From c75fdaf55cc7a8860d903fd6faaad878904947ab Mon Sep 17 00:00:00 2001 From: raclamusi Date: Mon, 6 Sep 2021 17:27:59 +0900 Subject: [PATCH 0001/3948] =?UTF-8?q?=E3=82=B5=E3=83=B3=E3=83=97=E3=83=AB?= =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E5=86=85=E3=81=AE=E3=82=B3=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=88=E3=82=92=E4=B8=80=E9=83=A8=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/new/op_new.md | 2 +- reference/new/op_new[].md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/new/op_new.md b/reference/new/op_new.md index fd34c58b72..95dff27738 100644 --- a/reference/new/op_new.md +++ b/reference/new/op_new.md @@ -131,7 +131,7 @@ int main() // (3) cl 型変数を動的に作成 // 確保失敗時にヌルポインタが返される cl* p2 = new (std::nothrow) cl(); - delete p2; // 配置 delete と言うものはないので、通常の delete 式で記憶域を解放する + delete p2; // 通常の delete 式で記憶域を解放する // (5) char 配列のスタック領域に、cl 型変数を動的に作成 // 領域のアライメントに注意 diff --git a/reference/new/op_new[].md b/reference/new/op_new[].md index 410c64c28f..17e774f84d 100644 --- a/reference/new/op_new[].md +++ b/reference/new/op_new[].md @@ -117,7 +117,7 @@ int main() // 32) 3 要素の cl 型配列を動的に作成 // 確保失敗時にヌルポインタが返される cl* p2 = new (std::nothrow) cl[3]; - delete[] p2; // 配置 delete と言うものはないので、通常の delete 式で記憶域を解放する + delete[] p2; // 通常の delete 式で記憶域を解放する // (5) char 配列のスタック領域に、3 要素の cl 型配列を動的に作成 // ただし、危険なため、使用してはいけない From 8cd61c6a88835035eb4f66e9e6281a83937e601d Mon Sep 17 00:00:00 2001 From: yumetodo Date: Wed, 11 Jan 2023 00:44:41 +0900 Subject: [PATCH 0002/3948] =?UTF-8?q?feat:=20P0588R1=E3=81=A7=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=E3=81=95=E3=82=8C=E3=81=9Fodr-usable=E3=81=AB?= =?UTF-8?q?=E3=81=A4=E3=81=84=E3=81=A6=E8=A8=98=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ref: - https://timsong-cpp.github.io/cppwp/n4861/basic.def.odr#9 - https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0588r1.html --- .../simplifying_implicit_lambda_capture.md | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/lang/cpp20/simplifying_implicit_lambda_capture.md b/lang/cpp20/simplifying_implicit_lambda_capture.md index 573ab11e03..b8cbbf1d8e 100644 --- a/lang/cpp20/simplifying_implicit_lambda_capture.md +++ b/lang/cpp20/simplifying_implicit_lambda_capture.md @@ -21,12 +21,31 @@ void f() { } ``` -構造化束縛で導入された名前はラムダ式でキャプチャできない、と明記された。しかしその後、「[構造化束縛を拡張して通常の変数宣言のように使用できるようにする](extending_structured_bindings_to_be_more_like_variable_declarations.md)」の仕様でそれが可能となったため、この仕様変更は打ち消された。 +本提案では一旦、構造化束縛で導入された名前はラムダ式でキャプチャできない、と明記された。その後、「[構造化束縛を拡張して通常の変数宣言のように使用できるようにする](extending_structured_bindings_to_be_more_like_variable_declarations.md)」の仕様でそれが可能となったため、この部分は打ち消された。 +## 仕様 + +odr-usable(=ある名前の定義がその場所で見つかるか)という用語を導入して、lamda式でキャプチャできるものの増加に対して、規格文面の整理が行われた。 + +ローカル変数のように、ローカルでodr-usedされる時に、その場所ではodr-usableでないとき、そのプログラムは適格ではない。 + +```cpp +void f(int n) { + [] { n = 1; }; // error: nが使われようとしているのはlambda式の中なので、odr-usableではない + struct A { + void f() { n = 2; } // error: nが使われようとしているのは関数定義スコープの中なので、odr-usableではない + }; + void g(int = n); // error: nが使われ用としているのはlambda式以外の関数引数スコープの中なので、odr-usableではない + [=](int k = n) {}; // error: n is not odr-usable due to being + // outside the block scope of the lambda-expression + [&] { [n]{ return n; }; }; // OK +} +``` ## 関連項目 - [C++17 構造化束縛](/lang/cpp17/structured_bindings.md) - [C++20 構造化束縛を拡張して通常の変数宣言のように使用できるようにする](extending_structured_bindings_to_be_more_like_variable_declarations.md) +- [C++20 構造化束縛した変数の参照キャプチャを許可](reference_capture_of_structured_bindings.md) ## 参照 - [P0588R1 Simplifying implicit lambda capture](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0588r1.html) From 768f0f229e6401538550aa58fa02c41714e48651 Mon Sep 17 00:00:00 2001 From: yumetodo Date: Wed, 11 Jan 2023 01:07:27 +0900 Subject: [PATCH 0003/3948] chore: fix typo --- lang/cpp20/simplifying_implicit_lambda_capture.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp20/simplifying_implicit_lambda_capture.md b/lang/cpp20/simplifying_implicit_lambda_capture.md index b8cbbf1d8e..08e716257b 100644 --- a/lang/cpp20/simplifying_implicit_lambda_capture.md +++ b/lang/cpp20/simplifying_implicit_lambda_capture.md @@ -35,7 +35,7 @@ void f(int n) { struct A { void f() { n = 2; } // error: nが使われようとしているのは関数定義スコープの中なので、odr-usableではない }; - void g(int = n); // error: nが使われ用としているのはlambda式以外の関数引数スコープの中なので、odr-usableではない + void g(int = n); // error: nが使われようとしているのはlambda式以外の関数引数スコープの中なので、odr-usableではない [=](int k = n) {}; // error: n is not odr-usable due to being // outside the block scope of the lambda-expression [&] { [n]{ return n; }; }; // OK From 66d4dc66d3f2259e546b1f7bc5591cf53bb8cc2c Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 11 Jan 2023 11:08:11 +0900 Subject: [PATCH 0004/3948] =?UTF-8?q?generator:=20=E3=82=AF=E3=83=A9?= =?UTF-8?q?=E3=82=B9=E3=83=A6=E3=83=BC=E3=82=B6=E8=A6=B3=E7=82=B9=E3=81=A7?= =?UTF-8?q?=E3=81=AE=E8=AA=AC=E6=98=8E=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/generator/generator.md | 65 +++++++++++++++++-- .../promise_type/get_return_object.md | 3 +- 2 files changed, 62 insertions(+), 6 deletions(-) diff --git a/reference/generator/generator.md b/reference/generator/generator.md index c7e1c9d10a..565e90fa13 100644 --- a/reference/generator/generator.md +++ b/reference/generator/generator.md @@ -22,8 +22,8 @@ namespace std { 戻り値型`generator`のコルーチン(以下、ジェネレータコルーチン)では`co_yield`式を用いて値を生成する。`co_yield` [`std::ranges::elements_of`](/reference/ranges/elements_of.md)`(rng)`式を用いると、ジェネレータコルーチンから入れ子Range(`rng`)の各要素を逐次生成する。 ジェネレータコルーチンでは`co_await`式を利用できない。 -ジェネレータコルーチンは遅延評価される。ジェネレータコルーチンが返す`generator`オブジェクトの利用側(以下、呼び出し側)で先頭要素[`begin`](generator/begin.md)を指す[イテレータ](generator/iterator.md)を間接参照するまで、ジェネレータコルーチンの本体処理は実行されない。 -呼び出し側がイテレータの間接参照を試みるとジェネレータコルーチンを再開(resume)し、ジェネレータコルーチン本体処理において`co_yield`式に到達すると生成値を保持して再び中断(suspend)する。呼び出し側ではイテレータの間接参照の結果として生成値を取得する。 +ジェネレータコルーチンは遅延評価される。ジェネレータコルーチンが返す`generator`オブジェクトを利用するコード(以下、ジェネレータ利用側)で先頭要素[`begin`](generator/begin.md)を指す[イテレータ](generator/iterator.md)を間接参照するまで、ジェネレータコルーチンの本体処理は実行されない。 +ジェネレータ利用側がイテレータの間接参照を試みるとジェネレータコルーチンを再開(resume)し、ジェネレータコルーチン本体処理において`co_yield`式に到達すると生成値を保持して再び中断(suspend)する。ジェネレータ利用側ではイテレータの間接参照の結果として生成値を取得する。 ### 説明用メンバ @@ -39,6 +39,61 @@ namespace std { - [`unique_ptr`](/reference/memory/unique_ptr.md)`<`[`stack`](/reference/stack/stack.md)`<`[`coroutine_handle<>`](/reference/coroutine/coroutine_handle.md)`>>`: アクティブスタック(`active_`) +### 第1テンプレートパラメータ`Ref`の概要 +`generator`クラステンプレートでは、テンプレートパラメータ`Ref`, `V`の組み合わせによってco_yieldオペランド型(`yielded`)やイテレータ間接参照の結果型(`reference`)や[イテレータの値型(`value_type`)](generator/iterator.md)を制御する。 + +第1パラメータ`Ref`以外は省略可能となっており、ほとんどのユースケース(提案文書によれば98%)では、テンプレートパラメータ`Ref`のみの明示指定で十分とされる。 +値型`T`を生成するジェネレータにおいて、第1テンプレートパラメータ`Ref`に応じて関連する型がそれぞれ導出される。 + +|`Ref`|co_yieldオペランド型|間接参照の結果型|イテレータの値型| +|-----|----|----|----| +|`T`
`T&&`|`T&&` と `const T&`|`T&&`|`T`| +|`T&`|`T&`|`T&`|`T`| +|`const T&`|`const T&`|`const T&`|`T`| + +ジェネレータそれ自身ではイテレータの値型を直接利用しない。ジェネレータ利用側でイテレータの`value_type`型にアクセスする特殊な追加処理を行う場合のみ、第2テンプレートパラメータ`V`の明示指定が必要とされる。 + + +### ジェネレータと値のコピー/ムーブ +`generator`クラステンプレートでは、その内部動作において最低限のコピー/ムーブ処理しか行わないよう設計されている。このため一定条件を満たせば、コピー不可でムーブのみ可能な型や、コピー/ムーブいずれも不可能な型の生成もサポートする。 + +値型`T`を生成するジェネレータにおいて、第1テンプレートパラメータ`Ref`とco_yield演算子オペランドに指定する式(左辺値/右辺値やconst修飾)に応じて、ジェネレータコルーチン最大1回のコピーが発生する。 +`Ref=T&`とした場合、co_yieldに右辺値を指定するとコンパイルエラーになる。 + +|`Ref`\co_yield式|左辺値|const左辺値|右辺値| +|-----|----|----|----| +|`T`
`T&&`|コピー 1回|コピー 1回|0回| +|`T&`|コピー 1回|コピー 1回|(不適格)| +|`const T&`|0回|0回|0回| + +またジェネレータ利用側においては、イテレータ間接参照結果を受ける変数の宣言型`X`との関係に応じて(例:[範囲for文](/lang/cpp11/range_based_for.md)の変数宣言型)、最大で1回のコピーまたはムーブが生じる。 +`Ref=T&`または`Ref=const T&`とした場合、右辺値参照型`T&&`には束縛できないためコンパイルエラーとなる。 + +|`Ref`\`X`|`T`|`T&&`|`const T&`| +|-----|----|----|----| +|`T`
`T&&`|ムーブ 1回|0回|0回| +|`T&`|コピー 1回|(不適格)|0回| +|`const T&`|コピー 1回|(不適格)|0回| + +ムーブのみ可能な型(例:[`std::unique_ptr`](/reference/memory/unique_ptr.md))では、上記表においてコピーが生じる組み合わせを避ければジェネレータより生成可能である。 +同様にコピー/ムーブいずれも不可能な型では、コピーまたはムーブが生じる組み合わせを避ければ生成可能である。 + + +### アロケータサポート +`generator`クラステンプレートの第3テンプレートパラメータ`Allocator`によって、[コルーチン・ステート](/lang/cpp20/coroutines.md)の動的メモリ確保に用いる静的アロケータ型を指定できる。省略時はデフォルトアロケータ[`allocator`](/reference/memory/allocator.md)が利用される。 + +またジェネレータコルーチン定義の引数リストに[`allocator_arg`](reference/memory/allocator_arg_t.md)タグ型に続いてアロケータオブジェクトを指定すると、ジェネレータの生成毎に異なるアロケータ利用を指定することもできる。 + +C++コンパイラによっては、ジェネレータコルーチンに関する動的メモリ確保・解放処理は最適化によって省略され(coroutine elision)、より効率的なコードが生成されることも期待できる。 + + +### ジェネレータのネスト +別の子ジェネレータコルーチンが返す`generator`もRangeとなっているため、ある親ジェネレータコルーチン内部で`co_yield` [`std::ranges::elements_of`](/reference/ranges/elements_of.md)構文を用いると、複数ジェネレータコルーチンのネスト構造をとることができる。 +子ジェネーレタコルーチンの遅延評価によって生成される値は、親ジェネレータコルーチンから生成されたかのように振る舞う。 + +`generator`クラス(厳密には[`generator::promise_type`](generator/promise_type.md))ではジェネレータコルーチンのネスト構造を検出し、[対称コルーチン](/lang/cpp20/coroutines.md)としてコルーチン間の実行フロー転送制御を効率的に行う。 + + ## 適格要件 - テンプレートパラメータ`Allocator`が`void`ではない場合、[`allocator_traits`](/reference/memory/allocator_traits.md)`::pointer`はポインタ型であること。 - 説明用のメンバ型`value`はCV修飾されないオブジェクト型であること。 @@ -70,7 +125,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |-----------------|-------------|-------| -| `yielded` | `co_yield`式の引数型(後述) | C++23 | +| `yielded` | `co_yield`演算子オペランド型(後述) | C++23 | | [`promise_type`](generator/promise_type.md) | ジェネレータコルーチンのPromise型 | C++23 | ``` cpp @@ -169,7 +224,7 @@ struct node { std::unique_ptr right = nullptr; }; -// 二分木を幅優先走査: 左(left)→自ノード→右(right) +// 二分木を走査: 左(left)→自ノード→右(right) std::generator traverse(const node& e) { if (e.left) { @@ -236,3 +291,5 @@ int main() ## 参照 - [P2502R2 `std::generator`: Synchronous Coroutine Generator for Ranges](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2502r2.pdf) +- [P0981R0 Halo: coroutine Heap Allocation eLision Optimization: the joint response](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0981r0.html) + - ジェネレータコルーチン実装において、動的メモリ確保が省略最適化される条件の議論。`std::generator`の設計に反映されている。 diff --git a/reference/generator/generator/promise_type/get_return_object.md b/reference/generator/generator/promise_type/get_return_object.md index ba9a6baec2..c41948ed96 100644 --- a/reference/generator/generator/promise_type/get_return_object.md +++ b/reference/generator/generator/promise_type/get_return_object.md @@ -12,12 +12,11 @@ generator get_return_object() noexcept; ## 概要 ジェネレータ[コルーチン](/lang/cpp20/coroutines.md)の戻り値オブジェクトを生成する。 -戻り値ジェネレータの[アクティブスタック](../../generator.md)を、空(empty)で初期化する。 プログラマが本関数を直接利用することは想定されていない。 ## 戻り値 -[`coroutine_handle`](/reference/coroutine/coroutine_handle.md)`::`[`from_promise`](/reference/coroutine/coroutine_handle/from_promise.md)`(*this)`で取得したコルーチンハンドルを保持する[`generator`](../../generator.md)オブジェクト。 +[`coroutine_handle`](/reference/coroutine/coroutine_handle.md)`::`[`from_promise`](/reference/coroutine/coroutine_handle/from_promise.md)`(*this)`で取得したコルーチンハンドルを保持し、[アクティブスタック](../../generator.md)を空(empty)で初期化した、[`generator`](../../generator.md)オブジェクト。 ## 例外 From df12b1d5f5725ef7c6ee40a770de935c3450af1c Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 11 Jan 2023 15:15:22 +0900 Subject: [PATCH 0005/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/generator/generator.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/generator/generator.md b/reference/generator/generator.md index 565e90fa13..4335cf0b25 100644 --- a/reference/generator/generator.md +++ b/reference/generator/generator.md @@ -82,7 +82,7 @@ namespace std { ### アロケータサポート `generator`クラステンプレートの第3テンプレートパラメータ`Allocator`によって、[コルーチン・ステート](/lang/cpp20/coroutines.md)の動的メモリ確保に用いる静的アロケータ型を指定できる。省略時はデフォルトアロケータ[`allocator`](/reference/memory/allocator.md)が利用される。 -またジェネレータコルーチン定義の引数リストに[`allocator_arg`](reference/memory/allocator_arg_t.md)タグ型に続いてアロケータオブジェクトを指定すると、ジェネレータの生成毎に異なるアロケータ利用を指定することもできる。 +またジェネレータコルーチン定義の引数リストに[`allocator_arg`](/reference/memory/allocator_arg_t.md)タグ型に続いてアロケータオブジェクトを指定すると、ジェネレータの生成毎に異なるアロケータ利用を指定することもできる。 C++コンパイラによっては、ジェネレータコルーチンに関する動的メモリ確保・解放処理は最適化によって省略され(coroutine elision)、より効率的なコードが生成されることも期待できる。 From 1f03563fee051b3135a3dd7ea79f14bd01b37ad3 Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 11 Jan 2023 17:17:16 +0900 Subject: [PATCH 0006/3948] =?UTF-8?q?coroutine:=20LWG3460=E3=82=92?= =?UTF-8?q?=E5=8F=8D=E6=98=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/coroutine/coroutine_handle.md | 14 ++++++++++++-- .../coroutine/coroutine_handle/from_promise.md | 4 ++++ reference/coroutine/coroutine_handle/promise.md | 4 ++++ reference/coroutine/noop_coroutine_handle.md | 14 ++++++++++---- 4 files changed, 30 insertions(+), 6 deletions(-) diff --git a/reference/coroutine/coroutine_handle.md b/reference/coroutine/coroutine_handle.md index 21c3dd67ab..da8306f0cf 100644 --- a/reference/coroutine/coroutine_handle.md +++ b/reference/coroutine/coroutine_handle.md @@ -15,7 +15,7 @@ namespace std { }; template - struct coroutine_handle : coroutine_handle<> { + struct coroutine_handle { // (メンバ宣言は省略) }; } @@ -30,7 +30,7 @@ namespace std { 例: 後述サンプルコードでは`task`クラス内に隠蔽されており、コルーチン`f`や関数`main`から間接的に利用される。 `coroutine_handle`または単に`coroutine_handle<>`は、Promise型について型消去(Type-erased)されたコルーチンハンドルとして取り扱える。 -コルーチンのPromise型を明示した`coroutine_handle`は型消去された`coroutine_handle<>`から公開派生されており、前者から後者への暗黙変換を行うことが可能となっている。 +コルーチンのPromise型を明示した`coroutine_handle`から`coroutine_handle<>`へと暗黙変換が可能となっている。 C++コルーチンとC API(コールバック関数へのポインタと`void*`をとる関数)との組合せ利用を可能とするため、`coroutine_handle`とポインタ型`void*`との相互変換がサポートされる。 @@ -51,6 +51,12 @@ C++コルーチンとC API(コールバック関数へのポインタと`void* |-----------------|----------------|----------------| | [`address`](coroutine_handle/address.md) | コルーチンハンドルに対応するアドレス値 | C++20 | +### 変換 + +| 名前 | 説明 | 対応バージョン | +|-----------------|---------------|----------------| +| `operator coroutine_handle<>` | 型消去されたコルーチンハンドルを返す | C++20 | + ### 観測 | 名前 | 説明 | 対応バージョン | @@ -188,3 +194,7 @@ result=42 ## 関連項目 - [C++20 コルーチン](/lang/cpp20/coroutines.md) + + +## 参照 +- [LWG3460 Unimplementable `noop_coroutine_handle` guarantees](https://cplusplus.github.io/LWG/issue3460) diff --git a/reference/coroutine/coroutine_handle/from_promise.md b/reference/coroutine/coroutine_handle/from_promise.md index 435c016ff1..6b8c9293e0 100644 --- a/reference/coroutine/coroutine_handle/from_promise.md +++ b/reference/coroutine/coroutine_handle/from_promise.md @@ -25,6 +25,10 @@ Promiseオブジェクトから対応するコルーチンハンドルを取得 [`addressof`](/reference/memory/addressof.md)`(h.`[`promise()`](promise.md)`) ==` [`addressof`](/reference/memory/addressof.md)`(p)` +## 備考 +型消去されたコルーチンハンドル`coroutine_handle<>`では、本メンバ関数は提供されない。 + + ## バージョン ### 言語 - C++20 diff --git a/reference/coroutine/coroutine_handle/promise.md b/reference/coroutine/coroutine_handle/promise.md index 2d36ee9b08..46057acdc4 100644 --- a/reference/coroutine/coroutine_handle/promise.md +++ b/reference/coroutine/coroutine_handle/promise.md @@ -21,6 +21,10 @@ Promise& promise() const; コルーチンのPromiseオブジェクトへの参照。 +## 備考 +型消去されたコルーチンハンドル`coroutine_handle<>`では、本メンバ関数は提供されない。 + + ## バージョン ### 言語 - C++20 diff --git a/reference/coroutine/noop_coroutine_handle.md b/reference/coroutine/noop_coroutine_handle.md index e9a3cdd3f0..074d574d3c 100644 --- a/reference/coroutine/noop_coroutine_handle.md +++ b/reference/coroutine/noop_coroutine_handle.md @@ -9,8 +9,10 @@ namespace std { struct noop_coroutine_promise {}; template<> - struct coroutine_handle : coroutine_handle<> + struct coroutine_handle { + constexpr operator coroutine_handle<>() const noexcept; + constexpr explicit operator bool() const noexcept; constexpr bool done() const noexcept; @@ -29,8 +31,7 @@ namespace std { using noop_coroutine_handle = coroutine_handle; } ``` -* coroutine_handle<>[link coroutine_handle.md] -* coroutine_handle[link coroutine_handle.md] +* coroutine_handle[link coroutine_handle.md] * unspecified[italic] @@ -41,6 +42,11 @@ namespace std { ## メンバ関数 +### 変換 +| 名前 | 説明 | 対応バージョン | +|-----------------|---------------|----------------| +| `operator coroutine_handle<>` | 型消去されたコルーチンハンドルを返す | C++20 | + ### 観測 | 名前 | 説明 | 対応バージョン | @@ -87,4 +93,4 @@ namespace std { ## 参照 - [P0913R1 Add symmetric coroutine control transfer](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0913r1.html) -- [LWG3460. Unimplementable noop_coroutine_handle guarantees](https://cplusplus.github.io/LWG/issue3460) +- [LWG3460 Unimplementable `noop_coroutine_handle` guarantees](https://cplusplus.github.io/LWG/issue3460) From f03abf873882732606460f6f65aaed739389d8d0 Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 11 Jan 2023 18:22:18 +0900 Subject: [PATCH 0007/3948] =?UTF-8?q?tuple/apply:=20P2517R1=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C(#1098)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/tuple/apply.md | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/reference/tuple/apply.md b/reference/tuple/apply.md index 6332df41c7..fdc9db56f0 100644 --- a/reference/tuple/apply.md +++ b/reference/tuple/apply.md @@ -7,7 +7,10 @@ ```cpp namespace std { template - constexpr decltype(auto) apply(F&& f, Tuple&& t); + constexpr decltype(auto) apply(F&& f, Tuple&& t); // C++20まで + + template + constexpr decltype(auto) apply(F&& f, Tuple&& t) noexcept(see below); // C++23から } ``` @@ -16,7 +19,7 @@ namespace std { ## 要件 -適用先の関数は[`Callable`](/reference/concepts/Callable.md)要件を満たす([INVOKE](/reference/concepts/Invoke.md)操作が可能)。展開されるものは、[`std::tuple`](../tuple.md)、[`std::array`](/reference/array/array.md)または[`std::pair`](/reference/utility/pair.md)のように、[`std::get`](/reference/array/array/get.md)と[`std::tuple_size`](/reference/array/array/tuple_size.md)をサポートする必要がある。 +適用先の関数は[`Callable`](/reference/concepts/Callable.md)要件を満たす([INVOKE](/reference/concepts/Invoke.md)操作が可能)。展開される`Tuple`型は[`std::tuple`](../tuple.md)に限定されず、[`std::array`](/reference/array/array.md)または[`std::pair`](/reference/utility/pair.md)のように、[`std::get`](/reference/array/array/get.md)と[`std::tuple_size`](/reference/array/array/tuple_size.md)をサポートする型であればよい。 ## 効果 @@ -28,6 +31,7 @@ constexpr decltype(auto) apply-impl(F&& f, Tuple&& t, std::index_sequence) return std::invoke(std::forward(f), std::get(std::forward(t))...); } ``` +* std::get[link tuple/get.md] * std::index_sequence[link /reference/utility/index_sequence.md] * std::invoke[link /reference/functional/invoke.md] * std::forward[link /reference/utility/forward.md] @@ -38,11 +42,17 @@ constexpr decltype(auto) apply-impl(F&& f, Tuple&& t, std::index_sequence) return apply-impl(std::forward(f), std::forward(t), std::make_index_sequence>>{}); ``` +* std::tuple_size_v[link tuple_size.md] * std::make_index_sequence[link /reference/utility/make_index_sequence.md] +* std::forward[link /reference/utility/forward.md] * std::remove_reference_t[link /reference/type_traits/remove_reference.md] ## 戻り値 -適用した関数の戻り値である。 +適用した関数呼び出しの戻り値 + + +## 例外 +C++23から : `I`をパラメータパック`0, 1, ..., (`[`tuple_size_v`](tuple_size.md)`<`[`remove_reference_t`](/reference/type_traits/remove_reference.md)`>-1)`としたとき、例外指定の式は次と等価 : `noexcept(`[`invoke`](/reference/functional/invoke.md)`(std::forward(f), get(std::forward(t))...))` ## 例 @@ -86,7 +96,7 @@ hello ## 関連項目 -- [make_from_tuple](../tuple/make_from_tuple.md) +- [`make_from_tuple`](make_from_tuple.md) - [`std::tuple`](../tuple.md) - [INVOKE](/reference/concepts/Invoke.md) @@ -98,3 +108,5 @@ hello - [P0220R0 Adopt Library Fundamentals TS for C++17](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0220r0.html) - [P0220R1 Adopt Library Fundamentals V1 TS Components for C++17 (R1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0220r1.html) - [C++1z タプルを展開して関数呼び出しするapply関数 - Faith and Brave - C++で遊ぼう](https://faithandbrave.hateblo.jp/entry/2016/08/18/184315) +- [P2517R1 Add a conditional `noexcept` specification to `std::apply`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2517r1.html) + - C++23から条件付きで`noexpcet`例外指定が行われる。 From 58e407c377e144d14665e1825e9b208767c443cc Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 12 Jan 2023 09:44:42 +0900 Subject: [PATCH 0008/3948] =?UTF-8?q?generator:=20=E6=A6=82=E8=A6=81?= =?UTF-8?q?=E8=AA=AC=E6=98=8E=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ジェネレータコルーチン再開(resume)タイミングとイテレータ間接参照の説明誤りを修正。 --- reference/generator/generator.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reference/generator/generator.md b/reference/generator/generator.md index 4335cf0b25..d49ca96d71 100644 --- a/reference/generator/generator.md +++ b/reference/generator/generator.md @@ -22,8 +22,10 @@ namespace std { 戻り値型`generator`のコルーチン(以下、ジェネレータコルーチン)では`co_yield`式を用いて値を生成する。`co_yield` [`std::ranges::elements_of`](/reference/ranges/elements_of.md)`(rng)`式を用いると、ジェネレータコルーチンから入れ子Range(`rng`)の各要素を逐次生成する。 ジェネレータコルーチンでは`co_await`式を利用できない。 -ジェネレータコルーチンは遅延評価される。ジェネレータコルーチンが返す`generator`オブジェクトを利用するコード(以下、ジェネレータ利用側)で先頭要素[`begin`](generator/begin.md)を指す[イテレータ](generator/iterator.md)を間接参照するまで、ジェネレータコルーチンの本体処理は実行されない。 -ジェネレータ利用側がイテレータの間接参照を試みるとジェネレータコルーチンを再開(resume)し、ジェネレータコルーチン本体処理において`co_yield`式に到達すると生成値を保持して再び中断(suspend)する。ジェネレータ利用側ではイテレータの間接参照の結果として生成値を取得する。 +ジェネレータコルーチンは遅延評価される。 +ジェネレータコルーチンが返す`generator`オブジェクトを利用するコード(以下、ジェネレータ利用側)において、先頭要素を指す[イテレータ](generator/iterator.md)を取得する([`begin`](generator/begin.md))、またはイテレータのインクリメント操作を行う(`operator++`)までジェネレータコルーチンは再開(resume)されない。 +ジェネレータコルーチン本体処理において`co_yield`式に到達すると、生成値を保持してから中断(suspend)しジェネレータ利用側へと制御を戻す。 +ジェネレータ利用側ではイテレータの間接参照(単項`operator*`)を行うことで、ジェネレータによる生成値を取得する。 ### 説明用メンバ From b66903af7aae0c27ac7f4bf5ea730cb11c731609 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 12 Jan 2023 12:00:19 +0900 Subject: [PATCH 0009/3948] apply : fix typo --- reference/tuple/apply.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/tuple/apply.md b/reference/tuple/apply.md index fdc9db56f0..f59d632a3f 100644 --- a/reference/tuple/apply.md +++ b/reference/tuple/apply.md @@ -109,4 +109,4 @@ hello - [P0220R1 Adopt Library Fundamentals V1 TS Components for C++17 (R1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0220r1.html) - [C++1z タプルを展開して関数呼び出しするapply関数 - Faith and Brave - C++で遊ぼう](https://faithandbrave.hateblo.jp/entry/2016/08/18/184315) - [P2517R1 Add a conditional `noexcept` specification to `std::apply`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2517r1.html) - - C++23から条件付きで`noexpcet`例外指定が行われる。 + - C++23から条件付きで`noexcept`例外指定が行われる。 From a73f34d4e7f371a8d311d7c539471422fbeebc90 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 12 Jan 2023 12:00:55 +0900 Subject: [PATCH 0010/3948] =?UTF-8?q?apply=20:=20=E3=82=AA=E3=83=BC?= =?UTF-8?q?=E3=83=90=E3=83=BC=E3=83=AD=E3=83=BC=E3=83=89=E3=81=AB=E7=95=AA?= =?UTF-8?q?=E5=8F=B7=E3=82=92=E3=81=A4=E3=81=91=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/tuple/apply.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reference/tuple/apply.md b/reference/tuple/apply.md index f59d632a3f..77d6e1845f 100644 --- a/reference/tuple/apply.md +++ b/reference/tuple/apply.md @@ -7,10 +7,12 @@ ```cpp namespace std { template - constexpr decltype(auto) apply(F&& f, Tuple&& t); // C++20まで + constexpr decltype(auto) + apply(F&& f, Tuple&& t); // (1) C++20 template - constexpr decltype(auto) apply(F&& f, Tuple&& t) noexcept(see below); // C++23から + constexpr decltype(auto) + apply(F&& f, Tuple&& t) noexcept(see below); // (1) C++23 } ``` From 85bebb584efb6141b4026ff231e7630aba3f4f27 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 12 Jan 2023 14:24:23 +0900 Subject: [PATCH 0011/3948] =?UTF-8?q?=E7=B7=A8=E9=9B=86=E8=80=85=E5=90=91?= =?UTF-8?q?=E3=81=91=E8=B3=87=E6=96=99=E3=82=92=E3=83=AA=E3=83=8D=E3=83=BC?= =?UTF-8?q?=E3=83=A0=E3=81=97=E3=80=81=E3=80=8Ccpprefjp=E3=82=92=E7=B7=A8?= =?UTF-8?q?=E9=9B=86=E3=81=99=E3=82=8B=E3=81=AB=E3=81=AF=E3=80=8D=E3=82=92?= =?UTF-8?q?=E3=82=B5=E3=82=A4=E3=83=89=E3=83=90=E3=83=BC=E3=81=AB=E8=A1=A8?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- index.md | 2 +- reference/random.md | 2 +- editors_doc/start_editing.md => start_editing.md | 16 ++++++++-------- {editors_doc => start_editing}/cite_note_ref.md | 0 .../class_template_page.md | 2 +- .../comparison_operator_template_page.md | 2 +- .../concept_template_page.md | 2 +- .../cpo_template_page.md | 2 +- .../function_template_page.md | 2 +- .../header_template_page.md | 2 +- .../lang_template_page.md | 2 +- .../module_template_page.md | 2 +- .../named_requirement_template_page.md | 2 +- {editors_doc => start_editing}/page_names.md | 0 {editors_doc => start_editing}/random_figure.md | 0 {editors_doc => start_editing}/specialized.md | 0 .../type-type_template_page.md | 2 +- 18 files changed, 21 insertions(+), 21 deletions(-) rename editors_doc/start_editing.md => start_editing.md (90%) rename {editors_doc => start_editing}/cite_note_ref.md (100%) rename {editors_doc => start_editing}/class_template_page.md (98%) rename {editors_doc => start_editing}/comparison_operator_template_page.md (98%) rename {editors_doc => start_editing}/concept_template_page.md (97%) rename {editors_doc => start_editing}/cpo_template_page.md (97%) rename {editors_doc => start_editing}/function_template_page.md (98%) rename {editors_doc => start_editing}/header_template_page.md (96%) rename {editors_doc => start_editing}/lang_template_page.md (96%) rename {editors_doc => start_editing}/module_template_page.md (95%) rename {editors_doc => start_editing}/named_requirement_template_page.md (96%) rename {editors_doc => start_editing}/page_names.md (100%) rename {editors_doc => start_editing}/random_figure.md (100%) rename {editors_doc => start_editing}/specialized.md (100%) rename {editors_doc => start_editing}/type-type_template_page.md (97%) diff --git a/README.md b/README.md index 540c273688..989b13c271 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ site cpprefjpへのコントリビュート方法や各ファイル編集方法については、以下のドキュメントを参照してください。 * [cpprefjpへのコントリビュート方法](CONTRIBUTING.md) -* [cpprefjpを編集するには](/editors_doc/start_editing.md) +* [cpprefjpを編集するには](start_editing.md) cpprefjpは、以下のコアメンバが運営を行っています。 diff --git a/index.md b/index.md index a9592d0a98..92cbc654dc 100644 --- a/index.md +++ b/index.md @@ -39,7 +39,7 @@ cpprefjp プロジェクトに参加する方法は簡単です。 本サイトの編集方法については、以下のドキュメントを参照してください。 -- [cpprefjpを編集するには](/editors_doc/start_editing.md) +- [cpprefjpを編集するには](/start_editing.md) 本サイトのコンテンツを作成、編集するにあたり、仕様を熟知し、一人で完璧に正しい内容を書くことは要求しません。 diff --git a/reference/random.md b/reference/random.md index 1a09db031e..3589ec9742 100644 --- a/reference/random.md +++ b/reference/random.md @@ -264,4 +264,4 @@ int main() ## 編集者向けの参照 -* [乱数分布の図を作る方法](/editors_doc/random_figure.md) +* [乱数分布の図を作る方法](/start_editing/random_figure.md) diff --git a/editors_doc/start_editing.md b/start_editing.md similarity index 90% rename from editors_doc/start_editing.md rename to start_editing.md index 0556516498..4ed0ab1fe7 100644 --- a/editors_doc/start_editing.md +++ b/start_editing.md @@ -52,13 +52,13 @@ Markdownの記述方法をわかりやすく解説してくれているWebサイ ただし、cpprefjp特有の拡張構文もあります。 以下のページにまとめてあるので、そちらを参照して下さい。 -* [cpprefjp特有の拡張構文](/editors_doc/specialized.md) +* [cpprefjp特有の拡張構文](/start_editing/specialized.md) Markdown形式では、HTMLのタグも併用できますが、cpprefjpサイトでは積極的にはHTMLタグを使用しない方針です。できるだけ、Markdown形式でできる範囲内で解決するようにしてください。 ただし、注釈・出典を貼るためにHTMLタグを利用します。 -* [cpprefjpにおける注釈・出典の貼り方](./cite_note_ref.md) +* [cpprefjpにおける注釈・出典の貼り方](/start_editing/cite_note_ref.md) それ以外に本サイト内で使用しているHTMLタグは以下です: @@ -71,10 +71,10 @@ Markdown形式では、HTMLのタグも併用できますが、cpprefjpサイト 新規リファレンスを書くにあたって、雛形ページを用意していますので、そちらをベースにして編集作業を行ってください。 -* [ヘッダファイルトップページの雛形](header_template_page.md) -* [関数の雛形](function_template_page.md) -* [クラスの雛形](class_template_page.md) -* [型の別名の雛形](type-type_template_page.md) +* [ヘッダファイルトップページの雛形](/start_editing/header_template_page.md) +* [関数の雛形](/start_editing/function_template_page.md) +* [クラスの雛形](/start_editing/class_template_page.md) +* [型の別名の雛形](/start_editing/type-type_template_page.md) また、リポジトリのトップディレクトリに`GLOBAL_QUALIFY_LIST.txt`というファイルがあります。サイト全体のコードブロックに対して適用したい識別子の修飾があれば、ここに列挙していきます。書き方は各雛形ページに書いてあるコードブロックの修飾と同じです。 @@ -88,8 +88,8 @@ Markdown形式では、HTMLのタグも併用できますが、cpprefjpサイト ## その他、cpprefjpを編集するにあたってのドキュメント -* [ページファイル名の付け方](/editors_doc/page_names.md) -* [乱数分布の図を作る方法](/editors_doc/random_figure.md) +* [ページファイル名の付け方](/start_editing/page_names.md) +* [乱数分布の図を作る方法](/start_editing/random_figure.md) ## 次期C++バージョンへの対応方針と作業方法 diff --git a/editors_doc/cite_note_ref.md b/start_editing/cite_note_ref.md similarity index 100% rename from editors_doc/cite_note_ref.md rename to start_editing/cite_note_ref.md diff --git a/editors_doc/class_template_page.md b/start_editing/class_template_page.md similarity index 98% rename from editors_doc/class_template_page.md rename to start_editing/class_template_page.md index f7aa3d96f2..e6c268aa80 100644 --- a/editors_doc/class_template_page.md +++ b/start_editing/class_template_page.md @@ -1,6 +1,6 @@ # page_title (1行目の見出し1はページのタイトルです。修飾なしで記載してください) -([cpprefjpを編集するには](start_editing.md) および [cpprefjp特有の拡張構文](specialized.md) を先に読んで下さい。) +([cpprefjpを編集するには](/start_editing.md) および [cpprefjp特有の拡張構文](specialized.md) を先に読んで下さい。) ( サンプルコードは文章中のどの部分で書いても大丈夫です。閲覧者の理解を助けるために必要だと感じたところで入れてください。 diff --git a/editors_doc/comparison_operator_template_page.md b/start_editing/comparison_operator_template_page.md similarity index 98% rename from editors_doc/comparison_operator_template_page.md rename to start_editing/comparison_operator_template_page.md index 2ea0c069b3..8dc4cbf996 100644 --- a/editors_doc/comparison_operator_template_page.md +++ b/start_editing/comparison_operator_template_page.md @@ -1,6 +1,6 @@ # page_title ((1行目の見出し1はページのタイトルです。修飾なしで記載してください) -([cpprefjpを編集するには](start_editing.md) および [cpprefjp特有の拡張構文](specialized.md) を先に読んで下さい。) +([cpprefjpを編集するには](/start_editing.md) および [cpprefjp特有の拡張構文](specialized.md) を先に読んで下さい。) ( サンプルコードは文章中のどの部分で書いても大丈夫です。閲覧者の理解を助けるために必要だと感じたところで入れてください。 diff --git a/editors_doc/concept_template_page.md b/start_editing/concept_template_page.md similarity index 97% rename from editors_doc/concept_template_page.md rename to start_editing/concept_template_page.md index 81c4127a7e..6d7dcbb557 100644 --- a/editors_doc/concept_template_page.md +++ b/start_editing/concept_template_page.md @@ -1,6 +1,6 @@ # page_title ((1行目の見出し1はページのタイトルです。修飾なしで記載してください) -([cpprefjpを編集するには](start_editing.md) および [cpprefjp特有の拡張構文](specialized.md) を先に読んで下さい。) +([cpprefjpを編集するには](/start_editing.md) および [cpprefjp特有の拡張構文](specialized.md) を先に読んで下さい。) ( サンプルコードは文章中のどの部分で書いても大丈夫です。閲覧者の理解を助けるために必要だと感じたところで入れてください。 diff --git a/editors_doc/cpo_template_page.md b/start_editing/cpo_template_page.md similarity index 97% rename from editors_doc/cpo_template_page.md rename to start_editing/cpo_template_page.md index 0f3adcb89b..f15e13d1da 100644 --- a/editors_doc/cpo_template_page.md +++ b/start_editing/cpo_template_page.md @@ -1,6 +1,6 @@ # page_title ((1行目の見出し1はページのタイトルです。修飾なしで記載してください) -([cpprefjpを編集するには](start_editing.md) および [cpprefjp特有の拡張構文](specialized.md) を先に読んで下さい。) +([cpprefjpを編集するには](/start_editing.md) および [cpprefjp特有の拡張構文](specialized.md) を先に読んで下さい。) ( サンプルコードは文章中のどの部分で書いても大丈夫です。閲覧者の理解を助けるために必要だと感じたところで入れてください。 diff --git a/editors_doc/function_template_page.md b/start_editing/function_template_page.md similarity index 98% rename from editors_doc/function_template_page.md rename to start_editing/function_template_page.md index 48939752fb..ab695a3b1f 100644 --- a/editors_doc/function_template_page.md +++ b/start_editing/function_template_page.md @@ -1,6 +1,6 @@ # page_title ((1行目の見出し1はページのタイトルです。修飾なしで記載してください) -([cpprefjpを編集するには](start_editing.md) および [cpprefjp特有の拡張構文](specialized.md) を先に読んで下さい。) +([cpprefjpを編集するには](/start_editing.md) および [cpprefjp特有の拡張構文](specialized.md) を先に読んで下さい。) ( サンプルコードは文章中のどの部分で書いても大丈夫です。閲覧者の理解を助けるために必要だと感じたところで入れてください。 diff --git a/editors_doc/header_template_page.md b/start_editing/header_template_page.md similarity index 96% rename from editors_doc/header_template_page.md rename to start_editing/header_template_page.md index 9086c91de2..5fb97a0497 100644 --- a/editors_doc/header_template_page.md +++ b/start_editing/header_template_page.md @@ -1,6 +1,6 @@ # page_title ((1行目の見出し1はページのタイトルです。修飾なしで記載してください) -([cpprefjpを編集するには](start_editing.md) および [cpprefjp特有の拡張構文](specialized.md) を先に読んで下さい。) +([cpprefjpを編集するには](/start_editing.md) および [cpprefjp特有の拡張構文](specialized.md) を先に読んで下さい。) ( サンプルコードは文章中のどの部分で書いても大丈夫です。閲覧者の理解を助けるために必要だと感じたところで入れてください。 diff --git a/editors_doc/lang_template_page.md b/start_editing/lang_template_page.md similarity index 96% rename from editors_doc/lang_template_page.md rename to start_editing/lang_template_page.md index f664982fb5..e66a017efa 100644 --- a/editors_doc/lang_template_page.md +++ b/start_editing/lang_template_page.md @@ -1,6 +1,6 @@ # page_title ((1行目の見出し1はページのタイトルです。修飾なしで記載してください) -([cpprefjpを編集するには](start_editing.md) および [cpprefjp特有の拡張構文](specialized.md) を先に読んで下さい。) +([cpprefjpを編集するには](/start_editing.md) および [cpprefjp特有の拡張構文](specialized.md) を先に読んで下さい。) ( サンプルコードは文章中のどの部分で書いても大丈夫です。閲覧者の理解を助けるために必要だと感じたところで入れてください。 diff --git a/editors_doc/module_template_page.md b/start_editing/module_template_page.md similarity index 95% rename from editors_doc/module_template_page.md rename to start_editing/module_template_page.md index 8dbf34b681..8c502466bd 100644 --- a/editors_doc/module_template_page.md +++ b/start_editing/module_template_page.md @@ -1,6 +1,6 @@ # page_title ((1行目の見出し1はページのタイトルです。修飾なしで記載してください) -([cpprefjpを編集するには](start_editing.md) および [cpprefjp特有の拡張構文](specialized.md) を先に読んで下さい。) +([cpprefjpを編集するには](/start_editing.md) および [cpprefjp特有の拡張構文](specialized.md) を先に読んで下さい。) ( サンプルコードは文章中のどの部分で書いても大丈夫です。閲覧者の理解を助けるために必要だと感じたところで入れてください。 diff --git a/editors_doc/named_requirement_template_page.md b/start_editing/named_requirement_template_page.md similarity index 96% rename from editors_doc/named_requirement_template_page.md rename to start_editing/named_requirement_template_page.md index ae02e46b81..46785553d0 100644 --- a/editors_doc/named_requirement_template_page.md +++ b/start_editing/named_requirement_template_page.md @@ -1,6 +1,6 @@ # page_title ((1行目の見出し1はページのタイトルです。修飾なしで記載してください) -([cpprefjpを編集するには](start_editing.md) および [cpprefjp特有の拡張構文](specialized.md) を先に読んで下さい。) +([cpprefjpを編集するには](/start_editing.md) および [cpprefjp特有の拡張構文](specialized.md) を先に読んで下さい。) ( サンプルコードは文章中のどの部分で書いても大丈夫です。閲覧者の理解を助けるために必要だと感じたところで入れてください。 diff --git a/editors_doc/page_names.md b/start_editing/page_names.md similarity index 100% rename from editors_doc/page_names.md rename to start_editing/page_names.md diff --git a/editors_doc/random_figure.md b/start_editing/random_figure.md similarity index 100% rename from editors_doc/random_figure.md rename to start_editing/random_figure.md diff --git a/editors_doc/specialized.md b/start_editing/specialized.md similarity index 100% rename from editors_doc/specialized.md rename to start_editing/specialized.md diff --git a/editors_doc/type-type_template_page.md b/start_editing/type-type_template_page.md similarity index 97% rename from editors_doc/type-type_template_page.md rename to start_editing/type-type_template_page.md index 73f3b4abad..f5bc4ae540 100644 --- a/editors_doc/type-type_template_page.md +++ b/start_editing/type-type_template_page.md @@ -1,6 +1,6 @@ # page_title ((1行目の見出し1はページのタイトルです。修飾なしで記載してください) -([cpprefjpを編集するには](start_editing.md) および [cpprefjp特有の拡張構文](specialized.md) を先に読んで下さい。) +([cpprefjpを編集するには](/start_editing.md) および [cpprefjp特有の拡張構文](specialized.md) を先に読んで下さい。) ( サンプルコードは文章中のどの部分で書いても大丈夫です。閲覧者の理解を助けるために必要だと感じたところで入れてください。 From eb4b7dd0cd8950815bd93ecb18fb56478d3c3879 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 12 Jan 2023 14:34:25 +0900 Subject: [PATCH 0012/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/thread/jthread/op_constructor.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/thread/jthread/op_constructor.md b/reference/thread/jthread/op_constructor.md index 950d054474..d8cb21af3e 100644 --- a/reference/thread/jthread/op_constructor.md +++ b/reference/thread/jthread/op_constructor.md @@ -84,7 +84,7 @@ jthread(jthread&&) noexcept; // (4) C++20 - [`get_stop_source()`](get_stop_source.md)で取得される[`std::stop_source`](/reference/stop_token/stop_source.md)オブジェクトの[`stop_possible()`](/reference/stop_token/stop_source/stop_possible.md)が`true`であること - `*this`は新しいスレッドと関連付けられること - (4) : - - `x.`[`get_id()`](get_id.md) `==` [`get_id()`](get_id)が`true`であること + - `x.`[`get_id()`](get_id.md) `==` [`get_id()`](get_id.md)が`true`であること - [`get_id()`](get_id.md)がムーブ前の`x.`[`get_id()`](get_id.md)の値であること - `x.`[`get_stop_source()`](get_stop_source.md)`.`[`stop_possible()`](/reference/stop_token/stop_source/stop_possible.md)が`false`であること From e3233e7dbb6729db10d737119c4a480238d0ae5f Mon Sep 17 00:00:00 2001 From: I <1091761+wx257osn2@users.noreply.github.com> Date: Thu, 12 Jan 2023 18:12:12 +0900 Subject: [PATCH 0013/3948] fix invalid name hiding --- reference/istream/basic_istream/read.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/istream/basic_istream/read.md b/reference/istream/basic_istream/read.md index 6a87e94e7c..829f0e1536 100644 --- a/reference/istream/basic_istream/read.md +++ b/reference/istream/basic_istream/read.md @@ -59,8 +59,8 @@ Shinjuku basic_istream& read(char_type* s, streamsize n) { iostate state = goodbit; try { - sentry s(*this, true); - if (s) { + const sentry sent(*this, true); + if (sent) { if (good()) { for (streamsize i = 0; i < n; ++i) { auto c = rdbuf()->sbumpc(); From 654c8795c2b0930f0f841f1fa227acd0b922733f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 13 Jan 2023 13:12:02 +0900 Subject: [PATCH 0014/3948] =?UTF-8?q?C++20=20:=20=E3=80=8C=E3=83=87?= =?UTF-8?q?=E3=83=95=E3=82=A9=E3=83=AB=E3=83=88=E3=81=AE=E3=82=B3=E3=83=94?= =?UTF-8?q?=E3=83=BC=E3=82=B3=E3=83=B3=E3=82=B9=E3=83=88=E3=83=A9=E3=82=AF?= =?UTF-8?q?=E3=82=BF=E3=81=A8=E9=9D=9Econst=E3=81=AA=E3=82=B3=E3=83=B3?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=83=A9=E3=82=AF=E3=82=BF=E3=81=8C=E8=A1=9D?= =?UTF-8?q?=E7=AA=81=E3=81=99=E3=82=8B=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E3=80=8D=E3=82=92=E8=BF=BD=E5=8A=A0=20(close=20#720)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp20.md | 2 +- ...ismatch_with_defaulted_copy_constructor.md | 41 +++++++++++++++++++ 3 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 lang/cpp20/resolving_const_mismatch_with_defaulted_copy_constructor.md diff --git a/implementation-status.md b/implementation-status.md index 1f84eb4d98..e64ce6a56f 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -181,7 +181,7 @@ | P0614R1: [初期化式をともなう範囲for文](/lang/cpp20/range-based_for_statements_with_initializer.md) | 範囲for文スコープで使用する変数の初期化のための構文を追加 | 9 | 8.0 | | 2019 Update 5 | | P0588R1: [暗黙のラムダキャプチャを簡略化](/lang/cpp20/simplifying_implicit_lambda_capture.md) | ラムダ式のキャプチャに関する仕様整理 | 8 | No | 2021.4 | 2019 Update 4 | | P0846R0: [関数テンプレートに明示的に型指定した場合にADLで見つからない問題を修正](/lang/cpp20/adl_and_function_templates_that_are_not_visible.md) | 名前空間内の関数テンプレートをテンプレート引数指定かつ非修飾・ADLで正しく呼び出せるよう修正 | 9 | 9.0 | 2021.4 | 2019 Update 1 | -| P0641R2: [デフォルトのコピーコンストラクタと非`const`なコンストラクタが衝突する問題を修正](/lang/cpp20/resolving_const_mismatch_with_defaulted_copy_constructor.md.nolink) | | 9 | 8.0 | 2021.4 | 2015 | +| P0641R2: [デフォルトのコピーコンストラクタと非`const`なコンストラクタが衝突する問題を修正](/lang/cpp20/resolving_const_mismatch_with_defaulted_copy_constructor.md) | 非`const`なオブジェクトをとるコンストラクタを定義すると、そのクラスをラップしたクラスのコピーコンストラクタが不適格になってしまう問題を修正 | 9 | 8.0 | 2021.4 | 2015 | | P0859R0: [評価されない文脈での定数式評価によって特殊メンバ関数がインスタンス化されることを規定](/lang/cpp20/less_eager_instantiation_of_constexpr_functions.md) | `sizeof`や`decltype`などの評価されない文脈において定数式評価を行った場合に、ムーブコンストラクタのような特殊メンバ関数が定義されることを規定 | 9 | 8 | | Partial in 2019 Update 7 | | P0515R3: [一貫比較](/lang/cpp20/consistent_comparison.md) | 三方比較演算子によって比較演算子の自動生成を行うようにする | 10 | 8.0 (partial) | 2021.4 | 2019 | | P0692R1: [特殊化のアクセスチェック](/lang/cpp20/access_checking_on_specializations.md) | | Yes | partial | 2021.4 | 2019 Update 6 | diff --git a/lang/cpp20.md b/lang/cpp20.md index cd33ace93f..03107560fe 100644 --- a/lang/cpp20.md +++ b/lang/cpp20.md @@ -15,7 +15,7 @@ C++20とは、2020年中に改訂され、ISO/IEC 14882:2020で標準規格化 | [ビットフィールドのメンバ変数初期化](cpp20/default_member_initializers_for_bit_fields.md) | ビットフィールドメンバ変数のデフォルト値を設定する構文を追加する | | [関数を条件付きで`explicit`にする構文を追加](cpp20/explicit_bool.md) | `explicit(true)`のように`explicit`に真理値パラメータを指定できるようにする | | [`const`修飾されたメンバポインタの制限を修正](cpp20/fixing_const_qualified_pointers_to_members.md) | `.*`演算子での左辺値の`const`メンバ関数呼び出しを許可する | -| [デフォルトのコピーコンストラクタと非`const`なコンストラクタが衝突する問題を修正](cpp20/resolving_const_mismatch_with_defaulted_copy_constructor.md.nolink) | | +| [デフォルトのコピーコンストラクタと非`const`なコンストラクタが衝突する問題を修正](cpp20/resolving_const_mismatch_with_defaulted_copy_constructor.md) | 非`const`なオブジェクトをとるコンストラクタを定義すると、そのクラスをラップしたクラスのコピーコンストラクタが不適格になってしまう問題を修正 | | [特殊化のアクセスチェック](cpp20/access_checking_on_specializations.md) | | | [空オブジェクトに対する最適化を支援する属性`[[no_unique_address]]`](cpp20/language_support_for_empty_objects.md) | `[[no_unique_address]]`属性を導入し、空の型のオブジェクトをほかのオブジェクトと共有する最適化を許可する | | [friend指定された関数内から構造化束縛を使用して非公開メンバ変数にアクセスすることを許可](cpp20/allow_structured_bindings_to_accessible_members.md) | 構造化束縛の仕様として公開メンバ変数のみを取り出せるようになっていたが、friend指定された関数からは非公開メンバ変数にもアクセスできるようにする | diff --git a/lang/cpp20/resolving_const_mismatch_with_defaulted_copy_constructor.md b/lang/cpp20/resolving_const_mismatch_with_defaulted_copy_constructor.md new file mode 100644 index 0000000000..3e7fc3e37e --- /dev/null +++ b/lang/cpp20/resolving_const_mismatch_with_defaulted_copy_constructor.md @@ -0,0 +1,41 @@ +# デフォルトのコピーコンストラクタと非constなコンストラクタが衝突する問題を修正 +* cpp20[meta cpp] + +## 概要 +C++17までは以下のように、自身の型の非`const`なオブジェクトをとるコンストラクタをもつクラスを定義し、 + +```cpp +struct MyType { + MyType(MyType&); // パラメータがconstではない +}; +``` + +そのクラスオブジェクトをメンバ変数としてもつクラスを定義し、コピーコンストラクタをデフォルト定義すると、プログラムは不適格となってしまう。 + +```cpp +template +struct Wrapper { + Wrapper(const Wrapper&) = default; + T t; +}; + +Wrapper var; // インスタンス化に失敗する +``` + +しかし、`Wrapper`をコピーしない限り、そのオブジェクトは使えるはずである。これはとくに[`std::tuple`](/reference/tuple/tuple.md)の実装で問題となる。 + +C++20では、このコードを適格とする。 + + +## 仕様 +- 明示的にデフォルト化された特殊メンバ関数のパラメータ型は、暗黙宣言された場合のパラメータ型と以下のように異なることを許可する: + - 参照修飾が異なる + - コピーコンストラクタとコピー代入演算子の場合、パラメータの型は「非`const`な`T`への参照」であってもかまわない +- それ以外の方法で型が異なる場合、以下のようになる: + - 特殊メンバ関数が代入演算子であり、戻り値の型が異なるか、パラメータの型が参照でない場合、 プログラムは不適格となる + - そうでない場合、その特殊メンバ関数が最初の宣言で明示的にデフォルト化されていれば、その関数は削除されたものとして定義される + - そうでない場合、プログラムは不適格となる + + +## 参照 +- [P0641R2 Resolving Core Issue #1331 (`const` mismatch with defaulted copy constructor)](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0641r2.html) From 2114ad7ea10a62fe8f32acaf49af047fe6996a1f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 13 Jan 2023 13:28:36 +0900 Subject: [PATCH 0015/3948] =?UTF-8?q?C++20=20:=20=E3=80=8C=E6=8A=BD?= =?UTF-8?q?=E8=B1=A1=E5=9E=8B=E3=81=AE=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF?= =?UTF-8?q?=E3=80=8D=E3=82=92=E8=BF=BD=E5=8A=A0=20(close=20#1105)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp20.md | 2 +- .../checking_for_abstract_class_types.md | 23 +++++++++++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 lang/cpp20/checking_for_abstract_class_types.md diff --git a/implementation-status.md b/implementation-status.md index e64ce6a56f..c50d9b2dfe 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -195,7 +195,7 @@ | P0634R3: [型の文脈で`typename`の省略を許可](/lang/cpp20/down_with_typename.md) | 型しか現れない文脈では、依存名を解決するための`typename`キーワードを省略できるようにする | 9 | 16 | 2021.4 (2021.6 は未対応) | 2019 Update 9 | | P0780R2: [ラムダ式の初期化キャプチャでのパック展開を許可](/lang/cpp20/allow_pack_expansion_in_lambda_init_capture.md) | `[...args = std::move(args)]`のようなキャプチャを許可 | 9
10 | 9.0 | | 2019 Update 2 | | P0479R5: [確率が高い分岐と低い分岐を伝える属性 `[[likely]]`, `[[unlikely]]`](/lang/cpp20/likely_and_unlikely_attributes.md) | 条件分岐の最適化ヒントを与える属性 | 9 (partial, `switch` 文のみ可能)
10 | 12.0 | | 2019 Update 6 | -| P0929R2: [抽象型のチェック](/lang/cpp20/checking_for_abstract_class_types.md.nolink) | 関数の宣言段階では、パラメータおよび戻り値型が抽象型かどうかをチェックしないようにする | 11 | | | 2019 Update 5 | +| P0929R2: [抽象型のチェック](/lang/cpp20/checking_for_abstract_class_types.md) | 関数の宣言段階では、パラメータおよび戻り値型が抽象型かどうかをチェックしないようにする | 11 | | | 2019 Update 5 | | P0732R2: [非型テンプレートパラメータとしてクラス型を許可する](/lang/cpp20/class_types_in_non-type_template_parameters.md) | 定数式として使用できる型を広く非型テンプレートパラメータとして使用できるようにする | 9 | partial | | 2019 Update 6 | | P0722R3: [可変長データを扱うクラスの効率的な`delete`](/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md.nolink) | クラスの`delete`演算子が呼び出される前にデストラクタが呼ばれないようにするオプションを追加 | 9 | 6.0 | | 2019 Update 7 | | P1064R0: [定数式からの仮想関数の呼び出しを許可](/lang/cpp20/allow_virtual_function_calls_in_constant_expressions.md) | 仮想関数に`constexpr`を付けられない制限を解除 | 9 | 9.0 | 2021.4 | 2019 Update 9 | diff --git a/lang/cpp20.md b/lang/cpp20.md index 03107560fe..07581197af 100644 --- a/lang/cpp20.md +++ b/lang/cpp20.md @@ -20,7 +20,7 @@ C++20とは、2020年中に改訂され、ISO/IEC 14882:2020で標準規格化 | [空オブジェクトに対する最適化を支援する属性`[[no_unique_address]]`](cpp20/language_support_for_empty_objects.md) | `[[no_unique_address]]`属性を導入し、空の型のオブジェクトをほかのオブジェクトと共有する最適化を許可する | | [friend指定された関数内から構造化束縛を使用して非公開メンバ変数にアクセスすることを許可](cpp20/allow_structured_bindings_to_accessible_members.md) | 構造化束縛の仕様として公開メンバ変数のみを取り出せるようになっていたが、friend指定された関数からは非公開メンバ変数にもアクセスできるようにする | | [構造化束縛がカスタマイゼーションポイントを見つけるルールを緩和](cpp20/relaxing_the_structured_bindings_customization_point_finding_rules.md) | 非テンプレートの`get()`メンバ関数が見つかった場合は、非メンバ関数の`get()`を探しにいく | -| [抽象型のチェック](cpp20/checking_for_abstract_class_types.md.nolink) | 関数の宣言段階では、パラメータおよび戻り値型が抽象型かどうかをチェックしないようにする | | | | | +| [抽象型のチェック](cpp20/checking_for_abstract_class_types.md) | 関数の宣言段階では、パラメータおよび戻り値型が抽象型かどうかをチェックしないようにする | | [可変長データを扱うクラスの効率的な`delete`](cpp20/efficient_sized_delete_for_variable_sized_classes.md.nolink) | クラスの`delete`演算子が呼び出される前にデストラクタが呼ばれないようにするオプションを追加 | | [条件付きで特殊メンバ関数をトリビアルに定義するように](cpp20/conditionally_trivial_special_member_functions.md.nolink) | 制約によってトリビアルな特殊メンバ関数と非トリビアルな特殊メンバ関数をオーバーロードできるようにする | diff --git a/lang/cpp20/checking_for_abstract_class_types.md b/lang/cpp20/checking_for_abstract_class_types.md new file mode 100644 index 0000000000..8c2193d9e0 --- /dev/null +++ b/lang/cpp20/checking_for_abstract_class_types.md @@ -0,0 +1,23 @@ +# 抽象型のチェック +* cpp20[meta cpp] + +## 概要 +C++17までは以下の仕様があったため、抽象クラスに早期の制限があった: + +> 抽象クラスは、パラメータ型、関数の戻り値型、明示的型変換の型として使用してはならない。抽象クラスへのポインタや参照は宣言できる。 + +しかし、先行宣言したクラスは、あとで定義が追加されるために、パラメータ型、関数の戻り値型、明示的型変換の型として使用できる。 + +``` +struct S; +S f(); // OK: 抽象性はここではチェックされない + +struct S { virtual void f() = 0; }; +S f(); // エラー!抽象クラスは関数の戻り値型として使用できない +``` + +C++20ではこれを適格とし、先行宣言と同様にクラスの完全性のチェックは、定義と呼び出しまで先送りすることとする。 + + +## 参照 +- [P0929R2 Checking for abstract class types](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0929r2.html) From d7ebdf4d7158da1a8b24fb289bfdf1256a86e654 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 13 Jan 2023 13:53:50 +0900 Subject: [PATCH 0016/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E3=83=96?= =?UTF-8?q?=E3=83=AD=E3=83=83=E3=82=AF=E3=81=ABC++=E6=8C=87=E5=AE=9A?= =?UTF-8?q?=E3=82=92=E5=BF=98=E3=82=8C=E3=81=A6=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp20/checking_for_abstract_class_types.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp20/checking_for_abstract_class_types.md b/lang/cpp20/checking_for_abstract_class_types.md index 8c2193d9e0..cf8b4f5727 100644 --- a/lang/cpp20/checking_for_abstract_class_types.md +++ b/lang/cpp20/checking_for_abstract_class_types.md @@ -8,7 +8,7 @@ C++17までは以下の仕様があったため、抽象クラスに早期の制 しかし、先行宣言したクラスは、あとで定義が追加されるために、パラメータ型、関数の戻り値型、明示的型変換の型として使用できる。 -``` +```cpp struct S; S f(); // OK: 抽象性はここではチェックされない From a01dfab45ae2c0c89c3462ab6ebbccfaa25e2fdd Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 13 Jan 2023 17:14:14 +0900 Subject: [PATCH 0017/3948] =?UTF-8?q?utility/exchange:=20P2401R0=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C(#1065)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/utility/exchange.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/reference/utility/exchange.md b/reference/utility/exchange.md index 23e6c4cc95..2a4a0f2ba1 100644 --- a/reference/utility/exchange.md +++ b/reference/utility/exchange.md @@ -7,10 +7,14 @@ ```cpp namespace std { template - T exchange(T& obj, U&& new_val); // C++14 + T exchange(T& obj, U&& new_val); // (1) C++14 template - constexpr T exchange(T& obj, U&& new_val); // C++20 + constexpr T exchange(T& obj, U&& new_val); // (1) C++20 + + template + constexpr T exchange(T& obj, U&& new_val) + noexcept(see below); // (1) C++23 } ``` @@ -36,6 +40,10 @@ return old_val; この関数を呼び出す前の、第1パラメータ`obj`の状態を返す。 +## 例外 +C++23から : 例外指定の式は次と等価 : [`is_nothrow_move_constructible_v](/reference/type_traits/is_nothrow_move_constructible.md)` &&` [`is_nothrow_assignable_v`](/reference/type_traits/is_nothrow_assignable.md)`` + + ## 備考 この関数は、[`std::atomic_exchange()`](/reference/atomic/atomic_exchange.md)関数の経験から導入された。 @@ -206,3 +214,4 @@ Hello 0x7ffc560ca4cc - [P0202R3 Add Constexpr Modifiers to Functions in `` and `` Headers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0202r3.html) - [`std::exchange` Patterns: Fast, Safe, Expressive, and Probably Underused](https://www.fluentcpp.com/2020/09/25/stdexchange-patterns-fast-safe-expressive-and-probably-underused/) - [`std::exchange`によるmoveしてリセットするイディオムの御紹介](https://onihusube.hatenablog.com/entry/2020/10/31/163244) +- [P2401R0 Add a conditional noexcept specification to std::exchange](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2401r0.html) \ No newline at end of file From b40b1a83eab6a27b8ed6b09af38212277074c214 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 13 Jan 2023 17:22:16 +0900 Subject: [PATCH 0018/3948] utility/exchange: fix markup --- reference/utility/exchange.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/utility/exchange.md b/reference/utility/exchange.md index 2a4a0f2ba1..9c103e5ed0 100644 --- a/reference/utility/exchange.md +++ b/reference/utility/exchange.md @@ -41,7 +41,7 @@ return old_val; ## 例外 -C++23から : 例外指定の式は次と等価 : [`is_nothrow_move_constructible_v](/reference/type_traits/is_nothrow_move_constructible.md)` &&` [`is_nothrow_assignable_v`](/reference/type_traits/is_nothrow_assignable.md)`` +C++23から : 例外指定の式は次と等価 : [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)` &&` [`is_nothrow_assignable_v`](/reference/type_traits/is_nothrow_assignable.md)`` ## 備考 From df3cf1576616ea59ff5b6f2e46c42aad9b88d734 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 13 Jan 2023 18:13:13 +0900 Subject: [PATCH 0019/3948] =?UTF-8?q?C++20=20:=20P0777R1=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/concepts/Invoke.md | 43 ++++++++++++++----- reference/optional/optional/op_constructor.md | 3 +- reference/tuple/apply.md | 13 +++++- reference/variant/variant/op_constructor.md | 9 ++-- 4 files changed, 53 insertions(+), 15 deletions(-) diff --git a/reference/concepts/Invoke.md b/reference/concepts/Invoke.md index d4643e4c0a..f90635bbd4 100644 --- a/reference/concepts/Invoke.md +++ b/reference/concepts/Invoke.md @@ -4,6 +4,11 @@ * named requirement[meta id-type] * [meta namespace] +C++における関数呼び出しという性質を抽象化しまとめた、仮想操作 *INVOKE* を定義する。 + +C++17からは、本仮想操作を実体化した[`invoke`](/reference/functional/invoke.md)関数テンプレートが提供される。 + + ## 用語定義 - *call-signature* とは、戻り値型に続けて丸括弧の中に0個以上の引数型を並べたものである。 *cf.* `int ( std::string, int )` - *callable-type* とは、関数呼び出し演算子を適用できる型 ( 関数、関数への参照、関数へのポインタ、`operator ()` をオーバーロードした型もしくはそれを(直接または間接的に) `public` 継承した型 ) もしくはメンバへのポインタ型を指す。 @@ -41,17 +46,35 @@ - それ以外の場合は、*INVOKE*`(f, t1, t2, ..., tN)` の実行結果の戻り値が型 `R` に暗黙的に変換されること。 3. すべての *call-wrapper* は、*MoveConstructible* でなければならない。 +## 要件(C++20) +1. 仮想操作 *INVOKE*`(f, t1, t2, ..., tN)` を次のように定義する。 + - `f` が型 `T` のメンバ関数へのポインタであり、[`is_baseof_v`](/reference/type_traits/is_base_of.md)`> == true`(`t1` が `T` または `T` を継承した型のオブジェクト/参照)であるとき、 `(t1.*f)(t2, ..., tN)` と同じ効果を持つ。 + - `f` が型 `T` のメンバ関数へのポインタであり、[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``が[`reference_wrapper`](/reference/functional/reference_wrapper.md)(`t1`が[`reference_wrapper`](/reference/functional/reference_wrapper.md)の特殊化)であるとき、 `(t1.get().*f)(t2, ..., tN)` と同じ効果を持つ。 + - `f` が型 `T` のメンバ関数へのポインタであり、 `t1` が上記の条件に当てはまらない場合(例えば、t1が`T`のポインタ)、`((*t1).*f)(t2, ..., tN)` と同じ効果を持つ。 + - `N == 1` で、`f` が型 `T` のメンバオブジェクトへのポインタであり、[`is_baseof_v`](/reference/type_traits/is_base_of.md)`> == true`(`t1` が `T` または `T` を継承した型のオブジェクト/参照)であるとき、 `t1.*f` と同じ効果を持つ。 + - `N == 1` で、`f` が型 `T` のメンバオブジェクトへのポインタであり、[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``が[`reference_wrapper`](/reference/functional/reference_wrapper.md)(`t1`が[`reference_wrapper`](/reference/functional/reference_wrapper.md)の特殊化)であるとき、 `t1.get().*f` と同じ効果を持つ。 + - `N == 1` で、`f` が型 `T` のメンバオブジェクトへのポインタであり、`t1` が上記の条件に当てはまらない場合(例えば、t1が`T`のポインタ)、 `(*t1).*f` と同じ効果を持つ。 + - 上記の条件のどれにも当てはまらない場合、 `f(t1, t2, ..., tN)` と同じ効果を持つ。 +2. *INVOKE*`(f, t1, t2, ..., tN)` を次のように定義する。 + - `R`が`void`かそのcv修飾の場合は、`static_cast(`*INVOKE*`(f, t1, t2, ..., tN))`。 + - それ以外の場合は、*INVOKE*`(f, t1, t2, ..., tN)` の実行結果の戻り値が型 `R` に暗黙的に変換されること。 +3. すべての *call-wrapper* は、*Cpp17MoveConstructible* かつ *Cpp17Destructible* でなければならない。 + + ## まとめ [第1引数がメンバ関数へのポインタの場合でも非静的メンバデータへのポインタの場合でも,第2引数がクラスオブジェクトへの参照の場合でもポインタの場合でもポインタっぽいものの場合でも,なんか知らんけどそれっぽく上手くいく](https://twitter.com/Cryolite/status/216814363221303296) ように取り計らった操作のことである。 ## 関連項目 -- [invoke](/reference/functional/invoke.md) -- [function](/reference/functional/function.md) -- [reference_wrapper](/reference/functional/reference_wrapper.md) -- [bind](/reference/functional/bind.md) -- [mem_fn](/reference/functional/mem_fn.md) -- [not_fn](/reference/functional/not_fn.md) -- [thread](/reference/thread/thread.md) -- [async](/reference/future/async.md) -- [packaged_task](/reference/future/packaged_task.md) -- [call_once](/reference/mutex/call_once.md) +- [`function`](/reference/functional/function.md) +- [`reference_wrapper`](/reference/functional/reference_wrapper.md) +- [`bind`](/reference/functional/bind.md) +- [`mem_fn`](/reference/functional/mem_fn.md) +- [`not_fn`](/reference/functional/not_fn.md) +- [`thread`](/reference/thread/thread.md) +- [`async`](/reference/future/async.md) +- [`packaged_task`](/reference/future/packaged_task.md) +- [`call_once`](/reference/mutex/call_once.md) + +## 参照 +- [P0777R1 Treating Unnecessary `decay`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0777r1.pdf) + - C++20から`decay_t`を`remove_cvref_t`へ変更。 diff --git a/reference/optional/optional/op_constructor.md b/reference/optional/optional/op_constructor.md index 3046ccd0ec..d584fdc657 100644 --- a/reference/optional/optional/op_constructor.md +++ b/reference/optional/optional/op_constructor.md @@ -221,6 +221,7 @@ int main() - [LWG Issue 2842. `in_place_t` check for `optional::optional(U&&)` should decay `U`](https://wg21.cmeerw.net/lwg/issue2842) - 説明の簡略化のため、このオーバーロードで`in_place_t`への言及は現在していない - [LWG Issue 2900. The copy and move constructors of `optional` are not `constexpr`](https://wg21.cmeerw.net/lwg/issue2900) +- [P0777R1 Treating Unnecessary `decay`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0777r1.pdf) - [P0892R2 `explicit(bool)`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0892r2.html) - C++20での`explicit(bool)`構文への対応 -- [P0602R4 `variant` and `optional` should propagate copy/move triviality](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0602r4.html) \ No newline at end of file +- [P0602R4 `variant` and `optional` should propagate copy/move triviality](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0602r4.html) diff --git a/reference/tuple/apply.md b/reference/tuple/apply.md index 77d6e1845f..ff0343f513 100644 --- a/reference/tuple/apply.md +++ b/reference/tuple/apply.md @@ -38,8 +38,17 @@ constexpr decltype(auto) apply-impl(F&& f, Tuple&& t, std::index_sequence) * std::invoke[link /reference/functional/invoke.md] * std::forward[link /reference/utility/forward.md] -次と等価である。 +C++17 : 次と等価である。 +```cpp +return apply-impl(std::forward(f), std::forward(t), + std::make_index_sequence>>{}); +``` +* std::tuple_size_v[link tuple_size.md] +* std::make_index_sequence[link /reference/utility/make_index_sequence.md] +* std::forward[link /reference/utility/forward.md] +* std::decay_t[link /reference/type_traits/decay.md] +C++20 : 次と等価である。 ```cpp return apply-impl(std::forward(f), std::forward(t), std::make_index_sequence>>{}); @@ -110,5 +119,7 @@ hello - [P0220R0 Adopt Library Fundamentals TS for C++17](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0220r0.html) - [P0220R1 Adopt Library Fundamentals V1 TS Components for C++17 (R1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0220r1.html) - [C++1z タプルを展開して関数呼び出しするapply関数 - Faith and Brave - C++で遊ぼう](https://faithandbrave.hateblo.jp/entry/2016/08/18/184315) +- [P0777R1 Treating Unnecessary `decay`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0777r1.pdf) + - C++20から効果説明の`decay_t`を`remove_cvref_t`へ変更。 - [P2517R1 Add a conditional `noexcept` specification to `std::apply`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2517r1.html) - C++23から条件付きで`noexcept`例外指定が行われる。 diff --git a/reference/variant/variant/op_constructor.md b/reference/variant/variant/op_constructor.md index a578926e87..38d1724d02 100644 --- a/reference/variant/variant/op_constructor.md +++ b/reference/variant/variant/op_constructor.md @@ -60,9 +60,10 @@ constexpr explicit variant(in_place_index_t, - (4) : - C++17 : ここで説明用に、`*this`が保持している型`Tj`と、そのインデックス値`j`を定義する。`Types...`の各型`Ti`に対して擬似的な関数`FUN(Ti)`を定義したとして、`FUN(`[`std::forward`](/reference/utility/forward.md)`(t))`呼び出しによって選択されたオーバーロードされた関数のパラメータ型を、構築してその後含まれる値の型を`Tj`とする - C++20 : ここで説明用に、`*this`が保持している型`Tj`と、そのインデックス値`j`を定義する。`Types...`の各型`Ti`を、縮小変換を受け付けない型であり (`Ti x[] = {`[`std::forward`](/reference/utility/forward.md)`(t)};`)、CV修飾付き`bool`の場合にCV修飾を外した`bool`型になるとして、その型に対して擬似的な関数`FUN(Ti)`を定義したとして、`FUN(`[`std::forward`](/reference/utility/forward.md)`(t))`呼び出しによって選択されたオーバーロードされた関数のパラメータ型を、構築してその後含まれる値の型を`Tj`とする - - [`is_same_v`](/reference/type_traits/is_same.md)`<`[`decay_t`](/reference/type_traits/decay.md)`, variant>`が`false`であること - - 型[`decay_t`](/reference/type_traits/decay.md)``が[`in_place_type_t`](/reference/utility/in_place_type_t.md)および[`in_place_index_t`](/reference/utility/in_place_index_t.md)の特殊化ではないこと - - [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true`であること + - C++17 : [`is_same_v`](/reference/type_traits/is_same.md)`<`[`decay_t`](/reference/type_traits/decay.md)`, variant>`が`false`であること + - C++20 : [`is_same_v`](/reference/type_traits/is_same.md)`<`[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`, variant>`が`false`であること + - C++17 : 型[`decay_t`](/reference/type_traits/decay.md)``が[`in_place_type_t`](/reference/utility/in_place_type_t.md)および[`in_place_index_t`](/reference/utility/in_place_index_t.md)の特殊化ではないこと + - C++20 : 型[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``が[`in_place_type_t`](/reference/utility/in_place_type_t.md)および[`in_place_index_t`](/reference/utility/in_place_index_t.md)の特殊化ではないこと - [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true`であること - 式`FUN(`[`std::forward`](/reference/utility/forward.md)`(x))`が適格であること - (5) : - `Types...`内に`T`が一度だけ現れること @@ -364,3 +365,5 @@ int main() - [LWG Issue 2901 Variants cannot properly support allocators](https://cplusplus.github.io/LWG/issue2901) - [P0608R3 A sane variant converting constructor](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0608r3.html) - [P0602R4 `variant` and `optional` should propagate copy/move triviality](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0602r4.html) +- [P0777R1 Treating Unnecessary `decay`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0777r1.pdf) + - C++20からテンプレートパラメータ制約の`decay_t`を`remove_cvref_t`へ変更。 From 5b0dfcbb75706d0b4219676187e0851178825d0d Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sat, 14 Jan 2023 04:32:58 +0900 Subject: [PATCH 0020/3948] =?UTF-8?q?=20C++23=E5=AF=BE=E5=BF=9C(?= =?UTF-8?q?=E3=83=98=E3=83=83=E3=83=80=E3=83=BC=E3=83=9A=E3=83=BC=E3=82=B8?= =?UTF-8?q?=E3=81=AE=E3=81=BF)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges.md | 55 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/reference/ranges.md b/reference/ranges.md index 347c3dc20b..855273b0fd 100644 --- a/reference/ranges.md +++ b/reference/ranges.md @@ -209,6 +209,13 @@ range | adaptor(args...) | [`views::all`](ranges/all.md) | Rangeへの参照として振る舞うビューを生成する (customization point object) | C++20 | | [`views::all_t`](ranges/all.md) | `all`の戻り値型 (alias template) | C++20 | +### as rvalue view + +| 名前 | 説明 | 対応バージョン | +|------------------------------------------------|--------------------------------------------------------------|----------------| +| [`as_rvalue_view`](ranges/as_rvalue_view.md.nolink) | 各要素をrvalueにするビュー (class template) | C++23 | +| [`views::as_rvalue`](ranges/as_rvalue.md.nolink) | `as_rvalue_view`を生成する (customization point object) | C++23 | + ### filter view | 名前 | 説明 | 対応バージョン | @@ -257,15 +264,25 @@ range | adaptor(args...) |-----------------------------------------------------|---------------------------------------------------------------------------------------------------|----------------| | [`join_view`](ranges/join_view.md) | ネストされたRangeを平坦にするビュー (class template) | C++20 | | [`views::join`](ranges/join_view.md) | ネストされたRangeを平坦にするビューを生成する (customization point object) | C++20 | + +### join with view + +| 名前 | 説明 | 対応バージョン | +|-----------------------------------------------------|---------------------------------------------------------------------------------------------------|----------------| | [`join_with_view`](ranges/join_with_view.md.nolink) | ネストされたRangeをデリミタで区切りながら平坦にするビュー (class template) | C++23 | | [`views::join_with`](ranges/join_with_view.md.nolink) | ネストされたRangeをデリミタで区切りながら平坦にするビューを生成する (customization point object) | C++23 | -### split view +### lazy split view | 名前 | 説明 | 対応バージョン | |-------------------------------------------------------|--------------------------------------------------------------|----------------| | [`lazy_split_view`](ranges/lazy_split_view.md) | Rangeを指定したデリミタで分割するビュー (class template) | C++20 | | [`views::lazy_split`](ranges/lazy_split_view.md) | `lazy_split_view`を生成する (customization point object) | C++20 | + +### split view + +| 名前 | 説明 | 対応バージョン | +|-------------------------------------------------------|--------------------------------------------------------------|----------------| | [`split_view`](ranges/split_view.md) | 文字列分割に特化した`lazy_split_view` (class template) | C++20 | | [`views::split`](ranges/split_view.md) | `split_view`を生成する (customization point object) | C++20 | @@ -289,6 +306,13 @@ range | adaptor(args...) | [`reverse_view`](ranges/reverse_view.md) | 逆順のビュー (class template) | C++20 | | [`views::reverse`](ranges/reverse_view.md) | 逆順のビューを生成する (customization point object) | C++20 | +### as const view + +| 名前 | 説明 | 対応バージョン | +|-----------------------------------------------|--------------------------------------------------------------|----------------| +| [`as_const_view`](ranges/as_const_view.md.nolink) | 各要素をconstにするビュー (class template) | C++23 | +| [`views::as_const`](ranges/as_const.md.nolink) | `as_const_view`を生成する (customization point object) | C++23 | + ### elements view | 名前 | 説明 | 対応バージョン | @@ -306,6 +330,11 @@ range | adaptor(args...) |--------------------------------------------------------|-------------------------------------------------------------------------------------|----------------| | [`zip_view`](ranges/zip_view.md.nolink) | 2つのシーケンスから値を1つずつ取り出した`tuple`のビュー (class template) | C++23 | | [`views::zip`](ranges/zip_view.md.nolink) | `zip_view`を生成する (customization point object) | C++23 | + +### zip transform view + +| 名前 | 説明 | 対応バージョン | +|--------------------------------------------------------|-------------------------------------------------------------------------------------|----------------| | [`zip_transform_view`](ranges/zip_transform_view.md.nolink) | 2つのシーケンスから値を1つずつ取り出し、関数を適用した結果のビュー (class template) | C++23 | | [`views::zip_transform`](ranges/zip_transform_view.md.nolink) | `zip_transform_view`を生成する (customization point object) | C++23 | @@ -315,6 +344,11 @@ range | adaptor(args...) |------------------------------------------------------------------|------------------------------------------------------------------------------------|----------------| | [`adjacent_view`](ranges/adjacent_view.md.nolink) | 各要素とそれに隣接する要素を指定個数ずつ取り出した`tuple`のビュー (class template) | C++23 | | [`views::adjacent`](ranges/adjacent_view.md.nolink) | `adjacent_view`を生成する (customization point object) | C++23 | + +### adjacent transform view + +| 名前 | 説明 | 対応バージョン | +|------------------------------------------------------------------|------------------------------------------------------------------------------------|----------------| | [`adjacent_transform_view`](ranges/adjacent_transform_view.md.nolink) | `adjacent_view`と同様に取り出し、関数を適用した結果のビュー (class template) | C++23 | | [`views::adjacent_transform`](ranges/adjacent_transform_view.md.nolink) | `adjacent_transform_view`を生成する (customization point object) | C++23 | @@ -324,6 +358,11 @@ range | adaptor(args...) |---------------------------------------------|--------------------------------------------------------------------|----------------| | [`chunk_view`](ranges/chunk_view.md.nolink) | シーケンスを指定個数で区切った`view`のシーケンス (class template) | C++23 | | [`views::chunk`](ranges/chunk_view.md.nolink) | `chunk_view`を生成する (customization point object) | C++23 | + +### chunk by view + +| 名前 | 説明 | 対応バージョン | +|---------------------------------------------|--------------------------------------------------------------------|----------------| | [`chunk_by_view`](ranges/chunk_by_view.md.nolink) | 2項述語が偽となる部分で区切った`view`のシーケンス (class template) | C++23 | | [`views::chunk_by`](ranges/chunk_by_view.md.nolink) | `chunk_by_view`を生成する (customization point object) | C++23 | @@ -334,6 +373,20 @@ range | adaptor(args...) | [`slide_view`](ranges/slide_view.md.nolink) | 各要素とそれに隣接する要素を指定個数ずつ見る`view`のシーケンス (class template) | C++23 | | [`views::slide`](ranges/slide_view.md.nolink) | `slide_view`を生成する (customization point object) | C++23 | +### stride view + +| 名前 | 説明 | 対応バージョン | +|------------------------------------------|-------------------------------------------------------|----------------| +| [`stride_view`](ranges/stride_view.md.nolink) | 要素を指定個数飛ばしに見るビュー (class template) | C++23 | +| [`views::stride`](ranges/stride_view.md.nolink) | `stride_view`を生成する (customization point object) | C++23 | + +### cartesian product view + +| 名前 | 説明 | 対応バージョン | +|---------------------------------------------------------------|------------------------------------------------------------------|----------------| +| [`cartesian_product_view`](ranges/cartesian_product_view.md.nolink) | シーケンスの直積集合のビュー (class template) | C++23 | +| [`views::cartesian_product`](ranges/cartesian_product.md.nolink) | `cartesian_product_view`を生成する (customization point object) | C++23 | + ## Range変換 From 3918a5059050dd68afaf130f76fb2f345105f576 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sat, 14 Jan 2023 20:46:28 +0900 Subject: [PATCH 0021/3948] =?UTF-8?q?CONTRIBUTING=E3=81=A8start=5Fediting?= =?UTF-8?q?=E3=81=8C=E9=87=8D=E8=A4=87=E3=81=97=E3=81=A6=E3=81=84=E3=81=9F?= =?UTF-8?q?=E3=81=AE=E3=81=A7=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CONTRIBUTINGをedit_policy (編集方針) にリネームし、サイドバーに追加 --- CONTRIBUTING.md | 82 ------------------------------------------------ edit_policy.md | 39 +++++++++++++++++++++++ start_editing.md | 38 +++++++++++++++++++++- 3 files changed, 76 insertions(+), 83 deletions(-) delete mode 100644 CONTRIBUTING.md create mode 100644 edit_policy.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index e3053d3ad7..0000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,82 +0,0 @@ -# cpprefjpへのコントリビュート方法 -本リポジトリは、C++の日本語リファレンスサイト[cpprefjp](https://cpprefjp.github.io/)のコンテンツを扱っています。私たちは、本サイトを一緒に編集していただける方を歓迎いたします。 - -ここでは、本サイトおよびそのMarkdownテキストを扱う本リポジトリを編集するにあたってのガイドラインをまとめます。 - -## できる限り全てのコンテンツにひとつ以上のサンプルコードを付ける -本サイトが提供するコンテンツは、全ての関数、全てのクラスにひとつ以上のサンプルコードを提供することを目標としています。これによって、ユーザーがその機能をどのように使えばよいのかの道を示せるようにし、その機能をどのような用途で使えるかを示せるようにします。 - - -## 正確なものに不要な情報はない -本サイトが提供するコンテンツは、編集者間での合意がとれるものである限りにおいて、「提供しなくてよい情報」というものはないと考えています。情報を書きすぎてはいけないということはありませんので、情報不足と思われる場所を見つけたら、現在の本サイトのスコープに収まる限りは追記していただいてかまいません。 - -スコープを超えるコンテンツを提供したい場合には、pull requestかissueを発行して、合意をとってください。 - - -## 本サイトは翻訳サイトではない -本サイトは、C++の規格書や他のリファレンスサイトの翻訳を提供するサイトではありません。本サイトのコンテンツは、仕様を理解した編集者が自分たちなりの言葉でC++機能の解説を書き、提供します。 - - -## ほかの人が書いたコンテンツの編集方法 -本サイトには、多くの方がコンテンツを提供しています。そのため、ほかの人が書いたコンテンツを編集することも少なくありません。編集者間での考え方の違いによるトラブルを防止するために、ほかの人が書いたコンテンツを編集する際は、以下のフローで修正の仕方を検討していただければと思います: - -1. 修正方針がわからない・複数考えられるが決めかねるようならissueを作って確認をとる -2. 修正はできるが、修正内容について修正者以外の合意・確認が必要そうならpull requestを作る -3. 元の記事を書いた人に伝えておきたいだけなら、事前にコメントを飛ばしたうえで直接修正する -4. 1.〜3.のようなことが何もなければ直接修正してかまわない。ただし、修正の理由や根拠は、修正内容かコミットメッセージのどちらかでフォローしておいたほうがよい - -なお、「ほかの人が書いたコンテンツ」には、本サイトの方針も含まれます。方針の改訂を提案する場合にも、上記フローでお願いします。 - - -## 本サイトのスコープを超えるコンテンツを書くには -本サイトでは多くのコンテンツを提供していますが、考えられる限り全ての情報を記載しているわけではありません。現在の本サイトが提供している範囲を超えるコンテンツを提供したい場合には、issueもしくはpull requestを作って合意をとってください。 - - -## 困ったことがあったらissueで相談 -本サイトの編集にあたって、編集者間の相談にはissueを使用してください。編集者間で直接やりとりしていただいてもかまいませんが、本サイトの記録として残したほうがよいやりとりであると判断した場合には、そのやりとりを本リポジトリのissueに貼り付けたり、リンクを貼ったりしていただければと思います。 - -ただし、編集者間の合意が必要あるものは、編集者間の直接のやりとりではなく、必ず本リポジトリのissueかpull requestで相談してください。オープンに議論できるものについては、管理者も同様です。 - - -## 本サイトのタスクを確認するには -本サイトで書くことが決まっているタスクを確認するには、issueを参照してください。「TASK」ラベルが付いているもので、担当者がついていないものがあれば、ぜひとも引き取ってください。 - - -## Pull Requestのレビューとマージ -push権限を持っている方は、Pull Requestのレビューとマージもぜひお願いします。 - -Pull Requestを送っていただいた方には、管理者から後ほどpush権限をお渡しします。権限の譲渡は管理者がする必要がありますが、レビューとマージは、ほかのpush権限保持者がしていただいてかまいません。 - -Pull Requestのレビューが滞っていた場合、Pull Requestの提出者の方は、cpprefjpのpush権限保持者に対して、個人的にレビューを依頼してもかまいません。push権限保持者がだれかは、以下のページから確認できます: - -- [cpprefjp people](https://github.com/orgs/cpprefjp/people) - - 権限保持者の確認に使用できます -- [cpprefjp contributors](https://github.com/cpprefjp/site/graphs/contributors) - - 各人が本サイトにどれくらいコントリビュートしているかを確認できます - -ただし可能な限り、レビュアーとの技術的な議論はPull Request上で行っていただけると助かります。これは、議論を記録として残すことが目的です。 - - -## Git関係のルール -- コミットメッセージに厳密な書式は設けない - - 人によっては「〜を修正」のように書き、またある人は「fix ...」のように書きます。コミットメッセージは修正内容がわかることが大事で、書式はそれほど重要ではないという考えです - - また、本リポジトリが、英語の情報を元に日本語情報を提供する、という特性上、コミットメッセージが日本語と英語どちらであっても編集者が困ることはないはずですので、日本語か英語であれば、どちらで書いてもよいものとします - - コミットメッセージの内容としては、とくに自分以外の人が書いた文章を編集する際には、コミットメッセージに「なぜそのように編集したのか」をできるだけ書いたほうがよいです。これは、経緯を振り返りやすくすることが目的です -- 強制プッシュ - - `git push -f`や`git push --force`といったコマンドは、リポジトリの設定で、masterブランチに対してはできないようにしてあります。これは、masterブランチは壊してはならないという理由によるものです - - masterブランチ以外には強制プッシュできますので、Pull Request用のトピックブランチのコミットを整理する、といった目的などで使用していただいて大丈夫です -- 署名付きコミット - - GPGによって署名が付いたコミットをすると、GitHub上でコミットに「Verified」と表示されます。このようなコミットがあると、リポジトリの信頼度が向上するため、強制ではありませんが署名を付加することを推奨します - - -## CI関係のルール -- cpprefjpでは、GitHub Actionsを使用して、コミットされるたびにMarkdown形式からHTML形式に変換して、GitHub Pagesとしてデプロイを行っています - - その変換時になんらかのエラーが発生した場合には、手元で修正して再度git pushを行うことになります - - 変換エラーではなく、GitHub Pagesリポジトリへのgit pushに失敗した場合 (buildアクションの実行中に新たなコミットがgit pushされた場合など) には、そのbuildアクションに対してRe-run jobを実行し、再度変換を行ってください - - -## push権限を持っていない人向け -push権限を持っていない方は、pull requestで何らかの編集を行うところからはじめてください。タスクを引き取っていただける場合には、タスクのissueに「やります」とコメントを書いていただければ、担当をお渡しします。 - -管理者からpush権限をお渡しする申請が届いた場合には、引き受けていただけると幸いです。 - diff --git a/edit_policy.md b/edit_policy.md new file mode 100644 index 0000000000..688e7774cb --- /dev/null +++ b/edit_policy.md @@ -0,0 +1,39 @@ +# 編集方針 +ここでは、本サイトを編集するにあたっての方針をまとめます。 + +## できる限り全てのコンテンツにひとつ以上のサンプルコードを付ける +本サイトが提供するコンテンツは、全ての関数、全てのクラスにひとつ以上のサンプルコードを提供することを目標としています。これによって、ユーザーがその機能をどのように使えばよいのかの道を示せるようにし、その機能をどのような用途で使えるかを示せるようにします。 + + +## 正確なものに不要な情報はない +本サイトが提供するコンテンツは、編集者間での合意がとれるものである限りにおいて、「提供しなくてよい情報」というものはないと考えています。情報を書きすぎてはいけないということはありませんので、情報不足と思われる場所を見つけたら、現在の本サイトのスコープに収まる限りは追記していただいてかまいません。 + +スコープを超えるコンテンツを提供したい場合には、pull requestかissueを発行して、合意をとってください。 + + +## 本サイトは翻訳サイトではない +本サイトは、C++の規格書や他のリファレンスサイトの翻訳を提供するサイトではありません。本サイトのコンテンツは、仕様を理解した編集者が自分たちなりの言葉でC++機能の解説を書き、提供します。 + + +## ほかの人が書いたコンテンツの編集方法 +本サイトには、多くの方がコンテンツを提供しています。そのため、ほかの人が書いたコンテンツを編集することも少なくありません。編集者間での考え方の違いによるトラブルを防止するために、ほかの人が書いたコンテンツを編集する際は、以下のフローで修正の仕方を検討していただければと思います: + +1. 修正方針がわからない・複数考えられるが決めかねるようならissueを作って確認をとる +2. 修正はできるが、修正内容について修正者以外の合意・確認が必要そうならpull requestを作る +3. 元の記事を書いた人に伝えておきたいだけなら、事前にコメントを飛ばしたうえで直接修正する +4. 1.〜3.のようなことが何もなければ直接修正してかまわない。ただし、修正の理由や根拠は、修正内容かコミットメッセージのどちらかでフォローしておいたほうがよい + +なお、「ほかの人が書いたコンテンツ」には、本サイトの方針も含まれます。方針の改訂を提案する場合にも、上記フローでお願いします。 + + +## 本サイトのスコープを超えるコンテンツを書くには +本サイトでは多くのコンテンツを提供していますが、考えられる限り全ての情報を記載しているわけではありません。現在の本サイトが提供している範囲を超えるコンテンツを提供したい場合には、issueもしくはpull requestを作って合意をとってください。 + + +## 困ったことがあったらissueで相談 +本サイトの編集にあたって、編集者間の相談にはissueを使用してください。編集者間で直接やりとりしていただいてもかまいませんが、本サイトの記録として残したほうがよいやりとりであると判断した場合には、そのやりとりを本リポジトリのissueに貼り付けたり、リンクを貼ったりしていただければと思います。 + +ただし、編集者間の合意が必要あるものは、編集者間の直接のやりとりではなく、必ず本リポジトリのissueかpull requestで相談してください。オープンに議論できるものについては、管理者も同様です。 + + + diff --git a/start_editing.md b/start_editing.md index 4ed0ab1fe7..c9451680d6 100644 --- a/start_editing.md +++ b/start_editing.md @@ -13,7 +13,7 @@ cpprefjpサイトのGitHubリポジトリは、以下になります: ## GitHubからcpprefjpサイトへの自動反映 -GitHub上で記述したMarkdown(.md)形式のリファレンスは、自動的にHTMLに変換されて、cpprefjpサイトに反映されます。 +GitHub上で記述したMarkdown(.md)形式のリファレンスは、GitHub Actionsによって自動的にHTMLに変換されて、cpprefjpサイトに反映されます。 ### 反映間隔 @@ -25,6 +25,9 @@ cpprefjp/site へ push すると、すぐに反映されます。 ### 変換エラーの検出 +変換時になんらかのエラーが発生した場合には、GitHub Actionsが失敗します。その場合、手元で修正して再度git pushを行うことになります + +変換エラーではなく、GitHub Pagesリポジトリへのgit pushに失敗した場合 (buildアクションの実行中に新たなコミットがgit pushされた場合など) には、そのbuildアクションに対してRe-run jobを実行し、再度変換を行ってください ### 自動反映ツール 自動反映ツールも、GitHub上で開発が進められています。 @@ -33,11 +36,16 @@ cpprefjp/site へ push すると、すぐに反映されます。 機能要望やpull request等がありましたら、こちらにお願いします。 + ## 編集権限を得るには +push権限を持っていない方は、pull requestで何らかの編集を行うところからはじめてください。タスクを引き取っていただける場合には、タスクのissueに「やります」とコメントを書いていただければ、担当をお渡しします。 + 本サイトに対してpull requestを提出していただければ、取り込んだあとに管理者から編集権限をお渡しします。 pull requestに慣れていない場合には、issueでの相談からはじめていただければと思います。 +管理者からpush権限をお渡しする申請が届いた場合には、引き受けていただけると幸いです。 + ## Markdown形式による編集方法 cpprefjpサイトは、Markdown(.md)形式でリファレンスを記述します。 @@ -102,3 +110,31 @@ C++の次のバージョンで入ることが決まった機能については - 次のC++バージョンに採択された機能は、本リポジトリのWikiページに随時記載しているので、対応状況を含めてそちらを確認すること +## 本サイトのタスクを確認するには +本サイトで書くことが決まっているタスクを確認するには、issueを参照してください。「TASK」ラベルが付いているもので、担当者がついていないものがあれば、ぜひとも引き取ってください。 + + +## Pull Requestのレビューとマージ +push権限を持っている方は、Pull Requestのレビューとマージもぜひお願いします。 + +Pull Requestを送っていただいた方には、管理者から後ほどpush権限をお渡しします。権限の譲渡は管理者がする必要がありますが、レビューとマージは、ほかのpush権限保持者がしていただいてかまいません。 + +Pull Requestのレビューが滞っていた場合、Pull Requestの提出者の方は、cpprefjpのpush権限保持者に対して、個人的にレビューを依頼してもかまいません。push権限保持者がだれかは、以下のページから確認できます: + +- [cpprefjp people](https://github.com/orgs/cpprefjp/people) + - 権限保持者の確認に使用できます +- [cpprefjp contributors](https://github.com/cpprefjp/site/graphs/contributors) + - 各人が本サイトにどれくらいコントリビュートしているかを確認できます + +ただし可能な限り、レビュアーとの技術的な議論はPull Request上で行っていただけると助かります。これは、議論を記録として残すことが目的です。 + + +## Git関係のルール +- コミットメッセージに厳密な書式は設けない + - 人によっては「〜を修正」のように書き、またある人は「fix ...」のように書きます。コミットメッセージは修正内容がわかることが大事で、書式はそれほど重要ではないという考えです + - また、本リポジトリが、英語の情報を元に日本語情報を提供する、という特性上、コミットメッセージが日本語と英語どちらであっても編集者が困ることはないはずですので、日本語か英語であれば、どちらで書いてもよいものとします + - コミットメッセージの内容としては、とくに自分以外の人が書いた文章を編集する際には、コミットメッセージに「なぜそのように編集したのか」をできるだけ書いたほうがよいです。これは、経緯を振り返りやすくすることが目的です +- 強制プッシュ + - `git push -f`や`git push --force`といったコマンドは、リポジトリの設定で、masterブランチに対してはできないようにしてあります。これは、masterブランチは壊してはならないという理由によるものです + - masterブランチ以外には強制プッシュできますので、Pull Request用のトピックブランチのコミットを整理する、といった目的などで使用していただいて大丈夫です + From 172d284725939b57df8a53fc1c6d6927cc546bf7 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sat, 14 Jan 2023 20:56:50 +0900 Subject: [PATCH 0022/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 989b13c271..d6e75637d0 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,8 @@ site cpprefjpへのコントリビュート方法や各ファイル編集方法については、以下のドキュメントを参照してください。 -* [cpprefjpへのコントリビュート方法](CONTRIBUTING.md) * [cpprefjpを編集するには](start_editing.md) +* [編集方針](edit_policy.md) cpprefjpは、以下のコアメンバが運営を行っています。 From 03178a714b1bb037194554a0ce91395cd3536e16 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 16 Jan 2023 16:48:48 +0900 Subject: [PATCH 0023/3948] =?UTF-8?q?C++23=20:=20std::format=E3=81=AERange?= =?UTF-8?q?=E3=80=81=E3=82=BF=E3=83=97=E3=83=AB=E3=81=AE=E5=87=BA=E5=8A=9B?= =?UTF-8?q?=E3=82=92=E4=BE=8B=E7=A4=BA=20#1085?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lang/cpp23.md b/lang/cpp23.md index a1b7451823..c41b7292bf 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -168,7 +168,13 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 - `std::string s = nullptr;`のような文字列オブジェクトに`nullptr`を代入するようなコードはバグの元であるため、[`std::basic_string`](/reference/string/basic_string.md)と[`std::basic_string_view`](/reference/string_view/basic_string_view.md)に、[`nullptr_t`](/reference/cstddef/nullptr_t.md)をとるコンストラクタをdelete定義として追加 - [`std::basic_string`](/reference/string/basic_string.md)クラスに、resize時に任意の初期化を行う[`resize_and_overwrite()`](/reference/string/basic_string/resize_and_overwrite.md.nolink)メンバ関数を追加 - [`std::basic_string`](/reference/string/basic_string.md)クラスのコンストラクタと[`substr()`](/reference/string/basic_string/substr.md)メンバ関数に一時オブジェクトのオーバーロードを追加 -- [`std::format()`](/reference/format/format.md)関数でコンテナ、[`std::tuple`](/reference/tuple/tuple.md)、[`std::pair`](/reference/utility/pair.md)を出力できるよう、[`std::formatter`](/reference/format/formatter.md)に特殊化を追加 +- [`std::format()`](/reference/format/format.md)関数でRange・コンテナ、[`std::tuple`](/reference/tuple/tuple.md)、[`std::pair`](/reference/utility/pair.md)を出力できるよう、[`std::formatter`](/reference/format/formatter.md)に特殊化を追加 + - Range・シーケンスコンテナは`[1, 2, 3]`、`["hello", "world"]`、`['a', 'b', 'c']`のように出力される + - 連想コンテナの場合、`std::map{{1, 2}, {3, 4}}`は`{1: 2, 3: 4}`のように出力され、`std::set{1, 2, 3}`は`{1, 2, 3}`のように出力される + - [`std::tuple`](/reference/tuple/tuple.md)、[`std::pair`](/reference/utility/pair.md)は`(1, 2)`のように出力される +- [`std::format()`](/reference/format/format.md)関数のフォーマット指定子としてデバッグ指定「`"?"`」を追加。これは文字・文字列を引用符で囲み、エスケープシーケンスをエスケープする + - ただし、Range・コンテナ中の文字・文字列はデフォルトでエスケープされる + - `format("{:?}", "h\tello")`は`"h\tello"`のように出力される ### 入出力 From 58fba8bb7d3df10b7d1e4052109ae27c22a472ed Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 16 Jan 2023 16:44:38 +0900 Subject: [PATCH 0024/3948] =?UTF-8?q?basic=5Fstring/substr:=20P2438R2?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C(#1092)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit basic_stringコンストラクタを採番維持したまま目的別にグルーピング。 C++23 WD N4928 では、合計19個のオーバーロードとなる(#1069 未対応)。 --- .../string/basic_string/op_constructor.md | 33 ++++++++++++++++--- reference/string/basic_string/substr.md | 24 ++++++++++++-- 2 files changed, 50 insertions(+), 7 deletions(-) diff --git a/reference/string/basic_string/op_constructor.md b/reference/string/basic_string/op_constructor.md index b64ae154e5..a4d4337dab 100644 --- a/reference/string/basic_string/op_constructor.md +++ b/reference/string/basic_string/op_constructor.md @@ -5,6 +5,7 @@ * function[meta id-type] ```cpp +// デフォルトコンストラクタ basic_string(); // (1) C++14 basic_string() noexcept(noexcept(Allocator())) // (1) C++17 : basic_string(Allocator()) {} @@ -17,12 +18,15 @@ constexpr explicit basic_string(const Allocator& a) noexcept; // (2) C++20 explicit basic_string(const Allocator& a = Allocator()); // (1) + (2) C++03 +// コピーコンストラクタ basic_string(const basic_string& str); // (3) C++03 constexpr basic_string(const basic_string& str); // (3) C++20 +// ムーブコンストラクタ basic_string(basic_string&& str) noexcept; // (4) C++11 constexpr basic_string(basic_string&& str) noexcept; // (4) C++20 +// basic_stringの指定範囲から構築するコンストラクタ basic_string(const basic_string& str, size_type pos, size_type n = npos, @@ -43,6 +47,16 @@ constexpr basic_string(const basic_string& str, size_type pos, const Allocator& a = Allocator()); // (6) C++20 +constexpr basic_string(basic_string&& str, + size_type pos, + const Allocator& a = Allocator()); // (17) C++23 + +constexpr basic_string(basic_string&& str, + size_type pos, + size_type n, + const Allocator& a = Allocator()); // (18) C++23 + +// 文字列ポインタから構築するコンストラクタ basic_string(const charT* s, size_type n, const Allocator& a = Allocator()); // (7) C++03 @@ -55,6 +69,9 @@ basic_string(const charT* s, constexpr basic_string(const charT* s, const Allocator& a = Allocator()); // (8) C++20 +basic_string(nullptr_t) = delete; // (16) C++23 + +// 文字個数から構築するコンストラクタ basic_string(size_type n, charT c, const Allocator& a = Allocator()); // (9) C++03 @@ -62,6 +79,7 @@ constexpr basic_string(size_type n, charT c, const Allocator& a = Allocator()); // (9) C++20 +// イテレータ範囲から構築するコンストラクタ template basic_string(InputIterator begin, InputIterator end, const Allocator& a = Allocator()); // (10) C++03 @@ -69,11 +87,13 @@ template constexpr basic_string(InputIterator begin, InputIterator end, const Allocator& a = Allocator()); // (10) C++20 +// 初期化子リストから構築するコンストラクタ basic_string(initializer_list init, const Allocator& = Allocator()); // (11) C++11 constexpr basic_string(initializer_list init, const Allocator& = Allocator()); // (11) C++20 +// アロケータ指定コピー/ムーブコンストラクタ basic_string(const basic_string& str, const Allocator&); // (12) C++11 constexpr basic_string(const basic_string& str, const Allocator&); // (12) C++20 @@ -98,8 +118,6 @@ constexpr basic_string(const T& t, size_type pos, size_type n, const Allocator& a = Allocator()); // (15) C++20 - -basic_string(nullptr_t) = delete; // (16) C++23 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -119,6 +137,9 @@ basic_string(nullptr_t) = delete; // (16) C++23 - (13) : アロケータを受け取るムーブコンストラクタ。 - (14) : [`std::basic_string_view`](/reference/string_view/basic_string_view.md)オブジェクトからの変換コンストラクタ。[`basic_string_view`](/reference/string_view/basic_string_view.md)``に変換可能な`t`が参照する範囲の文字列を`*this`にコピーする。 - (15) : [`basic_string_view`](/reference/string_view/basic_string_view.md)``に変換可能な`t`が参照する範囲の文字列の`pos`番目から`n`文字の部分文字列がコピーされる。`n == npos`の場合、`pos`番目から末尾までの部分文字列がコピーされる。 +- (17) : `str`オブジェクトの部分文字列のコピーから`basic_string`オブジェクトを構築する。`str`オブジェクトの`pos`番目から`n`文字の部分文字列がコピーされる。`n == npos`の場合、`pos`番目から末尾までの部分文字列がコピーされる。`str`は未規定の値になる。 +- (18) : `str`オブジェクトの部分文字列のコピーから`basic_string`オブジェクトを構築する。`str`オブジェクトの`pos`番目から末尾までの部分文字列がコピーされる。`str`は未規定の値になる。 + ## テンプレートパラメータ制約 @@ -138,7 +159,7 @@ basic_string(nullptr_t) = delete; // (16) C++23 ## 例外 -- (5), (6) : `pos > str.`[`size()`](size.md)の場合、[`out_of_range`](/reference/stdexcept.md)例外を送出する。 +- (5), (6), (17), (18) : `pos > str.`[`size()`](size.md)の場合、[`out_of_range`](/reference/stdexcept.md)例外を送出する。 - (13) : `alloc == str.`[`get_allocator()`](get_allocator.md)の場合、例外を投げない。 @@ -237,6 +258,8 @@ s14 : Hello - `string_view`から範囲を指定して構築する(15)を追加 - [LWG Issue 2946. LWG 2758's resolution missed further corrections](https://wg21.cmeerw.net/lwg/issue2946) - 意図しない暗黙変換防止のために`string_view`を受けるオーバーロード(14)の引数型を`const T&`に変更 -- [P2166R1 A Proposal to Prohibit std::basic_string and std::basic_string_view construction from nullptr.](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2166r1.html) - - C++23での、`nullptr_t`をとるコンストラクタのdelete宣言追加 - [P0980R1 Making `std::string` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0980r1.pdf) +- [P2166R1 A Proposal to Prohibit std::basic_string and std::basic_string_view construction from nullptr.](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2166r1.html) + - C++23での(16)`nullptr_t`をとるコンストラクタのdelete宣言追加 +- [P2438R2 `std::string::substr() &&`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2438r2.html) + - C++23での(17),(18)`basic_string&&`と範囲指定をとるコンストラクタ追加 diff --git a/reference/string/basic_string/substr.md b/reference/string/basic_string/substr.md index 0e0d9c1525..3585e73327 100644 --- a/reference/string/basic_string/substr.md +++ b/reference/string/basic_string/substr.md @@ -11,18 +11,26 @@ basic_string constexpr basic_string substr(size_type pos = 0, size_type n = npos) const; // (1) C++20 +constexpr basic_string + substr(size_type pos = 0, + size_type n = npos) const &; // (1) C++23 + +constexpr basic_string + substr(size_type pos = 0, + size_type n = npos) &&; // (2) C++23 ``` ## 概要 -部分文字列を取得する。 +部分文字列を取得する。 `pos`番目から`n`要素の文字列を返す。 +引数省略時は、先頭位置(`0`番目)から全要素(`npos`)の文字列を返す。 ## 要件 `pos <=` [`size()`](size.md) -## 戻り値 +## 戻り値(C++20まで) `n`と[`size()`](size.md) `- pos`のうち、小さい方をコピーする長さ`rlen`として、 `basic_string(`[`data()`](data.md)`+pos, rlen)` @@ -30,10 +38,20 @@ constexpr basic_string を返す。パラメータ`n`のデフォルト引数である`npos`の場合には、`pos`番目以降の全体を返す。 +## 効果(C++23から) +- (1) 次と等価 : `return` [`basic_string`](op_constructor.md)`(*this, pos, n);` +- (2) 次と等価 : `return` [`basic_string`](op_constructor.md)`(std::move(*this), pos, n);` + + ## 例外 `pos >` [`size()`](size.md)の場合、[`out_of_range`](/reference/stdexcept.md)例外を送出する。 +## 備考 +C++23から(2)[右辺値修飾オーバーロード](/lang/cpp11/ref_qualifier_for_this)の追加にともない、従来からある(1)はconst左辺値参照オーバーロードに変更される。 +同時にメンバ関数`substr`のライブラリ仕様記述は、新たに追加された`basic_string`コンストラクタを用いて書き直されるものの、基本的な動作はC++20までと同一である。 + + ## 例 ```cpp example #include @@ -66,3 +84,5 @@ llo ## 参照 - [P0980R1 Making `std::string` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0980r1.pdf) +- [P2438R2 `std::string::substr() &&`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2438r2.html) + - C++23での(2)右辺値修飾オーバーロード追加 From 53c9bf6cffc98cc92fb84cff4f378285cd8bd320 Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 16 Jan 2023 17:49:31 +0900 Subject: [PATCH 0025/3948] =?UTF-8?q?bitset:=20P2417R2=20constexpr?= =?UTF-8?q?=E5=8C=96(#1091)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/bitset/bitset/all.md | 5 +++-- reference/bitset/bitset/any.md | 8 ++++--- reference/bitset/bitset/count.md | 9 ++++++-- reference/bitset/bitset/flip.md | 10 +++++---- reference/bitset/bitset/none.md | 7 +++++-- reference/bitset/bitset/op_and.md | 9 +++++--- reference/bitset/bitset/op_and_assign.md | 7 ++++--- reference/bitset/bitset/op_at.md | 5 +++-- reference/bitset/bitset/op_constructor.md | 16 +++++++++++++- reference/bitset/bitset/op_equal.md | 7 ++++--- reference/bitset/bitset/op_flip.md | 6 ++++-- reference/bitset/bitset/op_left_shift.md | 6 ++++-- .../bitset/bitset/op_left_shift_assign.md | 6 ++++-- reference/bitset/bitset/op_not_equal.md | 4 +++- reference/bitset/bitset/op_or.md | 9 +++++--- reference/bitset/bitset/op_or_assign.md | 7 ++++--- reference/bitset/bitset/op_right_shift.md | 6 ++++-- .../bitset/bitset/op_right_shift_assign.md | 6 ++++-- reference/bitset/bitset/op_xor.md | 9 +++++--- reference/bitset/bitset/op_xor_assign.md | 7 ++++--- reference/bitset/bitset/reference.md | 21 +++++++++++-------- reference/bitset/bitset/reset.md | 10 +++++---- reference/bitset/bitset/set.md | 10 +++++---- reference/bitset/bitset/size.md | 7 +++---- reference/bitset/bitset/test.md | 6 ++++-- reference/bitset/bitset/to_string.md | 14 ++++++++----- reference/bitset/bitset/to_ullong.md | 5 +++-- reference/bitset/bitset/to_ulong.md | 5 +++-- 28 files changed, 147 insertions(+), 80 deletions(-) diff --git a/reference/bitset/bitset/all.md b/reference/bitset/bitset/all.md index d56dc5447d..b1bc7202ed 100644 --- a/reference/bitset/bitset/all.md +++ b/reference/bitset/bitset/all.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -bool all() const noexcept; +bool all() const noexcept; // (1) C++11 +constexpr bool all() const noexcept; // (1) C++23 ``` ## 概要 @@ -63,4 +64,4 @@ int main() ## 参照 - +- [P2417R2 A more constexpr bitset](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2417r2.pdf) diff --git a/reference/bitset/bitset/any.md b/reference/bitset/bitset/any.md index a0115f0e9d..f3a58acf28 100644 --- a/reference/bitset/bitset/any.md +++ b/reference/bitset/bitset/any.md @@ -5,8 +5,9 @@ * function[meta id-type] ```cpp -bool any() const; // C++03 -bool any() const noexcept; // C++11 +bool any() const; // (1) C++03 +bool any() const noexcept; // (1) C++11 +constexpr bool any() const noexcept; // (1) C++23 ``` ## 概要 @@ -49,5 +50,6 @@ int main() ``` ``` -## 参照 +## 参照 +- [P2417R2 A more constexpr bitset](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2417r2.pdf) diff --git a/reference/bitset/bitset/count.md b/reference/bitset/bitset/count.md index e4a625c473..2a4e8ff6a6 100644 --- a/reference/bitset/bitset/count.md +++ b/reference/bitset/bitset/count.md @@ -5,8 +5,9 @@ * function[meta id-type] ```cpp -size_t count() const; // C++03 -size_t count() const noexcept; // C++11 +size_t count() const; // (1) C++03 +size_t count() const noexcept; // (1) C++11 +constexpr size_t count() const noexcept; // (1) C++23 ``` ## 概要 @@ -71,3 +72,7 @@ int main() ## 関連項目 - [`std::popcount()`](/reference/bit/popcount.md) + + +## 参照 +- [P2417R2 A more constexpr bitset](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2417r2.pdf) diff --git a/reference/bitset/bitset/flip.md b/reference/bitset/bitset/flip.md index 9f594d31d9..a340f74e7b 100644 --- a/reference/bitset/bitset/flip.md +++ b/reference/bitset/bitset/flip.md @@ -5,10 +5,12 @@ * function[meta id-type] ```cpp -bitset& flip(); // (1) C++03 -bitset& flip() noexcept; // (1) C++11 +bitset& flip(); // (1) C++03 +bitset& flip() noexcept; // (1) C++11 +constexpr bitset& flip() noexcept; // (1) C++23 -bitset& flip(size_t pos); // (2) +bitset& flip(size_t pos); // (2) C++03 +constexpr bitset& flip(size_t pos); // (2) C++23 ``` ## 概要 @@ -64,4 +66,4 @@ int main() ## 参照 - +- [P2417R2 A more constexpr bitset](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2417r2.pdf) diff --git a/reference/bitset/bitset/none.md b/reference/bitset/bitset/none.md index 0c493f7539..8c2dce68d8 100644 --- a/reference/bitset/bitset/none.md +++ b/reference/bitset/bitset/none.md @@ -5,7 +5,9 @@ * function[meta id-type] ```cpp -bool none() const noexcept; +bool none() const; // (1) C++03 +bool none() const noexcept; // (1) C++11 +constexpr bool none() const noexcept; // (1) C++23 ``` ## 概要 @@ -48,5 +50,6 @@ int main() ``` ``` -## 参照 +## 参照 +- [P2417R2 A more constexpr bitset](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2417r2.pdf) diff --git a/reference/bitset/bitset/op_and.md b/reference/bitset/bitset/op_and.md index 9b8920b518..23b9fedffd 100644 --- a/reference/bitset/bitset/op_and.md +++ b/reference/bitset/bitset/op_and.md @@ -6,10 +6,13 @@ ```cpp namespace std { template - bitset operator&(const bitset& lhs, const bitset& rhs); // C++03 + bitset operator&(const bitset& lhs, const bitset& rhs); // (1) C++03 template - bitset operator&(const bitset& lhs, const bitset& rhs) noexcept; // C++11 + bitset operator&(const bitset& lhs, const bitset& rhs) noexcept; // (1) C++11 + + template + constexpr bitset operator&(const bitset& lhs, const bitset& rhs) noexcept; // (1) C++23 } ``` @@ -54,4 +57,4 @@ int main() ## 参照 - +- [P2417R2 A more constexpr bitset](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2417r2.pdf) diff --git a/reference/bitset/bitset/op_and_assign.md b/reference/bitset/bitset/op_and_assign.md index 7c31f92933..a1671426b6 100644 --- a/reference/bitset/bitset/op_and_assign.md +++ b/reference/bitset/bitset/op_and_assign.md @@ -5,8 +5,9 @@ * function[meta id-type] ```cpp -bitset& operator&=(const bitset& rhs); // C++03 -bitset& operator&=(const bitset& rhs) noexcept; // C++11 +bitset& operator&=(const bitset& rhs); // (1) C++03 +bitset& operator&=(const bitset& rhs) noexcept; // (1) C++11 +constexpr bitset& operator&=(const bitset& rhs) noexcept; // (1) C++23 ``` ## 概要 @@ -48,4 +49,4 @@ int main() ## 参照 - +- [P2417R2 A more constexpr bitset](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2417r2.pdf) diff --git a/reference/bitset/bitset/op_at.md b/reference/bitset/bitset/op_at.md index c1aac0187b..e5ee01c9d6 100644 --- a/reference/bitset/bitset/op_at.md +++ b/reference/bitset/bitset/op_at.md @@ -9,7 +9,8 @@ bool operator[](size_t pos) const; // (1) C++03 constexpr bool operator[](size_t pos); // (1) C++11 constexpr bool operator[](size_t pos) const; // (1) C++14 -reference operator[](size_t pos); // (2) +reference operator[](size_t pos); // (2) C++03 +constexpr reference operator[](size_t pos); // (2) C++23 ``` * reference[link reference.md] @@ -58,4 +59,4 @@ false ## 参照 - [N3669 Fixing constexpr member functions without const](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3669.pdf) - +- [P2417R2 A more constexpr bitset](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2417r2.pdf) diff --git a/reference/bitset/bitset/op_constructor.md b/reference/bitset/bitset/op_constructor.md index a21dae1a68..1b898c9a8c 100644 --- a/reference/bitset/bitset/op_constructor.md +++ b/reference/bitset/bitset/op_constructor.md @@ -26,11 +26,25 @@ explicit bitset( basic_string::npos, CharT zero = CharT('0'), CharT one = CharT('1')); // (3) C++11 +template +constexpr explicit bitset( + const basic_string& str, + typename basic_string::size_type pos = 0, + typename basic_string::size_type n = + basic_string::npos, + CharT zero = CharT('0'), CharT one = CharT('1')); // (3) C++23 + template explicit bitset( const CharT* str, typename basic_string::size_type n = basic_string::npos, CharT zero = CharT('0'), CharT one = CharT('1')); // (4) C++11 + +template +constexpr explicit bitset( + const CharT* str, + typename basic_string::size_type n = basic_string::npos, + CharT zero = CharT('0'), CharT one = CharT('1')); // (4) C++23 ``` * basic_string[link /reference/string/basic_string.md] @@ -122,4 +136,4 @@ int main() ## 参照 - [LWG Issue 778. `std::bitset` does not have any constructor taking a string literal](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#778) - (4)のコンストラクタが追加された経緯となるレポート - +- [P2417R2 A more constexpr bitset](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2417r2.pdf) diff --git a/reference/bitset/bitset/op_equal.md b/reference/bitset/bitset/op_equal.md index 90f60064f8..d8574f78d1 100644 --- a/reference/bitset/bitset/op_equal.md +++ b/reference/bitset/bitset/op_equal.md @@ -5,8 +5,9 @@ * function[meta id-type] ```cpp -bool operator==(const bitset& rhs) const; // C++03 -bool operator==(const bitset& rhs) const noexcept; // C++11 +bool operator==(const bitset& rhs) const; // (1) C++03 +bool operator==(const bitset& rhs) const noexcept; // (1) C++11 +constexpr bool operator==(const bitset& rhs) const noexcept; // (1) C++23 ``` ## 概要 @@ -47,4 +48,4 @@ equal ## 参照 - +- [P2417R2 A more constexpr bitset](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2417r2.pdf) diff --git a/reference/bitset/bitset/op_flip.md b/reference/bitset/bitset/op_flip.md index 4ae7cd8436..2ef56cb234 100644 --- a/reference/bitset/bitset/op_flip.md +++ b/reference/bitset/bitset/op_flip.md @@ -5,8 +5,9 @@ * function[meta id-type] ```cpp -bitset operator~() const; // C++03 -bitset operator~() const noexcept; // C++11 +bitset operator~() const; // (1) C++03 +bitset operator~() const noexcept; // (1) C++11 +constexpr bitset operator~() const noexcept; // (1) C++23 ``` ## 概要 @@ -49,4 +50,5 @@ int main() ## 参照 +- [P2417R2 A more constexpr bitset](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2417r2.pdf) diff --git a/reference/bitset/bitset/op_left_shift.md b/reference/bitset/bitset/op_left_shift.md index 87fb4cf10d..517b45125a 100644 --- a/reference/bitset/bitset/op_left_shift.md +++ b/reference/bitset/bitset/op_left_shift.md @@ -5,7 +5,9 @@ * function[meta id-type] ```cpp -bitset operator<<(size_t pos) const noexcept; +bitset operator<<(size_t pos) const; // (1) C++03 +bitset operator<<(size_t pos) const noexcept; // (1) C++11 +constexpr bitset operator<<(size_t pos) const noexcept; // (1) C++23 ``` ## 概要 @@ -48,4 +50,4 @@ int main() ## 参照 - +- [P2417R2 A more constexpr bitset](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2417r2.pdf) diff --git a/reference/bitset/bitset/op_left_shift_assign.md b/reference/bitset/bitset/op_left_shift_assign.md index f9e4459040..056dc43bcd 100644 --- a/reference/bitset/bitset/op_left_shift_assign.md +++ b/reference/bitset/bitset/op_left_shift_assign.md @@ -5,7 +5,9 @@ * function[meta id-type] ```cpp -bitset& operator<<=(size_t pos) noexcept; +bitset& operator<<=(size_t pos); // (1) C++03 +bitset& operator<<=(size_t pos) noexcept; // (1) C++11 +constexpr bitset& operator<<=(size_t pos) noexcept; // (1) C++23 ``` ## 概要 @@ -46,4 +48,4 @@ int main() ## 参照 - +- [P2417R2 A more constexpr bitset](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2417r2.pdf) diff --git a/reference/bitset/bitset/op_not_equal.md b/reference/bitset/bitset/op_not_equal.md index 4506c65809..c2b8e152fc 100644 --- a/reference/bitset/bitset/op_not_equal.md +++ b/reference/bitset/bitset/op_not_equal.md @@ -7,7 +7,8 @@ ```cpp // operator==により、以下のオーバーロードが使用可能になる (C++20) bool operator!=(const bitset& rhs) const; // (1) C++03 -bool operator!=(const bitset& rhs) const noexcept; // (2) C++11 +bool operator!=(const bitset& rhs) const noexcept; // (1) C++11 +constexpr bool operator!=(const bitset& rhs) const noexcept; // (1) C++23 ``` ## 概要 @@ -54,3 +55,4 @@ not equal ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P2417R2 A more constexpr bitset](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2417r2.pdf) diff --git a/reference/bitset/bitset/op_or.md b/reference/bitset/bitset/op_or.md index eabd61bf49..9bb3cc2e7d 100644 --- a/reference/bitset/bitset/op_or.md +++ b/reference/bitset/bitset/op_or.md @@ -6,10 +6,13 @@ ```cpp namespace std { template - bitset operator|(const bitset& lhs, const bitset& rhs); // C++03 + bitset operator|(const bitset& lhs, const bitset& rhs); // (1) C++03 template - bitset operator|(const bitset& lhs, const bitset& rhs) noexcept; // C++11 + bitset operator|(const bitset& lhs, const bitset& rhs) noexcept; // (1) C++11 + + template + constexpr bitset operator|(const bitset& lhs, const bitset& rhs) noexcept; // (1) C++23 } ``` @@ -54,4 +57,4 @@ int main() ## 参照 - +- [P2417R2 A more constexpr bitset](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2417r2.pdf) diff --git a/reference/bitset/bitset/op_or_assign.md b/reference/bitset/bitset/op_or_assign.md index c062ae51b2..2dcd663e06 100644 --- a/reference/bitset/bitset/op_or_assign.md +++ b/reference/bitset/bitset/op_or_assign.md @@ -5,8 +5,9 @@ * function[meta id-type] ```cpp -bitset& operator|=(const bitset& rhs); // C++03 -bitset& operator|=(const bitset& rhs) noexcept; // C++11 +bitset& operator|=(const bitset& rhs); // (1) C++03 +bitset& operator|=(const bitset& rhs) noexcept; // (1) C++11 +constexpr bitset& operator|=(const bitset& rhs) noexcept; // (1) C++23 ``` ## 概要 @@ -48,4 +49,4 @@ int main() ## 参照 - +- [P2417R2 A more constexpr bitset](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2417r2.pdf) diff --git a/reference/bitset/bitset/op_right_shift.md b/reference/bitset/bitset/op_right_shift.md index a0f013b88b..b3aa2263ec 100644 --- a/reference/bitset/bitset/op_right_shift.md +++ b/reference/bitset/bitset/op_right_shift.md @@ -5,7 +5,9 @@ * function[meta id-type] ```cpp -bitset operator>>(size_t pos) const noexcept; +bitset operator>>(size_t pos) const; // (1) C++03 +bitset operator>>(size_t pos) const noexcept; // (1) C++11 +constexpr bitset operator>>(size_t pos) const noexcept; // (1) C++23 ``` ## 概要 @@ -48,4 +50,4 @@ int main() ## 参照 - +- [P2417R2 A more constexpr bitset](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2417r2.pdf) diff --git a/reference/bitset/bitset/op_right_shift_assign.md b/reference/bitset/bitset/op_right_shift_assign.md index 0c3539bfe0..cb47218962 100644 --- a/reference/bitset/bitset/op_right_shift_assign.md +++ b/reference/bitset/bitset/op_right_shift_assign.md @@ -5,7 +5,9 @@ * function[meta id-type] ```cpp -bitset& operator>>=(size_t pos) noexcept; +bitset& operator>>=(size_t pos); // (1) C++03 +bitset& operator>>=(size_t pos) noexcept; // (1) C++11 +constexpr bitset& operator>>=(size_t pos) noexcept; // (1) C++23 ``` ## 概要 @@ -46,4 +48,4 @@ int main() ## 参照 - +- [P2417R2 A more constexpr bitset](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2417r2.pdf) diff --git a/reference/bitset/bitset/op_xor.md b/reference/bitset/bitset/op_xor.md index 3fcfd962d2..36f622fe1e 100644 --- a/reference/bitset/bitset/op_xor.md +++ b/reference/bitset/bitset/op_xor.md @@ -6,10 +6,13 @@ ```cpp namespace std { template - bitset operator^(const bitset& lhs, const bitset& rhs); // C++03 + bitset operator^(const bitset& lhs, const bitset& rhs); // (1) C++03 template - bitset operator^(const bitset& lhs, const bitset& rhs) noexcept; // C++11 + bitset operator^(const bitset& lhs, const bitset& rhs) noexcept; // (1) C++11 + + template + constexpr bitset operator^(const bitset& lhs, const bitset& rhs) noexcept; // (1) C++23 } ``` @@ -54,4 +57,4 @@ int main() ## 参照 - +- [P2417R2 A more constexpr bitset](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2417r2.pdf) diff --git a/reference/bitset/bitset/op_xor_assign.md b/reference/bitset/bitset/op_xor_assign.md index 26a82351e7..b6091b5a73 100644 --- a/reference/bitset/bitset/op_xor_assign.md +++ b/reference/bitset/bitset/op_xor_assign.md @@ -5,8 +5,9 @@ * function[meta id-type] ```cpp -bitset& operator^=(const bitset& rhs); // C++03 -bitset& operator^=(const bitset& rhs) noexcept; // C++11 +bitset& operator^=(const bitset& rhs); // (1) C++03 +bitset& operator^=(const bitset& rhs) noexcept; // (1) C++11 +constexpr bitset& operator^=(const bitset& rhs) noexcept; // (1) C++23 ``` ## 概要 @@ -48,4 +49,4 @@ int main() ## 参照 - +- [P2417R2 A more constexpr bitset](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2417r2.pdf) diff --git a/reference/bitset/bitset/reference.md b/reference/bitset/bitset/reference.md index f4f5f2e2af..76add68b88 100644 --- a/reference/bitset/bitset/reference.md +++ b/reference/bitset/bitset/reference.md @@ -11,22 +11,24 @@ namespace std { public: class reference { friend class bitset; - reference() noexcept; + CONSTEXPR reference() noexcept; public: - ~reference() noexcept; - reference& operator=(bool x) noexcept; - reference& operator=(const reference&) noexcept; - bool operator~() const noexcept; - operator bool() const noexcept; - reference& flip() noexcept; + CONSTEXPR ~reference() noexcept; + CONSTEXPR reference& operator=(bool x) noexcept; + CONSTEXPR reference& operator=(const reference&) noexcept; + CONSTEXPR bool operator~() const noexcept; + CONSTEXPR operator bool() const noexcept; + CONSTEXPR reference& flip() noexcept; }; }; -} ``` +* CONSTEXPR[italic] ## 概要 `bitset::reference`は、`bitset`の各ビットにアクセスするためのプロキシクラスである。`bitset::`[`operator[]`](op_at.md)で返されるビット情報を取得、書き換えるためにある。 +C++23から`bitset::reference`全メンバ関数への`constexpr`指定が行われる。 + ### メンバ関数 @@ -69,5 +71,6 @@ int main() ``` ``` -### 参照 +## 参照 +- [P2417R2 A more constexpr bitset](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2417r2.pdf) diff --git a/reference/bitset/bitset/reset.md b/reference/bitset/bitset/reset.md index 91436468ad..66e5de4a6d 100644 --- a/reference/bitset/bitset/reset.md +++ b/reference/bitset/bitset/reset.md @@ -5,10 +5,12 @@ * function[meta id-type] ```cpp -bitset& reset(); // (1) C++03 -bitset& reset() noexcept; // (1) C++11 +bitset& reset(); // (1) C++03 +bitset& reset() noexcept; // (1) C++11 +constexpr bitset& reset() noexcept; // (1) C++23 -bitset& reset(size_t pos); // (2) +bitset& reset(size_t pos); // (2) C++03 +constexpr bitset& reset(size_t pos); // (2) C++23 ``` ## 概要 @@ -64,4 +66,4 @@ int main() ## 参照 - +- [P2417R2 A more constexpr bitset](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2417r2.pdf) diff --git a/reference/bitset/bitset/set.md b/reference/bitset/bitset/set.md index eff41c637d..9b41a8dbcb 100644 --- a/reference/bitset/bitset/set.md +++ b/reference/bitset/bitset/set.md @@ -5,10 +5,12 @@ * function[meta id-type] ```cpp -bitset& set(); // (1) C++03 -bitset& set() noexcept; // (1) C++11 +bitset& set(); // (1) C++03 +bitset& set() noexcept; // (1) C++11 +constexpr bitset& set() noexcept; // (1) C++23 -bitset& set(size_t pos, bool val = true); // (2) +bitset& set(size_t pos, bool val = true); // (2) C++03 +constexpr bitset& set(size_t pos, bool val = true); // (2) C++23 ``` ## 概要 @@ -64,4 +66,4 @@ int main() ## 参照 - +- [P2417R2 A more constexpr bitset](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2417r2.pdf) diff --git a/reference/bitset/bitset/size.md b/reference/bitset/bitset/size.md index 262599b0d4..b3c58ac786 100644 --- a/reference/bitset/bitset/size.md +++ b/reference/bitset/bitset/size.md @@ -5,9 +5,9 @@ * function[meta id-type] ```cpp -size_t size() const; // C++03 -constexpr size_t size() noexcept; // C++11 -constexpr size_t size() const noexcept; // C++14 +size_t size() const; // (1) C++03 +constexpr size_t size() noexcept; // (1) C++11 +constexpr size_t size() const noexcept; // (1) C++14 ``` ## 概要 @@ -39,4 +39,3 @@ int main() ## 参照 - [N3669 Fixing constexpr member functions without const](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3669.pdf) - diff --git a/reference/bitset/bitset/test.md b/reference/bitset/bitset/test.md index 7de20bcb4d..544fe980fb 100644 --- a/reference/bitset/bitset/test.md +++ b/reference/bitset/bitset/test.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -bool test(size_t pos) const; +bool test(size_t pos) const; // (1) C++03 +constexpr bool test(size_t pos) const; // (1) C++23 ``` ## 概要 @@ -45,5 +46,6 @@ int main() ``` ``` -## 参照 +## 参照 +- [P2417R2 A more constexpr bitset](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2417r2.pdf) diff --git a/reference/bitset/bitset/to_string.md b/reference/bitset/bitset/to_string.md index 83590fe671..a83a4103a9 100644 --- a/reference/bitset/bitset/to_string.md +++ b/reference/bitset/bitset/to_string.md @@ -5,16 +5,20 @@ * function template[meta id-type] ```cpp -// C++03 template -basic_string to_string() const; +basic_string to_string() const; // (1) C++03 -// C++11 template , class Allocator = allocator> basic_string - to_string(CharT zero = CharT('0'), CharT one = CharT('1')) const; + to_string(CharT zero = CharT('0'), CharT one = CharT('1')) const; // (1) C++11 + +template , + class Allocator = allocator> +constexpr basic_string + to_string(CharT zero = CharT('0'), CharT one = CharT('1')) const; // (1) C++23 ``` * basic_string[link /reference/string/basic_string.md] @@ -65,4 +69,4 @@ int main() - C++11で、`0`を表す文字と`1`を表す文字を指定できるようになった経緯のレポート - [LWG Issue 1113. `bitset::to_string` could be simplified](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#1113) - C++11で、デフォルトの文字型が設定された経緯のレポート - +- [P2417R2 A more constexpr bitset](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2417r2.pdf) diff --git a/reference/bitset/bitset/to_ullong.md b/reference/bitset/bitset/to_ullong.md index f99fff73fe..5b03cf19b6 100644 --- a/reference/bitset/bitset/to_ullong.md +++ b/reference/bitset/bitset/to_ullong.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -unsigned long long to_ullong() const; +unsigned long long to_ullong() const; // (1) C++11 +constexpr unsigned long long to_ullong() const; // (1) C++23 ``` ## 概要 @@ -52,4 +53,4 @@ int main() ## 参照 - +- [P2417R2 A more constexpr bitset](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2417r2.pdf) diff --git a/reference/bitset/bitset/to_ulong.md b/reference/bitset/bitset/to_ulong.md index c6c90b0099..2b0d44b62d 100644 --- a/reference/bitset/bitset/to_ulong.md +++ b/reference/bitset/bitset/to_ulong.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -unsigned long to_ulong() const; +unsigned long to_ulong() const; // (1) C++03 +constexpr unsigned long to_ulong() const; // (1) C++23 ``` ## 概要 @@ -41,4 +42,4 @@ int main() ## 参照 - +- [P2417R2 A more constexpr bitset](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2417r2.pdf) From a0a65d950381e8c5c246de5f9dead685aba7db4e Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 16 Jan 2023 18:18:48 +0900 Subject: [PATCH 0026/3948] =?UTF-8?q?=E6=8B=A1=E5=BC=B5=E5=AD=90=E3=83=9F?= =?UTF-8?q?=E3=82=B9=E3=81=AE=E3=82=88=E3=81=86=E3=81=AA=E4=B8=8D=E6=AD=A3?= =?UTF-8?q?=E3=81=AA=E5=86=85=E9=83=A8=E3=83=AA=E3=83=B3=E3=82=AF=E3=81=8C?= =?UTF-8?q?=E6=A4=9C=E5=87=BA=E3=81=95=E3=82=8C=E3=81=A6=E3=81=84=E3=81=AA?= =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=9F=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/script/link_check.py | 46 ++++++++++++++----- reference/string/basic_string/substr.md | 2 +- .../basic_string_view/op_constructor.md | 2 +- start_editing/page_names.md | 2 +- 4 files changed, 38 insertions(+), 14 deletions(-) diff --git a/.github/workflows/script/link_check.py b/.github/workflows/script/link_check.py index e630d8eb8e..af27098972 100644 --- a/.github/workflows/script/link_check.py +++ b/.github/workflows/script/link_check.py @@ -44,7 +44,13 @@ def fix_link(link: str) -> str: link = link + ")" return re.sub("#.*", "", link.strip()) else: - return "" + if not link: + return "" + + if link.startswith("#"): + return "" + + return link IGNORE_LIST = [ "https://web.archive.org", # 確実に存在すると思われる @@ -72,17 +78,35 @@ def add_link(origin_link: str): else: inner_links.append(link) - for m in re.finditer(r'\[(.*?)\]\((.*?)\)', text): - link = m.group(2) - if '(' in link: - index = text.find(')', m.end(0)) - after_link = text[m.start(2):index] - add_link(after_link) - else: - add_link(link) + in_code_block = False + for line in text.split("\n"): + # コードブロックのなかは、チェックしない + is_code_block = line.strip().startswith("```") + if is_code_block: + in_code_block = not in_code_block + continue + + if in_code_block: + continue + + for m in re.finditer(r'\[(.*?)\]\((.*?)\)', line): + pretext = line[0:m.start(0)] + # コード修飾のなかは、チェックしない + incode = pretext.count("`") + if pretext.count("`") % 2 != 0: + continue + + link = m.group(2) + if '(' in link: + index = line.find(')', m.end(0)) + after_link = line[m.start(2):index] + add_link(after_link) + else: + add_link(link) - for m in re.finditer(r'[\*-] (.*?)\[link (.*?)\]', text): - add_link(m.group(2)) + for line in text.split("\n"): + for m in re.finditer(r'[\*-] (.*?)\[link (.*?)\]', line): + add_link(m.group(2)) return inner_links, outer_links diff --git a/reference/string/basic_string/substr.md b/reference/string/basic_string/substr.md index 3585e73327..a7ad8c2185 100644 --- a/reference/string/basic_string/substr.md +++ b/reference/string/basic_string/substr.md @@ -48,7 +48,7 @@ constexpr basic_string ## 備考 -C++23から(2)[右辺値修飾オーバーロード](/lang/cpp11/ref_qualifier_for_this)の追加にともない、従来からある(1)はconst左辺値参照オーバーロードに変更される。 +C++23から(2)[右辺値修飾オーバーロード](/lang/cpp11/ref_qualifier_for_this.md)の追加にともない、従来からある(1)はconst左辺値参照オーバーロードに変更される。 同時にメンバ関数`substr`のライブラリ仕様記述は、新たに追加された`basic_string`コンストラクタを用いて書き直されるものの、基本的な動作はC++20までと同一である。 diff --git a/reference/string_view/basic_string_view/op_constructor.md b/reference/string_view/basic_string_view/op_constructor.md index 4e1c60b05c..3de2a3a375 100644 --- a/reference/string_view/basic_string_view/op_constructor.md +++ b/reference/string_view/basic_string_view/op_constructor.md @@ -82,7 +82,7 @@ snprintf(buf, sizeof(buf), "abc"); string_view str(buf); ``` -- ヌル文字を含む文字列リテラル全体から`basic_string_view`を構築したい場合は[`std::string_view_literals::svリテラル`](op_sv.html)を用いる。 +- ヌル文字を含む文字列リテラル全体から`basic_string_view`を構築したい場合は[`std::string_view_literals::svリテラル`](op_sv.md)を用いる。 ## 例 diff --git a/start_editing/page_names.md b/start_editing/page_names.md index 9caa2ad2af..b1e2ba1ab4 100644 --- a/start_editing/page_names.md +++ b/start_editing/page_names.md @@ -88,4 +88,4 @@ C++にはこの表に含まれない演算子もいくつかあるが、ここ ## その他、例外的なページファイル名 -- [`std::_Exit()`](/reference/cstdlib/exit_.html)は、ページファイル名を先頭アンダースコアしたところ、Chromeブラウザで404 Page Not Foundとなったため、回避策として末尾にアンダースコアを付けている +- [`std::_Exit()`](/reference/cstdlib/exit_.md)は、ページファイル名を先頭アンダースコアしたところ、Chromeブラウザで404 Page Not Foundとなったため、回避策として末尾にアンダースコアを付けている From fb89d60dad2209edb09d59b161cd7e56b4f8e2a9 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Mon, 16 Jan 2023 18:14:16 +0900 Subject: [PATCH 0027/3948] =?UTF-8?q?=E5=8F=AF=E5=A4=89=E9=95=B7=E3=83=87?= =?UTF-8?q?=E3=83=BC=E3=82=BF=E3=82=92=E6=89=B1=E3=81=86=E3=82=AF=E3=83=A9?= =?UTF-8?q?=E3=82=B9=E3=81=AE=E5=8A=B9=E7=8E=87=E7=9A=84=E3=81=AA`delete`?= =?UTF-8?q?=E3=80=81=E5=88=9D=E7=A8=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp20.md | 2 +- ...sized_delete_for_variable_sized_classes.md | 183 ++++++++++++++++++ reference/new.md | 1 + reference/new/destroying_delete_t.md | 34 ++++ 4 files changed, 219 insertions(+), 1 deletion(-) create mode 100644 lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md create mode 100644 reference/new/destroying_delete_t.md diff --git a/lang/cpp20.md b/lang/cpp20.md index 07581197af..1c063cea8e 100644 --- a/lang/cpp20.md +++ b/lang/cpp20.md @@ -21,7 +21,7 @@ C++20とは、2020年中に改訂され、ISO/IEC 14882:2020で標準規格化 | [friend指定された関数内から構造化束縛を使用して非公開メンバ変数にアクセスすることを許可](cpp20/allow_structured_bindings_to_accessible_members.md) | 構造化束縛の仕様として公開メンバ変数のみを取り出せるようになっていたが、friend指定された関数からは非公開メンバ変数にもアクセスできるようにする | | [構造化束縛がカスタマイゼーションポイントを見つけるルールを緩和](cpp20/relaxing_the_structured_bindings_customization_point_finding_rules.md) | 非テンプレートの`get()`メンバ関数が見つかった場合は、非メンバ関数の`get()`を探しにいく | | [抽象型のチェック](cpp20/checking_for_abstract_class_types.md) | 関数の宣言段階では、パラメータおよび戻り値型が抽象型かどうかをチェックしないようにする | -| [可変長データを扱うクラスの効率的な`delete`](cpp20/efficient_sized_delete_for_variable_sized_classes.md.nolink) | クラスの`delete`演算子が呼び出される前にデストラクタが呼ばれないようにするオプションを追加 | +| [可変長データを扱うクラスの効率的な`delete`](cpp20/efficient_sized_delete_for_variable_sized_classes.md) | クラスの`delete`演算子が呼び出される前にデストラクタが呼ばれないようにするオプションを追加 | | [条件付きで特殊メンバ関数をトリビアルに定義するように](cpp20/conditionally_trivial_special_member_functions.md.nolink) | 制約によってトリビアルな特殊メンバ関数と非トリビアルな特殊メンバ関数をオーバーロードできるようにする | diff --git a/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md b/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md new file mode 100644 index 0000000000..a07745ef61 --- /dev/null +++ b/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md @@ -0,0 +1,183 @@ +# 可変長データを扱うクラスの効率的な`delete` +* cpp20[meta cpp] + +## 概要 + +従来のクラススコープでの`operator delete`オーバーロードにおいて、オーバーロードされた`operator delete`が呼び出されるのはそのクラスのオブジェクトが破棄された後であり、そのオーバーロード内からはそのクラスのオブジェクト(及びメンバ)にアクセスすることはできなかった。 + +```cpp +#include + +struct S { + std::string str; + + // #1 Sのための operator delete オーバーロード + void operator delete(void* p) { + // Sのオブジェクトは破棄済みのため、未定義動作となる + const S& self = *p; // UB + std::cout << self->str; // UB + + // メモリ領域の解放 + ::operator delete(p); + } +}; + +int main() { + S* p = new S{}; + + // Sのデストラクタ呼び出しの後#1が呼び出される + delete p; +} +``` + +`delete`式は指定されたポインタの指しているオブジェクトを破棄した後にそのオブジェクトが占めていたメモリ領域を解放するが、`operator delete`のオーバーロードはオブジェクト破棄後のメモリ領域解放のみを担うため、`operator delete`のオーバーロードが呼ばれた時点でその対象の領域上のオブジェクトは生存期間を終えている。 + +C++20から、第ニ引数に[`std::destroying_delete_t`](/reference/new/destroying_delete_t.md)を取るように`operator delete`をオーバーロードすることで、`delete`式の行う全ての振る舞いをハンドリングできるようになり、`operator delete`のオーバーロード内から`delete`対象のオブジェクトに安全にアクセスすることができる。 + +```cpp +#include +#include +#include + +struct S { + std::string str; + + // #1 Sのための operator delete オーバーロード + void operator delete(S* p, std::destroying_delete_t) { + // pの指すオブジェクトはデストラクタ呼び出し前のため、安全に参照できる + const S& self = *p; // ok + std::cout << self.str; // ok + + // デストラクタ呼び出しをしなければならない + std::destroy_at(p); + // メモリ解放 + ::operator delete(p); + } +}; + +int main() { + S* p = new S{"test"}; + + // Sのデストラクタは呼ばれずに#1が呼び出される + delete p; +} +``` +* std::destroying_delete_t[color ff0000] +* std::destroy_at[link /reference/new/destroy_at.md] + +このように、`std::destroying_delete_t`を取る`operator delete`のオーバーロードのことを*destroying operator delete*と呼ぶ。*destroying operator delete*においては、`delete`式が行う全てのことをユーザーが行う必要がある。 + +## 仕様 + +- クラス`C`に対する*destroying operator delete*の第一引数は`C*`でなければならない +- *destroying operator delete*の戻り値型は`void`でなければならない + +(執筆中) + +## 例 + +### 可変サイズクラスの`delete` + +```cpp example +#include +#include +#include +#include +#include +#include + +class inlined_fixed_string { + size_t length; + + inlined_fixed_string(size_t size, const char *data) + : length(size) + { + // 自身の後ろにある領域に文字列をコピーする + // P0593R6の効果によって、charオブジェクトの生存期間が自動開始される(C++20以降) + std::memcpy(this + 1, data, size); + } + +public: + inlined_fixed_string() = delete; + + auto size() const -> std::size_t { + return length; + } + + auto view() const -> std::string_view { + // thisの後ろにはlength個のcharオブジェクトが生存期間内にあるため、このreinterpret_castは問題ない + return { reinterpret_cast(this + 1), this->size() }; + } + + // std::stringから構築するファクトリ関数 + static auto Make(const std::string& str) -> inlined_fixed_string* { + // 自身の末尾に固定長(実行時可変長)の文字列用領域を確保する + const std::size_t full_size = sizeof(inlined_fixed_string) + str.length() + 1; + + // パディングしたサイズでメモリの確保 + // new式ではなくグローバルnew演算子の呼出 + auto* p = ::operator new(full_size); + + // ログ出力 + std::cout << "inlined_fixed_string::Make() : " << full_size <<" byte allocate.\n"; + + // 確保したメモリ領域にplacement newして構築 + // コンストラクタ内で文字列をコピー + return ::new(p) inlined_fixed_string(str.length() + 1, str.c_str()); + } + + // 確保した領域を含めてdelete + void operator delete(inlined_fixed_string* p, std::destroying_delete_t) { + // 末尾領域の長さを取得 + const std::size_t full_size = sizeof(inlined_fixed_string) + p->length; + + // デストラクタ呼び出し + std::destroy_at(p); + + // char(トリビアルに破棄可能な)型はデストラクタ呼び出しを省略可能 + std::ranges::destroy(p + 1, p + 1 + p->length + 1); + + // メモリ解放 + ::operator delete(p, full_size); + + // ログ出力 + std::cout << "inlined_fixed_string::operator delete() : " << full_size <<" byte deallocate.\n"; + } +}; + +int main() { + std::string str = "C++20 destroying operator delete test."; + auto* p = inlined_fixed_string::Make(str); + + std::cout << p->view() << "\n"; + + delete p; +} +``` +* destroying_delete_t[color ff0000] +* std::destroy_at[link /reference/new/destroy_at.md] +* std::ranges::destroy[link /reference/memory/ranges_destroy.md] + + +### 出力 + +``` +inlined_fixed_string::Make() : 47 byte allocate. +C++20 destroying operator delete test. +inlined_fixed_string::operator delete() : 47 byte deallocate. +``` + +## この機能が必要になった背景・経緯 +(執筆中) + +## 検討されたほかの選択肢 +(執筆中) + +## 関連項目 + +- [`std::destroying_delete_t`](/reference/new/destroying_delete_t.md) + +## 参照 + +- [P0722R3 Efficient sized delete for variable sized classes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0722r3.html) +- [P0722R1 Efficient sized delete for variable sized classes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0722r1.html) diff --git a/reference/new.md b/reference/new.md index c06a6461f6..5fc6e7ec54 100644 --- a/reference/new.md +++ b/reference/new.md @@ -14,6 +14,7 @@ | [`align_val_t`](new/align_val_t.md) | デフォルトよりも大きなアライメントを要求するとき、`new` に渡されるアライメント値の型 | C++17 | | [`nothrow_t`](new/nothrow_t.md) | 例外をスローしないための`std::nothrow`の型 | | | [`new_handler`](new/new_handler.md) | `new`失敗時に呼ばれる関数の型 | | +| [`destroying_delete_t`](new/destroying_delete_t.md) | *destroying operator delete*を定義するためのタグ型 | C++20 | ## 関数 diff --git a/reference/new/destroying_delete_t.md b/reference/new/destroying_delete_t.md new file mode 100644 index 0000000000..fdf24f428a --- /dev/null +++ b/reference/new/destroying_delete_t.md @@ -0,0 +1,34 @@ +# destroying_delete_t +* new[meta header] +* std[meta namespace] +* class[meta id-type] +* cpp20[meta cpp] + +```cpp +namespace std { + struct destroying_delete_t { + explicit destroying_delete_t() = default; + }; + + inline constexpr destroying_delete_t destroying_delete{}; +} +``` + +## 概要 + +C++20にて追加された[*destroying operator delete*](/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md)を定義するためのタグ型。クラススコープ`operator delete`オーバーロード定義時にこの型を第二引数に取るように定義する。 + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 16 +- [GCC](/implementation.md#gcc): 9 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 7 + +## 関連項目 +- [C++20 可変長データを扱うクラスの効率的な`delete`](/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md) + +## 参照 +- [P0722R3 Efficient sized delete for variable sized classes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0722r3.html) From bc12e242a85559d837c3e115ad7d74f16589f530 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Mon, 16 Jan 2023 18:23:47 +0900 Subject: [PATCH 0028/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- .../efficient_sized_delete_for_variable_sized_classes.md | 4 ++-- lang/cpp20/feature_test_macros.md | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/implementation-status.md b/implementation-status.md index c50d9b2dfe..615506a9c7 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -197,7 +197,7 @@ | P0479R5: [確率が高い分岐と低い分岐を伝える属性 `[[likely]]`, `[[unlikely]]`](/lang/cpp20/likely_and_unlikely_attributes.md) | 条件分岐の最適化ヒントを与える属性 | 9 (partial, `switch` 文のみ可能)
10 | 12.0 | | 2019 Update 6 | | P0929R2: [抽象型のチェック](/lang/cpp20/checking_for_abstract_class_types.md) | 関数の宣言段階では、パラメータおよび戻り値型が抽象型かどうかをチェックしないようにする | 11 | | | 2019 Update 5 | | P0732R2: [非型テンプレートパラメータとしてクラス型を許可する](/lang/cpp20/class_types_in_non-type_template_parameters.md) | 定数式として使用できる型を広く非型テンプレートパラメータとして使用できるようにする | 9 | partial | | 2019 Update 6 | -| P0722R3: [可変長データを扱うクラスの効率的な`delete`](/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md.nolink) | クラスの`delete`演算子が呼び出される前にデストラクタが呼ばれないようにするオプションを追加 | 9 | 6.0 | | 2019 Update 7 | +| P0722R3: [可変長データを扱うクラスの効率的な`delete`](/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md) | クラスの`delete`演算子が呼び出される前にデストラクタが呼ばれないようにするオプションを追加 | 9 | 6.0 | | 2019 Update 7 | | P1064R0: [定数式からの仮想関数の呼び出しを許可](/lang/cpp20/allow_virtual_function_calls_in_constant_expressions.md) | 仮想関数に`constexpr`を付けられない制限を解除 | 9 | 9.0 | 2021.4 | 2019 Update 9 | | P1327R1: [定数式での`dynamic_cast`、多態的な`typeid`を許可](/lang/cpp20/allowing_dynamic_cast_polymorphic_typeid_in_constant_expressions.md) | 定数式での動的多態を許可 | 10 | 9.0 | 2021.4 | 2019 Update 9 | | P1002R1: [constexpr関数内でのtry-catchブロックを許可](/lang/cpp20/try-catch_blocks_in_constexpr_functions.md) | constexpr関数内でtry-catchブロックを書けるようにする | 9 | 8.0 | 2021.4 (2021.6 は未対応) | 2019 Update 5 | diff --git a/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md b/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md index a07745ef61..cffee868ba 100644 --- a/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md +++ b/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md @@ -63,7 +63,7 @@ int main() { } ``` * std::destroying_delete_t[color ff0000] -* std::destroy_at[link /reference/new/destroy_at.md] +* std::destroy_at[link /reference/memory/destroy_at.md] このように、`std::destroying_delete_t`を取る`operator delete`のオーバーロードのことを*destroying operator delete*と呼ぶ。*destroying operator delete*においては、`delete`式が行う全てのことをユーザーが行う必要がある。 @@ -155,7 +155,7 @@ int main() { } ``` * destroying_delete_t[color ff0000] -* std::destroy_at[link /reference/new/destroy_at.md] +* std::destroy_at[link /reference/memory/destroy_at.md] * std::ranges::destroy[link /reference/memory/ranges_destroy.md] diff --git a/lang/cpp20/feature_test_macros.md b/lang/cpp20/feature_test_macros.md index ab69825f4b..ece68f1b89 100644 --- a/lang/cpp20/feature_test_macros.md +++ b/lang/cpp20/feature_test_macros.md @@ -20,7 +20,7 @@ |`__cpp_designated_initializers`|`201707L`|[指示付き初期化](designated_initialization.md)| |`__cpp_generic_lambdas`|`201707L`|[ジェネリックラムダのテンプレート構文](familiar_template_syntax_for_generic_lambdas.md)| |`__cpp_impl_coroutine`|`201902L`|[コルーチン](coroutines.md)| -|`__cpp_impl_destroying_delete`|`201806L`|[可変長データを扱うクラスの効率的な`delete`](efficient_sized_delete_for_variable_sized_classes.md.nolink)| +|`__cpp_impl_destroying_delete`|`201806L`|[可変長データを扱うクラスの効率的な`delete`](efficient_sized_delete_for_variable_sized_classes.md)| |`__cpp_impl_three_way_comparison`|`201907L`|[一貫比較](consistent_comparison.md)| |`__cpp_init_captures`|`201803L`|[ラムダ式の初期化キャプチャでのパック展開を許可](allow_pack_expansion_in_lambda_init_capture.md)| |`__cpp_modules`|`201907L`|[モジュール](modules.md)| @@ -63,7 +63,7 @@ |`__cpp_lib_constexpr_utility`|`201811L`|[`std::pair`](/reference/utility/pair.md)の`constexpr`追加対応(一部のコンストラクタと代入演算子)|[``](/reference/utility.md)| |`__cpp_lib_constexpr_vector`|`201907L`|[`std::vector`](/reference/vector/vector.md)の`constexpr`対応|[``](/reference/vector.md)| |`__cpp_lib_coroutine`|`201902L`|[``](/reference/coroutine.md)ヘッダの追加|[``](/reference/coroutine.md)| -|`__cpp_lib_destroying_delete`|`201806L`|[`std::destroying_delete_t`](/reference/new/destroying_delete_t.md.nolink)|[``](/reference/new.md)| +|`__cpp_lib_destroying_delete`|`201806L`|[`std::destroying_delete_t`](/reference/new/destroying_delete_t.md)|[``](/reference/new.md)| |`__cpp_lib_endian`|`201907L`|[`std::endian`](/reference/bit/endian.md)|[``](/reference/bit.md)| |`__cpp_lib_erase_if`|`202002L`|各コンテナに対する`std::erase`、`std::erase_if`の特殊化|[``](/reference/string.md)
[``](/reference/deque.md)
[``](/reference/forward_list.md)
[``](/reference/list.md)
[``](/reference/vector.md)
[``](/reference/map.md)
[``](/reference/set.md)
[``](/reference/unordered_map.md)
[``](/reference/unordered_set.md)| |`__cpp_lib_execution`|`201902L`|[`std::execution::unsequenced_policy`](/reference/execution/execution/execution_policy.md)|[``](/reference/execution.md)| From 4c86ef0198c0d52a49f7716a658d20ab273c4d41 Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 16 Jan 2023 19:01:51 +0900 Subject: [PATCH 0029/3948] =?UTF-8?q?unique=5Fptr:=20P2273R3=20constexpr?= =?UTF-8?q?=E5=8C=96(#1071)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/memory/default_delete.md | 11 ++++---- reference/memory/make_unique.md | 10 +++++-- reference/memory/make_unique_for_overwrite.md | 9 +++++-- reference/memory/unique_ptr/get.md | 7 ++++- reference/memory/unique_ptr/get_deleter.md | 11 ++++++-- reference/memory/unique_ptr/op_arrow.md | 7 ++++- reference/memory/unique_ptr/op_assign.md | 14 +++++++--- reference/memory/unique_ptr/op_at.md | 7 ++++- reference/memory/unique_ptr/op_bool.md | 5 ++-- .../memory/unique_ptr/op_compare_3way.md | 19 +++++++------ reference/memory/unique_ptr/op_constructor.md | 27 ++++++++++++++----- reference/memory/unique_ptr/op_deref.md | 8 +++++- reference/memory/unique_ptr/op_destructor.md | 7 ++++- reference/memory/unique_ptr/op_equal.md | 7 +++++ reference/memory/unique_ptr/op_greater.md | 14 +++++++--- .../memory/unique_ptr/op_greater_equal.md | 14 +++++++--- reference/memory/unique_ptr/op_less.md | 14 +++++++--- reference/memory/unique_ptr/op_less_equal.md | 14 +++++++--- reference/memory/unique_ptr/op_not_equal.md | 7 +++++ reference/memory/unique_ptr/release.md | 7 ++++- reference/memory/unique_ptr/reset.md | 14 ++++++---- reference/memory/unique_ptr/swap.md | 7 ++++- reference/memory/unique_ptr/swap_free.md | 9 ++++++- 23 files changed, 192 insertions(+), 57 deletions(-) diff --git a/reference/memory/default_delete.md b/reference/memory/default_delete.md index b1a0e5c168..9bf2d54add 100644 --- a/reference/memory/default_delete.md +++ b/reference/memory/default_delete.md @@ -26,9 +26,10 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| `constexpr default_delete() noexcept=default;`
`template default_delete()(default_delete const& other) noexcept;` | コンストラクタ。 変換可能な型からのコピーも可能。 | C++11 | +| `constexpr default_delete() noexcept = default;` | コンストラクタ。 | C++11 | +| `template default_delete()(default_delete const& other) noexcept;` | 変換可能な型からのコピーコンストラクタ。 | C++11
C++23からconstexpr指定 | | `~default_delete() = default;` | デストラクタ | C++11 | -| `void operator()(T* ptr) const;` | 関数呼び出し演算子。渡されたポインタ`ptr`を `delete ptr;`で削除する | C++11 | +| `void operator()(T* ptr) const;` | 関数呼び出し演算子。渡されたポインタ`ptr`を `delete ptr;`で削除する | C++11
C++23からconstexpr指定 | ## 配列版のメンバ関数 @@ -36,10 +37,10 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| | `constexpr default_delete() noexcept=default;` | デフォルトコンストラクタ。 | C++11| -| `template default_delete()(const default_delete&) noexcept;` | 変換可能な型からのコピーコンストラクタ。 | C++17 | +| `template default_delete()(const default_delete&) noexcept;` | 変換可能な型からのコピーコンストラクタ。 | C++17
C++23からconstexpr指定 | | `~default_delete() = default;` | デストラクタ | C++11 | | `void operator()(T* ptr) const;`
`template `
`void operator()(U*) const = delete;` | 関数呼び出し演算子。渡されたポインタ`ptr`を `delete[] ptr;`で削除する | C++11
C++14まで | -| `template void operator()(U* ptr) const;`| 関数呼び出し演算子。渡されたポインタ`ptr`を `delete[] ptr;`で削除する。変換可能な型の配列へのポインタも削除可能。 | C++17 | +| `template void operator()(U* ptr) const;`| 関数呼び出し演算子。渡されたポインタ`ptr`を `delete[] ptr;`で削除する。変換可能な型の配列へのポインタも削除可能。 | C++17
C++23からconstexpr指定 | ## 例 @@ -83,4 +84,4 @@ int main() ## 参照 - +- [P2273R3 Making `std::unique_ptr` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2273r3.pdf) diff --git a/reference/memory/make_unique.md b/reference/memory/make_unique.md index 1edcdd71d3..b15e45c441 100644 --- a/reference/memory/make_unique.md +++ b/reference/memory/make_unique.md @@ -7,10 +7,14 @@ ```cpp namespace std { template - unique_ptr make_unique(Args&&... args); // (1) + unique_ptr make_unique(Args&&... args); // (1) C++14 + template + constexpr unique_ptr make_unique(Args&&... args); // (1) C++23 template - unique_ptr make_unique(size_t n); // (2) + unique_ptr make_unique(size_t n); // (2) C++14 + template + constexpr unique_ptr make_unique(size_t n); // (2) C++23 template unspecified make_unique(Args&&...) = delete; // (3) @@ -89,6 +93,8 @@ int main() - [N3656 make_unique (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3656.htm) - [Why is `make_unique` disallowed? - stackoverflow](https://stackoverflow.com/questions/16596950/why-is-make-uniquetn-disallowed) - (3)のオーバーロードの意味について +- [P2273R3 Making `std::unique_ptr` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2273r3.pdf) + ## 関連項目 diff --git a/reference/memory/make_unique_for_overwrite.md b/reference/memory/make_unique_for_overwrite.md index 37ce5f94e2..e22c00e000 100644 --- a/reference/memory/make_unique_for_overwrite.md +++ b/reference/memory/make_unique_for_overwrite.md @@ -7,10 +7,14 @@ ```cpp namespace std { template - unique_ptr make_unique_for_overwrite(); // (1) + unique_ptr make_unique_for_overwrite(); // (1) C++20 + template + constexpr unique_ptr make_unique_for_overwrite(); // (1) C++23 template - unique_ptr make_unique_for_overwrite(size_t n); // (2) + unique_ptr make_unique_for_overwrite(size_t n); // (2) C++20 + template + constexpr unique_ptr make_unique_for_overwrite(size_t n); // (2) C++23 template unspecified make_unique_for_overwrite(Args&&...) = delete; // (3) @@ -82,3 +86,4 @@ int main() - [P1973R1 Rename "_default_init" Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1973r1.pdf) - [Why is `make_unique` disallowed? - stackoverflow](https://stackoverflow.com/questions/16596950/why-is-make-uniquetn-disallowed) - (3)のオーバーロードの意味について +- [P2273R3 Making `std::unique_ptr` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2273r3.pdf) diff --git a/reference/memory/unique_ptr/get.md b/reference/memory/unique_ptr/get.md index 2830bc81aa..2876ad8017 100644 --- a/reference/memory/unique_ptr/get.md +++ b/reference/memory/unique_ptr/get.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -pointer get() const noexcept; +pointer get() const noexcept; // (1) C++11 +constexpr pointer get() const noexcept; // (1) C++23 ``` ## 概要 @@ -51,3 +52,7 @@ int main() - [Clang](/implementation.md#clang): 3.0 - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 + + +## 参照 +- [P2273R3 Making `std::unique_ptr` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2273r3.pdf) diff --git a/reference/memory/unique_ptr/get_deleter.md b/reference/memory/unique_ptr/get_deleter.md index 4f56d8ac84..73dc0eb677 100644 --- a/reference/memory/unique_ptr/get_deleter.md +++ b/reference/memory/unique_ptr/get_deleter.md @@ -6,8 +6,11 @@ * cpp11[meta cpp] ```cpp -deleter_type& get_deleter() noexcept; -const deleter_type& get_deleter() const noexcept; +deleter_type& get_deleter() noexcept; // (1) C++11 +constexpr deleter_type& get_deleter() noexcept; // (1) C++23 + +const deleter_type& get_deleter() const noexcept; // (2) C++11 +constexpr const deleter_type& get_deleter() const noexcept; // (2) C++23 ``` ## 概要 @@ -47,3 +50,7 @@ int main() - [Clang](/implementation.md#clang): 3.0 - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 + + +## 参照 +- [P2273R3 Making `std::unique_ptr` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2273r3.pdf) diff --git a/reference/memory/unique_ptr/op_arrow.md b/reference/memory/unique_ptr/op_arrow.md index 12a348a806..dcc9843439 100644 --- a/reference/memory/unique_ptr/op_arrow.md +++ b/reference/memory/unique_ptr/op_arrow.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -pointer operator->() const noexcept; +pointer operator->() const noexcept; // (1) C++11 +constexpr pointer operator->() const noexcept; // (1) C++23 ``` ## 概要 @@ -53,3 +54,7 @@ hello - [Clang](/implementation.md#clang): 3.0 - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 + + +## 参照 +- [P2273R3 Making `std::unique_ptr` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2273r3.pdf) diff --git a/reference/memory/unique_ptr/op_assign.md b/reference/memory/unique_ptr/op_assign.md index bbd33568ca..78fd8e4464 100644 --- a/reference/memory/unique_ptr/op_assign.md +++ b/reference/memory/unique_ptr/op_assign.md @@ -6,14 +6,19 @@ * cpp11[meta cpp] ```cpp -unique_ptr& operator=(unique_ptr&& u) noexcept; // (1) 単一オブジェクト、配列 +unique_ptr& operator=(unique_ptr&& u) noexcept; // (1) C++11 +constexpr unique_ptr& operator=(unique_ptr&& u) noexcept; // (1) C++23 template -unique_ptr& operator=(unique_ptr&& u) noexcept; // (2) 単一オブジェクト、配列(C++17) +unique_ptr& operator=(unique_ptr&& u) noexcept; // (2) C++11 単一オブジェクト版 + // (2) C++17 配列版 +template +constexpr unique_ptr& operator=(unique_ptr&& u) noexcept; // (2) C++23 -unique_ptr& operator=(nullptr_t) noexcept; // (3) 単一オブジェクト、配列 +unique_ptr& operator=(nullptr_t) noexcept; // (3) C++11 +constexpr unique_ptr& operator=(nullptr_t) noexcept; // (3) C++23 -unique_ptr& operator=(const unique_ptr&) = delete; // (4) 単一オブジェクト、配列 +unique_ptr& operator=(const unique_ptr&) = delete; // (4) C++11 ``` * nullptr_t[link /reference/cstddef/nullptr_t.md] @@ -112,3 +117,4 @@ int main() - [LWG 2246. `unique_ptr` assignment effects w.r.t. deleter](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2246) - [LWG 2228: Missing SFINAE rule in unique_ptr templated assignment](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4366) - (2)のSFINAEルール不足の欠陥修正の提案文書 +- [P2273R3 Making `std::unique_ptr` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2273r3.pdf) diff --git a/reference/memory/unique_ptr/op_at.md b/reference/memory/unique_ptr/op_at.md index 61d3f0fea9..319849610c 100644 --- a/reference/memory/unique_ptr/op_at.md +++ b/reference/memory/unique_ptr/op_at.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -T& operator[](std::size_t i) const; +T& operator[](std::size_t i) const; // (1) C++11 +constexpr T& operator[](std::size_t i) const; // (1) C++23 ``` ## 概要 @@ -53,3 +54,7 @@ int main() - [Clang](/implementation.md#clang): 3.0 - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 + + +## 参照 +- [P2273R3 Making `std::unique_ptr` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2273r3.pdf) diff --git a/reference/memory/unique_ptr/op_bool.md b/reference/memory/unique_ptr/op_bool.md index 145b8743fd..8dd564e714 100644 --- a/reference/memory/unique_ptr/op_bool.md +++ b/reference/memory/unique_ptr/op_bool.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -explicit operator bool() const noexcept; +explicit operator bool() const noexcept; // (1) C++11 +constexpr explicit operator bool() const noexcept; // (1) C++23 ``` ## 概要 @@ -58,4 +59,4 @@ p has resource ## 参照 - [N2435 Explicit bool for Smart Pointers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2435.htm) - +- [P2273R3 Making `std::unique_ptr` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2273r3.pdf) diff --git a/reference/memory/unique_ptr/op_compare_3way.md b/reference/memory/unique_ptr/op_compare_3way.md index 927572fd1e..42125823c4 100644 --- a/reference/memory/unique_ptr/op_compare_3way.md +++ b/reference/memory/unique_ptr/op_compare_3way.md @@ -16,13 +16,14 @@ namespace std { operator<=>(const unique_ptr& x, const unique_ptr& y); // (1) C++20 template - requires three_way_comparable_with< - typename unique_ptr::pointer, - nullptr_t> - compare_three_way_result_t< - typename unique_ptr::pointer, - nullptr_t> + requires three_way_comparable_with::pointer> + compare_three_way_result_t::pointer> operator<=>(const unique_ptr& x, nullptr_t); // (2) C++20 + + template + requires three_way_comparable_with::pointer> + constexpr compare_three_way_result_t::pointer> + operator<=>(const unique_ptr& x, nullptr_t); // (2) C++23 } ``` * nullptr_t[link /reference/cstddef/nullptr_t.md] @@ -34,7 +35,7 @@ namespace std { ## テンプレートパラメータ制約 - (1) : 型`unique_ptr::pointer`と型`unique_ptr::pointer`が三方比較可能であること -- (2) : 型`unique_ptr::pointer`と型[`nullptr_t`](/reference/cstddef/nullptr_t.md)が三方比較可能であること +- (2) : 型`unique_ptr::pointer`同士が三方比較可能であること ## 戻り値 @@ -47,7 +48,7 @@ namespace std { - (2) : ```cpp - return compare_three_way()(x.get(), nullptr); + return compare_three_way()(x.get(), static_cast::pointer>(nullptr)); ``` * compare_three_way[link /reference/compare/compare_three_way.md] * get()[link get.md] @@ -96,3 +97,5 @@ p2 is nullptr ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [LWG3426 `operator<=>(const unique_ptr&, nullptr_t)` can't get no satisfaction](https://cplusplus.github.io/LWG/issue3426) +- [P2273R3 Making `std::unique_ptr` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2273r3.pdf) diff --git a/reference/memory/unique_ptr/op_constructor.md b/reference/memory/unique_ptr/op_constructor.md index 8e7f6b4da0..6a6820ebf0 100644 --- a/reference/memory/unique_ptr/op_constructor.md +++ b/reference/memory/unique_ptr/op_constructor.md @@ -8,24 +8,36 @@ ```cpp constexpr unique_ptr() noexcept; // (1) 単一オブジェクト、配列 -explicit unique_ptr(pointer p) noexcept; // (2) 単一オブジェクト、配列(C++14まで) +explicit unique_ptr(pointer p) noexcept; // (2) 単一オブジェクト、配列(C++14まで) +constexpr explicit unique_ptr(pointer p) noexcept; // (2) 単一オブジェクト C++23 template -explicit unique_ptr(U p) noexcept; // (2) 配列 C++17 +explicit unique_ptr(U p) noexcept; // (2) 配列 C++17 +template +constexpr explicit unique_ptr(U p) noexcept; // (2) 配列 C++23 -unique_ptr(pointer p, const D& d1) noexcept; // (3) 単一オブジェクト、配列(C++14まで) +unique_ptr(pointer p, const D& d1) noexcept; // (3) 単一オブジェクト、配列(C++14まで) +constexpr unique_ptr(pointer p, const D& d1) noexcept; // (3) 単一オブジェクト C++23 +template +unique_ptr(U p, const D& d1) noexcept; // (3) 配列 C++17 template -unique_ptr(U p, const D& d1) noexcept; // (3) 配列 C++17 +constexpr unique_ptr(U p, const D& d1) noexcept; // (3) 配列 C++23 -unique_ptr(pointer p, D&& d2) noexcept; // (4) 単一オブジェクト、配列(C++14まで) +unique_ptr(pointer p, D&& d2) noexcept; // (4) 単一オブジェクト、配列(C++14まで) +constexpr unique_ptr(pointer p, D&& d2) noexcept; // (4) 単一オブジェクト C++23 template -unique_ptr(U p, D&& d2) noexcept; // (4) 配列 C++17 +unique_ptr(U p, D&& d2) noexcept; // (4) 配列 C++17 +template +constexpr unique_ptr(U p, D&& d2) noexcept; // (4) 配列 C++23 -unique_ptr(unique_ptr&& u) noexcept; // (5) 単一オブジェクト、配列 +unique_ptr(unique_ptr&& u) noexcept; // (5) 単一オブジェクト、配列 +constexpr unique_ptr(unique_ptr&& u) noexcept; // (5) 単一オブジェクト、配列 C++23 constexpr unique_ptr(nullptr_t) noexcept; // (6) 単一オブジェクト、配列 template unique_ptr(unique_ptr&& u) noexcept; // (7) 単一オブジェクト、配列(C++17) +template +constexpr unique_ptr(unique_ptr&& u) noexcept; // (7) 単一オブジェクト、配列 C++23 template unique_ptr(auto_ptr&& u) noexcept; // (8) 単一オブジェクト @@ -163,3 +175,4 @@ int main() - [LWG Issue 2520 : N4089 broke initializing `unique_ptr` from a nullptr](https://wg21.cmeerw.net/lwg/issue2520) - [LWG Issue 2801. Default-constructibility of `unique_ptr`](https://wg21.cmeerw.net/lwg/issue2948) - [LWG Issue 2905. `is_constructible_v, P, D const &>` should be false when D is not copy constructible](https://wg21.cmeerw.net/lwg/issue2905) +- [P2273R3 Making `std::unique_ptr` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2273r3.pdf) diff --git a/reference/memory/unique_ptr/op_deref.md b/reference/memory/unique_ptr/op_deref.md index 938ea89a4e..1bfd37e7cb 100644 --- a/reference/memory/unique_ptr/op_deref.md +++ b/reference/memory/unique_ptr/op_deref.md @@ -6,9 +6,11 @@ * cpp11[meta cpp] ```cpp -typename add_lvalue_reference::type operator*() const; +typename add_lvalue_reference::type operator*() const; // (1) C++11 +constexpr add_lvalue_reference_t operator*() const; // (1) C++23 ``` * add_lvalue_reference[link /reference/type_traits/add_lvalue_reference.md] +* add_lvalue_reference_t[link /reference/type_traits/add_lvalue_reference.md] ## 概要 ポインタを間接参照する。 @@ -54,3 +56,7 @@ int main() - [Clang](/implementation.md#clang): 3.0 - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 + + +## 参照 +- [P2273R3 Making `std::unique_ptr` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2273r3.pdf) diff --git a/reference/memory/unique_ptr/op_destructor.md b/reference/memory/unique_ptr/op_destructor.md index 123e7905b3..9626191ac0 100644 --- a/reference/memory/unique_ptr/op_destructor.md +++ b/reference/memory/unique_ptr/op_destructor.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -~unique_ptr(); +~unique_ptr(); // C++11 +constexpr ~unique_ptr(); // C++23 ``` ## unique_ptrオブジェクトの破棄 @@ -26,3 +27,7 @@ - [Clang](/implementation.md#clang): 3.0 - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 + + +## 参照 +- [P2273R3 Making `std::unique_ptr` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2273r3.pdf) diff --git a/reference/memory/unique_ptr/op_equal.md b/reference/memory/unique_ptr/op_equal.md index d2f8a3b2b2..b9ede623b4 100644 --- a/reference/memory/unique_ptr/op_equal.md +++ b/reference/memory/unique_ptr/op_equal.md @@ -8,13 +8,19 @@ namespace std { template bool operator==(const unique_ptr& a, const unique_ptr& b); // (1) C++11 + template + constexpr bool operator==(const unique_ptr& a, const unique_ptr& b); // (1) C++23 template bool operator==(const unique_ptr& x, nullptr_t) noexcept; // (2) C++11 + template + constexpr bool operator==(const unique_ptr& x, nullptr_t) noexcept; // (2) C++23 // (2)により以下のオーバーロードが使用可能 (C++20) template bool operator==(nullptr_t, const unique_ptr& x) noexcept; // (3) C++11 + template + constexpr bool operator==(nullptr_t, const unique_ptr& x) noexcept; // (3) C++23 } ``` * nullptr_t[link /reference/cstddef/nullptr_t.md] @@ -78,3 +84,4 @@ p2 is nullptr ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P2273R3 Making `std::unique_ptr` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2273r3.pdf) diff --git a/reference/memory/unique_ptr/op_greater.md b/reference/memory/unique_ptr/op_greater.md index 026f17887d..151f3dbcae 100644 --- a/reference/memory/unique_ptr/op_greater.md +++ b/reference/memory/unique_ptr/op_greater.md @@ -7,13 +7,17 @@ ```cpp namespace std { template - bool operator>(const unique_ptr& a, const unique_ptr& b); // (1) + bool operator>(const unique_ptr& a, const unique_ptr& b); // (1) C++11 template - bool operator>(const unique_ptr& x, nullptr_t); // (2) + bool operator>(const unique_ptr& x, nullptr_t); // (2) C++11 + template + constexpr bool operator>(const unique_ptr& x, nullptr_t); // (2) C++23 template - bool operator>(nullptr_t, const unique_ptr& x); // (3) + bool operator>(nullptr_t, const unique_ptr& x); // (3) C++11 + template + constexpr bool operator>(nullptr_t, const unique_ptr& x); // (3) C++23 } ``` * nullptr_t[link /reference/cstddef/nullptr_t.md] @@ -70,3 +74,7 @@ false - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 - 2012までは`nullptr`バージョンがない。 + + +## 参照 +- [P2273R3 Making `std::unique_ptr` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2273r3.pdf) diff --git a/reference/memory/unique_ptr/op_greater_equal.md b/reference/memory/unique_ptr/op_greater_equal.md index 0b3588b0c3..267ced55d9 100644 --- a/reference/memory/unique_ptr/op_greater_equal.md +++ b/reference/memory/unique_ptr/op_greater_equal.md @@ -7,13 +7,17 @@ ```cpp namespace std { template - bool operator>=(const unique_ptr& a, const unique_ptr& b); // (1) + bool operator>=(const unique_ptr& a, const unique_ptr& b); // (1) C++11 template - bool operator>=(const unique_ptr& x, nullptr_t); // (2) + bool operator>=(const unique_ptr& x, nullptr_t); // (2) C++11 + template + constexpr bool operator>=(const unique_ptr& x, nullptr_t); // (2) C++23 template - bool operator>=(nullptr_t, const unique_ptr& x); // (3) + bool operator>=(nullptr_t, const unique_ptr& x); // (3) C++11 + template + constexpr bool operator>=(nullptr_t, const unique_ptr& x); // (3) C++23 } ``` * nullptr_t[link /reference/cstddef/nullptr_t.md] @@ -70,3 +74,7 @@ false - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 - 2012までは`nullptr`バージョンがない。 + + +## 参照 +- [P2273R3 Making `std::unique_ptr` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2273r3.pdf) diff --git a/reference/memory/unique_ptr/op_less.md b/reference/memory/unique_ptr/op_less.md index 76e2b3943e..edf98f2b0e 100644 --- a/reference/memory/unique_ptr/op_less.md +++ b/reference/memory/unique_ptr/op_less.md @@ -7,13 +7,17 @@ ```cpp namespace std { template - bool operator<(const unique_ptr& a, const unique_ptr& b); // (1) + bool operator<(const unique_ptr& a, const unique_ptr& b); // (1) C++11 template - bool operator<(const unique_ptr& x, nullptr_t); // (2) + bool operator<(const unique_ptr& x, nullptr_t); // (2) C++11 + template + constexpr bool operator<(const unique_ptr& x, nullptr_t); // (2) C++23 template - bool operator<(nullptr_t, const unique_ptr& x); // (3) + bool operator<(nullptr_t, const unique_ptr& x); // (3) C++11 + template + constexpr bool operator<(nullptr_t, const unique_ptr& x); // (3) C++23 } ``` * nullptr_t[link /reference/cstddef/nullptr_t.md] @@ -72,3 +76,7 @@ true - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 - 2012までは`nullptr`バージョンがない。 + + +## 参照 +- [P2273R3 Making `std::unique_ptr` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2273r3.pdf) diff --git a/reference/memory/unique_ptr/op_less_equal.md b/reference/memory/unique_ptr/op_less_equal.md index da0fe43b52..663e8a42d1 100644 --- a/reference/memory/unique_ptr/op_less_equal.md +++ b/reference/memory/unique_ptr/op_less_equal.md @@ -7,13 +7,17 @@ ```cpp namespace std { template - bool operator<=(const unique_ptr& a, const unique_ptr& b); // (1) + bool operator<=(const unique_ptr& a, const unique_ptr& b); // (1) C++11 template - bool operator<=(const unique_ptr& x, nullptr_t); // (2) + bool operator<=(const unique_ptr& x, nullptr_t); // (2) C++11 + template + constexpr bool operator<=(const unique_ptr& x, nullptr_t); // (2) C++23 template - bool operator<=(nullptr_t, const unique_ptr& x); // (3) + bool operator<=(nullptr_t, const unique_ptr& x); // (3) C++11 + template + constexpr bool operator<=(nullptr_t, const unique_ptr& x); // (3) C++23 } ``` * nullptr_t[link /reference/cstddef/nullptr_t.md] @@ -70,3 +74,7 @@ true - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 - 2012までは`nullptr`バージョンがない。 + + +## 参照 +- [P2273R3 Making `std::unique_ptr` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2273r3.pdf) diff --git a/reference/memory/unique_ptr/op_not_equal.md b/reference/memory/unique_ptr/op_not_equal.md index d200e0915c..698faed96b 100644 --- a/reference/memory/unique_ptr/op_not_equal.md +++ b/reference/memory/unique_ptr/op_not_equal.md @@ -9,12 +9,18 @@ namespace std { // operator==により、以下の演算子が使用可能になる (C++20) template bool operator!=(const unique_ptr& a, const unique_ptr& b); // (1) C++11 + template + constexpr bool operator!=(const unique_ptr& a, const unique_ptr& b); // (1) C++23 template bool operator!=(const unique_ptr& x, nullptr_t) noexcept; // (2) C++11 + template + constexpr bool operator!=(const unique_ptr& x, nullptr_t) noexcept; // (2) C++23 template bool operator!=(nullptr_t, const unique_ptr& x) noexcept; // (3) C++11 + template + constexpr bool operator!=(nullptr_t, const unique_ptr& x) noexcept; // (3) C++23 } ``` * nullptr_t[link /reference/cstddef/nullptr_t.md] @@ -74,3 +80,4 @@ p3 is not nullptr ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P2273R3 Making `std::unique_ptr` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2273r3.pdf) diff --git a/reference/memory/unique_ptr/release.md b/reference/memory/unique_ptr/release.md index 36ab382f48..074cc13c0f 100644 --- a/reference/memory/unique_ptr/release.md +++ b/reference/memory/unique_ptr/release.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -pointer release() noexcept; +pointer release() noexcept; // (1) C++11 +constexpr pointer release() noexcept; // (1) C++23 ``` ## 概要 @@ -60,3 +61,7 @@ int main() - [Clang](/implementation.md#clang): 3.0 - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 + + +## 参照 +- [P2273R3 Making `std::unique_ptr` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2273r3.pdf) diff --git a/reference/memory/unique_ptr/reset.md b/reference/memory/unique_ptr/reset.md index a61850b7fe..11e85d8f68 100644 --- a/reference/memory/unique_ptr/reset.md +++ b/reference/memory/unique_ptr/reset.md @@ -6,14 +6,17 @@ * cpp11[meta cpp] ```cpp -void reset(pointer p = pointer()) noexcept; // (1) +void reset(pointer p = pointer()) noexcept; // (1) C++11 +constexpr void reset(pointer p = pointer()) noexcept; // (1) C++23 // 配列版のみ -void reset(nullptr_t p) noexcept; // (2) C++14まで -void reset(nullptr_t = nullptr) noexcept; // (2) C++17 +void reset(nullptr_t p) noexcept; // (2) C++11 +void reset(nullptr_t = nullptr) noexcept; // (2) C++17 +constexpr void reset(nullptr_t = nullptr) noexcept; // (2) C++23 -template void reset(U) = delete; // (3) C++14まで -template void reset(U p) noexcept; // (3) C++17 +template void reset(U) = delete; // (3) C++11 +template void reset(U p) noexcept; // (3) C++17 +template constexpr void reset(U p) noexcept; // (3) C++23 ``` ## 概要 @@ -81,3 +84,4 @@ p doesn't have resource ## 参照 - [LWG Issue 2169. Missing `reset()` requirements in `unique_ptr` specialization](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2169) - [N4089 Safe conversions in `unique_ptr`, revision 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4089.pdf) +- [P2273R3 Making `std::unique_ptr` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2273r3.pdf) diff --git a/reference/memory/unique_ptr/swap.md b/reference/memory/unique_ptr/swap.md index 737dd69790..3cd9b0f1b6 100644 --- a/reference/memory/unique_ptr/swap.md +++ b/reference/memory/unique_ptr/swap.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -void swap(unique_ptr& x) noexcept; +void swap(unique_ptr& x) noexcept; // (1) C++11 +constexpr void swap(unique_ptr& x) noexcept; // (1) C++23 ``` ## 概要 @@ -64,3 +65,7 @@ int main() - [Clang](/implementation.md#clang): 3.0 - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 + + +## 参照 +- [P2273R3 Making `std::unique_ptr` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2273r3.pdf) diff --git a/reference/memory/unique_ptr/swap_free.md b/reference/memory/unique_ptr/swap_free.md index f91b897911..8d67c3ff00 100644 --- a/reference/memory/unique_ptr/swap_free.md +++ b/reference/memory/unique_ptr/swap_free.md @@ -7,7 +7,10 @@ ```cpp namespace std { template - void swap(unique_ptr& a, unique_ptr& b) noexcept; + void swap(unique_ptr& a, unique_ptr& b) noexcept; // (1) C++11 + + template + constexpr void swap(unique_ptr& a, unique_ptr& b) noexcept; // (1) C++23 } ``` @@ -62,3 +65,7 @@ int main() - [Clang](/implementation.md#clang): 3.0 - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 + + +## 参照 +- [P2273R3 Making `std::unique_ptr` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2273r3.pdf) From 9769a2621a0cc735b6a3eacbc0ca487bbbaf361d Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 16 Jan 2023 19:25:15 +0900 Subject: [PATCH 0030/3948] =?UTF-8?q?=20:=20formattable=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20#1085?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format.md | 1 + reference/format/formattable.md | 83 +++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 reference/format/formattable.md diff --git a/reference/format.md b/reference/format.md index 0b8e6334e5..11273eceeb 100644 --- a/reference/format.md +++ b/reference/format.md @@ -24,6 +24,7 @@ | 名前 | 説明 | 対応バージョン | |----------------------------------------------------------------------|-----------------------------------------------------------------------------|----------------| +| [`formattable`](format/formattable.md) | 文字列フォーマット可能 (concept) | C++23 | | [`formatter`](format/formatter.md) | 引数の型に対応する書式文字列の解析、値のフォーマットを担う (class template) | C++20 | | [`basic_format_parse_context`](format/basic_format_parse_context.md) | 書式文字列の解析のコンテキスト (class template) | C++20 | | [`format_parse_context`](format/basic_format_parse_context.md) | `basic_format_parse_context`のマルチバイト文字列版 (type-alias) | C++20 | diff --git a/reference/format/formattable.md b/reference/format/formattable.md new file mode 100644 index 0000000000..df74f2bbda --- /dev/null +++ b/reference/format/formattable.md @@ -0,0 +1,83 @@ +# formattable +* format[meta header] +* concept[meta id-type] +* std[meta namespace] +* cpp23[meta cpp] + +```cpp +namespace std { + template + concept fmt-iter-for = output_iterator; + + template + concept formattable = + semiregular, charT>> && + requires(formatter, charT> f, + const formatter, charT> cf, + T t, + basic_format_context, charT> fc, + basic_format_parse_context pc) { + { f.parse(pc) } -> same_as::iterator>; + { cf.format(t, fc) } -> same_as>; + } + }; +} +``` +* formatter[link formatter.md] +* semiregular[link /reference/concepts/semiregular.md] +* remove_cvref_t[link /reference/type_traits/remove_cvref.md] +* basic_format_context[link basic_format_context.md] +* basic_format_parse_context[link basic_format_parse_context.md] +* same_as[link /reference/concepts/same_as.md] + +## 概要 +`formattable`は、文字列フォーマット可能であることを表すコンセプトである。 + +このコンセプトを使用することで、[`formatter`](formatter.md)クラステンプレートが使用したい型で特殊化されているかをチェックできる。 + + +## 例 +```cpp example +#include +#include +#include + +template T> +void f(T x) { + std::cout << std::format("{}", x) << std::endl; +} + +int main() { + f(3); // OK + f("hello"); // OK +//f(std::any{3}); // NG : std::anyはstd::formatterを特殊化していない +} +``` +* std::format[link format.md] +* + +### 出力 +``` +3 +hello +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13 +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 関連項目 + +- [C++20 コンセプト](/lang/cpp20/concepts.md) +- [`is_copy_constructible`](/reference/type_traits/is_copy_constructible.md) + +## 参照 + +- [P0898R3 Standard Library Concepts](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0898r3.pdf) +- [P1754R1 Rename concepts to standard_case for C++20, while we still can](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1754r1.pdf) +- [LWG Issue 3141. `CopyConstructible` doesn't preserve source values](https://wg21.cmeerw.net/lwg/issue3141) From 7435b8b5b5c5b7b909bbdecc643632204f3697c8 Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 16 Jan 2023 19:38:10 +0900 Subject: [PATCH 0031/3948] =?UTF-8?q?=E3=83=98=E3=83=83=E3=83=80=E4=B8=80?= =?UTF-8?q?=E8=A6=A7=E3=81=8B=E3=82=89=E3=82=92=E5=89=8A?= =?UTF-8?q?=E9=99=A4=E3=81=97=E3=80=81=E5=B0=86=E6=9D=A5=E3=81=AEC++?= =?UTF-8?q?=E6=A4=9C=E8=A8=8E=E3=83=9A=E3=83=BC=E3=82=B8=E3=81=B8=E7=A7=BB?= =?UTF-8?q?=E5=8B=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/future.md | 6 ++++++ reference.md | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lang/future.md b/lang/future.md index b62c6980eb..f20b39a43e 100644 --- a/lang/future.md +++ b/lang/future.md @@ -10,3 +10,9 @@ |----------|------| | [契約に基づくプログラミング](future/contract-based_programming.md) | 事前条件、事後条件、表明を宣言する新たな属性構文を追加 | + +## ライブラリ + +| ヘッダ | 説明 | +|--------|------| +| [``](/reference/contract.md) | 契約違反のハンドリング | diff --git a/reference.md b/reference.md index 1345041222..e43685df13 100644 --- a/reference.md +++ b/reference.md @@ -31,7 +31,6 @@ | [``](/reference/new.md) | 動的メモリ管理 | | | [``](/reference/typeinfo.md) | 型情報 | | | [``](/reference/source_location.md) | ソースコード上の位置 | C++20 | -| [``](/reference/contract.md) | 契約違反のハンドリング | C++23 | | [``](/reference/exception.md) | 例外ハンドリング | | | [``](/reference/initializer_list.md) | 初期化子リスト | C++11 | | [``](/reference/compare.md) | 比較演算 | C++20 | From 6110d2acd09265649b59d92bce37988f9bb6c491 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 16 Jan 2023 19:44:52 +0900 Subject: [PATCH 0032/3948] =?UTF-8?q?formattable=20:=20=E5=8F=82=E7=85=A7?= =?UTF-8?q?=E3=82=92=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/formattable.md | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/reference/format/formattable.md b/reference/format/formattable.md index df74f2bbda..b10613e016 100644 --- a/reference/format/formattable.md +++ b/reference/format/formattable.md @@ -71,13 +71,6 @@ hello - [GCC](/implementation.md#gcc): 13 - [Visual C++](/implementation.md#visual_cpp): ?? -## 関連項目 - -- [C++20 コンセプト](/lang/cpp20/concepts.md) -- [`is_copy_constructible`](/reference/type_traits/is_copy_constructible.md) ## 参照 - -- [P0898R3 Standard Library Concepts](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0898r3.pdf) -- [P1754R1 Rename concepts to standard_case for C++20, while we still can](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1754r1.pdf) -- [LWG Issue 3141. `CopyConstructible` doesn't preserve source values](https://wg21.cmeerw.net/lwg/issue3141) +- [P2286R8 Formatting Ranges](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2286r8.html) From 8ba4402df9b92a45ccca16558fc3e504d97cff28 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 16 Jan 2023 22:05:35 +0900 Subject: [PATCH 0033/3948] =?UTF-8?q?=E5=9B=BD=E9=9A=9B=E6=A8=99=E6=BA=96?= =?UTF-8?q?=E8=A6=8F=E6=A0=BC=20:=20C++23=E3=81=AEWorking=20Draft=E3=82=92?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=20#1107?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- international-standard.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/international-standard.md b/international-standard.md index df1836e22c..ef735925a0 100644 --- a/international-standard.md +++ b/international-standard.md @@ -12,7 +12,7 @@ C++ の標準規格は、他にも各国の規格化団体によって国際標 | 通称†1 | 名称 | 参照する規格案†2 | 規格案・原案 | `__cplusplus` | |:--|:--|:--|:--|:--| -| [C++23](lang/cpp23.md) (C++2b) | ISO/IEC 14882:2023 (予定) | N4917([PDF](http://open-std.org/jtc1/sc22/wg21/docs/papers/2022/n4917.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/)) | N4917 N4910 N4901 N4892 N4885 N4878
N4868 N4861 | -- | +| [C++23](lang/cpp23.md) (C++2b) | ISO/IEC 14882:2023 (予定) | N4929([PDF](http://open-std.org/jtc1/sc22/wg21/docs/papers/2022/n4928.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/)) | N4928 N4917 N4910 N4901 N4892 N4885 N4878
N4868 N4861 | -- | | [C++20](lang/cpp20.md) (C++2a) | ISO/IEC 14882:2020 | N4861†3([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/n4861.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4861/)) | N4860 N4849 N4842 N4835 N4830
N4820 N4810 N4800 N4791 N4788†4
N4778 N4762 N4750 N4741 N4727
N4713 N4700 N4687 | `202002L` | | [C++17](lang/cpp17.md) (C++1z) | ISO/IEC 14882:2017 | N4659([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4659.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4659/)) | N4660 N4659 N4640 N4618 N4606
N4594 N4582 N4567 N4527 N4431
N4296 | `201703L` | | [C++14](lang/cpp14.md) (C++1y) | ISO/IEC 14882:2014 | N4140([PDF](https://github.com/cplusplus/draft/blob/master/papers/n4140.pdf?raw=true)/[HTML](https://timsong-cpp.github.io/cppwp/n4140/)) | N4141 N4140 N3937 N3936 N3797
N3691 N3690 N3485 N3376 N3337 | `201402L` | From 0818b7295acfa3a6ddad86c8331655f9cc8c2d25 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 16 Jan 2023 22:42:05 +0900 Subject: [PATCH 0034/3948] =?UTF-8?q?C++23=20:=20=E8=A8=80=E8=AA=9E?= =?UTF-8?q?=E6=A9=9F=E8=83=BD=E3=81=A8=E3=81=97=E3=81=A6N4929=E3=81=AEEdit?= =?UTF-8?q?or's=20Report=E3=81=A7=E6=8E=A1=E6=8A=9E=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=81=9F=E3=82=82=E3=81=AE=E3=82=92=E8=A8=98=E8=BC=89=20#1107?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4929.html --- implementation-status.md | 4 ++++ lang/cpp23.md | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/implementation-status.md b/implementation-status.md index 615506a9c7..81c76ff7cb 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -251,7 +251,9 @@ | P2266R3: [暗黙的なムーブを簡略化](/lang/cpp23/simpler_implicit_move.md.nolink) | 参照を返す関数の`return`文で暗黙的にムーブされない問題を修正 | 13 | 13 | - | - | | P1467R9: [浮動小数点数型の拡張](/lang/cpp23/extended_floating_point_types_and_standard_names.md.nolink) | 実装による拡張浮動小数点型の定義を許可する | 13 | - | - | - | | P1787R6: [スコープと名前ルックアップの仕様整理](/lang/cpp23/declarations_and_where_to_find_them.md.nolink) | 複雑で不完全になっているスコープと名前ルックアップの仕様を整理し、一部の問題を解決する | - | - | - | - | +| P2615R1: [無意味なexport宣言を禁止する](/lang/cpp23/meaningful_exports.md.nolink) | | - | - | - | - | | P2360R0: [初期化文での型の別名宣言を許可](/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md.nolink) | `for (using T = int; T e : v) {}`を許可 | 12 | 14 | - | - | +| P2718R0: [範囲for文が範囲への参照を延命することを規定](lang/cpp23/lifetime_extension_in_range_based_for_loop.md.nolink) | | - | - | - | - | | P2324R2: [関数末尾のラベルを許可](/lang/cpp23/labels_at_the_end_of_compound_statements.md.nolink) | C互換のため、関数末尾でのgoto文のラベルを許可する | 13 | 16 | - | - | | P0847R7: [自身のオブジェクトを明示的にパラメータとして指定する](/lang/cpp23/deducing_this.md.nolink) | メンバ関数が`*this`の型・オブジェクトをパラメータとしてとり、`*this`オブジェクトがconst/非const、左辺値/右辺値であるかをメンバ関数内で識別できるようにする | - | - | - | 2022 Update 2 (partial) | | P1847R4: [アクセス制御の異なるメンバ変数のレイアウトを宣言順に規定](/lang/cpp23/make_declaration_order_layout_mandated.md.nolink) | アクセス制御の異なるメンバ変数のレイアウトが実装によって異なっていたため仕様を規定 | Yes | Yes | - | Yes | @@ -268,6 +270,8 @@ | P2242R3: [定数式内での非リテラル変数の使用を含められないようにする](/lang/cpp23/non_literal_variables_in_constexpr_functions.md.nolink) | 定数式内で静的変数・スレッドローカル変数およびgoto文とラベルを含められない制限を設ける | 12 | 15 | - | - | | P2246R1: [静的な診断メッセージの文字エンコーディング](/lang/cpp23/character_encoding_of_diagnostic_text.md.nolink) | `static_assert`や`[[deprecated]]`などの診断メッセージの文字集合に関する要件をなくす | - | yes | - | - | | P2448R2: [`constexpr`関数のすべての引数が定数実行できない場合でも適格とする](/lang/cpp23/relaxing_some_constexpr_restrictions.md.nolink) | | 13 | - | - | - | +| P2647R1: [`constexpr`関数内での`static constexpr`変数を許可](/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md.nolink) | | - | - | - | - | +| P2564R3: [`constexpr`関数内で`consteval`関数を呼び出せない問題を緩和](/lang/cpp23/consteval_needs_to_propagate_up.md.nolink) | | - | - | - | - | | P1102R2: [ラムダ式で`()`を省略できる条件を緩和](/lang/cpp23/down_with_lambda_parens.md.nolink) | キャプチャや修飾をともなってもパラメータリストが空であれば`()`を省略できる | 11 | 13 | - | - | | P2173R1: [ラムダ式に対する属性](/lang/cpp23/attributes_on_lambda_expressions.md.nolink) | ラムダ式のいくつかの箇所に属性を記述できるようにする | 9 | 13 | - | - | | P1774R8: [コード内容の仮定をコンパイラに伝えるassume属性](/lang/cpp23/portable_assumptions.md.nolink) | 最適化のために、コードの仮定をコンパイラに伝える属性を標準化する | 13 | - | - | - | diff --git a/lang/cpp23.md b/lang/cpp23.md index c41b7292bf..c142958e59 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -22,6 +22,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| | [スコープと名前ルックアップの仕様整理](cpp23/declarations_and_where_to_find_them.md.nolink) | 複雑で不完全になっているスコープと名前ルックアップの仕様を整理し、一部の問題を解決する | +| [無意味なexport宣言を禁止する](cpp23/meaningful_exports.md.nolink) | | ### 制御構文 @@ -29,6 +30,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| | [初期化文での型の別名宣言を許可](cpp23/extend_init_statement_to_allow_alias_declaration.md.nolink) | `for (using T = int; T e : v) {}`を許可 | +| [範囲for文が範囲への参照を延命することを規定](cpp23/lifetime_extension_in_range_based_for_loop.md.nolink) | | | [関数末尾のラベルを許可](cpp23/labels_at_the_end_of_compound_statements.md.nolink) | C互換のため、関数末尾でのgoto文のラベルを許可する | @@ -69,6 +71,8 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 | [定数式内での非リテラル変数の使用を含められないようにする](cpp23/non_literal_variables_in_constexpr_functions.md.nolink) | 定数式内で静的変数・スレッドローカル変数およびgoto文とラベルを含められない制限を設ける | | [静的な診断メッセージの文字エンコーディング](cpp23/character_encoding_of_diagnostic_text.md.nolink) | `static_assert`や`[[deprecated]]`などの診断メッセージの文字集合に関する要件をなくす | | [`constexpr`関数のすべての引数が定数実行できない場合でも適格とする](cpp23/relaxing_some_constexpr_restrictions.md.nolink) | | +| [`constexpr`関数内での`static constexpr`変数を許可](cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md.nolink) | | +| [`constexpr`関数内で`consteval`関数を呼び出せない問題を緩和](cpp23/consteval_needs_to_propagate_up.md.nolink) | | ### ラムダ式 From 1b669b142f7641f9d1239543ab39082ccb21dc26 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 17 Jan 2023 11:28:44 +0900 Subject: [PATCH 0035/3948] =?UTF-8?q?utility/unreachable:=20P0627R6?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C(#1068)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23.md | 2 +- reference/utility.md | 7 +++ reference/utility/unreachable.md | 77 ++++++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 reference/utility/unreachable.md diff --git a/lang/cpp23.md b/lang/cpp23.md index c142958e59..810613cfbb 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -204,7 +204,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 - [``](/reference/utility.md)に、列挙値を基底型に変換する[`std::to_underlying()`](/reference/utility/to_underlying.md)関数を追加 - [``](/reference/utility.md)に、 (主に) メンバ変数を転送するため、指定された型の`const`性と参照修飾で引数を転送する[`std::forward_like()`](/reference/utility/forward_like.md)関数を追加 - [`std::optional`](/reference/optional/optional.md)クラスにモナド操作としてメンバ関数[`and_then()`](/reference/optional/optional/and_then.md.nolink)、[`transform()`](/reference/optional/optional/transform.md.nolink)、[`or_else()`](/reference/optional/optional/or_else.md.nolink)を追加 -- 到達しないパスであることを表明する関数[`std::unreachable()`](/reference/utility/unreachable.md.nolink)を追加 +- 到達しないパスであることを表明する関数[`std::unreachable()`](/reference/utility/unreachable.md)を追加 - [`std::bitset`](/reference/bitset/bitset.md)クラスをさらに`constexpr`対応 diff --git a/reference/utility.md b/reference/utility.md index 4b567f5331..490c181eb5 100644 --- a/reference/utility.md +++ b/reference/utility.md @@ -68,6 +68,13 @@ | [`to_underlying`](utility/to_underlying.md) | 列挙値を基底型に変換する (function template) | C++23 | +## 列挙型 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`unreachable`](utility/unreachable.md) | コードパス不到達を表明する (function) | C++23 | + + ## 組 | 名前 | 説明 | 対応バージョン | diff --git a/reference/utility/unreachable.md b/reference/utility/unreachable.md new file mode 100644 index 0000000000..0c3fb66efd --- /dev/null +++ b/reference/utility/unreachable.md @@ -0,0 +1,77 @@ +## unreachable +* utility[meta header] +* function[meta id-type] +* std[meta namespace] +* cpp23[meta cpp] + +```cpp +namespace std { + [[noreturn]] void unreachable(); +} +``` + +## 概要 +コード実行が本関数に到達しないことを表明する。 + + +## 事前条件 +`true`==`false` + + +## 備考 +`std::unreachable`関数の事前条件は決して満たされない(恒偽式)となるため、関数呼び出しは常に未定義の動作を引き起こす。 +C++コンパイラはこの情報を利用し、`std::unreachable`呼び出しを含まないコードパスのみが実行されうると仮定して、より高速に動作するプログラムを生成する可能性がある。 + + +## 例 +```cpp example +#include +#include + +int f(int x) +{ + switch (x) { + case 0: + case 1: + return x; + default: + std::unreachable(); + } +} + +int main() +{ + std::cout << f(0) << std::endl; + std::cout << f(1) << std::endl; + // f(2)呼び出しは未定義動作 +} +``` +* std::unreachable[color ff0000] + +### 出力 +``` +0 +1 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 15.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [C++20 `[[likely]]`, `[[unlikely]]`属性](/lang/cpp20/likely_and_unlikely_attributes.md) + + +## 参照 +- [GCC Built-in Function: `__builtin_unreachable`](https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html) +- [Clang Builtin Function: `__builtin_unreachable`](https://clang.llvm.org/docs/LanguageExtensions.html) +- [MSVC Compiler intrinsics: `__assume`](https://learn.microsoft.com/en-us/cpp/intrinsics/assume) +- [P0627R6 Function to mark unreachable code](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0627r6.pdf) From aa403df17d9a20ce6fa2836861a09e45c43a466c Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 17 Jan 2023 11:39:47 +0900 Subject: [PATCH 0036/3948] utility/unreachable: fix markup --- reference/utility/unreachable.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/utility/unreachable.md b/reference/utility/unreachable.md index 0c3fb66efd..61f59ec685 100644 --- a/reference/utility/unreachable.md +++ b/reference/utility/unreachable.md @@ -1,4 +1,4 @@ -## unreachable +# unreachable * utility[meta header] * function[meta id-type] * std[meta namespace] From 1e4b73b5da23e978ded1e96d3e12dfa8cb2746ff Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 17 Jan 2023 12:50:51 +0900 Subject: [PATCH 0037/3948] =?UTF-8?q?format=20:=20=E3=83=87=E3=83=90?= =?UTF-8?q?=E3=83=83=E3=82=B0=E6=8C=87=E5=AE=9A=E3=81=A8=E3=80=81C++23?= =?UTF-8?q?=E5=90=91=E3=81=91=E3=82=B5=E3=83=B3=E3=83=97=E3=83=AB=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E3=82=92=E8=BF=BD=E5=8A=A0=20#1085?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/format.md | 139 +++++++++++++++++++++++++++++++------ 1 file changed, 116 insertions(+), 23 deletions(-) diff --git a/reference/format/format.md b/reference/format/format.md index 35dec427a9..5f79af9521 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -94,9 +94,10 @@ string s3 = format("{} {1}", "a", "b"); // コンパイルエラー #### 文字列型の場合 -| type | 意味 | -|:-----------|:-----------------| -| s (省略可) | 文字列 | +| type | 意味 | 対応バージョン | +|:-----------|:-------------|----------------| +| s (省略可) | 文字列 | C++20 | +| ? | デバッグ出力 | 文字・文字列を引用符で囲み、エスケープシーケンスをエスケープして出力 (例:`"\n"`は`"\"\\n\""`となる) | C++23 | #### 文字型 / `bool`型 / 整数型の場合 @@ -105,17 +106,18 @@ string s3 = format("{} {1}", "a", "b"); // コンパイルエラー * 以下の表の通りに[`to_chars`](/reference/charconv/to_chars.md)を呼び出したあと、その結果を出力へコピーするかのような振る舞いをする。ただし、実際に[`to_chars`](/reference/charconv/to_chars.md)を呼び出すかどうかは規定されていない。 * 実際には、出力へコピーする際にパディングなども行われる。 -| type | 意味 | 効果 | -|:-----------|:--------------------------------|:--------------------------------------------------------------------------| -| b | 2進数(小文字) | `to_chars(first, last, value, 2)` (代替表現の接頭辞 `0b`) | -| B | 2進数(大文字) | `b`の大文字版 (代替表現の接頭辞 `0B`) | -| c | 文字として出力 | `static_cast(value)` (収まらないときは`format_error`) | -| d | 10進数 | `to_chars(first, last, value)` | -| n | 10進数(ロケールを考慮する) | ロケール依存の桁区切りを使った`d` | -| o | 8進数 | `to_chars(first, last, value, 8)` (代替表現の接頭辞 `0`、ただし値が0のときは接頭辞なし) | -| x | 16進数(小文字) | `to_chars(first, last, value, 16)` (代替表現の接頭辞 `0x`) | -| X | 16進数(大文字) | `x`の大文字版 (代替表現の接頭辞 `0X`) | -| (なし) | デフォルト | `d` (整数型の場合)
`c` (文字型の場合)
`"true"`/`"false"`を出力(`bool`型の場合) | +| type | 意味 | 効果 | 対応バージョン | +|:-------|:---------------------------|:--------------------------------------------------------------------------|----------------| +| b | 2進数(小文字) | `to_chars(first, last, value, 2)` (代替表現の接頭辞 `0b`) | C++20 | +| B | 2進数(大文字) | `b`の大文字版 (代替表現の接頭辞 `0B`) | C++20 | +| c | 文字として出力 | `static_cast(value)` (収まらないときは`format_error`) | C++20 | +| d | 10進数 | `to_chars(first, last, value)` | C++20 | +| n | 10進数(ロケールを考慮する) | ロケール依存の桁区切りを使った`d` | C++20 | +| o | 8進数 | `to_chars(first, last, value, 8)` (代替表現の接頭辞 `0`、ただし値が0のときは接頭辞なし) | C++20 | +| x | 16進数(小文字) | `to_chars(first, last, value, 16)` (代替表現の接頭辞 `0x`) | C++20 | +| X | 16進数(大文字) | `x`の大文字版 (代替表現の接頭辞 `0X`) | C++20 | +| ? | デバッグ出力 | 文字・文字列を引用符で囲み、エスケープシーケンスをエスケープして出力 (例:`"\n"`は`"\"\\n\""`となる) | C++23 | +| (なし) | デフォルト | `d` (整数型の場合)
`c` (文字型の場合)
`"true"`/`"false"`を出力(`bool`型の場合) | C++20 | #### 浮動小数点数型の場合 @@ -246,6 +248,7 @@ return vformat(loc, fmt.str, make_wformat_args(args...)); // (4) * あるいは、`to_wchars`のようなものを作り、それを使うことも考えられる。 ## 例 +### 基本的な使い方 (C++20) ```cpp example #include #include @@ -256,11 +259,101 @@ int main() } ``` -### 出力 +#### 出力 ``` The answer is 42. ``` +### 文字・文字列を出力する (C++23) +```cpp example +#include +#include + +int main() { + // デフォルトの文字列出力。 + // 引用符で囲まれず「hello」が出力される + std::cout << std::format("0. {}", "hello") << std::endl; + + // デバッグ出力。 + // 引用符で囲まれ「"hello"」が出力される + std::cout << std::format("1. {:?}", "hello") << std::endl; + + // エスケープシーケンスを含む文字列をデフォルト出力。 + // エスケープシーケンスが処理され、以下のように出力される: + // hello + // world + std::cout << std::format("2. {}", "hello\nworld") << std::endl; + + // エスケープシーケンスを含む文字列をデバッグ出力。 + // エスケープシーケンスがエスケープされて以下のように出力される: + // "hello\nworld" + std::cout << std::format("3. {:?}", "hello\nworld") << std::endl; +} +``` + +#### 出力 +``` +hello +"hello" +hello +world +"hello\nworld" +``` + +### コンテナ・Rangeを出力する (C++23) +```cpp example +#include +#include +#include +#include +#include +#include + +int main() { + std::vector vi = {1, 2, 3}; + std::vector vs = {"aaa", "bbb", "ccc"}; + std::map m {{1, "aaa"}, {2, "bbb"}}; + std::set s = {1, 2, 3}; + auto r = std::ranges::views::iota(1, 5); + + std::cout << std::format("0. {}", vi) << std::endl; + std::cout << std::format("1. {}", vs) << std::endl; + std::cout << std::format("2. {}", m) << std::endl; + std::cout << std::format("3. {}", s) << std::endl; + std::cout << std::format("4. {}", r) << std::endl; +} +``` +* std::ranges::views::iota[link /reference/ranges/iota_view.md] + +#### 出力 +``` +0. [1, 2, 3] +1. ["abc", "bbb", "ccc"] +2. {1: "aaa", 2: "bbb"} +3. {1, 2, 3} +4. [1, 2, 3, 4] +``` + +### pair、tupleを出力する (C++23) +```cpp example +#include +#include +#include +#include + +int main() +{ + std::cout << std::format("{}", std::tuple{3, 1.23, "hello"}) << std::endl; + std::cout << std::format("{}", std::pair{3, "hello"}) << std::endl; +} +``` + +#### 出力 +``` +(3, 1.23, "hello") +(3, "hello") +``` + ## 実装例 ```cpp template @@ -303,14 +396,14 @@ wstring format(const locale& loc, wformat_string fmt, const Args&... ar ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? -- [ICC](/implementation.md#icc): ?? +- [GCC](/implementation.md#gcc): 13 - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 - -* [Working Draft, Standard for Programming Language C++ [format]](https://timsong-cpp.github.io/cppwp/format) -* [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) -* [P1652R1 Printf corner cases in std::format](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1652r1.html) -* [P2216R3 std::format improvements](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2216r3.html) -* [[C++] std::formatあるいは{fmt}のコンパイル時フォーマット文字列チェックの魔術 - 地面を見下ろす少年の足蹴にされる私](https://onihusube.hatenablog.com/entry/2021/07/01/195912) +- [Working Draft, Standard for Programming Language C++ [format]](https://timsong-cpp.github.io/cppwp/format) +- [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) +- [P1652R1 Printf corner cases in std::format](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1652r1.html) +- [P2216R3 std::format improvements](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2216r3.html) +- [[C++] std::formatあるいは{fmt}のコンパイル時フォーマット文字列チェックの魔術 - 地面を見下ろす少年の足蹴にされる私](https://onihusube.hatenablog.com/entry/2021/07/01/195912) +- [P2286R8 Formatting Ranges](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2286r8.html) + - C++23から、Range・コンテナ、`pair`、`tuple`のフォーマット出力、および文字・文字列のデバッグ指定 (`"?"`) が追加された From 30fc8dfa3b393e0d82cb47e01f87483cdc6abe38 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 17 Jan 2023 13:47:24 +0900 Subject: [PATCH 0038/3948] =?UTF-8?q?format=20:=20Range=E3=81=A8tuple-type?= =?UTF-8?q?=E3=81=AE=E6=9B=B8=E5=BC=8F=E4=BB=95=E6=A7=98=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=20#1085?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/format.md | 74 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 72 insertions(+), 2 deletions(-) diff --git a/reference/format/format.md b/reference/format/format.md index 5f79af9521..c248160a47 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -141,6 +141,68 @@ string s3 = format("{} {1}", "a", "b"); // コンパイルエラー ポインタは`void*`のみサポートする。それ以外のポインタは、`void*`にキャストしなければ出力できない。 +#### Range・シーケンスコンテナの場合 (C++23) + +Range・シーケンスコンテナに対して使用できる標準のオプション書式は次の通り(`[]`は省略可の意味)。 + +``` +[[fill] align] [width] [n] [range-type] [: range-underlying-spec] +``` + +* `fill` : アライメントに使う文字 (デフォルト: スペース) +* `align` : アライメント(デフォルトは型による) + * `>` : 右寄せ + * `<` : 左寄せ + * `^` : 中央寄せ +* `width` : 幅 (省略時は値に応じて幅が決まり、アライメントは機能しない) + * 置換フィールドを使って変数で指定できる +* `n` : 囲み文字をなくす +* `range-type` : Range・コンテナの表現方法(表を参照) +* `range-underlying-spec` : 要素の書式 (この上にある表を参照) + +| range-type | 意味 | 効果 | 対応バージョン | +|------------|------|------|----------------| +| m | `std::map`出力向けの書式 | 全体の囲み文字を`[ ]`の代わりに`{ }`とする。要素型がtuple-like型であれば要素型にも`m`書式を適用する | C++23 | +| s | 文字列として出力 | 要素型が文字型であること。エスケープ処理しない文字列として書式化する | C++23 | +| ?s | デバッグ文字列として出力 | 要素型が文字型であること。エスケープした文字列として書式化する | C++23 | + +- `?s`書式を指定した場合、`n`オプションと、`range-underlying-spec`は指定できない。 +- コンテナが[`std::vector`](/reference/vector/vector.md)``である場合、その要素型は`bool`として処理される + + +#### 連想コンテナの場合 (C++23) + +Range・シーケンスコンテナと同じだが、デフォルトで`m`書式を適用する。 + + +#### pair、tuple (C++23) + +[`std::pair`](/reference/utility/pair.md)と[`std::tuple`](/reference/tuple/tuple.md)に対して使用できる標準のオプション書式は次の通り(`[]`は省略可の意味)。 + +``` +[[fill] align] [width] [tuple-type] +``` + +* `fill` : アライメントに使う文字 (デフォルト: スペース) +* `align` : アライメント(デフォルトは型による) + * `>` : 右寄せ + * `<` : 左寄せ + * `^` : 中央寄せ +* `width` : 幅 (省略時は値に応じて幅が決まり、アライメントは機能しない) + * 置換フィールドを使って変数で指定できる +* `n` : 囲み文字をなくす +* `tuple-type` : `pair`と`tuple`の表現方法(表を参照) + +| type | 意味 | 効果 | 対応バージョン | +|--------|------|------|----------------| +| m | `std::map`出力向けの`pair`書式 | `pair{1, 2}`を`1: 2`のように囲み文字なし、区切り文字列を`": "`となる。要素数が2であること | C++23 | +| n | 囲み文字をなくす | `tuple{3, 1.23, "hello"}`は`3, 1.23, "hello"`となる | C++23 | +| (なし) | デフォルト | `tuple{3, 1.23, "hello"}`は`(3, 1.23, "hello")`となる | C++23 | + +- 要素型ごとに個別に書式を指定することはできない +- 文字列はデバッグ出力が常に有効 + + ### 例(N4861より) ```cpp @@ -274,7 +336,7 @@ int main() { // 引用符で囲まれず「hello」が出力される std::cout << std::format("0. {}", "hello") << std::endl; - // デバッグ出力。 + // デバッグ出力 (C++23)。 // 引用符で囲まれ「"hello"」が出力される std::cout << std::format("1. {:?}", "hello") << std::endl; @@ -284,7 +346,7 @@ int main() { // world std::cout << std::format("2. {}", "hello\nworld") << std::endl; - // エスケープシーケンスを含む文字列をデバッグ出力。 + // エスケープシーケンスを含む文字列をデバッグ出力 (C++23)。 // エスケープシーケンスがエスケープされて以下のように出力される: // "hello\nworld" std::cout << std::format("3. {:?}", "hello\nworld") << std::endl; @@ -321,6 +383,11 @@ int main() { std::cout << std::format("2. {}", m) << std::endl; std::cout << std::format("3. {}", s) << std::endl; std::cout << std::format("4. {}", r) << std::endl; + + // 文字を要素とするコンテナは文字列として出力させることもできる + std::vector vc = {'h', '\n', 'e', 'l', 'l', 'o'}; + std::cout << std::format("5. {:s}", vc) << std::endl; + std::cout << std::format("6. {:?s}", vc) << std::endl; } ``` * std::ranges::views::iota[link /reference/ranges/iota_view.md] @@ -332,6 +399,9 @@ int main() { 2. {1: "aaa", 2: "bbb"} 3. {1, 2, 3} 4. [1, 2, 3, 4] +5. h +ello +6. "h\nello" ``` ### pair、tupleを出力する (C++23) From 07a5186b1aa5dd5a0862eb8d36f0dca5b51d8cf8 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 17 Jan 2023 13:54:41 +0900 Subject: [PATCH 0039/3948] =?UTF-8?q?format=20:=20=20=E8=A6=8B=E5=87=BA?= =?UTF-8?q?=E3=81=97=E3=81=A8=E3=81=97=E3=81=A6=E5=88=A5=E3=81=AA=E7=94=A8?= =?UTF-8?q?=E9=80=94=E3=81=A7=E3=80=8C=E4=BE=8B=E3=80=8D=E3=81=8C=E3=81=82?= =?UTF-8?q?=E3=82=8B=E3=81=A8=E6=B7=B7=E4=B9=B1=E3=81=99=E3=82=8B=E3=81=AE?= =?UTF-8?q?=E3=81=A7=E3=80=81=E3=83=AA=E3=83=8D=E3=83=BC=E3=83=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/format.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/format/format.md b/reference/format/format.md index c248160a47..a30e609348 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -203,7 +203,7 @@ Range・シーケンスコンテナと同じだが、デフォルトで`m`書式 - 文字列はデバッグ出力が常に有効 -### 例(N4861より) +### 書式例 ```cpp char c = 120; From e8da7c362f22a2d6def5f717d3315e4fd63e1ab1 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 17 Jan 2023 15:21:00 +0900 Subject: [PATCH 0040/3948] =?UTF-8?q?C++23=20:=20P1774R8=20assume=E5=B1=9E?= =?UTF-8?q?=E6=80=A7(#1043)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp20/likely_and_unlikely_attributes.md | 4 ++ lang/cpp23.md | 2 +- lang/cpp23/portable_assumptions.md | 66 ++++++++++++++++++++ reference/utility/unreachable.md | 1 + 4 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 lang/cpp23/portable_assumptions.md diff --git a/lang/cpp20/likely_and_unlikely_attributes.md b/lang/cpp20/likely_and_unlikely_attributes.md index 718f5ab25c..ffc6b9ed69 100644 --- a/lang/cpp20/likely_and_unlikely_attributes.md +++ b/lang/cpp20/likely_and_unlikely_attributes.md @@ -63,6 +63,10 @@ std::string fizzbuzz(int n) GCCやClangなど一部C++コンパイラでは独自拡張として同等機能を提供しており、Linuxカーネルや大規模OSSによる広い利用実績があったため、C++標準の属性として採用された。 +## 関連項目 +- [C++23 `[[assume]]`属性](/lang/cpp23/portable_assumptions.md) + + ## 参照 - [How do the likely/unlikely macros in the Linux kernel work and what is their benefit? - Stack Overflow](https://stackoverflow.com/questions/109710/) - [GCC __builtin_expect組み込み関数](https://gcc.gnu.org/onlinedocs/gcc/extensions-to-the-c-language-family/other-built-in-functions-provided-by-gcc.html) diff --git a/lang/cpp23.md b/lang/cpp23.md index 810613cfbb..4a0492e74e 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -87,7 +87,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| -| [コード内容の仮定をコンパイラに伝えるassume属性](cpp23/portable_assumptions.md.nolink) | 最適化のために、コードの仮定をコンパイラに伝える属性を標準化する | +| [コード内容の仮定をコンパイラに伝えるassume属性](cpp23/portable_assumptions.md) | 最適化のために、コードの仮定をコンパイラに伝える属性を標準化する | ### プリプロセッサ diff --git a/lang/cpp23/portable_assumptions.md b/lang/cpp23/portable_assumptions.md new file mode 100644 index 0000000000..8c8ebf1c0f --- /dev/null +++ b/lang/cpp23/portable_assumptions.md @@ -0,0 +1,66 @@ +# コード内容の仮定をコンパイラに伝える`assume`属性 +* cpp23[meta cpp] + +## 概要 +あるコード地点において実行時に満たすべき仮定(assumption)を、C++コンパイラへ最適化ヒントとして与える属性である。 +`assume`属性を適切に用いると、C++コンパイラはより高速に動作し、サイズの小さいプログラムを生成する可能性がある。 + + +## 仕様 +`[[assume(expr)]]`属性は、空文(null statement)に対して指定できる。 + +式`expr`の評価結果は`bool`型に変換され、その結果が`true`であるとみなされるが、`assume`属性中の式は効果を持たない。 +式`expr`が`false`になる場合は、未定義の動作を引き起こす。 + +式`expr`には、構文要素 _conditional-expression_ を指定する。 +トップレベルのコンマ演算子`,`や代入演算子`=`は指定できない。 + +```cpp +[[assume(expr1, expr2)]]; // Error +[[assume((expr, expr2))]]; // OK(expr2==trueのみ考慮される) +[[assume(x = 1)]]; // Error +[[assume((x = 1))]]; // OK(効果を持たない) +``` + +式`expr`が`true`に評価される場合、`[[assume(expr)]]`属性を指定した空文をコア定数式とみなせる。 + + +## 例 +```cpp +int divide_by_32(int x) +{ + [[assume(x >= 0)]]; + // 引数 x は必ず正の値を取ると仮定できるため + // C++コンパイラによるアセンブリコード生成時に、 + // 非正値を考慮しない最適コードを生成できる可能性がある。 + return x / 32; +} +// asssume属性による仮定がfalseとなる関数呼び出し、 +// 例えば divide_by_32(-100) は未定義動作を引き起こす。 +``` +* assume[color ff0000] + +```cpp +int f(int y) +{ + // 効果を持たないため変数 y の値は変化しない。 + [[assume(++y == 43)]]; + // 最適化により return 42; へと置換される可能性がある。 + return y; +} +``` +* assume[color ff0000] + + +## この機能が必要になった背景・経緯 +主要C++コンパイラでは独自拡張として同等機能を提供しており、高パフォーマンスや低レイテンシなアプリ開発向けでは有用であるため、C++標準の属性として採用された。 + + +## 関連項目 +- [C++20 `[[likely]]`, `[[unlikely]]`属性](/lang/cpp20/likely_and_unlikely_attributes.md) + + +## 参照 +- [Clang Builtin Functions `__builtin_assume`](https://clang.llvm.org/docs/LanguageExtensions.html) +- [MSVC Compiler intrinsics `__assume`](https://learn.microsoft.com/en-us/cpp/intrinsics/assume) +- [P1774R8 Portable assumptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1774r8.pdf) diff --git a/reference/utility/unreachable.md b/reference/utility/unreachable.md index 61f59ec685..f4e949d46a 100644 --- a/reference/utility/unreachable.md +++ b/reference/utility/unreachable.md @@ -68,6 +68,7 @@ int main() ## 関連項目 - [C++20 `[[likely]]`, `[[unlikely]]`属性](/lang/cpp20/likely_and_unlikely_attributes.md) +- [C++23 `[[assume]]`属性](/lang/cpp23/portable_assumptions.md) ## 参照 From 31f15af518188c1ae9aefe351f3e9bb8ddfebf02 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 17 Jan 2023 15:25:32 +0900 Subject: [PATCH 0041/3948] implementaion-status: fix inner link(#1043) --- implementation-status.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/implementation-status.md b/implementation-status.md index 81c76ff7cb..2de75dc39f 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -274,7 +274,7 @@ | P2564R3: [`constexpr`関数内で`consteval`関数を呼び出せない問題を緩和](/lang/cpp23/consteval_needs_to_propagate_up.md.nolink) | | - | - | - | - | | P1102R2: [ラムダ式で`()`を省略できる条件を緩和](/lang/cpp23/down_with_lambda_parens.md.nolink) | キャプチャや修飾をともなってもパラメータリストが空であれば`()`を省略できる | 11 | 13 | - | - | | P2173R1: [ラムダ式に対する属性](/lang/cpp23/attributes_on_lambda_expressions.md.nolink) | ラムダ式のいくつかの箇所に属性を記述できるようにする | 9 | 13 | - | - | -| P1774R8: [コード内容の仮定をコンパイラに伝えるassume属性](/lang/cpp23/portable_assumptions.md.nolink) | 最適化のために、コードの仮定をコンパイラに伝える属性を標準化する | 13 | - | - | - | +| P1774R8: [コード内容の仮定をコンパイラに伝えるassume属性](/lang/cpp23/portable_assumptions.md) | 最適化のために、コードの仮定をコンパイラに伝える属性を標準化する | 13 | - | - | - | | P2316R2: [文字リテラルエンコーディングを一貫させる](/lang/cpp23/consistent_character_literal_encoding.md.nolink) | プリプロセッサの条件式での文字リテラルの扱いをC++式と同様にする | yes | yes | - | - | | P2334R1: [`elif`/`elifdef`/`elifndef`のサポートを追加](/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md.nolink) | `#if`/`#ifdef`/`#ifndef`に対応する複数条件命令のサポートを追加する | 12 | 13 | - | - | | P2437R1: [`#warning`のサポートを追加](/lang/cpp23/warning.md.nolink) | 多くのC++コンパイラが実装していたプリプロセス時の警告`#warning message`を正式サポート | yes | yes | yes | yes | From 58230430ce1071207574b91002781b526ec6422b Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 17 Jan 2023 15:53:11 +0900 Subject: [PATCH 0042/3948] =?UTF-8?q?C++23=20:=20P2186R2=20GC=E3=82=B5?= =?UTF-8?q?=E3=83=9D=E3=83=BC=E3=83=88=E5=89=8A=E9=99=A4(#1049)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp11/predefined_macros.md | 5 +++-- lang/cpp23.md | 2 +- reference/memory.md | 15 ++++++++------- reference/memory/declare_no_pointers.md | 7 +++++++ reference/memory/declare_reachable.md | 4 ++++ reference/memory/get_pointer_safety.md | 5 +++++ reference/memory/pointer_safety.md | 5 ++++- reference/memory/undeclare_no_pointers.md | 7 +++++++ reference/memory/undeclare_reachable.md | 7 +++++++ 9 files changed, 46 insertions(+), 11 deletions(-) diff --git a/lang/cpp11/predefined_macros.md b/lang/cpp11/predefined_macros.md index b543981d6e..61deae3b4f 100644 --- a/lang/cpp11/predefined_macros.md +++ b/lang/cpp11/predefined_macros.md @@ -14,7 +14,7 @@ | マクロ名 | 説明 | |---------------|-------------------------| -| `__STDCPP_STRICT_POINTER_SAFETY__` | 実装がポインタの厳密な安全性を持っている場合、整数値`1`として定義される | +| `__STDCPP_STRICT_POINTER_SAFETY__` | 実装がポインタの厳密な安全性を持っている場合、整数値`1`として定義される
本マクロ定数はC++23で削除される | | `__STDCPP_THREADS__` | プログラムが複数のスレッドを実行できる場合、整数値`1`として定義される | | `__STDC_MB_MIGHT_NEQ_WC__` | このマクロが整数型の定数`1`として定義されている場合、基本文字集合に含まれる文字のリテラルが、`char`と`wchar_t`で異なる値を持つ可能性がある。
このマクロが定義されない場合には`'x' == L'x'`が`true`であることが保証され、そうでなければされない。 | @@ -26,4 +26,5 @@ ## 参照 - [N2693 Requirements on programs and backwards compatibility](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2693.html) - [CWG Issue 1169. Missing feature macro for strict pointer safety](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1169) - +- [P2186R2 Removing Garbage Collection Support](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2186r2.html) + - C++23でのマクロ`__STDCPP_STRICT_POINTER_SAFETY__`削除 diff --git a/lang/cpp23.md b/lang/cpp23.md index 4a0492e74e..1ab3027786 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -238,7 +238,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 - [`std::undeclare_no_pointers()`](/reference/memory/undeclare_no_pointers.md) - [`std::get_pointer_safety()`](/reference/memory/get_pointer_safety.md) - [`std::pointer_safety`](/reference/memory/pointer_safety.md) - - `__STDCPP_STRICT_POINTER_SAFETY__`マクロ + - [`__STDCPP_STRICT_POINTER_SAFETY__`マクロ](/lang/cpp11/predefined_macros.md) ### 取り決め diff --git a/reference/memory.md b/reference/memory.md index 94c556ec5d..aa92020469 100644 --- a/reference/memory.md +++ b/reference/memory.md @@ -110,16 +110,16 @@ | `atomic_compare_exchange_strong_explicit` | 強い比較でメモリオーダーを指定して、`shared_ptr`の値の入れ替えをアトミックに行う (function template) | C++11
C++20で非推奨 | -## ガベージコレクション支援 +## ガベージコレクション支援(C++23で削除) | 名前 | 説明 | 対応バージョン | |--------------------------------------------------|--------------------------------------------|-------| -| [`pointer_safety`](memory/pointer_safety.md) | ポインタ安全性について実装/挙動を示す列挙型(enum class) | C++11 | -| [`get_pointer_safety`](memory/get_pointer_safety.md) | 処理系の、ポインタ安全性についての実装/挙動を取得する(function) | C++11 | -| [`declare_reachable`](memory/declare_reachable.md) | ポインタが到達可能であることを宣言する(function) | C++11 | -| [`undeclare_reachable`](memory/undeclare_reachable.md) | ポインタが到達可能であるという宣言を削除する(function template) | C++11 | -| [`declare_no_pointers`](memory/declare_no_pointers.md) | 指定された範囲のポインタが、追跡可能ではないことを宣言する(function) | C++11 | -| [`undeclare_no_pointers`](memory/undeclare_no_pointers.md) | `declare_no_pointers`で宣言された範囲を無効化する(function) | C++11 | +| [`pointer_safety`](memory/pointer_safety.md) | ポインタ安全性について実装/挙動を示す列挙型(enum class) | C++11
C++23で削除 | +| [`get_pointer_safety`](memory/get_pointer_safety.md) | 処理系の、ポインタ安全性についての実装/挙動を取得する(function) | C++11
C++23で削除 | +| [`declare_reachable`](memory/declare_reachable.md) | ポインタが到達可能であることを宣言する(function) | C++11
C++23で削除 | +| [`undeclare_reachable`](memory/undeclare_reachable.md) | ポインタが到達可能であるという宣言を削除する(function template) | C++11
C++23で削除 | +| [`declare_no_pointers`](memory/declare_no_pointers.md) | 指定された範囲のポインタが、追跡可能ではないことを宣言する(function) | C++11
C++23で削除 | +| [`undeclare_no_pointers`](memory/undeclare_no_pointers.md) | `declare_no_pointers`で宣言された範囲を無効化する(function) | C++11
C++23で削除 | ## ポインタのユーティリティ @@ -137,3 +137,4 @@ - [N4190 Removing `auto_ptr`, `random_shuffle()`, And Old `` Stuff](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4190.htm) - [P0718R2 Revising `atomic_shared_ptr` for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0718r2.html) - [P2051R0 C++ Standard Library Issues to be moved in Prague](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2051r0.html) +- [P2186R2 Removing Garbage Collection Support](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2186r2.html) diff --git a/reference/memory/declare_no_pointers.md b/reference/memory/declare_no_pointers.md index a1dc0ed3b4..bbbc4dc965 100644 --- a/reference/memory/declare_no_pointers.md +++ b/reference/memory/declare_no_pointers.md @@ -3,6 +3,7 @@ * std[meta namespace] * function[meta id-type] * cpp11[meta cpp] +* cpp23removed[meta cpp] ```cpp namespace std { @@ -10,6 +11,8 @@ namespace std { } ``` +この関数はC++23で削除された。 + ## 概要 特定の領域に追跡可能なポインタが存在しないことを宣言する。 @@ -107,3 +110,7 @@ int main() - [Clang](/implementation.md#clang): 3.4 (relaxed実装) - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 (relaxed実装) + + +## 参照 +- [P2186R2 Removing Garbage Collection Support](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2186r2.html) diff --git a/reference/memory/declare_reachable.md b/reference/memory/declare_reachable.md index a77c35f39c..735b448c1d 100644 --- a/reference/memory/declare_reachable.md +++ b/reference/memory/declare_reachable.md @@ -3,6 +3,7 @@ * std[meta namespace] * function[meta id-type] * cpp11[meta cpp] +* cpp23removed[meta cpp] ```cpp namespace std { @@ -10,6 +11,8 @@ namespace std { } ``` +この関数はC++23で削除された。 + ## 概要 ポインタが到達可能であることを宣言する。 @@ -85,3 +88,4 @@ int main() * [C++0x ガベージコレクションと到達可能性ベースリーク検知の最小支援 - Faith and Brave - C++で遊ぼう](http://faithandbrave.hateblo.jp/entry/20081117/1226913980) * [N2670: Minimal Support for Garbage Collection and Reachability-Based Leak Detection (revised)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2670.htm) * [Garbage Collection ABI - C++ FAQ - www.stroustrup.com](http://www.stroustrup.com/C++11FAQ.html#gc-abi) +* [P2186R2 Removing Garbage Collection Support](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2186r2.html) diff --git a/reference/memory/get_pointer_safety.md b/reference/memory/get_pointer_safety.md index c41be424df..b0472fa271 100644 --- a/reference/memory/get_pointer_safety.md +++ b/reference/memory/get_pointer_safety.md @@ -3,6 +3,7 @@ * std[meta namespace] * function[meta id-type] * cpp11[meta cpp] +* cpp23removed[meta cpp] ```cpp namespace std { @@ -11,6 +12,8 @@ namespace std { ``` * pointer_safety[link /reference/memory/pointer_safety.md] +この関数はC++23で削除された。 + ## 概要 ポインタの安全性が、使用している処理系においてどのように実装されているかを確認する。 @@ -32,3 +35,5 @@ namespace std { - [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +## 参照 +- [P2186R2 Removing Garbage Collection Support](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2186r2.html) diff --git a/reference/memory/pointer_safety.md b/reference/memory/pointer_safety.md index 1f690afaa9..79ef952547 100644 --- a/reference/memory/pointer_safety.md +++ b/reference/memory/pointer_safety.md @@ -3,6 +3,7 @@ * std[meta namespace] * enum[meta id-type] * cpp11[meta cpp] +* cpp23removed[meta cpp] ```cpp namespace std { @@ -14,6 +15,8 @@ namespace std { } ``` +この列挙型はC++23で削除された。 + ## 概要 `pointer_safety`は、ポインタ安全性について、その挙動/規則について確認するための列挙型である。 @@ -46,4 +49,4 @@ namespace std { - [C++0x ガベージコレクションと到達可能性ベースリーク検知の最小支援 - Faith and Brave - C++で遊ぼう](http://faithandbrave.hateblo.jp/entry/20081117/1226913980) * [N2670: Minimal Support for Garbage Collection and Reachability-Based Leak Detection (revised)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2670.htm) - [Garbage Collection ABI - C++ FAQ - www.stroustrup.com](http://www.stroustrup.com/C++11FAQ.html#gc-abi) - +- [P2186R2 Removing Garbage Collection Support](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2186r2.html) diff --git a/reference/memory/undeclare_no_pointers.md b/reference/memory/undeclare_no_pointers.md index 197339c200..781a668b35 100644 --- a/reference/memory/undeclare_no_pointers.md +++ b/reference/memory/undeclare_no_pointers.md @@ -3,6 +3,7 @@ * std[meta namespace] * function[meta id-type] * cpp11[meta cpp] +* cpp23removed[meta cpp] ```cpp namespace std { @@ -10,6 +11,8 @@ namespace std { } ``` +この関数はC++23で削除された。 + ## 概要 特定の領域に追跡可能なポインタが存在しないことの宣言を取り消す。 @@ -56,3 +59,7 @@ int main() - [Clang](/implementation.md#clang): 3.4 (relaxed実装) - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 (relaxed実装) + + +## 参照 +- [P2186R2 Removing Garbage Collection Support](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2186r2.html) diff --git a/reference/memory/undeclare_reachable.md b/reference/memory/undeclare_reachable.md index 0127548429..95d090859b 100644 --- a/reference/memory/undeclare_reachable.md +++ b/reference/memory/undeclare_reachable.md @@ -3,6 +3,7 @@ * std[meta namespace] * function template[meta id-type] * cpp11[meta cpp] +* cpp23removed[meta cpp] ```cpp namespace std { @@ -11,6 +12,8 @@ namespace std { } ``` +この関数はC++23で削除された。 + ## 概要 ポインタの到達可能の宣言を取り下げる。 @@ -68,3 +71,7 @@ int main() - [Clang](/implementation.md#clang): 3.4 (relaxed実装) - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 (relaxed実装) + + +## 参照 +- [P2186R2 Removing Garbage Collection Support](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2186r2.html) From 5a087a079fd97e1ea53e341313cb593e53b1db22 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 17 Jan 2023 17:15:07 +0900 Subject: [PATCH 0043/3948] =?UTF-8?q?functional/invoke=5Fr:=20P2136R3?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C(#1055)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23.md | 2 +- reference/concepts/Invoke.md | 5 ++- reference/functional/invoke.md | 10 ++--- reference/functional/invoke_r.md | 67 ++++++++++++++++++++++++++++++++ 4 files changed, 76 insertions(+), 8 deletions(-) create mode 100644 reference/functional/invoke_r.md diff --git a/lang/cpp23.md b/lang/cpp23.md index 1ab3027786..051acc7536 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -187,7 +187,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 ### 関数オブジェクト -- [`std::invoke()`](/reference/functional/invoke.md)の戻り値型を指定するバージョンである[`std::invoke_r()`](/reference/functional/onvoke_r.md.nolink)を追加 +- [`std::invoke()`](/reference/functional/invoke.md)の戻り値型を指定するバージョンである[`std::invoke_r()`](/reference/functional/invoke_r.md)を追加 - ムーブのみ可能な[`std::function`](/reference/functional/function.md)クラスと等価な機能をもつ[`std::move_only_function`](/reference/functional/move_only_function.md.nolink)クラスを追加 - ユーザー定義のRangeアダプタがパイプライン演算子 `|` をサポートしやすくするために、末尾から引数を束縛する[`std::bind_back()`](/reference/functional/bind_back.md.nolink)関数を追加 diff --git a/reference/concepts/Invoke.md b/reference/concepts/Invoke.md index f90635bbd4..3fb731b220 100644 --- a/reference/concepts/Invoke.md +++ b/reference/concepts/Invoke.md @@ -6,8 +6,8 @@ C++における関数呼び出しという性質を抽象化しまとめた、仮想操作 *INVOKE* を定義する。 -C++17からは、本仮想操作を実体化した[`invoke`](/reference/functional/invoke.md)関数テンプレートが提供される。 - +- C++17からは、仮想操作 *INVOKE* を実体化した[`std::invoke`](/reference/functional/invoke.md)関数テンプレートが提供される。 +- C++23からは、仮想操作 *INVOKE* を実体化した[`std::invoke_r`](/reference/functional/invoke_r.md)関数テンプレートが提供される。 ## 用語定義 - *call-signature* とは、戻り値型に続けて丸括弧の中に0個以上の引数型を並べたものである。 *cf.* `int ( std::string, int )` @@ -78,3 +78,4 @@ C++17からは、本仮想操作を実体化した[`invoke`](/reference/function ## 参照 - [P0777R1 Treating Unnecessary `decay`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0777r1.pdf) - C++20から`decay_t`を`remove_cvref_t`へ変更。 +- [P2136R3 `invoke_r`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2136r3.html) diff --git a/reference/functional/invoke.md b/reference/functional/invoke.md index 636fb6174d..82cb8e6051 100644 --- a/reference/functional/invoke.md +++ b/reference/functional/invoke.md @@ -130,11 +130,11 @@ int main() ## 関連項目 -- [invoke_result](/reference/type_traits/invoke_result.md) -- [is_invocable](/reference/type_traits/is_invocable.md) -- [is_invocable_r](/reference/type_traits/is_invocable_r.md) -- [is_nothrow_invocable](/reference/type_traits/is_nothrow_invocable.md) -- [is_nothrow_invocable_r](/reference/type_traits/is_nothrow_invocable_r.md) +- [`invoke_r`](invoke_r.md) +- [`invoke_result`](/reference/type_traits/invoke_result.md) +- [`is_invocable`](/reference/type_traits/is_invocable.md) +- [`is_nothrow_invocable`](/reference/type_traits/is_nothrow_invocable.md) + ## 参照 - [C++1z INVOKEコンセプトに従った関数呼び出しをするinvoke()関数 - Faith and Brave - C++で遊ぼう](https://faithandbrave.hateblo.jp/entry/2016/09/07/173344) diff --git a/reference/functional/invoke_r.md b/reference/functional/invoke_r.md new file mode 100644 index 0000000000..55114daefe --- /dev/null +++ b/reference/functional/invoke_r.md @@ -0,0 +1,67 @@ +# invoke_r +* functional[meta header] +* function template[meta id-type] +* std[meta namespace] +* cpp23[meta cpp] + +```cpp +namespace std { + template + constexpr R invoke_r(F&& f, Args&&... args) + noexcept(is_nothrow_invocable_r_v); +} +``` +* is_nothrow_invocable_r_v[link /reference/type_traits/is_nothrow_invocable_r.md] + +## 概要 +関数呼び出し可能なオブジェクト`f`とその引数`args...`の組み合わせで[*INVOKE*](/reference/concepts/Invoke.md)要件に従った関数呼び出しを行う。 +`R`が(CV修飾された)`void`でなければ、戻り値は`R`型へ暗黙変換される。 + + +## テンプレートパラメータ制約 +[`is_­invocable_­r_­v`](/reference/type_traits/is_invocable_r.md)``が`true` + + +## 戻り値 +[`INVOKE`](/reference/concepts/Invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`std::forward`](/reference/utility/forward.md)`(args)...)` + + +## 例 +```cpp example +#include +#include + +// ASCIIコード 0x43 == 'C' +int ch() { return 0x43; } + +int main() +{ + std::cout << std::invoke_r(ch()) << std::endl; +} +``` +* std::invoke_r[color ff0000] + +### 出力例 +``` +C +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`invoke`](invoke.md) +- [`is_invocable_r`](/reference/type_traits/is_invocable_r.md) +- [`is_nothrow_invocable_r`](/reference/type_traits/is_nothrow_invocable_r.md) + + +## 参照 +- [P2136R3 `invoke_r`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2136r3.html) From 30918b2308ad1932317002a995220d96cd0038d5 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 17 Jan 2023 17:18:07 +0900 Subject: [PATCH 0044/3948] functinoal/invoke_r: delete forbidden chars(#1055) --- reference/functional/invoke_r.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/functional/invoke_r.md b/reference/functional/invoke_r.md index 55114daefe..c5d679bde4 100644 --- a/reference/functional/invoke_r.md +++ b/reference/functional/invoke_r.md @@ -19,7 +19,7 @@ namespace std { ## テンプレートパラメータ制約 -[`is_­invocable_­r_­v`](/reference/type_traits/is_invocable_r.md)``が`true` +[`is_invocable_r_v`](/reference/type_traits/is_invocable_r.md)``が`true` ## 戻り値 From 1f6c97ce954e86960f296aa7d95ef14b33d587b4 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 17 Jan 2023 17:32:08 +0900 Subject: [PATCH 0045/3948] INVOKE: fix markup `INVOKE`(#1055) --- reference/concepts/Invoke.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/concepts/Invoke.md b/reference/concepts/Invoke.md index 3fb731b220..45b14dc317 100644 --- a/reference/concepts/Invoke.md +++ b/reference/concepts/Invoke.md @@ -7,7 +7,7 @@ C++における関数呼び出しという性質を抽象化しまとめた、仮想操作 *INVOKE* を定義する。 - C++17からは、仮想操作 *INVOKE* を実体化した[`std::invoke`](/reference/functional/invoke.md)関数テンプレートが提供される。 -- C++23からは、仮想操作 *INVOKE* を実体化した[`std::invoke_r`](/reference/functional/invoke_r.md)関数テンプレートが提供される。 +- C++23からは、仮想操作 *INVOKE*`` を実体化した[`std::invoke_r`](/reference/functional/invoke_r.md)関数テンプレートが提供される。 ## 用語定義 - *call-signature* とは、戻り値型に続けて丸括弧の中に0個以上の引数型を並べたものである。 *cf.* `int ( std::string, int )` From f86e3825c89e743aedfdd3d66a1850cbd74d63f2 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 17 Jan 2023 18:15:48 +0900 Subject: [PATCH 0046/3948] =?UTF-8?q?=E4=BB=95=E6=A7=98=E3=81=A8=E4=BE=8B?= =?UTF-8?q?=E3=81=AE=E8=BF=BD=E8=A8=98=20#1102?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...sized_delete_for_variable_sized_classes.md | 132 +++++++++++++++++- 1 file changed, 128 insertions(+), 4 deletions(-) diff --git a/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md b/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md index cffee868ba..dc5424748a 100644 --- a/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md +++ b/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md @@ -69,10 +69,62 @@ int main() { ## 仕様 -- クラス`C`に対する*destroying operator delete*の第一引数は`C*`でなければならない -- *destroying operator delete*の戻り値型は`void`でなければならない +クラススコープで定義された`operator delete()`で、第二引数が`std::destroying_delete_t`であるものを*destroying operator delete*と呼ぶ。クラス`C`に対する*destroying operator delete*の第一引数は`C*`でなければならず、その2点以外は通常の`operator delete`オーバーロードの制約に従う。 -(執筆中) +```cpp +struct S { + // これらの宣言はいずれも、destroying operator deleteではない(コンパイルエラーとなる) + void operator delete(void*, std::destroying_delete_t); // 第一引数はS* + void operator delete(S*, auto); // 第二引数は std::destroying_delete_t + int* operator delete(S*, std::destroying_delete_t); // 戻り値はvoid + virtual void operator delete(S*, std::destroying_delete_t); // 仮想関数にできない +}; +``` + +単一オブジェクトに対する`delete`式の実行に伴う`operator delete`の探索の結果、その候補の中に*destroying operator delete*が含まれている場合、*destroying operator delete*ではない`operator delete`は候補から外れる。 + +```cpp +struct S { + // destroying operator delete + void operator delete(S*, std::destroying_delete_t); + + // destroying operator deleteが定義されている限り、こちらが呼び出されることはない + void operator delete(void*); +}; +``` + +ただし、配列に対する`delete`式の場合は、*destroying operator delete*は考慮されない。 + +```cpp +struct S { + // #1 destroying operator delete + void operator delete(S* p, std::destroying_delete_t) { + std::cout << "S::operator delete()\n"; + + std::destroy_at(p); + ::operator delete(p); + } +}; + +int main() { + S* p = new S[1]{}; + + // #1は呼び出されず、要素ごとに破棄された後で配列の領域が解放される + delete[] p; +} +``` + +また、配列板の`operator delete[]`を*destroying operator delete*としてオーバーロードすることもできない。 + +```cpp +struct S { + void operator delete[](S* p, std::destroying_delete_t); // ng +}; +``` + +単一オブジェクトに対する`delete`式においてそのオブジェクトの静的型と動的型が一致しない場合(つまり、基底クラスのポインタから派生クラスのオブジェクトを`delete`しようとする場合など)、その静的型はその動的型の基底クラスである必要があり両方の型に仮想デストラクタが必要となるが、*destroying operator delete*が`operator delete`として使用される場合にはその必要はない。したがって、*destroying operator delete*が使用されない場合に`delete`式が指定されたポインタの指す最も派生したオブジェクトを削除せず未定義動作になるような場合(仮想デストラクタの定義忘れなど)でも、*destroying operator delete*が使用された場合は未定義動作とならない(ただし、呼び出された*destroying operator delete*がそのオブジェクトを正しく破棄しない場合は未定義動作となりうる)。 + +*destroying operator delete*が`operator delete`として使用される`delete`式の実行において、`delete`式は`delete`対象オブジェクトのデストラクタを呼び出さないで`operator delete`を呼び出す。また、その際の*destroying operator delete*の第二引数(`std::destroying_delete_t`に対応する引数)に渡される値は未規定。 ## 例 @@ -159,7 +211,7 @@ int main() { * std::ranges::destroy[link /reference/memory/ranges_destroy.md] -### 出力 +#### 出力 ``` inlined_fixed_string::Make() : 47 byte allocate. @@ -167,6 +219,78 @@ C++20 destroying operator delete test. inlined_fixed_string::operator delete() : 47 byte deallocate. ``` +### 正しいデストラクタへのディスパッチ + +```cpp example +#include +#include + +// 仮想デストラクタを定義しない基底クラス +struct base { + int kind = 0; + + // destroying operator delete宣言 #1 + void operator delete(base* p, std::destroying_delete_t); +}; + +struct derived1 : base { + derived1() : base{1} {} +}; + +struct derived2 : base { + derived2() : base{2} {} +}; + +// #1に対応する定義 +void base::operator delete(base* p, std::destroying_delete_t) { + + switch(p->kind) { + case 1: + { + auto* dp = static_cast(p); + std::destroy_at(dp); + ::operator delete(dp); + std::cout << "destruct derived1\n"; + break; + } + case 2: + { + auto* dp = static_cast(p); + std::destroy_at(dp); + ::operator delete(dp); + std::cout << "destruct derived2\n"; + break; + } + default: + std::destroy_at(p); + ::operator delete(p); + std::cout << "destruct base\n"; + } +} + +int main() { + { + base* p = new derived1{}; + // #1によってderived1のデストラクタが呼ばれ、メモリが解放される + delete p; + } + { + base* p = new derived2{}; + // #1によってderived2のデストラクタが呼ばれ、メモリが解放される + delete p; + } +} +``` +* destroying_delete_t[color ff0000] +* std::destroy_at[link /reference/memory/destroy_at.md] + +#### 出力 + +``` +destruct derived1 +destruct derived2 +``` + ## この機能が必要になった背景・経緯 (執筆中) From 44c43e183739ddba0b62ede3da2f5e5d4d9a38fe Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 17 Jan 2023 18:31:24 +0900 Subject: [PATCH 0047/3948] =?UTF-8?q?hexfloat=20:=20GCC=E3=81=A7=E5=85=A5?= =?UTF-8?q?=E5=8A=9B=E3=81=A7=E3=81=AE=E4=BD=BF=E7=94=A8=E3=81=AB=E3=83=90?= =?UTF-8?q?=E3=82=B0=E3=81=8C=E3=81=82=E3=82=8B=E3=81=93=E3=81=A8=E3=82=92?= =?UTF-8?q?=E8=A8=98=E8=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ios.md | 6 +++--- reference/ios/fixed.md | 2 +- reference/ios/hexfloat.md | 9 +++++++-- reference/ios/scientific.md | 2 +- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/reference/ios.md b/reference/ios.md index edb16e13a6..f1bdad6045 100644 --- a/reference/ios.md +++ b/reference/ios.md @@ -47,9 +47,9 @@ | [`dec`](ios/dec.md) | 十進法で入出力(整数) | | | [`hex`](ios/hex.md) | 十六進法で入出力(整数) | | | [`oct`](ios/oct.md) | 八進法で入出力(整数) | | -| [`fixed`](ios/fixed.md) | 小数点数表記で出力(浮動小数点数) | | -| [`scientific`](ios/scientific.md) | 指数表記で出力(浮動小数点数) | | -| [`hexfloat`](ios/hexfloat.md) | 十六進法での指数表記で出力(浮動小数点数) | C++11 | +| [`fixed`](ios/fixed.md) | 小数点数表記で入出力(浮動小数点数) | | +| [`scientific`](ios/scientific.md) | 指数表記で入出力(浮動小数点数) | | +| [`hexfloat`](ios/hexfloat.md) | 十六進法での指数表記で入出力(浮動小数点数) | C++11 | | [`defaultfloat`](ios/defaultfloat.md) | 小数点数・指数表記の自動切り替え(浮動小数点数) | C++11 | ## バージョン diff --git a/reference/ios/fixed.md b/reference/ios/fixed.md index 246c211180..05eacc1efa 100644 --- a/reference/ios/fixed.md +++ b/reference/ios/fixed.md @@ -10,7 +10,7 @@ namespace std { ``` ## 概要 -浮動小数点数を固定小数点表記で出力することを指示するマニピュレータ。 +浮動小数点数を固定小数点表記で入出力することを指示するマニピュレータ。 ## 効果 `str.setf(ios_base::fixed, ios_base::floatfield)`を実行する。 diff --git a/reference/ios/hexfloat.md b/reference/ios/hexfloat.md index 4b57d76726..9eae0997df 100644 --- a/reference/ios/hexfloat.md +++ b/reference/ios/hexfloat.md @@ -11,7 +11,7 @@ namespace std { ``` ## 概要 -浮動小数点数を十六進法で出力することを指示するマニピュレータ。 +浮動小数点数を十六進法で入出力することを指示するマニピュレータ。 [`printf()`](http://linuxjm.osdn.jp/html/LDP_man-pages/man3/printf.3.html)関数の`%a`/`%A`相当。 @@ -31,9 +31,14 @@ namespace std { ### 処理系 - [Clang](/implementation.md#clang): 3.0 - [GCC](/implementation.md#gcc): 5.0 -- [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2008, 2010, 2012 + +#### 備考 +- GCCは12.0時点で、入力ストリームでの`hexfloat`の使用に対応していない。使用すると値0が入力される (エラーにならない) + - [Bug 81122 - [DR 2381] parsing f stopped after '0' when reading `std::hexfloat >> f;`](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81122) + + ## 参照 - [`defaultfloat`](defaultfloat.md) - [`fixed`](fixed.md) diff --git a/reference/ios/scientific.md b/reference/ios/scientific.md index 388f6a913f..b6af309269 100644 --- a/reference/ios/scientific.md +++ b/reference/ios/scientific.md @@ -10,7 +10,7 @@ namespace std { ``` ## 概要 -浮動小数点数を指数表記で出力することを指示するマニピュレータ。 +浮動小数点数を指数表記で入出力することを指示するマニピュレータ。 ## 効果 `str.setf(ios_base::scientific, ios_base::floatfield)`を実行する。 From 2497046e4f89beeaffa4c0f7f3a014c4b6560e0e Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 17 Jan 2023 19:47:28 +0900 Subject: [PATCH 0048/3948] =?UTF-8?q?format=20:=20Range=E3=81=AE=E8=A6=81?= =?UTF-8?q?=E7=B4=A0=E3=81=AB=E5=AF=BE=E3=81=99=E3=82=8B=E6=9B=B8=E5=BC=8F?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=E3=81=AE=E4=BE=8B=E3=82=92=E8=A8=98=E8=BC=89?= =?UTF-8?q?=20#1085?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/format.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/reference/format/format.md b/reference/format/format.md index a30e609348..ad5be59541 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -384,10 +384,14 @@ int main() { std::cout << std::format("3. {}", s) << std::endl; std::cout << std::format("4. {}", r) << std::endl; + // Rangeの書式指定のあと、:で区切って要素に対する書式指定ができる (ここでは16進数出力) + std::vector vx = {0xf, 0x1e, 0x3c}; + std::cout << std::format("5. {::#x}", vx) << std::endl; + // 文字を要素とするコンテナは文字列として出力させることもできる std::vector vc = {'h', '\n', 'e', 'l', 'l', 'o'}; - std::cout << std::format("5. {:s}", vc) << std::endl; - std::cout << std::format("6. {:?s}", vc) << std::endl; + std::cout << std::format("6. {:s}", vc) << std::endl; + std::cout << std::format("7. {:?s}", vc) << std::endl; } ``` * std::ranges::views::iota[link /reference/ranges/iota_view.md] @@ -399,9 +403,10 @@ int main() { 2. {1: "aaa", 2: "bbb"} 3. {1, 2, 3} 4. [1, 2, 3, 4] -5. h +5. [0xf, 0x1e, 0x3c] +6. h ello -6. "h\nello" +7. "h\nello" ``` ### pair、tupleを出力する (C++23) From 1a3edd0c8bebb22b99068fcdd45d4f2efb52c312 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 17 Jan 2023 20:01:38 +0900 Subject: [PATCH 0049/3948] =?UTF-8?q?=E3=80=8Cstd::tuple=E3=80=8D=E3=82=92?= =?UTF-8?q?=E3=82=B0=E3=83=AD=E3=83=BC=E3=83=90=E3=83=AB=E4=BF=AE=E9=A3=BE?= =?UTF-8?q?=E3=83=AA=E3=82=B9=E3=83=88=E3=81=AB=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 1 + lang/cpp11/variadic_templates.md | 4 ---- lang/cpp17/structured_bindings.md | 2 -- lang/cpp17/type_deduction_for_class_templates.md | 1 - lang/cpp20/adl_and_function_templates_that_are_not_visible.md | 1 - lang/cpp20/explicit_bool.md | 1 - reference/memory/uses_allocator_construction_args.md | 1 - reference/tuple/forward_as_tuple.md | 1 - reference/tuple/make_tuple.md | 1 - reference/tuple/tie.md | 1 - reference/tuple/tuple.md | 1 - reference/tuple/tuple_cat.md | 1 - reference/tuple/tuple_element.md | 1 - reference/tuple/tuple_size.md | 1 - reference/utility/index_sequence_for.md | 1 - reference/utility/pair/op_constructor.md | 1 - 16 files changed, 1 insertion(+), 19 deletions(-) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 747a81b6d8..aeef4d91da 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -186,6 +186,7 @@ * t2.join()[link /reference/thread/thread/join.md] * t3.join()[link /reference/thread/thread/join.md] * [link /reference/tuple.md] + * std::tuple[link /reference/tuple/tuple.md] * [link /reference/type_traits.md] * std::false_type[link /reference/type_traits/false_type.md] * std::is_same[link /reference/type_traits/is_same.md] diff --git a/lang/cpp11/variadic_templates.md b/lang/cpp11/variadic_templates.md index 34e2c5a106..fefba19170 100644 --- a/lang/cpp11/variadic_templates.md +++ b/lang/cpp11/variadic_templates.md @@ -40,7 +40,6 @@ void f(Args... args) f(3, 'a', "hello"); ``` -* std::tuple[link /reference/tuple/tuple.md] パラメータパックを最初の要素から順番に処理していきたい場合には、「任意の型のパラメータをひとつと、任意の個数の任意の型のパラメータを受け取る」というような形式のパラメータリストとし、再帰によって処理をする: @@ -201,7 +200,6 @@ hello f(a, b); } ``` - * std::tuple[link /reference/tuple/tuple.md] * std::make_tuple[link /reference/tuple/make_tuple.md] - テンプレートパラメータ @@ -247,7 +245,6 @@ hello ```cpp std::tuple t; ``` - * std::tuple[link /reference/tuple/tuple.md] - 初期化子 @@ -356,7 +353,6 @@ hello >::value, ""); // OK } ``` - * std::tuple[link /reference/tuple/tuple.md] * static_assert[link static_assert.md] diff --git a/lang/cpp17/structured_bindings.md b/lang/cpp17/structured_bindings.md index 9d725be6ae..6dc9d99714 100644 --- a/lang/cpp17/structured_bindings.md +++ b/lang/cpp17/structured_bindings.md @@ -122,7 +122,6 @@ int main() } } ``` -* std::tuple[link /reference/tuple/tuple.md] * std::forward_as_tuple[link /reference/tuple/forward_as_tuple.md] #### 出力 @@ -325,7 +324,6 @@ C++17時点の構造化束縛では、使用しない変数もコピーあるい std::tuple, T4> f(); auto { w, {x, y}, z } = f(); // このような、tuple内にあるpairを同時に分解はできない ``` -* std::tuple[link /reference/tuple/tuple.md] ## 関連項目 diff --git a/lang/cpp17/type_deduction_for_class_templates.md b/lang/cpp17/type_deduction_for_class_templates.md index 141b334e80..a6c5bcc053 100644 --- a/lang/cpp17/type_deduction_for_class_templates.md +++ b/lang/cpp17/type_deduction_for_class_templates.md @@ -191,7 +191,6 @@ int main() * std::function[link /reference/functional/function.md] * std::weak_ptr[link /reference/memory/weak_ptr.md] * wp.lock()[link /reference/memory/weak_ptr/lock.md] -* std::tuple[link /reference/tuple/tuple.md] * std::make_tuple[link /reference/tuple/make_tuple.md] * std::promise[link /reference/future/promise.md] * p.get_future()[link /reference/future/promise/get_future.md] diff --git a/lang/cpp20/adl_and_function_templates_that_are_not_visible.md b/lang/cpp20/adl_and_function_templates_that_are_not_visible.md index 2843c7bde1..0854827db4 100644 --- a/lang/cpp20/adl_and_function_templates_that_are_not_visible.md +++ b/lang/cpp20/adl_and_function_templates_that_are_not_visible.md @@ -53,7 +53,6 @@ int main() { std::cout << get<0>(t) << std::endl; // C++17:NG C++20:OK } ``` -* std::tuple[link /reference/tuple/tuple.md] * get[link /reference/tuple/tuple/get.md] ### 出力 diff --git a/lang/cpp20/explicit_bool.md b/lang/cpp20/explicit_bool.md index d8cc566065..1981098fda 100644 --- a/lang/cpp20/explicit_bool.md +++ b/lang/cpp20/explicit_bool.md @@ -94,7 +94,6 @@ std::tuple pixel_coordinates() struct NonCopyable { NonCopyable(int); NonCopyable(const NonCopyable&) = delete; }; std::pair pmd{42, 3.14}; // C++14でコンパイルエラー! ``` -* std::tuple[link /reference/tuple/tuple.md] この問題に対して、C++17では (対応が早い処理系はそれ以前から) これらのクラスのコンストラクタが、条件付きで`explicit`定義されるようにした。その実装方法としてはSFINAEによって、`explicit`コンストラクタと非`explicit`コンストラクタをオーバーロードする方法が使われていた。 diff --git a/reference/memory/uses_allocator_construction_args.md b/reference/memory/uses_allocator_construction_args.md index d3862b4e9b..3596122c20 100644 --- a/reference/memory/uses_allocator_construction_args.md +++ b/reference/memory/uses_allocator_construction_args.md @@ -215,7 +215,6 @@ int main() * std::allocator_arg_t[link allocator_arg_t.md] * std::ostream[link ../ostream/basic_ostream.md] * std::piecewise_construct_t[link ../utility/piecewise_construct_t.md] -* std::tuple[link ../tuple/tuple.md] * std::apply[link ../tuple/apply.md] ### 出力 diff --git a/reference/tuple/forward_as_tuple.md b/reference/tuple/forward_as_tuple.md index ecd0095c94..82e5c72da2 100644 --- a/reference/tuple/forward_as_tuple.md +++ b/reference/tuple/forward_as_tuple.md @@ -48,7 +48,6 @@ int main() } ``` * std::forward_as_tuple[color ff0000] -* std::tuple[link tuple.md] ### 出力 ``` diff --git a/reference/tuple/make_tuple.md b/reference/tuple/make_tuple.md index 596be85406..237294775a 100644 --- a/reference/tuple/make_tuple.md +++ b/reference/tuple/make_tuple.md @@ -54,7 +54,6 @@ int main() } ``` * std::make_tuple[color ff0000] -* std::tuple[link tuple.md] * std::ref[link /reference/functional/ref.md] * std::cref[link /reference/functional/cref.md] diff --git a/reference/tuple/tie.md b/reference/tuple/tie.md index b94c9d9751..f27dd96162 100644 --- a/reference/tuple/tie.md +++ b/reference/tuple/tie.md @@ -78,7 +78,6 @@ int main() ``` * std::tie[color ff0000] * std::ignore[link ignore.md] -* std::tuple[link tuple.md] #### 出力 ``` diff --git a/reference/tuple/tuple.md b/reference/tuple/tuple.md index 6b55fb90ab..a4a196ca89 100644 --- a/reference/tuple/tuple.md +++ b/reference/tuple/tuple.md @@ -93,7 +93,6 @@ int main() std::cout << s << std::endl; } ``` -* std::tuple[color ff0000] * std::get[link tuple/get.md] * std::make_tuple[link make_tuple.md] diff --git a/reference/tuple/tuple_cat.md b/reference/tuple/tuple_cat.md index 2c278f82d9..f1a5573651 100644 --- a/reference/tuple/tuple_cat.md +++ b/reference/tuple/tuple_cat.md @@ -55,7 +55,6 @@ int main() } ``` * std::tuple_cat[color ff0000] -* std::tuple[link tuple.md] * std::get[link tuple/get.md] ### 出力 diff --git a/reference/tuple/tuple_element.md b/reference/tuple/tuple_element.md index 8cc6c55586..06543ace0c 100644 --- a/reference/tuple/tuple_element.md +++ b/reference/tuple/tuple_element.md @@ -80,7 +80,6 @@ int main() } ``` * std::tuple_element[color ff0000] -* std::tuple[link tuple.md] ### 出力 ``` diff --git a/reference/tuple/tuple_size.md b/reference/tuple/tuple_size.md index 7132b6c54c..d20516e291 100644 --- a/reference/tuple/tuple_size.md +++ b/reference/tuple/tuple_size.md @@ -67,7 +67,6 @@ int main() } ``` * std::tuple_size[color ff0000] -* std::tuple[link tuple.md] ### 出力 ``` diff --git a/reference/utility/index_sequence_for.md b/reference/utility/index_sequence_for.md index 3aceab4d67..8f1a909400 100644 --- a/reference/utility/index_sequence_for.md +++ b/reference/utility/index_sequence_for.md @@ -53,7 +53,6 @@ int main() ``` * std::index_sequence_for[color ff0000] * std::integer_sequence[link integer_sequence.md] -* std::tuple[link /reference/tuple/tuple.md] * std::make_tuple[link /reference/tuple/make_tuple.md] ## 出力 diff --git a/reference/utility/pair/op_constructor.md b/reference/utility/pair/op_constructor.md index f7039ea235..72d83c383f 100644 --- a/reference/utility/pair/op_constructor.md +++ b/reference/utility/pair/op_constructor.md @@ -113,7 +113,6 @@ constexpr pair(piecewise_construct_t, struct NonCopyable { NonCopyable(int); NonCopyable(const NonCopyable&) = delete; }; std::pair pmd{42, 3.14}; // C++14でコンパイルエラー! ``` - * std::tuple[link /reference/tuple/tuple.md] - この変更はC++17に対するものであるが、コンパイラが早期に対応していたため、一部処理系ではC++14の段階から適格となっていた From dd2fa16c526d237459f87e1b6b2511545779968d Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 17 Jan 2023 20:24:46 +0900 Subject: [PATCH 0050/3948] =?UTF-8?q?format=20:=20Range=E3=81=AE=E3=83=87?= =?UTF-8?q?=E3=83=90=E3=83=83=E3=82=B0=E5=87=BA=E5=8A=9B=E3=82=92=E8=A7=A3?= =?UTF-8?q?=E9=99=A4=E3=81=99=E3=82=8B=E4=BE=8B=E3=82=92=E8=A8=98=E8=BC=89?= =?UTF-8?q?=20#1085?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/format.md | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/reference/format/format.md b/reference/format/format.md index ad5be59541..110f2a53db 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -168,6 +168,8 @@ Range・シーケンスコンテナに対して使用できる標準のオプシ - `?s`書式を指定した場合、`n`オプションと、`range-underlying-spec`は指定できない。 - コンテナが[`std::vector`](/reference/vector/vector.md)``である場合、その要素型は`bool`として処理される +- Range・シーケンスコンテナでは、要素型がデバッグ出力可能である場合、それがデフォルトで有効となる + - 要素型の書式を指定して、デバッグ出力指定をしなければ、デフォルトで有効になっているデバッグ出力を解除できる #### 連想コンテナの場合 (C++23) @@ -200,7 +202,7 @@ Range・シーケンスコンテナと同じだが、デフォルトで`m`書式 | (なし) | デフォルト | `tuple{3, 1.23, "hello"}`は`(3, 1.23, "hello")`となる | C++23 | - 要素型ごとに個別に書式を指定することはできない -- 文字列はデバッグ出力が常に有効 +- デバッグ出力可能な要素型の場合、デバッグ出力は常に有効 ### 書式例 @@ -388,10 +390,16 @@ int main() { std::vector vx = {0xf, 0x1e, 0x3c}; std::cout << std::format("5. {::#x}", vx) << std::endl; + // コンテナの要素型が文字・文字列型の場合はデフォルトでデバッグ出力 (?) が適用されるが、 + // 要素への書式指定として ? を指定しなければ、デバッグ出力が解除される + std::vector vt = {"h\tello", "w\norld", "C++"}; + std::cout << std::format("6. {:}", vt) << std::endl; + std::cout << std::format("7. {::}", vt) << std::endl; + // 文字を要素とするコンテナは文字列として出力させることもできる std::vector vc = {'h', '\n', 'e', 'l', 'l', 'o'}; - std::cout << std::format("6. {:s}", vc) << std::endl; - std::cout << std::format("7. {:?s}", vc) << std::endl; + std::cout << std::format("8. {:s}", vc) << std::endl; + std::cout << std::format("9. {:?s}", vc) << std::endl; } ``` * std::ranges::views::iota[link /reference/ranges/iota_view.md] @@ -404,9 +412,12 @@ int main() { 3. {1, 2, 3} 4. [1, 2, 3, 4] 5. [0xf, 0x1e, 0x3c] -6. h +6. ["h\tello", "w\norld", "C++"] +7. [h ello, w +orld, C++] +8. h ello -7. "h\nello" +9. "h\nello" ``` ### pair、tupleを出力する (C++23) From da9f2c769593d5d8b94ad15ed3291ab538c5f83f Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 18 Jan 2023 09:25:19 +0900 Subject: [PATCH 0051/3948] =?UTF-8?q?utility/unreachable:=20=E5=BE=AE?= =?UTF-8?q?=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/utility/unreachable.md | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/reference/utility/unreachable.md b/reference/utility/unreachable.md index f4e949d46a..9ba4c982d4 100644 --- a/reference/utility/unreachable.md +++ b/reference/utility/unreachable.md @@ -19,7 +19,7 @@ namespace std { ## 備考 -`std::unreachable`関数の事前条件は決して満たされない(恒偽式)となるため、関数呼び出しは常に未定義の動作を引き起こす。 +`std::unreachable`関数の事前条件は決して満たされない(恒偽式)ため、関数呼び出しは常に未定義の動作を引き起こす。 C++コンパイラはこの情報を利用し、`std::unreachable`呼び出しを含まないコードパスのみが実行されうると仮定して、より高速に動作するプログラムを生成する可能性がある。 @@ -28,15 +28,18 @@ C++コンパイラはこの情報を利用し、`std::unreachable`呼び出し #include #include -int f(int x) +int flip(int x) { - switch (x) { - case 0: - case 1: - return x; - default: - std::unreachable(); - } + switch (x) { + case 0: + return 1; + case 1: + return 0; + default: + // C++コンパイラは引数 x が値0,1以外を取らないと + // 仮定したコード生成を行う可能性がある。 + std::unreachable(); + } } int main() @@ -50,8 +53,8 @@ int main() ### 出力 ``` -0 1 +0 ``` From 3a5b2dc12d79e256423a3b90bb35533e103ec671 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 18 Jan 2023 09:33:55 +0900 Subject: [PATCH 0052/3948] =?UTF-8?q?operator=20delete[]=20:=20=E7=95=AA?= =?UTF-8?q?=E5=8F=B7=E3=81=AE=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/new/op_delete[].md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/new/op_delete[].md b/reference/new/op_delete[].md index b734ca7cd2..7be6ffe5c4 100644 --- a/reference/new/op_delete[].md +++ b/reference/new/op_delete[].md @@ -11,11 +11,11 @@ void operator delete[](void* ptr, std::align_val_t alignment) noexcept; void operator delete[](void* ptr, std::size_t size, std::align_val_t alignment) noexcept; // (4) C++17 から void operator delete[](void* ptr, const std::nothrow_t&) throw(); // (5) C++03 まで -void operator delete[](void* ptr, const std::nothrow_t&) noexcept; // (6) C++11 から -void operator delete[](void* ptr, std::align_val_t alignment, const std::nothrow_t&) noexcept; // (7) C++17 から +void operator delete[](void* ptr, const std::nothrow_t&) noexcept; // (5) C++11 から +void operator delete[](void* ptr, std::align_val_t alignment, const std::nothrow_t&) noexcept; // (6) C++17 から -void operator delete[](void* ptr, void*) throw(); // (8) C++03 まで -void operator delete[](void* ptr, void*) noexcept; // (8) C++11 から +void operator delete[](void* ptr, void*) throw(); // (7) C++03 まで +void operator delete[](void* ptr, void*) noexcept; // (7) C++11 から ``` * std::nothrow_t[link nothrow_t.md] * std::align_val_t[link align_val_t.md] From 5e7e22e36add8468caa85af0a3c18a7a443a5e1b Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 18 Jan 2023 17:57:22 +0900 Subject: [PATCH 0053/3948] =?UTF-8?q?=E5=8F=AF=E5=A4=89=E9=95=B7=E3=83=87?= =?UTF-8?q?=E3=83=BC=E3=82=BF=E3=82=92=E6=89=B1=E3=81=86=E3=82=AF=E3=83=A9?= =?UTF-8?q?=E3=82=B9=E3=81=AE=E5=8A=B9=E7=8E=87=E7=9A=84=E3=81=AA`delete`?= =?UTF-8?q?=E3=80=81=E5=AE=8C=E6=88=90=20#1102?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...sized_delete_for_variable_sized_classes.md | 129 +++++++++++++++++- 1 file changed, 127 insertions(+), 2 deletions(-) diff --git a/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md b/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md index dc5424748a..913238ea84 100644 --- a/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md +++ b/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md @@ -126,6 +126,47 @@ struct S { *destroying operator delete*が`operator delete`として使用される`delete`式の実行において、`delete`式は`delete`対象オブジェクトのデストラクタを呼び出さないで`operator delete`を呼び出す。また、その際の*destroying operator delete*の第二引数(`std::destroying_delete_t`に対応する引数)に渡される値は未規定。 +`delete`式に指定されているポインタの指すオブジェクトがクラス型であり、そのデストラクタが仮想デストラクタである場合、その`delete`式の実行に伴う`operator delete`の探索はそのオブジェクトの動的型(実行時の実際のクラス型)のスコープで行われる。この探索は、クラスの仮想関数を基底クラスから呼び出す時と同じものである。 + +```cpp +// 基底クラス +struct B { + virtual ~B(); + + // 普通のdelete演算子オーバーロード + void operator delete(void*, std::size_t); +}; + +// 派生クラス1 +struct D : B { + // 普通のdelete演算子オーバーロード + void operator delete(void*); +}; + +// 派生クラス2 +struct E : B { + void log_deletion(); + + // destroying operator delete + void operator delete(E *p, std::destroying_delete_t) { + p->log_deletion(); + p->~E(); + ::operator delete(p); + } +}; + +void f() { + B* bp = new D; + delete bp; // #1 D::operator delete(void*)が呼び出される + + bp = new E; + delete bp; // #2 E::operator delete(E*, std::destroying_delete_t)が呼び出される +} +``` + +`#1`において、`D`のオブジェクトは`delete`式によって破棄され、そのメモリ領域は`D::operator delete`によって解放される。 +`#2`において、`E`のオブジェクトの破棄とそのメモリ領域の解放は`E::operator delete`(*destroying operator delete*)によって行われる。 + ## 例 ### 可変サイズクラスの`delete` @@ -292,16 +333,100 @@ destruct derived2 ``` ## この機能が必要になった背景・経緯 -(執筆中) + +1つ目の例に挙げた`inlined_fixed_string`のような可変サイズクラスの定義は、ポインタの間接参照を回避しながら可変長配列を定義することができ、よく書かれるパターンだった(実際には*flexible array member*を使用することが多い)。 + +しかし、このようなクラスは[サイズ付きデアロケーション](/lang/cpp14/sized_deallocation.md)を活用して効率的に削除することができなかった。 + +`inlined_fixed_string`のオブジェクトを指すポインタを`s`とすると、`delete s;`という式の実行において、C++14([CWG Issue 2248](https://cplusplus.github.io/CWG/issues/2248)解決前)のコンパイラは次のようなコードを呼び出す必要があった + +```cpp +::operator delete(s, full_size); +``` + +しかし、この場合に自動で`full_size`を取得することはできない。 + +C++17では代わりに次のようなコードを出力する + +```cpp +::operator delete(s, sizeof(inlined_fixed_string)); +``` + +が、これは正しく確保したメモリ領域を解放していない。 + +正しくは、クラスで`operator delete`をオーバーロードする必要がある + +```cpp +static void operator delete(void* ptr) { + ::operator delete(ptr); // アロケータが知っているptrのサイズ情報に頼る(アロケータでそのサイズを求めるためのオーバーヘッドが発生しうる) +} +``` + +すなわち、サイズ付きデアロケーションを全く利用しない。これは安全に解放できるようになる一方で、サイズ付きデアロケーションのパフォーマンス上の利点を全て捨てることになる。 + +理想的には、クラスが保存している実際に確保したメモリのサイズを取得できることが望ましい + +```cpp +static void operator delete(void* ptr) { + inlined_fixed_string *s = reinterpret_cast(ptr); // UB + std::size_t full_size = sizeof(inlined_fixed_string) + s->size(); // UB + ::operator delete(ptr, full_size); +} +``` + +しかし、前述のように、この`operator delete`実行の前に`ptr`にあるオブジェクトは破棄されているため、これは未定義動作となる。 + +*destroying operator delete*は、この一番最後の`operator delete`相当のコードを安全にし、このような可変長クラスの`delete`を効率化するために導入された。 ## 検討されたほかの選択肢 -(執筆中) + +### `delete p`以外の削除メカニズム + +*destroying operator delete*が必要となる場合に、`delete`式ではなく別のメカニズムによってオブジェクトの破棄とメモリ解放を行う方法が検討された。しかし、これに次のような欠点がある + +- ユーザー定義型が組み込み型と同様に使用されるという原則に違反している + - この方法の場合、`delete`式が使えなくなる +- 仮想デストラクタを持つ既存のクラス階層は、動的にクラスレイアウトの先頭/末尾に領域を拡張する派生クラスに対して透過的に拡張できない +- メモリ解放戦略のローカルな選択がコードの利用者にリークする + - `std::unique_ptr`などにおいてはカスタムデリータを指定しなければならない + - `std::make_unique`などは使用できない + - リソース管理に`new/delete`を使用する多くのリソース管理クラスを使用できない + +これらの欠点(特に、`delete`式が使用できないこと)によって、この方法は好まれなかった。 + +### destroying operator deleteの別の構文 + +*destroying operator delete*を宣言する構文として、いくつかの構文が検討された。 + +```cpp +struct S { + // 1. void*の代わりにS*をとる + void operator delete(S*); + + // 2. 1+~を先頭につける + void operator ~delete(S*); + + // 3. デストラクタ風宣言 + ~S delete(); +}; +``` + +1. 通常の`operator delete`オーバーロードと区別がつきづらい +2. まだ通常の`operator delete`オーバーロードと区別がつきづらい + - `~delete`は新しい演算子であるため可読性の問題がある + - *destroying operator delete*は`delete`式の実行を完全にオーバーライドするものだが、異なる演算子オーバーロードになっていることによってそれを表現していない +3. デストラクタ風味の宣言によって、サブオブジェクト(メンバや基底クラス)のデストラクタが自動で呼ばれるという勘違いを招く可能性がある。 + - 加えて、2と同様の問題がある + +結局、`std::destroying_delete_t`を第二引数に取る形が一番シンプルかつ可読性が高いとして採用された。 ## 関連項目 +- [C++14 サイズ付きデアロケーション](/lang/cpp14/sized_deallocation.md) - [`std::destroying_delete_t`](/reference/new/destroying_delete_t.md) ## 参照 - [P0722R3 Efficient sized delete for variable sized classes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0722r3.html) - [P0722R1 Efficient sized delete for variable sized classes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0722r1.html) +- [CWG Issue 2248. Problems with sized delete](https://cplusplus.github.io/CWG/issues/2248) From 0f9f47544b06f157c39972ad9e2f7d28e274a304 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 18 Jan 2023 18:08:13 +0900 Subject: [PATCH 0054/3948] =?UTF-8?q?operator=20delete=20:=20=E4=B8=80?= =?UTF-8?q?=E8=A6=A7=E3=81=AE=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/new/op_delete.md | 4 ++++ reference/new/op_delete[].md | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/reference/new/op_delete.md b/reference/new/op_delete.md index 63c16b89bb..b8981ba97a 100644 --- a/reference/new/op_delete.md +++ b/reference/new/op_delete.md @@ -6,12 +6,16 @@ ```cpp void operator delete(void* ptr) throw(); // (1) C++03 まで void operator delete(void* ptr) noexcept; // (1) C++11 から + void operator delete(void* ptr, std::size_t size) noexcept; // (2) C++14 から + void operator delete(void* ptr, std::align_val_t alignment) noexcept; // (3) C++17 から + void operator delete(void* ptr, std::size_t size, std::align_val_t alignment) noexcept; // (4) C++17 から void operator delete(void* ptr, const std::nothrow_t&) throw(); // (5) C++03 まで void operator delete(void* ptr, const std::nothrow_t&) noexcept; // (5) C++11 から + void operator delete(void* ptr, std::align_val_t alignment, const std::nothrow_t&) noexcept; // (6) C++17 から void operator delete(void* ptr, void*) throw(); // (7) C++03 まで diff --git a/reference/new/op_delete[].md b/reference/new/op_delete[].md index 7be6ffe5c4..9866bb4d43 100644 --- a/reference/new/op_delete[].md +++ b/reference/new/op_delete[].md @@ -6,12 +6,16 @@ ```cpp void operator delete[](void* ptr) throw(); // (1) C++03 まで void operator delete[](void* ptr) noexcept; // (1) C++11 から + void operator delete[](void* ptr, std::size_t size) noexcept; // (2) C++14 から + void operator delete[](void* ptr, std::align_val_t alignment) noexcept; // (3) C++17 から + void operator delete[](void* ptr, std::size_t size, std::align_val_t alignment) noexcept; // (4) C++17 から void operator delete[](void* ptr, const std::nothrow_t&) throw(); // (5) C++03 まで void operator delete[](void* ptr, const std::nothrow_t&) noexcept; // (5) C++11 から + void operator delete[](void* ptr, std::align_val_t alignment, const std::nothrow_t&) noexcept; // (6) C++17 から void operator delete[](void* ptr, void*) throw(); // (7) C++03 まで From c73a9543b5fc9445921fd23c14b862129e8d21d3 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 18 Jan 2023 20:46:39 +0900 Subject: [PATCH 0055/3948] =?UTF-8?q?format=20:=20vector>?= =?UTF-8?q?=E3=81=AE=E6=9B=B8=E5=BC=8F=E6=8C=87=E5=AE=9A=E3=81=AE=E4=BE=8B?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20#1085?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/format.md | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/reference/format/format.md b/reference/format/format.md index 110f2a53db..50e023e2fb 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -390,16 +390,21 @@ int main() { std::vector vx = {0xf, 0x1e, 0x3c}; std::cout << std::format("5. {::#x}", vx) << std::endl; + // vector>の場合は、:で区切られた要素の書式がRangeの書式となり、 + // さらに :で区切って要素の書式指定をする + std::vector> vvx = {{0xf, 0x1e}, {0x3c}}; + std::cout << std::format("6. {:::#x}", vvx) << std::endl; + // コンテナの要素型が文字・文字列型の場合はデフォルトでデバッグ出力 (?) が適用されるが、 // 要素への書式指定として ? を指定しなければ、デバッグ出力が解除される std::vector vt = {"h\tello", "w\norld", "C++"}; - std::cout << std::format("6. {:}", vt) << std::endl; - std::cout << std::format("7. {::}", vt) << std::endl; + std::cout << std::format("7. {:}", vt) << std::endl; + std::cout << std::format("8. {::}", vt) << std::endl; // 文字を要素とするコンテナは文字列として出力させることもできる std::vector vc = {'h', '\n', 'e', 'l', 'l', 'o'}; - std::cout << std::format("8. {:s}", vc) << std::endl; - std::cout << std::format("9. {:?s}", vc) << std::endl; + std::cout << std::format("9. {:s}", vc) << std::endl; + std::cout << std::format("10. {:?s}", vc) << std::endl; } ``` * std::ranges::views::iota[link /reference/ranges/iota_view.md] @@ -412,12 +417,13 @@ int main() { 3. {1, 2, 3} 4. [1, 2, 3, 4] 5. [0xf, 0x1e, 0x3c] -6. ["h\tello", "w\norld", "C++"] -7. [h ello, w +6. [[0xf, 0x1e], [0x3c]] +7. ["h\tello", "w\norld", "C++"] +8. [h ello, w orld, C++] -8. h +9. h ello -9. "h\nello" +10. "h\nello" ``` ### pair、tupleを出力する (C++23) From 98315ac5cd9d4b828401de81dc4d2c205bd9c37a Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 19 Jan 2023 13:48:42 +0900 Subject: [PATCH 0056/3948] =?UTF-8?q?optional:=20P0798R8=20and=5Fthen/tran?= =?UTF-8?q?sform/or=5Felse=E8=BF=BD=E5=8A=A0(#1057)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23.md | 2 +- reference/optional/optional.md | 10 ++ reference/optional/optional/and_then.md | 123 +++++++++++++++++++++++ reference/optional/optional/or_else.md | 112 +++++++++++++++++++++ reference/optional/optional/transform.md | 104 +++++++++++++++++++ 5 files changed, 350 insertions(+), 1 deletion(-) create mode 100644 reference/optional/optional/and_then.md create mode 100644 reference/optional/optional/or_else.md create mode 100644 reference/optional/optional/transform.md diff --git a/lang/cpp23.md b/lang/cpp23.md index 051acc7536..71f95f71d9 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -203,7 +203,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 - [`std::visit()`](/reference/variant/visit.md)に指定できるバリアントオブジェクトを、直接的な「[`std::variant`](/reference/variant/variant.md)型の特殊化であること」という制約を緩和し、[`std::variant`](/reference/variant/variant.md)から派生した型も許可 - [``](/reference/utility.md)に、列挙値を基底型に変換する[`std::to_underlying()`](/reference/utility/to_underlying.md)関数を追加 - [``](/reference/utility.md)に、 (主に) メンバ変数を転送するため、指定された型の`const`性と参照修飾で引数を転送する[`std::forward_like()`](/reference/utility/forward_like.md)関数を追加 -- [`std::optional`](/reference/optional/optional.md)クラスにモナド操作としてメンバ関数[`and_then()`](/reference/optional/optional/and_then.md.nolink)、[`transform()`](/reference/optional/optional/transform.md.nolink)、[`or_else()`](/reference/optional/optional/or_else.md.nolink)を追加 +- [`std::optional`](/reference/optional/optional.md)クラスにモナド操作としてメンバ関数[`and_then()`](/reference/optional/optional/and_then.md)、[`transform()`](/reference/optional/optional/transform.md)、[`or_else()`](/reference/optional/optional/or_else.md)を追加 - 到達しないパスであることを表明する関数[`std::unreachable()`](/reference/utility/unreachable.md)を追加 - [`std::bitset`](/reference/bitset/bitset.md)クラスをさらに`constexpr`対応 diff --git a/reference/optional/optional.md b/reference/optional/optional.md index 9c2191c353..72847dfc1b 100644 --- a/reference/optional/optional.md +++ b/reference/optional/optional.md @@ -78,6 +78,15 @@ namespace std { | [`value_or`](optional/value_or.md) | 有効値もしくは指定された無効値を取得する | C++17 | +### モナド操作 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`and_then`](optional/and_then.md) | 有効値に対して関数を適用する | C++23 | +| [`transform`](optional/transform.md) | 有効値を変換する | C++23 | +| [`or_else`](optional/or_else.md) | 無効値に対して関数を適用する | C++23 | + + ## メンバ型 | 名前 | 説明 | 対応バージョン | @@ -201,3 +210,4 @@ error - [P0307R2 Making Optional Greater Equal Again](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0307r2.pdf) - [P0504R0 Revisiting in-place tag types for `any`/`optional`/`variant`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0504r0.html) - [LWG Issue 3196. `std::optional` is ill-formed is `T` is an array](https://wg21.cmeerw.net/lwg/issue3196) +- [P0798R8 Monadic operations for std::optional](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0798r8.html) diff --git a/reference/optional/optional/and_then.md b/reference/optional/optional/and_then.md new file mode 100644 index 0000000000..f84da9910b --- /dev/null +++ b/reference/optional/optional/and_then.md @@ -0,0 +1,123 @@ +# and_then +* optional[meta header] +* function template[meta id-type] +* std[meta namespace] +* optional[meta class] +* cpp23[meta cpp] + +```cpp +template constexpr auto and_then(F&& f) &; // (1) +template constexpr auto and_then(F&& f) &&; // (2) +template constexpr auto and_then(F&& f) const&; // (3) +template constexpr auto and_then(F&& f) const&&; // (4) +``` + +## 概要 +有効値を保持していれば、値に対して`f`を適用した結果を`optional`として返す。 +有効値を保持していなければ、[`std::nullopt`](../nullopt_t.md)を返す。 + +実際には複数オーバーロードが提供されるが、大まかには下記シグニチャのようにみなせる。 +`and_then`へは、引数リストに1個の`T`型をとり`std::optional`型を返す関数や関数オブジェクトを与える。 + +```cpp +template +class optional { + template + std::optional and_then(function(T)> func); +}; +``` +* function[link /reference/functional/function.md] + + +## 適格要件 +説明用の`U`型を次の通りとする: + +- (1), (3) : [`invoke_result_t`](/reference/type_traits/invoke_result.md)`` +- (2), (4) : [`invoke_result_t`](/reference/type_traits/invoke_result.md)`` + +[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``は`optional`の特殊化であること + + +## 効果 +- (1), (3) : 次と等価 + + ```cpp + if (*this) { + return invoke(std::forward(f), value()); + } else { + return remove_cvref_t(); + } + ``` + +- (2), (4) : 次と等価 + + ```cpp + if (*this) { + return invoke(std::forward(f), std::move(value())); + } else { + return remove_cvref_t(); + } + ``` + + +## 備考 +`and_then`は、メソッドチェーンをサポートするモナド風(monadic)操作として導入された。 +関数型プログラミングの文脈における Monadic Bind 操作に対応する。 + + +## 例 +```cpp example +#include +#include + +// 正数なら2倍/それ以外は無効値を返す関数 +std::optional twice(int n) +{ + if (0 < n) { + return n * 2; + } else { + return std::nullopt; + } +} + +int main() +{ + std::optional o1 = 2; + assert(o1.and_then(twice).value() == 4); + + std::optional o2 = -1; + assert(not o2.and_then(twice).has_value()); + + std::optional o3 = std::nullopt; + assert(not o3.and_then(twice).has_value()); +} +``` +* and_then[color ff0000] +* std::nullopt[link ../nullopt_t.md] +* value()[link value.md] +* has_value()[link has_value.md] + + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`transform`](transform.md) +- [`or_else`](or_else.md) + + +## 参照 +- [P0798R8 Monadic operations for std::optional](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0798r8.html) diff --git a/reference/optional/optional/or_else.md b/reference/optional/optional/or_else.md new file mode 100644 index 0000000000..b9d10ea866 --- /dev/null +++ b/reference/optional/optional/or_else.md @@ -0,0 +1,112 @@ +# or_else +* optional[meta header] +* function template[meta id-type] +* std[meta namespace] +* optional[meta class] +* cpp23[meta cpp] + +```cpp +template constexpr optional or_else(F&& f) const &; // (1) +template constexpr optional or_else(F&& f) &&; // (2) +``` + +## 概要 +有効値を保持していれば、なにもしない。 +有効値を保持していなければ、`f()`の呼び出し結果を`optional`として返す。 + +実際には複数オーバーロードが提供されるが、大まかには下記シグニチャのようにみなせる。 +`or_else`へは、空の引数リストをとり`std::optional`へ変換可能な`Return`型を返す関数や関数オブジェクトを与える。 + +```cpp +template +class optional { + template + std::optional or_else(function func); +}; +``` +* function[link /reference/functional/function.md] + + +## テンプレートパラメータ制約 +- (1) : `F`は[`invocable<>`](/reference/concepts/invocable.md)のモデル、かつ`T`は[`copy_constructible`](/reference/concepts/copy_constructible.md)のモデルであること +- (2) : `F`は[`invocable<>`](/reference/concepts/invocable.md)のモデル、かつ`T`は[`move_constructible`](/reference/concepts/move_constructible.md)のモデルであること + + +## 適格要件 +[`is_same_v`](/reference/type_traits/is_same.md)`<`[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`>, optional>`が`true`であること + + +## 効果 +- (1) : 次と等価 + + ```cpp + if (*this) { + return *this; + } else { + return std::forward(f)(); + } + ``` + +- (2) : 次と等価 + + ```cpp + if (*this) { + return std::move(*this); + } else { + return std::forward(f)(); + } + ``` + + +## 備考 +`or_else`は、メソッドチェーンをサポートするモナド風(monadic)操作として導入された。 + + +## 例 +```cpp example +#include +#include + +std::optional defvalue() +{ + return 42; +} + +int main() +{ + std::optional o1 = 1; + assert(o1.or_else(defvalue).value() == 1); + + std::optional o2 = std::nullopt; + assert(o2.or_else(defvalue).value() == 42); +} +``` +* or_else[color ff0000] +* std::nullopt[link ../nullopt_t.md] +* value()[link value.md] + + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`and_then`](and_then.md) +- [`transform`](transform.md) +- [`value_or`](value_or.md) + + +## 参照 +- [P0798R8 Monadic operations for std::optional](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0798r8.html) diff --git a/reference/optional/optional/transform.md b/reference/optional/optional/transform.md new file mode 100644 index 0000000000..0bbc9e62f6 --- /dev/null +++ b/reference/optional/optional/transform.md @@ -0,0 +1,104 @@ +# transform +* optional[meta header] +* function template[meta id-type] +* std[meta namespace] +* optional[meta class] +* cpp23[meta cpp] + +```cpp +template constexpr auto transform(F&& f) &; // (1) +template constexpr auto transform(F&& f) &&; // (2) +template constexpr auto transform(F&& f) const&; // (3) +template constexpr auto transform(F&& f) const&&; // (4) +``` + +## 概要 +有効値を保持していれば、値に対して`f`を適用した結果を`optional`に格納して返す。 +有効値を保持していなければ、[`std::nullopt`](../nullopt_t.md)を返す。 + +実際には複数オーバーロードが提供されるが、大まかには下記シグニチャのようにみなせる。 +`transform`へは、引数リストに1個の`T`型をとり`Return`型を返す関数や関数オブジェクトを与える。 + +```cpp +template +class optional { + template + std::optional transform(function func); +}; +``` +* function[link /reference/functional/function.md] + + +説明用の`U`型を次の通りとする: + +- (1), (3) : [`invoke_result_t`](/reference/type_traits/invoke_result.md)`` +- (2), (4) : [`invoke_result_t`](/reference/type_traits/invoke_result.md)`` + + +## 適格要件 +- (1), (3) : + - `U`型は[`in_place_t`](/reference/utility/in_place_t.md), [`nullopt_t`](nullopt_t.md)いずれでもなく、非配列オブジェクト型であること。 + - ある変数`u`の宣言 `U u(`[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`value()`](value.md)`));` が妥当であること。 +- (2), (4) : + - `U`型は[`in_place_t`](/reference/utility/in_place_t.md), [`nullopt_t`](nullopt_t.md)いずれでもなく、非配列オブジェクト型であること。 + - ある変数`u`の宣言 `U u(`[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`std​::​move`](/reference/utility/move.md)`(`[`value()`](value.md)`)));` が妥当であること。 + + +## 効果 +- (1), (3) : `*this`が有効値を保持するときは、[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`value()`](value.md)`)`で非リスト初期化した`optional`オブジェクトを返す。有効値を保持しないときは、`optional()`を返す。 +- (2), (4) : `*this`が有効値を保持するときは、[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`std​::​move`](/reference/utility/move.md)`(`[`value()`](value.md)`))`で非リスト初期化した`optional`オブジェクトを返す。有効値を保持しないときは、`optional()`を返す。 + + +## 備考 +`transform`は、メソッドチェーンをサポートするモナド風(monadic)操作として導入された。 +関数型プログラミングの文脈における Functor Map 操作に対応する。 + + +## 例 +```cpp example +#include +#include + +int twice(int n) +{ + return n * 2; +} + +int main() +{ + std::optional o1 = 2; + assert(o1.transform(twice).value() == 4); + + std::optional o2 = std::nullopt; + assert(not o2.transform(twice).has_value()); +} +``` +* transform[color ff0000] +* std::nullopt[link ../nullopt_t.md] +* value()[link value.md] +* has_value()[link has_value.md] + + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`and_then`](and_then.md) +- [`or_else`](or_else.md) + + +## 参照 +- [P0798R8 Monadic operations for std::optional](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0798r8.html) From bc4c31bdfdeb6460a9043885d82911b660104194 Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 19 Jan 2023 13:59:17 +0900 Subject: [PATCH 0057/3948] optional: fix inner link, remove forbidden chars(#1057) --- reference/optional/optional/and_then.md | 6 +++--- reference/optional/optional/transform.md | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/reference/optional/optional/and_then.md b/reference/optional/optional/and_then.md index f84da9910b..bb30148d8f 100644 --- a/reference/optional/optional/and_then.md +++ b/reference/optional/optional/and_then.md @@ -22,8 +22,8 @@ template constexpr auto and_then(F&& f) const&&; // (4) ```cpp template class optional { - template - std::optional and_then(function(T)> func); + template + std::optional and_then(function(T)> func); }; ``` * function[link /reference/functional/function.md] @@ -33,7 +33,7 @@ class optional { 説明用の`U`型を次の通りとする: - (1), (3) : [`invoke_result_t`](/reference/type_traits/invoke_result.md)`` -- (2), (4) : [`invoke_result_t`](/reference/type_traits/invoke_result.md)`` +- (2), (4) : [`invoke_result_t`](/reference/type_traits/invoke_result.md)`` [`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``は`optional`の特殊化であること diff --git a/reference/optional/optional/transform.md b/reference/optional/optional/transform.md index 0bbc9e62f6..b6206e0711 100644 --- a/reference/optional/optional/transform.md +++ b/reference/optional/optional/transform.md @@ -32,21 +32,21 @@ class optional { 説明用の`U`型を次の通りとする: - (1), (3) : [`invoke_result_t`](/reference/type_traits/invoke_result.md)`` -- (2), (4) : [`invoke_result_t`](/reference/type_traits/invoke_result.md)`` +- (2), (4) : [`invoke_result_t`](/reference/type_traits/invoke_result.md)`` ## 適格要件 - (1), (3) : - - `U`型は[`in_place_t`](/reference/utility/in_place_t.md), [`nullopt_t`](nullopt_t.md)いずれでもなく、非配列オブジェクト型であること。 + - `U`型は[`in_place_t`](/reference/utility/in_place_t.md), [`nullopt_t`](../nullopt_t.md)いずれでもなく、非配列オブジェクト型であること。 - ある変数`u`の宣言 `U u(`[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`value()`](value.md)`));` が妥当であること。 - (2), (4) : - - `U`型は[`in_place_t`](/reference/utility/in_place_t.md), [`nullopt_t`](nullopt_t.md)いずれでもなく、非配列オブジェクト型であること。 - - ある変数`u`の宣言 `U u(`[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`std​::​move`](/reference/utility/move.md)`(`[`value()`](value.md)`)));` が妥当であること。 + - `U`型は[`in_place_t`](/reference/utility/in_place_t.md), [`nullopt_t`](../nullopt_t.md)いずれでもなく、非配列オブジェクト型であること。 + - ある変数`u`の宣言 `U u(`[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`std::move`](/reference/utility/move.md)`(`[`value()`](value.md)`)));` が妥当であること。 ## 効果 - (1), (3) : `*this`が有効値を保持するときは、[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`value()`](value.md)`)`で非リスト初期化した`optional`オブジェクトを返す。有効値を保持しないときは、`optional()`を返す。 -- (2), (4) : `*this`が有効値を保持するときは、[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`std​::​move`](/reference/utility/move.md)`(`[`value()`](value.md)`))`で非リスト初期化した`optional`オブジェクトを返す。有効値を保持しないときは、`optional()`を返す。 +- (2), (4) : `*this`が有効値を保持するときは、[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`std::move`](/reference/utility/move.md)`(`[`value()`](value.md)`))`で非リスト初期化した`optional`オブジェクトを返す。有効値を保持しないときは、`optional()`を返す。 ## 備考 From ccc68e9e6e5c615c4801914c5e7110b53ba4d80e Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 19 Jan 2023 14:21:34 +0900 Subject: [PATCH 0058/3948] =?UTF-8?q?exception/rethrow=5Fexception:=20P167?= =?UTF-8?q?5P2=E5=AF=BE=E5=BF=9C(#1060)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/exception/rethrow_exception.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/reference/exception/rethrow_exception.md b/reference/exception/rethrow_exception.md index b40a019c76..c84d46525b 100644 --- a/reference/exception/rethrow_exception.md +++ b/reference/exception/rethrow_exception.md @@ -7,15 +7,25 @@ ```cpp [[noreturn]] void rethrow_exception(exception_ptr p); ``` +* exception_ptr[link exception_ptr.md] ## 概要 `exception_ptr`が指す例外オブジェクトを再スローする。 -## 要件 +## 事前条件 `p`がヌルを指す`exception_ptr`ではないこと。 +## 効果 +説明用の変数`u`を、`p`が指す例外オブジェクトもしくはそのコピーとする。 +コピーが行われるか否か、コピー時にメモリ確保が行われるか否かは未規定とされる。 + +- `u`用のメモリ確保に失敗した場合、[`bad_alloc`](/reference/new/bad_alloc.md)例外がスローされる。 +- そうでなければ、`p`が指す例外オブジェクトから`u`へのコピー時に例外スローされた場合、その例外がスローされる。 +- そうでなければ、`throw u;` + + ## 戻り値 この関数は決して返らない。 @@ -73,5 +83,5 @@ terminate called after throwing an instance of 'std::runtime_error' ## 参照 - [N2179 Language Support for Transporting Exceptions between Threads](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html) - - +- [P1675R2 `rethrow_exception` must be allowed to copy](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1675r2.pdf) + - 既存C++コンパイラの挙動にあわせて効果(Effects)文面を修正。 From 333f7233dc3a0e3aaa10ecce0fa8b2cbd1f46392 Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 19 Jan 2023 14:36:19 +0900 Subject: [PATCH 0059/3948] =?UTF-8?q?charconv:=20P2291R3=20to=5Fchars/from?= =?UTF-8?q?=5Fchars=20constexpr=E6=8C=87=E5=AE=9A(#1086)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/charconv/from_chars.md | 6 +++++- reference/charconv/to_chars.md | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/reference/charconv/from_chars.md b/reference/charconv/from_chars.md index 98dbda731a..c19cbb24d9 100644 --- a/reference/charconv/from_chars.md +++ b/reference/charconv/from_chars.md @@ -8,7 +8,9 @@ namespace std { //整数型用 from_chars_result from_chars(const char* first, const char* last, - /*see below*/& value, int base = 10); // (1) + /*see below*/& value, int base = 10); // (1) C++17 + constexpr from_chars_result from_chars(const char* first, const char* last, + /*see below*/& value, int base = 10); // (1) C++23 //浮動小数点型用 from_chars_result from_chars(const char* first, const char* last, float& value, @@ -257,3 +259,5 @@ nan - [P0067R5: Elementary string conversions, revision 5](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0067r5.html) - [P0682R1: Repairing elementary string conversions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0682r1.html) - [How to Use The Newest C++ String Conversion Routines - std::from_chars - Bartek's coding blog ](https://www.bfilipek.com/2018/12/fromchars.html) +- [P2291R3: Add Constexpr Modifiers to Functions to_chars and from_chars for Integral Types in `` Header](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2291r3.pdf) + - C++23での(1)constexpr指定 diff --git a/reference/charconv/to_chars.md b/reference/charconv/to_chars.md index cb05cd2f4e..0805a8b6ea 100644 --- a/reference/charconv/to_chars.md +++ b/reference/charconv/to_chars.md @@ -7,7 +7,9 @@ ```cpp namespace std { //整数型用 - to_chars_result to_chars(char* first, char* last, /*see below*/ value, int base = 10); // (1) + to_chars_result to_chars(char* first, char* last, /*see below*/ value, int base = 10); // (1) C++17 + constexpr to_chars_result to_chars(char* first, char* last, /*see below*/ value, int base = 10); // (1) C++23 + //boolの変換は禁止 to_chars_result to_chars(char* first, char* last, bool value, int base = 10) = delete; // C++20 @@ -222,3 +224,5 @@ z - [P0682R1: Repairing elementary string conversions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0682r1.html) - [LWG Issue 3266. `to_chars(bool)` should be deleted](https://wg21.cmeerw.net/lwg/issue3266) - [Visual Studio 2017 version 15.9.0 - Visual Studio 2017 version 15.9 Release Notes](https://docs.microsoft.com/en-us/visualstudio/releasenotes/vs2017-relnotes#-c) +- [P2291R3: Add Constexpr Modifiers to Functions to_chars and from_chars for Integral Types in `` Header](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2291r3.pdf) + - C++23での(1)constexpr指定 From dc3a27eda45160ff1b3cd68f5ad67915805fd0c5 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 19 Jan 2023 15:52:25 +0900 Subject: [PATCH 0060/3948] =?UTF-8?q?=20:=20range=5Fformat?= =?UTF-8?q?=E3=81=A8format=5Fkind=E3=82=92=E8=BF=BD=E5=8A=A0=20#1085?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 2 + reference/algorithm/ranges_unique_copy.md | 1 - .../chrono/zoned_time/op_deduction_guide.md | 1 - reference/concepts/assignable_from.md | 1 - reference/concepts/boolean-testable.md | 2 - reference/concepts/common_reference_with.md | 1 - reference/concepts/common_with.md | 1 - reference/format.md | 4 ++ reference/format/format_kind.md | 64 +++++++++++++++++++ reference/format/formattable.md | 2 - reference/format/range_format.md | 55 ++++++++++++++++ .../generator/promise_type/op_new.md | 1 - .../generator/promise_type/yield_value.md | 2 - reference/iterator/bidirectional_iterator.md | 1 - reference/iterator/common_iterator.md | 1 - reference/iterator/contiguous_iterator.md | 2 - reference/iterator/incrementable.md | 1 - reference/iterator/incrementable_traits.md | 1 - reference/iterator/indirect_result_t.md | 3 +- .../iterator/indirectly_readable_traits.md | 1 - reference/iterator/indirectly_writable.md | 1 - reference/iterator/iter_difference_t.md | 3 +- reference/iterator/projected.md | 4 +- reference/iterator/random_access_iterator.md | 1 - reference/iterator/sized_sentinel_for.md | 1 - reference/iterator/weakly_incrementable.md | 1 - reference/memory/no-throw-input-iterator.md | 2 - .../random/uniform_random_bit_generator.md | 1 - reference/ranges/borrowed_iterator_t.md | 1 - reference/ranges/borrowed_range.md | 1 - reference/ranges/borrowed_subrange_t.md | 1 - reference/ranges/common_range.md | 1 - reference/ranges/common_view.md | 1 - reference/ranges/contiguous_range.md | 1 - reference/ranges/dangling.md | 1 - reference/ranges/iota_view/end.md | 2 - reference/ranges/iota_view/size.md | 1 - reference/ranges/owning_view.md | 1 - reference/ranges/ref_view.md | 2 - reference/ranges/reverse_view.md | 1 - reference/ranges/view_interface.md | 1 - reference/ranges/viewable_range.md | 1 - 42 files changed, 128 insertions(+), 49 deletions(-) create mode 100644 reference/format/format_kind.md create mode 100644 reference/format/range_format.md diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index aeef4d91da..8322676ab3 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -71,6 +71,7 @@ * [link /reference/codecvt.md] * [link /reference/complex.md] * [link /reference/concepts.md] + * same_as[link /reference/concepts/same_as.md] * [link /reference/condition_variable.md] * std::condition_variable[link /reference/condition_variable/condition_variable.md] * [link /reference/cstddef.md] @@ -188,6 +189,7 @@ * [link /reference/tuple.md] * std::tuple[link /reference/tuple/tuple.md] * [link /reference/type_traits.md] + * remove_cvref_t[link /reference/type_traits/remove_cvref.md] * std::false_type[link /reference/type_traits/false_type.md] * std::is_same[link /reference/type_traits/is_same.md] * std::is_same_v[link /reference/type_traits/is_same.md] diff --git a/reference/algorithm/ranges_unique_copy.md b/reference/algorithm/ranges_unique_copy.md index ffea34d914..1d5b6e38a5 100644 --- a/reference/algorithm/ranges_unique_copy.md +++ b/reference/algorithm/ranges_unique_copy.md @@ -46,7 +46,6 @@ namespace std::ranges { * indirect_equivalence_relation[link /reference/iterator/indirect_equivalence_relation.md] * indirectly_copyable[link /reference/iterator/indirectly_copyable.md] * forward_iterator[link /reference/iterator/forward_iterator.md] -* same_as[link /reference/concepts/same_as.md] * iter_value_t[link /reference/iterator/iter_value_t.md] * indirectly_copyable_storable[link /reference/iterator/indirectly_copyable_storable.md] * projected[link /reference/iterator/projected.md] diff --git a/reference/chrono/zoned_time/op_deduction_guide.md b/reference/chrono/zoned_time/op_deduction_guide.md index 55473dcc96..ab6784e803 100644 --- a/reference/chrono/zoned_time/op_deduction_guide.md +++ b/reference/chrono/zoned_time/op_deduction_guide.md @@ -53,7 +53,6 @@ namespace std::chrono { * conditional_t[link /reference/type_traits/conditional.md] * is_convertible[link /reference/type_traits/is_convertible.md] * time_zone[link /reference/chrono/time_zone.md] -* remove_cvref_t[link /reference/type_traits/remove_cvref.md] ## 概要 `std::chrono::zoned_time`クラステンプレートの型推論補助。 diff --git a/reference/concepts/assignable_from.md b/reference/concepts/assignable_from.md index 7c27d22135..950aa72333 100644 --- a/reference/concepts/assignable_from.md +++ b/reference/concepts/assignable_from.md @@ -18,7 +18,6 @@ namespace std { * is_lvalue_reference_v[link /reference/type_traits/is_lvalue_reference.md] * remove_reference_t[link /reference/type_traits/remove_reference.md] * common_reference_with[link common_reference_with.md] -* same_as[link same_as.md] ## 概要 diff --git a/reference/concepts/boolean-testable.md b/reference/concepts/boolean-testable.md index db8d120f96..d285fa1fa6 100644 --- a/reference/concepts/boolean-testable.md +++ b/reference/concepts/boolean-testable.md @@ -84,9 +84,7 @@ namespace std { } ``` * movable[link /reference/concepts/movable.md] -* same_as[link /reference/concepts/same_as.md] * convertible_to[link /reference/concepts/convertible_to.md] -* remove_cvref_t[link /reference/type_traits/remove_cvref.md] * remove_reference_t[link /reference/type_traits/remove_reference.md] diff --git a/reference/concepts/common_reference_with.md b/reference/concepts/common_reference_with.md index 54445f7f47..ed23d35e35 100644 --- a/reference/concepts/common_reference_with.md +++ b/reference/concepts/common_reference_with.md @@ -13,7 +13,6 @@ namespace std { convertible_to>; } ``` -* same_as[link /reference/concepts/same_as.md] * convertible_to[link /reference/concepts/convertible_to.md] * common_reference_t[link /reference/type_traits/common_reference.md] diff --git a/reference/concepts/common_with.md b/reference/concepts/common_with.md index 7c24628cfa..bed016ee04 100644 --- a/reference/concepts/common_with.md +++ b/reference/concepts/common_with.md @@ -23,7 +23,6 @@ namespace std { add_lvalue_reference_t>>; } ``` -* same_as[link /reference/concepts/same_as.md] * common_type_t[link /reference/type_traits/common_type.md] * add_lvalue_reference_t[link /reference/type_traits/add_lvalue_reference.md] * common_reference_with[link /reference/concepts/common_reference_with.md] diff --git a/reference/format.md b/reference/format.md index 11273eceeb..86734ef79f 100644 --- a/reference/format.md +++ b/reference/format.md @@ -32,6 +32,10 @@ | [`basic_format_context`](format/basic_format_context.md) | 引数のフォーマットのコンテキスト (class template) | C++20 | | [`format_context`](format/basic_format_context.md) | `basic_format_context`のマルチバイト文字列版 (type-alias) | C++20 | | [`wformat_context`](format/basic_format_context.md) | `basic_format_context`のワイド文字列版 (type-alias) | C++20 | +| [`range_format`](format/range_format.md) | Rangeの書式種別 (enum) | C++23 | +| [`format_kind`](format/format_kind.md) | 指定したRangeの書式種別を取得する (variable) | C++23 | +| [`range_formatter`](format/range_formatter.md.nolink) | Rangeに対する書式文字列の解析、値のフォーマットを行う (class template) | C++23 | +| [`range-default-formatter`](format/range-default-formatter.md.nolink) | Rangeに対する共通の書式文字列の解析、値のフォーマットを行う説明専用クラス (class template) | C++23 | ## 引数 diff --git a/reference/format/format_kind.md b/reference/format/format_kind.md new file mode 100644 index 0000000000..0cabf103d6 --- /dev/null +++ b/reference/format/format_kind.md @@ -0,0 +1,64 @@ +# format_kind +* format[meta header] +* std[meta namespace] +* variable[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template + constexpr unspecified format_kind = unspecified; // (1) C++23 + + template + requires same_as> + constexpr range_format format_kind = see below; // (2) C++23 +} +``` +* range_format[link range_format.md] +* ranges::input_range[link /reference/ranges/input_range.md] + +## 概要 +Rangeの書式種別を取得する変数テンプレート。 + +- (1) プライマリテンプレート。これがインスタンス化されたらプログラムは不適格となる +- (2) 入力Rangeの型Rに応じて、書式種別を取得する + + +## 適格要件 +- (2) : 入力Rangeの型`R`は、const/volatileおよび参照で修飾されていないこと + + +## 効果 +以下、(2)について記載する。 + +- [`same_as`](/reference/concepts/same_as.md)`<`[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`<`[`ranges::range_reference_t`](/reference/ranges/range_reference_t.md)`>, R>`が`true`である場合、値[`range_format::disabled`](range_format.md)をもつ + - 例として、[`std::filesystem::path`](/reference/filesystem/path.md)のような再帰的な型がこれに相当する +- `R::key_type`が有効な式である場合 ([`std::map`](/reference/map/map.md)や[`std::set`](/reference/set/set.md)が相当する)、 + - `R::mapped_type`が有効な式であり、[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`<`[`ranges::range_reference_t`](/reference/ranges/range_reference_t.md)`>`を`U`として、`U`が[`std::pair`](/reference/utility/pair.md)の特殊化もしくは`U`が[`std::tuple`](/reference/tuple/tuple.md)の特殊化で要素数が2の場合、値[`range_format::map`](range_format.md)をもつ + - そうでない場合、値[`range_format::set`](range_format.md)をもつ +- そうでない場合、値[`range_format::sequence`](range_format.md)をもつ + + +## 備考 +- ユーザーは、この型の特殊化を定義できる + - ただし、その特殊化は定数式であり、型として`const` [`range_format`](range_format.md)をもつこと + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`format_kind`](range_format.md) +- [`formatter`](formatter.md) + + +## 参照 +- [P2286R8 Formatting Ranges](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2286r8.html) +- [P2585R1 Improve default container formatting](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2585r1.html) diff --git a/reference/format/formattable.md b/reference/format/formattable.md index b10613e016..7932564e3e 100644 --- a/reference/format/formattable.md +++ b/reference/format/formattable.md @@ -25,10 +25,8 @@ namespace std { ``` * formatter[link formatter.md] * semiregular[link /reference/concepts/semiregular.md] -* remove_cvref_t[link /reference/type_traits/remove_cvref.md] * basic_format_context[link basic_format_context.md] * basic_format_parse_context[link basic_format_parse_context.md] -* same_as[link /reference/concepts/same_as.md] ## 概要 `formattable`は、文字列フォーマット可能であることを表すコンセプトである。 diff --git a/reference/format/range_format.md b/reference/format/range_format.md new file mode 100644 index 0000000000..eca360a279 --- /dev/null +++ b/reference/format/range_format.md @@ -0,0 +1,55 @@ +# range_format +* format[meta header] +* std[meta namespace] +* enum[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + enum class range_format { + disabled, + map, + set, + sequence, + string, + debug_string + }; +} +``` + +## 概要 +Rangeの書式種別を表す列挙型。 + + +| 列挙値 | 説明 | +|----------------|------| +| `disabled` | 書式化ができないRangeであることを表す値 | +| `map` | [`std::map`](/reference/map/map.md)や[`std::flat_map`](/reference/flat_map/flat_map.md.nolink)向けの書式。`{k1: v1, k2: v2}` | +| `set` | [`std::set`](/reference/set/set.md)や[`std::flat_set`](/reference/flat_set/flat_set.md.nolink)向けの書式。`{v1, v2}` | +| `sequence` | [`std::vector`](/reference/vector/vector.md)や[`std::array`](/reference/array/array.md)向けの書式。`[v1, v2]`| +| `string` | 文字列向けの書式。`abc` | +| `debug_string` | デバッグ文字列向けの書式。`\nabc` | + + +## 備考 +- `disable`は値0であるため、`bool`型に変換して有効かどうかを判定するための使用できる + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`format_kind`](format_kind.md) +- [`formatter`](formatter.md) + + +## 参照 +- [P2286R8 Formatting Ranges](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2286r8.html) +- [P2585R1 Improve default container formatting](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2585r1.html) diff --git a/reference/generator/generator/promise_type/op_new.md b/reference/generator/generator/promise_type/op_new.md index 2127e113ab..e8fe66e717 100644 --- a/reference/generator/generator/promise_type/op_new.md +++ b/reference/generator/generator/promise_type/op_new.md @@ -17,7 +17,6 @@ template requires same_as || convertible_to void* operator new(size_t size, const This&, allocator_arg_t, const Alloc& alloc, const Args&...); ``` -* same_as[link /reference/concepts/same_as.md] * default_initializable[link /reference/concepts/default_initializable.md] * convertible_to[link /reference/concepts/convertible_to.md] * allocator_arg_t[link /reference/memory/allocator_arg_t.md] diff --git a/reference/generator/generator/promise_type/yield_value.md b/reference/generator/generator/promise_type/yield_value.md index 021e09c1dc..e2fdae00be 100644 --- a/reference/generator/generator/promise_type/yield_value.md +++ b/reference/generator/generator/promise_type/yield_value.md @@ -28,9 +28,7 @@ auto yield_value(ranges::elements_of r) noexcept; // (4) * ranges::range_reference_t[link /reference/ranges/range_reference_t.md] * remove_reference_t[link /reference/type_traits/remove_reference.md] * is_rvalue_reference_v[link /reference/type_traits/is_rvalue_reference.md] -* remove_cvref_t[link /reference/type_traits/remove_cvref.md] * constructible_from[link /reference/concepts/constructible_from.md] -* same_as[link /reference/concepts/same_as.md] * convertible_to[link /reference/concepts/convertible_to.md] diff --git a/reference/iterator/bidirectional_iterator.md b/reference/iterator/bidirectional_iterator.md index d8259b1146..c85f4c49b3 100644 --- a/reference/iterator/bidirectional_iterator.md +++ b/reference/iterator/bidirectional_iterator.md @@ -20,7 +20,6 @@ namespace std { * derived_from[link /reference/concepts/derived_from.md] * ITER_CONCEPT[link /reference/iterator/input_iterator.md#iter_concept] * bidirectional_iterator_tag[link iterator_tag.md] -* same_as[link /reference/concepts/same_as.md] ## 概要 diff --git a/reference/iterator/common_iterator.md b/reference/iterator/common_iterator.md index bfe04e2ad6..f6d48e0d4a 100644 --- a/reference/iterator/common_iterator.md +++ b/reference/iterator/common_iterator.md @@ -35,7 +35,6 @@ namespace std { ``` * input_or_output_iterator[link /reference/iterator/input_or_output_iterator.md] * sentinel_for[link /reference/iterator/sentinel_for.md] -* same_as[link /reference/concepts/same_as.md] * copyable[link /reference/concepts/copyable.md] * variant[link /reference/variant/variant.md] * incrementable_traits[link /reference/iterator/incrementable_traits.md] diff --git a/reference/iterator/contiguous_iterator.md b/reference/iterator/contiguous_iterator.md index aee5b0c82f..0271281b18 100644 --- a/reference/iterator/contiguous_iterator.md +++ b/reference/iterator/contiguous_iterator.md @@ -23,9 +23,7 @@ namespace std { * contiguous_iterator_tag[link /reference/iterator/iterator_tag.md] * is_lvalue_reference_v[link /reference/type_traits/is_lvalue_reference.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] -* same_as[link /reference/concepts/same_as.md] * iter_value_t[link /reference/iterator/iter_value_t.md] -* remove_cvref_t[link /reference/type_traits/remove_cvref.md] * to_address[link /reference/memory/to_address.md] * add_pointer_t[link /reference/type_traits/add_pointer.md] diff --git a/reference/iterator/incrementable.md b/reference/iterator/incrementable.md index 7014666de2..0ca128affd 100644 --- a/reference/iterator/incrementable.md +++ b/reference/iterator/incrementable.md @@ -17,7 +17,6 @@ namespace std { ``` * regular[link /reference/concepts/regular.md] * weakly_incrementable[link /reference/iterator/weakly_incrementable.md] -* same_as[link /reference/concepts/same_as.md] ## 概要 diff --git a/reference/iterator/incrementable_traits.md b/reference/iterator/incrementable_traits.md index fe12f10050..5315ed5ce9 100644 --- a/reference/iterator/incrementable_traits.md +++ b/reference/iterator/incrementable_traits.md @@ -111,7 +111,6 @@ int main() { } ``` * std::incrementable_traits[color ff0000] -* same_as[link /reference/concepts/same_as.md] ### 出力 ``` diff --git a/reference/iterator/indirect_result_t.md b/reference/iterator/indirect_result_t.md index 5f6238a9ea..40ff439278 100644 --- a/reference/iterator/indirect_result_t.md +++ b/reference/iterator/indirect_result_t.md @@ -41,7 +41,6 @@ int main() { } ``` * std::indirect_result_t[color ff0000] -* same_as[link /reference/concepts/same_as.md] ### 出力 ``` @@ -58,4 +57,4 @@ int main() { ## 参照 -- [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) \ No newline at end of file +- [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/iterator/indirectly_readable_traits.md b/reference/iterator/indirectly_readable_traits.md index d4b10579c3..c8fbdf2f68 100644 --- a/reference/iterator/indirectly_readable_traits.md +++ b/reference/iterator/indirectly_readable_traits.md @@ -129,7 +129,6 @@ int main() { } ``` * std::indirectly_readable_traits[color ff0000] -* same_as[link /reference/concepts/same_as.md] ### 出力 ``` diff --git a/reference/iterator/indirectly_writable.md b/reference/iterator/indirectly_writable.md index 5db0068582..2a78cad5f7 100644 --- a/reference/iterator/indirectly_writable.md +++ b/reference/iterator/indirectly_writable.md @@ -41,7 +41,6 @@ namespace std { indirectly_readable && same_as, decay_t> ``` * indirectly_readable[link indirectly_readable.md] -* same_as[link /reference/concepts/same_as.md] * iter_value_t[link /reference/iterator/iter_value_t.md] * decay_t[link /reference/type_traits/decay.md] diff --git a/reference/iterator/iter_difference_t.md b/reference/iterator/iter_difference_t.md index 520f1e0124..b0610cbc52 100644 --- a/reference/iterator/iter_difference_t.md +++ b/reference/iterator/iter_difference_t.md @@ -10,7 +10,6 @@ namespace std { using iter_difference_t = /*see below*/; } ``` -* remove_cvref_t[link /reference/type_traits/remove_cvref.md] ## 概要 @@ -63,4 +62,4 @@ int main() { ## 参照 -- [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) \ No newline at end of file +- [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/iterator/projected.md b/reference/iterator/projected.md index 2f9345b371..3e53a73318 100644 --- a/reference/iterator/projected.md +++ b/reference/iterator/projected.md @@ -24,7 +24,6 @@ namespace std { ``` * indirectly_readable[link /reference/iterator/indirectly_readable.md] * indirectly_regular_unary_invocable[link /reference/iterator/indirectly_unary_invocable.md] -* remove_cvref_t[link /reference/type_traits/remove_cvref.md] * indirect_result_t[link /reference/iterator/indirect_result_t.md] * incrementable_traits[link /reference/iterator/incrementable_traits.md] * iter_difference_t[link /reference/iterator/iter_difference_t.md] @@ -66,7 +65,6 @@ int main() { ``` * std::projected[color ff0000] * identity[link /reference/functional/identity.md] -* same_as[link /reference/concepts/same_as.md] * indirectly_readable[link /reference/iterator/indirectly_readable.md] * iter_difference_t[link /reference/iterator/iter_difference_t.md] * iter_value_t[link /reference/iterator/iter_value_t.md] @@ -95,4 +93,4 @@ int main() { ## 参照 -- [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) \ No newline at end of file +- [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/iterator/random_access_iterator.md b/reference/iterator/random_access_iterator.md index 960b1aea51..fe2a3e5f19 100644 --- a/reference/iterator/random_access_iterator.md +++ b/reference/iterator/random_access_iterator.md @@ -30,7 +30,6 @@ namespace std { * sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] * iter_difference_t[link /reference/iterator/iter_difference_t.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] -* same_as[link /reference/concepts/same_as.md] ## 概要 diff --git a/reference/iterator/sized_sentinel_for.md b/reference/iterator/sized_sentinel_for.md index ba62da114e..5f4a285b94 100644 --- a/reference/iterator/sized_sentinel_for.md +++ b/reference/iterator/sized_sentinel_for.md @@ -19,7 +19,6 @@ namespace std { * sentinel_for[link /reference/iterator/sentinel_for.md] * disable_sized_sentinel_for[link disable_sized_sentinel_for.md] * remove_cv_t[link /reference/type_traits/remove_cv.md] -* same_as[link /reference/concepts/same_as.md] * iter_difference_t[link /reference/iterator/iter_difference_t.md] ## 概要 diff --git a/reference/iterator/weakly_incrementable.md b/reference/iterator/weakly_incrementable.md index 26e83ed1c8..3fd39e8184 100644 --- a/reference/iterator/weakly_incrementable.md +++ b/reference/iterator/weakly_incrementable.md @@ -20,7 +20,6 @@ namespace std { * movable[link /reference/concepts/movable.md] * iter_difference_t[link /reference/iterator/iter_difference_t.md] * is-signed-integer-like[link /reference/iterator/is_integer_like.md] -* same_as[link /reference/concepts/same_as.md] ## 概要 diff --git a/reference/memory/no-throw-input-iterator.md b/reference/memory/no-throw-input-iterator.md index b831032aa7..f79ff1fa24 100644 --- a/reference/memory/no-throw-input-iterator.md +++ b/reference/memory/no-throw-input-iterator.md @@ -17,8 +17,6 @@ namespace std { * is_lvalue_reference_v[link /reference/type_traits/is_lvalue_reference.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] * iter_value_t[link /reference/iterator/iter_value_t.md] -* same_as[link /reference/concepts/same_as.md] -* remove_cvref_t[link /reference/type_traits/remove_cvref.md] ## 概要 diff --git a/reference/random/uniform_random_bit_generator.md b/reference/random/uniform_random_bit_generator.md index d1403fac8a..03c02d27ba 100644 --- a/reference/random/uniform_random_bit_generator.md +++ b/reference/random/uniform_random_bit_generator.md @@ -18,7 +18,6 @@ namespace std { ``` * invocable[link /reference/concepts/invocable.md] * unsigned_integral[link /reference/concepts/unsigned_integral.md] -* same_as[link /reference/concepts/same_as.md] * invoke_result_t[link /reference/type_traits/invoke_result.md] * bool_constant[link /reference/type_traits/bool_constant.md] diff --git a/reference/ranges/borrowed_iterator_t.md b/reference/ranges/borrowed_iterator_t.md index 82eb80f1ae..f53d9fca07 100644 --- a/reference/ranges/borrowed_iterator_t.md +++ b/reference/ranges/borrowed_iterator_t.md @@ -64,7 +64,6 @@ int main() { * ranges::dangling[link dangling.md] * ranges::subrange[link subrange.md] * borrowed_range[link borrowed_range.md] -* same_as[link /reference/concepts/same_as.md] ### 出力 ``` diff --git a/reference/ranges/borrowed_range.md b/reference/ranges/borrowed_range.md index 2a729a7728..524a2dfbb6 100644 --- a/reference/ranges/borrowed_range.md +++ b/reference/ranges/borrowed_range.md @@ -13,7 +13,6 @@ namespace std::ranges { * range[link range.md] * is_lvalue_reference_v[link /reference/type_traits/is_lvalue_reference.md] * enable_borrowed_range[link enable_borrowed_range.md] -* remove_cvref_t[link /reference/type_traits/remove_cvref.md] ## 概要 `borrowed_range`は、Rangeを所有しない`range`を表すコンセプトである。Rangeオブジェクトの左辺値参照は`borrowed_range`である。 diff --git a/reference/ranges/borrowed_subrange_t.md b/reference/ranges/borrowed_subrange_t.md index 7c47718f1a..165e437dd2 100644 --- a/reference/ranges/borrowed_subrange_t.md +++ b/reference/ranges/borrowed_subrange_t.md @@ -61,7 +61,6 @@ int main() { * ranges::dangling[link dangling.md] * ranges::subrange[link subrange.md] * borrowed_range[link borrowed_range.md] -* same_as[link /reference/concepts/same_as.md] ### 出力 ``` diff --git a/reference/ranges/common_range.md b/reference/ranges/common_range.md index 7725434f3a..689491fc1c 100644 --- a/reference/ranges/common_range.md +++ b/reference/ranges/common_range.md @@ -11,7 +11,6 @@ namespace std::ranges { } ``` * range[link range.md] -* same_as[link /reference/concepts/same_as.md] * iterator_t[link iterator_t.md] * sentinel_t[link sentinel_t.md] diff --git a/reference/ranges/common_view.md b/reference/ranges/common_view.md index 355f071a17..c80a810766 100644 --- a/reference/ranges/common_view.md +++ b/reference/ranges/common_view.md @@ -96,7 +96,6 @@ int main() { ``` * views::common[color ff0000] * views::iota[link iota_view.md] -* same_as[link /reference/concepts/same_as.md] ### 出力 ``` diff --git a/reference/ranges/contiguous_range.md b/reference/ranges/contiguous_range.md index 09451f7d8f..381e7dd852 100644 --- a/reference/ranges/contiguous_range.md +++ b/reference/ranges/contiguous_range.md @@ -17,7 +17,6 @@ namespace std::ranges { * contiguous_iterator[link /reference/iterator/contiguous_iterator.md] * iterator_t[link iterator_t.md] * ranges::data[link data.md] -* same_as[link /reference/concepts/same_as.md] * add_pointer_t[link /reference/type_traits/add_pointer.md] * range_reference_t[link range_reference_t.md] diff --git a/reference/ranges/dangling.md b/reference/ranges/dangling.md index 3494df0d79..785115d3e7 100644 --- a/reference/ranges/dangling.md +++ b/reference/ranges/dangling.md @@ -60,7 +60,6 @@ int main() * ranges::find[link /reference/algorithm/ranges_find.md] * ranges::subrange[link subrange.md] * borrowed_range[link borrowed_range.md] -* same_as[link /reference/concepts/same_as.md] ### 出力 ``` diff --git a/reference/ranges/iota_view/end.md b/reference/ranges/iota_view/end.md index a2b1e2bb5b..e6fb5b4b31 100644 --- a/reference/ranges/iota_view/end.md +++ b/reference/ranges/iota_view/end.md @@ -9,7 +9,6 @@ constexpr auto end() const; // (1) constexpr iterator end() const requires same_as; // (2) ``` -* same_as[link /reference/concepts/same_as.md] * iterator[link iterator.md] ## 概要 @@ -27,7 +26,6 @@ else // (2) return iterator{bound_}; ``` -* same_as[link /reference/concepts/same_as.md] * unreachable_sentinel_t[link /reference/iterator/unreachable_sentinel_t.md] * unreachable_sentinel[link /reference/iterator/unreachable_sentinel_t.md] * sentinel[link sentinel.md] diff --git a/reference/ranges/iota_view/size.md b/reference/ranges/iota_view/size.md index 20cf7f485b..abab7bdc27 100644 --- a/reference/ranges/iota_view/size.md +++ b/reference/ranges/iota_view/size.md @@ -9,7 +9,6 @@ constexpr auto size() const requires (same_as && advanceable) || (integral && integral) || sized_sentinel_for; ``` -* same_as[link /reference/concepts/same_as.md] * integral[link /reference/concepts/same_as.md] * advanceable[italic][link iterator.md] * sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] diff --git a/reference/ranges/owning_view.md b/reference/ranges/owning_view.md index 1986248acd..404178683e 100644 --- a/reference/ranges/owning_view.md +++ b/reference/ranges/owning_view.md @@ -145,7 +145,6 @@ namespace std::ranges { * declval[link /reference/utility/declval.md] * std::forward[link /reference/utility/forward.md] * addressof[link /reference/memory/addressof.md] -* same_as[link /reference/concepts/same_as.md] * iterator_t[link iterator_t.md] * sentinel_t[link sentinel_t.md] * ranges::begin[link begin.md] diff --git a/reference/ranges/ref_view.md b/reference/ranges/ref_view.md index 96f37ff23e..b180139763 100644 --- a/reference/ranges/ref_view.md +++ b/reference/ranges/ref_view.md @@ -127,11 +127,9 @@ namespace std::ranges { * range[link range.md] * is_object_v[link /reference/type_traits/is_object.md] * convertible_to[link /reference/concepts/convertible_to.md] -* remove_cvref_t[link /reference/type_traits/remove_cvref.md] * declval[link /reference/utility/declval.md] * std::forward[link /reference/utility/forward.md] * addressof[link /reference/memory/addressof.md] -* same_as[link /reference/concepts/same_as.md] * iterator_t[link iterator_t.md] * sentinel_t[link sentinel_t.md] * ranges::begin[link begin.md] diff --git a/reference/ranges/reverse_view.md b/reference/ranges/reverse_view.md index 3b4c80ece8..734be3926f 100644 --- a/reference/ranges/reverse_view.md +++ b/reference/ranges/reverse_view.md @@ -97,7 +97,6 @@ int main() { } ``` * views::reverse[color ff0000] -* same_as[link /reference/concepts/same_as.md] ### 出力 ``` diff --git a/reference/ranges/view_interface.md b/reference/ranges/view_interface.md index 1e1765f58a..9c75fdd6ec 100644 --- a/reference/ranges/view_interface.md +++ b/reference/ranges/view_interface.md @@ -12,7 +12,6 @@ namespace std::ranges { } ``` * is_class_v[link /reference/type_traits/is_class.md] -* same_as[link /reference/concepts/same_as.md] * remove_cv_t[link /reference/type_traits/remove_cv.md] ## 概要 diff --git a/reference/ranges/viewable_range.md b/reference/ranges/viewable_range.md index a4a1927c72..2ec364d469 100644 --- a/reference/ranges/viewable_range.md +++ b/reference/ranges/viewable_range.md @@ -16,7 +16,6 @@ namespace std::ranges { ``` * range[link range.md] * view[link view.md] -* remove_cvref_t[link /reference/type_traits/remove_cvref.md] * constructible_from[link /reference/concepts/constructible_from.md] * is_lvalue_reference_v[link /reference/type_traits/is_lvalue_reference.md] * movable[link /reference/concepts/movable.md] From 7f6f300c6b989362ef158ca6852f3feb7577e901 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 19 Jan 2023 16:37:51 +0900 Subject: [PATCH 0061/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE?= =?UTF-8?q?=E9=A3=BE=E6=BC=8F=E3=82=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/format_kind.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/format/format_kind.md b/reference/format/format_kind.md index 0cabf103d6..be59a73ce4 100644 --- a/reference/format/format_kind.md +++ b/reference/format/format_kind.md @@ -21,7 +21,7 @@ namespace std { Rangeの書式種別を取得する変数テンプレート。 - (1) プライマリテンプレート。これがインスタンス化されたらプログラムは不適格となる -- (2) 入力Rangeの型Rに応じて、書式種別を取得する +- (2) 入力Rangeの型`R`に応じて、書式種別を取得する ## 適格要件 From 61cbf011ad1acf7aecc4eab5853ea65edb6a4e80 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 19 Jan 2023 17:11:16 +0900 Subject: [PATCH 0062/3948] =?UTF-8?q?format=5Fkind=20:=20=E8=A6=8B?= =?UTF-8?q?=E5=87=BA=E3=81=97=E3=83=9F=E3=82=B9=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/format_kind.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/format/format_kind.md b/reference/format/format_kind.md index be59a73ce4..84295fbb95 100644 --- a/reference/format/format_kind.md +++ b/reference/format/format_kind.md @@ -24,7 +24,7 @@ Rangeの書式種別を取得する変数テンプレート。 - (2) 入力Rangeの型`R`に応じて、書式種別を取得する -## 適格要件 +## テンプレートパラメータ制約 - (2) : 入力Rangeの型`R`は、const/volatileおよび参照で修飾されていないこと From 84f996ba10e58682f9cb49fa77382f745e3b71a9 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Thu, 19 Jan 2023 18:27:02 +0900 Subject: [PATCH 0063/3948] =?UTF-8?q?=E5=8F=AF=E5=A4=89=E9=95=B7=E3=83=87?= =?UTF-8?q?=E3=83=BC=E3=82=BF=E3=82=92=E6=89=B1=E3=81=86=E3=82=AF=E3=83=A9?= =?UTF-8?q?=E3=82=B9=E3=81=AE=E5=8A=B9=E7=8E=87=E7=9A=84=E3=81=AAdelete=20?= =?UTF-8?q?:=20=E4=BF=AE=E6=AD=A3=E3=81=A8=E8=BF=BD=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../efficient_sized_delete_for_variable_sized_classes.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md b/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md index 913238ea84..2d16ae931f 100644 --- a/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md +++ b/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md @@ -14,7 +14,7 @@ struct S { // #1 Sのための operator delete オーバーロード void operator delete(void* p) { // Sのオブジェクトは破棄済みのため、未定義動作となる - const S& self = *p; // UB + const S* self = reinterpret_cast(p); // UB std::cout << self->str; // UB // メモリ領域の解放 @@ -69,7 +69,7 @@ int main() { ## 仕様 -クラススコープで定義された`operator delete()`で、第二引数が`std::destroying_delete_t`であるものを*destroying operator delete*と呼ぶ。クラス`C`に対する*destroying operator delete*の第一引数は`C*`でなければならず、その2点以外は通常の`operator delete`オーバーロードの制約に従う。 +クラススコープで定義された`operator delete()`で、第二引数が`std::destroying_delete_t`であるものを*destroying operator delete*と呼ぶ。クラス`C`に対する*destroying operator delete*の第一引数は`C*`でなければならず、それらの点以外は通常の`operator delete`オーバーロードの制約に従う。 ```cpp struct S { @@ -126,7 +126,7 @@ struct S { *destroying operator delete*が`operator delete`として使用される`delete`式の実行において、`delete`式は`delete`対象オブジェクトのデストラクタを呼び出さないで`operator delete`を呼び出す。また、その際の*destroying operator delete*の第二引数(`std::destroying_delete_t`に対応する引数)に渡される値は未規定。 -`delete`式に指定されているポインタの指すオブジェクトがクラス型であり、そのデストラクタが仮想デストラクタである場合、その`delete`式の実行に伴う`operator delete`の探索はそのオブジェクトの動的型(実行時の実際のクラス型)のスコープで行われる。この探索は、クラスの仮想関数を基底クラスから呼び出す時と同じものである。 +*destroying operator delete*に限らず全ての`operator delete`オーバーロードにおいて、`delete`式に指定されているポインタの指すオブジェクトがクラス型であり、そのデストラクタが仮想デストラクタである場合、その`delete`式の実行に伴う`operator delete`の探索はそのオブジェクトの動的型(実行時の実際のクラス型)のスコープで行われる。この探索は、クラスの仮想関数を基底クラスから呼び出す時と同じものである。 ```cpp // 基底クラス From 6634d8587f5b9dbb4dc46f1c792f5d3246fd3fea Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Thu, 19 Jan 2023 23:43:47 +0900 Subject: [PATCH 0064/3948] =?UTF-8?q?repeat=5Fview=E3=81=AE=E8=AA=AC?= =?UTF-8?q?=E6=98=8E=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges.md | 7 ++ reference/ranges/repeat_view.md | 108 ++++++++++++++++++ reference/ranges/repeat_view/iterator.md | 135 +++++++++++++++++++++++ 3 files changed, 250 insertions(+) create mode 100644 reference/ranges/repeat_view.md create mode 100644 reference/ranges/repeat_view/iterator.md diff --git a/reference/ranges.md b/reference/ranges.md index 855273b0fd..cbe100bf33 100644 --- a/reference/ranges.md +++ b/reference/ranges.md @@ -150,6 +150,13 @@ Rangeファクトリは、Rangeではないオブジェクトから[`view`](rang | [`iota_view`](ranges/iota_view.md) | 単調増加列であるRange (class template) | C++20 | | [`views::iota`](ranges/iota_view.md) | `iota_view`を生成する (customization point object) | C++20 | +### repeat view + +| 名前 | 説明 | 対応バージョン | +|-----------------------------------------------|-------------------------------------------------------|----------------| +| [`repeat_view`](ranges/repeat_view.md) | 指定した値を指定回数繰り返すRange (class template) | C++23 | +| [`views::repeat`](ranges/repeat_view.md) | `repeat_view`を生成する (customization point object) | C++23 | + ### istream view | 名前 | 説明 | 対応バージョン | diff --git a/reference/ranges/repeat_view.md b/reference/ranges/repeat_view.md new file mode 100644 index 0000000000..2143188090 --- /dev/null +++ b/reference/ranges/repeat_view.md @@ -0,0 +1,108 @@ +# repeat_view +* ranges[meta header] +* std::ranges[meta namespace] +* class template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template + requires (is_object_v && same_as> && + (is-integer-like || same_as)) + class repeat_view : public view_interface> { …… }; // (1) + + namespace views { + inline constexpr /*unspecified*/ repeat = /*unspecified*/; // (2) + } +} +``` +* move_constructible[link /reference/concepts/move_constructible.md] +* semiregular[link /reference/concepts/semiregular.md] +* unreachable_sentinel_t[link /reference/iterator/unreachable_sentinel_t.md] +* is_object_v[link /reference/type_traits/is_object.md] +* same_as[link /reference/concepts/same_as.md] +* remove_cv_t[link /reference/type_traits/remove_cv.md] +* is-integer-like[link /reference/iterator/is_integer_like.md] +* view_interface[link view_interface.md] + +## 概要 +- (1): 指定した値を指定回数繰り返す[`view`](view.md) +- (2): `repeat_view`を生成するカスタマイゼーションポイントオブジェクト + +回数を省略した場合、無限長となる。 + +### Rangeコンセプト + +| borrowed | sized | output | input | forward | bidirectional | random_access | contiguous | common | viewable | view | +|----------|-------|--------|-------|---------|---------------|---------------|------------|--------|----------|------| +| | (1) | | ○ | ○ | ○ | ○ | | (1) | ○ | ○ | + +- (1) `Bound = unreachable_sentinel_t` ではない場合 + +## 効果 +- 式`views::repear(E)`の効果は`repeat_view(E)`と等しい。 +- 式`views::repear(E, F)`の効果は`repeat_view(E, F)`と等しい。 + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|--------------------------------------------------|----------------------------------|----------------| +| [`(constructor)`](repeat_view/op_constructor.md.nolink) | コンストラクタ | C++23 | +| [`begin`](repeat_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++23 | +| [`end`](repeat_view/end.md.nolink) | 番兵を取得する | C++23 | +| [`size`](repeat_view/data.md.nolink) | 配列の先頭へのポインタを取得する | C++23 | + +## 継承しているメンバ関数 + +| 名前 | 説明 | 対応バージョン | +|----------------------------------------------|------------------------------ ----|----------------| +| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++23 | +| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++23 | +| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++23 | +| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++23 | + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|-------------------------------------------|------------------------------|----------------| +| [`iterator`](repeat_view/iterator.md) | イテレータ型(説明専用) | C++23 | + + +## 推論補助 + +| 名前 | 説明 | 対応バージョン | +|-------------------------------------------------------|------------------------------|----------------| +| [`(deduction_guide)`](repeat_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | + +## 例 +```cpp example +#include +#include + +int main() { + using namespace std; + + for(int n : views::repeat(42, 3)) { + cout << n << ' '; + } +} +``` +* views::repeat[color ff0000] + +### 出力 +``` +42 42 42 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ? +- [GCC](/implementation.md#gcc): ? +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): ? + +## 参照 +- [N4917 26 Ranges library](https://timsong-cpp.github.io/cppwp/ranges) diff --git a/reference/ranges/repeat_view/iterator.md b/reference/ranges/repeat_view/iterator.md new file mode 100644 index 0000000000..69b53a5a02 --- /dev/null +++ b/reference/ranges/repeat_view/iterator.md @@ -0,0 +1,135 @@ +# iterator +* ranges[meta header] +* std::ranges[meta namespace] +* repeat_view[meta class] +* class template[meta id-type] +* cpp23[meta cpp] + +## 概要 + +[`repeat_view`](../repeat_view.md)のイテレータ。 + +このクラスの名前は規定されておらず、振る舞いのみが規定されている。 + +このクラスの型を取得したい場合、[`iterator_t`](../iterator_t.md)を使用できる。 + + +## 実装例 + +```cpp +namespace std::ranges { + template + requires (is_object_v && same_as> && + (is-integer-like || same_as)) + class repeat_view::iterator { + private: + using index_type = conditional_t, ptrdiff_t, Bound>; + const T* value_ = nullptr;P + index_type current_ = index_type(); + + constexpr explicit iterator(const T* value, index_type b = index_type()) + : value_{value} + , current_{b} + { + } + + public: + using iterator_concept = random_access_iterator_tag; + using iterator_category = random_access_iterator_tag; + using value_type = T; + using difference_type = conditional_t, + index_type, + iota_diff_t(index_type)>; + + iterator() = default; + + constexpr const T& operator*() const noexcept { + return *value_; + } + + constexpr iterator& operator++() { + ++current_; + return *this; + } + constexpr iterator operator++(int) { + auto tmp = *this; + ++*this; + return tmp; + } + + constexpr iterator& operator--() { + --current_; + return *this; + } + constexpr iterator operator--(int) { + auto tmp = *this; + --*this; + return tmp; + } + + constexpr iterator& operator+=(difference_type n) { + current_ += n; + return *this; + } + constexpr iterator& operator-=(difference_type n) { + current_ -= n; + return *this; + } + constexpr const T& operator[](difference_type n) const noexcept { + return *(*this + n); + } + + friend constexpr bool operator==(const iterator& x, const iterator& y) { + return x.current_ == y.current_; + } + friend constexpr auto operator<=>(const iterator& x, const iterator& y) { + return x.current_ <=> y.current_; + } + + friend constexpr iterator operator+(iterator i, difference_type n) { + i += n; + return i; + } + friend constexpr iterator operator+(difference_type n, iterator i) { + i += n; + return i; + } + + friend constexpr iterator operator-(iterator i, difference_type n) { + i -= n; + return i; + } + friend constexpr difference_type operator-(const iterator& x, const iterator& y) { + return static_cast(x.current_) - static_cast(y.current_); + } + }; +} +``` +* move_constructible[link /reference/concepts/move_constructible.md] +* semiregular[link /reference/concepts/semiregular.md] +* unreachable_sentinel_t[link /reference/iterator/unreachable_sentinel_t.md] +* is_object_v[link /reference/type_traits/is_object.md] +* same_as[link /reference/concepts/same_as.md] +* remove_cv_t[link /reference/type_traits/remove_cv.md] +* is-integer-like[link /reference/iterator/is_integer_like.md] +* repeat_view[link ../repeat_view.md] +* conditional_t[link /reference/type_traits/conditional.md] +* ptrdiff_t[link /reference/stddef/ptrdiff_t.md] +* random_access_iterator_tag[link /reference/iterator/iterator_tag.md] +* is-signed-integer-like[link /reference/iterator/is_integer_like.md] +* iota_diff_t[link /reference/ranges/iota_view/iota_diff_t.md] +* incrementable[link /reference/iterator/incrementable.md] +* weakly-equality-comparable-with[link /reference/concepts/equality_comparable.md] + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ? +- [GCC](/implementation.md#gcc): ? +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): ? + +## 参照 +- [N4917 26 Ranges library](https://timsong-cpp.github.io/cppwp/ranges) From 8b51996ff3b9a4b68106d943313e89569da65069 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Thu, 19 Jan 2023 23:48:01 +0900 Subject: [PATCH 0065/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/repeat_view/iterator.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/ranges/repeat_view/iterator.md b/reference/ranges/repeat_view/iterator.md index 69b53a5a02..45f671b719 100644 --- a/reference/ranges/repeat_view/iterator.md +++ b/reference/ranges/repeat_view/iterator.md @@ -114,7 +114,7 @@ namespace std::ranges { * is-integer-like[link /reference/iterator/is_integer_like.md] * repeat_view[link ../repeat_view.md] * conditional_t[link /reference/type_traits/conditional.md] -* ptrdiff_t[link /reference/stddef/ptrdiff_t.md] +* ptrdiff_t[link /reference/cstddef/ptrdiff_t.md] * random_access_iterator_tag[link /reference/iterator/iterator_tag.md] * is-signed-integer-like[link /reference/iterator/is_integer_like.md] * iota_diff_t[link /reference/ranges/iota_view/iota_diff_t.md] From 8d68f98f82d54011721eac4667dd508b81c457ac Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Fri, 20 Jan 2023 00:26:59 +0900 Subject: [PATCH 0066/3948] Fix typo --- reference/ranges/repeat_view/iterator.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/ranges/repeat_view/iterator.md b/reference/ranges/repeat_view/iterator.md index 45f671b719..8116fd5008 100644 --- a/reference/ranges/repeat_view/iterator.md +++ b/reference/ranges/repeat_view/iterator.md @@ -24,7 +24,7 @@ namespace std::ranges { class repeat_view::iterator { private: using index_type = conditional_t, ptrdiff_t, Bound>; - const T* value_ = nullptr;P + const T* value_ = nullptr; index_type current_ = index_type(); constexpr explicit iterator(const T* value, index_type b = index_type()) From 53880060961c5a4400ef61ee610bd6077224c070 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 20 Jan 2023 16:51:46 +0900 Subject: [PATCH 0067/3948] =?UTF-8?q?formatter=20:=20C++23=E4=BB=95?= =?UTF-8?q?=E6=A7=98=E3=81=AB=E5=AF=BE=E5=BF=9C=E3=81=97=E3=80=81=E3=82=B5?= =?UTF-8?q?=E3=83=B3=E3=83=97=E3=83=AB=E3=82=B3=E3=83=BC=E3=83=89=E3=81=AE?= =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=83=91=E3=82=A4=E3=83=AB=E3=82=A8=E3=83=A9?= =?UTF-8?q?=E3=83=BC=E3=82=92=E4=BF=AE=E6=AD=A3=20(const=E3=81=8C=E6=8A=9C?= =?UTF-8?q?=E3=81=91=E3=81=A6=E3=81=9F)=20#1085?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/formatter.md | 113 ++++++++++++++++++++++++---------- 1 file changed, 79 insertions(+), 34 deletions(-) diff --git a/reference/format/formatter.md b/reference/format/formatter.md index e407919960..5d167a515b 100644 --- a/reference/format/formatter.md +++ b/reference/format/formatter.md @@ -7,15 +7,34 @@ ```cpp namespace std { - template - struct formatter; + template + struct formatter; // (1) C++20 + + template + requires (format_kind != range_format::disabled) && + formattable, charT> + struct formatter + : range-default-formatter, R, charT> { }; // (2) C++23 + + template ... Ts> + struct formatter, charT>; // (3) C++23 } ``` +* ranges::input_range[link /reference/ranges/input_range.md] +* format_kind[link format_kind.md] +* range_format[link range_format.md] +* formattable[link formattable.md] +* ranges::range_reference_t[link /reference/ranges/range_reference_t.md] +* range-default-formatter[link range-default-formatter.md.nolink] ## 概要 フォーマット引数の個々の型に対応する書式文字列の解析と値のフォーマットを担うクラス。 -`charT`を`char`または`wchar_t`とすると、標準で以下の特殊化が利用できる。 +- (1) : デフォルトのフォーマット +- (2) : Range用のフォーマット。実装は[`range-default-formatter`](range-default-formatter.md.nolink)クラスが行う +- (3) : [`std::pair`](/reference/utility/pair.md)と[`std::tuple`](/reference/tuple/tuple.md)に対する特殊化 + +(1)は、`charT`を`char`または`wchar_t`とすると、標準で以下の特殊化が利用できる。 - 1 以下のもの。 ```cpp @@ -46,43 +65,67 @@ namespace std { ワイド文字列とマルチバイト文字列を相互に変換するような特殊化は意図的に用意されていないが、ユーザーが用意することは禁止していない。 -## Formatter要件 +## ユーザーの型で`formatter`を特殊化する場合の要件 `formatter`の有効な特殊化はFormatter要件を満たす必要がある。 型`F`がFormatter要件を満たすとは、次のことをいう。 -* `F`は`Cpp17DefaultConstructible`、`Cpp17CopyConstructible`、`Cpp17CopyAssignable`、`Cpp17Destructible`であること +- `F`は`Cpp17DefaultConstructible`、`Cpp17CopyConstructible`、`Cpp17CopyAssignable`、`Cpp17Destructible`であること さらに、以下の条件を満たすこと 1. 式 `f.parse(pc)` が有効であり、 - * 戻り値の型が`PC::iterator`である - * イテレータ範囲`[pc.begin(), pc.end())`を解析して`format_error`を投げるか、解析が終わった位置を指すイテレータを返す + - 戻り値の型が`PC::iterator`である + - イテレータ範囲`[pc.begin(), pc.end())`を解析して`format_error`を投げるか、解析が終わった位置を指すイテレータを返す 2. 式 `f.format(t, fc)` が有効であり、 - * 戻り値の型が`FC::iterator`である - * フォーマット結果を`fc.out()`へ出力し、出力後のイテレータを返す - * 出力は`t`、`fc.locale()`、最後に呼び出された`f.parse(pc)`のイテレータ範囲`[pc.begin(), pc.end())`以外に依存しない + - 戻り値の型が`FC::iterator`である + - フォーマット結果を`fc.out()`へ出力し、出力後のイテレータを返す + - 出力は`t`、`fc.locale()`、最後に呼び出された`f.parse(pc)`のイテレータ範囲`[pc.begin(), pc.end())`以外に依存しない 3. 式 `f.format(u, fc)` が有効であり、 - * 戻り値が`FC::iterator`である - * フォーマット結果を`fc.out()`へ出力し、出力後のイテレータを返す - * 出力は`u`、`fc.locale()`、最後に呼び出された`f.parse(pc)`のイテレータ範囲`[pc.begin(), pc.end())`以外に依存しない - * `u`を変更しない + - 戻り値が`FC::iterator`である + - フォーマット結果を`fc.out()`へ出力し、出力後のイテレータを返す + - 出力は`u`、`fc.locale()`、最後に呼び出された`f.parse(pc)`のイテレータ範囲`[pc.begin(), pc.end())`以外に依存しない + - `u`を変更しない 条件内の各要素を、以下のように定義する -* 文字の型を`charT` -* 出力イテレータの型を`Out` -* フォーマット引数の型を`T` -* `f`を`F`のオブジェクト -* `u`を`T`のlvalue -* `t`を`T`または`const T`へ変換できる型のオブジェクト -* `PC`を`basic_format_parse_context` -* `FC`を`basic_format_context` -* `pc`を`PC`のlvalue -* `fc`を`FC`のlvalue -* `pc.begin()`は書式文字列中の対応する置換フィールドのオプションの先頭を指す -* オプションが空なら、`pc.begin() == pc.end()`または`*pc.begin() == '}'`である +- 文字の型を`charT` +- 出力イテレータの型を`Out` +- フォーマット引数の型を`T` +- `f`を`F`のオブジェクト +- `u`を`T`のlvalue +- `t`を`T`または`const T`へ変換できる型のオブジェクト +- `PC`を[`basic_format_parse_context`](basic_format_parse_context.md)`` +- `FC`を[`basic_format_context`](basic_format_context.md)`` +- `pc`を`PC`のlvalue +- `fc`を`FC`のlvalue +- `pc.begin()`は書式文字列中の対応する置換フィールドのオプションの先頭を指す +- オプションが空なら、`pc.begin() == pc.end()`または`*pc.begin() == '}'`である + + +## メンバ関数 + +| メンバ関数 | 説明 | 対応バージョン | +|------------|------|----------------| +| [`parse`](formatter/parse.md.nolink) | 書式の解析を行う | C++20 | +| [`format`](formatter/format.md.nolink) | 書式化を行う | C++20 | + + +### 文字・文字列に対する特殊化 + +| メンバ関数 | 説明 | 対応バージョン | +|------------|------|----------------| +| [`set_debug_format`](formatter/set_debug_format.md.nolink) | デバッグ書式を有効にする | C++23 | + + +### pair / tuple向けの特殊化 + +| メンバ関数 | 説明 | 対応バージョン | +|------------|------|----------------| +| [`set_separator`](formatter/set_separator.md.nolink) | 要素の区切り文字を設定する | C++23 | +| [`set_brackets`](formatter/set_brackets.md.nolink) | 全体の囲み文字を設定する | C++23 | + ## 例 ```cpp example @@ -93,15 +136,15 @@ enum color { red, green, blue }; const char* color_names[] = { "red", "green", "blue" }; -template<> struct std::formatter : std::formatter { - auto format(color c, format_context& ctx) { - return formatter::format(color_names[c], ctx); +template<> +struct std::formatter : std::formatter { + auto format(color c, std::format_context& ctx) const { + return std::formatter::format(color_names[c], ctx); } }; int main() { - int variable = 0; std::cout << std::format("{}", red) << std::endl; } ``` @@ -117,11 +160,13 @@ red ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? +- [GCC](/implementation.md#gcc): 13 - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 - -* [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) -* [{fmt}](https://github.com/fmtlib/fmt) +- [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) +- [{fmt}](https://github.com/fmtlib/fmt) +- [P2286R8 Formatting Ranges](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2286r8.html) +- [P2585R1 Improve default container formatting](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2585r1.html) + - C++23から、Range・コンテナ、`pair`、`tuple`のフォーマット出力、および文字・文字列のデバッグ指定 (`"?"`) が追加された From c5c2b70b56b6b6f805049ca80c7772d432bfc408 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 20 Jan 2023 17:03:35 +0900 Subject: [PATCH 0068/3948] =?UTF-8?q?=E7=B7=A8=E9=9B=86=E3=82=BF=E3=82=B9?= =?UTF-8?q?=E3=82=AF=E3=82=92=E3=80=81start=5Fediting.md=E3=81=AE=E4=B8=8B?= =?UTF-8?q?=E3=81=AE=E6=96=B9=E3=81=AB=E8=A8=98=E8=BC=89=E3=81=97=E3=81=9F?= =?UTF-8?q?=20(#1104)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start_editing.md | 163 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 131 insertions(+), 32 deletions(-) diff --git a/start_editing.md b/start_editing.md index c9451680d6..ca31544419 100644 --- a/start_editing.md +++ b/start_editing.md @@ -1,4 +1,4 @@ -# cpprefjpを編集するには +# はじめてのコントリビュート 本cpprefjpサイトは、GitHub Pagesのサービス上に構築されていますが、編集自体はGitHubリポジトリにあるMarkdown形式のプレーンテキストで行います。 @@ -54,64 +54,56 @@ Markdownは、GitHubサービス上でドキュメントを記述するフォー Markdownの記述方法をわかりやすく解説してくれているWebサイトは、すでに数多く存在しますので、詳細はそちらを参照してください。 -* [Markdown記法 チートシート](http://qiita.com/Qiita/items/c686397e4a0f4f11683d) -* [文章作成やメモ書きにも便利、Markdown記法](http://kojika17.com/2013/01/starting-markdown.html) +- [Markdown記法 チートシート](http://qiita.com/Qiita/items/c686397e4a0f4f11683d) +- [文章作成やメモ書きにも便利、Markdown記法](http://kojika17.com/2013/01/starting-markdown.html) ただし、cpprefjp特有の拡張構文もあります。 以下のページにまとめてあるので、そちらを参照して下さい。 -* [cpprefjp特有の拡張構文](/start_editing/specialized.md) +- [cpprefjp特有の拡張構文](/start_editing/specialized.md) Markdown形式では、HTMLのタグも併用できますが、cpprefjpサイトでは積極的にはHTMLタグを使用しない方針です。できるだけ、Markdown形式でできる範囲内で解決するようにしてください。 ただし、注釈・出典を貼るためにHTMLタグを利用します。 -* [cpprefjpにおける注釈・出典の貼り方](/start_editing/cite_note_ref.md) +- [cpprefjpにおける注釈・出典の貼り方](/start_editing/cite_note_ref.md) それ以外に本サイト内で使用しているHTMLタグは以下です: -* アンカーを貼るために、`対象文字列`のようなHTML5に基づく記法を利用している -* 表内での改行のために、`
`タグを利用している -* 値の大きさを表現するために、上付き文字を表す``タグを利用している -* 添字を表現するために、下付き文字を表す``タグを利用している +- アンカーを貼るために、`対象文字列`のようなHTML5に基づく記法を利用している +- 表内での改行のために、`
`タグを利用している +- 値の大きさを表現するために、上付き文字を表す``タグを利用している +- 添字を表現するために、下付き文字を表す``タグを利用している また、Markdownパーサーの制限を回避し、表内で `|` (縦線、vertical line) を使用するために、文字参照 `|` を使用してます。 新規リファレンスを書くにあたって、雛形ページを用意していますので、そちらをベースにして編集作業を行ってください。 -* [ヘッダファイルトップページの雛形](/start_editing/header_template_page.md) -* [関数の雛形](/start_editing/function_template_page.md) -* [クラスの雛形](/start_editing/class_template_page.md) -* [型の別名の雛形](/start_editing/type-type_template_page.md) +- [言語機能の雛形](/start_editing/lang_template_page.md) +- [ヘッダファイルページの雛形](/start_editing/header_template_page.md) +- [モジュールページの雛形](/start_editing/module_template_page.md) +- [関数の雛形](/start_editing/function_template_page.md) +- [クラスの雛形](/start_editing/class_template_page.md) +- [型の別名の雛形](/start_editing/type-type_template_page.md) +- [コンセプトの雛形](/start_editing/concept_template_page.md) +- [名前付き要件の雛形](/start_editing/named_requirement_template_page.md) +- [比較演算子の雛形](/start_editing/comparison_operator_template_page.md) +- [CPOの雛形](/start_editing/cpo_template_page.md) また、リポジトリのトップディレクトリに`GLOBAL_QUALIFY_LIST.txt`というファイルがあります。サイト全体のコードブロックに対して適用したい識別子の修飾があれば、ここに列挙していきます。書き方は各雛形ページに書いてあるコードブロックの修飾と同じです。 ## 初めての人は見ておいたほうがよいページ -* [処理系](/implementation.md) 処理系の正式な定義があります -* [進行状況](https://github.com/cpprefjp/site/wiki/progress) リファレンス作成の進行状況が確認できます -* [スタイル](/working_style.md) 作業を行う上でのスタイルの定義と、訳語があります +- [処理系](/implementation.md) 処理系の正式な定義があります +- [進行状況](https://github.com/cpprefjp/site/wiki/progress) リファレンス作成の進行状況が確認できます +- [スタイル](/working_style.md) 作業を行う上でのスタイルの定義と、訳語があります ## その他、cpprefjpを編集するにあたってのドキュメント -* [ページファイル名の付け方](/start_editing/page_names.md) -* [乱数分布の図を作る方法](/start_editing/random_figure.md) - - -## 次期C++バージョンへの対応方針と作業方法 -C++の次のバージョンで入ることが決まった機能については、以下の方針で対応を行います。 - -- 次のバージョンの言語機能・ライブラリ機能の解説は、随時許可する -- ただし、Working Draftに採択された機能のみを対象とする。まだ提案中の機能は、本サイトでの解説の対象外とする - - 例外は、機能テストマクロのようなコンパイラへの推奨機能 -- 採択された機能は、[C++ Standards Committee Papers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/)のEditor's Reportで確認できる -- 次のC++バージョンに採択された機能は、本リポジトリのWikiページに随時記載しているので、対応状況を含めてそちらを確認すること - - -## 本サイトのタスクを確認するには -本サイトで書くことが決まっているタスクを確認するには、issueを参照してください。「TASK」ラベルが付いているもので、担当者がついていないものがあれば、ぜひとも引き取ってください。 +- [ページファイル名の付け方](/start_editing/page_names.md) +- [乱数分布の図を作る方法](/start_editing/random_figure.md) ## Pull Requestのレビューとマージ @@ -138,3 +130,110 @@ Pull Requestのレビューが滞っていた場合、Pull Requestの提出者 - `git push -f`や`git push --force`といったコマンドは、リポジトリの設定で、masterブランチに対してはできないようにしてあります。これは、masterブランチは壊してはならないという理由によるものです - masterブランチ以外には強制プッシュできますので、Pull Request用のトピックブランチのコミットを整理する、といった目的などで使用していただいて大丈夫です + +## 求められる編集作業 +### 誤字・脱字を修正する (難易度★) +本サイトは編集者が手入力で解説を書いているため、誤字・脱字はどうしても発生してしまいます。 + +誤字・脱字があったら、積極的に修正してください。 + + +### 動作確認できたコンパイラバージョンを記載する (難易度★★) +本サイトのライブラリリファレンスでは、機能ごとに動作確認ができたコンパイラバージョンを記載しています。 + +各ページを書いた時点での動作確認できたコンパイラバージョンは記載していますが、その後の更新は十分に行えていません。 + +サンプルコードの下に以下のように動作確認できたコンパイラバージョンを記載する項目がありますので、「??」になっている項目がありましたら、動作確認して埋めていっていただきたいです。 + +``` +## 処理系 +### バージョン +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 1 +``` + +バージョンの表記としては、とくにVisual C++は本サイト独自の表記法がありますので、以下のページを確認してください。 + +- [処理系](implementation.md) + +対応バージョンは、動作確認できたコンパイラのうち、最小のバージョンを知りたいので、記載されているものより古いコンパイラバージョンで動作確認ができた場合は、記載されているバージョンを修正してください。 + +動作確認の方法としては、対象ページのサンプルコードを、お手元のコンパイラでコンパイル・実行し、出力が記載されているものと一致しているかを確認してください。 + +ただし、「出力例」のように記載されている場合、プラットフォームごとに出力が異なる可能性があります。その場合は仕様と実装を確認していただく必要があるかもしれません。 + +動作確認は、Webブラウザ上で行える場合があります。オンラインコンパイラとして、以下のサービスの使用も検討してください。 + +- [Wandbox](https://wandbox.org/) +- [Compiler Explorer](https://godbolt.org/) + + +### 関連項目を追加する (難易度★★★) +各ページには、「`## 関連項目`」という見出し以下に本サイト内の関連ページを記載できます。 + +読者が関連する情報を追いやすいように、関連ページへのリンク追加をお願いしたいです。 + +関連項目としては、以下のようなものを記載します: + +- 言語機能であれば、その機能への仕様変更・拡張など +- ライブラリであれば、 + - 組み合わせて使うことが多いもの + - 特定のデータ構造に特化した関数と、汎用の関数 + - その機能の代わりに使用を検討したほうがよいもの + +関連項目を書く場所については、各雛形ページを参照してください。 + +- [言語機能の雛形](/start_editing/lang_template_page.md) +- [ヘッダファイルページの雛形](/start_editing/header_template_page.md) +- [モジュールページの雛形](/start_editing/module_template_page.md) +- [関数の雛形](/start_editing/function_template_page.md) +- [クラスの雛形](/start_editing/class_template_page.md) +- [型の別名の雛形](/start_editing/type-type_template_page.md) +- [コンセプトの雛形](/start_editing/concept_template_page.md) +- [名前付き要件の雛形](/start_editing/named_requirement_template_page.md) +- [比較演算子の雛形](/start_editing/comparison_operator_template_page.md) +- [CPOの雛形](/start_editing/cpo_template_page.md) + + +### サンプルコードを追加する (難易度★★★★) +本サイトは、すべての機能にひとつ以上のサンプルコードを付けることを大きな価値としています。 + +サンプルコードをひとつは (ほぼ) 必ず付けるようにしていますが、ユースケースをカバーできていない場合があります。 + +良質なサンプルコードを作ることはむずかしいですが、機能の有用性を説明する最小サンプルコードを書くことに慣れている方や挑戦したい方にお願いしたいです。 + +サンプルコードを追加する場合、以下の要件を満たすようお願いします: + +1. 既存サンプルコードとは異なるユースケースや、異なる観点を与えるものであること +2. 標準の範囲内でその機能の有用性を説明しにくい場合を除き、プラットフォーム非依存であること +3. 十分に小さいこと + + +### 新仕様に対応する (難易度★★★★★★) +C++の規格書を読み慣れている方向けになります。 + +C++の新仕様やCWG/LWGのissueへの対応作業が多く求められます。対応がまだ行われていない作業は、以下で確認できます。 + +- [cpprefjp/siteリポジトリのタスクissue](https://github.com/cpprefjp/site/issues) + - 担当をとりやすいようタスクissueにしているものがある +- [cpprefjp/siteリポジトリのWiki](https://github.com/cpprefjp/site/wiki) + - CWG (Core Working Group) や LWG (Library Working Group) へのissue (Defect Report) など、タスクissueにしていない未対応タスクがすべて記載されている + +C++の次のバージョンで入ることが決まった機能については、以下の方針で対応を行います。 + +- 次のバージョンの言語機能・ライブラリ機能の解説は、随時許可する +- ただし、Working Draftに採択された機能のみを対象とする。まだ提案中の機能は、本サイトでの解説の対象外とする + - 例外は、機能テストマクロのようなコンパイラへの推奨機能 +- 採択された機能は、Wikiの各言語バージョンのページに記載されているが、されていなかったら[C++ Standards Committee Papers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/)のEditor's Reportで確認できる + + +### 優先度が低くなっている古くからある機能を記載する (難易度★★★★★★) +本サイトはなるべくすべての機能の解説を書くことを目標にしてはいますが、記載が追いついていないものがいくつかあります。 + +- iostream系 +- C互換ライブラリ +- ロケール + +これらはタスクissueにもできていませんが、手が足りず作業できていません。 + From c7b073edbaacae8d096596221e3f4b25f6c98362 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 20 Jan 2023 18:39:24 +0900 Subject: [PATCH 0069/3948] =?UTF-8?q?formatter=20:=20parse=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20#1085?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/format.md | 8 +++--- reference/format/formatter.md | 2 +- reference/format/formatter/parse.md | 44 +++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 reference/format/formatter/parse.md diff --git a/reference/format/format.md b/reference/format/format.md index 50e023e2fb..e0b6d80959 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -63,7 +63,7 @@ string s2 = format("{0} {}", "a", "b"); // コンパイルエラー string s3 = format("{} {1}", "a", "b"); // コンパイルエラー ``` -### 標準のオプション書式 +### 標準のオプション書式 組み込みの型に対して使える標準のオプション書式は次の通り(`[]`は省略可の意味)。 基本的に`printf`の書式を踏襲しているが、あくまでもオプションであり、省略しても``と同じようにデフォルトの書式が使われる。 @@ -141,7 +141,7 @@ string s3 = format("{} {1}", "a", "b"); // コンパイルエラー ポインタは`void*`のみサポートする。それ以外のポインタは、`void*`にキャストしなければ出力できない。 -#### Range・シーケンスコンテナの場合 (C++23) +#### Range・シーケンスコンテナの書式 (C++23) Range・シーケンスコンテナに対して使用できる標準のオプション書式は次の通り(`[]`は省略可の意味)。 @@ -172,12 +172,12 @@ Range・シーケンスコンテナに対して使用できる標準のオプシ - 要素型の書式を指定して、デバッグ出力指定をしなければ、デフォルトで有効になっているデバッグ出力を解除できる -#### 連想コンテナの場合 (C++23) +#### 連想コンテナの書式 (C++23) Range・シーケンスコンテナと同じだが、デフォルトで`m`書式を適用する。 -#### pair、tuple (C++23) +#### pair、tupleの書式 (C++23) [`std::pair`](/reference/utility/pair.md)と[`std::tuple`](/reference/tuple/tuple.md)に対して使用できる標準のオプション書式は次の通り(`[]`は省略可の意味)。 diff --git a/reference/format/formatter.md b/reference/format/formatter.md index 5d167a515b..2616e01481 100644 --- a/reference/format/formatter.md +++ b/reference/format/formatter.md @@ -108,7 +108,7 @@ namespace std { | メンバ関数 | 説明 | 対応バージョン | |------------|------|----------------| -| [`parse`](formatter/parse.md.nolink) | 書式の解析を行う | C++20 | +| [`parse`](formatter/parse.md) | 書式の解析を行う | C++20 | | [`format`](formatter/format.md.nolink) | 書式化を行う | C++20 | diff --git a/reference/format/formatter/parse.md b/reference/format/formatter/parse.md new file mode 100644 index 0000000000..65441609eb --- /dev/null +++ b/reference/format/formatter/parse.md @@ -0,0 +1,44 @@ +# parse +* format[meta header] +* function[meta id-type] +* std[meta namespace] +* formatter[meta class] +* cpp20[meta cpp] + +```cpp +template +constexpr typename ParseContext::iterator + parse(ParseContext& ctx); +``` +* ParseContext[link /reference/format/basic_format_parse_context.md] + +## 概要 +書式文字列の範囲`[ctx.begin(), ctx.end())`を解析する。 + + +## 効果 +- デフォルトの`formatter`の場合、[`std::format()`](/reference/format/format.md)関数ページに記載されている「[標準のオプション書式](/reference/format/format.md#std-format-options)」を解析する +- [`std::pair`](/reference/utility/pair.md)と[`std::tuple`](/reference/tuple/tuple.md)に対する`formatter`の特殊化の場合、[`std::format()`](/reference/format/format.md)関数ページに記載されている「[pair、tupleの書式](/reference/format/format.md#tuple-format-options)」を解析する + - このとき、書式によって以下を設定する + - 全体の囲み文字を、[`set_brackets()`](set_brackets.md.nolink)メンバ関数で設定する + - 要素の区切り文字を、[`set_separator()`](set_separator.md.nolink)メンバ関数で設定する + - 各要素の`formatter`を`e`として、[`e.set_debug_format()`](set_debug_format.md.nolink)が有効な式であれば、それを呼び出してデバッグ書式を有効にする + + +## 戻り値 +解析がおわった書式文字列の終端を指すイテレータを返す。 + + +## 備考 +- pair / tupleが文字・文字列を要素とする場合、デバッグ書式は常に有効となり、無効にする方法はない + + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13 +- [Visual C++](/implementation.md#visual_cpp): ?? + From a7b952b5dd1ab45c869dc554cdfa89b9eabfd1ae Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sat, 21 Jan 2023 14:28:19 +0900 Subject: [PATCH 0070/3948] =?UTF-8?q?=E3=83=87=E3=82=A3=E3=83=AC=E3=82=AF?= =?UTF-8?q?=E3=83=88=E3=83=AA=E6=A7=8B=E9=80=A0=E3=81=AE=E3=83=89=E3=82=AD?= =?UTF-8?q?=E3=83=A5=E3=83=A1=E3=83=B3=E3=83=88=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20#1114?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start_editing.md | 1 + start_editing/directory_structure.md | 33 ++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 start_editing/directory_structure.md diff --git a/start_editing.md b/start_editing.md index ca31544419..b25bab7577 100644 --- a/start_editing.md +++ b/start_editing.md @@ -104,6 +104,7 @@ Markdown形式では、HTMLのタグも併用できますが、cpprefjpサイト - [ページファイル名の付け方](/start_editing/page_names.md) - [乱数分布の図を作る方法](/start_editing/random_figure.md) +- [ディレクトリ構造](/start_editing/directory_structure.md) ## Pull Requestのレビューとマージ diff --git a/start_editing/directory_structure.md b/start_editing/directory_structure.md new file mode 100644 index 0000000000..0eab09424b --- /dev/null +++ b/start_editing/directory_structure.md @@ -0,0 +1,33 @@ +# ディレクトリ構造 +## lang +- cpp{version}.mdの形式で、各C++バージョンの言語機能ページを作る +- future.mdは、将来のC++で検討されている言語機能を記載するところである。導入予定だった機能が再検討になった場合などに使用する +- archive.mdは、廃案になったC++機能だが解説として残す価値のあるものがある場合に、記載するところである + + +## reference / module +- reference階層は、ヘッダベースのライブラリリファレンスで、その階層直下にはヘッダページを置く +- module階層は、モジュールベースのライブラリリファレンスで、その階層直下にはモジュールページを置く + +reference階層とmodule階層は上記以外は同じであるため、以下、共通のルールを書きます。 + +### ヘッダ・モジュール階層 +- ヘッダ・モジュール階層以下に、それに所属している機能のページを置く +- どのヘッダ・モジュールにも属さない機能の場合は、以下のように対応する + - 全体で使用する説明専用の機能は、仮のヘッダ``に属するものとして記載する + + +### クラス階層 +- クラスに属するメンバ関数と型は、クラス階層の下に置く +- オーバーロードを意図している関数、そのクラス向けに特殊化した機能も、クラス階層の下に置き、機能の列挙としてもクラスページで行う + - オーバーロードを意図している関数の例は以下: + - 非メンバ関数の演算子 + - `std::get()` + - `std::begin()`/`std::end()`およびそれに類するもの +- 演算子オーバーロードは、`operator<<` (出力ストリームへの出力) と `std::operator>>` (入力ストリームからの入力) を除き、左辺のクラスに属するものとする + - 特殊な例として、[`std::error_code`](/reference/system_error/error_code.md)と[`std::error_condition`](/reference/system_error/error_condition.md)の比較演算子は、クラス階層ではなくヘッダ階層としている。これは所属関係がむずかしいためである + + +### コンセプト階層 +- コンセプトによってオーバーロード・特殊化されている場合は、コンセプトの階層を作って、その下に置く。機能の列挙としてはヘッダページで行う + From e13f4b9b603c641a2612512aa5b414bbd873dd44 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sat, 21 Jan 2023 18:18:55 +0900 Subject: [PATCH 0071/3948] =?UTF-8?q?=E3=83=87=E3=82=A3=E3=83=AC=E3=82=AF?= =?UTF-8?q?=E3=83=88=E3=83=AA=E6=A7=8B=E9=80=A0=20:=20=E5=90=8D=E5=89=8D?= =?UTF-8?q?=E7=A9=BA=E9=96=93=E9=9A=8E=E5=B1=A4=E3=81=AB=E3=81=A4=E3=81=84?= =?UTF-8?q?=E3=81=A6=E8=A8=98=E8=BC=89=20#1114?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start_editing/directory_structure.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/start_editing/directory_structure.md b/start_editing/directory_structure.md index 0eab09424b..ff75d1bab4 100644 --- a/start_editing/directory_structure.md +++ b/start_editing/directory_structure.md @@ -31,3 +31,8 @@ reference階層とmodule階層は上記以外は同じであるため、以下 ### コンセプト階層 - コンセプトによってオーバーロード・特殊化されている場合は、コンセプトの階層を作って、その下に置く。機能の列挙としてはヘッダページで行う +### 名前空間階層 +- 名前空間の階層は基本的に導入しない。例外は以下: + - [`std::this_thread`](/reference/thread/this_thread.md) + - 名前空間に特殊な意味をもたせている + From 6d599abc0f83e6e4fbbda70230a5604e4887d17d Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sat, 21 Jan 2023 18:24:34 +0900 Subject: [PATCH 0072/3948] =?UTF-8?q?formatter=20:=20format=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=90=E9=96=A2=E6=95=B0=E3=81=AFconst=E3=81=A7?= =?UTF-8?q?=E3=81=AA=E3=81=91=E3=82=8C=E3=81=B0=E3=81=AA=E3=82=89=E3=81=AA?= =?UTF-8?q?=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/formatter.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/reference/format/formatter.md b/reference/format/formatter.md index 2616e01481..329f90fc85 100644 --- a/reference/format/formatter.md +++ b/reference/format/formatter.md @@ -78,11 +78,11 @@ namespace std { 1. 式 `f.parse(pc)` が有効であり、 - 戻り値の型が`PC::iterator`である - イテレータ範囲`[pc.begin(), pc.end())`を解析して`format_error`を投げるか、解析が終わった位置を指すイテレータを返す -2. 式 `f.format(t, fc)` が有効であり、 +2. 式 `cf.format(t, fc)` が有効であり、 - 戻り値の型が`FC::iterator`である - フォーマット結果を`fc.out()`へ出力し、出力後のイテレータを返す - 出力は`t`、`fc.locale()`、最後に呼び出された`f.parse(pc)`のイテレータ範囲`[pc.begin(), pc.end())`以外に依存しない -3. 式 `f.format(u, fc)` が有効であり、 +3. 式 `cf.format(u, fc)` が有効であり、 - 戻り値が`FC::iterator`である - フォーマット結果を`fc.out()`へ出力し、出力後のイテレータを返す - 出力は`u`、`fc.locale()`、最後に呼び出された`f.parse(pc)`のイテレータ範囲`[pc.begin(), pc.end())`以外に依存しない @@ -94,6 +94,7 @@ namespace std { - 出力イテレータの型を`Out` - フォーマット引数の型を`T` - `f`を`F`のオブジェクト +- `cf`を`F`の`const`オブジェクト - `u`を`T`のlvalue - `t`を`T`または`const T`へ変換できる型のオブジェクト - `PC`を[`basic_format_parse_context`](basic_format_parse_context.md)`` @@ -103,6 +104,8 @@ namespace std { - `pc.begin()`は書式文字列中の対応する置換フィールドのオプションの先頭を指す - オプションが空なら、`pc.begin() == pc.end()`または`*pc.begin() == '}'`である +[`std::formattable`](/reference/format/formattable.md)コンセプトも参照。 + ## メンバ関数 From 382c5a58f43a993659b3fe8bb6816fc28f2bcddc Mon Sep 17 00:00:00 2001 From: yoh Date: Sun, 22 Jan 2023 00:51:10 +0900 Subject: [PATCH 0073/3948] =?UTF-8?q?memory:=20P1132R8=20out=5Fptr=5Ft,out?= =?UTF-8?q?=5Fptr=E8=BF=BD=E5=8A=A0(#1050)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23.md | 2 +- reference/memory.md | 11 +++ reference/memory/out_ptr.md | 80 ++++++++++++++++++++ reference/memory/out_ptr_t.md | 58 ++++++++++++++ reference/memory/out_ptr_t/op_constructor.md | 45 +++++++++++ reference/memory/out_ptr_t/op_destructor.md | 75 ++++++++++++++++++ reference/memory/out_ptr_t/op_pointer.md | 44 +++++++++++ reference/memory/out_ptr_t/op_voidpp.md | 59 +++++++++++++++ 8 files changed, 373 insertions(+), 1 deletion(-) create mode 100644 reference/memory/out_ptr.md create mode 100644 reference/memory/out_ptr_t.md create mode 100644 reference/memory/out_ptr_t/op_constructor.md create mode 100644 reference/memory/out_ptr_t/op_destructor.md create mode 100644 reference/memory/out_ptr_t/op_pointer.md create mode 100644 reference/memory/out_ptr_t/op_voidpp.md diff --git a/lang/cpp23.md b/lang/cpp23.md index 71f95f71d9..0ad5123c1e 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -193,7 +193,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 ### メモリ -- [``](/reference/memory.md)に、出力ポインタと入出力ポインタの抽象である[`std::out_ptr`](/reference/memory/out_ptr.md.nolink)と[`std::inout_ptr`](/reference/memory/inout_ptr.md.nolink)を追加 +- [``](/reference/memory.md)に、レガシーC関数からスマートポインタへの直接出力をサポートする、スマートポインタアダプタ[`std::out_ptr`](/reference/memory/out_ptr.md)と[`std::inout_ptr`](/reference/memory/inout_ptr.md.nolink)を追加 - [`std::unique_ptr`](/reference/memory/unique_ptr.md)クラスを`constexpr`に対応 - [``](/reference/memory.md)に、オブジェクトの生存期間を開始することを明示する関数として、[`std::start_lifetime_as()`](/reference/memory/start_lifetime_as.md.nolink)と[`std::start_lifetime_as_array()`](/reference/memory/start_lifetime_as_array.md.nolink)を追加 - [``](/reference/bit.md)に、値のバイト入れ替え (エンディアン変換) を行う[`std::byteswap()`](/reference/bit/byteswap.md)関数を追加 diff --git a/reference/memory.md b/reference/memory.md index aa92020469..8bd2bd4f0b 100644 --- a/reference/memory.md +++ b/reference/memory.md @@ -90,6 +90,16 @@ | `auto_ptr` | 古い専有方式スマートポインタ(class template) | C++11から非推奨
C++17で削除 | +## スマートポインタアダプタ + +| 名前 | 説明 | 対応バージョン | +|------|------|-------| +| [`out_ptr_t`](memory/out_ptr_t.md) | スマートポインタへの出力サポート(class template) | C++23 | +| [`out_ptr`](memory/out_ptr.md) | スマートポインタへの出力サポートヘルパ関数(function template) | C++23 | +| [`inout_ptr_t`](memory/inout_ptr_t.md.nolink) | スマートポインタへの入出力サポート(class template) | C++23 | +| [`inout_ptr`](memory/inout_ptr.md.nolink) | スマートポインタへの入出力サポートヘルパ関数(function template) | C++23 | + + ## スマートポインタのアトミック操作 | 名前 | 説明 | 対応バージョン | @@ -138,3 +148,4 @@ - [P0718R2 Revising `atomic_shared_ptr` for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0718r2.html) - [P2051R0 C++ Standard Library Issues to be moved in Prague](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2051r0.html) - [P2186R2 Removing Garbage Collection Support](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2186r2.html) +- [P1132R8 out_ptr - a scalable output pointer abstraction](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1132r8.html) diff --git a/reference/memory/out_ptr.md b/reference/memory/out_ptr.md new file mode 100644 index 0000000000..e613eec812 --- /dev/null +++ b/reference/memory/out_ptr.md @@ -0,0 +1,80 @@ +# out_ptr +* memory[meta header] +* function template[meta id-type] +* std[meta namespace] +* cpp23[meta cpp] + +```cpp +namespace std { + template + auto out_ptr(Smart& s, Args&&... args); +} +``` + +## 概要 +2重ポインタ`T**`引数経由で新規確保リソースへのポインタを返すレガシーC関数に対して、出力されたポインタ値をスマートポインタ`s`に格納するアダプタ[`out_ptr_t`](out_ptr_t.md)を返すヘルパ関数。 + +C++標準スマートポインタ[`std::shared_ptr`](shared_ptr.md)や[`std::unique_ptr`](unique_ptr.md)を始め、互換インタフェースをもつ任意のスマートポインタ型`Smart`を取り扱える。 + + +説明用の`P`型を次のように定義する : + +- [`is_void_v`](/reference/type_traits/is_void.md)``が`false`ならば`Pointer` +- そうでなければ、`Smart::pointer`が有効な型名であれば`Smart::pointer` +- そうでなければ、`Smart::element_type*`が有効な型名であれば`Smart::element_type*` +- そうでなければ、[`pointer_traits`](pointer_traits.md)`::element_type*` + + +## 戻り値 +[`out_ptr_t`](out_ptr_t.md)`(s,` [`std::forward`](/reference/utility/forward.md)`(args)...)` + + +## 例 +### P1132R8引用 +```cpp example +// Legacy C APIs +error_num c_api_create_handle(int seed_value, int** p_handle); +void c_api_delete_handle(int* handle); + +// C++ program +#include + +struct resource_deleter { + void operator()(int* handle) { + c_api_delete_handle(handle); + } +}; + +int main() { + std::unique_ptr resource(nullptr); + error_num err = c_api_create_handle( + 24, std::out_ptr(resource) + ); + if (err == C_API_ERROR_CONDITION) { + // handle errors + } + // resource.get() the out-value from the C API function +} +``` +* std::out_ptr[color ff0000] + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`out_ptr_t`](out_ptr_t.md) +- [`shared_ptr`](shared_ptr.md) +- [`unique_ptr`](unique_ptr.md) + + +## 参照 +- [P1132R8 out_ptr - a scalable output pointer abstraction](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1132r8.html) diff --git a/reference/memory/out_ptr_t.md b/reference/memory/out_ptr_t.md new file mode 100644 index 0000000000..5a2dee0b09 --- /dev/null +++ b/reference/memory/out_ptr_t.md @@ -0,0 +1,58 @@ +# out_ptr_t +* memory[meta header] +* class template[meta id-type] +* std[meta namespace] +* cpp23[meta cpp] + +```cpp +namespace std { + template + class out_ptr_t; +} +``` + +## 概要 +2重ポインタ`T**`(=`Pointer*`)引数経由で新規確保リソースへのポインタを返すレガシーC関数に対して、取得されたポインタ値をスマートポインタに格納するアダプタクラス。 +アダプタオブジェクトの生成には、[`std::out_ptr()`](out_ptr.md)ヘルパ関数を利用する。 + +C++標準スマートポインタ[`std::shared_ptr`](shared_ptr.md)や[`std::unique_ptr`](unique_ptr.md)を始め、互換インタフェースをもつ任意のスマートポインタ型`Smart`を取り扱える。 + + +## テンプレートパラメータ制約 +`Pointer`はCpp17NullablePointer要件を満たすこと + + +## 適格要件 +`Smart`が[`shared_ptr`](shared_ptr.md)の特殊化かつ`sizeof...(Args) == 0`の場合、プログラムは不適格となる。 +(根拠説明は[デストラクタ](out_ptr_t/op_destructor.md)を参照のこと。) + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|-----------------|----------------|----------------| +| [`(constructor)`](out_ptr_t/op_constructor.md) | コンストラクタ | C++23 | +| [`(destructor)`](out_ptr_t/op_destructor.md) | デストラクタ | C++23 | +| [`operator Pointer*()`](out_ptr_t/op_pointer.md) | `Pointer*`への暗黙変換 | C++23 | +| [`operator void**()`](out_ptr_t/op_voidpp.md) | `void**`への暗黙変換 | C++23 | + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`out_ptr()`](out_ptr.md) +- [`shared_ptr`](shared_ptr.md) +- [`unique_ptr`](unique_ptr.md) + + +## 参照 +- [P1132R8 out_ptr - a scalable output pointer abstraction](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1132r8.html) diff --git a/reference/memory/out_ptr_t/op_constructor.md b/reference/memory/out_ptr_t/op_constructor.md new file mode 100644 index 0000000000..d73d0961e8 --- /dev/null +++ b/reference/memory/out_ptr_t/op_constructor.md @@ -0,0 +1,45 @@ +# コンストラクタ +* memory[meta header] +* std[meta namespace] +* out_ptr_t[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +explicit out_ptr_t(Smart& smart, Args... args); // (1) +out_ptr_t(const out_ptr_t&) = delete; // (2) +``` + +## 概要 +- (1) : `out_ptr_t`オブジェクトの構築。 +- (2) : コピーコンストラクタ。コピー不可。 + + +## 効果 +(1) : `out_ptr_t`クラスの説明用メンバ変数`s`, `a`, `p`を下記の通り初期化する。 + +- `Smart&`型メンバ変数 : `s = smart;` +- `tuple`型メンバ変数 : `a =` [`std::forward`](/reference/utility/forward.md)`(args)...;` +- `Pointer`型メンバ : `p = {};` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`out_ptr()`](../out_ptr.md) +- [`(destructor)`](op_destructor.md) +- [`operator Pointer*`](op_pointer.md) +- [`operator void**`](op_voidpp.md) + + +## 参照 +- [P1132R8 out_ptr - a scalable output pointer abstraction](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1132r8.html) diff --git a/reference/memory/out_ptr_t/op_destructor.md b/reference/memory/out_ptr_t/op_destructor.md new file mode 100644 index 0000000000..22946ceb0b --- /dev/null +++ b/reference/memory/out_ptr_t/op_destructor.md @@ -0,0 +1,75 @@ +# デストラクタ +* memory[meta header] +* std[meta namespace] +* out_ptr_t[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +~out_ptr_t(); +``` + +## 概要 +指定した`Smart`型スマートポインタに、レガシーC関数呼び出しにより取得されたポインタ値を格納する。 + +スマートポインタへのポインタ値格納には、`Smart::reset()`メンバ関数、もしくは`Smart`オブジェクト構築+ムーブ代入`operator=`が利用される。 + +- オブジェクト単位でカスタムデリータを管理する[`std::shared_ptr`](../shared_ptr.md)の場合、[`out_ptr_t`コンストラクタ](op_constructor.md)にてデリータオブジェクトを渡しておくことで、[`reset()`](../shared_ptr/reset.md)呼び出しの追加引数リストとして渡される。 +この動作は[`out_ptr_t`](../out_ptr_t.md)クラステンプレートの適格要件にて強制される。 +- 型レベルでカスタムデリータを管理する[`std::unique_ptr`](../unique_ptr.md)の場合、[`reset()`](../unique_ptr/reset.md)呼び出しには取得ポインタ値のみが渡される。 +- これ以外のスマートポインタ型では、同スマートポインタの動作セマンティクスに従う。 + + +## 効果 +説明用の`SP`型を下記の通り定義する : + +- `Smart::pointer`が有効な型名であれば`Smart::pointer` +- そうでなければ、`Smart::element_type*`が有効な型名であれば`Smart::element_type*` +- そうでなければ、[`pointer_traits`](../pointer_traits.md)`::element_type*` +- そうでなければ、`Pointer` + +[説明用メンバ変数](op_constructor.md)`s`, `a`, `p`を用いて、以下と同じ効果を持つ : + +- 式 `s.reset(static_cast(p),` [`std::forward`](/reference/utility/forward.md)`(args)...)` が適格ならば、 + + ```cpp + if (p) { + apply([&](auto&&... args) { + s.reset(static_cast(p), std::forward(args)...); }, std::move(a)); + } + ``` + * apply[link /reference/tuple/apply.md] + +- [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true`ならば、 + + ```cpp + if (p) { + apply([&](auto&&... args) { + s = Smart(static_cast(p), std::forward(args)...); }, std::move(a)); + } + ``` + * apply[link /reference/tuple/apply.md] + +- そうでなければ、プログラムは不適格となる。 + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`out_ptr()`](../out_ptr.md) +- [`(constructor)`](op_constructor.md) +- [`operator Pointer*`](op_pointer.md) +- [`operator void**`](op_voidpp.md) + + +## 参照 +- [P1132R8 out_ptr - a scalable output pointer abstraction](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1132r8.html) diff --git a/reference/memory/out_ptr_t/op_pointer.md b/reference/memory/out_ptr_t/op_pointer.md new file mode 100644 index 0000000000..3154decf66 --- /dev/null +++ b/reference/memory/out_ptr_t/op_pointer.md @@ -0,0 +1,44 @@ +# operator Pointer* +* memory[meta header] +* std[meta namespace] +* out_ptr_t[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +operator Pointer*() const noexcept; +``` + +## 概要 +`Pointer`型の[説明用メンバ変数](op_constructor.md)へのポインタを取得する。 + + +## 事前条件 +`*this`の[`operator void**()`](op_voidpp.md)が呼び出されていないこと + + +## 戻り値 +[`addressof`](../addressof.md)`(const_cast(p))` + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`out_ptr()`](../out_ptr.md) + + +## 参照 +- [P1132R8 out_ptr - a scalable output pointer abstraction](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1132r8.html) diff --git a/reference/memory/out_ptr_t/op_voidpp.md b/reference/memory/out_ptr_t/op_voidpp.md new file mode 100644 index 0000000000..c903bd9a32 --- /dev/null +++ b/reference/memory/out_ptr_t/op_voidpp.md @@ -0,0 +1,59 @@ +# operator void** +* memory[meta header] +* std[meta namespace] +* out_ptr_t[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +operator void**() const noexcept; +``` + +## 概要 +`Pointer`型の[説明用メンバ変数](op_constructor.md)へのポインタ値を、`void**`型にキャストして取得する。 + + +## テンプレートパラメータ制約 +[`is_same_v`](/reference/type_traits/is_same.md)``が`false`であること + + +## 適格要件 +[`is_pointer_v`](/reference/type_traits/is_pointer.md)``が`true`であること + + +## 事前条件 +`*this`の[`operator Pointer*()`](op_pointer.md)が呼び出されていないこと + + +## 戻り値 +次のポインタ値`v`を返す : + +- 初期値`*v`は`static_cast(p)`と等価であり、かつ +- `*this`の後続変更に続かない`*v`の変更は、`static_cast(p) == *v`のように、`*this`[デストラクト中](op_destructor.md)の`p`の値に影響を与える。 + + +## 例外 +投げない + + +## 備考 +`*this`の生存期間外での`*v`へのアクセスは未定義動作 + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`out_ptr()`](../out_ptr.md) + + +## 参照 +- [P1132R8 out_ptr - a scalable output pointer abstraction](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1132r8.html) From c6bde8363fb78d19713ad3e9b4cd2e4ceb0d48df Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 23 Jan 2023 13:51:14 +0900 Subject: [PATCH 0074/3948] =?UTF-8?q?=20generator::promise=5Ftype:=20yield?= =?UTF-8?q?=5Fvalue=20=E5=BE=AE=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/generator/generator/promise_type/yield_value.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/generator/generator/promise_type/yield_value.md b/reference/generator/generator/promise_type/yield_value.md index e2fdae00be..4befc49bef 100644 --- a/reference/generator/generator/promise_type/yield_value.md +++ b/reference/generator/generator/promise_type/yield_value.md @@ -84,7 +84,7 @@ return yield_value(ranges::elements_of(nested( ## 例外 -- (1) : 投げない。 +- (1),(3),(4) : 投げない。 - (2) : 格納されるオブジェクトの初期化によって送出された例外。 From 5e25d82045a410286548f4cfb14542e78bec876d Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 23 Jan 2023 13:56:44 +0900 Subject: [PATCH 0075/3948] =?UTF-8?q?generator::promise=5Ftype:=20op=5Fnew?= =?UTF-8?q?=20=E3=82=AA=E3=83=BC=E3=83=90=E3=83=BC=E3=83=AD=E3=83=BC?= =?UTF-8?q?=E3=83=89=E7=95=AA=E5=8F=B7=E4=BB=98=E4=B8=8E=E6=BC=8F=E3=82=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/generator/generator/promise_type/op_new.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/generator/generator/promise_type/op_new.md b/reference/generator/generator/promise_type/op_new.md index e8fe66e717..3764efb606 100644 --- a/reference/generator/generator/promise_type/op_new.md +++ b/reference/generator/generator/promise_type/op_new.md @@ -15,7 +15,7 @@ void* operator new(size_t size, allocator_arg_t, const Alloc& alloc, const Args& template requires same_as || convertible_to -void* operator new(size_t size, const This&, allocator_arg_t, const Alloc& alloc, const Args&...); +void* operator new(size_t size, const This&, allocator_arg_t, const Alloc& alloc, const Args&...); ``` * default_initializable[link /reference/concepts/default_initializable.md] * convertible_to[link /reference/concepts/convertible_to.md] From bc11699bac740b8042fd13a697e6a038deb8f881 Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 23 Jan 2023 14:15:49 +0900 Subject: [PATCH 0076/3948] international-standard: fix N4928 link (close #1115) --- international-standard.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/international-standard.md b/international-standard.md index ef735925a0..01f9a31d04 100644 --- a/international-standard.md +++ b/international-standard.md @@ -12,7 +12,7 @@ C++ の標準規格は、他にも各国の規格化団体によって国際標 | 通称†1 | 名称 | 参照する規格案†2 | 規格案・原案 | `__cplusplus` | |:--|:--|:--|:--|:--| -| [C++23](lang/cpp23.md) (C++2b) | ISO/IEC 14882:2023 (予定) | N4929([PDF](http://open-std.org/jtc1/sc22/wg21/docs/papers/2022/n4928.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/)) | N4928 N4917 N4910 N4901 N4892 N4885 N4878
N4868 N4861 | -- | +| [C++23](lang/cpp23.md) (C++2b) | ISO/IEC 14882:2023 (予定) | N4929([PDF](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4928.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/)) | N4928 N4917 N4910 N4901 N4892 N4885 N4878
N4868 N4861 | -- | | [C++20](lang/cpp20.md) (C++2a) | ISO/IEC 14882:2020 | N4861†3([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/n4861.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4861/)) | N4860 N4849 N4842 N4835 N4830
N4820 N4810 N4800 N4791 N4788†4
N4778 N4762 N4750 N4741 N4727
N4713 N4700 N4687 | `202002L` | | [C++17](lang/cpp17.md) (C++1z) | ISO/IEC 14882:2017 | N4659([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4659.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4659/)) | N4660 N4659 N4640 N4618 N4606
N4594 N4582 N4567 N4527 N4431
N4296 | `201703L` | | [C++14](lang/cpp14.md) (C++1y) | ISO/IEC 14882:2014 | N4140([PDF](https://github.com/cplusplus/draft/blob/master/papers/n4140.pdf?raw=true)/[HTML](https://timsong-cpp.github.io/cppwp/n4140/)) | N4141 N4140 N3937 N3936 N3797
N3691 N3690 N3485 N3376 N3337 | `201402L` | From 410c5724eb943491f7efda14612ede8075ef839d Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 23 Jan 2023 14:35:08 +0900 Subject: [PATCH 0077/3948] =?UTF-8?q?basic=5Fformat=5Fcontext=20:=20out,?= =?UTF-8?q?=20advance=5Fto,=20locale=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/basic_format_context.md | 22 +++++----- .../format/basic_format_context/advance_to.md | 40 +++++++++++++++++++ reference/format/basic_format_context/arg.md | 9 ++--- .../format/basic_format_context/locale.md | 32 +++++++++++++++ reference/format/basic_format_context/out.md | 40 +++++++++++++++++++ 5 files changed, 127 insertions(+), 16 deletions(-) create mode 100644 reference/format/basic_format_context/advance_to.md create mode 100644 reference/format/basic_format_context/locale.md create mode 100644 reference/format/basic_format_context/out.md diff --git a/reference/format/basic_format_context.md b/reference/format/basic_format_context.md index 00c619c43f..17cf7666aa 100644 --- a/reference/format/basic_format_context.md +++ b/reference/format/basic_format_context.md @@ -19,28 +19,28 @@ namespace std { ## 概要 実際に渡されたフォーマット引数を含む、フォーマット実行中の状態を保持するクラス。 -* (1): テンプレートの定義 -* (2): マルチバイト文字列版の特殊化 (出力イテレータの型は未規定) -* (3): ワイド文字列版の特殊化 (出力イテレータの型は未規定) +- (1): テンプレートの定義 +- (2): マルチバイト文字列版の別名 (出力イテレータの型は未規定) +- (3): ワイド文字列版の別名 (出力イテレータの型は未規定) ## テンプレートパラメータ制約 +- `Out`は`OutputIterator`であること -`Out`は`OutputIterator`であること。 ## メンバ関数 -| 名前 | 説明 | 対応バージョン | -|--------------------------------------|--------------------------------------------------|----------------| -| [`arg`](basic_format_context/arg.md) | フォーマット引数を得る | C++20 | -| `out` | 出力イテレータを得る | C++20 | -| `advance_to` | 出力イテレータを指定したイテレータに設定する | C++20 | -| `locale` | ロケールを得る | C++20 | +| 名前 | 説明 | 対応バージョン | +|--------------------------------------|----------------------------------------------|----------------| +| [`arg`](basic_format_context/arg.md) | フォーマット引数を取得する | C++20 | +| [`out`](basic_format_context/out.md) | 出力イテレータを取得する | C++20 | +| [`advance_to`](basic_format_context/advance_to.md) | 出力イテレータを指定したイテレータに設定する | C++20 | +| [`locale`](basic_format_context/locale.md) | ロケールを取得する | C++20 | ## メンバ型 | 名前 | 説明 | 対応バージョン | |------------------|----------------------------------------------------|----------------| -| `iterator` | 出力イテレータ(`Out`と等しい) (type-alias) | C++20 | +| `iterator` | 出力イテレータ(`Out`と等しい) (type-alias) | C++20 | | `char_type` | 文字の型(`charT`と等しい) (type-alias) | C++20 | | `formatter_type` | 型`T`に対応するフォーマッターの型 (alias-template) | C++20 | diff --git a/reference/format/basic_format_context/advance_to.md b/reference/format/basic_format_context/advance_to.md new file mode 100644 index 0000000000..5aff44b4a7 --- /dev/null +++ b/reference/format/basic_format_context/advance_to.md @@ -0,0 +1,40 @@ +# advance_to +* format[meta header] +* function[meta id-type] +* std[meta namespace] +* basic_format_context[meta class] +* cpp20[meta cpp] + +```cpp +void advance_to(iterator it); +``` +* basic_format_arg[link /reference/format/basic_format_arg.md] +* basic_format_context[link /reference/format/basic_format_context.md] + +## 概要 +出力イテレータを指定したイテレータに設定する。 + + +## 効果 +以下と等価: + +```cpp +out_ = std::move(it); +``` +* std::move[link /reference/utility/move.md] + +ここで`out_`は、メンバ変数として保持している出力イテレータである。 + + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13 +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 + +- [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) diff --git a/reference/format/basic_format_context/arg.md b/reference/format/basic_format_context/arg.md index 067b2d4d9e..5787680bb6 100644 --- a/reference/format/basic_format_context/arg.md +++ b/reference/format/basic_format_context/arg.md @@ -1,5 +1,4 @@ # arg - * format[meta header] * function[meta id-type] * std[meta namespace] @@ -7,14 +6,14 @@ * cpp20[meta cpp] ```cpp -basic_format_arg arg(size_t id) const +basic_format_arg arg(size_t id) const; ``` * basic_format_arg[link /reference/format/basic_format_arg.md] * basic_format_context[link /reference/format/basic_format_context.md] ## 概要 -`i`番目のフォーマット引数を得る。`i`が範囲外の場合、`basic_format_arg`のデフォルト値を返す。 +`i`番目のフォーマット引数を取得する。`i`が範囲外の場合、`basic_format_arg`のデフォルト値を返す。 ## バージョン ### 言語 @@ -22,10 +21,10 @@ basic_format_arg arg(size_t id) const ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? +- [GCC](/implementation.md#gcc): 13 - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 -* [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) +- [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) diff --git a/reference/format/basic_format_context/locale.md b/reference/format/basic_format_context/locale.md new file mode 100644 index 0000000000..5990d19ea6 --- /dev/null +++ b/reference/format/basic_format_context/locale.md @@ -0,0 +1,32 @@ +# locale +* format[meta header] +* function[meta id-type] +* std[meta namespace] +* basic_format_context[meta class] +* cpp20[meta cpp] + +```cpp +std::locale locale(); +``` +* std::locale[link /reference/locale/locale.md] + +## 概要 +ロケールを取得する。 + + +## 効果 +文字列フォーマット関数に指定されたロケールオブジェクトがあればそれを返し、そうでなければ[`std::locale()`](/reference/locale/locale.md)を返す。 + + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13 +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 + +- [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) diff --git a/reference/format/basic_format_context/out.md b/reference/format/basic_format_context/out.md new file mode 100644 index 0000000000..4c8569f053 --- /dev/null +++ b/reference/format/basic_format_context/out.md @@ -0,0 +1,40 @@ +# out +* format[meta header] +* function[meta id-type] +* std[meta namespace] +* basic_format_context[meta class] +* cpp20[meta cpp] + +```cpp +iterator out(); +``` +* basic_format_arg[link /reference/format/basic_format_arg.md] +* basic_format_context[link /reference/format/basic_format_context.md] + +## 概要 +出力イテレータを取得する。 + + +## 効果 +以下と等価: + +```cpp +return std::move(out_); +``` +* std::move[link /reference/utility/move.md] + +ここで`out_`は、メンバ変数として保持している出力イテレータである。 + + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13 +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 + +- [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) From 14f1a2ea622be0674ca9d977cb02d08d951ee03d Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Mon, 23 Jan 2023 15:27:47 +0900 Subject: [PATCH 0078/3948] =?UTF-8?q?=20:=20=E8=AA=AC=E6=98=8E?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/version.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/version.md b/reference/version.md index b12a8e1db4..12a24a50d6 100644 --- a/reference/version.md +++ b/reference/version.md @@ -2,7 +2,7 @@ * version[meta header] * cpp20[meta cpp] -``ヘッダでは、実装依存でのC++標準ライブラリのバージョン情報を提供する。定義されるバージョン情報は実装ごとに決められるため、標準ではこのヘッダは空である。 +``ヘッダでは、実装依存でのC++標準ライブラリのバージョン情報を提供する。機能テストマクロ以外のバージョン情報以外に何が定義されるかは実装ごとに決められる。 本ヘッダはフリースタンディング環境でも提供される。 From 549b24e254087fe066ec04c189647a895df995f0 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Mon, 23 Jan 2023 15:30:48 +0900 Subject: [PATCH 0079/3948] =?UTF-8?q?format=20:=20=E8=A1=A8=E3=81=AE?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/format.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/format/format.md b/reference/format/format.md index e0b6d80959..09665bed3e 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -94,9 +94,9 @@ string s3 = format("{} {1}", "a", "b"); // コンパイルエラー #### 文字列型の場合 -| type | 意味 | 対応バージョン | -|:-----------|:-------------|----------------| -| s (省略可) | 文字列 | C++20 | +| type | 意味 |効果 | 対応バージョン | +|:-----------|:-------------|--------------------------------------------------------------------------------------|-------| +| s (省略可) | 文字列 | 文字列をそのまま出力 | C++20 | | ? | デバッグ出力 | 文字・文字列を引用符で囲み、エスケープシーケンスをエスケープして出力 (例:`"\n"`は`"\"\\n\""`となる) | C++23 | #### 文字型 / `bool`型 / 整数型の場合 From 3fd8e81e2945ef1acf4bb9b0cd348214e4ffff61 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Mon, 23 Jan 2023 15:33:36 +0900 Subject: [PATCH 0080/3948] =?UTF-8?q?foramt=20:=20=E3=83=87=E3=83=90?= =?UTF-8?q?=E3=83=83=E3=82=B0=E5=87=BA=E5=8A=9B=E4=BE=8B=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20=E3=83=87=E3=83=90=E3=83=83=E3=82=B0=E5=87=BA?= =?UTF-8?q?=E5=8A=9B=E3=81=AF=E3=80=81=E5=85=A5=E5=8A=9B=E6=96=87=E5=AD=97?= =?UTF-8?q?=E5=88=97=E3=81=A8=E7=AD=89=E4=BE=A1=E3=81=AA=E6=96=87=E5=AD=97?= =?UTF-8?q?=E5=88=97=E3=83=AA=E3=83=86=E3=83=A9=E3=83=AB=E3=82=92=E7=94=9F?= =?UTF-8?q?=E6=88=90=E5=8F=AF=E8=83=BD=E3=81=AA=E6=96=87=E5=AD=97=E5=88=97?= =?UTF-8?q?=E3=82=92=E5=87=BA=E5=8A=9B=E3=81=99=E3=82=8B=E3=81=AE=E3=81=A7?= =?UTF-8?q?=20\n=E3=81=AF=E6=94=B9=E8=A1=8C=E6=96=87=E5=AD=971=E6=96=87?= =?UTF-8?q?=E5=AD=97=E3=81=A8=E3=81=97=E3=81=A6=E3=82=A8=E3=82=B9=E3=82=B1?= =?UTF-8?q?=E3=83=BC=E3=83=97=E3=82=B7=E3=83=BC=E3=82=B1=E3=83=B3=E3=82=B9?= =?UTF-8?q?=E3=81=AB=E7=BD=AE=E6=8F=9B=E3=81=95=E3=82=8C=E3=82=8B=EF=BC=88?= =?UTF-8?q?=E3=81=AF=E3=81=9A=EF=BC=89=EF=BC=88=E6=9C=AA=E7=A2=BA=E8=AA=8D?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/format.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/format/format.md b/reference/format/format.md index 09665bed3e..2a7a42ba95 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -97,7 +97,7 @@ string s3 = format("{} {1}", "a", "b"); // コンパイルエラー | type | 意味 |効果 | 対応バージョン | |:-----------|:-------------|--------------------------------------------------------------------------------------|-------| | s (省略可) | 文字列 | 文字列をそのまま出力 | C++20 | -| ? | デバッグ出力 | 文字・文字列を引用符で囲み、エスケープシーケンスをエスケープして出力 (例:`"\n"`は`"\"\\n\""`となる) | C++23 | +| ? | デバッグ出力 | 文字・文字列を引用符で囲み、エスケープシーケンスをエスケープして出力 (例:`"\n"`は`"\"\n\""`となる) | C++23 | #### 文字型 / `bool`型 / 整数型の場合 From 322f877cba64aafc0fe6e828f93455ddfaa8ecb8 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 23 Jan 2023 16:08:11 +0900 Subject: [PATCH 0081/3948] =?UTF-8?q?formatter=20:=20parse=E3=82=92?= =?UTF-8?q?=E5=AE=9F=E8=A3=85=E3=81=99=E3=82=8B=E4=BE=8B=E3=82=92=E8=A8=98?= =?UTF-8?q?=E8=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/format.md | 2 +- reference/format/formatter.md | 64 ++++++++++++++++++++++++++++++++++- 2 files changed, 64 insertions(+), 2 deletions(-) diff --git a/reference/format/format.md b/reference/format/format.md index 2a7a42ba95..9f8b0498ed 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -277,7 +277,7 @@ _`basic_format_string`_ のコンストラクタは[即時関数](/lang/cpp20/im * 書式文字列は定数式であり、[`string_view`](/reference/string_view/basic_string_view.md)(ワイド文字列版は[`wstring_view`](/reference/string_view/basic_string_view.md))に暗黙変換できること。 * 書式文字列にエラーがないこと。例えば、 * 閉じていないカッコなどの構文エラーがないこと。 - * 実際に渡している引数の型が書式文字列中の置換フィールドが要求する型に合うこと。 + * 実際に渡している引数の型が、書式文字列中の置換フィールドに要求される型と合うこと。 ## 効果 diff --git a/reference/format/formatter.md b/reference/format/formatter.md index 329f90fc85..f815402b90 100644 --- a/reference/format/formatter.md +++ b/reference/format/formatter.md @@ -131,6 +131,7 @@ namespace std { ## 例 +### オリジナル書式なし、型変換のみの場合 ```cpp example #include #include @@ -151,12 +152,73 @@ int main() std::cout << std::format("{}", red) << std::endl; } ``` +* std::format_context[link basic_format_context.md] -### 出力 +#### 出力 ``` red ``` +### オリジナル書式を定義する例 +```cpp example +#include +#include + +enum color { red, green, blue }; + +const char* color_names[] = { "red", "green", "blue" }; +const char* jp_color_names[] = { "赤", "緑", "青" }; + +template<> +struct std::formatter { + bool is_jp = false; + + // コンパイル時の書式文字列の解析があるため、 + // constexprにする必要がある。 + // この関数に渡されるパラメータは、{:%j}の%以降。 + // 解析がおわった場所を指すイテレータを返す。 + constexpr auto parse(std::format_parse_context& ctx) { + auto it = ctx.begin(); + if (*it == '%') { + ++it; + if (*it == 'j') { + is_jp = true; + } + else if (*it == 'e') { + is_jp = false; + } + ++it; + } + return it; + } + + // format()関数は書式の情報をもたない。 + // parse()関数で解析した書式をメンバ変数で保持しておいて、 + // それをもとに書式化する + auto format(color c, std::format_context& ctx) const { + return std::format_to(ctx.out(), "{}", + is_jp ? jp_color_names[c] : color_names[c] + ); + } +}; + +int main() +{ + std::cout << std::format("{:%j} {:%e}", red, blue) << std::endl; +} +``` +* std::format_parse_context[link basic_format_parse_context.md] +* ctx.begin()[link basic_format_parse_context/begin.md.nolink] +* std::format_context[link basic_format_context.md] +* ctx.out()[link basic_format_context/out.md] +* std::format_to[link format_to.md] + + +#### 出力 +``` +赤 blue +``` + ## バージョン ### 言語 - C++20 From ccd76f630e9cb46d570698a709ff442b58f98c78 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 23 Jan 2023 16:16:44 +0900 Subject: [PATCH 0082/3948] =?UTF-8?q?formatter::parse=20:=20=E6=88=BB?= =?UTF-8?q?=E3=82=8A=E5=80=A4=E3=81=AF=E7=B5=82=E7=AB=AF=E3=81=A7=E3=81=AF?= =?UTF-8?q?=E3=81=AA=E3=81=8F=E3=80=81=E8=A7=A3=E6=9E=90=E3=81=8C=E3=81=8A?= =?UTF-8?q?=E3=82=8F=E3=81=A3=E3=81=9F=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/formatter/parse.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/format/formatter/parse.md b/reference/format/formatter/parse.md index 65441609eb..789c2f6725 100644 --- a/reference/format/formatter/parse.md +++ b/reference/format/formatter/parse.md @@ -26,7 +26,7 @@ constexpr typename ParseContext::iterator ## 戻り値 -解析がおわった書式文字列の終端を指すイテレータを返す。 +`ctx`のうち、解析がおわった位置を指すイテレータを返す。 ## 備考 From a7b1a5ea1f52af47efb9e60956446b86688271e5 Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 23 Jan 2023 17:34:13 +0900 Subject: [PATCH 0083/3948] =?UTF-8?q?memory:=20P1132R8=20inout=5Fptr=5Ft,i?= =?UTF-8?q?nout=5Fptr=E8=BF=BD=E5=8A=A0(#1050)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23.md | 2 +- reference/memory.md | 4 +- reference/memory/inout_ptr.md | 83 ++++++++++++++++++ reference/memory/inout_ptr_t.md | 56 ++++++++++++ .../memory/inout_ptr_t/op_constructor.md | 52 +++++++++++ reference/memory/inout_ptr_t/op_destructor.md | 87 +++++++++++++++++++ reference/memory/inout_ptr_t/op_pointer.md | 44 ++++++++++ reference/memory/inout_ptr_t/op_voidpp.md | 59 +++++++++++++ reference/memory/out_ptr_t/op_constructor.md | 6 +- reference/memory/out_ptr_t/op_destructor.md | 2 +- 10 files changed, 388 insertions(+), 7 deletions(-) create mode 100644 reference/memory/inout_ptr.md create mode 100644 reference/memory/inout_ptr_t.md create mode 100644 reference/memory/inout_ptr_t/op_constructor.md create mode 100644 reference/memory/inout_ptr_t/op_destructor.md create mode 100644 reference/memory/inout_ptr_t/op_pointer.md create mode 100644 reference/memory/inout_ptr_t/op_voidpp.md diff --git a/lang/cpp23.md b/lang/cpp23.md index 0ad5123c1e..48d4410f46 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -193,7 +193,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 ### メモリ -- [``](/reference/memory.md)に、レガシーC関数からスマートポインタへの直接出力をサポートする、スマートポインタアダプタ[`std::out_ptr`](/reference/memory/out_ptr.md)と[`std::inout_ptr`](/reference/memory/inout_ptr.md.nolink)を追加 +- [``](/reference/memory.md)に、レガシーC関数からスマートポインタへの直接出力をサポートする、スマートポインタアダプタ[`std::out_ptr`](/reference/memory/out_ptr.md)と[`std::inout_ptr`](/reference/memory/inout_ptr.md)を追加 - [`std::unique_ptr`](/reference/memory/unique_ptr.md)クラスを`constexpr`に対応 - [``](/reference/memory.md)に、オブジェクトの生存期間を開始することを明示する関数として、[`std::start_lifetime_as()`](/reference/memory/start_lifetime_as.md.nolink)と[`std::start_lifetime_as_array()`](/reference/memory/start_lifetime_as_array.md.nolink)を追加 - [``](/reference/bit.md)に、値のバイト入れ替え (エンディアン変換) を行う[`std::byteswap()`](/reference/bit/byteswap.md)関数を追加 diff --git a/reference/memory.md b/reference/memory.md index 8bd2bd4f0b..557152dbd9 100644 --- a/reference/memory.md +++ b/reference/memory.md @@ -96,8 +96,8 @@ |------|------|-------| | [`out_ptr_t`](memory/out_ptr_t.md) | スマートポインタへの出力サポート(class template) | C++23 | | [`out_ptr`](memory/out_ptr.md) | スマートポインタへの出力サポートヘルパ関数(function template) | C++23 | -| [`inout_ptr_t`](memory/inout_ptr_t.md.nolink) | スマートポインタへの入出力サポート(class template) | C++23 | -| [`inout_ptr`](memory/inout_ptr.md.nolink) | スマートポインタへの入出力サポートヘルパ関数(function template) | C++23 | +| [`inout_ptr_t`](memory/inout_ptr_t.md) | スマートポインタへの入出力サポート(class template) | C++23 | +| [`inout_ptr`](memory/inout_ptr.md) | スマートポインタへの入出力サポートヘルパ関数(function template) | C++23 | ## スマートポインタのアトミック操作 diff --git a/reference/memory/inout_ptr.md b/reference/memory/inout_ptr.md new file mode 100644 index 0000000000..21bce258d5 --- /dev/null +++ b/reference/memory/inout_ptr.md @@ -0,0 +1,83 @@ +# inout_ptr +* memory[meta header] +* function template[meta id-type] +* std[meta namespace] +* cpp23[meta cpp] + +```cpp +namespace std { + template + auto inout_ptr(Smart& s, Args&&... args); +} +``` + +## 概要 +2重ポインタ`T**`引数経由で既存リソースを解放してから新規確保リソースへのポインタを返すレガシーC関数に対して、出力されたポインタ値をスマートポインタ`s`に格納するアダプタ[`inout_ptr_t`](inout_ptr_t.md)を返すヘルパ関数。 + +リソース占有管理セマンティクスを提供するC++標準スマートポインタ[`std::unique_ptr`](unique_ptr.md)を始め、互換インタフェースをもつ任意のスマートポインタ型`Smart`を取り扱える。 + +説明用の`P`型を次のように定義する : + +- [`is_void_v`](/reference/type_traits/is_void.md)``が`false`ならば`Pointer` +- そうでなければ、`Smart::pointer`が有効な型名であれば`Smart::pointer` +- そうでなければ、`Smart::element_type*`が有効な型名であれば`Smart::element_type*` +- そうでなければ、[`pointer_traits`](pointer_traits.md)`::element_type*` + + +## 戻り値 +[`inout_ptr_t`](inout_ptr_t.md)`(s,` [`std::forward`](/reference/utility/forward.md)`(args)...)` + + +## 備考 +スマートポインタアダプタ`inout_ptr`は、リソース共有管理セマンティクスを提供する[`std::shared_ptr`](shared_ptr.md)をサポートしない。 +これは、共有管理されている既存リソースの所有権を放棄させるインタフェース(`release`)を提供しないためである。 + + +## 例 +### P1132R8引用 +```cpp example +// Legacy C APIs +error_num c_api_re_create_handle(int seed_value, int** p_handle); +void c_api_delete_handle(int* handle); + +// C++ program +#include + +struct resource_deleter { + void operator()(int* handle) { + c_api_delete_handle(handle); + } +}; + +int main() { + std::unique_ptr resource(nullptr); + error_num err = c_api_re_create_handle( + 24, std::inout_ptr(resource) + ); + if (err == C_API_ERROR_CONDITION) { + // handle errors + } + // resource.get() the out-value from the C API function +} +``` +* std::inout_ptr[color ff0000] + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`inout_ptr_t`](inout_ptr_t.md) +- [`unique_ptr`](unique_ptr.md) + + +## 参照 +- [P1132R8 out_ptr - a scalable output pointer abstraction](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1132r8.html) diff --git a/reference/memory/inout_ptr_t.md b/reference/memory/inout_ptr_t.md new file mode 100644 index 0000000000..4dffa9e67d --- /dev/null +++ b/reference/memory/inout_ptr_t.md @@ -0,0 +1,56 @@ +# inout_ptr_t +* memory[meta header] +* class template[meta id-type] +* std[meta namespace] +* cpp23[meta cpp] + +```cpp +namespace std { + template + class inout_ptr_t; +} +``` + +## 概要 +2重ポインタ`T**`(=`Pointer*`)引数経由で既存リソースを解放してから新規確保リソースへのポインタを返すレガシーC関数に対して、取得されたポインタ値をスマートポインタに格納するアダプタクラス。 +アダプタオブジェクトの生成には、[`std::inout_ptr()`](inout_ptr.md)ヘルパ関数を利用する。 + +C++標準スマートポインタ[`std::unique_ptr`](unique_ptr.md)を始め、互換インタフェースをもつ任意のスマートポインタ型`Smart`を取り扱える。 + + +## テンプレートパラメータ制約 +`Pointer`はCpp17NullablePointer要件を満たすこと + + +## 適格要件 +`Smart`が[`shared_ptr`](shared_ptr.md)の特殊化の場合、プログラムは不適格となる。 + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|-----------------|----------------|----------------| +| [`(constructor)`](inout_ptr_t/op_constructor.md) | コンストラクタ | C++23 | +| [`(destructor)`](inout_ptr_t/op_destructor.md) | デストラクタ | C++23 | +| [`operator Pointer*()`](inout_ptr_t/op_pointer.md) | `Pointer*`への暗黙変換 | C++23 | +| [`operator void**()`](inout_ptr_t/op_voidpp.md) | `void**`への暗黙変換 | C++23 | + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`inout_ptr()`](inout_ptr.md) +- [`unique_ptr`](unique_ptr.md) + + +## 参照 +- [P1132R8 out_ptr - a scalable output pointer abstraction](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1132r8.html) diff --git a/reference/memory/inout_ptr_t/op_constructor.md b/reference/memory/inout_ptr_t/op_constructor.md new file mode 100644 index 0000000000..63978cd94c --- /dev/null +++ b/reference/memory/inout_ptr_t/op_constructor.md @@ -0,0 +1,52 @@ +# コンストラクタ +* memory[meta header] +* std[meta namespace] +* inout_ptr_t[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +explicit inout_ptr_t(Smart& smart, Args... args); // (1) +inout_ptr_t(const inout_ptr_t&) = delete; // (2) +``` + +## 概要 +- (1) : `inout_ptr_t`オブジェクトの構築。 +- (2) : コピーコンストラクタ。コピー不可。 + + +## 効果 +(1) : `inout_ptr_t`クラスの説明用メンバ変数`s`, `a`, `p`を下記の通り初期化する。 + +- `Smart&`型メンバ変数`s` : `smart` +- `tuple`型メンバ変数`a` : [`std::forward`](/reference/utility/forward.md)`(args)...` +- `Pointer`型メンバ`p` : + - [`is_pointer_v`](/reference/type_traits/is_pointer.md)``が`true`ならば、`smart` + - そうでなければ、`smart.get()` + + +## 備考 +実装によっては`s.release()`を呼び出すかもしれない。 +コンストラクタで`release`メンバ関数を呼び出さない場合は、[デストラクタ](op_destructor.md)にて呼び出される。 + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`inout_ptr()`](../inout_ptr.md) +- [`(destructor)`](op_destructor.md) +- [`operator Pointer*`](op_pointer.md) +- [`operator void**`](op_voidpp.md) + + +## 参照 +- [P1132R8 out_ptr - a scalable output pointer abstraction](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1132r8.html) diff --git a/reference/memory/inout_ptr_t/op_destructor.md b/reference/memory/inout_ptr_t/op_destructor.md new file mode 100644 index 0000000000..80c1d2c3d4 --- /dev/null +++ b/reference/memory/inout_ptr_t/op_destructor.md @@ -0,0 +1,87 @@ +# デストラクタ +* memory[meta header] +* std[meta namespace] +* inout_ptr_t[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +~inout_ptr_t(); +``` + +## 概要 +指定した`Smart`型スマートポインタが管理するリソースを解放し、レガシーC関数呼び出しにより取得されたポインタ値を格納する。 + +スマートポインタのリソース解放には、`Smart::release()`メンバ関数が利用される。 +スマートポインタへのポインタ値格納には、`Smart::reset()`メンバ関数、もしくは`Smart`オブジェクト構築+ムーブ代入`operator=`が利用される。 + + +## 効果 +説明用の`SP`型を下記の通り定義する : + +- `Smart::pointer`が有効な型名であれば`Smart::pointer` +- そうでなければ、`Smart::element_type*`が有効な型名であれば`Smart::element_type*` +- そうでなければ、[`pointer_traits`](../pointer_traits.md)`::element_type*` +- そうでなければ、`Pointer` + +説明用の文`release-statement`を下記の通り定義する : + +- [コンストラクタ](op_constructor.md)で`s.release()`を呼び出さない実装であれば、`s.release()` +- そうでなければ、空文 + +[説明用メンバ変数](op_constructor.md)`s`, `a`, `p`を用いて、以下と同じ効果を持つ : + +- [`is_pointer_v`](/reference/type_traits/is_pointer.md)``が`true`ならば、 + + ```cpp + if (p) { + apply([&](auto&&... args) { + s = Smart(static_cast(p), std::forward(args)...); }, std::move(a)); + } + ``` + +- 式 `s.reset(static_cast(p),` [`std::forward`](/reference/utility/forward.md)`(args)...)` が適格ならば、 + + ```cpp + if (p) { + apply([&](auto&&... args) { + release-statement; + s.reset(static_cast(p), std::forward(args)...); }, std::move(a)); + } + ``` + * apply[link /reference/tuple/apply.md] + +- [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true`ならば、 + + ```cpp + if (p) { + apply([&](auto&&... args) { + release-statement; + s = Smart(static_cast(p), std::forward(args)...); }, std::move(a)); + } + ``` + * apply[link /reference/tuple/apply.md] + +- そうでなければ、プログラムは不適格となる。 + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`inout_ptr_t()`](../inout_ptr_t.md) +- [`(constructor)`](op_constructor.md) +- [`operator Pointer*`](op_pointer.md) +- [`operator void**`](op_voidpp.md) + + +## 参照 +- [P1132R8 out_ptr - a scalable output pointer abstraction](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1132r8.html) diff --git a/reference/memory/inout_ptr_t/op_pointer.md b/reference/memory/inout_ptr_t/op_pointer.md new file mode 100644 index 0000000000..f6ab1c1a48 --- /dev/null +++ b/reference/memory/inout_ptr_t/op_pointer.md @@ -0,0 +1,44 @@ +# operator Pointer* +* memory[meta header] +* std[meta namespace] +* inout_ptr_t[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +operator Pointer*() const noexcept; +``` + +## 概要 +`Pointer`型の[説明用メンバ変数](op_constructor.md)へのポインタを取得する。 + + +## 事前条件 +`*this`の[`operator void**()`](op_voidpp.md)が呼び出されていないこと + + +## 戻り値 +[`addressof`](../addressof.md)`(const_cast(p))` + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`inout_ptr()`](../inout_ptr.md) + + +## 参照 +- [P1132R8 out_ptr - a scalable output pointer abstraction](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1132r8.html) diff --git a/reference/memory/inout_ptr_t/op_voidpp.md b/reference/memory/inout_ptr_t/op_voidpp.md new file mode 100644 index 0000000000..cd8efc5efb --- /dev/null +++ b/reference/memory/inout_ptr_t/op_voidpp.md @@ -0,0 +1,59 @@ +# operator void** +* memory[meta header] +* std[meta namespace] +* inout_ptr_t[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +operator void**() const noexcept; +``` + +## 概要 +`Pointer`型の[説明用メンバ変数](op_constructor.md)へのポインタ値を、`void**`型にキャストして取得する。 + + +## テンプレートパラメータ制約 +[`is_same_v`](/reference/type_traits/is_same.md)``が`false`であること + + +## 適格要件 +[`is_pointer_v`](/reference/type_traits/is_pointer.md)``が`true`であること + + +## 事前条件 +`*this`の[`operator Pointer*()`](op_pointer.md)が呼び出されていないこと + + +## 戻り値 +次のポインタ値`v`を返す : + +- 初期値`*v`は`static_cast(p)`と等価であり、かつ +- `*this`の後続変更に続かない`*v`の変更は、`static_cast(p) == *v`のように、`*this`[デストラクト中](op_destructor.md)の`p`の値に影響を与える。 + + +## 例外 +投げない + + +## 備考 +`*this`の生存期間外での`*v`へのアクセスは未定義動作 + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`inout_ptr()`](../inout_ptr.md) + + +## 参照 +- [P1132R8 out_ptr - a scalable output pointer abstraction](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1132r8.html) diff --git a/reference/memory/out_ptr_t/op_constructor.md b/reference/memory/out_ptr_t/op_constructor.md index d73d0961e8..76c09cfa7c 100644 --- a/reference/memory/out_ptr_t/op_constructor.md +++ b/reference/memory/out_ptr_t/op_constructor.md @@ -18,9 +18,9 @@ out_ptr_t(const out_ptr_t&) = delete; // (2) ## 効果 (1) : `out_ptr_t`クラスの説明用メンバ変数`s`, `a`, `p`を下記の通り初期化する。 -- `Smart&`型メンバ変数 : `s = smart;` -- `tuple`型メンバ変数 : `a =` [`std::forward`](/reference/utility/forward.md)`(args)...;` -- `Pointer`型メンバ : `p = {};` +- `Smart&`型メンバ変数`s` : `smart` +- `tuple`型メンバ変数`a` : [`std::forward`](/reference/utility/forward.md)`(args)...` +- `Pointer`型メンバ`p` : `{}`(値初期化) ## バージョン diff --git a/reference/memory/out_ptr_t/op_destructor.md b/reference/memory/out_ptr_t/op_destructor.md index 22946ceb0b..ff1fae12d0 100644 --- a/reference/memory/out_ptr_t/op_destructor.md +++ b/reference/memory/out_ptr_t/op_destructor.md @@ -14,7 +14,7 @@ スマートポインタへのポインタ値格納には、`Smart::reset()`メンバ関数、もしくは`Smart`オブジェクト構築+ムーブ代入`operator=`が利用される。 -- オブジェクト単位でカスタムデリータを管理する[`std::shared_ptr`](../shared_ptr.md)の場合、[`out_ptr_t`コンストラクタ](op_constructor.md)にてデリータオブジェクトを渡しておくことで、[`reset()`](../shared_ptr/reset.md)呼び出しの追加引数リストとして渡される。 +- オブジェクト単位でカスタムデリータを管理する[`std::shared_ptr`](../shared_ptr.md)の場合、[`out_ptr_t`コンストラクタ](op_constructor.md)にてデリータオブジェクトを渡しておくことで、[`reset()`](../shared_ptr/reset.md)呼び出しの取得ポインタ値に続く引数として渡される。 この動作は[`out_ptr_t`](../out_ptr_t.md)クラステンプレートの適格要件にて強制される。 - 型レベルでカスタムデリータを管理する[`std::unique_ptr`](../unique_ptr.md)の場合、[`reset()`](../unique_ptr/reset.md)呼び出しには取得ポインタ値のみが渡される。 - これ以外のスマートポインタ型では、同スマートポインタの動作セマンティクスに従う。 From 7389f02b53b3f36cb3a47e4caeb7da71239dd22d Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 23 Jan 2023 20:06:57 +0900 Subject: [PATCH 0084/3948] =?UTF-8?q?functional:=20P0288R9=20move=5Fonly?= =?UTF-8?q?=5Ffunction=E8=BF=BD=E5=8A=A0(#1056)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 既存std::functionをベースとして各ページを作成。 --- lang/cpp23.md | 2 +- reference/functional/function.md | 5 + reference/functional/move_only_function.md | 99 +++++++++ .../move_only_function/op_assign.md | 69 +++++++ .../functional/move_only_function/op_bool.md | 58 ++++++ .../functional/move_only_function/op_call.md | 67 +++++++ .../move_only_function/op_constructor.md | 188 ++++++++++++++++++ .../move_only_function/op_destructor.md | 36 ++++ .../functional/move_only_function/op_equal.md | 66 ++++++ .../move_only_function/op_not_equal.md | 66 ++++++ .../functional/move_only_function/swap.md | 72 +++++++ .../move_only_function/swap_free.md | 67 +++++++ 12 files changed, 794 insertions(+), 1 deletion(-) create mode 100644 reference/functional/move_only_function.md create mode 100644 reference/functional/move_only_function/op_assign.md create mode 100644 reference/functional/move_only_function/op_bool.md create mode 100644 reference/functional/move_only_function/op_call.md create mode 100644 reference/functional/move_only_function/op_constructor.md create mode 100644 reference/functional/move_only_function/op_destructor.md create mode 100644 reference/functional/move_only_function/op_equal.md create mode 100644 reference/functional/move_only_function/op_not_equal.md create mode 100644 reference/functional/move_only_function/swap.md create mode 100644 reference/functional/move_only_function/swap_free.md diff --git a/lang/cpp23.md b/lang/cpp23.md index 48d4410f46..2263b8a0a8 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -188,7 +188,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 ### 関数オブジェクト - [`std::invoke()`](/reference/functional/invoke.md)の戻り値型を指定するバージョンである[`std::invoke_r()`](/reference/functional/invoke_r.md)を追加 -- ムーブのみ可能な[`std::function`](/reference/functional/function.md)クラスと等価な機能をもつ[`std::move_only_function`](/reference/functional/move_only_function.md.nolink)クラスを追加 +- [`std::function`](/reference/functional/function.md)クラスと等価な機能をもつ、ムーブのみ可能な[`std::move_only_function`](/reference/functional/move_only_function.md)クラスを追加 - ユーザー定義のRangeアダプタがパイプライン演算子 `|` をサポートしやすくするために、末尾から引数を束縛する[`std::bind_back()`](/reference/functional/bind_back.md.nolink)関数を追加 diff --git a/reference/functional/function.md b/reference/functional/function.md index 9e39efb429..27f8027020 100644 --- a/reference/functional/function.md +++ b/reference/functional/function.md @@ -113,6 +113,11 @@ int main() ### 言語 - C++11 + +## 関連項目 +- [`move_only_function`](move_only_function.md) + + ## 参照 - [P0302R1 Removing Allocator Support in `std::function` (rev 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0302r1.html) - [P0005R4 Adopt `not_fn` from Library Fundamentals 2 for C++17](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0005r4.html) diff --git a/reference/functional/move_only_function.md b/reference/functional/move_only_function.md new file mode 100644 index 0000000000..ebd0db2017 --- /dev/null +++ b/reference/functional/move_only_function.md @@ -0,0 +1,99 @@ +# move_only_function +* functional[meta header] +* class template[meta id-type] +* std[meta namespace] +* cpp23[meta cpp] + +```cpp +namespace std { + template class move_only_function; // 宣言のみ + + template + class move_only_function; +} +``` + +## 概要 +`move_only_function`クラステンプレートは、パラメータの型リスト`ArgTypes...`、戻り値の型`R`に合致する、あらゆる関数ポインタ、関数オブジェクト、メンバ関数ポインタ、メンバ変数ポインタを保持できるクラスである。 + +下記全ての組み合わせ(12種類)についてクラステンプレートの部分特殊化が提供される。 + +- CV修飾子 *cv* : `const`, CV修飾無し +- 参照修飾子 *ref* : `&`, `&&`, 参照修飾無し +- noexcept例外指定 *noex* : `true`, `false` + + +## メンバ関数 +### 構築・破棄 + +| 名前 | 説明 | 対応バージョン | +|-----------------|----------------|----------------| +| [`(constructor)`](move_only_function/op_constructor.md) | コンストラクタ | C++23 | +| [`(destructor)`](move_only_function/op_destructor.md) | デストラクタ | C++23 | +| [`operator=`](move_only_function/op_assign.md) | 代入演算子 | C++23 | +| [`swap`](move_only_function/swap.md) | 他の`move_only_function`オブジェクトと中身を入れ替える | C++23 | +| [`operator bool`](move_only_function/op_bool.md) | 関数呼び出しが可能か調べる | C++23 | +| [`operator()`](move_only_function/op_call.md) | 関数呼び出し | C++23 | + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|-----------------|----------------|----------------| +| `result_type` | 関数の戻り値の型(テンプレートパラメータ`R`) | C++23 | + +## 非メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|-----------------|----------------|----------------| +| [`operator==`](move_only_function/op_equal.md) | 等値比較 | C++23 | +| [`operator!=`](move_only_function/op_not_equal.md) | 非等値比較 | C++23 | +| [`swap`](move_only_function/swap_free.md) | 2つの`move_only_function`オブジェクトを入れ替える | C++23 | + + +## 例 +```cpp example +#include +#include + +int add(int x) { return x + 1; } + +int main() +{ + // 関数を代入 + std::move_only_function f = add; + + // 関数オブジェクトを代入 + f = [](int x) { return x + 1; }; + + // 保持している関数を呼び出す + int result = f(1); + std::cout << result << std::endl; +} +``` +* std::move_only_function[color ff0000] +* f(1)[link move_only_function/op_call.md] + +### 出力 +``` +1 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`function`](function.md) + + +## 参照 +- [P0288R9 move_only_function](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0288r9.html) diff --git a/reference/functional/move_only_function/op_assign.md b/reference/functional/move_only_function/op_assign.md new file mode 100644 index 0000000000..2990e70d90 --- /dev/null +++ b/reference/functional/move_only_function/op_assign.md @@ -0,0 +1,69 @@ +# operator= +* functional[meta header] +* std[meta namespace] +* move_only_function[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +move_only_function& operator=(move_only_function&& f); // (1) + +move_only_function& operator=(nullptr_t); noexcept; // (2) + +template +move_only_function& operator=(F&& f); // (3) +``` + +## 効果 +- (1) : ムーブ代入。[`move_only_function`](op_constructor.md)`(`[`std::move`](/reference/utility/move.md)`(f)).`[`swap`](swap.md)`(*this)` +- (2) : `*this`が有効な関数ポインタ、メンバポインタ、もしくは関数オブジェクトを持っている場合、それを解放する。 +- (3) : [`move_only_function`](op_constructor.md)`(`[`std::forward`](/reference/utility/forward.md)`(f)).`[`swap`](swap.md)`(*this)` + + +## 戻り値 +`*this` + + +## 例外 +- (2) : 投げない + + +## 例 +```cpp example +#include +#include + +int ident(int x) { return x; } + +int main() +{ + std::move_only_function f; + + // 関数を代入 + f = ident; + + int result = f(1); + std::cout << result << std::endl; +} +``` +* f(1)[link op_call.md] + +### 出力 +``` +1 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0288R9 move_only_function](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0288r9.html) diff --git a/reference/functional/move_only_function/op_bool.md b/reference/functional/move_only_function/op_bool.md new file mode 100644 index 0000000000..c6cfaad762 --- /dev/null +++ b/reference/functional/move_only_function/op_bool.md @@ -0,0 +1,58 @@ +# operator bool +* functional[meta header] +* std[meta namespace] +* move_only_function[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +explicit operator bool() const noexcept; +``` + +## 概要 +関数呼び出しが可能か調べる。 + + +## 戻り値 +呼び出す関数を持っていれば`true`、そうでなければ`false`を返す。 + + +## 例 +```cpp example +#include +#include + +int ident(int x) { return x; } + +int main() +{ + std::move_only_function f = ident; + + if (f) { + std::cout << "not empty" << std::endl; + } + else { + std::cout << "empty" << std::endl; + } +} +``` + +### 出力 +``` +not empty +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0288R9 move_only_function](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0288r9.html) diff --git a/reference/functional/move_only_function/op_call.md b/reference/functional/move_only_function/op_call.md new file mode 100644 index 0000000000..e72ca00699 --- /dev/null +++ b/reference/functional/move_only_function/op_call.md @@ -0,0 +1,67 @@ +# operator() +* functional[meta header] +* std[meta namespace] +* move_only_function[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +R operator()(ArgTypes... args) /*cv*/ /*ref*/ noexcept(/*noex*/); +``` + +## 概要 +関数を呼び出す。 + +CV修飾子 *cv*, 参照修飾子 *ref*, noexcept例外指定 *noex* は[`move_only_function`](../move_only_function.md)に指定するテンプレートパラメータ`R(ArgTypes...)`部と等しい。 + + +## 事前条件 +`*this`は関数ポインタまたは関数オブジェクトを保持していること。 + + +## 効果 +`*this`が保持している`F`型の関数ポインタまたは関数オブジェクト`f`に対して、[`INVOKE`](/reference/concepts/Invoke.md)`(static_cast(f),` [`std::forward`](/reference/utility/forward.md)`(args)...)`を行う。 + + +## 戻り値 +`R`型が`void`の場合は何も返さない。そうでなければ、関数呼び出しの戻り値を返す。 + + +## 例 +```cpp example +#include +#include + +int ident(int x) +{ return x; } + +int main() +{ + std::move_only_function f = ident; + + // 関数呼び出し : 保持しているident()関数を呼び出す + int result = f(1); + + std::cout << result << std::endl; +} +``` + +### 出力 +``` +1 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0288R9 move_only_function](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0288r9.html) diff --git a/reference/functional/move_only_function/op_constructor.md b/reference/functional/move_only_function/op_constructor.md new file mode 100644 index 0000000000..5a13d4bcdd --- /dev/null +++ b/reference/functional/move_only_function/op_constructor.md @@ -0,0 +1,188 @@ +# コンストラクタ +* functional[meta header] +* std[meta namespace] +* move_only_function[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +move_only_function() noexcept; // (1) +move_only_function(nullptr_t) noexcept; // (2) +move_only_function(move_only_function&&) noexcept; // (3) + +template move_only_function(F&&); // (4) + +template +explicit move_only_function(in_place_type_t, Args&&...); // (5) + +template +explicit move_only_function(in_place_type_t, initializer_list, Args&&...); // (6) +``` +* in_place_type_t[link /reference/utility/in_place_type_t.md] + +## 概要 +`move_only_function`オブジェクトを構築する。 + + +`move_only_function`クラステンプレートパラメータのnoexcept例外指定 *noex* 特殊化に応じて、説明用の`bool`型テンプレート定数`is-callable-from`を下記のように定義する : +- *noex* が`true`のとき : [`is_nothrow_invocable_r_v`](/reference/type_traits/is_nothrow_invocable_r.md)` &&` [`is_nothrow_invocable_r_v`](/reference/type_traits/is_nothrow_invocable_r.md)`` +- *noex* が`false`のとき : [`is_invocable_r_v`](/reference/type_traits/is_invocable_r.md)` &&` [`is_invocable_r_v`](/reference/type_traits/is_invocable_r.md)`` + + +## テンプレートパラメータ制約 +- (4) : `VT`型を`decay_t`としたとき + - `remove_cvref_t`が`move_only_function`と同一型ではなく、かつ + - `remove_cvref_t`が`in_place_type_t`の特殊化ではなく、かつ + - `is-callable-from`が`true`であること +- (5) : `VT`型を`decay_t`としたとき + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true`であり、かつ + - `is-callable-from`が`true`であること +- (6) : `VT`型を`decay_t`としたとき + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)`&, Args...>`が`true`であり、かつ + - `is-callable-from`が`true`であること + + +## 適格要件 +- (4) : `VT`型を`decay_t`としたとき、[`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true`であること。 +- (5), (6) : `decay_t`が`T`と同一型であること。 + + +## 事前条件 +- (4) : `VT`型を`decay_t`としたとき + - `VT`がCpp17Destructible要件を満たすこと。 + - [`is_move_construtible_v`](/reference/type_traits/is_move_constructible.md)``が`true`の場合、`VT`がCpp17MoveConstructible要件を満たすこと。 +- (5), (6) : `VT`型を`decay_t`としたとき + - `VT`がCpp17Destructible要件を満たすこと。 + - [`is_move_construtible_v`](/reference/type_traits/is_move_constructible.md)``が`true`の場合、`VT`がCpp17MoveConstructible要件を満たすこと。 + + +## 効果 +- (1), (2) : 関数を持たない空の`move_only_function`オブジェクトを構築する。この方法で構築した後、[`operator bool`](op_bool.md)は`false`を返す。 +- (3) : `f`が保持する状態を`*this`に移動する。移動された後の`f`は、未規定な値を持つ有効な状態となる。 +- (4) : `*this`の格納オブジェクトを + - `f`が関数ポインタ型、メンバ関数ポインタ型、メンバ変数ポインタ型いずれかのヌルポインタ値の場合、値を保持しない。 + - `remove_cvref_t`が`move_only_function`の特殊化であり、かつ値を保持していない場合、値を保持しない。 + - そうでなければ、`*this`が保持する`VT`型の格納オブジェクトを、`std::forward(f)`で直接非リスト初期化する。 +- (5) : `*this`が保持する`VT`型の格納オブジェクトを、`std::forward(args)...`で直接非リスト初期化する。 +- (6) : `*this`が保持する`VT`型の格納オブジェクトを、`ilist, std::forward(args)...`で直接非リスト初期化する。 + + +## 例外 +- (1), (2), (3) : 投げない +- (4), (5), (6) : 格納オブジェクトの初期化から例外が投げられる可能性がある。`VT`が関数ポインタまたは[`reference_wrapper`](/reference/functional/reference_wrapper.md)の特殊化いずれでもなければ、`bad_alloc`例外が投げられる可能性がある。 + + +## 例 +```cpp example +#include +#include +#include + +struct ident_functor { + int operator()(int x) const + { return x; } +}; + +int ident_func(int x) +{ return x; } + +struct X { + int value; + X() : value(3) {} + + int ident_member_func(int x) const + { return x; } +}; + +int main() +{ + // (1) + // デフォルトコンストラクタ + // 空のmove_only_functionオブジェクトを作る + { + std::move_only_function f; + assert(!f); + } + + // (2) + // ヌルポインタを受け取るコンストラクタ + // デフォルトコンストラクタと同様、空のmove_only_functionオブジェクトを作る + { + std::move_only_function f = nullptr; + assert(!f); + } + + // (3) + // ムーブ構築 + { + std::move_only_function f = ident_functor(); + std::move_only_function g = std::move(f); + + int result = g(1); + std::cout << "(3) : " << result << std::endl; + } + + // (4) + // 関数ポインタを受け取って構築 + { + std::function f = ident_func; + + int result = f(1); + std::cout << "(4) function pointer : " << result << std::endl; + } + + // (4) + // 関数オブジェクトを受け取って構築 + { + std::function f = ident_functor(); + + int result = f(1); + std::cout << "(4) function object : " << result << std::endl; + } + + // (4) + // メンバ関数ポインタを受け取った構築 + { + std::function f = &X::ident_member_func; + + X x; + int result = f(x, 1); + std::cout << "(4) member function pointer : " << result << std::endl; + } + + // (4) + // メンバ変数ポインタを受け取った構築 + { + std::function f = &X::value; + + X x; + int result = f(x); + std::cout << "(4) member variable pointer : " << result << std::endl; + } +} +``` +* std::move[link /reference/utility/move.md] + +### 出力 +``` +(3) : 1 +(4) function pointer : 1 +(4) function object : 1 +(4) member function pointer : 1 +(4) member variable pointer : 3 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0288R9 move_only_function](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0288r9.html) diff --git a/reference/functional/move_only_function/op_destructor.md b/reference/functional/move_only_function/op_destructor.md new file mode 100644 index 0000000000..abd3afe51f --- /dev/null +++ b/reference/functional/move_only_function/op_destructor.md @@ -0,0 +1,36 @@ +# デストラクタ +* functional[meta header] +* std[meta namespace] +* move_only_function[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +~move_only_function(); +``` + +## 概要 +`move_only_function`オブジェクトを破棄する。 + + +## 効果 +`*this`が有効な関数ポインタ、メンバポインタ、もしくは関数オブジェクトを持っている場合、その関数を解放する。 + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0288R9 move_only_function](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0288r9.html) diff --git a/reference/functional/move_only_function/op_equal.md b/reference/functional/move_only_function/op_equal.md new file mode 100644 index 0000000000..f885652e71 --- /dev/null +++ b/reference/functional/move_only_function/op_equal.md @@ -0,0 +1,66 @@ +# operator== +* functional[meta header] +* std[meta namespace] +* move_only_function[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +friend bool operator==(const move_only_function& f, nullptr_t) noexcept; // (1) + +// (1)により、以下のオーバーロードが使用可能になる +friend bool operator==(nullptr_t, const move_only_function& f) noexcept; // (2) +``` +* nullptr_t[link /reference/cstddef/nullptr_t.md] + +## 概要 +等値比較する。 + + +## 戻り値 +`!f` + + +## 例 +```cpp example +#include +#include + +int ident(int x) { return x; } + +int main() +{ + std::move_only_function f; + + if (f == nullptr) { + std::cout << "empty" << std::endl; + } + + f = ident; + if (f == nullptr) {} + else { + std::cout << "not empty" << std::endl; + } +} +``` + +### 出力 +``` +empty +not empty +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0288R9 move_only_function](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0288r9.html) diff --git a/reference/functional/move_only_function/op_not_equal.md b/reference/functional/move_only_function/op_not_equal.md new file mode 100644 index 0000000000..b1f6ba926e --- /dev/null +++ b/reference/functional/move_only_function/op_not_equal.md @@ -0,0 +1,66 @@ +# operator!= +* functional[meta header] +* std[meta namespace] +* move_only_function[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +// operator==により、以下のオーバーロードが使用可能になる +bool operator!=(const move_only_function& f, nullptr_t) noexcept; // (1) + +bool operator!=(nullptr_t, const move_only_function& f) noexcept; // (2) +``` +* nullptr_t[link /reference/cstddef/nullptr_t.md] + +## 概要 +非等値比較する。 + + +## 戻り値 +`static_cast(f)` + + +## 例 +```cpp example +#include +#include + +int ident(int x) { return x; } + +int main() +{ + std::move_only_function f = ident; + + if (f != nullptr) { + std::cout << "not empty" << std::endl; + } + + f = nullptr; + if (f != nullptr) {} + else { + std::cout << "empty" << std::endl; + } +} +``` + +### 出力 +``` +not empty +empty +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0288R9 move_only_function](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0288r9.html) diff --git a/reference/functional/move_only_function/swap.md b/reference/functional/move_only_function/swap.md new file mode 100644 index 0000000000..3bc3956208 --- /dev/null +++ b/reference/functional/move_only_function/swap.md @@ -0,0 +1,72 @@ +# swap +* functional[meta header] +* std[meta namespace] +* move_only_function[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +void swap(move_only_function& other) noexcept; +``` + +## 概要 +他の`move_only_function`オブジェクトと中身を入れ替える。 + + +## 効果 +`*this`が持つ関数と`other`が持つ関数を交換する。 + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include + +int ident(int x) { return x; } +int add(int x) { return x + 1; } + +int main() +{ + std::move_only_function f = ident; + std::move_only_function g = add; + + // fとgを交換 + f.swap(g); + + std::cout << f(1) << std::endl; // add + std::cout << g(1) << std::endl; // ident +} +``` +* swap[color ff0000] +* f(1)[link op_call.md] +* g(1)[link op_call.md] + +### 出力 +``` +2 +1 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0288R9 move_only_function](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0288r9.html) + diff --git a/reference/functional/move_only_function/swap_free.md b/reference/functional/move_only_function/swap_free.md new file mode 100644 index 0000000000..9404837ffd --- /dev/null +++ b/reference/functional/move_only_function/swap_free.md @@ -0,0 +1,67 @@ +# swap (非メンバ関数) +* functional[meta header] +* std[meta namespace] +* move_only_function[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +friend void swap(move_only_function& f1, move_only_function& f2) noexcept; +``` + +## 概要 +2つの`move_only_function`オブジェクトを入れ替える。 + + +## 効果 +`f1.`[`swap`](swap.md)`(f2)` + + +## 戻り値 +なし + + +## 例 +```cpp example +#include +#include + +int ident(int x) { return x; } +int add(int x) { return x + 1; } + +int main() +{ + std::move_only_function f = ident; + std::move_only_function g = add; + + // fとgを交換 + std::swap(f, g); + + std::cout << f(1) << std::endl; // add + std::cout << g(1) << std::endl; // ident +} +``` +* std::swap[color ff0000] +* f(1)[link op_call.md] +* g(1)[link op_call.md] + +### 出力 +``` +2 +1 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0288R9 move_only_function](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0288r9.html) From 7208b792c3223ad04b126825da87d020f65e3861 Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 11 Jan 2023 22:53:36 +0900 Subject: [PATCH 0085/3948] =?UTF-8?q?generator:=20=E5=BE=AE=E8=AA=BF?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/generator/generator.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/generator/generator.md b/reference/generator/generator.md index d49ca96d71..70e949cc5a 100644 --- a/reference/generator/generator.md +++ b/reference/generator/generator.md @@ -18,6 +18,7 @@ namespace std { ## 概要 `generator`クラステンプレートは、[コルーチン](/lang/cpp20/coroutines.md)の評価により生成される要素列のビュー(view)を表現する。 特殊化された`generator`は[`view`](/reference/ranges/view.md)および[`input_range`](/reference/ranges/input_range.md)のモデルである。 +`generator`はムーブのみ可能なオブジェクトである。 戻り値型`generator`のコルーチン(以下、ジェネレータコルーチン)では`co_yield`式を用いて値を生成する。`co_yield` [`std::ranges::elements_of`](/reference/ranges/elements_of.md)`(rng)`式を用いると、ジェネレータコルーチンから入れ子Range(`rng`)の各要素を逐次生成する。 ジェネレータコルーチンでは`co_await`式を利用できない。 From 96e93fc28af2cb6f312a531638731b8bebdbcb90 Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 23 Jan 2023 21:15:56 +0900 Subject: [PATCH 0086/3948] =?UTF-8?q?functional:=20move=5Fonly=5Ffunction?= =?UTF-8?q?=E3=81=B8=E3=81=AE=E3=83=AA=E3=83=B3=E3=82=AF=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?(#1056)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/functional.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/functional.md b/reference/functional.md index 8ac753e93a..de215b83e5 100644 --- a/reference/functional.md +++ b/reference/functional.md @@ -25,6 +25,7 @@ struct doubler { |----------------------------------------------------------|----------------------------------------|-------| | [`function`](functional/function.md) | 関数・関数オブジェクトの多相的なラッパー(class template) | C++11 | | [`bad_function_call`](functional/bad_function_call.md) | 不正な関数呼び出しに関する例外(class) | C++11 | +| [`move_only_function`](functional/move_only_function.md) | 関数・関数オブジェクトの多相的な軽量ラッパー(class template) | C++23 | ## 統一的な関数呼び出し From ad997184e5177e545acd5a3b7410cc48451fc5cb Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 23 Jan 2023 22:33:13 +0900 Subject: [PATCH 0087/3948] =?UTF-8?q?basic=5Fformat=5Fparse=5Fcontext:=20b?= =?UTF-8?q?egin,=20end,=20advance=5Fto=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../format/basic_format_context/advance_to.md | 2 - reference/format/basic_format_context/out.md | 2 - .../format/basic_format_parse_context.md | 12 +-- .../basic_format_parse_context/advance_to.md | 48 +++++++++++ .../basic_format_parse_context/begin.md | 86 +++++++++++++++++++ .../format/basic_format_parse_context/end.md | 86 +++++++++++++++++++ reference/format/formatter.md | 2 +- 7 files changed, 227 insertions(+), 11 deletions(-) create mode 100644 reference/format/basic_format_parse_context/advance_to.md create mode 100644 reference/format/basic_format_parse_context/begin.md create mode 100644 reference/format/basic_format_parse_context/end.md diff --git a/reference/format/basic_format_context/advance_to.md b/reference/format/basic_format_context/advance_to.md index 5aff44b4a7..dac5edc89d 100644 --- a/reference/format/basic_format_context/advance_to.md +++ b/reference/format/basic_format_context/advance_to.md @@ -8,8 +8,6 @@ ```cpp void advance_to(iterator it); ``` -* basic_format_arg[link /reference/format/basic_format_arg.md] -* basic_format_context[link /reference/format/basic_format_context.md] ## 概要 出力イテレータを指定したイテレータに設定する。 diff --git a/reference/format/basic_format_context/out.md b/reference/format/basic_format_context/out.md index 4c8569f053..d6e5676539 100644 --- a/reference/format/basic_format_context/out.md +++ b/reference/format/basic_format_context/out.md @@ -8,8 +8,6 @@ ```cpp iterator out(); ``` -* basic_format_arg[link /reference/format/basic_format_arg.md] -* basic_format_context[link /reference/format/basic_format_context.md] ## 概要 出力イテレータを取得する。 diff --git a/reference/format/basic_format_parse_context.md b/reference/format/basic_format_parse_context.md index 2d0db6d8a8..f02a306339 100644 --- a/reference/format/basic_format_parse_context.md +++ b/reference/format/basic_format_parse_context.md @@ -28,17 +28,17 @@ namespace std { | 名前 | 説明 | 対応バージョン | |-----------------|----------------------------------------------------|----------------| | `(constructor)` | コンストラクタ | C++20 | -| `begin` | 書式文字列の先頭のイテレータを得る | C++20 | -| `end` | 書式文字列の末尾のイテレータを得る | C++20 | -| `advance_to` | 先頭のイテレータを指定したイテレータに設定する | C++20 | +| [`begin`](basic_format_parse_context/begin.md) | 書式文字列の先頭を指すイテレータを取得する | C++20 | +| [`end`](basic_format_parse_context/end.md) | 書式文字列の末尾を指すイテレータを取得する | C++20 | +| [`advance_to`](basic_format_parse_context/advance_to.md) | 指定したイテレータを先頭イテレータとして設定する | C++20 | | `next_arg_id` | フォーマット引数の番号を次に進める | C++20 | | `check_arg_id` | フォーマット引数の番号指定が有効か確かめる | C++20 | ## メンバ型 -| 名前 | 説明 | 対応バージョン | -|------------------|-----------------------------------------------------------------------------------------------|----------------| -| `char_type` | 文字の型(`charT`と等しい) (type-alias) | C++20 | +| 名前 | 説明 | 対応バージョン | +|------------------|---------------------------------------------------------------------------------------------|----------------| +| `char_type` | 文字の型(`charT`と等しい) (type-alias) | C++20 | | `const_iterator` | 書式文字列のイテレータの型(`basic_string_view::const_iterator`と等しい) (type-alias) | C++20 | | `iterator` | 書式文字列のイテレータの型(`basic_string_view::iterator`と等しい) (type-alias) | C++20 | diff --git a/reference/format/basic_format_parse_context/advance_to.md b/reference/format/basic_format_parse_context/advance_to.md new file mode 100644 index 0000000000..5f490afd7f --- /dev/null +++ b/reference/format/basic_format_parse_context/advance_to.md @@ -0,0 +1,48 @@ +# advance_to +* format[meta header] +* function[meta id-type] +* std[meta namespace] +* basic_format_parse_context[meta class] +* cpp20[meta cpp] + +```cpp +constexpr void advance_to(const_iterator it); +``` + +## 概要 +指定したイテレータを先頭イテレータとして設定する。 + +この関数は、書式文字列の全体を解析する処理において、[`formatter`](/reference/format/formatter.md)`::`[`parse()`](/reference/format/formatter/parse.md)の戻り値を、次の解析の初期位置として設定するために使用する。 + +```cpp +while (…) { + next_parse_ctx.advance_to(f.parse(parse_ctx)); +} +``` +* parse[link /reference/format/formatter/parse.md] + + +## 事前条件 +- `it`は[`end()`](end.md)に到達可能であること + + +## 効果 +メンバ変数として保持している、書式文字列の先頭を指すイテレータ`begin_`があるとして、以下と等価: + +```cpp +begin_ = it; +``` + + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13 +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 + +- [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) diff --git a/reference/format/basic_format_parse_context/begin.md b/reference/format/basic_format_parse_context/begin.md new file mode 100644 index 0000000000..be15eeaedf --- /dev/null +++ b/reference/format/basic_format_parse_context/begin.md @@ -0,0 +1,86 @@ +# begin +* format[meta header] +* function[meta id-type] +* std[meta namespace] +* basic_format_parse_context[meta class] +* cpp20[meta cpp] + +```cpp +constexpr const_iterator begin() const noexcept; +``` + +## 概要 +書式文字列の先頭を指すイテレータを取得する。 + + +## 効果 +メンバ変数として保持している、書式文字列の先頭を指すイテレータを返す。 + + +## 例 +### 基本的な使い方 +```cpp example +#include +#include + +enum color { red, green, blue }; + +const char* color_names[] = { "red", "green", "blue" }; + +template<> +class std::formatter { + bool enable_quote = false; +public: + constexpr auto parse(std::format_parse_context& ctx) { + auto it = ctx.begin(); + if (it == ctx.end()) { + return it; + } + + if (*it == '%') { + enable_quote = true; + ++it; + } + return it; + } + + auto format(color c, std::format_context& ctx) const { + if (enable_quote) { + return std::format_to(ctx.out(), "\"{}\"", color_names[c]); + } + else { + return std::format_to(ctx.out(), "{}", color_names[c]); + } + } +}; + +int main() +{ + std::cout << std::format("{:%}", red) << std::endl; +} +``` +* ctx.begin()[color ff0000] +* ctx.end()[link end.md] +* std::format[link /reference/format/format.md] +* std::format_to[link /reference/format/format_to.md] +* std::format_context[link /reference/format/basic_format_context.md] +* ctx.out()[link /reference/format/basic_format_context/out.md] + +#### 出力 +``` +"red" +``` + + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13 +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 + +- [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) diff --git a/reference/format/basic_format_parse_context/end.md b/reference/format/basic_format_parse_context/end.md new file mode 100644 index 0000000000..b71998a6df --- /dev/null +++ b/reference/format/basic_format_parse_context/end.md @@ -0,0 +1,86 @@ +# end +* format[meta header] +* function[meta id-type] +* std[meta namespace] +* basic_format_parse_context[meta class] +* cpp20[meta cpp] + +```cpp +constexpr const_iterator end() const noexcept; +``` + +## 概要 +書式文字列の末尾を指すイテレータを取得する。 + + +## 効果 +メンバ変数として保持している、書式文字列の末尾を指すイテレータを返す。 + + +## 例 +### 基本的な使い方 +```cpp example +#include +#include + +enum color { red, green, blue }; + +const char* color_names[] = { "red", "green", "blue" }; + +template<> +class std::formatter { + bool enable_quote = false; +public: + constexpr auto parse(std::format_parse_context& ctx) { + auto it = ctx.begin(); + if (it == ctx.end()) { + return it; + } + + if (*it == '%') { + enable_quote = true; + ++it; + } + return it; + } + + auto format(color c, std::format_context& ctx) const { + if (enable_quote) { + return std::format_to(ctx.out(), "\"{}\"", color_names[c]); + } + else { + return std::format_to(ctx.out(), "{}", color_names[c]); + } + } +}; + +int main() +{ + std::cout << std::format("{:%}", red) << std::endl; +} +``` +* ctx.end()[color ff0000] +* ctx.begin()[link begin.md] +* std::format[link /reference/format/format.md] +* std::format_to[link /reference/format/format_to.md] +* std::format_context[link /reference/format/basic_format_context.md] +* ctx.out()[link /reference/format/basic_format_context/out.md] + +#### 出力 +``` +"red" +``` + + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13 +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 + +- [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) diff --git a/reference/format/formatter.md b/reference/format/formatter.md index f815402b90..4f87612a8b 100644 --- a/reference/format/formatter.md +++ b/reference/format/formatter.md @@ -208,7 +208,7 @@ int main() } ``` * std::format_parse_context[link basic_format_parse_context.md] -* ctx.begin()[link basic_format_parse_context/begin.md.nolink] +* ctx.begin()[link basic_format_parse_context/begin.md] * std::format_context[link basic_format_context.md] * ctx.out()[link basic_format_context/out.md] * std::format_to[link format_to.md] From d1ac632cff8ca15c520099a205d3039e6b7111c1 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 23 Jan 2023 22:37:02 +0900 Subject: [PATCH 0088/3948] =?UTF-8?q?basic=5Fformat=5Fparse=5Fcontext::adv?= =?UTF-8?q?ance=5Fto=20:=20=E8=AA=AC=E6=98=8E=E8=A6=8B=E7=9B=B4=E3=81=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/basic_format_parse_context/advance_to.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/reference/format/basic_format_parse_context/advance_to.md b/reference/format/basic_format_parse_context/advance_to.md index 5f490afd7f..8d2967bf92 100644 --- a/reference/format/basic_format_parse_context/advance_to.md +++ b/reference/format/basic_format_parse_context/advance_to.md @@ -12,11 +12,15 @@ constexpr void advance_to(const_iterator it); ## 概要 指定したイテレータを先頭イテレータとして設定する。 -この関数は、書式文字列の全体を解析する処理において、[`formatter`](/reference/format/formatter.md)`::`[`parse()`](/reference/format/formatter/parse.md)の戻り値を、次の解析の初期位置として設定するために使用する。 +この関数は、書式文字列の全体を解析する処理において、[`formatter`](/reference/format/formatter.md)`::`[`parse()`](/reference/format/formatter/parse.md)の戻り値から、次の解析を始めるために使用する。 ```cpp while (…) { - next_parse_ctx.advance_to(f.parse(parse_ctx)); + auto it = f.parse(parse_ctx); + + /* 次の書式指定までitを進める… */ + + next_parse_ctx.advance_to(it); } ``` * parse[link /reference/format/formatter/parse.md] From 3269f7f3c99ee899ad037629c023ff4edb7577a0 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 23 Jan 2023 23:06:25 +0900 Subject: [PATCH 0089/3948] =?UTF-8?q?formatter=20:=20format,=20set=5Fbrack?= =?UTF-8?q?ets,=20set=5Fseparator,=20set=5Fdebug=5Fformat=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20#1085?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 1 + reference/format/format.md | 2 +- reference/format/formatter.md | 8 ++-- reference/format/formatter/format.md | 41 +++++++++++++++++++ reference/format/formatter/parse.md | 6 +-- reference/format/formatter/set_brackets.md | 41 +++++++++++++++++++ .../format/formatter/set_debug_format.md | 40 ++++++++++++++++++ reference/format/formatter/set_separator.md | 39 ++++++++++++++++++ 8 files changed, 170 insertions(+), 8 deletions(-) create mode 100644 reference/format/formatter/format.md create mode 100644 reference/format/formatter/set_brackets.md create mode 100644 reference/format/formatter/set_debug_format.md create mode 100644 reference/format/formatter/set_separator.md diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 8322676ab3..2bb6b88df2 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -174,6 +174,7 @@ * std::u32string[link /reference/string/basic_string.md] * std::wstring[link /reference/string/basic_string.md] * [link /reference/string_view.md] + * basic_string_view[link /reference/string_view/basic_string_view.md] * std::basic_string_view[link /reference/string_view/basic_string_view.md] * std::string_view[link /reference/string_view/basic_string_view.md] * [link /reference/syncstream.md] diff --git a/reference/format/format.md b/reference/format/format.md index 9f8b0498ed..83a6ce5a08 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -177,7 +177,7 @@ Range・シーケンスコンテナに対して使用できる標準のオプシ Range・シーケンスコンテナと同じだが、デフォルトで`m`書式を適用する。 -#### pair、tupleの書式 (C++23) +#### pair、tupleの書式 (C++23) [`std::pair`](/reference/utility/pair.md)と[`std::tuple`](/reference/tuple/tuple.md)に対して使用できる標準のオプション書式は次の通り(`[]`は省略可の意味)。 diff --git a/reference/format/formatter.md b/reference/format/formatter.md index 4f87612a8b..b932711462 100644 --- a/reference/format/formatter.md +++ b/reference/format/formatter.md @@ -112,22 +112,22 @@ namespace std { | メンバ関数 | 説明 | 対応バージョン | |------------|------|----------------| | [`parse`](formatter/parse.md) | 書式の解析を行う | C++20 | -| [`format`](formatter/format.md.nolink) | 書式化を行う | C++20 | +| [`format`](formatter/format.md) | 書式化を行う | C++20 | ### 文字・文字列に対する特殊化 | メンバ関数 | 説明 | 対応バージョン | |------------|------|----------------| -| [`set_debug_format`](formatter/set_debug_format.md.nolink) | デバッグ書式を有効にする | C++23 | +| [`set_debug_format`](formatter/set_debug_format.md) | デバッグ出力を有効にする | C++23 | ### pair / tuple向けの特殊化 | メンバ関数 | 説明 | 対応バージョン | |------------|------|----------------| -| [`set_separator`](formatter/set_separator.md.nolink) | 要素の区切り文字を設定する | C++23 | -| [`set_brackets`](formatter/set_brackets.md.nolink) | 全体の囲み文字を設定する | C++23 | +| [`set_separator`](formatter/set_separator.md) | 要素の区切り文字を設定する | C++23 | +| [`set_brackets`](formatter/set_brackets.md) | 全体の囲み文字を設定する | C++23 | ## 例 diff --git a/reference/format/formatter/format.md b/reference/format/formatter/format.md new file mode 100644 index 0000000000..fb49958895 --- /dev/null +++ b/reference/format/formatter/format.md @@ -0,0 +1,41 @@ +# format +* format[meta header] +* function[meta id-type] +* std[meta namespace] +* formatter[meta class] +* cpp20[meta cpp] + +```cpp +template +typename FormatContext::iterator + format(T& x, FormatContext& ctx) const; +``` +* FormatContext[link /reference/format/basic_format_context.md] + +## 概要 +受け取った型`T`のオブジェクトを書式化する。 + + +## 効果 +- [`parse()`](parse.md)メンバ関数で解析した書式文字列の指定に基づいて、`x`の値を文字列に変換する +- [`std::pair`](/reference/utility/pair.md)と[`std::tuple`](/reference/tuple/tuple.md)に対する`formatter`の特殊化の場合、以下を[`ctx.out()`](/reference/format/basic_format_context/out.md)に出力する: + - 開きカッコを出力する + - 範囲`[0, タプルの要素数)`の各要素`I`について、 + - `I != 0`であれば区切り文字を出力する + - タプルの`I`番目の要素を、その型の`formatter`で出力する + - 閉じカッコを出力する + + +## 戻り値 +出力がおわった位置の出力イテレータを返す。 + + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13 +- [Visual C++](/implementation.md#visual_cpp): ?? + diff --git a/reference/format/formatter/parse.md b/reference/format/formatter/parse.md index 789c2f6725..2d4f6ab239 100644 --- a/reference/format/formatter/parse.md +++ b/reference/format/formatter/parse.md @@ -20,9 +20,9 @@ constexpr typename ParseContext::iterator - デフォルトの`formatter`の場合、[`std::format()`](/reference/format/format.md)関数ページに記載されている「[標準のオプション書式](/reference/format/format.md#std-format-options)」を解析する - [`std::pair`](/reference/utility/pair.md)と[`std::tuple`](/reference/tuple/tuple.md)に対する`formatter`の特殊化の場合、[`std::format()`](/reference/format/format.md)関数ページに記載されている「[pair、tupleの書式](/reference/format/format.md#tuple-format-options)」を解析する - このとき、書式によって以下を設定する - - 全体の囲み文字を、[`set_brackets()`](set_brackets.md.nolink)メンバ関数で設定する - - 要素の区切り文字を、[`set_separator()`](set_separator.md.nolink)メンバ関数で設定する - - 各要素の`formatter`を`e`として、[`e.set_debug_format()`](set_debug_format.md.nolink)が有効な式であれば、それを呼び出してデバッグ書式を有効にする + - 全体の囲み文字を、[`set_brackets()`](set_brackets.md)メンバ関数で設定する + - 要素の区切り文字を、[`set_separator()`](set_separator.md)メンバ関数で設定する + - 各要素の`formatter`を`e`として、[`e.set_debug_format()`](set_debug_format.md)が有効な式であれば、それを呼び出してデバッグ書式を有効にする ## 戻り値 diff --git a/reference/format/formatter/set_brackets.md b/reference/format/formatter/set_brackets.md new file mode 100644 index 0000000000..972fd8cff1 --- /dev/null +++ b/reference/format/formatter/set_brackets.md @@ -0,0 +1,41 @@ +# set_brackets +* format[meta header] +* function[meta id-type] +* std[meta namespace] +* formatter[meta class] +* cpp23[meta cpp] + +```cpp +template ... Ts> +constexpr void + formatter>::set_brackets( + basic_string_view opening, + basic_string_view closing); // (1) +``` + +## 概要 +全体の囲み文字を設定する。 + +このメンバ関数は、[`std::format()`](/reference/format/format.md)関数の「[pair、tupleの書式](/reference/format/format.md#tuple-format-options)」において囲み文字を変更するオプションを指定することで自動的に呼び出される。 + +デフォルトの開きカッコは`"("`、閉じカッコは`")"`である。 + + +## 効果 +`opening`を開きカッコ、`closing`を閉じカッコとして設定する。 + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2286R8 Formatting Ranges](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2286r8.html) +- [P2585R1 Improve default container formatting](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2585r1.html) + - C++23から、Range・コンテナ、`pair`、`tuple`のフォーマット出力、および文字・文字列のデバッグ指定 (`"?"`) が追加された diff --git a/reference/format/formatter/set_debug_format.md b/reference/format/formatter/set_debug_format.md new file mode 100644 index 0000000000..94d7141c77 --- /dev/null +++ b/reference/format/formatter/set_debug_format.md @@ -0,0 +1,40 @@ +# set_debug_format +* format[meta header] +* function[meta id-type] +* std[meta namespace] +* formatter[meta class] +* cpp23[meta cpp] + +```cpp +constexpr void + formatter::set_debug_format(); // (1) +``` + +## 概要 +デバッグ出力を有効にする。 + +このメンバ関数は、[`std::format()`](/reference/format/format.md)関数の文字・文字列に対する書式として「? (デバッグ出力)」の指定をすることで自動的に呼び出される。デフォルトは無効である。 + +この機能が有効になることで、文字・文字列が引用符で囲まれ、エスケープシーケンスがエスケープされて出力される (例:`"\n"`は`"\"\n\""`となる)。 + +タプルおよびRangeの要素としての文字・文字列に対しては、デフォルトで有効であることに注意。 + + +## 効果 +デバッグ出力を有効にする。 + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2286R8 Formatting Ranges](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2286r8.html) +- [P2585R1 Improve default container formatting](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2585r1.html) + - C++23から、Range・コンテナ、`pair`、`tuple`のフォーマット出力、および文字・文字列のデバッグ指定 (`"?"`) が追加された diff --git a/reference/format/formatter/set_separator.md b/reference/format/formatter/set_separator.md new file mode 100644 index 0000000000..d54d732a95 --- /dev/null +++ b/reference/format/formatter/set_separator.md @@ -0,0 +1,39 @@ +# set_separator +* format[meta header] +* function[meta id-type] +* std[meta namespace] +* formatter[meta class] +* cpp23[meta cpp] + +```cpp +template ... Ts> +constexpr void + formatter>::set_separator(basic_string_view sep); // (1) +``` + +## 概要 +要素の区切り文字を設定する。 + +このメンバ関数は、[`std::format()`](/reference/format/format.md)関数の「[pair、tupleの書式](/reference/format/format.md#tuple-format-options)」において区切り文字を変更するオプションを指定することで自動的に呼び出される。 + +デフォルトの開きカッコは`", "`である。 + + +## 効果 +`sep`を区切り文字として設定する。 + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2286R8 Formatting Ranges](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2286r8.html) +- [P2585R1 Improve default container formatting](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2585r1.html) + - C++23から、Range・コンテナ、`pair`、`tuple`のフォーマット出力、および文字・文字列のデバッグ指定 (`"?"`) が追加された From 93bd53edf4fda360fdc78d36d80cbbe94036c3b5 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 24 Jan 2023 00:16:16 +0900 Subject: [PATCH 0090/3948] =?UTF-8?q?formatter=20:=20=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=89=E4=BF=AE=E9=A3=BE=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/formatter.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reference/format/formatter.md b/reference/format/formatter.md index b932711462..7c882484aa 100644 --- a/reference/format/formatter.md +++ b/reference/format/formatter.md @@ -153,6 +153,7 @@ int main() } ``` * std::format_context[link basic_format_context.md] +* std::format[link format.md] #### 出力 ``` @@ -212,6 +213,7 @@ int main() * std::format_context[link basic_format_context.md] * ctx.out()[link basic_format_context/out.md] * std::format_to[link format_to.md] +* std::format[link format.md] #### 出力 From 731e1ea31aaf0eb0022d342263e3d4b8c359e55a Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 24 Jan 2023 00:32:28 +0900 Subject: [PATCH 0091/3948] =?UTF-8?q?memory/(in)out=5Fptr=5Ft:=20=E7=89=B9?= =?UTF-8?q?=E6=AE=8A=E5=8C=96=E5=8F=AF=E8=83=BD=E3=81=AA=E3=81=93=E3=81=A8?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E8=A8=98(#1050)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/memory/inout_ptr_t.md | 5 ++++- reference/memory/out_ptr_t.md | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/reference/memory/inout_ptr_t.md b/reference/memory/inout_ptr_t.md index 4dffa9e67d..1dc0927b3f 100644 --- a/reference/memory/inout_ptr_t.md +++ b/reference/memory/inout_ptr_t.md @@ -15,7 +15,10 @@ namespace std { 2重ポインタ`T**`(=`Pointer*`)引数経由で既存リソースを解放してから新規確保リソースへのポインタを返すレガシーC関数に対して、取得されたポインタ値をスマートポインタに格納するアダプタクラス。 アダプタオブジェクトの生成には、[`std::inout_ptr()`](inout_ptr.md)ヘルパ関数を利用する。 -C++標準スマートポインタ[`std::unique_ptr`](unique_ptr.md)を始め、互換インタフェースをもつ任意のスマートポインタ型`Smart`を取り扱える。 +リソース占有管理セマンティクスを提供するC++標準スマートポインタ[`std::unique_ptr`](unique_ptr.md)を始め、互換インタフェースをもつ任意のスマートポインタ型`Smart`を取り扱える。 + +プログラマは`inout_ptr_t`クラステンプレートの特殊化を定義してもよい。 +このとき1つ以上のプログラム定義型に依存していれば、プライマリテンプレートにおける要件を満たす必要はない。 ## テンプレートパラメータ制約 diff --git a/reference/memory/out_ptr_t.md b/reference/memory/out_ptr_t.md index 5a2dee0b09..6e0994a0c9 100644 --- a/reference/memory/out_ptr_t.md +++ b/reference/memory/out_ptr_t.md @@ -17,6 +17,9 @@ namespace std { C++標準スマートポインタ[`std::shared_ptr`](shared_ptr.md)や[`std::unique_ptr`](unique_ptr.md)を始め、互換インタフェースをもつ任意のスマートポインタ型`Smart`を取り扱える。 +プログラマは`out_ptr_t`クラステンプレートの特殊化を定義してもよい。 +このとき1つ以上のプログラム定義型に依存していれば、プライマリテンプレートにおける要件を満たす必要はない。 + ## テンプレートパラメータ制約 `Pointer`はCpp17NullablePointer要件を満たすこと From 04e52ed81dd8ee331331170a6f67a548fc195e6b Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 24 Jan 2023 00:47:28 +0900 Subject: [PATCH 0092/3948] =?UTF-8?q?=E8=A8=B3=E8=AA=9E=E8=A1=A8:=20"progr?= =?UTF-8?q?am-defiend=20type"=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/concepts/convertible_to.md | 4 ++-- working_style.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/concepts/convertible_to.md b/reference/concepts/convertible_to.md index b6be426237..cd446206b5 100644 --- a/reference/concepts/convertible_to.md +++ b/reference/concepts/convertible_to.md @@ -86,7 +86,7 @@ int main() std::cout << std::convertible_to << std::endl; std::cout << std::convertible_to << std::endl; - std::cout << "\n--- program defined type ---\n"; + std::cout << "\n--- program-defined type ---\n"; std::cout << std::convertible_to << std::endl; std::cout << std::convertible_to << std::endl; std::cout << std::convertible_to << std::endl; @@ -113,7 +113,7 @@ true true false ---- program defined type --- +--- program-defined type --- true true false diff --git a/working_style.md b/working_style.md index 19cd16183e..ee0da6fabd 100644 --- a/working_style.md +++ b/working_style.md @@ -129,8 +129,8 @@ C++11以降対応については対応バージョンを明記します。バー | underlying type | 基底型 | | unordered associative container(s) | 非順序連想コンテナ | | unspecified | 未規定 | +| program-defined type | プログラム定義型 | | virtual base class | 仮想基底クラス | | weak ordering | 弱順序 | | well-formed | 適格 | | eligible | 資格のある | - From f85391077c46ea79afc2a1a5792bf3d7ac44b4e6 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 24 Jan 2023 15:06:24 +0900 Subject: [PATCH 0093/3948] =?UTF-8?q?move=5Fonly=5Ffunction:=20=E5=BE=93?= =?UTF-8?q?=E6=9D=A5function=E3=81=A8=E5=AF=BE=E6=AF=94=E3=81=97=E3=81=9F?= =?UTF-8?q?=E4=BE=8B=E7=A4=BA=E3=82=B3=E3=83=BC=E3=83=89=E3=82=92=E6=8B=A1?= =?UTF-8?q?=E5=85=85(#1056)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/functional/move_only_function.md | 152 +++++++++++++++++- .../functional/move_only_function/op_call.md | 11 +- 2 files changed, 155 insertions(+), 8 deletions(-) diff --git a/reference/functional/move_only_function.md b/reference/functional/move_only_function.md index ebd0db2017..3e189c0130 100644 --- a/reference/functional/move_only_function.md +++ b/reference/functional/move_only_function.md @@ -16,12 +16,21 @@ namespace std { ## 概要 `move_only_function`クラステンプレートは、パラメータの型リスト`ArgTypes...`、戻り値の型`R`に合致する、あらゆる関数ポインタ、関数オブジェクト、メンバ関数ポインタ、メンバ変数ポインタを保持できるクラスである。 -下記全ての組み合わせ(12種類)についてクラステンプレートの部分特殊化が提供される。 +下記全ての組み合わせ(12種類)に対して、クラステンプレートの部分特殊化が提供される。 - CV修飾子 *cv* : `const`, CV修飾無し - 参照修飾子 *ref* : `&`, `&&`, 参照修飾無し - noexcept例外指定 *noex* : `true`, `false` +### `function`との比較 +[`std::function`](function.md)と比べて、`std::move_only_function`は下記の特徴をもつ。 + +- ムーブのみ対応。コピー不可。 +- const性を正しく伝搬する。 +- 関数型のCV修飾/参照修飾/noexcept例外指定をサポートする。 +- [`target_type`](function/target_type.md)型と[`target()`](function/target.md)を提供しない。 +- [関数呼び出し](move_only_function/op_call.md)は強い前提条件を持つ。 + ## メンバ関数 ### 構築・破棄 @@ -52,9 +61,10 @@ namespace std { ## 例 +### 例1: 基本の使い方 ```cpp example -#include #include +#include int add(int x) { return x + 1; } @@ -74,9 +84,139 @@ int main() * std::move_only_function[color ff0000] * f(1)[link move_only_function/op_call.md] -### 出力 +#### 出力 +``` +2 +``` + +### 例2: const性の伝搬 +```cpp +#include +#include +#include +#include + +struct Functor { + std::string operator()() { + return "non-const"; + } + std::string operator()() const { + return "const"; + } +}; + +int main() +{ + std::cout << "-- move_only_function" << std::endl; + std::move_only_function mof1 = Functor{}; + const std::move_only_function mof2 = Functor{}; // (呼び出し時に不適格) + std::move_only_function mof3 = Functor{}; + const std::move_only_function mof4 = Functor{}; + std::cout << "mof1: " << mof1() << std::endl; +//std::cout << "mof2: " << mof2() << std::endl; // 不適格 + std::cout << "mof3: " << mof3() << std::endl; + std::cout << "mof4: " << mof4() << std::endl; + + std::cout << "-- function" << std::endl; + std::function fn1 = Functor{}; + const std::function fn2 = Functor{}; +// std::function fn3 = Functor{}; // 不適格 +//const std::function fn4 = Functor{}; // 不適格 + std::cout << "fn1: " << fn1() << std::endl; + std::cout << "fn2: " << fn2() << std::endl; +} +``` +* std::move_only_function[color ff0000] +* std::function[link function.md] + +#### 出力 +``` +-- move_only_function +mof1: non-const +mof3: const +mof4: const +-- function +fn1: non-const +fn2: non-const +``` + +### 例3: 左辺値/右辺値の伝搬 +```cpp example +#include +#include +#include +#include + +struct Functor { + std::string operator()() & { + return "L-val"; + } + std::string operator()() && { + return "R-val"; + } +}; + +int main() +{ + std::cout << "-- move_only_function" << std::endl; + std::move_only_function mof1 = Functor{}; + std::move_only_function mof2 = Functor{}; + std::cout << "mof1/L-val: " << mof1() << std::endl; + std::cout << "mof1/R-val: " << std::move(mof1)() << std::endl; +//std::cout << "mof2/L-val: " << mof2() << std::endl; // 不適格 + std::cout << "mof2/R-val: " << std::move(mof2)() << std::endl; + + std::cout << "-- function" << std::endl; + std::function fn1 = Functor{}; +//std::function fn2 = Functor{}; // 不適格 + std::cout << "fn1/L-val: " << fn1() << std::endl; + std::cout << "fn1/R-val: " << std::move(fn1)() << std::endl; +} +``` +* std::move_only_function[color ff0000] +* std::function[link function.md] + +#### 出力 +``` +-- move_only_function +mof1/L-val: L-val +mof1/R-val: L-val +mof2/R-val: R-val +-- function +fn1/L-val: L-val +fn1/R-val: L-val +``` + +### 例4: noexcept指定の伝搬 +```cpp example +#include + +void func() {} +void func_noex() noexcept {} + +int main() +{ + std::move_only_function mof1 = func; + std::move_only_function mof2 = func_noex; +//std::move_only_function mof3 = func; // 不適格 + std::move_only_function mof4 = func_noex; + static_assert(not noexcept(mof1())); + static_assert(not noexcept(mof2())); + static_assert( noexcept(mof4())); + + std::function fn1 = func; + std::function fn2 = func_noex; +//std::function fn3 = func; // 不適格 +//std::function fn4 = func_noex; // 不適格 + static_assert(not noexcept(fn1())); + static_assert(not noexcept(fn2())); +} +``` +* std::move_only_function[color ff0000] +* std::function[link function.md] + +#### 出力 ``` -1 ``` @@ -86,7 +226,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? +- [GCC](/implementation.md#gcc): 12.1 - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? @@ -97,3 +237,5 @@ int main() ## 参照 - [P0288R9 move_only_function](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0288r9.html) +- [N4348 Making `std::function` safe for concurrency](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4348.html) + - `std::function`のconst性伝搬に関して、スレッドセーフ保証の観点からの問題指摘。 diff --git a/reference/functional/move_only_function/op_call.md b/reference/functional/move_only_function/op_call.md index e72ca00699..fcc09a5ff9 100644 --- a/reference/functional/move_only_function/op_call.md +++ b/reference/functional/move_only_function/op_call.md @@ -12,7 +12,12 @@ R operator()(ArgTypes... args) /*cv*/ /*ref*/ noexcept(/*noex*/); ## 概要 関数を呼び出す。 -CV修飾子 *cv*, 参照修飾子 *ref*, noexcept例外指定 *noex* は[`move_only_function`](../move_only_function.md)に指定するテンプレートパラメータ`R(ArgTypes...)`部と等しい。 +`operator()`のCV修飾子 *cv*, 参照修飾子 *ref*, noexcept例外指定 *noex* は、[`move_only_function`](../move_only_function.md)に指定するテンプレートパラメータ`R(ArgTypes...)`部のものと等しい。 + +説明用のプレースホルダ *inv-quals* を次のように定義する : + +- *ref* が空(参照修飾無し)ならば、*cv*`&` +- そうでなければ、*cv* *ref* ## 事前条件 @@ -20,7 +25,7 @@ CV修飾子 *cv*, 参照修飾子 *ref*, noexcept例外指定 *noex* は[`move_o ## 効果 -`*this`が保持している`F`型の関数ポインタまたは関数オブジェクト`f`に対して、[`INVOKE`](/reference/concepts/Invoke.md)`(static_cast(f),` [`std::forward`](/reference/utility/forward.md)`(args)...)`を行う。 +`*this`が保持している`F`型の関数ポインタまたは関数オブジェクト`f`に対して、[`INVOKE`](/reference/concepts/Invoke.md)`(static_cast(f),` [`std::forward`](/reference/utility/forward.md)`(args)...)`を行う。 ## 戻り値 @@ -58,7 +63,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? +- [GCC](/implementation.md#gcc): 12.1 - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? From 6e6d1c530a1e90c052394a44d9e1e4a64a6c419b Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 24 Jan 2023 17:29:15 +0900 Subject: [PATCH 0094/3948] =?UTF-8?q?move=5Fonly=5Ffunciton=20:=20std::fun?= =?UTF-8?q?ction=E3=81=A8=E3=81=AE=E9=81=95=E3=81=84=E3=81=AB=E3=81=A4?= =?UTF-8?q?=E3=81=84=E3=81=A6=E8=BF=BD=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/functional/move_only_function.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reference/functional/move_only_function.md b/reference/functional/move_only_function.md index 3e189c0130..448d269616 100644 --- a/reference/functional/move_only_function.md +++ b/reference/functional/move_only_function.md @@ -29,7 +29,9 @@ namespace std { - const性を正しく伝搬する。 - 関数型のCV修飾/参照修飾/noexcept例外指定をサポートする。 - [`target_type`](function/target_type.md)型と[`target()`](function/target.md)を提供しない。 -- [関数呼び出し](move_only_function/op_call.md)は強い前提条件を持つ。 + - 実行時型情報(RTTI)非依存 +- [関数呼び出し](move_only_function/op_call.md)は強い事前条件を持つ。 + - 関数呼び出し時のnullチェックが要求されない ## メンバ関数 From 020145072fe3f0b3552760fd3de229fc084fe5dc Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 24 Jan 2023 17:41:57 +0900 Subject: [PATCH 0095/3948] =?UTF-8?q?span,basic=5Fstring=5Fview:=20P2251?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C(#1062)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/span/span.md | 4 ++++ reference/string_view/basic_string_view.md | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/reference/span/span.md b/reference/span/span.md index f65f8daf00..c4fe25ad36 100644 --- a/reference/span/span.md +++ b/reference/span/span.md @@ -31,6 +31,8 @@ namespace std { 文字列操作に特化したクラスとして[`std::basic_string_view`](/reference/string_view/basic_string_view.md)が定義されているが、こちらはメモリ連続性をもつあらゆるコンテナに適用できる。 +このクラスは、[トリビアルコピー可能](/reference/type_traits/is_trivially_copyable.md)である(C++23) + ### メモリ連続性 このクラスの対象は、メモリの連続性を持つシーケンスである。例として、以下は対象のシーケンスである: @@ -276,3 +278,5 @@ int main() - [P2116R0 Remove tuple-like protocol support from fixed-extent `span`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2116r0.html) - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) - [P2325R3 Views should not be required to be default constructible](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2325r3.html) +- [Require `span` & `basic_string_view` to be Trivially Copyable](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2251r1.pdf) + - C++23から、トリビアルコピー可能が保証される。 diff --git a/reference/string_view/basic_string_view.md b/reference/string_view/basic_string_view.md index 5e7bc85b20..2c3484d7fb 100644 --- a/reference/string_view/basic_string_view.md +++ b/reference/string_view/basic_string_view.md @@ -31,6 +31,8 @@ string_view hello = sv.substr(0, 5); // 先頭5文字を抽出する このクラスの実装としては、文字配列の参照する先頭文字へのポインタと、文字数の2つをメンバ変数として持つ。これらの変数を変動させることによって、部分文字列の抽出や、限定された範囲内での検索といったことを実現する。 +このクラスは、[トリビアルコピー可能](/reference/type_traits/is_trivially_copyable.md)である(C++23) + ## メンバ関数 ### 構築・破棄 @@ -321,3 +323,5 @@ C - [P0254R2 Integrating `std::string_view` and `std::string`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0254r2.pdf) - [P0403R0 Literal suffixes for `basic_string_view`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0403r0.html) - [String literals make bad ranges - Andrzej's C++ blog](https://akrzemi1.wordpress.com/2019/09/25/string-literals-make-bad-ranges/) +- [Require `span` & `basic_string_view` to be Trivially Copyable](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2251r1.pdf) + - C++23から、トリビアルコピー可能が保証される。 From 01eb3487685c392456dcec2c6bc85b06fcc5b8bf Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 24 Jan 2023 17:52:47 +0900 Subject: [PATCH 0096/3948] move_only_function/op_constructor: fix markup --- reference/functional/move_only_function/op_constructor.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/functional/move_only_function/op_constructor.md b/reference/functional/move_only_function/op_constructor.md index 5a13d4bcdd..1635fa0f53 100644 --- a/reference/functional/move_only_function/op_constructor.md +++ b/reference/functional/move_only_function/op_constructor.md @@ -25,6 +25,7 @@ explicit move_only_function(in_place_type_t, initializer_list, Args&&...); `move_only_function`クラステンプレートパラメータのnoexcept例外指定 *noex* 特殊化に応じて、説明用の`bool`型テンプレート定数`is-callable-from`を下記のように定義する : + - *noex* が`true`のとき : [`is_nothrow_invocable_r_v`](/reference/type_traits/is_nothrow_invocable_r.md)` &&` [`is_nothrow_invocable_r_v`](/reference/type_traits/is_nothrow_invocable_r.md)`` - *noex* が`false`のとき : [`is_invocable_r_v`](/reference/type_traits/is_invocable_r.md)` &&` [`is_invocable_r_v`](/reference/type_traits/is_invocable_r.md)`` From f3d46e161ef521b57aeb7cc2b254859daedae89f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 24 Jan 2023 19:08:33 +0900 Subject: [PATCH 0097/3948] =?UTF-8?q?=20:=20range=5Fformatter?= =?UTF-8?q?=E3=82=AF=E3=83=A9=E3=82=B9=E3=83=9A=E3=83=BC=E3=82=B8=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20#1085?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format.md | 2 +- reference/format/range_formatter.md | 127 ++++++++++++++++++++++++++++ 2 files changed, 128 insertions(+), 1 deletion(-) create mode 100644 reference/format/range_formatter.md diff --git a/reference/format.md b/reference/format.md index 86734ef79f..13d7736732 100644 --- a/reference/format.md +++ b/reference/format.md @@ -34,7 +34,7 @@ | [`wformat_context`](format/basic_format_context.md) | `basic_format_context`のワイド文字列版 (type-alias) | C++20 | | [`range_format`](format/range_format.md) | Rangeの書式種別 (enum) | C++23 | | [`format_kind`](format/format_kind.md) | 指定したRangeの書式種別を取得する (variable) | C++23 | -| [`range_formatter`](format/range_formatter.md.nolink) | Rangeに対する書式文字列の解析、値のフォーマットを行う (class template) | C++23 | +| [`range_formatter`](format/range_formatter.md) | Rangeに対する書式文字列の解析、値のフォーマットを行う (class template) | C++23 | | [`range-default-formatter`](format/range-default-formatter.md.nolink) | Rangeに対する共通の書式文字列の解析、値のフォーマットを行う説明専用クラス (class template) | C++23 | ## 引数 diff --git a/reference/format/range_formatter.md b/reference/format/range_formatter.md new file mode 100644 index 0000000000..5bd98668ae --- /dev/null +++ b/reference/format/range_formatter.md @@ -0,0 +1,127 @@ +# range_formatter +* format[meta header] +* class template[meta id-type] +* std[meta namespace] +* cpp23[meta cpp] + +```cpp +namespace std { + template + requires same_as, T> && formattable + class range_formatter; +} +``` +* formattable[link formattable.md] + +## 概要 +`range_formatter`は、Range・コンテナに対する[`formatter`](formatter.md)クラスの特殊化を実装するためのユーティリティクラスである。 + +ユーザー定義のコンテナ・RangeをRange書式に対応する場合は、以下のようにする: + +- オリジナル書式を定義しないのであれば、このクラスではなく、[`format_kind`](format_kind.md)を特殊化する +- オリジナル書式を定義するのであれば、このクラスおよび[`format_kind`](format_kind.md)を特殊化して[`parse()`](range_formatter/parse.md.nolink)メンバ関数と[`format()`](range_formatter/format.md.nolink)メンバ関数を実装する + + +## メンバ関数 + +| メンバ関数 | 説明 | 対応バージョン | +|------------|------|----------------| +| [`set_separator`](range_formatter/set_separator.md.nolink) | 要素の区切り文字を設定する | C++23 | +| [`set_brackets`](range_formatter/set_brackets.md.nolink) | 全体の囲み文字を設定する | C++23 | +| [`underlying`](range_formatter/underlying.md.nolink) | 要素型の`formatter`を取得する | C++23 | +| [`parse`](range_formatter/parse.md.nolink) | 書式の解析を行う | C++23 | +| [`format`](range_formatter/format.md.nolink) | 書式化を行う | C++23 | + + +## 例 +### オリジナル書式を定義する例 +```cpp example +#include +#include +#include + +template +class std::range_formatter> : public std::range_formatter> { + bool is_colon = false; + using base_type = std::range_formatter>; +public: + + // コンパイル時の書式文字列の解析があるため、 + // constexprにする必要がある。 + // この関数に渡されるパラメータは、{:%j}の%以降。 + // 解析がおわった場所を指すイテレータを返す。 + constexpr auto parse(std::format_parse_context& ctx) { + auto it = ctx.begin(); + if (*it == 'c') { + is_colon = true; + ++it; + } + ctx.advance_to(it); + return base_type::parse(ctx); + } + + // format()関数は書式の情報をもたない。 + // parse()関数で解析した書式をメンバ変数で保持しておいて、 + // それをもとに書式化する + auto format(const std::vector& v, std::format_context& ctx) const { + if (is_colon) { + auto out = ctx.out(); + bool is_first = true; + for (const T& x : v) { + if (is_first) { + is_first = false; + } + else { + *out = ':'; + ++out; + } + ctx.advance_to(out); + out = underlying().format(x, ctx); + } + return out; + } + return base_type::format(v, ctx); + } +}; + +int main() +{ + std::vector v = {0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}; + std::cout << std::format("{:c:02x}", v) << std::endl; +} +``` +* std::format_parse_context[link basic_format_parse_context.md] +* ctx.begin()[link basic_format_parse_context/begin.md] +* std::format_context[link basic_format_context.md] +* ctx.out()[link basic_format_context/out.md] +* std::format_to[link format_to.md] +* std::format[link format.md] +* underlying()[link range_formatter/underlying.md.nolink] + + +#### 出力 +``` +aa:bb:cc:dd:ee:ff +``` + +(動作確認はできていない) + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 関連項目 +- [`range-default-formatter`](range-default-formatter.md.nolink) +- [`formatter`](formatter.md) + + +## 参照 +- [P2286R8 Formatting Ranges](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2286r8.html) +- [P2585R1 Improve default container formatting](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2585r1.html) + - C++23から、Range・コンテナ、`pair`、`tuple`のフォーマット出力、および文字・文字列のデバッグ指定 (`"?"`) が追加された From 1b70d4969c37657769dcef952082534252dba460 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 24 Jan 2023 19:40:00 +0900 Subject: [PATCH 0098/3948] =?UTF-8?q?range=5Fformatter=20:=20=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E4=BF=AE=E9=A3=BE=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/range_formatter.md | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/reference/format/range_formatter.md b/reference/format/range_formatter.md index 5bd98668ae..258c751561 100644 --- a/reference/format/range_formatter.md +++ b/reference/format/range_formatter.md @@ -50,22 +50,22 @@ public: // constexprにする必要がある。 // この関数に渡されるパラメータは、{:%j}の%以降。 // 解析がおわった場所を指すイテレータを返す。 - constexpr auto parse(std::format_parse_context& ctx) { - auto it = ctx.begin(); + constexpr auto parse(std::format_parse_context& pctx) { + auto it = pctx.begin(); if (*it == 'c') { is_colon = true; ++it; } - ctx.advance_to(it); - return base_type::parse(ctx); + pctx.advance_to(it); + return base_type::parse(pctx); } // format()関数は書式の情報をもたない。 // parse()関数で解析した書式をメンバ変数で保持しておいて、 // それをもとに書式化する - auto format(const std::vector& v, std::format_context& ctx) const { + auto format(const std::vector& v, std::format_context& fctx) const { if (is_colon) { - auto out = ctx.out(); + auto out = fctx.out(); bool is_first = true; for (const T& x : v) { if (is_first) { @@ -75,12 +75,12 @@ public: *out = ':'; ++out; } - ctx.advance_to(out); - out = underlying().format(x, ctx); + fctx.advance_to(out); + out = underlying().format(x, fctx); } return out; } - return base_type::format(v, ctx); + return base_type::format(v, fctx); } }; @@ -91,9 +91,11 @@ int main() } ``` * std::format_parse_context[link basic_format_parse_context.md] -* ctx.begin()[link basic_format_parse_context/begin.md] +* pctx.begin()[link basic_format_parse_context/begin.md] +* pctx.advance_to()[link basic_format_parse_context/advance_to.md] * std::format_context[link basic_format_context.md] -* ctx.out()[link basic_format_context/out.md] +* fctx.out()[link basic_format_context/out.md] +* fctx.advance_to()[link basic_format_context/advance_to.md] * std::format_to[link format_to.md] * std::format[link format.md] * underlying()[link range_formatter/underlying.md.nolink] From 258f393aeb27077ec21225cc177df1722c7529e5 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 24 Jan 2023 19:48:04 +0900 Subject: [PATCH 0099/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE?= =?UTF-8?q?=E9=A3=BE=E3=83=9F=E3=82=B9=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/range_formatter.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/format/range_formatter.md b/reference/format/range_formatter.md index 258c751561..5b0cec189a 100644 --- a/reference/format/range_formatter.md +++ b/reference/format/range_formatter.md @@ -92,10 +92,10 @@ int main() ``` * std::format_parse_context[link basic_format_parse_context.md] * pctx.begin()[link basic_format_parse_context/begin.md] -* pctx.advance_to()[link basic_format_parse_context/advance_to.md] +* pctx.advance_to[link basic_format_parse_context/advance_to.md] * std::format_context[link basic_format_context.md] * fctx.out()[link basic_format_context/out.md] -* fctx.advance_to()[link basic_format_context/advance_to.md] +* fctx.advance_to[link basic_format_context/advance_to.md] * std::format_to[link format_to.md] * std::format[link format.md] * underlying()[link range_formatter/underlying.md.nolink] From 684d1f03ad7dfc7059d79909f078182c3bc58266 Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 25 Jan 2023 10:14:44 +0900 Subject: [PATCH 0100/3948] =?UTF-8?q?move=5Fonly=5Ffunction:=20=E6=8E=A8?= =?UTF-8?q?=E8=AB=96=E8=A3=9C=E5=8A=A9=E3=82=92=E5=AE=9A=E7=BE=A9=E3=81=97?= =?UTF-8?q?=E3=81=AA=E3=81=84=E6=97=A8=E3=82=92=E6=98=8E=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/functional/move_only_function.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/reference/functional/move_only_function.md b/reference/functional/move_only_function.md index 448d269616..1d76195614 100644 --- a/reference/functional/move_only_function.md +++ b/reference/functional/move_only_function.md @@ -6,7 +6,8 @@ ```cpp namespace std { - template class move_only_function; // 宣言のみ + template + class move_only_function; // 宣言のみ template class move_only_function; @@ -26,12 +27,13 @@ namespace std { [`std::function`](function.md)と比べて、`std::move_only_function`は下記の特徴をもつ。 - ムーブのみ対応。コピー不可。 -- const性を正しく伝搬する。 - 関数型のCV修飾/参照修飾/noexcept例外指定をサポートする。 + - const性などを正しく伝搬することでバグ発生リスクを軽減する - [`target_type`](function/target_type.md)型と[`target()`](function/target.md)を提供しない。 - 実行時型情報(RTTI)非依存 - [関数呼び出し](move_only_function/op_call.md)は強い事前条件を持つ。 - 関数呼び出し時のnullチェックが要求されない +- クラステンプレート引数の[推論補助](/lang/cpp17/type_deduction_for_class_templates.md)を提供しない。 ## メンバ関数 @@ -241,3 +243,4 @@ int main() - [P0288R9 move_only_function](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0288r9.html) - [N4348 Making `std::function` safe for concurrency](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4348.html) - `std::function`のconst性伝搬に関して、スレッドセーフ保証の観点からの問題指摘。 +- [Why does C++23 std::move_only_function not have deduction guides?](https://stackoverflow.com/questions/69509236/why-does-c23-stdmove-only-function-not-have-deduction-guides) From da6808523e7c9835d8383ecb2480e4368a26fccb Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 25 Jan 2023 10:47:49 +0900 Subject: [PATCH 0101/3948] =?UTF-8?q?utility/unreachable:=20=E5=BE=AE?= =?UTF-8?q?=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/utility/unreachable.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/utility/unreachable.md b/reference/utility/unreachable.md index 9ba4c982d4..90ea2d7759 100644 --- a/reference/utility/unreachable.md +++ b/reference/utility/unreachable.md @@ -15,7 +15,7 @@ namespace std { ## 事前条件 -`true`==`false` +`false`==`true` ## 備考 @@ -44,9 +44,9 @@ int flip(int x) int main() { - std::cout << f(0) << std::endl; - std::cout << f(1) << std::endl; - // f(2)呼び出しは未定義動作 + std::cout << flip(0) << std::endl; + std::cout << flip(1) << std::endl; + // 例えば f(2) 呼び出しは未定義動作となる。 } ``` * std::unreachable[color ff0000] From 63e429d33d1a3e2f10ecbfe657d31a3c5b0eb41e Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 25 Jan 2023 11:29:10 +0900 Subject: [PATCH 0102/3948] =?UTF-8?q?move=5Fonly=5Ffunction/op=5Fconstruct?= =?UTF-8?q?or:=20=E5=85=A8=E3=82=AA=E3=83=BC=E3=83=90=E3=83=BC=E3=83=AD?= =?UTF-8?q?=E3=83=BC=E3=83=89=E3=81=AE=E4=BE=8B=E7=A4=BA=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=89=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../move_only_function/op_constructor.md | 94 +++++++++++-------- 1 file changed, 57 insertions(+), 37 deletions(-) diff --git a/reference/functional/move_only_function/op_constructor.md b/reference/functional/move_only_function/op_constructor.md index 1635fa0f53..d5bd1e25b1 100644 --- a/reference/functional/move_only_function/op_constructor.md +++ b/reference/functional/move_only_function/op_constructor.md @@ -24,7 +24,12 @@ explicit move_only_function(in_place_type_t, initializer_list, Args&&...); `move_only_function`オブジェクトを構築する。 -`move_only_function`クラステンプレートパラメータのnoexcept例外指定 *noex* 特殊化に応じて、説明用の`bool`型テンプレート定数`is-callable-from`を下記のように定義する : +`move_only_function`クラステンプレートパラメータのCV修飾子 *cv*, 参照修飾子 *ref*, noexcept例外指定 *noex* に応じて、説明用のプレースホルダ *inv-quals* を次のように定義する : + +- *ref* が空(参照修飾無し)ならば、*cv*`&` +- そうでなければ、*cv* *ref* + +また、説明用の`bool`型テンプレート定数`is-callable-from`を下記のように定義する : - *noex* が`true`のとき : [`is_nothrow_invocable_r_v`](/reference/type_traits/is_nothrow_invocable_r.md)` &&` [`is_nothrow_invocable_r_v`](/reference/type_traits/is_nothrow_invocable_r.md)`` - *noex* が`false`のとき : [`is_invocable_r_v`](/reference/type_traits/is_invocable_r.md)` &&` [`is_invocable_r_v`](/reference/type_traits/is_invocable_r.md)`` @@ -76,8 +81,10 @@ explicit move_only_function(in_place_type_t, initializer_list, Args&&...); ## 例 ```cpp example #include -#include #include +#include +#include +#include struct ident_functor { int operator()(int x) const @@ -89,77 +96,88 @@ int ident_func(int x) struct X { int value; - X() : value(3) {} - int ident_member_func(int x) const - { return x; } + int add_member_func(int x) const + { return value + x; } }; +struct add_functor { + int value; + + add_functor(int v) : value(v) {} + add_functor(std::initializer_list lst, int iv) + : value(std::accumulate(lst.begin(), lst.end(), iv)) {} + + int operator()(int x) const + { return value + x; } +}; + + int main() { - // (1) - // デフォルトコンストラクタ + // (1) デフォルトコンストラクタ + // (2) ヌルポインタを受け取るコンストラクタ // 空のmove_only_functionオブジェクトを作る { - std::move_only_function f; - assert(!f); - } - - // (2) - // ヌルポインタを受け取るコンストラクタ - // デフォルトコンストラクタと同様、空のmove_only_functionオブジェクトを作る - { - std::move_only_function f = nullptr; - assert(!f); + std::move_only_function f1; + assert(!f1); + std::move_only_function f2 = nullptr; + assert(!f2); } - // (3) - // ムーブ構築 + // (3) ムーブ構築 { std::move_only_function f = ident_functor(); std::move_only_function g = std::move(f); + assert(g && !f); int result = g(1); std::cout << "(3) : " << result << std::endl; } - // (4) - // 関数ポインタを受け取って構築 + // (4) 関数ポインタを受け取って構築 { std::function f = ident_func; int result = f(1); std::cout << "(4) function pointer : " << result << std::endl; } - - // (4) - // 関数オブジェクトを受け取って構築 + // (4) 関数オブジェクトを受け取って構築 { std::function f = ident_functor(); int result = f(1); std::cout << "(4) function object : " << result << std::endl; } - - // (4) - // メンバ関数ポインタを受け取った構築 + // (4) メンバ関数ポインタを受け取った構築 { - std::function f = &X::ident_member_func; + std::function f = &X::add_member_func; - X x; + X x{2}; int result = f(x, 1); std::cout << "(4) member function pointer : " << result << std::endl; } - - // (4) - // メンバ変数ポインタを受け取った構築 + // (4) メンバ変数ポインタを受け取った構築 { std::function f = &X::value; - - X x; + X x{2}; int result = f(x); std::cout << "(4) member variable pointer : " << result << std::endl; } + + // (5) 引数リストによる直接構築コンストラクタ + { + std::move_only_function f(std::in_place_type, 2); + int result = f(1); + std::cout << "(5) : " << result << std::endl; + } + + // (6) initializer_list+引数リストによる直接構築コンストラクタ + { + std::move_only_function f(std::in_place_type, std::initializer_list{1, 2, 3}, 4); + int result = f(5); + std::cout << "(6) : " << result << std::endl; + } } ``` * std::move[link /reference/utility/move.md] @@ -169,8 +187,10 @@ int main() (3) : 1 (4) function pointer : 1 (4) function object : 1 -(4) member function pointer : 1 -(4) member variable pointer : 3 +(4) member function pointer : 3 +(4) member variable pointer : 2 +(5) : 3 +(6) : 15 ``` @@ -180,7 +200,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? +- [GCC](/implementation.md#gcc): 12.1 - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? From 373f49da92fb9c34115279a210f29067b6259e35 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 25 Jan 2023 11:56:38 +0900 Subject: [PATCH 0103/3948] =?UTF-8?q?range=5Fformatter=20:=20=E3=82=B5?= =?UTF-8?q?=E3=83=B3=E3=83=97=E3=83=AB=E3=82=B3=E3=83=BC=E3=83=89=E3=81=AE?= =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=83=91=E3=82=A4=E3=83=AB=E3=81=8C=E9=80=9A?= =?UTF-8?q?=E3=82=89=E3=81=AA=E3=81=95=E3=81=9D=E3=81=86=E3=81=AA=E3=81=AE?= =?UTF-8?q?=E3=81=A7=E8=A6=8B=E7=9B=B4=E3=81=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/range_formatter.md | 32 ++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/reference/format/range_formatter.md b/reference/format/range_formatter.md index 5b0cec189a..7f3190b223 100644 --- a/reference/format/range_formatter.md +++ b/reference/format/range_formatter.md @@ -41,7 +41,31 @@ namespace std { #include template -class std::range_formatter> : public std::range_formatter> { +class MyVector { + std::vector v_; +public: + using base_type = std::vector; + using iterator = typename base_type::iterator; + using const_iterator = typename base_type::iterator; + using value_type = typename base_type::value_type; + using reference = typename base_type::reference; + using const_reference = typename base_type::const_reference; + + MyVector() = default; + MyVector(std::initializer_list init) + : v_(init.begin(), init.end()) {} + + iterator begin() { v_.begin(); } + const_iterator begin() const { v_.begin(); } + + iterator end() { v_.end(); } + const_iterator end() const { v_.end(); } + + const std::vector& base() const { return v_; } +}; + +template +class std::range_formatter> : public std::range_formatter> { bool is_colon = false; using base_type = std::range_formatter>; public: @@ -63,7 +87,7 @@ public: // format()関数は書式の情報をもたない。 // parse()関数で解析した書式をメンバ変数で保持しておいて、 // それをもとに書式化する - auto format(const std::vector& v, std::format_context& fctx) const { + auto format(const MyVector& v, std::format_context& fctx) const { if (is_colon) { auto out = fctx.out(); bool is_first = true; @@ -80,10 +104,12 @@ public: } return out; } - return base_type::format(v, fctx); + return base_type::format(v.base(), fctx); } }; +#include + int main() { std::vector v = {0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}; From 74662b472ba0ca06ab99ac08ed74a3d2e8669584 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 25 Jan 2023 14:16:40 +0900 Subject: [PATCH 0104/3948] =?UTF-8?q?range=5Fformatter=20:=20=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=90=E9=96=A2=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20#1085?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/format.md | 2 +- reference/format/formatter/set_separator.md | 2 +- reference/format/range_formatter.md | 19 ++++---- reference/format/range_formatter/format.md | 47 +++++++++++++++++++ reference/format/range_formatter/parse.md | 39 +++++++++++++++ .../format/range_formatter/set_brackets.md | 34 ++++++++++++++ .../format/range_formatter/set_separator.md | 32 +++++++++++++ .../format/range_formatter/underlying.md | 33 +++++++++++++ 8 files changed, 198 insertions(+), 10 deletions(-) create mode 100644 reference/format/range_formatter/format.md create mode 100644 reference/format/range_formatter/parse.md create mode 100644 reference/format/range_formatter/set_brackets.md create mode 100644 reference/format/range_formatter/set_separator.md create mode 100644 reference/format/range_formatter/underlying.md diff --git a/reference/format/format.md b/reference/format/format.md index 83a6ce5a08..97fae21faa 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -172,7 +172,7 @@ Range・シーケンスコンテナに対して使用できる標準のオプシ - 要素型の書式を指定して、デバッグ出力指定をしなければ、デフォルトで有効になっているデバッグ出力を解除できる -#### 連想コンテナの書式 (C++23) +#### 連想コンテナの書式 (C++23) Range・シーケンスコンテナと同じだが、デフォルトで`m`書式を適用する。 diff --git a/reference/format/formatter/set_separator.md b/reference/format/formatter/set_separator.md index d54d732a95..1d82f14ae8 100644 --- a/reference/format/formatter/set_separator.md +++ b/reference/format/formatter/set_separator.md @@ -16,7 +16,7 @@ constexpr void このメンバ関数は、[`std::format()`](/reference/format/format.md)関数の「[pair、tupleの書式](/reference/format/format.md#tuple-format-options)」において区切り文字を変更するオプションを指定することで自動的に呼び出される。 -デフォルトの開きカッコは`", "`である。 +デフォルトの区切り文字は`", "`である。 ## 効果 diff --git a/reference/format/range_formatter.md b/reference/format/range_formatter.md index 7f3190b223..c2d5c38f5e 100644 --- a/reference/format/range_formatter.md +++ b/reference/format/range_formatter.md @@ -19,18 +19,18 @@ namespace std { ユーザー定義のコンテナ・RangeをRange書式に対応する場合は、以下のようにする: - オリジナル書式を定義しないのであれば、このクラスではなく、[`format_kind`](format_kind.md)を特殊化する -- オリジナル書式を定義するのであれば、このクラスおよび[`format_kind`](format_kind.md)を特殊化して[`parse()`](range_formatter/parse.md.nolink)メンバ関数と[`format()`](range_formatter/format.md.nolink)メンバ関数を実装する +- オリジナル書式を定義するのであれば、このクラスおよび[`format_kind`](format_kind.md)を特殊化して[`parse()`](range_formatter/parse.md)メンバ関数と[`format()`](range_formatter/format.md)メンバ関数を実装する ## メンバ関数 | メンバ関数 | 説明 | 対応バージョン | |------------|------|----------------| -| [`set_separator`](range_formatter/set_separator.md.nolink) | 要素の区切り文字を設定する | C++23 | -| [`set_brackets`](range_formatter/set_brackets.md.nolink) | 全体の囲み文字を設定する | C++23 | -| [`underlying`](range_formatter/underlying.md.nolink) | 要素型の`formatter`を取得する | C++23 | -| [`parse`](range_formatter/parse.md.nolink) | 書式の解析を行う | C++23 | -| [`format`](range_formatter/format.md.nolink) | 書式化を行う | C++23 | +| [`set_separator`](range_formatter/set_separator.md) | 要素の区切り文字を設定する | C++23 | +| [`set_brackets`](range_formatter/set_brackets.md) | 全体の囲み文字を設定する | C++23 | +| [`underlying`](range_formatter/underlying.md) | 要素型の`formatter`を取得する | C++23 | +| [`parse`](range_formatter/parse.md) | 書式の解析を行う | C++23 | +| [`format`](range_formatter/format.md) | 書式化を行う | C++23 | ## 例 @@ -64,6 +64,9 @@ public: const std::vector& base() const { return v_; } }; +template +constexpr std::range_format std::format_kind> = std::range_format::sequence; + template class std::range_formatter> : public std::range_formatter> { bool is_colon = false; @@ -87,7 +90,7 @@ public: // format()関数は書式の情報をもたない。 // parse()関数で解析した書式をメンバ変数で保持しておいて、 // それをもとに書式化する - auto format(const MyVector& v, std::format_context& fctx) const { + auto format(MyVector&& v, std::format_context& fctx) const { if (is_colon) { auto out = fctx.out(); bool is_first = true; @@ -124,7 +127,7 @@ int main() * fctx.advance_to[link basic_format_context/advance_to.md] * std::format_to[link format_to.md] * std::format[link format.md] -* underlying()[link range_formatter/underlying.md.nolink] +* underlying()[link range_formatter/underlying.md] #### 出力 diff --git a/reference/format/range_formatter/format.md b/reference/format/range_formatter/format.md new file mode 100644 index 0000000000..8cebaf5e12 --- /dev/null +++ b/reference/format/range_formatter/format.md @@ -0,0 +1,47 @@ +# format +* format[meta header] +* function[meta id-type] +* std[meta namespace] +* range_formatter[meta class] +* cpp23[meta cpp] + +```cpp +template + requires formattable, charT> && + same_as>, T> +typename FormatContext::iterator + format(R&& r, FormatContext& ctx) const; // (1) +``` +* FormatContext[link /reference/format/basic_format_context.md] +* ranges::input_range[link /reference/ranges/input_range.md] +* ranges::range_reference_t[link /reference/ranges/range_reference_t.md] + +## 概要 +受け取ったRangeオブジェクト`R`を書式化する。 + + +## 効果 +- [`parse()`](parse.md)メンバ関数で解析した書式文字列の指定に基づいて、`r`の値を文字列に変換し、以下を[`ctx.out()`](/reference/format/basic_format_context/out.md)に出力する: + - Range書式として[`s` (文字列として出力)](/reference/format/format.md#range-format-options)が指定された場合、[`basic_string`](/reference/string/basic_string.md)`(`[`from_range`](/reference/ranges/from_range_t.md.nolink)`, r)`を出力する + - そうでなく、Range書式として[`?s` (デバッグ文字列として出力)](/reference/format/format.md#range-format-options)が指定された場合、[`basic_string`](/reference/string/basic_string.md)`(`[`from_range`](/reference/ranges/from_range_t.md.nolink)`, r)`に引用符を付け、エスケープシーケンスをエスケープして出力する + - そうでなければ、 + - 開きカッコを出力する + - Range `r`の各要素`e`について、 + - [`underlying()`](underlying.md)の[`formatter`](/reference/format/formatter.md)で`e`を書式化して出力する + - 最後の要素でなければ、区切り文字を出力する + - 閉じカッコを出力する + + +## 戻り値 +出力がおわった位置の出力イテレータを返す。 + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + diff --git a/reference/format/range_formatter/parse.md b/reference/format/range_formatter/parse.md new file mode 100644 index 0000000000..22b031b481 --- /dev/null +++ b/reference/format/range_formatter/parse.md @@ -0,0 +1,39 @@ +# parse +* format[meta header] +* function[meta id-type] +* std[meta namespace] +* range_formatter[meta class] +* cpp23[meta cpp] + +```cpp +template +constexpr typename ParseContext::iterator + parse(ParseContext& ctx); +``` +* ParseContext[link /reference/format/basic_format_parse_context.md] + +## 概要 +書式文字列の範囲`[ctx.begin(), ctx.end())`を解析する。 + + +## 効果 +- [`std::format()`](/reference/format/format.md)関数ページに記載されている「[Range・シーケンスコンテナの書式](/reference/format/format.md#range-format-options)」および「[連想コンテナの書式](/reference/format/format.md#assoc-format-options)」を解析する + - このとき、書式によって以下を設定する + - `n`オプション (囲み文字をなくす) が指定されなければ、全体の囲み文字を、[`set_brackets()`](set_brackets.md)メンバ関数で設定する + - 要素の区切り文字を、[`set_separator()`](set_separator.md)メンバ関数で設定する + - 要素に対する書式が空でなければ、各要素の[`formatter`](/reference/format/formatter.md)を`e`として、[`e.set_debug_format()`](/reference/format/formatter/set_debug_format.md)が有効な式であれば、それを呼び出してデバッグ書式を有効にする + + +## 戻り値 +`ctx`のうち、解析がおわった位置を指すイテレータを返す。 + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + diff --git a/reference/format/range_formatter/set_brackets.md b/reference/format/range_formatter/set_brackets.md new file mode 100644 index 0000000000..045bf01a6b --- /dev/null +++ b/reference/format/range_formatter/set_brackets.md @@ -0,0 +1,34 @@ +# set_brackets +* format[meta header] +* function[meta id-type] +* std[meta namespace] +* range_formatter[meta class] +* cpp23[meta cpp] + +```cpp +constexpr void + set_brackets(basic_string_view opening, + basic_string_view closing); // (1) +``` + +## 概要 +全体の囲み文字を設定する。 + +このメンバ関数は、[`std::format()`](/reference/format/format.md)関数の「[Range・シーケンスコンテナの書式](/reference/format/format.md#range-format-options)」および「[連想コンテナの書式](/reference/format/format.md#assoc-format-options)」において囲み文字を変更するオプションを指定することで自動的に呼び出される。 + +- Range・シーケンスコンテナのデフォルトの開きカッコは`"["`、閉じカッコは`"]"` +- 連想コンテナのデフォルトの開きカッコは`"{"`、閉じカッコは`"}"` + + +## 効果 +`opening`を開きカッコ、`closing`を閉じカッコとして設定する。 + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/format/range_formatter/set_separator.md b/reference/format/range_formatter/set_separator.md new file mode 100644 index 0000000000..bed0838d47 --- /dev/null +++ b/reference/format/range_formatter/set_separator.md @@ -0,0 +1,32 @@ +# set_separator +* format[meta header] +* function[meta id-type] +* std[meta namespace] +* range_formatter[meta class] +* cpp23[meta cpp] + +```cpp +constexpr void + set_separator(basic_string_view sep); // (1) +``` + +## 概要 +要素の区切り文字を設定する。 + +このメンバ関数は、[`std::format()`](/reference/format/format.md)関数の「[Range・シーケンスコンテナの書式](/reference/format/format.md#range-format-options)」および「[連想コンテナの書式](/reference/format/format.md#assoc-format-options)」において区切り文字を変更するオプションを指定することで自動的に呼び出される。 + +デフォルトの区切り文字は`", "`である。 + + +## 効果 +`sep`を区切り文字として設定する。 + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/format/range_formatter/underlying.md b/reference/format/range_formatter/underlying.md new file mode 100644 index 0000000000..e8ea0a6603 --- /dev/null +++ b/reference/format/range_formatter/underlying.md @@ -0,0 +1,33 @@ +# underlying +* format[meta header] +* function[meta id-type] +* std[meta namespace] +* range_formatter[meta class] +* cpp23[meta cpp] + +```cpp +constexpr formatter& underlying(); // (1) C++23 +constexpr const formatter& underlying() const; // (2) C++23 +``` +* formatter[link /reference/format/formatter.md] + +## 概要 +Rangeの要素型に対する[`formatter`](/reference/format/formatter.md)を取得する。 + +- (1) : 非const版 +- (2) : const版 + + +## 戻り値 +メンバ変数として保持している、Rangeの要素型に対する[`formatter`](/reference/format/formatter.md)を返す。 + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + From e400d17b65d9279c6b636cf00f8ac98964e3e5ce Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 25 Jan 2023 23:41:14 +0900 Subject: [PATCH 0105/3948] =?UTF-8?q?expected:=20expected=E3=82=AF?= =?UTF-8?q?=E3=83=A9=E3=82=B9=E6=A6=82=E8=A6=81=E3=81=AE=E3=81=BF(#1066)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 2 + lang/cpp23.md | 2 +- reference.md | 2 +- reference/expected.md | 34 ++++++++++ reference/expected/expected.md | 120 +++++++++++++++++++++++++++++++++ 5 files changed, 158 insertions(+), 2 deletions(-) create mode 100644 reference/expected.md create mode 100644 reference/expected/expected.md diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 2bb6b88df2..3c202f133a 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -90,6 +90,8 @@ * std::execution::par[link /reference/execution/execution/execution_policy.md] * std::execution::par_unseq[link /reference/execution/execution/execution_policy.md] * std::execution::seq[link /reference/execution/execution/execution_policy.md] +* [link /reference/expected.md] + * std::expected[link /reference/expected/expected.md] * [link /reference/filesystem.md] * fe.what()[link /reference/filesystem/filesystem_error/what.md] * fs::filesystem_error[link /reference/filesystem/filesystem_error.md] diff --git a/lang/cpp23.md b/lang/cpp23.md index 2263b8a0a8..f5f33237d5 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -115,7 +115,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 - スタックトレースを取得するためのライブラリとして[``](/reference/stacktrace.md)を追加 - CとC++の間でのアトミック操作の相互運用のため、C互換ライブラリとして[``](/reference/stdatomic.h.md)を追加 - 外部から提供されるメモリバッファでストリーム処理を行うライブラリとして[``](/reference/spanstream.md.nolink)を追加 -- 正常値とエラー値のどちらかを持つクラスおよびライブラリとして[``](/reference/expected.md.nolink)を追加 +- 正常値とエラー値のどちらかを持つクラスおよびライブラリとして[``](/reference/expected.md)を追加 - 多次元配列ビューのライブラリとして[``](/reference/mdspan.md.nolink)を追加 - ノードベースではないソート済みキーによる順序付き連想コンテナのライブラリとして、[``](/reference/flat_map.md.nolink)と[``](/reference/flat_set.md.nolink)を追加 - 書式指定で出力するライブラリとして[``](/reference/print.md.nolink)を追加 diff --git a/reference.md b/reference.md index e43685df13..82516c2871 100644 --- a/reference.md +++ b/reference.md @@ -63,7 +63,7 @@ | [``](/reference/optional.md) | 任意で値を持たせられるオブジェクト | C++17 | | [``](/reference/variant.md) | 候補の型を切り替えながら保持できる記憶域型 | C++17 | | [``](/reference/any.md) | あらゆる型の値を保持できる記憶域型 | C++17 | -| [``](/reference/expected.md.nolink) | 正常値かエラー値のどちらかを持たせられるオブジェクト | C++23 | +| [``](/reference/expected.md) | 正常値かエラー値のどちらかを持たせられるオブジェクト | C++23 | | [``](/reference/type_traits.md) | 型特性 | C++11 | | [``](/reference/functional.md) | 関数オブジェクト | | | [``](/reference/memory.md) | メモリ | | diff --git a/reference/expected.md b/reference/expected.md new file mode 100644 index 0000000000..3794925f44 --- /dev/null +++ b/reference/expected.md @@ -0,0 +1,34 @@ +# expected +* expected[meta header] +* cpp23[meta cpp] + +``ヘッダでは、任意の正常値または任意のエラー値のどちらかを持たせられるオブジェクトの型を定義する。 + + +| 名前 | 説明 | 対応バージョン | +|-----------------|----------------|-------| +| [`expected`](expected/expected.md) | 正常値かエラー値を保持するオブジェクト (class template) | C++23 | +| [`unexpected`](expected/unexpected.md.nolink) | エラー値の代入補助クラス (class template) | C++23 | +| [`unexpect_t`](expected/unexpect_t.md.nolink) | エラー値の直接構築を指示するタグ型 (class) | C++23 | +| [`bad_expected_access`](expected/bad_expected_access.md.nolink) | エラー値保持時に正常値へアクセスした場合に発生する例外 (class template) | C++23 | + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`optional`](optional.md) + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) +- [P2549R1 `std::unexpected` should have `error()` as member accessor](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2549r1.html) +- [P2505R5 Monadic Functions for `std::expected`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2505r5.html) diff --git a/reference/expected/expected.md b/reference/expected/expected.md new file mode 100644 index 0000000000..34e775ca7d --- /dev/null +++ b/reference/expected/expected.md @@ -0,0 +1,120 @@ +# expected +* expected[meta header] +* class template[meta id-type] +* std[meta namespace] +* cpp23[meta cpp] + +```cpp +namespace std { + template + class expected; + + // T=cv void 部分特殊化 + template + requires is_void_v + class expected; +} +``` + +## 概要 +`expected`クラスは、任意の型`T`の値を正常値とし任意の型`E`の値をエラー値として、正常もしくはエラーいずれかの状態を取ることを値として表現できる型である。 + + +## 適格要件 + +- 型`T`が(CV修飾された)`void`型でなければ、型`T`はCpp17Destructible要件を満たすこと。 +- 型`E`はCpp17Destructible要件を満たすこと。 + + +## メンバ関数 +### 構築・破棄 + +| 名前 | 説明 | 対応バージョン | +|-----------------|----------------|-------| +| [`(constructor)`](expected/op_constructor.md.nolink) | コンストラクタ | C++23 | +| [`(destructor)`](expected/op_destructor.md.nolink) | デストラクタ | C++23 | + +### 代入 + +| 名前 | 説明 | 対応バージョン | +|-----------------|----------------|-------| +| [`operator=`](expected/op_assign.md.nolink) | 代入演算子 | C++23 | +| [`emplace`](expected/emplace.md.nolink) | 正常値型のコンストラクタ引数から直接構築する | C++23 | +| [`swap`](expected/swap.md.nolink) | 他の`expected`オブジェクトとデータを入れ替える | C++23 | + +### 値の観測 + +| 名前 | 説明 | 対応バージョン | +|-----------------|----------------|-------| +| [`operator->`](expected/op_arrow.md.nolink) | メンバアクセス | C++23 | +| [`operator*`](expected/op_deref.md.nolink) | 間接参照 | C++23 | +| [`operator bool`](expected/op_bool.md.nolink) | 正常値を保持しているかを判定する | C++23 | +| [`has_value`](expected/has_value.md.nolink) | 正常値を保持しているかを判定する | C++23 | +| [`value`](expected/value.md.nolink) | 正常値を取得する | C++23 | +| [`error`](expected/error.md.nolink) | エラー値を取得する | C++23 | +| [`value_or`](expected/value_or.md.nolink) | 正常値もしくは指定された値を取得する | C++23 | + +### モナド操作 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`and_then`](expected/and_then.md.nolink) | 正常値に対して関数を適用する | C++23 | +| [`or_else`](expected/or_else.md.nolink) | エラー値に対して関数を適用する | C++23 | +| [`transform`](expected/transform.md.nolink) | 正常値を変換する | C++23 | +| [`transform_error`](expected/transform_error.md.nolink) | エラー値を変換する | C++23 | + +### 比較 + +| 名前 | 説明 | 対応バージョン | +|--------------|------------|-------| +| `operator==` | 等値比較 | C++23 | +| `operator!=` | 非等値比較 | C++23 | + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|-------------------|-----------------|-------| +| `value_type` | 正常値の型`T` | C++23 | +| `error_type` | エラー値の型`E` | C++23 | +| `unexpected_type` | [`unexpected`](unexpected.md.nolink) | C++23 | +| `template rebind` | `expected` | C++23 | + + +## 例 +```cpp example +#include +#include + +int main() +{ + int variable = 0; + std::cout << variable << std::endl; +} +``` +* std::expected[color ff0000] + +### 出力 +``` +0 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`optional`](/reference/optional/optional.md) + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) +- [P2505R5 Monadic Functions for `std::expected`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2505r5.html) From fd14d851b9dfadb7c82e398b0172f2c5ac379290 Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 26 Jan 2023 00:02:46 +0900 Subject: [PATCH 0106/3948] =?UTF-8?q?expected:=20=E5=9F=BA=E6=9C=AC?= =?UTF-8?q?=E7=9A=84=E3=81=AA=E4=BE=8B=E7=A4=BA=E3=82=B3=E3=83=BC=E3=83=89?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0(#1066)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/expected/expected.md | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/reference/expected/expected.md b/reference/expected/expected.md index 34e775ca7d..b10bda8928 100644 --- a/reference/expected/expected.md +++ b/reference/expected/expected.md @@ -84,19 +84,45 @@ namespace std { ## 例 ```cpp example #include +#include #include +#include + +// 整数除算 +std::expected idiv(int a, int b) +{ + if (b == 0) { + return std::unexpected{"divide by zero"}; + } + if (a % b != 0) { + return std::unexpected{"out of domain"}; + } + return a / b; +} + +void dump_result(const std::expected& v) +{ + if (v) { + std::cout << *v << std::endl; + } else { + std::cout << std::quoted(v.error()) << std::endl; + } +} int main() { - int variable = 0; - std::cout << variable << std::endl; + dump_result(idiv(10, 2)); + dump_result(idiv(10, 3)); + dump_result(idiv(10, 0)); } ``` * std::expected[color ff0000] ### 出力 ``` -0 +5 +out of domain +divide by zero ``` From 1971c4d9bd39ce1da8ac77597daca3298cb2e3d4 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 26 Jan 2023 18:34:03 +0900 Subject: [PATCH 0107/3948] =?UTF-8?q?=20:=20=E3=82=B3=E3=83=B3?= =?UTF-8?q?=E3=83=86=E3=83=8A=E3=82=A2=E3=83=80=E3=83=97=E3=82=BF=E3=81=AE?= =?UTF-8?q?=E6=96=87=E5=AD=97=E5=88=97=E3=83=95=E3=82=A9=E3=83=BC=E3=83=9E?= =?UTF-8?q?=E3=83=83=E3=83=88=E3=81=AB=E5=AF=BE=E5=BF=9C=20#1085?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format.md | 2 + reference/format/const-formattable-range.md | 38 ++++++++++++++ reference/format/fmt-maybe-const.md | 32 ++++++++++++ reference/format/format.md | 58 +++++++++++++++++++++ reference/format/formatter.md | 7 +++ reference/format/formatter/format.md | 22 +++++++- reference/format/formatter/parse.md | 9 ++++ 7 files changed, 167 insertions(+), 1 deletion(-) create mode 100644 reference/format/const-formattable-range.md create mode 100644 reference/format/fmt-maybe-const.md diff --git a/reference/format.md b/reference/format.md index 13d7736732..0fb6081f58 100644 --- a/reference/format.md +++ b/reference/format.md @@ -34,6 +34,8 @@ | [`wformat_context`](format/basic_format_context.md) | `basic_format_context`のワイド文字列版 (type-alias) | C++20 | | [`range_format`](format/range_format.md) | Rangeの書式種別 (enum) | C++23 | | [`format_kind`](format/format_kind.md) | 指定したRangeの書式種別を取得する (variable) | C++23 | +| [`const-formattable-range`](format/const-formattable-range.md) | `const Range`の要素型が文字列フォーマット可能 (concept) | C++23 | +| [`fmt-maybe-const`](format/fmt-maybe-const.md) | `formatter::format()`関数のパラメータ型として使用するための(const) Range型を取得 (type-alias) | C++23 | | [`range_formatter`](format/range_formatter.md) | Rangeに対する書式文字列の解析、値のフォーマットを行う (class template) | C++23 | | [`range-default-formatter`](format/range-default-formatter.md.nolink) | Rangeに対する共通の書式文字列の解析、値のフォーマットを行う説明専用クラス (class template) | C++23 | diff --git a/reference/format/const-formattable-range.md b/reference/format/const-formattable-range.md new file mode 100644 index 0000000000..48ab057c20 --- /dev/null +++ b/reference/format/const-formattable-range.md @@ -0,0 +1,38 @@ +# const-formattable-range +* format[meta header] +* concept[meta id-type] +* std[meta namespace] +* cpp23[meta cpp] + +```cpp +namespace std { + template + concept const-formattable-range = + ranges::input_range && + formattable, charT>; +} +``` +* ranges::input_range[link /reference/ranges/input_range.md] +* formattable[link formattable.md] +* ranges::range_reference_t[link /reference/ranges/range_reference_t.md] + +## 概要 +`const-formattable-range`は、`const R`入力Rangeの要素型が文字列フォーマット可能であることを表す説明専用コンセプトである。 + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`fmt-maybe-const`](fmt-maybe-const.md) + + +## 参照 +- [P2286R8 Formatting Ranges](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2286r8.html) diff --git a/reference/format/fmt-maybe-const.md b/reference/format/fmt-maybe-const.md new file mode 100644 index 0000000000..83bb3e20de --- /dev/null +++ b/reference/format/fmt-maybe-const.md @@ -0,0 +1,32 @@ +# fmt-maybe-const +* format[meta header] +* concept[meta id-type] +* std[meta namespace] +* cpp23[meta cpp] + +```cpp +namespace std { + template + using fmt-maybe-const = + conditional_t, const R, R>; +} +``` +* const-formattable-range[link const-formattable-range.md] +* conditional_t[link /reference/type_traits/conditional.md] + +## 概要 +`fmt-maybe-const`は、[`formatter::format()`](/reference/format/formatter/format.md)関数のパラメータ型として使用するための(const) Range型を取得する、型の別名である。 + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2286R8 Formatting Ranges](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2286r8.html) diff --git a/reference/format/format.md b/reference/format/format.md index 97fae21faa..09bbcb1fd6 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -170,6 +170,7 @@ Range・シーケンスコンテナに対して使用できる標準のオプシ - コンテナが[`std::vector`](/reference/vector/vector.md)``である場合、その要素型は`bool`として処理される - Range・シーケンスコンテナでは、要素型がデバッグ出力可能である場合、それがデフォルトで有効となる - 要素型の書式を指定して、デバッグ出力指定をしなければ、デフォルトで有効になっているデバッグ出力を解除できる +- コンテナアダプタである[`std::queue`](/reference/queue/queue.md)、[`std::priority_queue`](/reference/queue/priority_queue.md)、[`std::stack`](/reference/stack/stack.md)も使用できる #### 連想コンテナの書式 (C++23) @@ -446,6 +447,63 @@ int main() (3, "hello") ``` +### コンテナアダプタを出力する (C++23) +```cpp example +#include +#include +#include +#include +#include +#include + +int main() +{ + std::queue que; + que.push(1); + que.push(2); + que.push(3); + + std::priority_queue pque; + pque.push(1); + pque.push(2); + pque.push(3); + + std::stack st; + st.push(1); + st.push(2); + st.push(3); + + std::flat_map m {{1, "aaa"}, {2, "bbb"}}; + std::flat_set s = {1, 2, 3}; + + // queue/priority_queue/stackは、内部で使用しているコンテナと同じ扱い + std::cout << std::format("queue: {}", que) << std::endl; + std::cout << std::format("priority_queue: {}", pque) << std::endl; + std::cout << std::format("stack: {}", st) << std::endl; + + // flat_map/flat_setはmap/setと同じ扱い + std::cout << std::format("flat_map: {}", m) << std::endl; + std::cout << std::format("flat_set: {}", s) << std::endl; +} +``` +* std::queue[link /reference/queue/queue.md] +* que.push[link /reference/queue/queue/push.md] +* std::priority_queue[link /reference/queue/priority_queue.md] +* pque.push[link /reference/queue/priority_queue/push.md] +* std::stack[link /reference/stack/stack.md] +* st.push[link /reference/stack/stack/push.md] +* std::flat_map[link /reference/flat_map/flat_map.md.nolink] +* std::flat_set[link /reference/flat_map/flat_set.md.nolink] + +#### 出力 +``` +[1, 2, 3] +[3, 2, 1] +[1, 2, 3] +{1: "aaa", 2: "bbb"} +{1, 2, 3} +``` + ## 実装例 ```cpp template diff --git a/reference/format/formatter.md b/reference/format/formatter.md index 7c882484aa..053e1069f0 100644 --- a/reference/format/formatter.md +++ b/reference/format/formatter.md @@ -18,6 +18,12 @@ namespace std { template ... Ts> struct formatter, charT>; // (3) C++23 + + template Container, + class... U> + struct formatter, charT>; // (4) C++23 } ``` * ranges::input_range[link /reference/ranges/input_range.md] @@ -33,6 +39,7 @@ namespace std { - (1) : デフォルトのフォーマット - (2) : Range用のフォーマット。実装は[`range-default-formatter`](range-default-formatter.md.nolink)クラスが行う - (3) : [`std::pair`](/reference/utility/pair.md)と[`std::tuple`](/reference/tuple/tuple.md)に対する特殊化 +- (4) : コンテナアダプタである[`std::queue`](/reference/queue/queue.md)、[`std::priority_queue`](/reference/queue/priority_queue.md)、[`std::stack`](/reference/stack/stack.md)に対する特殊化 (1)は、`charT`を`char`または`wchar_t`とすると、標準で以下の特殊化が利用できる。 diff --git a/reference/format/formatter/format.md b/reference/format/formatter/format.md index fb49958895..b15b0553c3 100644 --- a/reference/format/formatter/format.md +++ b/reference/format/formatter/format.md @@ -6,15 +6,26 @@ * cpp20[meta cpp] ```cpp +using maybe-const-adaptor = + fmt-maybe-const, charT>; // 説明専用 + template typename FormatContext::iterator - format(T& x, FormatContext& ctx) const; + format(T& x, FormatContext& ctx) const; // (1) C++20 + +template +typename FormatContext::iterator + format(maybe-const-adaptor& r, FormatContext& ctx) const; // (2) C++23 ``` * FormatContext[link /reference/format/basic_format_context.md] +* fmt-maybe-const[link /reference/format/fmt-maybe-const.md] ## 概要 受け取った型`T`のオブジェクトを書式化する。 +- (1) : デフォルトの`formatter`および、[`std::pair`](/reference/utility/pair.md)と[`std::tuple`](/reference/tuple/tuple.md)に対する`formatter`の特殊化でのシグニチャ +- (2) : コンテナアダプタに対する特殊化でのシグニチャ + ## 効果 - [`parse()`](parse.md)メンバ関数で解析した書式文字列の指定に基づいて、`x`の値を文字列に変換する @@ -24,6 +35,15 @@ typename FormatContext::iterator - `I != 0`であれば区切り文字を出力する - タプルの`I`番目の要素を、その型の`formatter`で出力する - 閉じカッコを出力する +- コンテナアダプタに対する特殊化の場合、メンバとして以下を持っているとして、 + ```cpp + formatter underlying_; + ``` + + - 以下と等価: + ```cpp + return underlying_.format(r.c, ctx); + ``` ## 戻り値 diff --git a/reference/format/formatter/parse.md b/reference/format/formatter/parse.md index 2d4f6ab239..8f73eb06ee 100644 --- a/reference/format/formatter/parse.md +++ b/reference/format/formatter/parse.md @@ -23,6 +23,15 @@ constexpr typename ParseContext::iterator - 全体の囲み文字を、[`set_brackets()`](set_brackets.md)メンバ関数で設定する - 要素の区切り文字を、[`set_separator()`](set_separator.md)メンバ関数で設定する - 各要素の`formatter`を`e`として、[`e.set_debug_format()`](set_debug_format.md)が有効な式であれば、それを呼び出してデバッグ書式を有効にする +- コンテナアダプタに対する特殊化の場合、メンバとして以下を持っているとして、 + ```cpp + formatter underlying_; + ``` + + - 以下と等価: + ```cpp + return underlying_.parse(ctx); + ``` ## 戻り値 From f34854cf613a91f73823e1270b3eee6bca9dac9b Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 26 Jan 2023 22:51:58 +0900 Subject: [PATCH 0108/3948] =?UTF-8?q?expected:=20unexpected,unexpect=5Ft,b?= =?UTF-8?q?ad=5Fexpected=5Faccess=E6=A6=82=E8=A6=81(#1066)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/expected.md | 6 +- reference/expected/bad_expected_access.md | 81 ++++++++++++++ reference/expected/expected.md | 12 ++- reference/expected/unexpect_t.md | 61 +++++++++++ reference/expected/unexpected.md | 126 ++++++++++++++++++++++ 5 files changed, 278 insertions(+), 8 deletions(-) create mode 100644 reference/expected/bad_expected_access.md create mode 100644 reference/expected/unexpect_t.md create mode 100644 reference/expected/unexpected.md diff --git a/reference/expected.md b/reference/expected.md index 3794925f44..1c16e793e0 100644 --- a/reference/expected.md +++ b/reference/expected.md @@ -8,9 +8,9 @@ | 名前 | 説明 | 対応バージョン | |-----------------|----------------|-------| | [`expected`](expected/expected.md) | 正常値かエラー値を保持するオブジェクト (class template) | C++23 | -| [`unexpected`](expected/unexpected.md.nolink) | エラー値の代入補助クラス (class template) | C++23 | -| [`unexpect_t`](expected/unexpect_t.md.nolink) | エラー値の直接構築を指示するタグ型 (class) | C++23 | -| [`bad_expected_access`](expected/bad_expected_access.md.nolink) | エラー値保持時に正常値へアクセスした場合に発生する例外 (class template) | C++23 | +| [`unexpected`](expected/unexpected.md) | エラー値の代入補助クラス (class template) | C++23 | +| [`unexpect_t`](expected/unexpect_t.md) | エラー値の直接構築を指示するタグ型 (class) | C++23 | +| [`bad_expected_access`](expected/bad_expected_access.md) | エラー値保持時に正常値へアクセスした場合に発生する例外 (class template) | C++23 | ## バージョン diff --git a/reference/expected/bad_expected_access.md b/reference/expected/bad_expected_access.md new file mode 100644 index 0000000000..b4ec99ce13 --- /dev/null +++ b/reference/expected/bad_expected_access.md @@ -0,0 +1,81 @@ +# bad_expected_access +* expected[meta header] +* class template[meta id-type] +* std[meta namespace] +* cpp23[meta cpp] + +```cpp +namespace std { + template + class bad_expected_access : public bad_expected_access { ... }; + + // void特殊化 + template<> + class bad_expected_access : public exception { ... }; +} +``` +* exception[link /reference/exception/exception.md] + +## 概要 +`bad_expected_access`は、[`expected`](expected.md)オブジェクトがエラー値を保持しているとき正常値にアクセスした場合に発生する例外である。 + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|-----------------|----------------|-------| +| [`(constructor)`](bad_expected_access/op_constructor.md.nolink) | コンストラクタ | C++23 | +| `(destructor)` | デストラクタ | C++23 | +| [`error`](bad_expected_access/error.md.nolink) | エラー値を取得する | C++23 | +| [`what`](bad_expected_access/what.md.nolink) | エラー理由の文字列を取得する | C++23 | + + +## 例 +```cpp example +#include +#include +#include +#include + +int main() +{ + std::expected x = std::unexpected{"invalid"}; + + try { + assert(not x.has_value()); + int value = x.value(); // bad_expected_access例外発生 + std::cout << "value: " << value << std::endl; + } + catch (const std::bad_expected_access& ex) { + std::cout << "error: " << ex.error() << std::endl; + } +} +``` +* std::bad_expected_access[color ff0000] +* std::unexpected[link unexpected.md] + +### 出力 +``` +error: invalid +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`expected`](expected.md) +- [`bad_optional_access`](/reference/optional/bad_optional_access.md) + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) +- [P2549R1 `std::unexpected` should have `error()` as member accessor](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2549r1.html) diff --git a/reference/expected/expected.md b/reference/expected/expected.md index b10bda8928..d05209c378 100644 --- a/reference/expected/expected.md +++ b/reference/expected/expected.md @@ -67,8 +67,8 @@ namespace std { | 名前 | 説明 | 対応バージョン | |--------------|------------|-------| -| `operator==` | 等値比較 | C++23 | -| `operator!=` | 非等値比較 | C++23 | +| [`operator==`](unexpected/op_equal.md.nolink) | 等値比較 | C++23 | +| [`operator!=`](unexpected/op_not_equal.md.nolink) | 非等値比較 | C++23 | ## メンバ型 @@ -77,7 +77,7 @@ namespace std { |-------------------|-----------------|-------| | `value_type` | 正常値の型`T` | C++23 | | `error_type` | エラー値の型`E` | C++23 | -| `unexpected_type` | [`unexpected`](unexpected.md.nolink) | C++23 | +| `unexpected_type` | [`unexpected`](unexpected.md) | C++23 | | `template rebind` | `expected` | C++23 | @@ -117,12 +117,13 @@ int main() } ``` * std::expected[color ff0000] +* std::unexpected[link unexpected.md] ### 出力 ``` 5 -out of domain -divide by zero +"out of domain" +"divide by zero" ``` @@ -138,6 +139,7 @@ divide by zero ## 関連項目 +- [`unexpected`](unexpected.md) - [`optional`](/reference/optional/optional.md) diff --git a/reference/expected/unexpect_t.md b/reference/expected/unexpect_t.md new file mode 100644 index 0000000000..9dd3e2d9bb --- /dev/null +++ b/reference/expected/unexpect_t.md @@ -0,0 +1,61 @@ +# unexpect_t +* expected[meta header] +* class[meta id-type] +* std[meta namespace] +* cpp23[meta cpp] + +```cpp +namespace std { + struct unexpect_t { + explicit unexpect_t() = default; + }; + + inline constexpr unexpect_t {}; +} +``` + +## 概要 +`unexpected_t`は、[`expected`コンストラクタ](expected/op_constructor.md.nolink)において、エラー値型のコンストラクタ引数を受け取って構築するためのタグ型である。 + +`unexpected_t`型の定数`unexpect`が提供される。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::expected x{std::unexpect, ETIMEDOUT, std::system_category()}; + assert(not x.has_value()); + assert(x.error().value() == ETIMEDOUT); + assert(x.error().category() == std::system_category()); +} +``` +* std::unexpect[color ff0000] +* ETIMEDOUT[link /reference/system_error/errc.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`expected`](expected.md) + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) diff --git a/reference/expected/unexpected.md b/reference/expected/unexpected.md new file mode 100644 index 0000000000..101eb5115f --- /dev/null +++ b/reference/expected/unexpected.md @@ -0,0 +1,126 @@ +# unexpected +* expected[meta header] +* class template[meta id-type] +* std[meta namespace] +* cpp23[meta cpp] + +```cpp +namespace std { + template + class unexpected; +} +``` + +## 概要 +`unexpected`クラスは、任意の型`E`の値をエラー値として表現する。 + + +## 適格要件 +`E`は非オブジェクト型、配列型、`unexpected`、CV修飾された型のいずれでもないこと。 + + +## メンバ関数 +### 構築・破棄 + +| 名前 | 説明 | 対応バージョン | +|-----------------|----------------|-------| +| [`(constructor)`](unexpected/op_constructor.md.nolink) | コンストラクタ | C++23 | +| [`(destructor)`](unexpected/op_destructor.md.nolink) | デストラクタ | C++23 | + +### 代入 + +| 名前 | 説明 | 対応バージョン | +|-----------------|----------------|-------| +| [`operator=`](unexpected/op_assign.md.nolink) | 代入演算子 | C++23 | +| [`swap`](unexpected/swap.md.nolink) | 他の`unexpected`オブジェクトとデータを入れ替える | C++23 | + +### 値の観測 + +| 名前 | 説明 | 対応バージョン | +|-----------------|----------------|-------| +| [`error`](unexpected/error.md.nolink) | エラー値を取得する | C++23 | + +### 比較 + +| 名前 | 説明 | 対応バージョン | +|--------------|------------|-------| +| [`operator==`](unexpected/op_equal.md.nolink) | 等値比較 | C++23 | +| [`operator!=`](unexpected/op_not_equal.md.nolink) | 非等値比較 | C++23 | + + +## 非メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|-------| +| [`swap`](unexpected/swap_free.md.nolink) | 他の`unexpected`オブジェクトとデータを入れ替える | C++23 | + +## 推論補助 + +| 名前 | 説明 | 対応バージョン | +|------|------|-------| +| [`(deduction_guide)`](unexpected/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | + + +## 例 +```cpp example +#include +#include +#include +#include + +// 整数除算 +std::expected idiv(int a, int b) +{ + if (b == 0) { + return std::unexpected{"divide by zero"}; + } + if (a % b != 0) { + return std::unexpected{"out of domain"}; + } + return a / b; +} + +void dump_result(const std::expected& v) +{ + if (v) { + std::cout << *v << std::endl; + } else { + std::cout << std::quoted(v.error()) << std::endl; + } +} + +int main() +{ + dump_result(idiv(10, 2)); + dump_result(idiv(10, 3)); + dump_result(idiv(10, 0)); +} +``` +* std::unexpected[color ff0000] + +### 出力 +``` +5 +"out of domain" +"divide by zero" +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`expected`](expected.md) + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) +- [P2549R1 `std::unexpected` should have `error()` as member accessor](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2549r1.html) From 1d666c610ffc9418a8f2b397b11e613ccfa6ca84 Mon Sep 17 00:00:00 2001 From: I <1091761+wx257osn2@users.noreply.github.com> Date: Fri, 27 Jan 2023 01:00:27 +0900 Subject: [PATCH 0109/3948] fix missing variable name --- reference/expected/unexpect_t.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/expected/unexpect_t.md b/reference/expected/unexpect_t.md index 9dd3e2d9bb..03ee4f5c62 100644 --- a/reference/expected/unexpect_t.md +++ b/reference/expected/unexpect_t.md @@ -10,7 +10,7 @@ namespace std { explicit unexpect_t() = default; }; - inline constexpr unexpect_t {}; + inline constexpr unexpect_t unexpect{}; } ``` From e92dbda8d6943d59800e65802678279cbec5ee7d Mon Sep 17 00:00:00 2001 From: I <1091761+wx257osn2@users.noreply.github.com> Date: Fri, 27 Jan 2023 01:00:45 +0900 Subject: [PATCH 0110/3948] add link --- reference/expected/unexpected.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/expected/unexpected.md b/reference/expected/unexpected.md index 101eb5115f..d38727ae3d 100644 --- a/reference/expected/unexpected.md +++ b/reference/expected/unexpected.md @@ -97,6 +97,7 @@ int main() } ``` * std::unexpected[color ff0000] +* std::expected[link expected.md] ### 出力 ``` From c0e60600cf7f49f89512999e5cf3aa13dcff1747 Mon Sep 17 00:00:00 2001 From: I <1091761+wx257osn2@users.noreply.github.com> Date: Fri, 27 Jan 2023 01:35:02 +0900 Subject: [PATCH 0111/3948] add link --- reference/expected/expected.md | 1 + reference/expected/unexpected.md | 1 + reference/string/basic_string.md | 1 + 3 files changed, 3 insertions(+) diff --git a/reference/expected/expected.md b/reference/expected/expected.md index d05209c378..3984d89de9 100644 --- a/reference/expected/expected.md +++ b/reference/expected/expected.md @@ -118,6 +118,7 @@ int main() ``` * std::expected[color ff0000] * std::unexpected[link unexpected.md] +* std::quoted[link ../iomanip/quoted.md] ### 出力 ``` diff --git a/reference/expected/unexpected.md b/reference/expected/unexpected.md index d38727ae3d..5b82dc97d5 100644 --- a/reference/expected/unexpected.md +++ b/reference/expected/unexpected.md @@ -98,6 +98,7 @@ int main() ``` * std::unexpected[color ff0000] * std::expected[link expected.md] +* std::quoted[link ../iomanip/quoted.md] ### 出力 ``` diff --git a/reference/string/basic_string.md b/reference/string/basic_string.md index 3480d5efd8..9e656c1df5 100644 --- a/reference/string/basic_string.md +++ b/reference/string/basic_string.md @@ -287,6 +287,7 @@ int main() static_assert(f()); } ``` +* s.data()[link basic_string/data.md] ## 参照 - [N2668 Concurrency Modifications to Basic String](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2668.htm) From 2513346aaefb6f93d4740367084d9f30d30a05aa Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 27 Jan 2023 16:28:04 +0900 Subject: [PATCH 0112/3948] =?UTF-8?q?=20:=20range-default-formatte?= =?UTF-8?q?r=E3=82=92=E8=BF=BD=E5=8A=A0=20#1085?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format.md | 2 +- reference/format/formatter.md | 4 +- reference/format/range-default-formatter.md | 97 +++++++++++++++++++++ reference/format/range_formatter.md | 4 +- 4 files changed, 103 insertions(+), 4 deletions(-) create mode 100644 reference/format/range-default-formatter.md diff --git a/reference/format.md b/reference/format.md index 0fb6081f58..458e42a680 100644 --- a/reference/format.md +++ b/reference/format.md @@ -37,7 +37,7 @@ | [`const-formattable-range`](format/const-formattable-range.md) | `const Range`の要素型が文字列フォーマット可能 (concept) | C++23 | | [`fmt-maybe-const`](format/fmt-maybe-const.md) | `formatter::format()`関数のパラメータ型として使用するための(const) Range型を取得 (type-alias) | C++23 | | [`range_formatter`](format/range_formatter.md) | Rangeに対する書式文字列の解析、値のフォーマットを行う (class template) | C++23 | -| [`range-default-formatter`](format/range-default-formatter.md.nolink) | Rangeに対する共通の書式文字列の解析、値のフォーマットを行う説明専用クラス (class template) | C++23 | +| [`range-default-formatter`](format/range-default-formatter.md) | Rangeに対する共通の書式文字列の解析、値のフォーマットを行う説明専用クラス (class template) | C++23 | ## 引数 diff --git a/reference/format/formatter.md b/reference/format/formatter.md index 053e1069f0..0106bb135e 100644 --- a/reference/format/formatter.md +++ b/reference/format/formatter.md @@ -31,13 +31,13 @@ namespace std { * range_format[link range_format.md] * formattable[link formattable.md] * ranges::range_reference_t[link /reference/ranges/range_reference_t.md] -* range-default-formatter[link range-default-formatter.md.nolink] +* range-default-formatter[link range-default-formatter.md] ## 概要 フォーマット引数の個々の型に対応する書式文字列の解析と値のフォーマットを担うクラス。 - (1) : デフォルトのフォーマット -- (2) : Range用のフォーマット。実装は[`range-default-formatter`](range-default-formatter.md.nolink)クラスが行う +- (2) : Range用のフォーマット。実装は[`range-default-formatter`](range-default-formatter.md)クラスが行う - (3) : [`std::pair`](/reference/utility/pair.md)と[`std::tuple`](/reference/tuple/tuple.md)に対する特殊化 - (4) : コンテナアダプタである[`std::queue`](/reference/queue/queue.md)、[`std::priority_queue`](/reference/queue/priority_queue.md)、[`std::stack`](/reference/stack/stack.md)に対する特殊化 diff --git a/reference/format/range-default-formatter.md b/reference/format/range-default-formatter.md new file mode 100644 index 0000000000..3d5c97b1e5 --- /dev/null +++ b/reference/format/range-default-formatter.md @@ -0,0 +1,97 @@ +# range-default-formatter +* format[meta header] +* class template[meta id-type] +* std[meta namespace] +* cpp23[meta cpp] + +```cpp +namespace std { + template + struct range-default-formatter; // (1) C++23 + + template + struct range-default-formatter< + range_format::sequence, R, charT>; // (2) C++23 + + template + struct range-default-formatter< + range_format::map, R, charT>; // (3) C++23 + + template + struct range-default-formatter< + range_format::set, R, charT>; // (4) C++23 + + template + requires (K == range_format::string || K == range_format::debug_string) + struct range-default-formatter< + K, R, charT>; // (5) C++23 +} +``` +* range_format[link range_format.md] +* ranges::input_range[link /reference/ranges/input_range.md] + +## 概要 +`range-default-formatter`は、Range・コンテナに対するデフォルトの書式解析と書式文字列化を行う説明専用クラスである。 + +このクラスは、[`formatter`](formatter.md)クラスのRange・コンテナに対する特殊化実装として標準ライブラリの内部で使用される。 + +このクラスの内部実装として[`range_formatter`](range_formatter.md)が使用される。 + + +- (1) : プライマリテンプレート。宣言のみ +- (2) : Range・シーケンスコンテナに対する特殊化。デバッグ出力の有効化と、`[a, b, c]`形式の出力を行う +- (3) : [`std::map`](/reference/map/map.md)や[`std::flat_map`](/reference/flat_map/flat_map.md.nolink)などの連想コンテナに対する特殊化。デバッグ出力の有効化と、`{1: a, 2: b}`形式での出力を行う +- (4) : [`std::set`](/reference/set/set.md)や[`std::flat_set`](/reference/flat_set/flat_set.md.nolink)などの集合コンテナに対する特殊化。デバッグ出力の有効化と、`{a, b, c}`形式の出力を行う +- (5) : 文字列形式の出力を行うRangeに対する特殊化。Rangeを文字列として出力し、[`range_format::debug_string`](range_format.md)指定であればデバッグ文字列として出力する + + +## 備考 +- (5) : この特殊化は規格上、標準ライブラリ内では使用されないが ([`formatter`](formatter.md)`<`[`string`](/reference/string/basic_string.md)`, charT>`がすでにある)、以下のような用途が考えられる + - ユーザー定義の文字列クラスを定義する場合に、[`format_kind`](format_kind.md)で値として[`range_format::string`](range_format.md)もしくは[`range_format::debug_string`](range_format.md)をもつよう特殊化するか ([`formatter`](formatter.md)`<`[`string`](/reference/string/basic_string.md)`, charT>`をラップする方がかんたんではある) + - [`std::vector`](/reference/vector/vector.md)のような文字を要素とするシーケンスコンテナで、文字列形式で出力する書式オプション ([`s`や`?s`](format.md#range-format-options)) を指定した際に`range-default-formatter`の内部で使用される + + +## メンバ関数 + +| メンバ関数 | 説明 | 対応バージョン | +|------------|------|----------------| +| `parse` | 書式の解析を行う | C++23 | +| `format` | 書式化を行う | C++23 | + + +### sequenceに対する特殊化 + +| メンバ関数 | 説明 | 対応バージョン | +|------------|------|----------------| +| `constexpr void set_separator(basic_string_view sep);` | 要素の区切り文字を設定する | C++23 | +| `constexpr void set_brackets(basic_string_view opening, basic_string_view closing);` | 全体の囲み文字を設定する | C++23 | + + +### mapに対する特殊化 + +| メンバ関数 | 説明 | 対応バージョン | +|------------|------|----------------| +| `constexpr range-default-formatter();` | 全体の囲み文字を`{}`、要素の囲み文字を空、要素同士の区切り文字を`": "`に設定する | C++23 | + +### setに対する特殊化 + +| メンバ関数 | 説明 | 対応バージョン | +|------------|------|----------------| +| `constexpr range-default-formatter();` | 全体の囲み文字を`{}`に設定する | C++23 | + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2286R8 Formatting Ranges](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2286r8.html) +- [P2585R1 Improve default container formatting](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2585r1.html) + - C++23から、Range・コンテナ、`pair`、`tuple`のフォーマット出力、および文字・文字列のデバッグ指定 (`"?"`) が追加された diff --git a/reference/format/range_formatter.md b/reference/format/range_formatter.md index c2d5c38f5e..71ff8a66f8 100644 --- a/reference/format/range_formatter.md +++ b/reference/format/range_formatter.md @@ -16,6 +16,8 @@ namespace std { ## 概要 `range_formatter`は、Range・コンテナに対する[`formatter`](formatter.md)クラスの特殊化を実装するためのユーティリティクラスである。 +このクラスは、説明専用クラス[`range-default-formatter`](range-default-formatter.md)の内部実装として使用される。 + ユーザー定義のコンテナ・RangeをRange書式に対応する場合は、以下のようにする: - オリジナル書式を定義しないのであれば、このクラスではなく、[`format_kind`](format_kind.md)を特殊化する @@ -148,7 +150,7 @@ aa:bb:cc:dd:ee:ff - [Visual C++](/implementation.md#visual_cpp): ?? ## 関連項目 -- [`range-default-formatter`](range-default-formatter.md.nolink) +- [`range-default-formatter`](range-default-formatter.md) - [`formatter`](formatter.md) From f216f9febdb4ded06f2ad999933927d694b52765 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 27 Jan 2023 16:39:33 +0900 Subject: [PATCH 0113/3948] =?UTF-8?q?vector::reference=E3=81=AB?= =?UTF-8?q?=E5=AF=BE=E3=81=99=E3=82=8Bformatter=E3=81=AE=E7=89=B9=E6=AE=8A?= =?UTF-8?q?=E5=8C=96=E3=82=92=E8=BF=BD=E5=8A=A0=20#1085?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/format.md | 22 ++++++++++++++++++++++ reference/format/formatter.md | 5 +++++ reference/vector/vector.md | 12 ++++++++++-- 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/reference/format/format.md b/reference/format/format.md index 09bbcb1fd6..b372bf8f75 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -504,6 +504,28 @@ int main() {1, 2, 3} ``` +### vectorを出力する (C++23) +```cpp example +```cpp example +#include +#include +#include + +int main() +{ + // vectorは1要素あたり1bitのみ領域を使用するよう特殊化されている。 + // しかし、出力としては通常のbool配列と同様になるようformatterが特殊化されている + std::vector v = {true, false, true}; + + std::cout << std::format("{}", v) << std::endl; +} +``` + +#### 出力 +``` +[true, false, true] +``` + ## 実装例 ```cpp template diff --git a/reference/format/formatter.md b/reference/format/formatter.md index 0106bb135e..4de6df6b06 100644 --- a/reference/format/formatter.md +++ b/reference/format/formatter.md @@ -41,6 +41,7 @@ namespace std { - (3) : [`std::pair`](/reference/utility/pair.md)と[`std::tuple`](/reference/tuple/tuple.md)に対する特殊化 - (4) : コンテナアダプタである[`std::queue`](/reference/queue/queue.md)、[`std::priority_queue`](/reference/queue/priority_queue.md)、[`std::stack`](/reference/stack/stack.md)に対する特殊化 + (1)は、`charT`を`char`または`wchar_t`とすると、標準で以下の特殊化が利用できる。 - 1 以下のもの。 @@ -238,6 +239,10 @@ int main() - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? +## 関連項目 +- [`vector`](/reference/vector/vector.md) + + ## 参照 - [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) - [{fmt}](https://github.com/fmtlib/fmt) diff --git a/reference/vector/vector.md b/reference/vector/vector.md index 97f1244105..d29357f077 100644 --- a/reference/vector/vector.md +++ b/reference/vector/vector.md @@ -189,7 +189,7 @@ public: } ``` -## ハッシュサポート +### ハッシュサポート | 名前 | 説明 | 対応バージョン | |--------------------------------------------------------------------|------------------------------------------|-------| @@ -197,6 +197,13 @@ public: | `template struct hash>;` | `hash`クラスの`vector`に対する特殊化 | C++11 | +### 文字列フォーマットサポート + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `template requires is-vector-bool-reference`
`struct formatter;` | `vector::reference`を`bool`として出力するための[`formatter`](/reference/format/formatter.md)の特殊化 | C++23 | + + ## 例 ### 基本的な使い方 (C++11) ```cpp example @@ -430,4 +437,5 @@ int main() - 可変長のビット配列の実装としては、Boost C++ Librariesの[`dynamic_bitset`](http://www.boost.org/doc/libs/release/libs/dynamic_bitset/dynamic_bitset.html)がある。 - [N2669 Thread-Safety in the Standard Library (Rev 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2669.htm) - [N4510 Minimal incomplete type support for standard containers, revision 4](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4510.html) - +- [P2286R8 Formatting Ranges](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2286r8.html) + - C++23から、Range・コンテナ、`pair`、`tuple`のフォーマット出力、および文字・文字列のデバッグ指定 (`"?"`) が追加された From b2de7cae247187b6cacc107f68aa0afec3c7ef0c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 27 Jan 2023 16:45:53 +0900 Subject: [PATCH 0114/3948] =?UTF-8?q?HTML=E3=81=B8=E3=81=AE=E5=A4=89?= =?UTF-8?q?=E6=8F=9B=E3=82=A8=E3=83=A9=E3=83=BC=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/format.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/format/format.md b/reference/format/format.md index b372bf8f75..cac2cb3e86 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -504,7 +504,7 @@ int main() {1, 2, 3} ``` -### vectorを出力する (C++23) +### `vector`を出力する (C++23) ```cpp example ```cpp example #include From c77af98f9553e4515f55edd53f96e65f1c58dc22 Mon Sep 17 00:00:00 2001 From: tshino Date: Sat, 28 Jan 2023 12:53:01 +0900 Subject: [PATCH 0115/3948] Fix typo cc: @faithandbrave --- start_editing/directory_structure.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/start_editing/directory_structure.md b/start_editing/directory_structure.md index ff75d1bab4..a47a004f2e 100644 --- a/start_editing/directory_structure.md +++ b/start_editing/directory_structure.md @@ -14,7 +14,7 @@ reference階層とmodule階層は上記以外は同じであるため、以下 ### ヘッダ・モジュール階層 - ヘッダ・モジュール階層以下に、それに所属している機能のページを置く - どのヘッダ・モジュールにも属さない機能の場合は、以下のように対応する - - 全体で使用する説明専用の機能は、仮のヘッダ``に属するものとして記載する + - 全体で使用する説明専用の機能は、仮のヘッダ``に属するものとして記載する ### クラス階層 From 7e9e00dcdfb90c4507302201a4b8a69b8dbab683 Mon Sep 17 00:00:00 2001 From: yoh Date: Sat, 28 Jan 2023 22:58:55 +0900 Subject: [PATCH 0116/3948] =?UTF-8?q?expected/expected:=20=E3=82=B3?= =?UTF-8?q?=E3=83=B3=E3=82=B9=E3=83=88=E3=83=A9=E3=82=AF=E3=82=BF,?= =?UTF-8?q?=E3=83=87=E3=82=B9=E3=83=88=E3=83=A9=E3=82=AF=E3=82=BF(#1066)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/expected/expected.md | 4 +- reference/expected/expected/op_constructor.md | 318 ++++++++++++++++++ reference/expected/expected/op_destructor.md | 37 ++ reference/expected/unexpect_t.md | 2 +- 4 files changed, 358 insertions(+), 3 deletions(-) create mode 100644 reference/expected/expected/op_constructor.md create mode 100644 reference/expected/expected/op_destructor.md diff --git a/reference/expected/expected.md b/reference/expected/expected.md index 3984d89de9..be26126024 100644 --- a/reference/expected/expected.md +++ b/reference/expected/expected.md @@ -31,8 +31,8 @@ namespace std { | 名前 | 説明 | 対応バージョン | |-----------------|----------------|-------| -| [`(constructor)`](expected/op_constructor.md.nolink) | コンストラクタ | C++23 | -| [`(destructor)`](expected/op_destructor.md.nolink) | デストラクタ | C++23 | +| [`(constructor)`](expected/op_constructor.md) | コンストラクタ | C++23 | +| [`(destructor)`](expected/op_destructor.md) | デストラクタ | C++23 | ### 代入 diff --git a/reference/expected/expected/op_constructor.md b/reference/expected/expected/op_constructor.md new file mode 100644 index 0000000000..98779f4788 --- /dev/null +++ b/reference/expected/expected/op_constructor.md @@ -0,0 +1,318 @@ +# コンストラクタ +* expected[meta header] +* function[meta id-type] +* std[meta namespace] +* expected[meta class] +* cpp23[meta cpp] + +```cpp +constexpr expected(); // (1) +constexpr expected(const expected&); // (2) +constexpr expected(expected&&) noexcept(see below); // (3) + +template +constexpr explicit(see below) expected(const expected&); // (4) +template +constexpr explicit(see below) expected(expected&&); // (5) + +template +constexpr explicit(see below) expected(U&& v); // (6) + +template +constexpr explicit(see below) expected(const unexpected&); // (7) +template +constexpr explicit(see below) expected(unexpected&&); // (8) + +template +constexpr explicit expected(in_place_t, Args&&...); // (9) +template +constexpr explicit expected(in_place_t, initializer_list, Args&&...); // (10) + +template +constexpr explicit expected(unexpect_t, Args&&...); // (11) +template +constexpr explicit expected(unexpect_t, initializer_list, Args&&...); // (12) +``` +* see below[italic] +* unexpected[link ../unexpected.md] +* unexpect_t[link ../unexpect_t.md] +* in_place_t[link /reference/utility/in_place_t.md] + +## 概要 +- (1) : 正常値型`T`を値初期化して保持する。 +- (2) : コピーコンストラクタ。 +- (3) : ムーブコンストラクタ。 +- (4) : 変換可能な`expected`オブジェクトからコピー構築する。 +- (5) : 変換可能な`expected`オブジェクトからムーブ構築する。 +- (6) : 正常値型`T`に変換可能な型`U`の値を正常値として受け取り、コピーまたはムーブして保持する。 +- (7) : 変換可能な[`unexpected`](../unexpected.md)オブジェクトかエラー値をコピー構築する。 +- (8) : 変換可能な[`unexpected`](../unexpected.md)オブジェクトからエラー値をムーブ構築する。 +- (9) : 正常値型`T`のコンストラクタ引数として任意個の引数を受け取って、コンストラクタ内で型`T`のオブジェクトを有効値として生成し、保持する。 +- (10) : 正常値型`T`のコンストラクタ引数として初期化子リストと任意個の引数を受け取って、コンストラクタ内で型`T`のオブジェクトを有効値として生成し、保持する。 +- (11) : エラー値型`E`のコンストラクタ引数として任意個の引数を受け取って、コンストラクタ内で型`E`のオブジェクトを有効値として生成し、保持する。 +- (12) : エラー値型`E`のコンストラクタ引数として初期化子リストと任意個の引数を受け取って、コンストラクタ内で型`E`のオブジェクトを有効値として生成し、保持する。 + + +説明用のテンプレート変数`converts-from-any-cvref`を次の通り定義する。 + +```cpp +template +constexpr bool converts-from-any-cvref = + disjunction_v, is_convertible, + is_constructible, is_convertible, + is_constructible, is_convertible, + is_constructible, is_convertible>; +``` +* disjunction_v[link /reference/type_traits/disjunction.md] +* is_constructible[link /reference/type_traits/is_constructible.md] +* is_convertible[link /reference/type_traits/is_convertible.md] + + +## テンプレートパラメータ制約 +- (1) : [`is_default_constructible_v`](/reference/type_traits/is_default_constructible.md)` == true` +- (3) : [`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)` == true`[`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)` == true` +- (4) : 次の制約を全て満たすこと + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true` + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true` + - `converts-from-any-cvref> == false` + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)`<`[`unexpected`](../unexpected.md)`, expected&> == false` + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)`<`[`unexpected`](../unexpected.md)`, expected> == false` + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)`<`[`unexpected`](../unexpected.md)`, const expected&> == false` + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)`<`[`unexpected`](../unexpected.md)`, const expected> == false` +- (5) : 次の制約を全て満たすこと + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true` + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true` + - `converts-from-any-cvref> == false` + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)`<`[`unexpected`](../unexpected.md)`, expected&> == false` + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)`<`[`unexpected`](../unexpected.md)`, expected> == false` + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)`<`[`unexpected`](../unexpected.md)`, const expected&> == false` + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)`<`[`unexpected`](../unexpected.md)`, const expected> == false` +- (6) : 次の制約を全て満たすこと + - [`is_same_v`](/reference/type_traits/is_same.md)`<`[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`,` [`in_place_t`](/reference/utility/in_place_t.md)`> == false` + - [`is_same_v`](/reference/type_traits/is_same.md)`> == false` + - [`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``は[`unexpected`](../unexpected.md)の特殊化でない + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true` +- (7) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true` +- (8) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true` +- (9) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true` +- (10) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)`&, Args...> == true` +- (11) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true` +- (12) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)`&, Args...> == true` + + +## 効果 +- (1) : 正常値を値初期化して保持する。 +- (2) : `rhs`が正常値を保持していれば、[`*rhs`](op_deref.md.nolink)で正常値を直接非リスト初期化する。そうでなければ、`rhs.`[`error()`](error.md.nolink)でエラー値を直接非リスト初期化する。 +- (3) : `rhs`が正常値を保持していれば、[`std::move`](/reference/utility/move.md)`(`[`*rhs`](op_deref.md.nolink)`)`で正常値を直接非リスト初期化する。そうでなければ、[`std::move`](/reference/utility/move.md)`(rhs.`[`error()`](error.md.nolink)`)`でエラー値を直接非リスト初期化する。 +- (4) : `rhs`が正常値を保持していれば、[`std::forward`](/reference/utility/forward.md)`(`[`*rhs`](op_deref.md.nolink)`)`で正常値を直接非リスト初期化する。そうでなければ、[`std::forward`](/reference/utility/forward.md)`(rhs.`[`error()`](error.md.nolink)`)`でエラー値を直接非リスト初期化する。 +- (5) : `rhs`が正常値を保持していれば、[`std::forward`](/reference/utility/forward.md)`(`[`*rhs`](op_deref.md.nolink)`)`で正常値を直接非リスト初期化する。そうでなければ、[`std::forward`](/reference/utility/forward.md)`(rhs.`[`error()`](error.md.nolink)`)`でエラー値を直接非リスト初期化する。 +- (6) : [`std::forward`](/reference/utility/forward.md)`(v)`で正常値を直接非リスト初期化する。 +- (7) : [`std::forward`](/reference/utility/forward.md)`(rhs.`[`error()`](error.md.nolink)`)`でエラー値を直接非リスト初期化する。 +- (8) : [`std::forward`](/reference/utility/forward.md)`(rhs.`[`error()`](error.md.nolink)`)`でエラー値を直接非リスト初期化する。 +- (9) : [`std::forward`](/reference/utility/forward.md)`(args)...`で正常値を直接非リスト初期化する。 +- (10) : `il,` [`std::forward`](/reference/utility/forward.md)`(args)...`で正常値を直接非リスト初期化する。 +- (11) : [`std::forward`](/reference/utility/forward.md)`(args)...`でエラー値を直接非リスト初期化する。 +- (12) : `il,` [`std::forward`](/reference/utility/forward.md)`(args)...`でエラー値を直接非リスト初期化する。 + + +## 事後条件 +- (1) : 有効値を保持している。 +- (2) : `rhs`が有効値を保持する場合は`*this`も有効値を保持し、`rhs`がエラー値を保持する場合は`*this`もエラー値を保持する。 +- (3) : `rhs`が有効値を保持する場合は`*this`も有効値を保持し、`rhs`がエラー値を保持する場合は`*this`もエラー値を保持する。`rhs.`[`has_value()`](has_value.md.nolink)は変化しない。 +- (4), (5) : `rhs`が有効値を保持する場合は`*this`も有効値を保持し、`rhs`がエラー値を保持する場合は`*this`もエラー値を保持する。`rhs.`[`has_value()`](has_value.md.nolink)は変化しない。 +- (6) : 有効値を保持している。 +- (7), (8) : エラー値を保持している。 +- (9), (10) : 有効値を保持している。 +- (11), (12) : エラー値を保持している。 + + +## 例外 +- (1) : 正常値型の初期化から送出される例外。 +- (2) : 正常値型またはエラー値型の初期化から送出される例外。 +- (3) : 正常値型またはエラー値型の初期化から送出される例外。 + - [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)``かつ[`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)``であれば、ムーブコンストラクタはnoexpcet指定される。 +- (4), (5) : 正常値型またはエラー値型の初期化から送出される例外。 +- (6) : 正常値型の初期化から送出される例外。 +- (7), (8) : エラー値型の初期化から送出される例外。 +- (9), (10) : 正常値型の初期化から送出される例外。 +- (11), (12) : エラー値型の初期化から送出される例外。 + + +## delete定義される条件 +- (2) : `!`[`is_copy_constructible_v`](/reference/type_traits/is_copy_constructible.md)` || !`[`is_copy_constructible_v`](/reference/type_traits/is_copy_constructible.md)`` + + +## トリビアルに定義される条件 +- (2) : [`is_trivially_copy_constructible_v`](/reference/type_traits/is_trivially_copy_constructible.md)` &&` [`is_trivially_copy_constructible_v`](/reference/type_traits/is_trivially_copy_constructible.md)`` +- (3) : [`is_trivially_move_constructible_v`](/reference/type_traits/is_trivially_move_constructible.md)` &&` [`is_trivially_move_constructible_v`](/reference/type_traits/is_trivially_move_constructible.md)`` + + +## explicitになる条件 +- (4) : `!`[`is_convertible_v`](/reference/type_traits/is_constructible.md)` || !`[`is_convertible_v`](/reference/type_traits/is_constructible.md)`` +- (5) : `!`[`is_convertible_v`](/reference/type_traits/is_constructible.md)` || !`[`is_convertible_v`](/reference/type_traits/is_constructible.md)`` +- (6) : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`` +- (7) : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`` +- (8) : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`` + + +## 例 +```cpp example +#include +#include +#include +#include +#include +#include +#include + +// std::pair型から2要素std::tuple型へはコピー変換可能 +using IntPair = std::pair; +using IntTuple = std::tuple; + +// std::unique_ptr型からstd::shared_ptr型へはムーブ変換可能 +using UniquePtr = std::unique_ptr; +using SharedPtr = std::shared_ptr; + +// 引数リスト または initializer_list+引数リスト から構築可能な型 +struct ComplexType { + std::string data; + std::vector seq; + + ComplexType(const char* ptr, size_t len) + : data(ptr, len) {} + ComplexType(std::initializer_list il, std::string_view sv) + : data(sv), seq(il) {} +}; + +int main() +{ + // (1) デフォルトコンストラクタ + { + std::expected x; + assert(x.has_value()); + assert(x.value() == 0); + // int型の値初期化{}は値0 + } + + // (2) コピーコンストラクタ + { + std::expected srcV = 42; + std::expected dstV = srcV; + assert(srcV.has_value() && dstV.has_value()); + assert(srcV.value() == 42 && dstV.value() == 42); + + std::expected srcE = std::unexpected{"Oops"}; + std::expected dstE = srcE; + assert(!srcE.has_value() && !dstE.has_value()); + assert(srcE.error() == "Oops" && dstE.error() == "Oops"); + } + + // (3) ムーブコンストラクタ + { + std::expected srcV = "ok"; + std::expected dstV = std::move(srcV); + assert(srcV.has_value() && dstV.has_value()); + assert(dstV.value() == "ok"); + // srcV.value()はstd::stringムーブ後の未規定の値 + + std::expected srcE = std::unexpected{"ng"}; + std::expected dstE = std::move(srcE); + assert(!srcE.has_value() && !dstE.has_value()); + assert(dstE.error() == "ng"); + // srcE.error()はstd::stringムーブ後の未規定の値 + } + + // (4) 変換コピー構築 + { + std::expected src = IntPair{1, 2}; + std::expected dst = src; + assert(src.has_value() && dst.has_value()); + assert((dst.value() == IntTuple{1, 2})); + } + + // (5) 変換ムーブ構築 + { + std::expected src = std::make_unique(42); + std::expected dst = std::move(src); + assert(src.has_value() && dst.has_value()); + assert(*dst.value() == 42); + assert(src.value() == nullptr); + // ムーブ後のstd::unique_ptr型はnullptrが保証される + } + + // (6) 正常値の変換コピー/ムーブ構築 + { + IntPair src1{1, 2}; + std::expected dst1 = src1; + assert(dst1.has_value()); + assert((dst1.value() == IntTuple{1, 2})); + + UniquePtr src2 = std::make_unique(42); + std::expected dst2 = std::move(src2); + assert(dst2.has_value()); + assert(*dst2.value() == 42); + } + + // (7),(8) エラー値の変換コピー/ムーブ構築 + { + std::unexpected src1{std::in_place, 1, 2}; + std::expected dst1 = src1; + assert(not dst1.has_value()); + assert((dst1.error() == IntTuple{1, 2})); + + UniquePtr src2 = std::make_unique(42); + std::expected dst2 = std::unexpected{std::move(src2)}; + assert(not dst2.has_value()); + assert(*dst2.error() == 42); + } + + // (9),(10) 引数リストから正常値を直接構築 + { + std::expected x1{std::in_place, "C++", 1}; + assert(x1.has_value()); + assert(x1.value().data == "C"); + // "C++"より長さ1の文字列が構築されている + + std::expected x2{std::in_place, {5, 6, 7, 8}, "Steps"}; + assert(x2.has_value()); + assert(x2.value().data == "Steps"); + assert((x2.value().seq == std::vector{5, 6, 7, 8})); + } + + // (11),(12) 引数リストからエラー値を直接構築 + { + std::expected x1{std::unexpect, "Hello!", 4}; + assert(not x1.has_value()); + assert(x1.error().data == "Hell"); + // "Hello!"より長さ4の文字列が構築されている + + std::expected x2{std::unexpect, {1, 2, 3}, "Lotus"}; + assert(not x2.has_value()); + assert(x2.error().data == "Lotus"); + assert((x2.error().seq == std::vector{1, 2, 3})); + } +} +``` +* has_value[link has_value.md.nolink] +* value[link value.md.nolink] +* error[link error.md.nolink] +* std::unexpected[link ../unexpected.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) diff --git a/reference/expected/expected/op_destructor.md b/reference/expected/expected/op_destructor.md new file mode 100644 index 0000000000..23add4ea40 --- /dev/null +++ b/reference/expected/expected/op_destructor.md @@ -0,0 +1,37 @@ +# デストラクタ +* expected[meta header] +* function[meta id-type] +* std[meta namespace] +* expected[meta class] +* cpp23[meta cpp] + +```cpp +constexpr ~expected(); +``` + +## 概要 +`expected`オブジェクトを破棄する。 + + +## 効果 +正常値を保持している場合は、正常値オブジェクトのデストラクタを呼び出す。 +エラー値を保持している場合は、エラー値オブジェクトのデストラクタを呼び出す。 + + +## トリビアルに定義される条件 +[`is_trivially_destructible_v`](/reference/type_traits/is_trivially_destructible.md)` &&` [`is_trivially_destructible_v`](/reference/type_traits/is_trivially_destructible.md)`` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) diff --git a/reference/expected/unexpect_t.md b/reference/expected/unexpect_t.md index 03ee4f5c62..5ef5320353 100644 --- a/reference/expected/unexpect_t.md +++ b/reference/expected/unexpect_t.md @@ -15,7 +15,7 @@ namespace std { ``` ## 概要 -`unexpected_t`は、[`expected`コンストラクタ](expected/op_constructor.md.nolink)において、エラー値型のコンストラクタ引数を受け取って構築するためのタグ型である。 +`unexpected_t`は、[`expected`コンストラクタ](expected/op_constructor.md)において、エラー値型のコンストラクタ引数を受け取って構築するためのタグ型である。 `unexpected_t`型の定数`unexpect`が提供される。 From fb277307e6e97f3406fcdfcc957b6c77cb11fb45 Mon Sep 17 00:00:00 2001 From: acd1034 <48613285+acd1034@users.noreply.github.com> Date: Sat, 28 Jan 2023 23:09:38 +0900 Subject: [PATCH 0117/3948] =?UTF-8?q?optional.or=5Felse:=20=E3=83=A1?= =?UTF-8?q?=E3=82=BD=E3=83=83=E3=83=89=E3=83=81=E3=82=A7=E3=82=A4=E3=83=B3?= =?UTF-8?q?=E3=81=A8=E3=81=97=E3=81=A6=E3=81=AE=E4=BD=BF=E3=81=84=E6=96=B9?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 下記の議論を元に例の見出しを修正: https://github.com/cpprefjp/site/issues/1101#issuecomment-1376896341 --- reference/optional/optional/or_else.md | 47 +++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/reference/optional/optional/or_else.md b/reference/optional/optional/or_else.md index b9d10ea866..78af379f92 100644 --- a/reference/optional/optional/or_else.md +++ b/reference/optional/optional/or_else.md @@ -63,6 +63,7 @@ class optional { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -86,10 +87,54 @@ int main() * value()[link value.md] -### 出力 +#### 出力 ``` ``` +### メソッドチェインとしての使い方 +```cpp example +#include +#include +#include +#include + +std::optional parse(std::string_view sv, int base, std::string_view prefix = "") +{ + if (!prefix.empty() && !sv.starts_with(prefix)) + return std::nullopt; + int n{}; + auto [ptr, ec] = std::from_chars(sv.data() + prefix.size(), sv.data() + sv.size(), n, base); + if (ec == std::errc{} && ptr == sv.data() + sv.size()) + return n; + else + return std::nullopt; +} + +std::optional parse_digit(std::string_view sv) +{ + return parse(sv, 2, "0b") + .or_else([sv] { return parse(sv, 10); }) + .or_else([sv] { return parse(sv, 16, "0x"); }); +} + +int main() +{ + assert(parse_digit("0b11") == std::optional(3)); + assert(parse_digit("11") == std::optional(11)); + assert(parse_digit("0x11") == std::optional(17)); + assert(parse_digit("x") == std::nullopt); +} +``` +* or_else[color ff0000] +* std::nullopt[link ../nullopt_t.md] +* std::string_view[link ../string_view/basic_string_view.md] +* std::from_chars[link ../charconv/from_chars.md] +* std::errc[link ../system_error/errc.md] + + +#### 出力 +``` +``` ## バージョン ### 言語 From 3e0c51d0d2f8c8607a57857902cd902236d01912 Mon Sep 17 00:00:00 2001 From: acd1034 <48613285+acd1034@users.noreply.github.com> Date: Sat, 28 Jan 2023 23:11:34 +0900 Subject: [PATCH 0118/3948] =?UTF-8?q?optional.or=5Felse:=20=E3=83=AA?= =?UTF-8?q?=E3=83=B3=E3=82=AF=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/optional/optional/or_else.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/optional/optional/or_else.md b/reference/optional/optional/or_else.md index 78af379f92..c046cd45c0 100644 --- a/reference/optional/optional/or_else.md +++ b/reference/optional/optional/or_else.md @@ -127,9 +127,9 @@ int main() ``` * or_else[color ff0000] * std::nullopt[link ../nullopt_t.md] -* std::string_view[link ../string_view/basic_string_view.md] -* std::from_chars[link ../charconv/from_chars.md] -* std::errc[link ../system_error/errc.md] +* std::string_view[link ../../string_view/basic_string_view.md] +* std::from_chars[link ../../charconv/from_chars.md] +* std::errc[link ../../system_error/errc.md] #### 出力 From 8094e1678b049e67ca0cc2d670aeac109dae4507 Mon Sep 17 00:00:00 2001 From: yoh Date: Sat, 28 Jan 2023 23:52:28 +0900 Subject: [PATCH 0119/3948] =?UTF-8?q?=E8=AA=AC=E6=98=8E=E7=94=A8=E3=81=AEE?= =?UTF-8?q?XPLICIT=E3=82=92italic=E8=A1=A8=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/optional/optional/op_constructor.md | 2 ++ reference/tuple/tuple/op_constructor.md | 2 ++ reference/utility/pair/op_constructor.md | 1 + 3 files changed, 5 insertions(+) diff --git a/reference/optional/optional/op_constructor.md b/reference/optional/optional/op_constructor.md index d584fdc657..13af1f5648 100644 --- a/reference/optional/optional/op_constructor.md +++ b/reference/optional/optional/op_constructor.md @@ -35,6 +35,8 @@ EXPLICIT optional(optional&& rhs); // (9) C++17 template explicit(see below) optional(optional&& rhs); // (9) C++20 ``` +* see below[italic] +* EXPLICIT[italic] * nullopt_t[link /reference/optional/nullopt_t.md] * in_place_t[link /reference/utility/in_place_t.md] * initializer_list[link /reference/initializer_list/initializer_list.md] diff --git a/reference/tuple/tuple/op_constructor.md b/reference/tuple/tuple/op_constructor.md index 9b61141ec3..6198cf8a91 100644 --- a/reference/tuple/tuple/op_constructor.md +++ b/reference/tuple/tuple/op_constructor.md @@ -170,6 +170,8 @@ explicit(see below) constexpr const Alloc& a, pair&&); // (18) C++20 ``` +* see below[italic] +* EXPLICIT[italic] * pair[link /reference/utility/pair.md] * allocator_arg_t[link /reference/memory/allocator_arg_t.md] diff --git a/reference/utility/pair/op_constructor.md b/reference/utility/pair/op_constructor.md index 72d83c383f..66369277a8 100644 --- a/reference/utility/pair/op_constructor.md +++ b/reference/utility/pair/op_constructor.md @@ -57,6 +57,7 @@ constexpr pair(piecewise_construct_t, tuple first_args, tuple second_args); // (8) C++20 ``` +* EXPLICIT[italic] * piecewise_construct_t[link /reference/utility/piecewise_construct_t.md] * tuple[link /reference/tuple/tuple.md] * see below[italic] From 915fa727b6a2153ffa8550c38785a9a4d38b7cfb Mon Sep 17 00:00:00 2001 From: yoh Date: Sat, 28 Jan 2023 23:55:37 +0900 Subject: [PATCH 0120/3948] =?UTF-8?q?"see=20below"=E3=82=92italic=E8=A1=A8?= =?UTF-8?q?=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/barrier/barrier.md | 1 + reference/charconv/from_chars.md | 2 ++ reference/charconv/to_chars.md | 1 + reference/chrono/file_clock.md | 3 +++ reference/chrono/hh_mm_ss/fractional_width.md | 1 + reference/compare/three_way_comparable.md | 2 +- reference/concepts/boolean-testable.md | 1 + reference/concepts/default_initializable.md | 1 + reference/concepts/equality_comparable.md | 1 + reference/concepts/same_as.md | 1 + reference/format/format_kind.md | 2 ++ reference/functional/placeholders.md | 1 + reference/functional/reference_wrapper/op_constructor.md | 1 + reference/iterator/common_iterator.md | 1 + reference/iterator/common_iterator/op_arrow.md | 1 + reference/iterator/indirectly_readable.md | 1 + reference/iterator/is_integer_like.md | 1 + reference/iterator/iter_difference_t.md | 1 + reference/iterator/iter_value_t.md | 1 + reference/iterator/iterator_traits.md | 1 + reference/iterator/reverse_iterator/iter_move.md | 1 + reference/iterator/reverse_iterator/iter_swap.md | 1 + reference/numbers/e.md | 1 + reference/numbers/egamma.md | 1 + reference/numbers/inv_pi.md | 1 + reference/numbers/inv_sqrt3.md | 1 + reference/numbers/inv_sqrtpi.md | 1 + reference/numbers/ln10.md | 1 + reference/numbers/ln2.md | 1 + reference/numbers/log10e.md | 1 + reference/numbers/log2e.md | 1 + reference/numbers/phi.md | 1 + reference/numbers/pi.md | 1 + reference/numbers/sqrt2.md | 1 + reference/numbers/sqrt3.md | 1 + reference/optional/make_optional.md | 1 + reference/optional/optional/op_assign.md | 1 + reference/optional/optional/swap.md | 1 + reference/ranges/enable_view.md | 1 + reference/span/span/subspan.md | 1 + reference/string/basic_string/op_compare_3way.md | 1 + reference/string/basic_string/op_deduction_guide.md | 1 + reference/string_view/basic_string_view/op_compare_3way.md | 1 + reference/tuple/apply.md | 1 + reference/tuple/tuple/op_assign.md | 1 + reference/tuple/tuple/swap.md | 1 + reference/unordered_map/unordered_map/op_deduction_guide.md | 1 + .../unordered_map/unordered_multimap/op_deduction_guide.md | 1 + .../unordered_set/unordered_multiset/op_deduction_guide.md | 1 + reference/unordered_set/unordered_set/op_deduction_guide.md | 1 + reference/utility/exchange.md | 1 + reference/utility/pair/swap.md | 1 + reference/variant/variant/op_assign.md | 1 + reference/variant/variant/op_constructor.md | 1 + reference/variant/variant/swap.md | 1 + reference/variant/variant/swap_free.md | 1 + reference/variant/visit.md | 1 + 57 files changed, 61 insertions(+), 1 deletion(-) diff --git a/reference/barrier/barrier.md b/reference/barrier/barrier.md index fe1ba46f25..30647f3fcd 100644 --- a/reference/barrier/barrier.md +++ b/reference/barrier/barrier.md @@ -10,6 +10,7 @@ namespace std { class barrier; } ``` +* see below[italic] ## 概要 `barrier`クラスは、複数スレッドにより並行実行される反復的なタスク制御に便利な、スレッド調整機構(同期プリミティブ)である。 diff --git a/reference/charconv/from_chars.md b/reference/charconv/from_chars.md index c19cbb24d9..3c0106a9b1 100644 --- a/reference/charconv/from_chars.md +++ b/reference/charconv/from_chars.md @@ -21,6 +21,8 @@ namespace std { chars_format fmt = chars_format::general); // (4) } ``` +* see below[italic] + ## 概要 与えられたイテレータ範囲`[first, last)`内の文字列から、オーバーロードと基数・フォーマット指定によって決まるパターンにマッチングする最初の数字文字列を見つけて、数値へ変換する。 diff --git a/reference/charconv/to_chars.md b/reference/charconv/to_chars.md index 0805a8b6ea..bfb3df0344 100644 --- a/reference/charconv/to_chars.md +++ b/reference/charconv/to_chars.md @@ -35,6 +35,7 @@ namespace std { chars_format fmt, int precision); // (10) } ``` +* see below[italic] ## 概要 与えられた数値(`value`)を文字列へ変換し、`[first, last)`内へ出力する。 diff --git a/reference/chrono/file_clock.md b/reference/chrono/file_clock.md index f008c83ca5..96330e7c1e 100644 --- a/reference/chrono/file_clock.md +++ b/reference/chrono/file_clock.md @@ -9,6 +9,7 @@ namespace std::chrono { using file_clock = see below; } ``` +* see below[italic] ## 概要 `file_clock`は、ファイル時間を作るために使用されるクロックである。この時刻系は[``](/reference/filesystem.md)ライブラリにおいてファイル作成日時やファイル更新日時を表現する[`file_time_type`](/reference/filesystem/file_time_type.md)のために定義される。 @@ -31,6 +32,7 @@ template static file_time from_sys(const sys_time&); ``` +* see below[italic] * utc_clock[link utc_clock.md] * sys_time[link sys_time.md] * file_time[link file_time.md] @@ -47,6 +49,7 @@ template static file_time from_utc(const utc_time&); ``` +* see below[italic] * tai_clock[link tai_clock.md] * gps_clock[link gps_clock.md] * utc_time[link utc_time.md] diff --git a/reference/chrono/hh_mm_ss/fractional_width.md b/reference/chrono/hh_mm_ss/fractional_width.md index 148ca0dc4c..666c9e9960 100644 --- a/reference/chrono/hh_mm_ss/fractional_width.md +++ b/reference/chrono/hh_mm_ss/fractional_width.md @@ -14,6 +14,7 @@ namespace std::chrono { }; } ``` +* see below[italic] ## 概要 `precision`型によって表現される小数の小数桁数。 diff --git a/reference/compare/three_way_comparable.md b/reference/compare/three_way_comparable.md index 72320ca386..2ca9e777a4 100644 --- a/reference/compare/three_way_comparable.md +++ b/reference/compare/three_way_comparable.md @@ -6,7 +6,6 @@ ```cpp namespace std { - template concept three_way_comparable = /*see below*/; // (1) @@ -14,6 +13,7 @@ namespace std { concept three_way_comparable_with = /*see below*/; // (2) } ``` +* see below[italic] ## 概要 `three_way_comparable`及び`three_way_comparable_with`は、指定された型`T`もしくは`T, U`の間で`<=>`による三方比較を使用可能であり、その戻り値型が指定した[比較カテゴリ型](/reference/compare.md)`Cat`に変換可能であることを表すコンセプトである。 diff --git a/reference/concepts/boolean-testable.md b/reference/concepts/boolean-testable.md index d285fa1fa6..8b8a13df77 100644 --- a/reference/concepts/boolean-testable.md +++ b/reference/concepts/boolean-testable.md @@ -10,6 +10,7 @@ namespace std { concept boolean-testable = /*see below*/; // 説明専用コンセプト } ``` +* see below[italic] ## 概要 diff --git a/reference/concepts/default_initializable.md b/reference/concepts/default_initializable.md index c6dec499a3..f71e8f9a6f 100644 --- a/reference/concepts/default_initializable.md +++ b/reference/concepts/default_initializable.md @@ -10,6 +10,7 @@ namespace std { concept default_initializable = /*see below*/; } ``` +* see below[italic] ## 概要 diff --git a/reference/concepts/equality_comparable.md b/reference/concepts/equality_comparable.md index fa14fd6e36..86ea1439fb 100644 --- a/reference/concepts/equality_comparable.md +++ b/reference/concepts/equality_comparable.md @@ -13,6 +13,7 @@ namespace std { concept equality_comparable_with = /*see below*/; // (2) } ``` +* see below[italic] ## 概要 `equality_comparable`及び`equality_comparable_with`は、指定された型`T`もしくは`T, U`の間で`==`演算子による同値比較が可能である事を表すコンセプトである。 diff --git a/reference/concepts/same_as.md b/reference/concepts/same_as.md index ed7053b3de..55847fa4f9 100644 --- a/reference/concepts/same_as.md +++ b/reference/concepts/same_as.md @@ -10,6 +10,7 @@ namespace std { concept same_as = /*see below*/; } ``` +* see below[italic] ## 概要 diff --git a/reference/format/format_kind.md b/reference/format/format_kind.md index 84295fbb95..95cc449730 100644 --- a/reference/format/format_kind.md +++ b/reference/format/format_kind.md @@ -14,6 +14,8 @@ namespace std { constexpr range_format format_kind = see below; // (2) C++23 } ``` +* unspecified[italic] +* see below[italic] * range_format[link range_format.md] * ranges::input_range[link /reference/ranges/input_range.md] diff --git a/reference/functional/placeholders.md b/reference/functional/placeholders.md index a5086d3708..9f21450a91 100644 --- a/reference/functional/placeholders.md +++ b/reference/functional/placeholders.md @@ -13,6 +13,7 @@ namespace placeholders { /*see below*/ unspecified _N; }} ``` +* see below[italic] * unspecified[italic] ## 概要 diff --git a/reference/functional/reference_wrapper/op_constructor.md b/reference/functional/reference_wrapper/op_constructor.md index d116936777..7446aac1f8 100644 --- a/reference/functional/reference_wrapper/op_constructor.md +++ b/reference/functional/reference_wrapper/op_constructor.md @@ -16,6 +16,7 @@ reference_wrapper(const reference_wrapper& x) noexcept; // (2) C++11 constexpr reference_wrapper(const reference_wrapper& x) noexcept; // (2) C++20 ``` +* see below[italic] ## 概要 与えられた参照で、参照オブジェクトを構築する。 diff --git a/reference/iterator/common_iterator.md b/reference/iterator/common_iterator.md index f6d48e0d4a..22eefeb3f0 100644 --- a/reference/iterator/common_iterator.md +++ b/reference/iterator/common_iterator.md @@ -33,6 +33,7 @@ namespace std { }; } ``` +* see below[italic] * input_or_output_iterator[link /reference/iterator/input_or_output_iterator.md] * sentinel_for[link /reference/iterator/sentinel_for.md] * copyable[link /reference/concepts/copyable.md] diff --git a/reference/iterator/common_iterator/op_arrow.md b/reference/iterator/common_iterator/op_arrow.md index 67ff48f3b0..df4f11843b 100644 --- a/reference/iterator/common_iterator/op_arrow.md +++ b/reference/iterator/common_iterator/op_arrow.md @@ -8,6 +8,7 @@ ```cpp decltype(auto) operator->() const requires /*see below*/; ``` +* see below[italic] ## 概要 イテレータを間接参照する。 diff --git a/reference/iterator/indirectly_readable.md b/reference/iterator/indirectly_readable.md index 6c6b6b9c6b..af05d5349c 100644 --- a/reference/iterator/indirectly_readable.md +++ b/reference/iterator/indirectly_readable.md @@ -10,6 +10,7 @@ namespace std { concept indirectly_readable = /*see below*/; } ``` +* see below[italic] ## 概要 diff --git a/reference/iterator/is_integer_like.md b/reference/iterator/is_integer_like.md index 69505c1dc1..d4b4118b67 100644 --- a/reference/iterator/is_integer_like.md +++ b/reference/iterator/is_integer_like.md @@ -13,6 +13,7 @@ namespace std { inline constexpr bool is-signed-integer-like = /*see below*/; } ``` +* see below[italic] ## 概要 diff --git a/reference/iterator/iter_difference_t.md b/reference/iterator/iter_difference_t.md index b0610cbc52..e998057a2a 100644 --- a/reference/iterator/iter_difference_t.md +++ b/reference/iterator/iter_difference_t.md @@ -10,6 +10,7 @@ namespace std { using iter_difference_t = /*see below*/; } ``` +* see below[italic] ## 概要 diff --git a/reference/iterator/iter_value_t.md b/reference/iterator/iter_value_t.md index 49d2b47ccb..7f3520a2dc 100644 --- a/reference/iterator/iter_value_t.md +++ b/reference/iterator/iter_value_t.md @@ -10,6 +10,7 @@ namespace std { using iter_value_t = /*see below*/; } ``` +* see below[italic] ## 概要 diff --git a/reference/iterator/iterator_traits.md b/reference/iterator/iterator_traits.md index 38cbf9c40a..7fdad8e587 100644 --- a/reference/iterator/iterator_traits.md +++ b/reference/iterator/iterator_traits.md @@ -102,6 +102,7 @@ namespace std { using reference = /*see below*/; using iterator_category = /*see below*/; ``` + * see below[italic] * indirectly_readable_traits[link /reference/iterator/indirectly_readable_traits.md] * incrementable_traits[link /reference/iterator/incrementable_traits.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] diff --git a/reference/iterator/reverse_iterator/iter_move.md b/reference/iterator/reverse_iterator/iter_move.md index fe97fe55c5..edf61ec14b 100644 --- a/reference/iterator/reverse_iterator/iter_move.md +++ b/reference/iterator/reverse_iterator/iter_move.md @@ -14,6 +14,7 @@ namespace std { }; } ``` +* see below[italic] * reverse_iterator[link /reference/iterator/reverse_iterator.md] * iter_rvalue_reference_t[link /reference/iterator/iter_rvalue_reference_t.md] diff --git a/reference/iterator/reverse_iterator/iter_swap.md b/reference/iterator/reverse_iterator/iter_swap.md index 2370c2679e..04653c48d0 100644 --- a/reference/iterator/reverse_iterator/iter_swap.md +++ b/reference/iterator/reverse_iterator/iter_swap.md @@ -16,6 +16,7 @@ namespace std { }; } ``` +* see below[italic] * reverse_iterator[link /reference/iterator/reverse_iterator.md] * indirectly_swappable[link /reference/iterator/indirectly_swappable.md] diff --git a/reference/numbers/e.md b/reference/numbers/e.md index e622ce8561..b5398523db 100644 --- a/reference/numbers/e.md +++ b/reference/numbers/e.md @@ -16,6 +16,7 @@ namespace std::numbers { } ``` * unspecified[italic] +* see below[italic] * floating_point[link /reference/concepts/floating_point.md] ## 概要 diff --git a/reference/numbers/egamma.md b/reference/numbers/egamma.md index 637ee50eea..eee50656c1 100644 --- a/reference/numbers/egamma.md +++ b/reference/numbers/egamma.md @@ -16,6 +16,7 @@ namespace std::numbers { } ``` * unspecified[italic] +* see below[italic] * floating_point[link /reference/concepts/floating_point.md] ## 概要 diff --git a/reference/numbers/inv_pi.md b/reference/numbers/inv_pi.md index deca18da93..e6a75174e2 100644 --- a/reference/numbers/inv_pi.md +++ b/reference/numbers/inv_pi.md @@ -16,6 +16,7 @@ namespace std::numbers { } ``` * unspecified[italic] +* see below[italic] * floating_point[link /reference/concepts/floating_point.md] ## 概要 diff --git a/reference/numbers/inv_sqrt3.md b/reference/numbers/inv_sqrt3.md index 4edbc94044..506fc2c9ea 100644 --- a/reference/numbers/inv_sqrt3.md +++ b/reference/numbers/inv_sqrt3.md @@ -16,6 +16,7 @@ namespace std::numbers { } ``` * unspecified[italic] +* see below[italic] * floating_point[link /reference/concepts/floating_point.md] ## 概要 diff --git a/reference/numbers/inv_sqrtpi.md b/reference/numbers/inv_sqrtpi.md index 608522cecf..0d3e6f4fb7 100644 --- a/reference/numbers/inv_sqrtpi.md +++ b/reference/numbers/inv_sqrtpi.md @@ -16,6 +16,7 @@ namespace std::numbers { } ``` * unspecified[italic] +* see below[italic] * floating_point[link /reference/concepts/floating_point.md] ## 概要 diff --git a/reference/numbers/ln10.md b/reference/numbers/ln10.md index eedebb9ec5..36400c4acf 100644 --- a/reference/numbers/ln10.md +++ b/reference/numbers/ln10.md @@ -16,6 +16,7 @@ namespace std::numbers { } ``` * unspecified[italic] +* see below[italic] * floating_point[link /reference/concepts/floating_point.md] ## 概要 diff --git a/reference/numbers/ln2.md b/reference/numbers/ln2.md index 2f7d3aedd8..d7d8a77e2c 100644 --- a/reference/numbers/ln2.md +++ b/reference/numbers/ln2.md @@ -16,6 +16,7 @@ namespace std::numbers { } ``` * unspecified[italic] +* see below[italic] * floating_point[link /reference/concepts/floating_point.md] ## 概要 diff --git a/reference/numbers/log10e.md b/reference/numbers/log10e.md index 52b94f1d4a..0269f89dda 100644 --- a/reference/numbers/log10e.md +++ b/reference/numbers/log10e.md @@ -16,6 +16,7 @@ namespace std::numbers { } ``` * unspecified[italic] +* see below[italic] * floating_point[link /reference/concepts/floating_point.md] ## 概要 diff --git a/reference/numbers/log2e.md b/reference/numbers/log2e.md index 2de00153c1..6b225a932f 100644 --- a/reference/numbers/log2e.md +++ b/reference/numbers/log2e.md @@ -16,6 +16,7 @@ namespace std::numbers { } ``` * unspecified[italic] +* see below[italic] * floating_point[link /reference/concepts/floating_point.md] ## 概要 diff --git a/reference/numbers/phi.md b/reference/numbers/phi.md index b9c34a54d1..daa102b4f8 100644 --- a/reference/numbers/phi.md +++ b/reference/numbers/phi.md @@ -16,6 +16,7 @@ namespace std::numbers { } ``` * unspecified[italic] +* see below[italic] * floating_point[link /reference/concepts/floating_point.md] ## 概要 diff --git a/reference/numbers/pi.md b/reference/numbers/pi.md index b7f713622a..240c6e118c 100644 --- a/reference/numbers/pi.md +++ b/reference/numbers/pi.md @@ -16,6 +16,7 @@ namespace std::numbers { } ``` * unspecified[italic] +* see below[italic] * floating_point[link /reference/concepts/floating_point.md] ## 概要 diff --git a/reference/numbers/sqrt2.md b/reference/numbers/sqrt2.md index cdd55ca995..778b2b0de3 100644 --- a/reference/numbers/sqrt2.md +++ b/reference/numbers/sqrt2.md @@ -16,6 +16,7 @@ namespace std::numbers { } ``` * unspecified[italic] +* see below[italic] * floating_point[link /reference/concepts/floating_point.md] ## 概要 diff --git a/reference/numbers/sqrt3.md b/reference/numbers/sqrt3.md index 71de3ecfb3..2e99f6c115 100644 --- a/reference/numbers/sqrt3.md +++ b/reference/numbers/sqrt3.md @@ -16,6 +16,7 @@ namespace std::numbers { } ``` * unspecified[italic] +* see below[italic] * floating_point[link /reference/concepts/floating_point.md] ## 概要 diff --git a/reference/optional/make_optional.md b/reference/optional/make_optional.md index 08818bfbc9..ed9cf25b70 100644 --- a/reference/optional/make_optional.md +++ b/reference/optional/make_optional.md @@ -18,6 +18,7 @@ namespace std { Args&&... args); // (3) } ``` +* see below[italic] ## 概要 有効な値を保持する`optional`オブジェクトを構築する。 diff --git a/reference/optional/optional/op_assign.md b/reference/optional/optional/op_assign.md index 9ef8badafb..35b9156763 100644 --- a/reference/optional/optional/op_assign.md +++ b/reference/optional/optional/op_assign.md @@ -21,6 +21,7 @@ optional& operator=(const optional& rhs); // (5) template optional& operator=(optional&& rhs); // (6) ``` +* see below[italic] * nullopt_t[link /reference/optional/nullopt_t.md] ## 概要 diff --git a/reference/optional/optional/swap.md b/reference/optional/optional/swap.md index 9efc8c9722..ccf0d05a0a 100644 --- a/reference/optional/optional/swap.md +++ b/reference/optional/optional/swap.md @@ -8,6 +8,7 @@ ```cpp void swap(optional& rhs) noexcept(see below); ``` +* see below[italic] ## 概要 他の`optional`オブジェクトとデータを入れ替える。 diff --git a/reference/ranges/enable_view.md b/reference/ranges/enable_view.md index db48f11750..4f9948c94f 100644 --- a/reference/ranges/enable_view.md +++ b/reference/ranges/enable_view.md @@ -29,6 +29,7 @@ namespace std::ranges { inline constexpr bool is-derived-from-view-interface = see below; // 説明専用 } ``` +* see below[italic] `is-derived-from-view-interface`は、`T`がある型`U`についてただ一つだけ`view_interface`を`public`な基底クラスに持ち、他の型`V`についての`view_interface`を基底クラスに持たない場合に`true`となる。 diff --git a/reference/span/span/subspan.md b/reference/span/span/subspan.md index 784ecc1bef..063cc688b4 100644 --- a/reference/span/span/subspan.md +++ b/reference/span/span/subspan.md @@ -13,6 +13,7 @@ constexpr span constexpr span subspan(size_type offset, size_type count = dynamic_extent) const; // (2) ``` +* see below[italic] * dynamic_extent[link /reference/span/dynamic_extent.md] ## 概要 diff --git a/reference/string/basic_string/op_compare_3way.md b/reference/string/basic_string/op_compare_3way.md index 59450a1ddb..127947a6df 100644 --- a/reference/string/basic_string/op_compare_3way.md +++ b/reference/string/basic_string/op_compare_3way.md @@ -17,6 +17,7 @@ namespace std { const charT* rhs); // (2) C++20 } ``` +* see below[italic] ## 概要 `basic_string`オブジェクトの三方比較を行う。 diff --git a/reference/string/basic_string/op_deduction_guide.md b/reference/string/basic_string/op_deduction_guide.md index 496f9d5d0d..65e7d0bee3 100644 --- a/reference/string/basic_string/op_deduction_guide.md +++ b/reference/string/basic_string/op_deduction_guide.md @@ -29,6 +29,7 @@ namespace std { -> basic_string; // (3) C++20 } ``` +* see below[italic] * allocator[link /reference/memory/allocator.md] * iterator_traits[link /reference/iterator/iterator_traits.md] * char_traits[link /reference/string/char_traits.md] diff --git a/reference/string_view/basic_string_view/op_compare_3way.md b/reference/string_view/basic_string_view/op_compare_3way.md index 481609366d..d885c78d89 100644 --- a/reference/string_view/basic_string_view/op_compare_3way.md +++ b/reference/string_view/basic_string_view/op_compare_3way.md @@ -12,6 +12,7 @@ namespace std { basic_string_view y) noexcept; // (1) C++20 } ``` +* see below[italic] ## 概要 `basic_string_view`オブジェクトの三方比較を行う。 diff --git a/reference/tuple/apply.md b/reference/tuple/apply.md index ff0343f513..3b00168b8f 100644 --- a/reference/tuple/apply.md +++ b/reference/tuple/apply.md @@ -15,6 +15,7 @@ namespace std { apply(F&& f, Tuple&& t) noexcept(see below); // (1) C++23 } ``` +* see below[italic] ## 概要 タプルを展開し、関数の引数に適用してその関数を実行する。 diff --git a/reference/tuple/tuple/op_assign.md b/reference/tuple/tuple/op_assign.md index 67d7e98bfd..6a594bb1e5 100644 --- a/reference/tuple/tuple/op_assign.md +++ b/reference/tuple/tuple/op_assign.md @@ -32,6 +32,7 @@ tuple& operator=(pair&&); // (6) C++11 template constexpr tuple& operator=(pair&&); // (6) C++20 ``` +* see below[italic] * pair[link /reference/utility/pair.md] ## 概要 diff --git a/reference/tuple/tuple/swap.md b/reference/tuple/tuple/swap.md index 603a8dfa87..4467d18b25 100644 --- a/reference/tuple/tuple/swap.md +++ b/reference/tuple/tuple/swap.md @@ -9,6 +9,7 @@ void swap(tuple& rhs) noexcept(see below); // (1) C++11 constexpr void swap(tuple& rhs) noexcept(see below); // (1) C++20 ``` +* see below[italic] ## 概要 他の`tuple`オブジェクトと中身を入れ替える。 diff --git a/reference/unordered_map/unordered_map/op_deduction_guide.md b/reference/unordered_map/unordered_map/op_deduction_guide.md index 68beb2cbc3..5378eadbab 100644 --- a/reference/unordered_map/unordered_map/op_deduction_guide.md +++ b/reference/unordered_map/unordered_map/op_deduction_guide.md @@ -77,6 +77,7 @@ namespace std { equal_to, Allocator>; // (8) } ``` +* see below[italic] * remove_const_t[link /reference/type_traits/remove_const.md] * add_const_t[link /reference/type_traits/add_const.md] * pair[link /reference/utility/pair.md] diff --git a/reference/unordered_map/unordered_multimap/op_deduction_guide.md b/reference/unordered_map/unordered_multimap/op_deduction_guide.md index 654e9c6e85..3091f49eb2 100644 --- a/reference/unordered_map/unordered_multimap/op_deduction_guide.md +++ b/reference/unordered_map/unordered_multimap/op_deduction_guide.md @@ -77,6 +77,7 @@ namespace std { equal_to, Allocator>; // (8) } ``` +* see below[italic] * remove_const_t[link /reference/type_traits/remove_const.md] * add_const_t[link /reference/type_traits/add_const.md] * pair[link /reference/utility/pair.md] diff --git a/reference/unordered_set/unordered_multiset/op_deduction_guide.md b/reference/unordered_set/unordered_multiset/op_deduction_guide.md index f4a4d9d296..d572ad8573 100644 --- a/reference/unordered_set/unordered_multiset/op_deduction_guide.md +++ b/reference/unordered_set/unordered_multiset/op_deduction_guide.md @@ -48,6 +48,7 @@ namespace std { equal_to, Allocator>; // (6) } ``` +* see below[italic] * hash[link /reference/functional/hash.md] * equal_to[link /reference/functional/equal_to.md] * iterator_traits[link /reference/iterator/iterator_traits.md] diff --git a/reference/unordered_set/unordered_set/op_deduction_guide.md b/reference/unordered_set/unordered_set/op_deduction_guide.md index e2eb9c9a71..d945823248 100644 --- a/reference/unordered_set/unordered_set/op_deduction_guide.md +++ b/reference/unordered_set/unordered_set/op_deduction_guide.md @@ -44,6 +44,7 @@ namespace std { -> unordered_set, Allocator>; // (6) } ``` +* see below[italic] * hash[link /reference/functional/hash.md] * equal_to[link /reference/functional/equal_to.md] * iterator_traits[link /reference/iterator/iterator_traits.md] diff --git a/reference/utility/exchange.md b/reference/utility/exchange.md index 9c103e5ed0..5f14d92127 100644 --- a/reference/utility/exchange.md +++ b/reference/utility/exchange.md @@ -17,6 +17,7 @@ namespace std { noexcept(see below); // (1) C++23 } ``` +* see below[italic] ## 概要 値を書き換え、書き換え前の値を返す。 diff --git a/reference/utility/pair/swap.md b/reference/utility/pair/swap.md index a55d139750..403b9a8ae4 100644 --- a/reference/utility/pair/swap.md +++ b/reference/utility/pair/swap.md @@ -9,6 +9,7 @@ void swap(pair& p) noexcept(see below); // (1) C++11 constexpr void swap(pair& p) noexcept(see below); // (1) C++20 ``` +* see below[italic] ## 概要 他の`pair`オブジェクトと値を入れ替える diff --git a/reference/variant/variant/op_assign.md b/reference/variant/variant/op_assign.md index 24293b012e..21d1c4a92d 100644 --- a/reference/variant/variant/op_assign.md +++ b/reference/variant/variant/op_assign.md @@ -14,6 +14,7 @@ variant& operator=(T&& rhs) noexcept(see below); // (3) C++17 template constexpr variant& operator=(T&& rhs) noexcept(see below); // (3) C++23 ``` +* see below[italic] ## 概要 `variant`オブジェクトもしくは候補型の値を代入する。 diff --git a/reference/variant/variant/op_constructor.md b/reference/variant/variant/op_constructor.md index 38d1724d02..fdfaca3ed8 100644 --- a/reference/variant/variant/op_constructor.md +++ b/reference/variant/variant/op_constructor.md @@ -31,6 +31,7 @@ constexpr explicit variant(in_place_index_t, initializer_list il, Args&&... args); // (8) ``` +* see below[italic] * size_t[link /reference/cstddef/size_t.md] * initializer_list[link /reference/initializer_list/initializer_list.md] * in_place_type_t[link /reference/utility/in_place_type_t.md] diff --git a/reference/variant/variant/swap.md b/reference/variant/variant/swap.md index a905630c21..8785fd27b2 100644 --- a/reference/variant/variant/swap.md +++ b/reference/variant/variant/swap.md @@ -9,6 +9,7 @@ void swap(variant& rhs) noexcept(see below); // C++17 constexpr void swap(variant& rhs) noexcept(see below); // C++23 ``` +* see below[italic] ## 概要 他の`variant`オブジェクトとデータを入れ替える。 diff --git a/reference/variant/variant/swap_free.md b/reference/variant/variant/swap_free.md index a1961ca338..b74fa172d3 100644 --- a/reference/variant/variant/swap_free.md +++ b/reference/variant/variant/swap_free.md @@ -12,6 +12,7 @@ namespace std { constexpr void swap(variant& x, variant& y) noexcept(see below); // C++23 } ``` +* see below[italic] ## 概要 同じ候補型をもつ2つの`variant`オブジェクトを入れ替える。 diff --git a/reference/variant/visit.md b/reference/variant/visit.md index ec41cb7f90..9e033a950e 100644 --- a/reference/variant/visit.md +++ b/reference/variant/visit.md @@ -13,6 +13,7 @@ namespace std { constexpr R visit(Visitor&& vis, Variants&&... vars); // (2) C++20 } ``` +* see below[italic] ## 概要 `variant`オブジェクトが現在保持している型に対応する関数を呼び出す。 From 724b29c83cfdd8bddf4cdc1bb3c657b6c9e17d4c Mon Sep 17 00:00:00 2001 From: yoh Date: Sun, 29 Jan 2023 23:29:20 +0900 Subject: [PATCH 0121/3948] expected/expected: operator=(#1066) --- reference/expected/expected.md | 2 +- reference/expected/expected/op_assign.md | 245 +++++++++++++++++++++++ 2 files changed, 246 insertions(+), 1 deletion(-) create mode 100644 reference/expected/expected/op_assign.md diff --git a/reference/expected/expected.md b/reference/expected/expected.md index be26126024..60b59f6af2 100644 --- a/reference/expected/expected.md +++ b/reference/expected/expected.md @@ -38,7 +38,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |-----------------|----------------|-------| -| [`operator=`](expected/op_assign.md.nolink) | 代入演算子 | C++23 | +| [`operator=`](expected/op_assign.md) | 代入演算子 | C++23 | | [`emplace`](expected/emplace.md.nolink) | 正常値型のコンストラクタ引数から直接構築する | C++23 | | [`swap`](expected/swap.md.nolink) | 他の`expected`オブジェクトとデータを入れ替える | C++23 | diff --git a/reference/expected/expected/op_assign.md b/reference/expected/expected/op_assign.md new file mode 100644 index 0000000000..103e901f9e --- /dev/null +++ b/reference/expected/expected/op_assign.md @@ -0,0 +1,245 @@ +# operator= +* expected[meta header] +* function[meta id-type] +* std[meta namespace] +* expected[meta class] +* cpp23[meta cpp] + +```cpp +constexpr expected& operator=(const expected&); // (1) + +constexpr expected& operator=(expected&&) noexcept(see below); // (2) + +template +constexpr expected& operator=(U&&); // (3) + +template +constexpr expected& operator=(const unexpected&); // (4) + +template +constexpr expected& operator=(unexpected&&); // (5) +``` +* see below[italic] +* unexpected[link ../unexpected.md] + +## 概要 +- (1) : コピー代入。 +- (2) : ムーブ代入。 +- (3) : 要素型`T`に変換可能な値を、正常値としてコピー代入またはムーブ代入。 +- (4) : 変換可能な[`unexpected`](../unexpected.md)オブジェクトから、エラー値としてコピー代入。 +- (5) : 変換可能な[`unexpected`](../unexpected.md)オブジェクトから、エラー値としてムーブ代入。 + + +動作説明用の`expected`クラスメンバ変数として、下記を導入する。 + +- `val` : `T`型の正常値。 +- `unex` : `E`型のエラー値。 +- `has_val` : `bool`型のフラグ変数。正常値を保持する場合は`true`に、エラー値を保持する場合は`false`となる。 + +また、説明用のテンプレート関数`reinit-expected`を次の通り定義する。 + +```cpp +template +constexpr void reinit-expected(T& newval, U& oldval, Args&&... args) { + if constexpr (is_nothrow_constructible_v) { + destroy_at(addressof(oldval)); + construct_at(addressof(newval), std::forward(args)...); + } else if constexpr (is_nothrow_move_constructible_v) { + T tmp(std::forward(args)...); + destroy_at(addressof(oldval)); + construct_at(addressof(newval), std::move(tmp)); + } else { + U tmp(std::move(oldval)); + destroy_at(addressof(oldval)); + try { + construct_at(addressof(newval), std::forward(args)...); + } catch (...) { + construct_at(addressof(oldval), std::move(tmp)); + throw; + } + } +} +``` +* addressof[link /reference/memory/addressof.md] +* construct_at[link /reference/memory/construct_at.md] +* destroy_at[link /reference/memory/destroy_at.md] +* is_nothrow_constructible_v[link /reference/type_traits/is_nothrow_constructible.md] +* is_nothrow_move_constructible_v[link /reference/type_traits/is_nothrow_move_constructible.md] + + +## テンプレートパラメータ制約 +- (2) : 下記を全て満たすこと + - [`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)` == true` + - [`is_move_assignable_v`](/reference/type_traits/is_move_assignable.md)` == true` + - [`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)` == true` + - [`is_move_assignable_v`](/reference/type_traits/is_move_assignable.md)` == true` + - `(`[`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)` ||` [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)`) == true` +- (3) : 下記を全て満たすこと + - [`is_same_v`](/reference/type_traits/is_same.md)`> == false` + - [`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``が[`unexpected`](../unexpected.md)の特殊化ではない + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true` + - [`is_assignable_v`](/reference/type_traits/is_assignable.md)` == true` + - `(`[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)` ||` [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)` ||` [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)`) == true` +- (4) : 下記を全て満たすこと + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true` + - [`is_assignable_v`](/reference/type_traits/is_assignable.md)` == true` + - `(`[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)` ||` [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)` || +`[`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)`) == true` +- (5) : 下記を全て満たすこと + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true` + - [`is_assignable_v`](/reference/type_traits/is_assignable.md)` == true` + - `(`[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)` ||` [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)` ||` [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)`) == true` + + +## 効果 +- (1) : 次の処理を行ったのち、例外が送出されなければ、`has_val = rhs.`[`has_value()`](has_value.md.nolink)`; return *this;` + - `this`と`rhs`が共に正常値を保持していたら、`val = *rhs` + - `this`が正常値を保持し、`rhs`がエラー値を保持していたら、`reinit-expected(unex, val, rhs.`[`error()`](error.md.nolink)`)` + - `this`がエラーを保持し、`rhs`が正常値を保持していたら、`reinit-expected(val, unex, *rhs)` + - `this`と`rhs`が共にエラー値を保持していたら、`unex = rhs.`[`error()`](error.md.nolink) +- (2) : 次の処理を行ったのち、例外が送出されなければ、`has_val = rhs.`[`has_value()`](has_value.md.nolink)`; return *this;` + - `this`と`rhs`が共に正常値を保持していたら、`val = std::move(*rhs)` + - `this`が正常値を保持し、`rhs`がエラー値を保持していたら、`reinit-expected(unex, val, std::move(rhs.`[`error()`](error.md.nolink)`))` + - `this`がエラーを保持し、`rhs`が正常値を保持していたら、`reinit-expected(val, unex, std::move(*rhs))` + - `this`と`rhs`が共にエラー値を保持していたら、`unex = std::move(rhs.`[`error()`](error.md.nolink)`)` +- (3) : 次の処理と等価 + - `this`が正常値を保持していたら、`val = std::forward(v)` + - `this`がエラー値を保持していたら、`reinit-expected(val, unex, std::forward(v)); has_val = true;` +- (4) : 次の処理と等価 + - `this`が正常値を保持していたら、`reinit-expected(unex, val, std::forward(e.`[`error()`](error.md.nolink)`)); +has_val = false;` + - `this`がエラー値を保持していたら、`unex = std::forward(e.`[`error()`](error.md.nolink)`);` +- (5) : 次の処理と等価 + - `this`が正常値を保持していたら、`reinit-expected(unex, val, std::forward(e.`[`error()`](error.md.nolink)`)); +has_val = false;` + - `this`がエラー値を保持していたら、`unex = std::forward(e.`[`error()`](error.md.nolink)`);` + + +## 戻り値 +`*this` + + +## 例外 +- (2) : ムーブ代入演算子のnoexcept例外指定は、次の式に従う + - [`is_nothrow_move_assignable_v`](/reference/type_traits/is_nothrow_move_assignable.md)` &&` [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)` &&` [`is_nothrow_move_assignable_v`](/reference/type_traits/is_nothrow_move_assignable.md)` &&` [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)`` + + +## delete定義される条件 +- (1) : 下記いずれか1つでも満たされないとき、コピー代入演算子はdelete定義される。 + - [`is_copy_assignable_v`](/reference/type_traits/is_copy_assignable.md)` == true` + - [`is_copy_constructible_v`](/reference/type_traits/is_copy_constructible.md)` == true` + - [`is_copy_assignable_v`](/reference/type_traits/is_copy_assignable.md)` == true` + - [`is_copy_constructible_v`](/reference/type_traits/is_copy_constructible.md)` == true` + - `(`[`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)` ||` [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)`) == true` + + +## 例 +```cpp example +#include +#include +#include +#include +#include +#include + +// std::pair型から2要素std::tuple型へはコピー代入可能 +using IntPair = std::pair; +using IntTuple = std::tuple; + +// std::unique_ptr型からstd::shared_ptr型へはムーブ代入可能 +using UniquePtr = std::unique_ptr; +using SharedPtr = std::shared_ptr; + +int main() +{ + // (1) コピー代入 + { + std::expected srcV = 42; + std::expected dstV; + dstV = srcV; + assert(srcV.has_value() && dstV.has_value()); + assert(srcV.value() == 42 && dstV.value() == 42); + + std::expected srcE = std::unexpected{"Oops"}; + std::expected dstE; + dstE = srcE; + assert(!srcE.has_value() && !dstE.has_value()); + assert(srcE.error() == "Oops" && dstE.error() == "Oops"); + } + + // (2) ムーブ代入 + { + std::expected srcV = "ok"; + std::expected dstV; + dstV = std::move(srcV); + assert(srcV.has_value() && dstV.has_value()); + assert(dstV.value() == "ok"); + // srcV.value()はstd::stringムーブ後の未規定の値 + + std::expected srcE = std::unexpected{"ng"}; + std::expected dstE; + dstE = std::move(srcE); + assert(!srcE.has_value() && !dstE.has_value()); + assert(dstE.error() == "ng"); + // srcE.error()はstd::stringムーブ後の未規定の値 + } + + // (3) 正常値の変換コピー代入 + { + IntPair src = IntPair{1, 2}; + std::expected dst; + dst = src; + assert(dst.has_value()); + assert((dst.value() == IntTuple{1, 2})); + } + // (3) 正常値の変換ムーブ代入 + { + UniquePtr src = std::make_unique(42); + std::expected dst; + dst = std::move(src); + assert(dst.has_value()); + assert(*dst.value() == 42); + } + + // (4) エラー値の変換コピー代入 + { + std::unexpected src{IntPair{1, 2}}; + std::expected dst; + dst = src; + assert(not dst.has_value()); + assert((dst.error() == IntTuple{1, 2})); + } + + // (5) エラー値の変換ムーブ代入 + { + std::unexpected src{std::make_unique(42)}; + std::expected dst; + dst = std::move(src); + assert(not dst.has_value()); + assert(*dst.error() == 42); + } +} +``` +* has_value[link has_value.md.nolink] +* value[link value.md.nolink] +* error[link error.md.nolink] +* std::unexpected[link ../unexpected.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) From 4f16a60c92c925396a78baf6e08f22a3450ff652 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 30 Jan 2023 16:20:22 +0900 Subject: [PATCH 0122/3948] =?UTF-8?q?=E3=83=98=E3=83=83=E3=83=80?= =?UTF-8?q?=E3=83=9A=E3=83=BC=E3=82=B8=E3=82=92=E8=BF=BD=E5=8A=A0=20#1082?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23.md | 2 +- reference.md | 2 +- reference/print.md | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 reference/print.md diff --git a/lang/cpp23.md b/lang/cpp23.md index f5f33237d5..54974e0963 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -118,7 +118,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 - 正常値とエラー値のどちらかを持つクラスおよびライブラリとして[``](/reference/expected.md)を追加 - 多次元配列ビューのライブラリとして[``](/reference/mdspan.md.nolink)を追加 - ノードベースではないソート済みキーによる順序付き連想コンテナのライブラリとして、[``](/reference/flat_map.md.nolink)と[``](/reference/flat_set.md.nolink)を追加 -- 書式指定で出力するライブラリとして[``](/reference/print.md.nolink)を追加 +- 書式指定で出力するライブラリとして[``](/reference/print.md)を追加 - コルーチンによるRangeの生成をサポートする[``](/reference/generator.md)を追加 diff --git a/reference.md b/reference.md index 82516c2871..331792a014 100644 --- a/reference.md +++ b/reference.md @@ -164,7 +164,7 @@ | [``](/reference/filesystem.md) | ファイルシステム | C++17 | | [``](/reference/syncstream.md) | 同期化出力ストリームラッパー | C++20 | | [``](/reference/spanstream.md.nolink) | メモリバッファの所有権をもたないストリーム | C++23 | -| [``](/reference/print.md.nolink) | 書式指定による出力 | C++23 | +| [``](/reference/print.md) | 書式指定による出力 | C++23 | ## 正規表現ライブラリ diff --git a/reference/print.md b/reference/print.md new file mode 100644 index 0000000000..493358192c --- /dev/null +++ b/reference/print.md @@ -0,0 +1,33 @@ +# print +* print[meta header] +* cpp23[meta cpp] + +``ヘッダでは、書式指定で出力する機能を定義する。 + +このヘッダでは、デフォルトの出力先、および`FILE*`指定のオーバーロードが定義される。[`std::ostream`](/reference/ostream/basic_ostream.md)指定のオーバーロードは[``](ostream.md)で定義される。 + + +| 名前 | 説明 | 対応バージョン | +|-----------------|----------------|-------| +| [`print`](print/print.md.nolink) | 書式指定で出力する (function template) | C++23 | +| [`println`](print/println.md.nolink) | 書式指定で出力する。末尾改行付き (function template) | C++23 | +| [`vprint_unicode`](print/vprint_unicode.md.nolink) | 書式指定でUnicode出力する (function template) | C++23 | +| [`vprint_nonunicode`](print/vprint_nonunicode.md.nolink) | 書式指定で非Unicode出力する (function template) | C++23 | + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [``](ostream.md) + + +## 参照 +- [P2093R14 Formatted output](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2093r14.html) From 83d53575d897b0bcdc6c5963ea22fd18ec855755 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 30 Jan 2023 16:32:55 +0900 Subject: [PATCH 0123/3948] =?UTF-8?q?optional::and=5Fthen,=20or=5Felse=20:?= =?UTF-8?q?=20=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE=E9=A3=BE=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 2 ++ reference/optional/optional/and_then.md | 7 +++++++ reference/optional/optional/or_else.md | 6 ++++++ 3 files changed, 15 insertions(+) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 3c202f133a..b561847852 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -179,6 +179,8 @@ * basic_string_view[link /reference/string_view/basic_string_view.md] * std::basic_string_view[link /reference/string_view/basic_string_view.md] * std::string_view[link /reference/string_view/basic_string_view.md] + * sv.data()[link /reference/string_view/basic_string_view/data.md] + * sv.size()[link /reference/string_view/basic_string_view/size.md] * [link /reference/syncstream.md] * [link /reference/system_error.md] * ec.message()[link /reference/system_error/error_code/message.md] diff --git a/reference/optional/optional/and_then.md b/reference/optional/optional/and_then.md index bb30148d8f..71f6ef5467 100644 --- a/reference/optional/optional/and_then.md +++ b/reference/optional/optional/and_then.md @@ -48,6 +48,9 @@ class optional { return remove_cvref_t(); } ``` + * invoke[link /reference/functional/invoke.md] + * std::forward[link /reference/utility/forward.md] + * value()[link value.md] - (2), (4) : 次と等価 @@ -58,6 +61,10 @@ class optional { return remove_cvref_t(); } ``` + * invoke[link /reference/functional/invoke.md] + * std::forward[link /reference/utility/forward.md] + * std::move[link /reference/utility/move.md] + * value()[link value.md] ## 備考 diff --git a/reference/optional/optional/or_else.md b/reference/optional/optional/or_else.md index c046cd45c0..f0a5d65bc9 100644 --- a/reference/optional/optional/or_else.md +++ b/reference/optional/optional/or_else.md @@ -46,6 +46,7 @@ class optional { return std::forward(f)(); } ``` + * std::forward[link /reference/utility/forward.md] - (2) : 次と等価 @@ -56,6 +57,8 @@ class optional { return std::forward(f)(); } ``` + * std::move[link /reference/utility/move.md] + * std::forward[link /reference/utility/forward.md] ## 備考 @@ -130,6 +133,9 @@ int main() * std::string_view[link ../../string_view/basic_string_view.md] * std::from_chars[link ../../charconv/from_chars.md] * std::errc[link ../../system_error/errc.md] +* prefix.empty()[link /reference/string_view/basic_string_view/empty.md] +* prefix.size()[link /reference/string_view/basic_string_view/size.md] +* sv.starts_with[link /reference/string_view/basic_string_view/starts_with.md] #### 出力 From 6d029cb18ead0f2abc706638978bc258ef4e5ea1 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 30 Jan 2023 17:47:30 +0900 Subject: [PATCH 0124/3948] =?UTF-8?q?expected=20:=20=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=89=E4=BF=AE=E9=A3=BE=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/expected/expected.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/expected/expected.md b/reference/expected/expected.md index 60b59f6af2..d2177e5fa1 100644 --- a/reference/expected/expected.md +++ b/reference/expected/expected.md @@ -15,6 +15,7 @@ namespace std { class expected; } ``` +* is_void_v[link /reference/type_traits/is_void.md] ## 概要 `expected`クラスは、任意の型`T`の値を正常値とし任意の型`E`の値をエラー値として、正常もしくはエラーいずれかの状態を取ることを値として表現できる型である。 From 469297fa7a5b27cdd4c4eca4b637a576ee496734 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 30 Jan 2023 22:06:53 +0900 Subject: [PATCH 0125/3948] =?UTF-8?q?=20:=20print,=20println?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20#1082?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/print.md | 4 +- reference/print/print.md | 119 +++++++++++++++++++++++++++++++++++++ reference/print/println.md | 87 +++++++++++++++++++++++++++ 3 files changed, 208 insertions(+), 2 deletions(-) create mode 100644 reference/print/print.md create mode 100644 reference/print/println.md diff --git a/reference/print.md b/reference/print.md index 493358192c..28a15991b5 100644 --- a/reference/print.md +++ b/reference/print.md @@ -9,8 +9,8 @@ | 名前 | 説明 | 対応バージョン | |-----------------|----------------|-------| -| [`print`](print/print.md.nolink) | 書式指定で出力する (function template) | C++23 | -| [`println`](print/println.md.nolink) | 書式指定で出力する。末尾改行付き (function template) | C++23 | +| [`print`](print/print.md) | 書式指定で出力する (function template) | C++23 | +| [`println`](print/println.md) | 書式指定で出力する。末尾改行付き (function template) | C++23 | | [`vprint_unicode`](print/vprint_unicode.md.nolink) | 書式指定でUnicode出力する (function template) | C++23 | | [`vprint_nonunicode`](print/vprint_nonunicode.md.nolink) | 書式指定で非Unicode出力する (function template) | C++23 | diff --git a/reference/print/print.md b/reference/print/print.md new file mode 100644 index 0000000000..bb5108a04c --- /dev/null +++ b/reference/print/print.md @@ -0,0 +1,119 @@ +# print +* print[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template + void print(format_string fmt, + Args&&... args); // (1) C++23 + + template + void print(FILE* stream, + format_string fmt, + Args&&... args); // (2) C++23 +} +``` +* format_string[link /reference/format/format_string.md.nolink] +* FILE[link /reference/cstdio/file.md.nolink] + +## 概要 +書式指定で出力する。 + +書式は[`std::format()`](/reference/format/format.md)関数のページを参照。 + +この関数は、[`std::printf()`](/reference/cstdio/printf.md.nolink)関数ライクな書式指定で引数を文字列化して出力する。 + +- (1) : 標準出力に、書式指定で出力する +- (2) : 指定された[`FILE`](/reference/cstdio/file.md.nolink)に、書式指定で出力する + +この関数は、末尾に改行コードが付かないことに注意。改行コードを自動で付けたい場合は、[`std::println()`](println.md)関数を使用すること。 + +[`std::ostream`](/reference/ostream/basic_ostream.md)から派生したクラスオブジェクトに対して出力したい場合は、[``](/reference/ostream.md)ヘッダの[`std::print()`](/reference/ostream/print.md.nolink)関数を使用すること。 + + +## 効果 +- (1) : 以下と等価: + ```cpp + print(stdout, fmt, std::forward(args)...); + ``` + * stdout[link /reference/cstdio/stdout.md.nolink] + * std::forward[link /reference/utility/forward.md] + +- (2) : 通常の文字列リテラルがUTF-8エンコーディングされている場合、以下と等価: + ```cpp + vprint_unicode(stream, fmt.get(), make_format_args(std::forward(args)...)); + ``` + * vprint_unicode[link vprint_unicode.md.nolink] + * fmt.get()[link /reference/format/format_string/get.md.nolink] + * make_format_args[link /reference/format/make_format_args.md] + * std::forward[link /reference/utility/forward.md] + + - そうでなければ、以下と等価: + ```cpp + vprint_nonunicode(stream, fmt.get(), make_format_args(std::forward(args)...)); + ``` + * vprint_nonunicode[link vprint_nonunicode.md.nolink] + * fmt.get()[link /reference/format/format_string/get.md.nolink] + * make_format_args[link /reference/format/make_format_args.md] + * std::forward[link /reference/utility/forward.md] + + +## 備考 +- LinuxやmacOSといった環境では、通常の`char`配列の文字列リテラルはUTF-8にエンコーディングされる +- WindowsのVisual Studioにおいては、ソースコードと実行時文字集合をUTF-8にする[`/utf-8`オプション](https://learn.microsoft.com/en-us/cpp/build/reference/utf-8-set-source-and-executable-character-sets-to-utf-8?view=msvc-170)を使用することで、通常の`char`配列の文字列リテラルがUTF-8にエンコーディングされる +- 「通常の文字列リテラルがUTF-8エンコーディングされている場合」という仕様は、コードでは以下のように表現できる: + ``` + constexpr bool is_utf8() { + const unsigned char micro[] = "\u00B5"; + return sizeof(micro) == 3 && micro[0] == 0xC2 && micro[1] == 0xB5; + } + + template + void print(string_view fmt, const Args&... args) { + if (is_utf8()) + vprint_unicode(fmt, make_format_args(args...)); + else + vprint_nonunicode(fmt, make_format_args(args...)); + } + ``` + * vprint_unicode[link vprint_unicode.md.nolink] + * vprint_nonunicode[link vprint_nonunicode.md.nolink] + + +## 例 +```cpp example +#include + +int main() +{ + std::print("Hello {} World\n", 42); +} +``` +* std::print[color ff0000] + +### 出力 +``` +Hello 42 World +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`std::format()`](/reference/format/format.md) +- [`std::println()`](println.md) + + +## 参照 +- [P2093R14 Formatted output](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2093r14.html) diff --git a/reference/print/println.md b/reference/print/println.md new file mode 100644 index 0000000000..54cc70128e --- /dev/null +++ b/reference/print/println.md @@ -0,0 +1,87 @@ +# println +* print[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template + void println(format_string fmt, + Args&&... args); // (1) C++23 + + template + void println(FILE* stream, + format_string fmt, + Args&&... args); // (2) C++23 +} +``` +* format_string[link /reference/format/format_string.md.nolink] +* FILE[link /reference/cstdio/file.md.nolink] + +## 概要 +書式指定で出力する。この関数は、出力の末尾に改行コードが自動で付加される。 + +書式は[`std::format()`](/reference/format/format.md)関数のページを参照。 + +この関数は、[`std::printf()`](/reference/cstdio/printf.md.nolink)関数ライクな書式指定で引数を文字列化して出力する。 + +- (1) : 標準出力に、書式指定で出力する +- (2) : 指定された[`FILE`](/reference/cstdio/file.md.nolink)に、書式指定で出力する + +この関数は、末尾に改行コードが付くことに注意。改行コードが不要な場合は、[`std::print()`](print.md)関数を使用すること。 + +[`std::ostream`](/reference/ostream/basic_ostream.md)から派生したクラスオブジェクトに対して出力したい場合は、[``](/reference/ostream.md)ヘッダの[`std::print()`](/reference/ostream/println.md.nolink)関数を使用すること。 + + +## 効果 +- (1) : 以下と等価: + ```cpp + println(stdout, fmt, std::forward(args)...); + ``` + * stdout[link /reference/cstdio/stdout.md.nolink] + * std::forward[link /reference/utility/forward.md] + +- (2) : 以下と等価: + ```cpp + print(stream, "{}\n", format(fmt, std::forward(args)...)); + ``` + * print[link print.md] + * format[link /reference/format/format.md] + * std::forward[link /reference/utility/forward.md] + + +## 例 +```cpp example +#include + +int main() +{ + std::println("Hello {} World", 42); +} +``` +* std::println[color ff0000] + +### 出力 +``` +Hello 42 World +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`std::format()`](/reference/format/format.md) +- [`std::print()`](print.md) + + +## 参照 +- [P2093R14 Formatted output](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2093r14.html) From a235d11124e9da535c0af2a90407538d283fb260 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 30 Jan 2023 22:35:29 +0900 Subject: [PATCH 0126/3948] =?UTF-8?q?=20:=20vprint=5F(non)unicode?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20#1082?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 1 + reference/print.md | 4 +- reference/print/print.md | 8 +-- reference/print/vprint_nonunicode.md | 67 ++++++++++++++++++++++ reference/print/vprint_unicode.md | 83 ++++++++++++++++++++++++++++ 5 files changed, 157 insertions(+), 6 deletions(-) create mode 100644 reference/print/vprint_nonunicode.md create mode 100644 reference/print/vprint_unicode.md diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index b561847852..039c6fd335 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -179,6 +179,7 @@ * basic_string_view[link /reference/string_view/basic_string_view.md] * std::basic_string_view[link /reference/string_view/basic_string_view.md] * std::string_view[link /reference/string_view/basic_string_view.md] + * string_view[link /reference/string_view/basic_string_view.md] * sv.data()[link /reference/string_view/basic_string_view/data.md] * sv.size()[link /reference/string_view/basic_string_view/size.md] * [link /reference/syncstream.md] diff --git a/reference/print.md b/reference/print.md index 28a15991b5..961249f324 100644 --- a/reference/print.md +++ b/reference/print.md @@ -11,8 +11,8 @@ |-----------------|----------------|-------| | [`print`](print/print.md) | 書式指定で出力する (function template) | C++23 | | [`println`](print/println.md) | 書式指定で出力する。末尾改行付き (function template) | C++23 | -| [`vprint_unicode`](print/vprint_unicode.md.nolink) | 書式指定でUnicode出力する (function template) | C++23 | -| [`vprint_nonunicode`](print/vprint_nonunicode.md.nolink) | 書式指定で非Unicode出力する (function template) | C++23 | +| [`vprint_unicode`](print/vprint_unicode.md) | 書式指定でUnicode出力する (function) | C++23 | +| [`vprint_nonunicode`](print/vprint_nonunicode.md) | 書式指定で非Unicode出力する (function) | C++23 | ## バージョン ### 言語 diff --git a/reference/print/print.md b/reference/print/print.md index bb5108a04c..dfa7d6707d 100644 --- a/reference/print/print.md +++ b/reference/print/print.md @@ -46,7 +46,7 @@ namespace std { ```cpp vprint_unicode(stream, fmt.get(), make_format_args(std::forward(args)...)); ``` - * vprint_unicode[link vprint_unicode.md.nolink] + * vprint_unicode[link vprint_unicode.md] * fmt.get()[link /reference/format/format_string/get.md.nolink] * make_format_args[link /reference/format/make_format_args.md] * std::forward[link /reference/utility/forward.md] @@ -55,7 +55,7 @@ namespace std { ```cpp vprint_nonunicode(stream, fmt.get(), make_format_args(std::forward(args)...)); ``` - * vprint_nonunicode[link vprint_nonunicode.md.nolink] + * vprint_nonunicode[link vprint_nonunicode.md] * fmt.get()[link /reference/format/format_string/get.md.nolink] * make_format_args[link /reference/format/make_format_args.md] * std::forward[link /reference/utility/forward.md] @@ -79,8 +79,8 @@ namespace std { vprint_nonunicode(fmt, make_format_args(args...)); } ``` - * vprint_unicode[link vprint_unicode.md.nolink] - * vprint_nonunicode[link vprint_nonunicode.md.nolink] + * vprint_unicode[link vprint_unicode.md] + * vprint_nonunicode[link vprint_nonunicode.md] ## 例 diff --git a/reference/print/vprint_nonunicode.md b/reference/print/vprint_nonunicode.md new file mode 100644 index 0000000000..22f5842c10 --- /dev/null +++ b/reference/print/vprint_nonunicode.md @@ -0,0 +1,67 @@ +# vprint_nonunicode +* print[meta header] +* std[meta namespace] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + void vprint_nonunicode(string_view fmt, + format_args args); // (1) C++23 + + void vprint_nonunicode(FILE* stream, + string_view fmt, + format_args args); // (2) C++23 +} +``` +* FILE[link /reference/cstdio/file.md.nolink] +* format_args[link /reference/format/basic_format_args.md] + +## 概要 +書式指定で非Unicode出力する。 + +- (1) : 標準出力に、書式指定で非Unicode出力する +- (2) : 指定された[`FILE`](/reference/cstdio/file.md.nolink)に、書式指定で非Unicode出力する + +[`std::ostream`](/reference/ostream/basic_ostream.md)から派生したクラスオブジェクトに対して出力したい場合は、[``](/reference/ostream.md)ヘッダの[`std::vprint_nonunicode()`](/reference/ostream/vprint_nonunicode.md.nolink)関数を使用すること。 + + +## 事前条件 +- (2) : `stream`が有効な出力Cストリームを指していること + + +## 効果 +- (1) : 以下と等価: + ```cpp + vprint_unicode(stdout, fmt, args); + ``` + * stdout[link /reference/cstdio/stdout.md.nolink] + +- (2) : [`vformat`](/reference/format/vformat.md)`(fmt, args)`の結果を`stream`に書き出す + + +## 例外 +- [`vformat()`](/reference/format/vformat.md)関数がなんらかの例外を送出する可能性がある +- 端末かストリームへの書き込みに失敗した場合、[`system_error`](/reference/system_error/system_error.md)を送出する +- [`bad_alloc`](/reference/new/bad_alloc.md)を送出する可能性がある + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`std::print()`](print.md) +- [`std::println()`](println.md) +- [`std::vprint_unicode()`](vprint_nonunicode.md) + + +## 参照 +- [P2093R14 Formatted output](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2093r14.html) diff --git a/reference/print/vprint_unicode.md b/reference/print/vprint_unicode.md new file mode 100644 index 0000000000..ed2ae9e2bf --- /dev/null +++ b/reference/print/vprint_unicode.md @@ -0,0 +1,83 @@ +# vprint_unicode +* print[meta header] +* std[meta namespace] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + void vprint_unicode(string_view fmt, + format_args args); // (1) C++23 + + void vprint_unicode(FILE* stream, + string_view fmt, + format_args args); // (2) C++23 +} +``` +* FILE[link /reference/cstdio/file.md.nolink] +* format_args[link /reference/format/basic_format_args.md] + +## 概要 +書式指定でUnicode出力する。 + +- (1) : 標準出力に、書式指定でUnicode出力する +- (2) : 指定された[`FILE`](/reference/cstdio/file.md.nolink)に、書式指定でUnicode出力する + +[`std::ostream`](/reference/ostream/basic_ostream.md)から派生したクラスオブジェクトに対して出力したい場合は、[``](/reference/ostream.md)ヘッダの[`std::vprint_unicode()`](/reference/ostream/vprint_unicode.md.nolink)関数を使用すること。 + + +## 事前条件 +- (2) `stream`が有効な出力Cストリームを指していること + + +## 効果 +- (1) : 以下と等価: + ```cpp + vprint_unicode(stdout, fmt, args); + ``` + * stdout[link /reference/cstdio/stdout.md.nolink] + +- (2) : 以下の方法で自動変数を初期化する: + ```cpp + string out = vformat(fmt, args); + ``` + * string[link /reference/string/basic_string.md] + * vformat[link /reference/format/vformat.md] + + - `stream`がUnicodeを表示できる端末を参照している場合、ネイティブのUnicode APIを使用して端末に書き出す。`out`が無効なコードユニットを含んでいる場合、その動作は未定義であり、実装はそれを診断することが望まれる。 + - `out`に無効なコードユニットが含まれる場合、その動作は未定義であり,実装者はそれを診断することが推奨される。それ以外の場合は、変更せずにストリームに書き出します。そうでなければ、変更せず`stream`に`out`を書き出す。 + - ネイティブのUnicode APIを使用する場合、この関数は`out`に書き出す前にフラッシュする + + +## 例外 +- [`vformat()`](/reference/format/vformat.md)関数がなんらかの例外を送出する可能性がある +- 端末かストリームへの書き込みに失敗した場合、[`system_error`](/reference/system_error/system_error.md)を送出する +- [`bad_alloc`](/reference/new/bad_alloc.md)を送出する可能性がある + + +## 備考 +- POSIXおよびWindowsにおいて、「`stream`が端末を参照している」とは、それぞれ、`isatty(fileno(stream))`、および`GetConsoleMode(_get_osfhandle(_fileno(stream)), ...) != 0`を意味する +- Windowsにおいて、ネイティブなUnicode APIとは`WriteConsoleW()`である +- 推奨の方式:ネイティブのUnicode APIを呼び出す際に文字コード変換が必要な場合、実装はUnicode標準 (Unicode Standard Version 14.0 - Core Specification, Chapter 3.9) に従って無効なコードユニットを「U+FFFD REPLACEMENT CHARACTER」で置き換える必要がある + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`std::print()`](print.md) +- [`std::println()`](println.md) +- [`std::vprint_nonunicode()`](vprint_nonunicode.md) + + +## 参照 +- [P2093R14 Formatted output](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2093r14.html) +- [P2539R4 Should the output of `std::print` to a terminal be synchronized with the underlying stream?](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2539r4.html) From dfae47736e42e6bf4603692f494e00540d05e3de Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 30 Jan 2023 22:37:58 +0900 Subject: [PATCH 0127/3948] =?UTF-8?q?format=20:=20print=20/=20println?= =?UTF-8?q?=E3=81=B8=E3=81=AE=E8=A8=80=E5=8F=8A=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20#1082?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/format.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/reference/format/format.md b/reference/format/format.md index cac2cb3e86..5b94a42d8f 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -42,6 +42,9 @@ string message = format("The answer is {}.", 42); // => "The answer is 42." 書式文字列は定数式でなければならず、その妥当性がコンパイル時にチェックされる。実行時に決まるフォーマット文字列を使用したい場合、[`vformat`](vformat.md)を使用できる。 +C++23以降、書式指定で出力する[`std::print()`](/reference/print/print.md)、[`std::println()`](/reference/print/println.md)関数が定義される。 + + ### 書式文字列 書式文字列中では、`{`と`}`で囲まれた範囲が置換フィールドとなる(エスケープシーケンスは`{{`と`}}`)。 @@ -571,6 +574,16 @@ wstring format(const locale& loc, wformat_string fmt, const Args&... ar - [GCC](/implementation.md#gcc): 13 - [Visual C++](/implementation.md#visual_cpp): ?? + +## 関連項目 +- [``](/reference/print.md) + - [`std::print()`](/reference/print/print.md) + - [`std::println()`](/reference/print/println.md) +- [``](/reference/ostream.md) + - [`std::print()`](/reference/ostream/print.md.nolink) + - [`std::println()`](/reference/ostream/println.md.nolink) + + ## 参照 - [Working Draft, Standard for Programming Language C++ [format]](https://timsong-cpp.github.io/cppwp/format) - [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) From e388ca69c6b456116a9cda79e221a8df66454bd2 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 30 Jan 2023 22:39:11 +0900 Subject: [PATCH 0128/3948] =?UTF-8?q?print=20:=20=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=89=E3=81=AE=E8=A8=80=E8=AA=9E=E6=8C=87=E5=AE=9A=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/print/print.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/print/print.md b/reference/print/print.md index dfa7d6707d..035692dca3 100644 --- a/reference/print/print.md +++ b/reference/print/print.md @@ -65,7 +65,7 @@ namespace std { - LinuxやmacOSといった環境では、通常の`char`配列の文字列リテラルはUTF-8にエンコーディングされる - WindowsのVisual Studioにおいては、ソースコードと実行時文字集合をUTF-8にする[`/utf-8`オプション](https://learn.microsoft.com/en-us/cpp/build/reference/utf-8-set-source-and-executable-character-sets-to-utf-8?view=msvc-170)を使用することで、通常の`char`配列の文字列リテラルがUTF-8にエンコーディングされる - 「通常の文字列リテラルがUTF-8エンコーディングされている場合」という仕様は、コードでは以下のように表現できる: - ``` + ```cpp constexpr bool is_utf8() { const unsigned char micro[] = "\u00B5"; return sizeof(micro) == 3 && micro[0] == 0xC2 && micro[1] == 0xB5; From 05643dc9ac4efe0b623696764045ced26d6010b0 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 31 Jan 2023 13:44:20 +0900 Subject: [PATCH 0129/3948] expected/expected: operator->,operator*(#1066) --- reference/expected/expected.md | 4 +- reference/expected/expected/op_arrow.md | 71 +++++++++++++++++++++++ reference/expected/expected/op_deref.md | 76 +++++++++++++++++++++++++ 3 files changed, 149 insertions(+), 2 deletions(-) create mode 100644 reference/expected/expected/op_arrow.md create mode 100644 reference/expected/expected/op_deref.md diff --git a/reference/expected/expected.md b/reference/expected/expected.md index d2177e5fa1..990f3020ff 100644 --- a/reference/expected/expected.md +++ b/reference/expected/expected.md @@ -47,8 +47,8 @@ namespace std { | 名前 | 説明 | 対応バージョン | |-----------------|----------------|-------| -| [`operator->`](expected/op_arrow.md.nolink) | メンバアクセス | C++23 | -| [`operator*`](expected/op_deref.md.nolink) | 間接参照 | C++23 | +| [`operator->`](expected/op_arrow.md) | 正常値へのメンバアクセス | C++23 | +| [`operator*`](expected/op_deref.md) | 正常値への間接参照 | C++23 | | [`operator bool`](expected/op_bool.md.nolink) | 正常値を保持しているかを判定する | C++23 | | [`has_value`](expected/has_value.md.nolink) | 正常値を保持しているかを判定する | C++23 | | [`value`](expected/value.md.nolink) | 正常値を取得する | C++23 | diff --git a/reference/expected/expected/op_arrow.md b/reference/expected/expected/op_arrow.md new file mode 100644 index 0000000000..8ee18c8a0c --- /dev/null +++ b/reference/expected/expected/op_arrow.md @@ -0,0 +1,71 @@ +# operator-> +* expected[meta header] +* function[meta id-type] +* std[meta namespace] +* expected[meta class] +* cpp23[meta cpp] + +```cpp +constexpr const T* operator->() const noexcept; // (1) +constexpr T* operator->() noexcept; // (2) +``` + +## 概要 +保持している正常値のメンバにアクセスする。 + + +## 事前条件 +[`has_value()`](has_value.md.nolink) `== true` + + +## 戻り値 +正常値へのポインタ。 + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::expected x = "Hello"; + std::cout << x->size() << std::endl; + + std::expected y = std::unexpected{42}; +//std::cout << y->size() << std::endl; + // エラー値を保持する y に対する operator-> 呼び出しは未定義動作 +} +``` +* x->[color ff0000] +* std::unexpected[link ../unexpected.md] + +### 出力 +``` +5 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`operator*`](op_deref.md) +- [`value`](value.md.nolink) + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) diff --git a/reference/expected/expected/op_deref.md b/reference/expected/expected/op_deref.md new file mode 100644 index 0000000000..bbe4445122 --- /dev/null +++ b/reference/expected/expected/op_deref.md @@ -0,0 +1,76 @@ +# operator* +* expected[meta header] +* function[meta id-type] +* std[meta namespace] +* expected[meta class] +* cpp23[meta cpp] + +```cpp +constexpr const T& operator*() const & noexcept; // (1) +constexpr T& operator*() & noexcept; // (2) +constexpr T&& operator*() && noexcept; // (3) +constexpr const T&& operator*() const && noexcept; // (4) +``` + +## 概要 +正常値を取得する。 + + +## 事前条件 +[`has_value()`](has_value.md.nolink) `== true` + + +## 戻り値 +動作説明用のメンバ変数として、正常値を保持する`val`を導入する。 + +- (1), (2) : `val` +- (3), (4) : [`std::move`](/reference/utility/move.md)`(val)` + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::expected x = 1; + std::cout << *x << std::endl; + + std::expected y = std::unexpected{"ERR"}; +//std::cout << *y << std::endl; + // エラー値を保持する y に対する operator* 呼び出しは未定義動作 +} +``` +* *x[color ff0000] +* std::unexpected[link ../unexpected.md] + +### 出力 +``` +1 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`operator->`](op_arrow.md) +- [`value`](value.md.nolink) + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) From 68f67f8140eab1bc2c2e1c9af564314b587c8bce Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 31 Jan 2023 13:45:12 +0900 Subject: [PATCH 0130/3948] =?UTF-8?q?expected/expected:=20=E3=82=B3?= =?UTF-8?q?=E3=83=B3=E3=82=B9=E3=83=88=E3=83=A9=E3=82=AF=E3=82=BF=E8=AA=BF?= =?UTF-8?q?=E6=95=B4(#1066)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit s/有効値/正常値/g, パラメータ名明記, 内部リンク追加 --- reference/expected/expected/op_constructor.md | 62 ++++++++++--------- 1 file changed, 33 insertions(+), 29 deletions(-) diff --git a/reference/expected/expected/op_constructor.md b/reference/expected/expected/op_constructor.md index 98779f4788..d5e086445b 100644 --- a/reference/expected/expected/op_constructor.md +++ b/reference/expected/expected/op_constructor.md @@ -6,37 +6,38 @@ * cpp23[meta cpp] ```cpp -constexpr expected(); // (1) -constexpr expected(const expected&); // (2) -constexpr expected(expected&&) noexcept(see below); // (3) +constexpr expected(); // (1) +constexpr expected(const expected& rhs); // (2) +constexpr expected(expected&& rhs) noexcept(see below); // (3) template -constexpr explicit(see below) expected(const expected&); // (4) +constexpr explicit(see below) expected(const expected& rhs); // (4) template -constexpr explicit(see below) expected(expected&&); // (5) +constexpr explicit(see below) expected(expected&& rhs); // (5) template constexpr explicit(see below) expected(U&& v); // (6) template -constexpr explicit(see below) expected(const unexpected&); // (7) +constexpr explicit(see below) expected(const unexpected& e); // (7) template -constexpr explicit(see below) expected(unexpected&&); // (8) +constexpr explicit(see below) expected(unexpected&& e); // (8) template -constexpr explicit expected(in_place_t, Args&&...); // (9) +constexpr explicit expected(in_place_t, Args&&... args); // (9) template -constexpr explicit expected(in_place_t, initializer_list, Args&&...); // (10) +constexpr explicit expected(in_place_t, initializer_list il, Args&&... args); // (10) template -constexpr explicit expected(unexpect_t, Args&&...); // (11) +constexpr explicit expected(unexpect_t, Args&&... args); // (11) template -constexpr explicit expected(unexpect_t, initializer_list, Args&&...); // (12) +constexpr explicit expected(unexpect_t, initializer_list il, Args&&... args); // (12) ``` * see below[italic] * unexpected[link ../unexpected.md] * unexpect_t[link ../unexpect_t.md] * in_place_t[link /reference/utility/in_place_t.md] +* initializer_list[link /reference/initializer_list/initializer_list.md] ## 概要 - (1) : 正常値型`T`を値初期化して保持する。 @@ -47,10 +48,10 @@ constexpr explicit expected(unexpect_t, initializer_list, Args&&...); // (12) - (6) : 正常値型`T`に変換可能な型`U`の値を正常値として受け取り、コピーまたはムーブして保持する。 - (7) : 変換可能な[`unexpected`](../unexpected.md)オブジェクトかエラー値をコピー構築する。 - (8) : 変換可能な[`unexpected`](../unexpected.md)オブジェクトからエラー値をムーブ構築する。 -- (9) : 正常値型`T`のコンストラクタ引数として任意個の引数を受け取って、コンストラクタ内で型`T`のオブジェクトを有効値として生成し、保持する。 -- (10) : 正常値型`T`のコンストラクタ引数として初期化子リストと任意個の引数を受け取って、コンストラクタ内で型`T`のオブジェクトを有効値として生成し、保持する。 -- (11) : エラー値型`E`のコンストラクタ引数として任意個の引数を受け取って、コンストラクタ内で型`E`のオブジェクトを有効値として生成し、保持する。 -- (12) : エラー値型`E`のコンストラクタ引数として初期化子リストと任意個の引数を受け取って、コンストラクタ内で型`E`のオブジェクトを有効値として生成し、保持する。 +- (9) : 正常値型`T`のコンストラクタ引数として任意個の引数を受け取って、コンストラクタ内で型`T`のオブジェクトを正常値として生成し、保持する。 +- (10) : 正常値型`T`のコンストラクタ引数として初期化子リストと任意個の引数を受け取って、コンストラクタ内で型`T`のオブジェクトを正常値として生成し、保持する。 +- (11) : エラー値型`E`のコンストラクタ引数として任意個の引数を受け取って、コンストラクタ内で型`E`のオブジェクトを正常値として生成し、保持する。 +- (12) : エラー値型`E`のコンストラクタ引数として初期化子リストと任意個の引数を受け取って、コンストラクタ内で型`E`のオブジェクトを正常値として生成し、保持する。 説明用のテンプレート変数`converts-from-any-cvref`を次の通り定義する。 @@ -70,7 +71,7 @@ constexpr bool converts-from-any-cvref = ## テンプレートパラメータ制約 - (1) : [`is_default_constructible_v`](/reference/type_traits/is_default_constructible.md)` == true` -- (3) : [`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)` == true`[`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)` == true` +- (3) : [`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)` == true &&` [`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)` == true` - (4) : 次の制約を全て満たすこと - [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true` - [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true` @@ -95,17 +96,17 @@ constexpr bool converts-from-any-cvref = - (7) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true` - (8) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true` - (9) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true` -- (10) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)`&, Args...> == true` +- (10) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)`&, Args...> == true` - (11) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true` -- (12) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)`&, Args...> == true` +- (12) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)`&, Args...> == true` ## 効果 - (1) : 正常値を値初期化して保持する。 -- (2) : `rhs`が正常値を保持していれば、[`*rhs`](op_deref.md.nolink)で正常値を直接非リスト初期化する。そうでなければ、`rhs.`[`error()`](error.md.nolink)でエラー値を直接非リスト初期化する。 -- (3) : `rhs`が正常値を保持していれば、[`std::move`](/reference/utility/move.md)`(`[`*rhs`](op_deref.md.nolink)`)`で正常値を直接非リスト初期化する。そうでなければ、[`std::move`](/reference/utility/move.md)`(rhs.`[`error()`](error.md.nolink)`)`でエラー値を直接非リスト初期化する。 -- (4) : `rhs`が正常値を保持していれば、[`std::forward`](/reference/utility/forward.md)`(`[`*rhs`](op_deref.md.nolink)`)`で正常値を直接非リスト初期化する。そうでなければ、[`std::forward`](/reference/utility/forward.md)`(rhs.`[`error()`](error.md.nolink)`)`でエラー値を直接非リスト初期化する。 -- (5) : `rhs`が正常値を保持していれば、[`std::forward`](/reference/utility/forward.md)`(`[`*rhs`](op_deref.md.nolink)`)`で正常値を直接非リスト初期化する。そうでなければ、[`std::forward`](/reference/utility/forward.md)`(rhs.`[`error()`](error.md.nolink)`)`でエラー値を直接非リスト初期化する。 +- (2) : `rhs`が正常値を保持していれば、[`*rhs`](op_deref.md)で正常値を直接非リスト初期化する。そうでなければ、`rhs.`[`error()`](error.md.nolink)でエラー値を直接非リスト初期化する。 +- (3) : `rhs`が正常値を保持していれば、[`std::move`](/reference/utility/move.md)`(`[`*rhs`](op_deref.md)`)`で正常値を直接非リスト初期化する。そうでなければ、[`std::move`](/reference/utility/move.md)`(rhs.`[`error()`](error.md.nolink)`)`でエラー値を直接非リスト初期化する。 +- (4) : `rhs`が正常値を保持していれば、[`std::forward`](/reference/utility/forward.md)`(`[`*rhs`](op_deref.md)`)`で正常値を直接非リスト初期化する。そうでなければ、[`std::forward`](/reference/utility/forward.md)`(rhs.`[`error()`](error.md.nolink)`)`でエラー値を直接非リスト初期化する。 +- (5) : `rhs`が正常値を保持していれば、[`std::forward`](/reference/utility/forward.md)`(`[`*rhs`](op_deref.md)`)`で正常値を直接非リスト初期化する。そうでなければ、[`std::forward`](/reference/utility/forward.md)`(rhs.`[`error()`](error.md.nolink)`)`でエラー値を直接非リスト初期化する。 - (6) : [`std::forward`](/reference/utility/forward.md)`(v)`で正常値を直接非リスト初期化する。 - (7) : [`std::forward`](/reference/utility/forward.md)`(rhs.`[`error()`](error.md.nolink)`)`でエラー値を直接非リスト初期化する。 - (8) : [`std::forward`](/reference/utility/forward.md)`(rhs.`[`error()`](error.md.nolink)`)`でエラー値を直接非リスト初期化する。 @@ -116,13 +117,13 @@ constexpr bool converts-from-any-cvref = ## 事後条件 -- (1) : 有効値を保持している。 -- (2) : `rhs`が有効値を保持する場合は`*this`も有効値を保持し、`rhs`がエラー値を保持する場合は`*this`もエラー値を保持する。 -- (3) : `rhs`が有効値を保持する場合は`*this`も有効値を保持し、`rhs`がエラー値を保持する場合は`*this`もエラー値を保持する。`rhs.`[`has_value()`](has_value.md.nolink)は変化しない。 -- (4), (5) : `rhs`が有効値を保持する場合は`*this`も有効値を保持し、`rhs`がエラー値を保持する場合は`*this`もエラー値を保持する。`rhs.`[`has_value()`](has_value.md.nolink)は変化しない。 -- (6) : 有効値を保持している。 +- (1) : 正常値を保持している。 +- (2) : `rhs`が正常値を保持する場合は`*this`も正常値を保持し、`rhs`がエラー値を保持する場合は`*this`もエラー値を保持する。 +- (3) : `rhs`が正常値を保持する場合は`*this`も正常値を保持し、`rhs`がエラー値を保持する場合は`*this`もエラー値を保持する。`rhs.`[`has_value()`](has_value.md.nolink)は変化しない。 +- (4), (5) : `rhs`が正常値を保持する場合は`*this`も正常値を保持し、`rhs`がエラー値を保持する場合は`*this`もエラー値を保持する。`rhs.`[`has_value()`](has_value.md.nolink)は変化しない。 +- (6) : 正常値を保持している。 - (7), (8) : エラー値を保持している。 -- (9), (10) : 有効値を保持している。 +- (9), (10) : 正常値を保持している。 - (11), (12) : エラー値を保持している。 @@ -173,7 +174,7 @@ using IntTuple = std::tuple; using UniquePtr = std::unique_ptr; using SharedPtr = std::shared_ptr; -// 引数リスト または initializer_list+引数リスト から構築可能な型 +// 引数リスト または 初期化子リスト+引数リスト から構築可能な型 struct ComplexType { std::string data; std::vector seq; @@ -297,6 +298,9 @@ int main() * value[link value.md.nolink] * error[link error.md.nolink] * std::unexpected[link ../unexpected.md] +* std::unexpect[link ../unexpect_t.md] +* std::in_place[link /reference/utility/in_place_t.md] +* std::make_unique[link /reference/memory/make_unique.md] ### 出力 ``` From 44e51113a40fd217b00231ee404f8e42649a0666 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 31 Jan 2023 14:11:27 +0900 Subject: [PATCH 0131/3948] =?UTF-8?q?expected/expected:=20operator=3D?= =?UTF-8?q?=E8=AA=BF=E6=95=B4(#1066)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit パラメータ名明記, 内部リンク追加 --- reference/expected/expected/op_assign.md | 38 ++++++++++--------- reference/expected/expected/op_constructor.md | 4 +- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/reference/expected/expected/op_assign.md b/reference/expected/expected/op_assign.md index 103e901f9e..0f9011829b 100644 --- a/reference/expected/expected/op_assign.md +++ b/reference/expected/expected/op_assign.md @@ -6,18 +6,18 @@ * cpp23[meta cpp] ```cpp -constexpr expected& operator=(const expected&); // (1) +constexpr expected& operator=(const expected& rhs); // (1) -constexpr expected& operator=(expected&&) noexcept(see below); // (2) +constexpr expected& operator=(expected&& rhs) noexcept(see below); // (2) template -constexpr expected& operator=(U&&); // (3) +constexpr expected& operator=(U&& v); // (3) template -constexpr expected& operator=(const unexpected&); // (4) +constexpr expected& operator=(const unexpected& e); // (4) template -constexpr expected& operator=(unexpected&&); // (5) +constexpr expected& operator=(unexpected&& e); // (5) ``` * see below[italic] * unexpected[link ../unexpected.md] @@ -65,7 +65,8 @@ constexpr void reinit-expected(T& newval, U& oldval, Args&&... args) { * destroy_at[link /reference/memory/destroy_at.md] * is_nothrow_constructible_v[link /reference/type_traits/is_nothrow_constructible.md] * is_nothrow_move_constructible_v[link /reference/type_traits/is_nothrow_move_constructible.md] - +* std::forward[link /reference/utility/forward.md] +* std::move[link /reference/utility/move.md] ## テンプレートパラメータ制約 - (2) : 下記を全て満たすこと @@ -93,26 +94,26 @@ constexpr void reinit-expected(T& newval, U& oldval, Args&&... args) { ## 効果 - (1) : 次の処理を行ったのち、例外が送出されなければ、`has_val = rhs.`[`has_value()`](has_value.md.nolink)`; return *this;` - - `this`と`rhs`が共に正常値を保持していたら、`val = *rhs` + - `this`と`rhs`が共に正常値を保持していたら、`val =` [`*rhs`](op_deref.md) - `this`が正常値を保持し、`rhs`がエラー値を保持していたら、`reinit-expected(unex, val, rhs.`[`error()`](error.md.nolink)`)` - - `this`がエラーを保持し、`rhs`が正常値を保持していたら、`reinit-expected(val, unex, *rhs)` + - `this`がエラーを保持し、`rhs`が正常値を保持していたら、`reinit-expected(val, unex,` [`*rhs`](op_deref.md)`)` - `this`と`rhs`が共にエラー値を保持していたら、`unex = rhs.`[`error()`](error.md.nolink) - (2) : 次の処理を行ったのち、例外が送出されなければ、`has_val = rhs.`[`has_value()`](has_value.md.nolink)`; return *this;` - - `this`と`rhs`が共に正常値を保持していたら、`val = std::move(*rhs)` - - `this`が正常値を保持し、`rhs`がエラー値を保持していたら、`reinit-expected(unex, val, std::move(rhs.`[`error()`](error.md.nolink)`))` - - `this`がエラーを保持し、`rhs`が正常値を保持していたら、`reinit-expected(val, unex, std::move(*rhs))` - - `this`と`rhs`が共にエラー値を保持していたら、`unex = std::move(rhs.`[`error()`](error.md.nolink)`)` + - `this`と`rhs`が共に正常値を保持していたら、`val =` [`std::move`](/reference/utility/move.md)`(`[`*rhs`](op_deref.md)`)` + - `this`が正常値を保持し、`rhs`がエラー値を保持していたら、`reinit-expected(unex, val,` [`std::move`](/reference/utility/move.md)`(rhs.`[`error()`](error.md.nolink)`))` + - `this`がエラーを保持し、`rhs`が正常値を保持していたら、`reinit-expected(val, unex,` [`std::move`](/reference/utility/move.md)`(`[`*rhs`](op_deref.md)`))` + - `this`と`rhs`が共にエラー値を保持していたら、`unex` [`std::move`](/reference/utility/move.md)`(rhs.`[`error()`](error.md.nolink)`)` - (3) : 次の処理と等価 - - `this`が正常値を保持していたら、`val = std::forward(v)` - - `this`がエラー値を保持していたら、`reinit-expected(val, unex, std::forward(v)); has_val = true;` + - `this`が正常値を保持していたら、`val =` [`std::forward`](/reference/utility/forward.md)`(v)` + - `this`がエラー値を保持していたら、`reinit-expected(val, unex,` [`std::forward`](/reference/utility/forward.md)`(v)); has_val = true;` - (4) : 次の処理と等価 - - `this`が正常値を保持していたら、`reinit-expected(unex, val, std::forward(e.`[`error()`](error.md.nolink)`)); + - `this`が正常値を保持していたら、`reinit-expected(unex, val,` [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpectederror.md.nolink)`)); has_val = false;` - - `this`がエラー値を保持していたら、`unex = std::forward(e.`[`error()`](error.md.nolink)`);` + - `this`がエラー値を保持していたら、`unex =` [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md.nolink)`);` - (5) : 次の処理と等価 - - `this`が正常値を保持していたら、`reinit-expected(unex, val, std::forward(e.`[`error()`](error.md.nolink)`)); + - `this`が正常値を保持していたら、`reinit-expected(unex, val,` [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpectederror.md.nolink)`)); has_val = false;` - - `this`がエラー値を保持していたら、`unex = std::forward(e.`[`error()`](error.md.nolink)`);` + - `this`がエラー値を保持していたら、`unex =` [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpectederror.md.nolink)`);` ## 戻り値 @@ -224,6 +225,7 @@ int main() * value[link value.md.nolink] * error[link error.md.nolink] * std::unexpected[link ../unexpected.md] +* std::make_unique[link /reference/memory/make_unique.md] ### 出力 ``` diff --git a/reference/expected/expected/op_constructor.md b/reference/expected/expected/op_constructor.md index d5e086445b..b2994975d2 100644 --- a/reference/expected/expected/op_constructor.md +++ b/reference/expected/expected/op_constructor.md @@ -108,8 +108,8 @@ constexpr bool converts-from-any-cvref = - (4) : `rhs`が正常値を保持していれば、[`std::forward`](/reference/utility/forward.md)`(`[`*rhs`](op_deref.md)`)`で正常値を直接非リスト初期化する。そうでなければ、[`std::forward`](/reference/utility/forward.md)`(rhs.`[`error()`](error.md.nolink)`)`でエラー値を直接非リスト初期化する。 - (5) : `rhs`が正常値を保持していれば、[`std::forward`](/reference/utility/forward.md)`(`[`*rhs`](op_deref.md)`)`で正常値を直接非リスト初期化する。そうでなければ、[`std::forward`](/reference/utility/forward.md)`(rhs.`[`error()`](error.md.nolink)`)`でエラー値を直接非リスト初期化する。 - (6) : [`std::forward`](/reference/utility/forward.md)`(v)`で正常値を直接非リスト初期化する。 -- (7) : [`std::forward`](/reference/utility/forward.md)`(rhs.`[`error()`](error.md.nolink)`)`でエラー値を直接非リスト初期化する。 -- (8) : [`std::forward`](/reference/utility/forward.md)`(rhs.`[`error()`](error.md.nolink)`)`でエラー値を直接非リスト初期化する。 +- (7) : [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md.nolink)`)`でエラー値を直接非リスト初期化する。 +- (8) : [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md.nolink)`)`でエラー値を直接非リスト初期化する。 - (9) : [`std::forward`](/reference/utility/forward.md)`(args)...`で正常値を直接非リスト初期化する。 - (10) : `il,` [`std::forward`](/reference/utility/forward.md)`(args)...`で正常値を直接非リスト初期化する。 - (11) : [`std::forward`](/reference/utility/forward.md)`(args)...`でエラー値を直接非リスト初期化する。 From 0bd721d4509759a70a2f56a2e6f7b77f99df7eaf Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 31 Jan 2023 14:35:20 +0900 Subject: [PATCH 0132/3948] =?UTF-8?q?=20:=20print(ln),=20vprint?= =?UTF-8?q?=5F(non)unicode=E3=82=92=E8=BF=BD=E5=8A=A0=20#1082?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/format.md | 4 +- reference/ostream.md | 12 +++ reference/ostream/print.md | 107 +++++++++++++++++++++++++ reference/ostream/println.md | 75 +++++++++++++++++ reference/ostream/vprint_nonunicode.md | 57 +++++++++++++ reference/ostream/vprint_unicode.md | 70 ++++++++++++++++ reference/print/print.md | 2 +- reference/print/println.md | 2 +- reference/print/vprint_nonunicode.md | 2 +- reference/print/vprint_unicode.md | 6 +- 10 files changed, 329 insertions(+), 8 deletions(-) create mode 100644 reference/ostream/print.md create mode 100644 reference/ostream/println.md create mode 100644 reference/ostream/vprint_nonunicode.md create mode 100644 reference/ostream/vprint_unicode.md diff --git a/reference/format/format.md b/reference/format/format.md index 5b94a42d8f..f8a57a28fe 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -580,8 +580,8 @@ wstring format(const locale& loc, wformat_string fmt, const Args&... ar - [`std::print()`](/reference/print/print.md) - [`std::println()`](/reference/print/println.md) - [``](/reference/ostream.md) - - [`std::print()`](/reference/ostream/print.md.nolink) - - [`std::println()`](/reference/ostream/println.md.nolink) + - [`std::print()`](/reference/ostream/print.md) + - [`std::println()`](/reference/ostream/println.md) ## 参照 diff --git a/reference/ostream.md b/reference/ostream.md index 222d3294b0..638dd6be11 100644 --- a/reference/ostream.md +++ b/reference/ostream.md @@ -20,6 +20,18 @@ | [`emit_on_flush`](ostream/emit_on_flush.md) | [`std::basic_osyncstream`](syncstream/basic_osyncstream.md)の同期時排出ポリシーを`true`にする | C++20 | | [`noemit_on_flush`](ostream/noemit_on_flush.md) | [`std::basic_osyncstream`](syncstream/basic_osyncstream.md)の同期時排出ポリシーを`false`にする | C++20 | + +## print関数 + +| 名前 | 説明 | 対応バージョン | +|-----------------|----------------|-------| +| [`print`](ostream/print.md) | 書式指定で出力する (function template) | C++23 | +| [`println`](ostream/println.md) | 書式指定で出力する。末尾改行付き (function template) | C++23 | +| [`vprint_unicode`](ostream/vprint_unicode.md) | 書式指定でUnicode出力する (function) | C++23 | +| [`vprint_nonunicode`](ostream/vprint_nonunicode.md) | 書式指定で非Unicode出力する (function) | C++23 | + + ## バージョン ### 言語 - C++98 + diff --git a/reference/ostream/print.md b/reference/ostream/print.md new file mode 100644 index 0000000000..507b72ead9 --- /dev/null +++ b/reference/ostream/print.md @@ -0,0 +1,107 @@ +# print +* ostream[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template + void print(ostream& os, + format_string fmt, + Args&&... args); // (1) C++23 +} +``` +* format_string[link /reference/format/format_string.md.nolink] +* ostream[link basic_ostream.md] + +## 概要 +書式指定で出力する。 + +書式は[`std::format()`](/reference/format/format.md)関数のページを参照。 + +この関数は、[`std::printf()`](/reference/cstdio/printf.md.nolink)関数ライクな書式指定で引数を文字列化して出力する。 + +- (1) : 指定した[`ostream`](basic_ostream.md)に、書式指定で出力する + +この関数は、末尾に改行コードが付かないことに注意。改行コードを自動で付けたい場合は、[`std::println()`](println.md)関数を使用すること。 + +デフォルトの標準出力に出力したい場合は、[``](/reference/print.md)ヘッダの[`std::print()`](/reference/print/print.md)関数を使用すること。 + + +## 効果 +- (1) : 通常の文字列リテラルがUTF-8エンコーディングされている場合、以下と等価: + ```cpp + vprint_unicode(os, fmt.get(), make_format_args(std::forward(args)...)); + ``` + * vprint_unicode[link vprint_unicode.md] + * fmt.get()[link /reference/format/format_string/get.md.nolink] + * make_format_args[link /reference/format/make_format_args.md] + * std::forward[link /reference/utility/forward.md] + + - そうでなければ、以下と等価: + ```cpp + vprint_nonunicode(os, fmt.get(), make_format_args(std::forward(args)...)); + ``` + * vprint_nonunicode[link vprint_nonunicode.md] + * fmt.get()[link /reference/format/format_string/get.md.nolink] + * make_format_args[link /reference/format/make_format_args.md] + * std::forward[link /reference/utility/forward.md] + + +## 備考 +- LinuxやmacOSといった環境では、通常の`char`配列の文字列リテラルはUTF-8にエンコーディングされる +- WindowsのVisual Studioにおいては、ソースコードと実行時文字集合をUTF-8にする[`/utf-8`オプション](https://learn.microsoft.com/en-us/cpp/build/reference/utf-8-set-source-and-executable-character-sets-to-utf-8?view=msvc-170)を使用することで、通常の`char`配列の文字列リテラルがUTF-8にエンコーディングされる +- 「通常の文字列リテラルがUTF-8エンコーディングされている場合」という仕様は、コードでは以下のように表現できる: + ```cpp + constexpr bool is_utf8() { + const unsigned char micro[] = "\u00B5"; + return sizeof(micro) == 3 && micro[0] == 0xC2 && micro[1] == 0xB5; + } + + template + void print(string_view fmt, const Args&... args) { + if (is_utf8()) + vprint_unicode(fmt, make_format_args(args...)); + else + vprint_nonunicode(fmt, make_format_args(args...)); + } + ``` + * vprint_unicode[link vprint_unicode.md] + * vprint_nonunicode[link vprint_nonunicode.md] + + +## 例 +```cpp example +#include + +int main() +{ + std::print(std::cout, "Hello {} World\n", 42); +} +``` +* std::print[color ff0000] + +### 出力 +``` +Hello 42 World +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`std::format()`](/reference/format/format.md) +- [`std::println()`](println.md) + + +## 参照 +- [P2093R14 Formatted output](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2093r14.html) diff --git a/reference/ostream/println.md b/reference/ostream/println.md new file mode 100644 index 0000000000..7924f33b3c --- /dev/null +++ b/reference/ostream/println.md @@ -0,0 +1,75 @@ +# println +* ostream[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template + void println(ostream& os, + format_string fmt, + Args&&... args); // (1) C++23 +} +``` +* format_string[link /reference/format/format_string.md.nolink] +* ostream[link basic_ostream.md] + +## 概要 +書式指定で出力する。この関数は、出力の末尾に改行コードが自動で付加される。 + +書式は[`std::format()`](/reference/format/format.md)関数のページを参照。 + +この関数は、[`std::printf()`](/reference/cstdio/printf.md.nolink)関数ライクな書式指定で引数を文字列化して出力する。 + +- (1) : 指定した[`ostream`](basic_ostream.md)に、書式指定で出力する + +この関数は、末尾に改行コードが付くことに注意。改行コードが不要な場合は、[`std::print()`](print.md)関数を使用すること。 + +デフォルトの標準出力に出力したい場合は、[``](/reference/print.md)ヘッダの[`std::println()`](/reference/print/println.md)関数を使用すること。 + + +## 効果 +- (1) : 以下と等価: + ```cpp + print(os, "{}\n", format(fmt, std::forward(args)...)); + ``` + * print[link print.md] + * format[link /reference/format/format.md] + * std::forward[link /reference/utility/forward.md] + + +## 例 +```cpp example +#include + +int main() +{ + std::println(std::cout, "Hello {} World", 42); +} +``` +* std::println[color ff0000] + +### 出力 +``` +Hello 42 World +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`std::format()`](/reference/format/format.md) +- [`std::print()`](print.md) + + +## 参照 +- [P2093R14 Formatted output](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2093r14.html) diff --git a/reference/ostream/vprint_nonunicode.md b/reference/ostream/vprint_nonunicode.md new file mode 100644 index 0000000000..bdc2408f35 --- /dev/null +++ b/reference/ostream/vprint_nonunicode.md @@ -0,0 +1,57 @@ +# vprint_nonunicode +* ostream[meta header] +* std[meta namespace] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + void vprint_nonunicode(ostream& os, + string_view fmt, + format_args args); // (1) C++23 +} +``` +* ostream[link basic_ostream.md] +* format_args[link /reference/format/basic_format_args.md] + +## 概要 +書式指定で非Unicode出力する。 + +- (1) : 指定した[`ostream`](basic_ostream.md)に、書式指定で非Unicode出力する + +デフォルトの標準出力に出力したい場合は、[``](/reference/print.md)ヘッダの[`std::vprint_nonunicode()`](/reference/print/vprint_nonunicode.md)関数を使用すること。 + + +## 効果 +- `os`の書式化出力関数として振る舞うが、以下の点が異なる: + - 出力の生成失敗は、以下で規定されるように報告される + - [`vformat()`](/reference/format/vformat.md)関数よって送出された例外は、[`os.exceptions()`](/reference/ios/basic_ios/exceptions.md)の値に関係なく、また`os`のエラー状態として[`ios_base`](/reference/ios/ios_base.md)`::`[`badbit`](/reference/ios/ios_base/type-iostate.md)をオンにすることなく、伝播される。 +- `sentry`オブジェクトを構築した後、以下のように自動変数を初期化する: + ```cpp + string out = vformat(fmt, args); + ``` + * string[link /reference/string/basic_string.md] + * vformat[link /reference/format/vformat.md] + +- 文字シーケンス `[`[`out.begin()`](/reference/string/basic_string/begin.md)`,` [`out.end()`](/reference/string/basic_string/end.md)`)` を `os` に挿入する。端末への書き込みまたは `os` への挿入が失敗した場合、[`os.setstate`](/reference/ios/basic_ios.md)`(`[`ios_base`](/reference/ios/ios_base.md)`::`[`badbit`](/reference/ios/ios_base/type-iostate.md)`)` を呼び出す ([`ios_base`](/reference/ios/ios_base.md)`::`[`failure`](/reference/ios/ios_base/failure.md)が送出される可能性がある) + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`std::print()`](print.md) +- [`std::println()`](println.md) +- [`std::vprint_unicode()`](vprint_nonunicode.md) + + +## 参照 +- [P2093R14 Formatted output](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2093r14.html) diff --git a/reference/ostream/vprint_unicode.md b/reference/ostream/vprint_unicode.md new file mode 100644 index 0000000000..ecc6b6f575 --- /dev/null +++ b/reference/ostream/vprint_unicode.md @@ -0,0 +1,70 @@ +# vprint_unicode +* ostream[meta header] +* std[meta namespace] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + void vprint_unicode(ostream& os, + string_view fmt, + format_args args); // (1) C++23 +} +``` +* ostream[link /reference/ostream/basic_ostream.md] +* format_args[link /reference/format/basic_format_args.md] + +## 概要 +書式指定でUnicode出力する。 + +- (1) : 指定した[`ostream`](basic_ostream.md)に、書式指定でUnicode出力する + +デフォルトの標準出力に出力したい場合は、[``](/reference/print.md)ヘッダの[`std::vprint_unicode()`](/reference/print/vprint_unicode.md)関数を使用すること。 + + +## 効果 +- `os`の書式化出力関数として振る舞うが、以下の点が異なる: + - 出力の生成失敗は、以下で規定されるように報告される + - [`vformat()`](/reference/format/vformat.md)関数よって送出された例外は、[`os.exceptions()`](/reference/ios/basic_ios/exceptions.md)の値に関係なく、また`os`のエラー状態として[`ios_base`](/reference/ios/ios_base.md)`::`[`badbit`](/reference/ios/ios_base/type-iostate.md)をオンにすることなく、伝播される。 +- `sentry`オブジェクトを構築した後、以下のように自動変数を初期化する: + ```cpp + string out = vformat(fmt, args); + ``` + * string[link /reference/string/basic_string.md] + * vformat[link /reference/format/vformat.md] + +- `os`が実装定義されたUnicodeを表示できる端末を参照するストリームである場合、ネイティブのUnicode APIを使用して端末に書き出す +- `out`に無効なコードユニットが含まれる場合、その動作は未定義であり,実装者はそれを診断することが推奨される +- ネイティブのUnicode APIを使用する場合、この関数は`out`を書き出す前にフラッシュする + + +## 例外 +- [`vformat()`](/reference/format/vformat.md)関数がなんらかの例外を送出する可能性がある +- 端末かストリームへの書き込みに失敗した場合、[`system_error`](/reference/system_error/system_error.md)を送出する +- [`bad_alloc`](/reference/new/bad_alloc.md)を送出する可能性がある + + +## 備考 +- 推奨の方式:ネイティブのUnicode APIを呼び出す際に文字コード変換が必要な場合、実装はUnicode標準 (Unicode Standard Version 14.0 - Core Specification, Chapter 3.9) に従って無効なコードユニットを「U+FFFD REPLACEMENT CHARACTER」で置き換える必要がある + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`std::print()`](print.md) +- [`std::println()`](println.md) +- [`std::vprint_nonunicode()`](vprint_nonunicode.md) + + +## 参照 +- [P2093R14 Formatted output](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2093r14.html) +- [P2539R4 Should the output of `std::print` to a terminal be synchronized with the underlying stream?](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2539r4.html) diff --git a/reference/print/print.md b/reference/print/print.md index 035692dca3..088c0647bd 100644 --- a/reference/print/print.md +++ b/reference/print/print.md @@ -31,7 +31,7 @@ namespace std { この関数は、末尾に改行コードが付かないことに注意。改行コードを自動で付けたい場合は、[`std::println()`](println.md)関数を使用すること。 -[`std::ostream`](/reference/ostream/basic_ostream.md)から派生したクラスオブジェクトに対して出力したい場合は、[``](/reference/ostream.md)ヘッダの[`std::print()`](/reference/ostream/print.md.nolink)関数を使用すること。 +[`std::ostream`](/reference/ostream/basic_ostream.md)から派生したクラスオブジェクトに対して出力したい場合は、[``](/reference/ostream.md)ヘッダの[`std::print()`](/reference/ostream/print.md)関数を使用すること。 ## 効果 diff --git a/reference/print/println.md b/reference/print/println.md index 54cc70128e..5ecd8f35ac 100644 --- a/reference/print/println.md +++ b/reference/print/println.md @@ -31,7 +31,7 @@ namespace std { この関数は、末尾に改行コードが付くことに注意。改行コードが不要な場合は、[`std::print()`](print.md)関数を使用すること。 -[`std::ostream`](/reference/ostream/basic_ostream.md)から派生したクラスオブジェクトに対して出力したい場合は、[``](/reference/ostream.md)ヘッダの[`std::print()`](/reference/ostream/println.md.nolink)関数を使用すること。 +[`std::ostream`](/reference/ostream/basic_ostream.md)から派生したクラスオブジェクトに対して出力したい場合は、[``](/reference/ostream.md)ヘッダの[`std::print()`](/reference/ostream/println.md)関数を使用すること。 ## 効果 diff --git a/reference/print/vprint_nonunicode.md b/reference/print/vprint_nonunicode.md index 22f5842c10..cc4d0accc9 100644 --- a/reference/print/vprint_nonunicode.md +++ b/reference/print/vprint_nonunicode.md @@ -23,7 +23,7 @@ namespace std { - (1) : 標準出力に、書式指定で非Unicode出力する - (2) : 指定された[`FILE`](/reference/cstdio/file.md.nolink)に、書式指定で非Unicode出力する -[`std::ostream`](/reference/ostream/basic_ostream.md)から派生したクラスオブジェクトに対して出力したい場合は、[``](/reference/ostream.md)ヘッダの[`std::vprint_nonunicode()`](/reference/ostream/vprint_nonunicode.md.nolink)関数を使用すること。 +[`std::ostream`](/reference/ostream/basic_ostream.md)から派生したクラスオブジェクトに対して出力したい場合は、[``](/reference/ostream.md)ヘッダの[`std::vprint_nonunicode()`](/reference/ostream/vprint_nonunicode.md)関数を使用すること。 ## 事前条件 diff --git a/reference/print/vprint_unicode.md b/reference/print/vprint_unicode.md index ed2ae9e2bf..a231b83ec6 100644 --- a/reference/print/vprint_unicode.md +++ b/reference/print/vprint_unicode.md @@ -23,7 +23,7 @@ namespace std { - (1) : 標準出力に、書式指定でUnicode出力する - (2) : 指定された[`FILE`](/reference/cstdio/file.md.nolink)に、書式指定でUnicode出力する -[`std::ostream`](/reference/ostream/basic_ostream.md)から派生したクラスオブジェクトに対して出力したい場合は、[``](/reference/ostream.md)ヘッダの[`std::vprint_unicode()`](/reference/ostream/vprint_unicode.md.nolink)関数を使用すること。 +[`std::ostream`](/reference/ostream/basic_ostream.md)から派生したクラスオブジェクトに対して出力したい場合は、[``](/reference/ostream.md)ヘッダの[`std::vprint_unicode()`](/reference/ostream/vprint_unicode.md)関数を使用すること。 ## 事前条件 @@ -44,9 +44,9 @@ namespace std { * string[link /reference/string/basic_string.md] * vformat[link /reference/format/vformat.md] - - `stream`がUnicodeを表示できる端末を参照している場合、ネイティブのUnicode APIを使用して端末に書き出す。`out`が無効なコードユニットを含んでいる場合、その動作は未定義であり、実装はそれを診断することが望まれる。 + - `stream`がUnicodeを表示できる端末を参照している場合、ネイティブのUnicode APIを使用して端末に書き出す - `out`に無効なコードユニットが含まれる場合、その動作は未定義であり,実装者はそれを診断することが推奨される。それ以外の場合は、変更せずにストリームに書き出します。そうでなければ、変更せず`stream`に`out`を書き出す。 - - ネイティブのUnicode APIを使用する場合、この関数は`out`に書き出す前にフラッシュする + - ネイティブのUnicode APIを使用する場合、この関数は`out`を書き出す前にフラッシュする ## 例外 From bc23c7365769749001533e451b3b02d8b53c3ee8 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 31 Jan 2023 15:24:21 +0900 Subject: [PATCH 0133/3948] expected/expected: operator bool,has_value,value,error(#1066) --- reference/expected/expected.md | 9 ++- reference/expected/expected/error.md | 70 ++++++++++++++++ reference/expected/expected/has_value.md | 65 +++++++++++++++ reference/expected/expected/op_arrow.md | 5 +- reference/expected/expected/op_assign.md | 24 +++--- reference/expected/expected/op_bool.md | 77 ++++++++++++++++++ reference/expected/expected/op_constructor.md | 18 ++--- reference/expected/expected/op_deref.md | 5 +- reference/expected/expected/value.md | 80 +++++++++++++++++++ 9 files changed, 324 insertions(+), 29 deletions(-) create mode 100644 reference/expected/expected/error.md create mode 100644 reference/expected/expected/has_value.md create mode 100644 reference/expected/expected/op_bool.md create mode 100644 reference/expected/expected/value.md diff --git a/reference/expected/expected.md b/reference/expected/expected.md index 990f3020ff..e002aae204 100644 --- a/reference/expected/expected.md +++ b/reference/expected/expected.md @@ -49,11 +49,12 @@ namespace std { |-----------------|----------------|-------| | [`operator->`](expected/op_arrow.md) | 正常値へのメンバアクセス | C++23 | | [`operator*`](expected/op_deref.md) | 正常値への間接参照 | C++23 | -| [`operator bool`](expected/op_bool.md.nolink) | 正常値を保持しているかを判定する | C++23 | -| [`has_value`](expected/has_value.md.nolink) | 正常値を保持しているかを判定する | C++23 | -| [`value`](expected/value.md.nolink) | 正常値を取得する | C++23 | -| [`error`](expected/error.md.nolink) | エラー値を取得する | C++23 | +| [`operator bool`](expected/op_bool.md) | 正常値を保持しているかを判定する | C++23 | +| [`has_value`](expected/has_value.md) | 正常値を保持しているかを判定する | C++23 | +| [`value`](expected/value.md) | 正常値を取得する | C++23 | +| [`error`](expected/error.md) | エラー値を取得する | C++23 | | [`value_or`](expected/value_or.md.nolink) | 正常値もしくは指定された値を取得する | C++23 | +| [`error_or`](expected/error_or.md.nolink) | エラー値もしくは指定された値を取得する | C++23 | ### モナド操作 diff --git a/reference/expected/expected/error.md b/reference/expected/expected/error.md new file mode 100644 index 0000000000..5ac4883f9b --- /dev/null +++ b/reference/expected/expected/error.md @@ -0,0 +1,70 @@ +# error +* expected[meta header] +* function[meta id-type] +* std[meta namespace] +* expected[meta class] +* cpp23[meta cpp] + +```cpp +constexpr const E& error() const & noexcept; // (1) +constexpr E& error() & noexcept; // (2) +constexpr const E&& error() const && noexcept; // (3) +constexpr E&& error() && noexcept; // (4) +``` + +## 概要 +エラー値を取得する。 + + +## 戻り値 +動作説明用のメンバ変数として、エラー値を保持する`unex`を導入する。 + +- (1), (2) : [`has_value()`](has_value.md) `== false`ならば、`unex` +- (3), (4) : [`has_value()`](has_value.md) `== false`ならば、[`std::move`](/reference/utility/move.md)`(unex)` + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include +#include +#include + +int main() +{ + std::expected x = std::unexpected{"ERR"}; + assert(not x.has_value()); + std::cout << x.error() << std::endl; +} +``` +* error()[color ff0000] +* has_value()[link has_value.md] +* std::unexpected[link ../unexpected.md] + +### 出力 +``` +ERR +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`error_or`](error_or.md.nolink) + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) diff --git a/reference/expected/expected/has_value.md b/reference/expected/expected/has_value.md new file mode 100644 index 0000000000..a828c2a92a --- /dev/null +++ b/reference/expected/expected/has_value.md @@ -0,0 +1,65 @@ +# has_value +* expected[meta header] +* function[meta id-type] +* std[meta namespace] +* expected[meta class] +* cpp23[meta cpp] + +```cpp +constexpr bool has_value() const noexcept; +``` + +## 概要 +正常値を保持しているかを判定する。 + + +## 戻り値 +正常値を保持しているなら`true`を返し、エラー値を保持しているなら`false`を返す。 + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::expected x = "Hello"; + std::cout << x.has_value() << std::endl; + + std::expected y = std::unexpected{42}; + std::cout << y.has_value() << std::endl; +} +``` +* has_value[color ff0000] +* std::unexpected[link ../unexpected.md] + +### 出力 +``` +1 +0 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`operator bool`](op_bool.md) + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) diff --git a/reference/expected/expected/op_arrow.md b/reference/expected/expected/op_arrow.md index 8ee18c8a0c..dc0a82aa5f 100644 --- a/reference/expected/expected/op_arrow.md +++ b/reference/expected/expected/op_arrow.md @@ -15,7 +15,7 @@ constexpr T* operator->() noexcept; // (2) ## 事前条件 -[`has_value()`](has_value.md.nolink) `== true` +[`has_value()`](has_value.md) `== true` ## 戻り値 @@ -64,7 +64,8 @@ int main() ## 関連項目 - [`operator*`](op_deref.md) -- [`value`](value.md.nolink) +- [`value()`](value.md) +- [`value_or()`](value_or.md.nolink) ## 参照 diff --git a/reference/expected/expected/op_assign.md b/reference/expected/expected/op_assign.md index 0f9011829b..3b1023df32 100644 --- a/reference/expected/expected/op_assign.md +++ b/reference/expected/expected/op_assign.md @@ -93,27 +93,27 @@ constexpr void reinit-expected(T& newval, U& oldval, Args&&... args) { ## 効果 -- (1) : 次の処理を行ったのち、例外が送出されなければ、`has_val = rhs.`[`has_value()`](has_value.md.nolink)`; return *this;` +- (1) : 次の処理を行ったのち、例外が送出されなければ、`has_val = rhs.`[`has_value()`](has_value.md)`; return *this;` - `this`と`rhs`が共に正常値を保持していたら、`val =` [`*rhs`](op_deref.md) - - `this`が正常値を保持し、`rhs`がエラー値を保持していたら、`reinit-expected(unex, val, rhs.`[`error()`](error.md.nolink)`)` + - `this`が正常値を保持し、`rhs`がエラー値を保持していたら、`reinit-expected(unex, val, rhs.`[`error()`](error.md)`)` - `this`がエラーを保持し、`rhs`が正常値を保持していたら、`reinit-expected(val, unex,` [`*rhs`](op_deref.md)`)` - - `this`と`rhs`が共にエラー値を保持していたら、`unex = rhs.`[`error()`](error.md.nolink) -- (2) : 次の処理を行ったのち、例外が送出されなければ、`has_val = rhs.`[`has_value()`](has_value.md.nolink)`; return *this;` + - `this`と`rhs`が共にエラー値を保持していたら、`unex = rhs.`[`error()`](error.md) +- (2) : 次の処理を行ったのち、例外が送出されなければ、`has_val = rhs.`[`has_value()`](has_value.md)`; return *this;` - `this`と`rhs`が共に正常値を保持していたら、`val =` [`std::move`](/reference/utility/move.md)`(`[`*rhs`](op_deref.md)`)` - - `this`が正常値を保持し、`rhs`がエラー値を保持していたら、`reinit-expected(unex, val,` [`std::move`](/reference/utility/move.md)`(rhs.`[`error()`](error.md.nolink)`))` + - `this`が正常値を保持し、`rhs`がエラー値を保持していたら、`reinit-expected(unex, val,` [`std::move`](/reference/utility/move.md)`(rhs.`[`error()`](error.md)`))` - `this`がエラーを保持し、`rhs`が正常値を保持していたら、`reinit-expected(val, unex,` [`std::move`](/reference/utility/move.md)`(`[`*rhs`](op_deref.md)`))` - - `this`と`rhs`が共にエラー値を保持していたら、`unex` [`std::move`](/reference/utility/move.md)`(rhs.`[`error()`](error.md.nolink)`)` + - `this`と`rhs`が共にエラー値を保持していたら、`unex` [`std::move`](/reference/utility/move.md)`(rhs.`[`error()`](error.md)`)` - (3) : 次の処理と等価 - `this`が正常値を保持していたら、`val =` [`std::forward`](/reference/utility/forward.md)`(v)` - `this`がエラー値を保持していたら、`reinit-expected(val, unex,` [`std::forward`](/reference/utility/forward.md)`(v)); has_val = true;` - (4) : 次の処理と等価 - - `this`が正常値を保持していたら、`reinit-expected(unex, val,` [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpectederror.md.nolink)`)); + - `this`が正常値を保持していたら、`reinit-expected(unex, val,` [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md.nolink)`)); has_val = false;` - `this`がエラー値を保持していたら、`unex =` [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md.nolink)`);` - (5) : 次の処理と等価 - - `this`が正常値を保持していたら、`reinit-expected(unex, val,` [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpectederror.md.nolink)`)); + - `this`が正常値を保持していたら、`reinit-expected(unex, val,` [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md.nolink)`)); has_val = false;` - - `this`がエラー値を保持していたら、`unex =` [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpectederror.md.nolink)`);` + - `this`がエラー値を保持していたら、`unex =` [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md.nolink)`);` ## 戻り値 @@ -221,9 +221,9 @@ int main() } } ``` -* has_value[link has_value.md.nolink] -* value[link value.md.nolink] -* error[link error.md.nolink] +* has_value[link has_value.md] +* value[link value.md] +* error[link error.md] * std::unexpected[link ../unexpected.md] * std::make_unique[link /reference/memory/make_unique.md] diff --git a/reference/expected/expected/op_bool.md b/reference/expected/expected/op_bool.md new file mode 100644 index 0000000000..684f32e4b8 --- /dev/null +++ b/reference/expected/expected/op_bool.md @@ -0,0 +1,77 @@ +# operator bool +* expected[meta header] +* function[meta id-type] +* std[meta namespace] +* expected[meta class] +* cpp23[meta cpp] + +```cpp +constexpr explicit operator bool() const noexcept; +``` + +## 概要 +正常値を保持しているかを判定する。 + + +## 戻り値 +正常値を保持しているなら`true`を返し、エラー値を保持しているなら`false`を返す。 + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::expected x = "Hello"; + if (x) { + std::cout << "val=" << *x << std::endl; + } else { + std::cout << "unex=" << x.error() << std::endl; + } + + std::expected y = std::unexpected{42}; + if (y) { + std::cout << "val=" << *y << std::endl; + } else { + std::cout << "unex=" << y.error() << std::endl; + } +} +``` +* (x)[color ff0000] +* (y)[color ff0000] +* *x[link op_deref.md] +* *y[link op_deref.md] +* error()[link error.md] +* std::unexpected[link ../unexpected.md] + +### 出力 +``` +val=Hello +unex=42 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`operator bool`](op_bool.md) + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) diff --git a/reference/expected/expected/op_constructor.md b/reference/expected/expected/op_constructor.md index b2994975d2..564f2e7f32 100644 --- a/reference/expected/expected/op_constructor.md +++ b/reference/expected/expected/op_constructor.md @@ -103,10 +103,10 @@ constexpr bool converts-from-any-cvref = ## 効果 - (1) : 正常値を値初期化して保持する。 -- (2) : `rhs`が正常値を保持していれば、[`*rhs`](op_deref.md)で正常値を直接非リスト初期化する。そうでなければ、`rhs.`[`error()`](error.md.nolink)でエラー値を直接非リスト初期化する。 -- (3) : `rhs`が正常値を保持していれば、[`std::move`](/reference/utility/move.md)`(`[`*rhs`](op_deref.md)`)`で正常値を直接非リスト初期化する。そうでなければ、[`std::move`](/reference/utility/move.md)`(rhs.`[`error()`](error.md.nolink)`)`でエラー値を直接非リスト初期化する。 -- (4) : `rhs`が正常値を保持していれば、[`std::forward`](/reference/utility/forward.md)`(`[`*rhs`](op_deref.md)`)`で正常値を直接非リスト初期化する。そうでなければ、[`std::forward`](/reference/utility/forward.md)`(rhs.`[`error()`](error.md.nolink)`)`でエラー値を直接非リスト初期化する。 -- (5) : `rhs`が正常値を保持していれば、[`std::forward`](/reference/utility/forward.md)`(`[`*rhs`](op_deref.md)`)`で正常値を直接非リスト初期化する。そうでなければ、[`std::forward`](/reference/utility/forward.md)`(rhs.`[`error()`](error.md.nolink)`)`でエラー値を直接非リスト初期化する。 +- (2) : `rhs`が正常値を保持していれば、[`*rhs`](op_deref.md)で正常値を直接非リスト初期化する。そうでなければ、`rhs.`[`error()`](error.md)でエラー値を直接非リスト初期化する。 +- (3) : `rhs`が正常値を保持していれば、[`std::move`](/reference/utility/move.md)`(`[`*rhs`](op_deref.md)`)`で正常値を直接非リスト初期化する。そうでなければ、[`std::move`](/reference/utility/move.md)`(rhs.`[`error()`](error.md)`)`でエラー値を直接非リスト初期化する。 +- (4) : `rhs`が正常値を保持していれば、[`std::forward`](/reference/utility/forward.md)`(`[`*rhs`](op_deref.md)`)`で正常値を直接非リスト初期化する。そうでなければ、[`std::forward`](/reference/utility/forward.md)`(rhs.`[`error()`](error.md)`)`でエラー値を直接非リスト初期化する。 +- (5) : `rhs`が正常値を保持していれば、[`std::forward`](/reference/utility/forward.md)`(`[`*rhs`](op_deref.md)`)`で正常値を直接非リスト初期化する。そうでなければ、[`std::forward`](/reference/utility/forward.md)`(rhs.`[`error()`](error.md)`)`でエラー値を直接非リスト初期化する。 - (6) : [`std::forward`](/reference/utility/forward.md)`(v)`で正常値を直接非リスト初期化する。 - (7) : [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md.nolink)`)`でエラー値を直接非リスト初期化する。 - (8) : [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md.nolink)`)`でエラー値を直接非リスト初期化する。 @@ -119,8 +119,8 @@ constexpr bool converts-from-any-cvref = ## 事後条件 - (1) : 正常値を保持している。 - (2) : `rhs`が正常値を保持する場合は`*this`も正常値を保持し、`rhs`がエラー値を保持する場合は`*this`もエラー値を保持する。 -- (3) : `rhs`が正常値を保持する場合は`*this`も正常値を保持し、`rhs`がエラー値を保持する場合は`*this`もエラー値を保持する。`rhs.`[`has_value()`](has_value.md.nolink)は変化しない。 -- (4), (5) : `rhs`が正常値を保持する場合は`*this`も正常値を保持し、`rhs`がエラー値を保持する場合は`*this`もエラー値を保持する。`rhs.`[`has_value()`](has_value.md.nolink)は変化しない。 +- (3) : `rhs`が正常値を保持する場合は`*this`も正常値を保持し、`rhs`がエラー値を保持する場合は`*this`もエラー値を保持する。`rhs.`[`has_value()`](has_value.md)は変化しない。 +- (4), (5) : `rhs`が正常値を保持する場合は`*this`も正常値を保持し、`rhs`がエラー値を保持する場合は`*this`もエラー値を保持する。`rhs.`[`has_value()`](has_value.md)は変化しない。 - (6) : 正常値を保持している。 - (7), (8) : エラー値を保持している。 - (9), (10) : 正常値を保持している。 @@ -294,9 +294,9 @@ int main() } } ``` -* has_value[link has_value.md.nolink] -* value[link value.md.nolink] -* error[link error.md.nolink] +* has_value()[link has_value.md] +* value()[link value.md] +* error()[link error.md] * std::unexpected[link ../unexpected.md] * std::unexpect[link ../unexpect_t.md] * std::in_place[link /reference/utility/in_place_t.md] diff --git a/reference/expected/expected/op_deref.md b/reference/expected/expected/op_deref.md index bbe4445122..02ef3b9bed 100644 --- a/reference/expected/expected/op_deref.md +++ b/reference/expected/expected/op_deref.md @@ -17,7 +17,7 @@ constexpr const T&& operator*() const && noexcept; // (4) ## 事前条件 -[`has_value()`](has_value.md.nolink) `== true` +[`has_value()`](has_value.md) `== true` ## 戻り値 @@ -69,7 +69,8 @@ int main() ## 関連項目 - [`operator->`](op_arrow.md) -- [`value`](value.md.nolink) +- [`value()`](value.md) +- [`value_or()`](value_or.md.nolink) ## 参照 diff --git a/reference/expected/expected/value.md b/reference/expected/expected/value.md new file mode 100644 index 0000000000..c7da839541 --- /dev/null +++ b/reference/expected/expected/value.md @@ -0,0 +1,80 @@ +# value +* expected[meta header] +* function[meta id-type] +* std[meta namespace] +* expected[meta class] +* cpp23[meta cpp] + +```cpp +constexpr const T& value() const &; // (1) +constexpr T& value() &; // (2) +constexpr const T&& value() const &&; // (3) +constexpr T&& value() &&; // (4) +``` + +## 概要 +正常値を取得する。 + + +## 戻り値 +動作説明用のメンバ変数として、正常値を保持する`val`を導入する。 + +- (1), (2) : [`has_value()`](has_value.md) `== true`ならば、`val` +- (3), (4) : [`has_value()`](has_value.md) `== true`ならば、[`std::move`](/reference/utility/move.md)`(val)` + + +## 例外 +- (1), (2) : [`has_value()`](has_value.md) `== false`ならば、例外[`bad_expected_access`](../bad_expected_access.md)`(`[`error()`](error.md)`)`をスローする +- (3), (4) : [`has_value()`](has_value.md) `== false`ならば、例外[`bad_expected_access`](../bad_expected_access.md)`(`[`std::move`](/reference/utility/move.md)`(`[`error()`](error.md)`))`をスローする + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::expected x = 1; + std::cout << x.value() << std::endl; + + std::expected y = std::unexpected{"ERR"}; + try { + std::cout << y.value() << std::endl; + } catch (const std::bad_expected_access& ex) { + std::cout << "throw:" << ex.error() << std::endl; + } +} +``` +* value()[color ff0000] +* error()[link ../unexpected/error.md.nolink] +* std::unexpected[link ../unexpected.md] +* std::bad_expected_access[link ../bad_expected_access.md] + +### 出力 +``` +1 +throw:ERR +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`operator->`](op_arrow.md) +- [`operator*`](op_deref.md) +- [`value_or()`](value_or.md.nolink) + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) From b2f6285e94de2248a57d9dedff0fb64677e15227 Mon Sep 17 00:00:00 2001 From: tomolatoon Date: Wed, 1 Feb 2023 09:02:24 +0900 Subject: [PATCH 0134/3948] =?UTF-8?q?P2165R4(#1083),=20P2255R2(#1070),=20P?= =?UTF-8?q?2321R2(#1063)=20-=20P2165R4,=20P2255R2:=20=E5=85=A8=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C=20-=20P2321R2:=20`pair`/`tuple`/`vector::refere?= =?UTF-8?q?nce`=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6=E5=AF=BE=E5=BF=9C=20-?= =?UTF-8?q?=20=E4=B8=80=E9=83=A8=E8=AA=AC=E6=98=8E=E5=B0=82=E7=94=A8?= =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=82=BB=E3=83=97=E3=83=88=E3=82=92=E7=8B=AC?= =?UTF-8?q?=E7=AB=8B=E3=83=9A=E3=83=BC=E3=82=B8=E3=81=B8=20-=20`not-same-a?= =?UTF-8?q?s`=E3=82=92`different-from`=E3=81=B8=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ..._to_bool_should_be_considered_narrowing.md | 2 +- lang/cpp23.md | 4 +- reference/concepts/Invoke.md | 5 + reference/exposition-only.md | 55 ++-- reference/iterator/indirectly_writable.md | 83 +++++- reference/ranges/different-from.md | 30 ++ reference/ranges/elements_view.md | 9 + reference/ranges/has-arrow.md | 28 ++ reference/ranges/simple-view.md | 38 +++ reference/ranges/subrange.md | 56 +--- .../subrange/convertible-to-non-slicing.md | 45 +++ reference/ranges/subrange/op_constructor.md | 15 +- .../ranges/subrange/op_deduction_guide.md | 3 +- reference/ranges/subrange/op_pairlike.md | 10 +- .../subrange/pair-like-convertible-from.md | 58 ++++ ...ses-nonqualification-pointer-conversion.md | 42 +++ reference/tuple/apply.md | 18 +- reference/tuple/make_from_tuple.md | 21 +- reference/tuple/pair-like.md | 63 ++++ reference/tuple/tuple-like.md | 50 ++++ reference/tuple/tuple.md | 116 +++++++- .../tuple/tuple/basic_common_reference.md | 52 ++++ reference/tuple/tuple/common_type.md | 46 +++ reference/tuple/tuple/op_assign.md | 98 ++++-- reference/tuple/tuple/op_compare_3way.md | 16 +- reference/tuple/tuple/op_constructor.md | 279 +++++++++++++----- reference/tuple/tuple/op_equal.md | 18 +- reference/tuple/tuple/swap.md | 17 +- reference/tuple/tuple/swap_free.md | 12 +- reference/tuple/tuple_cat.md | 36 ++- reference/type_traits.md | 2 + reference/type_traits/common_reference.md | 2 +- reference/type_traits/is_invocable_r.md | 46 ++- .../reference_constructs_from_temporary.md | 156 ++++++++++ .../reference_converts_from_temporary.md | 152 ++++++++++ reference/utility/pair.md | 114 ++++++- .../utility/pair/basic_common_reference.md | 49 +++ reference/utility/pair/common_type.md | 44 +++ reference/utility/pair/op_assign.md | 82 +++-- reference/utility/pair/op_constructor.md | 111 ++++--- reference/vector/vector.md | 20 +- 41 files changed, 1816 insertions(+), 287 deletions(-) create mode 100644 reference/ranges/different-from.md create mode 100644 reference/ranges/has-arrow.md create mode 100644 reference/ranges/simple-view.md create mode 100644 reference/ranges/subrange/convertible-to-non-slicing.md create mode 100644 reference/ranges/subrange/pair-like-convertible-from.md create mode 100644 reference/ranges/subrange/uses-nonqualification-pointer-conversion.md create mode 100644 reference/tuple/pair-like.md create mode 100644 reference/tuple/tuple-like.md create mode 100644 reference/tuple/tuple/basic_common_reference.md create mode 100644 reference/tuple/tuple/common_type.md create mode 100644 reference/type_traits/reference_constructs_from_temporary.md create mode 100644 reference/type_traits/reference_converts_from_temporary.md create mode 100644 reference/utility/pair/basic_common_reference.md create mode 100644 reference/utility/pair/common_type.md diff --git a/lang/cpp20/converting_from_pointer_to_bool_should_be_considered_narrowing.md b/lang/cpp20/converting_from_pointer_to_bool_should_be_considered_narrowing.md index d4d04cedef..2df22bf8c0 100644 --- a/lang/cpp20/converting_from_pointer_to_bool_should_be_considered_narrowing.md +++ b/lang/cpp20/converting_from_pointer_to_bool_should_be_considered_narrowing.md @@ -40,7 +40,7 @@ std::variant v = b[1]; // intを保持して構築されてしまう * bitset[link /reference/bitset/bitset.md] * variant[link /reference/variant/variant.md] -`std::bitset`の非`const`な[`operator[]`](/reference/bitset/bitset/op_at.md)は`bool`型へ暗黙変換可能なプロクシオブジェクトを返す。 +`std::bitset`の非`const`な[`operator[]`](/reference/bitset/bitset/op_at.md)は`bool`型へ暗黙変換可能なプロキシオブジェクトを返す。 `std::variant`の構築・代入時に縮小変換が起こることを検出して防止することはライブラリレベルで可能だったが、ポインタ型から`bool`への変換を縮小変換として扱うということはライブラリレベルでは実装できなかったため`bool`への変換全体を禁止せざるを得ず、このような問題が発生していた。 diff --git a/lang/cpp23.md b/lang/cpp23.md index 54974e0963..8c29b9b53f 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -216,8 +216,8 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 - [``](/reference/type_traits.md)に、スコープ付き列挙型かを判定する型特性[`std::is_scoped_enum`](/reference/type_traits/is_scoped_enum.md)を追加 - [``](/reference/type_traits.md)に、第1テンプレート引数についている型修飾を外す型特性として、以下を追加: - [``](/reference/type_traits.md)に、一時オブジェクトの参照への束縛を検出するための型特性として、以下を追加: - - [`std::reference_constructs_from_temporary`](/reference/type_traits/reference_constructs_from_temporary.md.nolink) - - [`std::reference_converts_from_temporary`](/reference/type_traits/reference_converts_from_temporary.md.nolink) + - [`std::reference_constructs_from_temporary`](/reference/type_traits/reference_constructs_from_temporary.md) + - [`std::reference_converts_from_temporary`](/reference/type_traits/reference_converts_from_temporary.md) ### C互換ライブラリ diff --git a/reference/concepts/Invoke.md b/reference/concepts/Invoke.md index 45b14dc317..682d748204 100644 --- a/reference/concepts/Invoke.md +++ b/reference/concepts/Invoke.md @@ -60,6 +60,11 @@ C++における関数呼び出しという性質を抽象化しまとめた、 - それ以外の場合は、*INVOKE*`(f, t1, t2, ..., tN)` の実行結果の戻り値が型 `R` に暗黙的に変換されること。 3. すべての *call-wrapper* は、*Cpp17MoveConstructible* かつ *Cpp17Destructible* でなければならない。 +## 要件(C++23差分) +C++20 における 2. について、次の文言を項目の最後に追加する。この変更は、`R`が参照かつ*INVOKE*の実行結果が`R`に束縛されることで寿命が延長される場合にダングリング参照が作成されてしまう事例を検出するための要件である。 + +- [`reference_­converts_­from_­temporary_­v`](/reference/type_traits/reference_converts_from_temporary.md)` == true`の場合、*INVOKE*`(f, t1, t2, …, tN)`は不適格。 + ## まとめ [第1引数がメンバ関数へのポインタの場合でも非静的メンバデータへのポインタの場合でも,第2引数がクラスオブジェクトへの参照の場合でもポインタの場合でもポインタっぽいものの場合でも,なんか知らんけどそれっぽく上手くいく](https://twitter.com/Cryolite/status/216814363221303296) ように取り計らった操作のことである。 diff --git a/reference/exposition-only.md b/reference/exposition-only.md index 840cf63d74..382f98d203 100644 --- a/reference/exposition-only.md +++ b/reference/exposition-only.md @@ -1,35 +1,52 @@ # 説明専用ライブラリ + * exposition-only[meta header] このページでは、説明専用のライブラリをまとめる。 これらはC++規格の文章中に現れる説明のためのものであり、実際に使うことはできない。 -| 名前 | 説明 | 対応バージョン | -|-----------------------------------------------------------------------|-------------------------|----------------| -| [`decay-copy`](exposition-only/decay-copy.md) | [`decay`](/reference/type_traits/decay.md)した型にコピーまたはムーブする (function template) | C++20 | -| [`synth-three-way`](exposition-only/synth-three-way-result.md) | 三方比較可能であればそれを行い、そうでなければ三方比較を実装して比較を行う (variable) | C++20 | -| [`synth-three-way-result`](exposition-only/synth-three-way-result.md) | `synth-three-way`関数オブジェクトでの比較結果の型 (function template) | C++20 | +| 名前 | 説明 | 対応バージョン | +|-----------------------------------------------------------------------|-------------------------------------------------------------------------------|-----------| +| [`decay-copy`](exposition-only/decay-copy.md) | [`decay`](/reference/type_traits/decay.md)した型にコピーまたはムーブする (function template) | C++20 | +| [`synth-three-way`](exposition-only/synth-three-way-result.md) | 三方比較可能であればそれを行い、そうでなければ三方比較を実装して比較を行う (variable) | C++20 | +| [`synth-three-way-result`](exposition-only/synth-three-way-result.md) | `synth-three-way`関数オブジェクトでの比較結果の型 (function template) | C++20 | ## `` -| 名前 | 説明 | 対応バージョン | -|------|------|----------------| -| [`boolean-testable`](concepts/boolean-testable.md) | 真理値型 (concept) | C++20 | +| 名前 | 説明 | 対応バージョン | +|----------------------------------------------------|------------------|-----------| +| [`boolean-testable`](concepts/boolean-testable.md) | 真理値型 (concept) | C++20 | ## `` -| 名前 | 説明 | 対応バージョン | -|------------------------------|-------------------------------------------------|----------------| -| [`with-reference`](iterator/dereferenceable.md) | 型`T`に参照を付加する (alias template) | C++20 | -| [`can-reference`](iterator/dereferenceable.md) | `with-reference`可能 (concept) | C++20 | -| [`dereferenceable`](iterator/dereferenceable.md) | 単純な間接参照が可能 (concept) | C++20 | -| [`is-integer-like`](iterator/is_integer_like.md) | 符号付整数型と同等の型か否かを表す (variable template) | C++20 | -| [`is-signed-integer-like`](iterator/is_integer_like.md) | 符号なし整数型と同等の型か否かを表す (variable template) | C++20 | +| 名前 | 説明 | 対応バージョン | +|---------------------------------------------------------|-------------------------------------------------------------|-----------| +| [`with-reference`](iterator/dereferenceable.md) | 型`T`に参照を付加する (alias template) | C++20 | +| [`can-reference`](iterator/dereferenceable.md) | [`with-reference`](iterator/dereferenceable.md)可能 (concept) | C++20 | +| [`dereferenceable`](iterator/dereferenceable.md) | 単純な間接参照が可能 (concept) | C++20 | +| [`is-integer-like`](iterator/is_integer_like.md) | 符号付整数型と同等の型か否かを表す (variable template) | C++20 | +| [`is-signed-integer-like`](iterator/is_integer_like.md) | 符号なし整数型と同等の型か否かを表す (variable template) | C++20 | ## `` -| 名前 | 説明 | 対応バージョン | -|--------------------------------------------|---------------------------------------------------------------------------------|----------------| -| [`copyable-box`](ranges/copyable_box.md) | コピー可能、または例外なしでムーブ可能な場合のみ値を保持する型 (class template) | C++20 | + +| 名前 | 説明 | 対応バージョン | +|----------------------------------------------|------------------------------------------------------------------------------------------------------|-----------| +| [`copyable-box`](ranges/copyable_box.md) | コピー可能、または例外なしでムーブ可能な場合のみ値を保持する型 (class template) | C++20 | +| [`simple-view`](ranges/simple-view.md) | 単純なビューを表す (concept) | C++20 | +| [`has-arrow`](ranges/has-arrow.md) | [`std::input_iterator`](/reference/iterator/input_iterator.md)を満たし、アロー演算子が使用できる型かを表す (concept) | C++20 | +| [`different-from`](ranges/different-from.md) | `const`/`volatile`修飾を無視して、2つの型が同じでないことを表す (concept) | C++20 | +| [`uses-nonqualification-pointer-conversion`](ranges/subrange/uses-nonqualification-pointer-conversion.md) | 直接変換できない型同士のポインタの変換が必要かどうかを表す (concept) | C++20 | +| [`convertible-to-non-slicing`](ranges/subrange/convertible-to-non-slicing.md) | スライシングを起こさずに変換できるかどうかを表す (concept) | C++20 | +| [`pair-like-convertible-from`](ranges/subrange/pair-like-convertible-from.md) | ある2つの型から構築出来る[`pair-like`](tuple/pair-like.md)な型を表す (concept) | C++20 | + +## `` + +| 名前 | 説明 | 対応バージョン | +|-------------------------------------|---------------------------------------------|-----------| +| [`tuple-like`](tuple/tuple-like.md) | [`tuple`](tuple/tuple.md)のような型を表す (concept) | C++23 | +| [`pair-like`](tuple/pair-like.md) | [`pair`](utility/pair.md)のような型を表す (concept) | C++20 | ## 参照 -- [N4861 16.4.2.1 Exposition-only functions](https://timsong-cpp.github.io/cppwp/n4861/expos.only.func) + +* [N4861 16.4.2.1 Exposition-only functions](https://timsong-cpp.github.io/cppwp/n4861/expos.only.func) +* [LWG 3404 Finish removing `subrange`'s conversions from `pair-like`](https://cplusplus.github.io/LWG/issue3404) diff --git a/reference/iterator/indirectly_writable.md b/reference/iterator/indirectly_writable.md index 2a78cad5f7..c8e64a86c5 100644 --- a/reference/iterator/indirectly_writable.md +++ b/reference/iterator/indirectly_writable.md @@ -29,7 +29,30 @@ namespace std { このコンセプトを構成する4つの制約式は全て、[等しさを保持](/reference/concepts.md)することを要求しない。 -`const_cast`を用いる制約式は、右辺値に対しても代入できるが`const`な右辺値では代入できなくなる非プロキシイテレータの*prvalue*(例えば`std::string`そのものなど)を返すイテレータを弾くためにある。これによって、間接参照が*prvalue*を返すようなイテレータ型は`indirectly_writable`のモデルとならないが、出力可能なプロキシオブジェクトを返すイテレータは`indirectly_writable`のモデルとなる事ができる。 +### 制約式について + +`const_cast`を用いる制約式は、非プロキシオブジェクト(値を所有するオブジェクトのことである。[`std::string`](/reference/string/basic_string.md)などが該当)を弾くために存在する。 + +まず前提として、非プロキシオブジェクトは[メンバ関数の左辺値/右辺値修飾](https://cpprefjp.github.io/lang/cpp11/ref_qualifier_for_this.html)が追加される以前からの慣習により、*pvalue*であっても代入が可能である。また、値を所有するために`const`が付与されれば代入は不可能となる。 + +```cpp example +#include + +int main() +{ + std::string() = "string"; // pvalueに代入 +} +``` + +このような非プロキシオブジェクトの*pvalue*がイテレータの間接参照結果として返された場合、それに書き込んだとしても、その*pvalue*のオブジェクトが所有する値を書き換えるのみであり、正しく出力されるとは言えない。 + +一方で、プロキシオブジェクト(所有権を持たず、他のオブジェクトを参照するオブジェクト)がイテレータの間接参照結果として返された場合は、*pvalue*の場合も代入された値を「参照する先のオブジェクトが所有する値」へ書き込むことによって、正しく出力を完了することが出来る。 + +更に、プロキシオブジェクトは値を所有しないため「`const`な参照先」でなければ、プロキシオブジェクトそれ自体が`const`であっても代入は可能であるべきである。しかしながら、従来のプロキシオブジェクトは`const`を付与された場合代入が不可能になる実装が殆どであり、変更が必要である。例としては[`std::vector::reference`](/reference/vector/vector.md)がある。 + +プロキシオブジェクトの他にも、参照(右辺値参照/左辺値参照問わず)も正しく出力が可能である。このことから、「`const`を付与した上でも代入が可能であるようなプロキシオブジェクト」と「参照」を合わせて「プロキシ参照(proxy reference)」と呼称することがある。 + +以上のことから、`const`を付与した際にも代入が可能であればプロキシ参照、不可能であれば非プロキシ参照と区別することが可能となる。したがって、間接参照が非プロキシ参照(プロキシオブジェクトでない*pvalue*など)を返すイテレータ型は本コンセプトのモデルとならず、プロキシ参照を返すイテレータは本コンセプトのモデルとなる事ができる。 ## モデル @@ -51,6 +74,8 @@ indirectly_readable && same_as, decay_t> `indirectly_writable`のモデルとなる`Out`の`operator*`は出力(上記式による代入文の左辺に来ること)だけが唯一有効な使用法であり、[`indirectly_readable`](indirectly_readable.md)である必要はない。 ## 例 + +### C++20 ```cpp example #include #include @@ -96,7 +121,7 @@ int main() { ``` * std::indirectly_writable[color ff0000] -### 出力 +#### 出力 ``` int* is indirectly writable int std::unique_ptr is indirectly writable int& @@ -109,6 +134,60 @@ std::optional is not indirectly writable int not_writable is not indirectly writable int ``` + +### C++23 で満たすようになった型 +```cpp example +#include +#include +#include +#include +#include +#include + +template +requires std::indirectly_writable +void f(const char* out, const char* t) +{ + std::cout << out << " is indirectly writable " << t << std::endl; +} + +template +void f(const char* out, const char* t) +{ + std::cout << out << " is not indirectly writable " << t << std::endl; +} + +struct ret_proxy_pair +{ + // 全ての要素がプロキシ参照である pair はプロキシ参照 + std::pair> operator*(); +}; + +struct ret_proxy_tuple +{ + // 全ての要素がプロキシ参照である tuple はプロキシ参照 + std::tuple> operator*(); +}; + + +int main() +{ + f::iterator, bool>("std::vector::iterator", "bool"); + f>>("ret_proxy_pair", "std::pair>"); + f>>("ret_proxy_tuple", "std::tuple>"); +} +``` +* std::indirectly_writable[color ff0000] + +#### 出力 +``` +std::vector::iterator is indirectly writable bool +ret_proxy_pair is indirectly writable std::pair> +ret_proxy_tuple is indirectly writable std::tuple> + +``` + + ## バージョン ### 言語 - C++20 diff --git a/reference/ranges/different-from.md b/reference/ranges/different-from.md new file mode 100644 index 0000000000..d821b67cc9 --- /dev/null +++ b/reference/ranges/different-from.md @@ -0,0 +1,30 @@ +# different-from +* ranges[meta header] +* concept[meta id-type] +* cpp20[meta cpp] + +```cpp +template + concept different-from = // 説明専用コンセプト + !same_as, remove_cvref_t>; +``` +* same_as[link /reference/concepts/same_as.md] +* remove_cvref_t[link /reference/type_traits/remove_cvref.md] + +## 概要 +`different-from`は、型`T`、`U`について`const`/`volatile`修飾を無視して、同じ型でないことを表す説明専用コンセプトである。 + + +## 備考 +N4885 までは`not-same-as`という名称だったが、実際には[`same_as`](/reference/concepts/same_as.md)の否定とは等価ではない(本説明専用コンセプトが`const`/`volatile`修飾を無視していることによる)ため、N4892(C++23 のドラフトの1つ)からは`different-from`という現行の名称に変更された。 + + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ranges/elements_view.md b/reference/ranges/elements_view.md index bb6cc5924f..d71cbb8d3b 100644 --- a/reference/ranges/elements_view.md +++ b/reference/ranges/elements_view.md @@ -60,6 +60,7 @@ namespace std::ranges { 説明専用コンセプト`has-tuple-element`を次のように定義する。 ```cpp +// C++20 template concept has-tuple-element = requires(T t) { @@ -68,12 +69,19 @@ concept has-tuple-element = typename tuple_element_t; { get(t) } -> convertible_to&>; }; + +// C++23 +template +concept has-tuple-element = + tuple-like && N < tuple_size_v; ``` * tuple_size[link /reference/tuple/tuple_size.md] * tuple_element_t[link /reference/tuple/tuple_element.md] * get[link /reference/tuple/tuple/get.md] * convertible_to[link /reference/concepts/convertible_to.md] * remove_reference_t[link /reference/type_traits/remove_reference.md] +* tuple-like[link /reference/tuple/tuple-like.md] +* tuple_size_v[link /reference/tuple/tuple_size.md] これを用いて、 @@ -161,3 +169,4 @@ three ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) - [C++20 ranges](https://techbookfest.org/product/5134506308665344) +- [P2165R4 Compatibility between `tuple`, `pair` and *tuple-like* objects](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2165r4.pdf) diff --git a/reference/ranges/has-arrow.md b/reference/ranges/has-arrow.md new file mode 100644 index 0000000000..fbb4ec5f50 --- /dev/null +++ b/reference/ranges/has-arrow.md @@ -0,0 +1,28 @@ +# has-arrow +* ranges[meta header] +* concept[meta id-type] +* cpp20[meta cpp] + +```cpp +template + concept has-arrow = // 説明専用コンセプト + input_iterator && (is_pointer_v || requires(I i) { i.operator->(); }); +``` +* input_iterator[link /reference/iterator/input_iterator.md] +* is_pointer_v[link /reference/type_traits/is_pointer.md] + +## 概要 +`has-arrow`は、型`I`について[`std::input_iterator`](/reference/iterator/input_iterator.md)を満たす上で、アロー演算子が使用可能であることを表す説明専用コンセプトである。 + +C++20 のイテレータ定義であるコンセプトたちではアロー演算子を提供することを要求していないため、別途用意されていると考えられる。 + + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ranges/simple-view.md b/reference/ranges/simple-view.md new file mode 100644 index 0000000000..7b2c01bbde --- /dev/null +++ b/reference/ranges/simple-view.md @@ -0,0 +1,38 @@ +# simple-view +* ranges[meta header] +* concept[meta id-type] +* cpp20[meta cpp] + +```cpp +template + concept simple-view = // 説明専用コンセプト + view && range && + same_­as, iterator_t> && + same_­as, sentinel_t>; +``` +* same-as[link /reference/concepts/same_as.md] +* view[link view.md] +* range[link range.md] +* iterator_t[link iterator_t.md] +* sentinel_t[link sentinel_t.md] + +## 概要 +`simple-view`は型`R`が単純(`R`は`const`であっても Range である(`const-iterable`である)上で、`R`が使用するイテレータ/センチネルと読み取り専用のイテレータ/センチネルが同じ型である)となるビューな Range を表す説明専用コンセプトである。 + +`const-iterable`が要件にあることは、`const-iterable`ではない Range は内部でキャッシュ等の複雑度が高い仕様となることで、`const-iterable`では無くならざるを得なくなることが背景であると考えられる。`const-iterable`でないビューとしては、[`ranges::filter_view`](filter_view.md)などが挙げられる。 + + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参考 +- [filter_viewがconst-iterableではない理由](https://zenn.dev/onihusube/scraps/40a95c8f769414) + diff --git a/reference/ranges/subrange.md b/reference/ranges/subrange.md index 8166946923..7aacf4c5be 100644 --- a/reference/ranges/subrange.md +++ b/reference/ranges/subrange.md @@ -33,7 +33,7 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |------------------------------------------------|----------------------------------|----------------| | [`(constructor)`](subrange/op_constructor.md) | コンストラクタ | C++20 | -| [`operator PairLike`](subrange/op_pairlike.md) | pair-likeな型に変換する | C++20 | +| [`operator PairLike`](subrange/op_pairlike.md) | [`pair-like`](/reference/tuple/pair-like.md)な型に変換する | C++20 | | [`begin`](subrange/begin.md) | 先頭を指すイテレータを取得する | C++20 | | [`end`](subrange/end.md) | 番兵を取得する | C++20 | | [`empty`](subrange/empty.md) | Rangeが空かどうかを判定する | C++20 | @@ -73,60 +73,6 @@ namespace std::ranges { | [`tuple_element`](subrange/tuple_element.md) | 静的な要素の型取得(class template) | C++20 | | [`get`](subrange/get.md) | 要素を取得する(function template) | C++20 | -## 説明専用コンセプト - -このクラスの説明では以下のコンセプトを用いる。 - -```cpp -// uses-nonqualification-pointer-conversion: 直接変換できない型同士のポインタの変換が必要 -template -concept uses-nonqualification-pointer-conversion = - is_pointer_v && is_pointer_v && - !convertible_to(*)[], remove_pointer_t(*)[]>; - -// convertible-to-non-slicing: スライシングを起こさずに変換できる -template -concept convertible-to-non-slicing = - convertible_to && - !uses-nonqualification-pointer-conversion, decay_t>; - -// pair-like: 大きさ2のtuple-likeな型である -template -concept pair-like = - !is_reference_v && requires(T t) { - typename tuple_size::type; - requires derived_from, integral_constant>; - typename tuple_element_t<0, remove_const_t>; - typename tuple_element_t<1, remove_const_t>; - { get<0>(t) } -> convertible_to&>; - { get<1>(t) } -> convertible_to&>; - }; - -// pair-like-convertible-from: U, Vから構築できるpair-likeである (その際、Uはスライシングを起こさない) -template -concept pair-like-convertible-from = - !range && pair-like && - constructible_from && - convertible-to-non-slicing> && - convertible_to>; -``` -* convertible_to[link /reference/concepts/convertible_to.md] -* constructible_from[link /reference/concepts/derived_from.md] -* derived_from[link /reference/concepts/derived_from.md] -* is_pointer_v[link /reference/type_traits/is_pointer.md] -* decay_t[link /reference/type_traits/decay.md] -* integral_constant[link /reference/type_traits/integral_constant.md] -* remove_pointer_t[link /reference/type_traits/remove_pointer.md] -* remove_const_t[link /reference/type_traits/remove_const.md] -* range[link /reference/ranges/range.md] -* tuple_element_t[link /reference/tuple/tuple_element.md] -* not-same-as[italic][link /reference/concepts/same_as.md] -* uses-nonqualification-pointer-conversion[italic] -* convertible-to-non-slicing[italic] -* pair-like[italic] -* pair-like-convertible-from[italic] -* make-unsigned-like-t[italic][link /reference/type_traits/make_unsigned.md] - ## バージョン ### 言語 diff --git a/reference/ranges/subrange/convertible-to-non-slicing.md b/reference/ranges/subrange/convertible-to-non-slicing.md new file mode 100644 index 0000000000..2b7b386983 --- /dev/null +++ b/reference/ranges/subrange/convertible-to-non-slicing.md @@ -0,0 +1,45 @@ +# convertible-to-non-slicing +* ranges[meta header] +* concept[meta id-type] +* std::ranges[meta namespace] +* cpp20[meta cpp] + +```cpp +namespace std::ranges { + template + concept convertible-to-non-slicing = // 説明専用コンセプト + convertible_to && + !uses-nonqualification-pointer-conversion, decay_t>; +} +``` +* convertible_to[link /reference/concepts/convertible_to.md] +* uses-nonqualification-pointer-conversion[link uses-nonqualification-pointer-conversion.md] +* decay_t[link /reference/type_traits/decay.md] +* convertible-to-non-slicing[italic] +* uses-nonqualification-pointer-conversion[italic] + +## 概要 +`convertible-to-non-slicing`は、型`From`から型`To`へ、スライシングを起こさずに変換できることを表す説明専用コンセプトである。[`ranges::subrange`](../subrange.md)での定義に使用され、`From`と`To`にはイテレータの型が渡される。 + + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`ranges::subrange`](../subrange.md) +- [`uses-nonqualification-pointer-conversion`](uses-nonqualification-pointer-conversion.md) +- [`pair-like-convertible-from`](pair-like-convertible-from.md) + + +## 参照 +- [LWG 3282 `subrange` converting constructor should disallow derived to base conversions](https://cplusplus.github.io/LWG/issue3282) +- [LWG 3470 `convertible-to-non-slicing` seems to reject valid case](https://cplusplus.github.io/LWG/issue3470) + diff --git a/reference/ranges/subrange/op_constructor.md b/reference/ranges/subrange/op_constructor.md index 6abc563de7..86a51709c4 100644 --- a/reference/ranges/subrange/op_constructor.md +++ b/reference/ranges/subrange/op_constructor.md @@ -17,7 +17,7 @@ constexpr subrange(convertible-to-non-slicing auto i, S s, make-unsigned-like requires (K == subrange_kind::sized); // (4) -template R> +template R> requires borrowed_range && convertible-to-non-slicing, I> && convertible_to, S> constexpr subrange(R&& r) requires (!StoreSize || sized_range); @@ -33,10 +33,13 @@ constexpr subrange(R&& r, make-unsigned-like-t> n) * sized_range[link /reference/ranges/sized_range.md] * convertible_to[link /reference/concepts/convertible_to.md] * iter_difference_t[link /reference/iterator/iter_difference_t.md] +* different-from[link ../different-from.md] +* convertible-to-non-slicing[link convertible-to-non-slicing.md] +* make-unsigned-like-t[link /reference/type_traits/make_unsigned.md] * StoreSize[italic] -* not-same-as[italic][link ../subrange.md] -* convertible-to-non-slicing[italic][link ../subrange.md] -* make-unsigned-like-t[italic][link /reference/type_traits/make_unsigned.md] +* different-from[italic] +* convertible-to-non-slicing[italic] +* make-unsigned-like-t[italic] ## 概要 - (1) : 空の`subrange`を構築する(デフォルトコンストラクタ) @@ -66,7 +69,7 @@ static constexpr bool StoreSize = (K == subrange_kind::sized && !sized_sentinel_ ## 事前条件 - (2): `[i, s)`は有効なイテレータ範囲であること -- (3): `[i, s)`は有効なイテレータ範囲であり、`n`はその範囲の長さ([`ranges::distance](/reference/iterator/ranges_distance.md)`(i, s)`)と等しいこと +- (3): `[i, s)`は有効なイテレータ範囲であり、`n`はその範囲の長さ([`ranges::distance`](/reference/iterator/ranges_distance.md)`(i, s)`)と等しいこと - (4): `r`は有効な範囲であること - (5): `r`は有効な範囲であり、`n`はその範囲の長さと等しいこと @@ -128,3 +131,5 @@ int main() - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) - [C++20 ranges](https://techbookfest.org/product/5134506308665344) - [P2367R0 Remove misuses of list-initialization from Clause 24](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2367r0.html) (本提案文書はC++20に遡って適用されている) +- [LWG 3281 Conversion from `pair-like` types to `subrange` is a silent semantic promotion](https://cplusplus.github.io/LWG/issue3281) +- [LWG 3282 `subrange` converting constructor should disallow derived to base conversions](https://cplusplus.github.io/LWG/issue3282) diff --git a/reference/ranges/subrange/op_deduction_guide.md b/reference/ranges/subrange/op_deduction_guide.md index 3de9160599..af57c59627 100644 --- a/reference/ranges/subrange/op_deduction_guide.md +++ b/reference/ranges/subrange/op_deduction_guide.md @@ -36,8 +36,7 @@ namespace std::ranges { * tuple_element_t[link /reference/tuple/tuple_element.md] * StoreSize[italic][link op_constructor.md] * iterator-sentinel-pair[italic][link ../subrange.md] -* not-same-as[italic][link ../subrange.md] -* convertible-to-non-slicing[italic][link ../subrange.md] +* convertible-to-non-slicing[italic][link convertible-to-non-slicing.md] * make-unsigned-like-t[italic][link /reference/type_traits/make_unsigned.md] ## 概要 diff --git a/reference/ranges/subrange/op_pairlike.md b/reference/ranges/subrange/op_pairlike.md index 1e2d68483f..7f17e9929b 100644 --- a/reference/ranges/subrange/op_pairlike.md +++ b/reference/ranges/subrange/op_pairlike.md @@ -6,15 +6,17 @@ * cpp20[meta cpp] ```cpp -template PairLike> +template PairLike> requires pair-like-convertible-from constexpr operator PairLike() const; ``` -* not-same-as[italic][link /reference/concepts/same_as.md] -* pair-like-convertible-from[italic][link ../subrange.md] +* different-from[link /reference/ranges/different-from.md] +* pair-like-convertible-from[link pair-like-convertible-from.md] +* different-from[italic] +* pair-like-convertible-from[italic] ## 概要 -pair-like (大きさ2のtuple-like) な型への変換演算子。 +[`pair-like`](/reference/tuple/pair-like.md) (大きさ2の[`tuple-like`](/reference/tuple/tuple-like.md)) な型への変換演算子。 ## 効果 ```cpp diff --git a/reference/ranges/subrange/pair-like-convertible-from.md b/reference/ranges/subrange/pair-like-convertible-from.md new file mode 100644 index 0000000000..a700da03a0 --- /dev/null +++ b/reference/ranges/subrange/pair-like-convertible-from.md @@ -0,0 +1,58 @@ +# pair-like-convertible-from +* ranges[meta header] +* concept[meta id-type] +* std::ranges[meta namespace] +* cpp20[meta cpp] + +```cpp +namespace std::ranges { + // C++20 + template + concept pair-like-convertible-from = // 説明専用コンセプト + !range && pair-like && + constructible_from && + convertible-to-non-slicing> && + convertible_to>; + + // C++23 + template + concept pair-like-convertible-from = // 説明専用コンセプト + !range && !is_reference_v && pair-like && + constructible_from && + convertible-to-non-slicing> && + convertible_to>; +} +``` +* range[link ../range.md] +* pair-like[link /reference/tuple/pair-like.md] +* convertible-to-non-slicing[link convertible-to-non-slicing.md] +* constructible_from[link /reference/concepts/constructible_from.md] +* convertible_to[link /reference/concepts/convertible_to.md] +* tuple_element_t[link /reference/tuple/tuple_element.md] +* is_reference_v[link /reference/type_traits/is_reference.md] +* convertible-to-non-slicing[italic] +* pair-like[italic] +* pair-like-convertible-from[italic] + +## 概要 +`pair-like-convertible-from`は、型`T`が型`U`と`V`から構築出来る[`pair-like`](/reference/tuple/pair-like.md)であり、かつ`U`がスライシングを起こさないということを表す説明専用コンセプトである。[`ranges::subrange`](../subrange.md)での定義に使用され、`U`にはイテレータの型が、`V`にはセンチネルの型が渡される。 + + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`ranges::subrange`](../subrange.md) +- [`uses-nonqualification-pointer-conversion`](uses-nonqualification-pointer-conversion.md) +- [`convertible-to-non-slicing`](convertible-to-non-slicing.md) + +## 参照 +- [P2165R4 Compatibility between `tuple`, `pair` and *tuple-like* objects](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2165r4.pdf) diff --git a/reference/ranges/subrange/uses-nonqualification-pointer-conversion.md b/reference/ranges/subrange/uses-nonqualification-pointer-conversion.md new file mode 100644 index 0000000000..390f4236f3 --- /dev/null +++ b/reference/ranges/subrange/uses-nonqualification-pointer-conversion.md @@ -0,0 +1,42 @@ +# uses-nonqualification-pointer-conversion +* ranges[meta header] +* concept[meta id-type] +* std::ranges[meta namespace] +* cpp20[meta cpp] + +```cpp +namespace std::ranges { + template + concept uses-nonqualification-pointer-conversion = // 説明専用コンセプト + is_pointer_v && is_pointer_v && + !convertible_to(*)[], remove_pointer_t(*)[]>; +} +``` +* convertible_to[link /reference/concepts/convertible_to.md] +* is_pointer_v[link /reference/type_traits/is_pointer.md] +* remove_pointer_t[link /reference/type_traits/remove_pointer.md] +* uses-nonqualification-pointer-conversion[italic] + +## 概要 +`uses-nonqualification-pointer-conversion`は、直接変換できない型同士のポインタの変換が必要かどうかを表す。[`ranges::subrange`](../subrange.md)の定義において、`ranges::subrange`を`T*[]`から構築するなどの時に必要になるポインタの変換を許容するために使用される。 + + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`ranges::subrange`](../subrange.md) +- [`convertible-to-non-slicing`](convertible-to-non-slicing.md) +- [`pair-like-convertible-from`](pair-like-convertible-from.md) + + +## 参照 +- [LWG 3470 `convertible-to-non-slicing` seems to reject valid case](https://cplusplus.github.io/LWG/issue3470) diff --git a/reference/tuple/apply.md b/reference/tuple/apply.md index 3b00168b8f..cd65bab1bd 100644 --- a/reference/tuple/apply.md +++ b/reference/tuple/apply.md @@ -10,29 +10,41 @@ namespace std { constexpr decltype(auto) apply(F&& f, Tuple&& t); // (1) C++20 - template + template constexpr decltype(auto) apply(F&& f, Tuple&& t) noexcept(see below); // (1) C++23 } ``` +* tuple-like[link tuple-like.md] +* tuple-like[link tuple-like.md] +<<<<<<< Updated upstream * see below[italic] +======= +>>>>>>> Stashed changes ## 概要 タプルを展開し、関数の引数に適用してその関数を実行する。 ## 要件 -適用先の関数は[`Callable`](/reference/concepts/Callable.md)要件を満たす([INVOKE](/reference/concepts/Invoke.md)操作が可能)。展開される`Tuple`型は[`std::tuple`](../tuple.md)に限定されず、[`std::array`](/reference/array/array.md)または[`std::pair`](/reference/utility/pair.md)のように、[`std::get`](/reference/array/array/get.md)と[`std::tuple_size`](/reference/array/array/tuple_size.md)をサポートする型であればよい。 +適用先の関数は[`Callable`](/reference/concepts/Callable.md)要件を満たす([INVOKE](/reference/concepts/Invoke.md)操作が可能)。展開される`Tuple`型は[`std::tuple`](../tuple.md)に限定されず、[`std::array`](/reference/array/array.md)または[`std::pair`](/reference/utility/pair.md)のように、[`std::get`](/reference/array/array/get.md)と[`std::tuple_size`](/reference/array/array/tuple_size.md)をサポートする型であればよい。(C++20 まで。)C++23 では[`tuple-like`](tuple-like.md)による制約が追加されたため、使用できる型は狭まった。([`tuple-like`](tuple-like.md)参照) ## 効果 次のような関数があるとき、 ```cpp +// C++17 template constexpr decltype(auto) apply-impl(F&& f, Tuple&& t, std::index_sequence) { return std::invoke(std::forward(f), std::get(std::forward(t))...); } + +// C++23 +template +constexpr decltype(auto) apply-impl(F&& f, Tuple&& t, std::index_sequence) { + return std::invoke(std::forward(f), std::get(std::forward(t))...); +} ``` * std::get[link tuple/get.md] * std::index_sequence[link /reference/utility/index_sequence.md] @@ -59,6 +71,7 @@ return apply-impl(std::forward(f), std::forward(t), * std::forward[link /reference/utility/forward.md] * std::remove_reference_t[link /reference/type_traits/remove_reference.md] + ## 戻り値 適用した関数呼び出しの戻り値 @@ -111,6 +124,7 @@ hello - [`make_from_tuple`](make_from_tuple.md) - [`std::tuple`](../tuple.md) - [INVOKE](/reference/concepts/Invoke.md) +- [`tuple-like`](tuple-like.md) ## 参照 diff --git a/reference/tuple/make_from_tuple.md b/reference/tuple/make_from_tuple.md index c8bb8ed534..e175fecd83 100644 --- a/reference/tuple/make_from_tuple.md +++ b/reference/tuple/make_from_tuple.md @@ -6,23 +6,33 @@ ```cpp namespace std { + // C++17 template constexpr T make_from_tuple(Tuple&& t); + + // C++23 + template + constexpr T make_from_tuple(Tuple&& t); } ``` +* tuple-like[link tuple-like.md] ## 概要 -tuple-likeな型`Tuple`のオブジェクトに含まれる値から型`T`のオブジェクトを構築する。 +[`tuple-like`](tuple-like.md)な型`Tuple`のオブジェクトに含まれる値から型`T`のオブジェクトを構築する。 ## 要件 -型`T`のコンストラクタの内のいずれか一つが、型`Tuple`に含まれる全ての型の値をその順番通りに受け入れ可能であること。それができない場合はコンパイルエラーとなる。 +型`T`のコンストラクタの内のいずれか一つが、型`Tuple`に含まれる全ての型の値をその順番通りに受け入れ可能であること。それができない場合はコンパイルエラーとなる。 + また、型`T`の初期化はそのコンストラクタで行われ集成体初期化は考慮されない。つまり、`Tuple`に含まれる型が空かただ一つの`T`でない場合、型`T`は集成体(aggregate)であってはならない(C++17のみ、C++20以降はok)。 +更に、C++23以降は`make_from_tuple`の返り値が参照である場合でダングリング参照を生成しないために、`make_from_tuple`の内部で`T`が構築される際に、`Tuple`から取得されるオブジェクト(参照の初期化であるので、`Tuple`のサイズは1である必要がある)の寿命が延長されないことも要求され、これを満たさない場合はコンパイルエラーとなる。 +正確には、[`tuple_­size_­v`](tuple_size.md)`<`[`remove_­reference_­t`](/reference/type_traits/remove_reference.md)`> == 1`である場合、[`reference_­constructs_­from_­temporary_­v`](/reference/type_traits/reference_constructs_from_temporary.md)`(`[`declval`](/reference/utility/declval.md)`()))> == false`であること。 + ## 引数 -- `t` -- tuple-likeな型`Tuple`のオブジェクト +- `t` -- [`tuple-like`](tuple-like.md)な型`Tuple`のオブジェクト -tuple-likeな型とは主に[`std::tuple`](../tuple.md)の事であるが、[`std::pair`](/reference/utility/pair.md)や[`std::array`](/reference/array/array.md)のように[`std::tuple`](../tuple.md)と同じような扱いができる型も含んでいる。 -より詳細には、[`std::get`](/reference/array/array/get.md)(インデックス指定)と[`std::tuple_size`](/reference/array/array/tuple_size.md)が適用可能な型である。 +[`tuple-like`](tuple-like.md)な型とは主に[`std::tuple`](../tuple.md)の事であるが、[`std::pair`](/reference/utility/pair.md)や[`std::array`](/reference/array/array.md)のように[`std::tuple`](../tuple.md)と同じような扱いができる型も含んでいる。 +より詳細には、[`std::get`](/reference/array/array/get.md)(インデックス指定)と[`std::tuple_size`](/reference/array/array/tuple_size.md)が適用可能な型である。(C++20まで。)C++23 では[`tuple-like`](tuple-like.md)による制約が追加されたため、使用できる型は狭まった。([`tuple-like`](tuple-like.md)を参照) ## 戻り値 `Tuple`に含まれる型の値をその順番通りに型`T`のコンストラクタに[`std::forward`](/reference/utility/forward.md)して構築された`T`のオブジェクト。 @@ -125,6 +135,7 @@ int main() ## 関連項目 - [apply](../tuple/apply.md) +- [`tuple-like`](tuple-like.md) ## 参照 - [C++1z タプルを任意の型のオブジェクトに変換するmake_from_tuple関数 - Faith and Brave - C++で遊ぼう](https://faithandbrave.hateblo.jp/entry/2016/08/19/173946) diff --git a/reference/tuple/pair-like.md b/reference/tuple/pair-like.md new file mode 100644 index 0000000000..7a15efbca0 --- /dev/null +++ b/reference/tuple/pair-like.md @@ -0,0 +1,63 @@ +# pair-like +* tuple[meta header] +* concept[meta id-type] +* std[meta namespace] +* cpp20[meta cpp] + +```cpp +namespace std { + namespace ranges { + // C++20 + template + concept pair-like = // 説明専用コンセプト + !is_reference_v && requires(T t) { + typename tuple_size::type; // tuple_­size が完全型であることを明確にする + requires derived_from, integral_constant>; + typename tuple_element_t<0, remove_const_t>; + typename tuple_element_t<1, remove_const_t>; + { get<0>(t) } -> convertible_to&>; + { get<1>(t) } -> convertible_to&>; + }; + } + + // C++23 以降 + template + concept pair-like // 説明専用コンセプト + = tuple-like && tuple_size_v> == 2; +} +``` +* tuple_element_t[link tuple_element.md] +* tuple_size[link tuple_size.md] +* tuple_size_v[link tuple_size.md] +* is_reference_v[link /reference/type_traits/is_reference.md] +* integral_constant[link /reference/type_traits/integral_constant.md] +* remove_const_t[link /reference/type_traits/remove_const.md] +* remove_cvref_t[link /reference/type_traits/remove_cvref.md] +* convertible_to[link /reference/concepts/convertible_to.md] +* tuple-like[link tuple-like.md] + +## 概要 +`pair-like`は型`T`が[`pair`](/reference/utility/pair.md)のような型であることを表現する説明専用コンセプトである。C++23 では[`tuple-like`](tuple-like.md)の追加に伴って定義が変更された。 + +[`ranges::subrange`](/reference/ranges/subrange.md)での[`operator PairLike`](/reference/ranges/subrange/op_pairlike.md)の定義など、[``](/reference/ranges.md)での定義に使用されている。 + +C++23 以降では[`array`](/reference/array/array.md)、[`pair`](/reference/utility/pair.md)、[`tuple`](tuple.md)、[`ranges::subrange`](/reference/ranges/subrange.md)らの互換性を高める(相互に構築・比較などが出来るようにする)ためにも使用される。 + + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`tuple-like`](tuple-like.md) + + +## 参照 +- [P2165R4 Compatibility between `tuple`, `pair` and *tuple-like* objects](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2165r4.pdf) diff --git a/reference/tuple/tuple-like.md b/reference/tuple/tuple-like.md new file mode 100644 index 0000000000..3728e0bba5 --- /dev/null +++ b/reference/tuple/tuple-like.md @@ -0,0 +1,50 @@ +# tuple-like +* tuple[meta header] +* concept[meta id-type] +* std[meta namespace] +* cpp23[meta cpp] + +```cpp +namespace std { + template + concept tuple-like = /*see below*/; // 説明専用コンセプト +} +``` + + +## 概要 +`tuple-like`は型`T`が[`tuple`](tuple.md)のような型であることを表現する説明専用コンセプトである。なお、[`pair`](/reference/utility/pair.md)のような型を表現する[`pair-like`](pair-like.md)も存在する。 + +[`array`](/reference/array/array.md)、[`pair`](/reference/utility/pair.md)、[`tuple`](tuple.md)、[`ranges::subrange`](/reference/ranges/subrange.md)らの互換性を高める(相互に構築・比較などが出来るようにする)ためなどに使用される。 + + +## 要件 +[`std::remove_cvref_t`](/reference/type_traits/remove_cvref.md)が次の特殊化であること。 + +- [`array`](/reference/array/array.md) +- [`pair`](/reference/utility/pair.md) +- [`tuple`](tuple.md) +- [`ranges::subrange`](/reference/ranges/subrange.md) + + +## 備考 +将来的に`std::get()`やそれに近しいカスタマイゼーションポイントオブジェクト(CPO)が定義されれば、`tuple-like`のモデルになる型は広がる可能性があるとされている。 + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`pair-like`](pair-like.md) + + +## 参照 +- [P2165R4 Compatibility between `tuple`, `pair` and *tuple-like* objects](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2165r4.pdf) diff --git a/reference/tuple/tuple.md b/reference/tuple/tuple.md index a4a196ca89..517715021e 100644 --- a/reference/tuple/tuple.md +++ b/reference/tuple/tuple.md @@ -72,6 +72,15 @@ namespace std { | [`(deduction_guide)`](tuple/op_deduction_guide.md) | クラステンプレートの推論補助 | C++17 | +## tuple-like とのユーティリティ +| 名前 | 説明 | 対応バージョン | +|-------------------------------------------------------------|----------------------------------------------------------------------|-----------| +| [`operator==`](tuple/op_equal.md) | [`tuple-like`](tuple-like.md)なオブジェクトとの等値比較を行う | C++23 | +| [`operator<=>`](tuple/op_compare_3way.md) | [`tuple-like`](tuple-like.md)なオブジェクトとの三方比較を行う | C++23 | +| [`common_type`](tuple/common_type.md) | [`tuple-like`](tuple-like.md)なオブジェクトとの共通型を取得できるようにする特殊化 | C++23 | +| [`basic_common_reference`](tuple/basic_common_reference.md) | [`tuple-like`](tuple-like.md)なオブジェクトとの共通の参照型を取得出来るようにする特殊化 | C++23 | + + ## 例 ### 基本的な使い方 (C++11) ```cpp example @@ -102,6 +111,7 @@ int main() hello ``` + ### 基本的な使い方 (C++17) ```cpp example #include @@ -134,6 +144,110 @@ a hello ``` + +### プロキシ参照としての使い方(C++23) +C++23 で[`zip_view`](/reference/ranges/zip_view.md.nolink)などが追加されたことに伴い、すべての要素がプロキシ参照であるような`tuple`は[プロキシ参照](/reference/iterator/indirectly_writable.md)として使用することが出来るようになった。 + +```cpp example +#include +#include +#include +#include + +struct A +{ + A(int i, double d) + : i(i) + , d(d) + {} + + std::tuple f() + { + // this が A* なので + // i: int + // d: double + // ということと同じ + return {i, d}; + } + + std::tuple f() const + { + // this が const A* なので + // i: const int + // d: const double + // ということと同じ + return {i, d}; + } + +private: + int i; + double d; +}; + +int main() +{ + // プロキシ参照である tuple の性質 + { + A a{0, 0.0}; + + // std::tuple + /***/ auto /***/ proxy = a.f(); + + // const std::tuple + const auto const_proxy = a.f(); + + // std::tuple + /***/ auto /***/ proxy_to_const = std::as_const(a).f(); + + // const std::tuple + const auto const_proxy_to_const = std::as_const(a).f(); + + // OK(各要素が指すオブジェクトの値について、代入操作がなされる) + proxy = a.f(); + const_proxy = a.f(); + + // NG(各要素が指すオブジェクトを変更できない!) + // proxy_to_const = a.f(); + // const_proxy_to_const = a.f(); + } + + // 使い方 + { + auto print = [](std::string_view prefix, A& a) { + + // 構造化束縛で分解 + // i: int& + // d: double& + auto [i, d] = a.f(); + + std::cout << std::format("{}: i={}, d={}\n", prefix, i, d); + }; + + A a{0, 0.0}, b{1, 1.0}; + + print("before a", a); + print("before b", b); + + // プロキシ参照として使える tuple 同士の swap 操作で + // 問題なく各要素が指す先のオブジェクトについて swap 操作が行える + std::ranges::swap(a.f(), b.f()); + + print("after a", a); + print("after b", b); + } +} + +``` + +#### 出力 +``` +before a: i=0, d=0 +before b: i=1, d=1 +after a: i=1, d=1 +after b: i=0, d=0 + +``` + ## バージョン ### 言語 - C++11 @@ -151,4 +265,4 @@ hello ## 参照 - [タプル - Wikipedia](https://ja.wikipedia.org/wiki/%E3%82%BF%E3%83%97%E3%83%AB) - +- [P2321R2 `zip`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2321r2.html) diff --git a/reference/tuple/tuple/basic_common_reference.md b/reference/tuple/tuple/basic_common_reference.md new file mode 100644 index 0000000000..637303d803 --- /dev/null +++ b/reference/tuple/tuple/basic_common_reference.md @@ -0,0 +1,52 @@ +# basic_common_reference +* tuple[meta header] +* std[meta namespace] +* class template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { +template class TQual, template class UQual> + struct basic_common_reference; +} +``` +* basic_common_reference[link /reference/type_traits/basic_common_reference.md] +* tuple-like[link ../tuple-like.md] + +## 概要 +[`tuple`](../tuple.md)と[`tuple-like`](../tuple-like.md)なオブジェクについて、[`common_reference`](/reference/type_traits/common_reference.md)で共通の参照型を取得できるようにアダプトする[`basic_common_reference`](/reference/type_traits/common_reference.md)の特殊化である。 + +ユーザーが直接この特殊化を利用する必要はない。[`common_reference`](/reference/type_traits/common_reference.md)を使用すること。 + + +## 効果 +[`tuple`](../tuple.md)`<`[`common_­reference_­t`](/reference/type_traits/common_reference.md)`, UQual>...>`によって得られた型をメンバ型`type`として定義する。 + + +## 要件 +- `TTuple`か`UTuple`のどちらかが[`tuple`](../tuple.md)の特殊化であること。 +- `TTuple`と`UTuple`のそれぞれについて、(次の`T`を置き換える形で)[`is_­same_­v`](/reference/type_traits/is_same.md)`>`であること。 + - 実質的には`TTuple`と`Utuple`について、参照型ではなく、最上位の`const`/`volatile`修飾も持っていないこと要求する。 +- `TTuple`と`UTuple`の要素数が一致していること。 + - 具体的には、[`tuple_­size_­v`](../tuple_size.md)` ==` [`tuple_­size_­v`](../tuple_size.md)``であること。 +- [`tuple`](../tuple.md)`<`[`common_­reference_­t`](/reference/type_traits/common_reference.md)`, UQual>...>`が正しく型を表すこと。 + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ??? +- [GCC](/implementation.md#gcc): ??? +- [ICC](/implementation.md#icc): ??? +- [Visual C++](/implementation.md#visual_cpp): ??? + + +## 関連項目 +- [`basic_common_reference`](/reference/type_traits/basic_common_reference.md) + + +## 参照 +- [P2165R4 Compatibility between `tuple`, `pair` and *tuple-like* objects](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2165r4.pdf) diff --git a/reference/tuple/tuple/common_type.md b/reference/tuple/tuple/common_type.md new file mode 100644 index 0000000000..b8ffd1e735 --- /dev/null +++ b/reference/tuple/tuple/common_type.md @@ -0,0 +1,46 @@ +# common_type +* tuple[meta header] +* std[meta namespace] +* class template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template + struct common_type; +} +``` +* common_type[link /reference/type_traits/common_type.md] +* tuple-like[link ../tuple-like.md] + +## 概要 +[`tuple`](../tuple.md)と[`tuple-like`](../tuple-like.md)なオブジェクについて、どちらからも変換可能な共通の型を取得できるようにする[`common_type`](/reference/type_traits/common_type.md)の特殊化である。 + + +## 効果 +[`tuple`](../tuple.md)`<`[`common_­type_­t`](/reference/type_traits/common_type.md)`...>`によって得られた型をメンバ型`type`として定義する。 + + +## 備考 +- `TTuple`か`UTuple`のどちらかが[`tuple`](../tuple.md)の特殊化であること。 +- `TTuple`と`UTuple`のそれぞれについて、(次の`T`を置き換える形で)[`is_­same_­v`](/reference/type_traits/is_same.md)`>`であること。 + - 実質的には`TTuple`と`Utuple`について、参照型ではなく、最上位の`const`/`volatile`修飾も持っていないこと要求する。 +- `TTuple`と`UTuple`の要素数が一致していること。 + - 具体的には、[`tuple_­size_­v`](../tuple_size.md)` ==` [`tuple_­size_­v`](../tuple_size.md)``であること。 +- [`tuple`](../tuple.md)`<`[`common_­type_­t`](/reference/type_traits/common_type.md)`...>`が正しく型を表すこと。 + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.6.1 +- [Visual C++](/implementation.md#visual_cpp): 2012 + +## 関連項目 +- [common_type](/reference/type_traits/common_type.md) + +## 参照 +- [P2165R4 Compatibility between `tuple`, `pair` and *tuple-like* objects](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2165r4.pdf) diff --git a/reference/tuple/tuple/op_assign.md b/reference/tuple/tuple/op_assign.md index 6a594bb1e5..67c8ba00a1 100644 --- a/reference/tuple/tuple/op_assign.md +++ b/reference/tuple/tuple/op_assign.md @@ -9,53 +9,102 @@ tuple& operator=(const tuple&); // (1) C++11 constexpr tuple& operator=(const tuple&); // (1) C++20 -tuple& operator=(tuple&&) noexcept(see below); // (2) C++11 -constexpr tuple& operator=(tuple&&) noexcept(see below); // (2) C++20 +constexpr const tuple& operator=(const tuple&) const; // (2) C++23 + +tuple& operator=(tuple&&) noexcept(see below); // (3) C++11 +constexpr tuple& operator=(tuple&&) noexcept(see below); // (3) C++20 + +constexpr const tuple& operator=(tuple&&) const; // (4) C++23 template -tuple& operator=(const tuple&); // (3) C++11 +tuple& operator=(const tuple&); // (5) C++11 template -constexpr tuple& operator=(const tuple&); // (3) C++20 +constexpr tuple& operator=(const tuple&); // (5) C++20 + +template +constexpr const tuple& + operator=(const tuple&) const; // (6) C++23 template -tuple& operator=(tuple&&); // (4) C++11 +tuple& operator=(tuple&&); // (7) C++11 template -constexpr tuple& operator=(tuple&&); // (4) C++20 +constexpr tuple& operator=(tuple&&); // (7) C++20 + +template +constexpr const tuple& + operator=(tuple&&) const; // (8) C++23 template -tuple& operator=(const pair&); // (5) C++11 +tuple& operator=(const pair&); // (9) C++11 template -constexpr tuple& operator=(const pair&); // (5) C++20 +constexpr tuple& operator=(const pair&); // (9) C++20 + +template +constexpr const tuple& + operator=(const pair&) const; // (10) C++23 template -tuple& operator=(pair&&); // (6) C++11 +tuple& operator=(pair&&); // (11) C++11 template -constexpr tuple& operator=(pair&&); // (6) C++20 +constexpr tuple& operator=(pair&&); // (11) C++20 + +template +constexpr const tuple& operator=(pair&&) const; // (12) C++23 + +template +constexpr tuple& operator=(UTuple&&); // (13) C++23 +template +constexpr const tuple& operator=(UTuple&&) const; // (14) C++23 ``` * see below[italic] * pair[link /reference/utility/pair.md] +* tuple-like[link ../tuple-like.md] ## 概要 - (1) : コピー代入を行う -- (2) : ムーブ代入を行う -- (3) : 変換可能な`tuple`からのコピー代入を行う -- (4) : 変換可能な`tuple`からのムーブ代入を行う -- (5) : 変換可能な`pair`からのコピー代入を行う -- (6) : 変換可能な`pair`からのムーブ代入を行う - +- (2) : (1) のプロキシ参照版 +- (3) : ムーブ代入を行う +- (4) : (3) のプロキシ参照版 +- (5) : 変換可能な[`tuple`](../tuple.md)からのコピー代入を行う +- (6) : (5) のプロキシ参照版 +- (7) : 変換可能な[`tuple`](../tuple.md)からのムーブ代入を行う +- (8) : (7) のプロキシ参照版 +- (9) : 変換可能な[`pair`](/reference/utility/pair.md)からのコピー代入を行う +- (10) : (9) のプロキシ参照版 +- (11) : 変換可能な[`pair`](/reference/utility/pair.md)からのムーブ代入を行う +- (12) : (11) のプロキシ参照版 +- (13) : [`tuple-like`](../tuple-like.md)なオブジェクトを代入 +- (14) : (13) のプロキシ参照版 + +[プロキシ参照](/reference/iterator/indirectly_writable.md)版とは、[プロキシ参照](/reference/iterator/indirectly_writable.md)である(要素が全て[プロキシ参照](/reference/iterator/indirectly_writable.md)である)[`tuple`](../tuple.md)が持つ各要素について、その要素の参照先へ、他の[`tuple`](../tuple.md)又は[`tuple-like`](../tuple-like.md)なオブジェクトの対応する値を代入する動作を行う版である。 ## 要件 -- (1) : `tuple`の全ての要素型`i`が[`is_copy_assignable`](/reference/type_traits/is_copy_assignable.md)`::value == true`であること -- (2) : `tuple`の全ての要素型`i`が[`is_move_assignable`](/reference/type_traits/is_move_assignable.md)`::value == true`であること -- (3) : パラメータの`tuple`の全ての要素型が、元の`tuple`の全ての要素型にコピー代入可能であり、要素数が同じであること -- (4) : パラメータの`tuple`の全ての要素型が、元の`tuple`の全ての要素型にムーブ代入可能であり、要素数が同じであること -- (5) : 元の`tuple`の要素数が2であり、パラメータの`pair`の全ての要素型が元の`tuple`の全ての要素型にコピー代入可能であること -- (6) : 元の`tuple`の要素型が2であり、パラメータの`pair`の全ての要素型が元の`tuple`の全ての要素型にムーブ代入可能であること +`Ti`(`i`は`[0, sizeof...(Types))`を範囲とする)が以下で現れた場合、元の[`tuple`](../tuple.md)のテンプレートパラメーターパックの`i`番目とする。また、`Ui`については、パラメーターの[`tuple`](../tuple.md)についてのテンプレートパラメーターパックの`i`番目とする。 + +- (1) : 全ての`i`について、[`is_copy_assignable`](/reference/type_traits/is_copy_assignable.md)`::value == true`であること +- (2) : C++23 : 全ての`i`について、[`is_copy_assignable_v`](/reference/type_traits/is_copy_assignable.md)` == true`であること +- (3) : 全ての`i`について、[`is_move_assignable`](/reference/type_traits/is_move_assignable.md)`::value == true`であること +- (4) : C++23 : 全ての`i`について、[`is_­assignable_­v`](/reference/type_traits/is_assignable.md)` == true`であること +- (5) : 要素数が同じかつ、パラメータの[`tuple`](../tuple.md)の全ての要素型が、元の[`tuple`](../tuple.md)の全ての要素型にコピー代入可能であること +- (6) : C++23 : 要素数が同じかつ、全ての`i`について、[`is_­assignable_­v`](/reference/type_traits/is_assignable.md)` == true`であること +- (7) : 要素数が同じかつ、パラメータの[`tuple`](../tuple.md)の全ての要素型が、元の[`tuple`](../tuple.md)の全ての要素型にムーブ代入可能であること +- (8) : C++23 : 要素数が同じかつ、全ての`i`について、[`is_­assignable_­v`](/reference/type_traits/is_assignable.md)` = true`であること +- (9) : 元の[`tuple`](../tuple.md)の要素数が2であり、パラメータの[`pair`](/reference/utility/pair.md)の全ての要素型が元の[`tuple`](../tuple.md)の全ての要素型にコピー代入可能であること +- (10) : C++23 : 元の[`tuple`](../tuple.md)の要素数が2であり、[`is_­assignable_­v`](/reference/type_traits/is_assignable.md)` &&` [`is_­assignable_­v`](/reference/type_traits/is_assignable.md)``であること +- (11) : 元の[`tuple`](../tuple.md)の要素型が2であり、パラメータの[`pair`](/reference/utility/pair.md)の全ての要素型が元の[`tuple`](../tuple.md)の全ての要素型にムーブ代入可能であること +- (12) : C++23 : 元の[`tuple`](../tuple.md)の要素数が2であり、[`is_­assignable_­v`](/reference/type_traits/is_assignable.md)` &&` [`is_­assignable_­v`](/reference/type_traits/is_assignable.md)``であること +- (13) : 要素数が同じかつ、次を全て満たすこと + - C++23 : [`different-from`](/reference/ranges/different-from.md)`` + - C++23 : [`remove_­cvref_­t`](/reference/type_traits/remove_cvref.md)``が[`ranges::subrange`](/reference/ranges/subrange.md)の特殊化でないこと + - C++23 : 全ての`i`について、[`is_­assignable_­v`](/reference/type_traits/is_assignable.md)`(`[`std​::​forward`](/reference/utility/forward.md)`(u)))>` +- (14) : 要素数が同じかつ、次をすべて満たすこと + - C++23 : [`different-from`](/reference/ranges/different-from.md)`` + - C++23 : [`remove_­cvref_­t`](/reference/type_traits/remove_cvref.md)``が[`ranges::subrange`](/reference/ranges/subrange.md)の特殊化でないこと + - C++23 : [`is_­assignable_­v`](/reference/type_traits/is_assignable.md)`(`[`std​::​forward`](/reference/utility/forward.md)`(u)))>` ## 例外 -- (2) : `tuple`の全ての要素型`i`が`is_nothrow_move_assignable::value == true`の場合、決して例外を投げない。 -- (4) : パラメータの`tuple`の全ての要素型が、元の`tuple`の全ての要素型にムーブ代入可能であり、要素数が同じであること +- (3) : 全ての`i`について、[`is_nothrow_move_assignable`](/reference/type_traits/is_nothrow_move_assignable.md)`::value == true`の場合、決して例外を投げない。 ## 例 @@ -117,3 +166,4 @@ int main() ## 参照 - [P1032R1 Misc constexpr bits](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1032r1.html) +- [P2165R4 Compatibility between `tuple`, `pair` and *tuple-like* objects](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2165r4.pdf) diff --git a/reference/tuple/tuple/op_compare_3way.md b/reference/tuple/tuple/op_compare_3way.md index 58a1663e00..91e768b7e4 100644 --- a/reference/tuple/tuple/op_compare_3way.md +++ b/reference/tuple/tuple/op_compare_3way.md @@ -9,13 +9,26 @@ namespace std { template constexpr common_comparison_category_t...> operator<=>(const tuple& t, const tuple& u); // (1) C++20 + + template + constexpr common_comparison_category_t...> + operator<=>(const tuple& t, const UTuple& u); // (2) C++23 + + // (2) の Elems は 型パラメータパック + // tuple_­element_­t<0, UTuple>, tuple_­element_­t<1, UTuple>, ..., + // tuple_­element_­t - 1, UTuple> + // を表す。 } ``` * tuple[link ../tuple.md] * common_comparison_category_t[link /reference/compare/common_comparison_category.md] +* synth-three-way-result[link /reference/exposition-only/synth-three-way-result.md] +* tuple-like[link ../tuple-like.md] +* tuple_­element_­t[link ../tuple_element.md] +* tuple_­size_­v[link ../tuple_size.md] ## 概要 -2つの[`tuple`](../tuple.md)オブジェクトの三方比較を行う。 +2つの[`tuple`](../tuple.md)オブジェクトの三方比較を行う。また、[`tuple-like`](../tuple-like.md)なオブジェクトとの三方比較を行う。(C++23以降) ## 効果 @@ -30,6 +43,7 @@ return t tail <=> u tail; ``` * tail[italic] * get[link get.md] +* synth-three-way[link /reference/exposition-only/synth-three-way-result.md] ここで`r`tailは、`r`の最初の要素以外のすべてを含む`tuple`である。 diff --git a/reference/tuple/tuple/op_constructor.md b/reference/tuple/tuple/op_constructor.md index 6198cf8a91..69b191ee40 100644 --- a/reference/tuple/tuple/op_constructor.md +++ b/reference/tuple/tuple/op_constructor.md @@ -27,206 +27,285 @@ explicit(see below) constexpr tuple(UTypes&&...); // (3) C++20 tuple(const tuple&) = default; // (4) C++11 tuple(tuple&&) = default; // (5) C++11 +template +explicit(see below) constexpr tuple(tuple&); // (6) C++23 + template -tuple(const tuple&); // (6) C++11 +tuple(const tuple&); // (7) C++11 template -constexpr tuple(const tuple&); // (6) C++14 +constexpr tuple(const tuple&); // (7) C++14 template -EXPLICIT constexpr tuple(const tuple&); // (6) C++17 +EXPLICIT constexpr tuple(const tuple&); // (7) C++17 template explicit(see below) constexpr - tuple(const tuple&); // (6) C++20 + tuple(const tuple&); // (7) C++20 template -tuple(tuple&&); // (7) C++11 +tuple(tuple&&); // (8) C++11 template -constexpr tuple(tuple&&); // (7) C++14 +constexpr tuple(tuple&&); // (8) C++14 template -EXPLICIT constexpr tuple(tuple&&); // (7) C++17 +EXPLICIT constexpr tuple(tuple&&); // (8) C++17 template -explicit(see below) constexpr tuple(tuple&&); // (7) C++20 +explicit(see below) constexpr tuple(tuple&&); // (8) C++20 + +template +explicit(see below) constexpr + tuple(const tuple&&); // (9) C++23 + +template +explicit(see below) constexpr tuple(pair&); // (10) C++23 template -tuple(const pair&); // (8) C++11 +tuple(const pair&); // (11) C++11 template -constexpr tuple(const pair&); // (8) C++14 +constexpr tuple(const pair&); // (11) C++14 template -EXPLICIT constexpr tuple(const pair&); // (8) C++17 +EXPLICIT constexpr tuple(const pair&); // (11) C++17 template -explicit(see below) constexpr tuple(const pair&); // (8) C++20 +explicit(see below) constexpr tuple(const pair&); // (11) C++20 template -tuple(pair&&); // (9) C++11 +tuple(pair&&); // (12) C++11 template -constexpr tuple(pair&&); // (9) C++14 +constexpr tuple(pair&&); // (12) C++14 template -EXPLICIT constexpr tuple(pair&&); // (9) C++17 +EXPLICIT constexpr tuple(pair&&); // (12) C++17 template -explicit(see below) constexpr tuple(pair&&); // (9) C++20 +explicit(see below) constexpr tuple(pair&&); // (12) C++20 + +template +explicit(see below) constexpr + tuple(const pair&&); // (13) C++23 + +template + explicit(see below) constexpr tuple(UTuple&&); // (14) C++23 -// アロケータによる構築 + +// 以下アロケータを指定する構築 template -tuple(allocator_arg_t, const Alloc& a); // (10) C++11 +tuple(allocator_arg_t, const Alloc& a); // (15) C++11 template -constexpr tuple(allocator_arg_t, const Alloc& a); // (10) C++20 +explicit(see below) constexpr + tuple(allocator_arg_t, const Alloc& a); // (15) C++20 template tuple(allocator_arg_t, const Alloc& a, - const Types&...); // (11) C++11 + const Types&...); // (16) C++11 template EXPLICIT tuple(allocator_arg_t, const Alloc& a, - const Types&...); // (11) C++17 + const Types&...); // (16) C++17 template explicit(see below) constexpr tuple(allocator_arg_t, const Alloc& a, - const Types&...); // (11) C++20 + const Types&...); // (16) C++20 template tuple(allocator_arg_t, const Alloc& a, - UTypes&&...); // (12) C++11 + UTypes&&...); // (17) C++11 template EXPLICIT tuple(allocator_arg_t, const Alloc& a, - UTypes&&...); // (12) C++17 + UTypes&&...); // (17) C++17 template explicit(see below) constexpr tuple(allocator_arg_t, const Alloc& a, - UTypes&&...); // (12) C++20 + UTypes&&...); // (17) C++20 template tuple(allocator_arg_t, const Alloc& a, - const tuple&); // (13) C++11 + const tuple&); // (18) C++11 template constexpr tuple(allocator_arg_t, const Alloc& a, - const tuple&); // (13) C++20 + const tuple&); // (18) C++20 template tuple(allocator_arg_t, const Alloc& a, - tuple&&); // (14) C++11 + tuple&&); // (19) C++11 template constexpr tuple(allocator_arg_t, const Alloc& a, - tuple&&); // (14) C++20 + tuple&&); // (19) C++20 + +template +explicit(see below) constexpr + tuple(allocator_arg_t, + const Alloc& a, + tuple&); // (20) C++23 template tuple(allocator_arg_t, const Alloc& a, - const tuple&); // (15) C++11 + const tuple&); // (21) C++11 template EXPLICIT tuple(allocator_arg_t, const Alloc& a, - const tuple&); // (15) C++17 + const tuple&); // (21) C++17 template explicit(see below) constexpr tuple(allocator_arg_t, const Alloc& a, - const tuple&); // (15) C++20 + const tuple&); // (21) C++20 template tuple(allocator_arg_t, const Alloc& a, - tuple&&); // (16) C++11 + tuple&&); // (22) C++11 template EXPLICIT tuple(allocator_arg_t, const Alloc& a, - tuple&&); // (16) C++17 + tuple&&); // (22) C++17 template explicit(see below) constexpr tuple(allocator_arg_t, const Alloc& a, - tuple&&); // (16) C++20 + tuple&&); // (22) C++20 + +template +explicit(see below) constexpr + tuple(allocator_arg_t, + const Alloc& a, + const tuple&&); // (23) C++23 + +template +explicit(see below) constexpr + tuple(allocator_arg_t, + const Alloc& a, + pair&); // (24) C++23 template tuple(allocator_arg_t, const Alloc& a, - const pair&); // (17) C++11 + const pair&); // (25) C++11 template EXPLICIT tuple(allocator_arg_t, const Alloc& a, - const pair&); // (17) C++17 + const pair&); // (25) C++17 template explicit(see below) constexpr tuple(allocator_arg_t, const Alloc& a, - const pair&); // (17) C++20 + const pair&); // (25) C++20 template tuple(allocator_arg_t, const Alloc& a, - pair&&); // (18) C++11 + pair&&); // (26) C++11 template EXPLICIT tuple(allocator_arg_t, const Alloc& a, - pair&&); // (18) C++17 + pair&&); // (26) C++17 template explicit(see below) constexpr tuple(allocator_arg_t, const Alloc& a, - pair&&); // (18) C++20 + pair&&); // (26) C++20 + +template +explicit(see below) constexpr + tuple(allocator_arg_t, + const Alloc& a, + const pair&&); // (27) C++23 + +template +explicit(see below) constexpr + tuple(allocator_arg_t, const Alloc& a, UTuple&&); // (28) C++23 ``` * see below[italic] * EXPLICIT[italic] * pair[link /reference/utility/pair.md] * allocator_arg_t[link /reference/memory/allocator_arg_t.md] +* tuple-like[link ../tuple-like.md] +* see below[italic] ## tupleオブジェクトの構築 -- (1) : すべての要素を初期化して構築 +- (1) : デフォルトコンストラクタ(すべての要素を初期化して構築) - (2) : 可変テンプレートパラメータの型の値によるコピー構築 - (3) : 可変テンプレートパラメータの型に変換可能な値によるムーブ構築 - (4) : コピーコンストラクタ - (5) : ムーブコンストラクタ -- (6) : 変換可能な型からのコピーコンストラクタ -- (7) : 変換可能な型からのムーブコンストラクタ -- (8) : テンプレートパラメータ数が2の場合に、`std::pair`オブジェクトからコピー構築する -- (9) : テンプレートパラメータ数が2の場合に、`std::pair`オブジェクトからムーブ構築する -- (10) : アロケータを指定してデフォルト構築する -- (11) : アロケータを指定して可変テンプレートパラメータの型の値によってコピー構築する -- (12) : アロケータを指定して可変テンプレートパラメータの型の値によってムーブ構築する -- (13) : アロケータを指定してコピー構築 -- (14) : アロケータを指定してムーブ構築 -- (15) : アロケータを指定して変換可能な他の`tuple`オブジェクトからコピー構築 -- (16) : アロケータを指定して変換可能な他の`tuple`オブジェクトからムーブ構築 -- (17) : テンプレートパラメータ数が2の場合、アロケータを指定して`std::pair`オブジェクトからコピー構築する -- (18) : テンプレートパラメータ数が2の場合、アロケータを指定して`std::pair`オブジェクトからムーブ構築する +- (6)-(9) : 変換可能な他の[`tuple`](../tuple.md)オブジェクトから構築 + - (6), (7), (9) はコピー構築、(8) はムーブ構築される +- (10)-(13) : テンプレートパラメータ数が2の場合、[`std::pair`](/reference/utility/pair.md)オブジェクトから構築する + - (10), (11), (13) はコピー構築、(12) はムーブ構築される +- (14) : [`tuple-like`](../tuple-like.md)なオブジェクトから構築する + +以下 (15)-(28) は (1)-(14) のアロケータ指定版であり、アロケータを指定する事以外は (1)-(14) と等価である。 + +- (15) : アロケータを指定してデフォルト構築する +- (16) : アロケータを指定して可変テンプレートパラメータの型の値によってコピー構築する +- (17) : アロケータを指定して可変テンプレートパラメータの型の値によってムーブ構築する +- (18) : アロケータを指定してコピー構築 +- (19) : アロケータを指定してムーブ構築 +- (20)-(23) : アロケータを指定して変換可能な他の[`tuple`](../tuple.md)オブジェクトから構築 + - (20), (21), (23) はコピー構築、(22) はムーブ構築される +- (24)-(27) : テンプレートパラメータ数が2の場合、アロケータを指定して[`std::pair`](/reference/utility/pair.md)オブジェクトから構築する + - (24), (25), (27) はコピー構築、(26) はムーブ構築される +- (28) : アロケータを指定して[`tuple-like`](../tuple-like.md)なオブジェクトから構築する ## テンプレートパラメータ制約 -- (1), (10) : +- (1), (15) : - `Types...`の全ての型`Ti`について、[`is_default_constructible`](/reference/type_traits/is_default_constructible.md)`::value == true`であること -- (2), (11) : +- (2), (16) : - `Types...`の全ての型`Ti`について、[`is_copy_constructible`](/reference/type_traits/is_copy_constructible.md)`::value == true`であること -- (3), (12) : +- (3), (17) : - `sizeof...(Types) == sizeof...(UTypes)`であること + - C++20まで : `Types...`の全ての型`Ti`と、`UTypes...`の全ての型`Ui`について、[`is_constructible`](/reference/type_traits/is_constructible.md)`::value == true`であること - C++17 : `sizeof...(Types) >= 1`であること - - `Types...`の全ての型`Ti`と、`UTypes...`の全ての型`Ui`について、[`is_constructible`](/reference/type_traits/is_constructible.md)`::value == true`であること -- (4), (13) : + - C++23 : `disambiguating-constraint`を次のように定義して、 + - `sizeof...(Types) == 1`の時、[`negation`](/reference/type_traits/negation.md)`<`[`is_­same`](/reference/type_traits/is_same.md)`<`[`remove_­cvref_­t`](/reference/type_traits/remove_cvref.md)`,` [`tuple`](../tuple.md)`>>` + - `sizeof...(Types) == 2 || sizeof...(Types) == 3`の時、[`bool_­constant`](/reference/type_traits/bool_constant.md)`,` [`allocator_­arg_­t`](/reference/memory/allocator_arg_t.md)`> ||` [`is_­same_­v`](/reference/type_traits/is_same.md)`<`[`remove_­cvref_­t`](/reference/type_traits/remove_cvref.md)`,` [`allocator_­arg_­t`](/reference/memory/allocator_arg_t.md)`>>` + - 以上に該当しなければ、[`true_type`](/reference/type_traits/true_type.md) + - C++23 : [`conjunction_­v`](/reference/type_traits/conjunction.md)`...>`であること +- (4), (18) : - `Types...`の全ての型`Ti`について、[`is_copy_constructible`](/reference/type_traits/is_copy_constructible.md)`::value == true`であること -- (5), (14) : +- (5), (19) : - `Types...`の全ての型`Ti`について、[`is_move_constructible`](/reference/type_traits/is_move_constructible.md)`::value == true`であること -- (6), (15) : +- (6)-(9), (20)-(23) : + - `I`をパラメータパック`0, 1, ..., (sizeof...(Types) - 1)`、`FWD(u)`を`static_­cast(u)`、`sizeof...(Types) == 1`の場合は、`Types...`を`T`へ、`UTypes...`を`U`へ展開したと定義して + - C++23 : `sizeof...(Types) == sizeof...(UTypes) && (`[`is_­constructible_­v`](/reference/type_traits/is_constructible.md)`(FWD(u)))> && ...) == true`であること + - C++23 : 更に、`sizeof...(Types) != 1`または、[`is_­convertible_v­`](/reference/type_traits/is_convertible.md)` == false &&` [`is_­constructible_­v`](/reference/type_traits/is_constructible.md)` == false &&` [`is_­same_­v`](/reference/type_traits/is_same.md)` == false`であること +- (7), (21) : - `sizeof...(Types) == sizeof...(UTypes)`であること - `Types...`の全ての型`Ti`と、`UTypes...`の全ての型`Ui`について、[`is_constructible`](/reference/type_traits/is_constructible.md)`::value == true`であること - - C++17 : `sizeof(Types...) != 1`であるか、そうでなければ`Types...`の先頭を`T`、`UTypes...`の先頭をUとして、`!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`&, T> && !`[`is_constructible_v`](/reference/type_traits/is_constructible.md)`&> && !`[`is_same_v`](/reference/type_traits/is_same.md)``が`true`であること + - C++17 : `sizeof(Types...) != 1`であるか、そうでなければ`Types...`の先頭を`T`、`UTypes...`の先頭を`U`として、`!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`&, T> && !`[`is_constructible_v`](/reference/type_traits/is_constructible.md)`&> && !`[`is_same_v`](/reference/type_traits/is_same.md)``が`true`であること - コピーコンストラクタとのオーバーロードが成立することを意図している -- (7), (16) : + - C++23 : (6)-(9), (20)-(23) の定義参照 +- (8), (22) : - `sizeof...(Types) == sizeof...(UTypes)`であること - `Types...`の全ての型`Ti`と、`UTypes...`の全ての型`Ui`について、[`is_constructible`](/reference/type_traits/is_constructible.md)`::value == true`であること - C++17 : `sizeof(Types...) != 1`であるか、そうでなければ`Types...`の先頭を`T`、`UTypes...`の先頭をUとして、`!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`, T> && !`[`is_constructible_v`](/reference/type_traits/is_constructible.md)`> && !`[`is_same_v`](/reference/type_traits/is_same.md)``が`true`であること - ムーブコンストラクタとのオーバーロードが成立することを意図している -- (8), (17) : + - C++23 : (6)-(9), (20)-(23) の定義参照 +- (10)-(13), (24)-(27) : + - `FWD(u)`を`static_­cast(u)`、`Types...`の0番目の型を`T0`、1番目の型を`T1`であるとして、 + - C++23 : `sizeof...(Types) == 2`であること + - C++23 : [`is_constructible_v`](/reference/type_traits/is_constructible.md)`(FWD(u))) == true`であること + - C++23 : [`is_constructible_v`](/reference/type_traits/is_constructible.md)`(FWD(u))) == true`であること +- (11), (25) : - `Types...`の0番目の型を`T0`、1番目の型を`T1`であるとする - `sizeof...(Types) == 2`であること - [`is_constructible`](/reference/type_traits/is_constructible.md)`::value == true`かつ[`is_constructible`](/reference/type_traits/is_constructible.md)`::value == true`であること -- (9), (18) : + - C++23 : (10)-(13), (24)-(27) の定義参照 +- (12), (26) : - `Types...`の0番目の型を`T0`、1番目の型を`T1`であるとする - `sizeof...(Types) == 2`であること - [`is_constructible`](/reference/type_traits/is_constructible.md)`::value == true`かつ[`is_constructible`](/reference/type_traits/is_constructible.md)`::value == true`であること + - C++23 : (10)-(13), (24)-(27) の定義参照 +- (14), (28) : + - C++23 : [`tuple-like`](../tuple-like.md)``であること + - C++23 : [`different-from`](/reference/ranges/different-from.md)``であること + - C++23 : [`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``が[`ranges::subrange`](/reference/ranges/subrange.md)の特殊化でないこと + - C++23 : `sizeof...(Types) ==` [`tuple_size_v`](../tuple_size.md)`<`[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`>`であること + - C++23 : `(`[`is_­constructible_­v`](/reference/type_traits/is_constructible.md)`(`[`std​::​forward`](/reference/utility/forward.md)`(u)))> && ...) == true`であること + - C++23 : `sizeof...(Types) != 1`であるか、または`Types...`を`T`に展開したとして[`is_­convertible_­v`](/reference/type_traits/is_convertible.md)` == false &&` [`is_­constructible_­v`](/reference/type_traits/is_constructible.md)` == false`であること ## 備考 @@ -238,25 +317,54 @@ explicit(see below) constexpr - (3) : - C++11からC++14まで : 無条件で`explicit`となる - C++17から : `!`[`conjunction_v`](/reference/type_traits/conjunction.md)`<`[`is_convertible`](/reference/type_traits/is_convertible.md)`...>`である場合、この関数は`explicit`となる -- (6) : - - C++17 : `!`[`conjunction_v`](/reference/type_traits/conjunction.md)`<`[`is_convertible`](/reference/type_traits/is_convertible.md)`...>`である場合、この関数は`explicit`となる + - C++23から : `(`[`reference_constructs_from_temporary_v`](/reference/type_traits/reference_constructs_from_temporary.md)` || ...)`である場合、この関数は削除定義される +- (6)-(9) : + - `I`をパラメータパック`0, 1, ..., (sizeof...(Types) - 1)`、`FWD(u)`を`static_­cast(u)`と定義して、 + - C++23 : `!(`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`(FWD(u))), Types> && ...)`である場合、この関数は`explicit`となる + - C++23 : `(`[`reference_constructs_from_temporary_v`](/reference/type_traits/reference_constructs_from_temporary.md)`(FWD(u)))> || ...)`である場合、この関数は削除定義される - (7) : - - C++17 : `!`[`conjunction_v`](/reference/type_traits/conjunction.md)`<`[`is_convertible`](/reference/type_traits/is_convertible.md)`...>`である場合、この関数は`explicit`となる + - C++17 : `!`[`conjunction_v`](/reference/type_traits/conjunction.md)`<`[`is_convertible`](/reference/type_traits/is_convertible.md)`...>`である場合、この関数は`explicit`となる + - C++23 : (6)-(9) の定義参照 - (8) : - - `Types...`の0番目の型を`T0`、1番目の型を`T1`であるとする - - `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` || !`[`is_convertible_v`](/reference/type_traits/is_convertible.md)``である場合、この関数は`explicit`となる + - C++17 : `!`[`conjunction_v`](/reference/type_traits/conjunction.md)`<`[`is_convertible`](/reference/type_traits/is_convertible.md)`...>`である場合、この関数は`explicit`となる + - C++23 : (6)-(9) の定義参照 +- (10)-(13) : + - `FWD(u)`を`static_­cast(u)`、`Types...`の0番目の型を`T0`、1番目の型を`T1`であるとして、 + - C++23 : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`(FWD(u))), T0> ||!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`(FWD(u))), T1>`である場合、この関数は`explicit`となる + - C++23 : [`reference_constructs_from_temporary_v`](/reference/type_traits/reference_constructs_from_temporary.md)`(FWD(u)))> ||` [`reference_constructs_from_temporary_v`](/reference/type_traits/reference_constructs_from_temporary.md)`(FWD(u)))>`である場合、この関数は削除定義される - (11) : - - C++17 : (2)と同じ条件で`explicit`となる + - `Types...`の0番目の型を`T0`、1番目の型を`T1`であるとする + - C++17 : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` || !`[`is_convertible_v`](/reference/type_traits/is_convertible.md)``である場合、この関数は`explicit`となる + - C++23 : (10)-(13) の定義参照 - (12) : - - C++17 : (3)と同じ条件で`explicit`となる + - `Types...`の0番目の型を`T0`、1番目の型を`T1`であるとする + - C++17 : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` || !`[`is_convertible_v`](/reference/type_traits/is_convertible.md)``である場合、この関数は`explicit`となる + - C++23 : (10)-(13) の定義参照 +- (14) : + - `I`をパラメータパック`0, 1, ..., (sizeof...(Types) - 1)`と定義して、 + - C++23 : `!(`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`(`[`std::forward`](/reference/utility/forward.md)`(u))), Types> && ...)`である場合、この関数は`explicit`となる - (15) : - - C++17 : (6)と同じ条件で`explicit`となる + - C++20 : 対応するコンストラクタ (1) と同じ条件で`explicit`となる - (16) : - - C++17 : (7)と同じ条件で`explicit`となる + - C++17 : 対応するコンストラクタ (2) と同じ条件で`explicit`となる - (17) : - - C++17 : (8)と同じ条件で`explicit`となる -- (18) : - - C++17 : (9)と同じ条件で`explicit`となる + - C++17 : 対応するコンストラクタ (3) と同じ条件で`explicit`となる + - C++23 : 対応するコンストラクタ (3) と同じ条件で削除定義される +- (20), (23) : + - C++23 : それぞれ対応するコンストラクタ (6), (9) と同じ条件で`explicit`となる + - C++23 : それぞれ対応するコンストラクタ (6), (9) と同じ条件で削除定義される +- (21), (22) : + - C++17 : それぞれ対応するコンストラクタ (7), (8) と同じ条件で`explicit`となる + - C++23 : それぞれ対応するコンストラクタ (7), (8) と同じ条件で削除定義される +- (24), (27) : + - C++23 : それぞれ対応するコンストラクタ (10), (13) と同じ条件で`explicit`となる + - C++23 : それぞれ対応するコンストラクタ (10), (13) と同じ条件で削除定義される +- (25), (26) : + - C++17 : それぞれ対応するコンストラクタ (11), (12) と同じ条件で`explicit`となる + - C++23 : それぞれ対応するコンストラクタ (11), (12) と同じ条件で削除定義される +- (28) : + - C++23 : それぞれ対応するコンストラクタ (14) と同じ条件で`explicit`となる + - C++17では、コンストラクタの各オーバーロードが条件付きで`explicit`となるよう規定された。これは、以下のような初期化子リストを使用したC++17での初期化が不適格になっていたため、適格になるようにするための変更である: ```cpp std::tuple pixel_coordinates() @@ -270,6 +378,13 @@ explicit(see below) constexpr - この変更はC++17に対するものであるが、コンパイラが早期に対応していたため、一部処理系ではC++14の段階から適格となっていた +- C++23 では、ダングリング参照の作成が簡単にできていた状態を改善するべく、[`reference_constructs_from_temporary`](/reference/type_traits/reference_constructs_from_temporary.md)が追加され、ダングリング参照が作成される場合には不適格とするようになった : + ```cpp + // コンストラクタ引数で std::string が構築され + // その一時オブジェクトが束縛されるため、ダングリング参照となっていた + // C++23 からは不適格であり、コンパイルエラー等で未然に防がれる + std::tuple x("hello", "world"); + ``` ## 例 ```cpp example @@ -332,3 +447,11 @@ int main() - [P1032R1 Misc constexpr bits](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1032r1.html) - [P0892R2 `explicit(bool)`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0892r2.html) - C++20での`explicit(bool)`構文への対応 +- [P2165R4 Compatibility between `tuple`, `pair` and *tuple-like* objects](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2165r4.pdf) + - [`tuple-like`](/reference/tuple/tuple-like.md)なオブジェクトからの構築 +- [P2255R2 A type trait to detect reference binding to temporary](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2255r2.html) + - 参照型を要素に持つ場合にダングリング参照が容易に作成できていたのを不適格にする +- [LWG 3121 tuple constructor constraints for UTypes&&... overloads](https://cplusplus.github.io/LWG/issue3121) + - C++23 での (3) のコンストラクタの制約の変更(`disambiguating-constraint`等)について +- [P2321R2 `zip`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2321r2.html#tuple) + - すべての要素が[プロキシ参照](/reference/iterator/indirectly_writable.md)の場合、[プロキシ参照](/reference/iterator/indirectly_writable.md)として使用できるようにする diff --git a/reference/tuple/tuple/op_equal.md b/reference/tuple/tuple/op_equal.md index ba77831b5d..b0cb55f2f8 100644 --- a/reference/tuple/tuple/op_equal.md +++ b/reference/tuple/tuple/op_equal.md @@ -13,17 +13,26 @@ namespace std { template constexpr bool operator==(const tuple& t, const tuple& u); // (1) C++14 + + template + constexpr bool operator==(const tuple& t, + const UTuple& u); // (2) C++23 } ``` * tuple[link ../tuple.md] +* tuple-like[link ../tuple-like.md] ## 概要 -2つの[`tuple`](../tuple.md)オブジェクトの等値比較を行う。 +2つの[`tuple`](../tuple.md)オブジェクトの等値比較を行う。また、[`tuple-like`](../tuple-like.md)なオブジェクトとの等値比較を行う。(C++23以降) ## 要件 -- 2つの[`tuple`](../tuple.md)オブジェクトの要素数が同じであること。 -- [`tuple`](../tuple.md)の要素`std::`[`get`](get.md)`(t)`と`std::`[`get`](get.md)`(u)`において、すべての要素の比較 `std::`[`get`](get.md)`(t) == std::`[`get`](get.md)`(u)` の比較結果が`bool`に変換可能な型であること。 +- (1) : + - 2つの[`tuple`](../tuple.md)オブジェクトの要素数が同じであること。(具体的には`sizeof...(TTypes) == sizeof...(UTypes)`であること。) + - [`tuple`](../tuple.md)の要素`std::`[`get`](get.md)`(t)`と`std::`[`get`](get.md)`(u)`において、すべての要素の比較 `std::`[`get`](get.md)`(t) == std::`[`get`](get.md)`(u)` の比較結果が`bool`に変換可能な型(C++23 以降は[`boolean-testable`](/reference/concepts/boolean-testable.md)を満たせばよい)であること。 +- (2) : + - C++23 : 2つの[`tuple-like`](../tuple-like.md)なオブジェクトの要素数が同じであること。(正確には、`sizeof...(TTypes) ==` [`tuple_­size_­v`](../tuple_size.md)``であること。) + - C++23 : [`tuple`](../tuple.md)の要素`std::`[`get`](get.md)`(t)`と[`tuple-like`](../tuple-like.md)なオブジェクトの要素`std::get(u)`において、すべての要素の比較 `std::`[`get`](get.md)`(t) == std::`[`get`](get.md)`(u)` の比較結果が[`boolean-testable`](/reference/concepts/boolean-testable.md)を満たす型(`bool`へ変換可能な型)であること。 ## 効果 @@ -31,7 +40,7 @@ namespace std { ## 戻り値 -[`tuple`](../tuple.md)の全ての要素を`std::`[`get`](get.md)`(t) ==std::`[`get`](get.md)`(u)` した結果が`true`である場合`true`を返し、そうでなければ`false`を返す。 +[`tuple`](../tuple.md)の全ての要素を`std::`[`get`](get.md)`(t) == std::`[`get`](get.md)`(u)`した結果が`true`である場合`true`を返し、そうでなければ`false`を返す。 ## 備考 @@ -84,3 +93,4 @@ false - [N3471 Constexpr Library Additions: utilities, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3471.html) - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P2165R4 Compatibility between `tuple`, `pair` and *tuple-like* objects](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2165r4.pdf) diff --git a/reference/tuple/tuple/swap.md b/reference/tuple/tuple/swap.md index 4467d18b25..d361d7fb2c 100644 --- a/reference/tuple/tuple/swap.md +++ b/reference/tuple/tuple/swap.md @@ -8,19 +8,26 @@ ```cpp void swap(tuple& rhs) noexcept(see below); // (1) C++11 constexpr void swap(tuple& rhs) noexcept(see below); // (1) C++20 + +constexpr void + swap(const tuple& rhs) const noexcept(see below); // (2) C++23 ``` +* tuple[link ../tuple.md] * see below[italic] ## 概要 -他の`tuple`オブジェクトと中身を入れ替える。 +- (1) : 他の[`tuple`](../tuple.md)オブジェクトと中身を入れ替える。 +- (2) : [プロキシ参照](/reference/iterator/indirectly_writable.md)である[`tuple`](../tuple.md)同士で、参照先の値を入れ替える。 ## 要件 -`tuple`の全ての要素型が`swap`可能であること。 +- (1) : [`tuple`](../tuple.md)の全ての要素型が`swap`可能であること。 +- (2) : C++23 : `(`[`is_swappable_v`](/reference/type_traits/is_swappable.md)` && ...) == true`であること。 ## 効果 -自身のインスタンスの全ての要素を、`rhs`の全ての要素と入れ替える +- (1) : 自身のインスタンスの全ての要素を、`rhs`の全ての要素と入れ替える +- (2) : 自身のインスタンスの各要素の参照先の値と、他の[プロキシ参照](/reference/iterator/indirectly_writable.md)な[`tuple`](../tuple.md)の各要素の参照先の値とを入れ替える。 ## 戻り値 @@ -28,7 +35,8 @@ constexpr void swap(tuple& rhs) noexcept(see below); // (1) C++20 ## 例外 -`tuple`の全ての要素型が、例外を投げない`swap`を持っている場合、この関数は例外を投げない +- (1) : [`tuple`](../tuple.md)の全ての要素型が、例外を投げない`swap`を持っている場合、この関数は例外を投げない +- (2) : C++23 : `(`[`is_nothrow_swappable_v`](/reference/type_traits/is_nothrow_swappable.md)` && ...) == true`であること。 ## 例 @@ -68,3 +76,4 @@ int main() ## 参照 - [P1032R1 Misc constexpr bits](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1032r1.html) +- [P2321R2 `zip`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2321r2.html) diff --git a/reference/tuple/tuple/swap_free.md b/reference/tuple/tuple/swap_free.md index e9636a9d81..8f26bbd29d 100644 --- a/reference/tuple/tuple/swap_free.md +++ b/reference/tuple/tuple/swap_free.md @@ -12,11 +12,21 @@ namespace std { template constexpr void swap(tuple& x, tuple& y) noexcept(noexcept(x.swap(y))); // (1) C++20 + + template + constexpr void swap(const tuple& x, + const tuple& y) + noexcept(see below); // (2) C++23 } ``` ## 概要 -2つの`tuple`オブジェクトを入れ替える。 +- (1) : 2つの`tuple`オブジェクトを入れ替える。 +- (2) : 2つの[プロキシ参照](/reference/iterator/indirectly_writable.md)である`tuple`オブジェクトについて、対応する要素毎に参照先の値を入れ替える。 + + +## 要件 +効果の式に現れている、[`tuple::swap`](swap.md)に準じる。 ## 効果 diff --git a/reference/tuple/tuple_cat.md b/reference/tuple/tuple_cat.md index f1a5573651..1f7f18b28a 100644 --- a/reference/tuple/tuple_cat.md +++ b/reference/tuple/tuple_cat.md @@ -7,28 +7,48 @@ ```cpp namespace std { template - tuple tuple_cat(Tuples&&...); // C++11 + tuple tuple_cat(Tuples&&...); // C++11 template - constexpr tuple tuple_cat(Tuples&&...); // C++14 + constexpr tuple tuple_cat(Tuples&&...); // C++14 + + template + constexpr tuple tuple_cat(Tuples&&... tpls); // C++23 } ``` +* tuple[link tuple.md] +* tuple-like[link tuple-like.md] ## 概要 -複数の[`tuple`](../tuple.md)を繋ぎ合わせ、1つの[`tuple`](../tuple.md)にする。 +複数の[`tuple`](tuple.md)を繋ぎ合わせ、1つの[`tuple`](tuple.md)にする。C++23 からは[`tuple-like`](tuple-like.md)である型を対象に繋ぎ合わせることが可能。 ## 要件 -- `Tuples...`の全ての型が`std::tuple`であること。 -- `Args...`の各型が左辺値参照であればコピー構築可能、そうでなければムーブ構築可能であること。 +- C++20まで : + - `Tuples...`の全ての型が[`std::tuple`](tuple.md)``であること。 + - `Args...`の各型が左辺値参照であればコピー構築可能、そうでなければムーブ構築可能であること。 +- C++23から : + - 本関数の返り値の[`tuple`](tuple.md)のテンプレートパラメーターパックを`Ctypes`とし、`Ctypes`の全ての要素について、引数`tpls`において対応する要素の型から構築可能であること。 + - より厳密には、次のように定義を行い、`(`[`is_­constructible_v­`](/reference/type_traits/is_constructible.md)` && ...) == true`であること。 + - `n`を`sizeof...(Tuples)`とし、`i`を範囲`[0, n)`における整数値とする + - `T(i)`を`Tuples`の`i`番目とする + - `U(i)`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md) とする + - `tp(i)`をパラメータパック`tpls`の`i`番目とする + - `S(i)`を[`tuple_size_v`](/reference/tuple/tuple_size.md)とする + - `E(i,k)`を[`tuple_element_t`](/reference/tuple/tuple_element.md)とする + - `e(i,k)`を`get(`[`std::forward`](/reference/utility/forward.md)`(tp(i)))`とする + - `Elems(i)`を型パラメータパック`E(i,0), ..., E(i,Si-1)`とする + - `elems(i)`をパラメータパック`e(i,0), ..., e(i,Si-1)`とする + - `Ctypes`を型パラメーターパック`Elems(0)..., Elems(1)..., ..., Elems(n-1)...`とする + - `celems`をパラメーターパック`elems(0)..., elems(1), ..., elems(n-1)...`とする ## 戻り値 -`Tuples...`の全ての`tuple`型の要素型全てを取り出し、`std::`[`forward`](/reference/utility/forward.md)`(x)`して構築される1つの`tuple`オブジェクト。 +`Tuples...`の全ての`tuple`型の要素型全てを取り出し、`std::`[`forward`](/reference/utility/forward.md)`(x)`して構築される1つの[`tuple`](tuple.md)`オブジェクト。 ## 備考 -実装によっては、`Tuples...` パラメータパックに含めることのできる型として、他のタプルライクな型([`pair`](/reference/utility/pair.md)や[`array`](/reference/array/array.md)のような)を追加的にサポートする可能性がある。 +実装によっては、`Tuples...` パラメータパックに含めることのできる型として、他のタプルライクな型([`pair`](/reference/utility/pair.md)や[`array`](/reference/array/array.md)のような)を追加的にサポートする可能性がある。(C++23からは[`tuple-like`](tuple-like.md)を満たす型をサポートする。) ## 例 @@ -79,4 +99,4 @@ World ## 参照 - [N3471 Constexpr Library Additions: utilities, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3471.html) - +- [P2165R4 Compatibility between `tuple`, `pair` and *tuple-like* objects](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2165r4.pdf) diff --git a/reference/type_traits.md b/reference/type_traits.md index b28f6c6e57..2b498ee7cb 100644 --- a/reference/type_traits.md +++ b/reference/type_traits.md @@ -123,6 +123,8 @@ | [`is_nothrow_convertible`](type_traits/is_nothrow_convertible.md) | ある型から別の型へ、例外を投げずに変換可能か調べる (class template) | C++20 | | [`is_layout_compatible`](type_traits/is_layout_compatible.md) | 2つの型にレイアウト互換があるかを判定する (class template) | C++20 | | [`is_pointer_interconvertible_base_of`](type_traits/is_pointer_interconvertible_base_of.md) | 基底クラスと派生クラスの間でポインタ相互交換可能かを判定する (class template) | C++20 | +| [`reference_constructs_from_temporary`](type_traits/reference_constructs_from_temporary.md) | 参照が一時オブジェクトを直接初期化(丸括弧による初期化)で束縛した時、一時オブジェクトの寿命が延長されているかを判定する (class template) | C++23 | +| [`reference_converts_from_temporary`](type_traits/reference_converts_from_temporary.md) | 参照が一時オブジェクトをコピー初期化(代入形式による初期化)で束縛した時、一時オブジェクトの寿命が延長されているかを判定する (class template) | C++23 | ## const-volatile の変更 diff --git a/reference/type_traits/common_reference.md b/reference/type_traits/common_reference.md index 7663b85ff8..5e118dda01 100644 --- a/reference/type_traits/common_reference.md +++ b/reference/type_traits/common_reference.md @@ -71,7 +71,7 @@ namespace std { ポインタ型やC++17までの標準ライブラリにおける普通のイテレータ型では、その`reference`型は`value_type&`の別名として定義されるという関係性がある。そのため、`value_type`と`reference`はどちらも`const`左辺値参照を付加することで`const value_type&`に変換できる(ことが期待される)。 -しかし、C++20から追加される`range`ライブラリの元となった`range-v3`ライブラリにおける`zip_view`(C++20には導入されていない)のプロクシイテレータのように、特殊なイテレータではそのような関係性が必ずしも成り立つとは限らない。 +しかし、C++20から追加される`range`ライブラリの元となった`range-v3`ライブラリにおける`zip_view`(標準ライブラリへはC++23で導入される)のプロキシイテレータのように、特殊なイテレータではそのような関係性が必ずしも成り立つとは限らない。 このような関係性を持つ型があるとジェネリックなアルゴリズムをより簡易に書くことができるようになるなどメリットがあるため、そのような型を求めるために`common_reference`が導入された。 diff --git a/reference/type_traits/is_invocable_r.md b/reference/type_traits/is_invocable_r.md index c207f4fcbe..a5b907ce77 100644 --- a/reference/type_traits/is_invocable_r.md +++ b/reference/type_traits/is_invocable_r.md @@ -23,15 +23,58 @@ namespace std { ## 効果 -型`F`に対して引数`ArgsTypes...`による[*INVOKE*](/reference/concepts/Invoke.md)要件に従った呼び出しが可能であり、その結果となる戻り値の型が`R`に変換可能であれば[`true_type`](true_type.md)から派生し、そうでなければ[`false_type`](false_type.md)から派生する。 +型`F`に対して引数`ArgsTypes...`による[*INVOKE*](/reference/concepts/Invoke.md)要件に従った呼び出しが可能であり、その結果となる戻り値の型が`R`に変換可能であれば[`true_type`](true_type.md)から派生し、そうでなければ[`false_type`](false_type.md)から派生する。(C++20まで。) + +C++23 では、型`F`に対して引数`ArgsTypes...`による[*INVOKE*](/reference/concepts/Invoke.md)要件に従った呼び出しが可能であり、その結果となる戻り値の型を`S`とすると、`S`は`R`に変換可能かつ、`S`は`R`に束縛されて寿命が延長されないのであれば[`true_type`](true_type.md)から派生し、そうでなければ[`false_type`](false_type.md)から派生する。 結果は以下と等価である: ```cpp +// C++17 std::is_convertible_v, R> + +// C++23 +std::is_convertible_v, R> && +std::reference_­converts_­from_­temporary_­v> == false ``` * std::is_convertible_v[link is_convertible.md] * std::invoke_result_t[link invoke_result.md] +* std::reference_­converts_­from_­temporary_­v[link /reference/type_traits/reference_converts_from_temporary.md] + + +## 寿命の延長とダングリング参照 +前項での`S`を継続して使用する。以下では`S`/`R`を`S`の値/`R`の値の意味で用いる場合がある。 + +`S`が`R`に束縛されて寿命が延長されるとは、`R`が参照、特に`const T&`や`T&&`である場合に発生する`S`の値に対する寿命の延長のことである。本メタ関数は実際に[*INVOKE*](/reference/concepts/Invoke.md)と`R`への変換を行う訳では無いが、本メタ関数に渡された型の値を使用して[*INVOKE*](/reference/concepts/Invoke.md)と`S`から`R`への変換が行われる場合(つまり[`invoke_r`](/reference/functional/invoke_r.md)の中)について考えてみよう。 + +`R`が`const T&`または`T&&`で、かつ`S`が`rvalue`であれば、`S`を`R`へ暗黙変換する際に`S`の寿命は`R`の寿命に合わせて延長されることがある。しかしこの場合、`R`は[*INVOKE*](/reference/concepts/Invoke.md)が行われる文を寿命とするので、`S`も同様に[*INVOKE*](/reference/concepts/Invoke.md)が行われる文が終了すると同時に寿命が終了する。参照による寿命の延長は2度適用されることはないため、このような場合には常にダングリング参照が生じてしまう。 + +これを検出し、不適格とするために[`reference_­converts_­from_­temporary_­v`](/reference/type_traits/reference_converts_from_temporary.md)を使用しているというわけなのである。 + +```cpp example +#include +#include + +struct S { + S() { std::cout << "S construct" << std::endl; } + ~S() { std::cout << "S destruct" << std::endl; } +}; + +int main() +{ + using R = const S&; + + std::cout << "1" << std::endl; + + // INVOKE、つまり std::invoke の返り値である S が + // R に束縛されて R の寿命と同じ寿命に延長された上で std::invoke_r の返り値となる + // しかし R の寿命はこの1文の間だけなので、S もこの1文が終了する際に破棄される + const S& a = std::invoke_r([]() { return S{}; }); + + std::cout << "2" << std::endl; +} +``` +* std::is_invocable_r[color ff0000] ## 例 @@ -84,3 +127,4 @@ false ## 参照 - [C++1z 関数が呼び出し可能かを判定する型特性 - Faith and Brave - C++で遊ぼう](https://faithandbrave.hateblo.jp/entry/2016/05/13/183857) - [Resolving GB 55, US 84, US 85, US 86](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0604r0.html) +- [P2255R2 A type trait to detect reference binding to temporary](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2255r2.html) diff --git a/reference/type_traits/reference_constructs_from_temporary.md b/reference/type_traits/reference_constructs_from_temporary.md new file mode 100644 index 0000000000..c02a78c880 --- /dev/null +++ b/reference/type_traits/reference_constructs_from_temporary.md @@ -0,0 +1,156 @@ +# reference_constructs_from_temporary +* type_traits[meta header] +* class template[meta id-type] +* std[meta namespace] +* cpp23[meta cpp] + +```cpp +namespace std { + template + struct reference_constructs_from_temporary; + + template + inline constexpr bool reference_constructs_from_temporary_v + = reference_constructs_from_temporary::value; +} +``` + +## 概要 +参照`T`が一時オブジェクト`U`を直接初期化(丸括弧による初期化)で束縛した時、その一時オブジェクトの寿命を延長するかを判定する。 + +[`tuple`](/reference/tuple/tuple.md)や[`pair`](/reference/utility/pair.md)のコンストラクタなど、`explicit`なコンストラクタ・変換関数におけるダングリング参照の生成を回避するために使用される。 + +なお、コピー初期化(代入形式による初期化)における文脈では[`reference_converts_from_temporary`](reference_converts_from_temporary.md)が使用される。 + + +## 要件 +`T`と`U`のどちらも、完全型、`const`/`volatile`修飾された(あるいはされていない)`void`、要素数不明の配列型であること。 + + +## 効果 +`VAL`を次のように定義する。 + +- `U`が参照型や関数型の場合、[`declval`](/reference/utility/declval.md)`()`と同じ型と値カテゴリを持つ式 +- `U`が参照型や関数型でない場合、型`U`である`pvalue`(ただし、`U`に`const`/`volatile`修飾があれば調整される) + +[`conjunction_v`](conjunction.md)`<`[`is_reference`](is_reference.md)`,` [`is_constructible`](is_constructible.md)`>`が`true`かつ、`T t(VAL)`において`t`が一時オブジェクトの寿命を延長する場合に[`true_type`](true_type.md)から派生し、そうでなければ[`false_type`](false_type.md)から派生する。 + + +## 備考 +多くのメタ関数は`pvalue`と`xvalue`を区別しないが、このメタ関数は区別する。例えば、右辺値参照に「返り値の型が右辺値参照である関数」の返り値を束縛することを考える。(再現コードは、説明の最後に付す) + +この事自体は即座に不適格とはならない。しかし、その関数が実際には`pvalue`を返しているとすれば、その`pvalue`は返り値の時点で右辺値参照に束縛されるため、それを右辺値参照に束縛したとしても寿命は延長されることはない。そのため、最終的にダングリング参照を生じることとなる。 + +このような場面においては、本メタ関数が`pvalue`と`xvalue`を、`pvalue`を`T`(参照なしの型)として、`xvalue`を`T&&`(右辺値参照である型、転送参照(Forwarding Reference) を意味しているわけではない)として区別すれば検出が可能となる。 + +```cpp example +#include + +struct S { + S() { std::cout << "S construct" << std::endl; } + ~S() { std::cout << "S destruct" << std::endl; } +}; + +S&& f() { return S{}; } + +int main() { + std::cout << "1" << std::endl; + + // f の返り値は s に束縛されて寿命が延長されたか? + // 実際にはこの宣言の1文が終了した際に f の返り値は破棄されている + S&& s(f()); + + std::cout << "2" << std::endl; +} + +``` + +### 出力 +``` +1 +S construct +S destruct +2 + +``` + +## 例 +```cpp example +#include + +struct A { + A() = default; + A(int) {} +}; + +struct B : A { + explicit B(int) {} +}; + +struct C { + operator struct A() { return A{}; } + explicit operator struct B() { return B{0}; } +}; + +int main() +{ + // OK: わかりやすく寿命が延長されるタイプ + static_assert(std::reference_constructs_from_temporary_v); + static_assert(std::reference_constructs_from_temporary_v); + static_assert(std::reference_constructs_from_temporary_v); + static_assert(std::reference_constructs_from_temporary_v); + + // OK: 変換されて rvalue になってから束縛されて寿命が延長されるタイプ + static_assert(std::reference_constructs_from_temporary_v); + static_assert(std::reference_constructs_from_temporary_v); + static_assert(std::reference_constructs_from_temporary_v); + + // OK: explicit ではないので変換されて rvalue になってから束縛されて寿命が延長されるタイプ + static_assert(std::reference_constructs_from_temporary_v); + static_assert(std::reference_constructs_from_temporary_v); + static_assert(std::reference_constructs_from_temporary_v); + static_assert(std::reference_constructs_from_temporary_v); + + + // NG: const ではない左辺値参照は寿命を延長しないんですタイプ + // 1つ目3つ目はそもそも参照そのものが構築出来ない + static_assert(false == std::reference_constructs_from_temporary_v); + static_assert(false == std::reference_constructs_from_temporary_v); + static_assert(false == std::reference_constructs_from_temporary_v); + + // NG: 構築できないパターンと右辺値参照は区別するパターン + static_assert(false == std::reference_constructs_from_temporary_v); + static_assert(false == std::reference_constructs_from_temporary_v); + + // NG: explicit なので変換出来ずに詰むパターン + static_assert(false == std::reference_constructs_from_temporary_v); + static_assert(false == std::reference_constructs_from_temporary_v); + static_assert(false == std::reference_constructs_from_temporary_v); + static_assert(false == std::reference_constructs_from_temporary_v); +} + +``` +* std::reference_constructs_from_temporary[color ff0000] + + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ??? +- [GCC](/implementation.md#gcc): ??? +- [ICC](/implementation.md#icc): ??? +- [Visual C++](/implementation.md#visual_cpp): ??? + + +## 関連項目 +- [`reference_converts_from_temporary`](reference_converts_from_temporary.md) + + +## 参照 +- [P2252R2 A type trait to detect reference binding to temporary](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2255r2.html) diff --git a/reference/type_traits/reference_converts_from_temporary.md b/reference/type_traits/reference_converts_from_temporary.md new file mode 100644 index 0000000000..0cff142fc5 --- /dev/null +++ b/reference/type_traits/reference_converts_from_temporary.md @@ -0,0 +1,152 @@ +# reference_converts_from_temporary +* type_traits[meta header] +* class template[meta id-type] +* std[meta namespace] +* cpp23[meta cpp] + +```cpp +namespace std { + template + struct reference_converts_from_temporary; +} +``` + +## 概要 +参照`T`が一時オブジェクト`U`をコピー初期化(代入形式による初期化)で束縛した時、その一時オブジェクトの寿命を延長するかを判定する。 + +[*INVOKE*](/reference/concepts/Invoke.md)``など、暗黙的な型変換のみが考慮される文脈におけるダングリング参照の生成を回避するために使用される。 + +なお、直接初期化(丸括弧による初期化)における文脈では[`reference_constructs_from_temporary`](reference_constructs_from_temporary.md)が使用される。 + + +## 要件 +`T`と`U`のどちらも、完全型、`const`/`volatile`修飾された(あるいはされていない)`void`、要素数不明の配列型であること。 + + +## 効果 +`VAL`を次のように定義する。 + +- `U`が参照型や関数型の場合、[`declval`](/reference/utility/declval.md)`()`と同じ型と値カテゴリを持つ式 +- `U`が参照型や関数型でない場合、型`U`である`pvalue`(ただし、`U`に`const`/`volatile`修飾があれば調整される) + +[`conjunction_v`](conjunction.md)`<`[`is_reference`](is_reference.md)`,` [`is_convertible`](is_convertible.md)`>`が`true`かつ、`T t(VAL)`において`t`が一時オブジェクトの寿命を延長する場合に[`true_type`](true_type.md)から派生し、そうでなければ[`false_type`](false_type.md)から派生する。 + + +## 備考 +多くのメタ関数は`pvalue`と`xvalue`を区別しないが、このメタ関数は区別する。例えば、右辺値参照に「返り値の型が右辺値参照である関数」の返り値を束縛することを考える。(再現コードは、説明の最後に付す) + +この事自体は即座に不適格とはならない。しかし、その関数が実際には`pvalue`を返しているとすれば、その`pvalue`は返り値の時点で右辺値参照に束縛されるため、それを右辺値参照に束縛したとしても寿命は延長されることはない。そのため、最終的にダングリング参照を生じることとなる。 + +このような場面においては、本メタ関数が`pvalue`と`xvalue`を、`pvalue`を`T`(参照なしの型)として、`xvalue`を`T&&`(右辺値参照である型、転送参照(Forwarding Reference) を意味しているわけではない)として区別すれば検出が可能となる。 + +```cpp example +#include + +struct S { + S() { std::cout << "S construct" << std::endl; } + ~S() { std::cout << "S destruct" << std::endl; } +}; + +S&& f() { return S{}; } + +int main() { + std::cout << "1" << std::endl; + + // f の返り値は s に束縛されて寿命が延長されたか? + // 実際にはこの宣言の1文が終了した際に f の返り値は破棄されている + S&& s = f(); + + std::cout << "2" << std::endl; +} + +``` + +### 出力 +``` +1 +S construct +S destruct +2 + +``` + + +## 例 +```cpp example +#include + +struct A { + A() = default; + A(int) {} +}; + +struct B : A { + explicit B(int) {} +}; + +struct C { + operator struct A() { return A{}; } + explicit operator struct B() { return B{0}; } +}; + +int main() +{ + // OK: わかりやすく寿命が延長されるタイプ + static_assert(std::reference_converts_from_temporary_v); + static_assert(std::reference_converts_from_temporary_v); + static_assert(std::reference_converts_from_temporary_v); + static_assert(std::reference_converts_from_temporary_v); + + // OK: 変換されて rvalue になってから束縛されて寿命が延長されるタイプ + static_assert(std::reference_converts_from_temporary_v); + static_assert(std::reference_converts_from_temporary_v); + static_assert(std::reference_converts_from_temporary_v); + + // OK: explicit ではないので変換されて rvalue になってから束縛されて寿命が延長されるタイプ + static_assert(std::reference_converts_from_temporary_v); + static_assert(std::reference_converts_from_temporary_v); + static_assert(std::reference_converts_from_temporary_v); + static_assert(std::reference_converts_from_temporary_v); + + + // NG: const ではない左辺値参照は寿命を延長しないんですタイプ + // 1つ目3つ目はそもそも参照そのものが構築出来ない + static_assert(false == std::reference_converts_from_temporary_v); + static_assert(false == std::reference_converts_from_temporary_v); + static_assert(false == std::reference_converts_from_temporary_v); + + // NG: 構築できないパターンと右辺値参照は区別するパターン + static_assert(false == std::reference_converts_from_temporary_v); + static_assert(false == std::reference_converts_from_temporary_v); + + // NG: explicit なので変換出来ずに詰むパターン + static_assert(false == std::reference_converts_from_temporary_v); + static_assert(false == std::reference_converts_from_temporary_v); + static_assert(false == std::reference_converts_from_temporary_v); + static_assert(false == std::reference_converts_from_temporary_v); +} + +``` +* std::reference_converts_from_temporary[color ff0000] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ??? +- [GCC](/implementation.md#gcc): ??? +- [ICC](/implementation.md#icc): ??? +- [Visual C++](/implementation.md#visual_cpp): ??? + + +## 関連項目 +- [`reference_constructs_from_temporary`](reference_constructs_from_temporary.md) + + +## 参照 +- [P2252R2 A type trait to detect reference binding to temporary](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2255r2.html) diff --git a/reference/utility/pair.md b/reference/utility/pair.md index 23ca915545..5963f91612 100644 --- a/reference/utility/pair.md +++ b/reference/utility/pair.md @@ -87,6 +87,14 @@ namespace std { | [`(deduction_guide)`](pair/op_deduction_guide.md) | クラステンプレートの推論補助 | C++17 | +## 特殊化 + +| 名前 | 説明 | 対応バージョン | +|------------------------------------------------------------|--------------------------------------------------------|-----------| +| [`common_type`](pair/common_type.md) | 異なる[`pair`](pair.md)間の共通型を取得できるようにする特殊化 | C++23 | +| [`basic_common_reference`](pair/basic_common_reference.md) | 異なる[`pair`](pair.md)間の共通の参照型を取得出来るようにする特殊化 | C++23 | + + ## 例 ### 基本的な使い方 (C++03) ```cpp example @@ -143,6 +151,110 @@ hello ``` +### プロキシ参照としての使い方(C++23) +C++23 で[`zip_view`](/reference/ranges/zip_view.md.nolink)などが追加されたことに伴い、どちらの要素も[プロキシ参照](/reference/iterator/indirectly_writable.md)であるような`pair`は[プロキシ参照](/reference/iterator/indirectly_writable.md)として使用することが出来るようになった。 + +```cpp example +#include +#include +#include +#include + +struct A +{ + A(int i, double d) + : i(i) + , d(d) + {} + + std::pair f() + { + // this が A* なので + // i: int + // d: double + // ということと同じ + return {i, d}; + } + + std::pair f() const + { + // this が const A* なので + // i: const int + // d: const double + // ということと同じ + return {i, d}; + } + +private: + int i; + double d; +}; + +int main() +{ + // プロキシ参照である pair の性質 + { + A a{0, 0.0}; + + // std::pair + /***/ auto /***/ proxy = a.f(); + + // const std::pair + const auto const_proxy = a.f(); + + // std::pair + /***/ auto /***/ proxy_to_const = std::as_const(a).f(); + + // const std::pair + const auto const_proxy_to_const = std::as_const(a).f(); + + // OK(各要素が指すオブジェクトの値について、代入操作がなされる) + proxy = a.f(); + const_proxy = a.f(); + + // NG(各要素が指すオブジェクトを変更できない!) + // proxy_to_const = a.f(); + // const_proxy_to_const = a.f(); + } + + // 使い方 + { + auto print = [](std::string_view prefix, A& a) { + + // 構造化束縛で分解 + // i: int& + // d: double& + auto [i, d] = a.f(); + + std::cout << std::format("{}: i={}, d={}\n", prefix, i, d); + }; + + A a{0, 0.0}, b{1, 1.0}; + + print("before a", a); + print("before b", b); + + // プロキシ参照として使える pair 同士の swap 操作で + // 問題なく各要素が指す先のオブジェクトについて swap 操作が行える + std::ranges::swap(a.f(), b.f()); + + print("after a", a); + print("after b", b); + } +} + +``` + +#### 出力 +``` +before a: i=0, d=0 +before b: i=1, d=1 +after a: i=1, d=1 +after b: i=0, d=0 + +``` + + ## 関連項目 - [`std::tuple`](/reference/tuple/tuple.md) - [C++17 構造化束縛](/lang/cpp17/structured_bindings.md) @@ -150,4 +262,4 @@ hello ## 参照 - [タプル - Wikipedia](https://ja.wikipedia.org/wiki/%E3%82%BF%E3%83%97%E3%83%AB) - +- [P2321R2 zip](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2321r2.html) diff --git a/reference/utility/pair/basic_common_reference.md b/reference/utility/pair/basic_common_reference.md new file mode 100644 index 0000000000..068a924d88 --- /dev/null +++ b/reference/utility/pair/basic_common_reference.md @@ -0,0 +1,49 @@ +# basic_common_reference +* utility[meta header] +* std[meta namespace] +* class template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template class TQual, template class UQual> + struct basic_common_reference, pair, TQual, UQual> { + using type = pair, UQual>, + common_reference_t, UQual>>; + }; +} +``` +* basic_common_reference[link /reference/type_traits/basic_common_reference.md] + +## 概要 +[`pair`](../pair.md)について、[`common_reference`](/reference/type_traits/common_reference.md)で共通の参照型を取得できるようにアダプトする[`basic_common_reference`](/reference/type_traits/common_reference.md)の特殊化である。 + +ユーザーが直接この特殊化を利用する必要はない。[`common_reference`](/reference/type_traits/common_reference.md)を使用すること。 + + +## 効果 +[`pair`](../pair.md)`<`[`common_reference_t`](/reference/type_traits/common_reference.md)`, UQual>,` [`common_reference_t`](/reference/type_traits/common_reference.md)`, UQual>>`によって得られた型をメンバ型`type`として定義する。 + + +## 要件 +- [`pair`](../pair.md)`<`[`common_reference_t`](/reference/type_traits/common_reference.md)`, UQual>,` [`common_reference_t`](/reference/type_traits/common_reference.md)`, UQual>>`が型を表すこと。 + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ??? +- [GCC](/implementation.md#gcc): ??? +- [ICC](/implementation.md#icc): ??? +- [Visual C++](/implementation.md#visual_cpp): ??? + + +## 関連項目 +- [`basic_common_reference`](/reference/type_traits/basic_common_reference.md) + + +## 参照 +- [P2321R2 `zip`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2321r2.html) diff --git a/reference/utility/pair/common_type.md b/reference/utility/pair/common_type.md new file mode 100644 index 0000000000..eb8656a05f --- /dev/null +++ b/reference/utility/pair/common_type.md @@ -0,0 +1,44 @@ +# common_type +* utility[meta header] +* std[meta namespace] +* class template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template + requires requires { typename pair, common_type_t>; } + struct common_type, pair> { + using type = pair, common_type_t>; + }; +} +``` +* common_type[link /reference/type_traits/common_type.md] +* tuple-like[link ../tuple-like.md] + +## 概要 +[`pair`](../pair.md)について、どちらからも変換可能な共通の型を取得できるようにする[`common_type`](/reference/type_traits/common_type.md)の特殊化である。 + + +## 効果 +[`pair`](../pair.md)`<`[`common_type_t`](/reference/type_traits/common_type.md)`,` [`common_type_t`](/reference/type_traits/common_type.md)`>`によって得られた型をメンバ型`type`として定義する。 + + +## 備考 +- [`pair`](../pair.md)`<`[`common_type_t`](/reference/type_traits/common_type.md)`,` [`common_type_t`](/reference/type_traits/common_type.md)`>`が型を表すこと。 + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.6.1 +- [Visual C++](/implementation.md#visual_cpp): 2012 + +## 関連項目 +- [common_type](/reference/type_traits/common_type.md) + +## 参照 +- [P2321R2 `zip`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2321r2.html) diff --git a/reference/utility/pair/op_assign.md b/reference/utility/pair/op_assign.md index cfb99733f5..b7ec890c1e 100644 --- a/reference/utility/pair/op_assign.md +++ b/reference/utility/pair/op_assign.md @@ -5,40 +5,80 @@ * function[meta id-type] ```cpp -pair& operator=(const pair& p); // (1) C++03 -constexpr pair& operator=(const pair& p); // (1) C++20 +pair& operator=(const pair& p); // (1) C++03 +constexpr pair& operator=(const pair& p); // (1) C++20 + +constexpr const pair& operator=(const pair& p) const; // (2) C++23 template -pair& operator=(const pair& p); // (2) C++03 + pair& operator=(const pair& p); // (3) C++03 template -constexpr pair& operator=(const pair& p); // (2) C++20 + constexpr pair& operator=(const pair& p); // (3) C++20 + +template +constexpr const pair& operator=(const pair& p) const; // (4) C++23 + +pair& operator=(pair&& p) noexcept(see below); // (5) C++11 +constexpr pair& operator=(pair&& p) noexcept(see below); // (5) C++20 -pair& operator=(pair&& p) noexcept(see below); // (3) C++11 -constexpr pair& operator=(pair&& p) noexcept(see below); // (3) C++20 +constexpr const pair& operator=(pair&& p) const; // (6) C++23 template -pair& operator=(pair&& p); // (4) C++11 + pair& operator=(pair&& p); // (7) C++11 template -constexpr pair& operator=(pair&& p); // (4) C++20 + constexpr pair& operator=(pair&& p); // (7) C++20 + +template + constexpr const pair& operator=(pair&& p) const; // (8) C++23 + +template + constexpr pair& operator=(P&& p); // (9) C++23 +template + constexpr const pair& operator=(P&& p) const; // (10) C++23 ``` +* see below[italic] +* pair-like[link /reference/tuple/pair-like.md] ## 概要 -- (1) : 同じ型の`pair`をコピー代入する -- (2) : 変換可能な`pair`をコピー代入する -- (3) : 同じ型の`pair`をムーブ代入する -- (4) : 変換可能な`pair`をムーブ代入する +- (1) : 同じ型の[`pair`](../pair.md)をコピー代入する +- (2) : (1) のプロキシ参照版 +- (3) : 変換可能な[`pair`](../pair.md)をコピー代入する +- (4) : (3) のプロキシ参照版 +- (5) : 同じ型の[`pair`](../pair.md)をムーブ代入する +- (6) : (5) のプロキシ参照版 +- (7) : 変換可能な[`pair`](../pair.md)をムーブ代入する +- (8) : (6) のプロキシ参照版 +- (9) : [`pair-like`](/reference/tuple/pair-like.md)なオブジェクトを代入 +- (10) : (9) のプロキシ参照版 + +[プロキシ参照](/reference/iterator/indirectly_writable.md)版とは、[プロキシ参照](/reference/iterator/indirectly_writable.md)である(要素がどちらも[プロキシ参照](/reference/iterator/indirectly_writable.md)である)[`pair`](../pair.md)が持つ各要素について、その要素の参照先へ、他の[`pair`](../pair.md)又は[`pair-like`](/reference/tuple/pair-like.md)なオブジェクトの対応する値を代入する動作を行う版である。 ## 要件 -- (1) : [`is_copy_assignable`](/reference/type_traits/is_copy_assignable.md)`::value &&` [`is_copy_assignable`](/reference/type_traits/is_copy_assignable.md)`::value`であること -- (2) : [`is_assignable`](/reference/type_traits/is_assignable.md)`::value &&` [`is_assignable`](/reference/type_traits/is_assignable.md)`::value`であること -- (3) : [`is_move_assignable`](/reference/type_traits/is_move_assignable.md)`::value &&` [`is_move_assignable`](/reference/type_traits/is_move_assignable.md)`::value`であること -- (4) : [`is_assignable`](/reference/type_traits/is_assignable.md)`::value &&` [`is_assignable`](/reference/type_traits/is_assignable.md)`::value`であること +- (1) : [`is_copy_assignable`](/reference/type_traits/is_copy_assignable.md)`::value &&` [`is_copy_assignable`](/reference/type_traits/is_copy_assignable.md)`::value`であること +- (2) : C++23 : [`is_copy_assignable_v`](/reference/type_traits/is_copy_assignable.md)` &&` [`is_copy_assignable_v`](/reference/type_traits/is_copy_assignable.md)``であること +- (3) : [`is_assignable`](/reference/type_traits/is_assignable.md)`::value &&` [`is_assignable`](/reference/type_traits/is_assignable.md)`::value`であること +- (4) : C++23 : [`is_assignable_v`](/reference/type_traits/is_assignable.md)` &&` [`is_assignable_v`](/reference/type_traits/is_assignable.md)``であること +- (5) : [`is_move_assignable`](/reference/type_traits/is_move_assignable.md)`::value &&` [`is_move_assignable`](/reference/type_traits/is_move_assignable.md)`::value`であること +- (6) : C++23 : [`is_assignable_v`](/reference/type_traits/is_assignable.md)` &&` [`is_assignable_v`](/reference/type_traits/is_assignable.md)``であること +- (7) : [`is_assignable`](/reference/type_traits/is_assignable.md)`::value &&` [`is_assignable`](/reference/type_traits/is_assignable.md)`::value`であること +- (8) : C++23 : [`is_assignable_v`](/reference/type_traits/is_assignable.md)` &&` [`is_assignable_v`](/reference/type_traits/is_assignable.md)``であること +- (9) : 次を全て満たすこと + - C++23 : [`different-from`](/reference/ranges/different-from.md)`` + - C++23 : [`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`

`が[`ranges::subrange`](/reference/ranges/subrange.md)の特殊化でないこと + - C++23 : [`is_­assignable_­v`](/reference/type_traits/is_assignable.md)`(`[`std​::​forward`](/reference/utility/forward.md)`

(p)))>` + - C++23 : [`is_­assignable_­v`](/reference/type_traits/is_assignable.md)`(`[`std​::​forward`](/reference/utility/forward.md)`

(p)))>` +- (10) : 次を全て満たすこと + - C++23 : [`different-from`](/reference/ranges/different-from.md)`` + - C++23 : [`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`

`が[`ranges::subrange`](/reference/ranges/subrange.md)の特殊化でないこと + - C++23 : [`is_­assignable_­v`](/reference/type_traits/is_assignable.md)`(`[`std​::​forward`](/reference/utility/forward.md)`

(p)))>` + - C++23 : [`is_­assignable_­v`](/reference/type_traits/is_assignable.md)`(`[`std​::​forward`](/reference/utility/forward.md)`

(p)))>` ## 効果 -- (1), (2) : `p.first`を`this->first`に、`p.second`を`this->second`にコピー代入する -- (3), (4) : `p.first`を`this->first`に、`p.second`を`this->second`にムーブ代入する +- (1), (2), (3), (4) : `p.first`を`this->first`に、`p.second`を`this->second`にコピー代入する +- (5), (6), (7), (8) : `p.first`を`this->first`に、`p.second`を`this->second`にムーブ代入する +- (9), (10) : `get<0>(p)`を`p.first`に、`get<1>(p)`を`p.second`に代入する ## 戻り値 @@ -46,7 +86,7 @@ constexpr pair& operator=(pair&& p); // (4) C++20 ## 例外 -- (3) : `is_nothrow_move_assignable::value && is_nothrow_move_assignable::value`である場合、この関数は例外を決して投げない +- (5) : [`is_nothrow_move_assignable`](/reference/type_traits/is_nothrow_move_assignable.md)`::value &&` [`is_nothrow_move_assignable`](/reference/type_traits/is_nothrow_move_assignable.md)`::value`である場合、この関数は例外を決して投げない ## 例 @@ -108,14 +148,14 @@ p4 : (1,abc) ## バージョン ### 言語 -- C++11 : (3), (4) +- C++11 : (5), (7) ### 処理系 - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): 4.6.1 - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 - - (1), (2)はそれより前から実装されている。 + - (1), (3)はそれより前から実装されている。 ## 参照 - [P1032R1 Misc constexpr bits](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1032r1.html) diff --git a/reference/utility/pair/op_constructor.md b/reference/utility/pair/op_constructor.md index 66369277a8..ad0ad1de44 100644 --- a/reference/utility/pair/op_constructor.md +++ b/reference/utility/pair/op_constructor.md @@ -11,7 +11,6 @@ EXPLICIT constexpr pair(); // (1) C++17 explicit(see below) constexpr pair(); // (1) C++20 pair(const pair&) = default; // (2) - pair(pair&&) = default; // (3) C++11 pair(const T1& x, const T2& y); // (4) C++03 @@ -30,80 +29,105 @@ explicit(see below) constexpr pair(U&& x, V&& y); // (5) C++20 template explicit(see below) constexpr pair(U&& x, V&& y); // (5) C++23 +template +explicit(see below) constexpr pair(pair& p); // (6) C++23 + template -pair(const pair& p); // (6) C++03 +pair(const pair& p); // (7) C++03 template -constexpr pair(const pair& p); // (6) C++14 +constexpr pair(const pair& p); // (7) C++14 template -EXPLICIT constexpr pair(const pair& p); // (6) C++17 +EXPLICIT constexpr pair(const pair& p); // (7) C++17 template -explicit(see below) constexpr pair(const pair& p); // (6) C++20 +explicit(see below) constexpr pair(const pair& p); // (7) C++20 template -pair(pair&& p); // (7) C++11 +pair(pair&& p); // (8) C++11 template -constexpr pair(pair&& p); // (7) C++14 +constexpr pair(pair&& p); // (8) C++14 template -EXPLICIT constexpr pair(pair&& p); // (7) C++17 +EXPLICIT constexpr pair(pair&& p); // (8) C++17 template -explicit(see below) constexpr pair(pair&& p); // (7) C++20 +explicit(see below) constexpr pair(pair&& p); // (8) C++20 + +template +explicit(see below) constexpr pair(const pair&& p); // (9) C++23 + +template +explicit(see below) constexpr pair(P&& p); // (10) C++23 template pair(piecewise_construct_t, tuple first_args, - tuple second_args); // (8) C++11 + tuple second_args); // (11) C++11 template constexpr pair(piecewise_construct_t, tuple first_args, - tuple second_args); // (8) C++20 + tuple second_args); // (11) C++20 ``` * EXPLICIT[italic] * piecewise_construct_t[link /reference/utility/piecewise_construct_t.md] * tuple[link /reference/tuple/tuple.md] +* pair-like[link /reference/tuple/tuple-like.md] * see below[italic] ## 概要 -`pair`オブジェクトを構築する。 +[`pair`](../pair.md)オブジェクトを構築する。 -- (1) : `first`と`second`を初期化して構築 +- (1) : デフォルトコンストラクタ(`first`と`second`を初期化して構築) - (2) : コピーコンストラクタ - (3) : ムーブコンストラクタ -- (4) : `first`と`second`の初期値を受け取って構築 -- (5) : `first`と`second`に変換可能な型の値を受け取ってムーブ構築 -- (6) : `first`と`second`に変換可能な`pair`型の値を受け取って構築 -- (7) : `first`と`second`に変換可能なpair型の右辺値を受け取って構築 -- (8) : `first`と`second`のコンストラクタ引数を受け取り、`first_args`と`second_args`それぞれの要素から`first`と`second`をムーブ構築 +- (4) : `first`と`second`の変換可能な型の値から構築 +- (5) : `first`と`second`に変換可能な型の値からムーブ構築 +- (6) : 変換可能な他の[`pair`](../pair.md)オブジェクトから構築 +- (7) : 変換可能な他の[`pair`](../pair.md)オブジェクトから構築 +- (8) : 変換可能な他の[`pair`](../pair.md)オブジェクトからムーブ構築 +- (9) : 変換可能な他の[`pair`](../pair.md)オブジェクトから構築 +- (10) : [`pair-like`](/reference/tuple/tuple-like.md)なオブジェクトから構築 +- (11) : `first`と`second`のコンストラクタ引数を受け取り、`first_args`と`second_args`それぞれの要素から`first`と`second`をムーブ構築 ## テンプレートパラメータ制約 - (1) : - - `first_type`と`second_type`が[`is_default_constructible`](/reference/type_traits/is_default_constructible.md)`::value == true`であること + - `first_type`と`second_type`がどちらも[`is_default_constructible`](/reference/type_traits/is_default_constructible.md)`::value == true`であること - (4) : - - `first_type`と`second_type`が[`is_copy_constructible`](/reference/type_traits/is_copy_constructible.md)`::value == true`であること + - `first_type`と`second_type`がどちらも[`is_copy_constructible`](/reference/type_traits/is_copy_constructible.md)`::value == true`であること - (5) : - [`is_constructible`](/reference/type_traits/is_constructible.md)`::value &&` [`is_constructible`](/reference/type_traits/is_constructible.md)`::value`であること - C++14まで : `U`が`first_type`に暗黙変換可能でない場合、もしくは`V`が`second_type`に暗黙変換可能でない場合、この関数はオーバーロード解決から除外される -- (6) : +- (6)-(10) : + - C++23 : `FWD(u)`を`static_cast(u)`と定義して、[`is_constructible_v`](/reference/type_traits/is_constructible.md)`(FWD(p)))> &&` [`is_constructible_v`](/reference/type_traits/is_constructible.md)`(FWD(p)))>`であること +- (7) : - [`is_constructible`](/reference/type_traits/is_constructible.md)`::value &&` [`is_constructible`](/reference/type_traits/is_constructible.md)`::value`であること - C++14まで : `const U&`が`first_type`に暗黙変換可能でない場合、もしくは`const V&`が`second_type`に暗黙変換可能でない場合、この関数はオーバーロード解決から除外される -- (7) : + - C++23 : (6)-(10) での定義参照 +- (8) : - [`is_constructible`](/reference/type_traits/is_constructible.md)`::value &&` [`is_constructible`](/reference/type_traits/is_constructible.md)`::value`であること - C++14まで : `U`が`first_type`に暗黙変換可能でない場合、もしくは`V`が`second_type`に暗黙変換可能でない場合、この関数はオーバーロード解決から除外される -- (8) : - - `is_constructible::value && is_constructible::value`であること + - C++23 : (6)-(10) での定義参照 +- (11) : + - [`is_constructible`](/reference/type_traits/is_constructible.md)`::value &&` [`is_constructible`](/reference/type_traits/is_constructible.md)`::value`であること ## 備考 - (1) : - - C++17 : `first_type`と`second_type`のどちらかが非暗黙にデフォルト構築できる場合、この関数は`explicit`となる + - C++17 : `first_type`と`second_type`のどちらかが非暗黙にデフォルト構築できない場合、`explicit`指定される - (4) : - - C++17 : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` || !`[`is_convertible_v`](/reference/type_traits/is_convertible.md)``である場合、この関数は`explicit`となる + - C++17 : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` || !`[`is_convertible_v`](/reference/type_traits/is_convertible.md)``である場合、`explicit`指定される - (5) : - - C++17 : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` || !`[`is_convertible_v`](/reference/type_traits/is_convertible.md)``である場合、この関数は`explicit`になる -- (6) : - - C++17 : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` || !`[`is_convertible_v`](/reference/type_traits/is_convertible.md)``である場合、この関数は`explicit`となる + - C++17 : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` || !`[`is_convertible_v`](/reference/type_traits/is_convertible.md)``である場合、`explicit`指定される + - C++23 : [`reference_­constructs_­from_­temporary_­v`](/reference/type_traits/reference_constructs_from_temporary.md)` ||` [`reference_­constructs_­from_­temporary_­v`](/reference/type_traits/reference_constructs_from_temporary.md)``である場合、このコンストラクタは削除定義される +- (6)-(10) : + - `FWD(u)`を`static_cast(u)`と定義して + - C++23 : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`(FWD(p))), T1> || !`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`(FWD(p))), T2>`である場合、`explicit`指定される + - C++23 : [`reference_­constructs_­from_­temporary_­v`](/reference/type_traits/reference_constructs_from_temporary.md)`(FWD(p)))> ||` [`reference_­constructs_­from_­temporary_­v`](/reference/type_traits/reference_constructs_from_temporary.md)`(FWD(p)))>`である場合、このコンストラクタは削除定義される - (7) : - - C++17 : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` || !`[`is_convertible_v`](/reference/type_traits/is_convertible.md)``である場合、この関数は`explicit`となる + - C++17 : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` || !`[`is_convertible_v`](/reference/type_traits/is_convertible.md)``である場合、`explicit`指定される + - C++23 : (6)-(10) での定義参照 +- (8) : + - C++17 : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` || !`[`is_convertible_v`](/reference/type_traits/is_convertible.md)``である場合、`explicit`指定される + - C++23 : (6)-(10) での定義参照 + - C++17では、コンストラクタの各オーバーロードが条件付きで`explicit`となるよう規定された。これは、以下のような初期化子リストを使用したC++17での初期化が不適格になっていたため、適格になるようにするための変更である: ```cpp std::tuple pixel_coordinates() @@ -117,6 +141,13 @@ constexpr pair(piecewise_construct_t, - この変更はC++17に対するものであるが、コンパイラが早期に対応していたため、一部処理系ではC++14の段階から適格となっていた +- C++23 では、ダングリング参照の作成が簡単にできていた状態を改善するべく、[`reference_constructs_from_temporary`](/reference/type_traits/reference_constructs_from_temporary.md)が追加され、ダングリング参照が作成される場合には不適格とするようになった : + ```cpp + // コンストラクタ引数で std::string が構築され + // その一時オブジェクトが束縛されるため、ダングリング参照となっていた + // C++23 からは不適格であり、コンパイルエラー等で未然に防がれる + std::pair x("hello", "world"); + ``` ## 例 ```cpp example @@ -177,13 +208,13 @@ int main() print("p3", p3); } - // (4) firstとsecondの初期値を受け取って構築 + // (4) firstとsecondの初期値から構築 { std::pair p4(1, std::string("abc")); print("p4", p4); } - // (5) firstとsecondの右辺値を受け取ってムーブ構築 + // (5) firstとsecondの右辺値からムーブ構築 { int x = 1; std::string s = "abc"; @@ -191,21 +222,21 @@ int main() print("p5", p5); } - // (6) 変換可能なpairから構築 + // (7) 変換可能なpairから構築 { std::pair p(1, "abc"); std::pair p6 = p; print("p6", p6); } - // (7) 変換可能なpairからムーブ構築 + // (8) 変換可能なpairからムーブ構築 { std::pair p(1, "abc"); std::pair p7 = std::move(p); print("p7", p7); } - // (8) first_typeとsecond_typeのコンストラクタ引数を受け取って構築 + // (11) first_typeとsecond_typeのコンストラクタ引数から構築 { std::pair p8(std::piecewise_construct, std::make_tuple(1, 2, 3), @@ -241,7 +272,7 @@ p8 : (X(1 2 3),Y(4 5)) - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 - C++03で規定されていたものは、2010より前のバージョンから実装されている。 - - 2010までは、(8) `std::piecewise_construct`版が実装されていない。 + - 2010までは、(11) `std::piecewise_construct`版が実装されていない。 - 2013までは、デフォルトコンストラクタに`constexpr`が付与されていない。 @@ -251,7 +282,7 @@ p8 : (X(1 2 3),Y(4 5)) ## 参照 - [N2345 Placement Insert for Containers (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2345.pdf) - - (8)の最初の提案 + - (11)の最初の提案 - [N3471 Constexpr Library Additions: utilities, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3471.html) - [N4387 Improving Pair and Tuple (Revision 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4387) - C++17での条件付き`explicit`の導入 @@ -260,3 +291,9 @@ p8 : (X(1 2 3),Y(4 5)) - C++20での`explicit(bool)`構文への対応 - [P1951R1 Default Arguments for `pair`'s Forwarding Constructor](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1951r1.html) - C++23での`{}`完全転送への対応 +- [P2165R4 Compatibility between `tuple`, `pair` and *tuple-like* objects](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2165r4.pdf) + - [`pair-like`](/reference/tuple/tuple-like.md)なオブジェクトからの構築 +- [P2255R2 A type trait to detect reference binding to temporary](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2255r2.html) + - 参照型を要素に持つ場合にダングリング参照が容易に作成できていたのを不適格にする +- [P2321R2 `zip`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2321r2.html#pair) + - すべての要素が[プロキシ参照](/reference/iterator/indirectly_writable.md)の場合、[プロキシ参照](/reference/iterator/indirectly_writable.md)として使用できるようにする diff --git a/reference/vector/vector.md b/reference/vector/vector.md index d29357f077..058a582118 100644 --- a/reference/vector/vector.md +++ b/reference/vector/vector.md @@ -174,18 +174,22 @@ namespace std { この特殊化はメモリ領域を最小化するために提供されていて、各要素は1bitの領域のみを必要とする。 -`vector::reference`は`bool`への参照ではなく、領域内の1bitを指す型であり、以下のようなインタフェースである (`constexpr`はC++20から付加される)。 +`vector::reference`は`bool`への参照ではなく、領域内の1bitを指す型であり、以下のようなインタフェースである (`noexcept`はC++11から、`constexpr`はC++20から付加される)。 + +C++23には`vector::iterator`が出力イテレータとなるために、`vector::reference`が`const`修飾を持つ`bool`からの代入演算子が追加され、[`indirectly_writable::iterator,` `bool>`](/reference/iterator/indirectly_writable.md)がモデルを満たすようになった。 ```cpp class vector::reference { friend class vector; - constexpr reference(); // コンストラクタは非公開 + constexpr reference(); // コンストラクタは非公開 public: + constexpr reference(const reference&) = default; // コピーコンストラクタ(C++17) constexpr ~reference(); - constexpr operator bool() const; // boolへの暗黙変換 - constexpr reference& operator=(const bool x); // boolからの代入 - constexpr reference& operator=(const reference& x); // vectorのビットからの代入 - constexpr void flip(); // ビットの反転 + constexpr operator bool() const noexcept; // boolへの暗黙変換 + constexpr reference& operator=(const bool x) noexcept; // boolからの代入 + constexpr reference& operator=(const reference& x) noexcept; // vectorのビットからの代入 + constexpr const reference& operator=(bool x) const noexcept; // *thisがconst時のboolからの代入(C++23) + constexpr void flip() noexcept; // ビットの反転 } ``` @@ -390,6 +394,7 @@ v[3] : 0 ``` `vector`の要素は参照するとプロキシオブジェクトのコピーが返ってくるため、RandomAccessIteratorの要件を満たさない。 +ただし、C++20以降のランダムアクセスイテレータの定義である[`random_access_iterator`](/reference/iterator/random_access_iterator.md)のモデルは満たす。 ### 定数式内でvectorを使用する (C++20) @@ -437,5 +442,4 @@ int main() - 可変長のビット配列の実装としては、Boost C++ Librariesの[`dynamic_bitset`](http://www.boost.org/doc/libs/release/libs/dynamic_bitset/dynamic_bitset.html)がある。 - [N2669 Thread-Safety in the Standard Library (Rev 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2669.htm) - [N4510 Minimal incomplete type support for standard containers, revision 4](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4510.html) -- [P2286R8 Formatting Ranges](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2286r8.html) - - C++23から、Range・コンテナ、`pair`、`tuple`のフォーマット出力、および文字・文字列のデバッグ指定 (`"?"`) が追加された + From d9d912ab5e77403cbdf5d93d51b2b66e887d4b8f Mon Sep 17 00:00:00 2001 From: tomolatoon Date: Wed, 1 Feb 2023 09:17:11 +0900 Subject: [PATCH 0135/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E3=81=AA=E3=81=A9=20-=20=E3=83=AA=E3=83=B3=E3=82=AF?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20-=20=E3=83=8F=E3=82=A4=E3=83=A9=E3=82=A4?= =?UTF-8?q?=E3=83=88=E4=BF=AE=E6=AD=A3=20-=20=E4=BD=95=E6=95=85=E3=81=8B?= =?UTF-8?q?=E6=B6=88=E3=81=97=E3=81=A6=E3=81=97=E3=81=BE=E3=81=A3=E3=81=9F?= =?UTF-8?q?=E3=82=82=E3=81=AE=E3=82=92=E5=BE=A9=E5=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/utility/pair/basic_common_reference.md | 2 ++ reference/utility/pair/common_type.md | 4 +++- reference/vector/vector.md | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/reference/utility/pair/basic_common_reference.md b/reference/utility/pair/basic_common_reference.md index 068a924d88..47a9a594ac 100644 --- a/reference/utility/pair/basic_common_reference.md +++ b/reference/utility/pair/basic_common_reference.md @@ -15,6 +15,8 @@ namespace std { } ``` * basic_common_reference[link /reference/type_traits/basic_common_reference.md] +* pair[link ../pair.md] +* common_reference_t[link /reference/type_traits/common_reference.md] ## 概要 [`pair`](../pair.md)について、[`common_reference`](/reference/type_traits/common_reference.md)で共通の参照型を取得できるようにアダプトする[`basic_common_reference`](/reference/type_traits/common_reference.md)の特殊化である。 diff --git a/reference/utility/pair/common_type.md b/reference/utility/pair/common_type.md index eb8656a05f..d71b1ec73b 100644 --- a/reference/utility/pair/common_type.md +++ b/reference/utility/pair/common_type.md @@ -14,7 +14,9 @@ namespace std { } ``` * common_type[link /reference/type_traits/common_type.md] -* tuple-like[link ../tuple-like.md] +* pair[link ../pair.md] +* common_type_t[link /reference/type_traits/common_type.md] +* tuple-like[link /reference/tuple/tuple-like.md] ## 概要 [`pair`](../pair.md)について、どちらからも変換可能な共通の型を取得できるようにする[`common_type`](/reference/type_traits/common_type.md)の特殊化である。 diff --git a/reference/vector/vector.md b/reference/vector/vector.md index 058a582118..725ca5847c 100644 --- a/reference/vector/vector.md +++ b/reference/vector/vector.md @@ -442,4 +442,5 @@ int main() - 可変長のビット配列の実装としては、Boost C++ Librariesの[`dynamic_bitset`](http://www.boost.org/doc/libs/release/libs/dynamic_bitset/dynamic_bitset.html)がある。 - [N2669 Thread-Safety in the Standard Library (Rev 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2669.htm) - [N4510 Minimal incomplete type support for standard containers, revision 4](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4510.html) - +- [P2286R8 Formatting Ranges](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2286r8.html) + - C++23から、Range・コンテナ、`pair`、`tuple`のフォーマット出力、および文字・文字列のデバッグ指定 (`"?"`) が追加された From 8cc4361ae1ba943d065a624d866ae3f526a48894 Mon Sep 17 00:00:00 2001 From: tomolatoon Date: Wed, 1 Feb 2023 09:56:41 +0900 Subject: [PATCH 0136/3948] =?UTF-8?q?=E3=82=BD=E3=83=95=E3=83=88=E3=83=8F?= =?UTF-8?q?=E3=82=A4=E3=83=95=E3=83=B3=E9=99=A4=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/concepts/Invoke.md | 2 +- reference/ranges/simple-view.md | 4 ++-- reference/tuple/make_from_tuple.md | 2 +- reference/tuple/pair-like.md | 2 +- .../tuple/tuple/basic_common_reference.md | 8 +++---- reference/tuple/tuple/common_type.md | 8 +++---- reference/tuple/tuple/op_assign.md | 18 +++++++-------- reference/tuple/tuple/op_compare_3way.md | 8 +++---- reference/tuple/tuple/op_constructor.md | 22 +++++++++---------- reference/tuple/tuple/op_equal.md | 2 +- reference/tuple/tuple_cat.md | 2 +- reference/type_traits/is_invocable_r.md | 6 ++--- reference/utility/pair/op_assign.md | 8 +++---- reference/utility/pair/op_constructor.md | 4 ++-- 14 files changed, 48 insertions(+), 48 deletions(-) diff --git a/reference/concepts/Invoke.md b/reference/concepts/Invoke.md index 682d748204..904dd091c5 100644 --- a/reference/concepts/Invoke.md +++ b/reference/concepts/Invoke.md @@ -63,7 +63,7 @@ C++における関数呼び出しという性質を抽象化しまとめた、 ## 要件(C++23差分) C++20 における 2. について、次の文言を項目の最後に追加する。この変更は、`R`が参照かつ*INVOKE*の実行結果が`R`に束縛されることで寿命が延長される場合にダングリング参照が作成されてしまう事例を検出するための要件である。 -- [`reference_­converts_­from_­temporary_­v`](/reference/type_traits/reference_converts_from_temporary.md)` == true`の場合、*INVOKE*`(f, t1, t2, …, tN)`は不適格。 +- [`reference_converts_from_temporary_v`](/reference/type_traits/reference_converts_from_temporary.md)` == true`の場合、*INVOKE*`(f, t1, t2, …, tN)`は不適格。 ## まとめ diff --git a/reference/ranges/simple-view.md b/reference/ranges/simple-view.md index 7b2c01bbde..d31987cb29 100644 --- a/reference/ranges/simple-view.md +++ b/reference/ranges/simple-view.md @@ -7,8 +7,8 @@ template concept simple-view = // 説明専用コンセプト view && range && - same_­as, iterator_t> && - same_­as, sentinel_t>; + same_as, iterator_t> && + same_as, sentinel_t>; ``` * same-as[link /reference/concepts/same_as.md] * view[link view.md] diff --git a/reference/tuple/make_from_tuple.md b/reference/tuple/make_from_tuple.md index e175fecd83..f4028bfcf4 100644 --- a/reference/tuple/make_from_tuple.md +++ b/reference/tuple/make_from_tuple.md @@ -26,7 +26,7 @@ namespace std { また、型`T`の初期化はそのコンストラクタで行われ集成体初期化は考慮されない。つまり、`Tuple`に含まれる型が空かただ一つの`T`でない場合、型`T`は集成体(aggregate)であってはならない(C++17のみ、C++20以降はok)。 更に、C++23以降は`make_from_tuple`の返り値が参照である場合でダングリング参照を生成しないために、`make_from_tuple`の内部で`T`が構築される際に、`Tuple`から取得されるオブジェクト(参照の初期化であるので、`Tuple`のサイズは1である必要がある)の寿命が延長されないことも要求され、これを満たさない場合はコンパイルエラーとなる。 -正確には、[`tuple_­size_­v`](tuple_size.md)`<`[`remove_­reference_­t`](/reference/type_traits/remove_reference.md)`> == 1`である場合、[`reference_­constructs_­from_­temporary_­v`](/reference/type_traits/reference_constructs_from_temporary.md)`(`[`declval`](/reference/utility/declval.md)`()))> == false`であること。 +正確には、[`tuple_size_v`](tuple_size.md)`<`[`remove_reference_t`](/reference/type_traits/remove_reference.md)`> == 1`である場合、[`reference_constructs_from_temporary_v`](/reference/type_traits/reference_constructs_from_temporary.md)`(`[`declval`](/reference/utility/declval.md)`()))> == false`であること。 ## 引数 - `t` -- [`tuple-like`](tuple-like.md)な型`Tuple`のオブジェクト diff --git a/reference/tuple/pair-like.md b/reference/tuple/pair-like.md index 7a15efbca0..3cf2baf921 100644 --- a/reference/tuple/pair-like.md +++ b/reference/tuple/pair-like.md @@ -11,7 +11,7 @@ namespace std { template concept pair-like = // 説明専用コンセプト !is_reference_v && requires(T t) { - typename tuple_size::type; // tuple_­size が完全型であることを明確にする + typename tuple_size::type; // tuple_size が完全型であることを明確にする requires derived_from, integral_constant>; typename tuple_element_t<0, remove_const_t>; typename tuple_element_t<1, remove_const_t>; diff --git a/reference/tuple/tuple/basic_common_reference.md b/reference/tuple/tuple/basic_common_reference.md index 637303d803..8d0fd167b3 100644 --- a/reference/tuple/tuple/basic_common_reference.md +++ b/reference/tuple/tuple/basic_common_reference.md @@ -21,16 +21,16 @@ template, UQual>...>`によって得られた型をメンバ型`type`として定義する。 +[`tuple`](../tuple.md)`<`[`common_reference_t`](/reference/type_traits/common_reference.md)`, UQual>...>`によって得られた型をメンバ型`type`として定義する。 ## 要件 - `TTuple`か`UTuple`のどちらかが[`tuple`](../tuple.md)の特殊化であること。 -- `TTuple`と`UTuple`のそれぞれについて、(次の`T`を置き換える形で)[`is_­same_­v`](/reference/type_traits/is_same.md)`>`であること。 +- `TTuple`と`UTuple`のそれぞれについて、(次の`T`を置き換える形で)[`is_same_v`](/reference/type_traits/is_same.md)`>`であること。 - 実質的には`TTuple`と`Utuple`について、参照型ではなく、最上位の`const`/`volatile`修飾も持っていないこと要求する。 - `TTuple`と`UTuple`の要素数が一致していること。 - - 具体的には、[`tuple_­size_­v`](../tuple_size.md)` ==` [`tuple_­size_­v`](../tuple_size.md)``であること。 -- [`tuple`](../tuple.md)`<`[`common_­reference_­t`](/reference/type_traits/common_reference.md)`, UQual>...>`が正しく型を表すこと。 + - 具体的には、[`tuple_size_v`](../tuple_size.md)` ==` [`tuple_size_v`](../tuple_size.md)``であること。 +- [`tuple`](../tuple.md)`<`[`common_reference_t`](/reference/type_traits/common_reference.md)`, UQual>...>`が正しく型を表すこと。 ## バージョン diff --git a/reference/tuple/tuple/common_type.md b/reference/tuple/tuple/common_type.md index b8ffd1e735..f6d8d89022 100644 --- a/reference/tuple/tuple/common_type.md +++ b/reference/tuple/tuple/common_type.md @@ -18,16 +18,16 @@ namespace std { ## 効果 -[`tuple`](../tuple.md)`<`[`common_­type_­t`](/reference/type_traits/common_type.md)`...>`によって得られた型をメンバ型`type`として定義する。 +[`tuple`](../tuple.md)`<`[`common_type_t`](/reference/type_traits/common_type.md)`...>`によって得られた型をメンバ型`type`として定義する。 ## 備考 - `TTuple`か`UTuple`のどちらかが[`tuple`](../tuple.md)の特殊化であること。 -- `TTuple`と`UTuple`のそれぞれについて、(次の`T`を置き換える形で)[`is_­same_­v`](/reference/type_traits/is_same.md)`>`であること。 +- `TTuple`と`UTuple`のそれぞれについて、(次の`T`を置き換える形で)[`is_same_v`](/reference/type_traits/is_same.md)`>`であること。 - 実質的には`TTuple`と`Utuple`について、参照型ではなく、最上位の`const`/`volatile`修飾も持っていないこと要求する。 - `TTuple`と`UTuple`の要素数が一致していること。 - - 具体的には、[`tuple_­size_­v`](../tuple_size.md)` ==` [`tuple_­size_­v`](../tuple_size.md)``であること。 -- [`tuple`](../tuple.md)`<`[`common_­type_­t`](/reference/type_traits/common_type.md)`...>`が正しく型を表すこと。 + - 具体的には、[`tuple_size_v`](../tuple_size.md)` ==` [`tuple_size_v`](../tuple_size.md)``であること。 +- [`tuple`](../tuple.md)`<`[`common_type_t`](/reference/type_traits/common_type.md)`...>`が正しく型を表すこと。 ## バージョン diff --git a/reference/tuple/tuple/op_assign.md b/reference/tuple/tuple/op_assign.md index 67c8ba00a1..23b54f8aac 100644 --- a/reference/tuple/tuple/op_assign.md +++ b/reference/tuple/tuple/op_assign.md @@ -84,23 +84,23 @@ constexpr const tuple& operator=(UTuple&&) const; // (14) C++23 - (1) : 全ての`i`について、[`is_copy_assignable`](/reference/type_traits/is_copy_assignable.md)`::value == true`であること - (2) : C++23 : 全ての`i`について、[`is_copy_assignable_v`](/reference/type_traits/is_copy_assignable.md)` == true`であること - (3) : 全ての`i`について、[`is_move_assignable`](/reference/type_traits/is_move_assignable.md)`::value == true`であること -- (4) : C++23 : 全ての`i`について、[`is_­assignable_­v`](/reference/type_traits/is_assignable.md)` == true`であること +- (4) : C++23 : 全ての`i`について、[`is_assignable_v`](/reference/type_traits/is_assignable.md)` == true`であること - (5) : 要素数が同じかつ、パラメータの[`tuple`](../tuple.md)の全ての要素型が、元の[`tuple`](../tuple.md)の全ての要素型にコピー代入可能であること -- (6) : C++23 : 要素数が同じかつ、全ての`i`について、[`is_­assignable_­v`](/reference/type_traits/is_assignable.md)` == true`であること +- (6) : C++23 : 要素数が同じかつ、全ての`i`について、[`is_assignable_v`](/reference/type_traits/is_assignable.md)` == true`であること - (7) : 要素数が同じかつ、パラメータの[`tuple`](../tuple.md)の全ての要素型が、元の[`tuple`](../tuple.md)の全ての要素型にムーブ代入可能であること -- (8) : C++23 : 要素数が同じかつ、全ての`i`について、[`is_­assignable_­v`](/reference/type_traits/is_assignable.md)` = true`であること +- (8) : C++23 : 要素数が同じかつ、全ての`i`について、[`is_assignable_v`](/reference/type_traits/is_assignable.md)` = true`であること - (9) : 元の[`tuple`](../tuple.md)の要素数が2であり、パラメータの[`pair`](/reference/utility/pair.md)の全ての要素型が元の[`tuple`](../tuple.md)の全ての要素型にコピー代入可能であること -- (10) : C++23 : 元の[`tuple`](../tuple.md)の要素数が2であり、[`is_­assignable_­v`](/reference/type_traits/is_assignable.md)` &&` [`is_­assignable_­v`](/reference/type_traits/is_assignable.md)``であること +- (10) : C++23 : 元の[`tuple`](../tuple.md)の要素数が2であり、[`is_assignable_v`](/reference/type_traits/is_assignable.md)` &&` [`is_assignable_v`](/reference/type_traits/is_assignable.md)``であること - (11) : 元の[`tuple`](../tuple.md)の要素型が2であり、パラメータの[`pair`](/reference/utility/pair.md)の全ての要素型が元の[`tuple`](../tuple.md)の全ての要素型にムーブ代入可能であること -- (12) : C++23 : 元の[`tuple`](../tuple.md)の要素数が2であり、[`is_­assignable_­v`](/reference/type_traits/is_assignable.md)` &&` [`is_­assignable_­v`](/reference/type_traits/is_assignable.md)``であること +- (12) : C++23 : 元の[`tuple`](../tuple.md)の要素数が2であり、[`is_assignable_v`](/reference/type_traits/is_assignable.md)` &&` [`is_assignable_v`](/reference/type_traits/is_assignable.md)``であること - (13) : 要素数が同じかつ、次を全て満たすこと - C++23 : [`different-from`](/reference/ranges/different-from.md)`` - - C++23 : [`remove_­cvref_­t`](/reference/type_traits/remove_cvref.md)``が[`ranges::subrange`](/reference/ranges/subrange.md)の特殊化でないこと - - C++23 : 全ての`i`について、[`is_­assignable_­v`](/reference/type_traits/is_assignable.md)`(`[`std​::​forward`](/reference/utility/forward.md)`(u)))>` + - C++23 : [`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``が[`ranges::subrange`](/reference/ranges/subrange.md)の特殊化でないこと + - C++23 : 全ての`i`について、[`is_assignable_v`](/reference/type_traits/is_assignable.md)`(`[`std​::​forward`](/reference/utility/forward.md)`(u)))>` - (14) : 要素数が同じかつ、次をすべて満たすこと - C++23 : [`different-from`](/reference/ranges/different-from.md)`` - - C++23 : [`remove_­cvref_­t`](/reference/type_traits/remove_cvref.md)``が[`ranges::subrange`](/reference/ranges/subrange.md)の特殊化でないこと - - C++23 : [`is_­assignable_­v`](/reference/type_traits/is_assignable.md)`(`[`std​::​forward`](/reference/utility/forward.md)`(u)))>` + - C++23 : [`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``が[`ranges::subrange`](/reference/ranges/subrange.md)の特殊化でないこと + - C++23 : [`is_assignable_v`](/reference/type_traits/is_assignable.md)`(`[`std​::​forward`](/reference/utility/forward.md)`(u)))>` ## 例外 diff --git a/reference/tuple/tuple/op_compare_3way.md b/reference/tuple/tuple/op_compare_3way.md index 91e768b7e4..1a6c4b76a5 100644 --- a/reference/tuple/tuple/op_compare_3way.md +++ b/reference/tuple/tuple/op_compare_3way.md @@ -15,8 +15,8 @@ namespace std { operator<=>(const tuple& t, const UTuple& u); // (2) C++23 // (2) の Elems は 型パラメータパック - // tuple_­element_­t<0, UTuple>, tuple_­element_­t<1, UTuple>, ..., - // tuple_­element_­t - 1, UTuple> + // tuple_element_t<0, UTuple>, tuple_element_t<1, UTuple>, ..., + // tuple_element_t - 1, UTuple> // を表す。 } ``` @@ -24,8 +24,8 @@ namespace std { * common_comparison_category_t[link /reference/compare/common_comparison_category.md] * synth-three-way-result[link /reference/exposition-only/synth-three-way-result.md] * tuple-like[link ../tuple-like.md] -* tuple_­element_­t[link ../tuple_element.md] -* tuple_­size_­v[link ../tuple_size.md] +* tuple_element_t[link ../tuple_element.md] +* tuple_size_v[link ../tuple_size.md] ## 概要 2つの[`tuple`](../tuple.md)オブジェクトの三方比較を行う。また、[`tuple-like`](../tuple-like.md)なオブジェクトとの三方比較を行う。(C++23以降) diff --git a/reference/tuple/tuple/op_constructor.md b/reference/tuple/tuple/op_constructor.md index 69b191ee40..2bf4e9eeb6 100644 --- a/reference/tuple/tuple/op_constructor.md +++ b/reference/tuple/tuple/op_constructor.md @@ -260,18 +260,18 @@ explicit(see below) constexpr - C++20まで : `Types...`の全ての型`Ti`と、`UTypes...`の全ての型`Ui`について、[`is_constructible`](/reference/type_traits/is_constructible.md)`::value == true`であること - C++17 : `sizeof...(Types) >= 1`であること - C++23 : `disambiguating-constraint`を次のように定義して、 - - `sizeof...(Types) == 1`の時、[`negation`](/reference/type_traits/negation.md)`<`[`is_­same`](/reference/type_traits/is_same.md)`<`[`remove_­cvref_­t`](/reference/type_traits/remove_cvref.md)`,` [`tuple`](../tuple.md)`>>` - - `sizeof...(Types) == 2 || sizeof...(Types) == 3`の時、[`bool_­constant`](/reference/type_traits/bool_constant.md)`,` [`allocator_­arg_­t`](/reference/memory/allocator_arg_t.md)`> ||` [`is_­same_­v`](/reference/type_traits/is_same.md)`<`[`remove_­cvref_­t`](/reference/type_traits/remove_cvref.md)`,` [`allocator_­arg_­t`](/reference/memory/allocator_arg_t.md)`>>` + - `sizeof...(Types) == 1`の時、[`negation`](/reference/type_traits/negation.md)`<`[`is_same`](/reference/type_traits/is_same.md)`<`[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`,` [`tuple`](../tuple.md)`>>` + - `sizeof...(Types) == 2 || sizeof...(Types) == 3`の時、[`bool_constant`](/reference/type_traits/bool_constant.md)`,` [`allocator_arg_t`](/reference/memory/allocator_arg_t.md)`> ||` [`is_same_v`](/reference/type_traits/is_same.md)`<`[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`,` [`allocator_arg_t`](/reference/memory/allocator_arg_t.md)`>>` - 以上に該当しなければ、[`true_type`](/reference/type_traits/true_type.md) - - C++23 : [`conjunction_­v`](/reference/type_traits/conjunction.md)`...>`であること + - C++23 : [`conjunction_v`](/reference/type_traits/conjunction.md)`...>`であること - (4), (18) : - `Types...`の全ての型`Ti`について、[`is_copy_constructible`](/reference/type_traits/is_copy_constructible.md)`::value == true`であること - (5), (19) : - `Types...`の全ての型`Ti`について、[`is_move_constructible`](/reference/type_traits/is_move_constructible.md)`::value == true`であること - (6)-(9), (20)-(23) : - - `I`をパラメータパック`0, 1, ..., (sizeof...(Types) - 1)`、`FWD(u)`を`static_­cast(u)`、`sizeof...(Types) == 1`の場合は、`Types...`を`T`へ、`UTypes...`を`U`へ展開したと定義して - - C++23 : `sizeof...(Types) == sizeof...(UTypes) && (`[`is_­constructible_­v`](/reference/type_traits/is_constructible.md)`(FWD(u)))> && ...) == true`であること - - C++23 : 更に、`sizeof...(Types) != 1`または、[`is_­convertible_v­`](/reference/type_traits/is_convertible.md)` == false &&` [`is_­constructible_­v`](/reference/type_traits/is_constructible.md)` == false &&` [`is_­same_­v`](/reference/type_traits/is_same.md)` == false`であること + - `I`をパラメータパック`0, 1, ..., (sizeof...(Types) - 1)`、`FWD(u)`を`static_cast(u)`、`sizeof...(Types) == 1`の場合は、`Types...`を`T`へ、`UTypes...`を`U`へ展開したと定義して + - C++23 : `sizeof...(Types) == sizeof...(UTypes) && (`[`is_constructible_v`](/reference/type_traits/is_constructible.md)`(FWD(u)))> && ...) == true`であること + - C++23 : 更に、`sizeof...(Types) != 1`または、[`is_convertible_v`](/reference/type_traits/is_convertible.md)` == false &&` [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == false &&` [`is_same_v`](/reference/type_traits/is_same.md)` == false`であること - (7), (21) : - `sizeof...(Types) == sizeof...(UTypes)`であること - `Types...`の全ての型`Ti`と、`UTypes...`の全ての型`Ui`について、[`is_constructible`](/reference/type_traits/is_constructible.md)`::value == true`であること @@ -285,7 +285,7 @@ explicit(see below) constexpr - ムーブコンストラクタとのオーバーロードが成立することを意図している - C++23 : (6)-(9), (20)-(23) の定義参照 - (10)-(13), (24)-(27) : - - `FWD(u)`を`static_­cast(u)`、`Types...`の0番目の型を`T0`、1番目の型を`T1`であるとして、 + - `FWD(u)`を`static_cast(u)`、`Types...`の0番目の型を`T0`、1番目の型を`T1`であるとして、 - C++23 : `sizeof...(Types) == 2`であること - C++23 : [`is_constructible_v`](/reference/type_traits/is_constructible.md)`(FWD(u))) == true`であること - C++23 : [`is_constructible_v`](/reference/type_traits/is_constructible.md)`(FWD(u))) == true`であること @@ -304,8 +304,8 @@ explicit(see below) constexpr - C++23 : [`different-from`](/reference/ranges/different-from.md)``であること - C++23 : [`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``が[`ranges::subrange`](/reference/ranges/subrange.md)の特殊化でないこと - C++23 : `sizeof...(Types) ==` [`tuple_size_v`](../tuple_size.md)`<`[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`>`であること - - C++23 : `(`[`is_­constructible_­v`](/reference/type_traits/is_constructible.md)`(`[`std​::​forward`](/reference/utility/forward.md)`(u)))> && ...) == true`であること - - C++23 : `sizeof...(Types) != 1`であるか、または`Types...`を`T`に展開したとして[`is_­convertible_­v`](/reference/type_traits/is_convertible.md)` == false &&` [`is_­constructible_­v`](/reference/type_traits/is_constructible.md)` == false`であること + - C++23 : `(`[`is_constructible_v`](/reference/type_traits/is_constructible.md)`(`[`std​::​forward`](/reference/utility/forward.md)`(u)))> && ...) == true`であること + - C++23 : `sizeof...(Types) != 1`であるか、または`Types...`を`T`に展開したとして[`is_convertible_v`](/reference/type_traits/is_convertible.md)` == false &&` [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == false`であること ## 備考 @@ -319,7 +319,7 @@ explicit(see below) constexpr - C++17から : `!`[`conjunction_v`](/reference/type_traits/conjunction.md)`<`[`is_convertible`](/reference/type_traits/is_convertible.md)`...>`である場合、この関数は`explicit`となる - C++23から : `(`[`reference_constructs_from_temporary_v`](/reference/type_traits/reference_constructs_from_temporary.md)` || ...)`である場合、この関数は削除定義される - (6)-(9) : - - `I`をパラメータパック`0, 1, ..., (sizeof...(Types) - 1)`、`FWD(u)`を`static_­cast(u)`と定義して、 + - `I`をパラメータパック`0, 1, ..., (sizeof...(Types) - 1)`、`FWD(u)`を`static_cast(u)`と定義して、 - C++23 : `!(`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`(FWD(u))), Types> && ...)`である場合、この関数は`explicit`となる - C++23 : `(`[`reference_constructs_from_temporary_v`](/reference/type_traits/reference_constructs_from_temporary.md)`(FWD(u)))> || ...)`である場合、この関数は削除定義される - (7) : @@ -329,7 +329,7 @@ explicit(see below) constexpr - C++17 : `!`[`conjunction_v`](/reference/type_traits/conjunction.md)`<`[`is_convertible`](/reference/type_traits/is_convertible.md)`...>`である場合、この関数は`explicit`となる - C++23 : (6)-(9) の定義参照 - (10)-(13) : - - `FWD(u)`を`static_­cast(u)`、`Types...`の0番目の型を`T0`、1番目の型を`T1`であるとして、 + - `FWD(u)`を`static_cast(u)`、`Types...`の0番目の型を`T0`、1番目の型を`T1`であるとして、 - C++23 : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`(FWD(u))), T0> ||!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`(FWD(u))), T1>`である場合、この関数は`explicit`となる - C++23 : [`reference_constructs_from_temporary_v`](/reference/type_traits/reference_constructs_from_temporary.md)`(FWD(u)))> ||` [`reference_constructs_from_temporary_v`](/reference/type_traits/reference_constructs_from_temporary.md)`(FWD(u)))>`である場合、この関数は削除定義される - (11) : diff --git a/reference/tuple/tuple/op_equal.md b/reference/tuple/tuple/op_equal.md index b0cb55f2f8..567726a2b3 100644 --- a/reference/tuple/tuple/op_equal.md +++ b/reference/tuple/tuple/op_equal.md @@ -31,7 +31,7 @@ namespace std { - 2つの[`tuple`](../tuple.md)オブジェクトの要素数が同じであること。(具体的には`sizeof...(TTypes) == sizeof...(UTypes)`であること。) - [`tuple`](../tuple.md)の要素`std::`[`get`](get.md)`(t)`と`std::`[`get`](get.md)`(u)`において、すべての要素の比較 `std::`[`get`](get.md)`(t) == std::`[`get`](get.md)`(u)` の比較結果が`bool`に変換可能な型(C++23 以降は[`boolean-testable`](/reference/concepts/boolean-testable.md)を満たせばよい)であること。 - (2) : - - C++23 : 2つの[`tuple-like`](../tuple-like.md)なオブジェクトの要素数が同じであること。(正確には、`sizeof...(TTypes) ==` [`tuple_­size_­v`](../tuple_size.md)``であること。) + - C++23 : 2つの[`tuple-like`](../tuple-like.md)なオブジェクトの要素数が同じであること。(正確には、`sizeof...(TTypes) ==` [`tuple_size_v`](../tuple_size.md)``であること。) - C++23 : [`tuple`](../tuple.md)の要素`std::`[`get`](get.md)`(t)`と[`tuple-like`](../tuple-like.md)なオブジェクトの要素`std::get(u)`において、すべての要素の比較 `std::`[`get`](get.md)`(t) == std::`[`get`](get.md)`(u)` の比較結果が[`boolean-testable`](/reference/concepts/boolean-testable.md)を満たす型(`bool`へ変換可能な型)であること。 diff --git a/reference/tuple/tuple_cat.md b/reference/tuple/tuple_cat.md index 1f7f18b28a..5827bea6e3 100644 --- a/reference/tuple/tuple_cat.md +++ b/reference/tuple/tuple_cat.md @@ -29,7 +29,7 @@ namespace std { - `Args...`の各型が左辺値参照であればコピー構築可能、そうでなければムーブ構築可能であること。 - C++23から : - 本関数の返り値の[`tuple`](tuple.md)のテンプレートパラメーターパックを`Ctypes`とし、`Ctypes`の全ての要素について、引数`tpls`において対応する要素の型から構築可能であること。 - - より厳密には、次のように定義を行い、`(`[`is_­constructible_v­`](/reference/type_traits/is_constructible.md)` && ...) == true`であること。 + - より厳密には、次のように定義を行い、`(`[`is_constructible_v`](/reference/type_traits/is_constructible.md)` && ...) == true`であること。 - `n`を`sizeof...(Tuples)`とし、`i`を範囲`[0, n)`における整数値とする - `T(i)`を`Tuples`の`i`番目とする - `U(i)`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md) とする diff --git a/reference/type_traits/is_invocable_r.md b/reference/type_traits/is_invocable_r.md index a5b907ce77..f32c28abaa 100644 --- a/reference/type_traits/is_invocable_r.md +++ b/reference/type_traits/is_invocable_r.md @@ -35,11 +35,11 @@ std::is_convertible_v, R> // C++23 std::is_convertible_v, R> && -std::reference_­converts_­from_­temporary_­v> == false +std::reference_converts_from_temporary_v> == false ``` * std::is_convertible_v[link is_convertible.md] * std::invoke_result_t[link invoke_result.md] -* std::reference_­converts_­from_­temporary_­v[link /reference/type_traits/reference_converts_from_temporary.md] +* std::reference_converts_from_temporary_v[link /reference/type_traits/reference_converts_from_temporary.md] ## 寿命の延長とダングリング参照 @@ -49,7 +49,7 @@ std::reference_­converts_­from_­temporary_­v diff --git a/reference/utility/pair/op_assign.md b/reference/utility/pair/op_assign.md index b7ec890c1e..9c1e433410 100644 --- a/reference/utility/pair/op_assign.md +++ b/reference/utility/pair/op_assign.md @@ -66,13 +66,13 @@ template - (9) : 次を全て満たすこと - C++23 : [`different-from`](/reference/ranges/different-from.md)`` - C++23 : [`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`

`が[`ranges::subrange`](/reference/ranges/subrange.md)の特殊化でないこと - - C++23 : [`is_­assignable_­v`](/reference/type_traits/is_assignable.md)`(`[`std​::​forward`](/reference/utility/forward.md)`

(p)))>` - - C++23 : [`is_­assignable_­v`](/reference/type_traits/is_assignable.md)`(`[`std​::​forward`](/reference/utility/forward.md)`

(p)))>` + - C++23 : [`is_assignable_v`](/reference/type_traits/is_assignable.md)`(`[`std​::​forward`](/reference/utility/forward.md)`

(p)))>` + - C++23 : [`is_assignable_v`](/reference/type_traits/is_assignable.md)`(`[`std​::​forward`](/reference/utility/forward.md)`

(p)))>` - (10) : 次を全て満たすこと - C++23 : [`different-from`](/reference/ranges/different-from.md)`` - C++23 : [`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`

`が[`ranges::subrange`](/reference/ranges/subrange.md)の特殊化でないこと - - C++23 : [`is_­assignable_­v`](/reference/type_traits/is_assignable.md)`(`[`std​::​forward`](/reference/utility/forward.md)`

(p)))>` - - C++23 : [`is_­assignable_­v`](/reference/type_traits/is_assignable.md)`(`[`std​::​forward`](/reference/utility/forward.md)`

(p)))>` + - C++23 : [`is_assignable_v`](/reference/type_traits/is_assignable.md)`(`[`std​::​forward`](/reference/utility/forward.md)`

(p)))>` + - C++23 : [`is_assignable_v`](/reference/type_traits/is_assignable.md)`(`[`std​::​forward`](/reference/utility/forward.md)`

(p)))>` ## 効果 diff --git a/reference/utility/pair/op_constructor.md b/reference/utility/pair/op_constructor.md index ad0ad1de44..84bb25ebcd 100644 --- a/reference/utility/pair/op_constructor.md +++ b/reference/utility/pair/op_constructor.md @@ -116,11 +116,11 @@ constexpr pair(piecewise_construct_t, - C++17 : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` || !`[`is_convertible_v`](/reference/type_traits/is_convertible.md)``である場合、`explicit`指定される - (5) : - C++17 : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` || !`[`is_convertible_v`](/reference/type_traits/is_convertible.md)``である場合、`explicit`指定される - - C++23 : [`reference_­constructs_­from_­temporary_­v`](/reference/type_traits/reference_constructs_from_temporary.md)` ||` [`reference_­constructs_­from_­temporary_­v`](/reference/type_traits/reference_constructs_from_temporary.md)``である場合、このコンストラクタは削除定義される + - C++23 : [`reference_constructs_from_temporary_v`](/reference/type_traits/reference_constructs_from_temporary.md)` ||` [`reference_constructs_from_temporary_v`](/reference/type_traits/reference_constructs_from_temporary.md)``である場合、このコンストラクタは削除定義される - (6)-(10) : - `FWD(u)`を`static_cast(u)`と定義して - C++23 : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`(FWD(p))), T1> || !`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`(FWD(p))), T2>`である場合、`explicit`指定される - - C++23 : [`reference_­constructs_­from_­temporary_­v`](/reference/type_traits/reference_constructs_from_temporary.md)`(FWD(p)))> ||` [`reference_­constructs_­from_­temporary_­v`](/reference/type_traits/reference_constructs_from_temporary.md)`(FWD(p)))>`である場合、このコンストラクタは削除定義される + - C++23 : [`reference_constructs_from_temporary_v`](/reference/type_traits/reference_constructs_from_temporary.md)`(FWD(p)))> ||` [`reference_constructs_from_temporary_v`](/reference/type_traits/reference_constructs_from_temporary.md)`(FWD(p)))>`である場合、このコンストラクタは削除定義される - (7) : - C++17 : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` || !`[`is_convertible_v`](/reference/type_traits/is_convertible.md)``である場合、`explicit`指定される - C++23 : (6)-(10) での定義参照 From 653081e759e041f845ec7efa22dad18ab81635ca Mon Sep 17 00:00:00 2001 From: tomolatoon Date: Wed, 1 Feb 2023 10:15:46 +0900 Subject: [PATCH 0137/3948] =?UTF-8?q?=E3=82=BC=E3=83=AD=E5=B9=85=E3=82=B9?= =?UTF-8?q?=E3=83=9A=E3=83=BC=E3=82=B9=E9=99=A4=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/tuple/tuple/op_assign.md | 4 ++-- reference/tuple/tuple/op_constructor.md | 2 +- reference/utility/pair/op_assign.md | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/reference/tuple/tuple/op_assign.md b/reference/tuple/tuple/op_assign.md index 23b54f8aac..46582ddf28 100644 --- a/reference/tuple/tuple/op_assign.md +++ b/reference/tuple/tuple/op_assign.md @@ -96,11 +96,11 @@ constexpr const tuple& operator=(UTuple&&) const; // (14) C++23 - (13) : 要素数が同じかつ、次を全て満たすこと - C++23 : [`different-from`](/reference/ranges/different-from.md)`` - C++23 : [`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``が[`ranges::subrange`](/reference/ranges/subrange.md)の特殊化でないこと - - C++23 : 全ての`i`について、[`is_assignable_v`](/reference/type_traits/is_assignable.md)`(`[`std​::​forward`](/reference/utility/forward.md)`(u)))>` + - C++23 : 全ての`i`について、[`is_assignable_v`](/reference/type_traits/is_assignable.md)`(`[`std::forward`](/reference/utility/forward.md)`(u)))>` - (14) : 要素数が同じかつ、次をすべて満たすこと - C++23 : [`different-from`](/reference/ranges/different-from.md)`` - C++23 : [`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``が[`ranges::subrange`](/reference/ranges/subrange.md)の特殊化でないこと - - C++23 : [`is_assignable_v`](/reference/type_traits/is_assignable.md)`(`[`std​::​forward`](/reference/utility/forward.md)`(u)))>` + - C++23 : [`is_assignable_v`](/reference/type_traits/is_assignable.md)`(`[`std::forward`](/reference/utility/forward.md)`(u)))>` ## 例外 diff --git a/reference/tuple/tuple/op_constructor.md b/reference/tuple/tuple/op_constructor.md index 2bf4e9eeb6..cc7f01e037 100644 --- a/reference/tuple/tuple/op_constructor.md +++ b/reference/tuple/tuple/op_constructor.md @@ -304,7 +304,7 @@ explicit(see below) constexpr - C++23 : [`different-from`](/reference/ranges/different-from.md)``であること - C++23 : [`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``が[`ranges::subrange`](/reference/ranges/subrange.md)の特殊化でないこと - C++23 : `sizeof...(Types) ==` [`tuple_size_v`](../tuple_size.md)`<`[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`>`であること - - C++23 : `(`[`is_constructible_v`](/reference/type_traits/is_constructible.md)`(`[`std​::​forward`](/reference/utility/forward.md)`(u)))> && ...) == true`であること + - C++23 : `(`[`is_constructible_v`](/reference/type_traits/is_constructible.md)`(`[`std::forward`](/reference/utility/forward.md)`(u)))> && ...) == true`であること - C++23 : `sizeof...(Types) != 1`であるか、または`Types...`を`T`に展開したとして[`is_convertible_v`](/reference/type_traits/is_convertible.md)` == false &&` [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == false`であること diff --git a/reference/utility/pair/op_assign.md b/reference/utility/pair/op_assign.md index 9c1e433410..3e48d1d6cd 100644 --- a/reference/utility/pair/op_assign.md +++ b/reference/utility/pair/op_assign.md @@ -66,13 +66,13 @@ template - (9) : 次を全て満たすこと - C++23 : [`different-from`](/reference/ranges/different-from.md)`` - C++23 : [`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`

`が[`ranges::subrange`](/reference/ranges/subrange.md)の特殊化でないこと - - C++23 : [`is_assignable_v`](/reference/type_traits/is_assignable.md)`(`[`std​::​forward`](/reference/utility/forward.md)`

(p)))>` - - C++23 : [`is_assignable_v`](/reference/type_traits/is_assignable.md)`(`[`std​::​forward`](/reference/utility/forward.md)`

(p)))>` + - C++23 : [`is_assignable_v`](/reference/type_traits/is_assignable.md)`(`[`std::forward`](/reference/utility/forward.md)`

(p)))>` + - C++23 : [`is_assignable_v`](/reference/type_traits/is_assignable.md)`(`[`std::forward`](/reference/utility/forward.md)`

(p)))>` - (10) : 次を全て満たすこと - C++23 : [`different-from`](/reference/ranges/different-from.md)`` - C++23 : [`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`

`が[`ranges::subrange`](/reference/ranges/subrange.md)の特殊化でないこと - - C++23 : [`is_assignable_v`](/reference/type_traits/is_assignable.md)`(`[`std​::​forward`](/reference/utility/forward.md)`

(p)))>` - - C++23 : [`is_assignable_v`](/reference/type_traits/is_assignable.md)`(`[`std​::​forward`](/reference/utility/forward.md)`

(p)))>` + - C++23 : [`is_assignable_v`](/reference/type_traits/is_assignable.md)`(`[`std::forward`](/reference/utility/forward.md)`

(p)))>` + - C++23 : [`is_assignable_v`](/reference/type_traits/is_assignable.md)`(`[`std::forward`](/reference/utility/forward.md)`

(p)))>` ## 効果 From 33fb9968149fffc0fd360aeee22c1bce32238a55 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 1 Feb 2023 10:26:37 +0900 Subject: [PATCH 0138/3948] =?UTF-8?q?detect=20forbidden=20characters=20CI?= =?UTF-8?q?=E3=81=AE=E8=AA=AC=E6=98=8E=E3=82=92=E8=A8=98=E8=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/detect_forbidden_characters.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/detect_forbidden_characters.yml b/.github/workflows/detect_forbidden_characters.yml index e8a6c5319e..f51f493c24 100644 --- a/.github/workflows/detect_forbidden_characters.yml +++ b/.github/workflows/detect_forbidden_characters.yml @@ -1,5 +1,13 @@ name: detect forbidden characters +# 本リポジトリでは、以下に挙げる文字の使用を禁止している: +# U+00AD SOFT HYPHEN (ソフトハイフン) +# U+200B ZERO WIDTH SPACE (ゼロ幅スペース) +# +# 経緯は以下を参照: +# #735 SOFT HYPHENを削除する? +# https://github.com/cpprefjp/site/issues/735 + on: [push, pull_request, workflow_dispatch] jobs: From 524b25681551c84589da6a080fda499b38a859aa Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 1 Feb 2023 11:02:49 +0900 Subject: [PATCH 0139/3948] =?UTF-8?q?start=5Fediting=20:=20GitHub=20Action?= =?UTF-8?q?s=E3=81=AE=E5=90=84=E3=82=BF=E3=82=B9=E3=82=AF=E3=81=AB?= =?UTF-8?q?=E3=81=A4=E3=81=84=E3=81=A6=E3=81=AE=E8=AA=AC=E6=98=8E=E3=82=92?= =?UTF-8?q?=E8=A8=98=E8=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start_editing.md | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/start_editing.md b/start_editing.md index b25bab7577..963c862fb4 100644 --- a/start_editing.md +++ b/start_editing.md @@ -24,15 +24,36 @@ cpprefjp/site へ push すると、すぐに反映されます。 日次の変換中にコミットした変更は、日次の変換がおわったあと (だいたい1時間30分〜2時間くらい) に自動で変換・反映されます。 -### 変換エラーの検出 +### 自動デプロイ、自動テスト +本リポジトリでは、GitHub Actionsを使用して、自動デプロイと自動テストを行っています。 + +#### 自動デプロイ +buildアクションで、MarkdownからHTMLへの変換と、GitHub Pagesへのデプロイを行っています。 + 変換時になんらかのエラーが発生した場合には、GitHub Actionsが失敗します。その場合、手元で修正して再度git pushを行うことになります -変換エラーではなく、GitHub Pagesリポジトリへのgit pushに失敗した場合 (buildアクションの実行中に新たなコミットがgit pushされた場合など) には、そのbuildアクションに対してRe-run jobを実行し、再度変換を行ってください +変換エラーではなく、GitHub Pagesリポジトリへのgit pushに失敗した場合 (buildアクションの実行中に新たなコミットがgit pushされた場合など) には、そのbuildアクションに対してRe-run jobを実行し、再度変換を行ってください。 + + +#### 自動テスト +- 禁止文字の検出 (detect forbidden charactersアクション) + - 説明は[detect_forbidden_characters.yml](https://github.com/cpprefjp/site/blob/master/.github/workflows/detect_forbidden_characters.yml)のコメントを参照 +- 内部リンクの誤り検出 (inner link checkアクション) + - サイト内のリンクが存在しない、または存在しているのに.nolinkを指定している場合にエラーが発生する + - [GitHub Actionsの実行ログ](https://github.com/cpprefjp/site/actions/workflows/inner_link_check.yml)で、どのページのどのリンクが不正かがわかるので、それを修正すること +- 外部リンク切れを検出 (outer link checkアクション) + - 日本時間で日曜日の23:30に実行される + - 外部リンクのページにアクセスできない (ページが消滅したか、一時的にアクセスできない、などの理由) 場合にエラーとなる + - エラーが発生した場合は、本リポジトリにissueが発行される + - ページが消滅した場合は、代替となるものがあれば差し替え、なければInternet Archiveに変更する + - 一時的にアクセスできない場合は、時間を置いてアクセスできるようになったらissueを閉じる + - 海外からのアクセス (GitHub Actions) を拒否しているページもあるため、そのようなページは個別にチェックから外す ([link_check.py](https://github.com/cpprefjp/site/blob/master/.github/workflows/script/link_check.py)の`IGNORE_LIST`に追加する) + ### 自動反映ツール 自動反映ツールも、GitHub上で開発が進められています。 -* [site_generator](https://github.com/cpprefjp/site_generator) +- [site_generator](https://github.com/cpprefjp/site_generator) 機能要望やpull request等がありましたら、こちらにお願いします。 From 05c1f4f83c8d0036ead5237667fb68c2c8217b4d Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Wed, 1 Feb 2023 16:12:22 +0900 Subject: [PATCH 0140/3948] =?UTF-8?q?time=5Ft:=20=E5=A4=9A=E3=81=8F?= =?UTF-8?q?=E3=81=AE=E5=AE=9F=E8=A3=85=E3=81=A7=E7=AC=A6=E5=8F=B7=E4=BB=98?= =?UTF-8?q?=E3=81=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ctime/time_t.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/ctime/time_t.md b/reference/ctime/time_t.md index 9e4d14d632..bcaf6ab18a 100644 --- a/reference/ctime/time_t.md +++ b/reference/ctime/time_t.md @@ -19,7 +19,7 @@ namespace std { ## 備考 -- 値の範囲が実装定義であるため、策定当時の標準ライブラリ実装では32ビット符号なし整数型の別名として定義されていた。しかし32ビットでは秒単位で扱った場合に、西暦2038年1月19日にオーバーフローしてしまうことが判明した。そのため、現在多くの実装では64ビット符号なし整数型の別名として定義される。64ビットで秒単位の場合は西暦3000億年まで扱えるため、オーバーフローの問題は気にしなくてよいだろう +- 値の範囲が実装定義であるため、策定当時の標準ライブラリ実装では32ビット符号付き整数型の別名として定義されていた。しかし32ビットでは秒単位で扱った場合に、西暦2038年1月19日にオーバーフローしてしまうことが判明した。そのため、現在多くの実装では64ビット符号付き整数型の別名として定義される。64ビットで秒単位の場合は西暦3000億年まで扱えるため、オーバーフローの問題は気にしなくてよいだろう - Cの規格として、`time_t`はreal typeであると定義される。Cでのreal typeは、整数型と浮動小数点型の総称である - C++にそのような型の分類はない From b36c4caa5ecd2acad1c374ef5553814b943de8b6 Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 1 Feb 2023 22:19:06 +0900 Subject: [PATCH 0141/3948] expected/expected: emplace(#1066) --- reference/expected/expected.md | 2 +- reference/expected/expected/emplace.md | 115 +++++++++++++++++++++++++ 2 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 reference/expected/expected/emplace.md diff --git a/reference/expected/expected.md b/reference/expected/expected.md index e002aae204..a3ef99bf73 100644 --- a/reference/expected/expected.md +++ b/reference/expected/expected.md @@ -40,7 +40,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |-----------------|----------------|-------| | [`operator=`](expected/op_assign.md) | 代入演算子 | C++23 | -| [`emplace`](expected/emplace.md.nolink) | 正常値型のコンストラクタ引数から直接構築する | C++23 | +| [`emplace`](expected/emplace.md) | 正常値型のコンストラクタ引数から直接構築する | C++23 | | [`swap`](expected/swap.md.nolink) | 他の`expected`オブジェクトとデータを入れ替える | C++23 | ### 値の観測 diff --git a/reference/expected/expected/emplace.md b/reference/expected/expected/emplace.md new file mode 100644 index 0000000000..4f357de713 --- /dev/null +++ b/reference/expected/expected/emplace.md @@ -0,0 +1,115 @@ +# emplace +* expected[meta header] +* function[meta id-type] +* std[meta namespace] +* expected[meta class] +* cpp23[meta cpp] + +```cpp +template +constexpr T& emplace(Args&&... args) noexcept; // (1) + +template +constexpr T& emplace(initializer_list il, Args&&... args) noexcept; // (2) +``` + +## 概要 +- (1) : 正常値型`T`のコンストラクタ引数として任意個の引数を受け取って、型`T`のオブジェクトを有効値として生成し、保持する。 +- (2) : 正常値型`T`のコンストラクタ引数として初期化子リストと任意個の引数を受け取って、型`T`のオブジェクトを有効値として生成し、保持する。 + + +## テンプレートパラメータ制約 +- (1) : [`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)` == true` +- (2) : [`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)`&, Args...> == true` + + +## 効果 +- (1) : 次の処理と等価 + ```cpp + if (has_value()) { + destroy_at(addressof(val)); + } else { + destroy_at(addressof(unex)); + has_val = true; + } + return *construct_at(addressof(val), std::forward(args)...); + ``` + * has_value[link has_value.md] + * addressof[link /reference/memory/addressof.md] + * construct_at[link /reference/memory/construct_at.md] + * destroy_at[link /reference/memory/destroy_at.md] + +- (2) : 次の処理と等価 + ```cpp + if (has_value()) { + destroy_at(addressof(val)); + } else { + destroy_at(addressof(unex)); + has_val = true; + } + return *construct_at(addressof(val), il, std::forward(args)...); + ``` + * has_value[link has_value.md] + * addressof[link /reference/memory/addressof.md] + * construct_at[link /reference/memory/construct_at.md] + * destroy_at[link /reference/memory/destroy_at.md] + + +## 例 +```cpp example +#include +#include +#include + +// 引数リスト または 初期化子リスト+引数リスト から例外送出なしに構築可能な型 +struct ComplexType { + int result = 0; + + ComplexType(int a, int b) noexcept + : result(a + b) {} + ComplexType(std::initializer_list list, int init) noexcept + : result(std::accumulate(list.begin(), list.end(), init)) {} +}; + +int main() +{ + // (1) + { + std::expected x = std::unexpected{0}; + x.emplace(1, 2); + assert(x.has_value()); + assert(x.value().result == 3); + } + + // (2) + { + std::expected x = std::unexpected{0}; + x.emplace({1, 2, 3, 4}, 5); + assert(x.has_value()); + assert(x.value().result == 15); + } +} +``` +* emplace[color ff0000] +* has_value()[link has_value.md] +* value()[link value.md] +* std::unexpected[link ../unexpected.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) From c10f83df34e60c270db8b53c3699ce6348a7700e Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 1 Feb 2023 23:49:54 +0900 Subject: [PATCH 0142/3948] =?UTF-8?q?expected/expected:=20=E8=AA=BF?= =?UTF-8?q?=E6=95=B4(#1066)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/expected/expected/emplace.md | 12 +++++++++++- reference/expected/expected/error.md | 8 ++++++-- reference/expected/expected/op_assign.md | 8 ++++---- reference/expected/expected/op_constructor.md | 8 ++++---- reference/expected/expected/value.md | 8 ++++---- 5 files changed, 29 insertions(+), 15 deletions(-) diff --git a/reference/expected/expected/emplace.md b/reference/expected/expected/emplace.md index 4f357de713..2faa79e859 100644 --- a/reference/expected/expected/emplace.md +++ b/reference/expected/expected/emplace.md @@ -12,15 +12,23 @@ constexpr T& emplace(Args&&... args) noexcept; // (1) template constexpr T& emplace(initializer_list il, Args&&... args) noexcept; // (2) ``` +* initializer_list[link /reference/initializer_list/initializer_list.md] ## 概要 - (1) : 正常値型`T`のコンストラクタ引数として任意個の引数を受け取って、型`T`のオブジェクトを有効値として生成し、保持する。 - (2) : 正常値型`T`のコンストラクタ引数として初期化子リストと任意個の引数を受け取って、型`T`のオブジェクトを有効値として生成し、保持する。 +動作説明用の`expected`クラスメンバ変数として、下記を導入する。 + +- `val` : `T`型の正常値。 +- `unex` : `E`型のエラー値。 +- `has_val` : `bool`型のフラグ変数。正常値を保持する場合は`true`に、エラー値を保持する場合は`false`となる。 + + ## テンプレートパラメータ制約 - (1) : [`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)` == true` -- (2) : [`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)`&, Args...> == true` +- (2) : [`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)`&, Args...> == true` ## 効果 @@ -38,6 +46,7 @@ constexpr T& emplace(initializer_list il, Args&&... args) noexcept; // (2) * addressof[link /reference/memory/addressof.md] * construct_at[link /reference/memory/construct_at.md] * destroy_at[link /reference/memory/destroy_at.md] + * std::forward[link /reference/utility/forward.md] - (2) : 次の処理と等価 ```cpp @@ -53,6 +62,7 @@ constexpr T& emplace(initializer_list il, Args&&... args) noexcept; // (2) * addressof[link /reference/memory/addressof.md] * construct_at[link /reference/memory/construct_at.md] * destroy_at[link /reference/memory/destroy_at.md] + * std::forward[link /reference/utility/forward.md] ## 例 diff --git a/reference/expected/expected/error.md b/reference/expected/expected/error.md index 5ac4883f9b..75a60fe65c 100644 --- a/reference/expected/expected/error.md +++ b/reference/expected/expected/error.md @@ -16,11 +16,15 @@ constexpr E&& error() && noexcept; // (4) エラー値を取得する。 +## 事前条件 +[`has_value()`](has_value.md) `== false` + + ## 戻り値 動作説明用のメンバ変数として、エラー値を保持する`unex`を導入する。 -- (1), (2) : [`has_value()`](has_value.md) `== false`ならば、`unex` -- (3), (4) : [`has_value()`](has_value.md) `== false`ならば、[`std::move`](/reference/utility/move.md)`(unex)` +- (1), (2) : エラー値を保持していたら、`unex` +- (3), (4) : エラー値を保持していたら、[`std::move`](/reference/utility/move.md)`(unex)` ## 例外 diff --git a/reference/expected/expected/op_assign.md b/reference/expected/expected/op_assign.md index 3b1023df32..d9763a4b9f 100644 --- a/reference/expected/expected/op_assign.md +++ b/reference/expected/expected/op_assign.md @@ -69,24 +69,24 @@ constexpr void reinit-expected(T& newval, U& oldval, Args&&... args) { * std::move[link /reference/utility/move.md] ## テンプレートパラメータ制約 -- (2) : 下記を全て満たすこと +- (2) : 次の制約を全て満たすこと - [`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)` == true` - [`is_move_assignable_v`](/reference/type_traits/is_move_assignable.md)` == true` - [`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)` == true` - [`is_move_assignable_v`](/reference/type_traits/is_move_assignable.md)` == true` - `(`[`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)` ||` [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)`) == true` -- (3) : 下記を全て満たすこと +- (3) : 次の制約を全て満たすこと - [`is_same_v`](/reference/type_traits/is_same.md)`> == false` - [`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``が[`unexpected`](../unexpected.md)の特殊化ではない - [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true` - [`is_assignable_v`](/reference/type_traits/is_assignable.md)` == true` - `(`[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)` ||` [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)` ||` [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)`) == true` -- (4) : 下記を全て満たすこと +- (4) : 次の制約を全て満たすこと - [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true` - [`is_assignable_v`](/reference/type_traits/is_assignable.md)` == true` - `(`[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)` ||` [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)` || `[`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)`) == true` -- (5) : 下記を全て満たすこと +- (5) : 次の制約を全て満たすこと - [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true` - [`is_assignable_v`](/reference/type_traits/is_assignable.md)` == true` - `(`[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)` ||` [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)` ||` [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)`) == true` diff --git a/reference/expected/expected/op_constructor.md b/reference/expected/expected/op_constructor.md index 564f2e7f32..2d9634ce5a 100644 --- a/reference/expected/expected/op_constructor.md +++ b/reference/expected/expected/op_constructor.md @@ -50,8 +50,8 @@ constexpr explicit expected(unexpect_t, initializer_list il, Args&&... args); - (8) : 変換可能な[`unexpected`](../unexpected.md)オブジェクトからエラー値をムーブ構築する。 - (9) : 正常値型`T`のコンストラクタ引数として任意個の引数を受け取って、コンストラクタ内で型`T`のオブジェクトを正常値として生成し、保持する。 - (10) : 正常値型`T`のコンストラクタ引数として初期化子リストと任意個の引数を受け取って、コンストラクタ内で型`T`のオブジェクトを正常値として生成し、保持する。 -- (11) : エラー値型`E`のコンストラクタ引数として任意個の引数を受け取って、コンストラクタ内で型`E`のオブジェクトを正常値として生成し、保持する。 -- (12) : エラー値型`E`のコンストラクタ引数として初期化子リストと任意個の引数を受け取って、コンストラクタ内で型`E`のオブジェクトを正常値として生成し、保持する。 +- (11) : エラー値型`E`のコンストラクタ引数として任意個の引数を受け取って、コンストラクタ内で型`E`のオブジェクトをエラー値として生成し、保持する。 +- (12) : エラー値型`E`のコンストラクタ引数として初期化子リストと任意個の引数を受け取って、コンストラクタ内で型`E`のオブジェクトをエラー値として生成し、保持する。 説明用のテンプレート変数`converts-from-any-cvref`を次の通り定義する。 @@ -96,9 +96,9 @@ constexpr bool converts-from-any-cvref = - (7) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true` - (8) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true` - (9) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true` -- (10) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)`&, Args...> == true` +- (10) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)`&, Args...> == true` - (11) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true` -- (12) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)`&, Args...> == true` +- (12) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)`&, Args...> == true` ## 効果 diff --git a/reference/expected/expected/value.md b/reference/expected/expected/value.md index c7da839541..136b805c8d 100644 --- a/reference/expected/expected/value.md +++ b/reference/expected/expected/value.md @@ -19,13 +19,13 @@ constexpr T&& value() &&; // (4) ## 戻り値 動作説明用のメンバ変数として、正常値を保持する`val`を導入する。 -- (1), (2) : [`has_value()`](has_value.md) `== true`ならば、`val` -- (3), (4) : [`has_value()`](has_value.md) `== true`ならば、[`std::move`](/reference/utility/move.md)`(val)` +- (1), (2) : 正常値を保持していたら、`val` +- (3), (4) : 正常値を保持していたら、[`std::move`](/reference/utility/move.md)`(val)` ## 例外 -- (1), (2) : [`has_value()`](has_value.md) `== false`ならば、例外[`bad_expected_access`](../bad_expected_access.md)`(`[`error()`](error.md)`)`をスローする -- (3), (4) : [`has_value()`](has_value.md) `== false`ならば、例外[`bad_expected_access`](../bad_expected_access.md)`(`[`std::move`](/reference/utility/move.md)`(`[`error()`](error.md)`))`をスローする +- (1), (2) : エラー値を保持していたら、例外[`bad_expected_access`](../bad_expected_access.md)`(`[`error()`](error.md)`)`をスローする +- (3), (4) : エラー値を保持していたら、例外[`bad_expected_access`](../bad_expected_access.md)`(`[`std::move`](/reference/utility/move.md)`(`[`error()`](error.md)`))`をスローする ## 例 From 88c024464a199aa995fdfc422f9d4c4da216c048 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 2 Feb 2023 00:02:13 +0900 Subject: [PATCH 0143/3948] =?UTF-8?q?print(ln)=20:=20=E5=87=BA=E5=8A=9B?= =?UTF-8?q?=E5=85=88=E3=82=92=E6=8C=87=E5=AE=9A=E3=81=99=E3=82=8B=E4=BE=8B?= =?UTF-8?q?=E3=80=81=E3=83=A2=E3=82=B8=E3=83=A5=E3=83=BC=E3=83=AB=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=83=9D=E3=83=BC=E3=83=88=E3=81=AE=E4=BE=8B=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/print/print.md | 25 ++++++++++++++++++++++++- reference/print/println.md | 25 ++++++++++++++++++++++++- 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/reference/print/print.md b/reference/print/print.md index 088c0647bd..da96a425dc 100644 --- a/reference/print/print.md +++ b/reference/print/print.md @@ -84,19 +84,42 @@ namespace std { ## 例 +### 基本的な使い方 ```cpp example #include int main() { std::print("Hello {} World\n", 42); + + // 出力先を指定 + std::print(stdout, "Hello {} World\n", 42); // 標準出力に出力 + std::print(stderr, "Hello {} World\n", 42); // 標準エラーに出力 } ``` * std::print[color ff0000] -### 出力 +#### 出力 ``` Hello 42 World +Hello 42 World +Hello 42 World +``` + +### モジュールをインポートする例 +```cpp example +#import std; +#import std.compat; + +int main() +{ + std::print("Hello {} World\n", 42); // OK + + // stdout / stderrはマクロとして定義される。 + // モジュールはマクロをエクスポートしないので、 + // stdout / stderrは使用できない + std::print(stdout, "Hello {} World\n", 42); // エラー!stdoutが見つからない +} ``` ## バージョン diff --git a/reference/print/println.md b/reference/print/println.md index 5ecd8f35ac..e588f774d2 100644 --- a/reference/print/println.md +++ b/reference/print/println.md @@ -52,19 +52,42 @@ namespace std { ## 例 +### 基本的な使い方 ```cpp example #include int main() { std::println("Hello {} World", 42); + + // 出力先を指定 + std::println(stdout, "Hello {} World", 42); // 標準出力に出力 + std::println(stderr, "Hello {} World", 42); // 標準エラーに出力 } ``` * std::println[color ff0000] -### 出力 +#### 出力 ``` Hello 42 World +Hello 42 World +Hello 42 World +``` + +### モジュールをインポートする例 +```cpp example +import std; +import std.compat; + +int main() +{ + std::println("Hello {} World", 42); // OK + + // stdout / stderrはマクロとして定義される。 + // モジュールはマクロをエクスポートしないので、 + // stdout / stderrは使用できない + std::println(stdout, "Hello {} World", 42); // エラー!stdoutが見つからない +} ``` ## バージョン From bc47b38c8e7d7a4e56a6783240de300d0d5cac84 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 2 Feb 2023 00:03:37 +0900 Subject: [PATCH 0144/3948] =?UTF-8?q?=E3=81=AEprint(ln)=20:=20?= =?UTF-8?q?=E5=87=BA=E5=8A=9B=E5=85=88=E3=82=92=E6=8C=87=E5=AE=9A=E3=81=99?= =?UTF-8?q?=E3=82=8B=E4=BE=8B=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ostream/print.md | 4 +++- reference/ostream/println.md | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/reference/ostream/print.md b/reference/ostream/print.md index 507b72ead9..c796974888 100644 --- a/reference/ostream/print.md +++ b/reference/ostream/print.md @@ -77,7 +77,8 @@ namespace std { int main() { - std::print(std::cout, "Hello {} World\n", 42); + std::print(std::cout, "Hello {} World\n", 42); // 標準出力に出力 + std::print(std::cerr, "Hello {} World\n", 42); // 標準エラーに出力 } ``` * std::print[color ff0000] @@ -85,6 +86,7 @@ int main() ### 出力 ``` Hello 42 World +Hello 42 World ``` ## バージョン diff --git a/reference/ostream/println.md b/reference/ostream/println.md index 7924f33b3c..1f3f7cc860 100644 --- a/reference/ostream/println.md +++ b/reference/ostream/println.md @@ -45,7 +45,8 @@ namespace std { int main() { - std::println(std::cout, "Hello {} World", 42); + std::println(std::cout, "Hello {} World", 42); // 標準出力に出力 + std::println(std::cerr, "Hello {} World", 42); // 標準エラーに出力 } ``` * std::println[color ff0000] @@ -53,6 +54,7 @@ int main() ### 出力 ``` Hello 42 World +Hello 42 World ``` ## バージョン From a689c6b126c827101cda6035cb83100609953f65 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 2 Feb 2023 01:06:43 +0900 Subject: [PATCH 0145/3948] =?UTF-8?q?print(ln)=20:=20=E3=82=B3=E3=83=B3?= =?UTF-8?q?=E3=83=91=E3=82=A4=E3=83=AB=E3=82=A8=E3=83=A9=E3=83=BC=E8=A1=8C?= =?UTF-8?q?=E3=82=92=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88=E3=82=A2=E3=82=A6?= =?UTF-8?q?=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/print/print.md | 7 ++++++- reference/print/println.md | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/reference/print/print.md b/reference/print/print.md index da96a425dc..0f4624814b 100644 --- a/reference/print/print.md +++ b/reference/print/print.md @@ -118,10 +118,15 @@ int main() // stdout / stderrはマクロとして定義される。 // モジュールはマクロをエクスポートしないので、 // stdout / stderrは使用できない - std::print(stdout, "Hello {} World\n", 42); // エラー!stdoutが見つからない + // std::print(stdout, "Hello {} World\n", 42); // エラー!stdoutが見つからない } ``` +#### 出力 +``` +Hello 42 World +``` + ## バージョン ### 言語 - C++23 diff --git a/reference/print/println.md b/reference/print/println.md index e588f774d2..c352e6dc84 100644 --- a/reference/print/println.md +++ b/reference/print/println.md @@ -86,10 +86,15 @@ int main() // stdout / stderrはマクロとして定義される。 // モジュールはマクロをエクスポートしないので、 // stdout / stderrは使用できない - std::println(stdout, "Hello {} World", 42); // エラー!stdoutが見つからない + // std::println(stdout, "Hello {} World", 42); // エラー!stdoutが見つからない } ``` +#### 出力 +``` +Hello 42 World +``` + ## バージョン ### 言語 - C++23 From 41369956550951a19b948397109d022c383e7f3d Mon Sep 17 00:00:00 2001 From: yumetodo Date: Thu, 2 Feb 2023 16:08:21 +0900 Subject: [PATCH 0146/3948] =?UTF-8?q?feat:=20std::bind=E3=81=A7=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=90=E3=83=BC=E9=96=A2=E6=95=B0=E3=82=92=E5=91=BC?= =?UTF-8?q?=E3=81=B3=E5=87=BA=E3=81=99=E6=96=B9=E6=B3=95=E3=82=92=E4=BE=8B?= =?UTF-8?q?=E3=81=AB=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/functional/bind.md | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/reference/functional/bind.md b/reference/functional/bind.md index 0201f34931..9808b53cc0 100644 --- a/reference/functional/bind.md +++ b/reference/functional/bind.md @@ -66,16 +66,34 @@ int add(int a, int b, int c) return a + b + c; } +class Foo { +public: + int n; + Foo(int n) : n(n) {} + Foo add(int n2) const + { + return this->n + n2; + } +}; + int main() { // 第1引数のみを先に渡す using namespace std::placeholders; - std::function f = std::bind(add, 2, _1, _2); + std::function f1 = std::bind(add, 2, _1, _2); + + // 残りの引数を渡して関数を呼び出す + const int result1 = f1(3, 4); + + Foo foo{2}; + + // thisにするもののみを先に渡す + std::function f2 = std::bind(&Foo::add, foo, _1); // 残りの引数を渡して関数を呼び出す - const int result = f(3, 4); + const auto result2 = f2(3); - std::cout << result << std::endl; + std::cout << result1 << ',' << result2.n << std::endl; } ``` * std::bind[color ff0000] @@ -84,7 +102,7 @@ int main() ### 出力 ``` -9 +9,5 ``` ## バージョン From 40638a63cdf1948f5f77277d07f504a34e7f7974 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Thu, 2 Feb 2023 17:52:37 +0900 Subject: [PATCH 0147/3948] fix typo in constexpr_lambda.md --- lang/cpp17/constexpr_lambda.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp17/constexpr_lambda.md b/lang/cpp17/constexpr_lambda.md index ffc7e4cc50..1f5ec0f3ae 100644 --- a/lang/cpp17/constexpr_lambda.md +++ b/lang/cpp17/constexpr_lambda.md @@ -86,7 +86,7 @@ int main(){ constexpr lambdaはSFINAEの文脈で用いる事はできない。 -以下のような記述を許可してしまうとあらゆる文や式が実体化に成功するかをチェックでてしまうため、禁止されている。 +以下のような記述を許可してしまうとあらゆる文や式が実体化に成功するかをチェックできてしまうため、禁止されている。 ```cpp // エラー、SFINAEの文脈でconstexprラムダが使われている From 991f1aca8f13b5d922ae94a2c51cdf043591c870 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Fri, 3 Feb 2023 16:43:28 +0900 Subject: [PATCH 0148/3948] =?UTF-8?q?=E6=95=B4=E6=95=B0=E5=9E=8B=E6=AF=94?= =?UTF-8?q?=E8=BC=83=E9=96=A2=E6=95=B0=E3=81=AE=E8=AA=AC=E6=98=8E=E3=81=A8?= =?UTF-8?q?=E4=BE=8B=E3=81=AE=E6=94=B9=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/utility/cmp_equal.md | 10 +++++++--- reference/utility/cmp_greater.md | 10 +++++++--- reference/utility/cmp_greater_equal.md | 10 +++++++--- reference/utility/cmp_less.md | 2 +- reference/utility/cmp_less_equal.md | 9 ++++++--- reference/utility/cmp_not_equal.md | 10 +++++++--- 6 files changed, 35 insertions(+), 16 deletions(-) diff --git a/reference/utility/cmp_equal.md b/reference/utility/cmp_equal.md index 7bd6d53cec..a0ab1b9cd7 100644 --- a/reference/utility/cmp_equal.md +++ b/reference/utility/cmp_equal.md @@ -12,15 +12,19 @@ namespace std { ``` ## 概要 -整数を安全に等値比較する。 +整数を安全に等値比較(`t == u`)する。 この関数は、型`T`と型`U`がそれぞれ符号付き整数と符号なし整数のどちらであったとしても、安全に比較できる関数である。以下のように符号付き整数のインデックス変数と符号なし整数の配列要素数の比較によってコンパイラに警告が出力されてしまうような状況で使用できる: ```cpp std::vector v; +int N = 0; -// 警告:式`i < v.size()`で、符号付き整数と符号なし整数の間で比較しようとした -for (int i = 0; i < v.size(); ++i) {} +// 警告:式`i == v.size()`で、符号付き整数と符号なし整数の間で比較しようとした +if (N == v.size()) {} + +// OK +if (std::cmp_equal(N, v.size())) {} ``` diff --git a/reference/utility/cmp_greater.md b/reference/utility/cmp_greater.md index 78e8c92e39..4704f132b7 100644 --- a/reference/utility/cmp_greater.md +++ b/reference/utility/cmp_greater.md @@ -12,15 +12,19 @@ namespace std { ``` ## 概要 -整数に対して安全に、左辺が右辺より大きいかを比較する。 +整数に対して安全に、左辺が右辺より大きいかを比較(`t > u`)する。 この関数は、型`T`と型`U`がそれぞれ符号付き整数と符号なし整数のどちらであったとしても、安全に比較できる関数である。以下のように符号付き整数のインデックス変数と符号なし整数の配列要素数の比較によってコンパイラに警告が出力されてしまうような状況で使用できる: ```cpp std::vector v; +int N = 0; -// 警告:式`i < v.size()`で、符号付き整数と符号なし整数の間で比較しようとした -for (int i = 0; i < v.size(); ++i) {} +// 警告:式`N > v.size()`で、符号付き整数と符号なし整数の間で比較しようとした +while (N > v.size()) {} + +// OK +while (std::cmp_greater(N, v.size())) {} ``` diff --git a/reference/utility/cmp_greater_equal.md b/reference/utility/cmp_greater_equal.md index e85ea8eb96..9013db2a8a 100644 --- a/reference/utility/cmp_greater_equal.md +++ b/reference/utility/cmp_greater_equal.md @@ -12,15 +12,19 @@ namespace std { ``` ## 概要 -整数に対して安全に、左辺が右辺以上かを比較する。 +整数に対して安全に、左辺が右辺以上かを比較(`t >= u`)する。 この関数は、型`T`と型`U`がそれぞれ符号付き整数と符号なし整数のどちらであったとしても、安全に比較できる関数である。以下のように符号付き整数のインデックス変数と符号なし整数の配列要素数の比較によってコンパイラに警告が出力されてしまうような状況で使用できる: ```cpp std::vector v; +int N = 0; -// 警告:式`i < v.size()`で、符号付き整数と符号なし整数の間で比較しようとした -for (int i = 0; i < v.size(); ++i) {} +// 警告:式`N >= v.size()`で、符号付き整数と符号なし整数の間で比較しようとした +while (N >= v.size()) {} + +// OK +while (std::cmp_greater_equal(N, v.size())) {} ``` diff --git a/reference/utility/cmp_less.md b/reference/utility/cmp_less.md index e1e96ce308..3049c2f6be 100644 --- a/reference/utility/cmp_less.md +++ b/reference/utility/cmp_less.md @@ -12,7 +12,7 @@ namespace std { ``` ## 概要 -整数に対して安全に、左辺が右辺より小さいかを比較する。 +整数に対して安全に、左辺が右辺より小さいかを比較(`t < u`)する。 この関数は、型`T`と型`U`がそれぞれ符号付き整数と符号なし整数のどちらであったとしても、安全に比較できる関数である。以下のように符号付き整数のインデックス変数と符号なし整数の配列要素数の比較によってコンパイラに警告が出力されてしまうような状況で使用できる: diff --git a/reference/utility/cmp_less_equal.md b/reference/utility/cmp_less_equal.md index 22b3897bb5..1caa8cd4fc 100644 --- a/reference/utility/cmp_less_equal.md +++ b/reference/utility/cmp_less_equal.md @@ -12,15 +12,18 @@ namespace std { ``` ## 概要 -整数に対して安全に、左辺が右辺以下かを比較する。 +整数に対して安全に、左辺が右辺以下かを比較(`t <= u`)する。 この関数は、型`T`と型`U`がそれぞれ符号付き整数と符号なし整数のどちらであったとしても、安全に比較できる関数である。以下のように符号付き整数のインデックス変数と符号なし整数の配列要素数の比較によってコンパイラに警告が出力されてしまうような状況で使用できる: ```cpp std::vector v; -// 警告:式`i < v.size()`で、符号付き整数と符号なし整数の間で比較しようとした -for (int i = 0; i < v.size(); ++i) {} +// 警告:式`i <= v.size()`で、符号付き整数と符号なし整数の間で比較しようとした +for (int i = 0; i <= v.size(); ++i) {} + +// OK +for (int i = 0; cmp_less_equal(i, v.size()); ++i) {} ``` diff --git a/reference/utility/cmp_not_equal.md b/reference/utility/cmp_not_equal.md index 642235b502..5a6ca57548 100644 --- a/reference/utility/cmp_not_equal.md +++ b/reference/utility/cmp_not_equal.md @@ -12,15 +12,19 @@ namespace std { ``` ## 概要 -整数を安全に非等値比較する。 +整数を安全に非等値比較(`t != u`)する。 この関数は、型`T`と型`U`がそれぞれ符号付き整数と符号なし整数のどちらであったとしても、安全に比較できる関数である。以下のように符号付き整数のインデックス変数と符号なし整数の配列要素数の比較によってコンパイラに警告が出力されてしまうような状況で使用できる: ```cpp std::vector v; +int N = 0; -// 警告:式`i < v.size()`で、符号付き整数と符号なし整数の間で比較しようとした -for (int i = 0; i < v.size(); ++i) {} +// 警告:式`i != v.size()`で、符号付き整数と符号なし整数の間で比較しようとした +if (N != v.size()) {} + +// OK +if (std::cmp_not_equal(N, v.size())) {} ``` From 195bd060727c2a7b967255fa8afb06d2d37c57d7 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 3 Feb 2023 22:23:30 +0900 Subject: [PATCH 0149/3948] expected/expected: value_or,error_or(#1066) --- reference/expected/expected.md | 4 +- reference/expected/expected/error.md | 2 +- reference/expected/expected/error_or.md | 68 ++++++++++++++++++++++++ reference/expected/expected/op_arrow.md | 2 +- reference/expected/expected/op_deref.md | 2 +- reference/expected/expected/value.md | 2 +- reference/expected/expected/value_or.md | 70 +++++++++++++++++++++++++ 7 files changed, 144 insertions(+), 6 deletions(-) create mode 100644 reference/expected/expected/error_or.md create mode 100644 reference/expected/expected/value_or.md diff --git a/reference/expected/expected.md b/reference/expected/expected.md index a3ef99bf73..bcb33b6ab6 100644 --- a/reference/expected/expected.md +++ b/reference/expected/expected.md @@ -53,8 +53,8 @@ namespace std { | [`has_value`](expected/has_value.md) | 正常値を保持しているかを判定する | C++23 | | [`value`](expected/value.md) | 正常値を取得する | C++23 | | [`error`](expected/error.md) | エラー値を取得する | C++23 | -| [`value_or`](expected/value_or.md.nolink) | 正常値もしくは指定された値を取得する | C++23 | -| [`error_or`](expected/error_or.md.nolink) | エラー値もしくは指定された値を取得する | C++23 | +| [`value_or`](expected/value_or.md) | 正常値もしくは指定された値を取得する | C++23 | +| [`error_or`](expected/error_or.md) | エラー値もしくは指定された値を取得する | C++23 | ### モナド操作 diff --git a/reference/expected/expected/error.md b/reference/expected/expected/error.md index 75a60fe65c..0803dd3d94 100644 --- a/reference/expected/expected/error.md +++ b/reference/expected/expected/error.md @@ -67,7 +67,7 @@ ERR ## 関連項目 -- [`error_or`](error_or.md.nolink) +- [`error_or`](error_or.md) ## 参照 diff --git a/reference/expected/expected/error_or.md b/reference/expected/expected/error_or.md new file mode 100644 index 0000000000..e455fd3304 --- /dev/null +++ b/reference/expected/expected/error_or.md @@ -0,0 +1,68 @@ +# error_or +* expected[meta header] +* function template[meta id-type] +* std[meta namespace] +* expected[meta class] +* cpp23[meta cpp] + +```cpp +template constexpr T error_or(G&& e) const &; // (1) +template constexpr T error_or(G&& e) &&; // (2) +``` + +## 概要 +エラー値もしくは指定された値を取得する。 + + +## 適格要件 +- (1) : [`is_copy_constructible_v`](/reference/type_traits/is_copy_constructible.md)` == true &&` [`is_convertible_v`](/reference/type_traits/is_convertible.md)` == true` +- (2) : [`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)` == true &&` [`is_convertible_v`](/reference/type_traits/is_convertible.md)` == true` + + +## 戻り値 +- (1) : [`has_value()`](has_value.md) `?` [`std::forward`](/reference/utility/forward.md)`(e) :` [`error()`](error.md) +- (2) : [`has_value()`](has_value.md) `?` [`std::forward`](/reference/utility/forward.md)`(e) :` [`std::move`](/reference/utility/move.md)`(`[`error()`](error.md)`)` + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::expected x = 42; + std::cout << x.error_or("-") << std::endl; + + std::expected y = std::unexpected{"ERR"}; + std::cout << y.error_or("-") << std::endl; +} +``` +* error_or()[color ff0000] +* std::unexpected[link ../unexpected.md] + +### 出力 +``` +- +ERR +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.0 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`error()`](error.md) + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) diff --git a/reference/expected/expected/op_arrow.md b/reference/expected/expected/op_arrow.md index dc0a82aa5f..21f76bd96b 100644 --- a/reference/expected/expected/op_arrow.md +++ b/reference/expected/expected/op_arrow.md @@ -65,7 +65,7 @@ int main() ## 関連項目 - [`operator*`](op_deref.md) - [`value()`](value.md) -- [`value_or()`](value_or.md.nolink) +- [`value_or()`](value_or.md) ## 参照 diff --git a/reference/expected/expected/op_deref.md b/reference/expected/expected/op_deref.md index 02ef3b9bed..e26e01ebec 100644 --- a/reference/expected/expected/op_deref.md +++ b/reference/expected/expected/op_deref.md @@ -70,7 +70,7 @@ int main() ## 関連項目 - [`operator->`](op_arrow.md) - [`value()`](value.md) -- [`value_or()`](value_or.md.nolink) +- [`value_or()`](value_or.md) ## 参照 diff --git a/reference/expected/expected/value.md b/reference/expected/expected/value.md index 136b805c8d..8d2b2836d2 100644 --- a/reference/expected/expected/value.md +++ b/reference/expected/expected/value.md @@ -73,7 +73,7 @@ throw:ERR ## 関連項目 - [`operator->`](op_arrow.md) - [`operator*`](op_deref.md) -- [`value_or()`](value_or.md.nolink) +- [`value_or()`](value_or.md) ## 参照 diff --git a/reference/expected/expected/value_or.md b/reference/expected/expected/value_or.md new file mode 100644 index 0000000000..5922c5ec96 --- /dev/null +++ b/reference/expected/expected/value_or.md @@ -0,0 +1,70 @@ +# value_or +* expected[meta header] +* function template[meta id-type] +* std[meta namespace] +* expected[meta class] +* cpp23[meta cpp] + +```cpp +template constexpr T value_or(U&& v) const &; // (1) +template constexpr T value_or(U&& v) &&; // (2) +``` + +## 概要 +正常値もしくは指定された値を取得する。 + + +## 適格要件 +- (1) : [`is_copy_constructible_v`](/reference/type_traits/is_copy_constructible.md)` == true &&` [`is_convertible_v`](/reference/type_traits/is_convertible.md)` == true` +- (2) : [`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)` == true &&` [`is_convertible_v`](/reference/type_traits/is_convertible.md)` == true` + + +## 戻り値 +- (1) : [`has_value()`](has_value.md) `?` [`**this`](op_deref.md) `: static_cast(`[`std::forward`](/reference/utility/forward.md)`(v))` +- (2) : [`has_value()`](has_value.md) `?` [`std::move`](/reference/utility/move.md)`(`[`**this`](op_deref.md)`) : static_cast(`[`std::forward`](/reference/utility/forward.md)`(v))` + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::expected x = 42; + std::cout << x.value_or(0) << std::endl; + + std::expected y = std::unexpected{"ERR"}; + std::cout << y.value_or(0) << std::endl; +} +``` +* value_or()[color ff0000] +* std::unexpected[link ../unexpected.md] + +### 出力 +``` +42 +0 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`operator->`](op_arrow.md) +- [`operator*`](op_deref.md) +- [`value()`](value.md) + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) From b79bb56d63ecdfa3568ca85fa5568d1ecb355d53 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 3 Feb 2023 22:55:42 +0900 Subject: [PATCH 0150/3948] expected/expected: swap(#1066) --- reference/expected/expected.md | 2 +- reference/expected/expected/swap.md | 131 ++++++++++++++++++++++++++++ 2 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 reference/expected/expected/swap.md diff --git a/reference/expected/expected.md b/reference/expected/expected.md index bcb33b6ab6..ecb45517a9 100644 --- a/reference/expected/expected.md +++ b/reference/expected/expected.md @@ -41,7 +41,7 @@ namespace std { |-----------------|----------------|-------| | [`operator=`](expected/op_assign.md) | 代入演算子 | C++23 | | [`emplace`](expected/emplace.md) | 正常値型のコンストラクタ引数から直接構築する | C++23 | -| [`swap`](expected/swap.md.nolink) | 他の`expected`オブジェクトとデータを入れ替える | C++23 | +| [`swap`](expected/swap.md) | 他の`expected`オブジェクトとデータを入れ替える | C++23 | ### 値の観測 diff --git a/reference/expected/expected/swap.md b/reference/expected/expected/swap.md new file mode 100644 index 0000000000..7a270c1f4c --- /dev/null +++ b/reference/expected/expected/swap.md @@ -0,0 +1,131 @@ +# swap +* expected[meta header] +* function[meta id-type] +* std[meta namespace] +* expected[meta class] +* cpp23[meta cpp] + +```cpp +constexpr void swap(expected& rhs) noexcept(see below); +``` +* see below[italic] + +## 概要 +他の`expected`オブジェクトとデータを入れ替える。 + +動作説明用の`expected`クラスメンバ変数として、下記を導入する。 + +- `val` : `T`型の正常値。 +- `unex` : `E`型のエラー値。 +- `has_val` : `bool`型のフラグ変数。正常値を保持する場合は`true`に、エラー値を保持する場合は`false`となる。 + + +## テンプレートパラメータ制約 +次の制約を全て満たすこと + +- [`is_swappable_v`](/reference/type_traits/is_swappable.md)` == true` +- [`is_swappable_v`](/reference/type_traits/is_swappable.md)` == true` +- `(`[`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)` &&` [`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)`) == true` +- `(`[`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)` &&` [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)`) == true` + + +## 効果 +`*this`と`rhs`それぞれが正常値/エラー値いずれを保持しているかに応じて、以下の効果を持つ。 + +- `*this`と`rhs`ともに正常値を保持していれば、次と等価 : `using std::swap;` [`swap`](/reference/utility/swap.md)`(val, rhs.val);` +- `*this`と`rhs`ともにエラー値を保持していれば、次と等価 : `using std::swap;` [`swap`](/reference/utility/swap.md)`(unex, rhs.unex);` +- `*this`がエラー値を`rhs`が正常値を保持していれば、次と等価 : `rhs.swap(*this);` +- `*this`が正常値を`rhs`がエラー値を保持していれば、次と等価 : + ```cpp + if constexpr (is_nothrow_move_constructible_v) { + E tmp(std::move(rhs.unex)); + destroy_at(addressof(rhs.unex)); + try { + construct_at(addressof(rhs.val), std::move(val)); + destroy_at(addressof(val)); + construct_at(addressof(unex), std::move(tmp)); + } catch(...) { + construct_at(addressof(rhs.unex), std::move(tmp)); + throw; + } + } else { + T tmp(std::move(val)); + destroy_at(addressof(val)); + try { + construct_at(addressof(unex), std::move(rhs.unex)); + destroy_at(addressof(rhs.unex)); + construct_at(addressof(rhs.val), std::move(tmp)); + } catch (...) { + construct_at(addressof(val), std::move(tmp)); + throw; + } + } + has_val = false; + rhs.has_val = true; + ``` + * addressof[link /reference/memory/addressof.md] + * construct_at[link /reference/memory/construct_at.md] + * destroy_at[link /reference/memory/destroy_at.md] + * std::move[link /reference/utility/move.md] + * is_nothrow_move_constructible_v[link /reference/type_traits/is_nothrow_move_constructible.md] + + +## 戻り値 +なし + + +## 例外 +noexcept例外指定は次の式に従う : + +[`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)` &&` [`is_nothrow_swappable_v`](/reference/type_traits/is_nothrow_swappable.md)` &&` [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)` &&` [`is_nothrow_swappable_v`](/reference/type_traits/is_nothrow_swappable.md)`` + +noexcept例外指定が`false`の場合、上記の「効果」による処理からの例外がスローされる。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::expected x = 42; + std::expected y = std::unexpected{"ERR"}; + assert(x.value() == 42 && y.error() == "ERR"); + + x.swap(y); + assert(x.error() == "ERR" && y.value() == 42); +} +``` +* swap[color ff0000] +* value()[link value.md] +* error()[link error.md] +* std::unexpected[link ../unexpected.md] + +### 出力 +``` +42 +0 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`operator->`](op_arrow.md) +- [`operator*`](op_deref.md) +- [`value()`](value.md) + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) From 74c922fff6904c42e88adb04f497dff5fa3088dc Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 3 Feb 2023 23:09:58 +0900 Subject: [PATCH 0151/3948] =?UTF-8?q?expected/expected:=20swap=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3(#1066)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/expected/expected/swap.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/expected/expected/swap.md b/reference/expected/expected/swap.md index 7a270c1f4c..8df15366e6 100644 --- a/reference/expected/expected/swap.md +++ b/reference/expected/expected/swap.md @@ -25,15 +25,15 @@ constexpr void swap(expected& rhs) noexcept(see below); - [`is_swappable_v`](/reference/type_traits/is_swappable.md)` == true` - [`is_swappable_v`](/reference/type_traits/is_swappable.md)` == true` -- `(`[`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)` &&` [`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)`) == true` -- `(`[`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)` &&` [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)`) == true` +- `(`[`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)` &&` [`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)`) == true` +- `(`[`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)` ||` [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)`) == true` ## 効果 `*this`と`rhs`それぞれが正常値/エラー値いずれを保持しているかに応じて、以下の効果を持つ。 -- `*this`と`rhs`ともに正常値を保持していれば、次と等価 : `using std::swap;` [`swap`](/reference/utility/swap.md)`(val, rhs.val);` -- `*this`と`rhs`ともにエラー値を保持していれば、次と等価 : `using std::swap;` [`swap`](/reference/utility/swap.md)`(unex, rhs.unex);` +- `*this`と`rhs`ともに正常値を保持していれば、次と等価 : `using` [`std::swap`](/reference/utility/swap.md)`; swap(val, rhs.val);` +- `*this`と`rhs`ともにエラー値を保持していれば、次と等価 : `using` [`std::swap`](/reference/utility/swap.md)`; swap(unex, rhs.unex);` - `*this`がエラー値を`rhs`が正常値を保持していれば、次と等価 : `rhs.swap(*this);` - `*this`が正常値を`rhs`がエラー値を保持していれば、次と等価 : ```cpp From 7a5214d449873dbd48f51bb2a022775430b6aa89 Mon Sep 17 00:00:00 2001 From: yoh Date: Sat, 4 Feb 2023 23:35:54 +0900 Subject: [PATCH 0152/3948] expected/expected: and_then,or_else,transform,transform_error(#1066) --- reference/expected/expected.md | 10 +- reference/expected/expected/and_then.md | 121 +++++++++++++++++ reference/expected/expected/or_else.md | 125 ++++++++++++++++++ reference/expected/expected/transform.md | 99 ++++++++++++++ .../expected/expected/transform_error.md | 94 +++++++++++++ 5 files changed, 445 insertions(+), 4 deletions(-) create mode 100644 reference/expected/expected/and_then.md create mode 100644 reference/expected/expected/or_else.md create mode 100644 reference/expected/expected/transform.md create mode 100644 reference/expected/expected/transform_error.md diff --git a/reference/expected/expected.md b/reference/expected/expected.md index ecb45517a9..018ba23804 100644 --- a/reference/expected/expected.md +++ b/reference/expected/expected.md @@ -60,10 +60,10 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`and_then`](expected/and_then.md.nolink) | 正常値に対して関数を適用する | C++23 | -| [`or_else`](expected/or_else.md.nolink) | エラー値に対して関数を適用する | C++23 | -| [`transform`](expected/transform.md.nolink) | 正常値を変換する | C++23 | -| [`transform_error`](expected/transform_error.md.nolink) | エラー値を変換する | C++23 | +| [`and_then`](expected/and_then.md) | 正常値に対して関数を適用する | C++23 | +| [`or_else`](expected/or_else.md) | エラー値に対して関数を適用する | C++23 | +| [`transform`](expected/transform.md) | 正常値を変換する | C++23 | +| [`transform_error`](expected/transform_error.md) | エラー値を変換する | C++23 | ### 比較 @@ -120,6 +120,8 @@ int main() ``` * std::expected[color ff0000] * std::unexpected[link unexpected.md] +* *v[link expected/op_deref.md] +* v.error()[link expected/error.md] * std::quoted[link ../iomanip/quoted.md] ### 出力 diff --git a/reference/expected/expected/and_then.md b/reference/expected/expected/and_then.md new file mode 100644 index 0000000000..4f0062460f --- /dev/null +++ b/reference/expected/expected/and_then.md @@ -0,0 +1,121 @@ +# and_then +* expected[meta header] +* function template[meta id-type] +* std[meta namespace] +* expected[meta class] +* cpp23[meta cpp] + +```cpp +template constexpr auto and_then(F&& f) &; // (1) +template constexpr auto and_then(F&& f) const &; // (2) +template constexpr auto and_then(F&& f) &&; // (3) +template constexpr auto and_then(F&& f) const &&; // (4) +``` + +## 概要 +正常値を保持していれば、正常値に対して`f`を適用した結果を`expected`として返す。 +エラー値を保持していれば、そのまま返す。 + + +## テンプレートパラメータ制約 +- (1), (2) : [`is_copy_constructible_v`](/reference/type_traits/is_copy_constructible.md)` == true` +- (3), (4) : [`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)` == true` + + +## 適格要件 +- (1), (2) : 型`U`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`>`としたとき、次を全て満たすこと + - `U`が`expected`の特殊化である + - [`is_same_v`](/reference/type_traits/is_same.md)` == true` +- (3), (4) : 型`U`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`>`としたとき、次を全て満たすこと + - `U`が`expected`の特殊化である + - [`is_same_v`](/reference/type_traits/is_same.md)` == true` + + +## 効果 +- (1), (2) : 次の処理と等価 + ```cpp + if (has_value()) + return invoke(std::forward(f), value()); + else + return U(unexpect, error()); + ``` + * has_value[link has_value.md] + * value()[link value.md] + * error()[link error.md] + * unexpect[link ../unexpect_t.md] + * invoke[link /reference/functional/invoke.md] + * std::forward[link /reference/utility/forward.md] + +- (3), (4) : 次の処理と等価 + ```cpp + if (has_value()) + return invoke(std::forward(f), std::move(value())); + else + return U(unexpect, std::move(error())); + ``` + * has_value[link has_value.md] + * value()[link value.md] + * error()[link error.md] + * unexpect[link ../unexpect_t.md] + * invoke[link /reference/functional/invoke.md] + * std::forward[link /reference/utility/forward.md] + * std::move[link /reference/utility/move.md] + + +## 例 +```cpp example +#include +#include +#include + +// 正数なら2倍/それ以外はエラー値を返す関数 +std::expected twice(int n) +{ + if (0 < n) { + return n * 2; + } else { + return std::unexpected{"out of domain"}; + } +} + +int main() +{ + std::expected v1 = 1; + assert(v1.and_then(twice).value() == 2); + + std::expected v2 = 0; + assert(v2.and_then(twice).error() == "out of domain"); + + std::expected e1 = std::unexpected{"NaN"}; + assert(e1.and_then(twice).error() == "NaN"); +} +``` +* and_then[color ff0000] +* value()[link value.md] +* error()[link error.md] +* std::unexpected[link ../unexpected.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.0 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`or_else()`](or_else.md) +- [`transform()`](transform.md) +- [`transform_error()`](transform_error.md) + + +## 参照 +- [P2505R5 Monadic Functions for `std::expected`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2505r5.html) diff --git a/reference/expected/expected/or_else.md b/reference/expected/expected/or_else.md new file mode 100644 index 0000000000..9cac724960 --- /dev/null +++ b/reference/expected/expected/or_else.md @@ -0,0 +1,125 @@ +# or_else +* expected[meta header] +* function template[meta id-type] +* std[meta namespace] +* expected[meta class] +* cpp23[meta cpp] + +```cpp +template constexpr auto or_else(F&& f) &; // (1) +template constexpr auto or_else(F&& f) const &; // (2) +template constexpr auto or_else(F&& f) &&; // (3) +template constexpr auto or_else(F&& f) const &&; // (4) +``` + +## 概要 +エラー値を保持していれば、エラー値に対して`f`を適用した結果を`expected`として返す。 +正常値を保持していれば、そのまま返す。 + + +## テンプレートパラメータ制約 +- (1), (2) : [`is_copy_constructible_v`](/reference/type_traits/is_copy_constructible.md)` == true` +- (3), (4) : [`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)` == true` + + +## 適格要件 +- (1), (2) : 型`G`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`>`としたとき、次を全て満たすこと + - `G`が`expected`の特殊化である + - [`is_same_v`](/reference/type_traits/is_same.md)` == true` +- (3), (4) : 型`G`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`>`としたとき、次を全て満たすこと + - `G`が`expected`の特殊化である + - [`is_same_v`](/reference/type_traits/is_same.md)` == true` + + +## 効果 +- (1), (2) : 次の処理と等価 + ```cpp + if (has_value()) + return G(in_place, value()); + else + return invoke(std::forward(f), error()); + ``` + * has_value()[link has_value.md] + * value()[link value.md] + * error()[link error.md] + * invoke[link /reference/functional/invoke.md] + * in_place[link /reference/utility/in_place_t.md] + * std::forward[link /reference/utility/forward.md] + +- (3), (4) : 次の処理と等価 + ```cpp + if (has_value()) + return G(in_place, std::move(value())); + else + return invoke(std::forward(f), std::move(error())); + ``` + * has_value()[link has_value.md] + * value()[link value.md] + * error()[link error.md] + * invoke[link /reference/functional/invoke.md] + * in_place[link /reference/utility/in_place_t.md] + * std::forward[link /reference/utility/forward.md] + * std::move[link /reference/utility/move.md] + + +## 例 +```cpp example +#include +#include +#include +#include +#include + +// 文字列を正常値(数値)として再解釈する関数 +std::expected parse(std::string_view s) +{ + int val{}; + auto [ptr, ec] = std::from_chars(s.begin(), s.end(), val); + if (ec == std::errc{} && ptr == s.end()) { + return val; + } else { + return std::unexpected{s}; + } +} + +int main() +{ + std::expected v1 = 1; + assert(v1.or_else(parse).value() == 1); + + std::expected e1 = std::unexpected{"123"}; + assert(e1.or_else(parse) == 123); + + std::expected e2 = std::unexpected{"bad"}; + assert(e2.or_else(parse).error() == "bad"); +} +``` +* or_else[color ff0000] +* value()[link value.md] +* error()[link error.md] +* std::unexpected[link ../unexpected.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.0 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`and_then()`](and_then.md) +- [`transform()`](transform.md) +- [`transform_error()`](transform_error.md) + + +## 参照 +- [P2505R5 Monadic Functions for `std::expected`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2505r5.html) diff --git a/reference/expected/expected/transform.md b/reference/expected/expected/transform.md new file mode 100644 index 0000000000..13f65dfbdc --- /dev/null +++ b/reference/expected/expected/transform.md @@ -0,0 +1,99 @@ +# transform +* expected[meta header] +* function template[meta id-type] +* std[meta namespace] +* expected[meta class] +* cpp23[meta cpp] + +```cpp +template constexpr auto transform(F&& f) &; // (1) +template constexpr auto transform(F&& f) const &; // (2) +template constexpr auto transform(F&& f) &&; // (3) +template constexpr auto transform(F&& f) const &&; // (4) +``` + +## 概要 +正常値を保持していれば、正常値に対して`f`を適用した結果を`expected`の正常値として格納して返す。 +エラー値を保持していれば、そのまま返す。 + + +## テンプレートパラメータ制約 +- (1), (2) : [`is_copy_constructible_v`](/reference/type_traits/is_copy_constructible.md)` == true` +- (3), (4) : [`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)` == true` + + +## 適格要件 +- (1), (2) : 型`U`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`>`としたとき、次を全て満たすこと + - `U`が`expected`の有効な正常値型である + - [`is_void_t`](/reference/type_traits/is_void.md)` == false`のとき、宣言`U u(`[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`value()`](value.md)`));`が妥当である +- (3), (4) : 型`U`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`>`としたとき、次を全て満たすこと + - `U`が`expected`の有効な正常値型である + - [`is_void_t`](/reference/type_traits/is_void.md)` == false`のとき、宣言`U u(`[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`std::move`](/reference/utility/move.md)`(`[`value()`](value.md)`)));`が妥当である + + +## 効果 +- (1), (2) : 次の効果をもつ + - エラー値を保持していたら、`expected(`[`unexpect`](../unexpect_t.md)`,` [`error()`](error.md)`)`を返す。 + - 型`U`が(CV修飾された)`void`でなければ、正常値を[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`value()`](value.md)`)`で非直接リスト初期化した`expected`オブジェクトを返す。 + - そうでなければ、[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`value()`](value.md)`)`を評価し、`expected()`を返す。 + +- (3), (4) : 次の効果をもつ + - エラー値を保持していたら、`expected(`[`unexpect`](../unexpect_t.md)`,` [`std::move`](/reference/utility/move.md)`(`[`error()`](error.md)`))`を返す。 + - 型`U`が(CV修飾された)`void`でなければ、正常値を[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`std::move`](/reference/utility/move.md)`(`[`value()`](value.md)`))`で非直接リスト初期化した`expected`オブジェクトを返す。 + - そうでなければ、[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`std::move`](/reference/utility/move.md)`(`[`value()`](value.md)`))`を評価し、`expected()`を返す。 + + +## 例 +```cpp example +#include +#include +#include +#include +#include + +// 1..N数列を生成する関数 +std::vector make_seq(int n) +{ + std::vector seq(n, 0); + std::iota(seq.begin(), seq.end(), 1); + return seq; +} + +int main() +{ + std::expected v1 = 3; + assert((v1.transform(make_seq).value() == std::vector{1,2,3})); + + std::expected e1 = std::unexpected{"NaN"}; + assert(e1.transform(make_seq).error() == "NaN"); +} +``` +* transform[color ff0000] +* value()[link value.md] +* error()[link error.md] +* std::unexpected[link ../unexpected.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.0 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`and_then()`](and_then.md) +- [`or_else()`](or_else.md) +- [`transform_error()`](transform_error.md) + + +## 参照 +- [P2505R5 Monadic Functions for `std::expected`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2505r5.html) diff --git a/reference/expected/expected/transform_error.md b/reference/expected/expected/transform_error.md new file mode 100644 index 0000000000..160c97d4b0 --- /dev/null +++ b/reference/expected/expected/transform_error.md @@ -0,0 +1,94 @@ +# transform_error +* expected[meta header] +* function template[meta id-type] +* std[meta namespace] +* expected[meta class] +* cpp23[meta cpp] + +```cpp +template constexpr auto transform_error(F&& f) &; // (1) +template constexpr auto transform_error(F&& f) const &; // (2) +template constexpr auto transform_error(F&& f) &&; // (3) +template constexpr auto transform_error(F&& f) const &&; // (4) +``` + +## 概要 +エラー値を保持していれば、エラー値に対して`f`を適用した結果を`expected`のエラー値として格納して返す。 +正常値を保持していれば、そのまま返す。 + + +## テンプレートパラメータ制約 +- (1), (2) : [`is_copy_constructible_v`](/reference/type_traits/is_copy_constructible.md)` == true` +- (3), (4) : [`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)` == true` + + +## 適格要件 +- (1), (2) : 型`G`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`>`としたとき、次を全て満たすこと + - `G`が`expected`の有効な値型である + - 宣言`G g(`[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`error()`](error.md)`));`が妥当である +- (3), (4) : 型`G`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`>`としたとき、次を全て満たすこと + - `G`が`expected`の有効な値型である + - 宣言`G g(`[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`std::move`](/reference/utility/move.md)`(`[`error()`](error.md)`)));`が妥当である + + +## 効果 +- (1), (2) : 次の効果をもつ + - 正常値を保持していたら、`expected(`[`in_place`](/reference/utility/in_place_t.md)`,` [`value()`](value.md)`)`を返す。 + - エラー値を[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`error()`](error.md)`)`で非直接リスト初期化した`expected`オブジェクトを返す。 +- (3), (4) : 次の効果をもつ + - エラー値を保持していたら、`expected(`[`unexpect`](../unexpect_t.md)`,` [`std::move`](/reference/utility/move.md)`(`[`error()`](error.md)`))`を返す。 + - 正常値を[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`std::move`](/reference/utility/move.md)`(`[`error()`](error.md)`))`で非直接リスト初期化した`expected`オブジェクトを返す。 + + +## 例 +```cpp example +#include +#include +#include +#include + +// 文字列を逆順に並べ替える関数 +std::string revstr(std::string str) +{ + std::reverse(str.begin(), str.end()); + return str; +} + +int main() +{ + std::expected v1 = 42; + assert(v1.transform_error(revstr).value() == 42); + + std::expected e1 = std::unexpected{"Oops"}; + assert(e1.transform_error(revstr).error() == "spoO"); +} +``` +* transform_error[color ff0000] +* value()[link value.md] +* error()[link error.md] +* std::unexpected[link ../unexpected.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.0 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`and_then()`](and_then.md) +- [`or_else()`](or_else.md) +- [`transform()`](transform.md) + + +## 参照 +- [P2505R5 Monadic Functions for `std::expected`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2505r5.html) From c7fe7e269cffd85cbe741ba50482628f0840c716 Mon Sep 17 00:00:00 2001 From: yoh Date: Sun, 5 Feb 2023 11:16:16 +0900 Subject: [PATCH 0153/3948] =?UTF-8?q?expected/expected:=20MonadicOperators?= =?UTF-8?q?=E8=AA=BF=E6=95=B4(#1066)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/expected/expected/and_then.md | 16 ++++++++++++ reference/expected/expected/or_else.md | 18 +++++++++++++ reference/expected/expected/transform.md | 21 +++++++++++++--- .../expected/expected/transform_error.md | 25 ++++++++++++++++--- 4 files changed, 73 insertions(+), 7 deletions(-) diff --git a/reference/expected/expected/and_then.md b/reference/expected/expected/and_then.md index 4f0062460f..358fdfb1bc 100644 --- a/reference/expected/expected/and_then.md +++ b/reference/expected/expected/and_then.md @@ -16,6 +16,18 @@ template constexpr auto and_then(F&& f) const &&; // (4) 正常値を保持していれば、正常値に対して`f`を適用した結果を`expected`として返す。 エラー値を保持していれば、そのまま返す。 +実際には複数オーバーロードが提供されるが、大まかには下記シグニチャのようにみなせる。 +`and_then`へは、引数リストに1個の`T`型をとり`std::expected`型を返す関数や関数オブジェクトを与える。 + +```cpp +template +class expected { + template + std::expected and_then(function(T)> func); +}; +``` +* function[link /reference/functional/function.md] + ## テンプレートパラメータ制約 - (1), (2) : [`is_copy_constructible_v`](/reference/type_traits/is_copy_constructible.md)` == true` @@ -62,6 +74,10 @@ template constexpr auto and_then(F&& f) const &&; // (4) * std::move[link /reference/utility/move.md] +## 備考 +`and_then`は、メソッドチェーンをサポートするモナド風(monadic)操作として導入された。 + + ## 例 ```cpp example #include diff --git a/reference/expected/expected/or_else.md b/reference/expected/expected/or_else.md index 9cac724960..8c7b08d780 100644 --- a/reference/expected/expected/or_else.md +++ b/reference/expected/expected/or_else.md @@ -16,6 +16,18 @@ template constexpr auto or_else(F&& f) const &&; // (4) エラー値を保持していれば、エラー値に対して`f`を適用した結果を`expected`として返す。 正常値を保持していれば、そのまま返す。 +実際には複数オーバーロードが提供されるが、大まかには下記シグニチャのようにみなせる。 +`or_else`へは、引数リストに1個の`E`型をとり`std::expected`型を返す関数や関数オブジェクトを与える。 + +```cpp +template +class expected { + template + std::expected or_else(function(E)> func); +}; +``` +* function[link /reference/functional/function.md] + ## テンプレートパラメータ制約 - (1), (2) : [`is_copy_constructible_v`](/reference/type_traits/is_copy_constructible.md)` == true` @@ -62,6 +74,10 @@ template constexpr auto or_else(F&& f) const &&; // (4) * std::move[link /reference/utility/move.md] +## 備考 +`or_else`は、メソッドチェーンをサポートするモナド風(monadic)操作として導入された。 + + ## 例 ```cpp example #include @@ -98,6 +114,8 @@ int main() * value()[link value.md] * error()[link error.md] * std::unexpected[link ../unexpected.md] +* std::from_chars[link /reference/charconv/from_chars.md] +* std::errc[link /reference/system_error/errc.md] ### 出力 ``` diff --git a/reference/expected/expected/transform.md b/reference/expected/expected/transform.md index 13f65dfbdc..74439250db 100644 --- a/reference/expected/expected/transform.md +++ b/reference/expected/expected/transform.md @@ -16,6 +16,18 @@ template constexpr auto transform(F&& f) const &&; // (4) 正常値を保持していれば、正常値に対して`f`を適用した結果を`expected`の正常値として格納して返す。 エラー値を保持していれば、そのまま返す。 +実際には複数オーバーロードが提供されるが、大まかには下記シグニチャのようにみなせる。 +`transform`へは、引数リストに1個の`T`型をとり`Return`型を返す関数や関数オブジェクトを与える。 + +```cpp +template +class expected { + template + std::expected transform(function func); +}; +``` +* function[link /reference/functional/function.md] + ## テンプレートパラメータ制約 - (1), (2) : [`is_copy_constructible_v`](/reference/type_traits/is_copy_constructible.md)` == true` @@ -25,10 +37,10 @@ template constexpr auto transform(F&& f) const &&; // (4) ## 適格要件 - (1), (2) : 型`U`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`>`としたとき、次を全て満たすこと - `U`が`expected`の有効な正常値型である - - [`is_void_t`](/reference/type_traits/is_void.md)` == false`のとき、宣言`U u(`[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`value()`](value.md)`));`が妥当である + - `U`が(CV修飾された)`void`ではないとき、宣言`U u(`[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`value()`](value.md)`));`が妥当である - (3), (4) : 型`U`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`>`としたとき、次を全て満たすこと - `U`が`expected`の有効な正常値型である - - [`is_void_t`](/reference/type_traits/is_void.md)` == false`のとき、宣言`U u(`[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`std::move`](/reference/utility/move.md)`(`[`value()`](value.md)`)));`が妥当である + - `U`が(CV修飾された)`void`ではないとき、宣言`U u(`[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`std::move`](/reference/utility/move.md)`(`[`value()`](value.md)`)));`が妥当である ## 効果 @@ -36,13 +48,16 @@ template constexpr auto transform(F&& f) const &&; // (4) - エラー値を保持していたら、`expected(`[`unexpect`](../unexpect_t.md)`,` [`error()`](error.md)`)`を返す。 - 型`U`が(CV修飾された)`void`でなければ、正常値を[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`value()`](value.md)`)`で非直接リスト初期化した`expected`オブジェクトを返す。 - そうでなければ、[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`value()`](value.md)`)`を評価し、`expected()`を返す。 - - (3), (4) : 次の効果をもつ - エラー値を保持していたら、`expected(`[`unexpect`](../unexpect_t.md)`,` [`std::move`](/reference/utility/move.md)`(`[`error()`](error.md)`))`を返す。 - 型`U`が(CV修飾された)`void`でなければ、正常値を[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`std::move`](/reference/utility/move.md)`(`[`value()`](value.md)`))`で非直接リスト初期化した`expected`オブジェクトを返す。 - そうでなければ、[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`std::move`](/reference/utility/move.md)`(`[`value()`](value.md)`))`を評価し、`expected()`を返す。 +## 備考 +`transform`は、メソッドチェーンをサポートするモナド風(monadic)操作として導入された。 + + ## 例 ```cpp example #include diff --git a/reference/expected/expected/transform_error.md b/reference/expected/expected/transform_error.md index 160c97d4b0..100e135d13 100644 --- a/reference/expected/expected/transform_error.md +++ b/reference/expected/expected/transform_error.md @@ -16,6 +16,18 @@ template constexpr auto transform_error(F&& f) const &&; // (4) エラー値を保持していれば、エラー値に対して`f`を適用した結果を`expected`のエラー値として格納して返す。 正常値を保持していれば、そのまま返す。 +実際には複数オーバーロードが提供されるが、大まかには下記シグニチャのようにみなせる。 +`transform_error`へは、引数リストに1個の`E`型をとり`Return`型を返す関数や関数オブジェクトを与える。 + +```cpp +template +class expected { + template + std::expected transform_error(function func); +}; +``` +* function[link /reference/functional/function.md] + ## テンプレートパラメータ制約 - (1), (2) : [`is_copy_constructible_v`](/reference/type_traits/is_copy_constructible.md)` == true` @@ -24,10 +36,10 @@ template constexpr auto transform_error(F&& f) const &&; // (4) ## 適格要件 - (1), (2) : 型`G`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`>`としたとき、次を全て満たすこと - - `G`が`expected`の有効な値型である + - `G`が`expected`の有効なエラー値型である - 宣言`G g(`[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`error()`](error.md)`));`が妥当である - (3), (4) : 型`G`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`>`としたとき、次を全て満たすこと - - `G`が`expected`の有効な値型である + - `G`が`expected`の有効なエラー値型である - 宣言`G g(`[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`std::move`](/reference/utility/move.md)`(`[`error()`](error.md)`)));`が妥当である @@ -36,8 +48,12 @@ template constexpr auto transform_error(F&& f) const &&; // (4) - 正常値を保持していたら、`expected(`[`in_place`](/reference/utility/in_place_t.md)`,` [`value()`](value.md)`)`を返す。 - エラー値を[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`error()`](error.md)`)`で非直接リスト初期化した`expected`オブジェクトを返す。 - (3), (4) : 次の効果をもつ - - エラー値を保持していたら、`expected(`[`unexpect`](../unexpect_t.md)`,` [`std::move`](/reference/utility/move.md)`(`[`error()`](error.md)`))`を返す。 - - 正常値を[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`std::move`](/reference/utility/move.md)`(`[`error()`](error.md)`))`で非直接リスト初期化した`expected`オブジェクトを返す。 + - 正常値を保持していたら、`expected(`[`in_place`](/reference/utility/in_place_t.md)`,` [`std::move`](/reference/utility/move.md)`(`[`value()`](value.md)`))`を返す。 + - エラー値を[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`std::move`](/reference/utility/move.md)`(`[`error()`](error.md)`))`で非直接リスト初期化した`expected`オブジェクトを返す。 + + +## 備考 +`transform_error`は、メソッドチェーンをサポートするモナド風(monadic)操作として導入された。 ## 例 @@ -67,6 +83,7 @@ int main() * value()[link value.md] * error()[link error.md] * std::unexpected[link ../unexpected.md] +* std::reverse[link /reference/algorithm/reverse.md] ### 出力 ``` From 4d920448512f40a8a9d1363b91491ab6b7dca3df Mon Sep 17 00:00:00 2001 From: yoh Date: Sun, 5 Feb 2023 13:34:35 +0900 Subject: [PATCH 0154/3948] expected/expected: operator==,!=(#1066) --- reference/expected/expected.md | 4 +- reference/expected/expected/op_equal.md | 95 +++++++++++++++++++++ reference/expected/expected/op_not_equal.md | 92 ++++++++++++++++++++ 3 files changed, 189 insertions(+), 2 deletions(-) create mode 100644 reference/expected/expected/op_equal.md create mode 100644 reference/expected/expected/op_not_equal.md diff --git a/reference/expected/expected.md b/reference/expected/expected.md index 018ba23804..21b53d0301 100644 --- a/reference/expected/expected.md +++ b/reference/expected/expected.md @@ -69,8 +69,8 @@ namespace std { | 名前 | 説明 | 対応バージョン | |--------------|------------|-------| -| [`operator==`](unexpected/op_equal.md.nolink) | 等値比較 | C++23 | -| [`operator!=`](unexpected/op_not_equal.md.nolink) | 非等値比較 | C++23 | +| [`operator==`](expected/op_equal.md) | 等値比較 | C++23 | +| [`operator!=`](expected/op_not_equal.md) | 非等値比較 | C++23 | ## メンバ型 diff --git a/reference/expected/expected/op_equal.md b/reference/expected/expected/op_equal.md new file mode 100644 index 0000000000..efbb187707 --- /dev/null +++ b/reference/expected/expected/op_equal.md @@ -0,0 +1,95 @@ +# operator== +* expected[meta header] +* function template[meta id-type] +* std[meta namespace] +* expected[meta class] +* cpp23[meta cpp] + +```cpp +template requires (!is_void_v) +friend constexpr bool operator==(const expected& x, const expected& y); // (1) + +template +friend constexpr bool operator==(const expected& x, const T2& v); // (2) +// (2)により、下記オーバーロードが使用可能になる +template +friend constexpr bool operator==(const T2& v, const expected& x); // (3) + +template +friend constexpr bool operator==(const expected& x, const unexpected& e); // (4) +// (4)により、下記オーバーロードが使用可能になる +template +friend constexpr bool operator==(const unexpected& e, const expected& x); // (5) +``` +* is_void_v[link /reference/type_traits/is_void.md] +* unexpected[link ../unexpected.md] + +## 概要 +- (1) : `unexpected`オブジェクト同士の等値比較を行う。 +- (2), (3) : `unexpected`オブジェクトと正常値の等値比較を行う。 +- (4), (5) : `unexpected`オブジェクトとエラー値の等値比較を行う。 + + +## 適格要件 +- (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.nolink)が適格であり、その結果を`bool`へ変換可能であること。 + + +## 戻り値 +- (1) : 次の値を返す + - `x.`[`has_value()`](has_value.md)と`y.`[`has_value()`](has_value.md)が異なるとき、`false` + - `x.`[`has_value()`](has_value.md) `== true`のとき、[`*x`](op_deref.md) `==` [`*y`](op_deref.md) + - `x.`[`error()`](error.md) `== y.`[`error()`](error.md) +- (2), (3) : `x.`[`has_value()`](has_value.md) `&& static_cast(`[`*x`](op_deref.md) `== v)` +- (4), (5) : `!x.`[`has_value()`](has_value.md) `&& static_cast(x.`[`error()`](error.md) `== e.`[`error()`](../unexpected/error.md.nolink)`)` + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::expected x1 = 1; + std::expected y1 = 1; + std::expected x2 = std::unexpected{1}; + std::expected y2 = std::unexpected{1}; + + // (1) + assert(x1 == y1); + assert(x2 == y2); + assert(not (x1 == y2)); + assert(not (x2 == y1)); + + // (2), (3) + assert(x1 == 1); + assert(1 == x1); + + // (4), (5) + assert(x2 == std::unexpected{1}); + assert(std::unexpected{1} == x2); +} +``` +* ==[color ff0000] +* std::unexpected[link ../unexpected.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) diff --git a/reference/expected/expected/op_not_equal.md b/reference/expected/expected/op_not_equal.md new file mode 100644 index 0000000000..dc9fb73701 --- /dev/null +++ b/reference/expected/expected/op_not_equal.md @@ -0,0 +1,92 @@ +# operator!= +* expected[meta header] +* function template[meta id-type] +* std[meta namespace] +* expected[meta class] +* cpp23[meta cpp] + +```cpp +// operator==により、下記オーバーロードが使用可能になる +template requires (!is_void_v) +friend constexpr bool operator!=(const expected& x, const expected& y); // (1) + +template +friend constexpr bool operator!=(const expected& x, const T2& v); // (2) +template +friend constexpr bool operator!=(const T2& v, const expected& x); // (3) + +template +friend constexpr bool operator!=(const expected& x, const unexpected& e); // (4) +template +friend constexpr bool operator!=(const unexpected& e, const expected& x); // (5) +``` +* operator==[link op_equal.md] +* is_void_v[link /reference/type_traits/is_void.md] +* unexpected[link ../unexpected.md] + +## 概要 +- (1) : `unexpected`オブジェクト同士の非等値比較を行う。 +- (2), (3) : `unexpected`オブジェクトと正常値の非等値比較を行う。 +- (4), (5) : `unexpected`オブジェクトとエラー値の非等値比較を行う。 + + +## 適格要件 +- (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.nolink)が適格であり、その結果を`bool`へ変換可能であること。 + + +## 戻り値 +- (1) : `!`[`(x == y)`](op_equal.md) +- (2), (3) : `!`[`(x == v)`](op_equal.md) +- (4), (5) : `!`[`(x == e)`](op_equal.md) + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::expected x1 = 1; + std::expected y1 = 100; + std::expected x2 = std::unexpected{1}; + std::expected y2 = std::unexpected{100}; + + // (1) + assert(x1 != y1); + assert(x2 != y2); + assert(x1 != y2); + assert(x2 != y1); + + // (2), (3) + assert(x1 != 2); + assert(2 != x1); + + // (4), (5) + assert(x2 != std::unexpected{2}); + assert(std::unexpected{2} != x2); +} +``` +* !=[color ff0000] +* std::unexpected[link ../unexpected.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) From f770ec54101b867e1347bbe1c0352c3056c649a4 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 6 Feb 2023 14:12:58 +0900 Subject: [PATCH 0155/3948] =?UTF-8?q?=20:=20basic=5Fformat=5Fstrin?= =?UTF-8?q?g=E3=82=AF=E3=83=A9=E3=82=B9=E3=82=92=E8=BF=BD=E5=8A=A0=20(clos?= =?UTF-8?q?e=20#1097)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format.md | 8 ++ reference/format/basic_format_string.md | 114 ++++++++++++++++++ reference/format/basic_format_string/get.md | 52 ++++++++ .../basic_format_string/op_constructor.md | 92 ++++++++++++++ reference/format/format.md | 33 ++--- reference/format/format_to.md | 8 +- reference/format/format_to_n.md | 30 ++++- reference/format/formatted_size.md | 4 +- reference/ostream/print.md | 2 +- reference/ostream/println.md | 2 +- reference/print/print.md | 2 +- reference/print/println.md | 2 +- 12 files changed, 307 insertions(+), 42 deletions(-) create mode 100644 reference/format/basic_format_string.md create mode 100644 reference/format/basic_format_string/get.md create mode 100644 reference/format/basic_format_string/op_constructor.md diff --git a/reference/format.md b/reference/format.md index 458e42a680..055a6756b8 100644 --- a/reference/format.md +++ b/reference/format.md @@ -51,6 +51,14 @@ | [`format_args`](format/basic_format_args.md) | `basic_format_args`のマルチバイト文字列版 (type-alias) | C++20 | | [`wformat_args`](format/basic_format_args.md) | `basic_format_args`のワイド文字列版 (type-alias) | C++20 | + +## 書式文字列 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`basic_format_string`](format/basic_format_string.md) | 書式のコンパイル時文字列クラス (class template) | C++23 | + + ## 例外 | 名前 | 説明 | 対応バージョン | diff --git a/reference/format/basic_format_string.md b/reference/format/basic_format_string.md new file mode 100644 index 0000000000..38475c010d --- /dev/null +++ b/reference/format/basic_format_string.md @@ -0,0 +1,114 @@ +# basic_format_string +* format[meta header] +* class[meta id-type] +* std[meta namespace] +* cpp23[meta cpp] + +```cpp +namespace std { + template + struct basic_format_string; + + template + using format_string = basic_format_string...>; + + template + using wformat_string = basic_format_string...>; +} +``` +* type_identity_t[link /reference/type_traits/type_identity.md] + + +## 概要 +`basic_format_string`クラスは、コンパイル時の書式文字列を表すクラスである。 + +C++20までは説明専用クラス`basic-format-string`として定義されていたが、C++23からはユーザーが利用できる正式な機能として定義される。 + +このクラスは、書式文字列のコンパイル時チェックを行う。 + +```cpp +auto str = std::format("{:d}", "I am not a number"); // コンパイルエラー! + // 書式文字列は「d」で整数を要求しているが、引数として文字列が渡された +``` + +このクラスのコンストラクタは、パラメータの書式文字列と、クラステンプレートパラメータの`Args...`を照合し、 + +- 書式文字列の型チェック +- 開きカッコと閉じカッコの一致 +- その他、型ごとに許可されたオプションが正しいか + +などをチェックする。 + +C++23で説明専用クラスでなく正式な機能として定義されたことにより、以下のように書式化を含むロギングなどをユーザーが定義できるようになる。 + +```cpp +template +void log(std::format_string s, Args&&... args) { + if (logging_enabled) { + log_raw(std::format(s, std::forward(args)...)); + } +} +``` +* std::format[link /reference/format/format.md] +* std::forward[link /reference/utility/forward.md] + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|-----------------|----------------|----------------| +| [`(constructor)`](basic_format_string/op_constructor.md) | コンストラクタ | C++23 | +| [`get`](basic_format_string/get.md) | 書式文字列を取得する | C++23 | + +## 例 +```cpp example +#include +#include +#include + +thread_local bool logging_enabled = true; + +// 現在時刻付きで、文字列フォーマットしてログ出力する +template +void log(std::format_string s, Args&&... args) { + if (!logging_enabled) { + return; + } + + namespace chrono = std::chrono; + auto now = chrono::floor(chrono::system_clock::now()); + std::cout << std::format("{}: {}", + chrono::zoned_time{"Asia/Tokyo", now}, + std::format(s, std::forward(args)...) + ) << std::endl; +} + +int main() +{ + log("Hello {} World", 42); +} +``` +* std::format_string[color ff0000] +* chrono::system_clock[link /reference/chrono/system_clock.md] +* now[link /reference/chrono/system_clock/now.md] +* chrono::floor[link /reference/chrono/time_point/floor.md] +* chrono::seconds[link /reference/chrono/duration_aliases.md] +* chrono::zoned_time[link /reference/chrono/zoned_time.md] +* std::forward[link /reference/utility/forward.md] + +### 出力 +``` +2023-02-06 10:46:53: Hello 42 World +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P2508R1 Expose `std::basic-format-string`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2508r1.html) diff --git a/reference/format/basic_format_string/get.md b/reference/format/basic_format_string/get.md new file mode 100644 index 0000000000..c13972bf08 --- /dev/null +++ b/reference/format/basic_format_string/get.md @@ -0,0 +1,52 @@ +# get +* format[meta header] +* function[meta id-type] +* std[meta namespace] +* basic_format_string[meta class] +* cpp23[meta cpp] + +```cpp +constexpr basic_string_view get() const noexcept; // (1) +``` + +## 概要 +書式文字列を取得する。 + + +## 戻り値 +メンバ変数として`basic_string_view str;`が定義されるとして、 + +```cpp +return str; +``` + + +## 例 +```cpp example +#include +#include + +template +void f(std::format_string fmt, Args&&...) { + assert(fmt.get() == "Hello {} World"); +} + +int main() { + f("Hello {} World", 42); +} +``` +* fmt.get()[color ff0000] + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2508R1 Expose `std::basic-format-string`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2508r1.html) diff --git a/reference/format/basic_format_string/op_constructor.md b/reference/format/basic_format_string/op_constructor.md new file mode 100644 index 0000000000..e3f944b66f --- /dev/null +++ b/reference/format/basic_format_string/op_constructor.md @@ -0,0 +1,92 @@ +# コンストラクタ +* format[meta header] +* function[meta id-type] +* std[meta namespace] +* basic_format_string[meta class] +* cpp23[meta cpp] + +```cpp +template +consteval basic_format_string(const T& s); +``` + +## 概要 +`basic_format_string`オブジェクトを構築する。 + + +## テンプレートパラメータ制約 +- `const T&`は[`convertible_to`](/reference/concepts/convertible_to.md)`<`[`basic_string_view`](/reference/string_view/basic_string_view.md)`>`のモデルであること + + +## 効果 +メンバ変数として`basic_string_view str;`が定義されるとして、`str(s)`で初期化する。 + + +## 備考 +- この関数の呼び出しは、`str`が`args`の書式文字列であるような`Args`型の`args`が存在しない限り、コア定数式ではない + - 意味 : 書式文字列が引数列`args`と合わせて正しくなければ、定数式評価 (`consteval`) が実行できずコンパイルエラーとなる + - 以下のようなコードはコンパイルエラーとなる: + ```cpp + int main() { + auto str = std::format("{:d}", "I am not a number"); // コンパイルエラー!型が合わない + } + ``` + * std::format[link /reference/format/format.md] + + +## 実装例 +```cpp +// 書式文字列のチェック +template +consteval void fmt_checker(std::basic_string_view str) +{ + // … + + if (/*カッコの開き・閉じが一致しない場合*/) { + throw "invalid brackets"; // throw式は定数式で実行できないため、 + // このパスを通ったらコンパイルエラーになる + } + + // … + + if (/*型が合わない時*/) { + throw "invalid type specifier"; + } + + // … +} + +namespace std { + template + struct basic_format_string { + std::basic_string_view str; + + template + requires std::convertible_to> + consteval basic_format_string(const T& s) + : str(s) + { + fmt_checker(str); + } + }; + + template + using format_string = basic_format_string...>; +} +``` +* std::convertible_to[link /reference/concepts/convertible_to.md] +* std::type_identity_t[link /reference/type_traits/type_identity.md] + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2216R3 `std::format` improvements](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2216r3.html) diff --git a/reference/format/format.md b/reference/format/format.md index f8a57a28fe..f611c31455 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -23,8 +23,8 @@ namespace std { * string[link /reference/string/basic_string.md] * wstring[link /reference/string/basic_string.md] * locale[link /reference/locale/locale.md] -* format_string[italic] -* wformat_string[italic] +* format_string[link basic_format_string.md] +* wformat_string[link basic_format_string.md] ## 概要 @@ -250,32 +250,13 @@ format("{:n}", 1234); // "1,234" (ロケールによる) ### コンパイル時の書式文字列チェック -_`format_string`_ および _`basic_format_string`_ は次のように定義される。ただし、クラス名は規定されない。 +書式文字列は、[`basic_format_string`](basic_format_string.md)クラスによってコンパイル時にチェックされる。 -```cpp -namespace std { - template struct basic_format_string { // exposition only - private: - basic_string_view str; // exposition only - - public: - template consteval basic_format_string(const T& s): str(s) { - /*何らかのコンパイル時書式文字列チェック*/ - } - }; - - template using format_string - = basic_format_string...>; // exposition only - - template using wformat_string - = basic_format_string...>; // exposition only -``` -* consteval[link /lang/cpp20/immediate_functions.md] - -_`basic_format_string`_ のコンストラクタは[即時関数](/lang/cpp20/immediate_functions.md)であり、書式文字列が正しい場合にのみ定数式として評価できるように実装される。即時関数であるため、定数式として評価できない場合はエラーとなる。 +[`basic_format_string`](basic_format_string.md) のコンストラクタは[即時関数](/lang/cpp20/immediate_functions.md)であり、書式文字列が正しい場合にのみ定数式として評価できるように実装される。即時関数であるため、定数式として評価できない場合はエラーとなる。 書式文字列チェックをエラーがあった場合に例外を投げるような実装をすれば、`throw`は定数式として評価できないため、コンパイルエラーとすることが可能である。 + ## 適格要件 * 書式文字列は定数式であり、[`string_view`](/reference/string_view/basic_string_view.md)(ワイド文字列版は[`wstring_view`](/reference/string_view/basic_string_view.md))に暗黙変換できること。 @@ -557,8 +538,8 @@ wstring format(const locale& loc, wformat_string fmt, const Args&... ar ``` * string[link /reference/string/basic_string.md] * wstring[link /reference/string/basic_string.md] -* format_string[italic] -* wformat_string[italic] +* format_string[link basic_format_string.md] +* wformat_string[link basic_format_string.md] * str[italic] * vformat[link vformat.md] * make_format_args[link make_format_args.md] diff --git a/reference/format/format_to.md b/reference/format/format_to.md index ddc5e3616a..cfa27ed944 100644 --- a/reference/format/format_to.md +++ b/reference/format/format_to.md @@ -20,8 +20,8 @@ namespace std { Out format_to(Out out, const locale& loc, wformat_string fmt, const Args&... args); // (4) } ``` -* format_string[italic] -* wformat_string[italic] +* format_string[link basic_format_string.md] +* wformat_string[link basic_format_string.md] * locale[link /reference/locale/locale.md] ## 概要 @@ -135,8 +135,8 @@ wstring format_to(Out out, const locale& loc, wformat_string fmt, const return vformat_to(out, loc, fmt.str, {make_format_args(args...)}); } ``` -* format_string[italic] -* wformat_string[italic] +* format_string[link basic_format_string.md] +* wformat_string[link basic_format_string.md] * str[italic] * basic_format_context[link basic_format_context.md] * vformat_to[link vformat.md] diff --git a/reference/format/format_to_n.md b/reference/format/format_to_n.md index 1bf745c885..043e0b96e0 100644 --- a/reference/format/format_to_n.md +++ b/reference/format/format_to_n.md @@ -8,20 +8,38 @@ ```cpp namespace std { template - format_to_n_result format_to_n(Out out, iter_difference_t n, format_string fmt, const Args&... args); // (1) + format_to_n_result + format_to_n(Out out, + iter_difference_t n, + format_string fmt, + const Args&... args); // (1) template - format_to_n_result format_to_n(Out out, iter_difference_t n, wformat_string fmt, const Args&... args); // (2) + format_to_n_result + format_to_n(Out out, + iter_difference_t n, + wformat_string fmt, + const Args&... args); // (2) template - format_to_n_result format_to_n(Out out, iter_difference_t n, const locale& loc, format_string fmt, const Args&... args); // (3) + format_to_n_result + format_to_n(Out out, + iter_difference_t n, + const locale& loc, + format_string fmt, + const Args&... args); // (3) template - format_to_n_result format_to_n(Out out, iter_difference_t n, const locale& loc, wformat_string fmt, const Args&... args); // (4) + format_to_n_result + format_to_n(Out out, + iter_difference_t n, + const locale& loc, + wformat_string fmt, + const Args&... args); // (4) } ``` -* format_string[italic] -* wformat_string[italic] +* format_string[link basic_format_string.md] +* wformat_string[link basic_format_string.md] * format_to_n_result[link format_to_n_result.md] * locale[link /reference/locale/locale.md] diff --git a/reference/format/formatted_size.md b/reference/format/formatted_size.md index b6fef70773..ee62d3d40a 100644 --- a/reference/format/formatted_size.md +++ b/reference/format/formatted_size.md @@ -20,8 +20,8 @@ namespace std { size_t formatted_size(const locale& loc, wformat_string fmt, const Args&... args); // (4) } ``` -* format_string[italic] -* wformat_string[italic] +* format_string[link basic_format_string.md] +* wformat_string[link basic_format_string.md] * locale[link /reference/locale/locale.md] ## 概要 diff --git a/reference/ostream/print.md b/reference/ostream/print.md index c796974888..7f98d91072 100644 --- a/reference/ostream/print.md +++ b/reference/ostream/print.md @@ -12,7 +12,7 @@ namespace std { Args&&... args); // (1) C++23 } ``` -* format_string[link /reference/format/format_string.md.nolink] +* format_string[link /reference/format/basic_format_string.md] * ostream[link basic_ostream.md] ## 概要 diff --git a/reference/ostream/println.md b/reference/ostream/println.md index 1f3f7cc860..bb6e90f1b7 100644 --- a/reference/ostream/println.md +++ b/reference/ostream/println.md @@ -12,7 +12,7 @@ namespace std { Args&&... args); // (1) C++23 } ``` -* format_string[link /reference/format/format_string.md.nolink] +* format_string[link /reference/format/basic_format_string.md] * ostream[link basic_ostream.md] ## 概要 diff --git a/reference/print/print.md b/reference/print/print.md index 0f4624814b..8ce2daf05c 100644 --- a/reference/print/print.md +++ b/reference/print/print.md @@ -16,7 +16,7 @@ namespace std { Args&&... args); // (2) C++23 } ``` -* format_string[link /reference/format/format_string.md.nolink] +* format_string[link /reference/format/basic_format_string.md] * FILE[link /reference/cstdio/file.md.nolink] ## 概要 diff --git a/reference/print/println.md b/reference/print/println.md index c352e6dc84..27f0d8dd28 100644 --- a/reference/print/println.md +++ b/reference/print/println.md @@ -16,7 +16,7 @@ namespace std { Args&&... args); // (2) C++23 } ``` -* format_string[link /reference/format/format_string.md.nolink] +* format_string[link /reference/format/basic_format_string.md] * FILE[link /reference/cstdio/file.md.nolink] ## 概要 From 9ad08e064c4e949c87fbd7ec33534903de1f4d76 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 6 Feb 2023 14:18:49 +0900 Subject: [PATCH 0156/3948] =?UTF-8?q?format=20:=20=E3=83=AD=E3=82=B0?= =?UTF-8?q?=E5=87=BA=E5=8A=9B=E3=81=AE=E4=BE=8B=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/format.md | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/reference/format/format.md b/reference/format/format.md index f611c31455..1aabd2fafe 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -546,6 +546,46 @@ wstring format(const locale& loc, wformat_string fmt, const Args&... ar * make_wformat_args[link make_format_args.md] * locale[link /reference/locale/locale.md] +### ログ出力の例 (C++23) +```cpp +#include +#include +#include + +// コンパイルフラグによって無効化できるログ出力関数 +template +void debug_log(std::format_string s, Args&&... args) { +#if defined(DISABLE_DEBUG_LOG) + return; +#else + namespace chrono = std::chrono; + auto now = chrono::floor(chrono::system_clock::now()); + std::cout << std::format("{}: {}", + chrono::zoned_time{"Asia/Tokyo", now}, + std::format(s, std::forward(args)...) + ) << std::endl; +#endif +} + +int main() +{ + debug_log("Hello {} World", 42); +} +``` +* std::format_string[link /reference/format/basic_format_string.md] +* chrono::system_clock[link /reference/chrono/system_clock.md] +* now[link /reference/chrono/system_clock/now.md] +* chrono::floor[link /reference/chrono/time_point/floor.md] +* chrono::seconds[link /reference/chrono/duration_aliases.md] +* chrono::zoned_time[link /reference/chrono/zoned_time.md] +* std::forward[link /reference/utility/forward.md] + +#### 出力 +``` +2023-02-06 10:46:53: Hello 42 World +``` + + ## バージョン ### 言語 - C++20 From 9140852ca87b0d97fe82e630ad5fe65f876f0f0c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 6 Feb 2023 14:28:24 +0900 Subject: [PATCH 0157/3948] =?UTF-8?q?format=20:=20=E6=AE=B5=E8=90=BD?= =?UTF-8?q?=E3=83=9F=E3=82=B9=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/format.md | 72 ++++++++++++++++++++------------------ 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/reference/format/format.md b/reference/format/format.md index 1aabd2fafe..cf7c5f0d40 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -510,41 +510,6 @@ int main() [true, false, true] ``` -## 実装例 -```cpp -template -string format(format_string fmt, const Args&... args) -{ - return vformat(fmt.str, make_format_args(args...)); -} - -template -wstring format(wformat_string fmt, const Args&... args) -{ - return vformat(fmt.str, make_wformat_args(args...)); -} - -template -string format(const locale& loc, format_string fmt, const Args&... args) -{ - return vformat(loc, fmt.str, make_format_args(args...)); -} - -template -wstring format(const locale& loc, wformat_string fmt, const Args&... args) -{ - return vformat(loc, fmt.str, make_wformat_args(args...)); -} -``` -* string[link /reference/string/basic_string.md] -* wstring[link /reference/string/basic_string.md] -* format_string[link basic_format_string.md] -* wformat_string[link basic_format_string.md] -* str[italic] -* vformat[link vformat.md] -* make_format_args[link make_format_args.md] -* make_wformat_args[link make_format_args.md] -* locale[link /reference/locale/locale.md] ### ログ出力の例 (C++23) ```cpp @@ -586,6 +551,43 @@ int main() ``` +## 実装例 +```cpp +template +string format(format_string fmt, const Args&... args) +{ + return vformat(fmt.str, make_format_args(args...)); +} + +template +wstring format(wformat_string fmt, const Args&... args) +{ + return vformat(fmt.str, make_wformat_args(args...)); +} + +template +string format(const locale& loc, format_string fmt, const Args&... args) +{ + return vformat(loc, fmt.str, make_format_args(args...)); +} + +template +wstring format(const locale& loc, wformat_string fmt, const Args&... args) +{ + return vformat(loc, fmt.str, make_wformat_args(args...)); +} +``` +* string[link /reference/string/basic_string.md] +* wstring[link /reference/string/basic_string.md] +* format_string[link basic_format_string.md] +* wformat_string[link basic_format_string.md] +* str[italic] +* vformat[link vformat.md] +* make_format_args[link make_format_args.md] +* make_wformat_args[link make_format_args.md] +* locale[link /reference/locale/locale.md] + + ## バージョン ### 言語 - C++20 From 6a2ea7cae4b614ea47552d81e31eeae5b35c9b03 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 6 Feb 2023 14:32:20 +0900 Subject: [PATCH 0158/3948] =?UTF-8?q?basic=5Fformat=5Fstring=20:=20?= =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE=E9=A3=BE=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/basic_format_string.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/format/basic_format_string.md b/reference/format/basic_format_string.md index 38475c010d..35af1c5afd 100644 --- a/reference/format/basic_format_string.md +++ b/reference/format/basic_format_string.md @@ -95,6 +95,7 @@ int main() * chrono::seconds[link /reference/chrono/duration_aliases.md] * chrono::zoned_time[link /reference/chrono/zoned_time.md] * std::forward[link /reference/utility/forward.md] +* std::format[link /reference/format/format.md] ### 出力 ``` From 44ce2423fe44bad90a3937cc11b6be83e14fcfac Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Mon, 6 Feb 2023 15:05:22 +0900 Subject: [PATCH 0159/3948] =?UTF-8?q?to=5Faddress=20:=20=E3=82=A4=E3=83=86?= =?UTF-8?q?=E3=83=AC=E3=83=BC=E3=82=BF=E3=81=8B=E3=82=89=E3=83=9D=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=82=BF=E3=81=B8=E3=81=AE=E5=A4=89=E6=8F=9B=E4=BE=8B?= =?UTF-8?q?=E3=81=AE=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/memory/to_address.md | 39 +++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/reference/memory/to_address.md b/reference/memory/to_address.md index a301c42f87..98a1321d37 100644 --- a/reference/memory/to_address.md +++ b/reference/memory/to_address.md @@ -32,6 +32,9 @@ namespace std { ## 例 + +### ポインタの例 + ```cpp example #include #include @@ -55,12 +58,46 @@ int main() ``` * std::to_address[color ff0000] -### 出力 +#### 出力 ``` 3 1 ``` +### イテレータの例 + +```cpp example +#include +#include + +int main() +{ + std::vector vec = {1, 2, 3, 4}; + + // vectorやstring等のイテレータはcontiguousではあるが、実装によってポインタではない場合がある + auto it = vec.begin(); + auto end = vec.end(); + + // contiguousなイテレータをその要素へのポインタに変換する + int* p = std::to_address(it); + + // 特に、終端イテレータからポインタへの変換で未定義動作を回避できる + int* ep = std::to_address(end); + // この様にしてしまうと、オブジェクトを指していないポインタのデリファレンスとなり未定義動作 + //int* ep = &*end; + + std::cout << *p << '\n'; + std::cout << *(ep - 1); +} +``` +* std::to_address[color ff0000] + +#### 出力 +``` +1 +4 +``` + ## バージョン ### 言語 - C++20 From 4b80aa7366b63eb7ae96c0be2d2c355a056437ec Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 6 Feb 2023 18:00:10 +0900 Subject: [PATCH 0160/3948] =?UTF-8?q?=E3=83=87=E3=82=A3=E3=83=AC=E3=82=AF?= =?UTF-8?q?=E3=83=88=E3=83=AA=E6=A7=8B=E9=80=A0=20:=20=E3=82=AA=E3=83=BC?= =?UTF-8?q?=E3=83=90=E3=83=BC=E3=83=AD=E3=83=BC=E3=83=89=E3=82=92=E6=84=8F?= =?UTF-8?q?=E5=9B=B3=E3=81=97=E3=81=9F=E4=BE=8B=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start_editing/directory_structure.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/start_editing/directory_structure.md b/start_editing/directory_structure.md index a47a004f2e..38a8a28f02 100644 --- a/start_editing/directory_structure.md +++ b/start_editing/directory_structure.md @@ -23,7 +23,10 @@ reference階層とmodule階層は上記以外は同じであるため、以下 - オーバーロードを意図している関数の例は以下: - 非メンバ関数の演算子 - `std::get()` - - `std::begin()`/`std::end()`およびそれに類するもの + - `std::begin()`/`std::end()`/`std::data()`/`std::size()`およびそれに類するもの + - `std::swap()` + - `std::erase()`/`std::erase_if()` + - `floor()`/`ceil()`/`round()` (chrono) - 演算子オーバーロードは、`operator<<` (出力ストリームへの出力) と `std::operator>>` (入力ストリームからの入力) を除き、左辺のクラスに属するものとする - 特殊な例として、[`std::error_code`](/reference/system_error/error_code.md)と[`std::error_condition`](/reference/system_error/error_condition.md)の比較演算子は、クラス階層ではなくヘッダ階層としている。これは所属関係がむずかしいためである From 6b380267a5dc836d9adf22c2e2fb983f02ca2ce4 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 6 Feb 2023 18:03:21 +0900 Subject: [PATCH 0161/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE?= =?UTF-8?q?=E9=A3=BE=E3=81=AE=E8=AA=A4=E3=82=8A=E6=A4=9C=E5=87=BACI?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/code_qualify_check.yml | 19 ++++++++ .../workflows/script/code_qualify_check.py | 45 +++++++++++++++++++ .../type_deduction_for_class_templates.md | 2 +- reference/algorithm/ranges_equal.md | 4 -- reference/algorithm/ranges_fill_n.md | 2 +- reference/algorithm/ranges_find.md | 1 - reference/algorithm/ranges_generate.md | 2 +- reference/algorithm/ranges_generate_n.md | 2 +- reference/algorithm/ranges_max_element.md | 1 - reference/algorithm/ranges_min_element.md | 1 - reference/algorithm/ranges_minmax_element.md | 1 - reference/algorithm/ranges_mismatch.md | 6 --- reference/algorithm/ranges_move_backward.md | 2 +- .../algorithm/ranges_prev_permutation.md | 2 +- reference/algorithm/ranges_remove_copy_if.md | 2 +- reference/algorithm/ranges_rotate.md | 2 - reference/algorithm/ranges_rotate_copy.md | 1 - reference/algorithm/ranges_set_difference.md | 1 - .../ranges_set_symmetric_difference.md | 1 - reference/algorithm/ranges_shift_left.md | 2 +- reference/algorithm/ranges_shuffle.md | 2 - reference/algorithm/ranges_stable_sort.md | 2 +- reference/algorithm/ranges_starts_with.md | 1 - reference/algorithm/ranges_transform.md | 2 +- reference/algorithm/transform.md | 2 +- reference/atomic/atomic_ref/op_or_assign.md | 3 +- reference/cfloat/dbl_epsilon.md | 2 +- reference/cfloat/dbl_max.md | 2 +- reference/cfloat/dbl_min.md | 2 +- reference/cfloat/dbl_true_min.md | 2 +- reference/cfloat/flt_epsilon.md | 2 +- reference/cfloat/flt_min.md | 2 +- reference/cfloat/flt_true_min.md | 2 +- reference/cfloat/ldbl_epsilon.md | 2 +- reference/cfloat/ldbl_max.md | 2 +- reference/cfloat/ldbl_max_exp.md | 2 +- reference/cfloat/ldbl_min.md | 2 +- reference/cfloat/ldbl_true_min.md | 2 +- reference/chrono/ambiguous_local_time.md | 2 - reference/chrono/gps_time.md | 1 - reference/chrono/local_time.md | 1 - reference/chrono/locate_zone.md | 2 +- reference/chrono/month_weekday/op_append.md | 2 +- .../chrono/month_weekday_last/op_append.md | 2 +- .../month_weekday_last/op_constructor.md | 1 - reference/chrono/tai_time.md | 1 - reference/chrono/time_point/op_greater.md | 2 +- .../chrono/time_point/op_greater_equal.md | 2 +- reference/chrono/time_point/op_less.md | 2 +- reference/chrono/time_point/op_less_equal.md | 2 +- reference/chrono/time_point/round.md | 2 +- reference/chrono/time_zone/to_local.md | 1 - reference/chrono/utc_clock/to_sys.md | 1 - reference/chrono/weekday/op_at.md | 4 +- reference/chrono/year_month_day.md | 1 - .../chrono/year_month_weekday/formatter.md | 1 - .../year_month_weekday/op_minus_assign.md | 2 +- .../chrono/year_month_weekday/op_plus.md | 2 +- .../year_month_weekday_last/formatter.md | 1 - .../op_minus_assign.md | 2 +- .../chrono/year_month_weekday_last/op_plus.md | 2 +- .../year_month_weekday_last/weekday_last.md | 2 +- .../chrono/zoned_time/op_deduction_guide.md | 1 - reference/cmath/hypot.md | 2 +- reference/compare/compare_three_way_result.md | 2 +- reference/compare/three_way_comparable.md | 2 - reference/concepts/common_with.md | 2 +- reference/concepts/relation.md | 4 +- reference/concepts/swappable.md | 2 +- reference/concepts/totally_ordered.md | 2 - reference/coroutine/coroutine_handle.md | 1 - reference/exception/bad_exception.md | 2 +- reference/expected/expected/error_or.md | 2 +- reference/expected/expected/value_or.md | 2 +- reference/filesystem/equivalent.md | 1 - reference/filesystem/is_empty.md | 1 - reference/format/format_to.md | 1 - reference/format/range_formatter.md | 1 - .../forward_list/forward_list/splice_after.md | 1 - reference/fstream/basic_filebuf/close.md | 2 +- reference/fstream/basic_filebuf/open.md | 2 +- reference/fstream/basic_fstream.md | 2 +- reference/future/packaged_task.md | 2 +- reference/ios/basic_ios/clear.md | 1 - reference/ios/basic_ios/fill.md | 1 - reference/ios/ios_base/register_callback.md | 1 - reference/ios/ios_base/type-event.md | 1 - reference/ios/ios_base/type-fmtflags.md | 1 - reference/ios/iostream_category.md | 2 +- reference/istream/basic_istream/seekg.md | 2 +- .../basic_istream/sentry/op_constructor.md | 1 - .../iterator/common_iterator/iter_swap.md | 3 +- .../common_iterator/op_constructor.md | 2 +- reference/iterator/counted_iterator.md | 1 - reference/iterator/counted_iterator/base.md | 1 - .../limits/numeric_limits/max_digits10.md | 2 +- reference/memory/ranges_destroy.md | 8 ++-- reference/memory/ranges_destroy_n.md | 4 +- .../memory/ranges_uninitialized_copy_n.md | 1 - .../memory/ranges_uninitialized_fill_n.md | 1 - .../memory/ranges_uninitialized_move_n.md | 1 - reference/memory/shared_ptr/unique.md | 2 +- reference/memory_resource/memory_resource.md | 4 +- .../polymorphic_allocator/construct.md | 2 - .../polymorphic_allocator/new_object.md | 3 -- .../pool_resource/upstream_resource.md | 2 +- reference/mutex/mutex/lock.md | 2 +- ...hardware_constructive_interference_size.md | 1 - reference/queue/queue/back.md | 2 +- reference/ranges/borrowed_subrange_t.md | 1 - reference/ranges/common_view.md | 2 - reference/ranges/copyable_box.md | 2 +- reference/ranges/elements_view.md | 1 - reference/ranges/iota_view.md | 3 +- reference/ranges/iota_view/iterator.md | 1 - reference/ranges/owning_view.md | 4 -- reference/ranges/ref_view.md | 1 - reference/ranges/repeat_view/iterator.md | 2 - reference/ranges/reverse_view.md | 2 - reference/ranges/simple-view.md | 2 +- .../ranges/subrange/op_deduction_guide.md | 7 +-- reference/regex/match_results.md | 2 +- reference/regex/match_results/prefix.md | 1 - reference/regex/match_results/suffix.md | 1 - reference/set/multiset/insert.md | 1 - reference/set/multiset/value_comp.md | 1 - reference/set/set/value_comp.md | 1 - reference/shared_mutex/shared_lock/op_bool.md | 1 - reference/span/span/op_constructor.md | 3 -- .../stacktrace/basic_stacktrace/current.md | 4 +- .../stacktrace/basic_stacktrace/max_size.md | 2 +- reference/stacktrace/basic_stacktrace/size.md | 2 +- reference/stacktrace/stacktrace_entry.md | 2 +- .../stop_token/stop_source/op_constructor.md | 1 - .../stop_token/stop_source/request_stop.md | 3 +- .../stop_token/stop_source/stop_requested.md | 2 +- .../stop_token/stop_token/stop_requested.md | 1 - reference/stop_token/stop_token/swap.md | 1 - reference/stop_token/stop_token/swap_free.md | 3 +- reference/tuple/make_from_tuple.md | 1 - .../type_traits/basic_common_reference.md | 2 +- reference/type_traits/is_invocable_r.md | 17 ++++--- reference/typeindex/type_index/op_greater.md | 1 - reference/typeindex/type_index/op_less.md | 1 - .../typeindex/type_index/op_less_equal.md | 1 - .../unordered_map/unordered_map/insert.md | 1 - .../unordered_map/op_not_equal.md | 1 - .../unordered_multimap/insert.md | 1 - reference/unordered_set/unordered_multiset.md | 4 +- .../unordered_multiset/bucket.md | 4 +- .../unordered_set/unordered_multiset/erase.md | 2 - .../unordered_multiset/insert.md | 1 - .../unordered_set/unordered_set/erase.md | 2 - .../unordered_set/unordered_set/insert.md | 1 - reference/utility/index_sequence.md | 1 - reference/utility/pair/common_type.md | 1 - reference/valarray/gslice_array/op_assign.md | 1 - .../valarray/gslice_array/op_divide_assign.md | 1 - .../gslice_array/op_left_shift_assign.md | 1 - .../valarray/gslice_array/op_minus_assign.md | 1 - .../valarray/gslice_array/op_modulo_assign.md | 1 - .../gslice_array/op_multiply_assign.md | 1 - .../valarray/gslice_array/op_or_assign.md | 1 - .../valarray/gslice_array/op_plus_assign.md | 1 - .../gslice_array/op_right_shift_assign.md | 1 - .../valarray/gslice_array/op_xor_assign.md | 1 - .../valarray/indirect_array/op_and_assign.md | 1 - .../valarray/indirect_array/op_assign.md | 1 - .../indirect_array/op_divide_assign.md | 1 - .../indirect_array/op_left_shift_assign.md | 1 - .../indirect_array/op_minus_assign.md | 1 - .../indirect_array/op_modulo_assign.md | 1 - .../indirect_array/op_multiply_assign.md | 1 - .../valarray/indirect_array/op_or_assign.md | 1 - .../valarray/indirect_array/op_plus_assign.md | 1 - .../indirect_array/op_right_shift_assign.md | 1 - .../valarray/indirect_array/op_xor_assign.md | 1 - .../valarray/mask_array/op_and_assign.md | 1 - reference/valarray/mask_array/op_assign.md | 1 - .../valarray/mask_array/op_divide_assign.md | 1 - .../mask_array/op_left_shift_assign.md | 1 - .../valarray/mask_array/op_minus_assign.md | 1 - .../valarray/mask_array/op_modulo_assign.md | 1 - .../valarray/mask_array/op_multiply_assign.md | 1 - reference/valarray/mask_array/op_or_assign.md | 1 - .../valarray/mask_array/op_plus_assign.md | 2 - .../mask_array/op_right_shift_assign.md | 1 - .../valarray/mask_array/op_xor_assign.md | 1 - .../valarray/slice_array/op_and_assign.md | 1 - reference/valarray/slice_array/op_assign.md | 1 - .../valarray/slice_array/op_divide_assign.md | 1 - .../slice_array/op_left_shift_assign.md | 1 - .../valarray/slice_array/op_minus_assign.md | 1 - .../valarray/slice_array/op_modulo_assign.md | 1 - .../slice_array/op_multiply_assign.md | 1 - .../valarray/slice_array/op_or_assign.md | 1 - .../valarray/slice_array/op_plus_assign.md | 1 - .../slice_array/op_right_shift_assign.md | 1 - .../valarray/slice_array/op_xor_assign.md | 1 - reference/variant/variant/emplace.md | 2 +- start_editing.md | 3 ++ 201 files changed, 163 insertions(+), 253 deletions(-) create mode 100644 .github/workflows/code_qualify_check.yml create mode 100644 .github/workflows/script/code_qualify_check.py diff --git a/.github/workflows/code_qualify_check.yml b/.github/workflows/code_qualify_check.yml new file mode 100644 index 0000000000..d5819c3852 --- /dev/null +++ b/.github/workflows/code_qualify_check.yml @@ -0,0 +1,19 @@ +name: code qualify check + +on: [push, pull_request, workflow_dispatch] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install requests + - uses: actions/checkout@v2 + - name: check + run: python3 .github/workflows/script/code_qualify_check.py diff --git a/.github/workflows/script/code_qualify_check.py b/.github/workflows/script/code_qualify_check.py new file mode 100644 index 0000000000..a544674432 --- /dev/null +++ b/.github/workflows/script/code_qualify_check.py @@ -0,0 +1,45 @@ +import glob +import re +import os +import sys + +def check_exist_qualify_target(text: str, filename: str) -> bool: + code = "" + in_code_block = False + found_error = False + for line in text.split("\n"): + is_code_block = line.strip().startswith("```") + if is_code_block: + in_code_block = not in_code_block + continue + + if in_code_block: + code += line + "\n" + continue + + m = re.fullmatch(r'[\*-] (.*?)\[(link |color |italic)(.*?)\]', line) + if m: + if code and len(code) > 0: + target = m.group(1) + if not target in code: # FIXME: 単語検索にしたい + print("{}: `{}` not found in code block.\n{}".format(filename, target, code)) + found_error = True + else: + code = "" + return not found_error + +if __name__ == '__main__': + found_error = False + current_dir = os.getcwd() + outer_link_dict = dict() + found_error = False + for p in sorted(list(glob.glob("**/*.md", recursive=True))): + dirname = os.path.dirname(p) + with open(p) as f: + text = f.read() + + if not check_exist_qualify_target(text, p): + found_error = True + + if found_error: + sys.exit(1) diff --git a/lang/cpp17/type_deduction_for_class_templates.md b/lang/cpp17/type_deduction_for_class_templates.md index a6c5bcc053..6f50129240 100644 --- a/lang/cpp17/type_deduction_for_class_templates.md +++ b/lang/cpp17/type_deduction_for_class_templates.md @@ -193,7 +193,7 @@ int main() * wp.lock()[link /reference/memory/weak_ptr/lock.md] * std::make_tuple[link /reference/tuple/make_tuple.md] * std::promise[link /reference/future/promise.md] -* p.get_future()[link /reference/future/promise/get_future.md] +* pro.get_future()[link /reference/future/promise/get_future.md] * std::future[link /reference/future/future.md] #### 出力 diff --git a/reference/algorithm/ranges_equal.md b/reference/algorithm/ranges_equal.md index 57026ce102..8b5fbc3711 100644 --- a/reference/algorithm/ranges_equal.md +++ b/reference/algorithm/ranges_equal.md @@ -44,10 +44,6 @@ namespace std::ranges { * indirectly_comparable[link /reference/iterator/indirectly_comparable.md] * input_range[link /reference/ranges/input_range.md] * iterator_t[link /reference/ranges/iterator_t.md] -* invoke[link /reference/functional/invoke.md] -* begin[link /reference/ranges/begin.md] -* end[link /reference/ranges/end.md] -* ref[link /reference/functional/ref.md] ## 概要 2つの範囲を等値比較する。 diff --git a/reference/algorithm/ranges_fill_n.md b/reference/algorithm/ranges_fill_n.md index 4916416db0..690d0ad500 100644 --- a/reference/algorithm/ranges_fill_n.md +++ b/reference/algorithm/ranges_fill_n.md @@ -41,7 +41,7 @@ int main() { std::ranges::fill_n(std::ostream_iterator(std::cout, ","), 10, 3); } ``` -* std::fill_n[color ff0000] +* std::ranges::fill_n[color ff0000] ### 出力 ``` diff --git a/reference/algorithm/ranges_find.md b/reference/algorithm/ranges_find.md index d7d1df6a92..deb2ea76be 100644 --- a/reference/algorithm/ranges_find.md +++ b/reference/algorithm/ranges_find.md @@ -104,7 +104,6 @@ inline constexpr find_impl find; * ranges::equal_to[link /reference/functional/ranges_equal_to.md] * input_range[link /reference/ranges/input_range.md] * projected[link /reference/iterator/projected.md] -* invoke[link /reference/functional/invoke.md] * begin[link /reference/ranges/begin.md] * end[link /reference/ranges/end.md] * ref[link /reference/functional/ref.md] diff --git a/reference/algorithm/ranges_generate.md b/reference/algorithm/ranges_generate.md index c07e9c82b5..174670b73c 100644 --- a/reference/algorithm/ranges_generate.md +++ b/reference/algorithm/ranges_generate.md @@ -69,7 +69,7 @@ int main() { } } ``` -* std::generate[color ff0000] +* std::ranges::generate[color ff0000] ### 出力 ``` diff --git a/reference/algorithm/ranges_generate_n.md b/reference/algorithm/ranges_generate_n.md index 04ff5213fa..69e58346d1 100644 --- a/reference/algorithm/ranges_generate_n.md +++ b/reference/algorithm/ranges_generate_n.md @@ -55,7 +55,7 @@ int main() { std::ranges::generate_n(std::ostream_iterator(std::cout, ","), 10, [&n]{ auto t = n; n *= 2; return t; }); } ``` -* std::generate_n[color ff0000] +* std::ranges::generate_n[color ff0000] ### 出力 ``` diff --git a/reference/algorithm/ranges_max_element.md b/reference/algorithm/ranges_max_element.md index 267aee7f72..86a6dab8b9 100644 --- a/reference/algorithm/ranges_max_element.md +++ b/reference/algorithm/ranges_max_element.md @@ -30,7 +30,6 @@ namespace std::ranges { * indirect_strict_weak_order[link /reference/iterator/indirect_strict_weak_order.md] * projected[link /reference/iterator/projected.md] * ranges::less[link /reference/functional/ranges_less.md] -* initializer_list[link /reference/initializer_list/initializer_list.md] * forward_range[link /reference/ranges/forward_range.md] * iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] diff --git a/reference/algorithm/ranges_min_element.md b/reference/algorithm/ranges_min_element.md index 27966205ae..3b758bc3a0 100644 --- a/reference/algorithm/ranges_min_element.md +++ b/reference/algorithm/ranges_min_element.md @@ -30,7 +30,6 @@ namespace std::ranges { * indirect_strict_weak_order[link /reference/iterator/indirect_strict_weak_order.md] * projected[link /reference/iterator/projected.md] * ranges::less[link /reference/functional/ranges_less.md] -* initializer_list[link /reference/initializer_list/initializer_list.md] * forward_range[link /reference/ranges/forward_range.md] * iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] diff --git a/reference/algorithm/ranges_minmax_element.md b/reference/algorithm/ranges_minmax_element.md index cb0d2b76e3..69b9cb6afa 100644 --- a/reference/algorithm/ranges_minmax_element.md +++ b/reference/algorithm/ranges_minmax_element.md @@ -31,7 +31,6 @@ namespace std::ranges { * indirect_strict_weak_order[link /reference/iterator/indirect_strict_weak_order.md] * projected[link /reference/iterator/projected.md] * ranges::less[link /reference/functional/ranges_less.md] -* initializer_list[link /reference/initializer_list/initializer_list.md] * forward_range[link /reference/ranges/forward_range.md] * iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] diff --git a/reference/algorithm/ranges_mismatch.md b/reference/algorithm/ranges_mismatch.md index 71f550a115..d366cdcd9c 100644 --- a/reference/algorithm/ranges_mismatch.md +++ b/reference/algorithm/ranges_mismatch.md @@ -46,14 +46,9 @@ namespace std::ranges { * ranges::equal_to[link /reference/functional/ranges_equal_to.md] * identity[link /reference/functional/identity.md] * indirectly_comparable[link /reference/iterator/indirectly_comparable.md] -* subrange[link /reference/ranges/subrange.md] * input_range[link /reference/ranges/input_range.md] * iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] -* invoke[link /reference/functional/invoke.md] -* begin[link /reference/ranges/begin.md] -* end[link /reference/ranges/end.md] -* ref[link /reference/functional/ref.md] ## 概要 @@ -156,7 +151,6 @@ inline constexpr mismatch_impl mismatch; * ranges::equal_to[link /reference/functional/ranges_equal_to.md] * identity[link /reference/functional/identity.md] * indirectly_comparable[link /reference/iterator/indirectly_comparable.md] -* subrange[link /reference/ranges/subrange.md] * input_range[link /reference/ranges/input_range.md] * iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] diff --git a/reference/algorithm/ranges_move_backward.md b/reference/algorithm/ranges_move_backward.md index a49dc82278..f649a4a920 100644 --- a/reference/algorithm/ranges_move_backward.md +++ b/reference/algorithm/ranges_move_backward.md @@ -96,7 +96,7 @@ int main() { ``` * std::ranges::move_backward[color ff0000] * v.emplace_back[link /reference/vector/vector/emplace_back.md] -* std::move[link move.md] +* std::ranges::move[link ranges_move.md] * std::views::take[link /reference/ranges/take_view.md] ### 出力 diff --git a/reference/algorithm/ranges_prev_permutation.md b/reference/algorithm/ranges_prev_permutation.md index ae00858a1f..fde5260635 100644 --- a/reference/algorithm/ranges_prev_permutation.md +++ b/reference/algorithm/ranges_prev_permutation.md @@ -90,7 +90,7 @@ int main () } while (std::ranges::prev_permutation(v).found); } ``` -* std::prev_permutation[color ff0000] +* std::ranges::prev_permutation[color ff0000] ### 出力 ``` diff --git a/reference/algorithm/ranges_remove_copy_if.md b/reference/algorithm/ranges_remove_copy_if.md index f6a052879a..423a93b346 100644 --- a/reference/algorithm/ranges_remove_copy_if.md +++ b/reference/algorithm/ranges_remove_copy_if.md @@ -83,7 +83,7 @@ int main() { std::ranges::remove_copy_if(v, std::ostream_iterator(std::cout, ","), [](int x) { return x%2 != 0; }); } ``` -* std::remove_copy_if[color ff0000] +* std::ranges::remove_copy_if[color ff0000] ### 出力 ``` diff --git a/reference/algorithm/ranges_rotate.md b/reference/algorithm/ranges_rotate.md index 6fbe6715fc..23d2346954 100644 --- a/reference/algorithm/ranges_rotate.md +++ b/reference/algorithm/ranges_rotate.md @@ -69,7 +69,6 @@ int main() { ``` * std::ranges::rotate[color ff0000] * str.begin()[link /reference/string/basic_string/begin.md] -* str.end()[link /reference/string/basic_string/end.md] #### 出力 ``` @@ -119,7 +118,6 @@ int main() * std::ranges::rotate[color ff0000] * std::ranges::copy[link ranges_copy.md] * seq.begin()[link /reference/vector/vector/begin.md] -* seq.end[link /reference/vector/vector/end.md] * seq.assign[link /reference/vector/vector/assign.md] * std::swap[link /reference/utility/swap.md] diff --git a/reference/algorithm/ranges_rotate_copy.md b/reference/algorithm/ranges_rotate_copy.md index 87cfa3d3e2..0331ba6100 100644 --- a/reference/algorithm/ranges_rotate_copy.md +++ b/reference/algorithm/ranges_rotate_copy.md @@ -74,7 +74,6 @@ int main() { ``` * std::ranges::rotate_copy[color ff0000] * str.begin()[link /reference/string/basic_string/begin.md] -* str.end()[link /reference/string/basic_string/end.md] ### 出力 ``` diff --git a/reference/algorithm/ranges_set_difference.md b/reference/algorithm/ranges_set_difference.md index d93ad1ab27..b65e42f678 100644 --- a/reference/algorithm/ranges_set_difference.md +++ b/reference/algorithm/ranges_set_difference.md @@ -110,7 +110,6 @@ int main() ``` * std::ranges::set_difference[color ff0000] * std::multiset[link /reference/set/multiset.md] -* begin()[link /reference/set/set/begin.md] * end()[link /reference/set/set/end.md] * std::inserter[link /reference/iterator/inserter.md] diff --git a/reference/algorithm/ranges_set_symmetric_difference.md b/reference/algorithm/ranges_set_symmetric_difference.md index e823c3f1e9..523137d701 100644 --- a/reference/algorithm/ranges_set_symmetric_difference.md +++ b/reference/algorithm/ranges_set_symmetric_difference.md @@ -118,7 +118,6 @@ int main() ``` * std::ranges::set_symmetric_difference[color ff0000] * std::multiset[link /reference/set/multiset.md] -* begin()[link /reference/set/set/begin.md] * end()[link /reference/set/set/end.md] * std::inserter[link /reference/iterator/inserter.md] diff --git a/reference/algorithm/ranges_shift_left.md b/reference/algorithm/ranges_shift_left.md index 019b11dd2d..468fc83116 100644 --- a/reference/algorithm/ranges_shift_left.md +++ b/reference/algorithm/ranges_shift_left.md @@ -87,7 +87,7 @@ int main() std::cout << std::endl; } ``` -* std::shift_left[color ff0000] +* std::ranges::shift_left[color ff0000] ### 出力 ``` diff --git a/reference/algorithm/ranges_shuffle.md b/reference/algorithm/ranges_shuffle.md index 28130bad01..a804b5fe62 100644 --- a/reference/algorithm/ranges_shuffle.md +++ b/reference/algorithm/ranges_shuffle.md @@ -112,8 +112,6 @@ int main() { } ``` * std::ranges::shuffle[color ff0000] -* input.begin()[link /reference/string/basic_string/begin.md] -* input.end()[link /reference/string/basic_string/end.md] #### 出力例 ``` diff --git a/reference/algorithm/ranges_stable_sort.md b/reference/algorithm/ranges_stable_sort.md index 2564b1bc7b..584ce90ea8 100644 --- a/reference/algorithm/ranges_stable_sort.md +++ b/reference/algorithm/ranges_stable_sort.md @@ -77,7 +77,7 @@ int main() std::cout << std::endl; } ``` -* std::stable_sort[color ff0000] +* std::ranges::stable_sort[color ff0000] ### 出力 ``` diff --git a/reference/algorithm/ranges_starts_with.md b/reference/algorithm/ranges_starts_with.md index 8331f84c94..5622695015 100644 --- a/reference/algorithm/ranges_starts_with.md +++ b/reference/algorithm/ranges_starts_with.md @@ -111,7 +111,6 @@ inline constexpr starts_with_impl starts_with; * iterator_t[link /reference/ranges/iterator_t.md] * move[link /reference/utility/move.md] * mismatch[link ranges_mismatch.md] -* invoke[link /reference/functional/invoke.md] * begin[link /reference/ranges/begin.md] * end[link /reference/ranges/end.md] * ref[link /reference/functional/ref.md] diff --git a/reference/algorithm/ranges_transform.md b/reference/algorithm/ranges_transform.md index 9586ce3e75..dbb995a60e 100644 --- a/reference/algorithm/ranges_transform.md +++ b/reference/algorithm/ranges_transform.md @@ -179,7 +179,7 @@ int main() { std::vector result; // v1[n] の文字を v2[n] 回繰り返した文字列を返す - std::ranges::transform(v1, v2, std::back_inserter(result), [](char a, int b) { return std::string(b, a); }); + std::ranges::transform(v1, v2, std::back_inserter(result), [](char a, int b) { return std::to_string(b, a); }); for (const std::string& s : result) { std::cout << s << std::endl; diff --git a/reference/algorithm/transform.md b/reference/algorithm/transform.md index 2fde7dbbfa..3c49dc84c9 100644 --- a/reference/algorithm/transform.md +++ b/reference/algorithm/transform.md @@ -136,7 +136,7 @@ int main() { // v1[n] の文字を v2[n] 回繰り返した文字列を返す std::transform(v1.begin(), v1.end(), v2.begin(), std::back_inserter(result), - [](char a, int b) { return std::string(b, a); }); + [](char a, int b) { return std::to_string(b, a); }); std::for_each(result.begin(), result.end(), [](const std::string& s) { std::cout << s << std::endl; }); diff --git a/reference/atomic/atomic_ref/op_or_assign.md b/reference/atomic/atomic_ref/op_or_assign.md index 5b54a8848c..2abc2f024d 100644 --- a/reference/atomic/atomic_ref/op_or_assign.md +++ b/reference/atomic/atomic_ref/op_or_assign.md @@ -47,8 +47,7 @@ int main() std::cout << std::bitset<4>(value).to_string() << std::endl; } ``` -* x |= b;[color ff0000] -* x.load()[link load.md] +* x |= 0b1110;[color ff0000] * to_string()[link /reference/bitset/bitset/to_string.md] #### 出力 diff --git a/reference/cfloat/dbl_epsilon.md b/reference/cfloat/dbl_epsilon.md index 818330fea6..348fdb0d58 100644 --- a/reference/cfloat/dbl_epsilon.md +++ b/reference/cfloat/dbl_epsilon.md @@ -40,7 +40,7 @@ int main() std::cout << std::pow(FLT_RADIX, 1 - DBL_MANT_DIG) << '\n'; } ``` -* sts::setprecision[link /reference/iomanip/setprecision.md] +* std::setprecision[link /reference/iomanip/setprecision.md] * DBL_EPSILON[color ff0000] * FLT_RADIX[link flt_radix.md] * DBL_DIG[link dbl_dig.md] diff --git a/reference/cfloat/dbl_max.md b/reference/cfloat/dbl_max.md index b66ef3ac23..113a856a70 100644 --- a/reference/cfloat/dbl_max.md +++ b/reference/cfloat/dbl_max.md @@ -41,7 +41,7 @@ int main() std::cout << (1 - std::pow(FLT_RADIX, -DBL_MANT_DIG)) * std::pow(FLT_RADIX, DBL_MAX_EXP - 1) * FLT_RADIX << '\n'; } ``` -* sts::setprecision[link /reference/iomanip/setprecision.md] +* std::setprecision[link /reference/iomanip/setprecision.md] * DBL_MAX[color ff0000] * FLT_RADIX[link flt_radix.md] * DBL_DIG[link dbl_dig.md] diff --git a/reference/cfloat/dbl_min.md b/reference/cfloat/dbl_min.md index e42b2efb42..71b01434b2 100644 --- a/reference/cfloat/dbl_min.md +++ b/reference/cfloat/dbl_min.md @@ -41,7 +41,7 @@ int main() std::cout << std::pow(FLT_RADIX, DBL_MIN_EXP - 1) << '\n'; } ``` -* sts::setprecision[link /reference/iomanip/setprecision.md] +* std::setprecision[link /reference/iomanip/setprecision.md] * DBL_MIN[color ff0000] * FLT_RADIX[link flt_radix.md] * DBL_DIG[link dbl_dig.md] diff --git a/reference/cfloat/dbl_true_min.md b/reference/cfloat/dbl_true_min.md index ab8a9ebd78..61c29a52f1 100644 --- a/reference/cfloat/dbl_true_min.md +++ b/reference/cfloat/dbl_true_min.md @@ -36,7 +36,7 @@ int main() } ``` * DBL_TRUE_MIN[color ff0000] -* sts::setprecision[link /reference/iomanip/setprecision.md] +* std::setprecision[link /reference/iomanip/setprecision.md] * DBL_DIG[link dbl_dig.md] * DBL_HAS_SUBNORM[link dbl_has_subnorm.md] * DBL_MIN[link dbl_min.md] diff --git a/reference/cfloat/flt_epsilon.md b/reference/cfloat/flt_epsilon.md index 418909ec45..fa5e040ff7 100644 --- a/reference/cfloat/flt_epsilon.md +++ b/reference/cfloat/flt_epsilon.md @@ -40,7 +40,7 @@ int main() std::cout << std::pow(FLT_RADIX, 1 - FLT_MANT_DIG) << '\n'; } ``` -* sts::setprecision[link /reference/iomanip/setprecision.md] +* std::setprecision[link /reference/iomanip/setprecision.md] * FLT_EPSILON[color ff0000] * FLT_RADIX[link flt_radix.md] * FLT_DIG[link flt_dig.md] diff --git a/reference/cfloat/flt_min.md b/reference/cfloat/flt_min.md index c41100e258..16c00f6726 100644 --- a/reference/cfloat/flt_min.md +++ b/reference/cfloat/flt_min.md @@ -41,7 +41,7 @@ int main() std::cout << std::pow((float)FLT_RADIX, (float)(FLT_MIN_EXP - 1)) << '\n'; } ``` -* sts::setprecision[link /reference/iomanip/setprecision.md] +* std::setprecision[link /reference/iomanip/setprecision.md] * FLT_MIN[color ff0000] * FLT_RADIX[link flt_radix.md] * FLT_DIG[link flt_dig.md] diff --git a/reference/cfloat/flt_true_min.md b/reference/cfloat/flt_true_min.md index ef514f5343..8ae3aceaee 100644 --- a/reference/cfloat/flt_true_min.md +++ b/reference/cfloat/flt_true_min.md @@ -36,7 +36,7 @@ int main() } ``` * FLT_TRUE_MIN[color ff0000] -* sts::setprecision[link /reference/iomanip/setprecision.md] +* std::setprecision[link /reference/iomanip/setprecision.md] * FLT_DIG[link flt_dig.md] * FLT_HAS_SUBNORM[link flt_has_subnorm.md] * FLT_MIN[link flt_min.md] diff --git a/reference/cfloat/ldbl_epsilon.md b/reference/cfloat/ldbl_epsilon.md index 113b99cd50..b5a0f4572a 100644 --- a/reference/cfloat/ldbl_epsilon.md +++ b/reference/cfloat/ldbl_epsilon.md @@ -40,7 +40,7 @@ int main() std::cout << std::pow(FLT_RADIX, 1 - LDBL_MANT_DIG) << '\n'; } ``` -* sts::setprecision[link /reference/iomanip/setprecision.md] +* std::setprecision[link /reference/iomanip/setprecision.md] * LDBL_EPSILON[color ff0000] * FLT_RADIX[link flt_radix.md] * LDBL_DIG[link ldbl_dig.md] diff --git a/reference/cfloat/ldbl_max.md b/reference/cfloat/ldbl_max.md index 02490dfca4..242f51a1e7 100644 --- a/reference/cfloat/ldbl_max.md +++ b/reference/cfloat/ldbl_max.md @@ -41,7 +41,7 @@ int main() std::cout << (1 - std::pow((long double)FLT_RADIX, -LDBL_MANT_DIG)) * std::pow((long double)FLT_RADIX, LDBL_MAX_EXP - 1) * FLT_RADIX << '\n'; } ``` -* sts::setprecision[link /reference/iomanip/setprecision.md] +* std::setprecision[link /reference/iomanip/setprecision.md] * LDBL_MAX[color ff0000] * FLT_RADIX[link flt_radix.md] * LDBL_DIG[link ldbl_dig.md] diff --git a/reference/cfloat/ldbl_max_exp.md b/reference/cfloat/ldbl_max_exp.md index 337a096eb8..b116229907 100644 --- a/reference/cfloat/ldbl_max_exp.md +++ b/reference/cfloat/ldbl_max_exp.md @@ -39,7 +39,7 @@ int main() std::cout << std::pow((long double)FLT_RADIX, LDBL_MAX_EXP) << '\n'; } ``` -* sts::setprecision[link /reference/iomanip/setprecision.md] +* std::setprecision[link /reference/iomanip/setprecision.md] * LDBL_MAX_EXP[color ff0000] * FLT_RADIX[link flt_radix.md] * LDBL_DIG[link ldbl_dig.md] diff --git a/reference/cfloat/ldbl_min.md b/reference/cfloat/ldbl_min.md index 102c9f6b03..f3aaa736b9 100644 --- a/reference/cfloat/ldbl_min.md +++ b/reference/cfloat/ldbl_min.md @@ -41,7 +41,7 @@ int main() std::cout << std::pow((long double)FLT_RADIX, LDBL_MIN_EXP - 1) << '\n'; } ``` -* sts::setprecision[link /reference/iomanip/setprecision.md] +* std::setprecision[link /reference/iomanip/setprecision.md] * LDBL_MIN[color ff0000] * FLT_RADIX[link flt_radix.md] * LDBL_DIG[link ldbl_dig.md] diff --git a/reference/cfloat/ldbl_true_min.md b/reference/cfloat/ldbl_true_min.md index 982fe08319..154ea86090 100644 --- a/reference/cfloat/ldbl_true_min.md +++ b/reference/cfloat/ldbl_true_min.md @@ -36,7 +36,7 @@ int main() } ``` * LDBL_TRUE_MIN[color ff0000] -* sts::setprecision[link /reference/iomanip/setprecision.md] +* std::setprecision[link /reference/iomanip/setprecision.md] * LDBL_DIG[link ldbl_dig.md] * LDBL_HAS_SUBNORM[link ldbl_has_subnorm.md] * LDBL_MIN[link ldbl_min.md] diff --git a/reference/chrono/ambiguous_local_time.md b/reference/chrono/ambiguous_local_time.md index 5504442987..371f211418 100644 --- a/reference/chrono/ambiguous_local_time.md +++ b/reference/chrono/ambiguous_local_time.md @@ -39,8 +39,6 @@ os << tp << " is ambiguous. It could be\n" return os.str().c_str(); ``` -* local_seconds[link local_time.md] -* time_since_epoch()[link time_point/time_since_epoch.md] ## 例 diff --git a/reference/chrono/gps_time.md b/reference/chrono/gps_time.md index 0e962cd38d..a995ab5936 100644 --- a/reference/chrono/gps_time.md +++ b/reference/chrono/gps_time.md @@ -149,7 +149,6 @@ int main() } ``` * chrono::from_stream[color ff0000] -* offset.count()[link duration/count.md] #### 出力例 ``` diff --git a/reference/chrono/local_time.md b/reference/chrono/local_time.md index 05a89e765b..db628b0098 100644 --- a/reference/chrono/local_time.md +++ b/reference/chrono/local_time.md @@ -162,7 +162,6 @@ int main() } ``` * chrono::from_stream[color ff0000] -* offset.count()[link duration/count.md] #### 出力例 ``` diff --git a/reference/chrono/locate_zone.md b/reference/chrono/locate_zone.md index 99f64aee93..7ae502cfc0 100644 --- a/reference/chrono/locate_zone.md +++ b/reference/chrono/locate_zone.md @@ -22,7 +22,7 @@ namespace std::chrono { return get_tzdb().locate_zone(tz_name); ``` * get_tzdb()[link get_tzdb.md] -* locate_zone()[link tzdb/locate_zone.md] +* locate_zone[link tzdb/locate_zone.md] ## 例外 diff --git a/reference/chrono/month_weekday/op_append.md b/reference/chrono/month_weekday/op_append.md index 99a05ef9e6..7cafb9f774 100644 --- a/reference/chrono/month_weekday/op_append.md +++ b/reference/chrono/month_weekday/op_append.md @@ -48,7 +48,7 @@ int main() * March[link /reference/chrono/month_constants.md] * Sunday[link /reference/chrono/weekday_constants.md] * 2020y[link /reference/chrono/year/op_y.md] -* chrono::year_month_weekday[link /reference/chrono/year_month_weekday.md] +* year_month_weekday[link /reference/chrono/year_month_weekday.md] ### 出力 ``` diff --git a/reference/chrono/month_weekday_last/op_append.md b/reference/chrono/month_weekday_last/op_append.md index 7063980e16..0bb75e882b 100644 --- a/reference/chrono/month_weekday_last/op_append.md +++ b/reference/chrono/month_weekday_last/op_append.md @@ -49,7 +49,7 @@ int main() * Sunday[link /reference/chrono/weekday_constants.md] * 2020y[link /reference/chrono/year/op_y.md] * last[link /reference/chrono/last_spec.md] -* chrono::year_month_weekday_last[link /reference/chrono/year_month_weekday_last.md] +* year_month_weekday_last[link /reference/chrono/year_month_weekday_last.md] ### 出力 ``` diff --git a/reference/chrono/month_weekday_last/op_constructor.md b/reference/chrono/month_weekday_last/op_constructor.md index 56da899b81..9da56b9bdb 100644 --- a/reference/chrono/month_weekday_last/op_constructor.md +++ b/reference/chrono/month_weekday_last/op_constructor.md @@ -15,7 +15,6 @@ month_weekday_last(const month_weekday_last&) = default; // (3) C++20 month_weekday_last(month_weekday_last&&) = default; // (4) C++20 ``` * chrono::month[link /reference/chrono/month.md] -* chrono::weekday_indexed[link /reference/chrono/weekday_indexed.md] ## 概要 - (1) : デフォルトコンストラクタ。定義されない diff --git a/reference/chrono/tai_time.md b/reference/chrono/tai_time.md index eeb23338a3..d4b24f1071 100644 --- a/reference/chrono/tai_time.md +++ b/reference/chrono/tai_time.md @@ -148,7 +148,6 @@ int main() } ``` * chrono::from_stream[color ff0000] -* offset.count()[link duration/count.md] #### 出力例 ``` diff --git a/reference/chrono/time_point/op_greater.md b/reference/chrono/time_point/op_greater.md index 11c637ad32..14a0914a87 100644 --- a/reference/chrono/time_point/op_greater.md +++ b/reference/chrono/time_point/op_greater.md @@ -26,7 +26,7 @@ namespace chrono { ```cpp return lhs.time_since_epoch() > rhs.time_since_poch(); ``` -* time_since_spoch[link /reference/chrono/time_point/time_since_epoch.md] +* time_since_epoch[link /reference/chrono/time_point/time_since_epoch.md] ## 例 ```cpp example diff --git a/reference/chrono/time_point/op_greater_equal.md b/reference/chrono/time_point/op_greater_equal.md index 429be0847b..1cc3424895 100644 --- a/reference/chrono/time_point/op_greater_equal.md +++ b/reference/chrono/time_point/op_greater_equal.md @@ -26,7 +26,7 @@ namespace chrono { ```cpp return lhs.time_since_epoch() < rhs.time_since_poch(); ``` -* time_since_spoch[link /reference/chrono/time_point/time_since_epoch.md] +* time_since_epoch[link /reference/chrono/time_point/time_since_epoch.md] ## 例 diff --git a/reference/chrono/time_point/op_less.md b/reference/chrono/time_point/op_less.md index 2acc74a0fb..cd84040b37 100644 --- a/reference/chrono/time_point/op_less.md +++ b/reference/chrono/time_point/op_less.md @@ -26,7 +26,7 @@ namespace chrono { ```cpp return lhs.time_since_epoch() < rhs.time_since_poch(); ``` -* time_since_spoch[link /reference/chrono/time_point/time_since_epoch.md] +* time_since_epoch[link /reference/chrono/time_point/time_since_epoch.md] ## 例 ```cpp example diff --git a/reference/chrono/time_point/op_less_equal.md b/reference/chrono/time_point/op_less_equal.md index f5883d03f6..b7d141b4ec 100644 --- a/reference/chrono/time_point/op_less_equal.md +++ b/reference/chrono/time_point/op_less_equal.md @@ -26,7 +26,7 @@ namespace chrono { ```cpp return lhs.time_since_epoch() <= rhs.time_since_poch(); ``` -* time_since_spoch[link /reference/chrono/time_point/time_since_epoch.md] +* time_since_epoch[link /reference/chrono/time_point/time_since_epoch.md] ## 例 diff --git a/reference/chrono/time_point/round.md b/reference/chrono/time_point/round.md index 8b5f483cbe..e504ce44ff 100644 --- a/reference/chrono/time_point/round.md +++ b/reference/chrono/time_point/round.md @@ -20,7 +20,7 @@ namespace std::chrono { ```cpp return time_point{round(tp.time_since_epoch())}; ``` -* ceil[link /reference/chrono/duration/ceil.md] +* round[link /reference/chrono/duration/round.md] * tp.time_since_epoch()[link time_since_epoch.md] diff --git a/reference/chrono/time_zone/to_local.md b/reference/chrono/time_zone/to_local.md index 81c93601b5..da1f251f70 100644 --- a/reference/chrono/time_zone/to_local.md +++ b/reference/chrono/time_zone/to_local.md @@ -53,7 +53,6 @@ int main() * time_since_epoch()[link /reference/chrono/time_point/time_since_epoch.md] * chrono::locate_zone[link /reference/chrono/locate_zone.md] * 9h[link /reference/chrono/duration/op_h.md] -* chrono::sys_time[link /reference/chrono/sys_time.md] * chrono::floor[link /reference/chrono/time_point/floor.md] ### 出力 diff --git a/reference/chrono/utc_clock/to_sys.md b/reference/chrono/utc_clock/to_sys.md index 589cd28fd1..3ed3614fee 100644 --- a/reference/chrono/utc_clock/to_sys.md +++ b/reference/chrono/utc_clock/to_sys.md @@ -44,7 +44,6 @@ int main() * to_sys[color ff0000] * from_sys[link from_sys.md] * sys_days[link /reference/chrono/sys_time.md] -* system_clock[link /reference/chrono/system_clock.md] * July[link /reference/chrono/month_constants.md] * time_since_epoch()[link /reference/chrono/time_point/time_since_epoch.md] diff --git a/reference/chrono/weekday/op_at.md b/reference/chrono/weekday/op_at.md index db488a35b6..8ac1c59ec8 100644 --- a/reference/chrono/weekday/op_at.md +++ b/reference/chrono/weekday/op_at.md @@ -55,8 +55,8 @@ int main() } } ``` -* chrono::Sunday[link /reference/chrono/weekday_constants.md] -* chrono::November[link /reference/chrono/month_constants.md] +* Sunday[link /reference/chrono/weekday_constants.md] +* November[link /reference/chrono/month_constants.md] * last[link /reference/chrono/last_spec.md] * year_month_weekday[link /reference/chrono/year_month_weekday.md] * year_month_weekday_last[link /reference/chrono/year_month_weekday_last.md] diff --git a/reference/chrono/year_month_day.md b/reference/chrono/year_month_day.md index 89c9eef9f6..9ada4327fc 100644 --- a/reference/chrono/year_month_day.md +++ b/reference/chrono/year_month_day.md @@ -280,7 +280,6 @@ int main() ``` * 1985y[link year/op_y.md] * 1954y[link year/op_y.md] -* 2000y[link year/op_y.md] * date.ok()[link year_month_day/ok.md] * year()[link year_month_day/year.md] * month()[link year_month_day/month.md] diff --git a/reference/chrono/year_month_weekday/formatter.md b/reference/chrono/year_month_weekday/formatter.md index 9e3624c778..4fb2682367 100644 --- a/reference/chrono/year_month_weekday/formatter.md +++ b/reference/chrono/year_month_weekday/formatter.md @@ -37,7 +37,6 @@ int main() { } ``` * std::format[link /reference/chrono/format.md] -* std::locale[link /reference/locale/locale.md] * 2020y[link /reference/chrono/year/op_y.md] * chrono::Sunday[link /reference/chrono/weekday_constants.md] diff --git a/reference/chrono/year_month_weekday/op_minus_assign.md b/reference/chrono/year_month_weekday/op_minus_assign.md index d6c2bf7fbd..50351c88cb 100644 --- a/reference/chrono/year_month_weekday/op_minus_assign.md +++ b/reference/chrono/year_month_weekday/op_minus_assign.md @@ -54,7 +54,7 @@ int main() assert(chrono::year_month_day{chrono::sys_days{date}} == 2020y/3/8); } ``` -* 2019y[link /reference/chrono/year/op_y.md] +* 2021y[link /reference/chrono/year/op_y.md] * 2020y[link /reference/chrono/year/op_y.md] * chrono::Sunday[link /reference/chrono/weekday_constants.md] * chrono::year_month_day[link /reference/chrono/year_month_day.md] diff --git a/reference/chrono/year_month_weekday/op_plus.md b/reference/chrono/year_month_weekday/op_plus.md index 4557d5389d..233de3cc2d 100644 --- a/reference/chrono/year_month_weekday/op_plus.md +++ b/reference/chrono/year_month_weekday/op_plus.md @@ -55,7 +55,7 @@ return ymwd + dm; - (3) : ```cpp -return (ymwd.year() + dy) / ywmd.month() / ywmd.weekday_indexed(); +return (ymwd.year() + dy) / ymwd.month() / ymwd.weekday_indexed(); ``` * ymwd.year()[link year.md] * ymwd.month()[link month.md] diff --git a/reference/chrono/year_month_weekday_last/formatter.md b/reference/chrono/year_month_weekday_last/formatter.md index 12ff5ce70f..b80f0f0b5c 100644 --- a/reference/chrono/year_month_weekday_last/formatter.md +++ b/reference/chrono/year_month_weekday_last/formatter.md @@ -37,7 +37,6 @@ int main() { } ``` * std::format[link /reference/chrono/format.md] -* std::locale[link /reference/locale/locale.md] * 2020y[link /reference/chrono/year/op_y.md] * chrono::Sunday[link /reference/chrono/weekday_constants.md] * chrono::last[link /reference/chrono/last_spec.md] diff --git a/reference/chrono/year_month_weekday_last/op_minus_assign.md b/reference/chrono/year_month_weekday_last/op_minus_assign.md index 741835a6b3..f2eff19153 100644 --- a/reference/chrono/year_month_weekday_last/op_minus_assign.md +++ b/reference/chrono/year_month_weekday_last/op_minus_assign.md @@ -54,7 +54,7 @@ int main() assert(chrono::year_month_day{chrono::sys_days{date}} == 2020y/3/29); } ``` -* 2019y[link /reference/chrono/year/op_y.md] +* 2021y[link /reference/chrono/year/op_y.md] * 2020y[link /reference/chrono/year/op_y.md] * chrono::Sunday[link /reference/chrono/weekday_constants.md] * chrono::last[link /reference/chrono/last_spec.md] diff --git a/reference/chrono/year_month_weekday_last/op_plus.md b/reference/chrono/year_month_weekday_last/op_plus.md index 7f0ead02c6..9fc1604de2 100644 --- a/reference/chrono/year_month_weekday_last/op_plus.md +++ b/reference/chrono/year_month_weekday_last/op_plus.md @@ -55,7 +55,7 @@ return ymwdl + dm; - (3) : ```cpp -return (ymwdl.year() + dy) / ywmdl.month() / ywmdl.weekday_last(); +return (ymwdl.year() + dy) / ymwdl.month() / ymwdl.weekday_last(); ``` * ymwdl.year()[link year.md] * ymwdl.month()[link month.md] diff --git a/reference/chrono/year_month_weekday_last/weekday_last.md b/reference/chrono/year_month_weekday_last/weekday_last.md index 680c42839b..620553fc92 100644 --- a/reference/chrono/year_month_weekday_last/weekday_last.md +++ b/reference/chrono/year_month_weekday_last/weekday_last.md @@ -34,7 +34,7 @@ int main() } ``` * date.weekday_last()[color ff0000] -* chrono::weekday_indexed[link /reference/chrono/weekday_indexed.md] +* chrono::weekday_last[link /reference/chrono/weekday_last.md] * 2020y[link /reference/chrono/year/op_y.md] * chrono::Sunday[link /reference/chrono/weekday_constants.md] * chrono::last[link /reference/chrono/last_spec.md] diff --git a/reference/chrono/zoned_time/op_deduction_guide.md b/reference/chrono/zoned_time/op_deduction_guide.md index ab6784e803..c937d247cf 100644 --- a/reference/chrono/zoned_time/op_deduction_guide.md +++ b/reference/chrono/zoned_time/op_deduction_guide.md @@ -128,7 +128,6 @@ int main() ``` * chrono::locate_zone[link /reference/chrono/locate_zone.md] * chrono::floor[link /reference/chrono/time_point/floor.md] -* time_since_epoch()[link /reference/chrono/time_point/time_since_epoch.md] * chrono::system_clock[link /reference/chrono/system_clock.md] * now()[link /reference/chrono/system_clock/now.md] * chrono::time_zone[link /reference/chrono/time_zone.md] diff --git a/reference/cmath/hypot.md b/reference/cmath/hypot.md index 72e81ace99..041d83f2c6 100644 --- a/reference/cmath/hypot.md +++ b/reference/cmath/hypot.md @@ -20,7 +20,7 @@ namespace std { float hypot(float x, float y, float z); // (8) C++17 から long double hypot(long double x, long double y, long double z); // (9) C++17 から - Promoted hypot(Arithmetic1 x, Arithmetic2 y, Arithmetic2 z); // (10) C++17 から + Promoted hypot(Arithmetic1 x, Arithmetic2 y, Arithmetic3 z); // (10) C++17 から } ``` * Promoted[italic] diff --git a/reference/compare/compare_three_way_result.md b/reference/compare/compare_three_way_result.md index 8af93a5ed7..edf34bbaca 100644 --- a/reference/compare/compare_three_way_result.md +++ b/reference/compare/compare_three_way_result.md @@ -78,7 +78,7 @@ int main() std::cout << (t1 >= t2) << std::endl; } ``` -* compare_three_way_result_t[color ff0000] +* compare_three_way_result[color ff0000] * type_identity[link /reference/type_traits/type_identity.md] ### 出力 diff --git a/reference/compare/three_way_comparable.md b/reference/compare/three_way_comparable.md index 2ca9e777a4..49c44dd758 100644 --- a/reference/compare/three_way_comparable.md +++ b/reference/compare/three_way_comparable.md @@ -60,7 +60,6 @@ concept three_way_comparable = * partial_ordering[link /reference/compare/partial_ordering.md] * weakly-equality-comparable-with[link /reference/concepts/equality_comparable.md] * remove_reference_t[link /reference/type_traits/remove_reference.md] -* convertible_to[link /reference/concepts/convertible_to.md] - (2) : 以下のように定義される。 @@ -82,7 +81,6 @@ concept three_way_comparable_with = * partial_ordering[link /reference/compare/partial_ordering.md] * weakly-equality-comparable-with[link /reference/concepts/equality_comparable.md] * remove_reference_t[link /reference/type_traits/remove_reference.md] -* convertible_to[link /reference/concepts/convertible_to.md] * common_reference_with[link /reference/concepts/common_reference_with.md] * common_reference_t[link /reference/type_traits/common_reference.md] diff --git a/reference/concepts/common_with.md b/reference/concepts/common_with.md index bed016ee04..83ab9c767b 100644 --- a/reference/concepts/common_with.md +++ b/reference/concepts/common_with.md @@ -72,7 +72,7 @@ int main() f, std::pair>(); } ``` -* std::common_reference_with[color ff0000] +* std::common_with[color ff0000] ### 出力 ``` diff --git a/reference/concepts/relation.md b/reference/concepts/relation.md index 12affba438..9bb2bb7291 100644 --- a/reference/concepts/relation.md +++ b/reference/concepts/relation.md @@ -12,9 +12,7 @@ namespace std { predicate && predicate; } ``` -* regular_invocable[link /reference/concepts/invocable.md] -* boolean-testable[link /reference/concepts/boolean-testable.md] -* invoke_result_t[link /reference/type_traits/invoke_result.md] +* predicate[link predicate.md] ## 概要 diff --git a/reference/concepts/swappable.md b/reference/concepts/swappable.md index 236c0c4be2..45216dac3d 100644 --- a/reference/concepts/swappable.md +++ b/reference/concepts/swappable.md @@ -21,8 +21,8 @@ namespace std { } ``` * swap[link /reference/concepts/swap.md] -* remove_reference_t[link /reference/type_traits/remove_reference.md] * common_reference_with[link /reference/concepts/common_reference_with.md] +* std::forward[link /reference/utility/forward.md] ## 概要 diff --git a/reference/concepts/totally_ordered.md b/reference/concepts/totally_ordered.md index c2148ab631..feaab818d0 100644 --- a/reference/concepts/totally_ordered.md +++ b/reference/concepts/totally_ordered.md @@ -22,8 +22,6 @@ namespace std { partially-ordered-with; } ``` -* boolean[link /reference/concepts/boolean-testable.md] -* common_reference_with[link /reference/concepts/common_reference_with.md] * common_reference_t[link /reference/type_traits/common_reference.md] * equality_comparable[link /reference/concepts/equality_comparable.md] * equality_comparable_with[link /reference/concepts/equality_comparable.md] diff --git a/reference/coroutine/coroutine_handle.md b/reference/coroutine/coroutine_handle.md index da8306f0cf..2070d733d8 100644 --- a/reference/coroutine/coroutine_handle.md +++ b/reference/coroutine/coroutine_handle.md @@ -20,7 +20,6 @@ namespace std { }; } ``` -* hash[link /reference/functional/hash.md] ## 概要 コルーチンに対応するコルーチンハンドル。 diff --git a/reference/exception/bad_exception.md b/reference/exception/bad_exception.md index 6dde728281..a2ce7399a5 100644 --- a/reference/exception/bad_exception.md +++ b/reference/exception/bad_exception.md @@ -74,7 +74,7 @@ int main() * std::bad_exception[color ff0000] * std::runtime_error[link /reference/stdexcept.md] * std::invalid_argument[link /reference/stdexcept.md] -* std::unexpected[link unexpected.md] +* std::set_unexpected[link set_unexpected.md] #### 出力 diff --git a/reference/expected/expected/error_or.md b/reference/expected/expected/error_or.md index e455fd3304..e99602e947 100644 --- a/reference/expected/expected/error_or.md +++ b/reference/expected/expected/error_or.md @@ -39,7 +39,7 @@ int main() std::cout << y.error_or("-") << std::endl; } ``` -* error_or()[color ff0000] +* error_or[color ff0000] * std::unexpected[link ../unexpected.md] ### 出力 diff --git a/reference/expected/expected/value_or.md b/reference/expected/expected/value_or.md index 5922c5ec96..e7431122aa 100644 --- a/reference/expected/expected/value_or.md +++ b/reference/expected/expected/value_or.md @@ -39,7 +39,7 @@ int main() std::cout << y.value_or(0) << std::endl; } ``` -* value_or()[color ff0000] +* value_or[color ff0000] * std::unexpected[link ../unexpected.md] ### 出力 diff --git a/reference/filesystem/equivalent.md b/reference/filesystem/equivalent.md index 70b54435a6..0105fafc53 100644 --- a/reference/filesystem/equivalent.md +++ b/reference/filesystem/equivalent.md @@ -11,7 +11,6 @@ namespace std::filesystem { } ``` * path[link path.md] -* std::uintmax_t[link /reference/cstdint/uintmax_t.md] ## 概要 2つのエンティティが等価かを確認する。 diff --git a/reference/filesystem/is_empty.md b/reference/filesystem/is_empty.md index e1f58b814b..da4477e9d3 100644 --- a/reference/filesystem/is_empty.md +++ b/reference/filesystem/is_empty.md @@ -63,7 +63,6 @@ int main() ``` * fs::is_empty[color ff0000] * fs::create_directory[link create_directory.md] -* fs::status[link status.md] ### 出力 ``` diff --git a/reference/format/format_to.md b/reference/format/format_to.md index cfa27ed944..d9f82b0c1f 100644 --- a/reference/format/format_to.md +++ b/reference/format/format_to.md @@ -71,7 +71,6 @@ return vformat_to(out, fmt.str, make_format_args(args...)); // (3), (4) return vformat_to(out, loc, fmt.str, make_wformat_args(args...)); ``` -* basic_format_context[link basic_format_context.md] * vformat_to[link vformat_to.md] * make_format_args[link make_format_args.md] diff --git a/reference/format/range_formatter.md b/reference/format/range_formatter.md index 71ff8a66f8..f838252ef3 100644 --- a/reference/format/range_formatter.md +++ b/reference/format/range_formatter.md @@ -127,7 +127,6 @@ int main() * std::format_context[link basic_format_context.md] * fctx.out()[link basic_format_context/out.md] * fctx.advance_to[link basic_format_context/advance_to.md] -* std::format_to[link format_to.md] * std::format[link format.md] * underlying()[link range_formatter/underlying.md] diff --git a/reference/forward_list/forward_list/splice_after.md b/reference/forward_list/forward_list/splice_after.md index c49b9f8fba..cf07b48606 100644 --- a/reference/forward_list/forward_list/splice_after.md +++ b/reference/forward_list/forward_list/splice_after.md @@ -110,7 +110,6 @@ int main() ``` * splice_after[color ff0000] * begin()[link begin.md] -* end()[link end.md] * std::move[link /reference/utility/move.md] * std::next[link /reference/iterator/next.md] diff --git a/reference/fstream/basic_filebuf/close.md b/reference/fstream/basic_filebuf/close.md index 25921a85f2..fded215193 100644 --- a/reference/fstream/basic_filebuf/close.md +++ b/reference/fstream/basic_filebuf/close.md @@ -51,7 +51,7 @@ int main() * std::fstream[link /reference/fstream/basic_fstream.md] * std::filebuf[link /reference/fstream/basic_filebuf.md] * rdbuf()[link /reference/fstream/basic_fstream/rdbuf.md] -* open()[link /reference/fstream/basic_filebuf/open.md] +* open[link /reference/fstream/basic_filebuf/open.md] * close()[color ff0000] ## バージョン diff --git a/reference/fstream/basic_filebuf/open.md b/reference/fstream/basic_filebuf/open.md index 465cfec12f..b7d1bf2377 100644 --- a/reference/fstream/basic_filebuf/open.md +++ b/reference/fstream/basic_filebuf/open.md @@ -72,10 +72,10 @@ int main() } } ``` +* buf->open[color ff0000] * std::fstream[link /reference/fstream/basic_fstream.md] * std::filebuf[link /reference/fstream/basic_filebuf.md] * rdbuf()[link /reference/fstream/basic_fstream/rdbuf.md] -* buf->open()[color ff0000] ## バージョン ### 言語 diff --git a/reference/fstream/basic_fstream.md b/reference/fstream/basic_fstream.md index 7860748032..d0c1c530df 100644 --- a/reference/fstream/basic_fstream.md +++ b/reference/fstream/basic_fstream.md @@ -13,7 +13,7 @@ namespace std { } ``` * char_traits[link /reference/string/char_traits.md] -* basic_istream[link /reference/istream/basic_istream.md] +* basic_iostream[link /reference/istream/basic_iostream.md] ## 概要 diff --git a/reference/future/packaged_task.md b/reference/future/packaged_task.md index fba1ebee60..c8c024c484 100644 --- a/reference/future/packaged_task.md +++ b/reference/future/packaged_task.md @@ -102,7 +102,7 @@ int main() * std::packaged_task[color ff0000] * task.get_future()[link packaged_task/get_future.md] * std::future[link future.md] -* std::f.get()[link future/get.md] +* f.get()[link future/get.md] * std::move[link /reference/utility/move.md] * t.detach()[link /reference/thread/thread/detach.md] diff --git a/reference/ios/basic_ios/clear.md b/reference/ios/basic_ios/clear.md index 70665a3d71..9fd2f5d4cb 100644 --- a/reference/ios/basic_ios/clear.md +++ b/reference/ios/basic_ios/clear.md @@ -44,7 +44,6 @@ void clear(iostate state = goodbit) { * goodbit[link ../ios_base/type-iostate.md] * badbit[link ../ios_base/type-iostate.md] * failure[link ../ios_base/failure.md] -* ios_base[link ../ios_base.md] ## 戻り値 なし diff --git a/reference/ios/basic_ios/fill.md b/reference/ios/basic_ios/fill.md index f0be0154fd..49dcdfed70 100644 --- a/reference/ios/basic_ios/fill.md +++ b/reference/ios/basic_ios/fill.md @@ -9,7 +9,6 @@ char_type fill() const; // (1) char_type fill(char_type fillch); // (2) ``` -* basic_ios[link ../basic_ios.md] ## 概要 埋め文字を取得・設定する。 diff --git a/reference/ios/ios_base/register_callback.md b/reference/ios/ios_base/register_callback.md index 2c96dc2a76..3f5baa92f1 100644 --- a/reference/ios/ios_base/register_callback.md +++ b/reference/ios/ios_base/register_callback.md @@ -78,7 +78,6 @@ int main() } ``` * std::ios_base[link ../ios_base.md] -* std::basic_ios[link ../basic_ios.md] * std::stringstream[link ../../sstream/basic_stringstream.md.nolink] * erase_event[link type-event.md] * copyfmt_event[link type-event.md] diff --git a/reference/ios/ios_base/type-event.md b/reference/ios/ios_base/type-event.md index 85b00a0e1b..1c62cd5909 100644 --- a/reference/ios/ios_base/type-event.md +++ b/reference/ios/ios_base/type-event.md @@ -66,7 +66,6 @@ int main() } ``` * std::ios_base[link ../ios_base.md] -* std::basic_ios[link ../basic_ios.md] * std::stringstream[link ../../sstream/basic_stringstream.md.nolink] * event[color ff0000] * erase_event[color ff0000] diff --git a/reference/ios/ios_base/type-fmtflags.md b/reference/ios/ios_base/type-fmtflags.md index 69a6e3ea07..b1cca8cf21 100644 --- a/reference/ios/ios_base/type-fmtflags.md +++ b/reference/ios/ios_base/type-fmtflags.md @@ -150,7 +150,6 @@ int main() * std::oct[link ../oct.md] * std::dec[link ../dec.md] * showbase[color ff0000] -* uppercase[color ff0000] * basefield[color ff0000] * hex[color ff0000] * oct[color ff0000] diff --git a/reference/ios/iostream_category.md b/reference/ios/iostream_category.md index 742e1ff19b..14a73c5895 100644 --- a/reference/ios/iostream_category.md +++ b/reference/ios/iostream_category.md @@ -46,7 +46,7 @@ int main() * std::iostream_category[color ff0000] * std::error_category[link /reference/system_error/error_category.md] * cat.name()[link /reference/system_error/error_category/name.md] -* cat.message()[link /reference/system_error/error_category/message.md] +* cat.message[link /reference/system_error/error_category/message.md] * std::io_errc::stream[link io_errc.md] ### 出力例 diff --git a/reference/istream/basic_istream/seekg.md b/reference/istream/basic_istream/seekg.md index 96d35213c6..949ee5a3ae 100644 --- a/reference/istream/basic_istream/seekg.md +++ b/reference/istream/basic_istream/seekg.md @@ -106,7 +106,7 @@ basic_istream& seekg(off_type off, seekdir dir) { * eofbit[link /reference/ios/ios_base/type-iostate.md] * sentry[link sentry.md] * rdbuf()[link /reference/ios/basic_ios/rdbuf.md] -* pubseekpos()[link /reference/streambuf/basic_streambuf/pubseekpos.md.nolink] +* pubseekpos[link /reference/streambuf/basic_streambuf/pubseekpos.md.nolink] * ios_base[link /reference/ios/ios_base.md] * in[link /reference/ios/ios_base/type-openmode.md] * failbit[link /reference/ios/ios_base/type-iostate.md] diff --git a/reference/istream/basic_istream/sentry/op_constructor.md b/reference/istream/basic_istream/sentry/op_constructor.md index 7ef7081327..09712203f3 100644 --- a/reference/istream/basic_istream/sentry/op_constructor.md +++ b/reference/istream/basic_istream/sentry/op_constructor.md @@ -7,7 +7,6 @@ ```cpp explicit sentry(basic_istream& is, bool noskipws = false); ``` -* char_traits[link ../../../string/char_traits.md] * basic_istream[link ../../basic_istream.md] ## 概要 diff --git a/reference/iterator/common_iterator/iter_swap.md b/reference/iterator/common_iterator/iter_swap.md index ce4688b2b3..b1a62876bb 100644 --- a/reference/iterator/common_iterator/iter_swap.md +++ b/reference/iterator/common_iterator/iter_swap.md @@ -16,7 +16,8 @@ namespace std { }; } ``` -* move_iterator[link /reference/iterator/move_iterator.md] +* input_or_output_iterator[link /reference/iterator/input_or_output_iterator.md] +* sentinel_for[link /reference/iterator/sentinel_for.md] * indirectly_swappable[link /reference/iterator/indirectly_swappable.md] ## 概要 diff --git a/reference/iterator/common_iterator/op_constructor.md b/reference/iterator/common_iterator/op_constructor.md index 8f7c68d636..260568aeec 100644 --- a/reference/iterator/common_iterator/op_constructor.md +++ b/reference/iterator/common_iterator/op_constructor.md @@ -71,7 +71,7 @@ int main() { * iterator_t[link /reference/ranges/iterator_t.md] * sentinel_t[link /reference/ranges/sentinel_t.md] * ranges::begin[link /reference/ranges/begin.md] -* seranges::end[link /reference/ranges/end.md] +* ranges::end[link /reference/ranges/end.md] ### 出力 ``` diff --git a/reference/iterator/counted_iterator.md b/reference/iterator/counted_iterator.md index 23d5a7a9f8..766955b162 100644 --- a/reference/iterator/counted_iterator.md +++ b/reference/iterator/counted_iterator.md @@ -29,7 +29,6 @@ namespace std { } ``` * input_or_output_iterator[link /reference/iterator/input_or_output_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * incrementable_traits[link /reference/iterator/incrementable_traits.md] * iter_difference_t[link /reference/iterator/iter_difference_t.md] * input_iterator[link /reference/iterator/input_iterator.md] diff --git a/reference/iterator/counted_iterator/base.md b/reference/iterator/counted_iterator/base.md index f29c64b22d..b70286fa72 100644 --- a/reference/iterator/counted_iterator/base.md +++ b/reference/iterator/counted_iterator/base.md @@ -9,7 +9,6 @@ constexpr const I& base() const & noexcept; // (1) constexpr I base() &&; // (2) ``` -* copy_constructible[link /reference/concepts/copy_constructible.md] ## 概要 diff --git a/reference/limits/numeric_limits/max_digits10.md b/reference/limits/numeric_limits/max_digits10.md index 1a2a478930..c59e979810 100644 --- a/reference/limits/numeric_limits/max_digits10.md +++ b/reference/limits/numeric_limits/max_digits10.md @@ -82,7 +82,7 @@ int main() ``` * max_digits10[color ff0000] * digits10[link digits10.md] -* std::stringstring[link /reference/sstream/basic_stringstream.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] * precision[link /reference/ios/ios_base/precision.md] * std::scientific[link /reference/ios/scientific.md] * s.str()[link /reference/sstream/basic_stringstream/str.md.nolink] diff --git a/reference/memory/ranges_destroy.md b/reference/memory/ranges_destroy.md index 22139a999f..4799f5fd1d 100644 --- a/reference/memory/ranges_destroy.md +++ b/reference/memory/ranges_destroy.md @@ -15,10 +15,10 @@ namespace std::ranges { constexpr borrowed_iterator_t destroy(R&& r) noexcept; // (2) C++20 } ``` -* no-throw-forward-iterator[link no-throw-forward-iterator.md] +* no-throw-input-iterator[link no-throw-input-iterator.md] * no-throw-sentinel[link no-throw-sentinel.md] * destructible[link /reference/concepts/destructible.md] -* no-throw-forward-range[link no-throw-forward-range.md] +* no-throw-input-range[link no-throw-input-range.md] * range_value_t[link /reference/ranges/range_value_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] @@ -33,11 +33,11 @@ namespace std::ranges { ## テンプレートパラメータ制約 - (1): - - `I`が[`no-throw-forward-iterator`](no-throw-forward-iterator.md)である + - `I`が[`no-throw-input-iterator`](no-throw-input-iterator.md)である - `S`が[`I`に対する例外を投げない番兵](no-throw-sentinel.md)である - `I`の要素型が、[破棄可能](/reference/concepts/destructible.md)である - (2): - - `R`が[`no-throw-forward-range`](no-throw-forward-range.md)である + - `R`が[`no-throw-input-range`](no-throw-input-range.md)である - `R`の要素型が、[破棄可能](/reference/concepts/destructible.md)である diff --git a/reference/memory/ranges_destroy_n.md b/reference/memory/ranges_destroy_n.md index 5b89f82e92..3e1ca1afcd 100644 --- a/reference/memory/ranges_destroy_n.md +++ b/reference/memory/ranges_destroy_n.md @@ -11,7 +11,7 @@ namespace std::ranges { constexpr I destroy_n(I first, iter_difference_t n) noexcept; // (1) C++20 } ``` -* no-throw-forward-iterator[link no-throw-forward-iterator.md] +* no-throw-input-iterator[link no-throw-input-iterator.md] * destructible[link /reference/concepts/destructible.md] * iter_value_t[link /reference/iterator/iter_value_t.md] * iter_difference_t[link /reference/iterator/iter_difference_t.md] @@ -24,7 +24,7 @@ namespace std::ranges { ## テンプレートパラメータ制約 - (1): - - `I`が[`no-throw-forward-iterator`](no-throw-forward-iterator.md)である + - `I`が[`no-throw-input-iterator`](no-throw-input-iterator.md)である - `I`の要素型が、[破棄可能](/reference/concepts/destructible.md)である diff --git a/reference/memory/ranges_uninitialized_copy_n.md b/reference/memory/ranges_uninitialized_copy_n.md index 499506e346..74ca629bc4 100644 --- a/reference/memory/ranges_uninitialized_copy_n.md +++ b/reference/memory/ranges_uninitialized_copy_n.md @@ -99,7 +99,6 @@ int main() } ``` * std::ranges::uninitialized_copy_n[color ff0000] -* std::ranges::subrange[link /reference/ranges/subrange.md] * std::allocator[link allocator.md] * alloc.allocate[link allocator/allocate.md] * std::ranges::destroy_n[link ranges_destroy_n.md] diff --git a/reference/memory/ranges_uninitialized_fill_n.md b/reference/memory/ranges_uninitialized_fill_n.md index d22580b085..8b4a686ce4 100644 --- a/reference/memory/ranges_uninitialized_fill_n.md +++ b/reference/memory/ranges_uninitialized_fill_n.md @@ -69,7 +69,6 @@ int main() } ``` * std::ranges::uninitialized_fill_n[color ff0000] -* std::ranges::subrange[link /reference/ranges/subrange.md] * std::allocator[link allocator.md] * alloc.allocate[link allocator/allocate.md] * std::ranges::destroy_n[link ranges_destroy_n.md] diff --git a/reference/memory/ranges_uninitialized_move_n.md b/reference/memory/ranges_uninitialized_move_n.md index 70f40c0c6e..5dbc814bba 100644 --- a/reference/memory/ranges_uninitialized_move_n.md +++ b/reference/memory/ranges_uninitialized_move_n.md @@ -99,7 +99,6 @@ int main() } ``` * std::ranges::uninitialized_move_n[color ff0000] -* std::ranges::subrange[link /reference/ranges/subrange.md] * std::allocator[link allocator.md] * alloc.allocate[link allocator/allocate.md] * std::ranges::destroy_n[link ranges_destroy_n.md] diff --git a/reference/memory/shared_ptr/unique.md b/reference/memory/shared_ptr/unique.md index 3cb4ef22cb..9702cde3fc 100644 --- a/reference/memory/shared_ptr/unique.md +++ b/reference/memory/shared_ptr/unique.md @@ -22,7 +22,7 @@ bool unique() const noexcept; ```cpp use_count() == 1 ``` -* get()[link get.md] +* use_count()[link use_count.md] ## 備考 diff --git a/reference/memory_resource/memory_resource.md b/reference/memory_resource/memory_resource.md index cd62481fba..1ad1d604c4 100644 --- a/reference/memory_resource/memory_resource.md +++ b/reference/memory_resource/memory_resource.md @@ -148,8 +148,8 @@ int main(){ ``` * std::pmr::memory_resource[color ff0000] * std::byte[link /reference/cstddef/byte.md] -* std::allocate[link /reference/memory_resource/memory_resource/allocate.md] -* std::deallocate[link /reference/memory_resource/memory_resource/deallocate.md] +* allocate[link /reference/memory_resource/memory_resource/allocate.md] +* deallocate[link /reference/memory_resource/memory_resource/deallocate.md] * std::bad_alloc[link /reference/new/bad_alloc.md] * std::max_align_t[link /reference/cstddef/max_align_t.md] * std::uintptr_t[link /reference/cstdint/uintptr_t.md] diff --git a/reference/memory_resource/polymorphic_allocator/construct.md b/reference/memory_resource/polymorphic_allocator/construct.md index fb89927472..da2b4f6eb0 100644 --- a/reference/memory_resource/polymorphic_allocator/construct.md +++ b/reference/memory_resource/polymorphic_allocator/construct.md @@ -344,8 +344,6 @@ int main() * destroy[link destroy.md] * std::pmr::monotonic_buffer_resource[link /reference/memory_resource/monotonic_buffer_resource.md] * std::pmr::string[link /reference/string/basic_string.md] -* std::piecewise_construct[link /reference/utility/piecewise_construct_t.md] -* std::make_tuple[link /reference/tuple/make_tuple.md] ### C++17 における出力 ``` diff --git a/reference/memory_resource/polymorphic_allocator/new_object.md b/reference/memory_resource/polymorphic_allocator/new_object.md index 7f166a872c..8af71512bb 100644 --- a/reference/memory_resource/polymorphic_allocator/new_object.md +++ b/reference/memory_resource/polymorphic_allocator/new_object.md @@ -9,9 +9,6 @@ template [[nodiscard]] T* new_object(CtorArgs&&... ctor_args); ``` -* pair[link /reference/utility/pair.md] -* tuple[link /reference/tuple/tuple.md] -* piecewise_construct_t[link /reference/utility/piecewise_construct_t.md] ## 概要 diff --git a/reference/memory_resource/pool_resource/upstream_resource.md b/reference/memory_resource/pool_resource/upstream_resource.md index 6990115cc8..97a30aaa1e 100644 --- a/reference/memory_resource/pool_resource/upstream_resource.md +++ b/reference/memory_resource/pool_resource/upstream_resource.md @@ -8,7 +8,7 @@ ```cpp memory_resource* upstream_resource() const; ``` -* memory_source[link /reference/memory_resource/memory_resource.md] +* memory_resource[link /reference/memory_resource/memory_resource.md] ## 概要 利用中の上流メモリリソースを取得する。 diff --git a/reference/mutex/mutex/lock.md b/reference/mutex/mutex/lock.md index c87114841f..89cab1e468 100644 --- a/reference/mutex/mutex/lock.md +++ b/reference/mutex/mutex/lock.md @@ -63,7 +63,7 @@ int main() } ``` * lock()[color ff0000] -* mutx_.unlock()[link unlock.md] +* mtx_.unlock()[link unlock.md] ### 出力 ``` diff --git a/reference/new/hardware_constructive_interference_size.md b/reference/new/hardware_constructive_interference_size.md index f115537100..4d4d0820af 100644 --- a/reference/new/hardware_constructive_interference_size.md +++ b/reference/new/hardware_constructive_interference_size.md @@ -42,7 +42,6 @@ int main() } ``` * std::hardware_constructive_interference_size[color ff0000] -* threads.push_back[link /reference/vector/vector/push_back.md] ### 出力例 diff --git a/reference/queue/queue/back.md b/reference/queue/queue/back.md index fdbb96f699..a5ce04366b 100644 --- a/reference/queue/queue/back.md +++ b/reference/queue/queue/back.md @@ -44,7 +44,7 @@ int main() { } ``` * back()[color ff0000] -* q.push[link push.md] +* que.push[link push.md] ### 出力 ``` diff --git a/reference/ranges/borrowed_subrange_t.md b/reference/ranges/borrowed_subrange_t.md index 165e437dd2..9e06a88c0e 100644 --- a/reference/ranges/borrowed_subrange_t.md +++ b/reference/ranges/borrowed_subrange_t.md @@ -57,7 +57,6 @@ int main() { * ranges::range[link range.md] * ranges::begin[link begin.md] * ranges::end[link end.md] -* ranges::range_value_t[link range_value_t.md] * ranges::dangling[link dangling.md] * ranges::subrange[link subrange.md] * borrowed_range[link borrowed_range.md] diff --git a/reference/ranges/common_view.md b/reference/ranges/common_view.md index c80a810766..a0aad31c05 100644 --- a/reference/ranges/common_view.md +++ b/reference/ranges/common_view.md @@ -170,9 +170,7 @@ namespace std::ranges { * sentinel_t[link sentinel_t.md] * ranges::begin[link begin.md] * ranges::end[link end.md] -* ranges::empty[link empty.md] * ranges::size[link size.md] -* ranges::data[link data.md] * views::all_t[link all.md] ## バージョン diff --git a/reference/ranges/copyable_box.md b/reference/ranges/copyable_box.md index fca994b362..236cfbacbd 100644 --- a/reference/ranges/copyable_box.md +++ b/reference/ranges/copyable_box.md @@ -46,7 +46,7 @@ constexpr copyable-box& operator=(copyable-box&& that) noexcept(is_nothrow_move_ } ``` * copyable-box[italic] -* is_nothrow_copy_constructible_v[link /reference/type_traits/is_nothrow_copy_constructible.md] +* is_nothrow_move_constructible_v[link /reference/type_traits/is_nothrow_move_constructible.md] * addressof[link /reference/memory/addressof.md] * emplace[link /reference/optional/optional/emplace.md] * reset[link /reference/optional/optional/reset.md] diff --git a/reference/ranges/elements_view.md b/reference/ranges/elements_view.md index d71cbb8d3b..934b911e4e 100644 --- a/reference/ranges/elements_view.md +++ b/reference/ranges/elements_view.md @@ -79,7 +79,6 @@ concept has-tuple-element = * tuple_element_t[link /reference/tuple/tuple_element.md] * get[link /reference/tuple/tuple/get.md] * convertible_to[link /reference/concepts/convertible_to.md] -* remove_reference_t[link /reference/type_traits/remove_reference.md] * tuple-like[link /reference/tuple/tuple-like.md] * tuple_size_v[link /reference/tuple/tuple_size.md] diff --git a/reference/ranges/iota_view.md b/reference/ranges/iota_view.md index 7b9b77a841..57461ad5de 100644 --- a/reference/ranges/iota_view.md +++ b/reference/ranges/iota_view.md @@ -15,7 +15,6 @@ namespace std::ranges { } } ``` -* is_object_v[link /reference/type_traits/is_object.md] * weakly_incrementable[link /reference/iterator/weakly_incrementable.md] * copyable[link /reference/concepts/copyable.md] * unreachable_sentinel_t[link /reference/iterator/unreachable_sentinel_t.md] @@ -44,7 +43,7 @@ namespace std::ranges { - (3): `W`と`Bound`が等しいとき ## テンプレートパラメータ制約 -- [`weakly_incrementable`](/reference/type_traits/is_object.md)`` +- [`weakly_incrementable`](/reference/iterator/weakly_incrementable.md)`` - [`copyable`](/reference/concepts/copyable.md)`` - [`semiregular`](/reference/concepts/semiregular.md)`` - [`weakly-equality-comparable-with`](/reference/concepts/equality_comparable.md)`` diff --git a/reference/ranges/iota_view/iterator.md b/reference/ranges/iota_view/iterator.md index 37473b1c20..e59a769b3b 100644 --- a/reference/ranges/iota_view/iterator.md +++ b/reference/ranges/iota_view/iterator.md @@ -191,7 +191,6 @@ namespace std::ranges { * totally_ordered[link /reference/concepts/totally_ordered.md] * three_way_comparable[link /reference/compare/three_way_comparable.md] * is_nothrow_copy_constructible_v[link /reference/type_traits/is_nothrow_copy_constructible.md] -* unreachable_sentinel_t[link /reference/iterator/unreachable_sentinel_t.md] * weakly-equality-comparable-with[link /reference/concepts/equality_comparable.md] ## バージョン diff --git a/reference/ranges/owning_view.md b/reference/ranges/owning_view.md index 404178683e..19ab8dc652 100644 --- a/reference/ranges/owning_view.md +++ b/reference/ranges/owning_view.md @@ -140,11 +140,7 @@ namespace std::ranges { ``` * is-initializer-list[italic] * range[link range.md] -* is_object_v[link /reference/type_traits/is_object.md] * default_initializable[link /reference/concepts/default_initializable.md] -* declval[link /reference/utility/declval.md] -* std::forward[link /reference/utility/forward.md] -* addressof[link /reference/memory/addressof.md] * iterator_t[link iterator_t.md] * sentinel_t[link sentinel_t.md] * ranges::begin[link begin.md] diff --git a/reference/ranges/ref_view.md b/reference/ranges/ref_view.md index b180139763..a68fbf6726 100644 --- a/reference/ranges/ref_view.md +++ b/reference/ranges/ref_view.md @@ -123,7 +123,6 @@ namespace std::ranges { ref_view(R&) -> ref_view; } ``` -* is-initializer-list[italic] * range[link range.md] * is_object_v[link /reference/type_traits/is_object.md] * convertible_to[link /reference/concepts/convertible_to.md] diff --git a/reference/ranges/repeat_view/iterator.md b/reference/ranges/repeat_view/iterator.md index 8116fd5008..621a15c900 100644 --- a/reference/ranges/repeat_view/iterator.md +++ b/reference/ranges/repeat_view/iterator.md @@ -118,8 +118,6 @@ namespace std::ranges { * random_access_iterator_tag[link /reference/iterator/iterator_tag.md] * is-signed-integer-like[link /reference/iterator/is_integer_like.md] * iota_diff_t[link /reference/ranges/iota_view/iota_diff_t.md] -* incrementable[link /reference/iterator/incrementable.md] -* weakly-equality-comparable-with[link /reference/concepts/equality_comparable.md] ## バージョン ### 言語 diff --git a/reference/ranges/reverse_view.md b/reference/ranges/reverse_view.md index 734be3926f..8f25ad9097 100644 --- a/reference/ranges/reverse_view.md +++ b/reference/ranges/reverse_view.md @@ -158,13 +158,11 @@ namespace std::ranges { * view_interface[link view_interface.md] * common_range[link common_range.md] * sized_range[link sized_range.md] -* copyable[link /reference/concepts/copyable.md] * default_initializable[link /reference/concepts/default_initializable.md] * copy_constructible[link /reference/concepts/copy_constructible.md] * reverse_iterator[link /reference/iterator/reverse_iterator.md] * make_reverse_iterator[link /reference/iterator/make_reverse_iterator.md] * iterator_t[link iterator_t.md] -* sentinel_t[link sentinel_t.md] * ranges::next[link /reference/iterator/ranges_next.md] * ranges::begin[link begin.md] * ranges::end[link end.md] diff --git a/reference/ranges/simple-view.md b/reference/ranges/simple-view.md index d31987cb29..b3c0e4cb53 100644 --- a/reference/ranges/simple-view.md +++ b/reference/ranges/simple-view.md @@ -10,7 +10,7 @@ template same_as, iterator_t> && same_as, sentinel_t>; ``` -* same-as[link /reference/concepts/same_as.md] +* same_as[link /reference/concepts/same_as.md] * view[link view.md] * range[link range.md] * iterator_t[link iterator_t.md] diff --git a/reference/ranges/subrange/op_deduction_guide.md b/reference/ranges/subrange/op_deduction_guide.md index af57c59627..8b9be3a373 100644 --- a/reference/ranges/subrange/op_deduction_guide.md +++ b/reference/ranges/subrange/op_deduction_guide.md @@ -29,15 +29,10 @@ namespace std::ranges { * iterator_t[link /reference/ranges/iterator_t.md] * sentinel_t[link /reference/ranges/sentinel_t.md] * sized_range[link /reference/ranges/sized_range.md] -* convertible_to[link /reference/concepts/convertible_to.md] * iter_difference_t[link /reference/iterator/iter_difference_t.md] * sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] * sentinel_for[link /reference/iterator/sentinel_for.md] -* tuple_element_t[link /reference/tuple/tuple_element.md] -* StoreSize[italic][link op_constructor.md] -* iterator-sentinel-pair[italic][link ../subrange.md] -* convertible-to-non-slicing[italic][link convertible-to-non-slicing.md] -* make-unsigned-like-t[italic][link /reference/type_traits/make_unsigned.md] +* make-unsigned-like-t[link /reference/type_traits/make_unsigned.md] ## 概要 [`subrange`](../subrange.md)クラステンプレートの型推論補助。 diff --git a/reference/regex/match_results.md b/reference/regex/match_results.md index 3897b36021..c6d15df401 100644 --- a/reference/regex/match_results.md +++ b/reference/regex/match_results.md @@ -163,7 +163,7 @@ int main() * m.size()[link match_results/size.md] * m.prefix()[link match_results/prefix.md] * m.suffix()[link match_results/suffix.md] -* m.str()[link match_results/str.md] +* m.str[link match_results/str.md] * m.position[link match_results/position.md] * m.length[link match_results/length.md] * m.format[link match_results/format.md] diff --git a/reference/regex/match_results/prefix.md b/reference/regex/match_results/prefix.md index 69caec91ef..dcac90ba10 100644 --- a/reference/regex/match_results/prefix.md +++ b/reference/regex/match_results/prefix.md @@ -99,7 +99,6 @@ int main() * std::smatch[link ../match_results.md] * std::regex_match[link ../regex_match.md] * std::regex_search[link ../regex_search.md] -* std::regex_iterator[link ../regex_iterator.md] * std::sregex_iterator[link ../regex_iterator.md] * sub.str()[link str.md] * std::ssub_match[link ../sub_match.md] diff --git a/reference/regex/match_results/suffix.md b/reference/regex/match_results/suffix.md index 0eefad0d77..d4c608ccf1 100644 --- a/reference/regex/match_results/suffix.md +++ b/reference/regex/match_results/suffix.md @@ -99,7 +99,6 @@ int main() * std::smatch[link ../match_results.md] * std::regex_match[link ../regex_match.md] * std::regex_search[link ../regex_search.md] -* std::regex_iterator[link ../regex_iterator.md] * std::sregex_iterator[link ../regex_iterator.md] * sub.str()[link str.md] * std::ssub_match[link ../sub_match.md] diff --git a/reference/set/multiset/insert.md b/reference/set/multiset/insert.md index 27c82a3415..d0259c30c1 100644 --- a/reference/set/multiset/insert.md +++ b/reference/set/multiset/insert.md @@ -21,7 +21,6 @@ void insert(initializer_list init); // (6) iterator insert(node_type&& nh); // (7) C++17 iterator insert(const_iterator hint, node_type&& nh); // (8) C++17 ``` -* pair[link /reference/utility/pair.md] * initializer_list[link /reference/initializer_list/initializer_list.md] ## 概要 diff --git a/reference/set/multiset/value_comp.md b/reference/set/multiset/value_comp.md index 17122f729c..4c5322a651 100644 --- a/reference/set/multiset/value_comp.md +++ b/reference/set/multiset/value_comp.md @@ -38,7 +38,6 @@ int main() } ``` * value_comp()[color ff0000] -* insert[link insert.md] ### 出力 ``` diff --git a/reference/set/set/value_comp.md b/reference/set/set/value_comp.md index 4baa4d3a8c..ad583b2250 100644 --- a/reference/set/set/value_comp.md +++ b/reference/set/set/value_comp.md @@ -38,7 +38,6 @@ int main() } ``` * value_comp()[color ff0000] -* insert[link insert.md] ### 出力 ``` diff --git a/reference/shared_mutex/shared_lock/op_bool.md b/reference/shared_mutex/shared_lock/op_bool.md index bf3c3197f7..7462575912 100644 --- a/reference/shared_mutex/shared_lock/op_bool.md +++ b/reference/shared_mutex/shared_lock/op_bool.md @@ -72,7 +72,6 @@ int main() * std::shared_timed_mutex[link /reference/shared_mutex/shared_timed_mutex.md] * std::defer_lock[link /reference/mutex/defer_lock.md] * lock.lock()[link /reference/shared_mutex/shared_timed_mutex/lock.md] -* lock.unlock()[link /reference/shared_mutex/shared_timed_mutex/unlock.md] ### 出力 ```cpp diff --git a/reference/span/span/op_constructor.md b/reference/span/span/op_constructor.md index 39633c5845..68321161df 100644 --- a/reference/span/span/op_constructor.md +++ b/reference/span/span/op_constructor.md @@ -254,15 +254,12 @@ int main() * s4.size()[link size.md] * s4.data()[link data.md] * v.data()[link /reference/vector/vector/data.md] -* cv.size()[link /reference/vector/vector/size.md] -* cv.data()[link /reference/vector/vector/data.md] * ar.size()[link /reference/array/array/size.md] * ar.data()[link /reference/array/array/data.md] * car.size()[link /reference/array/array/size.md] * car.data()[link /reference/array/array/data.md] * str.size()[link /reference/string/basic_string/size.md] * str.data()[link /reference/string/basic_string/data.md] -* std::move[link /reference/utility/move.md] ### 出力 ``` diff --git a/reference/stacktrace/basic_stacktrace/current.md b/reference/stacktrace/basic_stacktrace/current.md index f1a5e8f9b5..c55d80f77f 100644 --- a/reference/stacktrace/basic_stacktrace/current.md +++ b/reference/stacktrace/basic_stacktrace/current.md @@ -91,7 +91,7 @@ int main() { f(); } ``` -* current()[color ff0000] +* current[color ff0000] #### 出力例 ``` @@ -116,7 +116,7 @@ int main() { f(); } ``` -* current()[color ff0000] +* current[color ff0000] #### 出力例 ``` diff --git a/reference/stacktrace/basic_stacktrace/max_size.md b/reference/stacktrace/basic_stacktrace/max_size.md index 3e633e70f4..f7224b35ea 100644 --- a/reference/stacktrace/basic_stacktrace/max_size.md +++ b/reference/stacktrace/basic_stacktrace/max_size.md @@ -24,7 +24,7 @@ size_type max_size() const noexcept; // (1) C++23 int main() { std::stacktrace trace{}; - std::cout << tract.max_size() << std::endl; + std::cout << trace.max_size() << std::endl; } ``` * trace.max_size()[color ff0000] diff --git a/reference/stacktrace/basic_stacktrace/size.md b/reference/stacktrace/basic_stacktrace/size.md index 5cf95e4b0e..1d0adafb24 100644 --- a/reference/stacktrace/basic_stacktrace/size.md +++ b/reference/stacktrace/basic_stacktrace/size.md @@ -69,7 +69,7 @@ int main() { } ``` * trace.size()[color ff0000] -* current()[link current.md] +* current[link current.md] #### 出力例 ``` diff --git a/reference/stacktrace/stacktrace_entry.md b/reference/stacktrace/stacktrace_entry.md index d9f8533b9e..70cfb395c2 100644 --- a/reference/stacktrace/stacktrace_entry.md +++ b/reference/stacktrace/stacktrace_entry.md @@ -108,7 +108,7 @@ int main() { ``` * std::stacktrace_entry[color ff0000] * std::stacktrace[link basic_stacktrace.md] -* current()[link basic_stacktrace/current.md] +* current[link basic_stacktrace/current.md] * entry.description()[link stacktrace_entry/description.md.nolink] * entry.source_file()[link stacktrace_entry/source_file.md.nolink] * entry.source_line()[link stacktrace_entry/source_line.md.nolink] diff --git a/reference/stop_token/stop_source/op_constructor.md b/reference/stop_token/stop_source/op_constructor.md index 7dd5abbf49..72e7496eb7 100644 --- a/reference/stop_token/stop_source/op_constructor.md +++ b/reference/stop_token/stop_source/op_constructor.md @@ -54,7 +54,6 @@ int main() } ``` * std::move[link /reference/utility/move.md] -* std::stop_token[link ../stop_token.md] * std::stop_source[link ../stop_source.md] * std::nostopstate[link ../nostopstate.md] * stop_requested()[link stop_requested.md] diff --git a/reference/stop_token/stop_source/request_stop.md b/reference/stop_token/stop_source/request_stop.md index afe7786252..45fd15118e 100644 --- a/reference/stop_token/stop_source/request_stop.md +++ b/reference/stop_token/stop_source/request_stop.md @@ -112,9 +112,8 @@ int main() * stop_callback[link ../stop_callback.md] * get_token()[link get_token.md] * request_stop()[link request_stop.md] -* stop_requested()[link stop_requested.md] * condition_variable_any[link /reference/condition_variable/condition_variable_any.md] -* wait()[link /reference/condition_variable/condition_variable_any/wait.md] +* cv.wait[link /reference/condition_variable/condition_variable_any/wait.md] * std::this_thread::sleep_for[link /reference/thread/this_thread/sleep_for.md] ### 出力 diff --git a/reference/stop_token/stop_source/stop_requested.md b/reference/stop_token/stop_source/stop_requested.md index 1cd9cbb9c9..eb4091139e 100644 --- a/reference/stop_token/stop_source/stop_requested.md +++ b/reference/stop_token/stop_source/stop_requested.md @@ -39,7 +39,7 @@ int main() } ``` * stop_source[link ../stop_source.md] -* nostopstate[link ../nostopstate.md] +* std::nostopstate[link ../nostopstate.md] * stop_requested()[link stop_requested.md] * request_stop()[link request_stop.md] diff --git a/reference/stop_token/stop_token/stop_requested.md b/reference/stop_token/stop_token/stop_requested.md index 0651da66ef..e8de4ea6f5 100644 --- a/reference/stop_token/stop_token/stop_requested.md +++ b/reference/stop_token/stop_token/stop_requested.md @@ -55,7 +55,6 @@ int main() ``` * std::stop_token[link ../stop_token.md] * std::stop_source[link ../stop_source.md] -* nostopstate[link ../nostopstate.md] * stop_requested()[link stop_requested.md] * request_stop()[link ../stop_source/request_stop.md] * get_token()[link ../stop_source/get_token.md] diff --git a/reference/stop_token/stop_token/swap.md b/reference/stop_token/stop_token/swap.md index 518a88261b..23aeee229f 100644 --- a/reference/stop_token/stop_token/swap.md +++ b/reference/stop_token/stop_token/swap.md @@ -42,7 +42,6 @@ int main() * swap[color ff0000] * std::stop_token[link ../stop_token.md] * std::stop_source[link ../stop_source.md] -* request_stop()[link ../stop_source/request_stop.md] * stop_possible()[link stop_possible.md] ### 出力 diff --git a/reference/stop_token/stop_token/swap_free.md b/reference/stop_token/stop_token/swap_free.md index 3def20a87f..d0f7e8f376 100644 --- a/reference/stop_token/stop_token/swap_free.md +++ b/reference/stop_token/stop_token/swap_free.md @@ -50,10 +50,9 @@ int main() assert(st2.stop_possible() == true); } ``` -* std::swap[color ff0000] +* swap[color ff0000] * std::stop_token[link ../stop_token.md] * std::stop_source[link ../stop_source.md] -* request_stop()[link ../stop_source/request_stop.md] * stop_possible()[link stop_possible.md] ### 出力 diff --git a/reference/tuple/make_from_tuple.md b/reference/tuple/make_from_tuple.md index f4028bfcf4..b11772daba 100644 --- a/reference/tuple/make_from_tuple.md +++ b/reference/tuple/make_from_tuple.md @@ -60,7 +60,6 @@ constexpr T make_from_tuple(Tuple&& t) { * std::forward[link /reference/utility/forward.md] * std::make_index_sequence[link /reference/utility/make_index_sequence.md] * std::index_sequence[link /reference/utility/index_sequence.md] -* std::decay_t[link /reference/type_traits/decay.md] ## 例 diff --git a/reference/type_traits/basic_common_reference.md b/reference/type_traits/basic_common_reference.md index 9bef863b6c..75f11fdf28 100644 --- a/reference/type_traits/basic_common_reference.md +++ b/reference/type_traits/basic_common_reference.md @@ -70,7 +70,7 @@ int main() static_assert(std::same_as, B&>); } ``` -* std::basic_common_reference[color ff0000] +* basic_common_reference[color ff0000] * std::same_as[link /reference/concepts/same_as.md] * std::common_reference_t[link common_reference.md] diff --git a/reference/type_traits/is_invocable_r.md b/reference/type_traits/is_invocable_r.md index f32c28abaa..6620732bf8 100644 --- a/reference/type_traits/is_invocable_r.md +++ b/reference/type_traits/is_invocable_r.md @@ -62,19 +62,18 @@ struct S { int main() { - using R = const S&; + using R = const S&; - std::cout << "1" << std::endl; + std::cout << "1" << std::endl; - // INVOKE、つまり std::invoke の返り値である S が - // R に束縛されて R の寿命と同じ寿命に延長された上で std::invoke_r の返り値となる - // しかし R の寿命はこの1文の間だけなので、S もこの1文が終了する際に破棄される - const S& a = std::invoke_r([]() { return S{}; }); - - std::cout << "2" << std::endl; + // INVOKE、つまり std::invoke の返り値である S が + // R に束縛されて R の寿命と同じ寿命に延長された上で std::invoke_r の返り値となる + // しかし R の寿命はこの1文の間だけなので、S もこの1文が終了する際に破棄される + const S& a = std::invoke_r([]() { return S{}; }); + + std::cout << "2" << std::endl; } ``` -* std::is_invocable_r[color ff0000] ## 例 diff --git a/reference/typeindex/type_index/op_greater.md b/reference/typeindex/type_index/op_greater.md index 803ef7193f..b444bd0c02 100644 --- a/reference/typeindex/type_index/op_greater.md +++ b/reference/typeindex/type_index/op_greater.md @@ -54,7 +54,6 @@ int main() } ``` * std::greater[color ff0000] -* std::greater_equal[color ff0000] * s.insert[link /reference/set/set/insert.md] * s.begin()[link /reference/set/set/begin.md] * s.end()[link /reference/set/set/end.md] diff --git a/reference/typeindex/type_index/op_less.md b/reference/typeindex/type_index/op_less.md index 770787bd14..2e57c4b14c 100644 --- a/reference/typeindex/type_index/op_less.md +++ b/reference/typeindex/type_index/op_less.md @@ -53,7 +53,6 @@ int main() } ``` * std::less[color ff0000] -* std::greater_equal[color ff0000] * s.insert[link /reference/set/set/insert.md] * s.begin()[link /reference/set/set/begin.md] * s.end()[link /reference/set/set/end.md] diff --git a/reference/typeindex/type_index/op_less_equal.md b/reference/typeindex/type_index/op_less_equal.md index 0469fba025..7a9b94334c 100644 --- a/reference/typeindex/type_index/op_less_equal.md +++ b/reference/typeindex/type_index/op_less_equal.md @@ -54,7 +54,6 @@ int main() } ``` * std::less_equal[color ff0000] -* std::greater_equal[color ff0000] * s.insert[link /reference/set/set/insert.md] * s.begin()[link /reference/set/set/begin.md] * s.end()[link /reference/set/set/end.md] diff --git a/reference/unordered_map/unordered_map/insert.md b/reference/unordered_map/unordered_map/insert.md index 81f309137e..3abc7efe21 100644 --- a/reference/unordered_map/unordered_map/insert.md +++ b/reference/unordered_map/unordered_map/insert.md @@ -218,7 +218,6 @@ int main() ``` * insert[color ff0000] * um.cbegin()[link cbegin.md] -* um.cend()[link cend.md] * fl.cbegin()[link /reference/forward_list/forward_list/cbegin.md] * fl.cend()[link /reference/forward_list/forward_list/cend.md] diff --git a/reference/unordered_map/unordered_map/op_not_equal.md b/reference/unordered_map/unordered_map/op_not_equal.md index 7377c00c9a..076e24022b 100644 --- a/reference/unordered_map/unordered_map/op_not_equal.md +++ b/reference/unordered_map/unordered_map/op_not_equal.md @@ -66,7 +66,6 @@ int main() return 0; } ``` -* insert[link insert.md] ### 出力 ``` diff --git a/reference/unordered_map/unordered_multimap/insert.md b/reference/unordered_map/unordered_multimap/insert.md index ddac0d8b6f..b0e30bd35a 100644 --- a/reference/unordered_map/unordered_multimap/insert.md +++ b/reference/unordered_map/unordered_multimap/insert.md @@ -206,7 +206,6 @@ int main() ``` * insert[color ff0000] * um.cbegin()[link cbegin.md] -* um.cend()[link cend.md] * fl.cbegin()[link /reference/forward_list/forward_list/cbegin.md] * fl.cend()[link /reference/forward_list/forward_list/cend.md] diff --git a/reference/unordered_set/unordered_multiset.md b/reference/unordered_set/unordered_multiset.md index 620a655645..8b6ce610f1 100644 --- a/reference/unordered_set/unordered_multiset.md +++ b/reference/unordered_set/unordered_multiset.md @@ -232,8 +232,8 @@ int main() ``` * std::unordered_multiset[color ff0000] * std::ostream[link /reference/ostream.md] -* us.insert[link unordered_multiset/insert.md] -* us.erase[link unordered_multiset/erase.md] +* ums.insert[link unordered_multiset/insert.md] +* ums.erase[link unordered_multiset/erase.md] ### 出力 ``` diff --git a/reference/unordered_set/unordered_multiset/bucket.md b/reference/unordered_set/unordered_multiset/bucket.md index d939147d4b..e744de4d78 100644 --- a/reference/unordered_set/unordered_multiset/bucket.md +++ b/reference/unordered_set/unordered_multiset/bucket.md @@ -59,8 +59,8 @@ int main() } ``` * bucket[color ff0000] -* us.bucket_count()[link bucket_count.md] -* us.bucket_size[link bucket_size.md] +* ums.bucket_count()[link bucket_count.md] +* ums.bucket_size[link bucket_size.md] ### 出力 ``` diff --git a/reference/unordered_set/unordered_multiset/erase.md b/reference/unordered_set/unordered_multiset/erase.md index 683a634b60..88cb5415f3 100644 --- a/reference/unordered_set/unordered_multiset/erase.md +++ b/reference/unordered_set/unordered_multiset/erase.md @@ -117,8 +117,6 @@ int main() ``` * erase[color ff0000] * std::ostream[link /reference/ostream/basic_ostream.md] -* ums.begin()[link begin.md] -* ums.end()[link end.md] * std::next[link /reference/iterator/next.md] * ums.cbegin()[link cbegin.md] diff --git a/reference/unordered_set/unordered_multiset/insert.md b/reference/unordered_set/unordered_multiset/insert.md index 5847a7f220..422261a0dc 100644 --- a/reference/unordered_set/unordered_multiset/insert.md +++ b/reference/unordered_set/unordered_multiset/insert.md @@ -160,7 +160,6 @@ int main() * c.cbegin()[link cbegin.md] * c.cend()[link cend.md] * ums.cbegin()[link cbegin.md] -* ums.cend()[link cend.md] * fl.cbegin()[link /reference/forward_list/forward_list/cbegin.md] * fl.cend()[link /reference/forward_list/forward_list/cend.md] diff --git a/reference/unordered_set/unordered_set/erase.md b/reference/unordered_set/unordered_set/erase.md index 835a8e0e1c..8a6c214acc 100644 --- a/reference/unordered_set/unordered_set/erase.md +++ b/reference/unordered_set/unordered_set/erase.md @@ -116,8 +116,6 @@ int main() ``` * erase[color ff0000] * std::ostream[link /reference/ostream/basic_ostream.md] -* us.begin()[link begin.md] -* us.end()[link end.md] * std::next[link /reference/iterator/next.md] * us.cbegin()[link cbegin.md] diff --git a/reference/unordered_set/unordered_set/insert.md b/reference/unordered_set/unordered_set/insert.md index 245d184a87..20e168442c 100644 --- a/reference/unordered_set/unordered_set/insert.md +++ b/reference/unordered_set/unordered_set/insert.md @@ -174,7 +174,6 @@ int main() * c.begin()[link begin.md] * c.end()[link end.md] * us.begin()[link begin.md] -* us.end()[link end.md] * second[link /reference/utility/pair.md] * first[link /reference/utility/pair.md] * fl.cbegin()[link /reference/forward_list/forward_list/cbegin.md] diff --git a/reference/utility/index_sequence.md b/reference/utility/index_sequence.md index 13e4bfab42..7de93bbe60 100644 --- a/reference/utility/index_sequence.md +++ b/reference/utility/index_sequence.md @@ -39,7 +39,6 @@ int main() } ``` * std::index_sequence[color ff0000] -* std::integer_sequence[link integer_sequence.md] ## 出力 ``` diff --git a/reference/utility/pair/common_type.md b/reference/utility/pair/common_type.md index d71b1ec73b..eb41b66900 100644 --- a/reference/utility/pair/common_type.md +++ b/reference/utility/pair/common_type.md @@ -16,7 +16,6 @@ namespace std { * common_type[link /reference/type_traits/common_type.md] * pair[link ../pair.md] * common_type_t[link /reference/type_traits/common_type.md] -* tuple-like[link /reference/tuple/tuple-like.md] ## 概要 [`pair`](../pair.md)について、どちらからも変換可能な共通の型を取得できるようにする[`common_type`](/reference/type_traits/common_type.md)の特殊化である。 diff --git a/reference/valarray/gslice_array/op_assign.md b/reference/valarray/gslice_array/op_assign.md index 83c56618aa..8956c508d2 100644 --- a/reference/valarray/gslice_array/op_assign.md +++ b/reference/valarray/gslice_array/op_assign.md @@ -13,7 +13,6 @@ public: void operator=(const ValOrProxy& ar) const; // (2) void operator=(const T& value) const; // (3) ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/gslice_array/op_divide_assign.md b/reference/valarray/gslice_array/op_divide_assign.md index 716a0e8504..25e661c61d 100644 --- a/reference/valarray/gslice_array/op_divide_assign.md +++ b/reference/valarray/gslice_array/op_divide_assign.md @@ -7,7 +7,6 @@ ```cpp void operator/=(const ValOrProxy& xs) const; ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/gslice_array/op_left_shift_assign.md b/reference/valarray/gslice_array/op_left_shift_assign.md index 6506d5c202..6f8a6ba807 100644 --- a/reference/valarray/gslice_array/op_left_shift_assign.md +++ b/reference/valarray/gslice_array/op_left_shift_assign.md @@ -7,7 +7,6 @@ ```cpp void operator<<=(const ValOrProxy& xs) const; ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/gslice_array/op_minus_assign.md b/reference/valarray/gslice_array/op_minus_assign.md index 4180b1807a..db6649ed9e 100644 --- a/reference/valarray/gslice_array/op_minus_assign.md +++ b/reference/valarray/gslice_array/op_minus_assign.md @@ -7,7 +7,6 @@ ```cpp void operator-=(const ValOrProxy& xs) const; ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/gslice_array/op_modulo_assign.md b/reference/valarray/gslice_array/op_modulo_assign.md index 28f0ce8b16..c651381f10 100644 --- a/reference/valarray/gslice_array/op_modulo_assign.md +++ b/reference/valarray/gslice_array/op_modulo_assign.md @@ -7,7 +7,6 @@ ```cpp void operator%=(const ValOrProxy& xs) const; ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/gslice_array/op_multiply_assign.md b/reference/valarray/gslice_array/op_multiply_assign.md index d974c8a246..0520146af8 100644 --- a/reference/valarray/gslice_array/op_multiply_assign.md +++ b/reference/valarray/gslice_array/op_multiply_assign.md @@ -7,7 +7,6 @@ ```cpp void operator*=(const ValOrProxy& xs) const; ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/gslice_array/op_or_assign.md b/reference/valarray/gslice_array/op_or_assign.md index cd2da73de0..ebf23be14b 100644 --- a/reference/valarray/gslice_array/op_or_assign.md +++ b/reference/valarray/gslice_array/op_or_assign.md @@ -7,7 +7,6 @@ ```cpp void operator|=(const ValOrProxy& xs) const; ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/gslice_array/op_plus_assign.md b/reference/valarray/gslice_array/op_plus_assign.md index 3c24b34322..08712a3e57 100644 --- a/reference/valarray/gslice_array/op_plus_assign.md +++ b/reference/valarray/gslice_array/op_plus_assign.md @@ -7,7 +7,6 @@ ```cpp void operator+=(const ValOrProxy& xs) const; ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/gslice_array/op_right_shift_assign.md b/reference/valarray/gslice_array/op_right_shift_assign.md index 32d3076fa8..56e1bb5c01 100644 --- a/reference/valarray/gslice_array/op_right_shift_assign.md +++ b/reference/valarray/gslice_array/op_right_shift_assign.md @@ -7,7 +7,6 @@ ```cpp void operator>>=(const ValOrProxy& xs) const; ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/gslice_array/op_xor_assign.md b/reference/valarray/gslice_array/op_xor_assign.md index 31d28cf285..5073075cf5 100644 --- a/reference/valarray/gslice_array/op_xor_assign.md +++ b/reference/valarray/gslice_array/op_xor_assign.md @@ -7,7 +7,6 @@ ```cpp void operator^=(const ValOrProxy& xs) const; ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/indirect_array/op_and_assign.md b/reference/valarray/indirect_array/op_and_assign.md index f5dc0c7fb3..79d646b825 100644 --- a/reference/valarray/indirect_array/op_and_assign.md +++ b/reference/valarray/indirect_array/op_and_assign.md @@ -7,7 +7,6 @@ ```cpp void operator&=(const ValOrProxy& xs) const; ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/indirect_array/op_assign.md b/reference/valarray/indirect_array/op_assign.md index c5725cabbc..46d1556cad 100644 --- a/reference/valarray/indirect_array/op_assign.md +++ b/reference/valarray/indirect_array/op_assign.md @@ -13,7 +13,6 @@ public: void operator=(const ValOrProxy& ar) const; // (2) void operator=(const T& value) const; // (3) ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/indirect_array/op_divide_assign.md b/reference/valarray/indirect_array/op_divide_assign.md index 3b3b9ac63a..944af8ba77 100644 --- a/reference/valarray/indirect_array/op_divide_assign.md +++ b/reference/valarray/indirect_array/op_divide_assign.md @@ -7,7 +7,6 @@ ```cpp void operator/=(const ValOrProxy& xs) const; ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/indirect_array/op_left_shift_assign.md b/reference/valarray/indirect_array/op_left_shift_assign.md index 069e93666f..715312a25a 100644 --- a/reference/valarray/indirect_array/op_left_shift_assign.md +++ b/reference/valarray/indirect_array/op_left_shift_assign.md @@ -7,7 +7,6 @@ ```cpp void operator<<=(const ValOrProxy& xs) const; ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/indirect_array/op_minus_assign.md b/reference/valarray/indirect_array/op_minus_assign.md index c0bff5da97..d026e5706f 100644 --- a/reference/valarray/indirect_array/op_minus_assign.md +++ b/reference/valarray/indirect_array/op_minus_assign.md @@ -7,7 +7,6 @@ ```cpp void operator-=(const ValOrProxy& xs) const; ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/indirect_array/op_modulo_assign.md b/reference/valarray/indirect_array/op_modulo_assign.md index 9284532034..0fca7c331e 100644 --- a/reference/valarray/indirect_array/op_modulo_assign.md +++ b/reference/valarray/indirect_array/op_modulo_assign.md @@ -7,7 +7,6 @@ ```cpp void operator%=(const ValOrProxy& xs) const; ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/indirect_array/op_multiply_assign.md b/reference/valarray/indirect_array/op_multiply_assign.md index 2414ae93fb..cd2844a896 100644 --- a/reference/valarray/indirect_array/op_multiply_assign.md +++ b/reference/valarray/indirect_array/op_multiply_assign.md @@ -7,7 +7,6 @@ ```cpp void operator*=(const ValOrProxy& xs) const; ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/indirect_array/op_or_assign.md b/reference/valarray/indirect_array/op_or_assign.md index 16f922e362..2189c7a811 100644 --- a/reference/valarray/indirect_array/op_or_assign.md +++ b/reference/valarray/indirect_array/op_or_assign.md @@ -7,7 +7,6 @@ ```cpp void operator|=(const ValOrProxy& xs) const; ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/indirect_array/op_plus_assign.md b/reference/valarray/indirect_array/op_plus_assign.md index 7074528ae4..d9d257ed12 100644 --- a/reference/valarray/indirect_array/op_plus_assign.md +++ b/reference/valarray/indirect_array/op_plus_assign.md @@ -7,7 +7,6 @@ ```cpp void operator+=(const ValOrProxy& xs) const; ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/indirect_array/op_right_shift_assign.md b/reference/valarray/indirect_array/op_right_shift_assign.md index 62848b0ab6..6f4f7724d9 100644 --- a/reference/valarray/indirect_array/op_right_shift_assign.md +++ b/reference/valarray/indirect_array/op_right_shift_assign.md @@ -7,7 +7,6 @@ ```cpp void operator>>=(const ValOrProxy& xs) const; ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/indirect_array/op_xor_assign.md b/reference/valarray/indirect_array/op_xor_assign.md index da1b57e489..102831572a 100644 --- a/reference/valarray/indirect_array/op_xor_assign.md +++ b/reference/valarray/indirect_array/op_xor_assign.md @@ -7,7 +7,6 @@ ```cpp void operator^=(const ValOrProxy& xs) const; ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/mask_array/op_and_assign.md b/reference/valarray/mask_array/op_and_assign.md index 6be7430d4f..c113dc4b83 100644 --- a/reference/valarray/mask_array/op_and_assign.md +++ b/reference/valarray/mask_array/op_and_assign.md @@ -7,7 +7,6 @@ ```cpp void operator&=(const ValOrProxy& xs) const; ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/mask_array/op_assign.md b/reference/valarray/mask_array/op_assign.md index 2e724f2bb9..6874cd06c1 100644 --- a/reference/valarray/mask_array/op_assign.md +++ b/reference/valarray/mask_array/op_assign.md @@ -13,7 +13,6 @@ public: void operator=(const ValOrProxy& ar) const; // (2) void operator=(const T& value) const; // (3) ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/mask_array/op_divide_assign.md b/reference/valarray/mask_array/op_divide_assign.md index 132427af7d..3c67846bda 100644 --- a/reference/valarray/mask_array/op_divide_assign.md +++ b/reference/valarray/mask_array/op_divide_assign.md @@ -7,7 +7,6 @@ ```cpp void operator/=(const ValOrProxy& xs) const; ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/mask_array/op_left_shift_assign.md b/reference/valarray/mask_array/op_left_shift_assign.md index 49b18383c8..34fea57663 100644 --- a/reference/valarray/mask_array/op_left_shift_assign.md +++ b/reference/valarray/mask_array/op_left_shift_assign.md @@ -7,7 +7,6 @@ ```cpp void operator<<=(const ValOrProxy& xs) const; ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/mask_array/op_minus_assign.md b/reference/valarray/mask_array/op_minus_assign.md index f5f47b2f35..4a99535fa8 100644 --- a/reference/valarray/mask_array/op_minus_assign.md +++ b/reference/valarray/mask_array/op_minus_assign.md @@ -7,7 +7,6 @@ ```cpp void operator-=(const ValOrProxy& xs) const; ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/mask_array/op_modulo_assign.md b/reference/valarray/mask_array/op_modulo_assign.md index 0e79810203..8dc002c99b 100644 --- a/reference/valarray/mask_array/op_modulo_assign.md +++ b/reference/valarray/mask_array/op_modulo_assign.md @@ -7,7 +7,6 @@ ```cpp void operator%=(const ValOrProxy& xs) const; ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/mask_array/op_multiply_assign.md b/reference/valarray/mask_array/op_multiply_assign.md index 8d8052c333..5921024e40 100644 --- a/reference/valarray/mask_array/op_multiply_assign.md +++ b/reference/valarray/mask_array/op_multiply_assign.md @@ -7,7 +7,6 @@ ```cpp void operator*=(const ValOrProxy& xs) const; ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/mask_array/op_or_assign.md b/reference/valarray/mask_array/op_or_assign.md index 57afe32b82..985fb61dc6 100644 --- a/reference/valarray/mask_array/op_or_assign.md +++ b/reference/valarray/mask_array/op_or_assign.md @@ -7,7 +7,6 @@ ```cpp void operator|=(const ValOrProxy& xs) const; ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/mask_array/op_plus_assign.md b/reference/valarray/mask_array/op_plus_assign.md index d1e21473bd..c5ba128c62 100644 --- a/reference/valarray/mask_array/op_plus_assign.md +++ b/reference/valarray/mask_array/op_plus_assign.md @@ -7,7 +7,6 @@ ```cpp void operator+=(const ValOrProxy& xs) const; ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 @@ -48,7 +47,6 @@ int main() } } ``` -* to_string()[link /reference/bitset/bitset/to_string.md] ### 出力 ``` diff --git a/reference/valarray/mask_array/op_right_shift_assign.md b/reference/valarray/mask_array/op_right_shift_assign.md index 49736513e4..d571bb3e5b 100644 --- a/reference/valarray/mask_array/op_right_shift_assign.md +++ b/reference/valarray/mask_array/op_right_shift_assign.md @@ -7,7 +7,6 @@ ```cpp void operator>>=(const ValOrProxy& xs) const; ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/mask_array/op_xor_assign.md b/reference/valarray/mask_array/op_xor_assign.md index 3e5eebc127..724deb22f1 100644 --- a/reference/valarray/mask_array/op_xor_assign.md +++ b/reference/valarray/mask_array/op_xor_assign.md @@ -7,7 +7,6 @@ ```cpp void operator^=(const ValOrProxy& xs) const; ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/slice_array/op_and_assign.md b/reference/valarray/slice_array/op_and_assign.md index cd70f86a38..77b14b2093 100644 --- a/reference/valarray/slice_array/op_and_assign.md +++ b/reference/valarray/slice_array/op_and_assign.md @@ -7,7 +7,6 @@ ```cpp void operator&=(const ValOrProxy& xs) const; ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/slice_array/op_assign.md b/reference/valarray/slice_array/op_assign.md index 9895dd713d..b9e795ef79 100644 --- a/reference/valarray/slice_array/op_assign.md +++ b/reference/valarray/slice_array/op_assign.md @@ -13,7 +13,6 @@ public: void operator=(const ValOrProxy& ar) const; // (2) void operator=(const T& value) const; // (3) ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/slice_array/op_divide_assign.md b/reference/valarray/slice_array/op_divide_assign.md index 8a6efa1086..e2ee7796dd 100644 --- a/reference/valarray/slice_array/op_divide_assign.md +++ b/reference/valarray/slice_array/op_divide_assign.md @@ -7,7 +7,6 @@ ```cpp void operator/=(const ValOrProxy& xs) const; ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/slice_array/op_left_shift_assign.md b/reference/valarray/slice_array/op_left_shift_assign.md index 6d4e07b47e..b827f5bc62 100644 --- a/reference/valarray/slice_array/op_left_shift_assign.md +++ b/reference/valarray/slice_array/op_left_shift_assign.md @@ -7,7 +7,6 @@ ```cpp void operator<<=(const ValOrProxy& xs) const; ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/slice_array/op_minus_assign.md b/reference/valarray/slice_array/op_minus_assign.md index bed07d5a94..22bcdcc5da 100644 --- a/reference/valarray/slice_array/op_minus_assign.md +++ b/reference/valarray/slice_array/op_minus_assign.md @@ -7,7 +7,6 @@ ```cpp void operator-=(const ValOrProxy& xs) const; ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/slice_array/op_modulo_assign.md b/reference/valarray/slice_array/op_modulo_assign.md index 7b9f42ced4..8566a53d78 100644 --- a/reference/valarray/slice_array/op_modulo_assign.md +++ b/reference/valarray/slice_array/op_modulo_assign.md @@ -7,7 +7,6 @@ ```cpp void operator%=(const ValOrProxy& xs) const; ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/slice_array/op_multiply_assign.md b/reference/valarray/slice_array/op_multiply_assign.md index 141339316e..63b1eab616 100644 --- a/reference/valarray/slice_array/op_multiply_assign.md +++ b/reference/valarray/slice_array/op_multiply_assign.md @@ -7,7 +7,6 @@ ```cpp void operator*=(const ValOrProxy& xs) const; ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/slice_array/op_or_assign.md b/reference/valarray/slice_array/op_or_assign.md index 2815e66710..26cd27f90e 100644 --- a/reference/valarray/slice_array/op_or_assign.md +++ b/reference/valarray/slice_array/op_or_assign.md @@ -7,7 +7,6 @@ ```cpp void operator|=(const ValOrProxy& xs) const; ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/slice_array/op_plus_assign.md b/reference/valarray/slice_array/op_plus_assign.md index 276832b409..2b266753ab 100644 --- a/reference/valarray/slice_array/op_plus_assign.md +++ b/reference/valarray/slice_array/op_plus_assign.md @@ -7,7 +7,6 @@ ```cpp void operator+=(const ValOrProxy& xs) const; ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/slice_array/op_right_shift_assign.md b/reference/valarray/slice_array/op_right_shift_assign.md index 0bb47395e7..bddb0eea21 100644 --- a/reference/valarray/slice_array/op_right_shift_assign.md +++ b/reference/valarray/slice_array/op_right_shift_assign.md @@ -7,7 +7,6 @@ ```cpp void operator>>=(const ValOrProxy& xs) const; ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/valarray/slice_array/op_xor_assign.md b/reference/valarray/slice_array/op_xor_assign.md index 18e40b7dd2..cfdd90146a 100644 --- a/reference/valarray/slice_array/op_xor_assign.md +++ b/reference/valarray/slice_array/op_xor_assign.md @@ -7,7 +7,6 @@ ```cpp void operator^=(const ValOrProxy& xs) const; ``` -* valarray[link /reference/valarray/valarray.md] * ValOrProxy[italic] ## 概要 diff --git a/reference/variant/variant/emplace.md b/reference/variant/variant/emplace.md index c8529d3062..53483df850 100644 --- a/reference/variant/variant/emplace.md +++ b/reference/variant/variant/emplace.md @@ -173,7 +173,7 @@ int main() * std::get[link get.md] * std::holds_alternative[link /reference/variant/holds_alternative.md] * index()[link index.md] -* std::in_place_index[link /reference/utility/in_place_index_t.md] +* in_place_index[link /reference/utility/in_place_index_t.md] #### 出力 ``` diff --git a/start_editing.md b/start_editing.md index 963c862fb4..c3e0f467fe 100644 --- a/start_editing.md +++ b/start_editing.md @@ -48,6 +48,9 @@ buildアクションで、MarkdownからHTMLへの変換と、GitHub Pagesへの - ページが消滅した場合は、代替となるものがあれば差し替え、なければInternet Archiveに変更する - 一時的にアクセスできない場合は、時間を置いてアクセスできるようになったらissueを閉じる - 海外からのアクセス (GitHub Actions) を拒否しているページもあるため、そのようなページは個別にチェックから外す ([link_check.py](https://github.com/cpprefjp/site/blob/master/.github/workflows/script/link_check.py)の`IGNORE_LIST`に追加する) +- コード修飾の誤り検出 (code qualify checkアクション) + - コードブロック中のコードを修飾しているのに、その修飾対象がない場合に、エラーが発生する + - [GitHub Actionsの実行ログ](https://github.com/cpprefjp/site/actions/workflows/code_qualify_check.yml)で、どのページのどのコード修飾が不正かがわかるので、それを修正すること ### 自動反映ツール From 318a70e4d2307d898ab08bd12c9f40258aa0a004 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 7 Feb 2023 15:26:44 +0900 Subject: [PATCH 0162/3948] =?UTF-8?q?from=5Fchars=20:=20to=5Faddress?= =?UTF-8?q?=E3=82=92=E4=BD=BF=E7=94=A8=E3=81=99=E3=82=8B=E4=BE=8B=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/charconv/from_chars.md | 90 +++++++++++++++++++++++++++++++- 1 file changed, 88 insertions(+), 2 deletions(-) diff --git a/reference/charconv/from_chars.md b/reference/charconv/from_chars.md index 3c0106a9b1..32e8a8975b 100644 --- a/reference/charconv/from_chars.md +++ b/reference/charconv/from_chars.md @@ -31,7 +31,7 @@ namespace std { C++標準はこれら関数の実装の詳細について何も規定しない。これは、各実装において可能な最も高速なアルゴリズムが選択されることを意図しての事である。 ## 要件 -- 全て : 出力イテレータ範囲`[first, last)`は有効な範囲であること(charのオブジェクトが構築済みであり、連続していること)。 +- 全て : 入力イテレータ範囲`[first, last)`は有効な範囲であること(charのオブジェクトが構築済みであり、連続していること)。 - (1) : `base`は2~36までの値であること。 - (2)~(4) : `fmt`は[`chars_format`](../charconv/chars_format.md)の列挙値のうちの一つであること。 @@ -87,6 +87,8 @@ C++標準はこれら関数の実装の詳細について何も規定しない ## 例 +### 基本の使用例 + ```cpp example #include #include @@ -228,7 +230,7 @@ int main() ``` * std::from_chars[color ff0000] -### 出力例(VS2019 preview4.1) +#### 出力例(VS2019 preview4.1) ``` 123456789 65535 @@ -242,6 +244,90 @@ nan -inf ``` +### イテレータ範囲からの変換(C++20) + +入力文字列はポインタによる範囲で指定する必要があるが、`std::string`等のイテレータは必ずしもポインタとは限らず、そのままでは使いづらいことがある。その様なとき、C++20の[`std::to_address`](/reference/memory/to_address.md)を使用すると安全かつ簡易にこの関数でイテレータを使用できる。 + +```cpp +#include +#include +#include +#include +#include +#include +#include +#include + +// contiguousな文字列範囲内の数値をdoubleへ変換する +template + requires std::same_as> +auto str_to_double(R&& r) -> std::optional { + double out; + + // 範囲のイテレータ(ポインタではない場合がある) + auto it = std::ranges::begin(r); + auto end = std::ranges::end(r); + + // to_addressでイテレータをポインタへ変換して渡す + if (auto [ptr, ec] = std::from_chars(std::to_address(it), std::to_address(end), out, std::chars_format::general); ec != std::errc{}) { + return std::nullopt; + } + + return out; +} + +int main() { + std::string str = "3.1415926535897932384626433832795 is pi"; + + if (auto opt = str_to_double(str); opt) { + std::cout << std::format("{:.15f}\n", *opt); + } else { + std::cout << "conversion failed.\n"; + } + + std::string_view strview = "2.7182818284590452353602874 is e"; + + if (auto opt = str_to_double(strview); opt) { + std::cout << std::format("{:.15f}\n", *opt); + } else { + std::cout << "conversion failed.\n"; + } + + const char cstr[] = "1.10001e-01 is Liouville number"; + std::vector strvec(cstr, std::ranges::end(cstr)); + + if (auto opt = str_to_double(strvec); opt) { + std::cout << std::format("{:.15f}\n", *opt); + } else { + std::cout << "conversion failed.\n"; + } + + std::span sp{cstr}; + + if (auto opt = str_to_double(sp); opt) { + std::cout << std::format("{:.15f}\n", *opt); + } else { + std::cout << "conversion failed.\n"; + } +} +``` +* std::from_chars[color ff0000] +* enable_view[link /reference/ranges/contiguous_range.md] +* enable_view[link /reference/ranges/range_value_t.md] +* enable_view[link /reference/ranges/begin.md] +* enable_view[link /reference/ranges/end.md] +* enable_view[link /reference/memory/to_address.md] +* enable_view[link /reference/format/format.md] + +#### 出力 + +``` +3.141592653589793 +2.718281828459045 +0.110001000000000 +0.110001000000000 +``` + ## バージョン ### 言語 - C++17 From ebf409bfcb1665f5256addfed394b0b3221817e4 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 7 Feb 2023 15:28:10 +0900 Subject: [PATCH 0163/3948] =?UTF-8?q?from=5Fchars=20:=20=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=89=E4=BF=AE=E9=A3=BE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/charconv/from_chars.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/reference/charconv/from_chars.md b/reference/charconv/from_chars.md index 32e8a8975b..8a4ff6a9a5 100644 --- a/reference/charconv/from_chars.md +++ b/reference/charconv/from_chars.md @@ -312,12 +312,12 @@ int main() { } ``` * std::from_chars[color ff0000] -* enable_view[link /reference/ranges/contiguous_range.md] -* enable_view[link /reference/ranges/range_value_t.md] -* enable_view[link /reference/ranges/begin.md] -* enable_view[link /reference/ranges/end.md] -* enable_view[link /reference/memory/to_address.md] -* enable_view[link /reference/format/format.md] +* contiguous_range[link /reference/ranges/contiguous_range.md] +* range_value_t[link /reference/ranges/range_value_t.md] +* begin[link /reference/ranges/begin.md] +* end[link /reference/ranges/end.md] +* to_address[link /reference/memory/to_address.md] +* format[link /reference/format/format.md] #### 出力 From 996f8d3679187e3abf7240299e2609f33975c35d Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 9 Feb 2023 10:25:10 +0900 Subject: [PATCH 0164/3948] =?UTF-8?q?expected/expected.void:=20=E3=82=B3?= =?UTF-8?q?=E3=83=B3=E3=82=B9=E3=83=88=E3=83=A9=E3=82=AF=E3=82=BF,?= =?UTF-8?q?=E3=83=87=E3=82=B9=E3=83=88=E3=83=A9=E3=82=AF=E3=82=BF(#1066)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 実験的に`expected`プライマリテンプレートと`expected`部分特殊化を フォルダ構造分離したうえで各種メンバの説明ページを作成してみる。 --- reference/expected/expected.md | 51 +++- .../expected/expected.void/op_constructor.md | 259 ++++++++++++++++++ .../expected/expected.void/op_destructor.md | 37 +++ reference/expected/expected/op_constructor.md | 5 +- 4 files changed, 348 insertions(+), 4 deletions(-) create mode 100644 reference/expected/expected.void/op_constructor.md create mode 100644 reference/expected/expected.void/op_destructor.md diff --git a/reference/expected/expected.md b/reference/expected/expected.md index 21b53d0301..9354101670 100644 --- a/reference/expected/expected.md +++ b/reference/expected/expected.md @@ -6,10 +6,11 @@ ```cpp namespace std { + // プライマリテンプレート template class expected; - // T=cv void 部分特殊化 + // T=cv void 部分特殊化テンプレート template requires is_void_v class expected; @@ -27,7 +28,7 @@ namespace std { - 型`E`はCpp17Destructible要件を満たすこと。 -## メンバ関数 +## メンバ関数(プライマリテンプレート) ### 構築・破棄 | 名前 | 説明 | 対応バージョン | @@ -73,6 +74,52 @@ namespace std { | [`operator!=`](expected/op_not_equal.md) | 非等値比較 | C++23 | +## メンバ関数(T=cv void 部分特殊化テンプレート) +### 構築・破棄 + +| 名前 | 説明 | 対応バージョン | +|-----------------|----------------|-------| +| [`(constructor)`](expected.void/op_constructor.md) | コンストラクタ | C++23 | +| [`(destructor)`](expected.void/op_destructor.md) | デストラクタ | C++23 | + +### 代入 + +| 名前 | 説明 | 対応バージョン | +|-----------------|----------------|-------| +| [`operator=`](expected.void/op_assign.md.nolink) | 代入演算子 | C++23 | +| [`emplace`](expected.void/emplace.md.nolink) | 正常値型のコンストラクタ引数から直接構築する | C++23 | +| [`swap`](expected.void/swap.md.nolink) | 他の`expected`オブジェクトとデータを入れ替える | C++23 | + +### 値の観測 + +| 名前 | 説明 | 対応バージョン | +|-----------------|----------------|-------| +| [`operator*`](expected.void/op_deref.md.nolink) | 正常値への間接参照 | C++23 | +| [`operator bool`](expected.void/op_bool.md.nolink) | 正常値を保持しているかを判定する | C++23 | +| [`has_value`](expected.void/has_value.md.nolink) | 正常値を保持しているかを判定する | C++23 | +| [`value`](expected.void/value.md.nolink) | 正常値を取得する | C++23 | +| [`error`](expected.void/error.md.nolink) | エラー値を取得する | C++23 | +| [`error_or`](expected.void/error_or.md.nolink) | エラー値もしくは指定された値を取得する | C++23 | + +(`expected` 部分特殊化では、演算子オーバーロード`operator->`およびメンバ関数`value`は提供されない。) + +### モナド操作 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`and_then`](expected.void/and_then.md.nolink) | 正常値に対して関数を適用する | C++23 | +| [`or_else`](expected.void/or_else.md.nolink) | エラー値に対して関数を適用する | C++23 | +| [`transform`](expected.void/transform.md.nolink) | 正常値を変換する | C++23 | +| [`transform_error`](expected.void/transform_error.md.nolink) | エラー値を変換する | C++23 | + +### 比較 + +| 名前 | 説明 | 対応バージョン | +|--------------|------------|-------| +| [`operator==`](expected.void/op_equal.md.nolink) | 等値比較 | C++23 | +| [`operator!=`](expected.void/op_not_equal.md.nolink) | 非等値比較 | C++23 | + + ## メンバ型 | 名前 | 説明 | 対応バージョン | diff --git a/reference/expected/expected.void/op_constructor.md b/reference/expected/expected.void/op_constructor.md new file mode 100644 index 0000000000..778760f7a6 --- /dev/null +++ b/reference/expected/expected.void/op_constructor.md @@ -0,0 +1,259 @@ +# コンストラクタ +* expected[meta header] +* function[meta id-type] +* std[meta namespace] +* expected[meta class] +* cpp23[meta cpp] + +```cpp +// expected部分特殊化 +constexpr expected(); // (1) +constexpr expected(const expected& rhs); // (2) +constexpr expected(expected&& rhs) noexcept(see below); // (3) + +template +constexpr explicit(see below) expected(const expected& rhs); // (4) +template +constexpr explicit(see below) expected(expected&& rhs); // (5) + +template +constexpr explicit(see below) expected(const unexpected& e); // (6) +template +constexpr explicit(see below) expected(unexpected&& e); // (7) + +constexpr explicit expected(in_place_t) noexcept; // (8) + +template +constexpr explicit expected(unexpect_t, Args&&... args); // (9) +template +constexpr explicit expected(unexpect_t, initializer_list il, Args&&... args); // (10) +``` +* see below[italic] +* unexpected[link ../unexpected.md] +* unexpect_t[link ../unexpect_t.md] +* in_place_t[link /reference/utility/in_place_t.md] +* initializer_list[link /reference/initializer_list/initializer_list.md] + +## 概要 +- (1) : 正常値を保持する。 +- (2) : コピーコンストラクタ。 +- (3) : ムーブコンストラクタ。 +- (4) : 変換可能な`expected`オブジェクトからコピー構築する。 +- (5) : 変換可能な`expected`オブジェクトからムーブ構築する。 +- (6) : 変換可能な[`unexpected`](../unexpected.md)オブジェクトかエラー値をコピー構築する。 +- (7) : 変換可能な[`unexpected`](../unexpected.md)オブジェクトからエラー値をムーブ構築する。 +- (8) : 正常値を保持する。 +- (9) : エラー値型`E`のコンストラクタ引数として任意個の引数を受け取って、コンストラクタ内で型`E`のオブジェクトをエラー値として生成し、保持する。 +- (10) : エラー値型`E`のコンストラクタ引数として初期化子リストと任意個の引数を受け取って、コンストラクタ内で型`E`のオブジェクトをエラー値として生成し、保持する。 + + +## テンプレートパラメータ制約 +- (3) : [`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)` == true` +- (4) : 次の制約を全て満たすこと + - [`is_void_v`](/reference/type_traits/is_void.md)` == true` + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true` + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)`<`[`unexpected`](../unexpected.md)`, expected&> == false` + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)`<`[`unexpected`](../unexpected.md)`, expected> == false` + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)`<`[`unexpected`](../unexpected.md)`, const expected&> == false` + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)`<`[`unexpected`](../unexpected.md)`, const expected> == false` +- (5) : 次の制約を全て満たすこと + - [`is_void_v`](/reference/type_traits/is_void.md)` == true` + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true` + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)`<`[`unexpected`](../unexpected.md)`, expected&> == false` + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)`<`[`unexpected`](../unexpected.md)`, expected> == false` + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)`<`[`unexpected`](../unexpected.md)`, const expected&> == false` + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)`<`[`unexpected`](../unexpected.md)`, const expected> == false` +- (6) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true` +- (7) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true` +- (9) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true` +- (10) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)`&, Args...> == true` + + +## 効果 +- (1) : 正常値を保持する。 +- (2) : `rhs`がエラー値を保持していれば、`rhs.`[`error()`](error.md.nolink)でエラー値を直接非リスト初期化する。 +- (3) : `rhs`がエラー値を保持していれば、[`std::move`](/reference/utility/move.md)`(rhs.`[`error()`](error.md.nolink)`)`でエラー値を直接非リスト初期化する。 +- (4) : `rhs`がエラー値を保持していれば、[`std::forward`](/reference/utility/forward.md)`(rhs.`[`error()`](error.md.nolink)`)`でエラー値を直接非リスト初期化する。 +- (5) : `rhs`がエラー値を保持していれば、[`std::forward`](/reference/utility/forward.md)`(rhs.`[`error()`](error.md.nolink)`)`でエラー値を直接非リスト初期化する。 +- (6) : [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md.nolink)`)`でエラー値を直接非リスト初期化する。 +- (7) : [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md.nolink)`)`でエラー値を直接非リスト初期化する。 +- (9) : [`std::forward`](/reference/utility/forward.md)`(args)...`でエラー値を直接非リスト初期化する。 +- (10) : `il,` [`std::forward`](/reference/utility/forward.md)`(args)...`でエラー値を直接非リスト初期化する。 + + +## 事後条件 +- (1) : 正常値を保持している。 +- (2) : `rhs`が正常値を保持する場合は`*this`も正常値を保持し、`rhs`がエラー値を保持する場合は`*this`もエラー値を保持する。 +- (3) : `rhs`が正常値を保持する場合は`*this`も正常値を保持し、`rhs`がエラー値を保持する場合は`*this`もエラー値を保持する。`rhs.`[`has_value()`](has_value.md.nolink)は変化しない。 +- (4), (5) : `rhs`が正常値を保持する場合は`*this`も正常値を保持し、`rhs`がエラー値を保持する場合は`*this`もエラー値を保持する。`rhs.`[`has_value()`](has_value.md.nolink)は変化しない。 +- (6), (7) : エラー値を保持している。 +- (8) : 正常値を保持している。 +- (9), (10) : エラー値を保持している。 + + +## 例外 +- (2) : エラー値型の初期化から送出される例外。 +- (3) : エラー値型の初期化から送出される例外。 + - [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)``であれば、ムーブコンストラクタはnoexpcet指定される。 +- (4), (5) : エラー値型の初期化から送出される例外。 +- (6), (7) : エラー値型の初期化から送出される例外。 +- (8) : 投げない。 +- (9), (10) : エラー値型の初期化から送出される例外。 + + +## delete定義される条件 +- (2) : `!`[`is_copy_constructible_v`](/reference/type_traits/is_copy_constructible.md)`` + + +## トリビアルに定義される条件 +- (2) : [`is_trivially_copy_constructible_v`](/reference/type_traits/is_trivially_copy_constructible.md)`` +- (3) : [`is_trivially_move_constructible_v`](/reference/type_traits/is_trivially_move_constructible.md)`` + + +## explicitになる条件 +- (4) : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`` +- (5) : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`` +- (6) : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`` +- (7) : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`` + + +## 例 +```cpp example +#include +#include +#include +#include +#include +#include +#include +#include + +// std::pair型から2要素std::tuple型へはコピー変換可能 +using IntPair = std::pair; +using IntTuple = std::tuple; + +// std::unique_ptr型からstd::shared_ptr型へはムーブ変換可能 +using UniquePtr = std::unique_ptr; +using SharedPtr = std::shared_ptr; + +// 引数リスト または 初期化子リスト+引数リスト から構築可能な型 +struct ComplexType { + std::string data; + std::vector seq; + + ComplexType(const char* ptr, size_t len) + : data(ptr, len) {} + ComplexType(std::initializer_list il, std::string_view sv) + : data(sv), seq(il) {} +}; + +int main() +{ + // (1) デフォルトコンストラクタ + { + std::expected x; + assert(x.has_value()); + } + + // (2) コピーコンストラクタ + { + std::expected srcV; + std::expected dstV = srcV; + assert(srcV.has_value() && dstV.has_value()); + + std::expected srcE = std::unexpected{42}; + std::expected dstE = srcE; + assert(!srcE.has_value() && !dstE.has_value()); + assert(srcE.error() == 42 && dstE.error() == 42); + } + + // (3) ムーブコンストラクタ + { + std::expected srcV; + std::expected dstV = std::move(srcV); + assert(srcV.has_value() && dstV.has_value()); + + std::expected srcE = std::unexpected{"Oops"}; + std::expected dstE = std::move(srcE); + assert(!srcE.has_value() && !dstE.has_value()); + assert(dstE.error() == "Oops"); + // srcE.error()はstd::stringムーブ後の未規定の値 + } + + // (4) 変換コピー構築 + { + std::expected src = std::unexpected{IntPair{1, 2}}; + std::expected dst = src; + assert(!src.has_value() && !dst.has_value()); + assert((dst.error() == IntTuple{1, 2})); + } + + // (5) 変換ムーブ構築 + { + std::expected src = std::unexpected{std::make_unique(42)}; + std::expected dst = std::move(src); + assert(!src.has_value() && !dst.has_value()); + assert(*dst.error() == 42); + assert(src.error() == nullptr); + // ムーブ後のstd::unique_ptr型はnullptrが保証される + } + + // (6),(7) エラー値の変換コピー/ムーブ構築 + { + std::unexpected src1{std::in_place, 1, 2}; + std::expected dst1 = src1; + assert(not dst1.has_value()); + assert((dst1.error() == IntTuple{1, 2})); + + UniquePtr src2 = std::make_unique(42); + std::expected dst2 = std::unexpected{std::move(src2)}; + assert(not dst2.has_value()); + assert(*dst2.error() == 42); + } + + // (8) 正常値(void)を直接構築 + { + std::expected x1{std::in_place}; + assert(x1.has_value()); + } + + // (9),(10) 引数リストからエラー値を直接構築 + { + std::expected x1{std::unexpect, "C++", 1}; + assert(not x1.has_value()); + assert(x1.error().data == "C"); + // "C++"より長さ1の文字列が構築されている + + std::expected x2{std::unexpect, {11, 14, 17, 20, 23}, "C++"}; + assert(not x2.has_value()); + assert(x2.error().data == "C++"); + assert((x2.error().seq == std::vector{11, 14, 17, 20, 23})); + } +} +``` +* has_value()[link has_value.md.nolink] +* value()[link value.md.nolink] +* error()[link error.md.nolink] +* std::unexpected[link ../unexpected.md] +* std::unexpect[link ../unexpect_t.md] +* std::in_place[link /reference/utility/in_place_t.md] +* std::make_unique[link /reference/memory/make_unique.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) diff --git a/reference/expected/expected.void/op_destructor.md b/reference/expected/expected.void/op_destructor.md new file mode 100644 index 0000000000..9e18dce500 --- /dev/null +++ b/reference/expected/expected.void/op_destructor.md @@ -0,0 +1,37 @@ +# デストラクタ +* expected[meta header] +* function[meta id-type] +* std[meta namespace] +* expected[meta class] +* cpp23[meta cpp] + +```cpp +// expected部分特殊化 +constexpr ~expected(); +``` + +## 概要 +`expected`オブジェクトを破棄する。 + + +## 効果 +エラー値を保持している場合は、エラー値オブジェクトのデストラクタを呼び出す。 + + +## トリビアルに定義される条件 +[`is_trivially_destructible_v`](/reference/type_traits/is_trivially_destructible.md)`` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) diff --git a/reference/expected/expected/op_constructor.md b/reference/expected/expected/op_constructor.md index 2d9634ce5a..34e9931df9 100644 --- a/reference/expected/expected/op_constructor.md +++ b/reference/expected/expected/op_constructor.md @@ -149,8 +149,8 @@ constexpr bool converts-from-any-cvref = ## explicitになる条件 -- (4) : `!`[`is_convertible_v`](/reference/type_traits/is_constructible.md)` || !`[`is_convertible_v`](/reference/type_traits/is_constructible.md)`` -- (5) : `!`[`is_convertible_v`](/reference/type_traits/is_constructible.md)` || !`[`is_convertible_v`](/reference/type_traits/is_constructible.md)`` +- (4) : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` || !`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`` +- (5) : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` || !`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`` - (6) : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`` - (7) : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`` - (8) : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`` @@ -162,6 +162,7 @@ constexpr bool converts-from-any-cvref = #include #include #include +#include #include #include #include From 44a8e478d43dcbbc5711c05570cf15be16a451f1 Mon Sep 17 00:00:00 2001 From: Akiko Kawai Date: Thu, 9 Feb 2023 11:11:22 +0900 Subject: [PATCH 0165/3948] Updated ICC ver for C++20 --- implementation-status.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/implementation-status.md b/implementation-status.md index 2de75dc39f..e29619c469 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -193,10 +193,10 @@ | P0969R0: [friend指定された関数内から構造化束縛を使用して非公開メンバ変数にアクセスすることを許可](/lang/cpp20/allow_structured_bindings_to_accessible_members.md) | 構造化束縛の仕様として公開メンバ変数のみを取り出せるようになっていたが、friend指定された関数からは非公開メンバ変数にもアクセスできるようにする | 8 | 8.0 | 2021.4 | 2019 | | P0961R1: [構造化束縛がカスタマイゼーションポイントを見つけるルールを緩和](/lang/cpp20/relaxing_the_structured_bindings_customization_point_finding_rules.md) | 非テンプレートの`get()`メンバ関数が見つかった場合は、非メンバ関数の`get()`を探しにいく | 8 | 8.0 | 2021.4 | 2019 | | P0634R3: [型の文脈で`typename`の省略を許可](/lang/cpp20/down_with_typename.md) | 型しか現れない文脈では、依存名を解決するための`typename`キーワードを省略できるようにする | 9 | 16 | 2021.4 (2021.6 は未対応) | 2019 Update 9 | -| P0780R2: [ラムダ式の初期化キャプチャでのパック展開を許可](/lang/cpp20/allow_pack_expansion_in_lambda_init_capture.md) | `[...args = std::move(args)]`のようなキャプチャを許可 | 9
10 | 9.0 | | 2019 Update 2 | -| P0479R5: [確率が高い分岐と低い分岐を伝える属性 `[[likely]]`, `[[unlikely]]`](/lang/cpp20/likely_and_unlikely_attributes.md) | 条件分岐の最適化ヒントを与える属性 | 9 (partial, `switch` 文のみ可能)
10 | 12.0 | | 2019 Update 6 | +| P0780R2: [ラムダ式の初期化キャプチャでのパック展開を許可](/lang/cpp20/allow_pack_expansion_in_lambda_init_capture.md) | `[...args = std::move(args)]`のようなキャプチャを許可 | 9
10 | 9.0 | 2021.7 | 2019 Update 2 | +| P0479R5: [確率が高い分岐と低い分岐を伝える属性 `[[likely]]`, `[[unlikely]]`](/lang/cpp20/likely_and_unlikely_attributes.md) | 条件分岐の最適化ヒントを与える属性 | 9 (partial, `switch` 文のみ可能)
10 | 12.0 | 2021.7 | 2019 Update 6 | | P0929R2: [抽象型のチェック](/lang/cpp20/checking_for_abstract_class_types.md) | 関数の宣言段階では、パラメータおよび戻り値型が抽象型かどうかをチェックしないようにする | 11 | | | 2019 Update 5 | -| P0732R2: [非型テンプレートパラメータとしてクラス型を許可する](/lang/cpp20/class_types_in_non-type_template_parameters.md) | 定数式として使用できる型を広く非型テンプレートパラメータとして使用できるようにする | 9 | partial | | 2019 Update 6 | +| P0732R2: [非型テンプレートパラメータとしてクラス型を許可する](/lang/cpp20/class_types_in_non-type_template_parameters.md) | 定数式として使用できる型を広く非型テンプレートパラメータとして使用できるようにする | 9 | partial | 2022.2 Partial | 2019 Update 6 | | P0722R3: [可変長データを扱うクラスの効率的な`delete`](/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md) | クラスの`delete`演算子が呼び出される前にデストラクタが呼ばれないようにするオプションを追加 | 9 | 6.0 | | 2019 Update 7 | | P1064R0: [定数式からの仮想関数の呼び出しを許可](/lang/cpp20/allow_virtual_function_calls_in_constant_expressions.md) | 仮想関数に`constexpr`を付けられない制限を解除 | 9 | 9.0 | 2021.4 | 2019 Update 9 | | P1327R1: [定数式での`dynamic_cast`、多態的な`typeid`を許可](/lang/cpp20/allowing_dynamic_cast_polymorphic_typeid_in_constant_expressions.md) | 定数式での動的多態を許可 | 10 | 9.0 | 2021.4 | 2019 Update 9 | From a97b34fc918f85ea6c1705856c12e04491d1b978 Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 9 Feb 2023 11:47:13 +0900 Subject: [PATCH 0166/3948] =?UTF-8?q?expected/expected.void:=20=E3=83=9A?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E6=A7=8B=E9=80=A0=E3=82=92=E8=AA=BF=E6=95=B4?= =?UTF-8?q?(#1066)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/expected/expected.void.md | 24 +++++++++++++++++++ .../expected/expected.void/op_constructor.md | 2 +- .../expected/expected.void/op_destructor.md | 2 +- 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 reference/expected/expected.void.md diff --git a/reference/expected/expected.void.md b/reference/expected/expected.void.md new file mode 100644 index 0000000000..1b909048f7 --- /dev/null +++ b/reference/expected/expected.void.md @@ -0,0 +1,24 @@ +# expected +* expected[meta header] +* class template[meta id-type] +* std[meta namespace] +* cpp23[meta cpp] + +```cpp +namespace std { + // プライマリテンプレート + template + class expected; + + // T=cv void 部分特殊化テンプレート + template + requires is_void_v + class expected; +} +``` +* expected[link expected.md] +* is_void_v[link /reference/type_traits/is_void.md] + +このページは`expected`部分特殊化テンプレートに対応するプレースホルダです。 + +`expected`クラスの説明は[`expected`プライマリテンプレート](expected.md)ページを参照してください。 diff --git a/reference/expected/expected.void/op_constructor.md b/reference/expected/expected.void/op_constructor.md index 778760f7a6..68eca5a471 100644 --- a/reference/expected/expected.void/op_constructor.md +++ b/reference/expected/expected.void/op_constructor.md @@ -2,7 +2,7 @@ * expected[meta header] * function[meta id-type] * std[meta namespace] -* expected[meta class] +* expected[meta class] * cpp23[meta cpp] ```cpp diff --git a/reference/expected/expected.void/op_destructor.md b/reference/expected/expected.void/op_destructor.md index 9e18dce500..aa71c726dc 100644 --- a/reference/expected/expected.void/op_destructor.md +++ b/reference/expected/expected.void/op_destructor.md @@ -2,7 +2,7 @@ * expected[meta header] * function[meta id-type] * std[meta namespace] -* expected[meta class] +* expected[meta class] * cpp23[meta cpp] ```cpp From dbb5c926307857ac6baca67048ee5407893d7531 Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 9 Feb 2023 13:13:27 +0900 Subject: [PATCH 0167/3948] =?UTF-8?q?expected/expected.void:=20meta=20clas?= =?UTF-8?q?s=E3=82=92=E4=BF=AE=E6=AD=A3(#1066)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/expected/expected.void/op_constructor.md | 2 +- reference/expected/expected.void/op_destructor.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/expected/expected.void/op_constructor.md b/reference/expected/expected.void/op_constructor.md index 68eca5a471..0559dcb3fd 100644 --- a/reference/expected/expected.void/op_constructor.md +++ b/reference/expected/expected.void/op_constructor.md @@ -2,7 +2,7 @@ * expected[meta header] * function[meta id-type] * std[meta namespace] -* expected[meta class] +* expected.void[meta class] * cpp23[meta cpp] ```cpp diff --git a/reference/expected/expected.void/op_destructor.md b/reference/expected/expected.void/op_destructor.md index aa71c726dc..9696d45f1b 100644 --- a/reference/expected/expected.void/op_destructor.md +++ b/reference/expected/expected.void/op_destructor.md @@ -2,7 +2,7 @@ * expected[meta header] * function[meta id-type] * std[meta namespace] -* expected[meta class] +* expected.void[meta class] * cpp23[meta cpp] ```cpp From 7c00cbcb2ff088824321a079167205680fb812b6 Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 9 Feb 2023 13:21:42 +0900 Subject: [PATCH 0168/3948] =?UTF-8?q?expected/expected.void:=20=E3=83=9A?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=82=BF=E3=82=A4=E3=83=88=E3=83=AB=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3(#1066)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/expected/expected.void.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/expected/expected.void.md b/reference/expected/expected.void.md index 1b909048f7..982d00f7ff 100644 --- a/reference/expected/expected.void.md +++ b/reference/expected/expected.void.md @@ -1,4 +1,4 @@ -# expected +# expected.void * expected[meta header] * class template[meta id-type] * std[meta namespace] From d55ed2f5f2abc2de1e69da1ed1f94cea6167738a Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 9 Feb 2023 16:00:32 +0900 Subject: [PATCH 0169/3948] =?UTF-8?q?expected/expected.void:=20=E5=85=A8?= =?UTF-8?q?=E3=83=A1=E3=83=B3=E3=83=90=E9=96=A2=E6=95=B0(#1066)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/expected/expected.md | 32 ++-- reference/expected/expected.void.md | 2 +- reference/expected/expected.void/and_then.md | 136 ++++++++++++++ reference/expected/expected.void/emplace.md | 55 ++++++ reference/expected/expected.void/error.md | 75 ++++++++ reference/expected/expected.void/error_or.md | 69 +++++++ reference/expected/expected.void/has_value.md | 65 +++++++ reference/expected/expected.void/op_assign.md | 171 ++++++++++++++++++ reference/expected/expected.void/op_bool.md | 75 ++++++++ .../expected/expected.void/op_constructor.md | 18 +- reference/expected/expected.void/op_deref.md | 67 +++++++ reference/expected/expected.void/op_equal.md | 82 +++++++++ .../expected/expected.void/op_not_equal.md | 81 +++++++++ reference/expected/expected.void/or_else.md | 130 +++++++++++++ reference/expected/expected.void/swap.md | 98 ++++++++++ reference/expected/expected.void/transform.md | 110 +++++++++++ .../expected/expected.void/transform_error.md | 104 +++++++++++ reference/expected/expected.void/value.md | 72 ++++++++ reference/expected/expected/emplace.md | 4 +- reference/expected/expected/op_assign.md | 2 +- reference/expected/expected/op_bool.md | 2 +- reference/expected/expected/or_else.md | 4 +- reference/expected/expected/swap.md | 8 - .../expected/expected/transform_error.md | 4 +- 24 files changed, 1424 insertions(+), 42 deletions(-) create mode 100644 reference/expected/expected.void/and_then.md create mode 100644 reference/expected/expected.void/emplace.md create mode 100644 reference/expected/expected.void/error.md create mode 100644 reference/expected/expected.void/error_or.md create mode 100644 reference/expected/expected.void/has_value.md create mode 100644 reference/expected/expected.void/op_assign.md create mode 100644 reference/expected/expected.void/op_bool.md create mode 100644 reference/expected/expected.void/op_deref.md create mode 100644 reference/expected/expected.void/op_equal.md create mode 100644 reference/expected/expected.void/op_not_equal.md create mode 100644 reference/expected/expected.void/or_else.md create mode 100644 reference/expected/expected.void/swap.md create mode 100644 reference/expected/expected.void/transform.md create mode 100644 reference/expected/expected.void/transform_error.md create mode 100644 reference/expected/expected.void/value.md diff --git a/reference/expected/expected.md b/reference/expected/expected.md index 9354101670..94ecaf8a84 100644 --- a/reference/expected/expected.md +++ b/reference/expected/expected.md @@ -86,38 +86,38 @@ namespace std { | 名前 | 説明 | 対応バージョン | |-----------------|----------------|-------| -| [`operator=`](expected.void/op_assign.md.nolink) | 代入演算子 | C++23 | -| [`emplace`](expected.void/emplace.md.nolink) | 正常値型のコンストラクタ引数から直接構築する | C++23 | -| [`swap`](expected.void/swap.md.nolink) | 他の`expected`オブジェクトとデータを入れ替える | C++23 | +| [`operator=`](expected.void/op_assign.md) | 代入演算子 | C++23 | +| [`emplace`](expected.void/emplace.md) | 正常値を保持する | C++23 | +| [`swap`](expected.void/swap.md) | 他の`expected`オブジェクトとデータを入れ替える | C++23 | ### 値の観測 | 名前 | 説明 | 対応バージョン | |-----------------|----------------|-------| -| [`operator*`](expected.void/op_deref.md.nolink) | 正常値への間接参照 | C++23 | -| [`operator bool`](expected.void/op_bool.md.nolink) | 正常値を保持しているかを判定する | C++23 | -| [`has_value`](expected.void/has_value.md.nolink) | 正常値を保持しているかを判定する | C++23 | -| [`value`](expected.void/value.md.nolink) | 正常値を取得する | C++23 | -| [`error`](expected.void/error.md.nolink) | エラー値を取得する | C++23 | -| [`error_or`](expected.void/error_or.md.nolink) | エラー値もしくは指定された値を取得する | C++23 | +| [`operator*`](expected.void/op_deref.md) | 正常値への間接参照 | C++23 | +| [`operator bool`](expected.void/op_bool.md) | 正常値を保持しているかを判定する | C++23 | +| [`has_value`](expected.void/has_value.md) | 正常値を保持しているかを判定する | C++23 | +| [`value`](expected.void/value.md) | 正常値を取得する | C++23 | +| [`error`](expected.void/error.md) | エラー値を取得する | C++23 | +| [`error_or`](expected.void/error_or.md) | エラー値もしくは指定された値を取得する | C++23 | -(`expected` 部分特殊化では、演算子オーバーロード`operator->`およびメンバ関数`value`は提供されない。) +(`expected` 部分特殊化では、演算子オーバーロード`operator->`およびメンバ関数`value_or`は提供されない。) ### モナド操作 | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`and_then`](expected.void/and_then.md.nolink) | 正常値に対して関数を適用する | C++23 | -| [`or_else`](expected.void/or_else.md.nolink) | エラー値に対して関数を適用する | C++23 | -| [`transform`](expected.void/transform.md.nolink) | 正常値を変換する | C++23 | -| [`transform_error`](expected.void/transform_error.md.nolink) | エラー値を変換する | C++23 | +| [`and_then`](expected.void/and_then.md) | 正常値に対して関数を適用する | C++23 | +| [`or_else`](expected.void/or_else.md) | エラー値に対して関数を適用する | C++23 | +| [`transform`](expected.void/transform.md) | 正常値を変換する | C++23 | +| [`transform_error`](expected.void/transform_error.md) | エラー値を変換する | C++23 | ### 比較 | 名前 | 説明 | 対応バージョン | |--------------|------------|-------| -| [`operator==`](expected.void/op_equal.md.nolink) | 等値比較 | C++23 | -| [`operator!=`](expected.void/op_not_equal.md.nolink) | 非等値比較 | C++23 | +| [`operator==`](expected.void/op_equal.md) | 等値比較 | C++23 | +| [`operator!=`](expected.void/op_not_equal.md) | 非等値比較 | C++23 | ## メンバ型 diff --git a/reference/expected/expected.void.md b/reference/expected/expected.void.md index 982d00f7ff..0081c57287 100644 --- a/reference/expected/expected.void.md +++ b/reference/expected/expected.void.md @@ -21,4 +21,4 @@ namespace std { このページは`expected`部分特殊化テンプレートに対応するプレースホルダです。 -`expected`クラスの説明は[`expected`プライマリテンプレート](expected.md)ページを参照してください。 +`expected`クラスの説明は[`expected`プライマリテンプレート](expected.md)ページを参照してください。 diff --git a/reference/expected/expected.void/and_then.md b/reference/expected/expected.void/and_then.md new file mode 100644 index 0000000000..47c6b5f6dd --- /dev/null +++ b/reference/expected/expected.void/and_then.md @@ -0,0 +1,136 @@ +# and_then +* expected[meta header] +* function template[meta id-type] +* std[meta namespace] +* expected.void[meta class] +* cpp23[meta cpp] + +```cpp +// expected部分特殊化 +template constexpr auto and_then(F&& f) &; // (1) +template constexpr auto and_then(F&& f) const &; // (2) +template constexpr auto and_then(F&& f) &&; // (3) +template constexpr auto and_then(F&& f) const &&; // (4) +``` + +## 概要 +正常値を保持していれば、`f`の呼び出し結果を`expected`として返す。 +エラー値を保持していれば、そのまま返す。 + +実際には複数オーバーロードが提供されるが、大まかには下記シグニチャのようにみなせる。 +`and_then`へは、引数をとらず`std::expected`型を返す関数や関数オブジェクトを与える。 + +```cpp +template +class expected { + template + std::expected and_then(function()> func); +}; +``` +* function[link /reference/functional/function.md] + + +## テンプレートパラメータ制約 +- (1), (2) : [`is_copy_constructible_v`](/reference/type_traits/is_copy_constructible.md)` == true` +- (3), (4) : [`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)` == true` + + +## 適格要件 +- (1), (2) : 型`U`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`>`としたとき、次を全て満たすこと + - `U`が`expected`の特殊化である + - [`is_same_v`](/reference/type_traits/is_same.md)` == true` +- (3), (4) : 型`U`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`>`としたとき、次を全て満たすこと + - `U`が`expected`の特殊化である + - [`is_same_v`](/reference/type_traits/is_same.md)` == true` + + +## 効果 +- (1), (2) : 次の処理と等価 + ```cpp + if (has_value()) + return invoke(std::forward(f)); + else + return U(unexpect, error()); + ``` + * has_value[link has_value.md] + * error()[link error.md] + * unexpect[link ../unexpect_t.md] + * invoke[link /reference/functional/invoke.md] + * std::forward[link /reference/utility/forward.md] + +- (3), (4) : 次の処理と等価 + ```cpp + if (has_value()) + return invoke(std::forward(f)); + else + return U(unexpect, std::move(error())); + ``` + * has_value[link has_value.md] + * error()[link error.md] + * unexpect[link ../unexpect_t.md] + * invoke[link /reference/functional/invoke.md] + * std::forward[link /reference/utility/forward.md] + * std::move[link /reference/utility/move.md] + + +## 備考 +`and_then`は、メソッドチェーンをサポートするモナド風(monadic)操作として導入された。 + + +## 例 +```cpp example +#include +#include +#include + +std::expected ok() +{ + return {}; +} + +std::expected ng() +{ + return std::unexpected{"ng"}; +} + +int main() +{ + std::expected v1; + assert(v1.and_then(ok).has_value()); + + std::expected v2; + assert(v2.and_then(ng).error() == "ng"); + + std::expected e1 = std::unexpected{"empty"}; + assert(e1.and_then(ng).error() == "empty"); +} +``` +* and_then[color ff0000] +* has_value()[link has_value.md] +* error()[link error.md] +* std::unexpected[link ../unexpected.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.0 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`or_else()`](or_else.md) +- [`transform()`](transform.md) +- [`transform_error()`](transform_error.md) + + +## 参照 +- [P2505R5 Monadic Functions for `std::expected`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2505r5.html) diff --git a/reference/expected/expected.void/emplace.md b/reference/expected/expected.void/emplace.md new file mode 100644 index 0000000000..bffef043ec --- /dev/null +++ b/reference/expected/expected.void/emplace.md @@ -0,0 +1,55 @@ +# emplace +* expected[meta header] +* function[meta id-type] +* std[meta namespace] +* expected.void[meta class] +* cpp23[meta cpp] + +```cpp +// expected部分特殊化 +constexpr void emplace() noexcept; +``` + +## 概要 +正常値を保持する。 + + +## 効果 +正常値を保持していたら、何もしない。 +エラー値を保持していたら、エラー値を破棄して正常値を保持する。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::expected x = std::unexpected{42}; + x.emplace(); + assert(x.has_value()); +} +``` +* emplace[color ff0000] +* has_value()[link has_value.md] +* std::unexpected[link ../unexpected.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) diff --git a/reference/expected/expected.void/error.md b/reference/expected/expected.void/error.md new file mode 100644 index 0000000000..36d7ca92ca --- /dev/null +++ b/reference/expected/expected.void/error.md @@ -0,0 +1,75 @@ +# error +* expected[meta header] +* function[meta id-type] +* std[meta namespace] +* expected.void[meta class] +* cpp23[meta cpp] + +```cpp +// expected部分特殊化 +constexpr const E& error() const & noexcept; // (1) +constexpr E& error() & noexcept; // (2) +constexpr const E&& error() const && noexcept; // (3) +constexpr E&& error() && noexcept; // (4) +``` + +## 概要 +エラー値を取得する。 + + +## 事前条件 +[`has_value()`](has_value.md) `== false` + + +## 戻り値 +動作説明用のメンバ変数として、エラー値を保持する`unex`を導入する。 + +- (1), (2) : エラー値を保持していたら、`unex` +- (3), (4) : エラー値を保持していたら、[`std::move`](/reference/utility/move.md)`(unex)` + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include +#include +#include + +int main() +{ + std::expected x = std::unexpected{"ERR"}; + assert(not x.has_value()); + std::cout << x.error() << std::endl; +} +``` +* error()[color ff0000] +* has_value()[link has_value.md] +* std::unexpected[link ../unexpected.md] + +### 出力 +``` +ERR +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`error_or`](error_or.md) + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) diff --git a/reference/expected/expected.void/error_or.md b/reference/expected/expected.void/error_or.md new file mode 100644 index 0000000000..e40c4ecdb6 --- /dev/null +++ b/reference/expected/expected.void/error_or.md @@ -0,0 +1,69 @@ +# error_or +* expected[meta header] +* function template[meta id-type] +* std[meta namespace] +* expected.void[meta class] +* cpp23[meta cpp] + +```cpp +// expected部分特殊化 +template constexpr T error_or(G&& e) const &; // (1) +template constexpr T error_or(G&& e) &&; // (2) +``` + +## 概要 +エラー値もしくは指定された値を取得する。 + + +## 適格要件 +- (1) : [`is_copy_constructible_v`](/reference/type_traits/is_copy_constructible.md)` == true &&` [`is_convertible_v`](/reference/type_traits/is_convertible.md)` == true` +- (2) : [`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)` == true &&` [`is_convertible_v`](/reference/type_traits/is_convertible.md)` == true` + + +## 戻り値 +- (1) : [`has_value()`](has_value.md) `?` [`std::forward`](/reference/utility/forward.md)`(e) :` [`error()`](error.md) +- (2) : [`has_value()`](has_value.md) `?` [`std::forward`](/reference/utility/forward.md)`(e) :` [`std::move`](/reference/utility/move.md)`(`[`error()`](error.md)`)` + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::expected x; + std::cout << x.error_or("-") << std::endl; + + std::expected y = std::unexpected{"ERR"}; + std::cout << y.error_or("-") << std::endl; +} +``` +* error_or[color ff0000] +* std::unexpected[link ../unexpected.md] + +### 出力 +``` +- +ERR +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.0 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`error()`](error.md) + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) diff --git a/reference/expected/expected.void/has_value.md b/reference/expected/expected.void/has_value.md new file mode 100644 index 0000000000..a75f832859 --- /dev/null +++ b/reference/expected/expected.void/has_value.md @@ -0,0 +1,65 @@ +# has_value +* expected[meta header] +* function[meta id-type] +* std[meta namespace] +* expected.void[meta class] +* cpp23[meta cpp] + +```cpp +// expected部分特殊化 +constexpr bool has_value() const noexcept; +``` + +## 概要 +正常値を保持しているかを判定する。 + + +## 戻り値 +正常値を保持しているなら`true`を返し、エラー値を保持しているなら`false`を返す。 + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::expected x; + std::cout << x.has_value() << std::endl; + + std::expected y = std::unexpected{42}; + std::cout << y.has_value() << std::endl; +} +``` +* has_value[color ff0000] +* std::unexpected[link ../unexpected.md] + +### 出力 +``` +1 +0 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`operator bool`](op_bool.md) + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) diff --git a/reference/expected/expected.void/op_assign.md b/reference/expected/expected.void/op_assign.md new file mode 100644 index 0000000000..5b49a231f4 --- /dev/null +++ b/reference/expected/expected.void/op_assign.md @@ -0,0 +1,171 @@ +# operator= +* expected[meta header] +* function[meta id-type] +* std[meta namespace] +* expected.void[meta class] +* cpp23[meta cpp] + +```cpp +// expected部分特殊化 +constexpr expected& operator=(const expected& rhs); // (1) + +constexpr expected& operator=(expected&& rhs) noexcept(see below); // (2) + +template +constexpr expected& operator=(const unexpected& e); // (3) + +template +constexpr expected& operator=(unexpected&& e); // (4) +``` +* see below[italic] +* unexpected[link ../unexpected.md] + +## 概要 +- (1) : コピー代入。 +- (2) : ムーブ代入。 +- (3) : 変換可能な[`unexpected`](../unexpected.md)オブジェクトから、エラー値としてコピー代入。 +- (4) : 変換可能な[`unexpected`](../unexpected.md)オブジェクトから、エラー値としてムーブ代入。 + + +動作説明用の`expected`クラスメンバ変数として、下記を導入する。 + +- `unex` : `E`型のエラー値。 +- `has_val` : `bool`型のフラグ変数。正常値を保持する場合は`true`に、エラー値を保持する場合は`false`となる。 + + +## テンプレートパラメータ制約 +- (3) : 次の制約を全て満たすこと + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true` + - [`is_assignable_v`](/reference/type_traits/is_assignable.md)` == true` +- (4) : 次の制約を全て満たすこと + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true` + - [`is_assignable_v`](/reference/type_traits/is_assignable.md)` == true` + + +## 効果 +- (1) : 次の処理と等価 + - `this`と`rhs`が共に正常値を保持していたら、なにもしない + - `this`が正常値を保持し、`rhs`がエラー値を保持していたら、[`construct_at`](/reference/memory/construct_at.md)`(`[`addressof`](/reference/memory/addressof.md)`(unex), rhs.unex); has_value = false;` + - `this`がエラーを保持し、`rhs`が正常値を保持していたら、`unex`を破棄し`has_value = true;` + - `this`と`rhs`が共にエラー値を保持していたら、`unex = rhs.`[`error()`](error.md) +- (2) : 次の処理と等価 + - `this`と`rhs`が共に正常値を保持していたら、なにもしない + - `this`が正常値を保持し、`rhs`がエラー値を保持していたら、[`construct_at`](/reference/memory/construct_at.md)`(`[`addressof`](/reference/memory/addressof.md)`(unex),` [`std::move`](/reference/utility/move.md)`(rhs.unex)); has_value = false;` + - `this`がエラーを保持し、`rhs`が正常値を保持していたら、`unex`を破棄し`has_value = true;` + - `this`と`rhs`が共にエラー値を保持していたら、`unex =` [`std::move`](/reference/utility/move.md)`(rhs.`[`error()`](error.md)`)` +- (3) : 次の処理と等価 + - `this`が正常値を保持していたら、[`construct_at`](/reference/memory/construct_at.md)`(`[`addressof`](/reference/memory/addressof.md)`(unex), val,` [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md.nolink)`)); +has_val = false;` + - `this`がエラー値を保持していたら、`unex =` [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md.nolink)`);` +- (4) : 次の処理と等価 + - `this`が正常値を保持していたら、[`construct_at`](/reference/memory/construct_at.md)`(`[`addressof`](/reference/memory/addressof.md)`(unex), val,` [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md.nolink)`)); +has_val = false;` + - `this`がエラー値を保持していたら、`unex =` [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md.nolink)`);` + + +## 戻り値 +`*this` + + +## 例外 +- (2) : ムーブ代入演算子のnoexcept例外指定は、次の式に従う + [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)` &&` [`is_nothrow_move_assignable_v`](/reference/type_traits/is_nothrow_move_assignable.md)`` + + +## delete定義される条件 +- (1) : 下記いずれか1つでも満たされないとき、コピー代入演算子はdelete定義される。 + - [`is_copy_assignable_v`](/reference/type_traits/is_copy_assignable.md)` == true` + - [`is_copy_constructible_v`](/reference/type_traits/is_copy_constructible.md)` == true` + + +## 例 +```cpp example +#include +#include +#include +#include +#include +#include + +// std::pair型から2要素std::tuple型へはコピー代入可能 +using IntPair = std::pair; +using IntTuple = std::tuple; + +// std::unique_ptr型からstd::shared_ptr型へはムーブ代入可能 +using UniquePtr = std::unique_ptr; +using SharedPtr = std::shared_ptr; + +int main() +{ + // (1) コピー代入 + { + std::expected srcV; + std::expected dstV; + dstV = srcV; + assert(srcV.has_value() && dstV.has_value()); + + std::expected srcE = std::unexpected{42}; + std::expected dstE; + dstE = srcE; + assert(!srcE.has_value() && !dstE.has_value()); + assert(srcE.error() == 42 && dstE.error() == 42); + } + + // (2) ムーブ代入 + { + std::expected srcV; + std::expected dstV; + dstV = std::move(srcV); + assert(srcV.has_value() && dstV.has_value()); + + std::expected srcE = std::unexpected{"Oops"}; + std::expected dstE; + dstE = std::move(srcE); + assert(!srcE.has_value() && !dstE.has_value()); + assert(dstE.error() == "Oops"); + // srcE.error()はstd::stringムーブ後の未規定の値 + } + + // (3) エラー値の変換コピー代入 + { + std::unexpected src{IntPair{1, 2}}; + std::expected dst; + dst = src; + assert(not dst.has_value()); + assert((dst.error() == IntTuple{1, 2})); + } + + // (4) エラー値の変換ムーブ代入 + { + std::unexpected src{std::make_unique(42)}; + std::expected dst; + dst = std::move(src); + assert(not dst.has_value()); + assert(*dst.error() == 42); + } +} +``` +* has_value[link has_value.md] +* value[link value.md] +* error[link error.md] +* std::unexpected[link ../unexpected.md] +* std::make_unique[link /reference/memory/make_unique.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) diff --git a/reference/expected/expected.void/op_bool.md b/reference/expected/expected.void/op_bool.md new file mode 100644 index 0000000000..0e30c76dd4 --- /dev/null +++ b/reference/expected/expected.void/op_bool.md @@ -0,0 +1,75 @@ +# operator bool +* expected[meta header] +* function[meta id-type] +* std[meta namespace] +* expected.void[meta class] +* cpp23[meta cpp] + +```cpp +// expected部分特殊化 +constexpr explicit operator bool() const noexcept; +``` + +## 概要 +正常値を保持しているかを判定する。 + + +## 戻り値 +正常値を保持しているなら`true`を返し、エラー値を保持しているなら`false`を返す。 + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::expected x; + if (x) { + std::cout << "has_value" << std::endl; + } else { + std::cout << "unex=" << x.error() << std::endl; + } + + std::expected y = std::unexpected{42}; + if (y) { + std::cout << "has_value" << std::endl; + } else { + std::cout << "unex=" << y.error() << std::endl; + } +} +``` +* (x)[color ff0000] +* (y)[color ff0000] +* error()[link error.md] +* std::unexpected[link ../unexpected.md] + +### 出力 +``` +has_value +unex=42 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`has_value()`](has_value.md) + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) diff --git a/reference/expected/expected.void/op_constructor.md b/reference/expected/expected.void/op_constructor.md index 0559dcb3fd..a1e4ad4f13 100644 --- a/reference/expected/expected.void/op_constructor.md +++ b/reference/expected/expected.void/op_constructor.md @@ -71,10 +71,10 @@ constexpr explicit expected(unexpect_t, initializer_list il, Args&&... args); ## 効果 - (1) : 正常値を保持する。 -- (2) : `rhs`がエラー値を保持していれば、`rhs.`[`error()`](error.md.nolink)でエラー値を直接非リスト初期化する。 -- (3) : `rhs`がエラー値を保持していれば、[`std::move`](/reference/utility/move.md)`(rhs.`[`error()`](error.md.nolink)`)`でエラー値を直接非リスト初期化する。 -- (4) : `rhs`がエラー値を保持していれば、[`std::forward`](/reference/utility/forward.md)`(rhs.`[`error()`](error.md.nolink)`)`でエラー値を直接非リスト初期化する。 -- (5) : `rhs`がエラー値を保持していれば、[`std::forward`](/reference/utility/forward.md)`(rhs.`[`error()`](error.md.nolink)`)`でエラー値を直接非リスト初期化する。 +- (2) : `rhs`がエラー値を保持していれば、`rhs.`[`error()`](error.md)でエラー値を直接非リスト初期化する。 +- (3) : `rhs`がエラー値を保持していれば、[`std::move`](/reference/utility/move.md)`(rhs.`[`error()`](error.md)`)`でエラー値を直接非リスト初期化する。 +- (4) : `rhs`がエラー値を保持していれば、[`std::forward`](/reference/utility/forward.md)`(rhs.`[`error()`](error.md)`)`でエラー値を直接非リスト初期化する。 +- (5) : `rhs`がエラー値を保持していれば、[`std::forward`](/reference/utility/forward.md)`(rhs.`[`error()`](error.md)`)`でエラー値を直接非リスト初期化する。 - (6) : [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md.nolink)`)`でエラー値を直接非リスト初期化する。 - (7) : [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md.nolink)`)`でエラー値を直接非リスト初期化する。 - (9) : [`std::forward`](/reference/utility/forward.md)`(args)...`でエラー値を直接非リスト初期化する。 @@ -84,8 +84,8 @@ constexpr explicit expected(unexpect_t, initializer_list il, Args&&... args); ## 事後条件 - (1) : 正常値を保持している。 - (2) : `rhs`が正常値を保持する場合は`*this`も正常値を保持し、`rhs`がエラー値を保持する場合は`*this`もエラー値を保持する。 -- (3) : `rhs`が正常値を保持する場合は`*this`も正常値を保持し、`rhs`がエラー値を保持する場合は`*this`もエラー値を保持する。`rhs.`[`has_value()`](has_value.md.nolink)は変化しない。 -- (4), (5) : `rhs`が正常値を保持する場合は`*this`も正常値を保持し、`rhs`がエラー値を保持する場合は`*this`もエラー値を保持する。`rhs.`[`has_value()`](has_value.md.nolink)は変化しない。 +- (3) : `rhs`が正常値を保持する場合は`*this`も正常値を保持し、`rhs`がエラー値を保持する場合は`*this`もエラー値を保持する。`rhs.`[`has_value()`](has_value.md)は変化しない。 +- (4), (5) : `rhs`が正常値を保持する場合は`*this`も正常値を保持し、`rhs`がエラー値を保持する場合は`*this`もエラー値を保持する。`rhs.`[`has_value()`](has_value.md)は変化しない。 - (6), (7) : エラー値を保持している。 - (8) : 正常値を保持している。 - (9), (10) : エラー値を保持している。 @@ -231,9 +231,9 @@ int main() } } ``` -* has_value()[link has_value.md.nolink] -* value()[link value.md.nolink] -* error()[link error.md.nolink] +* has_value()[link has_value.md] +* value()[link value.md] +* error()[link error.md] * std::unexpected[link ../unexpected.md] * std::unexpect[link ../unexpect_t.md] * std::in_place[link /reference/utility/in_place_t.md] diff --git a/reference/expected/expected.void/op_deref.md b/reference/expected/expected.void/op_deref.md new file mode 100644 index 0000000000..429ee518fa --- /dev/null +++ b/reference/expected/expected.void/op_deref.md @@ -0,0 +1,67 @@ +# operator* +* expected[meta header] +* function[meta id-type] +* std[meta namespace] +* expected.void[meta class] +* cpp23[meta cpp] + +```cpp +// expected部分特殊化 +constexpr void operator*() const noexcept; +``` + +## 概要 +正常値(`void`)を取得する。 + + +## 事前条件 +[`has_value()`](has_value.md) `== true` + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 例 +```cpp example +#include + +int main() +{ + std::expected x; + *x; + + std::expected y = std::unexpected{42}; +//*y; + // エラー値を保持する y に対する operator* 呼び出しは未定義動作 +} +``` +* *x[color ff0000] +* std::unexpected[link ../unexpected.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`value()`](value.md) + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) diff --git a/reference/expected/expected.void/op_equal.md b/reference/expected/expected.void/op_equal.md new file mode 100644 index 0000000000..7707374e70 --- /dev/null +++ b/reference/expected/expected.void/op_equal.md @@ -0,0 +1,82 @@ +# operator== +* expected[meta header] +* function template[meta id-type] +* std[meta namespace] +* expected.void[meta class] +* cpp23[meta cpp] + +```cpp +// expected部分特殊化 +template requires is_void_v +friend constexpr bool operator==(const expected& x, const expected& y); // (1) + +template +friend constexpr bool operator==(const expected& x, const unexpected& e); // (2) +// (2)により、下記オーバーロードが使用可能になる +template +friend constexpr bool operator==(const unexpected& e, const expected& x); // (3) +``` +* is_void_v[link /reference/type_traits/is_void.md] +* unexpected[link ../unexpected.md] + +## 概要 +- (1) : `unexpected`オブジェクト同士の等値比較を行う。 +- (2), (3) : `unexpected`オブジェクトとエラー値の等値比較を行う。 + + +## 適格要件 +- (1) : 式`x.`[`error()`](error.md) `== y.`[`error()`](error.md)が適格であり、その結果を`bool`へ変換可能であること。 +- (2), (3) : 式`x.`[`error()`](error.md) `== e.`[`error()`](../unexpected/error.md.nolink)が適格であり、その結果を`bool`へ変換可能であること。 + + +## 戻り値 +- (1) : 次の値を返す + - `x.`[`has_value()`](has_value.md)と`y.`[`has_value()`](has_value.md)が異なるとき、`false` + - そうでなければ、`x.`[`has_value()`](has_value.md) `|| static_cast(x.`[`error()`](error.md) `== y.`[`error()`](error.md)`)` +- (2), (3) : `!x.`[`has_value()`](has_value.md) `&& static_cast(x.`[`error()`](error.md) `== e.`[`error()`](../unexpected/error.md.nolink)`)` + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::expected x1; + std::expected y1; + std::expected x2 = std::unexpected{1}; + std::expected y2 = std::unexpected{1}; + + // (1) + assert(x1 == y1); + assert(x2 == y2); + assert(not (x1 == y2)); + assert(not (x2 == y1)); + + // (2), (3) + assert(x2 == std::unexpected{1}); + assert(std::unexpected{1} == x2); +} +``` +* ==[color ff0000] +* std::unexpected[link ../unexpected.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) diff --git a/reference/expected/expected.void/op_not_equal.md b/reference/expected/expected.void/op_not_equal.md new file mode 100644 index 0000000000..e27d344acf --- /dev/null +++ b/reference/expected/expected.void/op_not_equal.md @@ -0,0 +1,81 @@ +# operator!= +* expected[meta header] +* function template[meta id-type] +* std[meta namespace] +* expected.void[meta class] +* cpp23[meta cpp] + +```cpp +// expected部分特殊化 +// operator==により、下記オーバーロードが使用可能になる +template requires is_void_v +friend constexpr bool operator!=(const expected& x, const expected& y); // (1) + +template +friend constexpr bool operator!=(const expected& x, const unexpected& e); // (2) +template +friend constexpr bool operator!=(const unexpected& e, const expected& x); // (3) +``` +* operator==[link op_equal.md] +* is_void_v[link /reference/type_traits/is_void.md] +* unexpected[link ../unexpected.md] + +## 概要 +- (1) : `unexpected`オブジェクト同士の非等値比較を行う。 +- (2), (3) : `unexpected`オブジェクトとエラー値の非等値比較を行う。 + + +## 適格要件 +- (1) : 式`x.`[`error()`](error.md) `== y.`[`error()`](error.md)が適格であり、その結果を`bool`へ変換可能であること。 +- (2), (3) : 式`x.`[`error()`](error.md) `== e.`[`error()`](../unexpected/error.md.nolink)が適格であり、その結果を`bool`へ変換可能であること。 + + +## 戻り値 +- (1) : `!`[`(x == y)`](op_equal.md) +- (2), (3) : `!`[`(x == e)`](op_equal.md) + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::expected x1; + std::expected y1; + std::expected x2 = std::unexpected{1}; + std::expected y2 = std::unexpected{100}; + + // (1) + assert(not (x1 != y1)); + assert(x2 != y2); + assert(x1 != y2); + assert(x2 != y1); + + // (2), (3) + assert(x2 != std::unexpected{2}); + assert(std::unexpected{2} != x2); +} +``` +* !=[color ff0000] +* std::unexpected[link ../unexpected.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) diff --git a/reference/expected/expected.void/or_else.md b/reference/expected/expected.void/or_else.md new file mode 100644 index 0000000000..6b73a22c28 --- /dev/null +++ b/reference/expected/expected.void/or_else.md @@ -0,0 +1,130 @@ +# or_else +* expected[meta header] +* function template[meta id-type] +* std[meta namespace] +* expected.void[meta class] +* cpp23[meta cpp] + +```cpp +// expected部分特殊化 +template constexpr auto or_else(F&& f) &; // (1) +template constexpr auto or_else(F&& f) const &; // (2) +template constexpr auto or_else(F&& f) &&; // (3) +template constexpr auto or_else(F&& f) const &&; // (4) +``` + +## 概要 +エラー値を保持していれば、エラー値に対して`f`を適用した結果を`expected`として返す。 +正常値を保持していれば、そのまま返す。 + +実際には複数オーバーロードが提供されるが、大まかには下記シグニチャのようにみなせる。 +`or_else`へは、引数リストに1個の`E`型をとり`std::expected`型を返す関数や関数オブジェクトを与える。 + +```cpp +template +class expected { + template + std::expected or_else(function(E)> func); +}; +``` +* function[link /reference/functional/function.md] + + +## 適格要件 +- (1), (2) : 型`G`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`>`としたとき、次を全て満たすこと + - `G`が`expected`の特殊化である + - [`is_same_v`](/reference/type_traits/is_same.md)` == true` +- (3), (4) : 型`G`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`>`としたとき、次を全て満たすこと + - `G`が`expected`の特殊化である + - [`is_same_v`](/reference/type_traits/is_same.md)` == true` + + +## 効果 +- (1), (2) : 次の処理と等価 + ```cpp + if (has_value()) + return G(); + else + return invoke(std::forward(f), error()); + ``` + * has_value()[link has_value.md] + * error()[link error.md] + * invoke[link /reference/functional/invoke.md] + * in_place[link /reference/utility/in_place_t.md] + * std::forward[link /reference/utility/forward.md] + +- (3), (4) : 次の処理と等価 + ```cpp + if (has_value()) + return G(); + else + return invoke(std::forward(f), std::move(error())); + ``` + * has_value()[link has_value.md] + * error()[link error.md] + * invoke[link /reference/functional/invoke.md] + * in_place[link /reference/utility/in_place_t.md] + * std::forward[link /reference/utility/forward.md] + * std::move[link /reference/utility/move.md] + + +## 備考 +`or_else`は、メソッドチェーンをサポートするモナド風(monadic)操作として導入された。 + + +## 例 +```cpp example +#include +#include +#include + +std::expected validate(int code) +{ + if (0 <= code) { + return {}; + } else { + return std::unexpected{"bad code"}; + } +} + +int main() +{ + std::expected v1; + assert(v1.or_else(validate).has_value()); + + std::expected e1 = std::unexpected{42}; + assert(e1.or_else(validate).has_value()); + + std::expected e2 = std::unexpected{-100}; + assert(e2.or_else(validate).error() == "bad code"); +} +``` +* or_else[color ff0000] +* has_value()[link has_value.md] +* error()[link error.md] +* std::unexpected[link ../unexpected.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.0 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`and_then()`](and_then.md) +- [`transform()`](transform.md) +- [`transform_error()`](transform_error.md) + + +## 参照 +- [P2505R5 Monadic Functions for `std::expected`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2505r5.html) diff --git a/reference/expected/expected.void/swap.md b/reference/expected/expected.void/swap.md new file mode 100644 index 0000000000..4a50254754 --- /dev/null +++ b/reference/expected/expected.void/swap.md @@ -0,0 +1,98 @@ +# swap +* expected[meta header] +* function[meta id-type] +* std[meta namespace] +* expected.void[meta class] +* cpp23[meta cpp] + +```cpp +// expected部分特殊化 +constexpr void swap(expected& rhs) noexcept(see below); +``` +* see below[italic] + +## 概要 +他の`expected`オブジェクトとデータを入れ替える。 + +動作説明用の`expected`クラスメンバ変数として、下記を導入する。 + +- `unex` : `E`型のエラー値。 +- `has_val` : `bool`型のフラグ変数。正常値を保持する場合は`true`に、エラー値を保持する場合は`false`となる。 + + +## テンプレートパラメータ制約 +次の制約を全て満たすこと + +- [`is_swappable_v`](/reference/type_traits/is_swappable.md)` == true` +- [`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)` == true` + + +## 効果 +`*this`と`rhs`それぞれが正常値/エラー値いずれを保持しているかに応じて、以下の効果を持つ。 + +- `*this`と`rhs`ともに正常値を保持していれば、なにもしない +- `*this`と`rhs`ともにエラー値を保持していれば、次と等価 : `using` [`std::swap`](/reference/utility/swap.md)`; swap(unex, rhs.unex);` +- `*this`がエラー値を`rhs`が正常値を保持していれば、次と等価 : `rhs.swap(*this);` +- `*this`が正常値を`rhs`がエラー値を保持していれば、次と等価 : + ```cpp + construct_at(addressof(unex), std::move(rhs.unex)); + destroy_at(addressof(rhs.unex)); + has_val = false; + rhs.has_val = true; + ``` + * addressof[link /reference/memory/addressof.md] + * construct_at[link /reference/memory/construct_at.md] + * destroy_at[link /reference/memory/destroy_at.md] + * std::move[link /reference/utility/move.md] + + +## 戻り値 +なし + + +## 例外 +noexcept例外指定は次の式に従う : + +[`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)` &&` [`is_nothrow_swappable_v`](/reference/type_traits/is_nothrow_swappable.md)`` + +noexcept例外指定が`false`の場合、上記の「効果」による処理からの例外がスローされる。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::expected x; + std::expected y = std::unexpected{42}; + assert(x.has_value() && y.error() == 42); + + x.swap(y); + assert(x.error() == 42 && y.has_value()); +} +``` +* swap[color ff0000] +* has_value()[link has_value.md] +* error()[link error.md] +* std::unexpected[link ../unexpected.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) diff --git a/reference/expected/expected.void/transform.md b/reference/expected/expected.void/transform.md new file mode 100644 index 0000000000..d8214747d7 --- /dev/null +++ b/reference/expected/expected.void/transform.md @@ -0,0 +1,110 @@ +# transform +* expected[meta header] +* function template[meta id-type] +* std[meta namespace] +* expected.void[meta class] +* cpp23[meta cpp] + +```cpp +// expected部分特殊化 +template constexpr auto transform(F&& f) &; // (1) +template constexpr auto transform(F&& f) const &; // (2) +template constexpr auto transform(F&& f) &&; // (3) +template constexpr auto transform(F&& f) const &&; // (4) +``` + +## 概要 +正常値を保持していれば、`f`の呼び出し結果を`expected`の正常値として格納して返す。 +エラー値を保持していれば、そのまま返す。 + +実際には複数オーバーロードが提供されるが、大まかには下記シグニチャのようにみなせる。 +`transform`へは、引数をとらず`Return`型を返す関数や関数オブジェクトを与える。 + +```cpp +template +class expected { + template + std::expected transform(function func); +}; +``` +* function[link /reference/functional/function.md] + + +## テンプレートパラメータ制約 +- (1), (2) : [`is_copy_constructible_v`](/reference/type_traits/is_copy_constructible.md)` == true` +- (3), (4) : [`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)` == true` + + +## 適格要件 +- (1), (2) : 型`U`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`>`としたとき、次を全て満たすこと + - `U`が`expected`の有効な正常値型である + - `U`が(CV修飾された)`void`ではないとき、宣言`U u(`[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f)));`が妥当である +- (3), (4) : 型`U`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`>`としたとき、次を全て満たすこと + - `U`が`expected`の有効な正常値型である + - `U`が(CV修飾された)`void`ではないとき、宣言`U u(`[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f)));`が妥当である + + +## 効果 +- (1), (2) : 次の効果をもつ + - エラー値を保持していたら、`expected(`[`unexpect`](../unexpect_t.md)`,` [`error()`](error.md)`)`を返す。 + - 型`U`が(CV修飾された)`void`でなければ、正常値を[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f))`で非直接リスト初期化した`expected`オブジェクトを返す。 + - そうでなければ、[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f))`を評価し、`expected()`を返す。 +- (3), (4) : 次の効果をもつ + - エラー値を保持していたら、`expected(`[`unexpect`](../unexpect_t.md)`,` [`std::move`](/reference/utility/move.md)`(`[`error()`](error.md)`))`を返す。 + - 型`U`が(CV修飾された)`void`でなければ、正常値を[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f))`で非直接リスト初期化した`expected`オブジェクトを返す。 + - そうでなければ、[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f))`を評価し、`expected()`を返す。 + + +## 備考 +`transform`は、メソッドチェーンをサポートするモナド風(monadic)操作として導入された。 + + +## 例 +```cpp example +#include +#include +#include + +int get_answer() +{ + return 42; +} + +int main() +{ + std::expected v1; + assert(v1.transform(get_answer).value() == 42); + + std::expected e1 = std::unexpected{"galaxy"}; + assert(e1.transform(get_answer).error() == "galaxy"); +} +``` +* transform[color ff0000] +* value()[link value.md] +* error()[link error.md] +* std::unexpected[link ../unexpected.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.0 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`and_then()`](and_then.md) +- [`or_else()`](or_else.md) +- [`transform_error()`](transform_error.md) + + +## 参照 +- [P2505R5 Monadic Functions for `std::expected`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2505r5.html) diff --git a/reference/expected/expected.void/transform_error.md b/reference/expected/expected.void/transform_error.md new file mode 100644 index 0000000000..07369cab16 --- /dev/null +++ b/reference/expected/expected.void/transform_error.md @@ -0,0 +1,104 @@ +# transform_error +* expected[meta header] +* function template[meta id-type] +* std[meta namespace] +* expected.void[meta class] +* cpp23[meta cpp] + +```cpp +// expected部分特殊化 +template constexpr auto transform_error(F&& f) &; // (1) +template constexpr auto transform_error(F&& f) const &; // (2) +template constexpr auto transform_error(F&& f) &&; // (3) +template constexpr auto transform_error(F&& f) const &&; // (4) +``` + +## 概要 +エラー値を保持していれば、エラー値に対して`f`を適用した結果を`expected`のエラー値として格納して返す。 +正常値を保持していれば、そのまま返す。 + +実際には複数オーバーロードが提供されるが、大まかには下記シグニチャのようにみなせる。 +`transform_error`へは、引数リストに1個の`E`型をとり`Return`型を返す関数や関数オブジェクトを与える。 + +```cpp +template +class expected { + template + std::expected transform_error(function func); +}; +``` +* function[link /reference/functional/function.md] + + +## 適格要件 +- (1), (2) : 型`G`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`>`としたとき、次を全て満たすこと + - `G`が`expected`の有効なエラー値型である + - 宣言`G g(`[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`error()`](error.md)`));`が妥当である +- (3), (4) : 型`G`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`>`としたとき、次を全て満たすこと + - `G`が`expected`の有効なエラー値型である + - 宣言`G g(`[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`std::move`](/reference/utility/move.md)`(`[`error()`](error.md)`)));`が妥当である + + +## 効果 +- (1), (2) : 次の効果をもつ + - 正常値を保持していたら、`expected()`を返す。 + - そうでなければ、エラー値を[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`error()`](error.md)`)`で非直接リスト初期化した`expected`オブジェクトを返す。 +- (3), (4) : 次の効果をもつ + - 正常値を保持していたら、`expected()`を返す。 + - そうでなければ、エラー値を[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`std::move`](/reference/utility/move.md)`(`[`error()`](error.md)`))`で非直接リスト初期化した`expected`オブジェクトを返す。 + + +## 備考 +`transform_error`は、メソッドチェーンをサポートするモナド風(monadic)操作として導入された。 + + +## 例 +```cpp example +#include +#include +#include +#include + +std::string int2str(int n) +{ + return std::format("({})", n); +} + +int main() +{ + std::expected v1; + assert(v1.transform_error(int2str).has_value()); + + std::expected e1 = std::unexpected{42}; + assert(e1.transform_error(int2str).error() == "(42)"); +} +``` +* transform_error[color ff0000] +* has_value()[link has_value.md] +* error()[link error.md] +* std::unexpected[link ../unexpected.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.0 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`and_then()`](and_then.md) +- [`or_else()`](or_else.md) +- [`transform()`](transform.md) + + +## 参照 +- [P2505R5 Monadic Functions for `std::expected`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2505r5.html) diff --git a/reference/expected/expected.void/value.md b/reference/expected/expected.void/value.md new file mode 100644 index 0000000000..ba7a593f77 --- /dev/null +++ b/reference/expected/expected.void/value.md @@ -0,0 +1,72 @@ +# value +* expected[meta header] +* function[meta id-type] +* std[meta namespace] +* expected.void[meta class] +* cpp23[meta cpp] + +```cpp +// expected部分特殊化 +constexpr void value() const &; // (1) +constexpr void value() &&; // (2) +``` + +## 概要 +正常値(`void`)を取得する。 + + +## 戻り値 +なし + + +## 例外 +- (1) : エラー値を保持していたら、例外[`bad_expected_access`](../bad_expected_access.md)`(`[`error()`](error.md)`)`をスローする +- (2) : エラー値を保持していたら、例外[`bad_expected_access`](../bad_expected_access.md)`(`[`std::move`](/reference/utility/move.md)`(`[`error()`](error.md)`))`をスローする + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::expected x; + x.value(); + + std::expected y = std::unexpected{42}; + try { + y.value(); + } catch (const std::bad_expected_access& ex) { + std::cout << "throw:" << ex.error() << std::endl; + } +} +``` +* value()[color ff0000] +* error()[link ../unexpected/error.md.nolink] +* std::unexpected[link ../unexpected.md] +* std::bad_expected_access[link ../bad_expected_access.md] + +### 出力 +``` +throw:42 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`operator*`](op_deref.md) + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) diff --git a/reference/expected/expected/emplace.md b/reference/expected/expected/emplace.md index 2faa79e859..31871cd0a4 100644 --- a/reference/expected/expected/emplace.md +++ b/reference/expected/expected/emplace.md @@ -15,8 +15,8 @@ constexpr T& emplace(initializer_list il, Args&&... args) noexcept; // (2) * initializer_list[link /reference/initializer_list/initializer_list.md] ## 概要 -- (1) : 正常値型`T`のコンストラクタ引数として任意個の引数を受け取って、型`T`のオブジェクトを有効値として生成し、保持する。 -- (2) : 正常値型`T`のコンストラクタ引数として初期化子リストと任意個の引数を受け取って、型`T`のオブジェクトを有効値として生成し、保持する。 +- (1) : 正常値型`T`のコンストラクタ引数として任意個の引数を受け取って、型`T`のオブジェクトを正常値として生成し、保持する。 +- (2) : 正常値型`T`のコンストラクタ引数として初期化子リストと任意個の引数を受け取って、型`T`のオブジェクトを正常値として生成し、保持する。 動作説明用の`expected`クラスメンバ変数として、下記を導入する。 diff --git a/reference/expected/expected/op_assign.md b/reference/expected/expected/op_assign.md index d9763a4b9f..a2094bc79e 100644 --- a/reference/expected/expected/op_assign.md +++ b/reference/expected/expected/op_assign.md @@ -102,7 +102,7 @@ constexpr void reinit-expected(T& newval, U& oldval, Args&&... args) { - `this`と`rhs`が共に正常値を保持していたら、`val =` [`std::move`](/reference/utility/move.md)`(`[`*rhs`](op_deref.md)`)` - `this`が正常値を保持し、`rhs`がエラー値を保持していたら、`reinit-expected(unex, val,` [`std::move`](/reference/utility/move.md)`(rhs.`[`error()`](error.md)`))` - `this`がエラーを保持し、`rhs`が正常値を保持していたら、`reinit-expected(val, unex,` [`std::move`](/reference/utility/move.md)`(`[`*rhs`](op_deref.md)`))` - - `this`と`rhs`が共にエラー値を保持していたら、`unex` [`std::move`](/reference/utility/move.md)`(rhs.`[`error()`](error.md)`)` + - `this`と`rhs`が共にエラー値を保持していたら、`unex =` [`std::move`](/reference/utility/move.md)`(rhs.`[`error()`](error.md)`)` - (3) : 次の処理と等価 - `this`が正常値を保持していたら、`val =` [`std::forward`](/reference/utility/forward.md)`(v)` - `this`がエラー値を保持していたら、`reinit-expected(val, unex,` [`std::forward`](/reference/utility/forward.md)`(v)); has_val = true;` diff --git a/reference/expected/expected/op_bool.md b/reference/expected/expected/op_bool.md index 684f32e4b8..e7cee7513b 100644 --- a/reference/expected/expected/op_bool.md +++ b/reference/expected/expected/op_bool.md @@ -70,7 +70,7 @@ unex=42 ## 関連項目 -- [`operator bool`](op_bool.md) +- [`has_value()`](has_value.md) ## 参照 diff --git a/reference/expected/expected/or_else.md b/reference/expected/expected/or_else.md index 8c7b08d780..bd4680b7b3 100644 --- a/reference/expected/expected/or_else.md +++ b/reference/expected/expected/or_else.md @@ -35,10 +35,10 @@ class expected { ## 適格要件 -- (1), (2) : 型`G`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`>`としたとき、次を全て満たすこと +- (1), (2) : 型`G`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`>`としたとき、次を全て満たすこと - `G`が`expected`の特殊化である - [`is_same_v`](/reference/type_traits/is_same.md)` == true` -- (3), (4) : 型`G`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`>`としたとき、次を全て満たすこと +- (3), (4) : 型`G`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`>`としたとき、次を全て満たすこと - `G`が`expected`の特殊化である - [`is_same_v`](/reference/type_traits/is_same.md)` == true` diff --git a/reference/expected/expected/swap.md b/reference/expected/expected/swap.md index 8df15366e6..ac5f63df26 100644 --- a/reference/expected/expected/swap.md +++ b/reference/expected/expected/swap.md @@ -105,8 +105,6 @@ int main() ### 出力 ``` -42 -0 ``` @@ -121,11 +119,5 @@ int main() - [Visual C++](/implementation.md#visual_cpp): ?? -## 関連項目 -- [`operator->`](op_arrow.md) -- [`operator*`](op_deref.md) -- [`value()`](value.md) - - ## 参照 - [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) diff --git a/reference/expected/expected/transform_error.md b/reference/expected/expected/transform_error.md index 100e135d13..e9edfd948f 100644 --- a/reference/expected/expected/transform_error.md +++ b/reference/expected/expected/transform_error.md @@ -46,10 +46,10 @@ class expected { ## 効果 - (1), (2) : 次の効果をもつ - 正常値を保持していたら、`expected(`[`in_place`](/reference/utility/in_place_t.md)`,` [`value()`](value.md)`)`を返す。 - - エラー値を[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`error()`](error.md)`)`で非直接リスト初期化した`expected`オブジェクトを返す。 + - そうでなければ、エラー値を[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`error()`](error.md)`)`で非直接リスト初期化した`expected`オブジェクトを返す。 - (3), (4) : 次の効果をもつ - 正常値を保持していたら、`expected(`[`in_place`](/reference/utility/in_place_t.md)`,` [`std::move`](/reference/utility/move.md)`(`[`value()`](value.md)`))`を返す。 - - エラー値を[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`std::move`](/reference/utility/move.md)`(`[`error()`](error.md)`))`で非直接リスト初期化した`expected`オブジェクトを返す。 + - そうでなければ、エラー値を[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`std::move`](/reference/utility/move.md)`(`[`error()`](error.md)`))`で非直接リスト初期化した`expected`オブジェクトを返す。 ## 備考 From 31bdb1a09601084f8113969e64a899383cc8e142 Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 9 Feb 2023 16:27:43 +0900 Subject: [PATCH 0170/3948] =?UTF-8?q?expected/expected:=20swap=E9=9D=9E?= =?UTF-8?q?=E3=83=A1=E3=83=B3=E3=83=90=E9=96=A2=E6=95=B0(#1066)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/expected/expected.md | 8 +++ reference/expected/expected.void/swap_free.md | 67 +++++++++++++++++++ reference/expected/expected/swap_free.md | 67 +++++++++++++++++++ 3 files changed, 142 insertions(+) create mode 100644 reference/expected/expected.void/swap_free.md create mode 100644 reference/expected/expected/swap_free.md diff --git a/reference/expected/expected.md b/reference/expected/expected.md index 94ecaf8a84..8e39403981 100644 --- a/reference/expected/expected.md +++ b/reference/expected/expected.md @@ -130,6 +130,14 @@ namespace std { | `template rebind` | `expected` | C++23 | +## 非メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|-------| +| [`swap`](expected/swap_free.md) | 2つの`expected`オブジェクトを入れ替える | C++23 | +| [`swap`](expected.void/swap_free.md) | 2つの`expected`オブジェクトを入れ替える | C++23 | + + ## 例 ```cpp example #include diff --git a/reference/expected/expected.void/swap_free.md b/reference/expected/expected.void/swap_free.md new file mode 100644 index 0000000000..02b0d13757 --- /dev/null +++ b/reference/expected/expected.void/swap_free.md @@ -0,0 +1,67 @@ +# swap (非メンバ関数) +* expected[meta header] +* function[meta id-type] +* std[meta namespace] +* expected.void[meta class] +* cpp23[meta cpp] + +```cpp +// expected部分特殊化 +friend constexpr void swap(expected& x, expected& y) + noexcept(noexcept(x.swap(y))); +``` +* swap[link swap.md] + +## 概要 +2つの`expected`オブジェクトを入れ替える。 + + +## 効果 +```cpp +x.swap(y); +``` +* swap[link swap.md] + + +## 戻り値 +なし + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::expected x; + std::expected y = std::unexpected{42}; + assert(x.has_value() && y.error() == 42); + + std::swap(x, y); + assert(x.error() == 42 && y.has_value()); +} +``` +* std::swap[color ff0000] +* has_value()[link has_value.md] +* error()[link error.md] +* std::unexpected[link ../unexpected.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) diff --git a/reference/expected/expected/swap_free.md b/reference/expected/expected/swap_free.md new file mode 100644 index 0000000000..634e59c339 --- /dev/null +++ b/reference/expected/expected/swap_free.md @@ -0,0 +1,67 @@ +# swap (非メンバ関数) +* expected[meta header] +* function[meta id-type] +* std[meta namespace] +* expected[meta class] +* cpp23[meta cpp] + +```cpp +friend constexpr void swap(expected& x, expected& y) + noexcept(noexcept(x.swap(y))); +``` +* swap[link swap.md] + +## 概要 +2つの`expected`オブジェクトを入れ替える。 + + +## 効果 +```cpp +x.swap(y); +``` +* swap[link swap.md] + + +## 戻り値 +なし + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::expected x = 42; + std::expected y = std::unexpected{"ERR"}; + assert(x.value() == 42 && y.error() == "ERR"); + + std::swap(x, y); + assert(x.error() == "ERR" && y.value() == 42); +} +``` +* std::swap[color ff0000] +* value()[link value.md] +* error()[link error.md] +* std::unexpected[link ../unexpected.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) From a69e754d6d013d030e477d95ed5bdc1432ea46e6 Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 9 Feb 2023 18:45:03 +0900 Subject: [PATCH 0171/3948] expected: unexpected(#1066) --- reference/exception/unexpected.md | 3 + reference/expected/expected.void/op_assign.md | 8 +- .../expected/expected.void/op_constructor.md | 4 +- reference/expected/expected.void/op_equal.md | 8 +- .../expected/expected.void/op_not_equal.md | 6 +- reference/expected/expected.void/swap_free.md | 2 +- reference/expected/expected.void/value.md | 2 +- reference/expected/expected/op_assign.md | 8 +- reference/expected/expected/op_constructor.md | 4 +- reference/expected/expected/op_equal.md | 10 +- reference/expected/expected/op_not_equal.md | 8 +- reference/expected/expected/swap_free.md | 2 +- reference/expected/expected/value.md | 2 +- reference/expected/unexpected.md | 21 +-- reference/expected/unexpected/error.md | 65 ++++++++ .../expected/unexpected/op_constructor.md | 146 ++++++++++++++++++ .../expected/unexpected/op_deduction_guide.md | 51 ++++++ reference/expected/unexpected/op_equal.md | 58 +++++++ reference/expected/unexpected/op_not_equal.md | 60 +++++++ reference/expected/unexpected/swap.md | 73 +++++++++ reference/expected/unexpected/swap_free.md | 65 ++++++++ 21 files changed, 564 insertions(+), 42 deletions(-) create mode 100644 reference/expected/unexpected/error.md create mode 100644 reference/expected/unexpected/op_constructor.md create mode 100644 reference/expected/unexpected/op_deduction_guide.md create mode 100644 reference/expected/unexpected/op_equal.md create mode 100644 reference/expected/unexpected/op_not_equal.md create mode 100644 reference/expected/unexpected/swap.md create mode 100644 reference/expected/unexpected/swap_free.md diff --git a/reference/exception/unexpected.md b/reference/exception/unexpected.md index ab200e8400..8564476e8f 100644 --- a/reference/exception/unexpected.md +++ b/reference/exception/unexpected.md @@ -13,6 +13,9 @@ namespace std { この関数はC++11から非推奨となり、C++17で削除された。`throw`キーワードの代わりに使用する[`noexcept`キーワード](/lang/cpp11/noexcept.md)では、指定外の例外が発生することによるエラーは起こらない。 +C++23から、同名の[`std::unexpected`クラステンプレート](/reference/expected/unexpected.md)が追加される。C++17で削除された名前の再利用となっているが、この関数と同クラステンプレートの間に機能的な関係は一切ない。 + + ## 概要 例外指定のある関数内で、指定外の例外が発生した時に呼び出される例外ハンドラを直接呼び出す。 diff --git a/reference/expected/expected.void/op_assign.md b/reference/expected/expected.void/op_assign.md index 5b49a231f4..e62f9f5ef2 100644 --- a/reference/expected/expected.void/op_assign.md +++ b/reference/expected/expected.void/op_assign.md @@ -54,13 +54,13 @@ constexpr expected& operator=(unexpected&& e); // (4) - `this`がエラーを保持し、`rhs`が正常値を保持していたら、`unex`を破棄し`has_value = true;` - `this`と`rhs`が共にエラー値を保持していたら、`unex =` [`std::move`](/reference/utility/move.md)`(rhs.`[`error()`](error.md)`)` - (3) : 次の処理と等価 - - `this`が正常値を保持していたら、[`construct_at`](/reference/memory/construct_at.md)`(`[`addressof`](/reference/memory/addressof.md)`(unex), val,` [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md.nolink)`)); + - `this`が正常値を保持していたら、[`construct_at`](/reference/memory/construct_at.md)`(`[`addressof`](/reference/memory/addressof.md)`(unex), val,` [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md)`)); has_val = false;` - - `this`がエラー値を保持していたら、`unex =` [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md.nolink)`);` + - `this`がエラー値を保持していたら、`unex =` [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md)`);` - (4) : 次の処理と等価 - - `this`が正常値を保持していたら、[`construct_at`](/reference/memory/construct_at.md)`(`[`addressof`](/reference/memory/addressof.md)`(unex), val,` [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md.nolink)`)); + - `this`が正常値を保持していたら、[`construct_at`](/reference/memory/construct_at.md)`(`[`addressof`](/reference/memory/addressof.md)`(unex), val,` [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md)`)); has_val = false;` - - `this`がエラー値を保持していたら、`unex =` [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md.nolink)`);` + - `this`がエラー値を保持していたら、`unex =` [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md)`);` ## 戻り値 diff --git a/reference/expected/expected.void/op_constructor.md b/reference/expected/expected.void/op_constructor.md index a1e4ad4f13..25fe4b7996 100644 --- a/reference/expected/expected.void/op_constructor.md +++ b/reference/expected/expected.void/op_constructor.md @@ -75,8 +75,8 @@ constexpr explicit expected(unexpect_t, initializer_list il, Args&&... args); - (3) : `rhs`がエラー値を保持していれば、[`std::move`](/reference/utility/move.md)`(rhs.`[`error()`](error.md)`)`でエラー値を直接非リスト初期化する。 - (4) : `rhs`がエラー値を保持していれば、[`std::forward`](/reference/utility/forward.md)`(rhs.`[`error()`](error.md)`)`でエラー値を直接非リスト初期化する。 - (5) : `rhs`がエラー値を保持していれば、[`std::forward`](/reference/utility/forward.md)`(rhs.`[`error()`](error.md)`)`でエラー値を直接非リスト初期化する。 -- (6) : [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md.nolink)`)`でエラー値を直接非リスト初期化する。 -- (7) : [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md.nolink)`)`でエラー値を直接非リスト初期化する。 +- (6) : [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md)`)`でエラー値を直接非リスト初期化する。 +- (7) : [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md)`)`でエラー値を直接非リスト初期化する。 - (9) : [`std::forward`](/reference/utility/forward.md)`(args)...`でエラー値を直接非リスト初期化する。 - (10) : `il,` [`std::forward`](/reference/utility/forward.md)`(args)...`でエラー値を直接非リスト初期化する。 diff --git a/reference/expected/expected.void/op_equal.md b/reference/expected/expected.void/op_equal.md index 7707374e70..62e228e97f 100644 --- a/reference/expected/expected.void/op_equal.md +++ b/reference/expected/expected.void/op_equal.md @@ -20,20 +20,20 @@ friend constexpr bool operator==(const unexpected& e, const expected& x); * unexpected[link ../unexpected.md] ## 概要 -- (1) : `unexpected`オブジェクト同士の等値比較を行う。 -- (2), (3) : `unexpected`オブジェクトとエラー値の等値比較を行う。 +- (1) : `expected`オブジェクト同士の等値比較を行う。 +- (2), (3) : `expected`オブジェクトとエラー値の等値比較を行う。 ## 適格要件 - (1) : 式`x.`[`error()`](error.md) `== y.`[`error()`](error.md)が適格であり、その結果を`bool`へ変換可能であること。 -- (2), (3) : 式`x.`[`error()`](error.md) `== e.`[`error()`](../unexpected/error.md.nolink)が適格であり、その結果を`bool`へ変換可能であること。 +- (2), (3) : 式`x.`[`error()`](error.md) `== e.`[`error()`](../unexpected/error.md)が適格であり、その結果を`bool`へ変換可能であること。 ## 戻り値 - (1) : 次の値を返す - `x.`[`has_value()`](has_value.md)と`y.`[`has_value()`](has_value.md)が異なるとき、`false` - そうでなければ、`x.`[`has_value()`](has_value.md) `|| static_cast(x.`[`error()`](error.md) `== y.`[`error()`](error.md)`)` -- (2), (3) : `!x.`[`has_value()`](has_value.md) `&& static_cast(x.`[`error()`](error.md) `== e.`[`error()`](../unexpected/error.md.nolink)`)` +- (2), (3) : `!x.`[`has_value()`](has_value.md) `&& static_cast(x.`[`error()`](error.md) `== e.`[`error()`](../unexpected/error.md)`)` ## 例 diff --git a/reference/expected/expected.void/op_not_equal.md b/reference/expected/expected.void/op_not_equal.md index e27d344acf..dd282393cf 100644 --- a/reference/expected/expected.void/op_not_equal.md +++ b/reference/expected/expected.void/op_not_equal.md @@ -21,13 +21,13 @@ friend constexpr bool operator!=(const unexpected& e, const expected& x); * unexpected[link ../unexpected.md] ## 概要 -- (1) : `unexpected`オブジェクト同士の非等値比較を行う。 -- (2), (3) : `unexpected`オブジェクトとエラー値の非等値比較を行う。 +- (1) : `expected`オブジェクト同士の非等値比較を行う。 +- (2), (3) : `expected`オブジェクトとエラー値の非等値比較を行う。 ## 適格要件 - (1) : 式`x.`[`error()`](error.md) `== y.`[`error()`](error.md)が適格であり、その結果を`bool`へ変換可能であること。 -- (2), (3) : 式`x.`[`error()`](error.md) `== e.`[`error()`](../unexpected/error.md.nolink)が適格であり、その結果を`bool`へ変換可能であること。 +- (2), (3) : 式`x.`[`error()`](error.md) `== e.`[`error()`](../unexpected/error.md)が適格であり、その結果を`bool`へ変換可能であること。 ## 戻り値 diff --git a/reference/expected/expected.void/swap_free.md b/reference/expected/expected.void/swap_free.md index 02b0d13757..a6f7cebbec 100644 --- a/reference/expected/expected.void/swap_free.md +++ b/reference/expected/expected.void/swap_free.md @@ -10,7 +10,7 @@ friend constexpr void swap(expected& x, expected& y) noexcept(noexcept(x.swap(y))); ``` -* swap[link swap.md] +* x.swap(y)[link swap.md] ## 概要 2つの`expected`オブジェクトを入れ替える。 diff --git a/reference/expected/expected.void/value.md b/reference/expected/expected.void/value.md index ba7a593f77..45e4c49db0 100644 --- a/reference/expected/expected.void/value.md +++ b/reference/expected/expected.void/value.md @@ -43,7 +43,7 @@ int main() } ``` * value()[color ff0000] -* error()[link ../unexpected/error.md.nolink] +* error()[link ../bad_expected_access/error.md.nolink] * std::unexpected[link ../unexpected.md] * std::bad_expected_access[link ../bad_expected_access.md] diff --git a/reference/expected/expected/op_assign.md b/reference/expected/expected/op_assign.md index a2094bc79e..ba763681a0 100644 --- a/reference/expected/expected/op_assign.md +++ b/reference/expected/expected/op_assign.md @@ -107,13 +107,13 @@ constexpr void reinit-expected(T& newval, U& oldval, Args&&... args) { - `this`が正常値を保持していたら、`val =` [`std::forward`](/reference/utility/forward.md)`(v)` - `this`がエラー値を保持していたら、`reinit-expected(val, unex,` [`std::forward`](/reference/utility/forward.md)`(v)); has_val = true;` - (4) : 次の処理と等価 - - `this`が正常値を保持していたら、`reinit-expected(unex, val,` [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md.nolink)`)); + - `this`が正常値を保持していたら、`reinit-expected(unex, val,` [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md)`)); has_val = false;` - - `this`がエラー値を保持していたら、`unex =` [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md.nolink)`);` + - `this`がエラー値を保持していたら、`unex =` [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md)`);` - (5) : 次の処理と等価 - - `this`が正常値を保持していたら、`reinit-expected(unex, val,` [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md.nolink)`)); + - `this`が正常値を保持していたら、`reinit-expected(unex, val,` [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md)`)); has_val = false;` - - `this`がエラー値を保持していたら、`unex =` [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md.nolink)`);` + - `this`がエラー値を保持していたら、`unex =` [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md)`);` ## 戻り値 diff --git a/reference/expected/expected/op_constructor.md b/reference/expected/expected/op_constructor.md index 34e9931df9..650fce1543 100644 --- a/reference/expected/expected/op_constructor.md +++ b/reference/expected/expected/op_constructor.md @@ -108,8 +108,8 @@ constexpr bool converts-from-any-cvref = - (4) : `rhs`が正常値を保持していれば、[`std::forward`](/reference/utility/forward.md)`(`[`*rhs`](op_deref.md)`)`で正常値を直接非リスト初期化する。そうでなければ、[`std::forward`](/reference/utility/forward.md)`(rhs.`[`error()`](error.md)`)`でエラー値を直接非リスト初期化する。 - (5) : `rhs`が正常値を保持していれば、[`std::forward`](/reference/utility/forward.md)`(`[`*rhs`](op_deref.md)`)`で正常値を直接非リスト初期化する。そうでなければ、[`std::forward`](/reference/utility/forward.md)`(rhs.`[`error()`](error.md)`)`でエラー値を直接非リスト初期化する。 - (6) : [`std::forward`](/reference/utility/forward.md)`(v)`で正常値を直接非リスト初期化する。 -- (7) : [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md.nolink)`)`でエラー値を直接非リスト初期化する。 -- (8) : [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md.nolink)`)`でエラー値を直接非リスト初期化する。 +- (7) : [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md)`)`でエラー値を直接非リスト初期化する。 +- (8) : [`std::forward`](/reference/utility/forward.md)`(e.`[`error()`](../unexpected/error.md)`)`でエラー値を直接非リスト初期化する。 - (9) : [`std::forward`](/reference/utility/forward.md)`(args)...`で正常値を直接非リスト初期化する。 - (10) : `il,` [`std::forward`](/reference/utility/forward.md)`(args)...`で正常値を直接非リスト初期化する。 - (11) : [`std::forward`](/reference/utility/forward.md)`(args)...`でエラー値を直接非リスト初期化する。 diff --git a/reference/expected/expected/op_equal.md b/reference/expected/expected/op_equal.md index efbb187707..e9daee414e 100644 --- a/reference/expected/expected/op_equal.md +++ b/reference/expected/expected/op_equal.md @@ -25,15 +25,15 @@ friend constexpr bool operator==(const unexpected& e, const expected& x); // * unexpected[link ../unexpected.md] ## 概要 -- (1) : `unexpected`オブジェクト同士の等値比較を行う。 -- (2), (3) : `unexpected`オブジェクトと正常値の等値比較を行う。 -- (4), (5) : `unexpected`オブジェクトとエラー値の等値比較を行う。 +- (1) : `expected`オブジェクト同士の等値比較を行う。 +- (2), (3) : `expected`オブジェクトと正常値の等値比較を行う。 +- (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.nolink)が適格であり、その結果を`bool`へ変換可能であること。 +- (4), (5) : 式`x.`[`error()`](error.md) `== e.`[`error()`](../unexpected/error.md)が適格であり、その結果を`bool`へ変換可能であること。 ## 戻り値 @@ -42,7 +42,7 @@ friend constexpr bool operator==(const unexpected& e, const expected& x); // - `x.`[`has_value()`](has_value.md) `== true`のとき、[`*x`](op_deref.md) `==` [`*y`](op_deref.md) - `x.`[`error()`](error.md) `== y.`[`error()`](error.md) - (2), (3) : `x.`[`has_value()`](has_value.md) `&& static_cast(`[`*x`](op_deref.md) `== v)` -- (4), (5) : `!x.`[`has_value()`](has_value.md) `&& static_cast(x.`[`error()`](error.md) `== e.`[`error()`](../unexpected/error.md.nolink)`)` +- (4), (5) : `!x.`[`has_value()`](has_value.md) `&& static_cast(x.`[`error()`](error.md) `== e.`[`error()`](../unexpected/error.md)`)` ## 例 diff --git a/reference/expected/expected/op_not_equal.md b/reference/expected/expected/op_not_equal.md index dc9fb73701..0d64264ebd 100644 --- a/reference/expected/expected/op_not_equal.md +++ b/reference/expected/expected/op_not_equal.md @@ -25,15 +25,15 @@ friend constexpr bool operator!=(const unexpected& e, const expected& x); // * unexpected[link ../unexpected.md] ## 概要 -- (1) : `unexpected`オブジェクト同士の非等値比較を行う。 -- (2), (3) : `unexpected`オブジェクトと正常値の非等値比較を行う。 -- (4), (5) : `unexpected`オブジェクトとエラー値の非等値比較を行う。 +- (1) : `expected`オブジェクト同士の非等値比較を行う。 +- (2), (3) : `expected`オブジェクトと正常値の非等値比較を行う。 +- (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.nolink)が適格であり、その結果を`bool`へ変換可能であること。 +- (4), (5) : 式`x.`[`error()`](error.md) `== e.`[`error()`](../unexpected/error.md)が適格であり、その結果を`bool`へ変換可能であること。 ## 戻り値 diff --git a/reference/expected/expected/swap_free.md b/reference/expected/expected/swap_free.md index 634e59c339..e3772eabff 100644 --- a/reference/expected/expected/swap_free.md +++ b/reference/expected/expected/swap_free.md @@ -9,7 +9,7 @@ friend constexpr void swap(expected& x, expected& y) noexcept(noexcept(x.swap(y))); ``` -* swap[link swap.md] +* x.swap(y)[link swap.md] ## 概要 2つの`expected`オブジェクトを入れ替える。 diff --git a/reference/expected/expected/value.md b/reference/expected/expected/value.md index 8d2b2836d2..8f1f26ffca 100644 --- a/reference/expected/expected/value.md +++ b/reference/expected/expected/value.md @@ -48,7 +48,7 @@ int main() } ``` * value()[color ff0000] -* error()[link ../unexpected/error.md.nolink] +* error()[link ../bad_expected_access/error.md.nolink] * std::unexpected[link ../unexpected.md] * std::bad_expected_access[link ../bad_expected_access.md] diff --git a/reference/expected/unexpected.md b/reference/expected/unexpected.md index 5b82dc97d5..0ce15ea9cf 100644 --- a/reference/expected/unexpected.md +++ b/reference/expected/unexpected.md @@ -12,7 +12,7 @@ namespace std { ``` ## 概要 -`unexpected`クラスは、任意の型`E`の値をエラー値として表現する。 +`unexpected`クラスは、[`std::expected`](expected.md)に格納される任意の型`E`の値をエラー値として表現する。 ## 適格要件 @@ -24,41 +24,42 @@ namespace std { | 名前 | 説明 | 対応バージョン | |-----------------|----------------|-------| -| [`(constructor)`](unexpected/op_constructor.md.nolink) | コンストラクタ | C++23 | -| [`(destructor)`](unexpected/op_destructor.md.nolink) | デストラクタ | C++23 | +| [`(constructor)`](unexpected/op_constructor.md) | コンストラクタ | C++23 | +| `(destructor)` | デストラクタ | C++23 | ### 代入 | 名前 | 説明 | 対応バージョン | |-----------------|----------------|-------| -| [`operator=`](unexpected/op_assign.md.nolink) | 代入演算子 | C++23 | -| [`swap`](unexpected/swap.md.nolink) | 他の`unexpected`オブジェクトとデータを入れ替える | C++23 | +| `constexpr unexpected& operator=(const unexpected&) = default;` | コピー代入演算子 | C++23 | +| `constexpr unexpected& operator=(unexpected&&) = default;` | ムーブ代入演算子 | C++23 | +| [`swap`](unexpected/swap.md) | 他の`unexpected`オブジェクトとデータを入れ替える | C++23 | ### 値の観測 | 名前 | 説明 | 対応バージョン | |-----------------|----------------|-------| -| [`error`](unexpected/error.md.nolink) | エラー値を取得する | C++23 | +| [`error`](unexpected/error.md) | 値を取得する | C++23 | ### 比較 | 名前 | 説明 | 対応バージョン | |--------------|------------|-------| -| [`operator==`](unexpected/op_equal.md.nolink) | 等値比較 | C++23 | -| [`operator!=`](unexpected/op_not_equal.md.nolink) | 非等値比較 | C++23 | +| [`operator==`](unexpected/op_equal.md) | 等値比較 | C++23 | +| [`operator!=`](unexpected/op_not_equal.md) | 非等値比較 | C++23 | ## 非メンバ関数 | 名前 | 説明 | 対応バージョン | |------|------|-------| -| [`swap`](unexpected/swap_free.md.nolink) | 他の`unexpected`オブジェクトとデータを入れ替える | C++23 | +| [`swap`](unexpected/swap_free.md) | 2つの`unexpected`オブジェクトを入れ替える | C++23 | ## 推論補助 | 名前 | 説明 | 対応バージョン | |------|------|-------| -| [`(deduction_guide)`](unexpected/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | +| [`(deduction_guide)`](unexpected/op_deduction_guide.md) | クラステンプレートの推論補助 | C++23 | ## 例 diff --git a/reference/expected/unexpected/error.md b/reference/expected/unexpected/error.md new file mode 100644 index 0000000000..054b65f7b3 --- /dev/null +++ b/reference/expected/unexpected/error.md @@ -0,0 +1,65 @@ +# error +* expected[meta header] +* function[meta id-type] +* std[meta namespace] +* unexpected[meta class] +* cpp23[meta cpp] + +```cpp +constexpr const E& error() const & noexcept; // (1) +constexpr E& error() & noexcept; // (2) +constexpr const E&& error() const && noexcept; // (3) +constexpr E&& error() && noexcept; // (4) +``` + +## 概要 +値を取得する。 + + +## 戻り値 +動作説明用のメンバ変数として、値を保持する`unex`を導入する。 + +- (1), (2) : `unex` +- (3), (4) : [`std::move`](/reference/utility/move.md)`(unex)` + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include +#include +#include + +int main() +{ + std::unexpected x{"ERR"}; + std::cout << x.error() << std::endl; +} +``` +* error()[color ff0000] +* std::unexpected[link ../unexpected.md] + +### 出力 +``` +ERR +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) +- [P2549R1 `std::unexpected` should have `error()` as member accessor](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2549r1.html) diff --git a/reference/expected/unexpected/op_constructor.md b/reference/expected/unexpected/op_constructor.md new file mode 100644 index 0000000000..258bd17dc9 --- /dev/null +++ b/reference/expected/unexpected/op_constructor.md @@ -0,0 +1,146 @@ +# コンストラクタ +* expected[meta header] +* function[meta id-type] +* std[meta namespace] +* unexpected[meta class] +* cpp23[meta cpp] + +```cpp +constexpr unexpected(const unexpected&) = default; // (1) +constexpr unexpected(unexpected&&) = default; // (2) + +template +constexpr explicit unexpected(Err&& e); // (3) + +template +constexpr explicit unexpected(in_place_t, Args&&... args); // (4) +template +constexpr explicit unexpected(in_place_t, initializer_list il, Args&&... args); // (5) +``` +* in_place_t[link /reference/utility/in_place_t.md] +* initializer_list[link /reference/initializer_list/initializer_list.md] + +## 概要 +- (1) : コピーコンストラクタ。 +- (2) : ムーブコンストラクタ。 +- (3) : 変換可能な`Err`オブジェクトからコピー/ムーブ構築する。 +- (4) : コンストラクタ引数として任意個の引数を受け取って、コンストラクタ内で型`E`のオブジェクトを生成し、保持する。 +- (5) : コンストラクタ引数として初期化子リストと任意個の引数を受け取って、コンストラクタ内で型`E`のオブジェクトを生成し、保持する。 + + +## テンプレートパラメータ制約 +- (3) : 次の制約を全て満たすこと + - [`is_same_v`](/reference/type_traits/is_same.md)`<`[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`, unexpected> == false` + - [`is_same_v`](/reference/type_traits/is_same.md)`<`[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`,` [`in_place_t`](/reference/utility/in_place_t.md)`> == false` + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true` +- (4) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true` +- (5) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)`&, Args...> == true` + + +## 効果 +- (3) : [`std::forward`](/reference/utility/forward.md)`(e)`で値を直接非リスト初期化する。 +- (4) : [`std::forward`](/reference/utility/forward.md)`(args)...`で値を直接非リスト初期化する。 +- (5) : `il,` [`std::forward`](/reference/utility/forward.md)`(args)...`で値を直接非リスト初期化する。 + + +## 例外 +型`E`の初期化から送出される例外。 + + +## 例 +```cpp example +#include +#include +#include +#include +#include +#include +#include +#include + +// std::pair型から2要素std::tuple型へはコピー変換可能 +using IntPair = std::pair; +using IntTuple = std::tuple; + +// std::unique_ptr型からstd::shared_ptr型へはムーブ変換可能 +using UniquePtr = std::unique_ptr; +using SharedPtr = std::shared_ptr; + +// 引数リスト または 初期化子リスト+引数リスト から構築可能な型 +struct ComplexType { + std::string data; + std::vector seq; + + ComplexType(const char* ptr, size_t len) + : data(ptr, len) {} + ComplexType(std::initializer_list il, std::string_view sv) + : data(sv), seq(il) {} +}; + +int main() +{ + // (1) コピーコンストラクタ + { + std::unexpected src{42}; + std::unexpected dst = src; + assert(src.error() == 42 && dst.error() == 42); + } + + // (2) ムーブコンストラクタ + { + std::unexpected src{"Oops!"}; + std::unexpected dst = std::move(src); + assert(dst.error() == "Oops!"); + // src.error()はstd::stringムーブ後の未規定の値 + } + + // (3) 変換コピー構築 + { + IntPair src = {1, 2}; + std::unexpected dst{src}; + assert((dst.error() == IntTuple{1, 2})); + } + // (3) 変換構築 + { + UniquePtr src = std::make_unique(42); + std::unexpected dst{std::move(src)}; + assert(*dst.error() == 42); + assert(src == nullptr); + // ムーブ後のstd::unique_ptr型はnullptrが保証される + } + + // (4),(5) 引数リストから直接構築 + { + std::unexpected x1{std::in_place, "C++", 1}; + assert(x1.error().data == "C"); + // "C++"より長さ1の文字列が構築されている + + std::unexpected x2{std::in_place, {98, 11, 23}, "C++"}; + assert(x2.error().data == "C++"); + assert((x2.error().seq == std::vector{98, 11, 23})); + } +} +``` +* std::unexpected[color ff0000] +* error[link error.md] +* std::in_place[link /reference/utility/in_place_t.md] +* std::make_unique[link /reference/memory/make_unique.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) diff --git a/reference/expected/unexpected/op_deduction_guide.md b/reference/expected/unexpected/op_deduction_guide.md new file mode 100644 index 0000000000..dd79e8017a --- /dev/null +++ b/reference/expected/unexpected/op_deduction_guide.md @@ -0,0 +1,51 @@ +# 推論補助 +* expected[meta header] +* std[meta namespace] +* unexpected[meta class] +* cpp23[meta cpp] + +```cpp +namespace std { + template + unexpected(E) -> unexpected; +} +``` + +## 概要 +`std::expected`クラステンプレートの型推論補助。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::unexpected x{1}; + assert(x.error() == 1); + static_assert(std::same_as>); +} +``` +* error()[link error.md] +* std::unexpected[link ../unexpected.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) diff --git a/reference/expected/unexpected/op_equal.md b/reference/expected/unexpected/op_equal.md new file mode 100644 index 0000000000..988a9f4661 --- /dev/null +++ b/reference/expected/unexpected/op_equal.md @@ -0,0 +1,58 @@ +# operator== +* expected[meta header] +* function template[meta id-type] +* std[meta namespace] +* unexpected[meta class] +* cpp23[meta cpp] + +```cpp +template +friend constexpr bool operator==(const unexpected& x, const unexpected& y); +``` +* unexpected[link ../unexpected.md] + +## 概要 +`unexpected`オブジェクト同士の等値比較を行う。 + + +## 適格要件 +式`x.`[`error()`](error.md) `== y.`[`error()`](error.md)が適格であり、その結果を`bool`へ変換可能であること。 + + +## 戻り値 +`x.`[`error()`](error.md) `== y.`[`error()`](error.md) + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::unexpected x{1}; + std::unexpected y{1}; + assert(x == y); +} +``` +* ==[color ff0000] +* std::unexpected[link ../unexpected.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) diff --git a/reference/expected/unexpected/op_not_equal.md b/reference/expected/unexpected/op_not_equal.md new file mode 100644 index 0000000000..1b7786aa01 --- /dev/null +++ b/reference/expected/unexpected/op_not_equal.md @@ -0,0 +1,60 @@ +# operator!= +* expected[meta header] +* function template[meta id-type] +* std[meta namespace] +* unexpected[meta class] +* cpp23[meta cpp] + +```cpp +// operator==により、下記オーバーロードが使用可能になる +template +friend constexpr bool operator!=(const unexpected& x, const unexpected& y); +``` +* operator==[link op_equal.md] +* unexpected[link ../unexpected.md] + +## 概要 +`unexpected`オブジェクト同士の非等値比較を行う。 + + +## 適格要件 +式`x.`[`error()`](error.md) `== y.`[`error()`](error.md)が適格であり、その結果を`bool`へ変換可能であること。 + + +## 戻り値 +`!`[`(x == y)`](op_equal.md) + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::unexpected x{1}; + std::unexpected y{2}; + assert(x != y); +} +``` +* !=[color ff0000] +* std::unexpected[link ../unexpected.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) diff --git a/reference/expected/unexpected/swap.md b/reference/expected/unexpected/swap.md new file mode 100644 index 0000000000..19b821f9d8 --- /dev/null +++ b/reference/expected/unexpected/swap.md @@ -0,0 +1,73 @@ +# swap +* expected[meta header] +* function[meta id-type] +* std[meta namespace] +* unexpected[meta class] +* cpp23[meta cpp] + +```cpp +constexpr void swap(unexpected& other) + noexcept(is_nothrow_swappable_v); +``` +* is_nothrow_swappable_v[link /reference/type_traits/is_nothrow_swappable.md] + + +## 概要 +他の`unexpected`オブジェクトとデータを入れ替える。 + + +## テンプレートパラメータ制約 +[`is_swappable_v`](/reference/type_traits/is_swappable.md)` == true` + + +## 効果 +動作説明用の`E`型メンバ変数`unex`として、次と等価 : + +```cpp +using std::swap; +swap(unex, rhs.unex); +``` +* std::swap[link /reference/utility/swap.md] + + +## 戻り値 +なし + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::unexpected x{1}; + std::unexpected y{2}; + assert(x.error() == 1 && y.error() == 2); + + x.swap(y); + assert(x.error() == 2 && y.error() == 1); +} +``` +* swap[color ff0000] +* error()[link error.md] +* std::unexpected[link ../unexpected.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) diff --git a/reference/expected/unexpected/swap_free.md b/reference/expected/unexpected/swap_free.md new file mode 100644 index 0000000000..778781ee2d --- /dev/null +++ b/reference/expected/unexpected/swap_free.md @@ -0,0 +1,65 @@ +# swap (非メンバ関数) +* expected[meta header] +* function[meta id-type] +* std[meta namespace] +* unexpected[meta class] +* cpp23[meta cpp] + +```cpp +friend constexpr void swap(unexpected& x, unexpected& y) + noexcept(noexcept(x.swap(y))); +``` +* x.swap(y)[link swap.md] + +## 概要 +2つの`unexpected`オブジェクトを入れ替える。 + + +## 効果 +```cpp +x.swap(y); +``` +* swap[link swap.md] + + +## 戻り値 +なし + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::unexpected x{1}; + std::unexpected y{2}; + assert(x.error() == 1 && y.error() == 2); + + std::swap(x, y); + assert(x.error() == 2 && y.error() == 1); +} +``` +* std::swap[color ff0000] +* error()[link error.md] +* std::unexpected[link ../unexpected.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) From 141e98ef7802194cbe801d5c38a0653545de0e7a Mon Sep 17 00:00:00 2001 From: yumetodo Date: Fri, 10 Feb 2023 01:02:52 +0900 Subject: [PATCH 0172/3948] =?UTF-8?q?chore:=20std:::size=20->=20std::rages?= =?UTF-8?q?::size=E3=81=AB=E3=83=AA=E3=83=B3=E3=82=AF=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/size.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reference/iterator/size.md b/reference/iterator/size.md index 52fbe0f7c4..7455d477de 100644 --- a/reference/iterator/size.md +++ b/reference/iterator/size.md @@ -93,6 +93,9 @@ int main() - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2015 +## 関連項目 + +- [`std::ranges::size`](/reference/ranges/size.md) ## 参照 - [`boost::size()` - Boost Range Library](http://www.boost.org/doc/libs/release/libs/range/doc/html/range/reference/concept_implementation/semantics/functions.html) From da6efe1a08463c917c6d8dfa6fb453612c98d055 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 10 Feb 2023 14:29:25 +0900 Subject: [PATCH 0173/3948] expected: bad_expected_access(#1066) --- reference/expected/bad_expected_access.md | 8 +-- .../expected/bad_expected_access/error.md | 71 +++++++++++++++++++ .../bad_expected_access/op_constructor.md | 52 ++++++++++++++ .../expected/bad_expected_access/what.md | 64 +++++++++++++++++ reference/expected/expected.void/value.md | 2 +- reference/expected/expected/value.md | 2 +- reference/expected/unexpected.md | 4 +- reference/expected/unexpected/error.md | 4 +- .../expected/unexpected/op_constructor.md | 8 +-- .../expected/unexpected/op_deduction_guide.md | 2 +- 10 files changed, 202 insertions(+), 15 deletions(-) create mode 100644 reference/expected/bad_expected_access/error.md create mode 100644 reference/expected/bad_expected_access/op_constructor.md create mode 100644 reference/expected/bad_expected_access/what.md diff --git a/reference/expected/bad_expected_access.md b/reference/expected/bad_expected_access.md index b4ec99ce13..1f18724c7e 100644 --- a/reference/expected/bad_expected_access.md +++ b/reference/expected/bad_expected_access.md @@ -9,7 +9,6 @@ namespace std { template class bad_expected_access : public bad_expected_access { ... }; - // void特殊化 template<> class bad_expected_access : public exception { ... }; } @@ -24,10 +23,11 @@ namespace std { | 名前 | 説明 | 対応バージョン | |-----------------|----------------|-------| -| [`(constructor)`](bad_expected_access/op_constructor.md.nolink) | コンストラクタ | C++23 | +| [`(constructor)`](bad_expected_access/op_constructor.md) | コンストラクタ | C++23 | | `(destructor)` | デストラクタ | C++23 | -| [`error`](bad_expected_access/error.md.nolink) | エラー値を取得する | C++23 | -| [`what`](bad_expected_access/what.md.nolink) | エラー理由の文字列を取得する | C++23 | +| `operator=` | コピー/ムーブ代入演算子 | C++23 | +| [`error`](bad_expected_access/error.md) | エラー値を取得する | C++23 | +| [`what`](bad_expected_access/what.md) | エラー理由の文字列を取得する | C++23 | ## 例 diff --git a/reference/expected/bad_expected_access/error.md b/reference/expected/bad_expected_access/error.md new file mode 100644 index 0000000000..66947a8e76 --- /dev/null +++ b/reference/expected/bad_expected_access/error.md @@ -0,0 +1,71 @@ +# error +* expected[meta header] +* function[meta id-type] +* std[meta namespace] +* bad_expected_access[meta class] +* cpp23[meta cpp] + +```cpp +constexpr const E& error() const & noexcept; // (1) +constexpr E& error() & noexcept; // (2) +constexpr const E&& error() const && noexcept; // (3) +constexpr E&& error() && noexcept; // (4) +``` + +## 概要 +エラー値を取得する。 + + +## 戻り値 +動作説明用のメンバ変数として、エラー値を保持する`unex`を導入する。 + +- (1), (2) : `unex` +- (3), (4) : [`std::move`](/reference/utility/move.md)`(unex)` + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include +#include +#include + +int main() +{ + std::expected v = std::unexpected{"ERR"}; + try { + std::cout << v.value() << std::endl; + } catch (const std::bad_expected_access& ex) { + std::cout << "throw:" << ex.error() << std::endl; + } +} +``` +* error()[color ff0000] +* value()[link ../expected/value.md] +* std::unexpected[link ../unexpected.md] +* std::bad_expected_access[link ../bad_expected_access.md] + +### 出力 +``` +throw:ERR +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) +- [P2549R1 `std::unexpected` should have `error()` as member accessor](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2549r1.html) diff --git a/reference/expected/bad_expected_access/op_constructor.md b/reference/expected/bad_expected_access/op_constructor.md new file mode 100644 index 0000000000..4049783bdd --- /dev/null +++ b/reference/expected/bad_expected_access/op_constructor.md @@ -0,0 +1,52 @@ +# コンストラクタ +* expected[meta header] +* function[meta id-type] +* std[meta namespace] +* bad_expected_access[meta class] +* cpp23[meta cpp] + +```cpp +explicit bad_expected_access(E e); // (1) +bad_expected_access(const bad_expected_access&); // (2) +bad_expected_access(bad_expected_access&&); // (3) +``` +* bad_expected_access[link ../bad_expected_access.md] + +## 概要 +- (1) : エラー値を[`std::move`](/reference/utility/move.md)`(e)`で初期化する。 +- (2) : コピーコンストラクタ。 +- (3) : ムーブコンストラクタ。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::bad_expected_access ex{42}; + assert(ex.error() == 42); +} +``` +* std::bad_expected_access[color ff0000] +* error()[link error.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) diff --git a/reference/expected/bad_expected_access/what.md b/reference/expected/bad_expected_access/what.md new file mode 100644 index 0000000000..38ad29ef36 --- /dev/null +++ b/reference/expected/bad_expected_access/what.md @@ -0,0 +1,64 @@ +# what +* expected[meta header] +* function[meta id-type] +* std[meta namespace] +* bad_expected_access[meta class] +* cpp23[meta cpp] + +```cpp +const char* what() const noexcept override; +``` + +## 概要 +エラー理由の文字列を取得する。 + + +## 戻り値 +エラー理由となる実装定義の文字列 + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include +#include +#include + +int main() +{ + std::expected v = std::unexpected{"ERR"}; + try { + std::cout << v.value() << std::endl; + } catch (const std::bad_expected_access& ex) { + std::cout << ex.what() << std::endl; + } +} +``` +* what()[color ff0000] +* value()[link ../expected/value.md] +* std::unexpected[link ../unexpected.md] +* std::bad_expected_access[link ../bad_expected_access.md] + +### 出力例 +``` +bad access to std::expected without expected value +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 12.1 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) diff --git a/reference/expected/expected.void/value.md b/reference/expected/expected.void/value.md index 45e4c49db0..a69e3d1d17 100644 --- a/reference/expected/expected.void/value.md +++ b/reference/expected/expected.void/value.md @@ -43,7 +43,7 @@ int main() } ``` * value()[color ff0000] -* error()[link ../bad_expected_access/error.md.nolink] +* error()[link ../bad_expected_access/error.md] * std::unexpected[link ../unexpected.md] * std::bad_expected_access[link ../bad_expected_access.md] diff --git a/reference/expected/expected/value.md b/reference/expected/expected/value.md index 8f1f26ffca..ab4a91004c 100644 --- a/reference/expected/expected/value.md +++ b/reference/expected/expected/value.md @@ -48,7 +48,7 @@ int main() } ``` * value()[color ff0000] -* error()[link ../bad_expected_access/error.md.nolink] +* error()[link ../bad_expected_access/error.md] * std::unexpected[link ../unexpected.md] * std::bad_expected_access[link ../bad_expected_access.md] diff --git a/reference/expected/unexpected.md b/reference/expected/unexpected.md index 0ce15ea9cf..e0dc8715d3 100644 --- a/reference/expected/unexpected.md +++ b/reference/expected/unexpected.md @@ -12,7 +12,7 @@ namespace std { ``` ## 概要 -`unexpected`クラスは、[`std::expected`](expected.md)に格納される任意の型`E`の値をエラー値として表現する。 +`unexpected`クラスは、[`std::expected`](expected.md)に格納される任意の型`E`のエラー値を表現するヘルパークラスである。 ## 適格要件 @@ -39,7 +39,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |-----------------|----------------|-------| -| [`error`](unexpected/error.md) | 値を取得する | C++23 | +| [`error`](unexpected/error.md) | エラー値を取得する | C++23 | ### 比較 diff --git a/reference/expected/unexpected/error.md b/reference/expected/unexpected/error.md index 054b65f7b3..8a6d6922bf 100644 --- a/reference/expected/unexpected/error.md +++ b/reference/expected/unexpected/error.md @@ -13,11 +13,11 @@ constexpr E&& error() && noexcept; // (4) ``` ## 概要 -値を取得する。 +エラー値を取得する。 ## 戻り値 -動作説明用のメンバ変数として、値を保持する`unex`を導入する。 +動作説明用のメンバ変数として、エラー値を保持する`unex`を導入する。 - (1), (2) : `unex` - (3), (4) : [`std::move`](/reference/utility/move.md)`(unex)` diff --git a/reference/expected/unexpected/op_constructor.md b/reference/expected/unexpected/op_constructor.md index 258bd17dc9..763cccae60 100644 --- a/reference/expected/unexpected/op_constructor.md +++ b/reference/expected/unexpected/op_constructor.md @@ -38,9 +38,9 @@ constexpr explicit unexpected(in_place_t, initializer_list il, Args&&... args ## 効果 -- (3) : [`std::forward`](/reference/utility/forward.md)`(e)`で値を直接非リスト初期化する。 -- (4) : [`std::forward`](/reference/utility/forward.md)`(args)...`で値を直接非リスト初期化する。 -- (5) : `il,` [`std::forward`](/reference/utility/forward.md)`(args)...`で値を直接非リスト初期化する。 +- (3) : [`std::forward`](/reference/utility/forward.md)`(e)`でエラー値を直接非リスト初期化する。 +- (4) : [`std::forward`](/reference/utility/forward.md)`(args)...`でエラー値を直接非リスト初期化する。 +- (5) : `il,` [`std::forward`](/reference/utility/forward.md)`(args)...`でエラー値を直接非リスト初期化する。 ## 例外 @@ -100,7 +100,7 @@ int main() std::unexpected dst{src}; assert((dst.error() == IntTuple{1, 2})); } - // (3) 変換構築 + // (3) 変換ムーブ構築 { UniquePtr src = std::make_unique(42); std::unexpected dst{std::move(src)}; diff --git a/reference/expected/unexpected/op_deduction_guide.md b/reference/expected/unexpected/op_deduction_guide.md index dd79e8017a..0927d9d581 100644 --- a/reference/expected/unexpected/op_deduction_guide.md +++ b/reference/expected/unexpected/op_deduction_guide.md @@ -12,7 +12,7 @@ namespace std { ``` ## 概要 -`std::expected`クラステンプレートの型推論補助。 +`std::unexpected`クラステンプレートの型推論補助。 ## 例 From 6a05dbbaea2d5e7472bd2ff832b2d36fcf520780 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Fri, 10 Feb 2023 17:58:27 +0900 Subject: [PATCH 0174/3948] =?UTF-8?q?take=5Fview=20:=20bidirectional?= =?UTF-8?q?=E4=BB=A5=E4=B8=8B=E3=81=AE=E5=85=A5=E5=8A=9B=E3=81=AB=E5=AF=BE?= =?UTF-8?q?=E3=81=99=E3=82=8B=E6=B3=A8=E6=84=8F=E3=82=92=E8=BF=BD=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/take_view.md | 65 +++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/reference/ranges/take_view.md b/reference/ranges/take_view.md index 2348faa48a..23008c5889 100644 --- a/reference/ranges/take_view.md +++ b/reference/ranges/take_view.md @@ -78,6 +78,70 @@ namespace std::ranges { |-------------------------------------------------------|------------------------------|----------------| | [`(deduction_guide)`](take_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++20 | +## 使用上の注意 + +この`view`(及びRangeアダプタ)は、入力が[`random_access_range`](random_access_range.md)ではない場合に意図しない無限ループに陥ることがある + +```cpp +int main() { + for (auto i : std::views::iota(0) + | std::views::filter([](auto i) { return i < 10; }) + | std::views::take(10)) + { + std::cout << i << '\n'; + } +} +``` + +このコードは0から9までの数字を出力するだけのループに見えるが、実行すると無限ループに陥るか完了までに多大な時間を要する。 + +範囲`for`文は内部でイテレータを用いた通常`for`文に展開されており、1つのループの終わりでは次の様な順番でループのための処理が行われている + +1. イテレータのインクリメント +2. イテレータの終端チェック +3. ループ本体実行 + +この例における1では、次の様なことが起きている + +1. `take_view`イテレータのインクリメント + 1. `take_view`内部カウンタの減算 + 2. [`filter_view`](filter_view.md)のイテレータのインクリメント + 1. 条件を満たす次の要素の探索 + - 条件を満たす要素が見つかるまで、`iota_view`イテレータをインクリメントする + 1. `iota_view`イテレータのインクリメント + - 増分1で整数値を生成、この場合は終端がない + 2. `iota_view`生成値の読み取りと条件チェック + +`views::iota(0)`によるシーケンスは0始まりの整数の無限列であり、`filter_view`のフィルタ条件(`return i < 10`)は10未満の整数値のみを取り出すものである。したがってこの場合、`iota_view`が10を生成して以降は`filter_view`で条件を満たす要素は存在しなくなる。 + +ループの最終端、本体処理が9を出力した後のループ終了直前には、`take_view`の内部カウンタが0になり`take_view`の終了条件が満たされるものの、その直後に内部イテレータ(`filter_view`のイテレータ)をインクリメントしてしまう。`filter_view`のイテレータはインクリメントによって10未満の次の要素を探索するために`iota_view`のイテレータをインクリメントし、`iota_view`は10以降の整数値をひたすら生成し続ける。 + +この例の`iota_view`の要素型は符号付き整数型であるため、そのオーバーフローは未定義動作となり、このループが終了するかどうかは保証されない。 + +入力に対して`filter_view`の条件の与え方が悪いという見方もできるが、これは`take_view`イテレータのインクリメント時に起こることに問題があり、`take_view`のイテレータは入力が[`random_access_range`](random_access_range.md)ではない場合は[`counted_iterator`](/reference/iterator/counted_iterator.md)を使用するため、本質的には`counted_iterator`の問題である。 + +`counted_iterator`はインクリメント時にカウンタ値を減算してからラップしているイテレータをインクリメントするが、カウンタ値を考慮せず常にインクリメントを行うため`counted_iterator`の内部カウンタが0になりその終了条件が満たされた時でもラップするイテレータをインクリメントしてしまう。そのため、`filter_view`イテレータのようにそのイテレータ取得時点で終端が確定していないイテレータを入力として使用すると、その終端でこのような問題が起こりうる。 + +特に、`input_iterator`では、イテレータがその範囲の終端に達した後でインクリメントしてしまうと何が起こるかわからないため、この問題はより複雑な形で顕在化する可能性がある。 + +```cpp +int main() { + // 入力ストリームには整数値1つしかない + auto iss = std::istringstream("0"); + + // 0を読んだ後、takeイテレータが進行するが、istream_viewが次のストリーム入力を待機するために終了しない + for (auto i : std::ranges::istream_view(iss) + | std::views::take(1)) + { + std::cout << i << '\n'; + } +} +``` + +この例では、`istream_view`の基底のストリームに追加の要素が入力されるか、ストリームが閉じられるまで`istream_view`のイテレータはインクリメント時に次の要素の入力を待機し続けてしまう。より一般的な`input_iterator`ではどうなるかわからない。 + +ただし、`take_view`は入力範囲が`random_access_range`の場合は`counted_iterator`を使用しないため、`random_access_range`に対して使用する場合はこの問題は起こらない。 + ## 例 ```cpp example #include @@ -113,3 +177,4 @@ int main() { - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) - [C++20 ranges](https://techbookfest.org/product/5134506308665344) - [P2367R0 Remove misuses of list-initialization from Clause 24](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2367r0.html) (本提案文書はC++20に遡って適用されている) +- [P2406R2 Add `lazy_counted_iterator`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2406r2.html) From d6efda15a80acb4f8c394c4ea3d970d80a4d2192 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Fri, 10 Feb 2023 18:08:42 +0900 Subject: [PATCH 0175/3948] =?UTF-8?q?take=5Fview=20:=20=E7=AE=87=E6=9D=A1?= =?UTF-8?q?=E6=9B=B8=E3=81=8D=E3=81=AE=E3=83=8D=E3=82=B9=E3=83=88=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/take_view.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/reference/ranges/take_view.md b/reference/ranges/take_view.md index 23008c5889..cac570185e 100644 --- a/reference/ranges/take_view.md +++ b/reference/ranges/take_view.md @@ -106,11 +106,11 @@ int main() { 1. `take_view`イテレータのインクリメント 1. `take_view`内部カウンタの減算 2. [`filter_view`](filter_view.md)のイテレータのインクリメント - 1. 条件を満たす次の要素の探索 - - 条件を満たす要素が見つかるまで、`iota_view`イテレータをインクリメントする - 1. `iota_view`イテレータのインクリメント - - 増分1で整数値を生成、この場合は終端がない - 2. `iota_view`生成値の読み取りと条件チェック + 1. 条件を満たす次の要素の探索 + - 条件を満たす要素が見つかるまで、`iota_view`イテレータをインクリメントする + 1. `iota_view`イテレータのインクリメント + - 増分1で整数値を生成、この場合は終端がない + 2. `iota_view`生成値の読み取りと条件チェック `views::iota(0)`によるシーケンスは0始まりの整数の無限列であり、`filter_view`のフィルタ条件(`return i < 10`)は10未満の整数値のみを取り出すものである。したがってこの場合、`iota_view`が10を生成して以降は`filter_view`で条件を満たす要素は存在しなくなる。 From 1bcaedc52902daf98f55025838c8ea628714af70 Mon Sep 17 00:00:00 2001 From: yoh Date: Sat, 11 Feb 2023 20:28:17 +0900 Subject: [PATCH 0176/3948] =?UTF-8?q?expected/expected:=20=E6=9C=80?= =?UTF-8?q?=E4=BD=8E=E9=99=90=E3=81=AE=E8=AA=AC=E6=98=8E=E5=A2=97=E8=A3=9C?= =?UTF-8?q?(#1066)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/expected/expected.md | 6 ++++++ reference/expected/unexpected.md | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/reference/expected/expected.md b/reference/expected/expected.md index 8e39403981..23da5b5149 100644 --- a/reference/expected/expected.md +++ b/reference/expected/expected.md @@ -21,10 +21,16 @@ namespace std { ## 概要 `expected`クラスは、任意の型`T`の値を正常値とし任意の型`E`の値をエラー値として、正常もしくはエラーいずれかの状態を取ることを値として表現できる型である。 +このクラスは、ヒープからの動的メモリ確保を行わない。 +実装は配置newのような機能によって、スタック領域のメモリのみを使用する。 + ## 適格要件 +- 型`T`および型`E`は、参照型、関数型、[`in_place_t`](/reference/utility/in_place_t.md)、[`unexpect_t`](unexpect_t.md)のいずれでもないこと。 +- 型`T`は[`unexpected`](unexpected.md)の特殊化ではないこと。 - 型`T`が(CV修飾された)`void`型でなければ、型`T`はCpp17Destructible要件を満たすこと。 +- 型`E`は非オブジェクト型、配列型、`unexpected`の特殊化、CV修飾された型のいずれでもないこと。 - 型`E`はCpp17Destructible要件を満たすこと。 diff --git a/reference/expected/unexpected.md b/reference/expected/unexpected.md index e0dc8715d3..6e8f00f677 100644 --- a/reference/expected/unexpected.md +++ b/reference/expected/unexpected.md @@ -16,7 +16,7 @@ namespace std { ## 適格要件 -`E`は非オブジェクト型、配列型、`unexpected`、CV修飾された型のいずれでもないこと。 +型`E`は非オブジェクト型、配列型、`unexpected`の特殊化、CV修飾された型のいずれでもないこと。 ## メンバ関数 From 8203fdd4e47fe92368e78d40c7821cb1d6bae2b9 Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 15 Feb 2023 11:56:49 +0900 Subject: [PATCH 0177/3948] fix external link (close #1123) --- reference/limits/numeric_limits/epsilon.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/limits/numeric_limits/epsilon.md b/reference/limits/numeric_limits/epsilon.md index 9f969b62c5..3af48f808e 100644 --- a/reference/limits/numeric_limits/epsilon.md +++ b/reference/limits/numeric_limits/epsilon.md @@ -57,7 +57,7 @@ equal ``` ## 参照 -- [C++ FAQ - Why doesn't my floating-point comparison work?](http://www.cs.technion.ac.il/users/yechiel/c++-faq/floating-point-arith.html) +- [C++ FAQ - Why doesn't my floating-point comparison work?](https://isocpp.org/wiki/faq/newbie#floating-point-arith) - [Comparing Floating Point Numbers, 2012 Edition](https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/) - [浮動小数比較の落とし穴 - trinoの走り書き](http://d.hatena.ne.jp/n-trino/20161101#p1) From d60c9f129df80b94cff1668f159c5eaf6c9f0420 Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 15 Feb 2023 14:03:02 +0900 Subject: [PATCH 0178/3948] =?UTF-8?q?algorithm:=20=E3=83=98=E3=83=83?= =?UTF-8?q?=E3=83=80=E5=86=92=E9=A0=AD=E8=AA=AC=E6=98=8E=E3=82=92=E5=8C=BA?= =?UTF-8?q?=E5=88=86=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm.md | 42 ++++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/reference/algorithm.md b/reference/algorithm.md index 041e10d61f..fb2fcc5646 100644 --- a/reference/algorithm.md +++ b/reference/algorithm.md @@ -4,10 +4,14 @@ 全てのアルゴリズムはデータ構造の実装の詳細から切り離されていて、イテレータによってパラメータ化されている。これはアルゴリズムの要件を満たすイテレータを提供しているなら、どのようなデータ構造であっても動作するということを示している。 -関数オブジェクトを使用するアルゴリズムでは、`for_each`と`for_each_n`以外、引数として渡されたオブジェクトを書き換えてはならない。 +このヘッダでは、以下の標準ヘッダをインクルードする: + +- [``](initializer_list.md) (C++11) + -ここでは、各アルゴリズムのテンプレートパラメータ名を、型の要件を表すために使っている。アルゴリズムを正しく利用するためには、テンプレートパラメータ名に応じたこれらの要件を満たしている必要がある。以下の通りである。 +### テンプレートパラメータ名とイテレータ要件 +``ヘッダでは、各アルゴリズムのテンプレートパラメータ名を、型の要件を表すために使っている。アルゴリズムを正しく利用するためには、テンプレートパラメータ名に応じたこれらの要件を満たしている必要がある。以下の通りである。 | テンプレートパラメータ名 | 要件 | |-------------------------------------------------------------------------|------------------------| @@ -20,8 +24,6 @@ もし「効果」のセクションで、イテレータの値を書き換えるという旨の文章が書かれている場合、その引数の型は mutable iterator の要件を満たしていなければならないという追加の要件がある。 もちろん、output iterator は常に書き換え可能であるため、この追加の要件は無意味である。 -いくつかのアルゴリズムは `_copy` というサフィックスが付いている。これは `_copy` サフィックスの付いていないアルゴリズムと違い、処理の結果を別のイテレータへ出力するアルゴリズムである。コピーバージョンを含めるかどうかの判断は、通常バージョンの計算量を考慮する。操作を行うコストがコピーのコストを大きく上回る場合、コピーバージョンは含めないようになっている。例えば `sort_copy` は存在しない。なぜなら、ソートのコストは大きいし、そのような場合、ユーザは `copy` してから `sort` するからだ。 - テンプレートパラメータ名が `Predicate` となっている場合、`Predicate` の値 `pred` と、引数として渡すイテレータ `i` について以下の要件を満たす必要がある - `pred(*i)` が `bool` として評価できなければならない。 @@ -32,8 +34,20 @@ - `binary_pred(*i1, *i2)` が `bool` として評価できなければならない。 - `binary_pred(*i1, *i2)` 内で `*i1` や `*i2` を書き変えてはならない。 -関数オブジェクトを引数に取る `for_each` 以外のアルゴリズムは、その関数オブジェクトを自由にコピーしても構わない。そのため、アルゴリズムの利用者はそのことに注意する必要がある。コピーされてしまうことが問題である場合、`reference_wrapper` や同様の解決手段を使ってオブジェクトの中身をコピーしないようなラッパークラスを使うといった対策を行う必要がある。 +### 要素の書き換え操作 +関数オブジェクトを使用するアルゴリズムでは、`for_each`と`for_each_n`以外、プログラム定義の関数に引数として渡された要素を書き換えてはならない。 + +### 関数オブジェクトの取り扱い +関数オブジェクトを引数に取る `for_each`, `for_each_n` 以外のアルゴリズムは、内部処理においてその関数オブジェクトをコピーする可能性がある。 + +そのため、アルゴリズムの利用者はそのことに注意する必要がある。コピーされてしまうことが問題である場合、`reference_wrapper` や同様の解決手段を使ってオブジェクトの中身をコピーしないようなラッパークラスを使うといった対策を行う必要がある。 + +### `_copy`サフィックス付きアルゴリズム +いくつかのアルゴリズムは `_copy` というサフィックスが付いている。これは `_copy` サフィックスの付いていないアルゴリズムと違い、処理の結果を別のイテレータへ出力するアルゴリズムである。 +コピーバージョンを含めるかどうかの判断は、通常バージョンの計算量を考慮する。操作を行うコストがコピーのコストを大きく上回る場合、コピーバージョンは含めないようになっている。例えば `sort_copy` は存在しない。なぜなら、ソートのコストは大きいし、そのような場合、ユーザは `copy` してから `sort` するからだ。 + +### イテレータ操作に関する補足 アルゴリズムの説明で `+` や `-` を使っているが、random-access iterator 以外のイテレータはそれを定義していない。そういった場合、 `a+n` というのは ```cpp @@ -41,21 +55,18 @@ X tmp = a; advance(tmp, n); return tmp; ``` +* advance[link /reference/iterator/advance.md] を意味する。また、`b-a` は ```cpp return distance(a, b); ``` +* distance[link /reference/iterator/distance.md] を意味する。 -このヘッダでは、以下の標準ヘッダをインクルードする: - -- [``](initializer_list.md) (C++11) - -### 射影とRangeサポート - +### 射影とRangeサポート(C++20) C++20ではアルゴリズム関数の新しいバージョンが`std::ranges`名前空間に追加された。従来の関数と比べて以下の点が異なる: * テンプレート引数がコンセプトによって制約される @@ -73,6 +84,8 @@ ranges::sort(v); // イテレータ対も渡せる ranges::sort(v.begin(), v.end()); ``` +* sort[link algorithm/sort.md] +* ranges::sort[link algorithm/ranges_sort.md] 射影は、述語とは別に渡すことができる関数オブジェクトで、特定のメンバだけを対象にアルゴリズムを実行するために用いる。 @@ -88,19 +101,23 @@ vector pv = { … }; sort(pv.begin(), pv.end(), [](auto&& a, auto&& b){ return a.name < b.name; }); ``` +* sort[link algorithm/sort.md] これは、述語がメンバの選択と比較という2つの仕事をしてしまっている点でよくない。この責務を分割し、メンバの選択だけを行うようにしたものが射影である。 ```cpp -// デフォルトの述語({})で、nameでソート +// デフォルトの述語(ranges::less{})で、nameでソート ranges::sort(pv, {}, [](auto&& a){ return a.name; }); // std::invokeで呼び出されるため、メンバ変数ポインタでもよい ranges::sort(pv, {}, &Parson::name); ``` +* ranges::sort[link algorithm/ranges_sort.md] +* ranges::less[link /reference/functional/ranges_less.md] * std::invoke[link /reference/functional/invoke.md] なお、各関数の説明においては、射影の影響は無視していることがある。 + ## シーケンスを変更しない操作 | 名前 | 説明 | 対応バージョン | @@ -418,6 +435,7 @@ ranges::sort(pv, {}, &Parson::name); | [`ranges::in_found_result`](algorithm/ranges_in_found_result.md) | イテレータとbool値を格納する型 | C++20 | | [`ranges::out_value_result`](algorithm/ranges_out_value_result.md) | イテレータと値を格納する型 | C++23 | + ## 関連項目 - [``](/reference/numeric.md) - 数値計算のアルゴリズム From 0709184c1cbe9f034e42efc9ec3cd272972b2192 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 15 Feb 2023 16:43:43 +0900 Subject: [PATCH 0179/3948] =?UTF-8?q?=E5=A4=96=E9=83=A8=E3=83=AA=E3=83=B3?= =?UTF-8?q?=E3=82=AF=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF=20:=20microsoft.c?= =?UTF-8?q?om=20=E3=82=92=E7=84=A1=E8=A6=96=E3=83=AA=E3=82=B9=E3=83=88?= =?UTF-8?q?=E3=81=AB=E7=99=BB=E9=8C=B2=20(close=20#1125)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/script/link_check.py | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/script/link_check.py b/.github/workflows/script/link_check.py index af27098972..982bd79613 100644 --- a/.github/workflows/script/link_check.py +++ b/.github/workflows/script/link_check.py @@ -56,6 +56,7 @@ def fix_link(link: str) -> str: "https://web.archive.org", # 確実に存在すると思われる "http://cse.naro.affrc.go.jp", # 海外 (GitHub Actions) からのアクセスを排除していると思われる "https://www.cryptopp.com", # アクセスチェックでよく失敗するがブラウザ上では問題なくアクセスできる + "https://www.microsoft.com/", # ちょくちょく失敗するが、一時的なものだと思われる ] def is_ignore_link(link: str) -> bool: From 20ed53df537f4456bc971969411f1277bbeb22f0 Mon Sep 17 00:00:00 2001 From: yutopp Date: Wed, 15 Feb 2023 17:44:48 +0900 Subject: [PATCH 0180/3948] =?UTF-8?q?typo/=E3=82=B3=E3=83=B3=E3=83=91?= =?UTF-8?q?=E3=82=A4=E3=83=AB=E3=82=A8=E3=83=A9=E3=83=BC=E3=81=AE=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3:=20shared=5Fmutex=E2=86=92shared=5Ftimed=5Fmutex?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/shared_mutex/shared_timed_mutex.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/shared_mutex/shared_timed_mutex.md b/reference/shared_mutex/shared_timed_mutex.md index 64940c2d7c..07aaa1a928 100644 --- a/reference/shared_mutex/shared_timed_mutex.md +++ b/reference/shared_mutex/shared_timed_mutex.md @@ -96,7 +96,7 @@ public: { int local_count; { - std::shared_lock lock(mtx_); + std::shared_lock lock(mtx_); local_count = count_; } // 共有ロックをここで手放す print_value(local_count); From a26647ae2a5f030130be55e76162716598002d6c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 16 Feb 2023 12:40:39 +0900 Subject: [PATCH 0181/3948] =?UTF-8?q?=20:=20C++23=E3=81=A7=E3=81=AE?= =?UTF-8?q?=E5=A4=89=E6=9B=B4=E6=A6=82=E8=A6=81=E3=82=92=E3=81=BE=E3=81=A8?= =?UTF-8?q?=E3=82=81=E3=81=9F=20#1067?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 1 + reference/cmath.md | 45 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 039c6fd335..06183ff071 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -1,3 +1,4 @@ +* floating-point-type[italic] * implementation-defined[italic] * import std;[link /module/std.md] * import std.compat;[link /module/std.compat.md] diff --git a/reference/cmath.md b/reference/cmath.md index 9bfc4a6cde..3ac2fc19f3 100644 --- a/reference/cmath.md +++ b/reference/cmath.md @@ -85,6 +85,37 @@ * Promoted[italic] +### C++23での差異 +#### constexpr対応 +C++23では、多くの数学関数が`constexpr`に対応し、定数式内で使用できるようになった。C++23時点では、コンパイラベンダの負担が低い機能を`constexpr`対応した。 + +C++23で`constexpr`対応する関数の条件は以下: + +1. 有理数の集合、または実数のどこにも密でない部分集合に作用すると見なされ、関数が閉じていること +2. 関数が丸めモードに強く依存しないこと + +[`exp()`](cmath/exp.md)、[`sqrt()`](cmath/sqrt.md)、[`cos()`](cmath/cos.md)、[`sin()`](cmath/sin.md)は1. の条件を満たさないため、C++23では`constexpr`に対応しない。 + +[`nearbyint`](cmath/nearbyint.md)は2. の条件を満たさないため、C++23では`constexpr`に対応しない。 + +なお、C++20では[`lerp()`](cmath/lerp.md)のみ`constexpr`に対応している。これはC標準ライブラリからの移植ではなく、C++で標準化された関数だからである。 + +#### 拡張浮動小数点数型への対応 +C++23では[``](stdfloat.md.nolink)に拡張浮動小数点数型が追加された。その対応として、以下のような`float`、`double`、`long double`に対するオーバーロードは、 + +```cpp +float abs(float x); +double abs(double x); +long double abs(long double x); +``` + +以下のように`floating-point-type`へのオーバーロードに統合され、拡張浮動小数点数型も扱えるようになった。 + +```cpp +floating-point-type abs(floating-point-type x); +``` + + ## エラーの扱い `` で提供される各関数は、特に明記されていない限り、引数の型が表現できる全ての値についての挙動が定義されている。 なお、ここで言う「挙動が定義されている」とは、未定義動作を引き起こさないというだけで、エラーが発生したり、実装依存の挙動となる場合がある事に注意。 @@ -169,6 +200,18 @@ C++03 までの場合、[`errno`](cerrno/errno.md) でしか通知されない 特に、[`fesetround`](cfenv/fesetround.md) で設定した丸め方式に従うとは限らないため、注意が必要である。 +## 定数式になる条件 + +`constexpr`対応する数学関数において、以下のいずれかの条件に合致する場合、定数式とならない (引数によってコンパイルエラーになる) + +- [`FE_INEXACT`](cfenv/fe_inexact.md)以外の、以下の浮動小数点例外が発生した場合: + - [`FE_DIVBYZERO`](cfenv/fe_divbyzero.md) (ゼロ除算) + - [`FE_INVALID`](cfenv/fe_invalid.md) (不正な演算) + - [`FE_OVERFLOW`](cfenv/fe_overflow.md) (オーバーフロー) + - [`FE_UNDERFLOW`](cfenv/fe_underflow.md) (アンダーフロー) +- [`math_errhandling`](cmath/math_errhandling.md) `&` [`MATH_ERRNO`](cmath/math_errno.md)が真で、[`errno`](cerrno/errno.md)が設定された場合 + + ## 三角関数 | 名前 | 説明 | 対応バージョン | @@ -417,3 +460,5 @@ NaN を返さなければならないが定義域エラーを報告してはな - [N1568 Proposed additions to TR-1 to improve compatibility with C99](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1568.htm) - [P00175R0 Synopses for the C library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0175r0.html) - C++17 から`f`、`l`サフィックス付きのC関数を導入 +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 From d3cb0839fde2f6b6534b5ba13db0c0c045804d9d Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 16 Feb 2023 12:56:27 +0900 Subject: [PATCH 0182/3948] =?UTF-8?q?abs,=20frexp,=20ilogb,=20ldexp=20:=20?= =?UTF-8?q?constexpr=E5=AF=BE=E5=BF=9C=20#1067?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cmath/abs.md | 43 +++++++++++++++++++++++++++++------- reference/cmath/frexp.md | 47 ++++++++++++++++++++++++++++++---------- reference/cmath/ilogb.md | 41 ++++++++++++++++++++++++++++++----- reference/cmath/ldexp.md | 44 ++++++++++++++++++++++++++++++------- 4 files changed, 142 insertions(+), 33 deletions(-) diff --git a/reference/cmath/abs.md b/reference/cmath/abs.md index 4f35a45bf2..1505b65f0c 100644 --- a/reference/cmath/abs.md +++ b/reference/cmath/abs.md @@ -6,15 +6,25 @@ ```cpp namespace std { - float abs(float x); // (1) - double abs(double x); // (2) - long double abs(long double x); // (3) + float abs(float x); // (1) C++03からC++20まで - double abs(Integral x); // (4) C++11 から C++14 まで + double abs(double x); // (2) C++03からC++20まで - int abs(int x); // (5) C++17 から - long abs(long int x); // (6) C++17 から - long long abs(long long x); // (7) C++17 から + long double abs(long double x); // (3) C++03からC++20まで + + constexpr floating-point-type + abs(floating-point-type x); // (4) C++23 + + double abs(Integral x); // (5) C++11 から C++14 まで + + int abs(int x); // (6) C++17 + constexpr int abs(int x); // (6) C++23 + + long abs(long int x); // (7) C++17 + constexpr long abs(long int x); // (7) C++23 + + long long abs(long long x); // (8) C++17 + constexpr long long abs(long long x); // (8) C++23 } ``` * Integral[italic] @@ -22,6 +32,15 @@ namespace std { ## 概要 浮動小数点数型の絶対値を求める。abs は absolute value(絶対値)の略。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `int`に対するオーバーロード +- (7) : `long int`に対するオーバーロード +- (8) : `long long`に対するオーバーロード + ## 戻り値 引数 `x` の絶対値を返す。 @@ -31,7 +50,8 @@ namespace std { ## 備考 - $$ f(x) = | x | $$ -- 任意の整数型に対するオーバーロード(4)は C++11 で追加されたが、[一部の符号なし整数型に対して問題を引き起こす](http://wg21.cmeerw.net/lwg/issue2192)ことから C++17 で削除され、符号付き整数型に対するオーバーロード(5),(6),(7)が追加された。 +- 任意の整数型に対するオーバーロード(5)は C++11 で追加されたが、[一部の符号なし整数型に対して問題を引き起こす](http://wg21.cmeerw.net/lwg/issue2192)ことから C++17 で削除され、符号付き整数型に対するオーバーロード(6),(7),(8)が追加された +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -76,3 +96,10 @@ namespace std { } } ``` + + +## 参照 +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/frexp.md b/reference/cmath/frexp.md index edef8a649a..27e351ad45 100644 --- a/reference/cmath/frexp.md +++ b/reference/cmath/frexp.md @@ -5,25 +5,46 @@ ```cpp namespace std { - float frexp(float value, int* exp); - double frexp(double value, int* exp); - long double frexp(long double value, int* exp); - - double frexp(Integral value, int* exp); // C++11 から - - float frexpf(float value, int* exp); // C++17 から - long double frexpl(long double value, int* exp); // C++17 から + float frexp(float value, int* exp); // (1) C++03からC++20まで + double frexp(double value, int* exp); // (2) C++03からC++20まで + long double frexp(long double value, int* exp); // (3) C++03からC++20まで + + constexpr floating-point-type + frexp(floating-point-type value, int* exp); // (4) C++23 + + double + frexp(Integral value, int* exp); // (5) C++11 + constexpr double + frexp(Integral value, int* exp); // (5) C++23 + + float + frexpf(float value, int* exp); // (6) C++17 + constexpr float + frexpf(float value, int* exp); // (6) C++23 + + long double + frexpl(long double value, int* exp); // (7) C++17 + constexpr long double + frexpl(long double value, int* exp); // (7) C++23 } ``` * Integral[italic] ## 概要 -`frexp`関数 (fraction and exponent)は、浮動小数点数`value`を、正規化された仮数部と 2 の累乗へ分解する。 +`frexp`関数 (fraction and exponent) は、浮動小数点数`value`を、正規化された仮数部と 2 の累乗へ分解する。 この関数は、与えられた浮動小数点数`value`を仮数部と指数部に分解し、仮数部を戻り値で返し、指数を`*exp`に書き込んで返す。 この関数と反対に、[`std::ldexp()`](ldexp.md)関数を使用することで、仮数部と指数部の値から浮動小数点数を作り出せる。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 引数 `value` が浮動小数点数ではない、もしくは2の乗数が `int` の範囲外である場合、戻り値は未規定。 @@ -39,7 +60,8 @@ C++11 以降では、処理系が IEC 60559 に準拠している場合([`std: - `value = ±0` の場合、戻り値は `±0` となり、`*exp` にはゼロが設定される。 - `value = ±∞` の場合、戻り値は `±∞` となり、`*exp` には未規定の値が設定される。 - `value` が NaN の場合、戻り値は NaN となり、`*exp` には未規定の値が設定される。 -- `frexp` は浮動小数点例外を全く発生させない。 +- この関数は浮動小数点例外を発生させない。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -68,4 +90,7 @@ int main() ## 参照 - [Why does `frexp()` not yield scientific notation?](http://stackoverflow.com/questions/24928833/why-does-frexp-not-yield-scientific-notation) - `frexp()`が戻り値を`[1, 2)`の範囲ではなく、`[0.5, 1)`の範囲に収めるようにしている理由は、IEEE 754およびISO/IEC 60559が策定される前に作られた関数であることが理由と考えられる - +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/ilogb.md b/reference/cmath/ilogb.md index 7822ca28d0..7c1faa8e71 100644 --- a/reference/cmath/ilogb.md +++ b/reference/cmath/ilogb.md @@ -6,14 +6,27 @@ ```cpp namespace std { - int ilogb(float); - int ilogb(double); - int ilogb(long double); + int ilogb(float x); // (1) C++11からC++20まで + int ilogb(double x); // (2) C++11からC++20まで + int ilogb(long double x); // (3) C++11からC++20まで - int ilogb(Integral); + constexpr int + ilogb(floating-point-type x); // (3) C++23 - int ilogbf(float x); // C++17 から - int ilogbl(long double x); // C++17 から + int + ilogb(Integral); // (4) C++11 + constexpr int + ilogb(Integral); // (4) C++23 + + int + ilogbf(float x); // (5) C++17 + constexpr int + ilogbf(float x); // (5) C++23 + + int + ilogbl(long double x); // (6) C++17 + constexpr int + ilogbl(long double x); // (6) C++23 } ``` * Integral[italic] @@ -21,6 +34,14 @@ namespace std { ## 概要 `ilogb`関数(integer log binary)は、浮動小数点数 `x` の指数部を `int` として返す。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 `x` がゼロの場合は [`FP_ILOGB0`](fp_ilogb0.md) を、無限大の場合は [`INT_MAX`](/reference/climits/int_max.md) を、`NaN` の場合は [`FP_ILOGBNAN`](fp_ilogbnan.md) を返す。 @@ -34,6 +55,7 @@ namespace std { - 正しい結果が戻り値の型(`int`)の範囲で表現可能な場合は、戻り値は正確で、現在の丸め方式に依存しない。 - 正しい結果が戻り値の型(`int`)の範囲外の場合は、戻り値は未規定で、[`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外)が発生する。 - `x` がゼロ、無限大、あるいは NaN の場合には、[`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外)が発生する。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -74,3 +96,10 @@ ilogb(1e-309) = -1027 - [GCC](/implementation.md#gcc): 4.3.6 - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/ldexp.md b/reference/cmath/ldexp.md index 1887601829..c8e973c158 100644 --- a/reference/cmath/ldexp.md +++ b/reference/cmath/ldexp.md @@ -5,14 +5,27 @@ ```cpp namespace std { - float ldexp(float x, int exp); - double ldexp(double x, int exp); - long double ldexp(long double x, int exp); - - double ldexp(Integral x, int exp); // C++11 から - - float ldexpf(float x, int exp); // C++17 から - long double ldexpl(long double x, int exp); // C++17 から + float ldexp(float x, int exp); // (1) C++03からC++20まで + double ldexp(double x, int exp); // (2) C++03からC++20まで + long double ldexp(long double x, int exp); // (3) C++03からC++20まで + + constexpr floating-point-type + ldexp(floating-point-type x, int exp); // (4) C++23 + + double + ldexp(Integral x, int exp); // (5) C++11 + constexpr double + ldexp(Integral x, int exp); // (5) C++23 + + float + ldexpf(float x, int exp); // (6) C++17 + constexpr float + ldexpf(float x, int exp); // (6) C++23 + + long double + ldexpl(long double x, int exp); // (7) C++17 + constexpr long double + ldexpl(long double x, int exp); // (7) C++23 } ``` * Integral[italic] @@ -24,6 +37,14 @@ namespace std { この関数と反対に、[`std::frexp()`](frexp.md)関数を使用することで、浮動小数点数を仮数部と指数部に分解できる。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 x * 2exp @@ -34,6 +55,7 @@ namespace std { ## 備考 - オーバーフローエラー、アンダーフローエラーが発生した場合の挙動については、[``](../cmath.md) を参照。 - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、かつ、基数が 2 の場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`radix`](../limits/numeric_limits/radix.md)`() == 2`)、[`scalbn`](scalbn.md)`(x, exp)` と等価である。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -89,3 +111,9 @@ namespace std { } ``` * std::pow[link pow.md] + +## 参照 +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした From eaf722b020984fde1abdb2b50c1f39d8863ecb1b Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 16 Feb 2023 13:04:27 +0900 Subject: [PATCH 0183/3948] =?UTF-8?q?=20:=20lerp=E3=81=AE=E8=AA=AC?= =?UTF-8?q?=E6=98=8E=E3=82=92=E8=A3=9C=E8=B6=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cmath.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cmath.md b/reference/cmath.md index 3ac2fc19f3..484776a1d4 100644 --- a/reference/cmath.md +++ b/reference/cmath.md @@ -98,7 +98,7 @@ C++23で`constexpr`対応する関数の条件は以下: [`nearbyint`](cmath/nearbyint.md)は2. の条件を満たさないため、C++23では`constexpr`に対応しない。 -なお、C++20では[`lerp()`](cmath/lerp.md)のみ`constexpr`に対応している。これはC標準ライブラリからの移植ではなく、C++で標準化された関数だからである。 +なお、C++20では[`lerp()`](cmath/lerp.md)のみ`constexpr`に対応している。これはC標準ライブラリからの移植ではなく、C++で標準化された関数だからである ([`errno`](cerrno/errno.md)や浮動小数点例外のようなグローバル状態を使用しない)。 #### 拡張浮動小数点数型への対応 C++23では[``](stdfloat.md.nolink)に拡張浮動小数点数型が追加された。その対応として、以下のような`float`、`double`、`long double`に対するオーバーロードは、 From 182e098dccc8482b0d0965ebd32f76dd01406bdb Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 16 Feb 2023 13:21:37 +0900 Subject: [PATCH 0184/3948] =?UTF-8?q?=20:=20=E3=83=90=E3=83=BC?= =?UTF-8?q?=E3=82=B8=E3=83=A7=E3=83=B3=E5=B7=AE=E7=95=B0=E3=81=AB=E3=83=9A?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E5=86=85=E3=83=AA=E3=83=B3=E3=82=AF=E3=82=92?= =?UTF-8?q?=E3=81=A4=E3=81=91=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cmath.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/cmath.md b/reference/cmath.md index 484776a1d4..e493b5cc35 100644 --- a/reference/cmath.md +++ b/reference/cmath.md @@ -30,14 +30,14 @@ ## 標準Cライブラリとの差異 ``は基本的には、標準 C ライブラリの `` に準拠しているが、いくつかの変更点がある。 -### C++03のC90との差異 +### C++03のC90との差異 - 各関数は std 名前空間に定義されている。 - `fabs` と等価の関数 `abs` を追加している。 - `pow` の第 2 引数が `int` のオーバーロードを追加している。 - 各関数(上記 2 関数を含む)に対して、引数および戻り値の `double` に対応する箇所が `float` および `long double` になっているオーバーロードバージョンを追加している。 -### C++11のC99との差異 +### C++11のC99との差異 - 各関数は std 名前空間に定義されている。 - `fabs` と等価の関数 `abs` を追加している。 - 引数に `double` を含む各関数(上記 `abs` を含む)に対して、引数および戻り値の `double` に対応する箇所が `float` と `long double` のオーバーロードバージョンを追加している。 @@ -85,7 +85,7 @@ * Promoted[italic] -### C++23での差異 +### C++23での差異 #### constexpr対応 C++23では、多くの数学関数が`constexpr`に対応し、定数式内で使用できるようになった。C++23時点では、コンパイラベンダの負担が低い機能を`constexpr`対応した。 From 019f15edfc2908d7d6678f7199696635dc2a7e92 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 16 Feb 2023 15:03:10 +0900 Subject: [PATCH 0185/3948] =?UTF-8?q?=20:=20constexpr=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C=E3=81=AE=E8=AA=AC=E6=98=8E=E8=A6=8B=E7=9B=B4=E3=81=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cmath.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reference/cmath.md b/reference/cmath.md index e493b5cc35..c16eeaa1a8 100644 --- a/reference/cmath.md +++ b/reference/cmath.md @@ -87,7 +87,7 @@ ### C++23での差異 #### constexpr対応 -C++23では、多くの数学関数が`constexpr`に対応し、定数式内で使用できるようになった。C++23時点では、コンパイラベンダの負担が低い機能を`constexpr`対応した。 +C++23では、多くの数学関数が`constexpr`に対応し、定数式内で使用できるようになった。C++23時点では、コンパイラベンダの負担が少ない機能を`constexpr`対応した。 C++23で`constexpr`対応する関数の条件は以下: @@ -98,6 +98,8 @@ C++23で`constexpr`対応する関数の条件は以下: [`nearbyint`](cmath/nearbyint.md)は2. の条件を満たさないため、C++23では`constexpr`に対応しない。 +ただし、コンパイラが先行して`constexpr`非対応の関数も対応している可能性がある。 + なお、C++20では[`lerp()`](cmath/lerp.md)のみ`constexpr`に対応している。これはC標準ライブラリからの移植ではなく、C++で標準化された関数だからである ([`errno`](cerrno/errno.md)や浮動小数点例外のようなグローバル状態を使用しない)。 #### 拡張浮動小数点数型への対応 From be98598467b9fc65906070c8edfd69ea1f243601 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 16 Feb 2023 17:55:10 +0900 Subject: [PATCH 0186/3948] =?UTF-8?q?=20:=20=E6=AE=8B=E3=82=8A?= =?UTF-8?q?=E3=81=AEconstexpr=E5=AF=BE=E5=BF=9C=20#1067?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cmath.md | 14 ++-- reference/cmath/abs.md | 2 +- reference/cmath/ceil.md | 45 +++++++++--- reference/cmath/copysign.md | 62 ++++++++++++++--- reference/cmath/fabs.md | 46 ++++++++++--- reference/cmath/fdim.md | 51 ++++++++++++-- reference/cmath/floor.md | 45 +++++++++--- reference/cmath/fma.md | 67 +++++++++++++++--- reference/cmath/fmax.md | 53 +++++++++++--- reference/cmath/fmin.md | 54 ++++++++++++--- reference/cmath/fmod.md | 46 ++++++++++--- reference/cmath/fpclassify.md | 30 ++++++-- reference/cmath/isfinite.md | 32 +++++++-- reference/cmath/isgreater.md | 36 +++++++--- reference/cmath/isgreaterequal.md | 36 +++++++--- reference/cmath/isinf.md | 32 +++++++-- reference/cmath/isless.md | 36 +++++++--- reference/cmath/islessequal.md | 37 +++++++--- reference/cmath/islessgreater.md | 37 +++++++--- reference/cmath/isnan.md | 32 +++++++-- reference/cmath/isnormal.md | 32 +++++++-- reference/cmath/isunordered.md | 36 +++++++--- reference/cmath/ldexp.md | 2 +- reference/cmath/llround.md | 44 +++++++++--- reference/cmath/logb.md | 44 +++++++++--- reference/cmath/lround.md | 44 +++++++++--- reference/cmath/modf.md | 64 +++++++++++++---- reference/cmath/nextafter.md | 63 ++++++++++++++--- reference/cmath/nexttoward.md | 65 +++++++++++++++--- reference/cmath/remainder.md | 49 ++++++++++--- reference/cmath/remquo.md | 67 ++++++++++++++++-- reference/cmath/round.md | 45 +++++++++--- reference/cmath/scalbln.md | 110 ++++++++++++++++++++++++++++++ reference/cmath/scalbn.md | 41 ++++++++--- reference/cmath/signbit.md | 34 +++++++-- reference/cmath/trunc.md | 45 +++++++++--- 36 files changed, 1307 insertions(+), 271 deletions(-) create mode 100644 reference/cmath/scalbln.md diff --git a/reference/cmath.md b/reference/cmath.md index c16eeaa1a8..d444ed428f 100644 --- a/reference/cmath.md +++ b/reference/cmath.md @@ -255,13 +255,13 @@ C++03 までの場合、[`errno`](cerrno/errno.md) でしか通知されない | 名前 | 説明 | 対応バージョン | |-----------|----------------------------------|-------| -| [`ldexp`](cmath/ldexp.md) | 2 の累乗との乗算 | | -| [`frexp`](cmath/frexp.md) | 仮数部と 2 の累乗への分解 | | -| [`ilogb`](cmath/ilogb.md) | 指数部を符号付き整数値として抽出 | C++11 | -| [`logb`](cmath/logb.md) | 指数部を浮動小数点数値として抽出 | C++11 | -| [`modf`](cmath/modf.md) | 整数部と小数部への分解 | | -| [`scalbn`](cmath/scalbn.md) | 内部表現の基数 (`FLT_RADIX`) の累乗との乗算 | C++11 | -| [`scalbln`](cmath/scalbn.md) | 内部表現の基数 (`FLT_RADIX`) の累乗との乗算 | C++11 | +| [`ldexp`](cmath/ldexp.md) | 2 の累乗との乗算 | | +| [`frexp`](cmath/frexp.md) | 仮数部と 2 の累乗への分解 | | +| [`ilogb`](cmath/ilogb.md) | 指数部を符号付き整数値として抽出 | C++11 | +| [`logb`](cmath/logb.md) | 指数部を浮動小数点数値として抽出 | C++11 | +| [`modf`](cmath/modf.md) | 整数部と小数部への分解 | | +| [`scalbn`](cmath/scalbn.md) | 内部表現の基数 (`FLT_RADIX`) の累乗との乗算 | C++11 | +| [`scalbln`](cmath/scalbln.md) | 内部表現の基数 (`FLT_RADIX`) の累乗との乗算。乗数として`long`をとる | C++11 | ## 累乗・冪根と絶対値 diff --git a/reference/cmath/abs.md b/reference/cmath/abs.md index 1505b65f0c..2fd23a2317 100644 --- a/reference/cmath/abs.md +++ b/reference/cmath/abs.md @@ -75,7 +75,7 @@ abs(-1.5) = 1.500000 ``` ### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 diff --git a/reference/cmath/ceil.md b/reference/cmath/ceil.md index d2f6c3cf1d..dd4d662f7a 100644 --- a/reference/cmath/ceil.md +++ b/reference/cmath/ceil.md @@ -5,14 +5,27 @@ ```cpp namespace std { - float ceil(float x); - double ceil(double x); - long double ceil(long double x); - - double ceil(Integral x); // C++11 から - - float ceilf(float x); // C++17 から - long double ceill(long double x); // C++17 から + float ceil(float x); // (1) C++03からC++20まで + double ceil(double x); // (2) C++03からC++20まで + long double ceil(long double x); // (3) C++03からC++20まで + + constexpr floating-point-type + ceil(floating-point-type x); // (4) C++23 + + double + ceil(Integral x); // (5) C++11 + constexpr double + ceil(Integral x); // (5) C++23 + + float + ceilf(float x); // (6) C++17 + constexpr float + ceilf(float x); // (6) C++17 + + long double + ceill(long double x); // (7) C++17 + constexpr long double + ceill(long double x); // (7) C++17 } ``` * Integral[italic] @@ -20,6 +33,14 @@ namespace std { ## 概要 引数 `x` 以上で最小の整数値を得る。(天井関数) +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 引数 `x` 以上で最小の整数値 @@ -35,6 +56,7 @@ namespace std { また、本関数の挙動は、丸めモードが [`FE_UPWARD`](/reference/cfenv/fe_upward.md) に設定されている時の [`rint`](rint.md)、あるいは [`nearbyint`](nearbyint.md) のいずれかと等価である。 したがって、本関数において戻り値が引数 `x` と異なる場合に例外 [`FE_INEXACT`](/reference/cfenv/fe_inexact.md) が発生するか否かは実装依存である。 なお、本関数の挙動は、現在の丸めモードには依存しない。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -97,3 +119,10 @@ FE_INEXACT = true ``` 引数と結果が異なる場合に例外 `FE_INEXACT` が発生するか否かは実装によって異なる。 + + +## 参照 +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/copysign.md b/reference/cmath/copysign.md index edb18a5f76..22f5656c61 100644 --- a/reference/cmath/copysign.md +++ b/reference/cmath/copysign.md @@ -6,14 +6,40 @@ ```cpp namespace std { - double copysign(double x, double y); - float copysign(float x, float y); - long double copysign(long double x, long double y); - - Integral copysign(Integral x, Integral y); - - float copysignf(float x, float y); // C++17 から - long double copysignl(long double x, long double y); // C++17 から + float + copysign(float x, + float y); // (1) C++11からC++20まで + double + copysign(double x, + double y); // (2) C++11からC++20まで + long double + copysign(long double x, + long double y); // (3) C++11からC++20まで + + constexpr floating-point-type + copysign(floating-point-type x, + floating-point-type y); // (4) C++23 + + Integral + copysign(Integral x + Integral y); // (5) C++11 + constexpr Integral + copysign(Integral x + Integral y); // (5) C++23 + + float + copysignf(float x, + float y); // (6) C++17 + constexpr float + copysignf(float x, + float y); // (6) C++23 + + long double + copysignl(long double x, + long double y); // (7) C++17 + constexpr long double + copysignl(long double x, + long double y); // (7) C++23 } ``` * Integral[italic] @@ -21,6 +47,14 @@ namespace std { ## 概要 `x`の絶対値に`y`の符号が付いた値を生成する。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 `x`の絶対値に`y`の符号が付いた値を返す。 @@ -29,7 +63,8 @@ namespace std { ## 備考 -符号付きゼロを表現するが負のゼロを取り扱わない実装では、この関数はゼロを正と見なす。 +- 符号付きゼロを表現するが負のゼロを取り扱わない実装では、この関数はゼロを正と見なす。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -55,7 +90,7 @@ int main() ``` ### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 @@ -102,3 +137,10 @@ namespace std { - [GCC](/implementation.md#gcc): 4.3 - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/fabs.md b/reference/cmath/fabs.md index 3fb04cb1ea..dff3100ed3 100644 --- a/reference/cmath/fabs.md +++ b/reference/cmath/fabs.md @@ -6,14 +6,27 @@ ```cpp namespace std { - float fabs(float x); - double fabs(double x); - long double fabs(long double x); - - double fabs(Integral x); // C++11 から - - float fabsf(float x); // C++17 から - long double fabsl(long double x); // C++17 から + float fabs(float x); // (1) C++03からC++20まで + double fabs(double x); // (2) C++03からC++20まで + long double fabs(long double x); // (3) C++03からC++20まで + + constexpr floating-point-type + fabs(floating-point-type x); // (4) C++23 + + double + fabs(Integral x); // (5) C++11 + constexpr double + fabs(Integral x); // (5) C++23 + + float + fabsf(float x); // (6) C++17 + constexpr float + fabsf(float x); // (6) C++23 + + long double + fabsl(long double x); // (7) C++17 + constexpr long double + fabsl(long double x); // (7) C++17 } ``` * Integral[italic] @@ -21,6 +34,14 @@ namespace std { ## 概要 算術型の絶対値を求める。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 引数 `x` の絶対値を返す。 @@ -34,6 +55,7 @@ namespace std { - `value = ±0` の場合、戻り値は `+0` となる。 - `value = ±∞` の場合、戻り値は `+∞` となる。 - 戻り値は正確で、現在の丸め方式には依存しない。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -77,7 +99,7 @@ fabs(-∞) = inf - [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 #### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 @@ -108,3 +130,9 @@ namespace std { * signbit[link signbit.md] * is_integral[link ../type_traits/is_integral.md] * enable_if[link ../type_traits/enable_if.md] + +## 参照 +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/fdim.md b/reference/cmath/fdim.md index 10fbfd9948..34f6d84bd7 100644 --- a/reference/cmath/fdim.md +++ b/reference/cmath/fdim.md @@ -6,14 +6,30 @@ ```cpp namespace std { - float fdim(float x, float y); - double fdim(double x, double y); - long double fdim(long double x, long double y); + float fdim(float x, float y); // (1) C++11からC++20まで + double fdim(double x, double y); // (2) C++11からC++20まで + long double fdim(long double x, long double y); // (3) C++11からC++20まで - Promoted fdim(Arithmetic1 x, Arithmetic2 y); + constexpr floating-point-type + fdim(floating-point-type x, + floating-point-type y); // (4) C++23 - float fdimf(float x, float y); // C++17 から - long double fdiml(long double x, long double y); // C++17 から + Promoted + fdim(Arithmetic1 x, + Arithmetic2 y); // (5) C++11 + constexpr Promoted + fdim(Arithmetic1 x, + Arithmetic2 y); // (5) C++23 + + float + fdimf(float x, float y); // (6) C++17 + constexpr float + fdimf(float x, float y); // (6) C++23 + + long double + fdiml(long double x, long double y); // (7) C++17 + constexpr long double + fdiml(long double x, long double y); // (7) C++23 } ``` * Promoted[italic] @@ -23,11 +39,25 @@ namespace std { ## 概要 算術型の正の差を求める。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 算術型に対するオーバーロード (大きい精度にキャストして計算される。整数は`double`で計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + + ## 戻り値 引数の正の差を返す。 `x - y > 0` の場合は `x - y` を、それ以外の場合は `+0` を返す。 + +## 備考 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された + + ## 例 ```cpp example #include @@ -61,6 +91,13 @@ fdim(+1.0, 0.0) = +1 - [Visual C++](/implementation.md#visual_cpp): ?? #### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 + + +## 参照 +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/floor.md b/reference/cmath/floor.md index 8c3c776937..b3bb3b5b99 100644 --- a/reference/cmath/floor.md +++ b/reference/cmath/floor.md @@ -5,14 +5,27 @@ ```cpp namespace std { - float floor(float x); - double floor(double x); - long double floor(long double x); - - double floor(Integral x); // C++11 から - - float floorf(float x); // C++17 から - long double floorl(long double x); // C++17 から + float floor(float x); // (1) C++03からC++20まで + double floor(double x); // (2) C++03からC++20まで + long double floor(long double x); // (3) C++03からC++20まで + + constexpr floating-point-type + floor(floating-point-type x); // (4) C++23 + + double + floor(Integral x); // (5) C++11 + constexpr double + floor(Integral x); // (5) C++23 + + float + floorf(float x); // (6) C++17 + constexpr float + floorf(float x); // (6) C++23 + + long double + floorl(long double x); // (7) C++17 + constexpr long double + floorl(long double x); // (7) C++23 } ``` * Integral[italic] @@ -20,6 +33,14 @@ namespace std { ## 概要 引数 `x` 以下で最大の整数値を得る。(床関数) +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 引数 `x` 以下で最大の整数値 @@ -35,6 +56,7 @@ namespace std { また、本関数の挙動は、丸めモードが [`FE_DOWNWARD`](/reference/cfenv/fe_downward.md) に設定されている時の [`rint`](rint.md)、あるいは [`nearbyint`](nearbyint.md) のいずれかと等価である。 したがって、本関数において戻り値が引数 `x` と異なる場合に例外 [`FE_INEXACT`](/reference/cfenv/fe_inexact.md) が発生するか否かは実装依存である。 なお、本関数の挙動は、現在の丸めモードには依存しない。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -97,3 +119,10 @@ FE_INEXACT = true ``` 引数と結果が異なる場合に例外 `FE_INEXACT` が発生するか否かは実装によって異なる。 + + +## 参照 +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/fma.md b/reference/cmath/fma.md index 77924d164a..7e633925fe 100644 --- a/reference/cmath/fma.md +++ b/reference/cmath/fma.md @@ -6,14 +6,50 @@ ```cpp namespace std { - float fma(float x, float y, float z); - double fma(double x, double y, double z); - long double fma(long double x, long double y, long double z); - - Promoted fma(Arithmetic1 x, Arithmetic2 y, Arithmetic3 z); - - float fmaf(float x, float y, float z); // C++17 から - long double fmal(long double x, long double y, long double z); // C++17 から + float + fma(float x, + float y, + float z); // (1) C++11からC++20まで + double + fma(double x, + double y, + double z); // (2) C++11からC++20まで + long double + fma(long double x, + long double y, + long double z); // (3) C++11からC++20まで + + constexpr floating-point-type + fma(floating-point-type x, + floating-point-type y, + floating-point-type z); // (4) C++23 + + Promoted + fma(Arithmetic1 x, + Arithmetic2 y, + Arithmetic3 z); // (5) C++11 + constexpr Promoted + fma(Arithmetic1 x, + Arithmetic2 y, + Arithmetic3 z); // (5) C++23 + + float + fmaf(float x, + float y, + float z); // (6) C++17 + constexpr float + fmaf(float x, + float y, + float z); // (6) C++23 + + long double + fmal(long double x, + long double y, + long double z); // (7) C++17 + constexpr long double + fmal(long double x, + long double y, + long double z); // (7) C++23 } ``` * Promoted[italic] @@ -29,6 +65,14 @@ namespace std { `fma` は fused multiply-add の略。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 算術型に対するオーバーロード (大きい精度にキャストして計算される。整数は`double`で計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 `x * y + z` を無限精度で計算した後、現在の丸めモードで丸めた結果 @@ -46,6 +90,7 @@ namespace std { - 本関数が単純に `x * y + z` を計算するのと等価か、より速い場合には、引数の型に応じて [`FP_FAST_FMA`](fp_fast_fma.md)(`double` の場合)、[`FP_FAST_FMAF`](fp_fast_fmaf.md)(`float` の場合)、[`FP_FAST_FMAL`](fp_fast_fmal.md)(`long double` の場合)と言ったマクロが定義される。 これらのマクロは、一般的に本関数がハードウェアによる積和演算命令を使用している場合にのみ定義される。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -162,3 +207,9 @@ FE_INVALID inf * 1.0 + -inf = -nan ``` + +## 参照 +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/fmax.md b/reference/cmath/fmax.md index 9bc851fe16..897dc964cd 100644 --- a/reference/cmath/fmax.md +++ b/reference/cmath/fmax.md @@ -6,14 +6,31 @@ ```cpp namespace std { - float fmax(float x, float y); - double fmax(double x, double y); - long double fmax(long double x, long double y); - - Promoted fmax(Arithmetic1 x, Arithmetic2 y); - - float fmaxf(float x, float y); // C++17 から - long double fmaxl(long double x, long double y); // C++17 から + float fmax(float x, float y); // (1) C++11からC++20まで + double fmax(double x, double y); // (2) C++11からC++20まで + long double + fmax(long double x, long double y); // (3) C++11からC++20まで + + constexpr floating-point-type + fmax(floating-point-type x, + floating-point-type y); // (4) C++23 + + Promoted + fmax(Arithmetic1 x, + Arithmetic2 y); // (5) C++11 + constexpr Promoted + fmax(Arithmetic1 x, + Arithmetic2 y); // (5) C++23 + + float + fmaxf(float x, float y); // (6) C++17 + constexpr float + fmaxf(float x, float y); // (6) C++23 + + long double + fmaxl(long double x, long double y); // (7) C++17 + constexpr long double + fmaxl(long double x, long double y); // (7) C++17 } ``` * Promoted[italic] @@ -23,6 +40,15 @@ namespace std { ## 概要 算術型の最大値を求める。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 算術型に対するオーバーロード (大きい精度にキャストして計算される。整数は`double`で計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + + ## 戻り値 引数の最大値を返す。 @@ -32,6 +58,8 @@ namespace std { - 引数の1つが NaN の場合 NaN でない方を返す。 - 引数が2つとも NaN の場合 NaN を返す。 - 理想的には `fmax(-0.0, +0.0)` は `+0` を返す。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された + ## 例 ```cpp example @@ -71,7 +99,7 @@ fmax( nan, nan) = +nan - [Visual C++](/implementation.md#visual_cpp): ?? #### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 @@ -105,3 +133,10 @@ namespace std { * std::enable_if[link ../type_traits/enable_if.md] * std::is_arithmetic[link ../type_traits/is_arithmetic.md] * std::common_type[link ../type_traits/common_type.md] + + +## 参照 +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/fmin.md b/reference/cmath/fmin.md index ad1d547abf..d342f48a40 100644 --- a/reference/cmath/fmin.md +++ b/reference/cmath/fmin.md @@ -6,14 +6,31 @@ ```cpp namespace std { - float fmin(float x, float y); - double fmin(double x, double y); - long double fmin(long double x, long double y); - - Promoted fmin(Arithmetic1 x, Arithmetic2 y); - - float fminf(float x, float y); // C++17 から - long double fminl(long double x, long double y); // C++17 から + float fmin(float x, float y); // (1) C++11からC++20まで + double fmin(double x, double y); // (2) C++11からC++20まで + long double + fmin(long double x, long double y); // (3) C++11からC++20まで + + constexpr floating-point-type + fmin(floating-point-type x, + floating-point-type y); // (4) C++23 + + Promoted + fmin(Arithmetic1 x, + Arithmetic2 y); // (5) C++11 + constexpr Promoted + fmin(Arithmetic1 x, + Arithmetic2 y); // (5) C++23 + + float + fminf(float x, float y); // (6) C++17 + constexpr float + fminf(float x, float y); // (6) C++17 + + long double + fminl(long double x, long double y); // (7) C++17 + constexpr long double + fminl(long double x, long double y); // (7) C++17 } ``` * Promoted[italic] @@ -23,15 +40,27 @@ namespace std { ## 概要 算術型の最小値を求める。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 算術型に対するオーバーロード (大きい精度にキャストして計算される。整数は`double`で計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + + ## 戻り値 引数の最小値を返す。 + ## 備考 - 戻り値は正確で、現在の丸めモードに依存しない。 - 処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 - 引数の1つが NaN の場合 NaN でない方を返す。 - 引数が2つとも NaN の場合 NaN を返す。 - 理想的には `fmin(-0.0, +0.0)` は `-0` を返す。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された + ## 例 ```cpp example @@ -71,7 +100,7 @@ fmin( nan, nan) = +nan - [Visual C++](/implementation.md#visual_cpp): ?? #### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 @@ -105,3 +134,10 @@ namespace std { * std::enable_if[link ../type_traits/enable_if.md] * std::is_arithmetic[link ../type_traits/is_arithmetic.md] * std::common_type[link ../type_traits/common_type.md] + + +## 参照 +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/fmod.md b/reference/cmath/fmod.md index 1666e78319..b74689fa3a 100644 --- a/reference/cmath/fmod.md +++ b/reference/cmath/fmod.md @@ -5,14 +5,31 @@ ```cpp namespace std { - double fmod(double x, double y); - float fmod(float x, float y); - long double fmod(long double x, long double y); - - Integral fmod(Integral x, Integral y); // C++11 から - - float fmodf(float x, float y); // C++17 から - long double fmodl(long double x, long double y); // C++17 から + float fmod(float x, float y); // (1) C++03からC++20まで + double fmod(double x, double y); // (2) C++03からC++20まで + long double fmod(long double x, + long double y); // (3) C++03からC++20まで + + constexpr floating-point-type + fmod(floating-point-type x, + floating-point-type y); // (4) C++23 + + Integral + fmod(Integral x, Integral y); // (5) C++11 + constexpr Integral + fmod(Integral x, Integral y); // (5) C++23 + + float + fmodf(float x, float y); // (6) C++17 + constexpr float + fmodf(float x, float y); // (6) C++23 + + long double + fmodl(long double x, + long double y); // (7) C++17 + constexpr long double + fmodl(long double x, + long double y); // (8) C++17 } ``` * Integral[italic] @@ -22,6 +39,14 @@ namespace std { 整数に対する剰余は`%`演算子で求められるが、浮動小数点数に対しては本関数を使用する必要がある。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 `x / y`の余りを返す。 @@ -97,3 +122,8 @@ fmod(6.3, 3.15) = 0 fmod(6, 2) = 0 ``` +## 参照 +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/fpclassify.md b/reference/cmath/fpclassify.md index f855a47acd..16242d32d6 100644 --- a/reference/cmath/fpclassify.md +++ b/reference/cmath/fpclassify.md @@ -6,13 +6,17 @@ ```cpp namespace std { - int fpclassify(float x); + int fpclassify(float x); // (1) C++11からC++20まで + int fpclassify(double x); // (2) C++11からC++20まで + int fpclassify(long double x); // (3) C++11からC++20まで - int fpclassify(double x); + constexpr int + fpclassify(floating-point-type x); // (4) C++23 - int fpclassify(long double x); - - int fpclassify(Integral x); + int + fpclassify(Integral x); // (5) C++11 + constexpr int + fpclassify(Integral x); // (5) C++23 } ``` * Integral[italic] @@ -21,6 +25,12 @@ namespace std { ## 概要 指定された値の数値分類を返す。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) + ## 戻り値 引数 `x` で指定された値の数値分類を表すマクロの整数値を返す。 @@ -37,7 +47,8 @@ namespace std { ## 備考 -本関数は、C 言語の `fpclassify` マクロと等価の機能を持つ。 +- C標準ライブラリでは`fpclassify`は関数マクロとして定義されるが、C++標準ライブラリでは関数として定義される +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -74,3 +85,10 @@ true true true ``` + + +## 参照 +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/isfinite.md b/reference/cmath/isfinite.md index 12e54f7c8a..395305d823 100644 --- a/reference/cmath/isfinite.md +++ b/reference/cmath/isfinite.md @@ -6,11 +6,17 @@ ```cpp namespace std { - bool isfinite(float x); - bool isfinite(double x); - bool isfinite(long double x); + bool isfinite(float x); // (1) C++11からC++20まで + bool isfinite(double x); // (2) C++11からC++20まで + bool isfinite(long double x); // (3) C++11からC++20まで - bool isfinite(Integral x); + constexpr bool + isfinite(floating-point-type x); // (4) C++23 + + bool + isfinite(Integral x); // (5) C++11 + constexpr bool + isfinite(Integral x); // (5) C++23 } ``` * Integral[italic] @@ -18,13 +24,20 @@ namespace std { ## 概要 数値が有限(finite value)であるか判定する。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) + ## 戻り値 パラメータ`x`がゼロ、非正規化数、正規化数のいずれかであり、無限大とNaNのいずれでもない場合に有限値であると見なし、`true`を返す。そうでない場合、`false`を返す。 ## 備考 -C標準ライブラリでは`isfinite`は関数マクロとして定義されるが、C++標準ライブラリでは関数として定義される。 +- C標準ライブラリでは`isfinite`は関数マクロとして定義されるが、C++標準ライブラリでは関数として定義される +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -73,7 +86,7 @@ int main() ``` ### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 @@ -87,3 +100,10 @@ int main() - [GCC](/implementation.md#gcc): 4.3 - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/isgreater.md b/reference/cmath/isgreater.md index 7b7cd8a32f..37537cceea 100644 --- a/reference/cmath/isgreater.md +++ b/reference/cmath/isgreater.md @@ -6,13 +6,18 @@ ```cpp namespace std { - bool isgreater(double x, double y); - - bool isgreater(float x, float y); - - bool isgreater(long double x, long double y); - - bool isgreater(Integral x, Integral y); + bool isgreater(float x, float y); // (1) C++11からC++20まで + bool isgreater(double x, double y); // (2) C++11からC++20まで + bool isgreater(long double x, long double y); // (3) C++11からC++20まで + + constexpr bool + isgreater(floating-point-type x, + floating-point-type y); // (4) C++23 + + bool + isgreater(Integral x, Integral y); // (5) C++11 + constexpr bool + isgreater(Integral x, Integral y); // (5) C++23 } ``` * Integral[italic] @@ -20,6 +25,11 @@ namespace std { ## 概要 浮動小数点数について、左辺が右辺より大きいかを判定する。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) ## 戻り値 @@ -29,8 +39,9 @@ namespace std { ## 備考 -- C標準ライブラリでは本関数は関数マクロとして定義されるが、C++標準ライブラリでは関数として定義される。 -- C標準ライブラリでは本関数は`int`型を戻り値とするが、C++標準ライブラリでは`bool`型を戻り値とする。 +- C標準ライブラリでは本関数は関数マクロとして定義されるが、C++標準ライブラリでは関数として定義される +- C標準ライブラリでは本関数は`int`型を戻り値とするが、C++標準ライブラリでは`bool`型を戻り値とする +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -92,3 +103,10 @@ isgreater(nan, nan) = false - [GCC](/implementation.md#gcc): 4.3 - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/isgreaterequal.md b/reference/cmath/isgreaterequal.md index 465af642e5..c8c03b169a 100644 --- a/reference/cmath/isgreaterequal.md +++ b/reference/cmath/isgreaterequal.md @@ -6,13 +6,18 @@ ```cpp namespace std { - bool isgreaterequal(double x, double y); - - bool isgreaterequal(float x, float y); - - bool isgreaterequal(long double x, long double y); - - bool isgreaterequal(Integral x, Integral y); + bool isgreaterequal(float x, float y); // (1) C++11からC++20まで + bool isgreaterequal(double x, double y); // (2) C++11からC++20まで + bool isgreaterequal(long double x, long double y); // (3) C++11からC++20まで + + constexpr bool + isgreaterequal(floating-point-type x, + floating-point-type y); // (4) C++23 + + bool + isgreaterequal(Integral x, Integral y); // (5) C++11 + constexpr bool + isgreaterequal(Integral x, Integral y); // (5) C++23 } ``` * Integral[italic] @@ -20,6 +25,11 @@ namespace std { ## 概要 浮動小数点数について、左辺が右辺以上かを判定する。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) ## 戻り値 @@ -29,8 +39,9 @@ namespace std { ## 備考 -- C標準ライブラリでは本関数は関数マクロとして定義されるが、C++標準ライブラリでは関数として定義される。 -- C標準ライブラリでは本関数は`int`型を戻り値とするが、C++標準ライブラリでは`bool`型を戻り値とする。 +- C標準ライブラリでは本関数は関数マクロとして定義されるが、C++標準ライブラリでは関数として定義される +- C標準ライブラリでは本関数は`int`型を戻り値とするが、C++標準ライブラリでは`bool`型を戻り値とする +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -92,3 +103,10 @@ isgreaterequal(nan, nan) = false - [GCC](/implementation.md#gcc): 4.3 - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/isinf.md b/reference/cmath/isinf.md index dfcc505906..2dfd8e152f 100644 --- a/reference/cmath/isinf.md +++ b/reference/cmath/isinf.md @@ -6,11 +6,17 @@ ```cpp namespace std { - bool isinf(float x); - bool isinf(double x); - bool isinf(long double x); + bool isinf(float x); // (1) C++11からC++20まで + bool isinf(double x); // (2) C++11からC++20まで + bool isinf(long double x); // (3) C++11からC++20まで - bool isinf(Integral x); + constexpr bool + isinf(floating-point-type x); // (4) C++23 + + bool + isinf(Integral x); // (5) C++11 + constexpr bool + isinf(Integral x); // (5) C++23 } ``` * Integral[italic] @@ -18,13 +24,20 @@ namespace std { ## 概要 数値が無限大(infinity)であるか判定する。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) + ## 戻り値 パラメータ`x`が(正もしくは負の)無限大である場合、`true`を返す。そうでない場合、`false`を返す。 ## 備考 -C標準ライブラリでは`isinf`は関数マクロとして定義されるが、C++標準ライブラリでは関数として定義される。 +- C標準ライブラリでは`isinf`は関数マクロとして定義されるが、C++標準ライブラリでは関数として定義される +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -47,7 +60,7 @@ int main() ``` ### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 @@ -61,3 +74,10 @@ int main() - [GCC](/implementation.md#gcc): 4.3 - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/isless.md b/reference/cmath/isless.md index 4234fd8d4b..30e5078f2b 100644 --- a/reference/cmath/isless.md +++ b/reference/cmath/isless.md @@ -6,13 +6,18 @@ ```cpp namespace std { - bool isless(double x, double y); - - bool isless(float x, float y); - - bool isless(long double x, long double y); - - bool isless(Integral x, Integral y); + bool isless(float x, float y); // (1) C++11からC++20まで + bool isless(double x, double y); // (2) C++11からC++20まで + bool isless(long double x, long double y); // (3) C++11からC++20まで + + constexpr bool + isless(floating-point-type x, + floating-point-type y); // (4) C++23 + + bool + isless(Integral x, Integral y); // (5) C++11 + constexpr bool + isless(Integral x, Integral y); // (5) C++23 } ``` * Integral[italic] @@ -20,6 +25,11 @@ namespace std { ## 概要 浮動小数点数について、左辺が右辺より小さいかを判定する。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) ## 戻り値 @@ -29,8 +39,9 @@ namespace std { ## 備考 -- C標準ライブラリでは本関数は関数マクロとして定義されるが、C++標準ライブラリでは関数として定義される。 -- C標準ライブラリでは本関数は`int`型を戻り値とするが、C++標準ライブラリでは`bool`型を戻り値とする。 +- C標準ライブラリでは本関数は関数マクロとして定義されるが、C++標準ライブラリでは関数として定義される +- C標準ライブラリでは本関数は`int`型を戻り値とするが、C++標準ライブラリでは`bool`型を戻り値とする +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -92,3 +103,10 @@ isless(nan, nan) = false - [GCC](/implementation.md#gcc): 4.3 - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/islessequal.md b/reference/cmath/islessequal.md index cc8e059212..ffe0a4dd71 100644 --- a/reference/cmath/islessequal.md +++ b/reference/cmath/islessequal.md @@ -6,13 +6,18 @@ ```cpp namespace std { - bool islessequal(double x, double y); - - bool islessequal(float x, float y); - - bool islessequal(long double x, long double y); - - bool islessequal(Integral x, Integral y); + bool islessequal(float x, float y); // (1) C++11からC++20まで + bool islessequal(double x, double y); // (2) C++11からC++20まで + bool islessequal(long double x, long double y); // (3) C++11からC++20まで + + constexpr bool + islessequal(floating-point-type x, + floating-point-type y); // (4) C++23 + + bool + islessequal(Integral x, Integral y); // (5) C++11 + constexpr bool + islessequal(Integral x, Integral y); // (5) C++23 } ``` * Integral[italic] @@ -20,6 +25,12 @@ namespace std { ## 概要 浮動小数点数について、左辺が右辺以下かを判定する。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) + ## 戻り値 `x <= y`と等価の演算によって、`x`が`y`以下であれば`true`、そうでなければ`false`を返す。 @@ -28,8 +39,9 @@ namespace std { ## 備考 -- C標準ライブラリでは本関数は関数マクロとして定義されるが、C++標準ライブラリでは関数として定義される。 -- C標準ライブラリでは本関数は`int`型を戻り値とするが、C++標準ライブラリでは`bool`型を戻り値とする。 +- C標準ライブラリでは本関数は関数マクロとして定義されるが、C++標準ライブラリでは関数として定義される +- C標準ライブラリでは本関数は`int`型を戻り値とするが、C++標準ライブラリでは`bool`型を戻り値とする +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -91,3 +103,10 @@ islessequal(nan, nan) = false - [GCC](/implementation.md#gcc): 4.3 - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/islessgreater.md b/reference/cmath/islessgreater.md index 00c796d2ab..a31690fff1 100644 --- a/reference/cmath/islessgreater.md +++ b/reference/cmath/islessgreater.md @@ -6,13 +6,18 @@ ```cpp namespace std { - bool islessgreater(double x, double y); - - bool islessgreater(float x, float y); - - bool islessgreater(long double x, long double y); - - bool islessgreater(Integral x, Integral y); + bool islessgreater(float x, float y); // (1) C++11からC++20まで + bool islessgreater(double x, double y); // (2) C++11からC++20まで + bool islessgreater(long double x, long double y); // (3) C++11からC++20まで + + constexpr bool + islessgreater(floating-point-type x, + floating-point-type y); // (4) C++23 + + bool + islessgreater(Integral x, Integral y); // (5) C++11 + constexpr bool + islessgreater(Integral x, Integral y); // (5) C++23 } ``` * Integral[italic] @@ -20,6 +25,12 @@ namespace std { ## 概要 浮動小数点数について、左辺が右辺より小さい、もしくは左辺が右辺より大きい、のいずれかに該当するかを判定する。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) + ## 戻り値 `x < y || x > y`と等価の演算によって、`x`が`y`より小さい、もしくは`x`が`y`より大きければ`true`、そうでなければ`false`を返す。 @@ -28,8 +39,9 @@ namespace std { ## 備考 -- C標準ライブラリでは本関数は関数マクロとして定義されるが、C++標準ライブラリでは関数として定義される。 -- C標準ライブラリでは本関数は`int`型を戻り値とするが、C++標準ライブラリでは`bool`型を戻り値とする。 +- C標準ライブラリでは本関数は関数マクロとして定義されるが、C++標準ライブラリでは関数として定義される +- C標準ライブラリでは本関数は`int`型を戻り値とするが、C++標準ライブラリでは`bool`型を戻り値とする +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -91,3 +103,10 @@ islessgreater(nan, nan) = false - [GCC](/implementation.md#gcc): 4.3 - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/isnan.md b/reference/cmath/isnan.md index 1c41a90d53..d9ef052668 100644 --- a/reference/cmath/isnan.md +++ b/reference/cmath/isnan.md @@ -6,11 +6,17 @@ ```cpp namespace std { - bool isnan(float x); - bool isnan(double x); - bool isnan(long double x); + bool isnan(float x); // (1) C++11からC++20まで + bool isnan(double x); // (2) C++11からC++20まで + bool isnan(long double x); // (3) C++11からC++20まで - bool isnan(Integral x); + constexpr bool + isnan(floating-point-type x); // (4) C++23 + + bool + isnan(Integral x); // (5) C++11 + constexpr bool + isnan(Integral x); // (5) C++23 } ``` * Integral[italic] @@ -18,13 +24,20 @@ namespace std { ## 概要 数値が NaN であるか判定する。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) + ## 戻り値 パラメータ`x`がNaNである場合、`true`を返す。そうでない場合、`false`を返す。 ## 備考 -C標準ライブラリでは`isnan`は関数マクロとして定義されるが、C++標準ライブラリでは関数として定義される。 +- C標準ライブラリでは`isnan`は関数マクロとして定義されるが、C++標準ライブラリでは関数として定義される +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -51,7 +64,7 @@ int main() ``` ### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 @@ -65,3 +78,10 @@ int main() - [GCC](/implementation.md#gcc): 4.3 - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/isnormal.md b/reference/cmath/isnormal.md index 3e9aa6c8c4..108f92a633 100644 --- a/reference/cmath/isnormal.md +++ b/reference/cmath/isnormal.md @@ -6,11 +6,17 @@ ```cpp namespace std { - bool isnormal(float x); - bool isnormal(double x); - bool isnormal(long double x); + bool isnormal(float x); // (1) C++11からC++20まで + bool isnormal(double x); // (2) C++11からC++20まで + bool isnormal(long double x); // (3) C++11からC++20まで - bool isnormal(Integral x); + constexpr bool + isnormal(floating-point-type x); // (4) C++23 + + bool + isnormal(Integral x); // (5) C++11 + constexpr bool + isnormal(Integral x); // (5) C++23 } ``` * Integral[italic] @@ -18,13 +24,20 @@ namespace std { ## 概要 数値が正規化数(normalized value)であるか判定する。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) + ## 戻り値 パラメータ`x`がゼロ、非正規化数、無限大、NaNのいずれでもない場合に正規化数であると見なし、`true`を返す。そうでない場合、`false`を返す。 ## 備考 -C標準ライブラリでは`isnormal`は関数マクロとして定義されるが、C++標準ライブラリでは関数として定義される。 +- C標準ライブラリでは`isnormal`は関数マクロとして定義されるが、C++標準ライブラリでは関数として定義される +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -73,7 +86,7 @@ int main() ``` ### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 @@ -87,3 +100,10 @@ int main() - [GCC](/implementation.md#gcc): 4.3 - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/isunordered.md b/reference/cmath/isunordered.md index dd88c64415..3c29cc16aa 100644 --- a/reference/cmath/isunordered.md +++ b/reference/cmath/isunordered.md @@ -6,13 +6,18 @@ ```cpp namespace std { - bool isunordered(double x, double y); - - bool isunordered(float x, float y); - - bool isunordered(long double x, long double y); - - bool isunordered(Integral x, Integral y); + bool isunordered(float x, float y); // (1) C++11からC++20まで + bool isunordered(double x, double y); // (2) C++11からC++20まで + bool isunordered(long double x, long double y); // (3) C++11からC++20まで + + constexpr bool + isunordered(floating-point-type x, + floating-point-type y); // (4) C++23 + + bool + isunordered(Integral x, Integral y); // (5) C++11 + constexpr bool + isunordered(Integral x, Integral y); // (5) C++23 } ``` * Integral[italic] @@ -22,6 +27,11 @@ namespace std { NaNに対する順序付けはされないため、`x`と`y`のいずれかがNaNである場合、この関数は`true`を返す。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) ## 戻り値 @@ -29,8 +39,9 @@ NaNに対する順序付けはされないため、`x`と`y`のいずれかがNa ## 備考 -- C標準ライブラリでは本関数は関数マクロとして定義されるが、C++標準ライブラリでは関数として定義される。 -- C標準ライブラリでは本関数は`int`型を戻り値とするが、C++標準ライブラリでは`bool`型を戻り値とする。 +- C標準ライブラリでは本関数は関数マクロとして定義されるが、C++標準ライブラリでは関数として定義される +- C標準ライブラリでは本関数は`int`型を戻り値とするが、C++標準ライブラリでは`bool`型を戻り値とする +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -75,3 +86,10 @@ isunordered(1, inf) = false - [GCC](/implementation.md#gcc): 4.3 - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/ldexp.md b/reference/cmath/ldexp.md index c8e973c158..00ca443394 100644 --- a/reference/cmath/ldexp.md +++ b/reference/cmath/ldexp.md @@ -86,7 +86,7 @@ int main() ``` ### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 diff --git a/reference/cmath/llround.md b/reference/cmath/llround.md index 5bc0ff98f9..fe26bc96eb 100644 --- a/reference/cmath/llround.md +++ b/reference/cmath/llround.md @@ -6,14 +6,27 @@ ```cpp namespace std { - long long llround(float x); - long long llround(double x); - long long llround(long double x); - - long long llround(Integral x); - - long long int llroundf(float x); // C++17 から - long long int llroundl(long double x); // C++17 から + long long llround(float x); // (1) C++11からC++20まで + long long llround(double x); // (2) C++11からC++20まで + long long llround(long double x); // (3) C++11からC++20まで + + constexpr long long + llround(floating-point-type x); // (4) C++23 + + long long + llround(Integral x); // (5) C++11 + constexpr long long + llround(Integral x); // (5) C++23 + + long long + llroundf(float x); // (6) C++17 + constexpr long long + llroundf(float x); // (6) C++23 + + long long + llroundl(long double x); // (7) C++17 + constexpr long long + llroundl(long double x); // (7) C++23 } ``` * Integral[italic] @@ -23,6 +36,14 @@ namespace std { ここで引数 `x` の四捨五入とは、`x` を最も近い整数に丸めるが、`x` の小数部分が `0.5` の場合には、`x` の符号が正負のいずれであってもゼロから遠い方向に丸めることを指す。 具体例は下記の出力例を参照。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 引数 `x` を四捨五入により丸めた整数値を、[`long long`型](/lang/cpp11/long_long_type.md)型の範囲に収めて返す。 @@ -33,6 +54,7 @@ namespace std { - [`round`](round.md)関数と違い、本関数において戻り値が非整数型引数 `x` と異なる場合に、例外 [`FE_INEXACT`](/reference/cfenv/fe_inexact.md) を発生させる必要はない。 - 戻り値が[`long long`型](/lang/cpp11/long_long_type.md)型の範囲を超えた場合、定義域エラーが起こる可能性がある。その際の挙動については、[``](../cmath.md) を参照。 - なお、本関数の挙動は、現在の丸めモードには依存しない。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -82,3 +104,9 @@ llround(-2.9) = -3 - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/logb.md b/reference/cmath/logb.md index 9224c4552c..465951a6bd 100644 --- a/reference/cmath/logb.md +++ b/reference/cmath/logb.md @@ -6,14 +6,27 @@ ```cpp namespace std { - float logb(float x); - double logb(double x); - long double logb(long double x); - - double logb(Integral); - - float logbf(float x); // C++17 から - long double logbl(long double x); // C++17 から + float logb(float x); // (1) C++11からC++20まで + double logb(double x); // (2) C++11からC++20まで + long double logb(long double x); // (3) C++11からC++20まで + + constexpr floating-point-type + logb(floating-point-type x); // (4) C++23 + + double + logb(Integral); // (5) C++11 + constexpr double + logb(Integral); // (5) C++23 + + float + logbf(float x); // (6) C++17 + constexpr float + logbf(float x); // (6) C++23 + + long double + logbl(long double x); // (7) C++17 + constexpr long double + logbl(long double x); // (7) C++23 } ``` * Integral[italic] @@ -23,6 +36,14 @@ namespace std { `log` が名前に入っているが、通常の対数関数と異なり、引数の符号は無視されることに注意。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 `|x| *` [`FLT_RADIX`](/reference/cfloat/flt_radix.md)-logb(x) が範囲 `[1,` [`FLT_RADIX`](/reference/cfloat/flt_radix.md)`)` に収まるように指数を求めて返す。(非正規化数の場合でも正しい値が返る) @@ -36,6 +57,7 @@ namespace std { - `x = ±0` の場合、戻り値は `-∞` となり、[`FE_DIVBYZERO`](../cfenv/fe_divbyzero.md)(ゼロ除算浮動小数点例外)が発生する。 - `x = ±∞` の場合、戻り値は `+∞` となる。 - 戻り値は正確で、現在の丸め方式に依存しない。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -76,3 +98,9 @@ logb(1e-309) = -1027 - [GCC](/implementation.md#gcc): 4.3.6 - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/lround.md b/reference/cmath/lround.md index 705fe24d0e..788e89eaf1 100644 --- a/reference/cmath/lround.md +++ b/reference/cmath/lround.md @@ -6,14 +6,27 @@ ```cpp namespace std { - long lround(float x); - long lround(double x); - long lround(long double x); - - long lround(Integral x); - - long int lroundf(float x); // C++17 から - long int lroundl(long double x); // C++17 から + long lround(float x); // (1) C++11からC++20まで + long lround(double x); // (2) C++11からC++20まで + long lround(long double x); // (3) C++11からC++20まで + + constexpr long + lround(floating-point-type x); // (4) C++23 + + long + lround(Integral x); // (5) C++11 + constexpr long + lround(Integral x); // (5) C++23 + + long int + lroundf(float x); // (6) C++17 + constexpr long int + lroundf(float x); // (6) C++23 + + long int + lroundl(long double x); // (7) C++17 + constexpr long int + lroundl(long double x); // (7) C++23 } ``` * Integral[italic] @@ -23,6 +36,14 @@ namespace std { ここで引数 `x` の四捨五入とは、`x` を最も近い整数に丸めるが、`x` の小数部分が `0.5` の場合には、`x` の符号が正負のいずれであってもゼロから遠い方向に丸めることを指す。 具体例は下記の出力例を参照。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 引数 `x` を四捨五入により丸めた整数値を、`long`型の範囲に収めて返す。 @@ -33,6 +54,7 @@ namespace std { - [`round`](round.md)関数と違い、本関数において戻り値が非整数型引数 `x` と異なる場合に、例外 [`FE_INEXACT`](/reference/cfenv/fe_inexact.md) を発生させる必要はない。 - 戻り値が`long`型の範囲を超えた場合、定義域エラーが起こる可能性がある。その際の挙動については、[``](../cmath.md) を参照。 - なお、本関数の挙動は、現在の丸めモードには依存しない。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -82,3 +104,9 @@ lround(-2.9) = -3 - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/modf.md b/reference/cmath/modf.md index b20911a3ae..b0f620b46b 100644 --- a/reference/cmath/modf.md +++ b/reference/cmath/modf.md @@ -5,14 +5,34 @@ ```cpp namespace std { - double modf(double value, double* iptr); - float modf(float value, float* iptr); - long double modf(long double value, long double* iptr); - - double modf(Integral value, double* iptr); // C++11 から - - float modff(float value, float* iptr); // C++17 から - long double modfl(long double value, long double* iptr); // C++17 から + float + modf(float value, float* iptr); // (1) C++03からC++20まで + double + modf(double value, double* iptr); // (2) C++03からC++20まで + long double + modf(long double value, + long double* iptr); // (3) C++03からC++20まで + + constexpr floating-point-type + modf(floating-point-type value, + floating-point-type* iptr); // (4) C++23 + + double + modf(Integral value, double* iptr); // (5) C++11 + constexpr double + modf(Integral value, double* iptr); // (5) C++23 + + float + modff(float value, float* iptr); // (6) C++17 + constexpr float + modff(float value, float* iptr); // (6) C++23 + + long double + modfl(long double value, + long double* iptr); // (7) C++17 + constexpr long double + modfl(long double value, + long double* iptr); // (7) C++23 } ``` * Integral[italic] @@ -20,6 +40,14 @@ namespace std { ## 概要 浮動小数点数を、整数部と小数部に分解する。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 引数`value`の小数部を符号付きとして返す。また、引数`value`の整数部を`*iptr`に書き込む。 @@ -29,12 +57,13 @@ namespace std { ## 備考 - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。(複号同順) - - `value = ±∞` の場合、戻り値は `±0` となり、`*exp` には `±∞` が設定される。 - - `value` が NaN の場合、戻り値は NaN となり、`*exp` には NaN が設定される。 - - 戻り値は正確で、現在の丸め方式には依存しない。 + - `value = ±∞` の場合、戻り値は `±0` となり、`*exp` には `±∞` が設定される。 + - `value` が NaN の場合、戻り値は NaN となり、`*exp` には NaN が設定される。 + - 戻り値は正確で、現在の丸め方式には依存しない。 - C++11 で `value` が整数型のオーバーロードが追加されているが、`iptr` の型によって呼び出されるオーバーロードが一意に決まるため、存在意義は無いものと思われる。 (`value` に整数型、`iptr` に `nullptr` を渡した場合のみ当該オーバーロードによって呼び出しが曖昧ではなくなるが、その場合は未定義動作となってしまうため、本オーバーロードの存在はむしろ有害) +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -78,9 +107,9 @@ int main() ``` ### 備考 -- 特定の環境で `constexpr` 指定されている場合がある。(独自拡張) - - GCC 4.6.1 以上 -- GCC、Clang では、C++11 で追加されたオーバーロードは存在しない。 +- 特定の環境では、早期に `constexpr` 対応されている場合がある: + - GCC 4.6.1 以上 +- GCC、Clang では、C++11 で追加された整数型オーバーロードは存在しない。 ## 実装例 @@ -143,3 +172,10 @@ namespace std { * FE_TOWARDZERO[link ../cfenv/fe_towardzero.md] * enable_if[link ../type_traits/enable_if.md] * is_integral[link ../type_traits/is_integral.md] + + +## 参照 +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/nextafter.md b/reference/cmath/nextafter.md index 46184131b4..abecec6491 100644 --- a/reference/cmath/nextafter.md +++ b/reference/cmath/nextafter.md @@ -6,14 +6,40 @@ ```cpp namespace std { - float nextafter(float x, float y); - double nextafter(double x, double y); - long double nextafter(long double x, long double y); - - Promoted nextafter(Arithmetic1 x, Arithmetic2 y); - - float nextafterf(float x, float y); // C++17 から - long double nextafterl(long double x, long double y); // C++17 から + float + nextafter(float x, + float y); // (1) C++11からC++20まで + double + nextafter(double x, + double y); // (2) C++11からC++20まで + long double + nextafter(long double x, + long double y); // (3) C++11からC++20まで + + constexpr floating-point-type + nextafter(floating-point-type x, + floating-point-type y); // (4) C++23 + + Promoted + nextafter(Arithmetic1 x, + Arithmetic2 y); // (5) C++11 + constexpr Promoted + nextafter(Arithmetic1 x, + Arithmetic2 y); // (5) C++23 + + float + nextafterf(float x, + float y); // (6) C++17 + constexpr float + nextafterf(float x, + float y); // (6) C++23 + + long double + nextafterl(long double x, + long double y); // (7) C++17 + constexpr long double + nextafterl(long double x, + long double y); // (7) C++23 } ``` * Arithmetic1[italic] @@ -25,6 +51,14 @@ namespace std { この関数は、パラメータ`x`の値をパラメータ`y`の値の方向に対して、その環境で表現可能な最小の値だけ進める。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 算術型に対するオーバーロード (大きい精度にキャストして計算される。整数は`double`で計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 パラメータ`x`の値をパラメータ`x`の方向に、表現可能な最小の値だけ進めた値を返す。 @@ -34,6 +68,10 @@ namespace std { 進めた結果が無限大、もしくは表現できない場合、値域エラーとなる。 +## 備考 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された + + ## 例 ```cpp example #include @@ -57,7 +95,7 @@ int main() ``` ### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 @@ -71,3 +109,10 @@ int main() - [GCC](/implementation.md#gcc): 4.3 - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/nexttoward.md b/reference/cmath/nexttoward.md index ac63ae8108..2ede9b2044 100644 --- a/reference/cmath/nexttoward.md +++ b/reference/cmath/nexttoward.md @@ -6,14 +6,40 @@ ```cpp namespace std { - float nexttoward(float x, long double y); - double nexttoward(double x, long double y); - long double nexttoward(long double x, long double y); - - Promoted nexttoward(Integral x, long double y); - - float nexttowardf(float x, long double y); // C++17 から - long double nexttowardl(long double x, long double y); // C++17 から + float + nexttoward(float x, + long double y); // (1) C++11からC++20まで + double + nexttoward(double x, + long double y); // (2) C++11からC++20まで + long double + nexttoward(long double x, + long double y); // (3) C++11からC++20まで + + constexpr floating-point-type + nexttoward(floating-point-type x, + floating-point-type y); // (4) C++23 + + Promoted + nexttoward(Integral x, + long double y); // (5) C++11 + constexpr Promoted + nexttoward(Integral x, + floating-point-type y); // (5) C++23 + + float + nexttowardf(float x, + long double y); // (6) C++17 + constexpr float + nexttowardf(float x, + long double y); // (6) C++23 + + long double + nexttowardl(long double x, + long double y); // (7) C++17 + constexpr long double + nexttowardl(long double x, + long double y); // (7) C++23 } ``` * Integral[italic] @@ -24,7 +50,15 @@ namespace std { この関数は、パラメータ`x`の値をパラメータ`y`の値の方向に対して、その環境で表現可能な最小の値だけ進める。 -この関数はパラメータ`y`の型が`long double`固定であることを除いて、[`std::nextafter()`](nextafter.md)関数と等価である。 +この関数はパラメータ`y`の型が`long double`固定であることを除いて、[`std::nextafter()`](nextafter.md)関数と等価である (C++23以降では精度規定の関数を除いて`y`は`long double`ではなく任意の浮動小数点数型であるため、[`std::nextafter()`](nextafter.md)関数と等価である)。 + +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 算術型に対するオーバーロード (大きい精度にキャストして計算される。整数は`double`で計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 ## 戻り値 @@ -35,6 +69,10 @@ namespace std { 進めた結果が無限大、もしくは表現できない場合、値域エラーとなる。 +## 備考 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された + + ## 例 ```cpp example #include @@ -58,7 +96,7 @@ int main() ``` ### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 @@ -72,3 +110,10 @@ int main() - [GCC](/implementation.md#gcc): 4.3 - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/remainder.md b/reference/cmath/remainder.md index 435d83f583..54d5b3a54a 100644 --- a/reference/cmath/remainder.md +++ b/reference/cmath/remainder.md @@ -6,14 +6,31 @@ ```cpp namespace std { - double remainder(double x, double y); - float remainder(float x, float y); - long double remainder(long double x, long double y); - - Integral remainder(Integral x, Integral y); - - float remainderf(float x, float y); // C++17 から - long double remainderl(long double x, long double y); // C++17 から + float remainder(float x, float y); // (1) C++11からC++20まで + double remainder(double x, double y); // (2) C++11からC++20まで + long double remainder(long double x, + long double y); // (3) C++11からC++20まで + + constexpr floating-point-type + remainder(floating-point-type x, + floating-point-type y); // (4) C++23 + + Integral + remainder(Integral x, Integral y); // (5) C++11 + constexpr Integral + remainder(Integral x, Integral y); // (5) C++23 + + float + remainderf(float x, float y); // (6) C++17 + constexpr float + remainderf(float x, float y); // (6) C++23 + + long double + remainderl(long double x, + long double y); // (7) C++17 + constexpr long double + remainderl(long double x, + long double y); // (7) C++23 } ``` * Integral[italic] @@ -23,6 +40,14 @@ namespace std { 整数に対する剰余は`%`演算子で求められるが、浮動小数点数に対しては本関数を使用する必要がある。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 IEC 60559で要求された`x REM y`を計算して返す。 @@ -34,6 +59,7 @@ IEC 60559で要求された`x REM y`を計算して返す。 - 本関数は、C99 の規格にある `remainder`(より正確には `math.h` ヘッダの `remainder`、`remainderf`、`remainderl` の 3 つ。それぞれ C++ の `double`、`float`、`long double` バージョンに相当)と等価である。 - IEC 60559で要求された`x REM y`の計算とは以下のようなものであり、全ての実装に適用できる。 - 「y≠0である場合、剰余r = x REM yは、丸めモードに関係なく数学的な関係r = x - nyによって定義される。ここで、nはx/yの正確な値に最も近い整数である。| n - x/y | = 1/2ならば、nは常に偶数である。したがって、剰余は常に正確である。r = 0の場合、その符号はxの符号とする」 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -81,3 +107,10 @@ remainder(6, 2) = 0 - [GCC](/implementation.md#gcc): 4.3 - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/remquo.md b/reference/cmath/remquo.md index d7b448b3c5..1dd97d8b88 100644 --- a/reference/cmath/remquo.md +++ b/reference/cmath/remquo.md @@ -6,14 +6,50 @@ ```cpp namespace std { - double remquo(double x, double y, int* quo); - float remquo(float x, float y, int* quo); - long double remquo(long double x, long double y, int* quo); + float + remquo(float x, + float y, + int* quo); // (1) C++11からC++20まで + double + remquo(double x, + double y, + int* quo); // (2) C++11からC++20まで + long double + remquo(long double x, + long double y, + int* quo); // (3) C++11からC++20まで - Integral remquo(Integral x, Integral y, int* quo); + constexpr floating-point-type + remquo(floating-point-type x, + floating-point-type y, + int* quo); // (4) C++23 - float remquof(float x, float y, int* quo); // C++17 から - long double remquol(long double x, long double y, int* quo); // C++17 から + Integral + remquo(Integral x, + Integral y, + int* quo); // (5) C++11 + constexpr Integral + remquo(Integral x, + Integral y, + int* quo); // (5) C++23 + + float + remquof(float x, + float y, + int* quo); // (6) C++17 + constexpr float + remquof(float x, + float y, + int* quo); // (6) C++23 + + long double + remquol(long double x, + long double y, + int* quo); // (7) C++17 + constexpr long double + remquol(long double x, + long double y, + int* quo); // (7) C++23 } ``` * Integral[italic] @@ -23,6 +59,14 @@ namespace std { この関数は、浮動小数点数に対して除算を行い、除算の結果(商)と、その余り(剰余)を同時に求める。戻り値として剰余が返され、ポインタ引数`quo`に商の値が書き込まれる。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 - [`remainder()`](remainder.md)関数と同じ方法で剰余を求めて、戻り値として返す。 @@ -31,6 +75,10 @@ namespace std { `y`がゼロである場合、`quo`が指す値は未規定となる。またその際、定義域エラーを発生させるかゼロを返すかは、実装定義となる。定義域エラーが発生した際の挙動については、[``](../cmath.md) を参照。 +## 備考 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された + + ## 例 ```cpp example #include @@ -80,3 +128,10 @@ remquo(6, 2) = quotient:3 remainder:0 - [GCC](/implementation.md#gcc): 4.3 - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/round.md b/reference/cmath/round.md index 7eed527eee..0eb888f839 100644 --- a/reference/cmath/round.md +++ b/reference/cmath/round.md @@ -6,14 +6,27 @@ ```cpp namespace std { - float round(float x); - double round(double x); - long double round(long double x); - - double round(Integral x); - - float roundf(float x); // C++17 から - long double roundl(long double x); // C++17 から + float round(float x); // (1) C++11からC++20まで + double round(double x); // (2) C++11からC++20まで + long double round(long double x); // (3) C++11からC++20まで + + constexpr floating-point-type + round(floating-point-type x); // (4) C++23 + + double + round(Integral x); // (5) C++11 + constexpr double + round(Integral x); // (5) C++23 + + float + roundf(float x); // (6) C++17 + constexpr float + roundf(float x); // (6) C++17 + + long double + roundl(long double x); // (7) C++17 + constexpr long double + roundl(long double x); // (7) C++23 } ``` * Integral[italic] @@ -23,6 +36,14 @@ namespace std { ここで引数 `x` の四捨五入とは、`x` を最も近い整数に丸めるが、`x` の小数部分が `0.5` の場合には、`x` の符号が正負のいずれであってもゼロから遠い方向に丸めることを指す。 具体例は下記の出力例を参照。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 引数 `x` を四捨五入により丸めた整数値 @@ -64,6 +85,7 @@ namespace std { ただし、本関数において戻り値が引数 `x` と異なる場合に、上記の実装のように例外 [`FE_INEXACT`](/reference/cfenv/fe_inexact.md) が発生するか否かは実装依存である。 なお、本関数の挙動は、現在の丸めモードには依存しない。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -126,3 +148,10 @@ FE_INEXACT = false ``` 引数と結果が異なる場合に例外 `FE_INEXACT` が発生するか否かは実装によって異なる。 + + +## 参照 +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/scalbln.md b/reference/cmath/scalbln.md new file mode 100644 index 0000000000..41caa90a45 --- /dev/null +++ b/reference/cmath/scalbln.md @@ -0,0 +1,110 @@ +# scalbln +* cmath[meta header] +* std[meta namespace] +* function[meta id-type] +* cpp11[meta cpp] + +```cpp +namespace std { + float scalbln(float x, long int n); // (1) C++11からC++20まで + double scalbln(double x, long int n); // (2) C++11からC++20まで + long double scalbln(long double x, long int n); // (3) C++11からC++20まで + + constexpr floating-point-type + scalbln(floating-point-type x, long int n); // (4) C++23 + + double + scalbln(Integral x, long int n); // (5) C++11 + constexpr double + scalbln(Integral x, long int n); // (5) C++23 + + float + scalblnf(float x, long int n); // (6) C++17 + constexpr float + scalblnf(float x, long int n); // (6) C++23 + + long double + scalblnl(long double x, long int n); // (7) C++17 + constexpr long double + scalblnl(long double x, long int n); // (7) C++23 +} +``` +* Integral[italic] + +## 概要 +[`scalbn()`](scalbn.md)の、乗数として`int`の代わりに`long int`をとるバージョン。 + +`x` に、浮動小数点数の内部表現の基数 [`FLT_RADIX`](/reference/cfloat/flt_radix.md) の `n` 乗を掛けた値を効率的に(通常は [`FLT_RADIX`](/reference/cfloat/flt_radix.md)n を明示的には計算せずに)計算する。scalbは「scale binary」を意味する。 + +この関数は、[`FLT_RADIX`](/reference/cfloat/flt_radix.md) が `2` であるシステム上では、[`ldexp()`](ldexp.md) 関数と等価である。 + +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + + +## 戻り値 +x * [FLT_RADIX](/reference/cfloat/flt_radix.md)n + +オーバーフローエラー、アンダーフローエラーが発生する可能性がある。 + + +## 備考 +- この関数は元々 `scalb()` という名前で提案されていたが、非標準の同名関数が広く実装されていた。そのため、`new` の意味を持つ `n` を関数名の末尾に付けて `scalbn()` 関数として標準ライブラリに定義された。 +- オーバーフローエラー、アンダーフローエラーが発生した場合の挙動については、[``](../cmath.md) を参照。 +- 処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。(複号同順) + - `x = ±0` の場合、戻り値は `±0` となる。 + - `n = 0` の場合、戻り値は `x` となる。 + - `x = ±∞` の場合、戻り値は `±∞` となる。 + - もしオーバーフローエラーやアンダーフローエラーを起こさなければ、結果は正確で現在の丸め方式には依存しない。 + +- `scalbln()` 関数は、パラメータ `n` の型が `long int` であることを除いて、`scalbn()` 関数と等価である。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された + + +## 例 +```cpp example +#include +#include + +int main() +{ + // 3.0 * (FLT_RADIX^4) + double result = std::scalbln(3.0, 4); + std::cout << result << std::endl; +} +``` +* std::scalbln[color ff0000] + +### 出力例 +``` +48 +``` + +### 備考 +特定の環境では、早期に `constexpr` 対応されている場合がある: + +- GCC 4.6.1 以上 + + +## バージョン +### 言語 +- C++11 + +### 処理系 +- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.3.6 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [WG14 N657 Floating-Point and Complex Arithmetic Enhancements](http://www.open-std.org/jtc1/sc22/wg14/www/docs/n657.ps) +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/scalbn.md b/reference/cmath/scalbn.md index 893959dc68..8ff816b4ff 100644 --- a/reference/cmath/scalbn.md +++ b/reference/cmath/scalbn.md @@ -6,14 +6,27 @@ ```cpp namespace std { - float scalbn(float x, int n); - double scalbn(double x, int n); - long double scalbn(long double x, int n); + float scalbn(float x, int n); // (1) C++11からC++20まで + double scalbn(double x, int n); // (2) C++11からC++20まで + long double scalbn(long double x, int n); // (3) C++11からC++20まで - double scalbn(Integral x, int n); + constexpr floating-point-type + scalbn(floating-point-type x, int n); // (4) C++23 - float scalbnf(float x, int n); // C++17 から - long double scalbnl(long double x, int n); // C++17 から + double + scalbn(Integral x, int n); // (5) C++11 + constexpr double + scalbn(Integral x, int n); // (5) C++23 + + float + scalbnf(float x, int n); // (6) C++17 + constexpr float + scalbnf(float x, int n); // (6) C++23 + + long double + scalbnl(long double x, int n); // (7) C++17 + constexpr long double + scalbnl(long double x, int n); // (7) C++23 // 乗数としてlong int型を受け取るバージョン float scalbln(float x, long int n); @@ -33,6 +46,14 @@ namespace std { この関数は、[`FLT_RADIX`](/reference/cfloat/flt_radix.md) が `2` であるシステム上では、[`ldexp()`](ldexp.md) 関数と等価である。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 x * [FLT_RADIX](/reference/cfloat/flt_radix.md)n @@ -50,6 +71,7 @@ namespace std { - もしオーバーフローエラーやアンダーフローエラーを起こさなければ、結果は正確で現在の丸め方式には依存しない。 - `scalbln()` 関数は、パラメータ `n` の型が `long int` であることを除いて、`scalbn()` 関数と等価である。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -72,7 +94,7 @@ int main() ``` ### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 @@ -112,4 +134,7 @@ namespace std { ## 参照 - [WG14 N657 Floating-Point and Complex Arithmetic Enhancements](http://www.open-std.org/jtc1/sc22/wg14/www/docs/n657.ps) - +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/signbit.md b/reference/cmath/signbit.md index 6d7ec3a65d..9f39e4a2a8 100644 --- a/reference/cmath/signbit.md +++ b/reference/cmath/signbit.md @@ -6,11 +6,17 @@ ```cpp namespace std { - bool signbit(float x); - bool signbit(double x); - bool signbit(long double x); + bool signbit(float x); // (1) C++11からC++20まで + bool signbit(double x); // (2) C++11からC++20まで + bool signbit(long double x); // (3) C++11からC++20まで - bool signbit(Integral x); + constexpr bool + signbit(floating-point-type x); // (4) C++23 + + bool + signbit(Integral x); // (5) C++11 + constexpr bool + signbit(Integral x); // (5) C++23 } ``` * Integral[italic] @@ -18,6 +24,12 @@ namespace std { ## 概要 数値の符号が負であるか判定する。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) + ## 戻り値 パラメータ`x`が負数である場合、`true`を返す。そうでない場合、`false`を返す。 @@ -27,7 +39,8 @@ namespace std { ## 備考 -C標準ライブラリでは`signbit`は関数マクロとして定義されるが、C++標準ライブラリでは関数として定義される。 +- C標準ライブラリでは`signbit`は関数マクロとして定義されるが、C++標準ライブラリでは関数として定義される +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -42,7 +55,7 @@ int main() assert(!std::signbit(1.0f)); assert(!std::signbit(0.0f)); - + constexpr float nan = std::numeric_limits::quiet_NaN(); assert(!std::signbit(nan)); assert(std::signbit(-nan)); @@ -55,7 +68,7 @@ int main() ``` ### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 @@ -69,3 +82,10 @@ int main() - [GCC](/implementation.md#gcc): 4.3 - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/trunc.md b/reference/cmath/trunc.md index 69f44cb476..d81a623db7 100644 --- a/reference/cmath/trunc.md +++ b/reference/cmath/trunc.md @@ -6,14 +6,27 @@ ```cpp namespace std { - float trunc(float x); - double trunc(double x); - long double trunc(long double x); - - double trunc(Integral x); - - float truncf(float x); // C++17 から - long double truncl(long double x); // C++17 から + float trunc(float x); // (1) C++11からC++20まで + double trunc(double x); // (2) C++11からC++20まで + long double trunc(long double x); // (3) C++11からC++20まで + + constexpr floating-point-type + trunc(floating-point-type x); // (4) C++23 + + double + trunc(Integral x); // (5) C++11 + constexpr double + trunc(Integral x); // (5) C++23 + + float + truncf(float x); // (6) C++17 + constexpr float + truncf(float x); // (6) C++23 + + long double + truncl(long double x); // (7) C++17 + constexpr long double + truncl(long double x); // (7) C++23 } ``` * Integral[italic] @@ -22,6 +35,14 @@ namespace std { 引数 `x` をゼロ方向に丸めた整数値を得る。 ゼロ方向への丸めた整数値とは、絶対値が引数 `x` の絶対値以下で、かつ、引数 `x` に最も近い整数値である。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 引数 `x` をゼロ方向に丸めた整数値 @@ -37,6 +58,7 @@ namespace std { また、本関数の挙動は、丸めモードが [`FE_TOWARDZERO`](/reference/cfenv/fe_towardzero.md) に設定されている時の [`rint`](rint.md)、あるいは [`nearbyint`](nearbyint.md) のいずれかと等価である。 したがって、本関数において戻り値が引数 `x` と異なる場合に例外 [`FE_INEXACT`](/reference/cfenv/fe_inexact.md) が発生するか否かは実装依存である。 なお、本関数の挙動は、現在の丸めモードには依存しない。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -99,3 +121,10 @@ FE_INEXACT = false ``` 引数と結果が異なる場合に例外 `FE_INEXACT` が発生するか否かは実装によって異なる。 + + +## 参照 +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした From 5419582e559fd5c88d719564587a9ca714844e5d Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 16 Feb 2023 17:57:36 +0900 Subject: [PATCH 0187/3948] : small fix --- reference/cmath.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/cmath.md b/reference/cmath.md index d444ed428f..a0b536acc3 100644 --- a/reference/cmath.md +++ b/reference/cmath.md @@ -94,9 +94,9 @@ C++23で`constexpr`対応する関数の条件は以下: 1. 有理数の集合、または実数のどこにも密でない部分集合に作用すると見なされ、関数が閉じていること 2. 関数が丸めモードに強く依存しないこと -[`exp()`](cmath/exp.md)、[`sqrt()`](cmath/sqrt.md)、[`cos()`](cmath/cos.md)、[`sin()`](cmath/sin.md)は1. の条件を満たさないため、C++23では`constexpr`に対応しない。 +[`exp()`](cmath/exp.md)、[`log()`](cmath/log.md)、[`sqrt()`](cmath/sqrt.md)、[`cos()`](cmath/cos.md)、[`sin()`](cmath/sin.md)は1. の条件を満たさないため、C++23では`constexpr`に対応しない。 -[`nearbyint`](cmath/nearbyint.md)は2. の条件を満たさないため、C++23では`constexpr`に対応しない。 +[`nearbyint()`](cmath/nearbyint.md)は2. の条件を満たさないため、C++23では`constexpr`に対応しない。 ただし、コンパイラが先行して`constexpr`非対応の関数も対応している可能性がある。 From ba05560fb997bdded15d10da0863ffb56166bee0 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 16 Feb 2023 18:06:36 +0900 Subject: [PATCH 0188/3948] =?UTF-8?q?=E8=BF=94=E3=82=8A=E5=80=A4=E3=80=81?= =?UTF-8?q?=E8=BF=94=E5=80=A4=20:=20=E8=A8=B3=E8=AA=9E=E8=A1=A8=E3=81=AB?= =?UTF-8?q?=E5=9F=BA=E3=81=A5=E3=81=84=E3=81=A6=E3=80=8C=E6=88=BB=E3=82=8A?= =?UTF-8?q?=E5=80=A4=E3=80=8D=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp17/folding_expressions.md | 6 +++--- reference/cmath.md | 8 ++++---- reference/cmath/beta.md | 2 +- reference/cmath/fp_ilogb0.md | 2 +- reference/cmath/fp_ilogbnan.md | 2 +- reference/cstddef/size_t.md | 2 +- reference/tuple/make_from_tuple.md | 2 +- reference/tuple/tuple_cat.md | 2 +- reference/type_traits/is_invocable_r.md | 4 ++-- .../reference_constructs_from_temporary.md | 12 ++++++------ .../type_traits/reference_converts_from_temporary.md | 12 ++++++------ 11 files changed, 27 insertions(+), 27 deletions(-) diff --git a/lang/cpp17/folding_expressions.md b/lang/cpp17/folding_expressions.md index 91dfaec805..a27b9224fe 100644 --- a/lang/cpp17/folding_expressions.md +++ b/lang/cpp17/folding_expressions.md @@ -200,16 +200,16 @@ template struct empty_fold この方法は可能な限りジェネリックであるが、以下のような問題があった: -* 空のパラメータパックは型付けされていないが、返り値の型は他の型に文脈的に変換可能である (暗黙の型変換につながり得る) +* 空のパラメータパックは型付けされていないが、戻り値の型は他の型に文脈的に変換可能である (暗黙の型変換につながり得る) * テンプレート特殊化だけのために関数をオブジェクトしなければならない * サポートする演算子と等価な関数オブジェクト間のマッピングを用意しなければならない 結局のところこれは問題の解決にはつながらず、負担も大きいことから採用されなかった。 -##### 返り値の型推論 +##### 戻り値の型推論 -可能であれば空の畳み込みから返り値の型推論を行い、そうでなければプログラムを不適格とする。 +可能であれば空の畳み込みから戻り値の型推論を行い、そうでなければプログラムを不適格とする。 例えば以下の例では `std::string` に推論する: ```cpp auto res = (std::string(args) + ...); diff --git a/reference/cmath.md b/reference/cmath.md index a0b536acc3..6104a3c3a7 100644 --- a/reference/cmath.md +++ b/reference/cmath.md @@ -62,11 +62,11 @@ なお、C++11 の記載にある無条件のキャストは規格のバグとされたため、C++11 であってもスコープ付き列挙型や explicit な変換演算子のあるクラス型に、上記規則にある無条件のキャストが適用されると想定すべきではない。 ([LWG 2086. Overly generic type support for math functions](http://cplusplus.github.io/LWG/lwg-defects.html#2086) 参照) - 各関数の個別ページでは、上記のオーバーロード関数をコードで示す際には、引数や返値の型を斜体で示す。 + 各関数の個別ページでは、上記のオーバーロード関数をコードで示す際には、引数や戻り値の型を斜体で示す。 ```cpp Integral // 任意の整数型 Arithmetic // 任意の算術型 - Promoted // 決定された返値型 + Promoted // 決定された戻り値型 ``` * Integral[italic] * Arithmetic[italic] @@ -447,8 +447,8 @@ NaN を返さなければならないが定義域エラーを報告してはな | [`FP_FAST_FMA`](cmath/fp_fast_fma.md) | `double` 型の `fma` 関数がより高速な実装であるか | C++11 | | [`FP_FAST_FMAF`](cmath/fp_fast_fmaf.md) | `float` 型の `fma` 関数がより高速な実装であるか | C++11 | | [`FP_FAST_FMAL`](cmath/fp_fast_fmal.md) | `long double` 型の `fma` 関数がより高速な実装であるか | C++11 | -| [`FP_ILOGB0`](cmath/fp_ilogb0.md) | `ilogb(0)` の返値を表す整数定数式 | C++11 | -| [`FP_ILOGBNAN`](cmath/fp_ilogbnan.md) | `ilogb(NaN)` の返値を表す整数定数式 | C++11 | +| [`FP_ILOGB0`](cmath/fp_ilogb0.md) | `ilogb(0)` の戻り値を表す整数定数式 | C++11 | +| [`FP_ILOGBNAN`](cmath/fp_ilogbnan.md) | `ilogb(NaN)` の戻り値を表す整数定数式 | C++11 | | [`MATH_ERRNO`](cmath/math_errno.md) | 数学ライブラリ内で`errno`にエラーが設定されたかを表す整数定数 | C++11 | | [`MATH_ERREXCEPT`](cmath/math_errexcept.md) | 数学ライブラリ内で浮動小数点例外が発生したかを表す整数定数 | C++11 | | [`math_errhandling`](cmath/math_errhandling.md) | `` 内の関数がエラーをどのように取り扱うかを表すマクロ | C++11 | diff --git a/reference/cmath/beta.md b/reference/cmath/beta.md index a6750ca455..ef26eca016 100644 --- a/reference/cmath/beta.md +++ b/reference/cmath/beta.md @@ -64,7 +64,7 @@ beta(2, 4) = 0.05 GCC 7.1.0–8.0.0 では `beta` は [`exp`](exp.md) と [`lgamma`](lgamma.md) を用いて $ |\mathrm{B}(x, y)| = \exp(\ln |\Gamma(x) \Gamma(y) / \Gamma(x + y)|)) $ を計算する。 -`x < 0 || y < 0` でも定義域エラーを報告せずに値を返すが、返り値は必ず正になる。 +`x < 0 || y < 0` でも定義域エラーを報告せずに値を返すが、戻り値は必ず正になる。 ## 参照 diff --git a/reference/cmath/fp_ilogb0.md b/reference/cmath/fp_ilogb0.md index c36b8665bc..98b04c263c 100644 --- a/reference/cmath/fp_ilogb0.md +++ b/reference/cmath/fp_ilogb0.md @@ -9,7 +9,7 @@ * implementation_defined[italic] ## 概要 -`FP_ILOGB0` は、[`std::ilogb`](ilogb.md)`(0)` の返り値を表す整数定数式である。 +`FP_ILOGB0` は、[`std::ilogb`](ilogb.md)`(0)` の戻り値を表す整数定数式である。 [`INT_MIN`](/reference/climits/int_min.md) と `-`[`INT_MAX`](/reference/climits/int_max.md) のうち少なくとも片方と等しい値でなければならない。 diff --git a/reference/cmath/fp_ilogbnan.md b/reference/cmath/fp_ilogbnan.md index 66243c1efb..1e45da9ec0 100644 --- a/reference/cmath/fp_ilogbnan.md +++ b/reference/cmath/fp_ilogbnan.md @@ -9,7 +9,7 @@ * implementation_defined[italic] ## 概要 -`FP_ILOGBNAN` は、[`std::ilogb()`](ilogb.md) に `NaN` を渡したときの返り値を表す整数定数式である。 +`FP_ILOGBNAN` は、[`std::ilogb()`](ilogb.md) に `NaN` を渡したときの戻り値を表す整数定数式である。 [`INT_MIN`](/reference/climits/int_min.md) と [`INT_MAX`](/reference/climits/int_max.md) いずれかと等しい値でなければならない。 diff --git a/reference/cstddef/size_t.md b/reference/cstddef/size_t.md index f669a2d23f..55cd26b59d 100644 --- a/reference/cstddef/size_t.md +++ b/reference/cstddef/size_t.md @@ -13,7 +13,7 @@ namespace std { `size_t`は、オブジェクトのバイト数を表現できる程度に十分に大きい符号なし整数型である。 C++03まではC言語と同じく「`sizeof`演算子によって返される符号なし整数型」と規定されていた。 -オブジェクトのバイト数(例えば[`malloc`](/reference/cstdlib.md)の引数)やコンテナの要素数(例えば[`std::size()`](/reference/iterator/size.md)の返り値)を表現するために用いられる。 +オブジェクトのバイト数(例えば[`malloc`](/reference/cstdlib.md)の引数)やコンテナの要素数(例えば[`std::size()`](/reference/iterator/size.md)の戻り値)を表現するために用いられる。 ## 例 ```cpp example diff --git a/reference/tuple/make_from_tuple.md b/reference/tuple/make_from_tuple.md index b11772daba..5aca1111f2 100644 --- a/reference/tuple/make_from_tuple.md +++ b/reference/tuple/make_from_tuple.md @@ -25,7 +25,7 @@ namespace std { また、型`T`の初期化はそのコンストラクタで行われ集成体初期化は考慮されない。つまり、`Tuple`に含まれる型が空かただ一つの`T`でない場合、型`T`は集成体(aggregate)であってはならない(C++17のみ、C++20以降はok)。 -更に、C++23以降は`make_from_tuple`の返り値が参照である場合でダングリング参照を生成しないために、`make_from_tuple`の内部で`T`が構築される際に、`Tuple`から取得されるオブジェクト(参照の初期化であるので、`Tuple`のサイズは1である必要がある)の寿命が延長されないことも要求され、これを満たさない場合はコンパイルエラーとなる。 +更に、C++23以降は`make_from_tuple`の戻り値が参照である場合でダングリング参照を生成しないために、`make_from_tuple`の内部で`T`が構築される際に、`Tuple`から取得されるオブジェクト(参照の初期化であるので、`Tuple`のサイズは1である必要がある)の寿命が延長されないことも要求され、これを満たさない場合はコンパイルエラーとなる。 正確には、[`tuple_size_v`](tuple_size.md)`<`[`remove_reference_t`](/reference/type_traits/remove_reference.md)`> == 1`である場合、[`reference_constructs_from_temporary_v`](/reference/type_traits/reference_constructs_from_temporary.md)`(`[`declval`](/reference/utility/declval.md)`()))> == false`であること。 ## 引数 diff --git a/reference/tuple/tuple_cat.md b/reference/tuple/tuple_cat.md index 5827bea6e3..095d19d563 100644 --- a/reference/tuple/tuple_cat.md +++ b/reference/tuple/tuple_cat.md @@ -28,7 +28,7 @@ namespace std { - `Tuples...`の全ての型が[`std::tuple`](tuple.md)``であること。 - `Args...`の各型が左辺値参照であればコピー構築可能、そうでなければムーブ構築可能であること。 - C++23から : - - 本関数の返り値の[`tuple`](tuple.md)のテンプレートパラメーターパックを`Ctypes`とし、`Ctypes`の全ての要素について、引数`tpls`において対応する要素の型から構築可能であること。 + - 本関数の戻り値の[`tuple`](tuple.md)のテンプレートパラメーターパックを`Ctypes`とし、`Ctypes`の全ての要素について、引数`tpls`において対応する要素の型から構築可能であること。 - より厳密には、次のように定義を行い、`(`[`is_constructible_v`](/reference/type_traits/is_constructible.md)` && ...) == true`であること。 - `n`を`sizeof...(Tuples)`とし、`i`を範囲`[0, n)`における整数値とする - `T(i)`を`Tuples`の`i`番目とする diff --git a/reference/type_traits/is_invocable_r.md b/reference/type_traits/is_invocable_r.md index 6620732bf8..84996582c2 100644 --- a/reference/type_traits/is_invocable_r.md +++ b/reference/type_traits/is_invocable_r.md @@ -66,8 +66,8 @@ int main() std::cout << "1" << std::endl; - // INVOKE、つまり std::invoke の返り値である S が - // R に束縛されて R の寿命と同じ寿命に延長された上で std::invoke_r の返り値となる + // INVOKE、つまり std::invoke の戻り値である S が + // R に束縛されて R の寿命と同じ寿命に延長された上で std::invoke_r の戻り値となる // しかし R の寿命はこの1文の間だけなので、S もこの1文が終了する際に破棄される const S& a = std::invoke_r([]() { return S{}; }); diff --git a/reference/type_traits/reference_constructs_from_temporary.md b/reference/type_traits/reference_constructs_from_temporary.md index c02a78c880..05d91676b7 100644 --- a/reference/type_traits/reference_constructs_from_temporary.md +++ b/reference/type_traits/reference_constructs_from_temporary.md @@ -37,9 +37,9 @@ namespace std { ## 備考 -多くのメタ関数は`pvalue`と`xvalue`を区別しないが、このメタ関数は区別する。例えば、右辺値参照に「返り値の型が右辺値参照である関数」の返り値を束縛することを考える。(再現コードは、説明の最後に付す) +多くのメタ関数は`pvalue`と`xvalue`を区別しないが、このメタ関数は区別する。例えば、右辺値参照に「戻り値の型が右辺値参照である関数」の戻り値を束縛することを考える。(再現コードは、説明の最後に付す) -この事自体は即座に不適格とはならない。しかし、その関数が実際には`pvalue`を返しているとすれば、その`pvalue`は返り値の時点で右辺値参照に束縛されるため、それを右辺値参照に束縛したとしても寿命は延長されることはない。そのため、最終的にダングリング参照を生じることとなる。 +この事自体は即座に不適格とはならない。しかし、その関数が実際には`pvalue`を返しているとすれば、その`pvalue`は戻り値の時点で右辺値参照に束縛されるため、それを右辺値参照に束縛したとしても寿命は延長されることはない。そのため、最終的にダングリング参照を生じることとなる。 このような場面においては、本メタ関数が`pvalue`と`xvalue`を、`pvalue`を`T`(参照なしの型)として、`xvalue`を`T&&`(右辺値参照である型、転送参照(Forwarding Reference) を意味しているわけではない)として区別すれば検出が可能となる。 @@ -55,11 +55,11 @@ S&& f() { return S{}; } int main() { std::cout << "1" << std::endl; - - // f の返り値は s に束縛されて寿命が延長されたか? - // 実際にはこの宣言の1文が終了した際に f の返り値は破棄されている + + // f の戻り値は s に束縛されて寿命が延長されたか? + // 実際にはこの宣言の1文が終了した際に f の戻り値は破棄されている S&& s(f()); - + std::cout << "2" << std::endl; } diff --git a/reference/type_traits/reference_converts_from_temporary.md b/reference/type_traits/reference_converts_from_temporary.md index 0cff142fc5..63ea01deac 100644 --- a/reference/type_traits/reference_converts_from_temporary.md +++ b/reference/type_traits/reference_converts_from_temporary.md @@ -33,9 +33,9 @@ namespace std { ## 備考 -多くのメタ関数は`pvalue`と`xvalue`を区別しないが、このメタ関数は区別する。例えば、右辺値参照に「返り値の型が右辺値参照である関数」の返り値を束縛することを考える。(再現コードは、説明の最後に付す) +多くのメタ関数は`pvalue`と`xvalue`を区別しないが、このメタ関数は区別する。例えば、右辺値参照に「戻り値の型が右辺値参照である関数」の戻り値を束縛することを考える。(再現コードは、説明の最後に付す) -この事自体は即座に不適格とはならない。しかし、その関数が実際には`pvalue`を返しているとすれば、その`pvalue`は返り値の時点で右辺値参照に束縛されるため、それを右辺値参照に束縛したとしても寿命は延長されることはない。そのため、最終的にダングリング参照を生じることとなる。 +この事自体は即座に不適格とはならない。しかし、その関数が実際には`pvalue`を返しているとすれば、その`pvalue`は戻り値の時点で右辺値参照に束縛されるため、それを右辺値参照に束縛したとしても寿命は延長されることはない。そのため、最終的にダングリング参照を生じることとなる。 このような場面においては、本メタ関数が`pvalue`と`xvalue`を、`pvalue`を`T`(参照なしの型)として、`xvalue`を`T&&`(右辺値参照である型、転送参照(Forwarding Reference) を意味しているわけではない)として区別すれば検出が可能となる。 @@ -51,11 +51,11 @@ S&& f() { return S{}; } int main() { std::cout << "1" << std::endl; - - // f の返り値は s に束縛されて寿命が延長されたか? - // 実際にはこの宣言の1文が終了した際に f の返り値は破棄されている + + // f の戻り値は s に束縛されて寿命が延長されたか? + // 実際にはこの宣言の1文が終了した際に f の戻り値は破棄されている S&& s = f(); - + std::cout << "2" << std::endl; } From 5415e29dfd912b953b8249e2d1b51dd18f57c4b5 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 17 Feb 2023 14:13:27 +0900 Subject: [PATCH 0189/3948] =?UTF-8?q?functional/hash:=20=E9=80=8F=E9=81=8E?= =?UTF-8?q?=E7=9A=84=E3=83=8F=E3=83=83=E3=82=B7=E3=83=A5/=E7=AD=89?= =?UTF-8?q?=E5=80=A4=E6=AF=94=E8=BC=83=E3=81=AE=E4=BE=8B=E7=A4=BA=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E3=82=92=E6=94=B9=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit C++20標準の`std::equal_to`や`std::hash`は、 透過的な計算動作を示すメンバ型`is_transparent`を持つことはない。 独自の文字列ハッシュ計算クラスと`std::equal_to<>`に置き換える。 --- reference/functional/hash.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/reference/functional/hash.md b/reference/functional/hash.md index 09717118b1..a2df8a8dda 100644 --- a/reference/functional/hash.md +++ b/reference/functional/hash.md @@ -123,16 +123,25 @@ int main() #include #include #include +#include + +struct string_hash { + using is_transparent = void; + // string/string_view/const char*共用ハッシュ計算 + size_t operator()(std::string_view sv) const { + return std::hash{}(sv); + } +}; int main() { - std::unordered_map um = { + std::unordered_map> um = { {"Alice", 3}, {"Bob", 1}, {"Carol", 4} }; - // std::equal_toとstd::hashがis_transparent型を持つ場合、 + // string_hashおよびstd::equal_to<>はいずれもメンバ型にis_transparentを持つため、 // find()などの検索関数に引数を渡す場合に、std::string一時オブジェクトが作られない auto it = um.find("Alice"); if (it != um.end()) { From 16cab03355668b5b677440ac2a954a3d72817aa2 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 17 Feb 2023 14:51:43 +0900 Subject: [PATCH 0190/3948] =?UTF-8?q?functional/hash:=20=E3=83=A1=E3=83=B3?= =?UTF-8?q?=E3=83=90=E5=9E=8Bis=5Ftransparent=20=E8=AA=AC=E6=98=8E?= =?UTF-8?q?=E6=96=87=E3=82=92=E8=A6=8B=E7=9B=B4=E3=81=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit P0919R3(c9b2f8c5f794e4c6fd4b3cdda5835c9c796674a0)対応時のメンバ型`transparent_key_equal`説明から、 P1690R1(7338e60d2c288f1a061b10a3bd6b53352381c0d5)対応時に`is_transparent`へ改定した際の修正漏れと思われる。 --- reference/functional/hash.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/functional/hash.md b/reference/functional/hash.md index a2df8a8dda..f2bcb77308 100644 --- a/reference/functional/hash.md +++ b/reference/functional/hash.md @@ -80,7 +80,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| `is_transparent` | 省略可。ハッシュ計算の関数オブジェクトがこの型を持っている場合、非順序連想コンテナの透過的な検索関数が有効になる。
標準ライブラリの`hash`クラスの特殊化がこの型を持つかは未規定。
この型は、例として`hash`が`hash`や`hash`と等価なハッシュ値を生成できるような場合に定義される。 | C++20 | +| `is_transparent` | 省略可。ハッシュ計算の関数オブジェクトがこの型を持っている場合、非順序連想コンテナの透過的な検索関数が有効になる。
この型は、例として`hash`が`hash`や`hash`と等価なハッシュ値を生成できるような場合に定義される。 | C++20 | ## 例 From bc842eccb3ea7ec2195a7d339994b4d9af21d4ea Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 17 Feb 2023 16:25:32 +0900 Subject: [PATCH 0191/3948] =?UTF-8?q?functinoal/hash:=20=E9=96=A2=E9=80=A3?= =?UTF-8?q?=E9=A0=85=E7=9B=AE=E3=81=AB=E7=89=B9=E6=AE=8A=E5=8C=96=E7=89=88?= =?UTF-8?q?=E3=81=B8=E3=81=AE=E3=83=AA=E3=83=B3=E3=82=AF=E5=88=97=E6=8C=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/functional/hash.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/reference/functional/hash.md b/reference/functional/hash.md index f2bcb77308..f1b626178f 100644 --- a/reference/functional/hash.md +++ b/reference/functional/hash.md @@ -38,7 +38,7 @@ namespace std { このクラスはそのものにデフォルトの定義は存在せず、ユーザーが任意の型で特殊化する際の要件を定義する。`hash`クラステンプレートを特殊化する場合、以下に記述するメンバ関数を持たせる必要がある。 -なお、``ヘッダでは、以下の特殊化を提供する: +``ヘッダでは、以下の特殊化を提供する。これ以外の特殊化は、対象型を定義する各種ヘッダファイルにて提供される: | 型 | 対応バージョン | |----------------------|----------------| @@ -167,6 +167,26 @@ found : 3 - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + +## 関連項目 + +| ヘッダ | 特殊化対象 | +|--------|------------| +| [``](/reference/coroutine.md) | [`std::coroutine_handle`](/reference/coroutine/coroutine_handle.md) | +| [``](/reference/bitset.md) | [`std::bitset`](/reference/bitset/bitset.md) | +| [``](/reference/filesystem.md) | [`std::filesystem::path`](/reference/filesystem/path.md) | +| [``](/reference/optional.md) | [`std::optional`](/reference/optional/optional.md) | +| [``](/reference/memory.md) | [`std::shared_ptr`](/reference/memory/shared_ptr.md), [`std::unique_ptr`](/reference/memory/unique_ptr.md) | +| [``](/reference/stacktrace.md) | [`std::basic_backtrace`](/reference/stacktrace/basic_stacktrace.md), [`std::stacktrace_entry`](/reference/stacktrace/stacktrace_entry.md) | +| [``](/reference/string.md) | `std::string`など | +| [``](/reference/string_view.md) | `std::string_view`など | +| [``](/reference/system_error.md) | [`std::error_code`](/reference/system_error/error_code.md), [`std::error_condition`](/reference/system_error/error_condition.md) | +| [``](/reference/thread.md) | [`std::thread:id`](/reference/thread/thread.md) | +| [``](/reference/typeindex.md) | [`std::type_index`](/reference/typeindex/type_index.md) | +| [``](/reference/variant.md) | [`std::variant`](/reference/variant/variant.md), [`std::monostate`](/reference/variant/monostate.md) | +| [``](/reference/vector.md) | [`std::vector`](/reference/vector/vector.md) | + + ## 参照 - [ハッシュ関数 - Wikipedia](https://ja.wikipedia.org/wiki/ハッシュ関数) - [LWG 2148 - Hashing enums should be supported directly by std::hash](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2148) From 910ec8ffb3fc83359cb2515e37f3230fd992090b Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 17 Feb 2023 16:54:31 +0900 Subject: [PATCH 0192/3948] =?UTF-8?q?=E3=83=87=E3=82=A3=E3=83=AC=E3=82=AF?= =?UTF-8?q?=E3=83=88=E3=83=AA=E6=A7=8B=E9=80=A0:=20=E3=82=AF=E3=83=A9?= =?UTF-8?q?=E3=82=B9=E9=9A=8E=E5=B1=A4expected/expected.void=E7=89=B9?= =?UTF-8?q?=E4=BE=8B=E3=82=92=E6=98=8E=E8=A8=98(#1066)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start_editing/directory_structure.md | 1 + 1 file changed, 1 insertion(+) diff --git a/start_editing/directory_structure.md b/start_editing/directory_structure.md index 38a8a28f02..64b072dc0a 100644 --- a/start_editing/directory_structure.md +++ b/start_editing/directory_structure.md @@ -27,6 +27,7 @@ reference階層とmodule階層は上記以外は同じであるため、以下 - `std::swap()` - `std::erase()`/`std::erase_if()` - `floor()`/`ceil()`/`round()` (chrono) + - 特殊な例として、[`std::expected`](/reference/expected/expected.md)では[`部分特殊化](/reference/expected/expected.void.md)のためにクラス階層を分離している。これは各メンバ説明の差分が大きいためである - 演算子オーバーロードは、`operator<<` (出力ストリームへの出力) と `std::operator>>` (入力ストリームからの入力) を除き、左辺のクラスに属するものとする - 特殊な例として、[`std::error_code`](/reference/system_error/error_code.md)と[`std::error_condition`](/reference/system_error/error_condition.md)の比較演算子は、クラス階層ではなくヘッダ階層としている。これは所属関係がむずかしいためである From 88c08cc878fdca30b520859de47d8367e91b0e35 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Fri, 17 Feb 2023 18:09:21 +0900 Subject: [PATCH 0193/3948] =?UTF-8?q?P0593R6=E5=88=9D=E7=A8=BF=20#117?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp20.md | 1 + ...jects_for_low-level_object_manipulation.md | 245 ++++++++++++++++++ 2 files changed, 246 insertions(+) create mode 100644 lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md diff --git a/lang/cpp20.md b/lang/cpp20.md index 1c063cea8e..4d00423716 100644 --- a/lang/cpp20.md +++ b/lang/cpp20.md @@ -23,6 +23,7 @@ C++20とは、2020年中に改訂され、ISO/IEC 14882:2020で標準規格化 | [抽象型のチェック](cpp20/checking_for_abstract_class_types.md) | 関数の宣言段階では、パラメータおよび戻り値型が抽象型かどうかをチェックしないようにする | | [可変長データを扱うクラスの効率的な`delete`](cpp20/efficient_sized_delete_for_variable_sized_classes.md) | クラスの`delete`演算子が呼び出される前にデストラクタが呼ばれないようにするオプションを追加 | | [条件付きで特殊メンバ関数をトリビアルに定義するように](cpp20/conditionally_trivial_special_member_functions.md.nolink) | 制約によってトリビアルな特殊メンバ関数と非トリビアルな特殊メンバ関数をオーバーロードできるようにする | +| [未初期化領域への暗黙的なオブジェクト構築](cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md) | 未初期化領域の利用時に自動的にトリビアルな型のオブジェクトを構築する | ### 列挙型 diff --git a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md new file mode 100644 index 0000000000..0050b30fb1 --- /dev/null +++ b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md @@ -0,0 +1,245 @@ +# 未初期化領域への暗黙的なオブジェクト構築 +* cpp20[meta cpp] + +## 概要 + +`new`式ではなく`malloc()`等他の方法で確保されたメモリ領域には、明示的にオブジェクトの構築を行うまで想定する型のオブジェクトは生存期間内になく、そのアクセス(読み書き)は未定義動作となる。 + +```cpp +struct X { + int a; + int b; +}; + +X *make_x() { + // malloc()はメモリの確保だけを行う + X *p = (X*)malloc(sizeof(struct X)); + + // pの領域にはオブジェクトが構築されていない + p->a = 1; // 💀 UB + p->b = 2; // 💀 UB + + return p; +} +``` + +この様なコードは純粋なC++コードでは`new`式を用いることになるため、その場合は問題ない。 + +```cpp +// new式を使用する場合 +X *make_x() { + // new式はメモリの確保とオブジェクト構築を行う + X *p = new X; + + // pの領域にはオブジェクトが構築済 + p->a = 1; // ✅ ok + p->b = 2; // ✅ ok + + return p; +} +``` + +一番最初の`malloc()`を用いるコードは主にCのコードと共有する部分で現れることがあり、Cでは問題ないもののC++コードとしてコンパイルした場合にのみ未定義動作となる。C++20からは、この様なコードのC/C++相互運用性向上のために、明示的にオブジェクトを構築する必要がないとみなすことのできる一部の型(*implicit-lifetime types*)に限って、未初期化領域へのアクセス時に暗黙的に(自動的に)オブジェクトが構築される様になり、未定義動作を回避できる様になる。 + +## 問題となる他の例 + +以下の例はこの変更によって解決される例であり、C++17以前は未定義動作となるものである。 + +### `operator new` + +`new`式ではなく`operator new()`を直接使用する場合は同様の問題がある。 + +```cpp +// new式を使用する場合 +X *make_x() { + // operator new()はメモリの確保だけを行う + X *p = (X*)::operator new(sizeof(struct X)); + + // pの領域にはオブジェクトが構築されていない + p->a = 1; // 💀 UB + p->b = 2; // 💀 UB + + return p; +} +``` + +### 共用体のコピー + +```cpp +union U { + int n; + float f; +}; + +float pun(int n) { + // U::nの生存期間が開始 + U u = {.n = n}; + + // このコピーではunオブジェクト表現がコピーされるものの、メンバの生存期間は開始されない + // そのため、アクティブメンバが無い状態となる + U u2 = u; + + // u2.fは非アクティブ + return u2.f; // 💀 UB +} +``` + +### バイト配列の読み込み + +```cpp +// 何かバイト列ストリームを受け取って処理する関数とする +void process(Stream *stream) { + // バイト配列の読み出し + std::unique_ptr buffer = stream->read(); + + // 先頭バイトの状態によって分岐 + if (buffer[0] == FOO) { + process_foo(reinterpret_cast(buffer.get())); // #1 + } else { + process_bar(reinterpret_cast(buffer.get())); // #2 + } +} +``` + +1つの領域に複数の型のオブジェクトが同時に生存期間内にあることはないため、`stream->read()`が内部で`Foo, Bar`どちらかのオブジェクトを構築していたとしても、`#1`と`#2`のどちらかのパスは未定義動作となる。そして、この様なコードでは多くの場合、明示的にオブジェクトが構築されることはない。 + +### 動的配列の実装 + +```cpp +// std::vectorの様な動的配列型を実装したい +template +struct Vec { + char *buf = nullptr; + char *buf_end_size = nullptr; + char *buf_end_capacity = nullptr; + + void reserve(std::size_t n) { + char *newbuf = (char*)::operator new(n * sizeof(T), std::align_val_t(alignof(T))); + std::uninitialized_copy(begin(), end(), (T*)newbuf); // #a 💀 UB + + ::operator delete(buf, std::align_val_t(alignof(T))); + buf_end_size = newbuf + sizeof(T) * size(); // #b 💀 UB + buf_end_capacity = newbuf + sizeof(T) * n; // #c 💀 UB + buf = newbuf; + } + + void push_back(T t) { + if (buf_end_size == buf_end_capacity) + reserve(std::max(size() * 2, 1)); + new (buf_end_size) T(t); + buf_end_size += sizeof(T); // #d 💀 UB + } + + T *begin() { return (T*)buf; } + + T *end() { return (T*)buf_end_size; } + + std::size_t size() { return end() - begin(); } // #e 💀 UB +}; + +int main() { + Vec v; + v.push_back(1); + v.push_back(2); + v.push_back(3); + for (int n : v) { /*...*/ } // #f 💀 UB +} +``` + +C++においては、ポインタに対する演算(`+ -`など)はそのポインタが配列オブジェクトを指している場合にのみ有効となるが、例中の`#a #b #c #d #e #f`で使用されるポインタの指す領域にはいずれも配列オブジェクトが生存期間にない(正確には、非配列オブジェクトのポインタの場合は要素数1の配列として扱われるが、この例の場合はそれを満たすことはほぼなく、満たさないものとする)。そのため、そのポインタをイテレータの様に使用することは未定義動作となる。 + +## 仕様 + +### implicit-lifetime types + +明示的にオブジェクトを構築する必要がないとみなすことのできる一部の型は*implicit-lifetime types*と呼ばれる次のいずれかに該当する型である + +1. [スカラ型](/reference/type_traits/is_scalar.md) +2. 配列型 + - 要素型は問わない +3. *implicit-lifetime class types* + - デストラクタがユーザー定義されていない集成体型、もしくは + - 少なくとも1つの資格のあるトリビアルコンストラクタと、トリビアルで削除されていないデストラクタを持つ型 +4. 1~3のCV修飾された型 + +### オブジェクトを暗黙的に構築する操作 + +標準ライブラリ中の次の関数は、*implicit-lifetime types*に対して使用した場合に、その振る舞いの一環としてそのオブジェクトを暗黙的に構築する + +- `new`演算子 + - `opreator new` + - `opreator new[]` +- アロケータ + - [`std::allocator::allocate`](/reference/memory/allocator/allocate.md) +- Cライブラリ関数 + - `std::aligned_alloc` + - `std::calloc` + - `std::malloc` + - `std::realloc` + - `std::memcpy` + - `std::memmove` +- [`std::bit_cast`](/reference/bit/bit_cast.md) + +これらの操作はそれぞれ、次のようにオブジェクトを暗黙的に構築する + +- `new`演算子とCのメモリ確保関数 + - 返された領域にオブジェクトを構築し、構築された適切なオブジェクトへのポインタを返す + - `calloc/realloc`の場合、暗黙的なオブジェクト構築はゼロ埋め/コピーが行われる前に行われる +- [`std::allocator::allocate`](/reference/memory/allocator/allocate.md) + - 返された配列型の領域にその配列型のオブジェクトを構築するが、配列要素は構築されない +- `std::memcpy/std::memmove` + - コピー先領域への暗黙的なオブジェクト構築は、コピー先領域にコピーをする前に行われる +- [`std::bit_cast`](/reference/bit/bit_cast.md) + - ネストしたものも含めて、結果領域に暗黙にオブジェクトを構築する + - ネストしたもの、とは例えばクラスメンバや配列の要素のこと + +### デストラクタ呼び出しによる生存期間の終了 +(執筆中) + +## 例 +(執筆中) +```cpp example +// (ここには、言語機能の使い方を解説するための、サンプルコードを記述します。) +// (インクルードとmain()関数を含む、実行可能なサンプルコードを記述してください。そのようなコードブロックにはexampleタグを付けます。) + +#include + +int main() +{ + int variable = 0; + std::cout << variable << std::endl; +} +``` +* variable[color ff0000] + +(コードブロック中の識別子に、文字色を付ける例です。) + +### 出力 +``` +0 +``` + +(ここには、サンプルコードの実行結果を記述します。何も出力がない場合は、項目を削除せず、空の出力にしてください。) +(実行結果が処理系・実行環境によって異なる場合は、項目名を「出力例」に変更し、可能であればその理由も併記してください。) + + +## この機能が必要になった背景・経緯 +(執筆中) + + +## 検討されたほかの選択肢 +(執筆中) + + +## 関連項目 + +- [`start_lifetime_as()`](/reference/memory/start_lifetime_as.md.nolink) +- [`start_lifetime_as_array()`](/reference/memory/start_lifetime_as_array.md.nolink) +- [`is_implicit_lifetime`](/reference/type_traits/is_implicit_lifetime.md.nolink) + +## 参照 + +- [P0593R6 Implicit creation of objects for low-level object manipulation](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p0593r6.html) +- [CWG Issue 2325. `std::launder` and reuse of character buffers](https://cplusplus.github.io/CWG/issues/2325.html) +- [CWG Issue 2605. Implicit-lifetime aggregates](https://cplusplus.github.io/CWG/issues/2605.html) +- [P1839R5 Accessing Object Representations](https://wg21.link/p1839r5) From ace1860c41772f23dc20e50b11b68c5890c2d430 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 17 Feb 2023 18:32:46 +0900 Subject: [PATCH 0194/3948] =?UTF-8?q?=20:=20=E6=8B=A1=E5=BC=B5?= =?UTF-8?q?=E6=B5=AE=E5=8B=95=E5=B0=8F=E6=95=B0=E7=82=B9=E6=95=B0=E5=9E=8B?= =?UTF-8?q?=E3=81=B8=E3=81=AE=E5=AF=BE=E5=BF=9C=E7=B6=9A=E3=81=8D=E3=80=82?= =?UTF-8?q?=E9=80=94=E4=B8=AD=E3=81=A7=E5=8A=9B=E5=B0=BD=E3=81=8D=E3=81=9F?= =?UTF-8?q?=20#1022?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cmath/acos.md | 33 ++++++++--- reference/cmath/acosh.md | 35 ++++++++--- reference/cmath/asin.md | 33 ++++++++--- reference/cmath/asinh.md | 33 ++++++++--- reference/cmath/assoc_laguerre.md | 60 ++++++++++++++----- reference/cmath/assoc_legendre.md | 63 +++++++++++++++----- reference/cmath/atan.md | 33 ++++++++--- reference/cmath/atan2.md | 60 +++++++++++++------ reference/cmath/atanh.md | 35 ++++++++--- reference/cmath/beta.md | 38 +++++++++++- reference/cmath/cbrt.md | 31 +++++++--- reference/cmath/comp_ellint_1.md | 49 ++++++++++++---- reference/cmath/comp_ellint_2.md | 47 +++++++++++---- reference/cmath/comp_ellint_3.md | 37 ++++++++++-- reference/cmath/cos.md | 33 ++++++++--- reference/cmath/cosh.md | 33 ++++++++--- reference/cmath/erf.md | 29 +++++++-- reference/cmath/erfc.md | 29 +++++++-- reference/cmath/exp.md | 35 ++++++++--- reference/cmath/exp2.md | 35 ++++++++--- reference/cmath/expm1.md | 33 ++++++++--- reference/cmath/hypot.md | 98 +++++++++++++++++++------------ reference/cmath/lgamma.md | 29 +++++++-- reference/cmath/llrint.md | 37 ++++++++---- reference/cmath/log.md | 37 ++++++++---- reference/cmath/log10.md | 37 ++++++++---- reference/cmath/log1p.md | 37 ++++++++---- reference/cmath/log2.md | 37 ++++++++---- reference/cmath/lrint.md | 38 ++++++++---- reference/cmath/nearbyint.md | 37 ++++++++---- reference/cmath/pow.md | 73 ++++++++++++++--------- reference/cmath/rint.md | 39 ++++++++---- reference/cmath/sin.md | 33 ++++++++--- reference/cmath/sinh.md | 34 ++++++++--- reference/cmath/sqrt.md | 31 +++++++--- reference/cmath/tan.md | 34 ++++++++--- reference/cmath/tanh.md | 33 ++++++++--- reference/cmath/tgamma.md | 29 +++++++-- 38 files changed, 1118 insertions(+), 389 deletions(-) diff --git a/reference/cmath/acos.md b/reference/cmath/acos.md index 46f0a5c892..6ae027aec7 100644 --- a/reference/cmath/acos.md +++ b/reference/cmath/acos.md @@ -6,14 +6,17 @@ ```cpp namespace std { - float acos(float x); - double acos(double x); - long double acos(long double x); + float acos(float x); // (1) C++03からC++20まで + double acos(double x); // (2) C++03からC++20まで + long double acos(long double x); // (3) C++03からC++20まで - double acos(Integral x); // C++11 から + floating-point-type + acos(floating-point-type x); // (4) C++23 - float acosf(float x); // C++17 から - long double acosl(long double x); // C++17 から + double acos(Integral x); // (5) C++11 + + float acosf(float x); // (6) C++17 + long double acosl(long double x); // (7) C++17 } ``` * Integral[italic] @@ -23,6 +26,14 @@ namespace std { `acos()`は、余弦を表す[`cos()`](cos.md)の逆関数である。$\cos(\mathrm{Arccos}~x) = x$、$\mathrm{Arccos}~(\cos x) = x ~ (x \in [0, \pi])$である。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 引数 `x` の逆余弦を主値 `[0, π]` の範囲で返す。(単位はラジアン) @@ -34,8 +45,9 @@ namespace std { - $$ f(x) = \mathrm{Arccos}~ x $$ - 定義域エラーが発生した場合の挙動については、[``](../cmath.md) を参照。 - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 - - `x = 1` の場合、戻り値は `+0` となる。 - - `x > |1|` の場合、戻り値は quiet NaN となり、[`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外)が発生する。 + - `x = 1` の場合、戻り値は `+0` となる。 + - `x > |1|` の場合、戻り値は quiet NaN となり、[`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外)が発生する。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -94,3 +106,8 @@ $$ \mathrm{Arccos}~x = \frac{\pi}{2} - \sum_{n = 0}^{\infty}\frac{\left(2n\right また、逆正接関数と逆余接関数の和は π / 2 なので [`asin`](asin.md) から求めることができる。 $$ \mathrm{Arccos}~x = \frac{\pi}{2} - \mathrm{Arcsin}~x \quad \mathrm{for} \; |x| < 1 $$ + + +## 参照 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/acosh.md b/reference/cmath/acosh.md index a879286245..8e072d9bf6 100644 --- a/reference/cmath/acosh.md +++ b/reference/cmath/acosh.md @@ -7,14 +7,17 @@ ```cpp namespace std { - float acosh(float x); - double acosh(double x); - long double acosh(long double x); + float acosh(float x); // (1) C++11からC++20まで + double acosh(double x); // (2) C++11からC++20まで + long double acosh(long double x); // (3) C++11からC++20まで - double acosh(Integral x); // C++11 から + floating-point-type + acosh(floating-point-type x); // (4) C++23 - float acoshf(float x); // C++17 から - long double acoshl(long double x); // C++17 から + double acosh(Integral x); // (5) C++11 + + float acoshf(float x); // (6) C++17 + long double acoshl(long double x); // (7) C++17 } ``` * Integral[italic] @@ -22,6 +25,14 @@ namespace std { ## 概要 算術型の逆双曲線余弦(エリアハイパボリックコサイン、area hyperbolic cosine)を求める。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 引数 `x` の逆双曲線余弦を `[0, +∞]` の範囲で返す。 @@ -33,9 +44,10 @@ namespace std { - $$ f(x) = \mathrm{arcosh}~x $$ - 定義域エラーが発生した場合の挙動については、[``](../cmath.md) を参照。 - 処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 - - `x = 1` の場合、戻り値は `+0` となる。 - - `x < 1` の場合、戻り値は quiet NaN となり、[`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外)が発生する。 - - `x = +∞` の場合、戻り値は `+∞` となる。 + - `x = 1` の場合、戻り値は `+0` となる。 + - `x < 1` の場合、戻り値は quiet NaN となり、[`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外)が発生する。 + - `x = +∞` の場合、戻り値は `+∞` となる。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -79,3 +91,8 @@ acosh(∞) = inf 対数に変換して求めることができる。 $$ \mathrm{arcosh}~x = \log_e \left(x + \sqrt{x^2-1}\right) \quad \mathrm{for} \; 1 < x $$ + + +## 参照 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/asin.md b/reference/cmath/asin.md index 6cda0510f7..132bd53a13 100644 --- a/reference/cmath/asin.md +++ b/reference/cmath/asin.md @@ -6,14 +6,17 @@ ```cpp namespace std { - float asin(float x); - double asin(double x); - long double asin(long double x); + float asin(float x); // (1) C++03からC++20まで + double asin(double x); // (2) C++03からC++20まで + long double asin(long double x); // (3) C++03からC++20まで - double asin(Integral x); // C++11 + floating-point-type + asin(floating-point-type x); // (4) C++23 - float asinf(float x); // C++17 から - long double asinl(long double x); // C++17 から + double asin(Integral x); // (5) C++11 + + float asinf(float x); // (6) C++17 + long double asinl(long double x); // (7) C++17 } ``` * Integral[italic] @@ -23,6 +26,14 @@ namespace std { `asin()`は、正弦を表す[`sin()`](sin.md)の逆関数である。$\sin(\mathrm{Arcsin}~x) = x$、$\mathrm{Arcsin}~(\sin x) = x ~ (x \in [-\pi/2, \pi/2])$である。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 引数 `x` の逆正弦を主値 `[-π/2, π/2]` の範囲で返す。(単位はラジアン) @@ -34,8 +45,9 @@ namespace std { - $$ f(x) = \mathrm{Arcsin}~x $$ - 定義域エラーが発生した場合の挙動については、[``](../cmath.md) を参照。 - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 - - `x = ±0` の場合、戻り値は `±0` となる。(複号同順) - - `x > |1|` の場合、戻り値は quiet NaN となり、[`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外)が発生する。 + - `x = ±0` の場合、戻り値は `±0` となる。(複号同順) + - `x > |1|` の場合、戻り値は quiet NaN となり、[`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外)が発生する。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -90,3 +102,8 @@ $$ \mathrm{Arcsin}~x = \sum_{n = 0}^{\infty} \frac{(2n)!}{4^n (n!)^2 (2n+1)} x^{ $|x| = 1$ 近傍の精度低下する領域(特に $1 / \sqrt{2} < |x| \le 1$)においては、以下の公式による変換で精度向上を図れる。 $$ \mathrm{Arcsin}~x = \frac{\pi}{2} - \mathrm{Arccos}~x = \frac{\pi}{2} - \mathrm{Arcsin}~\sqrt{1 - x^2} \quad \mathrm{for} \; 0 \le x \le 1 $$ + + +## 参照 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/asinh.md b/reference/cmath/asinh.md index 94543b7c5d..c18b0fa468 100644 --- a/reference/cmath/asinh.md +++ b/reference/cmath/asinh.md @@ -7,14 +7,17 @@ ```cpp namespace std { - float asinh(float x); - double asinh(double x); - long double asinh(long double x); + float asinh(float x); // (1) C++11からC++20まで + double asinh(double x); // (2) C++11からC++20まで + long double asinh(long double x); // (3) C++11からC++20まで - double asinh(Integral x); // C++11 から + floating-point-type + asinh(floating-point-type x); // (4) C++23 - float asinhf(float x); // C++17 から - long double asinhl(long double x); // C++17 から + double asinh(Integral x); // (5) C++11 + + float asinhf(float x); // (6) C++17 + long double asinhl(long double x); // (7) C++17 } ``` * Integral[italic] @@ -22,6 +25,14 @@ namespace std { ## 概要 算術型の逆双曲線正弦(エリアハイパボリックサイン、area hyperbolic sine)を求める。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 引数 `x` の逆双曲線正弦を返す。 @@ -30,8 +41,9 @@ namespace std { ## 備考 - $$ f(x) = \mathrm{arsinh}~x $$ - 処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。(複号同順) - - `x = ±0` の場合、戻り値は `±0` となる。 - - `x = ±∞` の場合、戻り値は `±∞` となる。 + - `x = ±0` の場合、戻り値は `±0` となる。 + - `x = ±∞` の場合、戻り値は `±∞` となる。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -80,3 +92,8 @@ $$ \mathrm{arsinh}~x = \sum_{n = 0}^{\infty} \frac{(-1)^n (2n)!}{4^n (n!)^2 (2n または対数に変換して求めることができる。 $$ \mathrm{arsinh}~x = \log_e \left(x + \sqrt{x^2+1}\right) \quad \mathrm{for~all} \; x $$ + + +## 参照 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/assoc_laguerre.md b/reference/cmath/assoc_laguerre.md index 0a30b9b7ac..2effc09d63 100644 --- a/reference/cmath/assoc_laguerre.md +++ b/reference/cmath/assoc_laguerre.md @@ -7,15 +7,44 @@ ```cpp namespace std { -float assoc_laguerref(unsigned n, unsigned m, float x); -double assoc_laguerre(unsigned n, unsigned m, double x); -long double assoc_laguerrel(unsigned n, unsigned m, long double x); + double + assoc_laguerre(unsigned int n, + unsigned int m, + double x); // (1) C++17 + floating-point-type + assoc_laguerre(unsigned int n, + unsigned int m, + floating-point-type x); // (1) C++23 + + Promoted + assoc_laguerre(unsigned int n, + unsigned int m, + Arithmetic x); // (2) C++17 + + float + assoc_laguerref(unsigned int n, + unsigned int m, + float x); // (3) C++17 + + long double + assoc_laguerrel(unsigned int n, + unsigned int m, + long double x); // (4) C++17 } ``` +* Promoted[italic] +* Arithmetic[italic] ## 概要 ラゲール陪多項式 (associated Laguerre polynomials) を計算する。 +- (1) : + - C++17 : `double`に対するオーバーロード + - C++23 : 浮動小数点数型に対するオーバーロード +- (2) : 算術型に対するオーバーロード (対応する精度の浮動小数点数型にキャストして計算される) +- (3) : `float`型規定 +- (4) : `long double`型規定 + ## 戻り値 引数 `n`, `m`, `x` のラゲール陪多項式 @@ -28,7 +57,8 @@ $$ ## 備考 -`n >= 128 || m >= 128` の場合、この関数の呼び出しの効果は実装定義である。 +- `n >= 128 || m >= 128` の場合、この関数の呼び出しの効果は実装定義である +- (1) : C++23では、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -93,16 +123,6 @@ assoc_laguerre(2, 1, 2) = -1 - [Visual C++](/implementation.md#visual_cpp): ?? -## 関連項目 -* ラゲール多項式 [`laguerre`](laguerre.md) - - -## 参照 -- [N3060 JTC1.22.29124 Programming Language C++ — Special Math Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3060.pdf) -- [WG21 P0226R1 Mathematical Special Functions for C++17, v5](https://isocpp.org/files/papers/P0226R1.pdf) -- [ISO/IEC 29124:2010 Information technology -- Programming languages, their environments and system software interfaces -- Extensions to the C++ Library to support mathematical special functions](https://www.iso.org/standard/50511.html) - - ## 実装例 ### 閉形式 $$ @@ -114,3 +134,15 @@ $$ L_n^m(x) = \frac{(2n + m - 1 - x)L_{n-1}^m(x) - (n + m - 1) L_{n-2}^m(x)}{n}; L_0^m(x) = 1, L_1^m(x) = -x + m + 1 $$ + + +## 関連項目 +- ラゲール多項式 [`laguerre`](laguerre.md) + + +## 参照 +- [N3060 JTC1.22.29124 Programming Language C++ — Special Math Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3060.pdf) +- [WG21 P0226R1 Mathematical Special Functions for C++17, v5](https://isocpp.org/files/papers/P0226R1.pdf) +- [ISO/IEC 29124:2010 Information technology -- Programming languages, their environments and system software interfaces -- Extensions to the C++ Library to support mathematical special functions](https://www.iso.org/standard/50511.html) +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/assoc_legendre.md b/reference/cmath/assoc_legendre.md index caf8d7941c..b36db5ea08 100644 --- a/reference/cmath/assoc_legendre.md +++ b/reference/cmath/assoc_legendre.md @@ -7,15 +7,44 @@ ```cpp namespace std { -float assoc_legendref(unsigned l, unsigned m, float x); -double assoc_legendre(unsigned l, unsigned m, double x); -long double assoc_legendrel(unsigned l, unsigned m, long double x); + double + assoc_legendre(unsigned int l, + unsigned int m, + double x); // (1) C++17 + floating-point-type + assoc_legendre(unsigned int l, + unsigned int m, + floating-point-type x); // (1) C++23 + + Promoted + assoc_legendre(unsigned int l, + unsigned int m, + Arithmetic x); // (2) C++17 + + float + assoc_legendref(unsigned int l, + unsigned int m, + float x); // (2) C++17 + + long double + assoc_legendrel(unsigned int l, + unsigned int m, + long double x); // (3) C++17 } ``` +* Promoted[italic] +* Arithmetic[italic] ## 概要 ルジャンドル陪関数 (associated Legendre functions) を計算する。 +- (1) : + - C++17 : `double`に対するオーバーロード + - C++23 : 浮動小数点数型に対するオーバーロード +- (2) : 算術型に対するオーバーロード (対応する精度の浮動小数点数型にキャストして計算される) +- (3) : `float`型規定 +- (4) : `long double`型規定 + ## 戻り値 引数 `l`, `m`, `x` のルジャンドル陪関数 @@ -27,7 +56,8 @@ $$ ## 備考 -`l >= 128` の場合、この関数の呼び出しの効果は実装定義である。 +- `l >= 128` の場合、この関数の呼び出しの効果は実装定義である +- (1) : C++23では、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -98,17 +128,6 @@ GCC 7.1.0–8.0.0 では `l < m` の場合 ($P_l^m = 0$) [`std::domain_error`](/ GCC 7.1.0–8.0.0 では $(-1)^m$ 倍された値を返す。 -## 関連項目 -* ルジャンドル多項式 [`legendre`](legendre.md) -* 球面調和関数の *θ* 成分 [`sph_legendre`](sph_legendre.md) - - -## 参照 -- [N3060 JTC1.22.29124 Programming Language C++ — Special Math Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3060.pdf) -- [WG21 P0226R1 Mathematical Special Functions for C++17, v5](https://isocpp.org/files/papers/P0226R1.pdf) -- [ISO/IEC 29124:2010 Information technology -- Programming languages, their environments and system software interfaces -- Extensions to the C++ Library to support mathematical special functions](https://www.iso.org/standard/50511.html) - - ## 実装例 ### 閉形式 $$ @@ -121,3 +140,17 @@ $$ P_l^m(x) = \frac{(2l-1) x P_{l-1}^m(x) - (l+m-1) P_{l-2}^m(x)}{l-m}; \quad P_{m-1}^m(x) = 0, \quad P_m^m(x) = (2m-1)!! (1 - x^2)^{m/2} $$ + + +## 関連項目 +- ルジャンドル多項式 [`legendre`](legendre.md) +- 球面調和関数の *θ* 成分 [`sph_legendre`](sph_legendre.md) + + +## 参照 +- [N3060 JTC1.22.29124 Programming Language C++ — Special Math Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3060.pdf) +- [WG21 P0226R1 Mathematical Special Functions for C++17, v5](https://isocpp.org/files/papers/P0226R1.pdf) +- [ISO/IEC 29124:2010 Information technology -- Programming languages, their environments and system software interfaces -- Extensions to the C++ Library to support mathematical special functions](https://www.iso.org/standard/50511.html) +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした + diff --git a/reference/cmath/atan.md b/reference/cmath/atan.md index 85488a3176..a82f0ba13d 100644 --- a/reference/cmath/atan.md +++ b/reference/cmath/atan.md @@ -6,14 +6,17 @@ ```cpp namespace std { - float atan(float x); - double atan(double x); - long double atan(long double x); + float atan(float x); // (1) C++03からC++20まで + double atan(double x); // (2) C++03からC++20まで + long double atan(long double x); // (3) C++03からC++20まで - double atan(Integral x); // C++11 から + floating-point-type + atan(floating-point-type x); // (4) C++23 - float atanf(float x); // C++17 から - long double atanl(long double x); // C++17 から + double atan(Integral x); // (5) C++11 + + float atanf(float x); // (6) C++17 + long double atanl(long double x); // (7) C++17 } ``` * Integral[italic] @@ -23,6 +26,14 @@ namespace std { `atan()`は、正接を表す[`tan()`](tan.md)の逆関数である。$\tan(\mathrm{Arctan}~x) = x$、$\mathrm{Arctan}~(\tan x) = x ~ (x \in [-\pi/2, \pi/2])$である。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 引数 `x` の逆正接を主値 `[-π/2, π/2]` の範囲で返す。(単位はラジアン) @@ -31,8 +42,9 @@ namespace std { ## 備考 - $$ f(x) = \mathrm{Arctan}~x $$ - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 - - `x = ±0` の場合、戻り値は `±0` となる。(複号同順) - - `x = ±∞` の場合、戻り値は `±π/2` となる。(複号同順) + - `x = ±0` の場合、戻り値は `±0` となる。(複号同順) + - `x = ±∞` の場合、戻り値は `±π/2` となる。(複号同順) +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -98,3 +110,8 @@ $$ \mathrm{Arctan}~x = \frac{\pi}{2} - \mathrm{Arctan}~\frac{1}{x} \quad \mathrm (特に $ \sqrt{2} - 1 < |x| \le \sqrt{2} + 1 $ の場合) $$ \mathrm{Arctan}~x = \frac{\pi}{4} + \mathrm{Arctan}~\frac{x - 1}{x + 1} \quad \mathrm{for} \; x \ne -1 $$ + + +## 参照 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/atan2.md b/reference/cmath/atan2.md index 9d45bc3fc8..4878498a1c 100644 --- a/reference/cmath/atan2.md +++ b/reference/cmath/atan2.md @@ -6,14 +6,23 @@ ```cpp namespace std { - float atan2(float y, float x); - double atan2(double y, double x); - long double atan2(long double y, long double x); - - Promoted atan2(Arithmetic1 y, Arithmetic2 x); // C++11 から - - float atan2f(float y, float x); // C++17 から - long double atan2l(long double y, long double x); // C++17 から + float atan2(float y, float x); // (1) C++03からC++20まで + double atan2(double y, double x); // (2) C++03からC++20まで + long double + atan2(long double y, long double x); // (3) C++03からC++20まで + + floating-point-type + atan2(floating-point-type y, + floating-point-type x); // (4) C++23 + + Promoted + atan2(Arithmetic1 y, + Arithmetic2 x); // (5) C++11 + + float + atan2f(float y, float x); // (6) C++17 + long double + atan2l(long double y, long double x); // (7) C++17 } ``` * Promoted[italic] @@ -27,6 +36,14 @@ namespace std { このような三角形があった場合、辺`y`の長さと辺`x`の長さを`atan2()`関数に与えることで、角度θがラジアン単位として求まる。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 算術型に対するオーバーロード (大きい精度にキャストして計算される。整数は`double`で計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 `y / x` の逆正接を `[-π, π]` の範囲で返す。(単位はラジアン) @@ -38,21 +55,22 @@ namespace std { ## 備考 - $$ f(y, x) = \mathrm{Arctan}~\frac{y}{x} $$ - 引数の順番に注意されたし。 + 引数の順番に注意されたし。 - 定義域エラーが発生した場合の挙動については、[``](../cmath.md) を参照。 - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。(複号同順) - - `y = ±0` で `x < 0` または `x = -0` の場合、戻り値は `±π` となる。 - - `y = ±0` で `x > 0` または `x = +0` の場合、戻り値は `±0` となる。 - - `y > 0` で `x = ±0` の場合、戻り値は `+π/2` となる。 - - `y < 0` で `x = ±0` の場合、戻り値は `-π/2` となる。 - - `0 < z < +∞` とすると、`y = ±z` で `x = -∞` の場合、戻り値は `±π` となる。 - - `0 < z < +∞` とすると、`y = ±z` で `x = +∞` の場合、戻り値は `±0` となる。 - - `y = ±∞` で `x` が有限の値の場合、戻り値は `±π/2` となる。 - - `y = ±∞` で `x = -∞` の場合、戻り値は `±3π/4` となる。 - - `y = ±∞` で `x = +∞` の場合、戻り値は `±π/4` となる。 + - `y = ±0` で `x < 0` または `x = -0` の場合、戻り値は `±π` となる。 + - `y = ±0` で `x > 0` または `x = +0` の場合、戻り値は `±0` となる。 + - `y > 0` で `x = ±0` の場合、戻り値は `+π/2` となる。 + - `y < 0` で `x = ±0` の場合、戻り値は `-π/2` となる。 + - `0 < z < +∞` とすると、`y = ±z` で `x = -∞` の場合、戻り値は `±π` となる。 + - `0 < z < +∞` とすると、`y = ±z` で `x = +∞` の場合、戻り値は `±0` となる。 + - `y = ±∞` で `x` が有限の値の場合、戻り値は `±π/2` となる。 + - `y = ±∞` で `x = -∞` の場合、戻り値は `±3π/4` となる。 + - `y = ±∞` で `x = +∞` の場合、戻り値は `±π/4` となる。 - 特に、`y` と `x` の両方がゼロの場合に定義域エラー([`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外))となったり、`y` が非ゼロで `x` がゼロの場合に極エラー([`FE_DIVBYZERO`](../cfenv/fe_divbyzero.md)(ゼロ除算浮動小数点例外))となったりは**しない**事に注意。 + 特に、`y` と `x` の両方がゼロの場合に定義域エラー([`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外))となったり、`y` が非ゼロで `x` がゼロの場合に極エラー([`FE_DIVBYZERO`](../cfenv/fe_divbyzero.md)(ゼロ除算浮動小数点例外))となったりは**しない**事に注意。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -114,3 +132,7 @@ $$ \displaystyle \mathrm{Arctan}~\frac{y}{x} - \pi & \quad \mathrm{for} \; x < 0, \; y < 0 \end{cases} $$ + +## 参照 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/atanh.md b/reference/cmath/atanh.md index c09d4bdd1b..78e3a266dc 100644 --- a/reference/cmath/atanh.md +++ b/reference/cmath/atanh.md @@ -7,14 +7,17 @@ ```cpp namespace std { - float atanh(float x); - double atanh(double x); - long double atanh(long double x); + float atanh(float x); // (1) C++11からC++20まで + double atanh(double x); // (2) C++11からC++20まで + long double atanh(long double x); // (3) C++11からC++20まで - double atanh(Integral x); // C++17 から + floating-point-type + atanh(floating-point-type x); // (4) C++23 - float atanhf(float x); // C++17 から - long double atanhl(long double x); // C++17 から + double atanh(Integral x); // (5) C++11 + + float atanhf(float x); // (6) C++17 + long double atanhl(long double x); // (7) C++17 } ``` * Integral[italic] @@ -22,6 +25,14 @@ namespace std { ## 概要 算術型の逆双曲線正接(エリアハイパボリックタンジェント、area hyperbolic tangent)を求める。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 引数 `x` の逆双曲線正接を返す。 @@ -33,9 +44,10 @@ namespace std { - $$ f(x) = \mathrm{artanh}~x $$ - 定義域エラー、あるいは、極エラーが発生した場合の挙動については、[``](../cmath.md) を参照。 - 処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。(複号同順) - - `x = ±0` の場合、戻り値は `±0` となる。 - - `x = ±1` の場合、戻り値は `±∞` となり、[`FE_DIVBYZERO`](../cfenv/fe_divbyzero.md)(ゼロ除算浮動小数点例外)が発生する。 - - `|x| > 1` の場合、戻り値は NaN となり、[`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外)が発生する。 + - `x = ±0` の場合、戻り値は `±0` となる。 + - `x = ±1` の場合、戻り値は `±∞` となり、[`FE_DIVBYZERO`](../cfenv/fe_divbyzero.md)(ゼロ除算浮動小数点例外)が発生する。 + - `|x| > 1` の場合、戻り値は NaN となり、[`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外)が発生する。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -87,3 +99,8 @@ $$ \mathrm{artanh}~x = \sum_{n = 0}^{\infty} \frac{1}{2n + 1} x^{2n + 1} \quad \ または対数に変換して求めることができる。 $$ \mathrm{artanh}~x = \frac{1}{2} \log_e \frac{1 + x}{1 - x} \quad \mathrm{for} \; |x| < 1 $$ + + +## 参照 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/beta.md b/reference/cmath/beta.md index ef26eca016..16ca1ded50 100644 --- a/reference/cmath/beta.md +++ b/reference/cmath/beta.md @@ -7,15 +7,40 @@ ```cpp namespace std { -float betaf(float x, float y); -double beta(double x, double y); -long double betal(long double x, long double y); + double + beta(double x, + double y); // (1) C++17 + floating-point-type + beta(floating-point-type x, + floating-point-type y); // (1) C++23 + + Promoted + beta(Arithmetic1 x, + Arithmetic2 y); // (2) C++17 + + float + betaf(float x, + float y); // (3) C++17 + + long double + betal(long double x, + long double y); // (4) C++17 } ``` +* Promoted[italic] +* Arithmetic1[italic] +* Arithmetic2[italic] ## 概要 ベータ関数 (beta function) を求める。 +- (1) : + - C++17 : `double`に対するオーバーロード + - C++23 : 浮動小数点数型に対するオーバーロード +- (2) : 算術型に対するオーバーロード (対応する大きい方の精度の浮動小数点数型にキャストして計算される) +- (3) : `float`型規定 +- (4) : `long double`型規定 + ## 戻り値 引数 `x`, `y` のベータ関数 @@ -26,6 +51,10 @@ $$ を返す。$\Gamma$ はガンマ関数 ([`tgamma`](tgamma.md))。 +## 備考 +- (1) : C++23では、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された + + ## 例 ```cpp example #include @@ -71,3 +100,6 @@ $ |\mathrm{B}(x, y)| = \exp(\ln |\Gamma(x) \Gamma(y) / \Gamma(x + y)|)) $ - [N3060 JTC1.22.29124 Programming Language C++ — Special Math Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3060.pdf) - [WG21 P0226R1 Mathematical Special Functions for C++17, v5](https://isocpp.org/files/papers/P0226R1.pdf) - [ISO/IEC 29124:2010 Information technology -- Programming languages, their environments and system software interfaces -- Extensions to the C++ Library to support mathematical special functions](https://www.iso.org/standard/50511.html) +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした + diff --git a/reference/cmath/cbrt.md b/reference/cmath/cbrt.md index c6c171a6dc..f5c879de33 100644 --- a/reference/cmath/cbrt.md +++ b/reference/cmath/cbrt.md @@ -7,14 +7,17 @@ ```cpp namespace std { - float cbrt(float x); - double cbrt(double x); - long double cbrt(long double x); + float cbrt(float x); // (1) C++11からC++20まで + double cbrt(double x); // (2) C++11からC++20まで + long double cbrt(long double x); // (3) C++11からC++20まで - double cbrt(Integral x); + floating-point-type + cbrt(floating-point-type x); // (4) C++23 - float cbrtf(float x); // C++17 から - long double cbrtl(long double x); // C++17 から + double cbrt(Integral x); // (5) C++11 + + float cbrtf(float x); // (6) C++17 + long double cbrtl(long double x); // (7) C++17 } ``` * Integral[italic] @@ -22,6 +25,14 @@ namespace std { ## 概要 算術型の実数の立方根を求める。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 引数 `x` の実数の立方根を返す。 @@ -30,8 +41,9 @@ namespace std { ## 備考 - $$ f(x) = \sqrt[3] x $$ - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。(複号同順) - - `x = ±0` の場合、戻り値は `±0` となる。 - - `x = ±∞` の場合、戻り値は `±∞` となる。 + - `x = ±0` の場合、戻り値は `±0` となる。 + - `x = ±∞` の場合、戻り値は `±∞` となる。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -78,3 +90,6 @@ cbrt(-1.0) = -1.000000 - GCC 4.6.1 以上 +## 参照 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/comp_ellint_1.md b/reference/cmath/comp_ellint_1.md index 96c669a228..8969a506b7 100644 --- a/reference/cmath/comp_ellint_1.md +++ b/reference/cmath/comp_ellint_1.md @@ -7,15 +7,35 @@ ```cpp namespace std { - float comp_ellint_1f(float k); - double comp_ellint_1(double k); - long double comp_ellint_1l(long double k); + double + comp_ellint_1(double k); // (1) C++17 + floating-point-type + comp_ellint_1(floating-point-type k); // (1) C++23 + + Promoted + comp_ellint_1(Arithmetic k); // (1) C++17 + + float + comp_ellint_1f(float k); // (2) C++17 + + long double + comp_ellint_1l(long double k); // (3) C++17 } ``` +* Promoted[italic] +* Arithmetic[italic] + ## 概要 第一種完全楕円積分 (complete elliptic integral of the first kind) を計算する。 +- (1) : + - C++17 : `double`に対するオーバーロード + - C++23 : 浮動小数点数型に対するオーバーロード +- (2) : 算術型に対するオーバーロード (対応する精度の浮動小数点数型にキャストして計算される) +- (3) : `float`型規定 +- (4) : `long double`型規定 + ## 戻り値 引数 `k` の第一種完全楕円積分 @@ -27,6 +47,10 @@ $$ $ F(k, \phi) $ は第一種不完全楕円積分 ([`ellint_1`](ellint_1.md))。 +## 備考 +- (1) : C++23では、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された + + ## 例 ```cpp example #include @@ -69,7 +93,7 @@ double pendulum_period_shift(double theta) { int main() { std::cout << std::setprecision(16); - + for (const auto theta : {15.0, 30.0, 45.0, 60.0}) { const auto angle = theta * pi / 180.0; std::cout << theta << " [°] : "; @@ -104,8 +128,15 @@ int main() { GCC 7.1.0–8.0.0 では定義域エラーが発生したときに [`std::numeric_limits::quiet_NaN`](/reference/limits/numeric_limits/quiet_nan.md) を返す。 +## 実装例 +### 級数 +$$ +K(k) = \frac{\pi}{2} \sum_{n=0}^\infty \left[ \frac{(2n-1)!!}{(2n)!!} \right]^2 k^{2n} +$$ + + ## 関連項目 -* 第一種不完全楕円積分 [`ellint_1`](ellint_1.md) +- 第一種不完全楕円積分 [`ellint_1`](ellint_1.md) ## 参照 @@ -113,9 +144,5 @@ GCC 7.1.0–8.0.0 では定義域エラーが発生したときに [`std::numeri - [WG21 P0226R1 Mathematical Special Functions for C++17, v5](https://isocpp.org/files/papers/P0226R1.pdf) - [ISO/IEC 29124:2010 Information technology -- Programming languages, their environments and system software interfaces -- Extensions to the C++ Library to support mathematical special functions](https://www.iso.org/standard/50511.html) - [振り子 - Wikipedia](https://ja.wikipedia.org/wiki/振り子) - -## 実装例 -### 級数 -$$ -K(k) = \frac{\pi}{2} \sum_{n=0}^\infty \left[ \frac{(2n-1)!!}{(2n)!!} \right]^2 k^{2n} -$$ +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/comp_ellint_2.md b/reference/cmath/comp_ellint_2.md index 5cfcb45516..8768d2306c 100644 --- a/reference/cmath/comp_ellint_2.md +++ b/reference/cmath/comp_ellint_2.md @@ -7,15 +7,34 @@ ```cpp namespace std { -float comp_ellint_2f(float k); -double comp_ellint_2(double k); -long double comp_ellint_2l(long double k); + double + comp_ellint_2(double k); // (1) C++17 + floating-point-type + comp_ellint_2(floating-point-type k); // (1) C++23 + + Promoted + comp_ellint_2(Arithmetic k); // (2) C++17 + + float + comp_ellint_2f(float k); // (3) C++17 + + long double + comp_ellint_2l(long double k); // (4) C++17 } ``` +* Promoted[italic] +* Arithmetic[italic] ## 概要 第二種完全楕円積分 (complete elliptic integral of the second kind) を計算する。 +- (1) : + - C++17 : `double`に対するオーバーロード + - C++23 : 浮動小数点数型に対するオーバーロード +- (2) : 算術型に対するオーバーロード (対応する精度の浮動小数点数型にキャストして計算される) +- (3) : `float`型規定 +- (4) : `long double`型規定 + ## 戻り値 引数 `k` の第二種完全楕円積分 @@ -27,6 +46,10 @@ $$ $ E(k, \phi) $ は第二種不完全楕円積分 ([`ellint_2`](ellint_2.md))。 +## 備考 +- (1) : C++23では、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された + + ## 例 ```cpp example #include @@ -59,18 +82,20 @@ comp_ellint_2(1) = 1 - [Visual C++](/implementation.md#visual_cpp): ?? +## 実装例 +### 級数 +$$ +E(k) = - \frac{\pi}{2} \sum_{n=0}^\infty \frac{1}{2n-1} \left[ \frac{(2n-1)!!}{(2n)!!} \right]^2 k^{2n} +$$ + + ## 関連項目 -* 第二種不完全楕円積分 [`ellint_2`](ellint_2.md) +- 第二種不完全楕円積分 [`ellint_2`](ellint_2.md) ## 参照 - [N3060 JTC1.22.29124 Programming Language C++ — Special Math Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3060.pdf) - [WG21 P0226R1 Mathematical Special Functions for C++17, v5](https://isocpp.org/files/papers/P0226R1.pdf) - [ISO/IEC 29124:2010 Information technology -- Programming languages, their environments and system software interfaces -- Extensions to the C++ Library to support mathematical special functions](https://www.iso.org/standard/50511.html) - - -## 実装例 -### 級数 -$$ -E(k) = - \frac{\pi}{2} \sum_{n=0}^\infty \frac{1}{2n-1} \left[ \frac{(2n-1)!!}{(2n)!!} \right]^2 k^{2n} -$$ +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/comp_ellint_3.md b/reference/cmath/comp_ellint_3.md index fa89db92e7..3a234e5037 100644 --- a/reference/cmath/comp_ellint_3.md +++ b/reference/cmath/comp_ellint_3.md @@ -7,15 +7,40 @@ ```cpp namespace std { -float comp_ellint_3f(float k, float nu); -double comp_ellint_3(double k, double nu); -long double comp_ellint_3l(long double k, long double nu); + double + comp_ellint_3(double k, + double nu); // (1) C++17 + floating-point-type + comp_ellint_3(floating-point-type k, + floating-point-type nu); // (1) C++23 + + Promoted + comp_ellint_3(Arithmetic1 k, + Arithmetic2 nu); // (2) C++17 + + float + comp_ellint_3f(float k, + float nu); // (3) C++17 + + long double + comp_ellint_3l(long double k, + long double nu); // (4) C++17 } ``` +* Promoted[italic] +* Arithmetic1[italic] +* Arithmetic2[italic] ## 概要 第三種完全楕円積分 (complete elliptic integral of the third kind) を計算する。 +- (1) : + - C++17 : `double`に対するオーバーロード + - C++23 : 浮動小数点数型に対するオーバーロード +- (2) : 算術型に対するオーバーロード (対応する大きい方の精度の浮動小数点数型にキャストして計算される) +- (3) : `float`型規定 +- (4) : `long double`型規定 + ## 戻り値 引数 `k`, `nu` の第三種完全楕円積分 @@ -25,11 +50,13 @@ $$ \quad \text{for } |k| \le 1 $$ を返す。 + $ \Pi(\nu, k) $ は第三種不完全楕円積分 ([`ellint_3`](ellint_3.md))。 ## 備考 -$\Pi(0, k) = K(k)$ (第一種完全楕円積分 [`comp_ellint_1`](comp_ellint_1.md))。 +- $\Pi(0, k) = K(k)$ (第一種完全楕円積分 [`comp_ellint_1`](comp_ellint_1.md)) +- (1) : C++23では、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -100,3 +127,5 @@ GCC 7.1.0–8.0.0 では - [N3060 JTC1.22.29124 Programming Language C++ — Special Math Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3060.pdf) - [WG21 P0226R1 Mathematical Special Functions for C++17, v5](https://isocpp.org/files/papers/P0226R1.pdf) - [ISO/IEC 29124:2010 Information technology -- Programming languages, their environments and system software interfaces -- Extensions to the C++ Library to support mathematical special functions](https://www.iso.org/standard/50511.html) +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/cos.md b/reference/cmath/cos.md index 2f8306873d..0f68b806d2 100644 --- a/reference/cmath/cos.md +++ b/reference/cmath/cos.md @@ -6,14 +6,17 @@ ```cpp namespace std { - float cos(float x); - double cos(double x); - long double cos(long double x); + float cos(float x); // (1) C++03からC++20まで + double cos(double x); // (2) C++03からC++20まで + long double cos(long double x); // (3) C++03からC++20まで - double cos(Integral x); // C++11 から + floating-point-type + cos(floating-point-type x); // (4) C++23 - float cosf(float x); // C++17 から - long double cosl(long double x); // C++17 から + double cos(Integral x); // (5) C++11 + + float cosf(float x); // (6) C++17 + long double cosl(long double x); // (7) C++17 } ``` * Integral[italic] @@ -21,6 +24,14 @@ namespace std { ## 概要 算術型の余弦(コサイン)を求める。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 引数 `x` の余弦を返す(`x`の単位はラジアン)。 @@ -29,8 +40,9 @@ namespace std { ## 備考 - $$ f(x) = \cos x $$ - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 - - `x = ±0` の場合、戻り値は `1` となる。 - - `x = ±∞` の場合、戻り値は quiet NaN となり、[`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外)が発生する。 + - `x = ±0` の場合、戻り値は `1` となる。 + - `x = ±∞` の場合、戻り値は quiet NaN となり、[`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外)が発生する。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -109,3 +121,8 @@ $$ \cos x = \sum_{n = 0}^{\infty} \frac{(-1)^n}{(2n)!} x^{2n} \quad \mathrm{for~ ## 関連項目 - [`std::numbers::pi`](/reference/numbers/pi.md) + + +## 参照 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/cosh.md b/reference/cmath/cosh.md index 0cb1d97bf3..3218f93c7d 100644 --- a/reference/cmath/cosh.md +++ b/reference/cmath/cosh.md @@ -6,14 +6,17 @@ ```cpp namespace std { - float cosh(float x); - double cosh(double x); - long double cosh(long double x); + float cosh(float x); // (1) C++03からC++20まで + double cosh(double x); // (2) C++03からC++20まで + long double cosh(long double x); // (3) C++03からC++20まで - double cosh(Integral x); // C++11 から + floating-point-type + cosh(floating-point-type x); // (4) C++23 - float coshf(float x); // C++17 から - long double coshl(long double x); // C++17 から + double cosh(Integral x); // (5) C++11 + + float coshf(float x); // (6) C++17 + long double coshl(long double x); // (7) C++17 } ``` * Integral[italic] @@ -21,6 +24,14 @@ namespace std { ## 概要 算術型の双曲線余弦(ハイパボリックコサイン)を求める。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 引数 `x` の双曲線余弦を返す。 @@ -32,8 +43,9 @@ namespace std { - $$ f(x) = \cosh x $$ - オーバーフローエラーが発生した場合の挙動については、[``](../cmath.md) を参照。 - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 - - `x = ±0` の場合、戻り値は `1` となる。 - - `x = ±∞` の場合、戻り値は `+∞` となる。 + - `x = ±0` の場合、戻り値は `1` となる。 + - `x = ±∞` の場合、戻り値は `+∞` となる。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -78,3 +90,8 @@ cosh(1.0) = 1.543081 以下のマクローリン級数を適当な次数で打ち切ることで近似的に求めることができる。 $$ \cosh x = \sum_{n = 0}^{\infty} \frac{1}{(2n)!} x^{2n} \quad \mathrm{for~all} \; x $$ + + +## 参照 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/erf.md b/reference/cmath/erf.md index 215c0bdfcb..138fa4d5f6 100644 --- a/reference/cmath/erf.md +++ b/reference/cmath/erf.md @@ -7,14 +7,17 @@ ```cpp namespace std { - float erf(float x); - double erf(double x); - long double erf(long double x); + float erf(float x); // (1) C++11からC++20まで + double erf(double x); // (2) C++11からC++20まで + long double erf(long double x); // (3) C++11からC++20まで - double erf(Integral x); + floating-point-type + erf(floating-point-type x); // (4) C++23 - float erff(float x); // C++17 から - long double erfl(long double x); // C++17 から + double erf(Integral x); // (5) C++11 + + float erff(float x); // (6) C++17 + long double erfl(long double x); // (7) C++17 } ``` * Integral[italic] @@ -22,6 +25,14 @@ namespace std { ## 概要 算術型の誤差関数 (error function) を求める。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 引数 `x` の誤差関数を返す。 @@ -33,6 +44,7 @@ namespace std { - `x = ±0` の場合、戻り値は `±0` となる。 - `x = ±∞` の場合、戻り値は `±1` となる。 - 平均μ, 標準偏差σの正規分布の累積分布関数は $$\frac{1}{2} \left( 1 + \mathrm{erf} ~ \frac{x - \mu}{\sqrt{2} \sigma} \right)$$ で与えられる。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -75,3 +87,8 @@ erf(+∞) = 1.000000 特定の環境で `constexpr` 指定されている場合がある。(独自拡張) - GCC 4.6.1 以上 + + +## 参照 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/erfc.md b/reference/cmath/erfc.md index 4effef62c4..8f16988704 100644 --- a/reference/cmath/erfc.md +++ b/reference/cmath/erfc.md @@ -7,14 +7,17 @@ ```cpp namespace std { - float erfc(float x); - double erfc(double x); - long double erfc(long double x); + float erfc(float x); // (1) C++11からC++20まで + double erfc(double x); // (2) C++11からC++20まで + long double erfc(long double x); // (3) C++11からC++20まで - double erfc(Integral x); + floating-point-type + erfc(floating-point-type x); // (4) C++23 - float erfcf(float x); // C++17 から - long double erfcl(long double x); // C++17 から + double erfc(Integral x); // (5) C++11 + + float erfcf(float x); // (6) C++17 + long double erfcl(long double x); // (7) C++17 } ``` * Integral[italic] @@ -22,6 +25,14 @@ namespace std { ## 概要 算術型の相補誤差関数 (complementary error function) を求める。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 引数 `x` の相補誤差関数を返す。 @@ -33,6 +44,7 @@ namespace std { - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 - `x = -∞` の場合、戻り値は `2` となる。 - `x = +∞` の場合、戻り値は `+0` となる。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -75,3 +87,8 @@ erfc(+∞) = 0.000000 特定の環境で `constexpr` 指定されている場合がある。(独自拡張) - GCC 4.6.1 以上 + + +## 参照 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/exp.md b/reference/cmath/exp.md index b24bb110e7..1d080b7518 100644 --- a/reference/cmath/exp.md +++ b/reference/cmath/exp.md @@ -6,14 +6,17 @@ ```cpp namespace std { - float exp(float x); - double exp(double x); - long double exp(long double x); + float exp(float x); // (1) C++03からC++20まで + double exp(double x); // (2) C++03からC++20まで + long double exp(long double x); // (3) C++03からC++20まで - double exp(Integral x); // C++11 から + floating-point-type + exp(floating-point-type x); // (4) C++23 - float expf(float x); // C++17 から - long double expl(long double x); // C++17 から + double exp(Integral x); // (5) C++11 + + float expf(float x); // (6) C++17 + long double expl(long double x); // (7) C++17 } ``` * Integral[italic] @@ -21,6 +24,14 @@ namespace std { ## 概要 `e` (ネイピア数) を底とする指数関数を求める。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 `e` (ネイピア数) の `x` 乗を返す。 @@ -32,9 +43,10 @@ namespace std { - $$ f(x) = e^x $$ - オーバーフローエラー、アンダーフローエラーが発生した場合の挙動については、[``](../cmath.md) を参照。 - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 - - `x = ±0` の場合、戻り値は `1` となる。 - - `x = -∞` の場合、戻り値は `+0` となる。 - - `x = +∞` の場合、戻り値は `+∞` となる。 + - `x = ±0` の場合、戻り値は `1` となる。 + - `x = -∞` の場合、戻り値は `+0` となる。 + - `x = +∞` の場合、戻り値は `+∞` となる。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -83,3 +95,8 @@ exp(-∞) = 0.000000 以下のマクローリン級数を適当な次数で打ち切ることで近似的に求めることができる。 $$ e^x = \sum_{n = 0}^{\infty} \frac{x^n}{n!} \quad \mathrm{for~all} \; x $$ + + +## 参照 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/exp2.md b/reference/cmath/exp2.md index 1819fe338a..44b28dc801 100644 --- a/reference/cmath/exp2.md +++ b/reference/cmath/exp2.md @@ -7,14 +7,17 @@ ```cpp namespace std { - float exp2(float x); - double exp2(double x); - long double exp2(long double x); + float exp2(float x); // (1) C++11からC++20まで + double exp2(double x); // (2) C++11からC++20まで + long double exp2(long double x); // (3) C++11からC++20まで - double exp2(Integral x); // C++11 から + floating-point-type + exp2(floating-point-type x); // (4) C++23 - float exp2f(float x); // C++17 から - long double exp2l(long double x); // C++17 から + double exp2(Integral x); // (5) C++11 + + float exp2f(float x); // (6) C++17 + long double exp2l(long double x); // (7) C++17 } ``` * Integral[italic] @@ -22,6 +25,14 @@ namespace std { ## 概要 2 を底とする指数関数を求める。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 2 の `x` 乗を返す。 @@ -33,9 +44,10 @@ namespace std { - $$ f(x) = 2^x $$ - オーバーフローエラー、アンダーフローエラーが発生した場合の挙動については、[``](../cmath.md) を参照。 - 処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 - - `x = ±0` の場合、戻り値は `1` となる。 - - `x = -∞` の場合、戻り値は `+0` となる。 - - `x = +∞` の場合、戻り値は `+∞` となる。 + - `x = ±0` の場合、戻り値は `1` となる。 + - `x = -∞` の場合、戻り値は `+0` となる。 + - `x = +∞` の場合、戻り値は `+∞` となる。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -104,3 +116,8 @@ namespace std { `exp` があれば、以下のように変換することで求められる。 $$ 2^x = e^{x \log_e 2} \quad \mathrm{for~all} \; x $$ + + +## 参照 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/expm1.md b/reference/cmath/expm1.md index b9624739b6..cf40c790d0 100644 --- a/reference/cmath/expm1.md +++ b/reference/cmath/expm1.md @@ -7,14 +7,17 @@ ```cpp namespace std { - float expm1(float x); - double expm1(double x); - long double expm1(long double x); + float expm1(float x); // (1) C++11からC++20まで + double expm1(double x); // (2) C++11からC++20まで + long double expm1(long double x); // (3) C++11からC++20まで - double expm1(Integral x); // C++11 から + floating-point-type + expm1(floating-point-type x); // (4) C++23 - float expm1f(float x); // C++17 から - long double expm1l(long double x); // C++17 から + double expm1(Integral x); // (5) C++11 + + float expm1f(float x); // (6) C++17 + long double expm1l(long double x); // (7) C++17 } ``` * Integral[italic] @@ -24,6 +27,14 @@ namespace std { 引数が 0 近傍において `exp(x)-1` より高精度な計算になる。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 `e` (ネイピア数) の `x` 乗から 1 を引いた値を返す。 @@ -35,9 +46,9 @@ namespace std { - $$ f(x) = e^x - 1 $$ - オーバーフローエラー、アンダーフローエラーが発生した場合の挙動については、[``](../cmath.md) を参照。 - 処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 - - `x = ±0` の場合、戻り値は `±0` となる。(複号同順) - - `x = -∞` の場合、戻り値は `-1` となる。 - - `x = +∞` の場合、戻り値は `+∞` となる。 + - `x = ±0` の場合、戻り値は `±0` となる。(複号同順) + - `x = -∞` の場合、戻り値は `-1` となる。 + - `x = +∞` の場合、戻り値は `+∞` となる。 ## 例 @@ -81,3 +92,7 @@ expm1(-∞) = -1.000000 - GCC 4.6.1 以上 + +## 参照 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/hypot.md b/reference/cmath/hypot.md index 041d83f2c6..340bddcd13 100644 --- a/reference/cmath/hypot.md +++ b/reference/cmath/hypot.md @@ -7,20 +7,35 @@ ```cpp namespace std { - float hypot(float x, float y); // (1) - double hypot(double x, double y); // (2) - long double hypot(long double x, long double y); // (3) - - Promoted hypot(Arithmetic1 x, Arithmetic2 y); // (4) - - float hypotf(float x, float y); // (5) C++17 から - long double hypotl(long double x, long double y); // (6) C++17 から - - double hypot(double x, double y, double z); // (7) C++17 から - float hypot(float x, float y, float z); // (8) C++17 から - long double hypot(long double x, long double y, long double z); // (9) C++17 から - - Promoted hypot(Arithmetic1 x, Arithmetic2 y, Arithmetic3 z); // (10) C++17 から + float hypot(float x, float y); // (1) C++11からC++20まで + double hypot(double x, double y); // (2) C++11からC++20まで + long double hypot(long double x, long double y); // (3) C++11からC++20まで + + floating-point-type + hypot(floating-point-type x, + floating-point-type y); // (4) C++23 + + Promoted hypot(Arithmetic1 x, Arithmetic2 y); // (5) C++11 + + float hypotf(float x, float y); // (6) C++17 + long double hypotl(long double x, long double y); // (7) C++17 + + float hypot(float x, float y, float z); // (8) C++17からC++20まで + double hypot(double x, double y, double z); // (9) C++17からC++20まで + long double + hypot(long double x, + long double y, + long double z); // (10) C++17からC++20まで + + floating-point-type + hypot(floating-point-type x, + floating-point-type y, + floating-point-type z); // (11) C++23 + + Promoted + hypot(Arithmetic1 x, + Arithmetic2 y, + Arithmetic3 z); // (12) C++17 } ``` * Promoted[italic] @@ -43,34 +58,37 @@ $$ f(x, y) = \sqrt{x^2 + y^2} $$ 各オーバーロードの概要は、以下の通りである: -- (1) : `double`型について、2引数の平方和の平方根を求める -- (2) : `float`型について、2引数の平方和の平方根を求める -- (3) : `long double`型について、2引数の平方和の平方根を求める -- (4) : 浮動小数点数型以外の算術型について、2引数の平方和の平方根を求める -- (5) : `float`型について、2引数の平方和の平方根を求める -- (6) : `long double`型について、2引数の平方和の平方根を求める -- (7) : `double`型について、3引数の平方和の平方根を求める -- (8) : `float`型について、3引数の平方和の平方根を求める -- (9) : `long double`型について、3引数の平方和の平方根を求める -- (10) : 浮動小数点数型以外の算術型について、3引数の平方和の平方根を求める +- (1) : 2引数版の`float`に対するオーバーロード +- (2) : 2引数版の`double`に対するオーバーロード +- (3) : 2引数版の`long double`に対するオーバーロード +- (4) : 2引数版の浮動小数点数型に対するオーバーロード +- (5) : 2引数版の算術型に対するオーバーロード (大きい精度にキャストして計算される。整数は`double`で計算される) +- (6) : 2引数版の`float`型規定 +- (7) : 2引数版の`long double`型規定 +- (8) : 3引数版の`float`に対するオーバーロード +- (9) : 3引数版の`double`に対するオーバーロード +- (10) : 3引数版の`long double`に対するオーバーロード +- (11) : 3引数版の浮動小数点数型に対するオーバーロード +- (12) : 3引数版の算術型に対するオーバーロード (大きい精度にキャストして計算される。整数は`double`で計算される) ## 戻り値 -- (1)-(6) : 引数 `x` と引数 `y` の平方和の平方根を返す。 -- (7)-(10) : 引数 `x` 、引数 `y` 、引数 `z` の平方和の平方根を返す。 +- (1)-(7) : 引数 `x` と引数 `y` の平方和の平方根を返す。 +- (8)-(12) : 引数 `x` 、引数 `y` 、引数 `z` の平方和の平方根を返す。 オーバーフローエラー、アンダーフローエラーが発生する可能性がある。 ## 備考 -- (1)-(6) : $$ f(x, y) = \sqrt{x^2 + y^2} $$ -- (7)-(10) : $$ f(x, y, z) = \sqrt{x^2 + y^2 + z^2} $$ +- (1)-(7) : $$ f(x, y) = \sqrt{x^2 + y^2} $$ +- (8)-(12) : $$ f(x, y, z) = \sqrt{x^2 + y^2 + z^2} $$ - 概要の「余計なオーバーフロー、アンダーフローを起こさない」とは、たとえ x2 が戻り値型の範囲を超えていても、結果が戻り値型の範囲に収まるのであればオーバーフローしないで正しい結果を返す、と言う事である。 - オーバーフローエラー、アンダーフローエラーが発生した場合の挙動については、[``](../cmath.md) を参照。 - 処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 - - `hypot(x, y)` と `hypot(y, x)` と `hypot(x, -y)` は等価である。 - - `hypot(x, ±0)` は、[`fabs`](fabs.md)`(x)` と等価である。 - - `hypot(±∞, y)` の戻り値は、たとえ `y` が NaN の場合でも `+∞` となる。 + - `hypot(x, y)` と `hypot(y, x)` と `hypot(x, -y)` は等価である。 + - `hypot(x, ±0)` は、[`fabs`](fabs.md)`(x)` と等価である。 + - `hypot(±∞, y)` の戻り値は、たとえ `y` が NaN の場合でも `+∞` となる。 +- C++23では、(1)、(2)、(3)が(4)に統合、(8)、(9)、(10)が(11)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -161,14 +179,14 @@ int main() - [Clang](/implementation.md#clang): 2.9, 3.1 - [GCC](/implementation.md#gcc): 4.3.4, 4.4.5, 4.5.2, 4.6.1, 4.7.0 - [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015, 2017 - - 2002, 2003, 2005, 2008, 2010およびそれ以降では、``でグローバル名前空間に以下が定義されている。 - - 仮引数・戻り値が`float`型の`_hypotf`関数が定義されている。 - - 仮引数・戻り値が`double`型の`hypot`関数と`_hypot`関数が定義されている。 - - 仮引数・戻り値が`long double`型の`_hypotl`マクロが定義されている。 - - 2010, 2012およびそれ以降では、上記に加え``でグローバル名前空間に以下が定義されている。 - - 仮引数・戻り値が`float`型の`hypotf`関数が定義されている。 - - 仮引数・戻り値が`long double`型の`hypotl`マクロが定義されている。 - - 2013以降、`_hypotl`と`hypotl`は関数として定義されている。 + - 2002, 2003, 2005, 2008, 2010およびそれ以降では、``でグローバル名前空間に以下が定義されている。 + - 仮引数・戻り値が`float`型の`_hypotf`関数が定義されている。 + - 仮引数・戻り値が`double`型の`hypot`関数と`_hypot`関数が定義されている。 + - 仮引数・戻り値が`long double`型の`_hypotl`マクロが定義されている。 + - 2010, 2012およびそれ以降では、上記に加え``でグローバル名前空間に以下が定義されている。 + - 仮引数・戻り値が`float`型の`hypotf`関数が定義されている。 + - 仮引数・戻り値が`long double`型の`hypotl`マクロが定義されている。 + - 2013以降、`_hypotl`と`hypotl`は関数として定義されている。 #### 備考 特定の環境で `constexpr` 指定されている場合がある。(独自拡張) @@ -184,3 +202,5 @@ $$ \sqrt{x^2 + y^2} = \left| u \right| \sqrt{1 + \left( \frac{v}{u} \right)^2} \ ## 参照 - [P0030R1 Proposal to Introduce a 3-Argument Overload to `std::hypot`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0030r1.pdf) +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/lgamma.md b/reference/cmath/lgamma.md index fbbfd3d71e..ace61255b5 100644 --- a/reference/cmath/lgamma.md +++ b/reference/cmath/lgamma.md @@ -7,14 +7,17 @@ ```cpp namespace std { - float lgamma(float x); - double lgamma(double x); - long double lgamma(long double x); + float lgamma(float x); // (1) C++11からC++20まで + double lgamma(double x); // (2) C++11からC++20まで + long double lgamma(long double x); // (3) C++11からC++20まで - double lgamma(Integral x); + floating-point-type + lgamma(floating-point-type x); // (4) C++23 - float lgammaf(float x); // C++17 から - long double lgammal(long double x); // C++17 から + double lgamma(Integral x); // (5) C++11 + + float lgammaf(float x); // (6) C++17 + long double lgammal(long double x); // (7) C++17 } ``` * Integral[italic] @@ -22,6 +25,14 @@ namespace std { ## 概要 ガンマ関数の絶対値の自然対数を求める。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 引数 `x` のガンマ関数の絶対値の自然対数を返す。 @@ -36,6 +47,7 @@ namespace std { [`FE_DIVBYZERO`](../cfenv/fe_divbyzero.md)(ゼロ除算浮動小数点例外)が発生する。 - `x = -∞` の場合、戻り値は `+∞` となる。 - `x = +∞` の場合、戻り値は `+∞` となる。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -82,3 +94,8 @@ lgamma(+∞) = inf 特定の環境で `constexpr` 指定されている場合がある。(独自拡張) - GCC 4.6.1 以上 + + +## 参照 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/llrint.md b/reference/cmath/llrint.md index d193710ded..ad4bfdedfe 100644 --- a/reference/cmath/llrint.md +++ b/reference/cmath/llrint.md @@ -6,14 +6,17 @@ ```cpp namespace std { - long long llrint(float x); - long long llrint(double x); - long long llrint(long double x); + long long llrint(float x); // (1) C++11からC++20まで + long long llrint(double x); // (2) C++11からC++20まで + long long llrint(long double x); // (3) C++11からC++20まで - long long llrint(Integral x); + long long + llrint(floating-point-type x); // (4) C++23 - long long llrintf(float x); // C++17 から - long long llrintl(long double x); // C++17 から + long long llrint(Integral x); // (5) C++11 + + long long llrintf(float x); // (6) C++17 + long long llrintl(long double x); // (7) C++17 } ``` * Integral[italic] @@ -21,6 +24,14 @@ namespace std { ## 概要 引数 `x` を現在の丸めモードで `long long` に丸めた値を得る。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 引数 `x` を現在の丸めモードで `long long` に丸めた値 @@ -29,12 +40,13 @@ namespace std { ## 備考 - 本関数は、C99 の規格にある `llrint`(より正確には `math.h` ヘッダの `llrint`、`llrintf`、`llrintl` の 3 つ。それぞれ C++ の `double`、`float`、`long double` バージョンに相当)と等価である。 - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 - - 丸めの結果が `long long` で表現不可能な場合、無効演算の浮動小数点例外([`FE_INVALID`](../cfenv/fe_invalid.md))が発生する。 - - 他の例外が発生しておらず、引数 `x` が戻り値と異なってる場合、不正確結果の浮動小数点例外([`FE_INEXACT`](../cfenv/fe_inexact.md))が発生する。 + - 丸めの結果が `long long` で表現不可能な場合、無効演算の浮動小数点例外([`FE_INVALID`](../cfenv/fe_invalid.md))が発生する。 + - 他の例外が発生しておらず、引数 `x` が戻り値と異なってる場合、不正確結果の浮動小数点例外([`FE_INEXACT`](../cfenv/fe_inexact.md))が発生する。 - C99 では、丸めモードや浮動小数点例外へのアクセスには `#pragma STDC FENV_ACCESS ON` でなければなければならないと記載されているが、C++ には該当する記載を見つけることができなかった。 - なお、C99 でも `FENV_ACCESS` のデフォルトは処理系定義である。 + なお、C99 でも `FENV_ACCESS` のデフォルトは処理系定義である。 - 丸めモード [`FE_TONEAREST`](../cfenv/fe_tonearest.md) は四捨五入ではなく、最近接偶数への丸めであることに注意。(例を参照) - 四捨五入が必要であれば、[`lround`](lround.md) を使用すること。(ただし、[`lround`](lround.md) は本関数と異なり、ISO IEC 60559 に準拠していても [`FE_INEXACT`](../cfenv/fe_inexact.md) が発生するか否かは処理系定義である) + 四捨五入が必要であれば、[`lround`](lround.md) を使用すること。(ただし、[`lround`](lround.md) は本関数と異なり、ISO IEC 60559 に準拠していても [`FE_INEXACT`](../cfenv/fe_inexact.md) が発生するか否かは処理系定義である) +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -149,3 +161,8 @@ llrint(9.22337e+18) = -9223372036854775808, FE_INEXACT = false, FE_INVALID = tru - [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0, 4.9.1, 4.9.2, 5.1.0, 5.2.0, 6.0.0 - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2013, 2015 + + +## 参照 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/log.md b/reference/cmath/log.md index b0546b9bba..de3f1ebe70 100644 --- a/reference/cmath/log.md +++ b/reference/cmath/log.md @@ -6,14 +6,17 @@ ```cpp namespace std { - float log(float x); - double log(double x); - long double log(long double x); + float log(float x); // (1) C++03からC++20まで + double log(double x); // (2) C++03からC++20まで + long double log(long double x); // (3) C++03からC++20まで - double log(Integral x); // C++11 から + floating-point-type + log(floating-point-type x); // (4) C++23 - float logf(float x); // C++17 から - long double logl(long double x); // C++17 から + double log(Integral x); // (5) C++11 + + float logf(float x); // (6) C++17 + long double logl(long double x); // (7) C++17 } ``` * Integral[italic] @@ -21,6 +24,14 @@ namespace std { ## 概要 `e` (ネイピア数) を底とする自然対数を求める。logは「logarithm (対数)」の略である。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 引数 `x` の `e` (ネイピア数) を底とする自然対数を返す。 @@ -32,10 +43,11 @@ namespace std { - $$ f(x) = \log_e x $$ - 定義域エラー、極エラーが発生した場合の挙動については、[``](../cmath.md) を参照。 - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 - - `x = ±0` の場合、戻り値は `-∞` となり、[`FE_DIVBYZERO`](../cfenv/fe_divbyzero.md)(ゼロ除算浮動小数点例外)が発生する。 - - `x = 1` の場合、戻り値は `+0` となる。 - - `x < 0` の場合、戻り値は quiet NaN となり、[`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外)が発生する。 - - `x = +∞` の場合、戻り値は `+∞` となる。 + - `x = ±0` の場合、戻り値は `-∞` となり、[`FE_DIVBYZERO`](../cfenv/fe_divbyzero.md)(ゼロ除算浮動小数点例外)が発生する。 + - `x = 1` の場合、戻り値は `+0` となる。 + - `x < 0` の場合、戻り値は quiet NaN となり、[`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外)が発生する。 + - `x = +∞` の場合、戻り値は `+∞` となる。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -85,3 +97,8 @@ log(-1.0) = nan 以下のマクローリン級数を適当な次数で打ち切ることで近似的に求めることができる。 $$ \log_e (1 + x) = \sum_{n = 1}^{\infty} \frac{(-1)^{n + 1}}{n} x^n \quad \mathrm{for} \; -1 < x \le 1 $$ + + +## 参照 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/log10.md b/reference/cmath/log10.md index b50a952801..b2abb65ab1 100644 --- a/reference/cmath/log10.md +++ b/reference/cmath/log10.md @@ -6,14 +6,17 @@ ```cpp namespace std { - float log10(float x); - double log10(double x); - long double log10(long double x); + float log10(float x); // (1) C++03からC++20まで + double log10(double x); // (2) C++03からC++20まで + long double log10(long double x); // (3) C++03からC++20まで - double log10(Integral x); // C++11 から + floating-point-type + log10(floating-point-type x); // (4) C++23 - float log10f(float x); // C++17 から - long double log10l(long double x); // C++17 から + double log10(Integral x); // (5) C++11 + + float log10f(float x); // (6) C++17 + long double log10l(long double x); // (7) C++17 } ``` * Integral[italic] @@ -21,6 +24,14 @@ namespace std { ## 概要 10 を底とする常用対数を求める。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 引数 `x` の 10 を底とする常用対数を返す。 @@ -32,10 +43,11 @@ namespace std { - $$ f(x) = \log_{10} x $$ - 定義域エラー、極エラーが発生した場合の挙動については、[``](../cmath.md) を参照。 - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 - - `x = ±0` の場合、戻り値は `-∞` となり、[`FE_DIVBYZERO`](../cfenv/fe_divbyzero.md)(ゼロ除算浮動小数点例外)が発生する。 - - `x = 1` の場合、戻り値は `+0` となる。 - - `x < 0` の場合、戻り値は quiet NaN となり、[`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外)が発生する。 - - `x = +∞` の場合、戻り値は `+∞` となる。 + - `x = ±0` の場合、戻り値は `-∞` となり、[`FE_DIVBYZERO`](../cfenv/fe_divbyzero.md)(ゼロ除算浮動小数点例外)が発生する。 + - `x = 1` の場合、戻り値は `+0` となる。 + - `x < 0` の場合、戻り値は quiet NaN となり、[`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外)が発生する。 + - `x = +∞` の場合、戻り値は `+∞` となる。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -118,3 +130,8 @@ log10(100000000.000000) : 8.000000 [`log`](log.md) があれば、以下のように変換することで求められる。 $$ \log_{10} x = \frac{\log_e x}{\log_e 10}$$ + + +## 参照 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/log1p.md b/reference/cmath/log1p.md index cbd9e8120c..4cabef4403 100644 --- a/reference/cmath/log1p.md +++ b/reference/cmath/log1p.md @@ -7,14 +7,17 @@ ```cpp namespace std { - float log1p(float x); - double log1p(double x); - long double log1p(long double x); + float log1p(float x); // (1) C++11からC++20まで + double log1p(double x); // (2) C++11からC++20まで + long double log1p(long double x); // (3) C++11からC++20まで - double log1p(Integral x); + floating-point-type + log1p(floating-point-type x); // (4) C++23 - float log1pf(float x); // C++17 から - long double log1pl(long double x); // C++17 から + double log1p(Integral x); // (5) C++11 + + float log1pf(float x); // (6) C++17 + long double log1pl(long double x); // (7) C++17 } ``` * Integral[italic] @@ -24,6 +27,14 @@ namespace std { 引数が 0 近傍において [`log`](log.md)`(1 + x)` より高精度な計算になる。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 引数 `x` に対して `1 + x` の `e` (ネイピア数) を底とする自然対数を返す。 @@ -35,10 +46,11 @@ namespace std { - $$ f(x) = \log_e (1 + x) $$ - 定義域エラー、極エラーが発生した場合の挙動については、[``](../cmath.md) を参照。 - 処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 - - `x = ±0` の場合、戻り値は `±0` となる。 - - `x = -1` の場合、戻り値は `-∞` となり、[`FE_DIVBYZERO`](../cfenv/fe_divbyzero.md)(ゼロ除算浮動小数点例外)が発生する。 - - `x < -1` の場合、戻り値は quiet NaN となり、[`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外)が発生する。 - - `x = +∞` の場合、戻り値は `+∞` となる。 + - `x = ±0` の場合、戻り値は `±0` となる。 + - `x = -1` の場合、戻り値は `-∞` となり、[`FE_DIVBYZERO`](../cfenv/fe_divbyzero.md)(ゼロ除算浮動小数点例外)が発生する。 + - `x < -1` の場合、戻り値は quiet NaN となり、[`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外)が発生する。 + - `x = +∞` の場合、戻り値は `+∞` となる。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -85,3 +97,8 @@ log1p(-2.0) = -nan 特定の環境で `constexpr` 指定されている場合がある。(独自拡張) - GCC 4.6.1 以上 + + +## 参照 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/log2.md b/reference/cmath/log2.md index 082925fd5c..a2e051fcef 100644 --- a/reference/cmath/log2.md +++ b/reference/cmath/log2.md @@ -7,14 +7,17 @@ ```cpp namespace std { - float log2(float x); - double log2(double x); - long double log2(long double x); + float log2(float x); // (1) C++11からC++20まで + double log2(double x); // (2) C++11からC++20まで + long double log2(long double x); // (3) C++11からC++20まで - double log2(Integral x); + floating-point-type + log2(floating-point-type x); // (4) C++23 - float log2f(float x); // C++17 から - long double log2l(long double x); // C++17 から + double log2(Integral x); // (5) C++11 + + float log2f(float x); // (6) C++17 + long double log2l(long double x); // (7) C++17 } ``` * Integral[italic] @@ -22,6 +25,14 @@ namespace std { ## 概要 2 を底とする二進対数を求める。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 引数 `x` の 2 を底とする二進対数を返す。 @@ -33,10 +44,11 @@ namespace std { - $$ f(x) = \log_2 x $$ - 定義域エラー、極エラーが発生した場合の挙動については、[``](../cmath.md) を参照。 - 処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 - - `x = ±0` の場合、戻り値は `-∞` となり、[`FE_DIVBYZERO`](../cfenv/fe_divbyzero.md)(ゼロ除算浮動小数点例外)が発生する。 - - `x = 1` の場合、戻り値は `+0` となる。 - - `x < 0` の場合、戻り値は quiet NaN となり、[`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外)が発生する。 - - `x = +∞` の場合、戻り値は `+∞` となる。 + - `x = ±0` の場合、戻り値は `-∞` となり、[`FE_DIVBYZERO`](../cfenv/fe_divbyzero.md)(ゼロ除算浮動小数点例外)が発生する。 + - `x = 1` の場合、戻り値は `+0` となる。 + - `x < 0` の場合、戻り値は quiet NaN となり、[`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外)が発生する。 + - `x = +∞` の場合、戻り値は `+∞` となる。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -145,3 +157,8 @@ log2(32) : 5, power of 2 [`log`](log.md) があれば、以下のように変換することで求められる。 $$ \log_2 x = \frac{\log_e x}{\log_e 2}$$ + + +## 参照 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/lrint.md b/reference/cmath/lrint.md index dbcb5393e7..f81ec46648 100644 --- a/reference/cmath/lrint.md +++ b/reference/cmath/lrint.md @@ -6,14 +6,16 @@ ```cpp namespace std { - long lrint(float x); - long lrint(double x); - long lrint(long double x); + long lrint(float x); // (1) C++11からC++20まで + long lrint(double x); // (2) C++11からC++20まで + long lrint(long double x); // (3) C++11からC++20まで - long lrint(Integral x); + long lrint(floating-point-type x); // (4) C++23 - long int lrintf(float x); // C++17 から - long int lrintl(long double x); // C++17 から + long lrint(Integral x); // (5) C++11 + + long int lrintf(float x); // (6) C++17 + long int lrintl(long double x); // (7) C++17 } ``` * Integral[italic] @@ -21,6 +23,14 @@ namespace std { ## 概要 引数 `x` を現在の丸めモードで `long` に丸めた値を得る。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 引数 `x` を現在の丸めモードで `long` に丸めた値 @@ -29,12 +39,13 @@ namespace std { ## 備考 - 本関数は、C99 の規格にある `lrint`(より正確には `math.h` ヘッダの `lrint`、`lrintf`、`lrintl` の 3 つ。それぞれ C++ の `double`、`float`、`long double` バージョンに相当)と等価である。 - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 - - 丸めの結果が `long` で表現不可能な場合、無効演算の浮動小数点例外([`FE_INVALID`](../cfenv/fe_invalid.md))が発生する。 - - 他の例外が発生しておらず、引数 `x` が戻り値と異なってる場合、不正確結果の浮動小数点例外([`FE_INEXACT`](../cfenv/fe_inexact.md))が発生する。 + - 丸めの結果が `long` で表現不可能な場合、無効演算の浮動小数点例外([`FE_INVALID`](../cfenv/fe_invalid.md))が発生する。 + - 他の例外が発生しておらず、引数 `x` が戻り値と異なってる場合、不正確結果の浮動小数点例外([`FE_INEXACT`](../cfenv/fe_inexact.md))が発生する。 - C99 では、丸めモードや浮動小数点例外へのアクセスには `#pragma STDC FENV_ACCESS ON` でなければなければならないと記載されているが、C++ には該当する記載を見つけることができなかった。 - なお、C99 でも `FENV_ACCESS` のデフォルトは処理系定義である。 + なお、C99 でも `FENV_ACCESS` のデフォルトは処理系定義である。 - 丸めモード [`FE_TONEAREST`](../cfenv/fe_tonearest.md) は単なる四捨五入ではないことに注意。 - 四捨五入が必要であれば、[`lround`](lround.md) を使用すること。(ただし、[`lround`](lround.md) は本関数と異なり、ISO IEC 60559 に準拠していても [`FE_INEXACT`](../cfenv/fe_inexact.md) が発生するか否かは処理系定義である) + 四捨五入が必要であれば、[`lround`](lround.md) を使用すること。(ただし、[`lround`](lround.md) は本関数と異なり、ISO IEC 60559 に準拠していても [`FE_INEXACT`](../cfenv/fe_inexact.md) が発生するか否かは処理系定義である) +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -151,4 +162,9 @@ lrint(9.22337e+18) = -9223372036854775808, FE_INEXACT = false, FE_INVALID = true - [Visual C++](/implementation.md#visual_cpp): 2013, 2015 ### 備考 -本関数は C++11 で追加されたが、Clang(libc++) では C++11 モードでなくても使用可能である。 +- 本関数は C++11 で追加されたが、Clang(libc++) では C++11 モードでなくても使用可能である + + +## 参照 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/nearbyint.md b/reference/cmath/nearbyint.md index 8c0b6f9b98..f5d3a067b7 100644 --- a/reference/cmath/nearbyint.md +++ b/reference/cmath/nearbyint.md @@ -6,14 +6,17 @@ ```cpp namespace std { - float nearbyint(float x); - double nearbyint(double x); - long double nearbyint(long double x); + float nearbyint(float x); // (1) C++11からC++20まで + double nearbyint(double x); // (2) C++11からC++20まで + long double nearbyint(long double x); // (3) C++11からC++20まで - double nearbyint(Integral x); + floating-point-type + nearbyint(floating-point-type x); // (4) C++23 - float nearbyintf(float x); // C++17 から - long double nearbyintl(long double x); // C++17 から + double nearbyint(Integral x); // (5) C++11 + + float nearbyintf(float x); // (6) C++17 + long double nearbyintl(long double x); // (7) C++17 } ``` * Integral[italic] @@ -21,6 +24,14 @@ namespace std { ## 概要 引数 `x` を現在の丸めモードで整数値に丸めた値を得る。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 引数 `x` を現在の丸めモードで整数値に丸めた値 @@ -30,11 +41,12 @@ namespace std { - 本関数と [`rint`](rint.md) は戻り値は同一であるが、本関数は引数 `x` が戻り値と異なっていても [`FE_INEXACT`](../cfenv/fe_invalid.md) は発生しないが、[`rint`](rint.md) は発生する可能性がある点のみ動作が異なる。 - 本関数は、C99 の規格にある `nearbyint`(より正確には `math.h` ヘッダの `nearbyint`、`nearbyintf`、`nearbyintl` の 3 つ。それぞれ C++ の `double`、`float`、`long double` バージョンに相当)と等価である。 - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 - - `x = ±0` の場合、`±0` を返す。 - - `x = ±∞` の場合、`±∞` を返す。 + - `x = ±0` の場合、`±0` を返す。 + - `x = ±∞` の場合、`±∞` を返す。 - C99 では、丸めモードの設定時には `#pragma STDC FENV_ACCESS ON` でなければなければならないと記載されているが、C++ には該当する記載を見つけることができなかった。 - なお、C99 でも `FENV_ACCESS` のデフォルトは処理系定義である。 + なお、C99 でも `FENV_ACCESS` のデフォルトは処理系定義である。 - 丸めモード [`FE_TONEAREST`](../cfenv/fe_tonearest.md) は単なる四捨五入ではないことに注意。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -120,4 +132,9 @@ FE_INEXACT = false - [Visual C++](/implementation.md#visual_cpp): 2013, 2015 ### 備考 -本関数は C++11 で追加されたが、Clang(libc++) では C++11 モードでなくても使用可能である。 +- 本関数は C++11 で追加されたが、Clang(libc++) では C++11 モードでなくても使用可能である。 + + +## 参照 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/pow.md b/reference/cmath/pow.md index 17d6a244b3..2fc052767f 100644 --- a/reference/cmath/pow.md +++ b/reference/cmath/pow.md @@ -6,18 +6,22 @@ ```cpp namespace std { - float pow(float x, float y); - double pow(double x, double y); - long double pow(long double x, long double y); + float pow(float x, float y); // (1) C++03からC++20まで + double pow(double x, double y); // (2) C++03からC++20まで + long double pow(long double x, long double y); // (3) C++03からC++20まで - float pow(float x, int y); // C++03 まで - double pow(double x, int y); // C++03 まで - long double pow(long double x, int y); // C++03 まで + float pow(float x, int y); // (4) C++03まで + double pow(double x, int y); // (5) C++03まで + long double pow(long double x, int y); // (6) C++03まで - Promoted pow(Arithmetic1 x, Arithmetic2 y); // C++11 から + floating-point-type + pow(floating-point-type x, + floating-point-type y); // (7) C++23 - float powf(float x, float y); // C++17 から - long double powl(long double x, long double y); // C++17 から + Promoted pow(Arithmetic1 x, Arithmetic2 y); // (8) C++11 + + float powf(float x, float y); // (9) C++17 + long double powl(long double x, long double y); // (10) C++17 } ``` * Promoted[italic] @@ -27,6 +31,17 @@ namespace std { ## 概要 `x` の `y` 乗を求める。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : `float`に対するオーバーロードで、`int`型の`y`をとる +- (5) : `double`に対するオーバーロードで、`int`型の`y`をとる +- (6) : `long double`に対するオーバーロードで、`int`型の`y`をとる +- (7) : 浮動小数点数型に対するオーバーロード +- (8) : 算術型に対するオーバーロード (大きい精度にキャストして計算される。整数は`double`で計算される) +- (9) : `float`型規定 +- (10) : `long double`型規定 + ## 戻り値 `x` を `y` 乗した値を返す。 @@ -38,24 +53,25 @@ namespace std { - $$ f(x, y) = x^y $$ - 定義域エラー、極エラー、オーバーフローエラー、アンダーフローエラーが発生した場合の挙動については、[``](../cmath.md) を参照。 - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。(複号同順) - - `x = ±0` で `y` が負の奇数の場合、戻り値は `±∞` となり、[`FE_DIVBYZERO`](../cfenv/fe_divbyzero.md)(ゼロ除算浮動小数点例外)が発生する。 - - `x = ±0` で `y` が有限でかつ負の奇数ではない場合、戻り値は `+∞` となり、[`FE_DIVBYZERO`](../cfenv/fe_divbyzero.md)(ゼロ除算浮動小数点例外)が発生する。 - - `x = ±0` で `y = -∞` の場合、戻り値は `+∞` となり、[`FE_DIVBYZERO`](../cfenv/fe_divbyzero.md)(ゼロ除算浮動小数点例外)が発生する可能性がある。 - - `x = ±0` で `y` が正の奇数の場合、戻り値は `±0` となる。 - - `x = ±0` で `y` が正でかつ奇数ではない場合、戻り値は `+0` となる。 - - `x = -1` で `y = ±∞` の場合、戻り値は `1` となる。 - - `x = 1` の場合、`y` にかかわらず戻り値は `1` となる(`y` が quiet NaN の場合を含む)。 - - `y = ±0` の場合、`x` にかかわらず戻り値は `1` となる(`x` が quiet NaN の場合を含む)。 - - `|x| < 1` で `y = -∞` の場合、戻り値は `+∞` となる。 - - `|x| > 1` で `y = -∞` の場合、戻り値は `+0` となる。 - - `|x| < 1` で `y = +∞` の場合、戻り値は `+0` となる。 - - `|x| > 1` で `y = +∞` の場合、戻り値は `+∞` となる。 - - `x = -∞` で `y` が負の奇数の場合、戻り値は `-0` となる。 - - `x = -∞` で `y` が負でかつ奇数ではない場合、戻り値は `+0` となる。 - - `x = -∞` で `y` が正の奇数の場合、戻り値は `-∞` となる。 - - `x = -∞` で `y` が正でかつ奇数ではない場合、戻り値は `+∞` となる。 - - `x = +∞` で `y < 0` の場合、戻り値は `+0` となる。 - - `x = +∞` で `y > 0` の場合、戻り値は `+∞` となる。 + - `x = ±0` で `y` が負の奇数の場合、戻り値は `±∞` となり、[`FE_DIVBYZERO`](../cfenv/fe_divbyzero.md)(ゼロ除算浮動小数点例外)が発生する。 + - `x = ±0` で `y` が有限でかつ負の奇数ではない場合、戻り値は `+∞` となり、[`FE_DIVBYZERO`](../cfenv/fe_divbyzero.md)(ゼロ除算浮動小数点例外)が発生する。 + - `x = ±0` で `y = -∞` の場合、戻り値は `+∞` となり、[`FE_DIVBYZERO`](../cfenv/fe_divbyzero.md)(ゼロ除算浮動小数点例外)が発生する可能性がある。 + - `x = ±0` で `y` が正の奇数の場合、戻り値は `±0` となる。 + - `x = ±0` で `y` が正でかつ奇数ではない場合、戻り値は `+0` となる。 + - `x = -1` で `y = ±∞` の場合、戻り値は `1` となる。 + - `x = 1` の場合、`y` にかかわらず戻り値は `1` となる(`y` が quiet NaN の場合を含む)。 + - `y = ±0` の場合、`x` にかかわらず戻り値は `1` となる(`x` が quiet NaN の場合を含む)。 + - `|x| < 1` で `y = -∞` の場合、戻り値は `+∞` となる。 + - `|x| > 1` で `y = -∞` の場合、戻り値は `+0` となる。 + - `|x| < 1` で `y = +∞` の場合、戻り値は `+0` となる。 + - `|x| > 1` で `y = +∞` の場合、戻り値は `+∞` となる。 + - `x = -∞` で `y` が負の奇数の場合、戻り値は `-0` となる。 + - `x = -∞` で `y` が負でかつ奇数ではない場合、戻り値は `+0` となる。 + - `x = -∞` で `y` が正の奇数の場合、戻り値は `-∞` となる。 + - `x = -∞` で `y` が正でかつ奇数ではない場合、戻り値は `+∞` となる。 + - `x = +∞` で `y < 0` の場合、戻り値は `+0` となる。 + - `x = +∞` で `y > 0` の場合、戻り値は `+∞` となる。 +- C++23では、(1)、(2)、(3)が(7)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -121,3 +137,6 @@ $$ x^y = e^{y \log_e x} $$ ただし `x` が負数かつ `y` が整数に等しい場合などについては、別に計算する必要がある。 +## 参照 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/rint.md b/reference/cmath/rint.md index 3568f563dd..85e053f497 100644 --- a/reference/cmath/rint.md +++ b/reference/cmath/rint.md @@ -6,14 +6,17 @@ ```cpp namespace std { - float rint(float x); - double rint(double x); - long double rint(long double x); + float rint(float x); // (1) C++11からC++20まで + double rint(double x); // (2) C++11からC++20まで + long double rint(long double x); // (3) C++11からC++20まで - double rint(Integral x); + floating-point-type + rint(floating-point-type x); // (4) C++23 - float rintf(float x); // C++17 から - long double rintl(long double x); // C++17 から + double rint(Integral x); // (5) C++11 + + float rintf(float x); // (6) C++17 + long double rintl(long double x); // (7) C++17 } ``` * Integral[italic] @@ -21,6 +24,14 @@ namespace std { ## 概要 引数 `x` を現在の丸めモードで整数値に丸めた値を得る。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 引数 `x` を現在の丸めモードで整数値に丸めた値 @@ -30,12 +41,13 @@ namespace std { - 本関数と [`nearbyint`](nearbyint.md) は戻り値は同一であるが、本関数は引数 `x` が戻り値と異なってる場合 [`FE_INEXACT`](../cfenv/fe_inexact.md) が発生する可能性があるが、[`nearbyint`](nearbyint.md) は発生しない点のみ動作が異なる。 - 本関数は、C99 の規格にある `rint`(より正確には `math.h` ヘッダの `rint`、`rintf`、`rintl` の 3 つ。それぞれ C++ の `double`、`float`、`long double` バージョンに相当)と等価である。 - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 - - `x = ±0` の場合、`±0` を返す。 - - `x = ±∞` の場合、`±∞` を返す。 - - 引数 `x` が戻り値と異なってる場合、[`FE_INEXACT`](../cfenv/fe_inexact.md) が発生する。 + - `x = ±0` の場合、`±0` を返す。 + - `x = ±∞` の場合、`±∞` を返す。 + - 引数 `x` が戻り値と異なってる場合、[`FE_INEXACT`](../cfenv/fe_inexact.md) が発生する。 - C99 では、丸めモードの設定時には `#pragma STDC FENV_ACCESS ON` でなければなければならないと記載されているが、C++ には該当する記載を見つけることができなかった。 - なお、C99 でも `FENV_ACCESS` のデフォルトは処理系定義である。 + なお、C99 でも `FENV_ACCESS` のデフォルトは処理系定義である。 - 丸めモード [`FE_TONEAREST`](../cfenv/fe_tonearest.md) は単なる四捨五入ではないことに注意。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -122,4 +134,9 @@ FE_INEXACT = true - [Visual C++](/implementation.md#visual_cpp): 2013, 2015 ### 備考 -本関数は C++11 で追加されたが、Clang(libc++) では C++11 モードでなくても使用可能である。 +- 本関数は C++11 で追加されたが、Clang(libc++) では C++11 モードでなくても使用可能である。 + + +## 参照 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/sin.md b/reference/cmath/sin.md index e26f6e35b8..3b9d23e246 100644 --- a/reference/cmath/sin.md +++ b/reference/cmath/sin.md @@ -6,14 +6,17 @@ ```cpp namespace std { - float sin(float x); - double sin(double x); - long double sin(long double x); + float sin(float x); // (1) C++03からC++20まで + double sin(double x); // (2) C++03からC++20まで + long double sin(long double x); // (3) C++03からC++20まで - double sin(Integral x); // C++11 から + floating-point-type + sin(floating-point-type x); // (4) C++23 - float sinf(float x); // C++17 から - long double sinl(long double x); // C++17 から + double sin(Integral x); // (5) C++11 + + float sinf(float x); // (6) C++17 + long double sinl(long double x); // (7) C++17 } ``` * Integral[italic] @@ -21,6 +24,14 @@ namespace std { ## 概要 算術型の正弦(サイン)を求める。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 引数 `x` の正弦を返す(`x`の単位はラジアン)。 @@ -29,8 +40,9 @@ namespace std { ## 備考 - $$ f(x) = \sin x $$ - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 - - `x = ±0` の場合、戻り値は `±0` となる。(複号同順) - - `x = ±∞` の場合、戻り値は quiet NaN となり、[`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外)が発生する。 + - `x = ±0` の場合、戻り値は `±0` となる。(複号同順) + - `x = ±∞` の場合、戻り値は quiet NaN となり、[`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外)が発生する。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -109,3 +121,8 @@ $$ \sin x = \sum_{n = 0}^{\infty} \frac{(-1)^n}{(2n + 1)!} x^{2n + 1} \quad \mat ## 関連項目 - [`std::numbers::pi`](/reference/numbers/pi.md) + + +## 参照 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/sinh.md b/reference/cmath/sinh.md index fabccedce0..48337b7b64 100644 --- a/reference/cmath/sinh.md +++ b/reference/cmath/sinh.md @@ -6,14 +6,17 @@ ```cpp namespace std { - float sinh(float x); - double sinh(double x); - long double sinh(long double x); + float sinh(float x); // (1) C++03からC++20まで + double sinh(double x); // (2) C++03からC++20まで + long double sinh(long double x); // (3) C++03からC++20まで - double sinh(Integral x); // C++11 から + floating-point-type + sinh(floating-point-type x); // (4) C++23 - float sinhf(float x); // C++17 から - long double sinhl(long double x); // C++17 から + double sinh(Integral x); // (5) C++11 + + float sinhf(float x); // (6) C++17 + long double sinhl(long double x); // (7) C++17 } ``` * Integral[italic] @@ -21,6 +24,14 @@ namespace std { ## 概要 算術型の双曲線正弦(ハイパボリックサイン)を求める。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 引数 `x` の双曲線正弦を返す。 @@ -32,8 +43,9 @@ namespace std { - $$ f(x) = \sinh x $$ - オーバーフローエラーが発生した場合の挙動については、[``](../cmath.md) を参照。 - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。(複号同順) - - `x = ±0` の場合、戻り値は `±0` となる。 - - `x = ±∞` の場合、戻り値は `±∞` となる。 + - `x = ±0` の場合、戻り値は `±0` となる。 + - `x = ±∞` の場合、戻り値は `±∞` となる。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -70,6 +82,7 @@ sinh(1.0) = 1.175201 #### 備考 特定の環境で `constexpr` 指定されている場合がある。(独自拡張) + - GCC 4.6.1 以上 @@ -77,3 +90,8 @@ sinh(1.0) = 1.175201 以下のマクローリン級数を適当な次数で打ち切ることで近似的に求めることができる。 $$ \sinh x = \sum_{n = 0}^{\infty} \frac{1}{(2n + 1)!} x^{2n + 1} \quad \mathrm{for~all} \; x $$ + + +## 参照 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/sqrt.md b/reference/cmath/sqrt.md index d091d8a0ad..b468598515 100644 --- a/reference/cmath/sqrt.md +++ b/reference/cmath/sqrt.md @@ -6,14 +6,17 @@ ```cpp namespace std { - float sqrt(float x); - double sqrt(double x); - long double sqrt(long double x); + float sqrt(float x); // (1) C++03からC++20まで + double sqrt(double x); // (2) C++03からC++20まで + long double sqrt(long double x); // (3) C++03からC++20まで - double sqrt(Integral x); // C++11 から + floating-point-type + sqrt(floating-point-type x); // (4) C++23 - float sqrtf(float x); // C++17 から - long double sqrtl(long double x); // C++17 から + double sqrt(Integral x); // (5) C++11 + + float sqrtf(float x); // (6) C++17 + long double sqrtl(long double x); // (7) C++17 } ``` * Integral[italic] @@ -21,6 +24,14 @@ namespace std { ## 概要 算術型の非負の平方根を求める。sqrtは square root (平方根) の略。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 引数 `x` の非負の平方根を返す。 @@ -33,8 +44,9 @@ namespace std { - $$ f(x) = \sqrt{x} $$ - 定義域エラーが発生した場合の挙動については、[``](../cmath.md) を参照。 - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。(複号同順) - - `x = ±0` の場合、戻り値は `±0` となる。 + - `x = ±0` の場合、戻り値は `±0` となる。 - `-0.0`は`0.0`と等しいため、定義域エラーにはならず、`-0.0`が返る +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -95,3 +107,8 @@ sqrt(-1.0) = -nan $$ a_{n + 1} = \frac{\frac{x}{a_n} + a_n}{2} \quad \mathrm{for} \; x \geq 0 $$ ただし `x` は引数、`a` の初期値は適当な値を選ぶものとする。 + + +## 参照 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/tan.md b/reference/cmath/tan.md index 0cb997396f..18b7e1e639 100644 --- a/reference/cmath/tan.md +++ b/reference/cmath/tan.md @@ -6,14 +6,17 @@ ```cpp namespace std { - float tan(float x); - double tan(double x); - long double tan(long double x); + float tan(float x); // (1) C++03からC++20まで + double tan(double x); // (2) C++03からC++20まで + long double tan(long double x); // (3) C++03からC++20まで - double tan(Integral x); // C++11 から + floating-point-type + tan(floating-point-type x); // (4) C++23 - float tanf(float x); // C++17 から - long double tanl(long double x); // C++17 から + double tan(Integral x); // (5) C++11 + + float tanf(float x); // (6) C++17 + long double tanl(long double x); // (7) C++17 } ``` * Integral[italic] @@ -21,6 +24,14 @@ namespace std { ## 概要 算術型の正接(タンジェント)を求める。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 引数 `x` の正接を返す(`x`の単位はラジアン)。 @@ -29,8 +40,9 @@ namespace std { ## 備考 - $$ f(x) = \tan x $$ - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 - - `x = ±0` の場合、戻り値は `±0` となる。(複号同順) - - `x = ±∞` の場合、戻り値は quiet NaN となり、[`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外)が発生する。 + - `x = ±0` の場合、戻り値は `±0` となる。(複号同順) + - `x = ±∞` の場合、戻り値は quiet NaN となり、[`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外)が発生する。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -72,6 +84,7 @@ tan(pi/2) = 16331239353195370.000000 #### 備考 特定の環境で `constexpr` 指定されている場合がある。(独自拡張) + - GCC 4.6.1 以上 @@ -83,3 +96,8 @@ $$ \tan x = \sum_{n = 1}^{\infty} \frac{B_{2n}(-4)^n(1-4^n)}{(2n)!} x^{2n - 1} \ 以下の公式から求めることができる。 $$ \tan x = \frac{\sin x}{\cos x} $$ + + +## 参照 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/tanh.md b/reference/cmath/tanh.md index 487a1d1aef..d2ae4edd8c 100644 --- a/reference/cmath/tanh.md +++ b/reference/cmath/tanh.md @@ -6,14 +6,17 @@ ```cpp namespace std { - float tanh(float x); - double tanh(double x); - long double tanh(long double x); + float tanh(float x); // (1) C++03からC++20まで + double tanh(double x); // (2) C++03からC++20まで + long double tanh(long double x); // (3) C++03からC++20まで - double tanh(Integral x); // C++11 から + floating-point-type + tanh(floating-point-type x); // (4) C++23 - float tanhf(float x); // C++17 から - long double tanhl(long double x); // C++17 から + double tanh(Integral x); // (5) C++11 + + float tanhf(float x); // (6) C++17 + long double tanhl(long double x); // (7) C++17 } ``` * Integral[italic] @@ -21,6 +24,14 @@ namespace std { ## 概要 算術型の双曲線正接(ハイパボリックタンジェント)を求める。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 引数 `x` の双曲線正接を返す。 @@ -29,8 +40,9 @@ namespace std { ## 備考 - $$ f(x) = \tanh x $$ - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。(複号同順) - - `x = ±0` の場合、戻り値は `±0` となる。 - - `x = ±∞` の場合、戻り値は `±1` となる。 + - `x = ±0` の場合、戻り値は `±0` となる。 + - `x = ±∞` の場合、戻り値は `±1` となる。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -77,3 +89,8 @@ $$ \tanh x = \sum_{n = 1}^{\infty} \frac{B_{2n}4^n(4^n - 1)}{(2n)!} x^{2n - 1} \ 以下の公式から求めることができる。 $$ \tanh x = \frac{\sinh x}{\cosh x} $$ + + +## 参照 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/tgamma.md b/reference/cmath/tgamma.md index e085208c75..0ed6c691b7 100644 --- a/reference/cmath/tgamma.md +++ b/reference/cmath/tgamma.md @@ -7,14 +7,17 @@ ```cpp namespace std { - float tgamma(float x); - double tgamma(double x); - long double tgamma(long double x); + float tgamma(float x); // (1) C++11からC++20まで + double tgamma(double x); // (2) C++11からC++20まで + long double tgamma(long double x); // (3) C++11からC++20まで - double tgamma(Integral x); + floating-point-type + tgamma(floating-point-type x); // (4) C++23 - float tgammaf(float x); // C++17 から - long double tgammal(long double x); // C++17 から + double tgamma(Integral x); // (5) C++11 + + float tgammaf(float x); // (6) C++17 + long double tgammal(long double x); // (7) C++17 } ``` * Integral[italic] @@ -22,6 +25,14 @@ namespace std { ## 概要 ガンマ関数を求める。 +- (1) : `float`に対するオーバーロード +- (2) : `double`に対するオーバーロード +- (3) : `long double`に対するオーバーロード +- (4) : 浮動小数点数型に対するオーバーロード +- (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) +- (6) : `float`型規定 +- (7) : `long double`型規定 + ## 戻り値 引数 `x` のガンマ関数を返す。 @@ -39,6 +50,7 @@ namespace std { [`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外)が発生する。 - `x = +∞` の場合、戻り値は `+∞` となる。 - `gamma` という関数は既にあったが処理系によって定義が違ったため、本当の (true) ガンマ関数 `tgamma` と名付けられた。 +- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -85,3 +97,8 @@ tgamma(+∞) = inf 特定の環境で `constexpr` 指定されている場合がある。(独自拡張) - GCC 4.6.1 以上 + + +## 参照 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした From 0567ba866215221944f3f808e33f23700c92f9cf Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 20 Feb 2023 15:22:56 +0900 Subject: [PATCH 0195/3948] =?UTF-8?q?=20:=20=E6=AE=8B=E3=82=8A?= =?UTF-8?q?=E3=81=AE=E6=95=B0=E5=AD=A6=E9=96=A2=E6=95=B0=E3=82=92=E6=8B=A1?= =?UTF-8?q?=E5=BC=B5=E6=B5=AE=E5=8B=95=E5=B0=8F=E6=95=B0=E7=82=B9=E6=95=B0?= =?UTF-8?q?=E5=9E=8B=E3=81=AB=E5=AF=BE=E5=BF=9C=20#1022?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cmath/cyl_bessel_i.md | 40 +++++++++++++++++++++---- reference/cmath/cyl_bessel_j.md | 44 ++++++++++++++++++++++----- reference/cmath/cyl_bessel_k.md | 42 +++++++++++++++++++++----- reference/cmath/cyl_neumann.md | 36 +++++++++++++++++++--- reference/cmath/ellint_1.md | 38 +++++++++++++++++++---- reference/cmath/ellint_2.md | 38 +++++++++++++++++++---- reference/cmath/ellint_3.md | 41 ++++++++++++++++++++----- reference/cmath/expint.md | 33 ++++++++++++++++++-- reference/cmath/hermite.md | 47 ++++++++++++++++++++++------- reference/cmath/laguerre.md | 53 +++++++++++++++++++++++++-------- reference/cmath/legendre.md | 53 +++++++++++++++++++++++++-------- reference/cmath/riemann_zeta.md | 30 +++++++++++++++++-- reference/cmath/sph_bessel.md | 53 +++++++++++++++++++++++++-------- reference/cmath/sph_legendre.md | 42 ++++++++++++++++++++++---- reference/cmath/sph_neumann.md | 53 +++++++++++++++++++++++++-------- 15 files changed, 528 insertions(+), 115 deletions(-) diff --git a/reference/cmath/cyl_bessel_i.md b/reference/cmath/cyl_bessel_i.md index 63681b73c5..b6a9ecfadf 100644 --- a/reference/cmath/cyl_bessel_i.md +++ b/reference/cmath/cyl_bessel_i.md @@ -7,15 +7,40 @@ ```cpp namespace std { -float cyl_bessel_if(float nu, float x); -double cyl_bessel_i(double nu, double x); -long double cyl_bessel_il(long double nu, long double x); + double + cyl_bessel_i(double nu, + double x); // (1) C++17 + floating-point-type + cyl_bessel_i(floating-point-type nu, + floating-point-type x); // (1) C++23 + + Promoted + cyl_bessel_i(Arithmetic1 nu, + Arithmetic2 x); // (2) C++17 + + float + cyl_bessel_if(float nu, + float x); // (3) C++17 + + long double + cyl_bessel_il(long double nu, + long double x); // (4) C++17 } ``` +* Promoted[italic] +* Arithmetic1[italic] +* Arithmetic2[italic] ## 概要 第一種変形ベッセル関数 (modified Bessel functions of the first kind) を求める。 +- (1) : + - C++17 : `double`に対するオーバーロード + - C++23 : 浮動小数点数型に対するオーバーロード +- (2) : 算術型に対するオーバーロード (対応する大きい方の精度の浮動小数点数型にキャストして計算される) +- (3) : `float`型規定 +- (4) : `long double`型規定 + ## 戻り値 引数 `nu`, `x` の第一種変形ベッセル関数 @@ -28,7 +53,8 @@ $J$ は第一種ベッセル関数 ([`cyl_bessel_j`](cyl_bessel_j.md)) である ## 備考 -`nu >= 128` の場合、この関数の呼び出しの効果は実装定義である。 +- `nu >= 128` の場合、この関数の呼び出しの効果は実装定義である +- (1) : C++23では、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -84,11 +110,13 @@ GCC 7.1.0–8.0.0 では `nu < 0` のときに [`std::domain_error`](/reference/ ## 関連項目 -* 第一種ベッセル関数 [`cyl_bessel_j`](cyl_bessel_j.md) -* 第二種変形ベッセル関数 [`cyl_bessel_k`](cyl_bessel_k.md) +- 第一種ベッセル関数 [`cyl_bessel_j`](cyl_bessel_j.md) +- 第二種変形ベッセル関数 [`cyl_bessel_k`](cyl_bessel_k.md) ## 参照 - [N3060 JTC1.22.29124 Programming Language C++ — Special Math Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3060.pdf) - [WG21 P0226R1 Mathematical Special Functions for C++17, v5](https://isocpp.org/files/papers/P0226R1.pdf) - [ISO/IEC 29124:2010 Information technology -- Programming languages, their environments and system software interfaces -- Extensions to the C++ Library to support mathematical special functions](https://www.iso.org/standard/50511.html) +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/cyl_bessel_j.md b/reference/cmath/cyl_bessel_j.md index 7f4d945e5b..0958d751ed 100644 --- a/reference/cmath/cyl_bessel_j.md +++ b/reference/cmath/cyl_bessel_j.md @@ -7,15 +7,40 @@ ```cpp namespace std { -float cyl_bessel_jf(float nu, float x); -double cyl_bessel_j(double nu, double x); -long double cyl_bessel_jl(long double nu, long double x); + double + cyl_bessel_j(double nu, + double x); // (1) C++17 + floating-point-type + cyl_bessel_j(floating-point-type nu, + floating-point-type x); // (1) C++23 + + Promoted + cyl_bessel_j(Arithmetic1 nu, + Arithmetic2 x); // (2) C++17 + + float + cyl_bessel_jf(float nu, + float x); // (3) C++17 + + long double + cyl_bessel_jl(long double nu, + long double x); // (4) C++17 } ``` +* Promoted[italic] +* Arithmetic1[italic] +* Arithmetic2[italic] ## 概要 第一種ベッセル関数 (Bessel functions of the first kind) を求める。 +- (1) : + - C++17 : `double`に対するオーバーロード + - C++23 : 浮動小数点数型に対するオーバーロード +- (2) : 算術型に対するオーバーロード (対応する大きい方の精度の浮動小数点数型にキャストして計算される) +- (3) : `float`型規定 +- (4) : `long double`型規定 + ## 戻り値 引数 `nu`, `x` の第一種ベッセル関数 @@ -27,7 +52,8 @@ $$ ## 備考 -`nu >= 128` の場合、この関数の呼び出しの効果は実装定義である。 +- `nu >= 128` の場合、この関数の呼び出しの効果は実装定義である +- (1) : C++23では、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -85,13 +111,15 @@ GCC 7.1.0–8.0.0 では `nu < 0` のときに [`std::domain_error`](/reference/ ## 関連項目 -* 第一種変形ベッセル関数 [`cyl_bessel_i`](cyl_bessel_i.md) -* 第二種変形ベッセル関数 [`cyl_bessel_k`](cyl_bessel_k.md) -* 第二種ベッセル関数 [`cyl_neumann`](cyl_neumann.md) -* 第一種球ベッセル関数 [`sph_bessel`](sph_bessel.md) +- 第一種変形ベッセル関数 [`cyl_bessel_i`](cyl_bessel_i.md) +- 第二種変形ベッセル関数 [`cyl_bessel_k`](cyl_bessel_k.md) +- 第二種ベッセル関数 [`cyl_neumann`](cyl_neumann.md) +- 第一種球ベッセル関数 [`sph_bessel`](sph_bessel.md) ## 参照 - [N3060 JTC1.22.29124 Programming Language C++ — Special Math Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3060.pdf) - [WG21 P0226R1 Mathematical Special Functions for C++17, v5](https://isocpp.org/files/papers/P0226R1.pdf) - [ISO/IEC 29124:2010 Information technology -- Programming languages, their environments and system software interfaces -- Extensions to the C++ Library to support mathematical special functions](https://www.iso.org/standard/50511.html) +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/cyl_bessel_k.md b/reference/cmath/cyl_bessel_k.md index 4d8be72c87..8bdb4b930b 100644 --- a/reference/cmath/cyl_bessel_k.md +++ b/reference/cmath/cyl_bessel_k.md @@ -7,15 +7,40 @@ ```cpp namespace std { -float cyl_bessel_kf(float nu, float x); -double cyl_bessel_k(double nu, double x); -long double cyl_bessel_kl(long double nu, long double x); + double + cyl_bessel_k(double nu, + double x); // (1) C++17 + floating-point-type + cyl_bessel_k(floating-point-type nu, + floating-point-type x); // (1) C++23 + + Promoted + cyl_bessel_k(Arithmetic1 nu, + Arithmetic2 x); // (2) C++17 + + float + cyl_bessel_kf(float nu, + float x); // (3) C++17 + + long double + cyl_bessel_kl(long double nu, + long double x); // (4) C++17 } ``` +* Promoted[italic] +* Arithmetic1[italic] +* Arithmetic2[italic] ## 概要 第二種変形ベッセル関数 (modified Bessel functions of the second kind) を求める。 +- (1) : + - C++17 : `double`に対するオーバーロード + - C++23 : 浮動小数点数型に対するオーバーロード +- (2) : 算術型に対するオーバーロード (対応する大きい方の精度の浮動小数点数型にキャストして計算される) +- (3) : `float`型規定 +- (4) : `long double`型規定 + ## 戻り値 引数 `nu`, `x` の第二種変形ベッセル関数 @@ -33,7 +58,8 @@ $I$, $J$, $N$ はそれぞれ ## 備考 -`nu >= 128` の場合、この関数の呼び出しの効果は実装定義である。 +- `nu >= 128` の場合、この関数の呼び出しの効果は実装定義である +- (1) : C++23では、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -89,12 +115,14 @@ GCC 7.1.0–8.0.0 では `nu < 0` のときに [`std::domain_error`](/reference/ ## 関連項目 -* 第一種変形ベッセル関数 [`cyl_bessel_i`](cyl_bessel_i.md) -* 第一種ベッセル関数 [`cyl_bessel_j`](cyl_bessel_j.md) -* 第二種ベッセル関数 [`cyl_neumann`](cyl_neumann.md) +- 第一種変形ベッセル関数 [`cyl_bessel_i`](cyl_bessel_i.md) +- 第一種ベッセル関数 [`cyl_bessel_j`](cyl_bessel_j.md) +- 第二種ベッセル関数 [`cyl_neumann`](cyl_neumann.md) ## 参照 - [N3060 JTC1.22.29124 Programming Language C++ — Special Math Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3060.pdf) - [WG21 P0226R1 Mathematical Special Functions for C++17, v5](https://isocpp.org/files/papers/P0226R1.pdf) - [ISO/IEC 29124:2010 Information technology -- Programming languages, their environments and system software interfaces -- Extensions to the C++ Library to support mathematical special functions](https://www.iso.org/standard/50511.html) +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/cyl_neumann.md b/reference/cmath/cyl_neumann.md index 8e092a00a5..548ce68813 100644 --- a/reference/cmath/cyl_neumann.md +++ b/reference/cmath/cyl_neumann.md @@ -7,15 +7,40 @@ ```cpp namespace std { -float cyl_neumannf(float nu, float x); -double cyl_neumann(double nu, double x); -long double cyl_neumannl(long double nu, long double x); + double + cyl_neumann(double nu, + double x); // (1) C++17 + floating-point-type + cyl_neumann(floating-point-type nu, + floating-point-type x); // (1) C++23 + + Promoted + cyl_neumann(Arithmetic1 nu, + Arithmetic2 x); // (2) C++17 + + float + cyl_neumannf(float nu, + float x); // (3) C++17 + + long double + cyl_neumannl(long double nu, + long double x); // (4) C++17 } ``` +* Promoted[italic] +* Arithmetic1[italic] +* Arithmetic2[italic] ## 概要 第二種ベッセル関数 (Bessel functions of the second kind)、ノイマン関数 (Neumann functions) を求める。 +- (1) : + - C++17 : `double`に対するオーバーロード + - C++23 : 浮動小数点数型に対するオーバーロード +- (2) : 算術型に対するオーバーロード (対応する精度の浮動小数点数型にキャストして計算される) +- (3) : `float`型規定 +- (4) : `long double`型規定 + ## 戻り値 引数 `x` の第二種ベッセル関数 @@ -28,7 +53,8 @@ $J$ は第一種ベッセル関数 ([`cyl_bessel_j`](cyl_bessel_j.md)) である ## 備考 -`nu >= 128` の場合、この関数の呼び出しの効果は実装定義である。 +- `nu >= 128` の場合、この関数の呼び出しの効果は実装定義である +- (1) : C++23では、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -95,3 +121,5 @@ GCC 7.1.0–8.0.0 では `nu < 0` のときに [`std::domain_error`](/reference/ - [N3060 JTC1.22.29124 Programming Language C++ — Special Math Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3060.pdf) - [WG21 P0226R1 Mathematical Special Functions for C++17, v5](https://isocpp.org/files/papers/P0226R1.pdf) - [ISO/IEC 29124:2010 Information technology -- Programming languages, their environments and system software interfaces -- Extensions to the C++ Library to support mathematical special functions](https://www.iso.org/standard/50511.html) +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/ellint_1.md b/reference/cmath/ellint_1.md index 68c4b64d6f..7c47a2c82c 100644 --- a/reference/cmath/ellint_1.md +++ b/reference/cmath/ellint_1.md @@ -7,15 +7,40 @@ ```cpp namespace std { -float ellint_1f(float k, float phi); -double ellint_1(double k, double phi); -long double ellint_1l(long double k, long double phi); + double + ellint_1(double k, + double phi); // (1) C++17 + floating-point-type + ellint_1(floating-point-type k, + floating-point-type phi); // (1) C++23 + + Promoted + ellint_1(Arithmetic1 k, + Arithmetic2 phi); // (2) C++17 + + float + ellint_1f(float k, + float phi); // (3) C++17 + + long double + ellint_1l(long double k, + long double phi); // (4) C++17 } ``` +* Promoted[italic] +* Arithmetic1[italic] +* Arithmetic2[italic] ## 概要 第一種不完全楕円積分 (incomplete elliptic integral of the first kind) を計算する。 +- (1) : + - C++17 : `double`に対するオーバーロード + - C++23 : 浮動小数点数型に対するオーバーロード +- (2) : 算術型に対するオーバーロード (対応する大きい方の精度の浮動小数点数型にキャストして計算される) +- (3) : `float`型規定 +- (4) : `long double`型規定 + ## 戻り値 引数 `k`, `phi` の第一種不完全楕円積分 @@ -27,7 +52,8 @@ $$ ## 備考 -$ F(k, \pi/2) = K(k)$ (第一種完全楕円積分 [`comp_ellint_1`](comp_ellint_1.md))。 +- $ F(k, \pi/2) = K(k)$ (第一種完全楕円積分 [`comp_ellint_1`](comp_ellint_1.md)) +- (1) : C++23では、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -85,10 +111,12 @@ GCC 7.1.0–8.0.0 では `|k| == 1 && |phi| >= π / 2` の場合 `nan` を返す ## 関連項目 -* 第一種完全楕円積分 [`comp_ellint_1`](comp_ellint_1.md) +- 第一種完全楕円積分 [`comp_ellint_1`](comp_ellint_1.md) ## 参照 - [N3060 JTC1.22.29124 Programming Language C++ — Special Math Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3060.pdf) - [WG21 P0226R1 Mathematical Special Functions for C++17, v5](https://isocpp.org/files/papers/P0226R1.pdf) - [ISO/IEC 29124:2010 Information technology -- Programming languages, their environments and system software interfaces -- Extensions to the C++ Library to support mathematical special functions](https://www.iso.org/standard/50511.html) +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/ellint_2.md b/reference/cmath/ellint_2.md index b454f4951a..041b8c6b0d 100644 --- a/reference/cmath/ellint_2.md +++ b/reference/cmath/ellint_2.md @@ -7,15 +7,40 @@ ```cpp namespace std { -float ellint_2f(float k, float phi); -double ellint_2(double k, double phi); -long double ellint_2l(long double k, long double phi); + double + ellint_2(double k, + double phi); // (1) C++17 + floating-point-type + ellint_2(floating-point-type k, + floating-point-type phi); // (1) C++23 + + Promoted + ellint_2(Arithmetic1 k, + Arithmetic2 phi); // (2) C++17 + + float + ellint_2f(float k, + float phi); // (3) C++17 + + long double + ellint_2l(long double k, + long double phi); // (4) C++17 } ``` +* Promoted[italic] +* Arithmetic1[italic] +* Arithmetic2[italic] ## 概要 第二種不完全楕円積分 (incomplete elliptic integral of the second kind) を計算する。 +- (1) : + - C++17 : `double`に対するオーバーロード + - C++23 : 浮動小数点数型に対するオーバーロード +- (2) : 算術型に対するオーバーロード (対応する大きい方の精度の浮動小数点数型にキャストして計算される) +- (3) : `float`型規定 +- (4) : `long double`型規定 + ## 戻り値 引数 `k`, `phi` の第二種不完全楕円積分 @@ -27,7 +52,8 @@ $$ ## 備考 -$ E(k, \pi/2) = E(k) $ (第二種完全楕円積分 [`comp_ellint_2`](comp_ellint_2.md))。 +- $ E(k, \pi/2) = E(k) $ (第二種完全楕円積分 [`comp_ellint_2`](comp_ellint_2.md)) +- (1) : C++23では、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -80,10 +106,12 @@ ellint_2(1, 0.5 pi) = 1 ## 関連項目 -* 第二種完全楕円積分 [`comp_ellint_2`](comp_ellint_2.md) +- 第二種完全楕円積分 [`comp_ellint_2`](comp_ellint_2.md) ## 参照 - [N3060 JTC1.22.29124 Programming Language C++ — Special Math Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3060.pdf) - [WG21 P0226R1 Mathematical Special Functions for C++17, v5](https://isocpp.org/files/papers/P0226R1.pdf) - [ISO/IEC 29124:2010 Information technology -- Programming languages, their environments and system software interfaces -- Extensions to the C++ Library to support mathematical special functions](https://www.iso.org/standard/50511.html) +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/ellint_3.md b/reference/cmath/ellint_3.md index 09166a3f96..b48b69b775 100644 --- a/reference/cmath/ellint_3.md +++ b/reference/cmath/ellint_3.md @@ -7,15 +7,40 @@ ```cpp namespace std { -float ellint_3f(float k, float nu, float phi); -double ellint_3(double k, double nu, double phi); -long double ellint_3l(long double k, long double nu, long double phi); + double + ellint_3(double k, + double phi); // (1) C++17 + floating-point-type + ellint_3(floating-point-type k, + floating-point-type phi); // (1) C++23 + + Promoted + ellint_3(Arithmetic1 k, + Arithmetic2 phi); // (2) C++17 + + float + ellint_3f(float k, + float phi); // (3) C++17 + + long double + ellint_3l(long double k, + long double phi); // (4) C++17 } ``` +* Promoted[italic] +* Arithmetic1[italic] +* Arithmetic2[italic] ## 概要 第三種不完全楕円積分 (incomplete elliptic integral of the third kind) を計算する。 +- (1) : + - C++17 : `double`に対するオーバーロード + - C++23 : 浮動小数点数型に対するオーバーロード +- (2) : 算術型に対するオーバーロード (対応する大きい方の精度の浮動小数点数型にキャストして計算される) +- (3) : `float`型規定 +- (4) : `long double`型規定 + ## 戻り値 引数 `k`, `nu`, `phi` の第三種不完全楕円積分 @@ -28,9 +53,9 @@ $$ ## 備考 -$ \Pi(\nu, k, \pi/2) = \Pi(\nu, k) $ (第三種完全楕円積分 [`comp_ellint_3`](comp_ellint_3.md))。 - -$ \Pi(0, k, \phi) = F(k, \phi) $ (第一種不完全楕円積分 [`ellint_1`](ellint_1.md))。 +- $ \Pi(\nu, k, \pi/2) = \Pi(\nu, k) $ (第三種完全楕円積分 [`comp_ellint_3`](comp_ellint_3.md)) +- $ \Pi(0, k, \phi) = F(k, \phi) $ (第一種不完全楕円積分 [`ellint_1`](ellint_1.md)) +- (1) : C++23では、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -109,10 +134,12 @@ GCC 7.1.0–8.0.0 では `1 - nu * sin^2(phi) < 0` のときに [`std::domain_er ## 関連項目 -* 第三種完全楕円積分 [`comp_ellint_3`](comp_ellint_3.md) +- 第三種完全楕円積分 [`comp_ellint_3`](comp_ellint_3.md) ## 参照 - [N3060 JTC1.22.29124 Programming Language C++ — Special Math Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3060.pdf) - [WG21 P0226R1 Mathematical Special Functions for C++17, v5](https://isocpp.org/files/papers/P0226R1.pdf) - [ISO/IEC 29124:2010 Information technology -- Programming languages, their environments and system software interfaces -- Extensions to the C++ Library to support mathematical special functions](https://www.iso.org/standard/50511.html) +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/expint.md b/reference/cmath/expint.md index 58a766535f..ee4e7b02a5 100644 --- a/reference/cmath/expint.md +++ b/reference/cmath/expint.md @@ -7,20 +7,45 @@ ```cpp namespace std { -float expintf(float x); -double expint(double x); -long double expintl(long double x); + double + expint(double x); // (1) C++17 + floating-point-type + expint(floating-point-type x); // (1) C++23 + + Promoted + expint(Arithmetic x); // (2) C++17 + + float + expintf(float x); // (3) C++17 + + long double + expintl(long double x); // (4) C++17 } ``` +* Promoted[italic] +* Arithmetic[italic] ## 概要 指数積分 (exponential integral) を求める。 +- (1) : + - C++17 : `double`に対するオーバーロード + - C++23 : 浮動小数点数型に対するオーバーロード +- (2) : 算術型に対するオーバーロード (対応する精度の浮動小数点数型にキャストして計算される) +- (3) : `float`型規定 +- (4) : `long double`型規定 + + ## 戻り値 引数 `x` の指数積分 $$ \mathrm{Ei}(x) = - \int_{-x}^\infty \mathrm{d}t \frac{e^{-t}}{t} = - \int_{-\infty}^x \mathrm{d}t \frac{e^t}{t} $$ を返す。 + +## 備考 +- (1) : C++23では、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された + + ## 例 ```cpp example #include @@ -62,3 +87,5 @@ expint(∞) = -nan - [N3060 JTC1.22.29124 Programming Language C++ — Special Math Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3060.pdf) - [WG21 P0226R1 Mathematical Special Functions for C++17, v5](https://isocpp.org/files/papers/P0226R1.pdf) - [ISO/IEC 29124:2010 Information technology -- Programming languages, their environments and system software interfaces -- Extensions to the C++ Library to support mathematical special functions](https://www.iso.org/standard/50511.html) +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/hermite.md b/reference/cmath/hermite.md index 8484383d4a..cfe3004a2b 100644 --- a/reference/cmath/hermite.md +++ b/reference/cmath/hermite.md @@ -7,15 +7,39 @@ ```cpp namespace std { -float hermitef(unsigned n, float x); -double hermite(unsigned n, double x); -long double hermitel(unsigned n, long double x); + double + hermite(unsigned int n, + double x); // (1) C++17 + floating-point-type + hermite(unsigned int n, + floating-point-type x); // (1) C++23 + + Promoted + hermite(unsigned int n, + Arithmetic x); // (2) C++17 + + float + hermitef(unsigned int n, + float x); // (3) C++17 + + long double + hermitel(unsigned int n, + long double x); // (4) C++17 } ``` +* Promoted[italic] +* Arithmetic[italic] ## 概要 エルミート多項式 (Hermite polynomials) を求める。 +- (1) : + - C++17 : `double`に対するオーバーロード + - C++23 : 浮動小数点数型に対するオーバーロード +- (2) : 算術型に対するオーバーロード (対応する精度の浮動小数点数型にキャストして計算される) +- (3) : `float`型規定 +- (4) : `long double`型規定 + ## 戻り値 引数 `n`, `x` のエルミート多項式 @@ -24,7 +48,8 @@ $$ H_n(x) = (-1)^n \exp(x^2) \frac{\mathrm{d}^n}{\mathrm{d}x^n} \exp(-x^2) $$ ## 備考 -`n >= 128` の場合、この関数の呼び出しの効果は実装定義である。 +- `n >= 128` の場合、この関数の呼び出しの効果は実装定義である +- (1) : C++23では、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -78,15 +103,17 @@ hermite(3, 1) = -4 - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? -## 参照 -- [N3060 JTC1.22.29124 Programming Language C++ — Special Math Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3060.pdf) -- [WG21 P0226R1 Mathematical Special Functions for C++17, v5](https://isocpp.org/files/papers/P0226R1.pdf) -- [ISO/IEC 29124:2010 Information technology -- Programming languages, their environments and system software interfaces -- Extensions to the C++ Library to support mathematical special functions](https://www.iso.org/standard/50511.html) - - ## 実装例 ### 閉形式 $$ H_n(x) = n! \sum_{j=0}^{\lfloor n / 2 \rfloor} \frac{(-1)^j}{j! (n - 2j)!} (2x)^{n - 2j} $$ ### 漸化式 $$ H_n(x) = 2 x H_{n-1}(x) - 2 (n-1) H_{n-2}(x); H_0(x) = 1, H_1(x) = 2x $$ + + +## 参照 +- [N3060 JTC1.22.29124 Programming Language C++ — Special Math Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3060.pdf) +- [WG21 P0226R1 Mathematical Special Functions for C++17, v5](https://isocpp.org/files/papers/P0226R1.pdf) +- [ISO/IEC 29124:2010 Information technology -- Programming languages, their environments and system software interfaces -- Extensions to the C++ Library to support mathematical special functions](https://www.iso.org/standard/50511.html) +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/laguerre.md b/reference/cmath/laguerre.md index ee4fac8c39..1f3ada630d 100644 --- a/reference/cmath/laguerre.md +++ b/reference/cmath/laguerre.md @@ -7,15 +7,39 @@ ```cpp namespace std { -float laguerref(unsigned n, float x); -double laguerre(unsigned n, double x); -long double laguerrel(unsigned n, long double x); + double + laguerre(unsigned int n, + double x); // (1) C++17 + floating-point-type + laguerre(unsigned int n, + floating-point-type x); // (1) C++23 + + Promoted + laguerre(unsigned int n, + Arithmetic x); // (2) C++17 + + float + laguerref(unsigned int n, + float x); // (3) C++17 + + long double + laguerrel(unsigned int n, + long double x); // (4) C++17 } ``` +* Promoted[italic] +* Arithmetic[italic] ## 概要 ラゲール多項式 (Laguerre polynomials) を求める。 +- (1) : + - C++17 : `double`に対するオーバーロード + - C++23 : 浮動小数点数型に対するオーバーロード +- (2) : 算術型に対するオーバーロード (対応する精度の浮動小数点数型にキャストして計算される) +- (3) : `float`型規定 +- (4) : `long double`型規定 + ## 戻り値 引数 `n`, `x` のラゲール多項式 @@ -24,7 +48,8 @@ $$ L_n(x) = \frac{e^x}{n!} \frac{\mathrm{d}^n}{\mathrm{d}x^n} (x^n e^{-x}) \quad ## 備考 -`n >= 128` の場合、この関数の呼び出しの効果は実装定義である。 +- `n >= 128` の場合、この関数の呼び出しの効果は実装定義である +- (1) : C++23では、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -79,19 +104,21 @@ laguerre(3, 2) = -0.333333 - [Visual C++](/implementation.md#visual_cpp): ?? +## 実装例 +### 閉形式 +$$ L_n(x) = \sum_{j=0}^n \frac{n!}{j! (n-j)!} \frac{(-x)^j}{j!} $$ + +### 漸化式 +$$ L_{n}(x) = \frac{(2n - 1 - x) L_{n-1}(x) - (n-1) L_{n-2}(x)}{n}; L_0(x) = 1, L_1(x) = -x + 1 $$ + + ## 関連項目 -* ラゲール陪多項式 [`assoc_laguerre`](assoc_laguerre.md) +- ラゲール陪多項式 [`assoc_laguerre`](assoc_laguerre.md) ## 参照 - [N3060 JTC1.22.29124 Programming Language C++ — Special Math Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3060.pdf) - [WG21 P0226R1 Mathematical Special Functions for C++17, v5](https://isocpp.org/files/papers/P0226R1.pdf) - [ISO/IEC 29124:2010 Information technology -- Programming languages, their environments and system software interfaces -- Extensions to the C++ Library to support mathematical special functions](https://www.iso.org/standard/50511.html) - - -## 実装例 -### 閉形式 -$$ L_n(x) = \sum_{j=0}^n \frac{n!}{j! (n-j)!} \frac{(-x)^j}{j!} $$ - -### 漸化式 -$$ L_{n}(x) = \frac{(2n - 1 - x) L_{n-1}(x) - (n-1) L_{n-2}(x)}{n}; L_0(x) = 1, L_1(x) = -x + 1 $$ +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/legendre.md b/reference/cmath/legendre.md index 77edfbec86..2bf88a55b5 100644 --- a/reference/cmath/legendre.md +++ b/reference/cmath/legendre.md @@ -7,15 +7,39 @@ ```cpp namespace std { -float legendref(unsigned l, float x); -double legendre(unsigned l, double x); -long double legendrel(unsigned l, long double x); + double + legendre(unsigned int n, + double x); // (1) C++17 + floating-point-type + legendre(unsigned int n, + floating-point-type x); // (1) C++23 + + Promoted + legendre(unsigned int n, + Arithmetic x); // (2) C++17 + + float + legendref(unsigned int n, + float x); // (3) C++17 + + long double + legendrel(unsigned int n, + long double x); // (4) C++17 } ``` +* Promoted[italic] +* Arithmetic[italic] ## 概要 ルジャンドル多項式 (Legendre polynomials) を求める。 +- (1) : + - C++17 : `double`に対するオーバーロード + - C++23 : 浮動小数点数型に対するオーバーロード +- (2) : 算術型に対するオーバーロード (対応する精度の浮動小数点数型にキャストして計算される) +- (3) : `float`型規定 +- (4) : `long double`型規定 + ## 戻り値 引数 `l`, `x` のルジャンドル多項式 @@ -24,7 +48,8 @@ $$ P_l(x) = \frac{1}{2^l l!} \frac{\mathrm{d}^l}{\mathrm{d}x^l} (x^2 - 1)^l \qua ## 備考 -`l >= 128` の場合、この関数の呼び出しの効果は実装定義である。 +- `n >= 128` の場合、この関数の呼び出しの効果は実装定義である +- (1) : C++23では、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -79,19 +104,21 @@ legendre(3, 1) = 1 - [Visual C++](/implementation.md#visual_cpp): ?? +## 実装例 +### 閉形式 +$$ P_l(x) = \frac{1}{2^l l!} \sum_{j=0}^{\lfloor l/2 \rfloor} (-1)^j \frac{l! (2l-2j)!}{j! (l-j)! (l-2j)!} x^{l-2j} $$ + +### 漸化式 +$$ P_l(x) = \frac{(2l-1) xP_{l-1}(x) - (l-1) P_{l-2}(x)}{l}; P_0(x) = 1, P_1(x) = x $$ + + ## 関連項目 -* ルジャンドル陪関数 [`assoc_legendre`](assoc_legendre.md) +- ルジャンドル陪関数 [`assoc_legendre`](assoc_legendre.md) ## 参照 - [N3060 JTC1.22.29124 Programming Language C++ — Special Math Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3060.pdf) - [WG21 P0226R1 Mathematical Special Functions for C++17, v5](https://isocpp.org/files/papers/P0226R1.pdf) - [ISO/IEC 29124:2010 Information technology -- Programming languages, their environments and system software interfaces -- Extensions to the C++ Library to support mathematical special functions](https://www.iso.org/standard/50511.html) - - -## 実装例 -### 閉形式 -$$ P_l(x) = \frac{1}{2^l l!} \sum_{j=0}^{\lfloor l/2 \rfloor} (-1)^j \frac{l! (2l-2j)!}{j! (l-j)! (l-2j)!} x^{l-2j} $$ - -### 漸化式 -$$ P_l(x) = \frac{(2l-1) xP_{l-1}(x) - (l-1) P_{l-2}(x)}{l}; P_0(x) = 1, P_1(x) = x $$ +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/riemann_zeta.md b/reference/cmath/riemann_zeta.md index f9763835d5..b6a8981d53 100644 --- a/reference/cmath/riemann_zeta.md +++ b/reference/cmath/riemann_zeta.md @@ -7,15 +7,34 @@ ```cpp namespace std { -float riemann_zetaf(float x); -double riemann_zeta(double x); -long double riemann_zetal(long double x); + double + riemann_zeta(double x); // (1) C++17 + floating-point-type + riemann_zeta(floating-point-type x); // (1) C++23 + + Promoted + riemann_zeta(Arithmetic x); // (2) C++17 + + float + riemann_zetaf(float x); // (3) C++17 + + long double + riemann_zetal(long double x); // (4) C++17 } ``` +* Promoted[italic] +* Arithmetic[italic] ## 概要 リーマンのゼータ関数 (Riemann zeta function) を求める。 +- (1) : + - C++17 : `double`に対するオーバーロード + - C++23 : 浮動小数点数型に対するオーバーロード +- (2) : 算術型に対するオーバーロード (対応する精度の浮動小数点数型にキャストして計算される) +- (3) : `float`型規定 +- (4) : `long double`型規定 + ## 戻り値 引数 `x` のリーマンゼータ関数 @@ -31,6 +50,9 @@ $$ $$ を返す。 +## 備考 +- (1) : C++23では、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された + ## 例 ```cpp example @@ -72,3 +94,5 @@ riemann_zeta(2) = 1.64493 - [N3060 JTC1.22.29124 Programming Language C++ — Special Math Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3060.pdf) - [WG21 P0226R1 Mathematical Special Functions for C++17, v5](https://isocpp.org/files/papers/P0226R1.pdf) - [ISO/IEC 29124:2010 Information technology -- Programming languages, their environments and system software interfaces -- Extensions to the C++ Library to support mathematical special functions](https://www.iso.org/standard/50511.html) +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/sph_bessel.md b/reference/cmath/sph_bessel.md index 6e26a7b1f5..ec9ba8c175 100644 --- a/reference/cmath/sph_bessel.md +++ b/reference/cmath/sph_bessel.md @@ -7,15 +7,39 @@ ```cpp namespace std { -float sph_besself(unsigned n, float x); -double sph_bessel(unsigned n, double x); -long double sph_bessell(unsigned n, long double x); + double + sph_bessel(unsigned int n, + double x); // (1) C++17 + floating-point-type + sph_bessel(unsigned int n, + floating-point-type x); // (1) C++23 + + Promoted + sph_bessel(unsigned int n, + Arithmetic x); // (2) C++17 + + float + sph_besself(unsigned int n, + float x); // (3) C++17 + + long double + sph_bessell(unsigned int n, + long double x); // (4) C++17 } ``` +* Promoted[italic] +* Arithmetic[italic] ## 概要 第一種球ベッセル関数 (spherical Bessel functions of the first kind) を求める。 +- (1) : + - C++17 : `double`に対するオーバーロード + - C++23 : 浮動小数点数型に対するオーバーロード +- (2) : 算術型に対するオーバーロード (対応する精度の浮動小数点数型にキャストして計算される) +- (3) : `float`型規定 +- (4) : `long double`型規定 + ## 戻り値 引数 `n`, `x` の第一種球ベッセル関数 @@ -28,7 +52,8 @@ $J$ は第一種ベッセル関数 ([`cyl_bessel_j`](cyl_bessel_j.md))。 ## 備考 -`n >= 128` の場合、この関数の呼び出しの効果は実装定義である。 +- `n >= 128` の場合、この関数の呼び出しの効果は実装定義である +- (1) : C++23では、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -80,19 +105,21 @@ sph_bessel(2, 0.5 pi) = 0.137417 - [Visual C++](/implementation.md#visual_cpp): ?? +## 実装例 +### 漸化式 +$$ +j_n(x) = \frac{2n-1}{x} j_{n-1}(x) - j_{n-2}(x); +j_0(x) = \frac{\sin x}{x}, j_1(x) = \frac{\sin x}{x^2} - \frac{\cos x}{x} +$$ + + ## 関連項目 -* 第一種ベッセル関数 [`cyl_bessel_j`](cyl_bessel_j.md) +- 第一種ベッセル関数 [`cyl_bessel_j`](cyl_bessel_j.md) ## 参照 - [N3060 JTC1.22.29124 Programming Language C++ — Special Math Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3060.pdf) - [WG21 P0226R1 Mathematical Special Functions for C++17, v5](https://isocpp.org/files/papers/P0226R1.pdf) - [ISO/IEC 29124:2010 Information technology -- Programming languages, their environments and system software interfaces -- Extensions to the C++ Library to support mathematical special functions](https://www.iso.org/standard/50511.html) - - -## 実装例 -### 漸化式 -$$ -j_n(x) = \frac{2n-1}{x} j_{n-1}(x) - j_{n-2}(x); -j_0(x) = \frac{\sin x}{x}, j_1(x) = \frac{\sin x}{x^2} - \frac{\cos x}{x} -$$ +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/sph_legendre.md b/reference/cmath/sph_legendre.md index 4a6b9df584..8f370c09d1 100644 --- a/reference/cmath/sph_legendre.md +++ b/reference/cmath/sph_legendre.md @@ -7,15 +7,44 @@ ```cpp namespace std { -float sph_legendref(unsigned l, unsigned m, float theta); -double sph_legendre(unsigned l, unsigned m, double theta); -long double sph_legendrel(unsigned l, unsigned m, long double theta); + double + sph_legendre(unsigned int l, + unsigned int m, + double theta); // (1) C++17 + floating-point-type + sph_legendre(unsigned int l, + unsigned int m, + floating-point-type theta); // (1) C++23 + + Promoted + sph_legendre(unsigned int l, + unsigned int m, + Arithmetic theta); // (2) C++17 + + float + sph_legendref(unsigned int l, + unsigned int m, + float theta); // (3) C++17 + + long double + sph_legendrel(unsigned int l, + unsigned int m, + long double theta); // (4) C++17 } ``` +* Promoted[italic] +* Arithmetic[italic] ## 概要 球面調和関数 (spherical harmonic function) の *θ* 成分を求める。 +- (1) : + - C++17 : `double`に対するオーバーロード + - C++23 : 浮動小数点数型に対するオーバーロード +- (2) : 算術型に対するオーバーロード (対応する精度の浮動小数点数型にキャストして計算される) +- (3) : `float`型規定 +- (4) : `long double`型規定 + ## 戻り値 引数 `l`, `m`, `theta` について $Y_l^m(\theta, 0)$ を返す。 @@ -29,7 +58,8 @@ $P_l^m$ はルジャンドル陪関数 ([`assoc_legendre`](assoc_legendre.md)) ## 備考 -`l >= 128` の場合、この関数の呼び出しの効果は実装定義である。 +- `l >= 128` の場合、この関数の呼び出しの効果は実装定義である +- (1) : C++23では、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -115,10 +145,12 @@ GCC 7.1.0–8.0.0 では `l < m` の場合 ($Y_l^m = 0$) [`std::domain_error`](/ ## 関連項目 -* ルジャンドル陪関数 [`assoc_legendre`](assoc_legendre.md) +- ルジャンドル陪関数 [`assoc_legendre`](assoc_legendre.md) ## 参照 - [N3060 JTC1.22.29124 Programming Language C++ — Special Math Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3060.pdf) - [WG21 P0226R1 Mathematical Special Functions for C++17, v5](https://isocpp.org/files/papers/P0226R1.pdf) - [ISO/IEC 29124:2010 Information technology -- Programming languages, their environments and system software interfaces -- Extensions to the C++ Library to support mathematical special functions](https://www.iso.org/standard/50511.html) +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cmath/sph_neumann.md b/reference/cmath/sph_neumann.md index 0cb874ef5f..9eb76458a3 100644 --- a/reference/cmath/sph_neumann.md +++ b/reference/cmath/sph_neumann.md @@ -7,15 +7,39 @@ ```cpp namespace std { -float sph_neumannf(unsigned n, float x); -double sph_neumann(unsigned n, double x); -long double sph_neumannl(unsigned n, long double x); + double + sph_neumann(unsigned int n, + double x); // (1) C++17 + floating-point-type + sph_neumann(unsigned int n, + floating-point-type x); // (1) C++23 + + Promoted + sph_neumann(unsigned int n, + Arithmetic x); // (2) C++17 + + float + sph_neumannf(unsigned int n, + float x); // (3) C++17 + + long double + sph_neumannl(unsigned int n, + long double x); // (4) C++17 } ``` +* Promoted[italic] +* Arithmetic[italic] ## 概要 第二種球ベッセル関数 (spherical Bessel functions of the second kind)、球ノイマン関数 (spherical Neumann functions) を求める。 +- (1) : + - C++17 : `double`に対するオーバーロード + - C++23 : 浮動小数点数型に対するオーバーロード +- (2) : 算術型に対するオーバーロード (対応する精度の浮動小数点数型にキャストして計算される) +- (3) : `float`型規定 +- (4) : `long double`型規定 + ## 戻り値 引数 `n`, `x` の第二種球ベッセル関数 @@ -28,7 +52,8 @@ $N$ は第二種ベッセル関数 ([`cyl_neumann`](cyl_neumann.md))。 ## 備考 -`n >= 128` の場合、この関数の呼び出しの効果は実装定義である。 +- `n >= 128` の場合、この関数の呼び出しの効果は実装定義である +- (1) : C++23では、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 @@ -80,19 +105,21 @@ sph_neumann(2, 0.5 pi) = -1.21585 - [Visual C++](/implementation.md#visual_cpp): ?? +## 実装例 +### 漸化式 +$$ +n_n(x) = \frac{2n-1}{x} n_{n-1}(x) - n_{n-2}(x); +n_0(x) = - \frac{\cos x}{x}, n_1(x) = - \frac{\cos x}{x^2} - \frac{\sin x}{x} +$$ + + ## 関連項目 -* 第二種ベッセル関数 [`cyl_neumann`](cyl_neumann.md) +- 第二種ベッセル関数 [`cyl_neumann`](cyl_neumann.md) ## 参照 - [N3060 JTC1.22.29124 Programming Language C++ — Special Math Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3060.pdf) - [WG21 P0226R1 Mathematical Special Functions for C++17, v5](https://isocpp.org/files/papers/P0226R1.pdf) - [ISO/IEC 29124:2010 Information technology -- Programming languages, their environments and system software interfaces -- Extensions to the C++ Library to support mathematical special functions](https://www.iso.org/standard/50511.html) - - -## 実装例 -### 漸化式 -$$ -n_n(x) = \frac{2n-1}{x} n_{n-1}(x) - n_{n-2}(x); -n_0(x) = - \frac{\cos x}{x}, n_1(x) = - \frac{\cos x}{x^2} - \frac{\sin x}{x} -$$ +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした From 2d01c561c9be61f02c5bac8113902099b2289481 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 20 Feb 2023 18:33:35 +0900 Subject: [PATCH 0196/3948] =?UTF-8?q?=20:=20abs=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=20#1067=20#1022?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cmath/abs.md | 2 +- reference/complex/complex/abs.md | 32 +++++----- reference/cstdlib.md | 6 +- reference/cstdlib/abs.md | 100 +++++++++++++++++++++++++++++++ 4 files changed, 120 insertions(+), 20 deletions(-) create mode 100644 reference/cstdlib/abs.md diff --git a/reference/cmath/abs.md b/reference/cmath/abs.md index 2fd23a2317..8ae5febb3b 100644 --- a/reference/cmath/abs.md +++ b/reference/cmath/abs.md @@ -45,7 +45,7 @@ namespace std { ## 戻り値 引数 `x` の絶対値を返す。 -- (1),(2),(3) : `x` が `±∞` だった場合 `+∞` を返す。 +- (1),(2),(3),(4) : `x` が `±∞` だった場合 `+∞` を返す。 ## 備考 diff --git a/reference/complex/complex/abs.md b/reference/complex/complex/abs.md index cf7686b0e0..69f779ae0c 100644 --- a/reference/complex/complex/abs.md +++ b/reference/complex/complex/abs.md @@ -24,21 +24,21 @@ namespace std { - 処理系が ISO IEC 60559 に準拠しているかどうかは、C99 の場合はマクロ `__STDC_IEC_559_COMPLEX__` が `1` に定義されている事で判別可能であるが、C++ の規格書には該当する記載を見つける事ができなかった。 - 絶対値の算出については、一部の算術型、および、[`valarray`](/reference/valarray/valarray.md) クラステンプレートに対しても、他のヘッダで定義されている。 - | 引数の型 | 関数 | ヘッダ | 備考 | - |----------------------------------------------------|-----------------------------------------------|--------------------------------------|------------| - | `float` | [`abs`](/reference/cmath/abs.md) | [`cmath`](/reference/cmath.md) | | - | | [`fabs`](/reference/cmath/fabs.md) | [`cmath`](/reference/cmath.md) | | - | `double` | [`abs`](/reference/cmath/abs.md) | [`cmath`](/reference/cmath.md) | | - | | [`fabs`](/reference/cmath/fabs.md) | [`cmath`](/reference/cmath.md) | | - | `long double` | [`abs`](/reference/cmath/abs.md) | [`cmath`](/reference/cmath.md) | | - | | [`fabs`](/reference/cmath/fabs.md) | [`cmath`](/reference/cmath.md) | | - | 任意の整数型 | [`abs`](/reference/cmath/abs.md) | [`cmath`](/reference/cmath.md) | C++11 から | - | | [`fabs`](/reference/cmath/fabs.md) | [`cmath`](/reference/cmath.md) | C++11 から | - | `int` | [`abs`](/reference/cstdlib/abs.md.nolink) | [`cstdlib`](/reference/cstdlib.md) | | - | `long int` | [`labs`](/reference/cstdlib/labs.md.nolink) | [`cstdlib`](/reference/cstdlib.md) | | - | | [`abs`](/reference/cstdlib/abs.md.nolink) | [`cstdlib`](/reference/cstdlib.md) | | - | `long long int` | [`llabs`](/reference/cstdlib/llabs.md.nolink) | [`cstdlib`](/reference/cstdlib.md) | C++11 から | - | | [`abs`](/reference/cstdlib/abs.md.nolink) | [`cstdlib`](/reference/cstdlib.md) | C++11 から | + | 引数の型 | 関数 | ヘッダ | 備考 | + |----------------------------------------------------|--------------------------------------|--------------------------------------|------------| + | `float` | [`abs`](/reference/cmath/abs.md) | [`cmath`](/reference/cmath.md) | | + | | [`fabs`](/reference/cmath/fabs.md) | [`cmath`](/reference/cmath.md) | | + | `double` | [`abs`](/reference/cmath/abs.md) | [`cmath`](/reference/cmath.md) | | + | | [`fabs`](/reference/cmath/fabs.md) | [`cmath`](/reference/cmath.md) | | + | `long double` | [`abs`](/reference/cmath/abs.md) | [`cmath`](/reference/cmath.md) | | + | | [`fabs`](/reference/cmath/fabs.md) | [`cmath`](/reference/cmath.md) | | + | 任意の整数型 | [`abs`](/reference/cmath/abs.md) | [`cmath`](/reference/cmath.md) | C++11 から | + | | [`fabs`](/reference/cmath/fabs.md) | [`cmath`](/reference/cmath.md) | C++11 から | + | `int` | [`abs`](/reference/cstdlib/abs.md) | [`cstdlib`](/reference/cstdlib.md) | | + | `long int` | [`labs`](/reference/cstdlib/abs.md) | [`cstdlib`](/reference/cstdlib.md) | | + | | [`abs`](/reference/cstdlib/abs.md) | [`cstdlib`](/reference/cstdlib.md) | | + | `long long int` | [`llabs`](/reference/cstdlib/abs.md) | [`cstdlib`](/reference/cstdlib.md) | C++11 から | + | | [`abs`](/reference/cstdlib/abs.md) | [`cstdlib`](/reference/cstdlib.md) | C++11 から | | [`valarray`](/reference/valarray/valarray.md)`` | [`abs`](/reference/valarray/valarray/abs.md) | [`valarray`](/reference/valarray.md) | | なお、上記のうち、任意の整数型に対する [`abs`](/reference/cmath/abs.md) については C++11 で追加されたが、ある種の問題を引き起こすことから、今後削除される可能性がある。[Validity and return type of std::abs(0u) is unclear](http://wg21.cmeerw.net/lwg/issue2192) 参照。 @@ -89,4 +89,4 @@ abs( (1,2) ) = 2.23607 | [`polar`](polar.md) | 指定した絶対値と偏角の複素数値を得る。 | | [`abs`](/reference/cmath/abs.md) | 絶対値を得る。(浮動小数点版) | | [`fabs`](/reference/cmath/fabs.md) | 絶対値を得る。(浮動小数点版) | -| [`abs`](/reference/cstdlib/abs.md.nolink) | 絶対値を得る。(整数版) | +| [`abs`](/reference/cstdlib/abs.md) | 絶対値を得る。(整数版) | diff --git a/reference/cstdlib.md b/reference/cstdlib.md index c35a95d5a6..2c80d8488d 100644 --- a/reference/cstdlib.md +++ b/reference/cstdlib.md @@ -80,9 +80,9 @@ | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| `abs` | `int`の絶対値を取得する (function) | | -| `labs` | `long`の絶対値を取得する (function) | | -| `llabs` | `long long`の絶対値を取得する (function) | C++11 | +| [`abs`](cstdlib/abs.md) | `int`の絶対値を取得する (function) | | +| [`labs`](cstdlib/abs.md) | `long`の絶対値を取得する (function) | | +| [`llabs`](cstdlib/abs.md) | `long long`の絶対値を取得する (function) | C++11 | | `div_t` | `div`関数の戻り値型 (class) | | | `div` | `int`の除算を行う (function) | | | `ldiv_t` | `div`関数の戻り値型 (class) | | diff --git a/reference/cstdlib/abs.md b/reference/cstdlib/abs.md new file mode 100644 index 0000000000..ad61f0b6aa --- /dev/null +++ b/reference/cstdlib/abs.md @@ -0,0 +1,100 @@ +# abs +* cstdlib[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +namespace std { + int + abs(int j); // (1) C++03 + constexpr int + abs(int j); // (1) C++23 + + long + int abs(long j); // (2) C++03 + constexpr long + int abs(long j); // (2) C++23 + + long long + abs(long long j); // (3) C++11 + constexpr long long + abs(long long j); // (3) C++23 + + float + abs(float j); // (4) C++03からC++20まで + double + abs(double j); // (5) C++03からC++20まで + long double + abs(long double j); // (6) C++03からC++20まで + + floating-point-type + abs(floating-point-type j); // (7) C++03からC++20まで + + long + labs(long j); // (8) C++03 + constexpr long + labs(long j); // (8) C++23 + + long long + llabs(long long j); // (9) C++11 + constexpr long long + llabs(long long j); // (9) C++23 +} +``` + +## 概要 +絶対値を求める。abs は absolute value(絶対値)の略。 + +- (1) : `int`に対するオーバーロード +- (2) : `long`に対するオーバーロード +- (3) : `long long`に対するオーバーロード +- (4) : `float`に対するオーバーロード +- (5) : `double`に対するオーバーロード +- (6) : `long double`に対するオーバーロード +- (7) : 浮動小数点数型に対するオーバーロード +- (8) : `long`規定 +- (9) : `long long`規定 + + +## 戻り値 +引数 `j` の絶対値を返す。 + +- (4),(5),(6),(7) : `j` が `±∞` だった場合 `+∞` を返す。 + + +## 備考 +- パラメータの型`X`において[`is_unsigned_v`](/reference/type_traits/is_unsigned.md)``が`true`であり、`X`が整数昇格によって`int`に変換できない場合、プログラムは不適格となる + - Cとの互換性のため、`int`に昇格できる符号なし整数型は許可される +- C++23では、(4)、(5)、(6)が(7)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された + + +## 例 +```cpp example +#include +#include + +int main() +{ + int x = std::abs(-1); + std::cout << x << std::endl; +} +``` +* std::abs[color ff0000] + +### 出力 +``` +1 +``` + + +### 備考 +特定の環境では、早期に `constexpr` 対応されている場合がある: + +- GCC 4.6.1 以上 + + +## 参照 +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした From 72d23cc651cdd53f0277d10e15bb9b26f0f66155 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 20 Feb 2023 19:06:32 +0900 Subject: [PATCH 0197/3948] =?UTF-8?q?=20:=20div=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=20#1067=20#1022?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib.md | 18 +++---- reference/cstdlib/div.md | 96 ++++++++++++++++++++++++++++++++++++ reference/cstdlib/div_t.md | 41 +++++++++++++++ reference/cstdlib/ldiv_t.md | 41 +++++++++++++++ reference/cstdlib/lldiv_t.md | 42 ++++++++++++++++ 5 files changed, 229 insertions(+), 9 deletions(-) create mode 100644 reference/cstdlib/div.md create mode 100644 reference/cstdlib/div_t.md create mode 100644 reference/cstdlib/ldiv_t.md create mode 100644 reference/cstdlib/lldiv_t.md diff --git a/reference/cstdlib.md b/reference/cstdlib.md index 2c80d8488d..cf12093f59 100644 --- a/reference/cstdlib.md +++ b/reference/cstdlib.md @@ -80,15 +80,15 @@ | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`abs`](cstdlib/abs.md) | `int`の絶対値を取得する (function) | | -| [`labs`](cstdlib/abs.md) | `long`の絶対値を取得する (function) | | -| [`llabs`](cstdlib/abs.md) | `long long`の絶対値を取得する (function) | C++11 | -| `div_t` | `div`関数の戻り値型 (class) | | -| `div` | `int`の除算を行う (function) | | -| `ldiv_t` | `div`関数の戻り値型 (class) | | -| `ldiv` | `long`の除算を行う (functon) | | -| `lldiv_t` | `div`関数の戻り値型 (class) | C++11 | -| `lldiv` | `long long`の除算を行う (function) | C++11 | +| [`abs`](cstdlib/abs.md) | `int`の絶対値を取得する (function) | | +| [`labs`](cstdlib/abs.md) | `long`の絶対値を取得する (function) | | +| [`llabs`](cstdlib/abs.md) | `long long`の絶対値を取得する (function) | C++11 | +| [`div_t`](cstdlib/div_t.md) | `div`関数の戻り値型 (class) | | +| [`div`](cstdlib/div.md) | `int`の除算と剰余算を行う (function) | | +| [`ldiv_t`](cstdlib/ldiv_t.md) | `ldiv`関数の戻り値型 (class) | | +| [`ldiv`](cstdlib/div.md) | `long`の除算と剰余算を行う (functon) | | +| [`lldiv_t`](cstdlib/lldiv_t.md) | `lldiv`関数の戻り値型 (class) | C++11 | +| [`lldiv`](cstdlib/div.md) | `long long`の除算と剰余算を行う (function) | C++11 | ## マルチバイト文字とワイド文字の変換 diff --git a/reference/cstdlib/div.md b/reference/cstdlib/div.md new file mode 100644 index 0000000000..1940b7e9e5 --- /dev/null +++ b/reference/cstdlib/div.md @@ -0,0 +1,96 @@ +# div +* cstdlib[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +namespace std { + div_t + div(int numer, + int denom); // (1) C++03 + constexpr div_t + div(int numer, + int denom); // (1) C++23 + + ldiv_t + div(long numer, + long denom); // (2) C++03 + constexpr ldiv_t + div(long numer, + long denom); // (2) C++23 + + lldiv_t + div(long long numer, + long long denom); // (3) C++03 + constexpr lldiv_t + div(long long numer, + long long denom); // (3) C++23 + + ldiv_t + ldiv(long numer, + long denom); // (4) C++03 + constexpr ldiv_t + ldiv(long numer, + long denom); // (4) C++23 + + lldiv_t + lldiv(long long numer, + long long denom); // (5) C++11 + constexpr lldiv_t + lldiv(long long numer, + long long denom); // (5) C++23 +} +``` +* div_t[link div_t.md] +* ldiv_t[link ldiv_t.md] +* lldiv_t[link lldiv_t.md] + +## 概要 +`number / denom`と`number % denom`の計算をひとつの操作で行う。 + +- (1) : `int`型のオーバーロード +- (2) : `long`型のオーバーロード +- (3) : `long long`型のオーバーロード +- (4) : `long`型規定 +- (5) : `long long`型規定 + + +## 戻り値 +戻り値型となるクラスの`quot`に商、`rem`に剰余を代入して返す。 + +結果のどちらかが表現できない場合は未定義動作となる。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::div_t x = std::div(5, 2); + std::cout << x.quot << std::endl; + std::cout << x.rem << std::endl; +} +``` +* std::div[color ff0000] +* std::div_t[link div_t.md] + +### 出力 +``` +2 +1 +``` + + +### 備考 +特定の環境では、早期に `constexpr` 対応されている場合がある: + +- GCC 4.6.1 以上 + + +## 参照 +- [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) + - C++23での、一部関数の`constexpr`対応 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした diff --git a/reference/cstdlib/div_t.md b/reference/cstdlib/div_t.md new file mode 100644 index 0000000000..799dad33ab --- /dev/null +++ b/reference/cstdlib/div_t.md @@ -0,0 +1,41 @@ +# div_t +* cstdlib[meta header] +* std[meta namespace] +* class[meta id-type] + +```cpp +namespace std { + struct div_t { + int quot; + int rem; + }; +} +``` + +## 概要 +[`std::div()`](div.md)関数の戻り値。 + +`quot`は「quotient (商)」、`rem`は「remainder (剰余)」。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::div_t x = std::div(5, 2); + std::cout << x.quot << std::endl; + std::cout << x.rem << std::endl; +} +``` +* std::div_t[color ff0000] +* std::div[link div.md] + +### 出力 +``` +2 +1 +``` + diff --git a/reference/cstdlib/ldiv_t.md b/reference/cstdlib/ldiv_t.md new file mode 100644 index 0000000000..a9de6511cd --- /dev/null +++ b/reference/cstdlib/ldiv_t.md @@ -0,0 +1,41 @@ +# ldiv_t +* cstdlib[meta header] +* std[meta namespace] +* class[meta id-type] + +```cpp +namespace std { + struct ldiv_t { + long quot; + long rem; + }; +} +``` + +## 概要 +[`std::div()`](div.md)関数の`long`版の戻り値。 + +`quot`は「quotient (商)」、`rem`は「remainder (剰余)」。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::ldiv_t x = std::div(5L, 2L); + std::cout << x.quot << std::endl; + std::cout << x.rem << std::endl; +} +``` +* std::ldiv_t[color ff0000] +* std::div[link div.md] + +### 出力 +``` +2 +1 +``` + diff --git a/reference/cstdlib/lldiv_t.md b/reference/cstdlib/lldiv_t.md new file mode 100644 index 0000000000..4fc72ed076 --- /dev/null +++ b/reference/cstdlib/lldiv_t.md @@ -0,0 +1,42 @@ +# lldiv_t +* cstdlib[meta header] +* std[meta namespace] +* class[meta id-type] +* cpp11[meta cpp] + +```cpp +namespace std { + struct lldiv_t { + long long quot; + long long rem; + }; +} +``` + +## 概要 +[`std::div()`](div.md)関数の`long long`版の戻り値。 + +`quot`は「quotient (商)」、`rem`は「remainder (剰余)」。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::lldiv_t x = std::div(5LL, 2LL); + std::cout << x.quot << std::endl; + std::cout << x.rem << std::endl; +} +``` +* std::lldiv_t[color ff0000] +* std::div[link div.md] + +### 出力 +``` +2 +1 +``` + From 9fc8d7418c4c64c443038637e34578e7a9428c4c Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 20 Feb 2023 21:23:06 +0900 Subject: [PATCH 0198/3948] =?UTF-8?q?cmath/remquo:=20=E9=96=A2=E6=95=B0?= =?UTF-8?q?=E3=81=AE=E5=88=A9=E7=94=A8=E7=9B=AE=E7=9A=84=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit remquo関数のユースケース説明をC99 Rationaleより引用。 https://www.open-std.org/jtc1/sc22/wg14/www/C99RationaleV5.10.pdf --- reference/cmath/remquo.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/reference/cmath/remquo.md b/reference/cmath/remquo.md index 1dd97d8b88..5f47b45786 100644 --- a/reference/cmath/remquo.md +++ b/reference/cmath/remquo.md @@ -55,9 +55,9 @@ namespace std { * Integral[italic] ## 概要 -浮動小数点数の剰余と商を求める。remquoは、「remainder (剰余)」と「quotient (商)」と意味する。 +浮動小数点数の剰余と、商の一部を求める。remquoは、「remainder (剰余)」と「quotient (商)」と意味する。 -この関数は、浮動小数点数に対して除算を行い、除算の結果(商)と、その余り(剰余)を同時に求める。戻り値として剰余が返され、ポインタ引数`quo`に商の値が書き込まれる。 +この関数は、浮動小数点数に対して除算を行い、除算の結果(商)の一部と、その余り(剰余)を同時に求める。戻り値として剰余が返され、ポインタ引数`quo`に商の値の一部が書き込まれる。 - (1) : `float`に対するオーバーロード - (2) : `double`に対するオーバーロード @@ -70,12 +70,16 @@ namespace std { ## 戻り値 - [`remainder()`](remainder.md)関数と同じ方法で剰余を求めて、戻り値として返す。 -- `quo`が指す値は、`x/y`で得られた商と同じ大きさを持ち、`x/y`で得られた符号と同じ符号を持つ +- `quo`が指す値は、`x/y`で得られる商と下位数ビットが等しく、`x/y`で得られた符号と同じ符号を持つ。 + - 商と等しくなる有効なビット数nは、少なくとも3以上の処理系定義の値とされる。 `y`がゼロである場合、`quo`が指す値は未規定となる。またその際、定義域エラーを発生させるかゼロを返すかは、実装定義となる。定義域エラーが発生した際の挙動については、[``](../cmath.md) を参照。 ## 備考 +`remquo`関数では`x/y`の厳密な商を求めることはできない。 +三角関数のような周期性をもつ数学関数の内部実装において、商の低次ビットを利用した引数の還元(argument reduction)操作で利用する。 + - C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された @@ -131,6 +135,7 @@ remquo(6, 2) = quotient:3 remainder:0 ## 参照 +- [std::remquo purpose and usage? - Stack Overflow](https://stackoverflow.com/q/11074865/684921) - [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) - C++23での、一部関数の`constexpr`対応 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) From 58d9a1f1730cb69791cd6e5262f424123a867941 Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 20 Feb 2023 21:40:47 +0900 Subject: [PATCH 0199/3948] cmath/remquo: fix link url --- reference/cmath/remquo.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cmath/remquo.md b/reference/cmath/remquo.md index 5f47b45786..12002f0809 100644 --- a/reference/cmath/remquo.md +++ b/reference/cmath/remquo.md @@ -135,7 +135,7 @@ remquo(6, 2) = quotient:3 remainder:0 ## 参照 -- [std::remquo purpose and usage? - Stack Overflow](https://stackoverflow.com/q/11074865/684921) +- [std::remquo purpose and usage? - Stack Overflow](https://stackoverflow.com/questions/11074865/stdremquo-purpose-and-usage) - [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) - C++23での、一部関数の`constexpr`対応 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) From d68f5d6cfdd62eb332354aa14196e11fd4097c54 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 21 Feb 2023 09:57:03 +0900 Subject: [PATCH 0200/3948] =?UTF-8?q?string=5Fview:=20LWG2791=20hash?= =?UTF-8?q?=E7=89=B9=E6=AE=8A=E5=8C=96=E3=83=8F=E3=83=83=E3=82=B7=E3=83=A5?= =?UTF-8?q?=E8=A8=88=E7=AE=97=E3=81=AFstring=E3=81=A8=E7=AD=89=E4=BE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/string_view/basic_string_view.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reference/string_view/basic_string_view.md b/reference/string_view/basic_string_view.md index 2c3484d7fb..083db3f5ba 100644 --- a/reference/string_view/basic_string_view.md +++ b/reference/string_view/basic_string_view.md @@ -182,6 +182,8 @@ string_view hello = sv.substr(0, 5); // 先頭5文字を抽出する | `template <> struct hash;` | `hash`クラスの`u16string_view`に対する特殊化 | C++17 | | `template <> struct hash;` | `hash`クラスの`u32string_view`に対する特殊化 | C++17 | +上記の各`*string_view`に対する`hash`クラスの特殊化は、それぞれ対応する[`*string`型に対する特殊化](/reference/string.md)と同じハッシュ値を算出する。 + ## 例 ### 基本的な使い方 @@ -322,6 +324,7 @@ C - [P0254R1 Integrating `std::string_view` and `std::string`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0254r1.pdf) - [P0254R2 Integrating `std::string_view` and `std::string`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0254r2.pdf) - [P0403R0 Literal suffixes for `basic_string_view`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0403r0.html) +- [LWG 2791 - `string_view` objects and strings should yield the same hash values](https://cplusplus.github.io/LWG/issue2791) - [String literals make bad ranges - Andrzej's C++ blog](https://akrzemi1.wordpress.com/2019/09/25/string-literals-make-bad-ranges/) - [Require `span` & `basic_string_view` to be Trivially Copyable](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2251r1.pdf) - C++23から、トリビアルコピー可能が保証される。 From 79d7e8577c8b851c97bb295ff6270a8b8f491970 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 21 Feb 2023 12:03:44 +0900 Subject: [PATCH 0201/3948] =?UTF-8?q?=E6=9C=AA=E5=88=9D=E6=9C=9F=E5=8C=96?= =?UTF-8?q?=E9=A0=98=E5=9F=9F=E3=81=B8=E3=81=AE=E6=9A=97=E9=BB=99=E7=9A=84?= =?UTF-8?q?=E3=81=AA=E3=82=AA=E3=83=96=E3=82=B8=E3=82=A7=E3=82=AF=E3=83=88?= =?UTF-8?q?=E6=A7=8B=E7=AF=89=20:=20=E4=BB=95=E6=A7=98=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...jects_for_low-level_object_manipulation.md | 37 ++++++++++++++++--- 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md index 0050b30fb1..7186111c5a 100644 --- a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md +++ b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md @@ -23,7 +23,7 @@ X *make_x() { } ``` -この様なコードは純粋なC++コードでは`new`式を用いることになるため、その場合は問題ない。 +この様なコードは純粋なC++では`new`式を用いることになり、その場合は問題ない。 ```cpp // new式を使用する場合 @@ -75,7 +75,7 @@ float pun(int n) { // U::nの生存期間が開始 U u = {.n = n}; - // このコピーではunオブジェクト表現がコピーされるものの、メンバの生存期間は開始されない + // このコピーではuのオブジェクト表現がコピーされるものの、メンバの生存期間は開始されない // そのため、アクティブメンバが無い状態となる U u2 = u; @@ -164,13 +164,13 @@ C++においては、ポインタに対する演算(`+ -`など)はそのポ ### オブジェクトを暗黙的に構築する操作 -標準ライブラリ中の次の関数は、*implicit-lifetime types*に対して使用した場合に、その振る舞いの一環としてそのオブジェクトを暗黙的に構築する +標準ライブラリ中の次の関数は、*implicit-lifetime types*に対して使用した場合に、その振る舞いの一環として指定された領域内にそのオブジェクトを暗黙的に構築する - `new`演算子 - `opreator new` - `opreator new[]` - アロケータ - - [`std::allocator::allocate`](/reference/memory/allocator/allocate.md) + - [`std::allocator::allocate`](/reference/memory/allocator/allocate.md) - Cライブラリ関数 - `std::aligned_alloc` - `std::calloc` @@ -193,8 +193,33 @@ C++においては、ポインタに対する演算(`+ -`など)はそのポ - ネストしたものも含めて、結果領域に暗黙にオブジェクトを構築する - ネストしたもの、とは例えばクラスメンバや配列の要素のこと -### デストラクタ呼び出しによる生存期間の終了 -(執筆中) +また、これらの操作に限らず、`char, unsigned char, std::byte`の配列オブジェクトを構築しその生存期間を開始する操作は、その配列オブジェクトが占有する領域内にその要素のオブジェクトを暗黙的に構築する。 + +### 暗黙的なオブジェクト構築 + +オブジェクトを暗黙的に構築する操作では、そうすることでプログラムが定義された振る舞いをするようになる(すなわち、未定義動作が回避できる)場合に、*implicit-lifetime types*の0個以上のオブジェクトを暗黙的に構築しその生存期間を開始させる。そのような、暗黙的なオブジェクト構築によってプログラムに定義された振る舞いをもたらすオブジェクトが1つも存在しない場合は未定義動作となる(これは今まで通り)。逆に、そのようなオブジェクトが複数存在している場合は、どのオブジェクトが暗黙的に構築されるかは未規定(これは、都度適切なオブジェクトが選択され構築されることを意図している)。 + +暗黙的なオブジェクト構築が行われる場合、そのサブオブジェクトの*implicit-lifetime types*のオブジェクトも暗黙的に構築され生存期間が開始されるが、*implicit-lifetime types*ではないオブジェクトは暗黙的に構築されないため明示的な初期化が必要となる。 + +暗黙的なオブジェクト構築を行わなくてもプログラムが定義された振る舞いをする(未定義動作とならない)場合、対象の操作は暗黙的にオブジェクトを構築せず、通常の効果のみをもたらす。 + +さらに、オブジェクトを暗黙的に構築する操作の内メモリを確保する関数等一部の操作では、暗黙的なオブジェクト構築によって作成されたオブジェクトを指す適切なポインタを返すことが規定される。これらの操作においては、そのポインタ値を返すことでプログラムが定義された振る舞いをするようになる場合に、指定された領域の先頭アドレスをアドレスとする暗黙的に構築されたオブジェクトの1つを選択し、そのオブジェクトを指すポインタ値を生成しそれを返す。そのような、プログラムに定義された振る舞いをもたらすようなポインタ値が存在しない場合は未定義動作となる。逆に、そのようなポインタ値が複数存在している場合は、どのポインタ値が生成されるかは未規定。 + +そのようなポインタ生成を行わなくてもプログラムが定義された振る舞いをする場合、そのようなポインタ値は生成されず、対象の操作は通常のポインタ値を返す。 + +### 擬似デストラクタ呼び出しによる生存期間の終了 + +一部の文脈では、スカラー型のオブジェクトに対してデストラクタ呼び出しを行うことができ、その場合のデストラクタ呼び出しのことを擬似デストラクタ呼び出し(*pseudo-destructor call*)と呼ぶ。 + +C++17まで、擬似デストラクタ呼び出しには何の効果もなかった(テンプレートの文脈でクラス型との構文上の互換性を取るためのものでしかなかった)が、C++20からは擬似デストラクタ呼び出しはそのスカラー型オブジェクトの生存期間を終了させることが規定される。 + +これに伴い、[`destroy_at()`](/reference/memory/destroy_at.md)などの擬似デストラクタ呼び出しと等価のことを行うライブラリ機能においても、スカラ型のオブジェクトの生存期間を終了させるようになる。 + +### これらの変更の影響 + +これらの変更はあくまでオブジェクト生存期間に関する規則を変更しただけに過ぎず、その影響はコンパイラ等の実装のオブジェクト生存期間の認識が変わるだけである。それによって、今まで未定義動作となっていたコードが未定義動作ではなくなり、未定義動作をトリガーとする最適化を受ける可能性が将来にわたって取り除かれることになる。 + +したがって、これらの変更によって最適化によるもの以外の実行時の振る舞いが変化することはなく、暗黙的なオブジェクト構築は実際にコンストラクタを呼んだり何か初期化を行うものではない。 ## 例 (執筆中) From afa0dc58b54968ec198a87a995138eefa3c092c1 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 21 Feb 2023 14:05:41 +0900 Subject: [PATCH 0202/3948] =?UTF-8?q?=E3=81=A8float16=5Ft?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=E3=80=82=E6=9B=B8=E3=81=8D=E3=81=8B?= =?UTF-8?q?=E3=81=91=20#1022?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23.md | 1 + reference.md | 1 + reference/cmath.md | 2 +- reference/stdfloat.md | 24 +++++++ reference/stdfloat/float16_t.md | 112 ++++++++++++++++++++++++++++++++ 5 files changed, 139 insertions(+), 1 deletion(-) create mode 100644 reference/stdfloat.md create mode 100644 reference/stdfloat/float16_t.md diff --git a/lang/cpp23.md b/lang/cpp23.md index 8c29b9b53f..9420d8791b 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -120,6 +120,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 - ノードベースではないソート済みキーによる順序付き連想コンテナのライブラリとして、[``](/reference/flat_map.md.nolink)と[``](/reference/flat_set.md.nolink)を追加 - 書式指定で出力するライブラリとして[``](/reference/print.md)を追加 - コルーチンによるRangeの生成をサポートする[``](/reference/generator.md)を追加 +- 拡張浮動小数点数のライブラリとして[``](/reference/stdfloat.md)を追加 ### コンテナ diff --git a/reference.md b/reference.md index 331792a014..583bb2ea52 100644 --- a/reference.md +++ b/reference.md @@ -28,6 +28,7 @@ |--------------------------------------------------------|--------------------------|----------------| | [``](/reference/limits.md) | 実装プロパティ | | | [``](/reference/version.md) | 実装依存のバージョン情報 | C++20 | +| [``](/reference/stdfloat.md) | 拡張浮動小数点数型 | C++23 | | [``](/reference/new.md) | 動的メモリ管理 | | | [``](/reference/typeinfo.md) | 型情報 | | | [``](/reference/source_location.md) | ソースコード上の位置 | C++20 | diff --git a/reference/cmath.md b/reference/cmath.md index 6104a3c3a7..1834c1ebf5 100644 --- a/reference/cmath.md +++ b/reference/cmath.md @@ -103,7 +103,7 @@ C++23で`constexpr`対応する関数の条件は以下: なお、C++20では[`lerp()`](cmath/lerp.md)のみ`constexpr`に対応している。これはC標準ライブラリからの移植ではなく、C++で標準化された関数だからである ([`errno`](cerrno/errno.md)や浮動小数点例外のようなグローバル状態を使用しない)。 #### 拡張浮動小数点数型への対応 -C++23では[``](stdfloat.md.nolink)に拡張浮動小数点数型が追加された。その対応として、以下のような`float`、`double`、`long double`に対するオーバーロードは、 +C++23では[``](stdfloat.md)に拡張浮動小数点数型が追加された。その対応として、以下のような`float`、`double`、`long double`に対するオーバーロードは、 ```cpp float abs(float x); diff --git a/reference/stdfloat.md b/reference/stdfloat.md new file mode 100644 index 0000000000..7275c9ca9d --- /dev/null +++ b/reference/stdfloat.md @@ -0,0 +1,24 @@ +# stdfloat +* stdfloat[meta header] +* cpp23[meta cpp] + +``ヘッダでは、実装定義の拡張浮動小数点数型を定義する。 + +これらの拡張浮動小数点数型は、ISO/IEC/IEEE 60559 (IEEE 754) 浮動小数点数規格に従った内部表現をもつことが規定される。 + + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`float16_t`](stdfloat/float16_t.md) | 16ビット半精度の浮動小数点数型 | C++23 | +| [`float32_t`](stdfloat/float32_t.md.nolink) | 32ビット単精度の浮動小数点数型 | C++23 | +| [`float64_t`](stdfloat/float64_t.md.nolink) | 64ビット倍精度の浮動小数点数型 | C++23 | +| [`float128_t`](stdfloat/float128_t.md.nolink) | 128ビット四倍精度の浮動小数点数型 | C++23 | +| [`bfloat16_t`](stdfloat/bfloat16_t.md.nolink) | 16ビットのbrain floating point型 | C++23 | + + +## バージョン +### 言語 +- C++23 + +## 参照 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) diff --git a/reference/stdfloat/float16_t.md b/reference/stdfloat/float16_t.md new file mode 100644 index 0000000000..c7e6d4c2f4 --- /dev/null +++ b/reference/stdfloat/float16_t.md @@ -0,0 +1,112 @@ +# float16_t +* stdfloat[meta header] +* std[meta namespace] +* type-alias[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { +#if defined(__STDCPP_FLOAT16_T__) + using float16_t = implementation-defined; +#endif +} +``` + +## 概要 +16ビット半精度の浮動小数点数型。 + +### 内部表現 + +ISO/IEC/IEEE 60559 (IEEE 754) 浮動小数点数規格のbinary16フォーマットをもつ。 + +| 符号ビット数 | 指数ビット数 | 仮数ビット数 | 最大指数 | +|--------------|--------------|--------------|----------| +| 1 | 5 | 10 | 15 | + +### リテラル +値にサフィックスとして`f16`もしくは`F16`を指定することで、`std::float16_t`のリテラルとすることができる。 + +```cpp +std::float16_t a = 1.0f16; +std::float16_t b = 2.0F16; +``` + + +### 順位 +浮動小数点数の変換で使用される順位 (rank) は、以下のように定義される: + +- `long double` > `double` > `float`のように、`long double`が最も高い順位をもつ +- 同じ値集合をもつ2つの拡張浮動小数点数型は、同じ順位をもつ +- 標準浮動小数点数型と同じ値集合をもつ拡張浮動小数点数型は、同じ順位をもつ +- 標準浮動小数点数型より多くの値集合をもつ拡張浮動小数点数型は、`double`と同じ順位をもつ + +注意として、浮動小数点数型`T1`の値集合が浮動小数点数型`T2`の値集合の部分集合でも上位集合でもない場合、浮動小数点数型`T1`と`T2`の変換順位は順位通りではない。これは、一方の型が他方より大きな範囲と低い精度の両方を持つ場合に起こり得る。 + +順位が同じ浮動小数点数型は、サブ順位 (subrank) で順序付けられる。拡張浮動小数点数は、標準浮動小数点数型よりも大きなサブ順位をもつ。 + + +### 昇格と変換 +C言語の名残と後方互換性のために、オーバーロード解決での`float`から`double`への変換は昇格と見なされるが、ほかの浮動小数点数型では昇格はない。 + +2つの浮動小数点型の少なくとも一方が拡張浮動小数点型である場合、変換先の型が変換元の型より大きいか等しい場合にのみ、2つの浮動小数点型間の変換が暗黙的に行われる。いかなる暗黙の変換も損失なく、値を正確に保持する。潜在的に損失のある変換はすべて明示的でなければならない。 + +小さい精度への変換は、`()`と`{}`による直接初期化、もしくは明示的なキャストのみ許可される。 + +```cpp +void f(std::float16_t); +void g() { + std::float16_t a = 1.0; // エラー!小さい精度への暗黙変換はできない + std::float16_t b(2.0); // OK : 直接初期化 + std::float16_t c{3.0}; // OK : 直接初期化 + a = 4.0; // エラー!小さい精度への暗黙変換はできない + f(5.0); // エラー!小さい精度への暗黙変換はできない + f(static_cast(5.0)); // OK : 明示的なキャスト +} +``` + + +### オーバーロード解決 +TBD + +- 浮動小数点数型`FP1`と浮動小数点数型`FP2`の間のいずれかの方向への変換は、`FP1`と算術型`T3`の間の同じ方向への変換よりも優先される + +```cpp +int f(std::float32_t); +int f(std::float64_t); +int f(long long); + +float x; +std::float16_t y; +int i = f(x); // f(std::float32_t)が呼び出される。 + // floatとstd::float32_tが同じ変換順位をもつ +int j = f(y); // エラー!曖昧。変換ランクが等しくない +``` +* std::float32_t[link float32_t.md.nolink] +* std::float64_t[link float32_t.md.nolink] + + + +## 備考 +- この型は、C23で定義されるオプションキーワード`_Float16`の別名として定義されることになるだろう + - この型は、`_Float16`と相互運用できることが望ましい +- この型は、`__STDCPP_FLOAT16_T__`マクロが定義されない場合、定義されない + - ISO/IEC/IEEE 60559 (IEEE 754) のbinary16フォーマットが実装される環境でこのマクロは定義される + + +## 例 +```cpp example +``` + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): +- [GCC](/implementation.md#gcc): +- [Visual C++](/implementation.md#visual_cpp): ?? + From cf2f9aca8e91c46b6f5c05b6152d5533279b356a Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 21 Feb 2023 14:29:57 +0900 Subject: [PATCH 0203/3948] =?UTF-8?q?=E6=93=AC=E4=BC=BC=E3=83=87=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=83=A9=E3=82=AF=E3=82=BF=E5=91=BC=E3=81=B3=E5=87=BA?= =?UTF-8?q?=E3=81=97=E3=81=AE=E4=BE=8B=E3=82=92=E8=BF=BD=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...jects_for_low-level_object_manipulation.md | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md index 7186111c5a..ed4a4415fc 100644 --- a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md +++ b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md @@ -213,13 +213,29 @@ C++においては、ポインタに対する演算(`+ -`など)はそのポ C++17まで、擬似デストラクタ呼び出しには何の効果もなかった(テンプレートの文脈でクラス型との構文上の互換性を取るためのものでしかなかった)が、C++20からは擬似デストラクタ呼び出しはそのスカラー型オブジェクトの生存期間を終了させることが規定される。 +```cpp +constexpr int f() { + int a = 123; + using T = int; + + // 擬似デストラクタ呼び出し + // C++20からはaの生存期間を終了させる + // C++17までは何も効果がない + a.~T(); + + return a; // C++20からはUB、C++17までは123を返す +} + +static_assert(f() == 123); // C++20からはUBが起こるため不適格、C++17以前は適格 +``` + これに伴い、[`destroy_at()`](/reference/memory/destroy_at.md)などの擬似デストラクタ呼び出しと等価のことを行うライブラリ機能においても、スカラ型のオブジェクトの生存期間を終了させるようになる。 ### これらの変更の影響 -これらの変更はあくまでオブジェクト生存期間に関する規則を変更しただけに過ぎず、その影響はコンパイラ等の実装のオブジェクト生存期間の認識が変わるだけである。それによって、今まで未定義動作となっていたコードが未定義動作ではなくなり、未定義動作をトリガーとする最適化を受ける可能性が将来にわたって取り除かれることになる。 +これらの変更はあくまでオブジェクト生存期間に関する規則を変更しただけに過ぎず、その影響はコンパイラ等の実装のオブジェクト生存期間の認識が変わるだけである。それによって、今まで未定義動作となっていたコードが未定義動作ではなくなり、未定義動作をトリガーとする最適化を受ける可能性が将来にわたって取り除かれることになる(ただし、擬似デストラクタ呼び出し周りの変更だけは、未定義動作ではなかったコードを未定義動作にしうる)。 -したがって、これらの変更によって最適化によるもの以外の実行時の振る舞いが変化することはなく、暗黙的なオブジェクト構築は実際にコンストラクタを呼んだり何か初期化を行うものではない。 +したがって、擬似デストラクタ呼び出しを除いて、これらの変更によって最適化によるもの以外の実行時の振る舞いが変化することはなく、暗黙的なオブジェクト構築は実際にコンストラクタを呼んだり何か初期化を行うものではない。 ## 例 (執筆中) From 9755c4c685f21f8cfb47980a23f619306afdcbff Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 21 Feb 2023 14:43:11 +0900 Subject: [PATCH 0204/3948] =?UTF-8?q?=E6=9C=AA=E5=88=9D=E6=9C=9F=E5=8C=96?= =?UTF-8?q?=E9=A0=98=E5=9F=9F=E3=81=B8=E3=81=AE=E6=9A=97=E9=BB=99=E7=9A=84?= =?UTF-8?q?=E3=81=AA=E3=82=AA=E3=83=96=E3=82=B8=E3=82=A7=E3=82=AF=E3=83=88?= =?UTF-8?q?=E6=A7=8B=E7=AF=89=20:=20=E8=A1=A8=E7=8F=BE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...creation_of_objects_for_low-level_object_manipulation.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md index ed4a4415fc..fa76066acc 100644 --- a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md +++ b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md @@ -209,9 +209,9 @@ C++においては、ポインタに対する演算(`+ -`など)はそのポ ### 擬似デストラクタ呼び出しによる生存期間の終了 -一部の文脈では、スカラー型のオブジェクトに対してデストラクタ呼び出しを行うことができ、その場合のデストラクタ呼び出しのことを擬似デストラクタ呼び出し(*pseudo-destructor call*)と呼ぶ。 +一部の文脈では、スカラ型のオブジェクトに対してデストラクタ呼び出しを行うことができ、その場合のデストラクタ呼び出しのことを擬似デストラクタ呼び出し(*pseudo-destructor call*)と呼ぶ。 -C++17まで、擬似デストラクタ呼び出しには何の効果もなかった(テンプレートの文脈でクラス型との構文上の互換性を取るためのものでしかなかった)が、C++20からは擬似デストラクタ呼び出しはそのスカラー型オブジェクトの生存期間を終了させることが規定される。 +C++17まで、擬似デストラクタ呼び出しには何の効果もなかった(テンプレートの文脈でクラス型との構文上の互換性を取るためのものでしかなかった)が、C++20からは擬似デストラクタ呼び出しはそのスカラ型オブジェクトの生存期間を終了させることが規定される。 ```cpp constexpr int f() { @@ -235,7 +235,7 @@ static_assert(f() == 123); // C++20からはUBが起こるため不適格、C++ これらの変更はあくまでオブジェクト生存期間に関する規則を変更しただけに過ぎず、その影響はコンパイラ等の実装のオブジェクト生存期間の認識が変わるだけである。それによって、今まで未定義動作となっていたコードが未定義動作ではなくなり、未定義動作をトリガーとする最適化を受ける可能性が将来にわたって取り除かれることになる(ただし、擬似デストラクタ呼び出し周りの変更だけは、未定義動作ではなかったコードを未定義動作にしうる)。 -したがって、擬似デストラクタ呼び出しを除いて、これらの変更によって最適化によるもの以外の実行時の振る舞いが変化することはなく、暗黙的なオブジェクト構築は実際にコンストラクタを呼んだり何か初期化を行うものではない。 +したがって、これらの変更によって実行時に何かすべきことが増えるわけではなく、暗黙的なオブジェクト構築は実際にコンストラクタを呼んだり何か初期化を行うものではないし、擬似デストラクタ呼び出しが実行時に何かをするようになるわけでもない。 ## 例 (執筆中) From 496bf9cbdced56bf08284bc1b984977a18136cee Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 21 Feb 2023 18:40:46 +0900 Subject: [PATCH 0205/3948] =?UTF-8?q?functional/hash:=20=E8=AA=AC=E6=98=8E?= =?UTF-8?q?=E5=A2=97=E8=A3=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/functional/hash.md | 41 ++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/reference/functional/hash.md b/reference/functional/hash.md index f1b626178f..764b4ff5c0 100644 --- a/reference/functional/hash.md +++ b/reference/functional/hash.md @@ -36,9 +36,11 @@ namespace std { ## 概要 クラステンプレート`hash`は、非順序連想コンテナ([`unordered_map`](/reference/unordered_map/unordered_map.md)/[`unordered_multimap`](/reference/unordered_map/unordered_multimap.md)/[`unordered_set`](/reference/unordered_set/unordered_set.md)/[`unordered_multiset`](/reference/unordered_set/unordered_multiset.md))のキーとなる型のためのハッシュ値を計算する関数オブジェクトである。 -このクラスはそのものにデフォルトの定義は存在せず、ユーザーが任意の型で特殊化する際の要件を定義する。`hash`クラステンプレートを特殊化する場合、以下に記述するメンバ関数を持たせる必要がある。 +このクラスはそのものにデフォルトの定義は存在せず、ユーザーが任意の型で特殊化する際の要件を定義する。`hash`クラステンプレートを特殊化する場合、後述するメンバ関数を持たせる必要がある。 -``ヘッダでは、以下の特殊化を提供する。これ以外の特殊化は、対象型を定義する各種ヘッダファイルにて提供される: +### 基本型のハッシュサポート +``ヘッダでは、基本型に対する特殊化を提供する。 +`std::string`などC++標準ライブラリ定義の型に対する特殊化は、対象型を定義する各種ヘッダファイルにて提供される。 | 型 | 対応バージョン | |----------------------|----------------| @@ -69,18 +71,25 @@ namespace std { ## メンバ関数 | 名前 | 説明 | -|-----------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------| -| `hash()`
`hash(const hash&)`
`hash(hash&&)` | デフォルトコンストラクタ、コピーコンストラクタ、ムーブコンストラクタを持つ | -| `~hash()` | デストラクタを持つ | -| `hash& operator=(const hash&)`
`hash& operator=(hash&&)` | コピー代入演算子とムーブ代入演算子を持つ | -| `size_t operator()(T key) const` | 関数呼び出し演算子によって、キーに対応するハッシュ値を返す | +|------|------| +| `(constructor)` | デフォルトコンストラクタ、コピーコンストラクタ、ムーブコンストラクタを持つ | +| `(destructor)` | デストラクタを持つ | +| `operator=` | コピー代入演算子とムーブ代入演算子を持つ | +| `operator()` | 関数呼び出し演算子によって、キー値`k`に対応する`size_t`型のハッシュ値を返す。`const`修飾メンバ関数。 | + +関数呼び出し演算子に関する制約は次の通り : + +- 引数に指定するキー値`k`を変更してはならない。 +- ハッシュ計算は引数で指定したキー値以外に依存してはいけない(状態をもってはいけない)。 +- 式`k1 == k2`を満たす2個のキー値に対しては、同一ハッシュ値を返すこと。 + - 異なる2個のキーに対して同一ハッシュ値を返すこと(collision; 衝突)は許容されるが、入力に対する出力ハッシュ値は`size_t`型の値域において均等分布することが好ましい。 ## メンバ型 | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| `is_transparent` | 省略可。ハッシュ計算の関数オブジェクトがこの型を持っている場合、非順序連想コンテナの透過的な検索関数が有効になる。
この型は、例として`hash`が`hash`や`hash`と等価なハッシュ値を生成できるような場合に定義される。 | C++20 | +| `is_transparent` | 省略可。ハッシュ計算を行う関数オブジェクトがこの型を持っている場合、非順序連想コンテナの透過的な検索関数が有効になる。
この型は、例えば関数オブジェクトが`string`型/`string_view`型/ヌル終端文字列(`const char*`)に対して等価なハッシュ値を生成できる場合に定義される。 | C++20 | ## 例 @@ -89,6 +98,8 @@ namespace std { #include #include +enum class E { A = 1, B = 42, C = 100 }; + int main() { int x; @@ -104,6 +115,10 @@ int main() // int*型のアドレス値(&x)に対するハッシュ値を求める std::cout << std::hash()(&x) << std::endl; + + // 列挙型の値E::Bに対するハッシュ値を求める(C++14から) + E e = E::B; + std::cout << std::hash()(e) << std::endl; } ``` * std::hash[color ff0000] @@ -114,10 +129,11 @@ int main() 100 1427109137 3219530756 +42 ``` ### 透過的にハッシュ値を計算できる場合 (C++20) -`is_transparent`が定義される場合、以下のようなコードにおいて、`find()`メンバ関数に文字列リテラルを指定しても、一時的な[`string`](/reference/string/basic_string.md)オブジェクトが作成されず、パフォーマンス向上が期待できる。 +メンバ型`is_transparent`が定義される場合、以下のようなコードにおいて、[`find`](/reference/unordered_map/unordered_map/find.md)メンバ関数に文字列リテラルを指定しても、一時的な[`string`](/reference/string/basic_string.md)オブジェクトが作成されず、パフォーマンス向上が期待できる。 ```cpp example #include @@ -135,6 +151,7 @@ struct string_hash { int main() { + // キー型=std::string, 値型=int std::unordered_map> um = { {"Alice", 3}, {"Bob", 1}, @@ -142,7 +159,7 @@ int main() }; // string_hashおよびstd::equal_to<>はいずれもメンバ型にis_transparentを持つため、 - // find()などの検索関数に引数を渡す場合に、std::string一時オブジェクトが作られない + // find()などの検索関数に値を渡す場合に、キー型(std::string)一時オブジェクトが作られない auto it = um.find("Alice"); if (it != um.end()) { std::cout << "found : " << it->second << std::endl; @@ -189,7 +206,9 @@ found : 3 ## 参照 - [ハッシュ関数 - Wikipedia](https://ja.wikipedia.org/wiki/ハッシュ関数) -- [LWG 2148 - Hashing enums should be supported directly by std::hash](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2148) +- [LWG 2148 - Hashing enums should be supported directly by `std::hash`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2148) - [LWG 2291 - std::hash is vulnerable to collision DoS attack](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2291) +- [LWG 2543 - LWG 2148 (hash support for enum types) seems under-specified](https://cplusplus.github.io/LWG/issue2543) +- [LWG 2817 - `std::hash` for `nullptr_t`](https://cplusplus.github.io/LWG/issue2817) - [P0919R3 Heterogeneous lookup for unordered containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0919r3.html) - [P1690R1 Refinement Proposal for P0919 Heterogeneous lookup for unordered containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1690r1.html) From 04deaac7dfd476246698e5046dffb52e63625c51 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 22 Feb 2023 17:52:51 +0900 Subject: [PATCH 0206/3948] =?UTF-8?q?=E6=9C=AA=E5=88=9D=E6=9C=9F=E5=8C=96?= =?UTF-8?q?=E9=A0=98=E5=9F=9F=E3=81=B8=E3=81=AE=E6=9A=97=E9=BB=99=E7=9A=84?= =?UTF-8?q?=E3=81=AA=E3=82=AA=E3=83=96=E3=82=B8=E3=82=A7=E3=82=AF=E3=83=88?= =?UTF-8?q?=E6=A7=8B=E7=AF=89=20:=20=E5=85=B1=E7=94=A8=E4=BD=93=E3=81=AE?= =?UTF-8?q?=E4=BE=8B=E3=81=A8=E5=95=8F=E9=A1=8C=E8=A7=A3=E6=B1=BA=E4=BE=8B?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...jects_for_low-level_object_manipulation.md | 209 ++++++++++++++++-- 1 file changed, 189 insertions(+), 20 deletions(-) diff --git a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md index fa76066acc..9e5eab7c48 100644 --- a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md +++ b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md @@ -15,7 +15,7 @@ X *make_x() { // malloc()はメモリの確保だけを行う X *p = (X*)malloc(sizeof(struct X)); - // pの領域にはオブジェクトが構築されていない + // pの領域にはXのオブジェクトが構築されていない p->a = 1; // 💀 UB p->b = 2; // 💀 UB @@ -31,7 +31,7 @@ X *make_x() { // new式はメモリの確保とオブジェクト構築を行う X *p = new X; - // pの領域にはオブジェクトが構築済 + // pの領域にはXのオブジェクトが構築済 p->a = 1; // ✅ ok p->b = 2; // ✅ ok @@ -50,12 +50,12 @@ X *make_x() { `new`式ではなく`operator new()`を直接使用する場合は同様の問題がある。 ```cpp -// new式を使用する場合 +// new演算子を使用する場合 X *make_x() { // operator new()はメモリの確保だけを行う X *p = (X*)::operator new(sizeof(struct X)); - // pの領域にはオブジェクトが構築されていない + // pの領域にはXのオブジェクトが構築されていない p->a = 1; // 💀 UB p->b = 2; // 💀 UB @@ -195,6 +195,25 @@ C++においては、ポインタに対する演算(`+ -`など)はそのポ また、これらの操作に限らず、`char, unsigned char, std::byte`の配列オブジェクトを構築しその生存期間を開始する操作は、その配列オブジェクトが占有する領域内にその要素のオブジェクトを暗黙的に構築する。 +#### 共用体のコピー操作 + +共用体のデフォルトのコピー/ムーブコンストラクタと代入演算子では、次のようにオブジェクトを暗黙的に構築する + +- コンストラクタ + - コピー元オブジェクトにネストした各オブジェクトに対して、コピー先内で対応するオブジェクト`o`を + - サブオブジェクトの場合 : 特定する + - それ以外の場合 : 暗黙的に構築する + - 別のオブジェクトにストレージを提供している場合やサブオブジェクトのサブオブジェクトなど + - `o`の生存期間はコピーの前に開始される +- 代入演算子 + - 代入元と代入先が同じオブジェクトではない場合 + - コピー元オブジェクトにネストした各オブジェクトに対して、コピー先内で対応するオブジェクト`o`が暗黙的に構築され + - `o`の生存期間はコピーの前に開始される + +どちらの場合も、コピー元で生存期間内にあるオブジェクトがコピー先で(可能なら)暗黙的に構築される。 + +クラス型をメンバとして保持する場合など、デフォルトのコンストラクタ/代入演算子が`delete`されている場合はこれは行われない。 + ### 暗黙的なオブジェクト構築 オブジェクトを暗黙的に構築する操作では、そうすることでプログラムが定義された振る舞いをするようになる(すなわち、未定義動作が回避できる)場合に、*implicit-lifetime types*の0個以上のオブジェクトを暗黙的に構築しその生存期間を開始させる。そのような、暗黙的なオブジェクト構築によってプログラムに定義された振る舞いをもたらすオブジェクトが1つも存在しない場合は未定義動作となる(これは今まで通り)。逆に、そのようなオブジェクトが複数存在している場合は、どのオブジェクトが暗黙的に構築されるかは未規定(これは、都度適切なオブジェクトが選択され構築されることを意図している)。 @@ -237,32 +256,182 @@ static_assert(f() == 123); // C++20からはUBが起こるため不適格、C++ したがって、これらの変更によって実行時に何かすべきことが増えるわけではなく、暗黙的なオブジェクト構築は実際にコンストラクタを呼んだり何か初期化を行うものではないし、擬似デストラクタ呼び出しが実行時に何かをするようになるわけでもない。 -## 例 -(執筆中) -```cpp example -// (ここには、言語機能の使い方を解説するための、サンプルコードを記述します。) -// (インクルードとmain()関数を含む、実行可能なサンプルコードを記述してください。そのようなコードブロックにはexampleタグを付けます。) +## 以前の問題の修正例 + +### `malloc()`/ `operator new` + +```cpp +// Xはimplicit-lifetime class types +struct X { + int a; + int b; +}; + +X *make_x() { + // 後続のXのメンバアクセスを定義された振る舞いとするために + // malloc()はメモリの確保とともにXのオブジェクト(とメンバオブジェクト)を暗黙的に構築する + // そして、構築されたXのオブジェクトへの適切なポインタを返す + X *p = (X*)malloc(sizeof(struct X)); + + // pの領域にはXのオブジェクトが暗黙的に構築されている + p->a = 1; // ✅ ok + p->b = 2; // ✅ ok + + return p; +} +``` + +```cpp +// new演算子を使用する場合 +X *make_x() { + // 後続のXのメンバアクセスを定義された振る舞いとするために + // operator new()はメモリの確保とともにXのオブジェクト(とメンバオブジェクト)を暗黙的に構築する + // そして、構築されたXのオブジェクトへの適切なポインタを返す + X *p = (X*)::operator new(sizeof(struct X)); + + // pの領域にはXのオブジェクトが暗黙的に構築されている + p->a = 1; // ✅ ok + p->b = 2; // ✅ ok + + return p; +} +``` + +### 共用体のコピー + +```cpp +union U { + int n; + float f; +}; + +float pun(int n) { + // U::nの生存期間が開始 + U u = {.n = n}; + + // このコピーではuのオブジェクト表現がコピーされるとともに + // uのアクティブメンバに対応するメンバがコピー先でアクティブとなる + U u2 = u; + + // u2.fは非アクティブ + return u2.f; // 💀 UB +} +``` + +共用体のコピーにおいてはあくまでコピー元で生存期間内にあったオブジェクトに対応するオブジェクトがコピー先でも生存期間内にあることが保証されるだけで、*type-punning*のようなことを可能にするわけではない。 + +```cpp +int f(int n) { + U u = {.n = n}; + + U u2 = u; + + // これならok + return u2.n; // ✅ ok +} +``` + +### バイト配列の読み込み -#include +```cpp +// 何かバイト列ストリームを受け取って処理する関数とする +void process(Stream *stream) { + // バイト配列の読み出し + std::unique_ptr buffer = stream->read(); -int main() -{ - int variable = 0; - std::cout << variable << std::endl; + // 先頭バイトの状態によって分岐 + if (buffer[0] == FOO) { + process_foo(reinterpret_cast(buffer.get())); // #1 + } else { + process_bar(reinterpret_cast(buffer.get())); // #2 + } } ``` -* variable[color ff0000] -(コードブロック中の識別子に、文字色を付ける例です。) +`Foo`も`Bar`も*implicit-lifetime types*だとして、以前のこのコードに対して`Stream::read()`が次のように実装されている場合 -### 出力 +```cpp +unique_ptr Stream::read() { + // ... determine data size ... + unique_ptr buffer(new char[N]); + // ... copy data into buffer ... + return buffer; +} ``` -0 + +この`read()`内の`new char[N]`によって呼ばれる`operator new[]`によって`Foo`/`Bar`のオブジェクトが暗黙的に構築される。この場合、`buffer[0] == FOO`による分岐によってプログラムに定義された振る舞いをもたらすオブジェクトは、`Foo`と`Bar`のオブジェクトとして2つ存在する。したがって、ここでは先頭バイトの状態に応じて適切なオブジェクトが構築される(そうすることでプログラムに定義された振る舞いをもたらす)ため、`process()`内では未定義動作は回避される。 + +```cpp +void process(Stream *stream) { + // バイト配列の読み出し + std::unique_ptr buffer = stream->read(); + + // 先頭バイトの状態によって適切なオブジェクトがStream::read()内で構築されている + if (buffer[0] == FOO) { + process_foo(reinterpret_cast(buffer.get())); // ✅ ok + } else { + process_bar(reinterpret_cast(buffer.get())); // ✅ ok + } +} ``` -(ここには、サンプルコードの実行結果を記述します。何も出力がない場合は、項目を削除せず、空の出力にしてください。) -(実行結果が処理系・実行環境によって異なる場合は、項目名を「出力例」に変更し、可能であればその理由も併記してください。) +### 動的配列の実装 + +```cpp +// std::vectorの様な動的配列型を実装したい +template +struct Vec { + char *buf = nullptr; + char *buf_end_size = nullptr; + char *buf_end_capacity = nullptr; + + void reserve(std::size_t n) { + // 後続の操作を適格にするためのオブジェクトを暗黙的に構築する + // ここでは、Tの配列型T[]のオブジェクトが暗黙的に構築される(要素のオブジェクトは構築されない) + // 同時に、char[]のオブジェクトも暗黙的に構築される + char *newbuf = (char*)::operator new(n * sizeof(T), std::align_val_t(alignof(T))); + + // newbufにはT[]のオブジェクトが生存期間内にあるため、ポインタT*をイテレータとして使用可能となる + // ここで、T[]の要素のTのオブジェクトが構築される(明示的) + std::uninitialized_copy(begin(), end(), (T*)newbuf); // #a ✅ ok + + ::operator delete(buf, std::align_val_t(alignof(T))); + + // newbufにはchar[]のオブジェクトが生存期間内にあるため、newbuf(char*)をイテレータとして使用可能となる + buf_end_size = newbuf + sizeof(T) * size(); // #b ✅ ok + buf_end_capacity = newbuf + sizeof(T) * n; // #c ✅ ok + buf = newbuf; + } + + void push_back(T t) { + if (buf_end_size == buf_end_capacity) + reserve(std::max(size() * 2, 1)); + new (buf_end_size) T(t); + + // buf_end_sizeの指す領域にはchar[]のオブジェクトが生存期間内にあるため、ポインタをイテレータとして使用可能 + buf_end_size += sizeof(T); // #d ✅ ok + } + + T *begin() { return (T*)buf; } + + T *end() { return (T*)buf_end_size; } + + // buf及びbuf_end_sizeの指す領域にはT[]のオブジェクトが生存期間内にあるため、ポインタをイテレータとして使用可能 + std::size_t size() { return end() - begin(); } // #e ✅ ok +}; + +int main() { + Vec v; + v.push_back(1); + v.push_back(2); + v.push_back(3); + + // 実装内部で暗黙的に配列オブジェクトが構築されることでUBが回避される + for (int n : v) { /*...*/ } // #f ✅ ok +} +``` +この例では、`reserve()`内`newbuf`及びそれを保存している`Vec::buf`の領域に`T[]`(`T`の配列型)と`char[]`のオブジェクトが暗黙的に構築され、同時に生存期間内にあることで、問題(配列オブジェクトを指さないポインタのイテレータとしての使用)が解消され、すべての箇所で定義された振る舞いをもたらしている。 ## この機能が必要になった背景・経緯 (執筆中) From 4818ff7a040a83267ebc5ee506299e44ea6195a3 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 22 Feb 2023 18:12:25 +0900 Subject: [PATCH 0207/3948] =?UTF-8?q?=E6=9C=AA=E5=88=9D=E6=9C=9F=E5=8C=96?= =?UTF-8?q?=E9=A0=98=E5=9F=9F=E3=81=B8=E3=81=AE=E6=9A=97=E9=BB=99=E7=9A=84?= =?UTF-8?q?=E3=81=AA=E3=82=AA=E3=83=96=E3=82=B8=E3=82=A7=E3=82=AF=E3=83=88?= =?UTF-8?q?=E6=A7=8B=E7=AF=89=20:=20=E8=A4=87=E6=95=B0=E3=81=AE=E3=82=AA?= =?UTF-8?q?=E3=83=96=E3=82=B8=E3=82=A7=E3=82=AF=E3=83=88=E3=81=8C=E6=A7=8B?= =?UTF-8?q?=E7=AF=89=E3=81=95=E3=82=8C=E3=81=86=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E4=BF=AE=E6=AD=A3=20#1117?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...t_creation_of_objects_for_low-level_object_manipulation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md index 9e5eab7c48..032c88222e 100644 --- a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md +++ b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md @@ -216,13 +216,13 @@ C++においては、ポインタに対する演算(`+ -`など)はそのポ ### 暗黙的なオブジェクト構築 -オブジェクトを暗黙的に構築する操作では、そうすることでプログラムが定義された振る舞いをするようになる(すなわち、未定義動作が回避できる)場合に、*implicit-lifetime types*の0個以上のオブジェクトを暗黙的に構築しその生存期間を開始させる。そのような、暗黙的なオブジェクト構築によってプログラムに定義された振る舞いをもたらすオブジェクトが1つも存在しない場合は未定義動作となる(これは今まで通り)。逆に、そのようなオブジェクトが複数存在している場合は、どのオブジェクトが暗黙的に構築されるかは未規定(これは、都度適切なオブジェクトが選択され構築されることを意図している)。 +オブジェクトを暗黙的に構築する操作では、そうすることでプログラムが定義された振る舞いをするようになる(すなわち、未定義動作が回避できる)場合に、*implicit-lifetime types*の0個以上のオブジェクトを暗黙的に構築しその生存期間を開始させる。そのような、暗黙的なオブジェクト構築によってプログラムに定義された振る舞いをもたらすオブジェクトの集合が1つも存在しない場合は未定義動作となる(これは今まで通り)。逆に、そのようなオブジェクトの集合が複数存在している場合は、どのオブジェクトが暗黙的に構築されるかは未規定(これは、都度適切なオブジェクトが選択され構築されることを意図している)。 暗黙的なオブジェクト構築が行われる場合、そのサブオブジェクトの*implicit-lifetime types*のオブジェクトも暗黙的に構築され生存期間が開始されるが、*implicit-lifetime types*ではないオブジェクトは暗黙的に構築されないため明示的な初期化が必要となる。 暗黙的なオブジェクト構築を行わなくてもプログラムが定義された振る舞いをする(未定義動作とならない)場合、対象の操作は暗黙的にオブジェクトを構築せず、通常の効果のみをもたらす。 -さらに、オブジェクトを暗黙的に構築する操作の内メモリを確保する関数等一部の操作では、暗黙的なオブジェクト構築によって作成されたオブジェクトを指す適切なポインタを返すことが規定される。これらの操作においては、そのポインタ値を返すことでプログラムが定義された振る舞いをするようになる場合に、指定された領域の先頭アドレスをアドレスとする暗黙的に構築されたオブジェクトの1つを選択し、そのオブジェクトを指すポインタ値を生成しそれを返す。そのような、プログラムに定義された振る舞いをもたらすようなポインタ値が存在しない場合は未定義動作となる。逆に、そのようなポインタ値が複数存在している場合は、どのポインタ値が生成されるかは未規定。 +さらに、オブジェクトを暗黙的に構築する操作の内メモリを確保する関数等一部の操作では、暗黙的なオブジェクト構築によって作成されたオブジェクトを指す適切なポインタを返すことが規定される。これらの操作においては、そのポインタ値を返すことでプログラムが定義された振る舞いをするようになる場合に、指定された領域の先頭アドレスをアドレスとする暗黙的に構築されたオブジェクトの1つを選択し、そのオブジェクトを指すポインタ値を生成しそれを返す。そのような、プログラムに定義された振る舞いをもたらすようなポインタ値が存在しない場合は未定義動作となる。逆に、そのようなポインタ値が複数存在している場合は、どのポインタ値が生成されるかは未規定。 そのようなポインタ生成を行わなくてもプログラムが定義された振る舞いをする場合、そのようなポインタ値は生成されず、対象の操作は通常のポインタ値を返す。 From dcbf835672a941482bd4eab44a9cdb713eabba2b Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 22 Feb 2023 20:44:11 +0900 Subject: [PATCH 0208/3948] =?UTF-8?q?=20:=20=E6=AE=8B=E3=82=8A?= =?UTF-8?q?=E3=82=92=E6=9B=B8=E3=81=84=E3=81=9F=20#1022?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 5 + reference/stdfloat.md | 8 +- reference/stdfloat/bfloat16_t.md | 187 +++++++++++++++++++++++++++++++ reference/stdfloat/float128_t.md | 179 +++++++++++++++++++++++++++++ reference/stdfloat/float16_t.md | 107 ++++++++++++++---- reference/stdfloat/float32_t.md | 179 +++++++++++++++++++++++++++++ reference/stdfloat/float64_t.md | 179 +++++++++++++++++++++++++++++ 7 files changed, 820 insertions(+), 24 deletions(-) create mode 100644 reference/stdfloat/bfloat16_t.md create mode 100644 reference/stdfloat/float128_t.md create mode 100644 reference/stdfloat/float32_t.md create mode 100644 reference/stdfloat/float64_t.md diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 06183ff071..210d6ca9ab 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -167,6 +167,11 @@ * [link /reference/stack.md] * [link /reference/stacktrace.md] * [link /reference/stdexcept.md] +* [link /reference/stdfloat.md] + * std::bfloat16_t[link /reference/stdfloat/bfloat16_t.md] + * std::float16_t[link /reference/stdfloat/float16_t.md] + * std::float32_t[link /reference/stdfloat/float32_t.md] + * std::float64_t[link /reference/stdfloat/float64_t.md] * [link /reference/stop_token.md] * [link /reference/streambuf.md] * [link /reference/string.md] diff --git a/reference/stdfloat.md b/reference/stdfloat.md index 7275c9ca9d..6f7602a047 100644 --- a/reference/stdfloat.md +++ b/reference/stdfloat.md @@ -10,10 +10,10 @@ | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`float16_t`](stdfloat/float16_t.md) | 16ビット半精度の浮動小数点数型 | C++23 | -| [`float32_t`](stdfloat/float32_t.md.nolink) | 32ビット単精度の浮動小数点数型 | C++23 | -| [`float64_t`](stdfloat/float64_t.md.nolink) | 64ビット倍精度の浮動小数点数型 | C++23 | -| [`float128_t`](stdfloat/float128_t.md.nolink) | 128ビット四倍精度の浮動小数点数型 | C++23 | -| [`bfloat16_t`](stdfloat/bfloat16_t.md.nolink) | 16ビットのbrain floating point型 | C++23 | +| [`float32_t`](stdfloat/float32_t.md) | 32ビット単精度の浮動小数点数型 | C++23 | +| [`float64_t`](stdfloat/float64_t.md) | 64ビット倍精度の浮動小数点数型 | C++23 | +| [`float128_t`](stdfloat/float128_t.md) | 128ビット四倍精度の浮動小数点数型 | C++23 | +| [`bfloat16_t`](stdfloat/bfloat16_t.md) | 16ビットのbrain floating point型 | C++23 | ## バージョン diff --git a/reference/stdfloat/bfloat16_t.md b/reference/stdfloat/bfloat16_t.md new file mode 100644 index 0000000000..6fb603150f --- /dev/null +++ b/reference/stdfloat/bfloat16_t.md @@ -0,0 +1,187 @@ +# bfloat16_t +* stdfloat[meta header] +* std[meta namespace] +* type-alias[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { +#if defined(__STDCPP_BFLOAT16_T__) + using bfloat16_t = implementation-defined; +#endif +} +``` + +## 概要 +16ビットのbrain floating point型。 + + +### 内部表現 +この型はISO/IEC/IEEE 60559 (IEEE 754) にはない16ビットの浮動小数点数型である。 + +Google社のTPUや、NVIDIAのGPUなどで採用されている内部表現をもつ。 + +| 型 | 符号ビット数 | 指数ビット数 | 仮数ビット数 | 最大指数 | +|--------------|--------------|--------------|--------------|----------| +| `bfloat16_t` | 1 | 8 | 7 | 127 | +| `float16_t` | 1 | 5 | 10 | 15 | + + +### リテラル +値にサフィックスとして`bf16`もしくは`BF16`を指定することで、`std::bfloat16_t`のリテラルとすることができる。 + +```cpp +std::bfloat16_t a = 1.0bf16; +std::bfloat16_t b = 2.0BF16; +``` + + +### 事前定義マクロ +- この型は、事前定義マクロ`__STDCPP_BFLOAT16_T__`が定義されない場合、定義されない + + +### 順位 +浮動小数点数の変換で使用される順位 (rank) は、以下のように定義される: + +- `long double` > `double` > `float`のように、`long double`が最も高い順位をもつ +- 同じ値集合をもつ2つの拡張浮動小数点数型は、同じ順位をもつ +- 標準浮動小数点数型と同じ値集合をもつ拡張浮動小数点数型は、同じ順位をもつ +- 標準浮動小数点数型より多くの値集合をもつ拡張浮動小数点数型は、`double`と同じ順位をもつ + +注意として、浮動小数点数型`T1`の値集合が浮動小数点数型`T2`の値集合の部分集合でも上位集合でもない場合、浮動小数点数型`T1`と`T2`の変換順位は順位通りではない。これは、一方の型が他方より大きな範囲と低い精度の両方を持つ場合に起こり得る。 + +順位が同じ浮動小数点数型は、サブ順位 (subrank) で順序付けられる。拡張浮動小数点数は、標準浮動小数点数型よりも大きなサブ順位をもつ。 + + +### 昇格と変換 +C言語の名残と後方互換性のために、オーバーロード解決での`float`から`double`への変換は昇格と見なされるが、ほかの浮動小数点数型では昇格はない。 + +2つの浮動小数点型の少なくとも一方が拡張浮動小数点型である場合、変換先の型が変換元の型より大きいか等しい場合にのみ、2つの浮動小数点型間の変換が暗黙的に行われる。いかなる暗黙の変換も損失なく、値を正確に保持する。潜在的に損失のある変換はすべて明示的でなければならない。 + +小さい精度への変換は、`()`と`{}`による直接初期化、もしくは明示的なキャストのみ許可される。 + +```cpp +void f(std::float16_t); +void g() { + std::float16_t a = 1.0; // エラー!小さい精度への暗黙変換はできない + std::float16_t b(2.0); // OK : 直接初期化 + std::float16_t c{3.0}; // OK : 直接初期化 + a = 4.0; // エラー!小さい精度への暗黙変換はできない + f(5.0); // エラー!小さい精度への暗黙変換はできない + f(static_cast(5.0)); // OK : 明示的なキャスト +} +``` + + +### 通常の算術変換 +算術演算での型変換は、以下のような規則で行われる。 + +- どちらかのオペランドが浮動小数点数型である場合、 + - 両方のオペランドが同じ型であれば、型変換は行われない + - そうでなく、オペランドの一方が浮動小数点数型でなければ、浮動小数点数型のオペランドの型に変換される + - そうでなく、オペランドの浮動小数点数型の変換順位が等しくない場合、小さい方の順位をもつ浮動小数点数型は、もう一方の浮動小数点数型に変換される + - `float + double`は`double`に、`std::float16_t + float`は`float`に変換される + - そうでなく、変換順位が等しい場合、サブ順位で比較が行われ、より大きいサブ順位をもつ浮動小数点数型に変換される + - `float + std::float32_t`は`std::float32_t`に変換される + - そうでなければ、式は不適格となる + - `std::float16_t + std::bfloat16_t`は不適格 + +```cpp example +#include +#include + +int main() { + float f32 = 1.0; + std::float16_t f16{2.0}; + std::bfloat16_t b16{3.0}; + std::float32_t f32b{4.0}; + + auto r1 = f32 + f16; // OK : f16は`float`に変換され、結果の型は`float`となる + auto r2 = f32 + b16; // OK : b16は`float`に変換され、結果の型は`float`となる + //auto r3 = f16 + b16; // エラー!どちらの型も算術変換でもう一方の型に変換できない + auto r4 = f32 + f32b; // OK : f32はより大きいサブ順位をもつ`std::float32_t`に変換される + static_assert(std::is_same_v); +} +``` + +### オーバーロード解決 +- 浮動小数点数型の変換をともなうオーバーロード解決は、値を維持する変換が優先され、同じ変換順位をもつ他の浮動小数点数型への変換が優先して行われる + - 値を維持する変換が曖昧な場合、プログラムは不適格となる + +```cpp +#include + +void f(std::float32_t) {} +void f(std::float64_t) {} +void f(long long) {} + +int main() { + float x; + std::float16_t y; + f(x); // f(std::float32_t)が呼び出される。 + // floatとstd::float32_tが同じ変換順位をもつ + //f(y); // エラー!曖昧。変換順位が等しいオーバーロードが見つからない +} +``` + + + +## 備考 +- この型は、C23で定義されるオプションキーワード`_Float16`の別名として定義されることになるだろう + - この型は、`_Float16`と相互運用できることが望ましい + + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::bfloat16_t a = 1.0bf16; + auto b = 2.0f32; // bの型はstd::float32_t + + // 明示的型変換によって、 + // float16_tとの間の変換ができる + auto aa = static_cast(a); + + // aはより大きい精度の型float32_tに変換される + auto c = a + b; // cの型はstd::float32_t + + // 精度を落とす縮小変換は明示的型変換で行う。 + // 拡張浮動小数点数型は数学関数にも渡すことができ、 + // 標準浮動小数点数型への暗黙変換もできる + double d = std::log(static_cast(c)); + + // 同じ精度の浮動小数点数型との間で、精度を落とさず変換でき、 + // coutでも拡張浮動小数点数のまま出力できる + std::cout << static_cast(d) << std::endl; +} +``` +* std::log[link /reference/cmath/log.md] + +### 出力 +``` +1.10156 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`std::float16_t`](float16_t.md) +- [`std::float32_t`](float32_t.md) +- [`std::float64_t`](float64_t.md) +- [`std::float128_t`](float128_t.md) + + +## 参照 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + diff --git a/reference/stdfloat/float128_t.md b/reference/stdfloat/float128_t.md new file mode 100644 index 0000000000..26535c1121 --- /dev/null +++ b/reference/stdfloat/float128_t.md @@ -0,0 +1,179 @@ +# float128_t +* stdfloat[meta header] +* std[meta namespace] +* type-alias[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { +#if defined(__STDCPP_FLOAT128_T__) + using float128_t = implementation-defined; +#endif +} +``` + +## 概要 +128ビット四倍精度の浮動小数点数型。 + +### 内部表現 +この型は、ISO/IEC/IEEE 60559 (IEEE 754) 浮動小数点数規格のbinary128フォーマットをもつ。 + +| 符号ビット数 | 指数ビット数 | 仮数ビット数 | 最大指数 | +|--------------|--------------|--------------|----------| +| 1 | 15 | 112 | 16383 | + +### リテラル +値にサフィックスとして`f128`もしくは`F128`を指定することで、`std::float128_t`のリテラルとすることができる。 + +```cpp +std::float128_t a = 1.0f128; +std::float128_t b = 2.0F128; +``` + + +### 事前定義マクロ +- この型は、事前定義マクロ`__STDCPP_FLOAT128_T__`が定義されない場合、定義されない + - ISO/IEC/IEEE 60559 (IEEE 754) のbinary128フォーマットが実装される環境でこのマクロは定義される + + +### 順位 +浮動小数点数の変換で使用される順位 (rank) は、以下のように定義される: + +- `long double` > `double` > `float`のように、`long double`が最も高い順位をもつ +- 同じ値集合をもつ2つの拡張浮動小数点数型は、同じ順位をもつ +- 標準浮動小数点数型と同じ値集合をもつ拡張浮動小数点数型は、同じ順位をもつ +- 標準浮動小数点数型より多くの値集合をもつ拡張浮動小数点数型は、`double`と同じ順位をもつ + +注意として、浮動小数点数型`T1`の値集合が浮動小数点数型`T2`の値集合の部分集合でも上位集合でもない場合、浮動小数点数型`T1`と`T2`の変換順位は順位通りではない。これは、一方の型が他方より大きな範囲と低い精度の両方を持つ場合に起こり得る。 + +順位が同じ浮動小数点数型は、サブ順位 (subrank) で順序付けられる。拡張浮動小数点数は、標準浮動小数点数型よりも大きなサブ順位をもつ。 + + +### 昇格と変換 +C言語の名残と後方互換性のために、オーバーロード解決での`float`から`double`への変換は昇格と見なされるが、ほかの浮動小数点数型では昇格はない。 + +2つの浮動小数点型の少なくとも一方が拡張浮動小数点型である場合、変換先の型が変換元の型より大きいか等しい場合にのみ、2つの浮動小数点型間の変換が暗黙的に行われる。いかなる暗黙の変換も損失なく、値を正確に保持する。潜在的に損失のある変換はすべて明示的でなければならない。 + +小さい精度への変換は、`()`と`{}`による直接初期化、もしくは明示的なキャストのみ許可される。 + +```cpp +void f(std::float16_t); +void g() { + std::float16_t a = 1.0; // エラー!小さい精度への暗黙変換はできない + std::float16_t b(2.0); // OK : 直接初期化 + std::float16_t c{3.0}; // OK : 直接初期化 + a = 4.0; // エラー!小さい精度への暗黙変換はできない + f(5.0); // エラー!小さい精度への暗黙変換はできない + f(static_cast(5.0)); // OK : 明示的なキャスト +} +``` + + +### 通常の算術変換 +算術演算での型変換は、以下のような規則で行われる。 + +- どちらかのオペランドが浮動小数点数型である場合、 + - 両方のオペランドが同じ型であれば、型変換は行われない + - そうでなく、オペランドの一方が浮動小数点数型でなければ、浮動小数点数型のオペランドの型に変換される + - そうでなく、オペランドの浮動小数点数型の変換順位が等しくない場合、小さい方の順位をもつ浮動小数点数型は、もう一方の浮動小数点数型に変換される + - `float + double`は`double`に、`std::float16_t + float`は`float`に変換される + - そうでなく、変換順位が等しい場合、サブ順位で比較が行われ、より大きいサブ順位をもつ浮動小数点数型に変換される + - `float + std::float32_t`は`std::float32_t`に変換される + - そうでなければ、式は不適格となる + - `std::float16_t + std::bfloat16_t`は不適格 + +```cpp example +#include +#include + +int main() { + float f32 = 1.0; + std::float16_t f16{2.0}; + std::bfloat16_t b16{3.0}; + std::float32_t f32b{4.0}; + + auto r1 = f32 + f16; // OK : f16は`float`に変換され、結果の型は`float`となる + auto r2 = f32 + b16; // OK : b16は`float`に変換され、結果の型は`float`となる + //auto r3 = f16 + b16; // エラー!どちらの型も算術変換でもう一方の型に変換できない + auto r4 = f32 + f32b; // OK : f32はより大きいサブ順位をもつ`std::float32_t`に変換される + static_assert(std::is_same_v); +} +``` + +### オーバーロード解決 +- 浮動小数点数型の変換をともなうオーバーロード解決は、値を維持する変換が優先され、同じ変換順位をもつ他の浮動小数点数型への変換が優先して行われる + - 値を維持する変換が曖昧な場合、プログラムは不適格となる + +```cpp +#include + +void f(std::float32_t) {} +void f(std::float64_t) {} +void f(long long) {} + +int main() { + float x; + std::float16_t y; + f(x); // f(std::float32_t)が呼び出される。 + // floatとstd::float32_tが同じ変換順位をもつ + //f(y); // エラー!曖昧。変換順位が等しいオーバーロードが見つからない +} +``` + + + +## 備考 +- この型は、C23で定義されるオプションキーワード`_Float16`の別名として定義されることになるだろう + - この型は、`_Float16`と相互運用できることが望ましい + + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::float16_t a = 1.0f16; + auto b = 2.0f32; // bの型はstd::float32_t + + // aはより大きい精度の型float32_tに変換される + auto c = a + b; // cの型はstd::float32_t + + // 精度を落とす縮小変換は明示的型変換で行う。 + // 拡張浮動小数点数型は数学関数にも渡すことができ、 + // 標準浮動小数点数型への暗黙変換もできる + double d = std::log(static_cast(c)); + + // 同じ精度の浮動小数点数型との間で、精度を落とさず変換でき、 + // coutでも拡張浮動小数点数のまま出力できる + std::cout << static_cast(d) << std::endl; +} +``` +* std::log[link /reference/cmath/log.md] + +### 出力 +``` +1.09863 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`std::float16_t`](float16_t.md) +- [`std::float32_t`](float32_t.md) +- [`std::float64_t`](float64_t.md) +- [`std::bfloat16_t`](bfloat16_t.md) + + +## 参照 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + diff --git a/reference/stdfloat/float16_t.md b/reference/stdfloat/float16_t.md index c7e6d4c2f4..8bdb7a312d 100644 --- a/reference/stdfloat/float16_t.md +++ b/reference/stdfloat/float16_t.md @@ -16,8 +16,7 @@ namespace std { 16ビット半精度の浮動小数点数型。 ### 内部表現 - -ISO/IEC/IEEE 60559 (IEEE 754) 浮動小数点数規格のbinary16フォーマットをもつ。 +この型は、ISO/IEC/IEEE 60559 (IEEE 754) 浮動小数点数規格のbinary16フォーマットをもつ。 | 符号ビット数 | 指数ビット数 | 仮数ビット数 | 最大指数 | |--------------|--------------|--------------|----------| @@ -32,6 +31,11 @@ std::float16_t b = 2.0F16; ``` +### 事前定義マクロ +- この型は、事前定義マクロ`__STDCPP_FLOAT16_T__`が定義されない場合、定義されない + - ISO/IEC/IEEE 60559 (IEEE 754) のbinary16フォーマットが実装される環境でこのマクロは定義される + + ### 順位 浮動小数点数の変換で使用される順位 (rank) は、以下のように定義される: @@ -65,40 +69,92 @@ void g() { ``` -### オーバーロード解決 -TBD +### 通常の算術変換 +算術演算での型変換は、以下のような規則で行われる。 + +- どちらかのオペランドが浮動小数点数型である場合、 + - 両方のオペランドが同じ型であれば、型変換は行われない + - そうでなく、オペランドの一方が浮動小数点数型でなければ、浮動小数点数型のオペランドの型に変換される + - そうでなく、オペランドの浮動小数点数型の変換順位が等しくない場合、小さい方の順位をもつ浮動小数点数型は、もう一方の浮動小数点数型に変換される + - `float + double`は`double`に、`std::float16_t + float`は`float`に変換される + - そうでなく、変換順位が等しい場合、サブ順位で比較が行われ、より大きいサブ順位をもつ浮動小数点数型に変換される + - `float + std::float32_t`は`std::float32_t`に変換される + - そうでなければ、式は不適格となる + - `std::float16_t + std::bfloat16_t`は不適格 -- 浮動小数点数型`FP1`と浮動小数点数型`FP2`の間のいずれかの方向への変換は、`FP1`と算術型`T3`の間の同じ方向への変換よりも優先される +```cpp example +#include +#include + +int main() { + float f32 = 1.0; + std::float16_t f16{2.0}; + std::bfloat16_t b16{3.0}; + std::float32_t f32b{4.0}; + + auto r1 = f32 + f16; // OK : f16は`float`に変換され、結果の型は`float`となる + auto r2 = f32 + b16; // OK : b16は`float`に変換され、結果の型は`float`となる + //auto r3 = f16 + b16; // エラー!どちらの型も算術変換でもう一方の型に変換できない + auto r4 = f32 + f32b; // OK : f32はより大きいサブ順位をもつ`std::float32_t`に変換される + static_assert(std::is_same_v); +} +``` + +### オーバーロード解決 +- 浮動小数点数型の変換をともなうオーバーロード解決は、値を維持する変換が優先され、同じ変換順位をもつ他の浮動小数点数型への変換が優先して行われる + - 値を維持する変換が曖昧な場合、プログラムは不適格となる ```cpp -int f(std::float32_t); -int f(std::float64_t); -int f(long long); - -float x; -std::float16_t y; -int i = f(x); // f(std::float32_t)が呼び出される。 - // floatとstd::float32_tが同じ変換順位をもつ -int j = f(y); // エラー!曖昧。変換ランクが等しくない +#include + +void f(std::float32_t) {} +void f(std::float64_t) {} +void f(long long) {} + +int main() { + float x; + std::float16_t y; + f(x); // f(std::float32_t)が呼び出される。 + // floatとstd::float32_tが同じ変換順位をもつ + //f(y); // エラー!曖昧。変換順位が等しいオーバーロードが見つからない +} ``` -* std::float32_t[link float32_t.md.nolink] -* std::float64_t[link float32_t.md.nolink] ## 備考 - この型は、C23で定義されるオプションキーワード`_Float16`の別名として定義されることになるだろう - この型は、`_Float16`と相互運用できることが望ましい -- この型は、`__STDCPP_FLOAT16_T__`マクロが定義されない場合、定義されない - - ISO/IEC/IEEE 60559 (IEEE 754) のbinary16フォーマットが実装される環境でこのマクロは定義される ## 例 ```cpp example +#include +#include +#include + +int main() { + std::float16_t a = 1.0f16; + auto b = 2.0f32; // bの型はstd::float32_t + + // aはより大きい精度の型float32_tに変換される + auto c = a + b; // cの型はstd::float32_t + + // 精度を落とす縮小変換は明示的型変換で行う。 + // 拡張浮動小数点数型は数学関数にも渡すことができ、 + // 標準浮動小数点数型への暗黙変換もできる + double d = std::log(static_cast(c)); + + // 同じ精度の浮動小数点数型との間で、精度を落とさず変換でき、 + // coutでも拡張浮動小数点数のまま出力できる + std::cout << static_cast(d) << std::endl; +} ``` +* std::log[link /reference/cmath/log.md] ### 出力 ``` +1.09863 ``` ## バージョン @@ -106,7 +162,18 @@ int j = f(y); // エラー!曖昧。変換ランクが等しくない - C++23 ### 処理系 -- [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 - [Visual C++](/implementation.md#visual_cpp): ?? + +## 関連項目 +- [`std::float32_t`](float32_t.md) +- [`std::float64_t`](float64_t.md) +- [`std::float128_t`](float128_t.md) +- [`std::bfloat16_t`](bfloat16_t.md) + + +## 参照 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + diff --git a/reference/stdfloat/float32_t.md b/reference/stdfloat/float32_t.md new file mode 100644 index 0000000000..fd915b943d --- /dev/null +++ b/reference/stdfloat/float32_t.md @@ -0,0 +1,179 @@ +# float32_t +* stdfloat[meta header] +* std[meta namespace] +* type-alias[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { +#if defined(__STDCPP_FLOAT32_T__) + using float32_t = implementation-defined; +#endif +} +``` + +## 概要 +32ビット単精度の浮動小数点数型。 + +### 内部表現 +この型は、ISO/IEC/IEEE 60559 (IEEE 754) 浮動小数点数規格のbinary32フォーマットをもつ。 + +| 符号ビット数 | 指数ビット数 | 仮数ビット数 | 最大指数 | +|--------------|--------------|--------------|----------| +| 1 | 8 | 23 | 127 | + +### リテラル +値にサフィックスとして`f32`もしくは`F32`を指定することで、`std::float32_t`のリテラルとすることができる。 + +```cpp +std::float32_t a = 1.0f32; +std::float32_t b = 2.0F32; +``` + + +### 事前定義マクロ +- この型は、事前定義マクロ`__STDCPP_FLOAT32_T__`が定義されない場合、定義されない + - ISO/IEC/IEEE 60559 (IEEE 754) のbinary32フォーマットが実装される環境でこのマクロは定義される + + +### 順位 +浮動小数点数の変換で使用される順位 (rank) は、以下のように定義される: + +- `long double` > `double` > `float`のように、`long double`が最も高い順位をもつ +- 同じ値集合をもつ2つの拡張浮動小数点数型は、同じ順位をもつ +- 標準浮動小数点数型と同じ値集合をもつ拡張浮動小数点数型は、同じ順位をもつ +- 標準浮動小数点数型より多くの値集合をもつ拡張浮動小数点数型は、`double`と同じ順位をもつ + +注意として、浮動小数点数型`T1`の値集合が浮動小数点数型`T2`の値集合の部分集合でも上位集合でもない場合、浮動小数点数型`T1`と`T2`の変換順位は順位通りではない。これは、一方の型が他方より大きな範囲と低い精度の両方を持つ場合に起こり得る。 + +順位が同じ浮動小数点数型は、サブ順位 (subrank) で順序付けられる。拡張浮動小数点数は、標準浮動小数点数型よりも大きなサブ順位をもつ。 + + +### 昇格と変換 +C言語の名残と後方互換性のために、オーバーロード解決での`float`から`double`への変換は昇格と見なされるが、ほかの浮動小数点数型では昇格はない。 + +2つの浮動小数点型の少なくとも一方が拡張浮動小数点型である場合、変換先の型が変換元の型より大きいか等しい場合にのみ、2つの浮動小数点型間の変換が暗黙的に行われる。いかなる暗黙の変換も損失なく、値を正確に保持する。潜在的に損失のある変換はすべて明示的でなければならない。 + +小さい精度への変換は、`()`と`{}`による直接初期化、もしくは明示的なキャストのみ許可される。 + +```cpp +void f(std::float16_t); +void g() { + std::float16_t a = 1.0; // エラー!小さい精度への暗黙変換はできない + std::float16_t b(2.0); // OK : 直接初期化 + std::float16_t c{3.0}; // OK : 直接初期化 + a = 4.0; // エラー!小さい精度への暗黙変換はできない + f(5.0); // エラー!小さい精度への暗黙変換はできない + f(static_cast(5.0)); // OK : 明示的なキャスト +} +``` + + +### 通常の算術変換 +算術演算での型変換は、以下のような規則で行われる。 + +- どちらかのオペランドが浮動小数点数型である場合、 + - 両方のオペランドが同じ型であれば、型変換は行われない + - そうでなく、オペランドの一方が浮動小数点数型でなければ、浮動小数点数型のオペランドの型に変換される + - そうでなく、オペランドの浮動小数点数型の変換順位が等しくない場合、小さい方の順位をもつ浮動小数点数型は、もう一方の浮動小数点数型に変換される + - `float + double`は`double`に、`std::float16_t + float`は`float`に変換される + - そうでなく、変換順位が等しい場合、サブ順位で比較が行われ、より大きいサブ順位をもつ浮動小数点数型に変換される + - `float + std::float32_t`は`std::float32_t`に変換される + - そうでなければ、式は不適格となる + - `std::float16_t + std::bfloat16_t`は不適格 + +```cpp example +#include +#include + +int main() { + float f32 = 1.0; + std::float16_t f16{2.0}; + std::bfloat16_t b16{3.0}; + std::float32_t f32b{4.0}; + + auto r1 = f32 + f16; // OK : f16は`float`に変換され、結果の型は`float`となる + auto r2 = f32 + b16; // OK : b16は`float`に変換され、結果の型は`float`となる + //auto r3 = f16 + b16; // エラー!どちらの型も算術変換でもう一方の型に変換できない + auto r4 = f32 + f32b; // OK : f32はより大きいサブ順位をもつ`std::float32_t`に変換される + static_assert(std::is_same_v); +} +``` + +### オーバーロード解決 +- 浮動小数点数型の変換をともなうオーバーロード解決は、値を維持する変換が優先され、同じ変換順位をもつ他の浮動小数点数型への変換が優先して行われる + - 値を維持する変換が曖昧な場合、プログラムは不適格となる + +```cpp +#include + +void f(std::float32_t) {} +void f(std::float64_t) {} +void f(long long) {} + +int main() { + float x; + std::float16_t y; + f(x); // f(std::float32_t)が呼び出される。 + // floatとstd::float32_tが同じ変換順位をもつ + //f(y); // エラー!曖昧。変換順位が等しいオーバーロードが見つからない +} +``` + + + +## 備考 +- この型は、C23で定義されるオプションキーワード`_Float16`の別名として定義されることになるだろう + - この型は、`_Float16`と相互運用できることが望ましい + + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::float16_t a = 1.0f16; + auto b = 2.0f32; // bの型はstd::float32_t + + // aはより大きい精度の型float32_tに変換される + auto c = a + b; // cの型はstd::float32_t + + // 精度を落とす縮小変換は明示的型変換で行う。 + // 拡張浮動小数点数型は数学関数にも渡すことができ、 + // 標準浮動小数点数型への暗黙変換もできる + double d = std::log(static_cast(c)); + + // 同じ精度の浮動小数点数型との間で、精度を落とさず変換でき、 + // coutでも拡張浮動小数点数のまま出力できる + std::cout << static_cast(d) << std::endl; +} +``` +* std::log[link /reference/cmath/log.md] + +### 出力 +``` +1.09863 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`std::float16_t`](float16_t.md) +- [`std::float64_t`](float64_t.md) +- [`std::float128_t`](float128_t.md) +- [`std::bfloat16_t`](bfloat16_t.md) + + +## 参照 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + diff --git a/reference/stdfloat/float64_t.md b/reference/stdfloat/float64_t.md new file mode 100644 index 0000000000..2af32056ba --- /dev/null +++ b/reference/stdfloat/float64_t.md @@ -0,0 +1,179 @@ +# float64_t +* stdfloat[meta header] +* std[meta namespace] +* type-alias[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { +#if defined(__STDCPP_FLOAT64_T__) + using float64_t = implementation-defined; +#endif +} +``` + +## 概要 +64ビット倍精度の浮動小数点数型。 + +### 内部表現 +この型は、ISO/IEC/IEEE 60559 (IEEE 754) 浮動小数点数規格のbinary64フォーマットをもつ。 + +| 符号ビット数 | 指数ビット数 | 仮数ビット数 | 最大指数 | +|--------------|--------------|--------------|----------| +| 1 | 11 | 52 | 1023 | + +### リテラル +値にサフィックスとして`f64`もしくは`F64`を指定することで、`std::float64_t`のリテラルとすることができる。 + +```cpp +std::float64_t a = 1.0f64; +std::float64_t b = 2.0F64; +``` + + +### 事前定義マクロ +- この型は、事前定義マクロ`__STDCPP_FLOAT64_T__`が定義されない場合、定義されない + - ISO/IEC/IEEE 60559 (IEEE 754) のbinary64フォーマットが実装される環境でこのマクロは定義される + + +### 順位 +浮動小数点数の変換で使用される順位 (rank) は、以下のように定義される: + +- `long double` > `double` > `float`のように、`long double`が最も高い順位をもつ +- 同じ値集合をもつ2つの拡張浮動小数点数型は、同じ順位をもつ +- 標準浮動小数点数型と同じ値集合をもつ拡張浮動小数点数型は、同じ順位をもつ +- 標準浮動小数点数型より多くの値集合をもつ拡張浮動小数点数型は、`double`と同じ順位をもつ + +注意として、浮動小数点数型`T1`の値集合が浮動小数点数型`T2`の値集合の部分集合でも上位集合でもない場合、浮動小数点数型`T1`と`T2`の変換順位は順位通りではない。これは、一方の型が他方より大きな範囲と低い精度の両方を持つ場合に起こり得る。 + +順位が同じ浮動小数点数型は、サブ順位 (subrank) で順序付けられる。拡張浮動小数点数は、標準浮動小数点数型よりも大きなサブ順位をもつ。 + + +### 昇格と変換 +C言語の名残と後方互換性のために、オーバーロード解決での`float`から`double`への変換は昇格と見なされるが、ほかの浮動小数点数型では昇格はない。 + +2つの浮動小数点型の少なくとも一方が拡張浮動小数点型である場合、変換先の型が変換元の型より大きいか等しい場合にのみ、2つの浮動小数点型間の変換が暗黙的に行われる。いかなる暗黙の変換も損失なく、値を正確に保持する。潜在的に損失のある変換はすべて明示的でなければならない。 + +小さい精度への変換は、`()`と`{}`による直接初期化、もしくは明示的なキャストのみ許可される。 + +```cpp +void f(std::float16_t); +void g() { + std::float16_t a = 1.0; // エラー!小さい精度への暗黙変換はできない + std::float16_t b(2.0); // OK : 直接初期化 + std::float16_t c{3.0}; // OK : 直接初期化 + a = 4.0; // エラー!小さい精度への暗黙変換はできない + f(5.0); // エラー!小さい精度への暗黙変換はできない + f(static_cast(5.0)); // OK : 明示的なキャスト +} +``` + + +### 通常の算術変換 +算術演算での型変換は、以下のような規則で行われる。 + +- どちらかのオペランドが浮動小数点数型である場合、 + - 両方のオペランドが同じ型であれば、型変換は行われない + - そうでなく、オペランドの一方が浮動小数点数型でなければ、浮動小数点数型のオペランドの型に変換される + - そうでなく、オペランドの浮動小数点数型の変換順位が等しくない場合、小さい方の順位をもつ浮動小数点数型は、もう一方の浮動小数点数型に変換される + - `float + double`は`double`に、`std::float16_t + float`は`float`に変換される + - そうでなく、変換順位が等しい場合、サブ順位で比較が行われ、より大きいサブ順位をもつ浮動小数点数型に変換される + - `float + std::float32_t`は`std::float32_t`に変換される + - そうでなければ、式は不適格となる + - `std::float16_t + std::bfloat16_t`は不適格 + +```cpp example +#include +#include + +int main() { + float f32 = 1.0; + std::float16_t f16{2.0}; + std::bfloat16_t b16{3.0}; + std::float32_t f32b{4.0}; + + auto r1 = f32 + f16; // OK : f16は`float`に変換され、結果の型は`float`となる + auto r2 = f32 + b16; // OK : b16は`float`に変換され、結果の型は`float`となる + //auto r3 = f16 + b16; // エラー!どちらの型も算術変換でもう一方の型に変換できない + auto r4 = f32 + f32b; // OK : f32はより大きいサブ順位をもつ`std::float32_t`に変換される + static_assert(std::is_same_v); +} +``` + +### オーバーロード解決 +- 浮動小数点数型の変換をともなうオーバーロード解決は、値を維持する変換が優先され、同じ変換順位をもつ他の浮動小数点数型への変換が優先して行われる + - 値を維持する変換が曖昧な場合、プログラムは不適格となる + +```cpp +#include + +void f(std::float32_t) {} +void f(std::float64_t) {} +void f(long long) {} + +int main() { + float x; + std::float16_t y; + f(x); // f(std::float32_t)が呼び出される。 + // floatとstd::float32_tが同じ変換順位をもつ + //f(y); // エラー!曖昧。変換順位が等しいオーバーロードが見つからない +} +``` + + + +## 備考 +- この型は、C23で定義されるオプションキーワード`_Float16`の別名として定義されることになるだろう + - この型は、`_Float16`と相互運用できることが望ましい + + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::float16_t a = 1.0f16; + auto b = 2.0f32; // bの型はstd::float32_t + + // aはより大きい精度の型float32_tに変換される + auto c = a + b; // cの型はstd::float32_t + + // 精度を落とす縮小変換は明示的型変換で行う。 + // 拡張浮動小数点数型は数学関数にも渡すことができ、 + // 標準浮動小数点数型への暗黙変換もできる + double d = std::log(static_cast(c)); + + // 同じ精度の浮動小数点数型との間で、精度を落とさず変換でき、 + // coutでも拡張浮動小数点数のまま出力できる + std::cout << static_cast(d) << std::endl; +} +``` +* std::log[link /reference/cmath/log.md] + +### 出力 +``` +1.09863 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`std::float16_t`](float16_t.md) +- [`std::float32_t`](float32_t.md) +- [`std::float128_t`](float128_t.md) +- [`std::bfloat16_t`](bfloat16_t.md) + + +## 参照 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + From b137272314df5cdd51f680abdcd931840dc9fee1 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 22 Feb 2023 20:50:40 +0900 Subject: [PATCH 0209/3948] =?UTF-8?q?C++23=20:=20=E6=8B=A1=E5=BC=B5?= =?UTF-8?q?=E6=B5=AE=E5=8B=95=E5=B0=8F=E6=95=B0=E7=82=B9=E6=95=B0=E5=9E=8B?= =?UTF-8?q?=E3=81=AF=E3=83=A9=E3=82=A4=E3=83=96=E3=83=A9=E3=83=AA=E3=81=A7?= =?UTF-8?q?=E8=A7=A3=E8=AA=AC=E3=82=92=E6=9B=B8=E3=81=84=E3=81=9F=20#1022?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 1 - lang/cpp23.md | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/implementation-status.md b/implementation-status.md index e29619c469..3c91cb55e5 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -249,7 +249,6 @@ | P0330R8: [(符号付き)`size_t`リテラルのためのサフィックス](/lang/cpp23/literal_suffix_for_signed_size_t.md) | `42z`/`42Z`とすることで`size_t`に対応する符号付き整数型のリテラルとする | 11 | 13 | - | - | | P2290R3: [エスケープシーケンスの区切り](/lang/cpp23/delimited_escape_sequences.md.nolink) | エスケープシーケンスの範囲を明確にする構文を追加する | 13 | 15 | - | - | | P2266R3: [暗黙的なムーブを簡略化](/lang/cpp23/simpler_implicit_move.md.nolink) | 参照を返す関数の`return`文で暗黙的にムーブされない問題を修正 | 13 | 13 | - | - | -| P1467R9: [浮動小数点数型の拡張](/lang/cpp23/extended_floating_point_types_and_standard_names.md.nolink) | 実装による拡張浮動小数点型の定義を許可する | 13 | - | - | - | | P1787R6: [スコープと名前ルックアップの仕様整理](/lang/cpp23/declarations_and_where_to_find_them.md.nolink) | 複雑で不完全になっているスコープと名前ルックアップの仕様を整理し、一部の問題を解決する | - | - | - | - | | P2615R1: [無意味なexport宣言を禁止する](/lang/cpp23/meaningful_exports.md.nolink) | | - | - | - | - | | P2360R0: [初期化文での型の別名宣言を許可](/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md.nolink) | `for (using T = int; T e : v) {}`を許可 | 12 | 14 | - | - | diff --git a/lang/cpp23.md b/lang/cpp23.md index 9420d8791b..9cdb590f0a 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -14,7 +14,8 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 | [(符号付き)`size_t`リテラルのためのサフィックス](cpp23/literal_suffix_for_signed_size_t.md) | `42z`/`42Z`とすることで`size_t`に対応する符号付き整数型のリテラルとする | | [エスケープシーケンスの区切り](cpp23/delimited_escape_sequences.md.nolink) | エスケープシーケンスの範囲を明確にする構文を追加する | | [暗黙的なムーブを簡略化](cpp23/simpler_implicit_move.md.nolink) | 参照を返す関数の`return`文で暗黙的にムーブされない問題を修正 | -| [浮動小数点数型の拡張](cpp23/extended_floating_point_types_and_standard_names.md.nolink) | 実装による拡張浮動小数点型の定義を許可する | + +これらに加えて、ライブラリ機能として拡張浮動小数点数型が定義された。[``](/reference/stdfloat.md)を参照。 ### 関数 From f39c3c31a7de0c74a6ad80fc8776d2022ac064e3 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 22 Feb 2023 23:35:18 +0900 Subject: [PATCH 0210/3948] =?UTF-8?q?=E3=81=AE=E5=90=84=E5=9E=8B?= =?UTF-8?q?=20:=20=E8=AA=AC=E6=98=8E=E8=A3=9C=E5=BC=B7=20#1022?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/stdfloat/bfloat16_t.md | 6 +----- reference/stdfloat/float128_t.md | 6 ++++-- reference/stdfloat/float16_t.md | 4 +++- reference/stdfloat/float32_t.md | 6 ++++-- reference/stdfloat/float64_t.md | 6 ++++-- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/reference/stdfloat/bfloat16_t.md b/reference/stdfloat/bfloat16_t.md index 6fb603150f..8334dbc2b5 100644 --- a/reference/stdfloat/bfloat16_t.md +++ b/reference/stdfloat/bfloat16_t.md @@ -107,6 +107,7 @@ int main() { ### オーバーロード解決 - 浮動小数点数型の変換をともなうオーバーロード解決は、値を維持する変換が優先され、同じ変換順位をもつ他の浮動小数点数型への変換が優先して行われる - 値を維持する変換が曖昧な場合、プログラムは不適格となる + - 「ひとつ上の順位をもつ浮動小数点数型に変換する」のような規則ではないため、ひとつ以上上の順位をもつ浮動小数点数型の候補が複数あると曖昧になる ```cpp #include @@ -126,11 +127,6 @@ int main() { -## 備考 -- この型は、C23で定義されるオプションキーワード`_Float16`の別名として定義されることになるだろう - - この型は、`_Float16`と相互運用できることが望ましい - - ## 例 ```cpp example #include diff --git a/reference/stdfloat/float128_t.md b/reference/stdfloat/float128_t.md index 26535c1121..c0547e7dee 100644 --- a/reference/stdfloat/float128_t.md +++ b/reference/stdfloat/float128_t.md @@ -103,6 +103,7 @@ int main() { ### オーバーロード解決 - 浮動小数点数型の変換をともなうオーバーロード解決は、値を維持する変換が優先され、同じ変換順位をもつ他の浮動小数点数型への変換が優先して行われる - 値を維持する変換が曖昧な場合、プログラムは不適格となる + - 「ひとつ上の順位をもつ浮動小数点数型に変換する」のような規則ではないため、ひとつ以上上の順位をもつ浮動小数点数型の候補が複数あると曖昧になる ```cpp #include @@ -123,8 +124,9 @@ int main() { ## 備考 -- この型は、C23で定義されるオプションキーワード`_Float16`の別名として定義されることになるだろう - - この型は、`_Float16`と相互運用できることが望ましい +- この型は、C23で定義されるオプションキーワード`_Float128`の別名として定義されることになるだろう + - この型は、`_Float128`と相互運用できるよう実装されることが望ましい +- この型が定義される環境はISO/IEC/IEEE 60559 (IEEE 754) 準拠であるため、同じ変換順位をもつ浮動小数点数型 (`float`と`std::float32_t`のような) は同じ内部表現をもつ ## 例 diff --git a/reference/stdfloat/float16_t.md b/reference/stdfloat/float16_t.md index 8bdb7a312d..1e6f2eb837 100644 --- a/reference/stdfloat/float16_t.md +++ b/reference/stdfloat/float16_t.md @@ -103,6 +103,7 @@ int main() { ### オーバーロード解決 - 浮動小数点数型の変換をともなうオーバーロード解決は、値を維持する変換が優先され、同じ変換順位をもつ他の浮動小数点数型への変換が優先して行われる - 値を維持する変換が曖昧な場合、プログラムは不適格となる + - 「ひとつ上の順位をもつ浮動小数点数型に変換する」のような規則ではないため、ひとつ以上上の順位をもつ浮動小数点数型の候補が複数あると曖昧になる ```cpp #include @@ -124,7 +125,8 @@ int main() { ## 備考 - この型は、C23で定義されるオプションキーワード`_Float16`の別名として定義されることになるだろう - - この型は、`_Float16`と相互運用できることが望ましい + - この型は、`_Float16`と相互運用できるよう実装されることが望ましい +- この型が定義される環境はISO/IEC/IEEE 60559 (IEEE 754) 準拠であるため、同じ変換順位をもつ浮動小数点数型 (`float`と`std::float32_t`のような) は同じ内部表現をもつ ## 例 diff --git a/reference/stdfloat/float32_t.md b/reference/stdfloat/float32_t.md index fd915b943d..ff19acbd0e 100644 --- a/reference/stdfloat/float32_t.md +++ b/reference/stdfloat/float32_t.md @@ -103,6 +103,7 @@ int main() { ### オーバーロード解決 - 浮動小数点数型の変換をともなうオーバーロード解決は、値を維持する変換が優先され、同じ変換順位をもつ他の浮動小数点数型への変換が優先して行われる - 値を維持する変換が曖昧な場合、プログラムは不適格となる + - 「ひとつ上の順位をもつ浮動小数点数型に変換する」のような規則ではないため、ひとつ以上上の順位をもつ浮動小数点数型の候補が複数あると曖昧になる ```cpp #include @@ -123,8 +124,9 @@ int main() { ## 備考 -- この型は、C23で定義されるオプションキーワード`_Float16`の別名として定義されることになるだろう - - この型は、`_Float16`と相互運用できることが望ましい +- この型は、C23で定義されるオプションキーワード`_Float32`の別名として定義されることになるだろう + - この型は、`_Float32`と相互運用できるよう実装されることが望ましい +- この型が定義される環境はISO/IEC/IEEE 60559 (IEEE 754) 準拠であるため、同じ変換順位をもつ浮動小数点数型 (`float`と`std::float32_t`のような) は同じ内部表現をもつ ## 例 diff --git a/reference/stdfloat/float64_t.md b/reference/stdfloat/float64_t.md index 2af32056ba..c477a8acea 100644 --- a/reference/stdfloat/float64_t.md +++ b/reference/stdfloat/float64_t.md @@ -103,6 +103,7 @@ int main() { ### オーバーロード解決 - 浮動小数点数型の変換をともなうオーバーロード解決は、値を維持する変換が優先され、同じ変換順位をもつ他の浮動小数点数型への変換が優先して行われる - 値を維持する変換が曖昧な場合、プログラムは不適格となる + - 「ひとつ上の順位をもつ浮動小数点数型に変換する」のような規則ではないため、ひとつ以上上の順位をもつ浮動小数点数型の候補が複数あると曖昧になる ```cpp #include @@ -123,8 +124,9 @@ int main() { ## 備考 -- この型は、C23で定義されるオプションキーワード`_Float16`の別名として定義されることになるだろう - - この型は、`_Float16`と相互運用できることが望ましい +- この型は、C23で定義されるオプションキーワード`_Float64`の別名として定義されることになるだろう + - この型は、`_Float64`と相互運用できるよう実装されることが望ましい +- この型が定義される環境はISO/IEC/IEEE 60559 (IEEE 754) 準拠であるため、同じ変換順位をもつ浮動小数点数型 (`float`と`std::float32_t`のような) は同じ内部表現をもつ ## 例 From f91a124e156859b310f53ef062117ae93c9c2ec2 Mon Sep 17 00:00:00 2001 From: Akiko Kawai Date: Thu, 23 Feb 2023 15:06:41 +0900 Subject: [PATCH 0211/3948] Updated ICX title for C++23 #1122 --- implementation-status.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/implementation-status.md b/implementation-status.md index 3c91cb55e5..d82e42b523 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -244,7 +244,7 @@ ## C++23言語機能の実装状況 -| 言語機能 | 説明 | [GCC][gcc] | [Clang][clang] | [ICC][icc] | [MSVC][msvc] | +| 言語機能 | 説明 | [GCC][gcc] | [Clang][clang] | [ICX][icx] | [MSVC][msvc] | |----------|------|------------|----------------|------------|--------------| | P0330R8: [(符号付き)`size_t`リテラルのためのサフィックス](/lang/cpp23/literal_suffix_for_signed_size_t.md) | `42z`/`42Z`とすることで`size_t`に対応する符号付き整数型のリテラルとする | 11 | 13 | - | - | | P2290R3: [エスケープシーケンスの区切り](/lang/cpp23/delimited_escape_sequences.md.nolink) | エスケープシーケンスの範囲を明確にする構文を追加する | 13 | 15 | - | - | @@ -288,9 +288,10 @@ - Visual C++ (MSVC): - [C++23 - cppreference](https://en.cppreference.com/w/cpp/23) - [次リリース情報(VS2019,2022) - Change log](https://github.com/microsoft/STL/wiki/Changelog) +- ICX: [C+23 Features Supported by Intel® C+ Compiler](https://www.intel.com/content/www/us/en/developer/articles/technical/c23-features-supported-by-intel-c-compiler.html) [gcc]: ./implementation.md#gcc [clang]: ./implementation.md#clang -[icc]: ./implementation.md#icc +[icx]: ./implementation.md#icc [msvc]: ./implementation.md#visual_cpp From 54c77480d6285273fddf16893c874817017ce004 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 24 Feb 2023 13:43:30 +0900 Subject: [PATCH 0212/3948] =?UTF-8?q?barrier:=20P2588R3=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/barrier/barrier.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/reference/barrier/barrier.md b/reference/barrier/barrier.md index 30647f3fcd..61d1f35772 100644 --- a/reference/barrier/barrier.md +++ b/reference/barrier/barrier.md @@ -31,9 +31,9 @@ namespace std { 各バリアフェーズ(barrier phase)は下記のステップで構成される: -- [`arrive()`](barrier/arrive.md)または[`arrive_and_drop`](barrier/arrive_and_drop.md)呼び出しによって、予定カウントを減算する。 -- 予定カウントが`0`に到達したら、完了ステップを実行する。テンプレートパラメータ`CompletionFunction`のデフォルト値に対する特殊化では、完了ステップは予定カウントを`0`とした[`arrive()`](barrier/arrive.md)または[`arrive_and_drop`](barrier/arrive_and_drop.md)呼び出しの一部として実行される。それ以外の特殊化では、完了ステップはそのフェーズ内でバリア到達したスレッドのいずれか1つの上で実行される。 -- 完了ステップが終了したのち、予定カウントをコンストラクタ実引数`expected`でリセットし、[`arrive_and_drop`](barrier/arrive_and_drop.md)呼び出しの場合は調整を行って、次のフェーズを開始する。 +- [`arrive()`](barrier/arrive.md)または[`arrive_and_drop()`](barrier/arrive_and_drop.md)呼び出しによって、予定カウントを減算する。 +- 予定カウントが`0`に到達した後、[`arrive()`](barrier/arrive.md)/[`arrive_and_drop()`](barrier/arrive_and_drop.md)/[`wait()`](barrier/wait.md)いずれかの呼び出しの間に、いずれかのスレッドにより正確に1回だけ完了ステップが実行される。だだし[`wait()`](barrier/wait.md)呼び出しを行うスレッドがない場合に、完了ステップが実行されるか否かは処理系定義とされる。 +- 完了ステップが終了したのち、予定カウントをコンストラクタ実引数`expected`でリセットし、[`arrive_and_drop()`](barrier/arrive_and_drop.md)呼び出しの場合は調整を行って、次のフェーズを開始する。 各フェーズは、フェーズ同期ポイント(phase synchronization point)を定義する。 フェーズ内でバリアに到達したスレッドは、[`wait()`](barrier/wait.md)呼び出しによりフェーズ同期ポイント上でブロックされ、フェーズ完了ステップが実行されるまでブロック状態は継続する。 @@ -160,10 +160,14 @@ Main 3 ## 関連項目 -- [``](/reference/latch.md) +- [`latch`](/reference/latch/latch.md) ## 参照 +- [P0666R2 Revised Latches and Barriers for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0666r2.pdf) +- [P1135R6 The C++20 Synchronization Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1135r6.html) +- [P2588R3 `barrier`'s phase completion guarantees](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2588r3.html) + - バリアフェーズ動作仕様の完了ステップを呼び出すスレッド要件が緩和された。 - [Boost.Threadライブラリ, Barriers](https://www.boost.org/doc/libs/1_73_0/doc/html/thread/synchronization.html#thread.synchronization.barriers) - [Java標準ライブラリ, java.util.concurrent.CyclicBarrier](https://docs.oracle.com/javase/jp/6/api/java/util/concurrent/CyclicBarrier.html) - [C#標準ライブラリ, System.Threading.Barrier](https://docs.microsoft.com/en-us/dotnet/api/system.threading.barrier) From 16e1d9768ef71370827c7cdb4a2a6c7d338d4914 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Fri, 24 Feb 2023 18:03:12 +0900 Subject: [PATCH 0213/3948] =?UTF-8?q?=E6=9C=AA=E5=88=9D=E6=9C=9F=E5=8C=96?= =?UTF-8?q?=E9=A0=98=E5=9F=9F=E3=81=B8=E3=81=AE=E6=9A=97=E9=BB=99=E7=9A=84?= =?UTF-8?q?=E3=81=AA=E3=82=AA=E3=83=96=E3=82=B8=E3=82=A7=E3=82=AF=E3=83=88?= =?UTF-8?q?=E6=A7=8B=E7=AF=89=20:=20=E3=81=94=E6=8C=87=E6=91=98=E5=8F=8D?= =?UTF-8?q?=E6=98=A0=20#1117?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...jects_for_low-level_object_manipulation.md | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md index 032c88222e..5d41421f92 100644 --- a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md +++ b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md @@ -118,9 +118,9 @@ struct Vec { std::uninitialized_copy(begin(), end(), (T*)newbuf); // #a 💀 UB ::operator delete(buf, std::align_val_t(alignof(T))); + buf = newbuf; buf_end_size = newbuf + sizeof(T) * size(); // #b 💀 UB buf_end_capacity = newbuf + sizeof(T) * n; // #c 💀 UB - buf = newbuf; } void push_back(T t) { @@ -367,13 +367,17 @@ void process(Stream *stream) { std::unique_ptr buffer = stream->read(); // 先頭バイトの状態によって適切なオブジェクトがStream::read()内で構築されている + // ただし、reinterpret_castの代わりにstd::launder()を使用する必要がある if (buffer[0] == FOO) { - process_foo(reinterpret_cast(buffer.get())); // ✅ ok + process_foo(std::launder(buffer.get())); // ✅ ok } else { - process_bar(reinterpret_cast(buffer.get())); // ✅ ok + process_bar(std::launder(buffer.get())); // ✅ ok } } ``` +* std::launder[link /reference/new/launder.md] + +追加で、各分岐においては返された`buffer`ポインタ(`char(*)[]`)から、それぞれの場合で適切なオブジェクト(`Foo`/`Bar`)へのポインタを[`std::launder()`](/reference/new/launder.md)によって取得する必要がある。`reinterpret_cast`はポインタの変換のみを行うため、この場合に ### 動的配列の実装 @@ -393,14 +397,14 @@ struct Vec { // newbufにはT[]のオブジェクトが生存期間内にあるため、ポインタT*をイテレータとして使用可能となる // ここで、T[]の要素のTのオブジェクトが構築される(明示的) - std::uninitialized_copy(begin(), end(), (T*)newbuf); // #a ✅ ok + std::uninitialized_copy(begin(), end(), std::launder(newbuf)); // #a ✅ ok ::operator delete(buf, std::align_val_t(alignof(T))); + buf = newbuf; // newbufにはchar[]のオブジェクトが生存期間内にあるため、newbuf(char*)をイテレータとして使用可能となる buf_end_size = newbuf + sizeof(T) * size(); // #b ✅ ok buf_end_capacity = newbuf + sizeof(T) * n; // #c ✅ ok - buf = newbuf; } void push_back(T t) { @@ -412,9 +416,9 @@ struct Vec { buf_end_size += sizeof(T); // #d ✅ ok } - T *begin() { return (T*)buf; } + T *begin() { return std::launder(buf); } - T *end() { return (T*)buf_end_size; } + T *end() { return std::launder(buf_end_size); } // buf及びbuf_end_sizeの指す領域にはT[]のオブジェクトが生存期間内にあるため、ポインタをイテレータとして使用可能 std::size_t size() { return end() - begin(); } // #e ✅ ok @@ -433,6 +437,8 @@ int main() { この例では、`reserve()`内`newbuf`及びそれを保存している`Vec::buf`の領域に`T[]`(`T`の配列型)と`char[]`のオブジェクトが暗黙的に構築され、同時に生存期間内にあることで、問題(配列オブジェクトを指さないポインタのイテレータとしての使用)が解消され、すべての箇所で定義された振る舞いをもたらしている。 +ここでも同様に、`newbuf`及び`Vec::buf`から都度適切なオブジェクトへのポインタを得るのに[`std::launder()`](/reference/new/launder.md)を使用する必要がある。 + ## この機能が必要になった背景・経緯 (執筆中) From 9116a9393d60707981347afccd127578fd47f374 Mon Sep 17 00:00:00 2001 From: sakujiro-inagaki <81898143+sakujiro-inagaki@users.noreply.github.com> Date: Sat, 25 Feb 2023 12:56:48 +0900 Subject: [PATCH 0214/3948] =?UTF-8?q?variant=E3=81=8C=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=E3=81=AE=E5=8B=95=E7=9A=84=E3=83=A1=E3=83=A2=E3=83=AA=E7=A2=BA?= =?UTF-8?q?=E4=BF=9D=E3=82=92=E8=A1=8C=E3=82=8F=E3=81=AA=E3=81=84=E3=81=93?= =?UTF-8?q?=E3=81=A8=E3=82=92=E8=AA=AC=E6=98=8E=E3=81=99=E3=82=8B=E6=96=87?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 「スタック領域のみを使用する」かどうかはvariant自身がスタック領域に置かれているかによるため、「オブジェクト表現内に直接割り当てる」という表現に修正。 --- reference/variant/variant.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/variant/variant.md b/reference/variant/variant.md index fa7cd33dbd..fb0dae86ab 100644 --- a/reference/variant/variant.md +++ b/reference/variant/variant.md @@ -43,7 +43,7 @@ std::visit([](auto& x) { このクラスと同様のことは共用体を使用しても達成できるが、このクラスはより使いやすいよう設計されている。 -このクラスは動的メモリ確保は行わず、スタック領域のみを使用する。 +このクラスは追加の動的メモリ確保は行わず、保持するオブジェクトを自身のオブジェクト表現内に直接割り当てる。 ### 備考 From 3607e5ab6eb5bf25b32929dc2426d78672ab5e9f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 27 Feb 2023 18:24:07 +0900 Subject: [PATCH 0215/3948] =?UTF-8?q?numeric=5Flimits::is=5Fiec559=20:=20C?= =?UTF-8?q?++23=E5=AF=BE=E5=BF=9C=20#1022?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/limits/numeric_limits/is_iec559.md | 11 ++++++----- reference/stdfloat/float128_t.md | 1 + reference/stdfloat/float16_t.md | 1 + reference/stdfloat/float32_t.md | 1 + reference/stdfloat/float64_t.md | 1 + 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/reference/limits/numeric_limits/is_iec559.md b/reference/limits/numeric_limits/is_iec559.md index 1c563ec065..b08d9d4cc8 100644 --- a/reference/limits/numeric_limits/is_iec559.md +++ b/reference/limits/numeric_limits/is_iec559.md @@ -5,17 +5,18 @@ * variable[meta id-type] ```cpp -// C++03 -static const bool is_iec559; - -// C++11 -static constexpr bool is_iec559; +static const bool is_iec559; // (1) C++03 +static constexpr bool is_iec559; // (1) C++11 ``` ## 概要 浮動小数点数型において、型`T`がIEC 559 (IEEE 754) に準拠しているかを判定する。 +## 備考 +- C++23 : [`float16_t`](/reference/stdfloat/float16_t.md)、[`float32_t`](/reference/stdfloat/float32_t.md)、[`float64_t`](/reference/stdfloat/float64_t.md)、[`float128_t`](/reference/stdfloat/float128_t.md)が存在する場合、この値は`true`となる + + ## 例 ```cpp example #include diff --git a/reference/stdfloat/float128_t.md b/reference/stdfloat/float128_t.md index c0547e7dee..a3802e2db1 100644 --- a/reference/stdfloat/float128_t.md +++ b/reference/stdfloat/float128_t.md @@ -174,6 +174,7 @@ int main() { - [`std::float32_t`](float32_t.md) - [`std::float64_t`](float64_t.md) - [`std::bfloat16_t`](bfloat16_t.md) +- [`std::numeric_limits::is_iec559`](/reference/limits/numeric_limits/is_iec559.md) ## 参照 diff --git a/reference/stdfloat/float16_t.md b/reference/stdfloat/float16_t.md index 1e6f2eb837..38896bf409 100644 --- a/reference/stdfloat/float16_t.md +++ b/reference/stdfloat/float16_t.md @@ -174,6 +174,7 @@ int main() { - [`std::float64_t`](float64_t.md) - [`std::float128_t`](float128_t.md) - [`std::bfloat16_t`](bfloat16_t.md) +- [`std::numeric_limits::is_iec559`](/reference/limits/numeric_limits/is_iec559.md) ## 参照 diff --git a/reference/stdfloat/float32_t.md b/reference/stdfloat/float32_t.md index ff19acbd0e..de37aa6a84 100644 --- a/reference/stdfloat/float32_t.md +++ b/reference/stdfloat/float32_t.md @@ -174,6 +174,7 @@ int main() { - [`std::float64_t`](float64_t.md) - [`std::float128_t`](float128_t.md) - [`std::bfloat16_t`](bfloat16_t.md) +- [`std::numeric_limits::is_iec559`](/reference/limits/numeric_limits/is_iec559.md) ## 参照 diff --git a/reference/stdfloat/float64_t.md b/reference/stdfloat/float64_t.md index c477a8acea..e696fd9c88 100644 --- a/reference/stdfloat/float64_t.md +++ b/reference/stdfloat/float64_t.md @@ -174,6 +174,7 @@ int main() { - [`std::float32_t`](float32_t.md) - [`std::float128_t`](float128_t.md) - [`std::bfloat16_t`](bfloat16_t.md) +- [`std::numeric_limits::is_iec559`](/reference/limits/numeric_limits/is_iec559.md) ## 参照 From 85010fbf2610dd0ecf5616502c609d70839d02b3 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 28 Feb 2023 17:48:48 +0900 Subject: [PATCH 0216/3948] =?UTF-8?q?basic=5Fostream::operator<<=20:=20C++?= =?UTF-8?q?23=E5=AF=BE=E5=BF=9C=E3=81=A8=E3=81=97=E3=81=A6=E6=8B=A1?= =?UTF-8?q?=E5=BC=B5=E6=B5=AE=E5=8B=95=E5=B0=8F=E6=95=B0=E7=82=B9=E6=95=B0?= =?UTF-8?q?=E5=9E=8B=E3=82=B5=E3=83=9D=E3=83=BC=E3=83=88=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=20#1022?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ostream/basic_ostream/op_ostream.md | 163 ++++++++++-------- reference/stdfloat/bfloat16_t.md | 1 + reference/stdfloat/float128_t.md | 1 + reference/stdfloat/float16_t.md | 1 + reference/stdfloat/float32_t.md | 1 + reference/stdfloat/float64_t.md | 1 + 6 files changed, 92 insertions(+), 76 deletions(-) diff --git a/reference/ostream/basic_ostream/op_ostream.md b/reference/ostream/basic_ostream/op_ostream.md index 740f02ceca..6a1dfae915 100644 --- a/reference/ostream/basic_ostream/op_ostream.md +++ b/reference/ostream/basic_ostream/op_ostream.md @@ -7,75 +7,86 @@ ```cpp // マニピュレータの実行 // 3つとも関数へのポインタを引数に取る。 -basic_ostream& operator<<(basic_ostream& (*pf)(basic_ostream&)); -basic_ostream& operator<<(basic_ios& (*pf)(basic_ios&)); -basic_ostream& operator<<(ios_base& (*pf)(ios_base&)); +basic_ostream& + operator<<(basic_ostream& (*pf)(basic_ostream&)); // (1) C++03 +basic_ostream& + operator<<(basic_ios& (*pf)(basic_ios&)); // (2) C++03 +basic_ostream& + operator<<(ios_base& (*pf)(ios_base&)); // (3) C++03 // bool値・数値・ポインタの書式化出力 -basic_ostream& operator<<(bool n); -basic_ostream& operator<<(short n); -basic_ostream& operator<<(unsigned short n); -basic_ostream& operator<<(int n); -basic_ostream& operator<<(unsigned int n); -basic_ostream& operator<<(long n); -basic_ostream& operator<<(unsigned long n); -basic_ostream& operator<<(long long n); // C++11 -basic_ostream& operator<<(unsigned long long n); // C++11 -basic_ostream& operator<<(float f); -basic_ostream& operator<<(double f); -basic_ostream& operator<<(long double f); -basic_ostream& operator<<(const void* p); -basic_ostream& operator<<(nullptr_t); // C++17 +basic_ostream& operator<<(bool n); // (4) C++03 +basic_ostream& operator<<(short n); // (5) C++03 +basic_ostream& operator<<(unsigned short n); // (6) C++03 +basic_ostream& operator<<(int n); // (7) C++03 +basic_ostream& operator<<(unsigned int n); // (8) C++03 +basic_ostream& operator<<(long n); // (9) C++03 +basic_ostream& operator<<(unsigned long n); // (10) C++03 +basic_ostream& operator<<(long long n); // (11) C++11 +basic_ostream& operator<<(unsigned long long n); // (12) C++11 +basic_ostream& operator<<(float f); // (13) C++03 +basic_ostream& operator<<(double f); // (14) C++03 +basic_ostream& operator<<(long double f); // (15) C++03 +basic_ostream& + operator<<(extended-floating-point-type f); // (16) C++23 +basic_ostream& operator<<(const void* p); // (17) C++03 +basic_ostream& operator<<(nullptr_t); // (18) C++17 // ストリームバッファの非書式化出力 -basic_ostream& operator<<(basic_streambuf* sb); +basic_ostream& operator<<(basic_streambuf* sb); // (19) C++03 ``` * nullptr_t[link /reference/cstddef/nullptr_t.md] +* extended-floating-point-type[link /reference/stdfloat.md] ## 概要 ストリームへの出力またはマニピュレータの実行を行う。 -- マニピュレータを実行するオーバーロードそれ自体は、書式化出力関数・非書式化出力関数いずれにも該当しない。 -- 数値型(`bool`も含む)とポインタに対するオーバーロードは、書式化出力関数である。 -- `basic_streambuf`に対するオーバーロードは、非書式化出力関数である。 +- (1)-(3) : マニピュレータを実行するオーバーロードそれ自体は、書式化出力関数・非書式化出力関数いずれにも該当しない +- (4)-(18) : 数値型(`bool`も含む)とポインタに対するオーバーロードは、書式化出力関数である +- (19) : `basic_streambuf`に対するオーバーロードは、非書式化出力関数である ## 効果 -### マニピュレータの実行 +### (1)-(3) : マニピュレータの実行 1. `pf(*this)`を呼び出す。 -### bool値・数値・ポインタの書式化出力 +### (4)-(17) : bool値・数値・ポインタの書式化出力 -1. `sentry`オブジェクトを構築する。`sentry`オブジェクトが失敗を示した場合、何もしない。 -1. `num_put::put`を使用して入力のパース・数値への変換を行う。実引数を渡すに際し、一部の型では以下のように型変換を行う。 - - `short` - - `flags()`に`hex`または`oct`が設定されていれば`static_cast(static_cast(n))` - - それ以外では`static_cast(n)` - - `int` - - `flags()`に`hex`または`oct`が設定されていれば`static_cast(static_cast(n))` - - それ以外では`static_cast(n)` - - `unsigned short`、`unsigned int`: `static_cast(n)` - - `float`: `static_cast(n)` -1. `num_put::put`から得られた`iostate`値を実引数にして`setstate`関数を呼び出す。 +1. `sentry`オブジェクトを構築する。`sentry`オブジェクトが失敗を示した場合、何もしない +1. `num_put::put`を使用して入力のパース・数値への変換を行う。実引数を渡すに際し、一部の型では以下のように型変換を行う + - (5) `short`: + - `flags()`に`hex`または`oct`が設定されていれば`static_cast(static_cast(n))` + - それ以外では`static_cast(n)` + - (6) `unsigned short`: `static_cast(n)` + - (7) `int`: + - `flags()`に`hex`または`oct`が設定されていれば`static_cast(static_cast(n))` + - それ以外では`static_cast(n)` + - (8) `unsigned int`: `static_cast(n)` + - (13) `float`: `static_cast(f)` + - (16) 拡張浮動小数点数型: + - 変換順位が`double`以下であれば、`static_cast(f)` + - そうでなく変換順位が`long double`以下であれば、`static_cast(f)` + - そうでなければ実装定義の意味論を持ち、この演算子は条件付きサポートとなる +1. `num_put::put`から得られた`iostate`値を実引数にして`setstate`関数を呼び出す -### `nullptr_t`の出力 +### (18) : `nullptr_t`の出力 - C++17 : 実装定義の出力文字列`s`を、`return operator<<(s)`として渡した場合と等価である。 -### ストリームバッファの非書式化出力 +### (19) : ストリームバッファの非書式化出力 別のストリームバッファからの入力をストリームに出力する。 1. `sentry`オブジェクトを構築する。`sentry`オブジェクトが失敗を示した場合、何もしない。 1. 仮引数`sb`がヌルポインタの場合、`setstate(badbit)`を呼び出して終了する。 1. 以下のいずれかを満たすまで、`sb`から文字を入力して`this`へ出力する。 - - EOFに達した。 - - 出力処理に失敗した(この場合、失敗したときの文字は入力側のストリームバッファに戻される)。 - - 例外が発生した。 + - EOFに達した。 + - 出力処理に失敗した(この場合、失敗したときの文字は入力側のストリームバッファに戻される)。 + - 例外が発生した。 入力がなされなかった場合、`setstate(failbit)`を呼び出す。 @@ -86,9 +97,9 @@ basic_ostream& operator<<(basic_streambuf* sb); ## 備考 - - このクラスにはメンバ関数版の`operator<<`と非メンバ関数版の`operator<<`があるが、ロケールに依存して出力が変わる型へのオーバーロードが、メンバ関数版として定義される設計となっている。 - 参照 : [N0470 A Draft for the Specification of the IOStream Classes](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/1994/N0470.asc) +- (16) : 実装はCV修飾されていない全ての拡張浮動小数点数型に対するオーバーロードを提供する ## 例 @@ -105,8 +116,6 @@ int main() { 101 ``` -## 実装例 -TBD ## バージョン ### 言語 @@ -117,43 +126,45 @@ TBD ## 関連項目 - このほかの`<<`演算子関数 - - [文字・文字列の書式化出力、および、右辺値ストリームに対する出力](op_ostream_free.md) - - [`std::sub_match`に関するもの](../../regex/sub_match/op_ostream.md) - - [`std::error_code`に関するもの](../../system_error/error_code/op_ostream.md) - - [`std::complex`に関するもの](../../complex/complex/op_ostream.md) - - [`std::bitset`に関するもの](../../bitset/bitset/op_ostream.md) - - [`std::basic_string`に関するもの](../../string/basic_string/op_ostream.md) - - [`std::shared_ptr`に関するもの](../../memory/shared_ptr/op_ostream.md) - - [`std::shuffle_order_engine`に関するもの](../../random/shuffle_order_engine/op_ostream.md) - - [`std::gamma_distribution`に関するもの](../../random/gamma_distribution/op_ostream.md) - - [`std::geometric_distribution`に関するもの](../../random/geometric_distribution/op_ostream.md) - - [`std::extreme_value_distribution`に関するもの](../../random/extreme_value_distribution/op_ostream.md) - - [`std::fisher_f_distribution`に関するもの](../../random/fisher_f_distribution/op_ostream.md) - - [`std::mersenne_twister_engine`に関するもの](../../random/mersenne_twister_engine/op_ostream.md) - - [`std::chi_squared_distribution`に関するもの](../../random/chi_squared_distribution/op_ostream.md) - - [`std::exponential_distribution`に関するもの](../../random/exponential_distribution/op_ostream.md) - - [`std::discrete_distribution`に関するもの](../../random/discrete_distribution/op_ostream.md) - - [`std::subtract_with_carry_engine`に関するもの](../../random/subtract_with_carry_engine/op_ostream.md) - - [`std::piecewise_constant_distribution`に関するもの](../../random/piecewise_constant_distribution/op_ostream.md) - - [`std::poisson_distribution`に関するもの](../../random/poisson_distribution/op_ostream.md) - - [`std::student_t_distribution`に関するもの](../../random/student_t_distribution/op_ostream.md) - - [`std::bernoulli_distribution`に関するもの](../../random/bernoulli_distribution/op_ostream.md) - - [`std::weibull_distribution`に関するもの](../../random/weibull_distribution/op_ostream.md) - - [`std::binomial_distribution`に関するもの](../../random/binomial_distribution/op_ostream.md) - - [`std::piecewise_linear_distribution`に関するもの](../../random/piecewise_linear_distribution/op_ostream.md) - - [`std::uniform_real_distribution`に関するもの](../../random/uniform_real_distribution/op_ostream.md) - - [`std::negative_binomial_distribution`に関するもの](../../random/negative_binomial_distribution/op_ostream.md) - - [`std::discard_block_engine`に関するもの](../../random/discard_block_engine/op_ostream.md) - - [`std::normal_distribution`に関するもの](../../random/normal_distribution/op_ostream.md) - - [`std::cauchy_distribution`に関するもの](../../random/cauchy_distribution/op_ostream.md) - - [`std::lognormal_distribution`に関するもの](../../random/lognormal_distribution/op_ostream.md) - - [`std::linear_congruential_engine`に関するもの](../../random/linear_congruential_engine/op_ostream.md) - - [`std::uniform_int_distribution`に関するもの](../../random/uniform_int_distribution/op_ostream.md) - - [`std::independent_bits_engine`に関するもの](../../random/independent_bits_engine/op_ostream.md) + - [文字・文字列の書式化出力、および、右辺値ストリームに対する出力](op_ostream_free.md) + - [`std::sub_match`に関するもの](../../regex/sub_match/op_ostream.md) + - [`std::error_code`に関するもの](../../system_error/error_code/op_ostream.md) + - [`std::complex`に関するもの](../../complex/complex/op_ostream.md) + - [`std::bitset`に関するもの](../../bitset/bitset/op_ostream.md) + - [`std::basic_string`に関するもの](../../string/basic_string/op_ostream.md) + - [`std::shared_ptr`に関するもの](../../memory/shared_ptr/op_ostream.md) + - [`std::shuffle_order_engine`に関するもの](../../random/shuffle_order_engine/op_ostream.md) + - [`std::gamma_distribution`に関するもの](../../random/gamma_distribution/op_ostream.md) + - [`std::geometric_distribution`に関するもの](../../random/geometric_distribution/op_ostream.md) + - [`std::extreme_value_distribution`に関するもの](../../random/extreme_value_distribution/op_ostream.md) + - [`std::fisher_f_distribution`に関するもの](../../random/fisher_f_distribution/op_ostream.md) + - [`std::mersenne_twister_engine`に関するもの](../../random/mersenne_twister_engine/op_ostream.md) + - [`std::chi_squared_distribution`に関するもの](../../random/chi_squared_distribution/op_ostream.md) + - [`std::exponential_distribution`に関するもの](../../random/exponential_distribution/op_ostream.md) + - [`std::discrete_distribution`に関するもの](../../random/discrete_distribution/op_ostream.md) + - [`std::subtract_with_carry_engine`に関するもの](../../random/subtract_with_carry_engine/op_ostream.md) + - [`std::piecewise_constant_distribution`に関するもの](../../random/piecewise_constant_distribution/op_ostream.md) + - [`std::poisson_distribution`に関するもの](../../random/poisson_distribution/op_ostream.md) + - [`std::student_t_distribution`に関するもの](../../random/student_t_distribution/op_ostream.md) + - [`std::bernoulli_distribution`に関するもの](../../random/bernoulli_distribution/op_ostream.md) + - [`std::weibull_distribution`に関するもの](../../random/weibull_distribution/op_ostream.md) + - [`std::binomial_distribution`に関するもの](../../random/binomial_distribution/op_ostream.md) + - [`std::piecewise_linear_distribution`に関するもの](../../random/piecewise_linear_distribution/op_ostream.md) + - [`std::uniform_real_distribution`に関するもの](../../random/uniform_real_distribution/op_ostream.md) + - [`std::negative_binomial_distribution`に関するもの](../../random/negative_binomial_distribution/op_ostream.md) + - [`std::discard_block_engine`に関するもの](../../random/discard_block_engine/op_ostream.md) + - [`std::normal_distribution`に関するもの](../../random/normal_distribution/op_ostream.md) + - [`std::cauchy_distribution`に関するもの](../../random/cauchy_distribution/op_ostream.md) + - [`std::lognormal_distribution`に関するもの](../../random/lognormal_distribution/op_ostream.md) + - [`std::linear_congruential_engine`に関するもの](../../random/linear_congruential_engine/op_ostream.md) + - [`std::uniform_int_distribution`に関するもの](../../random/uniform_int_distribution/op_ostream.md) + - [`std::independent_bits_engine`に関するもの](../../random/independent_bits_engine/op_ostream.md) - 出力対象の型 - - [`basic_streambuf`](../../streambuf/basic_streambuf.md) + - [`basic_streambuf`](../../streambuf/basic_streambuf.md) ## 参照 - [N2114 `long long` Goes to the Library, Revision 1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2114.html) - [LWG Issue 2221. No formatted output operator for `nullptr`](https://wg21.cmeerw.net/lwg/issue2221) +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で拡張浮動小数点数型の`ostream`出力がサポートされた diff --git a/reference/stdfloat/bfloat16_t.md b/reference/stdfloat/bfloat16_t.md index 8334dbc2b5..8e748b72de 100644 --- a/reference/stdfloat/bfloat16_t.md +++ b/reference/stdfloat/bfloat16_t.md @@ -176,6 +176,7 @@ int main() { - [`std::float32_t`](float32_t.md) - [`std::float64_t`](float64_t.md) - [`std::float128_t`](float128_t.md) +- [`std::basic_ostream::operator<<`](/reference/ostream/basic_ostream/op_ostream.md) ## 参照 diff --git a/reference/stdfloat/float128_t.md b/reference/stdfloat/float128_t.md index a3802e2db1..f27a31bcec 100644 --- a/reference/stdfloat/float128_t.md +++ b/reference/stdfloat/float128_t.md @@ -175,6 +175,7 @@ int main() { - [`std::float64_t`](float64_t.md) - [`std::bfloat16_t`](bfloat16_t.md) - [`std::numeric_limits::is_iec559`](/reference/limits/numeric_limits/is_iec559.md) +- [`std::basic_ostream::operator<<`](/reference/ostream/basic_ostream/op_ostream.md) ## 参照 diff --git a/reference/stdfloat/float16_t.md b/reference/stdfloat/float16_t.md index 38896bf409..8ddfe47e5f 100644 --- a/reference/stdfloat/float16_t.md +++ b/reference/stdfloat/float16_t.md @@ -175,6 +175,7 @@ int main() { - [`std::float128_t`](float128_t.md) - [`std::bfloat16_t`](bfloat16_t.md) - [`std::numeric_limits::is_iec559`](/reference/limits/numeric_limits/is_iec559.md) +- [`std::basic_ostream::operator<<`](/reference/ostream/basic_ostream/op_ostream.md) ## 参照 diff --git a/reference/stdfloat/float32_t.md b/reference/stdfloat/float32_t.md index de37aa6a84..18870b67fb 100644 --- a/reference/stdfloat/float32_t.md +++ b/reference/stdfloat/float32_t.md @@ -175,6 +175,7 @@ int main() { - [`std::float128_t`](float128_t.md) - [`std::bfloat16_t`](bfloat16_t.md) - [`std::numeric_limits::is_iec559`](/reference/limits/numeric_limits/is_iec559.md) +- [`std::basic_ostream::operator<<`](/reference/ostream/basic_ostream/op_ostream.md) ## 参照 diff --git a/reference/stdfloat/float64_t.md b/reference/stdfloat/float64_t.md index e696fd9c88..186c998a3e 100644 --- a/reference/stdfloat/float64_t.md +++ b/reference/stdfloat/float64_t.md @@ -175,6 +175,7 @@ int main() { - [`std::float128_t`](float128_t.md) - [`std::bfloat16_t`](bfloat16_t.md) - [`std::numeric_limits::is_iec559`](/reference/limits/numeric_limits/is_iec559.md) +- [`std::basic_ostream::operator<<`](/reference/ostream/basic_ostream/op_ostream.md) ## 参照 From 7137aae806b98ff357fea841b251e65c653255c5 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 1 Mar 2023 16:05:29 +0900 Subject: [PATCH 0217/3948] =?UTF-8?q?errc=20:=20LWG=20Issue=203869?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/system_error/errc.md | 163 +++++++++++++++++---------------- 1 file changed, 82 insertions(+), 81 deletions(-) diff --git a/reference/system_error/errc.md b/reference/system_error/errc.md index 06e5ed33b7..baf735a3de 100644 --- a/reference/system_error/errc.md +++ b/reference/system_error/errc.md @@ -15,88 +15,89 @@ namespace std { この値は、[`error_code`](error_code.md)/[`error_condition`](error_condition.md)に設定する[`generic_category()`](generic_category.md)カテゴリのエラー値として使用される。 -| 列挙値 | 値 | 説明 | -|--------------------------------------|-------------------|------------------------------------------| -| `address_family_not_supported` | `EAFNOSUPPORT` | アドレスファミリーがサポートされていない | -| `address_in_use` | `EADDRINUSE` | アドレスがすでに使用されている | -| `address_not_available` | `EADDRNOTAVAIL` | アドレスが使用できない | -| `already_connected` | `EISCONN` | ソケットが接続されている | -| `argument_list_too_long` | `E2BIG` | 引数リストが長すぎる | -| `argument_out_of_domain` | `EDOM` | 引数が領域外 | -| `bad_address` | `EFAULT` | アドレスが不正 | -| `bad_file_descriptor` | `EBADF` | ファイルディスクリプタが不正 | -| `bad_message` | `EBADMSG` | メッセージが不正 | -| `broken_pipe` | `EPIPE` | パイプが壊れている | -| `connection_aborted` | `ECONNABORTED` | 接続が中止された | -| `connection_already_in_progress` | `EALREADY` | 接続がすでに処理中 | -| `connection_refused` | `ECONNREFUSED` | 接続が拒否された | -| `connection_reset` | `ECONNRESET` | 接続がリセットされた | -| `cross_device_link` | `EXDEV` | 不適切なリンク | -| `destination_address_required` | `EDESTADDRREQ` | 宛先アドレスが必要 | -| `device_or_resource_busy` | `EBUSY` | リソースが使用中 | -| `directory_not_empty` | `ENOTEMPTY` | ディレクトリが空ではない | -| `executable_format_error` | `ENOEXEC` | 実行ファイル形式のエラー | -| `file_exists` | `EEXIST` | ファイルが存在する | -| `file_too_large` | `EFBIG` | ファイルが大きすぎる | -| `filename_too_long` | `ENAMETOOLONG` | ファイル名が長すぎる | -| `function_not_supported` | `ENOSYS` | 関数がサポートされていない(実装されていない) | -| `host_unreachable` | `EHOSTUNREACH` | ホストに到達不能 | -| `identifier_removed` | `EIDRM` | 識別子が削除された | -| `illegal_byte_sequence` | `EILSEQ` | 不正なバイト列 | -| `inappropriate_io_control_operation` | `ENOTTY` | I/O制御操作が不適切 | -| `interrupted` | `EINTR` | 関数呼び出しが割り込まれた | -| `invalid_argument` | `EINVAL` | 引数が無効 | -| `invalid_seek` | `ESPIPE` | 無効なシーク | -| `io_error` | `EIO` | I/Oエラー | -| `is_a_directory` | `EISDIR` | ディレクトリである | -| `message_size` | `EMSGSIZE` | メッセージが長すぎる | -| `network_down` | `ENETDOWN` | ネットワークが不通 | -| `network_reset` | `ENETRESET` | 接続がネットワーク側から中止された | -| `network_unreachable` | `ENETUNREACH` | ネットワークが到達不能である | -| `no_buffer_space` | `ENOBUFS` | 使用可能なバッファ空間がない | -| `no_child_process` | `ECHILD` | 子プロセスがない | -| `no_link` | `ENOLINK` | リンクが切れている | -| `no_lock_available` | `ENOLCK` | 利用できるロックがない | -| `no_message_available` | `ENODATA` | ストリームの読み出しキューの先頭に読み出し可能なメッセージがない | -| `no_message` | `ENOMSG` | 要求された型のメッセージがない | -| `no_protocol_option` | `ENOPROTOOPT` | 指定されたプロトコルが利用できない | -| `no_space_on_device` | `ENOSPC` | デバイスに空き領域がない | -| `no_stream_resources` | `ENOSR` | 指定されたストリームリソースがない | -| `no_such_device_or_address` | `ENXIO` | そのようなデバイスやアドレスはない | -| `no_such_device` | `ENODEV` | そのようなデバイスはない | -| `no_such_file_or_directory` | `ENOENT` | そのようなファイルやディレクトリはない | -| `no_such_process` | `ESRCH` | そのようなプロセスはない | -| `not_a_directory` | `ENOTDIR` | ディレクトリではない | -| `not_a_socket` | `ENOTSOCK` | ソケットではない | -| `not_a_stream` | `ENOSTR` | ストリームではない | -| `not_connected` | `ENOTCONN` | ソケットが接続されていない | -| `not_enough_memory` | `ENOMEM` | メモリ領域に十分な空きがない | -| `not_supported` | `ENOTSUP` | 操作がサポートされていない | -| `operation_canceled` | `ECANCELED` | 操作がキャンセルされた | -| `operation_in_progress` | `EINPROGRESS` | 操作が実行中である | -| `operation_not_permitted` | `EPERM` | 操作が許可されていない | -| `operation_not_supported` | `EOPNOTSUPP` | ソケットでサポートされていない操作 | -| `operation_would_block` | `EWOULDBLOCK` | 操作がブロッキングされる見込み | -| `owner_dead` | `EOWNERDEAD` | ミューテックスを所有している間に終了した | -| `permission_denied` | `EACCES` | 許可されていない | -| `protocol_error` | `EPROTO` | プロトコルエラー | -| `protocol_not_supported` | `EPROTONOSUPPORT` | プロトコルがサポートされていない | -| `read_only_file_system` | `EROFS` | ファイルシステムが読み取り専用 | -| `resource_deadlock_would_occur` | `EDEADLK` | リソースのデッドロックを回避した | -| `resource_unavailable_try_again` | `EAGAIN` | リソースが一時的に利用不可 | -| `result_out_of_range` | `ERANGE` | 結果が大きすぎる | -| `state_not_recoverable` | `ENOTRECOVERABLE` | ロックが回復不能 | -| `stream_timeout` | `ETIME` | タイムアウト | -| `text_file_busy` | `ETXTBSY` | テキストファイルが使用中 | -| `timed_out` | `ETIMEDOUT` | 操作がタイムアウト | -| `too_many_files_open_in_system` | `ENFILE` | システム全体で開いているファイルが多すぎる | -| `too_many_files_open` | `EMFILE` | 開いているファイルが多すぎる | -| `too_many_links` | `EMLINK` | リンクが多すぎる | -| `too_many_symbolic_link_levels` | `ELOOP` | シンボリックリンクが多すぎる | -| `value_too_large` | `EOVERFLOW` | データ型に対して値が大きすぎる | -| `wrong_protocol_type` | `EPROTOTYPE` | ソケットに指定できないプロトコルタイプ | +| 列挙値 | 値 | 説明 |非推奨| +|--------------------------------------|-------------------|------------------------------------------|---| +| `address_family_not_supported` | `EAFNOSUPPORT` | アドレスファミリーがサポートされていない || +| `address_in_use` | `EADDRINUSE` | アドレスがすでに使用されている || +| `address_not_available` | `EADDRNOTAVAIL` | アドレスが使用できない || +| `already_connected` | `EISCONN` | ソケットが接続されている || +| `argument_list_too_long` | `E2BIG` | 引数リストが長すぎる || +| `argument_out_of_domain` | `EDOM` | 引数が領域外 || +| `bad_address` | `EFAULT` | アドレスが不正 || +| `bad_file_descriptor` | `EBADF` | ファイルディスクリプタが不正 || +| `bad_message` | `EBADMSG` | メッセージが不正 || +| `broken_pipe` | `EPIPE` | パイプが壊れている || +| `connection_aborted` | `ECONNABORTED` | 接続が中止された || +| `connection_already_in_progress` | `EALREADY` | 接続がすでに処理中 || +| `connection_refused` | `ECONNREFUSED` | 接続が拒否された || +| `connection_reset` | `ECONNRESET` | 接続がリセットされた || +| `cross_device_link` | `EXDEV` | 不適切なリンク || +| `destination_address_required` | `EDESTADDRREQ` | 宛先アドレスが必要 || +| `device_or_resource_busy` | `EBUSY` | リソースが使用中 || +| `directory_not_empty` | `ENOTEMPTY` | ディレクトリが空ではない || +| `executable_format_error` | `ENOEXEC` | 実行ファイル形式のエラー || +| `file_exists` | `EEXIST` | ファイルが存在する || +| `file_too_large` | `EFBIG` | ファイルが大きすぎる || +| `filename_too_long` | `ENAMETOOLONG` | ファイル名が長すぎる || +| `function_not_supported` | `ENOSYS` | 関数がサポートされていない(実装されていない) || +| `host_unreachable` | `EHOSTUNREACH` | ホストに到達不能 || +| `identifier_removed` | `EIDRM` | 識別子が削除された || +| `illegal_byte_sequence` | `EILSEQ` | 不正なバイト列 || +| `inappropriate_io_control_operation` | `ENOTTY` | I/O制御操作が不適切 || +| `interrupted` | `EINTR` | 関数呼び出しが割り込まれた || +| `invalid_argument` | `EINVAL` | 引数が無効 || +| `invalid_seek` | `ESPIPE` | 無効なシーク || +| `io_error` | `EIO` | I/Oエラー || +| `is_a_directory` | `EISDIR` | ディレクトリである || +| `message_size` | `EMSGSIZE` | メッセージが長すぎる || +| `network_down` | `ENETDOWN` | ネットワークが不通 || +| `network_reset` | `ENETRESET` | 接続がネットワーク側から中止された || +| `network_unreachable` | `ENETUNREACH` | ネットワークが到達不能である || +| `no_buffer_space` | `ENOBUFS` | 使用可能なバッファ空間がない || +| `no_child_process` | `ECHILD` | 子プロセスがない || +| `no_link` | `ENOLINK` | リンクが切れている || +| `no_lock_available` | `ENOLCK` | 利用できるロックがない || +| `no_message_available` | `ENODATA` | ストリームの読み出しキューの先頭に読み出し可能なメッセージがない |C++23で非推奨| +| `no_message` | `ENOMSG` | 要求された型のメッセージがない || +| `no_protocol_option` | `ENOPROTOOPT` | 指定されたプロトコルが利用できない || +| `no_space_on_device` | `ENOSPC` | デバイスに空き領域がない || +| `no_stream_resources` | `ENOSR` | 指定されたストリームリソースがない |C++23で非推奨| +| `no_such_device_or_address` | `ENXIO` | そのようなデバイスやアドレスはない || +| `no_such_device` | `ENODEV` | そのようなデバイスはない || +| `no_such_file_or_directory` | `ENOENT` | そのようなファイルやディレクトリはない || +| `no_such_process` | `ESRCH` | そのようなプロセスはない || +| `not_a_directory` | `ENOTDIR` | ディレクトリではない || +| `not_a_socket` | `ENOTSOCK` | ソケットではない || +| `not_a_stream` | `ENOSTR` | ストリームではない |C++23で非推奨| +| `not_connected` | `ENOTCONN` | ソケットが接続されていない || +| `not_enough_memory` | `ENOMEM` | メモリ領域に十分な空きがない || +| `not_supported` | `ENOTSUP` | 操作がサポートされていない || +| `operation_canceled` | `ECANCELED` | 操作がキャンセルされた || +| `operation_in_progress` | `EINPROGRESS` | 操作が実行中である || +| `operation_not_permitted` | `EPERM` | 操作が許可されていない || +| `operation_not_supported` | `EOPNOTSUPP` | ソケットでサポートされていない操作 || +| `operation_would_block` | `EWOULDBLOCK` | 操作がブロッキングされる見込み || +| `owner_dead` | `EOWNERDEAD` | ミューテックスを所有している間に終了した || +| `permission_denied` | `EACCES` | 許可されていない || +| `protocol_error` | `EPROTO` | プロトコルエラー || +| `protocol_not_supported` | `EPROTONOSUPPORT` | プロトコルがサポートされていない || +| `read_only_file_system` | `EROFS` | ファイルシステムが読み取り専用 || +| `resource_deadlock_would_occur` | `EDEADLK` | リソースのデッドロックを回避した || +| `resource_unavailable_try_again` | `EAGAIN` | リソースが一時的に利用不可 || +| `result_out_of_range` | `ERANGE` | 結果が大きすぎる || +| `state_not_recoverable` | `ENOTRECOVERABLE` | ロックが回復不能 || +| `stream_timeout` | `ETIME` | タイムアウト |C++23で非推奨| +| `text_file_busy` | `ETXTBSY` | テキストファイルが使用中 || +| `timed_out` | `ETIMEDOUT` | 操作がタイムアウト || +| `too_many_files_open_in_system` | `ENFILE` | システム全体で開いているファイルが多すぎる || +| `too_many_files_open` | `EMFILE` | 開いているファイルが多すぎる || +| `too_many_links` | `EMLINK` | リンクが多すぎる || +| `too_many_symbolic_link_levels` | `ELOOP` | シンボリックリンクが多すぎる || +| `value_too_large` | `EOVERFLOW` | データ型に対して値が大きすぎる || +| `wrong_protocol_type` | `EPROTOTYPE` | ソケットに指定できないプロトコルタイプ || +非推奨とされているものは、対応する`errno`値がPOSIX規格において廃止されたことに対応している。 ## 参照 - [Man page of ERRNO](http://linuxjm.osdn.jp/html/LDP_man-pages/man3/errno.3.html) - +- [LWG Issue 3869. Deprecate `std::errc` constants related to UNIX STREAMS](https://cplusplus.github.io/LWG/issue3869) From b986d8c2578971123909748683f72e599ac081ac Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 1 Mar 2023 16:48:24 +0900 Subject: [PATCH 0218/3948] =?UTF-8?q?basic=5Fistream::operator>>=20:=20C++?= =?UTF-8?q?23=E5=AF=BE=E5=BF=9C=E3=81=A8=E3=81=97=E3=81=A6=E6=8B=A1?= =?UTF-8?q?=E5=BC=B5=E6=B5=AE=E5=8B=95=E5=B0=8F=E6=95=B0=E7=82=B9=E6=95=B0?= =?UTF-8?q?=E5=9E=8B=E3=82=92=E3=82=B5=E3=83=9D=E3=83=BC=E3=83=88=20#1022?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/istream/basic_istream/op_istream.md | 79 +++++++++++-------- reference/stdfloat/bfloat16_t.md | 1 + reference/stdfloat/float128_t.md | 1 + reference/stdfloat/float16_t.md | 1 + reference/stdfloat/float32_t.md | 1 + reference/stdfloat/float64_t.md | 1 + 6 files changed, 51 insertions(+), 33 deletions(-) diff --git a/reference/istream/basic_istream/op_istream.md b/reference/istream/basic_istream/op_istream.md index 5b71af1094..e2e9b6dd0b 100644 --- a/reference/istream/basic_istream/op_istream.md +++ b/reference/istream/basic_istream/op_istream.md @@ -7,61 +7,73 @@ ```cpp // マニピュレータ // 3つとも関数へのポインタを引数に取る。 -basic_istream& operator>>(basic_istream& (*pf)(basic_istream&)); -basic_istream& operator>>(basic_ios& (*pf)(basic_ios&)); -basic_istream& operator>>(ios_base& (*pf)(ios_base&)); +basic_istream& + operator>>(basic_istream& (*pf)(basic_istream&)); // (1) C++03 +basic_istream& + operator>>(basic_ios& (*pf)(basic_ios&)); // (2) C++03 +basic_istream& + operator>>(ios_base& (*pf)(ios_base&)); // (3) C++03 // bool値・数値・ポインタ -basic_istream& operator>>(bool& n); -basic_istream& operator>>(short& n); -basic_istream& operator>>(unsigned short& n); -basic_istream& operator>>(int& n); -basic_istream& operator>>(unsigned int& n); -basic_istream& operator>>(long& n); -basic_istream& operator>>(unsigned long& n); -basic_istream& operator>>(long long& n); // C++11 -basic_istream& operator>>(unsigned long long& n); // C++11 -basic_istream& operator>>(float& f); -basic_istream& operator>>(double& f); -basic_istream& operator>>(long double& f); -basic_istream& operator>>(void*& p); +basic_istream& operator>>(bool& n); // (4) C++03 +basic_istream& operator>>(short& n); // (5) C++03 +basic_istream& operator>>(unsigned short& n); // (6) C++03 +basic_istream& operator>>(int& n); // (7) C++03 +basic_istream& operator>>(unsigned int& n); // (8) C++03 +basic_istream& operator>>(long& n); // (9) C++03 +basic_istream& operator>>(unsigned long& n); // (10) C++03 +basic_istream& operator>>(long long& n); // (11) C++11 +basic_istream& operator>>(unsigned long long& n); // (12) C++11 +basic_istream& operator>>(float& f); // (13) C++03 +basic_istream& operator>>(double& f); // (14) C++03 +basic_istream& operator>>(long double& f); // (15) C++03 +basic_istream& + operator>>(extended-floating-point-type& f); // (16) C++23 +basic_istream& operator>>(void*& p); // (17) C++03 // ストリームバッファ -basic_istream& operator>>(basic_streambuf* sb); +basic_istream& + operator>>(basic_streambuf* sb); // (18) C++03 ``` ## 概要 ストリームからの入力またはマニピュレータの実行を行う。 -- マニピュレータを実行するオーバーロードそれ自体は、書式化入力関数・非書式化入力関数いずれにも該当しない。 +- (1)-(3) : マニピュレータを実行するオーバーロードそれ自体は、書式化入力関数・非書式化入力関数いずれにも該当しない。 - マニピュレータが書式化入力関数・非書式化入力関数であるということはあり得る(例: [`ws`](../ws.md))。 -- 数値型(`bool`も含む)と`void*`に対するオーバーロードは、書式化入力関数である。 -- `basic_streambuf`に対するオーバーロードは、非書式化入力関数である。 +- (4)-(17) : 数値型(`bool`も含む)と`void*`に対するオーバーロードは、書式化入力関数である。 +- (18) : `basic_streambuf`に対するオーバーロードは、非書式化入力関数である。 ## 効果 -### マニピュレータ +### (1)-(3) : マニピュレータ 1. `pf(*this)`を呼び出す。 -### bool値・数値・ポインタ +### (4)-(17) : bool値・数値・ポインタ -1. `sentry`オブジェクトを構築する。`sentry`オブジェクトが失敗を示した場合、何もしない。 +1. `sentry`オブジェクトを構築する。`sentry`オブジェクトが失敗を示した場合、何もしない 1. `num_get::get`を使用して入力のパース・数値への変換を行う。 - - ただし、`int`と`short`の場合は、`long`を実引数に取るものを使用する。結果が`int`と`short`それぞれの範囲外の値になった場合、`failbit`を追加する。 -1. `num_get::get`から得られた`iostate`値を実引数にして`setstate`関数を呼び出す。 + - `int`と`short` : `long`を実引数に取るものを使用する。結果が`int`と`short`それぞれの範囲外の値になった場合、`failbit`を追加する + - 拡張浮動小数点数型 : + - 拡張浮動小数点数型の変換順位が`long double`より大きい場合、条件付きサポートとなる + - そうでない場合、対応する標準浮動小数点数型`FP`を以下のように定義し、`FP`型の値として値を入力したあと、拡張浮動小数点数型にキャストして代入する + - 拡張浮動小数点数型の変換順位が`float`以下の場合、`FP`を`float`とする + - そうでなく、拡張浮動小数点数型の変換順位が`double`以下の場合、`FP`を`double`とする + - そうでない場合、`FP`を`long double`とする +1. `num_get::get`から得られた`iostate`値を実引数にして`setstate`関数を呼び出す -### ストリームバッファ +### (18) : ストリームバッファ ストリームからの入力を別のストリームバッファに出力する。 -1. 仮引数`sb`がヌルポインタの場合、`setstate(failbit)`を呼び出して終了する。 -1. `sentry`オブジェクトを構築する。`sentry`オブジェクトが失敗を示した場合、何もしない。 -1. 以下のいずれかを満たすまで、`this`内のストリームバッファから文字を入力して`sb`へ出力する。 - - EOFに達した。 - - 出力処理に失敗した(この場合、失敗したときの文字は入力側のストリームバッファに戻される)。 - - 例外が発生した。 +1. 仮引数`sb`がヌルポインタの場合、`setstate(failbit)`を呼び出して終了する +1. `sentry`オブジェクトを構築する。`sentry`オブジェクトが失敗を示した場合、何もしない +1. 以下のいずれかを満たすまで、`this`内のストリームバッファから文字を入力して`sb`へ出力する + - EOFに達した + - 出力処理に失敗した(この場合、失敗したときの文字は入力側のストリームバッファに戻される) + - 例外が発生した 入力がなされなかった場合、`setstate(failbit)`を呼び出す。 @@ -113,4 +125,5 @@ TBD ## 参照 - [N2114 `long long` Goes to the Library, Revision 1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2114.html) - +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で拡張浮動小数点数型の`istream`入力がサポートされた diff --git a/reference/stdfloat/bfloat16_t.md b/reference/stdfloat/bfloat16_t.md index 8e748b72de..95fec2634a 100644 --- a/reference/stdfloat/bfloat16_t.md +++ b/reference/stdfloat/bfloat16_t.md @@ -177,6 +177,7 @@ int main() { - [`std::float64_t`](float64_t.md) - [`std::float128_t`](float128_t.md) - [`std::basic_ostream::operator<<`](/reference/ostream/basic_ostream/op_ostream.md) +- [`std::basic_istream::operator>>`](/reference/istream/basic_istream/op_istream.md) ## 参照 diff --git a/reference/stdfloat/float128_t.md b/reference/stdfloat/float128_t.md index f27a31bcec..2ce8adee12 100644 --- a/reference/stdfloat/float128_t.md +++ b/reference/stdfloat/float128_t.md @@ -176,6 +176,7 @@ int main() { - [`std::bfloat16_t`](bfloat16_t.md) - [`std::numeric_limits::is_iec559`](/reference/limits/numeric_limits/is_iec559.md) - [`std::basic_ostream::operator<<`](/reference/ostream/basic_ostream/op_ostream.md) +- [`std::basic_istream::operator>>`](/reference/istream/basic_istream/op_istream.md) ## 参照 diff --git a/reference/stdfloat/float16_t.md b/reference/stdfloat/float16_t.md index 8ddfe47e5f..ed7cacc630 100644 --- a/reference/stdfloat/float16_t.md +++ b/reference/stdfloat/float16_t.md @@ -176,6 +176,7 @@ int main() { - [`std::bfloat16_t`](bfloat16_t.md) - [`std::numeric_limits::is_iec559`](/reference/limits/numeric_limits/is_iec559.md) - [`std::basic_ostream::operator<<`](/reference/ostream/basic_ostream/op_ostream.md) +- [`std::basic_istream::operator>>`](/reference/istream/basic_istream/op_istream.md) ## 参照 diff --git a/reference/stdfloat/float32_t.md b/reference/stdfloat/float32_t.md index 18870b67fb..f562c5c8fa 100644 --- a/reference/stdfloat/float32_t.md +++ b/reference/stdfloat/float32_t.md @@ -176,6 +176,7 @@ int main() { - [`std::bfloat16_t`](bfloat16_t.md) - [`std::numeric_limits::is_iec559`](/reference/limits/numeric_limits/is_iec559.md) - [`std::basic_ostream::operator<<`](/reference/ostream/basic_ostream/op_ostream.md) +- [`std::basic_istream::operator>>`](/reference/istream/basic_istream/op_istream.md) ## 参照 diff --git a/reference/stdfloat/float64_t.md b/reference/stdfloat/float64_t.md index 186c998a3e..4bfe085ee0 100644 --- a/reference/stdfloat/float64_t.md +++ b/reference/stdfloat/float64_t.md @@ -176,6 +176,7 @@ int main() { - [`std::bfloat16_t`](bfloat16_t.md) - [`std::numeric_limits::is_iec559`](/reference/limits/numeric_limits/is_iec559.md) - [`std::basic_ostream::operator<<`](/reference/ostream/basic_ostream/op_ostream.md) +- [`std::basic_istream::operator>>`](/reference/istream/basic_istream/op_istream.md) ## 参照 From 24071c41d16fb31699da953fada78eadf9769d12 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 1 Mar 2023 16:52:16 +0900 Subject: [PATCH 0219/3948] =?UTF-8?q?=E7=94=A8=E8=AA=9E=E5=AE=9A=E7=BE=A9?= =?UTF-8?q?=20:=20=E6=8B=A1=E5=BC=B5=E6=B5=AE=E5=8B=95=E5=B0=8F=E6=95=B0?= =?UTF-8?q?=E7=82=B9=E6=95=B0=E5=9E=8B=E3=81=A8=E6=A8=99=E6=BA=96=E6=B5=AE?= =?UTF-8?q?=E5=8B=95=E5=B0=8F=E6=95=B0=E7=82=B9=E6=95=B0=E5=9E=8B=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20#1022?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit いろいろなところで使われそうな用語なので --- GLOBAL_DEFINED_WORDS.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/GLOBAL_DEFINED_WORDS.json b/GLOBAL_DEFINED_WORDS.json index b3aaadbb78..0616e27d83 100644 --- a/GLOBAL_DEFINED_WORDS.json +++ b/GLOBAL_DEFINED_WORDS.json @@ -72,5 +72,12 @@ }, "イテレータ範囲": { "desc": "2つのイテレータで表現される半開区間を表す。C++20からイテレータと番兵で異なる型であっても指定可能になる" + }, + "拡張浮動小数点数型": { + "desc": "で定義される内部表現の規定された浮動小数点数型", + "link": "/reference/stdfloat.md" + }, + "標準浮動小数点数型": { + "desc": "拡張浮動小数点数型の対義語としてfloat / double / long doubleを指す用語" } } From cde470d65c8f4cf33adf6a28b5d621b851d42ed0 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Thu, 2 Mar 2023 15:14:41 +0900 Subject: [PATCH 0220/3948] =?UTF-8?q?string=5Fview=E3=82=B3=E3=83=B3?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=83=A9=E3=82=AF=E3=82=BF=20:=20P2499R0?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basic_string_view/op_constructor.md | 29 +++++++++++++++---- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/reference/string_view/basic_string_view/op_constructor.md b/reference/string_view/basic_string_view/op_constructor.md index 3de2a3a375..796e21aa20 100644 --- a/reference/string_view/basic_string_view/op_constructor.md +++ b/reference/string_view/basic_string_view/op_constructor.md @@ -7,10 +7,12 @@ ```cpp constexpr basic_string_view() noexcept; // (1) + constexpr basic_string_view( const basic_string_view&) noexcept = default; // (2) constexpr basic_string_view(const CharT* str); // (3) + basic_string_view(nullptr_t) = delete; // (4) C++23 constexpr basic_string_view(const CharT* str, size_type len); // (5) @@ -19,7 +21,7 @@ template constexpr basic_string_view(It begin, End end); // (6) C++20 template -constexpr basic_string_view(R&& r); // (7) C++23 +explicit constexpr basic_string_view(R&& r); // (7) C++23 ``` ## 概要 @@ -90,6 +92,7 @@ string_view str(buf); #include #include #include +#include int main() { @@ -117,20 +120,32 @@ int main() std::cout << "(3) : " << sv << std::endl; } - // (4) + // (5) // 文字配列と文字数を受けとって部分文字列を参照するコンストラクタ { // "Hello World"の先頭5文字"Hello"を参照 std::string_view sv{"Hello World", 5}; - std::cout << "(4) : " << sv << std::endl; + std::cout << "(5) : " << sv << std::endl; } - // (5) + // (6) // 文字のイテレータ範囲を受け取って参照するコンストラクタ { std::string s = "Hello World"; std::string_view sv{s.begin(), s.begin() + 5}; - std::cout << "(5) : " << sv << std::endl; + std::cout << "(6) : " << sv << std::endl; + } + + // (7) + // contiguous_rangeからの構築 + { + std::vector vec = {'H', 'e', 'l', 'l', 'o', '\0', '!'}; + // 参照するのは入力範囲先頭からそのサイズ(`std::ranges::size()`)分 + std::string_view sv{vec}; + std::cout << "(7) : " << sv << std::endl; + + // explicitのため、このような初期化や暗黙変換は無効 + //std::string_view sv = {vec}; } } ``` @@ -142,8 +157,9 @@ int main() ``` (2) : Hello World (3) : Hello World -(4) : Hello (5) : Hello +(6) : Hello +(7) : Hello! ``` ## バージョン @@ -164,3 +180,4 @@ int main() - C++23での、`nullptr_t`をとるコンストラクタのdelete宣言追加 - [P1989R2 Range constructor for `std::string_view` 2: Constrain Harder](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1989r2.pdf) - C++23での、レンジ版コンストラクタ追加 +- [P2499R0 `string_view` range constructor should be `explicit`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2499r0.html) From 0216351917fda4cb7f2cf6ddec4ad04e9a962c77 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Thu, 2 Mar 2023 15:23:35 +0900 Subject: [PATCH 0221/3948] =?UTF-8?q?string=5Fview=E3=82=B3=E3=83=B3?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=83=A9=E3=82=AF=E3=82=BF=20:=20=E5=BE=AE?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/string_view/basic_string_view/op_constructor.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/string_view/basic_string_view/op_constructor.md b/reference/string_view/basic_string_view/op_constructor.md index 796e21aa20..1fe1452653 100644 --- a/reference/string_view/basic_string_view/op_constructor.md +++ b/reference/string_view/basic_string_view/op_constructor.md @@ -21,7 +21,7 @@ template constexpr basic_string_view(It begin, End end); // (6) C++20 template -explicit constexpr basic_string_view(R&& r); // (7) C++23 +constexpr explicit basic_string_view(R&& r); // (7) C++23 ``` ## 概要 From 828ff5889a64f24eec0a5c14efcdb4b4abe0cdc7 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 2 Mar 2023 18:59:22 +0900 Subject: [PATCH 0222/3948] =?UTF-8?q?atomic,=20atomic=5Fref=20:=20C++23=20?= =?UTF-8?q?=E6=8B=A1=E5=BC=B5=E6=B5=AE=E5=8B=95=E5=B0=8F=E6=95=B0=E7=82=B9?= =?UTF-8?q?=E6=95=B0=E5=9E=8B=E3=81=AB=E5=AF=BE=E5=BF=9C=20#1022?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/atomic/atomic.md | 18 ++++++++++++++---- reference/atomic/atomic_ref.md | 16 ++++++++++++---- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/reference/atomic/atomic.md b/reference/atomic/atomic.md index c9909623d2..1f0424e7dd 100644 --- a/reference/atomic/atomic.md +++ b/reference/atomic/atomic.md @@ -6,11 +6,11 @@ ```cpp namespace std { - template struct atomic; + template struct atomic; // (1) C++11 - template<> struct atomic; - template<> struct atomic; // C++20 - template struct atomic; + template<> struct atomic; // (2) C++11 + template<> struct atomic; // (3) C++20 + template struct atomic; // (4) C++11 } ``` * integral[italic] @@ -19,6 +19,14 @@ namespace std { ## 概要 `atomic`クラステンプレートは、型`T`をアトミック操作するためのクラステンプレートである。組み込み型に対する特殊化が提供されており、それぞれに特化した演算が用意されている。 +- (1) : プライマリテンプレート。宣言のみ +- (2) : 整数型に対する特殊化 +- (3) : (CV修飾されていない) 浮動小数点数型に対する特殊化 + - (C++23) : 拡張浮動小数点数型を含む +- (4) : 任意の型のポインタに対する特殊化 + +これらのほか、[``](/reference/memory.md)ヘッダで[`std::shared_ptr`と`std::weak_ptr`に対する`atomic`クラスの特殊化](/reference/memory/atomic.md)が定義される。 + ## テンプレートパラメータ制約 - 型`T`は[コピー構築可能](/reference/concepts/copy_constructible.md)かつ[コピー代入可能](/reference/type_traits/is_copy_assignable.md)であること @@ -304,3 +312,5 @@ int main() - [Correctly implementing a spinlock in C++](https://rigtorp.se/spinlock/) - [P1135R6 The C++20 Synchronization Library](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1135r6.html) - C++20での`atomic_signed_lock_free`と`atomic_unsigned_lock_free`の追加 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で拡張浮動小数点数型もテンプレート引数として指定することが許可された diff --git a/reference/atomic/atomic_ref.md b/reference/atomic/atomic_ref.md index c9359034f9..2af2f3bd40 100644 --- a/reference/atomic/atomic_ref.md +++ b/reference/atomic/atomic_ref.md @@ -6,11 +6,11 @@ ```cpp namespace std { - template struct atomic_ref; + template struct atomic_ref; // (1) C++20 - template<> struct atomic_ref; - template<> struct atomic_ref; - template struct atomic_ref; + template<> struct atomic_ref; // (2) C++20 + template<> struct atomic_ref; // (3) C++20 + template struct atomic_ref; // (4) C++20 } ``` * integral[italic] @@ -27,6 +27,12 @@ namespace std { `atomic_ref`クラステンプレートは型`T`の値をコピーではなく参照で保持するため、`atomic_ref`オブジェクトより先に参照先の変数の寿命が尽きてはならない。 +- (1) : プライマリテンプレート。宣言のみ +- (2) : 整数型に対する特殊化 +- (3) : (CV修飾されていない) 浮動小数点数型に対する特殊化 + - (C++23) : 拡張浮動小数点数型を含む +- (4) : 任意の型のポインタに対する特殊化 + ## テンプレートパラメータ制約 - 型`T`は[`is_trivially_copyable_v`](/reference/type_traits/is_trivially_copyable.md)` == true`であること @@ -185,3 +191,5 @@ int main() ### 参照 - [P0019R8 Atomic Ref](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0019r8.html) +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で拡張浮動小数点数型もテンプレート引数として指定することが許可された From d63dd85d2a3389d8b9f95829778f041b49eba2e1 Mon Sep 17 00:00:00 2001 From: Akiko Kawai Date: Fri, 3 Mar 2023 13:37:15 +0900 Subject: [PATCH 0223/3948] =?UTF-8?q?VC=E3=81=AEC++23=E6=A9=9F=E8=83=BD?= =?UTF-8?q?=E3=81=8CMS=E5=85=AC=E5=BC=8F=E3=82=B5=E3=82=A4=E3=83=88?= =?UTF-8?q?=E3=81=AB=E8=BC=89=E3=81=A3=E3=81=9F=E3=81=AE=E3=81=A7=E3=83=AA?= =?UTF-8?q?=E3=83=B3=E3=82=AF=E3=82=92=E4=BF=AE=E6=AD=A3=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/implementation-status.md b/implementation-status.md index d82e42b523..641d50ecc5 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -286,7 +286,7 @@ - GCC: [C++23 Support in GCC](https://gcc.gnu.org/projects/cxx-status.html#cxx23) - Clang: [C++2b implementation status](https://clang.llvm.org/cxx_status.html#cxx23) - Visual C++ (MSVC): - - [C++23 - cppreference](https://en.cppreference.com/w/cpp/23) + - [Visual C++ 言語への準拠](https://docs.microsoft.com/ja-jp/cpp/visual-cpp-language-conformance) - [次リリース情報(VS2019,2022) - Change log](https://github.com/microsoft/STL/wiki/Changelog) - ICX: [C+23 Features Supported by Intel® C+ Compiler](https://www.intel.com/content/www/us/en/developer/articles/technical/c23-features-supported-by-intel-c-compiler.html) From e9d068b7c23c0d32bdd8ce872aac2b35a40d806a Mon Sep 17 00:00:00 2001 From: Akiko Kawai Date: Fri, 3 Mar 2023 13:43:22 +0900 Subject: [PATCH 0224/3948] Updated Implimentation status for VC++ C++23 --- implementation-status.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/implementation-status.md b/implementation-status.md index 641d50ecc5..f7dbf79a90 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -255,7 +255,7 @@ | P2718R0: [範囲for文が範囲への参照を延命することを規定](lang/cpp23/lifetime_extension_in_range_based_for_loop.md.nolink) | | - | - | - | - | | P2324R2: [関数末尾のラベルを許可](/lang/cpp23/labels_at_the_end_of_compound_statements.md.nolink) | C互換のため、関数末尾でのgoto文のラベルを許可する | 13 | 16 | - | - | | P0847R7: [自身のオブジェクトを明示的にパラメータとして指定する](/lang/cpp23/deducing_this.md.nolink) | メンバ関数が`*this`の型・オブジェクトをパラメータとしてとり、`*this`オブジェクトがconst/非const、左辺値/右辺値であるかをメンバ関数内で識別できるようにする | - | - | - | 2022 Update 2 (partial) | -| P1847R4: [アクセス制御の異なるメンバ変数のレイアウトを宣言順に規定](/lang/cpp23/make_declaration_order_layout_mandated.md.nolink) | アクセス制御の異なるメンバ変数のレイアウトが実装によって異なっていたため仕様を規定 | Yes | Yes | - | Yes | +| P1847R4: [アクセス制御の異なるメンバ変数のレイアウトを宣言順に規定](/lang/cpp23/make_declaration_order_layout_mandated.md.nolink) | アクセス制御の異なるメンバ変数のレイアウトが実装によって異なっていたため仕様を規定 | Yes | Yes | - | 2022 | | P2128R6: [添字演算子の多次元サポート](/lang/cpp23/multidimensional_subscript_operator.nd.nolink) | `operator[](int x, int y, int z)`のように添字演算子のオーバーロードで複数のパラメータをとることを許可 | 12 | 15 | - | - | | P1169R4: [`this`ポインタをもつ必要のない演算子を`static`として宣言できるようにする](/lang/cpp23/static_operator.md.nolink) | | 13 | 16 | - | - | | P2201R1 : [異なる文字エンコーディングをもつ文字列リテラルの連結を不適格とする](/lang/cpp23/mixed_string_literal_concatenation.md.nolink) | `auto a = u8"" L"";`のような異なる文字エンコーディング同士での文字列リテラルを連結を禁止する | Yes | Yes | Yes | Yes | @@ -267,14 +267,14 @@ | P1938R3 : [`if consteval`](/lang/cpp23/if_consteval.md.nolink) | コンパイル時の文脈かどうかで分岐させる | 12 | 14 | - | - | | P1401R5 : [定数式の文脈での`bool`への縮小変換を許可](/lang/cpp23/narrowing_contextual_conversions_to_bool.md.nolink) | `if constexpr(flags & Flags::Exec)`や`static_assert(N);`を許可 | 9 | 13 | - | - | | P2242R3: [定数式内での非リテラル変数の使用を含められないようにする](/lang/cpp23/non_literal_variables_in_constexpr_functions.md.nolink) | 定数式内で静的変数・スレッドローカル変数およびgoto文とラベルを含められない制限を設ける | 12 | 15 | - | - | -| P2246R1: [静的な診断メッセージの文字エンコーディング](/lang/cpp23/character_encoding_of_diagnostic_text.md.nolink) | `static_assert`や`[[deprecated]]`などの診断メッセージの文字集合に関する要件をなくす | - | yes | - | - | +| P2246R1: [静的な診断メッセージの文字エンコーディング](/lang/cpp23/character_encoding_of_diagnostic_text.md.nolink) | `static_assert`や`[[deprecated]]`などの診断メッセージの文字集合に関する要件をなくす | - | yes | - | 2022 | | P2448R2: [`constexpr`関数のすべての引数が定数実行できない場合でも適格とする](/lang/cpp23/relaxing_some_constexpr_restrictions.md.nolink) | | 13 | - | - | - | | P2647R1: [`constexpr`関数内での`static constexpr`変数を許可](/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md.nolink) | | - | - | - | - | | P2564R3: [`constexpr`関数内で`consteval`関数を呼び出せない問題を緩和](/lang/cpp23/consteval_needs_to_propagate_up.md.nolink) | | - | - | - | - | | P1102R2: [ラムダ式で`()`を省略できる条件を緩和](/lang/cpp23/down_with_lambda_parens.md.nolink) | キャプチャや修飾をともなってもパラメータリストが空であれば`()`を省略できる | 11 | 13 | - | - | | P2173R1: [ラムダ式に対する属性](/lang/cpp23/attributes_on_lambda_expressions.md.nolink) | ラムダ式のいくつかの箇所に属性を記述できるようにする | 9 | 13 | - | - | | P1774R8: [コード内容の仮定をコンパイラに伝えるassume属性](/lang/cpp23/portable_assumptions.md) | 最適化のために、コードの仮定をコンパイラに伝える属性を標準化する | 13 | - | - | - | -| P2316R2: [文字リテラルエンコーディングを一貫させる](/lang/cpp23/consistent_character_literal_encoding.md.nolink) | プリプロセッサの条件式での文字リテラルの扱いをC++式と同様にする | yes | yes | - | - | +| P2316R2: [文字リテラルエンコーディングを一貫させる](/lang/cpp23/consistent_character_literal_encoding.md.nolink) | プリプロセッサの条件式での文字リテラルの扱いをC++式と同様にする | yes | yes | - | 2022 | | P2334R1: [`elif`/`elifdef`/`elifndef`のサポートを追加](/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md.nolink) | `#if`/`#ifdef`/`#ifndef`に対応する複数条件命令のサポートを追加する | 12 | 13 | - | - | | P2437R1: [`#warning`のサポートを追加](/lang/cpp23/warning.md.nolink) | 多くのC++コンパイラが実装していたプリプロセス時の警告`#warning message`を正式サポート | yes | yes | yes | yes | | P2295R6: [汎用的なソースコードのエンコーディングとしてUTF-8をサポート](/lang/cpp23/support_for_utf8_as_a_portable_source_file_encoding.md.nolink) | | 13 | 15 | - | 2019 Update 2 | From f5a4bdcc87ea89099b2112d27cb67ca68af26546 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 3 Mar 2023 19:21:37 +0900 Subject: [PATCH 0225/3948] =?UTF-8?q?complex=20:=20C++23=E3=81=AE=E6=8B=A1?= =?UTF-8?q?=E5=BC=B5=E6=B5=AE=E5=8B=95=E5=B0=8F=E6=95=B0=E7=82=B9=E6=95=B0?= =?UTF-8?q?=E5=9E=8B=E3=81=AB=E5=AF=BE=E5=BF=9C=20#1022?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/complex/complex.md | 9 +-- reference/complex/complex/arg.md | 19 +++++-- reference/complex/complex/conj.md | 14 +++-- reference/complex/complex/imag_free.md | 31 ++++++----- reference/complex/complex/norm.md | 14 +++-- reference/complex/complex/op_constructor.md | 61 +++++---------------- reference/complex/complex/pow.md | 44 +++++++++++---- reference/complex/complex/proj.md | 17 +++--- reference/complex/complex/real_free.md | 32 ++++++----- 9 files changed, 125 insertions(+), 116 deletions(-) diff --git a/reference/complex/complex.md b/reference/complex/complex.md index 036b851a8e..153a5c090e 100644 --- a/reference/complex/complex.md +++ b/reference/complex/complex.md @@ -15,11 +15,7 @@ namespace std { `complex`クラステンプレートは、複素数を表すクラスである。このクラスは、実部(real part)と虚部(imaginary part)を、それぞれ型`T`の値として保持し、演算に使用する。 -`complex`クラステンプレートは以下の型で特殊化され、特化した実装が行われる: - -- `float` -- `double` -- `long double` +`complex`クラステンプレートはCV修飾されていない浮動小数点数型 (C++23以降は拡張浮動小数点数型を含む) で特殊化され、特化した実装が行われる: これ以外の型がテンプレート引数として与えられた場合、その動作は未規定である。 @@ -190,4 +186,5 @@ polar : (-1.62921e-07,1) - [LWG Issue 387. `std::complex` over-encapsulated](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#387) - C++11で、`std::complex`型のメモリレイアウトが規定された経緯のレポート - [N1568 Proposed additions to TR-1 to improve compatibility with C99](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1568.htm) - +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で拡張浮動小数点数型に対応した diff --git a/reference/complex/complex/arg.md b/reference/complex/complex/arg.md index 9928a2e94d..b02461bf76 100644 --- a/reference/complex/complex/arg.md +++ b/reference/complex/complex/arg.md @@ -6,9 +6,9 @@ ```cpp namespace std { template - T arg(const complex& x); + T arg(const complex& x); // (1) C++03 - Promoted arg(Arithmetic x); // 追加のオーバーロード:C++11 から + complex arg(Arithmetic x); // (2) C++11 追加のオーバーロード } ``` * Promoted[italic] @@ -17,11 +17,13 @@ namespace std { ## 概要 複素数値の偏角を得る。arg は argument(偏角)の略。 -なお、C++11 で追加されたオーバーロードは、以下のように規定されている。 +- (1) : `complex`に対するオーバーロード +- (2) : 算術型に対する追加のオーバーロード -- 実引数の型が `long double` の場合、`complex` にキャストされているかのように振る舞う。 -- そうでなくて、実引数の型が `double` か整数型の場合、`complex` にキャストされているかのように振る舞う。 -- そうでなくて、実引数の型が `float` の場合、`complex` にキャストされているかのように振る舞う。 +(2)は、以下のように振る舞う: + +- 実引数の型が浮動小数点数型 `T` の場合、`complex` にキャストされているかのように振る舞う +- そうでなくて、実引数が整数型の場合、`complex` にキャストされているかのように振る舞う (C++23) また、これらの追加のオーバーロードが関数テンプレートなのか否か、あるいは、引数が参照型なのか否かなどについては、規格では何も言及されていない。 @@ -81,3 +83,8 @@ arg( (1,2) ) = 1.10715 | [`conj`](conj.md) | 共役複素数を得る。 | | [`proj`](proj.md) | リーマン球面への射影を得る。 | | [`polar`](polar.md) | 指定した絶対値と偏角の複素数値を得る。 | + + +## 参照 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で拡張浮動小数点数型への対応が行われ、整数型も考慮されるようになった diff --git a/reference/complex/complex/conj.md b/reference/complex/complex/conj.md index 0a96f4df6c..6f3502a6ef 100644 --- a/reference/complex/complex/conj.md +++ b/reference/complex/complex/conj.md @@ -11,7 +11,7 @@ namespace std { template constexpr complex conj(const complex& x); // (1) C++20 - std::complex conj(Arithmetic x); // (2) C++11 追加のオーバーロード + complex conj(Arithmetic x); // (2) C++11 追加のオーバーロード } ``` * Promoted[italic] @@ -20,11 +20,13 @@ namespace std { ## 概要 共役複素数を得る。conj は conjugate(共役)の略。 -なお、C++11 で追加されたオーバーロードは、以下のように規定されている。 +- (1) : `complex`に対するオーバーロード +- (2) : 算術型に対する追加のオーバーロード -- 実引数の型が `long double` の場合、`complex` にキャストされているかのように振る舞う。 -- そうでなくて、実引数の型が `double` か整数型の場合、`complex` にキャストされているかのように振る舞う。 -- そうでなくて、実引数の型が `float` の場合、`complex` にキャストされているかのように振る舞う。 +(2)は、以下のように振る舞う: + +- 実引数の型が浮動小数点数型 `T` の場合、`complex` にキャストされているかのように振る舞う +- そうでなくて、実引数が整数型の場合、`complex` にキャストされているかのように振る舞う (C++23) また、これらの追加のオーバーロードが関数テンプレートなのか否か、あるいは、引数が参照型なのか否かなどについては、規格では何も言及されていない。 @@ -80,3 +82,5 @@ conj( (1,2) ) = (1,-2) ## 参照 - [P0415R1 Constexpr for `std::complex`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0415r1.html) +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で拡張浮動小数点数型への対応が行われ、整数型も考慮されるようになった diff --git a/reference/complex/complex/imag_free.md b/reference/complex/complex/imag_free.md index cf3b8699c1..98a3e498bd 100644 --- a/reference/complex/complex/imag_free.md +++ b/reference/complex/complex/imag_free.md @@ -6,14 +6,14 @@ ```cpp namespace std { template - T imag(const complex& x); // C++11 まで - + T imag(const complex& x); // (1) C++03 template - constexpr T imag(const complex& x); // C++14 から - - Promoted imag(Arithmetic x); // 追加のオーバーロード:C++11 + constexpr T imag(const complex& x); // (1) C++14 - constexpr Promoted imag(Arithmetic x); // 追加のオーバーロード:C++14 から + complex + imag(Arithmetic x); // (2) C++11 追加のオーバーロード + constexpr complex + imag(Arithmetic x); // (2) C++14 追加のオーバーロード } ``` * Promoted[italic] @@ -22,11 +22,13 @@ namespace std { ## 概要 複素数の虚部を取得する。 -なお、C++11 で追加されたオーバーロードは、以下のように規定されている。 +- (1) : `complex`に対するオーバーロード +- (2) : 算術型に対する追加のオーバーロード + +(2)は、以下のように振る舞う: -- 実引数の型が `long double` の場合、`complex` にキャストされているかのように振る舞う。 -- そうでなくて、実引数の型が `double` か整数型の場合、`complex` にキャストされているかのように振る舞う。 -- そうでなくて、実引数の型が `float` の場合、`complex` にキャストされているかのように振る舞う。 +- 実引数の型が浮動小数点数型 `T` の場合、`complex` にキャストされているかのように振る舞う +- そうでなくて、実引数が整数型の場合、`complex` にキャストされているかのように振る舞う (C++23) また、これらの追加のオーバーロードが関数テンプレートなのか否か、あるいは、引数が参照型なのか否かなどについては、規格では何も言及されていない。 @@ -78,10 +80,6 @@ int main() なお、libstdc++ では追加のオーバーロードが constexpr になっていないが、これはバグであるものと思われる。 -## 参照 -- [N3302 Constexpr Library Additions: complex, v2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3302.html) - - ## 関連項目 | 名前 | 説明 | @@ -96,3 +94,8 @@ int main() | [`proj`](proj.md) | リーマン球面への射影を得る。 | | [`polar`](polar.md) | 指定した絶対値と偏角の複素数値を得る。 | + +## 参照 +- [N3302 Constexpr Library Additions: complex, v2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3302.html) +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で拡張浮動小数点数型への対応が行われ、整数型も考慮されるようになった diff --git a/reference/complex/complex/norm.md b/reference/complex/complex/norm.md index aa1f3b68dc..6406d40f85 100644 --- a/reference/complex/complex/norm.md +++ b/reference/complex/complex/norm.md @@ -11,7 +11,7 @@ namespace std { template constexpr T norm(const complex& x); // (1) C++20 - Promoted norm(Arithmetic x); // (2) C++11 追加のオーバーロード + complex norm(Arithmetic x); // (2) C++11 追加のオーバーロード } ``` * Promoted[italic] @@ -20,11 +20,13 @@ namespace std { ## 概要 複素数体のノルム(field norm。絶対値の 2 乗)を得る。 -なお、C++11 で追加されたオーバーロードは、以下のように規定されている。 +- (1) : `complex`に対するオーバーロード +- (2) : 算術型に対する追加のオーバーロード -- 実引数の型が `long double` の場合、`complex` にキャストされているかのように振る舞う。 -- そうでなくて、実引数の型が `double` か整数型の場合、`complex` にキャストされているかのように振る舞う。 -- そうでなくて、実引数の型が `float` の場合、`complex` にキャストされているかのように振る舞う。 +(2)は、以下のように振る舞う: + +- 実引数の型が浮動小数点数型 `T` の場合、`complex` にキャストされているかのように振る舞う +- そうでなくて、実引数が整数型の場合、`complex` にキャストされているかのように振る舞う (C++23) また、これらの追加のオーバーロードが関数テンプレートなのか否か、あるいは、引数が参照型なのか否かなどについては、規格では何も言及されていない。 @@ -87,3 +89,5 @@ norm( (1,2) ) = 5 - [ノルム (体論) - Wikipedia](https://ja.wikipedia.org/wiki/%E3%83%8E%E3%83%AB%E3%83%A0_(%E4%BD%93%E8%AB%96)) - [ノルム - Wikipedia](https://ja.wikipedia.org/wiki/%E3%83%8E%E3%83%AB%E3%83%A0) - [P0415R1 Constexpr for `std::complex`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0415r1.html) +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で拡張浮動小数点数型への対応が行われ、整数型も考慮されるようになった diff --git a/reference/complex/complex/op_constructor.md b/reference/complex/complex/op_constructor.md index 78394e5255..452b989663 100644 --- a/reference/complex/complex/op_constructor.md +++ b/reference/complex/complex/op_constructor.md @@ -10,51 +10,18 @@ constexpr complex(const T& re = T(), const T& im = T()); // (1) C++14 complex(const complex& other); // (2) C++03 constexpr complex(const complex& other); // (2) C++14 +constexpr complex(const complex& other) = default; // (2) C++23 template complex(const complex& other); // (3) C++03 - template constexpr complex(const complex& other); // (3) C++14 +template +constexpr explicit(see below) + complex(const complex& other); // (3) C++23 ``` -### float 特殊化 -```cpp -complex(const float& re = 0.0f, const float& im = 0.0f); // (1) C++03 -constexpr complex(const float& re = 0.0f, const float& im = 0.0f); // (1) C++14 - -explicit complex(const complex& other); // (3)' C++03 -explicit constexpr complex(const complex& other); // (3)' C++14 - -explicit complex(const complex& other); // (3)' C++03 -explicit constexpr complex(const complex& other); // (3)' C++14 -``` - -### double 特殊化 -```cpp -complex(const double& re = 0.0, const double& im = 0.0); // (1) C++03 -constexpr complex(const double& re = 0.0, const double& im = 0.0); // (1) C++14 - -complex(const complex& other); // (3)' C++03 -constexpr complex(const complex& other); // (3)' C++14 - -explicit complex(const complex& other); // (3)' C++03 -explicit constexpr complex(const complex& other); // (3)' C++14 -``` - -### long double 特殊化 -```cpp -complex(const long double& re = 0.0L, const long double& im = 0.0L); // (1) C++03 -constexpr complex(const long double& re = 0.0L, const long double& im = 0.0L); // (1) C++14 - -complex(const complex& other); // (3)' C++03 -constexpr complex(const complex& other); // (3)' C++14 - -complex(const complex& other); // (3)' C++03 -constexpr complex(const complex& other); // (3)' C++14 -``` - -## complexオブジェクトの構築 +## 概要 - (1) : 実部(`re`)と虚部(`im`)の値をそれぞれ受け取って構築 - (2) : コピーコンストラクタ - (3) : 変換可能な要素型の`complex`オブジェクトからのコピー @@ -66,9 +33,7 @@ constexpr complex(const complex& other); // (3)' C++14 ## 備考 -各浮動小数点型の特殊化では、変換コンストラクタとして (3) の関数テンプレート形式ではなく、(3)' のように個別の関数群を提供している。 -これらのうち、各要素が縮小変換となるものは `explicit` と宣言されているため、暗黙の型変換には使用されない。 -また、テンプレート形式ではないため、浮動小数点型以外の特殊化からの変換は(たとえ要素型同士での型変換ができたとしても)行うことができない。 +- (3) : 浮動小数点数型として縮小変換となるものは `explicit` と宣言されているため、暗黙の型変換には使用されない ## 例 @@ -86,11 +51,11 @@ int main() // コピー構築 std::complex c2 = c1; - // (3)' + // (3) // 変換可能なcomplexオブジェクトからコピー std::complex c3 = c2; - // (3)' + // (3) // 縮小変換となるコンストラクタは explicit // std::complex c4 = c3; // エラー std::complex c4(c3); // 直接初期化なら OK @@ -111,13 +76,15 @@ c4 : (1,2) ``` -## 参照 -- [N3302 Constexpr Library Additions: complex, v2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3302.html) - - ## 関連項目 | 名前 | 説明 | |------------------|----------------------------------| |[`real`](real.md) | 実部を取得、あるいは、設定する。 | |[`imag`](imag.md) | 虚部を取得、あるいは、設定する。 | + + +## 参照 +- [N3302 Constexpr Library Additions: complex, v2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3302.html) +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で拡張浮動小数点数型に対応した diff --git a/reference/complex/complex/pow.md b/reference/complex/complex/pow.md index 97fa0aa261..e8ca273d58 100644 --- a/reference/complex/complex/pow.md +++ b/reference/complex/complex/pow.md @@ -6,34 +6,49 @@ ```cpp namespace std { template - complex pow(const complex& x, const complex& y); // (1) + complex + pow(const complex& x, + const complex& y); // (1) C++03 template - complex pow(const complex& x, const T& y); // (2) + complex + pow(const complex& x, + const T& y); // (2) C++03 template - complex pow(const T& x, const complex& y); // (3) + complex + pow(const T& x, + const complex& y); // (3) C++03 template - complex pow(const complex& x, int y); // (4) C++03 まで + complex + pow(const complex& x, + int y); // (4) C++03 まで - Promoted pow(ArithmeticOrComplex1 x, ArithmeticOrComplex2 y); // (5) 追加のオーバーロード:C++11 から + complex + pow(ArithmeticOrComplex1 x, + ArithmeticOrComplex2 y); // (5) C++11 追加のオーバーロード } ``` * Promoted[italic] * ArithmeticOrComplex1[italic] * ArithmeticOrComplex2[italic] +* common_type_t[link /reference/type_traits/common_type.md] ## 概要 複素数値の累乗を得る。pow は power(累乗、指数)の略。 -なお、C++11 で追加されたオーバーロード (5) は、少なくとも 1 つの実引数が `complex` の場合にオーバーロード解決の際に考慮され、以下のように規定されている。 - -- いずれかの実引数の型が `complex` か `long double` の場合、両方の引数が `complex` にキャストされているかのように振る舞う。 -- そうでなくて、いずれかの実引数の型が `complex` か `double` か整数型の場合、両方の引数が `complex` にキャストされているかのように振る舞う。 -- そうでなくて、いずれかの実引数の型が `complex` か `float` の場合、両方の引数が `complex` にキャストされているかのように振る舞う。 - -また、これらの追加のオーバーロードが関数テンプレートなのか否か、あるいは、引数が参照型なのか否かなどについては、規格では何も言及されていない。 +- (1) : `complex`同士に対するオーバーロード +- (2) : `complex`と`T`の組み合わせでのオーバーロード +- (3) : `T`と`complex`の組み合わせでのオーバーロード +- (3) : `complex`と`int`の組み合わせでのオーバーロード +- (5) : `complex`と任意の算術型、およびその逆の組み合わせに対する追加のオーバーロード + - C++11 : 少なくとも 1 つの実引数が `complex` の場合にオーバーロード解決の際に考慮され、以下のように規定されている + - いずれかの実引数の型が `complex` か `long double` の場合、両方の引数が `complex` にキャストされているかのように振る舞う + - そうでなくて、いずれかの実引数の型が `complex` か `double` か整数型の場合、両方の引数が `complex` にキャストされているかのように振る舞う + - そうでなくて、いずれかの実引数の型が `complex` か `float` の場合、両方の引数が `complex` にキャストされているかのように振る舞う + - また、これらの追加のオーバーロードが関数テンプレートなのか否か、あるいは、引数が参照型なのか否かなどについては、規格では何も言及されていない + - C++23 : `complex`と、`T2`もしくは`complex`の組み合わせ、およびその逆の組み合わせに対するオーバーロードとなり、戻り値はその共通の型`complex<`[`common_type_t`](/reference/type_traits/common_type.md)`>`となった ## 戻り値 @@ -119,3 +134,8 @@ pow( (1,2), (3,4) ) = (0.12901,0.0339241) | [`tan`](tan.md) | 複素数の正接を求める。 | | [`tanh`](tanh.md) | 複素数の双曲線正接を求める。 | | [`pow`](/reference/cmath/pow.md) | 実数の累乗を求める。 | + + +## 参照 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で拡張浮動小数点数型への対応が行われた diff --git a/reference/complex/complex/proj.md b/reference/complex/complex/proj.md index 4cd739a86e..e2d8119442 100644 --- a/reference/complex/complex/proj.md +++ b/reference/complex/complex/proj.md @@ -7,9 +7,9 @@ ```cpp namespace std { template - complex proj(const complex& x); + complex proj(const complex& x); // (1) C++11 - complex proj(Arithmetic x); // 追加のオーバーロード:C++11 から + complex proj(Arithmetic x); // (2) C++11 追加のオーバーロード } ``` * Promoted[italic] @@ -18,11 +18,13 @@ namespace std { ## 概要 リーマン球面への射影(備考参照)を得る。proj は projection(射影、投射)の略。 -なお、C++11 で追加されたオーバーロードは、以下のように規定されている。 +- (1) : `complex`に対するオーバーロード +- (2) : 算術型に対する追加のオーバーロード -- 実引数の型が `long double` の場合、`complex` にキャストされているかのように振る舞う。 -- そうでなくて、実引数の型が `double` か整数型の場合、`complex` にキャストされているかのように振る舞う。 -- そうでなくて、実引数の型が `float` の場合、`complex` にキャストされているかのように振る舞う。 +(2)は、以下のように振る舞う: + +- 実引数の型が浮動小数点数型 `T` の場合、`complex` にキャストされているかのように振る舞う +- そうでなくて、実引数が整数型の場合、`complex` にキャストされているかのように振る舞う (C++23) また、これらの追加のオーバーロードが関数テンプレートなのか否か、あるいは、引数が参照型なのか否かなどについては、規格では何も言及されていない。 @@ -115,4 +117,5 @@ proj( (nan,-inf) ) = (inf,-0) ## 参照 - [LWG Issue 781. `std::complex` should add missing C99 functions](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#781) - +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で拡張浮動小数点数型への対応が行われ、整数型も考慮されるようになった diff --git a/reference/complex/complex/real_free.md b/reference/complex/complex/real_free.md index 1a04c7332e..bd5f8876c6 100644 --- a/reference/complex/complex/real_free.md +++ b/reference/complex/complex/real_free.md @@ -6,14 +6,14 @@ ```cpp namespace std { template - T real(const complex& x); // C++11 まで - + T real(const complex& x); // (1) C++03 template - constexpr T real(const complex& x); // C++14 から - - Promoted real(Arithmetic x); // 追加のオーバーロード:C++11 + constexpr T real(const complex& x); // (1) C++14 - constexpr Promoted real(Arithmetic x); // 追加のオーバーロード:C++14 から + complex + real(Arithmetic x); // (2) C++11 追加のオーバーロード + constexpr complex + real(Arithmetic x); // (2) C++14 追加のオーバーロード } ``` * Promoted[italic] @@ -22,11 +22,13 @@ namespace std { ## 概要 複素数の実部を取得する。 -なお、C++11 で追加されたオーバーロードは、以下のように規定されている。 +- (1) : `complex`に対するオーバーロード +- (2) : 算術型に対する追加のオーバーロード + +(2)は、以下のように振る舞う: -- 実引数の型が `long double` の場合、`complex` にキャストされているかのように振る舞う。 -- そうでなくて、実引数の型が `double` か整数型の場合、`complex` にキャストされているかのように振る舞う。 -- そうでなくて、実引数の型が `float` の場合、`complex` にキャストされているかのように振る舞う。 +- 実引数の型が浮動小数点数型 `T` の場合、`complex` にキャストされているかのように振る舞う +- そうでなくて、実引数が整数型の場合、`complex` にキャストされているかのように振る舞う (C++23) また、これらの追加のオーバーロードが関数テンプレートなのか否か、あるいは、引数が参照型なのか否かなどについては、規格では何も言及されていない。 @@ -78,10 +80,6 @@ int main() なお、libstdc++ では追加のオーバーロードが constexpr になっていないが、これはバグであるものと思われる。 -## 参照 -- [N3302 Constexpr Library Additions: complex, v2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3302.html) - - ## 関連項目 | 名前 | 説明 | @@ -95,3 +93,9 @@ int main() | [`conj`](conj.md) | 共役複素数を得る。 | | [`proj`](proj.md) | リーマン球面への射影を得る。 | | [`polar`](polar.md) | 指定した絶対値と偏角の複素数値を得る。 | + + +## 参照 +- [N3302 Constexpr Library Additions: complex, v2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3302.html) +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で拡張浮動小数点数型への対応が行われ、整数型も考慮されるようになった From d00a2e8f0da78ce5910d58817306a2a05e2f97ba Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 3 Mar 2023 19:25:15 +0900 Subject: [PATCH 0226/3948] =?UTF-8?q?=E4=B8=8D=E8=A6=81=E3=81=AA=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E4=BF=AE=E9=A3=BE=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/complex/complex/pow.md | 1 - 1 file changed, 1 deletion(-) diff --git a/reference/complex/complex/pow.md b/reference/complex/complex/pow.md index e8ca273d58..ada29ac862 100644 --- a/reference/complex/complex/pow.md +++ b/reference/complex/complex/pow.md @@ -33,7 +33,6 @@ namespace std { * Promoted[italic] * ArithmeticOrComplex1[italic] * ArithmeticOrComplex2[italic] -* common_type_t[link /reference/type_traits/common_type.md] ## 概要 複素数値の累乗を得る。pow は power(累乗、指数)の略。 From 604825206be7c23d8379e547c24893fa88319f1c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 3 Mar 2023 19:26:41 +0900 Subject: [PATCH 0227/3948] =?UTF-8?q?README=20:=20=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=89=E4=BF=AE=E9=A3=BE=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF?= =?UTF-8?q?=E3=81=AE=E3=83=90=E3=83=83=E3=82=B8=E3=82=92=E8=A1=A8=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d6e75637d0..0198c7f579 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ site [![detect forbidden characters](https://github.com/cpprefjp/site/workflows/detect%20forbidden%20characters/badge.svg)](https://github.com/cpprefjp/site/actions/workflows/detect_forbidden_characters.yml) [![inner link check](https://github.com/cpprefjp/site/workflows/inner%20link%20check/badge.svg)](https://github.com/cpprefjp/site/actions/workflows/inner_link_check.yml) +[![code qualify check](https://github.com/cpprefjp/site/workflows/code%20qualify%20check/badge.svg)](https://github.com/cpprefjp/site/actions/workflows/code_qualify_check.yml) [![outer link check](https://github.com/cpprefjp/site/workflows/outer%20link%20check/badge.svg)](https://github.com/cpprefjp/site/actions/workflows/outer_link_check.yml) [![build](https://github.com/cpprefjp/site/workflows/build/badge.svg)](https://github.com/cpprefjp/site/actions/workflows/build.yml) From ceb817552e5037e8511165cd17271d2a86b468ca Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Sat, 4 Mar 2023 15:42:39 +0900 Subject: [PATCH 0228/3948] =?UTF-8?q?string=5Fview=20=E3=82=B3=E3=83=B3?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=83=A9=E3=82=AF=E3=82=BF=20:=20LWG=20Issue?= =?UTF-8?q?=203857=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/string_view/basic_string_view/op_constructor.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/reference/string_view/basic_string_view/op_constructor.md b/reference/string_view/basic_string_view/op_constructor.md index 1fe1452653..87c4e83782 100644 --- a/reference/string_view/basic_string_view/op_constructor.md +++ b/reference/string_view/basic_string_view/op_constructor.md @@ -44,8 +44,6 @@ constexpr explicit basic_string_view(R&& r); // (7) C++23 - [`is_same_v`](/reference/type_traits/is_same.md)`<`[`ranges::range_value_t`](/reference/ranges/range_value_t.md)`, charT>`が`true`であること - [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`false`であること - `d`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``型の左辺値としたとき、`d.operator ::std::basic_string_view()`が妥当な式ではないこと - - もし`R::traits_type`が妥当な型の場合、[`is_same_v`](/reference/type_traits/is_same.md)`<`[`remove_reference_t`](/reference/type_traits/remove_reference.md)`::traits_type, traits>`が`true`であること - ## 事前条件 - (3) : 範囲`[str, str + Traits::`[`length`](/reference/string/char_traits/length.md)`(str))`が妥当であること (アクセス可能であること) @@ -181,3 +179,4 @@ int main() - [P1989R2 Range constructor for `std::string_view` 2: Constrain Harder](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1989r2.pdf) - C++23での、レンジ版コンストラクタ追加 - [P2499R0 `string_view` range constructor should be `explicit`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2499r0.html) +- [LWG Issue 3857. `basic_string_view` should allow explicit conversion when only traits vary](https://cplusplus.github.io/LWG/issue3857) From bd6e8a6d96268e8405ad83cb1d8c61fd9e0c3e68 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 7 Mar 2023 11:44:35 +0900 Subject: [PATCH 0229/3948] =?UTF-8?q?build=E3=82=B8=E3=83=A7=E3=83=96?= =?UTF-8?q?=E3=82=92=E6=9C=80=E6=96=B0=E4=BB=A5=E5=A4=96=E3=82=AD=E3=83=A3?= =?UTF-8?q?=E3=83=B3=E3=82=BB=E3=83=AB=E3=81=99=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20#1131?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 84779dd99c..60015616d8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,3 +62,7 @@ jobs: # あとはスクリプトで頑張る - run: ./cpprefjp/site/.github/workflows/script/build.sh working-directory: site_generator + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true From f447758159921653e9e3346942620c9c7bf074b8 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 7 Mar 2023 12:46:13 +0900 Subject: [PATCH 0230/3948] =?UTF-8?q?from=5Fchars=20:=20=E6=8B=A1=E5=BC=B5?= =?UTF-8?q?=E6=B5=AE=E5=8B=95=E5=B0=8F=E6=95=B0=E7=82=B9=E6=95=B0=E5=9E=8B?= =?UTF-8?q?=E3=81=AB=E5=AF=BE=E5=BF=9C=20#1022?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/charconv/from_chars.md | 64 ++++++++++++++++++++++++-------- 1 file changed, 48 insertions(+), 16 deletions(-) diff --git a/reference/charconv/from_chars.md b/reference/charconv/from_chars.md index 8a4ff6a9a5..fe8be92968 100644 --- a/reference/charconv/from_chars.md +++ b/reference/charconv/from_chars.md @@ -7,21 +7,42 @@ ```cpp namespace std { //整数型用 - from_chars_result from_chars(const char* first, const char* last, - /*see below*/& value, int base = 10); // (1) C++17 - constexpr from_chars_result from_chars(const char* first, const char* last, - /*see below*/& value, int base = 10); // (1) C++23 + from_chars_result + from_chars(const char* first, + const char* last, + /*see below*/& value, + int base = 10); // (1) C++17 + constexpr from_chars_result + from_chars(const char* first, + const char* last, + integer-type& value, + int base = 10); // (1) C++23 //浮動小数点型用 - from_chars_result from_chars(const char* first, const char* last, float& value, - chars_format fmt = chars_format::general); // (2) - from_chars_result from_chars(const char* first, const char* last, double& value, - chars_format fmt = chars_format::general); // (3) - from_chars_result from_chars(const char* first, const char* last, long double& value, - chars_format fmt = chars_format::general); // (4) + from_chars_result + from_chars(const char* first, + const char* last, + float& value, + chars_format fmt = chars_format::general); // (2) C++17からC++20まで + from_chars_result + from_chars(const char* first, + const char* last, + double& value, + chars_format fmt = chars_format::general); // (3) C++17からC++20まで + from_chars_result + from_chars(const char* first, + const char* last, + long double& value, + chars_format fmt = chars_format::general); // (4) C++17からC++20まで + from_chars_result + from_chars(const char* first, + const char* last, + floating-point-type& value, + chars_format fmt = chars_format::general); // (5) C++23 } ``` * see below[italic] +* integer-type[italic] ## 概要 @@ -30,6 +51,13 @@ namespace std { C++標準はこれら関数の実装の詳細について何も規定しない。これは、各実装において可能な最も高速なアルゴリズムが選択されることを意図しての事である。 +- (1) : 整数型に対するオーバーロード +- (2) : `float`型に対するオーバーロード +- (3) : `double`型に対するオーバーロード +- (4) : `long double`型に対するオーバーロード +- (5) : 浮動小数点数型に対するオーバーロード + + ## 要件 - 全て : 入力イテレータ範囲`[first, last)`は有効な範囲であること(charのオブジェクトが構築済みであり、連続していること)。 - (1) : `base`は2~36までの値であること。 @@ -51,7 +79,7 @@ C++標準はこれら関数の実装の詳細について何も規定しない nを基数としたCロケールによる`strtol`で変換する際と同様のパターンを用いる。 ただし、`value`の型が符号付である場合にのみ`-`は考慮され、`+`や16進数の`0x`等の他の記号は考慮されない。 -- (2)~(4) : 浮動小数点数字列を浮動小数点数へ変換する。 +- (2)~(5) : 浮動小数点数字列を浮動小数点数へ変換する。 Cロケールによる`strtod`で変換する際と同様のパターンを用いる。ただし、以下の違いがある。 数字の先頭の符号は`-`のみが考慮され、`+`等は考慮されない。 また、`fmt`に`chars_format::general`が設定されておらず(`scientific`と`fixed`が同時に設定されておらず) @@ -83,7 +111,9 @@ C++標準はこれら関数の実装の詳細について何も規定しない 投げない。 ## 備考 -(1)の関数は実装によって全ての整数型(符号付、無し)および`char`の参照型のオーバーロードが提供される。 +- (1) : 実装によって全ての整数型(符号付、無し)および`char`の参照型のオーバーロードが提供される +- (5) : 浮動小数点数型は、拡張浮動小数点数型を含む + ## 例 @@ -278,7 +308,7 @@ auto str_to_double(R&& r) -> std::optional { int main() { std::string str = "3.1415926535897932384626433832795 is pi"; - + if (auto opt = str_to_double(str); opt) { std::cout << std::format("{:.15f}\n", *opt); } else { @@ -286,7 +316,7 @@ int main() { } std::string_view strview = "2.7182818284590452353602874 is e"; - + if (auto opt = str_to_double(strview); opt) { std::cout << std::format("{:.15f}\n", *opt); } else { @@ -295,7 +325,7 @@ int main() { const char cstr[] = "1.10001e-01 is Liouville number"; std::vector strvec(cstr, std::ranges::end(cstr)); - + if (auto opt = str_to_double(strvec); opt) { std::cout << std::format("{:.15f}\n", *opt); } else { @@ -303,7 +333,7 @@ int main() { } std::span sp{cstr}; - + if (auto opt = str_to_double(sp); opt) { std::cout << std::format("{:.15f}\n", *opt); } else { @@ -349,3 +379,5 @@ int main() { - [How to Use The Newest C++ String Conversion Routines - std::from_chars - Bartek's coding blog ](https://www.bfilipek.com/2018/12/fromchars.html) - [P2291R3: Add Constexpr Modifiers to Functions to_chars and from_chars for Integral Types in `` Header](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2291r3.pdf) - C++23での(1)constexpr指定 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で拡張浮動小数点数型に対応した From 985d49c758e7d255f694e0357e289c7484c47cf8 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 7 Mar 2023 12:46:45 +0900 Subject: [PATCH 0231/3948] =?UTF-8?q?to=5Fchars=20:=20=E6=8B=A1=E5=BC=B5?= =?UTF-8?q?=E6=B5=AE=E5=8B=95=E5=B0=8F=E6=95=B0=E7=82=B9=E6=95=B0=E5=9E=8B?= =?UTF-8?q?=E3=81=AB=E5=AF=BE=E5=BF=9C=20#1022?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/charconv/to_chars.md | 137 +++++++++++++++++++++++++-------- 1 file changed, 106 insertions(+), 31 deletions(-) diff --git a/reference/charconv/to_chars.md b/reference/charconv/to_chars.md index bfb3df0344..aeb75e232b 100644 --- a/reference/charconv/to_chars.md +++ b/reference/charconv/to_chars.md @@ -7,35 +7,93 @@ ```cpp namespace std { //整数型用 - to_chars_result to_chars(char* first, char* last, /*see below*/ value, int base = 10); // (1) C++17 - constexpr to_chars_result to_chars(char* first, char* last, /*see below*/ value, int base = 10); // (1) C++23 + to_chars_result + to_chars(char* first, + char* last, + /*see below*/ value, + int base = 10); // (1) C++17 + constexpr to_chars_result + to_chars(char* first, + char* last, + integer-type value, + int base = 10); // (1) C++23 //boolの変換は禁止 - to_chars_result to_chars(char* first, char* last, bool value, int base = 10) = delete; // C++20 + to_chars_result + to_chars(char* first, + char* last, + bool value, + int base = 10) = delete; // C++20 //精度、フォーマット指定なし - to_chars_result to_chars(char* first, char* last, float value); // (2) - to_chars_result to_chars(char* first, char* last, double value); // (3) - to_chars_result to_chars(char* first, char* last, long double value); // (4) + to_chars_result + to_chars(char* first, + char* last, + float value); // (2) C++17からC++20まで + to_chars_result + to_chars(char* first, + char* last, + double value); // (3) C++17からC++20まで + to_chars_result + to_chars(char* first, + char* last, + long double value); // (4) C++17からC++20まで + to_chars_result + to_chars(char* first, + char* last, + floating-point-type value); // (5) C++23 //精度指定なし - to_chars_result to_chars(char* first, char* last, float value, - chars_format fmt); // (5) - to_chars_result to_chars(char* first, char* last, double value, - chars_format fmt); // (6) - to_chars_result to_chars(char* first, char* last, long double value, - chars_format fmt); // (7) + to_chars_result + to_chars(char* first, + char* last, + float value, + chars_format fmt); // (6) C++17からC++20まで + to_chars_result + to_chars(char* first, + char* last, + double value, + chars_format fmt); // (7) C++17からC++20まで + to_chars_result + to_chars(char* first, + char* last, + long double value, + chars_format fmt); // (8) C++17からC++20まで + to_chars_result + to_chars(char* first, + char* last, + floating-point-type value, + chars_format fmt); // (9) C++23 //精度とフォーマットを指定 - to_chars_result to_chars(char* first, char* last, float value, - chars_format fmt, int precision); // (8) - to_chars_result to_chars(char* first, char* last, double value, - chars_format fmt, int precision); // (9) - to_chars_result to_chars(char* first, char* last, long double value, - chars_format fmt, int precision); // (10) + to_chars_result + to_chars(char* first, + char* last, + float value, + chars_format fmt, + int precision); // (10) C++17からC++20まで + to_chars_result + to_chars(char* first, + char* last, + double value, + chars_format fmt, + int precision); // (11) C++17からC++20まで + to_chars_result + to_chars(char* first, + char* last, + long double value, + chars_format fmt, + int precision); // (12) C++17からC++20まで + to_chars_result + to_chars(char* first, + char* last, + floating-point-type value, + chars_format fmt, + int precision); // (13) C++23 } ``` * see below[italic] +* integer-type[italic] ## 概要 与えられた数値(`value`)を文字列へ変換し、`[first, last)`内へ出力する。 @@ -43,10 +101,24 @@ namespace std { C++標準はこれら関数の実装の詳細について何も規定しない。これは、各実装において可能な最も高速なアルゴリズムが選択されることを意図しての事である。 +- (1) : 整数型に対するオーバーロード +- (2) : `float`に対するオーバーロード (精度・フォーマット指定なし) +- (3) : `double`に対するオーバーロード (精度・フォーマット指定なし) +- (4) : `long double`に対するオーバーロード (精度・フォーマット指定なし) +- (5) : 浮動小数点数型に対するオーバーロード (精度・フォーマット指定なし) +- (6) : `float`に対するオーバーロード (精度指定なし) +- (7) : `double`に対するオーバーロード (精度指定なし) +- (8) : `long double`に対するオーバーロード (精度指定なし) +- (9) : 浮動小数点数型に対するオーバーロード (精度指定なし) +- (10) : `float`に対するオーバーロード (精度・フォーマット指定) +- (11) : `double`に対するオーバーロード (精度・フォーマット指定) +- (12) : `long double`に対するオーバーロード (精度・フォーマット指定) +- (13) : 浮動小数点数型に対するオーバーロード (精度・フォーマット指定) + ## 要件 - 全て : 出力イテレータ範囲`[first, last)`は有効な範囲であること(charのオブジェクトが構築済みであり、連続していること)。 - (1) : `base`は2~36までの値であること。 -- (5)~(10) : `fmt`は[`chars_format`](../charconv/chars_format.md)の列挙値のうちの一つであること。 +- (6)~(13) : `fmt`は[`chars_format`](../charconv/chars_format.md)の列挙値のうちの一つであること。 ## 引数 - `first` -- 変換結果の文字列を出力する範囲の先頭ポインタ。 @@ -64,14 +136,14 @@ C++標準はこれら関数の実装の詳細について何も規定しない 10 < nの場合、10~35の値はアルファベットの小文字a~zがあてられる。 桁数を合わせるために左側を0をパディングすること(0埋め)は行われない。 -- (2)(3)(4) : Cロケールで`printf`によって行われたかのように浮動小数点数を文字列へ変換する。 +- (2)(3)(4)(5) : Cロケールで`printf`によって行われたかのように浮動小数点数を文字列へ変換する。 フォーマット指定子は`%f,%e`どちらかを出力文字列が最も短くなるように(両者が同じなら`%f`が優先)選択する。 -- (5)(6)(7) : `fmt`によって指定されたフォーマット指定子を用いて、Cロケールで`printf`によって行われたかのように浮動小数点数を文字列へ変換する。 +- (6)(7)(8)(9) : `fmt`によって指定されたフォーマット指定子を用いて、Cロケールで`printf`によって行われたかのように浮動小数点数を文字列へ変換する。 出力文字列が最も短くなるように変換される。 - `chars_format::general`が指定された場合は(2)(3)(4)と同等。 + `chars_format::general`が指定された場合は(2)(3)(4)(5)と同等。 -- (8)(9)(10) : `fmt`と`precision`によって指定されたフォーマット指定子と精度を用いて、Cロケールで`printf`によって行われたかのように浮動小数点数を文字列へ変換する。 +- (10)(11)(12)(13) : `fmt`と`precision`によって指定されたフォーマット指定子と精度を用いて、Cロケールで`printf`によって行われたかのように浮動小数点数を文字列へ変換する。 出力文字列が最も短くなるようにとは、小数点の前に少なくとも1桁あり、対応する[`from_chars`](../charconv/from_chars.md)関数によって値を正確に復元できるような最小の文字数、になることである。 そのような文字列表現が複数ある場合、`value`の値との差が最も小さくなる物が選ばれ、それも複数あるときは[`std::round_to_nearest`](/reference/limits/float_round_style.md)に従った丸めによって一つを選択する。 @@ -96,9 +168,10 @@ C++標準はこれら関数の実装の詳細について何も規定しない 投げない。 ## 備考 -(1)の関数は実装によって全ての整数型(符号付、無し)および`char`のオーバーロードが提供される。 +- MSVCでは浮動小数点数→10進文字列変換の実装に[Ryu](https://github.com/ulfjack/ryu)というアルゴリズムを利用している。 +- (1) : 実装によって全ての整数型(符号付、無し)および`char`のオーバーロードが提供される +- (5)(9)(13) : 浮動小数点数型は拡張浮動小数点数型を含む -MSVCでは浮動小数点数→10進文字列変換の実装に[Ryu](https://github.com/ulfjack/ryu)というアルゴリズムを利用している。 ## 例 @@ -145,21 +218,21 @@ int main() std::cout << "conversion failed." << std::endl; } - //(6) 精度指定なしの浮動小数点数変換、指数表記 + //(7) 精度指定なしの浮動小数点数変換、指数表記 if (auto [ptr, ec] = std::to_chars(begin, end, l, std::chars_format::scientific); ec == std::errc{}) { std::cout << std::string_view(begin, ptr - begin) << std::endl; } else { std::cout << "conversion failed." << std::endl; } - //(6) 精度指定なしの浮動小数点数変換、固定小数表記 + //(7) 精度指定なしの浮動小数点数変換、固定小数表記 if (auto [ptr, ec] = std::to_chars(begin, end, l, std::chars_format::fixed); ec == std::errc{}) { std::cout << std::string_view(begin, ptr - begin) << std::endl; } else { std::cout << "conversion failed." << std::endl; } - //(6) 精度指定なしの浮動小数点数変換、16進指数表記 + //(7) 精度指定なしの浮動小数点数変換、16進指数表記 if (auto [ptr, ec] = std::to_chars(begin, end, l, std::chars_format::hex); ec == std::errc{}) { std::cout << std::string_view(begin, ptr - begin) << std::endl; } @@ -167,21 +240,21 @@ int main() std::cout << "conversion failed." << std::endl; } - //(9) 精度指定ありの浮動小数点数変換、指数表記 + //(11) 精度指定ありの浮動小数点数変換、指数表記 if (auto [ptr, ec] = std::to_chars(begin, end, l, std::chars_format::scientific, 16); ec == std::errc{}) { std::cout << std::string_view(begin, ptr - begin) << std::endl; } else { std::cout << "conversion failed." << std::endl; } - //(9) 精度指定ありの浮動小数点数変換、固定小数表記 + //(11) 精度指定ありの浮動小数点数変換、固定小数表記 if (auto [ptr, ec] = std::to_chars(begin, end, l, std::chars_format::fixed, 16); ec == std::errc{}) { std::cout << std::string_view(begin, ptr - begin) << std::endl; } else { std::cout << "conversion failed." << std::endl; } - //(9) 精度指定ありの浮動小数点数変換、16進指数表記 + //(11) 精度指定ありの浮動小数点数変換、16進指数表記 if (auto [ptr, ec] = std::to_chars(begin, end, l, std::chars_format::hex, 16); ec == std::errc{}) { std::cout << std::string_view(begin, ptr - begin) << std::endl; } @@ -227,3 +300,5 @@ z - [Visual Studio 2017 version 15.9.0 - Visual Studio 2017 version 15.9 Release Notes](https://docs.microsoft.com/en-us/visualstudio/releasenotes/vs2017-relnotes#-c) - [P2291R3: Add Constexpr Modifiers to Functions to_chars and from_chars for Integral Types in `` Header](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2291r3.pdf) - C++23での(1)constexpr指定 +- [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) + - C++23で拡張浮動小数点数型に対応した From d9d21a6ae8197fd8f3b2f068b597574fc67bf450 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 10 Mar 2023 13:49:08 +0900 Subject: [PATCH 0232/3948] =?UTF-8?q?=E3=81=AE=E3=83=98?= =?UTF-8?q?=E3=83=83=E3=83=80=E3=83=9A=E3=83=BC=E3=82=B8=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=20#1078?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23.md | 2 +- reference.md | 2 +- reference/flat_map.md | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 reference/flat_map.md diff --git a/lang/cpp23.md b/lang/cpp23.md index 9cdb590f0a..1828d7e04d 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -118,7 +118,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 - 外部から提供されるメモリバッファでストリーム処理を行うライブラリとして[``](/reference/spanstream.md.nolink)を追加 - 正常値とエラー値のどちらかを持つクラスおよびライブラリとして[``](/reference/expected.md)を追加 - 多次元配列ビューのライブラリとして[``](/reference/mdspan.md.nolink)を追加 -- ノードベースではないソート済みキーによる順序付き連想コンテナのライブラリとして、[``](/reference/flat_map.md.nolink)と[``](/reference/flat_set.md.nolink)を追加 +- ノードベースではないソート済みキーによる順序付き連想コンテナのライブラリとして、[``](/reference/flat_map.md)と[``](/reference/flat_set.md.nolink)を追加 - 書式指定で出力するライブラリとして[``](/reference/print.md)を追加 - コルーチンによるRangeの生成をサポートする[``](/reference/generator.md)を追加 - 拡張浮動小数点数のライブラリとして[``](/reference/stdfloat.md)を追加 diff --git a/reference.md b/reference.md index 583bb2ea52..2a938a630a 100644 --- a/reference.md +++ b/reference.md @@ -107,7 +107,7 @@ | [``](/reference/vector.md) | ベクタ配列 | | | [``](/reference/map.md) | 順序付き連想配列 | | | [``](/reference/set.md) | 順序付き集合 | | -| [``](/reference/flat_map.md.nolink) | ソート済みキーによる順序付き連想配列 | C++23 | +| [``](/reference/flat_map.md) | ソート済みキーによる順序付き連想配列 | C++23 | | [``](/reference/flat_set.md.nolink) | ソート済みキーによる順序付き集合 | C++23 | | [``](/reference/unordered_map.md) | 非順序連想配列 | C++11 | | [``](/reference/unordered_set.md) | 非順序集合 | C++11 | diff --git a/reference/flat_map.md b/reference/flat_map.md new file mode 100644 index 0000000000..bb1d8093eb --- /dev/null +++ b/reference/flat_map.md @@ -0,0 +1,32 @@ +# flat_map +* flat_map[meta header] +* cpp23[meta cpp] + +`` ヘッダは、ソート済みキーによる順序付き連想配列を定義する。 + +[`std::map`](/reference/map/map.md)と違ってノードベースの実装ではなく、メモリ連続性のある配列で扱われる (flat=平坦)。 + +`` ヘッダでは、キーの重複を許さない `std::`[`flat_map`](flat_map/flat_map.md.nolink) クラステンプレート、およびキーの重複を許す `std::`[`flat_multimap`](flat_map/flat_multimap.md.nolink) クラステンプレートを提供する。 + +このヘッダでは、以下の標準ヘッダをインクルードする: + +- [``](initializer_list.md) +- [``](compare.md) + + +| 名前 | 説明 | 対応バージョン | +|----------------------------------------------|--------------------------------------------------------|-------| +| [`flat_map`](flat_map/flat_map.md.nolink) | キーの重複を許さない平坦な順序付き連想コンテナ(class template) | C++23 | +| [`flat_multimap`](flat_map/flat_multimap.md.nolink) | キーの重複を許す平坦な順序付き連想コンテナ(class template) | C++23 | + + +## バージョン +### 言語 +- C++23 + + +## 参照 +- [P0429R3 A Standard `flat_map`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0429r3.pdf) + - C++23で`flat_map`が導入された経緯・動機・設計について記載されている +- [P0429R9 A Standard `flat_map`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0429r9.pdf) + - C++23で導入された`flat_map`の仕様 From a49ab655988d97d3a3f88babe5c609af7a3588d0 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 10 Mar 2023 13:58:40 +0900 Subject: [PATCH 0233/3948] =?UTF-8?q?=20:=20fix=20=E6=97=A5?= =?UTF-8?q?=E6=9C=AC=E8=AA=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/flat_map.md b/reference/flat_map.md index bb1d8093eb..568ef4d4e1 100644 --- a/reference/flat_map.md +++ b/reference/flat_map.md @@ -4,7 +4,7 @@ `` ヘッダは、ソート済みキーによる順序付き連想配列を定義する。 -[`std::map`](/reference/map/map.md)と違ってノードベースの実装ではなく、メモリ連続性のある配列で扱われる (flat=平坦)。 +[`std::map`](/reference/map/map.md)と違ってノードベースの実装ではなく、メモリ連続性のある平坦 (flat) な配列で扱われる。 `` ヘッダでは、キーの重複を許さない `std::`[`flat_map`](flat_map/flat_map.md.nolink) クラステンプレート、およびキーの重複を許す `std::`[`flat_multimap`](flat_map/flat_multimap.md.nolink) クラステンプレートを提供する。 From 58c137d95c790b4afa37945a0b9cec9236cc2dc3 Mon Sep 17 00:00:00 2001 From: tshino Date: Mon, 13 Mar 2023 22:14:33 +0900 Subject: [PATCH 0234/3948] =?UTF-8?q?shift=5Fleft/shift=5Fright=E3=81=A7?= =?UTF-8?q?=E8=B2=A0=E6=95=B0=E3=82=92=E6=8C=87=E5=AE=9A=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E3=81=A8=E8=AA=AD=E3=82=81=E3=82=8B=E8=A8=98=E8=BF=B0=E3=81=AE?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_shift_left.md | 4 ++-- reference/algorithm/ranges_shift_right.md | 4 ++-- reference/algorithm/shift_left.md | 8 ++++++-- reference/algorithm/shift_right.md | 8 ++++++-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/reference/algorithm/ranges_shift_left.md b/reference/algorithm/ranges_shift_left.md index 468fc83116..9e567fde3c 100644 --- a/reference/algorithm/ranges_shift_left.md +++ b/reference/algorithm/ranges_shift_left.md @@ -45,7 +45,7 @@ namespace std::ranges { ## 効果 -- `n <= 0`である場合、なにもしない +- `n == 0`である場合、なにもしない - `n >= last - first`である場合、なにもしない - `i < (last - first) - n`である非負の各`i`について、`first + n + i`位置の要素を`first + i`位置にムーブする - (1)では、`i = 0`から`i = (last - first) - n - 1`の順に処理する @@ -65,7 +65,7 @@ namespace std::ranges { ## 備考 -- シフト数として負数を指定するとなにも起こらないが、この関数には符号付き整数型を指定することとなっている。これは、Bidirectional Iterator向けの最適化した実装をする場合に[`std::prev()`](/reference/iterator/prev.md)関数を使用するため、そちらのパラメータ型と合わせたことによる +- シフト数として負数を指定することはできないが、この関数には符号付き整数型を指定することとなっている。これは、Bidirectional Iterator向けの最適化した実装をする場合に[`std::prev()`](/reference/iterator/prev.md)関数を使用するため、そちらのパラメータ型と合わせたことによる - `shift_left()`と[`shift_right()`](ranges_shift_right.md)で関数が分かれているのは、コンパイルしたコードサイズを小さくするためと、左シフトと右シフトでは最大パフォーマンスのための実装が異なるためである diff --git a/reference/algorithm/ranges_shift_right.md b/reference/algorithm/ranges_shift_right.md index d536d557ad..8ff494298c 100644 --- a/reference/algorithm/ranges_shift_right.md +++ b/reference/algorithm/ranges_shift_right.md @@ -46,7 +46,7 @@ namespace std::ranges { ## 効果 -- `n <= 0`である場合、なにもしない +- `n == 0`である場合、なにもしない - `n >= last - first`である場合、なにもしない - `i < (last - first) - n`である非負の各`i`について、`first + i`位置の要素を`first + n + i`位置にムーブする - (1)では、`I`型が[`bidirectional_iterator`](/reference/iterator/bidirectional_iterator.md)のモデルとなる場合は、`i = (last - first) - n - 1`から`i = 0`の順に処理する @@ -66,7 +66,7 @@ namespace std::ranges { ## 備考 -- シフト数として負数を指定するとなにも起こらないが、この関数には符号付き整数型を指定することとなっている。これは、Bidirectional Iterator向けの最適化した実装をする場合に[`std::prev()`](/reference/iterator/prev.md)関数を使用するため、そちらのパラメータ型と合わせたことによる +- シフト数として負数を指定することはできないが、この関数には符号付き整数型を指定することとなっている。これは、Bidirectional Iterator向けの最適化した実装をする場合に[`std::prev()`](/reference/iterator/prev.md)関数を使用するため、そちらのパラメータ型と合わせたことによる - [`shift_left()`](ranges_shift_left.md)と`shift_right()`で関数が分かれているのは、コンパイルしたコードサイズを小さくするためと、左シフトと右シフトでは最大パフォーマンスのための実装が異なるためである diff --git a/reference/algorithm/shift_left.md b/reference/algorithm/shift_left.md index 25010f71aa..d4534a50b9 100644 --- a/reference/algorithm/shift_left.md +++ b/reference/algorithm/shift_left.md @@ -34,8 +34,12 @@ namespace std { - `*first`の型が[ムーブ代入可能](/reference/type_traits/is_move_assignable.md)であること +## 事前条件 +`n >= 0` + + ## 効果 -- `n <= 0`である場合、なにもしない +- `n == 0`である場合、なにもしない - `n >= last - first`である場合、なにもしない - `i < (last - first) - n`である非負の各`i`について、`first + n + i`位置の要素を`first + i`位置にムーブする - (1)では、`i = 0`から`i = (last - first) - n - 1`の順に処理する @@ -52,7 +56,7 @@ namespace std { ## 備考 -- シフト数として負数を指定するとなにも起こらないが、この関数には符号付き整数型を指定することとなっている。これは、Bidirectional Iterator向けの最適化した実装をする場合に[`std::prev()`](/reference/iterator/prev.md)関数を使用するため、そちらのパラメータ型と合わせたことによる +- シフト数として負数を指定することはできないが、この関数には符号付き整数型を指定することとなっている。これは、Bidirectional Iterator向けの最適化した実装をする場合に[`std::prev()`](/reference/iterator/prev.md)関数を使用するため、そちらのパラメータ型と合わせたことによる - `shift_left()`と[`shift_right()`](shift_right.md)で関数が分かれているのは、コンパイルしたコードサイズを小さくするためと、左シフトと右シフトでは最大パフォーマンスのための実装が異なるためである diff --git a/reference/algorithm/shift_right.md b/reference/algorithm/shift_right.md index 06fe7d1acc..13ac718fb2 100644 --- a/reference/algorithm/shift_right.md +++ b/reference/algorithm/shift_right.md @@ -35,8 +35,12 @@ namespace std { - `ForwardIterator`型が、Bidirectional Iteratorの要件もしくは[ValueSwappable](/reference/concepts/ValueSwappable.md)の要件を満たすこと +## 事前条件 +`n >= 0` + + ## 効果 -- `n <= 0`である場合、なにもしない +- `n == 0`である場合、なにもしない - `n >= last - first`である場合、なにもしない - `i < (last - first) - n`である非負の各`i`について、`first + i`位置の要素を`first + n + i`位置にムーブする - (1)では、`ForwardIterator`型がBidirectional Iteratorの要件を満たす場合は、`i = (last - first) - n - 1`から`i = 0`の順に処理する @@ -53,7 +57,7 @@ namespace std { ## 備考 -- シフト数として負数を指定するとなにも起こらないが、この関数には符号付き整数型を指定することとなっている。これは、Bidirectional Iterator向けの最適化した実装をする場合に[`std::prev()`](/reference/iterator/prev.md)関数を使用するため、そちらのパラメータ型と合わせたことによる +- シフト数として負数を指定することはできないが、この関数には符号付き整数型を指定することとなっている。これは、Bidirectional Iterator向けの最適化した実装をする場合に[`std::prev()`](/reference/iterator/prev.md)関数を使用するため、そちらのパラメータ型と合わせたことによる - [`shift_left()`](shift_left.md)と`shift_right()`で関数が分かれているのは、コンパイルしたコードサイズを小さくするためと、左シフトと右シフトでは最大パフォーマンスのための実装が異なるためである From 68eb5baa77245d37dd583d936ec89998e7f7a6a5 Mon Sep 17 00:00:00 2001 From: tshino Date: Tue, 14 Mar 2023 02:17:29 +0900 Subject: [PATCH 0235/3948] =?UTF-8?q?shift=5Fleft/shift=5Fright=E3=81=AE?= =?UTF-8?q?=E4=BA=8B=E5=89=8D=E6=9D=A1=E4=BB=B6=E3=81=AB=E5=90=88=E3=82=8F?= =?UTF-8?q?=E3=81=9B=E3=81=A6=E6=88=BB=E3=82=8A=E5=80=A4=E3=81=AE=E8=A8=98?= =?UTF-8?q?=E8=BF=B0=E3=82=82=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_shift_left.md | 5 ++--- reference/algorithm/ranges_shift_right.md | 5 ++--- reference/algorithm/shift_left.md | 5 ++--- reference/algorithm/shift_right.md | 5 ++--- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/reference/algorithm/ranges_shift_left.md b/reference/algorithm/ranges_shift_left.md index 9e567fde3c..7706f89d36 100644 --- a/reference/algorithm/ranges_shift_left.md +++ b/reference/algorithm/ranges_shift_left.md @@ -54,9 +54,8 @@ namespace std::ranges { ## 戻り値 `new_last`を次のように定義する。 -- `n > 0`かつ`n < last - first`である場合、`first + (last - first - n)`を返す -- `n > 0`である場合、`first`を返す -- いずれでもない場合、`last`を返す +- `n < last - first`である場合、`first + (last - first - n)` +- そうでなければ、`first` このとき、 `{first, new_last}` diff --git a/reference/algorithm/ranges_shift_right.md b/reference/algorithm/ranges_shift_right.md index 8ff494298c..8ee0dabda0 100644 --- a/reference/algorithm/ranges_shift_right.md +++ b/reference/algorithm/ranges_shift_right.md @@ -55,9 +55,8 @@ namespace std::ranges { ## 戻り値 `new_first`を次のように定義する。 -- `n > 0`かつ`n < last - first`である場合、`first + n`を返す -- `n > 0`である場合、`last`を返す -- いずれでもない場合、`first`を返す +- `n < last - first`である場合、`first + n` +- そうでなければ、`last` このとき、 `{new_first, last}` diff --git a/reference/algorithm/shift_left.md b/reference/algorithm/shift_left.md index d4534a50b9..f6cf231ffb 100644 --- a/reference/algorithm/shift_left.md +++ b/reference/algorithm/shift_left.md @@ -46,9 +46,8 @@ namespace std { ## 戻り値 -- `n > 0`かつ`n < last - first`である場合、`first + (last - first - n)`を返す -- `n > 0`である場合、`first`を返す -- いずれでもない場合、`last`を返す +- `n < last - first`である場合、`first + (last - first - n)`を返す +- そうでなければ、`first`を返す ## 計算量 diff --git a/reference/algorithm/shift_right.md b/reference/algorithm/shift_right.md index 13ac718fb2..f910c76b17 100644 --- a/reference/algorithm/shift_right.md +++ b/reference/algorithm/shift_right.md @@ -47,9 +47,8 @@ namespace std { ## 戻り値 -- `n > 0`かつ`n < last - first`である場合、`first + n`を返す -- `n > 0`である場合、`last`を返す -- いずれでもない場合、`first`を返す +- `n < last - first`である場合、`first + n`を返す +- そうでなければ、`last`を返す ## 計算量 From ceb813ec5fdcfcbf3ef5205d2e0bf4f52e83337d Mon Sep 17 00:00:00 2001 From: tshino Date: Wed, 15 Mar 2023 10:35:05 +0900 Subject: [PATCH 0236/3948] =?UTF-8?q?shift=5Fleft/shift=5Fright=E3=81=AE?= =?UTF-8?q?=E5=8F=82=E7=85=A7=E3=83=AA=E3=82=B9=E3=83=88=E3=81=ABP1243R4?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/shift_left.md | 1 + reference/algorithm/shift_right.md | 1 + 2 files changed, 2 insertions(+) diff --git a/reference/algorithm/shift_left.md b/reference/algorithm/shift_left.md index f6cf231ffb..7cbae619af 100644 --- a/reference/algorithm/shift_left.md +++ b/reference/algorithm/shift_left.md @@ -99,5 +99,6 @@ int main() - [`rotate`](rotate.md) ## 参照 +- [P1243R4 Rangify New Algorithms](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1243r4.pdf) - [P0769R2 | Add shift to ``](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0769r2.pdf) - [[idea for proposal] Adding `std::shift` to `` - std-proposals](https://groups.google.com/a/isocpp.org/forum/#!msg/std-proposals/I76om68B3t0/iA348-iFBAAJ) diff --git a/reference/algorithm/shift_right.md b/reference/algorithm/shift_right.md index f910c76b17..ec54813bac 100644 --- a/reference/algorithm/shift_right.md +++ b/reference/algorithm/shift_right.md @@ -100,5 +100,6 @@ int main() - [`rotate`](rotate.md) ## 参照 +- [P1243R4 Rangify New Algorithms](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1243r4.pdf) - [P0769R2 | Add shift to ``](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0769r2.pdf) - [[idea for proposal] Adding `std::shift` to `` - std-proposals](https://groups.google.com/a/isocpp.org/forum/#!msg/std-proposals/I76om68B3t0/iA348-iFBAAJ) From f5945989373e78031eef9ece3dc5ccdf13dfb41d Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 17 Mar 2023 20:46:19 +0900 Subject: [PATCH 0237/3948] is_layout_compatible: fix typo, update example --- reference/type_traits/is_layout_compatible.md | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/reference/type_traits/is_layout_compatible.md b/reference/type_traits/is_layout_compatible.md index 09d435694c..d2cf1daca1 100644 --- a/reference/type_traits/is_layout_compatible.md +++ b/reference/type_traits/is_layout_compatible.md @@ -32,7 +32,7 @@ namespace std { - `T1`と`U1`が同一の型である。 - `T1`と`U1`がレイアウト互換な列挙型(layout-compatible enumerations)である。 - つまり、2つの列挙型`T1`, `U1`の[基底型](underlying_type.md)が同一の型をもつ。 -- `T1`と`U1`が[スタンダードレイアウト](is_standard_layout.md)かつレイアウト互換なクラス(compatible-compatible class)である。 +- `T1`と`U1`が[スタンダードレイアウト](is_standard_layout.md)かつレイアウト互換なクラス(layout-compatible class)である。 - つまり、2つのスタンダードレイアウトなクラス`T1`, `U1`に含まれる全てのメンバ変数およびビットフィールドが、同一の先頭のメンバの並び(common initial sequence)を構成している。 - 2つ型の同一の先頭のメンバの並びとは、各クラスにおける非静的メンバ変数およびビットフィールドの宣言順序において、対応するエンティティがレイアウト互換な型であり、両エンティティともに[`no_unique_address`属性](/lang/cpp20/language_support_for_empty_objects.md)の指定有無が同一であり、かつ両エンティティが同一幅ビットフィールドもしくは(ビットフィールドではなく)非静的メンバ変数という条件を満たす、先頭からの最長の並びを指す。 @@ -41,21 +41,27 @@ namespace std { ```cpp example #include -struct X { int a; }; -struct Y { int b; }; -struct Z { char c; }; - enum class E0 : int { A, B, C }; enum class E1 : int { X, Y, Z }; enum class E2 : char { A, B, C }; +struct X { int a; }; +struct Y { const int b; }; +struct Z { char c; }; +struct X1 { static int s; int m; }; + int main() { - static_assert( std::is_layout_compatible_v); - static_assert( std::is_layout_compatible_v); - static_assert(!std::is_layout_compatible_v); - static_assert( std::is_layout_compatible_v); - static_assert(!std::is_layout_compatible_v); + static_assert( std::is_layout_compatible_v); + static_assert(not std::is_layout_compatible_v); + + static_assert( std::is_layout_compatible_v); + static_assert(not std::is_layout_compatible_v); + static_assert(not std::is_layout_compatible_v); + + static_assert( std::is_layout_compatible_v); + static_assert(not std::is_layout_compatible_v); + static_assert( std::is_layout_compatible_v); } ``` * std::is_layout_compatible_v[color ff0000] @@ -71,7 +77,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? +- [GCC](/implementation.md#gcc): 12.1 - [Visual C++](/implementation.md#visual_cpp): ?? From 5684a8d9526d13ddee84d6a2468b973081e2b041 Mon Sep 17 00:00:00 2001 From: Akiko Kawai Date: Sat, 18 Mar 2023 10:06:17 +0900 Subject: [PATCH 0238/3948] =?UTF-8?q?=E6=97=A7ICC=E3=83=AA=E3=83=B3?= =?UTF-8?q?=E3=82=AF=E3=81=8C=E5=88=87=E3=82=8C=E3=81=A6=E3=81=97=E3=81=BE?= =?UTF-8?q?=E3=81=A3=E3=81=9F=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3=20#1122?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 1 + 1 file changed, 1 insertion(+) diff --git a/implementation-status.md b/implementation-status.md index f7dbf79a90..a78a0ddd6f 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -292,6 +292,7 @@ [gcc]: ./implementation.md#gcc [clang]: ./implementation.md#clang +[icc]: ./implementation.md#icc [icx]: ./implementation.md#icc [msvc]: ./implementation.md#visual_cpp From 1e3d056d8a587c92a2ce8f4e6c95c5bbad667fbe Mon Sep 17 00:00:00 2001 From: Akiko Kawai Date: Sat, 18 Mar 2023 10:20:25 +0900 Subject: [PATCH 0239/3948] =?UTF-8?q?Updated=20supported=20c++23=20by=20IC?= =?UTF-8?q?X=20(=EF=BD=9E=20R2201R1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/implementation-status.md b/implementation-status.md index a78a0ddd6f..e813d62bf3 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -246,19 +246,19 @@ | 言語機能 | 説明 | [GCC][gcc] | [Clang][clang] | [ICX][icx] | [MSVC][msvc] | |----------|------|------------|----------------|------------|--------------| -| P0330R8: [(符号付き)`size_t`リテラルのためのサフィックス](/lang/cpp23/literal_suffix_for_signed_size_t.md) | `42z`/`42Z`とすることで`size_t`に対応する符号付き整数型のリテラルとする | 11 | 13 | - | - | +| P0330R8: [(符号付き)`size_t`リテラルのためのサフィックス](/lang/cpp23/literal_suffix_for_signed_size_t.md) | `42z`/`42Z`とすることで`size_t`に対応する符号付き整数型のリテラルとする | 11 | 13 | 2022.2 | - | | P2290R3: [エスケープシーケンスの区切り](/lang/cpp23/delimited_escape_sequences.md.nolink) | エスケープシーケンスの範囲を明確にする構文を追加する | 13 | 15 | - | - | -| P2266R3: [暗黙的なムーブを簡略化](/lang/cpp23/simpler_implicit_move.md.nolink) | 参照を返す関数の`return`文で暗黙的にムーブされない問題を修正 | 13 | 13 | - | - | +| P2266R3: [暗黙的なムーブを簡略化](/lang/cpp23/simpler_implicit_move.md.nolink) | 参照を返す関数の`return`文で暗黙的にムーブされない問題を修正 | 13 | 13 | 2022.2 | - | | P1787R6: [スコープと名前ルックアップの仕様整理](/lang/cpp23/declarations_and_where_to_find_them.md.nolink) | 複雑で不完全になっているスコープと名前ルックアップの仕様を整理し、一部の問題を解決する | - | - | - | - | | P2615R1: [無意味なexport宣言を禁止する](/lang/cpp23/meaningful_exports.md.nolink) | | - | - | - | - | -| P2360R0: [初期化文での型の別名宣言を許可](/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md.nolink) | `for (using T = int; T e : v) {}`を許可 | 12 | 14 | - | - | +| P2360R0: [初期化文での型の別名宣言を許可](/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md.nolink) | `for (using T = int; T e : v) {}`を許可 | 12 | 14 | 2022.2 | - | | P2718R0: [範囲for文が範囲への参照を延命することを規定](lang/cpp23/lifetime_extension_in_range_based_for_loop.md.nolink) | | - | - | - | - | | P2324R2: [関数末尾のラベルを許可](/lang/cpp23/labels_at_the_end_of_compound_statements.md.nolink) | C互換のため、関数末尾でのgoto文のラベルを許可する | 13 | 16 | - | - | | P0847R7: [自身のオブジェクトを明示的にパラメータとして指定する](/lang/cpp23/deducing_this.md.nolink) | メンバ関数が`*this`の型・オブジェクトをパラメータとしてとり、`*this`オブジェクトがconst/非const、左辺値/右辺値であるかをメンバ関数内で識別できるようにする | - | - | - | 2022 Update 2 (partial) | | P1847R4: [アクセス制御の異なるメンバ変数のレイアウトを宣言順に規定](/lang/cpp23/make_declaration_order_layout_mandated.md.nolink) | アクセス制御の異なるメンバ変数のレイアウトが実装によって異なっていたため仕様を規定 | Yes | Yes | - | 2022 | -| P2128R6: [添字演算子の多次元サポート](/lang/cpp23/multidimensional_subscript_operator.nd.nolink) | `operator[](int x, int y, int z)`のように添字演算子のオーバーロードで複数のパラメータをとることを許可 | 12 | 15 | - | - | +| P2128R6: [添字演算子の多次元サポート](/lang/cpp23/multidimensional_subscript_operator.nd.nolink) | `operator[](int x, int y, int z)`のように添字演算子のオーバーロードで複数のパラメータをとることを許可 | 12 | 15 | 2022.2 | - | | P1169R4: [`this`ポインタをもつ必要のない演算子を`static`として宣言できるようにする](/lang/cpp23/static_operator.md.nolink) | | 13 | 16 | - | - | -| P2201R1 : [異なる文字エンコーディングをもつ文字列リテラルの連結を不適格とする](/lang/cpp23/mixed_string_literal_concatenation.md.nolink) | `auto a = u8"" L"";`のような異なる文字エンコーディング同士での文字列リテラルを連結を禁止する | Yes | Yes | Yes | Yes | +| P2201R1 : [異なる文字エンコーディングをもつ文字列リテラルの連結を不適格とする](/lang/cpp23/mixed_string_literal_concatenation.md.nolink) | `auto a = u8"" L"";`のような異なる文字エンコーディング同士での文字列リテラルを連結を禁止する | Yes | Yes | 2022.2 | Yes | | P2029R4: [文字・文字列リテラル中の数値・ユニバーサルキャラクタのエスケープに関する問題解決](/lang/cpp23/numeric_and_universal_character_escapes_in_character_and_string_literals.md.nolink) | | - | - | - | - | | P2362R3: [1ワイド文字に収まらないワイド文字リテラルを禁止する](/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md.nolink) | エンコード結果として`wchar_t`の大きさに収まらないワイド文字リテラルを禁止する | 13 | 14 | - | - | | P2071R2: [名前付きユニバーサルキャラクタ名](/lang/cpp23/named_universal_character_escapes.md.nolink) | 16進数のユニバーサルキャラクタだけでなく、その文字の名前を入力できるようにする | 13 | 15 | - | - | From 59b877334be838338599f1faf067686365e5e643 Mon Sep 17 00:00:00 2001 From: suomesta Date: Mon, 20 Mar 2023 22:54:31 +0900 Subject: [PATCH 0240/3948] fix that notes on correct place --- reference/bitset/bitset/op_equal.md | 4 ++++ reference/bitset/bitset/op_not_equal.md | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/bitset/bitset/op_equal.md b/reference/bitset/bitset/op_equal.md index d8574f78d1..675ed0c7b4 100644 --- a/reference/bitset/bitset/op_equal.md +++ b/reference/bitset/bitset/op_equal.md @@ -22,6 +22,10 @@ constexpr bool operator==(const bitset& rhs) const noexcept; // (1) C++23 投げない。 +## 備考 +- この演算子により、`operator!=`が使用可能になる (C++20) + + ## 例 ```cpp example #include diff --git a/reference/bitset/bitset/op_not_equal.md b/reference/bitset/bitset/op_not_equal.md index c2b8e152fc..df548f1c57 100644 --- a/reference/bitset/bitset/op_not_equal.md +++ b/reference/bitset/bitset/op_not_equal.md @@ -23,10 +23,6 @@ constexpr bool operator!=(const bitset& rhs) const noexcept; // (1) C++23 投げない。 -## 備考 -- この演算子により、`operator!=`が使用可能になる (C++20) - - ## 例 ```cpp example #include From 6f006553cc2a92f9293a75abe9bd887b175acf0c Mon Sep 17 00:00:00 2001 From: suomesta Date: Mon, 20 Mar 2023 23:00:21 +0900 Subject: [PATCH 0241/3948] fix some typo in ranges sample --- reference/ranges/cdata.md | 9 +++------ reference/ranges/cend.md | 4 ++-- reference/ranges/data.md | 9 +++------ 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/reference/ranges/cdata.md b/reference/ranges/cdata.md index cb9b063b9c..34ca0ed789 100644 --- a/reference/ranges/cdata.md +++ b/reference/ranges/cdata.md @@ -52,13 +52,10 @@ int main() * std::ranges::cdata[color ff0000] * std::ranges::size[link size.md] -### 出力 +### 出力例 ``` -false -false -true -false -false +array size:4 at 0x7fffb1ad5d70 +array size:1 at 0x556ec23ba2b0 ``` ## バージョン diff --git a/reference/ranges/cend.md b/reference/ranges/cend.md index 8d2f4f8d0b..355272484f 100644 --- a/reference/ranges/cend.md +++ b/reference/ranges/cend.md @@ -49,8 +49,8 @@ int main() }); } ``` -* std::ranges::cbegin[color ff0000] -* std::ranges::cend[link cend.md] +* std::ranges::cbegin[link cbegin.md] +* std::ranges::cend[color ff0000] ### 出力 ``` diff --git a/reference/ranges/data.md b/reference/ranges/data.md index 0bcc3bb1c2..f46a4ee852 100644 --- a/reference/ranges/data.md +++ b/reference/ranges/data.md @@ -56,13 +56,10 @@ int main() * std::ranges::data[color ff0000] * std::ranges::size[link size.md] -### 出力 +### 出力例 ``` -false -false -true -false -false +array size:4 at 0x7fff28ab1c50 +array size:1 at 0x5596494f02b0 ``` ## バージョン From b8525072e38f2979a23b1ba259719a937b0e7e0d Mon Sep 17 00:00:00 2001 From: suomesta Date: Mon, 20 Mar 2023 23:02:50 +0900 Subject: [PATCH 0242/3948] remove unnecessaly characters --- reference/optional/optional/op_compare_3way.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/optional/optional/op_compare_3way.md b/reference/optional/optional/op_compare_3way.md index a29b526669..139816117f 100644 --- a/reference/optional/optional/op_compare_3way.md +++ b/reference/optional/optional/op_compare_3way.md @@ -35,7 +35,7 @@ namespace std { - (2) : ```cpp - ```return bool(x) <=> false;` + return bool(x) <=> false; ``` - (3) : 以下と等価 From 3e88af561b8b1f5803fbf49d43ea6e188fd1eb4c Mon Sep 17 00:00:00 2001 From: suomesta Date: Mon, 20 Mar 2023 23:05:47 +0900 Subject: [PATCH 0243/3948] fix again samples of std::set --- reference/set/set/count.md | 4 ++-- reference/set/set/lower_bound.md | 2 -- reference/set/set/upper_bound.md | 2 -- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/reference/set/set/count.md b/reference/set/set/count.md index a9aae4791d..69e0cc7001 100644 --- a/reference/set/set/count.md +++ b/reference/set/set/count.md @@ -67,8 +67,8 @@ int main() ### 出力 ``` -2 -2 +1 +1 ``` ## 関連項目 diff --git a/reference/set/set/lower_bound.md b/reference/set/set/lower_bound.md index b02867c4a2..6c5bc0c927 100644 --- a/reference/set/set/lower_bound.md +++ b/reference/set/set/lower_bound.md @@ -87,11 +87,9 @@ int main() ### 出力 ``` B -B C D -B B C D diff --git a/reference/set/set/upper_bound.md b/reference/set/set/upper_bound.md index 5e2feb56b1..6e4dad3e06 100644 --- a/reference/set/set/upper_bound.md +++ b/reference/set/set/upper_bound.md @@ -87,11 +87,9 @@ int main() ### 出力 ``` B -B C D -B B C D From 283ec8d963da7202ba54e1f14abdb66b1a0a34f3 Mon Sep 17 00:00:00 2001 From: suomesta Date: Mon, 20 Mar 2023 23:13:02 +0900 Subject: [PATCH 0244/3948] fix some versioning --- reference/array/array/rbegin.md | 2 +- reference/bitset/bitset/op_at.md | 3 +-- reference/string/basic_string/compare.md | 2 +- reference/string/basic_string/op_plus_assign.md | 2 +- reference/vector/vector/back.md | 4 ++-- reference/vector/vector/resize.md | 2 +- 6 files changed, 7 insertions(+), 8 deletions(-) diff --git a/reference/array/array/rbegin.md b/reference/array/array/rbegin.md index 77c2b18acf..ab54a7b75d 100644 --- a/reference/array/array/rbegin.md +++ b/reference/array/array/rbegin.md @@ -7,7 +7,7 @@ ```cpp reverse_iterator rbegin() noexcept; // (1) C++11 -constexpr reverse_iterator rbegin() noexcept; // (1) C++11 +constexpr reverse_iterator rbegin() noexcept; // (1) C++17 const_reverse_iterator rbegin() const noexcept; // (2) C++11 constexpr const_reverse_iterator rbegin() const noexcept; // (2) C++17 diff --git a/reference/bitset/bitset/op_at.md b/reference/bitset/bitset/op_at.md index e5ee01c9d6..8d9b77c01a 100644 --- a/reference/bitset/bitset/op_at.md +++ b/reference/bitset/bitset/op_at.md @@ -6,8 +6,7 @@ ```cpp bool operator[](size_t pos) const; // (1) C++03 -constexpr bool operator[](size_t pos); // (1) C++11 -constexpr bool operator[](size_t pos) const; // (1) C++14 +constexpr bool operator[](size_t pos) const; // (1) C++11 reference operator[](size_t pos); // (2) C++03 constexpr reference operator[](size_t pos); // (2) C++23 diff --git a/reference/string/basic_string/compare.md b/reference/string/basic_string/compare.md index 0b0edf7b66..d3240d4c36 100644 --- a/reference/string/basic_string/compare.md +++ b/reference/string/basic_string/compare.md @@ -38,7 +38,7 @@ constexpr int size_type n2 = npos) const; // (3) C++20 int compare(const charT* s) const; // (4) C++03 -constexpr int compare(const charT* s) const; // (4) C++03 +constexpr int compare(const charT* s) const; // (4) C++20 int compare(size_type pos1, diff --git a/reference/string/basic_string/op_plus_assign.md b/reference/string/basic_string/op_plus_assign.md index 898c797826..7f5dbb1ff5 100644 --- a/reference/string/basic_string/op_plus_assign.md +++ b/reference/string/basic_string/op_plus_assign.md @@ -12,7 +12,7 @@ basic_string& operator+=(const charT* s); // (2) C++03 constexpr basic_string& operator+=(const charT* s); // (2) C++20 basic_string& operator+=(charT c); // (3) C++03 -constexpr basic_string& operator+=(charT c); // (3) C++03 +constexpr basic_string& operator+=(charT c); // (3) C++20 basic_string& operator+=(initializer_list il); // (4) C++11 constexpr basic_string& operator+=(initializer_list il); // (4) C++20 diff --git a/reference/vector/vector/back.md b/reference/vector/vector/back.md index 54c5b4f6d7..1bb42f8e2b 100644 --- a/reference/vector/vector/back.md +++ b/reference/vector/vector/back.md @@ -6,10 +6,10 @@ ```cpp reference back(); // (1) C++03 -constexpr reference back(); // (1) C++03 +constexpr reference back(); // (1) C++20 const_reference back() const; // (2) C++03 -constexpr const_reference back() const; // (2) C++03 +constexpr const_reference back() const; // (2) C++20 ``` ## 概要 diff --git a/reference/vector/vector/resize.md b/reference/vector/vector/resize.md index b9f19ccc9a..5a6d19c4da 100644 --- a/reference/vector/vector/resize.md +++ b/reference/vector/vector/resize.md @@ -9,7 +9,7 @@ void resize(size_type sz); // (1) C++11 constexpr void resize(size_type sz); // (1) C++20 void resize(size_type sz, const T& c); // (2) C++11 -constexpr void resize(size_type sz, const T& c); // (2) C++11 +constexpr void resize(size_type sz, const T& c); // (2) C++20 void resize(size_type sz, T c = T()); // (1) + (2) C++03 ``` From e4e068d317be054bde4480e0dafa521104707c14 Mon Sep 17 00:00:00 2001 From: suomesta Date: Mon, 20 Mar 2023 23:31:57 +0900 Subject: [PATCH 0245/3948] fix noexcept description in std::string --- reference/string/basic_string/compare.md | 3 ++- reference/string/basic_string/empty.md | 3 ++- reference/string/basic_string/op_greater.md | 4 ++-- reference/string/basic_string/op_greater_equal.md | 4 ++-- reference/string/basic_string/op_less.md | 4 ++-- reference/string/basic_string/op_less_equal.md | 4 ++-- 6 files changed, 12 insertions(+), 10 deletions(-) diff --git a/reference/string/basic_string/compare.md b/reference/string/basic_string/compare.md index d3240d4c36..4e65ba6d22 100644 --- a/reference/string/basic_string/compare.md +++ b/reference/string/basic_string/compare.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -int compare(const basic_string& str) const noexcept; // (1) C++03 +int compare(const basic_string& str) const; // (1) C++03 +int compare(const basic_string& str) const noexcept; // (1) C++11 constexpr int compare(const basic_string& str) const noexcept; // (1) C++20 diff --git a/reference/string/basic_string/empty.md b/reference/string/basic_string/empty.md index 5432d75921..0ead8e0bf1 100644 --- a/reference/string/basic_string/empty.md +++ b/reference/string/basic_string/empty.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -bool empty() const noexcept; // C++03 +bool empty() const; // C++03 +bool empty() const noexcept; // C++11 [[nodiscard]] constexpr bool empty() const noexcept; // C++20 ``` diff --git a/reference/string/basic_string/op_greater.md b/reference/string/basic_string/op_greater.md index d2b484b7df..fecd2374ef 100644 --- a/reference/string/basic_string/op_greater.md +++ b/reference/string/basic_string/op_greater.md @@ -31,11 +31,11 @@ namespace std { template bool operator>(const basic_string& a, - const CharT* rhs) noexcept; // (3) C++03 + const CharT* rhs); // (3) C++03 template constexpr bool operator>(const basic_string& a, - const CharT* rhs) noexcept; // (3) C++20 + const CharT* rhs); // (3) C++20 } ``` diff --git a/reference/string/basic_string/op_greater_equal.md b/reference/string/basic_string/op_greater_equal.md index c1dd0d0cfe..0ecd461d33 100644 --- a/reference/string/basic_string/op_greater_equal.md +++ b/reference/string/basic_string/op_greater_equal.md @@ -31,11 +31,11 @@ namespace std { template bool operator>=(const basic_string& a, - const CharT* rhs) noexcept; // (3) C++03 + const CharT* rhs); // (3) C++03 template constexpr bool operator>=(const basic_string& a, - const CharT* rhs) noexcept; // (3) C++20 + const CharT* rhs); // (3) C++20 } ``` diff --git a/reference/string/basic_string/op_less.md b/reference/string/basic_string/op_less.md index 3ac1796857..5d7438d1c8 100644 --- a/reference/string/basic_string/op_less.md +++ b/reference/string/basic_string/op_less.md @@ -31,11 +31,11 @@ namespace std { template bool operator<(const basic_string& a, - const CharT* rhs) noexcept; // (3) C++03 + const CharT* rhs); // (3) C++03 template constexpr bool operator<(const basic_string& a, - const CharT* rhs) noexcept; // (3) C++20 + const CharT* rhs); // (3) C++20 } ``` diff --git a/reference/string/basic_string/op_less_equal.md b/reference/string/basic_string/op_less_equal.md index 107357465e..29a7962b59 100644 --- a/reference/string/basic_string/op_less_equal.md +++ b/reference/string/basic_string/op_less_equal.md @@ -31,11 +31,11 @@ namespace std { template bool operator<=(const basic_string& a, - const CharT* rhs) noexcept; // (3) C++03 + const CharT* rhs); // (3) C++03 template constexpr bool operator<=(const basic_string& a, - const CharT* rhs) noexcept; // (3) C++20 + const CharT* rhs); // (3) C++20 } ``` From b30e6fd541461db3e42e8e62566af794628077fa Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 22 Mar 2023 12:27:12 +0900 Subject: [PATCH 0246/3948] =?UTF-8?q?Clang=2016=E3=81=A7C++17=E3=81=8C?= =?UTF-8?q?=E3=83=87=E3=83=95=E3=82=A9=E3=83=AB=E3=83=88=E3=81=AB=E3=81=AA?= =?UTF-8?q?=E3=81=A3=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://releases.llvm.org/16.0.0/tools/clang/docs/ReleaseNotes.html --- implementation.md | 1 + 1 file changed, 1 insertion(+) diff --git a/implementation.md b/implementation.md index 0a116ece67..6d561183c2 100644 --- a/implementation.md +++ b/implementation.md @@ -35,6 +35,7 @@ - GNU拡張を有効にする`-std=gnu++1z`オプションもある。 - Clang 5.0以降は、`-std=c++17`オプションを使用する(以前までのオプションも使用できる)。 - GNU拡張を有効にする`-std=gnu++17`オプションもある。 +- Clang 16.0以降はC++17がデフォルトとなる。デフォルトバージョンのコンパイルオプションは`-std=gnu++17` ### C++20の機能を有効にする - Clang 6.0以降は、`-std=c++2a`オプションを使用する。 From 5ae96e7b57f2e93aafb913a4c658faa229325091 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 22 Mar 2023 15:11:06 +0900 Subject: [PATCH 0247/3948] =?UTF-8?q?=E3=83=88=E3=83=83=E3=83=97=E3=83=9A?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=81=AB=E3=80=81=E3=82=B9=E3=83=9D=E3=83=B3?= =?UTF-8?q?=E3=82=B5=E3=83=BC=E3=82=B7=E3=83=83=E3=83=97=E3=81=AB=E3=81=A4?= =?UTF-8?q?=E3=81=84=E3=81=A6=E6=8E=B2=E8=BC=89=20#1116?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/index.md b/index.md index 92cbc654dc..48c6a135f0 100644 --- a/index.md +++ b/index.md @@ -13,6 +13,15 @@ 本サイトでは、他サイトおよび規格書の直接的な翻訳ではなく、編集者の調査と考えに基づいた解説を提供していきます。 +## スポンサーシップ + +- [cpprefjp - Open Collective](https://opencollective.com/cpprefjp) + +このプロジェクトは、持続的な活動のため、ユーザーの方々からのご支援をお待ちしております。上記Open Collectiveのプロジェクトでスポンサーシップの募集をしております。 + +ご支援いただくユーザーの方々は、本ページ (cpprefjpサイトのトップページ) に、金額順でロゴを表示させていただきます。ご支援いただいた資金は、貢献度に応じてコントリビューターに分配させていただきます。 + + ## 参加方法 本サイトは、多くのユーザの手によって書かれています。 From 0af0c3caadb5b187475d04a5ecb886a970376506 Mon Sep 17 00:00:00 2001 From: norisio Date: Wed, 22 Mar 2023 15:46:44 +0900 Subject: [PATCH 0248/3948] =?UTF-8?q?allocator.md=20backquote=E3=81=AEtypo?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/memory/allocator.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/memory/allocator.md b/reference/memory/allocator.md index 6f40c0fce1..d544395168 100644 --- a/reference/memory/allocator.md +++ b/reference/memory/allocator.md @@ -41,7 +41,7 @@ C++11から: |---------------------------------------------|----------------------------------------------|-------| | [`(constructor)`](allocator/op_constructor.md) | コンストラクタ | | | [`(destructor)`](allocator/op_destructor.md) | デストラクタ | | -| [`operator=`](allocator/op_assign.md)` | 代入演算子 | | +| [`operator=`](allocator/op_assign.md) | 代入演算子 | | | [`allocate`](allocator/allocate.md) | メモリを確保する | | | [`deallocate`](allocator/deallocate.md) | メモリを解放する | | | [`address`](allocator/address.md) | 変数のアドレスを取得する | C++17から非推奨
C++20で削除 | From fd8b500a0632722667b1db10070fea4ab2771ec2 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Thu, 23 Mar 2023 11:21:17 +0900 Subject: [PATCH 0249/3948] =?UTF-8?q?unordered=5Fmap::insert=5For=5Fassign?= =?UTF-8?q?()=20:=20=E5=BE=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/unordered_map/unordered_map/insert_or_assign.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/unordered_map/unordered_map/insert_or_assign.md b/reference/unordered_map/unordered_map/insert_or_assign.md index 43e6811878..eba286a23b 100644 --- a/reference/unordered_map/unordered_map/insert_or_assign.md +++ b/reference/unordered_map/unordered_map/insert_or_assign.md @@ -21,7 +21,7 @@ iterator insert_or_assign(const_iterator hint, key_type&& k, M&& obj); * pair[link /reference/utility/pair.md] ## 概要 -引数 `k` で指定されたキーが存在しなければ対応する値を引数 `obj` の値として要素を挿入し(`insert`)、さもなければ(`or`)、そのキーに対応する値に引数 `obj` を代入する(`assign`)。 +引数 `k` で指定されたキーが存在しなければ対応する値を引数 `obj` のキーとして要素を挿入し(`insert`)、さもなければ(`or`)、そのキーに対応する値に引数 `obj` を代入する(`assign`)。 引数 `hint` は、`k` を検索する際のヒントに使用される。(が、実際に使用されることはないものと思われる。[`emplace_hint`](emplace_hint.md) の備考を参照) From ec2e4d073819ab587b8697b938e3935a06ba00e7 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sat, 25 Mar 2023 13:05:26 +0900 Subject: [PATCH 0250/3948] =?UTF-8?q?=E3=83=88=E3=83=83=E3=83=97=E3=83=9A?= =?UTF-8?q?=E3=83=BC=E3=82=B8=20:=20Acerola=20Software=E7=A4=BE=E6=A7=98?= =?UTF-8?q?=E3=81=AE=E3=83=AD=E3=82=B4=E3=82=92=E8=A1=A8=E7=A4=BA=20#1116?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/index.md b/index.md index 48c6a135f0..4d388fc91b 100644 --- a/index.md +++ b/index.md @@ -63,6 +63,16 @@ cpprefjp プロジェクトに参加する方法は簡単です。 - [Standard Template Library プログラミング on the Web](https://web.archive.org/web/20190112041213/http://episteme.wankuma.com/stlprog/index.html) +## スポンサー +cpprefjpプロジェクトは、以下の方々にスポンサーになっていただいております。 + +Acerola Software + +スポンサーシップについては、以下のページを参照ください。 + +- [cpprefjp - Open Collective](https://opencollective.com/cpprefjp) + + ## プライバシーポリシー 本サイトは、サイトの改善のためにGoogleアナリティクスを使用しています。本サイトをご利用中のブラウザは、Googleに特定の情報を自動的に送信します。本サイトは、この分析のためにCookieを使用します。利用者は、本サイトを利用することで、この目的においてCookieを使用することを許可したものとみなします。 From f578c301efb8a61c8315cba9d085440e6847028b Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sat, 25 Mar 2023 13:15:35 +0900 Subject: [PATCH 0251/3948] fix close tag --- index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.md b/index.md index 4d388fc91b..5c34eec219 100644 --- a/index.md +++ b/index.md @@ -66,7 +66,7 @@ cpprefjp プロジェクトに参加する方法は簡単です。 ## スポンサー cpprefjpプロジェクトは、以下の方々にスポンサーになっていただいております。 -Acerola Software +Acerola Software スポンサーシップについては、以下のページを参照ください。 From ee14b2abd0629a65e1a1c7439e153d882bd4dda0 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sat, 25 Mar 2023 13:25:30 +0900 Subject: [PATCH 0252/3948] fix sponsor logo --- index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.md b/index.md index 5c34eec219..5221fe7f74 100644 --- a/index.md +++ b/index.md @@ -66,7 +66,7 @@ cpprefjp プロジェクトに参加する方法は簡単です。 ## スポンサー cpprefjpプロジェクトは、以下の方々にスポンサーになっていただいております。 -Acerola Software +

Acerola Software
スポンサーシップについては、以下のページを参照ください。 From b42afef66438a15b6676484c6ec372f2a3d67482 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 27 Mar 2023 18:44:08 +0900 Subject: [PATCH 0253/3948] =?UTF-8?q?=E3=82=B9=E3=83=9D=E3=83=B3=E3=82=B5?= =?UTF-8?q?=E3=83=BC=E3=83=AD=E3=82=B4=20:=20=E3=82=B9=E3=83=9E=E3=83=9B?= =?UTF-8?q?=E3=81=A7=E6=A8=AA=E3=82=B9=E3=82=AF=E3=83=AD=E3=83=BC=E3=83=AB?= =?UTF-8?q?=E3=81=8C=E5=BF=85=E8=A6=81=E3=81=AA=E3=81=84=E3=82=88=E3=81=86?= =?UTF-8?q?=E6=9C=80=E5=A4=A7=E5=B9=85=E3=82=92=E8=A8=AD=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.md b/index.md index 5221fe7f74..eb58faa1e7 100644 --- a/index.md +++ b/index.md @@ -66,7 +66,7 @@ cpprefjp プロジェクトに参加する方法は簡単です。 ## スポンサー cpprefjpプロジェクトは、以下の方々にスポンサーになっていただいております。 -
Acerola Software
+
Acerola Software
スポンサーシップについては、以下のページを参照ください。 From 6c6acb89e820b695525a06025bb4b2f028604482 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 27 Mar 2023 19:30:25 +0900 Subject: [PATCH 0254/3948] =?UTF-8?q?=E3=82=B9=E3=83=9D=E3=83=B3=E3=82=B5?= =?UTF-8?q?=E3=83=BC=E3=83=AD=E3=82=B4=20:=20max-width=E3=81=AFCSS?= =?UTF-8?q?=E3=81=A7=E8=A8=AD=E5=AE=9A=E3=81=97=E3=81=9F=E3=81=AE=E3=81=A7?= =?UTF-8?q?=E3=81=93=E3=81=A1=E3=82=89=E3=81=A7=E3=81=AE=E8=A8=AD=E5=AE=9A?= =?UTF-8?q?=E3=81=AF=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.md b/index.md index eb58faa1e7..5221fe7f74 100644 --- a/index.md +++ b/index.md @@ -66,7 +66,7 @@ cpprefjp プロジェクトに参加する方法は簡単です。 ## スポンサー cpprefjpプロジェクトは、以下の方々にスポンサーになっていただいております。 -
Acerola Software
+
Acerola Software
スポンサーシップについては、以下のページを参照ください。 From 51b9443a4f04cbe929cd6d839db6bbc8c08d5097 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 29 Mar 2023 14:12:48 +0900 Subject: [PATCH 0255/3948] =?UTF-8?q?=E3=83=88=E3=83=83=E3=83=97=E3=83=9A?= =?UTF-8?q?=E3=83=BC=E3=82=B8=20:=20Fixstars=E7=A4=BE=E6=A7=98=E3=81=AE?= =?UTF-8?q?=E3=83=AD=E3=82=B4=E3=82=92=E8=A1=A8=E7=A4=BA=20#1116?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.md b/index.md index 5221fe7f74..6323a276f0 100644 --- a/index.md +++ b/index.md @@ -66,6 +66,8 @@ cpprefjp プロジェクトに参加する方法は簡単です。 ## スポンサー cpprefjpプロジェクトは、以下の方々にスポンサーになっていただいております。 +
Fixstars
+
Acerola Software
スポンサーシップについては、以下のページを参照ください。 From 163df869ce0e8c97cb11c2c13363578a0801dc78 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 29 Mar 2023 16:06:08 +0900 Subject: [PATCH 0256/3948] =?UTF-8?q?=E3=83=88=E3=83=83=E3=83=97=E3=83=9A?= =?UTF-8?q?=E3=83=BC=E3=82=B8=20:=20=E6=94=AF=E6=8F=B4=E9=87=91=E9=A1=8D?= =?UTF-8?q?=E3=81=8C=E5=90=8C=E3=81=98=E5=A0=B4=E5=90=88=E3=81=AF=E7=99=BB?= =?UTF-8?q?=E9=8C=B2=E9=A0=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.md b/index.md index 6323a276f0..4b1ffb1d74 100644 --- a/index.md +++ b/index.md @@ -19,7 +19,7 @@ このプロジェクトは、持続的な活動のため、ユーザーの方々からのご支援をお待ちしております。上記Open Collectiveのプロジェクトでスポンサーシップの募集をしております。 -ご支援いただくユーザーの方々は、本ページ (cpprefjpサイトのトップページ) に、金額順でロゴを表示させていただきます。ご支援いただいた資金は、貢献度に応じてコントリビューターに分配させていただきます。 +ご支援いただくユーザーの方々は、本ページ (cpprefjpサイトのトップページ) に、金額順でロゴを表示させていただきます (金額が同じ場合は登録順)。ご支援いただいた資金は、貢献度に応じてコントリビューターに分配させていただきます。 ## 参加方法 From 833f22bde02b45e122bd746d52c58f223ef4f81f Mon Sep 17 00:00:00 2001 From: kamitani08 <48343709+kamitani08@users.noreply.github.com> Date: Wed, 29 Mar 2023 23:09:06 +0900 Subject: [PATCH 0257/3948] Update guaranteed_copy_elision.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit タイポ修正 最適化されない場合はコピーコントラクタの前にムーブコンストラクタを実行しようとします。 参考: https://timsong-cpp.github.io/cppwp/n4861/class.copy.elision#3 引用元も「最適化が無効な場合は、ムーブコンストラクタが呼ばれます。」となっていたため誤字と判断しました。 https://ja.cppreference.com/w/cpp/language/copy_elision --- lang/cpp17/guaranteed_copy_elision.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp17/guaranteed_copy_elision.md b/lang/cpp17/guaranteed_copy_elision.md index 286b3a4361..620afa4ed2 100644 --- a/lang/cpp17/guaranteed_copy_elision.md +++ b/lang/cpp17/guaranteed_copy_elision.md @@ -60,7 +60,7 @@ struct Noisy { std::vector f() { std::vector v = std::vector(3); // v 初期化時、コピーは省略される return v; // NRVO は、C++17でも保証されない -} // 最適化されない場合、コピーコンストラクタがよばれる +} // 最適化されない場合、ムーブコンストラクタがよばれる void g(std::vector arg) { std::cout << "arg.size() = " << arg.size() << '\n'; From 363b7385c4de72f884beb642a6bf79279a8a7a04 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Thu, 30 Mar 2023 15:56:52 +0900 Subject: [PATCH 0258/3948] =?UTF-8?q?split=5Fview=20:=20=E8=AA=AC=E6=98=8E?= =?UTF-8?q?=E3=81=AE=E6=94=B9=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/split_view.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/reference/ranges/split_view.md b/reference/ranges/split_view.md index 389e68be03..488812bdc3 100644 --- a/reference/ranges/split_view.md +++ b/reference/ranges/split_view.md @@ -26,10 +26,14 @@ namespace std::ranges { ## 概要 -- (1): [`forward_range`](forward_range.md)を要素、または要素の[`view`](view.md)からなるパターンをデリミタとして分割し、それぞれの部分Rangeを要素とする新たなRangeとして扱う[`view`](view.md) +指定した区切り文字(デリミタ)によって、入力文字範囲の分割を行うRangeアダプタ。 + +- (1): 入力の文字範囲を、その要素型の文字または文字列からなるパターンをデリミタとして分割し、切り出した文字列(部分Range)を要素とする新たなRangeに変換する[`view`](view.md) - (2): `split_view`を生成するRangeアダプタオブジェクト -### Rangeコンセプト +入力範囲`V`もデリミタ`Pattern`も共に[`forward_range`](forward_range.md)(かつ`view`)であることしか求められていないため、実際には文字列の分割に限らず、任意の`forward_range`を`forward_range`によって表現されるパターンによって分割することができる。 + +### Rangeコンセプト(`split_view`そのもの) | borrowed | sized | output | input | forward | bidirectional | random_access | contiguous | common | viewable | view | |----------|-------|--------|-------|---------|---------------|---------------|------------|--------|----------|------| @@ -37,7 +41,7 @@ namespace std::ranges { - (1): `V`が[`common_range`](common_range.md)のとき -### Rangeコンセプト (各部分Range) +### Rangeコンセプト (`split_view`の要素である、切り出した部分文字列を示す各部分Range) | borrowed | sized | output | input | forward | bidirectional | random_access | contiguous | common | viewable | view | |----------|-------|--------|-------|---------|---------------|---------------|------------|--------|----------|------| From f9f1c46d5b971891ef2779d943543493e7d49b4a Mon Sep 17 00:00:00 2001 From: suomesta Date: Fri, 31 Mar 2023 22:05:15 +0900 Subject: [PATCH 0259/3948] fix some typo --- reference/bit/rotr.md | 2 +- reference/format/format_kind.md | 2 +- reference/ios/io_errc.md | 2 +- reference/string/char_traits/to_int_type.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/bit/rotr.md b/reference/bit/rotr.md index 91d92fbd0a..c6b572442d 100644 --- a/reference/bit/rotr.md +++ b/reference/bit/rotr.md @@ -26,7 +26,7 @@ namespace std { - `r`が0である場合は`x`が返る - `r`が正である場合は`(x >> r) | (x << (N - r))`が返る -- `r`が負である場合は[`rotl`](rotr.md)`(x, -r)`が返る +- `r`が負である場合は[`rotl`](rotl.md)`(x, -r)`が返る ## 例外 diff --git a/reference/format/format_kind.md b/reference/format/format_kind.md index 95cc449730..3e11e64718 100644 --- a/reference/format/format_kind.md +++ b/reference/format/format_kind.md @@ -57,7 +57,7 @@ Rangeの書式種別を取得する変数テンプレート。 ## 関連項目 -- [`format_kind`](range_format.md) +- [`range_format`](range_format.md) - [`formatter`](formatter.md) diff --git a/reference/ios/io_errc.md b/reference/ios/io_errc.md index 896c3b148b..232097925e 100644 --- a/reference/ios/io_errc.md +++ b/reference/ios/io_errc.md @@ -15,7 +15,7 @@ namespace std { ## 概要 入出力操作に関するエラーの種別を表す列挙型。エラーのカテゴリは [`iostream_category`](iostream_category.md)`()` で取得できる。 [`is_error_code_enum`](is_error_code_enum.md) の特殊化がされていることからわかるように、本列挙型は [`error_code`](../system_error/error_code.md) として使うことを意図しており、暗黙的に [`error_code`](../system_error/error_code.md) への変換が可能である。 -なお、[`is_error_condition_enum`](../system_error/is_error_condition_enum.md) の特殊化はされていないため、本列挙型から [`error_condition`](../system_error/error_condition.md) に暗黙的に変換する事は出来ないが、[`make_eror_condtion`](make_error_condition.md)`()` の呼び出し、および、一旦 [`error_code`](../system_error/error_code.md) に変換してから [`error_code`](../system_error/error_code.md)`::`[`default_error_condition`](../system_error/error_code/default_error_condition.md) を使用して変換する、などが可能である。 +なお、[`is_error_condition_enum`](../system_error/is_error_condition_enum.md) の特殊化はされていないため、本列挙型から [`error_condition`](../system_error/error_condition.md) に暗黙的に変換する事は出来ないが、[`make_eror_condition`](make_error_condition.md)`()` の呼び出し、および、一旦 [`error_code`](../system_error/error_code.md) に変換してから [`error_code`](../system_error/error_code.md)`::`[`default_error_condition`](../system_error/error_code/default_error_condition.md) を使用して変換する、などが可能である。 列挙値は唯一 `stream` のみが定義されている。 diff --git a/reference/string/char_traits/to_int_type.md b/reference/string/char_traits/to_int_type.md index fc2960e48b..1c8285f225 100644 --- a/reference/string/char_traits/to_int_type.md +++ b/reference/string/char_traits/to_int_type.md @@ -14,7 +14,7 @@ static constexpr int_type to_int_type(char_type c) noexcept; // C++11 ## 戻り値 -[`to_int_type`](to_int_type.md)と[`eq_int_type`](eq_int_type.md)の定義によって制約される文字`e`を返す。 +[`to_char_type`](to_char_type.md)と[`eq_int_type`](eq_int_type.md)の定義によって制約される文字`e`を返す。 ## 計算量 From 901910765b0e8046402e73880aeb25a1d0755a5b Mon Sep 17 00:00:00 2001 From: suomesta Date: Fri, 31 Mar 2023 22:11:26 +0900 Subject: [PATCH 0260/3948] remove relation item linking to own page --- reference/unordered_map/unordered_map/insert_or_assign.md | 1 - reference/unordered_map/unordered_map/max_load_factor.md | 1 - reference/unordered_map/unordered_multimap/max_load_factor.md | 1 - 3 files changed, 3 deletions(-) diff --git a/reference/unordered_map/unordered_map/insert_or_assign.md b/reference/unordered_map/unordered_map/insert_or_assign.md index eba286a23b..c5b85144bc 100644 --- a/reference/unordered_map/unordered_map/insert_or_assign.md +++ b/reference/unordered_map/unordered_map/insert_or_assign.md @@ -128,7 +128,6 @@ key = two, value = 42, is inserted = false, is empty = true | [`emplace`](emplace.md) | コンテナ内への要素の直接構築 | | [`emplace_hint`](emplace_hint.md) | 挿入位置のヒントを使用したコンテナ内への要素の直接構築 | | [`insert`](insert.md) | 要素の追加 | -| [`insert_or_assign`](insert_or_assign.md) | 要素の追加、あるいは代入 | | [`erase`](erase.md) | 要素の削除 | | [`clear`](clear.md) | 全要素の削除 | | [`swap`](swap.md) | 内容の交換 | diff --git a/reference/unordered_map/unordered_map/max_load_factor.md b/reference/unordered_map/unordered_map/max_load_factor.md index 44a1baff85..963acb82bc 100644 --- a/reference/unordered_map/unordered_map/max_load_factor.md +++ b/reference/unordered_map/unordered_map/max_load_factor.md @@ -139,6 +139,5 @@ new load_factor: 1.125 | [`emplace`](emplace.md) | コンテナ内への要素の直接構築 | | [`size`](size.md) | 要素数の取得 | | [`bucket_count`](bucket_count.md) | バケット数の取得 | -| [`max_load_factor`](max_load_factor.md) | 負荷率の最大値を取得、設定 | | [`clear`](clear.md) | 全要素の削除 | diff --git a/reference/unordered_map/unordered_multimap/max_load_factor.md b/reference/unordered_map/unordered_multimap/max_load_factor.md index c559fb1e75..60062f45e9 100644 --- a/reference/unordered_map/unordered_multimap/max_load_factor.md +++ b/reference/unordered_map/unordered_multimap/max_load_factor.md @@ -141,6 +141,5 @@ new load_factor: 1.125 | [`emplace`](emplace.md) | コンテナ内への要素の直接構築 | | [`size`](size.md) | 要素数の取得 | | [`bucket_count`](bucket_count.md) | バケット数の取得 | -| [`max_load_factor`](max_load_factor.md) | 負荷率の最大値を取得、設定 | | [`clear`](clear.md) | 全要素の削除 | From 9365d56a456376b0f98c7d54af3391da78412617 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sat, 1 Apr 2023 01:45:06 +0900 Subject: [PATCH 0261/3948] remove link to own page --- reference/stop_token/stop_token/stop_possible.md | 4 ++-- reference/stop_token/stop_token/stop_requested.md | 4 ++-- reference/string_view/basic_string_view/begin.md | 2 +- reference/string_view/basic_string_view/cbegin.md | 2 +- reference/type_traits/integral_constant.md | 2 +- reference/unordered_map/unordered_map/load_factor.md | 2 +- reference/unordered_map/unordered_map/max_load_factor.md | 8 ++++---- reference/unordered_map/unordered_multimap/load_factor.md | 2 +- .../unordered_map/unordered_multimap/max_load_factor.md | 8 ++++---- reference/utility/pair.md | 4 ++-- reference/valarray/valarray.md | 2 +- 11 files changed, 20 insertions(+), 20 deletions(-) diff --git a/reference/stop_token/stop_token/stop_possible.md b/reference/stop_token/stop_token/stop_possible.md index bf7a1da6c0..bc6ed3e434 100644 --- a/reference/stop_token/stop_token/stop_possible.md +++ b/reference/stop_token/stop_token/stop_possible.md @@ -25,7 +25,7 @@ 投げない。 ## 備考 -一度[`stop_requested()`](stop_requested.md) `==` `true`となった[`stop_token`](../stop_token.md)は、自身と停止状態を共有する[`stop_source`](../stop_source.md)が破棄されても[`stop_requested()`](stop_requested.md) `==` `true`かつ[`stop_possible()`](stop_possible.md) `==` `true`の状態のままになる。 +一度[`stop_requested()`](stop_requested.md) `==` `true`となった[`stop_token`](../stop_token.md)は、自身と停止状態を共有する[`stop_source`](../stop_source.md)が破棄されても[`stop_requested()`](stop_requested.md) `==` `true`かつ`stop_possible()` `==` `true`の状態のままになる。 ## 例 @@ -64,9 +64,9 @@ int main() assert(st3.stop_possible() == false); } ``` +* stop_possible()[color ff0000] * std::stop_token[link ../stop_token.md] * std::stop_source[link ../stop_source.md] -* stop_possible()[link stop_possible.md] * request_stop()[link ../stop_source/request_stop.md] * get_token()[link ../stop_source/get_token.md] diff --git a/reference/stop_token/stop_token/stop_requested.md b/reference/stop_token/stop_token/stop_requested.md index e8de4ea6f5..ff1167c250 100644 --- a/reference/stop_token/stop_token/stop_requested.md +++ b/reference/stop_token/stop_token/stop_requested.md @@ -20,7 +20,7 @@ 投げない。 ## 備考 -一度[`stop_requested()`](stop_requested.md) `==` `true`となった[`stop_token`](../stop_token.md)は、自身と停止状態を共有する[`stop_source`](../stop_source.md)が破棄されても[`stop_requested()`](stop_requested.md) `==` `true`かつ[`stop_possible()`](stop_possible.md) `==` `true`の状態のままになる。 +一度`stop_requested()` `==` `true`となった[`stop_token`](../stop_token.md)は、自身と停止状態を共有する[`stop_source`](../stop_source.md)が破棄されても`stop_requested()` `==` `true`かつ[`stop_possible()`](stop_possible.md) `==` `true`の状態のままになる。 ## 例 ```cpp example @@ -53,9 +53,9 @@ int main() assert(st1.stop_requested() == true); } ``` +* stop_requested()[color ff0000] * std::stop_token[link ../stop_token.md] * std::stop_source[link ../stop_source.md] -* stop_requested()[link stop_requested.md] * request_stop()[link ../stop_source/request_stop.md] * get_token()[link ../stop_source/get_token.md] diff --git a/reference/string_view/basic_string_view/begin.md b/reference/string_view/basic_string_view/begin.md index fb6dae7e94..9f6abd2935 100644 --- a/reference/string_view/basic_string_view/begin.md +++ b/reference/string_view/basic_string_view/begin.md @@ -14,7 +14,7 @@ constexpr const_iterator begin() const noexcept; ## 戻り値 -`!`[`empty()`](empty.md)である場合、[`data()`](data.md)を指すイテレータを返す。そうでない場合、`[`[`begin()`](begin.md)`,` [`end()`](end.md)`)`を妥当な範囲とする未規定の値を返す。 +`!`[`empty()`](empty.md)である場合、[`data()`](data.md)を指すイテレータを返す。そうでない場合、`[begin(),` [`end()`](end.md)`)`を妥当な範囲とする未規定の値を返す。 ## 例 diff --git a/reference/string_view/basic_string_view/cbegin.md b/reference/string_view/basic_string_view/cbegin.md index 746688ad0d..0868f6ab47 100644 --- a/reference/string_view/basic_string_view/cbegin.md +++ b/reference/string_view/basic_string_view/cbegin.md @@ -14,7 +14,7 @@ constexpr const_iterator cbegin() const noexcept; ## 戻り値 -`!`[`empty()`](empty.md)である場合、[`data()`](data.md)を指すイテレータを返す。そうでない場合、`[`[`cbegin()`](cbegin.md)`,` [`cend()`](cend.md)`)`を妥当な範囲とする未規定の値を返す。 +`!`[`empty()`](empty.md)である場合、[`data()`](data.md)を指すイテレータを返す。そうでない場合、`[cbegin(),` [`cend()`](cend.md)`)`を妥当な範囲とする未規定の値を返す。 ## 例 diff --git a/reference/type_traits/integral_constant.md b/reference/type_traits/integral_constant.md index e7634194c5..c45fcd342d 100644 --- a/reference/type_traits/integral_constant.md +++ b/reference/type_traits/integral_constant.md @@ -59,7 +59,7 @@ int main(){} - `operator()`関数は、2015から実装されている。 #### 備考 -上の例でコンパイラによってはエラーになる。GCC 4.3.4, 4.5.3, Visual C++ 2010 は [`integral_constant`](integral_constant.md) が `operator value_type()` を持っていないためエラーになる。 +上の例でコンパイラによってはエラーになる。GCC 4.3.4, 4.5.3, Visual C++ 2010 は `integral_constant` が `operator value_type()` を持っていないためエラーになる。 ## 関連項目 diff --git a/reference/unordered_map/unordered_map/load_factor.md b/reference/unordered_map/unordered_map/load_factor.md index e9483c7f32..19359f354d 100644 --- a/reference/unordered_map/unordered_map/load_factor.md +++ b/reference/unordered_map/unordered_map/load_factor.md @@ -67,7 +67,7 @@ current load_factor: 0.5 ``` ### 検証 -[`load_factor`](load_factor.md) = [`size`](size.md) / [`bucket_count`](bucket_count.md) を満たしている。 +`load_factor` = [`size`](size.md) / [`bucket_count`](bucket_count.md) を満たしている。 ## バージョン diff --git a/reference/unordered_map/unordered_map/max_load_factor.md b/reference/unordered_map/unordered_map/max_load_factor.md index 963acb82bc..77ce33d85a 100644 --- a/reference/unordered_map/unordered_map/max_load_factor.md +++ b/reference/unordered_map/unordered_map/max_load_factor.md @@ -110,13 +110,13 @@ new load_factor: 1.125 ``` ### 検証 -[`max_load_factor`](max_load_factor.md) の初期値は 1.0f +`max_load_factor` の初期値は 1.0f その状態では、[`bucket_count`](bucket_count.md) を超える要素を挿入した場合 -[`load_factor`](load_factor.md) < [`max_load_factor`](max_load_factor.md) になるよう、バケットが拡張されている +[`load_factor`](load_factor.md) < `max_load_factor` になるよう、バケットが拡張されている -[`max_load_factor`](max_load_factor.md) を 大きくした場合は -[`load_factor`](load_factor.md) < [`max_load_factor`](max_load_factor.md) を満たすよう +`max_load_factor` を 大きくした場合は +[`load_factor`](load_factor.md) < `max_load_factor` を満たすよう バケットが縮小された diff --git a/reference/unordered_map/unordered_multimap/load_factor.md b/reference/unordered_map/unordered_multimap/load_factor.md index a2ef279b7f..9d06b95e8d 100644 --- a/reference/unordered_map/unordered_multimap/load_factor.md +++ b/reference/unordered_map/unordered_multimap/load_factor.md @@ -68,7 +68,7 @@ current load_factor: 0.5 ``` ### 検証 -[`load_factor`](load_factor.md) = [`size`](size.md) / [`bucket_count`](bucket_count.md) を満たしている。 +`load_factor` = [`size`](size.md) / [`bucket_count`](bucket_count.md) を満たしている。 ## バージョン diff --git a/reference/unordered_map/unordered_multimap/max_load_factor.md b/reference/unordered_map/unordered_multimap/max_load_factor.md index 60062f45e9..17579c558b 100644 --- a/reference/unordered_map/unordered_multimap/max_load_factor.md +++ b/reference/unordered_map/unordered_multimap/max_load_factor.md @@ -112,13 +112,13 @@ new load_factor: 1.125 ``` ### 検証 -[`max_load_factor`](max_load_factor.md) の初期値は 1.0f +`max_load_factor` の初期値は 1.0f その状態では、[`bucket_count`](bucket_count.md) を超える要素を挿入した場合 -[`load_factor`](load_factor.md) < [`max_load_factor`](max_load_factor.md) になるよう、バケットが拡張されている +[`load_factor`](load_factor.md) < `max_load_factor` になるよう、バケットが拡張されている -[`max_load_factor`](max_load_factor.md) を 大きくした場合は -[`load_factor`](load_factor.md) < [`max_load_factor`](max_load_factor.md) を満たすよう +`max_load_factor` を 大きくした場合は +[`load_factor`](load_factor.md) < `max_load_factor` を満たすよう バケットが縮小された diff --git a/reference/utility/pair.md b/reference/utility/pair.md index 5963f91612..8cab65a198 100644 --- a/reference/utility/pair.md +++ b/reference/utility/pair.md @@ -91,8 +91,8 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------------------------------------------------------------|--------------------------------------------------------|-----------| -| [`common_type`](pair/common_type.md) | 異なる[`pair`](pair.md)間の共通型を取得できるようにする特殊化 | C++23 | -| [`basic_common_reference`](pair/basic_common_reference.md) | 異なる[`pair`](pair.md)間の共通の参照型を取得出来るようにする特殊化 | C++23 | +| [`common_type`](pair/common_type.md) | 異なる`pair`間の共通型を取得できるようにする特殊化 | C++23 | +| [`basic_common_reference`](pair/basic_common_reference.md) | 異なる`pair`間の共通の参照型を取得出来るようにする特殊化 | C++23 | ## 例 diff --git a/reference/valarray/valarray.md b/reference/valarray/valarray.md index e54a2e47fe..dcfa67bb36 100644 --- a/reference/valarray/valarray.md +++ b/reference/valarray/valarray.md @@ -36,7 +36,7 @@ valarray c = a + b; 処理系によっては、このような演算を、CPUのSIMD命令によって並列に計算するよう最適化する。 -なお、戻り値型に *`ValOrProxy`* と表記している箇所は、[`valarray`](valarray.md)`` か代理の型のいずれかであることを、引数型に *`ValOrProxy`* と表記している箇所は、[`valarray`](valarray.md)`` と代理の型のいずれでも受け取ることが可能であることを表している。 +なお、戻り値型に *`ValOrProxy`* と表記している箇所は、`valarray` か代理の型のいずれかであることを、引数型に *`ValOrProxy`* と表記している箇所は、`valarray` と代理の型のいずれでも受け取ることが可能であることを表している。 [``](../valarray.md) の概要も参照のこと。 From f09cd879a500c63e43eb84f00f7f4704652c9efa Mon Sep 17 00:00:00 2001 From: suomesta Date: Sat, 1 Apr 2023 01:45:46 +0900 Subject: [PATCH 0262/3948] fix to correct ling --- reference/compare/compare_strong_order_fallback.md | 4 ++-- reference/compare/partial_order.md | 2 +- reference/compare/weak_order.md | 8 ++++---- reference/deque/deque/rend.md | 10 +++++----- reference/future.md | 2 +- reference/future/promise/swap_free.md | 2 +- reference/ios/showbase.md | 2 +- reference/limits/numeric_limits/quiet_nan.md | 2 +- reference/limits/numeric_limits/signaling_nan.md | 2 +- reference/ostream/vprint_nonunicode.md | 2 +- reference/print/vprint_nonunicode.md | 2 +- reference/ranges/split_view.md | 2 +- reference/source_location/source_location/current.md | 2 +- reference/type_traits/is_arithmetic.md | 2 +- reference/type_traits/is_fundamental.md | 2 +- reference/type_traits/is_object.md | 2 +- 16 files changed, 24 insertions(+), 24 deletions(-) diff --git a/reference/compare/compare_strong_order_fallback.md b/reference/compare/compare_strong_order_fallback.md index b78d7ca363..29fcadee39 100644 --- a/reference/compare/compare_strong_order_fallback.md +++ b/reference/compare/compare_strong_order_fallback.md @@ -63,10 +63,10 @@ namespace std { 上記「効果」節2,3のケースでは、ユーザー定義の`< ==`演算子を定義、もしくは`strong_order()`へアダプトしておくことによって実行される比較をカスタマイズすることができる。 1. -- -2. 引数`a, b`の型`T`を[`strong_order`](weak_order.md)にアダプトしておく。 +2. 引数`a, b`の型`T`を[`strong_order`](strong_order.md)にアダプトしておく。 3. 引数`a, b`の型`T`に対して、使用可能な`< ==`演算子を定義しておく。 -ただし、どのケースにおいてもその戻り値型は[`strong_ordering`](weak_ordering.md)に変換可能でなければならない。 +ただし、どのケースにおいてもその戻り値型は[`strong_ordering`](strong_ordering.md)に変換可能でなければならない。 ## 例 ```cpp example diff --git a/reference/compare/partial_order.md b/reference/compare/partial_order.md index d591f65e07..283d853892 100644 --- a/reference/compare/partial_order.md +++ b/reference/compare/partial_order.md @@ -66,7 +66,7 @@ namespace std { 3. 引数`a, b`の型`T`に対して、使用可能な`<=>`演算子を定義しておく。 4. 引数`a, b`の型`T`を[`weak_order`](weak_order.md)にアダプトしておく。 -ただし、どのケースにおいてもその戻り値型は[`partial_ordering`](weak_ordering.md)に変換可能でなければならない。 +ただし、どのケースにおいてもその戻り値型は[`partial_ordering`](partial_ordering.md)に変換可能でなければならない。 ## 例 diff --git a/reference/compare/weak_order.md b/reference/compare/weak_order.md index 4a79879325..6a49ba1f9a 100644 --- a/reference/compare/weak_order.md +++ b/reference/compare/weak_order.md @@ -25,7 +25,7 @@ namespace std { 1. [`decay`](/reference/type_traits/decay.md)を通した`a, b`の型が異なる場合、呼び出しは不適格(コンパイルエラー) -2. `std::weak_order`(本関数オブジェクト)の宣言を含まないコンテキストで、[`weak_ordering`](strong_ordering.md)`(weak_order(a, b))`が呼び出し可能ならば`weak_ordering(weak_order(a, b))` +2. `std::weak_order`(本関数オブジェクト)の宣言を含まないコンテキストで、[`weak_ordering`](weak_ordering.md)`(weak_order(a, b))`が呼び出し可能ならば`weak_ordering(weak_order(a, b))` 3. [`decay`](/reference/type_traits/decay.md)を通した`a, b`の型`T`が浮動小数点型の場合、`T`の組み込みの比較演算子および[`strong_order`](strong_order.md)による順序と一貫する[`weak_ordering`](weak_ordering.md)の値を返す。 さらに、[`numeric_limits::is_iec559`](/reference/limits/numeric_limits/is_iec559.md)` == true`の場合、追加で以下の同値類の順序に従った順序付けを行う。 @@ -40,9 +40,9 @@ namespace std { 8. `+Inf` 9. 全ての`+NaN` -4. [`weak_ordering`](strong_ordering.md)`(a <=> b)`が呼び出し可能ならば`weak_ordering(a <=> b)` +4. [`weak_ordering`](weak_ordering.md)`(a <=> b)`が呼び出し可能ならば`weak_ordering(a <=> b)` -5. [`weak_ordering(`](strong_ordering.md)[`strong_order`](strong_order.md)`(a, b))`が呼び出し可能ならば`weak_ordering(strong_order(a, b))` +5. [`weak_ordering(`](weak_ordering.md)[`strong_order`](strong_order.md)`(a, b))`が呼び出し可能ならば`weak_ordering(strong_order(a, b))` 6. それ以外の場合、呼び出しは不適格。 @@ -82,7 +82,7 @@ namespace std { 4. 引数`a, b`の型`T`に対して、使用可能な`<=>`演算子を定義しておく。 5. 引数`a, b`の型`T`を[`strong_order`](strong_order.md)にアダプトしておく。 -ただし、どのケースにおいてもその戻り値型は[`weak_ordering`](strong_ordering.md)に変換可能でなければならない。 +ただし、どのケースにおいてもその戻り値型は[`weak_ordering`](weak_ordering.md)に変換可能でなければならない。 ## 備考 diff --git a/reference/deque/deque/rend.md b/reference/deque/deque/rend.md index 1b36f28796..7b0beb878a 100644 --- a/reference/deque/deque/rend.md +++ b/reference/deque/deque/rend.md @@ -68,10 +68,10 @@ int main() | 名前 | 説明 | |--------------------------|--------------------------------------| -| [`rbegin`](rbegin.md) | 末尾要素を指す逆イテレータを取得する | -| [`crbegin`](cbegin.md) | 末尾要素を指す読み取り専用逆イテレータを取得する | -| [`crend`](crend.md) | 先頭要素の前を指す読み取り専用逆イテレータを取得する | -| [`begin`](begin.md) | 先頭要素を指すイテレータの取得する | -| [`end`](end.md) | 末尾要素の次を指すイテレータを取得する | +| [`rbegin`](rbegin.md) | 末尾要素を指す逆イテレータを取得する | +| [`crbegin`](crbegin.md) | 末尾要素を指す読み取り専用逆イテレータを取得する | +| [`crend`](crend.md) | 先頭要素の前を指す読み取り専用逆イテレータを取得する | +| [`begin`](begin.md) | 先頭要素を指すイテレータの取得する | +| [`end`](end.md) | 末尾要素の次を指すイテレータを取得する | diff --git a/reference/future.md b/reference/future.md index df6ce6b456..004e80b41d 100644 --- a/reference/future.md +++ b/reference/future.md @@ -5,7 +5,7 @@ ``ヘッダでは、並行プログラミングのためのデザインパターンのひとつであるFutureパターンに関するクラス・関数を提供する。 [`future`](future/future.md)はデータの準備ができるまで待機してからデータを読み取る。 -[`promise`](future/promise.md)はデータを書き込み、準備ができたことを[`future`](future.md)に通知する。 +[`promise`](future/promise.md)はデータを書き込み、準備ができたことを[`future`](future/future.md)に通知する。 [`packaged_task`](future/packaged_task.md)は関数の戻り値をデータの書き込みと見なし、関数終了時に[`future`](future/future.md)に通知する。さらにこのパターンを容易に扱うための[`async()`](future/async.md)関数を提供する。 | 名前 | 説明 | 対応バージョン | diff --git a/reference/future/promise/swap_free.md b/reference/future/promise/swap_free.md index 71376cc6a8..5eb6e95199 100644 --- a/reference/future/promise/swap_free.md +++ b/reference/future/promise/swap_free.md @@ -16,7 +16,7 @@ namespace std { ## 効果 -`x.`[`swap`](swap_free.md)`(y)` +`x.`[`swap`](swap.md)`(y)` ## 戻り値 diff --git a/reference/ios/showbase.md b/reference/ios/showbase.md index 90af9c2563..7713ce33aa 100644 --- a/reference/ios/showbase.md +++ b/reference/ios/showbase.md @@ -11,7 +11,7 @@ namespace std { ## 概要 整数出力時に基数を表すプレフィックスを付与することを指示するマニピュレータ。 -[`hex`](hex.md)や[`oct`](hex.md)と組み合わせると、それぞれ0xおよび0が頭に出力される。 +[`hex`](hex.md)や[`oct`](oct.md)と組み合わせると、それぞれ0xおよび0が頭に出力される。 ただし、0の場合を除く。 `money_put`など、その他の出力でも効果がある場合がある。 diff --git a/reference/limits/numeric_limits/quiet_nan.md b/reference/limits/numeric_limits/quiet_nan.md index 39e8cc581d..4e16529a87 100644 --- a/reference/limits/numeric_limits/quiet_nan.md +++ b/reference/limits/numeric_limits/quiet_nan.md @@ -53,6 +53,6 @@ double : 1.#QNAN ``` ## 参照 -* [`numeric_limits::has_quiet_NaN`](quiet_nan.md) +* [`numeric_limits::has_quiet_NaN`](has_quiet_nan.md) * [NANの定義について - ぴょぴょぴょ? - Linuxとかプログラミングの覚え書き](http://d.hatena.ne.jp/pyopyopyo/20100330/p1) diff --git a/reference/limits/numeric_limits/signaling_nan.md b/reference/limits/numeric_limits/signaling_nan.md index 164aa0d047..bc5488544e 100644 --- a/reference/limits/numeric_limits/signaling_nan.md +++ b/reference/limits/numeric_limits/signaling_nan.md @@ -51,6 +51,6 @@ double : 1.#QNAN ``` ## 参照 -* [`numeric_limits::has_quiet_NaN`](signaling_nan.md) +* [`numeric_limits::has_quiet_NaN`](has_quiet_nan.md) * [NANの定義について - ぴょぴょぴょ? - Linuxとかプログラミングの覚え書き](http://d.hatena.ne.jp/pyopyopyo/20100330/p1) diff --git a/reference/ostream/vprint_nonunicode.md b/reference/ostream/vprint_nonunicode.md index bdc2408f35..a2894b7f53 100644 --- a/reference/ostream/vprint_nonunicode.md +++ b/reference/ostream/vprint_nonunicode.md @@ -50,7 +50,7 @@ namespace std { ## 関連項目 - [`std::print()`](print.md) - [`std::println()`](println.md) -- [`std::vprint_unicode()`](vprint_nonunicode.md) +- [`std::vprint_unicode()`](vprint_unicode.md) ## 参照 diff --git a/reference/print/vprint_nonunicode.md b/reference/print/vprint_nonunicode.md index cc4d0accc9..d4d6fe31f2 100644 --- a/reference/print/vprint_nonunicode.md +++ b/reference/print/vprint_nonunicode.md @@ -60,7 +60,7 @@ namespace std { ## 関連項目 - [`std::print()`](print.md) - [`std::println()`](println.md) -- [`std::vprint_unicode()`](vprint_nonunicode.md) +- [`std::vprint_unicode()`](vprint_unicode.md) ## 参照 diff --git a/reference/ranges/split_view.md b/reference/ranges/split_view.md index 488812bdc3..f09880d28f 100644 --- a/reference/ranges/split_view.md +++ b/reference/ranges/split_view.md @@ -51,7 +51,7 @@ namespace std::ranges { ## テンプレートパラメータ制約 -- `V`、`Pattern`が[`view`](view.md)かつ[`forward_range`](input_range.md) +- `V`、`Pattern`が[`view`](view.md)かつ[`forward_range`](forward_range.md) - `V`のイテレータと`Pattern`のイテレータが等値比較可能である ## 効果 diff --git a/reference/source_location/source_location/current.md b/reference/source_location/source_location/current.md index 0b60e977f3..0eb4905fea 100644 --- a/reference/source_location/source_location/current.md +++ b/reference/source_location/source_location/current.md @@ -25,7 +25,7 @@ static consteval source_location current() noexcept; * [`line()`](line.md)の値は`__LINE__`が表すような行番号であり、1オリジンだが、行番号が不明のときは0になる可能性がある。 * [`column()`](column.md)の値は行頭からのオフセットを表す処理系定義の値で、1オリジンだが、列番号が不明のときは0になる可能性がある。 * [`file_name()`](file_name.md)の値は`__FILE__`が表すような現在のファイル名である。 -* [`function_name()`](file_name.md)の値は[`__func__`](/lang/cpp11/func.md)が表すような現在の関数名であり、[`__func__`](/lang/cpp11/func.md)が定義されないような状況では空文字列である。 +* [`function_name()`](function_name.md)の値は[`__func__`](/lang/cpp11/func.md)が表すような現在の関数名であり、[`__func__`](/lang/cpp11/func.md)が定義されないような状況では空文字列である。 その他の方法で呼び出されたときは、未規定の有効な値を返す。 diff --git a/reference/type_traits/is_arithmetic.md b/reference/type_traits/is_arithmetic.md index 5699cf6c91..6a1c566193 100644 --- a/reference/type_traits/is_arithmetic.md +++ b/reference/type_traits/is_arithmetic.md @@ -19,7 +19,7 @@ namespace std { ## 効果 -`is_arithmetic`は、型`T`が算術型であるならば[`true_type`](true_type.md)から派生し、そうでなければ[`false_type`](true_type.md)から派生する。 +`is_arithmetic`は、型`T`が算術型であるならば[`true_type`](true_type.md)から派生し、そうでなければ[`false_type`](false_type.md)から派生する。 ## 例 diff --git a/reference/type_traits/is_fundamental.md b/reference/type_traits/is_fundamental.md index a0b96545ad..fa0c1fe223 100644 --- a/reference/type_traits/is_fundamental.md +++ b/reference/type_traits/is_fundamental.md @@ -19,7 +19,7 @@ namespace std { ## 効果 -`is_fundamental`は、型`T`が単純型であるならば[`true_type`](true_type.md)から派生し、そうでなければ[`false_type`](true_type.md)から派生する。 +`is_fundamental`は、型`T`が単純型であるならば[`true_type`](true_type.md)から派生し、そうでなければ[`false_type`](false_type.md)から派生する。 ## 例 diff --git a/reference/type_traits/is_object.md b/reference/type_traits/is_object.md index 7a68d5dfdd..44607d810c 100644 --- a/reference/type_traits/is_object.md +++ b/reference/type_traits/is_object.md @@ -19,7 +19,7 @@ namespace std { ## 効果 -`is_object`は、型`T`がオブジェクト型であるならば[`true_type`](true_type.md)から派生し、そうでなければ[`false_type`](true_type.md)から派生する。 +`is_object`は、型`T`がオブジェクト型であるならば[`true_type`](true_type.md)から派生し、そうでなければ[`false_type`](false_type.md)から派生する。 ## 例 From 5e61ff5c823cc319809c329792c646f2744e85e1 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sat, 1 Apr 2023 01:53:40 +0900 Subject: [PATCH 0263/3948] set link and remove link to own page --- reference/memory/return_temporary_buffer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/memory/return_temporary_buffer.md b/reference/memory/return_temporary_buffer.md index 9483b9be38..a3e6448f9a 100644 --- a/reference/memory/return_temporary_buffer.md +++ b/reference/memory/return_temporary_buffer.md @@ -34,7 +34,7 @@ void return_temporary_buffer(T* p); ## 非推奨・削除の詳細 -`std::get_temporary_buffer()`関数と[`std::return_temporary_buffer()`](return_temporary_buffer.md)関数は、関数内での一時的なメモリ確保のために、最適化されたメモリ確保の仕組みを提供することを期待して定義されたが、実際にはどの実装も特別なメモリ確保を行わず、そのために使われてこなかった。 +[`get_temporary_buffer()`](get_temporary_buffer.md)関数と`std::return_temporary_buffer()`関数は、関数内での一時的なメモリ確保のために、最適化されたメモリ確保の仕組みを提供することを期待して定義されたが、実際にはどの実装も特別なメモリ確保を行わず、そのために使われてこなかった。 将来的にスタックからメモリ確保をする仕組みが検討されているが、これらの関数は設計として例外安全性やRAIIといったものが考慮されていない。スタックからメモリ確保する機能が入ったとしても、これらの関数の内部を改善することはできないと判断され、非推奨となった。 From ab42c56c60f7caf7c809277e1b204427eb790376 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sat, 1 Apr 2023 02:02:37 +0900 Subject: [PATCH 0264/3948] arrange relations in ranges::next/prev/advance --- reference/iterator/ranges_advance.md | 5 +++-- reference/iterator/ranges_next.md | 5 +++-- reference/iterator/ranges_prev.md | 7 ++++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/reference/iterator/ranges_advance.md b/reference/iterator/ranges_advance.md index 9b67945fb4..781d03c0ea 100644 --- a/reference/iterator/ranges_advance.md +++ b/reference/iterator/ranges_advance.md @@ -127,9 +127,10 @@ diff : 2 | 名前 | 説明 | |---------------------|-----------------------------------| | [`next()`](next.md) | `n`回前方に進めたイテレータを返す | -| [`advance()`](advance.md) | `n`回イテレータを進める | +| [`prev()`](prev.md) | `n`回後方に進めたイテレータを返す | +| [`advance()`](advance.md) | `n`回イテレータを進める | | [`ranges::next()`](ranges_next.md) | `n`回あるいは`bound`まで前方に進めたイテレータを返す | -| [`ranges::advance()`](/reference/iterator/ranges_advance.md) |`n`回あるいは`boundまで`イテレータを進める | +| [`rangse::prev()`](ranges_prev.md) | `n`回後方に進めたイテレータを返す | ## 参照 diff --git a/reference/iterator/ranges_next.md b/reference/iterator/ranges_next.md index a99a746704..3062d963d4 100644 --- a/reference/iterator/ranges_next.md +++ b/reference/iterator/ranges_next.md @@ -140,10 +140,11 @@ int main() { | 名前 | 説明 | |---------------------|-----------------------------------| +| [`next()`](next.md) | `n`回前方に進めたイテレータを返す | | [`prev()`](prev.md) | `n`回後方に進めたイテレータを返す | -| [`advance()`](advance.md) | `n`回イテレータを進める | +| [`advance()`](advance.md) | `n`回イテレータを進める | | [`rangse::prev()`](ranges_prev.md) | `n`回後方に進めたイテレータを返す | -| [`ranges::advance()`](/reference/iterator/ranges_advance.md) |`n`回あるいは`boundまで`イテレータを進める | +| [`ranges::advance()`](ranges_advance.md) |`n`回あるいは`boundまで`イテレータを進める | ## 参照 diff --git a/reference/iterator/ranges_prev.md b/reference/iterator/ranges_prev.md index 296a2da2b2..e5be4ac5d9 100644 --- a/reference/iterator/ranges_prev.md +++ b/reference/iterator/ranges_prev.md @@ -122,10 +122,11 @@ int main() { | 名前 | 説明 | |---------------------|-----------------------------------| +| [`next()`](next.md) | `n`回前方に進めたイテレータを返す | | [`prev()`](prev.md) | `n`回後方に進めたイテレータを返す | -| [`advance()`](advance.md) | `n`回イテレータを進める | -| [`rangse::prev()`](ranges_prev.md) | `n`回後方に進めたイテレータを返す | -| [`ranges::advance()`](/reference/iterator/ranges_advance.md) |`n`回あるいは`boundまで`イテレータを進める | +| [`advance()`](advance.md) | `n`回イテレータを進める | +| [`ranges::next()`](ranges_next.md) | `n`回あるいは`bound`まで前方に進めたイテレータを返す | +| [`ranges::advance()`](ranges_advance.md) |`n`回あるいは`boundまで`イテレータを進める | ## 参照 From 38aa278067c5ee2a63926bd41401b57d0ab27eb5 Mon Sep 17 00:00:00 2001 From: Bando Masafumi <63996969+cupro29@users.noreply.github.com> Date: Thu, 6 Apr 2023 01:04:48 +0900 Subject: [PATCH 0265/3948] fix typo --- reference/ranges/repeat_view.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/ranges/repeat_view.md b/reference/ranges/repeat_view.md index 2143188090..0f2af5d767 100644 --- a/reference/ranges/repeat_view.md +++ b/reference/ranges/repeat_view.md @@ -40,8 +40,8 @@ namespace std::ranges { - (1) `Bound = unreachable_sentinel_t` ではない場合 ## 効果 -- 式`views::repear(E)`の効果は`repeat_view(E)`と等しい。 -- 式`views::repear(E, F)`の効果は`repeat_view(E, F)`と等しい。 +- 式`views::repeat(E)`の効果は`repeat_view(E)`と等しい。 +- 式`views::repeat(E, F)`の効果は`repeat_view(E, F)`と等しい。 ## メンバ関数 From 663009edf7ef89aacce6d49fdbe7f71cd9705ab1 Mon Sep 17 00:00:00 2001 From: I <1091761+wx257osn2@users.noreply.github.com> Date: Thu, 6 Apr 2023 18:38:48 +0900 Subject: [PATCH 0266/3948] remove # --- reference/print/print.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/print/print.md b/reference/print/print.md index 8ce2daf05c..d4f5dea236 100644 --- a/reference/print/print.md +++ b/reference/print/print.md @@ -108,8 +108,8 @@ Hello 42 World ### モジュールをインポートする例 ```cpp example -#import std; -#import std.compat; +import std; +import std.compat; int main() { From ef831a1bc7916fef42e7d21cc5ecc7a90249d9db Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 11 Apr 2023 10:09:56 +0900 Subject: [PATCH 0267/3948] =?UTF-8?q?pair=20:=20piecewise=20construction?= =?UTF-8?q?=E3=81=AE=E8=AA=AC=E6=98=8E=E3=82=92=E6=94=B9=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/utility/pair/op_constructor.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reference/utility/pair/op_constructor.md b/reference/utility/pair/op_constructor.md index 84bb25ebcd..2556f04c2d 100644 --- a/reference/utility/pair/op_constructor.md +++ b/reference/utility/pair/op_constructor.md @@ -84,7 +84,8 @@ constexpr pair(piecewise_construct_t, - (8) : 変換可能な他の[`pair`](../pair.md)オブジェクトからムーブ構築 - (9) : 変換可能な他の[`pair`](../pair.md)オブジェクトから構築 - (10) : [`pair-like`](/reference/tuple/tuple-like.md)なオブジェクトから構築 -- (11) : `first`と`second`のコンストラクタ引数を受け取り、`first_args`と`second_args`それぞれの要素から`first`と`second`をムーブ構築 +- (11) : `first`と`second`のコンストラクタ引数を`std::tuple`に詰めて受け取り、`first_args`と`second_args`内のそれぞれの要素を転送して`first`と`second`を直接構築 + - 転送は、`std::tuple`オブジェクト(`first_args`/`second_args`)内の要素`x`とその型`U`(`Args1...`/`Args2...`に含まれる型)によって、`std::forward(x)`のようにしてコンストラクタに渡される ## テンプレートパラメータ制約 @@ -127,6 +128,7 @@ constexpr pair(piecewise_construct_t, - (8) : - C++17 : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` || !`[`is_convertible_v`](/reference/type_traits/is_convertible.md)``である場合、`explicit`指定される - C++23 : (6)-(10) での定義参照 +- (11) : このコンストラクタでは`first`/`second`をそのコンストラクタ引数から直接構築するため、ムーブもコピーもできないような型でも初期化することができる - C++17では、コンストラクタの各オーバーロードが条件付きで`explicit`となるよう規定された。これは、以下のような初期化子リストを使用したC++17での初期化が不適格になっていたため、適格になるようにするための変更である: ```cpp From bbf0c78e4950b3cec5fba5986840fcd0064a38da Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 11 Apr 2023 10:24:47 +0900 Subject: [PATCH 0268/3948] =?UTF-8?q?pair=E3=82=B3=E3=83=B3=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=83=A9=E3=82=AF=E3=82=BF=20:=20explicit/delete?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E3=81=AE=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/utility/pair/op_constructor.md | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/reference/utility/pair/op_constructor.md b/reference/utility/pair/op_constructor.md index 2556f04c2d..f4a0090002 100644 --- a/reference/utility/pair/op_constructor.md +++ b/reference/utility/pair/op_constructor.md @@ -109,26 +109,34 @@ constexpr pair(piecewise_construct_t, - (11) : - [`is_constructible`](/reference/type_traits/is_constructible.md)`::value &&` [`is_constructible`](/reference/type_traits/is_constructible.md)`::value`であること +## delete定義される条件(C++23) + +- (5) : [`reference_constructs_from_temporary_v`](/reference/type_traits/reference_constructs_from_temporary.md)` ||` [`reference_constructs_from_temporary_v`](/reference/type_traits/reference_constructs_from_temporary.md)``である場合、このコンストラクタは削除定義される +- (6)-(10) : + - `FWD(u)`を`static_cast(u)`と定義して + - [`reference_constructs_from_temporary_v`](/reference/type_traits/reference_constructs_from_temporary.md)`(FWD(p)))> ||` [`reference_constructs_from_temporary_v`](/reference/type_traits/reference_constructs_from_temporary.md)`(FWD(p)))>`である場合、このコンストラクタは削除定義される +- (11) : 要素型(`T1, T2`のどちらかもしくは両方)が参照型であり、初期化によって一時オブジェクトを束縛することになる場合、このコンストラクタは削除定義される + - 上記のコンストラクタと同様に、[`reference_constructs_from_temporary`](/reference/type_traits/reference_constructs_from_temporary.md)を使用して判定される + +## explicitになる条件 -## 備考 - (1) : - C++17 : `first_type`と`second_type`のどちらかが非暗黙にデフォルト構築できない場合、`explicit`指定される - (4) : - C++17 : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` || !`[`is_convertible_v`](/reference/type_traits/is_convertible.md)``である場合、`explicit`指定される - (5) : - C++17 : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` || !`[`is_convertible_v`](/reference/type_traits/is_convertible.md)``である場合、`explicit`指定される - - C++23 : [`reference_constructs_from_temporary_v`](/reference/type_traits/reference_constructs_from_temporary.md)` ||` [`reference_constructs_from_temporary_v`](/reference/type_traits/reference_constructs_from_temporary.md)``である場合、このコンストラクタは削除定義される - (6)-(10) : - `FWD(u)`を`static_cast(u)`と定義して - C++23 : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`(FWD(p))), T1> || !`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`(FWD(p))), T2>`である場合、`explicit`指定される - - C++23 : [`reference_constructs_from_temporary_v`](/reference/type_traits/reference_constructs_from_temporary.md)`(FWD(p)))> ||` [`reference_constructs_from_temporary_v`](/reference/type_traits/reference_constructs_from_temporary.md)`(FWD(p)))>`である場合、このコンストラクタは削除定義される - (7) : - C++17 : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` || !`[`is_convertible_v`](/reference/type_traits/is_convertible.md)``である場合、`explicit`指定される - - C++23 : (6)-(10) での定義参照 - (8) : - C++17 : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` || !`[`is_convertible_v`](/reference/type_traits/is_convertible.md)``である場合、`explicit`指定される - - C++23 : (6)-(10) での定義参照 -- (11) : このコンストラクタでは`first`/`second`をそのコンストラクタ引数から直接構築するため、ムーブもコピーもできないような型でも初期化することができる + +## 備考 + +- (11)のコンストラクタでは`first`/`second`をそのコンストラクタ引数から直接構築するため、コピーもムーブもできないような型でも初期化することができる - C++17では、コンストラクタの各オーバーロードが条件付きで`explicit`となるよう規定された。これは、以下のような初期化子リストを使用したC++17での初期化が不適格になっていたため、適格になるようにするための変更である: ```cpp @@ -143,7 +151,7 @@ constexpr pair(piecewise_construct_t, - この変更はC++17に対するものであるが、コンパイラが早期に対応していたため、一部処理系ではC++14の段階から適格となっていた -- C++23 では、ダングリング参照の作成が簡単にできていた状態を改善するべく、[`reference_constructs_from_temporary`](/reference/type_traits/reference_constructs_from_temporary.md)が追加され、ダングリング参照が作成される場合には不適格とするようになった : +- C++23 では、ダングリング参照の作成が簡単にできていた状態を改善するべく、[`reference_constructs_from_temporary`](/reference/type_traits/reference_constructs_from_temporary.md)が追加され、一部のコンストラクタにおいてダングリング参照が作成される場合には不適格とするようになった : ```cpp // コンストラクタ引数で std::string が構築され // その一時オブジェクトが束縛されるため、ダングリング参照となっていた From abc25987eceb7bfea7f0dee74dd39a6239e074b3 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 11 Apr 2023 10:37:42 +0900 Subject: [PATCH 0269/3948] =?UTF-8?q?pair=E3=82=B3=E3=83=B3=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=83=A9=E3=82=AF=E3=82=BF=20:=20explicit=E3=81=AB?= =?UTF-8?q?=E3=81=AA=E3=82=8B=E6=9D=A1=E4=BB=B6=E3=81=AE=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/utility/pair/op_constructor.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reference/utility/pair/op_constructor.md b/reference/utility/pair/op_constructor.md index f4a0090002..c0eedfa560 100644 --- a/reference/utility/pair/op_constructor.md +++ b/reference/utility/pair/op_constructor.md @@ -128,11 +128,13 @@ constexpr pair(piecewise_construct_t, - C++17 : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` || !`[`is_convertible_v`](/reference/type_traits/is_convertible.md)``である場合、`explicit`指定される - (6)-(10) : - `FWD(u)`を`static_cast(u)`と定義して - - C++23 : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`(FWD(p))), T1> || !`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`(FWD(p))), T2>`である場合、`explicit`指定される + - C++23 : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`(FWD(p))), first_type> || !`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`(FWD(p))), second_type>`である場合、`explicit`指定される - (7) : - C++17 : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` || !`[`is_convertible_v`](/reference/type_traits/is_convertible.md)``である場合、`explicit`指定される + - C++23 : (6)-(10) での定義参照(複雑であるが、条件は同等である) - (8) : - C++17 : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` || !`[`is_convertible_v`](/reference/type_traits/is_convertible.md)``である場合、`explicit`指定される + - C++23 : (6)-(10) での定義参照(複雑であるが、条件は同等である) ## 備考 From b240dfdc804d6675c712e38bad9e666d79964225 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Fri, 14 Apr 2023 16:22:27 +0900 Subject: [PATCH 0270/3948] =?UTF-8?q?type=5Finfo::operator!=3D=20:=20=3D?= =?UTF-8?q?=E3=81=8C=E5=A4=89=E3=81=A0=E3=81=A3=E3=81=9F=E3=81=AE=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/typeinfo/type_info/op_not_equal.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/typeinfo/type_info/op_not_equal.md b/reference/typeinfo/type_info/op_not_equal.md index 77ae97dc92..4f5b6435f8 100644 --- a/reference/typeinfo/type_info/op_not_equal.md +++ b/reference/typeinfo/type_info/op_not_equal.md @@ -12,7 +12,7 @@ bool operator!=(const type_info& rhs) const noexcept; // (1) C++11 ## 概要 2つの型が異なるかを判定する -(C++20からは、`operator==`から導出される) +(C++20からは、`operator==`から導出される) ## 戻り値 From 5eaa8eebe4f6275b47229ed76bfb655ae73896a6 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Mon, 17 Apr 2023 12:05:56 +0900 Subject: [PATCH 0271/3948] =?UTF-8?q?basic=5Fstring::append=20:=20?= =?UTF-8?q?=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88=E3=82=A2=E3=82=A6=E3=83=88?= =?UTF-8?q?=E3=81=8C=E5=A4=96=E3=82=8C=E3=81=A6=E3=81=84=E3=81=9F=E3=81=AE?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/string/basic_string/append.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/string/basic_string/append.md b/reference/string/basic_string/append.md index 8ebc7b88d6..aec3364381 100644 --- a/reference/string/basic_string/append.md +++ b/reference/string/basic_string/append.md @@ -54,12 +54,12 @@ template basic_string& append(const T& t, size_type pos, - size_type n = npos); / (9) C++17 + size_type n = npos); // (9) C++17 template constexpr basic_string& append(const T& t, size_type pos, - size_type n = npos); / (9) C++20 + size_type n = npos); // (9) C++20 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] From 37440305b5e204f34741e3edb9719a7b852bf4f9 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Mon, 17 Apr 2023 12:19:30 +0900 Subject: [PATCH 0272/3948] =?UTF-8?q?noexcept=20:=20=E6=8C=87=E5=AE=9A?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E3=81=AA=E4=BD=8D=E7=BD=AE=E3=81=AB=E3=81=A4?= =?UTF-8?q?=E3=81=84=E3=81=A6=E8=BF=BD=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp11/noexcept.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lang/cpp11/noexcept.md b/lang/cpp11/noexcept.md index 4257e4bcb3..2ac2aff52c 100644 --- a/lang/cpp11/noexcept.md +++ b/lang/cpp11/noexcept.md @@ -56,13 +56,16 @@ struct X { // 例外を送出しない int getValue() const noexcept; //int getValue() const noexcept(true); + + // noexceptは参照修飾と後置戻り値型の間 + auto getString() const & noexcept -> std::string; }; ``` * noexcept[color ff0000] - `noexcept`もしくは`noexcept(trueに評価される整数定数式)`が指定された関数が例外を送出した場合、[`std::terminate()`](/reference/exception/terminate.md)関数を呼び出してプログラムを異常終了させる。その際、[`std::terminate()`](/reference/exception/terminate.md)関数が呼び出される前に、スタックの巻き戻しは起こらない可能性がある。 - 従来の`throw`キーワードによる例外仕様(C++03ではexception specification、C++11ではdynamic exception specificationと呼ばれる仕様)は、C++11以降で非推奨である。 - +- `noexcept`の指定可能な位置は、[参照修飾](/lang/cpp11/ref_qualifier_for_this.md)の後、[戻り値の型を後置する関数宣言構文](/lang/cpp11/trailing_return_types.md)の前である。 ### 式が例外を送出する可能性があるか判定するnoexcept演算子 - 演算子としての`noexcept`は、引数として指定した定数式が例外を送出する可能性があるかどうかをコンパイル時に判定し、`bool`型の定数値を返す From 15e87dfd566db42845f47158e941032b9e0a2de0 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 17 Apr 2023 17:15:49 +0900 Subject: [PATCH 0273/3948] (multi)map, (multi)set : s/const pointer/const_pointer/ --- reference/map/map.md | 2 +- reference/map/multimap.md | 2 +- reference/set/multiset.md | 2 +- reference/set/set.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/map/map.md b/reference/map/map.md index a3fc5f03c2..3ced8970a8 100644 --- a/reference/map/map.md +++ b/reference/map/map.md @@ -140,7 +140,7 @@ namespace std { | `size_type` | 要素数を表す符号なし整数型。`difference_type` で表現可能な非負整数(0以上の整数)を表すことが可能。(通常は [`size_t`](/reference/cstddef/size_t.md)) | | | `difference_type` | 同一のコンテナを指す `iterator` の差を表す符号付き整数型(通常は [`ptrdiff_t`](/reference/cstddef/ptrdiff_t.md))
`std::`[`iterator_traits`](/reference/iterator/iterator_traits.md)`::difference_type`、および、`std::`[`iterator_traits`](/reference/iterator/iterator_traits.md)`::difference_type` と同じ。 | | | `pointer` | 要素 `value_type`へのポインタ。
C++03 : `typename Allocator::pointer`。
C++11以降 : `typename` [`allocator_traits`](/reference/memory/allocator_traits.md)`::pointer`。 | | -| `const pointer` | 要素 `value_type`への`const`ポインタ。
C++03 : `typename Allocator::const_pointer`。
C++11以降 : `typename` [`allocator_traits`](/reference/memory/allocator_traits.md)`::const_pointer`。 | | +| `const_pointer` | 要素 `value_type`への`const`ポインタ。
C++03 : `typename Allocator::const_pointer`。
C++11以降 : `typename` [`allocator_traits`](/reference/memory/allocator_traits.md)`::const_pointer`。 | | | `reverse_iterator` | 逆順双方向イテレータ。`std::`[`reverse_iterator`](/reference/iterator/reverse_iterator.md)``。 | | | `const_reverse_iterator` | 読み取り専用逆順双方向イテレータ。`std::`[`reverse_iterator`](/reference/iterator/reverse_iterator.md)``。 | | | `node_type` | [`node_handle`](/reference/node_handle/node_handle.md)クラステンプレートの特殊化。 | C++17 | diff --git a/reference/map/multimap.md b/reference/map/multimap.md index b5381dce87..8cf3d751de 100644 --- a/reference/map/multimap.md +++ b/reference/map/multimap.md @@ -135,7 +135,7 @@ namespace std { | `size_type` | 要素数を表す符号なし整数型。`difference_type` で表現可能な非負整数(0以上の整数)を表すことが可能。(通常は [`size_t`](/reference/cstddef/size_t.md)) | | | `difference_type` | 同一のコンテナを指す `iterator` の差を表す符号付き整数型(通常は [`ptrdiff_t`](/reference/cstddef/ptrdiff_t.md))
`std::`[`iterator_traits`](/reference/iterator/iterator_traits.md)`::difference_type`、および、`std::`[`iterator_traits`](/reference/iterator/iterator_traits.md)`::difference_type` と同じ。 | | | `pointer` | 要素 `value_type`へのポインタ。
C++03 : `typename Allocator::pointer`。
C++11以降 : `typename` [`allocator_traits`](/reference/memory/allocator_traits.md)`::pointer`。 | | -| `const pointer` | 要素 `value_type`への`const`ポインタ。
C++03 : `typename Allocator::const_pointer`。
C++11以降 : `typename` [`allocator_traits`](/reference/memory/allocator_traits.md)`::const_pointer`。 | | +| `const_pointer` | 要素 `value_type`への`const`ポインタ。
C++03 : `typename Allocator::const_pointer`。
C++11以降 : `typename` [`allocator_traits`](/reference/memory/allocator_traits.md)`::const_pointer`。 | | | `reverse_iterator` | 逆順双方向イテレータ。`std::`[`reverse_iterator`](/reference/iterator/reverse_iterator.md)``。 | | | `const_reverse_iterator` | 読み取り専用逆順双方向イテレータ。`std::`[`reverse_iterator`](/reference/iterator/reverse_iterator.md)``。 | | | `node_type` | [`node_handle`](/reference/node_handle/node_handle.md)クラステンプレートの特殊化。 | C++17 | diff --git a/reference/set/multiset.md b/reference/set/multiset.md index e8d765498c..36892db95a 100644 --- a/reference/set/multiset.md +++ b/reference/set/multiset.md @@ -124,7 +124,7 @@ namespace std { | `size_type` | 要素数を表す符号なし整数型。`difference_type` で表現可能な非負整数(0以上の整数)を表すことが可能。(通常は [`size_t`](/reference/cstddef/size_t.md)) | | | `difference_type` | 同一のコンテナを指す `iterator` の差を表す符号付き整数型(通常は [`ptrdiff_t`](/reference/cstddef/ptrdiff_t.md))
`std::`[`iterator_traits`](/reference/iterator/iterator_traits.md)`::difference_type`、および、`std::`[`iterator_traits`](/reference/iterator/iterator_traits.md)`::difference_type` と同じ。 | | | `pointer` | 要素 `value_type`へのポインタ。
C++03 : `typename Allocator::pointer`。
C++11以降 : `typename` [`allocator_traits`](/reference/memory/allocator_traits.md)`::pointer`。 | | -| `const pointer` | 要素 `value_type`への`const`ポインタ。
C++03 : `typename Allocator::const_pointer`。
C++11以降 : `typename` [`allocator_traits`](/reference/memory/allocator_traits.md)`::const_pointer`。 | | +| `const_pointer` | 要素 `value_type`への`const`ポインタ。
C++03 : `typename Allocator::const_pointer`。
C++11以降 : `typename` [`allocator_traits`](/reference/memory/allocator_traits.md)`::const_pointer`。 | | | `reverse_iterator` | 逆順双方向イテレータ。`std::`[`reverse_iterator`](/reference/iterator/reverse_iterator.md)``。 | | | `const_reverse_iterator` | 読み取り専用逆順双方向イテレータ。`std::`[`reverse_iterator`](/reference/iterator/reverse_iterator.md)``。 | | | `node_type` | [`node_handle`](/reference/node_handle/node_handle.md)クラステンプレートの特殊化。 | C++17 | diff --git a/reference/set/set.md b/reference/set/set.md index ad6b0a5dff..2b94af98de 100644 --- a/reference/set/set.md +++ b/reference/set/set.md @@ -125,7 +125,7 @@ namespace std { | `size_type` | 要素数を表す符号なし整数型。`difference_type` で表現可能な非負整数(0以上の整数)を表すことが可能。(通常は [`size_t`](/reference/cstddef/size_t.md)) | | | `difference_type` | 同一のコンテナを指す `iterator` の差を表す符号付き整数型(通常は [`ptrdiff_t`](/reference/cstddef/ptrdiff_t.md))
`std::`[`iterator_traits`](/reference/iterator/iterator_traits.md)`::difference_type`、および、`std::`[`iterator_traits`](/reference/iterator/iterator_traits.md)`::difference_type` と同じ。 | | | `pointer` | 要素 `value_type`へのポインタ。
C++03 : `typename Allocator::pointer`。
C++11以降 : `typename` [`allocator_traits`](/reference/memory/allocator_traits.md)`::pointer`。 | | -| `const pointer` | 要素 `value_type`への`const`ポインタ。
C++03 : `typename Allocator::const_pointer`。
C++11以降 : `typename` [`allocator_traits`](/reference/memory/allocator_traits.md)`::const_pointer`。 | | +| `const_pointer` | 要素 `value_type`への`const`ポインタ。
C++03 : `typename Allocator::const_pointer`。
C++11以降 : `typename` [`allocator_traits`](/reference/memory/allocator_traits.md)`::const_pointer`。 | | | `reverse_iterator` | 逆順双方向イテレータ。`std::`[`reverse_iterator`](/reference/iterator/reverse_iterator.md)``。 | | | `const_reverse_iterator` | 読み取り専用逆順双方向イテレータ。`std::`[`reverse_iterator`](/reference/iterator/reverse_iterator.md)``。 | | | `node_type` | [`node_handle`](/reference/node_handle/node_handle.md)クラステンプレートの特殊化。 | C++17 | From 9fe59f7c3a1b97adef5bc273c0ab9f81f8b085a7 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 17 Apr 2023 18:07:27 +0900 Subject: [PATCH 0274/3948] =?UTF-8?q?flat=5Fmap=E3=82=AF=E3=83=A9=E3=82=B9?= =?UTF-8?q?=E3=81=AE=E3=83=9A=E3=83=BC=E3=82=B8=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20#1078?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map.md | 4 +- reference/flat_map/flat_map.md | 171 ++++++++++++++++++++ reference/format/format.md | 2 +- reference/format/range-default-formatter.md | 2 +- reference/format/range_format.md | 2 +- 5 files changed, 176 insertions(+), 5 deletions(-) create mode 100644 reference/flat_map/flat_map.md diff --git a/reference/flat_map.md b/reference/flat_map.md index 568ef4d4e1..7523236c44 100644 --- a/reference/flat_map.md +++ b/reference/flat_map.md @@ -6,7 +6,7 @@ [`std::map`](/reference/map/map.md)と違ってノードベースの実装ではなく、メモリ連続性のある平坦 (flat) な配列で扱われる。 -`` ヘッダでは、キーの重複を許さない `std::`[`flat_map`](flat_map/flat_map.md.nolink) クラステンプレート、およびキーの重複を許す `std::`[`flat_multimap`](flat_map/flat_multimap.md.nolink) クラステンプレートを提供する。 +`` ヘッダでは、キーの重複を許さない `std::`[`flat_map`](flat_map/flat_map.md) クラステンプレート、およびキーの重複を許す `std::`[`flat_multimap`](flat_map/flat_multimap.md.nolink) クラステンプレートを提供する。 このヘッダでは、以下の標準ヘッダをインクルードする: @@ -16,7 +16,7 @@ | 名前 | 説明 | 対応バージョン | |----------------------------------------------|--------------------------------------------------------|-------| -| [`flat_map`](flat_map/flat_map.md.nolink) | キーの重複を許さない平坦な順序付き連想コンテナ(class template) | C++23 | +| [`flat_map`](flat_map/flat_map.md) | キーの重複を許さない平坦な順序付き連想コンテナ(class template) | C++23 | | [`flat_multimap`](flat_map/flat_multimap.md.nolink) | キーの重複を許す平坦な順序付き連想コンテナ(class template) | C++23 | diff --git a/reference/flat_map/flat_map.md b/reference/flat_map/flat_map.md new file mode 100644 index 0000000000..c49ed299d6 --- /dev/null +++ b/reference/flat_map/flat_map.md @@ -0,0 +1,171 @@ +# flat_map +* flat_map[meta header] +* std[meta namespace] +* class template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template , + class KeyContainer = vector, + class MappedContainer = vector> + class flat_map; +} +``` +* less[link ../functional/less.md] +* vector[link /reference/vector.md] + +## 概要 + + +## メンバ関数 +### 構築・破棄 + +| 名前 | 説明 | 対応バージョン | +|---------------------------------|----------------|-------| +| [`(constructor)`](flat_map/op_constructor.md.nolink) | コンストラクタ | C++23 | +| [`(destructor)`](flat_map/op_destructor.md.nolink) | デストラクタ | C++23 | +| [`operator=`](flat_map/op_assign.md.nolink) | 代入演算子 | C++23 | + + +### イテレータ + +| 名前 | 説明 | 対応バージョン | +|------------------------------|----------------------------------------------|-------| +| [`begin`](flat_map/begin.md.nolink) | 先頭を指すイテレータを取得する | C++23 | +| [`cbegin`](flat_map/cbegin.md.nolink) | 先頭を指す読み取り専用イテレータを取得する | C++23 | +| [`end`](flat_map/end.md.nolink) | 末尾を指すイテレータを取得する | C++23 | +| [`cend`](flat_map/cend.md.nolink) | 末尾を指す読み取り専用イテレータを取得する | C++23 | +| [`rbegin`](flat_map/rbegin.md.nolink) | 末尾を指す逆イテレータを取得する | C++23 | +| [`crbegin`](flat_map/crbegin.md.nolink) | 末尾を指す読み取り専用逆イテレータを取得する | C++23 | +| [`rend`](flat_map/rend.md.nolink) | 先頭を指す逆イテレータを取得する | C++23 | +| [`crend`](flat_map/crend.md.nolink) | 先頭を指す読み取り専用逆イテレータを取得する | C++23 | + + +### 領域 + +| 名前 | 説明 | 対応バージョン | +|---------------------------------|------------------------------------|-------| +| [`empty`](flat_map/empty.md.nolink) | コンテナが空であるかどうかを調べる | C++23 | +| [`size`](flat_map/size.md.nolink) | 要素数を取得する | C++23 | +| [`max_size`](flat_map/max_size.md.nolink) | 格納可能な最大の要素数を取得する | C++23 | + + +### コンテナの変更 + +| 名前 | 説明 | 対応バージョン | +|-----------------------------------------------|--------------------------------------------|----------------| +| [`clear`](flat_map/clear.md.nolink) | 全ての要素を削除する | C++23 | +| [`insert`](flat_map/insert.md.nolink) | 要素を挿入する | C++23 | +| [`insert_or_assign`](flat_map/insert_or_assign.md.nolink) | 要素を挿入、あるいは代入する | C++23 | +| [`insert_range`](flat_map/insert_range.md.nolink) | Rangeを挿入する | C++23 | +| [`emplace`](flat_map/emplace.md.nolink) | 要素を直接構築する | C++23 | +| [`emplace_hint`](flat_map/emplace_hint.md.nolink) | ヒントを使って要素を直接構築する | C++23 | +| [`try_emplace`](flat_map/try_emplace.md.nolink) | キーが存在しない場合のみ要素を直接構築する | C++23 | +| [`erase`](flaflat_maptmap/erase.md.nolink) | 要素を削除する | C++23 | +| [`swap`](flat_map/swap.md.nolink) | コンテンツを交換する | C++23 | +| [`extract`](flat_map/extract.md.nolink) | キーのコンテナ、値のコンテナを取得する | C++23 | +| [`replace`](flat_map/replace.md.nolink) | キーのコンテナ、値のコンテナを置き換える | C++23 | + + +### 要素アクセス + +| 名前 | 説明 | 対応バージョン | +|---------------------------------------|--------------------------------------------|-------| +| [`operator[]`](flat_map/op_at.md.nolink) | 指定したキーを持つ要素を取得する | C++23 | +| [`at`](flat_map/at.md.nolink) | 指定したキーを持つ要素を取得する | C++23 | +| [`count`](flat_map/count.md.nolink) | 指定したキーにマッチする要素の数を取得する | C++23 | +| [`find`](flat_map/find.md.nolink) | 指定したキーで要素を探す | C++23 | +| [`contains`](flat_map/contains.md.nolink) | 指定したキーの要素が含まれているかを判定する | C++23 | +| [`equal_range`](flat_map/equal_range.md.nolink) | 指定したキーにマッチする要素範囲を取得する | C++23 | +| [`lower_bound`](flat_map/lower_bound.md.nolink) | 与えられた値より小さくない最初の要素へのイテレータを取得する | C++23 | +| [`upper_bound`](flat_map/upper_bound.md.nolink) | 特定の値よりも大きい最初の要素へのイテレータを取得する | C++23 | + +### オブザーバー + +| 名前 | 説明 | 対応バージョン | +|-------------------------------------|----------------------------------------|----------------| +| [`key_comp`](flat_map/key_comp.md.nolink) | キー比較用の関数オブジェクトを取得する | C++23 | +| [`value_comp`](flat_map/value_comp.md.nolink) | 要素比較用の関数オブジェクトを取得する | C++23 | + +### 比較演算子 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`operator==`](flat_map/op_equal.md.nolink) | 左辺と右辺が等しいかの判定を行う | C++23 | +| `bool operator!=(const flat_map& x, const flat_map& y);` | 左辺と右辺が等しくないかの判定を行う (`==`により使用可能) | C++23 | +| [`operator<=>`](flat_map/op_compare_3way.md.nolink) | 三方比較を行う | C++23 | +| `bool operator<(const flat_map& x, const flat_map& y);` | 左辺が右辺より小さいかの判定を行う (`<=>`により使用可能) | C++23 | +| `bool operator<=(const flat_map& x, const flat_map& y);` | 左辺が右辺より小さいか等しいかの判定を行う (`<=>`により使用可能) | C++23 | +| `bool operator>(const flat_map& x, const flat_map& y);` | 左辺が右辺より大きいかの判定を行う (`<=>`により使用可能) | C++23 | +| `bool operator>=(const flat_map& x, const flat_map& y);` | 左辺が右辺より大きいか等しいかの判定を行う (`<=>`により使用可能) | C++23 | + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `key_type` | キーの型。テンプレートパラメータ `Key` | C++23 | +| `mapped_type` | 値の型。テンプレートパラメータ `T` | C++23 | +| `value_type` | 要素の型。`[`std::pair`](/reference/utility/pair.md)`` | C++23 | +| `key_compare` | キー値の大小関係を判定する二項述語の型。テンプレートパラメータ `Compare` | C++23 | +| [`value_compare`](flat_map/value_compare.md.nolink) | 要素値のキー部分で大小関係を判定する二項述語の型。入れ子クラス | C++23 | +| `reference` | 要素への参照型。[`std::pair`](/reference/utility/pair.md)`` | C++23 | +| `const_reference` | 要素への`const`参照型。[`std::pair`](/reference/utility/pair.md)`` | C++23 | +| `size_type` | 要素数を表す符号なし整数型 [`size_t`](/reference/cstddef/size_t.md) | C++23 | +| `difference_type` | 同一のコンテナを指す `iterator` の差を表す符号付き整数型 [`ptrdiff_t`](/reference/cstddef/ptrdiff_t.md) | C++23 | +| `iterator` | 双方向イテレータ | C++23 | +| `const_iterator` | 読み取り専用双方向イテレータ | C++23 | +| `reverse_iterator` | 逆順双方向イテレータ。[`std::reverse_iterator`](/reference/iterator/reverse_iterator.md)`` | C++23 | +| `const_reverse_iterator` | 読み取り専用逆順双方向イテレータ。[`std::reverse_iterator`](/reference/iterator/reverse_iterator.md)`` | C++23 | +| `key_container_type` | キーを格納するコンテナ型 `KeyContainer` | C++23 | +| `mapped_container_type` | 値を格納するコンテナ型 `MappedContainer` | C++23 | +| [`containers`](flat_map/containers.md.nolink) | キーのコンテナと値のコンテナを保持する型 | C++23 | + + +## 非メンバ関数 +### 入れ替え + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`swap`](flat_map/swap_free.md.nolink) | 2つの`flat_map`オブジェクトを入れ替える | C++23 | + + +### 要素削除 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`erase_if`](flat_map/erase_if_free.md.nolink) | 指定した条件に合致する要素とその分の領域を、コンテナから削除する | C++23 | + + +## 推論補助 + +| 名前 | 説明 | 対応バージョン | +|---------------------------------------------|------------------------------------|-------| +| [`(deduction_guide)`](flat_map/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | + + +## 例 +### 基本的な使い方 + +#### 出力 + + + +### ユーザー定義型をキーとして使用する (`operator<=>`を定義) +``` + +#### 出力 + + +### ユーザー定義型をキーとして使用する (大小比較の関数オブジェクトを定義) +#### 出力 + + +## 参照 +- [P0429R3 A Standard `flat_map`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0429r3.pdf) + - C++23で`flat_map`が導入された経緯・動機・設計について記載されている +- [P0429R9 A Standard `flat_map`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0429r9.pdf) + - C++23で導入された`flat_map`の仕様 diff --git a/reference/format/format.md b/reference/format/format.md index cf7c5f0d40..875d62741b 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -476,7 +476,7 @@ int main() * pque.push[link /reference/queue/priority_queue/push.md] * std::stack[link /reference/stack/stack.md] * st.push[link /reference/stack/stack/push.md] -* std::flat_map[link /reference/flat_map/flat_map.md.nolink] +* std::flat_map[link /reference/flat_map/flat_map.md] * std::flat_set[link /reference/flat_map/flat_set.md.nolink] #### 出力 diff --git a/reference/format/range-default-formatter.md b/reference/format/range-default-formatter.md index 3d5c97b1e5..45f154b179 100644 --- a/reference/format/range-default-formatter.md +++ b/reference/format/range-default-formatter.md @@ -40,7 +40,7 @@ namespace std { - (1) : プライマリテンプレート。宣言のみ - (2) : Range・シーケンスコンテナに対する特殊化。デバッグ出力の有効化と、`[a, b, c]`形式の出力を行う -- (3) : [`std::map`](/reference/map/map.md)や[`std::flat_map`](/reference/flat_map/flat_map.md.nolink)などの連想コンテナに対する特殊化。デバッグ出力の有効化と、`{1: a, 2: b}`形式での出力を行う +- (3) : [`std::map`](/reference/map/map.md)や[`std::flat_map`](/reference/flat_map/flat_map.md)などの連想コンテナに対する特殊化。デバッグ出力の有効化と、`{1: a, 2: b}`形式での出力を行う - (4) : [`std::set`](/reference/set/set.md)や[`std::flat_set`](/reference/flat_set/flat_set.md.nolink)などの集合コンテナに対する特殊化。デバッグ出力の有効化と、`{a, b, c}`形式の出力を行う - (5) : 文字列形式の出力を行うRangeに対する特殊化。Rangeを文字列として出力し、[`range_format::debug_string`](range_format.md)指定であればデバッグ文字列として出力する diff --git a/reference/format/range_format.md b/reference/format/range_format.md index eca360a279..be68bcd919 100644 --- a/reference/format/range_format.md +++ b/reference/format/range_format.md @@ -24,7 +24,7 @@ Rangeの書式種別を表す列挙型。 | 列挙値 | 説明 | |----------------|------| | `disabled` | 書式化ができないRangeであることを表す値 | -| `map` | [`std::map`](/reference/map/map.md)や[`std::flat_map`](/reference/flat_map/flat_map.md.nolink)向けの書式。`{k1: v1, k2: v2}` | +| `map` | [`std::map`](/reference/map/map.md)や[`std::flat_map`](/reference/flat_map/flat_map.md)向けの書式。`{k1: v1, k2: v2}` | | `set` | [`std::set`](/reference/set/set.md)や[`std::flat_set`](/reference/flat_set/flat_set.md.nolink)向けの書式。`{v1, v2}` | | `sequence` | [`std::vector`](/reference/vector/vector.md)や[`std::array`](/reference/array/array.md)向けの書式。`[v1, v2]`| | `string` | 文字列向けの書式。`abc` | From 3ecf9caed67da356223be078b0707556c9226e2c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 17 Apr 2023 18:20:36 +0900 Subject: [PATCH 0275/3948] =?UTF-8?q?flat=5Fmap=20:=20=E6=A7=8B=E6=96=87?= =?UTF-8?q?=E3=83=9F=E3=82=B9=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/flat_map/flat_map.md b/reference/flat_map/flat_map.md index c49ed299d6..caea672f58 100644 --- a/reference/flat_map/flat_map.md +++ b/reference/flat_map/flat_map.md @@ -109,7 +109,7 @@ namespace std { |------|------|----------------| | `key_type` | キーの型。テンプレートパラメータ `Key` | C++23 | | `mapped_type` | 値の型。テンプレートパラメータ `T` | C++23 | -| `value_type` | 要素の型。`[`std::pair`](/reference/utility/pair.md)`` | C++23 | +| `value_type` | 要素の型。[`std::pair`](/reference/utility/pair.md)`` | C++23 | | `key_compare` | キー値の大小関係を判定する二項述語の型。テンプレートパラメータ `Compare` | C++23 | | [`value_compare`](flat_map/value_compare.md.nolink) | 要素値のキー部分で大小関係を判定する二項述語の型。入れ子クラス | C++23 | | `reference` | 要素への参照型。[`std::pair`](/reference/utility/pair.md)`` | C++23 | From 82cec00a8113857dd68414dc45d1b4803cf83a74 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 17 Apr 2023 18:38:11 +0900 Subject: [PATCH 0276/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E3=83=96?= =?UTF-8?q?=E3=83=AD=E3=83=83=E3=82=AF=E3=81=AE=E6=B6=88=E3=81=97=E5=BF=98?= =?UTF-8?q?=E3=82=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map.md | 1 - 1 file changed, 1 deletion(-) diff --git a/reference/flat_map/flat_map.md b/reference/flat_map/flat_map.md index caea672f58..b26f495540 100644 --- a/reference/flat_map/flat_map.md +++ b/reference/flat_map/flat_map.md @@ -155,7 +155,6 @@ namespace std { ### ユーザー定義型をキーとして使用する (`operator<=>`を定義) -``` #### 出力 From 0ce85f3d6aa5f19188d506288f7f3101ee3313c3 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 18 Apr 2023 17:02:01 +0900 Subject: [PATCH 0277/3948] =?UTF-8?q?flat=5Fmap=20:=20=E6=AF=94=E8=BC=83?= =?UTF-8?q?=E6=BC=94=E7=AE=97=E5=AD=90=E3=81=A8swap=E3=82=92=E9=9D=9E?= =?UTF-8?q?=E3=83=A1=E3=83=B3=E3=83=90=20(Hidden=20Friends)=20=E9=96=A2?= =?UTF-8?q?=E6=95=B0=E3=81=AB=E5=88=86=E9=A1=9E=20#1142?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map.md | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/reference/flat_map/flat_map.md b/reference/flat_map/flat_map.md index b26f495540..ac96b9be44 100644 --- a/reference/flat_map/flat_map.md +++ b/reference/flat_map/flat_map.md @@ -90,18 +90,6 @@ namespace std { | [`key_comp`](flat_map/key_comp.md.nolink) | キー比較用の関数オブジェクトを取得する | C++23 | | [`value_comp`](flat_map/value_comp.md.nolink) | 要素比較用の関数オブジェクトを取得する | C++23 | -### 比較演算子 - -| 名前 | 説明 | 対応バージョン | -|------|------|----------------| -| [`operator==`](flat_map/op_equal.md.nolink) | 左辺と右辺が等しいかの判定を行う | C++23 | -| `bool operator!=(const flat_map& x, const flat_map& y);` | 左辺と右辺が等しくないかの判定を行う (`==`により使用可能) | C++23 | -| [`operator<=>`](flat_map/op_compare_3way.md.nolink) | 三方比較を行う | C++23 | -| `bool operator<(const flat_map& x, const flat_map& y);` | 左辺が右辺より小さいかの判定を行う (`<=>`により使用可能) | C++23 | -| `bool operator<=(const flat_map& x, const flat_map& y);` | 左辺が右辺より小さいか等しいかの判定を行う (`<=>`により使用可能) | C++23 | -| `bool operator>(const flat_map& x, const flat_map& y);` | 左辺が右辺より大きいかの判定を行う (`<=>`により使用可能) | C++23 | -| `bool operator>=(const flat_map& x, const flat_map& y);` | 左辺が右辺より大きいか等しいかの判定を行う (`<=>`により使用可能) | C++23 | - ## メンバ型 @@ -126,18 +114,32 @@ namespace std { ## 非メンバ関数 -### 入れ替え +### 要素削除 | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`swap`](flat_map/swap_free.md.nolink) | 2つの`flat_map`オブジェクトを入れ替える | C++23 | +| [`erase_if`](flat_map/erase_if_free.md.nolink) | 指定した条件に合致する要素とその分の領域を、コンテナから削除する | C++23 | -### 要素削除 +## 非メンバ(*Hidden friends*)関数 +### 比較演算子 | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`erase_if`](flat_map/erase_if_free.md.nolink) | 指定した条件に合致する要素とその分の領域を、コンテナから削除する | C++23 | +| [`operator==`](flat_map/op_equal.md.nolink) | 左辺と右辺が等しいかの判定を行う | C++23 | +| `bool operator!=(const flat_map& x, const flat_map& y);` | 左辺と右辺が等しくないかの判定を行う (`==`により使用可能) | C++23 | +| [`operator<=>`](flat_map/op_compare_3way.md.nolink) | 三方比較を行う | C++23 | +| `bool operator<(const flat_map& x, const flat_map& y);` | 左辺が右辺より小さいかの判定を行う (`<=>`により使用可能) | C++23 | +| `bool operator<=(const flat_map& x, const flat_map& y);` | 左辺が右辺より小さいか等しいかの判定を行う (`<=>`により使用可能) | C++23 | +| `bool operator>(const flat_map& x, const flat_map& y);` | 左辺が右辺より大きいかの判定を行う (`<=>`により使用可能) | C++23 | +| `bool operator>=(const flat_map& x, const flat_map& y);` | 左辺が右辺より大きいか等しいかの判定を行う (`<=>`により使用可能) | C++23 | + + +### 入れ替え + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`swap`](flat_map/swap_free.md.nolink) | 2つの`flat_map`オブジェクトを入れ替える | C++23 | ## 推論補助 From 45cd04b0f7f0abbdb7cfbc314a9354f0bf85b154 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 19 Apr 2023 17:18:32 +0900 Subject: [PATCH 0278/3948] =?UTF-8?q?launder()=E3=81=8C=E5=BF=85=E8=A6=81?= =?UTF-8?q?=E3=81=AB=E3=81=AA=E3=82=8B=E5=A0=B4=E5=90=88=E3=81=AE=E8=A7=A3?= =?UTF-8?q?=E6=B1=BA=E3=82=B3=E3=83=BC=E3=83=89=E3=82=92=E5=89=8A=E9=99=A4?= =?UTF-8?q?=20#1117?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...jects_for_low-level_object_manipulation.md | 76 +------------------ 1 file changed, 4 insertions(+), 72 deletions(-) diff --git a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md index 5d41421f92..a2e04f0665 100644 --- a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md +++ b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md @@ -361,83 +361,15 @@ unique_ptr Stream::read() { この`read()`内の`new char[N]`によって呼ばれる`operator new[]`によって`Foo`/`Bar`のオブジェクトが暗黙的に構築される。この場合、`buffer[0] == FOO`による分岐によってプログラムに定義された振る舞いをもたらすオブジェクトは、`Foo`と`Bar`のオブジェクトとして2つ存在する。したがって、ここでは先頭バイトの状態に応じて適切なオブジェクトが構築される(そうすることでプログラムに定義された振る舞いをもたらす)ため、`process()`内では未定義動作は回避される。 -```cpp -void process(Stream *stream) { - // バイト配列の読み出し - std::unique_ptr buffer = stream->read(); - - // 先頭バイトの状態によって適切なオブジェクトがStream::read()内で構築されている - // ただし、reinterpret_castの代わりにstd::launder()を使用する必要がある - if (buffer[0] == FOO) { - process_foo(std::launder(buffer.get())); // ✅ ok - } else { - process_bar(std::launder(buffer.get())); // ✅ ok - } -} -``` -* std::launder[link /reference/new/launder.md] +ただし、`process()`内の各分岐においては、返された`buffer`ポインタ(`char(*)[]`)からそれぞれの場合で適切なオブジェクト(`Foo`/`Bar`)へのポインタを、[`std::launder()`](/reference/new/launder.md)を用いて取得する必要がある。 -追加で、各分岐においては返された`buffer`ポインタ(`char(*)[]`)から、それぞれの場合で適切なオブジェクト(`Foo`/`Bar`)へのポインタを[`std::launder()`](/reference/new/launder.md)によって取得する必要がある。`reinterpret_cast`はポインタの変換のみを行うため、この場合に +`reinterpret_cast`はポインタ型の変換のみを行うが、型変換だけではそのポインタはその領域に生存期間内にあるオブジェクトと必ずしもリンクしない。`std::launder()`は、渡されたポインタの領域で生存期間内にあるオブジェクトへのポインタを生成して返す関数であり、これを用いることで暗黙的に構築されたオブジェクトへの適切なポインタを得ることができる。 ### 動的配列の実装 -```cpp -// std::vectorの様な動的配列型を実装したい -template -struct Vec { - char *buf = nullptr; - char *buf_end_size = nullptr; - char *buf_end_capacity = nullptr; - - void reserve(std::size_t n) { - // 後続の操作を適格にするためのオブジェクトを暗黙的に構築する - // ここでは、Tの配列型T[]のオブジェクトが暗黙的に構築される(要素のオブジェクトは構築されない) - // 同時に、char[]のオブジェクトも暗黙的に構築される - char *newbuf = (char*)::operator new(n * sizeof(T), std::align_val_t(alignof(T))); - - // newbufにはT[]のオブジェクトが生存期間内にあるため、ポインタT*をイテレータとして使用可能となる - // ここで、T[]の要素のTのオブジェクトが構築される(明示的) - std::uninitialized_copy(begin(), end(), std::launder(newbuf)); // #a ✅ ok - - ::operator delete(buf, std::align_val_t(alignof(T))); - - buf = newbuf; - // newbufにはchar[]のオブジェクトが生存期間内にあるため、newbuf(char*)をイテレータとして使用可能となる - buf_end_size = newbuf + sizeof(T) * size(); // #b ✅ ok - buf_end_capacity = newbuf + sizeof(T) * n; // #c ✅ ok - } - - void push_back(T t) { - if (buf_end_size == buf_end_capacity) - reserve(std::max(size() * 2, 1)); - new (buf_end_size) T(t); - - // buf_end_sizeの指す領域にはchar[]のオブジェクトが生存期間内にあるため、ポインタをイテレータとして使用可能 - buf_end_size += sizeof(T); // #d ✅ ok - } - - T *begin() { return std::launder(buf); } - - T *end() { return std::launder(buf_end_size); } - - // buf及びbuf_end_sizeの指す領域にはT[]のオブジェクトが生存期間内にあるため、ポインタをイテレータとして使用可能 - std::size_t size() { return end() - begin(); } // #e ✅ ok -}; - -int main() { - Vec v; - v.push_back(1); - v.push_back(2); - v.push_back(3); - - // 実装内部で暗黙的に配列オブジェクトが構築されることでUBが回避される - for (int n : v) { /*...*/ } // #f ✅ ok -} -``` - -この例では、`reserve()`内`newbuf`及びそれを保存している`Vec::buf`の領域に`T[]`(`T`の配列型)と`char[]`のオブジェクトが暗黙的に構築され、同時に生存期間内にあることで、問題(配列オブジェクトを指さないポインタのイテレータとしての使用)が解消され、すべての箇所で定義された振る舞いをもたらしている。 +この例では、`reserve()`内`newbuf`及びそれを保存している`Vec::buf`の領域に`T[]`(`T`の配列型)と`char[]`のオブジェクトが暗黙的に構築され、同時に生存期間内にあることで、問題(配列オブジェクトを指さないポインタのイテレータとしての使用)は解消される。 -ここでも同様に、`newbuf`及び`Vec::buf`から都度適切なオブジェクトへのポインタを得るのに[`std::launder()`](/reference/new/launder.md)を使用する必要がある。 +ただし、`newbuf`及び`Vec::buf`から都度適切なオブジェクトへのポインタを得るのに[`std::launder()`](/reference/new/launder.md)を適切使用する必要がある。 ## この機能が必要になった背景・経緯 (執筆中) From 1c743fb17397e72155bcdc8c3f60f431add22fce Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 19 Apr 2023 18:00:15 +0900 Subject: [PATCH 0279/3948] =?UTF-8?q?=E8=83=8C=E6=99=AF=E3=81=A8=E3=81=9D?= =?UTF-8?q?=E3=81=AE=E4=BB=96=E9=81=B8=E6=8A=9E=E8=82=A2=E8=BF=BD=E8=A8=98?= =?UTF-8?q?=20#1117?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...jects_for_low-level_object_manipulation.md | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md index a2e04f0665..ac70f082a1 100644 --- a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md +++ b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md @@ -369,15 +369,29 @@ unique_ptr Stream::read() { この例では、`reserve()`内`newbuf`及びそれを保存している`Vec::buf`の領域に`T[]`(`T`の配列型)と`char[]`のオブジェクトが暗黙的に構築され、同時に生存期間内にあることで、問題(配列オブジェクトを指さないポインタのイテレータとしての使用)は解消される。 -ただし、`newbuf`及び`Vec::buf`から都度適切なオブジェクトへのポインタを得るのに[`std::launder()`](/reference/new/launder.md)を適切使用する必要がある。 +ただし、`newbuf`及び`Vec::buf`から都度適切なオブジェクトへのポインタを得るのに[`std::launder()`](/reference/new/launder.md)を適切に使用する必要がある。 ## この機能が必要になった背景・経緯 -(執筆中) +例に上がっているようなコードはC言語では一般的な操作であり、Cでは問題がない。このようなコードはCとC++のコード共有部分でC++コードとして現れる可能性があり、その場合には未定義動作となる。 + +また、動的配列の例などは、`std::vector`の実装において問題となることで、そこは完全にC++のコードでありながらC++がサポートしてないことを行うことになってしまう。 + +これらの問題は、影響を受けるコードが多すぎるため実装はこれを最適化に用いたりはしないと考えられるため、実際には問題とならない可能性が高かった。しかし、これらのよく書かれているコードをC++がサポートしていないという奇妙な状況を改善するため、暗黙的なオブジェクト構築という仕様が導入された。 ## 検討されたほかの選択肢 -(執筆中) +上記の問題を解決するための方法として、暗黙的なオブジェクト構築以外に + +- 問題となる操作を無条件で合法化 +- ライブラリ関数を追加して、それを介してコンパイラに意図を伝達 +- `std::span`を特別扱いして、関連する操作を合法化 + +などが考案されていた。 + +最終的には、暗黙的なオブジェクト構築のように、C++のオブジェクトモデルを修正する形でこの問題を解消することになった。 + +ただし、2番目の特殊なライブラリ関数もC++23で`std::start_lifetime_as()`として追加されテイル。 ## 関連項目 From f81c873437dd6933e6a0668ba1b3959051b865b1 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 19 Apr 2023 18:02:51 +0900 Subject: [PATCH 0280/3948] =?UTF-8?q?=E5=8F=82=E8=80=83=E3=83=AA=E3=83=B3?= =?UTF-8?q?=E3=82=AF=E8=BF=BD=E5=8A=A0=E3=81=A8=E4=BF=AE=E6=AD=A3=20#1117?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...it_creation_of_objects_for_low-level_object_manipulation.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md index ac70f082a1..9ade0289ad 100644 --- a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md +++ b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md @@ -391,7 +391,7 @@ unique_ptr Stream::read() { 最終的には、暗黙的なオブジェクト構築のように、C++のオブジェクトモデルを修正する形でこの問題を解消することになった。 -ただし、2番目の特殊なライブラリ関数もC++23で`std::start_lifetime_as()`として追加されテイル。 +ただし、2番目の特殊なライブラリ関数もC++23で`std::start_lifetime_as()`として追加されている。 ## 関連項目 @@ -402,6 +402,7 @@ unique_ptr Stream::read() { ## 参照 - [P0593R6 Implicit creation of objects for low-level object manipulation](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p0593r6.html) +- [P0593R0 What to do with buffers that are not arrays, and undefined behavior thereof?](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0593r0.html) - [CWG Issue 2325. `std::launder` and reuse of character buffers](https://cplusplus.github.io/CWG/issues/2325.html) - [CWG Issue 2605. Implicit-lifetime aggregates](https://cplusplus.github.io/CWG/issues/2605.html) - [P1839R5 Accessing Object Representations](https://wg21.link/p1839r5) From a13c86a40039bef44b954d1f33455a41fc1eaab9 Mon Sep 17 00:00:00 2001 From: Tomoya Adachi Date: Thu, 20 Apr 2023 01:20:06 +0900 Subject: [PATCH 0281/3948] numeric_limits: Add and fix links to cfloat --- reference/limits/numeric_limits/digits.md | 2 +- reference/limits/numeric_limits/max_exponent.md | 6 +++--- reference/limits/numeric_limits/min_exponent.md | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/reference/limits/numeric_limits/digits.md b/reference/limits/numeric_limits/digits.md index d2df4503de..a31713bcc9 100644 --- a/reference/limits/numeric_limits/digits.md +++ b/reference/limits/numeric_limits/digits.md @@ -30,7 +30,7 @@ static constexpr int digits; // C++11 |---------------|-----------------------------------------------------| | `float` | [`FLT_MANT_DIG`](/reference/cfloat/flt_mant_dig.md) | | `double` | [`DBL_MANT_DIG`](/reference/cfloat/dbl_mant_dig.md) | -| `long double` | [`LDBL_MANT_DIG`](/reference/cfloat/ldbl_dig.md) | +| `long double` | [`LDBL_MANT_DIG`](/reference/cfloat/ldbl_mant_dig.md) | ## 例 diff --git a/reference/limits/numeric_limits/max_exponent.md b/reference/limits/numeric_limits/max_exponent.md index 9a0e692162..ee9ca5812e 100644 --- a/reference/limits/numeric_limits/max_exponent.md +++ b/reference/limits/numeric_limits/max_exponent.md @@ -21,9 +21,9 @@ static constexpr int max_exponent; | 型 | 対応するマクロ | |---------------|----------------| -| `float` | `FLT_MAX_EXP` | -| `double` | `DBL_MAX_EXP` | -| `long double` | `LDBL_MAX_EXP` | +| `float` | [`FLT_MAX_EXP`](/reference/cfloat/flt_max_exp.md) | +| `double` | [`DBL_MAX_EXP`](/reference/cfloat/dbl_max_exp.md) | +| `long double` | [`LDBL_MAX_EXP`](/reference/cfloat/ldbl_max_exp.md) | ## 例 diff --git a/reference/limits/numeric_limits/min_exponent.md b/reference/limits/numeric_limits/min_exponent.md index ad9f2ea1c3..30828fe39a 100644 --- a/reference/limits/numeric_limits/min_exponent.md +++ b/reference/limits/numeric_limits/min_exponent.md @@ -21,9 +21,9 @@ static constexpr int min_exponent; | 型 | 対応するマクロ | |---------------|----------------| -| `float` | `FLT_MIN_EXP` | -| `double` | `DBL_MIN_EXP` | -| `long double` | `LDBL_MIN_EXP` | +| `float` | [`FLT_MIN_EXP`](/reference/cfloat/flt_min_exp.md) | +| `double` | [`DBL_MIN_EXP`](/reference/cfloat/dbl_min_exp.md) | +| `long double` | [`LDBL_MIN_EXP`](/reference/cfloat/ldbl_min_exp.md) | ## 例 From 4816cf7b669210665378bf3cdf43dd1b6b2cfa70 Mon Sep 17 00:00:00 2001 From: Tomoya Adachi Date: Thu, 20 Apr 2023 01:23:38 +0900 Subject: [PATCH 0282/3948] numeric_limits: Fix description of max/min_exponent --- reference/limits/numeric_limits/max_exponent.md | 2 +- reference/limits/numeric_limits/min_exponent.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/limits/numeric_limits/max_exponent.md b/reference/limits/numeric_limits/max_exponent.md index ee9ca5812e..95f84a9c53 100644 --- a/reference/limits/numeric_limits/max_exponent.md +++ b/reference/limits/numeric_limits/max_exponent.md @@ -14,7 +14,7 @@ static constexpr int max_exponent; ## 概要 浮動小数点数型において、型`T`の指数上限値を得る。 -基数[`radix`](radix.md)を`max_exponent`の値で累乗した値が、型`T`で表現可能な正規化された値となる最大の正の値。 +基数[`radix`](radix.md)を`max_exponent - 1`の値で累乗した値が、型`T`で表現可能な正規化された値となる最大の正の値。 浮動小数点数型以外は0になる。 対応するマクロを次の表に挙げる。 diff --git a/reference/limits/numeric_limits/min_exponent.md b/reference/limits/numeric_limits/min_exponent.md index 30828fe39a..253e15063f 100644 --- a/reference/limits/numeric_limits/min_exponent.md +++ b/reference/limits/numeric_limits/min_exponent.md @@ -14,7 +14,7 @@ static constexpr int min_exponent; ## 概要 浮動小数点数型において、型`T`の指数下限値を得る。 -基数[`radix`](radix.md)を`min_exponent`の値で累乗した値が、型`T`で表現可能な正規化された値となる最小の負の値。 +基数[`radix`](radix.md)を`min_exponent - 1`の値で累乗した値が、型`T`で表現可能な正規化された値となる最小の負の値。 浮動小数点数以外は0となる。 対応するマクロを次の表に挙げる。 From 5f8fea3398580638ca88fe270ac92b789e6e48bc Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 26 Apr 2023 16:29:59 +0900 Subject: [PATCH 0283/3948] =?UTF-8?q?=E3=82=AF=E3=83=A9=E3=82=B9=E3=81=AE?= =?UTF-8?q?=E9=9B=9B=E5=BD=A2=E3=83=9A=E3=83=BC=E3=82=B8=20:=20Hidden=20Fr?= =?UTF-8?q?iends=E3=81=AE=E8=A8=98=E8=BC=89=E4=BE=8B=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=20#1142?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start_editing/class_template_page.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/start_editing/class_template_page.md b/start_editing/class_template_page.md index e6c268aa80..525e7d8eb8 100644 --- a/start_editing/class_template_page.md +++ b/start_editing/class_template_page.md @@ -102,7 +102,7 @@ namespace std { (比較演算子がデフォルト定義され、個別ページを作らない場合の記述例。オペランドの組み合わせ数が多い場合には、個別ページを作ることを推奨する) | 名前 | 説明 | 対応バージョン | -|-----|-----|-----| +|------|------|----------------| | `bool operator==(const X&, const X&) = default;` | 等値比較 | | | `bool operator!=(const X&, const X&);` | 非等値比較 (`==`により使用可能) | | | `strong_ordering operator<=>(const X&, const X&) = default;` | 三方比較 | | @@ -112,6 +112,15 @@ namespace std { | `bool operator>=(const X&, const X&);` | 左辺が右辺以上かを判定する (`<=>`により使用可能) | | +## 非メンバ(*Hidden friends*)関数 + +(`friend`付きメンバ関数はこの見出し以下で記載する。[`counted_iterator`](/reference/iterator/counted_iterator.md)を例として参照) + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `swap` | 2つのオブジェクトを入れ替える | | + + ## 例 ```cpp example // (ここには、クラスを解説するための、サンプルコードを記述します。) From 629ccda92610146d4e330c73f6cc44cb1977330c Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 26 Apr 2023 17:29:03 +0900 Subject: [PATCH 0284/3948] =?UTF-8?q?=E6=9C=AA=E5=88=9D=E6=9C=9F=E5=8C=96?= =?UTF-8?q?=E9=A0=98=E5=9F=9F=E3=81=B8=E3=81=AE=E6=9A=97=E9=BB=99=E7=9A=84?= =?UTF-8?q?=E3=81=AA=E3=82=AA=E3=83=96=E3=82=B8=E3=82=A7=E3=82=AF=E3=83=88?= =?UTF-8?q?=E6=A7=8B=E7=AF=89=20:=20=E5=BE=AE=E4=BF=AE=E6=AD=A3=20#1117?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...eation_of_objects_for_low-level_object_manipulation.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md index 9ade0289ad..ece3e8084d 100644 --- a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md +++ b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md @@ -348,7 +348,7 @@ void process(Stream *stream) { } ``` -`Foo`も`Bar`も*implicit-lifetime types*だとして、以前のこのコードに対して`Stream::read()`が次のように実装されている場合 +`Foo`も`Bar`も*implicit-lifetime types*だとして、このコードに対して`Stream::read()`が次のように実装されている場合 ```cpp unique_ptr Stream::read() { @@ -363,7 +363,7 @@ unique_ptr Stream::read() { ただし、`process()`内の各分岐においては、返された`buffer`ポインタ(`char(*)[]`)からそれぞれの場合で適切なオブジェクト(`Foo`/`Bar`)へのポインタを、[`std::launder()`](/reference/new/launder.md)を用いて取得する必要がある。 -`reinterpret_cast`はポインタ型の変換のみを行うが、型変換だけではそのポインタはその領域に生存期間内にあるオブジェクトと必ずしもリンクしない。`std::launder()`は、渡されたポインタの領域で生存期間内にあるオブジェクトへのポインタを生成して返す関数であり、これを用いることで暗黙的に構築されたオブジェクトへの適切なポインタを得ることができる。 +`reinterpret_cast`はポインタ型の変換のみを行うが、型変換だけではそのポインタはその領域で生存期間内にあるオブジェクトと必ずしもリンクしない。`std::launder()`は、渡されたポインタの領域で生存期間内にあるオブジェクトへのポインタを生成して返す関数であり、これを用いることで暗黙的に構築されたオブジェクトへの適切なポインタを得ることができる。 ### 動的配列の実装 @@ -389,9 +389,9 @@ unique_ptr Stream::read() { などが考案されていた。 -最終的には、暗黙的なオブジェクト構築のように、C++のオブジェクトモデルを修正する形でこの問題を解消することになった。 +最終的には、C++のオブジェクトモデルを修正する暗黙的なオブジェクト構築によってこの問題を解消することになった。 -ただし、2番目の特殊なライブラリ関数もC++23で`std::start_lifetime_as()`として追加されている。 +なお、2番目の特殊なライブラリ関数もC++23で`std::start_lifetime_as()`として追加されている。 ## 関連項目 From 8627239dd8cf584e55541ecf4754bcaa8f746780 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Apr 2023 17:48:03 +0900 Subject: [PATCH 0285/3948] =?UTF-8?q?=E5=9B=BD=E9=9A=9B=E6=A8=99=E6=BA=96?= =?UTF-8?q?=E8=A6=8F=E6=A0=BC=20:=20C++23=E3=81=AE=E8=A6=8F=E6=A0=BC?= =?UTF-8?q?=E6=A1=88=E3=82=92=E6=9B=B4=E6=96=B0=20#1144?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- international-standard.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/international-standard.md b/international-standard.md index 01f9a31d04..acb3caa2ca 100644 --- a/international-standard.md +++ b/international-standard.md @@ -12,7 +12,7 @@ C++ の標準規格は、他にも各国の規格化団体によって国際標 | 通称†1 | 名称 | 参照する規格案†2 | 規格案・原案 | `__cplusplus` | |:--|:--|:--|:--|:--| -| [C++23](lang/cpp23.md) (C++2b) | ISO/IEC 14882:2023 (予定) | N4929([PDF](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4928.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/)) | N4928 N4917 N4910 N4901 N4892 N4885 N4878
N4868 N4861 | -- | +| [C++23](lang/cpp23.md) (C++2b) | ISO/IEC 14882:2023 (予定) | N4944([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4944.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/)) | N4944 N4928 N4917 N4910 N4901 N4892 N4885 N4878
N4868 N4861 | -- | | [C++20](lang/cpp20.md) (C++2a) | ISO/IEC 14882:2020 | N4861†3([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/n4861.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4861/)) | N4860 N4849 N4842 N4835 N4830
N4820 N4810 N4800 N4791 N4788†4
N4778 N4762 N4750 N4741 N4727
N4713 N4700 N4687 | `202002L` | | [C++17](lang/cpp17.md) (C++1z) | ISO/IEC 14882:2017 | N4659([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4659.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4659/)) | N4660 N4659 N4640 N4618 N4606
N4594 N4582 N4567 N4527 N4431
N4296 | `201703L` | | [C++14](lang/cpp14.md) (C++1y) | ISO/IEC 14882:2014 | N4140([PDF](https://github.com/cplusplus/draft/blob/master/papers/n4140.pdf?raw=true)/[HTML](https://timsong-cpp.github.io/cppwp/n4140/)) | N4141 N4140 N3937 N3936 N3797
N3691 N3690 N3485 N3376 N3337 | `201402L` | From 7606d8fa6cf0fe57dc94718210b69cfd269a7f40 Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Thu, 27 Apr 2023 20:18:24 +0900 Subject: [PATCH 0286/3948] fix typo in cpp20/coroutines --- lang/cpp20/coroutines.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/cpp20/coroutines.md b/lang/cpp20/coroutines.md index 4c1a1b63a7..89de2759fc 100644 --- a/lang/cpp20/coroutines.md +++ b/lang/cpp20/coroutines.md @@ -145,8 +145,8 @@ task g3(int a, ...) { // エラー: 可変引数リストは許可され ### Promise型とコルーチン動作仕様 コルーチンのPromise型は、コルーチンの戻り値型`R`と引数リスト`P1`, `P2`, ..., `Pn`から決定されるクラス型である。 -- デフォルト動作では`R::protmise_type`がPromise型となる。 -- ユーザプログラム中で[`std::coroutine_traits`](/reference/coroutine/coroutine_traits.md)トレイトを特殊化した場合は、`coroutine_traits::protmise_type`がPromise型となる。 +- デフォルト動作では`R::promise_type`がPromise型となる。 +- ユーザプログラム中で[`std::coroutine_traits`](/reference/coroutine/coroutine_traits.md)トレイトを特殊化した場合は、`coroutine_traits::promise_type`がPromise型となる。 - コルーチンがクラスの非静的メンバの場合、`P1`は暗黙のオブジェクトパラメータ(`*this`の型)となる。 コルーチンは、その本体 _function-body_ が下記の通り置き換えられたかのように動作する: From 0f55a9625276f145d0ea372275df2e829a978782 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 8 May 2023 12:53:08 +0900 Subject: [PATCH 0287/3948] =?UTF-8?q?=E3=83=86=E3=83=B3=E3=83=97=E3=83=AC?= =?UTF-8?q?=E3=83=BC=E3=83=88=E5=86=8D=E5=B8=B0=E5=9B=9E=E6=95=B0=E3=81=AE?= =?UTF-8?q?=E8=A8=98=E4=BA=8B=E3=81=8C=E3=83=AA=E3=83=B3=E3=82=AF=E5=88=87?= =?UTF-8?q?=E3=82=8C=E3=81=97=E3=81=A6=E3=81=84=E3=81=9F=E3=81=AE=E3=81=A7?= =?UTF-8?q?=E3=82=A2=E3=83=BC=E3=82=AB=E3=82=A4=E3=83=96=E3=81=AB=E5=B7=AE?= =?UTF-8?q?=E3=81=97=E6=9B=BF=E3=81=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp11/recursive_template_limit.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp11/recursive_template_limit.md b/lang/cpp11/recursive_template_limit.md index b5d1b8cf2d..c54d80ca5b 100644 --- a/lang/cpp11/recursive_template_limit.md +++ b/lang/cpp11/recursive_template_limit.md @@ -56,7 +56,7 @@ int main() ## 参照 - [CWG Issue 831. Limit on recursively nested template instantiations](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#831) -- [Variadic Templates for C++0x](http://www.jot.fm/issues/issue_2008_02/article2/) +- [Variadic Templates for C++0x](https://web.archive.org/web/20230430062038/http://www.jot.fm/issues/issue_2008_02/article2/) - テンプレートの再帰によって、コンパイル時間がどれくらい延びるかのレポートがある記事 - [C++ Language Features/Controlling implementation limits - Clang Compiler User’s Manual](http://clang.llvm.org/docs/UsersManual.html#cmdoption-ftemplate-depth) - [3.5 Options Controlling C++ Dialect - GCC Command Options](https://gcc.gnu.org/onlinedocs/gcc/gcc-command-options/options-controlling-c%2B%2B-dialect.html) From e85219905c26037593496a3fe1622160c27f5620 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 8 May 2023 14:50:47 +0900 Subject: [PATCH 0288/3948] =?UTF-8?q?C++23=20:=20N4945=E3=81=A7=E3=81=AE?= =?UTF-8?q?=E4=B8=BB=E8=A6=81=E3=81=AA=E5=A4=89=E6=9B=B4=E3=82=92=E5=8F=8D?= =?UTF-8?q?=E6=98=A0=20#1144?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lang/cpp23.md b/lang/cpp23.md index 1828d7e04d..41eebfdf3f 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -148,6 +148,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 - [``](/reference/ranges.md)に、Rangeを等間隔からなるRangeに変換する[`std::views::stride`](/reference/ranges/stride_view.md.nolink)を追加 - [``](/reference/ranges.md)に、Rangeをムーブするための[`std::views::as_rvalue`](/reference/ranges/as_rvalue.md.nolink)を追加 - [``](/reference/ranges.md)に、指定した値をN回繰り返すRangeを生成する[`std::views::repeat`](/reference/ranges/repeat.md.nolink)を追加 +- [``](/reference/ranges.md)に、Rangeをインデックス付きでループさせる[`std::views::enumerate`](/reference/ranges/enumerate.md.nolink)を追加 ### アルゴリズム @@ -227,9 +228,13 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 ### 機能の非推奨化 -- [`std::aligned_storage`](/reference/type_traits/aligned_storage.md)と[`std::aligned_union`](/reference/type_traits/aligned_union.md)を非推奨化。これらの機能は未定義動作を引き起こし、間違った保証が行われ、よくないAPI設計が行われていたため、非推奨となる。 +- [`std::aligned_storage`](/reference/type_traits/aligned_storage.md)と[`std::aligned_union`](/reference/type_traits/aligned_union.md)を非推奨化。これらの機能は未定義動作を引き起こし、間違った保証が行われ、よくないAPI設計が行われていたため、非推奨となる - [`std::aligned_storage`](/reference/type_traits/aligned_storage.md)の代わりに`alignas(T)` [`std::byte`](/reference/cstddef/byte.md)`[sizeof(T)];`を使用することを推奨する - [`std::aligned_union`](/reference/type_traits/aligned_union.md)の代わりに`alignas(Ts...)` [`std::byte`](/reference/cstddef/byte.md)`[`[`std::max`](/reference/algorithm/max.md)`({sizeof(Ts)...})];`を使用することを推奨する +- [``](/reference/limits.md)の以下の非正規化数に関する機能を非推奨化。これらの機能は必ずしもコンパイル時に決まらない可能性のある値であり有用でないため、非推奨となる + - [`std::numeric_limits`](/reference/limits/numeric_limits.md)`::`[`has_denorm`](/reference/limits/numeric_limits/has_denorm.md) + - [`std::numeric_limits`](/reference/limits/numeric_limits.md)`::`[`has_denorm_loss`](/reference/limits/numeric_limits/has_denorm_loss.md) + - [`std::float_denorm_style`](/reference/limits/float_denorm_style.md) ### 機能の削除 From 7580c17863c0ba80bef67d6a2b39119587905da7 Mon Sep 17 00:00:00 2001 From: sutatoruta <72185056+sutatoruta@users.noreply.github.com> Date: Tue, 9 May 2023 12:47:27 +0900 Subject: [PATCH 0289/3948] =?UTF-8?q?typo=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/random.md | 4 ++-- reference/random/binomial_distribution.md | 4 ++-- reference/random/binomial_distribution/op_call.md | 4 ++-- reference/random/binomial_distribution/op_constructor.md | 4 ++-- reference/random/geometric_distribution.md | 6 +++--- reference/random/geometric_distribution/op_call.md | 4 ++-- reference/random/geometric_distribution/op_constructor.md | 4 ++-- reference/random/negative_binomial_distribution.md | 4 ++-- reference/random/poisson_distribution.md | 2 +- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/reference/random.md b/reference/random.md index 3589ec9742..e278b82a59 100644 --- a/reference/random.md +++ b/reference/random.md @@ -47,7 +47,7 @@ 先に挙げた擬似乱数生成器に対して一般的なパラメータを定義し、使いやすいように用意された擬似乱数生成器の型。 -これらの型には、パフォーマンス、オブジェクトのサイズ、周期などのトレードオフがある。ユーザーの目的に合わせて擬似乱数正器の型を選択してほしい。 +これらの型には、パフォーマンス、オブジェクトのサイズ、周期などのトレードオフがある。ユーザーの目的に合わせて擬似乱数生成器の型を選択してほしい。 オブジェクトのサイズをある程度無視・許容できる状況では、多くの分野と用途に、[`mt19937`](random/mt19937.md)を推奨できる。 @@ -84,7 +84,7 @@ ## 分布生成器 -分布生成器は、乱数生成器のよって生成される値の範囲や分布を調整するクラスである。 +分布生成器は、乱数生成器によって生成される値の範囲や分布を調整するクラスである。 分布生成器は、環境によって異なるアルゴリズムで実装される可能性がある。擬似乱数生成器は環境によらず同じシードを与えれば同じ乱数列が生成されるが、分布生成器を介して乱数生成する場合、環境によって異なる乱数列が生成される場合がある。 diff --git a/reference/random/binomial_distribution.md b/reference/random/binomial_distribution.md index 9bf147b961..716eafc2a1 100644 --- a/reference/random/binomial_distribution.md +++ b/reference/random/binomial_distribution.md @@ -13,7 +13,7 @@ namespace std { ## 概要 `binomial_distribution`は、離散確率分布の一種である二項分布を表すクラスである。 -成功する確率pの事象をn回施行し、成功した回数を求める。 +成功する確率pの事象をn回試行し、成功した回数を求める。 二項分布は、以下のような用途に使用できる: @@ -82,7 +82,7 @@ int main() std::random_device seed_gen; std::default_random_engine engine(seed_gen()); - // 成功確率0.5の事象を5回施行する + // 成功確率0.5の事象を5回試行する std::binomial_distribution<> dist(5, 0.5); // 成功した回数を取得(0以上5以下の値が返される) diff --git a/reference/random/binomial_distribution/op_call.md b/reference/random/binomial_distribution/op_call.md index ae6793ca33..96871cdc94 100644 --- a/reference/random/binomial_distribution/op_call.md +++ b/reference/random/binomial_distribution/op_call.md @@ -38,7 +38,7 @@ int main() // (1) { - // 確率0.5で成功する事象を3回施行する + // 確率0.5で成功する事象を3回試行する std::binomial_distribution<> dist(3, 0.5); // 成功回数を取得 @@ -51,7 +51,7 @@ int main() using dist_type = std::binomial_distribution<>; dist_type dist; - // 確率0.5で成功する事象を3回施行する + // 確率0.5で成功する事象を3回試行する dist_type::param_type param(3, 0.5); // 成功回数を取得 diff --git a/reference/random/binomial_distribution/op_constructor.md b/reference/random/binomial_distribution/op_constructor.md index 3d02a43d29..c72284bb08 100644 --- a/reference/random/binomial_distribution/op_constructor.md +++ b/reference/random/binomial_distribution/op_constructor.md @@ -39,7 +39,7 @@ int main() // パラメータを個別に指定する { - // 確率0.5で成功する事象を、3回施行する + // 確率0.5で成功する事象を、3回試行する std::binomial_distribution<> dist(3, 0.5); // 成功回数を取得 @@ -51,7 +51,7 @@ int main() { using dist_type = std::binomial_distribution<>; - // 確率0.5で成功する事象を、3回施行する + // 確率0.5で成功する事象を、3回試行する dist_type::param_type param(3, 0.5); dist_type dist(param); diff --git a/reference/random/geometric_distribution.md b/reference/random/geometric_distribution.md index 6f9f7b4f2d..7350f757a3 100644 --- a/reference/random/geometric_distribution.md +++ b/reference/random/geometric_distribution.md @@ -13,9 +13,9 @@ namespace std { ## 概要 `geometric_distribution`は、離散確率分布の一種である幾何分布を表すクラスである。 -このクラスは、ベルヌーイ分布([`bernoulli_distribution`](bernoulli_distribution.md))を施行し、初めて成功するまでに何回失敗したかを取得する。これは、[`negative_binomial_distribution`](negative_binomial_distribution.md)`(1, p)`と同じである。 +このクラスは、ベルヌーイ分布([`bernoulli_distribution`](bernoulli_distribution.md))を試行し、初めて成功するまでに何回失敗したかを取得する。これは、[`negative_binomial_distribution`](negative_binomial_distribution.md)`(1, p)`と同じである。 -幾何分布は、無記憶性(memoryless)という性質を持つ。これにより、施行の結果が次の結果(確率)に影響せず、それぞれが独立した結果となる。 +幾何分布は、無記憶性(memoryless)という性質を持つ。これにより、試行の結果が次の結果(確率)に影響せず、それぞれが独立した結果となる。 幾何分布は、以下のような用途で使用できる: @@ -84,7 +84,7 @@ int main() std::random_device seed_gen; std::default_random_engine engine(seed_gen()); - // 成功確率0.5の事象を、成功するまで施行する + // 成功確率0.5の事象を、成功するまで試行する std::geometric_distribution<> dist(0.5); // 成功するまでに、何回失敗したかを取得 diff --git a/reference/random/geometric_distribution/op_call.md b/reference/random/geometric_distribution/op_call.md index 2bce05d9d4..14229bd5d1 100644 --- a/reference/random/geometric_distribution/op_call.md +++ b/reference/random/geometric_distribution/op_call.md @@ -38,7 +38,7 @@ int main() // (1) { - // 確率0.5で成功する事象を、成功するまで施行する + // 確率0.5で成功する事象を、成功するまで試行する std::geometric_distribution<> dist(0.5); // 成功するまでに失敗した回数を取得 @@ -51,7 +51,7 @@ int main() using dist_type = std::geometric_distribution<>; dist_type dist; - // 確率0.5で成功する事象を、成功するまで施行する + // 確率0.5で成功する事象を、成功するまで試行する dist_type::param_type param(0.5); // 成功するまでに失敗した回数を取得 diff --git a/reference/random/geometric_distribution/op_constructor.md b/reference/random/geometric_distribution/op_constructor.md index 95c0aadb9c..a83eab0385 100644 --- a/reference/random/geometric_distribution/op_constructor.md +++ b/reference/random/geometric_distribution/op_constructor.md @@ -39,7 +39,7 @@ int main() // (2) パラメータを個別に指定する { - // 確率0.5で成功する事象を、成功するまで施行する + // 確率0.5で成功する事象を、成功するまで試行する std::geometric_distribution<> dist(0.5); // 成功するまでに失敗した回数を取得 @@ -51,7 +51,7 @@ int main() { using dist_type = std::geometric_distribution<>; - // 確率0.5で成功する事象を、成功するまで施行する + // 確率0.5で成功する事象を、成功するまで試行する dist_type::param_type param(0.5); dist_type dist(param); diff --git a/reference/random/negative_binomial_distribution.md b/reference/random/negative_binomial_distribution.md index 3a101174a9..0dd417c262 100644 --- a/reference/random/negative_binomial_distribution.md +++ b/reference/random/negative_binomial_distribution.md @@ -13,10 +13,10 @@ namespace std { ## 概要 `negative_binomial_distribution`は、離散確率分布の一種である、負の二項分布を表すクラスである。 -二項分布([`binomial_distribution`](binomial_distribution.md)が「確率pで成功する事象をt回施行し、成功回数を取得する」のに対し、負の二項分布は「確率pで成功する事象がk回成功するまでに失敗した回数を取得する」ということを行う。 +二項分布([`binomial_distribution`](binomial_distribution.md)が「確率pで成功する事象をt回試行し、成功回数を取得する」のに対し、負の二項分布は「確率pで成功する事象がk回成功するまでに失敗した回数を取得する」ということを行う。 -負の二項分布は、実装によって「k回成功するまでに施行した回数を取得する」ものと、「k回成功するまでに失敗した回数を取得する」もの、2つのバリエーションが存在する。`std::negative_binomial_distribution`クラスは後者である。 +負の二項分布は、実装によって「k回成功するまでに試行した回数を取得する」ものと、「k回成功するまでに失敗した回数を取得する」もの、2つのバリエーションが存在する。`std::negative_binomial_distribution`クラスは後者である。 テンプレートパラメータは、以下を意味する: diff --git a/reference/random/poisson_distribution.md b/reference/random/poisson_distribution.md index 28d78815ac..505d9229a0 100644 --- a/reference/random/poisson_distribution.md +++ b/reference/random/poisson_distribution.md @@ -16,7 +16,7 @@ namespace std { `poisson_distribution`は、離散確率分布の一種であるポワソン分布を表すクラスである。 以下の確率密度関数に基いて、ランダムな整数を生成する: -$$ p(x \mid \mu) = \frac{e^{-\mu} \mu^i}{i!} $$ +$$ p(x \mid \mu) = \frac{e^{-\mu} \mu^x}{x!} $$ この数式においてμ(mu)は、平均値(mean)である。 From ae6ac7c9b792b8e3fb6fb2ba9bbeab01648740cb Mon Sep 17 00:00:00 2001 From: sutatoruta <72185056+sutatoruta@users.noreply.github.com> Date: Tue, 9 May 2023 12:54:34 +0900 Subject: [PATCH 0290/3948] =?UTF-8?q?random.md=E3=81=AE=E8=AA=AC=E6=98=8E?= =?UTF-8?q?=E6=96=87=E3=81=A8=E3=82=B3=E3=83=BC=E3=83=89=E3=81=AE=E4=B8=8D?= =?UTF-8?q?=E6=95=B4=E5=90=88=E3=82=92=E4=BF=AE=E6=AD=A3=20=E7=94=BB?= =?UTF-8?q?=E5=83=8F=E3=81=AF=E7=8F=BE=E5=9C=A8=E3=81=AE=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=89=E3=81=AB=E5=A4=89=E6=9B=B4=E3=81=95=E3=82=8C=E3=82=8B?= =?UTF-8?q?=E4=BB=A5=E5=89=8D=E3=81=A8=E5=90=8C=E3=81=98=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=A0=E3=81=A3=E3=81=9F=E3=81=AE=E3=81=A7=E3=80=81=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E3=81=AE=E6=96=B9=E3=82=92float=E3=81=AB?= =?UTF-8?q?=E3=81=97=E3=81=BE=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/random.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/random.md b/reference/random.md index e278b82a59..15257500b9 100644 --- a/reference/random.md +++ b/reference/random.md @@ -160,12 +160,12 @@ int main() std::mt19937 engine(seed_gen()); // 一様実数分布 - // [-1.0, 1.0)の値の範囲で、等確率に実数を生成する - std::uniform_real_distribution<> dist1(-1.0, 1.0); + // [-1.0f, 1.0f)の値の範囲で、等確率に実数を生成する + std::uniform_real_distribution dist1(-1.0f, 1.0f); // 正規分布 - // 平均1.0、標準偏差0.5で分布させる - std::normal_distribution<> dist2(1.0, 0.5); + // 平均1.0f、標準偏差0.5fで分布させる + std::normal_distribution dist2(1.0f, 0.5f); std::ofstream file("random.tsv"); for (size_t i = 0; i < 1000*1000; ++i) { From 058df357fc5857506ee46f8fc179485c0ee759ec Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 10 May 2023 15:16:13 +0900 Subject: [PATCH 0291/3948] =?UTF-8?q?NG=E3=83=AF=E3=83=BC=E3=83=89?= =?UTF-8?q?=E3=81=AE=E3=83=81=E3=82=A7=E3=83=83=E3=82=AFCI=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ngword_check.yml | 19 ++++++++ .github/workflows/script/ngword_check.py | 46 +++++++++++++++++++ .../expected/expected.void/op_constructor.md | 2 +- reference/expected/expected/op_constructor.md | 2 +- reference/ios/io_errc.md | 2 +- reference/random/random_device.md | 2 +- 6 files changed, 69 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/ngword_check.yml create mode 100644 .github/workflows/script/ngword_check.py diff --git a/.github/workflows/ngword_check.yml b/.github/workflows/ngword_check.yml new file mode 100644 index 0000000000..82c48ed9e2 --- /dev/null +++ b/.github/workflows/ngword_check.yml @@ -0,0 +1,19 @@ +name: ngword check + +on: [push, pull_request, workflow_dispatch] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install requests + - uses: actions/checkout@v2 + - name: check + run: python3 .github/workflows/script/ngword_check.py diff --git a/.github/workflows/script/ngword_check.py b/.github/workflows/script/ngword_check.py new file mode 100644 index 0000000000..5c65bd41e0 --- /dev/null +++ b/.github/workflows/script/ngword_check.py @@ -0,0 +1,46 @@ +import glob +import os +import sys + +NGWORD_LIST = [ + ("", "
", "
"), + ("", "
", "
"), + ("", "algined", "aligned"), + ("", "condtion", "condition"), + ("", "eror", "error"), + ("", "exposion", "exposition"), + ("", "noexpcet", "noexcept"), + ("", "protmise_type", "promise_type"), + ("", "repear", "repeat"), + ("", "子ルーチン", "コルーチン"), + ("reference/chrono", "dulation", "duration"), + ("reference/random", "施行", "試行"), + ("reference/random", "疑似", "擬似"), +] + +def check_ngword(text: str, filename: str) -> bool: + found_error: bool = False + + for target_dir, ngword, correct in NGWORD_LIST: + if not filename.startswith(target_dir): + continue + + if ngword in text: + print("{}: the file includes ngword \"{}\". you should fix to \"{}\".".format(filename, ngword, correct)) + found_error = True + return not found_error + +if __name__ == '__main__': + found_error = False + current_dir = os.getcwd() + outer_link_dict = dict() + found_error = False + for p in sorted(list(glob.glob("**/*.md", recursive=True))): + with open(p) as f: + text = f.read() + + if not check_ngword(text, p): + found_error = True + + if found_error: + sys.exit(1) diff --git a/reference/expected/expected.void/op_constructor.md b/reference/expected/expected.void/op_constructor.md index 25fe4b7996..760c12b569 100644 --- a/reference/expected/expected.void/op_constructor.md +++ b/reference/expected/expected.void/op_constructor.md @@ -94,7 +94,7 @@ constexpr explicit expected(unexpect_t, initializer_list il, Args&&... args); ## 例外 - (2) : エラー値型の初期化から送出される例外。 - (3) : エラー値型の初期化から送出される例外。 - - [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)``であれば、ムーブコンストラクタはnoexpcet指定される。 + - [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)``であれば、ムーブコンストラクタはnoexcept指定される。 - (4), (5) : エラー値型の初期化から送出される例外。 - (6), (7) : エラー値型の初期化から送出される例外。 - (8) : 投げない。 diff --git a/reference/expected/expected/op_constructor.md b/reference/expected/expected/op_constructor.md index 650fce1543..4daa20aabd 100644 --- a/reference/expected/expected/op_constructor.md +++ b/reference/expected/expected/op_constructor.md @@ -131,7 +131,7 @@ constexpr bool converts-from-any-cvref = - (1) : 正常値型の初期化から送出される例外。 - (2) : 正常値型またはエラー値型の初期化から送出される例外。 - (3) : 正常値型またはエラー値型の初期化から送出される例外。 - - [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)``かつ[`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)``であれば、ムーブコンストラクタはnoexpcet指定される。 + - [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)``かつ[`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)``であれば、ムーブコンストラクタはnoexcept指定される。 - (4), (5) : 正常値型またはエラー値型の初期化から送出される例外。 - (6) : 正常値型の初期化から送出される例外。 - (7), (8) : エラー値型の初期化から送出される例外。 diff --git a/reference/ios/io_errc.md b/reference/ios/io_errc.md index 232097925e..dbfc4e84c8 100644 --- a/reference/ios/io_errc.md +++ b/reference/ios/io_errc.md @@ -15,7 +15,7 @@ namespace std { ## 概要 入出力操作に関するエラーの種別を表す列挙型。エラーのカテゴリは [`iostream_category`](iostream_category.md)`()` で取得できる。 [`is_error_code_enum`](is_error_code_enum.md) の特殊化がされていることからわかるように、本列挙型は [`error_code`](../system_error/error_code.md) として使うことを意図しており、暗黙的に [`error_code`](../system_error/error_code.md) への変換が可能である。 -なお、[`is_error_condition_enum`](../system_error/is_error_condition_enum.md) の特殊化はされていないため、本列挙型から [`error_condition`](../system_error/error_condition.md) に暗黙的に変換する事は出来ないが、[`make_eror_condition`](make_error_condition.md)`()` の呼び出し、および、一旦 [`error_code`](../system_error/error_code.md) に変換してから [`error_code`](../system_error/error_code.md)`::`[`default_error_condition`](../system_error/error_code/default_error_condition.md) を使用して変換する、などが可能である。 +なお、[`is_error_condition_enum`](../system_error/is_error_condition_enum.md) の特殊化はされていないため、本列挙型から [`error_condition`](../system_error/error_condition.md) に暗黙的に変換する事は出来ないが、[`make_error_condition`](make_error_condition.md)`()` の呼び出し、および、一旦 [`error_code`](../system_error/error_code.md) に変換してから [`error_code`](../system_error/error_code.md)`::`[`default_error_condition`](../system_error/error_code/default_error_condition.md) を使用して変換する、などが可能である。 列挙値は唯一 `stream` のみが定義されている。 diff --git a/reference/random/random_device.md b/reference/random/random_device.md index f5cea2f710..7b7c4644b5 100644 --- a/reference/random/random_device.md +++ b/reference/random/random_device.md @@ -328,6 +328,6 @@ int main() - [random_deviceの実装(再訪) - 煙人計画](http://vaporoid.hateblo.jp/entry/2014/07/25/154852) - [Replacing `/dev/urandom` May 4, 2016 - Security](https://lwn.net/Articles/685371/) - [gccをwindowsで使うならstd::random_deviceを使ってはいけない - Qiita](http://qiita.com/nanashi/items/f94b78398a6c79d939e1) -- [MSC30-C. 疑似乱数の生成に rand() 関数を使用しない](https://www.jpcert.or.jp/sc-rules/c-msc30-c.html) +- [MSC30-C. 擬似乱数の生成に rand() 関数を使用しない](https://www.jpcert.or.jp/sc-rules/c-msc30-c.html) - `CryptGenRandom`のエントロピー源(2005年時点): [Cryptographically Secure Random number on Windows without using CryptoAPI – Michael Howard's Web Log](https://blogs.msdn.microsoft.com/michael_howard/2005/01/14/cryptographically-secure-random-number-on-windows-without-using-cryptoapi/#div-comment-5543) From dd8a50d89d7eaa04ca9511109342e11ff990e1fb Mon Sep 17 00:00:00 2001 From: Toru Fukaya Date: Wed, 10 May 2023 15:31:22 +0900 Subject: [PATCH 0292/3948] =?UTF-8?q?=E3=82=AF=E3=83=A9=E3=82=B9=E3=83=86?= =?UTF-8?q?=E3=83=B3=E3=83=97=E3=83=AC=E3=83=BC=E3=83=88=E3=81=AE=E5=9E=8B?= =?UTF-8?q?=E6=8E=A8=E8=AB=96=E3=82=92=E5=9B=9E=E9=81=BF=E3=81=99=E3=82=8B?= =?UTF-8?q?=E4=BE=8B=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 元の記述ではクラステンプレートの型推論を回避出来ていなかったため修正した。 この修正は以下のpp.55--58を参考に記述した。 [Class Template Argument Deduction - A New Abstraction - Zhihao Yuan - CppCon 2017](https://github.com/CppCon/CppCon2017/raw/master/Presentations/Class%20Template%20Argument%20Deduction%20-%20A%20New%20Abstraction/Class%20Template%20Argument%20Deduction%20-%20A%20New%20Abstraction%20-%20Zhihao%20Yuan%20-%20CppCon%202017.pdf) --- lang/cpp17/type_deduction_for_class_templates.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lang/cpp17/type_deduction_for_class_templates.md b/lang/cpp17/type_deduction_for_class_templates.md index 6f50129240..0d71bf481b 100644 --- a/lang/cpp17/type_deduction_for_class_templates.md +++ b/lang/cpp17/type_deduction_for_class_templates.md @@ -203,11 +203,17 @@ int main() ### クラステンプレートの型推論を回避する例 ```cpp +// C++20 で追加された std::type_identity と同じことをするクラス +template +struct identity { + using type = T; +}; + template struct X { - using T_ = T; + using T_ = typename identity::type; - // テンプレートパラメータを直接使用せず、型の別名を付けてから使用する。 + // テンプレートパラメータを直接使用せず、identityを介して使用する。 // これによって、テンプレート引数を明示的に指定させられる X(T_) {} }; From 8a3b7791e2aa4768757706b8294ff698bbc3233f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 10 May 2023 17:00:34 +0900 Subject: [PATCH 0293/3948] =?UTF-8?q?=E7=A7=BB=E8=AD=B2->=E5=A7=94?= =?UTF-8?q?=E8=AD=B2=20=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/script/ngword_check.py | 1 + reference/queue/priority_queue/op_constructor.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/script/ngword_check.py b/.github/workflows/script/ngword_check.py index 5c65bd41e0..0b709286aa 100644 --- a/.github/workflows/script/ngword_check.py +++ b/.github/workflows/script/ngword_check.py @@ -13,6 +13,7 @@ ("", "protmise_type", "promise_type"), ("", "repear", "repeat"), ("", "子ルーチン", "コルーチン"), + ("", "移譲", "委譲"), ("reference/chrono", "dulation", "duration"), ("reference/random", "施行", "試行"), ("reference/random", "疑似", "擬似"), diff --git a/reference/queue/priority_queue/op_constructor.md b/reference/queue/priority_queue/op_constructor.md index 12aebaeb36..78e2550c7b 100644 --- a/reference/queue/priority_queue/op_constructor.md +++ b/reference/queue/priority_queue/op_constructor.md @@ -68,7 +68,7 @@ priority_queue(priority_queue&& que, - (1) : デフォルトコンストラクタ - C++03 : 比較関数と元となるコンテナをコピーして構築する。 - C++11 : 比較関数をコピー、元となるコンテナをムーブして構築する。 - - C++20 : (2)に移譲。 + - C++20 : (2)に委譲。 - (2) : 比較関数のコピーと元となるコンテナをデフォルト構築して構築するコンストラクタ。 - (3) : 比較関数と、元となるコンテナのコピーから構築するコンストラクタ。 - (4) : コピーコンストラクタ From 9d64bb3992e4f626b57dc749cb4fc05e36dad532 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 15 May 2023 14:25:41 +0900 Subject: [PATCH 0294/3948] =?UTF-8?q?flat=5Fmap=20:=20=E3=82=AF=E3=83=A9?= =?UTF-8?q?=E3=82=B9=E3=83=9A=E3=83=BC=E3=82=B8=E3=81=AE=E3=82=B5=E3=83=B3?= =?UTF-8?q?=E3=83=97=E3=83=AB=E3=82=B3=E3=83=BC=E3=83=89=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=20#1078?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 1 + reference/flat_map/flat_map.md | 136 +++++++++++++++++++++++++++++++++ 2 files changed, 137 insertions(+) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 210d6ca9ab..da59539dd7 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -200,6 +200,7 @@ * t3.join()[link /reference/thread/thread/join.md] * [link /reference/tuple.md] * std::tuple[link /reference/tuple/tuple.md] + * std::tie[link /reference/tuple/tie.md] * [link /reference/type_traits.md] * remove_cvref_t[link /reference/type_traits/remove_cvref.md] * std::false_type[link /reference/type_traits/false_type.md] diff --git a/reference/flat_map/flat_map.md b/reference/flat_map/flat_map.md index ac96b9be44..191a70e6c3 100644 --- a/reference/flat_map/flat_map.md +++ b/reference/flat_map/flat_map.md @@ -151,18 +151,154 @@ namespace std { ## 例 ### 基本的な使い方 +```cpp example +#include +#include +#include + +int main() +{ + // stringをキー、intを値として扱う連想配列 + std::flat_map fm = { + {"Carol", 4}, + {"Alice", 3}, + {"Bob", 1} + }; + + // 検索 : キー(string)を指定し、値(int)を得る + int r = fm.at("Alice"); + std::cout << r << std::endl; + + // 全体を出力する + for (const auto& [key, value] : fm) { + std::cout << key << " : " << value << std::endl; + } +} +``` +* fm.at[link flat_map/at.md.nolink] #### 出力 +``` +3 +Alice : 3 +Bob : 1 +Carol : 4 +``` ### ユーザー定義型をキーとして使用する (`operator<=>`を定義) +```cpp example +#include +#include +#include + +// 要素がひとつの場合 +struct MyInt { + int value; + + friend auto operator<=>(const MyInt& a, const MyInt& b) noexcept { + return a.value <=> b.value; + } +}; + +// 要素が複数の場合 +struct Person { + int id; + int age; + std::string name; + + friend auto operator<=>(const Person& a, const Person& b) noexcept { + if (auto comp = a.id <=> b.id; comp != 0) { + return comp; + } + if (auto comp = a.age <=> b.age; comp != 0) { + return comp; + } + return a.name <=> b.name; + } +}; + +int main() +{ + std::flat_map fm1 { + {MyInt{1}, 3}, + {MyInt{2}, 1}, + {MyInt{3}, 4}, + }; + std::cout << fm1[MyInt{2}] << std::endl; + + std::flat_map fm2 { + {Person{1, 18, "Alice"}, 3}, + {Person{2, 30, "Bob"}, 1}, + {Person{3, 30, "Carol"}, 4}, + }; + std::cout << fm2[Person{2, 30, "Bob"}] << std::endl; +} +``` #### 出力 +``` +1 +1 +``` ### ユーザー定義型をキーとして使用する (大小比較の関数オブジェクトを定義) +```cpp example +#include +#include +#include +#include + +// 要素がひとつの場合 +struct MyInt { + int value; +}; + +struct MyIntLess { + bool operator()(const MyInt& a, const MyInt& b) const noexcept { + return a.value < b.value; + } +}; + +// 要素が複数の場合 +struct Person { + int id; + int age; + std::string name; +}; + +struct PersonLess { + bool operator()(const Person& a, const Person& b) const noexcept { + // キーとして比較したい要素を列挙する + return std::tie(a.id, a.age, a.name) < std::tie(b.id, b.age, b.name); + } +}; + +int main() +{ + std::flat_map fm1 { + {MyInt{1}, 3}, + {MyInt{2}, 1}, + {MyInt{3}, 4}, + }; + std::cout << fm1[MyInt{2}] << std::endl; + + std::flat_map fm2 { + {Person{1, 18, "Alice"}, 3}, + {Person{2, 30, "Bob"}, 1}, + {Person{3, 30, "Carol"}, 4}, + }; + std::cout << fm2[Person{2, 30, "Bob"}] << std::endl; +} +``` + #### 出力 +``` +1 +1 +``` ## 参照 From 566457ebc95a9e0329610ff0e31f8e4a5d445323 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 15 May 2023 15:56:02 +0900 Subject: [PATCH 0295/3948] =?UTF-8?q?=E3=82=B0=E3=83=AD=E3=83=BC=E3=83=90?= =?UTF-8?q?=E3=83=AB=E4=BF=AE=E9=A3=BE=E3=83=AA=E3=82=B9=E3=83=88=E3=81=AB?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20#1078?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index da59539dd7..247d1a223a 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -97,6 +97,7 @@ * fe.what()[link /reference/filesystem/filesystem_error/what.md] * fs::filesystem_error[link /reference/filesystem/filesystem_error.md] * fs::path[link /reference/filesystem/path.md] +* [link /reference/flat_map.md] * [link /reference/format.md] * [link /reference/forward_list.md] * std::forward_list[link /reference/forward_list/forward_list.md] From 4f1dfeb02c7ba96c0fb0f83fb56afbd02290369a Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 15 May 2023 18:19:29 +0900 Subject: [PATCH 0296/3948] =?UTF-8?q?README=20:=20NG=E3=83=AF=E3=83=BC?= =?UTF-8?q?=E3=83=89=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF=E3=81=AECI?= =?UTF-8?q?=E3=83=90=E3=83=83=E3=82=B8=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 0198c7f579..77a3df8f45 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ site [![detect forbidden characters](https://github.com/cpprefjp/site/workflows/detect%20forbidden%20characters/badge.svg)](https://github.com/cpprefjp/site/actions/workflows/detect_forbidden_characters.yml) [![inner link check](https://github.com/cpprefjp/site/workflows/inner%20link%20check/badge.svg)](https://github.com/cpprefjp/site/actions/workflows/inner_link_check.yml) [![code qualify check](https://github.com/cpprefjp/site/workflows/code%20qualify%20check/badge.svg)](https://github.com/cpprefjp/site/actions/workflows/code_qualify_check.yml) +[![ngword check](https://github.com/cpprefjp/site/workflows/ngword%20check/badge.svg)](https://github.com/cpprefjp/site/actions/workflows/ngword_check.yml) [![outer link check](https://github.com/cpprefjp/site/workflows/outer%20link%20check/badge.svg)](https://github.com/cpprefjp/site/actions/workflows/outer_link_check.yml) [![build](https://github.com/cpprefjp/site/workflows/build/badge.svg)](https://github.com/cpprefjp/site/actions/workflows/build.yml) From 5e0410386479b6cbb938010164128996c2f18876 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 17 May 2023 14:31:46 +0900 Subject: [PATCH 0297/3948] =?UTF-8?q?flat=5Fmap=20:=20at=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=20#1078?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map.md | 4 +- reference/flat_map/flat_map/at.md | 75 +++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 2 deletions(-) create mode 100644 reference/flat_map/flat_map/at.md diff --git a/reference/flat_map/flat_map.md b/reference/flat_map/flat_map.md index 191a70e6c3..4f6db7f7d1 100644 --- a/reference/flat_map/flat_map.md +++ b/reference/flat_map/flat_map.md @@ -75,7 +75,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |---------------------------------------|--------------------------------------------|-------| | [`operator[]`](flat_map/op_at.md.nolink) | 指定したキーを持つ要素を取得する | C++23 | -| [`at`](flat_map/at.md.nolink) | 指定したキーを持つ要素を取得する | C++23 | +| [`at`](flat_map/at.md) | 指定したキーを持つ要素を取得する | C++23 | | [`count`](flat_map/count.md.nolink) | 指定したキーにマッチする要素の数を取得する | C++23 | | [`find`](flat_map/find.md.nolink) | 指定したキーで要素を探す | C++23 | | [`contains`](flat_map/contains.md.nolink) | 指定したキーの要素が含まれているかを判定する | C++23 | @@ -175,7 +175,7 @@ int main() } } ``` -* fm.at[link flat_map/at.md.nolink] +* fm.at[link flat_map/at.md] #### 出力 ``` diff --git a/reference/flat_map/flat_map/at.md b/reference/flat_map/flat_map/at.md new file mode 100644 index 0000000000..211fe1af35 --- /dev/null +++ b/reference/flat_map/flat_map/at.md @@ -0,0 +1,75 @@ +# at +* flat_map[meta header] +* std[meta namespace] +* flat_map[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +mapped_type& at(const key_type& x); // (1) C++23 +const mapped_type& at(const key_type& x) const; // (2) C++23 +``` + +## 概要 +指定したキーを持つ要素を取得する。 +要素を取り出す際にキーの存在チェックをする。 + + +## 戻り値 +キー`x`に対応する値を返す。対応する要素が存在しないときは、[`out_of_range`](/reference/stdexcept.md)例外を投げる。 + + +## 計算量 +要素数に対して対数時間 + + +## 例 +```cpp example +#include +#include +#include + +namespace stdx = flat_map; +template +void at_wrap(Container& c, T v) +{ + try { + std::cout << c.at(v) << std::endl; + } + catch(std::out_of_range&) { + std::cout << "exception std::out_of_range" << std::endl; + } +} + +int main() +{ + stdx::flat_map fm; + fm.insert(std::make_pair(1, 'a')); + + at_wrap(fm, 1); + at_wrap(fm, 2); +} +``` +* c.at[color ff0000] +* fm.insert[link insert.md.nolink] +* std::out_of_range[link /reference/stdexcept.md] + +### 出力 +``` +a +exception std::out_of_range +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`operator[]`](op_at.md.nolink) +- [`find()`](find.md.nolink) From e87272b9c0f629393dfa20826eca548e99628237 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 17 May 2023 15:43:57 +0900 Subject: [PATCH 0298/3948] =?UTF-8?q?flat=5Fmap::at=20:=20=E4=B8=8D?= =?UTF-8?q?=E8=A6=81=E3=81=AA=E3=82=B3=E3=83=BC=E3=83=89=E3=82=92=E5=89=8A?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map/at.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/reference/flat_map/flat_map/at.md b/reference/flat_map/flat_map/at.md index 211fe1af35..10f24b1607 100644 --- a/reference/flat_map/flat_map/at.md +++ b/reference/flat_map/flat_map/at.md @@ -29,7 +29,6 @@ const mapped_type& at(const key_type& x) const; // (2) C++23 #include #include -namespace stdx = flat_map; template void at_wrap(Container& c, T v) { @@ -43,7 +42,7 @@ void at_wrap(Container& c, T v) int main() { - stdx::flat_map fm; + std::flat_map fm; fm.insert(std::make_pair(1, 'a')); at_wrap(fm, 1); From 1fe5eb30dfd9a30854f2c1a13ddfaeb7fe5f9eed Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 18 May 2023 11:57:47 +0900 Subject: [PATCH 0299/3948] =?UTF-8?q?flat=5Fmap=20:=20operator[=20]?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20#1078?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map.md | 2 +- reference/flat_map/flat_map/at.md | 2 +- reference/flat_map/flat_map/op_at.md | 63 ++++++++++++++++++++++++++++ 3 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 reference/flat_map/flat_map/op_at.md diff --git a/reference/flat_map/flat_map.md b/reference/flat_map/flat_map.md index 4f6db7f7d1..ce2f36f48a 100644 --- a/reference/flat_map/flat_map.md +++ b/reference/flat_map/flat_map.md @@ -74,7 +74,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |---------------------------------------|--------------------------------------------|-------| -| [`operator[]`](flat_map/op_at.md.nolink) | 指定したキーを持つ要素を取得する | C++23 | +| [`operator[]`](flat_map/op_at.md) | 指定したキーを持つ要素を取得する | C++23 | | [`at`](flat_map/at.md) | 指定したキーを持つ要素を取得する | C++23 | | [`count`](flat_map/count.md.nolink) | 指定したキーにマッチする要素の数を取得する | C++23 | | [`find`](flat_map/find.md.nolink) | 指定したキーで要素を探す | C++23 | diff --git a/reference/flat_map/flat_map/at.md b/reference/flat_map/flat_map/at.md index 10f24b1607..824caed0c6 100644 --- a/reference/flat_map/flat_map/at.md +++ b/reference/flat_map/flat_map/at.md @@ -70,5 +70,5 @@ exception std::out_of_range ## 関連項目 -- [`operator[]`](op_at.md.nolink) +- [`operator[]`](op_at.md) - [`find()`](find.md.nolink) diff --git a/reference/flat_map/flat_map/op_at.md b/reference/flat_map/flat_map/op_at.md new file mode 100644 index 0000000000..f9131e3251 --- /dev/null +++ b/reference/flat_map/flat_map/op_at.md @@ -0,0 +1,63 @@ +# operator[] +* flat_map[meta header] +* std[meta namespace] +* flat_map[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +mapped_type& operator[](const key_type& x); // (1) C++23 +mapped_type& operator[](key_type&& x); // (2) C++23 +``` + +## 概要 +指定したキーを持つ要素を取得する。対応する要素が存在しない場合は生成して返す。 + + +## 戻り値 +キー`x`に対応する値を返す。対応する要素が存在しない場合は、要素をデフォルト構築して参照を返す。 + + +## 計算量 +要素数に対して対数時間 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_map fm; + fm.insert(std::make_pair(1, 'a')); + + // キー`1`に対応する要素を参照する + char& a = fm[1]; + std::cout << a << std::endl; + + // キー`2`に対応する要素を生成する + fm[2] = 'b'; +} +``` +* m[1][color ff0000] +* m[2][color ff0000] +* m.insert[link insert.md.nolink] + +### 出力 +``` +a +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`at()`](at.md) From b7b62702f56341a53ba6f218fbb01661e966a284 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 18 May 2023 11:58:56 +0900 Subject: [PATCH 0300/3948] =?UTF-8?q?map::operator[=20]=20:=20=E3=82=AA?= =?UTF-8?q?=E3=83=BC=E3=83=90=E3=83=BC=E3=83=AD=E3=83=BC=E3=83=89=E3=81=AB?= =?UTF-8?q?=E8=A8=80=E8=AA=9E=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3?= =?UTF-8?q?=E3=81=AE=E6=9B=B8=E3=81=8D=E5=BF=98=E3=82=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/map/map/op_at.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/map/map/op_at.md b/reference/map/map/op_at.md index 23148e8736..5870ff609a 100644 --- a/reference/map/map/op_at.md +++ b/reference/map/map/op_at.md @@ -5,8 +5,8 @@ * function[meta id-type] ```cpp -T& operator[](const key_type& x); -T& operator[](key_type&& x); +T& operator[](const key_type& x); // (1) C++03 +T& operator[](key_type&& x); // (2) C++11 ``` ## 概要 From c84d47b429f528700f37e1ba4d22f8b7e5bfdd61 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 18 May 2023 15:18:23 +0900 Subject: [PATCH 0301/3948] =?UTF-8?q?flat=5Fmap::at=20:=20=E9=80=8F?= =?UTF-8?q?=E9=81=8E=E7=9A=84=E3=81=AA=E6=A4=9C=E7=B4=A2=E3=82=AA=E3=83=BC?= =?UTF-8?q?=E3=83=90=E3=83=BC=E3=83=AD=E3=83=BC=E3=83=89=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=20#1078?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map/at.md | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/reference/flat_map/flat_map/at.md b/reference/flat_map/flat_map/at.md index 824caed0c6..593666b50c 100644 --- a/reference/flat_map/flat_map/at.md +++ b/reference/flat_map/flat_map/at.md @@ -7,13 +7,31 @@ ```cpp mapped_type& at(const key_type& x); // (1) C++23 -const mapped_type& at(const key_type& x) const; // (2) C++23 + +template +mapped_type& at(const K& x); // (2) C++23 + +const mapped_type& at(const key_type& x) const; // (3) C++23 + +template +const mapped_type& at(const K& x) const; // (4) C++23 ``` ## 概要 指定したキーを持つ要素を取得する。 要素を取り出す際にキーの存在チェックをする。 +- (1), (3) : クラスのテンプレートパラメータ`key_type`型のキーを受け取る +- (2), (4) : `key_type`と比較可能な`K`型のキーを受け取る + + +## テンプレートパラメータ制約 +- (2), (4) : `key_compare::is_transparent`が妥当な式であること + + +## 事前条件 +- (2), (4) : `find(x)`という式が妥当であり、動作が明確に定義されていること + ## 戻り値 キー`x`に対応する値を返す。対応する要素が存在しないときは、[`out_of_range`](/reference/stdexcept.md)例外を投げる。 @@ -23,6 +41,12 @@ const mapped_type& at(const key_type& x) const; // (2) C++23 要素数に対して対数時間 +## 備考 +- (2), (4) : + - `is_transparent`は、標準ライブラリの[`std::less`](/reference/functional/less.md)、[`std::greater`](/reference/functional/greater.md)といった関数オブジェクトの、`void`に対する特殊化で定義される。それ以外のテンプレートパラメータで`is_transparent`が定義されないのは、互換性のためである。 + - これらのオーバーロードは、`flat_map`のようなコンテナに対し、検索操作で文字列リテラルを渡した際に、キー型の一時オブジェクトが生成されるコストを減らすためにある。 + + ## 例 ```cpp example #include From 1702da3257cf6123abd2378255bd48554eb4a1bf Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 18 May 2023 15:23:49 +0900 Subject: [PATCH 0302/3948] =?UTF-8?q?(multi)set|map=E3=81=AEfind=20:=20?= =?UTF-8?q?=E9=80=8F=E9=81=8E=E7=9A=84=E3=81=AA=E6=A4=9C=E7=B4=A2=E3=81=AE?= =?UTF-8?q?=E4=BB=95=E6=A7=98=E3=82=92=E3=81=B2=E3=81=AA=E5=BD=A2=E3=81=AB?= =?UTF-8?q?=E5=90=88=E3=82=8F=E3=81=9B=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/map/map/find.md | 6 +++++- reference/map/multimap/find.md | 6 +++++- reference/set/multiset/find.md | 6 +++++- reference/set/set/find.md | 6 +++++- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/reference/map/map/find.md b/reference/map/map/find.md index cbfe40cc23..10e96c93a3 100644 --- a/reference/map/map/find.md +++ b/reference/map/map/find.md @@ -23,6 +23,10 @@ const_iterator find(const K& x) const; // (4) C++14 - (2), (4) : `key_type`と比較可能な`K`型のキーを受け取って検索する。 +## テンプレートパラメータ制約 +- (2), (4) : `key_compare::is_transparent`が妥当な式であること + + ## 戻り値 - (1), (3) : `x`と等価なキーの要素が見つかった場合は、見つかった要素へのイテレータを返す。そうでない場合は、 [`end()`](/reference/map/map/end.md) を返す。 - (2), (4) : `key_compare`型の関数オブジェクトを`c`、コンテナ内の各要素が持つキーを`k`として、キーが等価か判定する式`!c(k, x) && !c(x, k)`が`true`となる要素へのイテレータを返す。そのような要素がない場合は、[`end()`](/reference/map/map/end.md) を返す。 @@ -33,7 +37,7 @@ const_iterator find(const K& x) const; // (4) C++14 ## 備考 -- (2), (4) : `key_compare::is_transparent`が妥当な式である場合のみ、この関数はオーバーロード解決に参加する。 +- (2), (4) : - `is_transparent`は、標準ライブラリの[`std::less`](/reference/functional/less.md)、[`std::greater`](/reference/functional/greater.md)といった関数オブジェクトの、`void`に対する特殊化で定義される。それ以外のテンプレートパラメータで`is_transparent`が定義されないのは、互換性のためである。 - これらのオーバーロードは、`map`のようなコンテナに対し、検索操作で文字列リテラルを渡した際に、キー型の一時オブジェクトが生成されるコストを減らすためにある。 diff --git a/reference/map/multimap/find.md b/reference/map/multimap/find.md index 112b83a4da..0a89139615 100644 --- a/reference/map/multimap/find.md +++ b/reference/map/multimap/find.md @@ -23,6 +23,10 @@ const_iterator find(const K& x) const; // (4) C++14 - (2), (4) : `key_type`と比較可能な`K`型のキーを受け取って検索する。 +## テンプレートパラメータ制約 +- (2), (4) : `key_compare::is_transparent`が妥当な式であること + + ## 戻り値 - (1), (3) : `x`と等価なキーの要素が見つかった場合は、見つかった要素へのイテレータを返す。そうでない場合は、 [`end()`](/reference/map/map/end.md) を返す。 - (2), (4) : `key_compare`型の関数オブジェクトを`c`、コンテナ内の各要素が持つキーを`k`として、キーが等価か判定する式`!c(k, x) && !c(x, k)`が`true`となる要素へのイテレータを返す。そのような要素がない場合は、[`end()`](/reference/map/map/end.md) を返す。 @@ -35,7 +39,7 @@ const_iterator find(const K& x) const; // (4) C++14 ## 備考 -- (2), (4) : `key_compare::is_transparent`が妥当な式である場合のみ、この関数はオーバーロード解決に参加する。 +- (2), (4) : - `is_transparent`は、標準ライブラリの[`std::less`](/reference/functional/less.md)、[`std::greater`](/reference/functional/greater.md)といった関数オブジェクトの、`void`に対する特殊化で定義される。それ以外のテンプレートパラメータで`is_transparent`が定義されないのは、互換性のためである。 - これらのオーバーロードは、`map`のようなコンテナに対し、検索操作で文字列リテラルを渡した際に、キー型の一時オブジェクトが生成されるコストを減らすためにある。 diff --git a/reference/set/multiset/find.md b/reference/set/multiset/find.md index fb8f217c89..ae74d6658f 100644 --- a/reference/set/multiset/find.md +++ b/reference/set/multiset/find.md @@ -23,6 +23,10 @@ const_iterator find(const K& x) const; // (4) C++14 - (2), (4) : `key_type`と比較可能な`K`型のキーを受け取って検索する。 +## テンプレートパラメータ制約 +- (2), (4) : `key_compare::is_transparent`が妥当な式であること + + ## 戻り値 - (1), (3) : `x`と等価なキーの要素が見つかった場合は、見つかった要素へのイテレータを返す。そうでない場合は、 [`end()`](end.md) を返す。 - (2), (4) : `key_compare`型の関数オブジェクトを`c`、コンテナ内の各要素が持つキーを`k`として、キーが等価か判定する式`!c(k, x) && !c(x, k)`が`true`となる要素へのイテレータを返す。そのような要素がない場合は、[`end()`](end.md) を返す。 @@ -33,7 +37,7 @@ const_iterator find(const K& x) const; // (4) C++14 ## 備考 -- (2), (4) : `key_compare::is_transparent`が妥当な式である場合のみ、この関数はオーバーロード解決に参加する。 +- (2), (4) : - `is_transparent`は、標準ライブラリの[`std::less`](/reference/functional/less.md)、[`std::greater`](/reference/functional/greater.md)といった関数オブジェクトの、`void`に対する特殊化で定義される。それ以外のテンプレートパラメータで`is_transparent`が定義されないのは、互換性のためである。 - これらのオーバーロードは、`multiset`のようなコンテナに対し、検索操作で文字列リテラルを渡した際に、キー型の一時オブジェクトが生成されるコストを減らすためにある。 diff --git a/reference/set/set/find.md b/reference/set/set/find.md index 4b201706d8..f8765cdd53 100644 --- a/reference/set/set/find.md +++ b/reference/set/set/find.md @@ -23,6 +23,10 @@ const_iterator find(const K& x) const; // (4) C++14 - (2), (4) : `key_type`と比較可能な`K`型のキーを受け取って検索する。 +## テンプレートパラメータ制約 +- (2), (4) : `key_compare::is_transparent`が妥当な式であること + + ## 戻り値 - (1), (3) : `x`と等価なキーの要素が見つかった場合は、見つかった要素へのイテレータを返す。そうでない場合は、 [`end()`](end.md) を返す。 - (2), (4) : `key_compare`型の関数オブジェクトを`c`、コンテナ内の各要素が持つキーを`k`として、キーが等価か判定する式`!c(k, x) && !c(x, k)`が`true`となる要素へのイテレータを返す。そのような要素がない場合は、[`end()`](end.md) を返す。 @@ -33,7 +37,7 @@ const_iterator find(const K& x) const; // (4) C++14 ## 備考 -- (2), (4) : `key_compare::is_transparent`が妥当な式である場合のみ、この関数はオーバーロード解決に参加する。 +- (2), (4) : - `is_transparent`は、標準ライブラリの[`std::less`](/reference/functional/less.md)、[`std::greater`](/reference/functional/greater.md)といった関数オブジェクトの、`void`に対する特殊化で定義される。それ以外のテンプレートパラメータで`is_transparent`が定義されないのは、互換性のためである。 - これらのオーバーロードは、`set`のようなコンテナに対し、検索操作で文字列リテラルを渡した際に、キー型の一時オブジェクトが生成されるコストを減らすためにある。 From a43bd165f7c77b915000e79e11396d825ec7b0bd Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 18 May 2023 15:28:26 +0900 Subject: [PATCH 0303/3948] =?UTF-8?q?flat=5Fmap=20:=20find=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20#1078?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map.md | 2 +- reference/flat_map/flat_map/at.md | 2 +- reference/flat_map/flat_map/find.md | 97 +++++++++++++++++++++++++++++ 3 files changed, 99 insertions(+), 2 deletions(-) create mode 100644 reference/flat_map/flat_map/find.md diff --git a/reference/flat_map/flat_map.md b/reference/flat_map/flat_map.md index ce2f36f48a..66257675a6 100644 --- a/reference/flat_map/flat_map.md +++ b/reference/flat_map/flat_map.md @@ -77,7 +77,7 @@ namespace std { | [`operator[]`](flat_map/op_at.md) | 指定したキーを持つ要素を取得する | C++23 | | [`at`](flat_map/at.md) | 指定したキーを持つ要素を取得する | C++23 | | [`count`](flat_map/count.md.nolink) | 指定したキーにマッチする要素の数を取得する | C++23 | -| [`find`](flat_map/find.md.nolink) | 指定したキーで要素を探す | C++23 | +| [`find`](flat_map/find.md) | 指定したキーで要素を探す | C++23 | | [`contains`](flat_map/contains.md.nolink) | 指定したキーの要素が含まれているかを判定する | C++23 | | [`equal_range`](flat_map/equal_range.md.nolink) | 指定したキーにマッチする要素範囲を取得する | C++23 | | [`lower_bound`](flat_map/lower_bound.md.nolink) | 与えられた値より小さくない最初の要素へのイテレータを取得する | C++23 | diff --git a/reference/flat_map/flat_map/at.md b/reference/flat_map/flat_map/at.md index 593666b50c..00317087d5 100644 --- a/reference/flat_map/flat_map/at.md +++ b/reference/flat_map/flat_map/at.md @@ -95,4 +95,4 @@ exception std::out_of_range ## 関連項目 - [`operator[]`](op_at.md) -- [`find()`](find.md.nolink) +- [`find()`](find.md) diff --git a/reference/flat_map/flat_map/find.md b/reference/flat_map/flat_map/find.md new file mode 100644 index 0000000000..81be7eaa78 --- /dev/null +++ b/reference/flat_map/flat_map/find.md @@ -0,0 +1,97 @@ +# find +* flat_map[meta header] +* std[meta namespace] +* flat_map[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +iterator find(const key_type& x); // (1) C++23 + +template +iterator find(const K& x); // (2) C++23 + +const_iterator find(const key_type& x) const; // (3) C++23 + +template +const_iterator find(const K& x) const; // (4) C++23 +``` + +## 概要 +`x`と等価なキーの要素を検索する。 + +- (1), (3) : クラスのテンプレートパラメータ`key_type`型のキーを受け取って検索する。 +- (2), (4) : `key_type`と比較可能な`K`型のキーを受け取って検索する。 + + +## テンプレートパラメータ制約 +- (2), (4) : `key_compare::is_transparent`が妥当な式であること + + +## 戻り値 +- (1), (3) : `x`と等価なキーの要素が見つかった場合は、見つかった要素へのイテレータを返す。そうでない場合は、 [`end()`](end.md.nolink) を返す。 +- (2), (4) : `key_compare`型の関数オブジェクトを`c`、コンテナ内の各要素が持つキーを`k`として、キーが等価か判定する式`!c(k, x) && !c(x, k)`が`true`となる要素へのイテレータを返す。そのような要素がない場合は、[`end()`](end.md.nolink) を返す。 + + +## 計算量 +[`size`](size.md.nolink) について対数時間。 + + +## 備考 +- (2), (4) : + - `is_transparent`は、標準ライブラリの[`std::less`](/reference/functional/less.md)、[`std::greater`](/reference/functional/greater.md)といった関数オブジェクトの、`void`に対する特殊化で定義される。それ以外のテンプレートパラメータで`is_transparent`が定義されないのは、互換性のためである。 + - これらのオーバーロードは、`map`のようなコンテナに対し、検索操作で文字列リテラルを渡した際に、キー型の一時オブジェクトが生成されるコストを減らすためにある。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + // (1) + { + std::flat_map fm = { + {"Alice", 3}, + {"Bob", 1}, + {"Carol", 4} + }; + + decltype(fm)::iterator it = fm.find("Bob"); + if (it != fm.end()) { // 見つかった + std::cout << it->second << std::endl; + } + } + + // (2) + { + std::flat_map> fm = { + {"Alice", 3}, + {"Bob", 1}, + {"Carol", 4} + }; + + // std::lessのvoidに対する特殊化を使用することで、 + // 文字列リテラルをfind()関数の引数として渡した際に、 + // std::string型の一時オブジェクトが生成されない。 + decltype(fm)::iterator it = fm.find("Bob"); + if (it != fm.end()) { // 見つかった + std::cout << it->second << std::endl; + } + } +} +``` +* find[color ff0000] +* std::less[link /reference/functional/less.md] + +### 出力 +``` +1 +1 +``` + +## 関連項目 +- [`contains()`](contains.md.nolink) + From c5c7b5ad8893c03a788f1f80a0ecd5e1480d12d0 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 18 May 2023 15:37:57 +0900 Subject: [PATCH 0304/3948] =?UTF-8?q?flat=5Fmap=20:=20size=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20#1078?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map.md | 2 +- reference/flat_map/flat_map/find.md | 2 +- reference/flat_map/flat_map/size.md | 65 +++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 reference/flat_map/flat_map/size.md diff --git a/reference/flat_map/flat_map.md b/reference/flat_map/flat_map.md index 66257675a6..1c2bff8c61 100644 --- a/reference/flat_map/flat_map.md +++ b/reference/flat_map/flat_map.md @@ -49,7 +49,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |---------------------------------|------------------------------------|-------| | [`empty`](flat_map/empty.md.nolink) | コンテナが空であるかどうかを調べる | C++23 | -| [`size`](flat_map/size.md.nolink) | 要素数を取得する | C++23 | +| [`size`](flat_map/size.md) | 要素数を取得する | C++23 | | [`max_size`](flat_map/max_size.md.nolink) | 格納可能な最大の要素数を取得する | C++23 | diff --git a/reference/flat_map/flat_map/find.md b/reference/flat_map/flat_map/find.md index 81be7eaa78..659806a299 100644 --- a/reference/flat_map/flat_map/find.md +++ b/reference/flat_map/flat_map/find.md @@ -34,7 +34,7 @@ const_iterator find(const K& x) const; // (4) C++23 ## 計算量 -[`size`](size.md.nolink) について対数時間。 +[`size`](size.md) について対数時間。 ## 備考 diff --git a/reference/flat_map/flat_map/size.md b/reference/flat_map/flat_map/size.md new file mode 100644 index 0000000000..eee272795b --- /dev/null +++ b/reference/flat_map/flat_map/size.md @@ -0,0 +1,65 @@ +# size +* flat_map[meta header] +* std[meta namespace] +* flat_map[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +size_type size() const noexcept; +``` + +## 概要 +コンテナ内の要素の数を返す。 + + +## 戻り値 +コンテナに格納されている要素の数を返す。 +メンバ型 `size_type` は符号なし整数型である。 + + +## 計算量 +定数時間 + + +## 例 +```cpp example +#include +#include + +int main () +{ + std::flat_map fm; + + std::cout << fm.size() << std::endl; + + fm.insert({1, 'a'}); + fm.insert({2, 'b'}); + fm.insert({3, 'c'}); + fm.insert({1, 'a'}); + + std::cout << fm.size() << std::endl; +} +``` +* size()[color ff0000] +* fm.insert[link insert.md.nolink] + +### 出力 +``` +0 +3 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`empty()`](empty.md.nolink) From fb3b50d2c8403fb9fa47e9941441f8fe686094a2 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 18 May 2023 15:38:36 +0900 Subject: [PATCH 0305/3948] =?UTF-8?q?flat=5Fmap::find=20:=20=E8=A8=80?= =?UTF-8?q?=E8=AA=9E=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3=E3=81=A8?= =?UTF-8?q?=E5=87=A6=E7=90=86=E7=B3=BB=E3=81=AE=E6=AC=84=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map/find.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/reference/flat_map/flat_map/find.md b/reference/flat_map/flat_map/find.md index 659806a299..6541baebbe 100644 --- a/reference/flat_map/flat_map/find.md +++ b/reference/flat_map/flat_map/find.md @@ -92,6 +92,17 @@ int main() 1 ``` +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + ## 関連項目 - [`contains()`](contains.md.nolink) From 131af885ebb460f4f285099152718fafd5e31fbd Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 18 May 2023 22:35:12 +0900 Subject: [PATCH 0306/3948] =?UTF-8?q?vaporoid=E6=A7=98=E3=81=AE=E3=82=B9?= =?UTF-8?q?=E3=83=9D=E3=83=B3=E3=82=B5=E3=83=BC=E3=83=AD=E3=82=B4=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.md b/index.md index 4b1ffb1d74..c2db6efaff 100644 --- a/index.md +++ b/index.md @@ -70,6 +70,8 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい
Acerola Software
+
vaporoid
+ スポンサーシップについては、以下のページを参照ください。 - [cpprefjp - Open Collective](https://opencollective.com/cpprefjp) From a6f4987bf6e5fc792246606aa37c263b065b25ab Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 18 May 2023 22:45:44 +0900 Subject: [PATCH 0307/3948] =?UTF-8?q?=E6=96=B0=E3=81=9F=E3=81=AA=E3=82=B9?= =?UTF-8?q?=E3=83=9D=E3=83=B3=E3=82=B5=E3=83=BC=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/index.md b/index.md index c2db6efaff..f3060e1cca 100644 --- a/index.md +++ b/index.md @@ -66,16 +66,35 @@ cpprefjp プロジェクトに参加する方法は簡単です。 ## スポンサー cpprefjpプロジェクトは、以下の方々にスポンサーになっていただいております。 + +### シルバースポンサー +
Fixstars
Acerola Software
-
vaporoid
+
vaporoid
+ +
vaporoid
+ + +### ブロンズスポンサー + +- イシハラユウヤ様 + + +### 一時スポンサー + +- [Hashitaku様](https://opencollective.com/hashitaku) +- yukika2e様 + スポンサーシップについては、以下のページを参照ください。 - [cpprefjp - Open Collective](https://opencollective.com/cpprefjp) +連絡先が不明なスポンサー様は、ロゴの表示が現在できておりません。Open Collectiveの問い合わせフォームから、表示するロゴ画像とリンク先URLについてご連絡いただきたいです。 + ## プライバシーポリシー From 8d47b625a8d21ac5de2c8b5feeb04ff2b8470793 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 18 May 2023 23:17:21 +0900 Subject: [PATCH 0308/3948] =?UTF-8?q?=E3=82=B9=E3=83=9D=E3=83=B3=E3=82=B5?= =?UTF-8?q?=E3=83=BC=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/index.md b/index.md index f3060e1cca..d61365ce90 100644 --- a/index.md +++ b/index.md @@ -81,6 +81,7 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい ### ブロンズスポンサー - イシハラユウヤ様 +- [Megumi Nakagami様](https://opencollective.com/meg_nakagami) ### 一時スポンサー From ca4541705729e6b4d06cc8cf660a39dc70dc7a79 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 18 May 2023 23:27:30 +0900 Subject: [PATCH 0309/3948] =?UTF-8?q?=E3=82=B9=E3=83=9D=E3=83=B3=E3=82=B5?= =?UTF-8?q?=E3=83=BC=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/index.md b/index.md index d61365ce90..99547cd12b 100644 --- a/index.md +++ b/index.md @@ -82,6 +82,7 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい - イシハラユウヤ様 - [Megumi Nakagami様](https://opencollective.com/meg_nakagami) +- Junichirou Minami様 ### 一時スポンサー From 1e49d46de2000efe530efba043c9daa973786916 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 19 May 2023 00:14:40 +0900 Subject: [PATCH 0310/3948] =?UTF-8?q?=E3=82=B9=E3=83=9D=E3=83=B3=E3=82=B5?= =?UTF-8?q?=E3=83=BC=E3=83=AD=E3=82=B4=E3=82=92=E8=A1=A8=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.md b/index.md index 99547cd12b..88051ceb04 100644 --- a/index.md +++ b/index.md @@ -75,14 +75,16 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい
vaporoid
-
vaporoid
+
vaporoid
### ブロンズスポンサー - イシハラユウヤ様 - [Megumi Nakagami様](https://opencollective.com/meg_nakagami) -- Junichirou Minami様 + + +
minachun / J.Minami
### 一時スポンサー From 50fa3907fce6fc13f715b89d4e0ad79c55e91dc6 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 19 May 2023 00:27:56 +0900 Subject: [PATCH 0311/3948] =?UTF-8?q?=E3=82=B9=E3=83=9D=E3=83=B3=E3=82=B5?= =?UTF-8?q?=E3=83=BC=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.md b/index.md index 88051ceb04..78eebf9688 100644 --- a/index.md +++ b/index.md @@ -77,6 +77,8 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい
vaporoid
+- M.Kohana様 + ### ブロンズスポンサー From 555a222083f8300ca63b94d0f019c7f8e0415df1 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 19 May 2023 09:51:24 +0900 Subject: [PATCH 0312/3948] =?UTF-8?q?=E3=82=B9=E3=83=9D=E3=83=B3=E3=82=B5?= =?UTF-8?q?=E3=83=BC=E7=94=BB=E5=83=8F=E3=82=92=E5=B7=AE=E3=81=97=E6=9B=BF?= =?UTF-8?q?=E3=81=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.md b/index.md index 78eebf9688..e83437d47a 100644 --- a/index.md +++ b/index.md @@ -73,9 +73,9 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい
Acerola Software
-
vaporoid
+
vaporoid
-
vaporoid
+
CubeSoft
- M.Kohana様 From 394355bbef55ac255bb459691f4ccfb8c671ecfb Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 19 May 2023 16:14:33 +0900 Subject: [PATCH 0313/3948] =?UTF-8?q?=E3=82=B9=E3=83=9D=E3=83=B3=E3=82=B5?= =?UTF-8?q?=E3=83=BC=E3=83=AD=E3=82=B4=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.md b/index.md index e83437d47a..2e643a2973 100644 --- a/index.md +++ b/index.md @@ -77,7 +77,7 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい
CubeSoft
-- M.Kohana様 +
M.Kohana
### ブロンズスポンサー From db4695bbdc990ec369d8ca97b7ddeb40431e58d4 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sat, 20 May 2023 12:26:15 +0900 Subject: [PATCH 0314/3948] =?UTF-8?q?=E3=82=B9=E3=83=9D=E3=83=B3=E3=82=B5?= =?UTF-8?q?=E3=83=BC=E3=83=AD=E3=82=B4=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.md b/index.md index 2e643a2973..8eb2272440 100644 --- a/index.md +++ b/index.md @@ -92,7 +92,8 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい ### 一時スポンサー - [Hashitaku様](https://opencollective.com/hashitaku) -- yukika2e様 + +yukika2e スポンサーシップについては、以下のページを参照ください。 From e5f31cd4413e1e2156289e5d5ad28c4c8f703735 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sat, 20 May 2023 12:40:09 +0900 Subject: [PATCH 0315/3948] =?UTF-8?q?=E9=96=89=E3=81=98=E3=82=BF=E3=82=B0?= =?UTF-8?q?=E5=BF=98=E3=82=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.md b/index.md index 8eb2272440..76dbf6db02 100644 --- a/index.md +++ b/index.md @@ -93,7 +93,7 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい - [Hashitaku様](https://opencollective.com/hashitaku) -yukika2e +yukika2e スポンサーシップについては、以下のページを参照ください。 From 76502a5485982eeb21315b415a8a3bec5da8a929 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sat, 20 May 2023 12:46:47 +0900 Subject: [PATCH 0316/3948] =?UTF-8?q?=E3=83=AD=E3=82=B4=E3=82=92=E4=B8=AD?= =?UTF-8?q?=E5=A4=AE=E5=AF=84=E3=81=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.md b/index.md index 76dbf6db02..c0a6ed0000 100644 --- a/index.md +++ b/index.md @@ -93,7 +93,7 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい - [Hashitaku様](https://opencollective.com/hashitaku) -yukika2e +
yukika2e
スポンサーシップについては、以下のページを参照ください。 From 0bbeedbb56fd825f21ead503b0edf8f47875d4f3 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sat, 20 May 2023 12:48:34 +0900 Subject: [PATCH 0317/3948] =?UTF-8?q?=E8=A1=8C=E5=85=A8=E4=BD=93=E3=81=AB?= =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=81=8C=E8=B2=BC=E3=82=89=E3=82=8C?= =?UTF-8?q?=E3=81=A6=E3=81=84=E3=81=9F=E3=81=AE=E3=81=A7=E3=80=81=E4=B8=AD?= =?UTF-8?q?=E5=A4=AE=E5=AF=84=E3=81=9B=E3=82=BF=E3=82=B0=E3=81=AB=E3=83=AA?= =?UTF-8?q?=E3=83=B3=E3=82=AF=E3=81=8C=E8=A8=AD=E5=AE=9A=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/index.md b/index.md index c0a6ed0000..48ecb58ac1 100644 --- a/index.md +++ b/index.md @@ -69,15 +69,15 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい ### シルバースポンサー -
Fixstars
+
Fixstars
-
Acerola Software
+
Acerola Software
-
vaporoid
+
vaporoid
-
CubeSoft
+
CubeSoft
-
M.Kohana
+
M.Kohana
### ブロンズスポンサー @@ -86,7 +86,7 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい - [Megumi Nakagami様](https://opencollective.com/meg_nakagami) -
minachun / J.Minami
+
minachun / J.Minami
### 一時スポンサー From c019c0e36bbd4830536eeb9cb79fc6f039c9e9b9 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 22 May 2023 16:04:06 +0900 Subject: [PATCH 0318/3948] =?UTF-8?q?borrowed=5Frange=20:=20span?= =?UTF-8?q?=E3=81=AE=E8=A6=81=E7=B4=A0=E3=81=AF=E6=96=87=E5=AD=97=E5=88=97?= =?UTF-8?q?=E3=81=A7=E3=81=AF=E3=81=AA=E3=81=8Fint=20#1150?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/borrowed_range.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/ranges/borrowed_range.md b/reference/ranges/borrowed_range.md index 524a2dfbb6..6ea3aaf0f0 100644 --- a/reference/ranges/borrowed_range.md +++ b/reference/ranges/borrowed_range.md @@ -43,7 +43,7 @@ int main() // string_viewは文字列を所有していないので、borrowed_rangeである static_assert(std::ranges::borrowed_range); - // spanは文字列を所有していないので、borrowed_rangeである + // spanはintを所有していないので、borrowed_rangeである static_assert(std::ranges::borrowed_range>); } ``` From aaff7b5d32b068cc6cd74ea24f9fb1b25f437a5c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 22 May 2023 16:29:22 +0900 Subject: [PATCH 0319/3948] =?UTF-8?q?(multi)map=20:=20empty=E3=81=AE?= =?UTF-8?q?=E8=A8=80=E8=AA=9E=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3?= =?UTF-8?q?=E3=81=8CC++11=E3=81=AB=E3=81=AA=E3=81=A3=E3=81=A6=E3=81=84?= =?UTF-8?q?=E3=81=9F=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/map/map/empty.md | 10 ---------- reference/map/multimap/empty.md | 10 ---------- 2 files changed, 20 deletions(-) diff --git a/reference/map/map/empty.md b/reference/map/map/empty.md index a4451c82b5..e9ec6ba894 100644 --- a/reference/map/map/empty.md +++ b/reference/map/map/empty.md @@ -52,16 +52,6 @@ int main () 0 ``` -## バージョン -### 言語 -- C++11 - -### 処理系 -- [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? -- [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 - ## 関連項目 | 名前 | 説明| diff --git a/reference/map/multimap/empty.md b/reference/map/multimap/empty.md index 92929d1acc..820c10bf05 100644 --- a/reference/map/multimap/empty.md +++ b/reference/map/multimap/empty.md @@ -52,16 +52,6 @@ int main () 0 ``` -## バージョン -### 言語 -- C++11 - -### 処理系 -- [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? -- [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 - ## 関連項目 | 名前 | 説明| From 9430b41593e773a191064eff80815532a0629be0 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 22 May 2023 16:32:15 +0900 Subject: [PATCH 0320/3948] =?UTF-8?q?flat=5Fmap=20:=20empty=E3=81=A8max=5F?= =?UTF-8?q?size=E3=82=92=E8=BF=BD=E5=8A=A0=20#1078?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map.md | 6 +-- reference/flat_map/flat_map/empty.md | 60 +++++++++++++++++++++++++ reference/flat_map/flat_map/max_size.md | 52 +++++++++++++++++++++ reference/flat_map/flat_map/size.md | 2 +- 4 files changed, 116 insertions(+), 4 deletions(-) create mode 100644 reference/flat_map/flat_map/empty.md create mode 100644 reference/flat_map/flat_map/max_size.md diff --git a/reference/flat_map/flat_map.md b/reference/flat_map/flat_map.md index 1c2bff8c61..be8763fa7e 100644 --- a/reference/flat_map/flat_map.md +++ b/reference/flat_map/flat_map.md @@ -47,10 +47,10 @@ namespace std { ### 領域 | 名前 | 説明 | 対応バージョン | -|---------------------------------|------------------------------------|-------| -| [`empty`](flat_map/empty.md.nolink) | コンテナが空であるかどうかを調べる | C++23 | +|------------------------------------|------------------------------------|-------| +| [`empty`](flat_map/empty.md) | コンテナが空であるかどうかを調べる | C++23 | | [`size`](flat_map/size.md) | 要素数を取得する | C++23 | -| [`max_size`](flat_map/max_size.md.nolink) | 格納可能な最大の要素数を取得する | C++23 | +| [`max_size`](flat_map/max_size.md) | 格納可能な最大の要素数を取得する | C++23 | ### コンテナの変更 diff --git a/reference/flat_map/flat_map/empty.md b/reference/flat_map/flat_map/empty.md new file mode 100644 index 0000000000..1e6250c92e --- /dev/null +++ b/reference/flat_map/flat_map/empty.md @@ -0,0 +1,60 @@ +# empty +* flat_map[meta header] +* std[meta namespace] +* flat_map[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +[[nodiscard]] bool empty() const noexcept; // (1) C++23 +``` + +## 概要 +コンテナが空かどうかをテストする。 +コンテナが空([`size()`](size.md) が 0)の場合に `true` を返す。 + +この関数はコンテナ内のコンテンツを変化させない。コンテンツをクリアするには [`clear()`](clear.md.nolink) メンバ関数を使用する。 + + +## 戻り値 +コンテナサイズが 0 のときに `true`, そうでないときに `false` を返す。 + + +## 計算量 +定数時間。 + + +## 例 +```cpp example +#include +#include + +int main () +{ + stdx::flat_map fm; + + std::cout << fm.empty() << std::endl; + + fm.insert({42, 'a'}); + + std::cout << fm.empty() << std::endl; +} +``` +* empty()[color ff0000] +* fm.insert[link insert.md.nolink] + +### 出力 +``` +1 +0 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + diff --git a/reference/flat_map/flat_map/max_size.md b/reference/flat_map/flat_map/max_size.md new file mode 100644 index 0000000000..e6aa517152 --- /dev/null +++ b/reference/flat_map/flat_map/max_size.md @@ -0,0 +1,52 @@ +# max_size +* flat_map[meta header] +* std[meta namespace] +* flat_map[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +size_type max_size() const noexcept; // (1) C++23 +``` + +## 概要 +コンテナが格納できる要素の最大数を返す。 +これは、システムやライブラリ実装の制限のもとでコンテナが格納できる潜在的な最大サイズである。 + + +## 戻り値 +コンテナが自身のコンテンツとして保持できる要素の最大数。 +メンバ型 `size_type` は符号なし整数型である。 + + +## 計算量 +定数時間。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_map fm; + + std::cout << fm.max_size() << std::endl; +} +``` +* max_size()[color ff0000] + +### 出力例 +``` +178956970 +``` + +## 言語バージョン +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + diff --git a/reference/flat_map/flat_map/size.md b/reference/flat_map/flat_map/size.md index eee272795b..6df18cda80 100644 --- a/reference/flat_map/flat_map/size.md +++ b/reference/flat_map/flat_map/size.md @@ -62,4 +62,4 @@ int main () ## 関連項目 -- [`empty()`](empty.md.nolink) +- [`empty()`](empty.md) From d6e40dd1f3f328b9f1e2d3ba3fd06a068eee1d2d Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 24 May 2023 16:53:36 +0900 Subject: [PATCH 0321/3948] =?UTF-8?q?flat=5Fmap=20:=20clear=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20#1078?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map.md | 2 +- reference/flat_map/flat_map/clear.md | 61 ++++++++++++++++++++++++++++ reference/flat_map/flat_map/empty.md | 2 +- 3 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 reference/flat_map/flat_map/clear.md diff --git a/reference/flat_map/flat_map.md b/reference/flat_map/flat_map.md index be8763fa7e..e75b17b669 100644 --- a/reference/flat_map/flat_map.md +++ b/reference/flat_map/flat_map.md @@ -57,7 +57,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |-----------------------------------------------|--------------------------------------------|----------------| -| [`clear`](flat_map/clear.md.nolink) | 全ての要素を削除する | C++23 | +| [`clear`](flat_map/clear.md) | 全ての要素を削除する | C++23 | | [`insert`](flat_map/insert.md.nolink) | 要素を挿入する | C++23 | | [`insert_or_assign`](flat_map/insert_or_assign.md.nolink) | 要素を挿入、あるいは代入する | C++23 | | [`insert_range`](flat_map/insert_range.md.nolink) | Rangeを挿入する | C++23 | diff --git a/reference/flat_map/flat_map/clear.md b/reference/flat_map/flat_map/clear.md new file mode 100644 index 0000000000..a9e14e962b --- /dev/null +++ b/reference/flat_map/flat_map/clear.md @@ -0,0 +1,61 @@ +# clear +* flat_map[meta header] +* std[meta namespace] +* flat_map[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +void clear() noexcept; // (1) C++23 +``` + +## 概要 +コンテナ内の全ての要素を削除する。それぞれのデストラクタが呼ばれ、コンテナから削除される。[`size()`](size.md) は 0 になる。 + + +## 計算量 +線形時間 + + +## 例外 + +投げない + +## 例 +```cpp example +#include +#include + +int main () +{ + std::flat_map fm = { + {3, 'C'}, + {4, 'D'}, + {1, 'A'}, + {2, 'B'}, + }; + + std::cout << fm.size() << std::endl; + + fm.clear(); + + std::cout << fm.size() << std::endl; +} +``` +* clear()[color ff0000] +* fm.size()[link size.md] + +### 出力 +``` +4 +0 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/flat_map/flat_map/empty.md b/reference/flat_map/flat_map/empty.md index 1e6250c92e..610139592c 100644 --- a/reference/flat_map/flat_map/empty.md +++ b/reference/flat_map/flat_map/empty.md @@ -13,7 +13,7 @@ コンテナが空かどうかをテストする。 コンテナが空([`size()`](size.md) が 0)の場合に `true` を返す。 -この関数はコンテナ内のコンテンツを変化させない。コンテンツをクリアするには [`clear()`](clear.md.nolink) メンバ関数を使用する。 +この関数はコンテナ内のコンテンツを変化させない。コンテンツをクリアするには [`clear()`](clear.md) メンバ関数を使用する。 ## 戻り値 From d91c1da0f13281d896a93c82e69da2b0f8eb611b Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 25 May 2023 13:29:01 +0900 Subject: [PATCH 0322/3948] =?UTF-8?q?flat=5Fmap=20:=20contains=E3=81=A8cou?= =?UTF-8?q?nt=E3=82=92=E8=BF=BD=E5=8A=A0=20#1078?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map.md | 6 +- reference/flat_map/flat_map/contains.md | 74 ++++++++++++++++++ reference/flat_map/flat_map/count.md | 99 +++++++++++++++++++++++++ reference/flat_map/flat_map/find.md | 2 +- reference/map/map/contains.md | 3 + reference/map/map/count.md | 3 +- reference/map/multimap/contains.md | 3 + reference/set/multiset/contains.md | 3 + reference/set/multiset/count.md | 1 + reference/set/set/contains.md | 3 + 10 files changed, 193 insertions(+), 4 deletions(-) create mode 100644 reference/flat_map/flat_map/contains.md create mode 100644 reference/flat_map/flat_map/count.md diff --git a/reference/flat_map/flat_map.md b/reference/flat_map/flat_map.md index e75b17b669..2298004e7b 100644 --- a/reference/flat_map/flat_map.md +++ b/reference/flat_map/flat_map.md @@ -76,9 +76,9 @@ namespace std { |---------------------------------------|--------------------------------------------|-------| | [`operator[]`](flat_map/op_at.md) | 指定したキーを持つ要素を取得する | C++23 | | [`at`](flat_map/at.md) | 指定したキーを持つ要素を取得する | C++23 | -| [`count`](flat_map/count.md.nolink) | 指定したキーにマッチする要素の数を取得する | C++23 | +| [`count`](flat_map/count.md) | 指定したキーにマッチする要素の数を取得する | C++23 | | [`find`](flat_map/find.md) | 指定したキーで要素を探す | C++23 | -| [`contains`](flat_map/contains.md.nolink) | 指定したキーの要素が含まれているかを判定する | C++23 | +| [`contains`](flat_map/contains.md) | 指定したキーの要素が含まれているかを判定する | C++23 | | [`equal_range`](flat_map/equal_range.md.nolink) | 指定したキーにマッチする要素範囲を取得する | C++23 | | [`lower_bound`](flat_map/lower_bound.md.nolink) | 与えられた値より小さくない最初の要素へのイテレータを取得する | C++23 | | [`upper_bound`](flat_map/upper_bound.md.nolink) | 特定の値よりも大きい最初の要素へのイテレータを取得する | C++23 | @@ -89,6 +89,8 @@ namespace std { |-------------------------------------|----------------------------------------|----------------| | [`key_comp`](flat_map/key_comp.md.nolink) | キー比較用の関数オブジェクトを取得する | C++23 | | [`value_comp`](flat_map/value_comp.md.nolink) | 要素比較用の関数オブジェクトを取得する | C++23 | +| [`keys`](flat_map/keys.md.nolink) | キーのコンテナを取得する | C++23 | +| [`values`](flat_map/values.md.nolink) | 値のコンテナを取得する | C++23 | ## メンバ型 diff --git a/reference/flat_map/flat_map/contains.md b/reference/flat_map/flat_map/contains.md new file mode 100644 index 0000000000..4f8e68a1ca --- /dev/null +++ b/reference/flat_map/flat_map/contains.md @@ -0,0 +1,74 @@ +# contains +* flat_map[meta header] +* std[meta namespace] +* flat_map[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +bool contains(const key_type& x) const; // (1) C++23 + +template +bool contains(const K& x) const; // (2) C++23 +``` + + +## 概要 +指定されたキー`x`に一致する要素がコンテナに含まれているかを判定する。 + +- (1) : クラスのテンプレートパラメータ`key_type`型のキーを受け取る +- (2) : `key_type`と比較可能な`K`型のキーを受け取る + + +## 戻り値 +以下と等価: + +```cpp +return find(x) != end(); +``` +* find[link find.md] +* end()[link end.md.nolink] + + +## 計算量 +対数時間 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_map m = { + {'a', 3}, + {'b', 1}, + {'c', 4} + }; + + // キー'b'の要素が含まれているか + if (m.contains('b')) { + std::cout << "contain" << std::endl; + } + else { + std::cout << "doesn't contain" << std::endl; + } +} +``` +* contains[color ff0000] + +### 出力 +``` +contain +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/flat_map/flat_map/count.md b/reference/flat_map/flat_map/count.md new file mode 100644 index 0000000000..b1fbb97af5 --- /dev/null +++ b/reference/flat_map/flat_map/count.md @@ -0,0 +1,99 @@ +# count +* flat_map[meta header] +* std[meta namespace] +* flat_map[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +size_type count(const key_type& x) const; // (1) C++23 + +template +size_type count(const K& x) const; // (2) C++23 +``` + +## 概要 +キー `x` を検索し、コンテナ内に見つかった要素の数を返す。`flat_map` コンテナはキーの重複を許さないため、この関数は実際には要素が見つかったときに 1 を、そうでないときに 0 を返す。 + +- (1) : クラスのテンプレートパラメータ`key_type`型のキーを受け取る +- (2) : `key_type`と比較可能な`K`型のキーを受け取る + + +## 戻り値 +- (1) : `x`と等価なキーの要素が見つかった場合は1、そうでない場合は0を返す。 +- (2) : `key_compare`型の関数オブジェクトを`c`、コンテナ内の各要素が持つキーを`k`として、キーが等価か判定する式`!c(k, x) && !c(x, k)`が`true`となる要素が見つかった場合は1、そうでない場合は0を返す。 + + +## 計算量 +``` +log(b.size()) + b.count(k) +``` +* b.size()[link size.md] + + +## 備考 +- (2) : この関数がオーバーロード解決に参加する条件は、[`find()`](find.md)メンバ関数の備考欄を参照 +- [`std::flat_multimap`](/reference/flat_map/flat_multimap.md.nolink)クラスとの共通インタフェースを使用する必要がなければ、この関数の代わりに[`contains()`](contains.md)メンバ関数を使用することを推奨する + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + // (1) + { + std::flat_map fm = { + {"Alice", 3}, + {"Bob", 1}, + {"Carol", 4} + }; + + std::size_t n = fm.count("Bob"); + if (n > 0) { // 見つかった + std::cout << "found" << std::endl; + } + } + + // (2) + { + std::flat_map> fm = { + {"Alice", 3}, + {"Bob", 1}, + {"Carol", 4} + }; + + // std::lessのvoidに対する特殊化を使用することで、 + // 文字列リテラルをcount()関数の引数として渡した際に、 + // std::string型の一時オブジェクトが生成されない。 + std::size_t n = fm.count("Bob"); + if (n > 0) { // 見つかった + std::cout << "found" << std::endl; + } + } +} +``` +* fm.count[color ff0000] +* std::less[link /reference/functional/less.md] + +### 出力 +``` +found +found +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`contains()`](contains.md) diff --git a/reference/flat_map/flat_map/find.md b/reference/flat_map/flat_map/find.md index 6541baebbe..99f5e642f7 100644 --- a/reference/flat_map/flat_map/find.md +++ b/reference/flat_map/flat_map/find.md @@ -104,5 +104,5 @@ int main() ## 関連項目 -- [`contains()`](contains.md.nolink) +- [`contains()`](contains.md) diff --git a/reference/map/map/contains.md b/reference/map/map/contains.md index a102feb735..6b35fbba73 100644 --- a/reference/map/map/contains.md +++ b/reference/map/map/contains.md @@ -16,6 +16,9 @@ bool contains(const K& x) const; // (2) ## 概要 指定されたキー`x`に一致する要素がコンテナに含まれているかを判定する。 +- (1) : クラスのテンプレートパラメータ`key_type`型のキーを受け取る +- (2) : `key_type`と比較可能な`K`型のキーを受け取る + ## 戻り値 以下と等価: diff --git a/reference/map/map/count.md b/reference/map/map/count.md index ad73fabefd..c8664399a9 100644 --- a/reference/map/map/count.md +++ b/reference/map/map/count.md @@ -31,7 +31,8 @@ log(b.size()) + b.count(k) ## 備考 -- (2) : この関数がオーバーロード解決に参加する条件は、[`find()`](find.md)メンバ関数の備考欄を参照。 +- (2) : この関数がオーバーロード解決に参加する条件は、[`find()`](find.md)メンバ関数の備考欄を参照 +- [`std::multimap`](/reference/map/multimap.md)クラスとの共通インタフェースを使用する必要がなければ、この関数の代わりに[`contains()`](contains.md)メンバ関数を使用することを推奨する ## 例 diff --git a/reference/map/multimap/contains.md b/reference/map/multimap/contains.md index 63c7c74956..4a902da65a 100644 --- a/reference/map/multimap/contains.md +++ b/reference/map/multimap/contains.md @@ -16,6 +16,9 @@ bool contains(const K& x) const; // (2) ## 概要 指定されたキー`x`に一致する要素がコンテナに含まれているかを判定する。 +- (1) : クラスのテンプレートパラメータ`key_type`型のキーを受け取る +- (2) : `key_type`と比較可能な`K`型のキーを受け取る + ## 戻り値 以下と等価: diff --git a/reference/set/multiset/contains.md b/reference/set/multiset/contains.md index 80612edcd5..10f93aa92d 100644 --- a/reference/set/multiset/contains.md +++ b/reference/set/multiset/contains.md @@ -16,6 +16,9 @@ bool contains(const K& x) const; // (2) ## 概要 指定されたキー`x`に一致する要素がコンテナに含まれているかを判定する。 +- (1) : クラスのテンプレートパラメータ`key_type`型のキーを受け取る +- (2) : `key_type`と比較可能な`K`型のキーを受け取る + ## 戻り値 以下と等価: diff --git a/reference/set/multiset/count.md b/reference/set/multiset/count.md index ae5ea12d13..8f801ed4b4 100644 --- a/reference/set/multiset/count.md +++ b/reference/set/multiset/count.md @@ -32,6 +32,7 @@ log(b.size()) + b.count(k) ## 備考 - (2) : この関数がオーバーロード解決に参加する条件は、[`find()`](find.md)メンバ関数の備考欄を参照。 +- [`std::multiset`](/reference/set/multiset.md)クラスとの共通インタフェースを使用する必要がなければ、この関数の代わりに[`contains()`](contains.md)メンバ関数を使用することを推奨する ## 例 diff --git a/reference/set/set/contains.md b/reference/set/set/contains.md index 6100e511ee..fc3f07756e 100644 --- a/reference/set/set/contains.md +++ b/reference/set/set/contains.md @@ -16,6 +16,9 @@ bool contains(const K& x) const; // (2) ## 概要 指定されたキー`x`に一致する要素がコンテナに含まれているかを判定する。 +- (1) : クラスのテンプレートパラメータ`key_type`型のキーを受け取る +- (2) : `key_type`と比較可能な`K`型のキーを受け取る + ## 戻り値 以下と等価: From 19decb254a0a081db7d7047d2405ac1ae5b8a066 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 25 May 2023 13:57:22 +0900 Subject: [PATCH 0323/3948] =?UTF-8?q?=E5=A4=89=E6=95=B0=E5=90=8D=E3=82=92?= =?UTF-8?q?=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map/contains.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/flat_map/flat_map/contains.md b/reference/flat_map/flat_map/contains.md index 4f8e68a1ca..23eb0bf271 100644 --- a/reference/flat_map/flat_map/contains.md +++ b/reference/flat_map/flat_map/contains.md @@ -41,14 +41,14 @@ return find(x) != end(); int main() { - std::flat_map m = { + std::flat_map fm = { {'a', 3}, {'b', 1}, {'c', 4} }; // キー'b'の要素が含まれているか - if (m.contains('b')) { + if (fm.contains('b')) { std::cout << "contain" << std::endl; } else { From 876f77c7c909f2972ecdc95333a1f86896ea091f Mon Sep 17 00:00:00 2001 From: Akiko Kawai Date: Mon, 5 Jun 2023 14:56:20 +0900 Subject: [PATCH 0324/3948] Update implementation-status.md for C++20 of ICC --- implementation-status.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/implementation-status.md b/implementation-status.md index e813d62bf3..a24835dc9c 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -178,7 +178,7 @@ | P0306R4: [可変引数が空でない場合のトークン置換](/lang/cpp20/va_opt.md) | プリプロセッサの置換で可変引数が空の場合に余計なカンマが付いてしまう問題に対処 | 8 (partial, `#__VA_OPT__`による文字列化が未サポート) | 6.0
9.0 ([p1042](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1042r1.html)) | 2021.4 | 2019 Update 5 | | P0329R4: [指示付き初期化](/lang/cpp20/designated_initialization.md) | | 8 | 6.0 (partial) | 2021.4 | 2019 Update 1 | | P0734R0: [コンセプト](/lang/cpp20/concepts.md) | テンプレートパラメータに対する制約を行う | 10 | 10.0 (partial) | 2021.6 | 2019 Update 3 | -| P0614R1: [初期化式をともなう範囲for文](/lang/cpp20/range-based_for_statements_with_initializer.md) | 範囲for文スコープで使用する変数の初期化のための構文を追加 | 9 | 8.0 | | 2019 Update 5 | +| P0614R1: [初期化式をともなう範囲for文](/lang/cpp20/range-based_for_statements_with_initializer.md) | 範囲for文スコープで使用する変数の初期化のための構文を追加 | 9 | 8.0 | 2021.7 | 2019 Update 5 | | P0588R1: [暗黙のラムダキャプチャを簡略化](/lang/cpp20/simplifying_implicit_lambda_capture.md) | ラムダ式のキャプチャに関する仕様整理 | 8 | No | 2021.4 | 2019 Update 4 | | P0846R0: [関数テンプレートに明示的に型指定した場合にADLで見つからない問題を修正](/lang/cpp20/adl_and_function_templates_that_are_not_visible.md) | 名前空間内の関数テンプレートをテンプレート引数指定かつ非修飾・ADLで正しく呼び出せるよう修正 | 9 | 9.0 | 2021.4 | 2019 Update 1 | | P0641R2: [デフォルトのコピーコンストラクタと非`const`なコンストラクタが衝突する問題を修正](/lang/cpp20/resolving_const_mismatch_with_defaulted_copy_constructor.md) | 非`const`なオブジェクトをとるコンストラクタを定義すると、そのクラスをラップしたクラスのコピーコンストラクタが不適格になってしまう問題を修正 | 9 | 8.0 | 2021.4 | 2015 | From 95fb484cfa67d9ff9c25e7fb3b53876e24abc206 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 5 Jun 2023 16:40:48 +0900 Subject: [PATCH 0325/3948] =?UTF-8?q?flat=5Fmap=20:=20containers=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20#1078?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map.md | 13 +++- reference/flat_map/flat_map/containers.md | 86 +++++++++++++++++++++++ 2 files changed, 97 insertions(+), 2 deletions(-) create mode 100644 reference/flat_map/flat_map/containers.md diff --git a/reference/flat_map/flat_map.md b/reference/flat_map/flat_map.md index 2298004e7b..60a86281ad 100644 --- a/reference/flat_map/flat_map.md +++ b/reference/flat_map/flat_map.md @@ -15,7 +15,7 @@ namespace std { } ``` * less[link ../functional/less.md] -* vector[link /reference/vector.md] +* vector[link /reference/vector/vector.md] ## 概要 @@ -112,7 +112,7 @@ namespace std { | `const_reverse_iterator` | 読み取り専用逆順双方向イテレータ。[`std::reverse_iterator`](/reference/iterator/reverse_iterator.md)`` | C++23 | | `key_container_type` | キーを格納するコンテナ型 `KeyContainer` | C++23 | | `mapped_container_type` | 値を格納するコンテナ型 `MappedContainer` | C++23 | -| [`containers`](flat_map/containers.md.nolink) | キーのコンテナと値のコンテナを保持する型 | C++23 | +| [`containers`](flat_map/containers.md) | キーのコンテナと値のコンテナを保持する型 | C++23 | ## 非メンバ関数 @@ -302,6 +302,15 @@ int main() 1 ``` +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + ## 参照 - [P0429R3 A Standard `flat_map`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0429r3.pdf) diff --git a/reference/flat_map/flat_map/containers.md b/reference/flat_map/flat_map/containers.md new file mode 100644 index 0000000000..16e454e485 --- /dev/null +++ b/reference/flat_map/flat_map/containers.md @@ -0,0 +1,86 @@ +# flat_map::containers +* flat_map[meta header] +* std[meta namespace] +* class[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template , + class KeyContainer = vector, + class MappedContainer = vector> + class flat_map { + public: + using key_container_type = KeyContainer; + using mapped_container_type = MappedContainer; + + struct containers { + key_container_type keys; + mapped_container_type values; + }; + }; +} +``` +* less[link /reference/functional/less.md] +* vector[link /reference/vector/vector.md] + +## 概要 +`flat_map`クラス内部のデータ保持方法として、キーのコンテナと値のコンテナをもつ。 + +この形式の内部表現は[`extract()`](extract.md.nolink)メンバ関数で取得でき、シリアライズなどの用途に使用できる。 + + +## 例 +### 基本的な使い方 +```cpp example +#include +#include +#include + +int main() +{ + std::flat_map fm = { + {"Alice", 3}, + {"Bob", 1}, + {"Carol", 4} + }; + + decltype(fm)::containers c = fm.extract(); + + std::cout << "keys:" + for (const auto& key : c.keys) { + std::cout << " " << key << std::endl; + } + + std::cout << "values:" + for (const auto& value : c.values) { + std::cout << " " << value << std::endl; + } +} +``` +* containers[color ff0000] +* fm.extract()[link extract.md.nolink] + +#### 出力 +``` +keys: + Alice + Bob + Carol +values: + 3 + 1 + 4 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? From 94035802f33d93439e33cd6b437f097d11ff402f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 5 Jun 2023 16:55:04 +0900 Subject: [PATCH 0326/3948] =?UTF-8?q?flat=5Fmap=20:=20map=E3=81=AE?= =?UTF-8?q?=E3=82=B3=E3=83=94=E3=83=9A=E3=81=A7=E6=9B=B8=E3=81=84=E3=81=A6?= =?UTF-8?q?=E3=81=84=E3=81=9F=E3=81=A8=E3=81=93=E3=82=8D=E3=82=92flat=5Fma?= =?UTF-8?q?p=E5=9B=BA=E6=9C=89=E3=81=AE=E4=BB=95=E6=A7=98=E3=81=AB?= =?UTF-8?q?=E6=9B=B8=E3=81=8D=E7=9B=B4=E3=81=97=20#1078?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map/contains.md | 10 +++++++ reference/flat_map/flat_map/count.md | 8 +++++- reference/flat_map/flat_map/find.md | 2 +- reference/flat_map/flat_map/max_size.md | 9 ++++-- reference/flat_map/flat_map/op_at.md | 37 ++++++++++++++++++++++++- reference/flat_map/flat_map/size.md | 8 ++++-- 6 files changed, 67 insertions(+), 7 deletions(-) diff --git a/reference/flat_map/flat_map/contains.md b/reference/flat_map/flat_map/contains.md index 23eb0bf271..8f2f27ae03 100644 --- a/reference/flat_map/flat_map/contains.md +++ b/reference/flat_map/flat_map/contains.md @@ -20,6 +20,10 @@ bool contains(const K& x) const; // (2) C++23 - (2) : `key_type`と比較可能な`K`型のキーを受け取る +## テンプレートパラメータ制約 +- (2) : `key_compare::is_transparent`が妥当な式であること + + ## 戻り値 以下と等価: @@ -34,6 +38,12 @@ return find(x) != end(); 対数時間 +## 備考 +- (3) : + - `is_transparent`は、標準ライブラリの[`std::less`](/reference/functional/less.md)、[`std::greater`](/reference/functional/greater.md)といった関数オブジェクトの、`void`に対する特殊化で定義される。それ以外のテンプレートパラメータで`is_transparent`が定義されないのは、互換性のためである。 + - これらのオーバーロードは、`flat_map`のようなコンテナに対し、検索操作で文字列リテラルを渡した際に、キー型の一時オブジェクトが生成されるコストを減らすためにある。 + + ## 例 ```cpp example #include diff --git a/reference/flat_map/flat_map/count.md b/reference/flat_map/flat_map/count.md index b1fbb97af5..78d869efb8 100644 --- a/reference/flat_map/flat_map/count.md +++ b/reference/flat_map/flat_map/count.md @@ -19,6 +19,10 @@ size_type count(const K& x) const; // (2) C++23 - (2) : `key_type`と比較可能な`K`型のキーを受け取る +## テンプレートパラメータ制約 +- (2) : `key_compare::is_transparent`が妥当な式であること + + ## 戻り値 - (1) : `x`と等価なキーの要素が見つかった場合は1、そうでない場合は0を返す。 - (2) : `key_compare`型の関数オブジェクトを`c`、コンテナ内の各要素が持つキーを`k`として、キーが等価か判定する式`!c(k, x) && !c(x, k)`が`true`となる要素が見つかった場合は1、そうでない場合は0を返す。 @@ -32,7 +36,9 @@ log(b.size()) + b.count(k) ## 備考 -- (2) : この関数がオーバーロード解決に参加する条件は、[`find()`](find.md)メンバ関数の備考欄を参照 +- (2) : + - `is_transparent`は、標準ライブラリの[`std::less`](/reference/functional/less.md)、[`std::greater`](/reference/functional/greater.md)といった関数オブジェクトの、`void`に対する特殊化で定義される。それ以外のテンプレートパラメータで`is_transparent`が定義されないのは、互換性のためである。 + - これらのオーバーロードは、`flat_map`のようなコンテナに対し、検索操作で文字列リテラルを渡した際に、キー型の一時オブジェクトが生成されるコストを減らすためにある。 - [`std::flat_multimap`](/reference/flat_map/flat_multimap.md.nolink)クラスとの共通インタフェースを使用する必要がなければ、この関数の代わりに[`contains()`](contains.md)メンバ関数を使用することを推奨する diff --git a/reference/flat_map/flat_map/find.md b/reference/flat_map/flat_map/find.md index 99f5e642f7..820727e597 100644 --- a/reference/flat_map/flat_map/find.md +++ b/reference/flat_map/flat_map/find.md @@ -40,7 +40,7 @@ const_iterator find(const K& x) const; // (4) C++23 ## 備考 - (2), (4) : - `is_transparent`は、標準ライブラリの[`std::less`](/reference/functional/less.md)、[`std::greater`](/reference/functional/greater.md)といった関数オブジェクトの、`void`に対する特殊化で定義される。それ以外のテンプレートパラメータで`is_transparent`が定義されないのは、互換性のためである。 - - これらのオーバーロードは、`map`のようなコンテナに対し、検索操作で文字列リテラルを渡した際に、キー型の一時オブジェクトが生成されるコストを減らすためにある。 + - これらのオーバーロードは、`flat_map`のようなコンテナに対し、検索操作で文字列リテラルを渡した際に、キー型の一時オブジェクトが生成されるコストを減らすためにある。 ## 例 diff --git a/reference/flat_map/flat_map/max_size.md b/reference/flat_map/flat_map/max_size.md index e6aa517152..df57adf3c5 100644 --- a/reference/flat_map/flat_map/max_size.md +++ b/reference/flat_map/flat_map/max_size.md @@ -15,8 +15,13 @@ size_type max_size() const noexcept; // (1) C++23 ## 戻り値 -コンテナが自身のコンテンツとして保持できる要素の最大数。 -メンバ型 `size_type` は符号なし整数型である。 +[`containers`](containers.md)型メンバ変数`c`があるとして、以下を返す。 + +```cpp +return min(c.keys.max_size(), c.values.max_size()); +``` +* min[link /reference/algorithm/min.md] +* max_size()[link /reference/vector/vector/max_size.md] ## 計算量 diff --git a/reference/flat_map/flat_map/op_at.md b/reference/flat_map/flat_map/op_at.md index f9131e3251..df611e9bd6 100644 --- a/reference/flat_map/flat_map/op_at.md +++ b/reference/flat_map/flat_map/op_at.md @@ -8,20 +8,55 @@ ```cpp mapped_type& operator[](const key_type& x); // (1) C++23 mapped_type& operator[](key_type&& x); // (2) C++23 + +template +mapped_type& operator[](K&& x); // (3) C++23 ``` ## 概要 指定したキーを持つ要素を取得する。対応する要素が存在しない場合は生成して返す。 +- (1) : 左辺値のキーを受け取る +- (2) : 一時オブジェクトのキーを受け取る +- (3) : `key_type`と比較可能なキーを受け取る + + +## テンプレートパラメータ制約 +- (3) : `key_compare::is_transparent`が妥当な式であること + ## 戻り値 -キー`x`に対応する値を返す。対応する要素が存在しない場合は、要素をデフォルト構築して参照を返す。 +- (1) : 以下と等価 + ```cpp + return try_emplace(x).first->second; + ``` + * try_emplace[link try_emplace.md.nolink] + +- (2) : 以下と等価 + ```cpp + return try_emplace(std::move(x)).first->second; + ``` + * try_emplace[link try_emplace.md.nolink] + * std::move[link /reference/utility/move.md] + +- (3) : 以下と等価 + ```cpp + return try_emplace(std::forward(x)).first->second; + ``` + * try_emplace[link try_emplace.md.nolink] + * std::forward[link /reference/utility/forward.md] ## 計算量 要素数に対して対数時間 +## 備考 +- (3) : + - `is_transparent`は、標準ライブラリの[`std::less`](/reference/functional/less.md)、[`std::greater`](/reference/functional/greater.md)といった関数オブジェクトの、`void`に対する特殊化で定義される。それ以外のテンプレートパラメータで`is_transparent`が定義されないのは、互換性のためである。 + - これらのオーバーロードは、`flat_map`のようなコンテナに対し、検索操作で文字列リテラルを渡した際に、キー型の一時オブジェクトが生成されるコストを減らすためにある。 + + ## 例 ```cpp example #include diff --git a/reference/flat_map/flat_map/size.md b/reference/flat_map/flat_map/size.md index 6df18cda80..580aa8b4ad 100644 --- a/reference/flat_map/flat_map/size.md +++ b/reference/flat_map/flat_map/size.md @@ -14,8 +14,12 @@ size_type size() const noexcept; ## 戻り値 -コンテナに格納されている要素の数を返す。 -メンバ型 `size_type` は符号なし整数型である。 +[`containers`](containers.md)型メンバ変数`c`があるとして、以下を返す。 + +```cpp +return c.keys.size(); +``` +* size()[link /reference/vector/vector/size.md] ## 計算量 From 309d0ed04619e888f7d063ef314f6852c8575a41 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 5 Jun 2023 17:01:27 +0900 Subject: [PATCH 0327/3948] =?UTF-8?q?=E8=A6=8F=E6=A0=BC=E8=8D=89=E6=A1=88?= =?UTF-8?q?=E3=82=92=E6=9B=B4=E6=96=B0=20#1151?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- international-standard.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/international-standard.md b/international-standard.md index acb3caa2ca..c88bd11465 100644 --- a/international-standard.md +++ b/international-standard.md @@ -12,7 +12,7 @@ C++ の標準規格は、他にも各国の規格化団体によって国際標 | 通称†1 | 名称 | 参照する規格案†2 | 規格案・原案 | `__cplusplus` | |:--|:--|:--|:--|:--| -| [C++23](lang/cpp23.md) (C++2b) | ISO/IEC 14882:2023 (予定) | N4944([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4944.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/)) | N4944 N4928 N4917 N4910 N4901 N4892 N4885 N4878
N4868 N4861 | -- | +| [C++23](lang/cpp23.md) (C++2b) | ISO/IEC 14882:2023 (予定) | N4950([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4950.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/)) | M4950 N4944 N4928 N4917 N4910 N4901 N4892 N4885 N4878
N4868 N4861 | -- | | [C++20](lang/cpp20.md) (C++2a) | ISO/IEC 14882:2020 | N4861†3([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/n4861.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4861/)) | N4860 N4849 N4842 N4835 N4830
N4820 N4810 N4800 N4791 N4788†4
N4778 N4762 N4750 N4741 N4727
N4713 N4700 N4687 | `202002L` | | [C++17](lang/cpp17.md) (C++1z) | ISO/IEC 14882:2017 | N4659([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4659.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4659/)) | N4660 N4659 N4640 N4618 N4606
N4594 N4582 N4567 N4527 N4431
N4296 | `201703L` | | [C++14](lang/cpp14.md) (C++1y) | ISO/IEC 14882:2014 | N4140([PDF](https://github.com/cplusplus/draft/blob/master/papers/n4140.pdf?raw=true)/[HTML](https://timsong-cpp.github.io/cppwp/n4140/)) | N4141 N4140 N3937 N3936 N3797
N3691 N3690 N3485 N3376 N3337 | `201402L` | From dc8afeb80e6ddd381b69bc2183821e7147e07465 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 7 Jun 2023 13:03:06 +0900 Subject: [PATCH 0328/3948] =?UTF-8?q?=E3=82=B9=E3=83=9D=E3=83=B3=E3=82=B5?= =?UTF-8?q?=E3=83=BC=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.md b/index.md index 48ecb58ac1..faa2490455 100644 --- a/index.md +++ b/index.md @@ -91,6 +91,8 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい ### 一時スポンサー +
odan
+ - [Hashitaku様](https://opencollective.com/hashitaku)
yukika2e
From 86be6a9acac38fb842a093948e9ee02679a267eb Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 7 Jun 2023 13:09:46 +0900 Subject: [PATCH 0329/3948] =?UTF-8?q?=E3=82=BF=E3=82=B0=E3=81=AE=E6=9B=B8?= =?UTF-8?q?=E3=81=8D=E9=96=93=E9=81=95=E3=81=84=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.md b/index.md index faa2490455..cc9e87f9ac 100644 --- a/index.md +++ b/index.md @@ -91,7 +91,7 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい ### 一時スポンサー -
odan
+
odan
- [Hashitaku様](https://opencollective.com/hashitaku) From 4476acb905f114be0c9850595fc37a7fa486617a Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 7 Jun 2023 18:26:38 +0900 Subject: [PATCH 0330/3948] =?UTF-8?q?P2614R2=E5=AF=BE=E5=BF=9C=20(#1145)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/limits.md | 2 +- reference/limits/float_denorm_style.md | 5 +++++ reference/limits/numeric_limits.md | 6 +++--- reference/limits/numeric_limits/denorm_min.md | 9 +++++++-- reference/limits/numeric_limits/has_denorm.md | 6 +++--- reference/limits/numeric_limits/has_denorm_loss.md | 3 +++ 6 files changed, 22 insertions(+), 9 deletions(-) diff --git a/reference/limits.md b/reference/limits.md index 0a550bc2a3..1e09b5242b 100644 --- a/reference/limits.md +++ b/reference/limits.md @@ -10,5 +10,5 @@ |--------------------------------------------------------|------------------------------|-------| | [`numeric_limits`](limits/numeric_limits.md) | 算術型の性質(class template) | | | [`float_round_style`](limits/float_round_style.md) | 浮動小数点数の丸め形式に関する列挙値(enum) | | -| [`float_denorm_style`](limits/float_denorm_style.md) | 非正規数のサポートに関する列挙値(enum) | | +| [`float_denorm_style`](limits/float_denorm_style.md) | 非正規数のサポートに関する列挙値(enum) | C++23で非推奨 | diff --git a/reference/limits/float_denorm_style.md b/reference/limits/float_denorm_style.md index 2fea59e749..578258c287 100644 --- a/reference/limits/float_denorm_style.md +++ b/reference/limits/float_denorm_style.md @@ -2,6 +2,7 @@ * limits[meta header] * std[meta namespace] * enum[meta id-type] +* cpp23deprecated[meta cpp] ```cpp namespace std { @@ -13,6 +14,8 @@ namespace std { } ``` +この型を返すメンバ変数がC++23にて非推奨化されるため、列挙型も非推奨とされる。 + `std::float_denorm_style`列挙型は、非正規化数(Denormal Number)のサポートに関する情報のための列挙値を提供する。 | 列挙値 | 説明 | @@ -22,3 +25,5 @@ namespace std { | `denorm_present` | 値型が非正規化数を許可する | +## 参照 +- [P2614R2 Deprecate `numeric_limits::has_denorm`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2614r2.pdf) diff --git a/reference/limits/numeric_limits.md b/reference/limits/numeric_limits.md index 54760b3ccb..e97b2017af 100644 --- a/reference/limits/numeric_limits.md +++ b/reference/limits/numeric_limits.md @@ -64,8 +64,8 @@ namespace std { | [`has_infinity`](numeric_limits/has_infinity.md) | 正の無限表現を持っているかを判定する | | | [`has_quiet_NaN`](numeric_limits/has_quiet_nan.md) | シグナルを発生させないNaNを持っているかを判定する | | | [`has_signaling_NaN`](numeric_limits/has_signaling_nan.md) | シグナルを発生させるNaNを持っているかを判定する | | -| [`has_denorm`](numeric_limits/has_denorm.md) | 非正規化数のサポート状況を判定する | | -| [`has_denorm_loss`](numeric_limits/has_denorm_loss.md) | 精度の損失が非正規化数によるものかを判定する | | +| [`has_denorm`](numeric_limits/has_denorm.md) | 非正規化数のサポート状況を判定する | C++23で非推奨 | +| [`has_denorm_loss`](numeric_limits/has_denorm_loss.md) | 精度の損失が非正規化数によるものかを判定する | C++23で非推奨 | | [`infinity()`](numeric_limits/infinity.md) | 正の無限表現を取得する | | | [`quiet_NaN()`](numeric_limits/quiet_nan.md) | シグナルを発生させないNaNを取得する | | | [`signaling_NaN()`](numeric_limits/signaling_nan.md) | シグナルを発生させるNaNを取得する | | @@ -81,4 +81,4 @@ namespace std { ## 参照 - [N2114 `long long` Goes to the Library, Revision 1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2114.html) - [LWG Issue 559. `numeric_limits`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#559) - +- [P2614R2 Deprecate `numeric_limits::has_denorm`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2614r2.pdf) diff --git a/reference/limits/numeric_limits/denorm_min.md b/reference/limits/numeric_limits/denorm_min.md index f134185d72..9ac1aa9666 100644 --- a/reference/limits/numeric_limits/denorm_min.md +++ b/reference/limits/numeric_limits/denorm_min.md @@ -22,7 +22,8 @@ static constexpr T denorm_min() noexcept; // (1) C++11 ## 戻り値 -最小の正の非正規化数 +非正規化数をサポートするならば、最小の正の非正規化数。 +そうでなければ、最小の正の正規化数。 ## 例外 @@ -51,7 +52,11 @@ float : 1.4013e-045 double : 4.94066e-324 ``` -## 参照 + +## 関連項目 * [`numeric_limits::has_denorm`](has_denorm.md) * [`numeric_limits::has_denorm_loss`](has_denorm_loss.md) + +## 参照 +- [P2614R2 Deprecate `numeric_limits::has_denorm`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2614r2.pdf) diff --git a/reference/limits/numeric_limits/has_denorm.md b/reference/limits/numeric_limits/has_denorm.md index 3ed1db591b..f355ceb1f2 100644 --- a/reference/limits/numeric_limits/has_denorm.md +++ b/reference/limits/numeric_limits/has_denorm.md @@ -3,6 +3,7 @@ * std[meta namespace] * numeric_limits[meta class] * variable[meta id-type] +* cpp23deprecated[meta cpp] ```cpp // C++03 @@ -71,7 +72,6 @@ float : present double : present ``` -## 参照 -* [`float_denorm_style`](../float_denorm_style.md) - +## 参照 +- [P2614R2 Deprecate `numeric_limits::has_denorm`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2614r2.pdf) diff --git a/reference/limits/numeric_limits/has_denorm_loss.md b/reference/limits/numeric_limits/has_denorm_loss.md index 947b3eb8b6..f16a0b5e3f 100644 --- a/reference/limits/numeric_limits/has_denorm_loss.md +++ b/reference/limits/numeric_limits/has_denorm_loss.md @@ -3,6 +3,7 @@ * std[meta namespace] * numeric_limits[meta class] * variable[meta id-type] +* cpp23deprecated[meta cpp] ```cpp // C++03 @@ -43,3 +44,5 @@ double : false ``` +## 参照 +- [P2614R2 Deprecate `numeric_limits::has_denorm`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2614r2.pdf) From f016e5bd22ff018f840da9de5698acce5d6e993e Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 7 Jun 2023 18:41:30 +0900 Subject: [PATCH 0331/3948] =?UTF-8?q?generator:=20P2787R1=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/generator/generator.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reference/generator/generator.md b/reference/generator/generator.md index 70e949cc5a..8b8ada27bd 100644 --- a/reference/generator/generator.md +++ b/reference/generator/generator.md @@ -10,6 +10,11 @@ namespace std { class generator : public ranges::view_interface> { ... } + + namespace pmr { + template + using generator = std::generator>; + } } ``` * ranges::view_interface[link /reference/ranges/view_interface.md] @@ -294,5 +299,6 @@ int main() ## 参照 - [P2502R2 `std::generator`: Synchronous Coroutine Generator for Ranges](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2502r2.pdf) +- [P2787R1 pmr::generator - Promise Types are not Values](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2787r1.pdf) - [P0981R0 Halo: coroutine Heap Allocation eLision Optimization: the joint response](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0981r0.html) - ジェネレータコルーチン実装において、動的メモリ確保が省略最適化される条件の議論。`std::generator`の設計に反映されている。 From 05d6b67e43a136c1b3146e1d6560d50870270188 Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 7 Jun 2023 18:51:07 +0900 Subject: [PATCH 0332/3948] P1413R2 -> P1413R3 --- reference/type_traits.md | 5 +++-- reference/type_traits/aligned_storage.md | 2 +- reference/type_traits/aligned_union.md | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/reference/type_traits.md b/reference/type_traits.md index 2b498ee7cb..ab74ad28b7 100644 --- a/reference/type_traits.md +++ b/reference/type_traits.md @@ -187,8 +187,8 @@ | 名前 | 説明 | 対応バージョン | |------------------------|-------------------------------------------|-------| | [`type_identity`](type_traits/type_identity.md) | 受け取った型を返す (class template) | C++20 | -| [`aligned_storage`](type_traits/aligned_storage.md) | アライメント調整された領域を作る (class template) | C++11 | -| [`aligned_union`](type_traits/aligned_union.md) | アライメント調整された共用体領域を作る (class template) | C++11 | +| [`aligned_storage`](type_traits/aligned_storage.md) | アライメント調整された領域を作る (class template) | C++11
C++23で非推奨 | +| [`aligned_union`](type_traits/aligned_union.md) | アライメント調整された共用体領域を作る (class template) | C++11
C++23で非推奨 | | [`remove_cvref`](type_traits/remove_cvref.md) | 型の`const-volatile`修飾と参照を除去する (class template) | C++20 | | [`decay`](type_traits/decay.md) | 配列と関数ポインタに関して、関数テンプレートと同様に推論された型を取得する (class template) | C++11 | | [`enable_if`](type_traits/enable_if.md) | コンパイル時条件式が真の場合のみ有効な型 (class template) | C++11 | @@ -243,3 +243,4 @@ - [型特性 - Boost逆引きリファレンス](https://boostjp.github.io/tips/type_traits.html) - [LWG Issue 2581. Specialization of `` variable templates should be prohibited](https://wg21.cmeerw.net/lwg/issue2581) - C++14までは``で定義されるクラステンプレートの特殊化を禁止していたが、C++17で定義される変数テンプレートも特殊化の禁止対象とされた +- [P1413R3 Deprecate `std::aligned_storage` and `std::aligned_union`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1413r3.pdf) diff --git a/reference/type_traits/aligned_storage.md b/reference/type_traits/aligned_storage.md index 67fdfa67fc..688a1a3e26 100644 --- a/reference/type_traits/aligned_storage.md +++ b/reference/type_traits/aligned_storage.md @@ -215,5 +215,5 @@ int main() - C++14で`aligned_storage_t`が定義された - [P0767R1 Deprecate POD](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0767r1.html) - C++20でPOD用語の非推奨化にともない、メンバ型`type`がPOD型ではなくトリビアル型に分類されるよう規定が変更された -- [P1413R2 Deprecate `std::aligned_storage` and `std::aligned_union`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1413r2.pdf) +- [P1413R3 Deprecate `std::aligned_storage` and `std::aligned_union`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1413r3.pdf) - C++23でこの機能が非推奨となった diff --git a/reference/type_traits/aligned_union.md b/reference/type_traits/aligned_union.md index 5cc614be93..840f4e410a 100644 --- a/reference/type_traits/aligned_union.md +++ b/reference/type_traits/aligned_union.md @@ -132,5 +132,5 @@ hello - [LWG Issue 2979. `aligned_union` should require complete object types](https://wg21.cmeerw.net/lwg/issue2979) - [P0767R1 Deprecate POD](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0767r1.html) - C++20でPOD用語の非推奨化にともない、メンバ型`type`がPOD型ではなくトリビアル型に分類されるよう規定が変更された -- [P1413R2 Deprecate `std::aligned_storage` and `std::aligned_union`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1413r2.pdf) +- [P1413R3 Deprecate `std::aligned_storage` and `std::aligned_union`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1413r3.pdf) - C++23でこの機能が非推奨となった From 8794a91852bd41ca1ca6aec28e304d2279c366cf Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 8 Jun 2023 00:23:54 +0900 Subject: [PATCH 0333/3948] =?UTF-8?q?generator=20:=20=E3=82=AF=E3=83=A9?= =?UTF-8?q?=E3=82=B9=E5=AE=9A=E7=BE=A9=E3=81=AE=E3=82=BB=E3=83=9F=E3=82=B3?= =?UTF-8?q?=E3=83=AD=E3=83=B3=E5=BF=98=E3=82=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/generator/generator.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/generator/generator.md b/reference/generator/generator.md index 8b8ada27bd..47ac8b9c75 100644 --- a/reference/generator/generator.md +++ b/reference/generator/generator.md @@ -9,7 +9,7 @@ namespace std { template class generator : public ranges::view_interface> { ... - } + }; namespace pmr { template From 2e52939f7e606be73a4e5fdb0fb5689eef9f2c68 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Thu, 8 Jun 2023 16:15:18 +0900 Subject: [PATCH 0334/3948] =?UTF-8?q?P23227R0=E3=81=A8CWG2654=E3=81=AB?= =?UTF-8?q?=E3=81=A4=E3=81=84=E3=81=A6=E8=BF=BD=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp20/deprecating_volatile.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lang/cpp20/deprecating_volatile.md b/lang/cpp20/deprecating_volatile.md index 7ed5700a49..f2501ad9ae 100644 --- a/lang/cpp20/deprecating_volatile.md +++ b/lang/cpp20/deprecating_volatile.md @@ -7,7 +7,7 @@ C++20より、`volatile`の本来の役割に照らして不正確、あるい 非推奨となるのは次のもの -1. `volatile`値に対する複合代入演算子(算術型・ポインタ型のみ) +1. ~~`volatile`値に対する複合代入演算子(算術型・ポインタ型のみ)~~ 2. `volatile`値に対するインクリメント/デクリメント演算子(算術型・ポインタ型のみ) 3. 間に`volatile`値がある場合の連鎖した代入演算子(非クラス型のみ) 4. 関数引数のトップレベル`volatile`修飾 @@ -66,6 +66,8 @@ a--; この場合、これらの複合的な演算子を用いず、明示的に「読み出し - 更新 - 書き込み」を分けて書くことで`volatile`変数へのアクセスをコード上でも明確にする事が推奨される。 +ただし、複合代入演算子についてはC++23で非推奨化が解除された。 + ### 連鎖した代入演算子 代入演算子の一部の用法には、複合代入演算子・インクリメント演算子と同様の問題がある。 @@ -377,3 +379,5 @@ volatile device dev; - [P1152R4 Deprecating `volatile`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1152r4.html) - [P1831R0 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1831r0.html) - [P1831R0 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) +- [P2327R0 De-deprecating volatile compound assignment](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2327r1.pdf) +- [CWG Issue 2654. Un-deprecation of compound volatile assignments](https://cplusplus.github.io/CWG/issues/2654.html) \ No newline at end of file From 13db5df18b405032ace43e3738009cda0f18bfe0 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Thu, 8 Jun 2023 16:25:13 +0900 Subject: [PATCH 0335/3948] =?UTF-8?q?=E8=BF=BD=E8=A8=98=E3=81=A8=E6=89=93?= =?UTF-8?q?=E3=81=A1=E6=B6=88=E3=81=97=E7=B7=9A=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp20/deprecating_volatile.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lang/cpp20/deprecating_volatile.md b/lang/cpp20/deprecating_volatile.md index f2501ad9ae..9cded3cda2 100644 --- a/lang/cpp20/deprecating_volatile.md +++ b/lang/cpp20/deprecating_volatile.md @@ -7,7 +7,7 @@ C++20より、`volatile`の本来の役割に照らして不正確、あるい 非推奨となるのは次のもの -1. ~~`volatile`値に対する複合代入演算子(算術型・ポインタ型のみ)~~ +1. ~`volatile`値に対する複合代入演算子(算術型・ポインタ型のみ)~ 2. `volatile`値に対するインクリメント/デクリメント演算子(算術型・ポインタ型のみ) 3. 間に`volatile`値がある場合の連鎖した代入演算子(非クラス型のみ) 4. 関数引数のトップレベル`volatile`修飾 @@ -311,7 +311,7 @@ volatile int i; // iの領域へ何回のアクセスが発生するか不透明 // これはどちらも非推奨化 -i += 42; +i += 42; // C++23で非推奨化解除 ++i; ``` @@ -380,4 +380,4 @@ volatile device dev; - [P1831R0 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1831r0.html) - [P1831R0 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - [P2327R0 De-deprecating volatile compound assignment](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2327r1.pdf) -- [CWG Issue 2654. Un-deprecation of compound volatile assignments](https://cplusplus.github.io/CWG/issues/2654.html) \ No newline at end of file +- [CWG Issue 2654. Un-deprecation of compound volatile assignments](https://cplusplus.github.io/CWG/issues/2654.html) From afc7241e8a6dd56adef175e6b1174aa743c93f87 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Thu, 8 Jun 2023 16:49:37 +0900 Subject: [PATCH 0336/3948] =?UTF-8?q?=E6=89=93=E3=81=A1=E6=B6=88=E3=81=97?= =?UTF-8?q?=E7=B7=9A=E3=81=8B=E3=82=89=E8=BF=BD=E8=A8=98=E3=81=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp20/deprecating_volatile.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lang/cpp20/deprecating_volatile.md b/lang/cpp20/deprecating_volatile.md index 9cded3cda2..8de6ac7238 100644 --- a/lang/cpp20/deprecating_volatile.md +++ b/lang/cpp20/deprecating_volatile.md @@ -7,7 +7,8 @@ C++20より、`volatile`の本来の役割に照らして不正確、あるい 非推奨となるのは次のもの -1. ~`volatile`値に対する複合代入演算子(算術型・ポインタ型のみ)~ +1. `volatile`値に対する複合代入演算子(算術型・ポインタ型のみ) + - C++23で非推奨化解除 2. `volatile`値に対するインクリメント/デクリメント演算子(算術型・ポインタ型のみ) 3. 間に`volatile`値がある場合の連鎖した代入演算子(非クラス型のみ) 4. 関数引数のトップレベル`volatile`修飾 From 1007613676069369e0090ad3305b504e2e83815c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 8 Jun 2023 17:35:11 +0900 Subject: [PATCH 0337/3948] =?UTF-8?q?=E9=96=A2=E6=95=B0=E3=81=AE=E9=9B=9B?= =?UTF-8?q?=E5=BD=A2=E3=83=9A=E3=83=BC=E3=82=B8=20:=20=E9=9D=9E=E6=8E=A8?= =?UTF-8?q?=E5=A5=A8=E3=83=BB=E5=89=8A=E9=99=A4=E3=81=AE=E6=9B=B8=E3=81=8D?= =?UTF-8?q?=E6=96=B9=E3=81=8C=E8=A8=98=E8=BC=89=E3=81=95=E3=82=8C=E3=81=A6?= =?UTF-8?q?=E3=81=84=E3=81=AA=E3=81=8B=E3=81=A3=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start_editing/function_template_page.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/start_editing/function_template_page.md b/start_editing/function_template_page.md index ab695a3b1f..a8d92a04f7 100644 --- a/start_editing/function_template_page.md +++ b/start_editing/function_template_page.md @@ -42,6 +42,10 @@ void definition(); // 関数・変数・定数の宣言を記述します。 ``` +(非推奨・削除となった場合は、その旨を記載し、代わりの機能に誘導します) + +(例:この関数は、C++14から非推奨となり、C++17で削除された。代わりに[`shuffle()`](/reference/algorithm/shuffle.md)関数を使用すること。) + ## 概要 (ここには、関数・変数・定数の概要を記述します。必須事項です。) @@ -103,6 +107,10 @@ void definition(); // 関数・変数・定数の宣言を記述します。 (ここには、関数・変数・定数を説明するにあたっての、補足事項を記述します。とくになければ、項目を削除してください。) +## 非推奨・削除の詳細 +(非推奨・削除となった背景を記載します。) + + ## 例 ```cpp example // (ここには、関数・変数・定数を解説するための、サンプルコードを記述します。) From 6b1443d2ddd576603a80d4c6b321941d86ab42ed Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 8 Jun 2023 17:51:39 +0900 Subject: [PATCH 0338/3948] =?UTF-8?q?has=5Fdenorm(=5Floss)=20:=20=E9=9D=9E?= =?UTF-8?q?=E6=8E=A8=E5=A5=A8=E3=81=AE=E8=A9=B3=E7=B4=B0=E3=82=92=E8=A8=98?= =?UTF-8?q?=E8=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/limits/float_denorm_style.md | 4 +++- reference/limits/numeric_limits/has_denorm.md | 21 ++++++++++++---- .../limits/numeric_limits/has_denorm_loss.md | 24 ++++++++++++++----- 3 files changed, 37 insertions(+), 12 deletions(-) diff --git a/reference/limits/float_denorm_style.md b/reference/limits/float_denorm_style.md index 578258c287..7a0f7289c6 100644 --- a/reference/limits/float_denorm_style.md +++ b/reference/limits/float_denorm_style.md @@ -14,8 +14,10 @@ namespace std { } ``` -この型を返すメンバ変数がC++23にて非推奨化されるため、列挙型も非推奨とされる。 +この型を返すメンバ変数がC++23にて非推奨化されるため、列挙型も非推奨とされる。非推奨の詳細は[`std::numeric_limits::has_denorm`](numeric_limits/has_denorm.md)を参照。 + +## 概要 `std::float_denorm_style`列挙型は、非正規化数(Denormal Number)のサポートに関する情報のための列挙値を提供する。 | 列挙値 | 説明 | diff --git a/reference/limits/numeric_limits/has_denorm.md b/reference/limits/numeric_limits/has_denorm.md index f355ceb1f2..7eafd921ec 100644 --- a/reference/limits/numeric_limits/has_denorm.md +++ b/reference/limits/numeric_limits/has_denorm.md @@ -6,14 +6,14 @@ * cpp23deprecated[meta cpp] ```cpp -// C++03 -static const float_denorm_style has_denorm; - -// C++11 -static constexpr float_denorm_style has_denorm; +static const float_denorm_style has_denorm; // (1) C++03 +static constexpr float_denorm_style has_denorm; // (1) C++11 ``` * float_denorm_style[link /reference/limits/float_denorm_style.md] +この機能は、C++23で非推奨となった。 + + ## 概要 浮動小数点数型において、型`T`の非正規化数(Denormal Number)のサポート状況を判定する。 @@ -32,6 +32,17 @@ static constexpr float_denorm_style has_denorm; | `long double` | [`LDBL_HAS_SUBNORM`](/reference/cfloat/ldbl_has_subnorm.md) | +## 非推奨・削除の詳細 +C言語側で対応するマクロ`*_HAS_SUBNORM`が廃止されたため、C++側でも非推奨とする。 + +この機能はコンパイル時定数として非正規化数のサポート状況を取得するものであった。しかし、これには以下のような問題があった: + +- ハードウェアによっては非正規化数をサポートしていない場合があり、その場合はソフトウェアエミュレーションによってサポートされている場合がある。この場合、同じ系統のハードウェアであっても将来のバージョンでサポートされる可能性があり、このときにABI破壊を回避しようとすると[`std::denorm_indeterminate`](../float_denorm_style.md)を常に使用せざるを得なくなってしまう +- ハードウェアサポートがある場合でも、実行時のフラグ切り替えによって非正規化数をゼロにフラッシュするように設定することが可能であり、非正規化数のサポート状況は必ずしもコンパイル時に確定するプロパティではない場合がある + +これらの理由から、この機能は有用なものではなく、最悪勘違いして使用される危険性があるため、非推奨とする。 + + ## 例 ```cpp example #include diff --git a/reference/limits/numeric_limits/has_denorm_loss.md b/reference/limits/numeric_limits/has_denorm_loss.md index f16a0b5e3f..8726aa17cc 100644 --- a/reference/limits/numeric_limits/has_denorm_loss.md +++ b/reference/limits/numeric_limits/has_denorm_loss.md @@ -6,15 +6,27 @@ * cpp23deprecated[meta cpp] ```cpp -// C++03 -static const bool has_denorm_loss; - -// C++11 -static constexpr bool has_denorm_loss; +static const bool has_denorm_loss; // (1) C++03 +static constexpr bool has_denorm_loss; // (1) C++11 ``` +この機能は、C++23で非推奨となった。 + ## 概要 -浮動小数点数型において、精度の損失が非正規化数によるものかを判定する +浮動小数点数型において、精度の損失が非正規化数によるものかを判定する。 + + +## 非推奨・削除の詳細 +非正規化数が使用されたことによって精度が低下した場合にそれを検出する次の2つの方法がIEEE754標準で指定されていた: + +- 非正規化損失(Denormalization loss) +- 不正確な結果(Inexact result) + +実際には1つ目の実装は存在しなかったため、現在のIEE754からは削除されており、2つ目の実装だけが存在している。この機能はこの2つのどちらがその環境の浮動小数点数型で実装されているかを示すものだったが、このような理由によりもはや意味がない状況となった。 + +また、この値は実装によってなぜか異なっている(MSVCだけが浮動小数点数型に対して`true`を返す)。 + +これらの理由から、この機能は有用なものではなく、最悪勘違いして使用される危険性があるため、非推奨とする。 ## 例 From 066971a8538f6c7d522967cb1c65cad8d1b355e3 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 9 Jun 2023 21:47:42 +0900 Subject: [PATCH 0339/3948] =?UTF-8?q?span/dynamic=5Fextent:=20P2116R0?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove tuple-like protocol support from fixed-extent `span` --- reference/span/dynamic_extent.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/reference/span/dynamic_extent.md b/reference/span/dynamic_extent.md index cdf8db9cb4..ed6a29bb80 100644 --- a/reference/span/dynamic_extent.md +++ b/reference/span/dynamic_extent.md @@ -22,8 +22,6 @@ namespace std { - 動的な長さをもつ範囲を参照する ([`std::vector`](/reference/vector/vector.md)や、ポインタと要素数の組など) - 参照範囲の変更を、動的な値で指定する (`s.`[`first`](span/first.md)`()`は静的な要素数、`s.`[`first`](span/first.md)`(n)`は動的な要素数をもつ`span`オブジェクトを作成する) -動的な要素数をもつ[`std::span`](span.md)クラスには、タプルインタフェースを使用できないという制限がある。 - ## 例 ```cpp example From ff098b7d447c0a2f43b975706bdbdfd457da3c9e Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 12 Jun 2023 14:04:43 +0900 Subject: [PATCH 0340/3948] =?UTF-8?q?flat=5Fmap=20:=20emplace=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20#1078?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map.md | 2 +- reference/flat_map/flat_map/emplace.md | 136 +++++++++++++++++++++++++ 2 files changed, 137 insertions(+), 1 deletion(-) create mode 100644 reference/flat_map/flat_map/emplace.md diff --git a/reference/flat_map/flat_map.md b/reference/flat_map/flat_map.md index 60a86281ad..18628ef35e 100644 --- a/reference/flat_map/flat_map.md +++ b/reference/flat_map/flat_map.md @@ -61,7 +61,7 @@ namespace std { | [`insert`](flat_map/insert.md.nolink) | 要素を挿入する | C++23 | | [`insert_or_assign`](flat_map/insert_or_assign.md.nolink) | 要素を挿入、あるいは代入する | C++23 | | [`insert_range`](flat_map/insert_range.md.nolink) | Rangeを挿入する | C++23 | -| [`emplace`](flat_map/emplace.md.nolink) | 要素を直接構築する | C++23 | +| [`emplace`](flat_map/emplace.md) | 要素を直接構築する | C++23 | | [`emplace_hint`](flat_map/emplace_hint.md.nolink) | ヒントを使って要素を直接構築する | C++23 | | [`try_emplace`](flat_map/try_emplace.md.nolink) | キーが存在しない場合のみ要素を直接構築する | C++23 | | [`erase`](flaflat_maptmap/erase.md.nolink) | 要素を削除する | C++23 | diff --git a/reference/flat_map/flat_map/emplace.md b/reference/flat_map/flat_map/emplace.md new file mode 100644 index 0000000000..68174e75bb --- /dev/null +++ b/reference/flat_map/flat_map/emplace.md @@ -0,0 +1,136 @@ +# emplace +* flat_map[meta header] +* std[meta namespace] +* flat_map[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +template +pair emplace(Args&&... args); +``` +* pair[link /reference/utility/pair.md] + +## 概要 +コンテナに新しい要素を挿入する。要素は直接構築される(コピーもムーブもされない)。要素のコンストラクタはこの関数に渡された引数を与えることによって呼ばれる。 + + +## パラメータ +- `args...` : 要素のコンストラクタへ転送される引数パック。 + + +## テンプレートパラメータ制約 +- [`is_constructible_v`](/reference/type_traits/is_constructible.md)`<`[`pair`](/reference/utility/pair.md)`, Arg...>`が`true`であること + + +## 効果 +[`pair`](/reference/utility/pair.md)``型の変数`t`を[`std::forward`](/reference/utility/forward.md)`(args)...`で初期化する。このコンテナが`t.first`と等価なキーをすでにもっている場合、`*this`を変更しない。そうでない場合、以下と等価: + +```cpp +auto key_it = ranges::upper_bound(c.keys, t.first, compare); +auto value_it = c.values.begin() + distance(c.keys.begin(), key_it); +c.keys.insert(key_it, std::move(t.first)); +c.values.insert(value_it, std::move(t.second)); +``` +* ranges::upper_bound[link /reference/algorithm/ranges_upper_bound.md] +* begin()[link /reference/vector/vector/begin.md] +* insert[link /reference/vector/vector/insert.md] +* std::move[link /reference/utility/move.md] + + +## 戻り値 +挿入されたかどうかを示す `bool` と、挿入された要素へのイテレータからなる [`pair`](/reference/utility/pair.md) を返す。挿入されなかったときは、既存要素へのイテレータを返す。 + + +## 例 +### 単純なキー・値を挿入する例 +```cpp example +#include +#include + +int main() +{ + std::flat_map fm; + + // キーと値のpairを作ることなく挿入できる + fm.emplace(3, 'A'); // キー3と、値'A'を挿入 + fm.emplace(1, 'B'); + fm.emplace(4, 'C'); + + for (const auto& [key, value] : fm) { + std::cout << key << " : " << value << std::endl; + } +} +``` +* emplace[color ff0000] + +#### 出力 +``` +1 : B +3 : A +4 : C +``` + +### キーと値もそれぞれコンストラクタ引数を渡す例 +```cpp example +#include +#include +#include +#include + +struct Point { + int x, y; + Point(int x, int y) : x(x), y(y) {} +}; + +int main() +{ + stdx::flat_map fm; + + fm.emplace(std::piecewise_construct, + std::forward_as_tuple(3, 'C'), // キーの型std::stringのコンストラクタ引数を渡す + std::forward_as_tuple(1, 2)); // 値の型Pointのコンストラクタ引数を渡す + + fm.emplace(std::piecewise_construct, + std::forward_as_tuple(3, 'A'), + std::forward_as_tuple(3, 4)); + + fm.emplace(std::piecewise_construct, + std::forward_as_tuple(3, 'B'), + std::forward_as_tuple(5, 6)); + + for (const auto& [key, value] : fm) { + std::cout << key << " : (" << value.x << ", " << value.y << ')' << std::endl; + } +} +``` +* emplace[color ff0000] +* std::piecewise_construct[link /reference/utility/piecewise_construct_t.md] +* std::forward_as_tuple[link /reference/tuple/forward_as_tuple.md] + +#### 出力 +``` +AAA : (3, 4) +BBB : (5, 6) +CCC : (1, 2) +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|------------------------------------------------|--------------------------------------------| +| [`flat_map::insert`](insert.md.nolink) | 要素を挿入する | +| [`flat_map::insert_or_assign`](insert_or_assign.md.nolink) | 要素を挿入、あるいは代入する | +| [`flat_map::emplace_hint`](emplace_hint.md.nolink) | ヒントを使って要素を直接構築する | +| [`flat_map::try_emplace`](try_emplace.md.nolink) | キーが存在しない場合のみ要素を直接構築する | + From 31bf54bd4fb47c87772bc62b636047089f5176d9 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 12 Jun 2023 14:28:44 +0900 Subject: [PATCH 0341/3948] =?UTF-8?q?flat=5Fmap::emplace=20:=20=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E4=BF=AE=E9=A3=BE=E3=81=AE=E3=83=AA=E3=83=B3?= =?UTF-8?q?=E3=82=AF=E8=BF=BD=E5=8A=A0=20#1078?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map/emplace.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reference/flat_map/flat_map/emplace.md b/reference/flat_map/flat_map/emplace.md index 68174e75bb..e69100dbb4 100644 --- a/reference/flat_map/flat_map/emplace.md +++ b/reference/flat_map/flat_map/emplace.md @@ -32,8 +32,11 @@ auto value_it = c.values.begin() + distance(c.keys.begin(), key_it); c.keys.insert(key_it, std::move(t.first)); c.values.insert(value_it, std::move(t.second)); ``` +* c.keys[link containers.md] +* c.values[link containers.md] * ranges::upper_bound[link /reference/algorithm/ranges_upper_bound.md] * begin()[link /reference/vector/vector/begin.md] +* distance[link /reference/iterator/distance.md] * insert[link /reference/vector/vector/insert.md] * std::move[link /reference/utility/move.md] From 83dd89cb38bbc23df68cf8b6372ea0a7010a2385 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 12 Jun 2023 14:29:26 +0900 Subject: [PATCH 0342/3948] =?UTF-8?q?flat=5Fmap::emplace=20:=20=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=82=AF=E3=83=AB=E3=83=BC=E3=83=89=E3=83=9F=E3=82=B9?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3=20#1078?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map/emplace.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/flat_map/flat_map/emplace.md b/reference/flat_map/flat_map/emplace.md index e69100dbb4..f822e8ec79 100644 --- a/reference/flat_map/flat_map/emplace.md +++ b/reference/flat_map/flat_map/emplace.md @@ -49,7 +49,7 @@ c.values.insert(value_it, std::move(t.second)); ### 単純なキー・値を挿入する例 ```cpp example #include -#include +#include int main() { From 5e2017d1eb229b78d1ae16d99c4afef381682a58 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Mon, 12 Jun 2023 17:53:48 +0900 Subject: [PATCH 0343/3948] =?UTF-8?q?=E3=82=B3=E3=83=AB=E3=83=BC=E3=83=81?= =?UTF-8?q?=E3=83=B3=20:=20pvalue=20->=20prvalue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp20/coroutines.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/cpp20/coroutines.md b/lang/cpp20/coroutines.md index 89de2759fc..4796f99c3a 100644 --- a/lang/cpp20/coroutines.md +++ b/lang/cpp20/coroutines.md @@ -434,8 +434,8 @@ _p_ をコルーチンPromiseオブジェクトのlvalue名とすると、`co_re ここで _final-suspend_ はコルーチン動作説明用の最終サスペンドポイントラベル名であり、_S_ は次の通り定義される: -- オペランドが _braced-init-list_ または非`void`型の式の場合、_S_ を _p_`.return_value(` _expr-or-braced-init-list_ `)`とする。式 _S_ は `void`型のpvalueであるべき。 -- そうでなければ、_S_ を複合文 `{` _expression_ _opt_ `;` _p_`.return_void(); }`とする。式 _p_`.return_void()`は`void`型のpvalueであるべき。 +- オペランドが _braced-init-list_ または非`void`型の式の場合、_S_ を _p_`.return_value(` _expr-or-braced-init-list_ `)`とする。式 _S_ は `void`型のprvalueであるべき。 +- そうでなければ、_S_ を複合文 `{` _expression_ _opt_ `;` _p_`.return_void(); }`とする。式 _p_`.return_void()`は`void`型のprvalueであるべき。 _p_`.return_void()`が有効な式のとき、コルーチン本体の終端到達はオペランド無し`co_return`と等価である。 そうでなければ、コルーチン本体の終端到達は未定義の動作を引き起こす。 From 5ae2c39abd2fa04018b5ee8add2a054c25079f4c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 12 Jun 2023 19:14:26 +0900 Subject: [PATCH 0344/3948] =?UTF-8?q?NG=E3=83=AF=E3=83=BC=E3=83=89?= =?UTF-8?q?=E3=81=A8=E3=81=97=E3=81=A6pvalue=20(prvalue=E3=81=AEtypo)=20?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/script/ngword_check.py | 1 + reference/iterator/indirectly_writable.md | 10 +++++----- .../type_traits/reference_constructs_from_temporary.md | 8 ++++---- .../type_traits/reference_converts_from_temporary.md | 8 ++++---- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/workflows/script/ngword_check.py b/.github/workflows/script/ngword_check.py index 0b709286aa..2403d87f38 100644 --- a/.github/workflows/script/ngword_check.py +++ b/.github/workflows/script/ngword_check.py @@ -11,6 +11,7 @@ ("", "exposion", "exposition"), ("", "noexpcet", "noexcept"), ("", "protmise_type", "promise_type"), + ("", "pvalue", "prvalue"), ("", "repear", "repeat"), ("", "子ルーチン", "コルーチン"), ("", "移譲", "委譲"), diff --git a/reference/iterator/indirectly_writable.md b/reference/iterator/indirectly_writable.md index c8e64a86c5..f0974db85e 100644 --- a/reference/iterator/indirectly_writable.md +++ b/reference/iterator/indirectly_writable.md @@ -33,26 +33,26 @@ namespace std { `const_cast`を用いる制約式は、非プロキシオブジェクト(値を所有するオブジェクトのことである。[`std::string`](/reference/string/basic_string.md)などが該当)を弾くために存在する。 -まず前提として、非プロキシオブジェクトは[メンバ関数の左辺値/右辺値修飾](https://cpprefjp.github.io/lang/cpp11/ref_qualifier_for_this.html)が追加される以前からの慣習により、*pvalue*であっても代入が可能である。また、値を所有するために`const`が付与されれば代入は不可能となる。 +まず前提として、非プロキシオブジェクトは[メンバ関数の左辺値/右辺値修飾](https://cpprefjp.github.io/lang/cpp11/ref_qualifier_for_this.html)が追加される以前からの慣習により、*prvalue*であっても代入が可能である。また、値を所有するために`const`が付与されれば代入は不可能となる。 ```cpp example #include int main() { - std::string() = "string"; // pvalueに代入 + std::string() = "string"; // prvalueに代入 } ``` -このような非プロキシオブジェクトの*pvalue*がイテレータの間接参照結果として返された場合、それに書き込んだとしても、その*pvalue*のオブジェクトが所有する値を書き換えるのみであり、正しく出力されるとは言えない。 +このような非プロキシオブジェクトの*prvalue*がイテレータの間接参照結果として返された場合、それに書き込んだとしても、その*prvalue*のオブジェクトが所有する値を書き換えるのみであり、正しく出力されるとは言えない。 -一方で、プロキシオブジェクト(所有権を持たず、他のオブジェクトを参照するオブジェクト)がイテレータの間接参照結果として返された場合は、*pvalue*の場合も代入された値を「参照する先のオブジェクトが所有する値」へ書き込むことによって、正しく出力を完了することが出来る。 +一方で、プロキシオブジェクト(所有権を持たず、他のオブジェクトを参照するオブジェクト)がイテレータの間接参照結果として返された場合は、*prvalue*の場合も代入された値を「参照する先のオブジェクトが所有する値」へ書き込むことによって、正しく出力を完了することが出来る。 更に、プロキシオブジェクトは値を所有しないため「`const`な参照先」でなければ、プロキシオブジェクトそれ自体が`const`であっても代入は可能であるべきである。しかしながら、従来のプロキシオブジェクトは`const`を付与された場合代入が不可能になる実装が殆どであり、変更が必要である。例としては[`std::vector::reference`](/reference/vector/vector.md)がある。 プロキシオブジェクトの他にも、参照(右辺値参照/左辺値参照問わず)も正しく出力が可能である。このことから、「`const`を付与した上でも代入が可能であるようなプロキシオブジェクト」と「参照」を合わせて「プロキシ参照(proxy reference)」と呼称することがある。 -以上のことから、`const`を付与した際にも代入が可能であればプロキシ参照、不可能であれば非プロキシ参照と区別することが可能となる。したがって、間接参照が非プロキシ参照(プロキシオブジェクトでない*pvalue*など)を返すイテレータ型は本コンセプトのモデルとならず、プロキシ参照を返すイテレータは本コンセプトのモデルとなる事ができる。 +以上のことから、`const`を付与した際にも代入が可能であればプロキシ参照、不可能であれば非プロキシ参照と区別することが可能となる。したがって、間接参照が非プロキシ参照(プロキシオブジェクトでない*prvalue*など)を返すイテレータ型は本コンセプトのモデルとならず、プロキシ参照を返すイテレータは本コンセプトのモデルとなる事ができる。 ## モデル diff --git a/reference/type_traits/reference_constructs_from_temporary.md b/reference/type_traits/reference_constructs_from_temporary.md index 05d91676b7..1e50abada8 100644 --- a/reference/type_traits/reference_constructs_from_temporary.md +++ b/reference/type_traits/reference_constructs_from_temporary.md @@ -31,17 +31,17 @@ namespace std { `VAL`を次のように定義する。 - `U`が参照型や関数型の場合、[`declval`](/reference/utility/declval.md)`()`と同じ型と値カテゴリを持つ式 -- `U`が参照型や関数型でない場合、型`U`である`pvalue`(ただし、`U`に`const`/`volatile`修飾があれば調整される) +- `U`が参照型や関数型でない場合、型`U`である`prvalue`(ただし、`U`に`const`/`volatile`修飾があれば調整される) [`conjunction_v`](conjunction.md)`<`[`is_reference`](is_reference.md)`,` [`is_constructible`](is_constructible.md)`>`が`true`かつ、`T t(VAL)`において`t`が一時オブジェクトの寿命を延長する場合に[`true_type`](true_type.md)から派生し、そうでなければ[`false_type`](false_type.md)から派生する。 ## 備考 -多くのメタ関数は`pvalue`と`xvalue`を区別しないが、このメタ関数は区別する。例えば、右辺値参照に「戻り値の型が右辺値参照である関数」の戻り値を束縛することを考える。(再現コードは、説明の最後に付す) +多くのメタ関数は`prvalue`と`xvalue`を区別しないが、このメタ関数は区別する。例えば、右辺値参照に「戻り値の型が右辺値参照である関数」の戻り値を束縛することを考える。(再現コードは、説明の最後に付す) -この事自体は即座に不適格とはならない。しかし、その関数が実際には`pvalue`を返しているとすれば、その`pvalue`は戻り値の時点で右辺値参照に束縛されるため、それを右辺値参照に束縛したとしても寿命は延長されることはない。そのため、最終的にダングリング参照を生じることとなる。 +この事自体は即座に不適格とはならない。しかし、その関数が実際には`prvalue`を返しているとすれば、その`prvalue`は戻り値の時点で右辺値参照に束縛されるため、それを右辺値参照に束縛したとしても寿命は延長されることはない。そのため、最終的にダングリング参照を生じることとなる。 -このような場面においては、本メタ関数が`pvalue`と`xvalue`を、`pvalue`を`T`(参照なしの型)として、`xvalue`を`T&&`(右辺値参照である型、転送参照(Forwarding Reference) を意味しているわけではない)として区別すれば検出が可能となる。 +このような場面においては、本メタ関数が`prvalue`と`xvalue`を、`prvalue`を`T`(参照なしの型)として、`xvalue`を`T&&`(右辺値参照である型、転送参照(Forwarding Reference) を意味しているわけではない)として区別すれば検出が可能となる。 ```cpp example #include diff --git a/reference/type_traits/reference_converts_from_temporary.md b/reference/type_traits/reference_converts_from_temporary.md index 63ea01deac..35cde01c5c 100644 --- a/reference/type_traits/reference_converts_from_temporary.md +++ b/reference/type_traits/reference_converts_from_temporary.md @@ -27,17 +27,17 @@ namespace std { `VAL`を次のように定義する。 - `U`が参照型や関数型の場合、[`declval`](/reference/utility/declval.md)`()`と同じ型と値カテゴリを持つ式 -- `U`が参照型や関数型でない場合、型`U`である`pvalue`(ただし、`U`に`const`/`volatile`修飾があれば調整される) +- `U`が参照型や関数型でない場合、型`U`である`prvalue`(ただし、`U`に`const`/`volatile`修飾があれば調整される) [`conjunction_v`](conjunction.md)`<`[`is_reference`](is_reference.md)`,` [`is_convertible`](is_convertible.md)`>`が`true`かつ、`T t(VAL)`において`t`が一時オブジェクトの寿命を延長する場合に[`true_type`](true_type.md)から派生し、そうでなければ[`false_type`](false_type.md)から派生する。 ## 備考 -多くのメタ関数は`pvalue`と`xvalue`を区別しないが、このメタ関数は区別する。例えば、右辺値参照に「戻り値の型が右辺値参照である関数」の戻り値を束縛することを考える。(再現コードは、説明の最後に付す) +多くのメタ関数は`prvalue`と`xvalue`を区別しないが、このメタ関数は区別する。例えば、右辺値参照に「戻り値の型が右辺値参照である関数」の戻り値を束縛することを考える。(再現コードは、説明の最後に付す) -この事自体は即座に不適格とはならない。しかし、その関数が実際には`pvalue`を返しているとすれば、その`pvalue`は戻り値の時点で右辺値参照に束縛されるため、それを右辺値参照に束縛したとしても寿命は延長されることはない。そのため、最終的にダングリング参照を生じることとなる。 +この事自体は即座に不適格とはならない。しかし、その関数が実際には`prvalue`を返しているとすれば、その`prvalue`は戻り値の時点で右辺値参照に束縛されるため、それを右辺値参照に束縛したとしても寿命は延長されることはない。そのため、最終的にダングリング参照を生じることとなる。 -このような場面においては、本メタ関数が`pvalue`と`xvalue`を、`pvalue`を`T`(参照なしの型)として、`xvalue`を`T&&`(右辺値参照である型、転送参照(Forwarding Reference) を意味しているわけではない)として区別すれば検出が可能となる。 +このような場面においては、本メタ関数が`prvalue`と`xvalue`を、`prvalue`を`T`(参照なしの型)として、`xvalue`を`T&&`(右辺値参照である型、転送参照(Forwarding Reference) を意味しているわけではない)として区別すれば検出が可能となる。 ```cpp example #include From 90927bc3454740d33a8e2933e23ebbc8f3d96ea5 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 13 Jun 2023 14:47:48 +0900 Subject: [PATCH 0345/3948] =?UTF-8?q?P0718R2=E3=81=AEshared=5Fptr=E3=81=AE?= =?UTF-8?q?=E3=82=A2=E3=83=88=E3=83=9F=E3=83=83=E3=82=AF=E3=83=95=E3=83=AA?= =?UTF-8?q?=E3=83=BC=E9=96=A2=E6=95=B0=E9=9D=9E=E6=8E=A8=E5=A5=A8=E3=82=92?= =?UTF-8?q?=E9=81=A9=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/memory/shared_ptr.md | 22 +++++++++---------- .../atomic_compare_exchange_strong.md | 15 +++++++++++-- ...atomic_compare_exchange_strong_explicit.md | 15 +++++++++++-- .../atomic_compare_exchange_weak.md | 14 +++++++++++- .../atomic_compare_exchange_weak_explicit.md | 15 +++++++++++-- .../memory/shared_ptr/atomic_exchange.md | 15 +++++++++++-- .../shared_ptr/atomic_exchange_explicit.md | 15 +++++++++++-- .../memory/shared_ptr/atomic_is_lock_free.md | 13 ++++++++++- reference/memory/shared_ptr/atomic_load.md | 15 +++++++++++-- .../memory/shared_ptr/atomic_load_explicit.md | 15 +++++++++++-- reference/memory/shared_ptr/atomic_store.md | 15 +++++++++++-- .../shared_ptr/atomic_store_explicit.md | 15 +++++++++++-- 12 files changed, 153 insertions(+), 31 deletions(-) diff --git a/reference/memory/shared_ptr.md b/reference/memory/shared_ptr.md index e997226fcf..796eb02a74 100644 --- a/reference/memory/shared_ptr.md +++ b/reference/memory/shared_ptr.md @@ -81,17 +81,17 @@ namespace std { | 名前 | 説明 | 対応バージョン | |-------------------------------------------|--------------------------------------------------|-------| -| [`atomic_is_lock_free`][is_lock_free] | 指定されたオブジェクトがロックフリーに振る舞えるかを調べる | C++11 | -| [`atomic_store`][store] | 値を書き込む | C++11 | -| [`atomic_store_explicit`][store_ex] | メモリオーダーを指定して値を書き込む | C++11 | -| [`atomic_load`][load] | 値を読み込む | C++11 | -| [`atomic_load_explicit`][load_ex] | メモリオーダーを指定して値を読み込む | C++11 | -| [`atomic_exchange`][exchange] | 値を入れ替える | C++11 | -| [`atomic_exchange_explicit`][exchange_ex] | メモリオーダーを指定して値を入れ替える | C++11 | -| [`atomic_compare_exchange_weak`][exchange_weak] | 弱い比較で値の入れ替えを行う | C++11 | -| [`atomic_compare_exchange_strong`][exchange_strong] | 強い比較で値の入れ替えを行う | C++11 | -| [`atomic_compare_exchange_weak_explicit`][exchange_weak_ex] | 弱い比較でメモリオーダーを指定して値の入れ替えを行う | C++11 | -| [`atomic_compare_exchange_strong_explicit`][exchange_strong_ex] | 強い比較でメモリオーダーを指定して値の入れ替えを行う | C++11 | +| [`atomic_is_lock_free`][is_lock_free] | 指定されたオブジェクトがロックフリーに振る舞えるかを調べる | C++11
C++20から非推奨 | +| [`atomic_store`][store] | 値を書き込む | C++11
C++20から非推奨 | +| [`atomic_store_explicit`][store_ex] | メモリオーダーを指定して値を書き込む | C++11
C++20から非推奨 | +| [`atomic_load`][load] | 値を読み込む | C++11
C++20から非推奨 | +| [`atomic_load_explicit`][load_ex] | メモリオーダーを指定して値を読み込む | C++11
C++20から非推奨 | +| [`atomic_exchange`][exchange] | 値を入れ替える | C++11
C++20から非推奨 | +| [`atomic_exchange_explicit`][exchange_ex] | メモリオーダーを指定して値を入れ替える | C++11
C++20から非推奨 | +| [`atomic_compare_exchange_weak`][exchange_weak] | 弱い比較で値の入れ替えを行う | C++11
C++20から非推奨 | +| [`atomic_compare_exchange_strong`][exchange_strong] | 強い比較で値の入れ替えを行う | C++11
C++20から非推奨 | +| [`atomic_compare_exchange_weak_explicit`][exchange_weak_ex] | 弱い比較でメモリオーダーを指定して値の入れ替えを行う | C++11
C++20から非推奨 | +| [`atomic_compare_exchange_strong_explicit`][exchange_strong_ex] | 強い比較でメモリオーダーを指定して値の入れ替えを行う | C++11
C++20から非推奨 | [is_lock_free]: shared_ptr/atomic_is_lock_free.md [store]: shared_ptr/atomic_store.md diff --git a/reference/memory/shared_ptr/atomic_compare_exchange_strong.md b/reference/memory/shared_ptr/atomic_compare_exchange_strong.md index 8a5f0cd78f..34571b12ca 100644 --- a/reference/memory/shared_ptr/atomic_compare_exchange_strong.md +++ b/reference/memory/shared_ptr/atomic_compare_exchange_strong.md @@ -3,6 +3,7 @@ * std[meta namespace] * function template[meta id-type] * cpp11[meta cpp] +* cpp20deprecated[meta cpp] ```cpp namespace std { @@ -12,6 +13,8 @@ namespace std { } ``` +この関数は、C++20から非推奨となった。アトミックアクセスの対象としている`shared_ptr`を[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)で置き換えることで同等の機能を使用できる。 + ## 概要 強い比較で、アトミックに`shared_ptr`オブジェクトを入れ替える。 @@ -37,6 +40,15 @@ atomic_compare_exchange_strong_explicit( ## 例外 投げない +## 非推奨・削除の詳細 + +この関数はフリー関数であるため、この関数によってアトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものはどこかに配置されている非アトミックオブジェクトである。そのため、アトミックアクセスしたい文脈の外側から通常のアクセスが可能であり、もし別のスレッドからそのようなアクセスが行われているとこの関数を用いていてもデータ競合を引き起こし未定義動作となる。 + +すなわち、アトミックにアクセスしたい`shared_ptr`オブジェクトに対する全てのアクセスをプログラマがきちんと管理しなければこの関数の使用は安全ではなく、それはかなり困難であったためこの関数は危険な利用がデフォルトとなっていた。 + +そのため、この関数(とそのファミリ)は非推奨とされ、代わりに[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)が追加された。`shared_ptr`に対する`atomic`特殊化を利用すれば、アトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものをアトミックオブジェクトとすることができるため、どこからアクセスしたとしても全てのアクセスは自動的にアトミックアクセスとなり、前述の問題は回避できる。 + +この関数から`shared_ptr`に対する`atomic`特殊化に移行する場合は、元のコードでアトミックアクセス対象となっていた`shared_ptr`オブジェクトの型を`std::atomic`に変更することで移行でき、その場合は`atomic`のために用意されているフリー関数が代わりに使用される(宣言されているヘッダが異なるため、``ヘッダのインクルードが必要となるかもしれない)。 ## 例 ```cpp example @@ -81,5 +93,4 @@ int main() - [N2674 Shared_ptr atomic access, revision 1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2674.htm) - [C++0x Shared_ptr atomic access - Faith and Brave - C++で遊ぼう](http://faithandbrave.hateblo.jp/entry/20081015/1224066366) - [LWG Issue 2172. Does `atomic_compare_exchange_*` accept `v == nullptr` arguments?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2172) - - +- [P0718R2 Revising `atomic_shared_ptr` for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0718r2.html) diff --git a/reference/memory/shared_ptr/atomic_compare_exchange_strong_explicit.md b/reference/memory/shared_ptr/atomic_compare_exchange_strong_explicit.md index 83a83f9afe..d87cd9c12a 100644 --- a/reference/memory/shared_ptr/atomic_compare_exchange_strong_explicit.md +++ b/reference/memory/shared_ptr/atomic_compare_exchange_strong_explicit.md @@ -3,6 +3,7 @@ * std[meta namespace] * function template[meta id-type] * cpp11[meta cpp] +* cpp20deprecated[meta cpp] ```cpp namespace std { @@ -14,6 +15,8 @@ namespace std { ``` * memory_order[link /reference/atomic/memory_order.md] +この関数は、C++20から非推奨となった。アトミックアクセスの対象としている`shared_ptr`を[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)で置き換えることで同等の機能を使用できる。 + ## 概要 メモリオーダーを指定して、強い比較で、アトミックに`shared_ptr`オブジェクトを入れ替える。 @@ -43,6 +46,15 @@ namespace std { ## 備考 等値比較は、2つの`shared_ptr`オブジェクトが同じポインタを保持し、リソースを共有していれば`true`となる。 +## 非推奨・削除の詳細 + +この関数はフリー関数であるため、この関数によってアトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものはどこかに配置されている非アトミックオブジェクトである。そのため、アトミックアクセスしたい文脈の外側から通常のアクセスが可能であり、もし別のスレッドからそのようなアクセスが行われているとこの関数を用いていてもデータ競合を引き起こし未定義動作となる。 + +すなわち、アトミックにアクセスしたい`shared_ptr`オブジェクトに対する全てのアクセスをプログラマがきちんと管理しなければこの関数の使用は安全ではなく、それはかなり困難であったためこの関数は危険な利用がデフォルトとなっていた。 + +そのため、この関数(とそのファミリ)は非推奨とされ、代わりに[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)が追加された。`shared_ptr`に対する`atomic`特殊化を利用すれば、アトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものをアトミックオブジェクトとすることができるため、どこからアクセスしたとしても全てのアクセスは自動的にアトミックアクセスとなり、前述の問題は回避できる。 + +この関数から`shared_ptr`に対する`atomic`特殊化に移行する場合は、元のコードでアトミックアクセス対象となっていた`shared_ptr`オブジェクトの型を`std::atomic`に変更することで移行でき、その場合は`atomic`のために用意されているフリー関数が代わりに使用される(宣言されているヘッダが異なるため、``ヘッダのインクルードが必要となるかもしれない)。 ## 例 ```cpp example @@ -93,5 +105,4 @@ int main() - [N2674 Shared_ptr atomic access, revision 1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2674.htm) - [C++0x Shared_ptr atomic access - Faith and Brave - C++で遊ぼう](http://faithandbrave.hateblo.jp/entry/20081015/1224066366) - [LWG Issue 2172. Does `atomic_compare_exchange_*` accept `v == nullptr` arguments?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2172) - - +- [P0718R2 Revising `atomic_shared_ptr` for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0718r2.html) diff --git a/reference/memory/shared_ptr/atomic_compare_exchange_weak.md b/reference/memory/shared_ptr/atomic_compare_exchange_weak.md index fafe20cb2c..8a8d5d53c2 100644 --- a/reference/memory/shared_ptr/atomic_compare_exchange_weak.md +++ b/reference/memory/shared_ptr/atomic_compare_exchange_weak.md @@ -3,6 +3,7 @@ * std[meta namespace] * function template[meta id-type] * cpp11[meta cpp] +* cpp20deprecated[meta cpp] ```cpp namespace std { @@ -12,6 +13,8 @@ namespace std { } ``` +この関数は、C++20から非推奨となった。アトミックアクセスの対象としている`shared_ptr`を[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)で置き換えることで同等の機能を使用できる。 + ## 概要 弱い比較で、アトミックに`shared_ptr`オブジェクトを入れ替える。 @@ -37,6 +40,15 @@ atomic_compare_exchange_weak_explicit( ## 例外 投げない +## 非推奨・削除の詳細 + +この関数はフリー関数であるため、この関数によってアトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものはどこかに配置されている非アトミックオブジェクトである。そのため、アトミックアクセスしたい文脈の外側から通常のアクセスが可能であり、もし別のスレッドからそのようなアクセスが行われているとこの関数を用いていてもデータ競合を引き起こし未定義動作となる。 + +すなわち、アトミックにアクセスしたい`shared_ptr`オブジェクトに対する全てのアクセスをプログラマがきちんと管理しなければこの関数の使用は安全ではなく、それはかなり困難であったためこの関数は危険な利用がデフォルトとなっていた。 + +そのため、この関数(とそのファミリ)は非推奨とされ、代わりに[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)が追加された。`shared_ptr`に対する`atomic`特殊化を利用すれば、アトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものをアトミックオブジェクトとすることができるため、どこからアクセスしたとしても全てのアクセスは自動的にアトミックアクセスとなり、前述の問題は回避できる。 + +この関数から`shared_ptr`に対する`atomic`特殊化に移行する場合は、元のコードでアトミックアクセス対象となっていた`shared_ptr`オブジェクトの型を`std::atomic`に変更することで移行でき、その場合は`atomic`のために用意されているフリー関数が代わりに使用される(宣言されているヘッダが異なるため、``ヘッダのインクルードが必要となるかもしれない)。 ## 例 ```cpp example @@ -80,4 +92,4 @@ int main() - [N2674 Shared_ptr atomic access, revision 1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2674.htm) - [C++0x Shared_ptr atomic access - Faith and Brave - C++で遊ぼう](http://faithandbrave.hateblo.jp/entry/20081015/1224066366) - [LWG Issue 2172. Does `atomic_compare_exchange_*` accept `v == nullptr` arguments?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2172) - +- [P0718R2 Revising `atomic_shared_ptr` for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0718r2.html) diff --git a/reference/memory/shared_ptr/atomic_compare_exchange_weak_explicit.md b/reference/memory/shared_ptr/atomic_compare_exchange_weak_explicit.md index 910f866cbe..665cd61862 100644 --- a/reference/memory/shared_ptr/atomic_compare_exchange_weak_explicit.md +++ b/reference/memory/shared_ptr/atomic_compare_exchange_weak_explicit.md @@ -3,6 +3,7 @@ * std[meta namespace] * function template[meta id-type] * cpp11[meta cpp] +* cpp20deprecated[meta cpp] ```cpp namespace std { @@ -14,6 +15,8 @@ namespace std { ``` * memory_order[link /reference/atomic/memory_order.md] +この関数は、C++20から非推奨となった。アトミックアクセスの対象としている`shared_ptr`を[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)で置き換えることで同等の機能を使用できる。 + ## 概要 メモリオーダーを指定して、弱い比較で、アトミックに`shared_ptr`オブジェクトを入れ替える。 @@ -43,6 +46,15 @@ namespace std { ## 備考 等値比較は、2つの`shared_ptr`オブジェクトが同じポインタを保持し、リソースを共有していれば`true`となる。 +## 非推奨・削除の詳細 + +この関数はフリー関数であるため、この関数によってアトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものはどこかに配置されている非アトミックオブジェクトである。そのため、アトミックアクセスしたい文脈の外側から通常のアクセスが可能であり、もし別のスレッドからそのようなアクセスが行われているとこの関数を用いていてもデータ競合を引き起こし未定義動作となる。 + +すなわち、アトミックにアクセスしたい`shared_ptr`オブジェクトに対する全てのアクセスをプログラマがきちんと管理しなければこの関数の使用は安全ではなく、それはかなり困難であったためこの関数は危険な利用がデフォルトとなっていた。 + +そのため、この関数(とそのファミリ)は非推奨とされ、代わりに[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)が追加された。`shared_ptr`に対する`atomic`特殊化を利用すれば、アトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものをアトミックオブジェクトとすることができるため、どこからアクセスしたとしても全てのアクセスは自動的にアトミックアクセスとなり、前述の問題は回避できる。 + +この関数から`shared_ptr`に対する`atomic`特殊化に移行する場合は、元のコードでアトミックアクセス対象となっていた`shared_ptr`オブジェクトの型を`std::atomic`に変更することで移行でき、その場合は`atomic`のために用意されているフリー関数が代わりに使用される(宣言されているヘッダが異なるため、``ヘッダのインクルードが必要となるかもしれない)。 ## 例 ```cpp example @@ -91,5 +103,4 @@ int main() - [N2674 Shared_ptr atomic access, revision 1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2674.htm) - [C++0x Shared_ptr atomic access - Faith and Brave - C++で遊ぼう](http://faithandbrave.hateblo.jp/entry/20081015/1224066366) - [LWG Issue 2172. Does `atomic_compare_exchange_*` accept `v == nullptr` arguments?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2172) - - +- [P0718R2 Revising `atomic_shared_ptr` for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0718r2.html) diff --git a/reference/memory/shared_ptr/atomic_exchange.md b/reference/memory/shared_ptr/atomic_exchange.md index 3a1591c7b6..0397fea06d 100644 --- a/reference/memory/shared_ptr/atomic_exchange.md +++ b/reference/memory/shared_ptr/atomic_exchange.md @@ -3,6 +3,7 @@ * std[meta namespace] * function template[meta id-type] * cpp11[meta cpp] +* cpp20deprecated[meta cpp] ```cpp namespace std { @@ -11,6 +12,8 @@ namespace std { } ``` +この関数は、C++20から非推奨となった。アトミックアクセスの対象としている`shared_ptr`を[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)で置き換えることで同等の機能を使用できる。 + ## 概要 `shared_ptr`オブジェクトを、アトミックに入れ替える。 @@ -30,6 +33,15 @@ atomic_exchange_explicit(p, r, memory_order_seq_cst) ## 例外 投げない +## 非推奨・削除の詳細 + +この関数はフリー関数であるため、この関数によってアトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものはどこかに配置されている非アトミックオブジェクトである。そのため、アトミックアクセスしたい文脈の外側から通常のアクセスが可能であり、もし別のスレッドからそのようなアクセスが行われているとこの関数を用いていてもデータ競合を引き起こし未定義動作となる。 + +すなわち、アトミックにアクセスしたい`shared_ptr`オブジェクトに対する全てのアクセスをプログラマがきちんと管理しなければこの関数の使用は安全ではなく、それはかなり困難であったためこの関数は危険な利用がデフォルトとなっていた。 + +そのため、この関数(とそのファミリ)は非推奨とされ、代わりに[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)が追加された。`shared_ptr`に対する`atomic`特殊化を利用すれば、アトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものをアトミックオブジェクトとすることができるため、どこからアクセスしたとしても全てのアクセスは自動的にアトミックアクセスとなり、前述の問題は回避できる。 + +この関数から`shared_ptr`に対する`atomic`特殊化に移行する場合は、元のコードでアトミックアクセス対象となっていた`shared_ptr`オブジェクトの型を`std::atomic`に変更することで移行でき、その場合は`atomic`のために用意されているフリー関数が代わりに使用される(宣言されているヘッダが異なるため、``ヘッダのインクルードが必要となるかもしれない)。 ## 例 ```cpp example @@ -71,5 +83,4 @@ int main() - [`atomic_exchange() - `](/reference/atomic/atomic_exchange.md) - [N2674 Shared_ptr atomic access, revision 1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2674.htm) - [C++0x Shared_ptr atomic access - Faith and Brave - C++で遊ぼう](http://faithandbrave.hateblo.jp/entry/20081015/1224066366) - - +- [P0718R2 Revising `atomic_shared_ptr` for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0718r2.html) diff --git a/reference/memory/shared_ptr/atomic_exchange_explicit.md b/reference/memory/shared_ptr/atomic_exchange_explicit.md index 5a85339317..574fc88566 100644 --- a/reference/memory/shared_ptr/atomic_exchange_explicit.md +++ b/reference/memory/shared_ptr/atomic_exchange_explicit.md @@ -3,6 +3,7 @@ * std[meta namespace] * function template[meta id-type] * cpp11[meta cpp] +* cpp20deprecated[meta cpp] ```cpp namespace std { @@ -13,6 +14,8 @@ namespace std { ``` * memory_order[link /reference/atomic/memory_order.md] +この関数は、C++20から非推奨となった。アトミックアクセスの対象としている`shared_ptr`を[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)で置き換えることで同等の機能を使用できる。 + ## 概要 メモリオーダーを指定して、`shared_ptr`オブジェクトを、アトミックに入れ替える。 @@ -32,6 +35,15 @@ namespace std { ## 例外 投げない +## 非推奨・削除の詳細 + +この関数はフリー関数であるため、この関数によってアトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものはどこかに配置されている非アトミックオブジェクトである。そのため、アトミックアクセスしたい文脈の外側から通常のアクセスが可能であり、もし別のスレッドからそのようなアクセスが行われているとこの関数を用いていてもデータ競合を引き起こし未定義動作となる。 + +すなわち、アトミックにアクセスしたい`shared_ptr`オブジェクトに対する全てのアクセスをプログラマがきちんと管理しなければこの関数の使用は安全ではなく、それはかなり困難であったためこの関数は危険な利用がデフォルトとなっていた。 + +そのため、この関数(とそのファミリ)は非推奨とされ、代わりに[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)が追加された。`shared_ptr`に対する`atomic`特殊化を利用すれば、アトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものをアトミックオブジェクトとすることができるため、どこからアクセスしたとしても全てのアクセスは自動的にアトミックアクセスとなり、前述の問題は回避できる。 + +この関数から`shared_ptr`に対する`atomic`特殊化に移行する場合は、元のコードでアトミックアクセス対象となっていた`shared_ptr`オブジェクトの型を`std::atomic`に変更することで移行でき、その場合は`atomic`のために用意されているフリー関数が代わりに使用される(宣言されているヘッダが異なるため、``ヘッダのインクルードが必要となるかもしれない)。 ## 例 ```cpp example @@ -75,5 +87,4 @@ int main() - [`atomic_exchange_explicit() - `](/reference/atomic/atomic_exchange_explicit.md) - [N2674 Shared_ptr atomic access, revision 1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2674.htm) - [C++0x Shared_ptr atomic access - Faith and Brave - C++で遊ぼう](http://faithandbrave.hateblo.jp/entry/20081015/1224066366) - - +- [P0718R2 Revising `atomic_shared_ptr` for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0718r2.html) diff --git a/reference/memory/shared_ptr/atomic_is_lock_free.md b/reference/memory/shared_ptr/atomic_is_lock_free.md index 48f99c08d9..281dafdfdb 100644 --- a/reference/memory/shared_ptr/atomic_is_lock_free.md +++ b/reference/memory/shared_ptr/atomic_is_lock_free.md @@ -3,6 +3,7 @@ * std[meta namespace] * function template[meta id-type] * cpp11[meta cpp] +* cpp20deprecated[meta cpp] ```cpp namespace std { @@ -11,6 +12,7 @@ namespace std { } ``` +この関数は、C++20から非推奨となった。アトミックアクセスの対象としている`shared_ptr`を[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)で置き換えることで同等の機能を使用できる。 ## 概要 `shared_ptr`オブジェクトがロックフリーに振る舞えるかを判定する。 @@ -29,6 +31,15 @@ namespace std { ## 例外 投げない +## 非推奨・削除の詳細 + +この関数はフリー関数であるため、この関数によってアトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものはどこかに配置されている非アトミックオブジェクトである。そのため、アトミックアクセスしたい文脈の外側から通常のアクセスが可能であり、もし別のスレッドからそのようなアクセスが行われているとこの関数を用いていてもデータ競合を引き起こし未定義動作となる。 + +すなわち、アトミックにアクセスしたい`shared_ptr`オブジェクトに対する全てのアクセスをプログラマがきちんと管理しなければこの関数の使用は安全ではなく、それはかなり困難であったためこの関数は危険な利用がデフォルトとなっていた。 + +そのため、この関数(とそのファミリ)は非推奨とされ、代わりに[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)が追加された。`shared_ptr`に対する`atomic`特殊化を利用すれば、アトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものをアトミックオブジェクトとすることができるため、どこからアクセスしたとしても全てのアクセスは自動的にアトミックアクセスとなり、前述の問題は回避できる。 + +この関数から`shared_ptr`に対する`atomic`特殊化に移行する場合は、元のコードでアトミックアクセス対象となっていた`shared_ptr`オブジェクトの型を`std::atomic`に変更することで移行でき、その場合は`atomic`のために用意されているフリー関数が代わりに使用される(宣言されているヘッダが異なるため、``ヘッダのインクルードが必要となるかもしれない)。 ## 例 ```cpp example @@ -71,4 +82,4 @@ shared_ptr isn't lock-free - [`atomic_is_lock_free() - `](/reference/atomic/atomic_is_lock_free.md) - [N2674 Shared_ptr atomic access, revision 1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2674.htm) - [C++0x Shared_ptr atomic access - Faith and Brave - C++で遊ぼう](http://faithandbrave.hateblo.jp/entry/20081015/1224066366) - +- [P0718R2 Revising `atomic_shared_ptr` for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0718r2.html) diff --git a/reference/memory/shared_ptr/atomic_load.md b/reference/memory/shared_ptr/atomic_load.md index 54deb6bb77..94b1b3ef19 100644 --- a/reference/memory/shared_ptr/atomic_load.md +++ b/reference/memory/shared_ptr/atomic_load.md @@ -3,6 +3,7 @@ * std[meta namespace] * function template[meta id-type] * cpp11[meta cpp] +* cpp20deprecated[meta cpp] ```cpp namespace std { @@ -11,6 +12,8 @@ namespace std { } ``` +この関数は、C++20から非推奨となった。アトミックアクセスの対象としている`shared_ptr`を[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)で置き換えることで同等の機能を使用できる。 + ## 概要 `shared_ptr`オブジェクトを、アトミックに読み込む。 @@ -30,6 +33,15 @@ atomic_load_explicit(p, memory_order_seq_cst) ## 例外 投げない +## 非推奨・削除の詳細 + +この関数はフリー関数であるため、この関数によってアトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものはどこかに配置されている非アトミックオブジェクトである。そのため、アトミックアクセスしたい文脈の外側から通常のアクセスが可能であり、もし別のスレッドからそのようなアクセスが行われているとこの関数を用いていてもデータ競合を引き起こし未定義動作となる。 + +すなわち、アトミックにアクセスしたい`shared_ptr`オブジェクトに対する全てのアクセスをプログラマがきちんと管理しなければこの関数の使用は安全ではなく、それはかなり困難であったためこの関数は危険な利用がデフォルトとなっていた。 + +そのため、この関数(とそのファミリ)は非推奨とされ、代わりに[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)が追加された。`shared_ptr`に対する`atomic`特殊化を利用すれば、アトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものをアトミックオブジェクトとすることができるため、どこからアクセスしたとしても全てのアクセスは自動的にアトミックアクセスとなり、前述の問題は回避できる。 + +この関数から`shared_ptr`に対する`atomic`特殊化に移行する場合は、元のコードでアトミックアクセス対象となっていた`shared_ptr`オブジェクトの型を`std::atomic`に変更することで移行でき、その場合は`atomic`のために用意されているフリー関数が代わりに使用される(宣言されているヘッダが異なるため、``ヘッダのインクルードが必要となるかもしれない)。 ## 例 ```cpp example @@ -73,5 +85,4 @@ int main() - [`atomic_load() - `](/reference/atomic/atomic_load.md) - [N2674 Shared_ptr atomic access, revision 1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2674.htm) - [C++0x Shared_ptr atomic access - Faith and Brave - C++で遊ぼう](http://faithandbrave.hateblo.jp/entry/20081015/1224066366) - - +- [P0718R2 Revising `atomic_shared_ptr` for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0718r2.html) diff --git a/reference/memory/shared_ptr/atomic_load_explicit.md b/reference/memory/shared_ptr/atomic_load_explicit.md index 57cd1d6bd7..12b91bdaaa 100644 --- a/reference/memory/shared_ptr/atomic_load_explicit.md +++ b/reference/memory/shared_ptr/atomic_load_explicit.md @@ -3,6 +3,7 @@ * std[meta namespace] * function template[meta id-type] * cpp11[meta cpp] +* cpp20deprecated[meta cpp] ```cpp namespace std { @@ -12,6 +13,8 @@ namespace std { ``` * memory_order[link /reference/atomic/memory_order.md] +この関数は、C++20から非推奨となった。アトミックアクセスの対象としている`shared_ptr`を[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)で置き換えることで同等の機能を使用できる。 + ## 概要 メモリオーダーを指定して、`shared_ptr`オブジェクトを、アトミックに読み込む。 @@ -32,6 +35,15 @@ namespace std { ## 例外 投げない +## 非推奨・削除の詳細 + +この関数はフリー関数であるため、この関数によってアトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものはどこかに配置されている非アトミックオブジェクトである。そのため、アトミックアクセスしたい文脈の外側から通常のアクセスが可能であり、もし別のスレッドからそのようなアクセスが行われているとこの関数を用いていてもデータ競合を引き起こし未定義動作となる。 + +すなわち、アトミックにアクセスしたい`shared_ptr`オブジェクトに対する全てのアクセスをプログラマがきちんと管理しなければこの関数の使用は安全ではなく、それはかなり困難であったためこの関数は危険な利用がデフォルトとなっていた。 + +そのため、この関数(とそのファミリ)は非推奨とされ、代わりに[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)が追加された。`shared_ptr`に対する`atomic`特殊化を利用すれば、アトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものをアトミックオブジェクトとすることができるため、どこからアクセスしたとしても全てのアクセスは自動的にアトミックアクセスとなり、前述の問題は回避できる。 + +この関数から`shared_ptr`に対する`atomic`特殊化に移行する場合は、元のコードでアトミックアクセス対象となっていた`shared_ptr`オブジェクトの型を`std::atomic`に変更することで移行でき、その場合は`atomic`のために用意されているフリー関数が代わりに使用される(宣言されているヘッダが異なるため、``ヘッダのインクルードが必要となるかもしれない)。 ## 例 ```cpp example @@ -77,5 +89,4 @@ int main() - [`atomic_load_explicit() - `](/reference/atomic/atomic_load.md) - [N2674 Shared_ptr atomic access, revision 1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2674.htm) - [C++0x Shared_ptr atomic access - Faith and Brave - C++で遊ぼう](http://faithandbrave.hateblo.jp/entry/20081015/1224066366) - - +- [P0718R2 Revising `atomic_shared_ptr` for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0718r2.html) diff --git a/reference/memory/shared_ptr/atomic_store.md b/reference/memory/shared_ptr/atomic_store.md index 96158d354a..fa00e9399b 100644 --- a/reference/memory/shared_ptr/atomic_store.md +++ b/reference/memory/shared_ptr/atomic_store.md @@ -3,6 +3,7 @@ * std[meta namespace] * function template[meta id-type] * cpp11[meta cpp] +* cpp20deprecated[meta cpp] ```cpp namespace std { @@ -11,6 +12,8 @@ namespace std { } ``` +この関数は、C++20から非推奨となった。アトミックアクセスの対象としている`shared_ptr`を[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)で置き換えることで同等の機能を使用できる。 + ## 概要 `shared_ptr`オブジェクトに、アトミックに値を書き込む。 @@ -34,6 +37,15 @@ atomic_store_explicit(p, r, memory_order_seq_cst) ## 例外 投げない +## 非推奨・削除の詳細 + +この関数はフリー関数であるため、この関数によってアトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものはどこかに配置されている非アトミックオブジェクトである。そのため、アトミックアクセスしたい文脈の外側から通常のアクセスが可能であり、もし別のスレッドからそのようなアクセスが行われているとこの関数を用いていてもデータ競合を引き起こし未定義動作となる。 + +すなわち、アトミックにアクセスしたい`shared_ptr`オブジェクトに対する全てのアクセスをプログラマがきちんと管理しなければこの関数の使用は安全ではなく、それはかなり困難であったためこの関数は危険な利用がデフォルトとなっていた。 + +そのため、この関数(とそのファミリ)は非推奨とされ、代わりに[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)が追加された。`shared_ptr`に対する`atomic`特殊化を利用すれば、アトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものをアトミックオブジェクトとすることができるため、どこからアクセスしたとしても全てのアクセスは自動的にアトミックアクセスとなり、前述の問題は回避できる。 + +この関数から`shared_ptr`に対する`atomic`特殊化に移行する場合は、元のコードでアトミックアクセス対象となっていた`shared_ptr`オブジェクトの型を`std::atomic`に変更することで移行でき、その場合は`atomic`のために用意されているフリー関数が代わりに使用される(宣言されているヘッダが異なるため、``ヘッダのインクルードが必要となるかもしれない)。 ## 例 ```cpp example @@ -77,5 +89,4 @@ int main() - [`atomic_store() - `](/reference/atomic/atomic_store.md) - [N2674 Shared_ptr atomic access, revision 1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2674.htm) - [C++0x Shared_ptr atomic access - Faith and Brave - C++で遊ぼう](http://faithandbrave.hateblo.jp/entry/20081015/1224066366) - - +- [P0718R2 Revising `atomic_shared_ptr` for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0718r2.html) diff --git a/reference/memory/shared_ptr/atomic_store_explicit.md b/reference/memory/shared_ptr/atomic_store_explicit.md index e70914eca0..bc1e5c5f0e 100644 --- a/reference/memory/shared_ptr/atomic_store_explicit.md +++ b/reference/memory/shared_ptr/atomic_store_explicit.md @@ -3,6 +3,7 @@ * std[meta namespace] * function template[meta id-type] * cpp11[meta cpp] +* cpp20deprecated[meta cpp] ```cpp namespace std { @@ -12,6 +13,8 @@ namespace std { ``` * memory_order[link /reference/atomic/memory_order.md] +この関数は、C++20から非推奨となった。アトミックアクセスの対象としている`shared_ptr`を[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)で置き換えることで同等の機能を使用できる。 + ## 概要 メモリオーダーを指定して、`shared_ptr`オブジェクトに、アトミックに値を書き込む。 @@ -36,6 +39,15 @@ namespace std { ## 例外 投げない +## 非推奨・削除の詳細 + +この関数はフリー関数であるため、この関数によってアトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものはどこかに配置されている非アトミックオブジェクトである。そのため、アトミックアクセスしたい文脈の外側から通常のアクセスが可能であり、もし別のスレッドからそのようなアクセスが行われているとこの関数を用いていてもデータ競合を引き起こし未定義動作となる。 + +すなわち、アトミックにアクセスしたい`shared_ptr`オブジェクトに対する全てのアクセスをプログラマがきちんと管理しなければこの関数の使用は安全ではなく、それはかなり困難であったためこの関数は危険な利用がデフォルトとなっていた。 + +そのため、この関数(とそのファミリ)は非推奨とされ、代わりに[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)が追加された。`shared_ptr`に対する`atomic`特殊化を利用すれば、アトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものをアトミックオブジェクトとすることができるため、どこからアクセスしたとしても全てのアクセスは自動的にアトミックアクセスとなり、前述の問題は回避できる。 + +この関数から`shared_ptr`に対する`atomic`特殊化に移行する場合は、元のコードでアトミックアクセス対象となっていた`shared_ptr`オブジェクトの型を`std::atomic`に変更することで移行でき、その場合は`atomic`のために用意されているフリー関数が代わりに使用される(宣言されているヘッダが異なるため、``ヘッダのインクルードが必要となるかもしれない)。 ## 例 ```cpp example @@ -81,5 +93,4 @@ int main() - [`atomic_store_explicit() - `](/reference/atomic/atomic_store_explicit.md) - [N2674 Shared_ptr atomic access, revision 1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2674.htm) - [C++0x Shared_ptr atomic access - Faith and Brave - C++で遊ぼう](http://faithandbrave.hateblo.jp/entry/20081015/1224066366) - - +- [P0718R2 Revising `atomic_shared_ptr` for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0718r2.html) From fb295e5dead94487ffcc86042b541ab62e3cb068 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 13 Jun 2023 16:00:58 +0900 Subject: [PATCH 0346/3948] =?UTF-8?q?flat=5Fmap=20:=20emplace=5Fhint?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20#1078?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map.md | 2 +- reference/flat_map/flat_map/emplace.md | 2 +- reference/flat_map/flat_map/emplace_hint.md | 82 +++++++++++++++++++++ 3 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 reference/flat_map/flat_map/emplace_hint.md diff --git a/reference/flat_map/flat_map.md b/reference/flat_map/flat_map.md index 18628ef35e..779e4536b3 100644 --- a/reference/flat_map/flat_map.md +++ b/reference/flat_map/flat_map.md @@ -62,7 +62,7 @@ namespace std { | [`insert_or_assign`](flat_map/insert_or_assign.md.nolink) | 要素を挿入、あるいは代入する | C++23 | | [`insert_range`](flat_map/insert_range.md.nolink) | Rangeを挿入する | C++23 | | [`emplace`](flat_map/emplace.md) | 要素を直接構築する | C++23 | -| [`emplace_hint`](flat_map/emplace_hint.md.nolink) | ヒントを使って要素を直接構築する | C++23 | +| [`emplace_hint`](flat_map/emplace_hint.md) | ヒントを使って要素を直接構築する | C++23 | | [`try_emplace`](flat_map/try_emplace.md.nolink) | キーが存在しない場合のみ要素を直接構築する | C++23 | | [`erase`](flaflat_maptmap/erase.md.nolink) | 要素を削除する | C++23 | | [`swap`](flat_map/swap.md.nolink) | コンテンツを交換する | C++23 | diff --git a/reference/flat_map/flat_map/emplace.md b/reference/flat_map/flat_map/emplace.md index f822e8ec79..398b430840 100644 --- a/reference/flat_map/flat_map/emplace.md +++ b/reference/flat_map/flat_map/emplace.md @@ -134,6 +134,6 @@ CCC : (1, 2) |------------------------------------------------|--------------------------------------------| | [`flat_map::insert`](insert.md.nolink) | 要素を挿入する | | [`flat_map::insert_or_assign`](insert_or_assign.md.nolink) | 要素を挿入、あるいは代入する | -| [`flat_map::emplace_hint`](emplace_hint.md.nolink) | ヒントを使って要素を直接構築する | +| [`flat_map::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | | [`flat_map::try_emplace`](try_emplace.md.nolink) | キーが存在しない場合のみ要素を直接構築する | diff --git a/reference/flat_map/flat_map/emplace_hint.md b/reference/flat_map/flat_map/emplace_hint.md new file mode 100644 index 0000000000..113abdf276 --- /dev/null +++ b/reference/flat_map/flat_map/emplace_hint.md @@ -0,0 +1,82 @@ +# emplace_hint +* flat_map[meta header] +* std[meta namespace] +* flat_map[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +template +iterator emplace_hint(const_iterator hint, Args&&... args); +``` + +## 概要 +要素が配置されるべき場所を示唆するパラメータ `hint` を使って、コンテナに新しい要素を挿入する。要素は直接構築される(コピーもムーブもされない)。要素のコンストラクタはこの関数に渡された引数と同じ引数で呼ばれる。 + + +## パラメータ +- `hint` : 新しい要素をどこへ挿入するかを示唆するために使われるイテレータ +- `args...` : 要素のコンストラクタへ転送される引数パック + + +## 戻り値 +新たな要素が追加された場合、その追加された要素を指すイテレータ。新たな要素が追加されなかった場合、既にあった要素を指すイテレータ。 + + +## 計算量 +一般にコンテナのサイズについて対数時間だが、新しい要素が `hint` の前に挿入された場合は償却定数時間。 + + +## 備考 +- [`try_emplace`](try_emplace.md.nolink) と異なり、たとえ要素が挿入されなかった場合でも `value_type` 型のオブジェクトが構築される可能性があり、結果として引数 `args` が [`move`](/reference/utility/move.md) の対象となって変更されてしまっている可能性があるため、注意が必要である。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_map fm; + + fm.emplace(1, 'A'); + + // キー2の要素が最後尾に追加されることが事前にわかっているので、fm.end()をヒントとして与える + fm.emplace_hint(fm.end(), 2, 'B'); + + for (const auto& [key, value] : fm) { + std::cout << key << " : " << value << std::endl; + } +} +``` +* emplace_hint[color ff0000] +* fm.emplace[link emplace.md] +* fm.end()[link end.md.nolink] + +### 出力 +``` +1 : A +2 : B +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|------------------------------------------------|--------------------------------------------| +| [`flat_map::insert`](insert.md.nolink) | 要素を挿入する | +| [`flat_map::insert_or_assign`](insert_or_assign.md.nolink) | 要素を挿入、あるいは代入する | +| [`flat_map::emplace`](emplace.md) | 要素を直接構築する | +| [`flat_map::try_emplace`](try_emplace.md.nolink) | キーが存在しない場合のみ要素を直接構築する | + From 0f3743e212c0c612150466f8fec1babd509c7a6f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 13 Jun 2023 16:09:39 +0900 Subject: [PATCH 0347/3948] =?UTF-8?q?C++20=20:=20shared=5Fptr=E3=81=AE?= =?UTF-8?q?=E3=82=A2=E3=83=88=E3=83=9F=E3=83=83=E3=82=AF=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E3=81=8C=E9=9D=9E=E6=8E=A8=E5=A5=A8=E3=81=AB=E3=81=AA=E3=81=A3?= =?UTF-8?q?=E3=81=9F=E3=81=93=E3=81=A8=E3=82=92=E8=A8=98=E8=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/cpprefjp/site/commit/90927bc3454740d33a8e2933e23ebbc8f3d96ea5 --- lang/cpp20.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lang/cpp20.md b/lang/cpp20.md index 4d00423716..3a48506f10 100644 --- a/lang/cpp20.md +++ b/lang/cpp20.md @@ -324,6 +324,18 @@ C++20とは、2020年中に改訂され、ISO/IEC 14882:2020で標準規格化 - [`std::atomic_init()`](/reference/atomic/atomic_init.md)関数 - [`ATOMIC_VAR_INIT`](/reference/atomic/atomic_var_init.md)マクロ - [`ATOMIC_FLAG_INIT`](/reference/atomic/atomic_flag_init.md)マクロ +- [`std::shared_ptr`](/reference/memory/shared_ptr.md)の[`std::atomic`特殊化](/reference/memory/atomic.md)追加にともない、[`std::shared_ptr`](/reference/memory/shared_ptr.md)に対する以下のアトミック操作を非推奨化: + - [`atomic_is_lock_free`](/reference/memory/shared_ptr/atomic_is_lock_free.md) + - [`atomic_load`](/reference/memory/shared_ptr/atomic_load.md) + - [`atomic_load_explicit`](/reference/memory/shared_ptr/atomic_load_explicit.md) + - [`atomic_store`](/reference/memory/shared_ptr/atomic_store.md) + - [`atomic_store_explicit`](/reference/memory/shared_ptr/atomic_store_explicit.md) + - [`atomic_exchange`](/reference/memory/shared_ptr/atomic_exchange.md) + - [`atomic_exchange_explicit`](/reference/memory/shared_ptr/atomic_exchange_explicit.md) + - [`atomic_compare_exchange_weak`](/reference/memory/shared_ptr/atomic_compare_exchange_weak.md) + - [`atomic_compare_exchange_strong`](/reference/memory/shared_ptr/atomic_compare_exchange_strong.md) + - [`atomic_compare_exchange_weak_explicit`](/reference/memory/shared_ptr/atomic_compare_exchange_weak_explicit.md) + - [`atomic_compare_exchange_strong_explicit`](/reference/memory/shared_ptr/atomic_compare_exchange_strong_explicit.md) ### 機能の削除 From 8f3626e2afa6c227bc9170774fd7b72e87d3c7c8 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 13 Jun 2023 21:17:59 +0900 Subject: [PATCH 0348/3948] =?UTF-8?q?set/map=E3=81=AEbegin/end=E7=B3=BB=20?= =?UTF-8?q?:=20=E3=81=BB=E3=81=8B=E3=81=AE=E3=82=B3=E3=83=B3=E3=83=86?= =?UTF-8?q?=E3=83=8A=E3=81=AB=E5=90=88=E3=82=8F=E3=81=9B=E3=81=A6=E6=96=87?= =?UTF-8?q?=E7=AB=A0=E3=82=92=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ・概要として「〜を返す」から「〜を取得する」に変更 ・「〜の値を返す」から「〜の値へのイテレータを返す」に変更 ・endを「末尾」「最後の要素」から「末尾の次」に変更 ・rendを「先頭」から「先頭の前」に変更 ・冗長な絶対リンクを相対リンクに変更 --- reference/map/map.md | 8 ++++---- reference/map/map/begin.md | 20 ++++++++++---------- reference/map/map/cbegin.md | 20 ++++++++++---------- reference/map/map/cend.md | 20 ++++++++++---------- reference/map/map/crbegin.md | 22 +++++++++++----------- reference/map/map/crend.md | 20 ++++++++++---------- reference/map/map/end.md | 20 ++++++++++---------- reference/map/map/rbegin.md | 22 +++++++++++----------- reference/map/map/rend.md | 20 ++++++++++---------- reference/map/multimap.md | 8 ++++---- reference/map/multimap/begin.md | 20 ++++++++++---------- reference/map/multimap/cbegin.md | 24 ++++++++++-------------- reference/map/multimap/cend.md | 20 ++++++++++---------- reference/map/multimap/crbegin.md | 22 +++++++++++----------- reference/map/multimap/crend.md | 21 +++++++++++---------- reference/map/multimap/end.md | 20 ++++++++++---------- reference/map/multimap/rbegin.md | 22 +++++++++++----------- reference/map/multimap/rend.md | 20 ++++++++++---------- reference/set/multiset.md | 8 ++++---- reference/set/multiset/begin.md | 8 ++++---- reference/set/multiset/cbegin.md | 6 +++--- reference/set/multiset/cend.md | 6 +++--- reference/set/multiset/crbegin.md | 6 +++--- reference/set/multiset/crend.md | 6 +++--- reference/set/multiset/end.md | 6 +++--- reference/set/multiset/rbegin.md | 8 ++++---- reference/set/multiset/rend.md | 4 ++-- reference/set/set.md | 8 ++++---- reference/set/set/begin.md | 8 ++++---- reference/set/set/cbegin.md | 6 +++--- reference/set/set/cend.md | 6 +++--- reference/set/set/crbegin.md | 6 +++--- reference/set/set/crend.md | 4 ++-- reference/set/set/end.md | 6 +++--- reference/set/set/rbegin.md | 8 ++++---- reference/set/set/rend.md | 4 ++-- 36 files changed, 230 insertions(+), 233 deletions(-) diff --git a/reference/map/map.md b/reference/map/map.md index 3ced8970a8..6c8e0a2335 100644 --- a/reference/map/map.md +++ b/reference/map/map.md @@ -69,12 +69,12 @@ namespace std { |------------------------------|----------------------------------------------|-------| | [`begin`](map/begin.md) | 先頭を指すイテレータを取得する | | | [`cbegin`](map/cbegin.md) | 先頭を指す読み取り専用イテレータを取得する | C++11 | -| [`end`](map/end.md) | 末尾を指すイテレータを取得する | | -| [`cend`](map/cend.md) | 末尾を指す読み取り専用イテレータを取得する | C++11 | +| [`end`](map/end.md) | 末尾の次を指すイテレータを取得する | | +| [`cend`](map/cend.md) | 末尾の次を指す読み取り専用イテレータを取得する | C++11 | | [`rbegin`](map/rbegin.md) | 末尾を指す逆イテレータを取得する | | | [`crbegin`](map/crbegin.md) | 末尾を指す読み取り専用逆イテレータを取得する | C++11 | -| [`rend`](map/rend.md) | 先頭を指す逆イテレータを取得する | | -| [`crend`](map/crend.md) | 先頭を指す読み取り専用逆イテレータを取得する | C++11 | +| [`rend`](map/rend.md) | 先頭の前を指す逆イテレータを取得する | | +| [`crend`](map/crend.md) | 先頭の前を指す読み取り専用逆イテレータを取得する | C++11 | ### 領域 diff --git a/reference/map/map/begin.md b/reference/map/map/begin.md index ffc6c0bf7d..83a13b26b4 100644 --- a/reference/map/map/begin.md +++ b/reference/map/map/begin.md @@ -11,8 +11,8 @@ const_iterator begin() const noexcept; ## 概要 -`map` コンテナの先頭のキーと要素のpairを参照するイテレータを返す。 -内部的に、`map`コンテナは要素を下位から上位へと並べており、従って `begin()`は `map` 内の最下位のキーにあたるpairのイテレータを返す。 +`map` コンテナの先頭のキーと要素のpairを参照するイテレータを取得する。 +内部的に、`map`コンテナは要素を下位から上位へと並べており、従って `begin()`は `map` 内の最下位のキーにあたるpairへのイテレータを返す。 ## 戻り値 @@ -77,13 +77,13 @@ int main() ## 関連項目 | 名前 | 説明 | -|------------------------------------------------------------------------------------------------|--------------------------------------------------| -| [`map::end`](/reference/map/map/end.md) | 末尾を指すイテレータを取得する | -| [`map::cbegin`](/reference/map/map/cbegin.md) | 先頭を指すconstイテレータを取得する | -| [`map::cend`](/reference/map/map/cend.md) | 末尾を指すconstイテレータを取得する | -| [`map::rbegin`](/reference/map/map/rbegin.md) | 末尾を指す逆イテレータを取得する | -| [`map::rend`](/reference/map/map/rend.md) | 先頭を指す逆イテレータを取得する | -| [`map::crbegin`](/reference/map/map/crbegin.md) | 末尾を指す逆constイテレータを取得する | -| [`map::crend`](/reference/map/map/crend.md) | 先頭を指す逆constイテレータを取得する | +|------------------------------|------------------------------------------| +| [`map::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`map::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`map::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`map::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | +| [`map::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`map::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | +| [`map::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | diff --git a/reference/map/map/cbegin.md b/reference/map/map/cbegin.md index 72e2f04fc4..cfdd8f467d 100644 --- a/reference/map/map/cbegin.md +++ b/reference/map/map/cbegin.md @@ -11,8 +11,8 @@ const_iterator cbegin() const noexcept; ## 概要 -`map` コンテナの先頭のキーと要素のpairを参照するイテレータを返す。 -内部的に、`map`コンテナは要素を下位から上位へと並べており、従って `cbegin()` は `map` 内の最下位のキーにあたるpairのイテレータを返す。 +`map` コンテナの先頭のキーと要素のpairを参照するイテレータを取得する。 +内部的に、`map`コンテナは要素を下位から上位へと並べており、従って `cbegin()` は `map` 内の最下位のキーにあたるpairへのイテレータを返す。 ## 戻り値 @@ -73,14 +73,14 @@ int main() ## 関連項目 | 名前 | 説明 | -|------------------------------------------------------------------------------------------------|--------------------------------------------------| -| [`map::begin`](/reference/map/map/begin.md) | 先頭を指すイテレータを取得する | -| [`map::end`](/reference/map/map/end.md) | 末尾を指すイテレータを取得する | -| [`map::cend`](/reference/map/map/cend.md) | 末尾を指すconstイテレータを取得する | -| [`map::rbegin`](/reference/map/map/rbegin.md) | 末尾を指す逆イテレータを取得する | -| [`map::rend`](/reference/map/map/rend.md) | 先頭を指す逆イテレータを取得する | -| [`map::crbegin`](/reference/map/map/crbegin.md) | 末尾を指す逆constイテレータを取得する | -| [`map::crend`](/reference/map/map/crend.md) | 先頭を指す逆constイテレータを取得する | +|------------------------------|-------------------------------------------| +| [`map::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`map::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`map::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`map::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | +| [`map::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`map::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | +| [`map::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | diff --git a/reference/map/map/cend.md b/reference/map/map/cend.md index abacf1b588..b35609733e 100644 --- a/reference/map/map/cend.md +++ b/reference/map/map/cend.md @@ -10,11 +10,11 @@ const_iterator cend() const noexcept; ``` ## 概要 -`map` コンテナの最後の要素の次を参照するイテレータを返す。 +`map` コンテナの末尾の次を参照するイテレータを取得する。 ## 戻り値 -コンテナの最後の要素の次を参照するイテレータ。 +コンテナの末尾の次を参照するイテレータ。 `const_iterator` はいずれもメンバ型である。`map` クラステンプレートにおいて、これらは双方向イテレータである。 @@ -78,14 +78,14 @@ int main() ## 関連項目 | 名前 | 説明 | -|------------------------------------------------------------------------------------------------|--------------------------------------------------| -| [`map::begin`](/reference/map/map/begin.md) | 先頭を指すイテレータを取得する | -| [`map::end`](/reference/map/map/end.md) | 末尾を指すイテレータを取得する | -| [`map::cbegin`](/reference/map/map/cbegin.md) | 先頭を指すconstイテレータを取得する | -| [`map::rbegin`](/reference/map/map/rbegin.md) | 末尾を指す逆イテレータを取得する | -| [`map::rend`](/reference/map/map/rend.md) | 先頭を指す逆イテレータを取得する | -| [`map::crbegin`](/reference/map/map/crbegin.md) | 末尾を指す逆constイテレータを取得する | -| [`map::crend`](/reference/map/map/crend.md) | 先頭を指す逆constイテレータを取得する | +|------------------------------|-------------------------------------------| +| [`map::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`map::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`map::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`map::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | +| [`map::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`map::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | +| [`map::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | diff --git a/reference/map/map/crbegin.md b/reference/map/map/crbegin.md index 8624ad553a..5b724949f3 100644 --- a/reference/map/map/crbegin.md +++ b/reference/map/map/crbegin.md @@ -10,9 +10,9 @@ const_reverse_iterator crbegin() const noexcept; ``` ## 概要 -`map` コンテナ内の最後の要素を指す逆イテレータを返す。 -内部的に、`map` コンテナは各要素をキーの値に従って下位から上位へと並べており、従って `crbegin()` は最上位のキーにあたる値を返す。 -`crbegin()` は [`end()`](/reference/map/map/end.md) と同じ要素を指すわけではなく、その前の要素を指すことに注意。 +`map` コンテナ内の末尾を指す逆イテレータを取得する。 +内部的に、`map` コンテナは各要素をキーの値に従って下位から上位へと並べており、従って `crbegin()` は最上位のキーにあたる値へのイテレータを返す。 +`crbegin()` は [`end()`](end.md) と同じ要素を指すわけではなく、その前の要素を指すことに注意。 ## 戻り値 @@ -66,11 +66,11 @@ int main() ## 関連項目 | 名前 | 説明 | ----------------------------------------------------------------------------------------------|--------------------------------------------------| -| [`map::begin`](/reference/map/map/begin.md) | 先頭を指すイテレータを取得する | -| [`map::end`](/reference/map/map/end.md) | 末尾を指すイテレータを取得する | -| [`map::cbegin`](/reference/map/map/cbegin.md) | 先頭を指すconstイテレータを取得する | -| [`map::cend`](/reference/map/map/cend.md) | 末尾を指すconstイテレータを取得する | -| [`map::rbegin`](/reference/map/map/rbegin.md) | 末尾を指す逆イテレータを取得する | -| [`map::rend`](/reference/map/map/rend.md) | 先頭を指す逆イテレータを取得する | -| [`map::crend`](/reference/map/map/crend.md) | 先頭を指す逆constイテレータを取得する | +-----------------------------|-------------------------------------------| +| [`map::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`map::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`map::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`map::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`map::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | +| [`map::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`map::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | diff --git a/reference/map/map/crend.md b/reference/map/map/crend.md index ecda48420b..f896d56bf3 100644 --- a/reference/map/map/crend.md +++ b/reference/map/map/crend.md @@ -11,8 +11,8 @@ const_reverse_iterator crend() const noexcept; ## 概要 -`map` コンテナの先頭要素の前(これは反転シーケンスの末尾にあたる)を指す逆イテレータを返す。 -`crend()` は [`begin()`](/reference/map/map/begin.md) と同じ要素を指すわけではなく、その前の要素を指すことに注意。 +`map` コンテナの先頭要素の前(これは反転シーケンスの末尾にあたる)を指す逆イテレータを取得する。 +`crend()` は [`begin()`](begin.md) と同じ要素を指すわけではなく、その前の要素を指すことに注意。 ## 戻り値 @@ -64,11 +64,11 @@ int main() ## 関連項目 | 名前 | 説明 | -|------------------------------------------------------------------------------------------------|--------------------------------------------| -| [`map::begin`](/reference/map/map/begin.md) | 先頭を指すイテレータを取得する | -| [`map::end`](/reference/map/map/end.md) | 末尾を指すイテレータを取得する | -| [`map::cbegin`](/reference/map/map/cbegin.md) | 先頭を指すconstイテレータを取得する | -| [`map::cend`](/reference/map/map/cend.md) | 末尾を指すconstイテレータを取得する | -| [`map::rbegin`](/reference/map/map/rbegin.md) | 末尾を指す逆イテレータを取得する | -| [`map::rend`](/reference/map/map/rend.md) | 先頭を指す逆イテレータを取得する | -| [`map::crbegin`](/reference/map/map/crbegin.md) | 末尾を指す逆constイテレータを取得する | +|------------------------------|-----------------------------------------| +| [`map::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`map::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`map::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`map::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`map::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | +| [`map::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`map::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | diff --git a/reference/map/map/end.md b/reference/map/map/end.md index b99f96425f..295f317db0 100644 --- a/reference/map/map/end.md +++ b/reference/map/map/end.md @@ -10,11 +10,11 @@ const_iterator end() const noexcept; ``` ## 概要 -`map` コンテナの最後の要素の次を参照するイテレータを返す。 +`map` コンテナの末尾の次を参照するイテレータを取得する。 ## 戻り値 -コンテナの最後の要素の次を参照するイテレータ。 +コンテナの末尾の次を参照するイテレータ。 `iterator` と `const_iterator` はいずれもメンバ型である。`map` クラステンプレートにおいて、これらは双方向イテレータである。 @@ -79,11 +79,11 @@ int main() ## 関連項目 | 名前 | 説明 | -|------------------------------------------------------------------------------------------------|--------------------------------------------------| -| [`map::begin`](/reference/map/map/begin.md) | 先頭を指すイテレータを取得する | -| [`map::cbegin`](/reference/map/map/cbegin.md) | 先頭を指すconstイテレータを取得する | -| [`map::cend`](/reference/map/map/cend.md) | 末尾を指すconstイテレータを取得する | -| [`map::rbegin`](/reference/map/map/rbegin.md) | 末尾を指す逆イテレータを取得する | -| [`map::rend`](/reference/map/map/rend.md) | 先頭を指す逆イテレータを取得する | -| [`map::crbegin`](/reference/map/map/crbegin.md) | 末尾を指す逆constイテレータを取得する | -| [`map::crend`](/reference/map/map/crend.md) | 先頭を指す逆constイテレータを取得する | +|------------------------------|-------------------------------------------| +| [`map::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`map::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`map::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`map::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | +| [`map::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`map::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | +| [`map::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | diff --git a/reference/map/map/rbegin.md b/reference/map/map/rbegin.md index ef66e81f89..d22d28ff16 100644 --- a/reference/map/map/rbegin.md +++ b/reference/map/map/rbegin.md @@ -10,9 +10,9 @@ const_reverse_iterator rbegin() const noexcept; ``` ## 概要 -`map` コンテナ内の最後の要素を指す逆イテレータを返す。 -内部的に、`map` コンテナは各要素をキーの値に従って下位から上位へと並べており、従って `rbegin()` は最上位のキーにあたる値を返す。 -`rbegin()` は [`end()`](/reference/map/map/end.md) と同じ要素を指すわけではなく、その前の要素を指すことに注意。 +`map` コンテナ内の末尾を指す逆イテレータを取得する。 +内部的に、`map` コンテナは各要素をキーの値に従って下位から上位へと並べており、従って `rbegin()` は最上位のキーにあたる値を指すイテレータを返す。 +`rbegin()` は [`end()`](end.md) と同じ要素を指すわけではなく、その前の要素を指すことに注意。 ## 戻り値 @@ -66,12 +66,12 @@ int main() ## 関連項目 | 名前 | 説明 | ----------------------------------------------------------------------------------------------|--------------------------------------------------| -| [`map::begin`](/reference/map/map/begin.md) | 先頭を指すイテレータを取得する | -| [`map::end`](/reference/map/map/end.md) | 末尾を指すイテレータを取得する | -| [`map::cbegin`](/reference/map/map/cbegin.md) | 先頭を指すconstイテレータを取得する | -| [`map::cend`](/reference/map/map/cend.md) | 末尾を指すconstイテレータを取得する | -| [`map::rend`](/reference/map/map/rend.md) | 先頭を指す逆イテレータを取得する | -| [`map::crbegin`](/reference/map/map/crbegin.md) | 末尾を指す逆constイテレータを取得する | -| [`map::crend`](/reference/map/map/crend.md) | 先頭を指す逆constイテレータを取得する | +-------------------------------|-----------------------------------------| +| [`map::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`map::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`map::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`map::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`map::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`map::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | +| [`map::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | diff --git a/reference/map/map/rend.md b/reference/map/map/rend.md index a6192d4368..8194808230 100644 --- a/reference/map/map/rend.md +++ b/reference/map/map/rend.md @@ -10,8 +10,8 @@ const_reverse_iterator rend() const noexcept; ``` ## 概要 -`map` コンテナの先頭要素の前(これは反転シーケンスの末尾にあたる)を指す逆イテレータを返す。 -`rend()` は [`begin()`](/reference/map/map/begin.md) と同じ要素を指すわけではなく、その前の要素を指すことに注意。 +`map` コンテナの先頭要素の前(これは反転シーケンスの末尾にあたる)を指す逆イテレータを取得する。 +`rend()` は [`begin()`](begin.md) と同じ要素を指すわけではなく、その前の要素を指すことに注意。 ## 戻り値 反転シーケンスの終端を指す逆イテレータ。 @@ -60,12 +60,12 @@ int main() ## 関連項目 | 名前 | 説明 | -|------------------------------------------------------------------------------------------------|--------------------------------------------| -| [`map::begin`](/reference/map/map/begin.md) | 先頭を指すイテレータを取得する | -| [`map::end`](/reference/map/map/end.md) | 末尾を指すイテレータを取得する | -| [`map::cbegin`](/reference/map/map/cbegin.md) | 先頭を指すconstイテレータを取得する | -| [`map::cend`](/reference/map/map/cend.md) | 末尾を指すconstイテレータを取得する | -| [`map::rbegin`](/reference/map/map/rbegin.md) | 末尾を指す逆イテレータを取得する | -| [`map::crbegin`](/reference/map/map/crbegin.md) | 末尾を指す逆constイテレータを取得する | -| [`map::crend`](/reference/map/map/crend.md) | 先頭を指す逆constイテレータを取得する | +|------------------------------|--------------------------------------------| +| [`map::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`map::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`map::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`map::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`map::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | +| [`map::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | +| [`map::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | diff --git a/reference/map/multimap.md b/reference/map/multimap.md index 8cf3d751de..180e5c2c0f 100644 --- a/reference/map/multimap.md +++ b/reference/map/multimap.md @@ -68,12 +68,12 @@ namespace std { |------------------------------|----------------------------------------------|-------| | [`begin`](multimap/begin.md) | 先頭を指すイテレータを取得する | | | [`cbegin`](multimap/cbegin.md) | 先頭を指す読み取り専用イテレータを取得する | C++11 | -| [`end`](multimap/end.md) | 末尾を指すイテレータを取得する | | -| [`cend`](multimap/cend.md) | 末尾を指す読み取り専用イテレータを取得する | C++11 | +| [`end`](multimap/end.md) | 末尾の次を指すイテレータを取得する | | +| [`cend`](multimap/cend.md) | 末尾の次を指す読み取り専用イテレータを取得する | C++11 | | [`rbegin`](multimap/rbegin.md) | 末尾を指す逆イテレータを取得する | | | [`crbegin`](multimap/crbegin.md) | 末尾を指す読み取り専用逆イテレータを取得する | C++11 | -| [`rend`](multimap/rend.md) | 先頭を指す逆イテレータを取得する | | -| [`crend`](multimap/crend.md) | 先頭を指す読み取り専用逆イテレータを取得する | C++11 | +| [`rend`](multimap/rend.md) | 先頭の前を指す逆イテレータを取得する | | +| [`crend`](multimap/crend.md) | 先頭の前を指す読み取り専用逆イテレータを取得する | C++11 | ### 領域 diff --git a/reference/map/multimap/begin.md b/reference/map/multimap/begin.md index b8c082ed31..f992c019f7 100644 --- a/reference/map/multimap/begin.md +++ b/reference/map/multimap/begin.md @@ -11,8 +11,8 @@ const_iterator begin() const noexcept; ## 概要 -`multimap` コンテナの先頭のキーと要素のpairを参照するイテレータを返す。 -内部的に、`multimap`コンテナは要素を下位から上位へと並べており、従って `begin()`は `multimap` 内の最下位のキーにあたるpairのイテレータを返す。 +`multimap` コンテナの先頭のキーと要素のpairを参照するイテレータを取得する。 +内部的に、`multimap`コンテナは要素を下位から上位へと並べており、従って `begin()`は `multimap` 内の最下位のキーにあたるpairへのイテレータを返す。 ## 戻り値 @@ -80,13 +80,13 @@ int main() ## 関連項目 | 名前 | 説明 | -|------------------------------------------------------------------------------------------------|--------------------------------------------------| -| [`multimap::end`](/reference/map/multimap/end.md) | 末尾を指すイテレータを取得する | -| [`multimap::cbegin`](/reference/map/multimap/cbegin.md) | 先頭を指すconstイテレータを取得する | -| [`multimap::cend`](/reference/map/multimap/cend.md) | 末尾を指すconstイテレータを取得する | -| [`multimap::rbegin`](/reference/map/multimap/rbegin.md) | 末尾を指す逆イテレータを取得する | -| [`multimap::rend`](/reference/map/multimap/rend.md) | 先頭を指す逆イテレータを取得する | -| [`multimap::crbegin`](/reference/map/multimap/crbegin.md) | 末尾を指す逆constイテレータを取得する | -| [`multimap::crend`](/reference/map/multimap/crend.md) | 先頭を指す逆constイテレータを取得する | +|-----------------------------------|-------------------------------------------| +| [`multimap::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`multimap::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`multimap::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`multimap::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | +| [`multimap::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`multimap::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | +| [`multimap::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | diff --git a/reference/map/multimap/cbegin.md b/reference/map/multimap/cbegin.md index 89b46de68a..8b5408b04e 100644 --- a/reference/map/multimap/cbegin.md +++ b/reference/map/multimap/cbegin.md @@ -10,8 +10,8 @@ const_iterator cbegin() const noexcept; ``` ## 概要 -`multimap` コンテナの先頭のキーと要素のpairを参照するイテレータを返す。 -内部的に、`multimap`コンテナは要素を下位から上位へと並べており、従って `cbegin()` は `multimap` 内の最下位のキーにあたるpairのイテレータを返す。 +`multimap` コンテナの先頭のキーと要素のpairを参照するイテレータを取得する。 +内部的に、`multimap`コンテナは要素を下位から上位へと並べており、従って `cbegin()` は `multimap` 内の最下位のキーにあたるpairへのイテレータを返す。 ## 戻り値 @@ -75,16 +75,12 @@ int main() ## 関連項目 | 名前 | 説明 | -|------------------------------------------------------------------------------------------------|--------------------------------------------------| -| [`multimap::begin`](/reference/map/multimap/begin.md) | 先頭を指すイテレータを取得する | -| [`multimap::end`](/reference/map/multimap/end.md) | 末尾を指すイテレータを取得する | -| [`multimap::cend`](/reference/map/multimap/cend.md) | 末尾を指すconstイテレータを取得する | -| [`multimap::rbegin`](/reference/map/multimap/rbegin.md) | 末尾を指す逆イテレータを取得する | -| [`multimap::rend`](/reference/map/multimap/rend.md) | 先頭を指す逆イテレータを取得する | -| [`multimap::crbegin`](/reference/map/multimap/crbegin.md) | 末尾を指す逆constイテレータを取得する | -| [`multimap::crend`](/reference/map/multimap/crend.md) | 先頭を指す逆constイテレータを取得する | - - - - +|-----------------------------------|-------------------------------------------| +| [`multimap::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`multimap::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`multimap::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`multimap::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | +| [`multimap::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`multimap::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | +| [`multimap::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | diff --git a/reference/map/multimap/cend.md b/reference/map/multimap/cend.md index 1f74d30a49..4df914fa00 100644 --- a/reference/map/multimap/cend.md +++ b/reference/map/multimap/cend.md @@ -10,11 +10,11 @@ const_iterator cend() const noexcept; ``` ## 概要 -`multimap` コンテナの最後の要素の次を参照するイテレータを返す。 +`multimap` コンテナの末尾の次を参照するイテレータを取得する。 ## 戻り値 -コンテナの最後の要素の次を参照するイテレータ。 +コンテナの末尾の次を参照するイテレータ。 `const_iterator` はいずれもメンバ型である。`multimap` クラステンプレートにおいて、これらは双方向イテレータである。 @@ -81,14 +81,14 @@ int main() ## 関連項目 | 名前 | 説明 | -|------------------------------------------------------------------------------------------------|--------------------------------------------------| -| [`multimap::begin`](/reference/map/multimap/begin.md) | 先頭を指すイテレータを取得する | -| [`multimap::end`](/reference/map/multimap/end.md) | 末尾を指すイテレータを取得する | -| [`multimap::cbegin`](/reference/map/multimap/cbegin.md) | 先頭を指すconstイテレータを取得する | -| [`multimap::rbegin`](/reference/map/multimap/rbegin.md) | 末尾を指す逆イテレータを取得する | -| [`multimap::rend`](/reference/map/multimap/rend.md) | 先頭を指す逆イテレータを取得する | -| [`multimap::crbegin`](/reference/map/multimap/crbegin.md) | 末尾を指す逆constイテレータを取得する | -| [`multimap::crend`](/reference/map/multimap/crend.md) | 先頭を指す逆constイテレータを取得する | +|-----------------------------------|-------------------------------------------| +| [`multimap::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`multimap::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`multimap::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`multimap::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | +| [`multimap::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`multimap::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | +| [`multimap::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | diff --git a/reference/map/multimap/crbegin.md b/reference/map/multimap/crbegin.md index a6809b1ac1..6e492f98d8 100644 --- a/reference/map/multimap/crbegin.md +++ b/reference/map/multimap/crbegin.md @@ -10,9 +10,9 @@ const_reverse_iterator crbegin() const noexcept; ``` ## 概要 -`multimap` コンテナ内の最後の要素を指す逆イテレータを返す。 -内部的に、`multimap` コンテナは各要素をキーの値に従って下位から上位へと並べており、従って `crbegin()` は最上位のキーにあたる値を返す。 -`crbegin()` は [`end()`](/reference/map/multimap/end.md) と同じ要素を指すわけではなく、その前の要素を指すことに注意。 +`multimap` コンテナ内の末尾を指す逆イテレータを取得する。 +内部的に、`multimap` コンテナは各要素をキーの値に従って下位から上位へと並べており、従って `crbegin()` は最上位のキーにあたる値へのイテレータを返す。 +`crbegin()` は [`end()`](end.md) と同じ要素を指すわけではなく、その前の要素を指すことに注意。 ## 戻り値 @@ -67,11 +67,11 @@ int main() ## 関連項目 | 名前 | 説明 | ----------------------------------------------------------------------------------------------|--------------------------------------------------| -| [`multimap::begin`](/reference/map/multimap/begin.md) | 先頭を指すイテレータを取得する | -| [`multimap::end`](/reference/map/multimap/end.md) | 末尾を指すイテレータを取得する | -| [`multimap::cbegin`](/reference/map/multimap/cbegin.md) | 先頭を指すconstイテレータを取得する | -| [`multimap::cend`](/reference/map/multimap/cend.md) | 末尾を指すconstイテレータを取得する | -| [`multimap::rbegin`](/reference/map/multimap/rbegin.md) | 末尾を指す逆イテレータを取得する | -| [`multimap::rend`](/reference/map/multimap/rend.md) | 先頭を指す逆イテレータを取得する | -| [`multimap::crend`](/reference/map/multimap/crend.md) | 先頭を指す逆constイテレータを取得する | +----------------------------------|-------------------------------------------| +| [`multimap::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`multimap::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`multimap::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`multimap::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`multimap::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | +| [`multimap::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`multimap::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | diff --git a/reference/map/multimap/crend.md b/reference/map/multimap/crend.md index 9041b14998..214442dbde 100644 --- a/reference/map/multimap/crend.md +++ b/reference/map/multimap/crend.md @@ -11,8 +11,8 @@ const_reverse_iterator crend() const noexcept; ## 概要 -`multimap` コンテナの先頭要素の前(これは反転シーケンスの末尾にあたる)を指す逆イテレータを返す。 -`crend()` は [`begin()`](/reference/map/multimap/begin.md) と同じ要素を指すわけではなく、その前の要素を指すことに注意。 +`multimap` コンテナの先頭要素の前(これは反転シーケンスの末尾にあたる)を指す逆イテレータを取得する。 +`crend()` は [`begin()`](begin.md) と同じ要素を指すわけではなく、その前の要素を指すことに注意。 ## 戻り値 @@ -65,11 +65,12 @@ int main() ## 関連項目 | 名前 | 説明 | -|------------------------------------------------------------------------------------------------|--------------------------------------------| -| [`multimap::begin`](/reference/map/multimap/begin.md) | 先頭を指すイテレータを取得する | -| [`multimap::end`](/reference/map/multimap/end.md) | 末尾を指すイテレータを取得する | -| [`multimap::cbegin`](/reference/map/multimap/cbegin.md) | 先頭を指すconstイテレータを取得する | -| [`multimap::cend`](/reference/map/multimap/cend.md) | 末尾を指すconstイテレータを取得する | -| [`multimap::rbegin`](/reference/map/multimap/rbegin.md) | 末尾を指す逆イテレータを取得する | -| [`multimap::rend`](/reference/map/multimap/rend.md) | 先頭を指す逆イテレータを取得する | -| [`multimap::crbegin`](/reference/map/multimap/crbegin.md) | 末尾を指す逆constイテレータを取得する | +|-----------------------------------|-----------------------------------------| +| [`multimap::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`multimap::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`multimap::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`multimap::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`multimap::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | +| [`multimap::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`multimap::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | + diff --git a/reference/map/multimap/end.md b/reference/map/multimap/end.md index 4bf789171d..d1b69cfea9 100644 --- a/reference/map/multimap/end.md +++ b/reference/map/multimap/end.md @@ -10,11 +10,11 @@ const_iterator end() const noexcept; ``` ## 概要 -`multimap` コンテナの最後の要素の次を参照するイテレータを返す。 +`multimap` コンテナの末尾の次を参照するイテレータを取得する。 ## 戻り値 -コンテナの最後の要素の次を参照するイテレータ。 +コンテナの末尾の次を参照するイテレータ。 `iterator` と `const_iterator` はいずれもメンバ型である。`multimap` クラステンプレートにおいて、これらは双方向イテレータである。 @@ -82,11 +82,11 @@ int main() ## 関連項目 | 名前 | 説明 | -|------------------------------------------------------------------------------------------------|--------------------------------------------------| -| [`multimap::begin`](/reference/map/multimap/begin.md) | 先頭を指すイテレータを取得する | -| [`multimap::cbegin`](/reference/map/multimap/cbegin.md) | 先頭を指すconstイテレータを取得する | -| [`multimap::cend`](/reference/map/multimap/cend.md) | 末尾を指すconstイテレータを取得する | -| [`multimap::rbegin`](/reference/map/multimap/rbegin.md) | 末尾を指す逆イテレータを取得する | -| [`multimap::rend`](/reference/map/multimap/rend.md) | 先頭を指す逆イテレータを取得する | -| [`multimap::crbegin`](/reference/map/multimap/crbegin.md) | 末尾を指す逆constイテレータを取得する | -| [`multimap::crend`](/reference/map/multimap/crend.md) | 先頭を指す逆constイテレータを取得する | +|-----------------------------------|-------------------------------------------| +| [`multimap::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`multimap::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`multimap::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`multimap::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | +| [`multimap::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`multimap::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | +| [`multimap::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | diff --git a/reference/map/multimap/rbegin.md b/reference/map/multimap/rbegin.md index ac65f4a05d..b19d19bbce 100644 --- a/reference/map/multimap/rbegin.md +++ b/reference/map/multimap/rbegin.md @@ -10,9 +10,9 @@ const_reverse_iterator rbegin() const noexcept; ``` ## 概要 -`multimap` コンテナ内の最後の要素を指す逆イテレータを返す。 -内部的に、`multimap` コンテナは各要素をキーの値に従って下位から上位へと並べており、従って `rbegin()` は最上位のキーにあたる値を返す。 -`rbegin()` は [`end()`](/reference/map/multimap/end.md) と同じ要素を指すわけではなく、その前の要素を指すことに注意。 +`multimap` コンテナ内の末尾を指す逆イテレータを取得する。 +内部的に、`multimap` コンテナは各要素をキーの値に従って下位から上位へと並べており、従って `rbegin()` は最上位のキーにあたる値をへのイテレータ返す。 +`rbegin()` は [`end()`](end.md) と同じ要素を指すわけではなく、その前の要素を指すことに注意。 ## 戻り値 @@ -67,12 +67,12 @@ int main() ## 関連項目 | 名前 | 説明 | ----------------------------------------------------------------------------------------------|--------------------------------------------------| -| [`multimap::begin`](/reference/map/multimap/begin.md) | 先頭を指すイテレータを取得する | -| [`multimap::end`](/reference/map/multimap/end.md) | 末尾を指すイテレータを取得する | -| [`multimap::cbegin`](/reference/map/multimap/cbegin.md) | 先頭を指すconstイテレータを取得する | -| [`multimap::cend`](/reference/map/multimap/cend.md) | 末尾を指すconstイテレータを取得する | -| [`multimap::rend`](/reference/map/multimap/rend.md) | 先頭を指す逆イテレータを取得する | -| [`multimap::crbegin`](/reference/map/multimap/crbegin.md) | 末尾を指す逆constイテレータを取得する | -| [`multimap::crend`](/reference/map/multimap/crend.md) | 先頭を指す逆constイテレータを取得する | +------------------------------------|-------------------------------------------| +| [`multimap::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`multimap::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`multimap::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`multimap::cend`](cend.md) | 末尾を指すconstイテレータを取得する | +| [`multimap::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`multimap::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | +| [`multimap::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | diff --git a/reference/map/multimap/rend.md b/reference/map/multimap/rend.md index 8bd6a71b28..b677d1e656 100644 --- a/reference/map/multimap/rend.md +++ b/reference/map/multimap/rend.md @@ -10,8 +10,8 @@ const_reverse_iterator rend() const noexcept; ``` ## 概要 -`multimap` コンテナの先頭要素の前(これは反転シーケンスの末尾にあたる)を指す逆イテレータを返す。 -`rend()` は [`begin()`](/reference/map/multimap/begin.md) と同じ要素を指すわけではなく、その前の要素を指すことに注意。 +`multimap` コンテナの先頭要素の前(これは反転シーケンスの末尾にあたる)を指す逆イテレータを取得する。 +`rend()` は [`begin()`](begin.md) と同じ要素を指すわけではなく、その前の要素を指すことに注意。 ## 戻り値 反転シーケンスの終端を指す逆イテレータ。 @@ -61,12 +61,12 @@ int main() ## 関連項目 | 名前 | 説明 | -|------------------------------------------------------------------------------------------------|--------------------------------------------| -| [`multimap::begin`](/reference/map/multimap/begin.md) | 先頭を指すイテレータを取得する | -| [`multimap::end`](/reference/map/multimap/end.md) | 末尾を指すイテレータを取得する | -| [`multimap::cbegin`](/reference/map/multimap/cbegin.md) | 先頭を指すconstイテレータを取得する | -| [`multimap::cend`](/reference/map/multimap/cend.md) | 末尾を指すconstイテレータを取得する | -| [`multimap::rbegin`](/reference/map/multimap/rbegin.md) | 末尾を指す逆イテレータを取得する | -| [`multimap::crbegin`](/reference/map/multimap/crbegin.md) | 末尾を指す逆constイテレータを取得する | -| [`multimap::crend`](/reference/map/multimap/crend.md) | 先頭を指す逆constイテレータを取得する | +|-----------------------------------|-------------------------------------------| +| [`multimap::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`multimap::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`multimap::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`multimap::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`multimap::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | +| [`multimap::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | +| [`multimap::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | diff --git a/reference/set/multiset.md b/reference/set/multiset.md index 36892db95a..b00dee1077 100644 --- a/reference/set/multiset.md +++ b/reference/set/multiset.md @@ -57,12 +57,12 @@ namespace std { |-------------------------------|----------------------------------------------|-------| | [`begin`](multiset/begin.md) | 先頭を指すイテレータを取得する | | | [`cbegin`](multiset/cbegin.md) | 先頭を指す読み取り専用イテレータを取得する | C++11 | -| [`end`](multiset/end.md) | 末尾を指すイテレータを取得する | | -| [`cend`](multiset/cend.md) | 末尾を指す読み取り専用イテレータを取得する | C++11 | +| [`end`](multiset/end.md) | 末尾の次を指すイテレータを取得する | | +| [`cend`](multiset/cend.md) | 末尾の次を指す読み取り専用イテレータを取得する | C++11 | | [`rbegin`](multiset/rbegin.md) | 末尾を指す逆イテレータを取得する | | | [`crbegin`](multiset/crbegin.md) | 末尾を指す読み取り専用逆イテレータを取得する | C++11 | -| [`rend`](multiset/rend.md) | 先頭を指す逆イテレータを取得する | | -| [`crend`](multiset/crend.md) | 先頭を指す読み取り専用逆イテレータを取得する | C++11 | +| [`rend`](multiset/rend.md) | 先頭の前を指す逆イテレータを取得する | | +| [`crend`](multiset/crend.md) | 先頭の前を指す読み取り専用逆イテレータを取得する | C++11 | ### 領域 diff --git a/reference/set/multiset/begin.md b/reference/set/multiset/begin.md index 344415f45c..0341799695 100644 --- a/reference/set/multiset/begin.md +++ b/reference/set/multiset/begin.md @@ -11,9 +11,9 @@ const_iterator begin() const noexcept; ## 概要 -`multiset` コンテナの先頭要素を参照するイテレータを返す。 +`multiset` コンテナの先頭要素を参照するイテレータを取得する。 -内部的に、`multiset`コンテナは要素を下位から上位へと並べており、従って `begin()` は `multiset` 内の最下位のキーにあたる値を返す。 +内部的に、`multiset`コンテナは要素を下位から上位へと並べており、従って `begin()` は `multiset` 内の最下位のキーにあたる値へのイテレータを返す。 ## 戻り値 @@ -67,6 +67,6 @@ int main() | 名前 | 説明 | |----------------------------|----------------------------------| -| [`multiset::end`](end.md) | 末尾を指すイテレータを取得する | +| [`multiset::end`](end.md) | 末尾の次を指すイテレータを取得する | | [`multiset::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | -| [`multiset::rend`](rend.md) | 先頭を指す逆イテレータを取得する | +| [`multiset::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | diff --git a/reference/set/multiset/cbegin.md b/reference/set/multiset/cbegin.md index 0a9b0ef5bb..9c95d81fd3 100644 --- a/reference/set/multiset/cbegin.md +++ b/reference/set/multiset/cbegin.md @@ -11,7 +11,7 @@ const_iterator cbegin() const noexcept; ## 概要 -`multiset` コンテナの先頭要素を参照する読み取り専用イテレータを返す。 +`multiset` コンテナの先頭要素を参照する読み取り専用イテレータを取得する。 ## 戻り値 @@ -52,7 +52,7 @@ int main() | 名前 | 説明 | |----------------------------|----------------------------------| -| [`multiset::cend`](cend.md) | 末尾を指す読み取り専用イテレータを取得する | +| [`multiset::cend`](cend.md) | 末尾の次を指す読み取り専用イテレータを取得する | | [`multuset::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | -| [`multiset::rend`](rend.md) | 先頭を指す逆イテレータを取得する | +| [`multiset::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | diff --git a/reference/set/multiset/cend.md b/reference/set/multiset/cend.md index 78807770ce..2d776a64a8 100644 --- a/reference/set/multiset/cend.md +++ b/reference/set/multiset/cend.md @@ -10,11 +10,11 @@ const_iterator cend() const noexcept; ``` ## 概要 -`multiset` コンテナの最後の要素の次を参照する読み取り専用イテレータを返す。 +`multiset` コンテナの末尾の次を参照する読み取り専用イテレータを取得する。 ## 戻り値 -コンテナの最後の要素の次を参照する読み取り専用イテレータ。 +コンテナの末尾の次を参照する読み取り専用イテレータ。 `const_iterator` はメンバ型である。`multiset` クラステンプレートにおいて、これは双方向イテレータである。 @@ -59,5 +59,5 @@ int main() |-------------------------|----------------------------------| | [`cbegin`](cbegin.md) | 先頭を指す読み取り専用イテレータを取得する | | [`rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | -| [`rend`](rend.md) | 先頭を指す逆イテレータを取得する | +| [`rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | diff --git a/reference/set/multiset/crbegin.md b/reference/set/multiset/crbegin.md index e2912cff79..f7d188d487 100644 --- a/reference/set/multiset/crbegin.md +++ b/reference/set/multiset/crbegin.md @@ -11,7 +11,7 @@ const_reverse_iterator crbegin() const noexcept; ## 概要 -`multiset` コンテナ内の最後の要素を指す、読み取り専用逆イテレータを返す。 +`multiset` コンテナ内の末尾の要素を指す、読み取り専用逆イテレータを取得する。 ## 戻り値 @@ -54,7 +54,7 @@ int main() | 名前 | 説明 | |-------------------------|----------------------------------| -| [`crend`](crend.md) | 先頭を指す読み取り専用逆イテレータを取得する | +| [`crend`](crend.md) | 先頭の前を指す読み取り専用逆イテレータを取得する | | [`cbegin`](cbegin.md) | 先頭を指す読み取り専用イテレータを取得する | -| [`cend`](cend.md) | 末尾を指す読み取り専用イテレータを取得する | +| [`cend`](cend.md) | 末尾の次を指す読み取り専用イテレータを取得する | diff --git a/reference/set/multiset/crend.md b/reference/set/multiset/crend.md index 7447f8f573..48973d85a6 100644 --- a/reference/set/multiset/crend.md +++ b/reference/set/multiset/crend.md @@ -11,7 +11,7 @@ const_reverse_iterator crend() const noexcept; ## 概要 -`multiset` コンテナの先頭要素の前(これは反転シーケンスの末尾にあたる)を指す読み取り専用逆イテレータを返す。 +`multiset` コンテナの先頭要素の前(これは反転シーケンスの末尾にあたる)を指す読み取り専用逆イテレータを取得する。 ## 戻り値 @@ -50,7 +50,7 @@ int main() | 名前 | 説明 | |-------------------------|------------------------------| -| [`crbegin`](rbegin.md) | 末尾を指す読み取り専用逆イテレータを返す | +| [`crbegin`](crbegin.md) | 末尾を指す読み取り専用逆イテレータを返す | | [`cbegin`](begin.md) | 先頭を指す読み取り専用イテレータを返す | -| [`cend`](end.md) | 末尾を指す読み取り専用イテレータを返す | +| [`cend`](end.md) | 末尾の次を指す読み取り専用イテレータを返す | diff --git a/reference/set/multiset/end.md b/reference/set/multiset/end.md index d11e9f9c56..6956b65857 100644 --- a/reference/set/multiset/end.md +++ b/reference/set/multiset/end.md @@ -10,11 +10,11 @@ const_iterator end() const noexcept; ``` ## 概要 -`multiset` コンテナの最後の要素の次を参照するイテレータを返す。 +`multiset` コンテナの末尾の次を参照するイテレータを取得する。 ## 戻り値 -コンテナの最後の要素の次を参照するイテレータ。 +コンテナの末尾の次を参照するイテレータ。 `iterator` と `const_iterator` はいずれもメンバ型である。`multiset` クラステンプレートにおいて、これらは双方向イテレータである。 @@ -70,5 +70,5 @@ int main() |-------------------------|----------------------------------| | [`begin`](begin.md) | 先頭を指すイテレータを取得する | | [`rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | -| [`rend`](rend.md) | 先頭を指す逆イテレータを取得する | +| [`rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | diff --git a/reference/set/multiset/rbegin.md b/reference/set/multiset/rbegin.md index 7c3433ef31..4220ad8eef 100644 --- a/reference/set/multiset/rbegin.md +++ b/reference/set/multiset/rbegin.md @@ -11,9 +11,9 @@ const_reverse_iterator rbegin() const noexcept; ## 概要 -`multiset` コンテナ内の最後の要素を指す逆イテレータを返す。 +`multiset` コンテナ内の末尾の要素を指す逆イテレータを取得する。 -内部的に、`multiset` コンテナは各要素を下位から上位へと並べており、従って `rbegin()` は最上位のキーにあたる値を返す。 +内部的に、`multiset` コンテナは各要素を下位から上位へと並べており、従って `rbegin()` は最上位のキーにあたる値へのイテレータを返す。 `rbegin()` は [`end()`](end.md) と同じ要素を指すわけではなく、その前の要素を指すことに注意。 @@ -63,7 +63,7 @@ int main() | 名前 | 説明 | |-----------------------|----------------------------------| -| [`rend`](rend.md) | 先頭を指す逆イテレータを取得する | +| [`rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`begin`](begin.md) | 先頭を指すイテレータを取得する | -| [`end`](end.md) | 末尾を指すイテレータを取得する | +| [`end`](end.md) | 末尾の次を指すイテレータを取得する | diff --git a/reference/set/multiset/rend.md b/reference/set/multiset/rend.md index 6ebfb9cc40..c8ea58d0c5 100644 --- a/reference/set/multiset/rend.md +++ b/reference/set/multiset/rend.md @@ -11,7 +11,7 @@ const_reverse_iterator rend() const noexcept; ## 概要 -`multiset` コンテナの先頭要素の前(これは反転シーケンスの末尾にあたる)を指す逆イテレータを返す。 +`multiset` コンテナの先頭要素の前(これは反転シーケンスの末尾にあたる)を指す逆イテレータを取得する。 `rend()` は [`begin()`](begin.md) と同じ要素を指すわけではなく、その前の要素を指すことに注意。 @@ -59,4 +59,4 @@ int main() |-------------------------|------------------------------| | [`rbegin`](rbegin.md) | 末尾を指す逆イテレータを返す | | [`begin`](begin.md) | 先頭を指すイテレータを返す | -| [`end`](end.md) | 末尾を指すイテレータを返す | +| [`end`](end.md) | 末尾の次を指すイテレータを返す | diff --git a/reference/set/set.md b/reference/set/set.md index 2b94af98de..eda67be00a 100644 --- a/reference/set/set.md +++ b/reference/set/set.md @@ -58,12 +58,12 @@ namespace std { |-------------------------------|----------------------------------------------|-------| | [`begin`](set/begin.md) | 先頭を指すイテレータを取得する | | | [`cbegin`](set/cbegin.md) | 先頭を指す読み取り専用イテレータを取得する | C++11 | -| [`end`](set/end.md) | 末尾を指すイテレータを取得する | | -| [`cend`](set/cend.md) | 末尾を指す読み取り専用イテレータを取得する | C++11 | +| [`end`](set/end.md) | 末尾の次を指すイテレータを取得する | | +| [`cend`](set/cend.md) | 末尾の次を指す読み取り専用イテレータを取得する | C++11 | | [`rbegin`](set/rbegin.md) | 末尾を指す逆イテレータを取得する | | | [`crbegin`](set/crbegin.md) | 末尾を指す読み取り専用逆イテレータを取得する | C++11 | -| [`rend`](set/rend.md) | 先頭を指す逆イテレータを取得する | | -| [`crend`](set/crend.md) | 先頭を指す読み取り専用逆イテレータを取得する | C++11 | +| [`rend`](set/rend.md) | 先頭の前を指す逆イテレータを取得する | | +| [`crend`](set/crend.md) | 先頭の前を指す読み取り専用逆イテレータを取得する | C++11 | ### 領域 diff --git a/reference/set/set/begin.md b/reference/set/set/begin.md index 8d7b34c8da..dcf55187cb 100644 --- a/reference/set/set/begin.md +++ b/reference/set/set/begin.md @@ -11,9 +11,9 @@ const_iterator begin() const noexcept; ## 概要 -`set` コンテナの先頭要素を参照するイテレータを返す。 +`set` コンテナの先頭要素を参照するイテレータを取得する。 -内部的に、`set`コンテナは要素を下位から上位へと並べており、従って `begin()` は `set` 内の最下位のキーにあたる値を返す。 +内部的に、`set`コンテナは要素を下位から上位へと並べており、従って `begin()` は `set` 内の最下位のキーにあたる値へのイテレータを返す。 ## 戻り値 @@ -67,6 +67,6 @@ int main() | 名前 | 説明 | |----------------------------|----------------------------------| -| [`set::end`](end.md) | 末尾を指すイテレータを取得する | +| [`set::end`](end.md) | 末尾の次を指すイテレータを取得する | | [`set::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | -| [`set::rend`](rend.md) | 先頭を指す逆イテレータを取得する | +| [`set::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | diff --git a/reference/set/set/cbegin.md b/reference/set/set/cbegin.md index 4a5252d056..f330017494 100644 --- a/reference/set/set/cbegin.md +++ b/reference/set/set/cbegin.md @@ -11,7 +11,7 @@ const_iterator cbegin() const noexcept; ## 概要 -`set` コンテナの先頭要素を参照する読み取り専用イテレータを返す。 +`set` コンテナの先頭要素を参照する読み取り専用イテレータを取得する。 ## 戻り値 @@ -52,7 +52,7 @@ int main() | 名前 | 説明 | |----------------------------|----------------------------------| -| [`set::cend`](cend.md) | 末尾を指す読み取り専用イテレータを取得する | +| [`set::cend`](cend.md) | 末尾の次を指す読み取り専用イテレータを取得する | | [`set::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | -| [`set::rend`](rend.md) | 先頭を指す逆イテレータを取得する | +| [`set::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | diff --git a/reference/set/set/cend.md b/reference/set/set/cend.md index d80cbb7cb5..0e9bed668f 100644 --- a/reference/set/set/cend.md +++ b/reference/set/set/cend.md @@ -10,11 +10,11 @@ const_iterator cend() const noexcept; ``` ## 概要 -`set` コンテナの最後の要素の次を参照する読み取り専用イテレータを返す。 +`set` コンテナの末尾の次を参照する読み取り専用イテレータを取得する。 ## 戻り値 -コンテナの最後の要素の次を参照する読み取り専用イテレータ。 +コンテナの末尾の次を参照する読み取り専用イテレータ。 `const_iterator` はメンバ型である。`set` クラステンプレートにおいて、これは双方向イテレータである。 @@ -59,5 +59,5 @@ int main() |-------------------------|----------------------------------| | [`cbegin`](cbegin.md) | 先頭を指す読み取り専用イテレータを取得する | | [`rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | -| [`rend`](rend.md) | 先頭を指す逆イテレータを取得する | +| [`rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | diff --git a/reference/set/set/crbegin.md b/reference/set/set/crbegin.md index 2760394b73..fc1825d950 100644 --- a/reference/set/set/crbegin.md +++ b/reference/set/set/crbegin.md @@ -11,7 +11,7 @@ const_reverse_iterator crbegin() const noexcept; ## 概要 -`set` コンテナ内の最後の要素を指す、読み取り専用逆イテレータを返す。 +`set` コンテナ内の末尾の要素を指す、読み取り専用逆イテレータを取得する。 ## 戻り値 @@ -54,7 +54,7 @@ int main() | 名前 | 説明 | |-------------------------|----------------------------------| -| [`crend`](crend.md) | 先頭を指す読み取り専用逆イテレータを取得する | +| [`crend`](crend.md) | 先頭の前を指す読み取り専用逆イテレータを取得する | | [`cbegin`](cbegin.md) | 先頭を指す読み取り専用イテレータを取得する | -| [`cend`](cend.md) | 末尾を指す読み取り専用イテレータを取得する | +| [`cend`](cend.md) | 末尾の次を指す読み取り専用イテレータを取得する | diff --git a/reference/set/set/crend.md b/reference/set/set/crend.md index a6043a6796..ebf206350a 100644 --- a/reference/set/set/crend.md +++ b/reference/set/set/crend.md @@ -11,7 +11,7 @@ const_reverse_iterator crend() const noexcept; ## 概要 -`set` コンテナの先頭要素の前(これは反転シーケンスの末尾にあたる)を指す読み取り専用逆イテレータを返す。 +`set` コンテナの先頭要素の前(これは反転シーケンスの末尾にあたる)を指す読み取り専用逆イテレータを取得する。 ## 戻り値 @@ -52,5 +52,5 @@ int main() |-------------------------|------------------------------| | [`crbegin`](rbegin.md) | 末尾を指す読み取り専用逆イテレータを返す | | [`cbegin`](begin.md) | 先頭を指す読み取り専用イテレータを返す | -| [`cend`](end.md) | 末尾を指す読み取り専用イテレータを返す | +| [`cend`](end.md) | 末尾の次を指す読み取り専用イテレータを返す | diff --git a/reference/set/set/end.md b/reference/set/set/end.md index 91d7284084..66aab63baf 100644 --- a/reference/set/set/end.md +++ b/reference/set/set/end.md @@ -10,11 +10,11 @@ const_iterator end() const noexcept; ``` ## 概要 -`set` コンテナの最後の要素の次を参照するイテレータを返す。 +`set` コンテナの末尾の次を参照するイテレータを取得する。 ## 戻り値 -コンテナの最後の要素の次を参照するイテレータ。 +コンテナの末尾の次を参照するイテレータ。 `iterator` と `const_iterator` はいずれもメンバ型である。`set` クラステンプレートにおいて、これらは双方向イテレータである。 @@ -70,5 +70,5 @@ int main() |-------------------------|----------------------------------| | [`begin`](begin.md) | 先頭を指すイテレータを取得する | | [`rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | -| [`rend`](rend.md) | 先頭を指す逆イテレータを取得する | +| [`rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | diff --git a/reference/set/set/rbegin.md b/reference/set/set/rbegin.md index 0ee8c2961b..27a33219a4 100644 --- a/reference/set/set/rbegin.md +++ b/reference/set/set/rbegin.md @@ -11,9 +11,9 @@ const_reverse_iterator rbegin() const noexcept; ## 概要 -`set` コンテナ内の最後の要素を指す逆イテレータを返す。 +`set` コンテナ内の末尾の要素を指す逆イテレータを取得する。 -内部的に、`set` コンテナは各要素を下位から上位へと並べており、従って `rbegin()` は最上位のキーにあたる値を返す。 +内部的に、`set` コンテナは各要素を下位から上位へと並べており、従って `rbegin()` は最上位のキーにあたる値を指すイテレータを返す。 `rbegin()` は [`end()`](end.md) と同じ要素を指すわけではなく、その前の要素を指すことに注意。 @@ -63,7 +63,7 @@ int main() | 名前 | 説明 | |-----------------------|----------------------------------| -| [`rend`](rend.md) | 先頭を指す逆イテレータを取得する | +| [`rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`begin`](begin.md) | 先頭を指すイテレータを取得する | -| [`end`](end.md) | 末尾を指すイテレータを取得する | +| [`end`](end.md) | 末尾の次を指すイテレータを取得する | diff --git a/reference/set/set/rend.md b/reference/set/set/rend.md index b0560212b2..ffdbe061c5 100644 --- a/reference/set/set/rend.md +++ b/reference/set/set/rend.md @@ -11,7 +11,7 @@ const_reverse_iterator rend() const noexcept; ## 概要 -`set` コンテナの先頭要素の前(これは反転シーケンスの末尾にあたる)を指す逆イテレータを返す。 +`set` コンテナの先頭要素の前(これは反転シーケンスの末尾にあたる)を指す逆イテレータを取得する。 `rend()` は [`begin()`](begin.md) と同じ要素を指すわけではなく、その前の要素を指すことに注意。 @@ -59,4 +59,4 @@ int main() |-------------------------|------------------------------| | [`rbegin`](rbegin.md) | 末尾を指す逆イテレータを返す | | [`begin`](begin.md) | 先頭を指すイテレータを返す | -| [`end`](end.md) | 末尾を指すイテレータを返す | +| [`end`](end.md) | 末尾の次を指すイテレータを返す | From 0376f471268c8f124984b4911a40bf6dec84eefc Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 14 Jun 2023 18:17:25 +0900 Subject: [PATCH 0349/3948] =?UTF-8?q?flat=5Fmap=20:=20begin,=20end?= =?UTF-8?q?=E7=B3=BB=E3=82=92=E8=BF=BD=E5=8A=A0=20#1078?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map.md | 26 +++--- reference/flat_map/flat_map/begin.md | 88 +++++++++++++++++++++ reference/flat_map/flat_map/cbegin.md | 83 +++++++++++++++++++ reference/flat_map/flat_map/cend.md | 86 ++++++++++++++++++++ reference/flat_map/flat_map/contains.md | 2 +- reference/flat_map/flat_map/crbegin.md | 78 ++++++++++++++++++ reference/flat_map/flat_map/crend.md | 76 ++++++++++++++++++ reference/flat_map/flat_map/emplace_hint.md | 2 +- reference/flat_map/flat_map/end.md | 87 ++++++++++++++++++++ reference/flat_map/flat_map/find.md | 4 +- reference/flat_map/flat_map/rbegin.md | 82 +++++++++++++++++++ reference/flat_map/flat_map/rend.md | 75 ++++++++++++++++++ 12 files changed, 672 insertions(+), 17 deletions(-) create mode 100644 reference/flat_map/flat_map/begin.md create mode 100644 reference/flat_map/flat_map/cbegin.md create mode 100644 reference/flat_map/flat_map/cend.md create mode 100644 reference/flat_map/flat_map/crbegin.md create mode 100644 reference/flat_map/flat_map/crend.md create mode 100644 reference/flat_map/flat_map/end.md create mode 100644 reference/flat_map/flat_map/rbegin.md create mode 100644 reference/flat_map/flat_map/rend.md diff --git a/reference/flat_map/flat_map.md b/reference/flat_map/flat_map.md index 779e4536b3..c699ae3a39 100644 --- a/reference/flat_map/flat_map.md +++ b/reference/flat_map/flat_map.md @@ -33,15 +33,15 @@ namespace std { ### イテレータ | 名前 | 説明 | 対応バージョン | -|------------------------------|----------------------------------------------|-------| -| [`begin`](flat_map/begin.md.nolink) | 先頭を指すイテレータを取得する | C++23 | -| [`cbegin`](flat_map/cbegin.md.nolink) | 先頭を指す読み取り専用イテレータを取得する | C++23 | -| [`end`](flat_map/end.md.nolink) | 末尾を指すイテレータを取得する | C++23 | -| [`cend`](flat_map/cend.md.nolink) | 末尾を指す読み取り専用イテレータを取得する | C++23 | -| [`rbegin`](flat_map/rbegin.md.nolink) | 末尾を指す逆イテレータを取得する | C++23 | -| [`crbegin`](flat_map/crbegin.md.nolink) | 末尾を指す読み取り専用逆イテレータを取得する | C++23 | -| [`rend`](flat_map/rend.md.nolink) | 先頭を指す逆イテレータを取得する | C++23 | -| [`crend`](flat_map/crend.md.nolink) | 先頭を指す読み取り専用逆イテレータを取得する | C++23 | +|----------------------------------|--------------------------------------------------|-------| +| [`begin`](flat_map/begin.md) | 先頭を指すイテレータを取得する | C++23 | +| [`cbegin`](flat_map/cbegin.md) | 先頭を指す読み取り専用イテレータを取得する | C++23 | +| [`end`](flat_map/end.md) | 末尾の次を指すイテレータを取得する | C++23 | +| [`cend`](flat_map/cend.md) | 末尾の次を指す読み取り専用イテレータを取得する | C++23 | +| [`rbegin`](flat_map/rbegin.md) | 末尾を指す逆イテレータを取得する | C++23 | +| [`crbegin`](flat_map/crbegin.md) | 末尾を指す読み取り専用逆イテレータを取得する | C++23 | +| [`rend`](flat_map/rend.md) | 先頭の前を指す逆イテレータを取得する | C++23 | +| [`crend`](flat_map/crend.md) | 先頭の前を指す読み取り専用逆イテレータを取得する | C++23 | ### 領域 @@ -106,10 +106,10 @@ namespace std { | `const_reference` | 要素への`const`参照型。[`std::pair`](/reference/utility/pair.md)`` | C++23 | | `size_type` | 要素数を表す符号なし整数型 [`size_t`](/reference/cstddef/size_t.md) | C++23 | | `difference_type` | 同一のコンテナを指す `iterator` の差を表す符号付き整数型 [`ptrdiff_t`](/reference/cstddef/ptrdiff_t.md) | C++23 | -| `iterator` | 双方向イテレータ | C++23 | -| `const_iterator` | 読み取り専用双方向イテレータ | C++23 | -| `reverse_iterator` | 逆順双方向イテレータ。[`std::reverse_iterator`](/reference/iterator/reverse_iterator.md)`` | C++23 | -| `const_reverse_iterator` | 読み取り専用逆順双方向イテレータ。[`std::reverse_iterator`](/reference/iterator/reverse_iterator.md)`` | C++23 | +| `iterator` | ランダムアクセスイテレータ | C++23 | +| `const_iterator` | 読み取り専用ランダムアクセスイテレータ | C++23 | +| `reverse_iterator` | 逆順ランダムアクセスイテレータ。[`std::reverse_iterator`](/reference/iterator/reverse_iterator.md)`` | C++23 | +| `const_reverse_iterator` | 読み取り専用逆順ランダムアクセスイテレータ。[`std::reverse_iterator`](/reference/iterator/reverse_iterator.md)`` | C++23 | | `key_container_type` | キーを格納するコンテナ型 `KeyContainer` | C++23 | | `mapped_container_type` | 値を格納するコンテナ型 `MappedContainer` | C++23 | | [`containers`](flat_map/containers.md) | キーのコンテナと値のコンテナを保持する型 | C++23 | diff --git a/reference/flat_map/flat_map/begin.md b/reference/flat_map/flat_map/begin.md new file mode 100644 index 0000000000..53f04ff970 --- /dev/null +++ b/reference/flat_map/flat_map/begin.md @@ -0,0 +1,88 @@ +# begin +* flat_map[meta header] +* std[meta namespace] +* flat_map[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +iterator begin() noexcept; +const_iterator begin() const noexcept; +``` + + +## 概要 +コンテナの先頭のキーと要素のpairを参照するイテレータを取得する。 + +内部的に、コンテナは要素を下位から上位へと並べており、従って`begin()`はコンテナ内の最下位のキーにあたるpairへのイテレータを返す。 + + +## 戻り値 +コンテナの先頭要素へのイテレータ。 +`iterator` と `const_iterator` はともにメンバ型である。このクラステンプレートにおいて、これらはランダムアクセスイテレータである。 + + +## 計算量 +定数時間。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_map fm; + fm[3] = 'C'; + fm[7] = 'G'; + fm[8] = 'H'; + fm[4] = 'D'; + fm[5] = 'E'; + fm[1] = 'A'; + fm[2] = 'B'; + fm[6] = 'F'; + + for (auto i = fm.begin(); i != fm.end(); ++i) { + std::cout << i->first << " " << i->second << "\n"; + } +} +``` +* begin()[color ff0000] +* fm.end()[link end.md] + +### 出力 +``` +1 A +2 B +3 C +4 D +5 E +6 F +7 G +8 H +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|-----------------------------------|--------------------------------| +| [`flat_map::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`flat_map::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`flat_map::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`flat_map::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | +| [`flat_map::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`flat_map::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | +| [`flat_map::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + diff --git a/reference/flat_map/flat_map/cbegin.md b/reference/flat_map/flat_map/cbegin.md new file mode 100644 index 0000000000..b128c228b2 --- /dev/null +++ b/reference/flat_map/flat_map/cbegin.md @@ -0,0 +1,83 @@ +# cbegin +* flat_map[meta header] +* std[meta namespace] +* flat_map[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +const_iterator cbegin() const noexcept; +``` + + +## 概要 +コンテナの先頭のキーと要素のpairを参照するイテレータを取得する。 + +内部的に、このコンテナは要素を下位から上位へと並べており、従って `cbegin()` はコンテナ内の最下位のキーにあたるpairへのイテレータを返す。 + + +## 戻り値 +コンテナの先頭要素へのイテレータ。 +`const_iterator` はメンバ型である。このクラステンプレートにおいて、これらはランダムアクセスイテレータである。 + + +## 計算量 +定数時間。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_map fm; + fm[3] = 'C'; + fm[7] = 'G'; + fm[8] = 'H'; + fm[4] = 'D'; + fm[5] = 'E'; + fm[1] = 'A'; + fm[2] = 'B'; + fm[6] = 'F'; + + for (auto i = fm.cbegin(); i != fm.cend(); ++i) { + std::cout << i->first << " " << i->second << "\n"; + } +} +``` +* cbegin()[color ff0000] +* fm.cend()[link cend.md] + +### 出力 +``` +1 A +2 B +3 C +4 D +5 E +6 F +7 G +8 H +``` + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|-----------------------------------|--------------------------------| +| [`flat_map::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`flat_map::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`flat_map::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`flat_map::rbegin`]rbegin.md) | 末尾を指す逆イテレータを取得する | +| [`flat_map::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`flat_map::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | +| [`flat_map::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + diff --git a/reference/flat_map/flat_map/cend.md b/reference/flat_map/flat_map/cend.md new file mode 100644 index 0000000000..ff0377cb5e --- /dev/null +++ b/reference/flat_map/flat_map/cend.md @@ -0,0 +1,86 @@ +# cend +* flat_map[meta header] +* std[meta namespace] +* flat_map[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +const_iterator cend() const noexcept; +``` + +## 概要 +コンテナの末尾の次を参照するイテレータを取得する。 + + +## 戻り値 +コンテナの末尾の次を参照するイテレータ。 +`const_iterator` はいずれもメンバ型である。このクラステンプレートにおいて、これらはランダムアクセスイテレータである。 + + +## 計算量 +定数時間 + + +## 備考 +- この関数によって返されるイテレータは、`*this`が保持するいずれの要素も参照しない。その指す先は、不正な範囲となるだろう + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_map fm; + fm[3] = 'C'; + fm[7] = 'G'; + fm[8] = 'H'; + fm[4] = 'D'; + fm[5] = 'E'; + fm[1] = 'A'; + fm[2] = 'B'; + fm[6] = 'F'; + + for (auto i = fm.cbegin(); i != fm.cend(); ++i) { + std::cout << i->first << " " << i->second << "\n"; + } +} +``` +* cend()[color ff0000] +* fm.cbegin()[link cbegin.md] + +### 出力 +``` +1 A +2 B +3 C +4 D +5 E +6 F +7 G +8 H +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 関連項目 + +| 名前 | 説明 | +|------------------------------|-------------------------------------------| +| [`flat_map::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`flat_map::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`flat_map::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`flat_map::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | +| [`flat_map::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`flat_map::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | +| [`flat_map::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + diff --git a/reference/flat_map/flat_map/contains.md b/reference/flat_map/flat_map/contains.md index 8f2f27ae03..93009ba932 100644 --- a/reference/flat_map/flat_map/contains.md +++ b/reference/flat_map/flat_map/contains.md @@ -31,7 +31,7 @@ bool contains(const K& x) const; // (2) C++23 return find(x) != end(); ``` * find[link find.md] -* end()[link end.md.nolink] +* end()[link end.md] ## 計算量 diff --git a/reference/flat_map/flat_map/crbegin.md b/reference/flat_map/flat_map/crbegin.md new file mode 100644 index 0000000000..a1d900a901 --- /dev/null +++ b/reference/flat_map/flat_map/crbegin.md @@ -0,0 +1,78 @@ +# crbegin +* flat_map[meta header] +* std[meta namespace] +* flat_map[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +const_reverse_iterator crbegin() const noexcept; +``` + +## 概要 +コンテナ内の末尾を指す逆イテレータを取得する。 +内部的に、このコンテナは各要素をキーの値に従って下位から上位へと並べており、従って `crbegin()` は最上位のキーにあたる値へのイテレータを返す。 +`crbegin()` は [`end()`](end.md) と同じ要素を指すわけではなく、その前の要素を指すことに注意。 + + +## 戻り値 +反転したシーケンスの先頭を指す逆イテレータ。 +`const_reverse_iterator` はメンバ型である。このクラステンプレートにおいて、これらは逆ランダムアクセスイテレータであり、`reverse_iterator` と定義される。 + + +## 計算量 +定数時間。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_map fm { + {5, 'e'}, + {2, 'b'}, + {4, 'd'}, + {1, 'a'}, + {1, 'a'} + }; + + std::flat_map::const_reverse_iterator i = fm.crbegin(); + for (; i != fm.crend() ; ++i) { + std::cout << i->first << " " << i->second << std::endl; + } +} +``` +* crbegin()[color ff0000] +* fm.crend()[link crend.md] + +### 出力 +``` +5 e +4 d +2 b +1 a +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +| 名前 | 説明 | +-----------------------------|-------------------------------------------| +| [`flat_map::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`flat_map::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`flat_map::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`flat_map::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`flat_map::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | +| [`flat_map::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`flat_map::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | diff --git a/reference/flat_map/flat_map/crend.md b/reference/flat_map/flat_map/crend.md new file mode 100644 index 0000000000..ed608420b3 --- /dev/null +++ b/reference/flat_map/flat_map/crend.md @@ -0,0 +1,76 @@ +# crend +* flat_map[meta header] +* std[meta namespace] +* flat_map[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +const_reverse_iterator crend() const noexcept; +``` + + +## 概要 +コンテナの先頭要素の前(これは反転シーケンスの末尾にあたる)を指す逆イテレータを取得する。 +`crend()` は [`begin()`](begin.md) と同じ要素を指すわけではなく、その前の要素を指すことに注意。 + + +## 戻り値 +反転シーケンスの終端を指す逆イテレータ。 +`const_reverse_iterator` はメンバ型である。`map` クラステンプレートにおいて、これらは逆ランダムアクセスイテレータであり、`reverse_iterator` と定義される。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_map fm { + {5, 'e'}, + {2, 'b'}, + {4, 'd'}, + {1, 'a'}, + {1, 'a'} + }; + + std::flat_map::const_reverse_iterator i = fm.crbegin(); + for (; i != fm.crend() ; ++i) { + std::cout << i->first << " " << i->second << std::endl; + } +} +``` +* crend()[color ff0000] +* fm.crbegin()[link crbegin.md] + +### 出力 +``` +5 e +4 d +2 b +1 a +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + + +## 関連項目 + +| 名前 | 説明 | +|------------------------------|-----------------------------------------| +| [`flat_map::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`flat_map::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`flat_map::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`flat_map::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`flat_map::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | +| [`flat_map::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`flat_map::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | diff --git a/reference/flat_map/flat_map/emplace_hint.md b/reference/flat_map/flat_map/emplace_hint.md index 113abdf276..c9516eae49 100644 --- a/reference/flat_map/flat_map/emplace_hint.md +++ b/reference/flat_map/flat_map/emplace_hint.md @@ -52,7 +52,7 @@ int main() ``` * emplace_hint[color ff0000] * fm.emplace[link emplace.md] -* fm.end()[link end.md.nolink] +* fm.end()[link end.md] ### 出力 ``` diff --git a/reference/flat_map/flat_map/end.md b/reference/flat_map/flat_map/end.md new file mode 100644 index 0000000000..a892c0acc1 --- /dev/null +++ b/reference/flat_map/flat_map/end.md @@ -0,0 +1,87 @@ +# end +* flat_map[meta header] +* std[meta namespace] +* flat_map[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +iterator end() noexcept; +const_iterator end() const noexcept; +``` + +## 概要 +コンテナの末尾の次を参照するイテレータを取得する。 + + +## 戻り値 +コンテナの最後の要素の次を参照するイテレータ。 +`iterator` と `const_iterator` はいずれもメンバ型である。`map` クラステンプレートにおいて、これらはランダムアクセスイテレータである。 + + +## 計算量 +定数時間 + + +## 備考 +- この関数によって返されるイテレータは、`*this`が保持するいずれの要素も参照しない。その指す先は、不正な範囲となるだろう + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_map fm; + fm[3] = 'C'; + fm[7] = 'G'; + fm[8] = 'H'; + fm[4] = 'D'; + fm[5] = 'E'; + fm[1] = 'A'; + fm[2] = 'B'; + fm[6] = 'F'; + + for (auto i = fm.begin(); i != fm.end(); ++i) { + std::cout << i->first << " " << i->second << "\n"; + } +} +``` +* end()[color ff0000] +* fm.begin()[link begin.md] + +### 出力 +``` +1 A +2 B +3 C +4 D +5 E +6 F +7 G +8 H +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|-----------------------------------|-------------------------------------------| +| [`flat_map::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`flat_map::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`flat_map::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`flat_map::rbegin`](rbegin.md) | 末尾の次を指す逆イテレータを取得する | +| [`flat_map::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`flat_map::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | +| [`flat_map::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | diff --git a/reference/flat_map/flat_map/find.md b/reference/flat_map/flat_map/find.md index 820727e597..5dcb21d11a 100644 --- a/reference/flat_map/flat_map/find.md +++ b/reference/flat_map/flat_map/find.md @@ -29,8 +29,8 @@ const_iterator find(const K& x) const; // (4) C++23 ## 戻り値 -- (1), (3) : `x`と等価なキーの要素が見つかった場合は、見つかった要素へのイテレータを返す。そうでない場合は、 [`end()`](end.md.nolink) を返す。 -- (2), (4) : `key_compare`型の関数オブジェクトを`c`、コンテナ内の各要素が持つキーを`k`として、キーが等価か判定する式`!c(k, x) && !c(x, k)`が`true`となる要素へのイテレータを返す。そのような要素がない場合は、[`end()`](end.md.nolink) を返す。 +- (1), (3) : `x`と等価なキーの要素が見つかった場合は、見つかった要素へのイテレータを返す。そうでない場合は、 [`end()`](end.md) を返す。 +- (2), (4) : `key_compare`型の関数オブジェクトを`c`、コンテナ内の各要素が持つキーを`k`として、キーが等価か判定する式`!c(k, x) && !c(x, k)`が`true`となる要素へのイテレータを返す。そのような要素がない場合は、[`end()`](end.md) を返す。 ## 計算量 diff --git a/reference/flat_map/flat_map/rbegin.md b/reference/flat_map/flat_map/rbegin.md new file mode 100644 index 0000000000..983534d7a8 --- /dev/null +++ b/reference/flat_map/flat_map/rbegin.md @@ -0,0 +1,82 @@ +# rbegin +* flat_map[meta header] +* std[meta namespace] +* flat_map[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +reverse_iterator rbegin() noexcept; +const_reverse_iterator rbegin() const noexcept; +``` + +## 概要 +コンテナ内の末尾を指す逆イテレータを取得する。 + +内部的に、このコンテナは各要素をキーの値に従って下位から上位へと並べており、従って `rbegin()` は最上位のキーにあたる値を指すイテレータを返す。 +`rbegin()` は [`end()`](end.md) と同じ要素を指すわけではなく、その前の要素を指すことに注意。 + + +## 戻り値 +反転したシーケンスの先頭を指す逆イテレータ。 +`reverse_iterator` と `const_reverse_iterator` はともにメンバ型である。このクラステンプレートにおいて、これらは逆ランダムアクセスイテレータであり、それぞれ `reverse_iterator`, `reverse_iterator` と定義される。 + + +## 計算量 +定数時間。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_map fm { + {5, 'e'}, + {2, 'b'}, + {4, 'd'}, + {1, 'a'}, + {1, 'a'} + }; + + std::flat_map::reverse_iterator i = fm.rbegin(); + for (; i != fm.rend() ; ++i) { + std::cout << i->first << " " << i->second << std::endl; + } +} +``` +* rbegin()[color ff0000] +* fm.rend()[link rend.md] + +### 出力 +``` +5 e +4 d +2 b +1 a +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +-------------------------------|-----------------------------------------| +| [`flat_map::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`flat_map::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`flat_map::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`flat_map::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`flat_map::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`flat_map::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | +| [`flat_map::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + diff --git a/reference/flat_map/flat_map/rend.md b/reference/flat_map/flat_map/rend.md new file mode 100644 index 0000000000..206000a683 --- /dev/null +++ b/reference/flat_map/flat_map/rend.md @@ -0,0 +1,75 @@ +# rend +* flat_map[meta header] +* std[meta namespace] +* flat_map[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +reverse_iterator rend() noexcept; +const_reverse_iterator rend() const noexcept; +``` + +## 概要 +コンテナの先頭要素の前(これは反転シーケンスの末尾にあたる)を指す逆イテレータを取得する。 +`rend()` は [`begin()`](begin.md) と同じ要素を指すわけではなく、その前の要素を指すことに注意。 + +## 戻り値 +反転シーケンスの終端を指す逆イテレータ。 +`reverse_iterator` と `const_reverse_iterator` はメンバ型である。このクラステンプレートにおいて、これらは逆ランダムアクセスイテレータであり、それぞれ `reverse_iterator`, `reverse_iterator` と定義される。 + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_map fm { + {5, 'e'}, + {2, 'b'}, + {4, 'd'}, + {1, 'a'}, + {1, 'a'} + }; + + std::flat_map::reverse_iterator i = fm.rbegin(); + for (; i != fm.rend() ; ++i) { + std::cout << i->first << " " << i->second << std::endl; + } +} +``` +* rend()[color ff0000] +* fm.rbegin()[link rbegin.md] + +### 出力 +``` +5 e +4 d +2 b +1 a +``` + +## バージョン +### 言語 +- C++23 + + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|------------------------------|--------------------------------------------| +| [`flat_map::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`flat_map::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`flat_map::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`flat_map::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`flat_map::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | +| [`flat_map::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | +| [`flat_map::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + From 5af768ad072b6415b1ed2d271af3f11270eaf5da Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 14 Jun 2023 18:24:04 +0900 Subject: [PATCH 0350/3948] =?UTF-8?q?C++20=20constinit=20:=20mutex/unique?= =?UTF-8?q?=5Fptr=E3=81=AE=E3=82=B3=E3=83=B3=E3=82=B9=E3=83=88=E3=83=A9?= =?UTF-8?q?=E3=82=AF=E3=82=BF=E3=81=A8=E7=9B=B8=E4=BA=92=E3=83=AA=E3=83=B3?= =?UTF-8?q?=E3=82=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp20/constinit.md | 3 +++ reference/memory/unique_ptr/op_constructor.md | 4 ++++ reference/mutex/mutex/op_constructor.md | 6 +++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lang/cpp20/constinit.md b/lang/cpp20/constinit.md index 8d9a370fab..343186f49a 100644 --- a/lang/cpp20/constinit.md +++ b/lang/cpp20/constinit.md @@ -196,6 +196,9 @@ int main() {} ## 関連項目 - [C++11 `constexpr`](/lang/cpp11/constexpr.md) +- [`mutex`のコンストラクタ](/reference/mutex/mutex/op_constructor.md) +- [`unique_ptr`のコンストラクタ](/reference/memory/unique_ptr/op_constructor.md) + ## 参照 diff --git a/reference/memory/unique_ptr/op_constructor.md b/reference/memory/unique_ptr/op_constructor.md index 6a6820ebf0..58e858b2a9 100644 --- a/reference/memory/unique_ptr/op_constructor.md +++ b/reference/memory/unique_ptr/op_constructor.md @@ -167,6 +167,10 @@ int main() - 2012までは、delete宣言に対応していないため、代わりにprivateで宣言のみ行う手法で代用されている。 +## 関連項目 +- [C++20 コンパイル時初期化を強制する`constinit`キーワードを追加](/lang/cpp20/constinit.md) + + ## 参照 - [N2435 Explicit bool for Smart Pointers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2435.htm) - (6)の経緯となる提案文書 diff --git a/reference/mutex/mutex/op_constructor.md b/reference/mutex/mutex/op_constructor.md index 5067466c2b..a725c6695e 100644 --- a/reference/mutex/mutex/op_constructor.md +++ b/reference/mutex/mutex/op_constructor.md @@ -10,7 +10,7 @@ constexpr mutex() noexcept; // (1) mutex(const mutex&) = delete; // (2) ``` -## mutexオブジェクトの構築 +## 概要 - (1) : デフォルトコンストラクタ。`mutex`オブジェクトの初期化を行う。 - (2) : コピーコンストラクタ。コピー不可。 @@ -106,6 +106,10 @@ A - 2012はコピーコンストラクタのdeleteに対応していないため、代わりにprivateで宣言のみ行う手法で代用されている。 +## 関連項目 +- [C++20 コンパイル時初期化を強制する`constinit`キーワードを追加](/lang/cpp20/constinit.md) + + ## 参照 - [Constant Initialization - 雑貨's tumblr](https://zakkas783-blog-blog.tumblr.com/post/25490513807/constant-initialization) - [mutexのconstexprコンストラクタ - yohhoyの日記](http://d.hatena.ne.jp/yohhoy/20120621/p1) From c46ebf4afd42816c9a9f10d04d668e336cfea25e Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Thu, 15 Jun 2023 15:37:52 +0900 Subject: [PATCH 0351/3948] =?UTF-8?q?offsetof=20:=20=E3=83=A1=E3=82=BF?= =?UTF-8?q?=E6=83=85=E5=A0=B1=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstddef/offsetof.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/reference/cstddef/offsetof.md b/reference/cstddef/offsetof.md index 19146806b6..94d3ac76d7 100644 --- a/reference/cstddef/offsetof.md +++ b/reference/cstddef/offsetof.md @@ -1,7 +1,6 @@ # offsetof * cstddef[meta header] -* std[meta namespace] -* type-alias[meta id-type] +* macro[meta id-type] ```cpp # define offsetof(type, member) see-below From 587bd5b265057b6b9f69895cf8c98d6c37bdd483 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 19 Jun 2023 15:23:45 +0900 Subject: [PATCH 0352/3948] =?UTF-8?q?map/set=E3=81=AEerase=20:=20=E7=AF=84?= =?UTF-8?q?=E5=9B=B2=E5=A4=96=E3=81=AE=E3=82=A4=E3=83=86=E3=83=AC=E3=83=BC?= =?UTF-8?q?=E3=82=BF=E3=82=84=E5=AD=98=E5=9C=A8=E3=81=97=E3=81=AA=E3=81=84?= =?UTF-8?q?=E3=82=AD=E3=83=BC=E3=81=8C=E6=8C=87=E5=AE=9A=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=81=9F=E5=A0=B4=E5=90=88=E3=81=AE=E5=8B=95=E4=BD=9C=E3=81=8C?= =?UTF-8?q?=E6=9C=AA=E5=AE=9A=E7=BE=A9=E3=81=A7=E3=81=82=E3=82=8B=E3=81=93?= =?UTF-8?q?=E3=81=A8=E3=82=92=E8=A8=98=E8=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/map/map/erase.md | 7 ++++++- reference/map/multimap/erase.md | 5 +++++ reference/set/multiset/erase.md | 5 +++++ reference/set/set/erase.md | 5 +++++ 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/reference/map/map/erase.md b/reference/map/map/erase.md index b0105266c8..df6cd4fe52 100644 --- a/reference/map/map/erase.md +++ b/reference/map/map/erase.md @@ -19,6 +19,10 @@ iterator erase(const_iterator first, const_iterator last); // (3) C++11 これは削除された要素の数だけコンテナの `size` を減らし、それぞれの要素のデストラクタを呼び出す。 +- (1) : 指定されたイテレータが指す要素を削除する +- (2) : 指定されたキーをもつ要素を削除する +- (3) : 指定されたイテレータ範囲の要素をすべて削除する + ## パラメータ - `position` : `map` から削除する単一要素を指すイテレータ。`iterator` はメンバ型であり、双方向イテレータとして定義される。 @@ -40,7 +44,8 @@ iterator erase(const_iterator first, const_iterator last); // (3) C++11 ## 備考 -- 削除された要素を指すイテレータ、および、参照のみ無効になる。なお、規格書に明確な記載は無いが、削除された要素を指すポインタも無効になる。 +- この関数に、範囲外のイテレータ (終端イテレータを含む) や存在しないキーを指定した場合の動作は未定義 +- 削除された要素を指すイテレータ、および、参照のみ無効になる。なお、規格書に明確な記載は無いが、削除された要素を指すポインタも無効になる - ループ中で `map` の要素を削除するためには、C++03 までは以下のようなコードを書く必要があった。 ```cpp while (it != map_object.end()) { diff --git a/reference/map/multimap/erase.md b/reference/map/multimap/erase.md index 3a5579f7fd..0c19e0a461 100644 --- a/reference/map/multimap/erase.md +++ b/reference/map/multimap/erase.md @@ -20,6 +20,10 @@ iterator erase(const_iterator first, const_iterator last); // (3) C++11 これは削除された要素の数だけコンテナの `size` を減らし、それぞれの要素のデストラクタを呼び出す。 +- (1) : 指定されたイテレータが指す要素を削除する +- (2) : 指定されたキーをもつ要素をすべて削除する +- (3) : 指定されたイテレータ範囲の要素をすべて削除する + ## パラメータ - `position` : `multimap` から削除する単一要素を指すイテレータ。`iterator` はメンバ型であり、双方向イテレータとして定義される。 @@ -41,6 +45,7 @@ iterator erase(const_iterator first, const_iterator last); // (3) C++11 ## 備考 +- この関数に、範囲外のイテレータ (終端イテレータを含む) や存在しないキーを指定した場合の動作は未定義 - 削除された要素を指すイテレータ、および、参照のみ無効になる。なお、規格書に明確な記載は無いが、削除された要素を指すポインタも無効になる。 - ループ中で `multimap` の要素を削除するためには、C++03 までは以下のようなコードを書く必要があった。 ```cpp diff --git a/reference/set/multiset/erase.md b/reference/set/multiset/erase.md index 5d22911a4b..73871bdc7e 100644 --- a/reference/set/multiset/erase.md +++ b/reference/set/multiset/erase.md @@ -19,6 +19,10 @@ size_type erase(const key_type& x); // (3) 単一要素またはイテレータ範囲`[first, last)`を `multiset` コンテナから削除する。 これは削除された要素の数だけコンテナの [`size`](size.md)`()` を減らし、それぞれの要素のデストラクタを呼び出す。 +- (1) : 指定されたイテレータが指す要素を削除する +- (2) : 指定されたキーをもつ要素をすべて削除する +- (3) : 指定されたイテレータ範囲の要素をすべて削除する + ## パラメータ - `position` : `multiset` から削除する単一要素を指すイテレータ。`iterator`、および、`const_iterator` はメンバ型であり、双方向イテレータとして定義される。 @@ -40,6 +44,7 @@ size_type erase(const key_type& x); // (3) ## 備考 +- この関数に、範囲外のイテレータ (終端イテレータを含む) や存在しないキーを指定した場合の動作は未定義 - 削除された要素を指すイテレータ、および、参照のみ無効になる。なお、規格書に明確な記載は無いが、削除された要素を指すポインタも無効になる。 - ループ中で `multiset` の要素を削除するためには、C++03 までは以下のようなコードを書く必要があった。 ```cpp diff --git a/reference/set/set/erase.md b/reference/set/set/erase.md index 7dfa75ab78..a789cada33 100644 --- a/reference/set/set/erase.md +++ b/reference/set/set/erase.md @@ -19,6 +19,10 @@ size_type erase(const key_type& x); // (3) 単一要素またはイテレータ範囲`[first, last)`を `set` コンテナから削除する。 これは削除された要素の数だけコンテナの [`size`](size.md)`()` を減らし、それぞれの要素のデストラクタを呼び出す。 +- (1) : 指定されたイテレータが指す要素を削除する +- (2) : 指定されたキーをもつ要素を削除する +- (3) : 指定されたイテレータ範囲の要素をすべて削除する + ## パラメータ - `position` : `set` から削除する単一要素を指すイテレータ。`iterator`、および、`const_iterator` はメンバ型であり、双方向イテレータとして定義される。 @@ -40,6 +44,7 @@ size_type erase(const key_type& x); // (3) ## 備考 +- この関数に、範囲外のイテレータ (終端イテレータを含む) や存在しないキーを指定した場合の動作は未定義 - 削除された要素を指すイテレータ、および、参照のみ無効になる。なお、規格書に明確な記載は無いが、削除された要素を指すポインタも無効になる。 - ループ中で `set` の要素を削除するためには、C++03 までは以下のようなコードを書く必要があった。 ```cpp From ae7c515da20425de6c80b7b4336ec49ba8d7f0c6 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 19 Jun 2023 15:30:43 +0900 Subject: [PATCH 0353/3948] =?UTF-8?q?map=20/=20set=E3=81=AEerase=20:=20end?= =?UTF-8?q?=E3=81=8C=E8=BF=94=E3=82=8B=E6=9D=A1=E4=BB=B6=E3=81=AE=E6=96=87?= =?UTF-8?q?=E7=AB=A0=E3=81=8C=E3=82=8F=E3=81=8B=E3=82=8A=E3=81=AB=E3=81=8F?= =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=9F=E3=81=AE=E3=81=A7=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/map/map/erase.md | 2 +- reference/map/multimap/erase.md | 2 +- reference/set/multiset/erase.md | 2 +- reference/set/set/erase.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/map/map/erase.md b/reference/map/map/erase.md index df6cd4fe52..868c9e440c 100644 --- a/reference/map/map/erase.md +++ b/reference/map/map/erase.md @@ -33,7 +33,7 @@ iterator erase(const_iterator first, const_iterator last); // (3) C++11 ## 戻り値 - (1), (3) - C++03 : 戻り値なし - - C++11 : 削除された要素の次を指すイテレータを返す。そのような要素がない場合、[`end()`](end.md)を返す(コンテナが空になった場合や、最後尾の要素を削除した場合)。 + - C++11 : 削除された要素の次を指すイテレータを返す。そのような要素がない場合、[`end()`](end.md)を返す (要素を削除した結果としてコンテナが空になった場合) - (2) 削除された要素の数を返す。 diff --git a/reference/map/multimap/erase.md b/reference/map/multimap/erase.md index 0c19e0a461..2f45485d8c 100644 --- a/reference/map/multimap/erase.md +++ b/reference/map/multimap/erase.md @@ -34,7 +34,7 @@ iterator erase(const_iterator first, const_iterator last); // (3) C++11 ## 戻り値 - (1), (3) - C++03 : 戻り値なし - - C++11 : 削除された要素の次を指すイテレータを返す。そのような要素がない場合、[`end()`](end.md)を返す(コンテナが空になった場合や、最後尾の要素を削除した場合)。 + - C++11 : 削除された要素の次を指すイテレータを返す。そのような要素がない場合、[`end()`](end.md)を返す (要素を削除した結果としてコンテナが空になった場合) - (2) 削除された要素の数を返す。 diff --git a/reference/set/multiset/erase.md b/reference/set/multiset/erase.md index 73871bdc7e..4aed5f0145 100644 --- a/reference/set/multiset/erase.md +++ b/reference/set/multiset/erase.md @@ -33,7 +33,7 @@ size_type erase(const key_type& x); // (3) ## 戻り値 - (1), (2) : - C++03 まで : なし - - C++11 から : 削除された要素の次を指すイテレータを返す。そのような要素がない場合、[`end()`](end.md)を返す(コンテナが空になった場合や、最後尾の要素を削除した場合)。 + - C++11 : 削除された要素の次を指すイテレータを返す。そのような要素がない場合、[`end()`](end.md)を返す (要素を削除した結果としてコンテナが空になった場合) - (3) : 削除された要素の数を返す。 diff --git a/reference/set/set/erase.md b/reference/set/set/erase.md index a789cada33..1138910f9e 100644 --- a/reference/set/set/erase.md +++ b/reference/set/set/erase.md @@ -33,7 +33,7 @@ size_type erase(const key_type& x); // (3) ## 戻り値 - (1), (2) : - C++03 まで : なし - - C++11 から : 削除された要素の次を指すイテレータを返す。そのような要素がない場合、[`end()`](end.md)を返す(コンテナが空になった場合や、最後尾の要素を削除した場合)。 + - C++11 : 削除された要素の次を指すイテレータを返す。そのような要素がない場合、[`end()`](end.md)を返す (要素を削除した結果としてコンテナが空になった場合) - (3) : 削除された要素の数を返す。 From 6251e4abe9d90fab42621ba97fea3a0b4a3c94aa Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 22 Jun 2023 16:06:07 +0900 Subject: [PATCH 0354/3948] =?UTF-8?q?map=20/=20set=E3=81=AEerase=20:=20?= =?UTF-8?q?=E3=82=AA=E3=83=BC=E3=83=90=E3=83=BC=E3=83=AD=E3=83=BC=E3=83=89?= =?UTF-8?q?=E4=BB=95=E6=A7=98=E3=81=8C=E5=8F=A4=E3=81=8F=E3=81=AA=E3=81=A3?= =?UTF-8?q?=E3=81=A6=E3=81=84=E3=81=9F=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/map/map/erase.md | 41 ++++++++++++++++++++---------- reference/map/multimap/erase.md | 43 +++++++++++++++++++++----------- reference/set/multiset/erase.md | 44 ++++++++++++++++++++++----------- reference/set/set/erase.md | 43 +++++++++++++++++++++----------- 4 files changed, 114 insertions(+), 57 deletions(-) diff --git a/reference/map/map/erase.md b/reference/map/map/erase.md index 868c9e440c..84fe25a4fa 100644 --- a/reference/map/map/erase.md +++ b/reference/map/map/erase.md @@ -5,13 +5,18 @@ * function[meta id-type] ```cpp -void erase(iterator position); // (1) C++03 -iterator erase(const_iterator position); // (1) C++11 +void erase(iterator position); // (1) C++03 (C++11で一旦削除) +iterator erase(iterator position); // (1) C++17 -size_type erase(const key_type& x); // (2) +iterator erase(const_iterator position); // (2) C++11 -void erase(iterator first, iterator last); // (3) C++03 -iterator erase(const_iterator first, const_iterator last); // (3) C++11 +size_type erase(const key_type& x); // (3) C++03 + +template +size_type erase(K&& x); // (4) C++23 + +void erase(iterator first, iterator last); // (5) C++03 +iterator erase(const_iterator first, const_iterator last); // (5) C++11 ``` ## 概要 @@ -20,8 +25,10 @@ iterator erase(const_iterator first, const_iterator last); // (3) C++11 これは削除された要素の数だけコンテナの `size` を減らし、それぞれの要素のデストラクタを呼び出す。 - (1) : 指定されたイテレータが指す要素を削除する -- (2) : 指定されたキーをもつ要素を削除する -- (3) : 指定されたイテレータ範囲の要素をすべて削除する +- (2) : 指定された読み取り専用イテレータが指す要素を削除する +- (3) : 指定されたキーをもつ要素を削除する +- (4) : `key_type`と比較可能な`K`型のキーを受け取って要素を削除する +- (5) : 指定されたイテレータ範囲の要素をすべて削除する ## パラメータ @@ -31,16 +38,20 @@ iterator erase(const_iterator first, const_iterator last); // (3) C++11 ## 戻り値 -- (1), (3) +- (1) : + - C++03 : 戻り値なし + - C++17 : 削除された要素の次を指すイテレータを返す。そのような要素がない場合、[`end()`](end.md)を返す (要素を削除した結果としてコンテナが空になった場合) +- (2) : 削除された要素の次を指すイテレータを返す。そのような要素がない場合、[`end()`](end.md)を返す (要素を削除した結果としてコンテナが空になった場合) +- (3), (4) : 削除された要素の数を返す +- (5) : - C++03 : 戻り値なし - C++11 : 削除された要素の次を指すイテレータを返す。そのような要素がない場合、[`end()`](end.md)を返す (要素を削除した結果としてコンテナが空になった場合) -- (2) 削除された要素の数を返す。 ## 計算量 -- (1) 定数時間。 -- (2) コンテナの [`size()`](/reference/map/map/size.md) について対数時間。 -- (3) コンテナの [`size()`](/reference/map/map/size.md) について対数時間、それに加えて `first` と `last` の間の距離に対する線形時間。 +- (1), (2) : 定数時間 +- (3), (4) : コンテナの [`size()`](/reference/map/map/size.md) について対数時間 +- (5) : コンテナの [`size()`](/reference/map/map/size.md) について対数時間、それに加えて `first` と `last` の間の距離に対する線形時間 ## 備考 @@ -174,7 +185,11 @@ int main() ## 参照 - [N2350 Container insert/erase and iterator constness (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2350.pdf) + - C++11で、`erase(iterator)`を`erase(const_iterator)`に変更 - [LWG Issue 2258. `a.erase(q1, q2)` unable to directly return `q2`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2258) - C++11では、「`a.erase(q1, q2)`の結果として`q2`が返る」という仕様だったが、`const_iterator`型が渡された場合に`iterator`型を返せない問題があった。そのためC++14では、`q2`が指す要素を指すイテレータが返る、ということが明記された - +- [LWG Issue 2059. C++0x ambiguity problem with `map::erase`](https://cplusplus.github.io/LWG/issue2059) + - C++17で、`erase(iterator)`を再追加 +- [P2077R3 Heterogeneous erasure overloads for associative containers](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2077r3.html) + - C++23で、`template erase(K&& x)`のオーバーロードが追加された diff --git a/reference/map/multimap/erase.md b/reference/map/multimap/erase.md index 2f45485d8c..f52bcb6cff 100644 --- a/reference/map/multimap/erase.md +++ b/reference/map/multimap/erase.md @@ -5,13 +5,18 @@ * function[meta id-type] ```cpp -void erase(iterator position); // (1) C++03 -iterator erase(const_iterator position); // (1) C++11 +void erase(iterator position); // (1) C++03 (C++11で一旦削除) +iterator erase(iterator position); // (1) C++17 -size_type erase(const key_type& x); // (2) +iterator erase(const_iterator position); // (2) C++11 -void erase(iterator first, iterator last); // (3) C++03 -iterator erase(const_iterator first, const_iterator last); // (3) C++11 +size_type erase(const key_type& x); // (3) C++03 + +template +size_type erase(K&& x); // (4) C++23 + +void erase(iterator first, iterator last); // (5) C++03 +iterator erase(const_iterator first, const_iterator last); // (5) C++11 ``` @@ -21,9 +26,10 @@ iterator erase(const_iterator first, const_iterator last); // (3) C++11 これは削除された要素の数だけコンテナの `size` を減らし、それぞれの要素のデストラクタを呼び出す。 - (1) : 指定されたイテレータが指す要素を削除する -- (2) : 指定されたキーをもつ要素をすべて削除する -- (3) : 指定されたイテレータ範囲の要素をすべて削除する - +- (2) : 指定された読み取り専用イテレータが指す要素を削除する +- (3) : 指定されたキーをもつ要素をすべて削除する +- (4) : `key_type`と比較可能な`K`型のキーを受け取って要素をすべて削除する +- (5) : 指定されたイテレータ範囲の要素をすべて削除する ## パラメータ - `position` : `multimap` から削除する単一要素を指すイテレータ。`iterator` はメンバ型であり、双方向イテレータとして定義される。 @@ -32,16 +38,20 @@ iterator erase(const_iterator first, const_iterator last); // (3) C++11 ## 戻り値 -- (1), (3) +- (1) : + - C++03 : 戻り値なし + - C++17 : 削除された要素の次を指すイテレータを返す。そのような要素がない場合、[`end()`](end.md)を返す (要素を削除した結果としてコンテナが空になった場合) +- (2) : 削除された要素の次を指すイテレータを返す。そのような要素がない場合、[`end()`](end.md)を返す (要素を削除した結果としてコンテナが空になった場合) +- (3), (4) : 削除された要素の数を返す +- (5) : - C++03 : 戻り値なし - C++11 : 削除された要素の次を指すイテレータを返す。そのような要素がない場合、[`end()`](end.md)を返す (要素を削除した結果としてコンテナが空になった場合) -- (2) 削除された要素の数を返す。 ## 計算量 -- (1) 定数時間。 -- (2) コンテナの [`size()`](/reference/map/map/size.md) について対数時間。 -- (3) コンテナの [`size()`](/reference/map/map/size.md) について対数時間、それに加えて `first` と `last` の間の距離に対する線形時間。 +- (1), (2) : 定数時間 +- (3), (4) : コンテナの [`size()`](/reference/map/map/size.md) について対数時間 +- (5) : コンテナの [`size()`](/reference/map/map/size.md) について対数時間、それに加えて `first` と `last` の間の距離に対する線形時間 ## 備考 @@ -164,7 +174,10 @@ int main() ## 参照 - [N2350 Container insert/erase and iterator constness (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2350.pdf) + - C++11で、`erase(iterator)`を`erase(const_iterator)`に変更 - [LWG Issue 2258. `a.erase(q1, q2)` unable to directly return `q2`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2258) - C++11では、「`a.erase(q1, q2)`の結果として`q2`が返る」という仕様だったが、`const_iterator`型が渡された場合に`iterator`型を返せない問題があった。そのためC++14では、`q2`が指す要素を指すイテレータが返る、ということが明記された - - +- [LWG Issue 2059. C++0x ambiguity problem with `map::erase`](https://cplusplus.github.io/LWG/issue2059) + - C++17で、`erase(iterator)`を再追加 +- [P2077R3 Heterogeneous erasure overloads for associative containers](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2077r3.html) + - C++23で、`template erase(K&& x)`のオーバーロードが追加された diff --git a/reference/set/multiset/erase.md b/reference/set/multiset/erase.md index 4aed5f0145..f8cd9641c1 100644 --- a/reference/set/multiset/erase.md +++ b/reference/set/multiset/erase.md @@ -5,13 +5,18 @@ * function[meta id-type] ```cpp -void erase(iterator position); // (1) C++03 まで -iterator erase(const_iterator position); // (1) C++11 から +void erase(iterator position); // (1) C++03 (C++11で一旦削除) +iterator erase(iterator position); // (1) C++17 -void erase(iterator first, iterator last); // (2) C++03 まで -iterator erase(const_iterator first, const_iterator last); // (2) C++11 から +iterator erase(const_iterator position); // (2) C++11 -size_type erase(const key_type& x); // (3) +size_type erase(const key_type& x); // (3) C++03 + +template +size_type erase(K&& x); // (4) C++23 + +void erase(iterator first, iterator last); // (5) C++03 +iterator erase(const_iterator first, const_iterator last); // (5) C++11 ``` @@ -20,8 +25,10 @@ size_type erase(const key_type& x); // (3) これは削除された要素の数だけコンテナの [`size`](size.md)`()` を減らし、それぞれの要素のデストラクタを呼び出す。 - (1) : 指定されたイテレータが指す要素を削除する -- (2) : 指定されたキーをもつ要素をすべて削除する -- (3) : 指定されたイテレータ範囲の要素をすべて削除する +- (2) : 指定された読み取り専用イテレータが指す要素を削除する +- (3) : 指定されたキーをもつ要素をすべて削除する +- (4) : `key_type`と比較可能な`K`型のキーを受け取って要素をすべて削除する +- (5) : 指定されたイテレータ範囲の要素をすべて削除する ## パラメータ @@ -31,16 +38,20 @@ size_type erase(const key_type& x); // (3) ## 戻り値 -- (1), (2) : - - C++03 まで : なし +- (1) : + - C++03 : 戻り値なし + - C++17 : 削除された要素の次を指すイテレータを返す。そのような要素がない場合、[`end()`](end.md)を返す (要素を削除した結果としてコンテナが空になった場合) +- (2) : 削除された要素の次を指すイテレータを返す。そのような要素がない場合、[`end()`](end.md)を返す (要素を削除した結果としてコンテナが空になった場合) +- (3), (4) : 削除された要素の数を返す +- (5) : + - C++03 : 戻り値なし - C++11 : 削除された要素の次を指すイテレータを返す。そのような要素がない場合、[`end()`](end.md)を返す (要素を削除した結果としてコンテナが空になった場合) -- (3) : 削除された要素の数を返す。 ## 計算量 -- (1) : 定数時間 -- (2) : コンテナの [`size()`](size.md) についての対数時間と、それに加えて `first` と `last` の間の距離に対する線形時間。 -- (3) : コンテナの [`size()`](size.md) についての対数時間と、それに加えて `x` と等価なキーの要素数に対する線形時間。 +- (1), (2) : 定数時間 +- (3), (4) : コンテナの [`size()`](/reference/map/map/size.md) について対数時間 +- (5) : コンテナの [`size()`](/reference/map/map/size.md) について対数時間、それに加えて `first` と `last` の間の距離に対する線形時間 ## 備考 @@ -157,7 +168,10 @@ int main() ## 参照 - [N2350 Container insert/erase and iterator constness (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2350.pdf) + - C++11で、`erase(iterator)`を`erase(const_iterator)`に変更 - [LWG Issue 2258. `a.erase(q1, q2)` unable to directly return `q2`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2258) - C++11では、「`a.erase(q1, q2)`の結果として`q2`が返る」という仕様だったが、`const_iterator`型が渡された場合に`iterator`型を返せない問題があった。そのためC++14では、`q2`が指す要素を指すイテレータが返る、ということが明記された - - +- [LWG Issue 2059. C++0x ambiguity problem with `map::erase`](https://cplusplus.github.io/LWG/issue2059) + - C++17で、`erase(iterator)`を再追加 +- [P2077R3 Heterogeneous erasure overloads for associative containers](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2077r3.html) + - C++23で、`template erase(K&& x)`のオーバーロードが追加された diff --git a/reference/set/set/erase.md b/reference/set/set/erase.md index 1138910f9e..683180d57c 100644 --- a/reference/set/set/erase.md +++ b/reference/set/set/erase.md @@ -5,13 +5,18 @@ * function[meta id-type] ```cpp -void erase(iterator position); // (1) C++03 まで -iterator erase(const_iterator position); // (1) C++11 から +void erase(iterator position); // (1) C++03 (C++11で一旦削除) +iterator erase(iterator position); // (1) C++17 -void erase(iterator first, iterator last); // (2) C++03 まで -iterator erase(const_iterator first, const_iterator last); // (2) C++11 から +iterator erase(const_iterator position); // (2) C++11 -size_type erase(const key_type& x); // (3) +size_type erase(const key_type& x); // (3) C++03 + +template +size_type erase(K&& x); // (4) C++23 + +void erase(iterator first, iterator last); // (5) C++03 +iterator erase(const_iterator first, const_iterator last); // (5) C++11 ``` @@ -20,8 +25,10 @@ size_type erase(const key_type& x); // (3) これは削除された要素の数だけコンテナの [`size`](size.md)`()` を減らし、それぞれの要素のデストラクタを呼び出す。 - (1) : 指定されたイテレータが指す要素を削除する -- (2) : 指定されたキーをもつ要素を削除する -- (3) : 指定されたイテレータ範囲の要素をすべて削除する +- (2) : 指定された読み取り専用イテレータが指す要素を削除する +- (3) : 指定されたキーをもつ要素を削除する +- (4) : `key_type`と比較可能な`K`型のキーを受け取って要素を削除する +- (5) : 指定されたイテレータ範囲の要素をすべて削除する ## パラメータ @@ -31,16 +38,20 @@ size_type erase(const key_type& x); // (3) ## 戻り値 -- (1), (2) : - - C++03 まで : なし +- (1) : + - C++03 : 戻り値なし + - C++17 : 削除された要素の次を指すイテレータを返す。そのような要素がない場合、[`end()`](end.md)を返す (要素を削除した結果としてコンテナが空になった場合) +- (2) : 削除された要素の次を指すイテレータを返す。そのような要素がない場合、[`end()`](end.md)を返す (要素を削除した結果としてコンテナが空になった場合) +- (3), (4) : 削除された要素の数を返す +- (5) : + - C++03 : 戻り値なし - C++11 : 削除された要素の次を指すイテレータを返す。そのような要素がない場合、[`end()`](end.md)を返す (要素を削除した結果としてコンテナが空になった場合) -- (3) : 削除された要素の数を返す。 ## 計算量 -- (1) : 定数時間 -- (2) : コンテナの [`size()`](size.md) についての対数時間と、それに加えて `first` と `last` の間の距離に対する線形時間。 -- (3) : コンテナの [`size()`](size.md) について対数時間。 +- (1), (2) : 定数時間 +- (3), (4) : コンテナの [`size()`](/reference/map/map/size.md) について対数時間 +- (5) : コンテナの [`size()`](/reference/map/map/size.md) について対数時間、それに加えて `first` と `last` の間の距離に対する線形時間 ## 備考 @@ -158,7 +169,11 @@ int main() ## 参照 - [N2350 Container insert/erase and iterator constness (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2350.pdf) + - C++11で、`erase(iterator)`を`erase(const_iterator)`に変更 - [LWG Issue 2258. `a.erase(q1, q2)` unable to directly return `q2`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2258) - C++11では、「`a.erase(q1, q2)`の結果として`q2`が返る」という仕様だったが、`const_iterator`型が渡された場合に`iterator`型を返せない問題があった。そのためC++14では、`q2`が指す要素を指すイテレータが返る、ということが明記された - +- [LWG Issue 2059. C++0x ambiguity problem with `map::erase`](https://cplusplus.github.io/LWG/issue2059) + - C++17で、`erase(iterator)`を再追加 +- [P2077R3 Heterogeneous erasure overloads for associative containers](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2077r3.html) + - C++23で、`template erase(K&& x)`のオーバーロードが追加された From 217669cf06e0ac6b4e4bc3058cf3871da48d7630 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 22 Jun 2023 16:15:33 +0900 Subject: [PATCH 0355/3948] =?UTF-8?q?unordered=5Fmap=20/=20set=E3=81=AEera?= =?UTF-8?q?se=20:=20erase(iterator)=E3=81=AE=E3=82=AA=E3=83=BC=E3=83=90?= =?UTF-8?q?=E3=83=BC=E3=83=AD=E3=83=BC=E3=83=89=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../unordered_map/unordered_map/erase.md | 53 ++++++++++--------- .../unordered_map/unordered_multimap/erase.md | 48 +++++++++-------- .../unordered_set/unordered_multiset/erase.md | 48 +++++++++-------- .../unordered_set/unordered_set/erase.md | 52 +++++++++--------- 4 files changed, 106 insertions(+), 95 deletions(-) diff --git a/reference/unordered_map/unordered_map/erase.md b/reference/unordered_map/unordered_map/erase.md index cfbdeb6f0f..ba3dbaa804 100644 --- a/reference/unordered_map/unordered_map/erase.md +++ b/reference/unordered_map/unordered_map/erase.md @@ -6,11 +6,13 @@ * cpp11[meta cpp] ```cpp -iterator erase(const_iterator position); // (1) +iterator erase(iterator position); // (1) C++17 -size_type erase(const key_type& k); // (2) +iterator erase(const_iterator position); // (2) C++11 -iterator erase(const_iterator first, const_iterator last); // (3) +size_type erase(const key_type& k); // (3) C++11 + +iterator erase(const_iterator first, const_iterator last); // (4) C++11 ``` ## 概要 @@ -24,30 +26,30 @@ iterator erase(const_iterator first, const_iterator last); // (3) ## 効果 -- (1) : `position` で指定された要素を削除する。 -- (2) : `k` と等価なキーの要素を削除する。 -- (3) : イテレータ範囲`[first, last)` にある要素を全て削除する。 +- (1), (2) : `position` で指定された要素を削除する。 +- (3) : `k` と等価なキーの要素を削除する。 +- (4) : イテレータ範囲`[first, last)` にある要素を全て削除する。 ## 戻り値 -- (1) : 「削除前に、削除された要素の次だった位置」を指すイテレータ。`erase()` を呼び出しても削除された要素以外を指す全てのイテレータは無効にならないため、`std::`[`next`](/reference/iterator/next.md)`(position)` と同じ位置を指す `iterator` である。 +- (1), (2) : 「削除前に、削除された要素の次だった位置」を指すイテレータ。`erase()` を呼び出しても削除された要素以外を指す全てのイテレータは無効にならないため、`std::`[`next`](/reference/iterator/next.md)`(position)` と同じ位置を指す `iterator` である。 なお、`position` は `const_iterator` なのに対して、戻り値は `iterator` であるため注意が必要。 -- (2) : 削除した要素数。つまり、`k` と等価なキーの要素があれば 1、無ければ 0。 -- (3) : 「削除前に、削除された要素の範囲の次だった位置」を指すイテレータ。`erase()` を呼び出しても削除された要素以外を指す全てのイテレータは無効にならないため、`last` と同じ位置を指す `iterator` である。 +- (3) : 削除した要素数。つまり、`k` と等価なキーの要素があれば 1、無ければ 0。 +- (4) : 「削除前に、削除された要素の範囲の次だった位置」を指すイテレータ。`erase()` を呼び出しても削除された要素以外を指す全てのイテレータは無効にならないため、`last` と同じ位置を指す `iterator` である。 なお、`first` 及び `last` は `const_iterator` なのに対して、戻り値は `iterator` であるため注意が必要である。 また、要件に示したように `first` が間接参照可能である必要がなかった場合にも、他の種類のコンテナの戻り値と照らし合わせると、`last` と同じ位置を指す `iterator` を返すのが適切であるものと思われる。 ## 例外 -- (1) : 投げない。 -- (2) : コンテナの `key_equal` と `hasher` のオブジェクト(それぞれ `key_eq()` と `hash_function()` が返すオブジェクト)が例外を投げなければ、例外を投げない。 -- (3) : 投げない。 +- (1), (2) : 投げない。 +- (3) : コンテナの `key_equal` と `hasher` のオブジェクト(それぞれ `key_eq()` と `hash_function()` が返すオブジェクト)が例外を投げなければ、例外を投げない。 +- (4) : 投げない。 ## 計算量 -- (1) : 平均的なケースでは定数(O(`1`))だが、最悪のケースではコンテナの要素数に比例(O([`size`](size.md)`()`)) -- (2) : 平均的なケースでは削除された要素数に比例(O([`count`](count.md)`(k)`))だが、最悪のケースではコンテナの要素数に比例(O([`size`](size.md)`()`)) -- (3) : 平均的なケースでは指定された範囲の要素数に比例(O(`std::`[`distance`](/reference/iterator/distance.md)`(first, last)`))だが、最悪のケースではコンテナの要素数に比例(O([`size`](size.md)`()`)) +- (1), (2) : 平均的なケースでは定数(O(`1`))だが、最悪のケースではコンテナの要素数に比例(O([`size`](size.md)`()`)) +- (3) : 平均的なケースでは削除された要素数に比例(O([`count`](count.md)`(k)`))だが、最悪のケースではコンテナの要素数に比例(O([`size`](size.md)`()`)) +- (4) : 平均的なケースでは指定された範囲の要素数に比例(O(`std::`[`distance`](/reference/iterator/distance.md)`(first, last)`))だが、最悪のケースではコンテナの要素数に比例(O([`size`](size.md)`()`)) ## 備考 @@ -94,10 +96,10 @@ int main() std::cout << std::endl; } - // 指定したキーと等価な要素を削除((2)の形式) + // 指定したキーと等価な要素を削除((3)の形式) { std::unordered_map um{ {"1st", 1}, {"3rd", 3}, {"5th", 5}, {"7th", 7}, {"9th", 9}, }; - print("(2) erase(const value_type&) before", um); + print("(3) erase(const value_type&) before", um); auto count1 = um.erase("5th"); auto count2 = um.erase("8th"); @@ -107,10 +109,10 @@ int main() std::cout << std::endl; } - // 指定した位置にある要素を削除((3)の形式) + // 指定した位置にある要素を削除((4)の形式) { std::unordered_map um{ {"1st", 1}, {"3rd", 3}, {"5th", 5}, {"7th", 7}, {"9th", 9}, }; - print("(3) erase(const_iterator, const_iterator) before", um); + print("(4) erase(const_iterator, const_iterator) before", um); auto it1 = std::next(um.cbegin()); auto it2 = std::next(it1, 2); @@ -135,12 +137,12 @@ argument: (3rd, 3) return value: (1st, 1) after : (9th, 9), (7th, 7), (5th, 5), (1st, 1), -(2) erase(const value_type&) before : (9th, 9), (7th, 7), (5th, 5), (3rd, 3), (1st, 1), +(3) erase(const value_type&) before : (9th, 9), (7th, 7), (5th, 5), (3rd, 3), (1st, 1), argument: 5th, 8th return value: 1, 0 after : (9th, 9), (7th, 7), (3rd, 3), (1st, 1), -(3) erase(const_iterator, const_iterator) before : (9th, 9), (7th, 7), (5th, 5), (3rd, 3), (1st, 1), +(4) erase(const_iterator, const_iterator) before : (9th, 9), (7th, 7), (5th, 5), (3rd, 3), (1st, 1), arguments: (7th, 7), (3rd, 3) return value: (3rd, 3) after : (9th, 9), (3rd, 3), (1st, 1), @@ -200,10 +202,6 @@ int main() - [Visual C++](/implementation.md#visual_cpp): ? -## 参照 -- [N2350 Container insert/erase and iterator constness (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2350.pdf) - - ## 関連項目 | 名前 | 説明 | @@ -214,3 +212,8 @@ int main() | [`clear`](clear.md) | 全要素の削除 | | [`swap`](swap.md) | 内容の交換 | + +## 参照 +- [N2350 Container insert/erase and iterator constness (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2350.pdf) +- [LWG Issue 2059. C++0x ambiguity problem with `map::erase`](https://cplusplus.github.io/LWG/issue2059) + - C++17で、`erase(iterator)`を追加 diff --git a/reference/unordered_map/unordered_multimap/erase.md b/reference/unordered_map/unordered_multimap/erase.md index 804e96d931..e93bb2ddfe 100644 --- a/reference/unordered_map/unordered_multimap/erase.md +++ b/reference/unordered_map/unordered_multimap/erase.md @@ -6,11 +6,13 @@ * cpp11[meta cpp] ```cpp -iterator erase(const_iterator position); // (1) +iterator erase(iterator position); // (1) C++17 -size_type erase(const key_type& k); // (2) +iterator erase(const_iterator position); // (2) C++11 -iterator erase(const_iterator first, const_iterator last); // (3) +size_type erase(const key_type& k); // (3) C++11 + +iterator erase(const_iterator first, const_iterator last); // (4) C++11 ``` ## 概要 @@ -24,30 +26,30 @@ iterator erase(const_iterator first, const_iterator last); // (3) ## 効果 -- (1) : `position` で指定された要素を削除する。 -- (2) : `k` と等価なキーの要素を削除する。 -- (3) : イテレータ範囲`[first, last)` にある要素を全て削除する。 +- (1), (2) : `position` で指定された要素を削除する。 +- (3) : `k` と等価なキーの要素を削除する。 +- (4) : イテレータ範囲`[first, last)` にある要素を全て削除する。 ## 戻り値 -- (1) : 「削除前に、削除された要素の次だった位置」を指すイテレータ。`erase()` を呼び出しても削除された要素以外を指す全てのイテレータは無効にならないため、`std::`[`next`](/reference/iterator/next.md)`(position)` と同じ位置を指す `iterator` である。 +- (1), (2) : 「削除前に、削除された要素の次だった位置」を指すイテレータ。`erase()` を呼び出しても削除された要素以外を指す全てのイテレータは無効にならないため、`std::`[`next`](/reference/iterator/next.md)`(position)` と同じ位置を指す `iterator` である。 なお、`position` は `const_iterator` なのに対して、戻り値は `iterator` であるため注意が必要である。 -- (2) : 削除した要素数。 -- (3) : 「削除前に、削除された要素の範囲の次だった位置」を指すイテレータ。`erase()` を呼び出しても削除された要素以外を指す全てのイテレータは無効にならないため、`last` と同じ位置を指す `iterator` である。 +- (3) : 削除した要素数。 +- (4) : 「削除前に、削除された要素の範囲の次だった位置」を指すイテレータ。`erase()` を呼び出しても削除された要素以外を指す全てのイテレータは無効にならないため、`last` と同じ位置を指す `iterator` である。 なお、`first` 及び `last` は `const_iterator` なのに対して、戻り値は `iterator` であるため注意が必要である。 また、要件に示したように `first` が間接参照可能である必要がなかった場合にも、他の種類のコンテナの戻り値と照らし合わせると、`last` と同じ位置を指す `iterator` を返すのが適切であるものと思われる。 ## 例外 -- (1) : 投げない。 -- (2) : コンテナの `key_equal` と `hasher` のオブジェクト(それぞれ `key_eq()` と `hash_function()` が返すオブジェクト)が例外を投げなければ、例外を投げない。 -- (3) : 投げない。 +- (1), (2) : 投げない。 +- (3) : コンテナの `key_equal` と `hasher` のオブジェクト(それぞれ `key_eq()` と `hash_function()` が返すオブジェクト)が例外を投げなければ、例外を投げない。 +- (4) : 投げない。 ## 計算量 -- (1) : 平均的なケースでは定数(O(`1`))だが、最悪のケースではコンテナの要素数に比例(O([`size`](size.md)`()`)) -- (2) : 平均的なケースでは削除された要素数に比例(O([`count`](count.md)`(k)`))だが、最悪のケースではコンテナの要素数に比例(O([`size`](size.md)`()`)) -- (3) : 平均的なケースでは指定された範囲の要素数に比例(O(`std::`[`distance`](/reference/iterator/distance.md)`(first, last)`))だが、最悪のケースではコンテナの要素数に比例(O([`size`](size.md)`()`)) +- (1), (2) : 平均的なケースでは定数(O(`1`))だが、最悪のケースではコンテナの要素数に比例(O([`size`](size.md)`()`)) +- (3) : 平均的なケースでは削除された要素数に比例(O([`count`](count.md)`(k)`))だが、最悪のケースではコンテナの要素数に比例(O([`size`](size.md)`()`)) +- (4) : 平均的なケースでは指定された範囲の要素数に比例(O(`std::`[`distance`](/reference/iterator/distance.md)`(first, last)`))だが、最悪のケースではコンテナの要素数に比例(O([`size`](size.md)`()`)) ## 備考 @@ -94,10 +96,10 @@ int main() std::cout << std::endl; } - // 指定したキーと等価な要素を削除((2)の形式) + // 指定したキーと等価な要素を削除((3)の形式) { std::unordered_multimap um{ {"1st", 1}, {"3rd", 3}, {"5th", 5}, {"7th", 7}, {"9th", 9}, {"3rd", 33}, }; - print("(2) erase(const value_type&) before", um); + print("(3) erase(const value_type&) before", um); auto count1 = um.erase("5th"); auto count2 = um.erase("8th"); @@ -108,10 +110,10 @@ int main() std::cout << std::endl; } - // 指定した位置にある要素を削除((3)の形式) + // 指定した位置にある要素を削除((4)の形式) { std::unordered_multimap um{ {"1st", 1}, {"3rd", 3}, {"5th", 5}, {"7th", 7}, {"9th", 9}, {"3rd", 33}, }; - print("(3) erase(const_iterator, const_iterator) before", um); + print("(4) erase(const_iterator, const_iterator) before", um); auto it1 = std::next(um.cbegin()); auto it2 = std::next(it1, 2); @@ -136,12 +138,12 @@ argument: (3rd, 33) return value: (3rd, 3) after : (9th, 9), (7th, 7), (5th, 5), (3rd, 3), (1st, 1), -(2) erase(const value_type&) before : (9th, 9), (7th, 7), (5th, 5), (3rd, 33), (3rd, 3), (1st, 1), +(3) erase(const value_type&) before : (9th, 9), (7th, 7), (5th, 5), (3rd, 33), (3rd, 3), (1st, 1), argument: 5th, 8th, 3rd return value: 1, 0, 2 after : (9th, 9), (7th, 7), (1st, 1), -(3) erase(const_iterator, const_iterator) before : (9th, 9), (7th, 7), (5th, 5), (3rd, 33), (3rd, 3), (1st, 1), +(4) erase(const_iterator, const_iterator) before : (9th, 9), (7th, 7), (5th, 5), (3rd, 33), (3rd, 3), (1st, 1), arguments: (7th, 7), (3rd, 33) return value: (3rd, 33) after : (9th, 9), (3rd, 33), (3rd, 3), (1st, 1), @@ -215,5 +217,5 @@ int main() ## 参照 - [LWG Issue 518. Are `insert` and `erase` stable for `unordered_multiset` and `unordered_multimap`?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#518) - 安定性の保証が規定された経緯のレポート - - +- [LWG Issue 2059. C++0x ambiguity problem with `map::erase`](https://cplusplus.github.io/LWG/issue2059) + - C++17で、`erase(iterator)`を追加 diff --git a/reference/unordered_set/unordered_multiset/erase.md b/reference/unordered_set/unordered_multiset/erase.md index 88cb5415f3..b32770c2f0 100644 --- a/reference/unordered_set/unordered_multiset/erase.md +++ b/reference/unordered_set/unordered_multiset/erase.md @@ -6,11 +6,13 @@ * cpp11[meta cpp] ```cpp -iterator erase(const_iterator position); // (1) +iterator erase(iterator position); // (1) C++17 -size_type erase(const key_type& k); // (2) +iterator erase(const_iterator position); // (2) C++11 -iterator erase(const_iterator first, const_iterator last); // (3) +size_type erase(const key_type& k); // (3) C++11 + +iterator erase(const_iterator first, const_iterator last); // (4) C++11 ``` ## 概要 @@ -24,30 +26,30 @@ iterator erase(const_iterator first, const_iterator last); // (3) ## 効果 -- (1) : `position` で指定された要素を削除する。 -- (2) : `k` と等価なキーの要素を削除する。 -- (3) : イテレータ範囲`[first, last)`にある要素を全て削除する。 +- (1), (2) : `position` で指定された要素を削除する。 +- (3) : `k` と等価なキーの要素を削除する。 +- (4) : イテレータ範囲`[first, last)`にある要素を全て削除する。 ## 戻り値 -- (1) : 「削除前に、削除された要素の次だった位置」を指すイテレータ。`erase()` を呼び出しても削除された要素以外を指す全てのイテレータは無効にならないため、`std::`[`next`](/reference/iterator/next.md)`(position)` と同じ位置を指す `iterator` である。 +- (1), (2) : 「削除前に、削除された要素の次だった位置」を指すイテレータ。`erase()` を呼び出しても削除された要素以外を指す全てのイテレータは無効にならないため、`std::`[`next`](/reference/iterator/next.md)`(position)` と同じ位置を指す `iterator` である。 なお、`position` は `const_iterator` なのに対して、戻り値は `iterator` であるため注意が必要だが、非順序連想コンテナの場合いずれにせよどちらも読み取り専用イテレータである。 -- (2) : 削除した要素数。 -- (3) : 「削除前に、削除された要素の範囲の次だった位置」を指すイテレータ。`erase()` を呼び出しても削除された要素以外を指す全てのイテレータは無効にならないため、`last` と同じ位置を指す `iterator` である。 +- (3) : 削除した要素数。 +- (4) : 「削除前に、削除された要素の範囲の次だった位置」を指すイテレータ。`erase()` を呼び出しても削除された要素以外を指す全てのイテレータは無効にならないため、`last` と同じ位置を指す `iterator` である。 なお、`first` 及び `last` は `const_iterator` なのに対して、戻り値は `iterator` であるため注意が必要だが、非順序連想コンテナの場合いずれにせよどちらも読み取り専用イテレータである。 また、要件に示したように `first` が間接参照可能である必要がなかった場合にも、他の種類のコンテナの戻り値と照らし合わせると、`last` と同じ位置を指す `iterator` を返すのが適切であるものと思われる。 ## 例外 -- (1) : 投げない。 -- (2) : コンテナの `key_equal` と `hasher` のオブジェクト(それぞれ `key_eq()` と `hash_function()` が返すオブジェクト)が例外を投げなければ、例外を投げない。 -- (3) : 投げない。 +- (1), (2) : 投げない。 +- (3) : コンテナの `key_equal` と `hasher` のオブジェクト(それぞれ `key_eq()` と `hash_function()` が返すオブジェクト)が例外を投げなければ、例外を投げない。 +- (4) : 投げない。 ## 計算量 -- (1) : 平均的なケースでは定数(O(`1`))だが、最悪のケースではコンテナの要素数に比例(O([`size`](size.md)`()`)) -- (2) : 平均的なケースでは削除された要素数に比例(O([`count`](count.md)`(k)`))だが、最悪のケースではコンテナの要素数に比例(O([`size`](size.md)`()`)) -- (3) : 平均的なケースでは指定された範囲の要素数に比例(O(`std::`[`distance`](/reference/iterator/distance.md)`(first, last)`))だが、最悪のケースではコンテナの要素数に比例(O([`size`](size.md)`()`)) +- (1), (2) : 平均的なケースでは定数(O(`1`))だが、最悪のケースではコンテナの要素数に比例(O([`size`](size.md)`()`)) +- (3) : 平均的なケースでは削除された要素数に比例(O([`count`](count.md)`(k)`))だが、最悪のケースではコンテナの要素数に比例(O([`size`](size.md)`()`)) +- (4) : 平均的なケースでは指定された範囲の要素数に比例(O(`std::`[`distance`](/reference/iterator/distance.md)`(first, last)`))だが、最悪のケースではコンテナの要素数に比例(O([`size`](size.md)`()`)) ## 備考 @@ -86,10 +88,10 @@ int main() std::cout << std::endl; } - // 指定したキーと等価な要素を削除((2)の形式) + // 指定したキーと等価な要素を削除((3)の形式) { std::unordered_multiset ums{ 1, 3, 5, 7, 9, 3, }; - print("(2) erase(const value_type&) before", ums); + print("(3) erase(const value_type&) before", ums); auto count1 = ums.erase(5); auto count2 = ums.erase(8); @@ -100,10 +102,10 @@ int main() std::cout << std::endl; } - // 指定した位置にある要素を削除((3)の形式) + // 指定した位置にある要素を削除((4)の形式) { std::unordered_multiset ums{ 1, 3, 5, 7, 9, 3, }; - print("(3) erase(const_iterator, const_iterator) before", ums); + print("(4) erase(const_iterator, const_iterator) before", ums); auto it1 = std::next(ums.cbegin()); auto it2 = std::next(it1, 2); @@ -127,12 +129,12 @@ argument: 1 return value: 3 after : 9 7 5 3 3 -(2) erase(const value_type&) before : 9 7 5 1 3 3 +(3) erase(const value_type&) before : 9 7 5 1 3 3 argument: 5, 8, 3 return value: 1, 0, 2 after : 9 7 1 -(3) erase(const_iterator, const_iterator) before : 9 7 5 1 3 3 +(4) erase(const_iterator, const_iterator) before : 9 7 5 1 3 3 arguments: 7, 1 return value: 1 after : 9 1 3 3 @@ -202,5 +204,5 @@ int main() ## 参照 - [LWG Issue 518. Are `insert` and `erase` stable for `unordered_multiset` and `unordered_multimap`?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#518) - 安定性の保証が規定された経緯のレポート - - +- [LWG Issue 2059. C++0x ambiguity problem with `map::erase`](https://cplusplus.github.io/LWG/issue2059) + - C++17で、`erase(iterator)`を追加 diff --git a/reference/unordered_set/unordered_set/erase.md b/reference/unordered_set/unordered_set/erase.md index 8a6c214acc..cab1403e86 100644 --- a/reference/unordered_set/unordered_set/erase.md +++ b/reference/unordered_set/unordered_set/erase.md @@ -6,11 +6,13 @@ * cpp11[meta cpp] ```cpp -iterator erase(const_iterator position); // (1) +iterator erase(iterator position); // (1) C++17 -size_type erase(const key_type& k); // (2) +iterator erase(const_iterator position); // (2) C++11 -iterator erase(const_iterator first, const_iterator last); // (3) +size_type erase(const key_type& k); // (3) C++11 + +iterator erase(const_iterator first, const_iterator last); // (4) C++11 ``` ## 概要 @@ -24,30 +26,30 @@ iterator erase(const_iterator first, const_iterator last); // (3) ## 効果 -- (1) : `position` で指定された要素を削除する。 -- (2) : `k` と等価なキーの要素を削除する。 -- (3) : イテレータ範囲`[first, last)`にある要素を全て削除する。 +- (1), (2) : `position` で指定された要素を削除する。 +- (3) : `k` と等価なキーの要素を削除する。 +- (4) : イテレータ範囲`[first, last)`にある要素を全て削除する。 ## 戻り値 -- (1) : 「削除前に、削除された要素の次だった位置」を指すイテレータ。`erase()` を呼び出しても削除された要素以外を指す全てのイテレータは無効にならないため、`std::`[`next`](/reference/iterator/next.md)`(position)` と同じ位置を指す `iterator` である。 +- (1), (2) : 「削除前に、削除された要素の次だった位置」を指すイテレータ。`erase()` を呼び出しても削除された要素以外を指す全てのイテレータは無効にならないため、`std::`[`next`](/reference/iterator/next.md)`(position)` と同じ位置を指す `iterator` である。 なお、`position` は `const_iterator` なのに対して、戻り値は `iterator` であるため注意が必要だが、非順序連想コンテナの場合いずれにせよどちらも読み取り専用イテレータである。 -- (2) : 削除した要素数。つまり、`k` と等価なキーの要素があれば 1、無ければ 0。 -- (3) : 「削除前に、削除された要素の範囲の次だった位置」を指すイテレータ。`erase()` を呼び出しても削除された要素以外を指す全てのイテレータは無効にならないため、`last` と同じ位置を指す `iterator` である。 +- (3) : 削除した要素数。つまり、`k` と等価なキーの要素があれば 1、無ければ 0。 +- (4) : 「削除前に、削除された要素の範囲の次だった位置」を指すイテレータ。`erase()` を呼び出しても削除された要素以外を指す全てのイテレータは無効にならないため、`last` と同じ位置を指す `iterator` である。 なお、`first` 及び `last` は `const_iterator` なのに対して、戻り値は `iterator` であるため注意が必要だが、非順序連想コンテナの場合いずれにせよどちらも読み取り専用イテレータである。 また、要件に示したように `first` が間接参照可能である必要がなかった場合にも、他の種類のコンテナの戻り値と照らし合わせると、`last` と同じ位置を指す `iterator` を返すのが適切であるものと思われる。 ## 例外 -- (1) : 投げない。 -- (2) : コンテナの `key_equal` と `hasher` のオブジェクト(それぞれ `key_eq()` と `hash_function()` が返すオブジェクト)が例外を投げなければ、例外を投げない。 -- (3) : 投げない。 +- (1), (2) : 投げない。 +- (3) : コンテナの `key_equal` と `hasher` のオブジェクト(それぞれ `key_eq()` と `hash_function()` が返すオブジェクト)が例外を投げなければ、例外を投げない。 +- (4) : 投げない。 ## 計算量 -- (1) : 平均的なケースでは定数(O(`1`))だが、最悪のケースではコンテナの要素数に比例(O([`size`](size.md)`()`)) -- (2) : 平均的なケースでは削除された要素数に比例(O([`count`](count.md)`(k)`))だが、最悪のケースではコンテナの要素数に比例(O([`size`](size.md)`()`)) -- (3) : 平均的なケースでは指定された範囲の要素数に比例(O(`std::`[`distance`](/reference/iterator/distance.md)`(first, last)`))だが、最悪のケースではコンテナの要素数に比例(O([`size`](size.md)`()`)) +- (1), (2) : 平均的なケースでは定数(O(`1`))だが、最悪のケースではコンテナの要素数に比例(O([`size`](size.md)`()`)) +- (3) : 平均的なケースでは削除された要素数に比例(O([`count`](count.md)`(k)`))だが、最悪のケースではコンテナの要素数に比例(O([`size`](size.md)`()`)) +- (4) : 平均的なケースでは指定された範囲の要素数に比例(O(`std::`[`distance`](/reference/iterator/distance.md)`(first, last)`))だが、最悪のケースではコンテナの要素数に比例(O([`size`](size.md)`()`)) ## 備考 @@ -86,10 +88,10 @@ int main() std::cout << std::endl; } - // 指定したキーと等価な要素を削除((2)の形式) + // 指定したキーと等価な要素を削除((3)の形式) { std::unordered_set us{ 1, 3, 5, 7, 9, }; - print("(2) erase(const value_type&) before", us); + print("(3) erase(const value_type&) before", us); auto count1 = us.erase(5); auto count2 = us.erase(8); @@ -99,10 +101,10 @@ int main() std::cout << std::endl; } - // 指定した位置にある要素を削除((3)の形式) + // 指定した位置にある要素を削除((4)の形式) { std::unordered_set us{ 1, 3, 5, 7, 9, }; - print("(3) erase(const_iterator, const_iterator) before", us); + print("(4) erase(const_iterator, const_iterator) before", us); auto it1 = std::next(us.cbegin()); auto it2 = std::next(it1, 2); @@ -126,12 +128,12 @@ argument: 3 return value: 1 after : 9 7 5 1 -(2) erase(const value_type&) before : 9 7 5 3 1 +(3) erase(const value_type&) before : 9 7 5 3 1 argument: 5, 8 return value: 1, 0 after : 9 7 3 1 -(3) erase(const_iterator, const_iterator) before : 9 7 5 3 1 +(4) erase(const_iterator, const_iterator) before : 9 7 5 3 1 arguments: 7, 3 return value: 3 after : 9 3 1 @@ -186,9 +188,6 @@ int main() - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? -## 参照 -- [N2350 Container insert/erase and iterator constness (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2350.pdf) - ## 関連項目 @@ -200,3 +199,8 @@ int main() | [`clear`](clear.md) | 全要素の削除 | | [`swap`](swap.md) | 内容の交換 | + +## 参照 +- [N2350 Container insert/erase and iterator constness (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2350.pdf) +- [LWG Issue 2059. C++0x ambiguity problem with `map::erase`](https://cplusplus.github.io/LWG/issue2059) + - C++17で、`erase(iterator)`を追加 From 6eaa82d487e3c732fa17de04e4bf624125036174 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 22 Jun 2023 16:34:17 +0900 Subject: [PATCH 0356/3948] =?UTF-8?q?map=20/=20set=E3=81=AEextract=20:=20C?= =?UTF-8?q?++23=E3=81=A7=E3=81=AEheterogeneous=E3=81=AA=E3=82=AA=E3=83=BC?= =?UTF-8?q?=E3=83=90=E3=83=BC=E3=83=AD=E3=83=BC=E3=83=89=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/map/map/extract.md | 26 +++++++++++++++++--------- reference/map/multimap/extract.md | 28 ++++++++++++++++++---------- reference/set/multiset/extract.md | 29 +++++++++++++++++++---------- reference/set/set/extract.md | 29 +++++++++++++++++++---------- 4 files changed, 73 insertions(+), 39 deletions(-) diff --git a/reference/map/map/extract.md b/reference/map/map/extract.md index 07df0c89bc..d181eed22f 100644 --- a/reference/map/map/extract.md +++ b/reference/map/map/extract.md @@ -6,13 +6,20 @@ * cpp17[meta cpp] ```cpp -node_type extract(const_iterator position); (1) -node_type extract(const key_type& x); (2) +node_type extract(const_iterator position); // (1) C++17 + +node_type extract(const key_type& x); // (2) C++17 + +template +node_type extract(K&& x); // (3) C++23 ``` ## 概要 -(1) `position`が指すノードを切り離し、その要素を所有する[ノードハンドル](/reference/node_handle/node_handle.md)を返す。 -(2) `x`と等価なキーが見つかった場合、`x`が指すノードを切り離し、その要素を所有するノードハンドルを返す。それ以外の場合は空のノードハンドルを返す。 +指定された要素を`*this`から切り離し、その要素を所有する[ノードハンドル](/reference/node_handle/node_handle.md)を取得する。 + +- (1) : `position`が指すノードを切り離す +- (2) : `x`と等価なキーをもつノードを切り離す +- (3) : `key_type`と比較可能な`x`と等価なキーをもつノードを切り離す ## 戻り値 @@ -20,13 +27,13 @@ node_type extract(const key_type& x); (2) ## 計算量 -(1) 償却定数時間 -(2) `map a;`のとき、log(a.size()) +- (1) : 償却定数時間 +- (2), (3) : 要素数を`N`として、`log(N)` ## 備考 -`extract`は、要素に対するコピーもムーブも行わずに、要素の所有権を転送することができる。 -また、`extract`は再確保なしでマップ要素のキーを変更することができる。 +- この関数は、要素に対するコピーもムーブも行わずに、要素の所有権を転送することができる +- この関数は、再確保なしでマップ要素のキーを変更することができる ## 例 @@ -96,4 +103,5 @@ m2 : ## 参照 - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) - +- [P2077R3 Heterogeneous erasure overloads for associative containers](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2077r3.html) + - C++23で、`template extract(K&& x)`のオーバーロードが追加された diff --git a/reference/map/multimap/extract.md b/reference/map/multimap/extract.md index ba164ebf2e..280b5cee4e 100644 --- a/reference/map/multimap/extract.md +++ b/reference/map/multimap/extract.md @@ -6,27 +6,34 @@ * cpp17[meta cpp] ```cpp -node_type extract(const_iterator position); (1) -node_type extract(const key_type& x); (2) +node_type extract(const_iterator position); // (1) C++17 + +node_type extract(const key_type& x); // (2) C++17 + +template +node_type extract(K&& x); // (3) C++23 ``` ## 概要 -(1) `position`が指すノードを切り離し、その要素を所有する[ノードハンドル](/reference/node_handle/node_handle.md)を返す。 -(2) `x`と等価なキーが見つかった場合、`x`が指す最初の要素を持つノードを切り離し、その要素を所有するノードハンドルを返す。それ以外の場合は空のノードハンドルを返す。 +指定された要素を`*this`から切り離し、その要素を所有する[ノードハンドル](/reference/node_handle/node_handle.md)を取得する。 + +- (1) : `position`が指すノードを切り離す +- (2) : `x`と等価なキーをもつノードをすべて切り離す +- (3) : `key_type`と比較可能な`x`と等価なキーをもつノードをすべて切り離す ## 戻り値 -要素を所有するノードハンドル。ただし、オーバーロード(2)の場合は空のノードハンドルの可能性がある。 +要素を所有するノードハンドル。ただし、オーバーロード(2), (3)の場合は空のノードハンドルの可能性がある。 ## 計算量 -(1) 償却定数時間 -(2) log((*this).size()) +- (1) : 償却定数時間 +- (2), (3) : 要素数を`N`として、`log(N)` ## 備考 -`extract`は、要素に対するコピーもムーブも行わずに、要素の所有権を転送することができる。 -また、`extract`は再確保なしでマップ要素のキーを変更することができる。 +- この関数は、要素に対するコピーもムーブも行わずに、要素の所有権を転送することができる +- この関数は、再確保なしでマップ要素のキーを変更することができる ## 例 @@ -96,4 +103,5 @@ m2 : ## 参照 - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) - +- [P2077R3 Heterogeneous erasure overloads for associative containers](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2077r3.html) + - C++23で、`template extract(K&& x)`のオーバーロードが追加された diff --git a/reference/set/multiset/extract.md b/reference/set/multiset/extract.md index 468599150e..960f6ac4ed 100644 --- a/reference/set/multiset/extract.md +++ b/reference/set/multiset/extract.md @@ -6,27 +6,35 @@ * cpp17[meta cpp] ```cpp -node_type extract(const_iterator position); (1) -node_type extract(const key_type& x); (2) +node_type extract(const_iterator position); // (1) C++17 + +node_type extract(const key_type& x); // (2) C++17 + +template +node_type extract(K&& x); // (3) C++23 ``` ## 概要 -(1) `position`が指すノードを切り離し、その要素を所有する[ノードハンドル](/reference/node_handle/node_handle.md)を返す。 -(2) `x`と等価なキーが見つかった場合、`x`が指す最初の要素を持つノードを切り離し、その要素を所有するノードハンドルを返す。それ以外の場合は空のノードハンドルを返す。 +指定された要素を`*this`から切り離し、その要素を所有する[ノードハンドル](/reference/node_handle/node_handle.md)を取得する。 + +- (1) : `position`が指すノードを切り離す +- (2) : `x`と等価なキーをもつノードをすべて切り離す +- (3) : `key_type`と比較可能な`x`と等価なキーをもつノードをすべて切り離す ## 戻り値 -要素を所有するノードハンドル。ただし、オーバーロード(2)の場合は空のノードハンドルの可能性がある。 +要素を所有するノードハンドル。ただし、オーバーロード(2), (3)の場合は空のノードハンドルの可能性がある。 ## 計算量 -(1) 償却定数時間 -(2) log((*this).size()) +- (1) : 償却定数時間 +- (2), (3) : 要素数を`N`として、`log(N)` ## 備考 -`extract`は、要素に対するコピーもムーブも行わずに、要素の所有権を転送することができる。 -また、`extract`は、ムーブオンリーオブジェクトを`multiset`から取り出すことができる。 +- この関数は、要素に対するコピーもムーブも行わずに、要素の所有権を転送することができる +- この関数は、再確保なしでマップ要素のキーを変更することができる + ```cpp example #include @@ -132,4 +140,5 @@ s2 = { 1, 2 } ## 参照 - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) - +- [P2077R3 Heterogeneous erasure overloads for associative containers](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2077r3.html) + - C++23で、`template extract(K&& x)`のオーバーロードが追加された diff --git a/reference/set/set/extract.md b/reference/set/set/extract.md index 8021f6bfbe..43a428d31d 100644 --- a/reference/set/set/extract.md +++ b/reference/set/set/extract.md @@ -6,27 +6,35 @@ * cpp17[meta cpp] ```cpp -node_type extract(const_iterator position); (1) -node_type extract(const key_type& x); (2) +node_type extract(const_iterator position); // (1) C++17 + +node_type extract(const key_type& x); // (2) C++17 + +template +node_type extract(K&& x); // (3) C++23 ``` ## 概要 -(1) `position`が指すノードを切り離し、その要素を所有する[ノードハンドル](/reference/node_handle/node_handle.md)を返す。 -(2) `x`と等価なキーが見つかった場合、`x`が指すノードを切り離し、その要素を所有するノードハンドルを返す。それ以外の場合は空のノードハンドルを返す。 +指定された要素を`*this`から切り離し、その要素を所有する[ノードハンドル](/reference/node_handle/node_handle.md)を取得する。 + +- (1) : `position`が指すノードを切り離す +- (2) : `x`と等価なキーをもつノードを切り離す +- (3) : `key_type`と比較可能な`x`と等価なキーをもつノードを切り離す ## 戻り値 -要素を所有するノードハンドル。ただし、オーバーロード(2)の場合は空のノードハンドルの可能性がある。 +要素を所有するノードハンドル。ただし、オーバーロード(2), (3)の場合は空のノードハンドルの可能性がある。 ## 計算量 -(1) 償却定数時間 -(2) log((*this).size()) +- (1) : 償却定数時間 +- (2), (3) : 要素数を`N`として、`log(N)` ## 備考 -`extract`は、要素に対するコピーもムーブも行わずに、要素の所有権を転送することができる。 -また、`extract`は、ムーブオンリーオブジェクトを`set`から取り出すことができる。 +- この関数は、要素に対するコピーもムーブも行わずに、要素の所有権を転送することができる +- この関数は、再確保なしでマップ要素のキーを変更することができる + ```cpp example #include @@ -132,4 +140,5 @@ s2 = { 1, 2 } ## 参照 - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) - +- [P2077R3 Heterogeneous erasure overloads for associative containers](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2077r3.html) + - C++23で、`template extract(K&& x)`のオーバーロードが追加された From a6c9e227b387d2aa8631acc1df6f78468d690702 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 22 Jun 2023 16:41:52 +0900 Subject: [PATCH 0357/3948] =?UTF-8?q?map=20/=20set=E3=81=AEerase=20:=20?= =?UTF-8?q?=E3=82=B5=E3=83=B3=E3=83=97=E3=83=AB=E3=82=B3=E3=83=BC=E3=83=89?= =?UTF-8?q?=E4=B8=AD=E3=81=A7=E6=9C=AA=E5=AE=9A=E7=BE=A9=E5=8B=95=E4=BD=9C?= =?UTF-8?q?=E3=82=92=E3=81=97=E3=81=A6=E3=81=84=E3=81=9F=E3=81=AE=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/map/map/erase.md | 4 ---- reference/map/multimap/erase.md | 4 ---- reference/set/multiset/erase.md | 4 ---- reference/set/set/erase.md | 4 ---- 4 files changed, 16 deletions(-) diff --git a/reference/map/map/erase.md b/reference/map/map/erase.md index 84fe25a4fa..f40a1cb9ac 100644 --- a/reference/map/map/erase.md +++ b/reference/map/map/erase.md @@ -99,9 +99,6 @@ int main() m.erase(1); std::cout << m.size() << std::endl; - m.erase(5); - std::cout << m.size() << std::endl; - m.erase(m.begin(), m.end()); std::cout << m.size() << std::endl; @@ -118,7 +115,6 @@ int main() ``` 3 2 -2 0 ``` diff --git a/reference/map/multimap/erase.md b/reference/map/multimap/erase.md index f52bcb6cff..47d878c4d0 100644 --- a/reference/map/multimap/erase.md +++ b/reference/map/multimap/erase.md @@ -99,9 +99,6 @@ int main() m.erase(1); std::cout << m.size() << std::endl; - m.erase(5); - std::cout << m.size() << std::endl; - m.erase(m.begin(), m.end()); std::cout << m.size() << std::endl; @@ -118,7 +115,6 @@ int main() ``` 3 2 -2 0 ``` diff --git a/reference/set/multiset/erase.md b/reference/set/multiset/erase.md index f8cd9641c1..4ed6d8977d 100644 --- a/reference/set/multiset/erase.md +++ b/reference/set/multiset/erase.md @@ -99,9 +99,6 @@ int main() c.erase(10); std::cout << c.size() << std::endl; - c.erase(5); - std::cout << c.size() << std::endl; - c.erase(c.begin(), c.end()); std::cout << c.size() << std::endl; } @@ -116,7 +113,6 @@ int main() ``` 3 1 -1 0 ``` diff --git a/reference/set/set/erase.md b/reference/set/set/erase.md index 683180d57c..2b3f85a0e3 100644 --- a/reference/set/set/erase.md +++ b/reference/set/set/erase.md @@ -99,9 +99,6 @@ int main() c.erase(10); std::cout << c.size() << std::endl; - c.erase(5); - std::cout << c.size() << std::endl; - c.erase(c.begin(), c.end()); std::cout << c.size() << std::endl; } @@ -116,7 +113,6 @@ int main() ``` 3 2 -2 0 ``` From 2ba5e134badc55935bde36761d61ced7bc9dcd68 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 22 Jun 2023 16:47:31 +0900 Subject: [PATCH 0358/3948] =?UTF-8?q?flat=5Fmap=20:=20erase=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20#1078?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map.md | 2 +- reference/flat_map/flat_map/erase.md | 169 +++++++++++++++++++++++++++ 2 files changed, 170 insertions(+), 1 deletion(-) create mode 100644 reference/flat_map/flat_map/erase.md diff --git a/reference/flat_map/flat_map.md b/reference/flat_map/flat_map.md index c699ae3a39..a64b6db0b9 100644 --- a/reference/flat_map/flat_map.md +++ b/reference/flat_map/flat_map.md @@ -64,7 +64,7 @@ namespace std { | [`emplace`](flat_map/emplace.md) | 要素を直接構築する | C++23 | | [`emplace_hint`](flat_map/emplace_hint.md) | ヒントを使って要素を直接構築する | C++23 | | [`try_emplace`](flat_map/try_emplace.md.nolink) | キーが存在しない場合のみ要素を直接構築する | C++23 | -| [`erase`](flaflat_maptmap/erase.md.nolink) | 要素を削除する | C++23 | +| [`erase`](flat_map/erase.md) | 要素を削除する | C++23 | | [`swap`](flat_map/swap.md.nolink) | コンテンツを交換する | C++23 | | [`extract`](flat_map/extract.md.nolink) | キーのコンテナ、値のコンテナを取得する | C++23 | | [`replace`](flat_map/replace.md.nolink) | キーのコンテナ、値のコンテナを置き換える | C++23 | diff --git a/reference/flat_map/flat_map/erase.md b/reference/flat_map/flat_map/erase.md new file mode 100644 index 0000000000..866a61380b --- /dev/null +++ b/reference/flat_map/flat_map/erase.md @@ -0,0 +1,169 @@ +# erase +* flat_map[meta header] +* std[meta namespace] +* flat_map[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +iterator erase(iterator position); // (1) C++23 + +iterator erase(const_iterator position); // (2) C++23 + +size_type erase(const key_type& x); // (3) C++23 + +template +size_type erase(K&& x); // (4) C++23 + +iterator erase(const_iterator first, const_iterator last); // (5) C++23 +``` + +## 概要 +単一要素またはイテレータ範囲`[first, last)`を `map` コンテナから削除する。 + +これは削除された要素の数だけコンテナの `size` を減らし、それぞれの要素のデストラクタを呼び出す。 + +- (1) : 指定されたイテレータが指す要素を削除する +- (2) : 指定された読み取り専用イテレータが指す要素を削除する +- (3) : 指定されたキーをもつ要素を削除する +- (4) : `key_type`と比較可能な`K`型のキーを受け取って要素を削除する +- (5) : 指定されたイテレータ範囲の要素をすべて削除する + + +## パラメータ +- `position` : 削除する単一要素を指すイテレータ。`iterator` はメンバ型であり、双方向イテレータとして定義される。 +- `x` : 削除する値のキー。`key_type` はメンバ型であり、コンテナの中で `Key` の別名として定義される。ここで `Key` は 1 番目のテンプレートパラメータであり、コンテナに格納される要素のキーの型である。 +- `first, last` : 削除するイテレータ範囲 `[first, last)` を指定するイテレータ。ここでいう範囲は `first` と `last` の間の全ての要素を含み、`first` が指す要素を含むが `last` が指す要素は含まない。 + + +## 戻り値 +- (1), (2), (5) : 削除された要素の次を指すイテレータを返す。そのような要素がない場合、[`end()`](end.md)を返す (要素を削除した結果としてコンテナが空になった場合) +- (3), (4) : 削除された要素の数を返す。 + + +## 計算量 +- (1), (2) : 定数時間 +- (3), (4) : コンテナの [`size()`](/reference/map/map/size.md) について対数時間 +- (5) : コンテナの [`size()`](/reference/map/map/size.md) について対数時間、それに加えて `first` と `last` の間の距離に対する線形時間 + + +## 備考 +- この関数に、範囲外のイテレータ (終端イテレータを含む) や存在しないキーを指定した場合の動作は未定義 +- 削除された要素を指すイテレータ、および、参照のみ無効になる。なお、規格書に明確な記載は無いが、削除された要素を指すポインタも無効になる +- ループ中で `map` の要素を削除するためには、C++03 までは以下のようなコードを書く必要があった。 + ```cpp + while (it != map_object.end()) { + if (条件) { + map_object.erase(it++); + } + else { + ++it; + } + } + ``` + + - これは、`erase` で指定したイテレータが、対象となる要素が削除されることによって無効になるため、後置インクリメント `it++` を使用することで要素が削除されるより先に削除対象の次の要素を指すようにするためである。 + - このような書き方は C++11 以降でも依然として有効だが、`erase` が削除された次の要素を指すイテレータを返すようになったため、以下のようなコードを + ```cpp + map_object.erase(it++); + ``` + + - 以下のように書くこともできるようになった + ```cpp + it = map_object.erase(it); + ``` + + +## 例 +### 基本的な使い方 (C++23) +```cpp example +#include +#include + +int main() +{ + std::flat_map fm = { + {1, 'A'}, + {2, 'B'}, + {3, 'C'} + }; + + std::cout << fm.size() << std::endl; + + fm.erase(1); + std::cout << fm.size() << std::endl; + + fm.erase(fm.begin(), fm.end()); + std::cout << fm.size() << std::endl; +} +``` +* erase[color ff0000] +* fm.size()[link size.md] +* fm.begin()[link begin.md] +* fm.end()[link end.md] + +#### 出力 +``` +3 +2 +0 +``` + +### イテレート中に要素を削除する (C++23) +```cpp example +#include +#include + +int main() +{ + std::flat_map fm = { + {3, 'a'}, + {1, 'b'}, + {4, 'c'} + }; + + // イテレート中に要素削除をするような場合には、 + // 範囲for文は使用できない + for (auto it = fm.begin(); it != fm.end();) { + // 条件一致した要素を削除する + if (it->first == 1) { + // 削除された要素の次を指すイテレータが返される。 + it = fm.erase(it); + } + // 要素削除をしない場合に、イテレータを進める + else { + ++it; + } + } + + for (const auto& [key, value] : fm) { + std::cout << key << ':' << value << std::endl; + } +} +``` + +#### 出力 +``` +3:a +4:c +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|---------------------------------|----------------------| +| [`flat_map::clear`](clear.md) | 全ての要素を削除する | +| [`flat_map::insert`](insert.md.nolink) | 要素を挿入する | +| [`flat_map::find`](find.md) | 指定したキーで要素を探す | + From 2c9f635eff6128691a72fb7312df6fe1f69deb8e Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 23 Jun 2023 13:50:47 +0900 Subject: [PATCH 0359/3948] =?UTF-8?q?flat=5Fmap=20:=20try=5Femplace?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20#1078?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map.md | 2 +- reference/flat_map/flat_map/emplace.md | 2 +- reference/flat_map/flat_map/emplace_hint.md | 4 +- reference/flat_map/flat_map/op_at.md | 12 +- reference/flat_map/flat_map/try_emplace.md | 178 ++++++++++++++++++++ 5 files changed, 188 insertions(+), 10 deletions(-) create mode 100644 reference/flat_map/flat_map/try_emplace.md diff --git a/reference/flat_map/flat_map.md b/reference/flat_map/flat_map.md index a64b6db0b9..fad9910105 100644 --- a/reference/flat_map/flat_map.md +++ b/reference/flat_map/flat_map.md @@ -63,7 +63,7 @@ namespace std { | [`insert_range`](flat_map/insert_range.md.nolink) | Rangeを挿入する | C++23 | | [`emplace`](flat_map/emplace.md) | 要素を直接構築する | C++23 | | [`emplace_hint`](flat_map/emplace_hint.md) | ヒントを使って要素を直接構築する | C++23 | -| [`try_emplace`](flat_map/try_emplace.md.nolink) | キーが存在しない場合のみ要素を直接構築する | C++23 | +| [`try_emplace`](flat_map/try_emplace.md) | キーが存在しない場合のみ要素を直接構築する | C++23 | | [`erase`](flat_map/erase.md) | 要素を削除する | C++23 | | [`swap`](flat_map/swap.md.nolink) | コンテンツを交換する | C++23 | | [`extract`](flat_map/extract.md.nolink) | キーのコンテナ、値のコンテナを取得する | C++23 | diff --git a/reference/flat_map/flat_map/emplace.md b/reference/flat_map/flat_map/emplace.md index 398b430840..b87c0a2030 100644 --- a/reference/flat_map/flat_map/emplace.md +++ b/reference/flat_map/flat_map/emplace.md @@ -135,5 +135,5 @@ CCC : (1, 2) | [`flat_map::insert`](insert.md.nolink) | 要素を挿入する | | [`flat_map::insert_or_assign`](insert_or_assign.md.nolink) | 要素を挿入、あるいは代入する | | [`flat_map::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | -| [`flat_map::try_emplace`](try_emplace.md.nolink) | キーが存在しない場合のみ要素を直接構築する | +| [`flat_map::try_emplace`](try_emplace.md) | キーが存在しない場合のみ要素を直接構築する | diff --git a/reference/flat_map/flat_map/emplace_hint.md b/reference/flat_map/flat_map/emplace_hint.md index c9516eae49..7a016946ba 100644 --- a/reference/flat_map/flat_map/emplace_hint.md +++ b/reference/flat_map/flat_map/emplace_hint.md @@ -28,7 +28,7 @@ iterator emplace_hint(const_iterator hint, Args&&... args); ## 備考 -- [`try_emplace`](try_emplace.md.nolink) と異なり、たとえ要素が挿入されなかった場合でも `value_type` 型のオブジェクトが構築される可能性があり、結果として引数 `args` が [`move`](/reference/utility/move.md) の対象となって変更されてしまっている可能性があるため、注意が必要である。 +- [`try_emplace`](try_emplace.md) と異なり、たとえ要素が挿入されなかった場合でも `value_type` 型のオブジェクトが構築される可能性があり、結果として引数 `args` が [`move`](/reference/utility/move.md) の対象となって変更されてしまっている可能性があるため、注意が必要である。 ## 例 @@ -78,5 +78,5 @@ int main() | [`flat_map::insert`](insert.md.nolink) | 要素を挿入する | | [`flat_map::insert_or_assign`](insert_or_assign.md.nolink) | 要素を挿入、あるいは代入する | | [`flat_map::emplace`](emplace.md) | 要素を直接構築する | -| [`flat_map::try_emplace`](try_emplace.md.nolink) | キーが存在しない場合のみ要素を直接構築する | +| [`flat_map::try_emplace`](try_emplace.md) | キーが存在しない場合のみ要素を直接構築する | diff --git a/reference/flat_map/flat_map/op_at.md b/reference/flat_map/flat_map/op_at.md index df611e9bd6..113fb30e2a 100644 --- a/reference/flat_map/flat_map/op_at.md +++ b/reference/flat_map/flat_map/op_at.md @@ -30,20 +30,20 @@ mapped_type& operator[](K&& x); // (3) C++23 ```cpp return try_emplace(x).first->second; ``` - * try_emplace[link try_emplace.md.nolink] + * try_emplace[link try_emplace.md] - (2) : 以下と等価 ```cpp return try_emplace(std::move(x)).first->second; ``` - * try_emplace[link try_emplace.md.nolink] + * try_emplace[link try_emplace.md] * std::move[link /reference/utility/move.md] - (3) : 以下と等価 ```cpp return try_emplace(std::forward(x)).first->second; ``` - * try_emplace[link try_emplace.md.nolink] + * try_emplace[link try_emplace.md] * std::forward[link /reference/utility/forward.md] @@ -75,9 +75,9 @@ int main() fm[2] = 'b'; } ``` -* m[1][color ff0000] -* m[2][color ff0000] -* m.insert[link insert.md.nolink] +* fm[1][color ff0000] +* fm[2][color ff0000] +* fm.insert[link insert.md.nolink] ### 出力 ``` diff --git a/reference/flat_map/flat_map/try_emplace.md b/reference/flat_map/flat_map/try_emplace.md new file mode 100644 index 0000000000..5a5d8c721a --- /dev/null +++ b/reference/flat_map/flat_map/try_emplace.md @@ -0,0 +1,178 @@ +# try_emplace +* flat_map[meta header] +* std[meta namespace] +* flat_map[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +template +pair + try_emplace(const key_type& k, + Args&&... args); // (1) C++23 + +template +pair + try_emplace(key_type&& k, + Args&&... args); // (2) C++23 + +template +iterator + try_emplace(const_iterator hint, + const key_type& k, + Args&&... args); // (3) C++23 + +template +iterator + try_emplace(const_iterator hint, + key_type&& k, + Args&&... args); // (4) C++23 + +template +pair + try_emplace(K&& k + Args&&... args); // (5) C++23 + +template +iterator + try_emplace(const_iterator hint, + K&& k, + Args&&... args); // (6) C++23 +``` +* pair[link /reference/utility/pair.md] + +## 概要 +指定されたキーが存在しない場合のみ要素を直接構築で挿入する。 + +引数 `k` と等価のキーを持つ要素が存在しない場合、コンテナに新しい要素を挿入する。要素は引数からコンテナ内に直接構築されるため、構築されたオブジェクトはコピーもムーブもされない。 +なお、本メンバ関数は [`emplace`](emplace.md) や [`emplace_hint`](emplace_hint.md) 等と異なり、引数 `k` と等価のキーを持つ要素が既に存在する場合には、`k` や `args` がムーブされてしまうことはない。 + +引数 `hint` は、`k` を検索する際のヒントに使用される。 + +- (1) : 指定されたキーが存在しない場合に、要素を直接構築で挿入する +- (2) : 指定された一時オブジェクトのキーが存在しない場合に、要素を直接構築で挿入する +- (3) : キーを検索するヒントを指定し、指定されたキーが存在しない場合に、要素を直接構築で挿入する +- (4) : キーを検索するヒントを指定し、指定された一時オブジェクトのキーが存在しない場合に、要素を直接構築で挿入する +- (5) : `key_type`と比較可能なキーが指定され、対応する存在しない場合に、要素を直接構築で挿入する +- (6) : keyを研削するヒントと`key_type`と比較可能なキーが指定され、対応する存在しない場合に、要素を直接構築で挿入する + + +## テンプレートパラメータ制約 +- [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true`であること +- (5), (6) : + - `Compare::is_transparent`が有効な式であること + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true`であること +- (5) : + - [`is_convertible_v`](/reference/type_traits/is_convertible.md)``と[`is_convertible_v`](/reference/type_traits/is_convertible.md)``がどちらも`false`であること + +なお、規格に記載はないが、`hint` は [`emplace_hint`](emplace_hint.md) と同様、コンテナの有効な読み取り専用イテレータである必要があるものと思われる。 + + +## 事前条件 +- (5), (6) : `k`から`key_type`への変換は、[`find`](find.md)`(k) ==` [`find`](find.md)`(u)`が`true`となるオブジェクト`u`を構築する + + +## 効果 +`k` と同値のキーを持つ要素を持っている場合、何もしない(引数への副作用もない)。そうでなければ、以下と等価: + +- (1), (2), (3), (4) : + ```cpp + auto key_it = ranges::upper_bound(c.keys, k, compare); + auto value_it = c.values.begin() + distance(c.keys.begin(), key_it); + c.keys.insert(key_it, std::forward(k)); + c.values.emplace(value_it, std::forward(args)...); + ``` + * c.keys[link containers.md] + * c.values[link containers.md] + * ranges::upper_bound[link /reference/algorithm/ranges_upper_bound.md] + * begin()[link /reference/vector/vector/begin.md] + * distance[link /reference/iterator/distance.md] + * insert[link /reference/vector/vector/insert.md] + * emplace[link /reference/vector/vector/emplace.md] + * std::forward[link /reference/utility/forward.md] + +- (5), (6) : + ```cpp + auto key_it = ranges::upper_bound(c.keys, k, compare); + auto value_it = c.values.begin() + distance(c.keys.begin(), key_it); + c.keys.emplace(key_it, std::forward(k)); + c.values.emplace(value_it, std::forward(args)...); + ``` + * c.keys[link containers.md] + * c.values[link containers.md] + * ranges::upper_bound[link /reference/algorithm/ranges_upper_bound.md] + * begin()[link /reference/vector/vector/begin.md] + * distance[link /reference/iterator/distance.md] + * emplace[link /reference/vector/vector/emplace.md] + * std::forward[link /reference/utility/forward.md] + + +## 戻り値 +- (1), (2), (5) : イテレータと `bool` 値の [`pair`](/reference/utility/pair.md) を返す。 + - 挿入された場合には、`first` に挿入された要素へのイテレータ、`second` に `true` が設定される。 + - 挿入されなかった場合には、`first` に `k` と等価のキーを持つ既存の要素へのイテレータ、`second` に `false` が設定される。 +- (3), (4), (6) : + - 挿入された場合には、挿入された要素へのイテレータを返す。 + - 挿入されなかった場合には、`k` と等価のキーを持つ既存の要素へのイテレータを返す。 + + +## 計算量 +- (1), (2), (5) : [`emplace`](emplace.md) と同じ +- (3), (4), (6) : [`emplace_hint`](emplace_hint.md) と同じ + + +## 備考 +- 概要に記載されているように、本メンバ関数は指定されたキーと等価の要素が既に存在する場合には、引数に副作用が発生しない。 + 一方、[`emplace`](emplace.md)、[`emplace_hint`](emplace_hint.md)、[`insert`](insert.md.nolink) にはそのような規定は無く、挿入がされなかった場合でも引数に副作用(引数からのムーブ)が発生してしまう可能性があるため、注意が必要である。 + + +## 例 +```cpp example +#include +#include +#include +#include + +int main() +{ + std::flat_map> fm; + + auto u1 = std::make_unique(114); + auto [it1, b1] = fm.try_emplace(42, std::move(u1)); + std::cout << std::boolalpha << (u1.get() == nullptr) << ", " << *it1->second << ", " << b1 << '\n'; + + auto u2 = std::make_unique(514); + auto [it2, b2] = fm.try_emplace(42, std::move(u2)); + std::cout << std::boolalpha << (u2.get() == nullptr) << ", " << *it2->second << ", " << b2 << '\n'; +} +``` +* try_emplace[color ff0000] +* get[link /reference/memory/unique_ptr/get.md] +* std::move[link /reference/utility/move.md] + +#### 出力 +``` +true, 114, true +false, 114, false +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|------------------------------------------------|--------------------------------------------| +| [`flat_map::insert`](insert.md.nolink) | 要素を挿入する | +| [`flat_map::insert_or_assign`](insert_or_assign.md.nolink) | 要素を挿入、あるいは代入する | +| [`flat_map::emplace`](emplace.md) | 要素を直接構築する | +| [`flat_map::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | + From c9cf59db4c0ab7b178340eef2d8f9c5799e5220c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 23 Jun 2023 17:37:04 +0900 Subject: [PATCH 0360/3948] =?UTF-8?q?map::try=5Femplace=20:=20=E6=A6=82?= =?UTF-8?q?=E8=A6=81=E6=96=87=E7=AB=A0=E3=82=92=E8=A3=9C=E5=BC=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/map/map/try_emplace.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/reference/map/map/try_emplace.md b/reference/map/map/try_emplace.md index 504b254d51..b9cb7d7b38 100644 --- a/reference/map/map/try_emplace.md +++ b/reference/map/map/try_emplace.md @@ -21,11 +21,18 @@ iterator try_emplace(const_iterator hint, key_type&& k, Args&&... args); * pair[link /reference/utility/pair.md] ## 概要 +指定されたキーが存在しない場合のみ要素を直接構築で挿入する。 + 引数 `k` と等価のキーを持つ要素が存在しない場合、コンテナに新しい要素を挿入する。要素は引数からコンテナ内に直接構築されるため、構築されたオブジェクトはコピーもムーブもされない。 なお、本メンバ関数は [`emplace`](emplace.md) や [`emplace_hint`](emplace_hint.md) 等と異なり、引数 `k` と等価のキーを持つ要素が既に存在する場合には、`k` や `args` がムーブされてしまうことはない。 引数 `hint` は、`k` を検索する際のヒントに使用される。 +- (1) : 指定されたキーが存在しない場合に、要素を直接構築で挿入する +- (2) : 指定された一時オブジェクトのキーが存在しない場合に、要素を直接構築で挿入する +- (3) : キーを検索するヒントを指定し、指定されたキーが存在しない場合に、要素を直接構築で挿入する +- (4) : キーを検索するヒントを指定し、指定された一時オブジェクトのキーが存在しない場合に、要素を直接構築で挿入する + ## テンプレートパラメータ制約 - (1)、(3) : `value_type` は、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(k)`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から `map` に直接構築可能であること From da669daebd77e3551c2bd9f68bcd745c0205981a Mon Sep 17 00:00:00 2001 From: OGAWA KenIchi Date: Sat, 24 Jun 2023 02:04:44 +0900 Subject: [PATCH 0361/3948] =?UTF-8?q?filesystem=5Ferror=E3=81=AE=E5=90=8D?= =?UTF-8?q?=E5=89=8D=E7=A9=BA=E9=96=93=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 属する名前空間をstdからstd::filesystemへ修正 --- reference/filesystem/filesystem_error.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/filesystem/filesystem_error.md b/reference/filesystem/filesystem_error.md index 872ff30da6..449928c39a 100644 --- a/reference/filesystem/filesystem_error.md +++ b/reference/filesystem/filesystem_error.md @@ -5,7 +5,7 @@ * cpp17[meta cpp] ```cpp -namespace std { +namespace std::filesystem { class filesystem_error : public system_error; } ``` From 717658da25868f54091bc273aaff7f7c5e46e02b Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sat, 24 Jun 2023 21:18:59 +0900 Subject: [PATCH 0362/3948] =?UTF-8?q?map=20/=20set=20/=20flat=5Fmap?= =?UTF-8?q?=E3=81=AEerase=20:=20=E5=AD=98=E5=9C=A8=E3=81=97=E3=81=AA?= =?UTF-8?q?=E3=81=84=E3=82=AD=E3=83=BC=E3=82=92=E6=8C=87=E5=AE=9A=E3=81=97?= =?UTF-8?q?=E3=81=9F=E5=A0=B4=E5=90=88=E3=81=A7=E3=82=82=E5=95=8F=E9=A1=8C?= =?UTF-8?q?=E3=81=AA=E3=81=8F=E5=8B=95=E4=BD=9C=E3=81=99=E3=82=8B=20(?= =?UTF-8?q?=E4=BD=95=E3=82=82=E3=81=97=E3=81=AA=E3=81=84)=20=E3=81=93?= =?UTF-8?q?=E3=81=A8=E3=82=92=E7=A2=BA=E8=AA=8D=20#1152?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map/erase.md | 2 +- reference/map/map/erase.md | 2 +- reference/map/multimap/erase.md | 2 +- reference/set/multiset/erase.md | 2 +- reference/set/set/erase.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/reference/flat_map/flat_map/erase.md b/reference/flat_map/flat_map/erase.md index 866a61380b..f689100106 100644 --- a/reference/flat_map/flat_map/erase.md +++ b/reference/flat_map/flat_map/erase.md @@ -48,7 +48,7 @@ iterator erase(const_iterator first, const_iterator last); // (5) C++23 ## 備考 -- この関数に、範囲外のイテレータ (終端イテレータを含む) や存在しないキーを指定した場合の動作は未定義 +- (1), (2) : この関数に、範囲外のイテレータ (終端イテレータを含む) を指定した場合の動作は未定義 - 削除された要素を指すイテレータ、および、参照のみ無効になる。なお、規格書に明確な記載は無いが、削除された要素を指すポインタも無効になる - ループ中で `map` の要素を削除するためには、C++03 までは以下のようなコードを書く必要があった。 ```cpp diff --git a/reference/map/map/erase.md b/reference/map/map/erase.md index f40a1cb9ac..11f2fa09a9 100644 --- a/reference/map/map/erase.md +++ b/reference/map/map/erase.md @@ -55,7 +55,7 @@ iterator erase(const_iterator first, const_iterator last); // (5) C++11 ## 備考 -- この関数に、範囲外のイテレータ (終端イテレータを含む) や存在しないキーを指定した場合の動作は未定義 +- (1), (2) : この関数に、範囲外のイテレータ (終端イテレータを含む) を指定した場合の動作は未定義 - 削除された要素を指すイテレータ、および、参照のみ無効になる。なお、規格書に明確な記載は無いが、削除された要素を指すポインタも無効になる - ループ中で `map` の要素を削除するためには、C++03 までは以下のようなコードを書く必要があった。 ```cpp diff --git a/reference/map/multimap/erase.md b/reference/map/multimap/erase.md index 47d878c4d0..335cddf5f2 100644 --- a/reference/map/multimap/erase.md +++ b/reference/map/multimap/erase.md @@ -55,7 +55,7 @@ iterator erase(const_iterator first, const_iterator last); // (5) C++11 ## 備考 -- この関数に、範囲外のイテレータ (終端イテレータを含む) や存在しないキーを指定した場合の動作は未定義 +- (1), (2) : この関数に、範囲外のイテレータ (終端イテレータを含む) を指定した場合の動作は未定義 - 削除された要素を指すイテレータ、および、参照のみ無効になる。なお、規格書に明確な記載は無いが、削除された要素を指すポインタも無効になる。 - ループ中で `multimap` の要素を削除するためには、C++03 までは以下のようなコードを書く必要があった。 ```cpp diff --git a/reference/set/multiset/erase.md b/reference/set/multiset/erase.md index 4ed6d8977d..b3aaab5492 100644 --- a/reference/set/multiset/erase.md +++ b/reference/set/multiset/erase.md @@ -55,7 +55,7 @@ iterator erase(const_iterator first, const_iterator last); // (5) C++11 ## 備考 -- この関数に、範囲外のイテレータ (終端イテレータを含む) や存在しないキーを指定した場合の動作は未定義 +- (1), (2) : この関数に、範囲外のイテレータ (終端イテレータを含む) を指定した場合の動作は未定義 - 削除された要素を指すイテレータ、および、参照のみ無効になる。なお、規格書に明確な記載は無いが、削除された要素を指すポインタも無効になる。 - ループ中で `multiset` の要素を削除するためには、C++03 までは以下のようなコードを書く必要があった。 ```cpp diff --git a/reference/set/set/erase.md b/reference/set/set/erase.md index 2b3f85a0e3..489bcdbc3d 100644 --- a/reference/set/set/erase.md +++ b/reference/set/set/erase.md @@ -55,7 +55,7 @@ iterator erase(const_iterator first, const_iterator last); // (5) C++11 ## 備考 -- この関数に、範囲外のイテレータ (終端イテレータを含む) や存在しないキーを指定した場合の動作は未定義 +- (1), (2) : この関数に、範囲外のイテレータ (終端イテレータを含む) を指定した場合の動作は未定義 - 削除された要素を指すイテレータ、および、参照のみ無効になる。なお、規格書に明確な記載は無いが、削除された要素を指すポインタも無効になる。 - ループ中で `set` の要素を削除するためには、C++03 までは以下のようなコードを書く必要があった。 ```cpp From 5674bf7cffb19f6e4c99d61e786dabb7ccfb5106 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sat, 24 Jun 2023 21:20:54 +0900 Subject: [PATCH 0363/3948] =?UTF-8?q?flat=5Fmap=E3=81=AEerase=20:=20flat?= =?UTF-8?q?=5Fmap=E3=81=A7=E3=81=AF=E8=A9=B2=E5=BD=93=E3=81=97=E3=81=AA?= =?UTF-8?q?=E3=81=84=E4=BB=95=E6=A7=98=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map/erase.md | 29 +++------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/reference/flat_map/flat_map/erase.md b/reference/flat_map/flat_map/erase.md index f689100106..9c39eed049 100644 --- a/reference/flat_map/flat_map/erase.md +++ b/reference/flat_map/flat_map/erase.md @@ -19,7 +19,7 @@ iterator erase(const_iterator first, const_iterator last); // (5) C++23 ``` ## 概要 -単一要素またはイテレータ範囲`[first, last)`を `map` コンテナから削除する。 +単一要素またはイテレータ範囲`[first, last)`を コンテナから削除する。 これは削除された要素の数だけコンテナの `size` を減らし、それぞれの要素のデストラクタを呼び出す。 @@ -43,35 +43,12 @@ iterator erase(const_iterator first, const_iterator last); // (5) C++23 ## 計算量 - (1), (2) : 定数時間 -- (3), (4) : コンテナの [`size()`](/reference/map/map/size.md) について対数時間 -- (5) : コンテナの [`size()`](/reference/map/map/size.md) について対数時間、それに加えて `first` と `last` の間の距離に対する線形時間 +- (3), (4) : コンテナの [`size()`](size.md) について対数時間 +- (5) : コンテナの [`size()`](size.md) について対数時間、それに加えて `first` と `last` の間の距離に対する線形時間 ## 備考 - (1), (2) : この関数に、範囲外のイテレータ (終端イテレータを含む) を指定した場合の動作は未定義 -- 削除された要素を指すイテレータ、および、参照のみ無効になる。なお、規格書に明確な記載は無いが、削除された要素を指すポインタも無効になる -- ループ中で `map` の要素を削除するためには、C++03 までは以下のようなコードを書く必要があった。 - ```cpp - while (it != map_object.end()) { - if (条件) { - map_object.erase(it++); - } - else { - ++it; - } - } - ``` - - - これは、`erase` で指定したイテレータが、対象となる要素が削除されることによって無効になるため、後置インクリメント `it++` を使用することで要素が削除されるより先に削除対象の次の要素を指すようにするためである。 - - このような書き方は C++11 以降でも依然として有効だが、`erase` が削除された次の要素を指すイテレータを返すようになったため、以下のようなコードを - ```cpp - map_object.erase(it++); - ``` - - - 以下のように書くこともできるようになった - ```cpp - it = map_object.erase(it); - ``` ## 例 From e7ee1d999620147a6423c73b2992803bf7185a50 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sat, 24 Jun 2023 21:23:22 +0900 Subject: [PATCH 0364/3948] =?UTF-8?q?map=20/=20set=E3=81=AEerase=20:=20era?= =?UTF-8?q?se(iterator)=E3=81=AF=E4=BB=95=E6=A7=98=E3=81=A8=E3=81=97?= =?UTF-8?q?=E3=81=A6=E3=81=AFC++17=E3=81=A7=E5=86=8D=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=E3=81=95=E3=82=8C=E3=81=9F=E3=81=8Cdefect=E3=81=AA=E3=81=AE?= =?UTF-8?q?=E3=81=A7C++14=E3=81=A7=E3=82=82=E4=BD=BF=E3=81=88=E3=82=8B?= =?UTF-8?q?=E5=A0=B4=E5=90=88=E3=81=8C=E3=81=82=E3=82=8B=E3=81=93=E3=81=A8?= =?UTF-8?q?=E3=82=92=E8=A8=98=E8=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/map/map/erase.md | 1 + reference/map/multimap/erase.md | 1 + reference/set/multiset/erase.md | 1 + reference/set/set/erase.md | 1 + 4 files changed, 4 insertions(+) diff --git a/reference/map/map/erase.md b/reference/map/map/erase.md index 11f2fa09a9..dfe1c708ef 100644 --- a/reference/map/map/erase.md +++ b/reference/map/map/erase.md @@ -55,6 +55,7 @@ iterator erase(const_iterator first, const_iterator last); // (5) C++11 ## 備考 +- (1) : C++17で再追加されたこのオーバーロードは、それ以前の言語バージョンから使用できる可能性がある - (1), (2) : この関数に、範囲外のイテレータ (終端イテレータを含む) を指定した場合の動作は未定義 - 削除された要素を指すイテレータ、および、参照のみ無効になる。なお、規格書に明確な記載は無いが、削除された要素を指すポインタも無効になる - ループ中で `map` の要素を削除するためには、C++03 までは以下のようなコードを書く必要があった。 diff --git a/reference/map/multimap/erase.md b/reference/map/multimap/erase.md index 335cddf5f2..e62de6e0f9 100644 --- a/reference/map/multimap/erase.md +++ b/reference/map/multimap/erase.md @@ -55,6 +55,7 @@ iterator erase(const_iterator first, const_iterator last); // (5) C++11 ## 備考 +- (1) : C++17で再追加されたこのオーバーロードは、それ以前の言語バージョンから使用できる可能性がある - (1), (2) : この関数に、範囲外のイテレータ (終端イテレータを含む) を指定した場合の動作は未定義 - 削除された要素を指すイテレータ、および、参照のみ無効になる。なお、規格書に明確な記載は無いが、削除された要素を指すポインタも無効になる。 - ループ中で `multimap` の要素を削除するためには、C++03 までは以下のようなコードを書く必要があった。 diff --git a/reference/set/multiset/erase.md b/reference/set/multiset/erase.md index b3aaab5492..8fa95adcdb 100644 --- a/reference/set/multiset/erase.md +++ b/reference/set/multiset/erase.md @@ -55,6 +55,7 @@ iterator erase(const_iterator first, const_iterator last); // (5) C++11 ## 備考 +- (1) : C++17で再追加されたこのオーバーロードは、それ以前の言語バージョンから使用できる可能性がある - (1), (2) : この関数に、範囲外のイテレータ (終端イテレータを含む) を指定した場合の動作は未定義 - 削除された要素を指すイテレータ、および、参照のみ無効になる。なお、規格書に明確な記載は無いが、削除された要素を指すポインタも無効になる。 - ループ中で `multiset` の要素を削除するためには、C++03 までは以下のようなコードを書く必要があった。 diff --git a/reference/set/set/erase.md b/reference/set/set/erase.md index 489bcdbc3d..2b4d0794d0 100644 --- a/reference/set/set/erase.md +++ b/reference/set/set/erase.md @@ -55,6 +55,7 @@ iterator erase(const_iterator first, const_iterator last); // (5) C++11 ## 備考 +- (1) : C++17で再追加されたこのオーバーロードは、それ以前の言語バージョンから使用できる可能性がある - (1), (2) : この関数に、範囲外のイテレータ (終端イテレータを含む) を指定した場合の動作は未定義 - 削除された要素を指すイテレータ、および、参照のみ無効になる。なお、規格書に明確な記載は無いが、削除された要素を指すポインタも無効になる。 - ループ中で `set` の要素を削除するためには、C++03 までは以下のようなコードを書く必要があった。 From c170374a913b9dbd4dceb07dbfa4eeba5489ed24 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sat, 24 Jun 2023 22:42:46 +0900 Subject: [PATCH 0365/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=83=9F?= =?UTF-8?q?=E3=82=B9=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/map/map/erase.md | 4 ++-- reference/map/multimap/erase.md | 4 ++-- reference/set/multiset/erase.md | 4 ++-- reference/set/set/erase.md | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/reference/map/map/erase.md b/reference/map/map/erase.md index dfe1c708ef..de6be33b32 100644 --- a/reference/map/map/erase.md +++ b/reference/map/map/erase.md @@ -50,8 +50,8 @@ iterator erase(const_iterator first, const_iterator last); // (5) C++11 ## 計算量 - (1), (2) : 定数時間 -- (3), (4) : コンテナの [`size()`](/reference/map/map/size.md) について対数時間 -- (5) : コンテナの [`size()`](/reference/map/map/size.md) について対数時間、それに加えて `first` と `last` の間の距離に対する線形時間 +- (3), (4) : コンテナの [`size()`](size.md) について対数時間 +- (5) : コンテナの [`size()`](size.md) について対数時間、それに加えて `first` と `last` の間の距離に対する線形時間 ## 備考 diff --git a/reference/map/multimap/erase.md b/reference/map/multimap/erase.md index e62de6e0f9..c67b298f1a 100644 --- a/reference/map/multimap/erase.md +++ b/reference/map/multimap/erase.md @@ -50,8 +50,8 @@ iterator erase(const_iterator first, const_iterator last); // (5) C++11 ## 計算量 - (1), (2) : 定数時間 -- (3), (4) : コンテナの [`size()`](/reference/map/map/size.md) について対数時間 -- (5) : コンテナの [`size()`](/reference/map/map/size.md) について対数時間、それに加えて `first` と `last` の間の距離に対する線形時間 +- (3), (4) : コンテナの [`size()`](size.md) について対数時間 +- (5) : コンテナの [`size()`](size.md) について対数時間、それに加えて `first` と `last` の間の距離に対する線形時間 ## 備考 diff --git a/reference/set/multiset/erase.md b/reference/set/multiset/erase.md index 8fa95adcdb..f4bfc5a4dc 100644 --- a/reference/set/multiset/erase.md +++ b/reference/set/multiset/erase.md @@ -50,8 +50,8 @@ iterator erase(const_iterator first, const_iterator last); // (5) C++11 ## 計算量 - (1), (2) : 定数時間 -- (3), (4) : コンテナの [`size()`](/reference/map/map/size.md) について対数時間 -- (5) : コンテナの [`size()`](/reference/map/map/size.md) について対数時間、それに加えて `first` と `last` の間の距離に対する線形時間 +- (3), (4) : コンテナの [`size()`](size.md) について対数時間 +- (5) : コンテナの [`size()`](size.md) について対数時間、それに加えて `first` と `last` の間の距離に対する線形時間 ## 備考 diff --git a/reference/set/set/erase.md b/reference/set/set/erase.md index 2b4d0794d0..385c77ac43 100644 --- a/reference/set/set/erase.md +++ b/reference/set/set/erase.md @@ -50,8 +50,8 @@ iterator erase(const_iterator first, const_iterator last); // (5) C++11 ## 計算量 - (1), (2) : 定数時間 -- (3), (4) : コンテナの [`size()`](/reference/map/map/size.md) について対数時間 -- (5) : コンテナの [`size()`](/reference/map/map/size.md) について対数時間、それに加えて `first` と `last` の間の距離に対する線形時間 +- (3), (4) : コンテナの [`size()`](size.md) について対数時間 +- (5) : コンテナの [`size()`](size.md) について対数時間、それに加えて `first` と `last` の間の距離に対する線形時間 ## 備考 From 0b736455a3af08ad8f820288134a5935e0cb513d Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 30 Jun 2023 19:05:50 +0900 Subject: [PATCH 0366/3948] =?UTF-8?q?flat=5Fmap=20:=20swap=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20#1078?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map.md | 2 +- reference/flat_map/flat_map/swap.md | 81 +++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 reference/flat_map/flat_map/swap.md diff --git a/reference/flat_map/flat_map.md b/reference/flat_map/flat_map.md index fad9910105..498606679e 100644 --- a/reference/flat_map/flat_map.md +++ b/reference/flat_map/flat_map.md @@ -65,7 +65,7 @@ namespace std { | [`emplace_hint`](flat_map/emplace_hint.md) | ヒントを使って要素を直接構築する | C++23 | | [`try_emplace`](flat_map/try_emplace.md) | キーが存在しない場合のみ要素を直接構築する | C++23 | | [`erase`](flat_map/erase.md) | 要素を削除する | C++23 | -| [`swap`](flat_map/swap.md.nolink) | コンテンツを交換する | C++23 | +| [`swap`](flat_map/swap.md) | コンテンツを交換する | C++23 | | [`extract`](flat_map/extract.md.nolink) | キーのコンテナ、値のコンテナを取得する | C++23 | | [`replace`](flat_map/replace.md.nolink) | キーのコンテナ、値のコンテナを置き換える | C++23 | diff --git a/reference/flat_map/flat_map/swap.md b/reference/flat_map/flat_map/swap.md new file mode 100644 index 0000000000..8f483eb1e9 --- /dev/null +++ b/reference/flat_map/flat_map/swap.md @@ -0,0 +1,81 @@ +# swap +* flat_map[meta header] +* std[meta namespace] +* flat_map[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +void swap(flat_map& y) noexcept; // (1) C++23 +``` + +## 概要 +コンテナ内のコンテンツを、同じ型の要素を保持する他の `flat_map` オブジェクトである `y` 内のコンテンツと交換する。 + +このメンバ関数の呼び出しの後、呼び出し前にコンテナ内にあった要素は `y` へ、`y` 内にあった要素は `*this` へ移る。 + + +## 計算量 +定数時間 + + +## 例 +```cpp example +#include +#include + +template +void print(const char* name, const Map& m) +{ + std::cout << name << " : {"; + + bool first = true; + + for (const auto& x : m) { + if (first) { + first = false; + } + else { + std::cout << ", "; + } + std::cout << "[" << x.first << "," << x.second << "]"; + } + std::cout << "}" << std::endl; +} + +int main() +{ + std::flat_map fm1 = { + {10, 'a'}, + {20, 'b'}, + {30, 'c'} + }; + + std::flat_map fm2 = { + {5, 'd'}, + {15, 'e'} + }; + + // fm1とfm2を入れ替える + fm1.swap(fm2); + + print("fm1", fm1); + print("fm2", fm2); +} +``` + +### 出力 +``` +fm1 : {[5,d], [15,e]} +fm2 : {[10,a], [20,b], [30,c]} +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + From 3021561ee5b45ef4b53eed34d4207d0ae946888d Mon Sep 17 00:00:00 2001 From: Kisaragi <48310258+KisaragiEffective@users.noreply.github.com> Date: Sat, 1 Jul 2023 03:32:45 +0900 Subject: [PATCH 0367/3948] =?UTF-8?q?ICX=E3=81=AE=E3=83=AA=E3=83=B3?= =?UTF-8?q?=E3=82=AF=E3=83=A9=E3=83=99=E3=83=AB=E3=82=92=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E3=81=97=E3=81=BE=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/implementation-status.md b/implementation-status.md index a24835dc9c..eb91cf5bcd 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -288,7 +288,7 @@ - Visual C++ (MSVC): - [Visual C++ 言語への準拠](https://docs.microsoft.com/ja-jp/cpp/visual-cpp-language-conformance) - [次リリース情報(VS2019,2022) - Change log](https://github.com/microsoft/STL/wiki/Changelog) -- ICX: [C+23 Features Supported by Intel® C+ Compiler](https://www.intel.com/content/www/us/en/developer/articles/technical/c23-features-supported-by-intel-c-compiler.html) +- ICX: [C++23 Features Supported by Intel® C++ Compiler](https://www.intel.com/content/www/us/en/developer/articles/technical/c23-features-supported-by-intel-c-compiler.html) [gcc]: ./implementation.md#gcc [clang]: ./implementation.md#clang From 592119b916a6fd6c2559f8f2f35b896bc4abdd4a Mon Sep 17 00:00:00 2001 From: OGAWA KenIchi Date: Sat, 1 Jul 2023 18:38:08 +0900 Subject: [PATCH 0368/3948] =?UTF-8?q?allocator:=20C++20=E3=81=A7=E3=81=AEs?= =?UTF-8?q?ize=5Ftype=E3=81=A8difference=5Ftype=E3=81=AE=E6=89=B1=E3=81=84?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * C++17で非推奨となったがC++20では非推奨が取り消されている模様 https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0619r4.html#3.9 --- lang/cpp20.md | 4 +--- reference/memory/allocator.md | 5 +++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lang/cpp20.md b/lang/cpp20.md index 3a48506f10..9acb56e12d 100644 --- a/lang/cpp20.md +++ b/lang/cpp20.md @@ -339,9 +339,7 @@ C++20とは、2020年中に改訂され、ISO/IEC 14882:2020で標準規格化 ### 機能の削除 -- C++11で[`allocator_traits`](/reference/memory/allocator_traits.md)クラスが導入されたことでC++17から非推奨化されていた、[`allocator`](/reference/memory/allocator.md)の以下のメンバを削除: - - `size_type`型 - - `difference_type`型 +- C++11で[`allocator_traits`](/reference/memory/allocator_traits.md)クラスが導入されたことでC++17から非推奨化されていた、[`allocator`](/reference/memory/allocator.md)の以下のメンバを削除。なお、`size_type`型と`difference_type`型の非推奨は取り消された。 - `pointer`型 - `const_pointer`型 - `reference`型 diff --git a/reference/memory/allocator.md b/reference/memory/allocator.md index d544395168..b13fc7f282 100644 --- a/reference/memory/allocator.md +++ b/reference/memory/allocator.md @@ -56,8 +56,8 @@ C++11から: |-------------------|----------------------------------------------|-------| | `value_type` | 要素の型 `T` | | | `propagate_on_container_move_assignment` | コンテナのムーブ代入時に、アロケータの状態を伝播するか。 [`true_type`](/reference/type_traits/true_type.md) | C++14 | -| `size_type` | 要素数を表す符号なし整数型 `size_t` | C++17から非推奨
C++20で削除 | -| `difference_type` | ポインタの差を表す符号付き整数型 `ptrdiff_t` | C++17から非推奨
C++20で削除 | +| `size_type` | 要素数を表す符号なし整数型 `size_t` | | +| `difference_type` | ポインタの差を表す符号付き整数型 `ptrdiff_t` | | | `pointer` | 要素のポインタ型 `T*` | C++17から非推奨
C++20で削除 | | `const_pointer` | 読み取り専用の要素のポインタ型 `const T*` | C++17から非推奨
C++20で削除 | | `reference` | 要素の参照型 `T&` | C++17から非推奨
C++20で削除 | @@ -77,6 +77,7 @@ C++11から: ## 非推奨・削除の詳細 C++17から`void`の特殊化版が非推奨となり、C++20で削除された。代わりに[`std::allocator_traits`](allocator_traits.md)クラスの`rebind`機能を使用すること。 +メンバ型の`size_type`と`difference_type`は、C++17で非推奨となったがC++20で非推奨が取り消された。 ## 例 ```cpp example From dc598a2bf6edb642f7fce7599b01aa9b29550568 Mon Sep 17 00:00:00 2001 From: acd1034 <48613285+acd1034@users.noreply.github.com> Date: Sun, 2 Jul 2023 20:35:22 +0900 Subject: [PATCH 0369/3948] =?UTF-8?q?=E3=82=AA=E3=83=AA=E3=82=B8=E3=83=8A?= =?UTF-8?q?=E3=83=AB=E6=9B=B8=E5=BC=8F=E3=82=92=E5=AE=9A=E7=BE=A9=E3=81=99?= =?UTF-8?q?=E3=82=8B=E4=BE=8B=E3=81=AE=E5=8F=82=E7=85=A7=E4=BF=AE=E9=A3=BE?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/range_formatter.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/format/range_formatter.md b/reference/format/range_formatter.md index f838252ef3..f093eca863 100644 --- a/reference/format/range_formatter.md +++ b/reference/format/range_formatter.md @@ -92,7 +92,7 @@ public: // format()関数は書式の情報をもたない。 // parse()関数で解析した書式をメンバ変数で保持しておいて、 // それをもとに書式化する - auto format(MyVector&& v, std::format_context& fctx) const { + auto format(const MyVector& v, std::format_context& fctx) const { if (is_colon) { auto out = fctx.out(); bool is_first = true; From 313f64e6b708f264cb2d24e2ead385d5c6e65555 Mon Sep 17 00:00:00 2001 From: acd1034 <48613285+acd1034@users.noreply.github.com> Date: Sun, 2 Jul 2023 20:50:32 +0900 Subject: [PATCH 0370/3948] =?UTF-8?q?fmt-iter-for=E3=81=8C=E6=9C=AA?= =?UTF-8?q?=E8=A6=8F=E5=AE=9A=E3=81=AE=E5=9E=8B=E3=81=A7=E3=81=82=E3=82=8B?= =?UTF-8?q?=E3=81=93=E3=81=A8=E3=82=92=E6=98=8E=E7=A4=BA=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/formattable.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/reference/format/formattable.md b/reference/format/formattable.md index 7932564e3e..cc329fe3ef 100644 --- a/reference/format/formattable.md +++ b/reference/format/formattable.md @@ -7,7 +7,7 @@ ```cpp namespace std { template - concept fmt-iter-for = output_iterator; + using fmt-iter-for = /* unspecified */; template concept formattable = @@ -23,6 +23,8 @@ namespace std { }; } ``` +* fmt-iter-for[italic] +* unspecified[italic] * formatter[link formatter.md] * semiregular[link /reference/concepts/semiregular.md] * basic_format_context[link basic_format_context.md] @@ -33,6 +35,7 @@ namespace std { このコンセプトを使用することで、[`formatter`](formatter.md)クラステンプレートが使用したい型で特殊化されているかをチェックできる。 +`formattable`コンセプトの定義において使用されている`fmt-iter-for`は、[`output_iterator`](/reference/iterator/output_iterator.md)コンセプトのモデルとなる未規定の型である。 ## 例 ```cpp example From 3c6b49c2e77dbe6621c285238164fda96fef1c1f Mon Sep 17 00:00:00 2001 From: Shunsuke Shimizu Date: Sun, 2 Jul 2023 21:08:17 +0900 Subject: [PATCH 0371/3948] =?UTF-8?q?basic=5Ffilebuf=E3=81=ABfstream?= =?UTF-8?q?=E3=83=98=E3=83=83=E3=83=80=E3=81=B8=E3=81=AE=E3=83=AA=E3=83=B3?= =?UTF-8?q?=E3=82=AF=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/fstream/basic_filebuf.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/fstream/basic_filebuf.md b/reference/fstream/basic_filebuf.md index fe04896755..798af5382d 100644 --- a/reference/fstream/basic_filebuf.md +++ b/reference/fstream/basic_filebuf.md @@ -22,7 +22,7 @@ Cの`FILE*`に対する入出力関数を使って実装される。 位置操作(`seekoff`と`seekpos`)は、入力・出力双方で共有される。 テンプレートパラメータとして文字型を受け取るようになっており、使用を容易にするため、以下のパラメータ設定済みエイリアスが定義されている。 -このエイリアスは``ヘッダと``ヘッダで定義されている。 +このエイリアスは[``](/reference/fstream.md)ヘッダと``ヘッダで定義されている。 | エイリアス | 説明 | 対応バージョン | |------------|------|----------------| From 94b0c912176e85c536b6a3d306995ee9da3c4590 Mon Sep 17 00:00:00 2001 From: g-suizu Date: Mon, 3 Jul 2023 16:21:38 +0900 Subject: [PATCH 0372/3948] =?UTF-8?q?=E5=8F=A4=E3=81=84=E8=A1=A8=E8=A8=98?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 単一要素の初期化リストをautoで受けた場合が、最新の仕様とこなっていて、 https://cpprefjp.github.io/lang/cpp17/new_rules_for_auto_deduction_from_braced-init-list.html と矛盾しているので修正してもらいたい --- lang/cpp11/initializer_lists.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lang/cpp11/initializer_lists.md b/lang/cpp11/initializer_lists.md index 30235501ff..edafb40052 100644 --- a/lang/cpp11/initializer_lists.md +++ b/lang/cpp11/initializer_lists.md @@ -258,11 +258,11 @@ int main() //auto x2 = {}; // コンパイルエラー!x2の型を推論できない ``` -- 単一要素の初期化子リストを`auto`で受けた場合、C++11では`std::initializer_list`型に推論されるが、C++17では`T`型に推論されるよう仕様が変更されるので注意 +- 単一要素の初期化子リストを`auto`で受けた場合、C++11では`std::initializer_list`型に推論されるが、C++17では直接初期化の場合`T`型に推論されるよう仕様が変更されるので注意 ```cpp - auto x = {1}; // C++11ではxの型はstd::initializer_list。 - // C++17ではxの型はintになる + auto x{1}; // C++17ではxの型はintになる + auto x = {1}; // C++11,17共に、xの型はstd::initializer_list。 ``` - 関数テンプレートのパラメータとして初期化子リストを受けとった場合は、`std::initializer_list`型には推論されない From 08a97ea65ad85cbb646cd58753e5860600ff337f Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Tue, 4 Jul 2023 00:53:39 +0900 Subject: [PATCH 0373/3948] =?UTF-8?q?typo:=20make=5Freverse=5Fiterator?= =?UTF-8?q?=E3=81=AE=E8=A8=80=E8=AA=9E=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7?= =?UTF-8?q?=E3=83=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 一部C++03になっていたのを修正 --- reference/iterator/make_reverse_iterator.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/iterator/make_reverse_iterator.md b/reference/iterator/make_reverse_iterator.md index 5f6d11908e..6998582c93 100644 --- a/reference/iterator/make_reverse_iterator.md +++ b/reference/iterator/make_reverse_iterator.md @@ -8,7 +8,7 @@ namespace std { template reverse_iterator - make_reverse_iterator(Iterator i); // C++03 + make_reverse_iterator(Iterator i); // C++14 template constexpr reverse_iterator From fb9bf3a994183126c8e0bde4f49c4738dacb1daa Mon Sep 17 00:00:00 2001 From: Shunsuke Shimizu Date: Wed, 5 Jul 2023 01:35:47 +0900 Subject: [PATCH 0374/3948] =?UTF-8?q?stringstream=E9=96=A2=E9=80=A3?= =?UTF-8?q?=E3=81=AE=E3=83=9A=E3=83=BC=E3=82=B8=E4=BD=9C=E6=88=90=E3=81=8A?= =?UTF-8?q?=E3=82=88=E3=81=B3=E3=80=81C++20=E3=81=A7=E3=81=AE=E5=8A=B9?= =?UTF-8?q?=E7=8E=87=E5=8C=96=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6=E5=8F=82?= =?UTF-8?q?=E7=85=A7=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp11/raw_string_literals.md | 4 +- lang/cpp11/variadic_templates.md | 2 +- reference/chrono/duration/op_ostream.md | 4 +- reference/complex/complex/op_ostream.md | 4 +- reference/iomanip/quoted.md | 2 +- reference/ios/basic_ios/rdbuf.md | 4 +- reference/ios/ios_base/iword.md | 2 +- reference/ios/ios_base/pword.md | 2 +- reference/ios/ios_base/register_callback.md | 2 +- reference/ios/ios_base/type-event.md | 2 +- reference/ios/ios_base/type-openmode.md | 4 +- reference/ios/ios_base/type-seekdir.md | 4 +- reference/ios/ios_base/xalloc.md | 2 +- reference/iterator/istream_iterator.md | 2 +- .../iterator/istream_iterator/op_arrow.md | 2 +- .../istream_iterator/op_constructor.md | 2 +- .../iterator/istream_iterator/op_deref.md | 2 +- .../iterator/istream_iterator/op_equal.md | 2 +- .../iterator/istream_iterator/op_increment.md | 2 +- .../iterator/istream_iterator/op_not_equal.md | 2 +- reference/iterator/istreambuf_iterator.md | 2 +- .../iterator/istreambuf_iterator/equal.md | 2 +- .../istreambuf_iterator/op_constructor.md | 2 +- .../iterator/istreambuf_iterator/op_deref.md | 2 +- .../iterator/istreambuf_iterator/op_equal.md | 2 +- .../istreambuf_iterator/op_increment.md | 2 +- .../istreambuf_iterator/op_not_equal.md | 2 +- .../limits/numeric_limits/max_digits10.md | 4 +- reference/ostream/basic_ostream/seekp.md | 4 +- reference/ostream/basic_ostream/tellp.md | 4 +- .../bernoulli_distribution/op_istream.md | 4 +- .../binomial_distribution/op_istream.md | 4 +- .../random/cauchy_distribution/op_istream.md | 4 +- .../chi_squared_distribution/op_istream.md | 4 +- .../random/discard_block_engine/op_istream.md | 4 +- .../discrete_distribution/op_istream.md | 4 +- .../exponential_distribution/op_istream.md | 4 +- .../extreme_value_distribution/op_istream.md | 4 +- .../fisher_f_distribution/op_istream.md | 4 +- .../random/gamma_distribution/op_istream.md | 4 +- .../geometric_distribution/op_istream.md | 4 +- .../independent_bits_engine/op_istream.md | 4 +- .../linear_congruential_engine/op_istream.md | 4 +- .../lognormal_distribution/op_istream.md | 4 +- .../mersenne_twister_engine/op_istream.md | 4 +- .../op_istream.md | 4 +- .../random/normal_distribution/op_istream.md | 4 +- .../op_istream.md | 4 +- .../op_istream.md | 4 +- .../random/poisson_distribution/op_istream.md | 4 +- .../random/shuffle_order_engine/op_istream.md | 4 +- .../student_t_distribution/op_istream.md | 4 +- .../subtract_with_carry_engine/op_istream.md | 4 +- .../uniform_int_distribution/op_istream.md | 4 +- .../uniform_real_distribution/op_istream.md | 4 +- .../random/weibull_distribution/op_istream.md | 4 +- reference/sstream.md | 18 +++--- reference/sstream/basic_istringstream.md | 20 +++--- reference/sstream/basic_istringstream/str.md | 33 ++++++++++ reference/sstream/basic_ostringstream.md | 64 +++++++++++++++++++ reference/sstream/basic_ostringstream/str.md | 33 ++++++++++ reference/sstream/basic_stringbuf.md | 57 +++++++++++++++++ reference/sstream/basic_stringbuf/str.md | 30 +++++++++ reference/sstream/basic_stringstream.md | 64 +++++++++++++++++++ reference/sstream/basic_stringstream/str.md | 33 ++++++++++ 65 files changed, 426 insertions(+), 108 deletions(-) create mode 100644 reference/sstream/basic_istringstream/str.md create mode 100644 reference/sstream/basic_ostringstream.md create mode 100644 reference/sstream/basic_ostringstream/str.md create mode 100644 reference/sstream/basic_stringbuf.md create mode 100644 reference/sstream/basic_stringbuf/str.md create mode 100644 reference/sstream/basic_stringstream.md create mode 100644 reference/sstream/basic_stringstream/str.md diff --git a/lang/cpp11/raw_string_literals.md b/lang/cpp11/raw_string_literals.md index c2e97999b2..1a12d53029 100644 --- a/lang/cpp11/raw_string_literals.md +++ b/lang/cpp11/raw_string_literals.md @@ -129,8 +129,8 @@ int main() * c_str()[link /reference/string/basic_string/c_str.md] * std::streambuf[link /reference/streambuf/basic_streambuf.md] * rdbuf[link /reference/ios/basic_ios/rdbuf.md] -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] -* str()[link /reference/sstream/basic_stringstream/str.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] +* str()[link /reference/sstream/basic_stringstream/str.md] * std::fprintf[link /reference/cstdio/fprintf.md.nolink] * Boost.Format[link http://www.boost.org/libs/format] * fmtlib[link https://github.com/fmtlib/fmt] diff --git a/lang/cpp11/variadic_templates.md b/lang/cpp11/variadic_templates.md index fefba19170..27b024adfd 100644 --- a/lang/cpp11/variadic_templates.md +++ b/lang/cpp11/variadic_templates.md @@ -323,7 +323,7 @@ hello f(1, 'a', "hello"); } ``` - * std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] + * std::stringstream[link /reference/sstream/basic_stringstream.md] - 複数のパラメータパックに対して拡張を行う場合、それらのパラメータパックは同じ要素数でなければならない。そうでない場合、プログラムは不適格となる diff --git a/reference/chrono/duration/op_ostream.md b/reference/chrono/duration/op_ostream.md index 8220e34025..044a8c65f8 100644 --- a/reference/chrono/duration/op_ostream.md +++ b/reference/chrono/duration/op_ostream.md @@ -33,12 +33,12 @@ s.precision(os.precision()); s << d.count() << units_suffix; return os << s.str(); ``` -* basic_ostringstream[link /reference/sstream/basic_ostringstream.md.nolink] +* basic_ostringstream[link /reference/sstream/basic_ostringstream.md] * flags[link /reference/ios/ios_base/flags.md] * s.imbue[link /reference/ios/ios_base/imbue.md] * os.getloc()[link /reference/ios/ios_base/getloc.md] * precision[link /reference/ios/ios_base/precision.md] -* s.str()[link /reference/sstream/basic_ostringstream/str.md.nolink] +* s.str()[link /reference/sstream/basic_ostringstream/str.md] ここでの`units_suffix`は、`Period::type`単位型に以下のように対応する: diff --git a/reference/complex/complex/op_ostream.md b/reference/complex/complex/op_ostream.md index d9ae353a4a..6f696c2359 100644 --- a/reference/complex/complex/op_ostream.md +++ b/reference/complex/complex/op_ostream.md @@ -25,14 +25,14 @@ s.precision(os.precision()); s << '(' << x.real() << "," << x.imag() << ')'; return os << s.str(); ``` -* basic_ostringstream[link /reference/sstream/basic_ostringstream.md.nolink] +* basic_ostringstream[link /reference/sstream/basic_ostringstream.md] * flags[link /reference/ios/ios_base/flags.md] * imbue[link /reference/ios/basic_ios/imbue.md] * getloc[link /reference/ios/ios_base/getloc.md] * precision[link /reference/ios/ios_base/precision.md] * real[link real.md] * imag[link imag.md] -* str[link /reference/sstream/basic_ostringstream/str.md.nolink] +* str[link /reference/sstream/basic_ostringstream/str.md] ## 例 diff --git a/reference/iomanip/quoted.md b/reference/iomanip/quoted.md index 315e976535..eb1fd9babf 100644 --- a/reference/iomanip/quoted.md +++ b/reference/iomanip/quoted.md @@ -115,7 +115,7 @@ int main() } ``` * std::quoted[color ff0000] -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] ## 出力 ``` diff --git a/reference/ios/basic_ios/rdbuf.md b/reference/ios/basic_ios/rdbuf.md index afefc59a9d..82ac9860b6 100644 --- a/reference/ios/basic_ios/rdbuf.md +++ b/reference/ios/basic_ios/rdbuf.md @@ -40,10 +40,10 @@ int main() std::cout << sstr.str(); } ``` -* std::ostringstream[link ../../sstream/basic_ostringstream.md.nolink] +* std::ostringstream[link ../../sstream/basic_ostringstream.md] * std::streambuf[link ../../streambuf/basic_streambuf.md] * rdbuf[color ff0000] -* str()[link ../../sstream/basic_ostringstream/str.md.nolink] +* str()[link ../../sstream/basic_ostringstream/str.md] ### 出力 ``` diff --git a/reference/ios/ios_base/iword.md b/reference/ios/ios_base/iword.md index d4caa916a3..38a08214f5 100644 --- a/reference/ios/ios_base/iword.md +++ b/reference/ios/ios_base/iword.md @@ -97,7 +97,7 @@ int main() * iword[color ff0000] * xalloc[link xalloc.md] * std::ostream[link ../../ostream/basic_ostream.md] -* std::stringstream[link ../../sstream/basic_stringstream.md.nolink] +* std::stringstream[link ../../sstream/basic_stringstream.md] * std::ios_base[link ../ios_base.md] * insert[link ../../string/basic_string/insert.md] * bad()[link ../basic_ios/bad.md] diff --git a/reference/ios/ios_base/pword.md b/reference/ios/ios_base/pword.md index c089d4a08e..f767722ac4 100644 --- a/reference/ios/ios_base/pword.md +++ b/reference/ios/ios_base/pword.md @@ -109,7 +109,7 @@ int main() * pword[color ff0000] * xalloc()[link xalloc.md] * std::ostream[link ../../ostream/basic_ostream.md] -* std::stringstream[link ../../sstream/basic_stringstream.md.nolink] +* std::stringstream[link ../../sstream/basic_stringstream.md] * std::ios_base[link ../ios_base.md] * bad()[link ../basic_ios/bad.md] * event[link type-event.md] diff --git a/reference/ios/ios_base/register_callback.md b/reference/ios/ios_base/register_callback.md index 3f5baa92f1..45df7a602e 100644 --- a/reference/ios/ios_base/register_callback.md +++ b/reference/ios/ios_base/register_callback.md @@ -78,7 +78,7 @@ int main() } ``` * std::ios_base[link ../ios_base.md] -* std::stringstream[link ../../sstream/basic_stringstream.md.nolink] +* std::stringstream[link ../../sstream/basic_stringstream.md] * erase_event[link type-event.md] * copyfmt_event[link type-event.md] * imbue_event[link type-event.md] diff --git a/reference/ios/ios_base/type-event.md b/reference/ios/ios_base/type-event.md index 1c62cd5909..3886c40327 100644 --- a/reference/ios/ios_base/type-event.md +++ b/reference/ios/ios_base/type-event.md @@ -66,7 +66,7 @@ int main() } ``` * std::ios_base[link ../ios_base.md] -* std::stringstream[link ../../sstream/basic_stringstream.md.nolink] +* std::stringstream[link ../../sstream/basic_stringstream.md] * event[color ff0000] * erase_event[color ff0000] * copyfmt_event[color ff0000] diff --git a/reference/ios/ios_base/type-openmode.md b/reference/ios/ios_base/type-openmode.md index 93076eead3..4bce2140ee 100644 --- a/reference/ios/ios_base/type-openmode.md +++ b/reference/ios/ios_base/type-openmode.md @@ -48,10 +48,10 @@ int main() } ``` * std::ios_base[link ../ios_base.md] -* std::ostringstream[link ../../sstream/basic_ostringstream.md.nolink] +* std::ostringstream[link ../../sstream/basic_ostringstream.md] * seekp[link ../../ostream/basic_ostream/seekp.md] * std::flush[link ../../ostream/flush.md] -* str()[link ../../sstream/basic_ostringstream/str.md.nolink] +* str()[link ../../sstream/basic_ostringstream/str.md] * openmode[color ff0000] * out[color ff0000] * ate[color ff0000] diff --git a/reference/ios/ios_base/type-seekdir.md b/reference/ios/ios_base/type-seekdir.md index 53ee0a8ad9..e5b3a674d9 100644 --- a/reference/ios/ios_base/type-seekdir.md +++ b/reference/ios/ios_base/type-seekdir.md @@ -45,10 +45,10 @@ int main() } ``` * std::ios_base[link ../ios_base.md] -* std::ostringstream[link ../../sstream/basic_ostringstream.md.nolink] +* std::ostringstream[link ../../sstream/basic_ostringstream.md] * seekp[link ../../ostream/basic_ostream/seekp.md] * std::flush[link ../../ostream/flush.md] -* str()[link ../../sstream/basic_ostringstream/str.md.nolink] +* str()[link ../../sstream/basic_ostringstream/str.md] * out[link type-openmode.md] * seekdir[color ff0000] * beg[color ff0000] diff --git a/reference/ios/ios_base/xalloc.md b/reference/ios/ios_base/xalloc.md index 9afeec1263..41f7f70b38 100644 --- a/reference/ios/ios_base/xalloc.md +++ b/reference/ios/ios_base/xalloc.md @@ -87,7 +87,7 @@ int main() * std::ios_base::xalloc()[color ff0000] * std::ostream[link /reference/ostream/basic_ostream.md] * pword[link pword.md] -* std::ostringstream[link /reference/sstream/basic_ostringstream.md.nolink] +* std::ostringstream[link /reference/sstream/basic_ostringstream.md] * std::hex[link /reference/ios/hex.md] ### 出力 diff --git a/reference/iterator/istream_iterator.md b/reference/iterator/istream_iterator.md index 98a9df2ae0..3d2818ea53 100644 --- a/reference/iterator/istream_iterator.md +++ b/reference/iterator/istream_iterator.md @@ -82,7 +82,7 @@ int main() } ``` * std::istream_iterator[color ff0000] -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] ### 出力 ``` diff --git a/reference/iterator/istream_iterator/op_arrow.md b/reference/iterator/istream_iterator/op_arrow.md index 53557602f4..bc9733d431 100644 --- a/reference/iterator/istream_iterator/op_arrow.md +++ b/reference/iterator/istream_iterator/op_arrow.md @@ -38,7 +38,7 @@ int main() } ``` * it->c_str()[color ff0000] -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] ### 出力 ``` diff --git a/reference/iterator/istream_iterator/op_constructor.md b/reference/iterator/istream_iterator/op_constructor.md index 138bb078bf..65b84578ed 100644 --- a/reference/iterator/istream_iterator/op_constructor.md +++ b/reference/iterator/istream_iterator/op_constructor.md @@ -38,7 +38,7 @@ int main() }); } ``` -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] ### 出力 ``` diff --git a/reference/iterator/istream_iterator/op_deref.md b/reference/iterator/istream_iterator/op_deref.md index 070ca35867..a1899a556a 100644 --- a/reference/iterator/istream_iterator/op_deref.md +++ b/reference/iterator/istream_iterator/op_deref.md @@ -40,7 +40,7 @@ int main() } ``` * *it[color ff0000] -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] ### 出力 ``` diff --git a/reference/iterator/istream_iterator/op_equal.md b/reference/iterator/istream_iterator/op_equal.md index d0c0926735..7e38e6da12 100644 --- a/reference/iterator/istream_iterator/op_equal.md +++ b/reference/iterator/istream_iterator/op_equal.md @@ -64,7 +64,7 @@ int main() std::cout << "it1 == last : " << (it1 == last) << std::endl; } ``` -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] ### 出力 ``` diff --git a/reference/iterator/istream_iterator/op_increment.md b/reference/iterator/istream_iterator/op_increment.md index 1c8b2e3848..d2baaefc51 100644 --- a/reference/iterator/istream_iterator/op_increment.md +++ b/reference/iterator/istream_iterator/op_increment.md @@ -49,7 +49,7 @@ int main() } ``` * ++it[color ff0000] -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] ### 出力 ``` diff --git a/reference/iterator/istream_iterator/op_not_equal.md b/reference/iterator/istream_iterator/op_not_equal.md index 12a3345b41..b03419ffcc 100644 --- a/reference/iterator/istream_iterator/op_not_equal.md +++ b/reference/iterator/istream_iterator/op_not_equal.md @@ -56,7 +56,7 @@ int main() std::cout << "it1 == last : " << (it1 != last) << std::endl; } ``` -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] ### 出力 ``` diff --git a/reference/iterator/istreambuf_iterator.md b/reference/iterator/istreambuf_iterator.md index 0dff73f38b..066c5a35f3 100644 --- a/reference/iterator/istreambuf_iterator.md +++ b/reference/iterator/istreambuf_iterator.md @@ -81,7 +81,7 @@ int main() } ``` * std::istreambuf_iterator[color ff0000] -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] ### 出力 ``` diff --git a/reference/iterator/istreambuf_iterator/equal.md b/reference/iterator/istreambuf_iterator/equal.md index c057189b21..9b6ba5fe5f 100644 --- a/reference/iterator/istreambuf_iterator/equal.md +++ b/reference/iterator/istreambuf_iterator/equal.md @@ -50,7 +50,7 @@ int main() } ``` * equal[color ff0000] -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] ### 出力 ``` diff --git a/reference/iterator/istreambuf_iterator/op_constructor.md b/reference/iterator/istreambuf_iterator/op_constructor.md index 7c014b3e44..2bbdf5059a 100644 --- a/reference/iterator/istreambuf_iterator/op_constructor.md +++ b/reference/iterator/istreambuf_iterator/op_constructor.md @@ -40,7 +40,7 @@ int main() std::cout << *it2 << std::endl; } ``` -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] ### 出力 ``` diff --git a/reference/iterator/istreambuf_iterator/op_deref.md b/reference/iterator/istreambuf_iterator/op_deref.md index 2c55b7e420..3c2f8a9939 100644 --- a/reference/iterator/istreambuf_iterator/op_deref.md +++ b/reference/iterator/istreambuf_iterator/op_deref.md @@ -33,7 +33,7 @@ int main() std::cout << *it << std::endl; } ``` -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] ### 出力 ``` diff --git a/reference/iterator/istreambuf_iterator/op_equal.md b/reference/iterator/istreambuf_iterator/op_equal.md index 11384386d9..cfebc4f4d5 100644 --- a/reference/iterator/istreambuf_iterator/op_equal.md +++ b/reference/iterator/istreambuf_iterator/op_equal.md @@ -68,7 +68,7 @@ int main() } } ``` -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] ### 出力 ``` diff --git a/reference/iterator/istreambuf_iterator/op_increment.md b/reference/iterator/istreambuf_iterator/op_increment.md index ebf62e6ba7..a6db381d0b 100644 --- a/reference/iterator/istreambuf_iterator/op_increment.md +++ b/reference/iterator/istreambuf_iterator/op_increment.md @@ -47,7 +47,7 @@ int main() ``` * ++it[color ff0000] * it++[color ff0000] -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] ### 出力 ``` diff --git a/reference/iterator/istreambuf_iterator/op_not_equal.md b/reference/iterator/istreambuf_iterator/op_not_equal.md index 3271bc401f..c567d8dd92 100644 --- a/reference/iterator/istreambuf_iterator/op_not_equal.md +++ b/reference/iterator/istreambuf_iterator/op_not_equal.md @@ -50,7 +50,7 @@ int main() } } ``` -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] ### 出力 ``` diff --git a/reference/limits/numeric_limits/max_digits10.md b/reference/limits/numeric_limits/max_digits10.md index c59e979810..d5869cfae4 100644 --- a/reference/limits/numeric_limits/max_digits10.md +++ b/reference/limits/numeric_limits/max_digits10.md @@ -82,10 +82,10 @@ int main() ``` * max_digits10[color ff0000] * digits10[link digits10.md] -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] * precision[link /reference/ios/ios_base/precision.md] * std::scientific[link /reference/ios/scientific.md] -* s.str()[link /reference/sstream/basic_stringstream/str.md.nolink] +* s.str()[link /reference/sstream/basic_stringstream/str.md] * std::nextafter[link /reference/cmath/nextafter.md] * std::uint32_t[link /reference/cstdint/uint32_t.md] diff --git a/reference/ostream/basic_ostream/seekp.md b/reference/ostream/basic_ostream/seekp.md index 8e741a9625..fe5c1d4e30 100644 --- a/reference/ostream/basic_ostream/seekp.md +++ b/reference/ostream/basic_ostream/seekp.md @@ -47,9 +47,9 @@ int main() { std::cout << os.str() << std::endl; } ``` -* std::ostringstream[link ../../sstream/basic_ostringstream.md.nolink] +* std::ostringstream[link ../../sstream/basic_ostringstream.md] * seekp[color ff0000] -* str()[link ../../sstream/basic_ostringstream/str.md.nolink] +* str()[link ../../sstream/basic_ostringstream/str.md] ### 出力 ``` diff --git a/reference/ostream/basic_ostream/tellp.md b/reference/ostream/basic_ostream/tellp.md index fbe665627f..bd012c8f22 100644 --- a/reference/ostream/basic_ostream/tellp.md +++ b/reference/ostream/basic_ostream/tellp.md @@ -37,9 +37,9 @@ int main() { std::cout << os.str() << std::endl; } ``` -* std::ostringstream[link ../../sstream/basic_ostringstream.md.nolink] +* std::ostringstream[link ../../sstream/basic_ostringstream.md] * tellp[color ff0000] -* str()[link ../../sstream/basic_ostringstream/str.md.nolink] +* str()[link ../../sstream/basic_ostringstream/str.md] * seekp[link seekp.md] ### 出力 diff --git a/reference/random/bernoulli_distribution/op_istream.md b/reference/random/bernoulli_distribution/op_istream.md index b3d999bb26..36d40820ee 100644 --- a/reference/random/bernoulli_distribution/op_istream.md +++ b/reference/random/bernoulli_distribution/op_istream.md @@ -59,8 +59,8 @@ int main() } } ``` -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] -* ss.str()[link /reference/sstream/basic_stringstream/str.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] +* ss.str()[link /reference/sstream/basic_stringstream/str.md] ### 出力例 ``` diff --git a/reference/random/binomial_distribution/op_istream.md b/reference/random/binomial_distribution/op_istream.md index 1511a602f5..607274a367 100644 --- a/reference/random/binomial_distribution/op_istream.md +++ b/reference/random/binomial_distribution/op_istream.md @@ -59,8 +59,8 @@ int main() } } ``` -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] -* ss.str()[link /reference/sstream/basic_stringstream/str.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] +* ss.str()[link /reference/sstream/basic_stringstream/str.md] ### 出力例 ``` diff --git a/reference/random/cauchy_distribution/op_istream.md b/reference/random/cauchy_distribution/op_istream.md index d2ce80ff48..13cd70ca75 100644 --- a/reference/random/cauchy_distribution/op_istream.md +++ b/reference/random/cauchy_distribution/op_istream.md @@ -59,8 +59,8 @@ int main() } } ``` -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] -* ss.str()[link /reference/sstream/basic_stringstream/str.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] +* ss.str()[link /reference/sstream/basic_stringstream/str.md] ### 出力例 ``` diff --git a/reference/random/chi_squared_distribution/op_istream.md b/reference/random/chi_squared_distribution/op_istream.md index 7ad6d295f8..4c465091af 100644 --- a/reference/random/chi_squared_distribution/op_istream.md +++ b/reference/random/chi_squared_distribution/op_istream.md @@ -59,8 +59,8 @@ int main() } } ``` -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] -* ss.str()[link /reference/sstream/basic_stringstream/str.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] +* ss.str()[link /reference/sstream/basic_stringstream/str.md] ### 出力例 ``` diff --git a/reference/random/discard_block_engine/op_istream.md b/reference/random/discard_block_engine/op_istream.md index 65f0aaf44e..8936b30c14 100644 --- a/reference/random/discard_block_engine/op_istream.md +++ b/reference/random/discard_block_engine/op_istream.md @@ -62,8 +62,8 @@ int main() } ``` * std::ranlux24[link /reference/random/ranlux24.md] -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] -* ss.str()[link /reference/sstream/basic_stringstream/str.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] +* ss.str()[link /reference/sstream/basic_stringstream/str.md] ### 出力例 ``` diff --git a/reference/random/discrete_distribution/op_istream.md b/reference/random/discrete_distribution/op_istream.md index 56db0c66c9..9a49598778 100644 --- a/reference/random/discrete_distribution/op_istream.md +++ b/reference/random/discrete_distribution/op_istream.md @@ -59,8 +59,8 @@ int main() } } ``` -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] -* ss.str()[link /reference/sstream/basic_stringstream/str.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] +* ss.str()[link /reference/sstream/basic_stringstream/str.md] ### 出力例 ``` diff --git a/reference/random/exponential_distribution/op_istream.md b/reference/random/exponential_distribution/op_istream.md index 2da09364c1..41a2e64fa2 100644 --- a/reference/random/exponential_distribution/op_istream.md +++ b/reference/random/exponential_distribution/op_istream.md @@ -59,8 +59,8 @@ int main() } } ``` -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] -* ss.str()[link /reference/sstream/basic_stringstream/str.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] +* ss.str()[link /reference/sstream/basic_stringstream/str.md] ### 出力例 ``` diff --git a/reference/random/extreme_value_distribution/op_istream.md b/reference/random/extreme_value_distribution/op_istream.md index 5a793168c9..7865c33880 100644 --- a/reference/random/extreme_value_distribution/op_istream.md +++ b/reference/random/extreme_value_distribution/op_istream.md @@ -59,8 +59,8 @@ int main() } } ``` -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] -* ss.str()[link /reference/sstream/basic_stringstream/str.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] +* ss.str()[link /reference/sstream/basic_stringstream/str.md] ### 出力例 ``` diff --git a/reference/random/fisher_f_distribution/op_istream.md b/reference/random/fisher_f_distribution/op_istream.md index 06baf1b929..df5d15d1ac 100644 --- a/reference/random/fisher_f_distribution/op_istream.md +++ b/reference/random/fisher_f_distribution/op_istream.md @@ -59,8 +59,8 @@ int main() } } ``` -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] -* ss.str()[link /reference/sstream/basic_stringstream/str.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] +* ss.str()[link /reference/sstream/basic_stringstream/str.md] ### 出力例 ``` diff --git a/reference/random/gamma_distribution/op_istream.md b/reference/random/gamma_distribution/op_istream.md index 0a5b219913..df99de1013 100644 --- a/reference/random/gamma_distribution/op_istream.md +++ b/reference/random/gamma_distribution/op_istream.md @@ -59,8 +59,8 @@ int main() } } ``` -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] -* ss.str()[link /reference/sstream/basic_stringstream/str.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] +* ss.str()[link /reference/sstream/basic_stringstream/str.md] ### 出力例 ``` diff --git a/reference/random/geometric_distribution/op_istream.md b/reference/random/geometric_distribution/op_istream.md index 962a83f912..d37e845a64 100644 --- a/reference/random/geometric_distribution/op_istream.md +++ b/reference/random/geometric_distribution/op_istream.md @@ -59,8 +59,8 @@ int main() } } ``` -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] -* ss.str()[link /reference/sstream/basic_stringstream/str.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] +* ss.str()[link /reference/sstream/basic_stringstream/str.md] ### 出力例 ``` diff --git a/reference/random/independent_bits_engine/op_istream.md b/reference/random/independent_bits_engine/op_istream.md index fce4194496..225d30de2d 100644 --- a/reference/random/independent_bits_engine/op_istream.md +++ b/reference/random/independent_bits_engine/op_istream.md @@ -65,8 +65,8 @@ int main() } ``` * std::uint64_t[link /reference/cstdint/uint64_t.md] -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] -* ss.str()[link /reference/sstream/basic_stringstream/str.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] +* ss.str()[link /reference/sstream/basic_stringstream/str.md] ### 出力例 ``` diff --git a/reference/random/linear_congruential_engine/op_istream.md b/reference/random/linear_congruential_engine/op_istream.md index e232d70866..751725d01c 100644 --- a/reference/random/linear_congruential_engine/op_istream.md +++ b/reference/random/linear_congruential_engine/op_istream.md @@ -62,8 +62,8 @@ int main() } ``` * std::minstd_rand[link /reference/random/minstd_rand.md] -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] -* ss.str()[link /reference/sstream/basic_stringstream/str.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] +* ss.str()[link /reference/sstream/basic_stringstream/str.md] ### 出力例 ``` diff --git a/reference/random/lognormal_distribution/op_istream.md b/reference/random/lognormal_distribution/op_istream.md index bf0026f8b6..d1d505a7c7 100644 --- a/reference/random/lognormal_distribution/op_istream.md +++ b/reference/random/lognormal_distribution/op_istream.md @@ -59,8 +59,8 @@ int main() } } ``` -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] -* ss.str()[link /reference/sstream/basic_stringstream/str.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] +* ss.str()[link /reference/sstream/basic_stringstream/str.md] ### 出力例 ``` diff --git a/reference/random/mersenne_twister_engine/op_istream.md b/reference/random/mersenne_twister_engine/op_istream.md index dd184fade4..3c04d5eab8 100644 --- a/reference/random/mersenne_twister_engine/op_istream.md +++ b/reference/random/mersenne_twister_engine/op_istream.md @@ -64,8 +64,8 @@ int main() } } ``` -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] -* ss.str()[link /reference/sstream/basic_stringstream/str.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] +* ss.str()[link /reference/sstream/basic_stringstream/str.md] ### 出力 ``` diff --git a/reference/random/negative_binomial_distribution/op_istream.md b/reference/random/negative_binomial_distribution/op_istream.md index f5e18a82f0..0f250f580d 100644 --- a/reference/random/negative_binomial_distribution/op_istream.md +++ b/reference/random/negative_binomial_distribution/op_istream.md @@ -59,8 +59,8 @@ int main() } } ``` -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] -* ss.str()[link /reference/sstream/basic_stringstream/str.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] +* ss.str()[link /reference/sstream/basic_stringstream/str.md] ### 出力例 ``` diff --git a/reference/random/normal_distribution/op_istream.md b/reference/random/normal_distribution/op_istream.md index 54556f72b0..a23c58c6e3 100644 --- a/reference/random/normal_distribution/op_istream.md +++ b/reference/random/normal_distribution/op_istream.md @@ -59,8 +59,8 @@ int main() } } ``` -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] -* ss.str()[link /reference/sstream/basic_stringstream/str.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] +* ss.str()[link /reference/sstream/basic_stringstream/str.md] ### 出力例 ``` diff --git a/reference/random/piecewise_constant_distribution/op_istream.md b/reference/random/piecewise_constant_distribution/op_istream.md index 99adc13063..8fc62b4b10 100644 --- a/reference/random/piecewise_constant_distribution/op_istream.md +++ b/reference/random/piecewise_constant_distribution/op_istream.md @@ -68,8 +68,8 @@ int main() } } ``` -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] -* ss.str()[link /reference/sstream/basic_stringstream/str.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] +* ss.str()[link /reference/sstream/basic_stringstream/str.md] * intervals.begin()[link /reference/array/array/begin.md] * intervals.end()[link /reference/array/array/end.md] * densities.begin()[link /reference/array/array/begin.md] diff --git a/reference/random/piecewise_linear_distribution/op_istream.md b/reference/random/piecewise_linear_distribution/op_istream.md index bd530aa0e2..763e0734d3 100644 --- a/reference/random/piecewise_linear_distribution/op_istream.md +++ b/reference/random/piecewise_linear_distribution/op_istream.md @@ -68,8 +68,8 @@ int main() } } ``` -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] -* ss.str()[link /reference/sstream/basic_stringstream/str.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] +* ss.str()[link /reference/sstream/basic_stringstream/str.md] * intervals.begin()[link /reference/array/array/begin.md] * intervals.end()[link /reference/array/array/end.md] * densities.begin()[link /reference/array/array/begin.md] diff --git a/reference/random/poisson_distribution/op_istream.md b/reference/random/poisson_distribution/op_istream.md index 47bd55b475..eef3fdf982 100644 --- a/reference/random/poisson_distribution/op_istream.md +++ b/reference/random/poisson_distribution/op_istream.md @@ -59,8 +59,8 @@ int main() } } ``` -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] -* ss.str()[link /reference/sstream/basic_stringstream/str.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] +* ss.str()[link /reference/sstream/basic_stringstream/str.md] ### 出力例 ``` diff --git a/reference/random/shuffle_order_engine/op_istream.md b/reference/random/shuffle_order_engine/op_istream.md index 5541d888b8..5f7187420a 100644 --- a/reference/random/shuffle_order_engine/op_istream.md +++ b/reference/random/shuffle_order_engine/op_istream.md @@ -62,8 +62,8 @@ int main() } ``` * std::knuth_b[link /reference/random/knuth_b.md] -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] -* ss.str()[link /reference/sstream/basic_stringstream/str.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] +* ss.str()[link /reference/sstream/basic_stringstream/str.md] ### 出力例 ``` diff --git a/reference/random/student_t_distribution/op_istream.md b/reference/random/student_t_distribution/op_istream.md index fe7000f644..d3ad5c925a 100644 --- a/reference/random/student_t_distribution/op_istream.md +++ b/reference/random/student_t_distribution/op_istream.md @@ -59,8 +59,8 @@ int main() } } ``` -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] -* ss.str()[link /reference/sstream/basic_stringstream/str.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] +* ss.str()[link /reference/sstream/basic_stringstream/str.md] ### 出力例 ``` diff --git a/reference/random/subtract_with_carry_engine/op_istream.md b/reference/random/subtract_with_carry_engine/op_istream.md index e3e70d2731..ec76e30313 100644 --- a/reference/random/subtract_with_carry_engine/op_istream.md +++ b/reference/random/subtract_with_carry_engine/op_istream.md @@ -62,8 +62,8 @@ int main() } ``` * std::ranlux24_base[link /reference/random/ranlux24_base.md] -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] -* ss.str()[link /reference/sstream/basic_stringstream/str.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] +* ss.str()[link /reference/sstream/basic_stringstream/str.md] ### 出力 ``` diff --git a/reference/random/uniform_int_distribution/op_istream.md b/reference/random/uniform_int_distribution/op_istream.md index 8b9f6f184a..2ba9daac82 100644 --- a/reference/random/uniform_int_distribution/op_istream.md +++ b/reference/random/uniform_int_distribution/op_istream.md @@ -59,8 +59,8 @@ int main() } } ``` -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] -* ss.str()[link /reference/sstream/basic_stringstream/str.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] +* ss.str()[link /reference/sstream/basic_stringstream/str.md] ### 出力例 ``` diff --git a/reference/random/uniform_real_distribution/op_istream.md b/reference/random/uniform_real_distribution/op_istream.md index 8089f4d464..41fc4079a6 100644 --- a/reference/random/uniform_real_distribution/op_istream.md +++ b/reference/random/uniform_real_distribution/op_istream.md @@ -59,8 +59,8 @@ int main() } } ``` -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] -* ss.str()[link /reference/sstream/basic_stringstream/str.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] +* ss.str()[link /reference/sstream/basic_stringstream/str.md] ### 出力例 ``` diff --git a/reference/random/weibull_distribution/op_istream.md b/reference/random/weibull_distribution/op_istream.md index 6d27afbdbc..c02900b8f7 100644 --- a/reference/random/weibull_distribution/op_istream.md +++ b/reference/random/weibull_distribution/op_istream.md @@ -59,8 +59,8 @@ int main() } } ``` -* std::stringstream[link /reference/sstream/basic_stringstream.md.nolink] -* ss.str()[link /reference/sstream/basic_stringstream/str.md.nolink] +* std::stringstream[link /reference/sstream/basic_stringstream.md] +* ss.str()[link /reference/sstream/basic_stringstream/str.md] ### 出力例 ``` diff --git a/reference/sstream.md b/reference/sstream.md index 1691596934..ff32b3aac7 100644 --- a/reference/sstream.md +++ b/reference/sstream.md @@ -7,9 +7,9 @@ | 名前 | 説明 | 対応バージョン | |-----------------------|------------------------------------------------|----------------| -| `basic_stringbuf` | 文字列ストリームバッファ(class template) | | -| `stringbuf` | `char`版の文字列ストリームバッファ(type-alias) | | -| `wstringbuf` | `wchar_t`版の文字列ストリームバッファ(type-alias) | | +| [`basic_stringbuf`](sstream/basic_stringbuf.md) | 文字列ストリームバッファ(class template) | | +| [`stringbuf`](sstream/basic_stringbuf.md) | `char`版の文字列ストリームバッファ(type-alias) | | +| [`wstringbuf`](sstream/basic_stringbuf.md) | `wchar_t`版の文字列ストリームバッファ(type-alias) | | ## 入力ストリーム @@ -23,16 +23,16 @@ | 名前 | 説明 | 対応バージョン | |-----------------------|------------------------------------------------|----------------| -| `basic_ostringstream` | 文字列出力ストリーム(class template) | | -| `ostringstream` | `char`版の文字列出力ストリーム(type-alias) | | -| `wostringstream` | `wchar_t`版の文字列出力ストリーム(type-alias) | | +| [`basic_ostringstream`](sstream/basic_ostringstream.md) | 文字列出力ストリーム(class template) | | +| [`ostringstream`](sstream/basic_ostringstream.md) | `char`版の文字列出力ストリーム(type-alias) | | +| [`wostringstream`](sstream/basic_ostringstream.md) | `wchar_t`版の文字列出力ストリーム(type-alias) | | ## 入出力ストリーム | 名前 | 説明 | 対応バージョン | |-----------------------|------------------------------------------------|----------------| -| `basic_stringstream` | 文字列入出力ストリーム(class template) | | -| `stringstream` | `char`版の文字列入出力ストリーム(type-alias) | | -| `wstringstream` | `wchar_t`版の文字列入出力ストリーム(type-alias) | | +| [`basic_stringstream`](sstream/basic_stringstream.md) | 文字列入出力ストリーム(class template) | | +| [`stringstream`](sstream/basic_stringstream.md) | `char`版の文字列入出力ストリーム(type-alias) | | +| [`wstringstream`](sstream/basic_stringstream.md) | `wchar_t`版の文字列入出力ストリーム(type-alias) | | diff --git a/reference/sstream/basic_istringstream.md b/reference/sstream/basic_istringstream.md index 374ce0799b..5965a4499b 100644 --- a/reference/sstream/basic_istringstream.md +++ b/reference/sstream/basic_istringstream.md @@ -18,18 +18,20 @@ namespace std { * basic_istream[link /reference/istream/basic_istream.md] ## 概要 +バッファに保持された文字列への読み取り操作ができるストリーム ## メンバ関数 -| 名前 | 説明 | 対応バージョン | -|---------------|--------------------------------------------|----------------| -| (constructor) | コンストラクタ | | -| (destructor) | デストラクタ | | -| `operator=` | ムーブ代入 | C++11 | -| `swap` | 値の交換 | C++11 | -| `rdbuf` | ストリームバッファオブジェクトの設定・取得 | | -| `str` | 文字列オブジェクトの設定・取得 | | +| 名前 | 説明 | 対応バージョン | +|-------------------------------------|--------------------------------------------|----------------| +| (constructor) | コンストラクタ | | +| (destructor) | デストラクタ | | +| `operator=` | ムーブ代入 | C++11 | +| `swap` | 値の交換 | C++11 | +| `rdbuf` | ストリームバッファオブジェクトの設定・取得 | | +| [`str`](basic_istringstream/str.md) | 文字列オブジェクトの設定・取得 | | +| `view` | 文字列ビューオブジェクトの取得 | C++20 | ## 非メンバ関数 @@ -58,3 +60,5 @@ namespace std { ``` ``` +## 参照 +- [P0408R7 Efficient Access to `basic_stringbuf`’s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) diff --git a/reference/sstream/basic_istringstream/str.md b/reference/sstream/basic_istringstream/str.md new file mode 100644 index 0000000000..ef88b99513 --- /dev/null +++ b/reference/sstream/basic_istringstream/str.md @@ -0,0 +1,33 @@ +# str +* sstream[meta header] +* std[meta namespace] +* basic_istringstream[meta class] +* function[meta id-type] + +```cpp +basic_string str() const; // (1) C++03 +basic_string str() const &; // (1) C++20 +template +basic_string str(const SAlloc& sa) const &; // (2) C++20 +basic_string str() const &&; // (3) C++20 + +void str(const basic_string& s); // (4) +template +void str(const basic_string& s); // (5) C++20 +void str(const basic_string&& s); // (6) C++20 +``` +* basic_string[link /reference/string/basic_string.md] + +## 概要 +文字列オブジェクトを取得または設定する。 + +## 効果 +- (1) : `return rdbuf()->str()` と等価 +- (2) : `return rdbuf()->str(sa)` と等価 +- (3) : `return std::move(*rdbuf()).str()` と等価 +- (4) : `rdbuf()->str(s)` と等価 +- (5) : `rdbuf()->str(s)` と等価 +- (6) : `rdbuf()->str(std::move(s))` と等価 + +## 関連項目 +[basic_stringbuf::str](../basic_stringbuf/str.md) diff --git a/reference/sstream/basic_ostringstream.md b/reference/sstream/basic_ostringstream.md new file mode 100644 index 0000000000..f3f0112e55 --- /dev/null +++ b/reference/sstream/basic_ostringstream.md @@ -0,0 +1,64 @@ +# basic_ostringstream +* sstream[meta header] +* std[meta namespace] +* class template[meta id-type] + +```cpp +namespace std { + template , + class Allocator = allocator > + class basic_ostringstream : public basic_ostream; + + using ostringstream = basic_ostringstream; + using wostringstream = basic_ostringstream; +} +``` +* char_traits[link /reference/string/char_traits.md] +* allocator[link /reference/memory/allocator.md] +* basic_ostream[link /reference/ostream/basic_ostream.md] + +## 概要 +バッファに保持された文字列への書き込み操作ができるストリーム + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|-------------------------------------|--------------------------------------------|----------------| +| (constructor) | コンストラクタ | | +| (destructor) | デストラクタ | | +| `operator=` | ムーブ代入 | C++11 | +| `swap` | 値の交換 | C++11 | +| `rdbuf` | ストリームバッファオブジェクトの設定・取得 | | +| [`str`](basic_ostringstream/str.md) | 文字列オブジェクトの設定・取得 | | +| `view` | 文字列ビューオブジェクトの取得 | C++20 | + + +## 非メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|--------|-------------------------------|----------------| +| `swap` | 2つのオブジェクトを入れ替える | C++11 | + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------------------|-------------------------------|----------------| +| `char_type` | テンプレート仮引数`CharT` | | +| `int_type` | `Traits::int_type` | | +| `pos_type` | `Traits::pos_type` | | +| `off_type` | `Traits::off_type` | | +| `traits_type` | テンプレート仮引数`Traits` | | +| `allocator_type` | テンプレート仮引数`Allocator` | | + +## 例 +```cpp +``` + +### 出力 +``` +``` + +## 参照 +- [P0408R7 Efficient Access to `basic_stringbuf`’s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) diff --git a/reference/sstream/basic_ostringstream/str.md b/reference/sstream/basic_ostringstream/str.md new file mode 100644 index 0000000000..c00d569fbf --- /dev/null +++ b/reference/sstream/basic_ostringstream/str.md @@ -0,0 +1,33 @@ +# str +* sstream[meta header] +* std[meta namespace] +* basic_ostringstream[meta class] +* function[meta id-type] + +```cpp +basic_string str() const; // (1) C++03 +basic_string str() const &; // (1) C++20 +template +basic_string str(const SAlloc& sa) const &; // (2) C++20 +basic_string str() const &&; // (3) C++20 + +void str(const basic_string& s); // (4) +template +void str(const basic_string& s); // (5) C++20 +void str(const basic_string&& s); // (6) C++20 +``` +* basic_string[link /reference/string/basic_string.md] + +## 概要 +文字列オブジェクトを取得または設定する。 + +## 効果 +- (1) : `return rdbuf()->str()` と等価 +- (2) : `return rdbuf()->str(sa)` と等価 +- (3) : `return std::move(*rdbuf()).str()` と等価 +- (4) : `rdbuf()->str(s)` と等価 +- (5) : `rdbuf()->str(s)` と等価 +- (6) : `rdbuf()->str(std::move(s))` と等価 + +## 関連項目 +[basic_stringbuf::str](../basic_stringbuf/str.md) diff --git a/reference/sstream/basic_stringbuf.md b/reference/sstream/basic_stringbuf.md new file mode 100644 index 0000000000..e5781a87d2 --- /dev/null +++ b/reference/sstream/basic_stringbuf.md @@ -0,0 +1,57 @@ +# basic_stringbuf +* sstream[meta header] +* std[meta namespace] +* class template[meta id-type] + +```cpp +namespace std { + template , + class Allocator = allocator > + class basic_stringbuf : public basic_streambuf; + + using stringbuf = basic_stringbuf; + using wstringbuf = basic_stringbuf; +} +``` +* char_traits[link /reference/string/char_traits.md] +* allocator[link /reference/memory/allocator.md] +* basic_streambuf[link /reference/streambuf/basic_streambuf.md] + +## 概要 +文字列を保持するストリームバッファ + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|---------------------------------|--------------------------------------------|----------------| +| (constructor) | コンストラクタ | | +| (destructor) | デストラクタ | | +| `operator=` | ムーブ代入 | C++11 | +| `swap` | 値の交換 | C++11 | +| [`str`](basic_stringbuf/str.md) | 文字列オブジェクトの設定・取得 | | +| `view` | 文字列ビューオブジェクトの取得 | C++20 | +| `get_allocator` | アロケータの取得 | C++20 | + + +## 非メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|--------|-------------------------------|----------------| +| `swap` | 2つのオブジェクトを入れ替える | C++11 | + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------------------|-------------------------------|----------------| +| `char_type` | テンプレート仮引数`CharT` | | +| `int_type` | `Traits::int_type` | | +| `pos_type` | `Traits::pos_type` | | +| `off_type` | `Traits::off_type` | | +| `traits_type` | テンプレート仮引数`Traits` | | +| `allocator_type` | テンプレート仮引数`Allocator` | | + + +## 参照 +- [P0408R7 Efficient Access to `basic_stringbuf`’s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) diff --git a/reference/sstream/basic_stringbuf/str.md b/reference/sstream/basic_stringbuf/str.md new file mode 100644 index 0000000000..d02eed80a3 --- /dev/null +++ b/reference/sstream/basic_stringbuf/str.md @@ -0,0 +1,30 @@ +# str +* sstream[meta header] +* std[meta namespace] +* basic_stringbuf[meta class] +* function[meta id-type] + +```cpp +basic_string str() const; // (1) C++03 +basic_string str() const &; // (1) C++20 +template +basic_string str(const SAlloc& sa) const &; // (2) C++20 +basic_string str() const &&; // (3) C++20 + +void str(const basic_string& s); // (4) +template +void str(const basic_string& s); // (5) C++20 +void str(const basic_string&& s); // (6) C++20 +``` +* basic_string[link /reference/string/basic_string.md] + +## 概要 +文字列オブジェクトを取得または設定する。 + +## 効果 +- (1) : 文字列オブジェクトを取得する +- (2) : 文字列オブジェクトを取得して、`SAlloc`型のアロケータ`sa`によって確保する +- (3) : 保持する文字列オブジェクトをムーブして取得する +- (4) : 文字列オブジェクト`s`を設定する +- (5) : `SAlloc`型のアロケータによって確保されているデータをコピーして、文字列オブジェクト`s`を設定する +- (6) : 与えられた文字列オブジェクト`s`をムーブして設定する diff --git a/reference/sstream/basic_stringstream.md b/reference/sstream/basic_stringstream.md new file mode 100644 index 0000000000..01fd9ce37d --- /dev/null +++ b/reference/sstream/basic_stringstream.md @@ -0,0 +1,64 @@ +# basic_stringstream +* sstream[meta header] +* std[meta namespace] +* class template[meta id-type] + +```cpp +namespace std { + template , + class Allocator = allocator > + class basic_stringstream : public basic_iostream; + + using stringstream = basic_stringstream; + using wstringstream = basic_stringstream; +} +``` +* char_traits[link /reference/string/char_traits.md] +* allocator[link /reference/memory/allocator.md] +* basic_iostream[link /reference/istream/basic_iostream.md] + +## 概要 +バッファに保持された文字列への読み取りおよび書き込み操作ができるストリーム + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|-------------------------------------|--------------------------------------------|----------------| +| (constructor) | コンストラクタ | | +| (destructor) | デストラクタ | | +| `operator=` | ムーブ代入 | C++11 | +| `swap` | 値の交換 | C++11 | +| `rdbuf` | ストリームバッファオブジェクトの設定・取得 | | +| [`str`](basic_stringstream/str.md) | 文字列オブジェクトの設定・取得 | | +| `view` | 文字列ビューオブジェクトの取得 | C++20 | + + +## 非メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|--------|-------------------------------|----------------| +| `swap` | 2つのオブジェクトを入れ替える | C++11 | + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------------------|-------------------------------|----------------| +| `char_type` | テンプレート仮引数`CharT` | | +| `int_type` | `Traits::int_type` | | +| `pos_type` | `Traits::pos_type` | | +| `off_type` | `Traits::off_type` | | +| `traits_type` | テンプレート仮引数`Traits` | | +| `allocator_type` | テンプレート仮引数`Allocator` | | + +## 例 +```cpp +``` + +### 出力 +``` +``` + +## 参照 +- [P0408R7 Efficient Access to `basic_stringbuf`’s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) diff --git a/reference/sstream/basic_stringstream/str.md b/reference/sstream/basic_stringstream/str.md new file mode 100644 index 0000000000..d76900b4f2 --- /dev/null +++ b/reference/sstream/basic_stringstream/str.md @@ -0,0 +1,33 @@ +# str +* sstream[meta header] +* std[meta namespace] +* basic_stringstream[meta class] +* function[meta id-type] + +```cpp +basic_string str() const; // (1) C++03 +basic_string str() const &; // (1) C++20 +template +basic_string str(const SAlloc& sa) const &; // (2) C++20 +basic_string str() const &&; // (3) C++20 + +void str(const basic_string& s); // (4) +template +void str(const basic_string& s); // (5) C++20 +void str(const basic_string&& s); // (6) C++20 +``` +* basic_string[link /reference/string/basic_string.md] + +## 概要 +文字列オブジェクトを取得または設定する。 + +## 効果 +- (1) : `return rdbuf()->str()` と等価 +- (2) : `return rdbuf()->str(sa)` と等価 +- (3) : `return std::move(*rdbuf()).str()` と等価 +- (4) : `rdbuf()->str(s)` と等価 +- (5) : `rdbuf()->str(s)` と等価 +- (6) : `rdbuf()->str(std::move(s))` と等価 + +## 関連項目 +[basic_stringbuf::str](../basic_stringbuf/str.md) From a3cf8a41e6d89778b12af4a438e40d1b1f52b673 Mon Sep 17 00:00:00 2001 From: Shunsuke Shimizu Date: Wed, 5 Jul 2023 02:32:53 +0900 Subject: [PATCH 0375/3948] =?UTF-8?q?stringstream=E3=82=B3=E3=83=B3?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=83=A9=E3=82=AF=E3=82=BF=E3=81=AE=E3=83=95?= =?UTF-8?q?=E3=82=A9=E3=83=BC=E3=83=9E=E3=83=83=E3=83=88=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/sstream/basic_istringstream.md | 4 ++-- reference/sstream/basic_ostringstream.md | 4 ++-- reference/sstream/basic_stringbuf.md | 4 ++-- reference/sstream/basic_stringstream.md | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/reference/sstream/basic_istringstream.md b/reference/sstream/basic_istringstream.md index 5965a4499b..82c8acc692 100644 --- a/reference/sstream/basic_istringstream.md +++ b/reference/sstream/basic_istringstream.md @@ -25,8 +25,8 @@ namespace std { | 名前 | 説明 | 対応バージョン | |-------------------------------------|--------------------------------------------|----------------| -| (constructor) | コンストラクタ | | -| (destructor) | デストラクタ | | +| `(constructor)` | コンストラクタ | | +| `(destructor)` | デストラクタ | | | `operator=` | ムーブ代入 | C++11 | | `swap` | 値の交換 | C++11 | | `rdbuf` | ストリームバッファオブジェクトの設定・取得 | | diff --git a/reference/sstream/basic_ostringstream.md b/reference/sstream/basic_ostringstream.md index f3f0112e55..e6f90336c5 100644 --- a/reference/sstream/basic_ostringstream.md +++ b/reference/sstream/basic_ostringstream.md @@ -25,8 +25,8 @@ namespace std { | 名前 | 説明 | 対応バージョン | |-------------------------------------|--------------------------------------------|----------------| -| (constructor) | コンストラクタ | | -| (destructor) | デストラクタ | | +| `(constructor)` | コンストラクタ | | +| `(destructor)` | デストラクタ | | | `operator=` | ムーブ代入 | C++11 | | `swap` | 値の交換 | C++11 | | `rdbuf` | ストリームバッファオブジェクトの設定・取得 | | diff --git a/reference/sstream/basic_stringbuf.md b/reference/sstream/basic_stringbuf.md index e5781a87d2..eeb830933b 100644 --- a/reference/sstream/basic_stringbuf.md +++ b/reference/sstream/basic_stringbuf.md @@ -25,8 +25,8 @@ namespace std { | 名前 | 説明 | 対応バージョン | |---------------------------------|--------------------------------------------|----------------| -| (constructor) | コンストラクタ | | -| (destructor) | デストラクタ | | +| `(constructor)` | コンストラクタ | | +| `(destructor)` | デストラクタ | | | `operator=` | ムーブ代入 | C++11 | | `swap` | 値の交換 | C++11 | | [`str`](basic_stringbuf/str.md) | 文字列オブジェクトの設定・取得 | | diff --git a/reference/sstream/basic_stringstream.md b/reference/sstream/basic_stringstream.md index 01fd9ce37d..71337c1462 100644 --- a/reference/sstream/basic_stringstream.md +++ b/reference/sstream/basic_stringstream.md @@ -25,8 +25,8 @@ namespace std { | 名前 | 説明 | 対応バージョン | |-------------------------------------|--------------------------------------------|----------------| -| (constructor) | コンストラクタ | | -| (destructor) | デストラクタ | | +| `(constructor)` | コンストラクタ | | +| `(destructor)` | デストラクタ | | | `operator=` | ムーブ代入 | C++11 | | `swap` | 値の交換 | C++11 | | `rdbuf` | ストリームバッファオブジェクトの設定・取得 | | From c1346e39c869eddfdd51c5154b6c8dea1da75cc8 Mon Sep 17 00:00:00 2001 From: Shunsuke Shimizu Date: Wed, 5 Jul 2023 02:42:21 +0900 Subject: [PATCH 0376/3948] =?UTF-8?q?fetch=5Fsub=20=E3=81=AE=20typo=20?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/atomic/atomic/op_minus_assign.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/atomic/atomic/op_minus_assign.md b/reference/atomic/atomic/op_minus_assign.md index 45302ce319..cec6f30393 100644 --- a/reference/atomic/atomic/op_minus_assign.md +++ b/reference/atomic/atomic/op_minus_assign.md @@ -11,7 +11,7 @@ T operator-=(T operand) noexcept; // (2) C++11 ``` ## 概要 -加算を行う +減算を行う ## テンプレートパラメータ制約 From 656649355ce2bda2f629f12880e239fed254e520 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 11 Jul 2023 00:25:50 +0900 Subject: [PATCH 0377/3948] =?UTF-8?q?C++23=20:=20=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=89=E4=BF=AE=E9=A3=BE=E5=86=85=E3=81=AE=E6=9C=AB=E5=B0=BE?= =?UTF-8?q?=E3=82=B9=E3=83=9A=E3=83=BC=E3=82=B9=E3=81=8C=E5=89=8A=E3=82=89?= =?UTF-8?q?=E3=82=8C=E3=81=A6=E3=81=97=E3=81=BE=E3=81=A3=E3=81=A6=E3=81=84?= =?UTF-8?q?=E3=81=9F=E3=81=AE=E3=82=92code=E3=82=BF=E3=82=B0=E3=81=A7?= =?UTF-8?q?=E5=9B=9E=E9=81=BF=20#1160?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp23.md b/lang/cpp23.md index 41eebfdf3f..ab68fb9108 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -106,7 +106,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| | [参照するPOSIX規格を更新](cpp23/update_normative_reference_to_posix.md) | 新しいPOSIX規格の機能を標準C++が参照していたため、参照するPOSIX規格のバージョンを更新 | -| [行末スペースを無視するよう規定](cpp23/trimming_whitespaces_before_line_splicing.md.nolink) | 行末が`\ `でおわっていた場合にMSVCは行の継続をしない実装になっていたため動作を共通化するため仕様を規定 | +| [行末スペースを無視するよう規定](cpp23/trimming_whitespaces_before_line_splicing.md.nolink) | 行末が「\ 」でおわっていた場合にMSVCは行の継続をしない実装になっていたため動作を共通化するため仕様を規定 | ## ライブラリ更新の概要 From 138872afcc7aaedb1d76a21314c5a49a5b915967 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 11 Jul 2023 14:51:41 +0900 Subject: [PATCH 0378/3948] =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=83=91=E3=82=A4?= =?UTF-8?q?=E3=83=A9=E3=81=AE=E5=AE=9F=E8=A3=85=E7=8A=B6=E6=B3=81C++23=20:?= =?UTF-8?q?=20=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE=E9=A3=BE=E5=86=85?= =?UTF-8?q?=E3=81=AE=E6=9C=AB=E5=B0=BE=E3=82=B9=E3=83=9A=E3=83=BC=E3=82=B9?= =?UTF-8?q?=E3=81=8C=E5=89=8A=E3=82=89=E3=82=8C=E3=81=A6=E3=81=97=E3=81=BE?= =?UTF-8?q?=E3=81=A3=E3=81=A6=E3=81=84=E3=81=9F=E3=81=AE=E3=82=92code?= =?UTF-8?q?=E3=82=BF=E3=82=B0=E3=81=A7=E5=9B=9E=E9=81=BF=20#1160?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/implementation-status.md b/implementation-status.md index eb91cf5bcd..b1495483f3 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -278,7 +278,7 @@ | P2334R1: [`elif`/`elifdef`/`elifndef`のサポートを追加](/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md.nolink) | `#if`/`#ifdef`/`#ifndef`に対応する複数条件命令のサポートを追加する | 12 | 13 | - | - | | P2437R1: [`#warning`のサポートを追加](/lang/cpp23/warning.md.nolink) | 多くのC++コンパイラが実装していたプリプロセス時の警告`#warning message`を正式サポート | yes | yes | yes | yes | | P2295R6: [汎用的なソースコードのエンコーディングとしてUTF-8をサポート](/lang/cpp23/support_for_utf8_as_a_portable_source_file_encoding.md.nolink) | | 13 | 15 | - | 2019 Update 2 | -| P2223R2: [行末スペースを無視するよう規定](/lang/cpp23/trimming_whitespaces_before_line_splicing.md.nolink) | 行末が`\ `でおわっていた場合にMSVCは行の継続をしない実装になっていたため動作を共通化するため仕様を規定 | Yes | Yes | - | - | +| P2223R2: [行末スペースを無視するよう規定](/lang/cpp23/trimming_whitespaces_before_line_splicing.md.nolink) | 行末が「\ 」でおわっていた場合にMSVCは行の継続をしない実装になっていたため動作を共通化するため仕様を規定 | Yes | Yes | - | - | 各処理系のC++23実装状況ページ: From c3f3f2cf06824af6c4548e63bd2155ce9328fc07 Mon Sep 17 00:00:00 2001 From: komori-n Date: Sun, 16 Jul 2023 17:31:12 +0900 Subject: [PATCH 0379/3948] =?UTF-8?q?remove=20=E3=81=AE=20typo=20=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/remove.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/algorithm/remove.md b/reference/algorithm/remove.md index 69147c9008..fbbca82699 100644 --- a/reference/algorithm/remove.md +++ b/reference/algorithm/remove.md @@ -27,7 +27,7 @@ namespace std { ``` ## 概要 -イテレータ範囲`[first, last)`から`指定された要素を取り除く。 +イテレータ範囲`[first, last)`から指定された要素を取り除く。 ## テンプレートパラメータ制約 From 97b792b514201c2ad5a52a7e29c0220ec0b53110 Mon Sep 17 00:00:00 2001 From: komori-n Date: Tue, 18 Jul 2023 21:28:35 +0900 Subject: [PATCH 0380/3948] =?UTF-8?q?ranges::swap=5Franges=20=E3=81=AE=20s?= =?UTF-8?q?wap=20=E5=9B=9E=E6=95=B0=E3=81=8C=E6=AD=A3=E3=81=97=E3=81=8F?= =?UTF-8?q?=E3=81=AA=E3=81=84=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_swap_ranges.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/algorithm/ranges_swap_ranges.md b/reference/algorithm/ranges_swap_ranges.md index 78f4b53439..32c56a4d1a 100644 --- a/reference/algorithm/ranges_swap_ranges.md +++ b/reference/algorithm/ranges_swap_ranges.md @@ -43,12 +43,12 @@ namespace std::ranges { ## 効果 -0 以上 `last1 - first1` 以下のそれぞれの `n` について [`swap`](/reference/utility/swap.md)`(*(first1 + n), *(first2 + n))` を行う +0 以上 [`min`](ranges_min.md)`(last1 - first1, last2 - first2)` 未満のそれぞれの `n` について [`swap`](/reference/utility/swap.md)`(*(first1 + n), *(first2 + n))` を行う ## 事前条件 -`[first1,last1)` と `[first2,first2 + (last1 - first1))` の範囲が重なってはならない。 -0 以上 `last1 - first1` 未満のそれぞれの `n` について、`*(first1 + n) と *(first2 + n)` は `Swappable` でなければならない。 +`[first1,last1)` と `[first2,last2)` の範囲が重なってはならない。 +0 以上 [`min`](ranges_min.md)`(last1 - first1, last2 - first2)` 未満のそれぞれの `n` について、`*(first1 + n) と *(first2 + n)` は `Swappable` でなければならない。 ## 戻り値 @@ -64,7 +64,7 @@ swap_ranges_result { ## 計算量 -正確に `last1 - first1` 回のスワップが行われる +正確に [`min`](ranges_min.md)`(last1 - first1, last2 - first2)` 回のスワップが行われる ## 例 From adf4a90966818e7f3130e2dab70cd63b00d78fd8 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 19 Jul 2023 16:31:07 +0900 Subject: [PATCH 0381/3948] =?UTF-8?q?span=20:=20P2278R4=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=20#1084?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/span/span.md | 11 ++++- reference/span/span/cbegin.md | 63 ++++++++++++++++++++++++++++ reference/span/span/cend.md | 77 ++++++++++++++++++++++++++++++++++ reference/span/span/crbegin.md | 63 ++++++++++++++++++++++++++++ reference/span/span/crend.md | 77 ++++++++++++++++++++++++++++++++++ 5 files changed, 289 insertions(+), 2 deletions(-) create mode 100644 reference/span/span/cbegin.md create mode 100644 reference/span/span/cend.md create mode 100644 reference/span/span/crbegin.md create mode 100644 reference/span/span/crend.md diff --git a/reference/span/span.md b/reference/span/span.md index c4fe25ad36..c5db6e60cd 100644 --- a/reference/span/span.md +++ b/reference/span/span.md @@ -106,6 +106,10 @@ namespace std { | [`end`](span/end.md) | 末尾要素の次を指すイテレータを取得する | C++20 | | [`rbegin`](span/rbegin.md) | 末尾要素を指す逆順イテレータを取得する | C++20 | | [`rend`](span/rend.md) | 先頭要素の前を指す逆順イテレータを取得する | C++20 | +| [`cbegin`](span/cbegin.md) | 先頭の要素を指す読み取り専用イテレータを取得する | C++23 | +| [`cend`](span/cend.md) | 末尾の次を指す読み取り専用イテレータを取得する | C++23 | +| [`crbegin`](span/crbegin.md) | 末尾を指す読み取り専用逆イテレータを取得する | C++23 | +| [`crend`](span/crend.md) | 先頭の前を指す読み取り専用逆イテレータを取得する | C++23 | ### メンバ定数 @@ -129,6 +133,8 @@ namespace std { | `const_reference` | `const`参照型 `const element_type&` | C++20 | | `iterator` | 実装定義のイテレータ型。[`contiguous_iterator`](/reference/iterator/contiguous_iterator.md)、[`random_access_iterator`](/reference/iterator/random_access_iterator.md)、constexprイテレータのモデルであり、コンテナのイテレータに対するすべての要件を満たす | C++20 | | `reverse_iterator` | 逆順イテレータ [`reverse_iterator`](/reference/iterator/reverse_iterator.md)`` | C++20 | +| `const_iterator` | 読み取り専用イテレータ [`std::const_iterator`](/reference/iterator/const_iterator.md.nolink)`` | C++23 | +| `const_reverse_iterator` | 読み取り専用逆イテレータ [`std::const_iterator`](/reference/iterator/const_iterator.md.nolink)`` | C++23 | ## 非メンバ関数 @@ -259,8 +265,8 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): 9.0 -- [GCC](/implementation.md#gcc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? +- [GCC](/implementation.md#gcc): 10.1 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 ## 参照 @@ -280,3 +286,4 @@ int main() - [P2325R3 Views should not be required to be default constructible](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2325r3.html) - [Require `span` & `basic_string_view` to be Trivially Copyable](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2251r1.pdf) - C++23から、トリビアルコピー可能が保証される。 +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) diff --git a/reference/span/span/cbegin.md b/reference/span/span/cbegin.md new file mode 100644 index 0000000000..825467f3c3 --- /dev/null +++ b/reference/span/span/cbegin.md @@ -0,0 +1,63 @@ +# cbegin +* span[meta header] +* std[meta namespace] +* span[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr const_iterator cbegin() const noexcept; +``` +* const_iterator[link /reference/iterator/const_iterator.md.nolink] + +## 概要 +先頭要素を指す読み取り専用イテレータを取得する。 + + +## 戻り値 + +```cpp +return begin(); +``` +* begin[link ./begin.md] + + +## 例外 +投げない + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5}; + std::span sp{v}; + + auto cit = sp.cbegin(); + + std::cout << *cit << '\n'; + + // これはできない + // *cit = 0; +} +``` +* cbegin()[color ff0000] + +### 出力 +``` +1 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) diff --git a/reference/span/span/cend.md b/reference/span/span/cend.md new file mode 100644 index 0000000000..3ea396854e --- /dev/null +++ b/reference/span/span/cend.md @@ -0,0 +1,77 @@ +# cend +* span[meta header] +* std[meta namespace] +* span[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr const_iterator cend() const noexcept; +``` +* const_iterator[link /reference/iterator/const_iterator.md.nolink] + +## 概要 +末尾要素の次を指すイテレータを取得する。 + + +## 戻り値 + +```cpp +return end(); +``` +* end[link ./end.md] + + +## 例外 +投げない + +## 例 +```cpp example +#include +#include +#include + +template S> +bool is_iter_pair(I, S) { + return true; +} + +bool is_iter_pair(...) { + return false; +} + +int main() { + std::vector v = {1, 2, 3, 4, 5}; + std::span sp{v}; + + auto cit = sp.cend(); + --cit; + + std::cout << *cit << '\n'; + + std::cout << std::boolalpha; + std::cout << is_iter_pair(sp.cbegin(), sp.cend()) << '\n'; + std::cout << is_iter_pair(sp.begin(), sp.cend()) << '\n'; +} +``` +* cend()[color ff0000] +* sentinel_for[link /reference/iterator/sentinel_for.md] + +### 出力 +``` +5 +true +true +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) diff --git a/reference/span/span/crbegin.md b/reference/span/span/crbegin.md new file mode 100644 index 0000000000..4894fb15cc --- /dev/null +++ b/reference/span/span/crbegin.md @@ -0,0 +1,63 @@ +# crbegin +* span[meta header] +* std[meta namespace] +* span[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr const_reverse_iterator crbegin() const noexcept; +``` +* const_iterator[link /reference/iterator/const_iterator.md.nolink] + +## 概要 +末尾要素の次を指すイテレータを取得する。 + + +## 戻り値 + +```cpp +return rbegin(); +``` +* rbegin[link ./rbegin.md] + + +## 例外 +投げない + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5}; + std::span sp{v}; + + auto cit = sp.crbegin(); + + std::cout << *cit << '\n'; + + // これはできない + // *cit = 0; +} +``` +* crbegin()[color ff0000] + +### 出力 +``` +5 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) diff --git a/reference/span/span/crend.md b/reference/span/span/crend.md new file mode 100644 index 0000000000..c20da112d8 --- /dev/null +++ b/reference/span/span/crend.md @@ -0,0 +1,77 @@ +# crend +* span[meta header] +* std[meta namespace] +* span[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr const_reverse_iterator crend() const noexcept; +``` +* const_iterator[link /reference/iterator/const_iterator.md.nolink] + +## 概要 +末尾要素の次を指すイテレータを取得する。 + + +## 戻り値 + +```cpp +return rend(); +``` +* rend[link ./rend.md] + + +## 例外 +投げない + +## 例 +```cpp example +#include +#include +#include + +template S> +bool is_iter_pair(I, S) { + return true; +} + +bool is_iter_pair(...) { + return false; +} + +int main() { + std::vector v = {1, 2, 3, 4, 5}; + std::span sp{v}; + + auto cit = sp.crend(); + --cit; + + std::cout << *cit << '\n'; + + std::cout << std::boolalpha; + std::cout << is_iter_pair(sp.crbegin(), sp.crend()) << '\n'; + std::cout << is_iter_pair(sp.rbegin(), sp.crend()) << '\n'; +} +``` +* crend()[color ff0000] +* sentinel_for[link /reference/iterator/sentinel_for.md] + +### 出力 +``` +1 +true +true +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) From 04340ca0d5503fcdb9c5c1ec03ac636445f03153 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 19 Jul 2023 16:33:06 +0900 Subject: [PATCH 0382/3948] =?UTF-8?q?=E4=B8=8D=E8=A6=81=E3=81=AA=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E4=BF=AE=E9=A3=BE=E3=81=AE=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/span/span/crbegin.md | 1 - reference/span/span/crend.md | 1 - 2 files changed, 2 deletions(-) diff --git a/reference/span/span/crbegin.md b/reference/span/span/crbegin.md index 4894fb15cc..731b1675ef 100644 --- a/reference/span/span/crbegin.md +++ b/reference/span/span/crbegin.md @@ -8,7 +8,6 @@ ```cpp constexpr const_reverse_iterator crbegin() const noexcept; ``` -* const_iterator[link /reference/iterator/const_iterator.md.nolink] ## 概要 末尾要素の次を指すイテレータを取得する。 diff --git a/reference/span/span/crend.md b/reference/span/span/crend.md index c20da112d8..3c2799b630 100644 --- a/reference/span/span/crend.md +++ b/reference/span/span/crend.md @@ -8,7 +8,6 @@ ```cpp constexpr const_reverse_iterator crend() const noexcept; ``` -* const_iterator[link /reference/iterator/const_iterator.md.nolink] ## 概要 末尾要素の次を指すイテレータを取得する。 From 7d3e69fd917cb09749aea3855289913420ca5011 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 19 Jul 2023 16:53:41 +0900 Subject: [PATCH 0383/3948] =?UTF-8?q?=E5=87=A6=E7=90=86=E5=9E=8B=20:=20VC+?= =?UTF-8?q?+=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3=E8=A1=A8?= =?UTF-8?q?=E8=A8=98=E3=83=AA=E3=82=B9=E3=83=88=E3=81=AE=E3=82=A2=E3=83=83?= =?UTF-8?q?=E3=83=97=E3=83=87=E3=83=BC=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MSVC2022 リリースノートでVSバージョンを確認し godboltでマクロの値を確認 --- implementation.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/implementation.md b/implementation.md index 6d561183c2..4f6a570f45 100644 --- a/implementation.md +++ b/implementation.md @@ -135,7 +135,10 @@ | 表記 | 製品名 [Visual Studio バージョン] †1 | VC++ バージョン †2 | `_MSC_VER` | `_MSC_FULL_VER` | |---------------|----------------------------------------|-----------------|------------|-----------------| -| 2022 Update 3 | Visual Studio 2022 version 17.3.4 | 14.30 | 1933 | 193331630 | +| 2022 Update 6 | Visual Studio 2022 version 17.6.5 | ?? | 1936 | 193632530 | +| 2022 Update 5 | Visual Studio 2022 version 17.5.4 | ?? | 1935 | 193532217 | +| 2022 Update 4 | Visual Studio 2022 version 17.4.9 | ?? | 1934 | 193431944 | +| 2022 Update 3 | Visual Studio 2022 version 17.3.6 | 14.30 | 1933 | 193331630 | | 2022 Update 2 | Visual Studio 2022 version 17.2.2 | 14.30 | 1932 | 193231329 | | 2022 Update 1 | Visual Studio 2022 version 17.0.2 | 14.30 | 1930 | 193030706 | | 2022 | Visual Studio 2022 version 17.0.1 | 14.30 | 1930 | 193030705 | From 0778710e5a3cbbead54b7a77e962b86061e37c69 Mon Sep 17 00:00:00 2001 From: komori-n Date: Wed, 19 Jul 2023 22:50:49 +0900 Subject: [PATCH 0384/3948] =?UTF-8?q?swap=5Franges=20=E3=81=AE=E3=83=AB?= =?UTF-8?q?=E3=83=BC=E3=83=97=E5=9B=9E=E6=95=B0=E3=81=8C=E6=AD=A3=E3=81=97?= =?UTF-8?q?=E3=81=8F=E3=81=AA=E3=81=84=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/swap_ranges.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/algorithm/swap_ranges.md b/reference/algorithm/swap_ranges.md index bee7ceb7b1..5d8650d26c 100644 --- a/reference/algorithm/swap_ranges.md +++ b/reference/algorithm/swap_ranges.md @@ -36,7 +36,7 @@ namespace std { ## 効果 -0 以上 `last1 - first1` 以下のそれぞれの `n` について [`swap`](/reference/utility/swap.md)`(*(first1 + n), *(first2 + n))` を行う +0 以上 `last1 - first1` 未満のそれぞれの `n` について [`swap`](/reference/utility/swap.md)`(*(first1 + n), *(first2 + n))` を行う ## 戻り値 From 79605e8277108c0de0d0ecf223945a518ad32127 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Thu, 20 Jul 2023 12:30:13 +0900 Subject: [PATCH 0385/3948] =?UTF-8?q?=20:=20P2278R4=E3=81=AE?= =?UTF-8?q?=E6=A9=9F=E8=83=BD=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/exposition-only.md | 2 ++ reference/iterator.md | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/reference/exposition-only.md b/reference/exposition-only.md index 382f98d203..c345766e3f 100644 --- a/reference/exposition-only.md +++ b/reference/exposition-only.md @@ -26,6 +26,7 @@ | [`dereferenceable`](iterator/dereferenceable.md) | 単純な間接参照が可能 (concept) | C++20 | | [`is-integer-like`](iterator/is_integer_like.md) | 符号付整数型と同等の型か否かを表す (variable template) | C++20 | | [`is-signed-integer-like`](iterator/is_integer_like.md) | 符号なし整数型と同等の型か否かを表す (variable template) | C++20 | +| [`constant-iterator ](iterator/iconstant_iterator.md.nolink) | 要素不変なイテレータ (concept) | C++23 | ## `` @@ -50,3 +51,4 @@ * [N4861 16.4.2.1 Exposition-only functions](https://timsong-cpp.github.io/cppwp/n4861/expos.only.func) * [LWG 3404 Finish removing `subrange`'s conversions from `pair-like`](https://cplusplus.github.io/LWG/issue3404) +* [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) diff --git a/reference/iterator.md b/reference/iterator.md index fba74b582f..a2e1dbc8ca 100644 --- a/reference/iterator.md +++ b/reference/iterator.md @@ -78,6 +78,7 @@ C++20以降の標準ライブラリでは、任意のイテレータに対して | [`iter_reference_t`](iterator/iter_reference_t.md) | イテレータの`reference_type`を取得する (alias template) | C++20 | | [`iter_rvalue_reference_t`](iterator/iter_rvalue_reference_t.md) | イテレータの指す要素の右辺値参照型を取得する (alias template) | C++20 | | [`iter_common_reference_t`](iterator/iter_common_reference_t.md) | イテレータの`value_type`と`reference_type`の[`common_reference`](/reference/type_traits/common_reference.md)を取得する (alias template) | C++20 | +| [`iter_const_reference_t`](iterator/iter_const_reference_t.md.nolink) | イテレータの参照型(`iter_reference_t`)を`const`化したものを取得する (alias template) | C++23 | | [`indirect_result_t`](iterator/indirect_result_t.md) | 関数呼び出し可能な型`F`を複数のイテレータ`Is...`によって呼び出した時の戻り値型を取得する (alias template) | C++20 | | [`projected`](iterator/projected.md) | イテレータ`I`の`Proj`による射影操作の結果を表すことのできる[`indirectly_readable`](/reference/iterator/indirectly_readable.md)なクラス (class template) | C++20 | | [`incrementable_traits`](iterator/incrementable_traits.md) | `iter_difference_t`にアダプトするためのカスタマイゼーションポイント (class template) | C++20 | @@ -137,6 +138,16 @@ C++20以降の標準ライブラリでは、任意のイテレータに対して | [`istreambuf_iterator`](iterator/istreambuf_iterator.md) | 入力ストリームバッファイテレータ(class template) | | | [`ostreambuf_iterator`](iterator/ostreambuf_iterator.md) | 出力ストリームバッファイテレータ(class template) | | +## 定数イテレータ + +| 名前 | 説明 | 対応バージョン | +|----------------------------------------------------|------------------------------------------|-------| +| [`basic_const_iterator`](iterator/basic_const_iterator.md.nolink) | イテレータの要素を`const`化するラッパーイテレータ(class template) | C++23 | +| [`const_iterator`](iterator/const_iterator.md.nolink) | 要素が`const`化されたイテレータ型を取得する (alias template) | C++23 | +| [`const_sentinel`](iterator/const_sentinel.md.nolink) | 要素が`const`化された番兵型を取得する (alias template) | C++23 | +| [`make_const_iterator`](iterator/make_const_iterator.md.nolink) | `const_iterator`オブジェクトを作るヘルパ関数(function template) | C++23 | +| [`make_const_sentinel`](iterator/make_const_sentinel.md.nolink) | `const_sentinel`オブジェクトを作るヘルパ関数(function template) | C++23 | + ## その他のイテレータアダプタ | 名前 | 説明 | 対応バージョン | @@ -186,3 +197,4 @@ C++20以降の標準ライブラリでは、任意のイテレータに対して - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) - [P2051R0 C++ Standard Library Issues to be moved in Prague](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2051r0.html) +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) From cde8479f21e88562f1dc764fa15b1875de5a0232 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Thu, 20 Jul 2023 15:05:33 +0900 Subject: [PATCH 0386/3948] =?UTF-8?q?iter=5Fconst=5Freference=5Ft=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=20#1084?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator.md | 2 +- reference/iterator/iter_const_reference_t.md | 91 ++++++++++++++++++++ 2 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 reference/iterator/iter_const_reference_t.md diff --git a/reference/iterator.md b/reference/iterator.md index a2e1dbc8ca..f2111fdad7 100644 --- a/reference/iterator.md +++ b/reference/iterator.md @@ -78,7 +78,7 @@ C++20以降の標準ライブラリでは、任意のイテレータに対して | [`iter_reference_t`](iterator/iter_reference_t.md) | イテレータの`reference_type`を取得する (alias template) | C++20 | | [`iter_rvalue_reference_t`](iterator/iter_rvalue_reference_t.md) | イテレータの指す要素の右辺値参照型を取得する (alias template) | C++20 | | [`iter_common_reference_t`](iterator/iter_common_reference_t.md) | イテレータの`value_type`と`reference_type`の[`common_reference`](/reference/type_traits/common_reference.md)を取得する (alias template) | C++20 | -| [`iter_const_reference_t`](iterator/iter_const_reference_t.md.nolink) | イテレータの参照型(`iter_reference_t`)を`const`化したものを取得する (alias template) | C++23 | +| [`iter_const_reference_t`](iterator/iter_const_reference_t.md) | イテレータの参照型(`iter_reference_t`)を`const`化したものを取得する (alias template) | C++23 | | [`indirect_result_t`](iterator/indirect_result_t.md) | 関数呼び出し可能な型`F`を複数のイテレータ`Is...`によって呼び出した時の戻り値型を取得する (alias template) | C++20 | | [`projected`](iterator/projected.md) | イテレータ`I`の`Proj`による射影操作の結果を表すことのできる[`indirectly_readable`](/reference/iterator/indirectly_readable.md)なクラス (class template) | C++20 | | [`incrementable_traits`](iterator/incrementable_traits.md) | `iter_difference_t`にアダプトするためのカスタマイゼーションポイント (class template) | C++20 | diff --git a/reference/iterator/iter_const_reference_t.md b/reference/iterator/iter_const_reference_t.md new file mode 100644 index 0000000000..27b0db8572 --- /dev/null +++ b/reference/iterator/iter_const_reference_t.md @@ -0,0 +1,91 @@ +# iter_const_reference_t +* iterator[meta header] +* std[meta namespace] +* type-alias[meta id-type] +* cpp20[meta cpp] + +```cpp +namespace std { + template + using iter_const_reference_t = common_reference_t&&, iter_reference_t>; +} +``` +* indirectly_readable[link ./indirectly_readable.md] +* common_reference_t[link /reference/type_traits/common_reference.md] +* iter_value_t[link ./iter_value_t.md] +* iter_reference_t[link ./iter_reference_t.md] + +## 概要 + +任意のイテレータ型`It`から、そのイテレータの要素への`const`参照型を取得する。 + +## 型の決定 + +`iter_value_t`が非参照型であり`iter_reference_t`から修飾を除いた型であるとすると、`iter_reference_t`に対して`iter_const_reference_t`は基本的には次のようになる + +|`iter_reference_t`|`iter_const_reference_t`| +|---|---| +|`T&`|`const T&`| +|`T&&`|`const T&&`| +|`const T&`|`const T&`| +|`const T&&`|`const T&&`| +|`T`|`T`| +|`const T`|`T`| + +`It`に対して`iterator_traits`の特殊化が存在する場合や、`const iter_value_t&&`と`iter_reference_t`について`common_reference`が特殊化されている場合はこれと異なる結果となりうる。標準ライブラリにあるそのようなイテレータ型を持つものについて一部例を示すと、次のようになる + +|`It`の取得元の範囲|`iter_value_t`|`iter_reference_t`|`iter_const_reference_t`| +|---|---|---|---| +|[`std::vector`](/reference/vector/vector.md)|`bool`|`std::vector::reference`|`bool`| +|`const std::vector`|`bool`|`bool`|`bool`| +|[`views::zip`](/reference/ranges/zip_view.md.nolink)|`std::tuple`|`std::tuple`|`std::tuple`| +|[`views::enumrate`](/reference/ranges/enumrate_view.md.nolink)|`std::tuple`|`std::tuple`|`std::tuple`| + +表中の`T, U`はそれそれの`view`に入力された範囲の値型、`D`は`views::enumrate`の入力範囲の`iter_difference_t`とする。 + +## 例 +```cpp example +#include +#include + +// indirectly_readableとなる最低限の型 +// Rが参照型、Vが値型となる +template +struct test_indirectly_readable { + using value_type = V; + using difference = std::ptrdiff_t; + + auto operator*() const -> R; +}; + +int main() { + static_assert(std::same_as>, const int&>); + static_assert(std::same_as>, const int&&>); + static_assert(std::same_as>, const int&>); + static_assert(std::same_as>, const int&&>); + static_assert(std::same_as>, int>); + static_assert(std::same_as>, int>); + + static_assert(std::same_as , std::tuple>>, std::tuple>); + static_assert(std::same_as, std::tuple>>, std::tuple>); + static_assert(std::same_as& , std::tuple>>, const std::tuple&>); +} +``` +* std::iter_const_reference_t[color ff0000] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) From 47397958eb92ad9e374f3e5386eca6102d387b45 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Thu, 20 Jul 2023 16:09:04 +0900 Subject: [PATCH 0387/3948] =?UTF-8?q?iter=5Fconst=5Freference=5Ft=20:=20?= =?UTF-8?q?=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3=E6=8C=87=E5=AE=9A?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/iter_const_reference_t.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/iterator/iter_const_reference_t.md b/reference/iterator/iter_const_reference_t.md index 27b0db8572..47a79a25ff 100644 --- a/reference/iterator/iter_const_reference_t.md +++ b/reference/iterator/iter_const_reference_t.md @@ -2,7 +2,7 @@ * iterator[meta header] * std[meta namespace] * type-alias[meta id-type] -* cpp20[meta cpp] +* cpp23[meta cpp] ```cpp namespace std { From a5c12573bef144e8af06888137c3e8401abcca49 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 21 Jul 2023 13:21:33 +0900 Subject: [PATCH 0388/3948] =?UTF-8?q?=E3=83=AF=E3=82=A4=E3=83=96=E3=83=AB?= =?UTF-8?q?=E5=88=86=E5=B8=83=E3=81=AE=E5=8F=82=E8=80=83=E6=96=87=E7=8C=AE?= =?UTF-8?q?=E3=82=92Web=20Archive=E3=81=AB=E5=B7=AE=E3=81=97=E6=9B=BF?= =?UTF-8?q?=E3=81=88=20#1159?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/random/weibull_distribution.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/random/weibull_distribution.md b/reference/random/weibull_distribution.md index 51d0a5e77b..f461df9850 100644 --- a/reference/random/weibull_distribution.md +++ b/reference/random/weibull_distribution.md @@ -128,5 +128,5 @@ int main() ### 参考 - [ワイブル分布 - Wikipedia](https://ja.wikipedia.org/wiki/ワイブル分布) - [ワイブル分布 = NtRand](http://www.ntrand.com/jp/weibull-distribution/) -- [疲労や破壊現象とワイブル分布](http://www.mogami.com/notes/weibull.html) +- [疲労や破壊現象とワイブル分布](http://web.archive.org/web/20220706102605/http://www.mogami.com/notes/weibull.html) From e0d67ff886c95bf2444c6a33d4556735b2ab2faf Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 26 Jul 2023 15:26:55 +0900 Subject: [PATCH 0389/3948] =?UTF-8?q?ostringstream=E3=81=AEstr()=20?= =?UTF-8?q?=E4=BF=AE=E9=A3=BE=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/sstream/basic_ostringstream/str.md | 4 ++-- reference/sstream/basic_stringbuf/str.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/sstream/basic_ostringstream/str.md b/reference/sstream/basic_ostringstream/str.md index c00d569fbf..f0c1eca187 100644 --- a/reference/sstream/basic_ostringstream/str.md +++ b/reference/sstream/basic_ostringstream/str.md @@ -8,8 +8,8 @@ basic_string str() const; // (1) C++03 basic_string str() const &; // (1) C++20 template -basic_string str(const SAlloc& sa) const &; // (2) C++20 -basic_string str() const &&; // (3) C++20 +basic_string str(const SAlloc& sa) const; // (2) C++20 +basic_string str() &&; // (3) C++20 void str(const basic_string& s); // (4) template diff --git a/reference/sstream/basic_stringbuf/str.md b/reference/sstream/basic_stringbuf/str.md index d02eed80a3..1d4b691af5 100644 --- a/reference/sstream/basic_stringbuf/str.md +++ b/reference/sstream/basic_stringbuf/str.md @@ -8,8 +8,8 @@ basic_string str() const; // (1) C++03 basic_string str() const &; // (1) C++20 template -basic_string str(const SAlloc& sa) const &; // (2) C++20 -basic_string str() const &&; // (3) C++20 +basic_string str(const SAlloc& sa) const; // (2) C++20 +basic_string str() &&; // (3) C++20 void str(const basic_string& s); // (4) template From 1ac7d1265a38e8965fdb0c05d250aa50787c71ea Mon Sep 17 00:00:00 2001 From: Shun Fujioka Date: Wed, 26 Jul 2023 22:07:19 +0900 Subject: [PATCH 0390/3948] =?UTF-8?q?std::map=E3=81=AEoperator[]=E3=81=AE?= =?UTF-8?q?=E8=A8=98=E8=BF=B0=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 要素が存在しない場合はデフォルト初期化ではなく、 値初期化をしてその要素を返却する。unordered_map についても同様の記述に修正。 --- reference/map/map/op_at.md | 2 +- reference/unordered_map/unordered_map/op_at.md | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/reference/map/map/op_at.md b/reference/map/map/op_at.md index 5870ff609a..340d961d12 100644 --- a/reference/map/map/op_at.md +++ b/reference/map/map/op_at.md @@ -14,7 +14,7 @@ T& operator[](key_type&& x); // (2) C++11 ## 戻り値 -キー`x`に対応する値を返す。対応する要素が存在しない場合は、要素をデフォルト構築して参照を返す。 +キー`x`に対応する値を返す。対応する要素が存在しない場合は、要素を値初期化して参照を返す。 ## 計算量 diff --git a/reference/unordered_map/unordered_map/op_at.md b/reference/unordered_map/unordered_map/op_at.md index d4f1bdcd7b..8fcae87898 100644 --- a/reference/unordered_map/unordered_map/op_at.md +++ b/reference/unordered_map/unordered_map/op_at.md @@ -14,8 +14,7 @@ T& operator[](key_type&& x); 要素へのアクセス ## 戻り値 -キーxに対応する値を返す。 -オブジェクトが存在しないときは、新しい要素が追加される。 +キー`x`に対応する値を返す。対応する要素が存在しない場合は、要素を値初期化して参照を返す。 ## 例外 投げない。 From 069e8574e5043f53c1c8e64faa7d54969e5e7c5f Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Thu, 27 Jul 2023 13:10:40 +0900 Subject: [PATCH 0391/3948] =?UTF-8?q?basic=5Fconst=5Fiterator=E3=83=9A?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E8=BF=BD=E5=8A=A0=20#1084?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator.md | 2 +- reference/iterator/basic_const_iterator.md | 121 +++++++++++++++++++++ 2 files changed, 122 insertions(+), 1 deletion(-) create mode 100644 reference/iterator/basic_const_iterator.md diff --git a/reference/iterator.md b/reference/iterator.md index f2111fdad7..47b2342130 100644 --- a/reference/iterator.md +++ b/reference/iterator.md @@ -142,7 +142,7 @@ C++20以降の標準ライブラリでは、任意のイテレータに対して | 名前 | 説明 | 対応バージョン | |----------------------------------------------------|------------------------------------------|-------| -| [`basic_const_iterator`](iterator/basic_const_iterator.md.nolink) | イテレータの要素を`const`化するラッパーイテレータ(class template) | C++23 | +| [`basic_const_iterator`](iterator/basic_const_iterator.md) | イテレータの要素を`const`化するラッパーイテレータ(class template) | C++23 | | [`const_iterator`](iterator/const_iterator.md.nolink) | 要素が`const`化されたイテレータ型を取得する (alias template) | C++23 | | [`const_sentinel`](iterator/const_sentinel.md.nolink) | 要素が`const`化された番兵型を取得する (alias template) | C++23 | | [`make_const_iterator`](iterator/make_const_iterator.md.nolink) | `const_iterator`オブジェクトを作るヘルパ関数(function template) | C++23 | diff --git a/reference/iterator/basic_const_iterator.md b/reference/iterator/basic_const_iterator.md new file mode 100644 index 0000000000..42043ad028 --- /dev/null +++ b/reference/iterator/basic_const_iterator.md @@ -0,0 +1,121 @@ +# basic_const_iterator +* iterator[meta header] +* std[meta namespace] +* class template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template + class basic_const_iterator; +} +``` +* input_iterator[link ./input_iterator.md] + +## 概要 + +`basic_const_iterator`は、イテレータをラップし、元の要素を定数(`const`)として参照するイテレータアダプタである。その他の操作は、元のイテレータそのものの動作をする。 + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------------------------------------------------------|-------------|-------| +| [`(constructor)`](basic_const_iterator/op_constructor.md.nolink) | コンストラクタ | C++23 | +| [`operator=`](basic_const_iterator/op_assign.md.nolink) | 代入演算子 | C++23 | +| [`base`](basic_const_iterator/base.md.nolink) | 元のイテレータを取得する | C++23 | +| [`operator*`](basic_const_iterator/op_deref.md.nolink) | 間接参照演算子 | C++23 | +| [`operator->`](basic_const_iterator/op_arrow.md.nolink) | メンバアクセス演算子 | C++23 | +| [`operator++`](basic_const_iterator/op_increment.md.nolink) | イテレータをインクリメントする | C++23 | +| [`operator--`](basic_const_iterator/op_decrement.md.nolink) | イテレータをデクリメントする | C++23 | +| [`operator+=`](basic_const_iterator/op_plus_assign.md.nolink) | イテレータ自身を進める | C++23 | +| [`operator-`](basic_const_iterator/op_unary_minus.md.nolink) | イテレータを逆に進める | C++23 | +| [`operator-=`](basic_const_iterator/op_minus_assign.md.nolink) | イテレータ自身を逆に進める | C++23 | +| [`operator[]`](basic_const_iterator/op_at.md.nolink) | 任意の位置にランダムアクセスする | C++23 | +| [`operator==`](basic_const_iterator/op_equal.md.nolink) | 等値比較 | C++23 | +| [`operator!=`](basic_const_iterator/op_equal.md.nolink) | 非等値比較 | C++23 | +| [`operator<`](basic_const_iterator/op_less.md.nolink) | 左辺が右辺より小さいかの判定を行う | C++23 | +| [`operator<=`](basic_const_iterator/op_less_equal.md.nolink) | 左辺が右辺以下かの判定を行う | C++23 | +| [`operator>`](basic_const_iterator/op_greater.md.nolink) | 左辺が右辺より大きいかの判定を行う | C++23 | +| [`operator>=`](basic_const_iterator/op_greater_equal.md) | 左辺が右辺以上かの判定を行う | C++23 | +| [`operator<=>`](basic_const_iterator/op_compare_3way.md.nolink) | 三方比較を行う | C++23 | +| [`operator-`](basic_const_iterator/op_minus.md.nolink) | 2つの`basic_const_iterator`の差を求める | C++23 | +| [`operator+`](basic_const_iterator/op_plus.md.nolink) | イテレータを進める | C++23 | + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------------------------------------------------------|-------------|-------| +| `iterator_concept` | `Iterator`がモデルとなる最も強いイテレータコンセプトに対応する[イテレータタグ型](/reference/iterator/iterator_tag.md) | C++23 | +| `iterator_category` | `Iterator`が[`forward_iterator`](/reference/iterator/forward_iterator.md)のモデルである場合にのみ[`iterator_traits`](/reference/iterator/iterator_traits.md)`<​Iterator>​::​iterator_category`として定義される | C++23 | +| `value_type` | [`iter_value_t`](/reference/iterator/iter_value_t.md)`` | C++23 | +| `difference_type` | [`iter_difference_t`](/reference/iterator/iter_difference_t.md)`` | C++23 | + +`iterator_concept`は次のように決定される + +- `Iterator`が[`contiguous_iterator`](/reference/iterator/contiguous_iterator.md)のモデルとなる場合 + - `contiguous_iterator_tag` +- そうではなく、`Iterator`が[`random_access_iterator`](/reference/iterator/random_access_iterator.md)のモデルとなる場合 + - `random_access_iterator_tag` +- そうではなく、`Iterator`が[`bidirectional_iterator`](/reference/iterator/bidirectional_iterator.md)のモデルとなる場合 + - `bidirectional_iterator_tag` +- そうではなく、`Iterator`が[`forward_iterator`](/reference/iterator/forward_iterator.md)のモデルとなる場合 + - `forward_iterator_tag` +- それ以外の場合 + - `input_iterator_tag` + +## 非メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------------------------------------------------------|-------------|-------| +| [`operator<`](basic_const_iterator/op_less.md.nolink) | 左辺が右辺より小さいかの判定を行う | C++23 | +| [`operator<=`](basic_const_iterator/op_less_equal.md.nolink) | 左辺が右辺以下かの判定を行う | C++23 | +| [`operator>`](basic_const_iterator/op_greater.md.nolink) | 左辺が右辺より大きいかの判定を行う | C++23 | +| [`operator>=`](basic_const_iterator/op_greater_equal.md.nolink) | 左辺が右辺以上かの判定を行う | C++23 | +| [`operator+`](basic_const_iterator/op_plus.md.nolink) | イテレータを進める | C++23 | +| [`operator-`](basic_const_iterator/op_minus.md.nolink) | 2つの`basic_const_iterator`の差を求める | C++23 | +| [`iter_move`](basic_const_iterator/iter_move.md.nolink) | イテレータの要素の移動 | C++23 | +| [`make_const_iterator`](make_const_iterator.md.nolink) | `basic_const_iterator`のヘルパ関数 | C++23 | +| [`make_const_sentinel`](make_const_sentinel.md.nolink) | `basic_const_iterator`のヘルパ関数 | C++23 | + +## 例 +(執筆中) + +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + auto cit = std::make_const_iterator(vec.begin()); + + std::cout << *cit << '\n'; + + ++cit; + + std::cout << *cit << '\n'; + + // 要素を変更できない + //*cit = 0; +} +``` +### 出力 +``` +1 +2 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) From ec6330712a56da138e4b977ca03476a72fa80801 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Thu, 27 Jul 2023 14:23:42 +0900 Subject: [PATCH 0392/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E3=81=A8=E4=B8=8D=E5=8F=AF=E8=A6=96=E6=96=87=E5=AD=97?= =?UTF-8?q?=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/basic_const_iterator.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/iterator/basic_const_iterator.md b/reference/iterator/basic_const_iterator.md index 42043ad028..07c9c7a44a 100644 --- a/reference/iterator/basic_const_iterator.md +++ b/reference/iterator/basic_const_iterator.md @@ -36,7 +36,7 @@ namespace std { | [`operator<`](basic_const_iterator/op_less.md.nolink) | 左辺が右辺より小さいかの判定を行う | C++23 | | [`operator<=`](basic_const_iterator/op_less_equal.md.nolink) | 左辺が右辺以下かの判定を行う | C++23 | | [`operator>`](basic_const_iterator/op_greater.md.nolink) | 左辺が右辺より大きいかの判定を行う | C++23 | -| [`operator>=`](basic_const_iterator/op_greater_equal.md) | 左辺が右辺以上かの判定を行う | C++23 | +| [`operator>=`](basic_const_iterator/op_greater_equal.md.nolink) | 左辺が右辺以上かの判定を行う | C++23 | | [`operator<=>`](basic_const_iterator/op_compare_3way.md.nolink) | 三方比較を行う | C++23 | | [`operator-`](basic_const_iterator/op_minus.md.nolink) | 2つの`basic_const_iterator`の差を求める | C++23 | | [`operator+`](basic_const_iterator/op_plus.md.nolink) | イテレータを進める | C++23 | @@ -47,7 +47,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------------------------------------------------------|-------------|-------| | `iterator_concept` | `Iterator`がモデルとなる最も強いイテレータコンセプトに対応する[イテレータタグ型](/reference/iterator/iterator_tag.md) | C++23 | -| `iterator_category` | `Iterator`が[`forward_iterator`](/reference/iterator/forward_iterator.md)のモデルである場合にのみ[`iterator_traits`](/reference/iterator/iterator_traits.md)`<​Iterator>​::​iterator_category`として定義される | C++23 | +| `iterator_category` | `Iterator`が[`forward_iterator`](/reference/iterator/forward_iterator.md)のモデルである場合にのみ[`iterator_traits`](/reference/iterator/iterator_traits.md)`::iterator_category`として定義される | C++23 | | `value_type` | [`iter_value_t`](/reference/iterator/iter_value_t.md)`` | C++23 | | `difference_type` | [`iter_difference_t`](/reference/iterator/iter_difference_t.md)`` | C++23 | From 206dcffbd83c1b4e070233ee321bbe16b8bad024 Mon Sep 17 00:00:00 2001 From: Shun Fujioka Date: Fri, 28 Jul 2023 00:21:33 +0900 Subject: [PATCH 0393/3948] =?UTF-8?q?fix:=20unordered=5Fmap=E3=81=AEoperat?= =?UTF-8?q?or[]=E3=81=AE=E4=BE=8B=E5=A4=96=E4=BB=95=E6=A7=98=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 例外を投げない仕様はないが、ハッシュ関数以外が例外を投げた場合は insertには副作用がないという規定がある ref: [unord.req.except] --- reference/unordered_map/unordered_map/op_at.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/reference/unordered_map/unordered_map/op_at.md b/reference/unordered_map/unordered_map/op_at.md index 8fcae87898..a1c7fbebe4 100644 --- a/reference/unordered_map/unordered_map/op_at.md +++ b/reference/unordered_map/unordered_map/op_at.md @@ -17,8 +17,7 @@ T& operator[](key_type&& x); キー`x`に対応する値を返す。対応する要素が存在しない場合は、要素を値初期化して参照を返す。 ## 例外 -投げない。 - +ハッシュ関数以外から例外が投げられた場合には、対応する要素がない場合の新規要素の挿入処理は実施されない。 ## 計算量 - 平均: 定数時間 From fb63802526c3daea90356da72e0ed67a8dd05f22 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Fri, 28 Jul 2023 12:33:44 +0900 Subject: [PATCH 0394/3948] =?UTF-8?q?basic=5Fconst=5Fiterator=20:=20?= =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=82=B9=E3=83=88=E3=83=A9=E3=82=AF=E3=82=BF?= =?UTF-8?q?=E3=81=A8.base()=E8=BF=BD=E5=8A=A0=20#1084?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/basic_const_iterator.md | 14 +-- .../iterator/basic_const_iterator/base.md | 63 +++++++++++++ .../basic_const_iterator/op_constructor.md | 88 +++++++++++++++++++ reference/iterator/counted_iterator/base.md | 2 +- 4 files changed, 161 insertions(+), 6 deletions(-) create mode 100644 reference/iterator/basic_const_iterator/base.md create mode 100644 reference/iterator/basic_const_iterator/op_constructor.md diff --git a/reference/iterator/basic_const_iterator.md b/reference/iterator/basic_const_iterator.md index 07c9c7a44a..61c5881140 100644 --- a/reference/iterator/basic_const_iterator.md +++ b/reference/iterator/basic_const_iterator.md @@ -20,9 +20,8 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------------------------------------------------------|-------------|-------| -| [`(constructor)`](basic_const_iterator/op_constructor.md.nolink) | コンストラクタ | C++23 | -| [`operator=`](basic_const_iterator/op_assign.md.nolink) | 代入演算子 | C++23 | -| [`base`](basic_const_iterator/base.md.nolink) | 元のイテレータを取得する | C++23 | +| [`(constructor)`](basic_const_iterator/op_constructor.md) | コンストラクタ | C++23 | +| [`base`](basic_const_iterator/base.md) | 元のイテレータを取得する | C++23 | | [`operator*`](basic_const_iterator/op_deref.md.nolink) | 間接参照演算子 | C++23 | | [`operator->`](basic_const_iterator/op_arrow.md.nolink) | メンバアクセス演算子 | C++23 | | [`operator++`](basic_const_iterator/op_increment.md.nolink) | イテレータをインクリメントする | C++23 | @@ -64,7 +63,7 @@ namespace std { - それ以外の場合 - `input_iterator_tag` -## 非メンバ関数 +## 非メンバ(*Hidden friends*)関数 | 名前 | 説明 | 対応バージョン | |------------------------------------------------------|-------------|-------| @@ -75,11 +74,15 @@ namespace std { | [`operator+`](basic_const_iterator/op_plus.md.nolink) | イテレータを進める | C++23 | | [`operator-`](basic_const_iterator/op_minus.md.nolink) | 2つの`basic_const_iterator`の差を求める | C++23 | | [`iter_move`](basic_const_iterator/iter_move.md.nolink) | イテレータの要素の移動 | C++23 | + +## 非メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------------------------------------------------------|-------------|-------| | [`make_const_iterator`](make_const_iterator.md.nolink) | `basic_const_iterator`のヘルパ関数 | C++23 | | [`make_const_sentinel`](make_const_sentinel.md.nolink) | `basic_const_iterator`のヘルパ関数 | C++23 | ## 例 -(執筆中) ```cpp example #include @@ -101,6 +104,7 @@ int main() { //*cit = 0; } ``` + ### 出力 ``` 1 diff --git a/reference/iterator/basic_const_iterator/base.md b/reference/iterator/basic_const_iterator/base.md new file mode 100644 index 0000000000..c8f53374ae --- /dev/null +++ b/reference/iterator/basic_const_iterator/base.md @@ -0,0 +1,63 @@ +# base +* iterator[meta header] +* std[meta namespace] +* basic_const_iterator[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr const Iterator& base() const & noexcept; // (1) +constexpr Iterator base() &&; // (2) +``` + +## 概要 + +メンバ変数として保持している、元のイテレータを取得する。 + +## 戻り値 + +- (1) : 元のイテレータへの`const`参照を返す。 +- (2) : 元のイテレータをムーブして返す。 + +## 例 + +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + std::basic_const_iterator cit = vec.begin(); + + std::cout << *cit << '\n'; + std::cout << *(cit.base()) << '\n'; + + // 元のイテレータが可変イテレータならば要素を変更可能 + *(cit.base()) = 0; + std::cout << *(cit.base()) << '\n'; +} +``` +* base[color ff0000] + +### 出力 + +``` +1 +1 +0 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) diff --git a/reference/iterator/basic_const_iterator/op_constructor.md b/reference/iterator/basic_const_iterator/op_constructor.md new file mode 100644 index 0000000000..40b7ccc3d3 --- /dev/null +++ b/reference/iterator/basic_const_iterator/op_constructor.md @@ -0,0 +1,88 @@ +# コンストラクタ +* iterator[meta header] +* std[meta namespace] +* basic_const_iterator[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr basic_const_iterator() requires default_initializable = default; // (1) + +constexpr basic_const_iterator(Iterator current); // (2) + +template U> +constexpr basic_const_iterator(basic_const_iterator current); // (3) + +template T> + requires convertible_to +constexpr basic_const_iterator(T&& current); // (4) +``` +* default_initializable[link /reference/concepts/default_initializable.md] +* convertible_to[link /reference/concepts/convertible_to.md] +* different-from[link /reference/ranges/different-from.md] + +## 概要 + +`basic_const_iterator`オブジェクトを構築する。 + +## 効果 + +ラップするイテレータを`current_`というメンバに保持するとして + +- (1) : `current_`をデフォルト構築する +- (2) : `current_`を`std::move(current)`で初期化する +- (3) : `current_`を`std::move(current.current_)`で初期化する +- (4) : `current_`を`std::forward(current)`で初期化する + +## 例 +```cpp example +#include +#include + +// 例示のための単純なイテレータラッパ、ラップするイテレータへの暗黙変換を提供する +template +struct wrap_iter { + I it; + + operator I() const { + return it; + } +}; + +int main() { + using I = std::vector::iterator; + + std::vector vec = {1, 2, 3, 4, 5}; + + // (1) デフォルトコンストラクタ + std::basic_const_iterator ci1{}; + + // (2) イテレータから構築 + std::basic_const_iterator ci2{vec.begin()}; + + // (3) 別のbasic_const_iteratorから変換して構築(コピーコンストラクタ) + std::basic_const_iterator ci3{ci2}; + + wrap_iter wrap{ci2}; + // (4) Iteratorに変換可能な型から構築 + std::basic_const_iterator ci4{wrap}; +} +``` +* basic_const_iterator[color ff0000] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) diff --git a/reference/iterator/counted_iterator/base.md b/reference/iterator/counted_iterator/base.md index b70286fa72..f66dcb9472 100644 --- a/reference/iterator/counted_iterator/base.md +++ b/reference/iterator/counted_iterator/base.md @@ -39,7 +39,7 @@ int main() { std::cout << *(ci.base()); } ``` -* count[color ff0000] +* base[color ff0000] * ranges::begin[link /reference/ranges/begin.md] ### 出力 From e19c878e156ca64ea7a5b4a4c703f8c79c494bde Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Fri, 28 Jul 2023 12:59:00 +0900 Subject: [PATCH 0395/3948] =?UTF-8?q?basic=5Fconst=5Fiterator=20:=20*=20->?= =?UTF-8?q?=20=E8=BF=BD=E5=8A=A0=20#1084?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/basic_const_iterator.md | 4 +- .../iterator/basic_const_iterator/op_arrow.md | 74 +++++++++++++++++++ .../iterator/basic_const_iterator/op_deref.md | 59 +++++++++++++++ 3 files changed, 135 insertions(+), 2 deletions(-) create mode 100644 reference/iterator/basic_const_iterator/op_arrow.md create mode 100644 reference/iterator/basic_const_iterator/op_deref.md diff --git a/reference/iterator/basic_const_iterator.md b/reference/iterator/basic_const_iterator.md index 61c5881140..e914d17bae 100644 --- a/reference/iterator/basic_const_iterator.md +++ b/reference/iterator/basic_const_iterator.md @@ -22,8 +22,8 @@ namespace std { |------------------------------------------------------|-------------|-------| | [`(constructor)`](basic_const_iterator/op_constructor.md) | コンストラクタ | C++23 | | [`base`](basic_const_iterator/base.md) | 元のイテレータを取得する | C++23 | -| [`operator*`](basic_const_iterator/op_deref.md.nolink) | 間接参照演算子 | C++23 | -| [`operator->`](basic_const_iterator/op_arrow.md.nolink) | メンバアクセス演算子 | C++23 | +| [`operator*`](basic_const_iterator/op_deref.md) | 間接参照演算子 | C++23 | +| [`operator->`](basic_const_iterator/op_arrow.md) | メンバアクセス演算子 | C++23 | | [`operator++`](basic_const_iterator/op_increment.md.nolink) | イテレータをインクリメントする | C++23 | | [`operator--`](basic_const_iterator/op_decrement.md.nolink) | イテレータをデクリメントする | C++23 | | [`operator+=`](basic_const_iterator/op_plus_assign.md.nolink) | イテレータ自身を進める | C++23 | diff --git a/reference/iterator/basic_const_iterator/op_arrow.md b/reference/iterator/basic_const_iterator/op_arrow.md new file mode 100644 index 0000000000..19189f9733 --- /dev/null +++ b/reference/iterator/basic_const_iterator/op_arrow.md @@ -0,0 +1,74 @@ +# operator-> +* iterator[meta header] +* std[meta namespace] +* basic_const_iterator[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr const auto* operator->() const + requires is_lvalue_reference_v> && + same_as>, value_type>; +``` +* is_lvalue_reference_v[link /reference/type_traits/is_lvalue_reference.md] +* iter_reference_t[link /reference/iterator/iter_reference_t.md] +* same_as[link /reference/concepts/same_as.md] +* remove_cvref_t[link /reference/type_traits/remove_cvref.md] + +## 概要 + +イテレータを通して参照先の要素のメンバにアクセスする + +## 戻り値 + +ラップするイテレータを`current_`というメンバに保持するとして + +- `Iterator`が[`contiguous_iterator`](/reference/iterator/contiguous_iterator.md)のモデルとなる場合 + - [`to_address`](/reference/memory/to_address.md)`((current_))` +- それ以外の場合 + - [`addressof`](/reference/memory/addressof.md)`(*current_)` + +## 例 +```cpp example +#include +#include +#include + +struct S { + int n; + + void print() const { + std::cout << "call const : " << this->n << '\n'; + } + + void print() { + std::cout << "call non const : " << this->n << '\n'; + } +}; + +int main() { + std::vector vec = {S{1}, S{3}}; + + std::basic_const_iterator cit = vec.begin(); + + cit->print(); +} +``` +* cit->[color ff0000] + +### 出力 +``` +call const : 1 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 10.1 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 + +## 参照 +- [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/iterator/basic_const_iterator/op_deref.md b/reference/iterator/basic_const_iterator/op_deref.md new file mode 100644 index 0000000000..e856b9bfcc --- /dev/null +++ b/reference/iterator/basic_const_iterator/op_deref.md @@ -0,0 +1,59 @@ +# operator* +* iterator[meta header] +* std[meta namespace] +* basic_const_iterator[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr reference operator*() const; +``` + +## 概要 +イテレータを間接参照する。 + +戻り値型`reference`は、[`iter_const_reference_t`](/reference/iterator/iter_const_reference_t.md)``のエイリアス。 + +## 効果 + +ラップしているイテレータを`current_`メンバ変数に保持するとして、以下と等価 + +`return static_cast(*current_);` + +## 例 +```cpp example +#include +#include +#include + + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + std::basic_const_iterator cit = vec.begin(); + + std::cout << *cit << '\n'; + + // 要素を変更できない + //*cit = 0; +} +``` +* *cit[color ff0000] + +### 出力 +``` +1 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) From 4a6b82e1fbbf4c8e10b8fe5ed613585ed09ec201 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Fri, 28 Jul 2023 14:33:44 +0900 Subject: [PATCH 0396/3948] =?UTF-8?q?basic=5Fconst=5Fiterator::->=20:=20?= =?UTF-8?q?=E5=8F=82=E8=80=83=E3=83=AA=E3=83=B3=E3=82=AF=E3=81=A8=E3=81=8B?= =?UTF-8?q?=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/basic_const_iterator/op_arrow.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/reference/iterator/basic_const_iterator/op_arrow.md b/reference/iterator/basic_const_iterator/op_arrow.md index 19189f9733..6b4a247bd4 100644 --- a/reference/iterator/basic_const_iterator/op_arrow.md +++ b/reference/iterator/basic_const_iterator/op_arrow.md @@ -63,12 +63,13 @@ call const : 1 ## バージョン ### 言語 -- C++20 +- C++23 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 ## 参照 -- [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) From 92d89626f7c03750772c8d97b61a28e19a0a73d9 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 2 Aug 2023 12:45:03 +0900 Subject: [PATCH 0397/3948] =?UTF-8?q?basic=5Fconst=5Fiterator=20:=20++=20-?= =?UTF-8?q?-=20+=3D=20-=3D=20=E8=BF=BD=E5=8A=A0=20#1084?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/basic_const_iterator.md | 8 +- .../basic_const_iterator/op_decrement.md | 78 ++++++++++++++++++ .../basic_const_iterator/op_increment.md | 79 +++++++++++++++++++ .../basic_const_iterator/op_minus_assign.md | 63 +++++++++++++++ .../basic_const_iterator/op_plus_assign.md | 64 +++++++++++++++ 5 files changed, 288 insertions(+), 4 deletions(-) create mode 100644 reference/iterator/basic_const_iterator/op_decrement.md create mode 100644 reference/iterator/basic_const_iterator/op_increment.md create mode 100644 reference/iterator/basic_const_iterator/op_minus_assign.md create mode 100644 reference/iterator/basic_const_iterator/op_plus_assign.md diff --git a/reference/iterator/basic_const_iterator.md b/reference/iterator/basic_const_iterator.md index e914d17bae..7f5ee0d714 100644 --- a/reference/iterator/basic_const_iterator.md +++ b/reference/iterator/basic_const_iterator.md @@ -24,11 +24,11 @@ namespace std { | [`base`](basic_const_iterator/base.md) | 元のイテレータを取得する | C++23 | | [`operator*`](basic_const_iterator/op_deref.md) | 間接参照演算子 | C++23 | | [`operator->`](basic_const_iterator/op_arrow.md) | メンバアクセス演算子 | C++23 | -| [`operator++`](basic_const_iterator/op_increment.md.nolink) | イテレータをインクリメントする | C++23 | -| [`operator--`](basic_const_iterator/op_decrement.md.nolink) | イテレータをデクリメントする | C++23 | -| [`operator+=`](basic_const_iterator/op_plus_assign.md.nolink) | イテレータ自身を進める | C++23 | +| [`operator++`](basic_const_iterator/op_increment.md) | イテレータをインクリメントする | C++23 | +| [`operator--`](basic_const_iterator/op_decrement.md) | イテレータをデクリメントする | C++23 | +| [`operator+=`](basic_const_iterator/op_plus_assign.md) | イテレータ自身を進める | C++23 | | [`operator-`](basic_const_iterator/op_unary_minus.md.nolink) | イテレータを逆に進める | C++23 | -| [`operator-=`](basic_const_iterator/op_minus_assign.md.nolink) | イテレータ自身を逆に進める | C++23 | +| [`operator-=`](basic_const_iterator/op_minus_assign.md) | イテレータ自身を逆に進める | C++23 | | [`operator[]`](basic_const_iterator/op_at.md.nolink) | 任意の位置にランダムアクセスする | C++23 | | [`operator==`](basic_const_iterator/op_equal.md.nolink) | 等値比較 | C++23 | | [`operator!=`](basic_const_iterator/op_equal.md.nolink) | 非等値比較 | C++23 | diff --git a/reference/iterator/basic_const_iterator/op_decrement.md b/reference/iterator/basic_const_iterator/op_decrement.md new file mode 100644 index 0000000000..7448315d91 --- /dev/null +++ b/reference/iterator/basic_const_iterator/op_decrement.md @@ -0,0 +1,78 @@ +# operator-- +* iterator[meta header] +* std[meta namespace] +* basic_const_iterator[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr basic_const_iterator& operator--() requires bidirectional_iterator; // (1) + +constexpr basic_const_iterator operator--(int) requires bidirectional_iterator; // (2) +``` +* bidirectional_iterator[link ./bidirectional_iterator.md] + +## 概要 + +イテレータをデクリメントする。 + +- (1) : 前置デクリメント +- (2) : 後置デクリメント + +## 効果 + +ラップするイテレータを`current_`というメンバに保持するとして + +- (1) : 以下と等価 + ```cpp + --current_; + return *this; + ``` +- (2) : 以下と等価 + ```cpp + auto tmp = *this; + --*this; + return tmp; + ``` + +## 例 +```cpp example +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + std::basic_const_iterator cit = vec.end(); + + --cit; + + std::cout << *cit << '\n'; + + cit--; + + std::cout << *cit << '\n'; + +} +``` +* --ci[color ff0000] +* ci--[color ff0000] + +### 出力 +``` +5 +4 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) diff --git a/reference/iterator/basic_const_iterator/op_increment.md b/reference/iterator/basic_const_iterator/op_increment.md new file mode 100644 index 0000000000..6e70a7f50a --- /dev/null +++ b/reference/iterator/basic_const_iterator/op_increment.md @@ -0,0 +1,79 @@ +# operator++ +* iterator[meta header] +* std[meta namespace] +* basic_const_iterator[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr basic_const_iterator& operator++(); // (1) + +constexpr void operator++(int); // (2) +constexpr basic_const_iterator operator++(int) requires forward_iterator; // (3) +``` +* forward_iterator[link ./forward_iterator.md] + +## 概要 + +イテレータをインクリメントする。 + +- (1) : 前置デクリメント +- (2)(3) : 後置デクリメント + +## 効果 + +ラップするイテレータを`current_`というメンバに保持するとして + +- (1) : 以下と等価 + ```cpp + ++current_; + return *this; + ``` +- (2) : `++current_;` +- (3) : 以下と等価 + ```cpp + auto tmp = *this; + ++*this; + return tmp; + ``` + +## 例 +```cpp example +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + std::basic_const_iterator cit = vec.begin(); + + ++cit; + + std::cout << *cit << '\n'; + + cit++; + + std::cout << *cit << '\n'; +} +``` +* ++cit[color ff0000] +* cit++[color ff0000] + +### 出力 +``` +2 +3 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) diff --git a/reference/iterator/basic_const_iterator/op_minus_assign.md b/reference/iterator/basic_const_iterator/op_minus_assign.md new file mode 100644 index 0000000000..c54ef70b6f --- /dev/null +++ b/reference/iterator/basic_const_iterator/op_minus_assign.md @@ -0,0 +1,63 @@ +# operator-= +* iterator[meta header] +* std[meta namespace] +* basic_const_iterator[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr basic_const_iterator& operator-=(difference_type n) + requires random_access_iterator; +``` +* random_access_iterator[link /reference/iterator/random_access_iterator.md] + +## 概要 + +イテレータを`n`回逆に進める。 + +## 効果 + +ラップするイテレータを`current_`というメンバに保持するとして、 以下と等価 + +```cpp +current -= n; +return *this; +``` + +## 戻り値 + +`*this` + +## 例 +```cpp example +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + std::basic_const_iterator cit = vec.end(); + + cit -= 2; + + std::cout << *cit << '\n'; +} +``` + +### 出力 +``` +4 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) diff --git a/reference/iterator/basic_const_iterator/op_plus_assign.md b/reference/iterator/basic_const_iterator/op_plus_assign.md new file mode 100644 index 0000000000..a5b708b6e2 --- /dev/null +++ b/reference/iterator/basic_const_iterator/op_plus_assign.md @@ -0,0 +1,64 @@ +# operator+= +* iterator[meta header] +* std[meta namespace] +* basic_const_iterator[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr basic_const_iterator& operator+=(difference_type n) + requires random_access_iterator; +``` +* random_access_iterator[link /reference/iterator/random_access_iterator.md] + + +## 概要 + +イテレータを`n`回進める。 + +## 事前条件 + +現在のカウントの値を`length`メンバ変数に保持するとして、`n <= length` + +## 効果 + +ラップするイテレータを`current_`というメンバに保持するとして、 以下と等価 + +```cpp +current += n; +return *this; +``` + +## 例 +```cpp example +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + std::basic_const_iterator cit = vec.begin(); + + cit += 2; + + std::cout << *cit << '\n'; +} +``` + +### 出力 +``` +3 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) From ea6381e681e5e706f23d38d721cfbfc361003d24 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 2 Aug 2023 12:48:19 +0900 Subject: [PATCH 0398/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE?= =?UTF-8?q?=E9=A3=BE=E7=AD=89=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/basic_const_iterator/op_decrement.md | 6 +++--- reference/iterator/basic_const_iterator/op_increment.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/iterator/basic_const_iterator/op_decrement.md b/reference/iterator/basic_const_iterator/op_decrement.md index 7448315d91..e0e0c24dfd 100644 --- a/reference/iterator/basic_const_iterator/op_decrement.md +++ b/reference/iterator/basic_const_iterator/op_decrement.md @@ -10,7 +10,7 @@ constexpr basic_const_iterator& operator--() requires bidirectional_iterator; // (2) ``` -* bidirectional_iterator[link ./bidirectional_iterator.md] +* bidirectional_iterator[link /reference/iterator/bidirectional_iterator.md] ## 概要 @@ -55,8 +55,8 @@ int main() { } ``` -* --ci[color ff0000] -* ci--[color ff0000] +* --cit[color ff0000] +* cit--[color ff0000] ### 出力 ``` diff --git a/reference/iterator/basic_const_iterator/op_increment.md b/reference/iterator/basic_const_iterator/op_increment.md index 6e70a7f50a..635fcaf4f4 100644 --- a/reference/iterator/basic_const_iterator/op_increment.md +++ b/reference/iterator/basic_const_iterator/op_increment.md @@ -11,7 +11,7 @@ constexpr basic_const_iterator& operator++(); // (1) constexpr void operator++(int); // (2) constexpr basic_const_iterator operator++(int) requires forward_iterator; // (3) ``` -* forward_iterator[link ./forward_iterator.md] +* forward_iterator[link /reference/iterator/forward_iterator.md] ## 概要 From 4e2bdcd9d523a6f4c59fd4bdb762e19da36c8cc0 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 2 Aug 2023 13:20:43 +0900 Subject: [PATCH 0399/3948] =?UTF-8?q?=E8=A1=A8=E7=A4=BA=E3=81=AE=E8=AA=BF?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/basic_const_iterator/op_decrement.md | 1 + reference/iterator/basic_const_iterator/op_increment.md | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/reference/iterator/basic_const_iterator/op_decrement.md b/reference/iterator/basic_const_iterator/op_decrement.md index e0e0c24dfd..d53aef4f59 100644 --- a/reference/iterator/basic_const_iterator/op_decrement.md +++ b/reference/iterator/basic_const_iterator/op_decrement.md @@ -28,6 +28,7 @@ constexpr basic_const_iterator operator--(int) requires bidirectional_iterator Date: Wed, 2 Aug 2023 15:57:45 +0900 Subject: [PATCH 0400/3948] =?UTF-8?q?P2418R2=E5=AF=BE=E5=BF=9C=20:=20?= =?UTF-8?q?=E9=96=A2=E6=95=B0=E3=81=AE=E3=82=A4=E3=83=B3=E3=82=BF=E3=83=BC?= =?UTF-8?q?=E3=83=95=E3=82=A7=E3=83=BC=E3=82=B9=E3=81=A8=E4=BA=8B=E5=89=8D?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E3=81=AE=E9=83=A8=E5=88=86=E3=81=AE=E5=A4=89?= =?UTF-8?q?=E6=9B=B4=E3=81=AE=E3=81=BF=E9=81=A9=E7=94=A8=20BasicFormatter?= =?UTF-8?q?=E8=A6=81=E4=BB=B6=E3=81=B8=E3=81=AE=E5=A4=89=E6=9B=B4=E3=81=A8?= =?UTF-8?q?=E3=81=8B=E3=81=AE=E3=81=A8=E3=81=93=E3=82=8D=E3=81=AF=E6=9C=AA?= =?UTF-8?q?=E9=81=A9=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/format.md | 9 +++++---- reference/format/format_to.md | 10 ++++++---- reference/format/format_to_n.md | 11 ++++++----- reference/format/formatted_size.md | 11 ++++++----- reference/format/make_format_args.md | 5 +++-- 5 files changed, 26 insertions(+), 20 deletions(-) diff --git a/reference/format/format.md b/reference/format/format.md index 875d62741b..a8f22404de 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -8,16 +8,16 @@ ```cpp namespace std { template - string format(format_string fmt, const Args&... args); // (1) + string format(format_string fmt, Args&&... args); // (1) template - wstring format(wformat_string fmt, const Args&... args); // (2) + wstring format(wformat_string fmt, Args&&... args); // (2) template - string format(const locale& loc, format_string fmt, const Args&... args); // (3) + string format(const locale& loc, format_string fmt, Args&&... args); // (3) template - wstring format(const locale& loc, wformat_string fmt, const Args&... args); // (4) + wstring format(const locale& loc, wformat_string fmt, Args&&... args); // (4) } ``` * string[link /reference/string/basic_string.md] @@ -615,3 +615,4 @@ wstring format(const locale& loc, wformat_string fmt, const Args&... ar - [[C++] std::formatあるいは{fmt}のコンパイル時フォーマット文字列チェックの魔術 - 地面を見下ろす少年の足蹴にされる私](https://onihusube.hatenablog.com/entry/2021/07/01/195912) - [P2286R8 Formatting Ranges](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2286r8.html) - C++23から、Range・コンテナ、`pair`、`tuple`のフォーマット出力、および文字・文字列のデバッグ指定 (`"?"`) が追加された +- [P2418R2 Add support for `std::generator`-like types to `std::format`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2418r2.html) diff --git a/reference/format/format_to.md b/reference/format/format_to.md index d9f82b0c1f..03cc3bc5c8 100644 --- a/reference/format/format_to.md +++ b/reference/format/format_to.md @@ -8,16 +8,16 @@ ```cpp namespace std { template - Out format_to(Out out, format_string fmt, const Args&... args); // (1) + Out format_to(Out out, format_string fmt, Args&&... args); // (1) template - Out format_to(Out out, wformat_string fmt, const Args&... args); // (2) + Out format_to(Out out, wformat_string fmt, Args&&... args); // (2) template - Out format_to(Out out, const locale& loc, format_string fmt, const Args&... args); // (3) + Out format_to(Out out, const locale& loc, format_string fmt, Args&&... args); // (3) template - Out format_to(Out out, const locale& loc, wformat_string fmt, const Args&... args); // (4) + Out format_to(Out out, const locale& loc, wformat_string fmt, Args&&... args); // (4) } ``` * format_string[link basic_format_string.md] @@ -158,3 +158,5 @@ wstring format_to(Out out, const locale& loc, wformat_string fmt, const * [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) * [P2216R3 std::format improvements](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2216r3.html) * [[C++] std::formatあるいは{fmt}のコンパイル時フォーマット文字列チェックの魔術 - 地面を見下ろす少年の足蹴にされる私](https://onihusube.hatenablog.com/entry/2021/07/01/195912) +* [P2418R2 Add support for `std::generator`-like types to `std::format`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2418r2.html) + diff --git a/reference/format/format_to_n.md b/reference/format/format_to_n.md index 043e0b96e0..59b29c5eb8 100644 --- a/reference/format/format_to_n.md +++ b/reference/format/format_to_n.md @@ -12,14 +12,14 @@ namespace std { format_to_n(Out out, iter_difference_t n, format_string fmt, - const Args&... args); // (1) + Args&&... args); // (1) template format_to_n_result format_to_n(Out out, iter_difference_t n, wformat_string fmt, - const Args&... args); // (2) + Args&&... args); // (2) template format_to_n_result @@ -27,7 +27,7 @@ namespace std { iter_difference_t n, const locale& loc, format_string fmt, - const Args&... args); // (3) + Args&&... args); // (3) template format_to_n_result @@ -35,7 +35,7 @@ namespace std { iter_difference_t n, const locale& loc, wformat_string fmt, - const Args&... args); // (4) + Args&&... args); // (4) } ``` * format_string[link basic_format_string.md] @@ -77,7 +77,7 @@ cout << buffer; // The answer is 42. `charT`を`decltype(fmt)::value_type`として、 * `out`は`OutputIterator`を満たす型の有効なオブジェクトである。 -* `Args`のそれぞれの引数`Ti`に対応するフォーマッター`formatter`が`Formatter`要件を満たす。 +* `Args`のそれぞれの引数`Ti`に対応するフォーマッター`formatter, charT>`が`BasicFormatter`要件を満たす。 ## 戻り値 @@ -127,3 +127,4 @@ The answer is 42. * [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) * [P2216R3 std::format improvements](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2216r3.html) * [[C++] std::formatあるいは{fmt}のコンパイル時フォーマット文字列チェックの魔術 - 地面を見下ろす少年の足蹴にされる私](https://onihusube.hatenablog.com/entry/2021/07/01/195912) +* [P2418R2 Add support for `std::generator`-like types to `std::format`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2418r2.html) diff --git a/reference/format/formatted_size.md b/reference/format/formatted_size.md index ee62d3d40a..0229779fa8 100644 --- a/reference/format/formatted_size.md +++ b/reference/format/formatted_size.md @@ -8,16 +8,16 @@ ```cpp namespace std { template - size_t formatted_size(format_string fmt, const Args&... args); // (1) + size_t formatted_size(format_string fmt, Args&&... args); // (1) template - size_t formatted_size(wformat_string fmt, const Args&... args); // (2) + size_t formatted_size(wformat_string fmt, Args&&... args); // (2) template - size_t formatted_size(const locale& loc, format_string fmt, const Args&... args); // (3) + size_t formatted_size(const locale& loc, format_string fmt, Args&&... args); // (3) template - size_t formatted_size(const locale& loc, wformat_string fmt, const Args&... args); // (4) + size_t formatted_size(const locale& loc, wformat_string fmt, Args&&... args); // (4) } ``` * format_string[link basic_format_string.md] @@ -48,7 +48,7 @@ formatted_size("The answer is {}.", 42); // => 17 `charT`を`decltype(fmt)::value_type`として、 -* `Args`のそれぞれの引数`Ti`に対応するフォーマッター`formatter`が`Formatter`要件を満たす。 +* `Args`のそれぞれの引数`Ti`に対応するフォーマッター`formatter, charT>`が`BasicFormatter`要件を満たす。 ## 戻り値 @@ -94,3 +94,4 @@ int main() * [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) * [P2216R3 std::format improvements](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2216r3.html) * [[C++] std::formatあるいは{fmt}のコンパイル時フォーマット文字列チェックの魔術 - 地面を見下ろす少年の足蹴にされる私](https://onihusube.hatenablog.com/entry/2021/07/01/195912) +* [P2418R2 Add support for `std::generator`-like types to `std::format`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2418r2.html) diff --git a/reference/format/make_format_args.md b/reference/format/make_format_args.md index 211858abc3..b8b852c5c5 100644 --- a/reference/format/make_format_args.md +++ b/reference/format/make_format_args.md @@ -8,10 +8,10 @@ ```cpp namespace std { template - format_arg_store make_format_args(const Args&... args); // (1) + format_arg_store make_format_args(Args&&... args); // (1) template - format_arg_store make_wformat_args(const Args&... args); // (2) + format_arg_store make_wformat_args(Args&&... args); // (2) } ``` * format_arg_store[italic] @@ -166,3 +166,4 @@ namespace std { ## 参照 * [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) +* [P2418R2 Add support for `std::generator`-like types to `std::format`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2418r2.html) From e279f872bff98b0808beec6ee224d5c7ea009811 Mon Sep 17 00:00:00 2001 From: nishidate-yuki Date: Thu, 3 Aug 2023 01:24:54 +0900 Subject: [PATCH 0401/3948] =?UTF-8?q?=E7=94=9F=E6=88=90=E3=81=97=E3=81=9F?= =?UTF-8?q?=E4=B9=B1=E6=95=B0=E3=81=AEimplicit=20conversion=E3=82=92?= =?UTF-8?q?=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/random.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/random.md b/reference/random.md index 15257500b9..857ce52f60 100644 --- a/reference/random.md +++ b/reference/random.md @@ -170,8 +170,8 @@ int main() std::ofstream file("random.tsv"); for (size_t i = 0; i < 1000*1000; ++i) { // 各分布法に基いて乱数を生成 - double r1 = dist1(engine); - double r2 = dist2(engine); + float r1 = dist1(engine); + float r2 = dist2(engine); file << r1 << "\t" << r2 << "\n"; } From b2a86ccbe173e1fbd007d9d0ea07652815f60961 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Thu, 3 Aug 2023 14:57:44 +0900 Subject: [PATCH 0402/3948] =?UTF-8?q?basic=5Fconst=5Fiterator=20:=20[]=20-?= =?UTF-8?q?=20+=20=E8=BF=BD=E5=8A=A0=20#1084?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/basic_const_iterator.md | 11 +-- .../iterator/basic_const_iterator/op_at.md | 64 +++++++++++++ .../iterator/basic_const_iterator/op_minus.md | 93 +++++++++++++++++++ .../iterator/basic_const_iterator/op_plus.md | 74 +++++++++++++++ .../basic_const_iterator/op_unary_minus.md | 69 ++++++++++++++ 5 files changed, 305 insertions(+), 6 deletions(-) create mode 100644 reference/iterator/basic_const_iterator/op_at.md create mode 100644 reference/iterator/basic_const_iterator/op_minus.md create mode 100644 reference/iterator/basic_const_iterator/op_plus.md create mode 100644 reference/iterator/basic_const_iterator/op_unary_minus.md diff --git a/reference/iterator/basic_const_iterator.md b/reference/iterator/basic_const_iterator.md index 7f5ee0d714..1a27d9853f 100644 --- a/reference/iterator/basic_const_iterator.md +++ b/reference/iterator/basic_const_iterator.md @@ -27,9 +27,9 @@ namespace std { | [`operator++`](basic_const_iterator/op_increment.md) | イテレータをインクリメントする | C++23 | | [`operator--`](basic_const_iterator/op_decrement.md) | イテレータをデクリメントする | C++23 | | [`operator+=`](basic_const_iterator/op_plus_assign.md) | イテレータ自身を進める | C++23 | -| [`operator-`](basic_const_iterator/op_unary_minus.md.nolink) | イテレータを逆に進める | C++23 | | [`operator-=`](basic_const_iterator/op_minus_assign.md) | イテレータ自身を逆に進める | C++23 | -| [`operator[]`](basic_const_iterator/op_at.md.nolink) | 任意の位置にランダムアクセスする | C++23 | +| [`operator-`](basic_const_iterator/op_minus.md) | 2つの`basic_const_iterator`の差を求める | C++23 | +| [`operator[]`](basic_const_iterator/op_at.md) | 任意の位置にランダムアクセスする | C++23 | | [`operator==`](basic_const_iterator/op_equal.md.nolink) | 等値比較 | C++23 | | [`operator!=`](basic_const_iterator/op_equal.md.nolink) | 非等値比較 | C++23 | | [`operator<`](basic_const_iterator/op_less.md.nolink) | 左辺が右辺より小さいかの判定を行う | C++23 | @@ -37,8 +37,6 @@ namespace std { | [`operator>`](basic_const_iterator/op_greater.md.nolink) | 左辺が右辺より大きいかの判定を行う | C++23 | | [`operator>=`](basic_const_iterator/op_greater_equal.md.nolink) | 左辺が右辺以上かの判定を行う | C++23 | | [`operator<=>`](basic_const_iterator/op_compare_3way.md.nolink) | 三方比較を行う | C++23 | -| [`operator-`](basic_const_iterator/op_minus.md.nolink) | 2つの`basic_const_iterator`の差を求める | C++23 | -| [`operator+`](basic_const_iterator/op_plus.md.nolink) | イテレータを進める | C++23 | ## メンバ型 @@ -71,8 +69,9 @@ namespace std { | [`operator<=`](basic_const_iterator/op_less_equal.md.nolink) | 左辺が右辺以下かの判定を行う | C++23 | | [`operator>`](basic_const_iterator/op_greater.md.nolink) | 左辺が右辺より大きいかの判定を行う | C++23 | | [`operator>=`](basic_const_iterator/op_greater_equal.md.nolink) | 左辺が右辺以上かの判定を行う | C++23 | -| [`operator+`](basic_const_iterator/op_plus.md.nolink) | イテレータを進める | C++23 | -| [`operator-`](basic_const_iterator/op_minus.md.nolink) | 2つの`basic_const_iterator`の差を求める | C++23 | +| [`operator+`](basic_const_iterator/op_plus.md) | イテレータを進める | C++23 | +| [`operator-`](basic_const_iterator/op_unary_minus.md) | イテレータを逆に進める | C++23 | +| [`operator-`](basic_const_iterator/op_minus.md) | 2つの`basic_const_iterator`の差を求める | C++23 | | [`iter_move`](basic_const_iterator/iter_move.md.nolink) | イテレータの要素の移動 | C++23 | ## 非メンバ関数 diff --git a/reference/iterator/basic_const_iterator/op_at.md b/reference/iterator/basic_const_iterator/op_at.md new file mode 100644 index 0000000000..00f9f55a80 --- /dev/null +++ b/reference/iterator/basic_const_iterator/op_at.md @@ -0,0 +1,64 @@ +# operator[] +* iterator[meta header] +* std[meta namespace] +* basic_const_iterator[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr reference operator[](difference_type n) const + requires random_access_iterator; +``` +* random_access_iterator[link /reference/iterator/random_access_iterator.md] + +## 概要 + +任意の位置にランダムアクセスする。 + +戻り値型`reference`は、[`iter_const_reference_t`](/reference/iterator/iter_const_reference_t.md)``のエイリアス。 + +## 効果 + +ラップしているイテレータを`current_`メンバ変数に保持するとして、以下と等価 + +```cpp +return static_cast(current_[n]); +``` + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + std::basic_const_iterator cit = vec.begin(); + + std::cout << cit[2] << '\n'; + std::cout << cit[4] << '\n'; + + // 要素を変更できない + // cit[0] = 0; +} +``` + +### 出力 +``` +3 +5 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) diff --git a/reference/iterator/basic_const_iterator/op_minus.md b/reference/iterator/basic_const_iterator/op_minus.md new file mode 100644 index 0000000000..76a2945f07 --- /dev/null +++ b/reference/iterator/basic_const_iterator/op_minus.md @@ -0,0 +1,93 @@ +# operator- +* iterator[meta header] +* std[meta namespace] +* basic_const_iterator[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +template S> +constexpr difference_type operator-(const S& y) const; // (1) + +template + requires sized_sentinel_for +friend constexpr difference_type operator-(const S& x, const basic_const_iterator& y); // (2) 非メンバ関数 +``` +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] + +## 概要 + +`basic_const_iterator`の間、もしくは`Iterator`に対応する番兵との間の距離を計算する。 + +`basic_const_iterator`のオブジェクトを`i`、`Iterator`に対応する番兵型のオブジェクトを`s`とすると + +- (1) : `i - s`のためのオーバーロード +- (2) : `s - i`のためのオーバーロード + +## テンプレートパラメータ制約 + +`not-a-const-iterator`は`I`が`basic_const_iterator`の特殊化ではない場合に`true`となる説明専用のコンセプトである。 + +## 効果 + +ラップしているイテレータを`current_`メンバ変数に保持するとして + +- (1) : 以下と等価 + ```cpp + return current_ - y; + ``` + +- (2) : 以下と等価 + ```cpp + return x - y.current_; + ``` + +## 備考 + +(2)の関数は[*Hidden friends*](/article/lib/hidden_friends.md)として定義される。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + std::basic_const_iterator cit = vec.begin(); + auto se = vec.end(); + + // 元のイテレータの番兵との間で距離計算 + std::cout << (cit - se) << '\n'; + std::cout << (se - cit) << '\n'; + + std::basic_const_iterator cse = se; + + // basic_const_iterator同士で距離計算 + // (1) -> (2)と呼ばれることで内部イテレータ同士の距離計算を行う + std::cout << (cit - cse) << '\n'; + std::cout << (cse - cit) << '\n'; +} +``` + +### 出力 +``` +-5 +5 +-5 +5 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) diff --git a/reference/iterator/basic_const_iterator/op_plus.md b/reference/iterator/basic_const_iterator/op_plus.md new file mode 100644 index 0000000000..6b86486740 --- /dev/null +++ b/reference/iterator/basic_const_iterator/op_plus.md @@ -0,0 +1,74 @@ +# operator+ (非メンバ関数) +* iterator[meta header] +* std[meta namespace] +* basic_const_iterator[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +friend constexpr basic_const_iterator operator+(const basic_const_iterator& i, difference_type n) + requires random_access_iterator; // (1) + +friend constexpr basic_const_iterator operator+(difference_type n, const basic_const_iterator& i) // (2) +``` +* random_access_iterator[link /reference/iterator/random_access_iterator.md] + +## 概要 + +イテレータを`n`回進める。 + +## 効果 + +ラップしているイテレータを`current_`メンバ変数に保持するとして、以下と等価 + +```cpp +return basic_const_iterator(i.current_ + n); +``` + +## 戻り値 + +現在位置から`n`戻したイテレータのコピーを返す。 + +## 備考 + +これらの関数は全て[*Hidden friends*](/article/lib/hidden_friends.md)として定義される。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + std::basic_const_iterator cit = vec.end(); + + auto cit2 = cit + 3; + auto cit3 = 4 + cit; + + std::cout << *cit << '\n'; + std::cout << *cit2 << '\n'; + std::cout << *cit3 << '\n'; +} +``` + +### 出力 +``` +1 +4 +5 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) diff --git a/reference/iterator/basic_const_iterator/op_unary_minus.md b/reference/iterator/basic_const_iterator/op_unary_minus.md new file mode 100644 index 0000000000..5e991296db --- /dev/null +++ b/reference/iterator/basic_const_iterator/op_unary_minus.md @@ -0,0 +1,69 @@ +# operator- (非メンバ関数) +* iterator[meta header] +* std[meta namespace] +* basic_const_iterator[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +friend constexpr basic_const_iterator operator-(const basic_const_iterator& i, difference_type n) + requires random_access_iterator; +``` +* random_access_iterator[link /reference/iterator/random_access_iterator.md] + +## 概要 + +イテレータを`n`回逆に進める。 + +## 効果 + +ラップしているイテレータを`current_`メンバ変数に保持するとして、以下と等価 + +```cpp +return basic_const_iterator(i.current_ - n); +``` + +## 戻り値 + +現在位置から`n`戻したイテレータのコピーを返す。 + +## 備考 + +この関数は[*Hidden friends*](/article/lib/hidden_friends.md)として定義される。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + std::basic_const_iterator cit = vec.end(); + + auto cit2 = cit - 3; + + std::cout << *cit << '\n'; + std::cout << *cit2 << '\n'; +} +``` + +### 出力 +``` +0 +3 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) From 09c1ad78bd5be675d94afdc1e49adcaa6ff7ca4d Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Fri, 4 Aug 2023 15:07:04 +0900 Subject: [PATCH 0403/3948] =?UTF-8?q?basic=5Fconst=5Fiterator=20:=20=3D=3D?= =?UTF-8?q?=20<=3D>=E8=BF=BD=E5=8A=A0=20#1084?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/basic_const_iterator.md | 6 +- .../basic_const_iterator/op_compare_3way.md | 103 +++++++++++++++++ .../iterator/basic_const_iterator/op_equal.md | 104 ++++++++++++++++++ 3 files changed, 210 insertions(+), 3 deletions(-) create mode 100644 reference/iterator/basic_const_iterator/op_compare_3way.md create mode 100644 reference/iterator/basic_const_iterator/op_equal.md diff --git a/reference/iterator/basic_const_iterator.md b/reference/iterator/basic_const_iterator.md index 1a27d9853f..a6d62a2859 100644 --- a/reference/iterator/basic_const_iterator.md +++ b/reference/iterator/basic_const_iterator.md @@ -30,13 +30,13 @@ namespace std { | [`operator-=`](basic_const_iterator/op_minus_assign.md) | イテレータ自身を逆に進める | C++23 | | [`operator-`](basic_const_iterator/op_minus.md) | 2つの`basic_const_iterator`の差を求める | C++23 | | [`operator[]`](basic_const_iterator/op_at.md) | 任意の位置にランダムアクセスする | C++23 | -| [`operator==`](basic_const_iterator/op_equal.md.nolink) | 等値比較 | C++23 | -| [`operator!=`](basic_const_iterator/op_equal.md.nolink) | 非等値比較 | C++23 | +| [`operator==`](basic_const_iterator/op_equal.md) | 等値比較 | C++23 | +| `operator!=` | 非等値比較 ([`==`](basic_const_iterator/op_equal.md)により使用可能) | C++23 | | [`operator<`](basic_const_iterator/op_less.md.nolink) | 左辺が右辺より小さいかの判定を行う | C++23 | | [`operator<=`](basic_const_iterator/op_less_equal.md.nolink) | 左辺が右辺以下かの判定を行う | C++23 | | [`operator>`](basic_const_iterator/op_greater.md.nolink) | 左辺が右辺より大きいかの判定を行う | C++23 | | [`operator>=`](basic_const_iterator/op_greater_equal.md.nolink) | 左辺が右辺以上かの判定を行う | C++23 | -| [`operator<=>`](basic_const_iterator/op_compare_3way.md.nolink) | 三方比較を行う | C++23 | +| [`operator<=>`](basic_const_iterator/op_compare_3way.md) | 三方比較を行う | C++23 | ## メンバ型 diff --git a/reference/iterator/basic_const_iterator/op_compare_3way.md b/reference/iterator/basic_const_iterator/op_compare_3way.md new file mode 100644 index 0000000000..7ab85c95ea --- /dev/null +++ b/reference/iterator/basic_const_iterator/op_compare_3way.md @@ -0,0 +1,103 @@ +# operator<=> +* iterator[meta header] +* std[meta namespace] +* basic_const_iterator[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr auto operator<=>(const basic_const_iterator& y) const + requires random_access_iterator && three_way_comparable; // (1) + +template I> +constexpr auto operator<=>(const I& y) const + requires random_access_iterator && totally_ordered_with && + three_way_comparable_with; // (2) +``` +* different-from[link /reference/ranges/different-from.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* three_way_comparable[link /reference/compare/three_way_comparable.md] +* totally_ordered_with[link /reference/concepts/totally_ordered_with.md] + +## 概要 + + +`basic_const_iterator`オブジェクトと別のイテレータ(`basic_const_iterator`か`Iterator`、`Iterator`と比較可能なオブジェクト)の三方比較を行う。 + +- (1) : `basic_const_iterator`同士の比較を行う +- (2) : ラップしているイテレータ(`Iterator`)と直接比較可能な型との間で比較を行う + +## 効果 + +ラップするイテレータを`current_`というメンバに保持するとして + +- (1) : 以下と等価 + ```cpp + return current_ <=> y.current_; + ``` + +- (2) : 以下と等価 + ```cpp + return current_ <=> y; + ``` + +## 備考 + +(2)の演算子により以下の演算子が使用可能になる(制約は同じものが適用される)。 + +```cpp +// 逆順 +template I> +friend constexpr auto operator<=>(const I&, const basic_const_iterator&); +``` + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + std::basic_const_iterator cit = vec.begin(); + auto se = vec.end(); + std::basic_const_iterator cse = se; + + + std::cout << std::boolalpha; + + // (1) basic_const_iterator同士の比較 + std::cout << std::is_lt(cit <=> cse) << '\n'; + std::cout << std::is_lt(cse <=> cit) << '\n'; + + // (2) 元のイテレータとの比較 + std::cout << std::is_lt(cit <=> se) << '\n'; + std::cout << std::is_lt(se <=> cit) << '\n'; +} +``` +* <=>[color ff0000] +* is_lt[link /reference/compare/named_comparison_functions.md] + +### 出力 + +``` +true +false +true +false +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) diff --git a/reference/iterator/basic_const_iterator/op_equal.md b/reference/iterator/basic_const_iterator/op_equal.md new file mode 100644 index 0000000000..d9bfd98ecd --- /dev/null +++ b/reference/iterator/basic_const_iterator/op_equal.md @@ -0,0 +1,104 @@ +# operator== +* iterator[meta header] +* std[meta namespace] +* basic_const_iterator[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +template S> +constexpr bool operator==(const S& s) const; +``` +* sentinel_for[link /reference/iterator/sentinel_for.md] + +## 概要 + +`basic_const_iterator`オブジェクトと別のイテレータ(`basic_const_iterator`か`Iterator`のオブジェクト)が同じ要素を指しているかを判定する。 + +## 効果 + +ラップしているイテレータを`current_`メンバ変数に保持するとして、以下と等価 + +```cpp +return current_ == s; +``` + +## 戻り値 + +2つのイテレータが同じ要素を指している場合に`true`を返す。 + + +## 備考 + +この演算子により以下の演算子が使用可能になる。 + +```cpp +// != +template S> +constexpr bool operator!=(const S&) const; + +// 逆順 +template S> +friend constexpr bool operator==(const S&, const basic_const_iterator&); + +template S> +friend constexpr bool operator!=(const S&, const basic_const_iterator&); +``` + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + std::basic_const_iterator cit = vec.begin(); + auto se = vec.end(); + + std::cout << std::boolalpha; + + // 元のイテレータとの比較 + std::cout << (cit == se) << '\n'; + std::cout << (se == cit) << '\n'; + + std::basic_const_iterator cse = se; + + // basic_const_iterator同士の比較 + std::cout << (cit == cse) << '\n'; + std::cout << (cse == cit) << '\n'; + + // !=の導出 + std::cout << (cit != se) << '\n'; + std::cout << (se != cit) << '\n'; + std::cout << (cit != cse) << '\n'; + std::cout << (cse != cit) << '\n'; +} +``` +* ==[color ff0000] + +### 出力 +``` +false +false +false +false +true +true +true +true +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) From c925d357c6d192dd1edca8e41f620f33c4a336aa Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Fri, 4 Aug 2023 15:20:42 +0900 Subject: [PATCH 0404/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/basic_const_iterator/op_compare_3way.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/iterator/basic_const_iterator/op_compare_3way.md b/reference/iterator/basic_const_iterator/op_compare_3way.md index 7ab85c95ea..e4294b7c8c 100644 --- a/reference/iterator/basic_const_iterator/op_compare_3way.md +++ b/reference/iterator/basic_const_iterator/op_compare_3way.md @@ -17,7 +17,7 @@ constexpr auto operator<=>(const I& y) const * different-from[link /reference/ranges/different-from.md] * random_access_iterator[link /reference/iterator/random_access_iterator.md] * three_way_comparable[link /reference/compare/three_way_comparable.md] -* totally_ordered_with[link /reference/concepts/totally_ordered_with.md] +* totally_ordered_with[link /reference/concepts/totally_ordered.md] ## 概要 From 3f6f9ce56b42ae4ea17dca2ad62f354b38fda974 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 9 Aug 2023 15:10:25 +0900 Subject: [PATCH 0405/3948] =?UTF-8?q?basic=5Fconst=5Fiterator=20:=20?= =?UTF-8?q?=E6=AE=8B=E3=82=8A=E3=81=AE=E6=AF=94=E8=BC=83=E6=BC=94=E7=AE=97?= =?UTF-8?q?=E5=AD=90=E3=81=AE=E8=BF=BD=E5=8A=A0=20#1084?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/basic_const_iterator.md | 16 +-- .../basic_const_iterator/op_greater.md | 108 ++++++++++++++++++ .../basic_const_iterator/op_greater_equal.md | 108 ++++++++++++++++++ .../iterator/basic_const_iterator/op_less.md | 108 ++++++++++++++++++ .../basic_const_iterator/op_less_equal.md | 108 ++++++++++++++++++ 5 files changed, 440 insertions(+), 8 deletions(-) create mode 100644 reference/iterator/basic_const_iterator/op_greater.md create mode 100644 reference/iterator/basic_const_iterator/op_greater_equal.md create mode 100644 reference/iterator/basic_const_iterator/op_less.md create mode 100644 reference/iterator/basic_const_iterator/op_less_equal.md diff --git a/reference/iterator/basic_const_iterator.md b/reference/iterator/basic_const_iterator.md index a6d62a2859..74b56deb47 100644 --- a/reference/iterator/basic_const_iterator.md +++ b/reference/iterator/basic_const_iterator.md @@ -32,10 +32,10 @@ namespace std { | [`operator[]`](basic_const_iterator/op_at.md) | 任意の位置にランダムアクセスする | C++23 | | [`operator==`](basic_const_iterator/op_equal.md) | 等値比較 | C++23 | | `operator!=` | 非等値比較 ([`==`](basic_const_iterator/op_equal.md)により使用可能) | C++23 | -| [`operator<`](basic_const_iterator/op_less.md.nolink) | 左辺が右辺より小さいかの判定を行う | C++23 | -| [`operator<=`](basic_const_iterator/op_less_equal.md.nolink) | 左辺が右辺以下かの判定を行う | C++23 | -| [`operator>`](basic_const_iterator/op_greater.md.nolink) | 左辺が右辺より大きいかの判定を行う | C++23 | -| [`operator>=`](basic_const_iterator/op_greater_equal.md.nolink) | 左辺が右辺以上かの判定を行う | C++23 | +| [`operator<`](basic_const_iterator/op_less.md) | 左辺が右辺より小さいかの判定を行う | C++23 | +| [`operator<=`](basic_const_iterator/op_less_equal.md) | 左辺が右辺以下かの判定を行う | C++23 | +| [`operator>`](basic_const_iterator/op_greater.md) | 左辺が右辺より大きいかの判定を行う | C++23 | +| [`operator>=`](basic_const_iterator/op_greater_equal.md) | 左辺が右辺以上かの判定を行う | C++23 | | [`operator<=>`](basic_const_iterator/op_compare_3way.md) | 三方比較を行う | C++23 | @@ -65,10 +65,10 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------------------------------------------------------|-------------|-------| -| [`operator<`](basic_const_iterator/op_less.md.nolink) | 左辺が右辺より小さいかの判定を行う | C++23 | -| [`operator<=`](basic_const_iterator/op_less_equal.md.nolink) | 左辺が右辺以下かの判定を行う | C++23 | -| [`operator>`](basic_const_iterator/op_greater.md.nolink) | 左辺が右辺より大きいかの判定を行う | C++23 | -| [`operator>=`](basic_const_iterator/op_greater_equal.md.nolink) | 左辺が右辺以上かの判定を行う | C++23 | +| [`operator<`](basic_const_iterator/op_less.md) | 左辺が右辺より小さいかの判定を行う | C++23 | +| [`operator<=`](basic_const_iterator/op_less_equal.md) | 左辺が右辺以下かの判定を行う | C++23 | +| [`operator>`](basic_const_iterator/op_greater.md) | 左辺が右辺より大きいかの判定を行う | C++23 | +| [`operator>=`](basic_const_iterator/op_greater_equal.md) | 左辺が右辺以上かの判定を行う | C++23 | | [`operator+`](basic_const_iterator/op_plus.md) | イテレータを進める | C++23 | | [`operator-`](basic_const_iterator/op_unary_minus.md) | イテレータを逆に進める | C++23 | | [`operator-`](basic_const_iterator/op_minus.md) | 2つの`basic_const_iterator`の差を求める | C++23 | diff --git a/reference/iterator/basic_const_iterator/op_greater.md b/reference/iterator/basic_const_iterator/op_greater.md new file mode 100644 index 0000000000..9feb50dd98 --- /dev/null +++ b/reference/iterator/basic_const_iterator/op_greater.md @@ -0,0 +1,108 @@ +# operator> +* iterator[meta header] +* std[meta namespace] +* basic_const_iterator[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr bool operator>(const basic_const_iterator& y) const + requires random_access_iterator; // (1) + +template I> +constexpr bool operator>(const I& y) const + requires random_access_iterator && totally_ordered_with; // (2) + +template +friend constexpr bool operator>(const I& x, const basic_const_iterator& y) + requires random_access_iterator && totally_ordered_with; // (3) 非メンバ関数 +``` +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* totally_ordered_with[link /reference/concepts/totally_ordered.md] +* different-from[link /reference/ranges/different-from.md] + +## 概要 + +`basic_const_iterator`オブジェクト同士あるいは別のイテレータとの間で、左辺が右辺より大きいかを判定する。 + +- (1) : 同じ`random_access_iterator`特殊化同士の間の`>`比較 +- (2) : `Iterator`と比較可能な型の値との間の`>`比較 +- (3) : (2)の逆順の演算子 + +## テンプレートパラメータ制約 + +`not-a-const-iterator`は`I`が`basic_const_iterator`の特殊化ではない場合に`true`となる説明専用のコンセプトである。 + +## 効果 + +ラップしているイテレータを`current_`メンバ変数に保持するとして、以下と等価 + +- (1) : 以下と等価 + ```cpp + return current_ > y.current_; + ``` + +- (2) : 以下と等価 + ```cpp + return current_ > y; + ``` + +- (3) : 以下と等価 + ```cpp + return x > y.current_; + ``` + +## 備考 + +(3)の関数は[*Hidden friends*](/article/lib/hidden_friends.md)として定義される。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + std::basic_const_iterator cit = vec.begin(); + auto se = vec.end(); + std::basic_const_iterator cse = se; + + std::cout << std::boolalpha; + + // basic_const_iterator同士の比較 + std::cout << (cit > cse) << '\n'; + std::cout << (cse > cit) << '\n'; + std::cout << (cit > cit) << '\n'; + + // 元のイテレータとの比較 + std::cout << (cit > se) << '\n'; + std::cout << (se > cit) << '\n'; + std::cout << (cit > cit.base()) << '\n'; +} +``` +* >[color ff0000] + +### 出力 +``` +false +true +false +false +true +false +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) diff --git a/reference/iterator/basic_const_iterator/op_greater_equal.md b/reference/iterator/basic_const_iterator/op_greater_equal.md new file mode 100644 index 0000000000..30d4283c7c --- /dev/null +++ b/reference/iterator/basic_const_iterator/op_greater_equal.md @@ -0,0 +1,108 @@ +# operator>= +* iterator[meta header] +* std[meta namespace] +* basic_const_iterator[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr bool operator>=(const basic_const_iterator& y) const + requires random_access_iterator; // (1) + +template I> +constexpr bool operator>=(const I& y) const + requires random_access_iterator && totally_ordered_with; // (2) + +template +friend constexpr bool operator>=(const I& x, const basic_const_iterator& y) + requires random_access_iterator && totally_ordered_with; // (3) 非メンバ関数 +``` +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* totally_ordered_with[link /reference/concepts/totally_ordered.md] +* different-from[link /reference/ranges/different-from.md] + +## 概要 + +`basic_const_iterator`オブジェクト同士あるいは別のイテレータとの間で、左辺が右辺以上かを判定する。 + +- (1) : 同じ`random_access_iterator`特殊化同士の間の`>=`比較 +- (2) : `Iterator`と比較可能な型の値との間の`>=`比較 +- (3) : (2)の逆順の演算子 + +## テンプレートパラメータ制約 + +`not-a-const-iterator`は`I`が`basic_const_iterator`の特殊化ではない場合に`true`となる説明専用のコンセプトである。 + +## 効果 + +ラップしているイテレータを`current_`メンバ変数に保持するとして、以下と等価 + +- (1) : 以下と等価 + ```cpp + return current_ >= y.current_; + ``` + +- (2) : 以下と等価 + ```cpp + return current_ >= y; + ``` + +- (3) : 以下と等価 + ```cpp + return x >= y.current_; + ``` + +## 備考 + +(3)の関数は[*Hidden friends*](/article/lib/hidden_friends.md)として定義される。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + std::basic_const_iterator cit = vec.begin(); + auto se = vec.end(); + std::basic_const_iterator cse = se; + + std::cout << std::boolalpha; + + // basic_const_iterator同士の比較 + std::cout << (cit >= cse) << '\n'; + std::cout << (cse >= cit) << '\n'; + std::cout << (cit >= cit) << '\n'; + + // 元のイテレータとの比較 + std::cout << (cit >= se) << '\n'; + std::cout << (se >= cit) << '\n'; + std::cout << (cit >= cit.base()) << '\n'; +} +``` +* >=[color ff0000] + +### 出力 +``` +false +true +true +false +true +true +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) diff --git a/reference/iterator/basic_const_iterator/op_less.md b/reference/iterator/basic_const_iterator/op_less.md new file mode 100644 index 0000000000..dcc2b40091 --- /dev/null +++ b/reference/iterator/basic_const_iterator/op_less.md @@ -0,0 +1,108 @@ +# operator< +* iterator[meta header] +* std[meta namespace] +* basic_const_iterator[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr bool operator<(const basic_const_iterator& y) const + requires random_access_iterator; // (1) + +template I> +constexpr bool operator<(const I& y) const + requires random_access_iterator && totally_ordered_with; // (2) + +template +friend constexpr bool operator<(const I& x, const basic_const_iterator& y) + requires random_access_iterator && totally_ordered_with; // (3) 非メンバ関数 +``` +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* totally_ordered_with[link /reference/concepts/totally_ordered.md] +* different-from[link /reference/ranges/different-from.md] + +## 概要 + +`basic_const_iterator`オブジェクト同士あるいは別のイテレータとの間で、左辺が右辺より小さいかを判定する。 + +- (1) : 同じ`random_access_iterator`特殊化同士の間の`<`比較 +- (2) : `Iterator`と比較可能な型の値との間の`<`比較 +- (3) : (2)の逆順の演算子 + +## テンプレートパラメータ制約 + +`not-a-const-iterator`は`I`が`basic_const_iterator`の特殊化ではない場合に`true`となる説明専用のコンセプトである。 + +## 効果 + +ラップしているイテレータを`current_`メンバ変数に保持するとして、以下と等価 + +- (1) : 以下と等価 + ```cpp + return current_ < y.current_; + ``` + +- (2) : 以下と等価 + ```cpp + return current_ < y; + ``` + +- (3) : 以下と等価 + ```cpp + return x < y.current_; + ``` + +## 備考 + +(3)の関数は[*Hidden friends*](/article/lib/hidden_friends.md)として定義される。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + std::basic_const_iterator cit = vec.begin(); + auto se = vec.end(); + std::basic_const_iterator cse = se; + + std::cout << std::boolalpha; + + // basic_const_iterator同士の比較 + std::cout << (cit < cse) << '\n'; + std::cout << (cse < cit) << '\n'; + std::cout << (cit < cit) << '\n'; + + // 元のイテレータとの比較 + std::cout << (cit < se) << '\n'; + std::cout << (se < cit) << '\n'; + std::cout << (cit < cit.base()) << '\n'; +} +``` +* <[color ff0000] + +### 出力 +``` +true +false +false +true +false +false +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) diff --git a/reference/iterator/basic_const_iterator/op_less_equal.md b/reference/iterator/basic_const_iterator/op_less_equal.md new file mode 100644 index 0000000000..2dd0ba4074 --- /dev/null +++ b/reference/iterator/basic_const_iterator/op_less_equal.md @@ -0,0 +1,108 @@ +# operator<= +* iterator[meta header] +* std[meta namespace] +* basic_const_iterator[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr bool operator<=(const basic_const_iterator& y) const + requires random_access_iterator; // (1) + +template I> +constexpr bool operator<=(const I& y) const + requires random_access_iterator && totally_ordered_with; // (2) + +template +friend constexpr bool operator<=(const I& x, const basic_const_iterator& y) + requires random_access_iterator && totally_ordered_with; // (3) 非メンバ関数 +``` +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* totally_ordered_with[link /reference/concepts/totally_ordered.md] +* different-from[link /reference/ranges/different-from.md] + +## 概要 + +`basic_const_iterator`オブジェクト同士あるいは別のイテレータとの間で、、左辺が右辺以下かを判定する。 + +- (1) : 同じ`random_access_iterator`特殊化同士の間の`<=`比較 +- (2) : `Iterator`と比較可能な型の値との間の`<=`比較 +- (3) : (2)の逆順の演算子 + +## テンプレートパラメータ制約 + +`not-a-const-iterator`は`I`が`basic_const_iterator`の特殊化ではない場合に`true`となる説明専用のコンセプトである。 + +## 効果 + +ラップしているイテレータを`current_`メンバ変数に保持するとして、以下と等価 + +- (1) : 以下と等価 + ```cpp + return current_ <= y.current_; + ``` + +- (2) : 以下と等価 + ```cpp + return current_ <= y; + ``` + +- (3) : 以下と等価 + ```cpp + return x <= y.current_; + ``` + +## 備考 + +(3)の関数は[*Hidden friends*](/article/lib/hidden_friends.md)として定義される。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + std::basic_const_iterator cit = vec.begin(); + auto se = vec.end(); + std::basic_const_iterator cse = se; + + std::cout << std::boolalpha; + + // basic_const_iterator同士の比較 + std::cout << (cit <= cse) << '\n'; + std::cout << (cse <= cit) << '\n'; + std::cout << (cit <= cit) << '\n'; + + // 元のイテレータとの比較 + std::cout << (cit <= se) << '\n'; + std::cout << (se <= cit) << '\n'; + std::cout << (cit <= cit.base()) << '\n'; +} +``` +* <=[color ff0000] + +### 出力 +``` +true +false +true +true +false +true +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) From 02ed11ec6d51486dd32ddc338107c5e383d474ee Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Thu, 10 Aug 2023 15:01:10 +0900 Subject: [PATCH 0406/3948] =?UTF-8?q?basic=5Fconst=5Fiterator=20:=20iter?= =?UTF-8?q?=5Fmove=E8=BF=BD=E5=8A=A0=20#1084?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/basic_const_iterator.md | 2 +- .../basic_const_iterator/iter_move.md | 85 +++++++++++++++++++ 2 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 reference/iterator/basic_const_iterator/iter_move.md diff --git a/reference/iterator/basic_const_iterator.md b/reference/iterator/basic_const_iterator.md index 74b56deb47..1bae1a1e2e 100644 --- a/reference/iterator/basic_const_iterator.md +++ b/reference/iterator/basic_const_iterator.md @@ -72,7 +72,7 @@ namespace std { | [`operator+`](basic_const_iterator/op_plus.md) | イテレータを進める | C++23 | | [`operator-`](basic_const_iterator/op_unary_minus.md) | イテレータを逆に進める | C++23 | | [`operator-`](basic_const_iterator/op_minus.md) | 2つの`basic_const_iterator`の差を求める | C++23 | -| [`iter_move`](basic_const_iterator/iter_move.md.nolink) | イテレータの要素の移動 | C++23 | +| [`iter_move`](basic_const_iterator/iter_move.md) | イテレータの要素の移動 | C++23 | ## 非メンバ関数 diff --git a/reference/iterator/basic_const_iterator/iter_move.md b/reference/iterator/basic_const_iterator/iter_move.md new file mode 100644 index 0000000000..022a1fe645 --- /dev/null +++ b/reference/iterator/basic_const_iterator/iter_move.md @@ -0,0 +1,85 @@ +# iter_move (非メンバ関数) +* iterator[meta header] +* std[meta namespace] +* basic_const_iterator[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +friend constexpr rvalue-reference iter_move(const basic_const_iterator& i) noexcept(/*see below*/); +``` + +## 概要 + +`basic_const_iterator`である`i`の指す要素をムーブする。 + +戻り値の`rvalue-reference`は次のように求められる`const`かつ右辺値となる型である + +```cpp +using rvalue-reference = common_reference_t&&, iter_rvalue_reference_t>; +``` + +## 戻り値 + +ラップしているイテレータを`current_`メンバ変数に保持するとして、次のようになる + +```cpp +return static_cast(ranges::iter_move(i.current_)); +``` +* ranges::iter_move[link /reference/iterator/iter_move.md] + +## 例外 + +`noexcept`指定には次の式が指定される + +```cpp +noexcept(static_cast(ranges::iter_move(i.current_))) +``` + +## 備考 + +この関数は[*Hidden friends*](/article/lib/hidden_friends.md)として定義される。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + std::basic_const_iterator cit = vec.begin(); + + // ADLによる呼び出し + int n1 = iter_move(cit); + std::cout << n1 << std::endl; + + ++cit; + + // ranges::iter_move CPOによる呼び出し + int n2 = std::ranges::iter_move(cit); + std::cout << n2 << std::endl; +} +``` +* iter_move[color ff0000] +* ranges::iter_move[link /reference/iterator/iter_move.md] + +### 出力 +``` +1 +2 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) From 5ba1413f2dd58d720c5e02db52e4bfd7f2e452b4 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Thu, 10 Aug 2023 16:10:00 +0900 Subject: [PATCH 0407/3948] =?UTF-8?q?join=5Fview=20:=20common=5Frange?= =?UTF-8?q?=E3=81=A8=E3=81=AA=E3=82=8B=E6=9D=A1=E4=BB=B6=E3=81=AE=E8=BF=BD?= =?UTF-8?q?=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/join_view.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/reference/ranges/join_view.md b/reference/ranges/join_view.md index 6e92b54ac4..7e109e5707 100644 --- a/reference/ranges/join_view.md +++ b/reference/ranges/join_view.md @@ -35,7 +35,10 @@ namespace std::ranges { - (1): 外側・内側のRangeが[`forward_range`](forward_range.md)のとき - (2): 外側・内側のRangeが[`bidirectional_range`](bidirectional_range.md)のとき -- (3): 外側・内側のRangeが[`forward_range`](forward_range.md)かつ[`common_range`](common_range.md)のとき +- (3): 外側・内側のRangeが[`forward_range`](forward_range.md)かつ[`common_range`](common_range.md)であり + - `const`ではない場合、内側のRangeは参照型(*prvalue*ではない) + +外側Rangeとは`V`のことであり、内側Rangeとは`range_reference_t`のことである。`const`の場合`V`を`const V`として同様。 ## テンプレートパラメータ制約 From 396b2b645a53a32c47038621eb6a4b3042374c45 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Thu, 10 Aug 2023 16:43:43 +0900 Subject: [PATCH 0408/3948] =?UTF-8?q?make=5Fconst=5Fiterator/make=5Fconst?= =?UTF-8?q?=5Fsentinel=E8=BF=BD=E5=8A=A0=20#1023?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/basic_const_iterator.md | 4 +- reference/iterator/make_const_iterator.md | 66 ++++++++++++++++++++ reference/iterator/make_const_sentinel.md | 70 ++++++++++++++++++++++ 3 files changed, 138 insertions(+), 2 deletions(-) create mode 100644 reference/iterator/make_const_iterator.md create mode 100644 reference/iterator/make_const_sentinel.md diff --git a/reference/iterator/basic_const_iterator.md b/reference/iterator/basic_const_iterator.md index 1bae1a1e2e..8dba4ef6bb 100644 --- a/reference/iterator/basic_const_iterator.md +++ b/reference/iterator/basic_const_iterator.md @@ -78,8 +78,8 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------------------------------------------------------|-------------|-------| -| [`make_const_iterator`](make_const_iterator.md.nolink) | `basic_const_iterator`のヘルパ関数 | C++23 | -| [`make_const_sentinel`](make_const_sentinel.md.nolink) | `basic_const_iterator`のヘルパ関数 | C++23 | +| [`make_const_iterator`](make_const_iterator.md) | `basic_const_iterator`のヘルパ関数 | C++23 | +| [`make_const_sentinel`](make_const_sentinel.md) | `basic_const_iterator`のヘルパ関数 | C++23 | ## 例 diff --git a/reference/iterator/make_const_iterator.md b/reference/iterator/make_const_iterator.md new file mode 100644 index 0000000000..bcd7120e88 --- /dev/null +++ b/reference/iterator/make_const_iterator.md @@ -0,0 +1,66 @@ +# make_const_iterator +* iterator[meta header] +* std[meta namespace] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template + constexpr const_iterator make_const_iterator(I it); +} +``` +* input_iterator[link input_iterator.md] +* const_iterator[link const_iterator.md.nolink] + +## 概要 + +`basic_const_iterator`のヘルパ関数。 + +## 戻り値 +```cpp +return it; +``` + +戻り値型は必ずしも`basic_const_iterator`の特殊化になるわけではない。 + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + auto cit = std::make_const_iterator(vec.begin()); + auto cse = std::make_const_sentinel(vec.end()); + + for (auto& n : std::ranges::subrange{cit, cse}) { + std::cout << n << ", "; + // 変更できない + // n = 0; + } +} +``` +* std::make_const_iterator[color ff0000] +* make_const_sentinel[link make_const_sentinel.md] + +### 出力 +``` +1, 2, 3, 4, 5, +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) diff --git a/reference/iterator/make_const_sentinel.md b/reference/iterator/make_const_sentinel.md new file mode 100644 index 0000000000..c79805188a --- /dev/null +++ b/reference/iterator/make_const_sentinel.md @@ -0,0 +1,70 @@ +# make_const_sentinel +* iterator[meta header] +* std[meta namespace] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template + constexpr const_sentinel make_const_sentinel(S s); +} +``` +* semiregular[link semiregular.md] +* const_sentinel[link const_sentinel.md.nolink] + +## 概要 + +`basic_const_iterator`のヘルパ関数。特に、イテレータではないような番兵を`basic_const_iterator`の番兵型へと変換するのに使用する。 + +## 戻り値 + +```cpp +return s; +``` + +戻り値型は必ずしも`basic_const_iterator`の特殊化になるわけではない。 + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 11, 5, 6, 22}; + + auto cit = std::make_const_iterator(rng.begin()); + auto cse = std::make_const_sentinel(std::unreachable_sentinel); // unreachable_sentinelはイテレータではない汎用の番兵 + + auto pos = std::ranges::find_if(cit, cse, [](auto& n) { + // 述語中で誤って変更してしまうことを防止する + // n = 0; + return 10 <= n; + }); + + std::cout << *pos; +} +``` +* std::make_const_sentinel[color ff0000] +* make_const_iterator[link make_const_iterator.md] +* unreachable_sentinel[link unreachable_sentinel_t.md] + +### 出力 +``` +11 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) From e9f6f76c141d8763627e59d0d59702b45619e55c Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Thu, 10 Aug 2023 16:48:16 +0900 Subject: [PATCH 0409/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/iterator.md b/reference/iterator.md index 47b2342130..2d403b9f1b 100644 --- a/reference/iterator.md +++ b/reference/iterator.md @@ -145,8 +145,8 @@ C++20以降の標準ライブラリでは、任意のイテレータに対して | [`basic_const_iterator`](iterator/basic_const_iterator.md) | イテレータの要素を`const`化するラッパーイテレータ(class template) | C++23 | | [`const_iterator`](iterator/const_iterator.md.nolink) | 要素が`const`化されたイテレータ型を取得する (alias template) | C++23 | | [`const_sentinel`](iterator/const_sentinel.md.nolink) | 要素が`const`化された番兵型を取得する (alias template) | C++23 | -| [`make_const_iterator`](iterator/make_const_iterator.md.nolink) | `const_iterator`オブジェクトを作るヘルパ関数(function template) | C++23 | -| [`make_const_sentinel`](iterator/make_const_sentinel.md.nolink) | `const_sentinel`オブジェクトを作るヘルパ関数(function template) | C++23 | +| [`make_const_iterator`](iterator/make_const_iterator.md) | `const_iterator`オブジェクトを作るヘルパ関数(function template) | C++23 | +| [`make_const_sentinel`](iterator/make_const_sentinel.md) | `const_sentinel`オブジェクトを作るヘルパ関数(function template) | C++23 | ## その他のイテレータアダプタ From ebae6b70f005143b4edd3d6003270bf4c2f2328a Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Thu, 10 Aug 2023 16:49:19 +0900 Subject: [PATCH 0410/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/make_const_sentinel.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/iterator/make_const_sentinel.md b/reference/iterator/make_const_sentinel.md index c79805188a..c7f4bddb6f 100644 --- a/reference/iterator/make_const_sentinel.md +++ b/reference/iterator/make_const_sentinel.md @@ -10,7 +10,7 @@ namespace std { constexpr const_sentinel make_const_sentinel(S s); } ``` -* semiregular[link semiregular.md] +* semiregular[link /reference/concepts/semiregular.md] * const_sentinel[link const_sentinel.md.nolink] ## 概要 From a16938b2890659af7e9b366593229419685da7bb Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Fri, 11 Aug 2023 13:28:15 +0900 Subject: [PATCH 0411/3948] =?UTF-8?q?const=5Fiterator=E8=BF=BD=E5=8A=A0=20?= =?UTF-8?q?#1084?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/exposition-only.md | 2 +- reference/iterator.md | 2 +- reference/iterator/const_iterator.md | 55 +++++++++++++++++++++++++ reference/iterator/constant-iterator.md | 29 +++++++++++++ 4 files changed, 86 insertions(+), 2 deletions(-) create mode 100644 reference/iterator/const_iterator.md create mode 100644 reference/iterator/constant-iterator.md diff --git a/reference/exposition-only.md b/reference/exposition-only.md index c345766e3f..003ffcbfa2 100644 --- a/reference/exposition-only.md +++ b/reference/exposition-only.md @@ -26,7 +26,7 @@ | [`dereferenceable`](iterator/dereferenceable.md) | 単純な間接参照が可能 (concept) | C++20 | | [`is-integer-like`](iterator/is_integer_like.md) | 符号付整数型と同等の型か否かを表す (variable template) | C++20 | | [`is-signed-integer-like`](iterator/is_integer_like.md) | 符号なし整数型と同等の型か否かを表す (variable template) | C++20 | -| [`constant-iterator ](iterator/iconstant_iterator.md.nolink) | 要素不変なイテレータ (concept) | C++23 | +| [`constant-iterator` ](iterator/constant-iterator.md) | 要素不変なイテレータ (concept) | C++23 | ## `` diff --git a/reference/iterator.md b/reference/iterator.md index 2d403b9f1b..e1692f44cc 100644 --- a/reference/iterator.md +++ b/reference/iterator.md @@ -143,7 +143,7 @@ C++20以降の標準ライブラリでは、任意のイテレータに対して | 名前 | 説明 | 対応バージョン | |----------------------------------------------------|------------------------------------------|-------| | [`basic_const_iterator`](iterator/basic_const_iterator.md) | イテレータの要素を`const`化するラッパーイテレータ(class template) | C++23 | -| [`const_iterator`](iterator/const_iterator.md.nolink) | 要素が`const`化されたイテレータ型を取得する (alias template) | C++23 | +| [`const_iterator`](iterator/const_iterator.md) | 要素が`const`化されたイテレータ型を取得する (alias template) | C++23 | | [`const_sentinel`](iterator/const_sentinel.md.nolink) | 要素が`const`化された番兵型を取得する (alias template) | C++23 | | [`make_const_iterator`](iterator/make_const_iterator.md) | `const_iterator`オブジェクトを作るヘルパ関数(function template) | C++23 | | [`make_const_sentinel`](iterator/make_const_sentinel.md) | `const_sentinel`オブジェクトを作るヘルパ関数(function template) | C++23 | diff --git a/reference/iterator/const_iterator.md b/reference/iterator/const_iterator.md new file mode 100644 index 0000000000..2aca4c4d6d --- /dev/null +++ b/reference/iterator/const_iterator.md @@ -0,0 +1,55 @@ +# const_iterator +* iterator[meta header] +* std[meta namespace] +* type-alias[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template + using const_iterator = /*see below*?; +} +``` +* input_iterator[link input_iterator.md] + +## 概要 + +任意のイテレータ型`I`を、定数イテレータ型へ変換する。 + +## 効果 + +- `I`が[`constant-iterator`]のモデルとなる場合 : `I` +- それ以外の場合 : [`basic_const_iterator`](basic_const_iterator.md)`` + +## 例 +```cpp example +#include + +int main() { + static_assert(std::same_as, std::basic_const_iterator>); + static_assert(std::same_as, const int*>); + + using vec_iter = std::vector::iterator; + + static_assert(std::same_as, std::basic_const_iterator>); + static_assert(std::same_as>, std::const_iterator>); +} +``` +* std::const_iterator[color ff0000] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) diff --git a/reference/iterator/constant-iterator.md b/reference/iterator/constant-iterator.md new file mode 100644 index 0000000000..63462148ad --- /dev/null +++ b/reference/iterator/constant-iterator.md @@ -0,0 +1,29 @@ +# constant-iterator +* iterator[meta header] +* std[meta namespace] +* concept[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template + concept constant-iterator = + input_iterator && same_as, iter_reference_t>; +} +``` +* input_or_output_iterator[link /reference/iterator/input_or_output_iterator.md] +* same_as[link /reference/concepts/same_as.md] +* iter_const_reference_t[link /reference/iterator/iter_const_reference_t.md] +* iter_reference_t[link /reference/iterator/iter_reference_t.md] + +## 概要 + +`constant-iterator`はイテレータ型`It`が定数イテレータであることを表す説明専用のコンセプトである。定数イテレータは、間接参照を通してその要素を変更することができない。 + +## バージョン +### 言語 +- C++23 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) From f2f8993721e5d0bba28ed266f52008a72fe6c862 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Fri, 11 Aug 2023 13:35:35 +0900 Subject: [PATCH 0412/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE?= =?UTF-8?q?=E9=A3=BE=E3=81=A8=E3=83=AA=E3=83=B3=E3=82=AF=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/constant-iterator.md | 2 +- reference/iterator/make_const_iterator.md | 2 +- reference/span/span.md | 4 ++-- reference/span/span/cbegin.md | 2 +- reference/span/span/cend.md | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/reference/iterator/constant-iterator.md b/reference/iterator/constant-iterator.md index 63462148ad..059ae0ca23 100644 --- a/reference/iterator/constant-iterator.md +++ b/reference/iterator/constant-iterator.md @@ -11,7 +11,7 @@ namespace std { input_iterator && same_as, iter_reference_t>; } ``` -* input_or_output_iterator[link /reference/iterator/input_or_output_iterator.md] +* input_iterator[link /reference/iterator/input_iterator.md] * same_as[link /reference/concepts/same_as.md] * iter_const_reference_t[link /reference/iterator/iter_const_reference_t.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] diff --git a/reference/iterator/make_const_iterator.md b/reference/iterator/make_const_iterator.md index bcd7120e88..2660d8b43a 100644 --- a/reference/iterator/make_const_iterator.md +++ b/reference/iterator/make_const_iterator.md @@ -11,7 +11,7 @@ namespace std { } ``` * input_iterator[link input_iterator.md] -* const_iterator[link const_iterator.md.nolink] +* const_iterator[link const_iterator.md] ## 概要 diff --git a/reference/span/span.md b/reference/span/span.md index c5db6e60cd..d42ee04f75 100644 --- a/reference/span/span.md +++ b/reference/span/span.md @@ -133,8 +133,8 @@ namespace std { | `const_reference` | `const`参照型 `const element_type&` | C++20 | | `iterator` | 実装定義のイテレータ型。[`contiguous_iterator`](/reference/iterator/contiguous_iterator.md)、[`random_access_iterator`](/reference/iterator/random_access_iterator.md)、constexprイテレータのモデルであり、コンテナのイテレータに対するすべての要件を満たす | C++20 | | `reverse_iterator` | 逆順イテレータ [`reverse_iterator`](/reference/iterator/reverse_iterator.md)`` | C++20 | -| `const_iterator` | 読み取り専用イテレータ [`std::const_iterator`](/reference/iterator/const_iterator.md.nolink)`` | C++23 | -| `const_reverse_iterator` | 読み取り専用逆イテレータ [`std::const_iterator`](/reference/iterator/const_iterator.md.nolink)`` | C++23 | +| `const_iterator` | 読み取り専用イテレータ [`std::const_iterator`](/reference/iterator/const_iterator.md)`` | C++23 | +| `const_reverse_iterator` | 読み取り専用逆イテレータ [`std::const_iterator`](/reference/iterator/const_iterator.md)`` | C++23 | ## 非メンバ関数 diff --git a/reference/span/span/cbegin.md b/reference/span/span/cbegin.md index 825467f3c3..c9fb1fa9b6 100644 --- a/reference/span/span/cbegin.md +++ b/reference/span/span/cbegin.md @@ -8,7 +8,7 @@ ```cpp constexpr const_iterator cbegin() const noexcept; ``` -* const_iterator[link /reference/iterator/const_iterator.md.nolink] +* const_iterator[link /reference/iterator/const_iterator.md] ## 概要 先頭要素を指す読み取り専用イテレータを取得する。 diff --git a/reference/span/span/cend.md b/reference/span/span/cend.md index 3ea396854e..75ce8d1373 100644 --- a/reference/span/span/cend.md +++ b/reference/span/span/cend.md @@ -8,7 +8,7 @@ ```cpp constexpr const_iterator cend() const noexcept; ``` -* const_iterator[link /reference/iterator/const_iterator.md.nolink] +* const_iterator[link /reference/iterator/const_iterator.md] ## 概要 末尾要素の次を指すイテレータを取得する。 From 00bb047d8c8ba716b8df149d4d48e9d8c5719c87 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Fri, 11 Aug 2023 13:43:26 +0900 Subject: [PATCH 0413/3948] =?UTF-8?q?const=5Fiterator=20:=20=E3=83=AA?= =?UTF-8?q?=E3=83=B3=E3=82=AF=E5=BF=98=E3=82=8C=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/const_iterator.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/iterator/const_iterator.md b/reference/iterator/const_iterator.md index 2aca4c4d6d..d88d0c17b7 100644 --- a/reference/iterator/const_iterator.md +++ b/reference/iterator/const_iterator.md @@ -18,7 +18,7 @@ namespace std { ## 効果 -- `I`が[`constant-iterator`]のモデルとなる場合 : `I` +- `I`が[`constant-iterator`](constant-iterator.md)のモデルとなる場合 : `I` - それ以外の場合 : [`basic_const_iterator`](basic_const_iterator.md)`` ## 例 From 0c072b9d3b702aad4920422e2fbb042c2e291019 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 16 Aug 2023 19:56:10 +0900 Subject: [PATCH 0414/3948] =?UTF-8?q?flat=5Fmap=20:=20insert=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20#1078?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 2 + reference/flat_map.md | 4 +- reference/flat_map/flat_map.md | 3 +- reference/flat_map/flat_map/at.md | 2 +- reference/flat_map/flat_map/emplace.md | 2 +- reference/flat_map/flat_map/emplace_hint.md | 2 +- reference/flat_map/flat_map/empty.md | 2 +- reference/flat_map/flat_map/erase.md | 2 +- reference/flat_map/flat_map/insert.md | 303 ++++++++++++++++++++ reference/flat_map/flat_map/key_equiv.md | 32 +++ reference/flat_map/flat_map/op_at.md | 2 +- reference/flat_map/flat_map/size.md | 2 +- reference/flat_map/flat_map/try_emplace.md | 4 +- reference/flat_map/sorted_unique_t.md | 66 +++++ reference/map/map/insert.md | 4 +- reference/map/multimap/insert.md | 2 +- 16 files changed, 420 insertions(+), 14 deletions(-) create mode 100644 reference/flat_map/flat_map/insert.md create mode 100644 reference/flat_map/flat_map/key_equiv.md create mode 100644 reference/flat_map/sorted_unique_t.md diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 247d1a223a..e0b435e15e 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -107,6 +107,8 @@ * [link /reference/generator.md] * [link /reference/initializer_list.md] * std::initializer_list[link /reference/initializer_list/initializer_list.md] + * il.begin()[link /reference/initializer_list/initializer_list/begin.md] + * il.end()[link /reference/initializer_list/initializer_list/end.md] * [link /reference/iomanip.md] * [link /reference/ios.md] * std::boolalpha[link /reference/ios/boolalpha.md] diff --git a/reference/flat_map.md b/reference/flat_map.md index 7523236c44..1442c31cf1 100644 --- a/reference/flat_map.md +++ b/reference/flat_map.md @@ -17,7 +17,9 @@ | 名前 | 説明 | 対応バージョン | |----------------------------------------------|--------------------------------------------------------|-------| | [`flat_map`](flat_map/flat_map.md) | キーの重複を許さない平坦な順序付き連想コンテナ(class template) | C++23 | -| [`flat_multimap`](flat_map/flat_multimap.md.nolink) | キーの重複を許す平坦な順序付き連想コンテナ(class template) | C++23 | +| [`flat_multimap`](flat_map/flat_multimap.md.nolink) | キーの重複を許す平坦な順序付き連想コンテナ(class template) | C++23 | +| [`sorted_unique_t`](flat_map/sorted_unique_t.md) | ソート済みかつ重複要素がないことを示すためのタグ型(class) | C++23 | +| [`sorted_unique`](flat_map/sorted_unique_t.md) | ソート済みかつ重複要素がないことを示すためのタグ値(variable) | C++23 | ## バージョン diff --git a/reference/flat_map/flat_map.md b/reference/flat_map/flat_map.md index 498606679e..53e8f472eb 100644 --- a/reference/flat_map/flat_map.md +++ b/reference/flat_map/flat_map.md @@ -58,7 +58,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |-----------------------------------------------|--------------------------------------------|----------------| | [`clear`](flat_map/clear.md) | 全ての要素を削除する | C++23 | -| [`insert`](flat_map/insert.md.nolink) | 要素を挿入する | C++23 | +| [`insert`](flat_map/insert.md) | 要素を挿入する | C++23 | | [`insert_or_assign`](flat_map/insert_or_assign.md.nolink) | 要素を挿入、あるいは代入する | C++23 | | [`insert_range`](flat_map/insert_range.md.nolink) | Rangeを挿入する | C++23 | | [`emplace`](flat_map/emplace.md) | 要素を直接構築する | C++23 | @@ -113,6 +113,7 @@ namespace std { | `key_container_type` | キーを格納するコンテナ型 `KeyContainer` | C++23 | | `mapped_container_type` | 値を格納するコンテナ型 `MappedContainer` | C++23 | | [`containers`](flat_map/containers.md) | キーのコンテナと値のコンテナを保持する型 | C++23 | +| [`key_equiv`](flat_map/key_equiv.md) | 要素をとってキーの等価比較を行う説明専用の関数オブジェクト | C++23 | ## 非メンバ関数 diff --git a/reference/flat_map/flat_map/at.md b/reference/flat_map/flat_map/at.md index 00317087d5..17933b15bb 100644 --- a/reference/flat_map/flat_map/at.md +++ b/reference/flat_map/flat_map/at.md @@ -74,7 +74,7 @@ int main() } ``` * c.at[color ff0000] -* fm.insert[link insert.md.nolink] +* fm.insert[link insert.md] * std::out_of_range[link /reference/stdexcept.md] ### 出力 diff --git a/reference/flat_map/flat_map/emplace.md b/reference/flat_map/flat_map/emplace.md index b87c0a2030..28a7e713d7 100644 --- a/reference/flat_map/flat_map/emplace.md +++ b/reference/flat_map/flat_map/emplace.md @@ -132,7 +132,7 @@ CCC : (1, 2) | 名前 | 説明 | |------------------------------------------------|--------------------------------------------| -| [`flat_map::insert`](insert.md.nolink) | 要素を挿入する | +| [`flat_map::insert`](insert.md) | 要素を挿入する | | [`flat_map::insert_or_assign`](insert_or_assign.md.nolink) | 要素を挿入、あるいは代入する | | [`flat_map::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | | [`flat_map::try_emplace`](try_emplace.md) | キーが存在しない場合のみ要素を直接構築する | diff --git a/reference/flat_map/flat_map/emplace_hint.md b/reference/flat_map/flat_map/emplace_hint.md index 7a016946ba..a667e951cf 100644 --- a/reference/flat_map/flat_map/emplace_hint.md +++ b/reference/flat_map/flat_map/emplace_hint.md @@ -75,7 +75,7 @@ int main() | 名前 | 説明 | |------------------------------------------------|--------------------------------------------| -| [`flat_map::insert`](insert.md.nolink) | 要素を挿入する | +| [`flat_map::insert`](insert.md) | 要素を挿入する | | [`flat_map::insert_or_assign`](insert_or_assign.md.nolink) | 要素を挿入、あるいは代入する | | [`flat_map::emplace`](emplace.md) | 要素を直接構築する | | [`flat_map::try_emplace`](try_emplace.md) | キーが存在しない場合のみ要素を直接構築する | diff --git a/reference/flat_map/flat_map/empty.md b/reference/flat_map/flat_map/empty.md index 610139592c..74651c9352 100644 --- a/reference/flat_map/flat_map/empty.md +++ b/reference/flat_map/flat_map/empty.md @@ -41,7 +41,7 @@ int main () } ``` * empty()[color ff0000] -* fm.insert[link insert.md.nolink] +* fm.insert[link insert.md] ### 出力 ``` diff --git a/reference/flat_map/flat_map/erase.md b/reference/flat_map/flat_map/erase.md index 9c39eed049..263666493b 100644 --- a/reference/flat_map/flat_map/erase.md +++ b/reference/flat_map/flat_map/erase.md @@ -141,6 +141,6 @@ int main() | 名前 | 説明 | |---------------------------------|----------------------| | [`flat_map::clear`](clear.md) | 全ての要素を削除する | -| [`flat_map::insert`](insert.md.nolink) | 要素を挿入する | +| [`flat_map::insert`](insert.md) | 要素を挿入する | | [`flat_map::find`](find.md) | 指定したキーで要素を探す | diff --git a/reference/flat_map/flat_map/insert.md b/reference/flat_map/flat_map/insert.md new file mode 100644 index 0000000000..d3c7e9001b --- /dev/null +++ b/reference/flat_map/flat_map/insert.md @@ -0,0 +1,303 @@ +# insert +* flat_map[meta header] +* std[meta namespace] +* flat_map[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +pair insert(const value_type& x); // (1) C++23 +pair insert(value_type&& x); // (2) C++23 + +iterator insert(const_iterator position, + const value_type& x); // (3) C++23 +iterator insert(const_iterator position, + value_type&& x); // (4) C++23 + +template +pair insert(P&& x); // (5) C++23 + +template +iterator insert(const_iterator position, + P&&); // (6) C++23 + +template +void insert(InputIterator first, + InputIterator last); // (7) C++23 + +template +void insert(sorted_unique_t, + InputIterator first, + InputIterator last); // (8) C++23 + +template R> +void insert_range(R&& rg); // (9) C++23 + +void insert(initializer_list il); // (10) C++23 + +void insert(sorted_unique_t s, + initializer_list il); // (11) C++23 +``` +* pair[link /reference/utility/pair.md] +* initializer_list[link /reference/initializer_list/initializer_list.md] +* sorted_unique_t[link ] + +## 概要 +新しく一つの要素(引数 `x`, `y`を使う)または要素のシーケンス(入力イテレータまたは `initializer_list` を使う)を挿入し、コンテナを拡張する。 + +これは、挿入された要素の数だけコンテナの [`size()`](size.md) を増やす。 + +`flat_map` コンテナは重複したキーを持つ要素を許さないため、挿入操作はそれぞれの要素が他のコンテナ内の既存要素と同じキーかどうかをチェックする。もし同じであれば要素は挿入されず、戻り値を持つ関数の場合はそれへのイテレータなどを返す。 + +重複した値を許す、類似したコンテナについては `flat_multimap` を参照。 + +内部的に `flat_map` コンテナは、コンストラクト時に指定された比較オブジェクトによって要素を下位から上位へとソートして保持する。 + +この操作は、適切な引数 `position` を提供することで効率を飛躍的に改善することができる。 + +- (1) : 単一要素を挿入する +- (2) : 単一要素の一時オブジェクトを挿入する +- (3) : 指定された位置に、単一要素を挿入する +- (4) : 指定された位置に、単一要素の一時オブジェクトを挿入する +- (5) : 単一要素として要素型`value_type`のコンストラクタ引数を受け取って挿入する +- (6) : 指定された位置に、要素型`value_type`のコンストラクタ引数を受け取って挿入する +- (7) : イテレータ範囲`[first, last)`を挿入する +- (8) : ソート済みかつ重複要素のないイテレータ範囲`[first, last)`を挿入する +- (9) : Rangeを挿入する +- (10) : 初期化子リストを挿入する +- (11) : ソート済みかつ重複要素のない初期化子リストを挿入する + + +## 要件 +- (5), (6) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)`<`[`pair`](/reference/utility/pair.md)`, P>`が`true`であること + + +## 効果 +- (1) : + ```cpp + return emplace(x); + ``` + * emplace[link emplace.md] + +- (2) : + ```cpp + return emplace(std::move(x)); + ``` + * emplace[link emplace.md] + * move[link /reference/utility/move.md] + +- (3) : + ```cpp + return emplace_hint(position, x); + ``` + * emplace_hint[link emplace_hint.md] + +- (4) : + ```cpp + return emplace_hint(position, std::move(x)); + ``` + * emplace_hint[link emplace_hint.md] + * move[link /reference/utility/move.md] + +- (5) : 以下と等価: + ```cpp + return emplace(std::forward

(x)); + ``` + * emplace[link emplace.md] + * forward[link /reference/utility/forward.md] + +- (6) : 以下と等価: + ```cpp + return emplace_hint(position, std::forward

(x));. + ``` + * emplace_hint[link emplace_hint.md] + * forward[link /reference/utility/forward.md] + +- (7) : メンバ変数として保持しているコンテナ`c`に、以下のように挿入する: + ```cpp + for (; first != last; ++first) { + value_type value = *first; + c.keys.insert(c.keys.end(), std::move(value.first)); + c.values.insert(c.values.end(), std::move(value.second)); + } + ``` + * c.keys[link containers.md] + * c.values[link containers.md] + * end()[link /reference/vector/vector/end.md] + * insert[link /reference/vector/vector/insert.md] + * std::move[link /reference/utility/move.md] + * first[link /reference/utility/pair.md] + * second[link /reference/utility/pair.md] + + - 次に、新しく挿入された要素の範囲を`value_comp()`を基準にソートする + - 次に、ソートされた結果の範囲と、既存の要素のソートされた範囲をひとつのソートされた範囲にマージする + - 最後に、重複する要素を以下のように削除する: + + ```cpp + auto zv = ranges::zip_view(c.keys, c.values); + auto it = ranges::unique(zv, key_equiv(compare)).begin(); + auto dist = distance(zv.begin(), it); + c.keys.erase(c.keys.begin() + dist, c.keys.end()); + c.values.erase(c.values.begin() + dist, c.values.end()); + ``` + * c.keys[link containers.md] + * c.values[link containers.md] + * ranges::zip_view[link /ranges/zip_view.md.nolink] + * ranges::unique[link /reference/algorithm/ranges_unique.md] + * key_equiv[link key_equiv.md] + * distance[link /reference/iterator/distance.md] + +- (8) : メンバ変数として保持しているコンテナ`c`に、以下のように挿入する: + ```cpp + for (; first != last; ++first) { + value_type value = *first; + c.keys.insert(c.keys.end(), std::move(value.first)); + c.values.insert(c.values.end(), std::move(value.second)); + } + ``` + * c.keys[link containers.md] + * c.values[link containers.md] + * end()[link /reference/vector/vector/end.md] + * insert[link /reference/vector/vector/insert.md] + * std::move[link /reference/utility/move.md] + * first[link /reference/utility/pair.md] + * second[link /reference/utility/pair.md] + + - 次に、ソートされた結果の範囲と、既存の要素のソートされた範囲をひとつのソートされた範囲にマージする + - 最後に、重複する要素を以下のように削除する: + + ```cpp + auto zv = ranges::zip_view(c.keys, c.values); + auto it = ranges::unique(zv, key_equiv(compare)).begin(); + auto dist = distance(zv.begin(), it); + c.keys.erase(c.keys.begin() + dist, c.keys.end()); + c.values.erase(c.values.begin() + dist, c.values.end()); + ``` + * c.keys[link containers.md] + * c.values[link containers.md] + * ranges::zip_view[link /ranges/zip_view.md.nolink] + * ranges::unique[link /reference/algorithm/ranges_unique.md] + * key_equiv[link key_equiv.md] + * distance[link /reference/iterator/distance.md] + +- (9) : メンバ変数として保持しているコンテナ`c`に、以下のように挿入する: + ```cpp + for (const auto& e : rg) { + c.keys.insert(c.keys.end(), e.first); + c.values.insert(c.values.end(), e.second); + } + ``` + * c.keys[link containers.md] + * c.values[link containers.md] + * end()[link /reference/vector/vector/end.md] + * insert[link /reference/vector/vector/insert.md] + * first[link /reference/utility/pair.md] + * second[link /reference/utility/pair.md] + + - 次に、新しく挿入された要素の範囲を`value_comp()`を基準にソートする + - 次に、ソートされた結果の範囲と、既存の要素のソートされた範囲をひとつのソートされた範囲にマージする + - 最後に、重複する要素を以下のように削除する: + + ```cpp + auto zv = ranges::zip_view(c.keys, c.values); + auto it = ranges::unique(zv, key_equiv(compare)).begin(); + auto dist = distance(zv.begin(), it); + c.keys.erase(c.keys.begin() + dist, c.keys.end()); + c.values.erase(c.values.begin() + dist, c.values.end()); + ``` + * c.keys[link containers.md] + * c.values[link containers.md] + * ranges::zip_view[link /ranges/zip_view.md.nolink] + * ranges::unique[link /reference/algorithm/ranges_unique.md] + * key_equiv[link key_equiv.md] + * distance[link /reference/iterator/distance.md] + +- (10) : + ```cpp + insert(il.begin(), il.end()); + ``` + +- (11) : + ```cpp + insert(s, il.begin(), il.end()); + ``` + + +## 戻り値 +- (1), (2), (5) : 戻り値としては、イテレータと`bool`値の組を返す。 + - 挿入された場合には、`first` に挿入された要素へのイテレータ、 `second` に `true` が設定される。 + - 挿入されなかった場合には、 `first` に `x` と等価のキーを持つ要素へのイテレータ、 `second` に `false` が設定される。 +- (3), (4), (6) : + - 挿入された場合には、新しく挿入された要素を指すイテレータを返す。 + - 挿入されなかった場合には、`x`のキーと等価のキーを持つ要素へのイテレータを返す。 +- (7), (8), (9), (10), (11) : なし + + +## 計算量 +- (7) : Nをこの操作の前の[`size()`](size.md)、Mを[`distance`](/reference/iterator/distance.md)`(first, last)`として、N + MlogM +- (7) : Nをこの操作のあとの[`size()`](size.md)として、Nに対して線形 +- (8) : Nをこの操作の前の[`size()`](size.md)、Mを[`ranges::distance`](/reference/iterator/ranges_distance.md)`(rg)`として、N + MlogM + + +## 備考 +- (7), (8), (9) : この操作はインプレース・マージを行うため、追加のメモリ確保を行う可能性がある + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_map fm; + + // 単一要素を挿入する + fm.insert(std::pair{3, 'a'}); + fm.insert({3, 'a'}); + + std::flat_map fm2 = { + {5, 'd'}, + {15, 'e'} + }; + + // シーケンスを挿入する + fm.insert(fm2); + fm.insert(fm2.begin(), fm2.end()); + + // 挿入するシーケンスがソート済みかつ重複要素がないことがわかっている場合、 + // 以下のように指定した方が高速になる + fm.insert(std::sorted_unique, fm2.begin(), fm2.end()); + + for (const auto& [key, value] : fm) { + std::cout << key << " : " << value << std::endl; + } +} +``` +* begin()[link begin.md] +* end()[link end.md] +* std::sorted_unique[link /reference/flat_map/sorted_unique_t.md] + +### 出力 +``` +3 : a +5 : d +15 : e +``` + +## バージョン +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|------------------------------------------------|--------------------------------------------| +| [`flat_map::insert_or_assign`](insert_or_assign.md.nolink) | 要素を挿入、あるいは代入する | +| [`flat_map::emplace`](emplace.md) | 要素を直接構築する | +| [`flat_map::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | +| [`flat_map::try_emplace`](try_emplace.md) | キーが存在しない場合のみ要素を直接構築する | + diff --git a/reference/flat_map/flat_map/key_equiv.md b/reference/flat_map/flat_map/key_equiv.md new file mode 100644 index 0000000000..5e4e771f24 --- /dev/null +++ b/reference/flat_map/flat_map/key_equiv.md @@ -0,0 +1,32 @@ +# key_equiv +* flat_map[meta header] +* std[meta namespace] +* flat_map[meta class] +* class[meta id-type] +* cpp23[meta cpp] + +```cpp +struct key_equiv { + key_equiv(key_compare c) : comp(c) { } + + bool operator()(const_reference x, const_reference y) const { + return !comp(x.first, y.first) && !comp(y.first, x.first); + } + + key_compare comp; +}; +``` + +## 概要 +要素をとってキーの等価比較を行う説明専用の関数オブジェクト。 + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + diff --git a/reference/flat_map/flat_map/op_at.md b/reference/flat_map/flat_map/op_at.md index 113fb30e2a..a2400349c4 100644 --- a/reference/flat_map/flat_map/op_at.md +++ b/reference/flat_map/flat_map/op_at.md @@ -77,7 +77,7 @@ int main() ``` * fm[1][color ff0000] * fm[2][color ff0000] -* fm.insert[link insert.md.nolink] +* fm.insert[link insert.md] ### 出力 ``` diff --git a/reference/flat_map/flat_map/size.md b/reference/flat_map/flat_map/size.md index 580aa8b4ad..328270899d 100644 --- a/reference/flat_map/flat_map/size.md +++ b/reference/flat_map/flat_map/size.md @@ -46,7 +46,7 @@ int main () } ``` * size()[color ff0000] -* fm.insert[link insert.md.nolink] +* fm.insert[link insert.md] ### 出力 ``` diff --git a/reference/flat_map/flat_map/try_emplace.md b/reference/flat_map/flat_map/try_emplace.md index 5a5d8c721a..dea4790f43 100644 --- a/reference/flat_map/flat_map/try_emplace.md +++ b/reference/flat_map/flat_map/try_emplace.md @@ -123,7 +123,7 @@ iterator ## 備考 - 概要に記載されているように、本メンバ関数は指定されたキーと等価の要素が既に存在する場合には、引数に副作用が発生しない。 - 一方、[`emplace`](emplace.md)、[`emplace_hint`](emplace_hint.md)、[`insert`](insert.md.nolink) にはそのような規定は無く、挿入がされなかった場合でも引数に副作用(引数からのムーブ)が発生してしまう可能性があるため、注意が必要である。 + 一方、[`emplace`](emplace.md)、[`emplace_hint`](emplace_hint.md)、[`insert`](insert.md) にはそのような規定は無く、挿入がされなかった場合でも引数に副作用(引数からのムーブ)が発生してしまう可能性があるため、注意が必要である。 ## 例 @@ -171,7 +171,7 @@ false, 114, false | 名前 | 説明 | |------------------------------------------------|--------------------------------------------| -| [`flat_map::insert`](insert.md.nolink) | 要素を挿入する | +| [`flat_map::insert`](insert.md) | 要素を挿入する | | [`flat_map::insert_or_assign`](insert_or_assign.md.nolink) | 要素を挿入、あるいは代入する | | [`flat_map::emplace`](emplace.md) | 要素を直接構築する | | [`flat_map::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | diff --git a/reference/flat_map/sorted_unique_t.md b/reference/flat_map/sorted_unique_t.md new file mode 100644 index 0000000000..67d6e68962 --- /dev/null +++ b/reference/flat_map/sorted_unique_t.md @@ -0,0 +1,66 @@ +# sorted_unique_t +* flat_map[meta header] +* std[meta namespace] +* class[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + struct sorted_unique_t { explicit sorted_unique_t() = default; }; + inline constexpr sorted_unique_t sorted_unique{}; +} +``` + +## 概要 +`sorted_unique_t`は、[`flat_map`](flat_map.md)コンテナに挿入するシーケンスがソート済みかつ重複要素がないことを示すためのタグ型および値である。 + +このクラス自体は空であり、オーバーロード解決のためにのみ使用される。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_map fm = { + {3, 'a'} + }; + + std::flat_map fm2 = { + {5, 'd'}, + {15, 'e'} + }; + + // 挿入するシーケンスがソート済みかつ重複要素がないことがわかっている場合、 + // sorted_uniqueを指定した方が高速になる + fm.insert(std::sorted_unique, fm2.begin(), fm2.end()); + + for (const auto& [key, value] : fm) { + std::cout << key << " : " << value << std::endl; + } +} +``` +* std::sorted_unique[color ff0000] +* insert[link flat_map/insert.md] +* begin()[link flat_map/begin.md] +* end()[link flat_map/end.md] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`std::flat_map`](flat_map.md) + diff --git a/reference/map/map/insert.md b/reference/map/map/insert.md index 67fa498234..db4b323470 100644 --- a/reference/map/map/insert.md +++ b/reference/map/map/insert.md @@ -32,7 +32,7 @@ iterator insert(const_iterator hint, node_type&& nh); // (8) C++17か ## 概要 新しく一つの要素(引数 `x`, `y`を使う)または要素のシーケンス(入力イテレータまたは `initializer_list` を使う)または[ノードハンドル](/reference/node_handle/node_handle.md)を挿入することにより、 `map` コンテナを拡張する。 -これは、挿入された要素の数だけコンテナの [`size()`](/reference/map/map/size.md) を増やす。 +これは、挿入された要素の数だけコンテナの [`size()`](size.md) を増やす。 `map` コンテナは重複したキーを持つ要素を許さないため、挿入操作はそれぞれの要素が他のコンテナ内の既存要素と同じキーかどうかをチェックする。もし同じであれば要素は挿入されず、戻り値を持つ関数の場合はそれへのイテレータなどを返す。 @@ -86,7 +86,7 @@ iterator insert(const_iterator hint, node_type&& nh); // (8) C++17か - (1), (2) : 対数時間 - (3), (4) : 一般に対数時間だが、指定された新たな要素が `position` が指す要素の直前に挿入された場合は償却定数時間。(ただし、備考も参照) - (5), (6) : 一般に N log(size + N)。(ただし、備考も参照) - - ここで、 `N` は `first` と `last` の間の距離であり `size` は挿入前のコンテナの [`size()`](/reference/map/map/size.md) を表す。 + - ここで、 `N` は `first` と `last` の間の距離であり `size` は挿入前のコンテナの [`size()`](size.md) を表す。 - (7) : 対数時間 - (8) : 一般に対数時間だが、指定された新たな要素が `position` が指す要素の直前に挿入された場合は償却定数時間。 diff --git a/reference/map/multimap/insert.md b/reference/map/multimap/insert.md index 1005aac1a9..946a11c844 100644 --- a/reference/map/multimap/insert.md +++ b/reference/map/multimap/insert.md @@ -32,7 +32,7 @@ iterator insert(const_iterator hint, node_type&& nh); // (10) C++17 ## 概要 新しく一つの要素(引数 `x`, `y`を使う)、要素のシーケンス(入力イテレータまたは `initializer_list` を使う)または[ノードハンドル](/reference/node_handle/node_handle.md)を挿入することにより、 `multimap` コンテナを拡張する。 -これは、挿入された要素の数だけコンテナの [`size()`](/reference/map/multimap/size.md) を増やす。 +これは、挿入された要素の数だけコンテナの [`size()`](size.md) を増やす。 内部的に `multimap` コンテナは、コンストラクト時に指定された比較オブジェクトによって要素を下位から上位へとソートして保持する。 From 2dd6e26bcbdb1a1faebd702ca4e0be505acb9668 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 16 Aug 2023 20:11:12 +0900 Subject: [PATCH 0415/3948] =?UTF-8?q?map::insert=20:=20P&&=E3=81=A8value?= =?UTF-8?q?=5Ftype&&=E3=81=AF=E4=B8=A1=E6=96=B9=E5=AD=98=E5=9C=A8=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=81=AE=E3=81=A7=E3=82=AA=E3=83=BC=E3=83=90=E3=83=BC?= =?UTF-8?q?=E3=83=AD=E3=83=BC=E3=83=89=E7=95=AA=E5=8F=B7=E3=82=92=E5=88=86?= =?UTF-8?q?=E3=81=91=E3=80=81=E6=A6=82=E8=A6=81=E6=96=87=E7=AB=A0=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/map/map/insert.md | 101 ++++++++++++++++++++---------------- 1 file changed, 57 insertions(+), 44 deletions(-) diff --git a/reference/map/map/insert.md b/reference/map/map/insert.md index db4b323470..259a068cb4 100644 --- a/reference/map/map/insert.md +++ b/reference/map/map/insert.md @@ -8,23 +8,25 @@ pair insert(const value_type& x); // (1) template -pair insert(P&& x); // (2) C++11から -pair insert(value_type&& x); // (2) C++17から +pair insert(P&& x); // (2) C++11 -iterator insert(iterator position, const value_type& x); // (3) C++11まで -iterator insert(const_iterator position, const value_type& x); // (3) C++11から +pair insert(value_type&& x); // (3) C++17 + +iterator insert(iterator position, const value_type& x); // (4) C++03まで +iterator insert(const_iterator position, const value_type& x); // (4) C++11から template -iterator insert(const_iterator position, P&& x); // (4) C++11から -iterator insert(const_iterator position, value_type&& x); // (4) C++17から +iterator insert(const_iterator position, P&& x); // (5) C++11 + +iterator insert(const_iterator position, value_type&& x); // (6) C++17 template -void insert(InputIterator first, InputIterator last); // (5) +void insert(InputIterator first, InputIterator last); // (7) -void insert(initializer_list init); // (6) C++11から +void insert(initializer_list init); // (8) C++11 -insert_return_type insert(node_type&& nh); // (7) C++17から -iterator insert(const_iterator hint, node_type&& nh); // (8) C++17から +insert_return_type insert(node_type&& nh); // (9) C++17 +iterator insert(const_iterator hint, node_type&& nh); // (10) C++17 ``` * pair[link /reference/utility/pair.md] * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -43,64 +45,75 @@ iterator insert(const_iterator hint, node_type&& nh); // (8) C++17か この操作は、適切な引数 `position` を提供することで効率を飛躍的に改善することができる。 -## 要件 -- (1) : `value_type` は、コンテナに対してコピー挿入可能でなければならない。 -- (2) : `value_type` は、コンテナに対してムーブ挿入可能でなければならない。 -- (3) : `value_type` は、コンテナに対してコピー挿入可能でなければならない。 -- (4) : `value_type` は、コンテナに対してムーブ挿入可能でなければならない。 -- (5) : イテレータ範囲`[first, last)`の各イテレータが、`*this`の要素を指さないこと。 -- (6) : (5)の要件と同じである。 -- (7) : `nh` は空である、または、`(*this).get_allocator() == nh.get_allocator()`である。 -- (8) : `nh` は空である、または、`(*this).get_allocator() == nh.get_allocator()`である。 +- (1) : 単一要素を挿入する +- (2) : 単一要素として要素型`value_type`のコンストラクタ引数を受け取って挿入する +- (3) : 単一要素の一時オブジェクトを挿入する +- (4) : 指定された位置に、単一要素を挿入する +- (5) : 指定された位置に、要素型`value_type`のコンストラクタ引数を受け取って挿入する +- (6) : 指定された位置に、単一要素の一時オブジェクトを挿入する +- (7) : イテレータ範囲`[first, last)`を挿入する +- (8) : 初期化子リストを挿入する +- (9) : [ノードハンドル](/reference/node_handle/node_handle.md)を挿入する +- (10) : 指定された位置に、[ノードハンドル](/reference/node_handle/node_handle.md)を挿入する + + +## テンプレートパラメータ制約 +- (1) : `value_type` は、コンテナに対してコピー挿入可能であること +- (2) : [`std::is_constructible`](/reference/type_traits/is_constructible.md)`::value == true`であること +- (3) : `value_type` は、コンテナに対してムーブ挿入可能であること +- (4) : `value_type` は、コンテナに対してコピー挿入可能であること +- (5) : [`std::is_constructible`](/reference/type_traits/is_constructible.md)`::value == true`であること +- (6) : `value_type` は、コンテナに対してムーブ挿入可能であること + + +## 事前条件 +- (7), (8) : イテレータ範囲`[first, last)`の各イテレータが、`*this`の要素を指さないこと +- (9), (10) : `nh` は空である、または、`(*this).get_allocator() == nh.get_allocator()`であること ## 効果 - (1) : `x`を`*this`の要素としてコピー挿入する。ただし、`x`のキーと等価のキーを持つ要素が`*this`に存在する場合には、挿入されない。 - (2) : [`emplace`](emplace.md)`(`[`std::forward`](/reference/utility/forward.md)`

(x))`と等価。 -- (3) : `x`を`*this`の要素としてコピー挿入する。ただし、`x`のキーと等価のキーを持つ要素が`*this`に存在する場合には、挿入されない。可能であれば、挿入位置のヒントを表すイテレータ`position`のすぐ前に挿入する。 -- (4) : [`emplace_hint`](emplace_hint.md)`(position,` [`std::forward`](/reference/utility/forward.md)`

(x))`と等価。 -- (5) : イテレータ範囲`[first, last)`の各要素を`*this`の要素として挿入する。ただし、`*this`にすでに存在するキーと等価なキーを持つ要素については、挿入されない。 -- (6) : `insert(init.begin(), init.end())`と等価。 -- (7) : `nh`が空の場合、効果はない。 +- (3) : `x`を`*this`の要素としてムーブ挿入する。ただし、`x`のキーと等価のキーを持つ要素が`*this`に存在する場合には、挿入されない。 +- (4) : `x`を`*this`の要素としてコピー挿入する。ただし、`x`のキーと等価のキーを持つ要素が`*this`に存在する場合には、挿入されない。可能であれば、挿入位置のヒントを表すイテレータ`position`のすぐ前に挿入する。 +- (5) : [`emplace_hint`](emplace_hint.md)`(position,` [`std::forward`](/reference/utility/forward.md)`

(x))`と等価。 +- (6) : `x`を`*this`の要素としてムーブ挿入する。ただし、`x`のキーと等価のキーを持つ要素が`*this`に存在する場合には、挿入されない。可能であれば、挿入位置のヒントを表すイテレータ`position`のすぐ前に挿入する。 +- (7) : イテレータ範囲`[first, last)`の各要素を`*this`の要素として挿入する。ただし、`*this`にすでに存在するキーと等価なキーを持つ要素については、挿入されない。 +- (8) : `insert(init.begin(), init.end())`と等価。 +- (9) : `nh`が空の場合、効果はない。 それ以外の場合、`nh.key()`と等価のキーを持つ要素がコンテナにない場合に限り、`nh`が所有する要素を挿入する。 -- (8) : `nh`が空の場合、効果はなく、`(*this).end()`を返す。 -それ以外の場合、`nh.key()`と等価のキーを持つ要素がコンテナにない場合に限り、`nh`が所有する要素を挿入する。`nh.key()`と等価のキーの要素を指すイテレータを常に返す。 -要素は、`p`の直前の位置のできるだけ近くに挿入される。 +- (10) : `nh`が空の場合、効果はなく、`(*this).end()`を返す。それ以外の場合、`nh.key()`と等価のキーを持つ要素がコンテナにない場合に限り、`nh`が所有する要素を挿入する。`nh.key()`と等価のキーの要素を指すイテレータを常に返す。要素は、`p`の直前の位置のできるだけ近くに挿入される。 ## 戻り値 -- (1), (2) : 戻り値としては、イテレータと`bool`値の組を返す。 +- (1), (2), (3) : 戻り値としては、イテレータと`bool`値の組を返す。 - 挿入された場合には、`first` に挿入された要素へのイテレータ、 `second` に `true` が設定される。 - 挿入されなかった場合には、 `first` に `x` と等価のキーを持つ要素へのイテレータ、 `second` に `false` が設定される。 -- (3), (4) : +- (4), (5), (6) : - 挿入された場合には、新しく挿入された要素を指すイテレータを返す。 - 挿入されなかった場合には、`x`のキーと等価のキーを持つ要素へのイテレータを返す。 -- (5), (6) : なし -- (7) : 戻り値としては、[`insert_return_type`](/reference/map/map.md)を返す。`insert_return_type`のイテレータ型メンバ変数`position`、`bool`型メンバ変数`inserted`に格納される値は(1), (2)のものと同じ情報である。`nh`が空の場合は、`position`は終端イテレータである。`node_type`型メンバ変数`node`には、 +- (7), (8) : なし +- (9) : 戻り値としては、[`insert_return_type`](/reference/map/map.md)を返す。`insert_return_type`のイテレータ型メンバ変数`position`、`bool`型メンバ変数`inserted`に格納される値は(1), (2)のものと同じ情報である。`nh`が空の場合は、`position`は終端イテレータである。`node_type`型メンバ変数`node`には、 - 挿入された場合には、空の[ノードハンドル](/reference/node_handle/node_handle.md)。 - 挿入されなかった場合には、`nh`の値である。 -- (8) : `nh`が空の場合、`(*this).end()`を返す。そうではない場合、`nh`と等価のキーの要素を指すイテレータを常に返す。 +- (10) : `nh`が空の場合、`(*this).end()`を返す。そうではない場合、`nh`と等価のキーの要素を指すイテレータを常に返す。 ## 計算量 -- (1), (2) : 対数時間 -- (3), (4) : 一般に対数時間だが、指定された新たな要素が `position` が指す要素の直前に挿入された場合は償却定数時間。(ただし、備考も参照) -- (5), (6) : 一般に N log(size + N)。(ただし、備考も参照) +- (1), (2), (3) : 対数時間 +- (4), (5), (6) : 一般に対数時間だが、指定された新たな要素が `position` が指す要素の直前に挿入された場合は償却定数時間。(ただし、備考も参照) +- (7), (8) : 一般に N log(size + N)。(ただし、備考も参照) - ここで、 `N` は `first` と `last` の間の距離であり `size` は挿入前のコンテナの [`size()`](size.md) を表す。 -- (7) : 対数時間 -- (8) : 一般に対数時間だが、指定された新たな要素が `position` が指す要素の直前に挿入された場合は償却定数時間。 +- (9) : 対数時間 +- (10) : 一般に対数時間だが、指定された新たな要素が `position` が指す要素の直前に挿入された場合は償却定数時間。 ## 備考 - これらの関数が呼ばれた後も、当該コンテナ内の要素を指す参照やイテレータは無効にはならない。 なお、規格書に明確な記載は無いが、当該コンテナ内の要素を指すポインタも無効にはならない。 -- (3), (4) : C++03 までの仕様では、計算量が償却定数時間となる条件は、「`position` が指す要素の**後ろ**に挿入された場合」となっているが、主要な実装はC++03時点から `position` が指す**前**に挿入する場合に償却定数時間となっていた。これは、`position` の後ろでは、適切な位置が先頭の場合に指定する方法がないこと、`vector::insert` の場合、`position` の前に挿入されること、STL のオリジナルである HP 社の実装が `position` の前に挿入する場合に償却定数時間であったことなどによる。 - -- (5) : C++03 までの仕様では、`first` と `last` の間が昇順にソートされていた場合、計算量が線形時間となっていたが、この仕様は実現性がないため C++11 では削除された。(例えば、コンテナの既存の要素が 2 から 100 の偶数のみの場合に、1 から 99 のソートされた奇数の範囲を挿入する場合を考えてみよ) - -- (2), (4) : [`std::is_constructible`](/reference/type_traits/is_constructible.md)`::value == true`である場合のみ、これらの関数はオーバーロード解決に参加する。 - -- (7), (8) : 要素は、コピーもムーブもされない。 +- (4), (5), (6): C++03 までの仕様では、計算量が償却定数時間となる条件は、「`position` が指す要素の**後ろ**に挿入された場合」となっているが、主要な実装はC++03時点から `position` が指す**前**に挿入する場合に償却定数時間となっていた。これは、`position` の後ろでは、適切な位置が先頭の場合に指定する方法がないこと、`vector::insert` の場合、`position` の前に挿入されること、STL のオリジナルである HP 社の実装が `position` の前に挿入する場合に償却定数時間であったことなどによる。 +- (7) : C++03 までの仕様では、`first` と `last` の間が昇順にソートされていた場合、計算量が線形時間となっていたが、この仕様は実現性がないため C++11 では削除された。(例えば、コンテナの既存の要素が 2 から 100 の偶数のみの場合に、1 から 99 のソートされた奇数の範囲を挿入する場合を考えてみよ) +- (9), (10) : 要素は、コピーもムーブもされない。 ## 例 From 1e3373055cb45f236e09607348f156090c597335 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 16 Aug 2023 20:16:57 +0900 Subject: [PATCH 0416/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map/insert.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/flat_map/flat_map/insert.md b/reference/flat_map/flat_map/insert.md index d3c7e9001b..243f2797d4 100644 --- a/reference/flat_map/flat_map/insert.md +++ b/reference/flat_map/flat_map/insert.md @@ -40,7 +40,7 @@ void insert(sorted_unique_t s, ``` * pair[link /reference/utility/pair.md] * initializer_list[link /reference/initializer_list/initializer_list.md] -* sorted_unique_t[link ] +* sorted_unique_t[link /reference/flat_map/sorted_unique_t.md] ## 概要 新しく一つの要素(引数 `x`, `y`を使う)または要素のシーケンス(入力イテレータまたは `initializer_list` を使う)を挿入し、コンテナを拡張する。 From f3f750307c2fa2056d04f01ad79cc0e75236a054 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 16 Aug 2023 20:22:34 +0900 Subject: [PATCH 0417/3948] =?UTF-8?q?container-compatible-range=E3=82=B3?= =?UTF-8?q?=E3=83=B3=E3=82=BB=E3=83=97=E3=83=88=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20#1069?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/exposition-only.md | 7 +++++ .../container-compatible-range.md | 27 +++++++++++++++++++ reference/flat_map/flat_map/insert.md | 1 + 3 files changed, 35 insertions(+) create mode 100644 reference/exposition-only/container-compatible-range.md diff --git a/reference/exposition-only.md b/reference/exposition-only.md index 003ffcbfa2..48716460b1 100644 --- a/reference/exposition-only.md +++ b/reference/exposition-only.md @@ -11,6 +11,13 @@ | [`synth-three-way`](exposition-only/synth-three-way-result.md) | 三方比較可能であればそれを行い、そうでなければ三方比較を実装して比較を行う (variable) | C++20 | | [`synth-three-way-result`](exposition-only/synth-three-way-result.md) | `synth-three-way`関数オブジェクトでの比較結果の型 (function template) | C++20 | + +## コンテナ + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`container-compatible-range`](exposition-only/container-compatible-range.md) | 指定されたコンテナと互換性のあるRange | C++23 | + ## `` | 名前 | 説明 | 対応バージョン | diff --git a/reference/exposition-only/container-compatible-range.md b/reference/exposition-only/container-compatible-range.md new file mode 100644 index 0000000000..a6b13dd0d9 --- /dev/null +++ b/reference/exposition-only/container-compatible-range.md @@ -0,0 +1,27 @@ +# container-compatible-range +* exposition-only[meta header] +* concept[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template + concept container-compatible-range = + ranges::input_range && convertible_to, T>; +} +``` +* ranges::input_range[link /reference/ranges/input_range.md] +* ranges::range_reference[link /reference/ranges/range_reference_t.md] +* convertible_to[link /reference/concepts/convertible_to.md] + +## 概要 +container-compatible-rangeは、指定されたコンテナと互換性のあるRangeであることを表すコンセプトである。 + + +## バージョン +### 言語 +- C++23 + + +## 参照 +- [P1206R7 `ranges::to`: A function to convert any range to a container](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1206r7.pdf) diff --git a/reference/flat_map/flat_map/insert.md b/reference/flat_map/flat_map/insert.md index 243f2797d4..5f3a656f0d 100644 --- a/reference/flat_map/flat_map/insert.md +++ b/reference/flat_map/flat_map/insert.md @@ -41,6 +41,7 @@ void insert(sorted_unique_t s, * pair[link /reference/utility/pair.md] * initializer_list[link /reference/initializer_list/initializer_list.md] * sorted_unique_t[link /reference/flat_map/sorted_unique_t.md] +* container-compatible-range[link /reference/exposition-only/container-compatible-range.md] ## 概要 新しく一つの要素(引数 `x`, `y`を使う)または要素のシーケンス(入力イテレータまたは `initializer_list` を使う)を挿入し、コンテナを拡張する。 From 292f841f9c90af75b5804ce5481dc23e6f93580a Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 17 Aug 2023 16:33:34 +0900 Subject: [PATCH 0418/3948] =?UTF-8?q?flat=5Fmap=20:=20insert=5Frange?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20#1078?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map.md | 2 +- reference/flat_map/flat_map/insert.md | 58 ++-------- reference/flat_map/flat_map/insert_range.md | 120 ++++++++++++++++++++ 3 files changed, 132 insertions(+), 48 deletions(-) create mode 100644 reference/flat_map/flat_map/insert_range.md diff --git a/reference/flat_map/flat_map.md b/reference/flat_map/flat_map.md index 53e8f472eb..24660156e2 100644 --- a/reference/flat_map/flat_map.md +++ b/reference/flat_map/flat_map.md @@ -60,7 +60,7 @@ namespace std { | [`clear`](flat_map/clear.md) | 全ての要素を削除する | C++23 | | [`insert`](flat_map/insert.md) | 要素を挿入する | C++23 | | [`insert_or_assign`](flat_map/insert_or_assign.md.nolink) | 要素を挿入、あるいは代入する | C++23 | -| [`insert_range`](flat_map/insert_range.md.nolink) | Rangeを挿入する | C++23 | +| [`insert_range`](flat_map/insert_range.md) | Rangeを挿入する | C++23 | | [`emplace`](flat_map/emplace.md) | 要素を直接構築する | C++23 | | [`emplace_hint`](flat_map/emplace_hint.md) | ヒントを使って要素を直接構築する | C++23 | | [`try_emplace`](flat_map/try_emplace.md) | キーが存在しない場合のみ要素を直接構築する | C++23 | diff --git a/reference/flat_map/flat_map/insert.md b/reference/flat_map/flat_map/insert.md index 5f3a656f0d..e19ee2fba9 100644 --- a/reference/flat_map/flat_map/insert.md +++ b/reference/flat_map/flat_map/insert.md @@ -30,13 +30,10 @@ void insert(sorted_unique_t, InputIterator first, InputIterator last); // (8) C++23 -template R> -void insert_range(R&& rg); // (9) C++23 - -void insert(initializer_list il); // (10) C++23 +void insert(initializer_list il); // (9) C++23 void insert(sorted_unique_t s, - initializer_list il); // (11) C++23 + initializer_list il); // (10) C++23 ``` * pair[link /reference/utility/pair.md] * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -64,9 +61,8 @@ void insert(sorted_unique_t s, - (6) : 指定された位置に、要素型`value_type`のコンストラクタ引数を受け取って挿入する - (7) : イテレータ範囲`[first, last)`を挿入する - (8) : ソート済みかつ重複要素のないイテレータ範囲`[first, last)`を挿入する -- (9) : Rangeを挿入する -- (10) : 初期化子リストを挿入する -- (11) : ソート済みかつ重複要素のない初期化子リストを挿入する +- (9) : 初期化子リストを挿入する +- (10) : ソート済みかつ重複要素のない初期化子リストを挿入する ## 要件 @@ -181,44 +177,12 @@ void insert(sorted_unique_t s, * key_equiv[link key_equiv.md] * distance[link /reference/iterator/distance.md] -- (9) : メンバ変数として保持しているコンテナ`c`に、以下のように挿入する: - ```cpp - for (const auto& e : rg) { - c.keys.insert(c.keys.end(), e.first); - c.values.insert(c.values.end(), e.second); - } - ``` - * c.keys[link containers.md] - * c.values[link containers.md] - * end()[link /reference/vector/vector/end.md] - * insert[link /reference/vector/vector/insert.md] - * first[link /reference/utility/pair.md] - * second[link /reference/utility/pair.md] - - - 次に、新しく挿入された要素の範囲を`value_comp()`を基準にソートする - - 次に、ソートされた結果の範囲と、既存の要素のソートされた範囲をひとつのソートされた範囲にマージする - - 最後に、重複する要素を以下のように削除する: - - ```cpp - auto zv = ranges::zip_view(c.keys, c.values); - auto it = ranges::unique(zv, key_equiv(compare)).begin(); - auto dist = distance(zv.begin(), it); - c.keys.erase(c.keys.begin() + dist, c.keys.end()); - c.values.erase(c.values.begin() + dist, c.values.end()); - ``` - * c.keys[link containers.md] - * c.values[link containers.md] - * ranges::zip_view[link /ranges/zip_view.md.nolink] - * ranges::unique[link /reference/algorithm/ranges_unique.md] - * key_equiv[link key_equiv.md] - * distance[link /reference/iterator/distance.md] - -- (10) : +- (9) : ```cpp insert(il.begin(), il.end()); ``` -- (11) : +- (10) : ```cpp insert(s, il.begin(), il.end()); ``` @@ -231,17 +195,16 @@ void insert(sorted_unique_t s, - (3), (4), (6) : - 挿入された場合には、新しく挿入された要素を指すイテレータを返す。 - 挿入されなかった場合には、`x`のキーと等価のキーを持つ要素へのイテレータを返す。 -- (7), (8), (9), (10), (11) : なし +- (7), (8), (9), (10) : なし ## 計算量 - (7) : Nをこの操作の前の[`size()`](size.md)、Mを[`distance`](/reference/iterator/distance.md)`(first, last)`として、N + MlogM -- (7) : Nをこの操作のあとの[`size()`](size.md)として、Nに対して線形 -- (8) : Nをこの操作の前の[`size()`](size.md)、Mを[`ranges::distance`](/reference/iterator/ranges_distance.md)`(rg)`として、N + MlogM +- (8) : Nをこの操作のあとの[`size()`](size.md)として、Nに対して線形 ## 備考 -- (7), (8), (9) : この操作はインプレース・マージを行うため、追加のメモリ確保を行う可能性がある +- (7), (8) : この操作はインプレース・マージを行うため、追加のメモリ確保を行う可能性がある ## 例 @@ -263,7 +226,6 @@ int main() }; // シーケンスを挿入する - fm.insert(fm2); fm.insert(fm2.begin(), fm2.end()); // 挿入するシーケンスがソート済みかつ重複要素がないことがわかっている場合、 @@ -275,6 +237,7 @@ int main() } } ``` +* insert[color ff0000] * begin()[link begin.md] * end()[link end.md] * std::sorted_unique[link /reference/flat_map/sorted_unique_t.md] @@ -298,6 +261,7 @@ int main() | 名前 | 説明 | |------------------------------------------------|--------------------------------------------| | [`flat_map::insert_or_assign`](insert_or_assign.md.nolink) | 要素を挿入、あるいは代入する | +| [`flat_map::insert_range`](insert_range.md) | Rangeを挿入する | | [`flat_map::emplace`](emplace.md) | 要素を直接構築する | | [`flat_map::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | | [`flat_map::try_emplace`](try_emplace.md) | キーが存在しない場合のみ要素を直接構築する | diff --git a/reference/flat_map/flat_map/insert_range.md b/reference/flat_map/flat_map/insert_range.md new file mode 100644 index 0000000000..7962278bf1 --- /dev/null +++ b/reference/flat_map/flat_map/insert_range.md @@ -0,0 +1,120 @@ +# insert_range +* flat_map[meta header] +* std[meta namespace] +* flat_map[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +template R> +void insert_range(R&& rg); // (1) C++23 +``` +* container-compatible-range[link /reference/exposition-only/container-compatible-range.md] + +## 概要 +Rangeを挿入し、コンテナを拡張する。 + +これは、挿入された要素の数だけコンテナの [`size()`](size.md) を増やす。 + +`flat_map` コンテナは重複したキーを持つ要素を許さないため、挿入操作はそれぞれの要素が他のコンテナ内の既存要素と同じキーかどうかをチェックする。もし同じであれば要素は挿入されない。 + +重複した値を許す、類似したコンテナについては `flat_multimap` を参照。 + +内部的に `flat_map` コンテナは、コンストラクト時に指定された比較オブジェクトによって要素を下位から上位へとソートして保持する。 + + +## 効果 +- メンバ変数として保持しているコンテナ`c`に、以下のように挿入する: + ```cpp + for (const auto& e : rg) { + c.keys.insert(c.keys.end(), e.first); + c.values.insert(c.values.end(), e.second); + } + ``` + * c.keys[link containers.md] + * c.values[link containers.md] + * end()[link /reference/vector/vector/end.md] + * insert[link /reference/vector/vector/insert.md] + * first[link /reference/utility/pair.md] + * second[link /reference/utility/pair.md] + + - 次に、新しく挿入された要素の範囲を`value_comp()`を基準にソートする + - 次に、ソートされた結果の範囲と、既存の要素のソートされた範囲をひとつのソートされた範囲にマージする + - 最後に、重複する要素を以下のように削除する: + + ```cpp + auto zv = ranges::zip_view(c.keys, c.values); + auto it = ranges::unique(zv, key_equiv(compare)).begin(); + auto dist = distance(zv.begin(), it); + c.keys.erase(c.keys.begin() + dist, c.keys.end()); + c.values.erase(c.values.begin() + dist, c.values.end()); + ``` + * c.keys[link containers.md] + * c.values[link containers.md] + * ranges::zip_view[link /ranges/zip_view.md.nolink] + * ranges::unique[link /reference/algorithm/ranges_unique.md] + * key_equiv[link key_equiv.md] + * distance[link /reference/iterator/distance.md] + + +## 戻り値 +なし + + +## 計算量 +- Nをこの操作の前の[`size()`](size.md)、Mを[`ranges::distance`](/reference/iterator/ranges_distance.md)`(rg)`として、N + MlogM + + +## 備考 +- この操作はインプレース・マージを行うため、追加のメモリ確保を行う可能性がある + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_map fm = { + {3, 'a'} + }; + + std::flat_map fm2 = { + {5, 'd'}, + {15, 'e'} + }; + + fm.insert_range(fm2); + + for (const auto& [key, value] : fm) { + std::cout << key << " : " << value << std::endl; + } +} +``` +* insert_range[color ff0000] + +### 出力 +``` +3 : a +5 : d +15 : e +``` + +## バージョン +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|------------------------------------------------|--------------------------------------------| +| [`flat_map::insert`](insert.md) | 要素を挿入する | +| [`flat_map::insert_or_assign`](insert_or_assign.md.nolink) | 要素を挿入、あるいは代入する | +| [`flat_map::emplace`](emplace.md) | 要素を直接構築する | +| [`flat_map::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | +| [`flat_map::try_emplace`](try_emplace.md) | キーが存在しない場合のみ要素を直接構築する | + From 3547182922866d554e5e9e681ffdc2bb81c6503f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 17 Aug 2023 16:47:59 +0900 Subject: [PATCH 0419/3948] =?UTF-8?q?=E6=9C=AA=E4=BD=BF=E7=94=A8=E3=81=AE?= =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE=E9=A3=BE=E3=82=92=E5=89=8A?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map/insert.md | 1 - 1 file changed, 1 deletion(-) diff --git a/reference/flat_map/flat_map/insert.md b/reference/flat_map/flat_map/insert.md index e19ee2fba9..2a500628c0 100644 --- a/reference/flat_map/flat_map/insert.md +++ b/reference/flat_map/flat_map/insert.md @@ -38,7 +38,6 @@ void insert(sorted_unique_t s, * pair[link /reference/utility/pair.md] * initializer_list[link /reference/initializer_list/initializer_list.md] * sorted_unique_t[link /reference/flat_map/sorted_unique_t.md] -* container-compatible-range[link /reference/exposition-only/container-compatible-range.md] ## 概要 新しく一つの要素(引数 `x`, `y`を使う)または要素のシーケンス(入力イテレータまたは `initializer_list` を使う)を挿入し、コンテナを拡張する。 From db7801c0f24a2e644d58d77981fb7767bfc88d38 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 17 Aug 2023 17:14:08 +0900 Subject: [PATCH 0420/3948] =?UTF-8?q?flat=5Fmap=20:=20insert=5For=5Fassign?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20#1078?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map.md | 2 +- reference/flat_map/flat_map/emplace.md | 3 +- reference/flat_map/flat_map/emplace_hint.md | 3 +- reference/flat_map/flat_map/insert.md | 2 +- .../flat_map/flat_map/insert_or_assign.md | 153 ++++++++++++++++++ reference/flat_map/flat_map/insert_range.md | 2 +- reference/flat_map/flat_map/try_emplace.md | 3 +- 7 files changed, 162 insertions(+), 6 deletions(-) create mode 100644 reference/flat_map/flat_map/insert_or_assign.md diff --git a/reference/flat_map/flat_map.md b/reference/flat_map/flat_map.md index 24660156e2..1f8d0b0ba5 100644 --- a/reference/flat_map/flat_map.md +++ b/reference/flat_map/flat_map.md @@ -59,7 +59,7 @@ namespace std { |-----------------------------------------------|--------------------------------------------|----------------| | [`clear`](flat_map/clear.md) | 全ての要素を削除する | C++23 | | [`insert`](flat_map/insert.md) | 要素を挿入する | C++23 | -| [`insert_or_assign`](flat_map/insert_or_assign.md.nolink) | 要素を挿入、あるいは代入する | C++23 | +| [`insert_or_assign`](flat_map/insert_or_assign.md) | 要素を挿入、あるいは代入する | C++23 | | [`insert_range`](flat_map/insert_range.md) | Rangeを挿入する | C++23 | | [`emplace`](flat_map/emplace.md) | 要素を直接構築する | C++23 | | [`emplace_hint`](flat_map/emplace_hint.md) | ヒントを使って要素を直接構築する | C++23 | diff --git a/reference/flat_map/flat_map/emplace.md b/reference/flat_map/flat_map/emplace.md index 28a7e713d7..22f1df248d 100644 --- a/reference/flat_map/flat_map/emplace.md +++ b/reference/flat_map/flat_map/emplace.md @@ -133,7 +133,8 @@ CCC : (1, 2) | 名前 | 説明 | |------------------------------------------------|--------------------------------------------| | [`flat_map::insert`](insert.md) | 要素を挿入する | -| [`flat_map::insert_or_assign`](insert_or_assign.md.nolink) | 要素を挿入、あるいは代入する | +| [`flat_map::insert_range`](insert_range.md) | Rangeを挿入する | +| [`flat_map::insert_or_assign`](insert_or_assign.md) | 要素を挿入、あるいは代入する | | [`flat_map::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | | [`flat_map::try_emplace`](try_emplace.md) | キーが存在しない場合のみ要素を直接構築する | diff --git a/reference/flat_map/flat_map/emplace_hint.md b/reference/flat_map/flat_map/emplace_hint.md index a667e951cf..193f6698c4 100644 --- a/reference/flat_map/flat_map/emplace_hint.md +++ b/reference/flat_map/flat_map/emplace_hint.md @@ -76,7 +76,8 @@ int main() | 名前 | 説明 | |------------------------------------------------|--------------------------------------------| | [`flat_map::insert`](insert.md) | 要素を挿入する | -| [`flat_map::insert_or_assign`](insert_or_assign.md.nolink) | 要素を挿入、あるいは代入する | +| [`flat_map::insert_range`](insert_range.md) | Rangeを挿入する | +| [`flat_map::insert_or_assign`](insert_or_assign.md) | 要素を挿入、あるいは代入する | | [`flat_map::emplace`](emplace.md) | 要素を直接構築する | | [`flat_map::try_emplace`](try_emplace.md) | キーが存在しない場合のみ要素を直接構築する | diff --git a/reference/flat_map/flat_map/insert.md b/reference/flat_map/flat_map/insert.md index 2a500628c0..276a869e13 100644 --- a/reference/flat_map/flat_map/insert.md +++ b/reference/flat_map/flat_map/insert.md @@ -259,7 +259,7 @@ int main() | 名前 | 説明 | |------------------------------------------------|--------------------------------------------| -| [`flat_map::insert_or_assign`](insert_or_assign.md.nolink) | 要素を挿入、あるいは代入する | +| [`flat_map::insert_or_assign`](insert_or_assign.md) | 要素を挿入、あるいは代入する | | [`flat_map::insert_range`](insert_range.md) | Rangeを挿入する | | [`flat_map::emplace`](emplace.md) | 要素を直接構築する | | [`flat_map::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | diff --git a/reference/flat_map/flat_map/insert_or_assign.md b/reference/flat_map/flat_map/insert_or_assign.md new file mode 100644 index 0000000000..39a0fad212 --- /dev/null +++ b/reference/flat_map/flat_map/insert_or_assign.md @@ -0,0 +1,153 @@ +# insert_or_assign +* flat_map[meta header] +* std[meta namespace] +* flat_map[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +template +pair + insert_or_assign(const key_type& k, + M&& obj); // (1) C++23 + +template +pair + insert_or_assign(key_type&& k, + M&& obj); // (2) C++23 + +template +pair + insert_or_assign(K&& k, + M&& obj); // (3) C++23 + +template +iterator + insert_or_assign(const_iterator hint, + const key_type& k, + M&& obj); // (4) C++23 + +template +iterator + insert_or_assign(const_iterator hint, + key_type&& k, + M&& obj); // (5) C++23 + +template +iterator + insert_or_assign(const_iterator hint, + K&& k, + M&& obj); // (6) C++23 +``` +* pair[link /reference/utility/pair.md] + +## 概要 +引数 `k` で指定されたキーが存在しなければ対応する値を引数 `obj` の値として要素を挿入し(`insert`)、さもなければ(`or`)、そのキーに対応する値に引数 `obj` を代入する(`assign`)。 + +引数 `hint` は、`k` を検索する際のヒントに使用される。 + +- (1) : `key_type`型のキーをとって挿入もしくは代入する +- (2) : `key_type`型の一時オブジェクトのキーをとって挿入もしくは代入する +- (3) : `key_type`に変換可能な型の一時オブジェクトのキーをとって挿入もしくは代入する +- (4) : 挿入位置のヒントをともない、`key_type`型のキーをとって挿入もしくは代入する +- (5) : 挿入位置のヒントをともない、`key_type`型の一時オブジェクトのキーをとって挿入もしくは代入する +- (6) : 挿入位置のヒントをともない、`key_type`に変換可能な型の一時オブジェクトのキーをとって挿入もしくは代入する + + +## テンプレートパラメータ制約 +- (1), (2), (4), (5) : + - [`is_assignable_v`](/reference/type_traits/is_assignable.md)`` が `true` であること + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)`` が `true` であること +- (3), (6) : + - `key_compare::is_transparent`が妥当な修飾IDであり、型を示すこと + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)`` が `true` であること + - [`is_assignable_v`](/reference/type_traits/is_assignable.md)`` が `true` であること + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)`` が `true` であること + +なお、規格に記載はないが、`hint` は [`emplace_hint`](emplace_hint.md) と同様、コンテナの有効な読み取り専用イテレータである必要があるものと思われる。 + + +## 事前条件 +- (3), (6) : + - `key_type`に変換した`k`を`u`として、[`find`](find.md)`(k) ==` [`find`](find.md)`(u)`が`true`であること + + +## 効果 +- (1), (2), (3) : + - `k`と等価なキーをもつ要素`e`が存在している場合、[`std::forward`](/reference/utility/forward.md)`(obj)`を`e.second`に代入する + - そうでなければ、以下と等価: + ```cpp + try_emplace(std::forward(k), std::forward(obj)); + ``` + * try_emplace[link try_emplace.md] + * std::forward[link /reference/utility/forward.md] + +- (4), (5), (6) : + - `k`と等価なキーをもつ要素`e`が存在している場合、[`std::forward`](/reference/utility/forward.md)`(obj)`を`e.second`に代入する + - そうでなければ、以下と等価: + ```cpp + try_emplace_hint(hint, std::forward(k), std::forward(obj)); + ``` + * try_emplace_hint[link try_emplace.md] + * std::forward[link /reference/utility/forward.md] + + +## 戻り値 +- (1)、(2)、(3) : イテレータと `bool` 値の [`pair`](/reference/utility/pair.md) を返す。 + - 挿入された場合には、`first` に挿入された要素へのイテレータ、`second` に `true` が設定される。 + - 代入された場合には、`first` に代入された要素へのイテレータ、`second` に `false` が設定される。 +- (4)、(5)、(6) : + - 挿入された場合には、挿入された要素へのイテレータを返す。 + - 代入された場合には、代入された要素へのイテレータを返す。 + + +## 計算量 +- (1)、(2)、(3) : [`emplace`](emplace.md) と同じ +- (4)、(5)、(6) : [`emplace_hint`](emplace_hint.md) と同じ + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::flat_map fm; + + auto [it1, b1] = fm.insert_or_assign("foo", 42); + std::cout << '(' << it1->first << ", " << it1->second << "), " << std::boolalpha << b1 << '\n'; + + auto [it2, b2] = fm.insert_or_assign("foo", 0); + std::cout << '(' << it2->first << ", " << it2->second << "), " << std::boolalpha << b2 << '\n'; +} +``` +* insert_or_assign[color ff0000] + +### 出力 +``` +(foo, 42), true +(foo, 0), false +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|------------------------------------------------|--------------------------------------------| +| [`flat_map::insert`](insert.md) | 要素を挿入する | +| [`flat_map::insert_range`](insert_range.md) | Rangeを挿入する | +| [`flat_map::emplace`](emplace.md) | 要素を直接構築する | +| [`flat_map::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | +| [`flat_map::try_emplace`](try_emplace.md) | キーが存在しない場合のみ要素を直接構築する | + diff --git a/reference/flat_map/flat_map/insert_range.md b/reference/flat_map/flat_map/insert_range.md index 7962278bf1..9abdd94079 100644 --- a/reference/flat_map/flat_map/insert_range.md +++ b/reference/flat_map/flat_map/insert_range.md @@ -113,7 +113,7 @@ int main() | 名前 | 説明 | |------------------------------------------------|--------------------------------------------| | [`flat_map::insert`](insert.md) | 要素を挿入する | -| [`flat_map::insert_or_assign`](insert_or_assign.md.nolink) | 要素を挿入、あるいは代入する | +| [`flat_map::insert_or_assign`](insert_or_assign.md) | 要素を挿入、あるいは代入する | | [`flat_map::emplace`](emplace.md) | 要素を直接構築する | | [`flat_map::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | | [`flat_map::try_emplace`](try_emplace.md) | キーが存在しない場合のみ要素を直接構築する | diff --git a/reference/flat_map/flat_map/try_emplace.md b/reference/flat_map/flat_map/try_emplace.md index dea4790f43..8cc66c14c6 100644 --- a/reference/flat_map/flat_map/try_emplace.md +++ b/reference/flat_map/flat_map/try_emplace.md @@ -172,7 +172,8 @@ false, 114, false | 名前 | 説明 | |------------------------------------------------|--------------------------------------------| | [`flat_map::insert`](insert.md) | 要素を挿入する | -| [`flat_map::insert_or_assign`](insert_or_assign.md.nolink) | 要素を挿入、あるいは代入する | +| [`flat_map::insert_range`](insert_range.md) | Rangeを挿入する | +| [`flat_map::insert_or_assign`](insert_or_assign.md) | 要素を挿入、あるいは代入する | | [`flat_map::emplace`](emplace.md) | 要素を直接構築する | | [`flat_map::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | From cd883d1560a5608d4f3d2df4dec093706a84c305 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 17 Aug 2023 17:15:40 +0900 Subject: [PATCH 0421/3948] =?UTF-8?q?flat=5Fmap::insert=5For=5Fassign=20:?= =?UTF-8?q?=20=E8=BB=A2=E9=80=81=E5=8F=82=E7=85=A7=E3=81=AF=E4=B8=80?= =?UTF-8?q?=E6=99=82=E3=82=AA=E3=83=96=E3=82=B8=E3=82=A7=E3=82=AF=E3=83=88?= =?UTF-8?q?=E3=81=A7=E3=81=AF=E3=81=AA=E3=81=8B=E3=81=A3=E3=81=9F=20#1078?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map/insert_or_assign.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/flat_map/flat_map/insert_or_assign.md b/reference/flat_map/flat_map/insert_or_assign.md index 39a0fad212..0a0328719b 100644 --- a/reference/flat_map/flat_map/insert_or_assign.md +++ b/reference/flat_map/flat_map/insert_or_assign.md @@ -48,10 +48,10 @@ iterator - (1) : `key_type`型のキーをとって挿入もしくは代入する - (2) : `key_type`型の一時オブジェクトのキーをとって挿入もしくは代入する -- (3) : `key_type`に変換可能な型の一時オブジェクトのキーをとって挿入もしくは代入する +- (3) : `key_type`に変換可能な型のキーをとって挿入もしくは代入する - (4) : 挿入位置のヒントをともない、`key_type`型のキーをとって挿入もしくは代入する - (5) : 挿入位置のヒントをともない、`key_type`型の一時オブジェクトのキーをとって挿入もしくは代入する -- (6) : 挿入位置のヒントをともない、`key_type`に変換可能な型の一時オブジェクトのキーをとって挿入もしくは代入する +- (6) : 挿入位置のヒントをともない、`key_type`に変換可能な型のキーをとって挿入もしくは代入する ## テンプレートパラメータ制約 From 21d60b4cf25bad0eeb02c8fc48169f6aca8a8b08 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 17 Aug 2023 17:16:18 +0900 Subject: [PATCH 0422/3948] =?UTF-8?q?map::insert=5For=5Fassign=20:=20?= =?UTF-8?q?=E3=82=AA=E3=83=BC=E3=83=90=E3=83=BC=E3=83=AD=E3=83=BC=E3=83=89?= =?UTF-8?q?=E3=81=AE=E6=A6=82=E8=A6=81=E6=96=87=E7=AB=A0=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/map/map/insert_or_assign.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reference/map/map/insert_or_assign.md b/reference/map/map/insert_or_assign.md index 331a6187f3..22eead3982 100644 --- a/reference/map/map/insert_or_assign.md +++ b/reference/map/map/insert_or_assign.md @@ -25,6 +25,11 @@ iterator insert_or_assign(const_iterator hint, key_type&& k, M&& obj); 引数 `hint` は、`k` を検索する際のヒントに使用される。 +- (1) : `key_type`型のキーをとって挿入もしくは代入する +- (2) : `key_type`型の一時オブジェクトのキーをとって挿入もしくは代入する +- (3) : 挿入位置のヒントをともない、`key_type`型のキーをとって挿入もしくは代入する +- (4) : 挿入位置のヒントをともない、`key_type`型の一時オブジェクトのキーをとって挿入もしくは代入する + ## テンプレートパラメータ制約 - (1)、(3) : [`is_assignable_v`](/reference/type_traits/is_assignable.md)`` が `true` であること。`value_type` は、`k`, [`forward`](/reference/utility/forward.md)`(obj)` から `map` に直接構築可能であること From 176e5a6c507f0297020a9ce423ff3fe6f78827f3 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 18 Aug 2023 14:45:41 +0900 Subject: [PATCH 0423/3948] =?UTF-8?q?map::lower=5Fbound,=20upper=5Fbound,?= =?UTF-8?q?=20equal=5Frange=20:=20=E3=82=AA=E3=83=BC=E3=83=90=E3=83=BC?= =?UTF-8?q?=E3=83=AD=E3=83=BC=E3=83=89=E6=A6=82=E8=A6=81=E3=81=A8=E3=83=AA?= =?UTF-8?q?=E3=83=B3=E3=82=AF=E3=82=92=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/map/map/equal_range.md | 20 +++++++++++--------- reference/map/map/lower_bound.md | 18 ++++++++++-------- reference/map/map/upper_bound.md | 18 ++++++++++-------- 3 files changed, 31 insertions(+), 25 deletions(-) diff --git a/reference/map/map/equal_range.md b/reference/map/map/equal_range.md index ebfc2bfa7b..062369cd34 100644 --- a/reference/map/map/equal_range.md +++ b/reference/map/map/equal_range.md @@ -22,18 +22,20 @@ pair ## 概要 コンテナ内の、`x` と等しいキー要素を全て含む範囲の境界を返す。`map` コンテナではキーの重複は無いため、この範囲は最大一つの要素を含む。 -もし `x` がコンテナ内のどのキーともマッチしなかった場合、戻り値の範囲は長さ 0 になり、両方のイテレータは `x` より大きく最も近い値を指す。そうでない場合、`x` がコンテナ内の全ての要素よりも大きい場合は [`end`](/reference/map/map/end.md) を指す。 +もし `x` がコンテナ内のどのキーともマッチしなかった場合、戻り値の範囲は長さ 0 になり、両方のイテレータは `x` より大きく最も近い値を指す。そうでない場合、`x` がコンテナ内の全ての要素よりも大きい場合は [`end`](/end.md) を指す。 -- (1), (3) : `key_type`型のキーを受け取り、そのキーと等価なキー要素を全て含むイテレータ範囲を取得する。 -- (2), (4) : `key_type`と比較可能な`K`型のキーを受け取り、そのキーと等価なキー要素を全て含むイテレータ範囲を取得する。 +- (1) : `key_type`型のキーを受け取り、そのキーと等価なキー要素を全て含むイテレータ範囲を取得する。 +- (2) : `key_type`と比較可能な`K`型のキーを受け取り、そのキーと等価なキー要素を全て含むイテレータ範囲を取得する。 +- (3) : `const`な`*this`オブジェクトにおいて、`key_type`型のキーを受け取り、そのキーと等価なキー要素を全て含むイテレータ範囲を取得する。 +- (4) : `const`な`*this`オブジェクトにおいて、`key_type`と比較可能な`K`型のキーを受け取り、そのキーと等価なキー要素を全て含むイテレータ範囲を取得する。 ## 戻り値 -この関数は `pair` を返す。ここで `pair::first` は [`lower_bound`](lower_bound.md)`(x)` が返すであろう値と同じ値で範囲の下境界にあたり、`pair::second` は [`upper_bound`](/reference/map/map/upper_bound.md)`(x)` が返すであろう値と同じ値で範囲の上境界にあたる。 +この関数は `pair` を返す。ここで `pair::first` は [`lower_bound`](lower_bound.md)`(x)` が返すであろう値と同じ値で範囲の下境界にあたり、`pair::second` は [`upper_bound`](upper_bound.md)`(x)` が返すであろう値と同じ値で範囲の上境界にあたる。 ## 計算量 -[`size`](/reference/map/map/size.md) について対数時間。 +[`size`](size.md) について対数時間。 ## 備考 @@ -75,10 +77,10 @@ B,1 | 名前 | 説明 | |-------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------| -| [`map::count`](/reference/map/map/count.md) | 指定したキーにマッチする要素の数を返す | -| [`map::lower_bound`](/reference/map/map/lower_bound.md) | 与えられた値より小さくない最初の要素へのイテレータを返す | -| [`map::upper_bound`](/reference/map/map/upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | -| [`map::find`](/reference/map/map/find.md) | 指定したキーで要素を探す | +| [`map::count`](count.md) | 指定したキーにマッチする要素の数を返す | +| [`map::lower_bound`](lower_bound.md) | 与えられた値より小さくない最初の要素へのイテレータを返す | +| [`map::upper_bound`](upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | +| [`map::find`](find.md) | 指定したキーで要素を探す | ## 参照 diff --git a/reference/map/map/lower_bound.md b/reference/map/map/lower_bound.md index 4c1ad305fd..52298b0a41 100644 --- a/reference/map/map/lower_bound.md +++ b/reference/map/map/lower_bound.md @@ -19,12 +19,14 @@ const_iterator lower_bound(const K& x) const; // (4) C++14 ## 概要 `x` を右辺とする `<` 演算が成り立たない最初の要素を指すイテレータを返す(コンテナの比較オブジェクトが使われる)。すなわちこれは `>=` 演算にあたる。 -[`upper_bound()`](/reference/map/map/upper_bound.md) とは異なり、このメンバ関数は `x` より大きいだけでなく、`x` と等しい場合であってもその要素へのイテレータを返す。 +[`upper_bound()`](upper_bound.md) とは異なり、このメンバ関数は `x` より大きいだけでなく、`x` と等しい場合であってもその要素へのイテレータを返す。 内部的には `map` コンテナ内の全ての要素は常に比較オブジェクトが定義する基準に沿って並んでいるため、この関数が返すいずれかの後に続く全ての要素が `x` より大きいか等しいことに注意。 -- (1), (3) : `key_type`型のキーを受け取り、そのキーより小さくない最初の要素へのイテレータを取得する。 -- (2), (4) : `key_type`と比較可能な`K`型のキーを受け取り、そのキーより小さくない最初の要素へのイテレータを取得する。 +- (1) : `key_type`型のキーを受け取り、そのキーより小さくない最初の要素へのイテレータを取得する。 +- (2) : `key_type`と比較可能な`K`型のキーを受け取り、そのキーより小さくない最初の要素へのイテレータを取得する。 +- (3) : `const`な`*this`オブジェクトにおいて、`key_type`型のキーを受け取り、そのキーより小さくない最初の要素へのイテレータを取得する。 +- (4) : `const`な`*this`オブジェクトにおいて、`key_type`と比較可能な`K`型のキーを受け取り、そのキーより小さくない最初の要素へのイテレータを取得する。 ## 戻り値 @@ -33,7 +35,7 @@ const_iterator lower_bound(const K& x) const; // (4) C++14 ## 計算量 -[`size()`](/reference/map/map/size.md) について対数時間。 +[`size()`](size.md) について対数時間。 ## 備考 @@ -109,10 +111,10 @@ D,5 | 名前 | 説明 | |-------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------| -| [`upper_bound`](/reference/map/map/upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | -| [`equal_range`](/reference/map/map/equal_range.md) | 指定したキーにマッチする要素範囲を返す | -| [`find`](/reference/map/map/find.md) | 指定したキーで要素を探す | -| [`count`](/reference/map/map/count.md) | 指定したキーにマッチする要素の数を返す | +| [`upper_bound`](upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | +| [`equal_range`](equal_range.md) | 指定したキーにマッチする要素範囲を返す | +| [`find`](find.md) | 指定したキーで要素を探す | +| [`count`](count.md) | 指定したキーにマッチする要素の数を返す | ## 参照 diff --git a/reference/map/map/upper_bound.md b/reference/map/map/upper_bound.md index 115075f407..6fa5b335d7 100644 --- a/reference/map/map/upper_bound.md +++ b/reference/map/map/upper_bound.md @@ -19,12 +19,14 @@ const_iterator upper_bound(const K& x) const; // (4) C++14 ## 概要 `x` より大きいキーを持つコンテナ内の最初の要素を指すイテレータを返す(コンテナの比較オブジェクトを使う)。 -[`lower_bound()`](/reference/map/map/lower_bound.md) と異なり、このメンバ関数は `x` と等しいときは要素へのイテレータを返さず、それは大きい場合にのみ要素へのイテレータを返す。 +[`lower_bound()`](lower_bound.md) と異なり、このメンバ関数は `x` と等しいときは要素へのイテレータを返さず、それは大きい場合にのみ要素へのイテレータを返す。 内部的に、`map` コンテナ内の全ての要素は常に比較オブジェクトで定義された基準に従って並ぶため、この関数が返す値に続く全ての要素は `x` より大きいことに注意。 -- (1), (3) : `key_type`型のキーを受け取り、そのキーより大きい最初の要素へのイテレータを取得する。 -- (2), (4) : `key_type`と比較可能な`K`型のキーを受け取り、そのキーより大きい最初の要素へのイテレータを取得する。 +- (1) : `key_type`型のキーを受け取り、そのキーより大きい最初の要素へのイテレータを取得する。 +- (2) : `key_type`と比較可能な`K`型のキーを受け取り、そのキーより大きい最初の要素へのイテレータを取得する。 +- (3) : `const`な`*this`オブジェクトにおいて、`key_type`型のキーを受け取り、そのキーより大きい最初の要素へのイテレータを取得する。 +- (4) : `const`な`*this`オブジェクトにおいて、`key_type`と比較可能な`K`型のキーを受け取り、そのキーより大きい最初の要素へのイテレータを取得する。 ## 戻り値 @@ -33,7 +35,7 @@ const_iterator upper_bound(const K& x) const; // (4) C++14 ## 計算量 -[`size()`](/reference/map/map/size.md) について対数時間。 +[`size()`](size.md) について対数時間。 ## 備考 @@ -109,10 +111,10 @@ D,5 | 名前 | 説明 | |-------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------| -| [`lower_bound`](/reference/map/map/lower_bound.md) | 与えられた値よりも小さくない最初の要素へのイテレータを返す | -| [`equal_range`](/reference/map/map/equal_range.md) | 指定したキーにマッチする要素範囲を返す | -| [`find`](/reference/map/map/find.md) | 指定したキーで要素を探す | -| [`count`](/reference/map/map/count.md) | 指定したキーにマッチする要素の数を返す | +| [`lower_bound`](lower_bound.md) | 与えられた値よりも小さくない最初の要素へのイテレータを返す | +| [`equal_range`](equal_range.md) | 指定したキーにマッチする要素範囲を返す | +| [`find`](find.md) | 指定したキーで要素を探す | +| [`count`](count.md) | 指定したキーにマッチする要素の数を返す | ## 参照 From d210ea7ae2005bc551bb475f8f29e3d2eb36458d Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 18 Aug 2023 14:53:30 +0900 Subject: [PATCH 0424/3948] =?UTF-8?q?flat=5Fmap=20:=20lower=5Fbound,=20upp?= =?UTF-8?q?er=5Fbound,=20equal=5Frange=E3=82=92=E8=BF=BD=E5=8A=A0=20#1078?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map.md | 6 +- reference/flat_map/flat_map/equal_range.md | 85 +++++++++++++++ reference/flat_map/flat_map/lower_bound.md | 119 +++++++++++++++++++++ reference/flat_map/flat_map/upper_bound.md | 119 +++++++++++++++++++++ reference/map/map/equal_range.md | 2 +- 5 files changed, 327 insertions(+), 4 deletions(-) create mode 100644 reference/flat_map/flat_map/equal_range.md create mode 100644 reference/flat_map/flat_map/lower_bound.md create mode 100644 reference/flat_map/flat_map/upper_bound.md diff --git a/reference/flat_map/flat_map.md b/reference/flat_map/flat_map.md index 1f8d0b0ba5..8eb87457bc 100644 --- a/reference/flat_map/flat_map.md +++ b/reference/flat_map/flat_map.md @@ -79,9 +79,9 @@ namespace std { | [`count`](flat_map/count.md) | 指定したキーにマッチする要素の数を取得する | C++23 | | [`find`](flat_map/find.md) | 指定したキーで要素を探す | C++23 | | [`contains`](flat_map/contains.md) | 指定したキーの要素が含まれているかを判定する | C++23 | -| [`equal_range`](flat_map/equal_range.md.nolink) | 指定したキーにマッチする要素範囲を取得する | C++23 | -| [`lower_bound`](flat_map/lower_bound.md.nolink) | 与えられた値より小さくない最初の要素へのイテレータを取得する | C++23 | -| [`upper_bound`](flat_map/upper_bound.md.nolink) | 特定の値よりも大きい最初の要素へのイテレータを取得する | C++23 | +| [`equal_range`](flat_map/equal_range.md) | 指定したキーにマッチする要素範囲を取得する | C++23 | +| [`lower_bound`](flat_map/lower_bound.md) | 与えられた値より小さくない最初の要素へのイテレータを取得する | C++23 | +| [`upper_bound`](flat_map/upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを取得する | C++23 | ### オブザーバー diff --git a/reference/flat_map/flat_map/equal_range.md b/reference/flat_map/flat_map/equal_range.md new file mode 100644 index 0000000000..7fb856d0b2 --- /dev/null +++ b/reference/flat_map/flat_map/equal_range.md @@ -0,0 +1,85 @@ +# equal_range +* flat_map[meta header] +* std[meta namespace] +* flat_map[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +pair equal_range(const key_type& x); // (1) C++23 + +template +pair equal_range(const K& x); // (2) C++23 + +pair + equal_range(const key_type& x) const; // (3) C++23 + +template +pair + equal_range(const K& x) const; // (4) C++23 +``` +* pair[link /reference/utility/pair.md] + +## 概要 +コンテナ内の、`x` と等しいキー要素を全て含む範囲の境界を返す。`map` コンテナではキーの重複は無いため、この範囲は最大一つの要素を含む。 + +もし `x` がコンテナ内のどのキーともマッチしなかった場合、戻り値の範囲は長さ 0 になり、両方のイテレータは `x` より大きく最も近い値を指す。そうでない場合、`x` がコンテナ内の全ての要素よりも大きい場合は [`end`](end.md) を指す。 + +- (1) : `key_type`型のキーを受け取り、そのキーと等価なキー要素を全て含むイテレータ範囲を取得する。 +- (2) : `key_type`と比較可能な`K`型のキーを受け取り、そのキーと等価なキー要素を全て含むイテレータ範囲を取得する。 +- (3) : `const`な`*this`オブジェクトにおいて、`key_type`型のキーを受け取り、そのキーと等価なキー要素を全て含むイテレータ範囲を取得する。 +- (4) : `const`な`*this`オブジェクトにおいて、`key_type`と比較可能な`K`型のキーを受け取り、そのキーと等価なキー要素を全て含むイテレータ範囲を取得する。 + + +## 戻り値 +この関数は `pair` を返す。ここで `pair::first` は [`lower_bound`](lower_bound.md)`(x)` が返すであろう値と同じ値で範囲の下境界にあたり、`pair::second` は [`upper_bound`](upper_bound.md)`(x)` が返すであろう値と同じ値で範囲の上境界にあたる。 + + +## 計算量 +[`size`](size.md) について対数時間。 + + +## 備考 +- (2), (4) : この関数がオーバーロード解決に参加する条件は、[`find()`](find.md)メンバ関数の備考欄を参照。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::flat_map fm = { + {"A", 3}, + {"B", 1}, + {"C", 4}, + {"D", 5} + }; + + using iterator = decltype(fm)::iterator; + std::pair ret = fm.equal_range("B"); + + for (iterator it = ret.first; it != ret.second; ++it) { + std::cout << it->first << "," << it->second << std::endl; + } +} +``` +* equal_range[color ff0000] + +### 出力 +``` +B,1 +``` + + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------| +| [`flat_map::count`](count.md) | 指定したキーにマッチする要素の数を返す | +| [`flat_map::lower_bound`](lower_bound.md) | 与えられた値より小さくない最初の要素へのイテレータを返す | +| [`flat_map::upper_bound`](upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | +| [`flat_map::find`](find.md) | 指定したキーで要素を探す | + diff --git a/reference/flat_map/flat_map/lower_bound.md b/reference/flat_map/flat_map/lower_bound.md new file mode 100644 index 0000000000..092a2e6b9a --- /dev/null +++ b/reference/flat_map/flat_map/lower_bound.md @@ -0,0 +1,119 @@ +# lower_bound +* flat_map[meta header] +* std[meta namespace] +* flat_map[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +iterator lower_bound(const key_type& x); // (1) C++23 + +template +iterator lower_bound(const K& x); // (2) C++23 + +const_iterator lower_bound(const key_type& x) const; // (3) C++23 + +template +const_iterator lower_bound(const K& x) const; // (4) C++23 +``` + +## 概要 +`x` を右辺とする `<` 演算が成り立たない最初の要素を指すイテレータを返す(コンテナの比較オブジェクトが使われる)。すなわちこれは `>=` 演算にあたる。 + +[`upper_bound()`](upper_bound.md) とは異なり、このメンバ関数は `x` より大きいだけでなく、`x` と等しい場合であってもその要素へのイテレータを返す。 + +内部的には `map` コンテナ内の全ての要素は常に比較オブジェクトが定義する基準に沿って並んでいるため、この関数が返すいずれかの後に続く全ての要素が `x` より大きいか等しいことに注意。 + +- (1) : `key_type`型のキーを受け取り、そのキーより小さくない最初の要素へのイテレータを取得する。 +- (2) : `key_type`と比較可能な`K`型のキーを受け取り、そのキーより小さくない最初の要素へのイテレータを取得する。 +- (3) : `const`な`*this`オブジェクトにおいて、`key_type`型のキーを受け取り、そのキーより小さくない最初の要素へのイテレータを取得する。 +- (4) : `const`な`*this`オブジェクトにおいて、`key_type`と比較可能な`K`型のキーを受け取り、そのキーより小さくない最初の要素へのイテレータを取得する。 + + +## 戻り値 +- (1), (3) : コンテナ内で `x` を右辺とする `<` 演算が成り立たない最初の要素へのイテレータを返す。そのような要素がない場合は、[`end()`](end.md)を返す。 +- (2), (4) : `key_compare`型の関数オブジェクトを`c`、コンテナ内の各要素が持つキーを`k`として、キーが小さくないか判定する式`!c(k, x)`が`true`となる要素へのイテレータを返す。そのような要素がない場合は、[`end()`](end.md) を返す。 + + +## 計算量 +[`size()`](size.md) について対数時間。 + + +## 備考 +- (2), (4) : この関数がオーバーロード解決に参加する条件は、[`find()`](find.md)メンバ関数の備考欄を参照。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + // (1) + { + std::flat_map fm = { + {"A", 3}, + {"B", 1}, + {"C", 4}, + {"D", 5} + }; + + // B以上D以下の範囲を取得 + decltype(fm)::iterator it = fm.lower_bound("B"); + decltype(fm)::iterator last = fm.upper_bound("D"); + + while (it != last) { + std::cout << it->first << ',' << it->second << std::endl; + ++it; + } + std::cout << std::endl; + } + + // (2) + { + std::flat_map> fm = { + {"A", 3}, + {"B", 1}, + {"C", 4}, + {"D", 5} + }; + + // std::lessのvoidに対する特殊化を使用することで、 + // 文字列リテラルをlower_bound()関数の引数として渡した際に、 + // std::string型の一時オブジェクトが生成されない。 + decltype(fm)::iterator it = fm.lower_bound("B"); + decltype(fm)::iterator last = fm.upper_bound("D"); + + while (it != last) { + std::cout << it->first << "," << it->second << std::endl; + ++it; + } + } +} +``` +* lower_bound[color ff0000] +* fm.upper_bound[link upper_bound.md] +* std::less[link /reference/functional/less.md] + +### 出力 +``` +B,1 +C,4 +D,5 + +B,1 +C,4 +D,5 +``` + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------| +| [`upper_bound`](upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | +| [`equal_range`](equal_range.md) | 指定したキーにマッチする要素範囲を返す | +| [`find`](find.md) | 指定したキーで要素を探す | +| [`count`](count.md) | 指定したキーにマッチする要素の数を返す | + diff --git a/reference/flat_map/flat_map/upper_bound.md b/reference/flat_map/flat_map/upper_bound.md new file mode 100644 index 0000000000..6ec16277b6 --- /dev/null +++ b/reference/flat_map/flat_map/upper_bound.md @@ -0,0 +1,119 @@ +# upper_bound +* flat_map[meta header] +* std[meta namespace] +* flat_map[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +iterator upper_bound(const key_type& x); // (1) C++23 + +template +iterator upper_bound(const K& x); // (2) C++23 + +const_iterator upper_bound(const key_type& x) const; // (3) C++23 + +template +const_iterator upper_bound(const K& x) const; // (4) C++23 +``` + +## 概要 +`x` より大きいキーを持つコンテナ内の最初の要素を指すイテレータを返す(コンテナの比較オブジェクトを使う)。 + +[`lower_bound()`](lower_bound.md) と異なり、このメンバ関数は `x` と等しいときは要素へのイテレータを返さず、それは大きい場合にのみ要素へのイテレータを返す。 + +内部的に、`map` コンテナ内の全ての要素は常に比較オブジェクトで定義された基準に従って並ぶため、この関数が返す値に続く全ての要素は `x` より大きいことに注意。 + +- (1) : `key_type`型のキーを受け取り、そのキーより大きい最初の要素へのイテレータを取得する。 +- (2) : `key_type`と比較可能な`K`型のキーを受け取り、そのキーより大きい最初の要素へのイテレータを取得する。 +- (3) : `const`な`*this`オブジェクトにおいて、`key_type`型のキーを受け取り、そのキーより大きい最初の要素へのイテレータを取得する。 +- (4) : `const`な`*this`オブジェクトにおいて、`key_type`と比較可能な`K`型のキーを受け取り、そのキーより大きい最初の要素へのイテレータを取得する。 + + +## 戻り値 +- (1), (3) : キー`x`より大きい最初の要素へのイテレータを返す。そのような要素がない場合は、[`end()`](end.md)を返す。 +- (2), (4) : `key_compare`型の関数オブジェクトを`c`、コンテナ内の各要素が持つキーを`k`として、キーが小さくないか判定する式`c(x, k)`が`true`となる要素へのイテレータを返す。そのような要素がない場合は、[`end()`](end.md) を返す。 + + +## 計算量 +[`size()`](size.md) について対数時間。 + + +## 備考 +- (2), (4) : この関数がオーバーロード解決に参加する条件は、[`find()`](find.md)メンバ関数の備考欄を参照。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + // (1) + { + std::flat_map fm = { + {"A", 3}, + {"B", 1}, + {"C", 4}, + {"D", 5} + }; + + // B以上D以下の範囲を取得 + decltype(fm)::iterator it = fm.lower_bound("B"); + decltype(fm)::iterator last = fm.upper_bound("D"); + + while (it != last) { + std::cout << it->first << ',' << it->second << std::endl; + ++it; + } + std::cout << std::endl; + } + + // (2) + { + std::flat_map> fm = { + {"A", 3}, + {"B", 1}, + {"C", 4}, + {"D", 5} + }; + + // std::lessのvoidに対する特殊化を使用することで、 + // 文字列リテラルをlower_bound()関数の引数として渡した際に、 + // std::string型の一時オブジェクトが生成されない。 + decltype(fm)::iterator it = fm.lower_bound("B"); + decltype(fm)::iterator last = fm.upper_bound("D"); + + while (it != last) { + std::cout << it->first << "," << it->second << std::endl; + ++it; + } + } +} +``` +* upper_bound[color ff0000] +* fm.lower_bound[link lower_bound.md] +* std::less[link /reference/functional/less.md] + +### 出力 +``` +B,1 +C,4 +D,5 + +B,1 +C,4 +D,5 +``` + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------| +| [`lower_bound`](lower_bound.md) | 与えられた値よりも小さくない最初の要素へのイテレータを返す | +| [`equal_range`](equal_range.md) | 指定したキーにマッチする要素範囲を返す | +| [`find`](find.md) | 指定したキーで要素を探す | +| [`count`](count.md) | 指定したキーにマッチする要素の数を返す | + diff --git a/reference/map/map/equal_range.md b/reference/map/map/equal_range.md index 062369cd34..2705fc06a1 100644 --- a/reference/map/map/equal_range.md +++ b/reference/map/map/equal_range.md @@ -22,7 +22,7 @@ pair ## 概要 コンテナ内の、`x` と等しいキー要素を全て含む範囲の境界を返す。`map` コンテナではキーの重複は無いため、この範囲は最大一つの要素を含む。 -もし `x` がコンテナ内のどのキーともマッチしなかった場合、戻り値の範囲は長さ 0 になり、両方のイテレータは `x` より大きく最も近い値を指す。そうでない場合、`x` がコンテナ内の全ての要素よりも大きい場合は [`end`](/end.md) を指す。 +もし `x` がコンテナ内のどのキーともマッチしなかった場合、戻り値の範囲は長さ 0 になり、両方のイテレータは `x` より大きく最も近い値を指す。そうでない場合、`x` がコンテナ内の全ての要素よりも大きい場合は [`end`](end.md) を指す。 - (1) : `key_type`型のキーを受け取り、そのキーと等価なキー要素を全て含むイテレータ範囲を取得する。 - (2) : `key_type`と比較可能な`K`型のキーを受け取り、そのキーと等価なキー要素を全て含むイテレータ範囲を取得する。 From 7f2cc9c03b4d65c0b81a0e9106ce065c74a017ea Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 18 Aug 2023 17:10:35 +0900 Subject: [PATCH 0425/3948] =?UTF-8?q?flat=5Fmap=20:=20erase=5Fif=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20#1078?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map.md | 2 +- reference/flat_map/flat_map/erase_if_free.md | 80 ++++++++++++++++++++ reference/map/map/erase_if_free.md | 2 +- reference/map/multimap/erase_if_free.md | 2 +- 4 files changed, 83 insertions(+), 3 deletions(-) create mode 100644 reference/flat_map/flat_map/erase_if_free.md diff --git a/reference/flat_map/flat_map.md b/reference/flat_map/flat_map.md index 8eb87457bc..04eee438c6 100644 --- a/reference/flat_map/flat_map.md +++ b/reference/flat_map/flat_map.md @@ -121,7 +121,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`erase_if`](flat_map/erase_if_free.md.nolink) | 指定した条件に合致する要素とその分の領域を、コンテナから削除する | C++23 | +| [`erase_if`](flat_map/erase_if_free.md) | 指定した条件に合致する要素とその分の領域を、コンテナから削除する | C++23 | ## 非メンバ(*Hidden friends*)関数 diff --git a/reference/flat_map/flat_map/erase_if_free.md b/reference/flat_map/flat_map/erase_if_free.md new file mode 100644 index 0000000000..ff886ba089 --- /dev/null +++ b/reference/flat_map/flat_map/erase_if_free.md @@ -0,0 +1,80 @@ +# erase_if +* flat_map[meta header] +* std[meta namespace] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template + typename flat_map::size_type + erase_if(flat_map& c, + Predicate pred); +} +``` + +## 概要 +指定した条件に合致する要素とその分の領域を、コンテナから削除する。 + +述語関数オブジェクトには、キーではなく、要素全体 (キーと値の[`pair`](/reference/utility/pair.md)) が渡されるので注意。 + + +## 事前条件 +- `Key`と`T`がムーブ代入可能であること + + +## 効果 +メンバ変数として保持しているコンテナ`c`の各要素`e`について、`bool(pred(pair(e)))`を`E`として、`E`が`true`であるすべての要素を削除する。 + + +## 戻り値 +削除した要素数を返す。 + + +## 計算量 +正確に[`size()`](size.md)回だけ述語適用する。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_map fm = { + {3, 'a'}, + {1, 'b'}, + {4, 'c'} + }; + + // コンテナfmから、キー1をもつ要素をすべて削除する + std::erase_if(fm, [](const auto& x) { return x.first == 1; }); + + for (const auto& [key, value] : fm) { + std::cout << key << ':' << value << std::endl; + } +} +``` +* std::erase_if[color ff0000] + +### 出力 +``` +3:a +4:c +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + diff --git a/reference/map/map/erase_if_free.md b/reference/map/map/erase_if_free.md index f0ff43d5ef..46e3e79630 100644 --- a/reference/map/map/erase_if_free.md +++ b/reference/map/map/erase_if_free.md @@ -15,7 +15,7 @@ namespace std { ## 概要 指定した条件に合致する要素とその分の領域を、コンテナから削除する。 -述語関数オブジェクトには、キーではなく、要素全体 (キーと値の組) が渡されるので注意。 +述語関数オブジェクトには、キーではなく、要素全体 (キーと値の[`pair`](/reference/utility/pair.md)) が渡されるので注意。 ## 効果 diff --git a/reference/map/multimap/erase_if_free.md b/reference/map/multimap/erase_if_free.md index b891823c58..6f406c93d8 100644 --- a/reference/map/multimap/erase_if_free.md +++ b/reference/map/multimap/erase_if_free.md @@ -15,7 +15,7 @@ namespace std { ## 概要 指定した条件に合致する要素とその分の領域を、コンテナから削除する。 -述語関数オブジェクトには、キーではなく、要素全体 (キーと値の組) が渡されるので注意。 +述語関数オブジェクトには、キーではなく、要素全体 (キーと値の[`pair`](/reference/utility/pair.md)) が渡されるので注意。 ## 効果 From dbc5cfe81d457f717ed99511f72b79d01058a533 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Mon, 21 Aug 2023 12:31:52 +0900 Subject: [PATCH 0426/3948] =?UTF-8?q?const=5Fsentinel=E8=BF=BD=E5=8A=A0=20?= =?UTF-8?q?#1084?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator.md | 2 +- reference/iterator/const_sentinel.md | 60 ++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 reference/iterator/const_sentinel.md diff --git a/reference/iterator.md b/reference/iterator.md index e1692f44cc..4052c30c18 100644 --- a/reference/iterator.md +++ b/reference/iterator.md @@ -144,7 +144,7 @@ C++20以降の標準ライブラリでは、任意のイテレータに対して |----------------------------------------------------|------------------------------------------|-------| | [`basic_const_iterator`](iterator/basic_const_iterator.md) | イテレータの要素を`const`化するラッパーイテレータ(class template) | C++23 | | [`const_iterator`](iterator/const_iterator.md) | 要素が`const`化されたイテレータ型を取得する (alias template) | C++23 | -| [`const_sentinel`](iterator/const_sentinel.md.nolink) | 要素が`const`化された番兵型を取得する (alias template) | C++23 | +| [`const_sentinel`](iterator/const_sentinel.md) | 要素が`const`化された番兵型を取得する (alias template) | C++23 | | [`make_const_iterator`](iterator/make_const_iterator.md) | `const_iterator`オブジェクトを作るヘルパ関数(function template) | C++23 | | [`make_const_sentinel`](iterator/make_const_sentinel.md) | `const_sentinel`オブジェクトを作るヘルパ関数(function template) | C++23 | diff --git a/reference/iterator/const_sentinel.md b/reference/iterator/const_sentinel.md new file mode 100644 index 0000000000..591caab8ed --- /dev/null +++ b/reference/iterator/const_sentinel.md @@ -0,0 +1,60 @@ +# const_sentinel +* iterator[meta header] +* std[meta namespace] +* type-alias[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template + using const_sentinel = /*see below*?; +} +``` +* semiregular[link /reference/concepts/semiregular.md] + +## 概要 + +任意の番兵型`S`を、定数イテレータ型([`const_iterator`](const_iterator.md))に対応する番兵型へ変換する。 + +## 効果 + +- `S`が[`input_iterator`](input_iterator.md)のモデルとなる場合 : [`const_iterator`](const_iterator.md)`` +- それ以外の場合 : `S` + +## 例 +```cpp example +#include + +int main() { + static_assert(std::same_as, std::basic_const_iterator>); + static_assert(std::same_as, const int*>); + + using vec_iter = std::vector::iterator; + + static_assert(std::same_as, std::basic_const_iterator>); + static_assert(std::same_as>, std::const_iterator>); + + static_assert(std::same_as, std::default_sentinel_t>); + static_assert(std::same_as, std::unreachable_sentinel_t>); +} +``` +* std::const_sentinel[color ff0000] +* std::default_sentinel_t[link /reference/iterator/default_sentinel_t.md] +* std::unreachable_sentinel_t[link /reference/iterator/unreachable_sentinel_t.md] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) From cd417442096e21404c93b495684928e7c723f387 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Mon, 21 Aug 2023 12:33:10 +0900 Subject: [PATCH 0427/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/make_const_sentinel.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/iterator/make_const_sentinel.md b/reference/iterator/make_const_sentinel.md index c7f4bddb6f..8b8718daf7 100644 --- a/reference/iterator/make_const_sentinel.md +++ b/reference/iterator/make_const_sentinel.md @@ -11,7 +11,7 @@ namespace std { } ``` * semiregular[link /reference/concepts/semiregular.md] -* const_sentinel[link const_sentinel.md.nolink] +* const_sentinel[link const_sentinel.md] ## 概要 From 7fc8707529d50ce7434a3e2c012fb8835619360c Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Mon, 21 Aug 2023 12:40:41 +0900 Subject: [PATCH 0428/3948] =?UTF-8?q?make=5Fconst=5Fsentinel=20:=20?= =?UTF-8?q?=E8=A1=A8=E7=8F=BE=E3=81=A8=E3=82=B5=E3=83=B3=E3=83=97=E3=83=AB?= =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/make_const_sentinel.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/iterator/make_const_sentinel.md b/reference/iterator/make_const_sentinel.md index 8b8718daf7..3301702e8d 100644 --- a/reference/iterator/make_const_sentinel.md +++ b/reference/iterator/make_const_sentinel.md @@ -15,7 +15,7 @@ namespace std { ## 概要 -`basic_const_iterator`のヘルパ関数。特に、イテレータではないような番兵を`basic_const_iterator`の番兵型へと変換するのに使用する。 +`basic_const_iterator`のヘルパ関数。特に、イテレータではないような番兵を`basic_const_iterator`の番兵へと変換するのに使用する。 ## 戻り値 @@ -35,7 +35,7 @@ return s; int main() { std::vector vec = {1, 2, 3, 4, 11, 5, 6, 22}; - auto cit = std::make_const_iterator(rng.begin()); + auto cit = std::make_const_iterator(vec.begin()); auto cse = std::make_const_sentinel(std::unreachable_sentinel); // unreachable_sentinelはイテレータではない汎用の番兵 auto pos = std::ranges::find_if(cit, cse, [](auto& n) { From 209d36b8491f92ecfde0a8ef69fbed90c840e937 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 21 Aug 2023 17:25:06 +0900 Subject: [PATCH 0429/3948] =?UTF-8?q?=E3=82=B9=E3=83=9D=E3=83=B3=E3=82=B5?= =?UTF-8?q?=E3=83=BC=E6=9B=B4=E6=96=B0=20#1165?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.md b/index.md index cc9e87f9ac..7e2bb1d380 100644 --- a/index.md +++ b/index.md @@ -93,6 +93,8 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい

odan
+
unagi
+ - [Hashitaku様](https://opencollective.com/hashitaku)
yukika2e
From d66df9c2b327ff15e7692c432cdd3f61fb02bed8 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 22 Aug 2023 15:22:02 +0900 Subject: [PATCH 0430/3948] =?UTF-8?q?basic=5Fconst=5Fiterator=E3=81=AEcomm?= =?UTF-8?q?on=5Ftype=E7=89=B9=E6=AE=8A=E5=8C=96=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20#1084?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/basic_const_iterator.md | 7 ++ .../basic_const_iterator/common_type.md | 85 +++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 reference/iterator/basic_const_iterator/common_type.md diff --git a/reference/iterator/basic_const_iterator.md b/reference/iterator/basic_const_iterator.md index 8dba4ef6bb..e3784acf17 100644 --- a/reference/iterator/basic_const_iterator.md +++ b/reference/iterator/basic_const_iterator.md @@ -81,6 +81,13 @@ namespace std { | [`make_const_iterator`](make_const_iterator.md) | `basic_const_iterator`のヘルパ関数 | C++23 | | [`make_const_sentinel`](make_const_sentinel.md) | `basic_const_iterator`のヘルパ関数 | C++23 | +## 特殊化 + +| 名前 | 説明 | 対応バージョン | +|------------------------------------------------------|-------------|-------| +| [`common_type`](basic_const_iterator/common_type.md) | `basic_const_iterator`とイテレータ型の間の共通の型を求める | C++23 | + + ## 例 ```cpp example diff --git a/reference/iterator/basic_const_iterator/common_type.md b/reference/iterator/basic_const_iterator/common_type.md new file mode 100644 index 0000000000..5d81e461ae --- /dev/null +++ b/reference/iterator/basic_const_iterator/common_type.md @@ -0,0 +1,85 @@ +# common_type +* iterator[meta header] +* std[meta namespace] +* class template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + // (1) + template U> + requires input_iterator> + struct common_type, U> { + using type = basic_const_iterator>; + }; + + // (2) + template U> + requires input_iterator> + struct common_type> { + using type = basic_const_iterator>; + }; + + // (3) + template U> + requires input_iterator> + struct common_type, basic_const_iterator> { + using type = basic_const_iterator>; + }; +} +``` +* common_with[link /reference/concepts/common_with.md] +* input_iterator[link ./input_iterator.md] +* common_type[link /reference/type_traits/common_type.md] +* common_type_t[link /reference/type_traits/common_type.md] + +## 概要 + +`basic_const_iterator`のための[`common_type`](/reference/type_traits/common_type.md)特殊化。 + +- (1)(2) : `basic_const_iterator`とその他のイテレータ型の間の共通の型を取得する +- (3) : 異なるイテレータ型による`basic_const_iterator`特殊化の間の共通の型を取得する + +## 例 +```cpp example +#include + +int main() { + using ct1 = std::common_type_t>; + + static_assert(std::same_as>); + + using ct2 = std::common_type_t, int*>; + + static_assert(std::same_as); + + using ct3 = std::common_type_t>; + + static_assert(std::same_as>); + + using ct4 = std::common_type_t, std::basic_const_iterator>; + + static_assert(std::same_as>); +} +``` + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 関連項目 + +- [`common_type`](/reference/type_traits/common_type.md) + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) From 21a2be5d6f6cb36c66283404efb5cd27bd370573 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 22 Aug 2023 15:25:15 +0900 Subject: [PATCH 0431/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/basic_const_iterator/common_type.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/iterator/basic_const_iterator/common_type.md b/reference/iterator/basic_const_iterator/common_type.md index 5d81e461ae..cc4aa27de6 100644 --- a/reference/iterator/basic_const_iterator/common_type.md +++ b/reference/iterator/basic_const_iterator/common_type.md @@ -29,7 +29,7 @@ namespace std { } ``` * common_with[link /reference/concepts/common_with.md] -* input_iterator[link ./input_iterator.md] +* input_iterator[link /reference/iterator/input_iterator.md] * common_type[link /reference/type_traits/common_type.md] * common_type_t[link /reference/type_traits/common_type.md] From 03ff5892fe0aa4fb8b8bdcdbba77fec13360c9de Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 23 Aug 2023 00:05:38 +0900 Subject: [PATCH 0432/3948] type_traits/is_pod: fix typo --- reference/type_traits/is_pod.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/type_traits/is_pod.md b/reference/type_traits/is_pod.md index 00a11495f7..230511dfaf 100644 --- a/reference/type_traits/is_pod.md +++ b/reference/type_traits/is_pod.md @@ -89,6 +89,6 @@ int main(){} - [LWG Issue 2015. Incorrect pre-conditions for some type traits](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2015) - C++11では要件が「型`T`は完全型であるか、`const`/`volatile`修飾された(あるいはされていない)`void`か、要素数不明の配列型でなければならない。」だったが、これは間違いであるため、C++14で「型[`remove_all_extents`](remove_all_extents.md)`::type`は、完全型か、`const`/`volatile`修飾された(あるいはされていない)`void`でなければならない。」に変更された。 - [P0006R0 Adopt Type Traits Variable Templates from Library Fundamentals TS for C++17](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0006r0.html) -- [CGW issue 2323. Expunge POD](https://wg21.cmeerw.net/cwg/issue2323) +- [CWG issue 2323. Expunge POD](https://wg21.cmeerw.net/cwg/issue2323) - [P0488R0 WG21 Working Paper, NB Comments, ISO/IEC CD 14882 #US 101](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0488r0.pdf#US101) - [P0767R1: Deprecate POD](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0767r1.html) From 86bab47aa01fce293636c43725a8d0d017f47c06 Mon Sep 17 00:00:00 2001 From: OGAWA KenIchi Date: Wed, 23 Aug 2023 10:02:01 +0900 Subject: [PATCH 0433/3948] =?UTF-8?q?=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88?= =?UTF-8?q?=E3=81=AE=E8=AA=A4=E3=82=8A=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/chrono/duration/op_constructor.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/chrono/duration/op_constructor.md b/reference/chrono/duration/op_constructor.md index acb831b610..95afebbeef 100644 --- a/reference/chrono/duration/op_constructor.md +++ b/reference/chrono/duration/op_constructor.md @@ -45,7 +45,7 @@ using std::chrono::duration; int main() { duration d1; // デフォルト構築 d1.count()は未初期化の値 - duration d2 {}; // デフォルト構築 d1.count()の値は0 + duration d2 {}; // デフォルト構築 d2.count()の値は0 duration d3(3); // 値を指定して構築(ミリ秒) duration d4 = d3; // ミリ秒からマイクロ秒に変換 From 6366c71c487dcdf10bbf224db35a5b3bbc4d3c3f Mon Sep 17 00:00:00 2001 From: OGAWA KenIchi Date: Wed, 23 Aug 2023 14:50:26 +0900 Subject: [PATCH 0434/3948] =?UTF-8?q?chrono/time=5Fpoint/op=5Fminus?= =?UTF-8?q?=E3=81=AE=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 「-」を「=」に修正 * 最初の宣言だけコメントがなかったのでコメントを追加 --- reference/chrono/time_point/op_minus.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/reference/chrono/time_point/op_minus.md b/reference/chrono/time_point/op_minus.md index 5ee3186182..b38628c53c 100644 --- a/reference/chrono/time_point/op_minus.md +++ b/reference/chrono/time_point/op_minus.md @@ -7,6 +7,7 @@ ```cpp namespace std { namespace chrono { + // time_point - duration = time_point template time_point>::type> operator-(const time_point& lhs, @@ -18,13 +19,13 @@ namespace chrono { operator-(const time_point& lhs, const duration& rhs); // (1) C++14 - // time_point - time_point - duration + // time_point - time_point = duration template typename common_type::type operator-(const time_point& lhs, const time_point& rhs); // (2) C++11 - // time_point - time_point - duration + // time_point - time_point = duration template constexpr typename common_type::type operator-(const time_point& lhs, From f2eb44725d784a0b8cb1d2f343178ffe04c392d8 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 23 Aug 2023 15:52:06 +0900 Subject: [PATCH 0435/3948] =?UTF-8?q?=20:=20P2278R4=E9=96=A2?= =?UTF-8?q?=E9=80=A3=E3=82=92=E8=BF=BD=E5=8A=A0=20#1084?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reference/ranges.md b/reference/ranges.md index cbe100bf33..44737cf700 100644 --- a/reference/ranges.md +++ b/reference/ranges.md @@ -65,10 +65,13 @@ C++20では関数によるカスタマイゼーションポイントの問題点 |------------------------------------------------------------------|------------------------------------------------|----------------| | [`iterator_t`](ranges/iterator_t.md) | イテレータ型を取得する (alias template) | C++20 | | [`sentinel_t`](ranges/sentinel_t.md) | 番兵型を取得する (alias template) | C++20 | +| [`const_iterator_t`](ranges/const_iterator_t.md.nolink) | 定数イテレータ型を取得する (alias template) | C++23 | +| [`const_sentinel_t`](ranges/const_sentinel_t.md.nolink) | 定数番兵型を取得する (alias template) | C++23 | | [`range_difference_t`](ranges/range_difference_t.md) | イテレータの差の型を取得する (alias template) | C++20 | | [`range_size_t`](ranges/range_size_t.md) | サイズの型を取得する(alias template) | C++20 | | [`range_value_t`](ranges/range_value_t.md) | 要素の型を取得する (alias template) | C++20 | | [`range_reference_t`](ranges/range_reference_t.md) | 要素の参照型を取得する (alias template) | C++20 | +| [`range_const_reference_t`](ranges/range_const_reference_t.md.nolink)| 要素の定数参照型を取得する (alias template) | C++23 | | [`range_rvalue_reference_t`](ranges/range_rvalue_reference_t.md) | 要素の右辺値参照型を取得する (alias template) | C++20 | ## Rangeコンセプト @@ -87,6 +90,7 @@ C++20では関数によるカスタマイゼーションポイントの問題点 | [`contiguous_range`](ranges/contiguous_range.md) | イテレータが隣接イテレータであるRange (concept) | C++20 | | [`common_range`](ranges/common_range.md) | イテレータと番兵の型が等しいRange (concept) | C++20 | | [`viewable_range`](ranges/viewable_range.md) | ビューに変換できるRange (concept) | C++20 | +| [`constant_range`](ranges/constant_range.md.nolink) | 要素が定数なRange (concept) | C++23 | ## カスタマイゼーションポイント @@ -424,3 +428,4 @@ range | adaptor(args...) ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) - [C++20 ranges](https://techbookfest.org/product/5134506308665344) +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) From a3c830c711a9f273eb85e397f730bc40063289c8 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 23 Aug 2023 16:10:46 +0900 Subject: [PATCH 0436/3948] =?UTF-8?q?const=5Fiterator=5Ft/const=5Fsentinel?= =?UTF-8?q?=5Ft=E8=BF=BD=E5=8A=A0=20#1084?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges.md | 4 +-- reference/ranges/const_iterator_t.md | 49 +++++++++++++++++++++++++ reference/ranges/const_sentinel_t.md | 53 ++++++++++++++++++++++++++++ 3 files changed, 104 insertions(+), 2 deletions(-) create mode 100644 reference/ranges/const_iterator_t.md create mode 100644 reference/ranges/const_sentinel_t.md diff --git a/reference/ranges.md b/reference/ranges.md index 44737cf700..adda7dbb9d 100644 --- a/reference/ranges.md +++ b/reference/ranges.md @@ -65,8 +65,8 @@ C++20では関数によるカスタマイゼーションポイントの問題点 |------------------------------------------------------------------|------------------------------------------------|----------------| | [`iterator_t`](ranges/iterator_t.md) | イテレータ型を取得する (alias template) | C++20 | | [`sentinel_t`](ranges/sentinel_t.md) | 番兵型を取得する (alias template) | C++20 | -| [`const_iterator_t`](ranges/const_iterator_t.md.nolink) | 定数イテレータ型を取得する (alias template) | C++23 | -| [`const_sentinel_t`](ranges/const_sentinel_t.md.nolink) | 定数番兵型を取得する (alias template) | C++23 | +| [`const_iterator_t`](ranges/const_iterator_t.md) | 定数イテレータ型を取得する (alias template) | C++23 | +| [`const_sentinel_t`](ranges/const_sentinel_t.md) | 定数番兵型を取得する (alias template) | C++23 | | [`range_difference_t`](ranges/range_difference_t.md) | イテレータの差の型を取得する (alias template) | C++20 | | [`range_size_t`](ranges/range_size_t.md) | サイズの型を取得する(alias template) | C++20 | | [`range_value_t`](ranges/range_value_t.md) | 要素の型を取得する (alias template) | C++20 | diff --git a/reference/ranges/const_iterator_t.md b/reference/ranges/const_iterator_t.md new file mode 100644 index 0000000000..d2ecc3fd72 --- /dev/null +++ b/reference/ranges/const_iterator_t.md @@ -0,0 +1,49 @@ +# const_iterator_t +* ranges[meta header] +* std::ranges[meta namespace] +* type-alias[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template + using const_iterator_t = const_iterator>; +} +``` +* range[link range.md] +* const_iterator[link /reference/iterator/const_iterator.md] +* iterator_t[link iterator_t.md] + +## 概要 + +任意のRange型`R`の定数イテレータの型を取得する。 + +## 例 + +```cpp example +#include +#include + +int main() { + static_assert(std::same_as>, std::basic_const_iterator::iterator>>); + static_assert(std::same_as>, std::vector::const_iterator>); +} +``` +* std::ranges::const_iterator_t[color ff0000] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) diff --git a/reference/ranges/const_sentinel_t.md b/reference/ranges/const_sentinel_t.md new file mode 100644 index 0000000000..086fe5e1b6 --- /dev/null +++ b/reference/ranges/const_sentinel_t.md @@ -0,0 +1,53 @@ +# const_sentinel_t +* ranges[meta header] +* std::ranges[meta namespace] +* type-alias[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template + using const_sentinel_t = const_sentinel>; +} +``` +* range[link range.md] +* const_sentinel[link /reference/iterator/const_sentinel.md] +* sentinel_t[link sentinel_t.md] + +## 概要 + +任意のRange型`R`の定数イテレータ([`const_iterator_t`](const_iterator_t.md)``)に対応する番兵の型を取得する。 + +## 例 + +```cpp example +#include +#include + +int main() { + static_assert(std::same_as>, std::basic_const_iterator::iterator>>); + static_assert(std::same_as>, std::vector::const_iterator>); + + static_assert(std::same_as>, std::unreachable_sentinel_t>); +} +``` +* std::ranges::const_sentinel_t[color ff0000] +* repeat_view[link repeat_view.md] +* std::unreachable_sentinel_t[link /reference/iterator/unreachable_sentinel_t.md] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) From a2837c4112998a57257d08838c7e4412876c5826 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 23 Aug 2023 19:07:04 +0900 Subject: [PATCH 0437/3948] =?UTF-8?q?is=5Fconstant=5Fevaluated=20:=20C++23?= =?UTF-8?q?=20if=20consteval=E3=81=B8=E3=81=AE=E3=83=AA=E3=83=B3=E3=82=AF?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/type_traits/is_constant_evaluated.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/type_traits/is_constant_evaluated.md b/reference/type_traits/is_constant_evaluated.md index 1cd386e9af..09482f82d5 100644 --- a/reference/type_traits/is_constant_evaluated.md +++ b/reference/type_traits/is_constant_evaluated.md @@ -134,6 +134,7 @@ int main() ## 関連項目 - [C++20 コンパイル時初期化を強制する`constinit`キーワードを追加](/lang/cpp20/constinit.md) +- [C++23 `if consteval`](/lang/cpp23/if_consteval.md.nolink) ## 参照 - [P0595R2 `std::is_constant_evaluated()`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0595r2.html) From bf5c611427dcc7915ec8a49a6d6cdd962eadcd55 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Thu, 24 Aug 2023 15:48:22 +0900 Subject: [PATCH 0438/3948] =?UTF-8?q?constant=5Frange=E3=81=A8possibly-con?= =?UTF-8?q?st-range=E8=BF=BD=E5=8A=A0=20#1084?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges.md | 2 +- reference/ranges/constant_range.md | 51 ++++++++++++++++++++++++ reference/ranges/possibly-const-range.md | 35 ++++++++++++++++ 3 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 reference/ranges/constant_range.md create mode 100644 reference/ranges/possibly-const-range.md diff --git a/reference/ranges.md b/reference/ranges.md index adda7dbb9d..e61744fe23 100644 --- a/reference/ranges.md +++ b/reference/ranges.md @@ -90,7 +90,7 @@ C++20では関数によるカスタマイゼーションポイントの問題点 | [`contiguous_range`](ranges/contiguous_range.md) | イテレータが隣接イテレータであるRange (concept) | C++20 | | [`common_range`](ranges/common_range.md) | イテレータと番兵の型が等しいRange (concept) | C++20 | | [`viewable_range`](ranges/viewable_range.md) | ビューに変換できるRange (concept) | C++20 | -| [`constant_range`](ranges/constant_range.md.nolink) | 要素が定数なRange (concept) | C++23 | +| [`constant_range`](ranges/constant_range.md) | 要素が定数なRange (concept) | C++23 | ## カスタマイゼーションポイント diff --git a/reference/ranges/constant_range.md b/reference/ranges/constant_range.md new file mode 100644 index 0000000000..4843aa1536 --- /dev/null +++ b/reference/ranges/constant_range.md @@ -0,0 +1,51 @@ +# constant_range +* ranges[meta header] +* concept[meta id-type] +* std::ranges[meta namespace] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template + concept constant_range = input_range && constant-iterator>; +} +``` +* input_range[link input_range.md] +* constant-iterator[link /reference/iterator/constant-iterator.md] +* iterator_t[link iterator_t.md] + +## 概要 + +`constant_range`は、その要素が変更不可能な`range`を表すコンセプトである。 + +## 例 + +```cpp example +#include +#include + +int main() { + static_assert(not std::ranges::constant_range< std::vector>); + static_assert( std::ranges::constant_range>); + + static_assert(std::ranges::constant_range>); +} +``` + +### 出力 + +``` +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) diff --git a/reference/ranges/possibly-const-range.md b/reference/ranges/possibly-const-range.md new file mode 100644 index 0000000000..8a921c7fdb --- /dev/null +++ b/reference/ranges/possibly-const-range.md @@ -0,0 +1,35 @@ +# possibly-const-range +* ranges[meta header] +* std::ranges[meta namespace] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template + constexpr auto& possibly-const-range(R& r) { + if constexpr (constant_range && !constant_range) { + return const_cast(r); + } else { + return r; + } + } +} +``` +* input_range[link /reference/ranges/input_range.md] +* constant_range[link /reference/ranges/constant_range.md] + +## 概要 + +`possibly-const-range`は入力の`input_range`オブジェクト`r`を、可能なら要素が定数化された`range`へ変換するものである。 + +主に、`ranges::cbegin()`など定数イテレータを取得したい場所で、イテレータ取得前の段階で`range`型の簡単な変換のみで定数イテレータを取得できるかを試行するのに使用される。 + + +## バージョン +### 言語 +- C++23 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) From 99a88c1134be17442149de2b693a93f654af17c9 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Thu, 24 Aug 2023 15:48:59 +0900 Subject: [PATCH 0439/3948] =?UTF-8?q?ranges::cbegin=20:=20P2278R4=E9=81=A9?= =?UTF-8?q?=E7=94=A8=20#1084?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/cbegin.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/reference/ranges/cbegin.md b/reference/ranges/cbegin.md index be82181303..0953d768ef 100644 --- a/reference/ranges/cbegin.md +++ b/reference/ranges/cbegin.md @@ -16,10 +16,14 @@ namespace std::ranges { Rangeから先頭要素への読み取り専用イテレータを取得する関数オブジェクト。 ## 効果 -部分式`E`の型を`T`とする。このとき、式`ranges::cbegin(E)`の効果は以下の式と等しい。 +部分式`E`の型を`T`、`E`の評価結果オブジェクトを示す左辺値を`t`とする。このとき、式`ranges::cbegin(E)`の効果は以下の式と等しい。 -1. `E`がlvalueであれば、[`ranges::begin`](begin.md)`(static_cast(E))` -2. それ以外の場合、[`ranges::begin`](begin.md)`(static_cast(E))` +- C++20まで + 1. `E`がlvalueであれば、[`ranges::begin`](begin.md)`(static_cast(E))` + 2. それ以外の場合、[`ranges::begin`](begin.md)`(static_cast(E))` +- C++23から + 1. `E`が右辺値であり、[`enable_borrowed_range`](./enable_borrowed_range.md)`>`が`false`となる場合、`ranges::cbegin(E)`は不適格 + 2. それ以外の場合、式`U`を[`ranges::begin`](begin.md)`(`[`possibly-const-range`](./possibly-const-range.md)`(t))`とすると、[`const_iterator`](/reference/iterator/const_iterator.md)`(U)` ## 戻り値 先頭要素への読み取り専用イテレータ。 @@ -28,7 +32,9 @@ Rangeから先頭要素への読み取り専用イテレータを取得する関 Rangeが`const`な場合について[`ranges::begin`](begin.md)をカスタマイズすることで、`ranges::cbegin`をカスタマイズできる。 ## 備考 -`ranges::cbegin`の呼び出しが有効な式であるとき、その型は[`input_or_output_iterator`](/reference/iterator/input_or_output_iterator.md)のモデルである。 +`ranges::cbegin`の呼び出しが有効な式であるとき、その型は[`input_or_output_iterator`](/reference/iterator/input_or_output_iterator.md)のモデルであり、C++23以降はさらに[`constant-iterator`](/reference/iterator/constant-iterator.md)のモデルである。 + +C++20までは`range`型`R`の`begin()`の`const`オーバーロードを呼び出してていたため得られたイテレータは必ずしも定数イテレータではない場合があったが、C++23からはそこから定数イテレータが得られない場合に[`basic_const_iterator`](/reference/iterator/basic_const_iterator.md)を使用することで確実に定数イテレータを取得する。 ## 例 ```cpp example @@ -75,3 +81,4 @@ int main() ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) - [C++20 ranges](https://techbookfest.org/product/5134506308665344) +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) From 4e3f803c205c62d5f0d09e3684e12536eaa58704 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Fri, 25 Aug 2023 11:49:22 +0900 Subject: [PATCH 0440/3948] =?UTF-8?q?range=5Fconst=5Freference=5Ft?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20#1084?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/iter_const_reference_t.md | 6 +-- reference/ranges.md | 4 +- reference/ranges/range_const_reference_t.md | 49 ++++++++++++++++++++ 3 files changed, 54 insertions(+), 5 deletions(-) create mode 100644 reference/ranges/range_const_reference_t.md diff --git a/reference/iterator/iter_const_reference_t.md b/reference/iterator/iter_const_reference_t.md index 47a79a25ff..459eb5016e 100644 --- a/reference/iterator/iter_const_reference_t.md +++ b/reference/iterator/iter_const_reference_t.md @@ -21,9 +21,9 @@ namespace std { ## 型の決定 -`iter_value_t`が非参照型であり`iter_reference_t`から修飾を除いた型であるとすると、`iter_reference_t`に対して`iter_const_reference_t`は基本的には次のようになる +`iter_value_t`が非参照型であり`iter_reference_t`から修飾を除いた型であるとすると、`iter_reference_t`に対して`iter_const_reference_t`は基本的には次のようになる(`T`を任意の修飾なしの型とする) -|`iter_reference_t`|`iter_const_reference_t`| +|`iter_reference_t`|`iter_const_reference_t`| |---|---| |`T&`|`const T&`| |`T&&`|`const T&&`| @@ -32,7 +32,7 @@ namespace std { |`T`|`T`| |`const T`|`T`| -`It`に対して`iterator_traits`の特殊化が存在する場合や、`const iter_value_t&&`と`iter_reference_t`について`common_reference`が特殊化されている場合はこれと異なる結果となりうる。標準ライブラリにあるそのようなイテレータ型を持つものについて一部例を示すと、次のようになる +`iter_value_t`に対して`iter_reference_t`が修飾以外も異なる型となる場合や、`It`に対して`iterator_traits`の特殊化が存在する場合、`const iter_value_t&&`と`iter_reference_t`について`common_reference`が特殊化されている場合などはこれと異なる結果となりうる。標準ライブラリにあるそのようなイテレータ型を持つものについて一部例を示すと、次のようになる |`It`の取得元の範囲|`iter_value_t`|`iter_reference_t`|`iter_const_reference_t`| |---|---|---|---| diff --git a/reference/ranges.md b/reference/ranges.md index e61744fe23..c7b99a06f6 100644 --- a/reference/ranges.md +++ b/reference/ranges.md @@ -66,12 +66,12 @@ C++20では関数によるカスタマイゼーションポイントの問題点 | [`iterator_t`](ranges/iterator_t.md) | イテレータ型を取得する (alias template) | C++20 | | [`sentinel_t`](ranges/sentinel_t.md) | 番兵型を取得する (alias template) | C++20 | | [`const_iterator_t`](ranges/const_iterator_t.md) | 定数イテレータ型を取得する (alias template) | C++23 | -| [`const_sentinel_t`](ranges/const_sentinel_t.md) | 定数番兵型を取得する (alias template) | C++23 | +| [`const_sentinel_t`](ranges/const_sentinel_t.md) | 定数番兵型を取得する (alias template) | C++23 | | [`range_difference_t`](ranges/range_difference_t.md) | イテレータの差の型を取得する (alias template) | C++20 | | [`range_size_t`](ranges/range_size_t.md) | サイズの型を取得する(alias template) | C++20 | | [`range_value_t`](ranges/range_value_t.md) | 要素の型を取得する (alias template) | C++20 | | [`range_reference_t`](ranges/range_reference_t.md) | 要素の参照型を取得する (alias template) | C++20 | -| [`range_const_reference_t`](ranges/range_const_reference_t.md.nolink)| 要素の定数参照型を取得する (alias template) | C++23 | +| [`range_const_reference_t`](ranges/range_const_reference_t.md) | 要素の定数参照型を取得する (alias template) | C++23 | | [`range_rvalue_reference_t`](ranges/range_rvalue_reference_t.md) | 要素の右辺値参照型を取得する (alias template) | C++20 | ## Rangeコンセプト diff --git a/reference/ranges/range_const_reference_t.md b/reference/ranges/range_const_reference_t.md new file mode 100644 index 0000000000..ae2fe2e014 --- /dev/null +++ b/reference/ranges/range_const_reference_t.md @@ -0,0 +1,49 @@ +# range_const_reference_t +* ranges[meta header] +* std::ranges[meta namespace] +* type-alias[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template + using range_const_reference_t = iter_const_reference_t>; +} +``` +* range[link range.md] +* iter_const_reference_t[link /reference/iterator/iter_const_reference_t.md] +* iterator_t[link iterator_t.md] + +## 概要 + +任意のRange型`R`から、そのRangeの要素への`const`参照型を取得する。 + +## 例 + +```cpp example +#include +#include + +int main() { + static_assert(std::same_as> , const int&>); + static_assert(std::same_as>, bool>); +} +``` +* std::ranges::range_const_reference_t[color ff0000] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) From e37ef9b695f6bb5e02f5153a9fa4281980f60e22 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Fri, 25 Aug 2023 12:32:57 +0900 Subject: [PATCH 0441/3948] =?UTF-8?q?=E7=AF=84=E5=9B=B2=E3=82=A2=E3=82=AF?= =?UTF-8?q?=E3=82=BB=E3=82=B9=E9=96=A2=E6=95=B0=E3=81=AEP2278R4=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C=20#1084?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/cdata.md | 18 ++++++++++++++---- reference/ranges/cend.md | 13 +++++++++---- reference/ranges/crbegin.md | 14 +++++++++++--- reference/ranges/crend.md | 13 +++++++++---- 4 files changed, 43 insertions(+), 15 deletions(-) diff --git a/reference/ranges/cdata.md b/reference/ranges/cdata.md index 34ca0ed789..4bf0e27bf3 100644 --- a/reference/ranges/cdata.md +++ b/reference/ranges/cdata.md @@ -16,10 +16,19 @@ namespace std::ranges { Rangeの要素が格納されたメモリ領域へのポインタを取得する関数オブジェクト。 ## 効果 -部分式`E`の型を`T`とする。このとき、式`ranges::cdata(E)`の効果は以下の式と等しい。 +部分式`E`の型を`T`、`E`の評価結果オブジェクトを示す左辺値を`t`とする。このとき、式`ranges::cdata(E)`の効果は以下の式と等しい。 -1. `E`がlvalueであれば、[`ranges::data`](data.md)`(static_cast(E))` -2. それ以外の場合、[`ranges::data`](data.md)`(static_cast(E))` +- C++20まで + 1. `E`がlvalueであれば、[`ranges::data`](data.md)`(static_cast(E))` + 2. それ以外の場合、[`ranges::data`](data.md)`(static_cast(E))` +- C++23から + 1. `E`が右辺値であり、[`enable_borrowed_range`](./enable_borrowed_range.md)`>`が`false`となる場合、`ranges::cdata(E)`は不適格 + 2. それ以外の場合、`as-const-pointer(`[`ranges::data`](data.md)`(`[`possibly-const-range`](./possibly-const-range.md)`(t)))` + - `as-const-pointer`は次のような説明専用関数テンプレートである + ```cpp + template + constexpr auto as-const-pointer(const T* p) { return p; } + ``` ## 戻り値 Rangeの要素が格納されたメモリ領域へのポインタ。 @@ -28,7 +37,7 @@ Rangeの要素が格納されたメモリ領域へのポインタ。 Rangeが`const`な場合について[`ranges::data`](data.md)をカスタマイズすることで、`ranges::cdata`をカスタマイズできる。 ## 備考 -`ranges::cdata(E)`が有効な式であるとき、その型はオブジェクトへのポインタである。 +`ranges::cdata(E)`が有効な式であるとき、その型はオブジェクトへのポインタである(C++23以降、このポインタは定数ポインタである)。 ## 例 ```cpp example @@ -71,3 +80,4 @@ array size:1 at 0x556ec23ba2b0 ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) - [C++20 ranges](https://techbookfest.org/product/5134506308665344) +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) diff --git a/reference/ranges/cend.md b/reference/ranges/cend.md index 355272484f..dbbcbe1d15 100644 --- a/reference/ranges/cend.md +++ b/reference/ranges/cend.md @@ -16,10 +16,14 @@ namespace std::ranges { Rangeから、最後尾要素の次を指す読み取り専用イテレータもしくは番兵を取得する関数オブジェクト。 ## 効果 -部分式`E`の型を`T`とする。このとき、式`ranges::cend(E)`の効果は以下の式と等しい。 +部分式`E`の型を`T`、`E`の評価結果オブジェクトを示す左辺値を`t`とする。このとき、式`ranges::cend(E)`の効果は以下の式と等しい。 -1. `E`がlvalueであれば、[`ranges::end`](end.md)`(static_cast(E))` -2. それ以外の場合、[`ranges::end`](end.md)`(static_cast(E))` +- C++20まで + 1. `E`がlvalueであれば、[`ranges::end`](end.md)`(static_cast(E))` + 2. それ以外の場合、[`ranges::end`](end.md)`(static_cast(E))` +- C++23から + 1. `E`が右辺値であり、[`enable_borrowed_range`](./enable_borrowed_range.md)`>`が`false`となる場合、`ranges::cend(E)`は不適格 + 2. それ以外の場合、式`U`を[`ranges::end`](end.md)`(`[`possibly-const-range`](./possibly-const-range.md)`(t))`とすると、[`const_sentinel`](/reference/iterator/const_sentinel.md)`(U)` ## 戻り値 最後尾要素の次を指す読み取り専用イテレータもしくは番兵。 @@ -28,7 +32,7 @@ Rangeから、最後尾要素の次を指す読み取り専用イテレータも Rangeが`const`な場合について[`ranges::end`](end.md)をカスタマイズすることで、`ranges::cend`をカスタマイズできる。 ## 備考 -`ranges::cend(E)`が有効な式であるとき、`ranges::cend(E)`の型`S`、[`ranges::cbegin`](cbegin.md)`(E)`の型`I`は[`sentinel_for`](/reference/iterator/sentinel_for.md)``のモデルである。 +`ranges::cend(E)`が有効な式であるとき、`ranges::cend(E)`の型`S`、[`ranges::cbegin`](cbegin.md)`(E)`の型`I`は[`sentinel_for`](/reference/iterator/sentinel_for.md)``のモデルである。C++23以降はさらに、`S`が`input_iterator`のモデルならば`S`は[`constant-iterator`](/reference/iterator/constant-iterator.md)のモデルである。 ## 例 ```cpp example @@ -75,3 +79,4 @@ int main() ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) - [C++20 ranges](https://techbookfest.org/product/5134506308665344) +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) diff --git a/reference/ranges/crbegin.md b/reference/ranges/crbegin.md index 650f0632bd..fe119a51d7 100644 --- a/reference/ranges/crbegin.md +++ b/reference/ranges/crbegin.md @@ -16,10 +16,14 @@ namespace std::ranges { Rangeの末尾を指す読み取り専用逆イテレータを取得する関数オブジェクト。 ## 効果 -部分式`E`の型を`T`とする。このとき、式`ranges::crbegin(E)`の効果は以下の式と等しい。 +部分式`E`の型を`T`、`E`の評価結果オブジェクトを示す左辺値を`t`とする。このとき、式`ranges::crbegin(E)`の効果は以下の式と等しい。 -1. `E`がlvalueであれば、[`ranges::rbegin`](rbegin.md)`(static_cast(E))` -2. それ以外の場合、[`ranges::rbegin`](rbegin.md)`(static_cast(E))` +- C++20まで + 1. `E`がlvalueであれば、[`ranges::rbegin`](rbegin.md)`(static_cast(E))` + 2. それ以外の場合、[`ranges::rbegin`](rbegin.md)`(static_cast(E))` +- C++23から + 1. `E`が右辺値であり、[`enable_borrowed_range`](./enable_borrowed_range.md)`>`が`false`となる場合、`ranges::crbegin(E)`は不適格 + 2. それ以外の場合、式`U`を[`ranges::rbegin`](rbegin.md)`(`[`possibly-const-range`](./possibly-const-range.md)`(t))`とすると、[`const_iterator`](/reference/iterator/const_iterator.md)`(U)` ## 戻り値 Rangeの末尾を指す読み取り専用逆イテレータ。 @@ -27,6 +31,9 @@ Rangeの末尾を指す読み取り専用逆イテレータ。 ## カスタマイゼーションポイント Rangeが`const`な場合について[`ranges::rbegin`](rbegin.md)をカスタマイズすることで、`ranges::crbegin`をカスタマイズできる。 +## 備考 +`ranges::crbegin`の呼び出しが有効な式であるとき、その型は[`input_or_output_iterator`](/reference/iterator/input_or_output_iterator.md)のモデルであり、C++23以降はさらに[`constant-iterator`](/reference/iterator/constant-iterator.md)のモデルである。 + ## 例 ```cpp example #include @@ -101,3 +108,4 @@ int main() ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) - [C++20 ranges](https://techbookfest.org/product/5134506308665344) +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) diff --git a/reference/ranges/crend.md b/reference/ranges/crend.md index e96891978e..bd3393e115 100644 --- a/reference/ranges/crend.md +++ b/reference/ranges/crend.md @@ -16,10 +16,14 @@ namespace std::ranges { Rangeの先頭の前を指す、読み取り専用逆イテレータもしくは番兵を取得する関数オブジェクト。 ## 効果 -部分式`E`の型を`T`とする。このとき、式`ranges::crend(E)`の効果は以下の式と等しい。 +部分式`E`の型を`T`、`E`の評価結果オブジェクトを示す左辺値を`t`とする。このとき、式`ranges::crend(E)`の効果は以下の式と等しい。 -1. `E`がlvalueであれば、[`ranges::rend`](rend.md)`(static_cast(E))` -2. それ以外の場合、[`ranges::rend`](rend.md)`(static_cast(E))` +- C++20まで + 1. `E`がlvalueであれば、[`ranges::rend`](rend.md)`(static_cast(E))` + 2. それ以外の場合、[`ranges::rend`](rend.md)`(static_cast(E))` +- C++23から + 1. `E`が右辺値であり、[`enable_borrowed_range`](./enable_borrowed_range.md)`>`が`false`となる場合、`ranges::crend(E)`は不適格 + 2. それ以外の場合、式`U`を[`ranges::rend`](rend.md)`(`[`possibly-const-range`](./possibly-const-range.md)`(t))`とすると、[`const_sentinel`](/reference/iterator/const_sentinel.md)`(U)` ## 戻り値 Rangeの先頭の前を指す、読み取り専用逆イテレータもしくは番兵。 @@ -28,7 +32,7 @@ Rangeの先頭の前を指す、読み取り専用逆イテレータもしくは Rangeが`const`な場合について[`ranges::rend`](rend.md)をカスタマイズすることで、`ranges::crend`をカスタマイズできる。 ## 備考 -`ranges::crend(E)`が有効な式であるとき、`ranges::crend(E)`の型`S`、[`ranges::crbegin`](crbegin.md)`(E)`の型`I`は[`sentinel_for`](/reference/iterator/sentinel_for.md)``のモデルである。 +`ranges::crend(E)`が有効な式であるとき、`ranges::crend(E)`の型`S`、[`ranges::crbegin`](crbegin.md)`(E)`の型`I`は[`sentinel_for`](/reference/iterator/sentinel_for.md)``のモデルである。C++23以降はさらに、`S`が`input_iterator`のモデルならば`S`は[`constant-iterator`](/reference/iterator/constant-iterator.md)のモデルである。 ## 例 ```cpp example @@ -104,3 +108,4 @@ int main() ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) - [C++20 ranges](https://techbookfest.org/product/5134506308665344) +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) From c5d0375ce0f048faf59ce7c6df22e9590de92e45 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 5 Sep 2023 12:34:45 +0900 Subject: [PATCH 0442/3948] =?UTF-8?q?view=5Finterface=20:=20P2278R4?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C=20#1084?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/view_interface.md | 3 ++ reference/ranges/view_interface/cbegin.md | 45 +++++++++++++++++++++++ reference/ranges/view_interface/cend.md | 45 +++++++++++++++++++++++ 3 files changed, 93 insertions(+) create mode 100644 reference/ranges/view_interface/cbegin.md create mode 100644 reference/ranges/view_interface/cend.md diff --git a/reference/ranges/view_interface.md b/reference/ranges/view_interface.md index 9c75fdd6ec..505a2706f0 100644 --- a/reference/ranges/view_interface.md +++ b/reference/ranges/view_interface.md @@ -37,6 +37,8 @@ namespace std::ranges { | [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | | [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | | [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | | [`derived`](view_interface/derived.md) | `D`へダウンキャストする (説明専用) | C++20 | ## バージョン @@ -58,3 +60,4 @@ namespace std::ranges { - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) - [C++20 ranges](https://techbookfest.org/product/5134506308665344) - [LWG Issue 3549. `view_interface` is overspecified to derive from `view_base`](https://cplusplus.github.io/LWG/issue3549) +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) diff --git a/reference/ranges/view_interface/cbegin.md b/reference/ranges/view_interface/cbegin.md new file mode 100644 index 0000000000..e02a0de9ed --- /dev/null +++ b/reference/ranges/view_interface/cbegin.md @@ -0,0 +1,45 @@ +# cbegin +* ranges[meta header] +* std::ranges[meta namespace] +* view_interface[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr auto cbegin() + requires input_range; // (1) + +constexpr auto cbegin() const + requires input_range; // (2) +``` +* input_range[link ../input_range.md] + +## 概要 + +Rangeの定数イテレータを取得する。 + +## 戻り値 + +(1)、(2)共に、以下と等価 + +```cpp +return ranges::cbegin(derived()); +``` +* ranges::cbegin[link ../cbegin.md] +* derived[link derived.md] + +## 計算量 +償却定数時間 + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) diff --git a/reference/ranges/view_interface/cend.md b/reference/ranges/view_interface/cend.md new file mode 100644 index 0000000000..78325c7093 --- /dev/null +++ b/reference/ranges/view_interface/cend.md @@ -0,0 +1,45 @@ +# cend +* ranges[meta header] +* std::ranges[meta namespace] +* view_interface[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr auto cend() + requires input_range; // (1) + +constexpr auto cend() const + requires input_range; // (2) +``` +* input_range[link ../input_range.md] + +## 概要 + +Rangeの定数イテレータに対応する番兵を取得する。 + +## 戻り値 + +(1)、(2)共に、以下と等価 + +```cpp +return ranges::cend(derived()); +``` +* ranges::cend[link ../cend.md] +* derived[link derived.md] + +## 計算量 +償却定数時間 + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) From 953efe6f14e067f5c4d51fa0f30e6ff175859d02 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 6 Sep 2023 14:41:56 +0900 Subject: [PATCH 0443/3948] =?UTF-8?q?views::as=5Fconst=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20#1084?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges.md | 4 +- reference/ranges/as_const_view.md | 106 ++++++++++++++++++++++++++++++ 2 files changed, 108 insertions(+), 2 deletions(-) create mode 100644 reference/ranges/as_const_view.md diff --git a/reference/ranges.md b/reference/ranges.md index c7b99a06f6..41b8b7b190 100644 --- a/reference/ranges.md +++ b/reference/ranges.md @@ -321,8 +321,8 @@ range | adaptor(args...) | 名前 | 説明 | 対応バージョン | |-----------------------------------------------|--------------------------------------------------------------|----------------| -| [`as_const_view`](ranges/as_const_view.md.nolink) | 各要素をconstにするビュー (class template) | C++23 | -| [`views::as_const`](ranges/as_const.md.nolink) | `as_const_view`を生成する (customization point object) | C++23 | +| [`as_const_view`](ranges/as_const_view.md) | 各要素をconstにするビュー (class template) | C++23 | +| [`views::as_const`](ranges/as_const_view.md) | `as_const_view`を生成する (customization point object) | C++23 | ### elements view diff --git a/reference/ranges/as_const_view.md b/reference/ranges/as_const_view.md new file mode 100644 index 0000000000..f335682fbf --- /dev/null +++ b/reference/ranges/as_const_view.md @@ -0,0 +1,106 @@ +# as_const_view +* ranges[meta header] +* std::ranges[meta namespace] +* class template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template + requires input_range + class as_const_view : public view_interface> { …… }; // (1) + + namespace views { + inline constexpr /*unspecified*/ as_const = /*unspecified*/; // (2) + } +} +``` +* input_range[link input_range.md] +* view[link view.md] +* view_interface[link view_interface.md] + +## 概要 +- (1): 各要素を定数化したRangeとして振る舞う[`view`](view.md) +- (2): `as_const_view`を生成するRangeアダプタオブジェクト + +### Rangeコンセプト + +| borrowed | sized | output | input | forward | bidirectional | random_access | contiguous | common | viewable | view | +|----------|-------|--------|-------|---------|---------------|---------------|------------|--------|----------|------| +| (1) | (1) | | ○ | (1) | (1) | (1) | (1) | (1) | ○ | ○ | + +- (1): `V`に従う + +## 効果 + +- (2): 式`views::as_const(E)`の効果は次のいずれか(`T = decltype((E))`、`U = remove_cvref_t`とする) + - `views::all_t`が`constant_range`のモデルとなる場合 : `views::all(E)` + - 任意の型`X`に対して、`U`が`empty_view`である場合 : `auto(views::empty)` + - 任意の型`X`と整数値`Extent`に対して、`U`が`span`である場合 : `span(E)` + - 任意の型`X`に対して、`U`が`ref_view`であり、`const X`が`constant_range`のモデルとなる場合 : `ref_view(static_cast(E.base()))` + - `E`が左辺値であり、`const U`が`constant_range`のモデルとなり、かつ`U`は`view`のモデルとならない場合 : `ref_view(static_cast(E))` + - それ以外の場合 : `as_const_view(E)` + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|--------------------------------------------------|----------------------------------|----------------| +| [`(constructor)`](as_const_view/op_constructor.md.nolink) | コンストラクタ | C++23 | +| [`base`](as_const_view/base.md.nolink) | `V`の参照を取得する | C++23 | +| [`begin`](as_const_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++23 | +| [`end`](as_const_view/end.md.nolink) | 番兵を取得する | C++23 | +| [`size`](as_const_view/size.md.nolink) | 要素数を取得する | C++23 | + +## 継承しているメンバ関数 + +| 名前 | 説明 | 対応バージョン | +|----------------------------------------------|----------------------------------|----------------| +| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++23 | +| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++23 | +| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++23 | +| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++23 | +| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++23 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | + +## 推論補助 + +| 名前 | 説明 | 対応バージョン | +|-------------------------------------------------------|------------------------------|----------------| +| [`(deduction_guide)`](as_const_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | + +## 例 +```cpp example +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4}; + + for (const int& i : vec | std::views::as_const) { + std::cout << i << ' '; + + // 変更不可 + //*i = 0 + } +} +``` +* views::as_const[color ff0000] + +### 出力 +``` +1 2 3 4 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) From f1b46a11655c1b1b27faa245f5732a4fd5dd5c81 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 6 Sep 2023 14:45:32 +0900 Subject: [PATCH 0444/3948] =?UTF-8?q?as=5Fconst=5Fview=20:=20=E3=82=B5?= =?UTF-8?q?=E3=83=B3=E3=83=97=E3=83=AB=E3=82=B3=E3=83=BC=E3=83=89=E3=81=AE?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/as_const_view.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/ranges/as_const_view.md b/reference/ranges/as_const_view.md index f335682fbf..2cac9fe1ce 100644 --- a/reference/ranges/as_const_view.md +++ b/reference/ranges/as_const_view.md @@ -77,11 +77,11 @@ namespace std::ranges { int main() { std::vector vec = {1, 2, 3, 4}; - for (const int& i : vec | std::views::as_const) { + for (auto& i : vec | std::views::as_const) { std::cout << i << ' '; // 変更不可 - //*i = 0 + //i = 0 } } ``` From fa4faf6048ec000b7c7fc003ea7b810badea9fae Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 6 Sep 2023 15:01:22 +0900 Subject: [PATCH 0445/3948] =?UTF-8?q?as=5Fconst=5Fview=20:=20=E8=A1=A8?= =?UTF-8?q?=E3=81=AE=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/as_const_view.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/ranges/as_const_view.md b/reference/ranges/as_const_view.md index 2cac9fe1ce..ec7d49d63d 100644 --- a/reference/ranges/as_const_view.md +++ b/reference/ranges/as_const_view.md @@ -26,10 +26,10 @@ namespace std::ranges { ### Rangeコンセプト | borrowed | sized | output | input | forward | bidirectional | random_access | contiguous | common | viewable | view | -|----------|-------|--------|-------|---------|---------------|---------------|------------|--------|----------|------| -| (1) | (1) | | ○ | (1) | (1) | (1) | (1) | (1) | ○ | ○ | +|:--------:|:-----:|:------:|:-----:|:-------:|:-------------:|:-------------:|:----------:|:------:|:--------:|:----:| +| ※ | ※ | | ○ | ※ | ※ | ※ | ※ | ※ | ○ | ○ | -- (1): `V`に従う +- ※: `V`に従う ## 効果 From 0185d032cb062bec39b469070735d250cacff810 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Fri, 8 Sep 2023 12:48:14 +0900 Subject: [PATCH 0446/3948] =?UTF-8?q?as=5Fconst=5Fview=20:=20=E3=82=B3?= =?UTF-8?q?=E3=83=B3=E3=82=B9=E3=83=88=E3=83=A9=E3=82=AF=E3=82=BF=E3=81=A8?= =?UTF-8?q?base=E8=BF=BD=E5=8A=A0=20#1084?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/as_const_view.md | 4 +- reference/ranges/as_const_view/base.md | 71 +++++++++++++++++++ .../ranges/as_const_view/op_constructor.md | 60 ++++++++++++++++ 3 files changed, 133 insertions(+), 2 deletions(-) create mode 100644 reference/ranges/as_const_view/base.md create mode 100644 reference/ranges/as_const_view/op_constructor.md diff --git a/reference/ranges/as_const_view.md b/reference/ranges/as_const_view.md index ec7d49d63d..1853a628fa 100644 --- a/reference/ranges/as_const_view.md +++ b/reference/ranges/as_const_view.md @@ -45,8 +45,8 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |--------------------------------------------------|----------------------------------|----------------| -| [`(constructor)`](as_const_view/op_constructor.md.nolink) | コンストラクタ | C++23 | -| [`base`](as_const_view/base.md.nolink) | `V`の参照を取得する | C++23 | +| [`(constructor)`](as_const_view/op_constructor.md) | コンストラクタ | C++23 | +| [`base`](as_const_view/base.md) | `V`の参照を取得する | C++23 | | [`begin`](as_const_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++23 | | [`end`](as_const_view/end.md.nolink) | 番兵を取得する | C++23 | | [`size`](as_const_view/size.md.nolink) | 要素数を取得する | C++23 | diff --git a/reference/ranges/as_const_view/base.md b/reference/ranges/as_const_view/base.md new file mode 100644 index 0000000000..1afffb6bb3 --- /dev/null +++ b/reference/ranges/as_const_view/base.md @@ -0,0 +1,71 @@ +# base +* ranges[meta header] +* std::ranges[meta namespace] +* as_const_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr V base() const & requires copy_constructible; // (1) +constexpr V base() &&; // (2) +``` +* copy_constructible[link /reference/concepts/copy_constructible.md] + +## 概要 + +メンバ変数として保持している、元の`view`を取得する。 + +## 戻り値 + +入力`view`(`V`)のオブジェクトを`base_`というメンバに保持するとして + +- (1) : `return base_;` +- (2) : `return std::move(base_);` + +## 例 + +```cpp example +#include +#include +#include + +int main() { + using std::ranges::view; + + std::vector vec = {1, 2, 3, 4, 5}; + + std::ranges::as_const_view acv{vec}; + + // (1) コピーして取得 + view auto b1 = acv.base(); + + // (2) ムーブして取得 + view auto b2 = std::move(acv).base(); + + // 得られるのは元のRangeではなく、あくまでview + static_assert(not std::same_as>); + static_assert( std::same_as>>); + static_assert( std::same_as>>); +} +``` +* base[color ff0000] +* same_as[link /reference/concepts/same_as.md] +* ref_view[link /reference/ranges/ref_view.md] + +### 出力 + +``` +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) diff --git a/reference/ranges/as_const_view/op_constructor.md b/reference/ranges/as_const_view/op_constructor.md new file mode 100644 index 0000000000..32832d8016 --- /dev/null +++ b/reference/ranges/as_const_view/op_constructor.md @@ -0,0 +1,60 @@ +# コンストラクタ +* ranges[meta header] +* std::ranges[meta namespace] +* as_const_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +as_const_view() requires default_initializable = default; // (1) + +constexpr explicit as_const_view(V base); // (2) +``` +* default_initializable[link /reference/concepts/default_initializable.md] + +## 概要 + +`as_const_view`オブジェクトを構築する。 + +## 効果 + +入力`view`(`V`)のオブジェクトを`base_`というメンバに保持するとして + +- (1) : `base_`をデフォルト構築する +- (2) : `base_`を`std::move(base)`で初期化する + +## 例 +```cpp example +#include +#include + +int main() { + using std::ranges::as_const_view; + + std::vector vec = {1, 2, 3, 4, 5}; + + // (1) デフォルト構築 + as_const_view>> v1{}; + + // (2) viewを入力して構築 + as_const_view v2{vec}; +} +``` +* as_const_view[color ff0000] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) From dbc7c10006eeae7a56fd011cdb1ee476a9a4cc17 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Fri, 8 Sep 2023 14:23:01 +0900 Subject: [PATCH 0447/3948] =?UTF-8?q?view=5Finterface=E3=82=92=E7=B6=99?= =?UTF-8?q?=E6=89=BF=E3=81=97=E3=81=A6=E3=81=84=E3=82=8B=E3=82=AF=E3=83=A9?= =?UTF-8?q?=E3=82=B9=E3=81=ABcbegin/cend=E3=81=AE=E3=83=AA=E3=83=B3?= =?UTF-8?q?=E3=82=AF=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/common_view.md | 2 ++ reference/ranges/drop_view.md | 2 ++ reference/ranges/drop_while_view.md | 2 ++ reference/ranges/elements_view.md | 2 ++ reference/ranges/filter_view.md | 2 ++ reference/ranges/join_view.md | 2 ++ reference/ranges/lazy_split_view.md | 2 ++ reference/ranges/owning_view.md | 2 ++ reference/ranges/ref_view.md | 2 ++ reference/ranges/reverse_view.md | 2 ++ reference/ranges/split_view.md | 2 ++ reference/ranges/subrange.md | 2 ++ reference/ranges/take_view.md | 2 ++ reference/ranges/take_while_view.md | 2 ++ reference/ranges/transform_view.md | 2 ++ 15 files changed, 30 insertions(+) diff --git a/reference/ranges/common_view.md b/reference/ranges/common_view.md index a0aad31c05..6c335e91f4 100644 --- a/reference/ranges/common_view.md +++ b/reference/ranges/common_view.md @@ -69,6 +69,8 @@ namespace std::ranges { | [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | | [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | | [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | ## 推論補助 diff --git a/reference/ranges/drop_view.md b/reference/ranges/drop_view.md index 6a5665d37e..11516f89fb 100644 --- a/reference/ranges/drop_view.md +++ b/reference/ranges/drop_view.md @@ -71,6 +71,8 @@ namespace std::ranges { | [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | | [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | | [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | ## 推論補助 diff --git a/reference/ranges/drop_while_view.md b/reference/ranges/drop_while_view.md index 00c930da2a..399cc35e33 100644 --- a/reference/ranges/drop_while_view.md +++ b/reference/ranges/drop_while_view.md @@ -65,6 +65,8 @@ namespace std::ranges { | [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | | [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | | [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | ## 推論補助 diff --git a/reference/ranges/elements_view.md b/reference/ranges/elements_view.md index 934b911e4e..fef43e2d70 100644 --- a/reference/ranges/elements_view.md +++ b/reference/ranges/elements_view.md @@ -114,6 +114,8 @@ concept has-tuple-element = | [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | | [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | | [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | ## 推論補助 diff --git a/reference/ranges/filter_view.md b/reference/ranges/filter_view.md index d88c5e3f46..215673df66 100644 --- a/reference/ranges/filter_view.md +++ b/reference/ranges/filter_view.md @@ -72,6 +72,8 @@ namespace std::ranges { | [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++20 | | [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | | [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | ## 推論補助 diff --git a/reference/ranges/join_view.md b/reference/ranges/join_view.md index 7e109e5707..2d0654b30c 100644 --- a/reference/ranges/join_view.md +++ b/reference/ranges/join_view.md @@ -71,6 +71,8 @@ namespace std::ranges { | [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++20 | | [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | | [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | ## 推論補助 diff --git a/reference/ranges/lazy_split_view.md b/reference/ranges/lazy_split_view.md index 83c75d6da8..2464188f0a 100644 --- a/reference/ranges/lazy_split_view.md +++ b/reference/ranges/lazy_split_view.md @@ -91,6 +91,8 @@ concept tiny-range = sized_range && | [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++20 | | [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | | [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | ## 推論補助 diff --git a/reference/ranges/owning_view.md b/reference/ranges/owning_view.md index 19ab8dc652..2dd2519d9c 100644 --- a/reference/ranges/owning_view.md +++ b/reference/ranges/owning_view.md @@ -49,6 +49,8 @@ Rangeの右辺値をムーブして所有する[`view`](view.md)。このクラ | [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | | [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | | [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | ## 推論補助 diff --git a/reference/ranges/ref_view.md b/reference/ranges/ref_view.md index a68fbf6726..dd73e17df4 100644 --- a/reference/ranges/ref_view.md +++ b/reference/ranges/ref_view.md @@ -49,6 +49,8 @@ Rangeへの参照として振る舞う[`view`](view.md)。このクラスのオ | [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | | [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | | [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | ## 推論補助 diff --git a/reference/ranges/reverse_view.md b/reference/ranges/reverse_view.md index 8f25ad9097..0a1d1fe65e 100644 --- a/reference/ranges/reverse_view.md +++ b/reference/ranges/reverse_view.md @@ -69,6 +69,8 @@ namespace std::ranges { | [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | | [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | | [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | ## 推論補助 diff --git a/reference/ranges/split_view.md b/reference/ranges/split_view.md index f09880d28f..cc16b95fb7 100644 --- a/reference/ranges/split_view.md +++ b/reference/ranges/split_view.md @@ -75,6 +75,8 @@ namespace std::ranges { | [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++20 | | [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | | [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | ## 推論補助 diff --git a/reference/ranges/subrange.md b/reference/ranges/subrange.md index 7aacf4c5be..510fddb0e3 100644 --- a/reference/ranges/subrange.md +++ b/reference/ranges/subrange.md @@ -51,6 +51,8 @@ namespace std::ranges { | [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | | [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | | [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | ## 推論補助 diff --git a/reference/ranges/take_view.md b/reference/ranges/take_view.md index cac570185e..ba262259c0 100644 --- a/reference/ranges/take_view.md +++ b/reference/ranges/take_view.md @@ -71,6 +71,8 @@ namespace std::ranges { | [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | | [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | | [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | ## 推論補助 diff --git a/reference/ranges/take_while_view.md b/reference/ranges/take_while_view.md index 4c96f1358c..6d6514cb89 100644 --- a/reference/ranges/take_while_view.md +++ b/reference/ranges/take_while_view.md @@ -65,6 +65,8 @@ namespace std::ranges { | [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | | [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | | [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | ## 推論補助 diff --git a/reference/ranges/transform_view.md b/reference/ranges/transform_view.md index 08e94775da..928b74277d 100644 --- a/reference/ranges/transform_view.md +++ b/reference/ranges/transform_view.md @@ -74,6 +74,8 @@ namespace std::ranges { | [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | | [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | | [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | ## 推論補助 From 1fff32a5344aa196ff9aee04d3115af96d5b2701 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Sun, 10 Sep 2023 02:57:04 +0900 Subject: [PATCH 0448/3948] =?UTF-8?q?as=5Fconst=5Fview::size()=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=20#1084?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/as_const_view.md | 2 +- reference/ranges/as_const_view/size.md | 63 ++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 reference/ranges/as_const_view/size.md diff --git a/reference/ranges/as_const_view.md b/reference/ranges/as_const_view.md index 1853a628fa..a1234d6d9a 100644 --- a/reference/ranges/as_const_view.md +++ b/reference/ranges/as_const_view.md @@ -49,7 +49,7 @@ namespace std::ranges { | [`base`](as_const_view/base.md) | `V`の参照を取得する | C++23 | | [`begin`](as_const_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++23 | | [`end`](as_const_view/end.md.nolink) | 番兵を取得する | C++23 | -| [`size`](as_const_view/size.md.nolink) | 要素数を取得する | C++23 | +| [`size`](as_const_view/size.md) | 要素数を取得する | C++23 | ## 継承しているメンバ関数 diff --git a/reference/ranges/as_const_view/size.md b/reference/ranges/as_const_view/size.md new file mode 100644 index 0000000000..38d5d23126 --- /dev/null +++ b/reference/ranges/as_const_view/size.md @@ -0,0 +1,63 @@ +# size +* ranges[meta header] +* std::ranges[meta namespace] +* as_const_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr auto size() requires sized_range; // (1) +constexpr auto size() const requires sized_range; // (2) +``` +* sized_range[link /reference/ranges/sized_range.md] + +## 概要 + +`view`の要素数を取得する。 + +この関数で得られる`as_const_view`の要素数は、元のRange(`V`)の要素数と一致する。 + +## 戻り値 + +入力`view`(`V`)のオブジェクトを`base_`というメンバに保持するとして + +- (1) : `return ranges::size(base_);` +- (2) : `return ranges::size(base_);` + +## 例 + +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + std::ranges::as_const_view acv{vec}; + + std::cout << acv.size() << '\n'; + std::cout << vec.size() << '\n'; +} +``` +* size[color ff0000] + +### 出力 + +``` +5 +5 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) From f3e3dbf0e4150686401ef06fbb2ad122ac77e561 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Sun, 10 Sep 2023 03:05:03 +0900 Subject: [PATCH 0449/3948] =?UTF-8?q?as=5Fconst=5Fview::size()=20:=20range?= =?UTF-8?q?s::size=E3=81=AE=E3=83=AA=E3=83=B3=E3=82=AF=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/as_const_view/size.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/ranges/as_const_view/size.md b/reference/ranges/as_const_view/size.md index 38d5d23126..8d82acf953 100644 --- a/reference/ranges/as_const_view/size.md +++ b/reference/ranges/as_const_view/size.md @@ -21,8 +21,8 @@ constexpr auto size() const requires sized_range; // (2) 入力`view`(`V`)のオブジェクトを`base_`というメンバに保持するとして -- (1) : `return ranges::size(base_);` -- (2) : `return ranges::size(base_);` +- (1) : `return `[`ranges::size`](/reference/ranges/size.md)`(base_);` +- (2) : `return `[`ranges::size`](/reference/ranges/size.md)`(base_);` ## 例 From afa42590107fe0eef866c42ec23624f37ae41f21 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Mon, 11 Sep 2023 11:47:14 +0900 Subject: [PATCH 0450/3948] =?UTF-8?q?as=5Fconst=5Fview::size()=20:=20?= =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E8=A1=A8=E8=A8=98=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/as_const_view/size.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/reference/ranges/as_const_view/size.md b/reference/ranges/as_const_view/size.md index 8d82acf953..d1739631bc 100644 --- a/reference/ranges/as_const_view/size.md +++ b/reference/ranges/as_const_view/size.md @@ -19,10 +19,12 @@ constexpr auto size() const requires sized_range; // (2) ## 戻り値 -入力`view`(`V`)のオブジェクトを`base_`というメンバに保持するとして +入力`view`(`V`)のオブジェクトを`base_`というメンバに保持するとして、(1)(2)どちらも -- (1) : `return `[`ranges::size`](/reference/ranges/size.md)`(base_);` -- (2) : `return `[`ranges::size`](/reference/ranges/size.md)`(base_);` +```cpp +return ranges::size(base_); +``` +* size[link /reference/ranges/size.md] ## 例 From a980ba7040481aaedeb09ba2086e2be7e421d58f Mon Sep 17 00:00:00 2001 From: suomesta Date: Mon, 11 Sep 2023 22:43:23 +0900 Subject: [PATCH 0451/3948] change meta-id function to template function --- reference/deque/deque/erase_if_free.md | 2 +- reference/list/list/erase_if_free.md | 2 +- reference/map/map/erase_if_free.md | 2 +- reference/map/multimap/erase_if_free.md | 2 +- reference/set/multiset/erase_if_free.md | 2 +- reference/set/set/erase_if_free.md | 2 +- reference/string/basic_string/erase_if_free.md | 2 +- reference/unordered_map/unordered_map/erase_if_free.md | 2 +- reference/unordered_map/unordered_multimap/erase_if_free.md | 2 +- reference/unordered_set/unordered_multiset/erase_if_free.md | 2 +- reference/unordered_set/unordered_set/erase_if_free.md | 2 +- reference/vector/vector/erase_if_free.md | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/reference/deque/deque/erase_if_free.md b/reference/deque/deque/erase_if_free.md index 882b9bd254..f7b971a6f1 100644 --- a/reference/deque/deque/erase_if_free.md +++ b/reference/deque/deque/erase_if_free.md @@ -1,7 +1,7 @@ # erase_if * deque[meta header] * std[meta namespace] -* function[meta id-type] +* function template[meta id-type] * cpp20[meta cpp] ```cpp diff --git a/reference/list/list/erase_if_free.md b/reference/list/list/erase_if_free.md index 4cd3482c42..992bf176c1 100644 --- a/reference/list/list/erase_if_free.md +++ b/reference/list/list/erase_if_free.md @@ -1,7 +1,7 @@ # erase_if * list[meta header] * std[meta namespace] -* function[meta id-type] +* function template[meta id-type] * cpp20[meta cpp] ```cpp diff --git a/reference/map/map/erase_if_free.md b/reference/map/map/erase_if_free.md index 46e3e79630..8fdf9b54f0 100644 --- a/reference/map/map/erase_if_free.md +++ b/reference/map/map/erase_if_free.md @@ -1,7 +1,7 @@ # erase_if * map[meta header] * std[meta namespace] -* function[meta id-type] +* function template[meta id-type] * cpp20[meta cpp] ```cpp diff --git a/reference/map/multimap/erase_if_free.md b/reference/map/multimap/erase_if_free.md index 6f406c93d8..ab62c46f01 100644 --- a/reference/map/multimap/erase_if_free.md +++ b/reference/map/multimap/erase_if_free.md @@ -1,7 +1,7 @@ # erase_if * map[meta header] * std[meta namespace] -* function[meta id-type] +* function template[meta id-type] * cpp20[meta cpp] ```cpp diff --git a/reference/set/multiset/erase_if_free.md b/reference/set/multiset/erase_if_free.md index d503543b90..4bc7b1d9b8 100644 --- a/reference/set/multiset/erase_if_free.md +++ b/reference/set/multiset/erase_if_free.md @@ -1,7 +1,7 @@ # erase_if * set[meta header] * std[meta namespace] -* function[meta id-type] +* function template[meta id-type] * cpp20[meta cpp] ```cpp diff --git a/reference/set/set/erase_if_free.md b/reference/set/set/erase_if_free.md index b8bfd02724..0ad8a473e4 100644 --- a/reference/set/set/erase_if_free.md +++ b/reference/set/set/erase_if_free.md @@ -1,7 +1,7 @@ # erase_if * set[meta header] * std[meta namespace] -* function[meta id-type] +* function template[meta id-type] * cpp20[meta cpp] ```cpp diff --git a/reference/string/basic_string/erase_if_free.md b/reference/string/basic_string/erase_if_free.md index 2c9ab35ffc..cd8af1d522 100644 --- a/reference/string/basic_string/erase_if_free.md +++ b/reference/string/basic_string/erase_if_free.md @@ -1,7 +1,7 @@ # erase_if * string[meta header] * std[meta namespace] -* function[meta id-type] +* function template[meta id-type] * cpp20[meta cpp] ```cpp diff --git a/reference/unordered_map/unordered_map/erase_if_free.md b/reference/unordered_map/unordered_map/erase_if_free.md index 5dbbcd2db4..dadb218c82 100644 --- a/reference/unordered_map/unordered_map/erase_if_free.md +++ b/reference/unordered_map/unordered_map/erase_if_free.md @@ -1,7 +1,7 @@ # erase_if * unordered_map[meta header] * std[meta namespace] -* function[meta id-type] +* function template[meta id-type] * cpp20[meta cpp] ```cpp diff --git a/reference/unordered_map/unordered_multimap/erase_if_free.md b/reference/unordered_map/unordered_multimap/erase_if_free.md index a22fe19347..a3443865a9 100644 --- a/reference/unordered_map/unordered_multimap/erase_if_free.md +++ b/reference/unordered_map/unordered_multimap/erase_if_free.md @@ -1,7 +1,7 @@ # erase_if * unordered_map[meta header] * std[meta namespace] -* function[meta id-type] +* function template[meta id-type] * cpp20[meta cpp] ```cpp diff --git a/reference/unordered_set/unordered_multiset/erase_if_free.md b/reference/unordered_set/unordered_multiset/erase_if_free.md index c228a4e661..496e40d04f 100644 --- a/reference/unordered_set/unordered_multiset/erase_if_free.md +++ b/reference/unordered_set/unordered_multiset/erase_if_free.md @@ -1,7 +1,7 @@ # erase_if * unordered_set[meta header] * std[meta namespace] -* function[meta id-type] +* function template[meta id-type] * cpp20[meta cpp] ```cpp diff --git a/reference/unordered_set/unordered_set/erase_if_free.md b/reference/unordered_set/unordered_set/erase_if_free.md index 1b3f5a4ffa..7d248e1d3c 100644 --- a/reference/unordered_set/unordered_set/erase_if_free.md +++ b/reference/unordered_set/unordered_set/erase_if_free.md @@ -1,7 +1,7 @@ # erase_if * unordered_set[meta header] * std[meta namespace] -* function[meta id-type] +* function template[meta id-type] * cpp20[meta cpp] ```cpp diff --git a/reference/vector/vector/erase_if_free.md b/reference/vector/vector/erase_if_free.md index 7b8346cbb0..45b5098932 100644 --- a/reference/vector/vector/erase_if_free.md +++ b/reference/vector/vector/erase_if_free.md @@ -1,7 +1,7 @@ # erase_if * vector[meta header] * std[meta namespace] -* function[meta id-type] +* function template[meta id-type] * cpp20[meta cpp] ```cpp From 87ffbf8063ce4c4e9204ca50530112ac0a939b19 Mon Sep 17 00:00:00 2001 From: suomesta Date: Mon, 11 Sep 2023 22:54:36 +0900 Subject: [PATCH 0452/3948] remove unnecessary include in samples --- reference/iterator/move_iterator/iter_swap.md | 1 - reference/mutex/recursive_timed_mutex/try_lock_for.md | 1 - reference/mutex/recursive_timed_mutex/try_lock_until.md | 1 - reference/mutex/timed_mutex/lock.md | 1 - reference/mutex/timed_mutex/try_lock.md | 1 - reference/mutex/timed_mutex/try_lock_for.md | 1 - reference/mutex/timed_mutex/try_lock_until.md | 1 - reference/mutex/timed_mutex/unlock.md | 1 - reference/mutex/unique_lock/lock.md | 1 - reference/mutex/unique_lock/try_lock.md | 1 - reference/mutex/unique_lock/try_lock_for.md | 1 - reference/mutex/unique_lock/try_lock_until.md | 1 - reference/mutex/unique_lock/unlock.md | 1 - reference/unordered_set/unordered_multiset/erase.md | 1 - reference/unordered_set/unordered_multiset/extract.md | 1 - reference/unordered_set/unordered_set/erase.md | 1 - reference/unordered_set/unordered_set/extract.md | 1 - 17 files changed, 17 deletions(-) diff --git a/reference/iterator/move_iterator/iter_swap.md b/reference/iterator/move_iterator/iter_swap.md index 809d6d6cae..7bf48ef735 100644 --- a/reference/iterator/move_iterator/iter_swap.md +++ b/reference/iterator/move_iterator/iter_swap.md @@ -48,7 +48,6 @@ return move_iterator(std::move(i)); ```cpp example #include #include -#include #include int main() { diff --git a/reference/mutex/recursive_timed_mutex/try_lock_for.md b/reference/mutex/recursive_timed_mutex/try_lock_for.md index 093e8717c7..a2ab20ee4f 100644 --- a/reference/mutex/recursive_timed_mutex/try_lock_for.md +++ b/reference/mutex/recursive_timed_mutex/try_lock_for.md @@ -43,7 +43,6 @@ bool try_lock_for(const chrono::duration& rel_time); #include #include #include -#include #include class X { diff --git a/reference/mutex/recursive_timed_mutex/try_lock_until.md b/reference/mutex/recursive_timed_mutex/try_lock_until.md index 16f292eb84..6d222075cc 100644 --- a/reference/mutex/recursive_timed_mutex/try_lock_until.md +++ b/reference/mutex/recursive_timed_mutex/try_lock_until.md @@ -48,7 +48,6 @@ bool try_lock_until(const chrono::time_point& abs_time); #include #include #include -#include #include class X { diff --git a/reference/mutex/timed_mutex/lock.md b/reference/mutex/timed_mutex/lock.md index 0169d95a59..afba82b683 100644 --- a/reference/mutex/timed_mutex/lock.md +++ b/reference/mutex/timed_mutex/lock.md @@ -39,7 +39,6 @@ void lock(); #include #include #include -#include class X { std::timed_mutex mtx_; diff --git a/reference/mutex/timed_mutex/try_lock.md b/reference/mutex/timed_mutex/try_lock.md index 593c2c26c1..f188c26019 100644 --- a/reference/mutex/timed_mutex/try_lock.md +++ b/reference/mutex/timed_mutex/try_lock.md @@ -39,7 +39,6 @@ bool try_lock(); #include #include #include -#include #include class X { diff --git a/reference/mutex/timed_mutex/try_lock_for.md b/reference/mutex/timed_mutex/try_lock_for.md index a2ed963183..6e8cfe20d0 100644 --- a/reference/mutex/timed_mutex/try_lock_for.md +++ b/reference/mutex/timed_mutex/try_lock_for.md @@ -47,7 +47,6 @@ bool try_lock_for(const chrono::duration& rel_time); #include #include #include -#include #include class X { diff --git a/reference/mutex/timed_mutex/try_lock_until.md b/reference/mutex/timed_mutex/try_lock_until.md index bab9805d88..e346799440 100644 --- a/reference/mutex/timed_mutex/try_lock_until.md +++ b/reference/mutex/timed_mutex/try_lock_until.md @@ -52,7 +52,6 @@ bool try_lock_until(const chrono::time_point& abs_time); #include #include #include -#include #include class X { diff --git a/reference/mutex/timed_mutex/unlock.md b/reference/mutex/timed_mutex/unlock.md index 44a08e7c18..1dfe0ab39f 100644 --- a/reference/mutex/timed_mutex/unlock.md +++ b/reference/mutex/timed_mutex/unlock.md @@ -34,7 +34,6 @@ void unlock(); #include #include #include -#include class X { std::timed_mutex mtx_; diff --git a/reference/mutex/unique_lock/lock.md b/reference/mutex/unique_lock/lock.md index 0322f65379..a685df3279 100644 --- a/reference/mutex/unique_lock/lock.md +++ b/reference/mutex/unique_lock/lock.md @@ -43,7 +43,6 @@ pm->lock(); #include #include #include -#include class X { std::mutex mtx_; diff --git a/reference/mutex/unique_lock/try_lock.md b/reference/mutex/unique_lock/try_lock.md index 2c3af64459..f20d5a5439 100644 --- a/reference/mutex/unique_lock/try_lock.md +++ b/reference/mutex/unique_lock/try_lock.md @@ -47,7 +47,6 @@ pm->try_lock(); #include #include #include -#include #include class X { diff --git a/reference/mutex/unique_lock/try_lock_for.md b/reference/mutex/unique_lock/try_lock_for.md index 7853ef3f6a..01db8a7d4d 100644 --- a/reference/mutex/unique_lock/try_lock_for.md +++ b/reference/mutex/unique_lock/try_lock_for.md @@ -49,7 +49,6 @@ pm->try_lock_for(rel_time); #include #include #include -#include #include class X { diff --git a/reference/mutex/unique_lock/try_lock_until.md b/reference/mutex/unique_lock/try_lock_until.md index 82d319734a..308a1ccc6e 100644 --- a/reference/mutex/unique_lock/try_lock_until.md +++ b/reference/mutex/unique_lock/try_lock_until.md @@ -51,7 +51,6 @@ pm->try_lock_until(abs_time); #include #include #include -#include #include class X { diff --git a/reference/mutex/unique_lock/unlock.md b/reference/mutex/unique_lock/unlock.md index fcffc44a28..f7d5514603 100644 --- a/reference/mutex/unique_lock/unlock.md +++ b/reference/mutex/unique_lock/unlock.md @@ -40,7 +40,6 @@ pm->unlock(); #include #include #include -#include class X { std::mutex mtx_; diff --git a/reference/unordered_set/unordered_multiset/erase.md b/reference/unordered_set/unordered_multiset/erase.md index b32770c2f0..57702ba2a5 100644 --- a/reference/unordered_set/unordered_multiset/erase.md +++ b/reference/unordered_set/unordered_multiset/erase.md @@ -63,7 +63,6 @@ iterator erase(const_iterator first, const_iterator last); // (4) C++11 #include #include #include -#include template void print(const char* label, const C& c, std::ostream& os = std::cout) diff --git a/reference/unordered_set/unordered_multiset/extract.md b/reference/unordered_set/unordered_multiset/extract.md index 1b01a7a473..13dd5676ab 100644 --- a/reference/unordered_set/unordered_multiset/extract.md +++ b/reference/unordered_set/unordered_multiset/extract.md @@ -29,7 +29,6 @@ node_type extract(const key_type& x); (2) ```cpp example #include -#include #include class noncopyable { diff --git a/reference/unordered_set/unordered_set/erase.md b/reference/unordered_set/unordered_set/erase.md index cab1403e86..ed87777ada 100644 --- a/reference/unordered_set/unordered_set/erase.md +++ b/reference/unordered_set/unordered_set/erase.md @@ -63,7 +63,6 @@ iterator erase(const_iterator first, const_iterator last); // (4) C++11 #include #include #include -#include template void print(const char* label, const C& c, std::ostream& os = std::cout) diff --git a/reference/unordered_set/unordered_set/extract.md b/reference/unordered_set/unordered_set/extract.md index 94ac44415d..b1d0a69f10 100644 --- a/reference/unordered_set/unordered_set/extract.md +++ b/reference/unordered_set/unordered_set/extract.md @@ -29,7 +29,6 @@ node_type extract(const key_type& x); (2) ```cpp example #include -#include #include class noncopyable { From 24061d75bba42c3b7e2f7175db090c7e1ec31e6b Mon Sep 17 00:00:00 2001 From: suomesta Date: Mon, 11 Sep 2023 22:58:30 +0900 Subject: [PATCH 0453/3948] fix wrong type in a sample --- reference/set/multiset/emplace.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/set/multiset/emplace.md b/reference/set/multiset/emplace.md index 5a80f030da..ea18815dbf 100644 --- a/reference/set/multiset/emplace.md +++ b/reference/set/multiset/emplace.md @@ -51,7 +51,7 @@ bool operator<(const s& lhs, const s& rhs) int main() { - std::set c; + std::multiset c; c.emplace(42); From 0dee2f1c26e7ffcdac6217e51c420d3b1b45bbb2 Mon Sep 17 00:00:00 2001 From: suomesta Date: Mon, 11 Sep 2023 23:13:45 +0900 Subject: [PATCH 0454/3948] fix typo --- reference/flat_map/flat_map/crend.md | 2 +- reference/flat_map/flat_map/end.md | 2 +- reference/flat_map/flat_map/equal_range.md | 2 +- reference/flat_map/flat_map/lower_bound.md | 2 +- reference/flat_map/flat_map/upper_bound.md | 2 +- reference/map/multimap/op_constructor.md | 2 +- reference/set/multiset/erase.md | 2 +- reference/set/multiset/insert.md | 2 +- reference/set/multiset/op_assign.md | 2 +- reference/set/multiset/value_comp.md | 2 +- reference/unordered_map/unordered_map/count.md | 4 ++-- reference/unordered_map/unordered_map/equal_range.md | 2 +- reference/unordered_map/unordered_map/find.md | 2 +- reference/unordered_map/unordered_map/op_not_equal.md | 2 +- reference/unordered_map/unordered_multimap/cend-size_type.md | 2 +- reference/unordered_map/unordered_multimap/count.md | 2 +- reference/unordered_map/unordered_multimap/equal_range.md | 2 +- reference/unordered_map/unordered_multimap/erase.md | 2 +- reference/unordered_map/unordered_multimap/find.md | 2 +- 19 files changed, 20 insertions(+), 20 deletions(-) diff --git a/reference/flat_map/flat_map/crend.md b/reference/flat_map/flat_map/crend.md index ed608420b3..466666a994 100644 --- a/reference/flat_map/flat_map/crend.md +++ b/reference/flat_map/flat_map/crend.md @@ -17,7 +17,7 @@ const_reverse_iterator crend() const noexcept; ## 戻り値 反転シーケンスの終端を指す逆イテレータ。 -`const_reverse_iterator` はメンバ型である。`map` クラステンプレートにおいて、これらは逆ランダムアクセスイテレータであり、`reverse_iterator` と定義される。 +`const_reverse_iterator` はメンバ型である。`flat_map` クラステンプレートにおいて、これらは逆ランダムアクセスイテレータであり、`reverse_iterator` と定義される。 ## 例 diff --git a/reference/flat_map/flat_map/end.md b/reference/flat_map/flat_map/end.md index a892c0acc1..c91a98c0e8 100644 --- a/reference/flat_map/flat_map/end.md +++ b/reference/flat_map/flat_map/end.md @@ -16,7 +16,7 @@ const_iterator end() const noexcept; ## 戻り値 コンテナの最後の要素の次を参照するイテレータ。 -`iterator` と `const_iterator` はいずれもメンバ型である。`map` クラステンプレートにおいて、これらはランダムアクセスイテレータである。 +`iterator` と `const_iterator` はいずれもメンバ型である。`flat_map` クラステンプレートにおいて、これらはランダムアクセスイテレータである。 ## 計算量 diff --git a/reference/flat_map/flat_map/equal_range.md b/reference/flat_map/flat_map/equal_range.md index 7fb856d0b2..2ecacea396 100644 --- a/reference/flat_map/flat_map/equal_range.md +++ b/reference/flat_map/flat_map/equal_range.md @@ -21,7 +21,7 @@ pair * pair[link /reference/utility/pair.md] ## 概要 -コンテナ内の、`x` と等しいキー要素を全て含む範囲の境界を返す。`map` コンテナではキーの重複は無いため、この範囲は最大一つの要素を含む。 +コンテナ内の、`x` と等しいキー要素を全て含む範囲の境界を返す。`flat_map` コンテナではキーの重複は無いため、この範囲は最大一つの要素を含む。 もし `x` がコンテナ内のどのキーともマッチしなかった場合、戻り値の範囲は長さ 0 になり、両方のイテレータは `x` より大きく最も近い値を指す。そうでない場合、`x` がコンテナ内の全ての要素よりも大きい場合は [`end`](end.md) を指す。 diff --git a/reference/flat_map/flat_map/lower_bound.md b/reference/flat_map/flat_map/lower_bound.md index 092a2e6b9a..c8ecf0c493 100644 --- a/reference/flat_map/flat_map/lower_bound.md +++ b/reference/flat_map/flat_map/lower_bound.md @@ -22,7 +22,7 @@ const_iterator lower_bound(const K& x) const; // (4) C++23 [`upper_bound()`](upper_bound.md) とは異なり、このメンバ関数は `x` より大きいだけでなく、`x` と等しい場合であってもその要素へのイテレータを返す。 -内部的には `map` コンテナ内の全ての要素は常に比較オブジェクトが定義する基準に沿って並んでいるため、この関数が返すいずれかの後に続く全ての要素が `x` より大きいか等しいことに注意。 +内部的には `flat_map` コンテナ内の全ての要素は常に比較オブジェクトが定義する基準に沿って並んでいるため、この関数が返すいずれかの後に続く全ての要素が `x` より大きいか等しいことに注意。 - (1) : `key_type`型のキーを受け取り、そのキーより小さくない最初の要素へのイテレータを取得する。 - (2) : `key_type`と比較可能な`K`型のキーを受け取り、そのキーより小さくない最初の要素へのイテレータを取得する。 diff --git a/reference/flat_map/flat_map/upper_bound.md b/reference/flat_map/flat_map/upper_bound.md index 6ec16277b6..011173b505 100644 --- a/reference/flat_map/flat_map/upper_bound.md +++ b/reference/flat_map/flat_map/upper_bound.md @@ -22,7 +22,7 @@ const_iterator upper_bound(const K& x) const; // (4) C++23 [`lower_bound()`](lower_bound.md) と異なり、このメンバ関数は `x` と等しいときは要素へのイテレータを返さず、それは大きい場合にのみ要素へのイテレータを返す。 -内部的に、`map` コンテナ内の全ての要素は常に比較オブジェクトで定義された基準に従って並ぶため、この関数が返す値に続く全ての要素は `x` より大きいことに注意。 +内部的に、`flat_map` コンテナ内の全ての要素は常に比較オブジェクトで定義された基準に従って並ぶため、この関数が返す値に続く全ての要素は `x` より大きいことに注意。 - (1) : `key_type`型のキーを受け取り、そのキーより大きい最初の要素へのイテレータを取得する。 - (2) : `key_type`と比較可能な`K`型のキーを受け取り、そのキーより大きい最初の要素へのイテレータを取得する。 diff --git a/reference/map/multimap/op_constructor.md b/reference/map/multimap/op_constructor.md index fce0f82a63..b2d9289a01 100644 --- a/reference/map/multimap/op_constructor.md +++ b/reference/map/multimap/op_constructor.md @@ -109,7 +109,7 @@ multimap(initializer_list init, * ls.emplace_back[link ../../list/list/emplace_back.md] なお、C++14 では同様の理由で (11) の形式も新たに追加されているが、こちらは存在しなくてもエラーとはならない。 - (`map(init, alloc)` の形式の構築では、(11) の形式が無い場合でも (10) の形式を用いて `init` から一時 `map` が構築され、`alloc` と共に (9) の形式に引き渡される) + (`multimap(init, alloc)` の形式の構築では、(11) の形式が無い場合でも (10) の形式を用いて `init` から一時 `multimap` が構築され、`alloc` と共に (9) の形式に引き渡される) ## 例 diff --git a/reference/set/multiset/erase.md b/reference/set/multiset/erase.md index f4bfc5a4dc..e17f80d9c5 100644 --- a/reference/set/multiset/erase.md +++ b/reference/set/multiset/erase.md @@ -33,7 +33,7 @@ iterator erase(const_iterator first, const_iterator last); // (5) C++11 ## パラメータ - `position` : `multiset` から削除する単一要素を指すイテレータ。`iterator`、および、`const_iterator` はメンバ型であり、双方向イテレータとして定義される。 -- `x` : `set` から削除される値。`key_type` はメンバ型であり、`multiset` コンテナの中で `Key` の別名として定義される。ここで `Key` は 1 番目のテンプレートパラメータであり、コンテナに格納される要素の型である。 +- `x` : `multiset` から削除される値。`key_type` はメンバ型であり、`multiset` コンテナの中で `Key` の別名として定義される。ここで `Key` は 1 番目のテンプレートパラメータであり、コンテナに格納される要素の型である。 - `first, last` : `multiset` コンテナ内の、削除されるイテレータ範囲 `[first, last)` を指定するイテレータ。ここでいう範囲は `first` と `last` の間の全ての要素を含み、`first` が指す要素を含むが `last` が指す要素は含まない。 diff --git a/reference/set/multiset/insert.md b/reference/set/multiset/insert.md index d0259c30c1..c0124bbb4a 100644 --- a/reference/set/multiset/insert.md +++ b/reference/set/multiset/insert.md @@ -24,7 +24,7 @@ iterator insert(const_iterator hint, node_type&& nh); // (8) C++17 * initializer_list[link /reference/initializer_list/initializer_list.md] ## 概要 -新しく一つの要素(引数 `x`, `y`を使う)、要素のシーケンス(入力イテレータまたは `initializer_list` を使う)または[ノードハンドル](/reference/node_handle/node_handle.md)を挿入することにより、 `set` コンテナを拡張する。 +新しく一つの要素(引数 `x`, `y`を使う)、要素のシーケンス(入力イテレータまたは `initializer_list` を使う)または[ノードハンドル](/reference/node_handle/node_handle.md)を挿入することにより、 `multiset` コンテナを拡張する。 `set` コンテナは重複した値を許さないため、挿入操作はそれぞれの要素が他のコンテナ内の既存要素と同じ値かどうかをチェックし、同じ要素がすでにあれば挿入されない。`multiset`の場合には、同じ値の要素でも挿入される。 diff --git a/reference/set/multiset/op_assign.md b/reference/set/multiset/op_assign.md index 6e43fa0755..ba93738df6 100644 --- a/reference/set/multiset/op_assign.md +++ b/reference/set/multiset/op_assign.md @@ -75,7 +75,7 @@ Size of c2: 7 | 名前 | 説明 | |------------------------------|----------------| | [`insert`](insert.md) | 要素を挿入する | -| [`set`](op_constructor.md) | コンストラクタ | +| [`multiset`](op_constructor.md) | コンストラクタ | ## 参照 diff --git a/reference/set/multiset/value_comp.md b/reference/set/multiset/value_comp.md index 4c5322a651..520e564120 100644 --- a/reference/set/multiset/value_comp.md +++ b/reference/set/multiset/value_comp.md @@ -11,7 +11,7 @@ value_compare value_comp() const; ## 概要 コンテナに関連づけられた比較オブジェクトを返す。これはコンテナ内の二つの要素を比較するために利用できる。 この比較オブジェクトはオブジェクトの構築時に設定され、関数ポインタであっても関数オブジェクトであっても良い。いずれにせよこれは同じ型の 2 つの引数をとり、[狭義の弱順序](/reference/algorithm.md#strict-weak-ordering)に従って一つ目の引数が二つ目の引数の前になる場合に `true`、そうでない場合に `false` を返す。 -`set` コンテナでは、要素の値はキーそのものであり、従って `value_comp` とその兄弟メンバ関数である [`key_comp`](key_comp.md) は同じである。 +`multiset` コンテナでは、要素の値はキーそのものであり、従って `value_comp` とその兄弟メンバ関数である [`key_comp`](key_comp.md) は同じである。 ## 戻り値 diff --git a/reference/unordered_map/unordered_map/count.md b/reference/unordered_map/unordered_map/count.md index e22638aa11..c22a78e32e 100644 --- a/reference/unordered_map/unordered_map/count.md +++ b/reference/unordered_map/unordered_map/count.md @@ -13,7 +13,7 @@ size_type count(const K& k) const; // (2) C++20 ``` ## 概要 -キーを検索し、コンテナ内に見つかった要素の数を返す。`map` コンテナはキーの重複を許さないため、この関数は実際には要素が見つかったときに 1 を、そうでないときに 0 を返す。 +キーを検索し、コンテナ内に見つかった要素の数を返す。`unordered_map` コンテナはキーの重複を許さないため、この関数は実際には要素が見つかったときに 1 を、そうでないときに 0 を返す。 - (1) : キー`x`を検索し、合致する要素数を取得する - (2) : キー`k`を透過的に検索し、合致する要素数を取得する @@ -22,7 +22,7 @@ size_type count(const K& k) const; // (2) C++20 ## パラメータ -- `x` : 検索するキー値。`key_type` はメンバ型であり、`map` コンテナの中で `Key` の別名として定義される。ここで `Key` は 1 番目のテンプレートパラメータである。 +- `x` : 検索するキー値。`key_type` はメンバ型であり、`unordered_map` コンテナの中で `Key` の別名として定義される。ここで `Key` は 1 番目のテンプレートパラメータである。 - `k` : 検索するキー。`key_type`と透過的に比較可能な型`K`型のキーである。 diff --git a/reference/unordered_map/unordered_map/equal_range.md b/reference/unordered_map/unordered_map/equal_range.md index 43a2c9b737..ef259a158c 100644 --- a/reference/unordered_map/unordered_map/equal_range.md +++ b/reference/unordered_map/unordered_map/equal_range.md @@ -34,7 +34,7 @@ pair ## パラメータ -- `x` : 比較されるキー値。`key_type` はメンバ型であり、`map` コンテナ内で `Key` の別名として定義される。ここで `Key` は最初のテンプレートパラメータである。 +- `x` : 比較されるキー値。`key_type` はメンバ型であり、`unordered_map` コンテナ内で `Key` の別名として定義される。ここで `Key` は最初のテンプレートパラメータである。 - `k` : 検索するキー。`key_type`と透過的に比較可能な型`K`型のキーである。 diff --git a/reference/unordered_map/unordered_map/find.md b/reference/unordered_map/unordered_map/find.md index d8c66af5dc..2c8bafe508 100644 --- a/reference/unordered_map/unordered_map/find.md +++ b/reference/unordered_map/unordered_map/find.md @@ -25,7 +25,7 @@ template const_iterator find(const K& k) const; // (4) C++20 ## パラメータ -- `x` : 検索するキー。`key_type` は `map` コンテナの中で `Key` の別名として定義される。ここで `Key` は 1 番目のテンプレートパラメータである。 +- `x` : 検索するキー。`key_type` は `unordered_map` コンテナの中で `Key` の別名として定義される。ここで `Key` は 1 番目のテンプレートパラメータである。 - `k` : 検索するキー。`key_type`と透過的に比較可能な型`K`型のキーである。 diff --git a/reference/unordered_map/unordered_map/op_not_equal.md b/reference/unordered_map/unordered_map/op_not_equal.md index 076e24022b..1675978af1 100644 --- a/reference/unordered_map/unordered_map/op_not_equal.md +++ b/reference/unordered_map/unordered_map/op_not_equal.md @@ -14,7 +14,7 @@ namespace std { ``` ## 概要 -`unordered_set` オブジェクトを非等値比較する。 +`unordered_map` オブジェクトを非等値比較する。 ## 要件 diff --git a/reference/unordered_map/unordered_multimap/cend-size_type.md b/reference/unordered_map/unordered_multimap/cend-size_type.md index 76edc3c796..b5795611b0 100644 --- a/reference/unordered_map/unordered_multimap/cend-size_type.md +++ b/reference/unordered_map/unordered_multimap/cend-size_type.md @@ -12,7 +12,7 @@ const_local_iterator cend(size_type n) const; ## 概要 インデックス(添え字)で指定したバケット内の最後の要素の次を指す読み取り専用イテレータを取得する。 -`unordered_map` は非順序連想コンテナであるため「最後」に特に意味はないが、[`cbegin(size_type)`](cbegin-size_type.md) で得られたイテレータを `cend(size_type)` まで `operator++()` でイテレートすることで当該バケットの要素を漏れなくダブりなく走査することができる。 +`unordered_multimap` は非順序連想コンテナであるため「最後」に特に意味はないが、[`cbegin(size_type)`](cbegin-size_type.md) で得られたイテレータを `cend(size_type)` まで `operator++()` でイテレートすることで当該バケットの要素を漏れなくダブりなく走査することができる。 ## 要件 diff --git a/reference/unordered_map/unordered_multimap/count.md b/reference/unordered_map/unordered_multimap/count.md index 8e6b3a2be8..532d65b503 100644 --- a/reference/unordered_map/unordered_multimap/count.md +++ b/reference/unordered_map/unordered_multimap/count.md @@ -22,7 +22,7 @@ size_type count(const K& k) const; // (2) C++20 ## パラメータ -- `x` : 検索するキー値。`key_type` はメンバ型であり、`map` コンテナの中で `Key` の別名として定義される。ここで `Key` は 1 番目のテンプレートパラメータである。 +- `x` : 検索するキー値。`key_type` はメンバ型であり、`unordered_multimap` コンテナの中で `Key` の別名として定義される。ここで `Key` は 1 番目のテンプレートパラメータである。 - `k` : 検索するキー。`key_type`と透過的に比較可能な型`K`型のキーである。 diff --git a/reference/unordered_map/unordered_multimap/equal_range.md b/reference/unordered_map/unordered_multimap/equal_range.md index ed5e4be65c..ae0904c154 100644 --- a/reference/unordered_map/unordered_multimap/equal_range.md +++ b/reference/unordered_map/unordered_multimap/equal_range.md @@ -34,7 +34,7 @@ pair ## パラメータ -- `x` : 比較されるキー値。`key_type` はメンバ型であり、`map` コンテナ内で `Key` の別名として定義される。ここで `Key` は最初のテンプレートパラメータである。 +- `x` : 比較されるキー値。`key_type` はメンバ型であり、`unordered_multimap` コンテナ内で `Key` の別名として定義される。ここで `Key` は最初のテンプレートパラメータである。 - `k` : 検索するキー。`key_type`と透過的に比較可能な型`K`型のキーである。 diff --git a/reference/unordered_map/unordered_multimap/erase.md b/reference/unordered_map/unordered_multimap/erase.md index e93bb2ddfe..f062651279 100644 --- a/reference/unordered_map/unordered_multimap/erase.md +++ b/reference/unordered_map/unordered_multimap/erase.md @@ -149,7 +149,7 @@ return value: (3rd, 33) after : (9th, 9), (3rd, 33), (3rd, 3), (1st, 1), ``` -注:[`unordered_map`](/reference/unordered_map/unordered_map.md) は非順序連想コンテナであるため、出力順序は無意味であることに注意 +注:[`unordered_multimap`](/reference/unordered_map/unordered_multimap.md) は非順序連想コンテナであるため、出力順序は無意味であることに注意 ### イテレート中に要素を削除する diff --git a/reference/unordered_map/unordered_multimap/find.md b/reference/unordered_map/unordered_multimap/find.md index 98c1c2309b..4ca158824c 100644 --- a/reference/unordered_map/unordered_multimap/find.md +++ b/reference/unordered_map/unordered_multimap/find.md @@ -27,7 +27,7 @@ template const_iterator find(const K& k) const; // (4) C++20 ## パラメータ -- `x` : 検索するキー。`key_type` は `map` コンテナの中で `Key` の別名として定義される。ここで `Key` は 1 番目のテンプレートパラメータである。 +- `x` : 検索するキー。`key_type` は `unordered_multimap` コンテナの中で `Key` の別名として定義される。ここで `Key` は 1 番目のテンプレートパラメータである。 - `k` : 検索するキー。`key_type`と透過的に比較可能な型`K`型のキーである。 From d83c6a4dbf2faf6b49a7de4a6b24e77b68cf4edb Mon Sep 17 00:00:00 2001 From: suomesta Date: Mon, 11 Sep 2023 23:15:18 +0900 Subject: [PATCH 0455/3948] fix link error --- reference/flat_map/flat_map/cbegin.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/flat_map/flat_map/cbegin.md b/reference/flat_map/flat_map/cbegin.md index b128c228b2..62057823d9 100644 --- a/reference/flat_map/flat_map/cbegin.md +++ b/reference/flat_map/flat_map/cbegin.md @@ -76,7 +76,7 @@ int main() | [`flat_map::begin`](begin.md) | 先頭を指すイテレータを取得する | | [`flat_map::end`](end.md) | 末尾の次を指すイテレータを取得する | | [`flat_map::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | -| [`flat_map::rbegin`]rbegin.md) | 末尾を指す逆イテレータを取得する | +| [`flat_map::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | | [`flat_map::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_map::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`flat_map::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | From 7341bb7e271c2e73f7a428f3371122cfacf11caf Mon Sep 17 00:00:00 2001 From: suomesta Date: Mon, 11 Sep 2023 23:17:31 +0900 Subject: [PATCH 0456/3948] add link --- reference/scoped_allocator/scoped_allocator_adaptor/op_equal.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/scoped_allocator/scoped_allocator_adaptor/op_equal.md b/reference/scoped_allocator/scoped_allocator_adaptor/op_equal.md index 01fe2b8223..12e1ecb9a7 100644 --- a/reference/scoped_allocator/scoped_allocator_adaptor/op_equal.md +++ b/reference/scoped_allocator/scoped_allocator_adaptor/op_equal.md @@ -19,7 +19,7 @@ namespace std { ## 戻り値 `sizeof...(InnerAlloc) == 0`であるならば、`a.`[outer_allocator()](outer_allocator.md) `== b.`[`outer_allocator()`](outer_allocator.md)の結果を返す。 -そうでなければ、`a.`[outer_allocator()](outer_allocator.md) `== b.`[`outer_allocator()`](outer_allocator.md) `&& a.`[`inner_allocator()`](inner_allocator.md) `== b.`[`inner_allocator()`]の結果を返す。 +そうでなければ、`a.`[outer_allocator()](outer_allocator.md) `== b.`[`outer_allocator()`](outer_allocator.md) `&& a.`[`inner_allocator()`](inner_allocator.md) `== b.`[`inner_allocator()`](inner_allocator.md)の結果を返す。 ## 例 From a14d042b837ef68612abe6e74371882ba4f9e287 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 12 Sep 2023 16:14:40 +0900 Subject: [PATCH 0457/3948] =?UTF-8?q?as=5Fconst=5Fview=20begin/end?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20#1084?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/as_const_view.md | 4 +- reference/ranges/as_const_view/begin.md | 71 +++++++++++++++++++++++++ reference/ranges/as_const_view/end.md | 70 ++++++++++++++++++++++++ 3 files changed, 143 insertions(+), 2 deletions(-) create mode 100644 reference/ranges/as_const_view/begin.md create mode 100644 reference/ranges/as_const_view/end.md diff --git a/reference/ranges/as_const_view.md b/reference/ranges/as_const_view.md index a1234d6d9a..1112e23922 100644 --- a/reference/ranges/as_const_view.md +++ b/reference/ranges/as_const_view.md @@ -47,8 +47,8 @@ namespace std::ranges { |--------------------------------------------------|----------------------------------|----------------| | [`(constructor)`](as_const_view/op_constructor.md) | コンストラクタ | C++23 | | [`base`](as_const_view/base.md) | `V`の参照を取得する | C++23 | -| [`begin`](as_const_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++23 | -| [`end`](as_const_view/end.md.nolink) | 番兵を取得する | C++23 | +| [`begin`](as_const_view/begin.md) | 先頭を指すイテレータを取得する | C++23 | +| [`end`](as_const_view/end.md) | 番兵を取得する | C++23 | | [`size`](as_const_view/size.md) | 要素数を取得する | C++23 | ## 継承しているメンバ関数 diff --git a/reference/ranges/as_const_view/begin.md b/reference/ranges/as_const_view/begin.md new file mode 100644 index 0000000000..e52b706ce5 --- /dev/null +++ b/reference/ranges/as_const_view/begin.md @@ -0,0 +1,71 @@ +# begin +* ranges[meta header] +* std::ranges[meta namespace] +* as_const_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr auto begin() requires (!simple-view); // (1) +constexpr auto begin() const requires range; // (2) +``` +* simple-view[link /reference/ranges/simple-view.md] +* range[link /reference/ranges/range.md] + +## 概要 + +`view`の先頭要素を指すイテレータを取得する。 + +## 戻り値 + +入力`view`(`V`)のオブジェクトを`base_`というメンバに保持するとして、(1)(2)どちらも + +```cpp +return ranges::cbegin(base_); +``` +* cbegin[link /reference/ranges/cbegin.md] + +## 例 + +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + std::ranges::as_const_view acv{vec}; + + auto it = acv.begin(); + + std::cout << *it << '\n'; + + ++it; + std::cout << *it << '\n'; + + // 書き換え不可 + //*it = 0; +} +``` +* begin[color ff0000] + +### 出力 + +``` +1 +2 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) diff --git a/reference/ranges/as_const_view/end.md b/reference/ranges/as_const_view/end.md new file mode 100644 index 0000000000..6485e9400a --- /dev/null +++ b/reference/ranges/as_const_view/end.md @@ -0,0 +1,70 @@ +# end +* ranges[meta header] +* std::ranges[meta namespace] +* as_const_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr auto end() requires (!simple-view); // (1) +constexpr auto end() const requires range; // (2) +``` +* simple-view[link /reference/ranges/simple-view.md] +* range[link /reference/ranges/range.md] + +## 概要 + +`view`の番兵を取得する。 + +## 戻り値 + +入力`view`(`V`)のオブジェクトを`base_`というメンバに保持するとして、(1)(2)どちらも + +```cpp +return ranges::cend(base_); +``` +* cend[link /reference/ranges/cend.md] + +## 例 + +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + std::ranges::as_const_view acv{vec}; + + auto it = acv.begin(); + auto se = acv.end(); + + assert(it != se); + + --se; + + std::cout << *se << '\n' +} +``` +* begin[color ff0000] +* subrange[link /reference/ranges/subrange.md] + +### 出力 + +``` +5 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) From 595b9bb33fe0907ced03e0d5201cdce1c4da87c4 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 12 Sep 2023 17:07:33 +0900 Subject: [PATCH 0458/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE?= =?UTF-8?q?=E9=A3=BE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/as_const_view/end.md | 1 - 1 file changed, 1 deletion(-) diff --git a/reference/ranges/as_const_view/end.md b/reference/ranges/as_const_view/end.md index 6485e9400a..f88ddfec7f 100644 --- a/reference/ranges/as_const_view/end.md +++ b/reference/ranges/as_const_view/end.md @@ -48,7 +48,6 @@ int main() { } ``` * begin[color ff0000] -* subrange[link /reference/ranges/subrange.md] ### 出力 From 82ef3319985de924be1f0198d05ccaf0d2eb0500 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 12 Sep 2023 17:09:00 +0900 Subject: [PATCH 0459/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE?= =?UTF-8?q?=E9=A3=BE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/as_const_view/end.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/ranges/as_const_view/end.md b/reference/ranges/as_const_view/end.md index f88ddfec7f..3783bdaadc 100644 --- a/reference/ranges/as_const_view/end.md +++ b/reference/ranges/as_const_view/end.md @@ -47,7 +47,7 @@ int main() { std::cout << *se << '\n' } ``` -* begin[color ff0000] +* end[color ff0000] ### 出力 From b950e124456e4d4abfc26c91e53ec5c13895dc9e Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 13 Sep 2023 12:06:29 +0900 Subject: [PATCH 0460/3948] =?UTF-8?q?as=5Fconst=5Fview=E6=8E=A8=E8=AB=96?= =?UTF-8?q?=E8=A3=9C=E5=8A=A9=E3=81=AE=E8=BF=BD=E5=8A=A0=20#1084?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/as_const_view.md | 2 +- .../as_const_view/op_deduction_guide.md | 63 +++++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 reference/ranges/as_const_view/op_deduction_guide.md diff --git a/reference/ranges/as_const_view.md b/reference/ranges/as_const_view.md index 1112e23922..9a4832ccb6 100644 --- a/reference/ranges/as_const_view.md +++ b/reference/ranges/as_const_view.md @@ -67,7 +67,7 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |-------------------------------------------------------|------------------------------|----------------| -| [`(deduction_guide)`](as_const_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | +| [`(deduction_guide)`](as_const_view/op_deduction_guide.md) | クラステンプレートの推論補助 | C++23 | ## 例 ```cpp example diff --git a/reference/ranges/as_const_view/op_deduction_guide.md b/reference/ranges/as_const_view/op_deduction_guide.md new file mode 100644 index 0000000000..1a33d8f8f4 --- /dev/null +++ b/reference/ranges/as_const_view/op_deduction_guide.md @@ -0,0 +1,63 @@ +# 推論補助 +* ranges[meta header] +* std::ranges[meta namespace] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template + as_const_view(R&&) -> as_const_view>; +} +``` +* as_const_view[link ../as_const_view.md] +* all_t[link /reference/ranges/all.md] + +## 概要 + +[`as_const_view`](../as_const_view.md)クラステンプレートの型推論補助。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4}; + + std::ranges::as_const_view v1{vec}; + + static_assert(std::same_as< + decltype(v1), + std::ranges::as_const_view>> + >); + + std::ranges::as_const_view v2{std::vector{1, 2}}; + + static_assert(std::same_as< + decltype(v2), + std::ranges::as_const_view>> + >); +} +``` +* ref_view[link /reference/ranges/ref_view.md] +* owning_view[link /reference/ranges/owning_view.md] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) + From d8142c96f48d70c18df8b6138b6fbc0dcb5ea867 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 13 Sep 2023 12:18:46 +0900 Subject: [PATCH 0461/3948] =?UTF-8?q?=E6=A9=9F=E8=83=BD=E3=83=86=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=83=9E=E3=82=AF=E3=83=AD=E8=BF=BD=E5=8A=A0=20#1084?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23/feature_test_macros.md | 22 ++++++++++++++++++++++ reference/version.md | 1 + 2 files changed, 23 insertions(+) create mode 100644 lang/cpp23/feature_test_macros.md diff --git a/lang/cpp23/feature_test_macros.md b/lang/cpp23/feature_test_macros.md new file mode 100644 index 0000000000..c1b8095cab --- /dev/null +++ b/lang/cpp23/feature_test_macros.md @@ -0,0 +1,22 @@ +# 機能テストマクロ +* cpp23[meta cpp] + +## 概要 + +### 言語機能 + +| マクロ名 | 値 | 機能 | +|----------|----|------| +|||| + +### ライブラリ + +ライブラリの機能テストマクロは全て[``](/reference/version.md)でも提供される。 + +| マクロ名 | 値 | 機能 | ヘッダ | +|----------|----|------|--------| +|`__cpp_lib_ranges_as_const`|`202207L`|`ranges::cbegin`が常に定数イテレータを返すようにする|[``](/reference/ranges.md)| + +## 参照 + +- [SD-FeatureTest: Feature-Test Macros and Policies - isocpp](https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations) diff --git a/reference/version.md b/reference/version.md index 12a24a50d6..f937274186 100644 --- a/reference/version.md +++ b/reference/version.md @@ -13,6 +13,7 @@ - [C++14 機能テストマクロ](/lang/cpp14/feature_test_macros.md) - [C++17 機能テストマクロ](/lang/cpp17/feature_test_macros.md) - [C++20 機能テストマクロ](/lang/cpp20/feature_test_macros.md) +- [C++23 機能テストマクロ](/lang/cpp23/feature_test_macros.md) ## 参照 - [P0754R2 ``](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0754r2.pdf) From 01117d7bbb901725da0d53a89102f6f37df5dd3e Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 13 Sep 2023 17:19:33 +0900 Subject: [PATCH 0462/3948] =?UTF-8?q?as=5Fconst=5Fview::begin=20:=20?= =?UTF-8?q?=E5=BE=97=E3=82=89=E3=82=8C=E3=82=8B=E3=82=A4=E3=83=86=E3=83=AC?= =?UTF-8?q?=E3=83=BC=E3=82=BF=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6=E8=BF=BD?= =?UTF-8?q?=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/as_const_view/begin.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reference/ranges/as_const_view/begin.md b/reference/ranges/as_const_view/begin.md index e52b706ce5..4a1ef49137 100644 --- a/reference/ranges/as_const_view/begin.md +++ b/reference/ranges/as_const_view/begin.md @@ -25,6 +25,8 @@ return ranges::cbegin(base_); ``` * cbegin[link /reference/ranges/cbegin.md] +`as_const_view`を`views::as_const`から生成している場合、ここで得られるイテレータは常に[`basic_const_iterator`](/reference/iterator/basic_const_iterator.md)の特殊化となる。 + ## 例 ```cpp example From 2311413d25e3c2224c996bfb59f5f656d1762abd Mon Sep 17 00:00:00 2001 From: suomesta Date: Wed, 13 Sep 2023 21:12:33 +0900 Subject: [PATCH 0463/3948] fix typo --- reference/atomic/atomic_ref/op_minus_assign.md | 2 +- reference/chrono/weekday/op_decrement.md | 4 ++-- reference/chrono/year/op_decrement.md | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/reference/atomic/atomic_ref/op_minus_assign.md b/reference/atomic/atomic_ref/op_minus_assign.md index 2a9a6b50b7..3f1fb93059 100644 --- a/reference/atomic/atomic_ref/op_minus_assign.md +++ b/reference/atomic/atomic_ref/op_minus_assign.md @@ -10,7 +10,7 @@ T operator-=(T operand) const noexcept; ``` ## 概要 -加算を行う +減算を行う ## 戻り値 diff --git a/reference/chrono/weekday/op_decrement.md b/reference/chrono/weekday/op_decrement.md index c0a2f8e1ba..435cef2f8f 100644 --- a/reference/chrono/weekday/op_decrement.md +++ b/reference/chrono/weekday/op_decrement.md @@ -40,7 +40,7 @@ namespace chrono = std::chrono; int main() { - // 前置インクリメント + // 前置デクリメント { chrono::weekday w = chrono::Sunday; @@ -48,7 +48,7 @@ int main() assert(w == chrono::Saturday); } - // 後置インクリメント + // 後置デクリメント { chrono::weekday w = chrono::Sunday; diff --git a/reference/chrono/year/op_decrement.md b/reference/chrono/year/op_decrement.md index 0428ca1c59..199987b775 100644 --- a/reference/chrono/year/op_decrement.md +++ b/reference/chrono/year/op_decrement.md @@ -42,7 +42,7 @@ namespace chrono = std::chrono; int main() { - // 前置インクリメント + // 前置デクリメント { chrono::year y{2020}; @@ -50,7 +50,7 @@ int main() assert(static_cast(y) == 2019); } - // 後置インクリメント + // 後置デクリメント { chrono::year y{2020}; From 430fad23a6692db0c8d608f465732ec3ac1db083 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 14 Sep 2023 17:19:34 +0900 Subject: [PATCH 0464/3948] =?UTF-8?q?flat=5Fmap=20:=20operator=3D=3D?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20#1078?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map.md | 2 +- reference/flat_map/flat_map/op_equal.md | 73 +++++++++++++++++++++++++ 2 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 reference/flat_map/flat_map/op_equal.md diff --git a/reference/flat_map/flat_map.md b/reference/flat_map/flat_map.md index 04eee438c6..bc10182cc6 100644 --- a/reference/flat_map/flat_map.md +++ b/reference/flat_map/flat_map.md @@ -129,7 +129,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`operator==`](flat_map/op_equal.md.nolink) | 左辺と右辺が等しいかの判定を行う | C++23 | +| [`operator==`](flat_map/op_equal.md) | 左辺と右辺が等しいかの判定を行う | C++23 | | `bool operator!=(const flat_map& x, const flat_map& y);` | 左辺と右辺が等しくないかの判定を行う (`==`により使用可能) | C++23 | | [`operator<=>`](flat_map/op_compare_3way.md.nolink) | 三方比較を行う | C++23 | | `bool operator<(const flat_map& x, const flat_map& y);` | 左辺が右辺より小さいかの判定を行う (`<=>`により使用可能) | C++23 | diff --git a/reference/flat_map/flat_map/op_equal.md b/reference/flat_map/flat_map/op_equal.md new file mode 100644 index 0000000000..11299d74bc --- /dev/null +++ b/reference/flat_map/flat_map/op_equal.md @@ -0,0 +1,73 @@ +# operator== +* flat_map[meta header] +* std[meta namespace] +* function template[meta id-type] +* flat_map[meta class] + +```cpp +friend bool operator==(const flat_map& x, const flat_map& y); +``` + +## 概要 +`x` が `y` と等しいかどうかの判定を行う。 + + +## 戻り値 +以下と等価: + +```cpp +return equal(x.begin(), x.end(), y.begin(), y.end()); +``` +* equal[link /reference/algorithm/equal.md] +* begin()[link begin.md] +* end()[link end.md] + + +## 計算量 +[`size()`](size.md) に対して線形時間。ただし、`x`と`y`のサイズが異なる場合は定数時間。 + + +## 備考 +- この演算子により、以下の演算子が使用可能になる: + - `operator!=` + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_map fm1 = { + {3, 'a'}, + {1, 'b'}, + {4, 'c'} + }; + + std::flat_map fm2 = { + {3, 'a'}, + {1, 'b'}, + }; + + std::cout << std::boolalpha; + std::cout << (fm1 == fm1) << std::endl; + std::cout << (fm1 == fm2) << std::endl; + std::cout << (fm1 != fm1) << std::endl; + std::cout << (fm1 != fm2) << std::endl; +} +``` + +### 出力 +``` +true +false +false +true +``` + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + From 842cacbb7d3c6d5da2c4f25ab7c829b50571c8a7 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 19 Sep 2023 16:10:35 +0900 Subject: [PATCH 0465/3948] =?UTF-8?q?flat=5Fmap=20:=20operator<=3D>?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20#1078?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map.md | 2 +- .../flat_map/flat_map/op_compare_3way.md | 90 +++++++++++++++++++ 2 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 reference/flat_map/flat_map/op_compare_3way.md diff --git a/reference/flat_map/flat_map.md b/reference/flat_map/flat_map.md index bc10182cc6..c2887c226e 100644 --- a/reference/flat_map/flat_map.md +++ b/reference/flat_map/flat_map.md @@ -131,7 +131,7 @@ namespace std { |------|------|----------------| | [`operator==`](flat_map/op_equal.md) | 左辺と右辺が等しいかの判定を行う | C++23 | | `bool operator!=(const flat_map& x, const flat_map& y);` | 左辺と右辺が等しくないかの判定を行う (`==`により使用可能) | C++23 | -| [`operator<=>`](flat_map/op_compare_3way.md.nolink) | 三方比較を行う | C++23 | +| [`operator<=>`](flat_map/op_compare_3way.md) | 三方比較を行う | C++23 | | `bool operator<(const flat_map& x, const flat_map& y);` | 左辺が右辺より小さいかの判定を行う (`<=>`により使用可能) | C++23 | | `bool operator<=(const flat_map& x, const flat_map& y);` | 左辺が右辺より小さいか等しいかの判定を行う (`<=>`により使用可能) | C++23 | | `bool operator>(const flat_map& x, const flat_map& y);` | 左辺が右辺より大きいかの判定を行う (`<=>`により使用可能) | C++23 | diff --git a/reference/flat_map/flat_map/op_compare_3way.md b/reference/flat_map/flat_map/op_compare_3way.md new file mode 100644 index 0000000000..40c926b924 --- /dev/null +++ b/reference/flat_map/flat_map/op_compare_3way.md @@ -0,0 +1,90 @@ +# operator<=> +* flat_map[meta header] +* std[meta namespace] +* function template[meta id-type] +* flat_map[meta class] +* cpp23[meta cpp] + +```cpp +synth-three-way-result + operator<=>(const flat_map& x, + const flat_map& y); // (1) C++23 +``` + +## 概要 +`flat_map`オブジェクトの三方比較を行う。 + + +## テンプレートパラメータ制約 +- 型 (`const`) `value_type` の値に対して`operator<=>`が定義されるか、型 (`const`) `value_type` の値に対して`operator<`が定義され全順序をもつこと + + +## 効果 +```cpp +return lexicographical_compare_three_way( + x.begin(), x.end(), + y.begin(), y.end(), + synth-three-way); +``` +* lexicographical_compare_three_way[link /reference/algorithm/lexicographical_compare_three_way.md] +* begin()[link begin.md] +* end()[link end.md] + + +## 計算量 +線形時間 + + +## 備考 +- この演算子により、以下の演算子が使用可能になる: + - `operator<` + - `operator<=` + - `operator>` + - `operator>=` + + +## 例 +```cpp example +#include +#include + +int main() +{ + stdx::flat_map fm1 = { + {3, 'a'}, + {1, 'b'}, + {4, 'c'} + }; + + stdx::flat_map fm2 = { + {3, 'a'}, + {1, 'b'}, + }; + + std::cout << std::boolalpha; + std::cout << ((fm1 <=> fm1) == 0) << std::endl; + std::cout << (fm1 < fm2) << std::endl; + std::cout << (fm1 <= fm1) << std::endl; + std::cout << (fm1 > fm2) << std::endl; + std::cout << (fm2 >= fm1) << std::endl; +} +``` + +### 出力 +``` +true +false +true +true +false +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + From 194a6b77fcf421e024c1838300c6522302775323 Mon Sep 17 00:00:00 2001 From: nishidate-yuki Date: Thu, 21 Sep 2023 23:17:30 +0900 Subject: [PATCH 0466/3948] fix typo --- reference/algorithm/lexicographical_compare_three_way.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/algorithm/lexicographical_compare_three_way.md b/reference/algorithm/lexicographical_compare_three_way.md index 6897cc9093..7daeae3f09 100644 --- a/reference/algorithm/lexicographical_compare_three_way.md +++ b/reference/algorithm/lexicographical_compare_three_way.md @@ -66,7 +66,7 @@ namespace std { ## 戻り値 戻り値型となる比較カテゴリ型を`Cat`とすると、 -イテレータ範囲`[first1, last1)`が、辞書式比較でイテレータ範囲`[first2, last2)`より大きい場合は`Cat::greator`を返し、小さい場合`Cat::less`を返し、等しいのならば`Cat::equivalent`を返す。 +イテレータ範囲`[first1, last1)`が、辞書式比較でイテレータ範囲`[first2, last2)`より大きい場合は`Cat::greater`を返し、小さい場合`Cat::less`を返し、等しいのならば`Cat::equivalent`を返す。 ## 計算量 From 20a027aad1db4757d4cbed18de465c1af86c3403 Mon Sep 17 00:00:00 2001 From: nishidate-yuki Date: Thu, 21 Sep 2023 23:25:24 +0900 Subject: [PATCH 0467/3948] fix typo --- lang/cpp20/consistent_comparison.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp20/consistent_comparison.md b/lang/cpp20/consistent_comparison.md index e3a13d8eba..c13451d445 100644 --- a/lang/cpp20/consistent_comparison.md +++ b/lang/cpp20/consistent_comparison.md @@ -80,7 +80,7 @@ auto comp = a <=> b; //全て未定義動作 bool is_less = comp == 1; -bool is_greator = -1 < comp +bool is_greater = -1 < comp bool is_equal = comp == 0.0; ``` From 42414ad076addfa1b2a17d0e398a0351564de153 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 21 Sep 2023 23:36:59 +0900 Subject: [PATCH 0468/3948] =?UTF-8?q?NG=E3=83=AF=E3=83=BC=E3=83=89?= =?UTF-8?q?=E3=81=ABgreator=20(greater=E3=81=AEtypo)=20=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=20#1168?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/script/ngword_check.py | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/script/ngword_check.py b/.github/workflows/script/ngword_check.py index 2403d87f38..4779e27d66 100644 --- a/.github/workflows/script/ngword_check.py +++ b/.github/workflows/script/ngword_check.py @@ -9,6 +9,7 @@ ("", "condtion", "condition"), ("", "eror", "error"), ("", "exposion", "exposition"), + ("", "greator", "greater"), ("", "noexpcet", "noexcept"), ("", "protmise_type", "promise_type"), ("", "pvalue", "prvalue"), From e3a410686a00c48fe624311ba1d358694868550d Mon Sep 17 00:00:00 2001 From: nishidate-yuki Date: Fri, 22 Sep 2023 00:30:33 +0900 Subject: [PATCH 0469/3948] fix spell "generetor" --- lang/cpp20/coroutines.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp20/coroutines.md b/lang/cpp20/coroutines.md index 4796f99c3a..c63b0b0617 100644 --- a/lang/cpp20/coroutines.md +++ b/lang/cpp20/coroutines.md @@ -28,7 +28,7 @@ for (int v: g) { 一般的なアプリケーション実装者からの利用を想定した、ジェネレータや非同期タスク・非同期I/Oといったハイレベルなコルーチンライブラリは、C++23以降での導入にむけて検討されている。 -C++23ではジェネレータコルーチンを実現する[``](/reference/generator.md)が追加された。 +C++23ではジェネレータコルーチンを実現する[``](/reference/generator.md)が追加された。 ### 特徴 From 852dd814b1c207fbd7d786862ad1f7647b7e7f47 Mon Sep 17 00:00:00 2001 From: nishidate-yuki Date: Fri, 22 Sep 2023 00:30:54 +0900 Subject: [PATCH 0470/3948] add "generetor" to NG words --- .github/workflows/script/ngword_check.py | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/script/ngword_check.py b/.github/workflows/script/ngword_check.py index 4779e27d66..c34913155a 100644 --- a/.github/workflows/script/ngword_check.py +++ b/.github/workflows/script/ngword_check.py @@ -9,6 +9,7 @@ ("", "condtion", "condition"), ("", "eror", "error"), ("", "exposion", "exposition"), + ("", "generetor", "generator"), ("", "greator", "greater"), ("", "noexpcet", "noexcept"), ("", "protmise_type", "promise_type"), From 4838b94398173fdae766f945fbcf2b2a2c42b088 Mon Sep 17 00:00:00 2001 From: nishidate-yuki Date: Fri, 22 Sep 2023 00:33:21 +0900 Subject: [PATCH 0471/3948] fix closing parenthesis --- lang/cpp20/coroutines.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp20/coroutines.md b/lang/cpp20/coroutines.md index c63b0b0617..133f5dce0a 100644 --- a/lang/cpp20/coroutines.md +++ b/lang/cpp20/coroutines.md @@ -601,7 +601,7 @@ C++20コルーチンはスタックレスコルーチンとして導入された (本ページ執筆時点では[提案文書P0876R10](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p0876r10.pdf)が最新) C++20コルーチンでは、コルーチン・ステートのために動的メモリ確保が行われる可能性がある。 -一定条件を満たせばコンパイラ最適化によって動的メモリ確保が省略されるとしているが、言語仕様として動的メモリ確保を避ける仕様も検討された(通称"Core Coroutines")。 +一定条件を満たせばコンパイラ最適化によって動的メモリ確保が省略されるとしているが、言語仕様として動的メモリ確保を避ける仕様も検討された(通称"Core Coroutines")。 最終的には既に実績のあるCoroutinesTS(発案者の名前にちなみ"Gor-routines"と呼ばれた)ベースのコルーチン仕様が採用されることになった。 C++20コルーチンに関するキーワードは、いずれも接頭辞`co_`が付与されている。 From 113c185a8acc00babf4598c577096b54658c1f0b Mon Sep 17 00:00:00 2001 From: nishidate-yuki Date: Fri, 22 Sep 2023 00:37:58 +0900 Subject: [PATCH 0472/3948] fix spell "voaltile" --- lang/cpp20/deprecating_volatile.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp20/deprecating_volatile.md b/lang/cpp20/deprecating_volatile.md index 8de6ac7238..92c5e983fb 100644 --- a/lang/cpp20/deprecating_volatile.md +++ b/lang/cpp20/deprecating_volatile.md @@ -254,7 +254,7 @@ auto&& [a, b, c] = f(); // OK、一時オブジェクト内各要素へのバ あるクラスが`volatile`な領域に配置されることもあればそうでない場合もある、という状況は考えづらく、そのような状況にあったとして、メンバ関数がどう有意義に異なるのかはさらに不明瞭である。 -さらに、コンストラクタやデストラクタは`const`も`voaltile`修飾もできないため、クラスのオブジェクトへの`volatile`性が有効になるのは派生先も含めてコンストラクタの呼び出しが完了した後からとなる(同様に、`volatile`性はデストラクタの呼び出し前までしか有効ではない)。 +さらに、コンストラクタやデストラクタは`const`も`volatile`修飾もできないため、クラスのオブジェクトへの`volatile`性が有効になるのは派生先も含めてコンストラクタの呼び出しが完了した後からとなる(同様に、`volatile`性はデストラクタの呼び出し前までしか有効ではない)。 `volatile`においてはその領域へのアクセスが重要であり、1度のアクセスは正確に1度だけ行われる必要があり、その順序は前後してはならない。クラスのオブジェクトが`volatile`な領域に配置されるとき、`volatile`の保証なしで構築や破棄をすることは間違っている。クラスオブジェクトが`volatile`な領域に配置される場合は、そのメンバ変数を`volatile`修飾しておく事が望ましい。 From 47177bf7988941985c80deeaba8bcd4b039af148 Mon Sep 17 00:00:00 2001 From: nishidate-yuki Date: Fri, 22 Sep 2023 00:39:03 +0900 Subject: [PATCH 0473/3948] add "voaltile" to NG words --- .github/workflows/script/ngword_check.py | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/script/ngword_check.py b/.github/workflows/script/ngword_check.py index c34913155a..14a0486a24 100644 --- a/.github/workflows/script/ngword_check.py +++ b/.github/workflows/script/ngword_check.py @@ -15,6 +15,7 @@ ("", "protmise_type", "promise_type"), ("", "pvalue", "prvalue"), ("", "repear", "repeat"), + ("", "voaltile", "volatile"), ("", "子ルーチン", "コルーチン"), ("", "移譲", "委譲"), ("reference/chrono", "dulation", "duration"), From 0a11f21c6c0606967a6211c296348eb9db0d96f5 Mon Sep 17 00:00:00 2001 From: nishidate-yuki Date: Fri, 22 Sep 2023 00:42:51 +0900 Subject: [PATCH 0474/3948] fix spell "opreator" --- ...t_creation_of_objects_for_low-level_object_manipulation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md index ece3e8084d..88fa894964 100644 --- a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md +++ b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md @@ -167,8 +167,8 @@ C++においては、ポインタに対する演算(`+ -`など)はそのポ 標準ライブラリ中の次の関数は、*implicit-lifetime types*に対して使用した場合に、その振る舞いの一環として指定された領域内にそのオブジェクトを暗黙的に構築する - `new`演算子 - - `opreator new` - - `opreator new[]` + - `operator new` + - `operator new[]` - アロケータ - [`std::allocator::allocate`](/reference/memory/allocator/allocate.md) - Cライブラリ関数 From fb234424f7a04f94227408b335b855e9a1b6a427 Mon Sep 17 00:00:00 2001 From: nishidate-yuki Date: Fri, 22 Sep 2023 00:43:50 +0900 Subject: [PATCH 0475/3948] add "opreator" to NG words --- .github/workflows/script/ngword_check.py | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/script/ngword_check.py b/.github/workflows/script/ngword_check.py index 14a0486a24..bbfced17c2 100644 --- a/.github/workflows/script/ngword_check.py +++ b/.github/workflows/script/ngword_check.py @@ -12,6 +12,7 @@ ("", "generetor", "generator"), ("", "greator", "greater"), ("", "noexpcet", "noexcept"), + ("", "opreator", "operator"), ("", "protmise_type", "promise_type"), ("", "pvalue", "prvalue"), ("", "repear", "repeat"), From 6845c65b8cea233da6b0a42f4fd37750b81459f6 Mon Sep 17 00:00:00 2001 From: nishidate-yuki Date: Fri, 22 Sep 2023 00:45:30 +0900 Subject: [PATCH 0476/3948] fix spell "swtich" --- lang/cpp20/likely_and_unlikely_attributes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp20/likely_and_unlikely_attributes.md b/lang/cpp20/likely_and_unlikely_attributes.md index ffc6b9ed69..378e98ad66 100644 --- a/lang/cpp20/likely_and_unlikely_attributes.md +++ b/lang/cpp20/likely_and_unlikely_attributes.md @@ -52,7 +52,7 @@ std::string fizzbuzz(int n) } } // 上記例のlikely属性利用は適切ではない可能性もあり、 -// swtich文ラベルへ属性指定構文例示として解釈すること。 +// switch文ラベルへ属性指定構文例示として解釈すること。 // 入力nがランダムと仮定すると 8/15=53.3% の分岐確率となり、 // この程度の偏りに対して最適化効果が得られるかは未知数である。 ``` From dc16deb55142f824ce896fb30e495ce73536a83e Mon Sep 17 00:00:00 2001 From: nishidate-yuki Date: Fri, 22 Sep 2023 00:46:29 +0900 Subject: [PATCH 0477/3948] add "swtich" to NG words --- .github/workflows/script/ngword_check.py | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/script/ngword_check.py b/.github/workflows/script/ngword_check.py index bbfced17c2..bda4f1a818 100644 --- a/.github/workflows/script/ngword_check.py +++ b/.github/workflows/script/ngword_check.py @@ -16,6 +16,7 @@ ("", "protmise_type", "promise_type"), ("", "pvalue", "prvalue"), ("", "repear", "repeat"), + ("", "swtich", "switch"), ("", "voaltile", "volatile"), ("", "子ルーチン", "コルーチン"), ("", "移譲", "委譲"), From d6ce50de34c3e648c4e75d0343149d02b6ef4398 Mon Sep 17 00:00:00 2001 From: nishidate-yuki Date: Fri, 22 Sep 2023 00:48:39 +0900 Subject: [PATCH 0478/3948] fix spell "namespase" --- lang/cpp20/modules.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp20/modules.md b/lang/cpp20/modules.md index d765538721..18ac40167e 100644 --- a/lang/cpp20/modules.md +++ b/lang/cpp20/modules.md @@ -239,7 +239,7 @@ export using namespace N; // エラー: 新たな名前を宣言していない export { struct Foo { /*...*/ }; // エクスポートされる static_assert(std::is_trivially_copyable_v); // エラー: 新たな名前を宣言していない - using namespase std; // エラー: 新たな名前を宣言していない + using namespace std; // エラー: 新たな名前を宣言していない } ``` From 499d43030eeffe6193d3a4b90f723477cf98b3e3 Mon Sep 17 00:00:00 2001 From: nishidate-yuki Date: Fri, 22 Sep 2023 00:49:11 +0900 Subject: [PATCH 0479/3948] add "namespase" to NG words --- .github/workflows/script/ngword_check.py | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/script/ngword_check.py b/.github/workflows/script/ngword_check.py index bda4f1a818..2b4810db43 100644 --- a/.github/workflows/script/ngword_check.py +++ b/.github/workflows/script/ngword_check.py @@ -11,6 +11,7 @@ ("", "exposion", "exposition"), ("", "generetor", "generator"), ("", "greator", "greater"), + ("", "namespase", "namespace"), ("", "noexpcet", "noexcept"), ("", "opreator", "operator"), ("", "protmise_type", "promise_type"), From 082b914d32b5d5baf063d4c1419979063ed1dd6c Mon Sep 17 00:00:00 2001 From: nishidate-yuki Date: Fri, 22 Sep 2023 00:52:32 +0900 Subject: [PATCH 0480/3948] fix spell "concpet" --- lang/cpp20/wording_for_lambdas_in_unevaluated_contexts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp20/wording_for_lambdas_in_unevaluated_contexts.md b/lang/cpp20/wording_for_lambdas_in_unevaluated_contexts.md index 1429ec81f1..91a11fb102 100644 --- a/lang/cpp20/wording_for_lambdas_in_unevaluated_contexts.md +++ b/lang/cpp20/wording_for_lambdas_in_unevaluated_contexts.md @@ -51,7 +51,7 @@ auto s2 = sizeof([]{ return 0;}()); // 4 6. 評価されない文脈であっても、ラムダ式の本体内で使用されている変数は暗黙的にキャプチャされる - 評価されない文脈で現れているラムダ式の本体内は評価されない文脈ではない 7. 関数の本体の外側で、その関数の引数をキャプチャする事はできない -8. `concpet`の定義内及び`requires`節の内部に現れているラムダ式本体のエラーはコンパイルエラーとなる +8. `concept`の定義内及び`requires`節の内部に現れているラムダ式本体のエラーはコンパイルエラーとなる ```cpp // 1 クロージャ型にリンケージを付加できない(これらのCはリンケージを持たない) From 2e6e1720de6ffcb5116835bf6c73060b98580fb4 Mon Sep 17 00:00:00 2001 From: nishidate-yuki Date: Fri, 22 Sep 2023 00:53:28 +0900 Subject: [PATCH 0481/3948] add "concpet" to NG words --- .github/workflows/script/ngword_check.py | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/script/ngword_check.py b/.github/workflows/script/ngword_check.py index 2b4810db43..26edc23797 100644 --- a/.github/workflows/script/ngword_check.py +++ b/.github/workflows/script/ngword_check.py @@ -6,6 +6,7 @@ ("", "
", "
"), ("", "
", "
"), ("", "algined", "aligned"), + ("", "concpet", "concept"), ("", "condtion", "condition"), ("", "eror", "error"), ("", "exposion", "exposition"), From 331a036a791df9df02b66a054ad7f70448fb205d Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 26 Sep 2023 16:26:36 +0900 Subject: [PATCH 0482/3948] =?UTF-8?q?counted=5Fiterator=20:=20P2259R1?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/counted_iterator.md | 28 +++++++++++++++++--------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/reference/iterator/counted_iterator.md b/reference/iterator/counted_iterator.md index 766955b162..d2e2903b1d 100644 --- a/reference/iterator/counted_iterator.md +++ b/reference/iterator/counted_iterator.md @@ -15,24 +15,24 @@ namespace std { }; - // incrementable_traitsにアダプトする - template - struct incrementable_traits> { - using difference_type = iter_difference_t; - }; - // iterator_traitsにアダプトする template + requires same_as> struct iterator_traits> : iterator_traits { - using pointer = void; + using pointer = conditional_t, add_pointer_t>, void>; }; } ``` * input_or_output_iterator[link /reference/iterator/input_or_output_iterator.md] * incrementable_traits[link /reference/iterator/incrementable_traits.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] * input_iterator[link /reference/iterator/input_iterator.md] +* same_as[link /reference/concepts/same_as.md] +* ITER_CONCEPT[link /reference/iterator/input_iterator.md#iter_concept] * iterator_traits[link /reference/iterator/iterator_traits.md] +* conditional_t[link /reference/type_traits/conditional.md] +* contiguous_iterator[link /reference/iterator/contiguous_iterator.md] +* add_pointer_t[link /reference/type_traits/add_pointer.md] +* iter_reference_t[link /reference/iterator/iter_reference_t.md] ## 概要 `counted_iterator`は、イテレータをラップしてそこから指定されたカウント数の範囲を表現するイテレータアダプタである。 @@ -50,6 +50,7 @@ namespace std { | [`base`](counted_iterator/base.md) | 元のイテレータを取得する | C++20 | | [`count`](counted_iterator/count.md) | 代入演算子 | C++20 | | [`operator*`](counted_iterator/op_deref.md) | 間接参照演算子 | C++20 | +| [`operator->`](counted_iterator/op_arrow.md.nolink) | メンバアクセス演算子 | C++20 | | [`operator++`](counted_iterator/op_increment.md) | イテレータをインクリメントする | C++20 | | [`operator--`](counted_iterator/op_decrement.md) | イテレータをデクリメントする | C++20 | | [`operator+`](counted_iterator/op_plus.md) | イテレータを進める | C++20 | @@ -77,9 +78,15 @@ namespace std { ## メンバ型 | 名前 | 説明 | 対応バージョン | -|-----------------|-----|-------| -| `iterator_type` | `I` | C++20 | +|---------------------|-----|-------| +| `iterator_type` | `I` | C++20 | +| `value_type` | [`iter_value_t`](/reference/iterator/iter_value_t.md)``※1 | C++20 | +| `difference_type` | [`iter_difference_t`](/reference/iterator/iter_difference_t.md)`` | C++20 | +| `iterator_concept` | `typename I::iterator_concept`※2 | C++20 | +| `iterator_category` | `typename I::iterator_category`※2 | C++20 | +- ※1 `I`が[`indirectly_readable`](/reference/iterator/indirectly_readable.md)のモデルである場合にのみ定義される +- ※2 どちらも、対応するメンバ型が定義されている場合にのみ定義される ## 例 @@ -136,3 +143,4 @@ int main() { ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) - [Hidden Friends - yohhoyの日記](https://yohhoy.hatenadiary.jp/entry/20190531/p1) +- [P2259R1 Repairing input range adaptors and `counted_iterator`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2259r1.html) From 46f89bc560d8c35c13641cf89f9dd5eba2774b8a Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 26 Sep 2023 16:29:58 +0900 Subject: [PATCH 0483/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/counted_iterator.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/reference/iterator/counted_iterator.md b/reference/iterator/counted_iterator.md index d2e2903b1d..10b5711b3a 100644 --- a/reference/iterator/counted_iterator.md +++ b/reference/iterator/counted_iterator.md @@ -24,10 +24,9 @@ namespace std { } ``` * input_or_output_iterator[link /reference/iterator/input_or_output_iterator.md] -* incrementable_traits[link /reference/iterator/incrementable_traits.md] * input_iterator[link /reference/iterator/input_iterator.md] * same_as[link /reference/concepts/same_as.md] -* ITER_CONCEPT[link /reference/iterator/input_iterator.md#iter_concept] +* ITER_TRAITS[link /reference/iterator/input_iterator.md#iter_concept] * iterator_traits[link /reference/iterator/iterator_traits.md] * conditional_t[link /reference/type_traits/conditional.md] * contiguous_iterator[link /reference/iterator/contiguous_iterator.md] From 38b9677ca78a674160acc8f3c1d792c25b530c9f Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 26 Sep 2023 20:17:12 +0900 Subject: [PATCH 0484/3948] =?UTF-8?q?C++26=20P2734R0=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ratio.md | 6 ++- reference/ratio/si_prefix.md | 99 ++++++++++++++++++++---------------- 2 files changed, 61 insertions(+), 44 deletions(-) diff --git a/reference/ratio.md b/reference/ratio.md index 6128a88694..188c13e8ec 100644 --- a/reference/ratio.md +++ b/reference/ratio.md @@ -38,6 +38,8 @@ | 名前 | 説明 | 対応バージョン | |---------------------------------|-------------------|----------------| +| [`quecto`](ratio/si_prefix.md) | クエクト(type-alias) | C++26 | +| [`ronto`](ratio/si_prefix.md) | ロント(type-alias) | C++26 | | [`yocto`](ratio/si_prefix.md) | ヨクト(type-alias) | C++11 | | [`zepto`](ratio/si_prefix.md) | ゼプト(type-alias) | C++11 | | [`atto`](ratio/si_prefix.md) | アト(type-alias) | C++11 | @@ -58,6 +60,8 @@ | [`exa`](ratio/si_prefix.md) | エクサ(type-alias) | C++11 | | [`zetta`](ratio/si_prefix.md) | ゼタ(type-alias) | C++11 | | [`yotta`](ratio/si_prefix.md) | ヨタ(type-alias) | C++11 | +| [`ronna`](ratio/si_prefix.md) | ロナ(type-alias) | C++26 | +| [`quetta`](ratio/si_prefix.md) | クエタ(type-alias) | C++26 | ## バージョン @@ -67,4 +71,4 @@ ## 参照 - [N2661 A Foundation to Sleep On](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2661.htm) - +- [P2734R0 Adding the new SI prefixes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2734r0.pdf) diff --git a/reference/ratio/si_prefix.md b/reference/ratio/si_prefix.md index 71f5a7bf3d..f4f6cf25ca 100644 --- a/reference/ratio/si_prefix.md +++ b/reference/ratio/si_prefix.md @@ -6,26 +6,30 @@ ```cpp namespace std { - using yocto = ratio<1, 1000000000000000000000000>; - using zepto = ratio<1, 1000000000000000000000>; - using atto = ratio<1, 1000000000000000000>; - using femto = ratio<1, 1000000000000000>; - using pico = ratio<1, 1000000000000>; - using nano = ratio<1, 1000000000>; - using micro = ratio<1, 1000000>; - using milli = ratio<1, 1000>; - using centi = ratio<1, 100>; - using deci = ratio<1, 10>; - using deca = ratio< 10, 1>; - using hecto = ratio< 100, 1>; - using kilo = ratio< 1000, 1>; - using mega = ratio< 1000000, 1>; - using giga = ratio< 1000000000, 1>; - using tera = ratio< 1000000000000, 1>; - using peta = ratio< 1000000000000000, 1>; - using exa = ratio< 1000000000000000000, 1>; - using zetta = ratio< 1000000000000000000000, 1>; - using yotta = ratio<1000000000000000000000000, 1>; + using quecto = ratio<1, 1000000000000000000000000000000>; // C++26 + using ronto = ratio<1, 1000000000000000000000000000>; // C++26 + using yocto = ratio<1, 1000000000000000000000000>; + using zepto = ratio<1, 1000000000000000000000>; + using atto = ratio<1, 1000000000000000000>; + using femto = ratio<1, 1000000000000000>; + using pico = ratio<1, 1000000000000>; + using nano = ratio<1, 1000000000>; + using micro = ratio<1, 1000000>; + using milli = ratio<1, 1000>; + using centi = ratio<1, 100>; + using deci = ratio<1, 10>; + using deca = ratio< 10, 1>; + using hecto = ratio< 100, 1>; + using kilo = ratio< 1000, 1>; + using mega = ratio< 1000000, 1>; + using giga = ratio< 1000000000, 1>; + using tera = ratio< 1000000000000, 1>; + using peta = ratio< 1000000000000000, 1>; + using exa = ratio< 1000000000000000000, 1>; + using zetta = ratio< 1000000000000000000000, 1>; + using yotta = ratio< 1000000000000000000000000, 1>; + using ronna = ratio< 1000000000000000000000000000, 1>; // C++26 + using quetta = ratio<1000000000000000000000000000000, 1>; // C++26 } ``` * ratio[link ratio.md] @@ -33,32 +37,36 @@ namespace std { ## 概要 これらは、コンパイル時有理数である[`ratio`](ratio.md)を利用した、SI単位系(The International System of Units : 国際単位系)の接頭辞を表す型である。 -| 型 | 説明 | -|---------|----------| -| `yocto` | ヨクト | -| `zepto` | ゼプト | -| `atto` | アト | -| `femto` | フェムト | -| `pico` | ピコ | -| `nano` | ナノ | -| `micro` | マイクロ | -| `milli` | ミリ | -| `centi` | センチ | -| `deci` | デシ | -| `deca` | デカ | -| `hecto` | ヘクト | -| `kilo` | キロ | -| `mega` | メガ | -| `giga` | ギガ | -| `tera` | テラ | -| `peta` | ペタ | -| `exa` | エクサ | -| `zetta` | ゼタ | -| `yotta` | ヨタ | +| 型 | 説明 | 10の冪 | +|---------|----------|------| +| `quecto` | クエクト | -30 | +| `ronto` | ロント | -27 | +| `yocto` | ヨクト | -24 | +| `zepto` | ゼプト | -21 | +| `atto` | アト | -18 | +| `femto` | フェムト | -15 | +| `pico` | ピコ | -12 | +| `nano` | ナノ | - 9 | +| `micro` | マイクロ | -6 | +| `milli` | ミリ | -3 | +| `centi` | センチ | -2 | +| `deci` | デシ | -1 | +| `deca` | デカ | 1 | +| `hecto` | ヘクト | 2 | +| `kilo` | キロ | 3 | +| `mega` | メガ | 6 | +| `giga` | ギガ | 9 | +| `tera` | テラ | 12 | +| `peta` | ペタ | 15 | +| `exa` | エクサ | 18 | +| `zetta` | ゼタ | 21 | +| `yotta` | ヨタ | 24 | +| `ronna` | ロナ | 27 | +| `quetta` | クエタ | 30 | ## 備考 -`yocto`、`zepto`、`zetta`、`yotta`は、[`intmax_t`](/reference/cstdint/intmax_t.md)型で値を表現できる場合のみ定義され、表現できない場合は定義されない。 +`quecto`, `ronto`, `yocto`、`zepto`、`zetta`、`yotta`, `ronna`, `quetta`は、[`intmax_t`](/reference/cstdint/intmax_t.md)型で値を表現できる場合のみ定義され、表現できない場合は定義されない。 ## 例 @@ -109,4 +117,9 @@ int main() - [GCC](/implementation.md#gcc): 4.4.7 - [Visual C++](/implementation.md#visual_cpp): ?? +### 備考 +`std::intmax_t`型が64bit幅の処理系では、SI接頭辞`quecto`~`zepto`、`zetta`~`quetta`を表現できないため、これらの型別名は定義されない。 + +## 参照 +- [P2734R0 Adding the new SI prefixes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2734r0.pdf) From 1cededd37b7dd98fca189186a275eefa2a985e50 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 26 Sep 2023 23:34:30 +0900 Subject: [PATCH 0485/3948] =?UTF-8?q?error=5Fcondition=20:=20HRESULT?= =?UTF-8?q?=E3=81=AE=E8=A7=A3=E8=AA=AC=E3=83=9A=E3=83=BC=E3=82=B8=E3=82=92?= =?UTF-8?q?archive=E3=81=AB=E5=B7=AE=E3=81=97=E6=9B=BF=E3=81=88=20#1170?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/system_error/error_condition.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/system_error/error_condition.md b/reference/system_error/error_condition.md index 5f6a2ef798..f4579823de 100644 --- a/reference/system_error/error_condition.md +++ b/reference/system_error/error_condition.md @@ -16,7 +16,7 @@ namespace std { Visual C++ 2010、GCC 4.6.1では[`generic_category()`](generic_category.md)と[`system_category()`](system_category.md)の[`error_category`](error_category.md)オブジェクトは[`name()`](error_category/name.md)メンバ関数を除いて同じ挙動を行い、それぞれの[`default_error_condition()`](error_category/default_error_condition.md)メンバ関数も同じエラー値、同じカテゴリの`error_condition`を構築するため、実質[`error_code`](error_code.md)と`error_condition`は標準カテゴリでは等価な動作をする。だが、[`error_category`](error_category.md)を継承した新たなカテゴリを定義することにより、以下のようなエラーを表現することが可能となる: - 一つのエラー値で上位Nビット、下位Nビットで異なるエラー情報を表現する -- 例: WindowsのHRESULT : 「[HRESULT型とは? - UsefullCode.net](http://www.usefullcode.net/2007/03/hresult.html)」 +- 例: WindowsのHRESULT : 「[HRESULT型とは? - UsefullCode.net](https://web.archive.org/web/20230323103136/http://www.usefullcode.net/2007/03/hresult.html)」 - システムのエラーコードを汎用のエラーコードに変換し、[`error_code`](/reference/system_error/error_code.md)にはシステムの環境依存エラー値、`error_condition`には環境依存しない汎用エラー値を格納する From 8974dd3325a7283cf340c5bc31c7d1e84f0f3fd2 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 27 Sep 2023 11:30:27 +0900 Subject: [PATCH 0486/3948] =?UTF-8?q?P2259R1=E5=AF=BE=E5=BF=9C=20=20counte?= =?UTF-8?q?d=5Fiterator::operator->=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/counted_iterator.md | 2 +- .../iterator/counted_iterator/op_arrow.md | 74 +++++++++++++++++++ 2 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 reference/iterator/counted_iterator/op_arrow.md diff --git a/reference/iterator/counted_iterator.md b/reference/iterator/counted_iterator.md index 10b5711b3a..20d01029c8 100644 --- a/reference/iterator/counted_iterator.md +++ b/reference/iterator/counted_iterator.md @@ -49,7 +49,7 @@ namespace std { | [`base`](counted_iterator/base.md) | 元のイテレータを取得する | C++20 | | [`count`](counted_iterator/count.md) | 代入演算子 | C++20 | | [`operator*`](counted_iterator/op_deref.md) | 間接参照演算子 | C++20 | -| [`operator->`](counted_iterator/op_arrow.md.nolink) | メンバアクセス演算子 | C++20 | +| [`operator->`](counted_iterator/op_arrow.md) | メンバアクセス演算子 | C++20 | | [`operator++`](counted_iterator/op_increment.md) | イテレータをインクリメントする | C++20 | | [`operator--`](counted_iterator/op_decrement.md) | イテレータをデクリメントする | C++20 | | [`operator+`](counted_iterator/op_plus.md) | イテレータを進める | C++20 | diff --git a/reference/iterator/counted_iterator/op_arrow.md b/reference/iterator/counted_iterator/op_arrow.md new file mode 100644 index 0000000000..48c0a7ab0f --- /dev/null +++ b/reference/iterator/counted_iterator/op_arrow.md @@ -0,0 +1,74 @@ +# operator-> +* iterator[meta header] +* std[meta namespace] +* counted_iterator[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr auto operator->() const noexcept + requires contiguous_iterator; +``` +* contiguous_iterator[link /reference/iterator/contiguous_iterator.md] + +## 概要 +イテレータを通して参照先の要素のメンバにアクセスする + +## 効果 + +`I`の値を`current`メンバ変数に保持するとして、以下と等価 + +```cpp +return to_address(current); +``` +* to_address[link /reference/memory/to_address.md] + +## 例 +```cpp example +#include +#include +#include +#include + +struct S { + int n; + + S(int a) : n{a} {} + + void print() const { + std::cout << this->n << '\n'; + } +}; + +int main() { + std::vector vec = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + + std::counted_iterator ci{std::ranges::begin(vec), 5}; + + ci->print(); + + ++ci; + + ci->print(); +} +``` +* ci->[color ff0000] +* ranges::begin[link /reference/ranges/begin.md] + +### 出力 +``` +1 +2 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 12.0 +- [Visual C++](/implementation.md#visual_cpp): 2022 + +## 参照 +- [P2259R1 Repairing input range adaptors and `counted_iterator`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2259r1.html) From 02832a7dda2b2f7dc9e56fc5cf306e8bed17e298 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 27 Sep 2023 11:40:09 +0900 Subject: [PATCH 0487/3948] =?UTF-8?q?P2017R1=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/common_view.md | 3 ++- reference/ranges/drop_view.md | 1 + reference/ranges/drop_while_view.md | 3 ++- reference/ranges/elements_view.md | 1 + reference/ranges/reverse_view.md | 3 ++- reference/ranges/take_view.md | 1 + 6 files changed, 9 insertions(+), 3 deletions(-) diff --git a/reference/ranges/common_view.md b/reference/ranges/common_view.md index 6c335e91f4..ec0c3c6e46 100644 --- a/reference/ranges/common_view.md +++ b/reference/ranges/common_view.md @@ -31,7 +31,7 @@ namespace std::ranges { | borrowed | sized | output | input | forward | bidirectional | random_access | contiguous | common | viewable | view | |----------|-------|--------|-------|---------|---------------|---------------|------------|--------|----------|------| -| ○ | ※ | ※ | ※ | ※ | ※ | ※ | ※ | ○ | ○ | ○ | +| ※ | ※ | ※ | ※ | ※ | ※ | ※ | ※ | ○ | ○ | ○ | ※ 参照先のRangeに従う @@ -193,3 +193,4 @@ namespace std::ranges { ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) - [C++20 ranges](https://techbookfest.org/product/5134506308665344) +- [P2017R1 Conditionally borrowed ranges](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2017r1.html) diff --git a/reference/ranges/drop_view.md b/reference/ranges/drop_view.md index 11516f89fb..167b243a99 100644 --- a/reference/ranges/drop_view.md +++ b/reference/ranges/drop_view.md @@ -115,3 +115,4 @@ int main() { - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) - [C++20 ranges](https://techbookfest.org/product/5134506308665344) - [P2367R0 Remove misuses of list-initialization from Clause 24](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2367r0.html) (本提案文書はC++20に遡って適用されている) +- [P2017R1 Conditionally borrowed ranges](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2017r1.html) diff --git a/reference/ranges/drop_while_view.md b/reference/ranges/drop_while_view.md index 399cc35e33..e8f0da54b7 100644 --- a/reference/ranges/drop_while_view.md +++ b/reference/ranges/drop_while_view.md @@ -30,7 +30,7 @@ namespace std::ranges { | borrowed | sized | output | input | forward | bidirectional | random_access | contiguous | common | viewable | view | |----------|-------|--------|-------|---------|---------------|---------------|------------|--------|----------|------| -| | | (1) | (1) | (1) | (1) | (1) | (1) | | ○ | ○ | +| (1) | | (1) | (1) | (1) | (1) | (1) | (1) | | ○ | ○ | - (1): `V`に従う @@ -109,3 +109,4 @@ int main() { - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) - [C++20 ranges](https://techbookfest.org/product/5134506308665344) - [P2367R0 Remove misuses of list-initialization from Clause 24](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2367r0.html) (本提案文書はC++20に遡って適用されている) +- [P2017R1 Conditionally borrowed ranges](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2017r1.html) diff --git a/reference/ranges/elements_view.md b/reference/ranges/elements_view.md index fef43e2d70..aed0aad529 100644 --- a/reference/ranges/elements_view.md +++ b/reference/ranges/elements_view.md @@ -171,3 +171,4 @@ three - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) - [C++20 ranges](https://techbookfest.org/product/5134506308665344) - [P2165R4 Compatibility between `tuple`, `pair` and *tuple-like* objects](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2165r4.pdf) +- [P2017R1 Conditionally borrowed ranges](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2017r1.html) diff --git a/reference/ranges/reverse_view.md b/reference/ranges/reverse_view.md index 0a1d1fe65e..80dabb5ae9 100644 --- a/reference/ranges/reverse_view.md +++ b/reference/ranges/reverse_view.md @@ -27,7 +27,7 @@ namespace std::ranges { | borrowed | sized | output | input | forward | bidirectional | random_access | contiguous | common | viewable | view | |----------|-------|--------|-------|---------|---------------|---------------|------------|--------|----------|------| -| ○ | ※ | ※ | ○ | ○ | ○ | ※ | | ○ | ○ | ○ | +| ※ | ※ | ※ | ○ | ○ | ○ | ※ | | ○ | ○ | ○ | ※ 参照先のRangeに従う @@ -184,3 +184,4 @@ namespace std::ranges { ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) - [C++20 ranges](https://techbookfest.org/product/5134506308665344) +- [P2017R1 Conditionally borrowed ranges](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2017r1.html) \ No newline at end of file diff --git a/reference/ranges/take_view.md b/reference/ranges/take_view.md index ba262259c0..7fd51bd91b 100644 --- a/reference/ranges/take_view.md +++ b/reference/ranges/take_view.md @@ -180,3 +180,4 @@ int main() { - [C++20 ranges](https://techbookfest.org/product/5134506308665344) - [P2367R0 Remove misuses of list-initialization from Clause 24](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2367r0.html) (本提案文書はC++20に遡って適用されている) - [P2406R2 Add `lazy_counted_iterator`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2406r2.html) +- [P2017R1 Conditionally borrowed ranges](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2017r1.html) \ No newline at end of file From 93bc41bc9ade112bd57283929091f24746bc82c1 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 27 Sep 2023 15:28:41 +0900 Subject: [PATCH 0488/3948] =?UTF-8?q?P2328R1=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/join_view.md | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/reference/ranges/join_view.md b/reference/ranges/join_view.md index 2d0654b30c..63876aaa98 100644 --- a/reference/ranges/join_view.md +++ b/reference/ranges/join_view.md @@ -7,8 +7,7 @@ ```cpp namespace std::ranges { template - requires view && input_range> && - (is_reference_v> || view>) + requires view && input_range> class join_view : public view_interface> { …… }; // (1) namespace views { @@ -19,8 +18,6 @@ namespace std::ranges { * input_range[link input_range.md] * view[link view.md] * range_reference_t[link range_reference_t.md] -* is_reference_v[link /reference/type_traits/is_reference.md] -* range_value_t[link range_value_t.md] ## 概要 @@ -33,8 +30,8 @@ namespace std::ranges { |----------|-------|--------|-------|---------|---------------|---------------|------------|--------|----------|------| | | | | 〇 | (1) | (2) | | | (3) | ○ | ○ | -- (1): 外側・内側のRangeが[`forward_range`](forward_range.md)のとき -- (2): 外側・内側のRangeが[`bidirectional_range`](bidirectional_range.md)のとき +- (1): 外側・内側のRangeが[`forward_range`](forward_range.md)であり、内側Rangeが参照型のとき +- (2): 外側・内側のRangeが[`bidirectional_range`](bidirectional_range.md)であり、内側Rangeが参照型かつ[`common_range`](common_range.md)であるとき - (3): 外側・内側のRangeが[`forward_range`](forward_range.md)かつ[`common_range`](common_range.md)であり - `const`ではない場合、内側のRangeは参照型(*prvalue*ではない) @@ -45,8 +42,6 @@ namespace std::ranges { - [`view`](view.md)`` - [`input_range`](input_range.md)`` - [`input_range`](input_range.md)`<`[`range_reference_t`](range_reference_t.md)`>` -- [`is_reference_v`](/reference/type_traits/is_reference.md)`<`[`range_reference_t`](range_reference_t.md)`>` -- [`view`](view.md)`<`[`range_value_t`](range_value_t.md)`>` ## 効果 @@ -117,3 +112,4 @@ h,e,l,l,o,w,o,r,l,d, ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) - [C++20 ranges](https://techbookfest.org/product/5134506308665344) +- [P2328R1 `join_view` should join all views of ranges](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2328r1.html) From 528131302fef3ee398244e5900cca0498df28064 Mon Sep 17 00:00:00 2001 From: I <1091761+wx257osn2@users.noreply.github.com> Date: Thu, 28 Sep 2023 19:20:12 +0900 Subject: [PATCH 0489/3948] fix title(prev -> next) --- reference/ranges/subrange/prev.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/ranges/subrange/prev.md b/reference/ranges/subrange/prev.md index af6863d2d2..416d1b073e 100644 --- a/reference/ranges/subrange/prev.md +++ b/reference/ranges/subrange/prev.md @@ -1,4 +1,4 @@ -# next +# prev * ranges[meta header] * std::ranges[meta namespace] * subrange[meta class] From 1117ef22bd6ecdc03a66d7831f77ac7f551ea580 Mon Sep 17 00:00:00 2001 From: I <1091761+wx257osn2@users.noreply.github.com> Date: Thu, 28 Sep 2023 19:21:01 +0900 Subject: [PATCH 0490/3948] fix typo --- lang/cpp23.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp23.md b/lang/cpp23.md index ab68fb9108..d33743631d 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -141,7 +141,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 - Rangeを先頭に追加する`prepend_range()`メンバ関数 - Rangeを末尾に追加する`append_range()`メンバ関数 - Rangeを代入する`assign_range()`メンバ関数 -- ユーザー定義のRangeアダプタがパイプライン演算子 `|` をサポートしやすくするために、[``](/reference/ranges.md)に[`std::range::range_adaptor_closure`](/reference/ranges/range_adaptor_closure.md.nolink)クラスを追加 +- ユーザー定義のRangeアダプタがパイプライン演算子 `|` をサポートしやすくするために、[``](/reference/ranges.md)に[`std::ranges::range_adaptor_closure`](/reference/ranges/range_adaptor_closure.md.nolink)クラスを追加 - [``](/reference/ranges.md)に、Rangeを連結させる[`join_with`](/reference/ranges/join_with.md.nolink)を追加 - Rangeを指定の大きさで分割する[`std::views::chunk`](/reference/ranges/chunk_view.md.nolink)と、Rangeを指定の大きさの隣接要素で分割する[`std::views::slide`](/reference/ranges/slide_view.md.nolink)を追加 - Rangeを条件一致する間の要素で分割する[`std::views::chunk_by`](/reference/ranges/chunk_by_view.md.nolink)を追加 From 92b8e34df0b16f484f679c267a2557de0b55b85c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 29 Sep 2023 11:16:54 +0900 Subject: [PATCH 0491/3948] =?UTF-8?q?Clang=20:=20C++26=E3=81=AE=E3=82=AA?= =?UTF-8?q?=E3=83=97=E3=82=B7=E3=83=A7=E3=83=B3=E3=82=92=E8=A8=98=E8=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/implementation.md b/implementation.md index 4f6a570f45..ade77d998e 100644 --- a/implementation.md +++ b/implementation.md @@ -47,6 +47,9 @@ - Clang 12.0以降は、`-std=c++2b`オプションを使用する。 - GNU拡張を有効にする`-std=gnu++2b`オプションもある。 +### C++26の機能を有効にする +- Clang 17.0以降は、`-std=c++2c`オプションを使用する。 + ## GNU Compiler Collection このサイトでは GCC と呼ぶ From ef3c242bd0a2f3794e8903dd6e7d40c953f9e492 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 29 Sep 2023 11:20:21 +0900 Subject: [PATCH 0492/3948] =?UTF-8?q?Clang=20:=20c++23=E3=82=AA=E3=83=97?= =?UTF-8?q?=E3=82=B7=E3=83=A7=E3=83=B3=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/implementation.md b/implementation.md index ade77d998e..6e8714caa6 100644 --- a/implementation.md +++ b/implementation.md @@ -46,9 +46,12 @@ ### C++23の機能を有効にする - Clang 12.0以降は、`-std=c++2b`オプションを使用する。 - GNU拡張を有効にする`-std=gnu++2b`オプションもある。 +- Clang 17.0以降は、`-std=c++23`オプションを使用する(以前までのオプションも使用できる)。 + - GNU拡張を有効にする`-std=gnu++23`オプションもある。 ### C++26の機能を有効にする - Clang 17.0以降は、`-std=c++2c`オプションを使用する。 + - GNU拡張を有効にする`-std=gnu++2c`オプションもある。 ## GNU Compiler Collection From 8e71d07c591b70c86e2687b1e6522c4d6965773d Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 29 Sep 2023 13:27:42 +0900 Subject: [PATCH 0493/3948] =?UTF-8?q?NG=E3=83=AF=E3=83=BC=E3=83=89?= =?UTF-8?q?=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF=20:=20std::range::=20?= =?UTF-8?q?=E2=86=92=20std::ranges::=20=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/cpprefjp/site/commit/1117ef22bd6ecdc03a66d7831f77ac7f551ea580 --- .github/workflows/script/ngword_check.py | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/script/ngword_check.py b/.github/workflows/script/ngword_check.py index 26edc23797..7eedfece7b 100644 --- a/.github/workflows/script/ngword_check.py +++ b/.github/workflows/script/ngword_check.py @@ -18,6 +18,7 @@ ("", "protmise_type", "promise_type"), ("", "pvalue", "prvalue"), ("", "repear", "repeat"), + ("", "std::range::", "std::ranges::"), ("", "swtich", "switch"), ("", "voaltile", "volatile"), ("", "子ルーチン", "コルーチン"), From 7e78a7d13f1c32def0d08a23db6404a8d19b48e1 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 29 Sep 2023 14:06:05 +0900 Subject: [PATCH 0494/3948] =?UTF-8?q?=E5=9B=BD=E9=9A=9B=E6=A8=99=E6=BA=96?= =?UTF-8?q?=E8=A6=8F=E6=A0=BC=20:=20C++26=E3=82=92=E8=BF=BD=E5=8A=A0=20#11?= =?UTF-8?q?66?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- international-standard.md | 3 ++- lang.md | 1 + lang/cpp26.md | 16 ++++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 lang/cpp26.md diff --git a/international-standard.md b/international-standard.md index c88bd11465..c614d20752 100644 --- a/international-standard.md +++ b/international-standard.md @@ -12,7 +12,8 @@ C++ の標準規格は、他にも各国の規格化団体によって国際標 | 通称†1 | 名称 | 参照する規格案†2 | 規格案・原案 | `__cplusplus` | |:--|:--|:--|:--|:--| -| [C++23](lang/cpp23.md) (C++2b) | ISO/IEC 14882:2023 (予定) | N4950([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4950.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/)) | M4950 N4944 N4928 N4917 N4910 N4901 N4892 N4885 N4878
N4868 N4861 | -- | +| [C++26](lang/cpp26.md) (C++2c) | ISO/IEC 14882:2026 (予定) | N4958([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4958.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/)) | N4958 | -- | +| [C++23](lang/cpp23.md) (C++2b) | ISO/IEC 14882:2023 (予定) | N4950([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4950.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/)) | N4950 N4944 N4928 N4917 N4910 N4901 N4892 N4885 N4878
N4868 N4861 | -- | | [C++20](lang/cpp20.md) (C++2a) | ISO/IEC 14882:2020 | N4861†3([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/n4861.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4861/)) | N4860 N4849 N4842 N4835 N4830
N4820 N4810 N4800 N4791 N4788†4
N4778 N4762 N4750 N4741 N4727
N4713 N4700 N4687 | `202002L` | | [C++17](lang/cpp17.md) (C++1z) | ISO/IEC 14882:2017 | N4659([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4659.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4659/)) | N4660 N4659 N4640 N4618 N4606
N4594 N4582 N4567 N4527 N4431
N4296 | `201703L` | | [C++14](lang/cpp14.md) (C++1y) | ISO/IEC 14882:2014 | N4140([PDF](https://github.com/cplusplus/draft/blob/master/papers/n4140.pdf?raw=true)/[HTML](https://timsong-cpp.github.io/cppwp/n4140/)) | N4141 N4140 N3937 N3936 N3797
N3691 N3690 N3485 N3376 N3337 | `201402L` | diff --git a/lang.md b/lang.md index 8e826e85e1..ae3ae7c778 100644 --- a/lang.md +++ b/lang.md @@ -7,6 +7,7 @@ - [C++17](lang/cpp17.md) - [C++20](lang/cpp20.md) - [C++23](lang/cpp23.md) +- [C++26](lang/cpp26.md) - [C++ (将来)](lang/future.md) - [C++ (廃案)](lang/archive.md) - [言語拡張](lang/extension.md.nolink) diff --git a/lang/cpp26.md b/lang/cpp26.md new file mode 100644 index 0000000000..ed3a33357c --- /dev/null +++ b/lang/cpp26.md @@ -0,0 +1,16 @@ +# C++26 + +## 概要 +C++26とは、2026年中に改訂される予定の、C++バージョンの通称である。 + +このバージョンは、策定中のためC++2cと呼ばれることがある。「(2020年代の3つ目のバージョンが) 202c年にリリースされる」という伏せ字として「c」が使われているが、3年周期に次のバージョンが策定されることが決まっているため、伏せ字になっている年数がずれることはない。 + + +## 言語機能 + +| 言語機能 | 説明 | +|----------|------| + + +## ライブラリ更新の概要 + From 4c95521670ac88129ccb470c6180a2dec4508d53 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sat, 30 Sep 2023 13:20:12 +0900 Subject: [PATCH 0495/3948] fix some minor faults --- reference/chrono/duration/op_greater_equal.md | 2 +- reference/chrono/time_point/op_greater_equal.md | 2 +- reference/chrono/time_point/op_plus.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/chrono/duration/op_greater_equal.md b/reference/chrono/duration/op_greater_equal.md index da9007c1d4..7ae068c48b 100644 --- a/reference/chrono/duration/op_greater_equal.md +++ b/reference/chrono/duration/op_greater_equal.md @@ -22,7 +22,7 @@ namespace chrono { ```cpp using ct = common_type::type; -return ct(lhs).count() < ct(rhs).count(); +return ct(lhs).count() >= ct(rhs).count(); ``` * common_type[link /reference/type_traits/common_type.md] * count[link /reference/chrono/duration/count.md] diff --git a/reference/chrono/time_point/op_greater_equal.md b/reference/chrono/time_point/op_greater_equal.md index 1cc3424895..aad6ba394b 100644 --- a/reference/chrono/time_point/op_greater_equal.md +++ b/reference/chrono/time_point/op_greater_equal.md @@ -24,7 +24,7 @@ namespace chrono { ## 戻り値 ```cpp -return lhs.time_since_epoch() < rhs.time_since_poch(); +return lhs.time_since_epoch() >= rhs.time_since_poch(); ``` * time_since_epoch[link /reference/chrono/time_point/time_since_epoch.md] diff --git a/reference/chrono/time_point/op_plus.md b/reference/chrono/time_point/op_plus.md index 7fa9cd8038..57eaa73399 100644 --- a/reference/chrono/time_point/op_plus.md +++ b/reference/chrono/time_point/op_plus.md @@ -23,7 +23,7 @@ namespace chrono { const time_point& rhs); // (2) C++11 template - time_point, Duration2>::type> + constexpr time_point, Duration2>::type> operator+(const duration& lhs, const time_point& rhs); // (2) C++14 }} From ba5a5a9392ad379ac413fc0336991838cdf89a3a Mon Sep 17 00:00:00 2001 From: suomesta Date: Sat, 30 Sep 2023 13:31:19 +0900 Subject: [PATCH 0496/3948] some small improvements in samples --- reference/chrono/duration/op_modulo.md | 2 +- reference/chrono/treat_as_floating_point.md | 4 ++-- reference/iterator/move_iterator/op_compare_3way.md | 1 - reference/iterator/move_iterator/op_equal.md | 1 - reference/iterator/move_iterator/op_greater.md | 1 - reference/iterator/move_iterator/op_greater_equal.md | 1 - reference/iterator/move_iterator/op_less.md | 1 - reference/iterator/move_iterator/op_less_equal.md | 1 - reference/iterator/move_iterator/op_minus.md | 1 - reference/iterator/move_iterator/op_not_equal.md | 1 - reference/ranges/input_range.md | 1 - 11 files changed, 3 insertions(+), 12 deletions(-) diff --git a/reference/chrono/duration/op_modulo.md b/reference/chrono/duration/op_modulo.md index 7f498d6c60..3320456f02 100644 --- a/reference/chrono/duration/op_modulo.md +++ b/reference/chrono/duration/op_modulo.md @@ -67,7 +67,7 @@ int main() std::cout << ms.count() << std::endl; } - // duration / duration + // duration % duration { seconds s = seconds(8) % seconds(3); std::cout << s.count() << std::endl; diff --git a/reference/chrono/treat_as_floating_point.md b/reference/chrono/treat_as_floating_point.md index f2182f942a..82caf6408d 100644 --- a/reference/chrono/treat_as_floating_point.md +++ b/reference/chrono/treat_as_floating_point.md @@ -36,13 +36,13 @@ int main() // floating point Rep static_assert( treat_as_floating_point>::rep>::value, - "duration> > can't become floating point" + "duration> > must be floating point" ); // integer Rep static_assert( !treat_as_floating_point::value, - "seconds can't become floating point" + "milliseconds can't become floating point" ); } ``` diff --git a/reference/iterator/move_iterator/op_compare_3way.md b/reference/iterator/move_iterator/op_compare_3way.md index 9ef855f71a..34745f6fda 100644 --- a/reference/iterator/move_iterator/op_compare_3way.md +++ b/reference/iterator/move_iterator/op_compare_3way.md @@ -28,7 +28,6 @@ namespace std { #include #include #include -#include #include int main() diff --git a/reference/iterator/move_iterator/op_equal.md b/reference/iterator/move_iterator/op_equal.md index 3ae76fd20b..cf851262af 100644 --- a/reference/iterator/move_iterator/op_equal.md +++ b/reference/iterator/move_iterator/op_equal.md @@ -61,7 +61,6 @@ C++20以降、これらの演算子により以下の演算子が使用可能に #include #include #include -#include #include int main() diff --git a/reference/iterator/move_iterator/op_greater.md b/reference/iterator/move_iterator/op_greater.md index 3ed2238c62..d6818b44dc 100644 --- a/reference/iterator/move_iterator/op_greater.md +++ b/reference/iterator/move_iterator/op_greater.md @@ -32,7 +32,6 @@ namespace std { #include #include #include -#include #include int main() diff --git a/reference/iterator/move_iterator/op_greater_equal.md b/reference/iterator/move_iterator/op_greater_equal.md index e21a2ad0bf..701907db3e 100644 --- a/reference/iterator/move_iterator/op_greater_equal.md +++ b/reference/iterator/move_iterator/op_greater_equal.md @@ -32,7 +32,6 @@ namespace std { #include #include #include -#include #include int main() diff --git a/reference/iterator/move_iterator/op_less.md b/reference/iterator/move_iterator/op_less.md index 418cc24be9..5e8eab85e3 100644 --- a/reference/iterator/move_iterator/op_less.md +++ b/reference/iterator/move_iterator/op_less.md @@ -33,7 +33,6 @@ namespace std { #include #include #include -#include #include int main() diff --git a/reference/iterator/move_iterator/op_less_equal.md b/reference/iterator/move_iterator/op_less_equal.md index b9e5c36b78..842d979624 100644 --- a/reference/iterator/move_iterator/op_less_equal.md +++ b/reference/iterator/move_iterator/op_less_equal.md @@ -32,7 +32,6 @@ namespace std { #include #include #include -#include #include int main() diff --git a/reference/iterator/move_iterator/op_minus.md b/reference/iterator/move_iterator/op_minus.md index 44563d80d8..bc320bfc3b 100644 --- a/reference/iterator/move_iterator/op_minus.md +++ b/reference/iterator/move_iterator/op_minus.md @@ -52,7 +52,6 @@ namespace std { #include #include #include -#include #include int main() diff --git a/reference/iterator/move_iterator/op_not_equal.md b/reference/iterator/move_iterator/op_not_equal.md index 70167b4a99..ef042e655a 100644 --- a/reference/iterator/move_iterator/op_not_equal.md +++ b/reference/iterator/move_iterator/op_not_equal.md @@ -47,7 +47,6 @@ C++20以降、この演算子は[`operator==`](op_equal.md)によって使用可 #include #include #include -#include #include int main() diff --git a/reference/ranges/input_range.md b/reference/ranges/input_range.md index 4a718f0cae..3d25375cfa 100644 --- a/reference/ranges/input_range.md +++ b/reference/ranges/input_range.md @@ -23,7 +23,6 @@ namespace std::ranges { ## 例 ```cpp example #include -#include #include int main() { From d2d48f0a58488d30bfb62833363b35821459adfc Mon Sep 17 00:00:00 2001 From: suomesta Date: Sat, 30 Sep 2023 13:36:08 +0900 Subject: [PATCH 0497/3948] fix meta-id from function to function template --- reference/deque/deque/erase_free.md | 2 +- reference/flat_map/flat_map/erase_if_free.md | 2 +- reference/forward_list/forward_list/erase_free.md | 2 +- reference/forward_list/forward_list/erase_if_free.md | 2 +- reference/list/list/erase_free.md | 2 +- reference/string/basic_string/erase_free.md | 2 +- reference/vector/vector/erase_free.md | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/reference/deque/deque/erase_free.md b/reference/deque/deque/erase_free.md index 5727df35f3..c6439601a6 100644 --- a/reference/deque/deque/erase_free.md +++ b/reference/deque/deque/erase_free.md @@ -1,7 +1,7 @@ # erase (非メンバ関数) * deque[meta header] * std[meta namespace] -* function[meta id-type] +* function template[meta id-type] * cpp20[meta cpp] ```cpp diff --git a/reference/flat_map/flat_map/erase_if_free.md b/reference/flat_map/flat_map/erase_if_free.md index ff886ba089..f7736ce45d 100644 --- a/reference/flat_map/flat_map/erase_if_free.md +++ b/reference/flat_map/flat_map/erase_if_free.md @@ -1,7 +1,7 @@ # erase_if * flat_map[meta header] * std[meta namespace] -* function[meta id-type] +* function template[meta id-type] * cpp23[meta cpp] ```cpp diff --git a/reference/forward_list/forward_list/erase_free.md b/reference/forward_list/forward_list/erase_free.md index 210d095e21..4412b45456 100644 --- a/reference/forward_list/forward_list/erase_free.md +++ b/reference/forward_list/forward_list/erase_free.md @@ -1,7 +1,7 @@ # erase (非メンバ関数) * forward_list[meta header] * std[meta namespace] -* function[meta id-type] +* function template[meta id-type] * cpp20[meta cpp] ```cpp diff --git a/reference/forward_list/forward_list/erase_if_free.md b/reference/forward_list/forward_list/erase_if_free.md index cb63ee486e..bd0d058a91 100644 --- a/reference/forward_list/forward_list/erase_if_free.md +++ b/reference/forward_list/forward_list/erase_if_free.md @@ -1,7 +1,7 @@ # erase_if * forward_list[meta header] * std[meta namespace] -* function[meta id-type] +* function template[meta id-type] * cpp20[meta cpp] ```cpp diff --git a/reference/list/list/erase_free.md b/reference/list/list/erase_free.md index 3c7a50709c..775837855d 100644 --- a/reference/list/list/erase_free.md +++ b/reference/list/list/erase_free.md @@ -1,7 +1,7 @@ # erase (非メンバ関数) * list[meta header] * std[meta namespace] -* function[meta id-type] +* function template[meta id-type] * cpp20[meta cpp] ```cpp diff --git a/reference/string/basic_string/erase_free.md b/reference/string/basic_string/erase_free.md index efd307220c..971ac0507a 100644 --- a/reference/string/basic_string/erase_free.md +++ b/reference/string/basic_string/erase_free.md @@ -1,7 +1,7 @@ # erase (非メンバ関数) * string[meta header] * std[meta namespace] -* function[meta id-type] +* function template[meta id-type] * cpp20[meta cpp] ```cpp diff --git a/reference/vector/vector/erase_free.md b/reference/vector/vector/erase_free.md index 8050eb8992..ca5f2048df 100644 --- a/reference/vector/vector/erase_free.md +++ b/reference/vector/vector/erase_free.md @@ -1,7 +1,7 @@ # erase (非メンバ関数) * vector[meta header] * std[meta namespace] -* function[meta id-type] +* function template[meta id-type] * cpp20[meta cpp] ```cpp From d172c772fb408750a5d91b48693e602df6cbf579 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sat, 30 Sep 2023 13:58:46 +0900 Subject: [PATCH 0498/3948] fix std version numbers --- reference/atomic/atomic_fetch_and.md | 2 +- reference/chrono/time_point/op_constructor.md | 2 +- reference/cmath/assoc_legendre.md | 4 ++-- reference/cmath/ceil.md | 4 ++-- reference/cmath/comp_ellint_1.md | 6 +++--- reference/cmath/fabs.md | 2 +- reference/cmath/fmax.md | 2 +- reference/cmath/fmin.md | 4 ++-- reference/cmath/round.md | 2 +- reference/filesystem/path/op_equal.md | 2 +- reference/forward_list/forward_list/swap.md | 2 +- reference/iterator/move_iterator/op_not_equal.md | 2 +- reference/string/basic_string/op_greater.md | 2 +- 13 files changed, 18 insertions(+), 18 deletions(-) diff --git a/reference/atomic/atomic_fetch_and.md b/reference/atomic/atomic_fetch_and.md index f6e534cbb9..9787490851 100644 --- a/reference/atomic/atomic_fetch_and.md +++ b/reference/atomic/atomic_fetch_and.md @@ -24,7 +24,7 @@ namespace std { template T atomic_fetch_and( atomic* object, - typename atomic::value_type operand) noexcept; // (2) C++11 + typename atomic::value_type operand) noexcept; // (2) C++17 } ``` * atomic[link atomic.md] diff --git a/reference/chrono/time_point/op_constructor.md b/reference/chrono/time_point/op_constructor.md index 264aea9f87..30809652e2 100644 --- a/reference/chrono/time_point/op_constructor.md +++ b/reference/chrono/time_point/op_constructor.md @@ -13,7 +13,7 @@ explicit time_point(const duration& d); // (2) C++11 constexpr explicit time_point(const duration& d); // (2) C++14 template -time_point(const time_point& t); // (3) C++14 +time_point(const time_point& t); // (3) C++11 template constexpr time_point(const time_point& t); // (3) C++14 diff --git a/reference/cmath/assoc_legendre.md b/reference/cmath/assoc_legendre.md index b36db5ea08..6c6839d980 100644 --- a/reference/cmath/assoc_legendre.md +++ b/reference/cmath/assoc_legendre.md @@ -24,12 +24,12 @@ namespace std { float assoc_legendref(unsigned int l, unsigned int m, - float x); // (2) C++17 + float x); // (3) C++17 long double assoc_legendrel(unsigned int l, unsigned int m, - long double x); // (3) C++17 + long double x); // (4) C++17 } ``` * Promoted[italic] diff --git a/reference/cmath/ceil.md b/reference/cmath/ceil.md index dd4d662f7a..eaf8388e55 100644 --- a/reference/cmath/ceil.md +++ b/reference/cmath/ceil.md @@ -20,12 +20,12 @@ namespace std { float ceilf(float x); // (6) C++17 constexpr float - ceilf(float x); // (6) C++17 + ceilf(float x); // (6) C++23 long double ceill(long double x); // (7) C++17 constexpr long double - ceill(long double x); // (7) C++17 + ceill(long double x); // (7) C++23 } ``` * Integral[italic] diff --git a/reference/cmath/comp_ellint_1.md b/reference/cmath/comp_ellint_1.md index 8969a506b7..c26d5595cd 100644 --- a/reference/cmath/comp_ellint_1.md +++ b/reference/cmath/comp_ellint_1.md @@ -13,13 +13,13 @@ namespace std { comp_ellint_1(floating-point-type k); // (1) C++23 Promoted - comp_ellint_1(Arithmetic k); // (1) C++17 + comp_ellint_1(Arithmetic k); // (2) C++17 float - comp_ellint_1f(float k); // (2) C++17 + comp_ellint_1f(float k); // (3) C++17 long double - comp_ellint_1l(long double k); // (3) C++17 + comp_ellint_1l(long double k); // (4) C++17 } ``` * Promoted[italic] diff --git a/reference/cmath/fabs.md b/reference/cmath/fabs.md index dff3100ed3..ee7a196cc6 100644 --- a/reference/cmath/fabs.md +++ b/reference/cmath/fabs.md @@ -26,7 +26,7 @@ namespace std { long double fabsl(long double x); // (7) C++17 constexpr long double - fabsl(long double x); // (7) C++17 + fabsl(long double x); // (7) C++23 } ``` * Integral[italic] diff --git a/reference/cmath/fmax.md b/reference/cmath/fmax.md index 897dc964cd..39d9ca6275 100644 --- a/reference/cmath/fmax.md +++ b/reference/cmath/fmax.md @@ -30,7 +30,7 @@ namespace std { long double fmaxl(long double x, long double y); // (7) C++17 constexpr long double - fmaxl(long double x, long double y); // (7) C++17 + fmaxl(long double x, long double y); // (7) C++23 } ``` * Promoted[italic] diff --git a/reference/cmath/fmin.md b/reference/cmath/fmin.md index d342f48a40..6f95abde92 100644 --- a/reference/cmath/fmin.md +++ b/reference/cmath/fmin.md @@ -25,12 +25,12 @@ namespace std { float fminf(float x, float y); // (6) C++17 constexpr float - fminf(float x, float y); // (6) C++17 + fminf(float x, float y); // (6) C++23 long double fminl(long double x, long double y); // (7) C++17 constexpr long double - fminl(long double x, long double y); // (7) C++17 + fminl(long double x, long double y); // (7) C++23 } ``` * Promoted[italic] diff --git a/reference/cmath/round.md b/reference/cmath/round.md index 0eb888f839..a685b14eae 100644 --- a/reference/cmath/round.md +++ b/reference/cmath/round.md @@ -21,7 +21,7 @@ namespace std { float roundf(float x); // (6) C++17 constexpr float - roundf(float x); // (6) C++17 + roundf(float x); // (6) C++23 long double roundl(long double x); // (7) C++17 diff --git a/reference/filesystem/path/op_equal.md b/reference/filesystem/path/op_equal.md index 2dfafdd795..fe27e58ec5 100644 --- a/reference/filesystem/path/op_equal.md +++ b/reference/filesystem/path/op_equal.md @@ -6,7 +6,7 @@ ```cpp namespace std::filesystem { - bool operator==(const path& lhs, const path& rhs) noexcept; // (1) C++20 + bool operator==(const path& lhs, const path& rhs) noexcept; // (1) C++17 class path { public: diff --git a/reference/forward_list/forward_list/swap.md b/reference/forward_list/forward_list/swap.md index fb58dd7b9e..2edb1f4972 100644 --- a/reference/forward_list/forward_list/swap.md +++ b/reference/forward_list/forward_list/swap.md @@ -6,7 +6,7 @@ * cpp11[meta cpp] ```cpp -void swap(forward_list& x); // (1) C++17 +void swap(forward_list& x); // (1) C++11 void swap(forward_list& x) noexcept( diff --git a/reference/iterator/move_iterator/op_not_equal.md b/reference/iterator/move_iterator/op_not_equal.md index ef042e655a..ba2cf3b10b 100644 --- a/reference/iterator/move_iterator/op_not_equal.md +++ b/reference/iterator/move_iterator/op_not_equal.md @@ -23,7 +23,7 @@ namespace std { operator!=(const move_iterator& x, const move_sentinel& y); // (2) C++20 template S> friend constexpr bool - operator!=(const move_sentinel& x, const move_iterator& y); // (2) C++20 + operator!=(const move_sentinel& x, const move_iterator& y); // (3) C++20 }; } ``` diff --git a/reference/string/basic_string/op_greater.md b/reference/string/basic_string/op_greater.md index fecd2374ef..1ff75a20ab 100644 --- a/reference/string/basic_string/op_greater.md +++ b/reference/string/basic_string/op_greater.md @@ -17,7 +17,7 @@ namespace std { template constexpr bool operator>(const basic_string& a, - const basic_string& b) noexcept; // (1) C++14 + const basic_string& b) noexcept; // (1) C++20 template bool From 46a08baefd09238f70612716fbb23e1197d8fdf4 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sat, 30 Sep 2023 14:44:45 +0900 Subject: [PATCH 0499/3948] add C++03 version --- reference/deque/deque/begin.md | 7 +++++-- reference/deque/deque/clear.md | 3 ++- reference/deque/deque/end.md | 7 +++++-- reference/deque/deque/max_size.md | 3 ++- reference/deque/deque/rbegin.md | 7 +++++-- reference/deque/deque/rend.md | 7 +++++-- reference/deque/deque/size.md | 3 ++- reference/map/map/begin.md | 7 +++++-- reference/map/map/clear.md | 3 ++- reference/map/map/end.md | 7 +++++-- reference/map/map/max_size.md | 3 ++- reference/map/map/rbegin.md | 7 +++++-- reference/map/map/rend.md | 7 +++++-- reference/map/map/size.md | 3 ++- reference/map/multimap/begin.md | 7 +++++-- reference/map/multimap/clear.md | 3 ++- reference/map/multimap/end.md | 7 +++++-- reference/map/multimap/max_size.md | 3 ++- reference/map/multimap/rbegin.md | 7 +++++-- reference/map/multimap/rend.md | 7 +++++-- reference/map/multimap/size.md | 3 ++- reference/set/multiset/begin.md | 7 +++++-- reference/set/multiset/clear.md | 3 ++- reference/set/multiset/end.md | 7 +++++-- reference/set/multiset/max_size.md | 3 ++- reference/set/multiset/rbegin.md | 7 +++++-- reference/set/multiset/rend.md | 7 +++++-- reference/set/multiset/size.md | 3 ++- reference/set/set/begin.md | 7 +++++-- reference/set/set/clear.md | 3 ++- reference/set/set/end.md | 7 +++++-- reference/set/set/max_size.md | 3 ++- reference/set/set/rbegin.md | 7 +++++-- reference/set/set/rend.md | 7 +++++-- reference/set/set/size.md | 3 ++- 35 files changed, 130 insertions(+), 55 deletions(-) diff --git a/reference/deque/deque/begin.md b/reference/deque/deque/begin.md index cbabb51d82..0c791f0fbd 100644 --- a/reference/deque/deque/begin.md +++ b/reference/deque/deque/begin.md @@ -5,8 +5,11 @@ * function[meta id-type] ```cpp -iterator begin() noexcept; -const_iterator begin() const noexcept; +iterator begin(); // (1) C++03 +iterator begin() noexcept; // (1) C++11 + +const_iterator begin() const; // (2) C++03 +const_iterator begin() const noexcept; // (2) C++11 ``` ## 概要 diff --git a/reference/deque/deque/clear.md b/reference/deque/deque/clear.md index 6164605423..39e0bf3403 100644 --- a/reference/deque/deque/clear.md +++ b/reference/deque/deque/clear.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -void clear() noexcept; +void clear(); // C++03 +void clear() noexcept; // C++11 ``` ## 概要 diff --git a/reference/deque/deque/end.md b/reference/deque/deque/end.md index a9ba0089aa..2369e4812b 100644 --- a/reference/deque/deque/end.md +++ b/reference/deque/deque/end.md @@ -5,8 +5,11 @@ * function[meta id-type] ```cpp -iterator end() noexcept; -const_iterator end() const noexcept; +iterator end(); // (1) C++03 +iterator end() noexcept; // (1) C++11 + +const_iterator end() const; // (2) C++03 +const_iterator end() const noexcept; // (2) C++11 ``` ## 概要 diff --git a/reference/deque/deque/max_size.md b/reference/deque/deque/max_size.md index b97485dde8..9bd2e6dabc 100644 --- a/reference/deque/deque/max_size.md +++ b/reference/deque/deque/max_size.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -size_type max_size() const noexcept; +size_type max_size() const; // C++03 +size_type max_size() const noexcept; // C++11 ``` ## 概要 diff --git a/reference/deque/deque/rbegin.md b/reference/deque/deque/rbegin.md index 90190fb238..09ea8e44ef 100644 --- a/reference/deque/deque/rbegin.md +++ b/reference/deque/deque/rbegin.md @@ -5,8 +5,11 @@ * function[meta id-type] ```cpp -reverse_iterator rbegin() noexcept; -const_reverse_iterator rbegin() const noexcept; +reverse_iterator rbegin(); // (1) C++03 +reverse_iterator rbegin() noexcept; // (1) C++11 + +const_reverse_iterator rbegin() const; // (2) C++03 +const_reverse_iterator rbegin() const noexcept; // (2) C++11 ``` ## 概要 diff --git a/reference/deque/deque/rend.md b/reference/deque/deque/rend.md index 7b0beb878a..7e4b450fe4 100644 --- a/reference/deque/deque/rend.md +++ b/reference/deque/deque/rend.md @@ -5,8 +5,11 @@ * function[meta id-type] ```cpp -reverse_iterator rend() noexcept; -const_reverse_iterator rend() const noexcept; +reverse_iterator rend(); // (1) C++03 +reverse_iterator rend() noexcept; // (1) C++11 + +const_reverse_iterator rend() const; // (2) C++03 +const_reverse_iterator rend() const noexcept; // (2) C++11 ``` ## 概要 diff --git a/reference/deque/deque/size.md b/reference/deque/deque/size.md index 94eb9d3acd..ff0e527272 100644 --- a/reference/deque/deque/size.md +++ b/reference/deque/deque/size.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -size_type size() const noexcept; +size_type size() const; // C++03 +size_type size() const noexcept; // C++11 ``` ## 概要 diff --git a/reference/map/map/begin.md b/reference/map/map/begin.md index 83a13b26b4..509972917b 100644 --- a/reference/map/map/begin.md +++ b/reference/map/map/begin.md @@ -5,8 +5,11 @@ * function[meta id-type] ```cpp -iterator begin() noexcept; -const_iterator begin() const noexcept; +iterator begin(); // (1) C++03 +iterator begin() noexcept; // (1) C++11 + +const_iterator begin() const; // (2) C++03 +const_iterator begin() const noexcept; // (2) C++11 ``` diff --git a/reference/map/map/clear.md b/reference/map/map/clear.md index 6fbb4055ed..4da367be61 100644 --- a/reference/map/map/clear.md +++ b/reference/map/map/clear.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -void clear() noexcept; +void clear(); // C++03 +void clear() noexcept; // C++11 ``` ## 概要 diff --git a/reference/map/map/end.md b/reference/map/map/end.md index 295f317db0..64199b90fc 100644 --- a/reference/map/map/end.md +++ b/reference/map/map/end.md @@ -5,8 +5,11 @@ * function[meta id-type] ```cpp -iterator end() noexcept; -const_iterator end() const noexcept; +iterator end(); // (1) C++03 +iterator end() noexcept; // (1) C++11 + +const_iterator end() const; // (2) C++03 +const_iterator end() const noexcept; // (2) C++11 ``` ## 概要 diff --git a/reference/map/map/max_size.md b/reference/map/map/max_size.md index b2c5d30bf2..d7500ace46 100644 --- a/reference/map/map/max_size.md +++ b/reference/map/map/max_size.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -size_type max_size() const noexcept; +size_type max_size() const; // C++03 +size_type max_size() const noexcept; // C++11 ``` ## 概要 diff --git a/reference/map/map/rbegin.md b/reference/map/map/rbegin.md index d22d28ff16..aa43704549 100644 --- a/reference/map/map/rbegin.md +++ b/reference/map/map/rbegin.md @@ -5,8 +5,11 @@ * function[meta id-type] ```cpp -reverse_iterator rbegin() noexcept; -const_reverse_iterator rbegin() const noexcept; +reverse_iterator rbegin(); // (1) C++03 +reverse_iterator rbegin() noexcept; // (1) C++11 + +const_reverse_iterator rbegin() const; // (2) C++03 +const_reverse_iterator rbegin() const noexcept; // (2) C++11 ``` ## 概要 diff --git a/reference/map/map/rend.md b/reference/map/map/rend.md index 8194808230..d6288d767b 100644 --- a/reference/map/map/rend.md +++ b/reference/map/map/rend.md @@ -5,8 +5,11 @@ * function[meta id-type] ```cpp -reverse_iterator rend() noexcept; -const_reverse_iterator rend() const noexcept; +reverse_iterator rend(); // (1) C++03 +reverse_iterator rend() noexcept; // (1) C++11 + +const_reverse_iterator rend() const; // (2) C++03 +const_reverse_iterator rend() const noexcept; // (2) C++11 ``` ## 概要 diff --git a/reference/map/map/size.md b/reference/map/map/size.md index f3d75df28b..7d6ea4b5a5 100644 --- a/reference/map/map/size.md +++ b/reference/map/map/size.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -size_type size() const noexcept; +size_type size() const; // C++03 +size_type size() const noexcept; // C++11 ``` ## 概要 diff --git a/reference/map/multimap/begin.md b/reference/map/multimap/begin.md index f992c019f7..d0fe47e760 100644 --- a/reference/map/multimap/begin.md +++ b/reference/map/multimap/begin.md @@ -5,8 +5,11 @@ * function[meta id-type] ```cpp -iterator begin() noexcept; -const_iterator begin() const noexcept; +iterator begin(); // (1) C++03 +iterator begin() noexcept; // (1) C++11 + +const_iterator begin() const; // (2) C++03 +const_iterator begin() const noexcept; // (2) C++11 ``` diff --git a/reference/map/multimap/clear.md b/reference/map/multimap/clear.md index 9bf6ee3bf8..3c4e9c7168 100644 --- a/reference/map/multimap/clear.md +++ b/reference/map/multimap/clear.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -void clear() noexcept; +void clear(); // C++03 +void clear() noexcept; // C++11 ``` ## 概要 diff --git a/reference/map/multimap/end.md b/reference/map/multimap/end.md index d1b69cfea9..4ec49d6782 100644 --- a/reference/map/multimap/end.md +++ b/reference/map/multimap/end.md @@ -5,8 +5,11 @@ * function[meta id-type] ```cpp -iterator end() noexcept; -const_iterator end() const noexcept; +iterator end(); // (1) C++03 +iterator end() noexcept; // (1) C++11 + +const_iterator end() const; // (2) C++03 +const_iterator end() const noexcept; // (2) C++11 ``` ## 概要 diff --git a/reference/map/multimap/max_size.md b/reference/map/multimap/max_size.md index 1bb93de75f..993e30d681 100644 --- a/reference/map/multimap/max_size.md +++ b/reference/map/multimap/max_size.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -size_type max_size() const noexcept; +size_type max_size() const; // C++03 +size_type max_size() const noexcept; // C++11 ``` ## 概要 diff --git a/reference/map/multimap/rbegin.md b/reference/map/multimap/rbegin.md index b19d19bbce..50c1cc14b3 100644 --- a/reference/map/multimap/rbegin.md +++ b/reference/map/multimap/rbegin.md @@ -5,8 +5,11 @@ * function[meta id-type] ```cpp -reverse_iterator rbegin() noexcept; -const_reverse_iterator rbegin() const noexcept; +reverse_iterator rbegin(); // (1) C++03 +reverse_iterator rbegin() noexcept; // (1) C++11 + +const_reverse_iterator rbegin() const; // (2) C++03 +const_reverse_iterator rbegin() const noexcept; // (2) C++11 ``` ## 概要 diff --git a/reference/map/multimap/rend.md b/reference/map/multimap/rend.md index b677d1e656..8dda7f3c1c 100644 --- a/reference/map/multimap/rend.md +++ b/reference/map/multimap/rend.md @@ -5,8 +5,11 @@ * function[meta id-type] ```cpp -reverse_iterator rend() noexcept; -const_reverse_iterator rend() const noexcept; +reverse_iterator rend(); // (1) C++03 +reverse_iterator rend() noexcept; // (1) C++11 + +const_reverse_iterator rend() const; // (2) C++03 +const_reverse_iterator rend() const noexcept; // (2) C++11 ``` ## 概要 diff --git a/reference/map/multimap/size.md b/reference/map/multimap/size.md index 3b27c6ae60..b268ff51e4 100644 --- a/reference/map/multimap/size.md +++ b/reference/map/multimap/size.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -size_type size() const noexcept; +size_type size() const; // C++03 +size_type size() const noexcept; // C++11 ``` ## 概要 diff --git a/reference/set/multiset/begin.md b/reference/set/multiset/begin.md index 0341799695..721a5a9069 100644 --- a/reference/set/multiset/begin.md +++ b/reference/set/multiset/begin.md @@ -5,8 +5,11 @@ * function[meta id-type] ```cpp -iterator begin() noexcept; -const_iterator begin() const noexcept; +iterator begin(); // (1) C++03 +iterator begin() noexcept; // (1) C++11 + +const_iterator begin() const; // (2) C++03 +const_iterator begin() const noexcept; // (2) C++11 ``` diff --git a/reference/set/multiset/clear.md b/reference/set/multiset/clear.md index 0f27222571..b807fe3747 100644 --- a/reference/set/multiset/clear.md +++ b/reference/set/multiset/clear.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -void clear() noexcept; +void clear(); // C++03 +void clear() noexcept; // C++11 ``` ## 概要 diff --git a/reference/set/multiset/end.md b/reference/set/multiset/end.md index 6956b65857..44fe3e8ba5 100644 --- a/reference/set/multiset/end.md +++ b/reference/set/multiset/end.md @@ -5,8 +5,11 @@ * function[meta id-type] ```cpp -iterator end() noexcept; -const_iterator end() const noexcept; +iterator end(); // (1) C++03 +iterator end() noexcept; // (1) C++11 + +const_iterator end() const; // (2) C++03 +const_iterator end() const noexcept; // (2) C++11 ``` ## 概要 diff --git a/reference/set/multiset/max_size.md b/reference/set/multiset/max_size.md index 561a6c45ab..3ebef31dbe 100644 --- a/reference/set/multiset/max_size.md +++ b/reference/set/multiset/max_size.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -size_type max_size() const noexcept; +size_type max_size() const; // C++03 +size_type max_size() const noexcept; // C++11 ``` ## 概要 diff --git a/reference/set/multiset/rbegin.md b/reference/set/multiset/rbegin.md index 4220ad8eef..715136a5f9 100644 --- a/reference/set/multiset/rbegin.md +++ b/reference/set/multiset/rbegin.md @@ -5,8 +5,11 @@ * function[meta id-type] ```cpp -reverse_iterator rbegin() noexcept; -const_reverse_iterator rbegin() const noexcept; +reverse_iterator rbegin(); // (1) C++03 +reverse_iterator rbegin() noexcept; // (1) C++11 + +const_reverse_iterator rbegin() const; // (2) C++03 +const_reverse_iterator rbegin() const noexcept; // (2) C++11 ``` diff --git a/reference/set/multiset/rend.md b/reference/set/multiset/rend.md index c8ea58d0c5..ad243ceb78 100644 --- a/reference/set/multiset/rend.md +++ b/reference/set/multiset/rend.md @@ -5,8 +5,11 @@ * function[meta id-type] ```cpp -reverse_iterator rend() noexcept; -const_reverse_iterator rend() const noexcept; +reverse_iterator rend(); // (1) C++03 +reverse_iterator rend() noexcept; // (1) C++11 + +const_reverse_iterator rend() const; // (2) C++03 +const_reverse_iterator rend() const noexcept; // (2) C++11 ``` diff --git a/reference/set/multiset/size.md b/reference/set/multiset/size.md index b54d2b60d0..4c3061b138 100644 --- a/reference/set/multiset/size.md +++ b/reference/set/multiset/size.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -size_type size() const noexcept; +size_type size() const; // C++03 +size_type size() const noexcept; // C++11 ``` ## 概要 diff --git a/reference/set/set/begin.md b/reference/set/set/begin.md index dcf55187cb..fd041908f6 100644 --- a/reference/set/set/begin.md +++ b/reference/set/set/begin.md @@ -5,8 +5,11 @@ * function[meta id-type] ```cpp -iterator begin() noexcept; -const_iterator begin() const noexcept; +iterator begin(); // (1) C++03 +iterator begin() noexcept; // (1) C++11 + +const_iterator begin() const; // (2) C++03 +const_iterator begin() const noexcept; // (2) C++11 ``` diff --git a/reference/set/set/clear.md b/reference/set/set/clear.md index af4f88972c..8d7cac8736 100644 --- a/reference/set/set/clear.md +++ b/reference/set/set/clear.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -void clear() noexcept; +void clear(); // C++03 +void clear() noexcept; // C++11 ``` ## 概要 diff --git a/reference/set/set/end.md b/reference/set/set/end.md index 66aab63baf..2403d14fdc 100644 --- a/reference/set/set/end.md +++ b/reference/set/set/end.md @@ -5,8 +5,11 @@ * function[meta id-type] ```cpp -iterator end() noexcept; -const_iterator end() const noexcept; +iterator end(); // (1) C++03 +iterator end() noexcept; // (1) C++11 + +const_iterator end() const; // (2) C++03 +const_iterator end() const noexcept; // (2) C++11 ``` ## 概要 diff --git a/reference/set/set/max_size.md b/reference/set/set/max_size.md index 0d023690a4..bf6685eea3 100644 --- a/reference/set/set/max_size.md +++ b/reference/set/set/max_size.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -size_type max_size() const noexcept; +size_type max_size() const; // C++03 +size_type max_size() const noexcept; // C++11 ``` ## 概要 diff --git a/reference/set/set/rbegin.md b/reference/set/set/rbegin.md index 27a33219a4..efb9239eb6 100644 --- a/reference/set/set/rbegin.md +++ b/reference/set/set/rbegin.md @@ -5,8 +5,11 @@ * function[meta id-type] ```cpp -reverse_iterator rbegin() noexcept; -const_reverse_iterator rbegin() const noexcept; +reverse_iterator rbegin(); // (1) C++03 +reverse_iterator rbegin() noexcept; // (1) C++11 + +const_reverse_iterator rbegin() const; // (2) C++03 +const_reverse_iterator rbegin() const noexcept; // (2) C++11 ``` diff --git a/reference/set/set/rend.md b/reference/set/set/rend.md index ffdbe061c5..62b0ea8278 100644 --- a/reference/set/set/rend.md +++ b/reference/set/set/rend.md @@ -5,8 +5,11 @@ * function[meta id-type] ```cpp -reverse_iterator rend() noexcept; -const_reverse_iterator rend() const noexcept; +reverse_iterator rend(); // (1) C++03 +reverse_iterator rend() noexcept; // (1) C++11 + +const_reverse_iterator rend() const; // (2) C++03 +const_reverse_iterator rend() const noexcept; // (2) C++11 ``` diff --git a/reference/set/set/size.md b/reference/set/set/size.md index e71c383acb..ecaa35ab49 100644 --- a/reference/set/set/size.md +++ b/reference/set/set/size.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -size_type size() const noexcept; +size_type size() const; // C++03 +size_type size() const noexcept; // C++11 ``` ## 概要 From 13b0cf9df87de6e5f426f9f689d72aace5046a38 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 2 Oct 2023 18:51:16 +0900 Subject: [PATCH 0500/3948] =?UTF-8?q?C++26=20:=20=E8=A8=80=E8=AA=9E?= =?UTF-8?q?=E6=A9=9F=E8=83=BD=E3=82=92=E8=BF=BD=E5=8A=A0=20#1166?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/lang/cpp26.md b/lang/cpp26.md index ed3a33357c..ffbf11ab75 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -7,9 +7,42 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 ## 言語機能 +### 変数 | 言語機能 | 説明 | |----------|------| +| [`std::initializer_list`の配列を静的ストレージに配置する](/lang/cpp26/static_storage_for_braced_initializers.md.nolink) | `std::vector v = {1, 2, 3};`のような初期化で初期化子リストを静的ストレージに配置することで無駄なコピーをなくす | +| [宣言のみで使用しない変数の名前として`_`をサポート](/lang/cpp26/nice_placeholder_with_no_name.md.nolink) | 変数名`_`は暗黙で`[[maybe_unused]]`が指定される | + + +### 文字列 + +| 言語機能 | 説明 | +|----------|------| +| [文字列リテラルの文字エンコーディング失敗を不適格とする](/lang/cpp26/making_non-encodable_string_literals_ill-formed.md.nolink) | 文字列リテラルのエンコーディング時に文字表現が失われる場合にコンパイルエラーにする | +| [コンパイル時にのみ使用される文字列の扱いを明確化](/lang/cpp26/unevaluated_strings.md.nolink) | `static_assert`や`[[deprecated]]`などで使用されるコンパイル時の文字列について、文字コードの指定を禁止し、実行時エンコーディングが行われないことを規定 | + + +### 属性 + +| 言語機能 | 説明 | +|----------|------| +| [属性の無視性を見直し](/lang/cpp26/on_the_ignorability_of_standard_attributes.md.nolink) | 構文として適格な属性のみを無視できるようにし、そうでない属性の使用を不適格とする | + + +### 定数式 + +| 言語機能 | 説明 | +|----------|------| +| [定数式での`void*`からポインタ型へのキャストを許可](/lang/cpp26/constexpr_cast_from_voidptr.md.nolink) | 型消去のために`void*`からポインタ型へのキャストを許可する | +| [`static_assert`の診断メッセージにユーザーが生成した文字列の指定を許可](/lang/cpp26/user-generated_static_assert_messages.md.nolink) | `constexpr`な`S.size()`と`S.data()`メンバ関数をもつオブジェクトをコンパイル時文字列として指定できるようにする | + + +### ソースコード + +| 言語機能 | 説明 | +|----------|------| +| [基本文字集合に@、$、\`を追加](/lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md.nolink) | C言語との互換性のためにこれらの文字を基本文字集合に追加 | ## ライブラリ更新の概要 From 10539d462cf7325212c96e5620110fdb8a79b115 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 4 Oct 2023 15:39:04 +0900 Subject: [PATCH 0501/3948] =?UTF-8?q?view=20:=20=E6=84=8F=E5=91=B3?= =?UTF-8?q?=E8=AB=96=E8=A6=81=E4=BB=B6=E3=81=AE=E5=BE=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/view.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/ranges/view.md b/reference/ranges/view.md index a33f657bb5..ac2b10319d 100644 --- a/reference/ranges/view.md +++ b/reference/ranges/view.md @@ -30,7 +30,7 @@ namespace std::ranges { 2. `T`のムーブ代入は、`T`のデストラクタとムーブコンストラクタを連続で実行する場合より複雑にならない 3. M 個の要素を持つ`T`型のオブジェクトから N 個の`T`型オブジェクトをムーブやコピーで作ったとき、それら N 個の`T`型オブジェクトは O(N + M) で破棄できる 4. [`copy_constructible`](/reference/concepts/copy_constructible.md)``が`false`、または`T`のコピーコンストラクタがO(1) -5. [`copyable`](/reference/concepts/copyable.md)``が`false`、または`T`のコピー代入演算子がO(1) +5. [`copyable`](/reference/concepts/copyable.md)``が`false`、または`T`のコピー代入は`T`のデストラクタとコピーコンストラクタを連続で実行する場合より複雑にならない `view`と[`borrowed_range`](borrowed_range.md)には直接の包含関係はないが、要素を所有していると一般にこれらの要件は満たせないため、[`borrowed_range`](borrowed_range.md)でもある場合が多い。 From 7ae71bb8a7e87f2373c9950a66d727a5675d841f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 10 Oct 2023 19:27:36 +0900 Subject: [PATCH 0502/3948] =?UTF-8?q?C++26=20:=20=E3=83=A9=E3=82=A4?= =?UTF-8?q?=E3=83=96=E3=83=A9=E3=83=AA=E6=9B=B4=E6=96=B0=E6=A6=82=E8=A6=81?= =?UTF-8?q?=E3=82=92=E4=B8=80=E9=83=A8=E8=BF=BD=E5=8A=A0=20#1166?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/lang/cpp26.md b/lang/cpp26.md index ffbf11ab75..f283d38283 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -46,4 +46,37 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 ## ライブラリ更新の概要 +### アルゴリズム +- 以下のアルゴリズムを`constexpr`に対応 + - [`std::stable_sort()`](/reference/algorithm/stable_sort.md) / [`std::ranges::stable_sort()`](/reference/algorithm/ranges_stable_sort.md) + - [`std::stable_partition()`](/reference/algorithm/stable_partition.md) / [`std::ranges::stable_partition()`](/reference/algorithm/ranges_stable_partition.md) + - [`std::inplace_merge()`](/reference/algorithm/inplace_merge.md) / [`std::ranges::stable_partition()`](/reference/algorithm/ranges_inplace_merge.md) + + +### 文字列 +- [``](/reference/charconv.md)の変換結果[`std::to_chars_result`](/reference/charconv/to_chars_result.md)と[`std::from_chars_result`](/reference/charconv/from_chars_result.md)に、変換が正しく完了したかを判定する`operator bool`を追加 +- [`std::to_string()`](/reference/string/to_string.md)の仕様が`std::sprintf()`で説明されていたが、[`std::format()`](/reference/format/format.md)で定義するよう仕様を変更 + + +### 日付・時間 +- [``](/reference/chrono.md)の以下のクラスに[`std::hash`](/reference/functional/hash.md)のサポートを追加 + - [`std::chrono::duration`](/reference/chrono/duration.md) + - [`std::chrono::time_point`](/reference/chrono/time_point.md) + - [`std::chrono::day`](/reference/chrono/day.md) + - [`std::chrono::month`](/reference/chrono/month.md) + - [`std::chrono::year`](/reference/chrono/year.md) + - [`std::chrono::weekday`](/reference/chrono/weekday.md) + - [`std::chrono::weekday_indexed`](/reference/chrono/weekday_indexed.md) + - [`std::chrono::weekday_last`](/reference/chrono/weekday_last.md) + - [`std::chrono::month_day`](/reference/chrono/month_day.md) + - [`std::chrono::month_day_last`](/reference/chrono/month_day_last.md) + - [`std::chrono::month_weekday`](/reference/chrono/month_weekday.md) + - [`std::chrono::month_weekday_last`](/reference/chrono/month_weekday_last.md) + - [`std::chrono::year_month`](/reference/chrono/year_month.md) + - [`std::chrono::year_month_day`](/reference/chrono/year_month_day.md) + - [`std::chrono::year_month_day_last`](/reference/chrono/year_month_day_last.md) + - [`std::chrono::year_month_weekday`](/reference/chrono/year_month_weekday.md) + - [`std::chrono::year_month_weekday_last`](/reference/chrono/year_month_weekday_last.md) + - [`std::chrono::zoned_time`](/reference/chrono/zoned_time.md) + - [`std::chrono::leap_second`](/reference/chrono/leap_second.md) From db656f46efdf12f6877e27170eadc50e18be3c31 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 12 Oct 2023 17:12:40 +0900 Subject: [PATCH 0503/3948] =?UTF-8?q?C++26=20:=20=E6=AE=8B=E3=82=8A?= =?UTF-8?q?=E3=81=AE=E3=83=A9=E3=82=A4=E3=83=96=E3=83=A9=E3=83=AA=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=A6=82=E8=A6=81=E3=82=92=E8=BF=BD=E5=8A=A0=20#1166?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 124 ++++++++++++++++++++++++++++++++++++++++++++++++++ reference.md | 3 ++ 2 files changed, 127 insertions(+) diff --git a/lang/cpp26.md b/lang/cpp26.md index f283d38283..21fe2c3be5 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -46,16 +46,73 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 ## ライブラリ更新の概要 +### 新ライブラリ +- 文字列エンコーディングを識別するライブラリとして、[``](/reference/text_encoding.md.nolink)を追加 +- 並行処理におけるデータの参照・更新を行うRCU (Read Copy Update) のライブラリとして、[``](/reference/rcu.md.nolink)を追加 +- 並行処理において参照中のデータが更新されないよう保護するハザードポインタのライブラリとして、[``](/reference/hazard_pointer.md.nolink)を追加 + + +### コンテナ +- [`std::mdspan`](/reference/mdspan/mdspan.md.nolink)のサブ配列版として[`std::submdspan`](/reference/mdspan/submdspan.md.nolink)を追加 +- 連想コンテナの以下のメンバ関数に、一時オブジェクトが生成されるコストを抑える拡張を追加 + - [`std::map`](/reference/map/map.md) + - [`operator[]`](/reference/map/map/op_at.md) + - [`at()`](/reference/map/map/at.md) + - [`try_emplace()`](/reference/map/map/try_emplace.md) + - [`insert_or_assign()`](/reference/map/map/insert_or_assign.md) + - [`std::set`](/reference/set/set.md) + - [`insert()`](/reference/set/set/insert.md) + - [`std::unordered_map`](/reference/unordered_map/unordered_map.md) + - [`operator[]`](/reference/unordered_map/unordered_map/op_at.md) + - [`at()`](/reference/unordered_map/unordered_map/at.md) + - [`try_emplace()`](/reference/unordered_map/unordered_map/try_emplace.md) + - [`insert_or_assign()`](/reference/unordered_map/unordered_map/insert_or_assign.md) + - [`bucket()`](/reference/unordered_map/unordered_map/bucket.md) + - [`std::unordered_multimap`](/reference/unordered_map/unordered_multimap.md) + - [`bucket()`](/reference/unordered_map/unordered_multimap/bucket.md) + - [`std::unordered_set`](/reference/unordered_set/unordered_set.md) + - [`insert()`](/reference/unordered_set/unordered_set/insert.md) + - [`bucket()`](/reference/unordered_set/unordered_set/bucket.md) + - [`std::unordered_multiset`](/reference/unordered_set/unordered_multiset.md) + - [`bucket()`](/reference/unordered_set/unordered_multiset/bucket.md) + + ### アルゴリズム - 以下のアルゴリズムを`constexpr`に対応 - [`std::stable_sort()`](/reference/algorithm/stable_sort.md) / [`std::ranges::stable_sort()`](/reference/algorithm/ranges_stable_sort.md) - [`std::stable_partition()`](/reference/algorithm/stable_partition.md) / [`std::ranges::stable_partition()`](/reference/algorithm/ranges_stable_partition.md) - [`std::inplace_merge()`](/reference/algorithm/inplace_merge.md) / [`std::ranges::stable_partition()`](/reference/algorithm/ranges_inplace_merge.md) +- Rangeアルゴリズムが完全型を要求しないようにするため、[`std::projected`](/reference/iterator/projected.md)の制約を緩和 + + +### 関数オブジェクト +- 所有権を保持しない[`std::function`](/reference/functional/function.md)として、[``](/reference/functional.md)に[`std::function_ref`](/reference/functional/function_ref.md.nolink)クラスを追加 +- [`std::move_only_function`](/reference/functional/move_only_function.md)のコピー可能版として、[``](/reference/functional.md)に[`std::copyable_function`](/reference/copyable_function.md.nolink)クラスを追加 +- [`std::bind_front()`](/reference/functional/bind_front.md)と[`std::bind_back()`](/reference/functional/bind_back.md.nolink)に、非型テンプレート引数として関数を指定するオーバーロードを追加 + - 関連して、非型テンプレート引数の関数オブジェクトを反転させられるよう、[`not_fn()`](/reference/functional/not_fn.md)に非型テンプレート引数版のオーバーロードを追加 ### 文字列 - [``](/reference/charconv.md)の変換結果[`std::to_chars_result`](/reference/charconv/to_chars_result.md)と[`std::from_chars_result`](/reference/charconv/from_chars_result.md)に、変換が正しく完了したかを判定する`operator bool`を追加 - [`std::to_string()`](/reference/string/to_string.md)の仕様が`std::sprintf()`で説明されていたが、[`std::format()`](/reference/format/format.md)で定義するよう仕様を変更 +- [`std::basic_istringstream`](/reference/sstream/basic_istringstream.md)および[`std::basic_ostringstream`](/reference/sstream/basic_ostringstream.md)のコンストラクタおよび`str()`メンバ関数に、[`std::basic_string_view`](/reference/string_view/basic_string_view.md)を受け取るオーバーロードを追加 +- [`std::format()`](/reference/format/format.md)に、ポインタ出力のサポートを追加 +- [`std::format()`](/reference/format/format.md)で幅と精度を動的に指定した場合でも型の検証がコンパイル時に行われるよう仕様を見直し + + +### ファイル +- ファイルのネイティブハンドルを取得できるよう、[`std::basic_filebuf`](/reference/fstream/basic_filebuf.md)、[`std::basic_ifstream`](/reference/fstream/basic_ifstream.md)、[`std::basic_ofstream`](/reference/fstream/basic_ofstream.md)、[`std::basic_fstream`](/reference/fstream/basic_fstream.md)クラスに、以下のメンバを追加 + - `native_handle_type`型 + - `native_handle()` + + +### 並行・並列処理 +- [`std::atomic`](/reference/atomic/atomic.md)オブジェクトに対する2つの値の最大値・最小値を取得する関数として、メンバ関数[`fetch_max()`](/reference/atomic/atomic/fetch_max.md.nolink)と[`fetch_min()`](/reference/atomic/atomic/fetch_min.md.nolink)、非メンバ関数として[`std::atomic_fetch_max`](/reference/atomic/atomic_fetch_max.md.nolink)、[`std::atomic_fetch_max_explicit`](/reference/atomic/atomic_fetch_max_explicit.md.nolink)、[`std::atomic_fetch_min`](/reference/atomic/atomic_fetch_min.md.nolink)、[`std::atomic_fetch_min_explicit`](/reference/atomic/atomic_fetch_min_explicit.md.nolink)を追加 + + +### スマートポインタ +- [`std::weak_ptr`](/reference/memory/weak_ptr.md)を非順序連想コンテナのキーとして使用できるよう、[``](/reference/memory.md)に所有権ベースのハッシュ値を取得する関数オブジェクト[`std::owner_hash`](/reference/memory/owner_hash.md.nolink)、および所有権ベースの等値比較を行う関数オブジェクト[`std::owner_equal`](/reference/memory/owner_equal.md.nolink)を追加 + - 関連して、[`std::shared_ptr`](/reference/memory/shared_ptr.md)クラスと[`std::weak_ptr`](/reference/memory/weak_ptr.md)クラスのメンバ関数として、`owner_hash()`と`owner_equal()`を追加 ### 日付・時間 @@ -80,3 +137,70 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [`std::chrono::zoned_time`](/reference/chrono/zoned_time.md) - [`std::chrono::leap_second`](/reference/chrono/leap_second.md) + +### 数学 +- [``](/reference/cmath.md)の以下の関数を、`constexpr`に対応 + - [`std::cos()`](/reference/cmath/cos.md) + - [`std::sin()`](/reference/cmath/sin.md) + - [`std::tan()`](/reference/cmath/tan.md) + - [`std::cosh()`](/reference/cmath/cosh.md) + - [`std::sinh()`](/reference/cmath/sinh.md) + - [`std::tanh()`](/reference/cmath/tanh.md) + - [`std::acos()`](/reference/cmath/acos.md) + - [`std::asin()`](/reference/cmath/asin.md) + - [`std::atan()`](/reference/cmath/atan.md) + - [`std::atan2()`](/reference/cmath/atan2.md) + - [`std::acosh()`](/reference/cmath/acosh.md) + - [`std::asinh()`](/reference/cmath/asinh.md) + - [`std::atanh()`](/reference/cmath/atanh.md) + - [`std::exp()`](/reference/cmath/exp.md) + - [`std::exp2()`](/reference/cmath/exp2.md) + - [`std::expm1()`](/reference/cmath/expm1.md) + - [`std::log()`](/reference/cmath/log.md) + - [`std::log10()`](/reference/cmath/log10.md) + - [`std::log1p()`](/reference/cmath/log1p.md) + - [`std::log2()`](/reference/cmath/log2.md) + - [`std::pow()`](/reference/cmath/pow.md) + - [`std::sqrt()`](/reference/cmath/sqrt.md) + - [`std::cbrt()`](/reference/cmath/cbrt.md) + - [`std::hypot()`](/reference/cmath/hypot.md) + - [`std::erf()`](/reference/cmath/erf.md) + - [`std::erfc()`](/reference/cmath/erfc.md) + - [`std::lgamma()`](/reference/cmath/lgamma.md) + - [`std::tgamma()`](/reference/cmath/tgamma.md) +- [``](/reference/complex.md)の以下の関数を、`constexpr`に対応 + - [`std::abs()`](/reference/complex/complex/abs.md) + - [`std::arg()`](/reference/complex/complex/arg.md) + - [`std::proj()`](/reference/complex/complex/proj.md) + - [`std::polar()`](/reference/complex/complex/polar.md) + - [`std::cos()`](/reference/complex/complex/cos.md) + - [`std::sin()`](/reference/complex/complex/sin.md) + - [`std::tan()`](/reference/complex/complex/tan.md) + - [`std::cosh()`](/reference/complex/complex/cosh.md) + - [`std::sinh()`](/reference/complex/complex/sinh.md) + - [`std::tanh()`](/reference/complex/complex/tanh.md) + - [`std::acos()`](/reference/complex/complex/acos.md) + - [`std::asin()`](/reference/complex/complex/asin.md) + - [`std::atan()`](/reference/complex/complex/atan.md) + - [`std::acosh()`](/reference/complex/complex/acosh.md) + - [`std::asinh()`](/reference/complex/complex/asinh.md) + - [`std::atanh()`](/reference/complex/complex/atanh.md) + - [`std::exp()`](/reference/complex/complex/exp.md) + - [`std::log()`](/reference/complex/complex/log.md) + - [`std::log10()`](/reference/complex/complex/log10.md) + - [`std::pow()`](/reference/complex/complex/pow.md) + - [`std::sqrt()`](/reference/complex/complex/sqrt.md) + +### ユーティリティ +- [`std::variant`](/reference/variant/variant.md)クラスに、メンバ関数版の[`visit()`](/reference/variant/variant/visit.md.nolink)を追加 +- [``](/reference/ratio.md)に、新たなSI接頭辞として、以下を追加 + - [`ronna`](/reference/ratio/si_prefix.md) (1027) + - [`ronto`](/reference/ratio/si_prefix.md) (10−27) + - [`quetta`](/reference/ratio/si_prefix.md) (1030) + - [`quecto`](/reference/ratio/si_prefix.md) (10−30) + + +### 型特性 +- 共用体のどのメンバがアクティブかを判定するための関数として、[``](/reference/type_traits.md)に[`std::is_within_lifetime()`](/reference/type_traits/is_within_lifetime.md.nolink)を追加 +- [`std::bitset`](/reference/bitset/bitset.md)に、[`std::basic_string_view`](/reference/string_view/basic_string_view.md)を受け取るコンストラクタを追加 + diff --git a/reference.md b/reference.md index 2a938a630a..7a1da26c9c 100644 --- a/reference.md +++ b/reference.md @@ -91,6 +91,7 @@ | ヘッダ | 説明 | 対応バージョン | |--------------------------------------|----------------------|----------------| | [``](/reference/locale.md) | ロケール | | +| [``](/reference/text_encoding.md.nolink) | 文字列エンコーディングの識別 | C++26 | | [``](/reference/codecvt.md) | コード変換ファセット | C++11
C++17から非推奨 | @@ -196,6 +197,8 @@ | [``](/reference/latch.md) | ラッチ同期 | C++20 | | [``](/reference/barrier.md) | バリア同期 | C++20 | | [``](/reference/future.md) | Future | C++11 | +| [``](/reference/rcu.md.nolink) | データの参照・更新 | C++26 | +| [``](/reference/hazard_pointer.md.nolink) | ハザードポインタ | C++26 | ## C言語互換ライブラリ From bd9f4a42d0497ec4d0348017e7740b5daecae870 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 13 Oct 2023 15:18:58 +0900 Subject: [PATCH 0504/3948] =?UTF-8?q?=E3=83=88=E3=83=83=E3=83=97=E3=83=9A?= =?UTF-8?q?=E3=83=BC=E3=82=B8=20:=20=E5=95=8F=E3=81=84=E5=90=88=E3=82=8F?= =?UTF-8?q?=E3=81=9B=E7=AA=93=E5=8F=A3=E3=81=AEGoogle=20Group=E3=81=A8?= =?UTF-8?q?=E9=8A=80=E8=A1=8C=E6=8C=AF=E8=BE=BC=E3=81=AB=E3=81=A4=E3=81=84?= =?UTF-8?q?=E3=81=A6=E8=A8=98=E8=BC=89=20#1116?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/index.md b/index.md index 7e2bb1d380..959b811735 100644 --- a/index.md +++ b/index.md @@ -21,6 +21,14 @@ ご支援いただくユーザーの方々は、本ページ (cpprefjpサイトのトップページ) に、金額順でロゴを表示させていただきます (金額が同じ場合は登録順)。ご支援いただいた資金は、貢献度に応じてコントリビューターに分配させていただきます。 +また、スポンサーシップの入金方法として、Open Collectiveのほかに銀行振込も対応しております。 + +銀行振込に関して、またはそれ以外でスポンサーシップの相談に関しては、以下のメールアドレスにお問い合わせください。 + +- メールアドレス : +- 宛名 : cpprefjp管理者 + - 代表として、主に高橋晶 (Akira Takahashi) がご対応させていただきます + ## 参加方法 本サイトは、多くのユーザの手によって書かれています。 From 1174ad40b2b765d3d2c1d8e76f6b1dee624ce2be Mon Sep 17 00:00:00 2001 From: suomesta Date: Sat, 14 Oct 2023 15:53:03 +0900 Subject: [PATCH 0505/3948] small improvemenmts in samples --- reference/chrono/time_point/op_constructor.md | 2 +- reference/type_traits/void_t.md | 2 +- reference/typeinfo/type_info/op_not_equal.md | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/chrono/time_point/op_constructor.md b/reference/chrono/time_point/op_constructor.md index 30809652e2..cc64e24ab4 100644 --- a/reference/chrono/time_point/op_constructor.md +++ b/reference/chrono/time_point/op_constructor.md @@ -53,7 +53,7 @@ int main() * time_since_epoch()[link time_since_epoch.md] * count()[link /reference/chrono/duration/count.md] -### 出力 +### 出力例 ``` 0 3000000 diff --git a/reference/type_traits/void_t.md b/reference/type_traits/void_t.md index 4797420739..284bb45673 100644 --- a/reference/type_traits/void_t.md +++ b/reference/type_traits/void_t.md @@ -78,7 +78,7 @@ int main() std::cout << is_equality_comparable::value << std::endl; } ``` -* std::void[color ff0000] +* std::void_t[color ff0000] * std::declval[link /reference/utility/declval.md] ### 出力 diff --git a/reference/typeinfo/type_info/op_not_equal.md b/reference/typeinfo/type_info/op_not_equal.md index 4f5b6435f8..8369925ea3 100644 --- a/reference/typeinfo/type_info/op_not_equal.md +++ b/reference/typeinfo/type_info/op_not_equal.md @@ -34,13 +34,13 @@ int main() const std::type_info& b = typeid(3); std::cout << std::boolalpha; - std::cout << "difference type? " << (a != b) << std::endl; + std::cout << "different type? " << (a != b) << std::endl; } ``` ### 出力 ``` -difference type? false +different type? false ``` ## 参照 From 0ee0833cda17c6b8510840c3f41cc0691cf6212b Mon Sep 17 00:00:00 2001 From: suomesta Date: Sat, 14 Oct 2023 15:59:12 +0900 Subject: [PATCH 0506/3948] fix some typo regarding std::string --- reference/string/basic_string/op_equal.md | 4 ++-- reference/string/basic_string/op_greater.md | 4 ++-- reference/string/basic_string/op_greater_equal.md | 4 ++-- reference/string/basic_string/op_less.md | 4 ++-- reference/string/basic_string/op_less_equal.md | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/reference/string/basic_string/op_equal.md b/reference/string/basic_string/op_equal.md index e9477fc487..71ffd0d111 100644 --- a/reference/string/basic_string/op_equal.md +++ b/reference/string/basic_string/op_equal.md @@ -52,8 +52,8 @@ namespace std { ## 戻り値 - (1) `a.`[`compare`](compare.md)`(b) == 0` -- (3) `a.`[`compare`](compare.md)`(b) == 0` -- (2) `b == a` +- (2) `a.`[`compare`](compare.md)`(b) == 0` +- (3) `b == a` ## 備考 diff --git a/reference/string/basic_string/op_greater.md b/reference/string/basic_string/op_greater.md index 1ff75a20ab..46301e944c 100644 --- a/reference/string/basic_string/op_greater.md +++ b/reference/string/basic_string/op_greater.md @@ -31,11 +31,11 @@ namespace std { template bool operator>(const basic_string& a, - const CharT* rhs); // (3) C++03 + const CharT* b); // (3) C++03 template constexpr bool operator>(const basic_string& a, - const CharT* rhs); // (3) C++20 + const CharT* b); // (3) C++20 } ``` diff --git a/reference/string/basic_string/op_greater_equal.md b/reference/string/basic_string/op_greater_equal.md index 0ecd461d33..2ba84b7b44 100644 --- a/reference/string/basic_string/op_greater_equal.md +++ b/reference/string/basic_string/op_greater_equal.md @@ -31,11 +31,11 @@ namespace std { template bool operator>=(const basic_string& a, - const CharT* rhs); // (3) C++03 + const CharT* b); // (3) C++03 template constexpr bool operator>=(const basic_string& a, - const CharT* rhs); // (3) C++20 + const CharT* b); // (3) C++20 } ``` diff --git a/reference/string/basic_string/op_less.md b/reference/string/basic_string/op_less.md index 5d7438d1c8..9c817c67dc 100644 --- a/reference/string/basic_string/op_less.md +++ b/reference/string/basic_string/op_less.md @@ -31,11 +31,11 @@ namespace std { template bool operator<(const basic_string& a, - const CharT* rhs); // (3) C++03 + const CharT* b); // (3) C++03 template constexpr bool operator<(const basic_string& a, - const CharT* rhs); // (3) C++20 + const CharT* b); // (3) C++20 } ``` diff --git a/reference/string/basic_string/op_less_equal.md b/reference/string/basic_string/op_less_equal.md index 29a7962b59..2266d12ac5 100644 --- a/reference/string/basic_string/op_less_equal.md +++ b/reference/string/basic_string/op_less_equal.md @@ -31,11 +31,11 @@ namespace std { template bool operator<=(const basic_string& a, - const CharT* rhs); // (3) C++03 + const CharT* b); // (3) C++03 template constexpr bool operator<=(const basic_string& a, - const CharT* rhs); // (3) C++20 + const CharT* b); // (3) C++20 } ``` From 6e62fb11896097dd937e50dadfbb80b72e5522ff Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 19 Oct 2023 09:42:36 +0900 Subject: [PATCH 0507/3948] =?UTF-8?q?ranges:=20from=5Frange=E3=82=BF?= =?UTF-8?q?=E3=82=B0=20(#1069)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/range_formatter/format.md | 4 +- reference/ranges.md | 3 ++ reference/ranges/from_range_t.md | 63 ++++++++++++++++++++++ 3 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 reference/ranges/from_range_t.md diff --git a/reference/format/range_formatter/format.md b/reference/format/range_formatter/format.md index 8cebaf5e12..bb48a62254 100644 --- a/reference/format/range_formatter/format.md +++ b/reference/format/range_formatter/format.md @@ -22,8 +22,8 @@ typename FormatContext::iterator ## 効果 - [`parse()`](parse.md)メンバ関数で解析した書式文字列の指定に基づいて、`r`の値を文字列に変換し、以下を[`ctx.out()`](/reference/format/basic_format_context/out.md)に出力する: - - Range書式として[`s` (文字列として出力)](/reference/format/format.md#range-format-options)が指定された場合、[`basic_string`](/reference/string/basic_string.md)`(`[`from_range`](/reference/ranges/from_range_t.md.nolink)`, r)`を出力する - - そうでなく、Range書式として[`?s` (デバッグ文字列として出力)](/reference/format/format.md#range-format-options)が指定された場合、[`basic_string`](/reference/string/basic_string.md)`(`[`from_range`](/reference/ranges/from_range_t.md.nolink)`, r)`に引用符を付け、エスケープシーケンスをエスケープして出力する + - Range書式として[`s` (文字列として出力)](/reference/format/format.md#range-format-options)が指定された場合、[`basic_string`](/reference/string/basic_string.md)`(`[`from_range`](/reference/ranges/from_range_t.md)`, r)`を出力する + - そうでなく、Range書式として[`?s` (デバッグ文字列として出力)](/reference/format/format.md#range-format-options)が指定された場合、[`basic_string`](/reference/string/basic_string.md)`(`[`from_range`](/reference/ranges/from_range_t.md)`, r)`に引用符を付け、エスケープシーケンスをエスケープして出力する - そうでなければ、 - 開きカッコを出力する - Range `r`の各要素`e`について、 diff --git a/reference/ranges.md b/reference/ranges.md index 41b8b7b190..37cae27000 100644 --- a/reference/ranges.md +++ b/reference/ranges.md @@ -404,6 +404,9 @@ range | adaptor(args...) | 名前 | 説明 | 対応バージョン | |----------------------|----------------------------------------------------------------|----------------| | [`to`](ranges/to.md.nolink) | パイプライン記法でRangeからコンテナを構築する (class template) | C++23 | +| [`from_range_t`](ranges/from_range_t.md) | Rangeからコンテナへの変換を示すタグ型 (class) | C++23 | +| [`from_range`](ranges/from_range_t.md) | Rangeからコンテナへの変換を示すタグ値 (variable) | C++23 | + ## 実装例 - [libstdc++](https://github.com/gcc-mirror/gcc/blob/master/libstdc%2B%2B-v3/include/std/ranges) diff --git a/reference/ranges/from_range_t.md b/reference/ranges/from_range_t.md new file mode 100644 index 0000000000..d03dea2152 --- /dev/null +++ b/reference/ranges/from_range_t.md @@ -0,0 +1,63 @@ +# from_range_t +* utility[meta header] +* std[meta namespace] +* class[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + struct from_range_t { explicit from_range_t() = default; }; + + inline constexpr from_range_t from_range{}; +} +``` + +## 概要 +`from_range_t`クラスは、オーバーロードのための空クラスである。 + +標準ライブラリのコンテナ初期化において、Rangeからコンテナを構築するオーバーロードを定義するためにある。 + + +## 例 +```cpp example +#include +#include +#include +#include + +int main() +{ + std::vector vec{1, 2, 3}; + std::list lst{std::from_range, vec}; + for (int n: lst) { + std::cout << n << std::endl; + } +} +``` +* std::from_range[color ff0000] + +### 出力 +``` +1 +2 +3 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`container-compatible-range`](/reference/exposition-only/container-compatible-range.md)コンセプト + + +## 参照 +- [P1206R7 Conversions from ranges to containers](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1206r7.pdf) From 5ad48c7f23557d030b8b9e88439b74c41611bd80 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 19 Oct 2023 14:57:45 +0900 Subject: [PATCH 0508/3948] =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=83=91=E3=82=A4?= =?UTF-8?q?=E3=83=A9=E3=81=AE=E5=AE=9F=E8=A3=85=E7=8A=B6=E6=B3=81=20:=20C+?= =?UTF-8?q?+26=E3=82=92=E8=BF=BD=E5=8A=A0=20#1166?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/implementation-status.md b/implementation-status.md index b1495483f3..b20cda55c3 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -8,6 +8,7 @@ - [C++17](#cpp17) - [C++20](#cpp20) - [C++23](#cpp23) +- [C++26](#cpp26) ## C++11言語機能の実装状況 @@ -290,6 +291,28 @@ - [次リリース情報(VS2019,2022) - Change log](https://github.com/microsoft/STL/wiki/Changelog) - ICX: [C++23 Features Supported by Intel® C++ Compiler](https://www.intel.com/content/www/us/en/developer/articles/technical/c23-features-supported-by-intel-c-compiler.html) + +## C++26言語機能の実装状況 + +| 言語機能 | 説明 | [GCC][gcc] | [Clang][clang] | [ICX][icx] | [MSVC][msvc] | +|----------|------|------------|----------------|------------|--------------| +| P2752R3: [`std::initializer_list`の配列を静的ストレージに配置する](/lang/cpp26/static_storage_for_braced_initializers.md.nolink) | `std::vector v = {1, 2, 3};`のような初期化で初期化子リストを静的ストレージに配置することで無駄なコピーをなくす | 14 | | | | +| P2169R4: [宣言のみで使用しない変数の名前として`_`をサポート](/lang/cpp26/nice_placeholder_with_no_name.md.nolink) | 変数名`_`は暗黙で`[[maybe_unused]]`が指定される | | 18 | | | +| P1854R4: [文字列リテラルの文字エンコーディング失敗を不適格とする](/lang/cpp26/making_non-encodable_string_literals_ill-formed.md.nolink) | 文字列リテラルのエンコーディング時に文字表現が失われる場合にコンパイルエラーにする | | 14 | | | +| P2361R6: [コンパイル時にのみ使用される文字列の扱いを明確化](/lang/cpp26/unevaluated_strings.md.nolink) | `static_assert`や`[[deprecated]]`などで使用されるコンパイル時の文字列について、文字コードの指定を禁止し、実行時エンコーディングが行われないことを規定 | | 18 | | | +| P2552R3: [属性の無視性を見直し](/lang/cpp26/on_the_ignorability_of_standard_attributes.md.nolink) | 構文として適格な属性のみを無視できるようにし、そうでない属性の使用を不適格とする | | | | | +| P2738R1: [定数式での`void*`からポインタ型へのキャストを許可](/lang/cpp26/constexpr_cast_from_voidptr.md.nolink) | 型消去のために`void*`からポインタ型へのキャストを許可する | | 14 | 17 | | +| P2741R3: [`static_assert`の診断メッセージにユーザーが生成した文字列の指定を許可](/lang/cpp26/user-generated_static_assert_messages.md.nolink) | `constexpr`な`S.size()`と`S.data()`メンバ関数をもつオブジェクトをコンパイル時文字列として指定できるようにする | | | | | +| P2558R2: [基本文字集合に@、$、\`を追加](/lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md.nolink) | C言語との互換性のためにこれらの文字を基本文字集合に追加 | | Yes | | | + +各処理系のC++26実装状況ページ: + +- GCC: [C++26 Support in GCC](https://gcc.gnu.org/projects/cxx-status.html#cxx26) +- Clang: [C++2c implementation status](https://clang.llvm.org/cxx_status.html#cxx26) +- Visual C++ (MSVC): + - [Change log](https://github.com/microsoft/STL/wiki/Changelog) + + [gcc]: ./implementation.md#gcc [clang]: ./implementation.md#clang [icc]: ./implementation.md#icc From 8d4359938373b6a481ddeb171825ec0127682158 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 19 Oct 2023 16:07:39 +0900 Subject: [PATCH 0509/3948] =?UTF-8?q?=E8=B2=A2=E7=8C=AE=E3=83=9D=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=83=88=E3=81=A8=E5=88=86=E9=85=8D=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6=E3=81=BE=E3=81=A8=E3=82=81?= =?UTF-8?q?=E3=81=9F=20#1116?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start_editing.md | 61 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/start_editing.md b/start_editing.md index c3e0f467fe..604b0a6e10 100644 --- a/start_editing.md +++ b/start_editing.md @@ -262,3 +262,64 @@ C++の次のバージョンで入ることが決まった機能については これらはタスクissueにもできていませんが、手が足りず作業できていません。 + +## 貢献ポイント +cpprefjpおよびboostjpでの作業は、以下のように貢献ポイントを割り振った上で、年間の貢献 (12月から翌年11月) を集計して収益をコントリビューターの方々に分配します。 + +分配の手順は以下のようになります: + +1. コアメンバーが集計用のPull Requestを立てる +2. コントリビューターの方々からの追加・修正の指摘を募集する +3. 各コントリビューターの年間貢献ポイントと分配率を仮決定 +4. 貢献ポイントの追加・修正指摘、および分配の受け入れ、または辞退の申し出を受け付ける (1週間程度) + - 期間内に分配の受け入れ申し出がない場合は、貢献ポイントを次年繰り越す (前年まで保持) +5. 辞退者を除いて分配率を決定する +6. 入金先の情報をコアメンバー宛に伝える (Googleフォームを用意する予定) + +お金での分配を辞退された方にも、ステッカーの配布などでお返しができればと考えています。 + + +### cpprefjp + +| タグ | ポイント | 説明 | +|-----|---------|------| +| cpprefjp/typo | 1 | 誤字・脱字の修正 (ページ単位) | +| cpprefjp/link | 2 | 関連項目・参照リンクなどの追加 (ページ単位) | +| cpprefjp/addref | 20 | リファレンスを1ページ追加 | +| cpprefjp/addlang | 20 | 言語機能を1ページ追加 | +| cpprefjp/fixs | 2 | 既存ページへの修正 : small 軽微な修正 (ページ単位) | +| cpprefjp/fixm | 5 | 既存ページへの修正 : medium 追加説明、サンプルコード追加 (ページ単位) | +| cpprefjp/fixl | 10 | 既存ページへの修正 : large 仕様変更への対応 (ページ単位) | +| cpprefjp/compiler | 2 | 動作確認できたコンパイラバージョンの記載 (ページ単位) | + +### boostjp + +| タグ | ポイント | 説明 | +|-----|---------|------| +| boostjp/typo | 1 | 誤字・脱字の修正 (ページ単位 | +| boostjp/releases | 2 | Boostリリースノート1件追加 small : maintenance workなどの小さなリリースノート | +| boostjp/releasem | 5 | Boostリリースノートページを準備 | +| boostjp/releasem | 10 | Boostリリースノート 1件追加 medium : 10行以下の中程度の大きさ | +| boostjp/releasel | 20 | Boostリリースノート 1件追加 large : mediumを超える大きさ | +| boostjp/addrefs | 10 | Boost逆引きリファレンス : small (1例追加) | +| boostjp/addrefm | 20 | Boost逆引きリファレンス : medium (標準C++のバージョンアップ対応1例単位、Boostのバージョンアップ対応1例単位) | +| boostjp/boosts | 5 | Boostへの貢献 small (typoの修正など) | + +### ツール類 + +CIスクリプト、site_generator、kunaiなど。 + +| タグ | ポイント | 説明 | +|-----|---------|------| +| tool/fixbug | 30 | バグ修正 | +| tool/improves | 10 | コード改善 : small | +| tool/improvem | 30 | コード改善 : medium | +| tool/improvem | 50 | コード改善 : large | +| tool/updatelib | 20 | 依存ライブラリのアップデート (直接使用のライブラリ単位) | +| tool/updatelang | 10 | 使用言語のアップデート : small (とくにコード変更なく更新できた) | +| tool/updatelang | 30 | 使用言語のアップデート : medium (多少のコード修正で更新できた) | +| tool/updatelang | 50 | 使用言語のアップデート : large (大きいまたはむずかしいコード修正をして更新できた) | +| tool/adds | 30 | 新たな仕組みの導入 small : (C++バージョン追加、カテゴリ追加など) | +| tool/addm | 50 | 新たな仕組みの導入 medium | +| tool/addl | 100〜 | 新たな仕組みの導入 large : キーワード自動リンク、相対リンク対応など | + From bf038286f8ff72920a7765766c3cc74740d86588 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 19 Oct 2023 17:30:40 +0900 Subject: [PATCH 0510/3948] =?UTF-8?q?any=20:=20=E3=82=AF=E3=83=A9=E3=82=B9?= =?UTF-8?q?=E3=83=9A=E3=83=BC=E3=82=B8=E3=81=AB=E5=9E=8B=E3=81=AE=E8=A6=81?= =?UTF-8?q?=E4=BB=B6=E3=82=92=E8=A8=98=E8=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/any/any.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/reference/any/any.md b/reference/any/any.md index 07afab0970..e4df296e1a 100644 --- a/reference/any/any.md +++ b/reference/any/any.md @@ -11,7 +11,7 @@ namespace std { ``` ## 概要 -`any`クラスは、あらゆる型の値を保持できる記憶域型である。保持する値と型は動的に切り替えることができる。 +`any`クラスは、コピー可能なあらゆる型の値を保持できる記憶域型である。保持する値と型は動的に切り替えることができる。 ```cpp std::any x = 3; // int型の値3で初期化 @@ -35,6 +35,10 @@ assert(s == "Hello"); - イベントの種類ごとに異なるイベント変数 (`function`と`function`) を用意するかまとめて扱うかで設計選択があるが、そこで`any`を使用するという選択肢がありうる +## 要件 +- 代入する型はコピー構築可能であること + + ## 備考 - 実装は、小さなオブジェクトを保持するためには動的メモリ確保を回避するべきである。そのようなsmall-object optimizationは、代入される型`T`が[`std::is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)` == true`の場合にのみ適用されること From 13004010008e80b9e91f3584b0e14614096036c1 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 19 Oct 2023 17:38:45 +0900 Subject: [PATCH 0511/3948] =?UTF-8?q?multiset,=20multimap=E3=81=AEerase=20?= =?UTF-8?q?:=20=E5=90=8C=E3=81=98=E3=82=AD=E3=83=BC=E3=82=92=E6=8C=81?= =?UTF-8?q?=E3=81=A4=E8=A6=81=E7=B4=A0=E6=95=B0=E3=82=92=E8=A8=88=E7=AE=97?= =?UTF-8?q?=E9=87=8F=E3=81=AB=E5=85=A5=E3=82=8C=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 規格上でも log(a.size()) + a.count(k) と規定されている --- reference/map/multimap/erase.md | 2 +- reference/set/multiset/erase.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/map/multimap/erase.md b/reference/map/multimap/erase.md index c67b298f1a..ce35b4a174 100644 --- a/reference/map/multimap/erase.md +++ b/reference/map/multimap/erase.md @@ -50,7 +50,7 @@ iterator erase(const_iterator first, const_iterator last); // (5) C++11 ## 計算量 - (1), (2) : 定数時間 -- (3), (4) : コンテナの [`size()`](size.md) について対数時間 +- (3), (4) : コンテナの [`size()`](size.md) について対数時間に加えて、[`count`](count.md)`(x)`について線形時間 - (5) : コンテナの [`size()`](size.md) について対数時間、それに加えて `first` と `last` の間の距離に対する線形時間 diff --git a/reference/set/multiset/erase.md b/reference/set/multiset/erase.md index e17f80d9c5..f31a7564f3 100644 --- a/reference/set/multiset/erase.md +++ b/reference/set/multiset/erase.md @@ -50,7 +50,7 @@ iterator erase(const_iterator first, const_iterator last); // (5) C++11 ## 計算量 - (1), (2) : 定数時間 -- (3), (4) : コンテナの [`size()`](size.md) について対数時間 +- (3), (4) : コンテナの [`size()`](size.md) について対数時間に加えて、[`count`](count.md)`(x)`について線形時間 - (5) : コンテナの [`size()`](size.md) について対数時間、それに加えて `first` と `last` の間の距離に対する線形時間 From 4f5d507d4e9830fee411f6f621b25ba1fc70cdb3 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 19 Oct 2023 20:07:41 +0900 Subject: [PATCH 0512/3948] =?UTF-8?q?from=5Frange=5Ft=20:=20=E6=89=80?= =?UTF-8?q?=E5=B1=9E=E3=83=98=E3=83=83=E3=83=80=E3=81=8C=E9=96=93=E9=81=95?= =?UTF-8?q?=E3=81=A3=E3=81=A6=E3=81=84=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/from_range_t.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/ranges/from_range_t.md b/reference/ranges/from_range_t.md index d03dea2152..fd207775bb 100644 --- a/reference/ranges/from_range_t.md +++ b/reference/ranges/from_range_t.md @@ -1,5 +1,5 @@ # from_range_t -* utility[meta header] +* ranges[meta header] * std[meta namespace] * class[meta id-type] * cpp23[meta cpp] From 8916ccbfcfaa9500e668b826335fa483e77d1151 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 19 Oct 2023 22:31:26 +0900 Subject: [PATCH 0513/3948] =?UTF-8?q?NG=E3=83=AF=E3=83=BC=E3=83=89?= =?UTF-8?q?=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF=20:=20=E4=B8=8D=E8=A6=81?= =?UTF-8?q?=E3=81=AA=E5=A4=89=E6=95=B0=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/script/ngword_check.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/script/ngword_check.py b/.github/workflows/script/ngword_check.py index 7eedfece7b..4393cc2f9c 100644 --- a/.github/workflows/script/ngword_check.py +++ b/.github/workflows/script/ngword_check.py @@ -41,9 +41,6 @@ def check_ngword(text: str, filename: str) -> bool: return not found_error if __name__ == '__main__': - found_error = False - current_dir = os.getcwd() - outer_link_dict = dict() found_error = False for p in sorted(list(glob.glob("**/*.md", recursive=True))): with open(p) as f: From d73d6be0b8b2381f19ce1ae66b0ae531fd77edca Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 19 Oct 2023 22:59:42 +0900 Subject: [PATCH 0514/3948] =?UTF-8?q?=E6=89=80=E5=B1=9E=E3=83=98=E3=83=83?= =?UTF-8?q?=E3=83=80=E3=81=AE=E6=8C=87=E5=AE=9A=E3=83=9F=E3=82=B9=E3=82=92?= =?UTF-8?q?=E6=A4=9C=E5=87=BA=E3=81=99=E3=82=8BCI=E3=82=BF=E3=82=B9?= =?UTF-8?q?=E3=82=AF=E3=82=92=E8=BF=BD=E5=8A=A0=20#1203?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/meta_header_check.yml | 19 +++++++ .github/workflows/script/meta_header_check.py | 54 +++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 .github/workflows/meta_header_check.yml create mode 100644 .github/workflows/script/meta_header_check.py diff --git a/.github/workflows/meta_header_check.yml b/.github/workflows/meta_header_check.yml new file mode 100644 index 0000000000..dbbd8b1fe5 --- /dev/null +++ b/.github/workflows/meta_header_check.yml @@ -0,0 +1,19 @@ +name: meta header check + +on: [push, pull_request, workflow_dispatch] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install requests + - uses: actions/checkout@v2 + - name: check + run: python3 .github/workflows/script/meta_header_check.py diff --git a/.github/workflows/script/meta_header_check.py b/.github/workflows/script/meta_header_check.py new file mode 100644 index 0000000000..cb9f746393 --- /dev/null +++ b/.github/workflows/script/meta_header_check.py @@ -0,0 +1,54 @@ +import glob +import os +import sys +import re + +def find_header_or_module(line: str) -> (re.Match, str): + m = re.fullmatch(r'[\*-] (.*?)\[meta header\]', line, re.MULTILINE) + if m: + return m, "header" + + m = re.fullmatch(r'[\*-] (.*?)\[meta module\]', line, re.MULTILINE) + if m: + return m, "module" + return None, "" + +def check_header(text: str, filename: str) -> bool: + found_error: bool = False + + for line in text.split("\n"): + m, header = find_header_or_module(line) + if m: + dirs = filename.split("/") + meta_header = m.group(1) + if len(dirs) < 2: + found_error = True + print("[{}] invalid directory: {}".format(filename, meta_header)) + elif len(dirs) == 2 and dirs[0] in ("reference", "module"): + own_filename = os.path.splitext(os.path.basename(filename))[0] + if meta_header != own_filename: + found_error = True + print("[{0}] invalid meta {1} \"{2}\". You should specify \"{3}\" as meta {1}".format( + filename, header, meta_header, own_filename)) + elif len(dirs) > 2 and dirs[0] in ("reference", "module"): + own_header = dirs[1] + if meta_header != own_header: + found_error = True + print("[{0}] invalid meta {1} \"{2}\". You should specify \"{3}\" as meta {1}".format( + filename, header, meta_header, own_header)) + + break + + return not found_error + +if __name__ == '__main__': + found_error = False + for p in sorted(list(glob.glob("**/*.md", recursive=True))): + with open(p) as f: + text = f.read() + + if not check_header(text, p): + found_error = True + + if found_error: + sys.exit(1) From 1b2e850c3d3eab21e2aeb35bc54f7708a7ef3ffe Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 19 Oct 2023 23:07:59 +0900 Subject: [PATCH 0515/3948] =?UTF-8?q?README=20:=20meta=20header=20check?= =?UTF-8?q?=E3=81=AECI=E3=83=90=E3=83=83=E3=82=B8=E3=82=92=E8=A1=A8?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 77a3df8f45..b9534c0fcf 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ site [![inner link check](https://github.com/cpprefjp/site/workflows/inner%20link%20check/badge.svg)](https://github.com/cpprefjp/site/actions/workflows/inner_link_check.yml) [![code qualify check](https://github.com/cpprefjp/site/workflows/code%20qualify%20check/badge.svg)](https://github.com/cpprefjp/site/actions/workflows/code_qualify_check.yml) [![ngword check](https://github.com/cpprefjp/site/workflows/ngword%20check/badge.svg)](https://github.com/cpprefjp/site/actions/workflows/ngword_check.yml) +[![meta header check](https://github.com/cpprefjp/site/workflows/meta%20header%20check/badge.svg)](https://github.com/cpprefjp/site/actions/workflows/meta_header_check.yml) [![outer link check](https://github.com/cpprefjp/site/workflows/outer%20link%20check/badge.svg)](https://github.com/cpprefjp/site/actions/workflows/outer_link_check.yml) [![build](https://github.com/cpprefjp/site/workflows/build/badge.svg)](https://github.com/cpprefjp/site/actions/workflows/build.yml) From 2873c6f3ce31b51a2c42f50a932ee09a005cc7c5 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 20 Oct 2023 00:12:17 +0900 Subject: [PATCH 0516/3948] =?UTF-8?q?LWG2510=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/mutex/adopt_lock.md | 5 ++--- reference/mutex/defer_lock.md | 5 ++--- reference/mutex/try_to_lock.md | 5 ++--- reference/new/nothrow_t.md | 5 ++++- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/reference/mutex/adopt_lock.md b/reference/mutex/adopt_lock.md index 98a0e30cc0..8ed862e4b7 100644 --- a/reference/mutex/adopt_lock.md +++ b/reference/mutex/adopt_lock.md @@ -6,7 +6,7 @@ ```cpp namespace std { - struct adopt_lock_t { }; + struct adopt_lock_t { explicit adopt_lock_t() = default; }; constexpr adopt_lock_t adopt_lock { }; // C++11 inline constexpr adopt_lock_t adopt_lock { }; // C++17 } @@ -58,5 +58,4 @@ int main() ## 参照 - - +- [LWG Issue 2510. Tag types should not be `DefaultConstructible`](https://cplusplus.github.io/LWG/issue2510) diff --git a/reference/mutex/defer_lock.md b/reference/mutex/defer_lock.md index f602e1b36e..9a543c671a 100644 --- a/reference/mutex/defer_lock.md +++ b/reference/mutex/defer_lock.md @@ -6,7 +6,7 @@ ```cpp namespace std { - struct defer_lock_t { }; + struct defer_lock_t { explicit defer_lock_t() = default; }; constexpr defer_lock_t defer_lock { }; // C++11 inline constexpr defer_lock_t defer_lock { }; // C++17 } @@ -56,5 +56,4 @@ int main() ## 参照 - - +- [LWG Issue 2510. Tag types should not be `DefaultConstructible`](https://cplusplus.github.io/LWG/issue2510 diff --git a/reference/mutex/try_to_lock.md b/reference/mutex/try_to_lock.md index 9ac9aae7c3..bebb717a29 100644 --- a/reference/mutex/try_to_lock.md +++ b/reference/mutex/try_to_lock.md @@ -6,7 +6,7 @@ ```cpp namespace std { - struct try_to_lock_t { }; + struct try_to_lock_t { explicit try_to_lock_t() = default; }; constexpr try_to_lock_t try_to_lock { }; // C++11 inline constexpr try_to_lock_t try_to_lock { }; // C++17 } @@ -62,5 +62,4 @@ int main() ## 参照 - - +- [LWG Issue 2510. Tag types should not be `DefaultConstructible`](https://cplusplus.github.io/LWG/issue2510 diff --git a/reference/new/nothrow_t.md b/reference/new/nothrow_t.md index 768dbe0634..12ed75df61 100644 --- a/reference/new/nothrow_t.md +++ b/reference/new/nothrow_t.md @@ -5,7 +5,7 @@ ```cpp namespace std { - struct nothrow_t {}; + struct nothrow_t { explicit nothrow_t() = default; }; extern const nothrow_t nothrow; } ``` @@ -55,3 +55,6 @@ int main() ``` logic_error: ThrowObj::ThrowObj() ``` + +## 参照 +- [LWG Issue 2510. Tag types should not be `DefaultConstructible`](https://cplusplus.github.io/LWG/issue2510) From f5119aed607afe31d105286502ccfce060a13e4a Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 25 Oct 2023 12:56:40 +0900 Subject: [PATCH 0517/3948] =?UTF-8?q?=E5=9B=BD=E9=9A=9B=E6=A8=99=E6=BA=96?= =?UTF-8?q?=E8=A6=8F=E6=A0=BC=20:=20Working=20Draft=E3=82=92=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=20#1205?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- international-standard.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/international-standard.md b/international-standard.md index c614d20752..e824a3083a 100644 --- a/international-standard.md +++ b/international-standard.md @@ -12,7 +12,7 @@ C++ の標準規格は、他にも各国の規格化団体によって国際標 | 通称†1 | 名称 | 参照する規格案†2 | 規格案・原案 | `__cplusplus` | |:--|:--|:--|:--|:--| -| [C++26](lang/cpp26.md) (C++2c) | ISO/IEC 14882:2026 (予定) | N4958([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4958.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/)) | N4958 | -- | +| [C++26](lang/cpp26.md) (C++2c) | ISO/IEC 14882:2026 (予定) | N4964([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4964.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/)) | N4964 N4958 | -- | | [C++23](lang/cpp23.md) (C++2b) | ISO/IEC 14882:2023 (予定) | N4950([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4950.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/)) | N4950 N4944 N4928 N4917 N4910 N4901 N4892 N4885 N4878
N4868 N4861 | -- | | [C++20](lang/cpp20.md) (C++2a) | ISO/IEC 14882:2020 | N4861†3([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/n4861.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4861/)) | N4860 N4849 N4842 N4835 N4830
N4820 N4810 N4800 N4791 N4788†4
N4778 N4762 N4750 N4741 N4727
N4713 N4700 N4687 | `202002L` | | [C++17](lang/cpp17.md) (C++1z) | ISO/IEC 14882:2017 | N4659([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4659.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4659/)) | N4660 N4659 N4640 N4618 N4606
N4594 N4582 N4567 N4527 N4431
N4296 | `201703L` | From 3b8a4156369a6cb647a2c3fe17fee4d7a2e06332 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 25 Oct 2023 17:34:08 +0900 Subject: [PATCH 0518/3948] =?UTF-8?q?=E8=B2=A2=E7=8C=AE=E3=83=9D=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=83=88=20:=20Open=20Collective=E3=81=A7=E3=81=AE?= =?UTF-8?q?=E7=B5=8C=E8=B2=BB=E7=94=B3=E8=AB=8B=E3=81=AE=E4=BB=95=E6=96=B9?= =?UTF-8?q?=E3=82=92=E8=A8=98=E8=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start_editing.md | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/start_editing.md b/start_editing.md index 604b0a6e10..7e551bf1bc 100644 --- a/start_editing.md +++ b/start_editing.md @@ -273,8 +273,10 @@ cpprefjpおよびboostjpでの作業は、以下のように貢献ポイント 3. 各コントリビューターの年間貢献ポイントと分配率を仮決定 4. 貢献ポイントの追加・修正指摘、および分配の受け入れ、または辞退の申し出を受け付ける (1週間程度) - 期間内に分配の受け入れ申し出がない場合は、貢献ポイントを次年繰り越す (前年まで保持) -5. 辞退者を除いて分配率を決定する -6. 入金先の情報をコアメンバー宛に伝える (Googleフォームを用意する予定) +5. 辞退者を除いて分配率および分配額を決定する +6. 入金先の情報をコアメンバー宛に伝える + - cpprefjpの銀行口座から支払う場合は、Googleフォームを用意する予定 + - Open Collectiveから支払う場合は、後述する手順で経費申請する お金での分配を辞退された方にも、ステッカーの配布などでお返しができればと考えています。 @@ -323,3 +325,21 @@ CIスクリプト、site_generator、kunaiなど。 | tool/addm | 50 | 新たな仕組みの導入 medium | | tool/addl | 100〜 | 新たな仕組みの導入 large : キーワード自動リンク、相対リンク対応など | +### Open Collectiveでの経費申請 +1. Open Collectiveのcpprefjpページに行く +2. 画面右側の「アクション」から「経費を申請」をクリック +3. ご自身の住所・氏名などを入力 +4. 支払い方法を入力 + - 通貨はUSDを選択 + - 送金先の国はJapanを選択 + - 「bank account (銀行口座)」または「PayPal」を選択 + - bank accountであれば、口座情報として銀行のSWIFT / BIC CODEおよびIBANを調べて入力する + - Google検索で「(銀行名) BIC CODE」などで検索 + - 三菱UFC銀行なら「BOTKJPJT」 + - bank accountのIBAN (International Bank Account Number) は、支店番号 + 口座番号を連続で記載する + - PayPalであれば、ご自身のPayPalアカウントを入力する + - ご自身の住所を英語で入力する + - 請求金額および請求の説明を記載して送信する + - 説明欄にGitHubアカウントを書いてもらえると、だれの申請かがわかりやすくて助かる +5. cpprefjpから経費の承認がされれば、支払われる + From da9fc6ae8541971d8adc926c20f51b9e1b0b284b Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 25 Oct 2023 17:35:52 +0900 Subject: [PATCH 0519/3948] =?UTF-8?q?=E8=B2=A2=E7=8C=AE=E3=83=9D=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=83=88=20:=20=E3=83=9E=E3=83=BC=E3=82=B8=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=81=9A=E3=82=AF=E3=83=AD=E3=83=BC=E3=82=BA=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=81=9FPR=E3=80=81=E3=83=9E=E3=83=BC=E3=82=B8?= =?UTF-8?q?=E3=81=95=E3=82=8C=E3=81=9A=E3=82=AA=E3=83=BC=E3=83=97=E3=83=B3?= =?UTF-8?q?=E3=81=AA=E3=81=BE=E3=81=BE=E3=81=AEPR=E3=81=AB=E3=81=A4?= =?UTF-8?q?=E3=81=84=E3=81=A6=E8=A8=98=E8=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start_editing.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/start_editing.md b/start_editing.md index 7e551bf1bc..86015dc1a6 100644 --- a/start_editing.md +++ b/start_editing.md @@ -280,6 +280,9 @@ cpprefjpおよびboostjpでの作業は、以下のように貢献ポイント お金での分配を辞退された方にも、ステッカーの配布などでお返しができればと考えています。 +なお、マージされずにクローズされたPull Requestについては貢献ポイントの対象外とさせていただきます。 + +また、masterブランチにマージされずオープンなままのPull Requestについては、マージされた年に貢献ポイントをつけさせていただきます。 ### cpprefjp From 33d6e9aa95e4f6d02fb700b1d3afa8769b70876c Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Thu, 26 Oct 2023 12:27:00 +0900 Subject: [PATCH 0520/3948] =?UTF-8?q?generator=20:=20=E3=83=87=E3=83=95?= =?UTF-8?q?=E3=82=A9=E3=83=AB=E3=83=88=E3=82=A2=E3=83=AD=E3=82=B1=E3=83=BC?= =?UTF-8?q?=E3=82=BF=E5=9E=8B=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/generator/generator.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/generator/generator.md b/reference/generator/generator.md index 47ac8b9c75..6d5cf18c7b 100644 --- a/reference/generator/generator.md +++ b/reference/generator/generator.md @@ -88,7 +88,7 @@ namespace std { ### アロケータサポート -`generator`クラステンプレートの第3テンプレートパラメータ`Allocator`によって、[コルーチン・ステート](/lang/cpp20/coroutines.md)の動的メモリ確保に用いる静的アロケータ型を指定できる。省略時はデフォルトアロケータ[`allocator`](/reference/memory/allocator.md)が利用される。 +`generator`クラステンプレートの第3テンプレートパラメータ`Allocator`によって、[コルーチン・ステート](/lang/cpp20/coroutines.md)の動的メモリ確保に用いる静的アロケータ型を指定できる。省略時はデフォルトアロケータ[`allocator`](/reference/memory/allocator.md)が利用される。 またジェネレータコルーチン定義の引数リストに[`allocator_arg`](/reference/memory/allocator_arg_t.md)タグ型に続いてアロケータオブジェクトを指定すると、ジェネレータの生成毎に異なるアロケータ利用を指定することもできる。 From 4dfdb3a577c6cfa2c9b7c43839366712329bb910 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 27 Oct 2023 14:31:51 +0900 Subject: [PATCH 0521/3948] =?UTF-8?q?index=20:=20=E6=99=82=E9=9B=A8?= =?UTF-8?q?=E5=A0=82=E3=81=95=E3=81=BE=E3=81=AE=E3=83=AD=E3=82=B4=E3=81=A8?= =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=82=92=E6=8E=B2=E8=BC=89=20#1206?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.md b/index.md index 959b811735..0399771ef3 100644 --- a/index.md +++ b/index.md @@ -1,4 +1,7 @@ # cpprefjp - C++日本語リファレンス +## ゴールドスポンサー + +
時雨堂
本サイトcpprefjpは、プログラミング言語C++のリファレンスを提供するWebサイトです。 From 3104eb39826b9c90875dc20d2cef6c7b740c6dc5 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 27 Oct 2023 14:35:36 +0900 Subject: [PATCH 0522/3948] =?UTF-8?q?build=E3=82=A8=E3=83=A9=E3=83=BC?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.md b/index.md index 0399771ef3..ce92fd0789 100644 --- a/index.md +++ b/index.md @@ -1,7 +1,7 @@ # cpprefjp - C++日本語リファレンス ## ゴールドスポンサー -
時雨堂
+
shiguredo
本サイトcpprefjpは、プログラミング言語C++のリファレンスを提供するWebサイトです。 From cefc9fa40e2d3fdd850fb2feffbf02cdb53b890f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 27 Oct 2023 14:42:37 +0900 Subject: [PATCH 0523/3948] =?UTF-8?q?build=E3=82=A2=E3=82=AF=E3=82=B7?= =?UTF-8?q?=E3=83=A7=E3=83=B3=20:=20Python=E3=82=923.11=E3=81=AB=E5=9B=BA?= =?UTF-8?q?=E5=AE=9A=20(3.12=E3=81=A7=E3=82=A8=E3=83=A9=E3=83=BC=E3=81=8C?= =?UTF-8?q?=E3=81=A7=E3=81=9F)=20#1206?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 60015616d8..d251a1a203 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -57,7 +57,8 @@ jobs: - name: Set up Python 3.x uses: actions/setup-python@v1 with: - python-version: 3.x + python-version: 3.11 + # 3.12でUndefined symbolエラーがでた # あとはスクリプトで頑張る - run: ./cpprefjp/site/.github/workflows/script/build.sh From 7326dd761e713c932f0305362d68613be3340927 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 27 Oct 2023 15:03:54 +0900 Subject: [PATCH 0524/3948] =?UTF-8?q?=E3=83=AD=E3=82=B4=E3=82=B5=E3=82=A4?= =?UTF-8?q?=E3=82=BA=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.md b/index.md index ce92fd0789..0de5770c6e 100644 --- a/index.md +++ b/index.md @@ -1,7 +1,7 @@ # cpprefjp - C++日本語リファレンス ## ゴールドスポンサー -
shiguredo
+
shiguredo
本サイトcpprefjpは、プログラミング言語C++のリファレンスを提供するWebサイトです。 From 2ef44e29a79b6c542a3b6754448f6402ae4c7cd4 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 27 Oct 2023 15:10:59 +0900 Subject: [PATCH 0525/3948] =?UTF-8?q?=E3=83=AD=E3=82=B4=E3=82=B5=E3=82=A4?= =?UTF-8?q?=E3=82=BA=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.md b/index.md index 0de5770c6e..f4e826938b 100644 --- a/index.md +++ b/index.md @@ -1,7 +1,7 @@ # cpprefjp - C++日本語リファレンス ## ゴールドスポンサー -
shiguredo
+
shiguredo
本サイトcpprefjpは、プログラミング言語C++のリファレンスを提供するWebサイトです。 From 8cb09b84f248a585697f837c9b5ff0609b785f20 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 27 Oct 2023 15:54:17 +0900 Subject: [PATCH 0526/3948] =?UTF-8?q?=E3=82=B9=E3=83=9D=E3=83=B3=E3=82=B5?= =?UTF-8?q?=E3=83=BC=E3=83=AD=E3=82=B4=E3=81=AE=E8=A1=A8=E7=A4=BA=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=E3=82=92=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.md b/index.md index f4e826938b..36575c45f6 100644 --- a/index.md +++ b/index.md @@ -1,8 +1,4 @@ # cpprefjp - C++日本語リファレンス -## ゴールドスポンサー - -
shiguredo
- 本サイトcpprefjpは、プログラミング言語C++のリファレンスを提供するWebサイトです。 最新C++バージョンのリファレンスを提供していきます。 @@ -77,6 +73,10 @@ cpprefjp プロジェクトに参加する方法は簡単です。 ## スポンサー cpprefjpプロジェクトは、以下の方々にスポンサーになっていただいております。 +### ゴールドスポンサー + +
shiguredo
+ ### シルバースポンサー From 11b8c7e10869d33b4464e73bdd5804ab70fcc9e8 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 27 Oct 2023 16:02:34 +0900 Subject: [PATCH 0527/3948] =?UTF-8?q?=E3=83=AD=E3=82=B4=E3=82=B5=E3=82=A4?= =?UTF-8?q?=E3=82=BA=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.md b/index.md index 36575c45f6..7c24768e9f 100644 --- a/index.md +++ b/index.md @@ -75,7 +75,7 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい ### ゴールドスポンサー -
shiguredo
+
shiguredo
### シルバースポンサー From 4d8a7ea19cc2b3942b7f81e8ff3bb000a9e894bb Mon Sep 17 00:00:00 2001 From: ROCKTAKEY Date: Fri, 27 Oct 2023 17:04:51 +0900 Subject: [PATCH 0528/3948] =?UTF-8?q?start=5Fediting:=20=E7=89=B9=E6=AE=8A?= =?UTF-8?q?=E6=96=87=E5=AD=97=E3=81=B8=E5=A4=89=E6=8F=9B=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=82=8B=E5=89=8D=E3=81=AE=E6=96=87=E5=AD=97=E5=88=97=E3=82=92?= =?UTF-8?q?=E8=A1=A8=E7=A4=BA=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start_editing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/start_editing.md b/start_editing.md index c3e0f467fe..6f28be5be8 100644 --- a/start_editing.md +++ b/start_editing.md @@ -99,7 +99,7 @@ Markdown形式では、HTMLのタグも併用できますが、cpprefjpサイト - 値の大きさを表現するために、上付き文字を表す``タグを利用している - 添字を表現するために、下付き文字を表す``タグを利用している -また、Markdownパーサーの制限を回避し、表内で `|` (縦線、vertical line) を使用するために、文字参照 `|` を使用してます。 +また、Markdownパーサーの制限を回避し、表内で `|` (縦線、vertical line) を使用するために、文字参照 `&#x7C;` を使用してます。 新規リファレンスを書くにあたって、雛形ページを用意していますので、そちらをベースにして編集作業を行ってください。 From 2c7cf5e6f86de685aca92bd133c4be459df95ec7 Mon Sep 17 00:00:00 2001 From: ROCKTAKEY Date: Fri, 27 Oct 2023 18:16:15 +0900 Subject: [PATCH 0529/3948] =?UTF-8?q?working=5Fstyle:=20=E5=9E=8B=E4=BF=AE?= =?UTF-8?q?=E9=A3=BE=E3=81=AE=E3=82=B9=E3=82=BF=E3=82=A4=E3=83=AB=E3=81=AE?= =?UTF-8?q?=E4=B8=80=E8=A6=A7=E3=82=92=E7=AD=89=E5=B9=85=E3=83=95=E3=82=A9?= =?UTF-8?q?=E3=83=B3=E3=83=88=E3=81=A7=E8=A1=A8=E7=A4=BA=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 元の実装ではプロポーショナルフォントで表示されるが、 スペースの有無などが見にくいため、等幅フォントで表示できる コードブロックに記述するよう修正した。 --- working_style.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/working_style.md b/working_style.md index ee0da6fabd..07f729d4a0 100644 --- a/working_style.md +++ b/working_style.md @@ -7,12 +7,14 @@ 型修飾のスタイル: -- A) const T &v -- B) const T& v -- C) const T & v -- D) T const &v -- E) T const& v -- F) T const & v +```cpp +/* (A) */ const T &v +/* (B) */ const T& v +/* (C) */ const T & v +/* (D) */ T const &v +/* (E) */ T const& v +/* (F) */ T const & v +``` 本サイトでは、Bのスタイルで型修飾を行います。 From 3f57b6362da6d563cc732cc0155939599ba43bab Mon Sep 17 00:00:00 2001 From: suomesta Date: Sun, 29 Oct 2023 14:53:13 +0900 Subject: [PATCH 0530/3948] improve some examples --- lang/cpp20/deprecate_implicit_capture_of_this_via_defcopy.md | 2 +- reference/charconv/from_chars.md | 1 + reference/type_traits/is_trivially_copyable.md | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lang/cpp20/deprecate_implicit_capture_of_this_via_defcopy.md b/lang/cpp20/deprecate_implicit_capture_of_this_via_defcopy.md index 6f66c2db74..c557cb099b 100644 --- a/lang/cpp20/deprecate_implicit_capture_of_this_via_defcopy.md +++ b/lang/cpp20/deprecate_implicit_capture_of_this_via_defcopy.md @@ -21,7 +21,7 @@ struct X { }; auto y = [=, this] { // C++20から推奨される方法: - return value + g(); // [=]ではthisポインタはキャプチャされなくなるため、thisを指定してキャプチャすること + return value + g(); // [=, this]と別々に指定することで、thisポインタもキャプチャしていることが明示される }; } diff --git a/reference/charconv/from_chars.md b/reference/charconv/from_chars.md index fe8be92968..d23eec298d 100644 --- a/reference/charconv/from_chars.md +++ b/reference/charconv/from_chars.md @@ -121,6 +121,7 @@ C++標準はこれら関数の実装の詳細について何も規定しない ```cpp example #include +#include #include int main() diff --git a/reference/type_traits/is_trivially_copyable.md b/reference/type_traits/is_trivially_copyable.md index 7cb491a8c0..52671bec75 100644 --- a/reference/type_traits/is_trivially_copyable.md +++ b/reference/type_traits/is_trivially_copyable.md @@ -70,7 +70,7 @@ struct optional { = default; // #2 optional(optional const& rhs) - requires copy_constructible; + requires std::copy_constructible; }; ``` * std::is_trivially_copy_constructible_v[link /reference/type_traits/is_trivially_copy_constructible.md] From de4b233c1adaaabaa2a35c4e3005828b50cef34b Mon Sep 17 00:00:00 2001 From: suomesta Date: Sun, 29 Oct 2023 14:59:57 +0900 Subject: [PATCH 0531/3948] fix some typo --- lang/cpp20/simplifying_implicit_lambda_capture.md | 2 +- reference/array/to_array.md | 2 +- reference/string/char_traits/to_int_type.md | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lang/cpp20/simplifying_implicit_lambda_capture.md b/lang/cpp20/simplifying_implicit_lambda_capture.md index 573ab11e03..0b54668fdc 100644 --- a/lang/cpp20/simplifying_implicit_lambda_capture.md +++ b/lang/cpp20/simplifying_implicit_lambda_capture.md @@ -2,7 +2,7 @@ * cpp20[meta cpp] ## 概要 -ここでは、ラムダ式での暗黙のキャプチャについて、以下のN個の問題を解決する: +ここでは、ラムダ式での暗黙のキャプチャについて、以下の問題を解決する: 1. ラムダ式内での`decltype((x))`の使用 2. ラムダ式での構造化束縛のキャプチャ diff --git a/reference/array/to_array.md b/reference/array/to_array.md index b96f234caa..15ad63c031 100644 --- a/reference/array/to_array.md +++ b/reference/array/to_array.md @@ -1,6 +1,6 @@ # to_array * array[meta header] -* function[meta id-type] +* function template[meta id-type] * std[meta namespace] * cpp20[meta cpp] diff --git a/reference/string/char_traits/to_int_type.md b/reference/string/char_traits/to_int_type.md index 1c8285f225..05b1504049 100644 --- a/reference/string/char_traits/to_int_type.md +++ b/reference/string/char_traits/to_int_type.md @@ -28,11 +28,11 @@ static constexpr int_type to_int_type(char_type c) noexcept; // C++11 int main() { - int x = std::char_traits::to_char_type('A'); + int x = std::char_traits::to_int_type('A'); std::cout << std::hex << x << std::endl; } ``` -* to_char_type[color ff0000] +* to_int_type[color ff0000] ### 出力例 ``` From c9a543d972fa76272af7350fe9a3af9e571ab42c Mon Sep 17 00:00:00 2001 From: Ryo Suzuki Date: Tue, 31 Oct 2023 11:22:16 +0900 Subject: [PATCH 0532/3948] =?UTF-8?q?ranges::less=20=E7=AD=89=E3=81=AE?= =?UTF-8?q?=E3=82=B5=E3=83=B3=E3=83=97=E3=83=AB=E3=82=B3=E3=83=BC=E3=83=89?= =?UTF-8?q?=E3=81=AE=E3=82=B3=E3=83=B3=E3=83=91=E3=82=A4=E3=83=AB=E3=82=A8?= =?UTF-8?q?=E3=83=A9=E3=83=BC=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/functional/ranges_equal_to.md | 2 +- reference/functional/ranges_greater.md | 2 +- reference/functional/ranges_greater_equal.md | 2 +- reference/functional/ranges_less.md | 2 +- reference/functional/ranges_less_equal.md | 2 +- reference/functional/ranges_not_equal_to.md | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/reference/functional/ranges_equal_to.md b/reference/functional/ranges_equal_to.md index fba4e4737b..94c0f6abbf 100644 --- a/reference/functional/ranges_equal_to.md +++ b/reference/functional/ranges_equal_to.md @@ -51,7 +51,7 @@ namespace std::ranges { int main() { - std::cout << std::boolalpha << std::ranges::equal_to()(3, 3) << std::endl; + std::cout << std::boolalpha << std::ranges::equal_to()(3, 3) << std::endl; } ``` * std::ranges::equal_to[color ff0000] diff --git a/reference/functional/ranges_greater.md b/reference/functional/ranges_greater.md index 6abf76d469..4223b5899a 100644 --- a/reference/functional/ranges_greater.md +++ b/reference/functional/ranges_greater.md @@ -49,7 +49,7 @@ namespace std::ranges { int main() { - std::cout << std::boolalpha << std::ranges::greater()(3, 2) << std::endl; + std::cout << std::boolalpha << std::ranges::greater()(3, 2) << std::endl; } ``` * std::ranges::greater[color ff0000] diff --git a/reference/functional/ranges_greater_equal.md b/reference/functional/ranges_greater_equal.md index 0a47d6eb48..a0e3337f47 100644 --- a/reference/functional/ranges_greater_equal.md +++ b/reference/functional/ranges_greater_equal.md @@ -49,7 +49,7 @@ namespace std::ranges { int main() { - std::cout << std::boolalpha << std::ranges::greater_equal()(3, 2) << std::endl; + std::cout << std::boolalpha << std::ranges::greater_equal()(3, 2) << std::endl; } ``` * std::ranges::greater_equal[color ff0000] diff --git a/reference/functional/ranges_less.md b/reference/functional/ranges_less.md index 7e3f6323f4..5ebebc91c6 100644 --- a/reference/functional/ranges_less.md +++ b/reference/functional/ranges_less.md @@ -52,7 +52,7 @@ namespace std::ranges { int main() { - std::cout << std::boolalpha << std::ranges::less()(2, 3) << std::endl; + std::cout << std::boolalpha << std::ranges::less()(2, 3) << std::endl; } ``` * std::ranges::less[color ff0000] diff --git a/reference/functional/ranges_less_equal.md b/reference/functional/ranges_less_equal.md index 580cf30844..96cbc5aa6b 100644 --- a/reference/functional/ranges_less_equal.md +++ b/reference/functional/ranges_less_equal.md @@ -49,7 +49,7 @@ namespace std::ranges { int main() { - std::cout << std::boolalpha << std::ranges::less_equal()(2, 3) << std::endl; + std::cout << std::boolalpha << std::ranges::less_equal()(2, 3) << std::endl; } ``` * std::ranges::less_equal[color ff0000] diff --git a/reference/functional/ranges_not_equal_to.md b/reference/functional/ranges_not_equal_to.md index b9ce3e0993..5254d6b9d0 100644 --- a/reference/functional/ranges_not_equal_to.md +++ b/reference/functional/ranges_not_equal_to.md @@ -48,7 +48,7 @@ namespace std::ranges { int main() { - std::cout << std::boolalpha << std::ranges::not_equal_to()(3, 3) << std::endl; + std::cout << std::boolalpha << std::ranges::not_equal_to()(3, 3) << std::endl; } ``` * std::ranges::not_equal_to[color ff0000] From 6df7cab6190236bae3307f74ca259ff29892eea4 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 31 Oct 2023 18:24:16 +0900 Subject: [PATCH 0533/3948] P2548R6 copyable_function (#1199) --- lang/cpp26.md | 2 +- reference/functional.md | 4 +- reference/functional/copyable_function.md | 243 ++++++++++++++++++ .../functional/copyable_function/op_assign.md | 73 ++++++ .../functional/copyable_function/op_bool.md | 58 +++++ .../functional/copyable_function/op_call.md | 72 ++++++ .../copyable_function/op_constructor.md | 225 ++++++++++++++++ .../copyable_function/op_destructor.md | 36 +++ .../functional/copyable_function/op_equal.md | 66 +++++ .../copyable_function/op_not_equal.md | 66 +++++ .../functional/copyable_function/swap.md | 72 ++++++ .../functional/copyable_function/swap_free.md | 67 +++++ reference/functional/function.md | 4 +- 13 files changed, 985 insertions(+), 3 deletions(-) create mode 100644 reference/functional/copyable_function.md create mode 100644 reference/functional/copyable_function/op_assign.md create mode 100644 reference/functional/copyable_function/op_bool.md create mode 100644 reference/functional/copyable_function/op_call.md create mode 100644 reference/functional/copyable_function/op_constructor.md create mode 100644 reference/functional/copyable_function/op_destructor.md create mode 100644 reference/functional/copyable_function/op_equal.md create mode 100644 reference/functional/copyable_function/op_not_equal.md create mode 100644 reference/functional/copyable_function/swap.md create mode 100644 reference/functional/copyable_function/swap_free.md diff --git a/lang/cpp26.md b/lang/cpp26.md index 21fe2c3be5..1217cfb55d 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -87,7 +87,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 ### 関数オブジェクト - 所有権を保持しない[`std::function`](/reference/functional/function.md)として、[``](/reference/functional.md)に[`std::function_ref`](/reference/functional/function_ref.md.nolink)クラスを追加 -- [`std::move_only_function`](/reference/functional/move_only_function.md)のコピー可能版として、[``](/reference/functional.md)に[`std::copyable_function`](/reference/copyable_function.md.nolink)クラスを追加 +- [`std::move_only_function`](/reference/functional/move_only_function.md)のコピー可能版として、[``](/reference/functional.md)に[`std::copyable_function`](/reference/functional/copyable_function.md)クラスを追加 - [`std::bind_front()`](/reference/functional/bind_front.md)と[`std::bind_back()`](/reference/functional/bind_back.md.nolink)に、非型テンプレート引数として関数を指定するオーバーロードを追加 - 関連して、非型テンプレート引数の関数オブジェクトを反転させられるよう、[`not_fn()`](/reference/functional/not_fn.md)に非型テンプレート引数版のオーバーロードを追加 diff --git a/reference/functional.md b/reference/functional.md index de215b83e5..3f31d2c936 100644 --- a/reference/functional.md +++ b/reference/functional.md @@ -25,7 +25,9 @@ struct doubler { |----------------------------------------------------------|----------------------------------------|-------| | [`function`](functional/function.md) | 関数・関数オブジェクトの多相的なラッパー(class template) | C++11 | | [`bad_function_call`](functional/bad_function_call.md) | 不正な関数呼び出しに関する例外(class) | C++11 | -| [`move_only_function`](functional/move_only_function.md) | 関数・関数オブジェクトの多相的な軽量ラッパー(class template) | C++23 | +| [`move_only_function`](functional/move_only_function.md) | ムーブのみ可能な関数・関数オブジェクトの多相軽量ラッパー(class template) | C++23 | +| [`copyable_function`](functional/copyable_function.md) | コピー可能な関数・関数オブジェクトの多相軽量ラッパー(class template) | C++26 | +| [`function_ref`](functional/function_ref.md.nolink) | 関数・関数オブジェクトの多相参照ラッパー(class template) | C++26 | ## 統一的な関数呼び出し diff --git a/reference/functional/copyable_function.md b/reference/functional/copyable_function.md new file mode 100644 index 0000000000..40131badd1 --- /dev/null +++ b/reference/functional/copyable_function.md @@ -0,0 +1,243 @@ +# copyable_function +* functional[meta header] +* class template[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std { + template + class copyable_function; // 宣言のみ + + template + class copyable_function; +} +``` + +## 概要 +`copyable_function`クラステンプレートは、パラメータの型リスト`ArgTypes...`、戻り値の型`R`に合致する、あらゆる関数ポインタ、関数オブジェクト、メンバ関数ポインタ、メンバ変数ポインタを保持できるクラスである。 + +下記全ての組み合わせ(12種類)に対して、クラステンプレートの部分特殊化が提供される。 + +- CV修飾子 *cv* : `const`, CV修飾無し +- 参照修飾子 *ref* : `&`, `&&`, 参照修飾無し +- noexcept例外指定 *noex* : `true`, `false` + +### `function`との比較 +[`std::function`](function.md)と比べて、`std::copyable_function`は下記の特徴をもつ。 + +- 関数型のCV修飾/参照修飾/noexcept例外指定をサポートする。 + - const性などを正しく伝搬することでバグ発生リスクを軽減する +- [`target_type`](function/target_type.md)型と[`target()`](function/target.md)を提供しない。 + - 実行時型情報(RTTI)非依存 +- [関数呼び出し](copyable_function/op_call.md)は強い事前条件を持つ。 + - 関数呼び出し時のnullチェックが要求されない +- クラステンプレート引数の[推論補助](/lang/cpp17/type_deduction_for_class_templates.md)を提供しない。 + + +## メンバ関数 +### 構築・破棄 + +| 名前 | 説明 | 対応バージョン | +|-----------------|----------------|----------------| +| [`(constructor)`](copyable_function/op_constructor.md) | コンストラクタ | C++26 | +| [`(destructor)`](copyable_function/op_destructor.md) | デストラクタ | C++26 | +| [`operator=`](copyable_function/op_assign.md) | 代入演算子 | C++26 | +| [`swap`](copyable_function/swap.md) | 他の`copyable_function`オブジェクトと中身を入れ替える | C++26 | +| [`operator bool`](copyable_function/op_bool.md) | 関数呼び出しが可能か調べる | C++26 | +| [`operator()`](copyable_function/op_call.md) | 関数呼び出し | C++26 | + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|-----------------|----------------|----------------| +| `result_type` | 関数の戻り値の型(テンプレートパラメータ`R`) | C++26 | + +## 非メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|-----------------|----------------|----------------| +| [`operator==`](copyable_function/op_equal.md) | 等値比較 | C++26 | +| [`operator!=`](copyable_function/op_not_equal.md) | 非等値比較 | C++26 | +| [`swap`](copyable_function/swap_free.md) | 2つの`copyable_function`オブジェクトを入れ替える | C++26 | + + +## 例 +### 例1: 基本の使い方 +```cpp example +#include +#include + +int add(int x) { return x + 1; } + +int main() +{ + // 関数を代入 + std::copyable_function f = add; + + // 関数オブジェクトを代入 + f = [](int x) { return x + 1; }; + + // 保持している関数を呼び出す + int result = f(1); + std::cout << result << std::endl; +} +``` +* std::copyable_function[color ff0000] +* f(1)[link copyable_function/op_call.md] + +#### 出力 +``` +2 +``` + +### 例2: const性の伝搬 +```cpp +#include +#include +#include +#include + +struct Functor { + std::string operator()() { + return "non-const"; + } + std::string operator()() const { + return "const"; + } +}; + +int main() +{ + std::cout << "-- copyable_function" << std::endl; + std::copyable_function mof1 = Functor{}; + const std::copyable_function mof2 = Functor{}; // (呼び出し時に不適格) + std::copyable_function mof3 = Functor{}; + const std::copyable_function mof4 = Functor{}; + std::cout << "mof1: " << mof1() << std::endl; +//std::cout << "mof2: " << mof2() << std::endl; // 不適格 + std::cout << "mof3: " << mof3() << std::endl; + std::cout << "mof4: " << mof4() << std::endl; + + std::cout << "-- function" << std::endl; + std::function fn1 = Functor{}; + const std::function fn2 = Functor{}; +// std::function fn3 = Functor{}; // 不適格 +//const std::function fn4 = Functor{}; // 不適格 + std::cout << "fn1: " << fn1() << std::endl; + std::cout << "fn2: " << fn2() << std::endl; +} +``` +* std::copyable_function[color ff0000] +* std::function[link function.md] + +#### 出力 +``` +-- copyable_function +mof1: non-const +mof3: const +mof4: const +-- function +fn1: non-const +fn2: non-const +``` + +### 例3: 左辺値/右辺値の伝搬 +```cpp example +#include +#include +#include +#include + +struct Functor { + std::string operator()() & { + return "L-val"; + } + std::string operator()() && { + return "R-val"; + } +}; + +int main() +{ + std::cout << "-- copyable_function" << std::endl; + std::copyable_function mof1 = Functor{}; + std::copyable_function mof2 = Functor{}; + std::cout << "mof1/L-val: " << mof1() << std::endl; + std::cout << "mof1/R-val: " << std::move(mof1)() << std::endl; +//std::cout << "mof2/L-val: " << mof2() << std::endl; // 不適格 + std::cout << "mof2/R-val: " << std::move(mof2)() << std::endl; + + std::cout << "-- function" << std::endl; + std::function fn1 = Functor{}; +//std::function fn2 = Functor{}; // 不適格 + std::cout << "fn1/L-val: " << fn1() << std::endl; + std::cout << "fn1/R-val: " << std::move(fn1)() << std::endl; +} +``` +* std::copyable_function[color ff0000] +* std::function[link function.md] + +#### 出力 +``` +-- copyable_function +mof1/L-val: L-val +mof1/R-val: L-val +mof2/R-val: R-val +-- function +fn1/L-val: L-val +fn1/R-val: L-val +``` + +### 例4: noexcept指定の伝搬 +```cpp example +#include + +void func() {} +void func_noex() noexcept {} + +int main() +{ + std::copyable_function mof1 = func; + std::copyable_function mof2 = func_noex; +//std::copyable_function mof3 = func; // 不適格 + std::copyable_function mof4 = func_noex; + static_assert(not noexcept(mof1())); + static_assert(not noexcept(mof2())); + static_assert( noexcept(mof4())); + + std::function fn1 = func; + std::function fn2 = func_noex; +//std::function fn3 = func; // 不適格 +//std::function fn4 = func_noex; // 不適格 + static_assert(not noexcept(fn1())); + static_assert(not noexcept(fn2())); +} +``` +* std::copyable_function[color ff0000] +* std::function[link function.md] + +#### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`function`](function.md) +- [`move_only_function`](move_only_function.md) + + +## 参照 +- [P2548R6 copyable_function](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2548r6.pdf) diff --git a/reference/functional/copyable_function/op_assign.md b/reference/functional/copyable_function/op_assign.md new file mode 100644 index 0000000000..1c405beb5c --- /dev/null +++ b/reference/functional/copyable_function/op_assign.md @@ -0,0 +1,73 @@ +# operator= +* functional[meta header] +* std[meta namespace] +* copyable_function[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +copyable_function& operator=(const copyable_function& f); // (1) + +copyable_function& operator=(copyable_function&& f); // (2) + +copyable_function& operator=(nullptr_t); noexcept; // (3) + +template +copyable_function& operator=(F&& f); // (4) +``` + +## 効果 + +- (1) : コピー代入。[`copyable_function`](op_constructor.md)`(f).`[`swap`](swap.md)`(*this)` +- (2) : ムーブ代入。[`copyable_function`](op_constructor.md)`(`[`std::move`](/reference/utility/move.md)`(f)).`[`swap`](swap.md)`(*this)` +- (3) : `*this`が有効な関数ポインタ、メンバポインタ、もしくは関数オブジェクトを持っている場合、それを解放する。 +- (4) : [`copyable_function`](op_constructor.md)`(`[`std::forward`](/reference/utility/forward.md)`(f)).`[`swap`](swap.md)`(*this)` + + +## 戻り値 +`*this` + + +## 例外 +- (3) : 投げない + + +## 例 +```cpp example +#include +#include + +int ident(int x) { return x; } + +int main() +{ + std::copyable_function f; + + // 関数を代入 + f = ident; + + int result = f(1); + std::cout << result << std::endl; +} +``` +* f(1)[link op_call.md] + +### 出力 +``` +1 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2548R6 copyable_function](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2548r6.pdf) diff --git a/reference/functional/copyable_function/op_bool.md b/reference/functional/copyable_function/op_bool.md new file mode 100644 index 0000000000..949114a07b --- /dev/null +++ b/reference/functional/copyable_function/op_bool.md @@ -0,0 +1,58 @@ +# operator bool +* functional[meta header] +* std[meta namespace] +* copyable_function[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +explicit operator bool() const noexcept; +``` + +## 概要 +関数呼び出しが可能か調べる。 + + +## 戻り値 +呼び出す関数を持っていれば`true`、そうでなければ`false`を返す。 + + +## 例 +```cpp example +#include +#include + +int ident(int x) { return x; } + +int main() +{ + std::copyable_function f = ident; + + if (f) { + std::cout << "not empty" << std::endl; + } + else { + std::cout << "empty" << std::endl; + } +} +``` + +### 出力 +``` +not empty +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2548R6 copyable_function](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2548r6.pdf) diff --git a/reference/functional/copyable_function/op_call.md b/reference/functional/copyable_function/op_call.md new file mode 100644 index 0000000000..6ffeb23fba --- /dev/null +++ b/reference/functional/copyable_function/op_call.md @@ -0,0 +1,72 @@ +# operator() +* functional[meta header] +* std[meta namespace] +* copyable_function[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +R operator()(ArgTypes... args) /*cv*/ /*ref*/ noexcept(/*noex*/); +``` + +## 概要 +関数を呼び出す。 + +`operator()`のCV修飾子 *cv*, 参照修飾子 *ref*, noexcept例外指定 *noex* は、[`copyable_function`](../copyable_function.md)に指定するテンプレートパラメータ`R(ArgTypes...)`部のものと等しい。 + +説明用のプレースホルダ *inv-quals* を次のように定義する : + +- *ref* が空(参照修飾無し)ならば、*cv*`&` +- そうでなければ、*cv* *ref* + + +## 事前条件 +`*this`は関数ポインタまたは関数オブジェクトを保持していること。 + + +## 効果 +`*this`が保持している`F`型の関数ポインタまたは関数オブジェクト`f`に対して、[`INVOKE`](/reference/concepts/Invoke.md)`(static_cast(f),` [`std::forward`](/reference/utility/forward.md)`(args)...)`を行う。 + + +## 戻り値 +`R`型が`void`の場合は何も返さない。そうでなければ、関数呼び出しの戻り値を返す。 + + +## 例 +```cpp example +#include +#include + +int ident(int x) +{ return x; } + +int main() +{ + std::copyable_function f = ident; + + // 関数呼び出し : 保持しているident()関数を呼び出す + int result = f(1); + + std::cout << result << std::endl; +} +``` + +### 出力 +``` +1 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2548R6 copyable_function](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2548r6.pdf) diff --git a/reference/functional/copyable_function/op_constructor.md b/reference/functional/copyable_function/op_constructor.md new file mode 100644 index 0000000000..3db59be242 --- /dev/null +++ b/reference/functional/copyable_function/op_constructor.md @@ -0,0 +1,225 @@ +# コンストラクタ +* functional[meta header] +* std[meta namespace] +* copyable_function[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +copyable_function() noexcept; // (1) +copyable_function(nullptr_t) noexcept; // (2) +copyable_function(const copyable_function&); // (3) +copyable_function(copyable_function&&) noexcept; // (4) + +template copyable_function(F&&); // (5) + +template +explicit copyable_function(in_place_type_t, Args&&...); // (6) + +template +explicit copyable_function(in_place_type_t, initializer_list, Args&&...); // (7) +``` +* in_place_type_t[link /reference/utility/in_place_type_t.md] + +## 概要 +`copyable_function`オブジェクトを構築する。 + + +`copyable_function`クラステンプレートパラメータのCV修飾子 *cv*, 参照修飾子 *ref*, noexcept例外指定 *noex* に応じて、説明用のプレースホルダ *inv-quals* を次のように定義する : + +- *ref* が空(参照修飾無し)ならば、*cv*`&` +- そうでなければ、*cv* *ref* + +また、説明用の`bool`型テンプレート定数`is-callable-from`を下記のように定義する : + +- *noex* が`true`のとき : [`is_nothrow_invocable_r_v`](/reference/type_traits/is_nothrow_invocable_r.md)` &&` [`is_nothrow_invocable_r_v`](/reference/type_traits/is_nothrow_invocable_r.md)`` +- *noex* が`false`のとき : [`is_invocable_r_v`](/reference/type_traits/is_invocable_r.md)` &&` [`is_invocable_r_v`](/reference/type_traits/is_invocable_r.md)`` + + +## テンプレートパラメータ制約 +- (5) : `VT`型を`decay_t`としたとき + - `remove_cvref_t`が`copyable_function`と同一型ではなく、かつ + - `remove_cvref_t`が`in_place_type_t`の特殊化ではなく、かつ + - `is-callable-from`が`true`であること +- (6) : `VT`型を`decay_t`としたとき + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true`であり、かつ + - `is-callable-from`が`true`であること +- (7) : `VT`型を`decay_t`としたとき + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)`&, Args...>`が`true`であり、かつ + - `is-callable-from`が`true`であること + + +## 適格要件 +- (5) : `VT`型を`decay_t`としたとき + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true`であり、かつ + - [`is_copy_constructible_v`](/reference/type_traits/is_copy_constructible.md)``が`true`であること +- (6), (7) : `VT`型を`decay_t`としたとき + - `VT`が`T`と同一型であり、かつ + - [`is_copy_constructible_v`](/reference/type_traits/is_copy_constructible.md)``が`true`であること + + +## 事前条件 +- (5) : `VT`型を`decay_t`としたとき、`VT`がCpp17Destructible要件およびCpp17CopyConstructible要件を満たすこと。 +- (6), (7) : `VT`型を`decay_t`としたとき、`VT`がCpp17Destructible要件およびCpp17CopyConstructible要件を満たすこと。 + + +## 効果 +- (1), (2) : 関数を持たない空の`copyable_function`オブジェクトを構築する。この方法で構築した後、[`operator bool`](op_bool.md)は`false`を返す。 +- (3) : `*this`の格納オブジェクトを + - `f`が値を保持していない場合、値を保持しない。 + - そうでなければ、`f`が保持する値をコピーして保持する。 +- (4) : `f`が保持する状態を`*this`に移動する。移動された後の`f`は、未規定な値を持つ有効な状態となる。 +- (5) : `*this`の格納オブジェクトを + - `f`が関数ポインタ型、メンバ関数ポインタ型、メンバ変数ポインタ型いずれかのヌルポインタ値の場合、値を保持しない。 + - `remove_cvref_t`が`copyable_function`の特殊化であり、かつ値を保持していない場合、値を保持しない。 + - そうでなければ、`*this`が保持する`VT`型の格納オブジェクトを、`std::forward(f)`で直接非リスト初期化する。 +- (6) : `*this`が保持する`VT`型の格納オブジェクトを、`std::forward(args)...`で直接非リスト初期化する。 +- (7) : `*this`が保持する`VT`型の格納オブジェクトを、`ilist, std::forward(args)...`で直接非リスト初期化する。 + + +## 例外 +- (1), (2), (4) : 投げない +- (3) : 格納オブジェクトの初期化から例外が投げられる可能性がある。`bad_alloc`例外が投げられる可能性がある。 +- (5), (6), (7) : 格納オブジェクトの初期化から例外が投げられる可能性がある。`VT`が関数ポインタまたは[`reference_wrapper`](/reference/functional/reference_wrapper.md)の特殊化いずれでもなければ、`bad_alloc`例外が投げられる可能性がある。 + + +## 例 +```cpp example +#include +#include +#include +#include +#include + +struct ident_functor { + int operator()(int x) const + { return x; } +}; + +int ident_func(int x) +{ return x; } + +struct X { + int value; + + int add_member_func(int x) const + { return value + x; } +}; + +struct add_functor { + int value; + + add_functor(int v) : value(v) {} + add_functor(std::initializer_list lst, int iv) + : value(std::accumulate(lst.begin(), lst.end(), iv)) {} + + int operator()(int x) const + { return value + x; } +}; + + +int main() +{ + // (1) デフォルトコンストラクタ + // (2) ヌルポインタを受け取るコンストラクタ + // 空のcopyable_functionオブジェクトを作る + { + std::copyable_function f1; + assert(!f1); + std::copyable_function f2 = nullptr; + assert(!f2); + } + + // (3) コピー構築 + { + std::copyable_function f = ident_functor(); + std::copyable_function g = f; + assert(g && f); + + int result = g(1); + std::cout << "(3) : " << result << std::endl; + } + + // (4) ムーブ構築 + { + std::copyable_function f = ident_functor(); + std::copyable_function g = std::move(f); + assert(g && !f); + + int result = g(1); + std::cout << "(4) : " << result << std::endl; + } + + // (5) 関数ポインタを受け取って構築 + { + std::copyable_function f = ident_func; + + int result = f(1); + std::cout << "(5) function pointer : " << result << std::endl; + } + // (5) 関数オブジェクトを受け取って構築 + { + std::copyable_function f = ident_functor(); + + int result = f(1); + std::cout << "(5) function object : " << result << std::endl; + } + // (5) メンバ関数ポインタを受け取った構築 + { + std::copyable_function f = &X::add_member_func; + + X x{2}; + int result = f(x, 1); + std::cout << "(5) member function pointer : " << result << std::endl; + } + // (5) メンバ変数ポインタを受け取った構築 + { + std::copyable_function f = &X::value; + X x{2}; + int result = f(x); + std::cout << "(5) member variable pointer : " << result << std::endl; + } + + // (6) 引数リストによる直接構築コンストラクタ + { + std::copyable_function f(std::in_place_type, 2); + int result = f(1); + std::cout << "(6) : " << result << std::endl; + } + + // (7) initializer_list+引数リストによる直接構築コンストラクタ + { + std::copyable_function f(std::in_place_type, std::initializer_list{1, 2, 3}, 4); + int result = f(5); + std::cout << "(7) : " << result << std::endl; + } +} +``` +* std::move[link /reference/utility/move.md] + +### 出力 +``` +(3) : 1 +(4) : 1 +(5) function pointer : 1 +(5) function object : 1 +(5) member function pointer : 3 +(5) member variable pointer : 2 +(6) : 3 +(7) : 15 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2548R6 copyable_function](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2548r6.pdf) diff --git a/reference/functional/copyable_function/op_destructor.md b/reference/functional/copyable_function/op_destructor.md new file mode 100644 index 0000000000..268bddf180 --- /dev/null +++ b/reference/functional/copyable_function/op_destructor.md @@ -0,0 +1,36 @@ +# デストラクタ +* functional[meta header] +* std[meta namespace] +* copyable_function[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +~copyable_function(); +``` + +## 概要 +`copyable_function`オブジェクトを破棄する。 + + +## 効果 +`*this`が有効な関数ポインタ、メンバポインタ、もしくは関数オブジェクトを持っている場合、その関数を解放する。 + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2548R6 copyable_function](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2548r6.pdf) diff --git a/reference/functional/copyable_function/op_equal.md b/reference/functional/copyable_function/op_equal.md new file mode 100644 index 0000000000..0d88b8ba41 --- /dev/null +++ b/reference/functional/copyable_function/op_equal.md @@ -0,0 +1,66 @@ +# operator== +* functional[meta header] +* std[meta namespace] +* copyable_function[meta class] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +friend bool operator==(const copyable_function& f, nullptr_t) noexcept; // (1) + +// (1)により、以下のオーバーロードが使用可能になる +friend bool operator==(nullptr_t, const copyable_function& f) noexcept; // (2) +``` +* nullptr_t[link /reference/cstddef/nullptr_t.md] + +## 概要 +等値比較する。 + + +## 戻り値 +`!f` + + +## 例 +```cpp example +#include +#include + +int ident(int x) { return x; } + +int main() +{ + std::copyable_function f; + + if (f == nullptr) { + std::cout << "empty" << std::endl; + } + + f = ident; + if (f == nullptr) {} + else { + std::cout << "not empty" << std::endl; + } +} +``` + +### 出力 +``` +empty +not empty +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2548R6 copyable_function](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2548r6.pdf) diff --git a/reference/functional/copyable_function/op_not_equal.md b/reference/functional/copyable_function/op_not_equal.md new file mode 100644 index 0000000000..df0b7a6b4e --- /dev/null +++ b/reference/functional/copyable_function/op_not_equal.md @@ -0,0 +1,66 @@ +# operator!= +* functional[meta header] +* std[meta namespace] +* copyable_function[meta class] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +// operator==により、以下のオーバーロードが使用可能になる +bool operator!=(const copyable_function& f, nullptr_t) noexcept; // (1) + +bool operator!=(nullptr_t, const copyable_function& f) noexcept; // (2) +``` +* nullptr_t[link /reference/cstddef/nullptr_t.md] + +## 概要 +非等値比較する。 + + +## 戻り値 +`static_cast(f)` + + +## 例 +```cpp example +#include +#include + +int ident(int x) { return x; } + +int main() +{ + std::copyable_function f = ident; + + if (f != nullptr) { + std::cout << "not empty" << std::endl; + } + + f = nullptr; + if (f != nullptr) {} + else { + std::cout << "empty" << std::endl; + } +} +``` + +### 出力 +``` +not empty +empty +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2548R6 copyable_function](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2548r6.pdf) diff --git a/reference/functional/copyable_function/swap.md b/reference/functional/copyable_function/swap.md new file mode 100644 index 0000000000..1b78432bb6 --- /dev/null +++ b/reference/functional/copyable_function/swap.md @@ -0,0 +1,72 @@ +# swap +* functional[meta header] +* std[meta namespace] +* copyable_function[meta class] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +void swap(copyable_function& other) noexcept; +``` + +## 概要 +他の`copyable_function`オブジェクトと中身を入れ替える。 + + +## 効果 +`*this`が持つ関数と`other`が持つ関数を交換する。 + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include + +int ident(int x) { return x; } +int add(int x) { return x + 1; } + +int main() +{ + std::copyable_function f = ident; + std::copyable_function g = add; + + // fとgを交換 + f.swap(g); + + std::cout << f(1) << std::endl; // add + std::cout << g(1) << std::endl; // ident +} +``` +* swap[color ff0000] +* f(1)[link op_call.md] +* g(1)[link op_call.md] + +### 出力 +``` +2 +1 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2548R6 copyable_function](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2548r6.pdf) + diff --git a/reference/functional/copyable_function/swap_free.md b/reference/functional/copyable_function/swap_free.md new file mode 100644 index 0000000000..4c12ebb98c --- /dev/null +++ b/reference/functional/copyable_function/swap_free.md @@ -0,0 +1,67 @@ +# swap (非メンバ関数) +* functional[meta header] +* std[meta namespace] +* copyable_function[meta class] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +friend void swap(copyable_function& f1, copyable_function& f2) noexcept; +``` + +## 概要 +2つの`copyable_function`オブジェクトを入れ替える。 + + +## 効果 +`f1.`[`swap`](swap.md)`(f2)` + + +## 戻り値 +なし + + +## 例 +```cpp example +#include +#include + +int ident(int x) { return x; } +int add(int x) { return x + 1; } + +int main() +{ + std::copyable_function f = ident; + std::copyable_function g = add; + + // fとgを交換 + std::swap(f, g); + + std::cout << f(1) << std::endl; // add + std::cout << g(1) << std::endl; // ident +} +``` +* std::swap[color ff0000] +* f(1)[link op_call.md] +* g(1)[link op_call.md] + +### 出力 +``` +2 +1 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2548R6 copyable_function](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2548r6.pdf) diff --git a/reference/functional/function.md b/reference/functional/function.md index 27f8027020..e074d0bcbe 100644 --- a/reference/functional/function.md +++ b/reference/functional/function.md @@ -115,7 +115,9 @@ int main() ## 関連項目 -- [`move_only_function`](move_only_function.md) +- C++23 [`move_only_function`](move_only_function.md) +- C++26 [`copyable_function`](copyable_function.md) +- C++26 [`function_ref`](function_ref.md.nolink) ## 参照 From 114671911d63eb03ec0284ba4a1992d3b35e1a7a Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 31 Oct 2023 18:27:05 +0900 Subject: [PATCH 0534/3948] move_only_function/op_constructor: fix example --- reference/functional/move_only_function/op_constructor.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/functional/move_only_function/op_constructor.md b/reference/functional/move_only_function/op_constructor.md index d5bd1e25b1..338da0c7b1 100644 --- a/reference/functional/move_only_function/op_constructor.md +++ b/reference/functional/move_only_function/op_constructor.md @@ -137,21 +137,21 @@ int main() // (4) 関数ポインタを受け取って構築 { - std::function f = ident_func; + std::move_only_function f = ident_func; int result = f(1); std::cout << "(4) function pointer : " << result << std::endl; } // (4) 関数オブジェクトを受け取って構築 { - std::function f = ident_functor(); + std::move_only_function f = ident_functor(); int result = f(1); std::cout << "(4) function object : " << result << std::endl; } // (4) メンバ関数ポインタを受け取った構築 { - std::function f = &X::add_member_func; + std::move_only_function f = &X::add_member_func; X x{2}; int result = f(x, 1); @@ -159,7 +159,7 @@ int main() } // (4) メンバ変数ポインタを受け取った構築 { - std::function f = &X::value; + std::move_only_function f = &X::value; X x{2}; int result = f(x); std::cout << "(4) member variable pointer : " << result << std::endl; From 05ee2e647ca2e59498eb1743056925969eeb6e7f Mon Sep 17 00:00:00 2001 From: tshino Date: Sat, 4 Nov 2023 19:40:21 +0900 Subject: [PATCH 0535/3948] =?UTF-8?q?std::exchange=E3=81=8C=E5=B8=B8?= =?UTF-8?q?=E3=81=AB=E3=83=A0=E3=83=BC=E3=83=96=E4=BB=A3=E5=85=A5=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AA=E8=A8=98=E8=BF=B0=E3=81=AE?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/utility/exchange.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/utility/exchange.md b/reference/utility/exchange.md index 5f14d92127..8736609591 100644 --- a/reference/utility/exchange.md +++ b/reference/utility/exchange.md @@ -24,7 +24,7 @@ namespace std { ## 効果 -第1パラメータ`obj`で受け取った変数への参照に、第2パラメータ`new_val`の値をムーブ代入し、代入前の`obj`の状態を返す。 +第1パラメータ`obj`で受け取った変数への参照に、第2パラメータ`new_val`の値をコピー代入または可能ならムーブ代入し、代入前の`obj`の状態を返す。 以下と等価の効果を持つ: @@ -215,4 +215,4 @@ Hello 0x7ffc560ca4cc - [P0202R3 Add Constexpr Modifiers to Functions in `` and `` Headers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0202r3.html) - [`std::exchange` Patterns: Fast, Safe, Expressive, and Probably Underused](https://www.fluentcpp.com/2020/09/25/stdexchange-patterns-fast-safe-expressive-and-probably-underused/) - [`std::exchange`によるmoveしてリセットするイディオムの御紹介](https://onihusube.hatenablog.com/entry/2020/10/31/163244) -- [P2401R0 Add a conditional noexcept specification to std::exchange](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2401r0.html) \ No newline at end of file +- [P2401R0 Add a conditional noexcept specification to std::exchange](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2401r0.html) From 7e37ab27d5f03221181f8282d1385efe68658864 Mon Sep 17 00:00:00 2001 From: SUZUKI Kei Date: Sun, 5 Nov 2023 08:45:00 +0900 Subject: [PATCH 0536/3948] =?UTF-8?q?typo=20=E3=82=92=E4=BF=AE=E6=AD=A3:?= =?UTF-8?q?=20"=E3=82=B9=E3=82=BF=E3=83=B3=E3=83=80=E3=83=BC=E3=83=89?= =?UTF-8?q?=E3=83=AC=E3=82=A4=E3=82=A2=E3=82=A6=E3=83=88=E5=9E=8B=E5=9E=8B?= =?UTF-8?q?"=20->=20"=E3=82=B9=E3=82=BF=E3=83=B3=E3=83=80=E3=83=BC?= =?UTF-8?q?=E3=83=89=E3=83=AC=E3=82=A4=E3=82=A2=E3=82=A6=E3=83=88=E5=9E=8B?= =?UTF-8?q?"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp20/deprecate_pod.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp20/deprecate_pod.md b/lang/cpp20/deprecate_pod.md index 4e26124f08..b0a96eda1e 100644 --- a/lang/cpp20/deprecate_pod.md +++ b/lang/cpp20/deprecate_pod.md @@ -2,7 +2,7 @@ * cpp20[meta cpp] ## 概要 -[POD (Plain Old Data) という型の分類](/reference/type_traits/is_pod.md)は、C++11において[トリビアル型](/reference/type_traits/is_trivial.md)と[スタンダードレイアウト型](/reference/type_traits/is_standard_layout.md)型に用語が分割された。 +[POD (Plain Old Data) という型の分類](/reference/type_traits/is_pod.md)は、C++11において[トリビアル型](/reference/type_traits/is_trivial.md)と[スタンダードレイアウト型](/reference/type_traits/is_standard_layout.md)に用語が分割された。 C++20では規格の文面に残っていた「POD」の使用をやめ、スタンダードレイアウト型などのほかの型分類に置き換えた。 From f9a0fdd70a42ec9b262b93cc8796d9e5f1b802b0 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sun, 5 Nov 2023 19:57:20 +0900 Subject: [PATCH 0537/3948] =?UTF-8?q?NG=E3=83=AF=E3=83=BC=E3=83=89?= =?UTF-8?q?=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF=20:=20"=E5=9E=8B](link)?= =?UTF-8?q?=E5=9E=8B"=E3=82=92NG=E3=83=AF=E3=83=BC=E3=83=89=E3=81=AB?= =?UTF-8?q?=E7=99=BB=E9=8C=B2=20#1211?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/script/ngword_check.py | 5 ++++- reference/cmath/llround.md | 4 ++-- reference/cstddef/max_align_t.md | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/script/ngword_check.py b/.github/workflows/script/ngword_check.py index 4393cc2f9c..ed62e31a24 100644 --- a/.github/workflows/script/ngword_check.py +++ b/.github/workflows/script/ngword_check.py @@ -1,6 +1,7 @@ import glob import os import sys +import re NGWORD_LIST = [ ("", "
", "
"), @@ -23,6 +24,7 @@ ("", "voaltile", "volatile"), ("", "子ルーチン", "コルーチン"), ("", "移譲", "委譲"), + ("", r'型]\((.*?)\)型', "型](link)"), ("reference/chrono", "dulation", "duration"), ("reference/random", "施行", "試行"), ("reference/random", "疑似", "擬似"), @@ -35,7 +37,8 @@ def check_ngword(text: str, filename: str) -> bool: if not filename.startswith(target_dir): continue - if ngword in text: + m = re.search(ngword, text) + if m: print("{}: the file includes ngword \"{}\". you should fix to \"{}\".".format(filename, ngword, correct)) found_error = True return not found_error diff --git a/reference/cmath/llround.md b/reference/cmath/llround.md index fe26bc96eb..468961a058 100644 --- a/reference/cmath/llround.md +++ b/reference/cmath/llround.md @@ -46,13 +46,13 @@ namespace std { ## 戻り値 -引数 `x` を四捨五入により丸めた整数値を、[`long long`型](/lang/cpp11/long_long_type.md)型の範囲に収めて返す。 +引数 `x` を四捨五入により丸めた整数値を、[`long long`型](/lang/cpp11/long_long_type.md)の範囲に収めて返す。 ## 備考 - 本関数は、C99 の規格にある `llround`(より正確には `math.h` ヘッダの `llround`、`llroundf`、`llroundl` の 3 つ。それぞれ C++ の `double`、`float`、`long double` バージョンに相当)と等価である。 - [`round`](round.md)関数と違い、本関数において戻り値が非整数型引数 `x` と異なる場合に、例外 [`FE_INEXACT`](/reference/cfenv/fe_inexact.md) を発生させる必要はない。 -- 戻り値が[`long long`型](/lang/cpp11/long_long_type.md)型の範囲を超えた場合、定義域エラーが起こる可能性がある。その際の挙動については、[``](../cmath.md) を参照。 +- 戻り値が[`long long`型](/lang/cpp11/long_long_type.md)の範囲を超えた場合、定義域エラーが起こる可能性がある。その際の挙動については、[``](../cmath.md) を参照。 - なお、本関数の挙動は、現在の丸めモードには依存しない。 - C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された diff --git a/reference/cstddef/max_align_t.md b/reference/cstddef/max_align_t.md index 1c58821d98..6ea08a2771 100644 --- a/reference/cstddef/max_align_t.md +++ b/reference/cstddef/max_align_t.md @@ -13,7 +13,7 @@ namespace std { ## 概要 `std::max_align_t`は、どのスカラー型よりも大きいアライメントを必要とする型である。 -この型は、C++11では[POD型](/reference/type_traits/is_pod.md)、C++20では[トリビアル型](/reference/type_traits/is_trivial.md)型に分類される。 +この型は、C++11では[POD型](/reference/type_traits/is_pod.md)、C++20では[トリビアル型](/reference/type_traits/is_trivial.md)に分類される。 `alignas`指示子により、`std::max_align_t`のアライメントより大きいサイズのアライメントを指定できるかどうかは、実装依存である。 From 11b32f7cbe871fe4970b66171344d19c831f1b7b Mon Sep 17 00:00:00 2001 From: suomesta Date: Sun, 5 Nov 2023 20:57:25 +0900 Subject: [PATCH 0538/3948] fix some typo --- reference/format/format.md | 1 - reference/format/formatter.md | 2 +- reference/random/binomial_distribution/op_constructor.md | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/reference/format/format.md b/reference/format/format.md index a8f22404de..22659c5a62 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -490,7 +490,6 @@ int main() ### `vector`を出力する (C++23) ```cpp example -```cpp example #include #include #include diff --git a/reference/format/formatter.md b/reference/format/formatter.md index 4de6df6b06..24a788f1a7 100644 --- a/reference/format/formatter.md +++ b/reference/format/formatter.md @@ -7,7 +7,7 @@ ```cpp namespace std { - template + template struct formatter; // (1) C++20 template diff --git a/reference/random/binomial_distribution/op_constructor.md b/reference/random/binomial_distribution/op_constructor.md index c72284bb08..8e3eed9430 100644 --- a/reference/random/binomial_distribution/op_constructor.md +++ b/reference/random/binomial_distribution/op_constructor.md @@ -7,9 +7,9 @@ ```cpp explicit binomial_distribution(IntType t = 1, double p = 0.5); // (1) -binomial_distribution() : binomial_distribution(1) {} // (1) +binomial_distribution() : binomial_distribution(1) {} // (1) C++20 -explicit binomial_distribution(IntType t, double p = 0.5); // (2) +explicit binomial_distribution(IntType t, double p = 0.5); // (2) C++20 explicit binomial_distribution(const param_type& parm); // (3) ``` From 0622e399e01a52b5e8524319d5a1c457e3e0e5f9 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sun, 5 Nov 2023 21:02:54 +0900 Subject: [PATCH 0539/3948] fix some expression --- reference/span/span/begin.md | 2 +- reference/span/span/crbegin.md | 2 +- reference/span/span/crend.md | 2 +- reference/span/span/end.md | 2 +- reference/span/span/rbegin.md | 4 ++-- reference/span/span/rend.md | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/reference/span/span/begin.md b/reference/span/span/begin.md index 703b5f6416..5bbfa25e2d 100644 --- a/reference/span/span/begin.md +++ b/reference/span/span/begin.md @@ -43,7 +43,7 @@ int main() std::vector v = {1, 2, 3, 4, 5}; // vの先頭3要素を部分シーケンスとして参照する - std::span s = std::span(v).first(3); + std::span s = std::span(v).first(3); // (1) std::for_each(s.begin(), s.end(), [](int x) { diff --git a/reference/span/span/crbegin.md b/reference/span/span/crbegin.md index 731b1675ef..b322bc1c98 100644 --- a/reference/span/span/crbegin.md +++ b/reference/span/span/crbegin.md @@ -10,7 +10,7 @@ constexpr const_reverse_iterator crbegin() const noexcept; ``` ## 概要 -末尾要素の次を指すイテレータを取得する。 +末尾を指す読み取り専用逆イテレータを取得する。 ## 戻り値 diff --git a/reference/span/span/crend.md b/reference/span/span/crend.md index 3c2799b630..a69a4fab65 100644 --- a/reference/span/span/crend.md +++ b/reference/span/span/crend.md @@ -10,7 +10,7 @@ constexpr const_reverse_iterator crend() const noexcept; ``` ## 概要 -末尾要素の次を指すイテレータを取得する。 +先頭の前を指す読み取り専用逆イテレータを取得する。 ## 戻り値 diff --git a/reference/span/span/end.md b/reference/span/span/end.md index 2ee445c264..52a6931c2c 100644 --- a/reference/span/span/end.md +++ b/reference/span/span/end.md @@ -43,7 +43,7 @@ int main() std::vector v = {1, 2, 3, 4, 5}; // vの先頭3要素を部分シーケンスとして参照する - std::span s = std::span(v).first(3); + std::span s = std::span(v).first(3); // (1) std::for_each(s.begin(), s.end(), [](int x) { diff --git a/reference/span/span/rbegin.md b/reference/span/span/rbegin.md index fe6f8e9a6b..e54407d591 100644 --- a/reference/span/span/rbegin.md +++ b/reference/span/span/rbegin.md @@ -10,7 +10,7 @@ constexpr reverse_iterator rbegin() const noexcept; ``` ## 概要 -先頭要素を指す逆順イテレータを取得する。 +末尾要素を指す逆順イテレータを取得する。 ## 戻り値 @@ -42,7 +42,7 @@ int main() std::vector v = {1, 2, 3, 4, 5}; // vの先頭3要素を部分シーケンスとして参照する - std::span s = std::span(v).first(3); + std::span s = std::span(v).first(3); // 逆順に出力 std::for_each(s.rbegin(), s.rend(), [](int x) { diff --git a/reference/span/span/rend.md b/reference/span/span/rend.md index 5c08090cd3..6fb7fa9975 100644 --- a/reference/span/span/rend.md +++ b/reference/span/span/rend.md @@ -10,7 +10,7 @@ constexpr reverse_iterator rend() const noexcept; ``` ## 概要 -末尾要素の次を指す逆順イテレータを取得する。 +先頭要素の前を指す逆順イテレータを取得する。 ## 戻り値 @@ -42,7 +42,7 @@ int main() std::vector v = {1, 2, 3, 4, 5}; // vの先頭3要素を部分シーケンスとして参照する - std::span s = std::span(v).first(3); + std::span s = std::span(v).first(3); // 逆順に出力 std::for_each(s.rbegin(), s.rend(), [](int x) { From 1bf71dc803d140329e3690f6abaa004bb21b9c97 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sun, 5 Nov 2023 21:08:32 +0900 Subject: [PATCH 0540/3948] update information about charconv --- reference/charconv.md | 4 ++-- reference/charconv/from_chars.md | 2 +- reference/charconv/to_chars.md | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/reference/charconv.md b/reference/charconv.md index e994e9f045..bdbe03ca84 100644 --- a/reference/charconv.md +++ b/reference/charconv.md @@ -66,8 +66,8 @@ XMLやJSONに代表されるテキストベースのデータを利用するケ - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0(整数のみ) -- [GCC](/implementation.md#gcc): 8.0(整数のみ) +- [Clang](/implementation.md#clang): 7.0(整数のみ), 14.0(to_chars()のみ浮動小数点もsupport) +- [GCC](/implementation.md#gcc): 8.0(整数のみ), 11.1(full support) - [Visual C++](/implementation.md#visual_cpp): 2017 update 7(整数のみ), update 9(full support) ## 参照 diff --git a/reference/charconv/from_chars.md b/reference/charconv/from_chars.md index d23eec298d..855170e2ed 100644 --- a/reference/charconv/from_chars.md +++ b/reference/charconv/from_chars.md @@ -1,6 +1,6 @@ # from_chars * charconv[meta header] -* function template[meta id-type] +* function[meta id-type] * std[meta namespace] * cpp17[meta cpp] diff --git a/reference/charconv/to_chars.md b/reference/charconv/to_chars.md index aeb75e232b..5651022098 100644 --- a/reference/charconv/to_chars.md +++ b/reference/charconv/to_chars.md @@ -1,6 +1,6 @@ # to_chars * charconv[meta header] -* function template[meta id-type] +* function[meta id-type] * std[meta namespace] * cpp17[meta cpp] @@ -284,7 +284,7 @@ z - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0(整数のみ) +- [Clang](/implementation.md#clang): 7.0(整数のみ), 14.0(full support) - [GCC](/implementation.md#gcc): 8.0(整数のみ), 11.1(full support) - [Visual C++](/implementation.md#visual_cpp): 2017 update 7(整数のみ), update 9(full support) From 9a64346a2a1d30ebefdbc5136b08e9a8eaa8b5c9 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 8 Nov 2023 16:42:45 +0900 Subject: [PATCH 0541/3948] =?UTF-8?q?=E6=9C=AA=E5=88=9D=E6=9C=9F=E5=8C=96?= =?UTF-8?q?=E3=83=A1=E3=83=A2=E3=83=AA=E3=81=AB=E5=AF=BE=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=82=A2=E3=83=AB=E3=82=B4=E3=83=AA=E3=82=BA=E3=83=A0=E3=80=81?= =?UTF-8?q?=E4=BA=8B=E5=89=8D=E6=9D=A1=E4=BB=B6=E8=BF=BD=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/memory/uninitialized_copy.md | 3 +++ reference/memory/uninitialized_copy_n.md | 3 +++ reference/memory/uninitialized_move.md | 3 +++ reference/memory/uninitialized_move_n.md | 3 +++ 4 files changed, 12 insertions(+) diff --git a/reference/memory/uninitialized_copy.md b/reference/memory/uninitialized_copy.md index f1e3357735..28c94f27c1 100644 --- a/reference/memory/uninitialized_copy.md +++ b/reference/memory/uninitialized_copy.md @@ -25,6 +25,9 @@ namespace std { 入力範囲`[first, last)`のコピーを未初期化出力範囲`[result, )`に書き込む。 +## 事前条件 + +- イテレータ範囲`[result, result + (last - first))`が`[first, last)`と重ならないこと ## 効果 - C++03 : 以下と等価 diff --git a/reference/memory/uninitialized_copy_n.md b/reference/memory/uninitialized_copy_n.md index 374055f2af..930e382b28 100644 --- a/reference/memory/uninitialized_copy_n.md +++ b/reference/memory/uninitialized_copy_n.md @@ -26,6 +26,9 @@ namespace std { 入力イテレータ範囲`[first, first + n)`のコピーを未初期化出力イテレータ範囲`[result, result + n)`に書き込む。 +## 事前条件 + +- イテレータ範囲`[result, result + n)`が`[first, first + n)`と重ならないこと ## 効果 - C++11 : 以下と等価 diff --git a/reference/memory/uninitialized_move.md b/reference/memory/uninitialized_move.md index 790e61d870..b431ad1616 100644 --- a/reference/memory/uninitialized_move.md +++ b/reference/memory/uninitialized_move.md @@ -26,6 +26,9 @@ namespace std { 入力範囲`[first, last)`からムーブして未初期化出力範囲`[result, )`に書き込む。 +## 事前条件 + +- イテレータ範囲`[result, result + (last - first))`が`[first, last)`と重ならないこと ## 効果 以下と等価: diff --git a/reference/memory/uninitialized_move_n.md b/reference/memory/uninitialized_move_n.md index 8352c6f192..3af10f4860 100644 --- a/reference/memory/uninitialized_move_n.md +++ b/reference/memory/uninitialized_move_n.md @@ -26,6 +26,9 @@ namespace std { 入力イテレータ範囲`[first, first + n)`からムーブして未初期化出力イテレータ範囲`[result, )`に書き込む。 +## 事前条件 + +- イテレータ範囲`[result, result + n)`が`[first, first + n)`と重ならないこと ## 効果 以下と等価: From 2f67b2a41bf0aaac87dd465530ed1e7f299ec156 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 8 Nov 2023 17:06:05 +0900 Subject: [PATCH 0542/3948] =?UTF-8?q?=E6=9C=AA=E5=88=9D=E6=9C=9F=E5=8C=96?= =?UTF-8?q?=E3=83=A1=E3=83=A2=E3=83=AA=E3=81=AB=E5=AF=BE=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=82=A2=E3=83=AB=E3=82=B4=E3=83=AA=E3=82=BA=E3=83=A0=E3=80=81?= =?UTF-8?q?=E4=BE=8B=E5=A4=96=E7=99=BA=E7=94=9F=E6=99=82=E3=81=AE=E6=8C=AF?= =?UTF-8?q?=E3=82=8B=E8=88=9E=E3=81=84=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6?= =?UTF-8?q?=E8=BF=BD=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://eel.is/c++draft/specialized.algorithms#general-2 --- reference/memory/ranges_uninitialized_copy.md | 4 ++++ reference/memory/ranges_uninitialized_copy_n.md | 4 ++++ reference/memory/ranges_uninitialized_default_construct.md | 3 +++ reference/memory/ranges_uninitialized_default_construct_n.md | 3 +++ reference/memory/ranges_uninitialized_fill.md | 3 +++ reference/memory/ranges_uninitialized_fill_n.md | 3 +++ reference/memory/ranges_uninitialized_move.md | 5 +++++ reference/memory/ranges_uninitialized_move_n.md | 5 +++++ reference/memory/ranges_uninitialized_value_construct.md | 4 ++++ reference/memory/ranges_uninitialized_value_construct_n.md | 4 ++++ reference/memory/uninitialized_copy.md | 4 ++++ reference/memory/uninitialized_copy_n.md | 4 ++++ reference/memory/uninitialized_default_construct.md | 3 +++ reference/memory/uninitialized_default_construct_n.md | 3 +++ reference/memory/uninitialized_fill.md | 3 +++ reference/memory/uninitialized_fill_n.md | 3 +++ reference/memory/uninitialized_move.md | 3 +++ reference/memory/uninitialized_move_n.md | 3 +++ reference/memory/uninitialized_value_construct.md | 3 +++ reference/memory/uninitialized_value_construct_n.md | 4 ++++ 20 files changed, 71 insertions(+) diff --git a/reference/memory/ranges_uninitialized_copy.md b/reference/memory/ranges_uninitialized_copy.md index dea3cc027b..381a318742 100644 --- a/reference/memory/ranges_uninitialized_copy.md +++ b/reference/memory/ranges_uninitialized_copy.md @@ -83,6 +83,10 @@ return {std::move(ifirst), ofirst}; * iter_reference_t[link /reference/iterator/iter_reference_t.md] * std::move[link /reference/utility/move.md] +## 例外 + +呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 + ## 例 ```cpp example diff --git a/reference/memory/ranges_uninitialized_copy_n.md b/reference/memory/ranges_uninitialized_copy_n.md index 74ca629bc4..ba3edaebdc 100644 --- a/reference/memory/ranges_uninitialized_copy_n.md +++ b/reference/memory/ranges_uninitialized_copy_n.md @@ -63,6 +63,10 @@ return {std::move(t.in).base(), t.out}; * default_sentinel[link /reference/iterator/default_sentinel_t.md] * std::move[link /reference/utility/move.md] +## 例外 + +呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 + ## 例 ```cpp example diff --git a/reference/memory/ranges_uninitialized_default_construct.md b/reference/memory/ranges_uninitialized_default_construct.md index 1003a30963..7e4ae7e346 100644 --- a/reference/memory/ranges_uninitialized_default_construct.md +++ b/reference/memory/ranges_uninitialized_default_construct.md @@ -62,6 +62,9 @@ return first; * remove_reference_t[link /reference/type_traits/remove_reference.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] +## 例外 + +呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 ## 備考 - [`std::vector`](/reference/vector/vector.md)クラスの要素数を変更する操作は、要素を値構築するためゼロ初期化が行われる。その値初期化のコストが気になるような場合に、デフォルト構築することでプログラマの責任で必要な分だけ任意に初期化でき、パフォーマンス向上が期待できるようになる。 diff --git a/reference/memory/ranges_uninitialized_default_construct_n.md b/reference/memory/ranges_uninitialized_default_construct_n.md index 02dd22a2d6..e1ff737166 100644 --- a/reference/memory/ranges_uninitialized_default_construct_n.md +++ b/reference/memory/ranges_uninitialized_default_construct_n.md @@ -38,6 +38,9 @@ return uninitialized_default_construct(counted_iterator(first, n), * default_sentinel[link /reference/iterator/default_sentinel_t.md] * base()[link /reference/iterator/counted_iterator/base.md] +## 例外 + +呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 ## 例 ```cpp example diff --git a/reference/memory/ranges_uninitialized_fill.md b/reference/memory/ranges_uninitialized_fill.md index a4df77097b..27c6f35d0c 100644 --- a/reference/memory/ranges_uninitialized_fill.md +++ b/reference/memory/ranges_uninitialized_fill.md @@ -66,6 +66,9 @@ return first; * remove_reference_t[link /reference/type_traits/remove_reference.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] +## 例外 + +呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 ## 例 ```cpp example diff --git a/reference/memory/ranges_uninitialized_fill_n.md b/reference/memory/ranges_uninitialized_fill_n.md index 8b4a686ce4..4490ea5693 100644 --- a/reference/memory/ranges_uninitialized_fill_n.md +++ b/reference/memory/ranges_uninitialized_fill_n.md @@ -37,6 +37,9 @@ return uninitialized_fill(counted_iterator(first, n), default_sentinel, x).base( * default_sentinel[link /reference/iterator/default_sentinel_t.md] * base()[link /reference/iterator/counted_iterator/base.md] +## 例外 + +呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 ## 例 ```cpp example diff --git a/reference/memory/ranges_uninitialized_move.md b/reference/memory/ranges_uninitialized_move.md index 37ae4a90f7..d19f2cb1d5 100644 --- a/reference/memory/ranges_uninitialized_move.md +++ b/reference/memory/ranges_uninitialized_move.md @@ -84,6 +84,11 @@ return {std::move(ifirst), ofirst}; * std::move[link /reference/utility/move.md] * ranges::iter_move[link /reference/iterator/iter_move.md] +## 例外 + +呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 + +またその場合、`[ifirst, ilast)`内の一部のオブジェクトは有効だが未規定な状態として残される。 ## 例 ```cpp example diff --git a/reference/memory/ranges_uninitialized_move_n.md b/reference/memory/ranges_uninitialized_move_n.md index 5dbc814bba..0b646f6a38 100644 --- a/reference/memory/ranges_uninitialized_move_n.md +++ b/reference/memory/ranges_uninitialized_move_n.md @@ -63,6 +63,11 @@ return {std::move(t.in).base(), t.out}; * default_sentinel[link /reference/iterator/default_sentinel_t.md] * std::move[link /reference/utility/move.md] +## 例外 + +呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 + +またその場合、`[ifirst, ifirst + n)`内の一部のオブジェクトは有効だが未規定な状態として残される。 ## 例 ```cpp example diff --git a/reference/memory/ranges_uninitialized_value_construct.md b/reference/memory/ranges_uninitialized_value_construct.md index 32ae40a9f6..2d26b966a1 100644 --- a/reference/memory/ranges_uninitialized_value_construct.md +++ b/reference/memory/ranges_uninitialized_value_construct.md @@ -62,6 +62,10 @@ return first; * remove_reference_t[link /reference/type_traits/remove_reference.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] +## 例外 + +呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 + ## 例 ```cpp example diff --git a/reference/memory/ranges_uninitialized_value_construct_n.md b/reference/memory/ranges_uninitialized_value_construct_n.md index 107825ab34..ba2cf6981a 100644 --- a/reference/memory/ranges_uninitialized_value_construct_n.md +++ b/reference/memory/ranges_uninitialized_value_construct_n.md @@ -38,6 +38,10 @@ return uninitialized_value_construct(counted_iterator(first, n), * default_sentinel[link /reference/iterator/default_sentinel_t.md] * base()[link /reference/iterator/counted_iterator/base.md] +## 例外 + +呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 + ## 例 ```cpp example diff --git a/reference/memory/uninitialized_copy.md b/reference/memory/uninitialized_copy.md index 28c94f27c1..0f985d8729 100644 --- a/reference/memory/uninitialized_copy.md +++ b/reference/memory/uninitialized_copy.md @@ -51,6 +51,10 @@ namespace std { ## 戻り値 `result` +## 例外 + +呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 + ### 例 ```cpp example diff --git a/reference/memory/uninitialized_copy_n.md b/reference/memory/uninitialized_copy_n.md index 930e382b28..461b339bae 100644 --- a/reference/memory/uninitialized_copy_n.md +++ b/reference/memory/uninitialized_copy_n.md @@ -54,6 +54,10 @@ namespace std { ## 戻り値 `result` +## 例外 + +呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 + ### 例 ```cpp example diff --git a/reference/memory/uninitialized_default_construct.md b/reference/memory/uninitialized_default_construct.md index 6fdf2633f3..d3b092fa59 100644 --- a/reference/memory/uninitialized_default_construct.md +++ b/reference/memory/uninitialized_default_construct.md @@ -38,6 +38,9 @@ for (; first != last; ++first) ## 戻り値 なし +## 例外 + +呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 ## 備考 - [`std::vector`](/reference/vector/vector.md)クラスの要素数を変更する操作は、要素を値構築するためゼロ初期化が行われる。その値初期化のコストが気になるような場合に、デフォルト構築することでプログラマの責任で必要な分だけ任意に初期化でき、パフォーマンス向上が期待できるようになる。 diff --git a/reference/memory/uninitialized_default_construct_n.md b/reference/memory/uninitialized_default_construct_n.md index 18919f6157..40207f3335 100644 --- a/reference/memory/uninitialized_default_construct_n.md +++ b/reference/memory/uninitialized_default_construct_n.md @@ -37,6 +37,9 @@ return first; * addressof[link addressof.md] * iterator_traits[link /reference/iterator/iterator_traits.md] +## 例外 + +呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 ## 備考 - [`std::vector`](/reference/vector/vector.md)クラスの要素数を変更する操作は、要素を値構築するためゼロ初期化が行われる。その値初期化のコストが気になるような場合に、デフォルト構築することでプログラマの責任で必要な分だけ任意に初期化でき、パフォーマンス向上が期待できるようになる。 diff --git a/reference/memory/uninitialized_fill.md b/reference/memory/uninitialized_fill.md index 59d8a5dcde..ec93f3fb3f 100644 --- a/reference/memory/uninitialized_fill.md +++ b/reference/memory/uninitialized_fill.md @@ -46,6 +46,9 @@ namespace std { ## 戻り値 なし +## 例外 + +呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 ### 例 ```cpp example diff --git a/reference/memory/uninitialized_fill_n.md b/reference/memory/uninitialized_fill_n.md index 5e362ff294..03dd5c8488 100644 --- a/reference/memory/uninitialized_fill_n.md +++ b/reference/memory/uninitialized_fill_n.md @@ -48,6 +48,9 @@ namespace std { ## 戻り値 `first` +## 例外 + +呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 ### 例 ```cpp example diff --git a/reference/memory/uninitialized_move.md b/reference/memory/uninitialized_move.md index b431ad1616..bc78fbf44f 100644 --- a/reference/memory/uninitialized_move.md +++ b/reference/memory/uninitialized_move.md @@ -46,6 +46,9 @@ for (; first != last; ++result, ++first) ## 戻り値 `result` +## 例外 + +呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 ### 例 ```cpp example diff --git a/reference/memory/uninitialized_move_n.md b/reference/memory/uninitialized_move_n.md index 3af10f4860..26888fc1a2 100644 --- a/reference/memory/uninitialized_move_n.md +++ b/reference/memory/uninitialized_move_n.md @@ -46,6 +46,9 @@ for (; n > 0; ++result, (void)++first, --n) ## 戻り値 `{first, result}` +## 例外 + +呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 ### 例 ```cpp example diff --git a/reference/memory/uninitialized_value_construct.md b/reference/memory/uninitialized_value_construct.md index 4f27319ed9..ed381b073f 100644 --- a/reference/memory/uninitialized_value_construct.md +++ b/reference/memory/uninitialized_value_construct.md @@ -38,6 +38,9 @@ for (; first != last; ++first) ## 戻り値 なし +## 例外 + +呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 ### 例 ```cpp example diff --git a/reference/memory/uninitialized_value_construct_n.md b/reference/memory/uninitialized_value_construct_n.md index 5645f18724..f27882d749 100644 --- a/reference/memory/uninitialized_value_construct_n.md +++ b/reference/memory/uninitialized_value_construct_n.md @@ -37,6 +37,10 @@ return first; * addressof[link addressof.md] * iterator_traits[link /reference/iterator/iterator_traits.md] +## 例外 + +呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 + ### 例 ```cpp example From 118d5b9ebee27d1a04c52bf9c0bfdadd7f940b37 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 9 Nov 2023 01:46:27 +0900 Subject: [PATCH 0543/3948] =?UTF-8?q?tuple/apply=20:=20Git=E3=81=AE?= =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=83=95=E3=83=AA=E3=82=AF=E3=83=88=E3=82=B3?= =?UTF-8?q?=E3=83=A1=E3=83=B3=E3=83=88=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/script/ngword_check.py | 2 ++ reference/tuple/apply.md | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/script/ngword_check.py b/.github/workflows/script/ngword_check.py index ed62e31a24..ddcde69755 100644 --- a/.github/workflows/script/ngword_check.py +++ b/.github/workflows/script/ngword_check.py @@ -22,6 +22,8 @@ ("", "std::range::", "std::ranges::"), ("", "swtich", "switch"), ("", "voaltile", "volatile"), + ("", "Updated upstream", ""), + ("", "Stashed changes", ""), ("", "子ルーチン", "コルーチン"), ("", "移譲", "委譲"), ("", r'型]\((.*?)\)型', "型](link)"), diff --git a/reference/tuple/apply.md b/reference/tuple/apply.md index cd65bab1bd..f78a536d59 100644 --- a/reference/tuple/apply.md +++ b/reference/tuple/apply.md @@ -17,10 +17,7 @@ namespace std { ``` * tuple-like[link tuple-like.md] * tuple-like[link tuple-like.md] -<<<<<<< Updated upstream * see below[italic] -======= ->>>>>>> Stashed changes ## 概要 タプルを展開し、関数の引数に適用してその関数を実行する。 From cc748a66a57065cd020e019f780845390e3026f8 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 9 Nov 2023 16:27:29 +0900 Subject: [PATCH 0544/3948] =?UTF-8?q?=E3=82=B9=E3=83=9D=E3=83=B3=E3=82=B5?= =?UTF-8?q?=E3=83=BC=E6=9B=B4=E6=96=B0=20#1212?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/index.md b/index.md index 7c24768e9f..1271f020fc 100644 --- a/index.md +++ b/index.md @@ -93,18 +93,17 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい ### ブロンズスポンサー -- イシハラユウヤ様 -- [Megumi Nakagami様](https://opencollective.com/meg_nakagami) - +
odan
-
minachun / J.Minami
+
unagi
+- [nodchip](https://twitter.com/nodchip) -### 一時スポンサー +- イシハラユウヤ様 +- [Megumi Nakagami様](https://opencollective.com/meg_nakagami) -
odan
-
unagi
+
minachun / J.Minami
- [Hashitaku様](https://opencollective.com/hashitaku) From 67a300dab35d0679a014d96c6e2669903a5012e2 Mon Sep 17 00:00:00 2001 From: Akiko Kawai Date: Sat, 11 Nov 2023 15:22:08 +0900 Subject: [PATCH 0545/3948] Updated implimentation status of Clang about c++23 --- implementation-status.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/implementation-status.md b/implementation-status.md index b20cda55c3..6398d41e56 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -226,7 +226,7 @@ | P0388R4: [要素数不明の配列への変換を許可](/lang/cpp20/permit_conversions_to_arrays_of_unknown_bound.md) | 要素数が判明している配列から、要素数が不明の配列への変換を許可 | 10 | 14 | 2021.6 | 2019 Update 7 | | P1143R2: [コンパイル時初期化を強制する`constinit`キーワードを追加](/lang/cpp20/constinit.md) | 初期化のみコンパイル時におわらせたい場合に使用する | 10 | 10.0 | | 2019 Update 10 | | P1152R4: [ほとんどの`volatile`を非推奨化](/lang/cpp20/deprecating_volatile.md) | `volatile`の有用な機能のみを残し、効果が疑わしい、または壊れている機能を非推奨化する | 10 | 10.0 | 2021.6 | 2019 Update 7 | -| P1814R0: [エイリアステンプレート経由でのクラステンプレートのテンプレート引数推論](/lang/cpp20/class_template_argument_deduction_for_alias_templates.md) | エイリアステンプレートからクラステンプレートのテンプレート引数を推論できるようにする | 10 | | | 2019 Update 7 | +| P1814R0: [エイリアステンプレート経由でのクラステンプレートのテンプレート引数推論](/lang/cpp20/class_template_argument_deduction_for_alias_templates.md) | エイリアステンプレートからクラステンプレートのテンプレート引数を推論できるようにする | 10 | No | | 2019 Update 7 | | P0784R7: [可変サイズをもつコンテナの`constexpr`化](/lang/cpp20/more_constexpr_containers.md) | `constexpr`記憶域をもつメモリアロケータの存在を考慮することで、可変サイズをもつコンテナをコンパイル時に使用できるようにする | 10 | 10.0 | 2021.6 | 2019 Update 9 | | P1957R2: [ポインタから`bool`への変換を縮小変換とする](/lang/cpp20/converting_from_pointer_to_bool_should_be_considered_narrowing.md) | ポインタから`bool`値への変換を縮小変換と規定することで、意図しない変換を防止する | 10 | 11.0 | | 2019 Update 7 | @@ -255,7 +255,7 @@ | P2360R0: [初期化文での型の別名宣言を許可](/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md.nolink) | `for (using T = int; T e : v) {}`を許可 | 12 | 14 | 2022.2 | - | | P2718R0: [範囲for文が範囲への参照を延命することを規定](lang/cpp23/lifetime_extension_in_range_based_for_loop.md.nolink) | | - | - | - | - | | P2324R2: [関数末尾のラベルを許可](/lang/cpp23/labels_at_the_end_of_compound_statements.md.nolink) | C互換のため、関数末尾でのgoto文のラベルを許可する | 13 | 16 | - | - | -| P0847R7: [自身のオブジェクトを明示的にパラメータとして指定する](/lang/cpp23/deducing_this.md.nolink) | メンバ関数が`*this`の型・オブジェクトをパラメータとしてとり、`*this`オブジェクトがconst/非const、左辺値/右辺値であるかをメンバ関数内で識別できるようにする | - | - | - | 2022 Update 2 (partial) | +| P0847R7: [自身のオブジェクトを明示的にパラメータとして指定する](/lang/cpp23/deducing_this.md.nolink) | メンバ関数が`*this`の型・オブジェクトをパラメータとしてとり、`*this`オブジェクトがconst/非const、左辺値/右辺値であるかをメンバ関数内で識別できるようにする | - | 18 | - | 2022 Update 2 (partial) | | P1847R4: [アクセス制御の異なるメンバ変数のレイアウトを宣言順に規定](/lang/cpp23/make_declaration_order_layout_mandated.md.nolink) | アクセス制御の異なるメンバ変数のレイアウトが実装によって異なっていたため仕様を規定 | Yes | Yes | - | 2022 | | P2128R6: [添字演算子の多次元サポート](/lang/cpp23/multidimensional_subscript_operator.nd.nolink) | `operator[](int x, int y, int z)`のように添字演算子のオーバーロードで複数のパラメータをとることを許可 | 12 | 15 | 2022.2 | - | | P1169R4: [`this`ポインタをもつ必要のない演算子を`static`として宣言できるようにする](/lang/cpp23/static_operator.md.nolink) | | 13 | 16 | - | - | @@ -269,9 +269,9 @@ | P1401R5 : [定数式の文脈での`bool`への縮小変換を許可](/lang/cpp23/narrowing_contextual_conversions_to_bool.md.nolink) | `if constexpr(flags & Flags::Exec)`や`static_assert(N);`を許可 | 9 | 13 | - | - | | P2242R3: [定数式内での非リテラル変数の使用を含められないようにする](/lang/cpp23/non_literal_variables_in_constexpr_functions.md.nolink) | 定数式内で静的変数・スレッドローカル変数およびgoto文とラベルを含められない制限を設ける | 12 | 15 | - | - | | P2246R1: [静的な診断メッセージの文字エンコーディング](/lang/cpp23/character_encoding_of_diagnostic_text.md.nolink) | `static_assert`や`[[deprecated]]`などの診断メッセージの文字集合に関する要件をなくす | - | yes | - | 2022 | -| P2448R2: [`constexpr`関数のすべての引数が定数実行できない場合でも適格とする](/lang/cpp23/relaxing_some_constexpr_restrictions.md.nolink) | | 13 | - | - | - | -| P2647R1: [`constexpr`関数内での`static constexpr`変数を許可](/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md.nolink) | | - | - | - | - | -| P2564R3: [`constexpr`関数内で`consteval`関数を呼び出せない問題を緩和](/lang/cpp23/consteval_needs_to_propagate_up.md.nolink) | | - | - | - | - | +| P2448R2: [`constexpr`関数のすべての引数が定数実行できない場合でも適格とする](/lang/cpp23/relaxing_some_constexpr_restrictions.md.nolink) | | 13 | 17 (partial) | - | - | +| P2647R1: [`constexpr`関数内での`static constexpr`変数を許可](/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md.nolink) | | - | 16 | - | - | +| P2564R3: [`constexpr`関数内で`consteval`関数を呼び出せない問題を緩和](/lang/cpp23/consteval_needs_to_propagate_up.md.nolink) | | - | 17 | - | - | | P1102R2: [ラムダ式で`()`を省略できる条件を緩和](/lang/cpp23/down_with_lambda_parens.md.nolink) | キャプチャや修飾をともなってもパラメータリストが空であれば`()`を省略できる | 11 | 13 | - | - | | P2173R1: [ラムダ式に対する属性](/lang/cpp23/attributes_on_lambda_expressions.md.nolink) | ラムダ式のいくつかの箇所に属性を記述できるようにする | 9 | 13 | - | - | | P1774R8: [コード内容の仮定をコンパイラに伝えるassume属性](/lang/cpp23/portable_assumptions.md) | 最適化のために、コードの仮定をコンパイラに伝える属性を標準化する | 13 | - | - | - | From 407947b424bc1f4f868a938453cb8c2eee2c0ab4 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sat, 11 Nov 2023 18:04:32 +0900 Subject: [PATCH 0546/3948] fix some typo --- reference/bit/bit_ceil.md | 3 +-- reference/forward_list/forward_list/remove.md | 2 +- reference/forward_list/forward_list/remove_if.md | 2 +- reference/list/list/remove.md | 2 +- reference/list/list/remove_if.md | 2 +- reference/source_location/source_location/current.md | 4 ++-- reference/stop_token/stop_token/op_not_equal.md | 2 +- reference/system_error/error_category.md | 4 ++-- reference/system_error/error_code.md | 2 +- reference/system_error/error_condition.md | 2 +- reference/thread/thread/id.md | 8 ++++---- 11 files changed, 16 insertions(+), 17 deletions(-) diff --git a/reference/bit/bit_ceil.md b/reference/bit/bit_ceil.md index 899e90f815..6dff70a379 100644 --- a/reference/bit/bit_ceil.md +++ b/reference/bit/bit_ceil.md @@ -20,8 +20,7 @@ namespace std { ## 事前条件 -- `x`以上となる最小の2の累乗値を`N`として、 -- 型`T`において値`N`が表現できること +- `x`以上となる最小の2の累乗値を`N`として、型`T`において値`N`が表現できること ## 戻り値 `N`を返す diff --git a/reference/forward_list/forward_list/remove.md b/reference/forward_list/forward_list/remove.md index c9c1f9c773..38088c749b 100644 --- a/reference/forward_list/forward_list/remove.md +++ b/reference/forward_list/forward_list/remove.md @@ -30,7 +30,7 @@ size_type remove(const T& value); // (1) C++20 ## 計算量 -ちょうど`x`の要素数回だけ等値比較を行う +ちょうど`distance(begin(), end())`回だけ等値比較を行う ## 例 diff --git a/reference/forward_list/forward_list/remove_if.md b/reference/forward_list/forward_list/remove_if.md index c607c7a3a4..c708f24c54 100644 --- a/reference/forward_list/forward_list/remove_if.md +++ b/reference/forward_list/forward_list/remove_if.md @@ -33,7 +33,7 @@ size_type remove_if(Predicate pred); // (1) C++20 ## 計算量 -ちょうど`x`の要素数回だけ述語を適用する +ちょうど`distance(begin(), end())`回だけ述語を適用する ## 例 diff --git a/reference/list/list/remove.md b/reference/list/list/remove.md index 252a2dbd27..2d2a70a5c1 100644 --- a/reference/list/list/remove.md +++ b/reference/list/list/remove.md @@ -28,7 +28,7 @@ size_type remove(const T& value); // (1) C++20 ## 計算量 -ちょうど`x`の要素数回だけ等値比較を行う +ちょうど`size()`回だけ等値比較を行う ## 例 diff --git a/reference/list/list/remove_if.md b/reference/list/list/remove_if.md index 0c23c143a6..12ce40889b 100644 --- a/reference/list/list/remove_if.md +++ b/reference/list/list/remove_if.md @@ -31,7 +31,7 @@ size_type remove_if(Predicate pred); // (1) C++20 ## 計算量 -ちょうど`x`の要素数回だけ述語を適用する +ちょうど`size()`回だけ述語を適用する ## 例 diff --git a/reference/source_location/source_location/current.md b/reference/source_location/source_location/current.md index 0eb4905fea..3f4af27b74 100644 --- a/reference/source_location/source_location/current.md +++ b/reference/source_location/source_location/current.md @@ -68,10 +68,10 @@ void func(source_location a = source_location::current()) { } int main() { - f(); // (2) + func(); // (2) source_location c = source_location::current(); - f(c); // (3) + func(c); // (3) } ``` diff --git a/reference/stop_token/stop_token/op_not_equal.md b/reference/stop_token/stop_token/op_not_equal.md index 0da38710ec..c62e1facca 100644 --- a/reference/stop_token/stop_token/op_not_equal.md +++ b/reference/stop_token/stop_token/op_not_equal.md @@ -14,7 +14,7 @@ namespace std { `stop_token`オブジェクトの非等値比較を行う。 ## 戻り値 -`!(x == y)` +`!(lhs == rhs)` ## 例外 投げない。 diff --git a/reference/system_error/error_category.md b/reference/system_error/error_category.md index 26ee36c2dd..bde401d72d 100644 --- a/reference/system_error/error_category.md +++ b/reference/system_error/error_category.md @@ -31,8 +31,8 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`equivalent`](error_category/equivalent.md) | エラーコードとエラー状態の等値比較 | C++11 | -| [`operator==`](error_category/op_equal.md) | 等値比較 (C++20から`operator<=>`により使用可能) | C++11 | -| [`operator!=`](error_category/op_not_equal.md) | 非等値比較 | C++11 | +| [`operator==`](error_category/op_equal.md) | 等値比較 | C++11 | +| [`operator!=`](error_category/op_not_equal.md) | 非等値比較 (C++20から`operator==`により使用可能) | C++11 | | [`operator<=>`](error_category/op_compare_3way.md) | 三方比較 | C++20 | | [`operator<`](error_category/op_less.md) | 左辺が右辺より小さいか比較 (C++20から`operator<=>`により使用可能) | C++11 | | `bool operator<=(const error_category&) const noexcept;` | 左辺が右辺以下か比較 (`operator<=>`により使用可能) | C++20 | diff --git a/reference/system_error/error_code.md b/reference/system_error/error_code.md index d2b1e46f3a..705e8b446f 100644 --- a/reference/system_error/error_code.md +++ b/reference/system_error/error_code.md @@ -37,7 +37,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`operator==`](op_equal.md) | 等値比較 | C++11 | -| [`operator!=`](op_not_equal.md) | 非等値比較 (C++20から`operator<=>`により使用可能) | C++11 | +| [`operator!=`](op_not_equal.md) | 非等値比較 (C++20から`operator==`により使用可能) | C++11 | | [`operator<=>`](error_code/op_compare_3way.md) | 三方比較 | C++20 | | [`operator<`](error_code/op_less.md) | 左辺が右辺より小さいか判定する (C++20から`operator<=>`により使用可能) | C++11 | | `bool operator<=(const error_code&, const error_code&) noexcept;` | 左辺が右辺以下か判定する (`operator<=>`により使用可能) | C++20 | diff --git a/reference/system_error/error_condition.md b/reference/system_error/error_condition.md index f4579823de..39fea2f8b1 100644 --- a/reference/system_error/error_condition.md +++ b/reference/system_error/error_condition.md @@ -40,7 +40,7 @@ Visual C++ 2010、GCC 4.6.1では[`generic_category()`](generic_category.md)と[ | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`operator==`](op_equal.md) | 等値比較 | C++11 | -| [`operator!=`](op_not_equal.md) | 非等値比較 (C++20から`operator<=>`により使用可能) | C++11 | +| [`operator!=`](op_not_equal.md) | 非等値比較 (C++20から`operator==`により使用可能) | C++11 | | [`operator<=>`](error_condition/op_compare_3way.md) | 三方比較 | C++20 | | [`operator<`](error_condition/op_less.md) | 左辺が右辺より小さいか判定する (C++20から`operator<=>`により使用可能) | C++11 | | `bool operator<=(const error_condition&, const error_condition&) noexcept;` | 左辺が右辺以下か判定する (`operator<=>`により使用可能) | C++20 | diff --git a/reference/thread/thread/id.md b/reference/thread/thread/id.md index e2be00e8a2..2c2e9cc7a2 100644 --- a/reference/thread/thread/id.md +++ b/reference/thread/thread/id.md @@ -49,10 +49,10 @@ namespace std { |--------------|------------------------------------|-------| | `operator==` | 等値比較 | C++11 | | `operator!=` | 非等値比較 (C++20から`operator==`により使用可能) | C++11 | -| `operator<` | 左辺が右辺より小さいかの判定を行う (C++20から`operator==`により使用可能) | C++11 | -| `operator<=` | 左辺が右辺以下かの判定を行う (C++20から`operator==`により使用可能) | C++11 | -| `operator>` | 左辺が右辺より大きいかの判定を行う (C++20から`operator==`により使用可能) | C++11 | -| `operator>=` | 左辺が右辺以上かの判定を行う (C++20から`operator==`により使用可能) | C++11 | +| `operator<` | 左辺が右辺より小さいかの判定を行う (C++20から`operator<=>`により使用可能) | C++11 | +| `operator<=` | 左辺が右辺以下かの判定を行う (C++20から`operator<=>`により使用可能) | C++11 | +| `operator>` | 左辺が右辺より大きいかの判定を行う (C++20から`operator<=>`により使用可能) | C++11 | +| `operator>=` | 左辺が右辺以上かの判定を行う (C++20から`operator<=>`により使用可能) | C++11 | | `strong_ordering operator<=>(thread::id x, thread::id y) noexcept;` | 三方比較 | C++20 | ### ストリーム出力 From 2c212294315aec84f90a1540a7a39ae621c5c073 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sun, 12 Nov 2023 06:26:22 +0900 Subject: [PATCH 0547/3948] =?UTF-8?q?ios=5Fbase=20:=20=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=89=E4=BF=AE=E9=A3=BE=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ios/ios_base.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/ios/ios_base.md b/reference/ios/ios_base.md index 79bc3be2b6..53bc93b1c2 100644 --- a/reference/ios/ios_base.md +++ b/reference/ios/ios_base.md @@ -10,7 +10,7 @@ namespace std { ``` ## 概要 -ios_baseは入出力クラスの基底となるクラスである。すべてのクラスで共通の処理や定数などが定義されている。 +`ios_base`は入出力クラスの基底となるクラスである。すべてのクラスで共通の処理や定数などが定義されている。 ## メンバ関数 ### 構築・破棄・代入 From e30c3ae988aed71a6df562fd71062079949a1d4e Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sun, 12 Nov 2023 06:34:48 +0900 Subject: [PATCH 0548/3948] =?UTF-8?q?ios=5Fbase::openmode=20:=20C++23?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C=E3=81=A8=E3=81=97=E3=81=A6noreplace=E3=83=95?= =?UTF-8?q?=E3=83=A9=E3=82=B0=E3=82=92=E8=BF=BD=E5=8A=A0=20(close=20#1094)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ios/ios_base/type-openmode.md | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/reference/ios/ios_base/type-openmode.md b/reference/ios/ios_base/type-openmode.md index 4bce2140ee..034a5f9ef3 100644 --- a/reference/ios/ios_base/type-openmode.md +++ b/reference/ios/ios_base/type-openmode.md @@ -15,14 +15,15 @@ using openmode = T3; `openmode` はストリームのオープンモードを指定するためのビットマスク型である。 `openmode` には以下の表のようなビットマスク値が存在し、全て [`ios_base`](../ios_base.md) の静的メンバ定数として定義されている。 -| 定数 | 設定された場合の効果 | -|------|----------------------| -| `app` | 各書き込み(出力)の前に、ストリームの最後にシークする。(append の略) | -| `ate` | ストリームのオープン直後に、ストリームの最後にシークする。(at end の略) | -| `binary` | 入出力をバイナリで行う。(テキストモードの反対) | -| `in` | 入力のためにオープンする。 | -| `out` | 出力のためにオープンする。 | -| `trunc` | 既存のストリームをオープンする際に、ストリームの内容を切り詰める。(truncate の略) | +| 定数 | 設定された場合の効果 | 対応バージョン | +|------|----------------------|----------------| +| `app` | 各書き込み(出力)の前に、ストリームの最後にシークする(append の略) | | +| `ate` | ストリームのオープン直後に、ストリームの最後にシークする(at end の略) | | +| `binary` | 入出力をバイナリで行う(テキストモードの反対) | | +| `in` | 入力のためにオープンする | | +| `out` | 出力のためにオープンする | | +| `noreplace` | 出力のために新規作成でオープンする。ファイルが存在している場合はエラー | C++23 | +| `trunc` | 既存のストリームをオープンする際に、ストリームの内容を切り詰める(truncate の略) | | ## 例 @@ -136,3 +137,8 @@ test1TE2ST3 - [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0, 4.9.1, 4.9.2, 5.1.0, 5.2.0, 6.0.0 - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2467R1 Support exclusive mode for fstreams](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2467r1.html) + - C++23での`noreplace`の追加 From f0d163cc2a32541706d85087b60957b133e87288 Mon Sep 17 00:00:00 2001 From: Akiko Kawai Date: Mon, 13 Nov 2023 12:20:34 +0900 Subject: [PATCH 0549/3948] Updated implimentation status of ICC about c++20 --- implementation-status.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/implementation-status.md b/implementation-status.md index 6398d41e56..d4944ce856 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -198,7 +198,7 @@ | P0479R5: [確率が高い分岐と低い分岐を伝える属性 `[[likely]]`, `[[unlikely]]`](/lang/cpp20/likely_and_unlikely_attributes.md) | 条件分岐の最適化ヒントを与える属性 | 9 (partial, `switch` 文のみ可能)
10 | 12.0 | 2021.7 | 2019 Update 6 | | P0929R2: [抽象型のチェック](/lang/cpp20/checking_for_abstract_class_types.md) | 関数の宣言段階では、パラメータおよび戻り値型が抽象型かどうかをチェックしないようにする | 11 | | | 2019 Update 5 | | P0732R2: [非型テンプレートパラメータとしてクラス型を許可する](/lang/cpp20/class_types_in_non-type_template_parameters.md) | 定数式として使用できる型を広く非型テンプレートパラメータとして使用できるようにする | 9 | partial | 2022.2 Partial | 2019 Update 6 | -| P0722R3: [可変長データを扱うクラスの効率的な`delete`](/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md) | クラスの`delete`演算子が呼び出される前にデストラクタが呼ばれないようにするオプションを追加 | 9 | 6.0 | | 2019 Update 7 | +| P0722R3: [可変長データを扱うクラスの効率的な`delete`](/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md) | クラスの`delete`演算子が呼び出される前にデストラクタが呼ばれないようにするオプションを追加 | 9 | 6.0 | 2023.0 | 2019 Update 7 | | P1064R0: [定数式からの仮想関数の呼び出しを許可](/lang/cpp20/allow_virtual_function_calls_in_constant_expressions.md) | 仮想関数に`constexpr`を付けられない制限を解除 | 9 | 9.0 | 2021.4 | 2019 Update 9 | | P1327R1: [定数式での`dynamic_cast`、多態的な`typeid`を許可](/lang/cpp20/allowing_dynamic_cast_polymorphic_typeid_in_constant_expressions.md) | 定数式での動的多態を許可 | 10 | 9.0 | 2021.4 | 2019 Update 9 | | P1002R1: [constexpr関数内でのtry-catchブロックを許可](/lang/cpp20/try-catch_blocks_in_constexpr_functions.md) | constexpr関数内でtry-catchブロックを書けるようにする | 9 | 8.0 | 2021.4 (2021.6 は未対応) | 2019 Update 5 | @@ -206,25 +206,25 @@ | P1330R0: [定数式内での共用体のアクティブメンバの変更を許可](/lang/cpp20/changing_the_active_member_of_a_union_inside_constexpr.md) | 共用体メンバの書き換えを定数式内で行えるようにする | 9 | 9.0 | 2021.4 | 2017 | | P1008R1: [ユーザー宣言したコンストラクタを持つクラスの集成体初期化を禁止](/lang/cpp20/prohibit_aggregates_with_user-declared_constructors.md) | コンストラクタが`delete`/`default`宣言されているクラスを、集成体初期化によってコンストラクタ呼び出しを回避して構築できてしまっていた技法を禁止 | 9 | 8.0 | 2021.4 | 2019 | | P0892R2: [関数を条件付きで`explicit`にする構文を追加](/lang/cpp20/explicit_bool.md) | `explicit(true)`のように`explicit`に真理値パラメータを指定できるようにする | 9 | 9.0 | 2021.4 | 2019 Update 2 | -| P1236R1: [符号付き整数型が2の補数表現であることを規定](/lang/cpp20/signed_integers_are_twos_complement.md) | 符号付き整数型のビット表現を2の補数に規定する | 9 | 9.0 | | | +| P1236R1: [符号付き整数型が2の補数表現であることを規定](/lang/cpp20/signed_integers_are_twos_complement.md) | 符号付き整数型のビット表現を2の補数に規定する | 9 | 9.0 | 2023.0 | | | P0482R6: [UTF-8エンコーディングされた文字の型として`char8_t`を追加](/lang/cpp20/char8_t.md) | UTF-8エンコードされた文字かどうかでオーバーロード・特殊化をできるようにする | 9 | 7 (`-fchar8_t`オプションが必要) | 2021.4 | 2019 Update 2 | | P1094R2: [入れ子名前空間定義でのインライン名前空間](/lang/cpp20/nested_inline_mamespaces.md) | `namespace ns1::inline ns2::ns3 {}`のように、入れ子名前空間を定義する式にインライン名前空間の指定を含められるようにする | 9 | 8.0 | 2021.4 | 2019 Update 7 | | P1091R3: [構造化束縛を拡張して通常の変数宣言のように使用できるようにする](/lang/cpp20/extending_structured_bindings_to_be_more_like_variable_declarations.md) | 記憶域指定子として`static`と`thread_local`の指定を許可 | 10 | 8.0 (partial) | 2021.4 | 2019 Update 4 | | P1381R1: [構造化束縛した変数の参照キャプチャを許可](/lang/cpp20/reference_capture_of_structured_bindings.md) | 構造化束縛をした変数は特殊な扱いのためラムダ式で参照キャプチャできない規定となっていたがこれを許可する | 8 | 8.0 (partial) | 2021.4 | 2017 Update 3 | | P0960R3: [丸カッコの値リストからの集成体初期化を許可](/lang/cpp20/allow_initializing_aggregates_from_a_parenthesized_list_of_values.md) | `T x{1, 2, 3};`と同様に`T x(1, 2, 3);`でも集成体初期化できるようにする | 10 | No | 2021.4 | 2019 Update 8 | | P1009R2: [`new`式での配列要素数の推論](/lang/cpp20/array_size_deduction_in_new-expressions.md) | `double* p = new double[]{1,2,3};`を許可 | 11 | 9 | 2021.4 | 2019 Update 7 | -| P1041R4: [`char16_t`と`char32_t`の文字・文字列リテラルを、文字コードUTF-16/32に規定](/lang/cpp20/make_char16t_char32t_string_literals_be_utf16_32.md) | `__STDC_UTF_16__`、`__STDC_UTF_32__`の定義に関係なく、`char16_t`、`char32_t`のリテラルをUTF-16/32文字コードに規定する | 10 | Yes | | 2015 | +| P1041R4: [`char16_t`と`char32_t`の文字・文字列リテラルを、文字コードUTF-16/32に規定](/lang/cpp20/make_char16t_char32t_string_literals_be_utf16_32.md) | `__STDC_UTF_16__`、`__STDC_UTF_32__`の定義に関係なく、`char16_t`、`char32_t`のリテラルをUTF-16/32文字コードに規定する | 10 | Yes | 2023.0 | 2015 | | P1103R3: [モジュール](/lang/cpp20/modules.md) | ヘッダファイル・ソースファイル、インクルードに変わる仕組みとしてモジュールを導入する | 11 (`-fmodules-ts`が必要) | 15
8.0 partial (`-fmodules`, `-fmodules-ts`が必要) | | 2019 Update 8 | | P0912R5: [コルーチン](/lang/cpp20/coroutines.md) | 関数実行を中断・再開する仕組みとしてコルーチンを導入する | 10 (`-fcoroutines`が必要) | 8.0 (partial) | 2021.4| 2019 Update 8 | | P1161R3: [添字演算子内でのカンマ演算子の使用を非推奨化](/lang/cpp20/deprecate_uses_of_the_comma_operator_in_subscripting_expressions.md) | `ar[i, j]`を非推奨化。`ar[(i, j)]`はOK | 10 | 9.0 | 2021.6 | 2019 Update 5 | -| P1331R2: [constexpr関数内でのトリビアルなデフォルト初期化を許可](/lang/cpp20/permitting_trivial_default_initialization_in_constexpr_contexts.md) | constexpr関数内でのデフォルト初期化を許可し、未初期化値を読むことのみ禁止する | 10 | 10.0 | | 2019 Update 7 | -| P0848R3: [条件付きで特殊メンバ関数をトリビアルに定義するように](/lang/cpp20/conditionally_trivial_special_member_functions.md.nolink) | 制約によってトリビアルな特殊メンバ関数と非トリビアルな特殊メンバ関数をオーバーロードできるようにする | 10 | 16 Partial (consepts 未実装部あり) | | 2019 Update 8 | +| P1331R2: [constexpr関数内でのトリビアルなデフォルト初期化を許可](/lang/cpp20/permitting_trivial_default_initialization_in_constexpr_contexts.md) | constexpr関数内でのデフォルト初期化を許可し、未初期化値を読むことのみ禁止する | 10 | 10.0 | 2022.3 | 2019 Update 7 | +| P0848R3: [条件付きで特殊メンバ関数をトリビアルに定義するように](/lang/cpp20/conditionally_trivial_special_member_functions.md.nolink) | 制約によってトリビアルな特殊メンバ関数と非トリビアルな特殊メンバ関数をオーバーロードできるようにする | 10 | 16 Partial (consepts 未実装部あり) | 2022.3 | 2019 Update 8 | | P1301R4: [`[[nodiscard]]`属性に理由となる文字列を付加できるようにする](/lang/cpp20/nodiscard_should_have_a_reason.md) | 関数の戻り値を無視してはならない理由を関数宣言に持たせ、警告メッセージに役立てる | 10 | 9.0 | 2021.6 | 2019 Update 5 | -| P1099R5: [スコープ付き列挙型のusing宣言](/lang/cpp20/using_enum.md) | `using enum EnumType;`もしくは`using EnumType::enumerator`とすることで、列挙値のスコープ指定を省略できるようにする | 11 | 13 | | 2019 Update 4 | +| P1099R5: [スコープ付き列挙型のusing宣言](/lang/cpp20/using_enum.md) | `using enum EnumType;`もしくは`using EnumType::enumerator`とすることで、列挙値のスコープ指定を省略できるようにする | 11 | 13 | 2023.0 | 2019 Update 4 | | P1816R0: [集成体クラステンプレートのテンプレート引数推論](/lang/cpp20/class_template_argument_deduction_for_aggregates.md) | クラステンプレートのテンプレート引数推論はコンストラクタ引数から推論されるが、集成体初期化からも推論できるようにする | 10 | No | | 2019 Update 7 | -| P1668R1: [constexpr関数内で未評価のインラインアセンブリを許可することによる組み込み関数のconstexpr有効化](/lang/cpp20/enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.md) | コンパイル時に評価されない場合にconstexpr関数にasm定義を含めることを許可 | 10 | 10.0 | | 2019 Update 9 | +| P1668R1: [constexpr関数内で未評価のインラインアセンブリを許可することによる組み込み関数のconstexpr有効化](/lang/cpp20/enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.md) | コンパイル時に評価されない場合にconstexpr関数にasm定義を含めることを許可 | 10 | 10.0 | 2022.3 | 2019 Update 9 | | P0388R4: [要素数不明の配列への変換を許可](/lang/cpp20/permit_conversions_to_arrays_of_unknown_bound.md) | 要素数が判明している配列から、要素数が不明の配列への変換を許可 | 10 | 14 | 2021.6 | 2019 Update 7 | -| P1143R2: [コンパイル時初期化を強制する`constinit`キーワードを追加](/lang/cpp20/constinit.md) | 初期化のみコンパイル時におわらせたい場合に使用する | 10 | 10.0 | | 2019 Update 10 | +| P1143R2: [コンパイル時初期化を強制する`constinit`キーワードを追加](/lang/cpp20/constinit.md) | 初期化のみコンパイル時におわらせたい場合に使用する | 10 | 10.0 | 2022.3 | 2019 Update 10 | | P1152R4: [ほとんどの`volatile`を非推奨化](/lang/cpp20/deprecating_volatile.md) | `volatile`の有用な機能のみを残し、効果が疑わしい、または壊れている機能を非推奨化する | 10 | 10.0 | 2021.6 | 2019 Update 7 | | P1814R0: [エイリアステンプレート経由でのクラステンプレートのテンプレート引数推論](/lang/cpp20/class_template_argument_deduction_for_alias_templates.md) | エイリアステンプレートからクラステンプレートのテンプレート引数を推論できるようにする | 10 | No | | 2019 Update 7 | | P0784R7: [可変サイズをもつコンテナの`constexpr`化](/lang/cpp20/more_constexpr_containers.md) | `constexpr`記憶域をもつメモリアロケータの存在を考慮することで、可変サイズをもつコンテナをコンパイル時に使用できるようにする | 10 | 10.0 | 2021.6 | 2019 Update 9 | From d408c51c96e78e8af3ab4accc880fee05791d87d Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 13 Nov 2023 15:41:43 +0900 Subject: [PATCH 0550/3948] =?UTF-8?q?=E3=83=88=E3=83=83=E3=83=97=E3=83=9A?= =?UTF-8?q?=E3=83=BC=E3=82=B8=20:=20=E3=82=B7=E3=83=AB=E3=83=90=E3=83=BC?= =?UTF-8?q?=E3=82=B9=E3=83=9D=E3=83=B3=E3=82=B5=E3=83=BC=E4=BB=A5=E4=B8=8A?= =?UTF-8?q?=E3=81=AFissue=E3=81=AB=E6=8E=A1=E7=94=A8=E6=83=85=E5=A0=B1?= =?UTF-8?q?=E3=82=92=E6=8A=95=E7=A8=BF=E3=81=A7=E3=81=8D=E3=82=8B=E7=89=B9?= =?UTF-8?q?=E5=85=B8=E3=82=92=E8=BF=BD=E5=8A=A0=20#1116?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.md b/index.md index 1271f020fc..21ae54e2d0 100644 --- a/index.md +++ b/index.md @@ -18,7 +18,12 @@ このプロジェクトは、持続的な活動のため、ユーザーの方々からのご支援をお待ちしております。上記Open Collectiveのプロジェクトでスポンサーシップの募集をしております。 -ご支援いただくユーザーの方々は、本ページ (cpprefjpサイトのトップページ) に、金額順でロゴを表示させていただきます (金額が同じ場合は登録順)。ご支援いただいた資金は、貢献度に応じてコントリビューターに分配させていただきます。 +ご支援いただくユーザーの方々には、以下の特典があります。 + +- 本ページ (cpprefjpサイトのトップページ) に、金額順でロゴを表示させていただきます (金額が同じ場合は登録順) +- シルバースポンサー以上の方は、[cpprefjp/site](https://github.com/cpprefjp/site)リポジトリのissueとして、採用情報を投稿できます (一週間ほどで閉じます) + +ご支援いただいた資金は、貢献度に応じてコントリビューターに分配させていただきます。 また、スポンサーシップの入金方法として、Open Collectiveのほかに銀行振込も対応しております。 From b17670dea79e6d26f1caa2f5c0252f9a8621439f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 13 Nov 2023 17:09:20 +0900 Subject: [PATCH 0551/3948] =?UTF-8?q?ostream=E3=81=AEprint=E3=81=A8println?= =?UTF-8?q?=20:=20cerr=E3=81=A8=E3=81=8B=E3=81=AFiostream=E3=81=A7?= =?UTF-8?q?=E5=AE=9A=E7=BE=A9=E3=81=95=E3=82=8C=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ostream/print.md | 2 +- reference/ostream/println.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/ostream/print.md b/reference/ostream/print.md index 7f98d91072..b0fe8d5cf5 100644 --- a/reference/ostream/print.md +++ b/reference/ostream/print.md @@ -73,7 +73,7 @@ namespace std { ## 例 ```cpp example -#include +#include int main() { diff --git a/reference/ostream/println.md b/reference/ostream/println.md index bb6e90f1b7..3b9834ae44 100644 --- a/reference/ostream/println.md +++ b/reference/ostream/println.md @@ -41,7 +41,7 @@ namespace std { ## 例 ```cpp example -#include +#include int main() { From e6d487c105ddd04d243c2932832bede7fe66d1cc Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 13 Nov 2023 17:10:30 +0900 Subject: [PATCH 0552/3948] =?UTF-8?q?print/vprint=5Funicode=20:=20?= =?UTF-8?q?=E3=81=A7=E3=81=99=E3=81=BE=E3=81=99=E8=AA=BF=E3=81=AB=E3=81=AA?= =?UTF-8?q?=E3=81=A3=E3=81=A6=E3=81=84=E3=81=9F=E3=81=A8=E3=81=93=E3=82=8D?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/print/vprint_unicode.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/print/vprint_unicode.md b/reference/print/vprint_unicode.md index a231b83ec6..bf5736b923 100644 --- a/reference/print/vprint_unicode.md +++ b/reference/print/vprint_unicode.md @@ -45,7 +45,7 @@ namespace std { * vformat[link /reference/format/vformat.md] - `stream`がUnicodeを表示できる端末を参照している場合、ネイティブのUnicode APIを使用して端末に書き出す - - `out`に無効なコードユニットが含まれる場合、その動作は未定義であり,実装者はそれを診断することが推奨される。それ以外の場合は、変更せずにストリームに書き出します。そうでなければ、変更せず`stream`に`out`を書き出す。 + - `out`に無効なコードユニットが含まれる場合、その動作は未定義であり,実装者はそれを診断することが推奨される。それ以外の場合は、変更せずにストリームに書き出す。そうでなければ、変更せず`stream`に`out`を書き出す。 - ネイティブのUnicode APIを使用する場合、この関数は`out`を書き出す前にフラッシュする From 19d47d886e3fad701966c229996b5a6d2dc40a71 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 15 Nov 2023 16:15:34 +0900 Subject: [PATCH 0553/3948] =?UTF-8?q?adjacent=5Ffind=E3=81=AE=E5=8B=95?= =?UTF-8?q?=E4=BD=9C=E3=82=A4=E3=83=A1=E3=83=BC=E3=82=B8=E3=82=92=E4=BB=98?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/adjacent_find.md | 30 ++++++++++++++++++++ reference/algorithm/ranges_adjacent_find.md | 31 +++++++++++++++++++++ 2 files changed, 61 insertions(+) diff --git a/reference/algorithm/adjacent_find.md b/reference/algorithm/adjacent_find.md index f6050f8b4b..112c1832fa 100644 --- a/reference/algorithm/adjacent_find.md +++ b/reference/algorithm/adjacent_find.md @@ -45,6 +45,23 @@ namespace std { ## 概要 イテレータ範囲`[first, last)`から、隣接する要素で条件を満たしている最初の要素を検索する。 +このアルゴリズムは、範囲の先頭から1つづつ進みながら隣接するペアに対して条件を満たすかをチェックし、その条件を満たす最初の要素へのイテレータを返す。指定された条件を満たしているかをチェックされるのは、現在位置にある要素とその次の位置にある要素の2つについてであり、1つの要素は最大2回参照される。 + +整数の配列`{1, 3, 3, 5, 0, 4, 5, 2}`を入力、指定された条件`pred`を[`std::greater`](/reference/functional/greater.md)とした時の、チェックされる要素の様子 + +``` +|0 1 2 3 4 5 6 7| : index +[1, 3, 3, 5, 0, 4, 5, 2] : input range +[1, 3] <- pred(1, 2) == false + [3, 3] <- pred(2, 2) == false + [3, 5] <- pred(2, 3) == false + [5, 0] <- pred(3, 0) == true + [0, 4] + [4, 5] + [5, 2] +``` + +この時、最初に条件を満たしたペアの左側の要素に対応するイテレータを返す。この例の場合、返される要素のイテレータは元の範囲で3番目の要素(0-indexed)であり、その値は`5`である。 ## 戻り値 `[first,last)` 内にあるイテレータ i について、`*i == *(i + 1)` もしくは `pred(*i, *(i + 1)) != false` であるような最初のイテレータを返す。 @@ -85,6 +102,19 @@ found: index==2 *it == *(it+1): true ``` +### 動作イメージ + +``` +|0 1 2 3 4 5 6| : index +[1, 4, 3, 3, 1, 2, 2] : input range +[1, 4] + [4, 3] + [3, 3] <- pred(3, 3) == true + [3, 1] + [1, 2] + [2, 2] +``` + ## 実装例 ```cpp template diff --git a/reference/algorithm/ranges_adjacent_find.md b/reference/algorithm/ranges_adjacent_find.md index 61184e75b1..63a09804f2 100644 --- a/reference/algorithm/ranges_adjacent_find.md +++ b/reference/algorithm/ranges_adjacent_find.md @@ -39,6 +39,24 @@ namespace std::ranges { - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +このアルゴリズムは、範囲の先頭から1つづつ進みながら隣接するペアに対して条件を満たすかをチェックし、その条件を満たす最初の要素へのイテレータを返す。指定された条件を満たしているかをチェックされるのは、現在位置にある要素とその次の位置にある要素の2つについてであり、1つの要素は最大2回参照される。 + +整数の配列`{1, 3, 3, 5, 0, 4, 5, 2}`を入力、指定された条件`pred`を[`std::greater`](/reference/functional/greater.md)とした時の、チェックされる要素の様子 + +``` +|0 1 2 3 4 5 6 7| : index +[1, 3, 3, 5, 0, 4, 5, 2] : input range +[1, 3] <- pred(1, 2) == false + [3, 3] <- pred(2, 2) == false + [3, 5] <- pred(2, 3) == false + [5, 0] <- pred(3, 0) == true + [0, 4] + [4, 5] + [5, 2] +``` + +この時、最初に条件を満たしたペアの左側の要素に対応するイテレータを返す。この例の場合、返される要素のイテレータは元の範囲で3番目の要素(0-indexed)であり、その値は`5`である。 + ## 戻り値 `[first,last)` 内にあるイテレータ i について、[`invoke`](/reference/functional/invoke.md)`(pred, `[`invoke`](/reference/functional/invoke.md)`(proj, *i), `[`invoke`](/reference/functional/invoke.md)`(proj, *(i + 1))) != false` であるような最初のイテレータを返す。 @@ -79,6 +97,19 @@ found: index==2 *it == *(it+1): true ``` +### 動作イメージ + +``` +|0 1 2 3 4 5 6| : index +[1, 4, 3, 3, 1, 2, 2] : input range +[1, 4] + [4, 3] + [3, 3] <- pred(3, 3) == true + [3, 1] + [1, 2] + [2, 2] +``` + ## 実装例 ```cpp struct adjacent_find_impl { From fbfaaeb3b76abd124b0afaad2c689ed5e32d159c Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 15 Nov 2023 16:16:27 +0900 Subject: [PATCH 0554/3948] =?UTF-8?q?=E6=95=B0=E5=AD=97=E3=81=8C=E3=81=82?= =?UTF-8?q?=E3=81=A3=E3=81=A6=E3=81=84=E3=81=AA=E3=81=84=E3=81=AE=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/adjacent_find.md | 8 ++++---- reference/algorithm/ranges_adjacent_find.md | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/reference/algorithm/adjacent_find.md b/reference/algorithm/adjacent_find.md index 112c1832fa..bb764ae8fd 100644 --- a/reference/algorithm/adjacent_find.md +++ b/reference/algorithm/adjacent_find.md @@ -52,10 +52,10 @@ namespace std { ``` |0 1 2 3 4 5 6 7| : index [1, 3, 3, 5, 0, 4, 5, 2] : input range -[1, 3] <- pred(1, 2) == false - [3, 3] <- pred(2, 2) == false - [3, 5] <- pred(2, 3) == false - [5, 0] <- pred(3, 0) == true +[1, 3] <- pred(1, 3) == false + [3, 3] <- pred(3, 3) == false + [3, 5] <- pred(3, 5) == false + [5, 0] <- pred(5, 0) == true [0, 4] [4, 5] [5, 2] diff --git a/reference/algorithm/ranges_adjacent_find.md b/reference/algorithm/ranges_adjacent_find.md index 63a09804f2..75e712ffea 100644 --- a/reference/algorithm/ranges_adjacent_find.md +++ b/reference/algorithm/ranges_adjacent_find.md @@ -46,10 +46,10 @@ namespace std::ranges { ``` |0 1 2 3 4 5 6 7| : index [1, 3, 3, 5, 0, 4, 5, 2] : input range -[1, 3] <- pred(1, 2) == false - [3, 3] <- pred(2, 2) == false - [3, 5] <- pred(2, 3) == false - [5, 0] <- pred(3, 0) == true +[1, 3] <- pred(1, 3) == false + [3, 3] <- pred(3, 3) == false + [3, 5] <- pred(3, 5) == false + [5, 0] <- pred(5, 0) == true [0, 4] [4, 5] [5, 2] From 1326e68a7dc70b04e698f1ce35580342c0c544e2 Mon Sep 17 00:00:00 2001 From: Akiko Kawai Date: Fri, 17 Nov 2023 11:21:41 +0900 Subject: [PATCH 0555/3948] Updated GCC support version for C++23 --- implementation-status.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/implementation-status.md b/implementation-status.md index d4944ce856..226af75fd4 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -270,7 +270,7 @@ | P2242R3: [定数式内での非リテラル変数の使用を含められないようにする](/lang/cpp23/non_literal_variables_in_constexpr_functions.md.nolink) | 定数式内で静的変数・スレッドローカル変数およびgoto文とラベルを含められない制限を設ける | 12 | 15 | - | - | | P2246R1: [静的な診断メッセージの文字エンコーディング](/lang/cpp23/character_encoding_of_diagnostic_text.md.nolink) | `static_assert`や`[[deprecated]]`などの診断メッセージの文字集合に関する要件をなくす | - | yes | - | 2022 | | P2448R2: [`constexpr`関数のすべての引数が定数実行できない場合でも適格とする](/lang/cpp23/relaxing_some_constexpr_restrictions.md.nolink) | | 13 | 17 (partial) | - | - | -| P2647R1: [`constexpr`関数内での`static constexpr`変数を許可](/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md.nolink) | | - | 16 | - | - | +| P2647R1: [`constexpr`関数内での`static constexpr`変数を許可](/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md.nolink) | 13 | - | 16 | - | - | | P2564R3: [`constexpr`関数内で`consteval`関数を呼び出せない問題を緩和](/lang/cpp23/consteval_needs_to_propagate_up.md.nolink) | | - | 17 | - | - | | P1102R2: [ラムダ式で`()`を省略できる条件を緩和](/lang/cpp23/down_with_lambda_parens.md.nolink) | キャプチャや修飾をともなってもパラメータリストが空であれば`()`を省略できる | 11 | 13 | - | - | | P2173R1: [ラムダ式に対する属性](/lang/cpp23/attributes_on_lambda_expressions.md.nolink) | ラムダ式のいくつかの箇所に属性を記述できるようにする | 9 | 13 | - | - | From 7a0af0077b1553719db531bfbe12275dc5cd60a6 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Fri, 17 Nov 2023 12:30:38 +0900 Subject: [PATCH 0556/3948] =?UTF-8?q?=E7=95=B3=E3=81=BF=E8=BE=BC=E3=81=BF?= =?UTF-8?q?=E5=BC=8F=20:=20=E5=BC=8F=E7=A8=AE=E9=A1=9E=E3=81=AE=E5=8F=82?= =?UTF-8?q?=E7=85=A7=E6=96=B9=E6=B3=95=E3=82=92=E5=BE=AE=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp17/folding_expressions.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lang/cpp17/folding_expressions.md b/lang/cpp17/folding_expressions.md index a27b9224fe..1a0b7f62b3 100644 --- a/lang/cpp17/folding_expressions.md +++ b/lang/cpp17/folding_expressions.md @@ -20,7 +20,7 @@ * 畳み込み式は括弧 `()` で囲まれなければならない * `op` は後述する二項演算子 - 二項畳み込み (3, 4) の場合 `op` は同一でなければならない + 二項畳み込み (3)(4) の場合 `op` は同一でなければならない * `pack` は未展開のパラメータパック (規格ではキャスト式 cast-expression と呼ばれる) * `init` は未展開のパラメータパック以外 (規格ではキャスト式 cast-expression と呼ばれる) * 畳み込み式は以下のように展開される: @@ -73,7 +73,7 @@ ### パラメータパックが空のときの式の値 -単項畳み込み (1, 2) でパラメータパックが空の場合、以下の演算子については式の値が設定される: +単項畳み込み (1)(2) でパラメータパックが空の場合、以下の演算子については式の値が設定される: | 演算子 | 値 | |------|------| @@ -83,7 +83,7 @@ 上記以外の演算子に対し空のパラメータパックが適用された場合、プログラムは不適格となる。 -空のパラメータパックが適用された場合の挙動を変えるには二項畳み込み (3, 4) で値を与える。 +空のパラメータパックが適用された場合の挙動を変えるには二項畳み込み (3)(4) で値を与える。 ## 例 From beb148edbf96be6eb9a31ee14b58a886db3e4e99 Mon Sep 17 00:00:00 2001 From: Akiko Kawai Date: Fri, 17 Nov 2023 13:31:37 +0900 Subject: [PATCH 0557/3948] Updated implimentation status of ICX about c++23 --- implementation-status.md | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/implementation-status.md b/implementation-status.md index 226af75fd4..c381659729 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -248,38 +248,38 @@ | 言語機能 | 説明 | [GCC][gcc] | [Clang][clang] | [ICX][icx] | [MSVC][msvc] | |----------|------|------------|----------------|------------|--------------| | P0330R8: [(符号付き)`size_t`リテラルのためのサフィックス](/lang/cpp23/literal_suffix_for_signed_size_t.md) | `42z`/`42Z`とすることで`size_t`に対応する符号付き整数型のリテラルとする | 11 | 13 | 2022.2 | - | -| P2290R3: [エスケープシーケンスの区切り](/lang/cpp23/delimited_escape_sequences.md.nolink) | エスケープシーケンスの範囲を明確にする構文を追加する | 13 | 15 | - | - | +| P2290R3: [エスケープシーケンスの区切り](/lang/cpp23/delimited_escape_sequences.md.nolink) | エスケープシーケンスの範囲を明確にする構文を追加する | 13 | 15 | 2023.2 | - | | P2266R3: [暗黙的なムーブを簡略化](/lang/cpp23/simpler_implicit_move.md.nolink) | 参照を返す関数の`return`文で暗黙的にムーブされない問題を修正 | 13 | 13 | 2022.2 | - | | P1787R6: [スコープと名前ルックアップの仕様整理](/lang/cpp23/declarations_and_where_to_find_them.md.nolink) | 複雑で不完全になっているスコープと名前ルックアップの仕様を整理し、一部の問題を解決する | - | - | - | - | | P2615R1: [無意味なexport宣言を禁止する](/lang/cpp23/meaningful_exports.md.nolink) | | - | - | - | - | | P2360R0: [初期化文での型の別名宣言を許可](/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md.nolink) | `for (using T = int; T e : v) {}`を許可 | 12 | 14 | 2022.2 | - | | P2718R0: [範囲for文が範囲への参照を延命することを規定](lang/cpp23/lifetime_extension_in_range_based_for_loop.md.nolink) | | - | - | - | - | -| P2324R2: [関数末尾のラベルを許可](/lang/cpp23/labels_at_the_end_of_compound_statements.md.nolink) | C互換のため、関数末尾でのgoto文のラベルを許可する | 13 | 16 | - | - | +| P2324R2: [関数末尾のラベルを許可](/lang/cpp23/labels_at_the_end_of_compound_statements.md.nolink) | C互換のため、関数末尾でのgoto文のラベルを許可する | 13 | 16 | 2023.2 | - | | P0847R7: [自身のオブジェクトを明示的にパラメータとして指定する](/lang/cpp23/deducing_this.md.nolink) | メンバ関数が`*this`の型・オブジェクトをパラメータとしてとり、`*this`オブジェクトがconst/非const、左辺値/右辺値であるかをメンバ関数内で識別できるようにする | - | 18 | - | 2022 Update 2 (partial) | | P1847R4: [アクセス制御の異なるメンバ変数のレイアウトを宣言順に規定](/lang/cpp23/make_declaration_order_layout_mandated.md.nolink) | アクセス制御の異なるメンバ変数のレイアウトが実装によって異なっていたため仕様を規定 | Yes | Yes | - | 2022 | | P2128R6: [添字演算子の多次元サポート](/lang/cpp23/multidimensional_subscript_operator.nd.nolink) | `operator[](int x, int y, int z)`のように添字演算子のオーバーロードで複数のパラメータをとることを許可 | 12 | 15 | 2022.2 | - | -| P1169R4: [`this`ポインタをもつ必要のない演算子を`static`として宣言できるようにする](/lang/cpp23/static_operator.md.nolink) | | 13 | 16 | - | - | +| P1169R4: [`this`ポインタをもつ必要のない演算子を`static`として宣言できるようにする](/lang/cpp23/static_operator.md.nolink) | | 13 | 16 | 2023.2 | - | | P2201R1 : [異なる文字エンコーディングをもつ文字列リテラルの連結を不適格とする](/lang/cpp23/mixed_string_literal_concatenation.md.nolink) | `auto a = u8"" L"";`のような異なる文字エンコーディング同士での文字列リテラルを連結を禁止する | Yes | Yes | 2022.2 | Yes | | P2029R4: [文字・文字列リテラル中の数値・ユニバーサルキャラクタのエスケープに関する問題解決](/lang/cpp23/numeric_and_universal_character_escapes_in_character_and_string_literals.md.nolink) | | - | - | - | - | -| P2362R3: [1ワイド文字に収まらないワイド文字リテラルを禁止する](/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md.nolink) | エンコード結果として`wchar_t`の大きさに収まらないワイド文字リテラルを禁止する | 13 | 14 | - | - | -| P2071R2: [名前付きユニバーサルキャラクタ名](/lang/cpp23/named_universal_character_escapes.md.nolink) | 16進数のユニバーサルキャラクタだけでなく、その文字の名前を入力できるようにする | 13 | 15 | - | - | +| P2362R3: [1ワイド文字に収まらないワイド文字リテラルを禁止する](/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md.nolink) | エンコード結果として`wchar_t`の大きさに収まらないワイド文字リテラルを禁止する | 13 | 14 | 2023.2 | - | +| P2071R2: [名前付きユニバーサルキャラクタ名](/lang/cpp23/named_universal_character_escapes.md.nolink) | 16進数のユニバーサルキャラクタだけでなく、その文字の名前を入力できるようにする | 13 | 15 | 2023.2 | - | | P2096R2: [部分特殊化の汎用化仕様](/lang/cpp23/generalized_wording_for_partial_specializations.md.nolink) | 変数テンプレートの部分特殊化を許可するために部分特殊化の仕様を汎用化 | - | - | - | - | | P2582R1: [継承コンストラクタからのクラステンプレート引数の推論](/lang/cpp23/class_template_argument_deduction_from_inherited.md.nolink) | | - | - | - | - | | P1938R3 : [`if consteval`](/lang/cpp23/if_consteval.md.nolink) | コンパイル時の文脈かどうかで分岐させる | 12 | 14 | - | - | -| P1401R5 : [定数式の文脈での`bool`への縮小変換を許可](/lang/cpp23/narrowing_contextual_conversions_to_bool.md.nolink) | `if constexpr(flags & Flags::Exec)`や`static_assert(N);`を許可 | 9 | 13 | - | - | -| P2242R3: [定数式内での非リテラル変数の使用を含められないようにする](/lang/cpp23/non_literal_variables_in_constexpr_functions.md.nolink) | 定数式内で静的変数・スレッドローカル変数およびgoto文とラベルを含められない制限を設ける | 12 | 15 | - | - | +| P1401R5 : [定数式の文脈での`bool`への縮小変換を許可](/lang/cpp23/narrowing_contextual_conversions_to_bool.md.nolink) | `if constexpr(flags & Flags::Exec)`や`static_assert(N);`を許可 | 9 | 13 | 2022.2 | - | +| P2242R3: [定数式内での非リテラル変数の使用を含められないようにする](/lang/cpp23/non_literal_variables_in_constexpr_functions.md.nolink) | 定数式内で静的変数・スレッドローカル変数およびgoto文とラベルを含められない制限を設ける | 12 | 15 | 2022.2 | - | | P2246R1: [静的な診断メッセージの文字エンコーディング](/lang/cpp23/character_encoding_of_diagnostic_text.md.nolink) | `static_assert`や`[[deprecated]]`などの診断メッセージの文字集合に関する要件をなくす | - | yes | - | 2022 | -| P2448R2: [`constexpr`関数のすべての引数が定数実行できない場合でも適格とする](/lang/cpp23/relaxing_some_constexpr_restrictions.md.nolink) | | 13 | 17 (partial) | - | - | -| P2647R1: [`constexpr`関数内での`static constexpr`変数を許可](/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md.nolink) | 13 | - | 16 | - | - | -| P2564R3: [`constexpr`関数内で`consteval`関数を呼び出せない問題を緩和](/lang/cpp23/consteval_needs_to_propagate_up.md.nolink) | | - | 17 | - | - | -| P1102R2: [ラムダ式で`()`を省略できる条件を緩和](/lang/cpp23/down_with_lambda_parens.md.nolink) | キャプチャや修飾をともなってもパラメータリストが空であれば`()`を省略できる | 11 | 13 | - | - | -| P2173R1: [ラムダ式に対する属性](/lang/cpp23/attributes_on_lambda_expressions.md.nolink) | ラムダ式のいくつかの箇所に属性を記述できるようにする | 9 | 13 | - | - | +| P2448R2: [`constexpr`関数のすべての引数が定数実行できない場合でも適格とする](/lang/cpp23/relaxing_some_constexpr_restrictions.md.nolink) | | 13 | 17 (partial) | 2024.0 (partial) | - | +| P2647R1: [`constexpr`関数内での`static constexpr`変数を許可](/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md.nolink) | 13 | - | 16 | 2023.2 | - | +| P2564R3: [`constexpr`関数内で`consteval`関数を呼び出せない問題を緩和](/lang/cpp23/consteval_needs_to_propagate_up.md.nolink) | | - | 17 | - | 2024.0 | +| P1102R2: [ラムダ式で`()`を省略できる条件を緩和](/lang/cpp23/down_with_lambda_parens.md.nolink) | キャプチャや修飾をともなってもパラメータリストが空であれば`()`を省略できる | 11 | 13 | 2022.2 | - | +| P2173R1: [ラムダ式に対する属性](/lang/cpp23/attributes_on_lambda_expressions.md.nolink) | ラムダ式のいくつかの箇所に属性を記述できるようにする | 9 | 13 | 2022.2 | - | | P1774R8: [コード内容の仮定をコンパイラに伝えるassume属性](/lang/cpp23/portable_assumptions.md) | 最適化のために、コードの仮定をコンパイラに伝える属性を標準化する | 13 | - | - | - | -| P2316R2: [文字リテラルエンコーディングを一貫させる](/lang/cpp23/consistent_character_literal_encoding.md.nolink) | プリプロセッサの条件式での文字リテラルの扱いをC++式と同様にする | yes | yes | - | 2022 | -| P2334R1: [`elif`/`elifdef`/`elifndef`のサポートを追加](/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md.nolink) | `#if`/`#ifdef`/`#ifndef`に対応する複数条件命令のサポートを追加する | 12 | 13 | - | - | -| P2437R1: [`#warning`のサポートを追加](/lang/cpp23/warning.md.nolink) | 多くのC++コンパイラが実装していたプリプロセス時の警告`#warning message`を正式サポート | yes | yes | yes | yes | -| P2295R6: [汎用的なソースコードのエンコーディングとしてUTF-8をサポート](/lang/cpp23/support_for_utf8_as_a_portable_source_file_encoding.md.nolink) | | 13 | 15 | - | 2019 Update 2 | -| P2223R2: [行末スペースを無視するよう規定](/lang/cpp23/trimming_whitespaces_before_line_splicing.md.nolink) | 行末が「\ 」でおわっていた場合にMSVCは行の継続をしない実装になっていたため動作を共通化するため仕様を規定 | Yes | Yes | - | - | +| P2316R2: [文字リテラルエンコーディングを一貫させる](/lang/cpp23/consistent_character_literal_encoding.md.nolink) | プリプロセッサの条件式での文字リテラルの扱いをC++式と同様にする | yes | yes | 2022.2 | 2022 | +| P2334R1: [`elif`/`elifdef`/`elifndef`のサポートを追加](/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md.nolink) | `#if`/`#ifdef`/`#ifndef`に対応する複数条件命令のサポートを追加する | 12 | 13 | 2022.2 | - | +| P2437R1: [`#warning`のサポートを追加](/lang/cpp23/warning.md.nolink) | 多くのC++コンパイラが実装していたプリプロセス時の警告`#warning message`を正式サポート | yes | yes | 2023.2 | yes | +| P2295R6: [汎用的なソースコードのエンコーディングとしてUTF-8をサポート](/lang/cpp23/support_for_utf8_as_a_portable_source_file_encoding.md.nolink) | | 13 | 15 | 2023.2 | 2019 Update 2 | +| P2223R2: [行末スペースを無視するよう規定](/lang/cpp23/trimming_whitespaces_before_line_splicing.md.nolink) | 行末が「\ 」でおわっていた場合にMSVCは行の継続をしない実装になっていたため動作を共通化するため仕様を規定 | Yes | Yes | 2022.2 | - | 各処理系のC++23実装状況ページ: From 7b90cfd29f6257e949730a1ba70ca02b0e9d2dd6 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Mon, 20 Nov 2023 12:16:20 +0900 Subject: [PATCH 0558/3948] =?UTF-8?q?offsetof=20:=20=E3=83=90=E3=83=BC?= =?UTF-8?q?=E3=82=B8=E3=83=A7=E3=83=B3=E9=96=93=E3=81=AE=E5=B7=AE=E7=95=B0?= =?UTF-8?q?=E3=81=AA=E3=81=A9=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6=E8=BF=BD?= =?UTF-8?q?=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstddef/offsetof.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reference/cstddef/offsetof.md b/reference/cstddef/offsetof.md index 94d3ac76d7..c2c8594841 100644 --- a/reference/cstddef/offsetof.md +++ b/reference/cstddef/offsetof.md @@ -12,8 +12,9 @@ この構造体の先頭から `member` へのバイト数が、`size_t` 型の符号なし整数値で返される。 -C++ での構造体の機能的拡張のため、`offsetof` の利用は、C の構造体のコンセプトに対応する POD のクラス型に制限される(但し、`public` な非仮想メンバ関数のみを持ち、コンストラクタ及びデストラクタを持たない非派生クラスも POD である)。 +C++ での構造体の機能的拡張のため、`offsetof` の利用は、C++11以降は[スタンダードレイアウト](/reference/type_traits/is_standard_layout.md)のクラス型に制限され、C++11まではC の構造体のコンセプトに対応する POD のクラス型に制限される(但し、`public` な非仮想メンバ関数のみを持ち、コンストラクタ及びデストラクタを持たない非派生クラスも POD である)。 +スタンダードレイアウトではないクラス型においての`offsetof`の利用は条件付きのサポートとなる(C++14までは未定義)。 ## パラメータ - `type` : `member` を有効なメンバ指示子とするクラス型 From 7405b3c3c4c498b3518d52486702eec36bf6e866 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Mon, 20 Nov 2023 12:25:47 +0900 Subject: [PATCH 0559/3948] =?UTF-8?q?offsetof=20:=20=E3=83=90=E3=83=BC?= =?UTF-8?q?=E3=82=B8=E3=83=A7=E3=83=B3=E5=A2=83=E7=95=8C=E3=81=AB=E3=81=A4?= =?UTF-8?q?=E3=81=84=E3=81=A6=E6=98=8E=E7=A2=BA=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstddef/offsetof.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/cstddef/offsetof.md b/reference/cstddef/offsetof.md index c2c8594841..aaacd630d7 100644 --- a/reference/cstddef/offsetof.md +++ b/reference/cstddef/offsetof.md @@ -12,9 +12,9 @@ この構造体の先頭から `member` へのバイト数が、`size_t` 型の符号なし整数値で返される。 -C++ での構造体の機能的拡張のため、`offsetof` の利用は、C++11以降は[スタンダードレイアウト](/reference/type_traits/is_standard_layout.md)のクラス型に制限され、C++11まではC の構造体のコンセプトに対応する POD のクラス型に制限される(但し、`public` な非仮想メンバ関数のみを持ち、コンストラクタ及びデストラクタを持たない非派生クラスも POD である)。 +C++ での構造体の機能的拡張のため、`offsetof` の利用は、C++11以降は[スタンダードレイアウト](/reference/type_traits/is_standard_layout.md)のクラス型に制限され、C++11より以前はC の構造体のコンセプトに対応する POD のクラス型に制限される(但し、`public` な非仮想メンバ関数のみを持ち、コンストラクタ及びデストラクタを持たない非派生クラスも POD である)。 -スタンダードレイアウトではないクラス型においての`offsetof`の利用は条件付きのサポートとなる(C++14までは未定義)。 +スタンダードレイアウトではないクラス型においての`offsetof`の利用は条件付きのサポートとなる(C++17より以前は未定義)。 ## パラメータ - `type` : `member` を有効なメンバ指示子とするクラス型 From 4d5c0edfcd79661472afc00a695d017297e4d1d9 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 21 Nov 2023 18:04:26 +0900 Subject: [PATCH 0560/3948] =?UTF-8?q?osdn.jp=E3=81=AE=E3=83=AA=E3=83=B3?= =?UTF-8?q?=E3=82=AF=E3=82=92webarchive=E3=81=AB=E5=B7=AE=E3=81=97?= =?UTF-8?q?=E6=9B=BF=E3=81=88=20#1214?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/atomic/atomic/wait.md | 2 +- reference/atomic/atomic_flag/wait.md | 2 +- reference/atomic/atomic_flag_wait.md | 2 +- reference/atomic/atomic_flag_wait_explicit.md | 2 +- reference/atomic/atomic_ref/wait.md | 2 +- reference/atomic/atomic_wait.md | 2 +- reference/atomic/atomic_wait_explicit.md | 2 +- reference/filesystem/create_directory.md | 4 ++-- reference/filesystem/create_directory_symlink.md | 2 +- reference/filesystem/create_hard_link.md | 2 +- reference/filesystem/create_symlink.md | 2 +- reference/filesystem/current_path.md | 4 ++-- reference/filesystem/file_size.md | 2 +- reference/filesystem/last_write_time.md | 4 ++-- reference/filesystem/remove.md | 2 +- reference/filesystem/remove_all.md | 2 +- reference/filesystem/rename.md | 2 +- reference/filesystem/resize_file.md | 2 +- reference/filesystem/space.md | 2 +- reference/filesystem/status.md | 2 +- reference/filesystem/symlink_status.md | 2 +- reference/ios/defaultfloat.md | 2 +- reference/ios/hexfloat.md | 2 +- reference/memory/get_temporary_buffer.md | 4 ++-- reference/random/random_device.md | 4 ++-- reference/semaphore/counting_semaphore.md | 4 ++-- reference/semaphore/counting_semaphore/acquire.md | 2 +- reference/shared_mutex/shared_mutex.md | 2 +- reference/shared_mutex/shared_timed_mutex.md | 2 +- reference/system_error/errc.md | 2 +- reference/thread/this_thread/yield.md | 2 +- 31 files changed, 37 insertions(+), 37 deletions(-) diff --git a/reference/atomic/atomic/wait.md b/reference/atomic/atomic/wait.md index 2aead94abb..52577ef455 100644 --- a/reference/atomic/atomic/wait.md +++ b/reference/atomic/atomic/wait.md @@ -45,7 +45,7 @@ void wait(T old, ## 備考 -- Windowsでは`WaitOnAddress()`関数、POSIXでは[`futex()`](https://linuxjm.osdn.jp/html/LDP_man-pages/man2/futex.2.html)関数が実装に使われる +- Windowsでは`WaitOnAddress()`関数、POSIXでは[`futex()`](https://web.archive.org/web/20230605025744/https://linuxjm.osdn.jp/html/LDP_man-pages/man2/futex.2.html)関数が実装に使われる ## 例 diff --git a/reference/atomic/atomic_flag/wait.md b/reference/atomic/atomic_flag/wait.md index 7ec772b20e..f4a550ebf4 100644 --- a/reference/atomic/atomic_flag/wait.md +++ b/reference/atomic/atomic_flag/wait.md @@ -36,7 +36,7 @@ void wait(bool old, memory_order order = memory_order::seq_cst) const noexcept; ## 備考 -- Windowsでは`WaitOnAddress()`関数、POSIXでは[`futex()`](https://linuxjm.osdn.jp/html/LDP_man-pages/man2/futex.2.html)関数が実装に使われる +- Windowsでは`WaitOnAddress()`関数、POSIXでは[`futex()`](https://web.archive.org/web/20230605025744/https://linuxjm.osdn.jp/html/LDP_man-pages/man2/futex.2.html)関数が実装に使われる ## 例 diff --git a/reference/atomic/atomic_flag_wait.md b/reference/atomic/atomic_flag_wait.md index 00d4eef90a..0ac06ba10f 100644 --- a/reference/atomic/atomic_flag_wait.md +++ b/reference/atomic/atomic_flag_wait.md @@ -36,7 +36,7 @@ namespace std { ## 備考 -- Windowsでは`WaitOnAddress()`関数、POSIXでは[`futex()`](https://linuxjm.osdn.jp/html/LDP_man-pages/man2/futex.2.html)関数が実装に使われる +- Windowsでは`WaitOnAddress()`関数、POSIXでは[`futex()`](https://web.archive.org/web/20230605025744/https://linuxjm.osdn.jp/html/LDP_man-pages/man2/futex.2.html)関数が実装に使われる ## 例 diff --git a/reference/atomic/atomic_flag_wait_explicit.md b/reference/atomic/atomic_flag_wait_explicit.md index c97c3c1931..6c5fd8f674 100644 --- a/reference/atomic/atomic_flag_wait_explicit.md +++ b/reference/atomic/atomic_flag_wait_explicit.md @@ -40,7 +40,7 @@ namespace std { ## 備考 -- Windowsでは`WaitOnAddress()`関数、POSIXでは[`futex()`](https://linuxjm.osdn.jp/html/LDP_man-pages/man2/futex.2.html)関数が実装に使われる +- Windowsでは`WaitOnAddress()`関数、POSIXでは[`futex()`](https://web.archive.org/web/20230605025744/https://linuxjm.osdn.jp/html/LDP_man-pages/man2/futex.2.html)関数が実装に使われる ## 例 diff --git a/reference/atomic/atomic_ref/wait.md b/reference/atomic/atomic_ref/wait.md index 71ffb03170..7bc8a699dd 100644 --- a/reference/atomic/atomic_ref/wait.md +++ b/reference/atomic/atomic_ref/wait.md @@ -35,7 +35,7 @@ void wait(T old, memory_order order = memory_order::seq_cst) const noexcept; ## 備考 -- Windowsでは`WaitOnAddress()`関数、POSIXでは[`futex()`](https://linuxjm.osdn.jp/html/LDP_man-pages/man2/futex.2.html)関数が実装に使われる +- Windowsでは`WaitOnAddress()`関数、POSIXでは[`futex()`](https://web.archive.org/web/20230605025744/https://linuxjm.osdn.jp/html/LDP_man-pages/man2/futex.2.html)関数が実装に使われる ## 例 diff --git a/reference/atomic/atomic_wait.md b/reference/atomic/atomic_wait.md index abeb47c7a5..3458917f5a 100644 --- a/reference/atomic/atomic_wait.md +++ b/reference/atomic/atomic_wait.md @@ -45,7 +45,7 @@ namespace std { ## 備考 -- Windowsでは`WaitOnAddress()`関数、POSIXでは[`futex()`](https://linuxjm.osdn.jp/html/LDP_man-pages/man2/futex.2.html)関数が実装に使われる +- Windowsでは`WaitOnAddress()`関数、POSIXでは[`futex()`](https://web.archive.org/web/20230605025744/https://linuxjm.osdn.jp/html/LDP_man-pages/man2/futex.2.html)関数が実装に使われる ## 例 diff --git a/reference/atomic/atomic_wait_explicit.md b/reference/atomic/atomic_wait_explicit.md index 985fcd69c3..a276ab3aa2 100644 --- a/reference/atomic/atomic_wait_explicit.md +++ b/reference/atomic/atomic_wait_explicit.md @@ -47,7 +47,7 @@ namespace std { ## 備考 -- Windowsでは`WaitOnAddress()`関数、POSIXでは[`futex()`](https://linuxjm.osdn.jp/html/LDP_man-pages/man2/futex.2.html)関数が実装に使われる +- Windowsでは`WaitOnAddress()`関数、POSIXでは[`futex()`](https://web.archive.org/web/20230605025744/https://linuxjm.osdn.jp/html/LDP_man-pages/man2/futex.2.html)関数が実装に使われる ## 例 diff --git a/reference/filesystem/create_directory.md b/reference/filesystem/create_directory.md index 873563fa4b..dca20f8a39 100644 --- a/reference/filesystem/create_directory.md +++ b/reference/filesystem/create_directory.md @@ -25,10 +25,10 @@ namespace std::filesystem { ## 効果 - (1), (2) : パス`p`のディレクトリを作成する - - POSIX環境では、[`mkdir()`](https://linuxjm.osdn.jp/html/LDP_man-pages/man2/mkdir.2.html)関数に、第2引数に権限として`static_cast(`[`perms::all`](perms.md)`)`を指定して実行する + - POSIX環境では、[`mkdir()`](https://web.archive.org/web/20231009095236/https://linuxjm.osdn.jp/html/LDP_man-pages/man2/mkdir.2.html)関数に、第2引数に権限として`static_cast(`[`perms::all`](perms.md)`)`を指定して実行する - (2) では、OSのファイルシステムAPIによってエラーが報告された場合、`ec`にエラー情報が設定される。そうでなければ、[`ec.clear()`](/reference/system_error/error_code/clear.md)を呼び出し、エラー情報をクリアする - (3), (4) : パス`existing_p`の属性を取得し、その属性を付加してパス`p`のディレクトリを作成する - - POSIX環境では、[`stat`](https://linuxjm.osdn.jp/html/LDP_man-pages/man2/stat.2.html)`(existing_p.c_str(), &attributes_stat)`の呼び出し後に、[`mkdir`](https://linuxjm.osdn.jp/html/LDP_man-pages/man2/mkdir.2.html)`(p.c_str(), attributes_stat.st_mode)`の呼び出しでディレクトリを作成する + - POSIX環境では、[`stat`](https://web.archive.org/web/20230827123440/https://linuxjm.osdn.jp/html/LDP_man-pages/man2/stat.2.html)`(existing_p.c_str(), &attributes_stat)`の呼び出し後に、[`mkdir`](https://web.archive.org/web/20231009095236/https://linuxjm.osdn.jp/html/LDP_man-pages/man2/mkdir.2.html)`(p.c_str(), attributes_stat.st_mode)`の呼び出しでディレクトリを作成する - Windows環境では、`CreateDirectoryExW(existing_p.c_str(), p.c_str(), 0)`を呼び出す diff --git a/reference/filesystem/create_directory_symlink.md b/reference/filesystem/create_directory_symlink.md index b90860e220..ff42a0ac92 100644 --- a/reference/filesystem/create_directory_symlink.md +++ b/reference/filesystem/create_directory_symlink.md @@ -22,7 +22,7 @@ namespace std::filesystem { ## 効果 -- POSIX環境では、[`symlink()`](https://linuxjm.osdn.jp/html/LDP_man-pages/man2/symlink.2.html)関数を使用して、パス`to`のディレクトリに対するシンボリックリンクをパス`new_symlink`に作成する +- POSIX環境では、[`symlink()`](https://web.archive.org/web/20230205210429/http://linuxjm.osdn.jp/html/LDP_man-pages/man2/symlink.2.html)関数を使用して、パス`to`のディレクトリに対するシンボリックリンクをパス`new_symlink`に作成する - パス`to`は、パス`new_symlink`からの相対パスであることに注意 diff --git a/reference/filesystem/create_hard_link.md b/reference/filesystem/create_hard_link.md index 447e723774..a27c654172 100644 --- a/reference/filesystem/create_hard_link.md +++ b/reference/filesystem/create_hard_link.md @@ -20,7 +20,7 @@ namespace std::filesystem { ## 効果 -- POSIX環境では、[`link()`](https://linuxjm.osdn.jp/html/LDP_man-pages/man2/link.2.html)関数を使用して、パス`to`のファイルと同じinodeを参照するハードリンクをパス`new_hard_link`に作成する +- POSIX環境では、[`link()`](https://web.archive.org/web/20230206201555/http://linuxjm.osdn.jp/html/LDP_man-pages/man2/link.2.html)関数を使用して、パス`to`のファイルと同じinodeを参照するハードリンクをパス`new_hard_link`に作成する ## 戻り値 diff --git a/reference/filesystem/create_symlink.md b/reference/filesystem/create_symlink.md index 430d0cf52a..cc23ce7eae 100644 --- a/reference/filesystem/create_symlink.md +++ b/reference/filesystem/create_symlink.md @@ -20,7 +20,7 @@ namespace std::filesystem { ## 効果 -- POSIX環境では、[`symlink()`](https://linuxjm.osdn.jp/html/LDP_man-pages/man2/symlink.2.html)関数を使用して、パス`to`のファイル・ディレクトリに対するシンボリックリンクをパス`new_symlink`に作成する +- POSIX環境では、[`symlink()`](https://web.archive.org/web/20230205210429/http://linuxjm.osdn.jp/html/LDP_man-pages/man2/symlink.2.html)関数を使用して、パス`to`のファイル・ディレクトリに対するシンボリックリンクをパス`new_symlink`に作成する ## 戻り値 diff --git a/reference/filesystem/current_path.md b/reference/filesystem/current_path.md index fa7adeab4a..e772854734 100644 --- a/reference/filesystem/current_path.md +++ b/reference/filesystem/current_path.md @@ -24,12 +24,12 @@ namespace std::filesystem { ## 効果 - (3), (4) : パス`p`を、現在の作業ディレクトリとして設定する - - POSIX環境では、[`chdir()`](https://linuxjm.osdn.jp/html/LDP_man-pages/man2/chdir.2.html)関数を使用する + - POSIX環境では、[`chdir()`](https://web.archive.org/web/20230605001127/https://linuxjm.osdn.jp/html/LDP_man-pages/man2/chdir.2.html)関数を使用する ## 戻り値 - (1), (2) : 現在の作業ディレクトリの絶対パスを、ネイティブフォーマットとして返す - - POSIX環境では、[`getcwd()`](https://linuxjm.osdn.jp/html/LDP_man-pages/man3/getcwd.3.html)関数を使用する + - POSIX環境では、[`getcwd()`](https://web.archive.org/web/20230208075801/http://linuxjm.osdn.jp/html/LDP_man-pages/man3/getcwd.3.html)関数を使用する - エラーが発生した場合、 (2) では`path()`が返る - (3), (4) : なし diff --git a/reference/filesystem/file_size.md b/reference/filesystem/file_size.md index f1f8965e28..07c94ab692 100644 --- a/reference/filesystem/file_size.md +++ b/reference/filesystem/file_size.md @@ -20,7 +20,7 @@ namespace std::filesystem { ## 戻り値 - ファイルが存在しない、もしくはファイルシステムでエラーが発生した場合、 (1) では[`std::filesystem::filesystem_error`](filesystem_error.md)例外を送出し、 (2) では`ec`にエラー情報が設定されて`static_cast<`[`uintmax_t`](/reference/cstdint/uintmax_t.md)`>(-1)`が返る - `p`が通常ファイル、もしくは通常ファイルを指すシンボリックリンクである場合、ファイルサイズが返る - - POSIX環境では[`stat()`](https://linuxjm.osdn.jp/html/LDP_man-pages/man2/stat.2.html)関数の`st_size`メンバ変数を使用する + - POSIX環境では[`stat()`](https://web.archive.org/web/20230827123440/https://linuxjm.osdn.jp/html/LDP_man-pages/man2/stat.2.html)関数の`st_size`メンバ変数を使用する - `p`がそれ以外のファイル種別である場合は、実装定義の動作をする diff --git a/reference/filesystem/last_write_time.md b/reference/filesystem/last_write_time.md index fc1a977b13..c5731d1d57 100644 --- a/reference/filesystem/last_write_time.md +++ b/reference/filesystem/last_write_time.md @@ -27,10 +27,10 @@ namespace std::filesystem { ## 効果 - (1), (2) : パス`p`が指すエンティティのデータが最後に変更された時間を返す - - POSIX環境では[`stat()`](https://linuxjm.osdn.jp/html/LDP_man-pages/man2/stat.2.html)関数によって返される`st_mtime`メンバを使用する + - POSIX環境では[`stat()`](https://web.archive.org/web/20230827123440/https://linuxjm.osdn.jp/html/LDP_man-pages/man2/stat.2.html)関数によって返される`st_mtime`メンバを使用する - (2) : エラーが発生した場合は、`ec`にエラー情報が設定され、`file_time_type::min()`が返る - (3), (4) : パス`p`のエンティティに、最終更新日時として`new_time`を設定する - - POSIX環境では[`futimens()`](https://linuxjm.osdn.jp/html/LDP_man-pages/man2/utimensat.2.html)関数を使用する + - POSIX環境では[`futimens()`](https://web.archive.org/web/20230129193157/https://linuxjm.osdn.jp/html/LDP_man-pages/man2/utimensat.2.html)関数を使用する - この関数を実行した結果として、`last_write_time(p) == new_time`となることは保証されない。これはOSのファイルシステムの制限による - (4) : エラーが発生した場合は、`ec`にエラー情報が設定される diff --git a/reference/filesystem/remove.md b/reference/filesystem/remove.md index 9a131678e0..7b2cfa6f4b 100644 --- a/reference/filesystem/remove.md +++ b/reference/filesystem/remove.md @@ -17,7 +17,7 @@ namespace std::filesystem { ## 効果 -- POSIX環境では、[`remove()`](https://linuxjm.osdn.jp/html/LDP_man-pages/man3/remove.3.html)関数を使用して、ファイル・ディレクトリを削除する。この環境では、ディレクトリを削除する場合、そのディレクトリは空でなければならない +- POSIX環境では、[`remove()`](https://web.archive.org/web/20230207183630/http://linuxjm.osdn.jp/html/LDP_man-pages/man3/remove.3.html)関数を使用して、ファイル・ディレクトリを削除する。この環境では、ディレクトリを削除する場合、そのディレクトリは空でなければならない ## 戻り値 diff --git a/reference/filesystem/remove_all.md b/reference/filesystem/remove_all.md index adf2db2ba0..ac7f89e8df 100644 --- a/reference/filesystem/remove_all.md +++ b/reference/filesystem/remove_all.md @@ -21,7 +21,7 @@ namespace std::filesystem { ## 効果 - パス`p`のコンテンツを、再帰的に削除する -- POSIX環境では、それぞれのコンテンツの削除に、[`remove()`](https://linuxjm.osdn.jp/html/LDP_man-pages/man3/remove.3.html)関数を使用する +- POSIX環境では、それぞれのコンテンツの削除に、[`remove()`](https://web.archive.org/web/20230207183630/http://linuxjm.osdn.jp/html/LDP_man-pages/man3/remove.3.html)関数を使用する ## 戻り値 diff --git a/reference/filesystem/rename.md b/reference/filesystem/rename.md index 26268f06dd..f4d23b96bc 100644 --- a/reference/filesystem/rename.md +++ b/reference/filesystem/rename.md @@ -21,7 +21,7 @@ namespace std::filesystem { ## 効果 - パス`old_p`のファイル・ディレクトリを、パス`new_p`に名称変更する - - POSIX環境では、[`rename()`](https://linuxjm.osdn.jp/html/LDP_man-pages/man2/rename.2.html)関数を使用する + - POSIX環境では、[`rename()`](https://web.archive.org/web/20230207112323/http://linuxjm.osdn.jp/html/LDP_man-pages/man2/rename.2.html)関数を使用する - パス`old_p`とパス`new_p`が同じファイルに解決される場合、本関数はなにもしない - そうでない場合、名称変更操作には、以下のような効果も含む: - `new_p`がすでに存在する非ディレクトリのファイルに解決される場合、すでに存在している`new_p`のファイルは削除される diff --git a/reference/filesystem/resize_file.md b/reference/filesystem/resize_file.md index a805591029..acbc12041c 100644 --- a/reference/filesystem/resize_file.md +++ b/reference/filesystem/resize_file.md @@ -19,7 +19,7 @@ namespace std::filesystem { ## 効果 - ファイル`p`の大きさを、`new_size`バイトに変更する。 - - POSIX環境では、[`truncate()`](https://linuxjm.osdn.jp/html/LDP_man-pages/man2/truncate.2.html)関数を使用する + - POSIX環境では、[`truncate()`](https://web.archive.org/web/20230605150743/https://linuxjm.osdn.jp/html/LDP_man-pages/man2/truncate.2.html)関数を使用する ## 例外 diff --git a/reference/filesystem/space.md b/reference/filesystem/space.md index 64794c5d6b..b0e0d5f314 100644 --- a/reference/filesystem/space.md +++ b/reference/filesystem/space.md @@ -18,7 +18,7 @@ namespace std::filesystem { ## 戻り値 -- POSIX環境であれば、[`statvfs()`](https://linuxjm.osdn.jp/html/LDP_man-pages/man3/statvfs.3.html)関数を使用して、残り容量を取得する。 +- POSIX環境であれば、[`statvfs()`](https://web.archive.org/web/20230129184216/http://linuxjm.osdn.jp/html/LDP_man-pages/man3/statvfs.3.html)関数を使用して、残り容量を取得する。 - [`space_info::capacity`](space_info.md)の値は`statvfs::f_blocks * statvfs::f_frsize` - [`space_info::free`](space_info.md)の値は`statvfs::f_bfree * statvfs::f_frsize` - [`space_info::available`](space_info.md)の値は`statvfs::f_bavail * statvfs::f_frsize` diff --git a/reference/filesystem/status.md b/reference/filesystem/status.md index cfa32866e6..c7f9f15e90 100644 --- a/reference/filesystem/status.md +++ b/reference/filesystem/status.md @@ -39,7 +39,7 @@ return result; - (2) : - 可能なら、ファイルパス`p`が指すファイルの属性を決定する - - POSIX環境であれば[`stat()`](https://linuxjm.osdn.jp/html/LDP_man-pages/man2/stat.2.html)関数を使用する + - POSIX環境であれば[`stat()`](https://web.archive.org/web/20230827123440/https://linuxjm.osdn.jp/html/LDP_man-pages/man2/stat.2.html)関数を使用する - OSのファイルシステムAPIによってエラーが報告された場合、`ec`にエラー情報が設定される。そうでなければ、[`ec.clear()`](/reference/system_error/error_code/clear.md)を呼び出し、エラー情報をクリアする diff --git a/reference/filesystem/symlink_status.md b/reference/filesystem/symlink_status.md index 2188b4d764..8be7a5d004 100644 --- a/reference/filesystem/symlink_status.md +++ b/reference/filesystem/symlink_status.md @@ -39,7 +39,7 @@ return result; - (2) : - 可能なら、ファイルパス`p`が指すファイルの属性を決定する。シンボリックリンクに対しては、シンボリックリンクが指すファイルではなく、シンボリックリンク自体のファイル属性を決定する - - POSIX環境であれば[`lstat()`](https://linuxjm.osdn.jp/html/LDP_man-pages/man2/stat.2.html)関数を使用する + - POSIX環境であれば[`lstat()`](https://web.archive.org/web/20230827123440/https://linuxjm.osdn.jp/html/LDP_man-pages/man2/stat.2.html)関数を使用する - OSのファイルシステムAPIによってエラーが報告された場合、`ec`にエラー情報が設定される。そうでなければ、[`ec.clear()`](/reference/system_error/error_code/clear.md)を呼び出し、エラー情報をクリアする diff --git a/reference/ios/defaultfloat.md b/reference/ios/defaultfloat.md index e59d170e00..07639a3053 100644 --- a/reference/ios/defaultfloat.md +++ b/reference/ios/defaultfloat.md @@ -13,7 +13,7 @@ namespace std { ## 概要 浮動小数点数を初期状態の書式で出力することを指示するマニピュレータ。 -この書式は、出力値や出力すべき精度により小数点数表記と指数表記が切り替わるものである([`printf()`](http://linuxjm.osdn.jp/html/LDP_man-pages/man3/printf.3.html)関数の`%g`/`%G`相当)。 +この書式は、出力値や出力すべき精度により小数点数表記と指数表記が切り替わるものである([`printf()`](https://web.archive.org/web/20230605132525/https://linuxjm.osdn.jp/html/LDP_man-pages/man3/printf.3.html)関数の`%g`/`%G`相当)。 ## 効果 `str.unsetf(ios_base::floatfield)`を実行する。 diff --git a/reference/ios/hexfloat.md b/reference/ios/hexfloat.md index 9eae0997df..7a0efd1f4e 100644 --- a/reference/ios/hexfloat.md +++ b/reference/ios/hexfloat.md @@ -13,7 +13,7 @@ namespace std { ## 概要 浮動小数点数を十六進法で入出力することを指示するマニピュレータ。 -[`printf()`](http://linuxjm.osdn.jp/html/LDP_man-pages/man3/printf.3.html)関数の`%a`/`%A`相当。 +[`printf()`](https://web.archive.org/web/20230605132525/https://linuxjm.osdn.jp/html/LDP_man-pages/man3/printf.3.html)関数の`%a`/`%A`相当。 ## 効果 `str.setf(ios_base::fixed | ios_base::scientific, ios_base::floatfield)`を実行する。 diff --git a/reference/memory/get_temporary_buffer.md b/reference/memory/get_temporary_buffer.md index a206697a7c..85e435acf7 100644 --- a/reference/memory/get_temporary_buffer.md +++ b/reference/memory/get_temporary_buffer.md @@ -17,7 +17,7 @@ pair get_temporary_buffer(ptrdiff_t n) noexcept; * pair[link /reference/utility/pair.md] * ptrdiff_t[link /reference/cstddef/ptrdiff_t.md] -この機能は、C++17から非推奨となり、C++20で削除された。短期的な用途のメモリ領域確保には、[`alloca()`](https://linuxjm.osdn.jp/html/LDP_man-pages/man3/alloca.3.html)のようなスタックからメモリを確保するなど、他の機能を使用すること。 +この機能は、C++17から非推奨となり、C++20で削除された。短期的な用途のメモリ領域確保には、[`alloca()`](https://web.archive.org/web/20230207110403/http://linuxjm.osdn.jp/html/LDP_man-pages/man3/alloca.3.html)のようなスタックからメモリを確保するなど、他の機能を使用すること。 ## 概要 @@ -51,7 +51,7 @@ pair get_temporary_buffer(ptrdiff_t n) noexcept; 将来的にスタックからメモリ確保をする仕組みが検討されているが、これらの関数は設計として例外安全性やRAIIといったものが考慮されていない。スタックからメモリ確保する機能が入ったとしても、これらの関数の内部を改善することはできないと判断され、非推奨となった。 -スタックからメモリ確保する機能は、現在の標準ライブラリにはない。そのため、代わりとしては、配置new構文や、標準外の[`alloca()`](https://linuxjm.osdn.jp/html/LDP_man-pages/man3/alloca.3.html)関数のような機能を使用すること。 +スタックからメモリ確保する機能は、現在の標準ライブラリにはない。そのため、代わりとしては、配置new構文や、標準外の[`alloca()`](https://web.archive.org/web/20230207110403/http://linuxjm.osdn.jp/html/LDP_man-pages/man3/alloca.3.html)関数のような機能を使用すること。 ## 例 diff --git a/reference/random/random_device.md b/reference/random/random_device.md index 7b7c4644b5..7a31d246fd 100644 --- a/reference/random/random_device.md +++ b/reference/random/random_device.md @@ -13,7 +13,7 @@ namespace std { ## 概要 `random_device`クラスは、非決定論的な乱数生成エンジンである。予測不能な乱数を生成することから、擬似乱数生成エンジンのシード初期化や、暗号化といった用途に使用できる。 -`random_device`の実装は処理系定義だが、Windows環境では[`CryptGenRandom()`](https://docs.microsoft.com/ja-jp/windows/win32/api/wincrypt/nf-wincrypt-cryptgenrandom)関数のラッパーとして、UNIX系環境では[`/dev/random`](https://linuxjm.osdn.jp/html/LDP_man-pages/man4/random.4.html)や[`/dev/urandom`](https://linuxjm.osdn.jp/html/LDP_man-pages/man4/random.4.html)から値を読み取る形で定義される場合がある。 +`random_device`の実装は処理系定義だが、Windows環境では[`CryptGenRandom()`](https://docs.microsoft.com/ja-jp/windows/win32/api/wincrypt/nf-wincrypt-cryptgenrandom)関数のラッパーとして、UNIX系環境では[`/dev/random`](https://web.archive.org/web/20230207121147/http://linuxjm.osdn.jp/html/LDP_man-pages/man4/random.4.html)や[`/dev/urandom`](https://web.archive.org/web/20230207121147/http://linuxjm.osdn.jp/html/LDP_man-pages/man4/random.4.html)から値を読み取る形で定義される場合がある。 実装の制限によって予測不能な乱数生成器を定義できない場合、このクラスは**擬似乱数生成器で定義される可能性がある**ため、特にクロスプラットフォームなコードを書く場合は注意すること。 予測不能な乱数はソフトウェアでは実装できないため、これらはハードウェアのノイズやマウスの動きといった環境ノイズをエントロピープールとして乱数を生成する。 @@ -323,7 +323,7 @@ int main() - GCC: [Implementation Status 26.5.6 [rand.device]](https://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#iso.2011.specific) - Microdoft Visual Studio 2017: [random\_device Class](https://docs.microsoft.com/en-us/cpp/standard-library/random-device-class) - [/dev/random - Wikipedia](https://ja.wikipedia.org/wiki//dev/random) -- [Man page of RANDOM](https://linuxjm.osdn.jp/html/LDP_man-pages/man4/random.4.html) +- [Man page of RANDOM](https://web.archive.org/web/20230207121147/http://linuxjm.osdn.jp/html/LDP_man-pages/man4/random.4.html) - [CryptGenRandom function (wincrypt.h) - Win32 apps | Microsoft Docs](https://docs.microsoft.com/ja-jp/windows/win32/api/wincrypt/nf-wincrypt-cryptgenrandom) - [random_deviceの実装(再訪) - 煙人計画](http://vaporoid.hateblo.jp/entry/2014/07/25/154852) - [Replacing `/dev/urandom` May 4, 2016 - Security](https://lwn.net/Articles/685371/) diff --git a/reference/semaphore/counting_semaphore.md b/reference/semaphore/counting_semaphore.md index ffc5544a26..fa107a488f 100644 --- a/reference/semaphore/counting_semaphore.md +++ b/reference/semaphore/counting_semaphore.md @@ -142,7 +142,7 @@ int main() ## 参照 -- [semop, semtimedop - System V セマフォの操作](https://linuxjm.osdn.jp/html/LDP_man-pages/man2/semop.2.html) -- [sem_overview - POSIX セマフォの概要](https://linuxjm.osdn.jp/html/LDP_man-pages/man7/sem_overview.7.html) +- [semop, semtimedop - System V セマフォの操作](https://web.archive.org/web/20230605023712/https://linuxjm.osdn.jp/html/LDP_man-pages/man2/semop.2.html) +- [sem_overview - POSIX セマフォの概要](https://web.archive.org/web/20230611015117/https://linuxjm.osdn.jp/html/LDP_man-pages/man7/sem_overview.7.html) - [Windows, Semaphore Objects](https://docs.microsoft.com/en-us/windows/win32/sync/semaphore-objects) - [macOS/iOS, Dispatch Semaphore](https://developer.apple.com/documentation/dispatch/dispatch_semaphore) diff --git a/reference/semaphore/counting_semaphore/acquire.md b/reference/semaphore/counting_semaphore/acquire.md index b29a40b350..98a70413c3 100644 --- a/reference/semaphore/counting_semaphore/acquire.md +++ b/reference/semaphore/counting_semaphore/acquire.md @@ -36,7 +36,7 @@ void acquire(); ## 備考 「効果」欄では`acquire`メンバ関数の振る舞いを手続き的に説明しているが、実際の処理系においてはオペレーティングシステムが提供する効率的なセマフォ操作関数が利用されると期待される。 -- POSIXセマフォでは[`sem_wait`関数](https://linuxjm.osdn.jp/html/LDP_man-pages/man3/sem_wait.3.html)が提供される。 +- POSIXセマフォでは[`sem_wait`関数](https://web.archive.org/web/20230206231852/http://linuxjm.osdn.jp/html/LDP_man-pages/man3/sem_wait.3.html)が提供される。 - Windowsセマフォでは[`WaitForSingleObject`関数](https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-waitforsingleobject)ファミリが提供される。 diff --git a/reference/shared_mutex/shared_mutex.md b/reference/shared_mutex/shared_mutex.md index 5c124a611a..18e66ae31b 100644 --- a/reference/shared_mutex/shared_mutex.md +++ b/reference/shared_mutex/shared_mutex.md @@ -29,7 +29,7 @@ namespace std { ## 備考 - このクラスは現状、書き込みロックと読み込みロックについてのスケジューリング戦略を規定せず、カスタマイズもできない。そのため、書き込みロックがなかなか取得できない、読み込みロックがなかなか取得できないというスタベーションの問題が発生した場合に、ユーザーの状況に合わせて戦略を変更することができない。POSIXのReaders-writer lockの実装では、スケジューリングのオプションを指定できる - - [`pthread_rwlockattr_setkind_np()`](https://linuxjm.osdn.jp/html/LDP_man-pages/man3/pthread_rwlockattr_setkind_np.3.html) + - [`pthread_rwlockattr_setkind_np()`](https://web.archive.org/web/20230130174238/http://linuxjm.osdn.jp/html/LDP_man-pages/man3/pthread_rwlockattr_setkind_np.3.html) ## メンバ関数 diff --git a/reference/shared_mutex/shared_timed_mutex.md b/reference/shared_mutex/shared_timed_mutex.md index 07aaa1a928..c80dfc9c0f 100644 --- a/reference/shared_mutex/shared_timed_mutex.md +++ b/reference/shared_mutex/shared_timed_mutex.md @@ -31,7 +31,7 @@ namespace std { ## 備考 - このクラスは現状、書き込みロックと読み込みロックについてのスケジューリング戦略を規定せず、カスタマイズもできない。そのため、書き込みロックがなかなか取得できない、読み込みロックがなかなか取得できないというスタベーションの問題が発生した場合に、ユーザーの状況に合わせて戦略を変更することができない。POSIXのReaders-writer lockの実装では、スケジューリングのオプションを指定できる - - [`pthread_rwlockattr_setkind_np()`](https://linuxjm.osdn.jp/html/LDP_man-pages/man3/pthread_rwlockattr_setkind_np.3.html) + - [`pthread_rwlockattr_setkind_np()`](https://web.archive.org/web/20230130174238/http://linuxjm.osdn.jp/html/LDP_man-pages/man3/pthread_rwlockattr_setkind_np.3.html) ## メンバ関数 diff --git a/reference/system_error/errc.md b/reference/system_error/errc.md index baf735a3de..0f11d1b595 100644 --- a/reference/system_error/errc.md +++ b/reference/system_error/errc.md @@ -99,5 +99,5 @@ namespace std { 非推奨とされているものは、対応する`errno`値がPOSIX規格において廃止されたことに対応している。 ## 参照 -- [Man page of ERRNO](http://linuxjm.osdn.jp/html/LDP_man-pages/man3/errno.3.html) +- [Man page of ERRNO](https://web.archive.org/web/20230205202552/http://linuxjm.osdn.jp/html/LDP_man-pages/man3/errno.3.html) - [LWG Issue 3869. Deprecate `std::errc` constants related to UNIX STREAMS](https://cplusplus.github.io/LWG/issue3869) diff --git a/reference/thread/this_thread/yield.md b/reference/thread/this_thread/yield.md index 2c765034ff..ed9dccab9a 100644 --- a/reference/thread/this_thread/yield.md +++ b/reference/thread/this_thread/yield.md @@ -28,7 +28,7 @@ namespace this_thread { ## 備考 -C++11標準の定義では処理系依存だが、その動作はPOSIXの[`sched_yield()`](https://linuxjm.osdn.jp/html/LDP_man-pages/man2/sched_yield.2.html)関数やWindows APIの[`SwitchToThread()`](https://docs.microsoft.com/ja-JP/windows/win32/api/processthreadsapi/nf-processthreadsapi-switchtothread)関数などを参考のこと。 +C++11標準の定義では処理系依存だが、その動作はPOSIXの[`sched_yield()`](https://web.archive.org/web/20230205233555/http://linuxjm.osdn.jp/html/LDP_man-pages/man2/sched_yield.2.html)関数やWindows APIの[`SwitchToThread()`](https://docs.microsoft.com/ja-JP/windows/win32/api/processthreadsapi/nf-processthreadsapi-switchtothread)関数などを参考のこと。 Visual C++では、Windows APIの[`Sleep()`](https://docs.microsoft.com/ja-jp/windows/win32/api/synchapi/nf-synchapi-sleep)関数を使った実装となっている。ただし、12.0でWindowsストア向けアプリケーションを対象とする場合は、`Sleep()`関数が許可されていないため、`WaitForSingleObject()`関数のタイムアウト時間に最小値1ミリ秒を指定して呼び出す実装となっている。 From 56dc9faa8b2d540bdbb01f0e4b51f9749922ec45 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 22 Nov 2023 10:33:21 +0900 Subject: [PATCH 0561/3948] =?UTF-8?q?osdn.jp=E3=81=AE=E3=83=AA=E3=83=B3?= =?UTF-8?q?=E3=82=AF=E3=82=92webarchive=E3=81=AB=E5=B7=AE=E3=81=97?= =?UTF-8?q?=E6=9B=BF=E3=81=88=20#1214=20#1215?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/memory/return_temporary_buffer.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/memory/return_temporary_buffer.md b/reference/memory/return_temporary_buffer.md index a3e6448f9a..89c5c75832 100644 --- a/reference/memory/return_temporary_buffer.md +++ b/reference/memory/return_temporary_buffer.md @@ -10,7 +10,7 @@ template void return_temporary_buffer(T* p); ``` -この機能は、C++17から非推奨となり、C++20で削除された。短期的な用途のメモリ領域確保には、[`alloca()`](https://linuxjm.osdn.jp/html/LDP_man-pages/man3/alloca.3.html)のようなスタックからメモリを確保するなど、他の機能を使用すること。 +この機能は、C++17から非推奨となり、C++20で削除された。短期的な用途のメモリ領域確保には、[`alloca()`](https://web.archive.org/web/20230207110403/http://linuxjm.osdn.jp/html/LDP_man-pages/man3/alloca.3.html)のようなスタックからメモリを確保するなど、他の機能を使用すること。 ## 概要 @@ -38,7 +38,7 @@ void return_temporary_buffer(T* p); 将来的にスタックからメモリ確保をする仕組みが検討されているが、これらの関数は設計として例外安全性やRAIIといったものが考慮されていない。スタックからメモリ確保する機能が入ったとしても、これらの関数の内部を改善することはできないと判断され、非推奨となった。 -スタックからメモリ確保する機能は、現在の標準ライブラリにはない。そのため、代わりとしては、配置new構文や、標準外の[`alloca()`](https://linuxjm.osdn.jp/html/LDP_man-pages/man3/alloca.3.html)関数のような機能を使用すること。 +スタックからメモリ確保する機能は、現在の標準ライブラリにはない。そのため、代わりとしては、配置new構文や、標準外の[`alloca()`](https://web.archive.org/web/20230207110403/http://linuxjm.osdn.jp/html/LDP_man-pages/man3/alloca.3.html)関数のような機能を使用すること。 ## 例 From 519f8a74927665b47e085f2cda66522126058cb7 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 24 Nov 2023 12:32:53 +0900 Subject: [PATCH 0562/3948] =?UTF-8?q?to=5Fchars=20/=20from=5Fchars=20:=20?= =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE=E9=A3=BE=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/charconv/from_chars.md | 2 ++ reference/charconv/to_chars.md | 3 +++ 2 files changed, 5 insertions(+) diff --git a/reference/charconv/from_chars.md b/reference/charconv/from_chars.md index 855170e2ed..6e3d84bc54 100644 --- a/reference/charconv/from_chars.md +++ b/reference/charconv/from_chars.md @@ -43,6 +43,7 @@ namespace std { ``` * see below[italic] * integer-type[italic] +* from_chars_result[link from_chars_result.md] ## 概要 @@ -349,6 +350,7 @@ int main() { * end[link /reference/ranges/end.md] * to_address[link /reference/memory/to_address.md] * format[link /reference/format/format.md] +* std::chars_format[link chars_format.md] #### 出力 diff --git a/reference/charconv/to_chars.md b/reference/charconv/to_chars.md index 5651022098..5fe7dc76c9 100644 --- a/reference/charconv/to_chars.md +++ b/reference/charconv/to_chars.md @@ -94,6 +94,7 @@ namespace std { ``` * see below[italic] * integer-type[italic] +* to_chars_result[link to_chars_result.md] ## 概要 与えられた数値(`value`)を文字列へ変換し、`[first, last)`内へ出力する。 @@ -264,6 +265,8 @@ int main() } ``` * std::to_chars[color ff0000] +* std::chars_format[link chars_format.md] +* std::errc[link /reference/system_error/errc.md] ### 出力例(VS2019 16.5 preview 1) ``` From 8a944b14616ef124fb61c5793c581789b2d58768 Mon Sep 17 00:00:00 2001 From: suomesta Date: Tue, 28 Nov 2023 21:47:39 +0900 Subject: [PATCH 0563/3948] fix a sample of atomic. improve some samples and expressions --- reference/iterator/iter_move.md | 2 +- reference/memory/atomic.md | 4 ++-- reference/memory/make_unique_for_overwrite.md | 10 ++++------ reference/type_traits/is_corresponding_member.md | 2 +- reference/type_traits/is_pod.md | 1 - .../is_pointer_interconvertible_with_class.md | 2 +- reference/type_traits/is_trivial.md | 3 +-- 7 files changed, 10 insertions(+), 14 deletions(-) diff --git a/reference/iterator/iter_move.md b/reference/iterator/iter_move.md index f77ff7ec78..9815d507aa 100644 --- a/reference/iterator/iter_move.md +++ b/reference/iterator/iter_move.md @@ -78,7 +78,7 @@ namespace std { struct I { int n = 0; - // HIdden friendsとして定義、prvalueを返す + // Hidden friendsとして定義、prvalueを返す friend auto iter_move(I& self) -> I { return std::move(self); } diff --git a/reference/memory/atomic.md b/reference/memory/atomic.md index f5a561f620..9d97732a0b 100644 --- a/reference/memory/atomic.md +++ b/reference/memory/atomic.md @@ -70,9 +70,9 @@ void producer() { void consumer() { // データが供給されたら、resourceとyを入れ替える (resourceが空になり、yにデータが入る)。 std::shared_ptr y; - while (!resource.exchange(y)) { - std::cout << *y << std::endl; + while (!(y = resource.exchange(y))) { } + std::cout << *y << std::endl; } int main() diff --git a/reference/memory/make_unique_for_overwrite.md b/reference/memory/make_unique_for_overwrite.md index e22c00e000..35fe5abf68 100644 --- a/reference/memory/make_unique_for_overwrite.md +++ b/reference/memory/make_unique_for_overwrite.md @@ -47,24 +47,22 @@ namespace std { ```cpp example #include #include -#include int main() { - std::unique_ptr> p1 = std::make_unique_for_overwrite>(); + std::unique_ptr i1 = std::make_unique_for_overwrite(); // 必ず初期化する - p1->first = 0; - p1->second = 0; + *i1 = 0; - std::cout << p1->first << ':' << p1->second << std::endl; + std::cout << *i1 << std::endl; } ``` * std::make_unique_for_overwrite[color ff0000] ### 出力 ``` -0:0 +0 ``` ## バージョン diff --git a/reference/type_traits/is_corresponding_member.md b/reference/type_traits/is_corresponding_member.md index acd1794989..18b10a77d2 100644 --- a/reference/type_traits/is_corresponding_member.md +++ b/reference/type_traits/is_corresponding_member.md @@ -1,6 +1,6 @@ # is_corresponding_member * type_traits[meta header] -* function[meta id-type] +* function template[meta id-type] * std[meta namespace] * cpp20[meta cpp] diff --git a/reference/type_traits/is_pod.md b/reference/type_traits/is_pod.md index 230511dfaf..7faded88f4 100644 --- a/reference/type_traits/is_pod.md +++ b/reference/type_traits/is_pod.md @@ -54,7 +54,6 @@ static_assert(std::is_same::type, std::false_type>::value, "ty static_assert(std::is_pod() == false, "is_pod() == false"); static_assert(std::is_pod::value == true, "const volatile int is POD"); -static_assert(std::is_pod::value == false, "int& is not POD"); struct POD_struct{}; struct non_POD_struct { diff --git a/reference/type_traits/is_pointer_interconvertible_with_class.md b/reference/type_traits/is_pointer_interconvertible_with_class.md index 104dd8dabe..2291a70eb0 100644 --- a/reference/type_traits/is_pointer_interconvertible_with_class.md +++ b/reference/type_traits/is_pointer_interconvertible_with_class.md @@ -1,6 +1,6 @@ # is_pointer_interconvertible_with_class * type_traits[meta header] -* function[meta id-type] +* function template[meta id-type] * std[meta namespace] * cpp20[meta cpp] diff --git a/reference/type_traits/is_trivial.md b/reference/type_traits/is_trivial.md index 38031617ee..1a3677574a 100644 --- a/reference/type_traits/is_trivial.md +++ b/reference/type_traits/is_trivial.md @@ -45,14 +45,13 @@ static_assert(std::is_same::type, std::false_type>::value, static_assert(std::is_trivial() == false, "is_trivial() == false"); static_assert(std::is_trivial::value == true, "const volatile int is trivial"); -static_assert(std::is_trivial::value == false, "int& is not trivial"); class trivial_class{}; struct non_trivial_class { non_trivial_class() {} // デフォルトコンストラクタが非トリビアル }; static_assert(std::is_trivial::value == true, "trivial_class is trivial"); -static_assert(std::is_trivial::value == true, "trivial_class& is trivial"); +static_assert(std::is_trivial::value == false, "trivial_class& is not trivial"); static_assert(std::is_trivial::value == false, "non_trivial_class is not trivial"); static_assert(std::is_trivial::value == false, "non_trivial_class& is not trivial"); From 56eaf74abaa2664b46a481a7be26dda475ecde59 Mon Sep 17 00:00:00 2001 From: yumetodo Date: Sun, 3 Dec 2023 21:01:23 +0900 Subject: [PATCH 0564/3948] fix(ci): ripgrep 14.0.3 --- .github/workflows/detect_forbidden_characters.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/detect_forbidden_characters.yml b/.github/workflows/detect_forbidden_characters.yml index f51f493c24..366f88492e 100644 --- a/.github/workflows/detect_forbidden_characters.yml +++ b/.github/workflows/detect_forbidden_characters.yml @@ -14,7 +14,7 @@ jobs: build: runs-on: ubuntu-latest env: - RIPGREP_VERSION: 13.0.0 + RIPGREP_VERSION: 14.0.3 BIN_DIR: ${{ github.workspace }}/bin REPO_DIR: repo cache-version: v1 From 1736ad68bc5288f5e341cac9eeef887830f0e3ed Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Mon, 4 Dec 2023 02:58:43 +0900 Subject: [PATCH 0565/3948] =?UTF-8?q?as=5Frvalue=5Fview=E3=81=AE=E8=A7=A3?= =?UTF-8?q?=E8=AA=AC=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges.md | 4 +- reference/ranges/as_rvalue_view.md | 185 +++++++++++++++++++++++++++++ 2 files changed, 187 insertions(+), 2 deletions(-) create mode 100644 reference/ranges/as_rvalue_view.md diff --git a/reference/ranges.md b/reference/ranges.md index 37cae27000..dc86669e79 100644 --- a/reference/ranges.md +++ b/reference/ranges.md @@ -224,8 +224,8 @@ range | adaptor(args...) | 名前 | 説明 | 対応バージョン | |------------------------------------------------|--------------------------------------------------------------|----------------| -| [`as_rvalue_view`](ranges/as_rvalue_view.md.nolink) | 各要素をrvalueにするビュー (class template) | C++23 | -| [`views::as_rvalue`](ranges/as_rvalue.md.nolink) | `as_rvalue_view`を生成する (customization point object) | C++23 | +| [`as_rvalue_view`](ranges/as_rvalue_view.md) | 各要素をrvalueにするビュー (class template) | C++23 | +| [`views::as_rvalue`](ranges/as_rvalue_view.md) | `as_rvalue_view`を生成する (customization point object) | C++23 | ### filter view diff --git a/reference/ranges/as_rvalue_view.md b/reference/ranges/as_rvalue_view.md new file mode 100644 index 0000000000..fb731ee54d --- /dev/null +++ b/reference/ranges/as_rvalue_view.md @@ -0,0 +1,185 @@ +# as_rvalue_view +* ranges[meta header] +* std::ranges[meta namespace] +* class template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template + requires (input_range) + class as_rvalue_view : public view_interface> { …… }; // (1) + + namespace views { + inline constexpr /*unspecified*/ as_rvalue = /*unspecified*/; // (2) + } +} +``` +* view[link view.md] +* view_interface[link view_interface.md] +* input_range[link input_range.md] + +## 概要 + +- (1): 要素をrvalueにする[`view`](view.md) +- (2): `as_rvalue_view`または同じ効果を実現する[`view`](view.md)を生成するRangeアダプタオブジェクト + +この[`view`](view.md)は、あるRangeの要素をムーブして別のコンテナに挿入する場合などに利用できる。 + +```cpp +vector words = {"the", "quick", "brown", "fox", "ate", "a", "pterodactyl"}; +vector new_words; +ranges::copy(words | views::as_rvalue, back_inserter(new_words)); +``` + +### Rangeコンセプト + +| borrowed | sized | output | input | forward | bidirectional | random_access | contiguous | common | viewable | view | +|----------|-------|--------|-------|---------|---------------|---------------|------------|--------|----------|------| +| ※ | ※ | ※ | ※ | ※ | ※ | ※ | ※ | ※ | ○ | ○ | + +※ 参照先のRangeに従う + +## テンプレートパラメータ制約 + +- [`view`](view.md)`` +- `!`[`common_range`](common_range.md)`` +- [`copyable`](/reference/concepts/copyable.md)`<`[`iterator_t`](iterator_t.md)`>` + +## 効果 + +- (2): 式`views::as_rvalue(E)`はRangeアダプタオブジェクトを表し、その効果は次の通り + - 要素がすでに右辺値参照であれば([`same_as`](/reference/concepts/same_as.md)`<`[`range_rvalue_reference_t`](range_rvalue_reference_t.md)`, `[`range_reference_t`](range_reference_t.md)`>`)、[`views::all`](all.md)`(E)`と等しい + - それ以外のとき、`as_rvalue_view{E}`と等しい + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|--------------------------------------------------|-----------------------------------|----------------| +| [`(constructor)`](as_rvalue_view/op_constructor.md.nolink) | コンストラクタ | C++20 | +| [`base`](as_rvalue_view/base.md.nolink) | `R`の参照を取得する | C++20 | +| [`begin`](as_rvalue_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++20 | +| [`end`](as_rvalue_view/end.md.nolink) | 番兵を取得する | C++20 | +| [`size`](as_rvalue_view/size.md.nolink) | 要素数を取得する | C++20 | + +`r`を参照先のRangeとする。`size`は、[`ranges::size`](size.md)`(r)`が有効な式であるときに定義される。 + +## 継承しているメンバ関数 + +| 名前 | 説明 | 対応バージョン | +|----------------------------------------------|-----------------------------------|----------------| +| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++20 | +| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++20 | +| [`data`](view_interface/data.md) | Rangeの先頭へのポインタを取得する | C++20 | +| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | +| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | +| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | + +## 推論補助 + +| 名前 | 説明 | 対応バージョン | +|-------------------------------------------------------|------------------------------|----------------| +| [`(deduction_guide)`](as_rvalue_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++20 | + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + using namespace std; + + vector words = {"the", "quick", "brown", "fox", "ate", "a", "pterodactyl"}; + vector new_words; + ranges::copy(words | views::as_rvalue, back_inserter(new_words)); + print("{}", new_words); +} +``` +* views::as_rvalue[color ff0000] +* print[link /reference/print/print.md] + +### 出力 +``` +["the", "quick", "brown", "fox", "ate", "a", "pterodactyl"] +``` + +## 実装例 +```cpp +namespace std::ranges { + template + requires input_range + class as_rvalue_view : public view_interface> { + V base_ = V(); // exposition only + + public: + as_rvalue_view() requires default_initializable = default; + constexpr explicit as_rvalue_view(V base); + + constexpr V base() const & requires copy_constructible { return base_; } + constexpr V base() && { return std::move(base_); } + + constexpr auto begin() requires (!simple-view) { + return move_iterator(ranges::begin(base_)); + } + + constexpr auto begin() const requires range { + return move_iterator(ranges::begin(base_)); + } + + constexpr auto end() requires (!simple-view) { + if constexpr (common_range) { + return move_iterator(ranges::end(base_)); + } else { + return move_sentinel(ranges::end(base_)); + } + } + + constexpr auto end() const requires range { + if constexpr (common_range) { + return move_iterator(ranges::end(base_)); + } else { + return move_sentinel(ranges::end(base_)); + } + } + + constexpr auto size() requires sized_range { return ranges::size(base_); } + constexpr auto size() const requires sized_range { return ranges::size(base_); } + }; + + template + as_rvalue_view(R&&) -> as_rvalue_view>; +} + +constexpr explicit as_rvalue_view(V base); +``` +* view[link view.md] +* view_interface[link view_interface.md] +* common_range[link common_range.md] +* sized_range[link sized_range.md] +* simple-view[link simple-view.md] +* default_initializable[link /reference/concepts/default_initializable.md] +* copy_constructible[link /reference/concepts/copy_constructible.md] +* move_iterator[link /reference/iterator/move_iterator.md] +* ranges::begin[link begin.md] +* ranges::end[link end.md] +* ranges::size[link size.md] +* views::all_t[link all.md] + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ? +- [GCC](/implementation.md#gcc): ? +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): ? + +## 参照 +- [N4950 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) +- [C++20 ranges](https://techbookfest.org/product/5134506308665344) +- [P2017R1 Conditionally borrowed ranges](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2017r1.html) From d590681ab31efacd313d8be0da32f51c252d9080 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Mon, 4 Dec 2023 03:05:54 +0900 Subject: [PATCH 0566/3948] =?UTF-8?q?as=5Frvalue=5Fview=E3=81=AE=E5=8F=82?= =?UTF-8?q?=E8=80=83=E3=83=AA=E3=83=B3=E3=82=AF=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/as_rvalue_view.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/reference/ranges/as_rvalue_view.md b/reference/ranges/as_rvalue_view.md index fb731ee54d..ffac933cbf 100644 --- a/reference/ranges/as_rvalue_view.md +++ b/reference/ranges/as_rvalue_view.md @@ -180,6 +180,4 @@ constexpr explicit as_rvalue_view(V base); - [Visual C++](/implementation.md#visual_cpp): ? ## 参照 -- [N4950 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) -- [C++20 ranges](https://techbookfest.org/product/5134506308665344) -- [P2017R1 Conditionally borrowed ranges](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2017r1.html) +- [N4950 24 Ranges library](https://timsong-cpp.github.io/cppwp/ranges) From 46c569dccacbaa4d2a1605ea536effe588b239f8 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Mon, 4 Dec 2023 03:08:22 +0900 Subject: [PATCH 0567/3948] =?UTF-8?q?as=5Frvalue=5Fview=E3=81=AE=E8=AA=AC?= =?UTF-8?q?=E6=98=8E=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/as_rvalue_view.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/ranges/as_rvalue_view.md b/reference/ranges/as_rvalue_view.md index ffac933cbf..b849c1b65b 100644 --- a/reference/ranges/as_rvalue_view.md +++ b/reference/ranges/as_rvalue_view.md @@ -49,7 +49,7 @@ ranges::copy(words | views::as_rvalue, back_inserter(new_words)); ## 効果 - (2): 式`views::as_rvalue(E)`はRangeアダプタオブジェクトを表し、その効果は次の通り - - 要素がすでに右辺値参照であれば([`same_as`](/reference/concepts/same_as.md)`<`[`range_rvalue_reference_t`](range_rvalue_reference_t.md)`, `[`range_reference_t`](range_reference_t.md)`>`)、[`views::all`](all.md)`(E)`と等しい + - 要素がすでに右辺値参照であれば(`T = decltype((E))`として、[`same_as`](/reference/concepts/same_as.md)`<`[`range_rvalue_reference_t`](range_rvalue_reference_t.md)`, `[`range_reference_t`](range_reference_t.md)`>`)、[`views::all`](all.md)`(E)`と等しい - それ以外のとき、`as_rvalue_view{E}`と等しい ## メンバ関数 From ac9e77ef97ed26336167fc8af261533ea6d511f8 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Mon, 4 Dec 2023 12:27:50 +0900 Subject: [PATCH 0568/3948] =?UTF-8?q?fold=E9=96=A2=E6=95=B0=E3=83=AA?= =?UTF-8?q?=E3=83=B3=E3=82=AF=E8=BF=BD=E5=8A=A0=20#1088?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23/feature_test_macros.md | 1 + reference/algorithm.md | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/lang/cpp23/feature_test_macros.md b/lang/cpp23/feature_test_macros.md index c1b8095cab..8bf3ab16e7 100644 --- a/lang/cpp23/feature_test_macros.md +++ b/lang/cpp23/feature_test_macros.md @@ -16,6 +16,7 @@ | マクロ名 | 値 | 機能 | ヘッダ | |----------|----|------|--------| |`__cpp_lib_ranges_as_const`|`202207L`|`ranges::cbegin`が常に定数イテレータを返すようにする|[``](/reference/ranges.md)| +|`__cpp_lib_ranges_fold`|`202207L`|`fold`アルゴリズム|[``](/reference/algorithm.md)| ## 参照 diff --git a/reference/algorithm.md b/reference/algorithm.md index fb2fcc5646..71a01885ac 100644 --- a/reference/algorithm.md +++ b/reference/algorithm.md @@ -420,6 +420,19 @@ ranges::sort(pv, {}, &Parson::name); | [`ranges::prev_permutation`](algorithm/ranges_prev_permutation.md) | 前の順列を生成する | C++20 | | [`ranges::is_permutation`](algorithm/ranges_is_permutation.md) | 範囲が順列かを判定する | C++20 | +### `fold`アルゴリズム + +`fold`操作は、初期値及び累積値とともに範囲の各要素について与えられた関数を適用していき、その結果を返すものである。これは、数値集計処理に特化した[`accumulate`](/reference/numeric/accumulate.md)を改善しより汎用的にしたものである。処理を範囲のどちら側から始めるかによって、`foldl`(`fold_left`)と`foldr`(`fold_right`)の2種類がある。 + +| 名前 | 説明 | 対応バージョン | +|-------------------------------------------------------|------------------------|-------| +| [`ranges::fold_left`](algorithm/fold_left.md.nolink) | 範囲の左(先頭)からの`fold` | C++23 | +| [`ranges::fold_right`](algorithm/fold_right.md.nolink)| 範囲の右(終端)からの`fold` | C++23 | +| [`ranges::fold_left_first`](algorithm/fold_left_first.md.nolink)| 範囲の左(先頭)からの`fold`、初期値を省略する | C++23 | +| [`ranges::fold_right_last`](algorithm/fold_right_last.md.nolink)| 範囲の右(終端)からの`fold`、初期値を省略する | C++23 | +| [`ranges::fold_left_with_iter`](algorithm/fold_left_with_iter.md.nolink) | 範囲の左(先頭)からの`fold`、終端イテレータを返す | C++23 | +| [`ranges::fold_left_first_with_iter`](algorithm/fold_left_first_with_iter.md.nolink) | 範囲の左(先頭)からの`fold`、初期値を省略し終端イテレータを返す | C++23 | + ### 戻り値 これらの型は、複数の値を1つの戻り値として返すために使われる汎用的な型である。構造化束縛で受け取ることが想定されている。 From 43c113af878f02995d3b5a67b551f09b2331d8d8 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 5 Dec 2023 12:53:01 +0900 Subject: [PATCH 0569/3948] =?UTF-8?q?fold=5Fleft=E8=BF=BD=E5=8A=A0=20#1088?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm.md | 12 +- reference/algorithm/ranges_fold_left.md | 270 ++++++++++++++++++++++++ 2 files changed, 276 insertions(+), 6 deletions(-) create mode 100644 reference/algorithm/ranges_fold_left.md diff --git a/reference/algorithm.md b/reference/algorithm.md index 71a01885ac..baa1640ee7 100644 --- a/reference/algorithm.md +++ b/reference/algorithm.md @@ -426,12 +426,12 @@ ranges::sort(pv, {}, &Parson::name); | 名前 | 説明 | 対応バージョン | |-------------------------------------------------------|------------------------|-------| -| [`ranges::fold_left`](algorithm/fold_left.md.nolink) | 範囲の左(先頭)からの`fold` | C++23 | -| [`ranges::fold_right`](algorithm/fold_right.md.nolink)| 範囲の右(終端)からの`fold` | C++23 | -| [`ranges::fold_left_first`](algorithm/fold_left_first.md.nolink)| 範囲の左(先頭)からの`fold`、初期値を省略する | C++23 | -| [`ranges::fold_right_last`](algorithm/fold_right_last.md.nolink)| 範囲の右(終端)からの`fold`、初期値を省略する | C++23 | -| [`ranges::fold_left_with_iter`](algorithm/fold_left_with_iter.md.nolink) | 範囲の左(先頭)からの`fold`、終端イテレータを返す | C++23 | -| [`ranges::fold_left_first_with_iter`](algorithm/fold_left_first_with_iter.md.nolink) | 範囲の左(先頭)からの`fold`、初期値を省略し終端イテレータを返す | C++23 | +| [`ranges::fold_left`](algorithm/ranges_fold_left.md) | 範囲の左(先頭)からの`fold` | C++23 | +| [`ranges::fold_right`](algorithm/ranges_fold_right.md.nolink)| 範囲の右(終端)からの`fold` | C++23 | +| [`ranges::fold_left_first`](algorithm/ranges_fold_left_first.md.nolink)| 範囲の左(先頭)からの`fold`、初期値を省略する | C++23 | +| [`ranges::fold_right_last`](algorithm/ranges_fold_right_last.md.nolink)| 範囲の右(終端)からの`fold`、初期値を省略する | C++23 | +| [`ranges::fold_left_with_iter`](algorithm/ranges_fold_left_with_iter.md.nolink) | 範囲の左(先頭)からの`fold`、終端イテレータを返す | C++23 | +| [`ranges::fold_left_first_with_iter`](algorithm/ranges_fold_left_first_with_iter.md.nolink) | 範囲の左(先頭)からの`fold`、初期値を省略し終端イテレータを返す | C++23 | ### 戻り値 diff --git a/reference/algorithm/ranges_fold_left.md b/reference/algorithm/ranges_fold_left.md new file mode 100644 index 0000000000..dd8ffe5a43 --- /dev/null +++ b/reference/algorithm/ranges_fold_left.md @@ -0,0 +1,270 @@ +# fold_left +* algorithm[meta header] +* function template[meta id-type] +* std::ranges[meta namespace] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template S, class T, + indirectly-binary-left-foldable F> + constexpr auto fold_left(I first, S last, T init, F f); // (1) + + template> F> + constexpr auto fold_left(R&& r, T init, F f); // (2) +} +``` +* input_iterator[link /reference/iterator/input_iterator.md] +* sentinel_for[link /reference/iterator/sentinel_for.md] +* input_range[link /reference/ranges/input_range.md] +* iterator_t[link /reference/ranges/iterator_t.md] + +## 概要 + +初期値から始めて、入力範囲の各要素に対して指定された二項演算を適用していきその結果を返す。二項演算が適用される各ステップでは、前のステップまでの積算値が一緒に渡される。 + +これは、関数型言語におけるリスト操作の一般形である高階関数`foldl`に対応し、[`std::accumulate`](/reference/numeric/accumulate.md)を改善したものでもある。 + +- (1) : 入力としてイテレータ範囲をとるオーバーロード +- (2) : 入力として範囲を直接とるオーバーロード + +この関数は、初期値を入力範囲の先頭に付加した範囲に対してその先頭の隣り合う2要素に対して与えられた二項演算を適用し、その結果によって処理した要素を置換し、処理後の範囲に対して同様の処理を範囲が空になるまで繰り返すような処理を行う。 + +`fold_left`の処理の様子 + +```{style=planetext} +0 : init +[1, 2, 3, 4, 5] : rng + +0 [1, 2, 3, 4, 5] +0 + 1 + 1 + 2 + 3 + 3 + 6 + 4 + 10 + 5 -> fold_left(rng, 0, +) +``` + +## 引数 + +- `first` -- 入力範囲の先頭イテレータ +- `last` -- 入力範囲の番兵(終端イテレータ) +- `r` -- 入力範囲のオブジェクト +- `init` -- 初期値 +- `f` -- 適用する二項演算 + - `f(std::move(init), *first)`のような呼び出しが可能であり、その戻り値型を`U`とすると + - `f(std::declval(), *first)`のような呼び出しも可能である必要がある + +## テンプレートパラメータ制約 + +`indirectly-binary-left-foldable`は次のように定義される説明専用のコンセプトである + +```cpp +template +concept indirectly-binary-left-foldable-impl = + movable && movable && + convertible_to && invocable> && + assignable_from>>; + +template +concept indirectly-binary-left-foldable = + copy_constructible && indirectly_readable && + invocable> && + convertible_to>, + decay_t>>> && + indirectly-binary-left-foldable-impl>>>; +``` +* movable[link /reference/concepts/movable.md] +* convertible_to[link /reference/concepts/convertible_to.md] +* iter_reference_t[link /reference/iterator/iter_reference_t.md] +* invocable[link /reference/concepts/invocable.md] +* assignable_from[link /reference/concepts/assignable_from.md] +* copy_constructible[link /reference/concepts/copy_constructible.md] +* indirectly_readable[link /reference/iterator/indirectly_readable.md] +* invoke_result_t[link /reference/type_traits/invoke_result.md] +* decay_t[link /reference/type_traits/decay.md] + +## 戻り値 + +- (1) : 以下と等価 + ```cpp + return ranges::fold_left_with_iter(std::move(first), last, std::move(init), f).value; + ``` + * fold_left_with_iter[link /reference/algorithm/ranges_fold_left_with_iter.md.nolink] + +- (2) : `r`からイテレータを取得して(1)に委譲 + ```cpp + return ranges::fold_left(ranges::begin(r), ranges::end(r), std::move(init), f); + ``` + * begin[link /reference/ranges/begin.md] + * end[link /reference/ranges/end.md] + +空の入力範囲に対しては初期値`init`を返す。 + +## 計算量 + +入力範囲`r`(`[first, last)`)の要素数を`N`とすると、正確に`N`回の`f`の適用が行われる。 + +## 備考 + +この関数の戻り値型は、入力の型`F, T, I`から次のような`U`として取得される + +```cpp +using U = decay_t>>; +``` +* decay_t[link /reference/type_traits/decay.md] +* invoke_result_t[link /reference/type_traits/invoke_result.md] +* iter_reference_t[link /reference/iterator/iter_reference_t.md] + +すなわち、指定した二項演算を初期値とイテレータによって`f(std::move(init), *first)`のように呼び出した時の戻り値型がこの関数の戻り値型となる。 + +また、この型`U`は`fold_left`の処理内部で積算値の型として使用されるものでもあり、`f`は`init`の代わりに`U`の右辺値も受け取れる必要がある。二項演算の呼び出しにおいては、第一引数に初期値もしくは積算値が渡され、第二引数にイテレータの間接参照結果が直接渡される。そして、二項演算の適用結果は積算値を保存する変数に直接代入される(つまり、結果を次のステップに引き継ぎたい場合は積算処理も二項演算内で行う必要がある)。詳細は下の実装例を参照。 + +## 例 + +### 基本的な数値集計処理の例 + +```cpp example +#include +#include +#include +#include +#include +#include +#include + +using namespace std::ranges; + +int main() { + // 入力 + range auto rng = views::iota(1, 11); + // 初期値 + const int init = 0; + // 二項演算 + auto op = std::plus<>{}; + + int resl = fold_left(rng, init, op); + + std::println("{:d}", resl); + + + // 入力範囲はfloatのvector + std::vector rngf = { 0.125f, 0.25f, 0.75f }; + + // 計算結果はfloat + std::same_as auto reslf = fold_left(rngf, init, op); + + std::println("{:g}", reslf); +} +``` +* fold_left[color ff0000] +* same_as[link /reference/concepts/same_as.md] +* iota[link /reference/ranges/iota_view.md] +* plus[link /reference/functional/plus.md] +* println[link /reference/print/println.md] + +### 出力 +``` +55 +2.125 +``` + +### 処理順序を表示する例 + +```cpp example +#include +#include +#include +#include +#include +#include +#include + +using namespace std::ranges; + +int main() { + // [a, b, c, d, e, f] + range auto rng = views::iota('a', 'g'); + + const std::string init = "init"; + + // fold_leftの二項演算op + auto op_left = [](std::string acc, char elem) { + acc += " -> "; + acc += elem; + return acc; + }; + // fold_rightの二項演算op + auto op_right = [op_left](char elem, std::string acc) { + return op_left(std::move(acc), elem); + }; + + auto resl = fold_left(rng, init, op_left); + auto resr = fold_right(rng, init, op_right); + + std::println("{:s}", resl); + std::println("{:s}", resr); +} +``` +* fold_left[color ff0000] +* same_as[link /reference/concepts/same_as.md] +* println[link /reference/print/println.md] +* fold_right[link /referencealgorithm/ranges_fold_right.md.nolink] + +### 出力 +``` +init -> a -> b -> c -> d -> e -> f +init -> f -> e -> d -> c -> b -> a +``` + +## 実装例 + +```cpp +template S, class T, + indirectly-binary-left-foldable F> +constexpr auto fold_left(I first, S last, T init, F f) { + using U = decay_t>>; + + if (first == last) { + return U(std::move(init)); + } + + U accum = invoke(f, std::move(init), *first); + + ++first; + + for (; first != last; ++first) { + accum = invoke(f, std::move(accum), *first); + } + + return accum; // 暗黙ムーブ or NRVO +} +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 5 + +## 関連項目 + +- [`ranges::fold_right`](algorithm/ranges_fold_right.md.nolink) + - 範囲の右からの`fold` +- [`ranges::fold_left_first`](algorithm/ranges_fold_left_first.md.nolink) + - 範囲の最初の要素を初期値として`fold_left` +- [`ranges::fold_right_last`](algorithm/ranges_fold_right_last.md.nolink) + - 範囲の最後の要素を初期値として`fold_right` +- [`ranges::fold_left_with_iter`](algorithm/ranges_fold_left_with_iter.md.nolink) + - `fold_left`の結果と共に、計算した終端イテレータも返す +- [`ranges::fold_left_first_with_iter`](algorithm/ranges_fold_left_first_with_iter.md.nolink) + - `fold_left_first`の結果と共に、計算した終端イテレータも返す + +## 参照 + +- [P2322R6 `ranges::fold`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2322r6.html) +- [プログラミングHaskellのfoldr, foldlの説明が秀逸だった件 - あと味](https://taiju.hatenablog.com/entry/20130202/1359773888) From c4adceb38e4d5c7167c73fb2ebaf0bf99c9e5729 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 5 Dec 2023 12:55:39 +0900 Subject: [PATCH 0570/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE?= =?UTF-8?q?=E9=A3=BE=E7=AD=89=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23.md | 2 +- reference/algorithm/ranges_fold_left.md | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lang/cpp23.md b/lang/cpp23.md index d33743631d..b779f1bf79 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -160,7 +160,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 - [`std::ranges::find_last_if_not()`](/reference/algorithm/find_last_if_not.md.nolink) - [``](/reference/algorithm.md)に、範囲に特定の値が含まれているかを判定する[`std::ranges::contains()`](/reference/algorithm/ranges_contains.md.nolink)、[`std::ranges::contains_subrange`](/reference/algorithm/ranges_contains_subrange.md.nolink)を追加 - [``](/reference/algorithm.md)に、数値に限定しない汎用的な畳み込みアルゴリズムとして、以下を追加: - - [`std::ranges::fold_left()`](/reference/algorithm/ranges_fold_left.md.nolink) + - [`std::ranges::fold_left()`](/reference/algorithm/ranges_fold_left.md) - [`std::ranges::fold_left_first()`](/reference/algorithm/ranges_fold_left_first.md.nolink) - [`std::ranges::fold_right()`](/reference/algorithm/ranges_fold_right.md.nolink) - [`std::ranges::fold_right_last()`](/reference/algorithm/ranges_fold_right_last.md.nolink) diff --git a/reference/algorithm/ranges_fold_left.md b/reference/algorithm/ranges_fold_left.md index dd8ffe5a43..da22186c13 100644 --- a/reference/algorithm/ranges_fold_left.md +++ b/reference/algorithm/ranges_fold_left.md @@ -33,7 +33,7 @@ namespace std::ranges { `fold_left`の処理の様子 -```{style=planetext} +``` 0 : init [1, 2, 3, 4, 5] : rng @@ -208,7 +208,6 @@ int main() { } ``` * fold_left[color ff0000] -* same_as[link /reference/concepts/same_as.md] * println[link /reference/print/println.md] * fold_right[link /referencealgorithm/ranges_fold_right.md.nolink] From 622ede1d942dc2c28105616017528c5b33444595 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 5 Dec 2023 14:53:36 +0900 Subject: [PATCH 0571/3948] =?UTF-8?q?fold=5Fleft=20:=20=E8=AA=AC=E6=98=8E?= =?UTF-8?q?=E5=B0=82=E7=94=A8=E3=82=B3=E3=83=B3=E3=82=BB=E3=83=97=E3=83=88?= =?UTF-8?q?=E5=AE=9A=E7=BE=A9=E3=82=921=E8=A1=8C1=E5=88=B6=E7=B4=84?= =?UTF-8?q?=E5=8C=96=E3=81=AA=E3=81=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_fold_left.md | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/reference/algorithm/ranges_fold_left.md b/reference/algorithm/ranges_fold_left.md index da22186c13..7ddff23b74 100644 --- a/reference/algorithm/ranges_fold_left.md +++ b/reference/algorithm/ranges_fold_left.md @@ -52,8 +52,8 @@ namespace std::ranges { - `r` -- 入力範囲のオブジェクト - `init` -- 初期値 - `f` -- 適用する二項演算 - - `f(std::move(init), *first)`のような呼び出しが可能であり、その戻り値型を`U`とすると - - `f(std::declval(), *first)`のような呼び出しも可能である必要がある + - `f(std::move(init), *first)`のような呼び出しが可能であり、その戻り値型のオブジェクトを`acc`とすると + - `f(std::move(acc), *first)`のような呼び出しも可能である必要がある ## テンプレートパラメータ制約 @@ -62,13 +62,16 @@ namespace std::ranges { ```cpp template concept indirectly-binary-left-foldable-impl = - movable && movable && - convertible_to && invocable> && + movable && + movable && + convertible_to && + invocable> && assignable_from>>; template concept indirectly-binary-left-foldable = - copy_constructible && indirectly_readable && + copy_constructible && + indirectly_readable && invocable> && convertible_to>, decay_t>>> && @@ -85,6 +88,10 @@ concept indirectly-binary-left-foldable = * invoke_result_t[link /reference/type_traits/invoke_result.md] * decay_t[link /reference/type_traits/decay.md] +ここでのテンプレートパラメータはそれぞれ、二項演算を指定する呼出可能な型`F`、初期値の型`T`、イテレータ型`I`、戻り値型(積算値の型)`U`である。 + +二項演算(`F`)は初期値・積算値と入力範囲の参照型に対して[`invocable`](/reference/concepts/invocable.md)であることしか求められていない(`regular_invocable`ではない)ため、適用する二項演算は任意の副作用を伴っていても良い。 + ## 戻り値 - (1) : 以下と等価 From fe170bc43566681d687ad9e0d6e0e2e59f482b8b Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Fri, 8 Dec 2023 03:55:42 +0900 Subject: [PATCH 0572/3948] =?UTF-8?q?=E8=A7=A3=E8=AA=AC=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0:=20=E7=AF=84=E5=9B=B2for=E6=96=87=E3=81=8C=E7=AF=84?= =?UTF-8?q?=E5=9B=B2=E5=88=9D=E6=9C=9F=E5=8C=96=E5=AD=90=E5=86=85=E3=81=A7?= =?UTF-8?q?=E7=94=9F=E3=81=98=E3=81=9F=E4=B8=80=E6=99=82=E3=82=AA=E3=83=96?= =?UTF-8?q?=E3=82=B8=E3=82=A7=E3=82=AF=E3=83=88=E3=82=92=E5=BB=B6=E5=91=BD?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=81=93=E3=81=A8=E3=82=92=E8=A6=8F=E5=AE=9A?= =?UTF-8?q?=20#1111?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp11/range_based_for.md | 1 + lang/cpp23.md | 2 +- ...etime_extension_in_range_based_for_loop.md | 147 ++++++++++++++++++ 3 files changed, 149 insertions(+), 1 deletion(-) create mode 100644 lang/cpp23/lifetime_extension_in_range_based_for_loop.md diff --git a/lang/cpp11/range_based_for.md b/lang/cpp11/range_based_for.md index f053c3af24..a5017a772a 100644 --- a/lang/cpp11/range_based_for.md +++ b/lang/cpp11/range_based_for.md @@ -357,6 +357,7 @@ int main() - [C++17 範囲forの制限緩和 — `begin` と `end` の型が異なることを許可](/lang/cpp17/generalizing_the_range-based_for_loop.md) - [C++20 範囲for文がカスタマイゼーションポイントを見つけるルールを緩和](/lang/cpp20/relaxing_the_range_for_loop_customization_point_finding_rules.md) +- [C++23 範囲for文が範囲初期化子内で生じた一時オブジェクトを延命することを規定](/lang/cpp23/lifetime_extension_in_range_based_for_loop.md) - [メンバ関数の左辺値/右辺値修飾](./ref_qualifier_for_this.md) ## 参照 diff --git a/lang/cpp23.md b/lang/cpp23.md index b779f1bf79..c80b253c4d 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -31,7 +31,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| | [初期化文での型の別名宣言を許可](cpp23/extend_init_statement_to_allow_alias_declaration.md.nolink) | `for (using T = int; T e : v) {}`を許可 | -| [範囲for文が範囲への参照を延命することを規定](cpp23/lifetime_extension_in_range_based_for_loop.md.nolink) | | +| [範囲for文が範囲初期化子内で生じた一時オブジェクトを延命することを規定](cpp23/lifetime_extension_in_range_based_for_loop.md) | 範囲初期化子内で生じた一時オブジェクトは範囲for文の終わりまで延命される | | [関数末尾のラベルを許可](cpp23/labels_at_the_end_of_compound_statements.md.nolink) | C互換のため、関数末尾でのgoto文のラベルを許可する | diff --git a/lang/cpp23/lifetime_extension_in_range_based_for_loop.md b/lang/cpp23/lifetime_extension_in_range_based_for_loop.md new file mode 100644 index 0000000000..ec0d00745b --- /dev/null +++ b/lang/cpp23/lifetime_extension_in_range_based_for_loop.md @@ -0,0 +1,147 @@ +# 範囲for文が範囲初期化子内で生じた一時オブジェクトを延命することを規定 + +* cpp23[meta cpp] + +## 仕様 + +範囲for文 + +``` +for ( init-statement(opt) for-range-declaration : for-range-initializer ) statement +``` + +において、`for-range-initializer` の中で生じた一時オブジェクトは、`for-range-initializer` で初期化される参照と同じ寿命まで延命される。 + +ただし、次の場合には適用されない。 + +- 一時オブジェクトが関数の引数の場合 +- 一時オブジェクトの(この規定が適用されない場合の)寿命が `for-range-initializer` 完全式の終わりではない場合 + +## 例 + +以下の例では、`getstr()` が返す一時オブジェクトが範囲for文の末端まで延命されている。 + +```cpp example +import std; + +std::vector getstr() { + return {"hello", "notUB"}; +} + +int main() +{ + for(auto&& c : getstr()[1]) { + std::println("{}", c); + } +} +``` + +### 出力 +``` +n +o +t +U +B +``` + +以下の例では、`getstr()` が返す一時オブジェクトは関数の引数だから、延命されない。 + +```cpp example +import std; + +std::vector getstr() { + return {"hello", "UB"}; +} + +std::string wrap(const std::string& x) { + return "[" + x + "]"; +} + +int main() +{ + for(auto&& c : wrap(getstr()[0])) { + std::println("{}", c); + } +} +``` + +### 出力 +``` +[ +h +e +l +l +o +] +``` + + + +## この機能が必要になった背景・経緯 + +範囲for文をより安全に使えるように改善するために仕様が変更された。 + +従来の仕様では、範囲for文を使う際に気が付きにくいダングリング参照を発生させる可能性があった。 + +```cpp example +#include +#include +#include + +std::vector getstr() { + return {"hello", "UB"}; +} + +int main() +{ + for(auto&& c : getstr()[0]) { + std::cout << c << std::endl; + } +} +``` + +このコードでは `getstr()` が一時オブジェクトとして `std::vector` を返し、範囲for文の範囲はその0番目の `std::string` の参照で初期化される。 + +この範囲for文は次のように展開される。 + +```cpp example +#include +#include +#include + +std::vector getstr() { + return {"hello", "UB"}; +} + +int main() +{ + { + auto&& r = getstr()[0]; + auto b = r.begin(); + auto e = r.end(); + for(; b != e; ++b) { + auto&& c = *b; + std::cout << c << std::endl; + } + } +} +``` + +ここで、`r` を初期化しているのは `getstr()` の返した一時オブジェクトではなく、その0番目の要素の参照である。そのため一時オブジェクト `std::vector` はこの行の終わりに破棄され、`r` はダングリング参照となる。 + +C++23では、`getstr()` の呼び出しが `for-range-initializer` の中にあるため、返った一時オブジェクトは参照 `r` と同じ寿命になる。したがってダングリング参照は発生せず、このコードは安全である。 + +## 検討されたほかの選択肢 + +一時オブジェクトの寿命について、範囲for文に限定しない汎用的な方法も検討されたが、最終的には範囲for文の例外規定となった。 + +## 関連項目 + +- [範囲for文](/lang/cpp11/range_based_for.md) + + +## 参照 + +- [地に足のついた範囲for文 - 地面を見下ろす少年の足蹴にされる私](https://onihusube.hatenablog.com/entry/2022/12/05/000923) From dd46a054290a54673f67ce248d7a35e32b3c3eee Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Fri, 8 Dec 2023 03:59:21 +0900 Subject: [PATCH 0573/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20#1111?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/implementation-status.md b/implementation-status.md index c381659729..f56b5a2bdb 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -253,7 +253,7 @@ | P1787R6: [スコープと名前ルックアップの仕様整理](/lang/cpp23/declarations_and_where_to_find_them.md.nolink) | 複雑で不完全になっているスコープと名前ルックアップの仕様を整理し、一部の問題を解決する | - | - | - | - | | P2615R1: [無意味なexport宣言を禁止する](/lang/cpp23/meaningful_exports.md.nolink) | | - | - | - | - | | P2360R0: [初期化文での型の別名宣言を許可](/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md.nolink) | `for (using T = int; T e : v) {}`を許可 | 12 | 14 | 2022.2 | - | -| P2718R0: [範囲for文が範囲への参照を延命することを規定](lang/cpp23/lifetime_extension_in_range_based_for_loop.md.nolink) | | - | - | - | - | +| P2718R0: [範囲for文が範囲初期化子内で生じた一時オブジェクトを延命することを規定](lang/cpp23/lifetime_extension_in_range_based_for_loop.md) | | - | - | - | - | | P2324R2: [関数末尾のラベルを許可](/lang/cpp23/labels_at_the_end_of_compound_statements.md.nolink) | C互換のため、関数末尾でのgoto文のラベルを許可する | 13 | 16 | 2023.2 | - | | P0847R7: [自身のオブジェクトを明示的にパラメータとして指定する](/lang/cpp23/deducing_this.md.nolink) | メンバ関数が`*this`の型・オブジェクトをパラメータとしてとり、`*this`オブジェクトがconst/非const、左辺値/右辺値であるかをメンバ関数内で識別できるようにする | - | 18 | - | 2022 Update 2 (partial) | | P1847R4: [アクセス制御の異なるメンバ変数のレイアウトを宣言順に規定](/lang/cpp23/make_declaration_order_layout_mandated.md.nolink) | アクセス制御の異なるメンバ変数のレイアウトが実装によって異なっていたため仕様を規定 | Yes | Yes | - | 2022 | From bb6a439711ec1a9e93ac58a41da5aa8c47e4f021 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Fri, 8 Dec 2023 13:05:45 +0900 Subject: [PATCH 0574/3948] =?UTF-8?q?fold=5Fright=E8=BF=BD=E5=8A=A0=20#108?= =?UTF-8?q?8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23.md | 2 +- reference/algorithm.md | 4 +- reference/algorithm/ranges_fold_left.md | 6 +- reference/algorithm/ranges_fold_right.md | 310 +++++++++++++++++++++++ 4 files changed, 317 insertions(+), 5 deletions(-) create mode 100644 reference/algorithm/ranges_fold_right.md diff --git a/lang/cpp23.md b/lang/cpp23.md index c80b253c4d..0a3294b2ac 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -162,7 +162,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 - [``](/reference/algorithm.md)に、数値に限定しない汎用的な畳み込みアルゴリズムとして、以下を追加: - [`std::ranges::fold_left()`](/reference/algorithm/ranges_fold_left.md) - [`std::ranges::fold_left_first()`](/reference/algorithm/ranges_fold_left_first.md.nolink) - - [`std::ranges::fold_right()`](/reference/algorithm/ranges_fold_right.md.nolink) + - [`std::ranges::fold_right()`](/reference/algorithm/ranges_fold_right.md) - [`std::ranges::fold_right_last()`](/reference/algorithm/ranges_fold_right_last.md.nolink) - [`std::ranges::fold_left_with_iter()`](/reference/algorithm/ranges_fold_left_with_iter.md.nolink) - [`std::ranges::fold_left_first_with_iter()`](/reference/algorithm/ranges_fold_left_first_with_iter.md.nolink) diff --git a/reference/algorithm.md b/reference/algorithm.md index baa1640ee7..0fb6b4c0ae 100644 --- a/reference/algorithm.md +++ b/reference/algorithm.md @@ -426,8 +426,8 @@ ranges::sort(pv, {}, &Parson::name); | 名前 | 説明 | 対応バージョン | |-------------------------------------------------------|------------------------|-------| -| [`ranges::fold_left`](algorithm/ranges_fold_left.md) | 範囲の左(先頭)からの`fold` | C++23 | -| [`ranges::fold_right`](algorithm/ranges_fold_right.md.nolink)| 範囲の右(終端)からの`fold` | C++23 | +| [`ranges::fold_left`](algorithm/ranges_fold_left.md) | 範囲の左(先頭)からの`fold` | C++23 | +| [`ranges::fold_right`](algorithm/ranges_fold_right.md)| 範囲の右(終端)からの`fold` | C++23 | | [`ranges::fold_left_first`](algorithm/ranges_fold_left_first.md.nolink)| 範囲の左(先頭)からの`fold`、初期値を省略する | C++23 | | [`ranges::fold_right_last`](algorithm/ranges_fold_right_last.md.nolink)| 範囲の右(終端)からの`fold`、初期値を省略する | C++23 | | [`ranges::fold_left_with_iter`](algorithm/ranges_fold_left_with_iter.md.nolink) | 範囲の左(先頭)からの`fold`、終端イテレータを返す | C++23 | diff --git a/reference/algorithm/ranges_fold_left.md b/reference/algorithm/ranges_fold_left.md index 7ddff23b74..52967d509d 100644 --- a/reference/algorithm/ranges_fold_left.md +++ b/reference/algorithm/ranges_fold_left.md @@ -29,9 +29,9 @@ namespace std::ranges { - (1) : 入力としてイテレータ範囲をとるオーバーロード - (2) : 入力として範囲を直接とるオーバーロード -この関数は、初期値を入力範囲の先頭に付加した範囲に対してその先頭の隣り合う2要素に対して与えられた二項演算を適用し、その結果によって処理した要素を置換し、処理後の範囲に対して同様の処理を範囲が空になるまで繰り返すような処理を行う。 +この関数は、初期値を入力範囲の先頭に付加した範囲に対してその先頭の隣り合う2要素に対して与えられた二項演算を適用し、その結果によって処理した要素を置換し、処理後の範囲に対して同様の処理を残りの要素が無くなるまで繰り返すような処理を行う。 -`fold_left`の処理の様子 +入力範囲を`{1, 2, 3, 4, 5}`、初期値を`0`、二項演算を`+`([`std::plus<>`](/reference/functional/plus.md))とした時の`fold_left`の処理の様子 ``` 0 : init @@ -45,6 +45,8 @@ namespace std::ranges { 10 + 5 -> fold_left(rng, 0, +) ``` +[`fold_right`](./ranges_fold_right.md)に対しては、入力範囲の先頭から末尾に向かって処理を進めていく点が異なる。 + ## 引数 - `first` -- 入力範囲の先頭イテレータ diff --git a/reference/algorithm/ranges_fold_right.md b/reference/algorithm/ranges_fold_right.md new file mode 100644 index 0000000000..f928e9d23b --- /dev/null +++ b/reference/algorithm/ranges_fold_right.md @@ -0,0 +1,310 @@ +# fold_right +* algorithm[meta header] +* function template[meta id-type] +* std::ranges[meta namespace] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template S, class T, + indirectly-binary-right-foldable F> + constexpr auto fold_right(I first, S last, T init, F f); // (1) + + template> F> + constexpr auto fold_right(R&& r, T init, F f); // (2) +} +``` +* bidirectional_iterator[link /reference/iterator/bidirectional_iterator.md] +* sentinel_for[link /reference/iterator/sentinel_for.md] +* bidirectional_range[link /reference/ranges/bidirectional_range.md] +* iterator_t[link /reference/ranges/iterator_t.md] + +## 概要 + +初期値から始めて、入力範囲の各要素に対して指定された二項演算を適用していきその結果を返す。二項演算が適用される各ステップでは、前のステップまでの積算値が一緒に渡される。 + +これは、関数型言語におけるリスト操作の一般形である高階関数`foldr`に対応し、[`std::accumulate`](/reference/numeric/accumulate.md)を改善したものでもある。 + +- (1) : 入力としてイテレータ範囲をとるオーバーロード +- (2) : 入力として範囲を直接とるオーバーロード + +この関数は、初期値を入力範囲の末尾に付加した範囲に対してその末尾の隣り合う2要素に対して与えられた二項演算を適用し、その結果によって処理した要素を置換し、処理後の範囲に対して同様の処理を残りの要素が無くなるまで繰り返すような処理を行う。 + +入力範囲を`{1, 2, 3, 4, 5}`、初期値を`0`、二項演算を`+`([`std::plus<>`](/reference/functional/plus.md))とした時の`fold_right()`の処理の様子 + +``` +0 : init +[1, 2, 3, 4, 5] : rng + +[1, 2, 3, 4, 5] 0 + 5 + 0 + 4 + 5 + 3 + 9 + 2 + 12 + 1 + 14 -> fold_right(rng, 0, +) +``` + +[`fold_left`](./ranges_fold_left.md)に対しては、入力範囲の末尾から先頭に向かって処理を進めていく点が異なる。 + +## 引数 + +- `first` -- 入力範囲の先頭イテレータ +- `last` -- 入力範囲の番兵(終端イテレータ) +- `r` -- 入力範囲のオブジェクト +- `init` -- 初期値 +- `f` -- 適用する二項演算 + - `f(*first, std::move(init))`のような呼び出しが可能であり、その戻り値型のオブジェクトを`acc`とすると + - `f(*first, std::move(acc))`のような呼び出しも可能である必要がある + +## テンプレートパラメータ制約 + +`indirectly-binary-right-foldable`は次のように定義される説明専用のコンセプトである + +```cpp +template +concept indirectly-binary-right-foldable = + indirectly-binary-left-foldable, T, I>; +``` +* indirectly-binary-left-foldable[link ranges_fold_left.md] + +`flipped`は二項呼び出し可能な`F`の引数順を入れ替える説明専用のクラステンプレートであり、次のように定義される + +```cpp +template +class flipped { + F f; + +public: + template requires invocable + invoke_result_t operator()(T&&, U&&); +}; +``` + +すなわち、二項演算`F`の引数順が逆になることを除いて[`fold_left`](./ranges_fold_left.md)と同じ制約となる。 + +ただし、`fold_right`はその処理の都合上、入力範囲に対して[`bidirectional_range`](/reference/ranges/bidirectional_range.md)であることを要求する(`fold_left`は[`input_range`](/reference/ranges/input_range.md))。 + +## 戻り値 + +(1)(2)ともに、以下と等価 + +```cpp +using U = decay_t, T>>; +if (first == last) + return U(std::move(init)); +I tail = ranges::next(first, last); +U accum = invoke(f, *--tail, std::move(init)); +while (first != tail) + accum = invoke(f, *--tail, std::move(accum)); +return accum; +``` +* decay_t[link /reference/type_traits/decay.md] +* invoke_result_t[link /reference/type_traits/invoke_result.md] +* iter_reference_t[link /reference/iterator/iter_reference_t.md] +* next[link /reference/iterator/ranges_next.md] +* invoke[link /reference/functional/invoke.md] + +空の入力範囲に対しては初期値`init`を返す。 + +## 計算量 + +入力範囲`r`(`[first, last)`)の要素数を`N`とすると、正確に`N`回の`f`の適用が行われる。 + +## 備考 + +この関数の戻り値型は、入力の型`F, T, I`から次のような`U`として取得される + +```cpp +using U = decay_t, T>>; +``` +* decay_t[link /reference/type_traits/decay.md] +* invoke_result_t[link /reference/type_traits/invoke_result.md] +* iter_reference_t[link /reference/iterator/iter_reference_t.md] + +すなわち、指定した二項演算をイテレータと初期値によって`f(*first, std::move(init))`のように呼び出した時の戻り値型がこの関数の戻り値型となる。 + +また、この型`U`は`fold_right`の処理内部で積算値の型として使用されるものでもあり、`f`は`init`の代わりに`U`の右辺値も受け取れる必要がある。二項演算の呼び出しにおいては、第一引数にイテレータの間接参照結果が直接渡され、第二引数に初期値もしくは積算値が渡される。そして、二項演算の適用結果は積算値を保存する変数に直接代入される(つまり、結果を次のステップに引き継ぎたい場合は積算処理も二項演算内で行う必要がある)。詳細は下の実装例を参照。 + +## 例 + +### 基本的な数値集計処理の例 + +```cpp example +#include +#include +#include +#include +#include +#include +#include + +using namespace std::ranges; + +int main() { + // 入力 + range auto rng = views::iota(1, 11); + // 初期値 + const int init = 0; + // 二項演算 + auto op = std::plus<>{}; + + int resl = fold_right(rng, init, op); + + std::println("{:d}", resl); + + + // 入力範囲はfloatのvector + std::vector rngf = { 0.125f, 0.25f, 0.75f }; + + // 計算結果はfloat + std::same_as auto reslf = fold_right(rngf, init, op); + + std::println("{:g}", reslf); +} +``` +* fold_right[color ff0000] +* same_as[link /reference/concepts/same_as.md] +* iota[link /reference/ranges/iota_view.md] +* plus[link /reference/functional/plus.md] +* println[link /reference/print/println.md] + +### 出力 +``` +55 +2.125 +``` + +### 処理順序を表示する例 + +```cpp example +#include +#include +#include +#include +#include +#include +#include + +using namespace std::ranges; + +int main() { + // [a, b, c, d, e, f] + range auto rng = views::iota('a', 'g'); + + const std::string init = "init"; + + // fold_leftの二項演算op + auto op_left = [](std::string acc, char elem) { + acc += " -> "; + acc += elem; + return acc; + }; + // fold_rightの二項演算op + auto op_right = [op_left](char elem, std::string acc) { + return op_left(std::move(acc), elem); + }; + + auto resl = fold_left(rng, init, op_left); + auto resr = fold_right(rng, init, op_right); + + std::println("{:s}", resl); + std::println("{:s}", resr); +} +``` +* fold_left[color ff0000] +* println[link /reference/print/println.md] +* fold_right[link /referencealgorithm/ranges_fold_right.md.nolink] + +### 出力 +``` +init -> a -> b -> c -> d -> e -> f +init -> f -> e -> d -> c -> b -> a +``` + +### 入力範囲を反転させる例 + +```cpp example +#include +#include +#include +#include +#include +#include +#include + +using namespace std::ranges; + +int main() { + range auto rng = views::iota(1, 11); + + std::vector init{}; + + auto op = [](int elem, std::vector acc) { + acc.push_back(elem); + return acc; + }; + + std::vector res = fold_right(rng, init, op); + + std::println("{:s}", res); +} +``` +* fold_left[color ff0000] +* println[link /reference/print/println.md] +* fold_right[link /referencealgorithm/ranges_fold_right.md.nolink] + +### 出力 +``` +[10 9 8 7 6 5 4 3 2 1] +``` + +## 実装例 + +```cpp +template S, class T, + indirectly-binary-right-foldable F> +constexpr auto fold_right(I first, S last, T init, F f) { + using U = decay_t, T>>; + + if (first == last) { + return U(std::move(init)); + } + + I tail = ranges::next(first, last); + U accum = invoke(f, *--tail, std::move(init)); + + while (first != tail) { + accum = invoke(f, *--tail, std::move(accum)); + } + + return accum; // 暗黙ムーブ or NRVO +} +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 5 + +## 関連項目 + +- [`ranges::fold_left`](algorithm/ranges_fold_left.md) + - 範囲の左からの`fold` +- [`ranges::fold_left_first`](algorithm/ranges_fold_left_first.md.nolink) + - 範囲の最初の要素を初期値として`fold_left` +- [`ranges::fold_right_last`](algorithm/ranges_fold_right_last.md.nolink) + - 範囲の最後の要素を初期値として`fold_right` +- [`ranges::fold_left_with_iter`](algorithm/ranges_fold_left_with_iter.md.nolink) + - `fold_left`の結果と共に、計算した終端イテレータも返す +- [`ranges::fold_left_first_with_iter`](algorithm/ranges_fold_left_first_with_iter.md.nolink) + - `fold_left_first`の結果と共に、計算した終端イテレータも返す + +## 参照 + +- [P2322R6 `ranges::fold`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2322r6.html) +- [プログラミングHaskellのfoldr, foldlの説明が秀逸だった件 - あと味](https://taiju.hatenablog.com/entry/20130202/1359773888) From 487904288cf18b707c0adeabc1a3ec0922557b6f Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Fri, 8 Dec 2023 13:14:06 +0900 Subject: [PATCH 0575/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_fold_left.md | 12 ++++++------ reference/algorithm/ranges_fold_right.md | 18 +++++++++--------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/reference/algorithm/ranges_fold_left.md b/reference/algorithm/ranges_fold_left.md index 52967d509d..8a6ff64666 100644 --- a/reference/algorithm/ranges_fold_left.md +++ b/reference/algorithm/ranges_fold_left.md @@ -218,7 +218,7 @@ int main() { ``` * fold_left[color ff0000] * println[link /reference/print/println.md] -* fold_right[link /referencealgorithm/ranges_fold_right.md.nolink] +* fold_right[link /referencealgorithm/ranges_fold_right.md] ### 出力 ``` @@ -261,15 +261,15 @@ constexpr auto fold_left(I first, S last, T init, F f) { ## 関連項目 -- [`ranges::fold_right`](algorithm/ranges_fold_right.md.nolink) +- [`ranges::fold_right`](ranges_fold_right.md) - 範囲の右からの`fold` -- [`ranges::fold_left_first`](algorithm/ranges_fold_left_first.md.nolink) +- [`ranges::fold_left_first`](ranges_fold_left_first.md.nolink) - 範囲の最初の要素を初期値として`fold_left` -- [`ranges::fold_right_last`](algorithm/ranges_fold_right_last.md.nolink) +- [`ranges::fold_right_last`](ranges_fold_right_last.md.nolink) - 範囲の最後の要素を初期値として`fold_right` -- [`ranges::fold_left_with_iter`](algorithm/ranges_fold_left_with_iter.md.nolink) +- [`ranges::fold_left_with_iter`](ranges_fold_left_with_iter.md.nolink) - `fold_left`の結果と共に、計算した終端イテレータも返す -- [`ranges::fold_left_first_with_iter`](algorithm/ranges_fold_left_first_with_iter.md.nolink) +- [`ranges::fold_left_first_with_iter`](ranges_fold_left_first_with_iter.md.nolink) - `fold_left_first`の結果と共に、計算した終端イテレータも返す ## 参照 diff --git a/reference/algorithm/ranges_fold_right.md b/reference/algorithm/ranges_fold_right.md index f928e9d23b..9d68e571f0 100644 --- a/reference/algorithm/ranges_fold_right.md +++ b/reference/algorithm/ranges_fold_right.md @@ -212,9 +212,9 @@ int main() { std::println("{:s}", resr); } ``` -* fold_left[color ff0000] +* fold_right[color ff0000] * println[link /reference/print/println.md] -* fold_right[link /referencealgorithm/ranges_fold_right.md.nolink] +* fold_left[link /reference/algorithm/ranges_fold_left.md] ### 出力 ``` @@ -250,9 +250,9 @@ int main() { std::println("{:s}", res); } ``` -* fold_left[color ff0000] +* fold_right[color ff0000] +* iota[link /reference/ranges/iota_view.md] * println[link /reference/print/println.md] -* fold_right[link /referencealgorithm/ranges_fold_right.md.nolink] ### 出力 ``` @@ -293,15 +293,15 @@ constexpr auto fold_right(I first, S last, T init, F f) { ## 関連項目 -- [`ranges::fold_left`](algorithm/ranges_fold_left.md) +- [`ranges::fold_left`](ranges_fold_left.md) - 範囲の左からの`fold` -- [`ranges::fold_left_first`](algorithm/ranges_fold_left_first.md.nolink) +- [`ranges::fold_left_first`](ranges_fold_left_first.md.nolink) - 範囲の最初の要素を初期値として`fold_left` -- [`ranges::fold_right_last`](algorithm/ranges_fold_right_last.md.nolink) +- [`ranges::fold_right_last`](ranges_fold_right_last.md.nolink) - 範囲の最後の要素を初期値として`fold_right` -- [`ranges::fold_left_with_iter`](algorithm/ranges_fold_left_with_iter.md.nolink) +- [`ranges::fold_left_with_iter`](ranges_fold_left_with_iter.md.nolink) - `fold_left`の結果と共に、計算した終端イテレータも返す -- [`ranges::fold_left_first_with_iter`](algorithm/ranges_fold_left_first_with_iter.md.nolink) +- [`ranges::fold_left_first_with_iter`](ranges_fold_left_first_with_iter.md.nolink) - `fold_left_first`の結果と共に、計算した終端イテレータも返す ## 参照 From 3888639209a892adebc7232795ed4a1c68645fda Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Fri, 8 Dec 2023 13:19:55 +0900 Subject: [PATCH 0576/3948] =?UTF-8?q?=E6=96=87=E7=AB=A0=E9=A0=86=E5=BA=8F?= =?UTF-8?q?=E3=82=84=E5=87=A6=E7=90=86=E7=B5=90=E6=9E=9C=E4=BE=8B=E3=81=AE?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_fold_left.md | 4 ++-- reference/algorithm/ranges_fold_right.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/reference/algorithm/ranges_fold_left.md b/reference/algorithm/ranges_fold_left.md index 8a6ff64666..3a08326c5c 100644 --- a/reference/algorithm/ranges_fold_left.md +++ b/reference/algorithm/ranges_fold_left.md @@ -24,13 +24,13 @@ namespace std::ranges { 初期値から始めて、入力範囲の各要素に対して指定された二項演算を適用していきその結果を返す。二項演算が適用される各ステップでは、前のステップまでの積算値が一緒に渡される。 +この関数は、初期値を入力範囲の先頭に付加した範囲に対してその先頭の隣り合う2要素に対して与えられた二項演算を適用し、その結果によって処理した要素を置換し、処理後の範囲に対して同様の処理を残りの要素が無くなるまで繰り返すような処理を行う。 + これは、関数型言語におけるリスト操作の一般形である高階関数`foldl`に対応し、[`std::accumulate`](/reference/numeric/accumulate.md)を改善したものでもある。 - (1) : 入力としてイテレータ範囲をとるオーバーロード - (2) : 入力として範囲を直接とるオーバーロード -この関数は、初期値を入力範囲の先頭に付加した範囲に対してその先頭の隣り合う2要素に対して与えられた二項演算を適用し、その結果によって処理した要素を置換し、処理後の範囲に対して同様の処理を残りの要素が無くなるまで繰り返すような処理を行う。 - 入力範囲を`{1, 2, 3, 4, 5}`、初期値を`0`、二項演算を`+`([`std::plus<>`](/reference/functional/plus.md))とした時の`fold_left`の処理の様子 ``` diff --git a/reference/algorithm/ranges_fold_right.md b/reference/algorithm/ranges_fold_right.md index 9d68e571f0..73cd849f40 100644 --- a/reference/algorithm/ranges_fold_right.md +++ b/reference/algorithm/ranges_fold_right.md @@ -24,13 +24,13 @@ namespace std::ranges { 初期値から始めて、入力範囲の各要素に対して指定された二項演算を適用していきその結果を返す。二項演算が適用される各ステップでは、前のステップまでの積算値が一緒に渡される。 +この関数は、初期値を入力範囲の末尾に付加した範囲に対してその末尾の隣り合う2要素に対して与えられた二項演算を適用し、その結果によって処理した要素を置換し、処理後の範囲に対して同様の処理を残りの要素が無くなるまで繰り返すような処理を行う。 + これは、関数型言語におけるリスト操作の一般形である高階関数`foldr`に対応し、[`std::accumulate`](/reference/numeric/accumulate.md)を改善したものでもある。 - (1) : 入力としてイテレータ範囲をとるオーバーロード - (2) : 入力として範囲を直接とるオーバーロード -この関数は、初期値を入力範囲の末尾に付加した範囲に対してその末尾の隣り合う2要素に対して与えられた二項演算を適用し、その結果によって処理した要素を置換し、処理後の範囲に対して同様の処理を残りの要素が無くなるまで繰り返すような処理を行う。 - 入力範囲を`{1, 2, 3, 4, 5}`、初期値を`0`、二項演算を`+`([`std::plus<>`](/reference/functional/plus.md))とした時の`fold_right()`の処理の様子 ``` @@ -256,7 +256,7 @@ int main() { ### 出力 ``` -[10 9 8 7 6 5 4 3 2 1] +[10, 9, 8, 7, 6, 5, 4, 3, 2, 1] ``` ## 実装例 From 5b1d104a57b7eed1e4f35415ff4bd41cce23e2ed Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Fri, 8 Dec 2023 13:21:29 +0900 Subject: [PATCH 0577/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E3=81=AA=E3=81=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_fold_left.md | 2 +- reference/algorithm/ranges_fold_right.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/algorithm/ranges_fold_left.md b/reference/algorithm/ranges_fold_left.md index 3a08326c5c..38273bdfa5 100644 --- a/reference/algorithm/ranges_fold_left.md +++ b/reference/algorithm/ranges_fold_left.md @@ -218,7 +218,7 @@ int main() { ``` * fold_left[color ff0000] * println[link /reference/print/println.md] -* fold_right[link /referencealgorithm/ranges_fold_right.md] +* fold_right[link ranges_fold_right.md] ### 出力 ``` diff --git a/reference/algorithm/ranges_fold_right.md b/reference/algorithm/ranges_fold_right.md index 73cd849f40..95b45b828b 100644 --- a/reference/algorithm/ranges_fold_right.md +++ b/reference/algorithm/ranges_fold_right.md @@ -247,7 +247,7 @@ int main() { std::vector res = fold_right(rng, init, op); - std::println("{:s}", res); + std::println("{}", res); } ``` * fold_right[color ff0000] From 2da58ef5105c2ba71d84713a5ae5b641187f9e5d Mon Sep 17 00:00:00 2001 From: yumetodo Date: Sun, 10 Dec 2023 15:15:14 +0900 Subject: [PATCH 0578/3948] =?UTF-8?q?fix:=20P2718R0=20=E3=81=AE=E4=BD=9C?= =?UTF-8?q?=E7=94=A8=E3=81=ABC++11=E3=81=AE=E7=AF=84=E5=9B=B2for=E3=81=AE?= =?UTF-8?q?=E8=A7=A3=E8=AA=AC=E3=81=8B=E3=82=89=E8=A8=80=E5=8F=8A=E3=81=99?= =?UTF-8?q?=E3=82=8B=20(#1111)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp11/range_based_for.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lang/cpp11/range_based_for.md b/lang/cpp11/range_based_for.md index a5017a772a..741fa25388 100644 --- a/lang/cpp11/range_based_for.md +++ b/lang/cpp11/range_based_for.md @@ -353,6 +353,8 @@ int main() } ``` +また、C++23からは`for-range-initializer`の寿命が条件を満たせば延長されるようになったので([C++23 範囲for文が範囲初期化子内で生じた一時オブジェクトを延命することを規定](/lang/cpp23/lifetime_extension_in_range_based_for_loop.md))、この問題を踏みにくくなっている。 + ## 関連項目 - [C++17 範囲forの制限緩和 — `begin` と `end` の型が異なることを許可](/lang/cpp17/generalizing_the_range-based_for_loop.md) From ea41b5db13806290e0f2e2ac3e229dc81607def8 Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Mon, 11 Dec 2023 02:29:40 +0900 Subject: [PATCH 0579/3948] =?UTF-8?q?=E5=A7=94=E8=AD=B2=E3=82=B3=E3=83=B3?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=83=A9=E3=82=AF=E3=82=BF=E3=81=AE=E5=AE=9F?= =?UTF-8?q?=E8=A1=8C=E9=A0=86=E5=BA=8F=E3=82=92=E6=98=8E=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cf. n4659 §15.6.2.6 > Once the target constructor returns, the body of the delegating constructor is executed. --- lang/cpp11/delegating_constructors.md | 1 + 1 file changed, 1 insertion(+) diff --git a/lang/cpp11/delegating_constructors.md b/lang/cpp11/delegating_constructors.md index d43818f11c..89285941f6 100644 --- a/lang/cpp11/delegating_constructors.md +++ b/lang/cpp11/delegating_constructors.md @@ -16,6 +16,7 @@ public: ``` (2)のコンストラクタでの、`X(42)`の部分が委譲コンストラクタに当たる。(2)のコンストラクタから(1)のコンストラクタを呼び出し、初期化処理を(1)のコンストラクタに集約している。 +(1)のコンストラクタから返ったのちに、(2)のコンストラクタの本体が実行される。 この機能を使用することにより、複数のコンストラクタを作成・メンテナンスするコストが減り、コードの肥大化を抑えられる。 From e75774c8e71c87bbbae3d71c957c5cfb7110a06d Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 13 Dec 2023 12:10:37 +0900 Subject: [PATCH 0580/3948] =?UTF-8?q?=E6=9C=AA=E5=88=9D=E6=9C=9F=E5=8C=96?= =?UTF-8?q?=E9=A0=98=E5=9F=9F=E3=81=B8=E3=81=AE=E6=9A=97=E9=BB=99=E7=9A=84?= =?UTF-8?q?=E3=81=AA=E3=82=AA=E3=83=96=E3=82=B8=E3=82=A7=E3=82=AF=E3=83=88?= =?UTF-8?q?=E6=A7=8B=E7=AF=89=20:=20=E7=AE=87=E6=9D=A1=E6=9B=B8=E3=81=8D?= =?UTF-8?q?=E3=81=AE=E3=82=A4=E3=83=B3=E3=83=87=E3=83=B3=E3=83=88=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...creation_of_objects_for_low-level_object_manipulation.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md index 88fa894964..1b8fb0efb9 100644 --- a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md +++ b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md @@ -206,9 +206,9 @@ C++においては、ポインタに対する演算(`+ -`など)はそのポ - 別のオブジェクトにストレージを提供している場合やサブオブジェクトのサブオブジェクトなど - `o`の生存期間はコピーの前に開始される - 代入演算子 - - 代入元と代入先が同じオブジェクトではない場合 - - コピー元オブジェクトにネストした各オブジェクトに対して、コピー先内で対応するオブジェクト`o`が暗黙的に構築され - - `o`の生存期間はコピーの前に開始される + - 代入元と代入先が同じオブジェクトではない場合 + - コピー元オブジェクトにネストした各オブジェクトに対して、コピー先内で対応するオブジェクト`o`が暗黙的に構築され + - `o`の生存期間はコピーの前に開始される どちらの場合も、コピー元で生存期間内にあるオブジェクトがコピー先で(可能なら)暗黙的に構築される。 From 3283bd057a59ce566b5ad5ebe110c069393acf24 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 13 Dec 2023 13:11:11 +0900 Subject: [PATCH 0581/3948] =?UTF-8?q?fold=5Fleft=5Ffirst=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20#1088?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm.md | 2 +- reference/algorithm/ranges_fold_left.md | 9 +- reference/algorithm/ranges_fold_left_first.md | 209 ++++++++++++++++++ reference/algorithm/ranges_fold_right.md | 2 +- 4 files changed, 214 insertions(+), 8 deletions(-) create mode 100644 reference/algorithm/ranges_fold_left_first.md diff --git a/reference/algorithm.md b/reference/algorithm.md index 0fb6b4c0ae..3ea9e85585 100644 --- a/reference/algorithm.md +++ b/reference/algorithm.md @@ -428,7 +428,7 @@ ranges::sort(pv, {}, &Parson::name); |-------------------------------------------------------|------------------------|-------| | [`ranges::fold_left`](algorithm/ranges_fold_left.md) | 範囲の左(先頭)からの`fold` | C++23 | | [`ranges::fold_right`](algorithm/ranges_fold_right.md)| 範囲の右(終端)からの`fold` | C++23 | -| [`ranges::fold_left_first`](algorithm/ranges_fold_left_first.md.nolink)| 範囲の左(先頭)からの`fold`、初期値を省略する | C++23 | +| [`ranges::fold_left_first`](algorithm/ranges_fold_left_first.md)| 範囲の左(先頭)からの`fold`、初期値を省略する | C++23 | | [`ranges::fold_right_last`](algorithm/ranges_fold_right_last.md.nolink)| 範囲の右(終端)からの`fold`、初期値を省略する | C++23 | | [`ranges::fold_left_with_iter`](algorithm/ranges_fold_left_with_iter.md.nolink) | 範囲の左(先頭)からの`fold`、終端イテレータを返す | C++23 | | [`ranges::fold_left_first_with_iter`](algorithm/ranges_fold_left_first_with_iter.md.nolink) | 範囲の左(先頭)からの`fold`、初期値を省略し終端イテレータを返す | C++23 | diff --git a/reference/algorithm/ranges_fold_left.md b/reference/algorithm/ranges_fold_left.md index 38273bdfa5..836625774b 100644 --- a/reference/algorithm/ranges_fold_left.md +++ b/reference/algorithm/ranges_fold_left.md @@ -138,9 +138,8 @@ using U = decay_t>>; #include #include #include -#include +#include #include -#include #include using namespace std::ranges; @@ -176,7 +175,7 @@ int main() { ### 出力 ``` 55 -2.125 +1.125 ``` ### 処理順序を表示する例 @@ -185,10 +184,8 @@ int main() { #include #include #include -#include +#include #include -#include -#include using namespace std::ranges; diff --git a/reference/algorithm/ranges_fold_left_first.md b/reference/algorithm/ranges_fold_left_first.md new file mode 100644 index 0000000000..202a5e0473 --- /dev/null +++ b/reference/algorithm/ranges_fold_left_first.md @@ -0,0 +1,209 @@ +# fold_left_first +* algorithm[meta header] +* function template[meta id-type] +* std::ranges[meta namespace] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template S, + indirectly-binary-left-foldable, I> F> + requires constructible_from, iter_reference_t> + constexpr auto fold_left_first(I first, S last, F f); // (1) + + template, iterator_t> F> + requires constructible_from, range_reference_t> + constexpr auto fold_left_first(R&& r, F f); // (2) +} +``` +* input_iterator[link /reference/iterator/input_iterator.md] +* sentinel_for[link /reference/iterator/sentinel_for.md] +* constructible_from[link /reference/concepts/constructible_from.md] +* iter_value_t[link /reference/iterator/iter_value_t.md] +* iter_reference_t[link /reference/iterator/iter_reference_t.md] +* input_range[link /reference/ranges/input_range.md] +* range_value_t[link /reference/ranges/range_value_t.md] +* range_reference_t[link /reference/ranges/range_reference_t.md] +* iterator_t[link /reference/ranges/iterator_t.md] +* indirectly-binary-left-foldable[link ./ranges_fold_left.md] + +## 概要 + +初期値の指定を省略する[`fold_left`](./ranges_fold_left.md)。入力範囲の先頭要素が初期値として使用される。 + +- (1) : 入力としてイテレータ範囲をとるオーバーロード +- (2) : 入力として範囲を直接とるオーバーロード + +## 引数 + +- `first` -- 入力範囲の先頭イテレータ +- `last` -- 入力範囲の番兵(終端イテレータ) +- `r` -- 入力範囲のオブジェクト +- `f` -- 適用する二項演算 + - `f(std::move(*first), *++first)`のような呼び出しが可能であり、その戻り値型のオブジェクトを`acc`とすると + - `f(std::move(acc), *first)`のような呼び出しも可能である必要がある + +## 戻り値 + +- (1) : 以下と等価 + ```cpp + return ranges::fold_left_first_with_iter(std::move(first), last, f).value; + ``` + * fold_left_first_with_iter[link /reference/algorithm/ranges_fold_left_first_with_iter.md.nolink] + +- (2) : `r`からイテレータを取得して(1)に委譲 + ```cpp + return ranges::fold_left_first(ranges::begin(r), ranges::end(r), f); + ``` + * begin[link /reference/ranges/begin.md] + * end[link /reference/ranges/end.md] + +空の入力範囲に対しては無効値を保持する[`optional`](/reference/optional/optional.md)を返す。 + +## 計算量 + +入力範囲`r`(`[first, last)`)の要素数を`N`とすると、正確に`N - 1`回の`f`の適用が行われる。 + +## 備考 + +この関数の戻り値型は[`optional`](/reference/optional/optional.md)``であり、`U`は引数と入力の型`I`から次のように取得される + +```cpp +using U = decltype(ranges::fold_left(std::move(first), last, iter_value_t(*first), f)); +``` +* fold_left[link ./ranges_fold_left.md] +* iter_value_t[link /reference/iterator/iter_value_t.md] + +すなわち、他の引数はそのままに初期値として`r`の要素を手動で指定して`fold_left`を呼び出した際の戻り値型を包む`optional`となる。 + +`fold_left`と同様に、この型`U`は`fold_left_first`の処理内部で積算値の型として使用されるものでもあり、`f`は`std::move(*first)`の代わりに`U`の右辺値も受け取れる必要がある。詳細は下の実装例を参照。 + +## 例 + +### 基本的な数値集計処理の例 + +```cpp example +#include +#include +#include +#include +#include + +using namespace std::ranges; + +int main() { + // 入力 + range auto rng = views::iota(1, 11); + // 二項演算 + auto op = std::plus<>{}; + + auto resl = fold_left_first(rng, op); + + std::println("{:d}", resl.value()); + + + // 入力範囲はfloatのvector + std::vector rngf = { 0.125f, 0.25f, 0.75f }; + + // 計算結果はoptional + auto reslf = fold_left_first(rngf, op); + + std::println("{:g}", reslf.value()); +} +``` +* fold_left_first[color ff0000] +* iota[link /reference/ranges/iota_view.md] +* plus[link /reference/functional/plus.md] +* println[link /reference/print/println.md] + +### 出力 +``` +55 +1.125 +``` + +### 空の入力範囲に対する動作の例 + +```cpp example +#include +#include +#include +#include +#include + +using namespace std::ranges; + +int main() { + range auto rng = views::empty; + auto op = std::plus<>{}; + + auto res1 = fold_left(rng, -1, op); + auto res3 = fold_left_first(rng, op); + + std::println("{:d}", res1); + std::println("{:d}", res3.value_or(-1)); +} +``` +* fold_left_first[color ff0000] +* fold_left[link ranges_fold_right.md] +* println[link /reference/print/println.md] +* value_or[link /reference/optional/optional/value_or.md] + +### 出力 +``` +-1 +-1 +``` + +## 実装例 + +```cpp +template S, + indirectly-binary-left-foldable, I> F> + requires constructible_from, iter_reference_t> +constexpr auto fold_left_first(I first, S last, F f) { + using U = decltype(ranges::fold_left(std::move(first), last, iter_value_t(*first), f)); + + if (first == last) { + return optional(); + } + + optional accum(in_place, *first); + + ++first; + + for (; first != last; ++first) { + *accum = invoke(f, std::move(*accum), *first); + } + + return accum; // 暗黙ムーブ or NRVO +} +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 5 + +## 関連項目 + +- [`ranges::fold_left`](ranges_fold_left.md) + - 範囲の左からの`fold` +- [`ranges::fold_right`](ranges_fold_right.md) + - 範囲の右からの`fold` +- [`ranges::fold_right_last`](ranges_fold_right_last.md.nolink) + - 範囲の最後の要素を初期値として`fold_right` +- [`ranges::fold_left_with_iter`](ranges_fold_left_with_iter.md.nolink) + - `fold_left`の結果と共に、計算した終端イテレータも返す +- [`ranges::fold_left_first_with_iter`](ranges_fold_left_first_with_iter.md.nolink) + - `fold_left_first`の結果と共に、計算した終端イテレータも返す + +## 参照 + +- [P2322R6 `ranges::fold`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2322r6.html) +- [プログラミングHaskellのfoldr, foldlの説明が秀逸だった件 - あと味](https://taiju.hatenablog.com/entry/20130202/1359773888) diff --git a/reference/algorithm/ranges_fold_right.md b/reference/algorithm/ranges_fold_right.md index 95b45b828b..a3a1f25f41 100644 --- a/reference/algorithm/ranges_fold_right.md +++ b/reference/algorithm/ranges_fold_right.md @@ -172,7 +172,7 @@ int main() { ### 出力 ``` 55 -2.125 +1.125 ``` ### 処理順序を表示する例 From 8aea300a364b730223f6ddce78f72ec2bf03f842 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 13 Dec 2023 13:13:50 +0900 Subject: [PATCH 0582/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23.md | 2 +- reference/algorithm/ranges_fold_left.md | 2 +- reference/algorithm/ranges_fold_right.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lang/cpp23.md b/lang/cpp23.md index 0a3294b2ac..c48eb9e7f1 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -161,7 +161,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 - [``](/reference/algorithm.md)に、範囲に特定の値が含まれているかを判定する[`std::ranges::contains()`](/reference/algorithm/ranges_contains.md.nolink)、[`std::ranges::contains_subrange`](/reference/algorithm/ranges_contains_subrange.md.nolink)を追加 - [``](/reference/algorithm.md)に、数値に限定しない汎用的な畳み込みアルゴリズムとして、以下を追加: - [`std::ranges::fold_left()`](/reference/algorithm/ranges_fold_left.md) - - [`std::ranges::fold_left_first()`](/reference/algorithm/ranges_fold_left_first.md.nolink) + - [`std::ranges::fold_left_first()`](/reference/algorithm/ranges_fold_left_first.md) - [`std::ranges::fold_right()`](/reference/algorithm/ranges_fold_right.md) - [`std::ranges::fold_right_last()`](/reference/algorithm/ranges_fold_right_last.md.nolink) - [`std::ranges::fold_left_with_iter()`](/reference/algorithm/ranges_fold_left_with_iter.md.nolink) diff --git a/reference/algorithm/ranges_fold_left.md b/reference/algorithm/ranges_fold_left.md index 836625774b..79e52f2e92 100644 --- a/reference/algorithm/ranges_fold_left.md +++ b/reference/algorithm/ranges_fold_left.md @@ -260,7 +260,7 @@ constexpr auto fold_left(I first, S last, T init, F f) { - [`ranges::fold_right`](ranges_fold_right.md) - 範囲の右からの`fold` -- [`ranges::fold_left_first`](ranges_fold_left_first.md.nolink) +- [`ranges::fold_left_first`](ranges_fold_left_first.md) - 範囲の最初の要素を初期値として`fold_left` - [`ranges::fold_right_last`](ranges_fold_right_last.md.nolink) - 範囲の最後の要素を初期値として`fold_right` diff --git a/reference/algorithm/ranges_fold_right.md b/reference/algorithm/ranges_fold_right.md index a3a1f25f41..c57d3dd79c 100644 --- a/reference/algorithm/ranges_fold_right.md +++ b/reference/algorithm/ranges_fold_right.md @@ -295,7 +295,7 @@ constexpr auto fold_right(I first, S last, T init, F f) { - [`ranges::fold_left`](ranges_fold_left.md) - 範囲の左からの`fold` -- [`ranges::fold_left_first`](ranges_fold_left_first.md.nolink) +- [`ranges::fold_left_first`](ranges_fold_left_first.md) - 範囲の最初の要素を初期値として`fold_left` - [`ranges::fold_right_last`](ranges_fold_right_last.md.nolink) - 範囲の最後の要素を初期値として`fold_right` From 1b09fb13cd1f9c122c6b2ec3ea02d9c74eaecffe Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 13 Dec 2023 19:48:39 +0900 Subject: [PATCH 0583/3948] =?UTF-8?q?2023=E5=B9=B4=E5=88=86=E3=81=AE?= =?UTF-8?q?=E8=B2=A2=E7=8C=AE=E3=83=9D=E3=82=A4=E3=83=B3=E3=83=88=E3=81=BE?= =?UTF-8?q?=E3=81=A8=E3=82=81=20(#1209)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/script/ngword_check.py | 3 + start_editing.md | 49 +- start_editing/contribution_stats_2023.md | 577 +++++++++++++++++++++++ 3 files changed, 620 insertions(+), 9 deletions(-) create mode 100644 start_editing/contribution_stats_2023.md diff --git a/.github/workflows/script/ngword_check.py b/.github/workflows/script/ngword_check.py index ddcde69755..09ca731aaf 100644 --- a/.github/workflows/script/ngword_check.py +++ b/.github/workflows/script/ngword_check.py @@ -48,6 +48,9 @@ def check_ngword(text: str, filename: str) -> bool: if __name__ == '__main__': found_error = False for p in sorted(list(glob.glob("**/*.md", recursive=True))): + if p.startswith("start_editing/"): + continue + with open(p) as f: text = f.read() diff --git a/start_editing.md b/start_editing.md index 6108cde98f..8bacec6968 100644 --- a/start_editing.md +++ b/start_editing.md @@ -284,31 +284,57 @@ cpprefjpおよびboostjpでの作業は、以下のように貢献ポイント また、masterブランチにマージされずオープンなままのPull Requestについては、マージされた年に貢献ポイントをつけさせていただきます。 +貢献ポイントとして含めないものには、以下があります + +1. 議論への参加、問題提起、問題報告 + - Issueの発行 + - Issue / Pull Request / コミットへのコメント + - SNS上での当Webサイトへの問題報告 +2. GitHub Wikiの編集 +3. 貢献ポイントの集計作業 + - [集計ツール](https://github.com/cpprefjp/stats_contribution)の開発 + - 貢献ポイントの調整・ルール作り + - `start_editing/contribution_stats_*.md`の編集 + +貢献ポイントの集計方法として、以下の注意事項があります + +- 同年内の当人による同ページへの複数の修正は、貢献ポイントをまとめる場合がある + - 連続した作業が複数コミットになった場合などにまとめる + - 複数の仕様変更による複数の修正の場合などはまとめない +- 同ページ内に対する複数の修正は、大きい貢献ポイントにまとめる場合がある + - リンク追加・修正を含む説明修正は、fixmやfixlなどにまとめる + + ### cpprefjp | タグ | ポイント | 説明 | |-----|---------|------| -| cpprefjp/typo | 1 | 誤字・脱字の修正 (ページ単位) | -| cpprefjp/link | 2 | 関連項目・参照リンクなどの追加 (ページ単位) | +| cpprefjp/typo | 1 | 誤字・脱字の修正 (ページ単位)。サンプルコードの非コメントの修正はfixs | +| cpprefjp/link | 2 | 関連項目・参照リンクなどの追加・修正、nolinkの解除 (ページ単位) | | cpprefjp/addref | 20 | リファレンスを1ページ追加 | | cpprefjp/addlang | 20 | 言語機能を1ページ追加 | -| cpprefjp/fixs | 2 | 既存ページへの修正 : small 軽微な修正 (ページ単位) | -| cpprefjp/fixm | 5 | 既存ページへの修正 : medium 追加説明、サンプルコード追加 (ページ単位) | +| cpprefjp/addpage | 20 | その他ページ追加 (articleや編集者向けページなど) | +| cpprefjp/fixs | 2 | 既存ページへの修正 : small 軽微な修正、コード修飾追加 (ページ単位) | +| cpprefjp/fixm | 5 | 既存ページへの修正 : medium 追加説明、サンプルコード追加、訳語追加 (ページ単位) | | cpprefjp/fixl | 10 | 既存ページへの修正 : large 仕様変更への対応 (ページ単位) | -| cpprefjp/compiler | 2 | 動作確認できたコンパイラバージョンの記載 (ページ単位) | +| cpprefjp/compiler | 2 | 動作確認できたコンパイラバージョンの記載。ライブラリ機能はページ単位、言語機能は件数単位 | + +機能追加での機能表への列の追加は、linkではなくfixlにあたる。 + ### boostjp | タグ | ポイント | 説明 | |-----|---------|------| -| boostjp/typo | 1 | 誤字・脱字の修正 (ページ単位 | -| boostjp/releases | 2 | Boostリリースノート1件追加 small : maintenance workなどの小さなリリースノート | -| boostjp/releasem | 5 | Boostリリースノートページを準備 | +| boostjp/typo | 1 | 誤字・脱字の修正 (ページ単位) | +| boostjp/link | 2 | 関連項目・参照リンクなどの追加・修正、nolinkの解除 (ページ単位) | +| boostjp/releases | 5 | Boostリリースノート1件追加 small : maintenance workなどの軽微で小さなリリースノート | | boostjp/releasem | 10 | Boostリリースノート 1件追加 medium : 10行以下の中程度の大きさ | | boostjp/releasel | 20 | Boostリリースノート 1件追加 large : mediumを超える大きさ | +| boostjp/fixs | 2 | 既存ページへの修正 : small 軽微な修正、コード修飾追加 (ページ単位) | +| boostjp/fixm | 5 | 既存ページへの修正 : medium 追加説明、訳語追加 (ページ単位) | | boostjp/addrefs | 10 | Boost逆引きリファレンス : small (1例追加) | | boostjp/addrefm | 20 | Boost逆引きリファレンス : medium (標準C++のバージョンアップ対応1例単位、Boostのバージョンアップ対応1例単位) | -| boostjp/boosts | 5 | Boostへの貢献 small (typoの修正など) | ### ツール類 @@ -346,3 +372,8 @@ CIスクリプト、site_generator、kunaiなど。 - 説明欄にGitHubアカウントを書いてもらえると、だれの申請かがわかりやすくて助かる 5. cpprefjpから経費の承認がされれば、支払われる + +### 貢献ポイントの集計ページ + +- [2023年](start_editing/contribution_stats_2023.md) + diff --git a/start_editing/contribution_stats_2023.md b/start_editing/contribution_stats_2023.md new file mode 100644 index 0000000000..d3986d7e32 --- /dev/null +++ b/start_editing/contribution_stats_2023.md @@ -0,0 +1,577 @@ +# 2023年 貢献ポイント +2023年1月から2023年11月を対象期間として、貢献ポイントを集計する。 + +## [yohhoy](https://github.com/yohhoy) + +| コミット | タグ | 説明 | +|----------|------|------| +| [41bca76](https://github.com/cpprefjp/site/commit/41bca76b22c72220203c7d2e369e6a76e9b645b2) | cpprefjp/typo:1 | `generator/begin`: fix typo | +| [bd48ead](https://github.com/cpprefjp/site/commit/bd48ead94b7324c18006cdcfe08aa8560cf1f303), [27f5df0](https://github.com/cpprefjp/site/commit/27f5df0eebfc593d6875f978aaab727648943559), [ab69dd](https://github.com/cpprefjp/site/commit/ab69dd554d5ea642a4ec6a2350760a6faf069039), [c6bde83](https://github.com/cpprefjp/site/commit/c6bde8363fb78d19713ad3e9b4cd2e4ceb0d48df), [5e25d82](https://github.com/cpprefjp/site/commit/5e25d82045a410286548f4cfb14542e78bec876d) | cpprefjp/addref:9, cpprefjp/fixs:1, cpprefjp/fixm:1, cpprefjp/link:1 | `generator/promise_type`のリファレンス作成 | +| [384970](https://github.com/cpprefjp/site/commit/384970b9c298f2b5ad0cf76502fbee6635386fc5) | cpprefjp/fixs:1 | cpp20/coroutines: 微調整 | +| [09c61f9](https://github.com/cpprefjp/site/commit/09c61f94ef2e5795801b131449073c34e47f4995) | cpprefjp/fixm:1 | `generator`: 例示コード拡充 | +| [66d4dc6](https://github.com/cpprefjp/site/commit/66d4dc66d3f2259e546b1f7bc5591cf53bb8cc2c) | cpprefjp/fixm:1, cpprefjp/fixs:1 | generator: クラスユーザ観点での説明追加 | +| [1f03563](https://github.com/cpprefjp/site/commit/1f03563fee051b3135a3dd7ea79f14bd01b37ad3) | cpprefjp/fixl:4 | `coroutine`: LWG3460を反映 | +| [f03abf8](https://github.com/cpprefjp/site/commit/f03abf873882732606460f6f65aaed739389d8d0) | cpprefjp/fixl:1 | `tuple/apply`: P2517R1対応 | +| [58e407c](https://github.com/cpprefjp/site/commit/58e407c377e144d14665e1825e9b208767c443cc) | cpprefjp/fixm:1 | `generator`: 概要説明を修正 | +| [a01dfab](https://github.com/cpprefjp/site/commit/a01dfab45ae2c0c89c3462ab6ebbccfaa25e2fdd), [b40b1a8](https://github.com/cpprefjp/site/commit/b40b1a83eab6a27b8ed6b09af38212277074c214) | cpprefjp/fixl:1 | utility/exchange: P2401R0対応 | +| [df3cf15](https://github.com/cpprefjp/site/commit/df3cf1576616ea59ff5b6f2e46c42aad9b88d734) | cpprefjp/fixl:3, cpprefjp/link:1 | C++20 : P0777R1対応 | +| [58fba8b](https://github.com/cpprefjp/site/commit/58fba8bb7d3df10b7d1e4052109ae27c22a472ed) | cpprefjp/fixl:2 | `basic_string/substr`: P2438R2対応 | +| [53c9bf6](https://github.com/cpprefjp/site/commit/53c9bf6cffc98cc92fb84cff4f378285cd8bd320) | cpprefjp/fixl:28 | `bitset`: P2417R2 `constexpr`化 | +| [4c86ef0](https://github.com/cpprefjp/site/commit/4c86ef0198c0d52a49f7716a658d20ab273c4d41) | cpprefjp/fixl:23 | `unique_ptr`: P2273R3 `constexpr`化 | +| [7435b8b](https://github.com/cpprefjp/site/commit/7435b8b5b5c5b7b909bbdecc643632204f3697c8) | cpprefjp/link:2 | ヘッダ一覧から``を削除し、将来のC++検討ページへ移動 | +| [1b669b1](https://github.com/cpprefjp/site/commit/1b669b142f7641f9d1239543ab39082ccb21dc26), [aa403df](https://github.com/cpprefjp/site/commit/aa403df17d9a20ce6fa2836861a09e45c43a466c), [da9f2c7](https://github.com/cpprefjp/site/commit/da9f2c769593d5d8b94ad15ed3291ab538c5f83f), [da68085](https://github.com/cpprefjp/site/commit/da6808523e7c9835d8383ecb2480e4368a26fccb) | cpprefjp/addref:1, cpprefjp/fixl:1, cpprefjp/link:1 | `utility/unreachable`: P0627R6対応 | +| [e8da7c3](https://github.com/cpprefjp/site/commit/e8da7c362f22a2d6def5f717d3315e4fd63e1ab1), [31f15af](https://github.com/cpprefjp/site/commit/31f15af518188c1ae9aefe351f3e9bb8ddfebf02) | cpprefjp/addlang:1, cpprefjp/link:4 | C++23 : P1774R8 `assume`属性 | +| [5823043](https://github.com/cpprefjp/site/commit/58230430ce1071207574b91002781b526ec6422b) | cpprefjp/fixl:8, cpprefjp/link:1 | C++23 : P2186R2 GCサポート削除 | +| [5a087a0](https://github.com/cpprefjp/site/commit/5a087a079fd97e1ea53e341313cb593e53b1db22), [30918b2](https://github.com/cpprefjp/site/commit/30918b2308ad1932317002a995220d96cd0038d5), [1f6c97c](https://github.com/cpprefjp/site/commit/1f6c97ce954e86960f296aa7d95ef14b33d587b4) | cpprefjp/addref:1, cpprefjp/fixl:1, cpprefjp/link:2 | `functional/invoke_r`: P2136R3対応 | +| [98315ac](https://github.com/cpprefjp/site/commit/98315ac5cd9d4b828401de81dc4d2c205bd9c37a), [bc4c31b](https://github.com/cpprefjp/site/commit/bc4c31bdfdeb6460a9043885d82911b660104194) | cpprefjp/addref:3, cpprefjp/fixl:1, cpprefjp/link:1 | `optional`: P0798R8 `and_then/transform/or_else`追加 | +| [ccc68e9](https://github.com/cpprefjp/site/commit/ccc68e9e6e5c615c4801914c5e7110b53ba4d80e) | cpprefjp/fixl:1 | `exception/rethrow_exception`: P1675P2対応 | +| [333f723](https://github.com/cpprefjp/site/commit/333f7233dc3a0e3aaa10ecce0fa8b2cbd1f46392) | cpprefjp/fixl:2 | `charconv`: P2291R3 `to_chars/from_chars` `constexpr`指定 | +| [382c5a5](https://github.com/cpprefjp/site/commit/382c5a58f43a993659b3fe8bb6816fc28f2bcddc) | cpprefjp/addref:6, cpprefjp/fixl:1, cpprefjp/fixm:1 | `memory`: P1132R8 `out_ptr_t`,`out_ptr`追加 | +| [bc11699](https://github.com/cpprefjp/site/commit/bc11699bac740b8042fd13a697e6a038deb8f881) | cpprefjp/link:1 | international-standard: fix N4928 link | +| [a7b1a5e](https://github.com/cpprefjp/site/commit/a7b1a5ea1f52af47efb9e60956446b86688271e5), [731e1ea](https://github.com/cpprefjp/site/commit/731e1ea31aaf0eb0022d342263e3d4b8c359e55a) | cpprefjp/addref:6, cpprefjp/link:2 | `memory`: P1132R8 `inout_ptr_t`,`inout_ptr`追加 | +| [7389f02](https://github.com/cpprefjp/site/commit/7389f02b53b3f36cb3a47e4caeb7da71239dd22d), [96e93fc](https://github.com/cpprefjp/site/commit/96e93fc28af2cb6f312a531638731b8bebdbcb90), [f853910](https://github.com/cpprefjp/site/commit/f85391077c46ea79afc2a1a5792bf3d7ac44b4e6), [01eb348](https://github.com/cpprefjp/site/commit/01eb3487685c392456dcec2c6bc85b06fcc5b8bf), [684d1f0](https://github.com/cpprefjp/site/commit/684d1f03ad7dfc7059d79909f078182c3bc58266), [63e429d](https://github.com/cpprefjp/site/commit/63e429d33d1a3e2f10ecbfe657d31a3c5b0eb41e), [1146719](https://github.com/cpprefjp/site/commit/114671911d63eb03ec0284ba4a1992d3b35e1a7a) | cpprefjp/addref:10, cpprefjp/fixl:1, cpprefjp/fixm:1, cpprefjp/link:1 | `functional`: P0288R9 `move_only_function`追加 | +| [7208b79](https://github.com/cpprefjp/site/commit/7208b792c3223ad04b126825da87d020f65e3861) | cpprefjp/fixm:1 | `generator`: 微調整 | +| [04e52ed](https://github.com/cpprefjp/site/commit/04e52ed81dd8ee331331170a6f67a548fc195e6b) | cpprefjp/fixm:1, cpprefjp/fixs:1 | 訳語表: "program-defiend type"を追加 | +| [0201450](https://github.com/cpprefjp/site/commit/020145072fe3f0b3552760fd3de229fc084fe5dc) | cpprefjp/fixm:2 | `span`,`basic_string_view`: P2251対応 | +| [e400d17](https://github.com/cpprefjp/site/commit/e400d17b65d9279c6b636cf00f8ac98964e3e5ce), [fd14d85](https://github.com/cpprefjp/site/commit/fd14d851b9dfadb7c82e398b0172f2c5ac379290), [f34854c](https://github.com/cpprefjp/site/commit/f34854cf613a91f73823e1270b3eee6bca9dac9b), [7e9e00d](https://github.com/cpprefjp/site/commit/7e9e00dcdfb90c4507302201a4b8a69b8dbab683), [724b29c](https://github.com/cpprefjp/site/commit/724b29c83cfdd8bddf4cdc1bb3c657b6c9e17d4c), [05643dc](https://github.com/cpprefjp/site/commit/05643dc9ac4efe0b623696764045ced26d6010b0), [68f67f8](https://github.com/cpprefjp/site/commit/68f67f8140eab1bc2c2e1c9af564314b587c8bce), [44e5111](https://github.com/cpprefjp/site/commit/44e51113a40fd217b00231ee404f8e42649a0666), [bc23c73](https://github.com/cpprefjp/site/commit/bc23c7365769749001533e451b3b02d8b53c3ee8), [b36c4ca](https://github.com/cpprefjp/site/commit/b36c4caa5ecd2acad1c374ef5553814b943de8b6), [c10f83d](https://github.com/cpprefjp/site/commit/c10f83df34e60c270db8b53c3699ce6348a7700e), [195bd06](https://github.com/cpprefjp/site/commit/195bd060727c2a7b967255fa8afb06d2d37c57d7), [b79bb56](https://github.com/cpprefjp/site/commit/b79bb56d63ecdfa3568ca85fa5568d1ecb355d53), [74c922f](https://github.com/cpprefjp/site/commit/74c922fff6904c42e88adb04f497dff5fa3088dc), [7a5214d](https://github.com/cpprefjp/site/commit/7a5214d449873dbd48f51bb2a022775430b6aa89), [c7fe7e2](https://github.com/cpprefjp/site/commit/c7fe7e269cffd85cbe741ba50482628f0840c716), [4d92044](https://github.com/cpprefjp/site/commit/4d920448512f40a8a9d1363b91491ab6b7dca3df), [996f8d3](https://github.com/cpprefjp/site/commit/996f8d3679187e3abf7240299e2609f33975c35d), [a97b34f](https://github.com/cpprefjp/site/commit/a97b34fc918f85ea6c1705856c12e04491d1b978), [dbb5c92](https://github.com/cpprefjp/site/commit/dbb5c926307857ac6baca67048ee5407893d7531), [7c00cbc](https://github.com/cpprefjp/site/commit/7c00cbcb2ff088824321a079167205680fb812b6), [d55ed2f](https://github.com/cpprefjp/site/commit/d55ed2f5f2abc2de1e69da1ed1f94cea6167738a), [31bdb1a](https://github.com/cpprefjp/site/commit/31bdb1a09601084f8113969e64a899383cc8e142), [a69e754](https://github.com/cpprefjp/site/commit/a69e754d6d013d030e477d95ed5bdc1432ea46e6), [da6efe1](https://github.com/cpprefjp/site/commit/da6efe1a08463c917c6d8dfa6fb453612c98d055), [1bcaedc](https://github.com/cpprefjp/site/commit/1bcaedc52902daf98f55025838c8ea628714af70) | cpprefjp/addref:53, cpprefjp/link:3 | `expected` | +| [8094e16](https://github.com/cpprefjp/site/commit/8094e1678b049e67ca0cc2d670aeac109dae4507) | cpprefjp/fixs:3 | 説明用のEXPLICITをitalic表記 | +| [915fa72](https://github.com/cpprefjp/site/commit/915fa727b6a2153ffa8550c38785a9a4d38b7cfb) | cpprefjp/fixs:57 | "see below"をitalic表記 | +| [8203fdd](https://github.com/cpprefjp/site/commit/8203fdd4e47fe92368e78d40c7821cb1d6bae2b9) | cpprefjp/link:1 | fix external link | +| [d60c9f1](https://github.com/cpprefjp/site/commit/d60c9f129df80b94cff1668f159c5eaf6c9f0420) | cpprefjp/fixm:1 | algorithm: ヘッダ冒頭説明を区分整理 | +| [5415e29](https://github.com/cpprefjp/site/commit/5415e29dfd912b953b8249e2d1b51dd18f57c4b5), [16cab03](https://github.com/cpprefjp/site/commit/16cab03355668b5b677440ac2a954a3d72817aa2), [bc842ec](https://github.com/cpprefjp/site/commit/bc842eccb3ea7ec2195a7d339994b4d9af21d4ea) | cpprefjp/fixm:1 | functional/hash: 透過的ハッシュ/等値比較の例示コードを改善 | +| [910ec8f](https://github.com/cpprefjp/site/commit/910ec8ffb3fc83359cb2515e37f3230fd992090b) | cpprefjp/fixm:1 | ディレクトリ構造: クラス階層expected/expected.void特例を明記 | +| [9fc8d74](https://github.com/cpprefjp/site/commit/9fc8d7418c4c64c443038637e34578e7a9428c4c), [58d9a1f](https://github.com/cpprefjp/site/commit/58d9a1f1730cb69791cd6e5262f424123a867941) | cpprefjp/fixm:1 | cmath/remquo: 関数の利用目的を追記 | +| [d68f5d6](https://github.com/cpprefjp/site/commit/d68f5d6cfdd62eb332354aa14196e11fd4097c54) | cpprefjp/fixl:1 | `string_view`: LWG2791 `hash`特殊化ハッシュ計算は`string`と等価 | +| [496bf9c](https://github.com/cpprefjp/site/commit/496bf9cbdced56bf08284bc1b984977a18136cee) | cpprefjp/fixm:1 | functional/hash: 説明増補 | +| [54c7748](https://github.com/cpprefjp/site/commit/54c77480d6285273fddf16893c874817017ce004) | cpprefjp/fixl:1 | barrier: P2588R3対応 | +| [f594598](https://github.com/cpprefjp/site/commit/f5945989373e78031eef9ece3dc5ccdf13dfb41d) | cpprefjp/fixm:1 | `is_layout_compatible`: fix typo, update example | +| [4476acb](https://github.com/cpprefjp/site/commit/4476acb905f114be0c9850595fc37a7fa486617a) | cpprefjp/fixl:6 | P2614R2対応 | +| [f016e5b](https://github.com/cpprefjp/site/commit/f016e5bd22ff018f840da9de5698acce5d6e993e) | cpprefjp/fixl:1 | generator: P2787R1対応 | +| [05d6b67](https://github.com/cpprefjp/site/commit/05d6b67e43a136c1b3146e1d6560d50870270188) | cpprefjp/fixl:3 | P1413R2 -> P1413R3 | +| [066971a](https://github.com/cpprefjp/site/commit/066971a8538f6c7d522967cb1c65cad8d1b355e3) | cpprefjp/fixl:1 | `span`/`dynamic_extent`: P2116R0対応 | +| [03ff589](https://github.com/cpprefjp/site/commit/03ff5892fe0aa4fb8b8bdcdbba77fec13360c9de) | cpprefjp/typo:1 | `type_traits`/`is_pod`: fix typo | +| [38b9677](https://github.com/cpprefjp/site/commit/38b9677ca78a674160acc8f3c1d792c25b530c9f) | cpprefjp/fixl:2 | C++26 P2734R0対応 | +| [6e62fb1](https://github.com/cpprefjp/site/commit/6e62fb11896097dd937e50dadfbb80b72e5522ff) | cpprefjp/addref:1, cpprefjp/fixl:1, cpprefjp/link:1 | `ranges`: `from_range`タグ | +| [2873c6f](https://github.com/cpprefjp/site/commit/2873c6f3ce31b51a2c42f50a932ee09a005cc7c5) | cpprefjp/fixl:4 | LWG2510対応 | +| [6df7cab](https://github.com/cpprefjp/site/commit/6df7cab6190236bae3307f74ca259ff29892eea4) | cpprefjp/addref:10, cpprefjp/fixl:2, cpprefjp/link:1 | P2548R6 `copyable_function` | + + +## [faithandbrave](https://github.com/faithandbrave) + +| コミット | タグ | 説明 | +|----------|------|------| +| [994ee06](https://github.com/cpprefjp/site/commit/994ee06cd34292af65978d9bda7a228b3c4ed340) | cpprefjp/fixm:1 | C++23 : `byteswap`への言及を追加 | +| [651153b](https://github.com/cpprefjp/site/commit/651153bde66e9de6f15ba010d25884d5788eb96e) | cpprefjp/fixm:1 | C++17 インライン変数 : 異なる型でインライン指定してはならないことはすでに仕様として書いてあったので、例示という形で無名クラスオブジェクトの解説をするよう修正 | +| [2f771c9](https://github.com/cpprefjp/site/commit/2f771c9f5e2d693949cf280f03e7001203f86488) | cpprefjp/fixl:1 | コンパイラの実装状況 : C++23の機能を一通り記載 | +| [27f6bb3](https://github.com/cpprefjp/site/commit/27f6bb3a7462e02e3f090d9991404439cf888230) | cpprefjp/addlang:1, cpprefjp/link:1 | C++14 : 「宣言時のメンバ初期化を持つ型の集成体初期化を許可」を追加 | +| [bd3ccc8](https://github.com/cpprefjp/site/commit/bd3ccc893f5ab8270ec7f91462c626ef7a791474) | cpprefjp/link:1 | C++11 非静的メンバ変数の初期化 : 「C++14 宣言時のメンバ初期化を持つ型の集成体初期化を許可」へのリンクを追加 | +| [602ea13](https://github.com/cpprefjp/site/commit/602ea13f1e58408a6dbc9f7fd73e1bd281dc9ef2), [198a5b0](https://github.com/cpprefjp/site/commit/198a5b061b43c5599cc0ccec8b25c8c9789cedd9) | cpprefjp/addlang:1, cpprefjp/link:4 | C++20 : 「暗黙のラムダキャプチャを簡略化」を追加 | +| [b66903a](https://github.com/cpprefjp/site/commit/b66903af7aae0c27ac7f4bf5ea730cb11c731609) | cpprefjp/typo:1 | apply : fix typo | +| [a73f34d](https://github.com/cpprefjp/site/commit/a73f34d4e7f371a8d311d7c539471422fbeebc90) | cpprefjp/fixm:1 | apply : オーバーロードに番号をつけた | +| [85bebb5](https://github.com/cpprefjp/site/commit/85bebb584efb6141b4026ff231e7630aba3f4f27) | cpprefjp/fixs:18 | 編集者向け資料をリネームし、「cpprefjpを編集するには」をサイドバーに表示 | +| [eb4b7dd](https://github.com/cpprefjp/site/commit/eb4b7dd0cd8950815bd93ecb18fb56478d3c3879) | cpprefjp/fixs:1 | リンク修正 | +| [654c879](https://github.com/cpprefjp/site/commit/654c8795c2b0930f0f841f1fa227acd0b922733f) | cpprefjp/addlang:1, cpprefjp/link:2 | C++20 : 「デフォルトのコピーコンストラクタと非constなコンストラクタが衝突する問題を修正」を追加 | +| [2114ad7](https://github.com/cpprefjp/site/commit/2114ad7ea10a62fe8f32acaf49af047fe6996a1f), [d7ebdf4](https://github.com/cpprefjp/site/commit/d7ebdf4d7158da1a8b24fb289bfdf1256a86e654) | cpprefjp/addlang:1, cpprefjp/link:2 | C++20 : 「抽象型のチェック」を追加 | +| [3918a50](https://github.com/cpprefjp/site/commit/3918a5059050dd68afaf130f76fb2f345105f576), [172d284](https://github.com/cpprefjp/site/commit/172d284725939b57df8a53fc1c6d6927cc546bf7) | cpprefjp/fixm:2 | CONTRIBUTINGとstart_editingが重複していたので整理 | +| [03178a7](https://github.com/cpprefjp/site/commit/03178a714b1bb037194554a0ce91395cd3536e16) | cpprefjp/fixm:1 | C++23 : `std::format`のRange、タプルの出力を例示 | +| [a0a65d9](https://github.com/cpprefjp/site/commit/a0a65d950381e8c5c246de5f9dead685aba7db4e) | tool/fixbug:1, cpprefjp/fixm:3 | 拡張子ミスのような不正な内部リンクが検出されていなかったのを修正 | +| [9769a26](https://github.com/cpprefjp/site/commit/9769a2621a0cc735b6a3eacbc0ca487bbbaf361d), [6110d2a](https://github.com/cpprefjp/site/commit/6110d2acd09265649b59d92bce37988f9bb6c491) | cpprefjp/addref:1, cpprefjp/link:1 | `` : `formattable`を追加 | +| [8ba4402](https://github.com/cpprefjp/site/commit/8ba4402df9b92a45ccca16558fc3e504d97cff28) | cpprefjp/fixl:1 | 国際標準規格 : C++23のWorking Draftを更新 | +| [0818b72](https://github.com/cpprefjp/site/commit/0818b7295acfa3a6ddad86c8331655f9cc8c2d25) | cpprefjp/fixl:2 | C++23 : 言語機能としてN4929のEditor's Reportで採択されたものを記載 | +| [1e4b73b](https://github.com/cpprefjp/site/commit/1e4b73b5da23e978ded1e96d3e12dfa8cb2746ff) | cpprefjp/fixl:1 | `format` : デバッグ指定と、C++23向けサンプルコードを追加 | +| [30fc8df](https://github.com/cpprefjp/site/commit/30fc8dfa3b393e0d82cb47e01f87483cdc6abe38) | cpprefjp/fixl:1 | `format` : Rangeとtuple-typeの書式仕様を追加 | +| [07a5186](https://github.com/cpprefjp/site/commit/07a5186b1aa5dd5a0862eb8d36f0dca5b51d8cf8) | cpprefjp/fixs:1 | `format` : 見出しとして別な用途で「例」があると混乱するので、リネーム | +| [44c43e1](https://github.com/cpprefjp/site/commit/44c43e183739ddba0b62ede3da2f5e5d4d9a38fe) | cpprefjp/fixm:1, cpprefjp/fixs:3 | `hexfloat` : GCCで入力での使用にバグがあることを記載 | +| [2497046](https://github.com/cpprefjp/site/commit/2497046e4f89beeaffa4c0f7f3a014c4b6560e0e) | cpprefjp/fixm:1 | `format` : Rangeの要素に対する書式指定の例を記載 | +| [1a3edd0](https://github.com/cpprefjp/site/commit/1a3edd0c8bebb22b99068fcdd45d4f2efb52c312) | cpprefjp/link:16 | `std::tuple`をグローバル修飾リストに追加 | +| [dd2fa16](https://github.com/cpprefjp/site/commit/dd2fa16c526d237459f87e1b6b2511545779968d) | cpprefjp/fixm:1 | `format` : Rangeのデバッグ出力を解除する例を記載 | +| [c73a954](https://github.com/cpprefjp/site/commit/c73a9543b5fc9445921fd23c14b862129e8d21d3) | cpprefjp/fixm:1 | `format` : `vector>`の書式指定の例を追加 | +| [dc3a27e](https://github.com/cpprefjp/site/commit/dc3a27eda45160ff1b3cd68f5ad67915805fd0c5), [7f6f300](https://github.com/cpprefjp/site/commit/7f6f300c6b989362ef158ca6852f3feb7577e901), [61cbf01](https://github.com/cpprefjp/site/commit/61cbf011ad1acf7aecc4eab5853ea65edb6a4e80) | cpprefjp/addref:2, cpprefjp/fixl:1, cpprefjp/link:39 | `` : `range_format`と`format_kind`を追加 | +| [5388006](https://github.com/cpprefjp/site/commit/53880060961c5a4400ef61ee610bd6077224c070) | cpprefjp/fixl:1 | `formatter` : C++23仕様に対応し、サンプルコードのコンパイルエラーを修正 (`const`が抜けてた) | +| [c5c2b70](https://github.com/cpprefjp/site/commit/c5c2b70b56b6b6f805049ca80c7772d432bfc408) | cpprefjp/fixm:1 | 編集タスクを、start_editing.mdの下の方に記載した | +| [c7b073e](https://github.com/cpprefjp/site/commit/c7b073edbaacae8d096596221e3f4b25f6c98362), [ccd76f6](https://github.com/cpprefjp/site/commit/ccd76f630e9cb46d570698a709ff442b58f98c78) | cpprefjp/addref:1, cpprefjp/link:2 | `formatter` : `parse`を追加 | +| [a7b952b](https://github.com/cpprefjp/site/commit/a7b952b5dd1ab45c869dc554cdfa89b9eabfd1ae), [e13f4b9](https://github.com/cpprefjp/site/commit/e13f4b9b603c641a2612512aa5b414bbd873dd44), [4b80aa7](https://github.com/cpprefjp/site/commit/4b80aa7366b63eb7ae96c0be2d2c355a056437ec) | cpprefjp/addpage:1, cpprefjp/link:1 | ディレクトリ構造のドキュメントを追加 | +| [6d599ab](https://github.com/cpprefjp/site/commit/6d599abc0f83e6e4fbbda70230a5604e4887d17d) | cpprefjp/fixm:1 | `formatter` : `format`メンバ関数は`const`でなければならない | +| [410c572](https://github.com/cpprefjp/site/commit/410c5724eb943491f7efda14612ede8075ef839d) | cpprefjp/addref:3, cpprefjp/fixm:2 | `basic_format_context` : `out`, `advance_to`, `locale`を追加 | +| [322f877](https://github.com/cpprefjp/site/commit/322f877cba64aafc0fe6e828f93455ddfaa8ecb8) | cpprefjp/fixm:1, cpprefjp/fixs:1 | `formatter` : `parse`を実装する例を記載 | +| [ad99718](https://github.com/cpprefjp/site/commit/ad997184e5177e545acd5a3b7410cc48451fc5cb), [d1ac632](https://github.com/cpprefjp/site/commit/d1ac632cff8ca15c520099a205d3039e6b7111c1) | cpprefjp/addref:3, cpprefjp/link:4 | `basic_format_parse_context`: `begin`, `end`, `advance_to`を追加 | +| [3269f7f](https://github.com/cpprefjp/site/commit/3269f7f3c99ee899ad037629c023ff4edb7577a0) | cpprefjp/addref:4, cpprefjp/link:3 | `formatter` : `format`, `set_brackets`, `set_separator`, `set_debug_format`を追加 | +| [93bd53e](https://github.com/cpprefjp/site/commit/93bd53edf4fda360fdc78d36d80cbbe94036c3b5) | cpprefjp/fixs:1 | `formatter` : コード修飾を追加 | +| [f3d46e1](https://github.com/cpprefjp/site/commit/f3d46e161ef521b57aeb7cc2b254859daedae89f), [1b70d49](https://github.com/cpprefjp/site/commit/1b70d4969c37657769dcef952082534252dba460), [258f393](https://github.com/cpprefjp/site/commit/258f393aeb27077ec21225cc177df1722c7529e5), [373f49d](https://github.com/cpprefjp/site/commit/373f49da92fb9c34115279a210f29067b6259e35), [74662b4](https://github.com/cpprefjp/site/commit/74662b472ba0ca06ab99ac08ed74a3d2e8669584) | cpprefjp/addref:6, cpprefjp/link:1 | `` : `range_formatter`を追加 | +| [1971c4d](https://github.com/cpprefjp/site/commit/1971c4d9bd39ce1da8ac77597daca3298cb2e3d4) | cpprefjp/addref:2, cpprefjp/fixl:5 | `` : コンテナアダプタの文字列フォーマットに対応 | +| [2513346](https://github.com/cpprefjp/site/commit/2513346aaefb6f93d4740367084d9f30d30a05aa) | cpprefjp/addref:1, cpprefjp/fixm:1, cpprefjp/link:2 | `` : `range-default-formatter`を追加 | +| [f216f9f](https://github.com/cpprefjp/site/commit/f216f9febdb4ded06f2ad999933927d694b52765), [b2de7ca](https://github.com/cpprefjp/site/commit/b2de7cae247187b6cacc107f68aa0afec3c7ef0c) | cpprefjp/fixl:1, cpprefjp/fixm:1, cpprefjp/link:1 | `vector::reference`に対する`formatter`の特殊化を追加 | +| [4f16a60](https://github.com/cpprefjp/site/commit/4f16a60c92c925396a78baf6e08f22a3450ff652), [469297f](https://github.com/cpprefjp/site/commit/469297fa7a5b27cdd4c4eca4b637a576ee496734), [a235d11](https://github.com/cpprefjp/site/commit/a235d11124e9da535c0af2a90407538d283fb260), [dfae477](https://github.com/cpprefjp/site/commit/dfae47736e42e6bf4603692f494e00540d05e3de), [e388ca6](https://github.com/cpprefjp/site/commit/e388ca69c6b456116a9cda79e221a8df66454bd2), [0bd721d](https://github.com/cpprefjp/site/commit/0bd721d4509759a70a2f56a2e6f7b77f99df7eaf), [88c0244](https://github.com/cpprefjp/site/commit/88c024464a199aa995fdfc422f9d4c4da216c048), [bc47b38](https://github.com/cpprefjp/site/commit/bc47b38c8e7d7a4e56a6783240de300d0d5cac84), [a689c6b](https://github.com/cpprefjp/site/commit/a689c6b126c827101cda6035cb83100609953f65) | cpprefjp/addref:9, cpprefjp/fixl:1, cpprefjp/fixm:1, cpprefjp/link:3 | ``ヘッダ | +| [83d5357](https://github.com/cpprefjp/site/commit/83d53575d897b0bcdc6c5963ea22fd18ec855755) | cpprefjp/fixs:3 | `optional::and_then`, `or_else` : コード修飾を追加 | +| [6d029cb](https://github.com/cpprefjp/site/commit/6d029cb18ead0f2abc706638978bc258ef4e5ea1) | cpprefjp/fixs:1 | `expected` : コード修飾を追加 | +| [33fb996](https://github.com/cpprefjp/site/commit/33fb9968149fffc0fd360aeee22c1bce32238a55) | cpprefjp/fixs:1 | detect forbidden characters CIの説明を記載 | +| [524b256](https://github.com/cpprefjp/site/commit/524b25681551c84589da6a080fda499b38a859aa) | cpprefjp/fixm:1 | start_editing : GitHub Actionsの各タスクについての説明を記載 | +| [f770ec5](https://github.com/cpprefjp/site/commit/f770ec54101b867e1347bbe1c0352c3056c649a4), [6a2ea7c](https://github.com/cpprefjp/site/commit/6a2ea7cae4b614ea47552d81e31eeae5b35c9b03) | cpprefjp/addref:3, cpprefjp/fixl:2, cpprefjp/link:7 | `` : `basic_format_string`クラスを追加 | +| [9ad08e0](https://github.com/cpprefjp/site/commit/9ad08e064c4e949c87fbd7ec33534903de1f4d76) | cpprefjp/fixm:1 | `format` : ログ出力の例を追加 | +| [9140852](https://github.com/cpprefjp/site/commit/9140852ca87b0d97fe82e630ad5fe65f876f0f0c) | cpprefjp/fixs:1 | `format` : 段落ミスを修正 | +| [6b38026](https://github.com/cpprefjp/site/commit/6b380267a5dc836d9adf22c2e2fb983f02ca2ce4), [6048252](https://github.com/cpprefjp/site/commit/604825206be7c23d8379e547c24893fa88319f1c) | tool/addm:2, cpprefjp/fixs:199, cpprefjp/link:1 | コード修飾の誤り検出CIを追加 | +| [0709184](https://github.com/cpprefjp/site/commit/0709184c1cbe9f034e42efc9ec3cd272972b2192) | tool/improves:1 | 外部リンクチェック : microsoft.com を無視リストに登録 | +| [a26647a](https://github.com/cpprefjp/site/commit/a26647ae2a5f030130be55e76162716598002d6c), [d3cb083](https://github.com/cpprefjp/site/commit/d3cb0839fde2f6b6534b5ba13db0c0c045804d9d), [eaf722b](https://github.com/cpprefjp/site/commit/eaf722b020984fde1abdb2b50c1f39d8863ecb1b), [182e098](https://github.com/cpprefjp/site/commit/182e098dccc8482b0d0965ebd32f76dd01406bdb), [019f15e](https://github.com/cpprefjp/site/commit/019f15edfc2908d7d6678f7199696635dc2a7e92), [be98598](https://github.com/cpprefjp/site/commit/be98598467b9fc65906070c8edfd69ea1f243601), [5419582](https://github.com/cpprefjp/site/commit/5419582e559fd5c88d719564587a9ca714844e5d) | cpprefjp/fixl:37 | ``の`constexpr`対応 | +| [ba05560](https://github.com/cpprefjp/site/commit/ba05560fb997bdded15d10da0863ffb56166bee0) | cpprefjp/fixs:11 | 返り値、返値 : 訳語表に基づいて「戻り値」に修正 | +| [ace1860](https://github.com/cpprefjp/site/commit/ace1860c41772f23dc20e50b11b68c5890c2d430), [0567ba8](https://github.com/cpprefjp/site/commit/0567ba866215221944f3f808e33f23700c92f9cf) | cpprefjp/fixl:53 | `` : 拡張浮動小数点数型への対応 | +| [2d01c56](https://github.com/cpprefjp/site/commit/2d01c561c9be61f02c5bac8113902099b2289481) | cpprefjp/addref:1, cpprefjp/fixs:1, cpprefjp/link:2 | `` : `abs`を追加 | +| [72d23cc](https://github.com/cpprefjp/site/commit/72d23cc651cdd53f0277d10e15bb9b26f0f66155) | cpprefjp/addref:4, cpprefjp/link:1 | `` : `div`を追加 | +| [afa0dc5](https://github.com/cpprefjp/site/commit/afa0dc58b54968ec198a87a995138eefa3c092c1), [dcbf835](https://github.com/cpprefjp/site/commit/dcbf835672a941482bd4eab44a9cdb713eabba2b), [b137272](https://github.com/cpprefjp/site/commit/b137272314df5cdd51f680abdcd931840dc9fee1), [f39c3c3](https://github.com/cpprefjp/site/commit/f39c3c31a7de0c74a6ad80fc8776d2022ac064e3), [85010fb](https://github.com/cpprefjp/site/commit/85010fbf2610dd0ecf5616502c609d70839d02b3), [b986d8c](https://github.com/cpprefjp/site/commit/b986d8c2578971123909748683f72e599ac081ac), [24071c4](https://github.com/cpprefjp/site/commit/24071c41d16fb31699da953fada78eadf9769d12), [828ff58](https://github.com/cpprefjp/site/commit/828ff5889a64f24eec0a5c14efcdb4b4abe0cdc7) | cpprefjp/addref:6, cpprefjp/link:3, cpprefjp/fixl:4, cpprefjp/fixm:2 | `` | +| [3607e5a](https://github.com/cpprefjp/site/commit/3607e5ab6eb5bf25b32929dc2426d78672ab5e9f) | cpprefjp/fixl:1, cpprefjp/link:4 | `numeric_limits::is_iec559` : C++23対応 |a +| [f5a4bdc](https://github.com/cpprefjp/site/commit/f5a4bdcc87ea89099b2112d27cb67ca68af26546) | cpprefjp/fixl:9 | `complex` : C++23の拡張浮動小数点数型に対応 | +| [d00a2e8](https://github.com/cpprefjp/site/commit/d00a2e8f0da78ce5910d58817306a2a05e2f97ba) | cpprefjp/fixs:1 | 不要なコード修飾を削除 | +| [bd6e8a6](https://github.com/cpprefjp/site/commit/bd6e8a6d96268e8405ad83cb1d8c61fd9e0c3e68) | tool/addm:1 | buildジョブを最新以外キャンセルするよう修正 | +| [f447758](https://github.com/cpprefjp/site/commit/f447758159921653e9e3346942620c9c7bf074b8) | cpprefjp/fixl:1 | `from_chars` : 拡張浮動小数点数型に対応 | +| [985d49c](https://github.com/cpprefjp/site/commit/985d49c758e7d255f694e0357e289c7484c47cf8) | cpprefjp/fixl:1 | `to_chars` : 拡張浮動小数点数型に対応 | +| [d9d21a6](https://github.com/cpprefjp/site/commit/d9d21a6ae8197fd8f3b2f068b597574fc67bf450), [a49ab65](https://github.com/cpprefjp/site/commit/a49ab655988d97d3a3f88babe5c609af7a3588d0), [9fe59f7](https://github.com/cpprefjp/site/commit/9fe59f7c3a1b97adef5bc273c0ab9f81f8b085a7), [3ecf9ca](https://github.com/cpprefjp/site/commit/3ecf9caed67da356223be078b0707556c9226e2c), [82cec00](https://github.com/cpprefjp/site/commit/82cec00a8113857dd68414dc45d1b4803cf83a74), [0ce85f3](https://github.com/cpprefjp/site/commit/0ce85f3d6aa5f19188d506288f7f3101ee3313c3), [9d64bb3](https://github.com/cpprefjp/site/commit/9d64bb3992e4f626b57dc749cb4fc05e36dad532), [566457e](https://github.com/cpprefjp/site/commit/566457ebc95a9e0329610ff0e31f8e4a5d445323), [5e04103](https://github.com/cpprefjp/site/commit/5e0410386479b6cbb938010164128996c2f18876), [e87272b](https://github.com/cpprefjp/site/commit/e87272b9c0f629393dfa20826eca548e99628237), [1fe5eb3](https://github.com/cpprefjp/site/commit/1fe5eb30dfd9a30854f2c1a13ddfaeb7fe5f9eed), [c84d47b](https://github.com/cpprefjp/site/commit/c84d47b429f528700f37e1ba4d22f8b7e5bfdd61), [a43bd16](https://github.com/cpprefjp/site/commit/a43bd165f7c77b915000e79e11396d825ec7b0bd), [c5c7b5a](https://github.com/cpprefjp/site/commit/c5c7b5ad8893c03a788f1f80a0ecd5e1480d12d0), [fb3b50d](https://github.com/cpprefjp/site/commit/fb3b50d2c8403fb9fa47e9941441f8fe686094a2), [9430b41](https://github.com/cpprefjp/site/commit/9430b41593e773a191064eff80815532a0629be0), [d6e40dd](https://github.com/cpprefjp/site/commit/d6e40dd1f3f328b9f1e2d3ba3fd06a068eee1d2d), [d91c1da](https://github.com/cpprefjp/site/commit/d91c1da0f13281d896a93c82e69da2b0f8eb611b), [19decb2](https://github.com/cpprefjp/site/commit/19decb254a0a081db7d7047d2405ac1ae5b8a066), [95fb484](https://github.com/cpprefjp/site/commit/95fb484cfa67d9ff9c25e7fb3b53876e24abc206), [9403580](https://github.com/cpprefjp/site/commit/94035802f33d93439e33cd6b437f097d11ff402f), [ff098b7](https://github.com/cpprefjp/site/commit/ff098b7d447c0a2f43b975706bdbdfd457da3c9e), [31bf54b](https://github.com/cpprefjp/site/commit/31bf54bd4fb47c87772bc62b636047089f5176d9), [83dd89c](https://github.com/cpprefjp/site/commit/83dd89cb38bbc23df68cf8b6372ea0a7010a2385), [fb295e5](https://github.com/cpprefjp/site/commit/fb295e5dead94487ffcc86042b541ab62e3cb068), [0376f47](https://github.com/cpprefjp/site/commit/0376f471268c8f124984b4911a40bf6dec84eefc), [2ba5e13](https://github.com/cpprefjp/site/commit/2ba5e134badc55935bde36761d61ced7bc9dcd68), [2c9f635](https://github.com/cpprefjp/site/commit/2c9f635eff6128691a72fb7312df6fe1f69deb8e), [c9cf59d](https://github.com/cpprefjp/site/commit/c9cf59db4c0ab7b178340eef2d8f9c5799e5220c), [5674bf7](https://github.com/cpprefjp/site/commit/5674bf7cffb19f6e4c99d61e786dabb7ccfb5106), [0b73645](https://github.com/cpprefjp/site/commit/0b736455a3af08ad8f820288134a5935e0cb513d), [0c072b9](https://github.com/cpprefjp/site/commit/0c072b9d3b702aad4920422e2fbb042c2e291019), [1e33730](https://github.com/cpprefjp/site/commit/1e3373055cb45f236e09607348f156090c597335), [f3f7503](https://github.com/cpprefjp/site/commit/f3f750307c2fa2056d04f01ad79cc0e75236a054), [292f841](https://github.com/cpprefjp/site/commit/292f841f9c90af75b5804ce5481dc23e6f93580a), [3547182](https://github.com/cpprefjp/site/commit/3547182922866d554e5e9e681ffdc2bb81c6503f), [db7801c](https://github.com/cpprefjp/site/commit/db7801c0f24a2e644d58d77981fb7767bfc88d38), [cd883d1](https://github.com/cpprefjp/site/commit/cd883d1560a5608d4f3d2df4dec093706a84c305), [d210ea7](https://github.com/cpprefjp/site/commit/d210ea7ae2005bc551bb475f8f29e3d2eb36458d), [7f2cc9c](https://github.com/cpprefjp/site/commit/7f2cc9c03b4d65c0b81a0e9106ce065c74a017ea), [430fad2](https://github.com/cpprefjp/site/commit/430fad23a6692db0c8d608f465732ec3ac1db083), [842cacb](https://github.com/cpprefjp/site/commit/842cacbb7d3c6d5da2c4f25ab7c829b50571c8a7) | cpprefjp/addref:37, cpprefjp/fixl:1, cpprefjp/fixm:8, cpprefjp/link:7 | `` | +| [b30e6fd](https://github.com/cpprefjp/site/commit/b30e6fd541461db3e42e8e62566af794628077fa) | cpprefjp/fixm:1 | Clang 16でC++17がデフォルトになった | +| [5ae96e7](https://github.com/cpprefjp/site/commit/5ae96e7b57f2e93aafb913a4c658faa229325091), [163df86](https://github.com/cpprefjp/site/commit/163df869ce0e8c97cb11c2c13363578a0801dc78) | cpprefjp/fixm:1 | トップページに、スポンサーシップについて掲載 | +| [ec2e4d0](https://github.com/cpprefjp/site/commit/ec2e4d073819ab587b8697b938e3935a06ba00e7), [f578c30](https://github.com/cpprefjp/site/commit/f578c301efb8a61c8315cba9d085440e6847028b), [ee14b2a](https://github.com/cpprefjp/site/commit/ee14b2abd0629a65e1a1c7439e153d882bd4dda0), [b42afef](https://github.com/cpprefjp/site/commit/b42afef66438a15b6676484c6ec372f2a3d67482), [6c6acb8](https://github.com/cpprefjp/site/commit/6c6acb89e820b695525a06025bb4b2f028604482) | cpprefjp/fixm:1 | トップページ : Acerola Software社様のロゴを表示 | +| [51b9443](https://github.com/cpprefjp/site/commit/51b9443a4f04cbe929cd6d839db6bbc8c08d5097) | cpprefjp/fixm:1 | トップページ : Fixstars社様のロゴを表示 | +| [15e87df](https://github.com/cpprefjp/site/commit/15e87dfd566db42845f47158e941032b9e0a2de0) | cpprefjp/typo:1 | (multi)map, (multi)set : s/const pointer/const_pointer/ | +| [5f8fea3](https://github.com/cpprefjp/site/commit/5f8fea3398580638ca88fe270ac92b789e6e48bc) | cpprefjp/fixm:1 | クラスの雛形ページ : Hidden Friendsの記載例を追加 | +| [8627239](https://github.com/cpprefjp/site/commit/8627239dd8cf584e55541ecf4754bcaa8f746780) | cpprefjp/fixm:1 | 国際標準規格 : C++23の規格案を更新 | +| [0f55a96](https://github.com/cpprefjp/site/commit/0f55a9625276f145d0ea372275df2e829a978782) | cpprefjp/link:1 | テンプレート再帰回数の記事がリンク切れしていたのでアーカイブに差し替え | +| [e852199](https://github.com/cpprefjp/site/commit/e85219905c26037593496a3fe1622160c27f5620), [6566493](https://github.com/cpprefjp/site/commit/656649355ce2bda2f629f12880e239fed254e520), [138872a](https://github.com/cpprefjp/site/commit/138872afcc7aaedb1d76a21314c5a49a5b915967) | cpprefjp/fixl:1 | C++23 : N4945での主要な変更を反映 | +| [058df35](https://github.com/cpprefjp/site/commit/058df357fc5857506ee46f8fc179485c0ee759ec), [4f1dfeb](https://github.com/cpprefjp/site/commit/4f1dfeb02c7ba96c0fb0f83fb56afbd02290369a), [8916ccb](https://github.com/cpprefjp/site/commit/8916ccbfcfaa9500e668b826335fa483e77d1151) | tool/addm:2, cpprefjp/typo:4, cpprefjp/link:1 | NGワードのチェックCIを追加 | +| [8a3b779](https://github.com/cpprefjp/site/commit/8a3b7791e2aa4768757706b8294ff698bbc3233f) | tool/improves:1, cpprefjp/typo:1 | 移譲->委譲 を追加 | +| [b7b6270](https://github.com/cpprefjp/site/commit/b7b62702f56341a53ba6f218fbb01661e966a284) | cpprefjp/fixs:1 | `map::operator[ ]` : オーバーロードに言語バージョンの書き忘れ | +| [1702da3](https://github.com/cpprefjp/site/commit/1702da3257cf6123abd2378255bd48554eb4a1bf) | cpprefjp/fixm:4 | (multi)set|mapのfind : 透過的な検索の仕様をひな形に合わせた | +| [131af88](https://github.com/cpprefjp/site/commit/131af885ebb460f4f285099152718fafd5e31fbd), [555a222](https://github.com/cpprefjp/site/commit/555a222083f8300ca63b94d0f019c7f8e0415df1) | cpprefjp/fixm:1 | vaporoid様のスポンサーロゴを追加 | +| [a6f4987](https://github.com/cpprefjp/site/commit/a6f4987bf6e5fc792246606aa37c263b065b25ab), [db4695b](https://github.com/cpprefjp/site/commit/db4695bbdc990ec369d8ca97b7ddeb40431e58d4), [e5f31cd](https://github.com/cpprefjp/site/commit/e5f31cd4413e1e2156289e5d5ad28c4c8f703735), [76502a5](https://github.com/cpprefjp/site/commit/76502a5485982eeb21315b415a8a3bec5da8a929), [0bbeedb](https://github.com/cpprefjp/site/commit/0bbeedbb56fd825f21ead503b0edf8f47875d4f3) | cpprefjp/fixm:1 | 新たなスポンサーを追加 | +| [8d47b62](https://github.com/cpprefjp/site/commit/8d47b625a8d21ac5de2c8b5feeb04ff2b8470793) | cpprefjp/fixm:1 | スポンサーを追加 | +| [ca45417](https://github.com/cpprefjp/site/commit/ca4541705729e6b4d06cc8cf660a39dc70dc7a79), [1e49d46](https://github.com/cpprefjp/site/commit/1e49d46de2000efe530efba043c9daa973786916) | cpprefjp/fixm:1 | スポンサー追加 | +| [50fa390](https://github.com/cpprefjp/site/commit/50fa3907fce6fc13f715b89d4e0ad79c55e91dc6), [394355b](https://github.com/cpprefjp/site/commit/394355bbef55ac255bb459691f4ccfb8c671ecfb) | cpprefjp/fixm:1 | スポンサー追加 | +| [c019c0e](https://github.com/cpprefjp/site/commit/c019c0e36bbd4830536eeb9cb79fc6f039c9e9b9) | cpprefjp/typo:1 | `borrowed_range` : `span`の要素は文字列ではなく`int` | +| [aaff7b5](https://github.com/cpprefjp/site/commit/aaff7b5d32b068cc6cd74ea24f9fb1b25f437a5c) | cpprefjp/fixm:2 | (multi)map : emptyの言語バージョンがC++11になっていたのを修正 | +| [309d0ed](https://github.com/cpprefjp/site/commit/309d0ed04619e888f7d063ef314f6852c8575a41) | cpprefjp/fixm:1 | 規格草案を更新 | +| [dc8afeb](https://github.com/cpprefjp/site/commit/dc8afeb80e6ddd381b69bc2183821e7147e07465), [86be6a9](https://github.com/cpprefjp/site/commit/86be6a9acac38fb842a093948e9ee02679a267eb) | cpprefjp/fixm:1 | スポンサー更新 | +| [8794a91](https://github.com/cpprefjp/site/commit/8794a91852bd41ca1ca6aec28e304d2279c366cf) | cpprefjp/typo:1 | generator : クラス定義のセミコロン忘れを修正 | +| [1007613](https://github.com/cpprefjp/site/commit/1007613676069369e0090ad3305b504e2e83815c) | cpprefjp/fixm:1 | 関数の雛形ページ : 非推奨・削除の書き方が記載されていなかった | +| [6b1443d](https://github.com/cpprefjp/site/commit/6b1443d2ddd576603a80d4c6b321941d86ab42ed) | cpprefjp/fixm:3 | `has_denorm(_loss)` : 非推奨の詳細を記載 | +| [5ae2c39](https://github.com/cpprefjp/site/commit/5ae2c39abd2fa04018b5ee8add2a054c25079f4c) | tool/improves:1, cpprefjp/typo:3 | NGワードとしてpvalue (prvalueのtypo) を追加 | +| [0f3743e](https://github.com/cpprefjp/site/commit/0f3743e212c0c612150466f8fec1babd509c7a6f) | cpprefjp/fixl:1 | C++20 : `shared_ptr`のアトミック操作が非推奨になったことを記載 | +| [8f3626e](https://github.com/cpprefjp/site/commit/8f3626e2afa6c227bc9170774fd7b72e87d3c7c8) | cpprefjp/fixm:36 | `set`/`map`の`begin`/`end`系 : ほかのコンテナに合わせて文章を整理 | +| [5af768a](https://github.com/cpprefjp/site/commit/5af768ad072b6415b1ed2d271af3f11270eaf5da) | cpprefjp/link:3 | C++20 `constinit` : `mutex`/`unique_ptr`のコンストラクタと相互リンク | +| [587bd5b](https://github.com/cpprefjp/site/commit/587bd5b265057b6b9f69895cf8c98d6c37bdd483), [ae7c515](https://github.com/cpprefjp/site/commit/ae7c515da20425de6c80b7b4336ec49ba8d7f0c6), [6251e4a](https://github.com/cpprefjp/site/commit/6251e4abe9d90fab42621ba97fea3a0b4a3c94aa), [a6c9e22](https://github.com/cpprefjp/site/commit/a6c9e227b387d2aa8631acc1df6f78468d690702), [717658d](https://github.com/cpprefjp/site/commit/717658da25868f54091bc273aaff7f7c5e46e02b), [e7ee1d9](https://github.com/cpprefjp/site/commit/e7ee1d999620147a6423c73b2992803bf7185a50), [c170374](https://github.com/cpprefjp/site/commit/c170374a913b9dbd4dceb07dbfa4eeba5489ed24) | cpprefjp/fixm:4 | `map`/`set`の`erase`に存在しないキーを指定した場合の動作 | +| [6eaa82d](https://github.com/cpprefjp/site/commit/6eaa82d487e3c732fa17de04e4bf624125036174) | cpprefjp/fixl:4 | `map` / `set`の`extract` : C++23でのheterogeneousなオーバーロードを追加 | +| [a5c1257](https://github.com/cpprefjp/site/commit/a5c12573bef144e8af06888137c3e8401abcca49) | cpprefjp/link:1 | ワイブル分布の参考文献をWeb Archiveに差し替え | +| [2dd6e26](https://github.com/cpprefjp/site/commit/2dd6e26bcbdb1a1faebd702ca4e0be505acb9668) | cpprefjp/fixm:1 | `map::insert` : `P&&`と`value_type&&`は両方存在するのでオーバーロード番号を分け、概要文章を追加 | +| [21d60b4](https://github.com/cpprefjp/site/commit/21d60b4cf25bad0eeb02c8fc48169f6aca8a8b08) | cpprefjp/fixm:1 | `map::insert_or_assign` : オーバーロードの概要文章を追加 | +| [176e5a6](https://github.com/cpprefjp/site/commit/176e5a6c507f0297020a9ce423ff3fe6f78827f3) | cpprefjp/fixm:3 | `map::lower_bound`, `upper_bound`, `equal_range` : オーバーロード概要とリンクを整理 | +| [209d36b](https://github.com/cpprefjp/site/commit/209d36b8491f92ecfde0a8ef69fbed90c840e937) | cpprefjp/fixm:1 | スポンサー更新 | +| [a2837c4](https://github.com/cpprefjp/site/commit/a2837c4112998a57257d08838c7e4412876c5826) | cpprefjp/link:1 | `is_constant_evaluated` : C++23 `if consteval`へのリンクを追加 | +| [42414ad](https://github.com/cpprefjp/site/commit/42414ad076addfa1b2a17d0e398a0351564de153) | tool/improves:1 | NGワードにgreator (greaterのtypo) を追加 | +| [1cededd](https://github.com/cpprefjp/site/commit/1cededd37b7dd98fca189186a275eefa2a985e50) | cpprefjp/link:1 | `error_condition` : `HRESULT`の解説ページをarchiveに差し替え | +| [92b8e34](https://github.com/cpprefjp/site/commit/92b8e34df0b16f484f679c267a2557de0b55b85c) | cpprefjp/fixm:1 | Clang : C++26のオプションを記載 | +| [ef3c242](https://github.com/cpprefjp/site/commit/ef3c242bd0a2f3794e8903dd6e7d40c953f9e492) | cpprefjp/fixm:1 | Clang : c++23オプションを追加 | +| [8e71d07](https://github.com/cpprefjp/site/commit/8e71d07c591b70c86e2687b1e6522c4d6965773d) | tool/improves:1 | NGワードチェック : `std::range::` → `std::ranges::` を追加 | +| [7e78a7d](https://github.com/cpprefjp/site/commit/7e78a7d13f1c32def0d08a23db6404a8d19b48e1) | cpprefjp/fixl:1 | 国際標準規格 : C++26を追加 | +| [13b0cf9](https://github.com/cpprefjp/site/commit/13b0cf9df87de6e5f426f9f689d72aace5046a38), [7ae71bb](https://github.com/cpprefjp/site/commit/7ae71bb8a7e87f2373c9950a66d727a5675d841f), [db656f4](https://github.com/cpprefjp/site/commit/db656f46efdf12f6877e27170eadc50e18be3c31) | cpprefjp/fixl:1 | C++26 : 言語機能を追加 | +| [bd9f4a4](https://github.com/cpprefjp/site/commit/bd9f4a42d0497ec4d0348017e7740b5daecae870) | cpprefjp/fixm:1 | トップページ : 問い合わせ窓口のGoogle Groupと銀行振込について記載 | +| [5ad48c7](https://github.com/cpprefjp/site/commit/5ad48c7f23557d030b8b9e88439b74c41611bd80) | cpprefjp/fixl:1 | コンパイラの実装状況 : C++26を追加 | +| [bf03828](https://github.com/cpprefjp/site/commit/bf038286f8ff72920a7765766c3cc74740d86588) | cpprefjp/fixm:1 | `any` : クラスページに型の要件を記載 | +| [1300401](https://github.com/cpprefjp/site/commit/13004010008e80b9e91f3584b0e14614096036c1) | cpprefjp/fixm:2 | `multiset`, `multimap`の`erase` : 同じキーを持つ要素数を計算量に入れた | +| [4f5d507](https://github.com/cpprefjp/site/commit/4f5d507d4e9830fee411f6f621b25ba1fc70cdb3) | cpprefjp/fixm:1 | `from_range_t` : 所属ヘッダが間違っていた | +| [d73d6be](https://github.com/cpprefjp/site/commit/d73d6be0b8b2381f19ce1ae66b0ae531fd77edca), [1b2e850](https://github.com/cpprefjp/site/commit/1b2e850c3d3eab21e2aeb35bc54f7708a7ef3ffe) | tool/addm:2, cpprefjp/fixm:1 | 所属ヘッダの指定ミスを検出するCIタスクを追加 | +| [f5119ae](https://github.com/cpprefjp/site/commit/f5119aed607afe31d105286502ccfce060a13e4a) | cpprefjp/fixl:1 | 国際標準規格 : Working Draftを更新 | +| [8d43599](https://github.com/cpprefjp/site/commit/8d4359938373b6a481ddeb171825ec0127682158) | | 貢献ポイントと分配方法についてまとめた | +| [3b8a415](https://github.com/cpprefjp/site/commit/3b8a4156369a6cb647a2c3fe17fee4d7a2e06332) | | 貢献ポイント : Open Collectiveでの経費申請の仕方を記載 | +| [da9fc6a](https://github.com/cpprefjp/site/commit/da9fc6ae8541971d8adc926c20f51b9e1b0b284b) | | 貢献ポイント : マージされずクローズされたPR、マージされずオープンなままのPRについて記載 | +| [4dfdb3a](https://github.com/cpprefjp/site/commit/4dfdb3a577c6cfa2c9b7c43839366712329bb910), [3104eb3](https://github.com/cpprefjp/site/commit/3104eb39826b9c90875dc20d2cef6c7b740c6dc5), [7326dd7](https://github.com/cpprefjp/site/commit/7326dd761e713c932f0305362d68613be3340927), [2ef44e2](https://github.com/cpprefjp/site/commit/2ef44e29a79b6c542a3b6754448f6402ae4c7cd4), [8cb09b8](https://github.com/cpprefjp/site/commit/8cb09b84f248a585697f837c9b5ff0609b785f20), [11b8c7e](https://github.com/cpprefjp/site/commit/11b8c7e10869d33b4464e73bdd5804ab70fcc9e8) | cpprefjp/fixm:1 | index : 時雨堂さまのロゴとリンクを掲載 | +| [cefc9fa](https://github.com/cpprefjp/site/commit/cefc9fa40e2d3fdd850fb2feffbf02cdb53b890f), [2c6589b](https://github.com/boostjp/site/commit/2c6589b1ff15d330b6027f4b3ea686002c97ba7b) | tool/fixbug:2 | buildアクション : Pythonを3.11に固定 (3.12でエラーがでた) | +| [6345a65](https://github.com/cpprefjp/site_generator/commit/6345a65aa1f15af1da6442509953a204b781125c) | tool/improvem:1 | Google Analytics GA4を設定 | +| [9b8dc0d](https://github.com/cpprefjp/kunai_config/commit/9b8dc0d6cc1a42edd7a819bd9f7af4ab5e006014), [91b3abb](https://github.com/cpprefjp/kunai_config/commit/91b3abb7cd35b79c140f1c3202ce150a6d56fcbc), [b375504](https://github.com/cpprefjp/kunai/commit/b375504f32f02eab6b14908435446f988f680055) | tool/improvem:1 | 編集者向け資料をリネーム | +| [9b1cdc2](https://github.com/cpprefjp/kunai_config/commit/9b1cdc2b2e7828e5e0bf46f6092917f1955e7315), [863b2d6](https://github.com/cpprefjp/kunai/commit/863b2d65fad1e754aff403bdb5e6b2701d807eeb), [bdccb2d](https://github.com/cpprefjp/kunai/commit/bdccb2d78751e71d97260f0d63a7d506bb85375f) | tool/adds:1 | 編集方針を追加 | +| [b7b8513](https://github.com/cpprefjp/kunai/commit/b7b85133a519e0f595701fa32e07f34155270b86) | tool/improves:1 | 画像の最大幅を設定 | +| [b206bad](https://github.com/cpprefjp/kunai/commit/b206badf8c9324ad381bf7809870a39a3052fbe5) | tool/improves:1 | codeタグ中の末尾スペースが消えてしまっていた問題を修正 | +| [368ecfc](https://github.com/boostjp/site/commit/368ecfc3cdbfea89419afc4349eb2632c78959f6), [075dd40](https://github.com/boostjp/site/commit/075dd4033e19289d15efa1fd8443247bcb910df7), [aa9e52b](https://github.com/boostjp/site/commit/aa9e52b68b1ff53cdaef9f1af0313874db953d6e), [c8d6259](https://github.com/boostjp/site/commit/c8d6259622539c4d8f662cfd15ee06b3abc2cdfb), [5d2c514](https://github.com/boostjp/site/commit/5d2c51488b95dc9e9752d85cd92c9912ef06e29c), [d813d6a](https://github.com/boostjp/site/commit/d813d6a315f149d2887ea842bb53604460fe8809) | boostjp/releasel:8, boostjp/releasem:19, boostjp/releases:1, boostjp/link:1 | 1.82.0リリースノート | +| [0bb4c21](https://github.com/boostjp/site/commit/0bb4c21338d28e2128d31aceca8b72597796d3c8), [34205bb](https://github.com/boostjp/site/commit/34205bb35cb0dc5c7e102c2aabfcaf8ef74ec92b), [403bc7b](https://github.com/boostjp/site/commit/403bc7b71df825a1fe8dff8795af3fd8d8876939), [cd1c5f8](https://github.com/boostjp/site/commit/cd1c5f8af25a2930ad82a1f083edbc072d4a26d9) | boostjp/releasel:4, boostjp/releasem:25, boostjp/releases:1, boostjp/link:1 | 1.83.0リリースノート | +| [bf70875](https://github.com/cpprefjp/site/commit/bf7087596d7f1334739ba264246d1b48baa184ae) | | 貢献ポイント : 集計中に必要となった貢献ポイントの項目を追加 | +| [f67a9f4](https://github.com/cpprefjp/site/commit/f67a9f4eb93b58343def06bba1dea17fd92a88cd) | | 2023年1月分の貢献ポイントをまとめた | +| [d9fb324](https://github.com/cpprefjp/site/commit/d9fb324b3d8c92c892f455b3901476c0d12a6de0) | | 貢献ポイント: Boostへの貢献は追跡しきれないのでやめた | +| [cc884d3](https://github.com/cpprefjp/site/commit/cc884d396da7dbcbc3da81e5eb72d5aa07319702) | | 貢献ポイント2023: 不正なタグを修正 | +| [4e048eb](https://github.com/cpprefjp/site/commit/4e048eb4e84314b1bbf25dc24834ded95bbe0e1c) | | 貢献ポイント : 2023/02のコントリビュートをまとめた | +| [0ceca8e](https://github.com/cpprefjp/site/commit/0ceca8ec9cd6c4f940efdc1da5899e65ae1769e2) | | 貢献ポイント : コンパイラ動作確認を言語機能とライブラリ機能で集計方法を分けた | +| [3faf5c1](https://github.com/cpprefjp/site/commit/3faf5c1a5046050bbdb3d981aadf1973afb4d4c1) | | 貢献ポイント : 2023/03のコントリビュートをまとめた | +| [7215f9e](https://github.com/cpprefjp/site/commit/7215f9ead299ef527fbb0c46da0adac3ecd8c71a) | | 貢献ポイント : 2023/04のコントリビュートを追加 | +| [e5991d8](https://github.com/cpprefjp/site/commit/e5991d81a6559beeaae08b186eb53342b68da699) | | NGワードチェック : 編集者向けドキュメントは対象外にした | +| [192494c](https://github.com/cpprefjp/site/commit/192494cb43d76c61eb31c84f0dec6b8d44e7f134) | | 貢献ポイント : 2023/05のコントリビュートを追加 | +| [cbed1c0](https://github.com/cpprefjp/site/commit/cbed1c090d88c47a37c504acfe0586ecfa0a57fb) | | 貢献ポイント : 2023/06のコントリビュートを追加 | +| [e3bd67b](https://github.com/cpprefjp/site/commit/e3bd67b0ecfa59e386f273eb5864025ec3270d76) | | 貢献ポイント: 2023/07のコントリビュートを追加 | +| [065f221](https://github.com/cpprefjp/site/commit/065f221b742620cdcb6db011deb401004c2896f9) | | 貢献ポイント : 集計作業を除外 | +| [94f157b](https://github.com/cpprefjp/site/commit/94f157bb931d012571810d9131ae086d4019301a) | | 貢献ポイント : 2023/08のコントリビュートを追加 | +| [142e7b6](https://github.com/cpprefjp/site/commit/142e7b6c519d541d0a028d68a09b691872aa7725) | | 貢献ポイント : 2023/09のコントリビュートを追加 | +| [d7ebe95](https://github.com/cpprefjp/site/commit/d7ebe95214a3ad01c4911770f970b4099cc25c4c) | | 貢献ポイント : 2023/10のコントリビュートを追加 | +| [217669c](https://github.com/cpprefjp/site/commit/217669cf06e0ac6b4e4bc3058cf3871da48d7630) | cpprefjp/fixl:4 | `unordered_map` / `set`の`erase` : `erase(iterator)`のオーバーロードを追加 | +| [bfc992c](https://github.com/cpprefjp/site/commit/bfc992c17fd341827ea3a1842c2ee193ad60f608) | | 貢献ポイント : cpprefjp/site以外のコミットを追加 | +| [f9a0fdd](https://github.com/cpprefjp/site/commit/f9a0fdd70a42ec9b262b93cc8796d9e5f1b802b0) | tool/improves:1, cpprefjp/typo:2 | NGワードチェック : "型](link)型"をNGワードに登録 | +| [118d5b9](https://github.com/cpprefjp/site/commit/118d5b9ebee27d1a04c52bf9c0bfdadd7f940b37) | tool/improves:1, cpprefjp/typo:1 | tuple/apply : Gitのコンフリクトコメントを削除 | +| [cc748a6](https://github.com/cpprefjp/site/commit/cc748a66a57065cd020e019f780845390e3026f8) | cpprefjp/fixm:1 | スポンサー更新 | +| [2c21229](https://github.com/cpprefjp/site/commit/2c212294315aec84f90a1540a7a39ae621c5c073) | cpprefjp/fixs:1 | `ios_base` : コード修飾を追加 | +| [e30c3ae](https://github.com/cpprefjp/site/commit/e30c3ae988aed71a6df562fd71062079949a1d4e) | cpprefjp/fixl:1 | `ios_base::openmode` : C++23対応として`noreplace`フラグを追加 | +| [d408c51](https://github.com/cpprefjp/site/commit/d408c51c96e78e8af3ab4accc880fee05791d87d) | cpprefjp/fixm:1 | トップページ : シルバースポンサー以上はissueに採用情報を投稿できる特典を追加 | +| [b17670d](https://github.com/cpprefjp/site/commit/b17670dea79e6d26f1caa2f5c0252f9a8621439f) | cpprefjp/fixm:2 | `ostream`の`print`と`println` : `cerr`とかは`iostream`で定義される | +| [e6d487c](https://github.com/cpprefjp/site/commit/e6d487c105ddd04d243c2932832bede7fe66d1cc) | cpprefjp/typo:1 | `print`/`vprint_unicode` : ですます調になっていたところを修正 | +| [519f8a7](https://github.com/cpprefjp/site/commit/519f8a74927665b47e085f2cda66522126058cb7) | cpprefjp/link:2 | `to_chars` / `from_chars` : コード修飾を追加 | +| [d7ec01f](https://github.com/boostjp/site/commit/d7ec01ffb8f080b9143f16c06a4ee437d4e91a46), [5153ad7](https://github.com/boostjp/site/commit/5153ad74e84dc6ddd921fd13fcef5acdb731fce6), [e9ebe52](https://github.com/boostjp/site/commit/e9ebe52d33bb0a8fca76ec53cb62950d4b7ef21c) | boostjp/releases:13, boostjp/releasem:24, boostjp/releasel:2, boostjp/link:1 | 1.84.0 : リリースノートを追加 | +| [4df3220](https://github.com/cpprefjp/site/commit/4df32209e7f4396c02262c96a7ab94d9c8246c18) | | 貢献ポイント : ユーザー名をリンクにした | + + +## [wx257osn2](https://github.com/wx257osn2) + +| コミット | タグ | 説明 | +|----------|------|------| +| [79d9ed9](https://github.com/cpprefjp/site/commit/79d9ed994302be52e299f635374106d1c5264c5c), [bbf5105](https://github.com/cpprefjp/site/commit/bbf5105d7652cc174b8c8c83f036189edbc5d49e) | cpprefjp/fixl:1 | 関数引数や戻り値型として非const参照が使えるようになったことを明示 | +| [31cfbe3](https://github.com/cpprefjp/site/commit/31cfbe34477f3b76e31ee79d312f2808f6dbdee6) | cpprefjp/fixl:1 | Defect report LWG 2901 removed allocator support of variant | +| [6061559](https://github.com/cpprefjp/site/commit/6061559e89e9315c95a53f90cf0cea0fe891e7ae) | cpprefjp/fixl:5 | P2231R1: some functions will be constexpr in C++23 | +| [e9732e7](https://github.com/cpprefjp/site/commit/e9732e7665c761ffe36e50e41982d79677b72376), [c398ce7](https://github.com/cpprefjp/site/commit/c398ce768a935757dceefcc478d0816baa59cab4) | cpprefjp/fixm:1 | 表現をよりわかりやすく | +| [e3233e7](https://github.com/cpprefjp/site/commit/e3233e7dbb6729db10d737119c4a480238d0ae5f) | cpprefjp/fixm:1 | fix invalid name hiding | +| [1d666c6](https://github.com/cpprefjp/site/commit/1d666c610ffc9418a8f2b397b11e613ccfa6ca84) | cpprefjp/fixm:1 | fix missing variable name | +| [e92dbda](https://github.com/cpprefjp/site/commit/e92dbda8d6943d59800e65802678279cbec5ee7d), [c0e6060](https://github.com/cpprefjp/site/commit/c0e60600cf7f49f89512999e5cf3aa13dcff1747) | cpprefjp/fixs:3 | add link | +| [663009e](https://github.com/cpprefjp/site/commit/663009edf7ef89aacce6d49fdbe7f71cd9705ab1) | cpprefjp/typo:1 | remove # | +| [5281313](https://github.com/cpprefjp/site/commit/528131302fef3ee398244e5900cca0498df28064) | cpprefjp/typo:1 | fix title(prev -> next) | +| [1117ef2](https://github.com/cpprefjp/site/commit/1117ef22bd6ecdc03a66d7831f77ac7f551ea580) | cpprefjp/typo:1 | fix typo | +| [8a693a4](https://github.com/cpprefjp/kunai/commit/8a693a4dafa4ade9ea143d56bb9d83daa7696c74) | tool/improves:1 | Fix font size of `` on headers | +| [e4d608c](https://github.com/cpprefjp/kunai/commit/e4d608c11981d724a9456323d2dabd1c153ae253) | tool/improves:1 | make padding 90% | + + +## [suomesta](https://github.com/suomesta) + +| コミット | タグ | 説明 | +|----------|------|------| +| [5df0bc4](https://github.com/cpprefjp/site/commit/5df0bc418e92e87d9450b1137168865a0c4c2589) | cpprefjp/fixm:1 | add result of sample | +| [59b8773](https://github.com/cpprefjp/site/commit/59b877334be838338599f1faf067686365e5e643) | cpprefjp/fixm:2 | fix that notes on correct place | +| [6f00655](https://github.com/cpprefjp/site/commit/6f006553cc2a92f9293a75abe9bd887b175acf0c) | cpprefjp/compiler:2, cpprefjp/link:1 | fix some typo in ranges sample | +| [b852507](https://github.com/cpprefjp/site/commit/b8525072e38f2979a23b1ba259719a937b0e7e0d) | cpprefjp/fixs:1 | remove unnecessaly characters | +| [3e88af5](https://github.com/cpprefjp/site/commit/3e88af561b8b1f5803fbf49d43ea6e188fd1eb4c) | cpprefjp/compiler:3 | fix again samples of `std::set` | +| [283ec8d](https://github.com/cpprefjp/site/commit/283ec8d963da7202ba54e1f14abdb66b1a0a34f3) | cpprefjp/fixm:6 | fix some versioning | +| [e4e068d](https://github.com/cpprefjp/site/commit/e4e068d317be054bde4480e0dafa521104707c14) | cpprefjp/fixm:1 | fix noexcept description in `std::string` | +| [f9f1c46](https://github.com/cpprefjp/site/commit/f9f1c46d5b971891ef2779d943543493e7d49b4a) | cpprefjp/link:4 | fix some typo | +| [9019107](https://github.com/cpprefjp/site/commit/901910765b0e8046402e73880aeb25a1d0755a5b) | cpprefjp/link:3 | remove relation item linking to own page | +| [9365d56](https://github.com/cpprefjp/site/commit/9365d56a456376b0f98c7d54af3391da78412617) | cpprefjp/link:11 | remove link to own page | +| [f09cd87](https://github.com/cpprefjp/site/commit/f09cd879a500c63e43eb84f00f7f4704652c9efa) | cpprefjp/link:16 | fix to correct link | +| [5e61ff5](https://github.com/cpprefjp/site/commit/5e61ff5c823cc319809c329792c646f2744e85e1) | cpprefjp/link:1 | set link and remove link to own page | +| [ab42c56](https://github.com/cpprefjp/site/commit/ab42c56c60f7caf7c809277e1b204427eb790376) | cpprefjp/link:3 | arrange relations in ranges::next/prev/advance | +| [a980ba7](https://github.com/cpprefjp/site/commit/a980ba7040481aaedeb09ba2086e2be7e421d58f) | cpprefjp/fixm:12 | change meta-id function to template function | +| [87ffbf8](https://github.com/cpprefjp/site/commit/87ffbf8063ce4c4e9204ca50530112ac0a939b19) | cpprefjp/fixm:17 | remove unnecessary include in samples | +| [24061d7](https://github.com/cpprefjp/site/commit/24061d75bba42c3b7e2f7175db090c7e1ec31e6b) | cpprefjp/fixm:1 | fix wrong type in a sample | +| [0dee2f1](https://github.com/cpprefjp/site/commit/0dee2f1c26e7ffcdac6217e51c420d3b1b45bbb2) | cpprefjp/typo:19 | fix typo | +| [d83c6a4](https://github.com/cpprefjp/site/commit/d83c6a4dbf2faf6b49a7de4a6b24e77b68cf4edb) | cpprefjp/link:1 | fix link error | +| [7341bb7](https://github.com/cpprefjp/site/commit/7341bb7e271c2e73f7a428f3371122cfacf11caf) | cpprefjp/link:1 | add link | +| [2311413](https://github.com/cpprefjp/site/commit/2311413d25e3c2224c996bfb59f5f656d1762abd) | cpprefjp/typo:3 | fix typo | +| [4c95521](https://github.com/cpprefjp/site/commit/4c95521670ac88129ccb470c6180a2dec4508d53) | cpprefjp/fixm:3 | fix some minor faults | +| [ba5a5a9](https://github.com/cpprefjp/site/commit/ba5a5a9392ad379ac413fc0336991838cdf89a3a) | cpprefjp/fixm:11 | some small improvements in samples | +| [d2d48f0](https://github.com/cpprefjp/site/commit/d2d48f0a58488d30bfb62833363b35821459adfc) | cpprefjp/fixm:7 | fix meta-id from function to function template | +| [d172c77](https://github.com/cpprefjp/site/commit/d172c772fb408750a5d91b48693e602df6cbf579) | cpprefjp/fixm:13 | fix std version numbers | +| [46a08ba](https://github.com/cpprefjp/site/commit/46a08baefd09238f70612716fbb23e1197d8fdf4) | cpprefjp/fixl:35 | add C++03 version | +| [1174ad4](https://github.com/cpprefjp/site/commit/1174ad40b2b765d3d2c1d8e76f6b1dee624ce2be) | cpprefjp/fixs:3 | small improvemenmts in samples | +| [0ee0833](https://github.com/cpprefjp/site/commit/0ee0833cda17c6b8510840c3f41cc0691cf6212b) | cpprefjp/fixs:5 | fix some typo regarding `std::string` | +| [3f57b63](https://github.com/cpprefjp/site/commit/3f57b6362da6d563cc732cc0155939599ba43bab) | cpprefjp/fixm:3 | improve some examples | +| [de4b233](https://github.com/cpprefjp/site/commit/de4b233c1adaaabaa2a35c4e3005828b50cef34b) | cpprefjp/fixm:1, cpprefjp/fixs:2 | fix some typo | +| [11b32f7](https://github.com/cpprefjp/site/commit/11b32f7cbe871fe4970b66171344d19c831f1b7b) | cpprefjp/fixm:2, cpprefjp/typo:1 | fix some typo | +| [0622e39](https://github.com/cpprefjp/site/commit/0622e399e01a52b5e8524319d5a1c457e3e0e5f9) | cpprefjp/fixm:6 | fix some expression | +| [1bf71dc](https://github.com/cpprefjp/site/commit/1bf71dc803d140329e3690f6abaa004bb21b9c97) | cpprefjp/compiler:2, cpprefjp/fixs:1 | update information about `charconv` | +| [407947b](https://github.com/cpprefjp/site/commit/407947b424bc1f4f868a938453cb8c2eee2c0ab4) | cpprefjp/fixm:6, cpprefjp/typo:5 | fix some typo | +| [8a944b1](https://github.com/cpprefjp/site/commit/8a944b14616ef124fb61c5793c581789b2d58768) | cpprefjp/fixm:4, cpprefjp/fixs:2, cpprefjp/typo:1 | fix a sample of atomic. | + + +## [k-satoda](https://github.com/k-satoda) + +| コミット | タグ | 説明 | +|----------|------|------| +| [533c542](https://github.com/cpprefjp/site/commit/533c54260230bc66ece67eda846b3412bdd38ee7) | cpprefjp/fixm:1 | `NULL`: C++03 の規定について実際の規格と合致しない記述を修正 | + + +## [onihusube](https://github.com/onihusube) + +| コミット | タグ | 説明 | +|----------|------|------| +| [df12b1d](https://github.com/cpprefjp/site/commit/df12b1d5f5725ef7c6ee40a770de935c3450af1c) | cpprefjp/fixs:1 | リンク修正 | +| [fb89d60](https://github.com/cpprefjp/site/commit/fb89d60dad2209edb09d59b161cd7e56b4f8e2a9), [bc12e24](https://github.com/cpprefjp/site/commit/bc12e242a85559d837c3e115ad7d74f16589f530), [f86e382](https://github.com/cpprefjp/site/commit/f86e3825c89e743aedfdd3d66a1850cbd74d63f2), [5e7e22e](https://github.com/cpprefjp/site/commit/5e7e22e36add8468caa85af0a3c18a7a443a5e1b), [84f996b](https://github.com/cpprefjp/site/commit/84f996ba10e58682f9cb49fa77382f745e3b71a9) | cpprefjp/addlang:1, cpprefjp/addref:1, cpprefjp/link:4 | 可変長データを扱うクラスの効率的な`delete` | +| [3a5b2dc](https://github.com/cpprefjp/site/commit/3a5b2dc12d79e256423a3b90bb35533e103ec671) | cpprefjp/fixm:1 | `operator delete[]` : 番号の調整 | +| [0f9f475](https://github.com/cpprefjp/site/commit/0f9f47544b06f157c39972ad9e2f7d28e274a304) | cpprefjp/fixs:2 | `operator delete` : 一覧の整理 | +| [14f1a2e](https://github.com/cpprefjp/site/commit/14f1a2ea622be0674ca9d977cb02d08d951ee03d) | cpprefjp/fixm:1 | `` : 説明を修正 | +| [549b24e](https://github.com/cpprefjp/site/commit/549b24e254087fe066ec04c189647a895df995f0) | cpprefjp/fixm:1 | `format` : 表の修正 | +| [3fd8e81](https://github.com/cpprefjp/site/commit/3fd8e81e2945ef1acf4bb9b0cd348214e4ffff61) | cpprefjp/fixm:1 | `format` : デバッグ出力例を修正 | +| [6e6d1c5](https://github.com/cpprefjp/site/commit/6e6d1c530a1e90c052394a44d9e1e4a64a6c419b) | cpprefjp/fixm:1 | `move_only_funciton` : `std::function`との違いについて追記 | +| [991f1ac](https://github.com/cpprefjp/site/commit/991f1aca8f13b5d922ae94a2c51cdf043591c870) | cpprefjp/fixm:6 | 整数型比較関数の説明と例の改善 | +| [44ce242](https://github.com/cpprefjp/site/commit/44ce2423fe44bad90a3937cc11b6be83e14fcfac) | cpprefjp/fixm:1 | `to_address` : イテレータからポインタへの変換例の追加 | +| [318a70e](https://github.com/cpprefjp/site/commit/318a70e4d2307d898ab08bd12c9f40258aa0a004), [ebf409b](https://github.com/cpprefjp/site/commit/ebf409bfcb1665f5256addfed394b0b3221817e4) | cpprefjp/fixm:1 | `from_chars` : `to_address`を使用する例を追加 | +| [6a05dbb](https://github.com/cpprefjp/site/commit/6a05dbbaea2d5e7472bd2ff832b2d36fcf520780), [d6efda1](https://github.com/cpprefjp/site/commit/d6efda15a80acb4f8c394c4ea3d970d80a4d2192) | cpprefjp/fixm:1 | `take_view` : bidirectional以下の入力に対する注意を追記 | +| [88c08cc](https://github.com/cpprefjp/site/commit/88c08cc878fdca30b520859de47d8367e91b0e35), [79d7e85](https://github.com/cpprefjp/site/commit/79d7e8577c8b851c97bb295ff6270a8b8f491970), [cf2f9ac](https://github.com/cpprefjp/site/commit/cf2f9aca8e91c46b6f5c05b6152d5533279b356a), [9755c4c](https://github.com/cpprefjp/site/commit/9755c4c685f21f8cfb47980a23f619306afdcbff), [04deaac](https://github.com/cpprefjp/site/commit/04deaac7dfd476246698e5046dffb52e63625c51), [4818ff7](https://github.com/cpprefjp/site/commit/4818ff7a040a83267ebc5ee506299e44ea6195a3), [16e1d97](https://github.com/cpprefjp/site/commit/16e1d9768ef71370827c7cdb4a2a6c7d338d4914), [1c743fb](https://github.com/cpprefjp/site/commit/1c743fb17397e72155bcdc8c3f60f431add22fce), [f81c873](https://github.com/cpprefjp/site/commit/f81c873437dd6933e6a0668ba1b3959051b865b1), [629ccda](https://github.com/cpprefjp/site/commit/629ccda92610146d4e330c73f6cc44cb1977330c) | cpprefjp/addlang:1, cpprefjp/link:1 | 未初期化領域への暗黙的なオブジェクト構築 | +| [7137aae](https://github.com/cpprefjp/site/commit/7137aae806b98ff357fea841b251e65c653255c5) | cpprefjp/fixl:1 | `errc` : LWG Issue 3869対応 | +| [cde470d](https://github.com/cpprefjp/site/commit/cde470d65c8f4cf33adf6a28b5d621b851d42ed0), [0216351](https://github.com/cpprefjp/site/commit/0216351917fda4cb7f2cf6ddec4ad04e9a962c77) | cpprefjp/fixl:1 | `string_view`コンストラクタ : P2499R0対応 | +| [ceb8175](https://github.com/cpprefjp/site/commit/ceb817552e5037e8511165cd17271d2a86b468ca) | cpprefjp/fixl:1 | `string_view` コンストラクタ : LWG Issue 3857対応 | +| [fd8b500](https://github.com/cpprefjp/site/commit/fd8b500a0632722667b1db10070fea4ab2771ec2) | cpprefjp/fixs:1 | `unordered_map::insert_or_assign()` : 微修正 | +| [363b738](https://github.com/cpprefjp/site/commit/363b7385c4de72f884beb642a6bf79279a8a7a04) | cpprefjp/fixm:1 | `split_view` : 説明の改善 | +| [ef831a1](https://github.com/cpprefjp/site/commit/ef831a1bc7916fef42e7d21cc5ecc7a90249d9db) | cpprefjp/fixm:1 | `pair` : piecewise constructionの説明を改善 | +| [bbf0c78](https://github.com/cpprefjp/site/commit/bbf0c78e4950b3cec5fba5986840fcd0064a38da), [abc2598](https://github.com/cpprefjp/site/commit/abc25987eceb7bfea7f0dee74dd39a6239e074b3) | cpprefjp/fixl:1 | `pair`コンストラクタ : `explicit`/`delete`条件の整理 | +| [b240dfd](https://github.com/cpprefjp/site/commit/b240dfdc804d6675c712e38bad9e666d79964225) | cpprefjp/typo:1 | `type_info::operator!=` : `=`が変だったのを修正 | +| [5eaa8ee](https://github.com/cpprefjp/site/commit/5eaa8eebe4f6275b47229ed76bfb655ae73896a6) | cpprefjp/typo:1 | `basic_string::append` : コメントアウトが外れていたのを修正 | +| [3744030](https://github.com/cpprefjp/site/commit/37440305b5e204f34741e3edb9719a7b852bf4f9) | cpprefjp/fixm:1 | `noexcept` : 指定可能な位置について追記 | +| [45cd04b](https://github.com/cpprefjp/site/commit/45cd04b0f7f0abbdb7cfbc314a9354f0bf85b154) | cpprefjp/fixm:1 | `launder()`が必要になる場合の解決コードを削除 | +| [2e52939](https://github.com/cpprefjp/site/commit/2e52939f7e606be73a4e5fdb0fb5689eef9f2c68), [13db5df](https://github.com/cpprefjp/site/commit/13db5df18b405032ace43e3738009cda0f18bfe0), [afc7241](https://github.com/cpprefjp/site/commit/afc7241e8a6dd56adef175e6b1174aa743c93f87) | cpprefjp/fixl:1 | P23227R0とCWG2654について追記 | +| [5e2017d](https://github.com/cpprefjp/site/commit/5e2017d1eb229b78d1ae16d99c4afef381682a58) | cpprefjp/typo:1 | コルーチン : pvalue -> prvalue | +| [90927bc](https://github.com/cpprefjp/site/commit/90927bc3454740d33a8e2933e23ebbc8f3d96ea5) | cpprefjp/fixl:12 | P0718R2の`shared_ptr`のアトミックフリー関数非推奨を適用 | +| [c46ebf4](https://github.com/cpprefjp/site/commit/c46ebf4afd42816c9a9f10d04d668e336cfea25e) | cpprefjp/fixm:1 | `offsetof` : メタ情報の修正 | +| [adf4a90](https://github.com/cpprefjp/site/commit/adf4a90966818e7f3130e2dab70cd63b00d78fd8), [04340ca](https://github.com/cpprefjp/site/commit/04340ca0d5503fcdb9c5c1ec03ac636445f03153) | cpprefjp/addref:4, cpprefjp/fixl:1 | `span` : P2278R4対応 | +| [7d3e69f](https://github.com/cpprefjp/site/commit/7d3e69fd917cb09749aea3855289913420ca5011) | cpprefjp/fixm:1 | 処理型 : VC++バージョン表記リストのアップデート | +| [79605e8](https://github.com/cpprefjp/site/commit/79605e8277108c0de0d0ecf223945a518ad32127), [069e857](https://github.com/cpprefjp/site/commit/069e8574e5043f53c1c8e64faa7d54969e5e7c5f), [ec63307](https://github.com/cpprefjp/site/commit/ec6330712a56da138e4b977ca03476a72fa80801), [fb63802](https://github.com/cpprefjp/site/commit/fb63802526c3daea90356da72e0ed67a8dd05f22), [e19c878](https://github.com/cpprefjp/site/commit/e19c878e156ca64ea7a5b4a4c703f8c79c494bde), [4a6b82e](https://github.com/cpprefjp/site/commit/4a6b82e1fbbf4c8e10b8fe5ed613585ed09ec201), [92d8962](https://github.com/cpprefjp/site/commit/92d89626f7c03750772c8d97b61a28e19a0a73d9), [ea6381e](https://github.com/cpprefjp/site/commit/ea6381e681e5e706f23d38d721cfbfc361003d24), [4e2bdcd](https://github.com/cpprefjp/site/commit/4e2bdcd9d523a6f4c59fd4bdb762e19da36c8cc0), [b2a86cc](https://github.com/cpprefjp/site/commit/b2a86ccbe173e1fbd007d9d0ea07652815f60961), [09c1ad7](https://github.com/cpprefjp/site/commit/09c1ad78bd5be675d94afdc1e49adcaa6ff7ca4d), [c925d35](https://github.com/cpprefjp/site/commit/c925d357c6d192dd1edca8e41f620f33c4a336aa), [3f6f9ce](https://github.com/cpprefjp/site/commit/3f6f9ce56b42ae4ea17dca2ad62f354b38fda974), [02ed11e](https://github.com/cpprefjp/site/commit/02ed11ec6d51486dd32ddc338107c5e383d474ee), [396b2b6](https://github.com/cpprefjp/site/commit/396b2b645a53a32c47038621eb6a4b3042374c45), [e9f6f76](https://github.com/cpprefjp/site/commit/e9f6f76c141d8763627e59d0d59702b45619e55c), [ebae6b7](https://github.com/cpprefjp/site/commit/ebae6b70f005143b4edd3d6003270bf4c2f2328a), [a16938b](https://github.com/cpprefjp/site/commit/a16938b2890659af7e9b366593229419685da7bb), [f2f8993](https://github.com/cpprefjp/site/commit/f2f8993721e5d0bba28ed266f52008a72fe6c862), [00bb047](https://github.com/cpprefjp/site/commit/00bb047d8c8ba716b8df149d4d48e9d8c5719c87), [dbc5cfe](https://github.com/cpprefjp/site/commit/dbc5cfe81d457f717ed99511f72b79d01058a533), [cd41744](https://github.com/cpprefjp/site/commit/cd417442096e21404c93b495684928e7c723f387), [7fc8707](https://github.com/cpprefjp/site/commit/7fc8707529d50ce7434a3e2c012fb8835619360c), [d66df9c](https://github.com/cpprefjp/site/commit/d66df9c2b327ff15e7692c432cdd3f61fb02bed8), [21a2be5](https://github.com/cpprefjp/site/commit/21a2be5d6f6cb36c66283404efb5cd27bd370573) | cpprefjp/addref:24, cpprefjp/fixl:2, cpprefjp/link:5 | `` : P2278R4の機能を追加 | +| [cde8479](https://github.com/cpprefjp/site/commit/cde8479f21e88562f1dc764fa15b1875de5a0232), [4739795](https://github.com/cpprefjp/site/commit/47397958eb92ad9e374f3e5386eca6102d387b45) | cpprefjp/addref:1, cpprefjp/link:1 | `iter_const_reference_t`追加 | +| [e0d67ff](https://github.com/cpprefjp/site/commit/e0d67ff886c95bf2444c6a33d4556735b2ab2faf) | cpprefjp/fixm:2 | `ostringstream`の`str()` 修飾の修正 | +| [5539a02](https://github.com/cpprefjp/site/commit/5539a0217b51ce272b48b1514c7631256927cac0) | cpprefjp/fixl:5 | P2418R2対応 : 関数のインターフェースと事前条件の部分の変更のみ適用 | +| [5ba1413](https://github.com/cpprefjp/site/commit/5ba1413f2dd58d720c5e02db52e4bfd7f2e452b4) | cpprefjp/fixm:1 | `join_view` : `common_range`となる条件の追記 | +| [f2eb447](https://github.com/cpprefjp/site/commit/f2eb44725d784a0b8cb1d2f343178ffe04c392d8), [a3c830c](https://github.com/cpprefjp/site/commit/a3c830c711a9f273eb85e397f730bc40063289c8), [bf5c611](https://github.com/cpprefjp/site/commit/bf5c611427dcc7915ec8a49a6d6cdd962eadcd55), [99a88c1](https://github.com/cpprefjp/site/commit/99a88c1134be17442149de2b693a93f654af17c9), [4e3f803](https://github.com/cpprefjp/site/commit/4e3f803c205c62d5f0d09e3684e12536eaa58704), [e37ef9b](https://github.com/cpprefjp/site/commit/e37ef9b695f6bb5e02f5153a9fa4281980f60e22), [c5d0375](https://github.com/cpprefjp/site/commit/c5d0375ce0f048faf59ce7c6df22e9590de92e45), [953efe6](https://github.com/cpprefjp/site/commit/953efe6f14e067f5c4d51fa0f30e6ff175859d02), [f1b46a1](https://github.com/cpprefjp/site/commit/f1b46a11655c1b1b27faa245f5732a4fd5dd5c81), [fa4faf6](https://github.com/cpprefjp/site/commit/fa4faf6048ec000b7c7fc003ea7b810badea9fae), [0185d03](https://github.com/cpprefjp/site/commit/0185d032cb062bec39b469070735d250cacff810), [dbc7c10](https://github.com/cpprefjp/site/commit/dbc7c10006eeae7a56fd011cdb1ee476a9a4cc17), [1fff32a](https://github.com/cpprefjp/site/commit/1fff32a5344aa196ff9aee04d3115af96d5b2701), [f3e3dbf](https://github.com/cpprefjp/site/commit/f3e3dbf0e4150686401ef06fbb2ad122ac77e561), [afa4259](https://github.com/cpprefjp/site/commit/afa42590107fe0eef866c42ec23624f37ae41f21), [a14d042](https://github.com/cpprefjp/site/commit/a14d042b837ef68612abe6e74371882ba4f9e287), [595b9bb](https://github.com/cpprefjp/site/commit/595b9bb33fe0907ced03e0d5201cdce1c4da87c4), [82ef331](https://github.com/cpprefjp/site/commit/82ef3319985de924be1f0198d05ccaf0d2eb0500), [b950e12](https://github.com/cpprefjp/site/commit/b950e124456e4d4abfc26c91e53ec5c13895dc9e), [01117d7](https://github.com/cpprefjp/site/commit/01117d7bbb901725da0d53a89102f6f37df5dd3e) | cpprefjp/addref:14, cpprefjp/fixl:22 | `` : P2278R4関連を追加 | +| [d8142c9](https://github.com/cpprefjp/site/commit/d8142c96f48d70c18df8b6138b6fbc0dcb5ea867) | cpprefjp/addlang:1, cpprefjp/fixl:1 | 機能テストマクロ追加 | +| [331a036](https://github.com/cpprefjp/site/commit/331a036a791df9df02b66a054ad7f70448fb205d), [46f89bc](https://github.com/cpprefjp/site/commit/46f89bc560d8c35c13641cf89f9dd5eba2774b8a), [8974dd3](https://github.com/cpprefjp/site/commit/8974dd3325a7283cf340c5bc31c7d1e84f0f3fd2) | cpprefjp/addref:1, cpprefjp/fixl:1 | `counted_iterator` : P2259R1対応 | +| [02832a7](https://github.com/cpprefjp/site/commit/02832a7dda2b2f7dc9e56fc5cf306e8bed17e298) | cpprefjp/fixl:3, cpprefjp/link:3 | P2017R1対応 | +| [93bc41b](https://github.com/cpprefjp/site/commit/93bc41bc9ade112bd57283929091f24746bc82c1) | cpprefjp/fixl:1 | P2328R1対応 | +| [10539d4](https://github.com/cpprefjp/site/commit/10539d462cf7325212c96e5620110fdb8a79b115) | cpprefjp/fixm:1 | view : 意味論要件の微修正 | +| [33d6e9a](https://github.com/cpprefjp/site/commit/33d6e9aa95e4f6d02fb700b1d3afa8769b70876c) | cpprefjp/fixm:1 | `generator` : デフォルトアロケータ型の修正 | +| [9a64346](https://github.com/cpprefjp/site/commit/9a64346a2a1d30ebefdbc5136b08e9a8eaa8b5c9) | cpprefjp/fixl:4 | 未初期化メモリに対するアルゴリズム、事前条件追記 | +| [2f67b2a](https://github.com/cpprefjp/site/commit/2f67b2a41bf0aaac87dd465530ed1e7f299ec156) | cpprefjp/fixl:20 | 未初期化メモリに対するアルゴリズム、例外発生時の振る舞いについて追記 | +| [19d47d8](https://github.com/cpprefjp/site/commit/19d47d886e3fad701966c229996b5a6d2dc40a71), [fbfaaeb](https://github.com/cpprefjp/site/commit/fbfaaeb3b76abd124b0afaad2c689ed5e32d159c) | cpprefjp/fixm:2 | `adjacent_find`の動作イメージを付加 | +| [7a0af00](https://github.com/cpprefjp/site/commit/7a0af0077b1553719db531bfbe12275dc5cd60a6) | cpprefjp/fixm:1 | 畳み込み式 : 式種類の参照方法を微調整 | +| [7b90cfd](https://github.com/cpprefjp/site/commit/7b90cfd29f6257e949730a1ba70ca02b0e9d2dd6), [7405b3c](https://github.com/cpprefjp/site/commit/7405b3c3c4c498b3518d52486702eec36bf6e866) | cpprefjp/fixl:1 | `offsetof` : バージョン間の差異などについて追記 | +| [4d5c0ed](https://github.com/cpprefjp/site/commit/4d5c0edfcd79661472afc00a695d017297e4d1d9), [56dc9fa](https://github.com/cpprefjp/site/commit/56dc9faa8b2d540bdbb01f0e4b51f9749922ec45) | cpprefjp/link:32 | osdn.jpのリンクをwebarchiveに差し替え | + + +## [tetsurom](https://github.com/tetsurom) + +| コミット | タグ | 説明 | +|----------|------|------| +| [5b0dfcb](https://github.com/cpprefjp/site/commit/5b0dfcbb75706d0b4219676187e0851178825d0d) | cpprefjp/fixl:1 | `` C++23対応(ヘッダーページのみ) | +| [6634d85](https://github.com/cpprefjp/site/commit/6634d8587f5b9dbb4dc46f1c792f5d3246fd3fea), [8b51996](https://github.com/cpprefjp/site/commit/8b51996ff3b9a4b68106d943313e89569da65069), [8d68f98](https://github.com/cpprefjp/site/commit/8d68f98f82d54011721eac4667dd508b81c457ac) | cpprefjp/addref:2, cpprefjp/fixl:1 | `repeat_view`の説明を追加 | + + +## [tshino](https://github.com/tshino) + +| コミット | タグ | 説明 | +|----------|------|------| +| [c77af98](https://github.com/cpprefjp/site/commit/c77af98f9553e4515f55edd53f96e65f1c58dc22) | cpprefjp/typo:1 | Fix typo | +| [58c137d](https://github.com/cpprefjp/site/commit/58c137d95c790b4afa37945a0b9cec9236cc2dc3), [68eb5ba](https://github.com/cpprefjp/site/commit/68eb5baa77245d37dd583d936ec89998e7f7a6a5), [ceb813e](https://github.com/cpprefjp/site/commit/ceb813ec5fdcfcbf3ef5205d2e0bf4f52e83337d) | cpprefjp/fixm:4, cpprefjp/link:2 | `shift_left`/`shift_right`で負数を指定可能と読める記述の修正 | +| [05ee2e6](https://github.com/cpprefjp/site/commit/05ee2e647ca2e59498eb1743056925969eeb6e7f) | cpprefjp/fixm:1 | `std::exchange`が常にムーブ代入するような記述の修正 | + + +## [acd1034](https://github.com/acd1034) + +| コミット | タグ | 説明 | +|----------|------|------| +| [fb27730](https://github.com/cpprefjp/site/commit/fb277307e6e97f3406fcdfcc957b6c77cb11fb45), [3e0c51d](https://github.com/cpprefjp/site/commit/3e0c51d0d2f8c8607a57857902cd902236d01912) | cpprefjp/fixm:1 | `optional.or_else`: メソッドチェインとしての使い方を追加 | +| [dc598a2](https://github.com/cpprefjp/site/commit/dc598a2bf6edb642f7fce7599b01aa9b29550568) | cpprefjp/fixm:1 | オリジナル書式を定義する例の参照修飾を修正 | +| [313f64e](https://github.com/cpprefjp/site/commit/313f64e6b708f264cb2d24e2ead385d5c6e65555) | cpprefjp/fixl:1 | fmt-iter-forが未規定の型であることを明示化 | + + +## [tomolatoon](https://github.com/tomolatoon) + +| コミット | タグ | 説明 | +|----------|------|------| +| [b2f6285](https://github.com/cpprefjp/site/commit/b2f6285e94de2248a57d9dedff0fb64677e15227), [d9d912a](https://github.com/cpprefjp/site/commit/d9d912ab5e77403cbdf5d93d51b2b66e887d4b8f), [8cc4361](https://github.com/cpprefjp/site/commit/8cc4361ae1ba943d065a624d866ae3f526a48894), [653081e](https://github.com/cpprefjp/site/commit/653081e759e041f845ec7efa22dad18ab81635ca) | cpprefjp/fixs:2, cpprefjp/link:2, cpprefjp/fixl:23, cpprefjp/addref:14 | P2165R4, P2255R2, P2321R2 | + + +## [akinomyoga](https://github.com/akinomyoga) + +| コミット | タグ | 説明 | +|----------|------|------| +| [05c1f4f](https://github.com/cpprefjp/site/commit/05c1f4f83c8d0036ead5237667fb68c2c8217b4d) | cpprefjp/fixm:1 | `time_t`: 多くの実装で符号付き | + + +## [yumetodo](https://github.com/yumetodo) + +| コミット | タグ | 説明 | +|----------|------|------| +| [4136995](https://github.com/cpprefjp/site/commit/41369956550951a19b948397109d022c383e7f3d) | cpprefjp/fixm:1 | feat: `std::bind`でメンバー関数を呼び出す方法を例に追加 | +| [141e98e](https://github.com/cpprefjp/site/commit/141e98ef7802194cbe801d5c38a0653545de0e7a) | cpprefjp/link:1 | chore: `std:::size` -> `std::rages::size`にリンクする | + + +## [HansRobo](https://github.com/HansRobo) + +| コミット | タグ | 説明 | +|----------|------|------| +| [40638a6](https://github.com/cpprefjp/site/commit/40638a63cdf1948f5f77277d07f504a34e7f7974) | cpprefjp/typo:1 | fix typo in constexpr_lambda.md | + + +## [h-sao](https://github.com/h-sao) + +| コミット | タグ | 説明 | +|----------|------|------| +| [44a8e47](https://github.com/cpprefjp/site/commit/44a8e478d43dcbbc5711c05570cf15be16a451f1) | cpprefjp/compiler:1 | Updated ICC ver for C++20 | +| [f91a124](https://github.com/cpprefjp/site/commit/f91a124e156859b310f53ef062117ae93c9c2ec2), [5684a8d](https://github.com/cpprefjp/site/commit/5684a8d9526d13ddee84d6a2468b973081e2b041) | cpprefjp/fixm:1 | Updated ICX title for C++23 | +| [d63dd85](https://github.com/cpprefjp/site/commit/d63dd85d2a3389d8b9f95829778f041b49eba2e1) | cpprefjp/link:1 | VCのC++23機能がMS公式サイトに載ったのでリンクを修正した | +| [e9d068b](https://github.com/cpprefjp/site/commit/e9d068b7c23c0d32bdd8ce872aac2b35a40d806a) | cpprefjp/compiler:3 | Updated Implimentation status for VC++ C++23 | +| [1e3d056](https://github.com/cpprefjp/site/commit/1e3d056d8a587c92a2ce8f4e6c95c5bbad667fbe) | cpprefjp/compiler:5 | Updated supported c++23 by ICX (~ R2201R1) | +| [876f77c](https://github.com/cpprefjp/site/commit/876f77c7c909f2972ecdc95333a1f86896ea091f) | cpprefjp/compiler:1 | Update implementation-status.md for C++20 of ICC | +| [67a300d](https://github.com/cpprefjp/site/commit/67a300dab35d0679a014d96c6e2669903a5012e2) | cpprefjp/compiler:5 | Updated implimentation status of Clang about c++23 | +| [f0d163c](https://github.com/cpprefjp/site/commit/f0d163cc2a32541706d85087b60957b133e87288) | cpprefjp/compiler:8 | Updated implimentation status of ICC about c++20 | +| [1326e68](https://github.com/cpprefjp/site/commit/1326e68a7dc70b04e698f1ce35580342c0c544e2) | cpprefjp/compiler:1 | Updated GCC support version for C++23 | +| [beb148e](https://github.com/cpprefjp/site/commit/beb148edbf96be6eb9a31ee14b58a886db3e4e99) | cpprefjp/compiler:17 | Updated implimentation status of ICX about c++23 | + + +## [yutopp](https://github.com/yutopp) + +| コミット | タグ | 説明 | +|----------|------|------| +| [20ed53d](https://github.com/cpprefjp/site/commit/20ed53df537f4456bc971969411f1277bbeb22f0) | cpprefjp/typo:1 | typo/コンパイルエラーの修正: `shared_mutex`→`shared_timed_mutex` | + + +## [sakujiro-inagaki](https://github.com/sakujiro-inagaki) + +| コミット | タグ | 説明 | +|----------|------|------| +| [9116a93](https://github.com/cpprefjp/site/commit/9116a9393d60707981347afccd127578fd47f374) | cpprefjp/fixm:1 | variantが追加の動的メモリ確保を行わないことを説明する文を修正 | + + +## [norisio](https://github.com/norisio) + +| コミット | タグ | 説明 | +|----------|------|------| +| [0af0c3c](https://github.com/cpprefjp/site/commit/0af0c3caadb5b187475d04a5ecb886a970376506) | cpprefjp/typo:1 | allocator.md backquoteのtypoを修正 | + + +## [kamitani08](https://github.com/kamitani08) + +| コミット | タグ | 説明 | +|----------|------|------| +| [833f22b](https://github.com/cpprefjp/site/commit/833f22bde02b45e122bd746d52c58f223ef4f81f) | cpprefjp/typo:1 | Update guaranteed_copy_elision.md | + + +## [cupro29](https://github.com/cupro29) + +| コミット | タグ | 説明 | +|----------|------|------| +| [38aa278](https://github.com/cpprefjp/site/commit/38aa278067c5ee2a63926bd41401b57d0ab27eb5) | cpprefjp/typo:1 | fix typo | + + +## [nu4nu](https://github.com/nu4nu) + +| コミット | タグ | 説明 | +|----------|------|------| +| [a13c86a](https://github.com/cpprefjp/site/commit/a13c86a40039bef44b954d1f33455a41fc1eaab9) | cpprefjp/link:3 | `numeric_limits`: Add and fix links to `cfloat` | +| [4816cf7](https://github.com/cpprefjp/site/commit/4816cf7b669210665378bf3cdf43dd1b6b2cfa70) | cpprefjp/fixm:2 | `numeric_limits`: Fix description of max/min_exponent | + + +## [ToruNiina](https://github.com/ToruNiina) + +| コミット | タグ | 説明 | +|----------|------|------| +| [7606d8f](https://github.com/cpprefjp/site/commit/7606d8fa6cf0fe57dc94718210b69cfd269a7f40) | cpprefjp/typo:1 | fix typo in cpp20/coroutines | +| [08a97ea](https://github.com/cpprefjp/site/commit/08a97ea65ad85cbb646cd58753e5860600ff337f) | cpprefjp/fixs:1 | typo: `make_reverse_iterator`の言語バージョン | + + +## [sutatoruta](https://github.com/sutatoruta) + +| コミット | タグ | 説明 | +|----------|------|------| +| [7580c17](https://github.com/cpprefjp/site/commit/7580c17863c0ba80bef67d6a2b39119587905da7) | cpprefjp/typo:9 | typo修正 | +| [ae6ac7c](https://github.com/cpprefjp/site/commit/ae6ac7c9b792b8e3fb6fb2ba9bbeab01648740cb) | cpprefjp/fixm:1 | random.mdの説明文とコードの不整合を修正 | + + +## [toru-fukaya](https://github.com/toru-fukaya) + +| コミット | タグ | 説明 | +|----------|------|------| +| [dd8a50d](https://github.com/cpprefjp/site/commit/dd8a50d89d7eaa04ca9511109342e11ff990e1fb) | cpprefjp/fixm:1 | クラステンプレートの型推論を回避する例を修正 | + + +## [kenichiice](https://github.com/kenichiice) + +| コミット | タグ | 説明 | +|----------|------|------| +| [da669da](https://github.com/cpprefjp/site/commit/da669daebd77e3551c2bd9f68bcd745c0205981a) | cpprefjp/fixm:1 | `filesystem_error`の名前空間を修正 | +| [86bab47](https://github.com/cpprefjp/site/commit/86bab47aa01fce293636c43725a8d0d017f47c06) | cpprefjp/fixs:1 | コメントの誤りを修正 | +| [6366c71](https://github.com/cpprefjp/site/commit/6366c71c487dcdf10bbf224db35a5b3bbc4d3c3f) | cpprefjp/fixs:1 | `chrono`/`time_point`/`op_minus`のコメントを修正 | +| [592119b](https://github.com/cpprefjp/site/commit/592119b916a6fd6c2559f8f2f35b896bc4abdd4a) | cpprefjp/fixl:2 | `allocator`: C++20での`size_type`と`difference_type`の扱いを修正 | + + +## [grafi-tt](https://github.com/grafi-tt) + +| コミット | タグ | 説明 | +|----------|------|------| +| [3c6b49c](https://github.com/cpprefjp/site/commit/3c6b49c2e77dbe6621c285238164fda96fef1c1f) | cpprefjp/link:1 | `basic_filebuf`に`fstream`ヘッダへのリンクを追加 | +| [fb9bf3a](https://github.com/cpprefjp/site/commit/fb9bf3a994183126c8e0bde4f49c4738dacb1daa), [a3cf8a4](https://github.com/cpprefjp/site/commit/a3cf8a41e6d89778b12af4a438e40d1b1f52b673) | cpprefjp/addref:7, cpprefjp/fixl:1, cpprefjp/link:57 | `stringstream`関連のページ作成および、C++20での効率化について参照追加 | +| [c1346e3](https://github.com/cpprefjp/site/commit/c1346e39c869eddfdd51c5154b6c8dea1da75cc8) | cpprefjp/typo:1 | `fetch_sub` の typo 修正 | + + +## [g-suizu](https://github.com/g-suizu) + +| コミット | タグ | 説明 | +|----------|------|------| +| [94b0c91](https://github.com/cpprefjp/site/commit/94b0c912176e85c536b6a3d306995ee9da3c4590) | cpprefjp/fixl:1 | 古い表記を修正 | + + +## [komori-n](https://github.com/komori-n) + +| コミット | タグ | 説明 | +|----------|------|------| +| [c3f3f2c](https://github.com/cpprefjp/site/commit/c3f3f2cf06824af6c4548e63bd2155ce9328fc07) | cpprefjp/typo:1 | `remove` の typo 修正 | +| [97b792b](https://github.com/cpprefjp/site/commit/97b792b514201c2ad5a52a7e29c0220ec0b53110) | cpprefjp/fixm:1 | `ranges::swap_ranges` の `swap` 回数が正しくない問題を修正 | +| [0778710](https://github.com/cpprefjp/site/commit/0778710e5a3cbbead54b7a77e962b86061e37c69) | cpprefjp/fixm:1 | `swap_ranges` のループ回数が正しくない問題を修正 | + + +## [sf624](https://github.com/sf624) + +| コミット | タグ | 説明 | +|----------|------|------| +| [1ac7d12](https://github.com/cpprefjp/site/commit/1ac7d1265a38e8965fdb0c05d250aa50787c71ea) | cpprefjp/fixm:2 | `std::map`の`operator[]`の記述を修正 | +| [206dcff](https://github.com/cpprefjp/site/commit/206dcffbd83c1b4e070233ee321bbe16b8bad024) | cpprefjp/fixm:1 | fix: `unordered_map`の`operator[]`の例外仕様を修正 | + + +## [yknishidate](https://github.com/yknishidate) + +| コミット | タグ | 説明 | +|----------|------|------| +| [e279f87](https://github.com/cpprefjp/site/commit/e279f872bff98b0808beec6ee224d5c7ea009811) | cpprefjp/fixm:1 | 生成した乱数のimplicit conversionを削除 | +| [194a6b7](https://github.com/cpprefjp/site/commit/194a6b77fcf421e024c1838300c6522302775323), [20a027a](https://github.com/cpprefjp/site/commit/20a027aad1db4757d4cbed18de465c1af86c3403) | cpprefjp/typo:2 | fix typo | +| [e3a4106](https://github.com/cpprefjp/site/commit/e3a410686a00c48fe624311ba1d358694868550d) | cpprefjp/typo:1 | fix spell "generetor" | +| [852dd81](https://github.com/cpprefjp/site/commit/852dd814b1c207fbd7d786862ad1f7647b7e7f47) | tool/improves:1 | add "generetor" to NG words | +| [4838b94](https://github.com/cpprefjp/site/commit/4838b94398173fdae766f945fbcf2b2a2c42b088) | cpprefjp/typo:1 | fix closing parenthesis | +| [113c185](https://github.com/cpprefjp/site/commit/113c185a8acc00babf4598c577096b54658c1f0b) | cpprefjp/typo:1 | fix spell "voaltile" | +| [47177bf](https://github.com/cpprefjp/site/commit/47177bf7988941985c80deeaba8bcd4b039af148) | tool/improves:1 | add "voaltile" to NG words | +| [0a11f21](https://github.com/cpprefjp/site/commit/0a11f21c6c0606967a6211c296348eb9db0d96f5) | cpprefjp/typo:1 | fix spell "opreator" | +| [fb23442](https://github.com/cpprefjp/site/commit/fb234424f7a04f94227408b335b855e9a1b6a427) | tool/improves:1 | add "opreator" to NG words | +| [6845c65](https://github.com/cpprefjp/site/commit/6845c65b8cea233da6b0a42f4fd37750b81459f6) | cpprefjp/typo:1 | fix spell "swtich" | +| [dc16deb](https://github.com/cpprefjp/site/commit/dc16deb55142f824ce896fb30e495ce73536a83e) | tool/improves:1 | add "swtich" to NG words | +| [d6ce50d](https://github.com/cpprefjp/site/commit/d6ce50de34c3e648c4e75d0343149d02b6ef4398) | cpprefjp/fixs:1 | fix spell "namespase" | +| [499d430](https://github.com/cpprefjp/site/commit/499d43030eeffe6193d3a4b90f723477cf98b3e3) | tool/improves:1 | add "namespase" to NG words | +| [082b914](https://github.com/cpprefjp/site/commit/082b914d32b5d5baf063d4c1419979063ed1dd6c) | cpprefjp/typo:1 | fix spell "concpet" | +| [2e6e172](https://github.com/cpprefjp/site/commit/2e6e1720de6ffcb5116835bf6c73060b98580fb4) | tool/improves:1 | add "concpet" to NG words | + + +## [ROCKTAKEY](https://github.com/ROCKTAKEY) + +| コミット | タグ | 説明 | +|----------|------|------| +| [4d8a7ea](https://github.com/cpprefjp/site/commit/4d8a7ea19cc2b3942b7f81e8ff3bb000a9e894bb) | cpprefjp/fixs:1 | start_editing: 特殊文字へ変換される前の文字列を表示するよう修正 | +| [2c7cf5e](https://github.com/cpprefjp/site/commit/2c7cf5e6f86de685aca92bd133c4be459df95ec7) | cpprefjp/fixs:1 | working_style: 型修飾のスタイルの一覧を等幅フォントで表示するよう修正 | +| [5b7be4d](https://github.com/boostjp/site/commit/5b7be4df3346979f242b50973fa621fe8780048b) | boostjp/link:1 | boostjpのメンバーへのリンクのミスを修正 | +| [dd67365](https://github.com/boostjp/site/commit/dd6736568d8619240d2362262a35f5787000040c) | boostjp/fixm:1 | 「編集に際してのその他の方針、ガイドライン」の項を追加 | +| [eddaf80](https://github.com/boostjp/site/commit/eddaf8047692547c58a205089b8c0756c4b1c5d8) | boostjp/typo:1 | 誤字を修正 | +| [0bb41b2](https://github.com/boostjp/site/commit/0bb41b2f7b6ffb6d2b5019a1271615297b477340) | boostjp/link:1 | `std::optional`と`std::expected`へのリンクを追加 | +| [3b69175](https://github.com/boostjp/site/commit/3b69175def18230615ea6c19bf63ac2427baae60) | boostjp/link:1 | `std::for_each`などへのリンクを追加 | +| [4f2591d](https://github.com/boostjp/site/commit/4f2591d40d878627430db880d9bdedaf6e6c82e2) | boostjp/link:1 | コンパイル時アサートへのリンクを追加 | +| [a9934e8](https://github.com/boostjp/site/commit/a9934e8743c022b00a5ddcaa026d22b2bd385f0a) | boostjp/link:1 | `std::unordered_map`、`std::unordered_set`へのリンクを追加 | +| [5607df1](https://github.com/boostjp/site/commit/5607df1b4672b0a573980043313e3fb693996dd5) | boostjp/link:1 | `std::variant`へのリンクを追加 | + + +## [Reputeless](https://github.com/Reputeless) + +| コミット | タグ | 説明 | +|----------|------|------| +| [c9a543d](https://github.com/cpprefjp/site/commit/c9a543d972fa76272af7350fe9a3af9e571ab42c) | cpprefjp/fixm:6 | `ranges::less` 等のサンプルコードのコンパイルエラーを修正 | + + +## [KisaragiEffective](https://github.com/KisaragiEffective) + +| コミット | タグ | 説明 | +|----------|------|------| +| [3021561](https://github.com/cpprefjp/site/commit/3021561ee5b45ef4b53eed34d4207d0ae946888d) | cpprefjp/typo:1 | ICXのリンクラベルを修正しました | + + +## [suzuki-kei](https://github.com/cpprefjp/site/commits?author=suzuki-kei) + +| コミット | タグ | 説明 | +|----------|------|------| +| [7e37ab2](https://github.com/cpprefjp/site/commit/7e37ab27d5f03221181f8282d1385efe68658864) | cpprefjp/typo:1 | typo を修正: "スタンダードレイアウト型型" -> "スタンダードレイアウト型" | + + From b66dc235144d1e19f0fbe2a4372f37381ac96aee Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 13 Dec 2023 20:17:12 +0900 Subject: [PATCH 0584/3948] =?UTF-8?q?=E5=A0=B1=E9=85=AC=E5=8F=97=E3=81=91?= =?UTF-8?q?=E5=8F=96=E3=82=8A=E3=81=AFOpen=20Collective=E3=81=B8=E3=81=AE?= =?UTF-8?q?=E7=B5=8C=E8=B2=BB=E7=94=B3=E8=AB=8B=E3=81=A7=E3=81=AF=E3=81=AA?= =?UTF-8?q?=E3=81=8F=E3=80=81cpprefjp=E6=97=A5=E6=9C=AC=E5=8F=A3=E5=BA=A7?= =?UTF-8?q?=E3=81=AB=E7=94=B3=E8=AB=8B=E3=83=95=E3=82=A9=E3=83=BC=E3=83=A0?= =?UTF-8?q?=E3=83=99=E3=83=BC=E3=82=B9=E3=81=A7=E7=94=B3=E8=AB=8B=E3=81=97?= =?UTF-8?q?=E3=81=A6=E3=82=82=E3=82=89=E3=81=86=E3=81=93=E3=81=A8=E3=81=AB?= =?UTF-8?q?=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start_editing.md | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/start_editing.md b/start_editing.md index 8bacec6968..8301f9cd45 100644 --- a/start_editing.md +++ b/start_editing.md @@ -354,25 +354,6 @@ CIスクリプト、site_generator、kunaiなど。 | tool/addm | 50 | 新たな仕組みの導入 medium | | tool/addl | 100〜 | 新たな仕組みの導入 large : キーワード自動リンク、相対リンク対応など | -### Open Collectiveでの経費申請 -1. Open Collectiveのcpprefjpページに行く -2. 画面右側の「アクション」から「経費を申請」をクリック -3. ご自身の住所・氏名などを入力 -4. 支払い方法を入力 - - 通貨はUSDを選択 - - 送金先の国はJapanを選択 - - 「bank account (銀行口座)」または「PayPal」を選択 - - bank accountであれば、口座情報として銀行のSWIFT / BIC CODEおよびIBANを調べて入力する - - Google検索で「(銀行名) BIC CODE」などで検索 - - 三菱UFC銀行なら「BOTKJPJT」 - - bank accountのIBAN (International Bank Account Number) は、支店番号 + 口座番号を連続で記載する - - PayPalであれば、ご自身のPayPalアカウントを入力する - - ご自身の住所を英語で入力する - - 請求金額および請求の説明を記載して送信する - - 説明欄にGitHubアカウントを書いてもらえると、だれの申請かがわかりやすくて助かる -5. cpprefjpから経費の承認がされれば、支払われる - - ### 貢献ポイントの集計ページ - [2023年](start_editing/contribution_stats_2023.md) From eb5bc297abfa0046dfb35c138b1826967cbf16c7 Mon Sep 17 00:00:00 2001 From: suomesta Date: Thu, 14 Dec 2023 23:43:16 +0900 Subject: [PATCH 0585/3948] fix samples. unique_ptr with void is ill-formed --- reference/memory/unique_ptr/op_assign.md | 4 ++-- reference/memory/unique_ptr/op_constructor.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/memory/unique_ptr/op_assign.md b/reference/memory/unique_ptr/op_assign.md index 78fd8e4464..bffce536bc 100644 --- a/reference/memory/unique_ptr/op_assign.md +++ b/reference/memory/unique_ptr/op_assign.md @@ -84,9 +84,9 @@ int main() // (2) 変換可能な型からの所有権移動 // p1の所有権をp2に譲渡する - std::unique_ptr p2; + std::unique_ptr p2; p2 = std::move(p1); - assert(*static_cast(p2.get()) == 3); + assert(*static_cast(p2.get()) == 3); // (3) リソース解放 std::unique_ptr p3(new int(3)); diff --git a/reference/memory/unique_ptr/op_constructor.md b/reference/memory/unique_ptr/op_constructor.md index 58e858b2a9..e63bf2eabe 100644 --- a/reference/memory/unique_ptr/op_constructor.md +++ b/reference/memory/unique_ptr/op_constructor.md @@ -143,8 +143,8 @@ int main() assert(!p6); // (7) 変換可能な他のunique_ptrから所有権を譲渡する - std::unique_ptr p7 = std::move(p5); - assert(*static_cast(p7.get()) == 3); + std::unique_ptr p7 = std::move(p5); + assert(*static_cast(p7.get()) == 3); } ``` * std::default_delete[link /reference/memory/default_delete.md] From c284a82024d234a862a388c2a4ae1cd48f32a536 Mon Sep 17 00:00:00 2001 From: Kisaragi <48310258+KisaragiEffective@users.noreply.github.com> Date: Tue, 19 Dec 2023 13:48:50 +0900 Subject: [PATCH 0586/3948] =?UTF-8?q?impl(C++11,ICC):=20=E3=82=A2=E3=83=A9?= =?UTF-8?q?=E3=82=A4=E3=83=A1=E3=83=B3=E3=83=88=E6=8C=87=E5=AE=9A=E3=81=8C?= =?UTF-8?q?=E3=82=B5=E3=83=9D=E3=83=BC=E3=83=88=E3=81=95=E3=82=8C=E3=81=9F?= =?UTF-8?q?=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://software.intel.com/en-us/articles/c0x-features-supported-by-intel-c-compiler による --- implementation-status.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/implementation-status.md b/implementation-status.md index f56b5a2bdb..73101a9e61 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -14,8 +14,8 @@ | 言語機能 | 説明 | [GCC][gcc] | [Clang][clang] | [ICC][icc] | [MSVC][msvc] | |----------------------------------|------|-----|-------|-----|------| -| N2341: [`alignas`](/lang/cpp11/alignas.md) | アライメント指定 | 4.8 | 3.0 | No | 2015
2003あるいはそれ以前からある`__declspec(align(x))`構文で代替可能。 | -| N2341: [`alignof`](/lang/cpp11/alignof.md) | アライメント取得 | 4.5 | 3.3 | No | 2015
2003あるいはそれ以前よりある`__alignof`で代替可能。 | +| N2341: [`alignas`](/lang/cpp11/alignas.md) | アライメント指定 | 4.8 | 3.0 | 15.0 | 2015
2003あるいはそれ以前からある`__declspec(align(x))`構文で代替可能。 | +| N2341: [`alignof`](/lang/cpp11/alignof.md) | アライメント取得 | 4.5 | 3.3 | 15.0 | 2015
2003あるいはそれ以前よりある`__alignof`で代替可能。 | | N1984: [`auto`](/lang/cpp11/auto.md) | 型推論 | 4.4 | 2.9 | 12.0 | 2010 | | N2343: [`decltype`](/lang/cpp11/decltype.md) | 式の型を取得 | 4.3 | 2.9 | 13.0 | 2010 (partial)
2012 | | N1653: C99互換のプリプロセッサ | [可変引数マクロ](/lang/cpp11/variadic_macros.md)、[Pragma演算子](/lang/cpp11/pragma_operator.md)、[`__func__`](/lang/cpp11/func.md) | 4.3 | 2.9 | 11.1 | 2005 (partial): 可変引数のみ `_Pragma`の代わりに`__pragma`が存在する。
2019 Update 6 | From a2f2ca3fd12984b58551161922e22332698f3974 Mon Sep 17 00:00:00 2001 From: range3 Date: Wed, 20 Dec 2023 13:48:35 +0900 Subject: [PATCH 0587/3948] fix forward_list::erase_after sample code --- reference/forward_list/forward_list/erase_after.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/reference/forward_list/forward_list/erase_after.md b/reference/forward_list/forward_list/erase_after.md index dfff5301e1..805ec3c5ab 100644 --- a/reference/forward_list/forward_list/erase_after.md +++ b/reference/forward_list/forward_list/erase_after.md @@ -107,8 +107,7 @@ int main() // 条件一致した要素を削除する if (*next == 1) { - // 削除された要素の次を指すイテレータが返される。 - it = ls.erase_after(it); + ls.erase_after(it); } // 要素削除をしない場合に、イテレータを進める else { From 55d6e134c1e1ad44593a4b3fb3c06e073b8b07fd Mon Sep 17 00:00:00 2001 From: yumetodo Date: Fri, 22 Dec 2023 01:24:52 +0900 Subject: [PATCH 0588/3948] fix: update checkout,setup-python,cache >The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2, actions/setup-python@v1. For more info: >https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/ --- .github/workflows/build.yml | 10 +++++----- .github/workflows/code_qualify_check.yml | 4 ++-- .github/workflows/detect_forbidden_characters.yml | 4 ++-- .github/workflows/inner_link_check.yml | 4 ++-- .github/workflows/meta_header_check.yml | 4 ++-- .github/workflows/ngword_check.yml | 4 ++-- .github/workflows/outer_link_check.yml | 4 ++-- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d251a1a203..48834405ca 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,7 +23,7 @@ jobs: chmod 600 $HOME/.ssh/id_ed25519 # site_generator - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: repository: cpprefjp/site_generator path: site_generator @@ -31,7 +31,7 @@ jobs: working-directory: site_generator # kunai - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: repository: cpprefjp/kunai path: site_generator/kunai @@ -39,13 +39,13 @@ jobs: working-directory: site_generator/kunai # cpprefjp.github.io - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: repository: cpprefjp/cpprefjp.github.io path: site_generator/cpprefjp/cpprefjp.github.io # site - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: repository: cpprefjp/site path: site_generator/cpprefjp/site @@ -55,7 +55,7 @@ jobs: working-directory: site_generator/cpprefjp/site - name: Set up Python 3.x - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: 3.11 # 3.12でUndefined symbolエラーがでた diff --git a/.github/workflows/code_qualify_check.yml b/.github/workflows/code_qualify_check.yml index d5819c3852..4260abe065 100644 --- a/.github/workflows/code_qualify_check.yml +++ b/.github/workflows/code_qualify_check.yml @@ -7,13 +7,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Set up Python - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: '3.x' - name: Install dependencies run: | python -m pip install --upgrade pip pip install requests - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: check run: python3 .github/workflows/script/code_qualify_check.py diff --git a/.github/workflows/detect_forbidden_characters.yml b/.github/workflows/detect_forbidden_characters.yml index 366f88492e..0fa333b698 100644 --- a/.github/workflows/detect_forbidden_characters.yml +++ b/.github/workflows/detect_forbidden_characters.yml @@ -20,7 +20,7 @@ jobs: cache-version: v1 steps: - id: cache-ripgrep - uses: actions/cache@v1 + uses: actions/cache@v3 with: path: ${{ env.BIN_DIR }} key: ${{ env.cache-version }}-ripgrep-${{ env.RIPGREP_VERSION }} @@ -31,7 +31,7 @@ jobs: mkdir -p $BIN_DIR tar xvf ripgrep-$RIPGREP_VERSION-x86_64-unknown-linux-musl.tar.gz --strip=1 --no-anchor -C $BIN_DIR rg working-directory: ${{ runner.temp }} - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: path: ${{ env.REPO_DIR }} - name: check diff --git a/.github/workflows/inner_link_check.yml b/.github/workflows/inner_link_check.yml index 0ee3bd2826..84ae4e0aa0 100644 --- a/.github/workflows/inner_link_check.yml +++ b/.github/workflows/inner_link_check.yml @@ -7,13 +7,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Set up Python - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: '3.x' - name: Install dependencies run: | python -m pip install --upgrade pip pip install requests - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: check run: python3 .github/workflows/script/link_check.py --check-inner-link diff --git a/.github/workflows/meta_header_check.yml b/.github/workflows/meta_header_check.yml index dbbd8b1fe5..9da3e3f520 100644 --- a/.github/workflows/meta_header_check.yml +++ b/.github/workflows/meta_header_check.yml @@ -7,13 +7,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Set up Python - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: '3.x' - name: Install dependencies run: | python -m pip install --upgrade pip pip install requests - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: check run: python3 .github/workflows/script/meta_header_check.py diff --git a/.github/workflows/ngword_check.yml b/.github/workflows/ngword_check.yml index 82c48ed9e2..03a71c6cb3 100644 --- a/.github/workflows/ngword_check.yml +++ b/.github/workflows/ngword_check.yml @@ -7,13 +7,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Set up Python - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: '3.x' - name: Install dependencies run: | python -m pip install --upgrade pip pip install requests - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: check run: python3 .github/workflows/script/ngword_check.py diff --git a/.github/workflows/outer_link_check.yml b/.github/workflows/outer_link_check.yml index 6d13da8dc6..f18d42f48d 100644 --- a/.github/workflows/outer_link_check.yml +++ b/.github/workflows/outer_link_check.yml @@ -12,14 +12,14 @@ jobs: runs-on: ubuntu-latest steps: - name: Set up Python - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: '3.x' - name: Install dependencies run: | python -m pip install --upgrade pip pip install requests - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: ref: master - name: check From 18b3289b402b802936dd5e1f5f05755c74088545 Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Fri, 22 Dec 2023 23:07:09 +0900 Subject: [PATCH 0589/3948] feat: C++23 relaxing some constexpr restrictions --- .../relaxing_some_constexpr_restrictions.md | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 lang/cpp23/relaxing_some_constexpr_restrictions.md diff --git a/lang/cpp23/relaxing_some_constexpr_restrictions.md b/lang/cpp23/relaxing_some_constexpr_restrictions.md new file mode 100644 index 0000000000..96a1313c77 --- /dev/null +++ b/lang/cpp23/relaxing_some_constexpr_restrictions.md @@ -0,0 +1,115 @@ +# constexpr関数のすべての引数が定数実行できない場合でも適格とする +* cpp23[meta cpp] + +## 概要 + +いかなる呼び出しにおいても定数式実行できない`constexpr`関数が存在しても、プログラムが不適格にならないようにする。 + +ただし、このような関数の存在までは許容するというだけで、定数式実行できない`constexpr`関数を定数式文脈で呼び出すと従来通りエラーとなる。 + +## この機能が必要になった背景・経緯 + +これまでは、いかなる引数での呼び出しでも定数式実行できない`constexpr`関数が存在するだけでプログラムは不適格になっていた。 + +例えば以下のような場合である。 + +```cpp +int f(int x) { return x + 1; } + +constexpr int g(int x) { return f(x); } // error! fはいかなるxについても定数式実行不能 +``` + +`g`は`constexpr`でない関数`f`を呼び出すため、プログラムの中で実際に`g`が定数式実行されない場合であっても、このコードは不適格である。 +これによって、定数式実行できない言語機能を使用している関数や、`constexpr`でない関数を誤って呼び出すようなミスを検出することができた。 + +しかし、多くの標準ライブラリが`constexpr`対応を進めていくようになり、状況が変化した。 + +例えば、`std::optional`の`reset`メンバメソッドが`constexpr`に対応するのはC++20以降である。 +これは`std::optional`の内部実装が`union`のアクティブメンバを更新しているからであり、[これを定数式内で実行するにはC++20を待たねばならなかった](https://cpprefjp.github.io/lang/cpp20/changing_the_active_member_of_a_union_inside_constexpr.html)。 + +よって、以下のコードはC++17では不適格だが、C++20では正しいコードとなる。 + +```cpp +template +constexpr void f(std::optional& opt) +{ + opt.reset(); +} +``` + +これを正しく記述するには、`constexpr`指定をするかどうかをマクロで変更しなければならない。 +例えばC++20から`constexpr`になる関数群に対して以下のようなマクロを使うか、 + +```cpp +#if __cplusplus >= 202002L +# define MYLIB_CXX20_CONSTEXPR constexpr +#else +# define MYLIB_CXX20_CONSTEXPR +#endif + +template +MYLIB_CXX20_CONSTEXPR void f(std::optional& opt) +{ + opt.reset(); +} +``` + +あるいはより細かく指定するためにそれぞれの機能テストマクロを使うしかなかった。 + +```cpp + +template +#if __cpp_lib_optional >= 202106 +constexpr +#endif +void f(std::optional& opt) +{ + o.reset(); +} +``` + +これはいかにも冗長であり、またライブラリの導入時期だけでなくその関数一つ一つが`constexpr`指定されたタイミングを意識する必要があるため、正しく指定するのは非常に難しい。 + +`constexpr`指定を行わないことによってもこの問題は回避できるが、自身以外のユーザーが存在するライブラリの場合は`constexpr`対応が望まれる可能性があり、その場合はこの問題に対処する必要が生じる。 + +多くの場合、標準ライブラリ関数が`constexpr`指定されるのは、その機能が定数式実行可能になったバージョンよりも遅れる。 +例えば、`std::array`の`operator[]`の非`const`版が`constexpr`指定されるのは、定数式内で変数の変更が許可されるC++14ではなく、その次のC++17である([参考](https://cpprefjp.github.io/reference/array/array/op_at.html))。 +このような状況では上記のような解決策を用いてもミスを避けることは容易ではない。 + +現在、登場時点では定数式内で実行できなかったために`constexpr`されていなかった多くの標準ライブラリ関数が、のちにコア言語機能が追加されて`constexpr`指定されている。 +現時点で`constexpr`されていない関数は次のバージョンで`constexpr`になるかもしれず、よって現在使用されているバージョンである関数が`constexpr`ではないということを指摘することの意味は薄れている。 + +以上を鑑みて、`constexpr`関数が定数式実行可能かどうかを判断するのは、実際に定数式内で実行されてからにした方がよいという結論に至った。 + +実際に定数式内で実行できない関数が定数式内で呼び出された場合、これは従来通りエラーとするほかない。 +しかし、定数式内で呼び出されていないのならば、定数式内で実行できない関数が存在していてもプログラムを不適格とはしない。 + +## 仕様 + +`constexpr`指定された関数が満たすべき条件を緩和する。 + +- 関数の返り値は`literal`型でなくともよい。 +- 関数の引数はどれも`literal`型でなくともよい。 +- その関数が定数式実行可能になるような引数が存在する必要はない。 +- 定数式実行可能になるような`template`引数が存在する必要はない。 + +`constexpr`指定された、`=delete`指定されていないコンストラクタが満たすべき条件を緩和する。 + +- 非静的メンバ変数のコンストラクタは`constexpr`でなくともよい +- [委譲コンストラクタ](https://cpprefjp.github.io/lang/cpp11/delegating_constructors.html)の場合、委譲先のコンストラクタが`constexpr`でなくともよい + +`constexpr`指定された、`=delete`指定されていないデストラクタが満たすべき条件を緩和する。 + +- 非静的メンバ変数のデストラクタは`constexpr`でなくともよい + +また、陽に`default`指定された関数は、それが`constexpr-suitable`である限り、暗黙に`constexpr`指定される。 +`constexpr-suitable`とは、コルーチン関数ではなく、仮想基底クラスを持つクラスのコンストラクタまたはデストラクタでもない関数を指す。 + +## 関連項目 + +- [C++20 - constexpr関数内でのtry-catchブロックを許可](/lang/cpp20/try-catch_blocks_in_constexpr_functions.html) +- [C++20 - constexpr関数内で未評価のインラインアセンブリを許可することによる組み込み関数のconstexpr有効化](/lang/cpp20/enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.html) + +## 参照 + +- [P2448R2 - Relaxing some constexpr restrictions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2448r2.html) From 8b71c4325be5b1823d7428babf1a019cb97310b2 Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Fri, 22 Dec 2023 23:19:51 +0900 Subject: [PATCH 0590/3948] feat: C++23 non-literal vars in constexpr funcs --- ...literal_variables_inconstexpr_functions.md | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 lang/cpp23/non_literal_variables_inconstexpr_functions.md diff --git a/lang/cpp23/non_literal_variables_inconstexpr_functions.md b/lang/cpp23/non_literal_variables_inconstexpr_functions.md new file mode 100644 index 0000000000..d2a8d61ea4 --- /dev/null +++ b/lang/cpp23/non_literal_variables_inconstexpr_functions.md @@ -0,0 +1,31 @@ +# 定数式内での非リテラル変数、静的変数・スレッドローカル変数およびgotoとラベルの存在を許可する +* cpp23[meta cpp] + +## 概要 + +`constexpr`関数が非リテラル変数、静的変数・スレッドローカル変数およびgoto文とラベルを含むことを許可する。 + +ただし、これをコンパイル時に評価した場合、従来通りエラーとなる。 +これらを含むコードパスは実行時にのみ通過するようにしなければならない。 + +## この機能が必要になった背景・経緯 + +これまでは、`constexpr`関数内には非リテラル変数、静的変数・スレッドローカル変数およびgoto文とラベルが含まれてはならなかった。 +これは、`constexpr`関数が定数式実行できない要素を含んではならないという意味で、理にかなった制限であった。 + +しかし、C++20で[`std::is_constant_evaluated`](/reference/type_traits/is_constant_evaluated.md)によって定数式実行されるコードパスと実行時に通るコードパスを分けることが可能になり、状況が変化した。 +定数式実行できないコードとはいえ、実行時にのみ通りコンパイル時には通らないコードパスに含まれていた場合にもプログラムが不適格となる、というのは直観に反する。 + +よって、コンパイル時に評価されない限りにおいて、`constexpr`関数内に非リテラル変数、静的変数・スレッドローカル変数およびgoto文とラベルを含むことが許可されることとなった。 + +ただし、`constexpr`内に存在することが許可されたものの定数式として評価できるわけではないので、これらの機能は依然としてコンパイル時に使用することはできない。 + +## 関連項目 + +- [C++20 - constexpr関数内でのtry-catchブロックを許可](/lang/cpp20/try-catch_blocks_in_constexpr_functions.html) +- [C++20 - constexpr関数内で未評価のインラインアセンブリを許可することによる組み込み関数のconstexpr有効化](/lang/cpp20/enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.html) +- [C++23 - constexpr関数のすべての引数が定数実行できない場合でも適格とする](/lang/cpp23/relaxing_some_constexpr_restrictions.md) + +## 参照 + +- [P2242R3 - Non-literal variables (and labels and gotos) in constexpr functions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2242r3.html) From 67f5bf3a5462712254d00b31de5f49d16ed28673 Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Fri, 22 Dec 2023 23:20:17 +0900 Subject: [PATCH 0591/3948] feat: update cpp23.md for non-literal vars --- lang/cpp23.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp23.md b/lang/cpp23.md index c48eb9e7f1..9aa357055e 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -69,7 +69,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 |----------|------| | [`if consteval`](cpp23/if_consteval.md.nolink) | コンパイル時の文脈かどうかで分岐させる | | [定数式の文脈での`bool`への縮小変換を許可](cpp23/narrowing_contextual_conversions_to_bool.md.nolink) | `if constexpr(flags & Flags::Exec)`や`static_assert(N);`を許可 | -| [定数式内での非リテラル変数の使用を含められないようにする](cpp23/non_literal_variables_in_constexpr_functions.md.nolink) | 定数式内で静的変数・スレッドローカル変数およびgoto文とラベルを含められない制限を設ける | +| [定数式内での非リテラル変数、静的変数・スレッドローカル変数およびgotoとラベルの存在を許可する](cpp23/non_literal_variables_in_constexpr_functions.md) | コンパイル時に評価されない限り、定数式内に静的変数・スレッドローカル変数およびgoto文とラベルを含むことを許可する | | [静的な診断メッセージの文字エンコーディング](cpp23/character_encoding_of_diagnostic_text.md.nolink) | `static_assert`や`[[deprecated]]`などの診断メッセージの文字集合に関する要件をなくす | | [`constexpr`関数のすべての引数が定数実行できない場合でも適格とする](cpp23/relaxing_some_constexpr_restrictions.md.nolink) | | | [`constexpr`関数内での`static constexpr`変数を許可](cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md.nolink) | | From b460e7d239c7c8cc10ef9e6cdad8b7b720f9e63e Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Fri, 22 Dec 2023 23:21:18 +0900 Subject: [PATCH 0592/3948] feat: update cpp23.md for relaxing-constexpr-restr --- lang/cpp23.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp23.md b/lang/cpp23.md index c48eb9e7f1..a9389f2e4e 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -71,7 +71,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 | [定数式の文脈での`bool`への縮小変換を許可](cpp23/narrowing_contextual_conversions_to_bool.md.nolink) | `if constexpr(flags & Flags::Exec)`や`static_assert(N);`を許可 | | [定数式内での非リテラル変数の使用を含められないようにする](cpp23/non_literal_variables_in_constexpr_functions.md.nolink) | 定数式内で静的変数・スレッドローカル変数およびgoto文とラベルを含められない制限を設ける | | [静的な診断メッセージの文字エンコーディング](cpp23/character_encoding_of_diagnostic_text.md.nolink) | `static_assert`や`[[deprecated]]`などの診断メッセージの文字集合に関する要件をなくす | -| [`constexpr`関数のすべての引数が定数実行できない場合でも適格とする](cpp23/relaxing_some_constexpr_restrictions.md.nolink) | | +| [`constexpr`関数のすべての引数が定数実行できない場合でも適格とする](cpp23/relaxing_some_constexpr_restrictions.md) | 定数式実行できない関数であっても、実際にコンパイル時に評価されない限り`constexpr`指定することを許可する | | [`constexpr`関数内での`static constexpr`変数を許可](cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md.nolink) | | | [`constexpr`関数内で`consteval`関数を呼び出せない問題を緩和](cpp23/consteval_needs_to_propagate_up.md.nolink) | | From 836d3a73ef67c9dd4dea4c9da85e4b1864c898d0 Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Fri, 22 Dec 2023 23:31:54 +0900 Subject: [PATCH 0593/3948] fix: link to *.md, not *.html --- lang/cpp23/relaxing_some_constexpr_restrictions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/cpp23/relaxing_some_constexpr_restrictions.md b/lang/cpp23/relaxing_some_constexpr_restrictions.md index 96a1313c77..0c5a236dd0 100644 --- a/lang/cpp23/relaxing_some_constexpr_restrictions.md +++ b/lang/cpp23/relaxing_some_constexpr_restrictions.md @@ -107,8 +107,8 @@ void f(std::optional& opt) ## 関連項目 -- [C++20 - constexpr関数内でのtry-catchブロックを許可](/lang/cpp20/try-catch_blocks_in_constexpr_functions.html) -- [C++20 - constexpr関数内で未評価のインラインアセンブリを許可することによる組み込み関数のconstexpr有効化](/lang/cpp20/enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.html) +- [C++20 - constexpr関数内でのtry-catchブロックを許可](/lang/cpp20/try-catch_blocks_in_constexpr_functions.md) +- [C++20 - constexpr関数内で未評価のインラインアセンブリを許可することによる組み込み関数のconstexpr有効化](/lang/cpp20/enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.md) ## 参照 From ccf8ee7fabf255812405bf80feb736f8b7cc1eb3 Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Fri, 22 Dec 2023 23:34:45 +0900 Subject: [PATCH 0594/3948] fix: update link to relaxing_some_constexpr_restr --- implementation-status.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/implementation-status.md b/implementation-status.md index 73101a9e61..cae458346d 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -269,7 +269,7 @@ | P1401R5 : [定数式の文脈での`bool`への縮小変換を許可](/lang/cpp23/narrowing_contextual_conversions_to_bool.md.nolink) | `if constexpr(flags & Flags::Exec)`や`static_assert(N);`を許可 | 9 | 13 | 2022.2 | - | | P2242R3: [定数式内での非リテラル変数の使用を含められないようにする](/lang/cpp23/non_literal_variables_in_constexpr_functions.md.nolink) | 定数式内で静的変数・スレッドローカル変数およびgoto文とラベルを含められない制限を設ける | 12 | 15 | 2022.2 | - | | P2246R1: [静的な診断メッセージの文字エンコーディング](/lang/cpp23/character_encoding_of_diagnostic_text.md.nolink) | `static_assert`や`[[deprecated]]`などの診断メッセージの文字集合に関する要件をなくす | - | yes | - | 2022 | -| P2448R2: [`constexpr`関数のすべての引数が定数実行できない場合でも適格とする](/lang/cpp23/relaxing_some_constexpr_restrictions.md.nolink) | | 13 | 17 (partial) | 2024.0 (partial) | - | +| P2448R2: [`constexpr`関数のすべての引数が定数実行できない場合でも適格とする](/lang/cpp23/relaxing_some_constexpr_restrictions.md) | | 13 | 17 (partial) | 2024.0 (partial) | - | | P2647R1: [`constexpr`関数内での`static constexpr`変数を許可](/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md.nolink) | 13 | - | 16 | 2023.2 | - | | P2564R3: [`constexpr`関数内で`consteval`関数を呼び出せない問題を緩和](/lang/cpp23/consteval_needs_to_propagate_up.md.nolink) | | - | 17 | - | 2024.0 | | P1102R2: [ラムダ式で`()`を省略できる条件を緩和](/lang/cpp23/down_with_lambda_parens.md.nolink) | キャプチャや修飾をともなってもパラメータリストが空であれば`()`を省略できる | 11 | 13 | 2022.2 | - | From 3be882a544ce4f82fbe00bd3411dbc6ec7047f02 Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Fri, 22 Dec 2023 23:39:45 +0900 Subject: [PATCH 0595/3948] feat: update link to non-literal in constexpr --- implementation-status.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/implementation-status.md b/implementation-status.md index 73101a9e61..7b7e235f2d 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -267,7 +267,7 @@ | P2582R1: [継承コンストラクタからのクラステンプレート引数の推論](/lang/cpp23/class_template_argument_deduction_from_inherited.md.nolink) | | - | - | - | - | | P1938R3 : [`if consteval`](/lang/cpp23/if_consteval.md.nolink) | コンパイル時の文脈かどうかで分岐させる | 12 | 14 | - | - | | P1401R5 : [定数式の文脈での`bool`への縮小変換を許可](/lang/cpp23/narrowing_contextual_conversions_to_bool.md.nolink) | `if constexpr(flags & Flags::Exec)`や`static_assert(N);`を許可 | 9 | 13 | 2022.2 | - | -| P2242R3: [定数式内での非リテラル変数の使用を含められないようにする](/lang/cpp23/non_literal_variables_in_constexpr_functions.md.nolink) | 定数式内で静的変数・スレッドローカル変数およびgoto文とラベルを含められない制限を設ける | 12 | 15 | 2022.2 | - | +| P2242R3: [定数式内での非リテラル変数の使用を含められないようにする](/lang/cpp23/non_literal_variables_in_constexpr_functions.md) | 定数式内で静的変数・スレッドローカル変数およびgoto文とラベルを含められない制限を設ける | 12 | 15 | 2022.2 | - | | P2246R1: [静的な診断メッセージの文字エンコーディング](/lang/cpp23/character_encoding_of_diagnostic_text.md.nolink) | `static_assert`や`[[deprecated]]`などの診断メッセージの文字集合に関する要件をなくす | - | yes | - | 2022 | | P2448R2: [`constexpr`関数のすべての引数が定数実行できない場合でも適格とする](/lang/cpp23/relaxing_some_constexpr_restrictions.md.nolink) | | 13 | 17 (partial) | 2024.0 (partial) | - | | P2647R1: [`constexpr`関数内での`static constexpr`変数を許可](/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md.nolink) | 13 | - | 16 | 2023.2 | - | From b10489552b9ffef97a06dd327490cdbf80e6c0fe Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Fri, 22 Dec 2023 23:40:00 +0900 Subject: [PATCH 0596/3948] fix: link to *.md, not *.html --- lang/cpp23/non_literal_variables_inconstexpr_functions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/cpp23/non_literal_variables_inconstexpr_functions.md b/lang/cpp23/non_literal_variables_inconstexpr_functions.md index d2a8d61ea4..10635adbee 100644 --- a/lang/cpp23/non_literal_variables_inconstexpr_functions.md +++ b/lang/cpp23/non_literal_variables_inconstexpr_functions.md @@ -22,8 +22,8 @@ ## 関連項目 -- [C++20 - constexpr関数内でのtry-catchブロックを許可](/lang/cpp20/try-catch_blocks_in_constexpr_functions.html) -- [C++20 - constexpr関数内で未評価のインラインアセンブリを許可することによる組み込み関数のconstexpr有効化](/lang/cpp20/enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.html) +- [C++20 - constexpr関数内でのtry-catchブロックを許可](/lang/cpp20/try-catch_blocks_in_constexpr_functions.md) +- [C++20 - constexpr関数内で未評価のインラインアセンブリを許可することによる組み込み関数のconstexpr有効化](/lang/cpp20/enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.md) - [C++23 - constexpr関数のすべての引数が定数実行できない場合でも適格とする](/lang/cpp23/relaxing_some_constexpr_restrictions.md) ## 参照 From a5815455cf9b2ec2c998a4729c3bb9f5496c37bd Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Fri, 22 Dec 2023 23:43:41 +0900 Subject: [PATCH 0597/3948] fix: filename of non-literal in constexpr funcs --- ...nctions.md => non_literal_variables_in_constexpr_functions.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename lang/cpp23/{non_literal_variables_inconstexpr_functions.md => non_literal_variables_in_constexpr_functions.md} (100%) diff --git a/lang/cpp23/non_literal_variables_inconstexpr_functions.md b/lang/cpp23/non_literal_variables_in_constexpr_functions.md similarity index 100% rename from lang/cpp23/non_literal_variables_inconstexpr_functions.md rename to lang/cpp23/non_literal_variables_in_constexpr_functions.md From 14014b8d983b579517ac6f387f9cc33bd9c5f868 Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Sat, 23 Dec 2023 00:03:58 +0900 Subject: [PATCH 0598/3948] fix: remove a link to a flie that does not exist --- lang/cpp23/non_literal_variables_in_constexpr_functions.md | 1 - 1 file changed, 1 deletion(-) diff --git a/lang/cpp23/non_literal_variables_in_constexpr_functions.md b/lang/cpp23/non_literal_variables_in_constexpr_functions.md index 10635adbee..0f2b682add 100644 --- a/lang/cpp23/non_literal_variables_in_constexpr_functions.md +++ b/lang/cpp23/non_literal_variables_in_constexpr_functions.md @@ -24,7 +24,6 @@ - [C++20 - constexpr関数内でのtry-catchブロックを許可](/lang/cpp20/try-catch_blocks_in_constexpr_functions.md) - [C++20 - constexpr関数内で未評価のインラインアセンブリを許可することによる組み込み関数のconstexpr有効化](/lang/cpp20/enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.md) -- [C++23 - constexpr関数のすべての引数が定数実行できない場合でも適格とする](/lang/cpp23/relaxing_some_constexpr_restrictions.md) ## 参照 From 477414c13645953e2651e62f1bca90fb81ecf9b5 Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Sat, 23 Dec 2023 00:34:19 +0900 Subject: [PATCH 0599/3948] fix: optional::reset is marked constexpr at 23 P2231R1 --- lang/cpp23/relaxing_some_constexpr_restrictions.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lang/cpp23/relaxing_some_constexpr_restrictions.md b/lang/cpp23/relaxing_some_constexpr_restrictions.md index 0c5a236dd0..2e88442647 100644 --- a/lang/cpp23/relaxing_some_constexpr_restrictions.md +++ b/lang/cpp23/relaxing_some_constexpr_restrictions.md @@ -24,10 +24,10 @@ constexpr int g(int x) { return f(x); } // error! fはいかなるxについて しかし、多くの標準ライブラリが`constexpr`対応を進めていくようになり、状況が変化した。 -例えば、`std::optional`の`reset`メンバメソッドが`constexpr`に対応するのはC++20以降である。 +例えば、`std::optional`の`reset`メンバメソッドが`constexpr`に対応するのはC++23以降である。 これは`std::optional`の内部実装が`union`のアクティブメンバを更新しているからであり、[これを定数式内で実行するにはC++20を待たねばならなかった](https://cpprefjp.github.io/lang/cpp20/changing_the_active_member_of_a_union_inside_constexpr.html)。 -よって、以下のコードはC++17では不適格だが、C++20では正しいコードとなる。 +よって、以下のコードはC++17では不適格だが、C++23では正しいコードとなる。 ```cpp template @@ -38,17 +38,17 @@ constexpr void f(std::optional& opt) ``` これを正しく記述するには、`constexpr`指定をするかどうかをマクロで変更しなければならない。 -例えばC++20から`constexpr`になる関数群に対して以下のようなマクロを使うか、 +例えばC++23から`constexpr`になる関数群に対して以下のようなマクロを使うか、 ```cpp -#if __cplusplus >= 202002L -# define MYLIB_CXX20_CONSTEXPR constexpr +#if __cplusplus >= 202300L // 具体的な値は未定 +# define MYLIB_CXX23_CONSTEXPR constexpr #else -# define MYLIB_CXX20_CONSTEXPR +# define MYLIB_CXX23_CONSTEXPR #endif template -MYLIB_CXX20_CONSTEXPR void f(std::optional& opt) +MYLIB_CXX23_CONSTEXPR void f(std::optional& opt) { opt.reset(); } From a38076e28a26e15cbc9cef3c6ef3b1d75ed1689b Mon Sep 17 00:00:00 2001 From: Toru Niina Date: Sat, 23 Dec 2023 20:07:56 +0900 Subject: [PATCH 0600/3948] fix: use markdown link, not a url Co-authored-by: Akira Takahashi --- lang/cpp23/relaxing_some_constexpr_restrictions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp23/relaxing_some_constexpr_restrictions.md b/lang/cpp23/relaxing_some_constexpr_restrictions.md index 2e88442647..cade4983e8 100644 --- a/lang/cpp23/relaxing_some_constexpr_restrictions.md +++ b/lang/cpp23/relaxing_some_constexpr_restrictions.md @@ -96,7 +96,7 @@ void f(std::optional& opt) `constexpr`指定された、`=delete`指定されていないコンストラクタが満たすべき条件を緩和する。 - 非静的メンバ変数のコンストラクタは`constexpr`でなくともよい -- [委譲コンストラクタ](https://cpprefjp.github.io/lang/cpp11/delegating_constructors.html)の場合、委譲先のコンストラクタが`constexpr`でなくともよい +- [委譲コンストラクタ](/lang/cpp11/delegating_constructors.md)の場合、委譲先のコンストラクタが`constexpr`でなくともよい `constexpr`指定された、`=delete`指定されていないデストラクタが満たすべき条件を緩和する。 From d2f578342035821a9ef6d2168da588ea5e526457 Mon Sep 17 00:00:00 2001 From: Toru Niina Date: Sat, 23 Dec 2023 20:08:03 +0900 Subject: [PATCH 0601/3948] fix: use markdown link, not a url Co-authored-by: Akira Takahashi --- lang/cpp23/relaxing_some_constexpr_restrictions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp23/relaxing_some_constexpr_restrictions.md b/lang/cpp23/relaxing_some_constexpr_restrictions.md index cade4983e8..f0a550b879 100644 --- a/lang/cpp23/relaxing_some_constexpr_restrictions.md +++ b/lang/cpp23/relaxing_some_constexpr_restrictions.md @@ -73,7 +73,7 @@ void f(std::optional& opt) `constexpr`指定を行わないことによってもこの問題は回避できるが、自身以外のユーザーが存在するライブラリの場合は`constexpr`対応が望まれる可能性があり、その場合はこの問題に対処する必要が生じる。 多くの場合、標準ライブラリ関数が`constexpr`指定されるのは、その機能が定数式実行可能になったバージョンよりも遅れる。 -例えば、`std::array`の`operator[]`の非`const`版が`constexpr`指定されるのは、定数式内で変数の変更が許可されるC++14ではなく、その次のC++17である([参考](https://cpprefjp.github.io/reference/array/array/op_at.html))。 +例えば、`std::array`の`operator[]`の非`const`版が`constexpr`指定されるのは、定数式内で変数の変更が許可されるC++14ではなく、その次のC++17である([参考](/reference/array/array/op_at.md))。 このような状況では上記のような解決策を用いてもミスを避けることは容易ではない。 現在、登場時点では定数式内で実行できなかったために`constexpr`されていなかった多くの標準ライブラリ関数が、のちにコア言語機能が追加されて`constexpr`指定されている。 From bdfe3511d148add8f915b86c36aec9e9ce6b471a Mon Sep 17 00:00:00 2001 From: Toru Niina Date: Sat, 23 Dec 2023 20:08:26 +0900 Subject: [PATCH 0602/3948] fix: use markdown link, not a url Co-authored-by: Akira Takahashi --- lang/cpp23/relaxing_some_constexpr_restrictions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp23/relaxing_some_constexpr_restrictions.md b/lang/cpp23/relaxing_some_constexpr_restrictions.md index f0a550b879..590fdb8511 100644 --- a/lang/cpp23/relaxing_some_constexpr_restrictions.md +++ b/lang/cpp23/relaxing_some_constexpr_restrictions.md @@ -25,7 +25,7 @@ constexpr int g(int x) { return f(x); } // error! fはいかなるxについて しかし、多くの標準ライブラリが`constexpr`対応を進めていくようになり、状況が変化した。 例えば、`std::optional`の`reset`メンバメソッドが`constexpr`に対応するのはC++23以降である。 -これは`std::optional`の内部実装が`union`のアクティブメンバを更新しているからであり、[これを定数式内で実行するにはC++20を待たねばならなかった](https://cpprefjp.github.io/lang/cpp20/changing_the_active_member_of_a_union_inside_constexpr.html)。 +これは`std::optional`の内部実装が`union`のアクティブメンバを更新しているからであり、[これを定数式内で実行するにはC++20を待たねばならなかった](/lang/cpp20/changing_the_active_member_of_a_union_inside_constexpr.md)。 よって、以下のコードはC++17では不適格だが、C++23では正しいコードとなる。 From 38df1313e8baf6b2c781e0d3553b38f56d3cbb8a Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Sat, 23 Dec 2023 20:09:58 +0900 Subject: [PATCH 0603/3948] feat: update title of c++23 non-literal constexpr --- implementation-status.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/implementation-status.md b/implementation-status.md index 7b7e235f2d..ec321416ea 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -267,7 +267,7 @@ | P2582R1: [継承コンストラクタからのクラステンプレート引数の推論](/lang/cpp23/class_template_argument_deduction_from_inherited.md.nolink) | | - | - | - | - | | P1938R3 : [`if consteval`](/lang/cpp23/if_consteval.md.nolink) | コンパイル時の文脈かどうかで分岐させる | 12 | 14 | - | - | | P1401R5 : [定数式の文脈での`bool`への縮小変換を許可](/lang/cpp23/narrowing_contextual_conversions_to_bool.md.nolink) | `if constexpr(flags & Flags::Exec)`や`static_assert(N);`を許可 | 9 | 13 | 2022.2 | - | -| P2242R3: [定数式内での非リテラル変数の使用を含められないようにする](/lang/cpp23/non_literal_variables_in_constexpr_functions.md) | 定数式内で静的変数・スレッドローカル変数およびgoto文とラベルを含められない制限を設ける | 12 | 15 | 2022.2 | - | +| P2242R3: [定数式内での非リテラル変数、静的変数・スレッドローカル変数およびgotoとラベルの存在を許可する](/lang/cpp23/non_literal_variables_in_constexpr_functions.md) | 定数式内で静的変数・スレッドローカル変数およびgoto文とラベルを含められない制限を設ける | 12 | 15 | 2022.2 | - | | P2246R1: [静的な診断メッセージの文字エンコーディング](/lang/cpp23/character_encoding_of_diagnostic_text.md.nolink) | `static_assert`や`[[deprecated]]`などの診断メッセージの文字集合に関する要件をなくす | - | yes | - | 2022 | | P2448R2: [`constexpr`関数のすべての引数が定数実行できない場合でも適格とする](/lang/cpp23/relaxing_some_constexpr_restrictions.md.nolink) | | 13 | 17 (partial) | 2024.0 (partial) | - | | P2647R1: [`constexpr`関数内での`static constexpr`変数を許可](/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md.nolink) | 13 | - | 16 | 2023.2 | - | From 08b2c517ec7e74e9e41a3ff36e2b44c278a7074d Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Sat, 23 Dec 2023 20:10:42 +0900 Subject: [PATCH 0604/3948] refactor: remove needless whitespaces --- implementation-status.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/implementation-status.md b/implementation-status.md index ec321416ea..2b7e2d0619 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -259,14 +259,14 @@ | P1847R4: [アクセス制御の異なるメンバ変数のレイアウトを宣言順に規定](/lang/cpp23/make_declaration_order_layout_mandated.md.nolink) | アクセス制御の異なるメンバ変数のレイアウトが実装によって異なっていたため仕様を規定 | Yes | Yes | - | 2022 | | P2128R6: [添字演算子の多次元サポート](/lang/cpp23/multidimensional_subscript_operator.nd.nolink) | `operator[](int x, int y, int z)`のように添字演算子のオーバーロードで複数のパラメータをとることを許可 | 12 | 15 | 2022.2 | - | | P1169R4: [`this`ポインタをもつ必要のない演算子を`static`として宣言できるようにする](/lang/cpp23/static_operator.md.nolink) | | 13 | 16 | 2023.2 | - | -| P2201R1 : [異なる文字エンコーディングをもつ文字列リテラルの連結を不適格とする](/lang/cpp23/mixed_string_literal_concatenation.md.nolink) | `auto a = u8"" L"";`のような異なる文字エンコーディング同士での文字列リテラルを連結を禁止する | Yes | Yes | 2022.2 | Yes | +| P2201R1: [異なる文字エンコーディングをもつ文字列リテラルの連結を不適格とする](/lang/cpp23/mixed_string_literal_concatenation.md.nolink) | `auto a = u8"" L"";`のような異なる文字エンコーディング同士での文字列リテラルを連結を禁止する | Yes | Yes | 2022.2 | Yes | | P2029R4: [文字・文字列リテラル中の数値・ユニバーサルキャラクタのエスケープに関する問題解決](/lang/cpp23/numeric_and_universal_character_escapes_in_character_and_string_literals.md.nolink) | | - | - | - | - | | P2362R3: [1ワイド文字に収まらないワイド文字リテラルを禁止する](/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md.nolink) | エンコード結果として`wchar_t`の大きさに収まらないワイド文字リテラルを禁止する | 13 | 14 | 2023.2 | - | | P2071R2: [名前付きユニバーサルキャラクタ名](/lang/cpp23/named_universal_character_escapes.md.nolink) | 16進数のユニバーサルキャラクタだけでなく、その文字の名前を入力できるようにする | 13 | 15 | 2023.2 | - | | P2096R2: [部分特殊化の汎用化仕様](/lang/cpp23/generalized_wording_for_partial_specializations.md.nolink) | 変数テンプレートの部分特殊化を許可するために部分特殊化の仕様を汎用化 | - | - | - | - | | P2582R1: [継承コンストラクタからのクラステンプレート引数の推論](/lang/cpp23/class_template_argument_deduction_from_inherited.md.nolink) | | - | - | - | - | -| P1938R3 : [`if consteval`](/lang/cpp23/if_consteval.md.nolink) | コンパイル時の文脈かどうかで分岐させる | 12 | 14 | - | - | -| P1401R5 : [定数式の文脈での`bool`への縮小変換を許可](/lang/cpp23/narrowing_contextual_conversions_to_bool.md.nolink) | `if constexpr(flags & Flags::Exec)`や`static_assert(N);`を許可 | 9 | 13 | 2022.2 | - | +| P1938R3: [`if consteval`](/lang/cpp23/if_consteval.md.nolink) | コンパイル時の文脈かどうかで分岐させる | 12 | 14 | - | - | +| P1401R5: [定数式の文脈での`bool`への縮小変換を許可](/lang/cpp23/narrowing_contextual_conversions_to_bool.md.nolink) | `if constexpr(flags & Flags::Exec)`や`static_assert(N);`を許可 | 9 | 13 | 2022.2 | - | | P2242R3: [定数式内での非リテラル変数、静的変数・スレッドローカル変数およびgotoとラベルの存在を許可する](/lang/cpp23/non_literal_variables_in_constexpr_functions.md) | 定数式内で静的変数・スレッドローカル変数およびgoto文とラベルを含められない制限を設ける | 12 | 15 | 2022.2 | - | | P2246R1: [静的な診断メッセージの文字エンコーディング](/lang/cpp23/character_encoding_of_diagnostic_text.md.nolink) | `static_assert`や`[[deprecated]]`などの診断メッセージの文字集合に関する要件をなくす | - | yes | - | 2022 | | P2448R2: [`constexpr`関数のすべての引数が定数実行できない場合でも適格とする](/lang/cpp23/relaxing_some_constexpr_restrictions.md.nolink) | | 13 | 17 (partial) | 2024.0 (partial) | - | From 2a0706c9f19273fdbdb1fd52014ac1af7a4b4de8 Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Sat, 23 Dec 2023 20:30:17 +0900 Subject: [PATCH 0605/3948] feat: mark std::optional member methods constexpr --- reference/optional/optional/emplace.md | 8 ++++-- reference/optional/optional/op_assign.md | 23 ++++++++++----- reference/optional/optional/op_constructor.md | 28 +++++++++++-------- reference/optional/optional/op_destructor.md | 3 +- reference/optional/optional/reset.md | 3 +- reference/optional/optional/swap.md | 3 +- reference/optional/optional/swap_free.md | 4 ++- 7 files changed, 47 insertions(+), 25 deletions(-) diff --git a/reference/optional/optional/emplace.md b/reference/optional/optional/emplace.md index 23aa12b988..49f3f7136d 100644 --- a/reference/optional/optional/emplace.md +++ b/reference/optional/optional/emplace.md @@ -7,10 +7,14 @@ ```cpp template -T& emplace(Args&&... args); // (1) +T& emplace(Args&&... args); // (1) C++17 +template +constexpr T& emplace(Args&&... args); // (1) C++23 template -T& emplace(std::initializer_list il, Args&&... args); // (2) +T& emplace(std::initializer_list il, Args&&... args); // (2) C++17 +template +constexpr T& emplace(std::initializer_list il, Args&&... args); // (2) C++23 ``` ## 概要 diff --git a/reference/optional/optional/op_assign.md b/reference/optional/optional/op_assign.md index 35b9156763..aff7c876f2 100644 --- a/reference/optional/optional/op_assign.md +++ b/reference/optional/optional/op_assign.md @@ -6,20 +6,29 @@ * cpp17[meta cpp] ```cpp -optional& operator=(nullopt_t rhs) noexcept; // (1) +optional& operator=(nullopt_t rhs) noexcept; // (1) C++17 +constexpr optional& operator=(nullopt_t rhs) noexcept; // (1) C++23 -optional& operator=(const optional& rhs); // (2) +optional& operator=(const optional& rhs); // (2) C++17 +constexpr optional& operator=(const optional& rhs); // (2) C++20 -optional& operator=(optional&& rhs) noexcept(see below); // (3) +optional& operator=(optional&& rhs) noexcept(see below); // (3) C++17 +constexpr optional& operator=(optional&& rhs) noexcept(see below); // (3) C++20 template -optional& operator=(U&& rhs); // (4) +optional& operator=(U&& rhs); // (4) C++17 +template +constexpr optional& operator=(U&& rhs); // (4) C++23 template -optional& operator=(const optional& rhs); // (5) +optional& operator=(const optional& rhs); // (5) C++17 +template +constexpr optional& operator=(const optional& rhs); // (5) C++23 template -optional& operator=(optional&& rhs); // (6) +optional& operator=(optional&& rhs); // (6) C++17 +template +constexpr optional& operator=(optional&& rhs); // (6) C++23 ``` * see below[italic] * nullopt_t[link /reference/optional/nullopt_t.md] @@ -170,4 +179,4 @@ int main() ## 参照 - [LWG Issue 2756. `optional` should `forward` `T`'s implicit conversions](https://wg21.cmeerw.net/lwg/issue2756) -- [P0602R4 `variant` and `optional` should propagate copy/move triviality](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0602r4.html) \ No newline at end of file +- [P0602R4 `variant` and `optional` should propagate copy/move triviality](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0602r4.html) diff --git a/reference/optional/optional/op_constructor.md b/reference/optional/optional/op_constructor.md index 13af1f5648..a7c32f8822 100644 --- a/reference/optional/optional/op_constructor.md +++ b/reference/optional/optional/op_constructor.md @@ -6,34 +6,38 @@ * cpp17[meta cpp] ```cpp -constexpr optional() noexcept; // (1) C++17 -constexpr optional(nullopt_t) noexcept; // (2) C++17 -constexpr optional(const optional& rhs); // (3) C++17 -constexpr optional(optional&& rhs) noexcept(see below); // (4) C++17 +constexpr optional() noexcept; // (1) C++17 +constexpr optional(nullopt_t) noexcept; // (2) C++17 +constexpr optional(const optional& rhs); // (3) C++17 +constexpr optional(optional&& rhs) noexcept(see below); // (4) C++17 template -constexpr explicit optional(in_place_t, Args&&... args); // (5) C++17 +constexpr explicit optional(in_place_t, Args&&... args); // (5) C++17 template constexpr explicit optional( in_place_t, initializer_list il, - Args&&... args); // (6) C++17 + Args&&... args); // (6) C++17 template -EXPLICIT constexpr optional(U&& rhs); // (7) C++17 +EXPLICIT constexpr optional(U&& rhs); // (7) C++17 template -explicit(see below) constexpr optional(U&& rhs); // (7) C++20 +explicit(see below) constexpr optional(U&& rhs); // (7) C++20 template -EXPLICIT optional(const optional& rhs); // (8) C++17 +EXPLICIT optional(const optional& rhs); // (8) C++17 template -explicit(see below) optional(const optional& rhs); // (8) C++20 +explicit(see below) optional(const optional& rhs); // (8) C++20 +template +explicit(see below) constexpr optional(const optional& rhs); // (8) C++23 template -EXPLICIT optional(optional&& rhs); // (9) C++17 +EXPLICIT optional(optional&& rhs); // (9) C++17 +template +explicit(see below) optional(optional&& rhs); // (9) C++20 template -explicit(see below) optional(optional&& rhs); // (9) C++20 +explicit(see below) constexpr optional(optional&& rhs); // (9) C++23 ``` * see below[italic] * EXPLICIT[italic] diff --git a/reference/optional/optional/op_destructor.md b/reference/optional/optional/op_destructor.md index e0171f5ef6..d81a0cf73d 100644 --- a/reference/optional/optional/op_destructor.md +++ b/reference/optional/optional/op_destructor.md @@ -6,7 +6,8 @@ * cpp17[meta cpp] ```cpp -~optional(); +~optional(); // C++17 +constexpr ~optional(); // C++23 ``` ## 概要 diff --git a/reference/optional/optional/reset.md b/reference/optional/optional/reset.md index 8e4ac21413..0f982a0a44 100644 --- a/reference/optional/optional/reset.md +++ b/reference/optional/optional/reset.md @@ -6,7 +6,8 @@ * cpp17[meta cpp] ```cpp -void reset() noexcept; +void reset() noexcept; // (1) C++17 +constexpr void reset() noexcept; // (1) C++23 ``` ## 概要 diff --git a/reference/optional/optional/swap.md b/reference/optional/optional/swap.md index ccf0d05a0a..d5e1c11bf6 100644 --- a/reference/optional/optional/swap.md +++ b/reference/optional/optional/swap.md @@ -6,7 +6,8 @@ * cpp17[meta cpp] ```cpp -void swap(optional& rhs) noexcept(see below); +void swap(optional& rhs) noexcept(see below); // C++17 +constexpr void swap(optional& rhs) noexcept(see below); // C++23 ``` * see below[italic] diff --git a/reference/optional/optional/swap_free.md b/reference/optional/optional/swap_free.md index 866f11ed5d..0e3382fe51 100644 --- a/reference/optional/optional/swap_free.md +++ b/reference/optional/optional/swap_free.md @@ -7,7 +7,9 @@ ```cpp namespace std { template - void swap(optional& x, optional& y) noexcept(noexcept(x.swap(y))); + void swap(optional& x, optional& y) noexcept(noexcept(x.swap(y))); // C++17 + template + constexpr void swap(optional& x, optional& y) noexcept(noexcept(x.swap(y))); // C++23 } ``` * x.swap(y)[link swap.md] From 2284db9ee66e01d666cb2e01bd3fa120549d963e Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Sat, 23 Dec 2023 20:40:21 +0900 Subject: [PATCH 0606/3948] feat: add link to C++23 constexpr conditions --- reference/optional/optional/emplace.md | 1 + reference/optional/optional/op_assign.md | 1 + reference/optional/optional/op_constructor.md | 1 + reference/optional/optional/op_destructor.md | 1 + reference/optional/optional/reset.md | 1 + reference/optional/optional/swap.md | 1 + reference/optional/optional/swap_free.md | 3 +++ 7 files changed, 9 insertions(+) diff --git a/reference/optional/optional/emplace.md b/reference/optional/optional/emplace.md index 49f3f7136d..35d5406d60 100644 --- a/reference/optional/optional/emplace.md +++ b/reference/optional/optional/emplace.md @@ -113,3 +113,4 @@ int main() - [N3406 A proposal to add a utility class to represent optional objects (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3406.html) - [LWG Issue 2857. {`variant`,`optional`,`any`}`::emplace` should return the constructed value](https://wg21.cmeerw.net/lwg/issue2857) - [P0084R2 Emplace Return Type (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0084r2.pdf) +- [P2231R1 Missing `constexpr` in `std::optional` and `std::variant`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2231r1.html) diff --git a/reference/optional/optional/op_assign.md b/reference/optional/optional/op_assign.md index aff7c876f2..68749dd030 100644 --- a/reference/optional/optional/op_assign.md +++ b/reference/optional/optional/op_assign.md @@ -180,3 +180,4 @@ int main() ## 参照 - [LWG Issue 2756. `optional` should `forward` `T`'s implicit conversions](https://wg21.cmeerw.net/lwg/issue2756) - [P0602R4 `variant` and `optional` should propagate copy/move triviality](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0602r4.html) +- [P2231R1 Missing `constexpr` in `std::optional` and `std::variant`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2231r1.html) diff --git a/reference/optional/optional/op_constructor.md b/reference/optional/optional/op_constructor.md index a7c32f8822..f5e34ceda0 100644 --- a/reference/optional/optional/op_constructor.md +++ b/reference/optional/optional/op_constructor.md @@ -231,3 +231,4 @@ int main() - [P0892R2 `explicit(bool)`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0892r2.html) - C++20での`explicit(bool)`構文への対応 - [P0602R4 `variant` and `optional` should propagate copy/move triviality](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0602r4.html) +- [P2231R1 Missing `constexpr` in `std::optional` and `std::variant`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2231r1.html) diff --git a/reference/optional/optional/op_destructor.md b/reference/optional/optional/op_destructor.md index d81a0cf73d..94c1610c10 100644 --- a/reference/optional/optional/op_destructor.md +++ b/reference/optional/optional/op_destructor.md @@ -71,3 +71,4 @@ int main() ## 関連項目 - [`std::vector`クラスのデストラクタ](/reference/vector/vector/op_destructor.md) - [`std::is_trivially_destructible`](/reference/type_traits/is_trivially_destructible.md) +- [P2231R1 Missing `constexpr` in `std::optional` and `std::variant`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2231r1.html) diff --git a/reference/optional/optional/reset.md b/reference/optional/optional/reset.md index 0f982a0a44..60017468d2 100644 --- a/reference/optional/optional/reset.md +++ b/reference/optional/optional/reset.md @@ -63,3 +63,4 @@ int main() ## 関連項目 - [`std::vector`クラスのデストラクタ](/reference/vector/vector/op_destructor.md) - [`std::is_trivially_destructible`](/reference/type_traits/is_trivially_destructible.md) +- [P2231R1 Missing `constexpr` in `std::optional` and `std::variant`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2231r1.html) diff --git a/reference/optional/optional/swap.md b/reference/optional/optional/swap.md index d5e1c11bf6..fafdbb56e9 100644 --- a/reference/optional/optional/swap.md +++ b/reference/optional/optional/swap.md @@ -122,3 +122,4 @@ int main() ## 参照 - [LWG Issue 2748. swappable traits for `optional`s](https://wg21.cmeerw.net/lwg/issue2748) +- [P2231R1 Missing `constexpr` in `std::optional` and `std::variant`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2231r1.html) diff --git a/reference/optional/optional/swap_free.md b/reference/optional/optional/swap_free.md index 0e3382fe51..e5d4506492 100644 --- a/reference/optional/optional/swap_free.md +++ b/reference/optional/optional/swap_free.md @@ -108,3 +108,6 @@ int main() - [GCC](/implementation.md#gcc): 7.2 - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P2231R1 Missing `constexpr` in `std::optional` and `std::variant`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2231r1.html) From 46c5224ef26c695010398f4cd83a9f760c93f367 Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Sat, 23 Dec 2023 22:26:49 +0900 Subject: [PATCH 0607/3948] fix: change wording --- lang/cpp23/relaxing_some_constexpr_restrictions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp23/relaxing_some_constexpr_restrictions.md b/lang/cpp23/relaxing_some_constexpr_restrictions.md index 590fdb8511..94fce590ca 100644 --- a/lang/cpp23/relaxing_some_constexpr_restrictions.md +++ b/lang/cpp23/relaxing_some_constexpr_restrictions.md @@ -16,7 +16,7 @@ ```cpp int f(int x) { return x + 1; } -constexpr int g(int x) { return f(x); } // error! fはいかなるxについても定数式実行不能 +constexpr int g(int x) { return f(x); } // error! fはいかなるxについても定数式実行不可能 ``` `g`は`constexpr`でない関数`f`を呼び出すため、プログラムの中で実際に`g`が定数式実行されない場合であっても、このコードは不適格である。 From f96627ba91a9a741923abd3fb82cea5a6d18384b Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Sat, 23 Dec 2023 23:38:47 +0900 Subject: [PATCH 0608/3948] fix: change wording about condition --- lang/cpp23/relaxing_some_constexpr_restrictions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/cpp23/relaxing_some_constexpr_restrictions.md b/lang/cpp23/relaxing_some_constexpr_restrictions.md index 94fce590ca..392ebaffb5 100644 --- a/lang/cpp23/relaxing_some_constexpr_restrictions.md +++ b/lang/cpp23/relaxing_some_constexpr_restrictions.md @@ -90,8 +90,8 @@ void f(std::optional& opt) - 関数の返り値は`literal`型でなくともよい。 - 関数の引数はどれも`literal`型でなくともよい。 -- その関数が定数式実行可能になるような引数が存在する必要はない。 -- 定数式実行可能になるような`template`引数が存在する必要はない。 +- いかなる引数が与えられても定数式実行不可能でもよい +- いかなる`template`引数が与えられても定数式実行不可能でもよい `constexpr`指定された、`=delete`指定されていないコンストラクタが満たすべき条件を緩和する。 From 0637fa2ef4cbf7887237cd3514a6a53618de9a3d Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Fri, 29 Dec 2023 19:31:32 +0900 Subject: [PATCH 0609/3948] =?UTF-8?q?feat:=20=E5=BC=95=E6=95=B0=20->=20?= =?UTF-8?q?=E5=AE=9F=E5=BC=95=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23/relaxing_some_constexpr_restrictions.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lang/cpp23/relaxing_some_constexpr_restrictions.md b/lang/cpp23/relaxing_some_constexpr_restrictions.md index 392ebaffb5..12c4ae98ce 100644 --- a/lang/cpp23/relaxing_some_constexpr_restrictions.md +++ b/lang/cpp23/relaxing_some_constexpr_restrictions.md @@ -9,7 +9,7 @@ ## この機能が必要になった背景・経緯 -これまでは、いかなる引数での呼び出しでも定数式実行できない`constexpr`関数が存在するだけでプログラムは不適格になっていた。 +これまでは、いかなる実引数での呼び出しでも定数式実行できない`constexpr`関数が存在するだけでプログラムは不適格になっていた。 例えば以下のような場合である。 @@ -89,9 +89,9 @@ void f(std::optional& opt) `constexpr`指定された関数が満たすべき条件を緩和する。 - 関数の返り値は`literal`型でなくともよい。 -- 関数の引数はどれも`literal`型でなくともよい。 -- いかなる引数が与えられても定数式実行不可能でもよい -- いかなる`template`引数が与えられても定数式実行不可能でもよい +- 関数の実引数はどれも`literal`型でなくともよい。 +- いかなる実引数が与えられても定数式実行不可能でもよい +- いかなる`template`実引数が与えられても定数式実行不可能でもよい `constexpr`指定された、`=delete`指定されていないコンストラクタが満たすべき条件を緩和する。 From 779fab6fd7d73310d02e81cc2b9b085b4918ad56 Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Fri, 29 Dec 2023 19:33:47 +0900 Subject: [PATCH 0610/3948] feat: change title to focus on func body MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit constexpr関数に与えられる実引数だけではなく、定数式実行できず 避けることもできないコードパスの存在を許すという変更であるため --- implementation-status.md | 2 +- lang/cpp23.md | 2 +- lang/cpp23/relaxing_some_constexpr_restrictions.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/implementation-status.md b/implementation-status.md index cae458346d..97a45e0032 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -269,7 +269,7 @@ | P1401R5 : [定数式の文脈での`bool`への縮小変換を許可](/lang/cpp23/narrowing_contextual_conversions_to_bool.md.nolink) | `if constexpr(flags & Flags::Exec)`や`static_assert(N);`を許可 | 9 | 13 | 2022.2 | - | | P2242R3: [定数式内での非リテラル変数の使用を含められないようにする](/lang/cpp23/non_literal_variables_in_constexpr_functions.md.nolink) | 定数式内で静的変数・スレッドローカル変数およびgoto文とラベルを含められない制限を設ける | 12 | 15 | 2022.2 | - | | P2246R1: [静的な診断メッセージの文字エンコーディング](/lang/cpp23/character_encoding_of_diagnostic_text.md.nolink) | `static_assert`や`[[deprecated]]`などの診断メッセージの文字集合に関する要件をなくす | - | yes | - | 2022 | -| P2448R2: [`constexpr`関数のすべての引数が定数実行できない場合でも適格とする](/lang/cpp23/relaxing_some_constexpr_restrictions.md) | | 13 | 17 (partial) | 2024.0 (partial) | - | +| P2448R2: [`constexpr`関数が定数実行できない場合でも適格とする](/lang/cpp23/relaxing_some_constexpr_restrictions.md) | | 13 | 17 (partial) | 2024.0 (partial) | - | | P2647R1: [`constexpr`関数内での`static constexpr`変数を許可](/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md.nolink) | 13 | - | 16 | 2023.2 | - | | P2564R3: [`constexpr`関数内で`consteval`関数を呼び出せない問題を緩和](/lang/cpp23/consteval_needs_to_propagate_up.md.nolink) | | - | 17 | - | 2024.0 | | P1102R2: [ラムダ式で`()`を省略できる条件を緩和](/lang/cpp23/down_with_lambda_parens.md.nolink) | キャプチャや修飾をともなってもパラメータリストが空であれば`()`を省略できる | 11 | 13 | 2022.2 | - | diff --git a/lang/cpp23.md b/lang/cpp23.md index a9389f2e4e..929049f321 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -71,7 +71,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 | [定数式の文脈での`bool`への縮小変換を許可](cpp23/narrowing_contextual_conversions_to_bool.md.nolink) | `if constexpr(flags & Flags::Exec)`や`static_assert(N);`を許可 | | [定数式内での非リテラル変数の使用を含められないようにする](cpp23/non_literal_variables_in_constexpr_functions.md.nolink) | 定数式内で静的変数・スレッドローカル変数およびgoto文とラベルを含められない制限を設ける | | [静的な診断メッセージの文字エンコーディング](cpp23/character_encoding_of_diagnostic_text.md.nolink) | `static_assert`や`[[deprecated]]`などの診断メッセージの文字集合に関する要件をなくす | -| [`constexpr`関数のすべての引数が定数実行できない場合でも適格とする](cpp23/relaxing_some_constexpr_restrictions.md) | 定数式実行できない関数であっても、実際にコンパイル時に評価されない限り`constexpr`指定することを許可する | +| [`constexpr`関数が定数実行できない場合でも適格とする](cpp23/relaxing_some_constexpr_restrictions.md) | 定数式実行できない関数であっても、実際にコンパイル時に評価されない限り`constexpr`指定することを許可する | | [`constexpr`関数内での`static constexpr`変数を許可](cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md.nolink) | | | [`constexpr`関数内で`consteval`関数を呼び出せない問題を緩和](cpp23/consteval_needs_to_propagate_up.md.nolink) | | diff --git a/lang/cpp23/relaxing_some_constexpr_restrictions.md b/lang/cpp23/relaxing_some_constexpr_restrictions.md index 12c4ae98ce..254dec4eba 100644 --- a/lang/cpp23/relaxing_some_constexpr_restrictions.md +++ b/lang/cpp23/relaxing_some_constexpr_restrictions.md @@ -1,4 +1,4 @@ -# constexpr関数のすべての引数が定数実行できない場合でも適格とする +# constexpr関数が定数実行できない場合でも適格とする * cpp23[meta cpp] ## 概要 From 04ff4ade9e1f9c18ec95cc7a9b3711812f0180f9 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sat, 30 Dec 2023 00:18:18 +0900 Subject: [PATCH 0611/3948] fix expression of extract() of multimap and multiset --- reference/map/multimap/extract.md | 2 +- reference/set/multiset/extract.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/map/multimap/extract.md b/reference/map/multimap/extract.md index 280b5cee4e..a4fd6d89ec 100644 --- a/reference/map/multimap/extract.md +++ b/reference/map/multimap/extract.md @@ -18,7 +18,7 @@ node_type extract(K&& x); // (3) C++23 指定された要素を`*this`から切り離し、その要素を所有する[ノードハンドル](/reference/node_handle/node_handle.md)を取得する。 - (1) : `position`が指すノードを切り離す -- (2) : `x`と等価なキーをもつノードをすべて切り離す +- (2) : `x`と等価なキーをもつノードを切り離す - (3) : `key_type`と比較可能な`x`と等価なキーをもつノードをすべて切り離す diff --git a/reference/set/multiset/extract.md b/reference/set/multiset/extract.md index 960f6ac4ed..84ab53b629 100644 --- a/reference/set/multiset/extract.md +++ b/reference/set/multiset/extract.md @@ -18,7 +18,7 @@ node_type extract(K&& x); // (3) C++23 指定された要素を`*this`から切り離し、その要素を所有する[ノードハンドル](/reference/node_handle/node_handle.md)を取得する。 - (1) : `position`が指すノードを切り離す -- (2) : `x`と等価なキーをもつノードをすべて切り離す +- (2) : `x`と等価なキーをもつノードを切り離す - (3) : `key_type`と比較可能な`x`と等価なキーをもつノードをすべて切り離す From 6b3f0cbc936ee694601043dffe4d1fa6272a6cba Mon Sep 17 00:00:00 2001 From: suomesta Date: Sat, 30 Dec 2023 01:05:52 +0900 Subject: [PATCH 0612/3948] fix some minor typo --- reference/deque/deque/assign.md | 2 +- reference/deque/deque/op_assign.md | 4 ++-- reference/map/map/insert.md | 4 ++-- reference/map/map/op_assign.md | 6 +++--- reference/map/multimap.md | 2 +- reference/map/multimap/insert.md | 2 +- reference/map/multimap/op_assign.md | 6 +++--- reference/memory/make_shared.md | 2 +- reference/node_handle/node_handle.md | 12 ++++++------ reference/node_handle/node_handle/empty.md | 2 +- reference/node_handle/node_handle/get_allocator.md | 4 +--- reference/node_handle/node_handle/key.md | 2 +- reference/node_handle/node_handle/mapped.md | 2 +- reference/node_handle/node_handle/op_assign.md | 3 ++- reference/node_handle/node_handle/op_bool.md | 2 +- reference/node_handle/node_handle/op_constructor.md | 3 ++- reference/node_handle/node_handle/op_destructor.md | 4 +--- reference/node_handle/node_handle/swap.md | 2 +- reference/node_handle/node_handle/swap_free.md | 2 +- reference/node_handle/node_handle/value.md | 2 +- reference/set/multiset/insert.md | 2 +- reference/set/multiset/op_assign.md | 4 ++-- reference/set/set/insert.md | 4 ++-- reference/set/set/op_assign.md | 4 ++-- reference/string/basic_string/assign.md | 4 ++-- reference/unordered_map/unordered_map/insert.md | 2 +- reference/unordered_map/unordered_multimap/insert.md | 2 +- reference/unordered_set/unordered_multiset/insert.md | 2 +- reference/unordered_set/unordered_set/count.md | 2 +- reference/unordered_set/unordered_set/extract.md | 2 +- reference/unordered_set/unordered_set/insert.md | 2 +- reference/vector/vector/assign.md | 12 ++++++------ reference/vector/vector/op_assign.md | 8 ++++---- 33 files changed, 58 insertions(+), 60 deletions(-) diff --git a/reference/deque/deque/assign.md b/reference/deque/deque/assign.md index 21c062e0d9..e69c1c85fb 100644 --- a/reference/deque/deque/assign.md +++ b/reference/deque/deque/assign.md @@ -21,7 +21,7 @@ void assign(initializer_list init); // (3) C++11 ## 効果 - (1) : `*this`の全ての要素を解放し、イテレータ範囲`[first, last)`の要素のコピーを`*this`にコピーする。 - (2) : `*this`の全ての要素が解放され、`t`オブジェクトの`n`個のコピーから`*this`を再構築する。 -- (3) : `*this`の全ての要素を解放し、`x`の全ての要素を`*this`にコピーする。 +- (3) : `*this`の全ての要素を解放し、`init`の全ての要素を`*this`にコピーする。 ## 例 diff --git a/reference/deque/deque/op_assign.md b/reference/deque/deque/op_assign.md index a3398fcd9a..0e214ced8a 100644 --- a/reference/deque/deque/op_assign.md +++ b/reference/deque/deque/op_assign.md @@ -6,7 +6,7 @@ ```cpp deque& operator=(const deque& x); // (1) C++03 -deque& operator=(deque&& y); // (2) C++11 +deque& operator=(deque&& x); // (2) C++11 deque& operator=(deque&& x) noexcept(allocator_traits::is_always_equal::value); // (2) C++17 deque& operator=(initializer_list init); // (3) C++11 @@ -22,7 +22,7 @@ deque& operator=(initializer_list init); // (3) C++11 ## 効果 - (1) : 同じテンプレートパラメータを持つ`deque`クラスのオブジェクトをコピー代入する。`*this`の全ての要素が解放され、`x`の全ての要素が`*this`にコピーされる。 - (2) : 同じテンプレートパラメータを持つ`deque`クラスのオブジェクトをムーブ代入する。`*this`の全ての要素が解放され、`x`の全ての要素が`*this`にムーブされる。 -- (3) : 同じ要素型を持つ[`initializer_list`](/reference/initializer_list/initializer_list.md)クラスのオブジェクトをコピー代入する。`*this`の全ての要素が解放され、`x`の全ての要素が`*this`にコピーされる。 +- (3) : 同じ要素型を持つ[`initializer_list`](/reference/initializer_list/initializer_list.md)クラスのオブジェクトをコピー代入する。`*this`の全ての要素が解放され、`init`の全ての要素が`*this`にコピーされる。 ## 戻り値 diff --git a/reference/map/map/insert.md b/reference/map/map/insert.md index 259a068cb4..f5a846253f 100644 --- a/reference/map/map/insert.md +++ b/reference/map/map/insert.md @@ -82,7 +82,7 @@ iterator insert(const_iterator hint, node_type&& nh); // (10) C++17 - (8) : `insert(init.begin(), init.end())`と等価。 - (9) : `nh`が空の場合、効果はない。 それ以外の場合、`nh.key()`と等価のキーを持つ要素がコンテナにない場合に限り、`nh`が所有する要素を挿入する。 -- (10) : `nh`が空の場合、効果はなく、`(*this).end()`を返す。それ以外の場合、`nh.key()`と等価のキーを持つ要素がコンテナにない場合に限り、`nh`が所有する要素を挿入する。`nh.key()`と等価のキーの要素を指すイテレータを常に返す。要素は、`p`の直前の位置のできるだけ近くに挿入される。 +- (10) : `nh`が空の場合、効果はなく、`(*this).end()`を返す。それ以外の場合、`nh.key()`と等価のキーを持つ要素がコンテナにない場合に限り、`nh`が所有する要素を挿入する。`nh.key()`と等価のキーの要素を指すイテレータを常に返す。要素は、`hint`の直前の位置のできるだけ近くに挿入される。 ## 戻り値 @@ -105,7 +105,7 @@ iterator insert(const_iterator hint, node_type&& nh); // (10) C++17 - (7), (8) : 一般に N log(size + N)。(ただし、備考も参照) - ここで、 `N` は `first` と `last` の間の距離であり `size` は挿入前のコンテナの [`size()`](size.md) を表す。 - (9) : 対数時間 -- (10) : 一般に対数時間だが、指定された新たな要素が `position` が指す要素の直前に挿入された場合は償却定数時間。 +- (10) : 一般に対数時間だが、指定された新たな要素が `hint` が指す要素の直前に挿入された場合は償却定数時間。 ## 備考 diff --git a/reference/map/map/op_assign.md b/reference/map/map/op_assign.md index 4a7058ceff..da17e632a2 100644 --- a/reference/map/map/op_assign.md +++ b/reference/map/map/op_assign.md @@ -6,7 +6,7 @@ ```cpp map& operator=(const map& x); // (1) C++03 -map& operator=(map&& y); // (2) C++11 +map& operator=(map&& x); // (2) C++11 map& operator=(map&& x) noexcept(allocator_traits::is_always_equal::value && is_nothrow_move_assignable::value); (2) // C++17 @@ -22,7 +22,7 @@ map& operator=(initializer_list init); // (3) C++11 ## 効果 - (1) : 同じテンプレートパラメータを持つ`map`クラスのオブジェクトをコピー代入する。`*this`の全ての要素が解放され、`x`の全ての要素が`*this`にコピーされる。 - (2) : 同じテンプレートパラメータを持つ`map`クラスのオブジェクトをムーブ代入する。`*this`の全ての要素が解放され、`x`の全ての要素が`*this`にムーブされる。 -- (3) : 同じテンプレートパラメータを持つ`initializer_list`クラスのオブジェクトをコピー代入する。`*this`の全ての要素が解放され、`x`の全ての要素が`*this`にコピーされる。 +- (3) : 同じテンプレートパラメータを持つ`initializer_list`クラスのオブジェクトをコピー代入する。`*this`の全ての要素が解放され、`init`の全ての要素が`*this`にコピーされる。 ## 戻り値 @@ -32,7 +32,7 @@ map& operator=(initializer_list init); // (3) C++11 ## 事後条件 - (1) : `*this == x` - (2) : `*this`は元々の`x`と等値となる -- (3) : `*this == x` +- (3) : `*this == map{init}` ## 計算量 diff --git a/reference/map/multimap.md b/reference/map/multimap.md index 180e5c2c0f..f5aa9fd9d1 100644 --- a/reference/map/multimap.md +++ b/reference/map/multimap.md @@ -159,7 +159,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`swap`](multimap/swap_free.md) | 2つの`map`オブジェクトを入れ替える | | +| [`swap`](multimap/swap_free.md) | 2つの`multimap`オブジェクトを入れ替える | | ### 要素削除 diff --git a/reference/map/multimap/insert.md b/reference/map/multimap/insert.md index 946a11c844..11af3b64d6 100644 --- a/reference/map/multimap/insert.md +++ b/reference/map/multimap/insert.md @@ -56,7 +56,7 @@ iterator insert(const_iterator hint, node_type&& nh); // (10) C++17 - (7) : イテレータ範囲`[first, last)`の各要素を`*this`の要素として挿入する。 - (8) : `insert(init.begin(), init.end())`と等価((7)へ委譲)。 - (9) : `nh`が空の場合、効果はない。そうでなければ、`nh`によって所有されている要素を挿入する。`nh.key()` と等価なキーを持つ要素を含む範囲がコンテナ内に存在する場合、要素はその範囲の終端に挿入される。 -- (10) : `nh`が空の場合、効果はない。そうでなければ、`nh` によって所有されている要素を`p`より前の出来るだけ近い位置に挿入する。 `nh.key()` と等価なキーを持つ要素を含む範囲がコンテナ内に存在する場合、要素はその範囲の終端に挿入される。 +- (10) : `nh`が空の場合、効果はない。そうでなければ、`nh` によって所有されている要素を`hint`より前の出来るだけ近い位置に挿入する。 `nh.key()` と等価なキーを持つ要素を含む範囲がコンテナ内に存在する場合、要素はその範囲の終端に挿入される。 ## 戻り値 diff --git a/reference/map/multimap/op_assign.md b/reference/map/multimap/op_assign.md index 96e60ee0a4..b3c7f12f2e 100644 --- a/reference/map/multimap/op_assign.md +++ b/reference/map/multimap/op_assign.md @@ -6,7 +6,7 @@ ```cpp multimap& operator=(const multimap& x); // (1) C++03 -multimap& operator=(multimap&& y); // (2) C++11 +multimap& operator=(multimap&& x); // (2) C++11 multimap& operator=(multimap&& x) noexcept(allocator_traits::is_always_equal::value && is_nothrow_move_assignable::value) // (2) C++17 @@ -22,7 +22,7 @@ multimap& operator=(initializer_list init); // (3) C++11 ## 効果 - (1) : 同じテンプレートパラメータを持つ`multimap`クラスのオブジェクトをコピー代入する。`*this`の全ての要素が解放され、`x`の全ての要素が`*this`にコピーされる。 - (2) : 同じテンプレートパラメータを持つ`multimap`クラスのオブジェクトをムーブ代入する。`*this`の全ての要素が解放され、`x`の全ての要素が`*this`にムーブされる。 -- (3) : 同じテンプレートパラメータを持つ`initializer_list`クラスのオブジェクトをコピー代入する。`*this`の全ての要素が解放され、`x`の全ての要素が`*this`にコピーされる。 +- (3) : 同じテンプレートパラメータを持つ`initializer_list`クラスのオブジェクトをコピー代入する。`*this`の全ての要素が解放され、`init`の全ての要素が`*this`にコピーされる。 ## 戻り値 @@ -32,7 +32,7 @@ multimap& operator=(initializer_list init); // (3) C++11 ## 事後条件 - (1) : `*this == x` - (2) : `*this`は元々の`x`と等値となる -- (3) : `*this == x` +- (3) : `*this == multimap{init}` ## 計算量 diff --git a/reference/memory/make_shared.md b/reference/memory/make_shared.md index 617cdd6645..3519a46bc1 100644 --- a/reference/memory/make_shared.md +++ b/reference/memory/make_shared.md @@ -75,7 +75,7 @@ namespace std { - ユーザーによるオブジェクトの生成 - 内部的な参照カウンタの生成 -`make_shared()` 内部的にオブジェクトを生成するため、オブジェクトの生成と参照カウンタの生成を、1つの大きなブロックとしてメモリを確保するため、より効率的になる。 +`make_shared()` は内部的にオブジェクトを生成するため、オブジェクトの生成と参照カウンタの生成を、1つの大きなブロックとしてメモリを確保するため、より効率的になる。 メモリの確保にユーザー定義のアロケータを使用したい場合には、 [`allocate_shared()`](allocate_shared.md) を使用する。 diff --git a/reference/node_handle/node_handle.md b/reference/node_handle/node_handle.md index 8ea8b0b1dd..c2cd8cce43 100644 --- a/reference/node_handle/node_handle.md +++ b/reference/node_handle/node_handle.md @@ -1,7 +1,7 @@ # node_handle * cpp17[meta cpp] * node_handle[meta category] -* class[meta id-type] +* class template[meta id-type] ```cpp @@ -51,8 +51,8 @@ class node_handle; | 名前 | 説明 | 対応バージョン | |----------------------------------------------|------------------------------|-------| | [`value`](node_handle/value.md)(set) | 要素アクセス | C++17 | -| [`key`](node_handle/key.md)(map) | Keyアクセス | C++17 | -| [`mapped`](node_handle/mapped.md)(map) | 要素アクセス | C++17 | +| [`key`](node_handle/key.md)(map) | キーアクセス | C++17 | +| [`mapped`](node_handle/mapped.md)(map) | 値アクセス | C++17 | | [`get_allocator`](node_handle/get_allocator.md) | アロケータオブジェクトの取得 | C++17 | | [`operator bool`](node_handle/op_bool.md) | ノードハンドルが空であるかどうかを調べる | C++17 | | [`empty`](node_handle/empty.md) | ノードハンドルが空であるかどうかを調べる | C++17 | @@ -69,9 +69,9 @@ class node_handle; | 名前 | 説明 | 対応バージョン | |-----------------|----------------|----------------| -| `key_type` | テンプレートパラメータ `Key`。 | C++17 | -| `value_type`(set) | テンプレートパラメータ `Key`。 | C++17 | -| `value_type`(map) | 要素の型。`std::`[`pair`](/reference/utility/pair.md)``。 | C++17 | +| `key_type` | テンプレートパラメータ `K`。 | C++17 | +| `value_type`(set) | テンプレートパラメータ `K`。 | C++17 | +| `value_type`(map) | 要素の型。`std::`[`pair`](/reference/utility/pair.md)``。 | C++17 | | `mapped_type`(map) | 値の型。テンプレートパラメータ `T`。 | C++17 | | `allocator_type` | アロケータの型。 | C++17 | diff --git a/reference/node_handle/node_handle/empty.md b/reference/node_handle/node_handle/empty.md index 7ab4a8ab7f..080dedc716 100644 --- a/reference/node_handle/node_handle/empty.md +++ b/reference/node_handle/node_handle/empty.md @@ -2,7 +2,7 @@ * cpp17[meta cpp] * node_handle[meta category] * node_handle[meta class] -* function template[meta id-type] +* function[meta id-type] * [meta namespace] ```cpp diff --git a/reference/node_handle/node_handle/get_allocator.md b/reference/node_handle/node_handle/get_allocator.md index 49f9ba9183..95f23a4e5f 100644 --- a/reference/node_handle/node_handle/get_allocator.md +++ b/reference/node_handle/node_handle/get_allocator.md @@ -2,7 +2,7 @@ * cpp17[meta cpp] * node_handle[meta category] * node_handle[meta class] -* function template[meta id-type] +* function[meta id-type] * [meta namespace] ```cpp @@ -27,7 +27,6 @@ allocator_type get_allocator() const; ## 例 ```cpp example -#include #include int main() @@ -42,7 +41,6 @@ int main() ### 出力 ``` -0 ``` ## バージョン diff --git a/reference/node_handle/node_handle/key.md b/reference/node_handle/node_handle/key.md index 236c838389..7f01972bcd 100644 --- a/reference/node_handle/node_handle/key.md +++ b/reference/node_handle/node_handle/key.md @@ -2,7 +2,7 @@ * cpp17[meta cpp] * node_handle[meta category] * node_handle[meta class] -* function template[meta id-type] +* function[meta id-type] * [meta namespace] ```cpp diff --git a/reference/node_handle/node_handle/mapped.md b/reference/node_handle/node_handle/mapped.md index 66e5e3c56b..207f497187 100644 --- a/reference/node_handle/node_handle/mapped.md +++ b/reference/node_handle/node_handle/mapped.md @@ -2,7 +2,7 @@ * cpp17[meta cpp] * node_handle[meta category] * node_handle[meta class] -* function template[meta id-type] +* function[meta id-type] * [meta namespace] ```cpp diff --git a/reference/node_handle/node_handle/op_assign.md b/reference/node_handle/node_handle/op_assign.md index 0e8106e44a..95040bf845 100644 --- a/reference/node_handle/node_handle/op_assign.md +++ b/reference/node_handle/node_handle/op_assign.md @@ -2,7 +2,7 @@ * cpp17[meta cpp] * node_handle[meta category] * node_handle[meta class] -* function template[meta id-type] +* function[meta id-type] * [meta namespace] ```cpp @@ -47,6 +47,7 @@ int main() std::set::node_type nh; // std::set::node_type nh2 = nh; // コピー構築はできない std::set::node_type nh2 = std::move(nh); + std::cout << static_cast(nh2); } ``` diff --git a/reference/node_handle/node_handle/op_bool.md b/reference/node_handle/node_handle/op_bool.md index e1b1e72046..bec4712855 100644 --- a/reference/node_handle/node_handle/op_bool.md +++ b/reference/node_handle/node_handle/op_bool.md @@ -2,7 +2,7 @@ * cpp17[meta cpp] * node_handle[meta category] * node_handle[meta class] -* function template[meta id-type] +* function[meta id-type] * [meta namespace] ```cpp diff --git a/reference/node_handle/node_handle/op_constructor.md b/reference/node_handle/node_handle/op_constructor.md index 5f1762ac2d..86daaffd7d 100644 --- a/reference/node_handle/node_handle/op_constructor.md +++ b/reference/node_handle/node_handle/op_constructor.md @@ -2,7 +2,7 @@ * cpp17[meta cpp] * node_handle[meta category] * node_handle[meta class] -* function template[meta id-type] +* function[meta id-type] * [meta namespace] ```cpp @@ -33,6 +33,7 @@ int main() std::set::node_type nh; // (1) // std::set::node_type nh2 = nh; // コピー構築はできない std::set::node_type nh2 = std::move(nh); // (2) + std::cout << static_cast(nh2); } ``` * node_type[color ff0000] diff --git a/reference/node_handle/node_handle/op_destructor.md b/reference/node_handle/node_handle/op_destructor.md index 1241bd2388..0dfe5b0257 100644 --- a/reference/node_handle/node_handle/op_destructor.md +++ b/reference/node_handle/node_handle/op_destructor.md @@ -2,7 +2,7 @@ * cpp17[meta cpp] * node_handle[meta category] * node_handle[meta class] -* function template[meta id-type] +* function[meta id-type] * [meta namespace] ```cpp @@ -23,7 +23,6 @@ ## 例 ```cpp example -#include #include int main() @@ -34,7 +33,6 @@ int main() ### 出力 ``` -0 ``` ## バージョン diff --git a/reference/node_handle/node_handle/swap.md b/reference/node_handle/node_handle/swap.md index f3c6306ef7..e243fb0c2a 100644 --- a/reference/node_handle/node_handle/swap.md +++ b/reference/node_handle/node_handle/swap.md @@ -2,7 +2,7 @@ * cpp17[meta cpp] * node_handle[meta category] * node_handle[meta class] -* function template[meta id-type] +* function[meta id-type] * [meta namespace] ```cpp diff --git a/reference/node_handle/node_handle/swap_free.md b/reference/node_handle/node_handle/swap_free.md index e1366fc746..b5ed9a4d65 100644 --- a/reference/node_handle/node_handle/swap_free.md +++ b/reference/node_handle/node_handle/swap_free.md @@ -1,7 +1,7 @@ # swap (非メンバ関数) * cpp17[meta cpp] * node_handle[meta category] -* function template[meta id-type] +* function[meta id-type] * [meta namespace] ```cpp diff --git a/reference/node_handle/node_handle/value.md b/reference/node_handle/node_handle/value.md index 877c82d2e4..e38f5c41e8 100644 --- a/reference/node_handle/node_handle/value.md +++ b/reference/node_handle/node_handle/value.md @@ -2,7 +2,7 @@ * cpp17[meta cpp] * node_handle[meta category] * node_handle[meta class] -* function template[meta id-type] +* function[meta id-type] * [meta namespace] ```cpp diff --git a/reference/set/multiset/insert.md b/reference/set/multiset/insert.md index c0124bbb4a..0a45de240a 100644 --- a/reference/set/multiset/insert.md +++ b/reference/set/multiset/insert.md @@ -36,7 +36,7 @@ iterator insert(const_iterator hint, node_type&& nh); // (8) C++17 - (5) : イテレータ範囲`[first, last)`の要素を挿入する - (6) : 初期化子リスト`init`の要素を挿入する - (7) : `nh`が空の場合、効果はない。そうでなければ、`nh`が所有する要素を挿入し、新しく挿入された要素を指すイテレータを返す。`nh.key()` と等価なキーを持つ要素を含む範囲がコンテナ内に存在する場合、要素はその範囲の終端に挿入される。`nh` が空でなく、`(*this).get_allocator() == nh.get_allocator()`であれば、動作は未定義である。 -- (8) : `nh`が空の場合、効果はなく、`(*this).end()`を返す。そうでなければ、 `nh` によって所有されている要素をコンテナに挿入し、 `nh.key()` と等価なキーを持つ要素を指すイテレータを返す。 `nh.key()` と等しいキーを持つ要素を含む範囲がコンテナ内に存在する場合、要素はその範囲の終端に挿入される。要素は、`p`の直前の位置のできるだけ近くに挿入される。`nh` が空でなく、`(*this).get_allocator() == nh.get_allocator()`であれば、動作は未定義である。 +- (8) : `nh`が空の場合、効果はなく、`(*this).end()`を返す。そうでなければ、 `nh` によって所有されている要素をコンテナに挿入し、 `nh.key()` と等価なキーを持つ要素を指すイテレータを返す。 `nh.key()` と等しいキーを持つ要素を含む範囲がコンテナ内に存在する場合、要素はその範囲の終端に挿入される。要素は、`hint`の直前の位置のできるだけ近くに挿入される。`nh` が空でなく、`(*this).get_allocator() == nh.get_allocator()`であれば、動作は未定義である。 ## 戻り値 diff --git a/reference/set/multiset/op_assign.md b/reference/set/multiset/op_assign.md index ba93738df6..f96d890248 100644 --- a/reference/set/multiset/op_assign.md +++ b/reference/set/multiset/op_assign.md @@ -23,7 +23,7 @@ multiset& operator=(initializer_list init); // (3) C++11 ## 効果 - (1) : 同じテンプレートパラメータを持つ `multiset` クラスのオブジェクトをコピー代入する。`*this` の全ての要素が解放され、`x` の全ての要素が `*this` にコピーされる。 - (2) : 同じテンプレートパラメータを持つ `multiset` クラスのオブジェクトをムーブ代入する。`*this` の全ての要素が解放され、`x` の全ての要素が `*this` にムーブされる。 -- (3) : 同じテンプレートパラメータを持つ `initializer_list` クラスのオブジェクトをコピー代入する。`*this` の全ての要素が解放され、`x` の全ての要素が `*this` にコピーされる。 +- (3) : 同じテンプレートパラメータを持つ `initializer_list` クラスのオブジェクトをコピー代入する。`*this` の全ての要素が解放され、`init` の全ての要素が `*this` にコピーされる。 ## 戻り値 @@ -33,7 +33,7 @@ multiset& operator=(initializer_list init); // (3) C++11 ## 事後条件 - (1) : `*this == x` - (2) : `*this`は元々の`x`と等値となる -- (3) : `*this == x` +- (3) : `*this == multiset{init}` ## 計算量 diff --git a/reference/set/set/insert.md b/reference/set/set/insert.md index 714e104f16..c572100eaa 100644 --- a/reference/set/set/insert.md +++ b/reference/set/set/insert.md @@ -39,7 +39,7 @@ iterator insert(const_iterator hint, node_type&& nh); // (8) C++17 - (7) : `nh`が空の場合、効果はない。 それ以外の場合、`nh.key()`と等価のキーを持つ要素がコンテナにない場合に限り、`nh`が所有する要素を挿入する。 - (8) : `nh`が空の場合、効果はなく、`(*this).end()`を返す。 -それ以外の場合、`nh.key()`と等価のキーを持つ要素がコンテナにない場合に限り、`nh`が所有する要素を挿入する。 `nh.key()`と同等のキーの要素を指すイテレータを常に返す。要素は、`p`の直前の位置のできるだけ近くに挿入される。 +それ以外の場合、`nh.key()`と等価のキーを持つ要素がコンテナにない場合に限り、`nh`が所有する要素を挿入する。 `nh.key()`と同等のキーの要素を指すイテレータを常に返す。要素は、`hint`の直前の位置のできるだけ近くに挿入される。 ## 戻り値 @@ -58,7 +58,7 @@ iterator insert(const_iterator hint, node_type&& nh); // (8) C++17 - (5), (6) : 一般に N log(size + N) - ※ ここで `N` は `first` と `last` の間の距離であり `size` は挿入前のコンテナの [`size()`](size.md) - (7) : 対数時間 -- (8) : 一般に対数時間だが、指定された新たな要素が `position` が指す要素の直前に挿入された場合は償却定数時間。 +- (8) : 一般に対数時間だが、指定された新たな要素が `hint` が指す要素の直前に挿入された場合は償却定数時間。 ## 備考 diff --git a/reference/set/set/op_assign.md b/reference/set/set/op_assign.md index f84066b91f..ea6aabf4a2 100644 --- a/reference/set/set/op_assign.md +++ b/reference/set/set/op_assign.md @@ -23,7 +23,7 @@ set& operator=(initializer_list init); // (3) C++11 ## 効果 - (1) : 同じテンプレートパラメータを持つ `set` クラスのオブジェクトをコピー代入する。`*this` の全ての要素が解放され、`x` の全ての要素が `*this` にコピーされる。 - (2) : 同じテンプレートパラメータを持つ `set` クラスのオブジェクトをムーブ代入する。`*this` の全ての要素が解放され、`x` の全ての要素が `*this` にムーブされる。 -- (3) : 同じテンプレートパラメータを持つ `initializer_list` クラスのオブジェクトをコピー代入する。`*this` の全ての要素が解放され、`x` の全ての要素が `*this` にコピーされる。 +- (3) : 同じテンプレートパラメータを持つ `initializer_list` クラスのオブジェクトをコピー代入する。`*this` の全ての要素が解放され、`init` の全ての要素が `*this` にコピーされる。 ## 戻り値 @@ -33,7 +33,7 @@ set& operator=(initializer_list init); // (3) C++11 ## 事後条件 - (1) : `*this == x` - (2) : `*this`は元々の`x`と等値となる -- (3) : `*this == x` +- (3) : `*this == set{init}` ## 計算量 diff --git a/reference/string/basic_string/assign.md b/reference/string/basic_string/assign.md index cb7ef5d7cd..fc55fcb488 100644 --- a/reference/string/basic_string/assign.md +++ b/reference/string/basic_string/assign.md @@ -42,8 +42,8 @@ constexpr basic_string& assign(InputIterator first, InputIterator last); // (7) C++20 -basic_string& assign(initializer_list); // (8) C++11 -constexpr basic_string& assign(initializer_list); // (8) C++20 +basic_string& assign(initializer_list il); // (8) C++11 +constexpr basic_string& assign(initializer_list il); // (8) C++20 // string_viewを引数に取るオーバーロード template diff --git a/reference/unordered_map/unordered_map/insert.md b/reference/unordered_map/unordered_map/insert.md index 3abc7efe21..390f67e240 100644 --- a/reference/unordered_map/unordered_map/insert.md +++ b/reference/unordered_map/unordered_map/insert.md @@ -71,7 +71,7 @@ iterator insert(const_iterator hint, node_type&& nh); // (10) C++17 - (10) : - `nh`が空の場合、効果はなく、`(*this).end()`を返す - それ以外の場合、`nh.key()`と等価のキーを持つ要素がコンテナにない場合に限り、`nh`が所有する要素を挿入する。`nh.key()`と等価のキーの要素を指すイテレータを常に返す - - 要素は、`p`の直前の位置のできるだけ近くに挿入される + - 要素は、`hint`の直前の位置のできるだけ近くに挿入される ## 戻り値 diff --git a/reference/unordered_map/unordered_multimap/insert.md b/reference/unordered_map/unordered_multimap/insert.md index b0e30bd35a..d60870c883 100644 --- a/reference/unordered_map/unordered_multimap/insert.md +++ b/reference/unordered_map/unordered_multimap/insert.md @@ -71,7 +71,7 @@ iterator insert(const_iterator hint, node_type&& nh); // (10) C++17 - (10) : - `nh`が空の場合、効果はなく、`(*this).end()`を返す - そうでなければ、 `nh` によって所有されている要素をコンテナに挿入し、 `nh.key()` と等価なキーを持つ要素を指すイテレータを返す - - `nh.key()` と等しいキーを持つ要素を含む範囲がコンテナ内に存在する場合、要素はその範囲の終端に挿入される。要素は、`p`の直前の位置のできるだけ近くに挿入される + - `nh.key()` と等しいキーを持つ要素を含む範囲がコンテナ内に存在する場合、要素はその範囲の終端に挿入される。要素は、`hint`の直前の位置のできるだけ近くに挿入される ## 戻り値 diff --git a/reference/unordered_set/unordered_multiset/insert.md b/reference/unordered_set/unordered_multiset/insert.md index 422261a0dc..09d2f8b213 100644 --- a/reference/unordered_set/unordered_multiset/insert.md +++ b/reference/unordered_set/unordered_multiset/insert.md @@ -60,7 +60,7 @@ iterator insert(const_iterator hint, node_type&& nh); // (6) C++17 - (3) : イテレータ範囲 `[first, last)` のすべての要素 `t` に対して、(1)の形式の `insert(t)` を呼び出した場合と等価である。 - (4) : (3)の形式を `insert(il.begin(), il.end())` として呼び出した場合と等価である。 - (5) : `nh`が空の場合、効果はない。そうでなければ、`nh`が所有する要素を挿入し、新しく挿入された要素を指すイテレータを返す。`nh.key()` と等価なキーを持つ要素を含む範囲がコンテナ内に存在する場合、要素はその範囲の終端に挿入される。 -- (6) : `nh`が空の場合、効果はなく、`(*this).end()`を返す。そうでなければ、 `nh` によって所有されている要素をコンテナに挿入し、 `nh.key()` と等価なキーを持つ要素を指すイテレータを返す。 `nh.key()` と等しいキーを持つ要素を含む範囲がコンテナ内に存在する場合、要素はその範囲の終端に挿入される。要素は、`p`の直前の位置のできるだけ近くに挿入される。 +- (6) : `nh`が空の場合、効果はなく、`(*this).end()`を返す。そうでなければ、 `nh` によって所有されている要素をコンテナに挿入し、 `nh.key()` と等価なキーを持つ要素を指すイテレータを返す。 `nh.key()` と等しいキーを持つ要素を含む範囲がコンテナ内に存在する場合、要素はその範囲の終端に挿入される。要素は、`hint`の直前の位置のできるだけ近くに挿入される。 ## 戻り値 diff --git a/reference/unordered_set/unordered_set/count.md b/reference/unordered_set/unordered_set/count.md index d38174485d..925ac8195c 100644 --- a/reference/unordered_set/unordered_set/count.md +++ b/reference/unordered_set/unordered_set/count.md @@ -13,7 +13,7 @@ size_type count(const K& k) const; // (2) C++20 ``` ## 概要 -キーを検索し、コンテナ内に見つかった要素の数を返す。`set` コンテナはキーの重複を許さないため、この関数は実際には要素が見つかったときに 1 を、そうでないときに 0 を返す。 +キーを検索し、コンテナ内に見つかった要素の数を返す。`unordered_set` コンテナはキーの重複を許さないため、この関数は実際には要素が見つかったときに 1 を、そうでないときに 0 を返す。 - (1) : キー`x`を検索し、合致する要素数を取得する - (2) : キー`k`を透過的に検索し、合致する要素数を取得する diff --git a/reference/unordered_set/unordered_set/extract.md b/reference/unordered_set/unordered_set/extract.md index b1d0a69f10..d123a2fbad 100644 --- a/reference/unordered_set/unordered_set/extract.md +++ b/reference/unordered_set/unordered_set/extract.md @@ -58,7 +58,7 @@ auto my_hash = [](my_struct const& s) noexcept -> std::size_t int main() { - // ムーブオンリーな型をキーとして扱う multiset + // ムーブオンリーな型をキーとして扱う unordered_set std::unordered_set s; // 挿入 diff --git a/reference/unordered_set/unordered_set/insert.md b/reference/unordered_set/unordered_set/insert.md index 20e168442c..525f2a215b 100644 --- a/reference/unordered_set/unordered_set/insert.md +++ b/reference/unordered_set/unordered_set/insert.md @@ -64,7 +64,7 @@ iterator insert(const_iterator hint, node_type&& nh); // (6) C++17 それ以外の場合、`nh.key()`と等価のキーを持つ要素がコンテナにない場合に限り、`nh`が所有する要素を挿入する。 - (6) : `nh`が空の場合、効果はなく、`(*this).end()`を返す。 それ以外の場合、`nh.key()`と等価のキーを持つ要素がコンテナにない場合に限り、`nh`が所有する要素を挿入する。`nh.key()`と等価のキーの要素を指すイテレータを常に返す。 -要素は、`p`の直前の位置のできるだけ近くに挿入される。 +要素は、`hint`の直前の位置のできるだけ近くに挿入される。 ## 戻り値 diff --git a/reference/vector/vector/assign.md b/reference/vector/vector/assign.md index 677211063f..38cecc0625 100644 --- a/reference/vector/vector/assign.md +++ b/reference/vector/vector/assign.md @@ -10,11 +10,11 @@ void assign(InputIterator first, InputIterator last); // (1) C++03 template constexpr void assign(InputIterator first, InputIterator last); // (1) C++20 -void assign(size_type n, const T& u); // (2) C++03 -constexpr void assign(size_type n, const T& u); // (2) C++20 +void assign(size_type n, const T& t); // (2) C++03 +constexpr void assign(size_type n, const T& t); // (2) C++20 -void assign(initializer_list); // (3) C++11 -constexpr void assign(initializer_list); // (3) C++20 +void assign(initializer_list il); // (3) C++11 +constexpr void assign(initializer_list il); // (3) C++20 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -28,12 +28,12 @@ constexpr void assign(initializer_list); // (3) C++20 ## 要件 - (1) : 型`T`は`*first`から`X`に対してEmplaceConstructibleでなければならない。イテレータがForward iterators の要件を満たさない場合、型`T`は`X`に対してMoveInsertableでなければならない。`[first, last)`の範囲のそれぞれのイテレータは1回だけ間接参照される。`first`, `last`は自身のイテレータであってはならない。 -- (2) : `u`は`*this`の要素への参照であってはならない。 +- (2) : `t`は`*this`の要素への参照であってはならない。 ## 効果 - (1) : イテレータ範囲`[first, last)`の要素のコピーで`*this`の要素を置き換える。 -- (2) : `*this`の要素をすべて`n`個の`u`のコピーに置き換える。 +- (2) : `*this`の要素をすべて`n`個の`t`のコピーに置き換える。 - (3) : `assign(il.begin(), il.end())`と等価。 diff --git a/reference/vector/vector/op_assign.md b/reference/vector/vector/op_assign.md index 4ac758454f..df387153de 100644 --- a/reference/vector/vector/op_assign.md +++ b/reference/vector/vector/op_assign.md @@ -16,8 +16,8 @@ constexpr vector& operator=(vector&& x) noexcept( allocator_traits::propagate_on_container_move_assignment::value || allocator_traits::is_always_equal::value); // (2) C++20 -vector& operator=(initializer_list); // (3) C++11 -constexpr vector& operator=(initializer_list); // (3) C++20 +vector& operator=(initializer_list init); // (3) C++11 +constexpr vector& operator=(initializer_list init); // (3) C++20 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] * allocator_traits[link /reference/memory/allocator_traits.md] @@ -35,7 +35,7 @@ constexpr vector& operator=(initializer_list); // (3) C++20 ## 効果 - (1) : 同じテンプレートパラメータを持つ`vector`クラスのオブジェクトをコピー代入する。`*this`の全ての要素が解放され、`x`の全ての要素が`*this`にコピーされる。 - (2) : 同じテンプレートパラメータを持つ`vector`クラスのオブジェクトをムーブ代入する。`*this`の全ての要素が解放され、`x`の全ての要素が`*this`にムーブされる。 -- (3) : 同じテンプレートパラメータを持つ`initializer_list`クラスのオブジェクトをコピー代入する。`*this`の全ての要素が解放され、`x`の全ての要素が`*this`にコピーされる。 +- (3) : 同じテンプレートパラメータを持つ`initializer_list`クラスのオブジェクトをコピー代入する。`*this`の全ての要素が解放され、`init`の全ての要素が`*this`にコピーされる。 ## 戻り値 @@ -45,7 +45,7 @@ constexpr vector& operator=(initializer_list); // (3) C++20 ## 事後条件 - (1) : `*this == x` - (2) : `*this`は元々の`x`と等値となる -- (3) : `*this == x` +- (3) : `*this == vector{init}` ## 計算量 From 62ade0308470905e5918ddf9a846caf8aa4e0ebd Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Sat, 30 Dec 2023 16:59:25 +0900 Subject: [PATCH 0613/3948] fix: update explanation of P2242 in impl-stat --- implementation-status.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/implementation-status.md b/implementation-status.md index 2b7e2d0619..ecfae2abd2 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -267,7 +267,7 @@ | P2582R1: [継承コンストラクタからのクラステンプレート引数の推論](/lang/cpp23/class_template_argument_deduction_from_inherited.md.nolink) | | - | - | - | - | | P1938R3: [`if consteval`](/lang/cpp23/if_consteval.md.nolink) | コンパイル時の文脈かどうかで分岐させる | 12 | 14 | - | - | | P1401R5: [定数式の文脈での`bool`への縮小変換を許可](/lang/cpp23/narrowing_contextual_conversions_to_bool.md.nolink) | `if constexpr(flags & Flags::Exec)`や`static_assert(N);`を許可 | 9 | 13 | 2022.2 | - | -| P2242R3: [定数式内での非リテラル変数、静的変数・スレッドローカル変数およびgotoとラベルの存在を許可する](/lang/cpp23/non_literal_variables_in_constexpr_functions.md) | 定数式内で静的変数・スレッドローカル変数およびgoto文とラベルを含められない制限を設ける | 12 | 15 | 2022.2 | - | +| P2242R3: [定数式内での非リテラル変数、静的変数・スレッドローカル変数およびgotoとラベルの存在を許可する](/lang/cpp23/non_literal_variables_in_constexpr_functions.md) | コンパイル時に評価されない限り、定数式内に静的変数・スレッドローカル変数およびgoto文とラベルを含むことを許可する | 12 | 15 | 2022.2 | - | | P2246R1: [静的な診断メッセージの文字エンコーディング](/lang/cpp23/character_encoding_of_diagnostic_text.md.nolink) | `static_assert`や`[[deprecated]]`などの診断メッセージの文字集合に関する要件をなくす | - | yes | - | 2022 | | P2448R2: [`constexpr`関数のすべての引数が定数実行できない場合でも適格とする](/lang/cpp23/relaxing_some_constexpr_restrictions.md.nolink) | | 13 | 17 (partial) | 2024.0 (partial) | - | | P2647R1: [`constexpr`関数内での`static constexpr`変数を許可](/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md.nolink) | 13 | - | 16 | 2023.2 | - | From 28dc4403c629b3a2d3584a9bff527de41a397d04 Mon Sep 17 00:00:00 2001 From: joseph0304 Date: Sun, 31 Dec 2023 11:09:32 +0900 Subject: [PATCH 0614/3948] add "constepx" to NG words --- .github/workflows/script/ngword_check.py | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/script/ngword_check.py b/.github/workflows/script/ngword_check.py index 09ca731aaf..96a0f537b0 100644 --- a/.github/workflows/script/ngword_check.py +++ b/.github/workflows/script/ngword_check.py @@ -27,6 +27,7 @@ ("", "子ルーチン", "コルーチン"), ("", "移譲", "委譲"), ("", r'型]\((.*?)\)型', "型](link)"), + ("", "constepx", "constexpr"), ("reference/chrono", "dulation", "duration"), ("reference/random", "施行", "試行"), ("reference/random", "疑似", "擬似"), From 10bce870608d979addbb7a98fa4a4b1d20b7cab3 Mon Sep 17 00:00:00 2001 From: joseph0304 Date: Sun, 31 Dec 2023 11:11:42 +0900 Subject: [PATCH 0615/3948] =?UTF-8?q?typo=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/memory/allocator_traits/max_size.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/memory/allocator_traits/max_size.md b/reference/memory/allocator_traits/max_size.md index 130c9e1f31..12e5ad4338 100644 --- a/reference/memory/allocator_traits/max_size.md +++ b/reference/memory/allocator_traits/max_size.md @@ -8,7 +8,7 @@ ```cpp static size_type max_size(Alloc& a); // C++11 static size_type max_size(const Alloc& a) noexcept; // C++14 から C++ 17 まで -static constepx size_type max_size(const Alloc& a) noexcept; // C++20 から +static constexpr size_type max_size(const Alloc& a) noexcept; // C++20 から ``` ## 概要 From c206a4c95260468452bbbaff960860e5bbf0c057 Mon Sep 17 00:00:00 2001 From: joseph0304 Date: Wed, 3 Jan 2024 16:17:02 +0900 Subject: [PATCH 0616/3948] =?UTF-8?q?typo=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit typosの結果をもとに修正したので、英語のみ対応 --- lang/cpp11/override_final.md | 2 +- reference/barrier/barrier/arrive.md | 2 +- reference/chrono/duration/op_decrement.md | 2 +- reference/chrono/duration/op_increment.md | 2 +- reference/compare/compare_three_way_result.md | 4 ++-- reference/compare/three_way_comparable.md | 4 ++-- reference/cstdlib/div.md | 20 +++++++++---------- .../hardware_destructive_interference_size.md | 4 ++-- reference/ranges/size.md | 4 ++-- .../type_traits/is_trivially_copyable.md | 2 +- 10 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lang/cpp11/override_final.md b/lang/cpp11/override_final.md index c3d6c8fcdd..e64ae0510f 100644 --- a/lang/cpp11/override_final.md +++ b/lang/cpp11/override_final.md @@ -269,7 +269,7 @@ struct base { }; struct derived [[check_names]] { - virtual void sone_func1(); // error, mis-spelled name + virtual void sone_func1(); // error, miss-spelled name virtual void some_func2(double); // error, no bad argument type virtual void some_func3(); // error, missing cv-qualification virtual int some_func4(int); // ill-formed: return type does not match B::h diff --git a/reference/barrier/barrier/arrive.md b/reference/barrier/barrier/arrive.md index e4288e446d..0f79daa985 100644 --- a/reference/barrier/barrier/arrive.md +++ b/reference/barrier/barrier/arrive.md @@ -16,7 +16,7 @@ ## 事前条件 -`updte > 0` かつ `update` が現行バリアフェーズの予定カウントに等しいかそれより小さいこと。 +`update > 0` かつ `update` が現行バリアフェーズの予定カウントに等しいかそれより小さいこと。 ## 効果 diff --git a/reference/chrono/duration/op_decrement.md b/reference/chrono/duration/op_decrement.md index b3f6d015ee..6d9617b9ef 100644 --- a/reference/chrono/duration/op_decrement.md +++ b/reference/chrono/duration/op_decrement.md @@ -18,7 +18,7 @@ constexpr duration operator--(int); // (2) C++17 ## 戻り値 -- `duration& opertor--()` : `--rep_; return *this`; +- `duration& operator--()` : `--rep_; return *this`; - `duration operator--(int)` : `return duration(rep_--);` ※ `rep_`は内部で保持している値。メンバ変数名は説明用のもの。 diff --git a/reference/chrono/duration/op_increment.md b/reference/chrono/duration/op_increment.md index c0deafcae6..2d8c578671 100644 --- a/reference/chrono/duration/op_increment.md +++ b/reference/chrono/duration/op_increment.md @@ -17,7 +17,7 @@ constexpr duration operator++(int); // (2) C++17 `duration`の値をインクリメントする ## 戻り値 -- `duration& opertor++()` : `++rep_; return *this;` +- `duration& operator++()` : `++rep_; return *this;` - `duration operator++(int)` : `return duration(rep_++);` ※ `rep_`は内部で保持している値。メンバ変数名は説明用のもの。 diff --git a/reference/compare/compare_three_way_result.md b/reference/compare/compare_three_way_result.md index edf34bbaca..1706db2fd2 100644 --- a/reference/compare/compare_three_way_result.md +++ b/reference/compare/compare_three_way_result.md @@ -95,7 +95,7 @@ false ```cpp template -concept simple_3way_compareble = requires(const std::remove_reference_t& t, const std::remove_reference_t& u) { +concept simple_3way_comparable = requires(const std::remove_reference_t& t, const std::remove_reference_t& u) { t <=> u; }; @@ -103,7 +103,7 @@ template struct compare_three_way_result {}; template -requires simple_3way_compareble +requires simple_3way_comparable struct compare_three_way_result { using type = decltype(declval&>() <=> declval&>()); }; diff --git a/reference/compare/three_way_comparable.md b/reference/compare/three_way_comparable.md index 49c44dd758..0626c244d0 100644 --- a/reference/compare/three_way_comparable.md +++ b/reference/compare/three_way_comparable.md @@ -95,7 +95,7 @@ concept three_way_comparable_with = - `(a <=> b <= 0) == bool(a <= b)`が`true`であること - `(a <=> b >= 0) == bool(a >= b)`が`true`であること - `Cat`が`strong_ordering`に変換可能ならば - - `T`は`totally_orderd`のモデルである + - `T`は`totally_ordered`のモデルである - (2) : `const remove_reference_t, const remove_reference_t`の左辺値`t, u`、`C = common_reference_t&, const remove_reference_t&>`について次の条件を満たす場合に限って、型`T, U, Cat`は`three_way_comparable_with`のモデルである - `t <=> u`と`u <=> t`が同じ[定義域](/reference/concepts.md)を持つ @@ -108,7 +108,7 @@ concept three_way_comparable_with = - `(t <=> u <= 0) == bool(t <= u)`が`true`であること - `(t <=> u >= 0) == bool(t >= u)`が`true`であること - `Cat`が`strong_ordering`に変換可能ならば - - `T, U`は`totally_orderd_with`のモデルである + - `T, U`は`totally_ordered_with`のモデルである - `partially-ordered-with` : `const remove_reference_t, const remove_reference_t`の左辺値`t, u`について次の条件を満たす場合に限って、型`T, U, Cat`は`partially-ordered-with`のモデルである - `t < u, t <= u, t > u, t >= u, u < t, u <= t, u > t, u >= t`が全て同じ[定義域](/reference/concepts.md)を持つ diff --git a/reference/cstdlib/div.md b/reference/cstdlib/div.md index 1940b7e9e5..7a377b348d 100644 --- a/reference/cstdlib/div.md +++ b/reference/cstdlib/div.md @@ -6,38 +6,38 @@ ```cpp namespace std { div_t - div(int numer, + div(int number, int denom); // (1) C++03 constexpr div_t - div(int numer, + div(int number, int denom); // (1) C++23 ldiv_t - div(long numer, + div(long number, long denom); // (2) C++03 constexpr ldiv_t - div(long numer, + div(long number, long denom); // (2) C++23 lldiv_t - div(long long numer, + div(long long number, long long denom); // (3) C++03 constexpr lldiv_t - div(long long numer, + div(long long number, long long denom); // (3) C++23 ldiv_t - ldiv(long numer, + ldiv(long number, long denom); // (4) C++03 constexpr ldiv_t - ldiv(long numer, + ldiv(long number, long denom); // (4) C++23 lldiv_t - lldiv(long long numer, + lldiv(long long number, long long denom); // (5) C++11 constexpr lldiv_t - lldiv(long long numer, + lldiv(long long number, long long denom); // (5) C++23 } ``` diff --git a/reference/new/hardware_destructive_interference_size.md b/reference/new/hardware_destructive_interference_size.md index 375be35fe7..78ca67e869 100644 --- a/reference/new/hardware_destructive_interference_size.md +++ b/reference/new/hardware_destructive_interference_size.md @@ -50,7 +50,7 @@ struct X { alignas(std::hardware_destructive_interference_size) int b; }; -struct IndivisualCacheInt { +struct IndividualCacheInt { alignas(std::hardware_destructive_interference_size) int value; }; @@ -83,7 +83,7 @@ int main() // 連続したメモリの各要素を、個別のキャッシュに乗せる { - std::vector v{10}; + std::vector v{10}; std::vector threads; for (std::size_t i = 0; i < v.size(); ++i) { threads.push_back(std::thread{[&v, i]{ diff --git a/reference/ranges/size.md b/reference/ranges/size.md index f17af9a876..80d30453e6 100644 --- a/reference/ranges/size.md +++ b/reference/ranges/size.md @@ -19,7 +19,7 @@ Rangeの要素数を取得する関数オブジェクト。 部分式`E`の型を`T`、`t`を`E`を評価した値とする。このとき、式`ranges::size(E)`の効果は以下の通り。 1. `T`が配列型であれば、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(`[`extent_v`](/reference/type_traits/extent.md)`)`に等しい(expression‑equivalent)。ただし、要素数不明の配列であれば、呼び出しは不適格。 -2. [`disable_sized_range`](disable_sized_range.md)`<`[`remove_cv_t`](/reference/type_traits/remove_cv.md)`>`が`false`、かつ[`decay-copy`](/reference/exposition-only/decay-copy.md)`(t.size())`が整数型(interger-like)の有効な式であれば、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(t.size())`と等しい。 +2. [`disable_sized_range`](disable_sized_range.md)`<`[`remove_cv_t`](/reference/type_traits/remove_cv.md)`>`が`false`、かつ[`decay-copy`](/reference/exposition-only/decay-copy.md)`(t.size())`が整数型(integer-like)の有効な式であれば、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(t.size())`と等しい。 3. `T`がクラス型または列挙体であって、[`disable_sized_range`](disable_sized_range.md)`<`[`remove_cv_t`](/reference/type_traits/remove_cv.md)`>`が`false`、かつ`size`がADLで見つかり、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(size(t))`が整数型の有効な式であれば、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(size(t))`と等しい。 4. `to-unsigned-like(`[`ranges::end`](end.md)`(t) - `[`ranges::begin`](begin.md)`(t))`が有効な式で、[`ranges::begin`](begin.md)の型`I`、[`ranges::end`](end.md)の型`S`が[`sized_sentinel_for`](/reference/iterator/disable_sized_sentinel_for.md)``と[`forward_iterator`](/reference/iterator/forward_iterator.md)のモデルであれば、`to-unsigned-like(`[`ranges::end`](end.md)`(t) - `[`ranges::begin`](begin.md)`(t))`と等しい。 @@ -33,7 +33,7 @@ Rangeの要素数。 もしくは、メンバ関数`size`を持たせるなどの方法でカスタマイズできる。 ## 備考 -`ranges::size(E)`が有効な式であるとき、その型は整数型(interger-like)。 +`ranges::size(E)`が有効な式であるとき、その型は整数型(integer-like)。 ## 例 ```cpp example diff --git a/reference/type_traits/is_trivially_copyable.md b/reference/type_traits/is_trivially_copyable.md index 52671bec75..c116b55b1c 100644 --- a/reference/type_traits/is_trivially_copyable.md +++ b/reference/type_traits/is_trivially_copyable.md @@ -203,7 +203,7 @@ static_assert(std::is_trivially_copyable::value == false, "De #ifdef __cpp_concepts // #1も#2も資格のあるコピーコンストラクタではなく、他に資格のあるコピー/ムーブ コンストラクタ/代入演算子がないためトリビアルコピー可能ではない static_assert(std::is_trivially_copyable>>::value == false, "std::unique_ptr isn't trivially copyable"); -// #2が資格のあるコピーコンストラクタであるが、user-proviedであるためトリビアルコピー可能ではない +// #2が資格のあるコピーコンストラクタであるが、user-providedであるためトリビアルコピー可能ではない static_assert(std::is_trivially_copyable>::value == false, "optional isn't trivially copyable"); // #1が資格のあるコピーコンストラクタであるのでトリビアルコピー可能 static_assert(std::is_trivially_copyable>::value == true, "optional is trivially copyable"); From 3fc04aac46c34e4fae26c034c53f23a5e17ec536 Mon Sep 17 00:00:00 2001 From: joseph0304 Date: Thu, 4 Jan 2024 12:28:36 +0900 Subject: [PATCH 0617/3948] =?UTF-8?q?typo=E3=81=A7=E3=81=AF=E3=81=AA?= =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=9F=E7=AE=87=E6=89=80=E3=82=92=E6=88=BB?= =?UTF-8?q?=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit override_final: miss-spelled -> mis-spelled div.md: number -> numer --- lang/cpp11/override_final.md | 2 +- reference/cstdlib/div.md | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lang/cpp11/override_final.md b/lang/cpp11/override_final.md index e64ae0510f..c3d6c8fcdd 100644 --- a/lang/cpp11/override_final.md +++ b/lang/cpp11/override_final.md @@ -269,7 +269,7 @@ struct base { }; struct derived [[check_names]] { - virtual void sone_func1(); // error, miss-spelled name + virtual void sone_func1(); // error, mis-spelled name virtual void some_func2(double); // error, no bad argument type virtual void some_func3(); // error, missing cv-qualification virtual int some_func4(int); // ill-formed: return type does not match B::h diff --git a/reference/cstdlib/div.md b/reference/cstdlib/div.md index 7a377b348d..afa02c6002 100644 --- a/reference/cstdlib/div.md +++ b/reference/cstdlib/div.md @@ -6,38 +6,38 @@ ```cpp namespace std { div_t - div(int number, + div(int numer, int denom); // (1) C++03 constexpr div_t - div(int number, + div(int numer, int denom); // (1) C++23 ldiv_t - div(long number, + div(long numer, long denom); // (2) C++03 constexpr ldiv_t - div(long number, + div(long numer, long denom); // (2) C++23 lldiv_t - div(long long number, + div(long long numer, long long denom); // (3) C++03 constexpr lldiv_t - div(long long number, + div(long long numer, long long denom); // (3) C++23 ldiv_t - ldiv(long number, + ldiv(long numer, long denom); // (4) C++03 constexpr ldiv_t - ldiv(long number, + ldiv(long numer, long denom); // (4) C++23 lldiv_t - lldiv(long long number, + lldiv(long long numer, long long denom); // (5) C++11 constexpr lldiv_t - lldiv(long long number, + lldiv(long long numer, long long denom); // (5) C++23 } ``` @@ -46,7 +46,7 @@ namespace std { * lldiv_t[link lldiv_t.md] ## 概要 -`number / denom`と`number % denom`の計算をひとつの操作で行う。 +`numer / denom`と`numer % denom`の計算をひとつの操作で行う。 - (1) : `int`型のオーバーロード - (2) : `long`型のオーバーロード From 4cbbdaef0bc744201837fd31b9c27583be1b7ae0 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 5 Jan 2024 18:09:24 +0900 Subject: [PATCH 0618/3948] =?UTF-8?q?functional/function=5Fref:=20?= =?UTF-8?q?=E6=A6=82=E8=A6=81=E3=81=AE=E3=81=BF(#1192)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 2 +- reference/functional.md | 2 +- reference/functional/copyable_function.md | 6 +- reference/functional/function.md | 2 +- reference/functional/function_ref.md | 119 +++++++++++++++++++++ reference/functional/move_only_function.md | 5 +- reference/utility.md | 8 ++ reference/utility/nontype_t.md | 74 +++++++++++++ 8 files changed, 210 insertions(+), 8 deletions(-) create mode 100644 reference/functional/function_ref.md create mode 100644 reference/utility/nontype_t.md diff --git a/lang/cpp26.md b/lang/cpp26.md index 1217cfb55d..640a980b9a 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -86,7 +86,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 ### 関数オブジェクト -- 所有権を保持しない[`std::function`](/reference/functional/function.md)として、[``](/reference/functional.md)に[`std::function_ref`](/reference/functional/function_ref.md.nolink)クラスを追加 +- 所有権を保持しない[`std::function`](/reference/functional/function.md)として、[``](/reference/functional.md)に[`std::function_ref`](/reference/functional/function_ref.md)クラスを追加 - [`std::move_only_function`](/reference/functional/move_only_function.md)のコピー可能版として、[``](/reference/functional.md)に[`std::copyable_function`](/reference/functional/copyable_function.md)クラスを追加 - [`std::bind_front()`](/reference/functional/bind_front.md)と[`std::bind_back()`](/reference/functional/bind_back.md.nolink)に、非型テンプレート引数として関数を指定するオーバーロードを追加 - 関連して、非型テンプレート引数の関数オブジェクトを反転させられるよう、[`not_fn()`](/reference/functional/not_fn.md)に非型テンプレート引数版のオーバーロードを追加 diff --git a/reference/functional.md b/reference/functional.md index 3f31d2c936..89b0b5430b 100644 --- a/reference/functional.md +++ b/reference/functional.md @@ -27,7 +27,7 @@ struct doubler { | [`bad_function_call`](functional/bad_function_call.md) | 不正な関数呼び出しに関する例外(class) | C++11 | | [`move_only_function`](functional/move_only_function.md) | ムーブのみ可能な関数・関数オブジェクトの多相軽量ラッパー(class template) | C++23 | | [`copyable_function`](functional/copyable_function.md) | コピー可能な関数・関数オブジェクトの多相軽量ラッパー(class template) | C++26 | -| [`function_ref`](functional/function_ref.md.nolink) | 関数・関数オブジェクトの多相参照ラッパー(class template) | C++26 | +| [`function_ref`](functional/function_ref.md) | 関数・関数オブジェクトの多相参照ラッパー(class template) | C++26 | ## 統一的な関数呼び出し diff --git a/reference/functional/copyable_function.md b/reference/functional/copyable_function.md index 40131badd1..f969169124 100644 --- a/reference/functional/copyable_function.md +++ b/reference/functional/copyable_function.md @@ -36,7 +36,6 @@ namespace std { ## メンバ関数 -### 構築・破棄 | 名前 | 説明 | 対応バージョン | |-----------------|----------------|----------------| @@ -235,8 +234,9 @@ int main() ## 関連項目 -- [`function`](function.md) -- [`move_only_function`](move_only_function.md) +- C++11 [`function`](function.md) +- C++23 [`move_only_function`](move_only_function.md) +- C++26 [`function_ref`](function_ref.md) ## 参照 diff --git a/reference/functional/function.md b/reference/functional/function.md index e074d0bcbe..3ece42c406 100644 --- a/reference/functional/function.md +++ b/reference/functional/function.md @@ -117,7 +117,7 @@ int main() ## 関連項目 - C++23 [`move_only_function`](move_only_function.md) - C++26 [`copyable_function`](copyable_function.md) -- C++26 [`function_ref`](function_ref.md.nolink) +- C++26 [`function_ref`](function_ref.md) ## 参照 diff --git a/reference/functional/function_ref.md b/reference/functional/function_ref.md new file mode 100644 index 0000000000..e9f9f54ac0 --- /dev/null +++ b/reference/functional/function_ref.md @@ -0,0 +1,119 @@ +# function_ref +* functional[meta header] +* class template[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std { + template + class function_ref; // 宣言のみ + + template + class function_ref; +} +``` + +## 概要 +`function_ref`クラステンプレートは、パラメータの型リスト`ArgTypes...`、戻り値の型`R`に合致する、あらゆる関数ポインタ、関数オブジェクト、メンバ関数ポインタ、メンバ変数ポインタを参照できるクラスである。 + +下記全ての組み合わせ(4種類)に対して、クラステンプレートの部分特殊化が提供される。 + +- CV修飾子 *cv* : `const`, CV修飾無し +- noexcept例外指定 *noex* : `true`, `false` + +`function_ref`クラステンプレートのあらゆる特殊化は[トリビアルコピー可能](/reference/type_traits/is_trivially_copyable.md)である。 + + +### `function`ファミリとの比較 +類似機能を提供する[`function`](function.md), [`move_only_function`](move_only_function.md), [`copyable_function`](copyable_function.md)とは異なり、`function_ref`は下記の特徴をもつ。 + +- 対象の所有権を管理しない軽量ラッパーとして実装される。 + - ポインタ2個のオブジェクトサイズで実装可能。 +- 構築時に必ず呼び出し対象を指定する必要がある。デフォルト構築不可。 + - `operator bool`を提供しない。 +- メンバ関数・メンバ変数を参照する場合は、[`std::nontype`](/reference/utility/nontype_t.md)タグを利用する。 + - 対象オブジェクトの束縛タイミングは、構築時または呼び出し時のいずれもサポートする。 +- ダングリング(dangling)参照を避けるため、左辺値(lvalue)のみを取り扱う。 + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|-----------------|----------------|----------------| +| [`(constructor)`](function_ref/op_constructor.md.nolink) | コンストラクタ | C++26 | +| (destructor) | デストラクタ | C++26 | +| [`operator=`](function_ref/op_assign.md.nolink) | 代入演算子 | C++26 | +| [`operator()`](function_ref/op_call.md.nolink) | 関数呼び出し | C++26 | + + +## 推論補助 + +| 名前 | 説明 | 対応バージョン | +|-----------------|----------------|----------------| +| [`(deduction_guide)`](function_ref/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++26 | + + +## 例 +### 例1: 基本の使い方 +```cpp example +#include +#include +#include // nontype + +// 呼び出し可能な何かを受け取る高階関数 +int hof(std::function_ref fn) +{ + return fn(2); +} + +int add(int x) { return x + 1; } + +struct Calc { + int x_; + int eval(int y) { + return x_ * y; + } +}; + +int main() +{ + // 通常関数を指定 + std::cout << hof(add) << std::endl; + // ラムダ式を指定 + std::cout << hof([](int x) { return x * 2; }) << std::endl; + + // オブジェクト束縛済みメンバ関数を指定 + Calc obj{ 3 }; + std::cout << hof({std::nontype<&Calc::eval>, obj}) << std::endl; +} +``` +* std::function_ref[color ff0000] +* std::nontype[link /reference/utility/nontype_t.md] + +#### 出力 +``` +3 +4 +6 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- C++11 [`function`](function.md) +- C++23 [`move_only_function`](move_only_function.md) +- C++26 [`copyable_function`](copyable_function.md) + + +## 参照 +- [P0792R14 `function_ref`: a type-erased callable reference](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p0792r14.html) diff --git a/reference/functional/move_only_function.md b/reference/functional/move_only_function.md index 1d76195614..dce2306850 100644 --- a/reference/functional/move_only_function.md +++ b/reference/functional/move_only_function.md @@ -37,7 +37,6 @@ namespace std { ## メンバ関数 -### 構築・破棄 | 名前 | 説明 | 対応バージョン | |-----------------|----------------|----------------| @@ -236,7 +235,9 @@ int main() ## 関連項目 -- [`function`](function.md) +- C++11 [`function`](function.md) +- C++26 [`copyable_function`](copyable_function.md) +- C++26 [`copyable_function`](copyable_function.md) ## 参照 diff --git a/reference/utility.md b/reference/utility.md index 490c181eb5..569b94ea63 100644 --- a/reference/utility.md +++ b/reference/utility.md @@ -98,6 +98,14 @@ | [`in_place_index`](utility/in_place_index_t.md) | 指定位置にある要素型のコンストラクタ引数を直接受け取って構築するためのタグ値 (constant variable) | C++17 | +## 非型引数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`nontype_t`](utility/nontype_t.md) | 非型引数を表現するためのタグ型 (class template) | C++26 | +| [`nontype`](utility/nontype_t.md) | 非型引数を表現するためのタグ値 (variable template) | C++26 | + + ## コンパイル時の整数シーケンス | 名前 | 説明 | 対応バージョン | diff --git a/reference/utility/nontype_t.md b/reference/utility/nontype_t.md new file mode 100644 index 0000000000..4d16bbf056 --- /dev/null +++ b/reference/utility/nontype_t.md @@ -0,0 +1,74 @@ +# nontype_t +* utility[meta header] +* std[meta namespace] +* class template[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + struct nontype_t { + explicit nontype_t() = default; + }; + + template constexpr nontype_t nontype{}; +} +``` + +## 概要 +`nontype_t`クラスは、オーバーロードのための空クラスである。 + +標準ライブラリの特定機能において、非型引数をテンプレートパラメータとして受け取って構築するための関数オーバーロードを定義するためにある。 + + +## 備考 +デフォルトコンストラクタに`explicit`が付いているのは、`nontype_t x = {};`のように`=`付きの波カッコ初期化を禁止するためである。ユーザーは通常、`nontype_t`型の変数テンプレートとして事前定義されている`nontype`を使用すればよいので、問題にはならない。 + + +## 例 +```cpp example +#include +#include +#include + +void call(std::function_ref fn) +{ + fn(); +} + +struct Dog { + void cry() { std::println("Bow-wow"); } +}; + +int main() +{ + Dog dog; + call({std::nontype<&Dog::cry>, dog}); +} +``` +* std::nontype[color ff0000] +* std::function_ref[link /reference/functional/function_ref.md] + +### 出力 +``` +Bow-wow +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`copyable_function`](/reference/functional/copyable_function.md) + + +## 参照 +- [P0792R14 `function_ref`: a type-erased callable reference](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p0792r14.html) From 9b4c3b8d48c0e541c1b1bd48e53d4d3e1139a09b Mon Sep 17 00:00:00 2001 From: yoh Date: Sat, 6 Jan 2024 22:02:41 +0900 Subject: [PATCH 0619/3948] =?UTF-8?q?functional/function=5Fref:=20?= =?UTF-8?q?=E8=A9=B3=E7=B4=B0=E8=AA=AC=E6=98=8E(#1192)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/functional/function_ref.md | 14 +- .../functional/function_ref/op_assign.md | 74 +++++++++ reference/functional/function_ref/op_call.md | 70 ++++++++ .../functional/function_ref/op_constructor.md | 157 ++++++++++++++++++ .../function_ref/op_deduction_guide.md | 93 +++++++++++ reference/utility/nontype_t.md | 2 +- 6 files changed, 402 insertions(+), 8 deletions(-) create mode 100644 reference/functional/function_ref/op_assign.md create mode 100644 reference/functional/function_ref/op_call.md create mode 100644 reference/functional/function_ref/op_constructor.md create mode 100644 reference/functional/function_ref/op_deduction_guide.md diff --git a/reference/functional/function_ref.md b/reference/functional/function_ref.md index e9f9f54ac0..63b9db3c92 100644 --- a/reference/functional/function_ref.md +++ b/reference/functional/function_ref.md @@ -22,7 +22,7 @@ namespace std { - CV修飾子 *cv* : `const`, CV修飾無し - noexcept例外指定 *noex* : `true`, `false` -`function_ref`クラステンプレートのあらゆる特殊化は[トリビアルコピー可能](/reference/type_traits/is_trivially_copyable.md)である。 +`function_ref`クラステンプレートの特殊化は、[`copyable`](/reference/concepts/copyable.md)のモデルである[トリビアルコピー可能](/reference/type_traits/is_trivially_copyable.md)な型となる。 ### `function`ファミリとの比較 @@ -41,17 +41,17 @@ namespace std { | 名前 | 説明 | 対応バージョン | |-----------------|----------------|----------------| -| [`(constructor)`](function_ref/op_constructor.md.nolink) | コンストラクタ | C++26 | -| (destructor) | デストラクタ | C++26 | -| [`operator=`](function_ref/op_assign.md.nolink) | 代入演算子 | C++26 | -| [`operator()`](function_ref/op_call.md.nolink) | 関数呼び出し | C++26 | +| [`(constructor)`](function_ref/op_constructor.md) | コンストラクタ | C++26 | +| `(destructor)` | デストラクタ | C++26 | +| [`operator=`](function_ref/op_assign.md) | 代入演算子 | C++26 | +| [`operator()`](function_ref/op_call.md) | 関数呼び出し | C++26 | ## 推論補助 | 名前 | 説明 | 対応バージョン | |-----------------|----------------|----------------| -| [`(deduction_guide)`](function_ref/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++26 | +| [`(deduction_guide)`](function_ref/op_deduction_guide.md) | クラステンプレートの推論補助 | C++26 | ## 例 @@ -59,7 +59,7 @@ namespace std { ```cpp example #include #include -#include // nontype +#include // 呼び出し可能な何かを受け取る高階関数 int hof(std::function_ref fn) diff --git a/reference/functional/function_ref/op_assign.md b/reference/functional/function_ref/op_assign.md new file mode 100644 index 0000000000..2c9f3166d4 --- /dev/null +++ b/reference/functional/function_ref/op_assign.md @@ -0,0 +1,74 @@ +# operator= +* functional[meta header] +* std[meta namespace] +* function_ref[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr function_ref& operator=(const function_ref&) noexcept = default; // (1) + +template function_ref& operator=(T) = delete; // (2) +``` + +## 概要 +コピー代入演算子。 + + +## テンプレートパラメータ制約 +- (2) : 以下の制約をみたすとき、代入演算子はdelete宣言される + - `T`が`function_ref`と同一型ではなく、かつ + - [`is_pointer_v`](/reference/type_traits/is_pointer.md)``が`false`であり、かつ + - `T`が[`nontype_t`](/reference/utility/nontype_t.md)の特殊化でないこと + + +## 効果 +- (1) : コピー代入。 + + +## 戻り値 +`*this` + + +## 例 +```cpp example +#include +#include + +int ident(int x) +{ return x; } + +int twice(int x) +{ return x * 2; } + +int main() +{ + std::function_ref f = ident; + std::function_ref g = twice; + + // コピー代入 + f = g; + + std::cout << f(1) << std::endl; +} +``` + +### 出力 +``` +2 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0792R14 `function_ref`: a type-erased callable reference](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p0792r14.html) diff --git a/reference/functional/function_ref/op_call.md b/reference/functional/function_ref/op_call.md new file mode 100644 index 0000000000..b6efb183f4 --- /dev/null +++ b/reference/functional/function_ref/op_call.md @@ -0,0 +1,70 @@ +# operator() +* functional[meta header] +* std[meta namespace] +* function_ref[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +R operator()(ArgTypes... args) const noexcept(/*noex*/); +``` + +## 概要 +関数を呼び出す。 + +`operator()`のnoexcept例外指定 *noex* は、[`function_ref`](../function_ref.md)に指定するテンプレートパラメータ`R(ArgTypes...)`部のものと等しい。 + + +## 効果 +以下と等価。参照対象に応じた詳細仕様は[コンストラクタ](op_constructor.md)説明を参照のこと。 + +```cpp +return thunk-ptr(bound-entity, std::forward(args)...); +``` +* thunk-ptr[italic] +* bound-entity[italic] +* std::forward[link /reference/utility/forward.md] + + +## 戻り値 +`R`型が`void`の場合は何も返さない。そうでなければ、関数呼び出しの戻り値を返す。 + + +## 例 +```cpp example +#include +#include + +int ident(int x) +{ return x; } + +int main() +{ + std::function_ref f = ident; + + // 関数呼び出し : 参照しているident()関数を呼び出す + int result = f(1); + + std::cout << result << std::endl; +} +``` + +### 出力 +``` +1 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0792R14 `function_ref`: a type-erased callable reference](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p0792r14.html) diff --git a/reference/functional/function_ref/op_constructor.md b/reference/functional/function_ref/op_constructor.md new file mode 100644 index 0000000000..e02e2e7ee5 --- /dev/null +++ b/reference/functional/function_ref/op_constructor.md @@ -0,0 +1,157 @@ +# コンストラクタ +* functional[meta header] +* std[meta namespace] +* function_ref[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +template function_ref(F* f) noexcept; // (1) + +template +constexpr function_ref(F&& f) noexcept; // (2) + +template +constexpr function_ref(nontype_t) noexcept; // (3) +template +constexpr function_ref(nontype_t, U&& obj) noexcept; // (4) +template +constexpr function_ref(nontype_t, /*cv*/ T* obj) noexcept; // (5) + +constexpr function_ref(const function_ref&) noexcept = default; // (6) +``` +* nontype_t[link /reference/utility/nontype_t.md] + +## 概要 +`function_ref`オブジェクトを構築する。 + +`function_ref`クラステンプレートパラメータのnoexcept例外指定 *noex* に応じて、説明用の`bool`型テンプレート定数`is-invocable-using`を次のように定義する : + +- *noex* が`true`のとき : [`is_nothrow_invocable_r_v`](/reference/type_traits/is_nothrow_invocable_r.md)`` +- *noex* が`false`のとき : [`is_invocable_r_v`](/reference/type_traits/is_invocable_r.md)`` + +`function_ref`オブジェクトは、説明専用のメンバ変数`thunk-ptr`と`bound-entity`を保持する。 + + +## テンプレートパラメータ制約 +- (1) : [`is_function`](/reference/type_traits/is_function.md)``が`true`、かつ`is-invocable-using`が`true`であること +- (2) : `T`を`remove_refernce_t`としたとき + - `remove_cvref_t`が`function_ref`と同一型ではなく、かつ + - [`is_member_pointer_v`](/reference/type_traits/is_member_pointer.md)`T`が`false`であり、かつ + - `is-invocable-using`が`true`であること +- (3) : `F`を`decltype(f)`としたとき + - `is-invocable-using`が`true`であること +- (4) : `T`を`remove_refernce_t`、`F`を`F`を`decltype(f)`としたとき + - [`is_rvalue_reference_v](/reference/type_traits/is_rvalue_reference.md)``が`false`であり、かつ + - `is-invocable-using`が`true`であること +- (5) : `F`を`decltype(f)`としたとき + - `is-invocable-using`が`true`であること + + +## 適格要件 +- (3), (4), (5) : `F`を`decltype(f)`としたとき、[`is_pointer`](/reference/type_traits/is_pointer.md)` ||` [`is_member_pointer`](/reference/type_traits/is_member_pointer.md)``が`true`ならば、`f`がヌルポインタでないこと。 + + +## 事前条件 +- (1) : `f`がヌルポインタでないこと。 + + +## 効果 +- (1) : `bound-entity`を`f`で、`thunk-ptr`を説明専用の関数`thunk`へのアドレスで初期化する。 + - [関数呼び出し`thunk(bound-entity, call-args...)`](op_call.md)は[`invoke_r`](/reference/functional/invoke_r.md)`(f, call-args...)`と等価。 +- (2) : `bound-entity`を[`addressof`](/reference/memory/addressof.md)`(f)`で、`thunk-ptr`を説明専用の関数`thunk`へのアドレスで初期化する。 + - [関数呼び出し`thunk(bound-entity, call-args...)`](op_call.md)は[`invoke_r`](/reference/functional/invoke_r.md)`(static_cast(f), call-args...)`と等価。 +- (3) : `bound-entity`を未規定オブジェクトへのポインタまたはヌルポインタで、`thunk-ptr`を説明専用の関数`thunk`へのアドレスで初期化する。 + - [関数呼び出し`thunk(bound-entity, call-args...)`](op_call.md)は[`invoke_r`](/reference/functional/invoke_r.md)`(f, call-args...)`と等価。 +- (4) : `bound-entity`を[`addressof`](/reference/memory/addressof.md)`(obj)`で、`thunk-ptr`を説明専用の関数`thunk`へのアドレスで初期化する。 + - [関数呼び出し`thunk(bound-entity, call-args...)`](op_call.md)は[`invoke_r`](/reference/functional/invoke_r.md)`(f, static_cast(obj), call-args...)`と等価。 +- (5) : `bound-entity`を`obj`で、`thunk-ptr`を説明専用の関数`thunk`へのアドレスで初期化する。 + - [関数呼び出し`thunk(bound-entity, call-args...)`](op_call.md)は[`invoke_r`](/reference/functional/invoke_r.md)`(f, obj, call-args...)`と等価。 +- (6) : コピーコンストラクタ。 + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include +#include + +int ident_func(int x) +{ return x; } + +struct ident_functor { + int operator()(int x) const + { return x; } +}; + +struct X { + int ident_func(int x) const + { return x; } +}; + + +int main() +{ + // (1) 関数ポインタ + { + std::function_ref f1 = &ident_func; + std::cout << "(1) : " << f1(1) << std::endl; + } + // (2) 関数オブジェクト + { + ident_functor functor; + std::function_ref f2 = functor; + std::cout << "(2) : " << f2(2) << std::endl; + } + // (3) メンバ関数 + { + std::function_ref f3 = std::nontype<&X::ident>; + X obj; + std::cout << "(3) : " << f3(obj, 3) << std::endl; + } + // (4), (5) メンバ関数+オブジェクト束縛 + { + X obj; + std::function_ref f4{std::nontype<&X::ident>, obj}; + std::cout << "(4) : " << f4(4) << std::endl; + std::function_ref f5{std::nontype<&X::ident>, &obj}; + std::cout << "(5) : " << f5(5) << std::endl; + } + // (6) コピーコンストラクタ + { + std::function_ref f1 = &ident_func; + std::function_ref f6 = f1; + std::cout << "(6) : " << f6(6) << std::endl; + } +} +``` +* std::nontype[link /reference/utility/nontype_t.md] + +### 出力 +``` +(1) : 1 +(2) : 2 +(3) : 3 +(4) : 4 +(5) : 5 +(6) : 6 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0792R14 `function_ref`: a type-erased callable reference](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p0792r14.html) diff --git a/reference/functional/function_ref/op_deduction_guide.md b/reference/functional/function_ref/op_deduction_guide.md new file mode 100644 index 0000000000..507dd12f2b --- /dev/null +++ b/reference/functional/function_ref/op_deduction_guide.md @@ -0,0 +1,93 @@ +# 推論補助 +* functional[meta header] +* std[meta namespace] +* function_ref[meta class] +* cpp26[meta cpp] + +```cpp +namespace std { + template + function_ref(F*) -> function_ref; // (1) + + template + function_ref(nontype_t) -> function_ref; // (2) + + template + function_ref(nontype_t, T&&) -> function_ref; // (3) +} +``` +* nontype_t[link /reference/utility/nontype_t.md] +* see below[italic] + + +## 概要 +`std::function_ref`クラステンプレートの型推論補助。 + + +## テンプレートパラメータ制約 +- (1) : [`is_function`](/reference/type_traits/is_function.md)``が`true`であること。 +- (2) : `F`を[`remove_pointer_t`](/reference/type_traits/remove_pointer.md)``としたとき、[`is_function`](/reference/type_traits/is_function.md)``が`true`であること。 +- (3) : `F`を`decltype(f)`としたとき + - 型`G`に対して`F`が`R(G::*)(A...) /*cv*/ & noexcept(E)`の形式(参照修飾子`&`は省略可、`E`は`bool`値)、または + - 型`G`とオブジェクト型`M`に対して`F`が`M G::*`の形式、または + - 型`G`に対して`F`が`R(*)(G, A...) noexcept(E)`の形式(`E`は`bool`値)であること + + +## 備考 +- (2) : `F`を[`remove_pointer_t`](/reference/type_traits/remove_pointer.md)``としたとき、型`function_ref`に推論される。 +- (3) : 型`function_ref`に推論される。 + - `F`が`M G::*`の形式のとき、`R`は[`invoke_result_t`](/reference/type_traits/invoke_result.md)``、`A...`は空のパック、`E`は`false`とする。 + - それ以外の形式のときは、テンプレートパラメータ制約の説明を参照。 + + +## 例 +```cpp example +#include + +int ident(int x) { return x; } + +struct X { + int data; + int mf(int x) { return x; } +}; + +int fun(X& obj) { return obj.data; } + +int main() +{ + // (1) 関数ポインタ + std::function_ref f1{&ident}; + + // (2) 関数ポインタ/NTTP + std::function_ref f2{std::nontype<&ident>}; + + // (3a) メンバ関数+オブジェクト束縛 + X obj{42}; + std::function_ref f3a{std::nontype<&X::mf>, obj}; + // (3b) メンバ変数+オブジェクト束縛 + std::function_ref f3b{std::nontype<&X::data>, obj}; + // (3c) 関数ポインタ+第1引数束縛 + std::function_ref f3c{std::nontype<&fun>, obj}; +} +``` +* std::function_ref[color ff0000] +* std::nontype[link /reference/utility/nontype_t.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0792R14 `function_ref`: a type-erased callable reference](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p0792r14.html) diff --git a/reference/utility/nontype_t.md b/reference/utility/nontype_t.md index 4d16bbf056..09211efc9f 100644 --- a/reference/utility/nontype_t.md +++ b/reference/utility/nontype_t.md @@ -67,7 +67,7 @@ Bow-wow ## 関連項目 -- [`copyable_function`](/reference/functional/copyable_function.md) +- [`function_ref`](/reference/functional/function_ref.md) ## 参照 From 0a6aa59227fd4e1ddb19a164d5351ecfacaa57ff Mon Sep 17 00:00:00 2001 From: yoh Date: Sat, 6 Jan 2024 22:11:40 +0900 Subject: [PATCH 0620/3948] function_ref/op_constructor.md: fix markup(#1192) --- reference/functional/function_ref/op_constructor.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/functional/function_ref/op_constructor.md b/reference/functional/function_ref/op_constructor.md index e02e2e7ee5..5152c1ef45 100644 --- a/reference/functional/function_ref/op_constructor.md +++ b/reference/functional/function_ref/op_constructor.md @@ -42,7 +42,7 @@ constexpr function_ref(const function_ref&) noexcept = default; // (6) - (3) : `F`を`decltype(f)`としたとき - `is-invocable-using`が`true`であること - (4) : `T`を`remove_refernce_t`、`F`を`F`を`decltype(f)`としたとき - - [`is_rvalue_reference_v](/reference/type_traits/is_rvalue_reference.md)``が`false`であり、かつ + - [`is_rvalue_reference_v`](/reference/type_traits/is_rvalue_reference.md)``が`false`であり、かつ - `is-invocable-using`が`true`であること - (5) : `F`を`decltype(f)`としたとき - `is-invocable-using`が`true`であること From 22a02d493591cb2ca982044feb8a313227f4ec7e Mon Sep 17 00:00:00 2001 From: yoh Date: Sun, 7 Jan 2024 12:21:49 +0900 Subject: [PATCH 0621/3948] functional/function_ref: some refinement(#1192) --- reference/functional/function_ref.md | 1 + reference/functional/function_ref/op_constructor.md | 12 ++++++++---- .../functional/function_ref/op_deduction_guide.md | 4 ++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/reference/functional/function_ref.md b/reference/functional/function_ref.md index 63b9db3c92..8d59b43741 100644 --- a/reference/functional/function_ref.md +++ b/reference/functional/function_ref.md @@ -16,6 +16,7 @@ namespace std { ## 概要 `function_ref`クラステンプレートは、パラメータの型リスト`ArgTypes...`、戻り値の型`R`に合致する、あらゆる関数ポインタ、関数オブジェクト、メンバ関数ポインタ、メンバ変数ポインタを参照できるクラスである。 +メンバ関数やメンバ変数に対してオブジェクトを束縛、関数ポインタや関数オブジェクトに対して第1引数を束縛した状態で参照することもできる。 下記全ての組み合わせ(4種類)に対して、クラステンプレートの部分特殊化が提供される。 diff --git a/reference/functional/function_ref/op_constructor.md b/reference/functional/function_ref/op_constructor.md index 5152c1ef45..83be90fc2a 100644 --- a/reference/functional/function_ref/op_constructor.md +++ b/reference/functional/function_ref/op_constructor.md @@ -34,14 +34,16 @@ constexpr function_ref(const function_ref&) noexcept = default; // (6) ## テンプレートパラメータ制約 +`function_ref`クラステンプレートパラメータのCV修飾子 *cv* に応じて + - (1) : [`is_function`](/reference/type_traits/is_function.md)``が`true`、かつ`is-invocable-using`が`true`であること -- (2) : `T`を`remove_refernce_t`としたとき - - `remove_cvref_t`が`function_ref`と同一型ではなく、かつ - - [`is_member_pointer_v`](/reference/type_traits/is_member_pointer.md)`T`が`false`であり、かつ +- (2) : `T`を[`remove_refernce_t`](/reference/type_traits/remove_reference.md)``としたとき + - [`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``が`function_ref`と同一型ではなく、かつ + - [`is_member_pointer_v`](/reference/type_traits/is_member_pointer.md)``が`false`であり、かつ - `is-invocable-using`が`true`であること - (3) : `F`を`decltype(f)`としたとき - `is-invocable-using`が`true`であること -- (4) : `T`を`remove_refernce_t`、`F`を`F`を`decltype(f)`としたとき +- (4) : `T`を[`remove_refernce_t`](/reference/type_traits/remove_reference.md)``、`F`を`decltype(f)`としたとき - [`is_rvalue_reference_v`](/reference/type_traits/is_rvalue_reference.md)``が`false`であり、かつ - `is-invocable-using`が`true`であること - (5) : `F`を`decltype(f)`としたとき @@ -57,6 +59,8 @@ constexpr function_ref(const function_ref&) noexcept = default; // (6) ## 効果 +`function_ref`クラステンプレートパラメータのCV修飾子 *cv* に応じて + - (1) : `bound-entity`を`f`で、`thunk-ptr`を説明専用の関数`thunk`へのアドレスで初期化する。 - [関数呼び出し`thunk(bound-entity, call-args...)`](op_call.md)は[`invoke_r`](/reference/functional/invoke_r.md)`(f, call-args...)`と等価。 - (2) : `bound-entity`を[`addressof`](/reference/memory/addressof.md)`(f)`で、`thunk-ptr`を説明専用の関数`thunk`へのアドレスで初期化する。 diff --git a/reference/functional/function_ref/op_deduction_guide.md b/reference/functional/function_ref/op_deduction_guide.md index 507dd12f2b..4ad2b4c144 100644 --- a/reference/functional/function_ref/op_deduction_guide.md +++ b/reference/functional/function_ref/op_deduction_guide.md @@ -36,8 +36,8 @@ namespace std { ## 備考 - (2) : `F`を[`remove_pointer_t`](/reference/type_traits/remove_pointer.md)``としたとき、型`function_ref`に推論される。 - (3) : 型`function_ref`に推論される。 - - `F`が`M G::*`の形式のとき、`R`は[`invoke_result_t`](/reference/type_traits/invoke_result.md)``、`A...`は空のパック、`E`は`false`とする。 - - それ以外の形式のときは、テンプレートパラメータ制約の説明を参照。 + - `F`が`M G::*`の形式のとき、`R`は[`invoke_result_t`](/reference/type_traits/invoke_result.md)``、`A...`は空のパック、`E`は`false`とする。 + - それ以外の形式のときは、テンプレートパラメータ制約の説明を参照。 ## 例 From f1173dacf9ca1dd8efeeb3984565c69b7d9dc203 Mon Sep 17 00:00:00 2001 From: yoh Date: Sun, 7 Jan 2024 12:34:26 +0900 Subject: [PATCH 0622/3948] =?UTF-8?q?GLOBAL=5FQUALIFY=5FLIST:=20?= =?UTF-8?q?=E3=83=98=E3=83=83=E3=83=80=E3=81=B8=E3=81=AE=E3=83=AA=E3=83=B3?= =?UTF-8?q?=E3=82=AF=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index e0b435e15e..5c4debf8af 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -150,6 +150,7 @@ * [link /reference/ostream.md] * std::basic_ostream[link /reference/ostream/basic_ostream.md] * std::endl[link /reference/ostream/endl.md] +* [link /reference/print.md] * [link /reference/queue.md] * [link /reference/random.md] * std::default_random_engine[link /reference/random/default_random_engine.md] From a0280b5a5332fb70925b893dfde840e8ebd58b2f Mon Sep 17 00:00:00 2001 From: yoh Date: Sun, 7 Jan 2024 16:59:33 +0900 Subject: [PATCH 0623/3948] =?UTF-8?q?mdspan/extents:=20=E6=A6=82=E8=A6=81(?= =?UTF-8?q?#1077)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23.md | 2 +- reference.md | 38 ++++++------ reference/mdspan.md | 49 ++++++++++++++++ reference/mdspan/extents.md | 112 ++++++++++++++++++++++++++++++++++++ reference/span.md | 3 +- 5 files changed, 184 insertions(+), 20 deletions(-) create mode 100644 reference/mdspan.md create mode 100644 reference/mdspan/extents.md diff --git a/lang/cpp23.md b/lang/cpp23.md index 63dc242b16..b8f550d13d 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -117,7 +117,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 - CとC++の間でのアトミック操作の相互運用のため、C互換ライブラリとして[``](/reference/stdatomic.h.md)を追加 - 外部から提供されるメモリバッファでストリーム処理を行うライブラリとして[``](/reference/spanstream.md.nolink)を追加 - 正常値とエラー値のどちらかを持つクラスおよびライブラリとして[``](/reference/expected.md)を追加 -- 多次元配列ビューのライブラリとして[``](/reference/mdspan.md.nolink)を追加 +- 多次元配列ビューのライブラリとして[``](/reference/mdspan.md)を追加 - ノードベースではないソート済みキーによる順序付き連想コンテナのライブラリとして、[``](/reference/flat_map.md)と[``](/reference/flat_set.md.nolink)を追加 - 書式指定で出力するライブラリとして[``](/reference/print.md)を追加 - コルーチンによるRangeの生成をサポートする[``](/reference/generator.md)を追加 diff --git a/reference.md b/reference.md index 7a1da26c9c..0747f86f5d 100644 --- a/reference.md +++ b/reference.md @@ -2,23 +2,25 @@ ## 目次 -- [言語サポートライブラリ](#language-support) -- [コンセプトライブラリ](#concepts) -- [診断ライブラリ](#diagnostics) -- [汎用的なユーティリティライブラリ](#general-utils) -- [文字列ライブラリ](#strings) -- [ローカライズライブラリ](#localization) -- [コンテナライブラリ](#container) -- [イテレータライブラリ](#iterator) -- [レンジライブラリ](#ranges) -- [アルゴリズムライブラリ](#algorithm) -- [数値ライブラリ](#numerics) -- [入出力ライブラリ](#io) -- [正規表現ライブラリ](#regular-expressions) -- [アトミック操作ライブラリ](#atomic-operations) -- [スレッドサポートライブラリ](#thread-support) -- [C言語互換ライブラリ](#clib-facilities) -- [説明専用ライブラリ](#exposition-only) +- [リファレンス](#リファレンス) + - [目次](#目次) + - [言語サポートライブラリ](#言語サポートライブラリ) + - [コンセプトライブラリ](#コンセプトライブラリ) + - [診断ライブラリ](#診断ライブラリ) + - [汎用的なユーティリティライブラリ](#汎用的なユーティリティライブラリ) + - [文字列ライブラリ](#文字列ライブラリ) + - [ローカライズライブラリ](#ローカライズライブラリ) + - [コンテナライブラリ](#コンテナライブラリ) + - [イテレータライブラリ](#イテレータライブラリ) + - [レンジライブラリ](#レンジライブラリ) + - [アルゴリズムライブラリ](#アルゴリズムライブラリ) + - [数値ライブラリ](#数値ライブラリ) + - [入出力ライブラリ](#入出力ライブラリ) + - [正規表現ライブラリ](#正規表現ライブラリ) + - [アトミック操作ライブラリ](#アトミック操作ライブラリ) + - [スレッドサポートライブラリ](#スレッドサポートライブラリ) + - [C言語互換ライブラリ](#c言語互換ライブラリ) + - [説明専用ライブラリ](#説明専用ライブラリ) *** @@ -113,7 +115,7 @@ | [``](/reference/unordered_map.md) | 非順序連想配列 | C++11 | | [``](/reference/unordered_set.md) | 非順序集合 | C++11 | | [``](/reference/span.md) | 部分シーケンスの参照 | C++20 | -| [``](/reference/mdspan.md.nolink) | 多次元配列ビュー | C++23 | +| [``](/reference/mdspan.md) | 多次元配列ビュー | C++23 | ## イテレータライブラリ diff --git a/reference/mdspan.md b/reference/mdspan.md new file mode 100644 index 0000000000..2a4c931e1d --- /dev/null +++ b/reference/mdspan.md @@ -0,0 +1,49 @@ +# mdspan +* mdspan[meta header] +* cpp23[meta cpp] + +``ヘッダでは、任意のメモリブロックに対して多次元配列のようにアクセスする機能を定義する。 + + +## 多次元配列サイズ + +| 名前 | 説明 | 対応バージョン | +|------|------|-------| +| [`extents`](mdspan/extents.md) | 多次元配列のサイズを表す値 (class template) | C++23 | +| [`dextents`](mdspan/extents.md) | 全次元が動的な多次元配列のサイズを表す値 (alias template) | C++23 | + + +## レイアウトマッピング + +| 名前 | 説明 | 対応バージョン | +|------|------|-------| +| [`layout_left`](mdspan/layout_left.md.nolink) | 最左次元が隣接するレイアウトマッピング (class) | C++23 | +| [`layout_right`](mdspan/layout_right.md.nolink) | 最右次元が隣接するレイアウトマッピング (class) | C++23 | +| [`layout_stride`](mdspan/layout_stride.md.nolink) | 汎用ストライド配置レイアウトマッピング (class) | C++23 | + + +## 要素アクセサ + +| 名前 | 説明 | 対応バージョン | +|------|------|-------| +| [`default_accessor`](mdspan/default_accessor.md.nolink) | デフォルトアクセサ (class template) | C++23 | + + +## 多次元配列ビュー + +| 名前 | 説明 | 対応バージョン | +|------|------|-------| +| [`mdspan`](mdspan/mdspan.md.nolink) | 多次元配列ビュー (class template) | C++23 | + + +## バージョン +### 言語 +- C++23 + + +## 関連項目 +- C++20 [``](span.md) + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/extents.md b/reference/mdspan/extents.md new file mode 100644 index 0000000000..1403114f23 --- /dev/null +++ b/reference/mdspan/extents.md @@ -0,0 +1,112 @@ +# extents +* mdspan[meta header] +* class template[meta id-type] +* std[meta namespace] +* cpp23[meta cpp] + +```cpp +namespace std { + template + class extents; + + template + using dextents = see below; +} +``` +* see below[italic] + +## 概要 +`extents`は、多次元配列の次元数、各次元の要素数、要素数が静的(コンパイル時)または動的(プログラム実行時)いずれのタイミングで指定されるかを表現する。 +多次元配列ビュー[`std::mdspan`](mdspan.md.nolink)に対して、多次元配列のサイズを指示するために用いられる。 + +- 多次元配列の次元数は`sizeof...(Extents)`に等しい +- `Extents`要素のうち[`dynamic_extent`](/reference/span/dynamic_extent.md)に等しい次元は、動的要素数(dynamic extent)となる +- それ以外の`Extents`要素の次元は、静的要素数(static extent)となる + +`extents`の特殊化は[`regular`](/reference/concepts/regular.md)のモデルであり、かつ[トリビアルコピー可能](/reference/type_traits/is_trivially_copyable.md)である。 + +エイリアステンプレート`dextents`は、全次元が動的要素数で指定される`extents`を生成する。 +例えば`dextents`は`extents`の略記となる。 + + +## 適格要件 + +- `IndexType`は符号付き整数型または符号無し整数型 +- `Extents`の各要素は[`dynamic_extent`](/reference/span/dynamic_extent.md)に等しい、または`IndexType`型で表現可能な値 + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`(constructor)`](extents/op_constructor.md.nolink) | コンストラクタ | C++23 | +| `(destructor)` | デストラクタ | C++23 | +| [`rank`](extents/rank.md.nolink) | 多次元配列の次元数を取得する | C++23 | +| [`rank_dynamic`](extents/rank_dynamic.md.nolink) | 多次元配列のうち動的要素数に指定された次元数を取得する | C++23 | +| [`static_extent`](extents/static_extent.md.nolink) | 指定次元の静的要素数を取得する | C++23 | +| [`extent`](extents/extent.md.nolink) | 指定次元の要素数を取得する | C++23 | + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `index_type` | `IndexType` | C++23 | +| `size_type` | [`make_unsigned_t`](/reference/type_traits/make_unsigned.md)`` | C++23 | +| `rank_type` | `size_t` | C++23 | + + +## 比較演算子 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`operator==`](extents/op_equal.md.nolink) | 等値比較 | C++23 | +| [`operator!=`](extents/op_equal.md.nolink) | 非等値比較 (`==`により使用可能) | C++23 | + + +## 推論補助 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`(deduction_guide)`](extents/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | + + +## 例 +```cpp example +#include + +int main() +{ + // 固定サイズ 3x3 の2次元配列サイズ + std::extents ext3x3; + + // 動的サイズをもつ2次元配列サイズを 4x2 で初期化 + using Ext2D = std::dextents; + Ext2D ext2d{4, 2}; + + // 2個の動的次元(高さ,幅)と固定次元(RGBA;4)からなる3次元配列サイズ + using ColorImageExt = std::dextents; + ColorImageExt image_ext{128, 128}; +} +``` +* std::extents[color ff0000] +* std::dextents[color ff0000] +* std::dynamic_extent[link /reference/span/dynamic_extent.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + + +## 関連項目 +- [`mdspan`](mdspan.md.nolink) + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) +- [P2599R2 index_type & size_type in mdspan](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2599r2.pdf) diff --git a/reference/span.md b/reference/span.md index 2e6b893f86..bb73d6fe40 100644 --- a/reference/span.md +++ b/reference/span.md @@ -16,4 +16,5 @@ ## 関連項目 -- [``](string_view.md) +- C++11 [``](string_view.md) +- C++23 [``](span.md) From e4401007436b18ac4d7559799870aab7444015f8 Mon Sep 17 00:00:00 2001 From: yoh Date: Sun, 7 Jan 2024 17:05:58 +0900 Subject: [PATCH 0624/3948] reference.md: revert TOC --- reference.md | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/reference.md b/reference.md index 0747f86f5d..9df528cfad 100644 --- a/reference.md +++ b/reference.md @@ -2,25 +2,23 @@ ## 目次 -- [リファレンス](#リファレンス) - - [目次](#目次) - - [言語サポートライブラリ](#言語サポートライブラリ) - - [コンセプトライブラリ](#コンセプトライブラリ) - - [診断ライブラリ](#診断ライブラリ) - - [汎用的なユーティリティライブラリ](#汎用的なユーティリティライブラリ) - - [文字列ライブラリ](#文字列ライブラリ) - - [ローカライズライブラリ](#ローカライズライブラリ) - - [コンテナライブラリ](#コンテナライブラリ) - - [イテレータライブラリ](#イテレータライブラリ) - - [レンジライブラリ](#レンジライブラリ) - - [アルゴリズムライブラリ](#アルゴリズムライブラリ) - - [数値ライブラリ](#数値ライブラリ) - - [入出力ライブラリ](#入出力ライブラリ) - - [正規表現ライブラリ](#正規表現ライブラリ) - - [アトミック操作ライブラリ](#アトミック操作ライブラリ) - - [スレッドサポートライブラリ](#スレッドサポートライブラリ) - - [C言語互換ライブラリ](#c言語互換ライブラリ) - - [説明専用ライブラリ](#説明専用ライブラリ) +- [言語サポートライブラリ](#language-support) +- [コンセプトライブラリ](#concepts) +- [診断ライブラリ](#diagnostics) +- [汎用的なユーティリティライブラリ](#general-utils) +- [文字列ライブラリ](#strings) +- [ローカライズライブラリ](#localization) +- [コンテナライブラリ](#container) +- [イテレータライブラリ](#iterator) +- [レンジライブラリ](#ranges) +- [アルゴリズムライブラリ](#algorithm) +- [数値ライブラリ](#numerics) +- [入出力ライブラリ](#io) +- [正規表現ライブラリ](#regular-expressions) +- [アトミック操作ライブラリ](#atomic-operations) +- [スレッドサポートライブラリ](#thread-support) +- [C言語互換ライブラリ](#clib-facilities) +- [説明専用ライブラリ](#exposition-only) *** From c7ab0726f09331e2c2ca7772477bd68030720a30 Mon Sep 17 00:00:00 2001 From: yoh Date: Sun, 7 Jan 2024 21:12:10 +0900 Subject: [PATCH 0625/3948] =?UTF-8?q?mdspan/mdspan:=20=E6=A6=82=E8=A6=81(#?= =?UTF-8?q?1077)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 2 +- reference/mdspan.md | 4 +- reference/mdspan/extents.md | 6 +- reference/mdspan/mdspan.md | 166 ++++++++++++++++++++++++++++++++++++ reference/span.md | 2 +- 5 files changed, 173 insertions(+), 7 deletions(-) create mode 100644 reference/mdspan/mdspan.md diff --git a/lang/cpp26.md b/lang/cpp26.md index 640a980b9a..02ea076283 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -53,7 +53,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 ### コンテナ -- [`std::mdspan`](/reference/mdspan/mdspan.md.nolink)のサブ配列版として[`std::submdspan`](/reference/mdspan/submdspan.md.nolink)を追加 +- [`std::mdspan`](/reference/mdspan/mdspan.md)のサブ配列版として[`std::submdspan`](/reference/mdspan/submdspan.md.nolink)を追加 - 連想コンテナの以下のメンバ関数に、一時オブジェクトが生成されるコストを抑える拡張を追加 - [`std::map`](/reference/map/map.md) - [`operator[]`](/reference/map/map/op_at.md) diff --git a/reference/mdspan.md b/reference/mdspan.md index 2a4c931e1d..f1fd482030 100644 --- a/reference/mdspan.md +++ b/reference/mdspan.md @@ -26,14 +26,14 @@ | 名前 | 説明 | 対応バージョン | |------|------|-------| -| [`default_accessor`](mdspan/default_accessor.md.nolink) | デフォルトアクセサ (class template) | C++23 | +| [`default_accessor`](mdspan/default_accessor.md.nolink) | デフォルト要素アクセサ (class template) | C++23 | ## 多次元配列ビュー | 名前 | 説明 | 対応バージョン | |------|------|-------| -| [`mdspan`](mdspan/mdspan.md.nolink) | 多次元配列ビュー (class template) | C++23 | +| [`mdspan`](mdspan/mdspan.md) | 多次元配列ビュー (class template) | C++23 | ## バージョン diff --git a/reference/mdspan/extents.md b/reference/mdspan/extents.md index 1403114f23..4e42d10441 100644 --- a/reference/mdspan/extents.md +++ b/reference/mdspan/extents.md @@ -17,7 +17,7 @@ namespace std { ## 概要 `extents`は、多次元配列の次元数、各次元の要素数、要素数が静的(コンパイル時)または動的(プログラム実行時)いずれのタイミングで指定されるかを表現する。 -多次元配列ビュー[`std::mdspan`](mdspan.md.nolink)に対して、多次元配列のサイズを指示するために用いられる。 +多次元配列ビュー[`std::mdspan`](mdspan.md)に対して、多次元配列のサイズを指示するために用いられる。 - 多次元配列の次元数は`sizeof...(Extents)`に等しい - `Extents`要素のうち[`dynamic_extent`](/reference/span/dynamic_extent.md)に等しい次元は、動的要素数(dynamic extent)となる @@ -104,9 +104,9 @@ int main() ## 関連項目 -- [`mdspan`](mdspan.md.nolink) +- [`mdspan`](mdspan.md) ## 参照 - [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) -- [P2599R2 index_type & size_type in mdspan](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2599r2.pdf) +- [P2599R2 `index_type` & `size_type` in `mdspan`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2599r2.pdf) diff --git a/reference/mdspan/mdspan.md b/reference/mdspan/mdspan.md new file mode 100644 index 0000000000..2de9025158 --- /dev/null +++ b/reference/mdspan/mdspan.md @@ -0,0 +1,166 @@ +# mdspan +* mdspan[meta header] +* class template[meta id-type] +* std[meta namespace] +* cpp23[meta cpp] + +```cpp +namespace std { + template> + class mdspan; +} +``` +* layout_right[link layout_right.md.nolink] +* default_accessor[link default_accessor.md.nolink] + +## 概要 +`mdspan`は、任意のメモリブロックに対して多次元配列のようにアクセスする機能を提供するクラスである。 + +`mdspan`の特殊化`MDS`は[`copyable`](/reference/concepts/copyable.md)のモデルであり、かつ + +- [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)``が`true`、かつ +- [`is_nothrow_move_assignable_v`](/reference/type_traits/is_nothrow_move_assignable.md)``が`true`、かつ +- [`is_nothrow_swappable_v`](/reference/type_traits/is_nothrow_swappable.md)``が1`true`となる。 + +そのメンバ型`accessor_type`, `mapping_type`, `pointer`が[トリビアルコピー可能](/reference/type_traits/is_trivially_copyable.md)であるとき、`mdspan`の特殊化もトリビアルコピー可能である。 + +### 説明専用メンバ変数 +`mdspan`クラスは、下記の説明専用メンバ変数を保持する。 + +- `acc_` : `accessor_type`型の要素アクセサ +- `map_` : `mapping_type`型のレイアウトマッピング +- `ptr_` : `data_handle_type`型のメモリブロックへのハンドル + + +## 適格要件 +- `ElementType`は抽象クラス型もしくは配列型のいずれでもない完全型であり、かつ +- `Extents`は[`extents`](extents.md)の特殊化であり、かつ +- [`is_same_v`](/reference/type_traits/is_same.md)``が`true`であること。 + +`LayoutPolicy`はレイアウトマッピングポリシー要件を満たし、かつ`AccessorPolicy`はアクセサポリシー要件を満たすこと。 + + +## メンバ関数 +### 構築・破棄 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`(constructor)`](mdspan/op_constructor.md.nolink) | コンストラクタ | C++23 | +| `(destructor)` | デストラクタ | C++23 | +| [`operator=`](mdspan/op_assing.md.nolink) | 代入演算子 | C++23 | + +### 要素へのアクセス + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`operator[]`](mdspan/op_at.md.nolink) | 多次元配列の要素アクセス | C++23 | + +### 多次元配列サイズ + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`rank`](mdspan/rank.md.nolink) | 多次元配列の次元数を取得する | C++23 | +| [`rank_dynamic`](mdspan/rank_dynamic.md.nolink) | 多次元配列のうち動的要素数に指定された次元数を取得する | C++23 | +| [`static_extent`](mdspan/static_extent.md.nolink) | 指定次元の静的要素数を取得する | C++23 | +| [`extent`](mdspan/extent.md.nolink) | 指定次元の要素数を取得する | C++23 | + +### 多次元インデクス空間 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`size`](mdspan/size.md.nolink) | メモリブロックに対する最大アクセス範囲を取得 | C++23 | +| [`empty`](mdspan/empty.md.nolink) | 最大アクセス範囲がサイズ0か否かを取得 | C++23 | + +### メンバ変数アクセサ + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`extents`](mdspan/extents.md.nolink) | 多次元配列のサイズ`map_.extents()`を取得 | C++23 | +| [`data_handle`](mdspan/data_handle.md.nolink) | メモリブロックへのハンドル`ptr_`を取得 | C++23 | +| [`mapping`](mdspan/mapping.md.nolink) | レイアウトマッピング`map_`を取得 | C++23 | +| [`accessor`](mdspan/accessor.md.nolink) | 要素アクセサ`acc_`を取得 | C++23 | + +### レイアウトマッピング + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `is_always_unique()` | `mapping_type::is_always_unique()` | C++23 | +| `is_always_exhaustive()` | `mapping_type::is_always_exhaustive()` | C++23 | +| `is_always_strided()` | `mapping_type::is_always_strided()` | C++23 | +| `is_unique()` | `map_.is_unique()` | C++23 | +| `is_exhaustive()` | `map_.is_exhaustive()` | C++23 | +| `is_strided()` | `map_.is_strided()` | C++23 | +| `stride(rank_type r)` | `map_.stride(r)` | C++23 | + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `extents_type` | 多次元配列サイズ型[`Extents`](extents.md) | C++23 | +| `layout_type` | レイアウトポリシー型`LayoutPolicy` | C++23 | +| `accessor_type` | アクセサポリシー型`AccessorPolicy` | C++23 | +| `mapping_type` | レイアウトマッピング型`typename layout_type::template mapping` | C++23 | +| `element_type` | 多次元配列の要素型`ElementType` | C++23 | +| `value_type` | 要素の値型[`remove_cv_t`](/reference/type_traits/remove_cvref.md)`` | C++23 | +| `size_type` | `typename extents_type::size_type` | C++23 | +| `rank_type` | `typename extents_type::rank_type` | C++23 | +| `pointer` | `typename accessor_type::pointer` | C++23 | +| `reference` | ` typename accessor_type::reference` | C++23 | + + +## 非メンバ(*Hidden friends*)関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `swap` | 2つのオブジェクトを入れ替える | C++23 | + + +## 例 +```cpp example +#include +#include + +int main() +{ + // メモリブロックに対する2次元配列/2x3要ビューを作成 + double arr[] = {1, 2, 3, 4, 5, 6}; + using Mat2x3 = std::extents; + std::mdspan mat{arr}; + + // 2次元配列の各要素を表示 + for (size_t i = 0; i < mat.extent(0); ++i) { + for (size_t j = 0; j < mat.extent(1); ++j) { + std::print("{} ", mat[i, j]); + } + std::println(""); + } +} +``` +* std::mdspan[color ff0000] +* std::extents[link extents.md] +* extent[link mdspan/extent.md.nolink] + +### 出力 +``` +1 2 3 +4 5 6 +``` + +## バージョン +### 言語 +- C++23 + + +## 関連項目 +- [`extents`](extents.md) + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) +- [P2599R2 `index_type` & `size_type` in `mdspan`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2599r2.pdf) +- [P2604R0 `mdspan`: rename `pointer` and `contiguous`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2604r0.html) +- [P2613R1 Add the missing `empty` to `mdspan`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2613r1.html) diff --git a/reference/span.md b/reference/span.md index bb73d6fe40..f28118b647 100644 --- a/reference/span.md +++ b/reference/span.md @@ -17,4 +17,4 @@ ## 関連項目 - C++11 [``](string_view.md) -- C++23 [``](span.md) +- C++23 [``](mdspan.md) From 3fa663860d835f09630b8cb9e457cb1735dde420 Mon Sep 17 00:00:00 2001 From: yoh Date: Sun, 7 Jan 2024 21:20:17 +0900 Subject: [PATCH 0626/3948] mdspan/mdspan: remove forbidden chars(#1077) --- reference/mdspan/mdspan.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/mdspan/mdspan.md b/reference/mdspan/mdspan.md index 2de9025158..20a2d61173 100644 --- a/reference/mdspan/mdspan.md +++ b/reference/mdspan/mdspan.md @@ -38,7 +38,7 @@ namespace std { ## 適格要件 - `ElementType`は抽象クラス型もしくは配列型のいずれでもない完全型であり、かつ - `Extents`は[`extents`](extents.md)の特殊化であり、かつ -- [`is_same_v`](/reference/type_traits/is_same.md)``が`true`であること。 +- [`is_same_v`](/reference/type_traits/is_same.md)``が`true`であること。 `LayoutPolicy`はレイアウトマッピングポリシー要件を満たし、かつ`AccessorPolicy`はアクセサポリシー要件を満たすこと。 From 40ff58769d30e3b1b7b8d3fad48dfe98fb92dd7f Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 8 Jan 2024 00:18:00 +0900 Subject: [PATCH 0627/3948] =?UTF-8?q?mdspan/default=5Faccessor:=20?= =?UTF-8?q?=E6=A6=82=E8=A6=81(#1077)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/mdspan.md | 2 +- reference/mdspan/default_accessor.md | 53 ++++++++++++++++++++++++++++ reference/mdspan/mdspan.md | 4 +-- 3 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 reference/mdspan/default_accessor.md diff --git a/reference/mdspan.md b/reference/mdspan.md index f1fd482030..ea8fbb3d07 100644 --- a/reference/mdspan.md +++ b/reference/mdspan.md @@ -26,7 +26,7 @@ | 名前 | 説明 | 対応バージョン | |------|------|-------| -| [`default_accessor`](mdspan/default_accessor.md.nolink) | デフォルト要素アクセサ (class template) | C++23 | +| [`default_accessor`](mdspan/default_accessor.md) | デフォルト要素アクセサ (class template) | C++23 | ## 多次元配列ビュー diff --git a/reference/mdspan/default_accessor.md b/reference/mdspan/default_accessor.md new file mode 100644 index 0000000000..fd0a6d58fc --- /dev/null +++ b/reference/mdspan/default_accessor.md @@ -0,0 +1,53 @@ +# default_accessor +* mdspan[meta header] +* class template[meta id-type] +* std[meta namespace] +* cpp23[meta cpp] + +```cpp +namespace std { + template + class default_accessor; +} +``` + +## 概要 +`default_accessor`は、多次元配列ビュー[`mdspan`](mdspan.md)の要素アクセスデフォルト動作を定義する。 + +`ElementType`は抽象クラス型もしくは配列型のいずれでもない完全型であること。 + +`default_accessor`はアクセサポリシー要件を満たす。 +また`default_accessor`は[トリビアルコピー可能](/reference/type_traits/is_trivially_copyable.md)であり、[`semiregular`](/reference/concepts/semiregular.md)のモデルである。 + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`(constructor)`](default_accessor/op_constructor.md.nolink) | コンストラクタ | C++23 | +| `(destructor)` | デストラクタ | C++23 | +| [`access`](default_accessor/access.md.nolink) | 指定オフセット位置にある要素へアクセスする | C++23 | +| [`offset`](default_accessor/offset.md.nolink) | 指定オフセット位置のハンドルを取得する | C++23 | + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `offset_policy` | `default_accessor` | C++23 | +| `element_type` | `ElementType` | C++23 | +| `reference` | `ElementType&` | C++23 | +| `data_handle_type` | `ElementType*` | C++23 | + + +## バージョン +### 言語 +- C++23 + + +## 関連項目 +- [`mdspan`](mdspan.md) + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) +- [Reddit - Why is mdspan::offset_policy needed?](https://www.reddit.com/r/cpp/comments/cgc37m/why_is_mdspanoffset_policy_needed/) diff --git a/reference/mdspan/mdspan.md b/reference/mdspan/mdspan.md index 20a2d61173..96090e5f6a 100644 --- a/reference/mdspan/mdspan.md +++ b/reference/mdspan/mdspan.md @@ -14,7 +14,7 @@ namespace std { } ``` * layout_right[link layout_right.md.nolink] -* default_accessor[link default_accessor.md.nolink] +* default_accessor[link default_accessor.md] ## 概要 `mdspan`は、任意のメモリブロックに対して多次元配列のようにアクセスする機能を提供するクラスである。 @@ -23,7 +23,7 @@ namespace std { - [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)``が`true`、かつ - [`is_nothrow_move_assignable_v`](/reference/type_traits/is_nothrow_move_assignable.md)``が`true`、かつ -- [`is_nothrow_swappable_v`](/reference/type_traits/is_nothrow_swappable.md)``が1`true`となる。 +- [`is_nothrow_swappable_v`](/reference/type_traits/is_nothrow_swappable.md)``が`true`となる。 そのメンバ型`accessor_type`, `mapping_type`, `pointer`が[トリビアルコピー可能](/reference/type_traits/is_trivially_copyable.md)であるとき、`mdspan`の特殊化もトリビアルコピー可能である。 From 6342d39bda99117b7e12ea563c26cbafb24a9058 Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 8 Jan 2024 15:46:40 +0900 Subject: [PATCH 0628/3948] =?UTF-8?q?mdspan/layout=5F*:=20=E6=A6=82?= =?UTF-8?q?=E8=A6=81(#1077)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/mdspan.md | 6 +-- reference/mdspan/default_accessor.md | 6 +++ reference/mdspan/extents.md | 8 ++- reference/mdspan/layout_left.md | 80 +++++++++++++++++++++++++++ reference/mdspan/layout_right.md | 80 +++++++++++++++++++++++++++ reference/mdspan/layout_stride.md | 81 ++++++++++++++++++++++++++++ reference/mdspan/mdspan.md | 9 +++- 7 files changed, 265 insertions(+), 5 deletions(-) create mode 100644 reference/mdspan/layout_left.md create mode 100644 reference/mdspan/layout_right.md create mode 100644 reference/mdspan/layout_stride.md diff --git a/reference/mdspan.md b/reference/mdspan.md index ea8fbb3d07..064c7bf32a 100644 --- a/reference/mdspan.md +++ b/reference/mdspan.md @@ -17,9 +17,9 @@ | 名前 | 説明 | 対応バージョン | |------|------|-------| -| [`layout_left`](mdspan/layout_left.md.nolink) | 最左次元が隣接するレイアウトマッピング (class) | C++23 | -| [`layout_right`](mdspan/layout_right.md.nolink) | 最右次元が隣接するレイアウトマッピング (class) | C++23 | -| [`layout_stride`](mdspan/layout_stride.md.nolink) | 汎用ストライド配置レイアウトマッピング (class) | C++23 | +| [`layout_left`](mdspan/layout_left.md) | 列優先(Fortran/Matlabスタイル)レイアウトマッピングポリシー (class) | C++23 | +| [`layout_right`](mdspan/layout_right.md) | 行優先(C/C++スタイル)レイアウトマッピングポリシー (class) | C++23 | +| [`layout_stride`](mdspan/layout_stride.md) | 汎用ストライド配置レイアウトマッピングポリシー (class) | C++23 | ## 要素アクセサ diff --git a/reference/mdspan/default_accessor.md b/reference/mdspan/default_accessor.md index fd0a6d58fc..9af53cfc51 100644 --- a/reference/mdspan/default_accessor.md +++ b/reference/mdspan/default_accessor.md @@ -43,6 +43,12 @@ namespace std { ### 言語 - C++23 +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + ## 関連項目 - [`mdspan`](mdspan.md) diff --git a/reference/mdspan/extents.md b/reference/mdspan/extents.md index 4e42d10441..776ae86337 100644 --- a/reference/mdspan/extents.md +++ b/reference/mdspan/extents.md @@ -85,7 +85,7 @@ int main() Ext2D ext2d{4, 2}; // 2個の動的次元(高さ,幅)と固定次元(RGBA;4)からなる3次元配列サイズ - using ColorImageExt = std::dextents; + using ColorImageExt = std::extents; ColorImageExt image_ext{128, 128}; } ``` @@ -102,6 +102,12 @@ int main() ### 言語 - C++23 +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + ## 関連項目 - [`mdspan`](mdspan.md) diff --git a/reference/mdspan/layout_left.md b/reference/mdspan/layout_left.md new file mode 100644 index 0000000000..39a9078ada --- /dev/null +++ b/reference/mdspan/layout_left.md @@ -0,0 +1,80 @@ +# layout_left +* mdspan[meta header] +* class[meta id-type] +* std[meta namespace] +* cpp23[meta cpp] + +```cpp +namespace std { + struct layout_left { + template + class mapping; + }; +} +``` +* Extents[link extents.md] +* mapping[link mapping.md.nolink] + +## 概要 +`layout_left`は、多次元配列ビュー[`mdspan`](mdspan.md)に対して、FortranやMatlab多次元配列と互換性のある列優先(column major)レイアウトマッピングを表現するポリシークラスである。 + +ポリシークラス名の由来は、多次元配列インデクスのうち最左次元が隣接配置(ストライド=1)されるところから来ている。 + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`mapping`](mapping.md.nolink) | レイアウトマッピング | C++23 | + + +## 例 +```cpp example +#include +#include + +int main() +{ + double arr[] = {1, 4, 2, 5, 3, 6}; + + // 要素数2x3の2次元配列/列優先レイアウト + using Dim2x3 = std::extents; + std::mdspan mat{arr}; + + for (size_t i = 0; i < mat.extent(0); ++i) { + for (size_t j = 0; j < mat.extent(1); ++j) { + std::cout << (j ? " " : "") << mat[i, j]; + } + std::cout << "\n"; + } +} +``` +* std::layout_left[color ff0000] +* std::mdspan[link mdspan.md] +* std::extents[link extents.md] + +### 出力 +``` +1 2 3 +4 5 6 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`layout_right`](layout_right.md) +- [`layout_stride`](layout_stride.md) + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/layout_right.md b/reference/mdspan/layout_right.md new file mode 100644 index 0000000000..a01e392bf4 --- /dev/null +++ b/reference/mdspan/layout_right.md @@ -0,0 +1,80 @@ +# layout_right +* mdspan[meta header] +* class[meta id-type] +* std[meta namespace] +* cpp23[meta cpp] + +```cpp +namespace std { + struct layout_right { + template + class mapping; + }; +} +``` +* Extents[link extents.md] +* mapping[link mapping.md.nolink] + +## 概要 +`layout_right`は、多次元配列ビュー[`mdspan`](mdspan.md)に対して、C/C++多次元配列と互換性のある行優先(row major)レイアウトマッピングを表現するポリシークラスである。 + +ポリシークラス名の由来は、多次元配列インデクスのうち最右次元が隣接配置(ストライド=1)されるところから来ている。 + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`mapping`](mapping.md.nolink) | レイアウトマッピング | C++23 | + + +## 例 +```cpp example +#include +#include + +int main() +{ + double arr[] = {1, 2, 3, 4, 5, 6}; + + // 要素数2x3の2次元配列/行優先レイアウト + using Dim2x3 = std::extents; + std::mdspan mat{arr}; + + for (size_t i = 0; i < mat.extent(0); ++i) { + for (size_t j = 0; j < mat.extent(1); ++j) { + std::cout << (j ? " " : "") << mat[i, j]; + } + std::cout << "\n"; + } +} +``` +* std::layout_right[color ff0000] +* std::mdspan[link mdspan.md] +* std::extents[link extents.md] + +### 出力 +``` +1 2 3 +4 5 6 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`layout_left`](layout_left.md) +- [`layout_stride`](layout_stride.md) + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/layout_stride.md b/reference/mdspan/layout_stride.md new file mode 100644 index 0000000000..d836124031 --- /dev/null +++ b/reference/mdspan/layout_stride.md @@ -0,0 +1,81 @@ +# layout_stride +* mdspan[meta header] +* class[meta id-type] +* std[meta namespace] +* cpp23[meta cpp] + +```cpp +namespace std { + struct layout_stride { + template + class mapping; + }; +} +``` +* Extents[link extents.md] +* mapping[link mapping.md.nolink] + +## 概要 +`layout_right`は、多次元配列ビュー[`mdspan`](mdspan.md)に対して、次元毎に任意ストライド幅を指定したレイアウトマッピングを表現するポリシークラスである。 + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`mapping`](mapping.md.nolink) | レイアウトマッピング | C++23 | + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + double arr[] = {1, 2, 3, 0, 4, 5, 6, 0}; + + // 要素数2x3の2次元配列/行優先かつパディングありレイアウト + using Dim2x3 = std::extents; + std::array strides{4, 1}; + std::layout_stride::mapping mapping{{}, strides}; + std::mdspan mat{arr, mapping}; + + for (size_t i = 0; i < mat.extent(0); ++i) { + for (size_t j = 0; j < mat.extent(1); ++j) { + std::cout << (j ? " " : "") << mat[i, j]; + } + std::cout << "\n"; + } +} +``` +* std::layout_stride[color ff0000] +* std::mdspan[link mdspan.md] +* std::extents[link extents.md] + +### 出力 +``` +1 2 3 +4 5 6 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`layout_left`](layout_left.md) +- [`layout_right`](layout_right.md) + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/mdspan.md b/reference/mdspan/mdspan.md index 96090e5f6a..dc612051b3 100644 --- a/reference/mdspan/mdspan.md +++ b/reference/mdspan/mdspan.md @@ -13,7 +13,7 @@ namespace std { class mdspan; } ``` -* layout_right[link layout_right.md.nolink] +* layout_right[link layout_right.md] * default_accessor[link default_accessor.md] ## 概要 @@ -150,10 +150,17 @@ int main() 4 5 6 ``` + ## バージョン ### 言語 - C++23 +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + ## 関連項目 - [`extents`](extents.md) From dc7da61b6fb966c11bc2363fdb4f46b683c78a63 Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 8 Jan 2024 18:38:45 +0900 Subject: [PATCH 0629/3948] =?UTF-8?q?mdspan/extents:=20=E5=85=A8=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=90(#1077)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 2 + reference/mdspan/extents.md | 33 ++-- reference/mdspan/extents/extent.md | 76 +++++++++ reference/mdspan/extents/op_constructor.md | 149 ++++++++++++++++++ .../mdspan/extents/op_deduction_guide.md | 59 +++++++ reference/mdspan/extents/op_equal.md | 70 ++++++++ reference/mdspan/extents/rank.md | 65 ++++++++ reference/mdspan/extents/rank_dynamic.md | 65 ++++++++ reference/mdspan/extents/static_extent.md | 76 +++++++++ reference/mdspan/layout_left.md | 4 +- reference/mdspan/layout_right.md | 4 +- reference/mdspan/layout_stride.md | 6 +- 12 files changed, 585 insertions(+), 24 deletions(-) create mode 100644 reference/mdspan/extents/extent.md create mode 100644 reference/mdspan/extents/op_constructor.md create mode 100644 reference/mdspan/extents/op_deduction_guide.md create mode 100644 reference/mdspan/extents/op_equal.md create mode 100644 reference/mdspan/extents/rank.md create mode 100644 reference/mdspan/extents/rank_dynamic.md create mode 100644 reference/mdspan/extents/static_extent.md diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 5c4debf8af..33bf2e3f27 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -131,6 +131,7 @@ * [link /reference/locale.md] * [link /reference/map.md] * std::map[link /reference/map/map.md] +* [link /reference/mdspan.md] * [link /reference/memory.md] * std::allocator[link /reference/memory/allocator.md] * std::shared_ptr[link /reference/memory/shared_ptr.md] @@ -167,6 +168,7 @@ * [link /reference/shared_mutex.md] * [link /reference/source_location.md] * [link /reference/span.md] + * std::dynamic_extent[link /reference/span/dynamic_extent.md] * [link /reference/sstream.md] * [link /reference/stack.md] * [link /reference/stacktrace.md] diff --git a/reference/mdspan/extents.md b/reference/mdspan/extents.md index 776ae86337..730d8c84bf 100644 --- a/reference/mdspan/extents.md +++ b/reference/mdspan/extents.md @@ -17,7 +17,7 @@ namespace std { ## 概要 `extents`は、多次元配列の次元数、各次元の要素数、要素数が静的(コンパイル時)または動的(プログラム実行時)いずれのタイミングで指定されるかを表現する。 -多次元配列ビュー[`std::mdspan`](mdspan.md)に対して、多次元配列のサイズを指示するために用いられる。 +多次元配列ビュー[`std::mdspan`](mdspan.md)に対して、多次元配列のサイズを指示するために用いる。 - 多次元配列の次元数は`sizeof...(Extents)`に等しい - `Extents`要素のうち[`dynamic_extent`](/reference/span/dynamic_extent.md)に等しい次元は、動的要素数(dynamic extent)となる @@ -25,7 +25,8 @@ namespace std { `extents`の特殊化は[`regular`](/reference/concepts/regular.md)のモデルであり、かつ[トリビアルコピー可能](/reference/type_traits/is_trivially_copyable.md)である。 -エイリアステンプレート`dextents`は、全次元が動的要素数で指定される`extents`を生成する。 +### エイリアステンプレート +エイリアステンプレート`dextents`は、次元数`Rank`かつ全次元が動的要素数で指定される`extents`を生成する。 例えば`dextents`は`extents`の略記となる。 @@ -39,12 +40,12 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`(constructor)`](extents/op_constructor.md.nolink) | コンストラクタ | C++23 | +| [`(constructor)`](extents/op_constructor.md) | コンストラクタ | C++23 | | `(destructor)` | デストラクタ | C++23 | -| [`rank`](extents/rank.md.nolink) | 多次元配列の次元数を取得する | C++23 | -| [`rank_dynamic`](extents/rank_dynamic.md.nolink) | 多次元配列のうち動的要素数に指定された次元数を取得する | C++23 | -| [`static_extent`](extents/static_extent.md.nolink) | 指定次元の静的要素数を取得する | C++23 | -| [`extent`](extents/extent.md.nolink) | 指定次元の要素数を取得する | C++23 | +| [`rank`](extents/rank.md) | 多次元配列の次元数を取得する | C++23 | +| [`rank_dynamic`](extents/rank_dynamic.md) | 多次元配列のうち動的要素数に指定された次元数を取得する | C++23 | +| [`static_extent`](extents/static_extent.md) | 指定次元の静的要素数を取得する | C++23 | +| [`extent`](extents/extent.md) | 指定次元の要素数を取得する | C++23 | ## メンバ型 @@ -60,15 +61,15 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`operator==`](extents/op_equal.md.nolink) | 等値比較 | C++23 | -| [`operator!=`](extents/op_equal.md.nolink) | 非等値比較 (`==`により使用可能) | C++23 | +| [`operator==`](extents/op_equal.md) | 等値比較 | C++23 | +| [`operator!=`](extents/op_equal.md) | 非等値比較 (`==`により使用可能) | C++23 | ## 推論補助 | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`(deduction_guide)`](extents/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | +| [`(deduction_guide)`](extents/op_deduction_guide.md) | クラステンプレートの推論補助 | C++23 | ## 例 @@ -77,21 +78,19 @@ namespace std { int main() { - // 固定サイズ 3x3 の2次元配列サイズ - std::extents ext3x3; + // 固定要素数 3x3 の2次元配列サイズ + std::extents ext3x3; - // 動的サイズをもつ2次元配列サイズを 4x2 で初期化 - using Ext2D = std::dextents; - Ext2D ext2d{4, 2}; + // 動的要素数からなる2次元配列サイズを 4x2 で初期化 + std::dextents ext2d{4, 2}; - // 2個の動的次元(高さ,幅)と固定次元(RGBA;4)からなる3次元配列サイズ + // 2個の動的要素数(高さ,幅)と静的要素数(RGBA=4)からなる3次元配列サイズ using ColorImageExt = std::extents; ColorImageExt image_ext{128, 128}; } ``` * std::extents[color ff0000] * std::dextents[color ff0000] -* std::dynamic_extent[link /reference/span/dynamic_extent.md] ### 出力 ``` diff --git a/reference/mdspan/extents/extent.md b/reference/mdspan/extents/extent.md new file mode 100644 index 0000000000..1c9827b180 --- /dev/null +++ b/reference/mdspan/extents/extent.md @@ -0,0 +1,76 @@ +# extent +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* extents[meta class] +* cpp23[meta cpp] + +```cpp +constexpr index_type extent(rank_type i) const noexcept; +``` + +## 概要 +多次元配列サイズのうち`i`番目次元の要素数を取得する。 + + +## 事前条件 +`i <` [`rank()`](rank.md)が`true` + + +## 戻り値 +`i`番目次元の要素数。 + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include + +int main() +{ + using Ext3x4 = std::extents; + static_assert(Ext3x4::static_extent(0) == 3); + static_assert(Ext3x4::static_extent(1) == 4); + Ext3x4 ext1; + assert(ext1.extent(0) == 3); + assert(ext1.extent(1) == 4); + + using Ext3xN = std::extents; + static_assert(Ext3xN::static_extent(0) == 3); + static_assert(Ext3xN::static_extent(1) == std::dynamic_extent); + Ext3xN ext2{10}; + assert(ext2.extent(0) == 3); + assert(ext2.extent(1) == 10); +} +``` +* extent()[color ff0000] +* static_extent()[link static_extent.md] +* std::extents[link ../extents.md] + + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`static_extent`](static_extent.md) + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/extents/op_constructor.md b/reference/mdspan/extents/op_constructor.md new file mode 100644 index 0000000000..2a0487d24a --- /dev/null +++ b/reference/mdspan/extents/op_constructor.md @@ -0,0 +1,149 @@ +# コンストラクタ +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* extents[meta class] +* cpp23[meta cpp] + +```cpp +constexpr extents() noexcept = default; // (1) + +template +constexpr explicit(see below) + extents(const extents& other) noexcept; // (2) + +template +constexpr explicit extents(OtherIndexTypes... exts) noexcept; // (3) + +template +constexpr explicit(N != rank_dynamic()) + extents(span exts) noexcept; // (4) + +template +constexpr explicit(N != rank_dynamic()) + extents(const array& exts) noexcept; // (5) +``` +* see below[italic] +* rank_dynamic()[link rank_dynamic.md] +* span[link /reference/span/span.md] +* array[link /reference/array/array.md] + +## 概要 +- (1) : デフォルトコンストラクタ +- (2) : 他`extents`からの変換コンストラクタ +- (3) : 要素数を値リストで設定するコンストラクタ +- (4) : 要素数を`span`で設定するコンストラクタ +- (5) : 要素数を`array`で設定するコンストラクタ + + +## テンプレートパラメータ制約 +- (2) : + - `sizeof...(OtherExtents) ==` [`rank()`](rank.md)が`ture`、かつ + - `((OtherExtents == dynamic_extent || Extents == dynamic_extent || OtherExtents == Extents) && ...)`が`ture`であること +- (3) : `N`を`sizeof...(OtherIndexTypes)`、`exts_arr`を[`array`](/reference/array/array.md)`{static_cast(std:move(exts))...}`としたとき + - `(`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` && ...)`が`ture`、かつ + - `(`[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_convertible.md)` && ...)`が`ture`、かつ + - `N ==` [`rank_dynamic()`](rank_dynamic.md) `|| N ==` [`rank()`](rank.md)が`true`であること +- (4), (5) : + - `(`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` && ...)`が`ture`、かつ + - `(`[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_convertible.md)` && ...)`が`ture`、かつ + - `N ==` [`rank_dynamic()`](rank_dynamic.md) `|| N ==` [`rank()`](rank.md)が`true`であること + + +## 事前条件 +- (2) : それぞれ`r`番目の次元が静的要素数に対して要素数が`other.`[`extent`](extent.md)`(r)`と等しく、かつ + - `sizeof...(OtherExtents) == 0`、もしくは + - `other`の全ての次元`r`において`other.extent(r)`が`index_type`型で表現可能な値であること +- (3) : `N`を`sizeof...(OtherIndexTypes)`、`exts_arr`を[`array`](/reference/array/array.md)`{static_cast(std:move(exts))...}`としたとき + - `N !=` [`rank_dynamic()`](rank_dynamic.md)ならば、それぞれ`r`番目の次元が静的要素数に対して要素数が`exts_arr[r]`と等しく、かつ + - `sizeof...(exts) == 0`もしくは`exts`の各要素が`index_type`型で表現可能な値であること +- (4), (5) : `N !=` [`rank_dynamic()`](rank_dynamic.md)ならば、それぞれ`r`番目の次元が静的要素数に対して要素数が`exts[r]`と等しく、かつ + - `N == 0`、もしくは + - `exts`の各要素が`index_type`型で表現可能な値であること + + +## 効果 +- (4), (5) : 動的要素数に指定された各次元の要素数を`exts`の値を用いて初期化する。 + + +## 事後条件 +- (2) : `*this == other` +- (3) : `exts_arr`を[`array`](/reference/array/array.md)`{static_cast(std:move(exts))...}`としたとき、`*this == extents(exts_arr)`(オーバーロード(5)の効果を参照) + + +## 例外 +投げない + + +## explicitになる条件 +- (2) : `(((Extents != dynamic_extent) && (OtherExtents == dynamic_extent)) || ... ) || (numeric_limits::max() < numeric_limits::max())` +- (4), (5) : `N !=` [`rank_dynamic()`](rank_dynamic.md) + + +## 例 +```cpp example +#include +#include +#include +#include + +using Ext3x4 = std::extents; +using Ext3xN = std::extents; + +int main() +{ + // (1) : デフォルトコンストラクタ + { + Ext3x4 ext1_3x4; + Ext3xN ext1_3xN; + } + // (2) : 変換コンストラクタ + { + Ext3x4 ext1_3x4; + Ext3xN ext1_3xN = ext1_3x4; + assert(ext1_3xN.extent(1) == 4); + } + // (3) : 要素数を値リストで設定するコンストラクタ + { + Ext3xN ext3_all{3, 4}; // 全次元を設定 + Ext3xN ext3_dyn{4}; // 動的要素数のみ設定 + assert(ext3_all == ext3_dyn); + } + // (4) : 要素数をspanで設定するコンストラクタ + { + int exts_all[] = {3, 4}; + int exts_dyn[] = {4}; + Ext3xN ext4_all{ std::span{exts_all} }; // 全次元を設定(explicit) + Ext3xN ext4_dyn = std::span{exts_dyn}; // 動的要素数のみ設定 + assert(ext4_all == ext4_dyn); + } + // (5) : 要素数をarrayで設定するコンストラクタ + { + std::array exts_all{3, 4}; + std::array exts_dyn{4}; + Ext3xN ext5_all{ exts_all }; // 全次元を設定(explicit) + Ext3xN ext5_dyn = exts_dyn; // 動的要素数のみ設定 + assert(ext5_all == ext5_dyn); + } +} +``` + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) +- [P2599R2 `index_type` & `size_type` in `mdspan`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2599r2.pdf) diff --git a/reference/mdspan/extents/op_deduction_guide.md b/reference/mdspan/extents/op_deduction_guide.md new file mode 100644 index 0000000000..7535824039 --- /dev/null +++ b/reference/mdspan/extents/op_deduction_guide.md @@ -0,0 +1,59 @@ +# 推論補助 +* mdspan[meta header] +* std[meta namespace] +* extents[meta class] +* cpp23[meta cpp] + +```cpp +namespace std { + template + explicit extents(Integrals...) -> see below; +} +``` +* see below[italic] + +## 概要 +`std::extents`クラステンプレートの型推論補助。多次元配列の動的要素数リストから[`std::dextents`](../extents.md)``型を推論する。 + + +## テンプレートパラメータ制約 +[`is_convertible_v`](/reference/type_traits/is_convertible.md)` && ...)`が`true`であること。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + // 動的要素数 3x3 の2次元配列サイズ + std::extents ext3x3{3, 3}; + + static_assert(std::same_as< + decltype(ext3x3), + std::dextens<2, std::dynamic_extent, std::dynamic_extent> + >); +} +``` +* std::extents[link ../extents.md] +* std::dextents[link ../extents.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/extents/op_equal.md b/reference/mdspan/extents/op_equal.md new file mode 100644 index 0000000000..cf11302ba9 --- /dev/null +++ b/reference/mdspan/extents/op_equal.md @@ -0,0 +1,70 @@ +# operator== +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* extents[meta class] +* cpp23[meta cpp] + +```cpp +template +friend constexpr bool operator==( + const extents& lhs, + const extents& rhs) noexcept; + +//operator==により、以下のオーバーロードが使用可能になる +template +friend constexpr bool operator!=( + const extents& lhs, + const extents& rhs) noexcept; +``` + +## 概要 +`extents`の等値比較を行う。 + + +## 戻り値 +`lhs`と`rhs`の次元数が等しく、かつ全事前の要素数が等しいときに`true`を返す。そうでなければ`false`を返す。 + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include + +int main() +{ + using Ext3x4 = std::extents; + Ext3x4 ext1; + + using Ext3xN = std::extents; + Ext3xN ext2{4}; + + assert(ext1 == ext2); +} +``` +* ==[color ff0000] +* std::extents[link ../extents.md] + + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/extents/rank.md b/reference/mdspan/extents/rank.md new file mode 100644 index 0000000000..fc1e9e5ade --- /dev/null +++ b/reference/mdspan/extents/rank.md @@ -0,0 +1,65 @@ +# rank +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* extents[meta class] +* cpp23[meta cpp] + +```cpp +static constexpr rank_type rank() noexcept; +``` + +## 概要 +多次元配列サイズの次元数を取得する。 + + +## 戻り値 +`sizeof...(Extents)` + + +## 例外 +投げない + + +## 例 +```cpp example +#include + +int main() +{ + using Ext3x4 = std::extents; + static_assert(Ext3x4::rank() == 2); + static_assert(Ext3x4::rank_dynamic() == 0); + + using Ext3xN = std::extents; + static_assert(Ext3xN::rank() == 2); + static_assert(Ext3xN::rank_dynamic() == 1); +} +``` +* rank()[color ff0000] +* rank_dynamic()[link rank_dynamic.md] +* std::extents[link ../extents.md] + + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`rank_dynamic`](rank_dynamic.md) + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/extents/rank_dynamic.md b/reference/mdspan/extents/rank_dynamic.md new file mode 100644 index 0000000000..a5b2fdcdaa --- /dev/null +++ b/reference/mdspan/extents/rank_dynamic.md @@ -0,0 +1,65 @@ +# rank_dynamic +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* extents[meta class] +* cpp23[meta cpp] + +```cpp +static constexpr rank_type rank_dynamic() noexcept; +``` + +## 概要 +多次元配列サイズの次元数うち、動的要素数に指定された次元数を取得する。 + + +## 戻り値 +動的要素数に指定された次元数 + + +## 例外 +投げない + + +## 例 +```cpp example +#include + +int main() +{ + using Ext3x4 = std::extents; + static_assert(Ext3x4::rank() == 2); + static_assert(Ext3x4::rank_dynamic() == 0); + + using Ext3xN = std::extents; + static_assert(Ext3xN::rank() == 2); + static_assert(Ext3xN::rank_dynamic() == 1); +} +``` +* rank_dynamic()[color ff0000] +* rank()[link rank.md] +* std::extents[link ../extents.md] + + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`rank`](rank.md) + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/extents/static_extent.md b/reference/mdspan/extents/static_extent.md new file mode 100644 index 0000000000..40dcde8018 --- /dev/null +++ b/reference/mdspan/extents/static_extent.md @@ -0,0 +1,76 @@ +# static_extent +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* extents[meta class] +* cpp23[meta cpp] + +```cpp +static constexpr size_t static_extent(rank_type i) noexcept; +``` + +## 概要 +多次元配列サイズのうち`i`番目次元の静的要素数を取得する。 + + +## 事前条件 +`i <` [`rank()`](rank.md)が`true` + + +## 戻り値 +`i`番目次元の静的要素数。同次元が動的要素数の場合は[`std::dynamic_extent`](/reference/span/dynamic_extent.md)を返す。 + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include + +int main() +{ + using Ext3x4 = std::extents; + static_assert(Ext3x4::static_extent(0) == 3); + static_assert(Ext3x4::static_extent(1) == 4); + Ext3x4 ext1; + assert(ext1.extent(0) == 3); + assert(ext1.extent(1) == 4); + + using Ext3xN = std::extents; + static_assert(Ext3xN::static_extent(0) == 3); + static_assert(Ext3xN::static_extent(1) == std::dynamic_extent); + Ext3xN ext2{10}; + assert(ext2.extent(0) == 3); + assert(ext2.extent(1) == 10); +} +``` +* static_extent()[color ff0000] +* extent()[link extent.md] +* std::extents[link ../extents.md] + + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`extent`](extent.md) + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/layout_left.md b/reference/mdspan/layout_left.md index 39a9078ada..2c01a5492d 100644 --- a/reference/mdspan/layout_left.md +++ b/reference/mdspan/layout_left.md @@ -38,8 +38,8 @@ int main() double arr[] = {1, 4, 2, 5, 3, 6}; // 要素数2x3の2次元配列/列優先レイアウト - using Dim2x3 = std::extents; - std::mdspan mat{arr}; + using Ext2x3 = std::extents; + std::mdspan mat{arr}; for (size_t i = 0; i < mat.extent(0); ++i) { for (size_t j = 0; j < mat.extent(1); ++j) { diff --git a/reference/mdspan/layout_right.md b/reference/mdspan/layout_right.md index a01e392bf4..67c72013b5 100644 --- a/reference/mdspan/layout_right.md +++ b/reference/mdspan/layout_right.md @@ -38,8 +38,8 @@ int main() double arr[] = {1, 2, 3, 4, 5, 6}; // 要素数2x3の2次元配列/行優先レイアウト - using Dim2x3 = std::extents; - std::mdspan mat{arr}; + using Ext2x3 = std::extents; + std::mdspan mat{arr}; for (size_t i = 0; i < mat.extent(0); ++i) { for (size_t j = 0; j < mat.extent(1); ++j) { diff --git a/reference/mdspan/layout_stride.md b/reference/mdspan/layout_stride.md index d836124031..773767c47a 100644 --- a/reference/mdspan/layout_stride.md +++ b/reference/mdspan/layout_stride.md @@ -37,10 +37,10 @@ int main() double arr[] = {1, 2, 3, 0, 4, 5, 6, 0}; // 要素数2x3の2次元配列/行優先かつパディングありレイアウト - using Dim2x3 = std::extents; + using Ext2x3 = std::extents; std::array strides{4, 1}; - std::layout_stride::mapping mapping{{}, strides}; - std::mdspan mat{arr, mapping}; + std::layout_stride::mapping mapping{{}, strides}; + std::mdspan mat{arr, mapping}; for (size_t i = 0; i < mat.extent(0); ++i) { for (size_t j = 0; j < mat.extent(1); ++j) { From 1ddfc8dbf8651be1d6fd1045c0513e9defac386d Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 8 Jan 2024 18:46:36 +0900 Subject: [PATCH 0630/3948] mdspan/extents: some fixes(#1077) --- reference/mdspan/extents/extent.md | 4 ++-- reference/mdspan/extents/op_deduction_guide.md | 6 +----- reference/mdspan/extents/static_extent.md | 4 ++-- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/reference/mdspan/extents/extent.md b/reference/mdspan/extents/extent.md index 1c9827b180..88ac76094d 100644 --- a/reference/mdspan/extents/extent.md +++ b/reference/mdspan/extents/extent.md @@ -47,8 +47,8 @@ int main() assert(ext2.extent(1) == 10); } ``` -* extent()[color ff0000] -* static_extent()[link static_extent.md] +* extent[color ff0000] +* static_extent[link static_extent.md] * std::extents[link ../extents.md] diff --git a/reference/mdspan/extents/op_deduction_guide.md b/reference/mdspan/extents/op_deduction_guide.md index 7535824039..7dce8c13ce 100644 --- a/reference/mdspan/extents/op_deduction_guide.md +++ b/reference/mdspan/extents/op_deduction_guide.md @@ -29,11 +29,7 @@ int main() { // 動的要素数 3x3 の2次元配列サイズ std::extents ext3x3{3, 3}; - - static_assert(std::same_as< - decltype(ext3x3), - std::dextens<2, std::dynamic_extent, std::dynamic_extent> - >); + static_assert(std::same_as>); } ``` * std::extents[link ../extents.md] diff --git a/reference/mdspan/extents/static_extent.md b/reference/mdspan/extents/static_extent.md index 40dcde8018..5c324a3a95 100644 --- a/reference/mdspan/extents/static_extent.md +++ b/reference/mdspan/extents/static_extent.md @@ -47,8 +47,8 @@ int main() assert(ext2.extent(1) == 10); } ``` -* static_extent()[color ff0000] -* extent()[link extent.md] +* static_extent[color ff0000] +* extent[link extent.md] * std::extents[link ../extents.md] From d862f0ab454aeab0a7659295980f7915b346cf72 Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 8 Jan 2024 22:35:12 +0900 Subject: [PATCH 0631/3948] mdspan/extents: refinements(#1077) --- reference/mdspan/extents.md | 24 +++++++++++++++---- reference/mdspan/extents/extent.md | 2 +- reference/mdspan/extents/op_constructor.md | 4 +++- .../mdspan/extents/op_deduction_guide.md | 2 +- reference/mdspan/extents/op_equal.md | 2 +- reference/mdspan/extents/static_extent.md | 2 +- reference/mdspan/layout_stride.md | 2 +- 7 files changed, 27 insertions(+), 11 deletions(-) diff --git a/reference/mdspan/extents.md b/reference/mdspan/extents.md index 730d8c84bf..3851a56db7 100644 --- a/reference/mdspan/extents.md +++ b/reference/mdspan/extents.md @@ -16,14 +16,28 @@ namespace std { * see below[italic] ## 概要 -`extents`は、多次元配列の次元数、各次元の要素数、要素数が静的(コンパイル時)または動的(プログラム実行時)いずれのタイミングで指定されるかを表現する。 +`extents`は、多次元配列の次元数(rank)と各次元の要素数(extent)を表現する。 多次元配列ビュー[`std::mdspan`](mdspan.md)に対して、多次元配列のサイズを指示するために用いる。 +`extents`の特殊化は[`regular`](/reference/concepts/regular.md)のモデルであり、かつ[トリビアルコピー可能](/reference/type_traits/is_trivially_copyable.md)である。 + +### 要素数の動的/静的指定 +多次元配列における次元の要素数が静的(コンパイル時)または動的(プログラム実行時)いずれのタイミングで決定するかを、各次元毎に指定する。 + - 多次元配列の次元数は`sizeof...(Extents)`に等しい -- `Extents`要素のうち[`dynamic_extent`](/reference/span/dynamic_extent.md)に等しい次元は、動的要素数(dynamic extent)となる -- それ以外の`Extents`要素の次元は、静的要素数(static extent)となる +- `Extents`要素が[`dynamic_extent`](/reference/span/dynamic_extent.md)に等しい次元は、動的要素数(dynamic extent)となる +- `Extents`要素がコンパイル時に整数値指定された次元は、静的要素数(static extent)となる -`extents`の特殊化は[`regular`](/reference/concepts/regular.md)のモデルであり、かつ[トリビアルコピー可能](/reference/type_traits/is_trivially_copyable.md)である。 +`extents`は、下記の説明専用メンバ変数を保持する。 + +```cpp +array dynamic-extents; +``` +* array[link /reference/array/array.md] +* rank_dynamic()[link extents/rank_dynamic.md] + +`extents`オブジェクトサイズ最小化のため、動的要素数次元のサイズ情報のみを`IndexType`型配列として管理する。 +動的要素数次元のサイズ情報は非型テンプレートパラメータとして型情報に埋め込まれるため、プログラム実行時のメモリ使用量には影響しない。 ### エイリアステンプレート エイリアステンプレート`dextents`は、次元数`Rank`かつ全次元が動的要素数で指定される`extents`を生成する。 @@ -53,7 +67,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| | `index_type` | `IndexType` | C++23 | -| `size_type` | [`make_unsigned_t`](/reference/type_traits/make_unsigned.md)`` | C++23 | +| `size_type` | [`make_unsigned_t`](/reference/type_traits/make_unsigned.md)`` | C++23 | | `rank_type` | `size_t` | C++23 | diff --git a/reference/mdspan/extents/extent.md b/reference/mdspan/extents/extent.md index 88ac76094d..d27bd55964 100644 --- a/reference/mdspan/extents/extent.md +++ b/reference/mdspan/extents/extent.md @@ -14,7 +14,7 @@ constexpr index_type extent(rank_type i) const noexcept; ## 事前条件 -`i <` [`rank()`](rank.md)が`true` +`i <` [`rank()`](rank.md) ## 戻り値 diff --git a/reference/mdspan/extents/op_constructor.md b/reference/mdspan/extents/op_constructor.md index 2a0487d24a..09e213fd7f 100644 --- a/reference/mdspan/extents/op_constructor.md +++ b/reference/mdspan/extents/op_constructor.md @@ -88,7 +88,7 @@ constexpr explicit(N != rank_dynamic()) #include using Ext3x4 = std::extents; -using Ext3xN = std::extents; +using Ext3xN = std::extents; int main() { @@ -127,6 +127,8 @@ int main() } } ``` +* std::extents[link ../extents.md] +* std::span[link /reference/span/span.md] ### 出力 ``` diff --git a/reference/mdspan/extents/op_deduction_guide.md b/reference/mdspan/extents/op_deduction_guide.md index 7dce8c13ce..29d65744bf 100644 --- a/reference/mdspan/extents/op_deduction_guide.md +++ b/reference/mdspan/extents/op_deduction_guide.md @@ -22,7 +22,7 @@ namespace std { ## 例 ```cpp example -#include +#include #include int main() diff --git a/reference/mdspan/extents/op_equal.md b/reference/mdspan/extents/op_equal.md index cf11302ba9..d59fa43195 100644 --- a/reference/mdspan/extents/op_equal.md +++ b/reference/mdspan/extents/op_equal.md @@ -23,7 +23,7 @@ friend constexpr bool operator!=( ## 戻り値 -`lhs`と`rhs`の次元数が等しく、かつ全事前の要素数が等しいときに`true`を返す。そうでなければ`false`を返す。 +`lhs`と`rhs`の次元数[`rank`](rank.md)が等しく、かつ全次元の要素数[`extent`](extent.md)が等しいときに`true`を返す。そうでなければ`false`を返す。 ## 例外 diff --git a/reference/mdspan/extents/static_extent.md b/reference/mdspan/extents/static_extent.md index 5c324a3a95..d8cbe1b137 100644 --- a/reference/mdspan/extents/static_extent.md +++ b/reference/mdspan/extents/static_extent.md @@ -14,7 +14,7 @@ static constexpr size_t static_extent(rank_type i) noexcept; ## 事前条件 -`i <` [`rank()`](rank.md)が`true` +`i <` [`rank()`](rank.md) ## 戻り値 diff --git a/reference/mdspan/layout_stride.md b/reference/mdspan/layout_stride.md index 773767c47a..1163ecf4d4 100644 --- a/reference/mdspan/layout_stride.md +++ b/reference/mdspan/layout_stride.md @@ -16,7 +16,7 @@ namespace std { * mapping[link mapping.md.nolink] ## 概要 -`layout_right`は、多次元配列ビュー[`mdspan`](mdspan.md)に対して、次元毎に任意ストライド幅を指定したレイアウトマッピングを表現するポリシークラスである。 +`layout_stride`は、多次元配列ビュー[`mdspan`](mdspan.md)に対して、次元毎に任意ストライド幅を指定したレイアウトマッピングを表現するポリシークラスである。 ## メンバ型 From c473fc9cdfef1938b8090218dd42611c840c64e0 Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 8 Jan 2024 23:17:53 +0900 Subject: [PATCH 0632/3948] =?UTF-8?q?mdspan/default=5Faccessor:=20?= =?UTF-8?q?=E5=85=A8=E3=83=A1=E3=83=B3=E3=83=90(#1077)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/mdspan/default_accessor.md | 34 ++++++++++++--- reference/mdspan/default_accessor/access.md | 36 ++++++++++++++++ reference/mdspan/default_accessor/offset.md | 35 ++++++++++++++++ .../mdspan/default_accessor/op_constructor.md | 41 +++++++++++++++++++ reference/mdspan/mdspan.md | 30 +++++++------- 5 files changed, 156 insertions(+), 20 deletions(-) create mode 100644 reference/mdspan/default_accessor/access.md create mode 100644 reference/mdspan/default_accessor/offset.md create mode 100644 reference/mdspan/default_accessor/op_constructor.md diff --git a/reference/mdspan/default_accessor.md b/reference/mdspan/default_accessor.md index 9af53cfc51..beb9dc7cca 100644 --- a/reference/mdspan/default_accessor.md +++ b/reference/mdspan/default_accessor.md @@ -12,21 +12,43 @@ namespace std { ``` ## 概要 -`default_accessor`は、多次元配列ビュー[`mdspan`](mdspan.md)の要素アクセスデフォルト動作を定義する。 +`default_accessor`は、多次元配列ビュー[`mdspan`](mdspan.md)を介した要素アクセスのデフォルト動作を定義する。 `ElementType`は抽象クラス型もしくは配列型のいずれでもない完全型であること。 -`default_accessor`はアクセサポリシー要件を満たす。 -また`default_accessor`は[トリビアルコピー可能](/reference/type_traits/is_trivially_copyable.md)であり、[`semiregular`](/reference/concepts/semiregular.md)のモデルである。 +`default_accessor`は[トリビアルコピー可能](/reference/type_traits/is_trivially_copyable.md)であり、[`semiregular`](/reference/concepts/semiregular.md)のモデルである。 + +### アクセサポリシー要件 +`default_accessor`は、下記のアクセサポリシー要件を満たす。 + +説明用の型`A`をアクセサポリシーとしたとき + +- `A`は[`copyable`](/reference/concepts/copyable.md)のモデルであり、かつ +- [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)``は`true`であり、かつ +- [`is_nothrow_move_assignable_v`](/reference/type_traits/is_nothrow_move_assignable.md)``は`true`であり、かつ +- [`is_nothrow_swappable_v`](/reference/type_traits/is_nothrow_swappable.md)``は`true`であること + +型`A`は下記のメンバ型を持つこと + +- `A::element_type` : 要素型 +- `A::data_handle_type` : メモリブロックのポインタ型 +- `A::reference` : 要素への参照型 +- `A::offset_policy` : `offset`適用後のアクセサポリシー + +説明用の変数`a`を`(const) A`の値、`p`を`(const) A::data_handle_type`の値、`i`を`size_t`の値としたとき、下記の式が妥当であること + +- `a.access(p, i)` : `A::eference`を返す +- `a.offset(p, i)` : `A::offset_policy::data_handle_type`を返す + ## メンバ関数 | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`(constructor)`](default_accessor/op_constructor.md.nolink) | コンストラクタ | C++23 | +| [`(constructor)`](default_accessor/op_constructor.md) | コンストラクタ | C++23 | | `(destructor)` | デストラクタ | C++23 | -| [`access`](default_accessor/access.md.nolink) | 指定オフセット位置にある要素へアクセスする | C++23 | -| [`offset`](default_accessor/offset.md.nolink) | 指定オフセット位置のハンドルを取得する | C++23 | +| [`access`](default_accessor/access.md) | 指定オフセット位置にある要素へアクセスする | C++23 | +| [`offset`](default_accessor/offset.md) | 指定オフセット位置のハンドルを取得する | C++23 | ## メンバ型 diff --git a/reference/mdspan/default_accessor/access.md b/reference/mdspan/default_accessor/access.md new file mode 100644 index 0000000000..7a1b022587 --- /dev/null +++ b/reference/mdspan/default_accessor/access.md @@ -0,0 +1,36 @@ +# access +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* default_accessor[meta class] +* cpp23[meta cpp] + +```cpp +constexpr reference access(data_handle_type p, size_t i) const noexcept; +``` + +## 概要 +指定オフセット位置にある要素へアクセスする。 + + +## 戻り値 +`p[i]` + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/default_accessor/offset.md b/reference/mdspan/default_accessor/offset.md new file mode 100644 index 0000000000..611ad5a72e --- /dev/null +++ b/reference/mdspan/default_accessor/offset.md @@ -0,0 +1,35 @@ +# offset +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* default_accessor[meta class] +* cpp23[meta cpp] + +```cpp +constexpr data_handle_type offset(data_handle_type p, size_t i) const noexcept; +``` + +## 概要 +指定オフセット位置のハンドルを取得する。 + +## 戻り値 +`p + i` + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/default_accessor/op_constructor.md b/reference/mdspan/default_accessor/op_constructor.md new file mode 100644 index 0000000000..c23b4fcda6 --- /dev/null +++ b/reference/mdspan/default_accessor/op_constructor.md @@ -0,0 +1,41 @@ +# コンストラクタ +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* default_accessor[meta class] +* cpp23[meta cpp] + +```cpp +constexpr default_accessor() noexcept = default; // (1) + +template +constexpr default_accessor(default_accessor) noexcept; // (2) +``` + +## 概要 +- (1) : デフォルトコンストラクタ +- (2) : 他`default_accessor`からの変換コンストラクタ + + +## テンプレートパラメータ制約 +- (2) : [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true`であること + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) +- [P2599R2 `index_type` & `size_type` in `mdspan`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2599r2.pdf) diff --git a/reference/mdspan/mdspan.md b/reference/mdspan/mdspan.md index dc612051b3..0c104d6e87 100644 --- a/reference/mdspan/mdspan.md +++ b/reference/mdspan/mdspan.md @@ -6,10 +6,11 @@ ```cpp namespace std { - template> + template< + class ElementType, + class Extents, + class LayoutPolicy = layout_right, + class AccessorPolicy = default_accessor> class mdspan; } ``` @@ -50,7 +51,7 @@ namespace std { |------|------|----------------| | [`(constructor)`](mdspan/op_constructor.md.nolink) | コンストラクタ | C++23 | | `(destructor)` | デストラクタ | C++23 | -| [`operator=`](mdspan/op_assing.md.nolink) | 代入演算子 | C++23 | +| [`operator=`](mdspan/op_assign.md.nolink) | 代入演算子 | C++23 | ### 要素へのアクセス @@ -101,15 +102,15 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| | `extents_type` | 多次元配列サイズ型[`Extents`](extents.md) | C++23 | -| `layout_type` | レイアウトポリシー型`LayoutPolicy` | C++23 | -| `accessor_type` | アクセサポリシー型`AccessorPolicy` | C++23 | -| `mapping_type` | レイアウトマッピング型`typename layout_type::template mapping` | C++23 | -| `element_type` | 多次元配列の要素型`ElementType` | C++23 | -| `value_type` | 要素の値型[`remove_cv_t`](/reference/type_traits/remove_cvref.md)`` | C++23 | -| `size_type` | `typename extents_type::size_type` | C++23 | -| `rank_type` | `typename extents_type::rank_type` | C++23 | -| `pointer` | `typename accessor_type::pointer` | C++23 | -| `reference` | ` typename accessor_type::reference` | C++23 | +| `layout_type` | レイアウトマッピングポリシー`LayoutPolicy` | C++23 | +| `accessor_type` | アクセサポリシー`AccessorPolicy` | C++23 | +| `mapping_type` | レイアウトマッピング`LayoutPolicy::mapping` | C++23 | +| `element_type` | 要素型`ElementType` | C++23 | +| `value_type` | 要素の値型[`remove_cv_t`](/reference/type_traits/remove_cvref.md)`` | C++23 | +| `size_type` | [`Extents::size_type`](extents.md) | C++23 | +| `rank_type` | [`Extents::rank_type`](extents.md) | C++23 | +| `pointer` | `AccessorPolicy::pointer` | C++23 | +| `reference` | `AccessorPolicy::reference` | C++23 | ## 非メンバ(*Hidden friends*)関数 @@ -164,6 +165,7 @@ int main() ## 関連項目 - [`extents`](extents.md) +- [`default_accessor`](default_accessor.md) ## 参照 From f736446b1594b687350c90bc9aa92ac1cb734692 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 9 Jan 2024 00:40:37 +0900 Subject: [PATCH 0633/3948] =?UTF-8?q?mdspan/mdspan:=20=E4=B8=80=E9=83=A8?= =?UTF-8?q?=E3=83=A1=E3=83=B3=E3=83=90(#1077)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/mdspan/default_accessor.md | 1 + .../mdspan/default_accessor/op_constructor.md | 1 - reference/mdspan/mdspan.md | 37 +++++------ reference/mdspan/mdspan/accessor.md | 61 +++++++++++++++++ reference/mdspan/mdspan/data_handle.md | 59 +++++++++++++++++ reference/mdspan/mdspan/extent.md | 66 +++++++++++++++++++ reference/mdspan/mdspan/extents.md | 65 ++++++++++++++++++ reference/mdspan/mdspan/mapping.md | 60 +++++++++++++++++ reference/mdspan/mdspan/rank.md | 64 ++++++++++++++++++ reference/mdspan/mdspan/rank_dynamic.md | 64 ++++++++++++++++++ reference/mdspan/mdspan/static_extent.md | 66 +++++++++++++++++++ 11 files changed, 522 insertions(+), 22 deletions(-) create mode 100644 reference/mdspan/mdspan/accessor.md create mode 100644 reference/mdspan/mdspan/data_handle.md create mode 100644 reference/mdspan/mdspan/extent.md create mode 100644 reference/mdspan/mdspan/extents.md create mode 100644 reference/mdspan/mdspan/mapping.md create mode 100644 reference/mdspan/mdspan/rank.md create mode 100644 reference/mdspan/mdspan/rank_dynamic.md create mode 100644 reference/mdspan/mdspan/static_extent.md diff --git a/reference/mdspan/default_accessor.md b/reference/mdspan/default_accessor.md index beb9dc7cca..ed76a82682 100644 --- a/reference/mdspan/default_accessor.md +++ b/reference/mdspan/default_accessor.md @@ -78,4 +78,5 @@ namespace std { ## 参照 - [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) +- [P2604R0 `mdspan`: rename `pointer` and `contiguous`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2604r0.html) - [Reddit - Why is mdspan::offset_policy needed?](https://www.reddit.com/r/cpp/comments/cgc37m/why_is_mdspanoffset_policy_needed/) diff --git a/reference/mdspan/default_accessor/op_constructor.md b/reference/mdspan/default_accessor/op_constructor.md index c23b4fcda6..bf77207220 100644 --- a/reference/mdspan/default_accessor/op_constructor.md +++ b/reference/mdspan/default_accessor/op_constructor.md @@ -38,4 +38,3 @@ constexpr default_accessor(default_accessor) noexcept; // (2) ## 参照 - [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) -- [P2599R2 `index_type` & `size_type` in `mdspan`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2599r2.pdf) diff --git a/reference/mdspan/mdspan.md b/reference/mdspan/mdspan.md index 0c104d6e87..2938e57495 100644 --- a/reference/mdspan/mdspan.md +++ b/reference/mdspan/mdspan.md @@ -33,7 +33,7 @@ namespace std { - `acc_` : `accessor_type`型の要素アクセサ - `map_` : `mapping_type`型のレイアウトマッピング -- `ptr_` : `data_handle_type`型のメモリブロックへのハンドル +- `ptr_` : `data_handle_type`型のメモリブロックへのハンドル(ポインタ) ## 適格要件 @@ -63,26 +63,21 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`rank`](mdspan/rank.md.nolink) | 多次元配列の次元数を取得する | C++23 | -| [`rank_dynamic`](mdspan/rank_dynamic.md.nolink) | 多次元配列のうち動的要素数に指定された次元数を取得する | C++23 | -| [`static_extent`](mdspan/static_extent.md.nolink) | 指定次元の静的要素数を取得する | C++23 | -| [`extent`](mdspan/extent.md.nolink) | 指定次元の要素数を取得する | C++23 | - -### 多次元インデクス空間 - -| 名前 | 説明 | 対応バージョン | -|------|------|----------------| -| [`size`](mdspan/size.md.nolink) | メモリブロックに対する最大アクセス範囲を取得 | C++23 | -| [`empty`](mdspan/empty.md.nolink) | 最大アクセス範囲がサイズ0か否かを取得 | C++23 | +| [`rank`](mdspan/rank.md) | 多次元配列の次元数を取得する | C++23 | +| [`rank_dynamic`](mdspan/rank_dynamic.md) | 多次元配列のうち動的要素数に指定された次元数を取得する | C++23 | +| [`static_extent`](mdspan/static_extent.md) | 指定次元の静的要素数を取得する | C++23 | +| [`extent`](mdspan/extent.md) | 指定次元の要素数を取得する | C++23 | +| [`size`](mdspan/size.md.nolink) | 多次元インデクス空間のサイズを取得する | C++23 | +| [`empty`](mdspan/empty.md.nolink) | 多次元インデクス空間がサイズ0か否かを取得する | C++23 | ### メンバ変数アクセサ | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`extents`](mdspan/extents.md.nolink) | 多次元配列のサイズ`map_.extents()`を取得 | C++23 | -| [`data_handle`](mdspan/data_handle.md.nolink) | メモリブロックへのハンドル`ptr_`を取得 | C++23 | -| [`mapping`](mdspan/mapping.md.nolink) | レイアウトマッピング`map_`を取得 | C++23 | -| [`accessor`](mdspan/accessor.md.nolink) | 要素アクセサ`acc_`を取得 | C++23 | +| [`extents`](mdspan/extents.md) | 多次元配列のサイズを取得する | C++23 | +| [`data_handle`](mdspan/data_handle.md) | メモリブロックへのハンドル`ptr_`を取得する | C++23 | +| [`mapping`](mdspan/mapping.md) | レイアウトマッピング`map_`を取得する | C++23 | +| [`accessor`](mdspan/accessor.md) | 要素アクセサ`acc_`を取得する | C++23 | ### レイアウトマッピング @@ -117,7 +112,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| `swap` | 2つのオブジェクトを入れ替える | C++23 | +| [`swap`](mdspan/swap_free.md.nolink) | 2つのオブジェクトを入れ替える | C++23 | ## 例 @@ -127,10 +122,10 @@ namespace std { int main() { - // メモリブロックに対する2次元配列/2x3要ビューを作成 double arr[] = {1, 2, 3, 4, 5, 6}; - using Mat2x3 = std::extents; - std::mdspan mat{arr}; + // メモリブロックに対する2x3要素の2次元配列ビューを作成 + using Ext2x3 = std::extents; + std::mdspan mat{arr}; // 2次元配列の各要素を表示 for (size_t i = 0; i < mat.extent(0); ++i) { @@ -143,7 +138,7 @@ int main() ``` * std::mdspan[color ff0000] * std::extents[link extents.md] -* extent[link mdspan/extent.md.nolink] +* extent[link mdspan/extent.md] ### 出力 ``` diff --git a/reference/mdspan/mdspan/accessor.md b/reference/mdspan/mdspan/accessor.md new file mode 100644 index 0000000000..3b248dc46e --- /dev/null +++ b/reference/mdspan/mdspan/accessor.md @@ -0,0 +1,61 @@ +# accessor +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* mdspan[meta class] +* cpp23[meta cpp] + +```cpp +constexpr const accessor_type& accessor() const noexcept; +``` + +## 概要 +要素アクセサ`acc_`を取得する。 + + +## 戻り値 +`acc_` + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include + +int main() +{ + int arr[] = {1, 2, 3, 4, 5, 6}; + // 静的要素数 2x3 の2次元配列ビュー + std::mdspan> mat{arr}; + + auto acc = mat.accessor(); + assert(acc.access(arr, 3) == arr[3]); +} +``` +* accessor()[color ff0000] +* std::mdspan[link ../mdspan.md] +* std::extents[link ../extents.md] +* acc.access[link ../default_accessor/access.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/mdspan/data_handle.md b/reference/mdspan/mdspan/data_handle.md new file mode 100644 index 0000000000..b19a2d1bb5 --- /dev/null +++ b/reference/mdspan/mdspan/data_handle.md @@ -0,0 +1,59 @@ +# data_handle +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* mdspan[meta class] +* cpp23[meta cpp] + +```cpp +constexpr const data_handle_type& data_handle() const noexcept; +``` + +## 概要 +メモリブロックへのハンドル`ptr_`を取得する。 + + +## 戻り値 +`ptr_` + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include + +int main() +{ + int arr[] = {1, 2, 3, 4, 5, 6}; + // 静的要素数 2x3 の2次元配列ビュー + std::mdspan> mat{arr}; + + assert(mat.data_handle() == arr); +} +``` +* data_handle()[color ff0000] +* std::mdspan[link ../mdspan.md] +* std::extents[link ../extents.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/mdspan/extent.md b/reference/mdspan/mdspan/extent.md new file mode 100644 index 0000000000..fe4f0290f4 --- /dev/null +++ b/reference/mdspan/mdspan/extent.md @@ -0,0 +1,66 @@ +# extent +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* mdspan[meta class] +* cpp23[meta cpp] + +```cpp +constexpr index_type extent(rank_type r) const noexcept; +``` + +## 概要 +指定次元の要素数を取得する。 + + +## 戻り値 +[`extents().extent(r)`](../extents/extent.md) + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include + +int main() +{ + int arr[] = {1, 2, 3, 4, 5, 6}; + // 動的要素数 2x3 の2次元配列ビュー + std::mdspan> mat{arr, 2, 3}; + + static_assert(mat.static_extent(1) == std::dynamic_extent); + assert(mat.extent(1) == 3); +} +``` +* extent[color ff0000] +* std::mdspan[link ../mdspan.md] +* std::dextents[link ../extents.md] +* static_extent[link static_extent.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`static_extent()`](static_extent.md) +- [`extents`](../extents.md) + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/mdspan/extents.md b/reference/mdspan/mdspan/extents.md new file mode 100644 index 0000000000..a940b1ae12 --- /dev/null +++ b/reference/mdspan/mdspan/extents.md @@ -0,0 +1,65 @@ +# extents +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* mdspan[meta class] +* cpp23[meta cpp] + +```cpp +constexpr const extents_type& extents() const noexcept; +``` + +## 概要 +多次元配列のサイズ情報[`extents`](../extents.md)を取得する + + +## 戻り値 +`map_.extents()` + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include + +int main() +{ + int arr[] = {1, 2, 3, 4, 5, 6}; + // 動的要素数 2x3 の2次元配列ビュー + std::mdspan> mat{arr, 2, 3}; + + auto exts = mat.extents(); + assert(exts.extent(0) == 2 && exts.extent(1) == 3); +} +``` +* extents()[color ff0000] +* std::mdspan[link ../mdspan.md] +* std::dextents[link ../extents.md] +* exts.extent[link ../extents/extent.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`extents`](../extents.md) + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/mdspan/mapping.md b/reference/mdspan/mdspan/mapping.md new file mode 100644 index 0000000000..b8644d1dea --- /dev/null +++ b/reference/mdspan/mdspan/mapping.md @@ -0,0 +1,60 @@ +# mapping +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* mdspan[meta class] +* cpp23[meta cpp] + +```cpp +constexpr const mapping_type& mapping() const noexcept; +``` + +## 概要 +レイアウトマッピング`map_`を取得する。 + + +## 戻り値 +`map_` + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include + +int main() +{ + int arr[] = {1, 2, 3, 4, 5, 6}; + // 静的要素数 2x3 の2次元配列ビュー + std::mdspan> mat{arr}; + + auto map = mat.mapping(); + assert(map.required_span_size() == 6); +} +``` +* mapping()[color ff0000] +* std::mdspan[link ../mdspan.md] +* std::extents[link ../extents.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/mdspan/rank.md b/reference/mdspan/mdspan/rank.md new file mode 100644 index 0000000000..7f8fdf2b5a --- /dev/null +++ b/reference/mdspan/mdspan/rank.md @@ -0,0 +1,64 @@ +# rank +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* mdspan[meta class] +* cpp23[meta cpp] + +```cpp +static constexpr rank_type rank() noexcept; +``` + +## 概要 +多次元配列サイズの次元数を取得する。 + + +## 戻り値 +[`extents_type::rank()`](../extents/rank.md) + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include + +int main() +{ + int arr[] = {1, 2, 3, 4, 5, 6}; + // 静的要素数 2x3 の2次元配列ビュー + std::mdspan> mat{arr}; + + static_assert(mat.rank() == 2); +} +``` +* rank()[color ff0000] +* std::mdspan[link ../mdspan.md] +* std::extents[link ../extents.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`rank_dynamic()`](rank_dynamic.md) +- [`extents`](../extents.md) + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/mdspan/rank_dynamic.md b/reference/mdspan/mdspan/rank_dynamic.md new file mode 100644 index 0000000000..ccf24283d2 --- /dev/null +++ b/reference/mdspan/mdspan/rank_dynamic.md @@ -0,0 +1,64 @@ +# rank_dynamic +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* mdspan[meta class] +* cpp23[meta cpp] + +```cpp +static constexpr rank_type rank_dynamic() noexcept; +``` + +## 概要 +多次元配列のうち動的要素数に指定された次元数を取得する。 + + +## 戻り値 +[`extents_type::rank_dynamic()`](../extents/rank_dynamic.md) + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include + +int main() +{ + int arr[] = {1, 2, 3, 4, 5, 6}; + // 静的要素数 2x3 の2次元配列ビュー + std::mdspan> mat{arr}; + + static_assert(mat.rank_dynamic() == 0); +} +``` +* rank_dynamic()[color ff0000] +* std::mdspan[link ../mdspan.md] +* std::extents[link ../extents.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`rank()`](rank.md) +- [`extents`](../extents.md) + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/mdspan/static_extent.md b/reference/mdspan/mdspan/static_extent.md new file mode 100644 index 0000000000..42c41bad02 --- /dev/null +++ b/reference/mdspan/mdspan/static_extent.md @@ -0,0 +1,66 @@ +# static_extent +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* mdspan[meta class] +* cpp23[meta cpp] + +```cpp +static constexpr size_t static_extent(rank_type r) noexcept; +``` + +## 概要 +指定次元の静的要素数を取得する。 + + +## 戻り値 +[`extents_type::static_extent(r)`](../extents/static_extent.md) + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include + +int main() +{ + int arr[] = {1, 2, 3, 4, 5, 6}; + // 動的要素数 2x3 の2次元配列ビュー + std::mdspan> mat{arr, 2, 3}; + + static_assert(mat.static_extent(1) == std::dynamic_extent); + assert(mat.extent(1) == 3); +} +``` +* static_extent[color ff0000] +* std::mdspan[link ../mdspan.md] +* std::dextents[link ../extents.md] +* extent[link extent.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`extent()`](extent.md) +- [`extents`](../extents.md) + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) From 50d9d1804060ade666fdc46dae84bdca4dd5882c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 11 Jan 2024 13:23:43 +0900 Subject: [PATCH 0634/3948] =?UTF-8?q?=E3=82=B9=E3=83=9D=E3=83=B3=E3=82=B5?= =?UTF-8?q?=E3=83=BC=E6=9B=B4=E6=96=B0=20#1227?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.md b/index.md index 21ae54e2d0..d1fdc92bd1 100644 --- a/index.md +++ b/index.md @@ -95,6 +95,8 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい
M.Kohana
+
pegasys
+ ### ブロンズスポンサー From b9c89678511288408ccaa5a844d747b579a23e21 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Thu, 11 Jan 2024 18:39:14 +0900 Subject: [PATCH 0635/3948] =?UTF-8?q?fold=5Fright=5Flast=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20#1088?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23.md | 2 +- reference/algorithm.md | 2 +- reference/algorithm/ranges_fold_left.md | 2 +- reference/algorithm/ranges_fold_left_first.md | 15 +- reference/algorithm/ranges_fold_right.md | 2 +- reference/algorithm/ranges_fold_right_last.md | 219 ++++++++++++++++++ 6 files changed, 230 insertions(+), 12 deletions(-) create mode 100644 reference/algorithm/ranges_fold_right_last.md diff --git a/lang/cpp23.md b/lang/cpp23.md index b8f550d13d..da951572b0 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -163,7 +163,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 - [`std::ranges::fold_left()`](/reference/algorithm/ranges_fold_left.md) - [`std::ranges::fold_left_first()`](/reference/algorithm/ranges_fold_left_first.md) - [`std::ranges::fold_right()`](/reference/algorithm/ranges_fold_right.md) - - [`std::ranges::fold_right_last()`](/reference/algorithm/ranges_fold_right_last.md.nolink) + - [`std::ranges::fold_right_last()`](/reference/algorithm/ranges_fold_right_last.md) - [`std::ranges::fold_left_with_iter()`](/reference/algorithm/ranges_fold_left_with_iter.md.nolink) - [`std::ranges::fold_left_first_with_iter()`](/reference/algorithm/ranges_fold_left_first_with_iter.md.nolink) - [``](/reference/numeric.md)に、連番を生成するRangeアルゴリズム[`std::ranges::iota()`](/reference/numeric/ranges_iota.md)を追加 diff --git a/reference/algorithm.md b/reference/algorithm.md index 3ea9e85585..5b6e8b5b7d 100644 --- a/reference/algorithm.md +++ b/reference/algorithm.md @@ -429,7 +429,7 @@ ranges::sort(pv, {}, &Parson::name); | [`ranges::fold_left`](algorithm/ranges_fold_left.md) | 範囲の左(先頭)からの`fold` | C++23 | | [`ranges::fold_right`](algorithm/ranges_fold_right.md)| 範囲の右(終端)からの`fold` | C++23 | | [`ranges::fold_left_first`](algorithm/ranges_fold_left_first.md)| 範囲の左(先頭)からの`fold`、初期値を省略する | C++23 | -| [`ranges::fold_right_last`](algorithm/ranges_fold_right_last.md.nolink)| 範囲の右(終端)からの`fold`、初期値を省略する | C++23 | +| [`ranges::fold_right_last`](algorithm/ranges_fold_right_last.md)| 範囲の右(終端)からの`fold`、初期値を省略する | C++23 | | [`ranges::fold_left_with_iter`](algorithm/ranges_fold_left_with_iter.md.nolink) | 範囲の左(先頭)からの`fold`、終端イテレータを返す | C++23 | | [`ranges::fold_left_first_with_iter`](algorithm/ranges_fold_left_first_with_iter.md.nolink) | 範囲の左(先頭)からの`fold`、初期値を省略し終端イテレータを返す | C++23 | diff --git a/reference/algorithm/ranges_fold_left.md b/reference/algorithm/ranges_fold_left.md index 79e52f2e92..3fa232e789 100644 --- a/reference/algorithm/ranges_fold_left.md +++ b/reference/algorithm/ranges_fold_left.md @@ -55,7 +55,7 @@ namespace std::ranges { - `init` -- 初期値 - `f` -- 適用する二項演算 - `f(std::move(init), *first)`のような呼び出しが可能であり、その戻り値型のオブジェクトを`acc`とすると - - `f(std::move(acc), *first)`のような呼び出しも可能である必要がある + - `acc = f(std::move(acc), *first)`のような呼び出しも可能である必要がある ## テンプレートパラメータ制約 diff --git a/reference/algorithm/ranges_fold_left_first.md b/reference/algorithm/ranges_fold_left_first.md index 202a5e0473..a7db717687 100644 --- a/reference/algorithm/ranges_fold_left_first.md +++ b/reference/algorithm/ranges_fold_left_first.md @@ -41,8 +41,8 @@ namespace std::ranges { - `last` -- 入力範囲の番兵(終端イテレータ) - `r` -- 入力範囲のオブジェクト - `f` -- 適用する二項演算 - - `f(std::move(*first), *++first)`のような呼び出しが可能であり、その戻り値型のオブジェクトを`acc`とすると - - `f(std::move(acc), *first)`のような呼び出しも可能である必要がある + - `f(*first, *first)`のような呼び出しが可能であり(実際にこの様に呼ばれるわけではない)、その戻り値型のオブジェクトを`acc`とすると + - `acc = f(std::move(acc), *first)`のような呼び出しも可能である必要がある ## 戻り値 @@ -75,9 +75,9 @@ using U = decltype(ranges::fold_left(std::move(first), last, iter_value_t(*fi * fold_left[link ./ranges_fold_left.md] * iter_value_t[link /reference/iterator/iter_value_t.md] -すなわち、他の引数はそのままに初期値として`r`の要素を手動で指定して`fold_left`を呼び出した際の戻り値型を包む`optional`となる。 +すなわち、他の引数はそのままに初期値として入力範囲`r`の要素を手動で指定して`fold_left`を呼び出した際の戻り値型を包む`optional`となる。 -`fold_left`と同様に、この型`U`は`fold_left_first`の処理内部で積算値の型として使用されるものでもあり、`f`は`std::move(*first)`の代わりに`U`の右辺値も受け取れる必要がある。詳細は下の実装例を参照。 +`fold_left`と同様に、この型`U`は`fold_left_first`の処理内部で積算値の型として使用されるものでもあり、`f`は`*first`の代わりに`U`の右辺値も受け取れる必要がある。詳細は下の実装例を参照。 ## 例 @@ -139,10 +139,10 @@ int main() { auto op = std::plus<>{}; auto res1 = fold_left(rng, -1, op); - auto res3 = fold_left_first(rng, op); + auto res2 = fold_left_first(rng, op); std::println("{:d}", res1); - std::println("{:d}", res3.value_or(-1)); + std::println("{:d}", res2.value_or(-1)); } ``` * fold_left_first[color ff0000] @@ -196,7 +196,7 @@ constexpr auto fold_left_first(I first, S last, F f) { - 範囲の左からの`fold` - [`ranges::fold_right`](ranges_fold_right.md) - 範囲の右からの`fold` -- [`ranges::fold_right_last`](ranges_fold_right_last.md.nolink) +- [`ranges::fold_right_last`](ranges_fold_right_last.md) - 範囲の最後の要素を初期値として`fold_right` - [`ranges::fold_left_with_iter`](ranges_fold_left_with_iter.md.nolink) - `fold_left`の結果と共に、計算した終端イテレータも返す @@ -206,4 +206,3 @@ constexpr auto fold_left_first(I first, S last, F f) { ## 参照 - [P2322R6 `ranges::fold`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2322r6.html) -- [プログラミングHaskellのfoldr, foldlの説明が秀逸だった件 - あと味](https://taiju.hatenablog.com/entry/20130202/1359773888) diff --git a/reference/algorithm/ranges_fold_right.md b/reference/algorithm/ranges_fold_right.md index c57d3dd79c..4df8aaa530 100644 --- a/reference/algorithm/ranges_fold_right.md +++ b/reference/algorithm/ranges_fold_right.md @@ -55,7 +55,7 @@ namespace std::ranges { - `init` -- 初期値 - `f` -- 適用する二項演算 - `f(*first, std::move(init))`のような呼び出しが可能であり、その戻り値型のオブジェクトを`acc`とすると - - `f(*first, std::move(acc))`のような呼び出しも可能である必要がある + - `acc = f(*first, std::move(acc))`のような呼び出しも可能である必要がある ## テンプレートパラメータ制約 diff --git a/reference/algorithm/ranges_fold_right_last.md b/reference/algorithm/ranges_fold_right_last.md new file mode 100644 index 0000000000..e3a53f9319 --- /dev/null +++ b/reference/algorithm/ranges_fold_right_last.md @@ -0,0 +1,219 @@ +# fold_right_last +* algorithm[meta header] +* function template[meta id-type] +* std::ranges[meta namespace] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template S, + indirectly-binary-right-foldable, I> F> + requires constructible_from, iter_reference_t> + constexpr auto fold_right_last(I first, S last, F f); // (1) + + template, iterator_t> F> + requires constructible_from, range_reference_t> + constexpr auto fold_right_last(R&& r, F f); // (2) +} +``` +* bidirectional_iterator[link /reference/iterator/bidirectional_iterator.md] +* sentinel_for[link /reference/iterator/sentinel_for.md] +* constructible_from[link /reference/concepts/constructible_from.md] +* iter_value_t[link /reference/iterator/iter_value_t.md] +* iter_reference_t[link /reference/iterator/iter_reference_t.md] +* bidirectional_range[link /reference/ranges/bidirectional_range.md] +* range_value_t[link /reference/ranges/range_value_t.md] +* range_reference_t[link /reference/ranges/range_reference_t.md] +* iterator_t[link /reference/ranges/iterator_t.md] +* indirectly-binary-right-foldable[link ./ranges_fold_right.md] + +## 概要 + +初期値の指定を省略する[`fold_right`](./ranges_fold_right.md)。入力範囲の末尾要素が初期値として使用される。 + +- (1) : 入力としてイテレータ範囲をとるオーバーロード +- (2) : 入力として範囲を直接とるオーバーロード + +## 引数 + +- `first` -- 入力範囲の先頭イテレータ +- `last` -- 入力範囲の番兵(終端イテレータ) +- `r` -- 入力範囲のオブジェクト +- `f` -- 適用する二項演算 + - `f(*first, *first)`のような呼び出しが可能であり(実際にこの様に呼ばれるわけではない)、その戻り値型のオブジェクトを`acc`とすると + - `acc = f(*first, std::move(acc))`のような呼び出しも可能である必要がある + +## 戻り値 + +(1)(2)ともに、以下と等価 + +```cpp +using U = decay_t, T>>; +if (first == last) + return optional(); +I tail = ranges::prev(ranges::next(first, std::move(last))); +return optional(in_place, ranges::fold_right(std::move(first), tail, iter_value_t(*tail), std::move(f))); +``` +* decay_t[link /reference/type_traits/decay.md] +* invoke_result_t[link /reference/type_traits/invoke_result.md] +* iter_reference_t[link /reference/iterator/iter_reference_t.md] +* prev[link /reference/iterator/ranges_prev.md] +* invoke[link /reference/functional/invoke.md] +* optional[link /reference/optional/optional.md] +* fold_right[link ./ranges_fold_right.md] +* iter_value_t[link /reference/iterator/iter_value_t.md] + +空の入力範囲に対しては無効値を保持する[`optional`](/reference/optional/optional.md)を返す。 + +## 計算量 + +入力範囲`r`(`[first, last)`)の要素数を`N`とすると、正確に`N - 1`回の`f`の適用が行われる。 + +## 備考 + +この関数の戻り値型は[`optional`](/reference/optional/optional.md)``であり、`U`は次のように求められる型と一致する + +```cpp +auto tail = --last; +decltype(ranges::fold_right(std::move(first), tail, iter_value_t(*tail), f)); +``` +* fold_right[link ./ranges_fold_right.md] +* iter_value_t[link /reference/iterator/iter_value_t.md] + +すなわち、他の引数はそのままに初期値として入力範囲`r`の要素を手動で指定して`fold_right`を呼び出した際の戻り値型を包む`optional`となる。 + +`fold_right`と同様に、この型`U`は`fold_right_last`の処理内部で積算値の型として使用されるものでもあり、`f`は`*first`の代わりに`U`の右辺値も受け取れる必要がある。詳細は下の実装例を参照。 + +## 例 + +### 基本的な数値集計処理の例 + +```cpp example +#include +#include +#include +#include +#include + +using namespace std::ranges; + +int main() { + // 入力 + range auto rng = views::iota(1, 11); + // 二項演算 + auto op = std::plus<>{}; + + auto resl = fold_right_last(rng, op); + + std::println("{:d}", resl.value()); + + + // 入力範囲はfloatのvector + std::vector rngf = { 0.125f, 0.25f, 0.75f }; + + // 計算結果はoptional + auto reslf = fold_right_last(rngf, op); + + std::println("{:g}", reslf.value()); +} +``` +* fold_right_last[color ff0000] +* iota[link /reference/ranges/iota_view.md] +* plus[link /reference/functional/plus.md] +* println[link /reference/print/println.md] + +### 出力 +``` +55 +1.125 +``` + +### 空の入力範囲に対する動作の例 + +```cpp example +#include +#include +#include +#include +#include + +using namespace std::ranges; + +int main() { + range auto rng = views::empty; + auto op = std::plus<>{}; + + auto res1 = fold_left(rng, -1, op); + auto res2 = fold_right_last(rng, op); + + std::println("{:d}", res1); + std::println("{:d}", res2.value_or(-1)); +} +``` +* fold_right_last[color ff0000] +* fold_left[link ranges_fold_right.md] +* println[link /reference/print/println.md] +* value_or[link /reference/optional/optional/value_or.md] + +### 出力 +``` +-1 +-1 +``` + +## 実装例 + +```cpp +template S, + indirectly-binary-right-foldable, I> F> + requires constructible_from, iter_reference_t> +constexpr auto fold_right_last(I first, S last, F f) { + using U = decay_t, T>>; + + if (first == last) { + return optional(); + } + + I tail = ranges::prev(ranges::next(first, std::move(last))); + + if (first == tail) { + return optional(in_place, *tail); + } + + const auto copy_tail = tail; + U accum = invoke(f, *--tail, *copy_tail); + + while (first != tail) { + accum = invoke(f, *--tail, std::move(accum)); + } + + return optional(in_place, std::move(accum)); +} +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 5 + +## 関連項目 + +- [`ranges::fold_left`](ranges_fold_left.md) + - 範囲の左からの`fold` +- [`ranges::fold_right`](ranges_fold_right.md) + - 範囲の右からの`fold` +- [`ranges::fold_left_first`](ranges_fold_left_first.md) + - 範囲の最後の要素を初期値として`fold_right` +- [`ranges::fold_left_with_iter`](ranges_fold_left_with_iter.md.nolink) + - `fold_left`の結果と共に、計算した終端イテレータも返す +- [`ranges::fold_left_first_with_iter`](ranges_fold_left_first_with_iter.md.nolink) + - `fold_left_first`の結果と共に、計算した終端イテレータも返す + +## 参照 + +- [P2322R6 `ranges::fold`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2322r6.html) From eff2b0b7ca783edc86b75e4fd83875ae956d7391 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Thu, 11 Jan 2024 18:44:22 +0900 Subject: [PATCH 0636/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_fold_left.md | 2 +- reference/algorithm/ranges_fold_right.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/algorithm/ranges_fold_left.md b/reference/algorithm/ranges_fold_left.md index 3fa232e789..9a540b2b8b 100644 --- a/reference/algorithm/ranges_fold_left.md +++ b/reference/algorithm/ranges_fold_left.md @@ -262,7 +262,7 @@ constexpr auto fold_left(I first, S last, T init, F f) { - 範囲の右からの`fold` - [`ranges::fold_left_first`](ranges_fold_left_first.md) - 範囲の最初の要素を初期値として`fold_left` -- [`ranges::fold_right_last`](ranges_fold_right_last.md.nolink) +- [`ranges::fold_right_last`](ranges_fold_right_last.md) - 範囲の最後の要素を初期値として`fold_right` - [`ranges::fold_left_with_iter`](ranges_fold_left_with_iter.md.nolink) - `fold_left`の結果と共に、計算した終端イテレータも返す diff --git a/reference/algorithm/ranges_fold_right.md b/reference/algorithm/ranges_fold_right.md index 4df8aaa530..f4484bed2d 100644 --- a/reference/algorithm/ranges_fold_right.md +++ b/reference/algorithm/ranges_fold_right.md @@ -297,7 +297,7 @@ constexpr auto fold_right(I first, S last, T init, F f) { - 範囲の左からの`fold` - [`ranges::fold_left_first`](ranges_fold_left_first.md) - 範囲の最初の要素を初期値として`fold_left` -- [`ranges::fold_right_last`](ranges_fold_right_last.md.nolink) +- [`ranges::fold_right_last`](ranges_fold_right_last.md) - 範囲の最後の要素を初期値として`fold_right` - [`ranges::fold_left_with_iter`](ranges_fold_left_with_iter.md.nolink) - `fold_left`の結果と共に、計算した終端イテレータも返す From 54a9faf17d7055af5f9d5c81f1273c286de1020d Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Fri, 12 Jan 2024 10:15:46 +0900 Subject: [PATCH 0637/3948] =?UTF-8?q?fold=5F*=20:=20=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E3=81=A8=E8=BF=BD=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_fold_left_first.md | 4 ++++ reference/algorithm/ranges_fold_right.md | 3 ++- reference/algorithm/ranges_fold_right_last.md | 8 +++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/reference/algorithm/ranges_fold_left_first.md b/reference/algorithm/ranges_fold_left_first.md index a7db717687..9bac033d2b 100644 --- a/reference/algorithm/ranges_fold_left_first.md +++ b/reference/algorithm/ranges_fold_left_first.md @@ -44,6 +44,10 @@ namespace std::ranges { - `f(*first, *first)`のような呼び出しが可能であり(実際にこの様に呼ばれるわけではない)、その戻り値型のオブジェクトを`acc`とすると - `acc = f(std::move(acc), *first)`のような呼び出しも可能である必要がある +## テンプレートパラメータ制約 + +[`indirectly-binary-left-foldable`](ranges_fold_left.md)では、初期値の型`T`が戻り値型(積算値の型)`U`に変換可能であることが要求([`convertible_to`](/reference/concepts/convertible_to.md)``)されており、この関数では初期値の型を指定できない(`range_value_t`が使用される)ため戻り値型を大きく制御することが困難になる。 + ## 戻り値 - (1) : 以下と等価 diff --git a/reference/algorithm/ranges_fold_right.md b/reference/algorithm/ranges_fold_right.md index f4484bed2d..b6bd5625eb 100644 --- a/reference/algorithm/ranges_fold_right.md +++ b/reference/algorithm/ranges_fold_right.md @@ -76,7 +76,8 @@ class flipped { F f; public: - template requires invocable + template + requires invocable invoke_result_t operator()(T&&, U&&); }; ``` diff --git a/reference/algorithm/ranges_fold_right_last.md b/reference/algorithm/ranges_fold_right_last.md index e3a53f9319..6491ba9fcd 100644 --- a/reference/algorithm/ranges_fold_right_last.md +++ b/reference/algorithm/ranges_fold_right_last.md @@ -44,6 +44,12 @@ namespace std::ranges { - `f(*first, *first)`のような呼び出しが可能であり(実際にこの様に呼ばれるわけではない)、その戻り値型のオブジェクトを`acc`とすると - `acc = f(*first, std::move(acc))`のような呼び出しも可能である必要がある +## テンプレートパラメータ制約 + +`indirectly-binary-right-foldable`は`F`の引数順が逆になることを除いて[`indirectly-binary-left-foldable`](ranges_fold_left.md)と同様の制約となる。 + +`indirectly-binary-left-foldable`では、初期値の型`T`が戻り値型(積算値の型)`U`に変換可能であることが要求([`convertible_to`](/reference/concepts/convertible_to.md)``)されており、この関数では初期値の型を指定できない(`range_value_t`が使用される)ため戻り値型を大きく制御することが困難になる(例えば、[`fold_right`](./ranges_fold_right.md)の例にある入力範囲を反転させる例の様なことは素直にはできない)。 + ## 戻り値 (1)(2)ともに、以下と等価 @@ -208,7 +214,7 @@ constexpr auto fold_right_last(I first, S last, F f) { - [`ranges::fold_right`](ranges_fold_right.md) - 範囲の右からの`fold` - [`ranges::fold_left_first`](ranges_fold_left_first.md) - - 範囲の最後の要素を初期値として`fold_right` + - 範囲の最初の要素を初期値として`fold_left` - [`ranges::fold_left_with_iter`](ranges_fold_left_with_iter.md.nolink) - `fold_left`の結果と共に、計算した終端イテレータも返す - [`ranges::fold_left_first_with_iter`](ranges_fold_left_first_with_iter.md.nolink) From d436315498e9a97e949f7edbba103fb451da3a9a Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sun, 14 Jan 2024 00:45:21 +0900 Subject: [PATCH 0638/3948] =?UTF-8?q?=E3=82=B9=E3=83=9D=E3=83=B3=E3=82=B5?= =?UTF-8?q?=E3=83=BC=E6=9B=B4=E6=96=B0=20#1228?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.md b/index.md index d1fdc92bd1..0701835722 100644 --- a/index.md +++ b/index.md @@ -82,6 +82,8 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい
shiguredo
+
cocotone
+ ### シルバースポンサー From deacb4747cde3308b630297f3a192df504c55dd3 Mon Sep 17 00:00:00 2001 From: yoh Date: Sun, 14 Jan 2024 19:55:02 +0900 Subject: [PATCH 0639/3948] =?UTF-8?q?mdspan:=20(=E5=90=8D=E5=89=8D?= =?UTF-8?q?=E4=BB=98=E3=81=8D)=E8=A6=81=E4=BB=B6(#1077)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/mdspan/AccessorPolicy.md | 47 ++++++++++ reference/mdspan/LayoutMapping.md | 109 ++++++++++++++++++++++++ reference/mdspan/LayoutMappingPolicy.md | 55 ++++++++++++ reference/mdspan/default_accessor.md | 22 +---- reference/mdspan/layout_left.md | 6 +- reference/mdspan/layout_right.md | 6 +- reference/mdspan/layout_stride.md | 4 +- reference/mdspan/mdspan.md | 33 +++---- working_style.md | 4 + 9 files changed, 245 insertions(+), 41 deletions(-) create mode 100644 reference/mdspan/AccessorPolicy.md create mode 100644 reference/mdspan/LayoutMapping.md create mode 100644 reference/mdspan/LayoutMappingPolicy.md diff --git a/reference/mdspan/AccessorPolicy.md b/reference/mdspan/AccessorPolicy.md new file mode 100644 index 0000000000..3e34f419a1 --- /dev/null +++ b/reference/mdspan/AccessorPolicy.md @@ -0,0 +1,47 @@ +# AccsessorPolicy +* named requirement[meta id-type] +* cpp23[meta cpp] + + +## 概要 +AccsessorPolicyは、多次元配列ビュー[`mdspan`](mdspan.md)を介した要素アクセス動作を定義するクラスが満たすべき要件である。 + + +## 要件 +AccsessorPolicyを満たす型`A`は + +- `A`は[`copyable`](/reference/concepts/copyable.md)のモデルであり、かつ +- [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)``は`true`であり、かつ +- [`is_nothrow_move_assignable_v`](/reference/type_traits/is_nothrow_move_assignable.md)``は`true`であり、かつ +- [`is_nothrow_swappable_v`](/reference/type_traits/is_nothrow_swappable.md)``は`true`であること + +型`A`は下記のメンバ型を持つこと + +- `A::element_type` : 要素型 +- `A::data_handle_type` : メモリブロックのポインタ型 +- `A::reference` : 要素への参照型 +- `A::offset_policy` : `offset`適用後のアクセサポリシー + +説明用の変数`a`を`(const) A`の値、`p`を`(const) A::data_handle_type`の値、`i`を`size_t`の値としたとき、下記の式が妥当であること + +- `a.access(p, i)` : `A::reference`を返す +- `a.offset(p, i)` : `A::offset_policy::data_handle_type`を返す + + +## `AccessorPolicy`に該当する型 + +- [`default_accessor`](default_accessor.md) + + +## バージョン +### 言語 +- C++23 + + +## 関連項目 +- [`mdspan`](mdspan.md) + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) +- [P2604R0 `mdspan`: rename `pointer` and `contiguous`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2604r0.html) diff --git a/reference/mdspan/LayoutMapping.md b/reference/mdspan/LayoutMapping.md new file mode 100644 index 0000000000..e3fd173e48 --- /dev/null +++ b/reference/mdspan/LayoutMapping.md @@ -0,0 +1,109 @@ +# LayoutMapping +* named requirement[meta id-type] +* cpp23[meta cpp] + + +## 概要 +LayoutMappingは、多次元配列ビュー[`mdspan`](mdspan.md)において多次元インデクスから参照先メモリブロック位置への対応関係(レイアウトマッピング)を定めるクラスが満たすべき要件である。 + +LayoutMappingを満たすユーザ定義型`layout_custom::mapping`は、常に[レイアウトマッピングポリシー](LayoutMappingPolicy.md)を満たす`layout_custom`の公開メンバ`mapping`クラステンプレートとして定義される。 + +```cpp +// レイアウトマッピングポリシーs +struct layout_custom { + // レイアウトマッピング + template + class mapping { + public: + using layout_type = layout_custom; + using extent_type = Extents; + // ... + }; +}; +``` +* Extents[link extents.md] + +### レイアウトマッピング特性 + +レイアウトマッピングによる多次元インデクスからメモリブロック位置への変換は、次の3種類の特性によって記述される。 + +- Unique特性 : 異なる多次元インデクス値であれば、互いに異なる要素位置へと変換される。 +- Exhaustive特性 : 取りうる全ての多次元インデクス値に対応する要素位置を考えたとき、アクセスされうる要素位置に隙間が生じない。 +- Strided特性 : 要素位置は多次元インデクス値と各次元ストライド幅のみを用いて計算できる。 + +例えば、多次元配列ビュー[`mdspan`](mdspan.md)のデフォルトレイアウトポリシー[`layout_right`](layout_right.md)は3つの特性を全て満たす。 +要素数3×2の2次元配列ビュー`mat3x2`における有効な多次元インデクス値`i,j`は`0,0`, `0,1`, `1,0`, `1,1`, `2,0`, `2,1`の6パターンとなり、それぞれ参照先メモリブロック`a`の要素位置`a[0]`, `a[1]`, `a[2]`, `a[3]`, `a[4]`, `a[5]`に対応する。 + +```cpp +int a[6] = {0, 1, 2, 3, 4, 5}; + +using Extents = std::extents; +std::mdspan mat3x2{a}; +``` + +- Unique特性 : 異なる多次元インデクス値は、異なる要素位置に対応する。参照先が重複することはない。 +- Exhaustive特性 : 全ての多次元インデクス値に対応する要素位置は連続している。 +- Strided特性 : 多次元インデクス値`i,j`に対応する要素位置は、ストライド幅`2,1`を用いて`(i*2+j)*1`と計算できる。 + + +## 要件 +LayoutMappingを満たす型`M`は + +- `M`は[`copyable`](/reference/concepts/copyable.md)および[`equality_comparable`](/reference/concepts/equality_comparable.md)のモデルであり、かつ +- [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)``は`true`であり、かつ +- [`is_nothrow_move_assignable_v`](/reference/type_traits/is_nothrow_move_assignable.md)``は`true`であり、かつ +- [`is_nothrow_swappable_v`](/reference/type_traits/is_nothrow_swappable.md)``は`true`であること + +型`M`は下記のメンバ型を持つこと + +- `M::extents_type` : [`extents`](extents.md)の特殊化 +- `M::index_type` : [`extents_type::index_type`](extents.md) +- `M::rank_type` : [`extents_type::rank_type`](extents.md) +- `M::layout_type` : 自クラスを提供する[レイアウトマッピングポリシー型](LayoutMappingPolicy.md) + +説明用の変数`m`を`(const) M`の値、パック`i`を[`M::extents_type::rank()`](extents/rank.md)個からなる整数値、変数`r`を多次元の次元番号としたとき、下記の式が妥当であること + +- `m.extents()` : `const M​::​extents_type&`型を返すこと。 +- `m(i...)` : `M​::​index_type`型を返すこと。 + - 戻り値 : 非負整数値 +- `m(i...) == m(static_cast(i)...)` : `true`となること。 +- `m.required_span_size()` : `M​::​index_type`型を返すこと。 + - 戻り値 : `m.extents()`の多次元インデクス空間サイズが0のときは値`0`。そうでなければ、レイアウトマッピングによりアクセスする可能性のあるメモリブロック範囲の最大値に`1`を足した値。 +- `m.is_unique()` : `bool`型を返すこと。 + - 戻り値 : Unique特性を満たすときに限り`true`。 +- `m.is_exhaustive()` : `bool`型を返すこと。 + - 戻り値 : Exhaustive特性を満たすときに限り`true`。 +- `m.is_strided()` : `bool`型を返すこと。 + - 戻り値 : Strided特性を満たすときに限り`true`。 +- `m.stride(r)` : `M​::​index_type`型を返すこと。 + - 前提条件 : `m.is_strided() == true` + - 戻り値 : `r`番目次元のストライド幅 +- `M::is_always_unique()` : `bool`型の定数式となること。 + - 戻り値 : 型`M`のあらゆるオブジェクトにおいてUnique特性を満たすときに`true`。 +- `M::is_always_exhaustive()` : `bool`型の定数となること。 + - 戻り値 : 型`M`のあらゆるオブジェクトにおいてExhaustive特性を満たすときに`true`。 +- `M::is_always_strided()` : `bool`型の定数となること。 + - 戻り値 : 型`M`のあらゆるオブジェクトにおいてStrided特性を満たすときに`true`。 + + +## `LayoutMapping`に該当する型 + +- `layout_left::mapping` +- `layout_right::mapping` +- `layout_stride::mapping` + + +## バージョン +### 言語 +- C++23 + + +## 関連項目 +- [`mdspan`](mdspan.md) +- [`extents`](extents.md) +- [LayoutMappingPolicy](LayoutMappingPolicy.md) + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) +- [P2604R0 `mdspan`: rename `pointer` and `contiguous`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2604r0.html) diff --git a/reference/mdspan/LayoutMappingPolicy.md b/reference/mdspan/LayoutMappingPolicy.md new file mode 100644 index 0000000000..5a6be231a0 --- /dev/null +++ b/reference/mdspan/LayoutMappingPolicy.md @@ -0,0 +1,55 @@ +# LayoutMappingPolicy +* named requirement[meta id-type] +* cpp23[meta cpp] + + +## 概要 +LayoutMappingPolicyは、多次元配列ビュー[`mdspan`](mdspan.md)において多次元インデクスから参照先メモリブロック位置へと変換する[レイアウトマッピング](LayoutMapping.md)を定めるクラスが満たすべき要件である。 + +LayoutMappingPolicyを満たすユーザ定義`layout_custom`ポリシークラスは、下記の構造で定義される。 + +```cpp +// レイアウトマッピングポリシー +struct layout_custom { + // レイアウトマッピング + template + class mapping { + public: + using layout_type = layout_custom; + using extent_type = Extents; + // ... + }; +}; +``` +* Extents[link extents.md] + + +## 要件 +LayoutMappingPolicyを満たす型`MP`は + +- [`extents`](extents.md)の特殊化`E`に対して`MP::mapping`が有効であり、かつ +- その型`X`が[レイアウトマッピング要件](LayoutMapping.md)を満たし、かつ +- メンバ型`X::layout_type`が型`MP`を表しており、かつ +- メンバ型`X::extent_type`が型`E`を表すこと。 + + +## `LayoutMappingPolicy`に該当する型 + +- [`layout_left`](layout_left.md) +- [`layout_right`](layout_right.md) +- [`layout_stride`](layout_stride.md) + + +## バージョン +### 言語 +- C++23 + + +## 関連項目 +- [`mdspan`](mdspan.md) +- [`extents`](extents.md) +- [LayoutMapping](LayoutMapping.md) + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/default_accessor.md b/reference/mdspan/default_accessor.md index ed76a82682..a14f5ef0db 100644 --- a/reference/mdspan/default_accessor.md +++ b/reference/mdspan/default_accessor.md @@ -18,27 +18,7 @@ namespace std { `default_accessor`は[トリビアルコピー可能](/reference/type_traits/is_trivially_copyable.md)であり、[`semiregular`](/reference/concepts/semiregular.md)のモデルである。 -### アクセサポリシー要件 -`default_accessor`は、下記のアクセサポリシー要件を満たす。 - -説明用の型`A`をアクセサポリシーとしたとき - -- `A`は[`copyable`](/reference/concepts/copyable.md)のモデルであり、かつ -- [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)``は`true`であり、かつ -- [`is_nothrow_move_assignable_v`](/reference/type_traits/is_nothrow_move_assignable.md)``は`true`であり、かつ -- [`is_nothrow_swappable_v`](/reference/type_traits/is_nothrow_swappable.md)``は`true`であること - -型`A`は下記のメンバ型を持つこと - -- `A::element_type` : 要素型 -- `A::data_handle_type` : メモリブロックのポインタ型 -- `A::reference` : 要素への参照型 -- `A::offset_policy` : `offset`適用後のアクセサポリシー - -説明用の変数`a`を`(const) A`の値、`p`を`(const) A::data_handle_type`の値、`i`を`size_t`の値としたとき、下記の式が妥当であること - -- `a.access(p, i)` : `A::eference`を返す -- `a.offset(p, i)` : `A::offset_policy::data_handle_type`を返す +`default_accessor`は[アクセサポリシー要件](AccessorPolicy.md)を満たす。 ## メンバ関数 diff --git a/reference/mdspan/layout_left.md b/reference/mdspan/layout_left.md index 2c01a5492d..91c040cbc2 100644 --- a/reference/mdspan/layout_left.md +++ b/reference/mdspan/layout_left.md @@ -16,9 +16,11 @@ namespace std { * mapping[link mapping.md.nolink] ## 概要 -`layout_left`は、多次元配列ビュー[`mdspan`](mdspan.md)に対して、FortranやMatlab多次元配列と互換性のある列優先(column major)レイアウトマッピングを表現するポリシークラスである。 +`layout_left`は、多次元配列ビュー[`mdspan`](mdspan.md)に対して、FortranやMatlab多次元配列と互換性のある列優先(column major)[レイアウトマッピング](LayoutMapping.md)を表現するポリシークラスである。 -ポリシークラス名の由来は、多次元配列インデクスのうち最左次元が隣接配置(ストライド=1)されるところから来ている。 +`layout_left`は、[レイアウトマッピングポリシー要件](LayoutMappingPolicy.md)を満たす[トリビアル型](/reference/type_traits/is_trivial.md)である。 + +ポリシークラス名の由来は、多次元インデクスのうち最左次元が隣接配置(ストライド=1)され、インデクス次元の左から右の順にストライドが増大するところから来ている。 ## メンバ型 diff --git a/reference/mdspan/layout_right.md b/reference/mdspan/layout_right.md index 67c72013b5..9d514db345 100644 --- a/reference/mdspan/layout_right.md +++ b/reference/mdspan/layout_right.md @@ -16,9 +16,11 @@ namespace std { * mapping[link mapping.md.nolink] ## 概要 -`layout_right`は、多次元配列ビュー[`mdspan`](mdspan.md)に対して、C/C++多次元配列と互換性のある行優先(row major)レイアウトマッピングを表現するポリシークラスである。 +`layout_right`は、多次元配列ビュー[`mdspan`](mdspan.md)に対して、C/C++多次元配列と互換性のある行優先(row major)[レイアウトマッピング](LayoutMapping.md)を表現するポリシークラスである。 -ポリシークラス名の由来は、多次元配列インデクスのうち最右次元が隣接配置(ストライド=1)されるところから来ている。 +`layout_right`は、[レイアウトマッピングポリシー要件](LayoutMappingPolicy.md)を満たす[トリビアル型](/reference/type_traits/is_trivial.md)である。 + +ポリシークラス名の由来は、多次元インデクスのうち最右次元が隣接配置(ストライド=1)され、インデクス次元の右から左の順にストライドが増大するところから来ている。 ## メンバ型 diff --git a/reference/mdspan/layout_stride.md b/reference/mdspan/layout_stride.md index 1163ecf4d4..8758500892 100644 --- a/reference/mdspan/layout_stride.md +++ b/reference/mdspan/layout_stride.md @@ -16,7 +16,9 @@ namespace std { * mapping[link mapping.md.nolink] ## 概要 -`layout_stride`は、多次元配列ビュー[`mdspan`](mdspan.md)に対して、次元毎に任意ストライド幅を指定したレイアウトマッピングを表現するポリシークラスである。 +`layout_stride`は、多次元配列ビュー[`mdspan`](mdspan.md)に対して、次元毎に任意ストライド幅を指定した[レイアウトマッピング](LayoutMapping.md)を表現するポリシークラスである。 + +`layout_stride`は、[レイアウトマッピングポリシー要件](LayoutMappingPolicy.md)を満たす[トリビアル型](/reference/type_traits/is_trivial.md)である。 ## メンバ型 diff --git a/reference/mdspan/mdspan.md b/reference/mdspan/mdspan.md index 2938e57495..3ab404ac7d 100644 --- a/reference/mdspan/mdspan.md +++ b/reference/mdspan/mdspan.md @@ -14,6 +14,9 @@ namespace std { class mdspan; } ``` +* Extents[link extents.md] +* LayoutPolicy[link LayoutMappingPolicy.md] +* AccessorPolicy[link AccessorPolicy.md] * layout_right[link layout_right.md] * default_accessor[link default_accessor.md] @@ -31,8 +34,8 @@ namespace std { ### 説明専用メンバ変数 `mdspan`クラスは、下記の説明専用メンバ変数を保持する。 -- `acc_` : `accessor_type`型の要素アクセサ -- `map_` : `mapping_type`型のレイアウトマッピング +- `acc_` : `accessor_type`型の[要素アクセサ](AccessorPolicy.md) +- `map_` : `mapping_type`型の[レイアウトマッピング](LayoutMapping.md) - `ptr_` : `data_handle_type`型のメモリブロックへのハンドル(ポインタ) @@ -41,7 +44,7 @@ namespace std { - `Extents`は[`extents`](extents.md)の特殊化であり、かつ - [`is_same_v`](/reference/type_traits/is_same.md)``が`true`であること。 -`LayoutPolicy`はレイアウトマッピングポリシー要件を満たし、かつ`AccessorPolicy`はアクセサポリシー要件を満たすこと。 +`LayoutPolicy`は[レイアウトマッピングポリシー要件](LayoutMappingPolicy.md)を満たし、かつ`AccessorPolicy`は[アクセサポリシー要件](AccessorPolicy.md)を満たすこと。 ## メンバ関数 @@ -83,13 +86,13 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| `is_always_unique()` | `mapping_type::is_always_unique()` | C++23 | -| `is_always_exhaustive()` | `mapping_type::is_always_exhaustive()` | C++23 | -| `is_always_strided()` | `mapping_type::is_always_strided()` | C++23 | -| `is_unique()` | `map_.is_unique()` | C++23 | -| `is_exhaustive()` | `map_.is_exhaustive()` | C++23 | -| `is_strided()` | `map_.is_strided()` | C++23 | -| `stride(rank_type r)` | `map_.stride(r)` | C++23 | +| `is_always_unique()` | [`mapping_type::is_always_unique()`](LayoutMapping.md) | C++23 | +| `is_always_exhaustive()` | [`mapping_type::is_always_exhaustive()`](LayoutMapping.md) | C++23 | +| `is_always_strided()` | [`mapping_type::is_always_strided()`](LayoutMapping.md) | C++23 | +| `is_unique()` | [`map_.is_unique()`](LayoutMapping.md) | C++23 | +| `is_exhaustive()` | [`map_.is_exhaustive()`](LayoutMapping.md) | C++23 | +| `is_strided()` | [`map_.is_strided()`](LayoutMapping.md) | C++23 | +| `stride(rank_type r)` | [`map_.stride(r)`](LayoutMapping.md) | C++23 | ## メンバ型 @@ -97,15 +100,15 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| | `extents_type` | 多次元配列サイズ型[`Extents`](extents.md) | C++23 | -| `layout_type` | レイアウトマッピングポリシー`LayoutPolicy` | C++23 | -| `accessor_type` | アクセサポリシー`AccessorPolicy` | C++23 | -| `mapping_type` | レイアウトマッピング`LayoutPolicy::mapping` | C++23 | +| `layout_type` | [レイアウトマッピングポリシー型`LayoutPolicy`](LayoutMappingPolicy.md) | C++23 | +| `accessor_type` | [アクセサポリシー型`AccessorPolicy`](AccessorPolicy.md) | C++23 | +| `mapping_type` | [レイアウトマッピング型`LayoutPolicy::mapping`](LayoutMapping.md) | C++23 | | `element_type` | 要素型`ElementType` | C++23 | | `value_type` | 要素の値型[`remove_cv_t`](/reference/type_traits/remove_cvref.md)`` | C++23 | | `size_type` | [`Extents::size_type`](extents.md) | C++23 | | `rank_type` | [`Extents::rank_type`](extents.md) | C++23 | -| `pointer` | `AccessorPolicy::pointer` | C++23 | -| `reference` | `AccessorPolicy::reference` | C++23 | +| `pointer` | [`AccessorPolicy::pointer`](AccessorPolicy.md) | C++23 | +| `reference` | [`AccessorPolicy::reference`](AccessorPolicy.md) | C++23 | ## 非メンバ(*Hidden friends*)関数 diff --git a/working_style.md b/working_style.md index 07f729d4a0..05f738d962 100644 --- a/working_style.md +++ b/working_style.md @@ -71,6 +71,7 @@ C++11以降対応については対応バージョンを明記します。バー | derived class | 派生クラス | | direct base class | 直接基底クラス | | delegate | 委譲 | +| dynamic extent | (std::mdspanの) 動的要素数 | | effects | 効果 | | emplace | 直接構築 | | empty | 空 | @@ -94,6 +95,8 @@ C++11以降対応については対応バージョンを明記します。バー | move | (std::move 的な意味で)ムーブ | | move assignment | ムーブ代入 | | move constructor | ムーブコンストラクタ | +| multidimensional index | 多次元インデクス | +| multidimensional index space | 多次元インデクス空間 | | mutable iterator | 可変イテレータ | | non-virtual base class | 非仮想基底クラス | | note | 注 | @@ -117,6 +120,7 @@ C++11以降対応については対応バージョンを明記します。バー | rvalue reference | 右辺値参照 | | sequence container(s) | シーケンスコンテナ | | signed | 符号付き | +| static extent | (std::mdspanの) 静的要素数 | | stop request | 停止要求 | | stop state | 停止状態 | | Spurious Failure | 見かけ上の失敗
[https://togetter.com/li/430770](https://togetter.com/li/430770) | From c38cacd6357c780e1cdc98f0d8e161b21146c7d1 Mon Sep 17 00:00:00 2001 From: yoh Date: Sun, 14 Jan 2024 20:16:28 +0900 Subject: [PATCH 0640/3948] mdspan/LayoutMapping: remove forbidden chars(#1077) --- reference/mdspan/LayoutMapping.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/mdspan/LayoutMapping.md b/reference/mdspan/LayoutMapping.md index e3fd173e48..680c4ebf6b 100644 --- a/reference/mdspan/LayoutMapping.md +++ b/reference/mdspan/LayoutMapping.md @@ -63,11 +63,11 @@ LayoutMappingを満たす型`M`は 説明用の変数`m`を`(const) M`の値、パック`i`を[`M::extents_type::rank()`](extents/rank.md)個からなる整数値、変数`r`を多次元の次元番号としたとき、下記の式が妥当であること -- `m.extents()` : `const M​::​extents_type&`型を返すこと。 -- `m(i...)` : `M​::​index_type`型を返すこと。 +- `m.extents()` : `const M::extents_type&`型を返すこと。 +- `m(i...)` : `M::index_type`型を返すこと。 - 戻り値 : 非負整数値 - `m(i...) == m(static_cast(i)...)` : `true`となること。 -- `m.required_span_size()` : `M​::​index_type`型を返すこと。 +- `m.required_span_size()` : `M::index_type`型を返すこと。 - 戻り値 : `m.extents()`の多次元インデクス空間サイズが0のときは値`0`。そうでなければ、レイアウトマッピングによりアクセスする可能性のあるメモリブロック範囲の最大値に`1`を足した値。 - `m.is_unique()` : `bool`型を返すこと。 - 戻り値 : Unique特性を満たすときに限り`true`。 @@ -75,7 +75,7 @@ LayoutMappingを満たす型`M`は - 戻り値 : Exhaustive特性を満たすときに限り`true`。 - `m.is_strided()` : `bool`型を返すこと。 - 戻り値 : Strided特性を満たすときに限り`true`。 -- `m.stride(r)` : `M​::​index_type`型を返すこと。 +- `m.stride(r)` : `M::index_type`型を返すこと。 - 前提条件 : `m.is_strided() == true` - 戻り値 : `r`番目次元のストライド幅 - `M::is_always_unique()` : `bool`型の定数式となること。 From 5fcf82919d1763672f494acfc3a2eb1ed0d19b42 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Mon, 15 Jan 2024 18:49:52 +0900 Subject: [PATCH 0641/3948] =?UTF-8?q?mdspan=E3=81=AE=E5=90=8D=E5=89=8D?= =?UTF-8?q?=E4=BB=98=E3=81=8D=E8=A6=81=E4=BB=B6=E3=81=AE=E3=83=A1=E3=82=BF?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=E4=BF=AE=E6=AD=A3=20#1229?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/mdspan/AccessorPolicy.md | 4 +++- reference/mdspan/LayoutMapping.md | 4 +++- reference/mdspan/LayoutMappingPolicy.md | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/reference/mdspan/AccessorPolicy.md b/reference/mdspan/AccessorPolicy.md index 3e34f419a1..ab4ab00be1 100644 --- a/reference/mdspan/AccessorPolicy.md +++ b/reference/mdspan/AccessorPolicy.md @@ -1,6 +1,8 @@ # AccsessorPolicy -* named requirement[meta id-type] * cpp23[meta cpp] +* mdspan[meta header] +* named requirement[meta id-type] +* [meta namespace] ## 概要 diff --git a/reference/mdspan/LayoutMapping.md b/reference/mdspan/LayoutMapping.md index 680c4ebf6b..6ad40ba1ab 100644 --- a/reference/mdspan/LayoutMapping.md +++ b/reference/mdspan/LayoutMapping.md @@ -1,6 +1,8 @@ # LayoutMapping -* named requirement[meta id-type] * cpp23[meta cpp] +* mdspan[meta header] +* named requirement[meta id-type] +* [meta namespace] ## 概要 diff --git a/reference/mdspan/LayoutMappingPolicy.md b/reference/mdspan/LayoutMappingPolicy.md index 5a6be231a0..3ba9ecd173 100644 --- a/reference/mdspan/LayoutMappingPolicy.md +++ b/reference/mdspan/LayoutMappingPolicy.md @@ -1,6 +1,8 @@ # LayoutMappingPolicy -* named requirement[meta id-type] * cpp23[meta cpp] +* mdspan[meta header] +* named requirement[meta id-type] +* [meta namespace] ## 概要 From 719017d0effa85721bee215d1a79ade5791cb4da Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 15 Jan 2024 23:14:51 +0900 Subject: [PATCH 0642/3948] =?UTF-8?q?reference=20/=20module=E4=BB=A5?= =?UTF-8?q?=E4=B8=8B=E3=81=AE=E9=9A=8E=E5=B1=A4=E3=81=A7=E3=80=81meta=20he?= =?UTF-8?q?ader=E3=81=8C=E6=8C=87=E5=AE=9A=E3=81=95=E3=82=8C=E3=81=AA?= =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=9F=E3=82=89=E3=82=A8=E3=83=A9=E3=83=BC?= =?UTF-8?q?=E3=81=AB=E3=81=99=E3=82=8B=20#1229?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/script/meta_header_check.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/script/meta_header_check.py b/.github/workflows/script/meta_header_check.py index cb9f746393..7bbdf31cd8 100644 --- a/.github/workflows/script/meta_header_check.py +++ b/.github/workflows/script/meta_header_check.py @@ -8,6 +8,10 @@ def find_header_or_module(line: str) -> (re.Match, str): if m: return m, "header" + m = re.fullmatch(r'[\*-] (.*?)\[meta category\]', line, re.MULTILINE) + if m: + return m, "category" + m = re.fullmatch(r'[\*-] (.*?)\[meta module\]', line, re.MULTILINE) if m: return m, "module" @@ -15,11 +19,11 @@ def find_header_or_module(line: str) -> (re.Match, str): def check_header(text: str, filename: str) -> bool: found_error: bool = False + dirs = filename.split("/") for line in text.split("\n"): m, header = find_header_or_module(line) if m: - dirs = filename.split("/") meta_header = m.group(1) if len(dirs) < 2: found_error = True @@ -36,8 +40,11 @@ def check_header(text: str, filename: str) -> bool: found_error = True print("[{0}] invalid meta {1} \"{2}\". You should specify \"{3}\" as meta {1}".format( filename, header, meta_header, own_header)) + return not found_error - break + if len(dirs) >= 2 and dirs[0] in ("reference", "module"): + found_error = True + print("[{0}] meta header is empty.".format(filename)) return not found_error From 5f397d4e59163b4df42c530b175b2474805e073e Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 17 Jan 2024 00:16:56 +0900 Subject: [PATCH 0643/3948] =?UTF-8?q?mdspan/layout=5Fright/mapping:=20?= =?UTF-8?q?=E5=85=A8=E3=83=A1=E3=83=B3=E3=83=90(#1077)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/mdspan.md | 2 +- reference/mdspan/LayoutMapping.md | 6 +- reference/mdspan/extents/op_constructor.md | 1 + reference/mdspan/extents/op_equal.md | 2 +- reference/mdspan/layout_left.md | 2 +- reference/mdspan/layout_right.md | 6 +- reference/mdspan/layout_right/mapping.md | 134 ++++++++++++++++ .../mdspan/layout_right/mapping/op_call.md | 76 +++++++++ .../layout_right/mapping/op_constructor.md | 149 ++++++++++++++++++ .../mdspan/layout_right/mapping/op_equal.md | 75 +++++++++ .../mapping/required_span_size.md | 65 ++++++++ .../mdspan/layout_right/mapping/stride.md | 78 +++++++++ working_style.md | 1 + 13 files changed, 588 insertions(+), 9 deletions(-) create mode 100644 reference/mdspan/layout_right/mapping.md create mode 100644 reference/mdspan/layout_right/mapping/op_call.md create mode 100644 reference/mdspan/layout_right/mapping/op_constructor.md create mode 100644 reference/mdspan/layout_right/mapping/op_equal.md create mode 100644 reference/mdspan/layout_right/mapping/required_span_size.md create mode 100644 reference/mdspan/layout_right/mapping/stride.md diff --git a/reference/mdspan.md b/reference/mdspan.md index 064c7bf32a..db4820535b 100644 --- a/reference/mdspan.md +++ b/reference/mdspan.md @@ -19,7 +19,7 @@ |------|------|-------| | [`layout_left`](mdspan/layout_left.md) | 列優先(Fortran/Matlabスタイル)レイアウトマッピングポリシー (class) | C++23 | | [`layout_right`](mdspan/layout_right.md) | 行優先(C/C++スタイル)レイアウトマッピングポリシー (class) | C++23 | -| [`layout_stride`](mdspan/layout_stride.md) | 汎用ストライド配置レイアウトマッピングポリシー (class) | C++23 | +| [`layout_stride`](mdspan/layout_stride.md) | ストライド幅指定レイアウトマッピングポリシー (class) | C++23 | ## 要素アクセサ diff --git a/reference/mdspan/LayoutMapping.md b/reference/mdspan/LayoutMapping.md index 6ad40ba1ab..add2121970 100644 --- a/reference/mdspan/LayoutMapping.md +++ b/reference/mdspan/LayoutMapping.md @@ -11,7 +11,7 @@ LayoutMappingは、多次元配列ビュー[`mdspan`](mdspan.md)において多 LayoutMappingを満たすユーザ定義型`layout_custom::mapping`は、常に[レイアウトマッピングポリシー](LayoutMappingPolicy.md)を満たす`layout_custom`の公開メンバ`mapping`クラステンプレートとして定義される。 ```cpp -// レイアウトマッピングポリシーs +// レイアウトマッピングポリシー struct layout_custom { // レイアウトマッピング template @@ -31,7 +31,7 @@ struct layout_custom { - Unique特性 : 異なる多次元インデクス値であれば、互いに異なる要素位置へと変換される。 - Exhaustive特性 : 取りうる全ての多次元インデクス値に対応する要素位置を考えたとき、アクセスされうる要素位置に隙間が生じない。 -- Strided特性 : 要素位置は多次元インデクス値と各次元ストライド幅のみを用いて計算できる。 +- Strided特性 : 多次元インデクス値`I_n`と各次元ストライド幅`S_n`を用いて、要素位置を式`(I_i * S_i) + ...`により計算できる。 例えば、多次元配列ビュー[`mdspan`](mdspan.md)のデフォルトレイアウトポリシー[`layout_right`](layout_right.md)は3つの特性を全て満たす。 要素数3×2の2次元配列ビュー`mat3x2`における有効な多次元インデクス値`i,j`は`0,0`, `0,1`, `1,0`, `1,1`, `2,0`, `2,1`の6パターンとなり、それぞれ参照先メモリブロック`a`の要素位置`a[0]`, `a[1]`, `a[2]`, `a[3]`, `a[4]`, `a[5]`に対応する。 @@ -45,7 +45,7 @@ std::mdspan mat3x2{a}; - Unique特性 : 異なる多次元インデクス値は、異なる要素位置に対応する。参照先が重複することはない。 - Exhaustive特性 : 全ての多次元インデクス値に対応する要素位置は連続している。 -- Strided特性 : 多次元インデクス値`i,j`に対応する要素位置は、ストライド幅`2,1`を用いて`(i*2+j)*1`と計算できる。 +- Strided特性 : 多次元インデクス値`i,j`に対応する要素位置は、ストライド幅`2,1`を用いて`i*2+j*1`と計算できる。 ## 要件 diff --git a/reference/mdspan/extents/op_constructor.md b/reference/mdspan/extents/op_constructor.md index 09e213fd7f..8da24f6ae7 100644 --- a/reference/mdspan/extents/op_constructor.md +++ b/reference/mdspan/extents/op_constructor.md @@ -96,6 +96,7 @@ int main() { Ext3x4 ext1_3x4; Ext3xN ext1_3xN; + assert(ext1_3xN.extent(1) == 0); } // (2) : 変換コンストラクタ { diff --git a/reference/mdspan/extents/op_equal.md b/reference/mdspan/extents/op_equal.md index d59fa43195..834c44bcf9 100644 --- a/reference/mdspan/extents/op_equal.md +++ b/reference/mdspan/extents/op_equal.md @@ -1,6 +1,6 @@ # operator== * mdspan[meta header] -* function[meta id-type] +* function template[meta id-type] * std[meta namespace] * extents[meta class] * cpp23[meta cpp] diff --git a/reference/mdspan/layout_left.md b/reference/mdspan/layout_left.md index 91c040cbc2..791be790c1 100644 --- a/reference/mdspan/layout_left.md +++ b/reference/mdspan/layout_left.md @@ -20,7 +20,7 @@ namespace std { `layout_left`は、[レイアウトマッピングポリシー要件](LayoutMappingPolicy.md)を満たす[トリビアル型](/reference/type_traits/is_trivial.md)である。 -ポリシークラス名の由来は、多次元インデクスのうち最左次元が隣接配置(ストライド=1)され、インデクス次元の左から右の順にストライドが増大するところから来ている。 +ポリシークラス名の由来は、多次元インデクスのうち最左次元が隣接配置(ストライド幅=1)され、インデクス次元の左から右の順にストライド幅が増大するところから来ている。 ## メンバ型 diff --git a/reference/mdspan/layout_right.md b/reference/mdspan/layout_right.md index 9d514db345..cd9e6e9a4c 100644 --- a/reference/mdspan/layout_right.md +++ b/reference/mdspan/layout_right.md @@ -13,21 +13,21 @@ namespace std { } ``` * Extents[link extents.md] -* mapping[link mapping.md.nolink] +* mapping[link layout_right/mapping.md] ## 概要 `layout_right`は、多次元配列ビュー[`mdspan`](mdspan.md)に対して、C/C++多次元配列と互換性のある行優先(row major)[レイアウトマッピング](LayoutMapping.md)を表現するポリシークラスである。 `layout_right`は、[レイアウトマッピングポリシー要件](LayoutMappingPolicy.md)を満たす[トリビアル型](/reference/type_traits/is_trivial.md)である。 -ポリシークラス名の由来は、多次元インデクスのうち最右次元が隣接配置(ストライド=1)され、インデクス次元の右から左の順にストライドが増大するところから来ている。 +ポリシークラス名の由来は、多次元インデクスのうち最右次元が隣接配置(ストライド幅=1)され、インデクス次元の右から左の順にストライド幅が増大するところから来ている。 ## メンバ型 | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`mapping`](mapping.md.nolink) | レイアウトマッピング | C++23 | +| [`mapping`](layout_right/mapping.md) | レイアウトマッピング | C++23 | ## 例 diff --git a/reference/mdspan/layout_right/mapping.md b/reference/mdspan/layout_right/mapping.md new file mode 100644 index 0000000000..7873890ccf --- /dev/null +++ b/reference/mdspan/layout_right/mapping.md @@ -0,0 +1,134 @@ +# mapping +* mdspan[meta header] +* class template[meta id-type] +* std[meta namespace] +* mdspan[meta class] +* cpp23[meta cpp] + +```cpp +namespace std { + struct layout_right { + template + class mapping; + }; +} +``` +* layout_right[link ../layout_right.md] +* Extents[link ../extents.md] + +## 概要 +`layout_right::mapping`は、[`extents`](../extents.md)型の多次元配列サイズ`E`をパラメータとして、C/C++多次元配列と互換性のある行優先(row major)[レイアウトマッピング](../LayoutMapping.md)を表現するクラスである。 + +`layout_right::mapping`は[トリビアルコピー可能](/reference/type_traits/is_trivially_copyable.md)であり、[`regular`](/reference/concepts/regular.md)のモデルである。 + +### 説明専用メンバ変数 +`layout_right::mapping`クラステンプレートは、下記の説明専用メンバ変数を保持する。 + +- `extents_` : `extents_type`型の[多次元配列サイズ情報](../extents.md) + + +## 適格要件 +- `Extents`は[`extents`](../extents.md)の特殊化であること。 +- [`Extents::rank_dynamic()`](../extents/rank_dynamic.md) `== 0`が`true`のとき、多次元インデクス空間`Extents()`のサイズが`Extents::index_type`型で表現できること。 + + +## メンバ関数 +### 構築・破棄 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`(constructor)`](mapping/op_constructor.md) | コンストラクタ | C++23 | +| `(destructor)` | デストラクタ | C++23 | +| `operator=` | コピー代入演算子 | C++23 | + +### 観測 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `extents` | 多次元配列のサイズ`extents_`を取得する | C++23 | +| [`required_span_size`](mapping/required_span_size.md) | 要素アクセス範囲を取得する | C++23 | +| [`operator()`](mapping/op_call.md) | 多次元配列インデクスから要素位置へ変換する | C++23 | +| [`stride`](mapping/stride.md) | 指定次元のストライド幅を取得する | C++23 | + + +## 静的メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `is_always_unique` | `true`を返す | C++23 | +| `is_always_exhaustive` | `true`を返す | C++23 | +| `is_always_strided` | `true`を返す | C++23 | +| `is_unique` | `true`を返す | C++23 | +| `is_exhaustive` | `true`を返す | C++23 | +| `is_strided` | `true`を返す | C++23 | + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `extents_type` | [`Extents`](../extents.md) | C++23 | +| `index_type` | [`Extents::index_type`](../extents.md) | C++23 | +| `size_type` | [`Extents::size_type`](../extents.md) | C++23 | +| `rank_type` | [`Extents::rank_type`](../extents.md) | C++23 | +| `layout_type` | [`layout_right`](../layout_right.md) | C++23 | + + +### 比較演算子 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`operator==`](mapping/op_equal.md) | 等値比較 | C++23 | +| [`operator!=`](mapping/op_equal.md) | 非等値比較 (`==`により使用可能) | C++23 | + + +## 例 +```cpp example +#include +#include + +int main() +{ + double arr[] = {1, 2, 3, 4, 5, 6}; + + // 要素数2x3の2次元配列/行優先レイアウト + using Ext2x3 = std::extents; + using Mapping = std::layout_right::mapping; + std::mdspan mat{arr, Mapping{}}; + + for (size_t i = 0; i < mat.extent(0); ++i) { + for (size_t j = 0; j < mat.extent(1); ++j) { + std::cout << (j ? " " : "") << mat[i, j]; + } + std::cout << "\n"; + } +} +``` +* std::layout_right::mapping[color ff0000] +* std::mdspan[link ../mdspan.md] +* std::extents[link ../extents.md] + +### 出力 +``` +1 2 3 +4 5 6 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`mdspan`](../mdspan.md) + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/layout_right/mapping/op_call.md b/reference/mdspan/layout_right/mapping/op_call.md new file mode 100644 index 0000000000..6117f05aee --- /dev/null +++ b/reference/mdspan/layout_right/mapping/op_call.md @@ -0,0 +1,76 @@ +# operator() +* mdspan[meta header] +* function template[meta id-type] +* std[meta namespace] +* mapping[meta class] +* cpp23[meta cpp] + +```cpp +template +constexpr index_type operator()(Indices... i) const noexcept; +``` + +## 概要 +多次元インデクス値`i...`に対応する要素位置を求める。 + + +## テンプレートパラメータ制約 +- `sizeof...(Indices) ==` [`extents_tyoe::rank()`](../../extents/rank.md)が`true`、かつ +- `(`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` && ...)`が`true`、かつ +- `(`[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)` && ...)`が`true`であること。 + + +## 事前条件 +多次元インデクス値`i...`は、多次元配列サイズ`extents_`における有効なインデクスであること。 + + +## 戻り値 +説明用のパラメータパック`P`において、[`is_same_v`](/reference/type_traits/is_same.md)`<`[`index_sequence_for`](/reference/utility/index_sequence_for.md)`,` [`index_sequence`](/reference/utility/index_sequence.md)`>`が`true`となるとき、以下と等価。 + +```cpp +return ((static_cast(Indices...) * stride(P)) + ... + 0); +``` +* stride[link stride.md] + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include + +int main() +{ + using Ext3x4 = std::extents; + using Mapping3x4 = std::layout_right::mapping; + Mapping3x4 map; + assert(map(0,0) == 0); + assert(map(0,1) == 1); + assert(map(1,0) == 4); + assert(map(2,3) == 11); +} +``` +* std::extents[link ../../extents.md] +* std::layout_right::mapping[link ../mapping.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/layout_right/mapping/op_constructor.md b/reference/mdspan/layout_right/mapping/op_constructor.md new file mode 100644 index 0000000000..c695df515f --- /dev/null +++ b/reference/mdspan/layout_right/mapping/op_constructor.md @@ -0,0 +1,149 @@ +# コンストラクタ +* mdspan[meta header] +* function template[meta id-type] +* std[meta namespace] +* mapping[meta class] +* cpp23[meta cpp] + +```cpp +constexpr mapping() noexcept = default; // (1) + +constexpr mapping(const mapping&) noexcept = default; // (2) + +constexpr mapping(const extents_type& e) noexcept; // (3) + +template +constexpr explicit(!is_convertible_v) + mapping(const mapping& other) noexcept; // (4) + +template +constexpr explicit(!is_convertible_v) + mapping(const layout_left::mapping& other) noexcept; // (5) + +template +constexpr explicit(extents_type::rank() > 0) + mapping(const layout_stride::mapping& other) noexcept; // (6) +``` +* is_convertible_v[link /reference/type_traits/is_convertible.md] +* rank()[link ../../extents/rank.md] +* layout_left::mapping[link ../../layout_left/mapping.md.nolink] +* layout_stride::mapping[link ../../layout_stride/mapping.md.nolink] + +## 概要 +- (1) : デフォルトコンストラクタ +- (2) : コピーコンストラクタ +- (3) : [`extents`](../../extents.md)からの変換コンストラクタ +- (4) : 他`layout_right::mapping`からの変換コンストラクタ +- (5) : [`layout_left::mapping`](../../layout_left/mapping.md.nolink)からの変換コンストラクタ +- (6) : [`layout_stride::mapping`](../../layout_stride/mapping.md.nolink)からの変換コンストラクタ + + +## テンプレートパラメータ制約 +- (4) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true`であること。 +- (5) : + - `extents_type​::​`[`rank()`](../../extents/rank.md) `<= 1`、かつ + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true`であること。 +- (6) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true`であること。 + + +## 事前条件 +- (3) : `e`の多次元インデクス空間のサイズを、`index_type`型で表現できること。 +- (4) : `other.`[`required_span_size()`](required_span_size.md)を、`index_type`型で表現できること。 +- (5) : `other.`[`required_span_size()`](../../layout_left/mapping/required_span_size.md.nolink)を、`index_type`型で表現できること。 +- (6) : + - `extents_type​::​`[`rank()`](../../extents/rank.md) `> 0`のとき、`other`における全次元のストライド幅が[`layout_right::mapping`相当の制約](stride.md)をもつこと。 + - `other.`[`required_span_size()`](../../layout_stride/mapping/required_span_size.md.nolink)を、`index_type`型で表現できること。 + + +## 効果 +- (3) : `e`を用いて`extents_`を直接非リスト初期化する。 +- (4), (5), (6) : `other.extents()`を用いて`extents_`を直接非リスト初期化する。 + + +## 例外 +投げない + + +## explicitになる条件 +- (4), (5) : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`` +- (6) : [`extents_type::rank()`](../../extents/rank.md) `> 0` + + +## 例 +```cpp example +#include +#include +#include + +using Ext3x4 = std::extents; +using Ext3xN = std::extents; + +using Mapping3x4 = std::layout_right::mapping; +using Mapping3xN = std::layout_right::mapping; + +int main() +{ + // (1) : デフォルトコンストラクタ + { + Mapping3x4 map1_3x4; + Mapping3xN map1_3xN; + assert(map1_3x4.required_span_size() == 12); + assert(map1_3xN.required_span_size() == 0); + } + // (2) : コピーコンストラクタ + { + Mapping3xN map2_a; + Mapping3xN map2_b = map2_a; + assert(map2_a == map2_b); + } + // (3) : extentsからの変換コンストラクタ + { + Ext3xN ext{4}; + Mapping3xN map3 = ext; + assert(map3.extents() == ext); + } + // (4) : layout_right::mappingからの変換コンストラクタ + { + Mapping3x4 map4_3x4; + Mapping3xN map4_3xN = map4_3x4; + assert(map4_3x4 == map4_3xN); + } + // (5) : layout_left::mappingからの変換コンストラクタ + { + using Ext1D = std::dextents; + std::layout_left::mapping src5{Ext1D{5}}; + std::layout_right::mapping dst5 = src5; + } + // (6) : layout_stride::mappingからの変換コンストラクタ + { + std::array strides{4, 1}; + std::layout_stride::mapping src6{{}, strides}; + std::layout_right::mapping dst6{src6}; // (explicit) + } +} +``` +* std::extents[link ../../extents.md] +* std::dextents[link ../../extents.md] +* std::layout_right::mapping[link ../mapping.md] +* std::layout_left::mapping[link ../../layout_left/mapping.md.nolink] +* std::layout_stride::mapping[link ../../layout_stride/mapping.md.nolink] +* required_span_size()[link required_span_size.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/layout_right/mapping/op_equal.md b/reference/mdspan/layout_right/mapping/op_equal.md new file mode 100644 index 0000000000..1fff45a894 --- /dev/null +++ b/reference/mdspan/layout_right/mapping/op_equal.md @@ -0,0 +1,75 @@ +# operator== +* mdspan[meta header] +* function template[meta id-type] +* std[meta namespace] +* mapping[meta class] +* cpp23[meta cpp] + +```cpp +template +friend constexpr bool operator==( + const mapping& x, const mapping& y) noexcept; + +//operator==により、以下のオーバーロードが使用可能になる +template +friend constexpr bool operator!=( + const mapping& x, const mapping& y) noexcept; +``` + +## 概要 +`mapping`の等値比較を行う。 + + +## テンプレートパラメータ制約 +`extents_type::`[`rank()`](../../extents/rank.md) `== OtherExtents::`[`rank()`](../../extents/rank.md) + + +## 戻り値 +[`x.extents() == y.extents()`](../../extents/op_equal.md) + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include + +int main() +{ + using Ext3x4 = std::extents; + using Mapping3x4 = std::layout_right::mapping; + Mapping3x4 map1; + + using Ext3xN = std::extents; + using Mapping3xN = std::layout_right::mapping; + Mapping3xN map2{Ext3xN{4}}; + + assert(map1 == map2); +} +``` +* ==[color ff0000] +* std::extents[link ../../extents.md] +* std::layout_right::mapping[link ../mapping.md] + + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/layout_right/mapping/required_span_size.md b/reference/mdspan/layout_right/mapping/required_span_size.md new file mode 100644 index 0000000000..6984b90c7b --- /dev/null +++ b/reference/mdspan/layout_right/mapping/required_span_size.md @@ -0,0 +1,65 @@ +# required_span_size +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* mapping[meta class] +* cpp23[meta cpp] + +```cpp +index_type required_span_size() const noexcept; +``` + +## 概要 +メモリブロックに対する要素アクセス範囲を取得する。 + + +## 戻り値 +多次元配列サイズ[`extents()`](../mapping.md)に対して、全次元の要素数を乗算した値。 +次元数が0の場合は、値1を返す。 + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include + +int main() +{ + using Ext3x4 = std::extents; + using Mapping3x4 = std::layout_right::mapping; + Mapping3x4 map1{}; + assert(map1.required_span_size() == 12); + + using Ext3D = std::dextents; + using Mapping3D = std::layout_right::mapping; + Mapping3D map2{Ext3D{4, 3, 2}}; + assert(map2.required_span_size() == 24); +} +``` +* required_span_size()[color ff0000] +* std::extents[link ../../extents.md] +* std::dextents[link ../../extents.md] +* std::layout_right::mapping[link ../mapping.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/layout_right/mapping/stride.md b/reference/mdspan/layout_right/mapping/stride.md new file mode 100644 index 0000000000..fc5a641b73 --- /dev/null +++ b/reference/mdspan/layout_right/mapping/stride.md @@ -0,0 +1,78 @@ +# stride +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* mapping[meta class] +* cpp23[meta cpp] + +```cpp +constexpr index_type stride(rank_type i) const noexcept; +``` + +## 概要 +`i`番目次元のストライド幅を取得する。 + + +## テンプレートパラメータ制約 +[`extents_type::rank()`](../../extents/rank.md) `> 0` + + +## 事前条件 +`i <` [`extents_type::rank()`](../../extents/rank.md) + + +## 戻り値 +多次元配列サイズの次元数`R =` [`extents_type::rank()`](../../extents/rank.md)としたとき + +- `i + 1 < R`のとき、`i + 1`番目次元から最右次元(`R-1`番目)までの要素数を乗算した値を返す。 +- `i + 1 == R`のとき、値1を返す。 + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include + +int main() +{ + using Ext3x4 = std::extents; + using Mapping3x4 = std::layout_right::mapping; + Mapping3x4 map1; + assert(map1.stride(0) == 4); + assert(map1.stride(1) == 1); + + using Ext3D = std::dextents; + using Mapping3D = std::layout_right::mapping; + Mapping3D map2{Ext3D{4, 3, 2}}; + assert(map2.stride(0) == 6); + assert(map2.stride(1) == 2); + assert(map2.stride(2) == 1); +} +``` +* stride[color ff0000] +* std::extents[link ../../extents.md] +* std::dextents[link ../../extents.md] +* std::layout_right::mapping[link ../mapping.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/working_style.md b/working_style.md index 05f738d962..592a43d0c6 100644 --- a/working_style.md +++ b/working_style.md @@ -125,6 +125,7 @@ C++11以降対応については対応バージョンを明記します。バー | stop state | 停止状態 | | Spurious Failure | 見かけ上の失敗
[https://togetter.com/li/430770](https://togetter.com/li/430770) | | strict weak ordering | 狭義の弱順序 | +| stride | (std::mdspanの) ストライド幅 | | strong ordering | 全順序 | | structural type | 構造的型 | | synchronization | 同期 | From 609bb7472628ea5c1b59e36acf610bd6afe02c1f Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 17 Jan 2024 00:20:56 +0900 Subject: [PATCH 0644/3948] mdspan/layout_right: remove forbidden chars(#1077) --- reference/mdspan/layout_right/mapping/op_constructor.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/mdspan/layout_right/mapping/op_constructor.md b/reference/mdspan/layout_right/mapping/op_constructor.md index c695df515f..96a8af7b2b 100644 --- a/reference/mdspan/layout_right/mapping/op_constructor.md +++ b/reference/mdspan/layout_right/mapping/op_constructor.md @@ -41,7 +41,7 @@ constexpr explicit(extents_type::rank() > 0) ## テンプレートパラメータ制約 - (4) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true`であること。 - (5) : - - `extents_type​::​`[`rank()`](../../extents/rank.md) `<= 1`、かつ + - `extents_type::`[`rank()`](../../extents/rank.md) `<= 1`、かつ - [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true`であること。 - (6) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true`であること。 @@ -51,7 +51,7 @@ constexpr explicit(extents_type::rank() > 0) - (4) : `other.`[`required_span_size()`](required_span_size.md)を、`index_type`型で表現できること。 - (5) : `other.`[`required_span_size()`](../../layout_left/mapping/required_span_size.md.nolink)を、`index_type`型で表現できること。 - (6) : - - `extents_type​::​`[`rank()`](../../extents/rank.md) `> 0`のとき、`other`における全次元のストライド幅が[`layout_right::mapping`相当の制約](stride.md)をもつこと。 + - `extents_type::`[`rank()`](../../extents/rank.md) `> 0`のとき、`other`における全次元のストライド幅が[`layout_right::mapping`相当の制約](stride.md)をもつこと。 - `other.`[`required_span_size()`](../../layout_stride/mapping/required_span_size.md.nolink)を、`index_type`型で表現できること。 From 14b6cb2d5ab831f062bfb98d369fd25c38caf68d Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 17 Jan 2024 10:07:02 +0900 Subject: [PATCH 0645/3948] =?UTF-8?q?mdspan/layout=5Fright:=20=E3=83=A1?= =?UTF-8?q?=E3=82=BF=E6=83=85=E5=A0=B1=E7=AD=89=E3=82=92=E8=AA=BF=E6=95=B4?= =?UTF-8?q?(#1077)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/mdspan/extents/index-cast.md | 32 +++++++++++++++++++ reference/mdspan/layout_right/mapping.md | 2 +- .../mdspan/layout_right/mapping/op_call.md | 4 +-- .../layout_right/mapping/op_constructor.md | 7 +++- .../mdspan/layout_right/mapping/op_equal.md | 2 +- .../mapping/required_span_size.md | 2 +- .../mdspan/layout_right/mapping/stride.md | 2 +- 7 files changed, 44 insertions(+), 7 deletions(-) create mode 100644 reference/mdspan/extents/index-cast.md diff --git a/reference/mdspan/extents/index-cast.md b/reference/mdspan/extents/index-cast.md new file mode 100644 index 0000000000..c343517666 --- /dev/null +++ b/reference/mdspan/extents/index-cast.md @@ -0,0 +1,32 @@ +# index-cast +* mdspan[meta header] +* function template[meta id-type] +* std[meta namespace] +* extents[meta class] +* cpp23[meta cpp] + +```cpp +template +static constexpr auto index-cast(OtherIndexType&& i) noexcept; // 説明専用 +``` + +## 概要 +多次元配列のインデクス型へと変換する、説明専用のメンバ関数である。 + + +## 戻り値 +- `OtherIndexType`が`bool`型以外の整数型の場合、`return i;`と等価。 +- `OtherIndexType`が`bool`型の場合、`return static_cast(i);`と等価。 + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++23 + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/layout_right/mapping.md b/reference/mdspan/layout_right/mapping.md index 7873890ccf..5ba076930f 100644 --- a/reference/mdspan/layout_right/mapping.md +++ b/reference/mdspan/layout_right/mapping.md @@ -2,7 +2,7 @@ * mdspan[meta header] * class template[meta id-type] * std[meta namespace] -* mdspan[meta class] +* layout_right[meta class] * cpp23[meta cpp] ```cpp diff --git a/reference/mdspan/layout_right/mapping/op_call.md b/reference/mdspan/layout_right/mapping/op_call.md index 6117f05aee..a8c41860e6 100644 --- a/reference/mdspan/layout_right/mapping/op_call.md +++ b/reference/mdspan/layout_right/mapping/op_call.md @@ -2,7 +2,7 @@ * mdspan[meta header] * function template[meta id-type] * std[meta namespace] -* mapping[meta class] +* layout_right::mapping[meta class] * cpp23[meta cpp] ```cpp @@ -21,7 +21,7 @@ constexpr index_type operator()(Indices... i) const noexcept; ## 事前条件 -多次元インデクス値`i...`は、多次元配列サイズ`extents_`における有効なインデクスであること。 +多次元インデクス値[`extents_type::index-cast(i)`](../../extents/index-cast.md)は、多次元配列サイズ`extents_`における有効なインデクスであること。 ## 戻り値 diff --git a/reference/mdspan/layout_right/mapping/op_constructor.md b/reference/mdspan/layout_right/mapping/op_constructor.md index 96a8af7b2b..13665be4e4 100644 --- a/reference/mdspan/layout_right/mapping/op_constructor.md +++ b/reference/mdspan/layout_right/mapping/op_constructor.md @@ -2,7 +2,7 @@ * mdspan[meta header] * function template[meta id-type] * std[meta namespace] -* mapping[meta class] +* layout_right::mapping[meta class] * cpp23[meta cpp] ```cpp @@ -145,5 +145,10 @@ int main() - [Visual C++](/implementation.md#visual_cpp): ?? +## 関連項目 +- [`layout_left::mapping`](../../layout_left/mapping.md.nolink) +- [`layout_stride::mapping`](../../layout_stride/mapping.md.nolink) + + ## 参照 - [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/layout_right/mapping/op_equal.md b/reference/mdspan/layout_right/mapping/op_equal.md index 1fff45a894..7ef7666552 100644 --- a/reference/mdspan/layout_right/mapping/op_equal.md +++ b/reference/mdspan/layout_right/mapping/op_equal.md @@ -2,7 +2,7 @@ * mdspan[meta header] * function template[meta id-type] * std[meta namespace] -* mapping[meta class] +* layout_right::mapping[meta class] * cpp23[meta cpp] ```cpp diff --git a/reference/mdspan/layout_right/mapping/required_span_size.md b/reference/mdspan/layout_right/mapping/required_span_size.md index 6984b90c7b..2348057990 100644 --- a/reference/mdspan/layout_right/mapping/required_span_size.md +++ b/reference/mdspan/layout_right/mapping/required_span_size.md @@ -2,7 +2,7 @@ * mdspan[meta header] * function[meta id-type] * std[meta namespace] -* mapping[meta class] +* layout_right::mapping[meta class] * cpp23[meta cpp] ```cpp diff --git a/reference/mdspan/layout_right/mapping/stride.md b/reference/mdspan/layout_right/mapping/stride.md index fc5a641b73..e4ab0bac33 100644 --- a/reference/mdspan/layout_right/mapping/stride.md +++ b/reference/mdspan/layout_right/mapping/stride.md @@ -2,7 +2,7 @@ * mdspan[meta header] * function[meta id-type] * std[meta namespace] -* mapping[meta class] +* layout_right::mapping[meta class] * cpp23[meta cpp] ```cpp From 323fd208be6218fdffd9b27c76bf5cf554f3e3ad Mon Sep 17 00:00:00 2001 From: Hiroyuki Hori <43978282+hi-hori@users.noreply.github.com> Date: Wed, 17 Jan 2024 11:53:36 +0900 Subject: [PATCH 0646/3948] =?UTF-8?q?std::ranges::views::all=20=E3=83=9A?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E4=B8=8A=E9=83=A8=E3=81=AE=E5=90=8D=E5=89=8D?= =?UTF-8?q?=E7=A9=BA=E9=96=93=E8=A1=A8=E7=A4=BA=E3=82=92=20std::ranges=20?= =?UTF-8?q?=E3=81=8B=E3=82=89=20std::ranges::views=20=E3=81=AB=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/all.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/ranges/all.md b/reference/ranges/all.md index ce8ebd6cd9..f0d0da82cc 100644 --- a/reference/ranges/all.md +++ b/reference/ranges/all.md @@ -1,6 +1,6 @@ # all * ranges[meta header] -* std::ranges[meta namespace] +* std::ranges::views[meta namespace] * cpo[meta id-type] * cpp20[meta cpp] From 75d3ea39f0136d0e3099e440b36dd023d486bbad Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 17 Jan 2024 23:22:03 +0900 Subject: [PATCH 0647/3948] =?UTF-8?q?mdspan/layout=5Fleft/mapping:=20?= =?UTF-8?q?=E5=85=A8=E3=83=A1=E3=83=B3=E3=83=90(#1077)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/mdspan/layout_left.md | 10 +- reference/mdspan/layout_left/mapping.md | 132 +++++++++++++++ .../mdspan/layout_left/mapping/op_call.md | 76 +++++++++ .../layout_left/mapping/op_constructor.md | 154 ++++++++++++++++++ .../mdspan/layout_left/mapping/op_equal.md | 75 +++++++++ .../layout_left/mapping/required_span_size.md | 65 ++++++++ .../mdspan/layout_left/mapping/stride.md | 78 +++++++++ reference/mdspan/layout_right/mapping.md | 6 +- .../layout_right/mapping/op_constructor.md | 10 +- reference/mdspan/layout_stride.md | 2 +- 10 files changed, 593 insertions(+), 15 deletions(-) create mode 100644 reference/mdspan/layout_left/mapping.md create mode 100644 reference/mdspan/layout_left/mapping/op_call.md create mode 100644 reference/mdspan/layout_left/mapping/op_constructor.md create mode 100644 reference/mdspan/layout_left/mapping/op_equal.md create mode 100644 reference/mdspan/layout_left/mapping/required_span_size.md create mode 100644 reference/mdspan/layout_left/mapping/stride.md diff --git a/reference/mdspan/layout_left.md b/reference/mdspan/layout_left.md index 791be790c1..0d02cd54de 100644 --- a/reference/mdspan/layout_left.md +++ b/reference/mdspan/layout_left.md @@ -13,7 +13,7 @@ namespace std { } ``` * Extents[link extents.md] -* mapping[link mapping.md.nolink] +* mapping[link layout_left/mapping.md] ## 概要 `layout_left`は、多次元配列ビュー[`mdspan`](mdspan.md)に対して、FortranやMatlab多次元配列と互換性のある列優先(column major)[レイアウトマッピング](LayoutMapping.md)を表現するポリシークラスである。 @@ -27,7 +27,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`mapping`](mapping.md.nolink) | レイアウトマッピング | C++23 | +| [`mapping`](layout_left/mapping.md) | レイアウトマッピング | C++23 | ## 例 @@ -37,7 +37,7 @@ namespace std { int main() { - double arr[] = {1, 4, 2, 5, 3, 6}; + double arr[] = {1, 2, 3, 4, 5, 6}; // 要素数2x3の2次元配列/列優先レイアウト using Ext2x3 = std::extents; @@ -57,8 +57,8 @@ int main() ### 出力 ``` -1 2 3 -4 5 6 +1 3 5 +2 4 6 ``` diff --git a/reference/mdspan/layout_left/mapping.md b/reference/mdspan/layout_left/mapping.md new file mode 100644 index 0000000000..b6d4264bbc --- /dev/null +++ b/reference/mdspan/layout_left/mapping.md @@ -0,0 +1,132 @@ +# mapping +* mdspan[meta header] +* class template[meta id-type] +* std[meta namespace] +* layout_left[meta class] +* cpp23[meta cpp] + +```cpp +namespace std { + template + class layout_left::mapping; +} +``` +* layout_left[link ../layout_left.md] +* Extents[link ../extents.md] + +## 概要 +`layout_left::mapping`は、[`extents`](../extents.md)型の多次元配列サイズ`E`をパラメータとして、Fortran/Matlab多次元配列と互換性のある列優先(column major)[レイアウトマッピング](../LayoutMapping.md)を表現するクラスである。 + +`layout_left::mapping`は[トリビアルコピー可能](/reference/type_traits/is_trivially_copyable.md)であり、[`regular`](/reference/concepts/regular.md)のモデルである。 + +### 説明専用メンバ変数 +`layout_left::mapping`クラステンプレートは、下記の説明専用メンバ変数を保持する。 + +- `extents_` : `extents_type`型の[多次元配列サイズ情報](../extents.md) + + +## 適格要件 +- `Extents`は[`extents`](../extents.md)の特殊化であること。 +- [`Extents::rank_dynamic()`](../extents/rank_dynamic.md) `== 0`が`true`のとき、多次元インデクス空間`Extents()`のサイズが`Extents::index_type`型で表現できること。 + + +## メンバ関数 +### 構築・破棄 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`(constructor)`](mapping/op_constructor.md) | コンストラクタ | C++23 | +| `(destructor)` | デストラクタ | C++23 | +| `operator=` | コピー代入演算子 | C++23 | + +### 観測 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `extents` | 多次元配列のサイズ`extents_`を取得する | C++23 | +| [`required_span_size`](mapping/required_span_size.md) | 要素アクセス範囲を取得する | C++23 | +| [`operator()`](mapping/op_call.md) | 多次元配列インデクスから要素位置へ変換する | C++23 | +| [`stride`](mapping/stride.md) | 指定次元のストライド幅を取得する | C++23 | + + +## 静的メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `is_always_unique` | `true`を返す | C++23 | +| `is_always_exhaustive` | `true`を返す | C++23 | +| `is_always_strided` | `true`を返す | C++23 | +| `is_unique` | `true`を返す | C++23 | +| `is_exhaustive` | `true`を返す | C++23 | +| `is_strided` | `true`を返す | C++23 | + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `extents_type` | [`Extents`](../extents.md) | C++23 | +| `index_type` | [`Extents::index_type`](../extents.md) | C++23 | +| `size_type` | [`Extents::size_type`](../extents.md) | C++23 | +| `rank_type` | [`Extents::rank_type`](../extents.md) | C++23 | +| `layout_type` | [`layout_left`](../layout_left.md) | C++23 | + + +### 比較演算子 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`operator==`](mapping/op_equal.md) | 等値比較 | C++23 | +| [`operator!=`](mapping/op_equal.md) | 非等値比較 (`==`により使用可能) | C++23 | + + +## 例 +```cpp example +#include +#include + +int main() +{ + double arr[] = {1, 2, 3, 4, 5, 6}; + + // 要素数2x3の2次元配列/列優先レイアウト + using Ext2x3 = std::extents; + using Mapping = std::layout_left::mapping; + std::mdspan mat{arr, Mapping{}}; + + for (size_t i = 0; i < mat.extent(0); ++i) { + for (size_t j = 0; j < mat.extent(1); ++j) { + std::cout << (j ? " " : "") << mat[i, j]; + } + std::cout << "\n"; + } +} +``` +* std::layout_left::mapping[color ff0000] +* std::mdspan[link ../mdspan.md] +* std::extents[link ../extents.md] + +### 出力 +``` +1 3 5 +2 4 6 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`mdspan`](../mdspan.md) + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/layout_left/mapping/op_call.md b/reference/mdspan/layout_left/mapping/op_call.md new file mode 100644 index 0000000000..18c58c9eaf --- /dev/null +++ b/reference/mdspan/layout_left/mapping/op_call.md @@ -0,0 +1,76 @@ +# operator() +* mdspan[meta header] +* function template[meta id-type] +* std[meta namespace] +* layout_left::mapping[meta class] +* cpp23[meta cpp] + +```cpp +template +constexpr index_type operator()(Indices... i) const noexcept; +``` + +## 概要 +多次元インデクス値`i...`に対応する要素位置を求める。 + + +## テンプレートパラメータ制約 +- `sizeof...(Indices) ==` [`extents_tyoe::rank()`](../../extents/rank.md)が`true`、かつ +- `(`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` && ...)`が`true`、かつ +- `(`[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)` && ...)`が`true`であること。 + + +## 事前条件 +多次元インデクス値[`extents_type::index-cast(i)`](../../extents/index-cast.md)は、多次元配列サイズ`extents_`における有効なインデクスであること。 + + +## 戻り値 +説明用のパラメータパック`P`において、[`is_same_v`](/reference/type_traits/is_same.md)`<`[`index_sequence_for`](/reference/utility/index_sequence_for.md)`,` [`index_sequence`](/reference/utility/index_sequence.md)`>`が`true`となるとき、以下と等価。 + +```cpp +return ((static_cast(Indices...) * stride(P)) + ... + 0); +``` +* stride[link stride.md] + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include + +int main() +{ + using Ext3x4 = std::extents; + using Mapping3x4 = std::layout_left::mapping; + Mapping3x4 map; + assert(map(0,0) == 0); + assert(map(0,1) == 3); + assert(map(1,0) == 1); + assert(map(2,3) == 11); +} +``` +* std::extents[link ../../extents.md] +* std::layout_left::mapping[link ../mapping.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/layout_left/mapping/op_constructor.md b/reference/mdspan/layout_left/mapping/op_constructor.md new file mode 100644 index 0000000000..2db5d74dfc --- /dev/null +++ b/reference/mdspan/layout_left/mapping/op_constructor.md @@ -0,0 +1,154 @@ +# コンストラクタ +* mdspan[meta header] +* function template[meta id-type] +* std[meta namespace] +* layout_left::mapping[meta class] +* cpp23[meta cpp] + +```cpp +constexpr mapping() noexcept = default; // (1) + +constexpr mapping(const mapping&) noexcept = default; // (2) + +constexpr mapping(const extents_type& e) noexcept; // (3) + +template +constexpr explicit(!is_convertible_v) + mapping(const mapping& other) noexcept; // (4) + +template +constexpr explicit(!is_convertible_v) + mapping(const layout_right::mapping& other) noexcept; // (5) + +template +constexpr explicit(extents_type::rank() > 0) + mapping(const layout_stride::mapping& other) noexcept; // (6) +``` +* is_convertible_v[link /reference/type_traits/is_convertible.md] +* rank()[link ../../extents/rank.md] +* layout_right::mapping[link ../../layout_right/mapping.md] +* layout_stride::mapping[link ../../layout_stride/mapping.md.nolink] + +## 概要 +- (1) : デフォルトコンストラクタ +- (2) : コピーコンストラクタ +- (3) : [`extents`](../../extents.md)からの変換コンストラクタ +- (4) : 他`layout_left::mapping`からの変換コンストラクタ +- (5) : [`layout_right::mapping`](../../layout_right/mapping.md)からの変換コンストラクタ +- (6) : [`layout_stride::mapping`](../../layout_stride/mapping.md.nolink)からの変換コンストラクタ + + +## テンプレートパラメータ制約 +- (4) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true`であること。 +- (5) : + - `extents_type::`[`rank()`](../../extents/rank.md) `<= 1`、かつ + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true`であること。 +- (6) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true`であること。 + + +## 事前条件 +- (3) : `e`の多次元インデクス空間のサイズを、`index_type`型で表現できること。 +- (4) : `other.`[`required_span_size()`](required_span_size.md)を、`index_type`型で表現できること。 +- (5) : `other.`[`required_span_size()`](../../layout_left/mapping/required_span_size.md)を、`index_type`型で表現できること。 +- (6) : + - `extents_type::`[`rank()`](../../extents/rank.md) `> 0`のとき、`other`における全次元のストライド幅が[`layout_left::mapping`相当の制約](stride.md)をもつこと。 + - `other.`[`required_span_size()`](../../layout_stride/mapping/required_span_size.md.nolink)を、`index_type`型で表現できること。 + + +## 効果 +- (3) : `e`を用いて`extents_`を直接非リスト初期化する。 +- (4), (5), (6) : `other.extents()`を用いて`extents_`を直接非リスト初期化する。 + + +## 例外 +投げない + + +## explicitになる条件 +- (4), (5) : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`` +- (6) : [`extents_type::rank()`](../../extents/rank.md) `> 0` + + +## 例 +```cpp example +#include +#include +#include + +using Ext3x4 = std::extents; +using Ext3xN = std::extents; + +using Mapping3x4 = std::layout_left::mapping; +using Mapping3xN = std::layout_left::mapping; + +int main() +{ + // (1) : デフォルトコンストラクタ + { + Mapping3x4 map1_3x4; + Mapping3xN map1_3xN; + assert(map1_3x4.required_span_size() == 12); + assert(map1_3xN.required_span_size() == 0); + } + // (2) : コピーコンストラクタ + { + Mapping3xN map2_a; + Mapping3xN map2_b = map2_a; + assert(map2_a == map2_b); + } + // (3) : extentsからの変換コンストラクタ + { + Ext3xN ext{4}; + Mapping3xN map3 = ext; + assert(map3.extents() == ext); + } + // (4) : layout_left::mappingからの変換コンストラクタ + { + Mapping3x4 map4_3x4; + Mapping3xN map4_3xN = map4_3x4; + assert(map4_3x4 == map4_3xN); + } + // (5) : layout_right::mappingからの変換コンストラクタ + { + using Ext1D = std::dextents; + std::layout_right::mapping src5{Ext1D{5}}; + std::layout_left::mapping dst5 = src5; + } + // (6) : layout_stride::mappingからの変換コンストラクタ + { + std::array strides{1, 3}; + std::layout_stride::mapping src6{{}, strides}; + std::layout_left::mapping dst6{src6}; // (explicit) + } +} +``` +* std::extents[link ../../extents.md] +* std::dextents[link ../../extents.md] +* std::layout_left::mapping[link ../mapping.md] +* std::layout_right::mapping[link ../../layout_right/mapping.md] +* std::layout_stride::mapping[link ../../layout_stride/mapping.md.nolink] +* required_span_size()[link required_span_size.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`layout_right::mapping`](../../layout_right/mapping.md) +- [`layout_stride::mapping`](../../layout_stride/mapping.md.nolink) + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/layout_left/mapping/op_equal.md b/reference/mdspan/layout_left/mapping/op_equal.md new file mode 100644 index 0000000000..2ac7079adb --- /dev/null +++ b/reference/mdspan/layout_left/mapping/op_equal.md @@ -0,0 +1,75 @@ +# operator== +* mdspan[meta header] +* function template[meta id-type] +* std[meta namespace] +* layout_left::mapping[meta class] +* cpp23[meta cpp] + +```cpp +template +friend constexpr bool operator==( + const mapping& x, const mapping& y) noexcept; + +//operator==により、以下のオーバーロードが使用可能になる +template +friend constexpr bool operator!=( + const mapping& x, const mapping& y) noexcept; +``` + +## 概要 +`mapping`の等値比較を行う。 + + +## テンプレートパラメータ制約 +`extents_type::`[`rank()`](../../extents/rank.md) `== OtherExtents::`[`rank()`](../../extents/rank.md) + + +## 戻り値 +[`x.extents() == y.extents()`](../../extents/op_equal.md) + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include + +int main() +{ + using Ext3x4 = std::extents; + using Mapping3x4 = std::layout_left::mapping; + Mapping3x4 map1; + + using Ext3xN = std::extents; + using Mapping3xN = std::layout_left::mapping; + Mapping3xN map2{Ext3xN{4}}; + + assert(map1 == map2); +} +``` +* ==[color ff0000] +* std::extents[link ../../extents.md] +* std::layout_left::mapping[link ../mapping.md] + + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/layout_left/mapping/required_span_size.md b/reference/mdspan/layout_left/mapping/required_span_size.md new file mode 100644 index 0000000000..40419fe696 --- /dev/null +++ b/reference/mdspan/layout_left/mapping/required_span_size.md @@ -0,0 +1,65 @@ +# required_span_size +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* layout_left::mapping[meta class] +* cpp23[meta cpp] + +```cpp +index_type required_span_size() const noexcept; +``` + +## 概要 +メモリブロックに対する要素アクセス範囲を取得する。 + + +## 戻り値 +多次元配列サイズ[`extents()`](../mapping.md)に対して、全次元の要素数を乗算した値。 +次元数が0の場合は、値1を返す。 + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include + +int main() +{ + using Ext3x4 = std::extents; + using Mapping3x4 = std::layout_left::mapping; + Mapping3x4 map1{}; + assert(map1.required_span_size() == 12); + + using Ext3D = std::dextents; + using Mapping3D = std::layout_left::mapping; + Mapping3D map2{Ext3D{4, 3, 2}}; + assert(map2.required_span_size() == 24); +} +``` +* required_span_size()[color ff0000] +* std::extents[link ../../extents.md] +* std::dextents[link ../../extents.md] +* std::layout_left::mapping[link ../mapping.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/layout_left/mapping/stride.md b/reference/mdspan/layout_left/mapping/stride.md new file mode 100644 index 0000000000..0e0180b8b3 --- /dev/null +++ b/reference/mdspan/layout_left/mapping/stride.md @@ -0,0 +1,78 @@ +# stride +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* layout_left::mapping[meta class] +* cpp23[meta cpp] + +```cpp +constexpr index_type stride(rank_type i) const noexcept; +``` + +## 概要 +`i`番目次元のストライド幅を取得する。 + + +## テンプレートパラメータ制約 +[`extents_type::rank()`](../../extents/rank.md) `> 0` + + +## 事前条件 +`i <` [`extents_type::rank()`](../../extents/rank.md) + + +## 戻り値 +多次元配列サイズの次元数`R =` [`extents_type::rank()`](../../extents/rank.md)としたとき + +- `i > 0`のとき、最左次元(`0`番目)から`i - 1`番目次元までの要素数を乗算した値を返す。 +- `i == 0`のとき、値1を返す。 + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include + +int main() +{ + using Ext3x4 = std::extents; + using Mapping3x4 = std::layout_left::mapping; + Mapping3x4 map1; + assert(map1.stride(0) == 1); + assert(map1.stride(1) == 3); + + using Ext3D = std::dextents; + using Mapping3D = std::layout_left::mapping; + Mapping3D map2{Ext3D{4, 3, 2}}; + assert(map2.stride(0) == 1); + assert(map2.stride(1) == 4); + assert(map2.stride(2) == 12); +} +``` +* stride[color ff0000] +* std::extents[link ../../extents.md] +* std::dextents[link ../../extents.md] +* std::layout_left::mapping[link ../mapping.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/layout_right/mapping.md b/reference/mdspan/layout_right/mapping.md index 5ba076930f..149e982228 100644 --- a/reference/mdspan/layout_right/mapping.md +++ b/reference/mdspan/layout_right/mapping.md @@ -7,10 +7,8 @@ ```cpp namespace std { - struct layout_right { - template - class mapping; - }; + template + class layout_right::mapping; } ``` * layout_right[link ../layout_right.md] diff --git a/reference/mdspan/layout_right/mapping/op_constructor.md b/reference/mdspan/layout_right/mapping/op_constructor.md index 13665be4e4..34679786b0 100644 --- a/reference/mdspan/layout_right/mapping/op_constructor.md +++ b/reference/mdspan/layout_right/mapping/op_constructor.md @@ -26,7 +26,7 @@ constexpr explicit(extents_type::rank() > 0) ``` * is_convertible_v[link /reference/type_traits/is_convertible.md] * rank()[link ../../extents/rank.md] -* layout_left::mapping[link ../../layout_left/mapping.md.nolink] +* layout_left::mapping[link ../../layout_left/mapping.md] * layout_stride::mapping[link ../../layout_stride/mapping.md.nolink] ## 概要 @@ -34,7 +34,7 @@ constexpr explicit(extents_type::rank() > 0) - (2) : コピーコンストラクタ - (3) : [`extents`](../../extents.md)からの変換コンストラクタ - (4) : 他`layout_right::mapping`からの変換コンストラクタ -- (5) : [`layout_left::mapping`](../../layout_left/mapping.md.nolink)からの変換コンストラクタ +- (5) : [`layout_left::mapping`](../../layout_left/mapping.md)からの変換コンストラクタ - (6) : [`layout_stride::mapping`](../../layout_stride/mapping.md.nolink)からの変換コンストラクタ @@ -49,7 +49,7 @@ constexpr explicit(extents_type::rank() > 0) ## 事前条件 - (3) : `e`の多次元インデクス空間のサイズを、`index_type`型で表現できること。 - (4) : `other.`[`required_span_size()`](required_span_size.md)を、`index_type`型で表現できること。 -- (5) : `other.`[`required_span_size()`](../../layout_left/mapping/required_span_size.md.nolink)を、`index_type`型で表現できること。 +- (5) : `other.`[`required_span_size()`](../../layout_left/mapping/required_span_size.md)を、`index_type`型で表現できること。 - (6) : - `extents_type::`[`rank()`](../../extents/rank.md) `> 0`のとき、`other`における全次元のストライド幅が[`layout_right::mapping`相当の制約](stride.md)をもつこと。 - `other.`[`required_span_size()`](../../layout_stride/mapping/required_span_size.md.nolink)を、`index_type`型で表現できること。 @@ -125,7 +125,7 @@ int main() * std::extents[link ../../extents.md] * std::dextents[link ../../extents.md] * std::layout_right::mapping[link ../mapping.md] -* std::layout_left::mapping[link ../../layout_left/mapping.md.nolink] +* std::layout_left::mapping[link ../../layout_left/mapping.md] * std::layout_stride::mapping[link ../../layout_stride/mapping.md.nolink] * required_span_size()[link required_span_size.md] @@ -146,7 +146,7 @@ int main() ## 関連項目 -- [`layout_left::mapping`](../../layout_left/mapping.md.nolink) +- [`layout_left::mapping`](../../layout_left/mapping.md) - [`layout_stride::mapping`](../../layout_stride/mapping.md.nolink) diff --git a/reference/mdspan/layout_stride.md b/reference/mdspan/layout_stride.md index 8758500892..a2b9899de5 100644 --- a/reference/mdspan/layout_stride.md +++ b/reference/mdspan/layout_stride.md @@ -13,7 +13,7 @@ namespace std { } ``` * Extents[link extents.md] -* mapping[link mapping.md.nolink] +* mapping[link layout_stride/mapping.md.nolink] ## 概要 `layout_stride`は、多次元配列ビュー[`mdspan`](mdspan.md)に対して、次元毎に任意ストライド幅を指定した[レイアウトマッピング](LayoutMapping.md)を表現するポリシークラスである。 From 8de03aaa7db47ac31be0d7d5d83546bd8aa07172 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 19 Jan 2024 00:17:01 +0900 Subject: [PATCH 0648/3948] =?UTF-8?q?mdspan/layout=5Fstride/mapping:=20?= =?UTF-8?q?=E5=85=A8=E3=83=A1=E3=83=B3=E3=83=90(#1077)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/mdspan/LayoutMapping.md | 2 +- .../mdspan/layout_left/mapping/op_call.md | 2 +- .../layout_left/mapping/op_constructor.md | 30 ++-- .../layout_left/mapping/required_span_size.md | 2 +- .../mdspan/layout_right/mapping/op_call.md | 8 +- .../layout_right/mapping/op_constructor.md | 29 ++- .../mapping/required_span_size.md | 2 +- reference/mdspan/layout_stride.md | 4 +- reference/mdspan/layout_stride/mapping.md | 136 ++++++++++++++ .../layout_stride/mapping/is_exhaustive.md | 66 +++++++ .../mapping/layout-mapping-alike.md | 31 ++++ .../mdspan/layout_stride/mapping/op_call.md | 85 +++++++++ .../layout_stride/mapping/op_constructor.md | 167 ++++++++++++++++++ .../mdspan/layout_stride/mapping/op_equal.md | 92 ++++++++++ .../mapping/required_span_size.md | 78 ++++++++ .../mdspan/layout_stride/mapping/stride.md | 62 +++++++ 16 files changed, 757 insertions(+), 39 deletions(-) create mode 100644 reference/mdspan/layout_stride/mapping.md create mode 100644 reference/mdspan/layout_stride/mapping/is_exhaustive.md create mode 100644 reference/mdspan/layout_stride/mapping/layout-mapping-alike.md create mode 100644 reference/mdspan/layout_stride/mapping/op_call.md create mode 100644 reference/mdspan/layout_stride/mapping/op_constructor.md create mode 100644 reference/mdspan/layout_stride/mapping/op_equal.md create mode 100644 reference/mdspan/layout_stride/mapping/required_span_size.md create mode 100644 reference/mdspan/layout_stride/mapping/stride.md diff --git a/reference/mdspan/LayoutMapping.md b/reference/mdspan/LayoutMapping.md index add2121970..0516a75fcb 100644 --- a/reference/mdspan/LayoutMapping.md +++ b/reference/mdspan/LayoutMapping.md @@ -44,7 +44,7 @@ std::mdspan mat3x2{a}; ``` - Unique特性 : 異なる多次元インデクス値は、異なる要素位置に対応する。参照先が重複することはない。 -- Exhaustive特性 : 全ての多次元インデクス値に対応する要素位置は連続している。 +- Exhaustive特性 : 全ての多次元インデクス値に対応する要素位置は隣接配置される。 - Strided特性 : 多次元インデクス値`i,j`に対応する要素位置は、ストライド幅`2,1`を用いて`i*2+j*1`と計算できる。 diff --git a/reference/mdspan/layout_left/mapping/op_call.md b/reference/mdspan/layout_left/mapping/op_call.md index 18c58c9eaf..7be1859987 100644 --- a/reference/mdspan/layout_left/mapping/op_call.md +++ b/reference/mdspan/layout_left/mapping/op_call.md @@ -15,7 +15,7 @@ constexpr index_type operator()(Indices... i) const noexcept; ## テンプレートパラメータ制約 -- `sizeof...(Indices) ==` [`extents_tyoe::rank()`](../../extents/rank.md)が`true`、かつ +- `sizeof...(Indices) ==` [`extents_type::rank()`](../../extents/rank.md)が`true`、かつ - `(`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` && ...)`が`true`、かつ - `(`[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)` && ...)`が`true`であること。 diff --git a/reference/mdspan/layout_left/mapping/op_constructor.md b/reference/mdspan/layout_left/mapping/op_constructor.md index 2db5d74dfc..4c4b118cf0 100644 --- a/reference/mdspan/layout_left/mapping/op_constructor.md +++ b/reference/mdspan/layout_left/mapping/op_constructor.md @@ -27,7 +27,7 @@ constexpr explicit(extents_type::rank() > 0) * is_convertible_v[link /reference/type_traits/is_convertible.md] * rank()[link ../../extents/rank.md] * layout_right::mapping[link ../../layout_right/mapping.md] -* layout_stride::mapping[link ../../layout_stride/mapping.md.nolink] +* layout_stride::mapping[link ../../layout_stride/mapping.md] ## 概要 - (1) : デフォルトコンストラクタ @@ -35,7 +35,7 @@ constexpr explicit(extents_type::rank() > 0) - (3) : [`extents`](../../extents.md)からの変換コンストラクタ - (4) : 他`layout_left::mapping`からの変換コンストラクタ - (5) : [`layout_right::mapping`](../../layout_right/mapping.md)からの変換コンストラクタ -- (6) : [`layout_stride::mapping`](../../layout_stride/mapping.md.nolink)からの変換コンストラクタ +- (6) : [`layout_stride::mapping`](../../layout_stride/mapping.md)からの変換コンストラクタ ## テンプレートパラメータ制約 @@ -52,7 +52,7 @@ constexpr explicit(extents_type::rank() > 0) - (5) : `other.`[`required_span_size()`](../../layout_left/mapping/required_span_size.md)を、`index_type`型で表現できること。 - (6) : - `extents_type::`[`rank()`](../../extents/rank.md) `> 0`のとき、`other`における全次元のストライド幅が[`layout_left::mapping`相当の制約](stride.md)をもつこと。 - - `other.`[`required_span_size()`](../../layout_stride/mapping/required_span_size.md.nolink)を、`index_type`型で表現できること。 + - `other.`[`required_span_size()`](../../layout_stride/mapping/required_span_size.md)を、`index_type`型で表現できること。 ## 効果 @@ -78,34 +78,34 @@ constexpr explicit(extents_type::rank() > 0) using Ext3x4 = std::extents; using Ext3xN = std::extents; -using Mapping3x4 = std::layout_left::mapping; -using Mapping3xN = std::layout_left::mapping; +using Mapping3x4 = ; +using Mapping3xN = ; int main() { // (1) : デフォルトコンストラクタ { - Mapping3x4 map1_3x4; - Mapping3xN map1_3xN; + std::layout_left::mapping map1_3x4; + std::layout_left::mapping map1_3xN; assert(map1_3x4.required_span_size() == 12); assert(map1_3xN.required_span_size() == 0); } // (2) : コピーコンストラクタ { - Mapping3xN map2_a; - Mapping3xN map2_b = map2_a; + std::layout_left::mapping map2_a; + std::layout_left::mapping map2_b = map2_a; assert(map2_a == map2_b); } // (3) : extentsからの変換コンストラクタ { Ext3xN ext{4}; - Mapping3xN map3 = ext; + std::layout_left::mapping map3 = ext; assert(map3.extents() == ext); } // (4) : layout_left::mappingからの変換コンストラクタ { - Mapping3x4 map4_3x4; - Mapping3xN map4_3xN = map4_3x4; + std::layout_left::mapping map4_3x4; + std::layout_left::mapping map4_3xN = map4_3x4; assert(map4_3x4 == map4_3xN); } // (5) : layout_right::mappingからの変換コンストラクタ @@ -122,11 +122,11 @@ int main() } } ``` +* std::layout_left::mapping[color ff0000] * std::extents[link ../../extents.md] * std::dextents[link ../../extents.md] -* std::layout_left::mapping[link ../mapping.md] * std::layout_right::mapping[link ../../layout_right/mapping.md] -* std::layout_stride::mapping[link ../../layout_stride/mapping.md.nolink] +* std::layout_stride::mapping[link ../../layout_stride/mapping.md] * required_span_size()[link required_span_size.md] ### 出力 @@ -147,7 +147,7 @@ int main() ## 関連項目 - [`layout_right::mapping`](../../layout_right/mapping.md) -- [`layout_stride::mapping`](../../layout_stride/mapping.md.nolink) +- [`layout_stride::mapping`](../../layout_stride/mapping.md) ## 参照 diff --git a/reference/mdspan/layout_left/mapping/required_span_size.md b/reference/mdspan/layout_left/mapping/required_span_size.md index 40419fe696..4fdcb6eeb0 100644 --- a/reference/mdspan/layout_left/mapping/required_span_size.md +++ b/reference/mdspan/layout_left/mapping/required_span_size.md @@ -6,7 +6,7 @@ * cpp23[meta cpp] ```cpp -index_type required_span_size() const noexcept; +constexpr index_type required_span_size() const noexcept; ``` ## 概要 diff --git a/reference/mdspan/layout_right/mapping/op_call.md b/reference/mdspan/layout_right/mapping/op_call.md index a8c41860e6..42420efa52 100644 --- a/reference/mdspan/layout_right/mapping/op_call.md +++ b/reference/mdspan/layout_right/mapping/op_call.md @@ -15,7 +15,7 @@ constexpr index_type operator()(Indices... i) const noexcept; ## テンプレートパラメータ制約 -- `sizeof...(Indices) ==` [`extents_tyoe::rank()`](../../extents/rank.md)が`true`、かつ +- `sizeof...(Indices) ==` [`extents_type::rank()`](../../extents/rank.md)が`true`、かつ - `(`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` && ...)`が`true`、かつ - `(`[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)` && ...)`が`true`であること。 @@ -45,6 +45,10 @@ return ((static_cast(Indices...) * stride(P)) + ... + 0); int main() { using Ext3x4 = std::extents; + using Mapping = std::layout_stride::mapping; + std::array strides{4, 1}; + std::mdspan mat{arr, Mapping{{}, strides}}; + using Mapping3x4 = std::layout_right::mapping; Mapping3x4 map; assert(map(0,0) == 0); @@ -54,7 +58,7 @@ int main() } ``` * std::extents[link ../../extents.md] -* std::layout_right::mapping[link ../mapping.md] +* std::layout_stride::mapping[link ../mapping.md] ### 出力 ``` diff --git a/reference/mdspan/layout_right/mapping/op_constructor.md b/reference/mdspan/layout_right/mapping/op_constructor.md index 34679786b0..72e60c94e3 100644 --- a/reference/mdspan/layout_right/mapping/op_constructor.md +++ b/reference/mdspan/layout_right/mapping/op_constructor.md @@ -27,7 +27,7 @@ constexpr explicit(extents_type::rank() > 0) * is_convertible_v[link /reference/type_traits/is_convertible.md] * rank()[link ../../extents/rank.md] * layout_left::mapping[link ../../layout_left/mapping.md] -* layout_stride::mapping[link ../../layout_stride/mapping.md.nolink] +* layout_stride::mapping[link ../../layout_stride/mapping.md] ## 概要 - (1) : デフォルトコンストラクタ @@ -35,7 +35,7 @@ constexpr explicit(extents_type::rank() > 0) - (3) : [`extents`](../../extents.md)からの変換コンストラクタ - (4) : 他`layout_right::mapping`からの変換コンストラクタ - (5) : [`layout_left::mapping`](../../layout_left/mapping.md)からの変換コンストラクタ -- (6) : [`layout_stride::mapping`](../../layout_stride/mapping.md.nolink)からの変換コンストラクタ +- (6) : [`layout_stride::mapping`](../../layout_stride/mapping.md)からの変換コンストラクタ ## テンプレートパラメータ制約 @@ -52,7 +52,7 @@ constexpr explicit(extents_type::rank() > 0) - (5) : `other.`[`required_span_size()`](../../layout_left/mapping/required_span_size.md)を、`index_type`型で表現できること。 - (6) : - `extents_type::`[`rank()`](../../extents/rank.md) `> 0`のとき、`other`における全次元のストライド幅が[`layout_right::mapping`相当の制約](stride.md)をもつこと。 - - `other.`[`required_span_size()`](../../layout_stride/mapping/required_span_size.md.nolink)を、`index_type`型で表現できること。 + - `other.`[`required_span_size()`](../../layout_stride/mapping/required_span_size.md)を、`index_type`型で表現できること。 ## 効果 @@ -78,34 +78,31 @@ constexpr explicit(extents_type::rank() > 0) using Ext3x4 = std::extents; using Ext3xN = std::extents; -using Mapping3x4 = std::layout_right::mapping; -using Mapping3xN = std::layout_right::mapping; - int main() { // (1) : デフォルトコンストラクタ { - Mapping3x4 map1_3x4; - Mapping3xN map1_3xN; + std::layout_right::mapping map1_3x4; + std::layout_right::mapping map1_3xN; assert(map1_3x4.required_span_size() == 12); assert(map1_3xN.required_span_size() == 0); } // (2) : コピーコンストラクタ { - Mapping3xN map2_a; - Mapping3xN map2_b = map2_a; + std::layout_right::mapping map2_a; + std::layout_right::mapping map2_b = map2_a; assert(map2_a == map2_b); } // (3) : extentsからの変換コンストラクタ { Ext3xN ext{4}; - Mapping3xN map3 = ext; + std::layout_right::mapping map3 = ext; assert(map3.extents() == ext); } // (4) : layout_right::mappingからの変換コンストラクタ { - Mapping3x4 map4_3x4; - Mapping3xN map4_3xN = map4_3x4; + std::layout_right::mapping map4_3x4; + std::layout_right::mapping map4_3xN = map4_3x4; assert(map4_3x4 == map4_3xN); } // (5) : layout_left::mappingからの変換コンストラクタ @@ -122,11 +119,11 @@ int main() } } ``` +* std::layout_right::mapping[color ff0000] * std::extents[link ../../extents.md] * std::dextents[link ../../extents.md] -* std::layout_right::mapping[link ../mapping.md] * std::layout_left::mapping[link ../../layout_left/mapping.md] -* std::layout_stride::mapping[link ../../layout_stride/mapping.md.nolink] +* std::layout_stride::mapping[link ../../layout_stride/mapping.md] * required_span_size()[link required_span_size.md] ### 出力 @@ -147,7 +144,7 @@ int main() ## 関連項目 - [`layout_left::mapping`](../../layout_left/mapping.md) -- [`layout_stride::mapping`](../../layout_stride/mapping.md.nolink) +- [`layout_stride::mapping`](../../layout_stride/mapping.md) ## 参照 diff --git a/reference/mdspan/layout_right/mapping/required_span_size.md b/reference/mdspan/layout_right/mapping/required_span_size.md index 2348057990..b6d2e28f0e 100644 --- a/reference/mdspan/layout_right/mapping/required_span_size.md +++ b/reference/mdspan/layout_right/mapping/required_span_size.md @@ -6,7 +6,7 @@ * cpp23[meta cpp] ```cpp -index_type required_span_size() const noexcept; +constexpr index_type required_span_size() const noexcept; ``` ## 概要 diff --git a/reference/mdspan/layout_stride.md b/reference/mdspan/layout_stride.md index a2b9899de5..69f790cc4a 100644 --- a/reference/mdspan/layout_stride.md +++ b/reference/mdspan/layout_stride.md @@ -13,7 +13,7 @@ namespace std { } ``` * Extents[link extents.md] -* mapping[link layout_stride/mapping.md.nolink] +* mapping[link layout_stride/mapping.md] ## 概要 `layout_stride`は、多次元配列ビュー[`mdspan`](mdspan.md)に対して、次元毎に任意ストライド幅を指定した[レイアウトマッピング](LayoutMapping.md)を表現するポリシークラスである。 @@ -25,7 +25,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`mapping`](mapping.md.nolink) | レイアウトマッピング | C++23 | +| [`mapping`](layout_stride/mapping.md) | レイアウトマッピング | C++23 | ## 例 diff --git a/reference/mdspan/layout_stride/mapping.md b/reference/mdspan/layout_stride/mapping.md new file mode 100644 index 0000000000..81d79bf939 --- /dev/null +++ b/reference/mdspan/layout_stride/mapping.md @@ -0,0 +1,136 @@ +# mapping +* mdspan[meta header] +* class template[meta id-type] +* std[meta namespace] +* layout_stride[meta class] +* cpp23[meta cpp] + +```cpp +namespace std { + template + class layout_stride::mapping; +} +``` +* layout_stride[link ../layout_stride.md] +* Extents[link ../extents.md] + +## 概要 +`layout_stride::mapping`は、[`extents`](../extents.md)型の多次元配列サイズ`E`をパラメータとして、次元毎に任意ストライド幅を指定した[レイアウトマッピング](../LayoutMapping.md)を表現するクラスである。 + +`layout_stride::mapping`は[トリビアルコピー可能](/reference/type_traits/is_trivially_copyable.md)であり、[`regular`](/reference/concepts/regular.md)のモデルである。 + +### 説明専用メンバ変数 +`layout_stride::mapping`クラステンプレートは、下記の説明専用メンバ変数を保持する。 + +- `extents_` : `extents_type`型の[多次元配列サイズ情報](../extents.md) +- `strides_` : `array`型のストライド幅配列 + + +## 適格要件 +- `Extents`は[`extents`](../extents.md)の特殊化であること。 +- [`Extents::rank_dynamic()`](../extents/rank_dynamic.md) `== 0`が`true`のとき、多次元インデクス空間`Extents()`のサイズが`Extents::index_type`型で表現できること。 + + +## メンバ関数 +### 構築・破棄 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`(constructor)`](mapping/op_constructor.md) | コンストラクタ | C++23 | +| `(destructor)` | デストラクタ | C++23 | +| `operator=` | コピー代入演算子 | C++23 | + +### 観測 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `extents` | 多次元配列のサイズ`extents_`を取得する | C++23 | +| `strides` | ストライド配列`strides_`を取得する | C++23 | +| [`required_span_size`](mapping/required_span_size.md) | 要素アクセス範囲を取得する | C++23 | +| [`operator()`](mapping/op_call.md) | 多次元配列インデクスから要素位置へ変換する | C++23 | +| [`is_exhaustive`](mapping/is_exhaustive.md) | [Exhaustive特性](../LayoutMapping.md)を取得する | C++23 | +| [`stride`](mapping/stride.md) | 指定次元のストライド幅を取得する | C++23 | + + +## 静的メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `is_always_unique` | `true`を返す | C++23 | +| `is_always_exhaustive` | `false`を返す | C++23 | +| `is_always_strided` | `true`を返す | C++23 | +| `is_unique` | `true`を返す | C++23 | +| `is_strided` | `true`を返す | C++23 | + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `extents_type` | [`Extents`](../extents.md) | C++23 | +| `index_type` | [`Extents::index_type`](../extents.md) | C++23 | +| `size_type` | [`Extents::size_type`](../extents.md) | C++23 | +| `rank_type` | [`Extents::rank_type`](../extents.md) | C++23 | +| `layout_type` | [`layout_stride`](../layout_stride.md) | C++23 | + + +### 比較演算子 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`operator==`](mapping/op_equal.md) | 等値比較 | C++23 | +| [`operator!=`](mapping/op_equal.md) | 非等値比較 (`==`により使用可能) | C++23 | + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + double arr[] = {1, 2, 3, 0, 4, 5, 6, 0}; + + // 要素数2x3の2次元配列/パディングあり行優先レイアウト + using Ext2x3 = std::extents; + using Mapping = std::layout_stride::mapping; + std::array strides{4, 1}; + std::mdspan mat{arr, Mapping{{}, strides}}; + + for (size_t i = 0; i < mat.extent(0); ++i) { + for (size_t j = 0; j < mat.extent(1); ++j) { + std::cout << (j ? " " : "") << mat[i, j]; + } + std::cout << "\n"; + } +} +``` +* std::layout_stride::mapping[color ff0000] +* std::mdspan[link ../mdspan.md] +* std::extents[link ../extents.md] + +### 出力 +``` +1 2 3 +4 5 6 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`mdspan`](../mdspan.md) + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/layout_stride/mapping/is_exhaustive.md b/reference/mdspan/layout_stride/mapping/is_exhaustive.md new file mode 100644 index 0000000000..22ac4e84e3 --- /dev/null +++ b/reference/mdspan/layout_stride/mapping/is_exhaustive.md @@ -0,0 +1,66 @@ +# is_exhaustive +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* layout_stride::mapping[meta class] +* cpp23[meta cpp] + +```cpp +constexpr bool is_exhaustive() const noexcept; +``` + +## 概要 +レイアウトマッピングの[Exhaustive特性](../../LayoutMapping.md)を取得する。 + + +## 戻り値 +多次元インデクスの次元数を`rank_`としたとき + +- `rank_ == 0`のとき、`true`を返す。 +- そうでなければ、取りうる全ての多次元インデクス値に対応する要素位置を考えたとき、アクセスされうる要素位置に隙間が生じないならば`true`を返す。 +- そうでなければ、`false`を返す。 + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include + +int main() +{ + using Ext2x3 = std::extents; + using Mapping = std::layout_stride::mapping; + + Mapping map1{{}, std::array{3, 1}}; + assert(map1.is_exhaustive()); + + Mapping map2{{}, std::array{4, 1}}; + assert(not map2.is_exhaustive()); +} +``` +* is_exhaustive()[color ff0000] +* std::extents[link ../../extents.md] +* std::layout_stride::mapping[link ../mapping.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/layout_stride/mapping/layout-mapping-alike.md b/reference/mdspan/layout_stride/mapping/layout-mapping-alike.md new file mode 100644 index 0000000000..ab4ac4ca47 --- /dev/null +++ b/reference/mdspan/layout_stride/mapping/layout-mapping-alike.md @@ -0,0 +1,31 @@ +# layout-mapping-alike +* mdspan[meta header] +* concept[meta id-type] +* std[meta namespace] +* layout_stride::mapping[meta class] +* cpp23[meta cpp] + +```cpp +template +concept layout-mapping-alike = requires { // exposition only + requires is-extents; + { M::is_always_strided() } -> same_as; + { M::is_always_exhaustive() } -> same_as; + { M::is_always_unique() } -> same_as; + bool_constant::value; + bool_constant::value; + bool_constant::value; +}; +``` + +## 概要 +`layout_stride::mapping`動作仕様のための説明専用コンセプトである。 + + +## バージョン +### 言語 +- C++23 + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/layout_stride/mapping/op_call.md b/reference/mdspan/layout_stride/mapping/op_call.md new file mode 100644 index 0000000000..e8ee2367ea --- /dev/null +++ b/reference/mdspan/layout_stride/mapping/op_call.md @@ -0,0 +1,85 @@ +# operator() +* mdspan[meta header] +* function template[meta id-type] +* std[meta namespace] +* layout_stride::mapping[meta class] +* cpp23[meta cpp] + +```cpp +template +constexpr index_type operator()(Indices... i) const noexcept; +``` + +## 概要 +多次元インデクス値`i...`に対応する要素位置を求める。 + + +## テンプレートパラメータ制約 +- `sizeof...(Indices) ==` [`extents_type::rank()`](../../extents/rank.md)が`true`、かつ +- `(`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` && ...)`が`true`、かつ +- `(`[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)` && ...)`が`true`であること。 + + +## 事前条件 +多次元インデクス値[`extents_type::index-cast(i)`](../../extents/index-cast.md)は、多次元配列サイズ`extents_`における有効なインデクスであること。 + + +## 戻り値 +説明用のパラメータパック`P`において、[`is_same_v`](/reference/type_traits/is_same.md)`<`[`index_sequence_for`](/reference/utility/index_sequence_for.md)`,` [`index_sequence`](/reference/utility/index_sequence.md)`>`が`true`となるとき、以下と等価。 + +```cpp +return ((static_cast(Indices...) * stride(P)) + ... + 0); +``` +* stride[link stride.md] + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include + +int main() +{ + using Ext3D = std::dextents; + using Mapping = std::layout_stride::mapping; + std::array strides{6, 1, 3}; + Mapping map{Ext3D{4, 3, 2}, strides}; + // map(i,j,k): + // i= 0 | 1 | 2 | 3 + // ------+-------+-------+------- + // j/k -> + // | 0 3 | 6 9 | 12 15 | 18 21 + // V 1 4 | 7 10 | 13 16 | 19 22 + // 2 5 | 8 11 | 14 17 | 20 23 + assert(map(0,0,0) == 0); + assert(map(1,0,0) == 6); + assert(map(0,1,0) == 1); + assert(map(0,0,1) == 3); + assert(map(3,2,1) == 23); +} +``` +* std::dextents[link ../../extents.md] +* std::layout_stride::mapping[link ../mapping.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/layout_stride/mapping/op_constructor.md b/reference/mdspan/layout_stride/mapping/op_constructor.md new file mode 100644 index 0000000000..3de01f41ae --- /dev/null +++ b/reference/mdspan/layout_stride/mapping/op_constructor.md @@ -0,0 +1,167 @@ +# コンストラクタ +* mdspan[meta header] +* function template[meta id-type] +* std[meta namespace] +* layout_stride::mapping[meta class] +* cpp23[meta cpp] + +```cpp +constexpr mapping() noexcept; // (1) + +constexpr mapping(const mapping&) noexcept = default; // (2) + +template + constexpr mapping(const extents_type&, span) noexcept; // (3) + +template + constexpr mapping(const extents_type&, const array&) noexcept; // (4) + +template + constexpr explicit(see below) mapping(const StridedLayoutMapping&) noexcept; // (5) +``` +* span[link /reference/span/span.md] +* array[link /reference/array/array.md] +* rank_[italic] +* see below[italic] + +## 概要 +- (1) : デフォルトコンストラクタ +- (2) : コピーコンストラクタ +- (3), (4) : [`extents`](../../extents.md)とストライド幅からの構築(定数`rank_`は次元数) +- (5) : [レイアウトマッピング](../../LayoutMapping.md)からの変換コンストラクタ + + +## テンプレートパラメータ制約 +- (3), (4) : + - [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true`、かつ + - [`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)``が`true`であること。 +- (5) : + - [`layout-mapping-alike`](layout-mapping-alike.md)``を満たす + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true` + - `StridedLayoutMapping::is_always_unique() == true` + - `StridedLayoutMapping::is_always_strided() == true` + + +## 事前条件 +- (1) : [`layout_right::mapping()`](../../layout_right/mapping.md)`.`[`required_span_size()`](../../layout_right/mapping/required_span_size.md)を、`index_type`型で表現できること。 +- (3), (4) : + - 半開区間`[0, rank_)`の全ての`i`に対して、`s[i]`を`index_type`へ変換した結果が`0`より大きいこと。 + - [`REQUIRED-SPAN-SIZE`](required_span_size.md)`(e, s)`を`index_type`型で表現できること。 + - `rank_`が`0`より大きいとき、半開区間`[1, rank_)`の全ての`i`に対して`j = i-1`として`s[Pi] >= s[Pj] * e.extents(Pj)`を満たすの整数値の組合せ`P`が存在すること。 +- (5) : + - `StridedLayoutMapping`が[レイアウトマッピングポリシー](../../LayoutMappingPolicy.md)を満たす + - `extents()`の全ての次元`r`に対して`other.stride(r) > 0` + - `other.required_span_size()`を`index_type`型で表現できること + - [`OFFSET`](op_equal.md)`(other) == 0` + + +## 効果 +- (1) : `extents_type()`で`extents_`を直接非リスト初期化し、全ての次元`d`に対して[`layout_right::mapping()`](../../layout_right/mapping.md)`.`[`stride(d)`](../../layout_right/mapping/stride.md)で`strides_[d]`を直接非リスト初期化する。 +- (3), (4) : `e`で`extents_`を直接非リスト初期化し、全ての次元`d`に対して[`as_const`](/reference/utility/as_const.md)`(s[d])`で`strides_[d]`を直接非リスト初期化する。 +- (5) : `other.extents()`で`extents_`を直接非リスト初期化し、全ての次元`d`に対して`other.stride(d)`で`strides_[d]`を直接非リスト初期化する。 + + +## 例外 +投げない + + +## explicitになる条件 +説明専用の変数テンプレート`is-mapping-of`を下記の通り定義する: + +```cpp +template +constexpr bool is-mapping-of = // exposition only + is_same_v, Mapping>; +``` +* is-mapping-of[italic] +* is_same_v[link /reference/type_traits/is_same.md] + +- (5) : `explicit`指定子の式は以下と等価 +```cpp +!(is_convertible_v && + (is-mapping-of || + is-mapping-of || + is-mapping-of)) +``` +* is_convertible_v[link /reference/type_traits/is_convertible.md] +* is-mapping-of[italic] +* layout_left[link ../../layout_left.md] +* layout_right[link ../../layout_right.md] +* layout_stride[link ../../layout_stride.md] + + +## 例 +```cpp example +#include +#include +#include +#include + +using Ext3x4 = std::extents; + +int main() +{ + // (1) : デフォルトコンストラクタ + { + std::layout_stride::mapping map1; + std::layout_right::mapping map1R; + assert(map1 == map1R); + } + // (2) : コピーコンストラクタ + { + std::layout_stride::mapping map2_a; + std::layout_stride::mapping map2_b = map2_a; + assert(map2_a == map2_b); + } + // (3) : extentsとストライド幅(span)による構築 + { + int strides[] = {4, 1}; + std::layout_stride::mapping map3{Ext3x4{}, std::span(strides)}; + assert(map3.stride(0) == 4); + assert(map3.stride(1) == 1); + } + // (4) : extentsとストライド幅(array)による構築 + { + std::array strides{4, 1}; + std::layout_stride::mapping map4{Ext3x4{}, strides}; + assert(map4.stride(0) == 4); + assert(map4.stride(1) == 1); + } + // (5) : レイアウトマッピングからの変換コンストラクタ + { + std::layout_left::mapping map5L; + std::layout_stride::mapping map5 = map5L; + assert(map5 == map5L); + } +} +``` +* std::layout_stride::mapping[color ff0000] +* std::extents[link ../../extents.md] +* std::layout_right::mapping[link ../../layout_right/mapping.md] +* std::layout_left::mapping[link ../../layout_left/mapping.md] +* stride[link stride.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`layout_left::mapping`](../../layout_left/mapping.md) +- [`layout_stride::mapping`](../../layout_stride/mapping.md) + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) +- [P2763R1 `layout_stride` static extents default constructor fix](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2763r1.html) diff --git a/reference/mdspan/layout_stride/mapping/op_equal.md b/reference/mdspan/layout_stride/mapping/op_equal.md new file mode 100644 index 0000000000..2bb0b090cb --- /dev/null +++ b/reference/mdspan/layout_stride/mapping/op_equal.md @@ -0,0 +1,92 @@ +# operator== +* mdspan[meta header] +* function template[meta id-type] +* std[meta namespace] +* layout_stride::mapping[meta class] +* cpp23[meta cpp] + +```cpp +template +friend constexpr bool operator==(const mapping& x, const OtherMapping& y) noexcept; + +//operator==により、以下のオーバーロードが使用可能になる +template +friend constexpr bool operator!=(const mapping& x, const OtherMapping& y) noexcept; +``` + +## 概要 +`mapping`の等値比較を行う。 + + +## テンプレートパラメータ制約 +- [`layout-mapping-alike`](layout-mapping-alike.md)``を満たすこと。 +- `extents_type::rank() == OtherMapping::extents_type::rank()` +- `OtherMapping::is_always_strided() == true` + + +## 事前条件 +`OtherMapping`は[レイアウトマッピング要件](../../LayoutMapping.md)を満たすこと。 + + +## 戻り値 +説明専用の関数`OFFSET(m)`を下記の通り定義する: + +- 多次元インデクスが0次元のとき[`m()`](op_call.md) +- そうでなければ、多次元インデクス空間のサイズが0のとき値`0` +- そうでなければ、多次元インデクス値の全要素が0である整数パック`z`を用いて[`m(z...)`](op_call.md) + +下記条件を全て満たすとき、`true`を返す。そうでなければ、`false`を返す。 + +- `x.extents() == y.extents()` +- `OFFSET(y) == 0` +- 全ての次元`r`において[`x.stride(r)`](stride.md) `== y.stride(y)` + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + using Ext4x3x2 = std::extents; + + std::layout_stride::mapping map1{{}, std::array{1, 4, 12}}; + std::layout_left::mapping mapL; + assert(map1 == mapL); + + std::layout_stride::mapping map2{{}, std::array{6, 2, 1}}; + std::layout_right::mapping mapR; + assert(map2 == mapR); +} +``` +* ==[color ff0000] +* std::extents[link ../../extents.md] +* std::layout_stride::mapping[link ../mapping.md] +* std::layout_left::mapping[link ../../layout_left/mapping.md] +* std::layout_right::mapping[link ../../layout_right/mapping.md] + + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/layout_stride/mapping/required_span_size.md b/reference/mdspan/layout_stride/mapping/required_span_size.md new file mode 100644 index 0000000000..160e925c31 --- /dev/null +++ b/reference/mdspan/layout_stride/mapping/required_span_size.md @@ -0,0 +1,78 @@ +# required_span_size +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* layout_stride::mapping[meta class] +* cpp23[meta cpp] + +```cpp +constexpr index_type required_span_size() const noexcept; +``` + +## 概要 +メモリブロックに対する要素アクセス範囲を取得する。 + +説明用の関数`REQUIRED-SPAN-SIZE(e, strides)`を次のように定義する + +- `e.`[`rank()`](../../extents/rank.md) `== 0`のとき値`1` +- そうでなければ、多次元インデクス空間`e`のサイズが0のとき値`0` +- そうでなければ、半開区間`[0, e.rank())`の全ての`r`に対して`(e.`[`extent`](../../extents/extent.md)`(r) - 1)`と[`extents_type::index-cast`](../../extents/index-cast.md)`(strides_[r])`を乗じた値の総和に`1`を加算した値 + + +## 戻り値 +説明専用のメンバ変数`extents_`, `strides_`に対して、`REQUIRED-SPAN-SIZE(extents_, strides_)`を返す。 + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + using Ext2x3 = std::extents; + using Mapping = std::layout_stride::mapping; + + Mapping map1{{}, std::array{4, 1}}; + assert(map1.required_span_size() == 7); + // map1(i,j): + // i/j -> + // | 1 2 3 (4) + // V 5 6 7 - + + Mapping map2{{}, std::array{2, 3}}; + assert(map2.required_span_size() == 9); + // map2(i,j): + // i/j -> + // | 1 4 7 + // V (2) (5) (8) + // 3 6 9 +} +``` +* required_span_size()[color ff0000] +* std::extents[link ../../extents.md] +* std::layout_stride::mapping[link ../mapping.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/layout_stride/mapping/stride.md b/reference/mdspan/layout_stride/mapping/stride.md new file mode 100644 index 0000000000..1ef0867f24 --- /dev/null +++ b/reference/mdspan/layout_stride/mapping/stride.md @@ -0,0 +1,62 @@ +# stride +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* layout_stride::mapping[meta class] +* cpp23[meta cpp] + +```cpp +constexpr index_type stride(rank_type i) const noexcept; +``` + +## 概要 +`i`番目次元のストライド幅を取得する。 + + +## 戻り値 +説明専用のメンバ変数`strides_`を用いて、`strides_[i]`を返す。 + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + using Ext3D = std::dextents; + using Mapping = std::layout_stride::mapping; + std::array strides{6, 1, 3}; + Mapping map{Ext3D{4, 3, 2}, strides}; + assert(map.stride(0) == 6); + assert(map.stride(1) == 1); + assert(map.stride(2) == 3); +} +``` +* stride[color ff0000] +* std::dextents[link ../../extents.md] +* std::layout_stride::mapping[link ../mapping.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) From b705d4a5c6508097f2adeadf5843973830e50d68 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 19 Jan 2024 00:38:06 +0900 Subject: [PATCH 0649/3948] =?UTF-8?q?mdspan:=20=E3=82=B3=E3=83=BC=E3=83=89?= =?UTF-8?q?=E4=BF=AE=E9=A3=BE=E8=AA=BF=E6=95=B4(#1077)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 3 +++ reference/mdspan/LayoutMapping.md | 6 +++--- reference/mdspan/extents/extent.md | 1 - reference/mdspan/extents/op_constructor.md | 1 - reference/mdspan/extents/op_deduction_guide.md | 2 -- reference/mdspan/extents/op_equal.md | 1 - reference/mdspan/extents/rank.md | 1 - reference/mdspan/extents/rank_dynamic.md | 2 -- reference/mdspan/extents/static_extent.md | 2 -- reference/mdspan/layout_left.md | 3 +-- reference/mdspan/layout_left/mapping.md | 2 -- reference/mdspan/layout_left/mapping/op_call.md | 1 - reference/mdspan/layout_left/mapping/op_constructor.md | 5 ----- reference/mdspan/layout_left/mapping/op_equal.md | 1 - reference/mdspan/layout_left/mapping/required_span_size.md | 2 -- reference/mdspan/layout_left/mapping/stride.md | 2 -- reference/mdspan/layout_right.md | 3 +-- reference/mdspan/layout_right/mapping.md | 2 -- reference/mdspan/layout_right/mapping/op_call.md | 7 +------ reference/mdspan/layout_right/mapping/op_constructor.md | 2 -- reference/mdspan/layout_right/mapping/op_equal.md | 2 -- .../mdspan/layout_right/mapping/required_span_size.md | 2 -- reference/mdspan/layout_right/mapping/stride.md | 2 -- reference/mdspan/layout_stride.md | 4 ++-- reference/mdspan/layout_stride/mapping.md | 4 +--- reference/mdspan/layout_stride/mapping/is_exhaustive.md | 2 +- reference/mdspan/layout_stride/mapping/op_call.md | 2 +- reference/mdspan/layout_stride/mapping/op_constructor.md | 1 - reference/mdspan/layout_stride/mapping/op_equal.md | 1 - .../mdspan/layout_stride/mapping/required_span_size.md | 1 - reference/mdspan/layout_stride/mapping/stride.md | 1 - reference/mdspan/mdspan.md | 2 -- reference/mdspan/mdspan/accessor.md | 4 +--- reference/mdspan/mdspan/data_handle.md | 2 -- reference/mdspan/mdspan/extent.md | 2 -- reference/mdspan/mdspan/extents.md | 2 -- reference/mdspan/mdspan/mapping.md | 2 -- reference/mdspan/mdspan/rank.md | 2 -- reference/mdspan/mdspan/rank_dynamic.md | 2 -- reference/mdspan/mdspan/static_extent.md | 2 -- 40 files changed, 15 insertions(+), 76 deletions(-) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 33bf2e3f27..616220f647 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -132,6 +132,9 @@ * [link /reference/map.md] * std::map[link /reference/map/map.md] * [link /reference/mdspan.md] + * std::extents[link /reference/mdspan/extents.md] + * std::dextents[link /reference/mdspan/extents.md] + * std::mdspan[link /reference/mdspan/mdspan.md] * [link /reference/memory.md] * std::allocator[link /reference/memory/allocator.md] * std::shared_ptr[link /reference/memory/shared_ptr.md] diff --git a/reference/mdspan/LayoutMapping.md b/reference/mdspan/LayoutMapping.md index 0516a75fcb..59560df80b 100644 --- a/reference/mdspan/LayoutMapping.md +++ b/reference/mdspan/LayoutMapping.md @@ -90,9 +90,9 @@ LayoutMappingを満たす型`M`は ## `LayoutMapping`に該当する型 -- `layout_left::mapping` -- `layout_right::mapping` -- `layout_stride::mapping` +- [`layout_left::mapping`](layout_left/mapping.md) +- [`layout_right::mapping`](layout_right/mapping.md) +- [`layout_stride::mapping`](layout_stride/mapping.md) ## バージョン diff --git a/reference/mdspan/extents/extent.md b/reference/mdspan/extents/extent.md index d27bd55964..f761763071 100644 --- a/reference/mdspan/extents/extent.md +++ b/reference/mdspan/extents/extent.md @@ -49,7 +49,6 @@ int main() ``` * extent[color ff0000] * static_extent[link static_extent.md] -* std::extents[link ../extents.md] ### 出力 diff --git a/reference/mdspan/extents/op_constructor.md b/reference/mdspan/extents/op_constructor.md index 8da24f6ae7..30530b9e7e 100644 --- a/reference/mdspan/extents/op_constructor.md +++ b/reference/mdspan/extents/op_constructor.md @@ -128,7 +128,6 @@ int main() } } ``` -* std::extents[link ../extents.md] * std::span[link /reference/span/span.md] ### 出力 diff --git a/reference/mdspan/extents/op_deduction_guide.md b/reference/mdspan/extents/op_deduction_guide.md index 29d65744bf..e18cb81f3d 100644 --- a/reference/mdspan/extents/op_deduction_guide.md +++ b/reference/mdspan/extents/op_deduction_guide.md @@ -32,8 +32,6 @@ int main() static_assert(std::same_as>); } ``` -* std::extents[link ../extents.md] -* std::dextents[link ../extents.md] ### 出力 ``` diff --git a/reference/mdspan/extents/op_equal.md b/reference/mdspan/extents/op_equal.md index 834c44bcf9..0f4b7bb144 100644 --- a/reference/mdspan/extents/op_equal.md +++ b/reference/mdspan/extents/op_equal.md @@ -47,7 +47,6 @@ int main() } ``` * ==[color ff0000] -* std::extents[link ../extents.md] ### 出力 diff --git a/reference/mdspan/extents/rank.md b/reference/mdspan/extents/rank.md index fc1e9e5ade..0f1ea9ae95 100644 --- a/reference/mdspan/extents/rank.md +++ b/reference/mdspan/extents/rank.md @@ -38,7 +38,6 @@ int main() ``` * rank()[color ff0000] * rank_dynamic()[link rank_dynamic.md] -* std::extents[link ../extents.md] ### 出力 diff --git a/reference/mdspan/extents/rank_dynamic.md b/reference/mdspan/extents/rank_dynamic.md index a5b2fdcdaa..552529dde2 100644 --- a/reference/mdspan/extents/rank_dynamic.md +++ b/reference/mdspan/extents/rank_dynamic.md @@ -38,8 +38,6 @@ int main() ``` * rank_dynamic()[color ff0000] * rank()[link rank.md] -* std::extents[link ../extents.md] - ### 出力 ``` diff --git a/reference/mdspan/extents/static_extent.md b/reference/mdspan/extents/static_extent.md index d8cbe1b137..d78fe14f17 100644 --- a/reference/mdspan/extents/static_extent.md +++ b/reference/mdspan/extents/static_extent.md @@ -49,8 +49,6 @@ int main() ``` * static_extent[color ff0000] * extent[link extent.md] -* std::extents[link ../extents.md] - ### 出力 ``` diff --git a/reference/mdspan/layout_left.md b/reference/mdspan/layout_left.md index 0d02cd54de..b25b5a862b 100644 --- a/reference/mdspan/layout_left.md +++ b/reference/mdspan/layout_left.md @@ -52,8 +52,7 @@ int main() } ``` * std::layout_left[color ff0000] -* std::mdspan[link mdspan.md] -* std::extents[link extents.md] +* extent[link mdspan/extent.md] ### 出力 ``` diff --git a/reference/mdspan/layout_left/mapping.md b/reference/mdspan/layout_left/mapping.md index b6d4264bbc..82c48be206 100644 --- a/reference/mdspan/layout_left/mapping.md +++ b/reference/mdspan/layout_left/mapping.md @@ -103,8 +103,6 @@ int main() } ``` * std::layout_left::mapping[color ff0000] -* std::mdspan[link ../mdspan.md] -* std::extents[link ../extents.md] ### 出力 ``` diff --git a/reference/mdspan/layout_left/mapping/op_call.md b/reference/mdspan/layout_left/mapping/op_call.md index 7be1859987..c8b9fc8abc 100644 --- a/reference/mdspan/layout_left/mapping/op_call.md +++ b/reference/mdspan/layout_left/mapping/op_call.md @@ -53,7 +53,6 @@ int main() assert(map(2,3) == 11); } ``` -* std::extents[link ../../extents.md] * std::layout_left::mapping[link ../mapping.md] ### 出力 diff --git a/reference/mdspan/layout_left/mapping/op_constructor.md b/reference/mdspan/layout_left/mapping/op_constructor.md index 4c4b118cf0..0f73155704 100644 --- a/reference/mdspan/layout_left/mapping/op_constructor.md +++ b/reference/mdspan/layout_left/mapping/op_constructor.md @@ -78,9 +78,6 @@ constexpr explicit(extents_type::rank() > 0) using Ext3x4 = std::extents; using Ext3xN = std::extents; -using Mapping3x4 = ; -using Mapping3xN = ; - int main() { // (1) : デフォルトコンストラクタ @@ -123,8 +120,6 @@ int main() } ``` * std::layout_left::mapping[color ff0000] -* std::extents[link ../../extents.md] -* std::dextents[link ../../extents.md] * std::layout_right::mapping[link ../../layout_right/mapping.md] * std::layout_stride::mapping[link ../../layout_stride/mapping.md] * required_span_size()[link required_span_size.md] diff --git a/reference/mdspan/layout_left/mapping/op_equal.md b/reference/mdspan/layout_left/mapping/op_equal.md index 2ac7079adb..104465ad80 100644 --- a/reference/mdspan/layout_left/mapping/op_equal.md +++ b/reference/mdspan/layout_left/mapping/op_equal.md @@ -51,7 +51,6 @@ int main() } ``` * ==[color ff0000] -* std::extents[link ../../extents.md] * std::layout_left::mapping[link ../mapping.md] diff --git a/reference/mdspan/layout_left/mapping/required_span_size.md b/reference/mdspan/layout_left/mapping/required_span_size.md index 4fdcb6eeb0..e71b488e8e 100644 --- a/reference/mdspan/layout_left/mapping/required_span_size.md +++ b/reference/mdspan/layout_left/mapping/required_span_size.md @@ -41,8 +41,6 @@ int main() } ``` * required_span_size()[color ff0000] -* std::extents[link ../../extents.md] -* std::dextents[link ../../extents.md] * std::layout_left::mapping[link ../mapping.md] ### 出力 diff --git a/reference/mdspan/layout_left/mapping/stride.md b/reference/mdspan/layout_left/mapping/stride.md index 0e0180b8b3..9e9dad454e 100644 --- a/reference/mdspan/layout_left/mapping/stride.md +++ b/reference/mdspan/layout_left/mapping/stride.md @@ -54,8 +54,6 @@ int main() } ``` * stride[color ff0000] -* std::extents[link ../../extents.md] -* std::dextents[link ../../extents.md] * std::layout_left::mapping[link ../mapping.md] ### 出力 diff --git a/reference/mdspan/layout_right.md b/reference/mdspan/layout_right.md index cd9e6e9a4c..58c94e2577 100644 --- a/reference/mdspan/layout_right.md +++ b/reference/mdspan/layout_right.md @@ -52,8 +52,7 @@ int main() } ``` * std::layout_right[color ff0000] -* std::mdspan[link mdspan.md] -* std::extents[link extents.md] +* extent[link mdspan/extent.md] ### 出力 ``` diff --git a/reference/mdspan/layout_right/mapping.md b/reference/mdspan/layout_right/mapping.md index 149e982228..891bd98a87 100644 --- a/reference/mdspan/layout_right/mapping.md +++ b/reference/mdspan/layout_right/mapping.md @@ -103,8 +103,6 @@ int main() } ``` * std::layout_right::mapping[color ff0000] -* std::mdspan[link ../mdspan.md] -* std::extents[link ../extents.md] ### 出力 ``` diff --git a/reference/mdspan/layout_right/mapping/op_call.md b/reference/mdspan/layout_right/mapping/op_call.md index 42420efa52..b36c9c642f 100644 --- a/reference/mdspan/layout_right/mapping/op_call.md +++ b/reference/mdspan/layout_right/mapping/op_call.md @@ -45,10 +45,6 @@ return ((static_cast(Indices...) * stride(P)) + ... + 0); int main() { using Ext3x4 = std::extents; - using Mapping = std::layout_stride::mapping; - std::array strides{4, 1}; - std::mdspan mat{arr, Mapping{{}, strides}}; - using Mapping3x4 = std::layout_right::mapping; Mapping3x4 map; assert(map(0,0) == 0); @@ -57,8 +53,7 @@ int main() assert(map(2,3) == 11); } ``` -* std::extents[link ../../extents.md] -* std::layout_stride::mapping[link ../mapping.md] +* std::layout_right::mapping[link ../mapping.md] ### 出力 ``` diff --git a/reference/mdspan/layout_right/mapping/op_constructor.md b/reference/mdspan/layout_right/mapping/op_constructor.md index 72e60c94e3..b9bf1f36e5 100644 --- a/reference/mdspan/layout_right/mapping/op_constructor.md +++ b/reference/mdspan/layout_right/mapping/op_constructor.md @@ -120,8 +120,6 @@ int main() } ``` * std::layout_right::mapping[color ff0000] -* std::extents[link ../../extents.md] -* std::dextents[link ../../extents.md] * std::layout_left::mapping[link ../../layout_left/mapping.md] * std::layout_stride::mapping[link ../../layout_stride/mapping.md] * required_span_size()[link required_span_size.md] diff --git a/reference/mdspan/layout_right/mapping/op_equal.md b/reference/mdspan/layout_right/mapping/op_equal.md index 7ef7666552..a4dc70a82d 100644 --- a/reference/mdspan/layout_right/mapping/op_equal.md +++ b/reference/mdspan/layout_right/mapping/op_equal.md @@ -51,10 +51,8 @@ int main() } ``` * ==[color ff0000] -* std::extents[link ../../extents.md] * std::layout_right::mapping[link ../mapping.md] - ### 出力 ``` ``` diff --git a/reference/mdspan/layout_right/mapping/required_span_size.md b/reference/mdspan/layout_right/mapping/required_span_size.md index b6d2e28f0e..b340dcf645 100644 --- a/reference/mdspan/layout_right/mapping/required_span_size.md +++ b/reference/mdspan/layout_right/mapping/required_span_size.md @@ -41,8 +41,6 @@ int main() } ``` * required_span_size()[color ff0000] -* std::extents[link ../../extents.md] -* std::dextents[link ../../extents.md] * std::layout_right::mapping[link ../mapping.md] ### 出力 diff --git a/reference/mdspan/layout_right/mapping/stride.md b/reference/mdspan/layout_right/mapping/stride.md index e4ab0bac33..dddd2eeeda 100644 --- a/reference/mdspan/layout_right/mapping/stride.md +++ b/reference/mdspan/layout_right/mapping/stride.md @@ -54,8 +54,6 @@ int main() } ``` * stride[color ff0000] -* std::extents[link ../../extents.md] -* std::dextents[link ../../extents.md] * std::layout_right::mapping[link ../mapping.md] ### 出力 diff --git a/reference/mdspan/layout_stride.md b/reference/mdspan/layout_stride.md index 69f790cc4a..9a6939f298 100644 --- a/reference/mdspan/layout_stride.md +++ b/reference/mdspan/layout_stride.md @@ -53,8 +53,8 @@ int main() } ``` * std::layout_stride[color ff0000] -* std::mdspan[link mdspan.md] -* std::extents[link extents.md] +* std::layout_stride::mapping[link layout_stride/mapping.md] +* extent[link mdspan/extent.md] ### 出力 ``` diff --git a/reference/mdspan/layout_stride/mapping.md b/reference/mdspan/layout_stride/mapping.md index 81d79bf939..ee1d463728 100644 --- a/reference/mdspan/layout_stride/mapping.md +++ b/reference/mdspan/layout_stride/mapping.md @@ -23,7 +23,7 @@ namespace std { `layout_stride::mapping`クラステンプレートは、下記の説明専用メンバ変数を保持する。 - `extents_` : `extents_type`型の[多次元配列サイズ情報](../extents.md) -- `strides_` : `array`型のストライド幅配列 +- `strides_` : [`array`](/reference/array/array.md)``型のストライド幅配列 ## 適格要件 @@ -107,8 +107,6 @@ int main() } ``` * std::layout_stride::mapping[color ff0000] -* std::mdspan[link ../mdspan.md] -* std::extents[link ../extents.md] ### 出力 ``` diff --git a/reference/mdspan/layout_stride/mapping/is_exhaustive.md b/reference/mdspan/layout_stride/mapping/is_exhaustive.md index 22ac4e84e3..c63ac2c884 100644 --- a/reference/mdspan/layout_stride/mapping/is_exhaustive.md +++ b/reference/mdspan/layout_stride/mapping/is_exhaustive.md @@ -28,6 +28,7 @@ constexpr bool is_exhaustive() const noexcept; ## 例 ```cpp example #include +#include #include int main() @@ -43,7 +44,6 @@ int main() } ``` * is_exhaustive()[color ff0000] -* std::extents[link ../../extents.md] * std::layout_stride::mapping[link ../mapping.md] ### 出力 diff --git a/reference/mdspan/layout_stride/mapping/op_call.md b/reference/mdspan/layout_stride/mapping/op_call.md index e8ee2367ea..cdcf2e782b 100644 --- a/reference/mdspan/layout_stride/mapping/op_call.md +++ b/reference/mdspan/layout_stride/mapping/op_call.md @@ -40,6 +40,7 @@ return ((static_cast(Indices...) * stride(P)) + ... + 0); ## 例 ```cpp example #include +#include #include int main() @@ -62,7 +63,6 @@ int main() assert(map(3,2,1) == 23); } ``` -* std::dextents[link ../../extents.md] * std::layout_stride::mapping[link ../mapping.md] ### 出力 diff --git a/reference/mdspan/layout_stride/mapping/op_constructor.md b/reference/mdspan/layout_stride/mapping/op_constructor.md index 3de01f41ae..cc213da700 100644 --- a/reference/mdspan/layout_stride/mapping/op_constructor.md +++ b/reference/mdspan/layout_stride/mapping/op_constructor.md @@ -136,7 +136,6 @@ int main() } ``` * std::layout_stride::mapping[color ff0000] -* std::extents[link ../../extents.md] * std::layout_right::mapping[link ../../layout_right/mapping.md] * std::layout_left::mapping[link ../../layout_left/mapping.md] * stride[link stride.md] diff --git a/reference/mdspan/layout_stride/mapping/op_equal.md b/reference/mdspan/layout_stride/mapping/op_equal.md index 2bb0b090cb..3bf85cb77c 100644 --- a/reference/mdspan/layout_stride/mapping/op_equal.md +++ b/reference/mdspan/layout_stride/mapping/op_equal.md @@ -66,7 +66,6 @@ int main() } ``` * ==[color ff0000] -* std::extents[link ../../extents.md] * std::layout_stride::mapping[link ../mapping.md] * std::layout_left::mapping[link ../../layout_left/mapping.md] * std::layout_right::mapping[link ../../layout_right/mapping.md] diff --git a/reference/mdspan/layout_stride/mapping/required_span_size.md b/reference/mdspan/layout_stride/mapping/required_span_size.md index 160e925c31..6cd182df85 100644 --- a/reference/mdspan/layout_stride/mapping/required_span_size.md +++ b/reference/mdspan/layout_stride/mapping/required_span_size.md @@ -55,7 +55,6 @@ int main() } ``` * required_span_size()[color ff0000] -* std::extents[link ../../extents.md] * std::layout_stride::mapping[link ../mapping.md] ### 出力 diff --git a/reference/mdspan/layout_stride/mapping/stride.md b/reference/mdspan/layout_stride/mapping/stride.md index 1ef0867f24..3c5bf9379d 100644 --- a/reference/mdspan/layout_stride/mapping/stride.md +++ b/reference/mdspan/layout_stride/mapping/stride.md @@ -39,7 +39,6 @@ int main() } ``` * stride[color ff0000] -* std::dextents[link ../../extents.md] * std::layout_stride::mapping[link ../mapping.md] ### 出力 diff --git a/reference/mdspan/mdspan.md b/reference/mdspan/mdspan.md index 3ab404ac7d..3bb309749a 100644 --- a/reference/mdspan/mdspan.md +++ b/reference/mdspan/mdspan.md @@ -139,8 +139,6 @@ int main() } } ``` -* std::mdspan[color ff0000] -* std::extents[link extents.md] * extent[link mdspan/extent.md] ### 出力 diff --git a/reference/mdspan/mdspan/accessor.md b/reference/mdspan/mdspan/accessor.md index 3b248dc46e..31f8e87667 100644 --- a/reference/mdspan/mdspan/accessor.md +++ b/reference/mdspan/mdspan/accessor.md @@ -37,9 +37,7 @@ int main() } ``` * accessor()[color ff0000] -* std::mdspan[link ../mdspan.md] -* std::extents[link ../extents.md] -* acc.access[link ../default_accessor/access.md] +* access[link ../default_accessor/access.md] ### 出力 ``` diff --git a/reference/mdspan/mdspan/data_handle.md b/reference/mdspan/mdspan/data_handle.md index b19a2d1bb5..f5fc8ea68f 100644 --- a/reference/mdspan/mdspan/data_handle.md +++ b/reference/mdspan/mdspan/data_handle.md @@ -36,8 +36,6 @@ int main() } ``` * data_handle()[color ff0000] -* std::mdspan[link ../mdspan.md] -* std::extents[link ../extents.md] ### 出力 ``` diff --git a/reference/mdspan/mdspan/extent.md b/reference/mdspan/mdspan/extent.md index fe4f0290f4..bf3377ec9a 100644 --- a/reference/mdspan/mdspan/extent.md +++ b/reference/mdspan/mdspan/extent.md @@ -37,8 +37,6 @@ int main() } ``` * extent[color ff0000] -* std::mdspan[link ../mdspan.md] -* std::dextents[link ../extents.md] * static_extent[link static_extent.md] ### 出力 diff --git a/reference/mdspan/mdspan/extents.md b/reference/mdspan/mdspan/extents.md index a940b1ae12..f6ff72a315 100644 --- a/reference/mdspan/mdspan/extents.md +++ b/reference/mdspan/mdspan/extents.md @@ -37,8 +37,6 @@ int main() } ``` * extents()[color ff0000] -* std::mdspan[link ../mdspan.md] -* std::dextents[link ../extents.md] * exts.extent[link ../extents/extent.md] ### 出力 diff --git a/reference/mdspan/mdspan/mapping.md b/reference/mdspan/mdspan/mapping.md index b8644d1dea..6e120f0c20 100644 --- a/reference/mdspan/mdspan/mapping.md +++ b/reference/mdspan/mdspan/mapping.md @@ -37,8 +37,6 @@ int main() } ``` * mapping()[color ff0000] -* std::mdspan[link ../mdspan.md] -* std::extents[link ../extents.md] ### 出力 ``` diff --git a/reference/mdspan/mdspan/rank.md b/reference/mdspan/mdspan/rank.md index 7f8fdf2b5a..75c7fde5bc 100644 --- a/reference/mdspan/mdspan/rank.md +++ b/reference/mdspan/mdspan/rank.md @@ -36,8 +36,6 @@ int main() } ``` * rank()[color ff0000] -* std::mdspan[link ../mdspan.md] -* std::extents[link ../extents.md] ### 出力 ``` diff --git a/reference/mdspan/mdspan/rank_dynamic.md b/reference/mdspan/mdspan/rank_dynamic.md index ccf24283d2..652c9588c0 100644 --- a/reference/mdspan/mdspan/rank_dynamic.md +++ b/reference/mdspan/mdspan/rank_dynamic.md @@ -36,8 +36,6 @@ int main() } ``` * rank_dynamic()[color ff0000] -* std::mdspan[link ../mdspan.md] -* std::extents[link ../extents.md] ### 出力 ``` diff --git a/reference/mdspan/mdspan/static_extent.md b/reference/mdspan/mdspan/static_extent.md index 42c41bad02..402b38f086 100644 --- a/reference/mdspan/mdspan/static_extent.md +++ b/reference/mdspan/mdspan/static_extent.md @@ -37,8 +37,6 @@ int main() } ``` * static_extent[color ff0000] -* std::mdspan[link ../mdspan.md] -* std::dextents[link ../extents.md] * extent[link extent.md] ### 出力 From 4b9c2df0161814f19d3b8b37138d9bc1a733eddf Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 19 Jan 2024 15:11:26 +0900 Subject: [PATCH 0650/3948] =?UTF-8?q?C++26=20:=202023-12=20Mailing?= =?UTF-8?q?=E3=81=AE=E3=82=B3=E3=82=A2=E8=A8=80=E8=AA=9E=E5=81=B4=E3=81=AB?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C=20#1220?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 ++ lang/cpp11/variadic_templates.md | 1 + lang/cpp20/consistent_comparison.md | 2 ++ lang/cpp26.md | 8 ++++++++ 4 files changed, 13 insertions(+) diff --git a/implementation-status.md b/implementation-status.md index fe88b94acb..3c795e898c 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -304,6 +304,8 @@ | P2738R1: [定数式での`void*`からポインタ型へのキャストを許可](/lang/cpp26/constexpr_cast_from_voidptr.md.nolink) | 型消去のために`void*`からポインタ型へのキャストを許可する | | 14 | 17 | | | P2741R3: [`static_assert`の診断メッセージにユーザーが生成した文字列の指定を許可](/lang/cpp26/user-generated_static_assert_messages.md.nolink) | `constexpr`な`S.size()`と`S.data()`メンバ関数をもつオブジェクトをコンパイル時文字列として指定できるようにする | | | | | | P2558R2: [基本文字集合に@、$、\`を追加](/lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md.nolink) | C言語との互換性のためにこれらの文字を基本文字集合に追加 | | Yes | | | +| P2662R3: [パラメータパックへのインデックスアクセスを許可](/lang/cpp26/pack_indexing.md.nolink) | 可変引数テンプレートのパラメータパックに添字アクセスできるようにする | | | | | +| P2864R2: [非推奨となっていた列挙値から算術型への暗黙変換を削除](/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md.nolink) | C++20から非推奨となっていた列挙値への算術演算で算術型に暗黙変換される仕様を削除 | 14 | 18 | | | 各処理系のC++26実装状況ページ: diff --git a/lang/cpp11/variadic_templates.md b/lang/cpp11/variadic_templates.md index 27b024adfd..36185d6999 100644 --- a/lang/cpp11/variadic_templates.md +++ b/lang/cpp11/variadic_templates.md @@ -381,6 +381,7 @@ void f(const T1& t1, const T2& t2, const T3& t3); ## 関連項目 - [C++11 可変引数マクロ](variadic_macros.md) - [C++17 畳み込み式](/lang/cpp17/folding_expressions.md) +- [C++26 パラメータパックへのインデックスアクセスを許可](/lang/cpp26/pack_indexing.md.nolink) ## 参照 diff --git a/lang/cpp20/consistent_comparison.md b/lang/cpp20/consistent_comparison.md index c13451d445..dc9123b0b2 100644 --- a/lang/cpp20/consistent_comparison.md +++ b/lang/cpp20/consistent_comparison.md @@ -794,6 +794,8 @@ struct has_vector { - [`compare_three_way`](/reference/compare/compare_three_way.md) - [``](/reference/algorithm.md) - [`lexicographical_compare_three_way`](/reference/algorithm/lexicographical_compare_three_way.md) +- [C++26 非推奨となっていた列挙値から算術型への暗黙変換を削除](/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md.nolink) + ## 参照 diff --git a/lang/cpp26.md b/lang/cpp26.md index 02ea076283..64aa7221a8 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -13,6 +13,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 |----------|------| | [`std::initializer_list`の配列を静的ストレージに配置する](/lang/cpp26/static_storage_for_braced_initializers.md.nolink) | `std::vector v = {1, 2, 3};`のような初期化で初期化子リストを静的ストレージに配置することで無駄なコピーをなくす | | [宣言のみで使用しない変数の名前として`_`をサポート](/lang/cpp26/nice_placeholder_with_no_name.md.nolink) | 変数名`_`は暗黙で`[[maybe_unused]]`が指定される | +| [非推奨となっていた列挙値から算術型への暗黙変換を削除](/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md.nolink) | C++20から非推奨となっていた列挙値への算術演算で算術型に暗黙変換される仕様を削除 | ### 文字列 @@ -30,6 +31,13 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | [属性の無視性を見直し](/lang/cpp26/on_the_ignorability_of_standard_attributes.md.nolink) | 構文として適格な属性のみを無視できるようにし、そうでない属性の使用を不適格とする | +### テンプレート + +| 言語機能 | 説明 | +|----------|------| +| [パラメータパックへのインデックスアクセスを許可](/lang/cpp26/pack_indexing.md.nolink) | 可変引数テンプレートのパラメータパックに添字アクセスできるようにする | + + ### 定数式 | 言語機能 | 説明 | From 125994a11745b009afc3b19b1ee64669da73ab27 Mon Sep 17 00:00:00 2001 From: yoh Date: Sun, 21 Jan 2024 10:52:48 +0900 Subject: [PATCH 0651/3948] =?UTF-8?q?mdspan/mdspan:=20=E5=85=A8=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=90(#1077)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/mdspan/extents/op_constructor.md | 12 +- .../layout_left/mapping/op_constructor.md | 2 +- .../layout_right/mapping/op_constructor.md | 2 +- .../mapping/layout-mapping-alike.md | 8 +- .../layout_stride/mapping/op_constructor.md | 12 +- reference/mdspan/mdspan.md | 20 +- reference/mdspan/mdspan/empty.md | 65 +++++ reference/mdspan/mdspan/op_assign.md | 57 ++++ reference/mdspan/mdspan/op_at.md | 96 +++++++ reference/mdspan/mdspan/op_constructor.md | 266 ++++++++++++++++++ reference/mdspan/mdspan/op_deduction_guide.md | 181 ++++++++++++ reference/mdspan/mdspan/size.md | 65 +++++ reference/mdspan/mdspan/swap_free.md | 72 +++++ 13 files changed, 836 insertions(+), 22 deletions(-) create mode 100644 reference/mdspan/mdspan/empty.md create mode 100644 reference/mdspan/mdspan/op_assign.md create mode 100644 reference/mdspan/mdspan/op_at.md create mode 100644 reference/mdspan/mdspan/op_constructor.md create mode 100644 reference/mdspan/mdspan/op_deduction_guide.md create mode 100644 reference/mdspan/mdspan/size.md create mode 100644 reference/mdspan/mdspan/swap_free.md diff --git a/reference/mdspan/extents/op_constructor.md b/reference/mdspan/extents/op_constructor.md index 30530b9e7e..1ccea56b8e 100644 --- a/reference/mdspan/extents/op_constructor.md +++ b/reference/mdspan/extents/op_constructor.md @@ -38,15 +38,15 @@ constexpr explicit(N != rank_dynamic()) ## テンプレートパラメータ制約 - (2) : - - `sizeof...(OtherExtents) ==` [`rank()`](rank.md)が`ture`、かつ - - `((OtherExtents == dynamic_extent || Extents == dynamic_extent || OtherExtents == Extents) && ...)`が`ture`であること + - `sizeof...(OtherExtents) ==` [`rank()`](rank.md)が`true`、かつ + - `((OtherExtents == dynamic_extent || Extents == dynamic_extent || OtherExtents == Extents) && ...)`が`true`であること - (3) : `N`を`sizeof...(OtherIndexTypes)`、`exts_arr`を[`array`](/reference/array/array.md)`{static_cast(std:move(exts))...}`としたとき - - `(`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` && ...)`が`ture`、かつ - - `(`[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_convertible.md)` && ...)`が`ture`、かつ + - `(`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` && ...)`が`true`、かつ + - `(`[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_convertible.md)` && ...)`が`true`、かつ - `N ==` [`rank_dynamic()`](rank_dynamic.md) `|| N ==` [`rank()`](rank.md)が`true`であること - (4), (5) : - - `(`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` && ...)`が`ture`、かつ - - `(`[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_convertible.md)` && ...)`が`ture`、かつ + - `(`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` && ...)`が`true`、かつ + - `(`[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_convertible.md)` && ...)`が`true`、かつ - `N ==` [`rank_dynamic()`](rank_dynamic.md) `|| N ==` [`rank()`](rank.md)が`true`であること diff --git a/reference/mdspan/layout_left/mapping/op_constructor.md b/reference/mdspan/layout_left/mapping/op_constructor.md index 0f73155704..199c1994f7 100644 --- a/reference/mdspan/layout_left/mapping/op_constructor.md +++ b/reference/mdspan/layout_left/mapping/op_constructor.md @@ -1,6 +1,6 @@ # コンストラクタ * mdspan[meta header] -* function template[meta id-type] +* function[meta id-type] * std[meta namespace] * layout_left::mapping[meta class] * cpp23[meta cpp] diff --git a/reference/mdspan/layout_right/mapping/op_constructor.md b/reference/mdspan/layout_right/mapping/op_constructor.md index b9bf1f36e5..abf8a40341 100644 --- a/reference/mdspan/layout_right/mapping/op_constructor.md +++ b/reference/mdspan/layout_right/mapping/op_constructor.md @@ -1,6 +1,6 @@ # コンストラクタ * mdspan[meta header] -* function template[meta id-type] +* function[meta id-type] * std[meta namespace] * layout_right::mapping[meta class] * cpp23[meta cpp] diff --git a/reference/mdspan/layout_stride/mapping/layout-mapping-alike.md b/reference/mdspan/layout_stride/mapping/layout-mapping-alike.md index ab4ac4ca47..4a6db282ea 100644 --- a/reference/mdspan/layout_stride/mapping/layout-mapping-alike.md +++ b/reference/mdspan/layout_stride/mapping/layout-mapping-alike.md @@ -6,6 +6,11 @@ * cpp23[meta cpp] ```cpp +template + constexpr bool is-extents = false; // exposition only +template + constexpr bool is-extents> = true; // exposition only + template concept layout-mapping-alike = requires { // exposition only requires is-extents; @@ -17,9 +22,10 @@ concept layout-mapping-alike = requires { // exposition only bool_constant::value; }; ``` +* bool_constant[link /reference/type_traits/bool_constant.md] ## 概要 -`layout_stride::mapping`動作仕様のための説明専用コンセプトである。 +`layout-mapping-alike`は、`layout_stride::mapping`動作仕様定義で用いられる説明専用コンセプトである。 ## バージョン diff --git a/reference/mdspan/layout_stride/mapping/op_constructor.md b/reference/mdspan/layout_stride/mapping/op_constructor.md index cc213da700..78c153acb1 100644 --- a/reference/mdspan/layout_stride/mapping/op_constructor.md +++ b/reference/mdspan/layout_stride/mapping/op_constructor.md @@ -1,6 +1,6 @@ # コンストラクタ * mdspan[meta header] -* function template[meta id-type] +* function[meta id-type] * std[meta namespace] * layout_stride::mapping[meta class] * cpp23[meta cpp] @@ -36,16 +36,16 @@ template - [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true`、かつ - [`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)``が`true`であること。 - (5) : - - [`layout-mapping-alike`](layout-mapping-alike.md)``を満たす - - [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true` - - `StridedLayoutMapping::is_always_unique() == true` - - `StridedLayoutMapping::is_always_strided() == true` + - [`layout-mapping-alike`](layout-mapping-alike.md)``を満たす + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true` + - `StridedLayoutMapping::is_always_unique() == true` + - `StridedLayoutMapping::is_always_strided() == true` ## 事前条件 - (1) : [`layout_right::mapping()`](../../layout_right/mapping.md)`.`[`required_span_size()`](../../layout_right/mapping/required_span_size.md)を、`index_type`型で表現できること。 - (3), (4) : - - 半開区間`[0, rank_)`の全ての`i`に対して、`s[i]`を`index_type`へ変換した結果が`0`より大きいこと。 + - 半開区間`[0, rank_)`の全ての`i`に対して、`s[i]`を`index_type`へ変換した結果が`0`より大きいこと。 - [`REQUIRED-SPAN-SIZE`](required_span_size.md)`(e, s)`を`index_type`型で表現できること。 - `rank_`が`0`より大きいとき、半開区間`[1, rank_)`の全ての`i`に対して`j = i-1`として`s[Pi] >= s[Pj] * e.extents(Pj)`を満たすの整数値の組合せ`P`が存在すること。 - (5) : diff --git a/reference/mdspan/mdspan.md b/reference/mdspan/mdspan.md index 3bb309749a..69a36fbe1b 100644 --- a/reference/mdspan/mdspan.md +++ b/reference/mdspan/mdspan.md @@ -52,15 +52,15 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`(constructor)`](mdspan/op_constructor.md.nolink) | コンストラクタ | C++23 | +| [`(constructor)`](mdspan/op_constructor.md) | コンストラクタ | C++23 | | `(destructor)` | デストラクタ | C++23 | -| [`operator=`](mdspan/op_assign.md.nolink) | 代入演算子 | C++23 | +| [`operator=`](mdspan/op_assign.md) | 代入演算子 | C++23 | ### 要素へのアクセス | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`operator[]`](mdspan/op_at.md.nolink) | 多次元配列の要素アクセス | C++23 | +| [`operator[]`](mdspan/op_at.md) | 多次元配列の要素アクセス | C++23 | ### 多次元配列サイズ @@ -70,8 +70,8 @@ namespace std { | [`rank_dynamic`](mdspan/rank_dynamic.md) | 多次元配列のうち動的要素数に指定された次元数を取得する | C++23 | | [`static_extent`](mdspan/static_extent.md) | 指定次元の静的要素数を取得する | C++23 | | [`extent`](mdspan/extent.md) | 指定次元の要素数を取得する | C++23 | -| [`size`](mdspan/size.md.nolink) | 多次元インデクス空間のサイズを取得する | C++23 | -| [`empty`](mdspan/empty.md.nolink) | 多次元インデクス空間がサイズ0か否かを取得する | C++23 | +| [`size`](mdspan/size.md) | 多次元インデクス空間のサイズを取得する | C++23 | +| [`empty`](mdspan/empty.md) | 多次元インデクス空間がサイズ0か否かを取得する | C++23 | ### メンバ変数アクセサ @@ -115,7 +115,14 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`swap`](mdspan/swap_free.md.nolink) | 2つのオブジェクトを入れ替える | C++23 | +| [`swap`](mdspan/swap_free.md) | 2つのオブジェクトを入れ替える | C++23 | + + +## 推論補助 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`(deduction_guide)`](mdspan/op_deduction_guide.md) | クラステンプレートの推論補助 | C++23 | ## 例 @@ -161,7 +168,6 @@ int main() ## 関連項目 - [`extents`](extents.md) -- [`default_accessor`](default_accessor.md) ## 参照 diff --git a/reference/mdspan/mdspan/empty.md b/reference/mdspan/mdspan/empty.md new file mode 100644 index 0000000000..f2b233a76d --- /dev/null +++ b/reference/mdspan/mdspan/empty.md @@ -0,0 +1,65 @@ +# empty +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* mdspan[meta class] +* cpp23[meta cpp] + +```cpp +[[nodiscard]] constexpr bool empty() const noexcept; +``` + +## 概要 +多次元インデクス空間がサイズ0か否かを取得する。 + + +## 戻り値 +多次元インデクス空間[`extents()`](extents.md)のサイズが0ならば`true`を返す。そうでなければ`false`を返す。 + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include + +using Matrix = std::mdspan>; + +int main() +{ + double arr[] = {1, 2, 3, 4, 5, 6}; + + Matrix mat0{arr, 0, 0}; + assert(mat0.empty()); + + Matrix mat1{arr, 2, 3}; + assert(not mat1.empty()); +} +``` +* empty()[color ff0000] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`extents`](../extents.md) + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/mdspan/op_assign.md b/reference/mdspan/mdspan/op_assign.md new file mode 100644 index 0000000000..cc6946809a --- /dev/null +++ b/reference/mdspan/mdspan/op_assign.md @@ -0,0 +1,57 @@ +# operator= +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* mdspan[meta class] +* cpp23[meta cpp] + +```cpp +constexpr mdspan& operator=(const mdspan& rhs) = default; // (1) +constexpr mdspan& operator=(mdspan&& rhs) = default; // (2) +``` + +## 概要 +- (1) : コピー代入演算子 +- (2) : ムーブ代入演算子 + + +## 例 +```cpp example +#include +#include + +using Matrix = std::mdspan>; + +int main() +{ + double arr1[] = {1, 2, 3, 4, 5, 6}; + double arr2[] = {4, 3, 2, 1}; + Matrix mat1{arr1, 2, 3}; + Matrix mat2{arr2, 1, 4}; + + mat2 = mat1; + assert(mat2.data_handle() == mat1.data_handle()); + assert(mat2.mapping() == mat1.mapping()); +} +``` +* [data_handle()](data_handle.md) +* [mapping()](mapping.md) + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/mdspan/op_at.md b/reference/mdspan/mdspan/op_at.md new file mode 100644 index 0000000000..56c2e0630c --- /dev/null +++ b/reference/mdspan/mdspan/op_at.md @@ -0,0 +1,96 @@ +# operator[] +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* mdspan[meta class] +* cpp23[meta cpp] + +```cpp +template +constexpr reference operator[](OtherIndexTypes... indices) const; // (1) + +template +constexpr reference operator[](span indices) const; // (2) + +template +constexpr reference operator[](const array& indices) const; // (3) +``` +* rank()[link rank.md] +* span[link /reference/span/span.md] +* array[link /reference/array/array.md] + +## 概要 +多次元インデクスを用いて要素にアクセスする。 + + +## テンプレートパラメータ制約 +- (1) : + - `(`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` && ...)`が`true`、かつ + - `(`[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_convertible.md)` && ...)`が`true`、かつ + - `sizeof...(OtherIndexTypes) ==` [`rank()`](rank.md)が`true`であること +- (2), (3) : + - `(`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` && ...)`が`true`、かつ + - `(`[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_convertible.md)` && ...)`が`true`であること + + +## 事前条件 +(1) : パック`I`を[`extents_type::index-cast`](../extents/index-cast.md)`(`[`as_const`](/reference/utility/as_const.md)`(indices))`としたとき、`I`は`extents()`の多次元インデクスであること。 + + +## 効果 +(1) : 以下と等価 + +```cpp +return acc_.access(ptr_, map_(static_cast(std::move(indices))...)); +``` +* acc_.access[link ../AccessorPolicy.md] +* map_[link ../LayoutMapping.md] +* std::move[link /reference/utility/move.md] + +(2), (3) : 説明用のパラメータパック`P`が[`is_same_v`](/reference/type_traits/is_same.md)`<`[`make_index_sequence`](/reference/utility/make_index_sequence.md)`<`[`rank()`](rank.md)`>,` [`index_sequence`](/reference/utility/index_sequence.md)`> == true`となるとき、以下と等価 + +```cpp +return operator[](extents_type::index-cast(as_const(indices[P]))...); +``` +* extents_type::index-cast[link ../extents/index-cast.md] +* as_const[link /reference/utility/as_const.md] + + +## 例 +```cpp example +#include +#include + +int main() +{ + int arr[] = {1, 2, 3, 4, 5, 6}; + // 静的要素数 2x3 の2次元配列ビュー + std::mdspan> mat{arr}; + + assert(map[0,0] == 1); + assert(map[1,2] == 6); +} +``` + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- C++23 [添字演算子の多次元サポート](cpp23/multidimensional_subscript_operator.nd.nolink) + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/mdspan/op_constructor.md b/reference/mdspan/mdspan/op_constructor.md new file mode 100644 index 0000000000..9c7913f8d6 --- /dev/null +++ b/reference/mdspan/mdspan/op_constructor.md @@ -0,0 +1,266 @@ +# コンストラクタ +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* mdspan[meta class] +* cpp23[meta cpp] + +```cpp +constexpr mdspan(); // (1) + +constexpr mdspan(const mdspan& rhs) = default; // (2) + +constexpr mdspan(mdspan&& rhs) = default; // (3) + +template + constexpr explicit + mdspan(data_handle_type p, OtherIndexTypes... exts); // (4) + +template + constexpr explicit(N != rank_dynamic()) + mdspan(data_handle_type p, span exts); // (5) + +template + constexpr explicit(N != rank_dynamic()) + mdspan(data_handle_type p, const array& exts); // (6) + +constexpr mdspan(data_handle_type p, const extents_type& ext); // (7) + +constexpr mdspan(data_handle_type p, const mapping_type& m); // (8) + +constexpr mdspan(data_handle_type p, const mapping_type& m, const accessor_type& a); // (9) + +template + constexpr explicit(see below) + mdspan(const mdspan& other); // (10) +``` +* span[link /reference/span/span.md] +* array[link /reference/array/array.md] +* rank_dynamic[link rank_dynamic.md] +* extents_type[link ../extents.md] +* mapping_type[link ../LayoutMapping.md] +* accessor_type[link ../AccessorPolicy.md] +* OtherExtents[link ../extents.md] +* OtherLayoutPolicy[link ../LayoutMappingPolicy.md] +* OtherAccessorPolicy[link ../AccessorPolicy.md] +* see below[italic] + +## 概要 +- (1) : デフォルトコンストラクタ +- (2) : コピーコンストラクタ +- (3) : ムーブコンストラクタ +- (4), (5), (6) : メモリブロックのポインタ`p`、各次元の要素数リスト`exts`から構築 +- (7) : メモリブロックのポインタ`p`、多次元配列サイズ`ext`から構築 +- (8) : メモリブロックのポインタ`p`、レイアウトマッピング`m`から構築 +- (9) : メモリブロックのポインタ`p`、レイアウトマッピング`m`、要素アクセサ`a`から構築 +- (10) : 他`mdspan`からの変換コンストラクタ + +以降は説明専用のメンバ変数`ptr_`, `map_`, `acc_`を用いる。 + + +## テンプレートパラメータ制約 +- (1) : + - [`rank_dynamic()`](rank_dynamic.md) `> 0` + - [`is_default_constructible_v`](/reference/type_traits/is_default_constructible.md)``が`true` + - [`is_default_constructible_v`](/reference/type_traits/is_default_constructible.md)``が`true` + - [`is_default_constructible_v`](/reference/type_traits/is_default_constructible.md)``が`true` +- (4) : `N`を`sizeof...(OtherIndexTypes)`としたとき + - `(`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` && ...)`が`true` + - `(`[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_convertible.md)` && ...)`が`true` + - `N ==` [`rank()`](rank.md) `|| N ==` [`rank_dynamic()`](rank_dynamic.md)が`true` + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true` + - [`is_default_constructible_v`](/reference/type_traits/is_default_constructible.md)``が`true` +- (5), (6) : + - `(`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` && ...)`が`true` + - `(`[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_convertible.md)` && ...)`が`true` + - `N ==` [`rank()`](rank.md) `|| N ==` [`rank_dynamic()`](rank_dynamic.md)が`true` + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true` + - [`is_default_constructible_v`](/reference/type_traits/is_default_constructible.md)``が`true` +- (7) : + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true` + - [`is_default_constructible_v`](/reference/type_traits/is_default_constructible.md)``が`true` +- (8) : + - [`is_default_constructible_v`](/reference/type_traits/is_default_constructible.md)``が`true` +- (10) : + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)`&>`が`true` + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true` + + +## 適格要件 +- (10) : + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true` + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true` + + +## 事前条件 +- (1) : デフォルト構築された`map_`, `acc_`を用いたとき、半開区間`[0, map_.required_span_size())`が`ptr_`と`acc_`によってアクセス可能な範囲であること。 +- (4), (5), (6), (7) : このコンストラクタで構築された`map_`とデフォルト構築された`acc_`を用いたとき、半開区間`[0, map_.required_span_size())`が`p`と`acc_`によってアクセス可能な範囲であること。 +- (8) : デフォルト構築された`acc_`を用いたとき、半開区間`[0, m.required_span_size())`が`p`と`acc_`によってアクセス可能な範囲であること。 +- (9) : 半開区間`[0, m.required_span_size())`が`p`と`a`によってアクセス可能な範囲であること。 +- (10) : + - [`extents_type`](../extents.md)の全ての次元`r`に対して、[`static_extent`](../extents/static_extent.md)`(r) ==` [`dynamic_extent`](/reference/span/dynamic_extent.md) `||` [`static_extent`](../extents/static_extent.md)`(r) == other.extent(r)`が`true`であり、 + - このコンストラクタで構築された`ptr_`, `map_`, `acc_`を用いたとき、半開区間`[0, map_.required_span_size())`が`ptr_`と`acc_`によってアクセス可能な範囲であること。 + + +## 効果 +- (1) : `ptr_`, `map_`, `acc_`を値初期化する。 +- (4) : + - `ptr_`を[`std::move`](/reference/utility/move.md)`(p)`で直接非リスト初期化し、 + - `map_`を[`extents_type`](../extents.md)`(static_cast(`[`std::move`](/reference/utility/move.md)`(exts))...)`で直接非リスト初期化し、 + - `acc_`を値初期化する。 +- (5), (6) : + - `ptr_`を[`std::move`](/reference/utility/move.md)`(p)`で直接非リスト初期化し、 + - `map_`を[`extents_type`](../extents.md)`(exts)`で直接非リスト初期化し、 + - `acc_`を値初期化する。 +- (7) : + - `ptr_`を[`std::move`](/reference/utility/move.md)`(p)`で直接非リスト初期化し、 + - `map_`を`ext`で直接非リスト初期化し、 + - `acc_`を値初期化する。 +- (8) : + - `ptr_`を[`std::move`](/reference/utility/move.md)`(p)`で直接非リスト初期化し、 + - `map_`を`m`で直接非リスト初期化し、 + - `acc_`を値初期化する。 +- (9) : + - `ptr_`を[`std::move`](/reference/utility/move.md)`(p)`で直接非リスト初期化し、 + - `map_`を`m`で直接非リスト初期化し、 + - `acc_`を`a`で直接非リスト初期化する。 +- (10) : + - `ptr_`を`other.ptr_`で直接非リスト初期化し、 + - `map_`を`other.map_`で直接非リスト初期化し、 + - `acc_`を`other.acc_`で直接非リスト初期化する。 + + +## explicitになる条件 +- (5), (6) : `N !=` [`rank_dynamic()`](rank_dynamic.md) +- (10) : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`&, mapping_type> || !`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`` + + +## 例 +```cpp example +#include +#include +#include +#include + +using Ext3x4 = std::extents; +using Ext3xN = std::extents; +using Ext2D = std::dextents; + +int main() +{ + int arr[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}; + + // (1) : デフォルトコンストラクタ + { + std::mdspan mat1_3xN; + assert(mat1_3xN.empty()); + // 動的要素数をもつ次元がない場合は不適格 + // std::mdspan mat1_3x4; + } + // (2), (3) : コピー/ムーブコンストラクタ + { + std::mdspan src{arr, 4}; // オーバーロード(4) + std::mdspan dst = src; + assert(dst.data_handle() == src.data_handle()); + assert(dst.mapping() == src.mapping()); + } + // (4) : ポインタ+要素数リストから構築 + { + std::mdspan mat4_all{arr, 3, 4}; // 全次元を設定 + std::mdspan mat4_dyn{arr, 4}; // 動的要素数のみ設定 + assert(mat4_all.size() == mat4_dyn.size()); + std::mdspan mat4_static{arr}; // 全次元が静的要素数 + assert(mat4_static.size() == 12); + } + // (5) : ポインタ+要素数spanから構築 + { + int exts_all[] = {3, 4}; + int exts_dyn[] = {4}; + std::mdspan mat5_all{arr, std::span{exts_all}}; // 全次元を設定 + std::mdspan mat5_dyn{arr, std::span{exts_dyn}}; // 動的要素数のみ設定 + assert(mat5_all.size() == mat5_dyn.size()); + } + // (6) : ポインタ+要素数arrayから構築 + { + std::array exts_all{3, 4}; + std::array exts_dyn{4}; + std::mdspan mat6_all{arr, exts_all}; // 全次元を設定 + std::mdspan mat6_dyn{arr, exts_dyn}; // 動的要素数のみ設定 + assert(mat6_all.size() == mat6_dyn.size()); + } + // (7) : ポインタ+多次元配列サイズから構築 + { + Ext2D ext{3, 4}; + std::mdspan mat7{arr, ext}; + assert(mat7.size() == 12); + } + // (8) : ポインタ+レイアウトマッピングから構築 + { + // 要素数 3x3(ストライド幅=[4,1])の2次元ビュー + using Mapping = std::layout_stride::mapping; + Mapping map{Ext2D{3, 3}, std::array{4, 1}}; + std::mdspan mat8{arr, map}; + assert(mat8.size() == 9); + assert(mat8.mapping().required_span_size() == 11); + // 1 2 3 (4) + // 5 6 7 (8) + // 9 10 11 - + assert((mat8[1,1] == 6 && mat8[2,2] == 11)); + } + // (9) : ポインタ+レイアウトマッピング+要素アクセサから構築 + { + // 要素数 3x4, 列優先レイアウト の2次元ビュー + std::layout_left::mapping map; + std::default_accessor acc; + std::mdspan mat9{arr, map, acc}; + // Extents: extents -> dextents + // LayoutPolicy: layout_left -> layout_stride + } + // (10) : 他mdspanからの変換コンストラクタ + { + // 要素数 3x4, 行優先レイアウト の2次元ビュー + std::mdspan src{arr}; // オーバーロード(4) + std::mdspan dst = src; + // ElementType: int -> const int + // Extents: extents -> dextents + // LayoutPolicy: layout_right -> layout_stride + // AccessorPolicy: default_accessor -> default_accessor + } +} +``` +* std::mdspan[color ff0000] +* empty()[link empty.md] +* data_handle()[link data_handle.md] +* mapping()[link mapping.md] +* size()[link size.md] +* std::layout_stride::mapping[link ../layout_stride/mapping.md]] +* std::layout_stride[link ../layout_stride.md] +* std::layout_left::mapping[link ../layout_left/mapping.md] +* std::default_accessor[link ../default_accessor.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`extents`](../extents.md) +- [LayoutMapping](../LayoutMapping.md) +- [AccessorPolicy](../AccessorPolicy.md) + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/mdspan/op_deduction_guide.md b/reference/mdspan/mdspan/op_deduction_guide.md new file mode 100644 index 0000000000..9cc9bff945 --- /dev/null +++ b/reference/mdspan/mdspan/op_deduction_guide.md @@ -0,0 +1,181 @@ +# 推論補助 +* mdspan[meta header] +* std[meta namespace] +* mdspan[meta class] +* cpp23[meta cpp] + +```cpp +namespace std { + template + requires (is_array_v && rank_v == 1) + mdspan(CArray&) + -> mdspan, extents>>; // (1) + + template + requires (is_pointer_v>) + mdspan(Pointer&&) + -> mdspan>, extents>; // (2) + + template + requires ((is_convertible_v && ...) && sizeof...(Integrals) > 0) + explicit mdspan(ElementType*, Integrals...) + -> mdspan>; // (3) + + template + mdspan(ElementType*, span) + -> mdspan>; // (4) + + template + mdspan(ElementType*, const array&) + -> mdspan>; // (5) + + template + mdspan(ElementType*, const extents&) + -> mdspan>; // (6) + + template + mdspan(ElementType*, const MappingType&) + -> mdspan; // (7) + + template + mdspan(const typename AccessorType::data_handle_type&, + const MappingType&, + const AccessorType&) + -> mdspan; // (8) +} +``` +* extents[link ../extents.md] +* dextents[link ../extents.md] +* span[link /reference/span/span.md] +* array[link /reference/array/array.md] +* is_array_v[link /reference/type_traits/is_array.md] +* is_pointer_v[link /reference/type_traits/is_pointer.md] +* rank_v[link /reference/type_traits/rank.md] +* extent_v[link /reference/type_traits/extent.md] +* is_convertible_v[link /reference/type_traits/is_convertible.md] +* remove_pointer_t[link /reference/type_traits/remove_pointer.md] +* remove_reference_t[link /reference/type_traits/remove_reference.md] +* remove_all_extents_t[link /reference/type_traits/remove_all_extents.md] + +## 概要 +`std::mdspan`クラステンプレートの型推論補助。 + + +## 備考 +推論補助(2)により、コンパイル時に要素数を取得できないポインタ型引数からは0次元`mdspan`が推論される。 + + +## 例 +```cpp example +#include +#include +#include +#include + +int main() +{ + int arr[] = {1, 2, 3, 4, 5, 6}; + + { // (1) : 1次元配列型から型推論 + std::mdspan m1{arr}; + static_assert(m1.rank() == 1 && m1.rank_dynamic() == 0); + static_assert(m1.static_extent(0) == 6); + // m1 := 静的要素数 6 の1次元配列ビュー + + // 2次元配列型からは型推論できない + // int arr2d[2][3] = {{1, 2, 3}, {4, 5, 6}}; + // std::mdspan m1_ng{arr2d}; + // 下記は推論補助(2)により0次元mdspanとなる + // std::mdspan m1_d0{&arr2d[0][0]}; + } + { // (2) : ポインタ型から型推論 + int* ptr = arr; + std::mdspan m2{ptr}; + static_assert(m2.rank() == 0); + assert(m2[] == *ptr); + // m2 := 0次元配列ビュー + } + { // (3) : 要素数リストから型推論 + std::mdspan m3{arr, 2, 3}; + static_assert(m3.rank_dynamic() == 2); + assert(m3.size() == 6); + // m3 := 動的要素数 2x3 の2次元配列ビュー + } + { // (4) : 要素数spanから型推論 + int exts[] = {2, 3}; + std::mdspan m4{arr, std::span{exts}}; + static_assert(m4.rank_dynamic() == 2); + assert(m4.size() == 6); + // m4 := 動的要素数 2x3 の2次元配列ビュー + } + { // (5) : 要素数arrayから型推論 + std::array exts{2, 3}; + std::mdspan m5{arr, exts}; + static_assert(m5.rank_dynamic() == 2); + assert(m5.size() == 6); + // m5 := 動的要素数 2x3 の2次元配列ビュー + } + { // (6) : 多次元配列サイズから型推論 + std::extents ext{3}; + std::mdspan m6{arr, ext}; + static_assert(m6.rank() == 2 && m6.rank_dynamic() == 1); + assert(m6.size() == 6); + // m6 := 静的要素数2 x 動的要素数3 の2次元配列ビュー + } + { // (7) : レイアウトマッピングから型推論 + using Ext2D = std::dextents; + std::layout_stride::mapping map{Ext2D{2, 2}, std::array{3, 1}}; + std::mdspan m7{arr, map}; + static_assert(m7.rank_dynamic() == 2); + assert(m7.size() == 4); + // m7 := 動的要素数 2x2(ストライド幅=[3,1]) の2次元配列ビュー + } + { // (8) : レイアウトマッピング+要素アクセサから型推論 + using Ext2D = std::dextents; + std::layout_stride::mapping map{Ext2D{2, 2}, std::array{3, 1}}; + std::default_accessor acc; + std::mdspan m8{arr, map, acc}; + static_assert(m8.rank_dynamic() == 2); + assert(m8.size() == 4); + // m8 := 動的要素数 2x2(ストライド幅=[3,1]) の読み取り専用2次元配列ビュー + } +} +``` +* std::mdspan[color ff0000] +* rank[link rank.md] +* rank_dynamic[link rank_dynamic.md] +* extent[link extent.md] +* static_extent[link static_extent.md] +* size[link size.md] +* std::layout_stride::mapping[link ../layout_stride/mapping.md] +* std::default_accessor[link ../default_accessor.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`extents`](../extents.md) +- [LayoutMapping](../LayoutMapping.md) +- [AccessorPolicy](../AccessorPolicy.md) + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/mdspan/size.md b/reference/mdspan/mdspan/size.md new file mode 100644 index 0000000000..13def8723a --- /dev/null +++ b/reference/mdspan/mdspan/size.md @@ -0,0 +1,65 @@ +# size +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* mdspan[meta class] +* cpp23[meta cpp] + +```cpp +constexpr size_type size() const noexcept; +``` + +## 概要 +多次元インデクス空間のサイズを取得する。 + + +## 適格要件 +多次元インデクス空間[`extents()`](extents.md)のサイズが`size_type`型で表現できること。 + + +## 戻り値 +多次元配列サイズ[`extents()`]に対して、全次元の要素数を乗算した値。 + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include + +int main() +{ + int arr[] = {1, 2, 3, 4, 5, 6}; + // 静的要素数 2x3 の2次元配列ビュー + std::mdspan> mat{arr}; + + static_assert(mat.size() == 6); +} +``` +* size()[color ff0000] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`extents`](../extents.md) + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/mdspan/swap_free.md b/reference/mdspan/mdspan/swap_free.md new file mode 100644 index 0000000000..06262f4df2 --- /dev/null +++ b/reference/mdspan/mdspan/swap_free.md @@ -0,0 +1,72 @@ +# swap (非メンバ関数) +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* mdspan[meta class] +* cpp23[meta cpp] + +```cpp +friend constexpr void swap(mdspan& x, mdspan& y) noexcept; +``` + +## 概要 +2つの`mdspan`オブジェクトを入れ替える。 + + +## 効果 +説明専用のメンバ変数`ptr_`, `map_`, `acc_`に対して、以下と等価 + +```cpp +swap(x.ptr_, y.ptr_); +swap(x.map_, y.map_); +swap(x.acc_, y.acc_); +``` + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include + +using Matrix = std::mdspan>; + +int main() +{ + double arr1[] = {1, 2, 3, 4, 5, 6}; + double arr2[] = {4, 3, 2, 1}; + Matrix mat1{arr1, 2, 3}; + Matrix mat2{arr2, 1, 4}; + + swap(mat1, mat2); + assert(mat1.data_handle() == arr2); + assert(mat1.size() == 4); + assert(mat2.data_handle() == arr1); + assert(mat2.size() == 6); +} +``` +* swap[color ff0000] +* data_handle()[link data_handle.md] +* size()[link size.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) From d2963f04918f26bad00d3bec77de1a8d0ba6c6ba Mon Sep 17 00:00:00 2001 From: yoh Date: Sun, 21 Jan 2024 15:05:43 +0900 Subject: [PATCH 0652/3948] =?UTF-8?q?mdspan/mdspan:=20=E8=AA=BF=E6=95=B4(#?= =?UTF-8?q?1077)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/mdspan/mdspan.md | 15 ++++++++++++++- reference/mdspan/mdspan/empty.md | 1 + reference/mdspan/mdspan/mapping.md | 2 +- reference/mdspan/mdspan/size.md | 3 ++- reference/span/dynamic_extent.md | 13 ++++++++++--- 5 files changed, 28 insertions(+), 6 deletions(-) diff --git a/reference/mdspan/mdspan.md b/reference/mdspan/mdspan.md index 69a36fbe1b..671fa98d38 100644 --- a/reference/mdspan/mdspan.md +++ b/reference/mdspan/mdspan.md @@ -21,7 +21,10 @@ namespace std { * default_accessor[link default_accessor.md] ## 概要 -`mdspan`は、任意のメモリブロックに対して多次元配列のようにアクセスする機能を提供するクラスである。 +`mdspan`は、任意のメモリブロックに対して多次元配列のようにアクセスする機能を提供するクラスである。 +`mdspan`それ自体は参照先メモリブロックを所有せず、[`[]`演算子](mdspan/op_at.md)を介して多次元配列のように見せかけるビュー(view)にすぎない。 + +クラスの名称`mdspan`は、1次元の範囲[`std::span`](../span/span.md)に対する多次元(MultiDimentional)拡張に由来する。 `mdspan`の特殊化`MDS`は[`copyable`](/reference/concepts/copyable.md)のモデルであり、かつ @@ -31,6 +34,14 @@ namespace std { そのメンバ型`accessor_type`, `mapping_type`, `pointer`が[トリビアルコピー可能](/reference/type_traits/is_trivially_copyable.md)であるとき、`mdspan`の特殊化もトリビアルコピー可能である。 +### テンプレートパラメータ +`mdspan`クラスでは、テンプレートパラメータを介して多次元配列ビューをカスタマイズできる。 + +- `ElementType` : 多次元配列ビューの要素型 +- `Extents` : 多次元配列の次元数(rank)と要素数(extent) +- `LayoutPolicy` : 多次元配列インデクスと要素位置の対応関係 +- `AccessorPolicy` : 要素アクセス時の詳細挙動 + ### 説明専用メンバ変数 `mdspan`クラスは、下記の説明専用メンバ変数を保持する。 @@ -168,6 +179,8 @@ int main() ## 関連項目 - [`extents`](extents.md) +- [LayoutMappingPolicy](LayoutMappingPolicy.md) +- [AccessorPolicy](AccessorPolicy.md) ## 参照 diff --git a/reference/mdspan/mdspan/empty.md b/reference/mdspan/mdspan/empty.md index f2b233a76d..481d0f68c1 100644 --- a/reference/mdspan/mdspan/empty.md +++ b/reference/mdspan/mdspan/empty.md @@ -59,6 +59,7 @@ int main() ## 関連項目 - [`extents`](../extents.md) +- [`size()`](size.md) ## 参照 diff --git a/reference/mdspan/mdspan/mapping.md b/reference/mdspan/mdspan/mapping.md index 6e120f0c20..9321b130c5 100644 --- a/reference/mdspan/mdspan/mapping.md +++ b/reference/mdspan/mdspan/mapping.md @@ -10,7 +10,7 @@ constexpr const mapping_type& mapping() const noexcept; ``` ## 概要 -レイアウトマッピング`map_`を取得する。 +[レイアウトマッピング](../LayoutMapping.md)`map_`を取得する。 ## 戻り値 diff --git a/reference/mdspan/mdspan/size.md b/reference/mdspan/mdspan/size.md index 13def8723a..26eee16ca3 100644 --- a/reference/mdspan/mdspan/size.md +++ b/reference/mdspan/mdspan/size.md @@ -18,7 +18,7 @@ constexpr size_type size() const noexcept; ## 戻り値 -多次元配列サイズ[`extents()`]に対して、全次元の要素数を乗算した値。 +多次元配列サイズ[`extents()`](extents.md)に対して、全次元の要素数を乗算した値。 ## 例外 @@ -59,6 +59,7 @@ int main() ## 関連項目 - [`extents`](../extents.md) +- [`empty()`](empty.md) ## 参照 diff --git a/reference/span/dynamic_extent.md b/reference/span/dynamic_extent.md index ed6a29bb80..213d78b373 100644 --- a/reference/span/dynamic_extent.md +++ b/reference/span/dynamic_extent.md @@ -14,12 +14,13 @@ namespace std { * max()[link /reference/limits/numeric_limits/max.md] ## 概要 -`dynamic_extent`は、動的な要素数をもつことを[`std::span`](span.md)クラスに指示するための定数である。 +`dynamic_extent`は、動的な要素数をもつことを[`std::span`](span.md)や[`std::mdspan`](../mdspan/mdspan.md)に指示するための定数である。 -以下のような状況で、[`std::span`](span.md)クラスは動的な要素数をもつようになる: +### std::span +以下のような状況で、[`span`](span.md)クラスは動的な要素数をもつようになる: - デフォルトテンプレート引数を使用 (デフォルトで`dynamic_extent`が使用される) -- 動的な長さをもつ範囲を参照する ([`std::vector`](/reference/vector/vector.md)や、ポインタと要素数の組など) +- 動的な長さをもつ範囲を参照する ([`vector`](/reference/vector/vector.md)や、ポインタと要素数の組など) - 参照範囲の変更を、動的な値で指定する (`s.`[`first`](span/first.md)`()`は静的な要素数、`s.`[`first`](span/first.md)`(n)`は動的な要素数をもつ`span`オブジェクトを作成する) @@ -66,6 +67,7 @@ int main() ``` ``` + ## バージョン ### 言語 - C++20 @@ -74,3 +76,8 @@ int main() - [Clang](/implementation.md#clang): 9.0 - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- C++20 [`span`](span.md) +- C++23 [`mdspan`](../mdspan/mdspan.md) From 4936e049841a801392b687d1de84e939a9822350 Mon Sep 17 00:00:00 2001 From: yoh Date: Sun, 21 Jan 2024 19:48:54 +0900 Subject: [PATCH 0653/3948] =?UTF-8?q?GLOBAL=5FQUALIFY=5FLIST:=20std::span?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 1 + reference/concepts/constructible_from.md | 1 - reference/mdspan/extents/op_constructor.md | 1 - reference/span/span/first.md | 1 - reference/span/span/last.md | 1 - reference/span/span/op_deduction_guide.md | 1 - reference/span/span/subspan.md | 1 - 7 files changed, 1 insertion(+), 6 deletions(-) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 616220f647..87e148ec94 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -171,6 +171,7 @@ * [link /reference/shared_mutex.md] * [link /reference/source_location.md] * [link /reference/span.md] + * std::span[link /reference/span/span.md] * std::dynamic_extent[link /reference/span/dynamic_extent.md] * [link /reference/sstream.md] * [link /reference/stack.md] diff --git a/reference/concepts/constructible_from.md b/reference/concepts/constructible_from.md index 8e32da98c6..ea9434932d 100644 --- a/reference/concepts/constructible_from.md +++ b/reference/concepts/constructible_from.md @@ -54,7 +54,6 @@ int main() { } ``` * std::constructible_from[color ff0000] -* std::span[link /reference/span/span.md] ### 出力 ``` diff --git a/reference/mdspan/extents/op_constructor.md b/reference/mdspan/extents/op_constructor.md index 1ccea56b8e..41cfe61dba 100644 --- a/reference/mdspan/extents/op_constructor.md +++ b/reference/mdspan/extents/op_constructor.md @@ -128,7 +128,6 @@ int main() } } ``` -* std::span[link /reference/span/span.md] ### 出力 ``` diff --git a/reference/span/span/first.md b/reference/span/span/first.md index 26be9cee49..733e55568a 100644 --- a/reference/span/span/first.md +++ b/reference/span/span/first.md @@ -73,7 +73,6 @@ int main() } ``` * first[color ff0000] -* std::dynamic_extent[link /reference/span/dynamic_extent.md] ### 出力 ``` diff --git a/reference/span/span/last.md b/reference/span/span/last.md index 69acbf358b..cd2bcc686b 100644 --- a/reference/span/span/last.md +++ b/reference/span/span/last.md @@ -74,7 +74,6 @@ int main() } ``` * last[color ff0000] -* std::dynamic_extent[link /reference/span/dynamic_extent.md] ### 出力 ``` diff --git a/reference/span/span/op_deduction_guide.md b/reference/span/span/op_deduction_guide.md index 48def51b36..c756458d21 100644 --- a/reference/span/span/op_deduction_guide.md +++ b/reference/span/span/op_deduction_guide.md @@ -117,7 +117,6 @@ int main() } } ``` -* std::dynamic_extent[link /reference/span/dynamic_extent.md] ### 出力 ``` diff --git a/reference/span/span/subspan.md b/reference/span/span/subspan.md index 063cc688b4..e452b4c31a 100644 --- a/reference/span/span/subspan.md +++ b/reference/span/span/subspan.md @@ -92,7 +92,6 @@ int main() } ``` * subspan[color ff0000] -* std::dynamic_extent[link /reference/span/dynamic_extent.md] ### 出力 ``` From a877468c7f9afe527c92c610ea733c053c1527dd Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 22 Jan 2024 20:52:23 +0900 Subject: [PATCH 0654/3948] =?UTF-8?q?C++26=20:=202023-12=20Mailing?= =?UTF-8?q?=E3=81=AE=E3=83=A9=E3=82=A4=E3=83=96=E3=83=A9=E3=83=AA=E5=A4=89?= =?UTF-8?q?=E6=9B=B4=E3=81=AB=E5=AF=BE=E5=BF=9C=20#1220?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23.md | 5 +++-- lang/cpp26.md | 31 ++++++++++++++++++++++++++++--- reference.md | 11 ++++++++++- 3 files changed, 41 insertions(+), 6 deletions(-) diff --git a/lang/cpp23.md b/lang/cpp23.md index da951572b0..7ac0b970c9 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -228,10 +228,11 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 ### 機能の非推奨化 -- [`std::aligned_storage`](/reference/type_traits/aligned_storage.md)と[`std::aligned_union`](/reference/type_traits/aligned_union.md)を非推奨化。これらの機能は未定義動作を引き起こし、間違った保証が行われ、よくないAPI設計が行われていたため、非推奨となる +- [`std::aligned_storage`](/reference/type_traits/aligned_storage.md)と[`std::aligned_union`](/reference/type_traits/aligned_union.md)を非推奨化。これらの機能は未定義動作を引き起こし、間違った保証が行われ、よくないAPI設計が行われていたため、非推奨とする - [`std::aligned_storage`](/reference/type_traits/aligned_storage.md)の代わりに`alignas(T)` [`std::byte`](/reference/cstddef/byte.md)`[sizeof(T)];`を使用することを推奨する - [`std::aligned_union`](/reference/type_traits/aligned_union.md)の代わりに`alignas(Ts...)` [`std::byte`](/reference/cstddef/byte.md)`[`[`std::max`](/reference/algorithm/max.md)`({sizeof(Ts)...})];`を使用することを推奨する -- [``](/reference/limits.md)の以下の非正規化数に関する機能を非推奨化。これらの機能は必ずしもコンパイル時に決まらない可能性のある値であり有用でないため、非推奨となる +- [`std::allocator`](/reference/memory/allocator.md)のメンバ型`is_always_equal`を非推奨化。これはアロケータが状態をもたないことを表す型でありデフォルトでは[`true_type`](/reference/type_traits/true_type.md)となっている。状態をもつユーザー定義のアロケータ型でこのメンバ型の上書きを忘れることでバグが埋め込まれてしまっていたため誤用防止のために非推奨とする +- [``](/reference/limits.md)の以下の非正規化数に関する機能を非推奨化。これらの機能は必ずしもコンパイル時に決まらない可能性のある値であり有用でないため、非推奨とする - [`std::numeric_limits`](/reference/limits/numeric_limits.md)`::`[`has_denorm`](/reference/limits/numeric_limits/has_denorm.md) - [`std::numeric_limits`](/reference/limits/numeric_limits.md)`::`[`has_denorm_loss`](/reference/limits/numeric_limits/has_denorm_loss.md) - [`std::float_denorm_style`](/reference/limits/float_denorm_style.md) diff --git a/lang/cpp26.md b/lang/cpp26.md index 64aa7221a8..eae30a66f9 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -58,10 +58,15 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - 文字列エンコーディングを識別するライブラリとして、[``](/reference/text_encoding.md.nolink)を追加 - 並行処理におけるデータの参照・更新を行うRCU (Read Copy Update) のライブラリとして、[``](/reference/rcu.md.nolink)を追加 - 並行処理において参照中のデータが更新されないよう保護するハザードポインタのライブラリとして、[``](/reference/hazard_pointer.md.nolink)を追加 +- デバッグサポートのライブラリとして[``](/reference/debugging.md.nolink)を追加 +- 線形代数ライブラリとして[``](/reference/linalg.md.nolink)を追加 ### コンテナ - [`std::mdspan`](/reference/mdspan/mdspan.md)のサブ配列版として[`std::submdspan`](/reference/mdspan/submdspan.md.nolink)を追加 +- [`std::span`](/reference/span/span.md)に、以下を追加 + - [`std::initializer_list`](/reference/initializer_list/initializer_list.md)をとるコンストラクタ + - インデックスアクセスのための[`at()`](/reference/span/span/at.md.nolink)メンバ関数 - 連想コンテナの以下のメンバ関数に、一時オブジェクトが生成されるコストを抑える拡張を追加 - [`std::map`](/reference/map/map.md) - [`operator[]`](/reference/map/map/op_at.md) @@ -104,8 +109,10 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [``](/reference/charconv.md)の変換結果[`std::to_chars_result`](/reference/charconv/to_chars_result.md)と[`std::from_chars_result`](/reference/charconv/from_chars_result.md)に、変換が正しく完了したかを判定する`operator bool`を追加 - [`std::to_string()`](/reference/string/to_string.md)の仕様が`std::sprintf()`で説明されていたが、[`std::format()`](/reference/format/format.md)で定義するよう仕様を変更 - [`std::basic_istringstream`](/reference/sstream/basic_istringstream.md)および[`std::basic_ostringstream`](/reference/sstream/basic_ostringstream.md)のコンストラクタおよび`str()`メンバ関数に、[`std::basic_string_view`](/reference/string_view/basic_string_view.md)を受け取るオーバーロードを追加 -- [`std::format()`](/reference/format/format.md)に、ポインタ出力のサポートを追加 -- [`std::format()`](/reference/format/format.md)で幅と精度を動的に指定した場合でも型の検証がコンパイル時に行われるよう仕様を見直し +- [`std::format()`](/reference/format/format.md)に、以下の改善を導入 + - ポインタ出力のサポートを追加 + - 幅と精度を動的に指定した場合でも型の検証がコンパイル時に行われるよう仕様を見直し + - コンパイル時の書式文字列だけでなく、実行時の書式文字列を渡せるよう仕様修正 ### ファイル @@ -146,7 +153,13 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [`std::chrono::leap_second`](/reference/chrono/leap_second.md) -### 数学 +### 数値 +- [``](/reference/numeric.md)に、飽和演算 (Saturation Arithmetic) として、型の表現可能な範囲で演算を行う以下の関数を追加 + - [`std::add_sat()`](/reference/numeric/add_sat.md.nolink) + - [`std::sub_sat()`](/reference/numeric/sub_sat.md.nolink) + - [`std::mul_sat()`](/reference/numeric/mul_sat.md.nolink) + - [`std::div_sat()`](/reference/numeric/div_sat.md.nolink) + - [`std::saturation_cast()`](/reference/numeric/saturation_cast.md.nolink) - [``](/reference/cmath.md)の以下の関数を、`constexpr`に対応 - [`std::cos()`](/reference/cmath/cos.md) - [`std::sin()`](/reference/cmath/sin.md) @@ -198,6 +211,9 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [`std::log10()`](/reference/complex/complex/log10.md) - [`std::pow()`](/reference/complex/complex/pow.md) - [`std::sqrt()`](/reference/complex/complex/sqrt.md) +- [`std::complex`](/reference/complex/complex.md)を構造化束縛や、将来のパターンマッチで使用できるようタプルインタフェースの特殊化を追加 +- [``](/reference/random.md)の範囲`[0, 1)`の乱数を生成する[`std::generate_canonical()`](/reference/random/generate_canonical.md)を、望ましい統計的性質を保証するようアルゴリズムと制約を変更 + ### ユーティリティ - [`std::variant`](/reference/variant/variant.md)クラスに、メンバ関数版の[`visit()`](/reference/variant/variant/visit.md.nolink)を追加 @@ -208,7 +224,16 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [`quecto`](/reference/ratio/si_prefix.md) (10−30) +### デバッグ +- [`assert`](/reference/cassert/assert.md)マクロの引数としてカンマを含む式を指定できるよう、可変引数化 + + ### 型特性 - 共用体のどのメンバがアクティブかを判定するための関数として、[``](/reference/type_traits.md)に[`std::is_within_lifetime()`](/reference/type_traits/is_within_lifetime.md.nolink)を追加 - [`std::bitset`](/reference/bitset/bitset.md)に、[`std::basic_string_view`](/reference/string_view/basic_string_view.md)を受け取るコンストラクタを追加 +### 機能の削除 +- C++20から非推奨となっていた、[`std::basic_string`](/reference/string/basic_string.md)`::`[`reserve()`](/reference/string/basic_string/reserve.md)のパラメータなしのオーバーロードを削除 +- C++23から非推奨となっていた、[`std::allocator`](/reference/memory/allocator.md)のメンバ型`is_always_equal`を削除 +- C++17から非推奨となっていたUnicode変換ライブラリ[``](/reference/codecvt.md)を削除 + diff --git a/reference.md b/reference.md index 9df528cfad..cefcdc4207 100644 --- a/reference.md +++ b/reference.md @@ -13,6 +13,7 @@ - [レンジライブラリ](#ranges) - [アルゴリズムライブラリ](#algorithm) - [数値ライブラリ](#numerics) +- [デバッグライブラリ](#debug) - [入出力ライブラリ](#io) - [正規表現ライブラリ](#regular-expressions) - [アトミック操作ライブラリ](#atomic-operations) @@ -92,7 +93,7 @@ |--------------------------------------|----------------------|----------------| | [``](/reference/locale.md) | ロケール | | | [``](/reference/text_encoding.md.nolink) | 文字列エンコーディングの識別 | C++26 | -| [``](/reference/codecvt.md) | コード変換ファセット | C++11
C++17から非推奨 | +| [``](/reference/codecvt.md) | コード変換ファセット | C++11
C++17から非推奨
C++26で削除 | ##
コンテナライブラリ @@ -148,6 +149,14 @@ | [``](/reference/valarray.md) | 数値の配列 | | | [``](/reference/numeric.md) | 一般的な数値操作 | | | [``](/reference/numbers.md) | 数値 | C++20 | +| [``](/reference/linalg.md.nolink) | 線形代数 | C++26 | + + +## デバッグライブラリ + +| ヘッダ | 説明 | 対応バージョン | +|----------------------------------------|------------------|----------------| +| [``](/reference/debugging.md.nolink) | デバッグサポート | C++26 | ## 入出力ライブラリ From 6af41765b3db6506c8646386fe33431c772b683f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 22 Jan 2024 20:53:34 +0900 Subject: [PATCH 0655/3948] =?UTF-8?q?C++26=E3=81=AE=E8=8D=89=E6=A1=88?= =?UTF-8?q?=E3=82=92=E6=9B=B4=E6=96=B0=20#1220?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- international-standard.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/international-standard.md b/international-standard.md index e824a3083a..6fb9e3eeec 100644 --- a/international-standard.md +++ b/international-standard.md @@ -12,7 +12,7 @@ C++ の標準規格は、他にも各国の規格化団体によって国際標 | 通称†1 | 名称 | 参照する規格案†2 | 規格案・原案 | `__cplusplus` | |:--|:--|:--|:--|:--| -| [C++26](lang/cpp26.md) (C++2c) | ISO/IEC 14882:2026 (予定) | N4964([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4964.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/)) | N4964 N4958 | -- | +| [C++26](lang/cpp26.md) (C++2c) | ISO/IEC 14882:2026 (予定) | N4971([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4971.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/)) | N4971 N4964 N4958 | -- | | [C++23](lang/cpp23.md) (C++2b) | ISO/IEC 14882:2023 (予定) | N4950([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4950.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/)) | N4950 N4944 N4928 N4917 N4910 N4901 N4892 N4885 N4878
N4868 N4861 | -- | | [C++20](lang/cpp20.md) (C++2a) | ISO/IEC 14882:2020 | N4861†3([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/n4861.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4861/)) | N4860 N4849 N4842 N4835 N4830
N4820 N4810 N4800 N4791 N4788†4
N4778 N4762 N4750 N4741 N4727
N4713 N4700 N4687 | `202002L` | | [C++17](lang/cpp17.md) (C++1z) | ISO/IEC 14882:2017 | N4659([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4659.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4659/)) | N4660 N4659 N4640 N4618 N4606
N4594 N4582 N4567 N4527 N4431
N4296 | `201703L` | From 967d06055671f0abf021e727d7443ac9c573175d Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 22 Jan 2024 21:20:18 +0900 Subject: [PATCH 0656/3948] =?UTF-8?q?basic=5Fstring/reserve:=20C++26=20P28?= =?UTF-8?q?70R3=E5=AF=BE=E5=BF=9C=20#1241?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/string/basic_string/reserve.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/reference/string/basic_string/reserve.md b/reference/string/basic_string/reserve.md index 3c2533c2fc..fafe5223b5 100644 --- a/reference/string/basic_string/reserve.md +++ b/reference/string/basic_string/reserve.md @@ -5,7 +5,9 @@ * function[meta id-type] ```cpp -void reserve(size_type res_arg = 0); // (1) C++03 (C++20で非推奨化) +void reserve(size_type res_arg = 0); // (1)+(2) C++03 + +void reserve(); // (1) C++20で非推奨化, C++26で削除 constexpr void reserve(size_type res_arg); // (2) C++20 ``` @@ -29,12 +31,14 @@ constexpr void reserve(size_type res_arg); // (2) C++20 ## 備考 -- C++03で`reserve`操作でのメモリの縮小ができたことは、以下の問題があった: - - パフォーマンスの罠となっていた。この関数に指定する引数の値を慎重に選ばなければ、予想外の動的な再確保によってパフォーマンスを低下させる原因となっていた - - 移植性の壁になっていた。メモリ縮小は実装に任せられたオプション機能であったため、環境による動作の違いがあった - - [`vector`](/reference/vector/vector.md)と`string`でのコードの汎用化がむずかしくなっていた。[`vector::reserve()`](/reference/vector/vector/reserve.md)はメモリ伸長のみをサポートしていたが、`string`側はメモリ縮小もサポートしていたため、引数の値を計算することが難しかった - - メモリ縮小のためには[`shrink_to_fit()`](shrink_to_fit.md)メンバ関数があるため、そちらと重複する機能をなくすこととした - - これらのことから、C++20では、メモリ縮小を許可しているように見えるデフォルト引数`0`を非推奨化し、メモリ縮小機能を効果から削除した +C++03で`reserve`操作でのメモリの縮小ができたことは、以下の問題があった: + +- パフォーマンスの罠となっていた。この関数に指定する引数の値を慎重に選ばなければ、予想外の動的な再確保によってパフォーマンスを低下させる原因となっていた +- 移植性の壁になっていた。メモリ縮小は実装に任せられたオプション機能であったため、環境による動作の違いがあった +- [`vector`](/reference/vector/vector.md)と`string`でのコードの汎用化がむずかしくなっていた。[`vector::reserve()`](/reference/vector/vector/reserve.md)はメモリ伸長のみをサポートしていたが、`string`側はメモリ縮小もサポートしていたため、引数の値を計算することが難しかった +- メモリ縮小のためには[`shrink_to_fit()`](shrink_to_fit.md)メンバ関数があるため、そちらと重複する機能であった + +これらのことから、C++20では、メモリ縮小を許可しているように見えるデフォルト引数`0`を非推奨化し、メモリ縮小機能を効果から削除した。 ## 例 @@ -70,3 +74,4 @@ int main() ## 参照 - [P0966R1 `string::reserve` Should Not Shrink](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0966r1.html) - [P0980R1 Making `std::string` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0980r1.pdf) +- [P2870R3 Remove `basic_string::reserve()` From C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2870r3.pdf) From 7df12cd5e4b34d5d10ca4c8b87c72dbb7694b3dc Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 22 Jan 2024 21:36:19 +0900 Subject: [PATCH 0657/3948] =?UTF-8?q?basic=5Fstring::reserve=20:=20?= =?UTF-8?q?=E9=9D=9E=E6=8E=A8=E5=A5=A8=E3=83=BB=E5=89=8A=E9=99=A4=E3=81=AE?= =?UTF-8?q?=E8=A9=B3=E7=B4=B0=E7=94=A8=E3=81=AE=E8=A6=8B=E5=87=BA=E3=81=97?= =?UTF-8?q?=E3=82=92=E8=A8=AD=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/string/basic_string/reserve.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/string/basic_string/reserve.md b/reference/string/basic_string/reserve.md index fafe5223b5..fd73401735 100644 --- a/reference/string/basic_string/reserve.md +++ b/reference/string/basic_string/reserve.md @@ -30,7 +30,7 @@ constexpr void reserve(size_type res_arg); // (2) C++20 `allocator_traits::allocate()` が、よりふさわしい例外を投げるかもしれない。 -## 備考 +## 非推奨・削除の詳細 C++03で`reserve`操作でのメモリの縮小ができたことは、以下の問題があった: - パフォーマンスの罠となっていた。この関数に指定する引数の値を慎重に選ばなければ、予想外の動的な再確保によってパフォーマンスを低下させる原因となっていた From c42217141cc5d3da23f861ece0478c55252be342 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 23 Jan 2024 12:08:49 +0900 Subject: [PATCH 0658/3948] =?UTF-8?q?C++26=E5=AF=BE=E5=BF=9C=E3=81=A8?= =?UTF-8?q?=E3=81=97=E3=81=A6=E3=80=81span::at=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20(close=20#1235)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 2 +- reference/span/span.md | 1 + reference/span/span/at.md | 72 ++++++++++++++++++++++++++++++++++++ reference/span/span/op_at.md | 4 ++ 4 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 reference/span/span/at.md diff --git a/lang/cpp26.md b/lang/cpp26.md index eae30a66f9..99921500a7 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -66,7 +66,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [`std::mdspan`](/reference/mdspan/mdspan.md)のサブ配列版として[`std::submdspan`](/reference/mdspan/submdspan.md.nolink)を追加 - [`std::span`](/reference/span/span.md)に、以下を追加 - [`std::initializer_list`](/reference/initializer_list/initializer_list.md)をとるコンストラクタ - - インデックスアクセスのための[`at()`](/reference/span/span/at.md.nolink)メンバ関数 + - インデックスアクセスのための[`at()`](/reference/span/span/at.md)メンバ関数 - 連想コンテナの以下のメンバ関数に、一時オブジェクトが生成されるコストを抑える拡張を追加 - [`std::map`](/reference/map/map.md) - [`operator[]`](/reference/map/map/op_at.md) diff --git a/reference/span/span.md b/reference/span/span.md index d42ee04f75..2468231219 100644 --- a/reference/span/span.md +++ b/reference/span/span.md @@ -93,6 +93,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`operator[]`](span/op_at.md) | 参照範囲から、任意の位置の要素を取得する | C++20 | +| [`at`](span/at.md) | 参照範囲から、任意の位置の要素を取得する | C++26 | | [`front`](span/front.md) | 参照範囲の先頭要素を取得する | C++20 | | [`back`](span/back.md) | 参照範囲の末尾要素を取得する | C++20 | | [`data`](span/data.md) | 参照範囲の先頭を指すポインタを取得する | C++20 | diff --git a/reference/span/span/at.md b/reference/span/span/at.md new file mode 100644 index 0000000000..987f6b4aa0 --- /dev/null +++ b/reference/span/span/at.md @@ -0,0 +1,72 @@ +# at +* span[meta header] +* std[meta namespace] +* span[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr reference at(size_type i) const; +``` + +## 概要 +参照範囲から、任意の位置の要素を取得する。 + + +## 戻り値 +以下と等価: + +```cpp +return *(data() + i); +``` +* data()[link data.md] + + +## 計算量 +定数時間 + + +## 例外 +`i >=` [`size()`](size.md)の場合、[`out_of_range`](/reference/stdexcept.md)例外を送出する。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::vector v = {1, 2, 3, 4, 5}; + + int& x = std::span{v}.at(2); + assert(x == 3); + + int& y = std::span{v}.subspan(2, 3).at(1); + assert(y == 4); +} +``` +* at[color ff0000] +* subspan[link subspan.md] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 14 +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`operator[]`](op_at.md) + + +## 参照 +- [P2821R5 `span.at()`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2821r5.html) diff --git a/reference/span/span/op_at.md b/reference/span/span/op_at.md index e621098322..b6d818f2dc 100644 --- a/reference/span/span/op_at.md +++ b/reference/span/span/op_at.md @@ -65,5 +65,9 @@ int main() - [Visual C++](/implementation.md#visual_cpp): ?? +## 関連項目 +- [`at`](at.md) + + ## 参照 - [P1872R0 `span` should have `size_type`, not `index_type`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1872r0.pdf) From 3bcf3e69f3a8a248df46b277212529be6a5df92c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 23 Jan 2024 12:48:27 +0900 Subject: [PATCH 0659/3948] =?UTF-8?q?C++26=E5=AF=BE=E5=BF=9C=E3=81=A8?= =?UTF-8?q?=E3=81=97=E3=81=A6span=E3=81=AE=E3=82=B3=E3=83=B3=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=83=A9=E3=82=AF=E3=82=BF=E3=81=ABinitializer=5Flist?= =?UTF-8?q?=E3=82=92=E3=81=A8=E3=82=8B=E3=82=AA=E3=83=BC=E3=83=90=E3=83=BC?= =?UTF-8?q?=E3=83=AD=E3=83=BC=E3=83=89=E3=82=92=E8=BF=BD=E5=8A=A0=20(close?= =?UTF-8?q?=20#1234)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/span/span/op_constructor.md | 65 ++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 2 deletions(-) diff --git a/reference/span/span/op_constructor.md b/reference/span/span/op_constructor.md index 68321161df..adf6ea57a5 100644 --- a/reference/span/span/op_constructor.md +++ b/reference/span/span/op_constructor.md @@ -35,6 +35,9 @@ constexpr span(const span& other) noexcept = default; // (8) C++20 template constexpr explicit(extent != dynamic_extent && OtherExtent == dynamic_extent) span(const span& s) noexcept; // (9) C++20 + +constexpr explicit(extent != dynamic_extent) + span(std::initializer_list il); // (10) C++26 ``` * size_t[link /reference/cstddef/size_t.md] * array[link /reference/array/array.md] @@ -57,6 +60,7 @@ constexpr explicit(extent != dynamic_extent && OtherExtent == dynamic_extent) - 動的な要素数をもつ`span`同士の変換 - `span`から`span`への変換 - バイト数が同じ暗黙の型変換が可能な要素型をもつ`span`同士の変換 +- (10) : 初期化子リストから`span`オブジェクトを構築する ## テンプレートパラメータ制約 @@ -88,6 +92,9 @@ constexpr explicit(extent != dynamic_extent && OtherExtent == dynamic_extent) - (9) : - `extent ==` [`dynamic_extent`](/reference/span/dynamic_extent.md) `|| OtherExtent ==` [`dynamic_extent`](/reference/span/dynamic_extent.md) `|| extent == OtherExtent`が`true`であること (受け取り側が[`dynamic_extent`](/reference/span/dynamic_extent.md)を持っていれば任意の`Extent`から変換できる) - `OtherElementType(*)[]`型が`ElementType(*)[]`型に変換可能であること +- (10) : + - [`is_const_v`](/reference/type_traits/is_const.md)``が`true`であること + - (`std::span`に対してのみ使用できる) ## 事前条件 @@ -106,6 +113,8 @@ constexpr explicit(extent != dynamic_extent && OtherExtent == dynamic_extent) - [`std::is_const_v`](/reference/type_traits/is_const.md)`` が `false`であるとき、型 `R` はコンセプト [`std::ranges::borrowed_range`](/reference/ranges/borrowed_range.md) のモデルであること - (9) : - `extent`が[`dynamic_extent`](/reference/span/dynamic_extent.md)と等値でない場合、`extent`は[`s.size()`](size.md)と等値になる +- (10) : + - `extent`が[`dynamic_extent`](/reference/span/dynamic_extent.md)と等値でない場合、`extent`は[`il.size()`](/reference/initializer_list/initializer_list/size.md)と等値になる ## 効果 @@ -114,6 +123,7 @@ constexpr explicit(extent != dynamic_extent && OtherExtent == dynamic_extent) - (4), (5), (6) : 範囲`[`[`data`](/reference/iterator/data.md)`(arr),` [`data`](/reference/iterator/data.md)`(arr) + N)`を参照する`span`オブジェクトを構築する - (7) : 範囲`[std::ranges::data(r), std::ranges::data(r) + std::ranges::size(r))`を参照する`span`オブジェクトを構築する - (9) : 範囲`[s.`[`data()`](data.md)`, s.`[`data()`](data.md) `+ s.`[`size()`](size.md)`)`を参照する`span`オブジェクトを構築する +- (10) : 範囲`[il.`[`begin()`](/reference/initializer_list/initializer_list/begin.md)`, il.`[`begin()`](/reference/initializer_list/initializer_list/begin.md) `+ il.`[`size()`](/reference/initializer_list/initializer_list/size.md)`)`を参照する`span`オブジェクトを構築する ## 事後条件 @@ -130,10 +140,20 @@ constexpr explicit(extent != dynamic_extent && OtherExtent == dynamic_extent) ## 計算量 -- (1)-(9) : 定数時間 +- (1)-(10) : 定数時間 + + +## この機能が必要になった背景・経緯 +- (10) : + - [`std::string_view`](/reference/string_view/basic_string_view.md)が文字列リテラル (たとえば`"abc"`) をとれるのと同様に、`std::span`クラスも[`std::initializer_list`](/reference/initializer_list/initializer_list.md)をとれるようにした + + +## 備考 +- (10) : `std::span v = {1, 2, 3};` のような使い方は初期化子リストの寿命が尽きてしまうので注意。関数のパラメータを`span`として受け取るような使い方が想定される ## 例 +### 基本的な使い方 (C++20) ```cpp example #include #include @@ -261,8 +281,47 @@ int main() * str.size()[link /reference/string/basic_string/size.md] * str.data()[link /reference/string/basic_string/data.md] -### 出力 +#### 出力 +``` +``` + + +### 初期化子リストからspanを構築する (C++26) +```cpp example +#include +#include +#include + +void print_list(std::span s) { + bool first = true; + for (const int& x : s) { + if (first) { + first = false; + } + else { + std::cout << ','; + } + std::cout << x; + } + std::cout << std::endl; +} + +int main() +{ + std::vector v = {1, 2, 3, 4, 5}; + print_list(v); + + print_list({{3, 1, 4}}); // C++20からOK + print_list({3, 1, 4}); // C++26からOK +} +``` + + +#### 出力 ``` +1,2,3,4,5 +3,1,4 +3,1,4 ``` ## バージョン @@ -283,3 +342,5 @@ int main() - [P1394R4 Range constructor for `std::span`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1394r4.pdf) - [P1976R2 Fixed-size `span` construction from dynamic range](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1976r2.html) - [P2117R0 C++ Standard Library Issues Resolved Directly In Prague](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2117r0.html) +- [P2447R6 `std::span` over an initializer list](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2447r6.html) + - C++26から初期化子リストをとるコンストラクタが追加された From 617a9416409eb88df55edf6cd8b9437cb8c4c67f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 23 Jan 2024 15:16:38 +0900 Subject: [PATCH 0660/3948] =?UTF-8?q?=E3=81=A8=E3=81=AEcon?= =?UTF-8?q?stexpr=E5=AF=BE=E5=BF=9C=20(close=20#1198)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 8 ++- reference/cmath/acos.md | 34 +++++++++---- reference/cmath/acosh.md | 34 +++++++++---- reference/cmath/asin.md | 34 +++++++++---- reference/cmath/asinh.md | 34 +++++++++---- reference/cmath/atan.md | 6 ++- reference/cmath/atan2.md | 15 +++++- reference/cmath/atanh.md | 34 +++++++++---- reference/cmath/cbrt.md | 34 +++++++++---- reference/cmath/cos.md | 34 +++++++++---- reference/cmath/cosh.md | 34 +++++++++---- reference/cmath/erf.md | 34 +++++++++---- reference/cmath/erfc.md | 34 +++++++++---- reference/cmath/exp.md | 34 +++++++++---- reference/cmath/exp2.md | 34 +++++++++---- reference/cmath/expm1.md | 34 +++++++++---- reference/cmath/hypot.md | 67 +++++++++++++++++++++----- reference/cmath/lgamma.md | 34 +++++++++---- reference/cmath/log.md | 34 +++++++++---- reference/cmath/log10.md | 34 +++++++++---- reference/cmath/log1p.md | 34 +++++++++---- reference/cmath/log2.md | 34 +++++++++---- reference/cmath/pow.md | 61 +++++++++++++++++------ reference/cmath/sin.md | 34 +++++++++---- reference/cmath/sinh.md | 34 +++++++++---- reference/cmath/sqrt.md | 34 +++++++++---- reference/cmath/tan.md | 34 +++++++++---- reference/cmath/tanh.md | 35 ++++++++++---- reference/cmath/tgamma.md | 26 +++++++--- reference/complex/complex/abs.md | 11 ++++- reference/complex/complex/acos.md | 11 ++++- reference/complex/complex/acosh.md | 11 ++++- reference/complex/complex/arg.md | 13 ++++- reference/complex/complex/asin.md | 11 ++++- reference/complex/complex/asinh.md | 11 ++++- reference/complex/complex/atan.md | 11 ++++- reference/complex/complex/atanh.md | 11 ++++- reference/complex/complex/conj.md | 14 ++++-- reference/complex/complex/cos.md | 11 ++++- reference/complex/complex/cosh.md | 11 ++++- reference/complex/complex/exp.md | 11 ++++- reference/complex/complex/imag_free.md | 6 ++- reference/complex/complex/log.md | 11 ++++- reference/complex/complex/log10.md | 11 ++++- reference/complex/complex/norm.md | 14 ++++-- reference/complex/complex/polar.md | 13 ++++- reference/complex/complex/pow.md | 19 +++++++- reference/complex/complex/proj.md | 13 ++++- reference/complex/complex/real_free.md | 12 +++-- reference/complex/complex/sin.md | 11 ++++- reference/complex/complex/sinh.md | 11 ++++- reference/complex/complex/sqrt.md | 11 ++++- reference/complex/complex/tan.md | 11 ++++- reference/complex/complex/tanh.md | 11 ++++- 54 files changed, 953 insertions(+), 304 deletions(-) diff --git a/lang/cpp26.md b/lang/cpp26.md index 99921500a7..311fb6c933 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -160,7 +160,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [`std::mul_sat()`](/reference/numeric/mul_sat.md.nolink) - [`std::div_sat()`](/reference/numeric/div_sat.md.nolink) - [`std::saturation_cast()`](/reference/numeric/saturation_cast.md.nolink) -- [``](/reference/cmath.md)の以下の関数を、`constexpr`に対応 +- [``](/reference/cmath.md)の以下の関数を、`constexpr`に対応 (特殊関数と、グローバルの丸めモードに依存する丸め関数以外の全て) - [`std::cos()`](/reference/cmath/cos.md) - [`std::sin()`](/reference/cmath/sin.md) - [`std::tan()`](/reference/cmath/tan.md) @@ -189,7 +189,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [`std::erfc()`](/reference/cmath/erfc.md) - [`std::lgamma()`](/reference/cmath/lgamma.md) - [`std::tgamma()`](/reference/cmath/tgamma.md) -- [``](/reference/complex.md)の以下の関数を、`constexpr`に対応 +- [``](/reference/complex.md)の以下の関数を、`constexpr`に対応 (すべて) - [`std::abs()`](/reference/complex/complex/abs.md) - [`std::arg()`](/reference/complex/complex/arg.md) - [`std::proj()`](/reference/complex/complex/proj.md) @@ -211,6 +211,10 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [`std::log10()`](/reference/complex/complex/log10.md) - [`std::pow()`](/reference/complex/complex/pow.md) - [`std::sqrt()`](/reference/complex/complex/sqrt.md) + - [`std::norm()`](/reference/complex/complex/norm.md) (算術型オーバーロード) + - [`std::conj()`](/reference/complex/complex/conj.md) (算術型オーバーロード) + - [`std::imag()`](/reference/complex/complex/imag_free.md) (算術型オーバーロード) + - [`std::real()`](/reference/complex/complex/real_free.md) (算術型オーバーロード) - [`std::complex`](/reference/complex/complex.md)を構造化束縛や、将来のパターンマッチで使用できるようタプルインタフェースの特殊化を追加 - [``](/reference/random.md)の範囲`[0, 1)`の乱数を生成する[`std::generate_canonical()`](/reference/random/generate_canonical.md)を、望ましい統計的性質を保証するようアルゴリズムと制約を変更 diff --git a/reference/cmath/acos.md b/reference/cmath/acos.md index 6ae027aec7..a1a6723d7b 100644 --- a/reference/cmath/acos.md +++ b/reference/cmath/acos.md @@ -6,17 +6,29 @@ ```cpp namespace std { - float acos(float x); // (1) C++03からC++20まで - double acos(double x); // (2) C++03からC++20まで - long double acos(long double x); // (3) C++03からC++20まで + float acos(float x); // (1) C++03からC++20まで + double acos(double x); // (2) C++03からC++20まで + long double acos(long double x); // (3) C++03からC++20まで floating-point-type - acos(floating-point-type x); // (4) C++23 - - double acos(Integral x); // (5) C++11 - - float acosf(float x); // (6) C++17 - long double acosl(long double x); // (7) C++17 + acos(floating-point-type x); // (4) C++23 + constexpr floating-point-type + acos(floating-point-type x); // (4) C++26 + + double + acos(Integral x); // (5) C++11 + constexpr double + acos(Integral x); // (5) C++26 + + float + acosf(float x); // (6) C++17 + constexpr float + acosf(float x); // (6) C++26 + + long double + acosl(long double x); // (7) C++17 + constexpr long double + acosl(long double x); // (7) C++26 } ``` * Integral[italic] @@ -92,7 +104,7 @@ acos(-1.0) = 3.141593 - [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 #### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 @@ -111,3 +123,5 @@ $$ \mathrm{Arccos}~x = \frac{\pi}{2} - \mathrm{Arcsin}~x \quad \mathrm{for} \; | ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/cmath/acosh.md b/reference/cmath/acosh.md index 8e072d9bf6..580f40969a 100644 --- a/reference/cmath/acosh.md +++ b/reference/cmath/acosh.md @@ -7,17 +7,29 @@ ```cpp namespace std { - float acosh(float x); // (1) C++11からC++20まで - double acosh(double x); // (2) C++11からC++20まで - long double acosh(long double x); // (3) C++11からC++20まで + float acosh(float x); // (1) C++11からC++20まで + double acosh(double x); // (2) C++11からC++20まで + long double acosh(long double x); // (3) C++11からC++20まで floating-point-type - acosh(floating-point-type x); // (4) C++23 - - double acosh(Integral x); // (5) C++11 - - float acoshf(float x); // (6) C++17 - long double acoshl(long double x); // (7) C++17 + acosh(floating-point-type x); // (4) C++23 + constexpr floating-point-type + acosh(floating-point-type x); // (4) C++26 + + double + acosh(Integral x); // (5) C++11 + constexpr double + acosh(Integral x); // (5) C++26 + + float + acoshf(float x); // (6) C++17 + constexpr float + acoshf(float x); // (6) C++26 + + long double + acoshl(long double x); // (7) C++17 + constexpr long double + acoshl(long double x); // (7) C++26 } ``` * Integral[italic] @@ -83,7 +95,7 @@ acosh(∞) = inf - [GCC](/implementation.md#gcc): 4.3.4, 4.4.5, 4.5.2, 4.6.1, 4.7.0 #### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 @@ -96,3 +108,5 @@ $$ \mathrm{arcosh}~x = \log_e \left(x + \sqrt{x^2-1}\right) \quad \mathrm{for} \ ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/cmath/asin.md b/reference/cmath/asin.md index 132bd53a13..dc4d99d8ec 100644 --- a/reference/cmath/asin.md +++ b/reference/cmath/asin.md @@ -6,17 +6,29 @@ ```cpp namespace std { - float asin(float x); // (1) C++03からC++20まで - double asin(double x); // (2) C++03からC++20まで - long double asin(long double x); // (3) C++03からC++20まで + float asin(float x); // (1) C++03からC++20まで + double asin(double x); // (2) C++03からC++20まで + long double asin(long double x); // (3) C++03からC++20まで floating-point-type - asin(floating-point-type x); // (4) C++23 - - double asin(Integral x); // (5) C++11 - - float asinf(float x); // (6) C++17 - long double asinl(long double x); // (7) C++17 + asin(floating-point-type x); // (4) C++23 + constexpr floating-point-type + asin(floating-point-type x); // (4) C++26 + + double + asin(Integral x); // (5) C++11 + constexpr double + asin(Integral x); // (5) C++26 + + float + asinf(float x); // (6) C++17 + constexpr float + asinf(float x); // (6) C++26 + + long double + asinl(long double x); // (7) C++17 + constexpr long double + asinl(long double x); // (7) C++26 } ``` * Integral[italic] @@ -88,7 +100,7 @@ asin(1.0) = 1.570796 - [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 #### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 @@ -107,3 +119,5 @@ $$ \mathrm{Arcsin}~x = \frac{\pi}{2} - \mathrm{Arccos}~x = \frac{\pi}{2} - \math ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/cmath/asinh.md b/reference/cmath/asinh.md index c18b0fa468..2ce92c89d4 100644 --- a/reference/cmath/asinh.md +++ b/reference/cmath/asinh.md @@ -7,17 +7,29 @@ ```cpp namespace std { - float asinh(float x); // (1) C++11からC++20まで - double asinh(double x); // (2) C++11からC++20まで - long double asinh(long double x); // (3) C++11からC++20まで + float asinh(float x); // (1) C++11からC++20まで + double asinh(double x); // (2) C++11からC++20まで + long double asinh(long double x); // (3) C++11からC++20まで floating-point-type - asinh(floating-point-type x); // (4) C++23 - - double asinh(Integral x); // (5) C++11 - - float asinhf(float x); // (6) C++17 - long double asinhl(long double x); // (7) C++17 + asinh(floating-point-type x); // (4) C++23 + constexpr floating-point-type + asinh(floating-point-type x); // (4) C++26 + + double + asinh(Integral x); // (5) C++11 + constexpr double + asinh(Integral x); // (5) C++26 + + float + asinhf(float x); // (6) C++17 + constexpr float + asinhf(float x); // (6) C++26 + + long double + asinhl(long double x); // (7) C++17 + constexpr long double + asinhl(long double x); // (7) C++26 } ``` * Integral[italic] @@ -78,7 +90,7 @@ asinh(1.0) = 0.881374 #### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 @@ -97,3 +109,5 @@ $$ \mathrm{arsinh}~x = \log_e \left(x + \sqrt{x^2+1}\right) \quad \mathrm{for~al ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/cmath/atan.md b/reference/cmath/atan.md index a82f0ba13d..457d83f3c6 100644 --- a/reference/cmath/atan.md +++ b/reference/cmath/atan.md @@ -12,6 +12,8 @@ namespace std { floating-point-type atan(floating-point-type x); // (4) C++23 + constexpr floating-point-type + atan(floating-point-type x); // (4) C++26 double atan(Integral x); // (5) C++11 @@ -89,7 +91,7 @@ atan(∞) = 1.570796 - [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 #### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 @@ -115,3 +117,5 @@ $$ \mathrm{Arctan}~x = \frac{\pi}{4} + \mathrm{Arctan}~\frac{x - 1}{x + 1} \quad ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/cmath/atan2.md b/reference/cmath/atan2.md index 4878498a1c..fcbcf04210 100644 --- a/reference/cmath/atan2.md +++ b/reference/cmath/atan2.md @@ -14,15 +14,26 @@ namespace std { floating-point-type atan2(floating-point-type y, floating-point-type x); // (4) C++23 + constexpr floating-point-type + atan2(floating-point-type y, + floating-point-type x); // (4) C++26 Promoted atan2(Arithmetic1 y, Arithmetic2 x); // (5) C++11 + constexpr Promoted + atan2(Arithmetic1 y, + Arithmetic2 x); // (5) C++26 float atan2f(float y, float x); // (6) C++17 + constexpr float + atan2f(float y, float x); // (6) C++26 + long double atan2l(long double y, long double x); // (7) C++17 + constexpr long double + atan2l(long double y, long double x); // (7) C++26 } ``` * Promoted[italic] @@ -116,7 +127,7 @@ atan2(-1.0, 1.0) = -0.785398 - [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 #### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 @@ -136,3 +147,5 @@ $$ ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/cmath/atanh.md b/reference/cmath/atanh.md index 78e3a266dc..6e3bb5445e 100644 --- a/reference/cmath/atanh.md +++ b/reference/cmath/atanh.md @@ -7,17 +7,29 @@ ```cpp namespace std { - float atanh(float x); // (1) C++11からC++20まで - double atanh(double x); // (2) C++11からC++20まで - long double atanh(long double x); // (3) C++11からC++20まで + float atanh(float x); // (1) C++11からC++20まで + double atanh(double x); // (2) C++11からC++20まで + long double atanh(long double x); // (3) C++11からC++20まで floating-point-type - atanh(floating-point-type x); // (4) C++23 - - double atanh(Integral x); // (5) C++11 - - float atanhf(float x); // (6) C++17 - long double atanhl(long double x); // (7) C++17 + atanh(floating-point-type x); // (4) C++23 + constexpr floating-point-type + atanh(floating-point-type x); // (4) C++26 + + double + atanh(Integral x); // (5) C++11 + constexpr double + atanh(Integral x); // (5) C++26 + + float + atanhf(float x); // (6) C++17 + constexpr float + atanhf(float x); // (6) C++26 + + long double + atanhl(long double x); // (7) C++17 + constexpr long double + atanhl(long double x); // (7) C++26 } ``` * Integral[italic] @@ -85,7 +97,7 @@ atanh(1.0) = inf - [GCC](/implementation.md#gcc): 4.3.4, 4.4.5, 4.5.2, 4.6.1, 4.7.0 #### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 @@ -104,3 +116,5 @@ $$ \mathrm{artanh}~x = \frac{1}{2} \log_e \frac{1 + x}{1 - x} \quad \mathrm{for} ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/cmath/cbrt.md b/reference/cmath/cbrt.md index f5c879de33..8ae164345a 100644 --- a/reference/cmath/cbrt.md +++ b/reference/cmath/cbrt.md @@ -7,17 +7,29 @@ ```cpp namespace std { - float cbrt(float x); // (1) C++11からC++20まで - double cbrt(double x); // (2) C++11からC++20まで - long double cbrt(long double x); // (3) C++11からC++20まで + float cbrt(float x); // (1) C++11からC++20まで + double cbrt(double x); // (2) C++11からC++20まで + long double cbrt(long double x); // (3) C++11からC++20まで floating-point-type - cbrt(floating-point-type x); // (4) C++23 - - double cbrt(Integral x); // (5) C++11 - - float cbrtf(float x); // (6) C++17 - long double cbrtl(long double x); // (7) C++17 + cbrt(floating-point-type x); // (4) C++23 + constexpr floating-point-type + cbrt(floating-point-type x); // (4) C++26 + + double + cbrt(Integral x); // (5) C++11 + constexpr double + cbrt(Integral x); // (5) C++26 + + float + cbrtf(float x); // (6) C++17 + constexpr float + cbrtf(float x); // (6) C++26 + + long double + cbrtl(long double x); // (7) C++17 + constexpr long double + cbrtl(long double x); // (7) C++26 } ``` * Integral[italic] @@ -85,7 +97,7 @@ cbrt(-1.0) = -1.000000 - [GCC](/implementation.md#gcc): 4.3.4, 4.4.5, 4.5.2, 4.6.1, 4.7.0 #### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 @@ -93,3 +105,5 @@ cbrt(-1.0) = -1.000000 ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/cmath/cos.md b/reference/cmath/cos.md index 0f68b806d2..8c79ac589e 100644 --- a/reference/cmath/cos.md +++ b/reference/cmath/cos.md @@ -6,17 +6,29 @@ ```cpp namespace std { - float cos(float x); // (1) C++03からC++20まで - double cos(double x); // (2) C++03からC++20まで - long double cos(long double x); // (3) C++03からC++20まで + float cos(float x); // (1) C++03からC++20まで + double cos(double x); // (2) C++03からC++20まで + long double cos(long double x); // (3) C++03からC++20まで floating-point-type - cos(floating-point-type x); // (4) C++23 - - double cos(Integral x); // (5) C++11 - - float cosf(float x); // (6) C++17 - long double cosl(long double x); // (7) C++17 + cos(floating-point-type x); // (4) C++23 + constexpr floating-point-type + cos(floating-point-type x); // (4) C++26 + + double + cos(Integral x); // (5) C++11 + constexpr double + cos(Integral x); // (5) C++26 + + float + cosf(float x); // (6) C++17 + constexpr float + cosf(float x); // (6) C++26 + + long double + cosl(long double x); // (7) C++17 + constexpr long double + cosl(long double x); // (7) C++26 } ``` * Integral[italic] @@ -108,7 +120,7 @@ int main() - [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 #### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 @@ -126,3 +138,5 @@ $$ \cos x = \sum_{n = 0}^{\infty} \frac{(-1)^n}{(2n)!} x^{2n} \quad \mathrm{for~ ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/cmath/cosh.md b/reference/cmath/cosh.md index 3218f93c7d..283d8afb12 100644 --- a/reference/cmath/cosh.md +++ b/reference/cmath/cosh.md @@ -6,17 +6,29 @@ ```cpp namespace std { - float cosh(float x); // (1) C++03からC++20まで - double cosh(double x); // (2) C++03からC++20まで - long double cosh(long double x); // (3) C++03からC++20まで + float cosh(float x); // (1) C++03からC++20まで + double cosh(double x); // (2) C++03からC++20まで + long double cosh(long double x); // (3) C++03からC++20まで floating-point-type - cosh(floating-point-type x); // (4) C++23 - - double cosh(Integral x); // (5) C++11 - - float coshf(float x); // (6) C++17 - long double coshl(long double x); // (7) C++17 + cosh(floating-point-type x); // (4) C++23 + constexpr floating-point-type + cosh(floating-point-type x); // (4) C++26 + + double + cosh(Integral x); // (5) C++11 + constexpr double + cosh(Integral x); // (5) C++26 + + float + coshf(float x); // (6) C++17 + constexpr float + coshf(float x); // (6) C++26 + + long double + coshl(long double x); // (7) C++17 + constexpr long double + coshl(long double x); // (7) C++26 } ``` * Integral[italic] @@ -81,7 +93,7 @@ cosh(1.0) = 1.543081 - [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 #### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 @@ -95,3 +107,5 @@ $$ \cosh x = \sum_{n = 0}^{\infty} \frac{1}{(2n)!} x^{2n} \quad \mathrm{for~all} ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/cmath/erf.md b/reference/cmath/erf.md index 138fa4d5f6..b492184f89 100644 --- a/reference/cmath/erf.md +++ b/reference/cmath/erf.md @@ -7,17 +7,29 @@ ```cpp namespace std { - float erf(float x); // (1) C++11からC++20まで - double erf(double x); // (2) C++11からC++20まで - long double erf(long double x); // (3) C++11からC++20まで + float erf(float x); // (1) C++11からC++20まで + double erf(double x); // (2) C++11からC++20まで + long double erf(long double x); // (3) C++11からC++20まで floating-point-type - erf(floating-point-type x); // (4) C++23 - - double erf(Integral x); // (5) C++11 - - float erff(float x); // (6) C++17 - long double erfl(long double x); // (7) C++17 + erf(floating-point-type x); // (4) C++23 + constexpr floating-point-type + erf(floating-point-type x); // (4) C++26 + + double + erf(Integral x); // (5) C++11 + constexpr double + erf(Integral x); // (5) C++26 + + float + erff(float x); // (6) C++17 + constexpr float + erff(float x); // (6) C++26 + + long double + erfl(long double x); // (7) C++17 + constexpr long double + erfl(long double x); // (7) C++26 } ``` * Integral[italic] @@ -84,7 +96,7 @@ erf(+∞) = 1.000000 - [Visual C++](/implementation.md#visual_cpp): ?? #### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 @@ -92,3 +104,5 @@ erf(+∞) = 1.000000 ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/cmath/erfc.md b/reference/cmath/erfc.md index 8f16988704..88aa1bf739 100644 --- a/reference/cmath/erfc.md +++ b/reference/cmath/erfc.md @@ -7,17 +7,29 @@ ```cpp namespace std { - float erfc(float x); // (1) C++11からC++20まで - double erfc(double x); // (2) C++11からC++20まで - long double erfc(long double x); // (3) C++11からC++20まで + float erfc(float x); // (1) C++11からC++20まで + double erfc(double x); // (2) C++11からC++20まで + long double erfc(long double x); // (3) C++11からC++20まで floating-point-type - erfc(floating-point-type x); // (4) C++23 - - double erfc(Integral x); // (5) C++11 - - float erfcf(float x); // (6) C++17 - long double erfcl(long double x); // (7) C++17 + erfc(floating-point-type x); // (4) C++23 + constexpr floating-point-type + erfc(floating-point-type x); // (4) C++26 + + double + erfc(Integral x); // (5) C++11 + constexpr double + erfc(Integral x); // (5) C++26 + + float + erfcf(float x); // (6) C++17 + constexpr float + erfcf(float x); // (6) C++26 + + long double + erfcl(long double x); // (7) C++17 + constexpr long double + erfcl(long double x); // (7) C++26 } ``` * Integral[italic] @@ -84,7 +96,7 @@ erfc(+∞) = 0.000000 - [Visual C++](/implementation.md#visual_cpp): ?? #### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 @@ -92,3 +104,5 @@ erfc(+∞) = 0.000000 ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/cmath/exp.md b/reference/cmath/exp.md index 1d080b7518..6622248ac1 100644 --- a/reference/cmath/exp.md +++ b/reference/cmath/exp.md @@ -6,17 +6,29 @@ ```cpp namespace std { - float exp(float x); // (1) C++03からC++20まで - double exp(double x); // (2) C++03からC++20まで - long double exp(long double x); // (3) C++03からC++20まで + float exp(float x); // (1) C++03からC++20まで + double exp(double x); // (2) C++03からC++20まで + long double exp(long double x); // (3) C++03からC++20まで floating-point-type - exp(floating-point-type x); // (4) C++23 - - double exp(Integral x); // (5) C++11 - - float expf(float x); // (6) C++17 - long double expl(long double x); // (7) C++17 + exp(floating-point-type x); // (4) C++23 + constexpr floating-point-type + exp(floating-point-type x); // (4) C++26 + + double + exp(Integral x); // (5) C++11 + constexpr double + exp(Integral x); // (5) C++26 + + float + expf(float x); // (6) C++17 + constexpr float + expf(float x); // (6) C++26 + + long double + expl(long double x); // (7) C++17 + constexpr long double + expl(long double x); // (7) C++26 } ``` * Integral[italic] @@ -86,7 +98,7 @@ exp(-∞) = 0.000000 - [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 #### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 @@ -100,3 +112,5 @@ $$ e^x = \sum_{n = 0}^{\infty} \frac{x^n}{n!} \quad \mathrm{for~all} \; x $$ ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/cmath/exp2.md b/reference/cmath/exp2.md index 44b28dc801..35f918b38d 100644 --- a/reference/cmath/exp2.md +++ b/reference/cmath/exp2.md @@ -7,17 +7,29 @@ ```cpp namespace std { - float exp2(float x); // (1) C++11からC++20まで - double exp2(double x); // (2) C++11からC++20まで - long double exp2(long double x); // (3) C++11からC++20まで + float exp2(float x); // (1) C++11からC++20まで + double exp2(double x); // (2) C++11からC++20まで + long double exp2(long double x); // (3) C++11からC++20まで floating-point-type - exp2(floating-point-type x); // (4) C++23 - - double exp2(Integral x); // (5) C++11 - - float exp2f(float x); // (6) C++17 - long double exp2l(long double x); // (7) C++17 + exp2(floating-point-type x); // (4) C++23 + constexpr floating-point-type + exp2(floating-point-type x); // (4) C++26 + + double + exp2(Integral x); // (5) C++11 + constexpr double + exp2(Integral x); // (5) C++26 + + float + exp2f(float x); // (6) C++17 + float + exp2f(float x); // (6) C++26 + + long double + exp2l(long double x); // (7) C++17 + constexpr long double + exp2l(long double x); // (7) C++26 } ``` * Integral[italic] @@ -107,7 +119,7 @@ namespace std { - [GCC](/implementation.md#gcc): 4.3.4, 4.4.5, 4.5.2, 4.6.1, 4.7.0 #### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 @@ -121,3 +133,5 @@ $$ 2^x = e^{x \log_e 2} \quad \mathrm{for~all} \; x $$ ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/cmath/expm1.md b/reference/cmath/expm1.md index cf40c790d0..eea6930d5a 100644 --- a/reference/cmath/expm1.md +++ b/reference/cmath/expm1.md @@ -7,17 +7,29 @@ ```cpp namespace std { - float expm1(float x); // (1) C++11からC++20まで - double expm1(double x); // (2) C++11からC++20まで - long double expm1(long double x); // (3) C++11からC++20まで + float expm1(float x); // (1) C++11からC++20まで + double expm1(double x); // (2) C++11からC++20まで + long double expm1(long double x); // (3) C++11からC++20まで floating-point-type - expm1(floating-point-type x); // (4) C++23 - - double expm1(Integral x); // (5) C++11 - - float expm1f(float x); // (6) C++17 - long double expm1l(long double x); // (7) C++17 + expm1(floating-point-type x); // (4) C++23 + constexpr floating-point-type + expm1(floating-point-type x); // (4) C++26 + + double + expm1(Integral x); // (5) C++11 + constexpr double + expm1(Integral x); // (5) C++26 + + float + expm1f(float x); // (6) C++17 + constexpr float + expm1f(float x); // (6) C++26 + + long double + expm1l(long double x); // (7) C++17 + constexpr long double + expm1l(long double x); // (7) C++26 } ``` * Integral[italic] @@ -88,7 +100,7 @@ expm1(-∞) = -1.000000 - [GCC](/implementation.md#gcc): 4.3.4, 4.4.5, 4.5.2, 4.6.1, 4.7.0 #### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 @@ -96,3 +108,5 @@ expm1(-∞) = -1.000000 ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/cmath/hypot.md b/reference/cmath/hypot.md index 340bddcd13..96700b2ce8 100644 --- a/reference/cmath/hypot.md +++ b/reference/cmath/hypot.md @@ -7,35 +7,74 @@ ```cpp namespace std { - float hypot(float x, float y); // (1) C++11からC++20まで - double hypot(double x, double y); // (2) C++11からC++20まで - long double hypot(long double x, long double y); // (3) C++11からC++20まで + float + hypot(float x, + float y); // (1) C++11からC++20まで + double + hypot(double x, + double y); // (2) C++11からC++20まで + long double + hypot(long double x, + long double y); // (3) C++11からC++20まで floating-point-type hypot(floating-point-type x, - floating-point-type y); // (4) C++23 + floating-point-type y); // (4) C++23 + constexpr floating-point-type + hypot(floating-point-type x, + floating-point-type y); // (4) C++26 - Promoted hypot(Arithmetic1 x, Arithmetic2 y); // (5) C++11 + Promoted + hypot(Arithmetic1 x, + Arithmetic2 y); // (5) C++11 + constexpr Promoted + hypot(Arithmetic1 x, + Arithmetic2 y); // (5) C++26 - float hypotf(float x, float y); // (6) C++17 - long double hypotl(long double x, long double y); // (7) C++17 + float + hypotf(float x, + float y); // (6) C++17 + constexpr float + hypotf(float x, + float y); // (6) C++26 - float hypot(float x, float y, float z); // (8) C++17からC++20まで - double hypot(double x, double y, double z); // (9) C++17からC++20まで + long double + hypotl(long double x, + long double y); // (7) C++17 + constexpr long double + hypotl(long double x, + long double y); // (7) C++26 + + float + hypot(float x, + float y, + float z); // (8) C++17からC++20まで + double + hypot(double x, + double y, + double z); // (9) C++17からC++20まで long double hypot(long double x, long double y, - long double z); // (10) C++17からC++20まで + long double z); // (10) C++17からC++20まで floating-point-type hypot(floating-point-type x, floating-point-type y, - floating-point-type z); // (11) C++23 + floating-point-type z); // (11) C++23 + constexpr floating-point-type + hypot(floating-point-type x, + floating-point-type y, + floating-point-type z); // (11) C++26 Promoted hypot(Arithmetic1 x, Arithmetic2 y, - Arithmetic3 z); // (12) C++17 + Arithmetic3 z); // (12) C++17 + constexpr Promoted + hypot(Arithmetic1 x, + Arithmetic2 y, + Arithmetic3 z); // (12) C++26 } ``` * Promoted[italic] @@ -189,7 +228,7 @@ int main() - 2013以降、`_hypotl`と`hypotl`は関数として定義されている。 #### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 @@ -204,3 +243,5 @@ $$ \sqrt{x^2 + y^2} = \left| u \right| \sqrt{1 + \left( \frac{v}{u} \right)^2} \ - [P0030R1 Proposal to Introduce a 3-Argument Overload to `std::hypot`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0030r1.pdf) - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/cmath/lgamma.md b/reference/cmath/lgamma.md index ace61255b5..57a08370ca 100644 --- a/reference/cmath/lgamma.md +++ b/reference/cmath/lgamma.md @@ -7,17 +7,29 @@ ```cpp namespace std { - float lgamma(float x); // (1) C++11からC++20まで - double lgamma(double x); // (2) C++11からC++20まで - long double lgamma(long double x); // (3) C++11からC++20まで + float lgamma(float x); // (1) C++11からC++20まで + double lgamma(double x); // (2) C++11からC++20まで + long double lgamma(long double x); // (3) C++11からC++20まで floating-point-type - lgamma(floating-point-type x); // (4) C++23 - - double lgamma(Integral x); // (5) C++11 - - float lgammaf(float x); // (6) C++17 - long double lgammal(long double x); // (7) C++17 + lgamma(floating-point-type x); // (4) C++23 + constexpr floating-point-type + lgamma(floating-point-type x); // (4) C++26 + + double + lgamma(Integral x); // (5) C++11 + constexpr double + lgamma(Integral x); // (5) C++26 + + float + lgammaf(float x); // (6) C++17 + constexpr float + lgammaf(float x); // (6) C++26 + + long double + lgammal(long double x); // (7) C++17 + constexpr long double + lgammal(long double x); // (7) C++26 } ``` * Integral[italic] @@ -91,7 +103,7 @@ lgamma(+∞) = inf - [Visual C++](/implementation.md#visual_cpp): ?? #### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 @@ -99,3 +111,5 @@ lgamma(+∞) = inf ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/cmath/log.md b/reference/cmath/log.md index de3f1ebe70..3da518e8a0 100644 --- a/reference/cmath/log.md +++ b/reference/cmath/log.md @@ -6,17 +6,29 @@ ```cpp namespace std { - float log(float x); // (1) C++03からC++20まで - double log(double x); // (2) C++03からC++20まで - long double log(long double x); // (3) C++03からC++20まで + float log(float x); // (1) C++03からC++20まで + double log(double x); // (2) C++03からC++20まで + long double log(long double x); // (3) C++03からC++20まで floating-point-type - log(floating-point-type x); // (4) C++23 - - double log(Integral x); // (5) C++11 - - float logf(float x); // (6) C++17 - long double logl(long double x); // (7) C++17 + log(floating-point-type x); // (4) C++23 + constexpr floating-point-type + log(floating-point-type x); // (4) C++26 + + double + log(Integral x); // (5) C++11 + constexpr double + log(Integral x); // (5) C++26 + + float + logf(float x); // (6) C++17 + constexpr float + logf(float x); // (6) C++26 + + long double + logl(long double x); // (7) C++17 + constexpr long double + logl(long double x); // (7) C++26 } ``` * Integral[italic] @@ -88,7 +100,7 @@ log(-1.0) = nan - [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 #### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 @@ -102,3 +114,5 @@ $$ \log_e (1 + x) = \sum_{n = 1}^{\infty} \frac{(-1)^{n + 1}}{n} x^n \quad \math ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/cmath/log10.md b/reference/cmath/log10.md index b2abb65ab1..1bdbb66a04 100644 --- a/reference/cmath/log10.md +++ b/reference/cmath/log10.md @@ -6,17 +6,29 @@ ```cpp namespace std { - float log10(float x); // (1) C++03からC++20まで - double log10(double x); // (2) C++03からC++20まで - long double log10(long double x); // (3) C++03からC++20まで + float log10(float x); // (1) C++03からC++20まで + double log10(double x); // (2) C++03からC++20まで + long double log10(long double x); // (3) C++03からC++20まで floating-point-type - log10(floating-point-type x); // (4) C++23 - - double log10(Integral x); // (5) C++11 - - float log10f(float x); // (6) C++17 - long double log10l(long double x); // (7) C++17 + log10(floating-point-type x); // (4) C++23 + constexpr floating-point-type + log10(floating-point-type x); // (4) C++26 + + double + log10(Integral x); // (5) C++11 + constexpr double + log10(Integral x); // (5) C++26 + + float + log10f(float x); // (6) C++17 + constexpr float + log10f(float x); // (6) C++26 + + long double + log10l(long double x); // (7) C++17 + constexpr long double + log10l(long double x); // (7) C++26 } ``` * Integral[italic] @@ -121,7 +133,7 @@ log10(100000000.000000) : 8.000000 - [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 #### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 @@ -135,3 +147,5 @@ $$ \log_{10} x = \frac{\log_e x}{\log_e 10}$$ ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/cmath/log1p.md b/reference/cmath/log1p.md index 4cabef4403..26813a70ad 100644 --- a/reference/cmath/log1p.md +++ b/reference/cmath/log1p.md @@ -7,17 +7,29 @@ ```cpp namespace std { - float log1p(float x); // (1) C++11からC++20まで - double log1p(double x); // (2) C++11からC++20まで - long double log1p(long double x); // (3) C++11からC++20まで + float log1p(float x); // (1) C++11からC++20まで + double log1p(double x); // (2) C++11からC++20まで + long double log1p(long double x); // (3) C++11からC++20まで floating-point-type - log1p(floating-point-type x); // (4) C++23 - - double log1p(Integral x); // (5) C++11 - - float log1pf(float x); // (6) C++17 - long double log1pl(long double x); // (7) C++17 + log1p(floating-point-type x); // (4) C++23 + constexpr floating-point-type + log1p(floating-point-type x); // (4) C++26 + + double + log1p(Integral x); // (5) C++11 + constexpr double + log1p(Integral x); // (5) C++26 + + float + log1pf(float x); // (6) C++17 + constexpr float + log1pf(float x); // (6) C++26 + + long double + log1pl(long double x); // (7) C++17 + constexpr long double + log1pl(long double x); // (7) C++26 } ``` * Integral[italic] @@ -94,7 +106,7 @@ log1p(-2.0) = -nan - [GCC](/implementation.md#gcc): 4.3.4, 4.4.5, 4.5.2, 4.6.1, 4.7.0 #### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 @@ -102,3 +114,5 @@ log1p(-2.0) = -nan ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/cmath/log2.md b/reference/cmath/log2.md index a2e051fcef..e57ff5ab2a 100644 --- a/reference/cmath/log2.md +++ b/reference/cmath/log2.md @@ -7,17 +7,29 @@ ```cpp namespace std { - float log2(float x); // (1) C++11からC++20まで - double log2(double x); // (2) C++11からC++20まで - long double log2(long double x); // (3) C++11からC++20まで + float log2(float x); // (1) C++11からC++20まで + double log2(double x); // (2) C++11からC++20まで + long double log2(long double x); // (3) C++11からC++20まで floating-point-type - log2(floating-point-type x); // (4) C++23 - - double log2(Integral x); // (5) C++11 - - float log2f(float x); // (6) C++17 - long double log2l(long double x); // (7) C++17 + log2(floating-point-type x); // (4) C++23 + constexpr floating-point-type + log2(floating-point-type x); // (4) C++26 + + double + log2(Integral x); // (5) C++11 + constexpr double + log2(Integral x); // (5) C++26 + + float + log2f(float x); // (6) C++17 + constexpr float + log2f(float x); // (6) C++26 + + long double + log2l(long double x); // (7) C++17 + constexpr long double + log2l(long double x); // (7) C++26 } ``` * Integral[italic] @@ -148,7 +160,7 @@ log2(32) : 5, power of 2 - [GCC](/implementation.md#gcc): 4.3.4, 4.4.5, 4.5.2, 4.6.1, 4.7.0 #### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 @@ -162,3 +174,5 @@ $$ \log_2 x = \frac{\log_e x}{\log_e 2}$$ ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/cmath/pow.md b/reference/cmath/pow.md index 2fc052767f..786a5d4c78 100644 --- a/reference/cmath/pow.md +++ b/reference/cmath/pow.md @@ -6,22 +6,53 @@ ```cpp namespace std { - float pow(float x, float y); // (1) C++03からC++20まで - double pow(double x, double y); // (2) C++03からC++20まで - long double pow(long double x, long double y); // (3) C++03からC++20まで - - float pow(float x, int y); // (4) C++03まで - double pow(double x, int y); // (5) C++03まで - long double pow(long double x, int y); // (6) C++03まで + float + pow(float x, + float y); // (1) C++03からC++20まで + double + pow(double x, + double y); // (2) C++03からC++20まで + long double + pow(long double x, + long double y); // (3) C++03からC++20まで + + float + pow(float x, + int y); // (4) C++03まで + double + pow(double x, + int y); // (5) C++03まで + long double + pow(long double x, + int y); // (6) C++03まで floating-point-type pow(floating-point-type x, - floating-point-type y); // (7) C++23 - - Promoted pow(Arithmetic1 x, Arithmetic2 y); // (8) C++11 - - float powf(float x, float y); // (9) C++17 - long double powl(long double x, long double y); // (10) C++17 + floating-point-type y); // (7) C++23 + constexpr floating-point-type + pow(floating-point-type x, + floating-point-type y); // (7) C++26 + + Promoted + pow(Arithmetic1 x, + Arithmetic2 y); // (8) C++11 + constexpr Promoted + pow(Arithmetic1 x, + Arithmetic2 y); // (8) C++26 + + float + powf(float x, + float y); // (9) C++17 + constexpr float + powf(float x, + float y); // (9) C++26 + + long double + powl(long double x, + long double y); // (10) C++17 + constexpr long double + powl(long double x, + long double y); // (10) C++26 } ``` * Promoted[italic] @@ -125,7 +156,7 @@ pow(2.0, -∞) = 0.000000 - [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 #### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 @@ -140,3 +171,5 @@ $$ x^y = e^{y \log_e x} $$ ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/cmath/sin.md b/reference/cmath/sin.md index 3b9d23e246..f149abfca0 100644 --- a/reference/cmath/sin.md +++ b/reference/cmath/sin.md @@ -6,17 +6,29 @@ ```cpp namespace std { - float sin(float x); // (1) C++03からC++20まで - double sin(double x); // (2) C++03からC++20まで - long double sin(long double x); // (3) C++03からC++20まで + float sin(float x); // (1) C++03からC++20まで + double sin(double x); // (2) C++03からC++20まで + long double sin(long double x); // (3) C++03からC++20まで floating-point-type - sin(floating-point-type x); // (4) C++23 - - double sin(Integral x); // (5) C++11 - - float sinf(float x); // (6) C++17 - long double sinl(long double x); // (7) C++17 + sin(floating-point-type x); // (4) C++23 + constexpr floating-point-type + sin(floating-point-type x); // (4) C++26 + + double + sin(Integral x); // (5) C++11 + constexpr double + sin(Integral x); // (5) C++26 + + float + sinf(float x); // (6) C++17 + constexpr float + sinf(float x); // (6) C++26 + + long double + sinl(long double x); // (7) C++17 + constexpr long double + sinl(long double x); // (7) C++26 } ``` * Integral[italic] @@ -108,7 +120,7 @@ int main() - [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 #### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 @@ -126,3 +138,5 @@ $$ \sin x = \sum_{n = 0}^{\infty} \frac{(-1)^n}{(2n + 1)!} x^{2n + 1} \quad \mat ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/cmath/sinh.md b/reference/cmath/sinh.md index 48337b7b64..0be3445468 100644 --- a/reference/cmath/sinh.md +++ b/reference/cmath/sinh.md @@ -6,17 +6,29 @@ ```cpp namespace std { - float sinh(float x); // (1) C++03からC++20まで - double sinh(double x); // (2) C++03からC++20まで - long double sinh(long double x); // (3) C++03からC++20まで + float sinh(float x); // (1) C++03からC++20まで + double sinh(double x); // (2) C++03からC++20まで + long double sinh(long double x); // (3) C++03からC++20まで floating-point-type - sinh(floating-point-type x); // (4) C++23 - - double sinh(Integral x); // (5) C++11 - - float sinhf(float x); // (6) C++17 - long double sinhl(long double x); // (7) C++17 + sinh(floating-point-type x); // (4) C++23 + constexpr floating-point-type + sinh(floating-point-type x); // (4) C++26 + + double + sinh(Integral x); // (5) C++11 + constexpr double + sinh(Integral x); // (5) C++26 + + float + sinhf(float x); // (6) C++17 + constexpr float + sinhf(float x); // (6) C++26 + + long double + sinhl(long double x); // (7) C++17 + constexpr long double + sinhl(long double x); // (7) C++26 } ``` * Integral[italic] @@ -81,7 +93,7 @@ sinh(1.0) = 1.175201 - [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 #### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 @@ -95,3 +107,5 @@ $$ \sinh x = \sum_{n = 0}^{\infty} \frac{1}{(2n + 1)!} x^{2n + 1} \quad \mathrm{ ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/cmath/sqrt.md b/reference/cmath/sqrt.md index b468598515..0b7fe0c501 100644 --- a/reference/cmath/sqrt.md +++ b/reference/cmath/sqrt.md @@ -6,17 +6,29 @@ ```cpp namespace std { - float sqrt(float x); // (1) C++03からC++20まで - double sqrt(double x); // (2) C++03からC++20まで - long double sqrt(long double x); // (3) C++03からC++20まで + float sqrt(float x); // (1) C++03からC++20まで + double sqrt(double x); // (2) C++03からC++20まで + long double sqrt(long double x); // (3) C++03からC++20まで floating-point-type - sqrt(floating-point-type x); // (4) C++23 - - double sqrt(Integral x); // (5) C++11 - - float sqrtf(float x); // (6) C++17 - long double sqrtl(long double x); // (7) C++17 + sqrt(floating-point-type x); // (4) C++23 + constexpr floating-point-type + sqrt(floating-point-type x); // (4) C++26 + + double + sqrt(Integral x); // (5) C++11 + constexpr double + sqrt(Integral x); // (5) C++26 + + float + sqrtf(float x); // (6) C++17 + constexpr float + sqrtf(float x); // (6) C++26 + + long double + sqrtl(long double x); // (7) C++17 + constexpr long double + sqrtl(long double x); // (7) C++26 } ``` * Integral[italic] @@ -96,7 +108,7 @@ sqrt(-1.0) = -nan - [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 #### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 @@ -112,3 +124,5 @@ $$ a_{n + 1} = \frac{\frac{x}{a_n} + a_n}{2} \quad \mathrm{for} \; x \geq 0 $$ ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/cmath/tan.md b/reference/cmath/tan.md index 18b7e1e639..657ad185f2 100644 --- a/reference/cmath/tan.md +++ b/reference/cmath/tan.md @@ -6,17 +6,29 @@ ```cpp namespace std { - float tan(float x); // (1) C++03からC++20まで - double tan(double x); // (2) C++03からC++20まで - long double tan(long double x); // (3) C++03からC++20まで + float tan(float x); // (1) C++03からC++20まで + double tan(double x); // (2) C++03からC++20まで + long double tan(long double x); // (3) C++03からC++20まで floating-point-type - tan(floating-point-type x); // (4) C++23 - - double tan(Integral x); // (5) C++11 - - float tanf(float x); // (6) C++17 - long double tanl(long double x); // (7) C++17 + tan(floating-point-type x); // (4) C++23 + constexpr floating-point-type + tan(floating-point-type x); // (4) C++26 + + double + tan(Integral x); // (5) C++11 + constexpr double + tan(Integral x); // (5) C++26 + + float + tanf(float x); // (6) C++17 + constexpr float + tanf(float x); // (6) C++26 + + long double + tanl(long double x); // (7) C++17 + constexpr long double + tanl(long double x); // (7) C++26 } ``` * Integral[italic] @@ -83,7 +95,7 @@ tan(pi/2) = 16331239353195370.000000 - [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 #### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 @@ -101,3 +113,5 @@ $$ \tan x = \frac{\sin x}{\cos x} $$ ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/cmath/tanh.md b/reference/cmath/tanh.md index d2ae4edd8c..3c618ea0b7 100644 --- a/reference/cmath/tanh.md +++ b/reference/cmath/tanh.md @@ -6,17 +6,29 @@ ```cpp namespace std { - float tanh(float x); // (1) C++03からC++20まで - double tanh(double x); // (2) C++03からC++20まで - long double tanh(long double x); // (3) C++03からC++20まで + float tanh(float x); // (1) C++03からC++20まで + double tanh(double x); // (2) C++03からC++20まで + long double tanh(long double x); // (3) C++03からC++20まで floating-point-type - tanh(floating-point-type x); // (4) C++23 - - double tanh(Integral x); // (5) C++11 - - float tanhf(float x); // (6) C++17 - long double tanhl(long double x); // (7) C++17 + tanh(floating-point-type x); // (4) C++23 + constexpr floating-point-type + tanh(floating-point-type x); // (4) C++26 + + double + tanh(Integral x); // (5) C++11 + constexpr double + tanh(Integral x); // (5) C++26 + + float + tanhf(float x); // (6) C++17 + constexpr float + tanhf(float x); // (6) C++26 + + long double + tanhl(long double x); // (7) C++17 + constexpr long double + tanhl(long double x); // (7) C++26 } ``` * Integral[italic] @@ -78,7 +90,8 @@ tanh(1.0) = 0.761594 - [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 #### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: + - GCC 4.6.1 以上 ## 実装例 @@ -94,3 +107,5 @@ $$ \tanh x = \frac{\sinh x}{\cosh x} $$ ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/cmath/tgamma.md b/reference/cmath/tgamma.md index 0ed6c691b7..f50e846682 100644 --- a/reference/cmath/tgamma.md +++ b/reference/cmath/tgamma.md @@ -13,11 +13,23 @@ namespace std { floating-point-type tgamma(floating-point-type x); // (4) C++23 - - double tgamma(Integral x); // (5) C++11 - - float tgammaf(float x); // (6) C++17 - long double tgammal(long double x); // (7) C++17 + constexpr floating-point-type + tgamma(floating-point-type x); // (4) C++26 + + double + tgamma(Integral x); // (5) C++11 + constexpr double + tgamma(Integral x); // (5) C++11 + + float + tgammaf(float x); // (6) C++17 + constexpr float + tgammaf(float x); // (6) C++26 + + long double + tgammal(long double x); // (7) C++17 + constexpr long double + tgammal(long double x); // (7) C++26 } ``` * Integral[italic] @@ -94,7 +106,7 @@ tgamma(+∞) = inf - [Visual C++](/implementation.md#visual_cpp): ?? #### 備考 -特定の環境で `constexpr` 指定されている場合がある。(独自拡張) +特定の環境では、早期に `constexpr` 対応されている場合がある: - GCC 4.6.1 以上 @@ -102,3 +114,5 @@ tgamma(+∞) = inf ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/complex/complex/abs.md b/reference/complex/complex/abs.md index 69f779ae0c..d49ea11fba 100644 --- a/reference/complex/complex/abs.md +++ b/reference/complex/complex/abs.md @@ -6,7 +6,11 @@ ```cpp namespace std { template - T abs(const complex& x); + T + abs(const complex& x); // (1) C++03 + template + constexpr T + abs(const complex& x); // (1) C++26 } ``` @@ -90,3 +94,8 @@ abs( (1,2) ) = 2.23607 | [`abs`](/reference/cmath/abs.md) | 絶対値を得る。(浮動小数点版) | | [`fabs`](/reference/cmath/fabs.md) | 絶対値を得る。(浮動小数点版) | | [`abs`](/reference/cstdlib/abs.md) | 絶対値を得る。(整数版) | + + +## 参照 +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/complex/complex/acos.md b/reference/complex/complex/acos.md index 46d9c9e823..cce0c2b23a 100644 --- a/reference/complex/complex/acos.md +++ b/reference/complex/complex/acos.md @@ -7,7 +7,11 @@ ```cpp namespace std { template - complex acos(const complex& x); + complex + acos(const complex& x); // (1) C++11 + template + constexpr complex + acos(const complex& x); // (1) C++26 } ``` @@ -110,3 +114,8 @@ acos( (1,2) ) = (1.14372,-1.52857) | [`tan`](tan.md) | 複素数の正接を求める。 | | [`tanh`](tanh.md) | 複素数の双曲線正接を求める。 | | [`acos`](/reference/cmath/acos.md) | 実数の逆余弦を求める。 | + + +## 参照 +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/complex/complex/acosh.md b/reference/complex/complex/acosh.md index 777195d803..4d21c8906d 100644 --- a/reference/complex/complex/acosh.md +++ b/reference/complex/complex/acosh.md @@ -7,7 +7,11 @@ ```cpp namespace std { template - complex acosh(const complex& x); + complex + acosh(const complex& x); // (1) C++11 + template + constexpr complex + acosh(const complex& x); // (1) C++26 } ``` @@ -108,3 +112,8 @@ acosh( (1,2) ) = (1.52857,1.14372) | [`tan`](tan.md) | 複素数の正接を求める。 | | [`tanh`](tanh.md) | 複素数の双曲線正接を求める。 | | [`acosh`](/reference/cmath/acosh.md) | 実数の逆双曲線余弦を求める。 | + + +## 参照 +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/complex/complex/arg.md b/reference/complex/complex/arg.md index b02461bf76..1dc6749ff6 100644 --- a/reference/complex/complex/arg.md +++ b/reference/complex/complex/arg.md @@ -6,9 +6,16 @@ ```cpp namespace std { template - T arg(const complex& x); // (1) C++03 + T + arg(const complex& x); // (1) C++03 + template + constexpr T + arg(const complex& x); // (1) C++26 - complex arg(Arithmetic x); // (2) C++11 追加のオーバーロード + complex + arg(Arithmetic x); // (2) C++11 + constexpr complex + arg(Arithmetic x); // (2) C++26 } ``` * Promoted[italic] @@ -88,3 +95,5 @@ arg( (1,2) ) = 1.10715 ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で拡張浮動小数点数型への対応が行われ、整数型も考慮されるようになった +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/complex/complex/asin.md b/reference/complex/complex/asin.md index a431d76784..bb9144bf87 100644 --- a/reference/complex/complex/asin.md +++ b/reference/complex/complex/asin.md @@ -7,7 +7,11 @@ ```cpp namespace std { template - complex asin(const complex& x); + complex + asin(const complex& x); // (1) C++11 + template + constexpr complex + asin(const complex& x); // (1) C++26 } ``` @@ -90,3 +94,8 @@ asin( (1,2) ) = (0.427079,1.52857) | [`tan`](tan.md) | 複素数の正接を求める。 | | [`tanh`](tanh.md) | 複素数の双曲線正接を求める。 | | [`asin`](/reference/cmath/asin.md) | 実数の逆正弦を求める。 | + + +## 参照 +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/complex/complex/asinh.md b/reference/complex/complex/asinh.md index f6b792eb51..573d5735c4 100644 --- a/reference/complex/complex/asinh.md +++ b/reference/complex/complex/asinh.md @@ -7,7 +7,11 @@ ```cpp namespace std { template - complex asinh(const complex& x); + complex + asinh(const complex& x); // (1) C++11 + template + constexpr complex + asinh(const complex& x); // (1) C++26 } ``` @@ -107,3 +111,8 @@ asinh( (1,2) ) = (1.46935,1.06344) | [`tan`](tan.md) | 複素数の正接を求める。 | | [`tanh`](tanh.md) | 複素数の双曲線正接を求める。 | | [`asinh`](/reference/cmath/asinh.md) | 実数の逆双曲線正弦を求める。 | + + +## 参照 +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/complex/complex/atan.md b/reference/complex/complex/atan.md index f118cfcfb9..5ef964f86a 100644 --- a/reference/complex/complex/atan.md +++ b/reference/complex/complex/atan.md @@ -7,7 +7,11 @@ ```cpp namespace std { template - complex atan(const complex& x); + complex + atan(const complex& x); // (1) C++11 + template + constexpr complex + atan(const complex& x); // (1) C++26 } ``` @@ -90,3 +94,8 @@ atan( (1,2) ) = (1.33897,0.402359) | [`tan`](tan.md) | 複素数の正接を求める。 | | [`tanh`](tanh.md) | 複素数の双曲線正接を求める。 | | [`atan`](/reference/cmath/atan.md) | 実数の逆正接を求める。 | + + +## 参照 +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/complex/complex/atanh.md b/reference/complex/complex/atanh.md index 568f5b052a..647d3a854b 100644 --- a/reference/complex/complex/atanh.md +++ b/reference/complex/complex/atanh.md @@ -7,7 +7,11 @@ ```cpp namespace std { template - complex atanh(const complex& x); + complex + atanh(const complex& x); // (1) C++11 + template + constexpr complex + atanh(const complex& x); // (1) C++26 } ``` @@ -108,3 +112,8 @@ atanh( (1,2) ) = (0.173287,1.1781) | [`tan`](tan.md) | 複素数の正接を求める。 | | [`tanh`](tanh.md) | 複素数の双曲線正接を求める。 | | [`atanh`](/reference/cmath/atanh.md) | 実数の逆双曲線正接を求める。 | + + +## 参照 +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/complex/complex/conj.md b/reference/complex/complex/conj.md index 6f3502a6ef..ef7443fa5c 100644 --- a/reference/complex/complex/conj.md +++ b/reference/complex/complex/conj.md @@ -6,12 +6,16 @@ ```cpp namespace std { template - complex conj(const complex& x); // (1) C++03 - + complex + conj(const complex& x); // (1) C++03 template - constexpr complex conj(const complex& x); // (1) C++20 + constexpr complex + conj(const complex& x); // (1) C++20 - complex conj(Arithmetic x); // (2) C++11 追加のオーバーロード + complex + conj(Arithmetic x); // (2) C++11 + constexpr complex + conj(Arithmetic x); // (2) C++26 } ``` * Promoted[italic] @@ -84,3 +88,5 @@ conj( (1,2) ) = (1,-2) - [P0415R1 Constexpr for `std::complex`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0415r1.html) - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で拡張浮動小数点数型への対応が行われ、整数型も考慮されるようになった +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で(2)が`constexpr`対応した diff --git a/reference/complex/complex/cos.md b/reference/complex/complex/cos.md index d57026ec7d..23e94c54e7 100644 --- a/reference/complex/complex/cos.md +++ b/reference/complex/complex/cos.md @@ -6,7 +6,11 @@ ```cpp namespace std { template - complex cos(const complex& x); + complex + cos(const complex& x); // (1) C++03 + template + constexpr complex + cos(const complex& x); // (1) C++26 } ``` @@ -85,3 +89,8 @@ cos( (1,2) ) = (2.03272,-3.0519) | [`tan`](tan.md) | 複素数の正接を求める。 | | [`tanh`](tanh.md) | 複素数の双曲線正接を求める。 | | [`cos`](/reference/cmath/cos.md) | 実数の余弦を求める。 | + + +## 参照 +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/complex/complex/cosh.md b/reference/complex/complex/cosh.md index ac5945fa42..7c5a5b3c8b 100644 --- a/reference/complex/complex/cosh.md +++ b/reference/complex/complex/cosh.md @@ -6,7 +6,11 @@ ```cpp namespace std { template - complex cosh(const complex& x); + complex + cosh(const complex& x); // (1) C++03 + template + constexpr complex + cosh(const complex& x); // (1) C++26 } ``` @@ -102,3 +106,8 @@ cosh( (1,2) ) = (-0.642148,1.06861) | [`tan`](tan.md) | 複素数の正接を求める。 | | [`tanh`](tanh.md) | 複素数の双曲線正接を求める。 | | [`cosh`](/reference/cmath/cosh.md) | 実数の双曲線余弦を求める。 | + + +## 参照 +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/complex/complex/exp.md b/reference/complex/complex/exp.md index 4b9a7858da..e41786c5bb 100644 --- a/reference/complex/complex/exp.md +++ b/reference/complex/complex/exp.md @@ -6,7 +6,11 @@ ```cpp namespace std { template - complex exp(const complex& x); + complex + exp(const complex& x); // (1) C++03 + template + constexpr complex + exp(const complex& x); // (1) C++26 } ``` @@ -104,3 +108,8 @@ exp( (1,2) ) = (-1.1312,2.47173) | [`tan`](tan.md) | 複素数の正接を求める。 | | [`tanh`](tanh.md) | 複素数の双曲線正接を求める。 | | [`exp`](/reference/cmath/exp.md) | 自然対数の底 e の累乗(実数)を求める。 | + + +## 参照 +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/complex/complex/imag_free.md b/reference/complex/complex/imag_free.md index 98a3e498bd..486c8f8f72 100644 --- a/reference/complex/complex/imag_free.md +++ b/reference/complex/complex/imag_free.md @@ -11,9 +11,9 @@ namespace std { constexpr T imag(const complex& x); // (1) C++14 complex - imag(Arithmetic x); // (2) C++11 追加のオーバーロード + imag(Arithmetic x); // (2) C++11 constexpr complex - imag(Arithmetic x); // (2) C++14 追加のオーバーロード + imag(Arithmetic x); // (2) C++26 } ``` * Promoted[italic] @@ -99,3 +99,5 @@ int main() - [N3302 Constexpr Library Additions: complex, v2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3302.html) - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で拡張浮動小数点数型への対応が行われ、整数型も考慮されるようになった +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で(2)が`constexpr`対応した diff --git a/reference/complex/complex/log.md b/reference/complex/complex/log.md index 33bf4de584..d8ae510873 100644 --- a/reference/complex/complex/log.md +++ b/reference/complex/complex/log.md @@ -6,7 +6,11 @@ ```cpp namespace std { template - complex log(const complex& x); + complex + log(const complex& x); // (1) C++03 + template + constexpr complex + log(const complex& x); // (1) C++26 } ``` @@ -106,3 +110,8 @@ log( (1,2) ) = (0.804719,1.10715) | [`tan`](tan.md) | 複素数の正接を求める。 | | [`tanh`](tanh.md) | 複素数の双曲線正接を求める。 | | [`log`](/reference/cmath/log.md) | 実数の自然対数を求める。 | + + +## 参照 +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/complex/complex/log10.md b/reference/complex/complex/log10.md index de363ba303..97c43987fb 100644 --- a/reference/complex/complex/log10.md +++ b/reference/complex/complex/log10.md @@ -6,7 +6,11 @@ ```cpp namespace std { template - complex log10(const complex& x); + complex + log10(const complex& x); // (1) C++03 + template + constexpr complex + log10(const complex& x); // (1) C++26 } ``` @@ -84,3 +88,8 @@ log10( (1,2) ) = (0.349485,0.480829) | [`tan`](tan.md) | 複素数の正接を求める。 | | [`tanh`](tanh.md) | 複素数の双曲線正接を求める。 | | [`log10`](/reference/cmath/log10.md) | 実数の常用対数を求める。 | + + +## 参照 +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/complex/complex/norm.md b/reference/complex/complex/norm.md index 6406d40f85..244cb4675a 100644 --- a/reference/complex/complex/norm.md +++ b/reference/complex/complex/norm.md @@ -6,12 +6,16 @@ ```cpp namespace std { template - T norm(const complex& x); // (1) C++03 - + T + norm(const complex& x); // (1) C++03 template - constexpr T norm(const complex& x); // (1) C++20 + constexpr T + norm(const complex& x); // (1) C++20 - complex norm(Arithmetic x); // (2) C++11 追加のオーバーロード + complex + norm(Arithmetic x); // (2) C++11 + constexpr complex + norm(Arithmetic x); // (2) C++26 } ``` * Promoted[italic] @@ -91,3 +95,5 @@ norm( (1,2) ) = 5 - [P0415R1 Constexpr for `std::complex`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0415r1.html) - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で拡張浮動小数点数型への対応が行われ、整数型も考慮されるようになった +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で(2)が`constexpr`対応した diff --git a/reference/complex/complex/polar.md b/reference/complex/complex/polar.md index 158cc5674e..7d9f91bbab 100644 --- a/reference/complex/complex/polar.md +++ b/reference/complex/complex/polar.md @@ -6,7 +6,13 @@ ```cpp namespace std { template - complex polar(const T& rho, const T& theta = 0); + complex + polar(const T& rho, + const T& theta = 0); // (1) C++03 + template + constexpr complex + polar(const T& rho, + const T& theta = 0); // (1) C++26 } ``` @@ -70,3 +76,8 @@ polar(1.0, pi / 4.0) = (0.707107,0.707107) | [`norm`](norm.md) | 複素数体のノルムを得る。 | | [`conj`](conj.md) | 共役複素数を得る。 | | [`proj`](proj.md) | リーマン球面への射影を得る。 | + + +## 参照 +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/complex/complex/pow.md b/reference/complex/complex/pow.md index ada29ac862..b5352ff2bf 100644 --- a/reference/complex/complex/pow.md +++ b/reference/complex/complex/pow.md @@ -9,16 +9,28 @@ namespace std { complex pow(const complex& x, const complex& y); // (1) C++03 + template + constexpr complex + pow(const complex& x, + const complex& y); // (1) C++26 template complex pow(const complex& x, const T& y); // (2) C++03 + template + constexpr complex + pow(const complex& x, + const T& y); // (2) C++26 template complex pow(const T& x, const complex& y); // (3) C++03 + template + constexpr complex + pow(const T& x, + const complex& y); // (3) C++26 template complex @@ -27,7 +39,10 @@ namespace std { complex pow(ArithmeticOrComplex1 x, - ArithmeticOrComplex2 y); // (5) C++11 追加のオーバーロード + ArithmeticOrComplex2 y); // (5) C++11 + constexpr complex + pow(ArithmeticOrComplex1 x, + ArithmeticOrComplex2 y); // (5) C++26 } ``` * Promoted[italic] @@ -138,3 +153,5 @@ pow( (1,2), (3,4) ) = (0.12901,0.0339241) ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で拡張浮動小数点数型への対応が行われた +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/complex/complex/proj.md b/reference/complex/complex/proj.md index e2d8119442..e395b6bc1d 100644 --- a/reference/complex/complex/proj.md +++ b/reference/complex/complex/proj.md @@ -7,9 +7,16 @@ ```cpp namespace std { template - complex proj(const complex& x); // (1) C++11 + complex + proj(const complex& x); // (1) C++11 + template + constexpr complex + proj(const complex& x); // (1) C++26 - complex proj(Arithmetic x); // (2) C++11 追加のオーバーロード + complex + proj(Arithmetic x); // (2) C++11 + constexpr complex + proj(Arithmetic x); // (2) C++26 } ``` * Promoted[italic] @@ -119,3 +126,5 @@ proj( (nan,-inf) ) = (inf,-0) - [LWG Issue 781. `std::complex` should add missing C99 functions](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#781) - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で拡張浮動小数点数型への対応が行われ、整数型も考慮されるようになった +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/complex/complex/real_free.md b/reference/complex/complex/real_free.md index bd5f8876c6..24508361a0 100644 --- a/reference/complex/complex/real_free.md +++ b/reference/complex/complex/real_free.md @@ -6,14 +6,16 @@ ```cpp namespace std { template - T real(const complex& x); // (1) C++03 + T + real(const complex& x); // (1) C++03 template - constexpr T real(const complex& x); // (1) C++14 + constexpr T + real(const complex& x); // (1) C++14 complex - real(Arithmetic x); // (2) C++11 追加のオーバーロード + real(Arithmetic x); // (2) C++11 constexpr complex - real(Arithmetic x); // (2) C++14 追加のオーバーロード + real(Arithmetic x); // (2) C++26 } ``` * Promoted[italic] @@ -99,3 +101,5 @@ int main() - [N3302 Constexpr Library Additions: complex, v2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3302.html) - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で拡張浮動小数点数型への対応が行われ、整数型も考慮されるようになった +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で(2)が`constexpr`対応した diff --git a/reference/complex/complex/sin.md b/reference/complex/complex/sin.md index 4c261b6022..f33626e480 100644 --- a/reference/complex/complex/sin.md +++ b/reference/complex/complex/sin.md @@ -6,7 +6,11 @@ ```cpp namespace std { template - complex sin(const complex& x); + complex + sin(const complex& x); // (1) C++03 + template + constexpr complex + sin(const complex& x); // (1) C++26 } ``` @@ -85,3 +89,8 @@ sin( (1,2) ) = (3.16578,1.9596) | [`tan`](tan.md) | 複素数の正接を求める。 | | [`tanh`](tanh.md) | 複素数の双曲線正接を求める。 | | [`sin`](/reference/cmath/sin.md) | 実数の正弦を求める。 | + + +## 参照 +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/complex/complex/sinh.md b/reference/complex/complex/sinh.md index 83c6b8004a..180e77b34b 100644 --- a/reference/complex/complex/sinh.md +++ b/reference/complex/complex/sinh.md @@ -6,7 +6,11 @@ ```cpp namespace std { template - complex sinh(const complex& x); + complex + sinh(const complex& x); // (1) C++03 + template + constexpr complex + sinh(const complex& x); // (1) C++26 } ``` @@ -102,3 +106,8 @@ sinh( (1,2) ) = (-0.489056,1.40312) | [`tan`](tan.md) | 複素数の正接を求める。 | | [`tanh`](tanh.md) | 複素数の双曲線正接を求める。 | | [`sinh`](/reference/cmath/sinh.md) | 実数の双曲線正弦を求める。 | + + +## 参照 +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/complex/complex/sqrt.md b/reference/complex/complex/sqrt.md index e1715b6d04..f1e1034dfc 100644 --- a/reference/complex/complex/sqrt.md +++ b/reference/complex/complex/sqrt.md @@ -7,7 +7,11 @@ ```cpp namespace std { template - complex sqrt(const complex& x); + complex + sqrt(const complex& x); // (1) C++03 + template + constexpr complex + sqrt(const complex& x); // (1) C++26 } ``` @@ -125,3 +129,8 @@ sqrt(-1.0 - 1.0i) = (0.45509,-1.09868) | [`tan`](tan.md) | 複素数の正接を求める。 | | [`tanh`](tanh.md) | 複素数の双曲線正接を求める。 | | [`sqrt`](/reference/cmath/sqrt.md) | 実数の平方根を求める。 | + + +## 参照 +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/complex/complex/tan.md b/reference/complex/complex/tan.md index 95be8f7360..bc3a34bd24 100644 --- a/reference/complex/complex/tan.md +++ b/reference/complex/complex/tan.md @@ -6,7 +6,11 @@ ```cpp namespace std { template - complex tan(const complex& x); + complex + tan(const complex& x); // (1) C++03 + template + constexpr complex + tan(const complex& x); // (1) C++26 } ``` @@ -85,3 +89,8 @@ tan( (1,2) ) = (0.0338128,1.01479) | [`sqrt`](sqrt.md) | 複素数の平方根を求める。 | | [`tanh`](tanh.md) | 複素数の双曲線正接を求める。 | | [`tan`](/reference/cmath/tan.md) | 実数の正接を求める。 | + + +## 参照 +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した diff --git a/reference/complex/complex/tanh.md b/reference/complex/complex/tanh.md index 7934cdba8f..ee06c23dd6 100644 --- a/reference/complex/complex/tanh.md +++ b/reference/complex/complex/tanh.md @@ -6,7 +6,11 @@ ```cpp namespace std { template - complex tanh(const complex& x); + complex + tanh(const complex& x); // (1) C++03 + template + constexpr complex + tanh(const complex& x); // (1) C++26 } ``` @@ -100,3 +104,8 @@ tanh( (1,2) ) = (1.16674,-0.243458) | [`sqrt`](sqrt.md) | 複素数の平方根を求める。 | | [`tan`](tan.md) | 複素数の正接を求める。 | | [`tanh`](/reference/cmath/tanh.md) | 実数の双曲線正接を求める。 | + + +## 参照 +- [P1383R2 More constexpr for `` and ``](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1383r2.pdf) + - C++26で`constexpr`対応した From c44afe1f24b02b373dc591f64569073f61302882 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 23 Jan 2024 17:09:00 +0900 Subject: [PATCH 0661/3948] =?UTF-8?q?LWG=20Issue=203305=E9=81=A9=E7=94=A8?= =?UTF-8?q?=EF=BC=88P3040R0=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/any/any_cast.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/reference/any/any_cast.md b/reference/any/any_cast.md index 1ed3b6b127..74593c4b45 100644 --- a/reference/any/any_cast.md +++ b/reference/any/any_cast.md @@ -31,13 +31,14 @@ namespace std { - (4), (5) : `std::any`オブジェクトが保持している型を指定して、その値を指すポインタを取得する。型の指定を間違った場合はヌルポインタが返る -## 要件 +## 適格要件 `using U =` [`remove_cv_t`](/reference/type_traits/remove_cv.md)`<`[`remove_reference_t`](/reference/type_traits/remove_reference.md)`>;`であるとして、 - (1) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true`であること。そうでない場合、プログラムは不適格となる - (2) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true`であること。そうでない場合、プログラムは不適格となる - (3) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true`であること。そうでない場合、プログラムは不適格となる - +- (4)(5) : [`is_void_v`](/reference/type_traits/is_void.md)` == false`であること + - C++26から ## 効果 `using U =` [`remove_cv_t`](/reference/type_traits/remove_cv.md)`<`[`remove_reference_t`](/reference/type_traits/remove_reference.md)`>;`であるとして、 @@ -148,3 +149,7 @@ int main() - [Clang](/implementation.md#clang): 4.0.1 - [GCC](/implementation.md#gcc): 7.3 - [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 + +- [LWG Issue 3305. `any_cast`](https://cplusplus.github.io/LWG/issue3305) \ No newline at end of file From 2ed0e77dd4664cc1371fbb07d3ac4bd8bc4d8599 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 23 Jan 2024 17:15:56 +0900 Subject: [PATCH 0662/3948] =?UTF-8?q?LWG=20Issue=203749=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=EF=BC=88P3040R0=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/common_iterator.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reference/iterator/common_iterator.md b/reference/iterator/common_iterator.md index 22eefeb3f0..9b94324ea1 100644 --- a/reference/iterator/common_iterator.md +++ b/reference/iterator/common_iterator.md @@ -25,7 +25,7 @@ namespace std { template struct iterator_traits> { using iterator_concept = /*see below*/; - using iterator_category = /*see below*/; + using iterator_category = /*see below*/; // 定義されない場合がある using value_type = iter_value_t; using difference_type = iter_difference_t; using pointer = /*see below*/; @@ -80,6 +80,7 @@ namespace std { | `pointer` | `void`
ただし、[`operator->`](common_iterator/op_arrow.md)が利用可能である場合はその戻り値型 | C++20 | | `reference` | [`iter_reference_t`](/reference/iterator/iter_reference_t.md)`` | C++20 | +- `iterator_category`は`iter_difference_t`が組み込みの整数型の場合にのみ定義される([*integer-class*](/reference/iterator/is_integer_like.md)型の場合には定義されない) ## 例 @@ -147,3 +148,4 @@ int main() { ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) - [Hidden Friends - yohhoyの日記](https://yohhoy.hatenadiary.jp/entry/20190531/p1) +- [LWG Issue 3749. `common_iterator` should handle integer-class difference types](https://cplusplus.github.io/LWG/issue3749) \ No newline at end of file From ce48adc1e50a85ee72cf65a5846f4717e575c4d2 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 23 Jan 2024 17:29:18 +0900 Subject: [PATCH 0663/3948] =?UTF-8?q?LWG=20Issue=203897=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=EF=BC=88P3040R0=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/memory/inout_ptr_t/op_destructor.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/reference/memory/inout_ptr_t/op_destructor.md b/reference/memory/inout_ptr_t/op_destructor.md index 80c1d2c3d4..e7428512a1 100644 --- a/reference/memory/inout_ptr_t/op_destructor.md +++ b/reference/memory/inout_ptr_t/op_destructor.md @@ -34,10 +34,8 @@ - [`is_pointer_v`](/reference/type_traits/is_pointer.md)``が`true`ならば、 ```cpp - if (p) { - apply([&](auto&&... args) { - s = Smart(static_cast(p), std::forward(args)...); }, std::move(a)); - } + apply([&](auto&&... args) { + s = Smart(static_cast(p), std::forward(args)...); }, std::move(a)); ``` - 式 `s.reset(static_cast(p),` [`std::forward`](/reference/utility/forward.md)`(args)...)` が適格ならば、 @@ -85,3 +83,4 @@ ## 参照 - [P1132R8 out_ptr - a scalable output pointer abstraction](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1132r8.html) +- [LWG Issue 3897. `inout_ptr` will not update raw pointer to 0](https://cplusplus.github.io/LWG/issue3897) From cfedf6d21d4ee52c2aa645e7fb9f75b3e8c75ba7 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 23 Jan 2024 17:42:24 +0900 Subject: [PATCH 0664/3948] =?UTF-8?q?LWG=20Issue=203946=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=EF=BC=88P3040R0=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/const_iterator_t.md | 7 ++++--- reference/ranges/const_sentinel_t.md | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/reference/ranges/const_iterator_t.md b/reference/ranges/const_iterator_t.md index d2ecc3fd72..183bca235e 100644 --- a/reference/ranges/const_iterator_t.md +++ b/reference/ranges/const_iterator_t.md @@ -7,12 +7,12 @@ ```cpp namespace std::ranges { template - using const_iterator_t = const_iterator>; + using const_iterator_t = decltype(ranges::cbegin(declval())); } ``` * range[link range.md] -* const_iterator[link /reference/iterator/const_iterator.md] -* iterator_t[link iterator_t.md] +* cbegin[link cbegin.md] +* declval[link /reference/utility/declval.md] ## 概要 @@ -47,3 +47,4 @@ int main() { ## 参照 - [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) +- [LWG Issue 3946. The definition of `const_iterator_t` should be reworked](https://cplusplus.github.io/LWG/issue3946) diff --git a/reference/ranges/const_sentinel_t.md b/reference/ranges/const_sentinel_t.md index 086fe5e1b6..e0ef6c9c88 100644 --- a/reference/ranges/const_sentinel_t.md +++ b/reference/ranges/const_sentinel_t.md @@ -7,12 +7,12 @@ ```cpp namespace std::ranges { template - using const_sentinel_t = const_sentinel>; + using const_sentinel_t = decltype(ranges::cend(declval())); } ``` * range[link range.md] -* const_sentinel[link /reference/iterator/const_sentinel.md] -* sentinel_t[link sentinel_t.md] +* cend[link cend.md] +* declval[link /reference/utility/declval.md] ## 概要 @@ -51,3 +51,4 @@ int main() { ## 参照 - [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) +- [LWG Issue 3946. The definition of `const_iterator_t` should be reworked](https://cplusplus.github.io/LWG/issue3946) From fdb5ec5326df252b737be4aa9f6c276943949470 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 23 Jan 2024 18:05:56 +0900 Subject: [PATCH 0665/3948] =?UTF-8?q?LWG=20Issue=203809=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=EF=BC=88P3040R0=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/random/subtract_with_carry_engine.md | 2 ++ .../random/subtract_with_carry_engine/op_constructor.md | 8 ++++++-- reference/random/subtract_with_carry_engine/seed.md | 7 +++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/reference/random/subtract_with_carry_engine.md b/reference/random/subtract_with_carry_engine.md index d3b8d04a82..241dbef1c5 100644 --- a/reference/random/subtract_with_carry_engine.md +++ b/reference/random/subtract_with_carry_engine.md @@ -83,6 +83,7 @@ namespace std { | `static constexpr size_t short_lag` | 短いラグ。進める要素数。テンプレートパラメータ`s`。 | C++11 | | `static constexpr size_t long_lag` | 長いラグ。オペランドの値間の距離。テンプレートパラメータ`r`。 | C++11 | | `static constexpr result_type default_seed` | デフォルトのシード値。`19780503u` | C++11 | +| `static constexpr uint_least32_t default_seed` | デフォルトのシード値。`19780503u` | C++26 | ## 非メンバ関数 @@ -150,3 +151,4 @@ int main() - [Subtract with carry - Wikipedia](https://en.wikipedia.org/wiki/Subtract_with_carry) - [A New Class of Random Number Generators](http://projecteuclid.org/DPubS?service=UI&version=1.0&verb=Display&handle=euclid.aoap/1177005878), George Marsaglia and Arif Zaman, The Annals of Applied Probability, Vol. 1, No. 3, 1991 - [M. Matsumoto, et al., Common Defects in Initialization of Pseudorandom Number Generators, *ACM Trans. Model. Comput. Simul.* **17**, 15 (2007)](https://doi.org/10.1145/1276927.1276928) +- [LWG Issue 3809. Is `std::subtract_with_carry_engine` supposed to work?](https://cplusplus.github.io/LWG/issue3809) diff --git a/reference/random/subtract_with_carry_engine/op_constructor.md b/reference/random/subtract_with_carry_engine/op_constructor.md index 647aa85bf7..355dce826d 100644 --- a/reference/random/subtract_with_carry_engine/op_constructor.md +++ b/reference/random/subtract_with_carry_engine/op_constructor.md @@ -9,6 +9,7 @@ ```cpp explicit subtract_with_carry_engine(result_type value = default_seed); // (1) subtract_with_carry_engine() : subtract_with_carry_engine(default_seed) {} // (1) C++20 +subtract_with_carry_engine() : subtract_with_carry_engine(0u) {} // (1) C++26 explicit subtract_with_carry_engine(result_type value); // (2) C++20 @@ -23,8 +24,10 @@ subtract_with_carry_engine(subtract_with_carry_engine&& e) = default; // (5 - (1) : デフォルトコンストラクタ - C++17まで:シード値が指定されない場合はデフォルトのシード値 (`subtract_with_carry_engine::default_seed`) で構築される - [`linear_congruential_engine`](../linear_congruential_engine.md) を $n = \lceil 32 / \mathtt{w} \rceil$ 回 (`w` は `subtract_with_carry_engine::word_size`) 呼び出して内部状態を初期化する - - C++20 : デフォルトのシード値 (`mersenne_twister_engine::default_seed`) で(2)に委譲 + - C++20から : デフォルトのシード値 (`subtract_with_carry_engine::default_seed`) で(2)に委譲 + - C++26から : シード値を`0u`として(2)に委譲 - (2) : シード値を受け取って状態シーケンスを構築する + - `value == 0`なら、デフォルトのシード値 (`subtract_with_carry_engine::default_seed`) が使用される - [`linear_congruential_engine`](../linear_congruential_engine.md) を $n = \lceil 32 / \mathtt{w} \rceil$ 回 (`w` は `subtract_with_carry_engine::word_size`) 呼び出して内部状態を初期化する - (3) : シードのシーケンスを受け取って状態シーケンスを構築する - (4) : コピーコンストラクタ。状態シーケンスをコピーする @@ -108,4 +111,5 @@ int main() ## 参照 -- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) \ No newline at end of file +- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) +- [LWG Issue 3809. Is `std::subtract_with_carry_engine` supposed to work?](https://cplusplus.github.io/LWG/issue3809) diff --git a/reference/random/subtract_with_carry_engine/seed.md b/reference/random/subtract_with_carry_engine/seed.md index a3ed4efcb1..07a5699e57 100644 --- a/reference/random/subtract_with_carry_engine/seed.md +++ b/reference/random/subtract_with_carry_engine/seed.md @@ -7,7 +7,10 @@ ```cpp void seed(result_type value = default_seed); // (1) -template void seed(Sseq& q); // (2) +void seed(result_type value = 0u); // (1) C++26 + +template +void seed(Sseq& q); // (2) ``` ## 概要 @@ -109,4 +112,4 @@ int main() ## 参照 - +- [LWG Issue 3809. Is `std::subtract_with_carry_engine` supposed to work?](https://cplusplus.github.io/LWG/issue3809) From 06c0c0060793e5d72690a5cc69ceaa7340439743 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 23 Jan 2024 18:08:04 +0900 Subject: [PATCH 0666/3948] =?UTF-8?q?LWG=20Issue=203948=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=EF=BC=88P3040R0=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/cdata.md | 3 ++- reference/ranges/possibly-const-range.md | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/reference/ranges/cdata.md b/reference/ranges/cdata.md index 4bf0e27bf3..1399209172 100644 --- a/reference/ranges/cdata.md +++ b/reference/ranges/cdata.md @@ -27,7 +27,7 @@ Rangeの要素が格納されたメモリ領域へのポインタを取得する - `as-const-pointer`は次のような説明専用関数テンプレートである ```cpp template - constexpr auto as-const-pointer(const T* p) { return p; } + constexpr auto as-const-pointer(const T* p) noexcept { return p; } ``` ## 戻り値 @@ -81,3 +81,4 @@ array size:1 at 0x556ec23ba2b0 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) - [C++20 ranges](https://techbookfest.org/product/5134506308665344) - [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) +- [LWG Issue 3948. `possibly-const-range` and `as-const-pointer` should be `noexcept`](https://cplusplus.github.io/LWG/issue3948) diff --git a/reference/ranges/possibly-const-range.md b/reference/ranges/possibly-const-range.md index 8a921c7fdb..5911d11bfc 100644 --- a/reference/ranges/possibly-const-range.md +++ b/reference/ranges/possibly-const-range.md @@ -7,7 +7,7 @@ ```cpp namespace std::ranges { template - constexpr auto& possibly-const-range(R& r) { + constexpr auto& possibly-const-range(R& r) noexcept { if constexpr (constant_range && !constant_range) { return const_cast(r); } else { @@ -33,3 +33,4 @@ namespace std::ranges { ## 参照 - [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) +- [LWG Issue 3948. `possibly-const-range` and `as-const-pointer` should be `noexcept`](https://cplusplus.github.io/LWG/issue3948) From 52a8ab142e76e8f530f5397d3e544503e01a8182 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 23 Jan 2024 18:14:07 +0900 Subject: [PATCH 0667/3948] =?UTF-8?q?C++26=E5=AF=BE=E5=BF=9C=E3=81=A8?= =?UTF-8?q?=E3=81=97=E3=81=A6=E3=83=A9=E3=82=A4=E3=83=96=E3=83=A9?= =?UTF-8?q?=E3=83=AA=E3=82=92=E5=89=8A=E9=99=A4=20(close=20#1243)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/codecvt.md | 6 ++++-- reference/codecvt/codecvt_mode.md | 6 ++++-- reference/codecvt/codecvt_utf16.md | 6 ++++-- reference/codecvt/codecvt_utf8.md | 6 ++++-- reference/codecvt/codecvt_utf8_utf16.md | 6 ++++-- 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/reference/codecvt.md b/reference/codecvt.md index 33c339a8b8..b89b07020e 100644 --- a/reference/codecvt.md +++ b/reference/codecvt.md @@ -2,6 +2,7 @@ * codecvt[meta header] * cpp11[meta cpp] * cpp17deprecated[meta cpp] +* cpp26removed[meta cpp] ``ヘッダでは、文字コード変換のためのファセットクラスを定義する。 @@ -13,12 +14,12 @@ | [`codecvt_utf8_utf16`](codecvt/codecvt_utf8_utf16.md) | UTF-8とUTF-16間での文字コード変換(class template) | C++11
C++17から非推奨 | -## 非推奨の詳細 +## 非推奨・削除の詳細 Unicodeの文字コード変換を行うこれらのクラスは、不正なコードポイントに対する安全なエラー処理の方法を提供していなかったため、セキュリティ上の欠陥があった。 仕様もあいまいであったため、不正なコードポイントに対してどのように振る舞うかも不明であった。 -Unicode以外のShift_JISやBig5といった文字コードの利用は急激に減少している。標準ライブラリでの現代的なUnicodeの変換機能は非常に必要とされているが、``の設計はお粗末なものだった。将来より良いものを作るために、これらの機能は非推奨とする。 +Unicode以外のShift_JISやBig5といった文字コードの利用は急激に減少している。標準ライブラリでの現代的なUnicodeの変換機能は非常に必要とされているが、``の設計はお粗末なものだった。将来より良いものを作るために、これらの機能は非推奨・削除とする。 標準ライブラリにUnicodeの文字コード変換をする代替機能はないため、他の専門特化した文字コード変換のライブラリを使用すること。 @@ -30,3 +31,4 @@ Unicode以外のShift_JISやBig5といった文字コードの利用は急激に ## 参照 - [P0618R0 Deprecating ``](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0618r0.html) +- [P2871R3 Remove Deprecated Unicode Conversion Facets from C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2871r3.pdf) diff --git a/reference/codecvt/codecvt_mode.md b/reference/codecvt/codecvt_mode.md index fcc7d069ab..241143f534 100644 --- a/reference/codecvt/codecvt_mode.md +++ b/reference/codecvt/codecvt_mode.md @@ -4,6 +4,7 @@ * enum[meta id-type] * cpp11[meta cpp] * cpp17deprecated[meta cpp] +* cpp26removed[meta cpp] ```cpp namespace std { @@ -31,12 +32,12 @@ namespace std { - [`codecvt_utf8_utf16`](codecvt_utf8_utf16.md) -## 非推奨の詳細 +## 非推奨・削除の詳細 Unicodeの文字コード変換を行うこれらのクラスは、不正なコードポイントに対する安全なエラー処理の方法を提供していなかったため、セキュリティ上の欠陥があった。 仕様もあいまいであったため、不正なコードポイントに対してどのように振る舞うかも不明であった。 -Unicode以外のShift_JISやBig5といった文字コードの利用が急激に減少している。標準ライブラリでの現代的なUnicodeの変換機能は非常に必要とされているが、``の設計はお粗末なものだった。将来より良いものを作るために、これらの機能は非推奨とする。 +Unicode以外のShift_JISやBig5といった文字コードの利用が急激に減少している。標準ライブラリでの現代的なUnicodeの変換機能は非常に必要とされているが、``の設計はお粗末なものだった。将来より良いものを作るために、これらの機能は非推奨・削除とする。 標準ライブラリにUnicodeの文字コード変換をする代替機能はないため、他の専門特化した文字コード変換のライブラリを使用すること。 @@ -53,3 +54,4 @@ Unicode以外のShift_JISやBig5といった文字コードの利用が急激に ## 参照 - [P0618R0 Deprecating ``](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0618r0.html) +- [P2871R3 Remove Deprecated Unicode Conversion Facets from C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2871r3.pdf) diff --git a/reference/codecvt/codecvt_utf16.md b/reference/codecvt/codecvt_utf16.md index c16c19952c..0ee5fa8be0 100644 --- a/reference/codecvt/codecvt_utf16.md +++ b/reference/codecvt/codecvt_utf16.md @@ -4,6 +4,7 @@ * class template[meta id-type] * cpp11[meta cpp] * cpp17deprecated[meta cpp] +* cpp26removed[meta cpp] ```cpp namespace std { @@ -26,12 +27,12 @@ UTF-16との変換を行うファセットクラス。`char`列と`Elem`列と BOMの有無やエンディアンなどを[`codecvt_mode`](codecvt_mode.md)で指定できる。 -## 非推奨の詳細 +## 非推奨・削除の詳細 Unicodeの文字コード変換を行うこれらのクラスは、不正なコードポイントに対する安全なエラー処理の方法を提供していなかったため、セキュリティ上の欠陥があった。 仕様もあいまいであったため、不正なコードポイントに対してどのように振る舞うかも不明であった。 -Unicode以外のShift_JISやBig5といった文字コードの利用が急激に減少している。標準ライブラリでの現代的なUnicodeの変換機能は非常に必要とされているが、``の設計はお粗末なものだった。将来より良いものを作るために、これらの機能は非推奨とする。 +Unicode以外のShift_JISやBig5といった文字コードの利用が急激に減少している。標準ライブラリでの現代的なUnicodeの変換機能は非常に必要とされているが、``の設計はお粗末なものだった。将来より良いものを作るために、これらの機能は非推奨・削除とする。 標準ライブラリにUnicodeの文字コード変換をする代替機能はないため、他の専門特化した文字コード変換のライブラリを使用すること。 @@ -92,3 +93,4 @@ int main() ## 参照 - [N2401 Code Conversion Facets for the Standard C++ Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2401.htm) - [P0618R0 Deprecating ``](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0618r0.html) +- [P2871R3 Remove Deprecated Unicode Conversion Facets from C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2871r3.pdf) diff --git a/reference/codecvt/codecvt_utf8.md b/reference/codecvt/codecvt_utf8.md index a3c6fc717d..0f6edc1df3 100644 --- a/reference/codecvt/codecvt_utf8.md +++ b/reference/codecvt/codecvt_utf8.md @@ -4,6 +4,7 @@ * class template[meta id-type] * cpp11[meta cpp] * cpp17deprecated[meta cpp] +* cpp26removed[meta cpp] ```cpp namespace std { @@ -26,12 +27,12 @@ UTF-8との変換を行うファセットクラス。`char`列と`Elem`列との BOMの有無を[`codecvt_mode`](codecvt_mode.md)で指定できる。 -## 非推奨の詳細 +## 非推奨・削除の詳細 Unicodeの文字コード変換を行うこれらのクラスは、不正なコードポイントに対する安全なエラー処理の方法を提供していなかったため、セキュリティ上の欠陥があった。 仕様もあいまいであったため、不正なコードポイントに対してどのように振る舞うかも不明であった。 -Unicode以外のShift_JISやBig5といった文字コードの利用が急激に減少している。標準ライブラリでの現代的なUnicodeの変換機能は非常に必要とされているが、``の設計はお粗末なものだった。将来より良いものを作るために、これらの機能は非推奨とする。 +Unicode以外のShift_JISやBig5といった文字コードの利用が急激に減少している。標準ライブラリでの現代的なUnicodeの変換機能は非常に必要とされているが、``の設計はお粗末なものだった。将来より良いものを作るために、これらの機能は非推奨・削除とする。 標準ライブラリにUnicodeの文字コード変換をする代替機能はないため、他の専門特化した文字コード変換のライブラリを使用すること。 @@ -92,3 +93,4 @@ int main() ## 参照 - [N2401 Code Conversion Facets for the Standard C++ Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2401.htm) - [P0618R0 Deprecating ``](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0618r0.html) +- [P2871R3 Remove Deprecated Unicode Conversion Facets from C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2871r3.pdf) diff --git a/reference/codecvt/codecvt_utf8_utf16.md b/reference/codecvt/codecvt_utf8_utf16.md index 045c111221..4095d4a892 100644 --- a/reference/codecvt/codecvt_utf8_utf16.md +++ b/reference/codecvt/codecvt_utf8_utf16.md @@ -4,6 +4,7 @@ * class template[meta id-type] * cpp11[meta cpp] * cpp17deprecated[meta cpp] +* cpp26removed[meta cpp] ```cpp namespace std { @@ -26,12 +27,12 @@ UTF-8とUTF-16との変換を行うファセットクラス。`char`列と`Elem` UTF-8文字列におけるBOMの有無を[`codecvt_mode`](codecvt_mode.md)で指定できる。 -## 非推奨の詳細 +## 非推奨・削除の詳細 Unicodeの文字コード変換を行うこれらのクラスは、不正なコードポイントに対する安全なエラー処理の方法を提供していなかったため、セキュリティ上の欠陥があった。 仕様もあいまいであったため、不正なコードポイントに対してどのように振る舞うかも不明であった。 -Unicode以外のShift_JISやBig5といった文字コードの利用が急激に減少している。標準ライブラリでの現代的なUnicodeの変換機能は非常に必要とされているが、``の設計はお粗末なものだった。将来より良いものを作るために、これらの機能は非推奨とする。 +Unicode以外のShift_JISやBig5といった文字コードの利用が急激に減少している。標準ライブラリでの現代的なUnicodeの変換機能は非常に必要とされているが、``の設計はお粗末なものだった。将来より良いものを作るために、これらの機能は非推奨・削除とする。 標準ライブラリにUnicodeの文字コード変換をする代替機能はないため、他の専門特化した文字コード変換のライブラリを使用すること。 @@ -92,3 +93,4 @@ int main() ## 参照 - [N2401 Code Conversion Facets for the Standard C++ Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2401.htm) - [P0618R0 Deprecating ``](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0618r0.html) +- [P2871R3 Remove Deprecated Unicode Conversion Facets from C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2871r3.pdf) From 013028f2cef7509570f8018a8192190eb75711bb Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 23 Jan 2024 18:17:33 +0900 Subject: [PATCH 0668/3948] =?UTF-8?q?LWG=20Issue=203953=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=EF=BC=88P3040R0=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/common_iterator/iter_move.md | 4 ++-- reference/iterator/counted_iterator/iter_move.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/iterator/common_iterator/iter_move.md b/reference/iterator/common_iterator/iter_move.md index 6dd5a362dd..f2afd766a6 100644 --- a/reference/iterator/common_iterator/iter_move.md +++ b/reference/iterator/common_iterator/iter_move.md @@ -10,7 +10,7 @@ namespace std { template S> class common_iterator { - friend iter_rvalue_reference_t iter_move(const common_iterator& i) + friend decltype(auto) iter_move(const common_iterator& i) noexcept(noexcept(ranges::iter_move(declval()))) requires input_iterator; }; @@ -18,7 +18,6 @@ namespace std { ``` * input_or_output_iterator[link /reference/iterator/input_or_output_iterator.md] * sentinel_for[link /reference/iterator/sentinel_for.md] -* iter_rvalue_reference_t[link /reference/iterator/iter_rvalue_reference_t.md] * ranges::iter_move[link /reference/iterator/iter_move.md] * input_iterator[link /reference/iterator/input_iterator.md] @@ -94,3 +93,4 @@ int main() { ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [LWG Issue 3953. `iter_move` for `common_iterator` and `counted_iterator` should return `decltype(auto)`](https://cplusplus.github.io/LWG/issue3953) diff --git a/reference/iterator/counted_iterator/iter_move.md b/reference/iterator/counted_iterator/iter_move.md index 9b949231c4..6a19d74163 100644 --- a/reference/iterator/counted_iterator/iter_move.md +++ b/reference/iterator/counted_iterator/iter_move.md @@ -6,12 +6,11 @@ ```cpp namespace std { - friend constexpr iter_rvalue_reference_t + friend constexpr decltype(auto) iter_move(const counted_iterator& i) noexcept(noexcept(ranges::iter_move(i.current))) requires input_iterator; } ``` -* iter_rvalue_reference_t[link /reference/iterator/iter_rvalue_reference_t.md] * ranges::iter_move[link /reference/iterator/iter_move.md] * input_iterator[link /reference/iterator/input_iterator.md] @@ -87,3 +86,4 @@ int main() { ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) - [LWG Issue 3472. `counted_iterator` is missing preconditions](https://cplusplus.github.io/LWG/issue3472) +- [LWG Issue 3953. `iter_move` for `common_iterator` and `counted_iterator` should return `decltype(auto)`](https://cplusplus.github.io/LWG/issue3953) From aa9d6847dcc660b3b0b2e27a945137c1e7288715 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 23 Jan 2024 18:21:47 +0900 Subject: [PATCH 0669/3948] =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=83=91=E3=82=A4?= =?UTF-8?q?=E3=83=A9=E3=81=AEC++26=E5=AF=BE=E5=BF=9C=E7=8A=B6=E6=B3=81?= =?UTF-8?q?=E3=82=92=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/implementation-status.md b/implementation-status.md index 3c795e898c..5d8c3c2296 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -297,12 +297,12 @@ | 言語機能 | 説明 | [GCC][gcc] | [Clang][clang] | [ICX][icx] | [MSVC][msvc] | |----------|------|------------|----------------|------------|--------------| | P2752R3: [`std::initializer_list`の配列を静的ストレージに配置する](/lang/cpp26/static_storage_for_braced_initializers.md.nolink) | `std::vector v = {1, 2, 3};`のような初期化で初期化子リストを静的ストレージに配置することで無駄なコピーをなくす | 14 | | | | -| P2169R4: [宣言のみで使用しない変数の名前として`_`をサポート](/lang/cpp26/nice_placeholder_with_no_name.md.nolink) | 変数名`_`は暗黙で`[[maybe_unused]]`が指定される | | 18 | | | -| P1854R4: [文字列リテラルの文字エンコーディング失敗を不適格とする](/lang/cpp26/making_non-encodable_string_literals_ill-formed.md.nolink) | 文字列リテラルのエンコーディング時に文字表現が失われる場合にコンパイルエラーにする | | 14 | | | -| P2361R6: [コンパイル時にのみ使用される文字列の扱いを明確化](/lang/cpp26/unevaluated_strings.md.nolink) | `static_assert`や`[[deprecated]]`などで使用されるコンパイル時の文字列について、文字コードの指定を禁止し、実行時エンコーディングが行われないことを規定 | | 18 | | | +| P2169R4: [宣言のみで使用しない変数の名前として`_`をサポート](/lang/cpp26/nice_placeholder_with_no_name.md.nolink) | 変数名`_`は暗黙で`[[maybe_unused]]`が指定される | 14 | 18 | | | +| P1854R4: [文字列リテラルの文字エンコーディング失敗を不適格とする](/lang/cpp26/making_non-encodable_string_literals_ill-formed.md.nolink) | 文字列リテラルのエンコーディング時に文字表現が失われる場合にコンパイルエラーにする | 14 | 14 | | | +| P2361R6: [コンパイル時にのみ使用される文字列の扱いを明確化](/lang/cpp26/unevaluated_strings.md.nolink) | `static_assert`や`[[deprecated]]`などで使用されるコンパイル時の文字列について、文字コードの指定を禁止し、実行時エンコーディングが行われないことを規定 | 14 | 18 | | | | P2552R3: [属性の無視性を見直し](/lang/cpp26/on_the_ignorability_of_standard_attributes.md.nolink) | 構文として適格な属性のみを無視できるようにし、そうでない属性の使用を不適格とする | | | | | -| P2738R1: [定数式での`void*`からポインタ型へのキャストを許可](/lang/cpp26/constexpr_cast_from_voidptr.md.nolink) | 型消去のために`void*`からポインタ型へのキャストを許可する | | 14 | 17 | | -| P2741R3: [`static_assert`の診断メッセージにユーザーが生成した文字列の指定を許可](/lang/cpp26/user-generated_static_assert_messages.md.nolink) | `constexpr`な`S.size()`と`S.data()`メンバ関数をもつオブジェクトをコンパイル時文字列として指定できるようにする | | | | | +| P2738R1: [定数式での`void*`からポインタ型へのキャストを許可](/lang/cpp26/constexpr_cast_from_voidptr.md.nolink) | 型消去のために`void*`からポインタ型へのキャストを許可する | 14 | 17 | | | +| P2741R3: [`static_assert`の診断メッセージにユーザーが生成した文字列の指定を許可](/lang/cpp26/user-generated_static_assert_messages.md.nolink) | `constexpr`な`S.size()`と`S.data()`メンバ関数をもつオブジェクトをコンパイル時文字列として指定できるようにする | 14 | 17 | | | | P2558R2: [基本文字集合に@、$、\`を追加](/lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md.nolink) | C言語との互換性のためにこれらの文字を基本文字集合に追加 | | Yes | | | | P2662R3: [パラメータパックへのインデックスアクセスを許可](/lang/cpp26/pack_indexing.md.nolink) | 可変引数テンプレートのパラメータパックに添字アクセスできるようにする | | | | | | P2864R2: [非推奨となっていた列挙値から算術型への暗黙変換を削除](/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md.nolink) | C++20から非推奨となっていた列挙値への算術演算で算術型に暗黙変換される仕様を削除 | 14 | 18 | | | From 16e6dd76a5a8e1de7cd5ccf68d41c14df685dbcc Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 23 Jan 2024 18:40:42 +0900 Subject: [PATCH 0670/3948] =?UTF-8?q?LWG=20Issue=204001=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=EF=BC=88P3040R0=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/iota_view.md | 5 ++- reference/ranges/iota_view/empty.md | 62 +++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 reference/ranges/iota_view/empty.md diff --git a/reference/ranges/iota_view.md b/reference/ranges/iota_view.md index 57461ad5de..00249329f7 100644 --- a/reference/ranges/iota_view.md +++ b/reference/ranges/iota_view.md @@ -61,12 +61,13 @@ namespace std::ranges { | [`begin`](iota_view/begin.md) | 先頭を指すイテレータを取得する | C++20 | | [`end`](iota_view/end.md) | 番兵を取得する | C++20 | | [`size`](iota_view/size.md) | 有限長のとき、要素数を取得する | C++20 | +| [`empty`](iota_view/empty.md) | Rangeが空かどうかを判定する | C++26 | ## 継承しているメンバ関数 | 名前 | 説明 | 対応バージョン | |----------------------------------------------|------------------------------------------|----------------| -| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++20 | +| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++20(C++23まで) | | [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++20 | | [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | | [`back`](view_interface/back.md) | 有限長のとき、末尾要素への参照を取得する | C++20 | @@ -201,3 +202,5 @@ FizzBuzz - [C++20 ranges](https://techbookfest.org/product/5134506308665344) - [P2325R3 Views should not be required to be default constructible](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2325r3.html) (本提案文書はC++20に遡って適用されている) - [P2367R0 Remove misuses of list-initialization from Clause 24](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2367r0.html) (本提案文書はC++20に遡って適用されている) +- [LWG Issue 4001. `iota_view` should provide `empty`](https://cplusplus.github.io/LWG/issue4001) + diff --git a/reference/ranges/iota_view/empty.md b/reference/ranges/iota_view/empty.md new file mode 100644 index 0000000000..13f2309acf --- /dev/null +++ b/reference/ranges/iota_view/empty.md @@ -0,0 +1,62 @@ +# empty +* ranges[meta header] +* std::ranges[meta namespace] +* iota_view[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr bool empty() const; +``` + +## 概要 + +[`iota_view`](../iota_view.md)が空かどうかを取得する + +## 効果 + +```cpp +return value_ == bound_; +``` + +空の場合に`true`を返す。 + +## 備考 + +C++20当初、この関数は[`view_interface`](/reference/ranges/view_interface.md)を通じて提供されていた。しかし、[`size()`](size.md)の制約を満たさない様な型の範囲を生成しなおかつ`input_range`となる場合、その様な範囲は空ではないことが分かるにも関わらず`view_interface::empty()`は無効化されてしまっていた。 + +この問題を回避するために、本メンバ関数が追加された。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v; + auto it = std::back_inserter(v); + + auto r = std::views::iota(it); + std::cout << r.empty() << "\n"; +} +``` + +### 出力 +``` +false +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): ? +- [GCC](/implementation.md#gcc): ? +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): ? + +## 参照 + +- [LWG Issue 4001. `iota_view` should provide `empty`](https://cplusplus.github.io/LWG/issue4001) From 25162a15922fb5031a0be90fe176b46145a94911 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 24 Jan 2024 13:40:33 +0900 Subject: [PATCH 0671/3948] =?UTF-8?q?to=5Fstring=20/=20to=5Fwstring=20:=20?= =?UTF-8?q?C++26=E5=AF=BE=E5=BF=9C=E3=81=A8=E3=81=97=E3=81=A6format?= =?UTF-8?q?=E3=83=99=E3=83=BC=E3=82=B9=E3=81=AE=E4=BB=95=E6=A7=98=E3=81=AB?= =?UTF-8?q?=E5=A4=89=E6=9B=B4=20#1181?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/string/to_string.md | 80 +++++++++++++++++++++------------- reference/string/to_wstring.md | 71 +++++++++++++++++++----------- 2 files changed, 94 insertions(+), 57 deletions(-) diff --git a/reference/string/to_string.md b/reference/string/to_string.md index 8cbbb3b903..dd608ebfce 100644 --- a/reference/string/to_string.md +++ b/reference/string/to_string.md @@ -6,38 +6,56 @@ ```cpp namespace std { - string to_string(int val); - string to_string(unsigned int val); - string to_string(long val); - string to_string(unsigned long val); - string to_string(long long val); - string to_string(unsigned long long val); - string to_string(float val); - string to_string(double val); - string to_string(long double val); + string to_string(int val); // (1) C++11 + string to_string(unsigned int val); // (2) C++11 + string to_string(long val); // (3) C++11 + string to_string(unsigned long val); // (4) C++11 + string to_string(long long val); // (5) C++11 + string to_string(unsigned long long val); // (6) C++11 + string to_string(float val); // (7) C++11 + string to_string(double val); // (8) C++11 + string to_string(long double val); // (9) C++11 } ``` +* string[link basic_string.md] ## 概要 -数値`val`を`string`型文字列に変換する。 +数値`val`を[`string`](basic_string.md)型文字列に変換する。 +- (1) : `int`型の値を[`string`](basic_string.md)型に変換する +- (2) : `unsigned int`型の値を[`string`](basic_string.md)型に変換する +- (3) : `long`型の値を[`string`](basic_string.md)型に変換する +- (4) : `unsigned long`型の値を[`string`](basic_string.md)型に変換する +- (5) : `long long`型の値を[`string`](basic_string.md)型に変換する +- (6) : `unsigned long long`型の値を[`string`](basic_string.md)型に変換する +- (7) : `float`型の値を[`string`](basic_string.md)型に変換する +- (8) : `double`型の値を[`string`](basic_string.md)型に変換する +- (9) : `long double`型の値を[`string`](basic_string.md)型に変換する -## 戻り値 -各数値型に対して、`sprintf(buf, fmt, val)`によって生成された文字列の`string`オブジェクトを返す。使用されるバッファサイズは未規定。 - -各型で使用されるフォーマットは以下のようになる: -| 型 | フォーマット | -|----------------------|--------------| -| `int` | `"%d"` | -| `unsigned int` | `"%u"` | -| `long` | `"%ld"` | -| `unsigned long` | `"%lu"` | -| `long long` | `"%lld"` | -| `unsigned long long` | `"%llu"` | -| `float` | `"%f"` | -| `double` | `"%f"` | -| `long double` | `"%Lf"` | +## 戻り値 +- C++11まで + 各数値型に対して、`sprintf(buf, fmt, val)`によって生成された文字列の`string`オブジェクトを返す。使用されるバッファサイズは未規定。 + + 各型で使用されるフォーマットは以下のようになる: + + | 型 | フォーマット | + |----------------------|--------------| + | `int` | `"%d"` | + | `unsigned int` | `"%u"` | + | `long` | `"%ld"` | + | `unsigned long` | `"%lu"` | + | `long long` | `"%lld"` | + | `unsigned long long` | `"%llu"` | + | `float` | `"%f"` | + | `double` | `"%f"` | + | `long double` | `"%Lf"` | + +- C++26から + ```cpp + return format("{}", val); + ``` + * format[link /reference/format/format.md] ## 例 @@ -155,10 +173,10 @@ std::string to_string(long double val) - [GCC](/implementation.md#gcc): 4.5.4 - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 - - 2010は、不完全な実装。以下の型のみ多重定義されている。 - - `long long` - - `unsigned long long` - - `long double` + - 2010は、不完全な実装。以下の型のみ多重定義されている。 + - `long long` + - `unsigned long long` + - `long double` ## 関連項目 @@ -171,5 +189,5 @@ std::string to_string(long double val) ## 参照 - [N2408 Simple Numeric Access Revision 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2408.html) - - +- [P2587R3 `to_string` or not `to_string`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2587r3.html) + - C++26から`sprintf`ベースの仕様をやめて`std::format()`ベースの仕様になった diff --git a/reference/string/to_wstring.md b/reference/string/to_wstring.md index 665f5570db..d29a5ca927 100644 --- a/reference/string/to_wstring.md +++ b/reference/string/to_wstring.md @@ -6,38 +6,56 @@ ```cpp namespace std { - wstring to_wstring(int val); - wstring to_wstring(unsigned int val); - wstring to_wstring(long val); - wstring to_wstring(unsigned long val); - wstring to_wstring(long long val); - wstring to_wstring(unsigned long long val); - wstring to_wstring(float val); - wstring to_wstring(double val); - wstring to_wstring(long double val); + wstring to_wstring(int val); // (1) C++11 + wstring to_wstring(unsigned int val); // (2) C++11 + wstring to_wstring(long val); // (3) C++11 + wstring to_wstring(unsigned long val); // (4) C++11 + wstring to_wstring(long long val); // (5) C++11 + wstring to_wstring(unsigned long long val); // (6) C++11 + wstring to_wstring(float val); // (7) C++11 + wstring to_wstring(double val); // (8) C++11 + wstring to_wstring(long double val); // (9) C++11 } ``` +* wstring[link basic_string.md] ## 概要 -数値`val`を`wstring`型文字列に変換する。 +数値`val`を[`wstring`](basic_string.md)型文字列に変換する。 +- (1) : `int`型の値を[`wstring`](basic_string.md)型に変換する +- (2) : `unsigned int`型の値を[`wstring`](basic_string.md)型に変換する +- (3) : `long`型の値を[`wstring`](basic_string.md)型に変換する +- (4) : `unsigned long`型の値を[`wstring`](basic_string.md)型に変換する +- (5) : `long long`型の値を[`wstring`](basic_string.md)型に変換する +- (6) : `unsigned long long`型の値を[`wstring`](basic_string.md)型に変換する +- (7) : `float`型の値を[`wstring`](basic_string.md)型に変換する +- (8) : `double`型の値を[`wstring`](basic_string.md)型に変換する +- (9) : `long double`型の値を[`wstring`](basic_string.md)型に変換する -## 戻り値 -各数値型に対して、`swprintf(buf, buffsize, fmt, val)`によって生成された文字列の`wstring`オブジェクトを返す。使用されるバッファサイズは未規定。 - -各型で使用されるフォーマットは以下のようになる: -| 型 | フォーマット | -|----------------------|---------------| -| `int` | `L"%d"` | -| `unsigned int` | `L"%u"` | -| `long` | `L"%ld"` | -| `unsigned long` | `L"%lu"` | -| `long long` | `L"%lld"` | -| `unsigned long long` | `L"%llu"` | -| `float` | `L"%f"` | -| `double` | `L"%f"` | -| `long double` | `L"%Lf"` | +## 戻り値 +- C++11まで + 各数値型に対して、`swprintf(buf, buffsize, fmt, val)`によって生成された文字列の`wstring`オブジェクトを返す。使用されるバッファサイズは未規定。 + + 各型で使用されるフォーマットは以下のようになる: + + | 型 | フォーマット | + |----------------------|---------------| + | `int` | `L"%d"` | + | `unsigned int` | `L"%u"` | + | `long` | `L"%ld"` | + | `unsigned long` | `L"%lu"` | + | `long long` | `L"%lld"` | + | `unsigned long long` | `L"%llu"` | + | `float` | `L"%f"` | + | `double` | `L"%f"` | + | `long double` | `L"%Lf"` | + +- C++26から + ```cpp + return format(L"{}", val); + ``` + * format[link /reference/format/format.md] ## 例 @@ -180,4 +198,5 @@ std::wstring to_wstring(long double val) ## 参照 - [N2408 Simple Numeric Access Revision 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2408.html) - +- [P2587R3 `to_string` or not `to_string`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2587r3.html) + - C++26から`sprintf`ベースの仕様をやめて`std::format()`ベースの仕様になった From e189708950239c8c2374d1e56ea592644ef1aaab Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 24 Jan 2024 15:22:06 +0900 Subject: [PATCH 0672/3948] =?UTF-8?q?basic=5Fostream::operator<<=20:=20C++?= =?UTF-8?q?23=E5=AF=BE=E5=BF=9C=E3=81=A8=E3=81=97=E3=81=A6`const=20volatil?= =?UTF-8?q?e=20void*`=E3=81=AE=E3=82=AA=E3=83=BC=E3=83=90=E3=83=BC?= =?UTF-8?q?=E3=83=AD=E3=83=BC=E3=83=89=E3=82=92=E8=BF=BD=E5=8A=A0=20(close?= =?UTF-8?q?=20#1059)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ostream/basic_ostream/op_ostream.md | 56 ++++++++++--------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/reference/ostream/basic_ostream/op_ostream.md b/reference/ostream/basic_ostream/op_ostream.md index 6a1dfae915..80d49ad68e 100644 --- a/reference/ostream/basic_ostream/op_ostream.md +++ b/reference/ostream/basic_ostream/op_ostream.md @@ -7,33 +7,33 @@ ```cpp // マニピュレータの実行 // 3つとも関数へのポインタを引数に取る。 +basic_ostream& + operator<<(basic_ostream& (*pf)(basic_ostream&)); // (1) C++03 basic_ostream& - operator<<(basic_ostream& (*pf)(basic_ostream&)); // (1) C++03 + operator<<(basic_ios& (*pf)(basic_ios&)); // (2) C++03 basic_ostream& - operator<<(basic_ios& (*pf)(basic_ios&)); // (2) C++03 -basic_ostream& - operator<<(ios_base& (*pf)(ios_base&)); // (3) C++03 + operator<<(ios_base& (*pf)(ios_base&)); // (3) C++03 // bool値・数値・ポインタの書式化出力 -basic_ostream& operator<<(bool n); // (4) C++03 -basic_ostream& operator<<(short n); // (5) C++03 -basic_ostream& operator<<(unsigned short n); // (6) C++03 -basic_ostream& operator<<(int n); // (7) C++03 -basic_ostream& operator<<(unsigned int n); // (8) C++03 -basic_ostream& operator<<(long n); // (9) C++03 -basic_ostream& operator<<(unsigned long n); // (10) C++03 -basic_ostream& operator<<(long long n); // (11) C++11 -basic_ostream& operator<<(unsigned long long n); // (12) C++11 -basic_ostream& operator<<(float f); // (13) C++03 -basic_ostream& operator<<(double f); // (14) C++03 -basic_ostream& operator<<(long double f); // (15) C++03 -basic_ostream& - operator<<(extended-floating-point-type f); // (16) C++23 -basic_ostream& operator<<(const void* p); // (17) C++03 -basic_ostream& operator<<(nullptr_t); // (18) C++17 +basic_ostream& operator<<(bool n); // (4) C++03 +basic_ostream& operator<<(short n); // (5) C++03 +basic_ostream& operator<<(unsigned short n); // (6) C++03 +basic_ostream& operator<<(int n); // (7) C++03 +basic_ostream& operator<<(unsigned int n); // (8) C++03 +basic_ostream& operator<<(long n); // (9) C++03 +basic_ostream& operator<<(unsigned long n); // (10) C++03 +basic_ostream& operator<<(long long n); // (11) C++11 +basic_ostream& operator<<(unsigned long long n); // (12) C++11 +basic_ostream& operator<<(float f); // (13) C++03 +basic_ostream& operator<<(double f); // (14) C++03 +basic_ostream& operator<<(long double f); // (15) C++03 +basic_ostream& operator<<(extended-floating-point-type f); // (16) C++23 +basic_ostream& operator<<(const void* p); // (17) C++03 +basic_ostream& operator<<(const volatile void* val); // (18) C++26 +basic_ostream& operator<<(nullptr_t); // (19) C++17 // ストリームバッファの非書式化出力 -basic_ostream& operator<<(basic_streambuf* sb); // (19) C++03 +basic_ostream& operator<<(basic_streambuf* sb); // (20) C++03 ``` * nullptr_t[link /reference/cstddef/nullptr_t.md] * extended-floating-point-type[link /reference/stdfloat.md] @@ -43,8 +43,8 @@ basic_ostream& operator<<(basic_streambuf* sb); // ストリームへの出力またはマニピュレータの実行を行う。 - (1)-(3) : マニピュレータを実行するオーバーロードそれ自体は、書式化出力関数・非書式化出力関数いずれにも該当しない -- (4)-(18) : 数値型(`bool`も含む)とポインタに対するオーバーロードは、書式化出力関数である -- (19) : `basic_streambuf`に対するオーバーロードは、非書式化出力関数である +- (4)-(19) : 数値型(`bool`も含む)とポインタに対するオーバーロードは、書式化出力関数である +- (20) : `basic_streambuf`に対するオーバーロードは、非書式化出力関数である ## 効果 @@ -52,7 +52,7 @@ basic_ostream& operator<<(basic_streambuf* sb); // 1. `pf(*this)`を呼び出す。 -### (4)-(17) : bool値・数値・ポインタの書式化出力 +### (4)-(18) : bool値・数値・ポインタの書式化出力 1. `sentry`オブジェクトを構築する。`sentry`オブジェクトが失敗を示した場合、何もしない 1. `num_put::put`を使用して入力のパース・数値への変換を行う。実引数を渡すに際し、一部の型では以下のように型変換を行う @@ -69,15 +69,17 @@ basic_ostream& operator<<(basic_streambuf* sb); // - 変換順位が`double`以下であれば、`static_cast(f)` - そうでなく変換順位が`long double`以下であれば、`static_cast(f)` - そうでなければ実装定義の意味論を持ち、この演算子は条件付きサポートとなる + - (18) `const volatile void*`: + - `return operator<<(const_cast(val));` 1. `num_put::put`から得られた`iostate`値を実引数にして`setstate`関数を呼び出す -### (18) : `nullptr_t`の出力 +### (19) : `nullptr_t`の出力 - C++17 : 実装定義の出力文字列`s`を、`return operator<<(s)`として渡した場合と等価である。 -### (19) : ストリームバッファの非書式化出力 +### (20) : ストリームバッファの非書式化出力 別のストリームバッファからの入力をストリームに出力する。 @@ -168,3 +170,5 @@ int main() { - [LWG Issue 2221. No formatted output operator for `nullptr`](https://wg21.cmeerw.net/lwg/issue2221) - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で拡張浮動小数点数型の`ostream`出力がサポートされた +- [P1147R1 Printing `volatile` Pointers](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1147r1.html) + - C++26で`const volatile void*`のオーバーロードが追加された From 8bedbe3d687527252d39f19c5f4e57ad30cf7df6 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 24 Jan 2024 15:39:15 +0900 Subject: [PATCH 0673/3948] =?UTF-8?q?C++23=20:=20#warning=20=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20#1046?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp23.md | 2 +- lang/cpp23/warning.md | 56 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 lang/cpp23/warning.md diff --git a/implementation-status.md b/implementation-status.md index 5d8c3c2296..42613ba1f8 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -277,7 +277,7 @@ | P1774R8: [コード内容の仮定をコンパイラに伝えるassume属性](/lang/cpp23/portable_assumptions.md) | 最適化のために、コードの仮定をコンパイラに伝える属性を標準化する | 13 | - | - | - | | P2316R2: [文字リテラルエンコーディングを一貫させる](/lang/cpp23/consistent_character_literal_encoding.md.nolink) | プリプロセッサの条件式での文字リテラルの扱いをC++式と同様にする | yes | yes | 2022.2 | 2022 | | P2334R1: [`elif`/`elifdef`/`elifndef`のサポートを追加](/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md.nolink) | `#if`/`#ifdef`/`#ifndef`に対応する複数条件命令のサポートを追加する | 12 | 13 | 2022.2 | - | -| P2437R1: [`#warning`のサポートを追加](/lang/cpp23/warning.md.nolink) | 多くのC++コンパイラが実装していたプリプロセス時の警告`#warning message`を正式サポート | yes | yes | 2023.2 | yes | +| P2437R1: [`#warning`のサポートを追加](/lang/cpp23/warning.md) | 多くのC++コンパイラが実装していたプリプロセス時の警告`#warning message`を正式サポート | yes | yes | 2023.2 | yes | | P2295R6: [汎用的なソースコードのエンコーディングとしてUTF-8をサポート](/lang/cpp23/support_for_utf8_as_a_portable_source_file_encoding.md.nolink) | | 13 | 15 | 2023.2 | 2019 Update 2 | | P2223R2: [行末スペースを無視するよう規定](/lang/cpp23/trimming_whitespaces_before_line_splicing.md.nolink) | 行末が「\ 」でおわっていた場合にMSVCは行の継続をしない実装になっていたため動作を共通化するため仕様を規定 | Yes | Yes | 2022.2 | - | diff --git a/lang/cpp23.md b/lang/cpp23.md index 7ac0b970c9..3d78ce1c3f 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -97,7 +97,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 |----------|------| | [文字リテラルエンコーディングを一貫させる](cpp23/consistent_character_literal_encoding.md.nolink) | プリプロセッサの条件式での文字リテラルの扱いをC++式と同様にする | | [`elif`/`elifdef`/`elifndef`のサポートを追加](cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md.nolink) | `#if`/`#ifdef`/`#ifndef`に対応する複数条件命令のサポートを追加する | -| [`#warning`のサポートを追加](cpp23/warning.md.nolink) | 多くのC++コンパイラが実装していたプリプロセス時の警告`#warning message`を正式サポート | +| [`#warning`のサポートを追加](cpp23/warning.md) | 多くのC++コンパイラが実装していたプリプロセス時の警告`#warning message`を正式サポート | | [汎用的なソースコードのエンコーディングとしてUTF-8をサポート](cpp23/support_for_utf8_as_a_portable_source_file_encoding.md.nolink) | | diff --git a/lang/cpp23/warning.md b/lang/cpp23/warning.md new file mode 100644 index 0000000000..2695381db8 --- /dev/null +++ b/lang/cpp23/warning.md @@ -0,0 +1,56 @@ +# #warningのサポートを追加 +* cpp23[meta cpp] + +## 概要 +C++23では、プリプロセッサ命令として、特定のコードに到達した際に警告メッセージを出力する `#warning` をサポートする。 + +```cpp +#warning The code is deprecated. +``` + +`#warning`命令は`#error`命令とちがい、コンパイルが停止しない。 + + +## 仕様 + +プリプロセッサ命令の構文として、`#error`と同様の構文で`#warning`が定義される: + +```cpp +#error pp-tokens(opt) new-line +#warning pp-tokens(opt) new-line +``` + +`#error`は到達時にプログラムが不適格になると規定されるが、`#warning`では不適格にならない。 + +警告メッセージの扱いは実装定義。 + + +## 例 +```cpp example +#include + +#warning The code is deprecated. + +int main() +{ + std::cout << "Hello" << std::endl; +} +``` + +### 出力例 +``` +prog.cc:3:2: warning: #warning The code is deprecated. [-Wcpp] + 3 | #warning The code is deprecated. + | ^~~~~~~ +Hello +``` + + +## この機能が必要になった背景・経緯 +`#warning`はほぼ全ての主要なコンパイラがサポートしており、致命的でない問題をプログラマに知らせたい状況で便利だった。 + +例として、ライブラリ作者が、自身のライブラリがマルチスレッドをまだサポートしておらずパフォーマンス劣化の懸念があるが、安全に使用することはできる、というようなことをユーザーに知らせたい、という状況で本機能が重宝される。 + + +## 参照 +- [P2437R1 Support for `#warning`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2437r1.pdf) From 33a231f2e0f943aba8066632c5ade72d58b761e8 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 24 Jan 2024 17:10:48 +0900 Subject: [PATCH 0674/3948] =?UTF-8?q?C++23:=20=E3=80=8C=E3=83=A9=E3=83=A0?= =?UTF-8?q?=E3=83=80=E5=BC=8F=E3=81=A7`()`=E3=82=92=E7=9C=81=E7=95=A5?= =?UTF-8?q?=E3=81=A7=E3=81=8D=E3=82=8B=E6=9D=A1=E4=BB=B6=E3=82=92=E7=B7=A9?= =?UTF-8?q?=E5=92=8C=E3=80=8D=E3=82=92=E8=BF=BD=E5=8A=A0=20(close=20#1041)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp11/lambda_expressions.md | 2 ++ lang/cpp23.md | 2 +- lang/cpp23/down_with_lambda_parens.md | 31 +++++++++++++++++++++++++++ 4 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 lang/cpp23/down_with_lambda_parens.md diff --git a/implementation-status.md b/implementation-status.md index 42613ba1f8..0a4e21cfb0 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -272,7 +272,7 @@ | P2448R2: [`constexpr`関数が定数実行できない場合でも適格とする](/lang/cpp23/relaxing_some_constexpr_restrictions.md) | | 13 | 17 (partial) | 2024.0 (partial) | - | | P2647R1: [`constexpr`関数内での`static constexpr`変数を許可](/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md.nolink) | 13 | - | 16 | 2023.2 | - | | P2564R3: [`constexpr`関数内で`consteval`関数を呼び出せない問題を緩和](/lang/cpp23/consteval_needs_to_propagate_up.md.nolink) | | - | 17 | - | 2024.0 | -| P1102R2: [ラムダ式で`()`を省略できる条件を緩和](/lang/cpp23/down_with_lambda_parens.md.nolink) | キャプチャや修飾をともなってもパラメータリストが空であれば`()`を省略できる | 11 | 13 | 2022.2 | - | +| P1102R2: [ラムダ式で`()`を省略できる条件を緩和](/lang/cpp23/down_with_lambda_parens.md) | 修飾や戻り値型をともなってもパラメータリストが空であれば`()`を省略できる | 11 | 13 | 2022.2 | - | | P2173R1: [ラムダ式に対する属性](/lang/cpp23/attributes_on_lambda_expressions.md.nolink) | ラムダ式のいくつかの箇所に属性を記述できるようにする | 9 | 13 | 2022.2 | - | | P1774R8: [コード内容の仮定をコンパイラに伝えるassume属性](/lang/cpp23/portable_assumptions.md) | 最適化のために、コードの仮定をコンパイラに伝える属性を標準化する | 13 | - | - | - | | P2316R2: [文字リテラルエンコーディングを一貫させる](/lang/cpp23/consistent_character_literal_encoding.md.nolink) | プリプロセッサの条件式での文字リテラルの扱いをC++式と同様にする | yes | yes | 2022.2 | 2022 | diff --git a/lang/cpp11/lambda_expressions.md b/lang/cpp11/lambda_expressions.md index 37c6c4d10b..073b1ab4b2 100644 --- a/lang/cpp11/lambda_expressions.md +++ b/lang/cpp11/lambda_expressions.md @@ -530,6 +530,8 @@ for_each(array, array + 4, <&>(double d) ( sum += factor ∗ d )); - [C++17 ラムダ式での`*this`のコピーキャプチャ](/lang/cpp17/lambda_capture_of_this_by_value.md) - [C++20 ラムダ式のキャプチャとして`[=, this]`を許可する](/lang/cpp20/allow_lambda_capture_equal_this.md) - [C++20 ジェネリックラムダのテンプレート構文](/lang/cpp20/familiar_template_syntax_for_generic_lambdas.md) +- [C++23 ラムダ式で()を省略できる条件を緩和](/lang/cpp23/down_with_lambda_parens.md) +- [C++23 ラムダ式に対する属性](/lang/cpp23/attributes_on_lambda_expressions.md.nolink) ## 参照 diff --git a/lang/cpp23.md b/lang/cpp23.md index 3d78ce1c3f..277bd4a56a 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -80,7 +80,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| -| [ラムダ式で`()`を省略できる条件を緩和](cpp23/down_with_lambda_parens.md.nolink) | キャプチャや修飾をともなってもパラメータリストが空であれば`()`を省略できる | +| [ラムダ式で`()`を省略できる条件を緩和](cpp23/down_with_lambda_parens.md) | 修飾や戻り値型をともなってもパラメータリストが空であれば`()`を省略できる | | [ラムダ式に対する属性](cpp23/attributes_on_lambda_expressions.md.nolink) | ラムダ式のいくつかの箇所に属性を記述できるようにする | diff --git a/lang/cpp23/down_with_lambda_parens.md b/lang/cpp23/down_with_lambda_parens.md new file mode 100644 index 0000000000..1790758554 --- /dev/null +++ b/lang/cpp23/down_with_lambda_parens.md @@ -0,0 +1,31 @@ +# ラムダ式で()を省略できる条件を緩和 +* cpp23[meta cpp] + +## 概要 +C++23では、ラムダ式のパラメータリストが空であれば、以下の要素を含む場合であってもパラメータリストの `()` を省略できる。 + +- `constexpr` +- `mutable` +- `consteval` +- `noexcept` +- 属性 (C++23時点でここに指定できる標準属性なし) +- 後置戻り値型 +- `requires` + +```cpp +auto f1 = [b = std::move(a)] () { … }; // C++20 OK, C++23 OK +auto f2 = [b = std::move(a)] { … }; // C++20 OK, C++23 OK + +auto f3 = [b = std::move(a)] () mutable { … }; // C++20 OK, C++23 OK +auto f4 = [b = std::move(a)] mutable { … }; // C++20 NG, C++23 OK + +auto f5 = [] constexpr mutable noexcept -> bool { return true; }; // C++23 OK +``` + + +## 関連項目 +- [C++11 ラムダ式](/lang/cpp11/lambda_expressions.md) + + +## 参照 +- [P1102R2 Down with `()`!](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1102r2.html) From 8ba9fbacbb2089f4b7a49a2a0d5c6a50949dbd58 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 24 Jan 2024 17:31:20 +0900 Subject: [PATCH 0675/3948] =?UTF-8?q?C++23=20:=20=E3=80=8C=E3=83=A9?= =?UTF-8?q?=E3=83=A0=E3=83=80=E5=BC=8F=E3=81=AB=E5=AF=BE=E3=81=99=E3=82=8B?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E3=80=8D=E3=82=92=E8=BF=BD=E5=8A=A0=20(close?= =?UTF-8?q?=20#1042)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp11/attributes.md | 1 + lang/cpp11/lambda_expressions.md | 2 +- lang/cpp14/deprecated_attr.md | 1 + lang/cpp17/nodiscard.md | 1 + lang/cpp23.md | 2 +- .../cpp23/attributes_on_lambda_expressions.md | 50 +++++++++++++++++++ 7 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 lang/cpp23/attributes_on_lambda_expressions.md diff --git a/implementation-status.md b/implementation-status.md index 0a4e21cfb0..8b7fa35739 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -273,7 +273,7 @@ | P2647R1: [`constexpr`関数内での`static constexpr`変数を許可](/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md.nolink) | 13 | - | 16 | 2023.2 | - | | P2564R3: [`constexpr`関数内で`consteval`関数を呼び出せない問題を緩和](/lang/cpp23/consteval_needs_to_propagate_up.md.nolink) | | - | 17 | - | 2024.0 | | P1102R2: [ラムダ式で`()`を省略できる条件を緩和](/lang/cpp23/down_with_lambda_parens.md) | 修飾や戻り値型をともなってもパラメータリストが空であれば`()`を省略できる | 11 | 13 | 2022.2 | - | -| P2173R1: [ラムダ式に対する属性](/lang/cpp23/attributes_on_lambda_expressions.md.nolink) | ラムダ式のいくつかの箇所に属性を記述できるようにする | 9 | 13 | 2022.2 | - | +| P2173R1: [ラムダ式に対する属性](/lang/cpp23/attributes_on_lambda_expressions.md) | ラムダ式のいくつかの箇所に属性を記述できるようにする | 9 | 13 | 2022.2 | - | | P1774R8: [コード内容の仮定をコンパイラに伝えるassume属性](/lang/cpp23/portable_assumptions.md) | 最適化のために、コードの仮定をコンパイラに伝える属性を標準化する | 13 | - | - | - | | P2316R2: [文字リテラルエンコーディングを一貫させる](/lang/cpp23/consistent_character_literal_encoding.md.nolink) | プリプロセッサの条件式での文字リテラルの扱いをC++式と同様にする | yes | yes | 2022.2 | 2022 | | P2334R1: [`elif`/`elifdef`/`elifndef`のサポートを追加](/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md.nolink) | `#if`/`#ifdef`/`#ifndef`に対応する複数条件命令のサポートを追加する | 12 | 13 | 2022.2 | - | diff --git a/lang/cpp11/attributes.md b/lang/cpp11/attributes.md index b56d298c5a..443e638ba7 100644 --- a/lang/cpp11/attributes.md +++ b/lang/cpp11/attributes.md @@ -160,6 +160,7 @@ C++11で採用されたもの以外で検討された以下の機能は、属性 - [C++20 `[[no_unique_address]]`属性](/lang/cpp20/language_support_for_empty_objects.md) - [C++20 `[[likely]]`, `[[unlikely]]`属性](/lang/cpp20/likely_and_unlikely_attributes.md) - [C++20 属性の名前空間を予約](/lang/cpp20/reserving_attribute_namespaces_for_future_use.md) +- [C++23 ラムダ式に対する属性](/lang/cpp23/attributes_on_lambda_expressions.md) ## 参照 diff --git a/lang/cpp11/lambda_expressions.md b/lang/cpp11/lambda_expressions.md index 073b1ab4b2..98eeb364e5 100644 --- a/lang/cpp11/lambda_expressions.md +++ b/lang/cpp11/lambda_expressions.md @@ -531,7 +531,7 @@ for_each(array, array + 4, <&>(double d) ( sum += factor ∗ d )); - [C++20 ラムダ式のキャプチャとして`[=, this]`を許可する](/lang/cpp20/allow_lambda_capture_equal_this.md) - [C++20 ジェネリックラムダのテンプレート構文](/lang/cpp20/familiar_template_syntax_for_generic_lambdas.md) - [C++23 ラムダ式で()を省略できる条件を緩和](/lang/cpp23/down_with_lambda_parens.md) -- [C++23 ラムダ式に対する属性](/lang/cpp23/attributes_on_lambda_expressions.md.nolink) +- [C++23 ラムダ式に対する属性](/lang/cpp23/attributes_on_lambda_expressions.md) ## 参照 diff --git a/lang/cpp14/deprecated_attr.md b/lang/cpp14/deprecated_attr.md index 1c9248a162..fbe530fa8c 100644 --- a/lang/cpp14/deprecated_attr.md +++ b/lang/cpp14/deprecated_attr.md @@ -123,6 +123,7 @@ prog.cc:45:3: warning: 'class_templ' is deprecated: don't use class_templ +#include + +int main() +{ + auto f1 = [] [[noreturn]] { throw std::runtime_error("error"); }; + auto f2 = [] [[nodiscard]] { return true; }; + auto f3 = [] [[deprecated]] { return false; }; + + auto f4 = [] + requires std::copy_constructible + [[nodiscard]] + (T value) { + return value; + }; +} +``` +* std::copy_constructible[link /reference/concepts/copy_constructible.md] + +### 出力 +``` +``` + +## 関連項目 +- [C++11 ラムダ式](/lang/cpp11/lambda_expressions.md) +- [C++11 属性構文](/lang/cpp11/attributes.md) + + +## 参照 +- [P2173R1 Attributes on Lambda-Expressions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2173r1.pdf) From 7e3cbd40cdd041691a7d807ec1b5484886aedf10 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 25 Jan 2024 12:55:21 +0900 Subject: [PATCH 0676/3948] =?UTF-8?q?C++23=20:=20=E3=80=8Cthis=E3=83=9D?= =?UTF-8?q?=E3=82=A4=E3=83=B3=E3=82=BF=E3=82=92=E3=82=82=E3=81=A4=E5=BF=85?= =?UTF-8?q?=E8=A6=81=E3=81=AE=E3=81=AA=E3=81=84=E6=BC=94=E7=AE=97=E5=AD=90?= =?UTF-8?q?=E3=82=92static=E3=81=A8=E3=81=97=E3=81=A6=E5=AE=A3=E8=A8=80?= =?UTF-8?q?=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=80=8D=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=97=E9=96=A2?= =?UTF-8?q?=E9=80=A3=E3=83=9A=E3=83=BC=E3=82=B8=E3=82=92=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=20(close=20#1029)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp11/lambda_expressions.md | 1 + lang/cpp23.md | 2 +- lang/cpp23/down_with_lambda_parens.md | 2 + lang/cpp23/static_operator.md | 50 ++++++++++ .../functional/function/op_deduction_guide.md | 25 +++-- reference/future/packaged_task.md | 7 ++ .../packaged_task/op_deduction_guide.md | 96 +++++++++++++++++++ 8 files changed, 174 insertions(+), 11 deletions(-) create mode 100644 lang/cpp23/static_operator.md create mode 100644 reference/future/packaged_task/op_deduction_guide.md diff --git a/implementation-status.md b/implementation-status.md index 8b7fa35739..de55453a28 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -258,7 +258,7 @@ | P0847R7: [自身のオブジェクトを明示的にパラメータとして指定する](/lang/cpp23/deducing_this.md.nolink) | メンバ関数が`*this`の型・オブジェクトをパラメータとしてとり、`*this`オブジェクトがconst/非const、左辺値/右辺値であるかをメンバ関数内で識別できるようにする | - | 18 | - | 2022 Update 2 (partial) | | P1847R4: [アクセス制御の異なるメンバ変数のレイアウトを宣言順に規定](/lang/cpp23/make_declaration_order_layout_mandated.md.nolink) | アクセス制御の異なるメンバ変数のレイアウトが実装によって異なっていたため仕様を規定 | Yes | Yes | - | 2022 | | P2128R6: [添字演算子の多次元サポート](/lang/cpp23/multidimensional_subscript_operator.nd.nolink) | `operator[](int x, int y, int z)`のように添字演算子のオーバーロードで複数のパラメータをとることを許可 | 12 | 15 | 2022.2 | - | -| P1169R4: [`this`ポインタをもつ必要のない演算子を`static`として宣言できるようにする](/lang/cpp23/static_operator.md.nolink) | | 13 | 16 | 2023.2 | - | +| P1169R4: [`this`ポインタをもつ必要のない演算子を`static`として宣言できるようにする](/lang/cpp23/static_operator.md) | 状態をもたないいくつかの演算子を`static`として宣言できるようにする | 13 | 16 | 2023.2 | - | | P2201R1: [異なる文字エンコーディングをもつ文字列リテラルの連結を不適格とする](/lang/cpp23/mixed_string_literal_concatenation.md.nolink) | `auto a = u8"" L"";`のような異なる文字エンコーディング同士での文字列リテラルを連結を禁止する | Yes | Yes | 2022.2 | Yes | | P2029R4: [文字・文字列リテラル中の数値・ユニバーサルキャラクタのエスケープに関する問題解決](/lang/cpp23/numeric_and_universal_character_escapes_in_character_and_string_literals.md.nolink) | | - | - | - | - | | P2362R3: [1ワイド文字に収まらないワイド文字リテラルを禁止する](/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md.nolink) | エンコード結果として`wchar_t`の大きさに収まらないワイド文字リテラルを禁止する | 13 | 14 | 2023.2 | - | diff --git a/lang/cpp11/lambda_expressions.md b/lang/cpp11/lambda_expressions.md index 98eeb364e5..a49355d457 100644 --- a/lang/cpp11/lambda_expressions.md +++ b/lang/cpp11/lambda_expressions.md @@ -532,6 +532,7 @@ for_each(array, array + 4, <&>(double d) ( sum += factor ∗ d )); - [C++20 ジェネリックラムダのテンプレート構文](/lang/cpp20/familiar_template_syntax_for_generic_lambdas.md) - [C++23 ラムダ式で()を省略できる条件を緩和](/lang/cpp23/down_with_lambda_parens.md) - [C++23 ラムダ式に対する属性](/lang/cpp23/attributes_on_lambda_expressions.md) +- [C++23 `this`ポインタをもつ必要のない演算子を`static`として宣言できるようにする](/lang/cpp23/static_operator.md) ## 参照 diff --git a/lang/cpp23.md b/lang/cpp23.md index f330d1aa70..ebfd678938 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -42,7 +42,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 | [自身のオブジェクトを明示的にパラメータとして指定する](cpp23/deducing_this.md.nolink) | メンバ関数が`*this`の型・オブジェクトをパラメータとしてとり、`*this`オブジェクトがconst/非const、左辺値/右辺値であるかをメンバ関数内で識別できるようにする | | [アクセス制御の異なるメンバ変数のレイアウトを宣言順に規定](cpp23/make_declaration_order_layout_mandated.md.nolink) | アクセス制御の異なるメンバ変数のレイアウトが実装によって異なっていたため仕様を規定 | | [添字演算子の多次元サポート](cpp23/multidimensional_subscript_operator.nd.nolink) | `operator[](int x, int y, int z)`のように添字演算子のオーバーロードで複数のパラメータをとることを許可 | -| [`this`ポインタをもつ必要のない演算子を`static`として宣言できるようにする](cpp23/static_operator.md.nolink) | | +| [`this`ポインタをもつ必要のない演算子を`static`として宣言できるようにする](cpp23/static_operator.md) | 状態をもたないいくつかの演算子を`static`として宣言できるようにする | ### 文字列 diff --git a/lang/cpp23/down_with_lambda_parens.md b/lang/cpp23/down_with_lambda_parens.md index 1790758554..38c1da716a 100644 --- a/lang/cpp23/down_with_lambda_parens.md +++ b/lang/cpp23/down_with_lambda_parens.md @@ -5,6 +5,7 @@ C++23では、ラムダ式のパラメータリストが空であれば、以下の要素を含む場合であってもパラメータリストの `()` を省略できる。 - `constexpr` +- `static` - `mutable` - `consteval` - `noexcept` @@ -25,6 +26,7 @@ auto f5 = [] constexpr mutable noexcept -> bool { return true; }; // C++23 OK ## 関連項目 - [C++11 ラムダ式](/lang/cpp11/lambda_expressions.md) +- [C++23 `this`ポインタをもつ必要のない演算子を`static`として宣言できるようにする](/lang/cpp23/static_operator.md) ## 参照 diff --git a/lang/cpp23/static_operator.md b/lang/cpp23/static_operator.md new file mode 100644 index 0000000000..d7841cfb51 --- /dev/null +++ b/lang/cpp23/static_operator.md @@ -0,0 +1,50 @@ +# thisポインタをもつ必要のない演算子をstaticとして宣言できるようにする +* cpp23[meta cpp] + +## 概要 +以下の演算子が`this`ポインタを必要としない (状態をもたない) 場合、演算子オーバーロードを`static`として定義できる: + +- `operator()` (関数呼び出し演算子) +- `operator[]` (添字演算子) + +またラムダ式においても同様に、`static`をつけられるようになる。`static`をつけた場合、以下のようになる: + +- `mutable`を同時に指定することはできない +- `const`メンバ関数ではなくなる + + +## 例 +```cpp example +#include + +struct F { + static bool operator()(int x) { + return x > 0; + } +}; + +int main() +{ + std::cout << F::operator()(1) << std::endl; + std::cout << F{}(1) << std::endl; + + auto f1 = []() static { return 1; }; + std::cout << f1() << std::endl; +} +``` + +### 出力 +``` +1 +1 +1 +``` + +## 関連項目 +- [C++11 ラムダ式](/lang/cpp11/lambda_expressions.md) +- [`std::function::`推論補助](/reference/functional/function/op_deduction_guide.md) + + +## 参照 +- [P1169R4 `static operator()`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1169r4.html) +- [P2589R0 `static operator[]`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2589r0.pdf) diff --git a/reference/functional/function/op_deduction_guide.md b/reference/functional/function/op_deduction_guide.md index 59091fde8f..f330677598 100644 --- a/reference/functional/function/op_deduction_guide.md +++ b/reference/functional/function/op_deduction_guide.md @@ -7,10 +7,10 @@ ```cpp namespace std { template - function(R(*)(ArgTypes...)) -> function; // (1) + function(R(*)(ArgTypes...)) -> function; // (1) C++17 template - function(F) -> function; // (2) + function(F) -> function; // (2) C++17 } ``` @@ -18,12 +18,18 @@ namespace std { `std::function`クラステンプレートの型推論補助。 - (1) : 関数ポインタからの推論 -- (2) : 関数オブジェクトからの推論。このオーバーロードは、関数呼び出し演算子がひとつだけオーバーロードされている場合に有効 +- (2) : 関数オブジェクトからシグニチャの推論。このオーバーロードは、関数呼び出し演算子がひとつだけオーバーロードされている場合に有効 -## 備考 -- (2) : 式`&F::operator()`が妥当な場合のみ、オーバーロード解決に参加する。関数呼び出し演算子が複数オーバーロードされていると、この方法では関数ポインタを取得できない。この式が妥当な場合、`decltype(&F::operator())`で関数ポインタのシグニチャを取得でき、`std::function`クラスのテンプレート引数に渡すシグニチャとして使用できる -- このクラスの推論補助は、将来のバージョンで変更される可能性がある +## テンプレートパラメータ制約 +- (2) : + - `&F::operator()`は評価されないオペランドとして扱われ、以下のいずれかの場合に適格である: + - C++17 : + - `decltype(&F::operator())`は、型`G`があるとして、`R(G::*)(A...) cv &(opt) noexcept(opt)`形式もしくは`R(*)(G cv ref(opt), A...) noexcept(opt)`形式であること + - C++26 : + - `F::operator()`が非静的メンバ関数であり、`decltype(&F::operator())`は、型`G`があるとして、`R(G::*)(A...) cv &(opt) noexcept(opt)`形式もしくは`R(*)(G cv ref(opt), A...) noexcept(opt)`形式であること + - `F::operator()`静的メンバ関数であり、`decltype(&F::operator())`は`R(*)(A...) noexcept(opt)`形式であること + ## 例 ```cpp example @@ -72,7 +78,7 @@ int main() ## バージョン ### 言語 -- C++17 +- C++20 ### 処理系 - [Clang](/implementation.md#clang): @@ -82,8 +88,9 @@ int main() ## 関連項目 - [C++17 クラステンプレートのテンプレート引数推論](/lang/cpp17/type_deduction_for_class_templates.md) +- [C++23 `this`ポインタをもつ必要のない演算子を`static`として宣言できるようにする](/lang/cpp23/static_operator.md) +- [C++23 自身のオブジェクトを明示的にパラメータとして指定する](/lang/cpp23/deducing_this.md.nolink) ## 参照 -- [P0433R2 Toward a resolution of US7 and US14: Integrating template deduction for class templates into the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0433r2.html) - +- [LWG issue 3117. Missing `packaged_task` deduction guides](https://wg21.cmeerw.net/lwg/issue3117) diff --git a/reference/future/packaged_task.md b/reference/future/packaged_task.md index c8c024c484..45a7b47f88 100644 --- a/reference/future/packaged_task.md +++ b/reference/future/packaged_task.md @@ -58,6 +58,13 @@ namespace std { | [`swap`](packaged_task/swap_free.md) | 2つの`packaged_task`オブジェクトを入れ替える | C++11 | +## 推論補助 + +| 名前 | 説明 | 対応バージョン | +|---------------------------------------------|------------------------------------|-------| +| [`(deduction_guide)`](packaged_task/op_deduction_guide.md) | クラステンプレートの推論補助 | C++20 | + + ## その他 | 名前 | 説明 | 対応バージョン | diff --git a/reference/future/packaged_task/op_deduction_guide.md b/reference/future/packaged_task/op_deduction_guide.md new file mode 100644 index 0000000000..e730510418 --- /dev/null +++ b/reference/future/packaged_task/op_deduction_guide.md @@ -0,0 +1,96 @@ +# 推論補助 +* future[meta header] +* std[meta namespace] +* packaged_task[meta class] +* cpp20[meta cpp] + +```cpp +namespace std { + template + packaged_task(R(*)(ArgTypes...)) + -> packaged_task; // (1) C++20 + + template + packaged_task(F) + -> packaged_task; // (2) C++20 +} +``` + +## 概要 +`std::packaged_task`クラステンプレートの型推論補助。 + +- (1) : 関数ポインタからの推論 +- (2) : 関数オブジェクトからシグニチャの推論。このオーバーロードは、関数呼び出し演算子がひとつだけオーバーロードされている場合に有効 + + +## テンプレートパラメータ制約 +- (2) : + - `&F::operator()`は評価されないオペランドとして扱われ、以下のいずれかの場合に適格である: + - C++17 : + - `decltype(&F::operator())`は、型`G`があるとして、`R(G::*)(A...) cv &(opt) noexcept(opt)`形式であること + - C++26 : + - `F::operator()`が非静的メンバ関数であり、`decltype(&F::operator())`は、型`G`があるとして、`R(G::*)(A...) cv &(opt) noexcept(opt)`形式もしくは`R(*)(G cv ref(opt), A...) noexcept(opt)`形式であること + - `F::operator()`静的メンバ関数であり、`decltype(&F::operator())`は`R(*)(A...) noexcept(opt)`形式であること + + +## 例 +```cpp example +#include +#include + +int foo(int, char) { return 0; } + +struct Functor { + int operator()(double) { return 1; } +}; + +int main() +{ + // (1) + // 関数ポインタからの型推論 + std::packaged_task f{foo}; + f(1, '3'); + std::cout << f.get_future().get() << std::endl; + + // (2) + // 関数オブジェクトからの型推論。 + // 関数呼び出し演算子がひとつだけオーバーロードされていること + std::packaged_task g{Functor{}}; + g(1.23); + std::cout << g.get_future().get() << std::endl; + + // (3) + // ラムダ式からの型推論 + std::packaged_task h{[](int) { return 2; }}; + h(3); + std::cout << h.get_future().get() << std::endl; +} +``` + +### 出力 +``` +0 +1 +2 +``` + + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 18 +- [GCC](/implementation.md#gcc): 11 +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [C++17 クラステンプレートのテンプレート引数推論](/lang/cpp17/type_deduction_for_class_templates.md) +- [C++23 `this`ポインタをもつ必要のない演算子を`static`として宣言できるようにする](/lang/cpp23/static_operator.md) +- [C++23 自身のオブジェクトを明示的にパラメータとして指定する](/lang/cpp23/deducing_this.md.nolink) + + +## 参照 +- [P0433R2 Toward a resolution of US7 and US14: Integrating template deduction for class templates into the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0433r2.html) + From 86e7cee1b8286f27dae89711ac474bc9affb2596 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 25 Jan 2024 13:07:02 +0900 Subject: [PATCH 0677/3948] =?UTF-8?q?C++23=20static=20operator=20:=20?= =?UTF-8?q?=E7=B5=8C=E7=B7=AF=E3=81=A8=E3=83=91=E3=83=95=E3=82=A9=E3=83=BC?= =?UTF-8?q?=E3=83=9E=E3=83=B3=E3=82=B9=E5=8A=B9=E6=9E=9C=E3=82=92=E8=A8=98?= =?UTF-8?q?=E8=BC=89=20#1029?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23/static_operator.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lang/cpp23/static_operator.md b/lang/cpp23/static_operator.md index d7841cfb51..82da0f5a2f 100644 --- a/lang/cpp23/static_operator.md +++ b/lang/cpp23/static_operator.md @@ -12,6 +12,8 @@ - `mutable`を同時に指定することはできない - `const`メンバ関数ではなくなる +これらを`static`として定義することで、演算子の呼び出しが高速化することを期待できる。 + ## 例 ```cpp example @@ -40,6 +42,13 @@ int main() 1 ``` + +## この機能が必要になった背景・経緯 +関数オブジェクトは関数ポインタに比べてインライン化しやすいため、パフォーマンスで有利である。しかし、関数オブジェクトがなんらかの理由でインライン化されない場合に、`this`ポインタを渡すための余分なレジスタを使わなければならない。 + +状態をもたない関数オブジェクトでは`this`ポインタの受け渡しは必要なく、無駄である。必要ないもののためにコストを支払わないという基本的な思想に反していたため、`this`ポインタの受け渡しをなくせる機能として、`static`指定の許可を導入した。 + + ## 関連項目 - [C++11 ラムダ式](/lang/cpp11/lambda_expressions.md) - [`std::function::`推論補助](/reference/functional/function/op_deduction_guide.md) From 923f1521f99ac6b35a09cb4ff33db453d73b2350 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 25 Jan 2024 13:32:02 +0900 Subject: [PATCH 0678/3948] =?UTF-8?q?charconv=20:=20C++26=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C=E3=81=A8=E3=81=97=E3=81=A6from=5Fchars=5Fresult=20/?= =?UTF-8?q?=20to=5Fchars=5Fresult=E3=81=ABoperator=20bool=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20(close=20#1179)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/charconv/from_chars.md | 160 +++++++++++++++++- reference/charconv/from_chars_result.md | 7 + .../charconv/from_chars_result/op_bool.md | 58 +++++++ reference/charconv/to_chars.md | 108 +++++++++++- reference/charconv/to_chars_result.md | 7 + reference/charconv/to_chars_result/op_bool.md | 60 +++++++ 6 files changed, 397 insertions(+), 3 deletions(-) create mode 100644 reference/charconv/from_chars_result/op_bool.md create mode 100644 reference/charconv/to_chars_result/op_bool.md diff --git a/reference/charconv/from_chars.md b/reference/charconv/from_chars.md index 6e3d84bc54..f728239d03 100644 --- a/reference/charconv/from_chars.md +++ b/reference/charconv/from_chars.md @@ -118,7 +118,7 @@ C++標準はこれら関数の実装の詳細について何も規定しない ## 例 -### 基本の使用例 +### 基本の使用例 (C++17) ```cpp example #include @@ -276,6 +276,164 @@ nan -inf ``` +### 基本の使用例 (C++26) +```cpp example +#include +#include +#include + +int main() +{ + { + const char str[] = "00000123456789 is decimal"; + int value{}; + + //(1) 10進数文字列からintへ変換 + //変換変換の成否判定に`operator bool`を使用 + if (std::from_chars(std::begin(str), std::end(str), value)) { + std::cout << value << std::endl; + } + else { + std::cout << "conversion failed." << std::endl; + } + } + + { + const char str[] = "1111111111111111 is (65535)_10"; + int value{}; + + //(1) 2進数文字列からintへ変換 + if (std::from_chars(std::begin(str), std::end(str), value, 2)) { + std::cout << value << std::endl; + } + else { + std::cout << "conversion failed." << std::endl; + } + } + + { + const char str[] = "Z is (35)_10"; + int value{}; + + //(1) 36進数文字列からintへ変換 + if (std::from_chars(std::begin(str), std::end(str), value, 36)) { + std::cout << value << std::endl; + } + else { + std::cout << "conversion failed." << std::endl; + } + } + + { + const char str[] = "255"; + char value{}; + + //(1) 失敗する例 MSVCにおけるcharの範囲は-128~127 + if (std::from_chars(std::begin(str), std::end(str), value)) { + std::cout << value << std::endl; + } + else { + std::cout << "conversion failed." << std::endl; + } + } + + std::cout << std::setprecision(16); + + { + const char str[] = "3.1415926535897932384626433832795 is pi"; + double value{}; + + //(3) 固定小数表記文字列からdoubleへ変換 + if (std::from_chars(std::begin(str), std::end(str), value)) { + std::cout << value << std::endl; + } + else { + std::cout << "conversion failed." << std::endl; + } + } + + { + const char str[] = "1.10001e-01 is Liouville number"; + double value{}; + + //(3) 指数表記文字列からdoubleへ変換 + if (std::from_chars(std::begin(str), std::end(str), value)) { + std::cout << value << std::endl; + } + else { + std::cout << "conversion failed." << std::endl; + } + } + + { + const char str[] = "1.c29068986fcdf000p-4 is Liouville number"; + double value{}; + + //(3) 16進指数表記文字列からdoubleへ変換 + if (std::from_chars(std::begin(str), std::end(str), value, std::chars_format::hex)) { + std::cout << value << std::endl; + } + else { + std::cout << "conversion failed." << std::endl; + } + } + + { + const char str[] = " 3.1415926535897932384626433832795 is pi"; + double value{}; + + //(3) 失敗する例 ホワイトスペース読み飛ばし + if (std::from_chars(std::begin(str), std::end(str), value)) { + std::cout << value << std::endl; + } + else { + std::cout << "conversion failed." << std::endl; + } + } + + { + const char str[] = "NaN"; + double value{}; + + //(3) NaNの読み取り + if (std::from_chars(std::begin(str), std::end(str), value)) { + std::cout << value << std::endl; + } + else { + std::cout << "conversion failed." << std::endl; + } + } + + { + const char str[] = "-INF"; + double value{}; + + //(3) INFの読み取り + if (std::from_chars(std::begin(str), std::end(str), value)) { + std::cout << value << std::endl; + } + else { + std::cout << "conversion failed." << std::endl; + } + } +} +``` + +#### 出力例 +``` +123456789 +65535 +35 +conversion failed. +3.141592653589793 +0.110001 +0.110001 +conversion failed. +nan +-inf +``` + + ### イテレータ範囲からの変換(C++20) 入力文字列はポインタによる範囲で指定する必要があるが、`std::string`等のイテレータは必ずしもポインタとは限らず、そのままでは使いづらいことがある。その様なとき、C++20の[`std::to_address`](/reference/memory/to_address.md)を使用すると安全かつ簡易にこの関数でイテレータを使用できる。 diff --git a/reference/charconv/from_chars_result.md b/reference/charconv/from_chars_result.md index ec3a237ef4..1f11dbac71 100644 --- a/reference/charconv/from_chars_result.md +++ b/reference/charconv/from_chars_result.md @@ -25,6 +25,13 @@ namespace std { | ec | 成功なら`ec == errc{}`、失敗ならば`errc::invalid_argument`を表す[`errc`](/reference/system_error/errc.md)の値。 | C++17 | ## メンバ関数 +### 成否判定 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`operator bool`](from_chars_result/op_bool.md) | 変換に成功したかを判定する | C++26 | + + ### 比較演算子 | 名前 | 説明 | 対応バージョン | diff --git a/reference/charconv/from_chars_result/op_bool.md b/reference/charconv/from_chars_result/op_bool.md new file mode 100644 index 0000000000..495733b414 --- /dev/null +++ b/reference/charconv/from_chars_result/op_bool.md @@ -0,0 +1,58 @@ +# operator bool +* charconv[meta header] +* std[meta namespace] +* from_chars_result[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr explicit operator bool() const noexcept; +``` + +## 概要 +変換が成功したかを判定する。 + + +## 戻り値 +```cpp +return ec == errc{}; +``` +* errc[link /reference/system_error/errc.md] + + +## 例 +```cpp example +#include +#include + +int main() +{ + const char str[] = "123"; + int value{}; + if (std::from_chars(std::begin(str), std::end(str), value)) { + std::cout << value << std::endl; + } + else { + std::cout << "conversion failed" << std::endl; + } +} +``` +* std::from_chars[link /reference/charconv/from_chars.md] + +### 出力 +``` +123 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2497R0 Testing for success or failure of `` functions](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2497r0.html) diff --git a/reference/charconv/to_chars.md b/reference/charconv/to_chars.md index 5fe7dc76c9..81bc4f0a71 100644 --- a/reference/charconv/to_chars.md +++ b/reference/charconv/to_chars.md @@ -175,7 +175,7 @@ C++標準はこれら関数の実装の詳細について何も規定しない ## 例 - +### 基本の使用例 (C++17) ```cpp example #include #include @@ -268,7 +268,111 @@ int main() * std::chars_format[link chars_format.md] * std::errc[link /reference/system_error/errc.md] -### 出力例(VS2019 16.5 preview 1) +#### 出力例(VS2019 16.5 preview 1) +``` +10 +1111111111111111 +z +0.110001 +1.10001e-01 +0.110001 +1.c29068986fcdfp-4 +1.1000100000000000e-01 +0.1100010000000000 +1.c29068986fcdf000p-4 +``` + +### 基本の使用例 (C++26) +```cpp example +#include +#include + +int main() +{ + char out[50]{}; + auto begin = std::begin(out); + auto end = std::end(out); + + //(1) 10進数文字列へ変換 + if (auto result = std::to_chars(begin, end, 10)) { + std::cout << std::string_view(begin, result.ptr - begin) << std::endl; + } + else { + std::cout << "conversion failed." << std::endl; + } + //(1) 2進数文字列へ変換 + if (auto result = std::to_chars(begin, end, 65535, 2)) { + std::cout << std::string_view(begin, result.ptr - begin) << std::endl; + } + else { + std::cout << "conversion failed." << std::endl; + } + //(1) 36進数文字列へ変換 + if (auto result = std::to_chars(begin, end, 35, 36)) { + std::cout << std::string_view(begin, result.ptr - begin) << std::endl; + } + else { + std::cout << "conversion failed." << std::endl; + } + + //リウヴィル数 + constexpr double l = 0.11000100000000000000000100000000000; + + //(3) 精度・フォーマット指定なしの浮動小数点数変換 + if (auto result = std::to_chars(begin, end, l)) { + std::cout << std::string_view(begin, result.ptr - begin) << std::endl; + } + else { + std::cout << "conversion failed." << std::endl; + } + + //(7) 精度指定なしの浮動小数点数変換、指数表記 + if (auto result = std::to_chars(begin, end, l, std::chars_format::scientific)) { + std::cout << std::string_view(begin, result.ptr - begin) << std::endl; + } + else { + std::cout << "conversion failed." << std::endl; + } + //(7) 精度指定なしの浮動小数点数変換、固定小数表記 + if (auto result = std::to_chars(begin, end, l, std::chars_format::fixed)) { + std::cout << std::string_view(begin, result.ptr - begin) << std::endl; + } + else { + std::cout << "conversion failed." << std::endl; + } + //(7) 精度指定なしの浮動小数点数変換、16進指数表記 + if (auto result = std::to_chars(begin, end, l, std::chars_format::hex)) { + std::cout << std::string_view(begin, result.ptr - begin) << std::endl; + } + else { + std::cout << "conversion failed." << std::endl; + } + + //(11) 精度指定ありの浮動小数点数変換、指数表記 + if (auto result = std::to_chars(begin, end, l, std::chars_format::scientific, 16)) { + std::cout << std::string_view(begin, result.ptr - begin) << std::endl; + } + else { + std::cout << "conversion failed." << std::endl; + } + //(11) 精度指定ありの浮動小数点数変換、固定小数表記 + if (auto result = std::to_chars(begin, end, l, std::chars_format::fixed, 16)) { + std::cout << std::string_view(begin, result.ptr - begin) << std::endl; + } + else { + std::cout << "conversion failed." << std::endl; + } + //(11) 精度指定ありの浮動小数点数変換、16進指数表記 + if (auto result = std::to_chars(begin, end, l, std::chars_format::hex, 16)) { + std::cout << std::string_view(begin, result.ptr - begin) << std::endl; + } + else { + std::cout << "conversion failed." << std::endl; + } +} +``` + +#### 出力例 ``` 10 1111111111111111 diff --git a/reference/charconv/to_chars_result.md b/reference/charconv/to_chars_result.md index 3db47772c5..855bb48092 100644 --- a/reference/charconv/to_chars_result.md +++ b/reference/charconv/to_chars_result.md @@ -24,6 +24,13 @@ namespace std { | ec | 成功なら`ec == errc{}`、失敗ならば`errc::value_too_large`を表す[`errc`](/reference/system_error/errc.md)の値。 | C++17 | ## メンバ関数 +### 成否判定 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`operator bool`](to_chars_result/op_bool.md) | 変換に成功したかを判定する | C++26 | + + ### 比較演算子 | 名前 | 説明 | 対応バージョン | diff --git a/reference/charconv/to_chars_result/op_bool.md b/reference/charconv/to_chars_result/op_bool.md new file mode 100644 index 0000000000..81d3c7f59f --- /dev/null +++ b/reference/charconv/to_chars_result/op_bool.md @@ -0,0 +1,60 @@ +# operator bool +* charconv[meta header] +* std[meta namespace] +* to_chars_result[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr explicit operator bool() const noexcept; +``` + +## 概要 +変換が成功したかを判定する。 + + +## 戻り値 +```cpp +return ec == errc{}; +``` +* errc[link /reference/system_error/errc.md] + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + char out[8]{}; + int value = 123; + + if (auto result = std::to_chars(std::begin(out), std::end(out), value)) { + std::cout << std::string_view(out, result.ptr - out) << std::endl; + } + else { + std::cout << "conversion failed" << std::endl; + } +} +``` +* std::from_chars[link /reference/charconv/from_chars.md] + +### 出力 +``` +123 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2497R0 Testing for success or failure of `` functions](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2497r0.html) From cb8f141b5b77e69be33ca5a897c431e6c721aaf7 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 25 Jan 2024 13:33:38 +0900 Subject: [PATCH 0679/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE?= =?UTF-8?q?=E9=A3=BE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/charconv/to_chars_result/op_bool.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/charconv/to_chars_result/op_bool.md b/reference/charconv/to_chars_result/op_bool.md index 81d3c7f59f..ef9727a300 100644 --- a/reference/charconv/to_chars_result/op_bool.md +++ b/reference/charconv/to_chars_result/op_bool.md @@ -39,7 +39,7 @@ int main() } } ``` -* std::from_chars[link /reference/charconv/from_chars.md] +* std::to_chars[link /reference/charconv/to_chars.md] ### 出力 ``` From 4029cd220f425f42360ad32bf1ba9f64ae9a1fb9 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 25 Jan 2024 14:26:41 +0900 Subject: [PATCH 0680/3948] =?UTF-8?q?C++23=20:=20=E3=80=8C=E5=90=8D?= =?UTF-8?q?=E5=89=8D=E4=BB=98=E3=81=8D=E3=83=A6=E3=83=8B=E3=83=90=E3=83=BC?= =?UTF-8?q?=E3=82=B5=E3=83=AB=E3=82=AD=E3=83=A3=E3=83=A9=E3=82=AF=E3=82=BF?= =?UTF-8?q?=E5=90=8D=E3=80=8D=E3=82=92=E8=BF=BD=E5=8A=A0=20(close=20#1033)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp11/char16_32.md | 1 + lang/cpp23.md | 2 +- .../named_universal_character_escapes.md | 58 +++++++++++++++++++ 4 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 lang/cpp23/named_universal_character_escapes.md diff --git a/implementation-status.md b/implementation-status.md index de55453a28..15fd2f9b8e 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -262,7 +262,7 @@ | P2201R1: [異なる文字エンコーディングをもつ文字列リテラルの連結を不適格とする](/lang/cpp23/mixed_string_literal_concatenation.md.nolink) | `auto a = u8"" L"";`のような異なる文字エンコーディング同士での文字列リテラルを連結を禁止する | Yes | Yes | 2022.2 | Yes | | P2029R4: [文字・文字列リテラル中の数値・ユニバーサルキャラクタのエスケープに関する問題解決](/lang/cpp23/numeric_and_universal_character_escapes_in_character_and_string_literals.md.nolink) | | - | - | - | - | | P2362R3: [1ワイド文字に収まらないワイド文字リテラルを禁止する](/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md.nolink) | エンコード結果として`wchar_t`の大きさに収まらないワイド文字リテラルを禁止する | 13 | 14 | 2023.2 | - | -| P2071R2: [名前付きユニバーサルキャラクタ名](/lang/cpp23/named_universal_character_escapes.md.nolink) | 16進数のユニバーサルキャラクタだけでなく、その文字の名前を入力できるようにする | 13 | 15 | 2023.2 | - | +| P2071R2: [名前付きユニバーサルキャラクタ名](/lang/cpp23/named_universal_character_escapes.md) | 16進数のユニバーサルキャラクタだけでなく、その文字の名前を入力できるようにする | 13 | 15 | 2023.2 | - | | P2096R2: [部分特殊化の汎用化仕様](/lang/cpp23/generalized_wording_for_partial_specializations.md.nolink) | 変数テンプレートの部分特殊化を許可するために部分特殊化の仕様を汎用化 | - | - | - | - | | P2582R1: [継承コンストラクタからのクラステンプレート引数の推論](/lang/cpp23/class_template_argument_deduction_from_inherited.md.nolink) | | - | - | - | - | | P1938R3: [`if consteval`](/lang/cpp23/if_consteval.md.nolink) | コンパイル時の文脈かどうかで分岐させる | 12 | 14 | - | - | diff --git a/lang/cpp11/char16_32.md b/lang/cpp11/char16_32.md index dbac254071..2ded4f7558 100644 --- a/lang/cpp11/char16_32.md +++ b/lang/cpp11/char16_32.md @@ -132,6 +132,7 @@ int main() - [C++20 UTF-8エンコーディングされた文字の型として`char8_t`を追加](/lang/cpp20/char8_t.md) - [C++20 `char16_t`と`char32_t`の文字・文字列リテラルを、文字コードUTF-16/32に規定](/lang/cpp20/make_char16t_char32t_string_literals_be_utf16_32.md) - [ostream `operator<<`](/reference/ostream/basic_ostream/op_ostream_free.md) +- [C++23 名前付きユニバーサルキャラクタ名](/lang/cpp23/named_universal_character_escapes.md) ## 参照 - [WG14 N1040 Extensions for the programming language C to support new character data types](http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1040.pdf) diff --git a/lang/cpp23.md b/lang/cpp23.md index ebfd678938..f39e7dac60 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -52,7 +52,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 | [異なる文字エンコーディングをもつ文字列リテラルの連結を不適格とする](cpp23/mixed_string_literal_concatenation.md.nolink) | `auto a = u8"" L"";`のような異なる文字エンコーディング同士での文字列リテラルを連結を禁止する | | [文字・文字列リテラル中の数値・ユニバーサルキャラクタのエスケープに関する問題解決](cpp23/numeric_and_universal_character_escapes_in_character_and_string_literals.md.nolink) | | | [1ワイド文字に収まらないワイド文字リテラルを禁止する](cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md.nolink) | エンコード結果として`wchar_t`の大きさに収まらないワイド文字リテラルを禁止する | -| [名前付きユニバーサルキャラクタ名](cpp23/named_universal_character_escapes.md.nolink) | 16進数のユニバーサルキャラクタだけでなく、その文字の名前を入力できるようにする | +| [名前付きユニバーサルキャラクタ名](cpp23/named_universal_character_escapes.md) | 16進数のユニバーサルキャラクタだけでなく、その文字の名前を入力できるようにする | ### テンプレート diff --git a/lang/cpp23/named_universal_character_escapes.md b/lang/cpp23/named_universal_character_escapes.md new file mode 100644 index 0000000000..8a38ffbe32 --- /dev/null +++ b/lang/cpp23/named_universal_character_escapes.md @@ -0,0 +1,58 @@ +# 名前付きユニバーサルキャラクタ名 +* cpp23[meta cpp] + +## 概要 +これまで、Unicodeのユニバーサルキャラクタ名を指定するためには、`u8"\u0100"`のように`\u`または`\U`に続いてコードポイントを記述していた。 + +しかしこれではコード上でなんの文字を表しているのかわかりにくいため、文字の名前を指定できるようにする。 + +構文としては`u8"\N{LATIN CAPITAL LETTER A WITH MACRON}"`のように、`\N{…}`の波カッコで囲まれた中に、ユニバーサルキャラクタ名を入力する。 + +使用可能な文字はUnicode規格ISO/IEC 10646で定義される。 + +名前のマッチングは[UAX44-LM2](https://www.unicode.org/reports/tr44/tr44-24.html#UAX44-LM2)を参照しており、これによって + +- 大文字・小文字を区別しない +- ハイフンの省略 +- アンダースコアをハイフンに置換 + +するなど、柔軟な指定ができるようになっている。例として、以下の名前はすべて`U+200B` (ZERO WIDTH SPACE、ゼロ幅スペース) を表すものとして使用できる: + +``` +ZERO WIDTH SPACE +ZERO-WIDTH SPACE +zero-width space +ZERO width S P_A_C E +``` + + +## 例 +```cpp example +#include + +int main() +{ + // ユニバーサルキャラクタ名をコードポイントで指定 + const char8_t* str1 = u8"\u0100\u0300"; + std::cout << reinterpret_cast(str1) << std::endl; + + // ユニバーサルキャラクタ名を名前で指定 + // 上記のコードポイント指定と等価 + const char8_t* str2 = u8"\N{LATIN CAPITAL LETTER A WITH MACRON}\N{COMBINING GRAVE ACCENT}"; + std::cout << reinterpret_cast(str2) << std::endl; +} +``` + +### 出力 +``` +Ā̀ +Ā̀ +``` + +## 関連項目 +- [C++11 `char16_t`と`char32_t`](/lang/cpp11/char16_32.md) + +## 参照 +- [P2173R1 Attributes on Lambda-Expressions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2173r1.pdf) +- [Unicode Character “Ā” (U+0100)](https://www.compart.com/en/unicode/U+0100) +- [Unicode Character “◌̀” (U+0300)](https://www.compart.com/en/unicode/U+0300) From 1f961de614430e79915b8892df2cacb3f87ddb0d Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 25 Jan 2024 14:43:38 +0900 Subject: [PATCH 0681/3948] =?UTF-8?q?C++23=20:=20=E3=80=8C=E5=88=9D?= =?UTF-8?q?=E6=9C=9F=E5=8C=96=E6=96=87=E3=81=A7=E3=81=AE=E5=9E=8B=E3=81=AE?= =?UTF-8?q?=E5=88=A5=E5=90=8D=E5=AE=A3=E8=A8=80=E3=82=92=E8=A8=B1=E5=8F=AF?= =?UTF-8?q?=E3=80=8D=E3=82=92=E8=BF=BD=E5=8A=A0=20(close=20#1024)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- .../selection_statements_with_initializer.md | 1 + ...e-based_for_statements_with_initializer.md | 1 + lang/cpp23.md | 2 +- ...it_statement_to_allow_alias_declaration.md | 47 +++++++++++++++++++ 5 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 lang/cpp23/extend_init_statement_to_allow_alias_declaration.md diff --git a/implementation-status.md b/implementation-status.md index 15fd2f9b8e..e977928a01 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -252,7 +252,7 @@ | P2266R3: [暗黙的なムーブを簡略化](/lang/cpp23/simpler_implicit_move.md.nolink) | 参照を返す関数の`return`文で暗黙的にムーブされない問題を修正 | 13 | 13 | 2022.2 | - | | P1787R6: [スコープと名前ルックアップの仕様整理](/lang/cpp23/declarations_and_where_to_find_them.md.nolink) | 複雑で不完全になっているスコープと名前ルックアップの仕様を整理し、一部の問題を解決する | - | - | - | - | | P2615R1: [無意味なexport宣言を禁止する](/lang/cpp23/meaningful_exports.md.nolink) | | - | - | - | - | -| P2360R0: [初期化文での型の別名宣言を許可](/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md.nolink) | `for (using T = int; T e : v) {}`を許可 | 12 | 14 | 2022.2 | - | +| P2360R0: [初期化文での型の別名宣言を許可](/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md) | `for (using T = int; T e : v) {}`を許可 | 12 | 14 | 2022.2 | - | | P2718R0: [範囲for文が範囲初期化子内で生じた一時オブジェクトを延命することを規定](lang/cpp23/lifetime_extension_in_range_based_for_loop.md) | | - | - | - | - | | P2324R2: [関数末尾のラベルを許可](/lang/cpp23/labels_at_the_end_of_compound_statements.md.nolink) | C互換のため、関数末尾でのgoto文のラベルを許可する | 13 | 16 | 2023.2 | - | | P0847R7: [自身のオブジェクトを明示的にパラメータとして指定する](/lang/cpp23/deducing_this.md.nolink) | メンバ関数が`*this`の型・オブジェクトをパラメータとしてとり、`*this`オブジェクトがconst/非const、左辺値/右辺値であるかをメンバ関数内で識別できるようにする | - | 18 | - | 2022 Update 2 (partial) | diff --git a/lang/cpp17/selection_statements_with_initializer.md b/lang/cpp17/selection_statements_with_initializer.md index 831b706ce3..0039fe4b8a 100644 --- a/lang/cpp17/selection_statements_with_initializer.md +++ b/lang/cpp17/selection_statements_with_initializer.md @@ -205,6 +205,7 @@ if (it != m.end()) { return it->size(); } ## 関連項目 - [C++20 初期化式をともなう範囲for文](/lang/cpp20/range-based_for_statements_with_initializer.md) +- [C++23 初期化文での型の別名宣言を許可](/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md) ## 参照 diff --git a/lang/cpp20/range-based_for_statements_with_initializer.md b/lang/cpp20/range-based_for_statements_with_initializer.md index 8c9e137eae..33db92eb7d 100644 --- a/lang/cpp20/range-based_for_statements_with_initializer.md +++ b/lang/cpp20/range-based_for_statements_with_initializer.md @@ -115,6 +115,7 @@ int main() ## 関連項目 - [C++17 if文とswitch文の条件式と初期化を分離](/lang/cpp17/selection_statements_with_initializer.md) +- [C++23 初期化文での型の別名宣言を許可](/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md) ## 参照 diff --git a/lang/cpp23.md b/lang/cpp23.md index f39e7dac60..046813918b 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -30,7 +30,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| -| [初期化文での型の別名宣言を許可](cpp23/extend_init_statement_to_allow_alias_declaration.md.nolink) | `for (using T = int; T e : v) {}`を許可 | +| [初期化文での型の別名宣言を許可](cpp23/extend_init_statement_to_allow_alias_declaration.md) | `for (using T = int; T e : v) {}`を許可 | | [範囲for文が範囲初期化子内で生じた一時オブジェクトを延命することを規定](cpp23/lifetime_extension_in_range_based_for_loop.md) | 範囲初期化子内で生じた一時オブジェクトは範囲for文の終わりまで延命される | | [関数末尾のラベルを許可](cpp23/labels_at_the_end_of_compound_statements.md.nolink) | C互換のため、関数末尾でのgoto文のラベルを許可する | diff --git a/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md b/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md new file mode 100644 index 0000000000..69cb5695f8 --- /dev/null +++ b/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md @@ -0,0 +1,47 @@ +# 初期化文での型の別名宣言を許可 +* cpp23[meta cpp] + +## 概要 +`if`文、`switch`文、範囲`for`文で初期化文を指定できるが、C++20までその初期化文では`typedef`による型の別名定義はできたが、`using`による型の別名定義はできなかった。 + +C++23では`using`による別名定義もまた初期化文でできるようになる。 + + +## 仕様 +初期化文 (init-statement) に、別名宣言 (alias-declaration) を追加 (`typedef`はsimple-declarationに含まれる)。 + +``` +init-statement: + expression-statement + simple-declaration + alias-declaration +``` + +## 例 +```cpp example +#include + +int f() { return 1; } + +int main() +{ + // C++20 : OK + if (typedef int T; T x = f()) { + std::cout << x << std::endl; + } + + // C++20 : OK + // C++23 : OK + if (using T = int; T x = f()) { + std::cout << x << std::endl; + } +} +``` + +## 関連項目 +- [C++17 if文とswitch文の条件式と初期化を分離](/lang/cpp17/selection_statements_with_initializer.md) +- [C++20 初期化式をともなう範囲for文](/lang/cpp20/range-based_for_statements_with_initializer.md) + + +## 参照 +- [P2360R0 Extend init-statement to allow alias-declaration](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2360r0.html) From 39555de7e83c4f34e9bc10c1776f3278bd427f64 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Thu, 25 Jan 2024 15:29:06 +0900 Subject: [PATCH 0682/3948] =?UTF-8?q?from=5Fchars=20:=20C++26=E3=81=AE?= =?UTF-8?q?=E4=BE=8B=E3=81=A7=E7=B5=90=E6=9E=9C=E3=82=92=E5=8F=97=E3=81=91?= =?UTF-8?q?=E3=82=8B=E5=A4=89=E6=95=B0=E3=82=92=E3=82=A4=E3=83=B3=E3=83=A9?= =?UTF-8?q?=E3=82=A4=E3=83=B3=E5=8C=96=20#1179?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/charconv/from_chars.md | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/reference/charconv/from_chars.md b/reference/charconv/from_chars.md index f728239d03..cd41fca037 100644 --- a/reference/charconv/from_chars.md +++ b/reference/charconv/from_chars.md @@ -286,11 +286,10 @@ int main() { { const char str[] = "00000123456789 is decimal"; - int value{}; //(1) 10進数文字列からintへ変換 //変換変換の成否判定に`operator bool`を使用 - if (std::from_chars(std::begin(str), std::end(str), value)) { + if (int value{}; std::from_chars(std::begin(str), std::end(str), value)) { std::cout << value << std::endl; } else { @@ -300,10 +299,9 @@ int main() { const char str[] = "1111111111111111 is (65535)_10"; - int value{}; //(1) 2進数文字列からintへ変換 - if (std::from_chars(std::begin(str), std::end(str), value, 2)) { + if (int value{}; std::from_chars(std::begin(str), std::end(str), value, 2)) { std::cout << value << std::endl; } else { @@ -313,10 +311,9 @@ int main() { const char str[] = "Z is (35)_10"; - int value{}; //(1) 36進数文字列からintへ変換 - if (std::from_chars(std::begin(str), std::end(str), value, 36)) { + if (int value{}; std::from_chars(std::begin(str), std::end(str), value, 36)) { std::cout << value << std::endl; } else { @@ -326,10 +323,9 @@ int main() { const char str[] = "255"; - char value{}; //(1) 失敗する例 MSVCにおけるcharの範囲は-128~127 - if (std::from_chars(std::begin(str), std::end(str), value)) { + if (char value{}; std::from_chars(std::begin(str), std::end(str), value)) { std::cout << value << std::endl; } else { @@ -341,10 +337,9 @@ int main() { const char str[] = "3.1415926535897932384626433832795 is pi"; - double value{}; //(3) 固定小数表記文字列からdoubleへ変換 - if (std::from_chars(std::begin(str), std::end(str), value)) { + if (double value{}; std::from_chars(std::begin(str), std::end(str), value)) { std::cout << value << std::endl; } else { @@ -354,10 +349,9 @@ int main() { const char str[] = "1.10001e-01 is Liouville number"; - double value{}; //(3) 指数表記文字列からdoubleへ変換 - if (std::from_chars(std::begin(str), std::end(str), value)) { + if (double value{}; std::from_chars(std::begin(str), std::end(str), value)) { std::cout << value << std::endl; } else { @@ -367,10 +361,9 @@ int main() { const char str[] = "1.c29068986fcdf000p-4 is Liouville number"; - double value{}; //(3) 16進指数表記文字列からdoubleへ変換 - if (std::from_chars(std::begin(str), std::end(str), value, std::chars_format::hex)) { + if (double value{}; std::from_chars(std::begin(str), std::end(str), value, std::chars_format::hex)) { std::cout << value << std::endl; } else { @@ -380,10 +373,9 @@ int main() { const char str[] = " 3.1415926535897932384626433832795 is pi"; - double value{}; //(3) 失敗する例 ホワイトスペース読み飛ばし - if (std::from_chars(std::begin(str), std::end(str), value)) { + if (double value{}; std::from_chars(std::begin(str), std::end(str), value)) { std::cout << value << std::endl; } else { @@ -393,10 +385,9 @@ int main() { const char str[] = "NaN"; - double value{}; //(3) NaNの読み取り - if (std::from_chars(std::begin(str), std::end(str), value)) { + if (double value{}; std::from_chars(std::begin(str), std::end(str), value)) { std::cout << value << std::endl; } else { @@ -406,10 +397,9 @@ int main() { const char str[] = "-INF"; - double value{}; //(3) INFの読み取り - if (std::from_chars(std::begin(str), std::end(str), value)) { + if (double value{}; std::from_chars(std::begin(str), std::end(str), value)) { std::cout << value << std::endl; } else { From 754290d816bc9ce131e4a3525b46ca68cd027be5 Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 25 Jan 2024 19:19:32 +0900 Subject: [PATCH 0683/3948] =?UTF-8?q?=E7=94=A8=E8=AA=9E=E7=B5=B1=E4=B8=80:?= =?UTF-8?q?=20=E7=9B=B4=E6=8E=A5=E9=9D=9E=E3=83=AA=E3=82=B9=E3=83=88?= =?UTF-8?q?=E5=88=9D=E6=9C=9F=E5=8C=96(direct-non-list-initialization)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_DEFINED_WORDS.json | 3 +++ reference/expected/expected.void/transform.md | 4 ++-- reference/expected/expected.void/transform_error.md | 4 ++-- reference/expected/expected/transform.md | 4 ++-- reference/expected/expected/transform_error.md | 4 ++-- reference/generator/generator/promise_type/yield_value.md | 2 +- reference/optional/optional/transform.md | 4 ++-- 7 files changed, 14 insertions(+), 11 deletions(-) diff --git a/GLOBAL_DEFINED_WORDS.json b/GLOBAL_DEFINED_WORDS.json index 0616e27d83..296f9b9ac4 100644 --- a/GLOBAL_DEFINED_WORDS.json +++ b/GLOBAL_DEFINED_WORDS.json @@ -55,6 +55,9 @@ "値初期化": { "desc": "`T x{};`構文での初期化。組み込み型の場合はゼロ相当の値で、クラス型の場合はデフォルトコンストラクタで初期化する。配列型の場合は各要素が再帰的に値初期化される" }, + "直接非リスト初期化": { + "desc": "direct-non-list-initialization。リスト初期化ではない直接初期化" + }, "値構築": { "redirect": "値初期化" }, diff --git a/reference/expected/expected.void/transform.md b/reference/expected/expected.void/transform.md index d8214747d7..0729603452 100644 --- a/reference/expected/expected.void/transform.md +++ b/reference/expected/expected.void/transform.md @@ -47,11 +47,11 @@ class expected { ## 効果 - (1), (2) : 次の効果をもつ - エラー値を保持していたら、`expected(`[`unexpect`](../unexpect_t.md)`,` [`error()`](error.md)`)`を返す。 - - 型`U`が(CV修飾された)`void`でなければ、正常値を[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f))`で非直接リスト初期化した`expected`オブジェクトを返す。 + - 型`U`が(CV修飾された)`void`でなければ、正常値を[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f))`で直接非リスト初期化した`expected`オブジェクトを返す。 - そうでなければ、[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f))`を評価し、`expected()`を返す。 - (3), (4) : 次の効果をもつ - エラー値を保持していたら、`expected(`[`unexpect`](../unexpect_t.md)`,` [`std::move`](/reference/utility/move.md)`(`[`error()`](error.md)`))`を返す。 - - 型`U`が(CV修飾された)`void`でなければ、正常値を[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f))`で非直接リスト初期化した`expected`オブジェクトを返す。 + - 型`U`が(CV修飾された)`void`でなければ、正常値を[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f))`で直接非リスト初期化した`expected`オブジェクトを返す。 - そうでなければ、[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f))`を評価し、`expected()`を返す。 diff --git a/reference/expected/expected.void/transform_error.md b/reference/expected/expected.void/transform_error.md index 07369cab16..5e9310a81d 100644 --- a/reference/expected/expected.void/transform_error.md +++ b/reference/expected/expected.void/transform_error.md @@ -42,10 +42,10 @@ class expected { ## 効果 - (1), (2) : 次の効果をもつ - 正常値を保持していたら、`expected()`を返す。 - - そうでなければ、エラー値を[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`error()`](error.md)`)`で非直接リスト初期化した`expected`オブジェクトを返す。 + - そうでなければ、エラー値を[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`error()`](error.md)`)`で直接非リスト初期化した`expected`オブジェクトを返す。 - (3), (4) : 次の効果をもつ - 正常値を保持していたら、`expected()`を返す。 - - そうでなければ、エラー値を[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`std::move`](/reference/utility/move.md)`(`[`error()`](error.md)`))`で非直接リスト初期化した`expected`オブジェクトを返す。 + - そうでなければ、エラー値を[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`std::move`](/reference/utility/move.md)`(`[`error()`](error.md)`))`で直接非リスト初期化した`expected`オブジェクトを返す。 ## 備考 diff --git a/reference/expected/expected/transform.md b/reference/expected/expected/transform.md index 74439250db..8a3259a49e 100644 --- a/reference/expected/expected/transform.md +++ b/reference/expected/expected/transform.md @@ -46,11 +46,11 @@ class expected { ## 効果 - (1), (2) : 次の効果をもつ - エラー値を保持していたら、`expected(`[`unexpect`](../unexpect_t.md)`,` [`error()`](error.md)`)`を返す。 - - 型`U`が(CV修飾された)`void`でなければ、正常値を[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`value()`](value.md)`)`で非直接リスト初期化した`expected`オブジェクトを返す。 + - 型`U`が(CV修飾された)`void`でなければ、正常値を[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`value()`](value.md)`)`で直接非リスト初期化した`expected`オブジェクトを返す。 - そうでなければ、[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`value()`](value.md)`)`を評価し、`expected()`を返す。 - (3), (4) : 次の効果をもつ - エラー値を保持していたら、`expected(`[`unexpect`](../unexpect_t.md)`,` [`std::move`](/reference/utility/move.md)`(`[`error()`](error.md)`))`を返す。 - - 型`U`が(CV修飾された)`void`でなければ、正常値を[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`std::move`](/reference/utility/move.md)`(`[`value()`](value.md)`))`で非直接リスト初期化した`expected`オブジェクトを返す。 + - 型`U`が(CV修飾された)`void`でなければ、正常値を[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`std::move`](/reference/utility/move.md)`(`[`value()`](value.md)`))`で直接非リスト初期化した`expected`オブジェクトを返す。 - そうでなければ、[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`std::move`](/reference/utility/move.md)`(`[`value()`](value.md)`))`を評価し、`expected()`を返す。 diff --git a/reference/expected/expected/transform_error.md b/reference/expected/expected/transform_error.md index e9edfd948f..d36c518c91 100644 --- a/reference/expected/expected/transform_error.md +++ b/reference/expected/expected/transform_error.md @@ -46,10 +46,10 @@ class expected { ## 効果 - (1), (2) : 次の効果をもつ - 正常値を保持していたら、`expected(`[`in_place`](/reference/utility/in_place_t.md)`,` [`value()`](value.md)`)`を返す。 - - そうでなければ、エラー値を[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`error()`](error.md)`)`で非直接リスト初期化した`expected`オブジェクトを返す。 + - そうでなければ、エラー値を[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`error()`](error.md)`)`で直接非リスト初期化した`expected`オブジェクトを返す。 - (3), (4) : 次の効果をもつ - 正常値を保持していたら、`expected(`[`in_place`](/reference/utility/in_place_t.md)`,` [`std::move`](/reference/utility/move.md)`(`[`value()`](value.md)`))`を返す。 - - そうでなければ、エラー値を[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`std::move`](/reference/utility/move.md)`(`[`error()`](error.md)`))`で非直接リスト初期化した`expected`オブジェクトを返す。 + - そうでなければ、エラー値を[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`std::move`](/reference/utility/move.md)`(`[`error()`](error.md)`))`で直接非リスト初期化した`expected`オブジェクトを返す。 ## 備考 diff --git a/reference/generator/generator/promise_type/yield_value.md b/reference/generator/generator/promise_type/yield_value.md index 4befc49bef..0bf6d5bff7 100644 --- a/reference/generator/generator/promise_type/yield_value.md +++ b/reference/generator/generator/promise_type/yield_value.md @@ -79,7 +79,7 @@ return yield_value(ranges::elements_of(nested( ## 戻り値 - (1) : [`suspend_always{}`](/reference/coroutine/suspend_always.md) -- (2) : `lval`を用いて直接非リスト初期化(direct-non-list-initialized)された[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`<`[`yielded`](../../generator.md)`>`型オブジェクトを保持し、[説明専用メンバ`value_`](../promise_type.md)が保持されたオブジェクトを指してコルーチンを中断(suspend)するメンバ関数をもつ、未規定の型の[Awaitableオブジェクト](/lang/cpp20/coroutines.md)。 +- (2) : `lval`を用いて直接非リスト初期化された[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`<`[`yielded`](../../generator.md)`>`型オブジェクトを保持し、[説明専用メンバ`value_`](../promise_type.md)が保持されたオブジェクトを指してコルーチンを中断(suspend)するメンバ関数をもつ、未規定の型の[Awaitableオブジェクト](/lang/cpp20/coroutines.md)。 - (3) : ジェネレータ`g.range`の所有権を受け取り、メンバ関数`await_ready`は`false`を返し、メンバ関数`await_suspend`は`x`のアクティブスタックに`g.range`に対応する[コルーチンハンドル](/reference/coroutine/coroutine_handle.md)をpushしてから`g.range`を再開(resume)し、メンバ関数`await_resume`は[説明専用メンバ`except_`](../promise_type.md)が例外を保持している場合に[`rethrow_exception`](/reference/exception/rethrow_exception.md)`(except_)`を行う、未規定の型の[Awaitableオブジェクト](/lang/cpp20/coroutines.md)。 diff --git a/reference/optional/optional/transform.md b/reference/optional/optional/transform.md index b6206e0711..17ceb6323b 100644 --- a/reference/optional/optional/transform.md +++ b/reference/optional/optional/transform.md @@ -45,8 +45,8 @@ class optional { ## 効果 -- (1), (3) : `*this`が有効値を保持するときは、[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`value()`](value.md)`)`で非リスト初期化した`optional`オブジェクトを返す。有効値を保持しないときは、`optional()`を返す。 -- (2), (4) : `*this`が有効値を保持するときは、[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`std::move`](/reference/utility/move.md)`(`[`value()`](value.md)`))`で非リスト初期化した`optional`オブジェクトを返す。有効値を保持しないときは、`optional()`を返す。 +- (1), (3) : `*this`が有効値を保持するときは、[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`value()`](value.md)`)`で直接非リスト初期化した`optional`オブジェクトを返す。有効値を保持しないときは、`optional()`を返す。 +- (2), (4) : `*this`が有効値を保持するときは、[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`std::move`](/reference/utility/move.md)`(`[`value()`](value.md)`))`で直接非リスト初期化した`optional`オブジェクトを返す。有効値を保持しないときは、`optional()`を返す。 ## 備考 From 688d25f9d958dfbf4d71fe1cba57fd023234b93a Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 29 Jan 2024 18:47:42 +0900 Subject: [PATCH 0684/3948] =?UTF-8?q?C++23=20:=20=E3=80=8C=E3=82=A8?= =?UTF-8?q?=E3=82=B9=E3=82=B1=E3=83=BC=E3=83=97=E3=82=B7=E3=83=BC=E3=82=B1?= =?UTF-8?q?=E3=83=B3=E3=82=B9=E3=81=AE=E5=8C=BA=E5=88=87=E3=82=8A=E3=80=8D?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20(close=20#1020)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp11/char16_32.md | 1 + lang/cpp23.md | 2 +- lang/cpp23/delimited_escape_sequences.md | 39 ++++++++++++++++++++++++ 4 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 lang/cpp23/delimited_escape_sequences.md diff --git a/implementation-status.md b/implementation-status.md index e977928a01..c8aaf2c0d9 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -248,7 +248,7 @@ | 言語機能 | 説明 | [GCC][gcc] | [Clang][clang] | [ICX][icx] | [MSVC][msvc] | |----------|------|------------|----------------|------------|--------------| | P0330R8: [(符号付き)`size_t`リテラルのためのサフィックス](/lang/cpp23/literal_suffix_for_signed_size_t.md) | `42z`/`42Z`とすることで`size_t`に対応する符号付き整数型のリテラルとする | 11 | 13 | 2022.2 | - | -| P2290R3: [エスケープシーケンスの区切り](/lang/cpp23/delimited_escape_sequences.md.nolink) | エスケープシーケンスの範囲を明確にする構文を追加する | 13 | 15 | 2023.2 | - | +| P2290R3: [エスケープシーケンスの区切り](/lang/cpp23/delimited_escape_sequences.md) | エスケープシーケンスの範囲を明確にする構文を追加する | 13 | 15 | 2023.2 | - | | P2266R3: [暗黙的なムーブを簡略化](/lang/cpp23/simpler_implicit_move.md.nolink) | 参照を返す関数の`return`文で暗黙的にムーブされない問題を修正 | 13 | 13 | 2022.2 | - | | P1787R6: [スコープと名前ルックアップの仕様整理](/lang/cpp23/declarations_and_where_to_find_them.md.nolink) | 複雑で不完全になっているスコープと名前ルックアップの仕様を整理し、一部の問題を解決する | - | - | - | - | | P2615R1: [無意味なexport宣言を禁止する](/lang/cpp23/meaningful_exports.md.nolink) | | - | - | - | - | diff --git a/lang/cpp11/char16_32.md b/lang/cpp11/char16_32.md index 2ded4f7558..a37cc16fc8 100644 --- a/lang/cpp11/char16_32.md +++ b/lang/cpp11/char16_32.md @@ -133,6 +133,7 @@ int main() - [C++20 `char16_t`と`char32_t`の文字・文字列リテラルを、文字コードUTF-16/32に規定](/lang/cpp20/make_char16t_char32t_string_literals_be_utf16_32.md) - [ostream `operator<<`](/reference/ostream/basic_ostream/op_ostream_free.md) - [C++23 名前付きユニバーサルキャラクタ名](/lang/cpp23/named_universal_character_escapes.md) +- [C++23 エスケープシーケンスの区切り](/lang/cpp23/delimited_escape_sequences.md) ## 参照 - [WG14 N1040 Extensions for the programming language C to support new character data types](http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1040.pdf) diff --git a/lang/cpp23.md b/lang/cpp23.md index 046813918b..ef6b478fd0 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -12,7 +12,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| | [(符号付き)`size_t`リテラルのためのサフィックス](cpp23/literal_suffix_for_signed_size_t.md) | `42z`/`42Z`とすることで`size_t`に対応する符号付き整数型のリテラルとする | -| [エスケープシーケンスの区切り](cpp23/delimited_escape_sequences.md.nolink) | エスケープシーケンスの範囲を明確にする構文を追加する | +| [エスケープシーケンスの区切り](cpp23/delimited_escape_sequences.md) | エスケープシーケンスの範囲を明確にする構文を追加する | | [暗黙的なムーブを簡略化](cpp23/simpler_implicit_move.md.nolink) | 参照を返す関数の`return`文で暗黙的にムーブされない問題を修正 | これらに加えて、ライブラリ機能として拡張浮動小数点数型が定義された。[``](/reference/stdfloat.md)を参照。 diff --git a/lang/cpp23/delimited_escape_sequences.md b/lang/cpp23/delimited_escape_sequences.md new file mode 100644 index 0000000000..975f02e067 --- /dev/null +++ b/lang/cpp23/delimited_escape_sequences.md @@ -0,0 +1,39 @@ +# エスケープシーケンスの区切り +* cpp23[meta cpp] + +## 概要 +C++23では、文字列リテラル中に記述するエスケープシーケンスとユニバーサルキャラクタ名の範囲を明確にするための波カッコ (`{}`) で囲む構文が追加される。 + +```cpp +// 8進数のエスケープシーケンス +"\18"; // 8は8進数に含まれないので'\1'と'8'の2文字を表す +"\o{1}8"; // C++23 : 上記と等価 +"\o{18}"; // C++23 : コンパイルエラー! + +// 16進数のエスケープシーケンス +"\xabc"; // 1文字 +"\xab" "c"; // 2文字 (文字列リテラルを分けて連結させる回避策) +"\x{ab}c"; // C++23 : 2文字を表す + +// ユニバーサルキャラクタ名 +u8"\u0001F1F8"; // 4文字か8文字のみ指定できる制限があるので先頭0埋めする +u8"\u{1F1F8}"; // C++23 : 5文字のコードポイントも記述できる +``` + +8進数エスケープシーケンスには3文字までという制限、ユニバーサルキャラクタ名には4文字または8文字の制限があったが、この構文ではその制限はない。 + + +## この機能が必要になった背景・経緯 +### ユニバーサルキャラクタ名の4文字・8文字制限 +ユニバーサルキャラクタ名は4文字か8文字で指定する制限があったため、5文字のコードポイントを指定するために`\U0001F1F8`のように先頭を0埋めする必要があった。 + +### エスケープシーケンスの範囲を表現しにくい問題 +8進数または16進数によるエスケープシーケンスは、8進数は3文字まで、16進数は無制限の文字数という制限の違いがあり、また、8進数または16進数ではない文字が現れることでエスケープシーケンスの範囲が終了するため注意が必要であった。 + + +## 関連項目 +- [C++11 `char16_t`と`char32_t`](/lang/cpp11/char16_32.md) + + +## 参照 +- [P2290R3 Delimited escape sequences](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2290r3.pdf) From d90163c98ecf59b7a0087365c56a284a6ee99e7b Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 29 Jan 2024 18:50:46 +0900 Subject: [PATCH 0685/3948] =?UTF-8?q?C++23=20:=20=E3=80=8C=E3=82=A8?= =?UTF-8?q?=E3=82=B9=E3=82=B1=E3=83=BC=E3=83=97=E3=82=B7=E3=83=BC=E3=82=B1?= =?UTF-8?q?=E3=83=B3=E3=82=B9=E3=81=AE=E5=8C=BA=E5=88=87=E3=82=8A=E3=80=8D?= =?UTF-8?q?=E3=82=92=E6=96=87=E5=AD=97=E5=88=97=E3=81=AE=E9=A0=85=E7=9B=AE?= =?UTF-8?q?=E3=81=AB=E7=A7=BB=E5=8B=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp23.md b/lang/cpp23.md index ef6b478fd0..848c72d20c 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -12,7 +12,6 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| | [(符号付き)`size_t`リテラルのためのサフィックス](cpp23/literal_suffix_for_signed_size_t.md) | `42z`/`42Z`とすることで`size_t`に対応する符号付き整数型のリテラルとする | -| [エスケープシーケンスの区切り](cpp23/delimited_escape_sequences.md) | エスケープシーケンスの範囲を明確にする構文を追加する | | [暗黙的なムーブを簡略化](cpp23/simpler_implicit_move.md.nolink) | 参照を返す関数の`return`文で暗黙的にムーブされない問題を修正 | これらに加えて、ライブラリ機能として拡張浮動小数点数型が定義された。[``](/reference/stdfloat.md)を参照。 @@ -50,6 +49,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| | [異なる文字エンコーディングをもつ文字列リテラルの連結を不適格とする](cpp23/mixed_string_literal_concatenation.md.nolink) | `auto a = u8"" L"";`のような異なる文字エンコーディング同士での文字列リテラルを連結を禁止する | +| [エスケープシーケンスの区切り](cpp23/delimited_escape_sequences.md) | エスケープシーケンスの範囲を明確にする構文を追加する | | [文字・文字列リテラル中の数値・ユニバーサルキャラクタのエスケープに関する問題解決](cpp23/numeric_and_universal_character_escapes_in_character_and_string_literals.md.nolink) | | | [1ワイド文字に収まらないワイド文字リテラルを禁止する](cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md.nolink) | エンコード結果として`wchar_t`の大きさに収まらないワイド文字リテラルを禁止する | | [名前付きユニバーサルキャラクタ名](cpp23/named_universal_character_escapes.md) | 16進数のユニバーサルキャラクタだけでなく、その文字の名前を入力できるようにする | From a199a4943b749cbfa776d0ff75a77bd6ec885fea Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Tue, 30 Jan 2024 03:23:53 +0900 Subject: [PATCH 0686/3948] Update lifetime_extension_in_range_based_for_loop.md #1246 --- ...etime_extension_in_range_based_for_loop.md | 74 ++++++++++--------- 1 file changed, 41 insertions(+), 33 deletions(-) diff --git a/lang/cpp23/lifetime_extension_in_range_based_for_loop.md b/lang/cpp23/lifetime_extension_in_range_based_for_loop.md index ec0d00745b..7c8407e824 100644 --- a/lang/cpp23/lifetime_extension_in_range_based_for_loop.md +++ b/lang/cpp23/lifetime_extension_in_range_based_for_loop.md @@ -14,7 +14,7 @@ for ( init-statement(opt) for-range-declaration : for-range-initializer ) statem ただし、次の場合には適用されない。 -- 一時オブジェクトが関数の引数の場合 +- 一時オブジェクトが関数の引数として生成された場合 - 一時オブジェクトの(この規定が適用されない場合の)寿命が `for-range-initializer` 完全式の終わりではない場合 ## 例 @@ -45,39 +45,20 @@ U B ``` -以下の例では、`getstr()` が返す一時オブジェクトは関数の引数だから、延命されない。 +範囲for文の危険性を減らすだけではなく、この仕様はRAIIのためのオブジェクトを無名で作るのに使うことができる。 -```cpp example -import std; - -std::vector getstr() { - return {"hello", "UB"}; -} - -std::string wrap(const std::string& x) { - return "[" + x + "]"; -} - -int main() -{ - for(auto&& c : wrap(getstr()[0])) { - std::println("{}", c); - } -} -``` - -### 出力 ``` -[ -h -e -l -l -o -] +// P2718R0より引用 +void f() { + std::vector v = { 42, 17, 13 }; + std::mutex m; + for (int x : static_cast(std::lock_guard(m)), v) { + ... + } +} ``` - - +ここでは、カンマ演算子を活用して実際にイテレートする範囲とは別にロックを獲得している。 +この一時オブジェクトは `for-range-initializer` の中で生じているから、範囲for文の終わりまでロックを維持できる。 ## この機能が必要になった背景・経緯 @@ -133,6 +114,32 @@ int main() C++23では、`getstr()` の呼び出しが `for-range-initializer` の中にあるため、返った一時オブジェクトは参照 `r` と同じ寿命になる。したがってダングリング参照は発生せず、このコードは安全である。 +### 例外規定について + +"一時オブジェクトが関数の引数として生成された場合" とは、次のサンプルコードにおける `f2(T t)` の実引数 `t` として、呼び出される関数のスコープで生成されるような場合である。 + +```cpp +// P2718R0より引用 +using T = std::list; +const T& f1(const T& t) { return t; } +const T& f2(T t) { return t; } +T g(); + +void foo() { + for (auto e : f1(g())) {} // OK: g()の戻り値は延命される + for (auto e : f2(g())) {} // 未定義動作 +} +``` + +このような `t` は呼び出される関数から戻ると破棄されるから、その参照を返すことは未定義動作である。 +ここで未定義動作になることは範囲for文の危険性と無関係なので、寿命を延長するという解釈ができないようにこの例外規定が入った。 + +議論: +- この `t` は "一時オブジェクトの寿命が `for-range-initializer` 完全式の終わりではない場合" にも該当すると考えられる +- この `t` は、構文的に見ると `for-range-initializer` の中で生じたとは言えないという意見もある +- "`for-range-initializer` の中" を実行時のことだと解釈すると、そこから呼び出された関数の中なども含むことになるが、それを排除する規定が "一時オブジェクトの寿命が `for-range-initializer` 完全式の終わりではない場合" ではないか + - インライン展開されたときなどに効いてくるのかもしれない + ## 検討されたほかの選択肢 一時オブジェクトの寿命について、範囲for文に限定しない汎用的な方法も検討されたが、最終的には範囲for文の例外規定となった。 @@ -141,7 +148,8 @@ C++23では、`getstr()` の呼び出しが `for-range-initializer` の中にあ - [範囲for文](/lang/cpp11/range_based_for.md) - ## 参照 - +- [P2718R0 Wording for P2644R1 Fix for Range-based for Loop](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2718r0.html) - [地に足のついた範囲for文 - 地面を見下ろす少年の足蹴にされる私](https://onihusube.hatenablog.com/entry/2022/12/05/000923) +- [範囲for文範囲初期化子内の一時オブジェクト延命の説明見直し + #1246](https://github.com/cpprefjp/site/issues/1246) From 1666a756c791c4d31b017f89f3d20d55b0bd99be Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 30 Jan 2024 17:22:09 +0900 Subject: [PATCH 0687/3948] =?UTF-8?q?C++23=20:=20=E3=80=8C=E8=A4=87?= =?UTF-8?q?=E5=90=88=E6=96=87=E3=81=AE=E6=9C=AB=E5=B0=BE=E3=81=B8=E3=81=AE?= =?UTF-8?q?=E3=83=A9=E3=83=99=E3=83=AB=E3=82=92=E8=A8=B1=E5=8F=AF=E3=80=8D?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20(close=20#1025)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp23.md | 2 +- ...abels_at_the_end_of_compound_statements.md | 29 +++++++++++++++++++ 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 lang/cpp23/labels_at_the_end_of_compound_statements.md diff --git a/implementation-status.md b/implementation-status.md index c8aaf2c0d9..25bc440cbc 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -254,7 +254,7 @@ | P2615R1: [無意味なexport宣言を禁止する](/lang/cpp23/meaningful_exports.md.nolink) | | - | - | - | - | | P2360R0: [初期化文での型の別名宣言を許可](/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md) | `for (using T = int; T e : v) {}`を許可 | 12 | 14 | 2022.2 | - | | P2718R0: [範囲for文が範囲初期化子内で生じた一時オブジェクトを延命することを規定](lang/cpp23/lifetime_extension_in_range_based_for_loop.md) | | - | - | - | - | -| P2324R2: [関数末尾のラベルを許可](/lang/cpp23/labels_at_the_end_of_compound_statements.md.nolink) | C互換のため、関数末尾でのgoto文のラベルを許可する | 13 | 16 | 2023.2 | - | +| P2324R2: [複合文の末尾へのラベルを許可](/lang/cpp23/labels_at_the_end_of_compound_statements.md) | C互換のため、複合文の末尾でのgoto文のラベルを許可する | 13 | 16 | 2023.2 | - | | P0847R7: [自身のオブジェクトを明示的にパラメータとして指定する](/lang/cpp23/deducing_this.md.nolink) | メンバ関数が`*this`の型・オブジェクトをパラメータとしてとり、`*this`オブジェクトがconst/非const、左辺値/右辺値であるかをメンバ関数内で識別できるようにする | - | 18 | - | 2022 Update 2 (partial) | | P1847R4: [アクセス制御の異なるメンバ変数のレイアウトを宣言順に規定](/lang/cpp23/make_declaration_order_layout_mandated.md.nolink) | アクセス制御の異なるメンバ変数のレイアウトが実装によって異なっていたため仕様を規定 | Yes | Yes | - | 2022 | | P2128R6: [添字演算子の多次元サポート](/lang/cpp23/multidimensional_subscript_operator.nd.nolink) | `operator[](int x, int y, int z)`のように添字演算子のオーバーロードで複数のパラメータをとることを許可 | 12 | 15 | 2022.2 | - | diff --git a/lang/cpp23.md b/lang/cpp23.md index 848c72d20c..3a42342d4b 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -31,7 +31,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 |----------|------| | [初期化文での型の別名宣言を許可](cpp23/extend_init_statement_to_allow_alias_declaration.md) | `for (using T = int; T e : v) {}`を許可 | | [範囲for文が範囲初期化子内で生じた一時オブジェクトを延命することを規定](cpp23/lifetime_extension_in_range_based_for_loop.md) | 範囲初期化子内で生じた一時オブジェクトは範囲for文の終わりまで延命される | -| [関数末尾のラベルを許可](cpp23/labels_at_the_end_of_compound_statements.md.nolink) | C互換のため、関数末尾でのgoto文のラベルを許可する | +| [複合文の末尾へのラベルを許可](cpp23/labels_at_the_end_of_compound_statements.md) | C互換のため、複合文の末尾でのgoto文のラベルを許可する | ### クラス diff --git a/lang/cpp23/labels_at_the_end_of_compound_statements.md b/lang/cpp23/labels_at_the_end_of_compound_statements.md new file mode 100644 index 0000000000..2d85ec9965 --- /dev/null +++ b/lang/cpp23/labels_at_the_end_of_compound_statements.md @@ -0,0 +1,29 @@ +# 複合文の末尾へのラベルを許可 +* cpp23[meta cpp] + +## 概要 +C言語 (C20) との互換性のため、C言語で許可されていた複合文の末尾 (関数末尾など`{}`ブロックの末尾) へのgotoラベルを許可する。 + +関数末尾の例: + +```cpp +void foo(void) +{ +first: // C20:OK C++:OK + int x; +second: // C20:OK C++:OK + x = 1; +last: // C20:OK C++23:OK +} +``` + + +## この機能が必要になった背景・経緯 +CではN2508の提案により、宣言の前など、複合文のあらゆる箇所にgotoラベルを置けるようになり、C++との互換性が改善した。C++では宣言は文として扱われるため宣言の前には以前からgotoラベルを置くことができた。ただし、C++では複合文の末尾にはgotoラベルを置けないという非互換が残っていた。 + +C++23でこの機能を導入することにより、gotoラベルを置ける場所についての非互換がなくなる。 + + +## 参照 +- [P2324R2 Labels at the end of compound statements (C compatibility)](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2324r2.pdf) +- [C2X Proposal: WG14 N2508 Free Positioning of Labels Inside Compound Statements (updates N2496)](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2508.pdf) From 6c5bf9be0d38330fdb3f611e9ac27894cab5e1a8 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Tue, 30 Jan 2024 22:13:14 +0900 Subject: [PATCH 0688/3948] Update lifetime_extension_in_range_based_for_loop.md #1246 --- ...etime_extension_in_range_based_for_loop.md | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/lang/cpp23/lifetime_extension_in_range_based_for_loop.md b/lang/cpp23/lifetime_extension_in_range_based_for_loop.md index 7c8407e824..4265b36f11 100644 --- a/lang/cpp23/lifetime_extension_in_range_based_for_loop.md +++ b/lang/cpp23/lifetime_extension_in_range_based_for_loop.md @@ -45,21 +45,6 @@ U B ``` -範囲for文の危険性を減らすだけではなく、この仕様はRAIIのためのオブジェクトを無名で作るのに使うことができる。 - -``` -// P2718R0より引用 -void f() { - std::vector v = { 42, 17, 13 }; - std::mutex m; - for (int x : static_cast(std::lock_guard(m)), v) { - ... - } -} -``` -ここでは、カンマ演算子を活用して実際にイテレートする範囲とは別にロックを獲得している。 -この一時オブジェクトは `for-range-initializer` の中で生じているから、範囲for文の終わりまでロックを維持できる。 - ## この機能が必要になった背景・経緯 範囲for文をより安全に使えるように改善するために仕様が変更された。 @@ -135,6 +120,9 @@ void foo() { ここで未定義動作になることは範囲for文の危険性と無関係なので、寿命を延長するという解釈ができないようにこの例外規定が入った。 議論: + +この例外規定の解釈は難解であり議論がある。 + - この `t` は "一時オブジェクトの寿命が `for-range-initializer` 完全式の終わりではない場合" にも該当すると考えられる - この `t` は、構文的に見ると `for-range-initializer` の中で生じたとは言えないという意見もある - "`for-range-initializer` の中" を実行時のことだと解釈すると、そこから呼び出された関数の中なども含むことになるが、それを排除する規定が "一時オブジェクトの寿命が `for-range-initializer` 完全式の終わりではない場合" ではないか @@ -153,3 +141,4 @@ void foo() { - [地に足のついた範囲for文 - 地面を見下ろす少年の足蹴にされる私](https://onihusube.hatenablog.com/entry/2022/12/05/000923) - [範囲for文範囲初期化子内の一時オブジェクト延命の説明見直し #1246](https://github.com/cpprefjp/site/issues/1246) +- [Are function parameter objects temporary objects?](https://stackoverflow.com/questions/77676199/are-function-parameter-objects-temporary-objects/77676480) From cdd2548d8b9737af779f87205aa7ccf2cb132f37 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 1 Feb 2024 14:03:47 +0900 Subject: [PATCH 0689/3948] =?UTF-8?q?=E3=82=B9=E3=83=9D=E3=83=B3=E3=82=B5?= =?UTF-8?q?=E3=83=BC=E6=9B=B4=E6=96=B0=20#1247?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.md b/index.md index 0701835722..2959ac087b 100644 --- a/index.md +++ b/index.md @@ -80,6 +80,8 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい ### ゴールドスポンサー +- Hiroshi様 +
shiguredo
cocotone
From a2f9fa08d694f177123b941746b64f1db49671b3 Mon Sep 17 00:00:00 2001 From: suomesta Date: Thu, 1 Feb 2024 22:47:18 +0900 Subject: [PATCH 0690/3948] update basic_streambuf class files --- reference/streambuf/basic_streambuf.md | 73 +++++++++-------- reference/streambuf/basic_streambuf/eback.md | 62 ++++++++++++++ reference/streambuf/basic_streambuf/egptr.md | 62 ++++++++++++++ reference/streambuf/basic_streambuf/epptr.md | 62 ++++++++++++++ reference/streambuf/basic_streambuf/gbump.md | 59 ++++++++++++++ reference/streambuf/basic_streambuf/gptr.md | 65 +++++++++++++++ .../streambuf/basic_streambuf/in_avail.md | 61 ++++++++++++++ .../streambuf/basic_streambuf/op_assign.md | 81 +++++++++++++++++++ .../basic_streambuf/op_constructor.md | 32 +++++--- .../streambuf/basic_streambuf/overflow.md | 74 +++++++++++++++++ .../streambuf/basic_streambuf/pbackfail.md | 72 +++++++++++++++++ reference/streambuf/basic_streambuf/pbase.md | 62 ++++++++++++++ reference/streambuf/basic_streambuf/pbump.md | 60 ++++++++++++++ reference/streambuf/basic_streambuf/pptr.md | 67 +++++++++++++++ .../streambuf/basic_streambuf/pubseekoff.md | 36 +++++++++ .../streambuf/basic_streambuf/pubseekpos.md | 35 ++++++++ .../streambuf/basic_streambuf/pubsetbuf.md | 34 ++++++++ .../streambuf/basic_streambuf/pubsync.md | 33 ++++++++ reference/streambuf/basic_streambuf/sbumpc.md | 62 ++++++++++++++ .../streambuf/basic_streambuf/seekoff.md | 36 +++++++++ .../streambuf/basic_streambuf/seekpos.md | 35 ++++++++ reference/streambuf/basic_streambuf/setbuf.md | 50 ++++++++++++ reference/streambuf/basic_streambuf/setg.md | 59 ++++++++++++++ reference/streambuf/basic_streambuf/setp.md | 62 ++++++++++++++ reference/streambuf/basic_streambuf/sgetc.md | 58 +++++++++++++ reference/streambuf/basic_streambuf/sgetn.md | 63 +++++++++++++++ .../streambuf/basic_streambuf/showmanyc.md | 71 ++++++++++++++++ reference/streambuf/basic_streambuf/snextc.md | 64 +++++++++++++++ .../streambuf/basic_streambuf/sputbackc.md | 69 ++++++++++++++++ reference/streambuf/basic_streambuf/sputc.md | 73 +++++++++++++++++ reference/streambuf/basic_streambuf/sputn.md | 63 +++++++++++++++ .../streambuf/basic_streambuf/sungetc.md | 71 ++++++++++++++++ reference/streambuf/basic_streambuf/swap.md | 60 ++++++++++++++ reference/streambuf/basic_streambuf/sync.md | 58 +++++++++++++ reference/streambuf/basic_streambuf/uflow.md | 76 +++++++++++++++++ .../streambuf/basic_streambuf/underflow.md | 74 +++++++++++++++++ reference/streambuf/basic_streambuf/xsgetn.md | 75 +++++++++++++++++ reference/streambuf/basic_streambuf/xsputn.md | 69 ++++++++++++++++ 38 files changed, 2230 insertions(+), 48 deletions(-) create mode 100644 reference/streambuf/basic_streambuf/eback.md create mode 100644 reference/streambuf/basic_streambuf/egptr.md create mode 100644 reference/streambuf/basic_streambuf/epptr.md create mode 100644 reference/streambuf/basic_streambuf/gbump.md create mode 100644 reference/streambuf/basic_streambuf/gptr.md create mode 100644 reference/streambuf/basic_streambuf/in_avail.md create mode 100644 reference/streambuf/basic_streambuf/op_assign.md create mode 100644 reference/streambuf/basic_streambuf/overflow.md create mode 100644 reference/streambuf/basic_streambuf/pbackfail.md create mode 100644 reference/streambuf/basic_streambuf/pbase.md create mode 100644 reference/streambuf/basic_streambuf/pbump.md create mode 100644 reference/streambuf/basic_streambuf/pptr.md create mode 100644 reference/streambuf/basic_streambuf/pubseekoff.md create mode 100644 reference/streambuf/basic_streambuf/pubseekpos.md create mode 100644 reference/streambuf/basic_streambuf/pubsetbuf.md create mode 100644 reference/streambuf/basic_streambuf/pubsync.md create mode 100644 reference/streambuf/basic_streambuf/sbumpc.md create mode 100644 reference/streambuf/basic_streambuf/seekoff.md create mode 100644 reference/streambuf/basic_streambuf/seekpos.md create mode 100644 reference/streambuf/basic_streambuf/setbuf.md create mode 100644 reference/streambuf/basic_streambuf/setg.md create mode 100644 reference/streambuf/basic_streambuf/setp.md create mode 100644 reference/streambuf/basic_streambuf/sgetc.md create mode 100644 reference/streambuf/basic_streambuf/sgetn.md create mode 100644 reference/streambuf/basic_streambuf/showmanyc.md create mode 100644 reference/streambuf/basic_streambuf/snextc.md create mode 100644 reference/streambuf/basic_streambuf/sputbackc.md create mode 100644 reference/streambuf/basic_streambuf/sputc.md create mode 100644 reference/streambuf/basic_streambuf/sputn.md create mode 100644 reference/streambuf/basic_streambuf/sungetc.md create mode 100644 reference/streambuf/basic_streambuf/swap.md create mode 100644 reference/streambuf/basic_streambuf/sync.md create mode 100644 reference/streambuf/basic_streambuf/uflow.md create mode 100644 reference/streambuf/basic_streambuf/underflow.md create mode 100644 reference/streambuf/basic_streambuf/xsgetn.md create mode 100644 reference/streambuf/basic_streambuf/xsputn.md diff --git a/reference/streambuf/basic_streambuf.md b/reference/streambuf/basic_streambuf.md index f34f413f03..8104be504b 100644 --- a/reference/streambuf/basic_streambuf.md +++ b/reference/streambuf/basic_streambuf.md @@ -61,8 +61,8 @@ namespace std { |-------------------------------------------------------|----------------------------|----------------| | [`(constructor)`](basic_streambuf/op_constructor.md) | コンストラクタ (protected) | | | `(destructor)` | デストラクタ (virtual) | | -| `operator=` | コピー代入 (protected) | C++11 | -| `swap` | 値の交換 (protected) | C++11 | +| [`operator=`](basic_streambuf/op_assign.md) | コピー代入 (protected) | C++11 | +| [`swap`](basic_streambuf/swap.md) | 値の交換 (protected) | C++11 | ### ロケール @@ -76,65 +76,64 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| `pubsetbuf` | バッファ領域を与える。 | | -| `pubseekoff` | 相対位置指定での移動。 | | -| `pubseekpos` | 絶対位置指定での移動。 | | -| `pubsync` | 出力列の同期。 | | -| `setbuf` | バッファ領域を与える (protected virtual)。 | | -| `seekoff` | 相対位置指定での移動 (protected virtual)。 | | -| `seekpos` | 絶対位置指定での移動 (protected virtual)。 | | -| `sync` | 出力列の同期 (protected virtual)。 | | +| [`pubsetbuf`](basic_streambuf/pubsetbuf.md) | バッファ領域を与える。 | | +| [`pubseekoff`](basic_streambuf/pubseekoff.md) | 相対位置指定での移動。 | | +| [`pubseekpos`](basic_streambuf/pubseekpos.md) | 絶対位置指定での移動。 | | +| [`pubsync`](basic_streambuf/pubsync.md) | 出力列の同期。 | | +| [`setbuf`](basic_streambuf/setbuf.md) | バッファ領域を与える (protected virtual)。 | | +| [`seekoff`](basic_streambuf/seekoff.md) | 相対位置指定での移動 (protected virtual)。 | | +| [`seekpos`](basic_streambuf/seekpos.md) | 絶対位置指定での移動 (protected virtual)。 | | +| [`sync`](basic_streambuf/sync.md) | 出力列の同期 (protected virtual)。 | | ### 入力 | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| `in_avail` | 現在の部分列から読み取り可能な文字数を返す。 | | -| `snextc` | 1文字捨てて、次の文字を読み取る。 | | -| `sbumpc` | 現在位置の文字を読み取り、現在位置を1文字進める。 | | -| `uflow` | (protected virtual) | -| `sgetc` | 現在位置の文字を読み取る。 | | -| `underflow` | (protected virtual) | -| `sgetn` | 複数文字を読み取る。 | | -| `xsgetn` | 複数文字を読み取る (protected virtual)。 | | -| `showmasync` | ブロックせずに読み取れると期待される文字数を得る (protected virtual)。 | | +| [`in_avail`](basic_streambuf/in_avail.md) | 現在の入力列の読み取り可能な文字数を返す。 | | +| [`snextc`](basic_streambuf/snextc.md) | 入力列の1文字を捨てて、次の文字を読み取る。 | | +| [`sbumpc`](basic_streambuf/sbumpc.md) | 入力列の現在位置の文字を読み取り、現在位置を1文字進める。 | | +| [`uflow`](basic_streambuf/uflow.md) | 入力部分列の領域を消費し切った際の処理 (protected virtual)。 | +| [`sgetc`](basic_streambuf/sgetc.md) | 入力列の現在位置の文字を読み取る。 | | +| [`underflow`](basic_streambuf/underflow.md) | 入力部分列の領域を消費し切った際の処理 (protected virtual)。 | +| [`sgetn`](basic_streambuf/sgetn.md) | 入力列から複数文字を読み取る。 | | +| [`xsgetn`](basic_streambuf/xsgetn.md) | 入力列から複数文字を読み取る (protected virtual)。 | | +| [`showmanyc`](basic_streambuf/showmanyc.md) | ブロックせずに読み取れると期待される文字数を得る (protected virtual)。 | | ### 入力の読み戻し | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| `sputbackc` | 任意の1文字を入力列に戻す。 | | -| `sungetc` | 直前に読み取った1文字を入力列に戻す。 | | -| `pbackfail` | 1文字を入力列に戻す (protected virtual) | | +| [`sputbackc`](basic_streambuf/sputbackc.md) | 任意の1文字を入力列に戻す。 | | +| [`sungetc`](basic_streambuf/sungetc.md) | 直前に読み取った1文字を入力列に戻す。 | | +| [`pbackfail`](basic_streambuf/pbackfail.md) | 1文字を入力列に戻す (protected virtual)。 | | ### 入力部分列の操作 | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| `eback` | 入力部分列の先頭へのポインタを返す (protected)。 | | -| `gptr` | 入力部分列の現在位置へのポインタを返す (protected)。 | | -| `egptr` | 入力部分列の終端へのポインタを返す (protected)。 | | -| `gbump` | 入力部分列の現在位置を指定した量だけ進める (protected)。 | | -| `setg` | 入力部分列の各ポインタを設定する (protected)。 | | +| [`eback`](basic_streambuf/eback.md) | 入力部分列の先頭へのポインタを返す (protected)。 | | +| [`gptr`](basic_streambuf/gptr.md) | 入力部分列の現在位置へのポインタを返す (protected)。 | | +| [`egptr`](basic_streambuf/egptr.md) | 入力部分列の終端へのポインタを返す (protected)。 | | +| [`gbump`](basic_streambuf/gbump.md) | 入力部分列の現在位置を指定した量だけ進める (protected)。 | | +| [`setg`](basic_streambuf/setg.md) | 入力部分列の各ポインタを設定する (protected)。 | | ### 出力 | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| `sputc` | 1文字を出力。 | | -| `overflow` | (protected virtual) | -| `sputn` | 複数文字を出力。 | | -| `xsputn` | 複数文字を出力 (protected virtual)。 | | +| [`sputc`](basic_streambuf/sputc.md) | 出力列に1文字書き込む。 | | +| [`overflow`](basic_streambuf/overflow.md) | 出力部分列の領域を消費し切った際の処理 (protected virtual)。 | +| [`sputn`](basic_streambuf/sputn.md) | 出力列に複数文字を書き込む。 | | +| [`xsputn`](basic_streambuf/xsputn.md) | 出力列に複数文字を書き込む (protected virtual)。 | | ### 出力部分列の操作 | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| `pbase` | 出力部分列の先頭へのポインタを返す (protected)。 | | -| `pptr` | 出力部分列の現在位置へのポインタを返す (protected)。 | | -| `epptr` | 出力部分列の終端へのポインタを返す (protected)。 | | -| `pbump` | 出力部分列の現在位置を指定した量だけ進める (protected)。 | | -| `setp` | 出力部分列の各ポインタを設定する (protected)。 | | +| [`pbase`](basic_streambuf/pbase.md) | 出力部分列の先頭へのポインタを返す (protected)。 | | +| [`pptr`](basic_streambuf/pptr.md) | 出力部分列の現在位置へのポインタを返す (protected)。 | | +| [`epptr`](basic_streambuf/epptr.md) | 出力部分列の終端へのポインタを返す (protected)。 | | +| [`pbump`](basic_streambuf/pbump.md) | 出力部分列の現在位置を指定した量だけ進める (protected)。 | | +| [`setp`](basic_streambuf/setp.md) | 出力部分列の各ポインタを設定する (protected)。 | | ## 参照 - diff --git a/reference/streambuf/basic_streambuf/eback.md b/reference/streambuf/basic_streambuf/eback.md new file mode 100644 index 0000000000..68fb80c20e --- /dev/null +++ b/reference/streambuf/basic_streambuf/eback.md @@ -0,0 +1,62 @@ +# eback +* streambuf[meta header] +* std[meta namespace] +* basic_streambuf[meta class] +* function[meta id-type] + +```cpp +namespace std { + template> + class basic_streambuf { + protected: + char_type* eback() const; + + …… + }; +} +``` + +## 概要 +入力部分列の先頭へのポインタを返す。 + +## 戻り値 +入力部分列の先頭へのポインタ。 + +## 例 +```cpp example +#include +#include + +// streambufを継承したクラス +class dummy_buf : public std::streambuf { + char space_[10] = {'A', 'B', 'C'}; +public: + dummy_buf(void) { + // 入力列に配列を設定 + setg(space_, space_, space_ + 10); + } + char_type* eback(void) const { + // ベースクラスのeback()を呼ぶ + return std::streambuf::eback(); + } +}; + +int main(void) { + dummy_buf buf{}; + std::cout << *buf.eback() << std::endl; // 先頭のポインタにアクセス +} +``` +* std::streambuf::eback[color ff0000] + +### 出力 +``` +A +``` + +## バージョン +### 言語 +- C++98 + +## 参照 +- [`gptr()`](gptr.md) +- [`egptr()`](egptr.md) diff --git a/reference/streambuf/basic_streambuf/egptr.md b/reference/streambuf/basic_streambuf/egptr.md new file mode 100644 index 0000000000..753d5f1ade --- /dev/null +++ b/reference/streambuf/basic_streambuf/egptr.md @@ -0,0 +1,62 @@ +# egptr +* streambuf[meta header] +* std[meta namespace] +* basic_streambuf[meta class] +* function[meta id-type] + +```cpp +namespace std { + template> + class basic_streambuf { + protected: + char_type* egptr() const; + + …… + }; +} +``` + +## 概要 +入力部分列の終端へのポインタを返す。 + +## 戻り値 +入力部分列の終端へのポインタ。 + +## 例 +```cpp example +#include +#include + +// streambufを継承したクラス +class dummy_buf : public std::streambuf { + char space_[10] = {'A', 'B', 'C'}; +public: + dummy_buf(void) { + // 入力列に配列を設定 + setg(space_, space_, space_ + 10); + } + char_type* egptr(void) const { + // ベースクラスのegptr()を呼ぶ + return std::streambuf::egptr(); + } +}; + +int main(void) { + dummy_buf buf{}; + std::cout << *(buf.egptr() - 10) << std::endl; // 末尾から逆算して先頭のポインタにアクセス +} +``` +* std::streambuf::egptr[color ff0000] + +### 出力 +``` +A +``` + +## バージョン +### 言語 +- C++98 + +## 参照 +- [`eback()`](eback.md) +- [`gptr()`](gptr.md) diff --git a/reference/streambuf/basic_streambuf/epptr.md b/reference/streambuf/basic_streambuf/epptr.md new file mode 100644 index 0000000000..3739b24989 --- /dev/null +++ b/reference/streambuf/basic_streambuf/epptr.md @@ -0,0 +1,62 @@ +# epptr +* streambuf[meta header] +* std[meta namespace] +* basic_streambuf[meta class] +* function[meta id-type] + +```cpp +namespace std { + template> + class basic_streambuf { + protected: + char_type* epptr() const; + + …… + }; +} +``` + +## 概要 +出力部分列の終端へのポインタを返す。 + +## 戻り値 +出力部分列の終端へのポインタ。 + +## 例 +```cpp example +#include +#include + +// streambufを継承したクラス +class dummy_buf : public std::streambuf { +public: + dummy_buf(char* begin, char* end) { + // 出力列の領域を指定 + setp(begin, end); + } + char_type* epptr(void) const { + // ベースクラスのepptr()を呼ぶ + return std::streambuf::epptr(); + } +}; + +int main(void) { + char space[10] = {}; + dummy_buf buf{space, space + 10}; + std::cout << buf.epptr() - space << std::endl; // epptr()の位置を確認 +} +``` +* std::streambuf::epptr[color ff0000] + +### 出力 +``` +10 +``` + +## バージョン +### 言語 +- C++98 + +## 参照 +- [`pbase()`](pbase.md) +- [`pptr()`](pptr.md) diff --git a/reference/streambuf/basic_streambuf/gbump.md b/reference/streambuf/basic_streambuf/gbump.md new file mode 100644 index 0000000000..ff11501679 --- /dev/null +++ b/reference/streambuf/basic_streambuf/gbump.md @@ -0,0 +1,59 @@ +# gbump +* streambuf[meta header] +* std[meta namespace] +* basic_streambuf[meta class] +* function[meta id-type] + +```cpp +namespace std { + template> + class basic_streambuf { + protected: + void gbump(int n); + + …… + }; +} +``` + +## 概要 +入力部分列の現在位置を指定した量だけ進める。 + +## 効果 +入力部分列の現在位置をnだけ進める。 + +## 例 +```cpp example +#include +#include + +// streambufを継承したクラス +class dummy_buf : public std::streambuf { + char space_[10] = {'A', 'B', 'C'}; +public: + dummy_buf(void) { + // 入力列に配列を設定 + setg(space_, space_, space_ + 10); + } + void gbump(int n) { + // ベースクラスのgbump()を呼ぶ + return std::streambuf::gbump(n); + } +}; + +int main(void) { + dummy_buf buf{}; + buf.gbump(2); // 現在位置を2つ進める + std::cout << char(buf.sgetc()) << std::endl; +} +``` +* std::streambuf::gbump[color ff0000] + +### 出力 +``` +C +``` + +## バージョン +### 言語 +- C++98 diff --git a/reference/streambuf/basic_streambuf/gptr.md b/reference/streambuf/basic_streambuf/gptr.md new file mode 100644 index 0000000000..394141c147 --- /dev/null +++ b/reference/streambuf/basic_streambuf/gptr.md @@ -0,0 +1,65 @@ +# gptr +* streambuf[meta header] +* std[meta namespace] +* basic_streambuf[meta class] +* function[meta id-type] + +```cpp +namespace std { + template> + class basic_streambuf { + protected: + char_type* gptr() const; + + …… + }; +} +``` + +## 概要 +入力部分列の現在位置へのポインタを返す。 + +## 戻り値 +入力部分列の現在位置へのポインタ。 + +## 例 +```cpp example +#include +#include + +// streambufを継承したクラス +class dummy_buf : public std::streambuf { + char space_[10] = {'A', 'B', 'C'}; +public: + dummy_buf(void) { + // 入力列に配列を設定 + setg(space_, space_, space_ + 10); + } + char_type* gptr(void) const { + // ベースクラスのgptr()を呼ぶ + return std::streambuf::gptr(); + } +}; + +int main(void) { + dummy_buf buf{}; + std::cout << *buf.gptr() << std::endl; // 現在位置のポインタにアクセス + buf.snextc(); // 現在位置を1つ進める + std::cout << *buf.gptr() << std::endl; // 現在位置のポインタにアクセス +} +``` +* std::streambuf::gptr[color ff0000] + +### 出力 +``` +A +B +``` + +## バージョン +### 言語 +- C++98 + +## 参照 +- [`eback()`](eback.md) +- [`egptr()`](egptr.md) diff --git a/reference/streambuf/basic_streambuf/in_avail.md b/reference/streambuf/basic_streambuf/in_avail.md new file mode 100644 index 0000000000..c0345ab384 --- /dev/null +++ b/reference/streambuf/basic_streambuf/in_avail.md @@ -0,0 +1,61 @@ +# in_avail +* streambuf[meta header] +* std[meta namespace] +* basic_streambuf[meta class] +* function[meta id-type] + +```cpp +namespace std { + template> + class basic_streambuf { + public: + streamsize in_avail(); + + …… + }; +} +``` +* streamsize[link /reference/ios/type-streamsize.md] + +## 概要 +現在の入力列の読み取り可能な文字数を返す。 + +## 戻り値 +- 読み取り可能な文字列が存在する場合、[`egptr()`](egptr.md) - [`gptr()`](gptr.md)を返す。 +- それ以外の場合、[`showmanyc()`](showmanyc.md)を返す。 + +## 例 +```cpp example +#include +#include + +// streambufを継承したクラス +class dummy_buf : public std::streambuf { + char space_[10] = {}; +public: + dummy_buf(void) { + // 入力列に配列を設定 + setg(space_, space_, space_ + 10); + } +}; + +int main(void) { + dummy_buf buf{}; + std::cout << buf.in_avail() << std::endl; +} +``` +* in_avail[color ff0000] + +### 出力 +``` +10 +``` + +## バージョン +### 言語 +- C++98 + +## 参照 +- [`egptr()`](egptr.md) +- [`gptr()`](gptr.md) +- [`showmanyc()`](showmanyc.md) diff --git a/reference/streambuf/basic_streambuf/op_assign.md b/reference/streambuf/basic_streambuf/op_assign.md new file mode 100644 index 0000000000..5fa97a8e3b --- /dev/null +++ b/reference/streambuf/basic_streambuf/op_assign.md @@ -0,0 +1,81 @@ +# operator= +* streambuf[meta header] +* std[meta namespace] +* basic_streambuf[meta class] +* function[meta id-type] +* cpp11[meta cpp] + +```cpp +namespace std { + template> + class basic_streambuf { + protected: + basic_streambuf& operator=(const basic_streambuf& rhs); + + …… + }; +} +``` + +## 概要 +入力部分列ポインタ、出力部分列ポインタ、ロケールをコピーする。 + +## 事後条件 +- [`eback()`](eback.md) == rhs.[`eback()`](eback.md) +- [`gptr()`](gptr.md) == rhs.[`gptr()`](gptr.md) +- [`egptr()`](egptr.md) == rhs.[`egptr()`](egptr.md) +- [`pbase()`](pbase.md) == rhs.[`pbase()`](pbase.md) +- [`pptr()`](pptr.md) == rhs.[`pptr()`](pptr.md) +- [`epptr()`](epptr.md) == rhs.[`epptr()`](epptr.md) +- [`getloc()`](getloc.md) == rhs.[`getloc()`](getloc.md) + +## 戻り値 +*this。 + +## 例 +```cpp example +#include +#include + +// streambufを継承したクラス +class dummy_buf : public std::streambuf { + char space_[10] = {'A', 'B', 'C'}; +public: + dummy_buf(void) { + // 入力列に配列を設定 + setg(space_, space_, space_ + 10); + } + void copy(const dummy_buf& rhs) { + // ベースクラスのoperator=を呼ぶ + std::streambuf::operator=(rhs); + } +}; + +int main(void) { + dummy_buf buf1{}; + dummy_buf buf2{}; + std::cout << char(buf1.sbumpc()) << std::endl; + buf2.copy(buf1); + std::cout << char(buf2.sbumpc()) << std::endl; +} +``` +* std::streambuf::operator=[color ff0000] + +### 出力 +``` +A +B +``` + +## バージョン +### 言語 +- C++98 + +## 参照 +- [`eback()`](eback.md) +- [`gptr()`](gptr.md) +- [`egptr()`](egptr.md) +- [`pbase()`](pbase.md) +- [`pptr()`](pptr.md) +- [`epptr()`](epptr.md) +- [`getloc()`](getloc.md) diff --git a/reference/streambuf/basic_streambuf/op_constructor.md b/reference/streambuf/basic_streambuf/op_constructor.md index c66dbbd429..4231c15ac7 100644 --- a/reference/streambuf/basic_streambuf/op_constructor.md +++ b/reference/streambuf/basic_streambuf/op_constructor.md @@ -9,7 +9,8 @@ namespace std { template> class basic_streambuf { protected: - basic_streambuf(); + basic_streambuf(); // (1) + basic_streambuf(const basic_streambuf& rhs); // (2) …… }; @@ -21,19 +22,28 @@ namespace std { ## 効果 -- 入力部分列・出力部分列の各ポインタをヌルにする。 -- 現在のグローバルロケールを`locale`デフォルトコンストラクタで取得し、`getloc()`の初期値とする。 +- (1) : + - 入力列・出力列の各ポインタをヌルにする。 + - 現在のグローバルロケールを`locale`デフォルトコンストラクタで取得し、`getloc()`の初期値とする。 +- (2) : rhs の入力列・出力列の各ポインタをコピーする。 ## 事後条件 -- `gptr()` == `nullptr` -- `egptr()` == `nullptr` -- `pptr()` == `nullptr` -- `epptr()` == `nullptr` -- `eback()` == `nullptr` -- `gptr()` == `nullptr` -- `egptr()` == `nullptr` -- `getloc()` == `locale()` +- (1) : + - `eback()` == `nullptr` + - `gptr()` == `nullptr` + - `egptr()` == `nullptr` + - `pbase()` == `nullptr` + - `pptr()` == `nullptr` + - `epptr()` == `nullptr` + - `getloc()` == `locale()` +- (2) : + - `eback()` == `rhs.eback()` + - `gptr()` == `rhs.gptr()` + - `egptr()` == `rhs.egptr()` + - `pbase()` == `rhs.pbase()` + - `pptr()` == `rhs.pptr()` + - `epptr()` == `rhs.epptr()` ## 実装例 diff --git a/reference/streambuf/basic_streambuf/overflow.md b/reference/streambuf/basic_streambuf/overflow.md new file mode 100644 index 0000000000..770a7a80c6 --- /dev/null +++ b/reference/streambuf/basic_streambuf/overflow.md @@ -0,0 +1,74 @@ +# overflow +* streambuf[meta header] +* std[meta namespace] +* basic_streambuf[meta class] +* function[meta id-type] + +```cpp +namespace std { + template> + class basic_streambuf { + protected: + virtual int_type overflow(int_type c = Traits::eof()); + + …… + }; +} +``` + +## 概要 +出力部分列の領域を消費し切った際の処理。 + +## 効果 +デフォルトの動作は[`Traits::eof()`](../../string/char_traits/eof.md)を返すのみ。(この関数をオーバーライドすることで、関数内で改めて[`setp()`](setp.md)を呼んで別の出力部分列を指し直す、のような処理を追加できる。) + +## 戻り値 +[`Traits::eof()`](../../string/char_traits/eof.md)。 + +## 備考 +出力部分列の領域を消費し切った状態で[`sputc()`](sputc.md)を呼ぶと、overflow()が呼ばれる。[`sputn()`](sputn.md)がoverflow()を呼ぶかどうかは未規定。 + +## 例 +```cpp example +#include +#include + +// streambufを継承したクラス +class dummy_buf : public std::streambuf { +public: + dummy_buf(char* begin, char* end) { + // 出力列の領域を指定 + setp(begin, end); + } +protected: + int_type overflow(int_type c) override { + std::cout << "overflow" << std::endl; + // ベースクラスのoverflow()を呼ぶ + return std::streambuf::overflow(c); + } +}; + +int main(void) { + char space[10] = {}; + dummy_buf buf{space, space + 2}; + std::cout << buf.sputc('A') << std::endl; // 'A'を書き込む + std::cout << buf.sputc('B') << std::endl; // 'B'を書き込む + std::cout << buf.sputc('C') << std::endl; // 'C'の書き込みに失敗。overflow()が呼ばれ、Traits::eof()が返る +} +``` +* std::streambuf::overflow[color ff0000] + +### 出力 +``` +65 +66 +overflow +-1 +``` + +## バージョン +### 言語 +- C++98 + +## 参照 +- [`sputc()`](sputc.md) diff --git a/reference/streambuf/basic_streambuf/pbackfail.md b/reference/streambuf/basic_streambuf/pbackfail.md new file mode 100644 index 0000000000..989643fadb --- /dev/null +++ b/reference/streambuf/basic_streambuf/pbackfail.md @@ -0,0 +1,72 @@ +# pbackfail +* streambuf[meta header] +* std[meta namespace] +* basic_streambuf[meta class] +* function[meta id-type] + +```cpp +namespace std { + template> + class basic_streambuf { + protected: + virtual int_type pbackfail(int_type c = Traits::eof()); + + …… + }; +} +``` + +## 概要 +1文字を入力列に戻す。 + +## 効果 +[`sungetc()`](sungetc.md)や[`sputbackc()`](sputbackc.md)の中から、入力部分列の現在位置を戻すことができない時に呼ばれる。デフォルトの動作は[`Traits::eof()`](../../string/char_traits/eof.md)を返すのみ。 + +## 戻り値 +[`Traits::eof()`](../../string/char_traits/eof.md)。 + +## 例 +```cpp example +#include +#include + +// streambufを継承したクラス +class dummy_buf : public std::streambuf { + char space_[10] = {'A', 'B', 'C'}; +public: + dummy_buf(void) { + // 入力列に配列を設定 + setg(space_, space_, space_ + 10); + } + int_type pbackfail(int_type c = traits_type::eof()) override { + std::cout << "pbackfail" << std::endl; + // ベースクラスのpbackfail()を呼ぶ + return std::streambuf::pbackfail(c); + } +}; + +int main(void) { + dummy_buf buf{}; + buf.sbumpc(); // 現在位置を1つ進める + + std::cout << buf.sputbackc('A') << std::endl; // sputbackc()成功 + std::cout << buf.sputbackc('Z') << std::endl; // sputbackc()失敗 + // sputbackc()の中でpbackfail()が呼ばれる +} +``` +* std::streambuf::pbackfail[color ff0000] + +### 出力 +``` +65 +pbackfail +-1 +``` + +## バージョン +### 言語 +- C++98 + +## 参照 +- [`sputbackc()`](sputbackc.md) +- [`sungetc()`](sungetc.md) diff --git a/reference/streambuf/basic_streambuf/pbase.md b/reference/streambuf/basic_streambuf/pbase.md new file mode 100644 index 0000000000..a4064df668 --- /dev/null +++ b/reference/streambuf/basic_streambuf/pbase.md @@ -0,0 +1,62 @@ +# pbase +* streambuf[meta header] +* std[meta namespace] +* basic_streambuf[meta class] +* function[meta id-type] + +```cpp +namespace std { + template> + class basic_streambuf { + protected: + char_type* pbase() const; + + …… + }; +} +``` + +## 概要 +出力部分列の先頭へのポインタを返す。 + +## 戻り値 +出力部分列の先頭へのポインタ。 + +## 例 +```cpp example +#include +#include + +// streambufを継承したクラス +class dummy_buf : public std::streambuf { +public: + dummy_buf(char* begin, char* end) { + // 出力列の領域を指定 + setp(begin, end); + } + char_type* pbase(void) const { + // ベースクラスのpbase()を呼ぶ + return std::streambuf::pbase(); + } +}; + +int main(void) { + char space[10] = {}; + dummy_buf buf{space, space + 10}; + std::cout << buf.pbase() - space << std::endl; // pbase()の位置を確認 +} +``` +* std::streambuf::pbase[color ff0000] + +### 出力 +``` +0 +``` + +## バージョン +### 言語 +- C++98 + +## 参照 +- [`pptr()`](pptr.md) +- [`epptr()`](epptr.md) diff --git a/reference/streambuf/basic_streambuf/pbump.md b/reference/streambuf/basic_streambuf/pbump.md new file mode 100644 index 0000000000..0f430c262d --- /dev/null +++ b/reference/streambuf/basic_streambuf/pbump.md @@ -0,0 +1,60 @@ +# pbump +* streambuf[meta header] +* std[meta namespace] +* basic_streambuf[meta class] +* function[meta id-type] + +```cpp +namespace std { + template> + class basic_streambuf { + protected: + void pbump(int n); + + …… + }; +} +``` + +## 概要 +出力部分列の現在位置を指定した量だけ進める。 + +## 効果 +出力部分列の現在位置をnだけ進める。 + +## 例 +```cpp example +#include +#include + +// streambufを継承したクラス +class dummy_buf : public std::streambuf { +public: + dummy_buf(char* begin, char* end) { + // 出力列の領域を指定 + setp(begin, end); + } + void pbump(int n) { + // ベースクラスのpbump()を呼ぶ + return std::streambuf::pbump(n); + } +}; + +int main(void) { + char space[10] = {}; + dummy_buf buf{space, space + 10}; + buf.pbump(2); // 現在位置を2つ進める + buf.sputc('A'); // 1文字書き込む + std::cout << space[2] << std::endl; // [2]に書き込まれた +} +``` +* std::streambuf::pbump[color ff0000] + +### 出力 +``` +A +``` + +## バージョン +### 言語 +- C++98 diff --git a/reference/streambuf/basic_streambuf/pptr.md b/reference/streambuf/basic_streambuf/pptr.md new file mode 100644 index 0000000000..88c2f384f6 --- /dev/null +++ b/reference/streambuf/basic_streambuf/pptr.md @@ -0,0 +1,67 @@ +# pptr +* streambuf[meta header] +* std[meta namespace] +* basic_streambuf[meta class] +* function[meta id-type] + +```cpp +namespace std { + template> + class basic_streambuf { + protected: + char_type* pptr() const; + + …… + }; +} +``` + +## 概要 +出力部分列の現在位置へのポインタを返す。 + +## 戻り値 +出力部分列の現在位置へのポインタ。 + +## 例 +```cpp example +#include +#include + +// streambufを継承したクラス +class dummy_buf : public std::streambuf { +public: + dummy_buf(char* begin, char* end) { + // 出力列の領域を指定 + setp(begin, end); + } + char_type* pptr(void) const { + // ベースクラスのpptr()を呼ぶ + return std::streambuf::pptr(); + } +}; + +int main(void) { + char space[10] = {}; + dummy_buf buf{space, space + 10}; + std::cout << buf.pptr() - space << std::endl; // pptr()の位置を確認 + buf.sputc('A'); // 3文字書き込む + buf.sputc('B'); + buf.sputc('C'); + std::cout << buf.pptr() - space << std::endl; // pptr()の位置を確認 +} +``` +* std::streambuf::pptr[color ff0000] + +### 出力 +``` +0 +3 +``` + +## バージョン +### 言語 +- C++98 + +## 参照 +- [`pbase()`](pbase.md) +- [`epptr()`](epptr.md) diff --git a/reference/streambuf/basic_streambuf/pubseekoff.md b/reference/streambuf/basic_streambuf/pubseekoff.md new file mode 100644 index 0000000000..ea4a1fcf62 --- /dev/null +++ b/reference/streambuf/basic_streambuf/pubseekoff.md @@ -0,0 +1,36 @@ +# pubseekoff +* streambuf[meta header] +* std[meta namespace] +* basic_streambuf[meta class] +* function[meta id-type] + +```cpp +namespace std { + template> + class basic_streambuf { + public: + pos_type pubseekoff(off_type off, ios_base::seekdir way, + ios_base::openmode which = ios_base::in | ios_base::out); + + …… + }; +} +``` +* ios_base::seekdir[link /reference/ios/ios_base/type-seekdir.md] +* ios_base::openmode[link /reference/ios/ios_base/type-openmode.md] + +## 概要 +相対位置指定での移動。 + +## 効果 +protected virtualの[`seekoff()`](seekoff.md)を呼ぶ。 + +## 戻り値 +[`seekoff`](seekoff.md)(off, way, which)。 + +## バージョン +### 言語 +- C++98 + +## 参照 +- [`seekoff()`](seekoff.md) diff --git a/reference/streambuf/basic_streambuf/pubseekpos.md b/reference/streambuf/basic_streambuf/pubseekpos.md new file mode 100644 index 0000000000..c01e012b1c --- /dev/null +++ b/reference/streambuf/basic_streambuf/pubseekpos.md @@ -0,0 +1,35 @@ +# pubseekpos +* streambuf[meta header] +* std[meta namespace] +* basic_streambuf[meta class] +* function[meta id-type] + +```cpp +namespace std { + template> + class basic_streambuf { + public: + pos_type pubseekpos(pos_type sp, + ios_base::openmode which = ios_base::in | ios_base::out); + + …… + }; +} +``` +* ios_base::openmode[link /reference/ios/ios_base/type-openmode.md] + +## 概要 +絶対位置指定での移動。 + +## 効果 +protected virtualの[`seekpos()`](seekpos.md)を呼ぶ。 + +## 戻り値 +[`seekpos`](seekpos.md)(sp, which)。 + +## バージョン +### 言語 +- C++98 + +## 参照 +- [`seekpos()`](seekpos.md) diff --git a/reference/streambuf/basic_streambuf/pubsetbuf.md b/reference/streambuf/basic_streambuf/pubsetbuf.md new file mode 100644 index 0000000000..76bb5fbde3 --- /dev/null +++ b/reference/streambuf/basic_streambuf/pubsetbuf.md @@ -0,0 +1,34 @@ +# pubsetbuf +* streambuf[meta header] +* std[meta namespace] +* basic_streambuf[meta class] +* function[meta id-type] + +```cpp +namespace std { + template> + class basic_streambuf { + public: + basic_streambuf* pubsetbuf(char_type* s, streamsize n); + + …… + }; +} +``` +* streamsize[link /reference/ios/type-streamsize.md] + +## 概要 +バッファ領域を与える。 + +## 効果 +protected virtualの[`setbuf()`setbuf.md)を呼ぶ。 + +## 戻り値 +[`setbuf`](setbuf.md)(s, n)。 + +## バージョン +### 言語 +- C++98 + +## 参照 +- [`setbuf()`](setbuf.md) diff --git a/reference/streambuf/basic_streambuf/pubsync.md b/reference/streambuf/basic_streambuf/pubsync.md new file mode 100644 index 0000000000..5111ae00af --- /dev/null +++ b/reference/streambuf/basic_streambuf/pubsync.md @@ -0,0 +1,33 @@ +# pubsync +* streambuf[meta header] +* std[meta namespace] +* basic_streambuf[meta class] +* function[meta id-type] + +```cpp +namespace std { + template> + class basic_streambuf { + public: + int pubsync(); + + …… + }; +} +``` + +## 概要 +出力列の同期。 + +## 効果 +protected virtualの[`sync()`](sync.md)を呼ぶ。 + +## 戻り値 +[`sync()`](sync.md)。 + +## バージョン +### 言語 +- C++98 + +## 参照 +- [`sync()`](sync.md) diff --git a/reference/streambuf/basic_streambuf/sbumpc.md b/reference/streambuf/basic_streambuf/sbumpc.md new file mode 100644 index 0000000000..c2466208ad --- /dev/null +++ b/reference/streambuf/basic_streambuf/sbumpc.md @@ -0,0 +1,62 @@ +# sbumpc +* streambuf[meta header] +* std[meta namespace] +* basic_streambuf[meta class] +* function[meta id-type] + +```cpp +namespace std { + template> + class basic_streambuf { + public: + int_type sbumpc(); + + …… + }; +} +``` + +## 概要 +入力列の現在位置の文字を読み取り、現在位置を1文字進める。 + +## 効果 +- 読み取り可能な文字列が存在する場合、現在位置の文字を返し、また、現在位置を1つ進める。 +- それ以外の場合、[`uflow()`](uflow.md)を呼ぶ。 + +## 例 +```cpp example +#include +#include + +// streambufを継承したクラス +class dummy_buf : public std::streambuf { + char space_[10] = {'A', 'B', 'C'}; +public: + dummy_buf(void) { + // 入力列に配列を設定 + setg(space_, space_, space_ + 10); + } +}; + +int main(void) { + dummy_buf buf{}; + std::cout << buf.in_avail() << std::endl; + std::cout << char(buf.sbumpc()) << std::endl; // 1文字目の’A'を読み取り、現在位置を1つ進める + std::cout << buf.in_avail() << std::endl; +} +``` +* sbumpc[color ff0000] + +### 出力 +``` +10 +A +9 +``` + +## バージョン +### 言語 +- C++98 + +## 参照 +- [`uflow()`](uflow.md) diff --git a/reference/streambuf/basic_streambuf/seekoff.md b/reference/streambuf/basic_streambuf/seekoff.md new file mode 100644 index 0000000000..e002214eab --- /dev/null +++ b/reference/streambuf/basic_streambuf/seekoff.md @@ -0,0 +1,36 @@ +# seekoff +* streambuf[meta header] +* std[meta namespace] +* basic_streambuf[meta class] +* function[meta id-type] + +```cpp +namespace std { + template> + class basic_streambuf { + protected: + virtual pos_type seekoff(off_type off, ios_base::seekdir way, + ios_base::openmode which = ios_base::in | ios_base::out); + + …… + }; +} +``` +* ios_base::seekdir[link /reference/ios/ios_base/type-seekdir.md] +* ios_base::openmode[link /reference/ios/ios_base/type-openmode.md] + +## 概要 +相対位置指定での移動。 + +## 効果 +デフォルトでは -1 を返すのみ。(オーバーライドした関数の具体的な動作はそのクラスに委ねられる。) + +## 戻り値 +pos_type(off_type(-1))。 + +## バージョン +### 言語 +- C++98 + +## 参照 +- [`pubseekoff()`](pubseekoff.md) diff --git a/reference/streambuf/basic_streambuf/seekpos.md b/reference/streambuf/basic_streambuf/seekpos.md new file mode 100644 index 0000000000..b1608cdf02 --- /dev/null +++ b/reference/streambuf/basic_streambuf/seekpos.md @@ -0,0 +1,35 @@ +# seekpos +* streambuf[meta header] +* std[meta namespace] +* basic_streambuf[meta class] +* function[meta id-type] + +```cpp +namespace std { + template> + class basic_streambuf { + protected: + virtual pos_type seekpos(pos_type sp, + ios_base::openmode which = ios_base::in | ios_base::out); + + …… + }; +} +``` +* ios_base::openmode[link /reference/ios/ios_base/type-openmode.md] + +## 概要 +絶対位置指定での移動。 + +## 効果 +デフォルトでは -1 を返すのみ。(オーバーライドした関数の具体的な動作はそのクラスに委ねられる。) + +## 戻り値 +pos_type(off_type(-1))。 + +## バージョン +### 言語 +- C++98 + +## 参照 +- [`pubseekpos()`](pubseekpos.md) diff --git a/reference/streambuf/basic_streambuf/setbuf.md b/reference/streambuf/basic_streambuf/setbuf.md new file mode 100644 index 0000000000..eb4ce9f293 --- /dev/null +++ b/reference/streambuf/basic_streambuf/setbuf.md @@ -0,0 +1,50 @@ +# setbuf +* streambuf[meta header] +* std[meta namespace] +* basic_streambuf[meta class] +* function[meta id-type] + +```cpp +namespace std { + template> + class basic_streambuf { + protected: + virtual basic_streambuf* setbuf(char_type* s, streamsize n); + + …… + }; +} +``` +* streamsize[link /reference/ios/type-streamsize.md] + +## 概要 +バッファ領域を与える。 + +## 効果 +デフォルトでは何もしない。(オーバーライドした関数の具体的な動作はそのクラスに委ねられる。) + +## 戻り値 +*this. + +## 例 +```cpp example +#include +#include + +int main() { + char buf[32] = {}; + std::stringstream ss; + + ss.rdbuf()->pubsetbuf(buf, sizeof(buf)); // std::stringstreamのsetbuf()が呼ばれる + ss << "ABC"; + + std::cout << buf << std::endl; +} +``` + +## バージョン +### 言語 +- C++98 + +## 参照 +- [`pubsetbuf()`](pubsetbuf.md) diff --git a/reference/streambuf/basic_streambuf/setg.md b/reference/streambuf/basic_streambuf/setg.md new file mode 100644 index 0000000000..8facfded94 --- /dev/null +++ b/reference/streambuf/basic_streambuf/setg.md @@ -0,0 +1,59 @@ +# setg +* streambuf[meta header] +* std[meta namespace] +* basic_streambuf[meta class] +* function[meta id-type] + +```cpp +namespace std { + template> + class basic_streambuf { + protected: + void setg(char_type* gbeg, char_type* gnext, char_type* gend); + + …… + }; +} +``` + +## 概要 +入力部分列の各ポインタを設定する。 + +## 事後条件 +gbeg == [`eback()`](eback.md) および gnext == [`gptr()`](gptr.md) および gend == [`egptr()`](egptr.md)。 + +## 例 +```cpp example +#include +#include + +// streambufを継承したクラス +class dummy_buf : public std::streambuf { + char space_[10] = {'A', 'B', 'C'}; +public: + dummy_buf(void) { + // 入力列に配列を設定 + setg(space_, space_, space_ + 10); + } +}; + +int main(void) { + dummy_buf buf{}; + std::cout << char(buf.sgetc()) << std::endl; // 現在位置の文字を読み取る +} +``` +* setg[color ff0000] + +### 出力 +``` +A +``` + +## バージョン +### 言語 +- C++98 + +## 参照 +- [`eback()`](eback.md) +- [`gptr()`](gptr.md) +- [`egptr()`](egptr.md) diff --git a/reference/streambuf/basic_streambuf/setp.md b/reference/streambuf/basic_streambuf/setp.md new file mode 100644 index 0000000000..ac74fc1c5f --- /dev/null +++ b/reference/streambuf/basic_streambuf/setp.md @@ -0,0 +1,62 @@ +# setp +* streambuf[meta header] +* std[meta namespace] +* basic_streambuf[meta class] +* function[meta id-type] + +```cpp +namespace std { + template> + class basic_streambuf { + protected: + void setp(char_type* pbeg, char_type* pend); + + …… + }; +} +``` + +## 概要 +出力部分列の各ポインタを設定する。 + +## 事後条件 +pbeg == [`pbase()`](pbase.md) および pbeg == [`pptr()`](pptr.md) および pend == [`epptr()`](epptr.md)。 + +## 例 +```cpp example +#include +#include + +// streambufを継承したクラス +class dummy_buf : public std::streambuf { +public: + dummy_buf(char* begin, char* end) { + // 出力列の領域を指定 + setp(begin, end); + } +}; + +int main(void) { + char space[10] = {}; + dummy_buf buf{space, space + 10}; + buf.sputc('A'); // 3文字書き込む + buf.sputc('B'); + buf.sputc('C'); + std::cout << space << std::endl; // 書き込んだ文字列を出力 +} +``` +* setp[color ff0000] + +### 出力 +``` +ABC +``` + +## バージョン +### 言語 +- C++98 + +## 参照 +- [`pbase()`](pbase.md) +- [`pptr()`](pptr.md) +- [`epptr()`](epptr.md) diff --git a/reference/streambuf/basic_streambuf/sgetc.md b/reference/streambuf/basic_streambuf/sgetc.md new file mode 100644 index 0000000000..393f081891 --- /dev/null +++ b/reference/streambuf/basic_streambuf/sgetc.md @@ -0,0 +1,58 @@ +# sgetc +* streambuf[meta header] +* std[meta namespace] +* basic_streambuf[meta class] +* function[meta id-type] + +```cpp +namespace std { + template> + class basic_streambuf { + public: + int_type sgetc(); + + …… + }; +} +``` + +## 概要 +入力列の現在位置の文字を読み取る。 + +## 戻り値 +- 読み取り可能な文字列が存在する場合、現在位置の文字。 +- それ以外の場合、[`underflow()`](underflow.md)を返す。 + +## 例 +```cpp example +#include +#include + +// streambufを継承したクラス +class dummy_buf : public std::streambuf { + char space_[10] = {'A', 'B', 'C'}; +public: + dummy_buf(void) { + // 入力列に配列を設定 + setg(space_, space_, space_ + 10); + } +}; + +int main(void) { + dummy_buf buf{}; + std::cout << char(buf.sgetc()) << std::endl; // 現在位置の文字を読み取る +} +``` +* sgetc[color ff0000] + +### 出力 +``` +A +``` + +## バージョン +### 言語 +- C++98 + +## 参照 +- [`underflow()`](underflow.md) diff --git a/reference/streambuf/basic_streambuf/sgetn.md b/reference/streambuf/basic_streambuf/sgetn.md new file mode 100644 index 0000000000..0a93160360 --- /dev/null +++ b/reference/streambuf/basic_streambuf/sgetn.md @@ -0,0 +1,63 @@ +# sgetn +* streambuf[meta header] +* std[meta namespace] +* basic_streambuf[meta class] +* function[meta id-type] + +```cpp +namespace std { + template> + class basic_streambuf { + public: + streamsize sgetn(char_type* s, streamsize n); + + …… + }; +} +``` +* streamsize[link /reference/ios/type-streamsize.md] + +## 概要 +入力列から複数文字を読み取る。 + +## 戻り値 +xsgetn(s, n)。 + +## 例 +```cpp example +#include +#include + +// streambufを継承したクラス +class dummy_buf : public std::streambuf { + char space_[10] = {'A', 'B', 'C'}; +public: + dummy_buf(void) { + // 入力列に配列を設定 + setg(space_, space_, space_ + 10); + } +}; + +int main(void) { + dummy_buf buf{}; + char dump[4] = {}; + + buf.sgetn(dump, 3); // 最初の3文字を読み取る + std::cout << dump << std::endl; + std::cout << buf.in_avail() << std::endl; // 現在位置は3進んでいる +} +``` +* sgetn[color ff0000] + +### 出力 +``` +ABC +7 +``` + +## バージョン +### 言語 +- C++98 + +## 参照 +- [`xsgetn()`](xsgetn.md) diff --git a/reference/streambuf/basic_streambuf/showmanyc.md b/reference/streambuf/basic_streambuf/showmanyc.md new file mode 100644 index 0000000000..79d2f3ea7b --- /dev/null +++ b/reference/streambuf/basic_streambuf/showmanyc.md @@ -0,0 +1,71 @@ +# showmanyc +* streambuf[meta header] +* std[meta namespace] +* basic_streambuf[meta class] +* function[meta id-type] + +```cpp +namespace std { + template> + class basic_streambuf { + protected: + virtual streamsize showmanyc(); + + …… + }; +} +``` +* streamsize[link /reference/ios/type-streamsize.md] + +## 概要 +ブロックせずに読み取れると期待される文字数を得る。 + +## 効果 +デフォルトの動作は 0 を返すのみ。(入力部分列以外の領域がある場合、この関数をオーバーライドすることで、入力部分列以外の領域のサイズを返すようにする。) + +## 戻り値 +0。 + +## 例 +```cpp example +#include +#include + +// streambufを継承したクラス +class dummy_buf : public std::streambuf { + char space_[10] = {}; +public: + dummy_buf(void) { + // 入力列に配列を設定 + setg(space_, space_, space_ + 2); + } + std::streamsize showmanyc(void) override { + std::cout << "showmanyc" << std::endl; + // ベースクラスのshowmanyc()を呼ぶ + return std::streambuf::showmanyc(); + } +}; + +int main(void) { + dummy_buf buf{}; + std::cout << buf.in_avail() << std::endl; // 残2文字 + buf.sbumpc(); // 1文字進める + buf.sbumpc(); // 1文字進める + std::cout << buf.in_avail() << std::endl; // 残0文字。in_avail()からshowmanyc()が呼ばれる +} +``` +* std::streambuf::showmanyc[color ff0000] + +### 出力 +``` +2 +showmanyc +0 +``` + +## バージョン +### 言語 +- C++98 + +## 参照 +- [`in_avail()`](in_avail.md) diff --git a/reference/streambuf/basic_streambuf/snextc.md b/reference/streambuf/basic_streambuf/snextc.md new file mode 100644 index 0000000000..3f86c4b5a3 --- /dev/null +++ b/reference/streambuf/basic_streambuf/snextc.md @@ -0,0 +1,64 @@ +# snextc +* streambuf[meta header] +* std[meta namespace] +* basic_streambuf[meta class] +* function[meta id-type] + +```cpp +namespace std { + template> + class basic_streambuf { + public: + int_type snextc(); + + …… + }; +} +``` + +## 概要 +入力列の1文字を捨てて、次の文字を読み取る。 + +## 効果 +[`sbumpc()`](sbumpc.md)を呼んで、1文字分読み進める。 + +## 戻り値 +次の文字。文字データが尽きていれば、[`Traits::eof()`](../../string/char_traits/eof.md)を返す。 + +## 例 +```cpp example +#include +#include + +// streambufを継承したクラス +class dummy_buf : public std::streambuf { + char space_[10] = {'A', 'B', 'C'}; +public: + dummy_buf(void) { + // 入力列に配列を設定 + setg(space_, space_, space_ + 10); + } +}; + +int main(void) { + dummy_buf buf{}; + std::cout << buf.in_avail() << std::endl; + std::cout << char(buf.snextc()) << std::endl; // 1文字目の’A'を捨て、次の’B'を読み取る + std::cout << buf.in_avail() << std::endl; +} +``` +* snextc[color ff0000] + +### 出力 +``` +10 +B +9 +``` + +## バージョン +### 言語 +- C++98 + +## 参照 +- [`sbumpc()`](sbumpc.md) diff --git a/reference/streambuf/basic_streambuf/sputbackc.md b/reference/streambuf/basic_streambuf/sputbackc.md new file mode 100644 index 0000000000..adc39cf634 --- /dev/null +++ b/reference/streambuf/basic_streambuf/sputbackc.md @@ -0,0 +1,69 @@ +# sputbackc +* streambuf[meta header] +* std[meta namespace] +* basic_streambuf[meta class] +* function[meta id-type] + +```cpp +namespace std { + template> + class basic_streambuf { + public: + int_type sputbackc(char_type c); + + …… + }; +} +``` + +## 概要 +任意の1文字を入力列に戻す。 + +## 効果 +- 入力文字列の現在位置を1つ戻すことができ、かつ、1つ戻った位置の値がcと等しければ、現在位置を1つ戻す。 +- それ以外の場合、[`pbackfail`](pbackfail.md)([`Traits::to_int_type`](../../string/char_traits/to_int_type.md)(c))を呼ぶ。 + +## 戻り値 +- 入力文字列の現在位置を1つ戻すことができ、かつ、1つ戻った位置の値がcと等しければ、[`Traits::to_int_type`](../../string/char_traits/to_int_type.md)(c)。 +- それ以外の場合、[`pbackfail`](pbackfail.md)([`Traits::to_int_type`](../../string/char_traits/to_int_type.md)(c))の戻り値を返す。 + +## 例 +```cpp example +#include +#include + +// streambufを継承したクラス +class dummy_buf : public std::streambuf { + char space_[10] = {'A', 'B', 'C'}; +public: + dummy_buf(void) { + // 入力列に配列を設定 + setg(space_, space_, space_ + 10); + } +}; + +int main(void) { + dummy_buf buf{}; + buf.sbumpc(); // 現在位置を1つ進める + + std::cout << buf.sputbackc('Z') << std::endl; // 失敗(1つ前の値は’A') + + std::cout << buf.sputbackc('A') << std::endl; // 成功。現在位置が1つ戻る + std::cout << char(buf.sgetc()) << std::endl; +} +``` +* sputbackc[color ff0000] + +### 出力 +``` +-1 +65 +A +``` + +## バージョン +### 言語 +- C++98 + +## 参照 +- [`pbackfail()`](pbackfail.md) diff --git a/reference/streambuf/basic_streambuf/sputc.md b/reference/streambuf/basic_streambuf/sputc.md new file mode 100644 index 0000000000..5c35f02bbf --- /dev/null +++ b/reference/streambuf/basic_streambuf/sputc.md @@ -0,0 +1,73 @@ +# sputc +* streambuf[meta header] +* std[meta namespace] +* basic_streambuf[meta class] +* function[meta id-type] + +```cpp +namespace std { + template> + class basic_streambuf { + public: + int_type sputc(char_type c); + + …… + }; +} +``` + +## 概要 +出力列に1文字書き込む。 + +## 効果 +- 出力列が存在する場合、現在位置にcを書き込み、現在位置を1つ進める。 +- それ以外の場合、[`overflow()`](overflow.md)を呼ぶ。 + +## 戻り値 +- 出力列が存在する場合、[`Traits::to_int_type`](../../string/char_traits/to_int_type.md)(c)。 +- それ以外の場合、[`overflow()`](overflow.md)の戻り値を返す。 + +## 例 +```cpp example +#include +#include + +// streambufを継承したクラス +class dummy_buf : public std::streambuf { +public: + dummy_buf(char* begin, char* end) { + // 出力列の領域を指定 + setp(begin, end); + } +}; + +int main(void) { + char space[10] = {}; + { + dummy_buf buf{space, space}; // 空の領域を指定 + std::cout << buf.sputc('A') << std::endl; // 書き込みは失敗 + } + { + dummy_buf buf{space, space + 10}; + std::cout << buf.sputc('A') << " " // 3文字書き込む + << buf.sputc('B') << " " + << buf.sputc('C') << std::endl; + std::cout << space << std::endl; // 書き込んだ文字列を出力 + } +} +``` +* sputc[color ff0000] + +### 出力 +``` +-1 +65 66 67 +ABC +``` + +## バージョン +### 言語 +- C++98 + +## 参照 +- [`overflow()`](overflow.md) diff --git a/reference/streambuf/basic_streambuf/sputn.md b/reference/streambuf/basic_streambuf/sputn.md new file mode 100644 index 0000000000..bac6a1bfe0 --- /dev/null +++ b/reference/streambuf/basic_streambuf/sputn.md @@ -0,0 +1,63 @@ +# sputn +* streambuf[meta header] +* std[meta namespace] +* basic_streambuf[meta class] +* function[meta id-type] + +```cpp +namespace std { + template> + class basic_streambuf { + public: + std::streamsize sputn(const char_type* s, std::streamsize n); + + …… + }; +} +``` +* streamsize[link /reference/ios/type-streamsize.md] + +## 概要 +出力列に複数文字を書き込む。 + +## 効果 +[`xsputn`](xsputn.md)(s, n)を呼ぶ。xsputn()はprotected virtualなので、継承されていれば、継承先のxsputn()が呼ばれる。 + +## 戻り値 +[`xsputn`](xsputn.md)(s, n)の戻り値。 + +## 例 +```cpp example +#include +#include + +// streambufを継承したクラス +class dummy_buf : public std::streambuf { +public: + dummy_buf(char* begin, char* end) { + // 出力列の領域を指定 + setp(begin, end); + } +}; + +int main(void) { + char space[10] = {}; + dummy_buf buf{space, space + 10}; + std::cout << buf.sputn("ABCDE", 3) << std::endl; // 3文字書き込む + std::cout << space << std::endl; // 書き込んだ文字列を出力 +} +``` +* sputn[color ff0000] + +### 出力 +``` +3 +ABC +``` + +## バージョン +### 言語 +- C++98 + +## 参照 +- [`xsputn()`](xsputn.md) diff --git a/reference/streambuf/basic_streambuf/sungetc.md b/reference/streambuf/basic_streambuf/sungetc.md new file mode 100644 index 0000000000..5439cf4588 --- /dev/null +++ b/reference/streambuf/basic_streambuf/sungetc.md @@ -0,0 +1,71 @@ +# sungetc +* streambuf[meta header] +* std[meta namespace] +* basic_streambuf[meta class] +* function[meta id-type] + +```cpp +namespace std { + template> + class basic_streambuf { + public: + int_type sungetc(); + + …… + }; +} +``` + +## 概要 +直前に読み取った1文字を入力列に戻す。 + +## 効果 +- 入力文字列の現在位置を1つ戻すことができる場合、現在位置を1つ戻す。 +- それ以外の場合、[`pbackfail`](pbackfail.md)([`Traits::to_int_type`](../../string/char_traits/to_int_type.md)(c))を呼ぶ。 + +## 戻り値 +- 読み取り可能な文字列が存在する場合、更新された現在位置のTraits::to_int_type(*gptr())。 +- それ以外の場合、[`pbackfail`](pbackfail.md)([`Traits::to_int_type`](../../string/char_traits/to_int_type.md)(c))の戻り値を返す。 + +## 例 +```cpp example +#include +#include + +// streambufを継承したクラス +class dummy_buf : public std::streambuf { + char space_[10] = {'A', 'B', 'C'}; +public: + dummy_buf(void) { + // 入力列に配列を設定 + setg(space_, space_, space_ + 10); + } +}; + +int main(void) { + dummy_buf buf{}; + buf.sbumpc(); // 現在位置を1つ進める + + std::cout << char(buf.sgetc()) << std::endl; + std::cout << buf.sungetc() << std::endl; // 成功。現在位置が1つ戻る + std::cout << char(buf.sgetc()) << std::endl; + + std::cout << buf.sungetc() << std::endl; // 失敗(現在位置は既に先頭に達している) +} +``` +* sungetc[color ff0000] + +### 出力 +``` +B +65 +A +-1 +``` + +## バージョン +### 言語 +- C++98 + +## 参照 +- [`pbackfail()`](pbackfail.md) diff --git a/reference/streambuf/basic_streambuf/swap.md b/reference/streambuf/basic_streambuf/swap.md new file mode 100644 index 0000000000..1616d7ba9f --- /dev/null +++ b/reference/streambuf/basic_streambuf/swap.md @@ -0,0 +1,60 @@ +# swap +* streambuf[meta header] +* std[meta namespace] +* basic_streambuf[meta class] +* function[meta id-type] +* cpp11[meta cpp] + +```cpp +namespace std { + template> + class basic_streambuf { + protected: + void swap(basic_streambuf& rhs); + + …… + }; +} +``` + +## 概要 +rhsと値を交換する。 + +## 例 +```cpp example +#include +#include + +// streambufを継承したクラス +class dummy_buf : public std::streambuf { + char space_[10] = {'A', 'B', 'C'}; +public: + dummy_buf(void) { + // 入力列に配列を設定 + setg(space_, space_, space_ + 10); + } + void swap(dummy_buf& rhs) { + // ベースクラスのswap()を呼ぶ + std::streambuf::swap(rhs); + } +}; + +int main(void) { + dummy_buf buf1{}; + dummy_buf buf2{}; + std::cout << char(buf1.sbumpc()) << std::endl; + buf2.swap(buf1); + std::cout << char(buf2.sbumpc()) << std::endl; +} +``` +* std::streambuf::swap[color ff0000] + +### 出力 +``` +A +B +``` + +## バージョン +### 言語 +- C++98 diff --git a/reference/streambuf/basic_streambuf/sync.md b/reference/streambuf/basic_streambuf/sync.md new file mode 100644 index 0000000000..ea505041d7 --- /dev/null +++ b/reference/streambuf/basic_streambuf/sync.md @@ -0,0 +1,58 @@ +# sync +* streambuf[meta header] +* std[meta namespace] +* basic_streambuf[meta class] +* function[meta id-type] + +```cpp +namespace std { + template> + class basic_streambuf { + protected: + virtual int sync(); + + …… + }; +} +``` + +## 概要 +出力列の同期。 + +## 効果 +デフォルトの動作は 0 を返すのみ。(オーバーライドした関数では、flushに相当する動作をすることが求められる。) + +## 戻り値 +0。 + +## 例 +```cpp example +#include +#include + +// streambufを継承したクラス +class dummy_buf : public std::streambuf { +public: + dummy_buf(void) { + } +protected: + virtual int sync(void) override { + std::cout << "sync" << std::endl; + // ベースクラスのsync()を呼ぶ + return std::streambuf::sync(); + } +}; + +int main(void) { + dummy_buf buf; + buf.pubsync(); // pubsync()を介してsync()を呼ぶ +} +``` +* std::streambuf::sync[color ff0000] + +## バージョン +### 言語 +- C++98 + +## 参照 +- [`pubsync()`](pubsync.md) diff --git a/reference/streambuf/basic_streambuf/uflow.md b/reference/streambuf/basic_streambuf/uflow.md new file mode 100644 index 0000000000..29282d4e57 --- /dev/null +++ b/reference/streambuf/basic_streambuf/uflow.md @@ -0,0 +1,76 @@ +# uflow +* streambuf[meta header] +* std[meta namespace] +* basic_streambuf[meta class] +* function[meta id-type] + +```cpp +namespace std { + template> + class basic_streambuf { + protected: + virtual int_type uflow(); + + …… + }; +} +``` + +## 概要 +入力部分列の領域を消費し切った際の処理。 + +## 効果 +デフォルトの動作は[`overflow()`](overflow.md)を呼ぶ。 + +- [`overflow()`](overflow.md)の戻り値が[`Traits::eof()`](../../string/char_traits/eof.md)であれば、[`Traits::eof()`](../../string/char_traits/eof.md)を返すのみ。 +- [`overflow()`](overflow.md)の戻り値が[`Traits::eof()`](../../string/char_traits/eof.md)でなければ、[`Traits::to_int_type`](../../string/char_traits/to_int_type.md)(*[`gptr()`](gptr.md))を返しつつ、[`gptr()`](gptr.md)を一つ進める。 + +なお、[`overflow()`](overflow.md)はデフォルト動作では、常に[`Traits::eof()`](../../string/char_traits/eof.md)を返す。 + +## 備考 +入力部分列の領域を消費し切った状態で[`sbumpc()`](sbumpc.md)を呼ぶと、uflow()が呼ばれる。 + +## 例 +```cpp example +#include +#include + +// streambufを継承したクラス +class dummy_buf : public std::streambuf { + char space_[10] = {'A', 'B'}; +public: + dummy_buf(void) { + // 入力列に配列を設定 + setg(space_, space_, space_ + 2); + } +protected: + int_type uflow(void) override { + std::cout << "uflow" << std::endl; + // ベースクラスのuflow()を呼ぶ + return std::streambuf::uflow(); + } +}; + +int main(void) { + dummy_buf buf{}; + std::cout << buf.sbumpc() << std::endl; // 1文字目の’A'を読み取る + std::cout << buf.sbumpc() << std::endl; // 2文字目の’B'を読み取る + std::cout << buf.sbumpc() << std::endl; // 文字の読み取りに失敗。uflow()が呼ばれ、Traits::eof()が返る +} +``` +* std::streambuf::uflow[color ff0000] + +### 出力 +``` +65 +66 +uflow +-1 +``` + +## バージョン +### 言語 +- C++98 + +## 参照 +- [`underflow()`](underflow.md) diff --git a/reference/streambuf/basic_streambuf/underflow.md b/reference/streambuf/basic_streambuf/underflow.md new file mode 100644 index 0000000000..30318bca82 --- /dev/null +++ b/reference/streambuf/basic_streambuf/underflow.md @@ -0,0 +1,74 @@ +# underflow +* streambuf[meta header] +* std[meta namespace] +* basic_streambuf[meta class] +* function[meta id-type] + +```cpp +namespace std { + template> + class basic_streambuf { + protected: + virtual int_type underflow(); + + …… + }; +} +``` + +## 概要 +入力部分列の領域を消費し切った際の処理。 + +## 効果 +デフォルトの動作は[`Traits::eof()`](../../string/char_traits/eof.md)を返すのみ。(この関数をオーバーライドすることで、関数内で改めて[`setg()`](setg.md)を呼んで別の入力部分列を指し直す、のような処理を追加できる。) + +## 戻り値 +[`Traits::eof()`](../../string/char_traits/eof.md)。 + +## 備考 +入力部分列の領域を消費し切った状態で[`sgetc()`](sgetc.md)を呼ぶと、underflow()が呼ばれる。 + +## 例 +```cpp example +#include +#include + +// streambufを継承したクラス +class dummy_buf : public std::streambuf { + char space_[10] = {'A', 'B'}; +public: + dummy_buf(void) { + // 入力列に配列を設定 + setg(space_, space_, space_ + 2); + } +protected: + int_type underflow(void) override { + std::cout << "underflow" << std::endl; + // ベースクラスのunderflow()を呼ぶ + return std::streambuf::underflow(); + } +}; + +int main(void) { + dummy_buf buf{}; + std::cout << buf.sgetc() << std::endl; // 1文字目の’A'を読み取る + buf.sbumpc(); // 1文字進める + buf.sbumpc(); // 1文字進める + std::cout << buf.sgetc() << std::endl; // 文字の読み取りに失敗。underflow()が呼ばれ、Traits::eof()が返る +} +``` +* std::streambuf::underflow[color ff0000] + +### 出力 +``` +65 +underflow +-1 +``` + +## バージョン +### 言語 +- C++98 + +## 参照 +- [`uflow()`](uflow.md) diff --git a/reference/streambuf/basic_streambuf/xsgetn.md b/reference/streambuf/basic_streambuf/xsgetn.md new file mode 100644 index 0000000000..1817b0b83a --- /dev/null +++ b/reference/streambuf/basic_streambuf/xsgetn.md @@ -0,0 +1,75 @@ +# xsgetn +* streambuf[meta header] +* std[meta namespace] +* basic_streambuf[meta class] +* function[meta id-type] + +```cpp +namespace std { + template> + class basic_streambuf { + protected: + virtual streamsize xsgetn(char_type* s, streamsize n); + + …… + }; +} +``` +* streamsize[link /reference/ios/type-streamsize.md] + +## 概要 +入力列から複数文字を読み取る。 + +## 効果 +入力列からn文字読み取り、sに格納する。入力列の読み取り可能領域が尽きれば、そこで読み取りを停止する。 + +## 戻り値 +読み取った文字数。 + +## 例 +```cpp example +#include +#include + +// streambufを継承したクラス +class dummy_buf : public std::streambuf { + char space_[5] = {'A', 'B', 'C', 'D', 'E'}; +public: + dummy_buf(void) { + // 入力列に配列を設定 + setg(space_, space_, space_ + 5); + } + std::streamsize xsgetn(char_type* s, std::streamsize n) override { + // ベースクラスのxsgetn()を呼ぶ + return std::streambuf::xsgetn(s, n); + } +}; + +int main(void) { + dummy_buf buf{}; + + char dump1[4] = {}; + std::cout << buf.xsgetn(dump1, 3) << std::endl; // 最初の3文字を読み取る + std::cout << dump1 << std::endl; + + char dump2[4] = {}; + std::cout << buf.xsgetn(dump2, 3) << std::endl; // 続く2文字のみ読み取る + std::cout << dump2 << std::endl; +} +``` +* std::streambuf::xsgetn[color ff0000] + +### 出力 +``` +3 +ABC +2 +DE +``` + +## バージョン +### 言語 +- C++98 + +## 参照 +- [`sgetn()`](sgetn.md) diff --git a/reference/streambuf/basic_streambuf/xsputn.md b/reference/streambuf/basic_streambuf/xsputn.md new file mode 100644 index 0000000000..4d4fe9364f --- /dev/null +++ b/reference/streambuf/basic_streambuf/xsputn.md @@ -0,0 +1,69 @@ +# xsputn +* streambuf[meta header] +* std[meta namespace] +* basic_streambuf[meta class] +* function[meta id-type] + +```cpp +namespace std { + template> + class basic_streambuf { + protected: + virtual streamsize xsputn(const char_type* s, streamsize n); + + …… + }; +} +``` +* streamsize[link /reference/ios/type-streamsize.md] + +## 概要 +出力列に複数文字を書き込む。 + +## 効果 +sからn文字を出力列に書き込む。書き込み可能領域が一杯になると、そこで書き込みを停止する。 + +## 戻り値 +書き込んだ文字数。 + +## 例 +```cpp example +#include +#include + +// streambufを継承したクラス +class dummy_buf : public std::streambuf { +public: + dummy_buf(char* begin, char* end) { + // 出力列の領域を指定 + setp(begin, end); + } + std::streamsize xsputn(const char_type* s, std::streamsize n) override { + // ベースクラスのxsputn()を呼ぶ + return std::streambuf::xsputn(s, n); + } +}; + +int main(void) { + char space[10] = {}; + dummy_buf buf{space, space + 5}; + std::cout << buf.xsputn("ABC", 3) << std::endl; // 3文字全て書き込む + std::cout << buf.xsputn("ABC", 3) << std::endl; // 2文字のみ書き込む + std::cout << space << std::endl; // 書き込んだ文字列を出力 +} +``` +* std::streambuf::xsputn[color ff0000] + +### 出力 +``` +3 +2 +ABCAB +``` + +## バージョン +### 言語 +- C++98 + +## 参照 +- [`sputn()`](sputn.md) From 8e2ed62cb6caa069f2cb8d0c547621b050b2abf2 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 2 Feb 2024 03:54:34 +0900 Subject: [PATCH 0691/3948] =?UTF-8?q?C++23=20:=20=E3=80=8C1=E3=83=AF?= =?UTF-8?q?=E3=82=A4=E3=83=89=E6=96=87=E5=AD=97=E3=81=AB=E5=8F=8E=E3=81=BE?= =?UTF-8?q?=E3=82=89=E3=81=AA=E3=81=84=E3=83=AF=E3=82=A4=E3=83=89=E6=96=87?= =?UTF-8?q?=E5=AD=97=E3=83=AA=E3=83=86=E3=83=A9=E3=83=AB=E3=82=92=E7=A6=81?= =?UTF-8?q?=E6=AD=A2=E3=81=99=E3=82=8B=E3=80=8D=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20(close=20#1032)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp23.md | 2 +- ..._multicharacter_wide_character_literals.md | 27 +++++++++++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md diff --git a/implementation-status.md b/implementation-status.md index 25bc440cbc..f260f364d4 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -261,7 +261,7 @@ | P1169R4: [`this`ポインタをもつ必要のない演算子を`static`として宣言できるようにする](/lang/cpp23/static_operator.md) | 状態をもたないいくつかの演算子を`static`として宣言できるようにする | 13 | 16 | 2023.2 | - | | P2201R1: [異なる文字エンコーディングをもつ文字列リテラルの連結を不適格とする](/lang/cpp23/mixed_string_literal_concatenation.md.nolink) | `auto a = u8"" L"";`のような異なる文字エンコーディング同士での文字列リテラルを連結を禁止する | Yes | Yes | 2022.2 | Yes | | P2029R4: [文字・文字列リテラル中の数値・ユニバーサルキャラクタのエスケープに関する問題解決](/lang/cpp23/numeric_and_universal_character_escapes_in_character_and_string_literals.md.nolink) | | - | - | - | - | -| P2362R3: [1ワイド文字に収まらないワイド文字リテラルを禁止する](/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md.nolink) | エンコード結果として`wchar_t`の大きさに収まらないワイド文字リテラルを禁止する | 13 | 14 | 2023.2 | - | +| P2362R3: [1ワイド文字に収まらないワイド文字リテラルを禁止する](/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md) | エンコード結果として`wchar_t`の大きさに収まらないワイド文字リテラルを禁止する | 13 | 14 | 2023.2 | - | | P2071R2: [名前付きユニバーサルキャラクタ名](/lang/cpp23/named_universal_character_escapes.md) | 16進数のユニバーサルキャラクタだけでなく、その文字の名前を入力できるようにする | 13 | 15 | 2023.2 | - | | P2096R2: [部分特殊化の汎用化仕様](/lang/cpp23/generalized_wording_for_partial_specializations.md.nolink) | 変数テンプレートの部分特殊化を許可するために部分特殊化の仕様を汎用化 | - | - | - | - | | P2582R1: [継承コンストラクタからのクラステンプレート引数の推論](/lang/cpp23/class_template_argument_deduction_from_inherited.md.nolink) | | - | - | - | - | diff --git a/lang/cpp23.md b/lang/cpp23.md index 3a42342d4b..7292c81ce8 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -51,7 +51,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 | [異なる文字エンコーディングをもつ文字列リテラルの連結を不適格とする](cpp23/mixed_string_literal_concatenation.md.nolink) | `auto a = u8"" L"";`のような異なる文字エンコーディング同士での文字列リテラルを連結を禁止する | | [エスケープシーケンスの区切り](cpp23/delimited_escape_sequences.md) | エスケープシーケンスの範囲を明確にする構文を追加する | | [文字・文字列リテラル中の数値・ユニバーサルキャラクタのエスケープに関する問題解決](cpp23/numeric_and_universal_character_escapes_in_character_and_string_literals.md.nolink) | | -| [1ワイド文字に収まらないワイド文字リテラルを禁止する](cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md.nolink) | エンコード結果として`wchar_t`の大きさに収まらないワイド文字リテラルを禁止する | +| [1ワイド文字に収まらないワイド文字リテラルを禁止する](cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md) | エンコード結果として`wchar_t`の大きさに収まらないワイド文字リテラルを禁止する | | [名前付きユニバーサルキャラクタ名](cpp23/named_universal_character_escapes.md) | 16進数のユニバーサルキャラクタだけでなく、その文字の名前を入力できるようにする | diff --git a/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md b/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md new file mode 100644 index 0000000000..ea946f5c9b --- /dev/null +++ b/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md @@ -0,0 +1,27 @@ +# 1ワイド文字に収まらないワイド文字リテラルを禁止する +* cpp23[meta cpp] + +## 概要 +C++23では、ワイド文字リテラルとして、以下を禁止する: + +- マルチキャラクタリテラル +- エンコード可能ではない、または複数文字を含む文字 + +```cpp +wchar_t a = '🤦'; // C++20:OK, C++23:OK \U0001f926 +wchar_t b = 'ab'; // C++20:OK, C++23:NG マルチキャラクタリテラル +wchar_t c = 'é́'; // C++20:OK, C++23:NG \u0065\u0301 +``` + +`wchar_t`はプラットフォームによって16ビットか32ビットのどちらかとなる。 +変数`a`のケースは`wchar_t`が32ビットの環境では情報を損うことなく表現でき、16ビットの環境では上位16ビットか下位16ビットのどちらかが切り捨てられる実装がある。 +`a`のケースは32ビットの場合には正しいものであるため、C++23では維持される。 + +変数`b`のケースはマルチキャラクタリテラル (multi-character literals) であり、実装定義の値となるが、多くの環境でいずれか1文字の値のみが使われていた。また、韓国語やバラモン語では1文字に見えて複数文字であるような場合があるため、`wchar_t`にマルチキャラクタリテラルを許可することはバグの元であるため、禁止とする。 + +変数`c`のケースは1文字のように見えても複数のコードポイントで構成されており、マルチキャラクタリテラルの一種であるため禁止とする。 + + +## 参照 +- [P2362R3 Remove non-encodable wide character literals and multicharacter wide character literals](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2362r3.pdf) + From 547e2058fa2c0087d6642cefacf893698aff939f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 2 Feb 2024 04:04:11 +0900 Subject: [PATCH 0692/3948] =?UTF-8?q?nolink=E3=82=92=E8=A7=A3=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/cpprefjp/site/commit/a2f9fa08d694f177123b941746b64f1db49671b3 --- reference/ios/ios_base/sync_with_stdio.md | 6 +++--- reference/istream/basic_istream/seekg.md | 2 +- .../istream/basic_istream/sentry/op_constructor.md | 6 +++--- reference/istream/basic_istream/sync.md | 2 +- reference/istream/basic_istream/tellg.md | 2 +- reference/istream/basic_istream/unget.md | 2 +- reference/iterator/ostreambuf_iterator/op_assign.md | 2 +- reference/ostream/basic_ostream/flush.md | 6 +++--- reference/ostream/basic_ostream/seekp.md | 12 ++++++------ .../ostream/basic_ostream/sentry/op_destructor.md | 4 ++-- reference/ostream/basic_ostream/tellp.md | 6 +++--- 11 files changed, 25 insertions(+), 25 deletions(-) diff --git a/reference/ios/ios_base/sync_with_stdio.md b/reference/ios/ios_base/sync_with_stdio.md index f315cba85f..f3d6f1fa42 100644 --- a/reference/ios/ios_base/sync_with_stdio.md +++ b/reference/ios/ios_base/sync_with_stdio.md @@ -25,9 +25,9 @@ static bool sync_with_stdio(bool sync = true); ## 備考 標準ストリーム `str` が C 言語ライブラリの標準ストリーム `f` と同期している場合、 -- 文字 `c` のストリームへの出力 [`fputc`](../../cstdio/fputc.md.nolink)`(f, c);` は `str.`[`rdbuf`](../basic_ios/rdbuf.md)`()->`[`sputc`](../../streambuf/basic_streambuf/sputc.md.nolink)`(c);` と等価であり、 -- 文字 `c` のストリームからの入力 `c =` [`fgetc`](../../cstdio/fgetc.md.nolink)`(f);` は `c = str.`[`rdbuf`](../basic_ios/rdbuf.md)`()->`[`sbumpc`](../../streambuf/basic_streambuf/sbumpc.md.nolink)`();` と等価であり、 -- 文字 `c` のストリームへの戻し [`ungetc`](../../cstdio/ungetc.md.nolink)`(c, f)` は `str.`[`rdbuf`](../basic_ios/rdbuf.md)`()->`[`sputbackc`](../../streambuf/basic_streambuf/sputbackc.md.nolink)`(c);` と等価である。 +- 文字 `c` のストリームへの出力 [`fputc`](../../cstdio/fputc.md.nolink)`(f, c);` は `str.`[`rdbuf`](../basic_ios/rdbuf.md)`()->`[`sputc`](../../streambuf/basic_streambuf/sputc.md)`(c);` と等価であり、 +- 文字 `c` のストリームからの入力 `c =` [`fgetc`](../../cstdio/fgetc.md.nolink)`(f);` は `c = str.`[`rdbuf`](../basic_ios/rdbuf.md)`()->`[`sbumpc`](../../streambuf/basic_streambuf/sbumpc.md)`();` と等価であり、 +- 文字 `c` のストリームへの戻し [`ungetc`](../../cstdio/ungetc.md.nolink)`(c, f)` は `str.`[`rdbuf`](../basic_ios/rdbuf.md)`()->`[`sputbackc`](../../streambuf/basic_streambuf/sputbackc.md)`(c);` と等価である。 ## 例 diff --git a/reference/istream/basic_istream/seekg.md b/reference/istream/basic_istream/seekg.md index 949ee5a3ae..f49ef55682 100644 --- a/reference/istream/basic_istream/seekg.md +++ b/reference/istream/basic_istream/seekg.md @@ -106,7 +106,7 @@ basic_istream& seekg(off_type off, seekdir dir) { * eofbit[link /reference/ios/ios_base/type-iostate.md] * sentry[link sentry.md] * rdbuf()[link /reference/ios/basic_ios/rdbuf.md] -* pubseekpos[link /reference/streambuf/basic_streambuf/pubseekpos.md.nolink] +* pubseekpos[link /reference/streambuf/basic_streambuf/pubseekpos.md] * ios_base[link /reference/ios/ios_base.md] * in[link /reference/ios/ios_base/type-openmode.md] * failbit[link /reference/ios/ios_base/type-iostate.md] diff --git a/reference/istream/basic_istream/sentry/op_constructor.md b/reference/istream/basic_istream/sentry/op_constructor.md index 09712203f3..1d91eb88bf 100644 --- a/reference/istream/basic_istream/sentry/op_constructor.md +++ b/reference/istream/basic_istream/sentry/op_constructor.md @@ -16,10 +16,10 @@ explicit sentry(basic_istream& is, bool noskipws = false); 1. `is.`[`good`](../../../ios/basic_ios/good.md)`()`が`false`なら、`is.`[`setstate`](../../../ios/basic_ios/setstate.md)`(failbit)`を呼び出し、関数から帰る。 1. `is.`[`tie`](../../../ios/basic_ios/tie.md)`()`が非ヌルポインタなら、`is.`[`tie`](../../../ios/basic_ios/tie.md)`()->`[`flush`](../../../ostream/basic_ostream/flush.md)`()`を呼び出す。 - `is.`[`tie`](../../../ios/basic_ios/tie.md)`()`が指す先のストリームバッファのput areaが空なら、この処理を省略しても良い。 - - `is.`[`rdbuf`](../../../ios/basic_ios/rdbuf.md)`()->`[`underflow`](../../../streambuf/basic_streambuf/underflow.md.nolink)`()`の呼び出しが発生するまで、この処理を遅延させても良い。 - - `is.`[`rdbuf`](../../../ios/basic_ios/rdbuf.md)`()->`[`underflow`](../../../streambuf/basic_streambuf/underflow.md.nolink)`()`の呼び出しが発生しなかったら、この処理を省略して良い(標準ライブラリ実装内部で、そのような最適化を行っても良い)。 + - `is.`[`rdbuf`](../../../ios/basic_ios/rdbuf.md)`()->`[`underflow`](../../../streambuf/basic_streambuf/underflow.md)`()`の呼び出しが発生するまで、この処理を遅延させても良い。 + - `is.`[`rdbuf`](../../../ios/basic_ios/rdbuf.md)`()->`[`underflow`](../../../streambuf/basic_streambuf/underflow.md)`()`の呼び出しが発生しなかったら、この処理を省略して良い(標準ライブラリ実装内部で、そのような最適化を行っても良い)。 1. `noskipws`が`false`かつ`is.`[`flags`](../../../ios/ios_base/flags.md)`() &` [`ios_base`](../../../ios/ios_base.md)`::skipws`が真なら、ストリームから空白文字を読み捨てる。 - 空白文字の判定は、文字`c`について[`use_facet`](../../../locale/use_facet.md.nolink)`<`[`ctype`](../../../locale/ctype.md)`>(is.`[`getloc`](../../../ios/ios_base/getloc.md)`()).`[`is`](../../../locale/ctype/is.md.nolink)`(`[`ctype`](../../../locale/ctype.md)`::`[`space`](../../../locale/ctype_base.md)`, c)`と等価な方法で行う。 - - このとき`is.`[`rdbuf`](../../../ios/basic_ios/rdbuf.md)`()->`[`sbumpc`](../../../streambuf/basic_streambuf/sbumpc.md.nolink)`()`または`is.`[`rdbuf`](../../../ios/basic_ios/rdbuf.md)`()->`[`sgetc`](../../../streambuf/basic_streambuf/sgetc.md.nolink)`()`が`Traits::eof()`を返したら、`is.`[`setstate`](../../../ios/basic_ios/setstate.md)`(failbit | eofbit)`を呼び出す。 + - このとき`is.`[`rdbuf`](../../../ios/basic_ios/rdbuf.md)`()->`[`sbumpc`](../../../streambuf/basic_streambuf/sbumpc.md)`()`または`is.`[`rdbuf`](../../../ios/basic_ios/rdbuf.md)`()->`[`sgetc`](../../../streambuf/basic_streambuf/sgetc.md)`()`が`Traits::eof()`を返したら、`is.`[`setstate`](../../../ios/basic_ios/setstate.md)`(failbit | eofbit)`を呼び出す。 ここまでの手順が完了したら、このオブジェクトの`operator bool`関数は`true`を、さもなくば`false`を返すようになる。 diff --git a/reference/istream/basic_istream/sync.md b/reference/istream/basic_istream/sync.md index dde4f1f5f0..b84c364e4f 100644 --- a/reference/istream/basic_istream/sync.md +++ b/reference/istream/basic_istream/sync.md @@ -46,7 +46,7 @@ int sync() { ``` * sentry[link sentry.md] * rdbuf()[link /reference/ios/basic_ios/rdbuf.md] -* pubsync()[link /reference/streambuf/basic_streambuf/pubsync.md.nolink] +* pubsync()[link /reference/streambuf/basic_streambuf/pubsync.md] * setstate[link /reference/ios/basic_ios/setstate.md] * badbit[link /reference/ios/ios_base/type-iostate.md] * exceptions()[link /reference/ios/basic_ios/exceptions.md] diff --git a/reference/istream/basic_istream/tellg.md b/reference/istream/basic_istream/tellg.md index ab7cb9326c..6adc6d5e2d 100644 --- a/reference/istream/basic_istream/tellg.md +++ b/reference/istream/basic_istream/tellg.md @@ -74,7 +74,7 @@ pos_type tellg(pos_type pos) { ``` * sentry[link sentry.md] * rdbuf()[link /reference/ios/basic_ios/rdbuf.md] -* pubseekoff[link /reference/streambuf/basic_streambuf/pubseekoff.md.nolink] +* pubseekoff[link /reference/streambuf/basic_streambuf/pubseekoff.md] * exceptions()[link /reference/ios/basic_ios/exceptions.md] * badbit[link /reference/ios/ios_base/type-iostate.md] diff --git a/reference/istream/basic_istream/unget.md b/reference/istream/basic_istream/unget.md index 8a36bbbefd..1fffb103d5 100644 --- a/reference/istream/basic_istream/unget.md +++ b/reference/istream/basic_istream/unget.md @@ -97,7 +97,7 @@ basic_istream& unget() { * eofbit[link /reference/ios/ios_base/type-iostate.md] * sentry[link sentry.md] * rdbuf()[link /reference/ios/basic_ios/rdbuf.md] -* sungetc()[link /reference/streambuf/basic_streambuf/sungetc.md.nolink] +* sungetc()[link /reference/streambuf/basic_streambuf/sungetc.md] * exceptions()[link /reference/ios/basic_ios/exceptions.md] * badbit[link /reference/ios/ios_base/type-iostate.md] diff --git a/reference/iterator/ostreambuf_iterator/op_assign.md b/reference/iterator/ostreambuf_iterator/op_assign.md index 3d25daa480..e260e963f1 100644 --- a/reference/iterator/ostreambuf_iterator/op_assign.md +++ b/reference/iterator/ostreambuf_iterator/op_assign.md @@ -13,7 +13,7 @@ ostreambuf_iterator& operator=(CharT c); ## 効果 -[`failed`](failed.md)`() == false`の場合に`sbuf_->`[`sputc`](../../streambuf/basic_streambuf/sputc.md.nolink)`(c)`を行い、そうでなければ何もしない。 +[`failed`](failed.md)`() == false`の場合に`sbuf_->`[`sputc`](../../streambuf/basic_streambuf/sputc.md)`(c)`を行い、そうでなければ何もしない。 ※ `sbuf_`はメンバ変数として保持している`streambuf_type`オブジェクトへのポインタ diff --git a/reference/ostream/basic_ostream/flush.md b/reference/ostream/basic_ostream/flush.md index 83acd81cea..1a82b076b1 100644 --- a/reference/ostream/basic_ostream/flush.md +++ b/reference/ostream/basic_ostream/flush.md @@ -14,8 +14,8 @@ basic_ostream& flush(); ## 効果 1. [`rdbuf`](../../ios/basic_ios/rdbuf.md)`()` がヌルポインタであれば、何もしない。 1. [`sentry`](sentry.md) オブジェクトを構築する。[`sentry`](sentry.md) オブジェクトが失敗を示した場合、何もしない。 -1. [`rdbuf`](../../ios/basic_ios/rdbuf.md)`()->`[`pubsync`](../../streambuf/basic_streambuf/pubsync.md.nolink)`()` を呼び出す。 -1. [`pubsync`](../../streambuf/basic_streambuf/pubsync.md.nolink)`()` が `-1` を返した場合は、[`setstate`](../../ios/basic_ios/setstate.md)`(`[`badbit`](../../ios/ios_base/type-iostate.md)`)` を呼び出す。(それによって、例外 [`ios_base`](../../ios/ios_base.md)`::`[`failure`](../../ios/ios_base/failure.md) が送出されるかもしれない) +1. [`rdbuf`](../../ios/basic_ios/rdbuf.md)`()->`[`pubsync`](../../streambuf/basic_streambuf/pubsync.md)`()` を呼び出す。 +1. [`pubsync`](../../streambuf/basic_streambuf/pubsync.md)`()` が `-1` を返した場合は、[`setstate`](../../ios/basic_ios/setstate.md)`(`[`badbit`](../../ios/ios_base/type-iostate.md)`)` を呼び出す。(それによって、例外 [`ios_base`](../../ios/ios_base.md)`::`[`failure`](../../ios/ios_base/failure.md) が送出されるかもしれない) 1. 上記処理中に例外が送出された場合、出力ストリームの現在の状態に [`ios_base`](../../ios/ios_base.md)`::`[`badbit`](../../ios/ios_base/type-iostate.md) を設定し、`(`[`exceptions`](../../ios/basic_ios/exceptions.md)`() &` [`ios_base`](../../ios/ios_base.md)`::`[`badbit`](../../ios/ios_base/type-iostate.md)`) != 0` の場合、当該例外を再送出する。 ## 戻り値 @@ -67,7 +67,7 @@ basic_ostream& basic_ostream::flush() * basic_ostream[link ../basic_ostream.md] * rdbuf[link ../../ios/basic_ios/rdbuf.md] * sentry[link sentry.md] -* pubsync[link ../../streambuf/basic_streambuf/pubsync.md.nolink] +* pubsync[link ../../streambuf/basic_streambuf/pubsync.md] * setstate[link ../../ios/basic_ios/setstate.md] * exceptions[link ../../ios/basic_ios/exceptions.md] * ios_base[link ../../ios/ios_base.md] diff --git a/reference/ostream/basic_ostream/seekp.md b/reference/ostream/basic_ostream/seekp.md index fe5c1d4e30..a47d4f23cc 100644 --- a/reference/ostream/basic_ostream/seekp.md +++ b/reference/ostream/basic_ostream/seekp.md @@ -27,8 +27,8 @@ basic_ostream& seekp(off_type off, seekdir dir); // (2) 1. [`sentry`](sentry.md) オブジェクトを構築する(C++11 以降のみ)。 1. 与えられた実引数により、以下のいずれかを実行する。 - - (1) [`rdbuf`](../../ios/basic_ios/rdbuf.md)`()->`[`pubseekpos`](../../streambuf/basic_streambuf/pubseekpos.md.nolink)`(pos, ios_base::out)` - - (2) [`rdbuf`](../../ios/basic_ios/rdbuf.md)`()->`[`pubseekoff`](../../streambuf/basic_streambuf/pubseekoff.md.nolink)`(off, dir, ios_base::out)` + - (1) [`rdbuf`](../../ios/basic_ios/rdbuf.md)`()->`[`pubseekpos`](../../streambuf/basic_streambuf/pubseekpos.md)`(pos, ios_base::out)` + - (2) [`rdbuf`](../../ios/basic_ios/rdbuf.md)`()->`[`pubseekoff`](../../streambuf/basic_streambuf/pubseekoff.md)`(off, dir, ios_base::out)` 1. 処理に失敗した場合(上記の戻り値が `-1` だった場合)、[`setstate`](../../ios/basic_ios/setstate.md)`(failbit)`を呼び出す。 ## 例 @@ -81,8 +81,8 @@ basic_ostream& seekp(off_type off, seekdir dir) { * sentry[link sentry.md] * fail[link ../../ios/basic_ios/fail.md] * rdbuf[link ../../ios/basic_ios/rdbuf.md] -* pubseekpos[link ../../streambuf/basic_streambuf/pubseekpos.md.nolink] -* pubseekoff[link ../../streambuf/basic_streambuf/pubseekoff.md.nolink] +* pubseekpos[link ../../streambuf/basic_streambuf/pubseekpos.md] +* pubseekoff[link ../../streambuf/basic_streambuf/pubseekoff.md] * setstate[link ../../ios/basic_ios/setstate.md] ## バージョン @@ -92,5 +92,5 @@ basic_ostream& seekp(off_type off, seekdir dir) { ## 参照 - [`basic_ostream::tellp`](tellp.md) -- [`basic_streambuf::pubseekpos`](../../streambuf/basic_streambuf/pubseekpos.md.nolink) -- [`basic_streambuf::pubseekoff`](../../streambuf/basic_streambuf/pubseekoff.md.nolink) +- [`basic_streambuf::pubseekpos`](../../streambuf/basic_streambuf/pubseekpos.md) +- [`basic_streambuf::pubseekoff`](../../streambuf/basic_streambuf/pubseekoff.md) diff --git a/reference/ostream/basic_ostream/sentry/op_destructor.md b/reference/ostream/basic_ostream/sentry/op_destructor.md index 78d4c635cc..274a7fd0d4 100644 --- a/reference/ostream/basic_ostream/sentry/op_destructor.md +++ b/reference/ostream/basic_ostream/sentry/op_destructor.md @@ -12,8 +12,8 @@ 出力処理の後処理を行う。 ## 効果 -`(os.`[`flags`](../../../ios/ios_base/flags.md)`() & unitbuf) && !`[`uncaught_exception`](../../../exception/uncaught_exception.md)`() && os.`[`good`](../../../ios/basic_ios/good.md)`()` が `true` なら、`os.`[`rdbuf`](../../../ios/basic_ios/rdbuf.md)`()->`[`pubsync`](../../../streambuf/basic_streambuf/pubsync.md.nolink)`()` を呼び出す。 -`os.`[`rdbuf`](../../../ios/basic_ios/rdbuf.md)`()->`[`pubsync`](../../../streambuf/basic_streambuf/pubsync.md.nolink)`()` が `-1` を返したら、`badbit` を設定する。ただし、これにより例外を投げることはない。 +`(os.`[`flags`](../../../ios/ios_base/flags.md)`() & unitbuf) && !`[`uncaught_exception`](../../../exception/uncaught_exception.md)`() && os.`[`good`](../../../ios/basic_ios/good.md)`()` が `true` なら、`os.`[`rdbuf`](../../../ios/basic_ios/rdbuf.md)`()->`[`pubsync`](../../../streambuf/basic_streambuf/pubsync.md)`()` を呼び出す。 +`os.`[`rdbuf`](../../../ios/basic_ios/rdbuf.md)`()->`[`pubsync`](../../../streambuf/basic_streambuf/pubsync.md)`()` が `-1` を返したら、`badbit` を設定する。ただし、これにより例外を投げることはない。 ## 参照 - [`(constructor)`](op_constructor.md) diff --git a/reference/ostream/basic_ostream/tellp.md b/reference/ostream/basic_ostream/tellp.md index bd012c8f22..31e17210aa 100644 --- a/reference/ostream/basic_ostream/tellp.md +++ b/reference/ostream/basic_ostream/tellp.md @@ -13,7 +13,7 @@ pos_type tellp(); ## 戻り値 -- [`fail`](../../ios/basic_ios/fail.md)`() == false` であれば、[`rdbuf`](../../ios/basic_ios/rdbuf.md)`()->`[`pubseekoff`](../../streambuf/basic_streambuf/pubseekoff.md.nolink)`(0, cur, out)`。 +- [`fail`](../../ios/basic_ios/fail.md)`() == false` であれば、[`rdbuf`](../../ios/basic_ios/rdbuf.md)`()->`[`pubseekoff`](../../streambuf/basic_streambuf/pubseekoff.md)`(0, cur, out)`。 - [`fail`](../../ios/basic_ios/fail.md)`() == true` であれば、`pos_type(-1)`。 ## 備考 @@ -61,7 +61,7 @@ pos_type tellp(pos_type pos) { * sentry[link sentry.md] * fail[link ../../ios/basic_ios/fail.md] * rdbuf[link ../../ios/basic_ios/rdbuf.md] -* pubseekoff[link ../../streambuf/basic_streambuf/pubseekoff.md.nolink] +* pubseekoff[link ../../streambuf/basic_streambuf/pubseekoff.md] ## バージョン ### 言語 @@ -70,4 +70,4 @@ pos_type tellp(pos_type pos) { ## 参照 - [`basic_ostream::seekp`](seekp.md) -- [`basic_streambuf::pubseekoff`](../../streambuf/basic_streambuf/pubseekoff.md.nolink) +- [`basic_streambuf::pubseekoff`](../../streambuf/basic_streambuf/pubseekoff.md) From b073a039ed7cb0e65f8bff62b74fe02e65921c33 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 2 Feb 2024 04:13:40 +0900 Subject: [PATCH 0693/3948] =?UTF-8?q?C++23=20:=20=E3=80=8C=E7=95=B0?= =?UTF-8?q?=E3=81=AA=E3=82=8B=E6=96=87=E5=AD=97=E3=82=A8=E3=83=B3=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=87=E3=82=A3=E3=83=B3=E3=82=B0=E3=82=92=E3=82=82?= =?UTF-8?q?=E3=81=A4=E6=96=87=E5=AD=97=E5=88=97=E3=83=AA=E3=83=86=E3=83=A9?= =?UTF-8?q?=E3=83=AB=E3=81=AE=E9=80=A3=E7=B5=90=E3=82=92=E4=B8=8D=E9=81=A9?= =?UTF-8?q?=E6=A0=BC=E3=81=A8=E3=81=99=E3=82=8B=E3=80=8D=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=20(close=20#1030)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp23.md | 2 +- .../mixed_string_literal_concatenation.md | 34 +++++++++++++++++++ 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 lang/cpp23/mixed_string_literal_concatenation.md diff --git a/implementation-status.md b/implementation-status.md index f260f364d4..8dc7556021 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -259,7 +259,7 @@ | P1847R4: [アクセス制御の異なるメンバ変数のレイアウトを宣言順に規定](/lang/cpp23/make_declaration_order_layout_mandated.md.nolink) | アクセス制御の異なるメンバ変数のレイアウトが実装によって異なっていたため仕様を規定 | Yes | Yes | - | 2022 | | P2128R6: [添字演算子の多次元サポート](/lang/cpp23/multidimensional_subscript_operator.nd.nolink) | `operator[](int x, int y, int z)`のように添字演算子のオーバーロードで複数のパラメータをとることを許可 | 12 | 15 | 2022.2 | - | | P1169R4: [`this`ポインタをもつ必要のない演算子を`static`として宣言できるようにする](/lang/cpp23/static_operator.md) | 状態をもたないいくつかの演算子を`static`として宣言できるようにする | 13 | 16 | 2023.2 | - | -| P2201R1: [異なる文字エンコーディングをもつ文字列リテラルの連結を不適格とする](/lang/cpp23/mixed_string_literal_concatenation.md.nolink) | `auto a = u8"" L"";`のような異なる文字エンコーディング同士での文字列リテラルを連結を禁止する | Yes | Yes | 2022.2 | Yes | +| P2201R1: [異なる文字エンコーディングをもつ文字列リテラルの連結を不適格とする](/lang/cpp23/mixed_string_literal_concatenation.md) | `auto a = u8"" L"";`のような異なる文字エンコーディング同士での文字列リテラルを連結を禁止する | Yes | Yes | 2022.2 | Yes | | P2029R4: [文字・文字列リテラル中の数値・ユニバーサルキャラクタのエスケープに関する問題解決](/lang/cpp23/numeric_and_universal_character_escapes_in_character_and_string_literals.md.nolink) | | - | - | - | - | | P2362R3: [1ワイド文字に収まらないワイド文字リテラルを禁止する](/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md) | エンコード結果として`wchar_t`の大きさに収まらないワイド文字リテラルを禁止する | 13 | 14 | 2023.2 | - | | P2071R2: [名前付きユニバーサルキャラクタ名](/lang/cpp23/named_universal_character_escapes.md) | 16進数のユニバーサルキャラクタだけでなく、その文字の名前を入力できるようにする | 13 | 15 | 2023.2 | - | diff --git a/lang/cpp23.md b/lang/cpp23.md index 7292c81ce8..1efbf9c004 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -48,7 +48,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| -| [異なる文字エンコーディングをもつ文字列リテラルの連結を不適格とする](cpp23/mixed_string_literal_concatenation.md.nolink) | `auto a = u8"" L"";`のような異なる文字エンコーディング同士での文字列リテラルを連結を禁止する | +| [異なる文字エンコーディングをもつ文字列リテラルの連結を不適格とする](cpp23/mixed_string_literal_concatenation.md) | `auto a = u8"" L"";`のような異なる文字エンコーディング同士での文字列リテラルを連結を禁止する | | [エスケープシーケンスの区切り](cpp23/delimited_escape_sequences.md) | エスケープシーケンスの範囲を明確にする構文を追加する | | [文字・文字列リテラル中の数値・ユニバーサルキャラクタのエスケープに関する問題解決](cpp23/numeric_and_universal_character_escapes_in_character_and_string_literals.md.nolink) | | | [1ワイド文字に収まらないワイド文字リテラルを禁止する](cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md) | エンコード結果として`wchar_t`の大きさに収まらないワイド文字リテラルを禁止する | diff --git a/lang/cpp23/mixed_string_literal_concatenation.md b/lang/cpp23/mixed_string_literal_concatenation.md new file mode 100644 index 0000000000..33b448c49a --- /dev/null +++ b/lang/cpp23/mixed_string_literal_concatenation.md @@ -0,0 +1,34 @@ +# 異なる文字エンコーディングをもつ文字列リテラルの連結を不適格とする +* cpp23[meta cpp] + +## 概要 +C++20までは、実装定義の動作として`L""`、`u8""`、`u""`、`U""`のようなエンコーディングが混在する文字列リテラルの連結を条件付きで許可していたが、これを禁止とする。 + +```cpp +// C++20 : 実装定義として条件付きでOK +// (ただし主要コンパイラはサポートしていない) +// C++23 : NG +void f() { + { auto a = L"" u""; } + { auto a = L"" u8""; } + { auto a = L"" U""; } + + { auto a = u8"" L""; } + { auto a = u8"" u""; } + { auto a = u8"" U""; } + + { auto a = u"" L""; } + { auto a = u"" u8""; } + { auto a = u"" U""; } + + { auto a = U"" L""; } + { auto a = U"" u""; } + { auto a = U"" u8""; } +} +``` + +異なるエンコーディングを混在させた文字列リテラルの連結は、ICC、GCC、Clang、MSVCのいずれもしておらず、それが有用なケースは知られていなかったため禁止する。 + + +## 参照 +- [P2201R1: Mixed string literal concatenation](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2201r1.html) From 8f7faa7b911b73e7d839ab53cb46ebfd0a7fda9f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 2 Feb 2024 04:39:49 +0900 Subject: [PATCH 0694/3948] =?UTF-8?q?C++23=20:=20=E3=80=8C=E9=9D=99?= =?UTF-8?q?=E7=9A=84=E3=81=AA=E8=A8=BA=E6=96=AD=E3=83=A1=E3=83=83=E3=82=BB?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=81=AE=E6=96=87=E5=AD=97=E3=82=A8=E3=83=B3?= =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=87=E3=82=A3=E3=83=B3=E3=82=B0=E3=80=8D?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20(close=20#1039)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp23.md | 2 +- .../character_encoding_of_diagnostic_text.md | 18 ++++++++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 lang/cpp23/character_encoding_of_diagnostic_text.md diff --git a/implementation-status.md b/implementation-status.md index 8dc7556021..e790a5a82c 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -268,7 +268,7 @@ | P1938R3: [`if consteval`](/lang/cpp23/if_consteval.md.nolink) | コンパイル時の文脈かどうかで分岐させる | 12 | 14 | - | - | | P1401R5: [定数式の文脈での`bool`への縮小変換を許可](/lang/cpp23/narrowing_contextual_conversions_to_bool.md.nolink) | `if constexpr(flags & Flags::Exec)`や`static_assert(N);`を許可 | 9 | 13 | 2022.2 | - | | P2242R3: [定数式内での非リテラル変数、静的変数・スレッドローカル変数およびgotoとラベルの存在を許可する](/lang/cpp23/non_literal_variables_in_constexpr_functions.md) | コンパイル時に評価されない限り、定数式内に静的変数・スレッドローカル変数およびgoto文とラベルを含むことを許可する | 12 | 15 | 2022.2 | - | -| P2246R1: [静的な診断メッセージの文字エンコーディング](/lang/cpp23/character_encoding_of_diagnostic_text.md.nolink) | `static_assert`や`[[deprecated]]`などの診断メッセージの文字集合に関する要件をなくす | - | yes | - | 2022 | +| P2246R1: [静的な診断メッセージの文字エンコーディング](/lang/cpp23/character_encoding_of_diagnostic_text.md) | `static_assert`や`[[deprecated]]`などの診断メッセージの文字集合に関する要件をなくす | - | yes | - | 2022 | | P2448R2: [`constexpr`関数が定数実行できない場合でも適格とする](/lang/cpp23/relaxing_some_constexpr_restrictions.md) | | 13 | 17 (partial) | 2024.0 (partial) | - | | P2647R1: [`constexpr`関数内での`static constexpr`変数を許可](/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md.nolink) | 13 | - | 16 | 2023.2 | - | | P2564R3: [`constexpr`関数内で`consteval`関数を呼び出せない問題を緩和](/lang/cpp23/consteval_needs_to_propagate_up.md.nolink) | | - | 17 | - | 2024.0 | diff --git a/lang/cpp23.md b/lang/cpp23.md index 1efbf9c004..3eb8e84aad 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -70,7 +70,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 | [`if consteval`](cpp23/if_consteval.md.nolink) | コンパイル時の文脈かどうかで分岐させる | | [定数式の文脈での`bool`への縮小変換を許可](cpp23/narrowing_contextual_conversions_to_bool.md.nolink) | `if constexpr(flags & Flags::Exec)`や`static_assert(N);`を許可 | | [定数式内での非リテラル変数、静的変数・スレッドローカル変数およびgotoとラベルの存在を許可する](cpp23/non_literal_variables_in_constexpr_functions.md) | コンパイル時に評価されない限り、定数式内に静的変数・スレッドローカル変数およびgoto文とラベルを含むことを許可する | -| [静的な診断メッセージの文字エンコーディング](cpp23/character_encoding_of_diagnostic_text.md.nolink) | `static_assert`や`[[deprecated]]`などの診断メッセージの文字集合に関する要件をなくす | +| [静的な診断メッセージの文字エンコーディング](cpp23/character_encoding_of_diagnostic_text.md) | `static_assert`や`[[deprecated]]`などの診断メッセージの文字集合に関する要件をなくす | | [`constexpr`関数が定数実行できない場合でも適格とする](cpp23/relaxing_some_constexpr_restrictions.md) | 定数式実行できない関数であっても、実際にコンパイル時に評価されない限り`constexpr`指定することを許可する | | [`constexpr`関数内での`static constexpr`変数を許可](cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md.nolink) | | | [`constexpr`関数内で`consteval`関数を呼び出せない問題を緩和](cpp23/consteval_needs_to_propagate_up.md.nolink) | | diff --git a/lang/cpp23/character_encoding_of_diagnostic_text.md b/lang/cpp23/character_encoding_of_diagnostic_text.md new file mode 100644 index 0000000000..c47a366e73 --- /dev/null +++ b/lang/cpp23/character_encoding_of_diagnostic_text.md @@ -0,0 +1,18 @@ +# 静的な診断メッセージの文字エンコーディング +* cpp23[meta cpp] + +## 概要 +C++23では、コンパイル時に診断メッセージを出力させる以下の機能について、ソースコードのエンコーディングが実行環境のエンコーディングで表現できない場合にどうするかの規定を見直す: + +- `static_assert` +- `[[deprecated]]` +- `[[nodiscard]]` +- `#error` + +C++20までは、「基本ソース文字集合に含まれない文字は出力する必要はない」という規定になっていたが、基本ソース文字集合と実行環境のエンコーディングは関係ないものであるため、この規定を削除することとした。 + +この規定はC20でも導入され、C++もそれに追従することとした。 + +## 参照 +- [P2246R1 Character encoding of diagnostic text](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2246r1.pdf) +- [WG14 N2563 Character encoding of diagnostic text](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2563.pdf) From f6061371256975ee7863aecca8396e4be9cf0ff6 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 2 Feb 2024 04:46:23 +0900 Subject: [PATCH 0695/3948] =?UTF-8?q?=E3=83=A9=E3=82=A4=E3=83=96=E3=83=A9?= =?UTF-8?q?=E3=83=AA=E3=81=AE=E3=81=B2=E3=81=AA=E5=BD=A2=E3=81=AB=E3=80=81?= =?UTF-8?q?=E3=80=8C=E3=81=93=E3=81=AE=E6=A9=9F=E8=83=BD=E3=81=8C=E5=BF=85?= =?UTF-8?q?=E8=A6=81=E3=81=AB=E3=81=AA=E3=81=A3=E3=81=9F=E8=83=8C=E6=99=AF?= =?UTF-8?q?=E3=83=BB=E7=B5=8C=E7=B7=AF=E3=80=8D=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20(#1244)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start_editing/class_template_page.md | 4 ++++ start_editing/cpo_template_page.md | 4 ++++ start_editing/function_template_page.md | 4 ++++ start_editing/type-type_template_page.md | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/start_editing/class_template_page.md b/start_editing/class_template_page.md index 525e7d8eb8..e7441bb072 100644 --- a/start_editing/class_template_page.md +++ b/start_editing/class_template_page.md @@ -57,6 +57,10 @@ namespace std { (ここには、満たさなければプログラムが不適格となる要件を記載します。`static_assert`に相当します。規格ではMandatesの項目です。) +## この機能が必要になった背景・経緯 +(ここには、その機能が必要になった背景や経緯を記述します。その機能で解決したい問題は何だったのかは、ユーザーがその言語機能を実際に使う上で重要な情報となります。余裕があったら書いてください) + + ## メンバ関数 ### 構築・破棄 diff --git a/start_editing/cpo_template_page.md b/start_editing/cpo_template_page.md index f15e13d1da..7af00f7b5c 100644 --- a/start_editing/cpo_template_page.md +++ b/start_editing/cpo_template_page.md @@ -65,6 +65,10 @@ namespace std { (ここには、カスタマイゼーションポイントオブジェクトを説明するにあたっての、補足事項を記述します。とくになければ、項目を削除してください。) +## この機能が必要になった背景・経緯 +(ここには、その機能が必要になった背景や経緯を記述します。その機能で解決したい問題は何だったのかは、ユーザーがその言語機能を実際に使う上で重要な情報となります。余裕があったら書いてください) + + ## 例 ```cpp example // (ここには、カスタマイゼーションポイントオブジェクトを解説するための、サンプルコードを記述します。) diff --git a/start_editing/function_template_page.md b/start_editing/function_template_page.md index a8d92a04f7..df78be2b4f 100644 --- a/start_editing/function_template_page.md +++ b/start_editing/function_template_page.md @@ -107,6 +107,10 @@ void definition(); // 関数・変数・定数の宣言を記述します。 (ここには、関数・変数・定数を説明するにあたっての、補足事項を記述します。とくになければ、項目を削除してください。) +## この機能が必要になった背景・経緯 +(ここには、その機能が必要になった背景や経緯を記述します。その機能で解決したい問題は何だったのかは、ユーザーがその言語機能を実際に使う上で重要な情報となります。余裕があったら書いてください) + + ## 非推奨・削除の詳細 (非推奨・削除となった背景を記載します。) diff --git a/start_editing/type-type_template_page.md b/start_editing/type-type_template_page.md index f5bc4ae540..6a2894e2d3 100644 --- a/start_editing/type-type_template_page.md +++ b/start_editing/type-type_template_page.md @@ -56,6 +56,10 @@ typedef origin_type new_type; (用途、注意事項、バージョンによる変更の経緯などを書いてください。省略可能です) +## この機能が必要になった背景・経緯 +(ここには、その機能が必要になった背景や経緯を記述します。その機能で解決したい問題は何だったのかは、ユーザーがその言語機能を実際に使う上で重要な情報となります。余裕があったら書いてください) + + ## 例 ```cpp example From 8d5b3bfda771b4e52cedfe03a9645f1f2e100cea Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 2 Feb 2024 04:50:59 +0900 Subject: [PATCH 0696/3948] =?UTF-8?q?=E8=84=B1=E5=AD=97=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23/mixed_string_literal_concatenation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp23/mixed_string_literal_concatenation.md b/lang/cpp23/mixed_string_literal_concatenation.md index 33b448c49a..538bbc8fb0 100644 --- a/lang/cpp23/mixed_string_literal_concatenation.md +++ b/lang/cpp23/mixed_string_literal_concatenation.md @@ -27,7 +27,7 @@ void f() { } ``` -異なるエンコーディングを混在させた文字列リテラルの連結は、ICC、GCC、Clang、MSVCのいずれもしておらず、それが有用なケースは知られていなかったため禁止する。 +異なるエンコーディングを混在させた文字列リテラルの連結は、ICC、GCC、Clang、MSVCのいずれもサポートしておらず、それが有用なケースは知られていなかったため禁止する。 ## 参照 From 197de3313aaef82533c7a77b7a6cccc219aa0d88 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 2 Feb 2024 13:02:59 +0900 Subject: [PATCH 0697/3948] =?UTF-8?q?C++23=20:=20=E3=80=8C=E3=82=A2?= =?UTF-8?q?=E3=82=AF=E3=82=BB=E3=82=B9=E5=88=B6=E5=BE=A1=E3=81=AE=E7=95=B0?= =?UTF-8?q?=E3=81=AA=E3=82=8B=E3=83=A1=E3=83=B3=E3=83=90=E5=A4=89=E6=95=B0?= =?UTF-8?q?=E3=81=AE=E3=83=AC=E3=82=A4=E3=82=A2=E3=82=A6=E3=83=88=E3=82=92?= =?UTF-8?q?=E5=AE=A3=E8=A8=80=E9=A0=86=E3=81=AB=E8=A6=8F=E5=AE=9A=E3=80=8D?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20(close=20#1027)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp23.md | 2 +- .../make_declaration_order_layout_mandated.md | 23 +++++++++++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 lang/cpp23/make_declaration_order_layout_mandated.md diff --git a/implementation-status.md b/implementation-status.md index e790a5a82c..4a6c30468a 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -256,7 +256,7 @@ | P2718R0: [範囲for文が範囲初期化子内で生じた一時オブジェクトを延命することを規定](lang/cpp23/lifetime_extension_in_range_based_for_loop.md) | | - | - | - | - | | P2324R2: [複合文の末尾へのラベルを許可](/lang/cpp23/labels_at_the_end_of_compound_statements.md) | C互換のため、複合文の末尾でのgoto文のラベルを許可する | 13 | 16 | 2023.2 | - | | P0847R7: [自身のオブジェクトを明示的にパラメータとして指定する](/lang/cpp23/deducing_this.md.nolink) | メンバ関数が`*this`の型・オブジェクトをパラメータとしてとり、`*this`オブジェクトがconst/非const、左辺値/右辺値であるかをメンバ関数内で識別できるようにする | - | 18 | - | 2022 Update 2 (partial) | -| P1847R4: [アクセス制御の異なるメンバ変数のレイアウトを宣言順に規定](/lang/cpp23/make_declaration_order_layout_mandated.md.nolink) | アクセス制御の異なるメンバ変数のレイアウトが実装によって異なっていたため仕様を規定 | Yes | Yes | - | 2022 | +| P1847R4: [アクセス制御の異なるメンバ変数のレイアウトを宣言順に規定](/lang/cpp23/make_declaration_order_layout_mandated.md) | アクセス制御の異なるメンバ変数のレイアウトは並び替えを許可されていたが宣言順に規定する | Yes | Yes | - | 2022 | | P2128R6: [添字演算子の多次元サポート](/lang/cpp23/multidimensional_subscript_operator.nd.nolink) | `operator[](int x, int y, int z)`のように添字演算子のオーバーロードで複数のパラメータをとることを許可 | 12 | 15 | 2022.2 | - | | P1169R4: [`this`ポインタをもつ必要のない演算子を`static`として宣言できるようにする](/lang/cpp23/static_operator.md) | 状態をもたないいくつかの演算子を`static`として宣言できるようにする | 13 | 16 | 2023.2 | - | | P2201R1: [異なる文字エンコーディングをもつ文字列リテラルの連結を不適格とする](/lang/cpp23/mixed_string_literal_concatenation.md) | `auto a = u8"" L"";`のような異なる文字エンコーディング同士での文字列リテラルを連結を禁止する | Yes | Yes | 2022.2 | Yes | diff --git a/lang/cpp23.md b/lang/cpp23.md index 3eb8e84aad..46e47eae4f 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -39,7 +39,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| | [自身のオブジェクトを明示的にパラメータとして指定する](cpp23/deducing_this.md.nolink) | メンバ関数が`*this`の型・オブジェクトをパラメータとしてとり、`*this`オブジェクトがconst/非const、左辺値/右辺値であるかをメンバ関数内で識別できるようにする | -| [アクセス制御の異なるメンバ変数のレイアウトを宣言順に規定](cpp23/make_declaration_order_layout_mandated.md.nolink) | アクセス制御の異なるメンバ変数のレイアウトが実装によって異なっていたため仕様を規定 | +| [アクセス制御の異なるメンバ変数のレイアウトを宣言順に規定](cpp23/make_declaration_order_layout_mandated.md) | アクセス制御の異なるメンバ変数のレイアウトは並び替えを許可されていたが宣言順に規定する | | [添字演算子の多次元サポート](cpp23/multidimensional_subscript_operator.nd.nolink) | `operator[](int x, int y, int z)`のように添字演算子のオーバーロードで複数のパラメータをとることを許可 | | [`this`ポインタをもつ必要のない演算子を`static`として宣言できるようにする](cpp23/static_operator.md) | 状態をもたないいくつかの演算子を`static`として宣言できるようにする | diff --git a/lang/cpp23/make_declaration_order_layout_mandated.md b/lang/cpp23/make_declaration_order_layout_mandated.md new file mode 100644 index 0000000000..3737326121 --- /dev/null +++ b/lang/cpp23/make_declaration_order_layout_mandated.md @@ -0,0 +1,23 @@ +# アクセス制御の異なるメンバ変数のレイアウトを宣言順に規定 +* cpp23[meta cpp] + +## 概要 +以下のようなアクセス制御の異なるメンバ変数のメモリレイアウトは、実装に対して自由に並び替えてよい、という規定になっていたが、これを宣言順に規定する。 + +```cpp +struct cell { + int a; +private: + double b; +public: + std::string c; +}; +``` + +実際に、自由に並び替えていた実装は存在しなかった。並び替えを許可する規定は、C++11でPOD (Plain Old Data) の見直しでスタンダードレイアウト型が導入される際に偶発的に入ったものであり、メモリレイアウトを不安定にする意図はなかった。 + +実装の慣行に従うためにも、アクセス制御が異なるメンバ変数であってもメモリレイアウトは宣言順であるという規定にする。 + + +## 参照 +- [P1847R4 Make declaration order layout mandated](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1847r4.pdf) From 6dbd0b7f856cf31a50fa592dfa24c7968b65a9ce Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 2 Feb 2024 13:26:07 +0900 Subject: [PATCH 0698/3948] =?UTF-8?q?C++23=20:=20=E3=80=8C=E6=96=87?= =?UTF-8?q?=E5=AD=97=E3=83=AA=E3=83=86=E3=83=A9=E3=83=AB=E3=82=A8=E3=83=B3?= =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=87=E3=82=A3=E3=83=B3=E3=82=B0=E3=82=92?= =?UTF-8?q?=E4=B8=80=E8=B2=AB=E3=81=95=E3=81=9B=E3=82=8B=E3=80=8D=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20(close=20#1044)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp23.md | 2 +- .../consistent_character_literal_encoding.md | 24 +++++++++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 lang/cpp23/consistent_character_literal_encoding.md diff --git a/implementation-status.md b/implementation-status.md index 4a6c30468a..b4d0ba3534 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -275,7 +275,7 @@ | P1102R2: [ラムダ式で`()`を省略できる条件を緩和](/lang/cpp23/down_with_lambda_parens.md) | 修飾や戻り値型をともなってもパラメータリストが空であれば`()`を省略できる | 11 | 13 | 2022.2 | - | | P2173R1: [ラムダ式に対する属性](/lang/cpp23/attributes_on_lambda_expressions.md) | ラムダ式のいくつかの箇所に属性を記述できるようにする | 9 | 13 | 2022.2 | - | | P1774R8: [コード内容の仮定をコンパイラに伝えるassume属性](/lang/cpp23/portable_assumptions.md) | 最適化のために、コードの仮定をコンパイラに伝える属性を標準化する | 13 | - | - | - | -| P2316R2: [文字リテラルエンコーディングを一貫させる](/lang/cpp23/consistent_character_literal_encoding.md.nolink) | プリプロセッサの条件式での文字リテラルの扱いをC++式と同様にする | yes | yes | 2022.2 | 2022 | +| P2316R2: [文字リテラルエンコーディングを一貫させる](/lang/cpp23/consistent_character_literal_encoding.md) | プリプロセッサの条件式での文字リテラルの扱いをC++式と同様にする | yes | yes | 2022.2 | 2022 | | P2334R1: [`elif`/`elifdef`/`elifndef`のサポートを追加](/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md.nolink) | `#if`/`#ifdef`/`#ifndef`に対応する複数条件命令のサポートを追加する | 12 | 13 | 2022.2 | - | | P2437R1: [`#warning`のサポートを追加](/lang/cpp23/warning.md) | 多くのC++コンパイラが実装していたプリプロセス時の警告`#warning message`を正式サポート | yes | yes | 2023.2 | yes | | P2295R6: [汎用的なソースコードのエンコーディングとしてUTF-8をサポート](/lang/cpp23/support_for_utf8_as_a_portable_source_file_encoding.md.nolink) | | 13 | 15 | 2023.2 | 2019 Update 2 | diff --git a/lang/cpp23.md b/lang/cpp23.md index 46e47eae4f..88f0bcc54a 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -95,7 +95,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| -| [文字リテラルエンコーディングを一貫させる](cpp23/consistent_character_literal_encoding.md.nolink) | プリプロセッサの条件式での文字リテラルの扱いをC++式と同様にする | +| [文字リテラルエンコーディングを一貫させる](cpp23/consistent_character_literal_encoding.md) | プリプロセッサの条件式での文字リテラルの扱いをC++式と同様にする | | [`elif`/`elifdef`/`elifndef`のサポートを追加](cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md.nolink) | `#if`/`#ifdef`/`#ifndef`に対応する複数条件命令のサポートを追加する | | [`#warning`のサポートを追加](cpp23/warning.md) | 多くのC++コンパイラが実装していたプリプロセス時の警告`#warning message`を正式サポート | | [汎用的なソースコードのエンコーディングとしてUTF-8をサポート](cpp23/support_for_utf8_as_a_portable_source_file_encoding.md.nolink) | | diff --git a/lang/cpp23/consistent_character_literal_encoding.md b/lang/cpp23/consistent_character_literal_encoding.md new file mode 100644 index 0000000000..d21dc25147 --- /dev/null +++ b/lang/cpp23/consistent_character_literal_encoding.md @@ -0,0 +1,24 @@ +# 文字リテラルエンコーディングを一貫させる +* cpp23[meta cpp] + +## 概要 +C++20までは、以下のような、プリプロセッサ上での文字リテラルの比較と、if文での文字リテラルの比較が同じであるという保証がなかった。 + +```cpp +#if 'A' == '\x41' +//... +#endif +if ('A' == 0x41){} +``` + +プリプロセッサとそれ以外の文字列リテラルの解釈が一致するかどうかは実装定義となっていたが、これをプリプロセッサの文字列リテラルの解釈がプリプロセッサ外と一致するよう規定する。 + + +## この機能が必要になった背景・経緯 +1500以上のオープンソースプロジェクトを調査したところ、このような`#if`マクロは、文字列リテラルのナロー文字エンコーディングを検出するために使われていた。 + +主要なコンパイラはすべて期待通りに動作していたが、プリプロセッサではナロー文字エンコーディングの保証がなかったため、通常の文字リテラルと同じ規定とすることでこの動作を保証することとした。 + + +## 参照 +- [P2316R2 Consistent character literal encoding](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2316r2.pdf) From c5762648e52c06cdc1d2385ff4376ab54025f594 Mon Sep 17 00:00:00 2001 From: suomesta Date: Fri, 2 Feb 2024 21:33:01 +0900 Subject: [PATCH 0699/3948] improve some decoration in streambuf --- reference/streambuf/basic_streambuf/in_avail.md | 2 +- reference/streambuf/basic_streambuf/op_assign.md | 14 +++++++------- .../streambuf/basic_streambuf/op_constructor.md | 3 ++- reference/streambuf/basic_streambuf/pbump.md | 2 +- reference/streambuf/basic_streambuf/pubseekoff.md | 2 +- reference/streambuf/basic_streambuf/pubseekpos.md | 2 +- reference/streambuf/basic_streambuf/pubsetbuf.md | 4 ++-- reference/streambuf/basic_streambuf/seekoff.md | 2 +- reference/streambuf/basic_streambuf/seekpos.md | 2 +- reference/streambuf/basic_streambuf/setbuf.md | 2 +- reference/streambuf/basic_streambuf/setg.md | 2 +- reference/streambuf/basic_streambuf/setp.md | 2 +- reference/streambuf/basic_streambuf/sgetn.md | 2 +- reference/streambuf/basic_streambuf/showmanyc.md | 2 +- reference/streambuf/basic_streambuf/sputbackc.md | 8 ++++---- reference/streambuf/basic_streambuf/sputc.md | 4 ++-- reference/streambuf/basic_streambuf/sputn.md | 4 ++-- reference/streambuf/basic_streambuf/sungetc.md | 6 +++--- reference/streambuf/basic_streambuf/uflow.md | 4 ++-- reference/streambuf/basic_streambuf/underflow.md | 2 +- reference/streambuf/basic_streambuf/xsgetn.md | 2 +- 21 files changed, 37 insertions(+), 36 deletions(-) diff --git a/reference/streambuf/basic_streambuf/in_avail.md b/reference/streambuf/basic_streambuf/in_avail.md index c0345ab384..d90e08113b 100644 --- a/reference/streambuf/basic_streambuf/in_avail.md +++ b/reference/streambuf/basic_streambuf/in_avail.md @@ -21,7 +21,7 @@ namespace std { 現在の入力列の読み取り可能な文字数を返す。 ## 戻り値 -- 読み取り可能な文字列が存在する場合、[`egptr()`](egptr.md) - [`gptr()`](gptr.md)を返す。 +- 読み取り可能な文字列が存在する場合、[`egptr()`](egptr.md)` - `[`gptr()`](gptr.md)を返す。 - それ以外の場合、[`showmanyc()`](showmanyc.md)を返す。 ## 例 diff --git a/reference/streambuf/basic_streambuf/op_assign.md b/reference/streambuf/basic_streambuf/op_assign.md index 5fa97a8e3b..4660c19aeb 100644 --- a/reference/streambuf/basic_streambuf/op_assign.md +++ b/reference/streambuf/basic_streambuf/op_assign.md @@ -21,13 +21,13 @@ namespace std { 入力部分列ポインタ、出力部分列ポインタ、ロケールをコピーする。 ## 事後条件 -- [`eback()`](eback.md) == rhs.[`eback()`](eback.md) -- [`gptr()`](gptr.md) == rhs.[`gptr()`](gptr.md) -- [`egptr()`](egptr.md) == rhs.[`egptr()`](egptr.md) -- [`pbase()`](pbase.md) == rhs.[`pbase()`](pbase.md) -- [`pptr()`](pptr.md) == rhs.[`pptr()`](pptr.md) -- [`epptr()`](epptr.md) == rhs.[`epptr()`](epptr.md) -- [`getloc()`](getloc.md) == rhs.[`getloc()`](getloc.md) +- [`eback()`](eback.md) == `rhs.`[`eback()`](eback.md) +- [`gptr()`](gptr.md) == `rhs.`[`gptr()`](gptr.md) +- [`egptr()`](egptr.md) == `rhs.`[`egptr()`](egptr.md) +- [`pbase()`](pbase.md) == `rhs.`[`pbase()`](pbase.md) +- [`pptr()`](pptr.md) == `rhs.`[`pptr()`](pptr.md) +- [`epptr()`](epptr.md) == `rhs.`[`epptr()`](epptr.md) +- [`getloc()`](getloc.md) == `rhs.`[`getloc()`](getloc.md) ## 戻り値 *this。 diff --git a/reference/streambuf/basic_streambuf/op_constructor.md b/reference/streambuf/basic_streambuf/op_constructor.md index 4231c15ac7..3aed4eb9a8 100644 --- a/reference/streambuf/basic_streambuf/op_constructor.md +++ b/reference/streambuf/basic_streambuf/op_constructor.md @@ -25,7 +25,7 @@ namespace std { - (1) : - 入力列・出力列の各ポインタをヌルにする。 - 現在のグローバルロケールを`locale`デフォルトコンストラクタで取得し、`getloc()`の初期値とする。 -- (2) : rhs の入力列・出力列の各ポインタをコピーする。 +- (2) : `rhs`の入力列・出力列の各ポインタをコピーする。 ## 事後条件 @@ -44,6 +44,7 @@ namespace std { - `pbase()` == `rhs.pbase()` - `pptr()` == `rhs.pptr()` - `epptr()` == `rhs.epptr()` + - `getloc()` == `rhs.getloc()` ## 実装例 diff --git a/reference/streambuf/basic_streambuf/pbump.md b/reference/streambuf/basic_streambuf/pbump.md index 0f430c262d..266756bc28 100644 --- a/reference/streambuf/basic_streambuf/pbump.md +++ b/reference/streambuf/basic_streambuf/pbump.md @@ -20,7 +20,7 @@ namespace std { 出力部分列の現在位置を指定した量だけ進める。 ## 効果 -出力部分列の現在位置をnだけ進める。 +出力部分列の現在位置を`n`だけ進める。 ## 例 ```cpp example diff --git a/reference/streambuf/basic_streambuf/pubseekoff.md b/reference/streambuf/basic_streambuf/pubseekoff.md index ea4a1fcf62..5e1fd25f3c 100644 --- a/reference/streambuf/basic_streambuf/pubseekoff.md +++ b/reference/streambuf/basic_streambuf/pubseekoff.md @@ -26,7 +26,7 @@ namespace std { protected virtualの[`seekoff()`](seekoff.md)を呼ぶ。 ## 戻り値 -[`seekoff`](seekoff.md)(off, way, which)。 +[`seekoff`](seekoff.md)`(off, way, which)`。 ## バージョン ### 言語 diff --git a/reference/streambuf/basic_streambuf/pubseekpos.md b/reference/streambuf/basic_streambuf/pubseekpos.md index c01e012b1c..24e2194ec1 100644 --- a/reference/streambuf/basic_streambuf/pubseekpos.md +++ b/reference/streambuf/basic_streambuf/pubseekpos.md @@ -25,7 +25,7 @@ namespace std { protected virtualの[`seekpos()`](seekpos.md)を呼ぶ。 ## 戻り値 -[`seekpos`](seekpos.md)(sp, which)。 +[`seekpos`](seekpos.md)`(sp, which)`。 ## バージョン ### 言語 diff --git a/reference/streambuf/basic_streambuf/pubsetbuf.md b/reference/streambuf/basic_streambuf/pubsetbuf.md index 76bb5fbde3..044242c48f 100644 --- a/reference/streambuf/basic_streambuf/pubsetbuf.md +++ b/reference/streambuf/basic_streambuf/pubsetbuf.md @@ -21,10 +21,10 @@ namespace std { バッファ領域を与える。 ## 効果 -protected virtualの[`setbuf()`setbuf.md)を呼ぶ。 +protected virtualの[`setbuf()`](setbuf.md)を呼ぶ。 ## 戻り値 -[`setbuf`](setbuf.md)(s, n)。 +[`setbuf`](setbuf.md)`(s, n)`。 ## バージョン ### 言語 diff --git a/reference/streambuf/basic_streambuf/seekoff.md b/reference/streambuf/basic_streambuf/seekoff.md index e002214eab..9dc924c53b 100644 --- a/reference/streambuf/basic_streambuf/seekoff.md +++ b/reference/streambuf/basic_streambuf/seekoff.md @@ -26,7 +26,7 @@ namespace std { デフォルトでは -1 を返すのみ。(オーバーライドした関数の具体的な動作はそのクラスに委ねられる。) ## 戻り値 -pos_type(off_type(-1))。 +`pos_type(off_type(-1))`。 ## バージョン ### 言語 diff --git a/reference/streambuf/basic_streambuf/seekpos.md b/reference/streambuf/basic_streambuf/seekpos.md index b1608cdf02..7780070d1b 100644 --- a/reference/streambuf/basic_streambuf/seekpos.md +++ b/reference/streambuf/basic_streambuf/seekpos.md @@ -25,7 +25,7 @@ namespace std { デフォルトでは -1 を返すのみ。(オーバーライドした関数の具体的な動作はそのクラスに委ねられる。) ## 戻り値 -pos_type(off_type(-1))。 +`pos_type(off_type(-1))`。 ## バージョン ### 言語 diff --git a/reference/streambuf/basic_streambuf/setbuf.md b/reference/streambuf/basic_streambuf/setbuf.md index eb4ce9f293..b1fe4aa9b7 100644 --- a/reference/streambuf/basic_streambuf/setbuf.md +++ b/reference/streambuf/basic_streambuf/setbuf.md @@ -24,7 +24,7 @@ namespace std { デフォルトでは何もしない。(オーバーライドした関数の具体的な動作はそのクラスに委ねられる。) ## 戻り値 -*this. +`*this`。 ## 例 ```cpp example diff --git a/reference/streambuf/basic_streambuf/setg.md b/reference/streambuf/basic_streambuf/setg.md index 8facfded94..81d1b8f4e9 100644 --- a/reference/streambuf/basic_streambuf/setg.md +++ b/reference/streambuf/basic_streambuf/setg.md @@ -20,7 +20,7 @@ namespace std { 入力部分列の各ポインタを設定する。 ## 事後条件 -gbeg == [`eback()`](eback.md) および gnext == [`gptr()`](gptr.md) および gend == [`egptr()`](egptr.md)。 +`gbeg == `[`eback()`](eback.md) および `gnext == `[`gptr()`](gptr.md) および `gend == `[`egptr()`](egptr.md)。 ## 例 ```cpp example diff --git a/reference/streambuf/basic_streambuf/setp.md b/reference/streambuf/basic_streambuf/setp.md index ac74fc1c5f..7823f4bd52 100644 --- a/reference/streambuf/basic_streambuf/setp.md +++ b/reference/streambuf/basic_streambuf/setp.md @@ -20,7 +20,7 @@ namespace std { 出力部分列の各ポインタを設定する。 ## 事後条件 -pbeg == [`pbase()`](pbase.md) および pbeg == [`pptr()`](pptr.md) および pend == [`epptr()`](epptr.md)。 +`pbeg == `[`pbase()`](pbase.md) および `pbeg == `[`pptr()`](pptr.md) および `pend == `[`epptr()`](epptr.md)。 ## 例 ```cpp example diff --git a/reference/streambuf/basic_streambuf/sgetn.md b/reference/streambuf/basic_streambuf/sgetn.md index 0a93160360..32f6bc9e83 100644 --- a/reference/streambuf/basic_streambuf/sgetn.md +++ b/reference/streambuf/basic_streambuf/sgetn.md @@ -21,7 +21,7 @@ namespace std { 入力列から複数文字を読み取る。 ## 戻り値 -xsgetn(s, n)。 +[`xsgetn`](xsgetn.md)`(s, n)`。 ## 例 ```cpp example diff --git a/reference/streambuf/basic_streambuf/showmanyc.md b/reference/streambuf/basic_streambuf/showmanyc.md index 79d2f3ea7b..212cbc7e9a 100644 --- a/reference/streambuf/basic_streambuf/showmanyc.md +++ b/reference/streambuf/basic_streambuf/showmanyc.md @@ -24,7 +24,7 @@ namespace std { デフォルトの動作は 0 を返すのみ。(入力部分列以外の領域がある場合、この関数をオーバーライドすることで、入力部分列以外の領域のサイズを返すようにする。) ## 戻り値 -0。 +`0`。 ## 例 ```cpp example diff --git a/reference/streambuf/basic_streambuf/sputbackc.md b/reference/streambuf/basic_streambuf/sputbackc.md index adc39cf634..feec4de98a 100644 --- a/reference/streambuf/basic_streambuf/sputbackc.md +++ b/reference/streambuf/basic_streambuf/sputbackc.md @@ -20,12 +20,12 @@ namespace std { 任意の1文字を入力列に戻す。 ## 効果 -- 入力文字列の現在位置を1つ戻すことができ、かつ、1つ戻った位置の値がcと等しければ、現在位置を1つ戻す。 -- それ以外の場合、[`pbackfail`](pbackfail.md)([`Traits::to_int_type`](../../string/char_traits/to_int_type.md)(c))を呼ぶ。 +- 入力文字列の現在位置を1つ戻すことができ、かつ、1つ戻った位置の値が`c`と等しければ、現在位置を1つ戻す。 +- それ以外の場合、[`pbackfail`](pbackfail.md)`(`[`Traits::to_int_type`](../../string/char_traits/to_int_type.md)`(c))`を呼ぶ。 ## 戻り値 -- 入力文字列の現在位置を1つ戻すことができ、かつ、1つ戻った位置の値がcと等しければ、[`Traits::to_int_type`](../../string/char_traits/to_int_type.md)(c)。 -- それ以外の場合、[`pbackfail`](pbackfail.md)([`Traits::to_int_type`](../../string/char_traits/to_int_type.md)(c))の戻り値を返す。 +- 入力文字列の現在位置を1つ戻すことができ、かつ、1つ戻った位置の値が`c`と等しければ、[`Traits::to_int_type`](../../string/char_traits/to_int_type.md)`(c)`。 +- それ以外の場合、[`pbackfail`](pbackfail.md)`(`[`Traits::to_int_type`](../../string/char_traits/to_int_type.md)`(c))`の戻り値を返す。 ## 例 ```cpp example diff --git a/reference/streambuf/basic_streambuf/sputc.md b/reference/streambuf/basic_streambuf/sputc.md index 5c35f02bbf..8f793cfcb9 100644 --- a/reference/streambuf/basic_streambuf/sputc.md +++ b/reference/streambuf/basic_streambuf/sputc.md @@ -20,11 +20,11 @@ namespace std { 出力列に1文字書き込む。 ## 効果 -- 出力列が存在する場合、現在位置にcを書き込み、現在位置を1つ進める。 +- 出力列が存在する場合、現在位置に`c`を書き込み、現在位置を1つ進める。 - それ以外の場合、[`overflow()`](overflow.md)を呼ぶ。 ## 戻り値 -- 出力列が存在する場合、[`Traits::to_int_type`](../../string/char_traits/to_int_type.md)(c)。 +- 出力列が存在する場合、[`Traits::to_int_type`](../../string/char_traits/to_int_type.md)`(c)`。 - それ以外の場合、[`overflow()`](overflow.md)の戻り値を返す。 ## 例 diff --git a/reference/streambuf/basic_streambuf/sputn.md b/reference/streambuf/basic_streambuf/sputn.md index bac6a1bfe0..ee0bf4770e 100644 --- a/reference/streambuf/basic_streambuf/sputn.md +++ b/reference/streambuf/basic_streambuf/sputn.md @@ -21,10 +21,10 @@ namespace std { 出力列に複数文字を書き込む。 ## 効果 -[`xsputn`](xsputn.md)(s, n)を呼ぶ。xsputn()はprotected virtualなので、継承されていれば、継承先のxsputn()が呼ばれる。 +[`xsputn`](xsputn.md)`(s, n)`を呼ぶ。[`xsputn()`](xsputn.md)はprotected virtualなので、継承されていれば、継承先の[`xsputn()`](xsputn.md)が呼ばれる。 ## 戻り値 -[`xsputn`](xsputn.md)(s, n)の戻り値。 +[`xsputn`](xsputn.md)`(s, n)`の戻り値。 ## 例 ```cpp example diff --git a/reference/streambuf/basic_streambuf/sungetc.md b/reference/streambuf/basic_streambuf/sungetc.md index 5439cf4588..024ab88c51 100644 --- a/reference/streambuf/basic_streambuf/sungetc.md +++ b/reference/streambuf/basic_streambuf/sungetc.md @@ -21,11 +21,11 @@ namespace std { ## 効果 - 入力文字列の現在位置を1つ戻すことができる場合、現在位置を1つ戻す。 -- それ以外の場合、[`pbackfail`](pbackfail.md)([`Traits::to_int_type`](../../string/char_traits/to_int_type.md)(c))を呼ぶ。 +- それ以外の場合、[`pbackfail`](pbackfail.md)`(`[`Traits::to_int_type`](../../string/char_traits/to_int_type.md)`(c))`を呼ぶ。 ## 戻り値 -- 読み取り可能な文字列が存在する場合、更新された現在位置のTraits::to_int_type(*gptr())。 -- それ以外の場合、[`pbackfail`](pbackfail.md)([`Traits::to_int_type`](../../string/char_traits/to_int_type.md)(c))の戻り値を返す。 +- 読み取り可能な文字列が存在する場合、更新された現在位置の[`Traits::to_int_type`](../../string/char_traits/to_int_type.md)`(*gptr())`。 +- それ以外の場合、[`pbackfail`](pbackfail.md)`(`[`Traits::to_int_type`](../../string/char_traits/to_int_type.md)`(c))`の戻り値を返す。 ## 例 ```cpp example diff --git a/reference/streambuf/basic_streambuf/uflow.md b/reference/streambuf/basic_streambuf/uflow.md index 29282d4e57..6be8e58317 100644 --- a/reference/streambuf/basic_streambuf/uflow.md +++ b/reference/streambuf/basic_streambuf/uflow.md @@ -23,12 +23,12 @@ namespace std { デフォルトの動作は[`overflow()`](overflow.md)を呼ぶ。 - [`overflow()`](overflow.md)の戻り値が[`Traits::eof()`](../../string/char_traits/eof.md)であれば、[`Traits::eof()`](../../string/char_traits/eof.md)を返すのみ。 -- [`overflow()`](overflow.md)の戻り値が[`Traits::eof()`](../../string/char_traits/eof.md)でなければ、[`Traits::to_int_type`](../../string/char_traits/to_int_type.md)(*[`gptr()`](gptr.md))を返しつつ、[`gptr()`](gptr.md)を一つ進める。 +- [`overflow()`](overflow.md)の戻り値が[`Traits::eof()`](../../string/char_traits/eof.md)でなければ、[`Traits::to_int_type`](../../string/char_traits/to_int_type.md)`(*`[`gptr()`](gptr.md)`)`を返しつつ、[`gptr()`](gptr.md)を一つ進める。 なお、[`overflow()`](overflow.md)はデフォルト動作では、常に[`Traits::eof()`](../../string/char_traits/eof.md)を返す。 ## 備考 -入力部分列の領域を消費し切った状態で[`sbumpc()`](sbumpc.md)を呼ぶと、uflow()が呼ばれる。 +入力部分列の領域を消費し切った状態で[`sbumpc()`](sbumpc.md)を呼ぶと、`uflow()`が呼ばれる。 ## 例 ```cpp example diff --git a/reference/streambuf/basic_streambuf/underflow.md b/reference/streambuf/basic_streambuf/underflow.md index 30318bca82..f80807486d 100644 --- a/reference/streambuf/basic_streambuf/underflow.md +++ b/reference/streambuf/basic_streambuf/underflow.md @@ -26,7 +26,7 @@ namespace std { [`Traits::eof()`](../../string/char_traits/eof.md)。 ## 備考 -入力部分列の領域を消費し切った状態で[`sgetc()`](sgetc.md)を呼ぶと、underflow()が呼ばれる。 +入力部分列の領域を消費し切った状態で[`sgetc()`](sgetc.md)を呼ぶと、`underflow()`が呼ばれる。 ## 例 ```cpp example diff --git a/reference/streambuf/basic_streambuf/xsgetn.md b/reference/streambuf/basic_streambuf/xsgetn.md index 1817b0b83a..12faef1b3c 100644 --- a/reference/streambuf/basic_streambuf/xsgetn.md +++ b/reference/streambuf/basic_streambuf/xsgetn.md @@ -21,7 +21,7 @@ namespace std { 入力列から複数文字を読み取る。 ## 効果 -入力列からn文字読み取り、sに格納する。入力列の読み取り可能領域が尽きれば、そこで読み取りを停止する。 +入力列から`n`文字読み取り、`s`に格納する。入力列の読み取り可能領域が尽きれば、そこで読み取りを停止する。 ## 戻り値 読み取った文字数。 From 3d75aee354975e9f519ef3082420de25976a935a Mon Sep 17 00:00:00 2001 From: suomesta Date: Sun, 4 Feb 2024 13:09:49 +0900 Subject: [PATCH 0700/3948] add link to streambuf. some improvements in string_view --- reference/fstream/basic_filebuf.md | 2 +- reference/istream/basic_istream/peek.md | 2 +- reference/istream/basic_istream/putback.md | 2 +- reference/istream/basic_istream/seekg.md | 8 ++++---- reference/istream/basic_istream/sync.md | 3 +-- reference/istream/basic_istream/tellg.md | 5 ++--- reference/istream/basic_istream/unget.md | 2 +- reference/string/basic_string.md | 2 +- reference/string_view/basic_string_view.md | 4 ++-- reference/string_view/basic_string_view/compare.md | 14 +++++++------- 10 files changed, 21 insertions(+), 23 deletions(-) diff --git a/reference/fstream/basic_filebuf.md b/reference/fstream/basic_filebuf.md index 798af5382d..6db55d159e 100644 --- a/reference/fstream/basic_filebuf.md +++ b/reference/fstream/basic_filebuf.md @@ -72,7 +72,7 @@ Cの`FILE*`に対する入出力関数を使って実装される。 | `sync` | 出力列の同期 (protected virtual) | | | `uflow` | (protected virtual) | | `underflow` | (protected virtual) | -| `showmasync` | ブロックせずに読み取れると期待される文字数を得る (protected virtual) | | +| `showmanyc` | ブロックせずに読み取れると期待される文字数を得る (protected virtual) | | | `pbackfail` | 1文字を入力列に戻す (protected virtual) | | | `overflow` | (protected virtual) | diff --git a/reference/istream/basic_istream/peek.md b/reference/istream/basic_istream/peek.md index 5945db70e1..0788400516 100644 --- a/reference/istream/basic_istream/peek.md +++ b/reference/istream/basic_istream/peek.md @@ -89,4 +89,4 @@ int_type peek() { ## 参照 - [`basic_istream::get`](get.md) -- `basic_streambuf::sgetc` +- [`basic_streambuf::sgetc`](../../streambuf/basic_streambuf/sgetc.md) diff --git a/reference/istream/basic_istream/putback.md b/reference/istream/basic_istream/putback.md index 442f4dead3..f2592d8dfe 100644 --- a/reference/istream/basic_istream/putback.md +++ b/reference/istream/basic_istream/putback.md @@ -96,4 +96,4 @@ basic_istream& putback(char_type c) { ## 参照 - [`basic_istream::unget`](unget.md) -- `basic_streambuf::sputbackc` +- [`basic_streambuf::sputbackc`](../../streambuf/basic_streambuf/sputbackc.md) diff --git a/reference/istream/basic_istream/seekg.md b/reference/istream/basic_istream/seekg.md index f49ef55682..4797bac576 100644 --- a/reference/istream/basic_istream/seekg.md +++ b/reference/istream/basic_istream/seekg.md @@ -121,7 +121,7 @@ basic_istream& seekg(off_type off, seekdir dir) { ## 参照 - [`basic_istream::tellg`](tellg.md) -- `basic_streambuf::pubseekpos` -- `basic_streambuf::pubseekoff` -- `basic_streambuf::seekpos` -- `basic_streambuf::seekoff` +- [`basic_streambuf::pubseekpos`](../../streambuf/basic_streambuf/pubseekpos.md) +- [`basic_streambuf::pubseekoff`](../../streambuf/basic_streambuf/pubseekoff.md) +- [`basic_streambuf::seekpos`](../../streambuf/basic_streambuf/seekpos.md) +- [`basic_streambuf::seekoff`](../../streambuf/basic_streambuf/seekoff.md) diff --git a/reference/istream/basic_istream/sync.md b/reference/istream/basic_istream/sync.md index b84c364e4f..71cb5f62e3 100644 --- a/reference/istream/basic_istream/sync.md +++ b/reference/istream/basic_istream/sync.md @@ -56,5 +56,4 @@ int sync() { - C++98 ## 参照 - -- `basic_streambuf::pubsync` +- [`basic_streambuf::pubsync`](../../streambuf/basic_streambuf/pubsync.md) diff --git a/reference/istream/basic_istream/tellg.md b/reference/istream/basic_istream/tellg.md index 6adc6d5e2d..cb1dfcb36e 100644 --- a/reference/istream/basic_istream/tellg.md +++ b/reference/istream/basic_istream/tellg.md @@ -83,7 +83,6 @@ pos_type tellg(pos_type pos) { - C++98 ## 参照 - - [`basic_istream::seekg`](seekg.md) -- `basic_streambuf::pubseekoff` -- `basic_streambuf::seekoff` +- [`basic_streambuf::pubseekoff`](../../streambuf/basic_streambuf/pubseekoff.md) +- [`basic_streambuf::seekoff`](../../streambuf/basic_streambuf/seekoff.md) diff --git a/reference/istream/basic_istream/unget.md b/reference/istream/basic_istream/unget.md index 1fffb103d5..d15f23f97c 100644 --- a/reference/istream/basic_istream/unget.md +++ b/reference/istream/basic_istream/unget.md @@ -108,4 +108,4 @@ basic_istream& unget() { ## 参照 - [`basic_istream::putback`](putback.md) -- `basic_streambuf::sungetc` +- [`basic_streambuf::sungetc`](../../streambuf/basic_streambuf/sungetc.md) diff --git a/reference/string/basic_string.md b/reference/string/basic_string.md index 9e656c1df5..e149400b80 100644 --- a/reference/string/basic_string.md +++ b/reference/string/basic_string.md @@ -151,7 +151,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |---------------------|----------------|------| -| `npos` | 無効な位置を表す。`find`や`substr`などで使われる。
`static const size_type npos = -1;` | | +| `npos` | 無効な位置を表す。`find`や`substr`などで使われる。
`static const size_type npos = -1;` | C++23からconstexpr | ### メンバ型 diff --git a/reference/string_view/basic_string_view.md b/reference/string_view/basic_string_view.md index 083db3f5ba..da546eea56 100644 --- a/reference/string_view/basic_string_view.md +++ b/reference/string_view/basic_string_view.md @@ -116,7 +116,7 @@ string_view hello = sv.substr(0, 5); // 先頭5文字を抽出する | 名前 | 説明 | 対応バージョン | |---------------------|----------------|------| -| `npos` | 無効な位置を表す。`find`や`substr`などで使われる。
`static const size_type npos = -1;` | C++17 | +| `npos` | 無効な位置を表す。`find`や`substr`などで使われる。
`static constexpr size_type npos = -1;` | C++17 | ### メンバ型 @@ -260,7 +260,7 @@ Hell ``` ### 文字列リテラルを範囲として使用する場合にヌル文字が含まれないようにする -```cpp +```cpp example #include #include diff --git a/reference/string_view/basic_string_view/compare.md b/reference/string_view/basic_string_view/compare.md index 93d05d2ff1..b75a42bc39 100644 --- a/reference/string_view/basic_string_view/compare.md +++ b/reference/string_view/basic_string_view/compare.md @@ -33,9 +33,9 @@ constexpr int compare(size_type pos1, ## 概要 他の文字列との比較を行う。 -- (1) : `*this`と`s`を比較する -- (2) : `*this`の範囲`[pos1, pos1 + n1)`と`s`を比較する -- (3) : `*this`の範囲`[pos1, pos1 + n1)`と`s`の範囲`[pos2, pos2 + n2)`を比較する +- (1) : `*this`と`sv`を比較する +- (2) : `*this`の範囲`[pos1, pos1 + n1)`と`sv`を比較する +- (3) : `*this`の範囲`[pos1, pos1 + n1)`と`sv`の範囲`[pos2, pos2 + n2)`を比較する - (4) : `*this`と文字配列`s`を比較する - (5) : `*this`の範囲`[pos1, pos1 + n1)`と文字配列`s`を比較する - (6) : `*this`の範囲`[pos1, pos1 + n1)`と文字配列`s`の先頭`n2`文字を比較する @@ -43,12 +43,12 @@ constexpr int compare(size_type pos1, ## 効果 - (1) : - - [`size()`](size.md)と`str.`[`size()`](size.md)のうち、小さい方を`rlen`とする + - [`size()`](size.md)と`sv.`[`size()`](size.md)のうち、小さい方を`rlen`とする - `int result = Traits::`[`compare`](/reference/string/char_traits/compare.md)`(`[`data()`](data.md)`, sv.`[`data()`](data.md)`, rlen);` - `result != 0`であれば`result`を返す。そうでなければ、以下のように返す: - - `size() < str.size()`であれば0未満の値を返す - - `size() == str.size()`であれば0を返す - - `size() > str.size()`であれば0超の値を返す + - `size() < sv.size()`であれば0未満の値を返す + - `size() == sv.size()`であれば0を返す + - `size() > sv.size()`であれば0超の値を返す - (2) : `return` [`substr`](substr.md)`(pos1, n1).compare(sv);` と等価 - (3) : `return` [`substr`](substr.md)`(pos1, n1).compare(sv.`[`substr`](substr.md)`(pos2, n2));` と等価 - (4) : `return compare(basic_string_view(s));` と等価 From 5d7347170fc0f7d3edc39aca553bb9c5d2373fd5 Mon Sep 17 00:00:00 2001 From: yoh Date: Sun, 4 Feb 2024 17:48:16 +0900 Subject: [PATCH 0701/3948] =?UTF-8?q?mdspan:=20submdspan=E6=A6=82=E8=A6=81?= =?UTF-8?q?(#1201)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 利用者観点での説明を一通り記述 --- lang/cpp26.md | 2 +- reference/mdspan.md | 13 + reference/mdspan/full_extent_t.md | 80 ++++++ reference/mdspan/layout_left/mapping.md | 8 + reference/mdspan/layout_right/mapping.md | 8 + reference/mdspan/layout_stride/mapping.md | 8 + reference/mdspan/strided_slice.md | 115 ++++++++ reference/mdspan/submdspan.md | 284 +++++++++++++++++++ reference/mdspan/submdspan_mapping_result.md | 45 +++ 9 files changed, 562 insertions(+), 1 deletion(-) create mode 100644 reference/mdspan/full_extent_t.md create mode 100644 reference/mdspan/strided_slice.md create mode 100644 reference/mdspan/submdspan.md create mode 100644 reference/mdspan/submdspan_mapping_result.md diff --git a/lang/cpp26.md b/lang/cpp26.md index 311fb6c933..a34ee1cdb3 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -63,7 +63,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 ### コンテナ -- [`std::mdspan`](/reference/mdspan/mdspan.md)のサブ配列版として[`std::submdspan`](/reference/mdspan/submdspan.md.nolink)を追加 +- [`std::mdspan`](/reference/mdspan/mdspan.md)から部分ビューを取り出す[`std::submdspan()`](/reference/mdspan/submdspan.md)を追加 - [`std::span`](/reference/span/span.md)に、以下を追加 - [`std::initializer_list`](/reference/initializer_list/initializer_list.md)をとるコンストラクタ - インデックスアクセスのための[`at()`](/reference/span/span/at.md)メンバ関数 diff --git a/reference/mdspan.md b/reference/mdspan.md index db4820535b..2172e1699a 100644 --- a/reference/mdspan.md +++ b/reference/mdspan.md @@ -36,6 +36,18 @@ | [`mdspan`](mdspan/mdspan.md) | 多次元配列ビュー (class template) | C++23 | +## 多次元配列部分ビュー + +| 名前 | 説明 | 対応バージョン | +|------|------|-------| +| [`strided_slice`](mdspan/strided_slice.md) | 指定次元のストライド指定要素取り出しを指示する集成体クラステンプレート (class template) | C++26 | +| [`full_extent_t`](mdspan/full_extent_t.md) | 指定次元の全要素取り出しを指示するタグ型 (class) | C++26 | +| [`full_extent`](mdspan/full_extent_t.md) | 指定次元の全要素取り出しを指示するタグ値 (variable) | C++26 | +| [`submdspan_mapping_result`](mdspan/submdspan_mapping_result.md) | 多次元配列部分ビューのレイアウトマッピング情報 (class template) | C++26 | +| [`submdspan_extents`](mdspan/submdspan_extents.md.nolink) | 多次元配列部分ビューの多次元配列サイズを計算する (function template) | C++26 | +| [`submdspan`](mdspan/submdspan.md) | 多次元配列部分ビューを取得する (function template) | C++26 | + + ## バージョン ### 言語 - C++23 @@ -47,3 +59,4 @@ ## 参照 - [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) +- [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) diff --git a/reference/mdspan/full_extent_t.md b/reference/mdspan/full_extent_t.md new file mode 100644 index 0000000000..49c7336d46 --- /dev/null +++ b/reference/mdspan/full_extent_t.md @@ -0,0 +1,80 @@ +# full_extent_t +* mdspan[meta header] +* class[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std { + struct full_extent_t { explicit full_extent_t() = default; }; + + inline constexpr full_extent_t full_extent{}; +} +``` + +## 概要 +`full_extent_t`は、多次元配列の特定次元に対して全要素取り出しを指示するためのタグ型である。 + +`full_extent_t`型の定数`full_extent`が提供される。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + int arr[] = {1, 2, 3, 4, 5, 6}; + using Ext2x3 = std::extents; + std::mdspan mat{arr}; + // 2x3要素の2次元配列ビュー + // i/j -> + // | 1 2 3 + // V 4 5 6 + + // i=1行を3要素の1次元ビューとして抽出 + auto row1 = std::submdspan(mat, 1, std::full_extent); + std::println("row[1]:"); + for (size_t i = 0; i < row1.extent(0); i++) { + std::print(" {}", row1[i]); + } + + // j=1列を2要素の1次元ビューとして抽出 + auto col1 = std::submdspan(mat, std::full_extent, 1); + std::println("\ncol[1]:"); + for (size_t i = 0; i < col1.extent(0); i++) { + std::print(" {}", col1[i]); + } +} +``` +* std::full_extent[color ff0000] +* std::submdspan[link submdspan.md] +* extent[link mdspan/extent.md] + +### 出力 +``` +row[1]: + 4 5 6 +col[1]: + 2 5 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`submdspan`](submdspan.md) + + +## 参照 +- [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) diff --git a/reference/mdspan/layout_left/mapping.md b/reference/mdspan/layout_left/mapping.md index 82c48be206..352ea08d49 100644 --- a/reference/mdspan/layout_left/mapping.md +++ b/reference/mdspan/layout_left/mapping.md @@ -72,6 +72,12 @@ namespace std { | `layout_type` | [`layout_left`](../layout_left.md) | C++23 | +## 非メンバ(*Hidden friends*)関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`submdspan_mapping`](mapping/submdspan_mapping.md.nolink) | [`submdspan`](../submdspan.md)サポート | C++26 | + ### 比較演算子 | 名前 | 説明 | 対応バージョン | @@ -124,7 +130,9 @@ int main() ## 関連項目 - [`mdspan`](../mdspan.md) +- [`submdspan`](../submdspan.md) ## 参照 - [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) +- [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) diff --git a/reference/mdspan/layout_right/mapping.md b/reference/mdspan/layout_right/mapping.md index 891bd98a87..9106e58bfc 100644 --- a/reference/mdspan/layout_right/mapping.md +++ b/reference/mdspan/layout_right/mapping.md @@ -72,6 +72,12 @@ namespace std { | `layout_type` | [`layout_right`](../layout_right.md) | C++23 | +## 非メンバ(*Hidden friends*)関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`submdspan_mapping`](mapping/submdspan_mapping.md.nolink) | [`submdspan`](../submdspan.md)サポート | C++26 | + ### 比較演算子 | 名前 | 説明 | 対応バージョン | @@ -124,7 +130,9 @@ int main() ## 関連項目 - [`mdspan`](../mdspan.md) +- [`submdspan`](../submdspan.md) ## 参照 - [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) +- [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) diff --git a/reference/mdspan/layout_stride/mapping.md b/reference/mdspan/layout_stride/mapping.md index ee1d463728..5907bf3675 100644 --- a/reference/mdspan/layout_stride/mapping.md +++ b/reference/mdspan/layout_stride/mapping.md @@ -74,6 +74,12 @@ namespace std { | `layout_type` | [`layout_stride`](../layout_stride.md) | C++23 | +## 非メンバ(*Hidden friends*)関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`submdspan_mapping`](mapping/submdspan_mapping.md.nolink) | [`submdspan`](../submdspan.md)サポート | C++26 | + ### 比較演算子 | 名前 | 説明 | 対応バージョン | @@ -128,7 +134,9 @@ int main() ## 関連項目 - [`mdspan`](../mdspan.md) +- [`submdspan`](../submdspan.md) ## 参照 - [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) +- [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) diff --git a/reference/mdspan/strided_slice.md b/reference/mdspan/strided_slice.md new file mode 100644 index 0000000000..6ab21722b1 --- /dev/null +++ b/reference/mdspan/strided_slice.md @@ -0,0 +1,115 @@ +# strided_slice +* mdspan[meta header] +* class template[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std { + template + struct strided_slice { + using offset_type = OffsetType; + using extent_type = ExtentType; + using stride_type = StrideType; + + [[no_unique_address]] offset_type offset{}; + [[no_unique_address]] extent_type extent{}; + [[no_unique_address]] stride_type stride{}; + }; +} +``` + +## 概要 +`strided_slice`は、多次元配列の特定次元に対してストライド幅を指定した要素取り出しを指示する集成体クラステンプレートである。 + +初期化時にメンバ変数名を明記する[指示付き初期化](/lang/cpp20/designated_initialization.md)をサポートし、テンプレートパラメータは[テンプレート引数推論](/lang/cpp20/class_template_argument_deduction_for_aggregates.md)の利用を想定した設計となっている。 + +- `offset` : 元の多次元配列におけるオフセット +- `extent` : 元の多次元配列における要素数 +- `stride` : 要素取り出しストライド幅 + +```cpp +// オフセット=1, 要素数=10, ストライド幅=3 +std::strided_slice{.offset=1, .extent=10, .stride=3} +``` + + +## 適格要件 +`OffsetType`, `ExtentType`, `StrideType`は符号付き整数型または符号無し整数型、もしくは[`integral-constant-like`](integral-constant-like.md.nolink)のモデルであること。 + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------|------|-------| +| `offset_type` | `offset`の型 | C++26 | +| `extent_type` | `extent`の型 | C++26 | +| `stride_type` | `stride`の型 | C++26 | + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + // 12要素の1次元配列ビュー + int arr[12]; + std::ranges::iota(arr, 0); + std::mdspan vec0{arr}; + + // オフセット位置1から10要素の範囲よりストライド幅3で要素抽出 + auto vec1 = std::submdspan(vec0, std::strided_slice{1, 10, 3}); + // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 + // ^ . . ^ . . ^ . . ^ + std::println("vec1:"); + for (size_t i = 0; i < vec1.extent(0); i++) { + std::print(" {}", vec1[i]); + } + + // オフセット位置0から12要素の範囲よりストライド幅4で要素抽出(指示付き初期化を利用) + auto vec2 = std::submdspan(vec0, + std::strided_slice{.offset=0, .extent=12, .stride=4}); + // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 + // ^ . . . ^ . . . ^ . . . + std::println("\nvec2:"); + for (size_t i = 0; i < vec2.extent(0); i++) { + std::print(" {}", vec2[i]); + } +} +``` +* std::strided_slice[color ff0000] +* std::ranges::iota[link /reference/numeric/ranges_iota.md] +* std::submdspan[link submdspan.md] +* extent[link mdspan/extent.md] + +### 出力 +``` +vec1: + 1 4 7 10 +vec2: + 0 4 8 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`submdspan`](submdspan.md) +- [C++20 指示付き初期化](/lang/cpp20/designated_initialization.md) +- [C++20 集成体クラステンプレートのテンプレート引数推論](/lang/cpp20/class_template_argument_deduction_for_aggregates.md) + + +## 参照 +- [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) diff --git a/reference/mdspan/submdspan.md b/reference/mdspan/submdspan.md new file mode 100644 index 0000000000..db055f288d --- /dev/null +++ b/reference/mdspan/submdspan.md @@ -0,0 +1,284 @@ +# submdspan +* mdspan[meta header] +* function template[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std { + template< + class ElementType, + class Extents, + class LayoutPolicy, + class AccessorPolicy, + class... SliceSpecifiers> + constexpr auto submdspan( + const mdspan& src, + SliceSpecifiers... slices) -> see below; +} +``` +* Extents[link extents.md] +* LayoutPolicy[link LayoutMappingPolicy.md] +* AccessorPolicy[link AccessorPolicy.md] +* mdspan[link mdspan.md] +* see below[italic] + +## 概要 +多次元配列ビュー[`mdspan`](mdspan.md)と各次元からの要素取り出し(スライス)方式を指定して、メモリブロックに対する新しい多次元配列ビュー[`mdspan`](mdspan.md)を取得する。 + +### スライス指定 +各次元からの要素取り出し方式は、下記の4種類をサポートする。 +スライス指定子リスト`slices...`にインデクス値指定が含まれる場合、戻り値の次元数(rank)は元の多次元配列ビューに対してインデクス値指定した次元数だけ削減される。 + +- インデクス値指定 : 整数値。指定次元に対する多次元インデクス値を固定する。 +- インデクス範囲指定 : [インデクス・ペア互換型](index-pair-like.md.nolink)の値。開始位置(begin)と終了位置(end)で表現される半開区間から要素群を取り出す。 +- ストライド・スライス指定 : [`std::strided_slice`](strided_slice.md)の値。オフセット(offset)と要素数(extent)とストライド幅(stride)で指定される要素群を取り出す。 +- 全要素指定 : [`std::full_extent`](full_extent_t.md)。指定次元の全要素を取り出す。 + + +## テンプレートパラメータ制約 +- `sizeof...(slices)`が[`Extents::rank()`](extents/rank.md)と等しく、かつ +- 評価されない文脈において式`submdspan_mapping(`[`src.mapping()`](mdspan/mapping.md)`, slices...)`が妥当な式であること。 + + +## 適格要件 +説明用の型`index_type`を[`Extents::index_type`](extents.md)、変数`sub_map_offset`を`submdspan_mapping(`[`src.mapping()`](mdspan/mapping.md)`, slices...)`の結果としたとき、 + +- 型`decltype(submdspan_mapping(`[`src.mapping()`](mdspan/mapping.md)`, slices...))`が[`submdspan_mapping_result`](submdspan_mapping_result.md)の特殊化であり、 +- [`is_same_v`](/reference/type_traits/is_same.md)`<`[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`, decltype(`[`submdspan_extents`](submdspan_extents.md.nolink)`(`[`src.mapping()`](mdspan/mapping.md)`, slices...))>`が`true`、かつ +- [`src.extents()`](mdspan/extents.md)の各次元インデクス`k`において、`S_k`を`SliceSpecifiers`の`k`番目の型としたき、下記いずれかの1つのみを満たすこと。 + - 型`S_k`が[`convertible_to`](/reference/concepts/convertible_to.md)``のモデル + - 型`S_k`が[`index-pair-like`](index-pair-like.md.nolink)``のモデル + - [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` + - 型`S_k`が[`strided_slice`](strided_slice.md)の特殊化 + + +## 事前条件 +- [`src.extents()`](mdspan/extents.md)の各次元インデクス`k`において、`S_k`を`SliceSpecifiers`の`k`番目の型、`s_k`を`slices`の`k`番目の値としたとき、下記を全て満たすこと。 + - 型`S_k`が[`strided_slice`](strided_slice.md)の特殊化のとき + - `s_k.extent == 0`、または + - `s_k.stride > 0` + - `0` ≤ [`first_`](first_.md.nolink)`(slices...)` ≤ [`last_`](last_.md.nolink)`(`[`src.extents()`](mdspan/extents.md)`, slices...)` ≤ [`src.extent(k)`](mdspan/extent.md) +- [`sub_map_offset.mapping`](submdspan_mapping_result.md)`.extents() ==` [`submdspan_extents`](submdspan_extents.md.nolink)`(`[`src.mapping()`](mdspan/mapping.md)`, slices...)`が`true`、かつ +- [`sub_map_offset.mapping`](submdspan_mapping_result.md)`.extents()`の多次元インデクス値を表す任意の整数パック`I`に対して、`sub_map_offset.mapping(I...) +` [`sub_map_offset.offset`](submdspan_mapping_result.md) `==` [`src.mapping()`](mdspan/mapping.md)`(`[`src-indices`](src-indices.md.nolink)`(`[`array`](/reference/array/array.md)`{I...}, slices...))`が`true`であること。 + + +## 効果 +以下と等価 + +```cpp +auto sub_map_offset = submdspan_mapping(src.mapping(), slices...); +return mdspan(src.accessor().offset(src.data(), sub_map_offset.offset), + sub_map_offset.mapping, + AccessorPolicy::offset_policy(src.accessor())); +``` +* mdspan[link mdspan.md] +* sub_map_offset[link submdspan_mapping_result.md] +* src.mapping()[link mdspan/mapping.md] +* src.accessor()[link mdspan/accessor.md] +* AccessorPolicy::offset_policy[link AccessorPolicy.md] + + +## 例 +### 基本的な使い方 +```cpp example +#include +#include +#include +#include + +// 2次元配列ビュー(Matrix)の要素表示 +template +void print_mat(std::string_view name, const std::mdspan& mat) +{ + static_assert(mat.rank() == 2); + std::println("{}:", name); + for (size_t i = 0; i < mat.extent(0); ++i) { + for (size_t j = 0; j < mat.extent(1); ++j) { + std::print(" {:2}", mat[i, j]); + } + std::println(""); + } +} + +// 1次元配列ビュー(Vector)の要素表示 +template +void print_vec(std::string_view name, const std::mdspan& mat) +{ + static_assert(mat.rank() == 1); + std::println("{}:", name); + for (size_t i = 0; i < mat.extent(0); ++i) { + std::print(" {:2}", mat[i]); + } + std::println(""); +} + +int main() +{ + int arr[20]; + std::ranges::iota(arr, 1); + + // 4x5要素の2次元配列ビュー + using Ext2D = std::dextents; + std::mdspan mat{arr, Ext2D{4, 5}}; + print_mat("mat", mat); + + // インデクス値指定+全要素指定(2次元→1次元) + auto row1 = std::submdspan(mat, 1, std::full_extent); + print_vec("mat[1,M]", row1); + auto col2 = std::submdspan(mat, std::full_extent, 2); + print_vec("mat[N,2]", col2); + + // 単一要素の取り出し(2次元→0次元) + auto elem = std::submdspan(mat, 1, 2); + std::println("mat[1,2]:\n {:2}", elem[]); + + // インデクス範囲指定 + auto submat = std::submdspan(mat, std::pair{1,3}, std::pair{1,4}); + print_mat("submat", submat); + + // ストライド・スライス指定 + auto strided = std::submdspan(mat, + std::strided_slice{.offset=1, .extent=3, .stride=2}, + std::strided_slice{.offset=0, .extent=5, .stride=2}); + print_mat("strided", strided); +} +``` +* std::submdspan[color ff0000] +* std::ranges::iota[link /reference/numeric/ranges_iota.md] +* std::full_extent[link full_extent_t.md] +* std::strided_slice[link strided_slice.md] + +#### 出力 +``` +mat: + 1 2 3 4 5 + 6 7 8 9 10 + 11 12 13 14 15 + 16 17 18 19 20 +mat[1,M]: + 6 7 8 9 10 +mat[N,2]: + 3 8 13 18 +mat[1,2]: + 8 +submat: + 7 8 9 + 12 13 14 +strided: + 6 8 10 + 16 18 20 +``` + +### 静的要素数mdspanの生成 +```cpp example +#include +#include +#include +#include + +// 整数定数型 +template +constexpr auto Int = std::integral_constant{}; + +int main() +{ + int arr[20]; + std::ranges::iota(arr, 1); + + // 静的要素数 4x5 の2次元配列ビュー + std::mdspan mat{arr, std::extents{}}; + + // 動的要素数 2x3 の2次元配列部分ビューを取り出し + auto submat_dyn = std::submdspan(mat, + std::pair{1, 3}, + std::strided_slice{.offset=0, .extent=5, .stride=2}); + static_assert(std::same_as>); + std::println("submat_dyn {}x{}", submat_dyn.extent(0), submat_dyn.extent(1)); + + // 静的要素数 2x3 の2次元配列部分ビューを取り出し + auto submat_2x3 = std::submdspan(mat, + std::pair{Int<1>, Int<3>}, + std::strided_slice{.offset=0, .extent=Int<5>, .stride=Int<2>}); + // (strided_slice::offset は戻り値型に影響を与えない) + static_assert(std::same_as>); + std::println("submat_2x3 {}x{}", submat_dyn.extent(0), submat_dyn.extent(1)); +} +``` +* std::submdspan[color ff0000] +* std::integral_constant[link /reference/type_traits/integral_constant.md] +* std::ranges::iota[link /reference/numeric/ranges_iota.md] +* std::strided_slice[link strided_slice.md] + +#### 出力 +``` +submat_dyn 2x3 +submat_2x3 2x3 +``` + +### レイアウトマッピング互換性 +```cpp example +#include + +int main() +{ + int arr[6] = {1, 2, 3, 4, 5, 6}; + + // 3x2要素の2次元配列ビュー(行優先レイアウト) + std::mdspan mat{arr, std::extents{}}; + static_assert(std::same_as); + // 1 2 + // 3 4 + // 5 6 + + // 行優先レイアウト std::layout_right を維持 + auto row0 = std::submdspan(mat, 0, std::full_extent); + // 1 2 + auto row12 = std::submdspan(mat, std::pair{1,3}, std::full_extent); + // 3 4 + // 5 6 + static_assert(std::same_as); + static_assert(std::same_as); + + // 汎用ストライド指定レイアウト std::layout_stride に変換 + auto col1 = std::submdspan(mat, std::full_extent, 1); + // 2 4 6 + auto row02 = std::submdspan(mat, + std::strided_slice{.offset=0, .extent=3, .stride=2}, + std::full_extent); + // 1 2 + // 5 6 + static_assert(std::same_as); + static_assert(std::same_as); +} +``` +* std::submdspan[color ff0000] +* std::full_extent[link full_extent_t.md] +* std::strided_slice[link strided_slice.md] +* std::layout_right[link layout_right.md] +* std::layout_stride[link layout_stride.md] + +#### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`mdspan`](mdspan.md) +- [`full_extent`](full_extent_t.md) +- [`strided_slice`](strided_slice.md) + + +## 参照 +- [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) diff --git a/reference/mdspan/submdspan_mapping_result.md b/reference/mdspan/submdspan_mapping_result.md new file mode 100644 index 0000000000..667a180e81 --- /dev/null +++ b/reference/mdspan/submdspan_mapping_result.md @@ -0,0 +1,45 @@ +# submdspan_mapping_result +* mdspan[meta header] +* class template[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std { + template + struct submdspan_mapping_result { + [[no_unique_address]] LayoutMapping mapping = LayoutMapping(); + size_t offset{}; + }; +} +``` +* LayoutMapping[link LayoutMapping.md] + +## 概要 +`submdspan_mapping_result`は、多次元配列ビュー[mdspan](mdspan.md)からの部分ビュー[`submdspan`](submdspan.md)取り出しサポートのために定義するカスタマイズポイント`submdspan_mapping`の戻り値型である。 + +- `mapping` : 多次元配列部分ビューの[レイアウトマッピング](LayoutMapping.md) +- `offset` : 多次元配列部分ビューの要素オフセット位置 + + +## 適格要件 +`LayoutMapping`は[レイアウトマッピング要件](LayoutMapping.md)を満たすこと。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`submdspan`](submdspan.md) + + +## 参照 +- [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) From 7c5eb19185319d7cb2dbdee3058460d954e0d2ae Mon Sep 17 00:00:00 2001 From: yoh Date: Sun, 4 Feb 2024 21:44:19 +0900 Subject: [PATCH 0702/3948] =?UTF-8?q?mdspan:=20submdspan=E8=AA=AC=E6=98=8E?= =?UTF-8?q?=E7=94=A8=E3=82=A8=E3=83=B3=E3=83=86=E3=82=A3=E3=83=86=E3=82=A3?= =?UTF-8?q?(#1201)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/mdspan/de-ice.md | 25 ++++++++++++ reference/mdspan/first_.md | 40 +++++++++++++++++++ reference/mdspan/full_extent_t.md | 5 ++- reference/mdspan/index-pair-like.md | 26 +++++++++++++ reference/mdspan/integral-constant-like.md | 33 ++++++++++++++++ reference/mdspan/last_.md | 41 ++++++++++++++++++++ reference/mdspan/src-indices.md | 40 +++++++++++++++++++ reference/mdspan/strided_slice.md | 10 +++-- reference/mdspan/submdspan.md | 17 ++++---- reference/mdspan/submdspan_mapping_result.md | 1 + 10 files changed, 226 insertions(+), 12 deletions(-) create mode 100644 reference/mdspan/de-ice.md create mode 100644 reference/mdspan/first_.md create mode 100644 reference/mdspan/index-pair-like.md create mode 100644 reference/mdspan/integral-constant-like.md create mode 100644 reference/mdspan/last_.md create mode 100644 reference/mdspan/src-indices.md diff --git a/reference/mdspan/de-ice.md b/reference/mdspan/de-ice.md new file mode 100644 index 0000000000..b2f611d270 --- /dev/null +++ b/reference/mdspan/de-ice.md @@ -0,0 +1,25 @@ +# de-ice +* mdspan[meta header] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +constexpr T de-ice(T val) { return val; } + +template +constexpr auto de-ice(T) { return T::value; } +``` +* integral-constant-like[link integral-constant-like.md] + +## 概要 +`de-ice`は[`submdspan`](submdspan.md)動作説明用の関数テンプレートである。 + + +## バージョン +### 言語 +- C++26 + + +## 参照 +- [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) diff --git a/reference/mdspan/first_.md b/reference/mdspan/first_.md new file mode 100644 index 0000000000..0a5dc8dd1d --- /dev/null +++ b/reference/mdspan/first_.md @@ -0,0 +1,40 @@ +# first_ +* mdspan[meta header] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +constexpr IndexType first_(SliceSpecifiers... slices); +``` + +## 概要 +`first_`は[`submdspan`](submdspan.md)動作説明用の関数テンプレートである。 + +`S_k`を`SliceSpecifiers`の`k`番目の型、`s_k`を`slices`の`k`番目の値としたとき、説明用の`P_k`の値を次のように定義する。 + +- 型`S_k`が[`convertible_to`](/reference/concepts/convertible_to.md)``のモデルのとき`s_k`、そうでなければ +- 型`S_k`が[`index-pair-like`](index-pair-like.md)``のモデルのとき`get<0>(s_k)`、そうでなければ +- 型`S_k`が[`strided_slice`](strided_slice.md)の特殊化のとき[`de-ice`](de-ice.md)`(s_k.offset)`、そうでなければ +- 値`0` + + +## 適格要件 +`IndexType`は符号付き整数型または符号無し整数型であること。 + + +## 事前条件 +`P_k`が`IndexType`型で表現可能な値であること。 + + +## 戻り値 +[`extents`](extents.md)`::`[`index-cast`](extents/index-cast.md)`(P_k)` + + +## バージョン +### 言語 +- C++26 + + +## 参照 +- [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) diff --git a/reference/mdspan/full_extent_t.md b/reference/mdspan/full_extent_t.md index 49c7336d46..78bf97479a 100644 --- a/reference/mdspan/full_extent_t.md +++ b/reference/mdspan/full_extent_t.md @@ -26,9 +26,10 @@ namespace std { int main() { int arr[] = {1, 2, 3, 4, 5, 6}; + + // 2x3要素の2次元配列ビュー using Ext2x3 = std::extents; std::mdspan mat{arr}; - // 2x3要素の2次元配列ビュー // i/j -> // | 1 2 3 // V 4 5 6 @@ -51,6 +52,8 @@ int main() * std::full_extent[color ff0000] * std::submdspan[link submdspan.md] * extent[link mdspan/extent.md] +* std::print[link /reference/print/print.md] +* std::println[link /reference/print/println.md] ### 出力 ``` diff --git a/reference/mdspan/index-pair-like.md b/reference/mdspan/index-pair-like.md new file mode 100644 index 0000000000..e4a34b71a3 --- /dev/null +++ b/reference/mdspan/index-pair-like.md @@ -0,0 +1,26 @@ +# index-pair-like +* mdspan[meta header] +* concept[meta id-type] +* cpp26[meta cpp] + +```cpp +template +concept index-pair-like = // exposition only + pair-like && + convertible_to, IndexType> && + convertible_to, IndexType>; +``` +* pair-like[link /reference/tuple/pair-like.md] +* convertible_to[link /reference/concepts/convertible_to.md] + +## 概要 +`index-pair-like`は、インデクス値ペアと互換があることを表す説明専用コンセプトである。 + + +## バージョン +### 言語 +- C++26 + + +## 参照 +- [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) diff --git a/reference/mdspan/integral-constant-like.md b/reference/mdspan/integral-constant-like.md new file mode 100644 index 0000000000..d45e5abaf4 --- /dev/null +++ b/reference/mdspan/integral-constant-like.md @@ -0,0 +1,33 @@ +# integral-constant-like +* mdspan[meta header] +* concept[meta id-type] +* cpp26[meta cpp] + +```cpp +template +concept integral-constant-like = // exposition only + is_integral_v && + !is_same_v> && + convertible_to && + equality_comparable_with && + bool_constant::value && + bool_constant(T()) == T::value>::value; +``` +* is_integral_v[link /reference/type_traits/is_integral.md] +* is_same_v[link /reference/type_traits/is_same.md] +* remove_const_t[link /reference/type_traits/remove_const.md] +* bool_constant[link /reference/type_traits/bool_constant.md] +* convertible_to[link /reference/concepts/convertible_to.md] +* equality_comparable_with[link /reference/concepts/equality_comparable.md] + +## 概要 +`integral-constant-like`は、型`T`が整数定数と互換があることを表す説明専用コンセプトである。 + + +## バージョン +### 言語 +- C++26 + + +## 参照 +- [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) diff --git a/reference/mdspan/last_.md b/reference/mdspan/last_.md new file mode 100644 index 0000000000..f552e9b469 --- /dev/null +++ b/reference/mdspan/last_.md @@ -0,0 +1,41 @@ +# last_ +* mdspan[meta header] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +constexpr auto last_(const Extents& src, SliceSpecifiers... slices); +``` +* Extents[link extents.md] + +## 概要 +`last_`は[`submdspan`](submdspan.md)動作説明用の関数テンプレートである。 + +`index_type`を`Extents::index_type`型、`S_k`を`SliceSpecifiers`の`k`番目の型、`s_k`を`slices`の`k`番目の値としたとき、説明用の`L_k`の値を次のように定義する。 + +- 型`S_k`が[`convertible_to`](/reference/concepts/convertible_to.md)``のモデルのとき[`de-ice`](de-ice.md)`(s_k) + 1`、そうでなければ +- 型`S_k`が[`index-pair-like`](index-pair-like.md)``のモデルのとき`get<1>(s_k)`、そうでなければ +- 型`S_k`が[`strided_slice`](strided_slice.md)の特殊化のとき[`de-ice`](de-ice.md)`(s_k.offset) +` [`de-ice`](de-ice.md)`(s_k.extent)`、そうでなければ +- `src.`[`extent`](extents/extent.md)`(k)` + + +## 適格要件 +`Extents`が[`extents`](extents.md)の特殊化であること。 + + +## 事前条件 +`L_k`が`index_type`型で表現可能な値であること。 + + +## 戻り値 +[`extents`](extents.md)`::`[`index-cast`](extents/index-cast.md)`(L_k)` + + +## バージョン +### 言語 +- C++26 + + +## 参照 +- [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) diff --git a/reference/mdspan/src-indices.md b/reference/mdspan/src-indices.md new file mode 100644 index 0000000000..f93730159d --- /dev/null +++ b/reference/mdspan/src-indices.md @@ -0,0 +1,40 @@ +# src-indices +* mdspan[meta header] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +constexpr array + src-indices(const array& indices, SliceSpecifiers ... slices); +``` +* array[link /reference/array/array.md] + +## 概要 +`src-indices`は[`submdspan`](submdspan.md)動作説明用の関数テンプレートである。 + +説明のため`rank`を`slices`の要素数、`S_k`を`SliceSpecifiers`の`k`番目の型とする +[`array`](/reference/array/array.md)``型の配列`map-rank`を導入し、その要素`map-rank[k]`を下記の通り定義する。 + +- 型`S_k`が[`convertible_to`](/reference/concepts/convertible_to.md)``のモデルのとき[`dynamic_extent`](/reference/span/dynamic_extent.md)、そうでなければ +- `j < k`において型`S_j`が[`convertible_to`](/reference/concepts/convertible_to.md)``のモデルではない個数 + + +## 適格要件 +`IndexType`は符号付き整数型または符号無し整数型であること。 + + +## 戻り値 +半開区間`[0, rank)`の`k`に対して、`k`番目の要素が下記の値を持つ配列を返す。 + +- `map-rank[k]`が[`dynamic_extent`](/reference/span/dynamic_extent.md)に等しいとき、[`first_`](first_.md)`(slices...)` +- そうでなければ、[`first_`](first_.md)`(slices...) + indices[map-rank[k]]` + + +## バージョン +### 言語 +- C++26 + + +## 参照 +- [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) diff --git a/reference/mdspan/strided_slice.md b/reference/mdspan/strided_slice.md index 6ab21722b1..b7003c043f 100644 --- a/reference/mdspan/strided_slice.md +++ b/reference/mdspan/strided_slice.md @@ -18,6 +18,7 @@ namespace std { }; } ``` +* no_unique_address[link /lang/cpp20/language_support_for_empty_objects.md] ## 概要 `strided_slice`は、多次元配列の特定次元に対してストライド幅を指定した要素取り出しを指示する集成体クラステンプレートである。 @@ -35,7 +36,7 @@ std::strided_slice{.offset=1, .extent=10, .stride=3} ## 適格要件 -`OffsetType`, `ExtentType`, `StrideType`は符号付き整数型または符号無し整数型、もしくは[`integral-constant-like`](integral-constant-like.md.nolink)のモデルであること。 +`OffsetType`, `ExtentType`, `StrideType`は符号付き整数型または符号無し整数型、もしくは[`integral-constant-like`](integral-constant-like.md)のモデルであること。 ## メンバ型 @@ -63,7 +64,7 @@ int main() // オフセット位置1から10要素の範囲よりストライド幅3で要素抽出 auto vec1 = std::submdspan(vec0, std::strided_slice{1, 10, 3}); // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 - // ^ . . ^ . . ^ . . ^ + // ^ . . ^ . . ^ . . ^ std::println("vec1:"); for (size_t i = 0; i < vec1.extent(0); i++) { std::print(" {}", vec1[i]); @@ -81,9 +82,10 @@ int main() } ``` * std::strided_slice[color ff0000] -* std::ranges::iota[link /reference/numeric/ranges_iota.md] * std::submdspan[link submdspan.md] -* extent[link mdspan/extent.md] +* std::print[link /reference/print/print.md] +* std::println[link /reference/print/println.md] +* std::ranges::iota[link /reference/numeric/ranges_iota.md] ### 出力 ``` diff --git a/reference/mdspan/submdspan.md b/reference/mdspan/submdspan.md index db055f288d..6ca3ad68f1 100644 --- a/reference/mdspan/submdspan.md +++ b/reference/mdspan/submdspan.md @@ -31,7 +31,7 @@ namespace std { スライス指定子リスト`slices...`にインデクス値指定が含まれる場合、戻り値の次元数(rank)は元の多次元配列ビューに対してインデクス値指定した次元数だけ削減される。 - インデクス値指定 : 整数値。指定次元に対する多次元インデクス値を固定する。 -- インデクス範囲指定 : [インデクス・ペア互換型](index-pair-like.md.nolink)の値。開始位置(begin)と終了位置(end)で表現される半開区間から要素群を取り出す。 +- インデクス範囲指定 : [インデクス・ペア互換型](index-pair-like.md)の値。開始位置(begin)と終了位置(end)で表現される半開区間から要素群を取り出す。 - ストライド・スライス指定 : [`std::strided_slice`](strided_slice.md)の値。オフセット(offset)と要素数(extent)とストライド幅(stride)で指定される要素群を取り出す。 - 全要素指定 : [`std::full_extent`](full_extent_t.md)。指定次元の全要素を取り出す。 @@ -48,7 +48,7 @@ namespace std { - [`is_same_v`](/reference/type_traits/is_same.md)`<`[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`, decltype(`[`submdspan_extents`](submdspan_extents.md.nolink)`(`[`src.mapping()`](mdspan/mapping.md)`, slices...))>`が`true`、かつ - [`src.extents()`](mdspan/extents.md)の各次元インデクス`k`において、`S_k`を`SliceSpecifiers`の`k`番目の型としたき、下記いずれかの1つのみを満たすこと。 - 型`S_k`が[`convertible_to`](/reference/concepts/convertible_to.md)``のモデル - - 型`S_k`が[`index-pair-like`](index-pair-like.md.nolink)``のモデル + - 型`S_k`が[`index-pair-like`](index-pair-like.md)``のモデル - [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` - 型`S_k`が[`strided_slice`](strided_slice.md)の特殊化 @@ -58,9 +58,9 @@ namespace std { - 型`S_k`が[`strided_slice`](strided_slice.md)の特殊化のとき - `s_k.extent == 0`、または - `s_k.stride > 0` - - `0` ≤ [`first_`](first_.md.nolink)`(slices...)` ≤ [`last_`](last_.md.nolink)`(`[`src.extents()`](mdspan/extents.md)`, slices...)` ≤ [`src.extent(k)`](mdspan/extent.md) + - `0` ≤ [`first_`](first_.md)`(slices...)` ≤ [`last_`](last_.md)`(`[`src.extents()`](mdspan/extents.md)`, slices...)` ≤ [`src.extent(k)`](mdspan/extent.md) - [`sub_map_offset.mapping`](submdspan_mapping_result.md)`.extents() ==` [`submdspan_extents`](submdspan_extents.md.nolink)`(`[`src.mapping()`](mdspan/mapping.md)`, slices...)`が`true`、かつ -- [`sub_map_offset.mapping`](submdspan_mapping_result.md)`.extents()`の多次元インデクス値を表す任意の整数パック`I`に対して、`sub_map_offset.mapping(I...) +` [`sub_map_offset.offset`](submdspan_mapping_result.md) `==` [`src.mapping()`](mdspan/mapping.md)`(`[`src-indices`](src-indices.md.nolink)`(`[`array`](/reference/array/array.md)`{I...}, slices...))`が`true`であること。 +- [`sub_map_offset.mapping`](submdspan_mapping_result.md)`.extents()`の多次元インデクス値を表す任意の整数パック`I`に対して、`sub_map_offset.mapping(I...) +` [`sub_map_offset.offset`](submdspan_mapping_result.md) `==` [`src.mapping()`](mdspan/mapping.md)`(`[`src-indices`](src-indices.md)`(`[`array`](/reference/array/array.md)`{I...}, slices...))`が`true`であること。 ## 効果 @@ -145,9 +145,11 @@ int main() } ``` * std::submdspan[color ff0000] -* std::ranges::iota[link /reference/numeric/ranges_iota.md] * std::full_extent[link full_extent_t.md] * std::strided_slice[link strided_slice.md] +* std::print[link /reference/print/print.md] +* std::println[link /reference/print/println.md] +* std::ranges::iota[link /reference/numeric/ranges_iota.md] #### 出力 ``` @@ -202,13 +204,14 @@ int main() std::strided_slice{.offset=0, .extent=Int<5>, .stride=Int<2>}); // (strided_slice::offset は戻り値型に影響を与えない) static_assert(std::same_as>); - std::println("submat_2x3 {}x{}", submat_dyn.extent(0), submat_dyn.extent(1)); + std::println("submat_2x3 {}x{}", submat_2x3.extent(0), submat_2x3.extent(1)); } ``` * std::submdspan[color ff0000] +* std::strided_slice[link strided_slice.md] * std::integral_constant[link /reference/type_traits/integral_constant.md] * std::ranges::iota[link /reference/numeric/ranges_iota.md] -* std::strided_slice[link strided_slice.md] +* std::println[link /reference/print/println.md] #### 出力 ``` diff --git a/reference/mdspan/submdspan_mapping_result.md b/reference/mdspan/submdspan_mapping_result.md index 667a180e81..78ec62a1cf 100644 --- a/reference/mdspan/submdspan_mapping_result.md +++ b/reference/mdspan/submdspan_mapping_result.md @@ -14,6 +14,7 @@ namespace std { } ``` * LayoutMapping[link LayoutMapping.md] +* no_unique_address[link /lang/cpp20/language_support_for_empty_objects.md] ## 概要 `submdspan_mapping_result`は、多次元配列ビュー[mdspan](mdspan.md)からの部分ビュー[`submdspan`](submdspan.md)取り出しサポートのために定義するカスタマイズポイント`submdspan_mapping`の戻り値型である。 From f222955da68c8794948d82cf78c3e78d006359f2 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 6 Feb 2024 16:15:39 +0900 Subject: [PATCH 0703/3948] =?UTF-8?q?fold=5Fleft=5Fwith=5Fiter=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=20#1088?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23.md | 2 +- reference/algorithm.md | 3 +- reference/algorithm/ranges_fold_left.md | 4 +- reference/algorithm/ranges_fold_left_first.md | 4 +- .../algorithm/ranges_fold_left_with_iter.md | 234 ++++++++++++++++++ reference/algorithm/ranges_fold_right.md | 2 +- reference/algorithm/ranges_fold_right_last.md | 2 +- reference/algorithm/ranges_in_value_result.md | 87 +++++++ 8 files changed, 330 insertions(+), 8 deletions(-) create mode 100644 reference/algorithm/ranges_fold_left_with_iter.md create mode 100644 reference/algorithm/ranges_in_value_result.md diff --git a/lang/cpp23.md b/lang/cpp23.md index 88f0bcc54a..9668a800ac 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -164,7 +164,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 - [`std::ranges::fold_left_first()`](/reference/algorithm/ranges_fold_left_first.md) - [`std::ranges::fold_right()`](/reference/algorithm/ranges_fold_right.md) - [`std::ranges::fold_right_last()`](/reference/algorithm/ranges_fold_right_last.md) - - [`std::ranges::fold_left_with_iter()`](/reference/algorithm/ranges_fold_left_with_iter.md.nolink) + - [`std::ranges::fold_left_with_iter()`](/reference/algorithm/ranges_fold_left_with_iter.md) - [`std::ranges::fold_left_first_with_iter()`](/reference/algorithm/ranges_fold_left_first_with_iter.md.nolink) - [``](/reference/numeric.md)に、連番を生成するRangeアルゴリズム[`std::ranges::iota()`](/reference/numeric/ranges_iota.md)を追加 diff --git a/reference/algorithm.md b/reference/algorithm.md index 5b6e8b5b7d..0f70852802 100644 --- a/reference/algorithm.md +++ b/reference/algorithm.md @@ -430,7 +430,7 @@ ranges::sort(pv, {}, &Parson::name); | [`ranges::fold_right`](algorithm/ranges_fold_right.md)| 範囲の右(終端)からの`fold` | C++23 | | [`ranges::fold_left_first`](algorithm/ranges_fold_left_first.md)| 範囲の左(先頭)からの`fold`、初期値を省略する | C++23 | | [`ranges::fold_right_last`](algorithm/ranges_fold_right_last.md)| 範囲の右(終端)からの`fold`、初期値を省略する | C++23 | -| [`ranges::fold_left_with_iter`](algorithm/ranges_fold_left_with_iter.md.nolink) | 範囲の左(先頭)からの`fold`、終端イテレータを返す | C++23 | +| [`ranges::fold_left_with_iter`](algorithm/ranges_fold_left_with_iter.md) | 範囲の左(先頭)からの`fold`、終端イテレータを返す | C++23 | | [`ranges::fold_left_first_with_iter`](algorithm/ranges_fold_left_first_with_iter.md.nolink) | 範囲の左(先頭)からの`fold`、初期値を省略し終端イテレータを返す | C++23 | ### 戻り値 @@ -446,6 +446,7 @@ ranges::sort(pv, {}, &Parson::name); | [`ranges::in_out_out_result`](algorithm/ranges_in_out_out_result.md) | 3つのイテレータを格納する型 | C++20 | | [`ranges::min_max_result`](algorithm/ranges_min_max_result.md) | 2つの値または参照を格納する型 | C++20 | | [`ranges::in_found_result`](algorithm/ranges_in_found_result.md) | イテレータとbool値を格納する型 | C++20 | +| [`ranges::in_value_result`](algorithm/ranges_in_value_result.md) | イテレータと値を格納する型 | C++23 | | [`ranges::out_value_result`](algorithm/ranges_out_value_result.md) | イテレータと値を格納する型 | C++23 | diff --git a/reference/algorithm/ranges_fold_left.md b/reference/algorithm/ranges_fold_left.md index 9a540b2b8b..f5b4fcee4e 100644 --- a/reference/algorithm/ranges_fold_left.md +++ b/reference/algorithm/ranges_fold_left.md @@ -100,7 +100,7 @@ concept indirectly-binary-left-foldable = ```cpp return ranges::fold_left_with_iter(std::move(first), last, std::move(init), f).value; ``` - * fold_left_with_iter[link /reference/algorithm/ranges_fold_left_with_iter.md.nolink] + * fold_left_with_iter[link /reference/algorithm/ranges_fold_left_with_iter.md] - (2) : `r`からイテレータを取得して(1)に委譲 ```cpp @@ -264,7 +264,7 @@ constexpr auto fold_left(I first, S last, T init, F f) { - 範囲の最初の要素を初期値として`fold_left` - [`ranges::fold_right_last`](ranges_fold_right_last.md) - 範囲の最後の要素を初期値として`fold_right` -- [`ranges::fold_left_with_iter`](ranges_fold_left_with_iter.md.nolink) +- [`ranges::fold_left_with_iter`](ranges_fold_left_with_iter.md) - `fold_left`の結果と共に、計算した終端イテレータも返す - [`ranges::fold_left_first_with_iter`](ranges_fold_left_first_with_iter.md.nolink) - `fold_left_first`の結果と共に、計算した終端イテレータも返す diff --git a/reference/algorithm/ranges_fold_left_first.md b/reference/algorithm/ranges_fold_left_first.md index 9bac033d2b..71307ad820 100644 --- a/reference/algorithm/ranges_fold_left_first.md +++ b/reference/algorithm/ranges_fold_left_first.md @@ -150,7 +150,7 @@ int main() { } ``` * fold_left_first[color ff0000] -* fold_left[link ranges_fold_right.md] +* fold_left[link ranges_fold_left.md] * println[link /reference/print/println.md] * value_or[link /reference/optional/optional/value_or.md] @@ -202,7 +202,7 @@ constexpr auto fold_left_first(I first, S last, F f) { - 範囲の右からの`fold` - [`ranges::fold_right_last`](ranges_fold_right_last.md) - 範囲の最後の要素を初期値として`fold_right` -- [`ranges::fold_left_with_iter`](ranges_fold_left_with_iter.md.nolink) +- [`ranges::fold_left_with_iter`](ranges_fold_left_with_iter.md) - `fold_left`の結果と共に、計算した終端イテレータも返す - [`ranges::fold_left_first_with_iter`](ranges_fold_left_first_with_iter.md.nolink) - `fold_left_first`の結果と共に、計算した終端イテレータも返す diff --git a/reference/algorithm/ranges_fold_left_with_iter.md b/reference/algorithm/ranges_fold_left_with_iter.md new file mode 100644 index 0000000000..f582a3bf15 --- /dev/null +++ b/reference/algorithm/ranges_fold_left_with_iter.md @@ -0,0 +1,234 @@ +# fold_left_first +* algorithm[meta header] +* function template[meta id-type] +* std::ranges[meta namespace] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template S, class T, + indirectly-binary-left-foldable F> + constexpr auto fold_left_with_iter(I first, S last, T init, F f); // (1) + + template> F> + constexpr auto fold_left_with_iter(R&& r, T init, F f); // (2) +} +``` +* input_iterator[link /reference/iterator/input_iterator.md] +* sentinel_for[link /reference/iterator/sentinel_for.md] +* indirectly-binary-left-foldable[link ./ranges_fold_left.md] +* input_range[link /reference/ranges/input_range.md] +* iterator_t[link /reference/ranges/iterator_t.md] + +## 概要 + +処理の過程で得られた終端位置を指すイテレータを同時に返す[`fold_left`](./ranges_fold_left.md)。戻り値はイテレータと処理結果のペアとなる。 + +- (1) : 入力としてイテレータ範囲をとるオーバーロード +- (2) : 入力として範囲を直接とるオーバーロード + +## 引数 + +- `first` -- 入力範囲の先頭イテレータ +- `last` -- 入力範囲の番兵(終端イテレータ) +- `r` -- 入力範囲のオブジェクト +- `init` -- 初期値 +- `f` -- 適用する二項演算 + - `f(std::move(init), *first)`のような呼び出しが可能であり、その戻り値型のオブジェクトを`acc`とすると + - `acc = f(std::move(acc), *first)`のような呼び出しも可能である必要がある + +## テンプレートパラメータ制約 + +二項演算(`F`)は初期値・積算値と入力範囲の参照型に対して[`invocable`](/reference/concepts/invocable.md)であることしか求められていない(`regular_invocable`ではない)ため、適用する二項演算は任意の副作用を伴っていても良い。 + +## 戻り値 + +型`U`を次のように取得して + +```cpp +using U = decay_t>>; +``` +* decay_t[link /reference/type_traits/decay.md] +* invoke_result_t[link /reference/type_traits/invoke_result.md] +* iter_reference_t[link /reference/iterator/iter_reference_t.md] + +(1)(2)ともに、以下と等価 + +```cpp +if (first == last) + return {std::move(first), U(std::move(init))}; +U accum = invoke(f, std::move(init), *first); +for (++first; first != last; ++first) + accum = invoke(f, std::move(accum), *first); +return {std::move(first), std::move(accum)}; +``` +* decay_t[link /reference/type_traits/decay.md] +* invoke_result_t[link /reference/type_traits/invoke_result.md] +* iter_reference_t[link /reference/iterator/iter_reference_t.md] +* next[link /reference/iterator/ranges_next.md] +* invoke[link /reference/functional/invoke.md] + +空の入力範囲に対しては初期値`init`を返す。入力範囲によらず、戻り値の1つ目の値(イテレータ値)は渡した範囲の終端イテレータ(`last`/`ranges::end(r)`)と同じ位置を指すイテレータとなる(必ずしも同じ型もしくは同じイテレータにならない)。 + +戻り値型はそれぞれ、`U`を次の様に[`fold_left_with_iter_result`](/reference/algorithm/ranges_in_value_result.md)の2つ目の引数に当てはめた型となる + +```cpp +template S, class T, + indirectly-binary-left-foldable F> +constexpr fold_left_with_iter_result + fold_left_with_iter(I first, S last, T init, F f); + +template> F> +constexpr fold_left_with_iter_result, U> + fold_left_with_iter(R&& r, T init, F f); +``` +* fold_left_with_iter_result[link /reference/algorithm/ranges_in_value_result.md] +* borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] + +1つ目の引数には入力のイテレータ型が当てられる。 + +## 計算量 + +入力範囲`r`(`[first, last)`)の要素数を`N`とすると、正確に`N`回の`f`の適用が行われる。 + +## 備考 + +戻り値の項で使用している`U`は、指定した二項演算を初期値とイテレータによって`f(std::move(init), *first)`のように呼び出した時の戻り値型であり、`fold_left_with_iter()`の処理内部で積算値の型として使用されるものでもある。 + +`fold_left`同様に、`f`は`init`の代わりに`U`の右辺値も受け取れる必要がある。二項演算の呼び出しにおいては、第一引数に初期値もしくは積算値が渡され、第二引数にイテレータの間接参照結果が直接渡される。そして、二項演算の適用結果は積算値を保存する変数に直接代入される(つまり、結果を次のステップに引き継ぎたい場合は積算処理も二項演算内で行う必要がある)。詳細は下の実装例を参照。 + +## 例 + +### 基本的な数値集計処理の例 + +```cpp example +#include +#include +#include +#include +#include + +using namespace std::ranges; + +int main() { + // 入力 + range auto rng = views::iota(1, 11); + // 初期値 + const int init = 0; + // 二項演算 + auto op = std::plus<>{}; + + auto [end1, resl] = fold_left_with_iter(rng, init, op); + + std::println("{{ {:s}, {:d} }}", end1 == end(rng), resl); + + + // 入力範囲はfloatのvector + std::vector rngf = { 0.125f, 0.25f, 0.75f }; + + // 計算結果はfloat + auto [end2, reslf] = fold_left_with_iter(rngf, init, op); + + std::println("{{ {:s}, {:g} }}", end2 == end(rngf), reslf); +} +``` +* fold_left_with_iter[color ff0000] +* iota[link /reference/ranges/iota_view.md] +* plus[link /reference/functional/plus.md] +* println[link /reference/print/println.md] + +### 出力 +``` +{ true, 55 } +{ true, 1.125 } +``` + +### 空の入力範囲に対する動作の例 + +```cpp example +#include +#include +#include +#include +#include + +using namespace std::ranges; + +int main() { + range auto rng = views::empty; + const int init = -1; + auto op = std::plus<>{}; + + auto res1 = fold_left(rng, init, op); + auto res2 = fold_left_first(rng, op); + auto [_, res3] = fold_left_with_iter(rng, init, op); + + std::println("{:d}", res1); + std::println("{:d}", res2.value_or(-1)); + std::println("{:d}", res3); +} +``` +* fold_left_with_iter[color ff0000] +* fold_left[link ranges_fold_left.md] +* fold_left_first[link ranges_fold_left_first.md] +* println[link /reference/print/println.md] +* value_or[link /reference/optional/optional/value_or.md] + +### 出力 +``` +-1 +-1 +-1 +``` + +## 実装例 + +```cpp +template S, class T, + indirectly-binary-left-foldable F> +constexpr auto fold_left_with_iter(I first, S last, F f) -> fold_left_with_iter_result { + using U = decay_t>>; + + if (first == last) { + return {std::move(first), U(std::move(init))}; + } + + U accum = invoke(f, std::move(init), *first); + + ++first; + + for (; first != last; ++first) { + accum = invoke(f, std::move(accum), *first); + } + + return {std::move(first), std::move(accum)}; +} +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 5 + +## 関連項目 + +- [`ranges::fold_left`](ranges_fold_left.md) + - 範囲の左からの`fold` +- [`ranges::fold_right`](ranges_fold_right.md) + - 範囲の右からの`fold` +- [`ranges::fold_left_first`](ranges_fold_left_first.md) + - 範囲の最初の要素を初期値として`fold_left` +- [`ranges::fold_right_last`](ranges_fold_right_last.md) + - 範囲の最後の要素を初期値として`fold_right` +- [`ranges::fold_left_first_with_iter`](ranges_fold_left_first_with_iter.md.nolink) + - `fold_left_first`の結果と共に、計算した終端イテレータも返す + +## 参照 + +- [P2322R6 `ranges::fold`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2322r6.html) diff --git a/reference/algorithm/ranges_fold_right.md b/reference/algorithm/ranges_fold_right.md index b6bd5625eb..933c272869 100644 --- a/reference/algorithm/ranges_fold_right.md +++ b/reference/algorithm/ranges_fold_right.md @@ -300,7 +300,7 @@ constexpr auto fold_right(I first, S last, T init, F f) { - 範囲の最初の要素を初期値として`fold_left` - [`ranges::fold_right_last`](ranges_fold_right_last.md) - 範囲の最後の要素を初期値として`fold_right` -- [`ranges::fold_left_with_iter`](ranges_fold_left_with_iter.md.nolink) +- [`ranges::fold_left_with_iter`](ranges_fold_left_with_iter.md) - `fold_left`の結果と共に、計算した終端イテレータも返す - [`ranges::fold_left_first_with_iter`](ranges_fold_left_first_with_iter.md.nolink) - `fold_left_first`の結果と共に、計算した終端イテレータも返す diff --git a/reference/algorithm/ranges_fold_right_last.md b/reference/algorithm/ranges_fold_right_last.md index 6491ba9fcd..30d0b7f6d8 100644 --- a/reference/algorithm/ranges_fold_right_last.md +++ b/reference/algorithm/ranges_fold_right_last.md @@ -215,7 +215,7 @@ constexpr auto fold_right_last(I first, S last, F f) { - 範囲の右からの`fold` - [`ranges::fold_left_first`](ranges_fold_left_first.md) - 範囲の最初の要素を初期値として`fold_left` -- [`ranges::fold_left_with_iter`](ranges_fold_left_with_iter.md.nolink) +- [`ranges::fold_left_with_iter`](ranges_fold_left_with_iter.md) - `fold_left`の結果と共に、計算した終端イテレータも返す - [`ranges::fold_left_first_with_iter`](ranges_fold_left_first_with_iter.md.nolink) - `fold_left_first`の結果と共に、計算した終端イテレータも返す diff --git a/reference/algorithm/ranges_in_value_result.md b/reference/algorithm/ranges_in_value_result.md new file mode 100644 index 0000000000..1cc5d96778 --- /dev/null +++ b/reference/algorithm/ranges_in_value_result.md @@ -0,0 +1,87 @@ +# in_value_result +* algorithm[meta header] +* std::ranges[meta namespace] +* class[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + // (1) + template + struct in_value_result { + [[no_unique_address]] I in; + [[no_unique_address]] T value; + + template + requires convertible_to && + convertible_to + constexpr operator in_value_result() const & { + return {in, value}; + } + + template + requires convertible_to && + convertible_to + constexpr operator in_value_result() && { + return {std::move(in), std::move(value)}; + } + }; + + // (2) + template + using fold_left_with_iter_result = in_value_result; + + // (3) + template + using fold_left_first_with_iter_result = in_value_result; +} +``` +* no_unique_address[link /lang/cpp20/language_support_for_empty_objects.md] +* convertible_to[link /reference/concepts/convertible_to.md] +* std::move[link /reference/utility/move.md] + +## 概要 + +* (1): イテレータと値を格納する型 +* (2): [`ranges::fold_left_with_iter`](/reference/algorithm/ranges_fold_left_with_iter.md)で使用するエイリアス +* (3): [`ranges::fold_left_first_with_iter`](/reference/algorithm/ranges_fold_left_first_with_iter.md.nolink)で使用するエイリアス + +この型は、関数が入力用に範囲を受け取る場合に、処理した範囲の末尾と、それとは別の出力を返すために使用される。 + +標準アルゴリズム関数ではこの型を直接返す代わりに、関数毎にエイリアスを定義している。 + + +## メンバ変数 + +| 名前 | 説明 | 対応バージョン | +| ------------------------------- | -------------------- | -------------- | +| `[[no_unique_address]] I in` | 読み込んだ範囲の終端位置 | C++23 | +| `[[no_unique_address]] T value` | イテレータとは別の値 | C++23 | + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +| ----------------------------------- | ---------- | -------------- | +| `operator in_value_result` | 変換演算子 | C++23 | + +変換演算子は、各テンプレートパラメーターが変換できる場合のみオーバーロード解決に参加する。 + +## 例 +(執筆中) + +### 出力 +(執筆中) + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 5 + +## 参照 + +- [P2322R6 `ranges::fold`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2322r6.html) From 379e1b05ec7f555ea67fc7e36918b526f295f11f Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 6 Feb 2024 16:18:31 +0900 Subject: [PATCH 0704/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE?= =?UTF-8?q?=E9=A3=BE=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_fold_left_with_iter.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/reference/algorithm/ranges_fold_left_with_iter.md b/reference/algorithm/ranges_fold_left_with_iter.md index f582a3bf15..f12e692ac6 100644 --- a/reference/algorithm/ranges_fold_left_with_iter.md +++ b/reference/algorithm/ranges_fold_left_with_iter.md @@ -63,10 +63,6 @@ for (++first; first != last; ++first) accum = invoke(f, std::move(accum), *first); return {std::move(first), std::move(accum)}; ``` -* decay_t[link /reference/type_traits/decay.md] -* invoke_result_t[link /reference/type_traits/invoke_result.md] -* iter_reference_t[link /reference/iterator/iter_reference_t.md] -* next[link /reference/iterator/ranges_next.md] * invoke[link /reference/functional/invoke.md] 空の入力範囲に対しては初期値`init`を返す。入力範囲によらず、戻り値の1つ目の値(イテレータ値)は渡した範囲の終端イテレータ(`last`/`ranges::end(r)`)と同じ位置を指すイテレータとなる(必ずしも同じ型もしくは同じイテレータにならない)。 From e49fbcde3004f58406691422d24faca22abad380 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 6 Feb 2024 16:23:57 +0900 Subject: [PATCH 0705/3948] =?UTF-8?q?=E3=82=BF=E3=82=A4=E3=83=88=E3=83=AB?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_fold_left_with_iter.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/algorithm/ranges_fold_left_with_iter.md b/reference/algorithm/ranges_fold_left_with_iter.md index f12e692ac6..8ad351294a 100644 --- a/reference/algorithm/ranges_fold_left_with_iter.md +++ b/reference/algorithm/ranges_fold_left_with_iter.md @@ -1,4 +1,4 @@ -# fold_left_first +# fold_left_with_iter * algorithm[meta header] * function template[meta id-type] * std::ranges[meta namespace] From 979afd4bdb032f5d70b4660f127510ebdad01e2e Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 7 Feb 2024 01:09:31 +0900 Subject: [PATCH 0706/3948] mdspan: submdspan_extents(#1201) --- reference/mdspan.md | 2 +- reference/mdspan/first_.md | 4 +- reference/mdspan/src-indices.md | 12 +-- reference/mdspan/submdspan.md | 11 ++- reference/mdspan/submdspan_extents.md | 131 ++++++++++++++++++++++++++ 5 files changed, 143 insertions(+), 17 deletions(-) create mode 100644 reference/mdspan/submdspan_extents.md diff --git a/reference/mdspan.md b/reference/mdspan.md index 2172e1699a..ce88e36f22 100644 --- a/reference/mdspan.md +++ b/reference/mdspan.md @@ -44,7 +44,7 @@ | [`full_extent_t`](mdspan/full_extent_t.md) | 指定次元の全要素取り出しを指示するタグ型 (class) | C++26 | | [`full_extent`](mdspan/full_extent_t.md) | 指定次元の全要素取り出しを指示するタグ値 (variable) | C++26 | | [`submdspan_mapping_result`](mdspan/submdspan_mapping_result.md) | 多次元配列部分ビューのレイアウトマッピング情報 (class template) | C++26 | -| [`submdspan_extents`](mdspan/submdspan_extents.md.nolink) | 多次元配列部分ビューの多次元配列サイズを計算する (function template) | C++26 | +| [`submdspan_extents`](mdspan/submdspan_extents.md) | 多次元配列部分ビューの多次元配列サイズを計算する (function template) | C++26 | | [`submdspan`](mdspan/submdspan.md) | 多次元配列部分ビューを取得する (function template) | C++26 | diff --git a/reference/mdspan/first_.md b/reference/mdspan/first_.md index 0a5dc8dd1d..7bc26f57d8 100644 --- a/reference/mdspan/first_.md +++ b/reference/mdspan/first_.md @@ -13,8 +13,8 @@ constexpr IndexType first_(SliceSpecifiers... slices); `S_k`を`SliceSpecifiers`の`k`番目の型、`s_k`を`slices`の`k`番目の値としたとき、説明用の`P_k`の値を次のように定義する。 -- 型`S_k`が[`convertible_to`](/reference/concepts/convertible_to.md)``のモデルのとき`s_k`、そうでなければ -- 型`S_k`が[`index-pair-like`](index-pair-like.md)``のモデルのとき`get<0>(s_k)`、そうでなければ +- 型`S_k`が[`convertible_to`](/reference/concepts/convertible_to.md)``のモデルのとき`s_k`、そうでなければ +- 型`S_k`が[`index-pair-like`](index-pair-like.md)``のモデルのとき`get<0>(s_k)`、そうでなければ - 型`S_k`が[`strided_slice`](strided_slice.md)の特殊化のとき[`de-ice`](de-ice.md)`(s_k.offset)`、そうでなければ - 値`0` diff --git a/reference/mdspan/src-indices.md b/reference/mdspan/src-indices.md index f93730159d..55ace153e2 100644 --- a/reference/mdspan/src-indices.md +++ b/reference/mdspan/src-indices.md @@ -13,22 +13,16 @@ constexpr array ## 概要 `src-indices`は[`submdspan`](submdspan.md)動作説明用の関数テンプレートである。 -説明のため`rank`を`slices`の要素数、`S_k`を`SliceSpecifiers`の`k`番目の型とする -[`array`](/reference/array/array.md)``型の配列`map-rank`を導入し、その要素`map-rank[k]`を下記の通り定義する。 - -- 型`S_k`が[`convertible_to`](/reference/concepts/convertible_to.md)``のモデルのとき[`dynamic_extent`](/reference/span/dynamic_extent.md)、そうでなければ -- `j < k`において型`S_j`が[`convertible_to`](/reference/concepts/convertible_to.md)``のモデルではない個数 - ## 適格要件 `IndexType`は符号付き整数型または符号無し整数型であること。 ## 戻り値 -半開区間`[0, rank)`の`k`に対して、`k`番目の要素が下記の値を持つ配列を返す。 +半開区間`[0, sizeof...(SliceSpecifiers))`の`k`に対して、`k`番目の要素が下記の値を持つ配列を返す。 -- `map-rank[k]`が[`dynamic_extent`](/reference/span/dynamic_extent.md)に等しいとき、[`first_`](first_.md)`(slices...)` -- そうでなければ、[`first_`](first_.md)`(slices...) + indices[map-rank[k]]` +- [`map-rank[k]`](submdspan_extents.md)が[`dynamic_extent`](/reference/span/dynamic_extent.md)に等しいとき、[`first_`](first_.md)`(slices...)` +- そうでなければ、[`first_`](first_.md)`(slices...) + indices[`[`map-rank[k]`](submdspan_extents.md)`]` ## バージョン diff --git a/reference/mdspan/submdspan.md b/reference/mdspan/submdspan.md index 6ca3ad68f1..f888eace84 100644 --- a/reference/mdspan/submdspan.md +++ b/reference/mdspan/submdspan.md @@ -45,8 +45,8 @@ namespace std { 説明用の型`index_type`を[`Extents::index_type`](extents.md)、変数`sub_map_offset`を`submdspan_mapping(`[`src.mapping()`](mdspan/mapping.md)`, slices...)`の結果としたとき、 - 型`decltype(submdspan_mapping(`[`src.mapping()`](mdspan/mapping.md)`, slices...))`が[`submdspan_mapping_result`](submdspan_mapping_result.md)の特殊化であり、 -- [`is_same_v`](/reference/type_traits/is_same.md)`<`[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`, decltype(`[`submdspan_extents`](submdspan_extents.md.nolink)`(`[`src.mapping()`](mdspan/mapping.md)`, slices...))>`が`true`、かつ -- [`src.extents()`](mdspan/extents.md)の各次元インデクス`k`において、`S_k`を`SliceSpecifiers`の`k`番目の型としたき、下記いずれかの1つのみを満たすこと。 +- [`is_same_v`](/reference/type_traits/is_same.md)`<`[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`, decltype(`[`submdspan_extents`](submdspan_extents.md)`(`[`src.mapping()`](mdspan/mapping.md)`, slices...))>`が`true`、かつ +- [`src.extents()`](mdspan/extents.md)の各次元インデクス`k`において、`S_k`を`SliceSpecifiers`の`k`番目の型としたき、下記いずれかのうち1つだけを満たすこと。 - 型`S_k`が[`convertible_to`](/reference/concepts/convertible_to.md)``のモデル - 型`S_k`が[`index-pair-like`](index-pair-like.md)``のモデル - [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` @@ -58,8 +58,8 @@ namespace std { - 型`S_k`が[`strided_slice`](strided_slice.md)の特殊化のとき - `s_k.extent == 0`、または - `s_k.stride > 0` - - `0` ≤ [`first_`](first_.md)`(slices...)` ≤ [`last_`](last_.md)`(`[`src.extents()`](mdspan/extents.md)`, slices...)` ≤ [`src.extent(k)`](mdspan/extent.md) -- [`sub_map_offset.mapping`](submdspan_mapping_result.md)`.extents() ==` [`submdspan_extents`](submdspan_extents.md.nolink)`(`[`src.mapping()`](mdspan/mapping.md)`, slices...)`が`true`、かつ + - `0` ≤ [`first_`](first_.md)`(slices...)` ≤ [`last_`](last_.md)`(`[`src.extents()`](mdspan/extents.md)`, slices...)` ≤ [`src.extent(k)`](mdspan/extent.md) +- [`sub_map_offset.mapping`](submdspan_mapping_result.md)`.extents() ==` [`submdspan_extents`](submdspan_extents.md)`(`[`src.mapping()`](mdspan/mapping.md)`, slices...)`が`true`、かつ - [`sub_map_offset.mapping`](submdspan_mapping_result.md)`.extents()`の多次元インデクス値を表す任意の整数パック`I`に対して、`sub_map_offset.mapping(I...) +` [`sub_map_offset.offset`](submdspan_mapping_result.md) `==` [`src.mapping()`](mdspan/mapping.md)`(`[`src-indices`](src-indices.md)`(`[`array`](/reference/array/array.md)`{I...}, slices...))`が`true`であること。 @@ -68,13 +68,14 @@ namespace std { ```cpp auto sub_map_offset = submdspan_mapping(src.mapping(), slices...); -return mdspan(src.accessor().offset(src.data(), sub_map_offset.offset), +return mdspan(src.accessor().offset(src.data_handle(), sub_map_offset.offset), sub_map_offset.mapping, AccessorPolicy::offset_policy(src.accessor())); ``` * mdspan[link mdspan.md] * sub_map_offset[link submdspan_mapping_result.md] * src.mapping()[link mdspan/mapping.md] +* src.data_handle()[link mdspan/mapping.md] * src.accessor()[link mdspan/accessor.md] * AccessorPolicy::offset_policy[link AccessorPolicy.md] diff --git a/reference/mdspan/submdspan_extents.md b/reference/mdspan/submdspan_extents.md new file mode 100644 index 0000000000..bcdf8b9db9 --- /dev/null +++ b/reference/mdspan/submdspan_extents.md @@ -0,0 +1,131 @@ +# submdspan_extents +* mdspan[meta header] +* function template[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std { + template + constexpr auto submdspan_extents(const extents& src, SliceSpecifiers ... slices); +} +``` +* extents[link extents.md] + +## 概要 +多次元配列サイズ[`extents`](extents.md)と各次元からの要素取り出し(スライス)方式を指定して、新しい多次元配列サイズ[`extents`](extents.md)を取得する。 + +### 動作説明用 +- 型`S_k` : `SliceSpecifiers`の`k`番目の型 +- 値`s_k` : `slices`の`k`番目の値 +- 値`map-rank` : `k`番目の要素`map-rank[k]`が下記を満たす、[`array`](/reference/array/array.md)``型の配列値 + - 型`S_k`が[`convertible_to`](/reference/concepts/convertible_to.md)``のモデルのとき[`dynamic_extent`](/reference/span/dynamic_extent.md)、そうでなければ + - `j < k`において型`S_j`が[`convertible_to`](/reference/concepts/convertible_to.md)``のモデルではない個数 + +動作説明用の配列`map-rank[]`は、変換元の次元インデクス`k`から変換先の次元インデクスへの対応関係を表現している。要素値`dynamic_extent`は変換により削減される次元を表す。 + + +## テンプレートパラメータ制約 +`sizeof...(slices)`が`Extents::rank()`と等しいこと。 + + +## 適格要件 +`src`の各次元インデクス`k`に対して、下記いずれかのうち1つだけを満たすこと。 + +- 型`S_k`が[`convertible_to`](/reference/concepts/convertible_to.md)``のモデル +- 型`S_k`が[`index-pair-like`](index-pair-like.md)``のモデル +- [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` +- 型`S_k`が[`strided_slice`](strided_slice.md)の特殊化 + + +## 事前条件 +`src`の各次元インデクス`k`に対して、下記を全て満たすこと。 + +- 型`S_k`が[`strided_slice`](strided_slice.md)の特殊化のとき + - `s_k.extent == 0`、または + - `s_k.stride > 0` +- `0` ≤ [`first_`](first_.md)`(slices...)` ≤ [`last_`](last_.md)`(src, slices...)` ≤ [`src.extent(k)`](extents/extent.md) + + +## 戻り値 +説明用の型`SubExtents`を、下記を満たす[`extents`](extents.md)の特殊化とする。 + +- [`SubExtents::rank()`](extents/rank.md)は、型`S_k`が[`convertible_to`](/reference/concepts/convertible_to.md)``のモデルではない`k`の個数に等しく、かつ +- `map-rank[k] !=` [`dynamic_extent`](/reference/span/dynamic_extent.md)を満たす`Extents`の次元インデクス`k`について、[`SubExtents::static_extent`](extents/static_extent.md)`(map-rank[k])`が下記と等しいこと + - [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true`のとき、[`SubExtents::static_extent`](extents/static_extent.md)`(k)`、そうでなければ、 + - 型`S_k`が[`index-pair-like`](index-pair-like.md)のモデルかつ`tuple_element_t<0, S_k>`および`tuple_element_t<1, S_k>`がいずれも[`integral-constant-like`](integral-constant-like.md)のモデルであるとき、[`de-ice`](de-ice.md)`(tuple_element_t<1, S_k>) -` [`de-ice`](de-ice.md)`(tuple_element_t<0, S_k>)`、そうでなければ + - 型`S_k`が[`strided_slice`](strided_slice.md)の特殊化かつメンバ型`extent_type`が`S_k::extent_type() == 0`かつ[`integral-constant-like`](integral-constant-like.md)のモデルであるとき、値`0`、そうでなければ + - 型`S_k`が[`strided_slice`](strided_slice.md)の特殊化かつメンバ型`extent_type`および`stride_type`がいずれも[`integral-constant-like`](integral-constant-like.md)のモデルであるとき、`1 + (`[`de-ice`](de-ice.md)`(S_k::extent_type()) - 1) /` [`de-ice`](de-ice.md)`(S_k::stride_type())`、そうでなければ + - [`dynamic_extent`](/reference/span/dynamic_extent.md) + +以下を満たす`SubExtents`型の値`ext`を返す。 + +- `map-rank[k] !=` [`dynamic_extent`](/reference/span/dynamic_extent.md)を満たす次元インデクス`k`について、[`ext.extent`](extents/extent.md)`(map-rank[k])`が下記に等しいこと + - 型`S_k`が[`strided_slice`](strided_slice.md)の特殊化であるとき、`s_k.extent == 0 ? 0 : 1 + (`[`de-ice`](de-ice.md)`(s_k.extent) - 1) /` [`de-ice`](de-ice.md)`(s_k.stride)` + - そうでなければ、[`last_`](last_.md)`(src, slices...) -` [`first_`](first_.md)`(slices...)` + + +## 例 +```cpp example +#include +#include +#include +#include + +template +constexpr auto Int = std::integral_constant{}; + +int main() +{ + std::extents exts{}; + + auto ext0 = std::submdspan_extents(exts, 0); + static_assert(std::same_as>); + + auto ext1 = std::submdspan_extents(exts, std::full_extent); + static_assert(std::same_as>); + + auto ext2 = std::submdspan_extents(exts, std::pair{Int<2>, Int<8>}); + static_assert(std::same_as>); + + auto ext3 = std::submdspan_extents(exts, std::strided_slice{0, Int<0>, 1}); + static_assert(std::same_as>); + assert(ext3.extent(0) == 0); + + auto ext4 = std::submdspan_extents(exts, std::strided_slice{0, Int<10>, Int<3>}); + static_assert(std::same_as>); + + auto ext5 = std::submdspan_extents(exts, std::pair{2, 8}); + static_assert(std::same_as>); + assert(ext5.extent(0) == 6); +} +``` +* std::submdspan_extents[color ff0000] +* std::full_extent[link full_extent_t.md] +* std::strided_slice[link strided_slice.md] +* std::integral_constant[link /reference/type_traits/integral_constant.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`submdspan`](submdspan.md) +- [`full_extent`](full_extent_t.md) +- [`strided_slice`](strided_slice.md) + + +## 参照 +- [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) From c7c70e6bc9b62d293679e86936ad8841fb2b802e Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 7 Feb 2024 10:22:16 +0900 Subject: [PATCH 0707/3948] =?UTF-8?q?fold=5Fleft=5Fwith=5Fiter=20:=20?= =?UTF-8?q?=E5=AE=9F=E8=A3=85=E4=BE=8B=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_fold_left_with_iter.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/reference/algorithm/ranges_fold_left_with_iter.md b/reference/algorithm/ranges_fold_left_with_iter.md index 8ad351294a..c938670c29 100644 --- a/reference/algorithm/ranges_fold_left_with_iter.md +++ b/reference/algorithm/ranges_fold_left_with_iter.md @@ -182,10 +182,14 @@ int main() { ## 実装例 ```cpp +template +using R = decay_t>>; + + template S, class T, indirectly-binary-left-foldable F> -constexpr auto fold_left_with_iter(I first, S last, F f) -> fold_left_with_iter_result { - using U = decay_t>>; +constexpr auto fold_left_with_iter(I first, S last, T init, F f) -> fold_left_with_iter_result> { + using U = R; if (first == last) { return {std::move(first), U(std::move(init))}; From 256984fd4498514958ec15475b08d549cdc2ac35 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 7 Feb 2024 13:26:14 +0900 Subject: [PATCH 0708/3948] =?UTF-8?q?=E3=82=B9=E3=83=9D=E3=83=B3=E3=82=B5?= =?UTF-8?q?=E3=83=BC=E6=9B=B4=E6=96=B0=20#1248?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.md b/index.md index 2959ac087b..5d0ae89a47 100644 --- a/index.md +++ b/index.md @@ -120,6 +120,8 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい
yukika2e
+- [ugai様](https://opencollective.com/ugai) + スポンサーシップについては、以下のページを参照ください。 From 893d77ede567736434e6b5539972527755df0a99 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 7 Feb 2024 19:53:39 +0900 Subject: [PATCH 0709/3948] =?UTF-8?q?C++23=20:=20=E3=80=8C=E7=B6=99?= =?UTF-8?q?=E6=89=BF=E3=82=B3=E3=83=B3=E3=82=B9=E3=83=88=E3=83=A9=E3=82=AF?= =?UTF-8?q?=E3=82=BF=E3=81=8B=E3=82=89=E3=81=AE=E3=82=AF=E3=83=A9=E3=82=B9?= =?UTF-8?q?=E3=83=86=E3=83=B3=E3=83=97=E3=83=AC=E3=83=BC=E3=83=88=E5=BC=95?= =?UTF-8?q?=E6=95=B0=E3=81=AE=E6=8E=A8=E8=AB=96=E3=80=8D=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=20(close=20#1035)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- .../type_deduction_for_class_templates.md | 1 + lang/cpp23.md | 2 +- ...plate_argument_deduction_from_inherited.md | 62 +++++++++++++++++++ 4 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 lang/cpp23/class_template_argument_deduction_from_inherited.md diff --git a/implementation-status.md b/implementation-status.md index b4d0ba3534..e21483f32a 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -264,7 +264,7 @@ | P2362R3: [1ワイド文字に収まらないワイド文字リテラルを禁止する](/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md) | エンコード結果として`wchar_t`の大きさに収まらないワイド文字リテラルを禁止する | 13 | 14 | 2023.2 | - | | P2071R2: [名前付きユニバーサルキャラクタ名](/lang/cpp23/named_universal_character_escapes.md) | 16進数のユニバーサルキャラクタだけでなく、その文字の名前を入力できるようにする | 13 | 15 | 2023.2 | - | | P2096R2: [部分特殊化の汎用化仕様](/lang/cpp23/generalized_wording_for_partial_specializations.md.nolink) | 変数テンプレートの部分特殊化を許可するために部分特殊化の仕様を汎用化 | - | - | - | - | -| P2582R1: [継承コンストラクタからのクラステンプレート引数の推論](/lang/cpp23/class_template_argument_deduction_from_inherited.md.nolink) | | - | - | - | - | +| P2582R1: [継承コンストラクタからのクラステンプレート引数の推論](/lang/cpp23/class_template_argument_deduction_from_inherited.md) | 継承コンストラクタからもクラステンプレート引数を推論できるようにする | - | - | - | - | | P1938R3: [`if consteval`](/lang/cpp23/if_consteval.md.nolink) | コンパイル時の文脈かどうかで分岐させる | 12 | 14 | - | - | | P1401R5: [定数式の文脈での`bool`への縮小変換を許可](/lang/cpp23/narrowing_contextual_conversions_to_bool.md.nolink) | `if constexpr(flags & Flags::Exec)`や`static_assert(N);`を許可 | 9 | 13 | 2022.2 | - | | P2242R3: [定数式内での非リテラル変数、静的変数・スレッドローカル変数およびgotoとラベルの存在を許可する](/lang/cpp23/non_literal_variables_in_constexpr_functions.md) | コンパイル時に評価されない限り、定数式内に静的変数・スレッドローカル変数およびgoto文とラベルを含むことを許可する | 12 | 15 | 2022.2 | - | diff --git a/lang/cpp17/type_deduction_for_class_templates.md b/lang/cpp17/type_deduction_for_class_templates.md index 0d71bf481b..2e108d1cc8 100644 --- a/lang/cpp17/type_deduction_for_class_templates.md +++ b/lang/cpp17/type_deduction_for_class_templates.md @@ -283,6 +283,7 @@ int main() - `std::array`の推論補助からは、非トリビアルなコンストラクタを持たないクラステンプレートであっても、推論補助を定義できることがわかる。ただし、配列の要素型を推論するためには、推論しない場合とは違った制限が必要となる - [C++20 集成体クラステンプレートのテンプレート引数推論](/lang/cpp20/class_template_argument_deduction_for_aggregates.md) - [C++20 エイリアステンプレート経由でのクラステンプレートのテンプレート引数推論](/lang/cpp20/class_template_argument_deduction_for_alias_templates.md) +- [C++23 継承コンストラクタからのクラステンプレート引数の推論](/lang/cpp23/class_template_argument_deduction_from_inherited.md) ## 参照 diff --git a/lang/cpp23.md b/lang/cpp23.md index 9668a800ac..cf0601ec9b 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -60,7 +60,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| | [部分特殊化の汎用化仕様](cpp23/generalized_wording_for_partial_specializations.md.nolink) | 変数テンプレートの部分特殊化を許可するために部分特殊化の仕様を汎用化 | -| [継承コンストラクタからのクラステンプレート引数の推論](cpp23/class_template_argument_deduction_from_inherited.md.nolink) | | +| [継承コンストラクタからのクラステンプレート引数の推論](cpp23/class_template_argument_deduction_from_inherited.md) | 継承コンストラクタからもクラステンプレート引数を推論できるようにする | ### 定数式 diff --git a/lang/cpp23/class_template_argument_deduction_from_inherited.md b/lang/cpp23/class_template_argument_deduction_from_inherited.md new file mode 100644 index 0000000000..db16325035 --- /dev/null +++ b/lang/cpp23/class_template_argument_deduction_from_inherited.md @@ -0,0 +1,62 @@ +# 継承コンストラクタからのクラステンプレート引数の推論 +* cpp23[meta cpp] + +## 概要 +C++23では、派生クラスで定義した継承コンストラクタからでも、クラステンプレート引数を推論できるようになる。 + + +基本的な例: + +```cpp +template +struct B { + B(T); +}; + +template +struct C : public B { + using B::B; +}; + +template +struct D : public B {}; + +C c(42); // C++23:OK, Cに推論される +D d(42); // エラー!推論失敗。推論補助が継承されていない + +B(int) -> B; // 推論補助を追加定義 +C c2(42); // OK。Cに推論される + +template +struct E : public B { + using B::B; +}; + +E e(42); // エラー!推論失敗。Eのテンプレート引数を推論補助から推論できない +``` + + +派生クラスもテンプレート引数をもつ場合: + +```cpp +template +struct F { + F(T, U, V); +}; + +template +struct G : F { + using G::F::F; +}; + +G g(true, 'a', 1); // OK。Gに推論される +``` + + +## 関連項目 +- [C++11 継承コンストラクタ](/lang/cpp11/inheriting_constructors.md) +- [C++17 クラステンプレートのテンプレート引数推論](/lang/cpp17/type_deduction_for_class_templates.md) + + +## 参照 +- [P2582R1 Wording for class template argument deduction from inherited constructors](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2582r1.pdf) From ab80c5253fe535d283fa9f6b71c60bd2f14c9281 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 8 Feb 2024 13:46:57 +0900 Subject: [PATCH 0710/3948] =?UTF-8?q?C++23=20:=20=E3=80=8Celif/elifdef/eli?= =?UTF-8?q?fndef=E3=81=AE=E3=82=B5=E3=83=9D=E3=83=BC=E3=83=88=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E3=80=8D=20(close=20#1045)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp23.md | 2 +- ...cessing_directives_elifdef_and_elifndef.md | 31 +++++++++++++++++++ 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md diff --git a/implementation-status.md b/implementation-status.md index e21483f32a..ef5e12f0b3 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -276,7 +276,7 @@ | P2173R1: [ラムダ式に対する属性](/lang/cpp23/attributes_on_lambda_expressions.md) | ラムダ式のいくつかの箇所に属性を記述できるようにする | 9 | 13 | 2022.2 | - | | P1774R8: [コード内容の仮定をコンパイラに伝えるassume属性](/lang/cpp23/portable_assumptions.md) | 最適化のために、コードの仮定をコンパイラに伝える属性を標準化する | 13 | - | - | - | | P2316R2: [文字リテラルエンコーディングを一貫させる](/lang/cpp23/consistent_character_literal_encoding.md) | プリプロセッサの条件式での文字リテラルの扱いをC++式と同様にする | yes | yes | 2022.2 | 2022 | -| P2334R1: [`elif`/`elifdef`/`elifndef`のサポートを追加](/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md.nolink) | `#if`/`#ifdef`/`#ifndef`に対応する複数条件命令のサポートを追加する | 12 | 13 | 2022.2 | - | +| P2334R1: [`elif`/`elifdef`/`elifndef`のサポートを追加](/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md) | `#if`/`#ifdef`/`#ifndef`に対応する複数条件命令のサポートを追加する | 12 | 13 | 2022.2 | - | | P2437R1: [`#warning`のサポートを追加](/lang/cpp23/warning.md) | 多くのC++コンパイラが実装していたプリプロセス時の警告`#warning message`を正式サポート | yes | yes | 2023.2 | yes | | P2295R6: [汎用的なソースコードのエンコーディングとしてUTF-8をサポート](/lang/cpp23/support_for_utf8_as_a_portable_source_file_encoding.md.nolink) | | 13 | 15 | 2023.2 | 2019 Update 2 | | P2223R2: [行末スペースを無視するよう規定](/lang/cpp23/trimming_whitespaces_before_line_splicing.md.nolink) | 行末が「\ 」でおわっていた場合にMSVCは行の継続をしない実装になっていたため動作を共通化するため仕様を規定 | Yes | Yes | 2022.2 | - | diff --git a/lang/cpp23.md b/lang/cpp23.md index cf0601ec9b..c7b39d662f 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -96,7 +96,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| | [文字リテラルエンコーディングを一貫させる](cpp23/consistent_character_literal_encoding.md) | プリプロセッサの条件式での文字リテラルの扱いをC++式と同様にする | -| [`elif`/`elifdef`/`elifndef`のサポートを追加](cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md.nolink) | `#if`/`#ifdef`/`#ifndef`に対応する複数条件命令のサポートを追加する | +| [`elif`/`elifdef`/`elifndef`のサポートを追加](cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md) | `#if`/`#ifdef`/`#ifndef`に対応する複数条件命令のサポートを追加する | | [`#warning`のサポートを追加](cpp23/warning.md) | 多くのC++コンパイラが実装していたプリプロセス時の警告`#warning message`を正式サポート | | [汎用的なソースコードのエンコーディングとしてUTF-8をサポート](cpp23/support_for_utf8_as_a_portable_source_file_encoding.md.nolink) | | diff --git a/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md b/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md new file mode 100644 index 0000000000..b7881a9b67 --- /dev/null +++ b/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md @@ -0,0 +1,31 @@ +# elif/elifdef/elifndefのサポートを追加 +* cpp23[meta cpp] + +## 概要 +C++23では、以下のプリプロセス時条件式が追加される: + +- `#if`に対応する`#elif`を追加。`#if`/`#ifdef`/`#ifndef`が偽だった場合の条件式を記述できる +- `#ifdef`に対応する`#elifdef`を追加。`#if`/`#ifdef`/`#ifndef`が偽だった場合の、特定の識別子が定義されているかの判定を記述できる +- `#ifndef`に対応する`#elifndef`を追加。`#if`/`#ifdef`/`#ifndef`が偽だった場合の、特定の識別子が定義されていないかの判定を記述できる + +これまでは`#if`が偽だった場合のさらなる条件式を記述するためには`#else`にネストして`#if`を記述する必要があったが、そのような条件分岐が書きやすくなる。 + +```cpp +#define FOO 2 + +#if FOO == 1 +/* */ +#elif FOO == 2 +/* */ +#elifdef BAR +/* */ +#elifndef HOGE +/* */ +#endif +``` + +これらのプリプロセス命令はC23でも追加されるため、C++でも同じく追加する。 + + +## 参照 +- [P2334R1 Add support for preprocessing directives elifdef and elifndef](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2334r1.pdf) From 296296a525ea431238f52ca03718fe3a72063651 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 8 Feb 2024 14:16:12 +0900 Subject: [PATCH 0711/3948] =?UTF-8?q?C++23=20:=20=E3=80=8C=E8=A1=8C?= =?UTF-8?q?=E6=9C=AB=E3=82=B9=E3=83=9A=E3=83=BC=E3=82=B9=E3=82=92=E7=84=A1?= =?UTF-8?q?=E8=A6=96=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E8=A6=8F=E5=AE=9A?= =?UTF-8?q?=E3=80=8D=E3=82=92=E8=BF=BD=E5=8A=A0=20(close=20#1048)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp23.md | 2 +- ...imming_whitespaces_before_line_splicing.md | 61 +++++++++++++++++++ 3 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 lang/cpp23/trimming_whitespaces_before_line_splicing.md diff --git a/implementation-status.md b/implementation-status.md index ef5e12f0b3..fd6d8c7a06 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -279,7 +279,7 @@ | P2334R1: [`elif`/`elifdef`/`elifndef`のサポートを追加](/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md) | `#if`/`#ifdef`/`#ifndef`に対応する複数条件命令のサポートを追加する | 12 | 13 | 2022.2 | - | | P2437R1: [`#warning`のサポートを追加](/lang/cpp23/warning.md) | 多くのC++コンパイラが実装していたプリプロセス時の警告`#warning message`を正式サポート | yes | yes | 2023.2 | yes | | P2295R6: [汎用的なソースコードのエンコーディングとしてUTF-8をサポート](/lang/cpp23/support_for_utf8_as_a_portable_source_file_encoding.md.nolink) | | 13 | 15 | 2023.2 | 2019 Update 2 | -| P2223R2: [行末スペースを無視するよう規定](/lang/cpp23/trimming_whitespaces_before_line_splicing.md.nolink) | 行末が「\ 」でおわっていた場合にMSVCは行の継続をしない実装になっていたため動作を共通化するため仕様を規定 | Yes | Yes | 2022.2 | - | +| P2223R2: [行末スペースを無視するよう規定](/lang/cpp23/trimming_whitespaces_before_line_splicing.md) | 行末が「\ 」でおわっていた場合にMSVCは行の継続をしない実装になっていたため動作を共通化するため仕様を規定 | Yes | Yes | 2022.2 | - | 各処理系のC++23実装状況ページ: diff --git a/lang/cpp23.md b/lang/cpp23.md index c7b39d662f..ffe036098e 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -106,7 +106,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| | [参照するPOSIX規格を更新](cpp23/update_normative_reference_to_posix.md) | 新しいPOSIX規格の機能を標準C++が参照していたため、参照するPOSIX規格のバージョンを更新 | -| [行末スペースを無視するよう規定](cpp23/trimming_whitespaces_before_line_splicing.md.nolink) | 行末が「\ 」でおわっていた場合にMSVCは行の継続をしない実装になっていたため動作を共通化するため仕様を規定 | +| [行末スペースを無視するよう規定](cpp23/trimming_whitespaces_before_line_splicing.md) | 行末が「\ 」でおわっていた場合にMSVCは行の継続をしない実装になっていたため動作を共通化するため仕様を規定 | ## ライブラリ更新の概要 diff --git a/lang/cpp23/trimming_whitespaces_before_line_splicing.md b/lang/cpp23/trimming_whitespaces_before_line_splicing.md new file mode 100644 index 0000000000..d17c4a5491 --- /dev/null +++ b/lang/cpp23/trimming_whitespaces_before_line_splicing.md @@ -0,0 +1,61 @@ +# 行末スペースを無視するよう規定 +* cpp23[meta cpp] + +## 概要 +`\` (バックスラッシュ) 後の行末スペースを無視するよう規定する。 + +これにより、バックスラッシュ後の行末スペースの有無でコンパイラによって動作が異なることがなくなる。 + + +## この機能が必要になった背景・経緯 +バックスラッシュから行末までの間のスペースをどう扱うかが、実装 (コンパイラ) によって違いがあった。 + +```cpp example +#include + +int f() { + int i = 1 + // \ + + 42 + ; + return i; +} + +int main() { + std::cout << f() << std::endl; +} +``` + +このコードにおいて「`// \`」のあとにはスペースがあり、EDG (ICCのフロントエンド)、GCC、Clangは行末スペースをトリミング (削除) して関数`f()`は`43`を返すが、MSVCはトリミングせず`1`を返していた。プラットフォーム間の動作差異をなくすために、実装は行末スペースをトリミングしなければならないよう提案することとした。 + +例として、IDEやツール (コードフォーマッタ) はそのような行末スペースを削除する可能性があり、Googleのコーディングスタイルでは行末スペースを禁止している。 + +ただしこの規定が入ることによって、行末スペースに依存したMSVCの既存のコードが互換性をなくす可能性はある (有用性は低いので問題になる可能性は低い)。GCC、Clang、ICCはデフォルトで行末スペースに対して有用な警告を出力していた。 + +行末バックスラッシュを使用した例を紹介する。アスキーアートやダイアグラムをコメントで表現する人々がいる。 + +```cpp example +#include + +int f() { + int hax = 0; + // _ _ + // | | | | + // | |__| | __ ___ __ + // | __ |/ _` \ \/ / + // | | | | (_| |> < + // |_| |_|\__,_/_/\_\ + hax = 1337; + return hax; +} + +int main() { + // 0が出力される。 + // 行末スペースが無視されなければ1337が出力される + std::cout << f() << std::endl; +} +``` + + +## 参照 +- [P2223R2 Trimming whitespaces before line splicing](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2223r2.pdf) From e24da0372c3ec0575ea9cbfe339b496125eb398f Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 9 Feb 2024 00:27:13 +0900 Subject: [PATCH 0712/3948] mdspan: submdspan_mapping(#1201) --- reference/mdspan/layout_left/mapping.md | 2 +- .../layout_left/mapping/submdspan_mapping.md | 87 +++++++++++++++++++ reference/mdspan/layout_right/mapping.md | 2 +- .../layout_right/mapping/submdspan_mapping.md | 87 +++++++++++++++++++ reference/mdspan/layout_stride/mapping.md | 2 +- .../mapping/submdspan_mapping.md | 84 ++++++++++++++++++ reference/mdspan/submdspan.md | 3 + reference/mdspan/submdspan_extents.md | 2 + reference/mdspan/submdspan_mapping_result.md | 2 +- 9 files changed, 267 insertions(+), 4 deletions(-) create mode 100644 reference/mdspan/layout_left/mapping/submdspan_mapping.md create mode 100644 reference/mdspan/layout_right/mapping/submdspan_mapping.md create mode 100644 reference/mdspan/layout_stride/mapping/submdspan_mapping.md diff --git a/reference/mdspan/layout_left/mapping.md b/reference/mdspan/layout_left/mapping.md index 352ea08d49..eb1e7669a8 100644 --- a/reference/mdspan/layout_left/mapping.md +++ b/reference/mdspan/layout_left/mapping.md @@ -76,7 +76,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`submdspan_mapping`](mapping/submdspan_mapping.md.nolink) | [`submdspan`](../submdspan.md)サポート | C++26 | +| [`submdspan_mapping`](mapping/submdspan_mapping.md) | [`submdspan`](../submdspan.md)サポート | C++26 | ### 比較演算子 diff --git a/reference/mdspan/layout_left/mapping/submdspan_mapping.md b/reference/mdspan/layout_left/mapping/submdspan_mapping.md new file mode 100644 index 0000000000..874fe9b30d --- /dev/null +++ b/reference/mdspan/layout_left/mapping/submdspan_mapping.md @@ -0,0 +1,87 @@ +# submdspan_mapping +* mdspan[meta header] +* function template[meta id-type] +* std[meta namespace] +* layout_left::mapping[meta class] +* cpp23[meta cpp] + +```cpp +template +constexpr auto submdspan-mapping-impl( // exposition only + SliceSpecifiers ... slices) const -> see below; + +template +friend constexpr auto submdspan_mapping( + const mapping& src, SliceSpecifiers... slices) +{ + return src.submdspan-mapping-impl(slices...); +} +``` +* see below[italic] +* submdspan-mapping-impl[italic] + +## 概要 +[`submdspan`](../../submdspan.md)関数をサポートするためのカスタマイゼーションポイント。 + +説明用の型`index_type`を[`Extents::index_type`](../../extents.md)、型`S_k`を`SliceSpecifiers`の`k`番目の型とする。 + + +## テンプレートパラメータ制約 +`sizeof...(slices)`が[`Extents::rank()`](../../extents/rank.md)と等しいこと。 + + +## 適格要件 +`extents()`の各次元インデクス`k`において、下記いずれかのうち1つだけを満たすこと。 + +- 型`S_k`が[`convertible_to`](/reference/concepts/convertible_to.md)``のモデル +- 型`S_k`が[`index-pair-like`](../../index-pair-like.md)``のモデル +- [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` +- 型`S_k`が[`strided_slice`](../../strided_slice.md)の特殊化 + + +## 事前条件 +`extents()`の各次元インデクス`k`において、`s_k`を`slices`の`k`番目の値としたとき、下記を全て満たすこと。 + +- 型`S_k`が[`strided_slice`](../../strided_slice.md)の特殊化のとき + - `s_k.extent == 0`、または + - `s_k.stride > 0` +- `0` ≤ [`first_`](../../first_.md)`(slices...)` ≤ [`last_`](../../last_.md)`(extents(), slices...)` ≤ `extents().`[`extent(k)`](../../extents/extent.md) + + +## 戻り値 +説明用の値や型を次の通り定義する。 + +- 値`sub_ext` : 式[`submdspan_extents`](../../submdspan_extents.md)`(extents(), slices...)`の結果 +- 型`SubExtents` : `decltype(sub_ext)` +- 値`sub_strides` : `extents()`の各次元インデクス`k`において、[`map-rank[k]`](../../submdspan_extents.md)が[`dynamic_extent`](/reference/span/dynamic_extent.md)ではない`k`に対し`sub_strides[map-rank[k]]`が下記を満たす、[`array`](/reference/array/array.md)``型の配列値 + - 型`S_k`が[`strided_slice`](../../strided_slice.md)の特殊化かつ`s_k.stride < s_k.extent`の場合、[`stride(k)`](stride.md) `*` [`de-ice`](../../de-ice.md)`(s_k.stride)` + - そうでなければ、[`stride(k)`](stride.md) +- パラメータパック`P` : [`is_same_v`](/reference/type_traits/is_same.md)`<`[`make_index_sequence`](/reference/utility/make_index_sequence.md)`,` [`index_sequence`](/reference/utility/index_sequence.md)`> == true` +- 値`offset` : `size_t`型の値[`(*this)`](op_call.md)`(`[`first_`](../../first_.md)`(slices...)...)` + +説明専用の`submdspan-mapping-impl`関数テンプレートは下記の値を返す。 + +- [`Extents::rank()`](../../extents/rank.md) `== 0`のとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{*this, 0}` +- 以下を満たすとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_left::mapping`](../../layout_left.md)`(sub_ext), offset}` + - 半開区間`[0, SubExtents::rank()-1)`の値`k`に対して、[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true`、かつ + - `SubExtents::rank()-1`に等しい値`k`に対して、型`S_k`が[`index-pair-like`](../../index-pair-like.md)``のモデルもしくは[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` +- [`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_stride::mapping`](../../layout_stride.md)`(sub_ext, sub_strides), offset}` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`submdspan`](../../submdspan.md) + + +## 参照 +- [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) diff --git a/reference/mdspan/layout_right/mapping.md b/reference/mdspan/layout_right/mapping.md index 9106e58bfc..e3c563a702 100644 --- a/reference/mdspan/layout_right/mapping.md +++ b/reference/mdspan/layout_right/mapping.md @@ -76,7 +76,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`submdspan_mapping`](mapping/submdspan_mapping.md.nolink) | [`submdspan`](../submdspan.md)サポート | C++26 | +| [`submdspan_mapping`](mapping/submdspan_mapping.md) | [`submdspan`](../submdspan.md)サポート | C++26 | ### 比較演算子 diff --git a/reference/mdspan/layout_right/mapping/submdspan_mapping.md b/reference/mdspan/layout_right/mapping/submdspan_mapping.md new file mode 100644 index 0000000000..e7669a672d --- /dev/null +++ b/reference/mdspan/layout_right/mapping/submdspan_mapping.md @@ -0,0 +1,87 @@ +# submdspan_mapping +* mdspan[meta header] +* function template[meta id-type] +* std[meta namespace] +* layout_right::mapping[meta class] +* cpp23[meta cpp] + +```cpp +template +constexpr auto submdspan-mapping-impl( // exposition only + SliceSpecifiers ... slices) const -> see below; + +template +friend constexpr auto submdspan_mapping( + const mapping& src, SliceSpecifiers... slices) +{ + return src.submdspan-mapping-impl(slices...); +} +``` +* see below[italic] +* submdspan-mapping-impl[italic] + +## 概要 +[`submdspan`](../../submdspan.md)関数をサポートするためのカスタマイゼーションポイント。 + +説明用の型`index_type`を[`Extents::index_type`](../../extents.md)、型`S_k`を`SliceSpecifiers`の`k`番目の型とする。 + + +## テンプレートパラメータ制約 +`sizeof...(slices)`が[`Extents::rank()`](../../extents/rank.md)と等しいこと。 + + +## 適格要件 +`extents()`の各次元インデクス`k`において、下記いずれかのうち1つだけを満たすこと。 + +- 型`S_k`が[`convertible_to`](/reference/concepts/convertible_to.md)``のモデル +- 型`S_k`が[`index-pair-like`](../../index-pair-like.md)``のモデル +- [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` +- 型`S_k`が[`strided_slice`](../../strided_slice.md)の特殊化 + + +## 事前条件 +`extents()`の各次元インデクス`k`において、`s_k`を`slices`の`k`番目の値としたとき、下記を全て満たすこと。 + +- 型`S_k`が[`strided_slice`](../../strided_slice.md)の特殊化のとき + - `s_k.extent == 0`、または + - `s_k.stride > 0` +- `0` ≤ [`first_`](../../first_.md)`(slices...)` ≤ [`last_`](../../last_.md)`(extents(), slices...)` ≤ `extents().`[`extent(k)`](../../extents/extent.md) + + +## 戻り値 +説明用の値や型を次の通り定義する。 + +- 値`sub_ext` : 式[`submdspan_extents`](../../submdspan_extents.md)`(extents(), slices...)`の結果 +- 型`SubExtents` : `decltype(sub_ext)` +- 値`sub_strides` : `extents()`の各次元インデクス`k`において、[`map-rank[k]`](../../submdspan_extents.md)が[`dynamic_extent`](/reference/span/dynamic_extent.md)ではない`k`に対し`sub_strides[map-rank[k]]`が下記を満たす、[`array`](/reference/array/array.md)``型の配列値 + - 型`S_k`が[`strided_slice`](../../strided_slice.md)の特殊化かつ`s_k.stride < s_k.extent`の場合、[`stride(k)`](stride.md) `*` [`de-ice`](../../de-ice.md)`(s_k.stride)` + - そうでなければ、[`stride(k)`](stride.md) +- パラメータパック`P` : [`is_same_v`](/reference/type_traits/is_same.md)`<`[`make_index_sequence`](/reference/utility/make_index_sequence.md)`,` [`index_sequence`](/reference/utility/index_sequence.md)`> == true` +- 値`offset` : `size_t`型の値[`(*this)`](op_call.md)`(`[`first_`](../../first_.md)`(slices...)...)` + +説明専用の`submdspan-mapping-impl`関数テンプレートは下記の値を返す。 + +- [`Extents::rank()`](../../extents/rank.md) `== 0`のとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{*this, 0}` +- 以下を満たすとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_right::mapping`](../../layout_right.md)`(sub_ext), offset}` + - 半開区間`[Extents::rank() - SubExtents::rank()+1, Extents::rank())`の値`k`に対して、[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true`、かつ + - `Extents::rank()-SubExtents::rank()`に等しい値`k`に対して、型`S_k`が[`index-pair-like`](../../index-pair-like.md)``のモデルもしくは[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` +- [`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_stride::mapping`](../../layout_stride.md)`(sub_ext, sub_strides), offset}` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`submdspan`](../../submdspan.md) + + +## 参照 +- [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) diff --git a/reference/mdspan/layout_stride/mapping.md b/reference/mdspan/layout_stride/mapping.md index 5907bf3675..d387ad12f2 100644 --- a/reference/mdspan/layout_stride/mapping.md +++ b/reference/mdspan/layout_stride/mapping.md @@ -78,7 +78,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`submdspan_mapping`](mapping/submdspan_mapping.md.nolink) | [`submdspan`](../submdspan.md)サポート | C++26 | +| [`submdspan_mapping`](mapping/submdspan_mapping.md) | [`submdspan`](../submdspan.md)サポート | C++26 | ### 比較演算子 diff --git a/reference/mdspan/layout_stride/mapping/submdspan_mapping.md b/reference/mdspan/layout_stride/mapping/submdspan_mapping.md new file mode 100644 index 0000000000..d66c72281e --- /dev/null +++ b/reference/mdspan/layout_stride/mapping/submdspan_mapping.md @@ -0,0 +1,84 @@ +# submdspan_mapping +* mdspan[meta header] +* function template[meta id-type] +* std[meta namespace] +* layout_stride::mapping[meta class] +* cpp23[meta cpp] + +```cpp +template +constexpr auto submdspan-mapping-impl( // exposition only + SliceSpecifiers ... slices) const -> see below; + +template +friend constexpr auto submdspan_mapping( + const mapping& src, SliceSpecifiers... slices) +{ + return src.submdspan-mapping-impl(slices...); +} +``` +* see below[italic] +* submdspan-mapping-impl[italic] + +## 概要 +[`submdspan`](../../submdspan.md)関数をサポートするためのカスタマイゼーションポイント。 + +説明用の型`index_type`を[`Extents::index_type`](../../extents.md)、型`S_k`を`SliceSpecifiers`の`k`番目の型とする。 + + +## テンプレートパラメータ制約 +`sizeof...(slices)`が[`Extents::rank()`](../../extents/rank.md)と等しいこと。 + + +## 適格要件 +`extents()`の各次元インデクス`k`において、下記いずれかのうち1つだけを満たすこと。 + +- 型`S_k`が[`convertible_to`](/reference/concepts/convertible_to.md)``のモデル +- 型`S_k`が[`index-pair-like`](../../index-pair-like.md)``のモデル +- [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` +- 型`S_k`が[`strided_slice`](../../strided_slice.md)の特殊化 + + +## 事前条件 +`extents()`の各次元インデクス`k`において、`s_k`を`slices`の`k`番目の値としたとき、下記を全て満たすこと。 + +- 型`S_k`が[`strided_slice`](../../strided_slice.md)の特殊化のとき + - `s_k.extent == 0`、または + - `s_k.stride > 0` +- `0` ≤ [`first_`](../../first_.md)`(slices...)` ≤ [`last_`](../../last_.md)`(extents(), slices...)` ≤ `extents().`[`extent(k)`](../../extents/extent.md) + + +## 戻り値 +説明用の値や型を次の通り定義する。 + +- 値`sub_ext` : 式[`submdspan_extents`](../../submdspan_extents.md)`(extents(), slices...)`の結果 +- 型`SubExtents` : `decltype(sub_ext)` +- 値`sub_strides` : `extents()`の各次元インデクス`k`において、[`map-rank[k]`](../../submdspan_extents.md)が[`dynamic_extent`](/reference/span/dynamic_extent.md)ではない`k`に対し`sub_strides[map-rank[k]]`が下記を満たす、[`array`](/reference/array/array.md)``型の配列値 + - 型`S_k`が[`strided_slice`](../../strided_slice.md)の特殊化かつ`s_k.stride < s_k.extent`の場合、[`stride(k)`](stride.md) `*` [`de-ice`](../../de-ice.md)`(s_k.stride)` + - そうでなければ、[`stride(k)`](stride.md) +- パラメータパック`P` : [`is_same_v`](/reference/type_traits/is_same.md)`<`[`make_index_sequence`](/reference/utility/make_index_sequence.md)`,` [`index_sequence`](/reference/utility/index_sequence.md)`> == true` +- 値`offset` : `size_t`型の値[`(*this)`](op_call.md)`(`[`first_`](../../first_.md)`(slices...)...)` + +説明専用の`submdspan-mapping-impl`関数テンプレートは下記の値を返す。 + +- [`Extents::rank()`](../../extents/rank.md) `== 0`のとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{*this, 0}` +- [`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_stride::mapping`](../../layout_stride.md)`(sub_ext, sub_strides), offset}` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`submdspan`](../../submdspan.md) + + +## 参照 +- [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) diff --git a/reference/mdspan/submdspan.md b/reference/mdspan/submdspan.md index f888eace84..73d41e563c 100644 --- a/reference/mdspan/submdspan.md +++ b/reference/mdspan/submdspan.md @@ -35,6 +35,9 @@ namespace std { - ストライド・スライス指定 : [`std::strided_slice`](strided_slice.md)の値。オフセット(offset)と要素数(extent)とストライド幅(stride)で指定される要素群を取り出す。 - 全要素指定 : [`std::full_extent`](full_extent_t.md)。指定次元の全要素を取り出す。 +### カスタマイゼーションポイント +`submdspan`関数により[`mdspan`](mdspan.md)から部分ビューを取り出すには、変換元の[レイアウトマッピング型](LayoutMapping.md)がカスタマイゼーションポイント`submdspan_mapping`を実装している必要がある。 + ## テンプレートパラメータ制約 - `sizeof...(slices)`が[`Extents::rank()`](extents/rank.md)と等しく、かつ diff --git a/reference/mdspan/submdspan_extents.md b/reference/mdspan/submdspan_extents.md index bcdf8b9db9..13ba564f84 100644 --- a/reference/mdspan/submdspan_extents.md +++ b/reference/mdspan/submdspan_extents.md @@ -15,6 +15,8 @@ namespace std { ## 概要 多次元配列サイズ[`extents`](extents.md)と各次元からの要素取り出し(スライス)方式を指定して、新しい多次元配列サイズ[`extents`](extents.md)を取得する。 +各次元からの要素取り出し方式は、[`submdspan`](submdspan.md)を参照のこと。 + ### 動作説明用 - 型`S_k` : `SliceSpecifiers`の`k`番目の型 - 値`s_k` : `slices`の`k`番目の値 diff --git a/reference/mdspan/submdspan_mapping_result.md b/reference/mdspan/submdspan_mapping_result.md index 78ec62a1cf..be6cfcd482 100644 --- a/reference/mdspan/submdspan_mapping_result.md +++ b/reference/mdspan/submdspan_mapping_result.md @@ -17,7 +17,7 @@ namespace std { * no_unique_address[link /lang/cpp20/language_support_for_empty_objects.md] ## 概要 -`submdspan_mapping_result`は、多次元配列ビュー[mdspan](mdspan.md)からの部分ビュー[`submdspan`](submdspan.md)取り出しサポートのために定義するカスタマイズポイント`submdspan_mapping`の戻り値型である。 +`submdspan_mapping_result`は、多次元配列ビュー[mdspan](mdspan.md)からの部分ビュー[`submdspan`](submdspan.md)取り出しサポートのために定義するカスタマイゼーションポイント`submdspan_mapping`の戻り値型である。 - `mapping` : 多次元配列部分ビューの[レイアウトマッピング](LayoutMapping.md) - `offset` : 多次元配列部分ビューの要素オフセット位置 From 45cad455315a852c3f520b90fde6faf65a7a6f3e Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 9 Feb 2024 16:08:46 +0900 Subject: [PATCH 0713/3948] =?UTF-8?q?C++23=20:=20=E3=80=8C=E5=AE=9A?= =?UTF-8?q?=E6=95=B0=E5=BC=8F=E3=81=AE=E6=96=87=E8=84=88=E3=81=A7=E3=81=AE?= =?UTF-8?q?bool=E3=81=B8=E3=81=AE=E7=B8=AE=E5=B0=8F=E5=A4=89=E6=8F=9B?= =?UTF-8?q?=E3=82=92=E8=A8=B1=E5=8F=AF=E3=80=8D=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20(close=20#1037)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp11/static_assert.md | 4 +- lang/cpp17/if_constexpr.md | 1 + lang/cpp23.md | 2 +- ...arrowing_contextual_conversions_to_bool.md | 40 +++++++++++++++++++ 5 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 lang/cpp23/narrowing_contextual_conversions_to_bool.md diff --git a/implementation-status.md b/implementation-status.md index fd6d8c7a06..0da26f461d 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -266,7 +266,7 @@ | P2096R2: [部分特殊化の汎用化仕様](/lang/cpp23/generalized_wording_for_partial_specializations.md.nolink) | 変数テンプレートの部分特殊化を許可するために部分特殊化の仕様を汎用化 | - | - | - | - | | P2582R1: [継承コンストラクタからのクラステンプレート引数の推論](/lang/cpp23/class_template_argument_deduction_from_inherited.md) | 継承コンストラクタからもクラステンプレート引数を推論できるようにする | - | - | - | - | | P1938R3: [`if consteval`](/lang/cpp23/if_consteval.md.nolink) | コンパイル時の文脈かどうかで分岐させる | 12 | 14 | - | - | -| P1401R5: [定数式の文脈での`bool`への縮小変換を許可](/lang/cpp23/narrowing_contextual_conversions_to_bool.md.nolink) | `if constexpr(flags & Flags::Exec)`や`static_assert(N);`を許可 | 9 | 13 | 2022.2 | - | +| P1401R5: [定数式の文脈での`bool`への縮小変換を許可](/lang/cpp23/narrowing_contextual_conversions_to_bool.md) | `if constexpr(flags & Flags::Exec)`や`static_assert(N);`を許可 | 9 | 13 | 2022.2 | - | | P2242R3: [定数式内での非リテラル変数、静的変数・スレッドローカル変数およびgotoとラベルの存在を許可する](/lang/cpp23/non_literal_variables_in_constexpr_functions.md) | コンパイル時に評価されない限り、定数式内に静的変数・スレッドローカル変数およびgoto文とラベルを含むことを許可する | 12 | 15 | 2022.2 | - | | P2246R1: [静的な診断メッセージの文字エンコーディング](/lang/cpp23/character_encoding_of_diagnostic_text.md) | `static_assert`や`[[deprecated]]`などの診断メッセージの文字集合に関する要件をなくす | - | yes | - | 2022 | | P2448R2: [`constexpr`関数が定数実行できない場合でも適格とする](/lang/cpp23/relaxing_some_constexpr_restrictions.md) | | 13 | 17 (partial) | 2024.0 (partial) | - | diff --git a/lang/cpp11/static_assert.md b/lang/cpp11/static_assert.md index 60e3716099..ea9cab600f 100644 --- a/lang/cpp11/static_assert.md +++ b/lang/cpp11/static_assert.md @@ -78,8 +78,8 @@ Boost Static Assertion Libraryが開発されたときに、コンパイル時 ## 関連項目 -- [C++17 `static_assert`](/lang/cpp17/extending_static_assert.md) — 第2引数の診断メッセージを省略できるようになった - +- [C++17 `static_assert`のメッセージ省略を許可](/lang/cpp17/extending_static_assert.md) +- [C++23 定数式の文脈での`bool`への縮小変換を許可](/lang/cpp23/narrowing_contextual_conversions_to_bool.md) ## 参照 diff --git a/lang/cpp17/if_constexpr.md b/lang/cpp17/if_constexpr.md index 2b2e8b4cbd..ae6cd312b0 100644 --- a/lang/cpp17/if_constexpr.md +++ b/lang/cpp17/if_constexpr.md @@ -412,6 +412,7 @@ template int do_something(Args... args) { ## 関連項目 - [`std::conditional`](/reference/type_traits/conditional.md) +- [C++23 定数式の文脈での`bool`への縮小変換を許可](/lang/cpp23/narrowing_contextual_conversions_to_bool.md) ## 参照 diff --git a/lang/cpp23.md b/lang/cpp23.md index ffe036098e..7c4417f33b 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -68,7 +68,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| | [`if consteval`](cpp23/if_consteval.md.nolink) | コンパイル時の文脈かどうかで分岐させる | -| [定数式の文脈での`bool`への縮小変換を許可](cpp23/narrowing_contextual_conversions_to_bool.md.nolink) | `if constexpr(flags & Flags::Exec)`や`static_assert(N);`を許可 | +| [定数式の文脈での`bool`への縮小変換を許可](cpp23/narrowing_contextual_conversions_to_bool.md) | `if constexpr(flags & Flags::Exec)`や`static_assert(N);`を許可 | | [定数式内での非リテラル変数、静的変数・スレッドローカル変数およびgotoとラベルの存在を許可する](cpp23/non_literal_variables_in_constexpr_functions.md) | コンパイル時に評価されない限り、定数式内に静的変数・スレッドローカル変数およびgoto文とラベルを含むことを許可する | | [静的な診断メッセージの文字エンコーディング](cpp23/character_encoding_of_diagnostic_text.md) | `static_assert`や`[[deprecated]]`などの診断メッセージの文字集合に関する要件をなくす | | [`constexpr`関数が定数実行できない場合でも適格とする](cpp23/relaxing_some_constexpr_restrictions.md) | 定数式実行できない関数であっても、実際にコンパイル時に評価されない限り`constexpr`指定することを許可する | diff --git a/lang/cpp23/narrowing_contextual_conversions_to_bool.md b/lang/cpp23/narrowing_contextual_conversions_to_bool.md new file mode 100644 index 0000000000..2730e9a171 --- /dev/null +++ b/lang/cpp23/narrowing_contextual_conversions_to_bool.md @@ -0,0 +1,40 @@ +# 定数式の文脈でのboolへの縮小変換を許可 +* cpp23[meta cpp] + +## 概要 +C++23では、以下の定数式文脈での`bool`への縮小変換を許可する: + +- `static_assert` +- `if constexpr` + +これにより、整数値から`bool`への変換 (ビットフラグの判定などで使われる)、スコープをもたない列挙値型から`bool`への変換ができる定数式の条件式内でできるようになる。 + +ただし`explicit(bool)`および`noexcept(bool)`のパラメータについては縮小変換が許可されないため、整数値として値`1`か`0`のどちらかしか指定できず、`noexcept(sizeof(char[2]))`のようなコードはコンパイルエラーとなる。 + + +### `static_assert`の例 + +```cpp +// 整数値が0でなければtrue、そうでなければfalse +static_assert(bool(N)); // これまでの書き方 +static_assert(N); // C++23以降 + +static_assert(sizeof(int[2])); // C++23:OK 縮小変換 +``` + +### `if constexpr`の例 +```cpp +if constexpr(bool(flags & Flags::Exec)) { … } // これまでの書き方 +if constexpr((flags & Flags::Exec) != 0) { … } // これまでの書き方 +if constexpr(flags & Flags::Exec) { … } // C++23以降 + +if constexpr (sizeof(int[2])) { … } // C++23:OK 縮小変換 +``` + +## 関連項目 +- [C++11 コンパイル時アサート](/lang/cpp11/static_assert.md) +- [C++17 `constexpr if`文](/lang/cpp17/if_constexpr.md) + + +## 参照 +- [P1401R5 Narrowing contextual conversions to `bool`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1401r5.html) From 8250474933368f71448e5a3cad3eb78d0f101ed2 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 9 Feb 2024 17:06:51 +0900 Subject: [PATCH 0714/3948] =?UTF-8?q?C++23=20:=20=E3=80=8Cconstexpr?= =?UTF-8?q?=E9=96=A2=E6=95=B0=E5=86=85=E3=81=A7=E3=81=AEstatic=20constexpr?= =?UTF-8?q?=E5=A4=89=E6=95=B0=E3=82=92=E8=A8=B1=E5=8F=AF=E3=80=8D=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20(close=20#1108)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp11/constexpr.md | 12 ++++++++- lang/cpp23.md | 2 +- ...iteral_variables_in_constexpr_functions.md | 1 + ...stexpr_variables_in_constexpr_functions.md | 26 +++++++++++++++++++ 5 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md diff --git a/implementation-status.md b/implementation-status.md index 0da26f461d..d61b11ed59 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -270,7 +270,7 @@ | P2242R3: [定数式内での非リテラル変数、静的変数・スレッドローカル変数およびgotoとラベルの存在を許可する](/lang/cpp23/non_literal_variables_in_constexpr_functions.md) | コンパイル時に評価されない限り、定数式内に静的変数・スレッドローカル変数およびgoto文とラベルを含むことを許可する | 12 | 15 | 2022.2 | - | | P2246R1: [静的な診断メッセージの文字エンコーディング](/lang/cpp23/character_encoding_of_diagnostic_text.md) | `static_assert`や`[[deprecated]]`などの診断メッセージの文字集合に関する要件をなくす | - | yes | - | 2022 | | P2448R2: [`constexpr`関数が定数実行できない場合でも適格とする](/lang/cpp23/relaxing_some_constexpr_restrictions.md) | | 13 | 17 (partial) | 2024.0 (partial) | - | -| P2647R1: [`constexpr`関数内での`static constexpr`変数を許可](/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md.nolink) | 13 | - | 16 | 2023.2 | - | +| P2647R1: [`constexpr`関数内での`static constexpr`変数を許可](/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md) | `constexpr`関数のローカルで定数を定義できるようにする | 13 | 16 | 2023.2 | - | | P2564R3: [`constexpr`関数内で`consteval`関数を呼び出せない問題を緩和](/lang/cpp23/consteval_needs_to_propagate_up.md.nolink) | | - | 17 | - | 2024.0 | | P1102R2: [ラムダ式で`()`を省略できる条件を緩和](/lang/cpp23/down_with_lambda_parens.md) | 修飾や戻り値型をともなってもパラメータリストが空であれば`()`を省略できる | 11 | 13 | 2022.2 | - | | P2173R1: [ラムダ式に対する属性](/lang/cpp23/attributes_on_lambda_expressions.md) | ラムダ式のいくつかの箇所に属性を記述できるようにする | 9 | 13 | 2022.2 | - | diff --git a/lang/cpp11/constexpr.md b/lang/cpp11/constexpr.md index 6a4be2c35e..ebbdd69b28 100644 --- a/lang/cpp11/constexpr.md +++ b/lang/cpp11/constexpr.md @@ -194,9 +194,19 @@ GCC 5.2、Clang 3.7、Visual C++ 2015時点で、3つともデフォルトは512 ## 関連項目 - [C++11 ユーザー定義リテラル](user_defined_literals.md) - [C++14 `constexpr`の制限緩和](/lang/cpp14/relaxing_constraints_on_constexpr.md) +- [C++17 `constexpr`ラムダ](/lang/cpp17/constexpr_lambda.md) +- [C++20 即時関数](/lang/cpp20/immediate_functions.md) - [C++20 定数式からの仮想関数の呼び出しを許可](/lang/cpp20/allow_virtual_function_calls_in_constant_expressions.md) +- [C++20 定数式での`dynamic_cast`、多態的な`typeid`を許可](/lang/cpp20/allowing_dynamic_cast_polymorphic_typeid_in_constant_expressions.md) - [C++20 `constexpr`関数内でのtry-catchブロックを許可](/lang/cpp20/try-catch_blocks_in_constexpr_functions.md) -- [C++20 即時関数](/lang/cpp20/immediate_functions.md) +- [C++20 定数式内での共用体のアクティブメンバの変更を許可](/lang/cpp20/changing_the_active_member_of_a_union_inside_constexpr.md) +- [C++20 constexpr関数内でのトリビアルなデフォルト初期化を許可](/lang/cpp20/permitting_trivial_default_initialization_in_constexpr_contexts.md) +- [C++20 constexpr関数内で未評価のインラインアセンブリを許可することによる組み込み関数のconstexpr有効化](/lang/cpp20/enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.md) +- [C++20 コンパイル時初期化を強制する`constinit`キーワードを追加](/lang/cpp20/constinit.md) +- [C++20 可変サイズをもつコンテナの`constexpr`化](/lang/cpp20/more_constexpr_containers.md) +- [C++23 `constexpr`関数が定数実行できない場合でも適格とする](/lang/cpp23/relaxing_some_constexpr_restrictions.md) +- [C++23 `constexpr`関数内での`static constexpr`変数を許可](/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md) +- [C++23 `constexpr`関数内で`consteval`関数を呼び出せない問題を緩和](/lang/cpp23/consteval_needs_to_propagate_up.md.nolink) ## 参照 diff --git a/lang/cpp23.md b/lang/cpp23.md index 7c4417f33b..d293cfd2c7 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -72,7 +72,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 | [定数式内での非リテラル変数、静的変数・スレッドローカル変数およびgotoとラベルの存在を許可する](cpp23/non_literal_variables_in_constexpr_functions.md) | コンパイル時に評価されない限り、定数式内に静的変数・スレッドローカル変数およびgoto文とラベルを含むことを許可する | | [静的な診断メッセージの文字エンコーディング](cpp23/character_encoding_of_diagnostic_text.md) | `static_assert`や`[[deprecated]]`などの診断メッセージの文字集合に関する要件をなくす | | [`constexpr`関数が定数実行できない場合でも適格とする](cpp23/relaxing_some_constexpr_restrictions.md) | 定数式実行できない関数であっても、実際にコンパイル時に評価されない限り`constexpr`指定することを許可する | -| [`constexpr`関数内での`static constexpr`変数を許可](cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md.nolink) | | +| [`constexpr`関数内での`static constexpr`変数を許可](cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md) | `constexpr`関数のローカルで定数を定義できるようにする | | [`constexpr`関数内で`consteval`関数を呼び出せない問題を緩和](cpp23/consteval_needs_to_propagate_up.md.nolink) | | diff --git a/lang/cpp23/non_literal_variables_in_constexpr_functions.md b/lang/cpp23/non_literal_variables_in_constexpr_functions.md index 0f2b682add..0cd51f8066 100644 --- a/lang/cpp23/non_literal_variables_in_constexpr_functions.md +++ b/lang/cpp23/non_literal_variables_in_constexpr_functions.md @@ -24,6 +24,7 @@ - [C++20 - constexpr関数内でのtry-catchブロックを許可](/lang/cpp20/try-catch_blocks_in_constexpr_functions.md) - [C++20 - constexpr関数内で未評価のインラインアセンブリを許可することによる組み込み関数のconstexpr有効化](/lang/cpp20/enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.md) +- [C++23 - `constexpr`関数内での`static constexpr`変数を許可](/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md) ## 参照 diff --git a/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md b/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md new file mode 100644 index 0000000000..431608eb6d --- /dev/null +++ b/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md @@ -0,0 +1,26 @@ +# constexpr関数内でのstatic constexpr変数を許可 +* cpp23[meta cpp] + +## 概要 +C++23からは、`constexpr`関数内で定数を定義するために、`static constexpr`変数を使用できるようになる。 + +```cpp +char xdigit(int n) { + static constexpr char digits[] = "0123456789abcdef"; // C++20:OK, C++23:OK + return digits[n]; +} + +constexpr char xdigit(int n) { + static constexpr char digits[] = "0123456789abcdef"; // C++20:NG, C++23:OK + return digits[n]; +} +``` + +C++20までは`constexpr`内で`static constexpr`変数を定義できなかったため、関数外での`static constexpr`変数の定義や、`consteval`関数で定数を返すなどの回避策がとられていたが、C++23からはそのような回避策が必要なくなる。 + + +## 関連項目 +- [C++23 定数式内での非リテラル変数、静的変数・スレッドローカル変数およびgotoとラベルの存在を許可する](/lang/cpp23/non_literal_variables_in_constexpr_functions.md) + +## 参照 +- [P2647R1 Permitting `static constexpr` variables in `constexpr` functions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2647r1.html) From bb18d677bed3535431feb4b84e9747b79c8e62c9 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 13 Feb 2024 12:11:13 +0900 Subject: [PATCH 0715/3948] =?UTF-8?q?C++23=20:=20if=20consteval=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20(close=20#1036)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp23.md | 2 +- lang/cpp23/if_consteval.md | 109 ++++++++++++++++++ .../type_traits/is_constant_evaluated.md | 50 +++++--- 4 files changed, 142 insertions(+), 21 deletions(-) create mode 100644 lang/cpp23/if_consteval.md diff --git a/implementation-status.md b/implementation-status.md index d61b11ed59..123dd1ae4e 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -265,7 +265,7 @@ | P2071R2: [名前付きユニバーサルキャラクタ名](/lang/cpp23/named_universal_character_escapes.md) | 16進数のユニバーサルキャラクタだけでなく、その文字の名前を入力できるようにする | 13 | 15 | 2023.2 | - | | P2096R2: [部分特殊化の汎用化仕様](/lang/cpp23/generalized_wording_for_partial_specializations.md.nolink) | 変数テンプレートの部分特殊化を許可するために部分特殊化の仕様を汎用化 | - | - | - | - | | P2582R1: [継承コンストラクタからのクラステンプレート引数の推論](/lang/cpp23/class_template_argument_deduction_from_inherited.md) | 継承コンストラクタからもクラステンプレート引数を推論できるようにする | - | - | - | - | -| P1938R3: [`if consteval`](/lang/cpp23/if_consteval.md.nolink) | コンパイル時の文脈かどうかで分岐させる | 12 | 14 | - | - | +| P1938R3: [`if consteval`](/lang/cpp23/if_consteval.md) | コンパイル時の文脈かどうかで分岐させる | 12 | 14 | - | - | | P1401R5: [定数式の文脈での`bool`への縮小変換を許可](/lang/cpp23/narrowing_contextual_conversions_to_bool.md) | `if constexpr(flags & Flags::Exec)`や`static_assert(N);`を許可 | 9 | 13 | 2022.2 | - | | P2242R3: [定数式内での非リテラル変数、静的変数・スレッドローカル変数およびgotoとラベルの存在を許可する](/lang/cpp23/non_literal_variables_in_constexpr_functions.md) | コンパイル時に評価されない限り、定数式内に静的変数・スレッドローカル変数およびgoto文とラベルを含むことを許可する | 12 | 15 | 2022.2 | - | | P2246R1: [静的な診断メッセージの文字エンコーディング](/lang/cpp23/character_encoding_of_diagnostic_text.md) | `static_assert`や`[[deprecated]]`などの診断メッセージの文字集合に関する要件をなくす | - | yes | - | 2022 | diff --git a/lang/cpp23.md b/lang/cpp23.md index d293cfd2c7..312f5c9154 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -67,7 +67,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| -| [`if consteval`](cpp23/if_consteval.md.nolink) | コンパイル時の文脈かどうかで分岐させる | +| [`if consteval`](cpp23/if_consteval.md) | コンパイル時の文脈かどうかで分岐させる | | [定数式の文脈での`bool`への縮小変換を許可](cpp23/narrowing_contextual_conversions_to_bool.md) | `if constexpr(flags & Flags::Exec)`や`static_assert(N);`を許可 | | [定数式内での非リテラル変数、静的変数・スレッドローカル変数およびgotoとラベルの存在を許可する](cpp23/non_literal_variables_in_constexpr_functions.md) | コンパイル時に評価されない限り、定数式内に静的変数・スレッドローカル変数およびgoto文とラベルを含むことを許可する | | [静的な診断メッセージの文字エンコーディング](cpp23/character_encoding_of_diagnostic_text.md) | `static_assert`や`[[deprecated]]`などの診断メッセージの文字集合に関する要件をなくす | diff --git a/lang/cpp23/if_consteval.md b/lang/cpp23/if_consteval.md new file mode 100644 index 0000000000..c690af5f75 --- /dev/null +++ b/lang/cpp23/if_consteval.md @@ -0,0 +1,109 @@ +# if consteval +* cpp23[meta cpp] + +## 概要 +C++23では、`constexpr`関数がコンパイル時に呼ばれたかを判定するための構文として、`if consteval`を導入する。これは「consteval if文」と呼ばれる。 + +```cpp +constexpr double my_fma(double a, double b, double c) { + if consteval { + // コンパイル時に実行される文脈 + return a * b + c; + } + else { + // 実行時に実行される文脈 + return __builtin_fma(a, b, c); + } +} + +#include +int main() { + constexpr double static_fma = my_fma(1.0, 2.0, 3.0); + double dynamic_fma = my_fma(1.0, 2.0, 3.0); + + std::cout << static_fma << std::endl; + std::cout << dynamic_fma << std::endl; +} +``` + +`if consteval`文内は即時関数 (`consteval`) の文脈であり、`consteval`関数を呼び出すことができる。 + +`if consteval`の逆条件として、実行時かを判定するためには、`if !consteval`を使用する (`consteval`の前に`!`)。 + +```cpp +constexpr double my_fma(double a, double b, double c) { + if !consteval { + // 実行時に実行される文脈 + return __builtin_fma(a, b, c); + } + else { + // コンパイル時に実行される文脈 + return a * b + c; + } +} +``` + +`if consteval`文は複合文でなければならない。 + +```cpp +constexpr double my_fma(double a, double b, double c) { + if !consteval { + return __builtin_fma(a, b, c); + } + else + return a * b + c; // コンパイルエラー!複合文でなければならない +} +``` + +## この機能が必要になった背景・経緯 +### constexprとconstevalの相互作用での問題 +`consteval`を使用したプログラムを考える。 + +```cpp +consteval int f(int i) { return i; } + +constexpr int g(int i) { + if (std::is_constant_evaluated()) { + return f(i) + 1; // <== + } else { + return 42; + } +} + +consteval int h(int i) { + return f(i) + 1; +} +``` +* std::is_constant_evaluated[link /reference/type_traits/is_constant_evaluated.md] + +定数式評価時には、関数`g()`と関数`h()`は同じことをするが、実行時には関数`h()`を呼び出すことはできない。また、`if (std::is_constant_evaluated())`文内は定数式ではあるが即時関数の文脈ではないため、即時関数`f()`を呼び出すことはできず、`<==`コメントのところで不適格となる。この文脈では、`f(42)`を呼び出すことはできるが、`f(i)`を呼び出すことはできない。 + + + +### `if constexpr (std::is_constant_evaluated())`の問題 +もうひとつの問題は、[`std::is_constant_evaluated()`](/reference/type_traits/is_constant_evaluated.md)固有の問題だが、この関数は`if`文と使わなければならないが、誤って`if constexpr`で使用してしまう場合である。 + +```cpp +constexpr size_t strlen(char const* s) { + if constexpr (std::is_constant_evaluated()) { + for (const char *p = s; ; ++p) { + if (*p == '\0') { + return static_cast(p - s); + } + } + } else { + __asm__("SSE 4.2で計算…"); + } +} +``` + +この関数は常にコンパイル時の方の文脈が呼ばれてしまう。この使用間違いはコンパイラによっては警告を出力するが、誤用を防ぐのがむずかしいという問題があった。 + + + +## 関連項目 +- [`std::is_constant_evaluated()`](/reference/type_traits/is_constant_evaluated.md) + + +## 参照 +- [P1938R3 `if consteval`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1938r3.html) diff --git a/reference/type_traits/is_constant_evaluated.md b/reference/type_traits/is_constant_evaluated.md index 09482f82d5..795dd774d6 100644 --- a/reference/type_traits/is_constant_evaluated.md +++ b/reference/type_traits/is_constant_evaluated.md @@ -17,24 +17,34 @@ namespace std { ## 戻り値 -本関数は以下の文脈内で評価された場合に`true`を返す。 - -- 文法上の定数式(配列型の要素数、`case`ラベルの値、など) -- [`constexpr if`](/lang/cpp17/if_constexpr.md)の条件式 -- [`consteval`関数](/lang/cpp20/immediate_functions.md)の呼び出し内 -- [コンセプト](/lang/cpp20/concepts.md)の定義式 - - `requires`節内 - - 入れ子要件内 -- 定数式で使用可能な変数の初期化式 - - `constexpr`変数の初期化式 - - 定数初期化される`const`な整数、列挙型変数の初期化式 - - 定数初期化される参照型変数の初期化式 -- 定数初期化される変数の初期化式 - -上記の文脈の外では、コンパイラの最適化(定数畳み込み)によって容易にコンパイル時評価できる式や`constexpr`関数の呼び出し中の評価であっても`false`となる。 - -[`constexpr if`](/lang/cpp17/if_constexpr.md)の条件式および[`static_assert`](/lang/cpp11/static_assert.md)の条件式に書かれている場合は必ず`true`となるので注意が必要である。 - +- C++20: + 本関数は以下の文脈内で評価された場合に`true`を返す。 + + - 文法上の定数式(配列型の要素数、`case`ラベルの値、など) + - [`constexpr if`](/lang/cpp17/if_constexpr.md)の条件式 + - [`consteval`関数](/lang/cpp20/immediate_functions.md)の呼び出し内 + - [コンセプト](/lang/cpp20/concepts.md)の定義式 + - `requires`節内 + - 入れ子要件内 + - 定数式で使用可能な変数の初期化式 + - `constexpr`変数の初期化式 + - 定数初期化される`const`な整数、列挙型変数の初期化式 + - 定数初期化される参照型変数の初期化式 + - 定数初期化される変数の初期化式 + + 上記の文脈の外では、コンパイラの最適化(定数畳み込み)によって容易にコンパイル時評価できる式や`constexpr`関数の呼び出し中の評価であっても`false`となる。 + + [`constexpr if`](/lang/cpp17/if_constexpr.md)の条件式および[`static_assert`](/lang/cpp11/static_assert.md)の条件式に書かれている場合は必ず`true`となるので注意が必要である。 + +- C++23: + 以下と等価: + ```cpp + if consteval { + return true; + } else { + return false; + } + ``` ## 備考 @@ -134,7 +144,9 @@ int main() ## 関連項目 - [C++20 コンパイル時初期化を強制する`constinit`キーワードを追加](/lang/cpp20/constinit.md) -- [C++23 `if consteval`](/lang/cpp23/if_consteval.md.nolink) +- [C++23 `if consteval`](/lang/cpp23/if_consteval.md) ## 参照 - [P0595R2 `std::is_constant_evaluated()`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0595r2.html) +- [P1938R3 `if consteval`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1938r3.html) + - C++23で`if consteval`を導入したことにより、この関数の効果を`if consteval`ベースの仕様に変更 From 5df0bf49f93095c7dbc3d28b5014739630977ae1 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 13 Feb 2024 13:44:31 +0900 Subject: [PATCH 0716/3948] =?UTF-8?q?C++23=20if=20consteval=20:=20?= =?UTF-8?q?=E9=96=A2=E9=80=A3=E9=A0=85=E7=9B=AE=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp20/immediate_functions.md | 1 + lang/cpp23/if_consteval.md | 1 + 2 files changed, 2 insertions(+) diff --git a/lang/cpp20/immediate_functions.md b/lang/cpp20/immediate_functions.md index 63321ced0a..df85a1da78 100644 --- a/lang/cpp20/immediate_functions.md +++ b/lang/cpp20/immediate_functions.md @@ -101,6 +101,7 @@ C++11で導入された`constexpr`指定子によって、関数を定数式評 * [C++11 `constexpr`](/lang/cpp11/constexpr.md) * [C++20 コンパイル時初期化を強制する`constinit`キーワードを追加](constinit.md) +* [C++23 `if consteval`](/lang/cpp23/if_consteval.md) ## 参照 diff --git a/lang/cpp23/if_consteval.md b/lang/cpp23/if_consteval.md index c690af5f75..0c7247d29f 100644 --- a/lang/cpp23/if_consteval.md +++ b/lang/cpp23/if_consteval.md @@ -103,6 +103,7 @@ constexpr size_t strlen(char const* s) { ## 関連項目 - [`std::is_constant_evaluated()`](/reference/type_traits/is_constant_evaluated.md) +- [C++20 即時関数](/lang/cpp20/immediate_functions.md) ## 参照 From 00f9995fc6afdff52084adaa4739c0eae91a5592 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 13 Feb 2024 13:47:00 +0900 Subject: [PATCH 0717/3948] =?UTF-8?q?std::merge=20:=20=E9=96=A2=E9=80=A3?= =?UTF-8?q?=E9=A0=85=E7=9B=AE=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/merge.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reference/algorithm/merge.md b/reference/algorithm/merge.md index 824b2114af..7b224746c3 100644 --- a/reference/algorithm/merge.md +++ b/reference/algorithm/merge.md @@ -172,6 +172,11 @@ OutputIterator merge(InputIterator1 first1, InputIterator1 last1, * std::copy[link copy.md] +## 関連項目 +- [`std::set::merge()`](/reference/set/set/merge.md) +- [`std::set_union()`](set_union.md) + + ## 参照 - [P0574R1 Algorithm Complexity Constraints and Parallel Overloads](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0574r1.html) - [P0202R3 Add Constexpr Modifiers to Functions in `` and `` Headers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0202r3.html) From 005ac4a78428da86e42138696edc492a4717b57b Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 13 Feb 2024 15:18:39 +0900 Subject: [PATCH 0718/3948] =?UTF-8?q?fold=5Fleft=5Ffirst=5Fwith=5Fiter?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20#1088?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23.md | 2 +- reference/algorithm.md | 2 +- reference/algorithm/ranges_fold_left.md | 2 +- reference/algorithm/ranges_fold_left_first.md | 4 +- .../ranges_fold_left_first_with_iter.md | 248 ++++++++++++++++++ .../algorithm/ranges_fold_left_with_iter.md | 29 +- reference/algorithm/ranges_fold_right.md | 2 +- reference/algorithm/ranges_fold_right_last.md | 2 +- 8 files changed, 272 insertions(+), 19 deletions(-) create mode 100644 reference/algorithm/ranges_fold_left_first_with_iter.md diff --git a/lang/cpp23.md b/lang/cpp23.md index 312f5c9154..d0da48df29 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -165,7 +165,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 - [`std::ranges::fold_right()`](/reference/algorithm/ranges_fold_right.md) - [`std::ranges::fold_right_last()`](/reference/algorithm/ranges_fold_right_last.md) - [`std::ranges::fold_left_with_iter()`](/reference/algorithm/ranges_fold_left_with_iter.md) - - [`std::ranges::fold_left_first_with_iter()`](/reference/algorithm/ranges_fold_left_first_with_iter.md.nolink) + - [`std::ranges::fold_left_first_with_iter()`](/reference/algorithm/ranges_fold_left_first_with_iter.md) - [``](/reference/numeric.md)に、連番を生成するRangeアルゴリズム[`std::ranges::iota()`](/reference/numeric/ranges_iota.md)を追加 diff --git a/reference/algorithm.md b/reference/algorithm.md index 0f70852802..52bb983fb4 100644 --- a/reference/algorithm.md +++ b/reference/algorithm.md @@ -431,7 +431,7 @@ ranges::sort(pv, {}, &Parson::name); | [`ranges::fold_left_first`](algorithm/ranges_fold_left_first.md)| 範囲の左(先頭)からの`fold`、初期値を省略する | C++23 | | [`ranges::fold_right_last`](algorithm/ranges_fold_right_last.md)| 範囲の右(終端)からの`fold`、初期値を省略する | C++23 | | [`ranges::fold_left_with_iter`](algorithm/ranges_fold_left_with_iter.md) | 範囲の左(先頭)からの`fold`、終端イテレータを返す | C++23 | -| [`ranges::fold_left_first_with_iter`](algorithm/ranges_fold_left_first_with_iter.md.nolink) | 範囲の左(先頭)からの`fold`、初期値を省略し終端イテレータを返す | C++23 | +| [`ranges::fold_left_first_with_iter`](algorithm/ranges_fold_left_first_with_iter.md) | 範囲の左(先頭)からの`fold`、初期値を省略し終端イテレータを返す | C++23 | ### 戻り値 diff --git a/reference/algorithm/ranges_fold_left.md b/reference/algorithm/ranges_fold_left.md index f5b4fcee4e..4fbb3a19b5 100644 --- a/reference/algorithm/ranges_fold_left.md +++ b/reference/algorithm/ranges_fold_left.md @@ -266,7 +266,7 @@ constexpr auto fold_left(I first, S last, T init, F f) { - 範囲の最後の要素を初期値として`fold_right` - [`ranges::fold_left_with_iter`](ranges_fold_left_with_iter.md) - `fold_left`の結果と共に、計算した終端イテレータも返す -- [`ranges::fold_left_first_with_iter`](ranges_fold_left_first_with_iter.md.nolink) +- [`ranges::fold_left_first_with_iter`](ranges_fold_left_first_with_iter.md) - `fold_left_first`の結果と共に、計算した終端イテレータも返す ## 参照 diff --git a/reference/algorithm/ranges_fold_left_first.md b/reference/algorithm/ranges_fold_left_first.md index 71307ad820..ae2564d50c 100644 --- a/reference/algorithm/ranges_fold_left_first.md +++ b/reference/algorithm/ranges_fold_left_first.md @@ -54,7 +54,7 @@ namespace std::ranges { ```cpp return ranges::fold_left_first_with_iter(std::move(first), last, f).value; ``` - * fold_left_first_with_iter[link /reference/algorithm/ranges_fold_left_first_with_iter.md.nolink] + * fold_left_first_with_iter[link /reference/algorithm/ranges_fold_left_first_with_iter.md] - (2) : `r`からイテレータを取得して(1)に委譲 ```cpp @@ -204,7 +204,7 @@ constexpr auto fold_left_first(I first, S last, F f) { - 範囲の最後の要素を初期値として`fold_right` - [`ranges::fold_left_with_iter`](ranges_fold_left_with_iter.md) - `fold_left`の結果と共に、計算した終端イテレータも返す -- [`ranges::fold_left_first_with_iter`](ranges_fold_left_first_with_iter.md.nolink) +- [`ranges::fold_left_first_with_iter`](ranges_fold_left_first_with_iter.md) - `fold_left_first`の結果と共に、計算した終端イテレータも返す ## 参照 diff --git a/reference/algorithm/ranges_fold_left_first_with_iter.md b/reference/algorithm/ranges_fold_left_first_with_iter.md new file mode 100644 index 0000000000..93496d7fdd --- /dev/null +++ b/reference/algorithm/ranges_fold_left_first_with_iter.md @@ -0,0 +1,248 @@ +# fold_left_first_with_iter +* algorithm[meta header] +* function template[meta id-type] +* std::ranges[meta namespace] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template S, + indirectly-binary-left-foldable, I> F> + requires constructible_from, iter_reference_t> + constexpr auto fold_left_first_with_iter(I first, S last, F f); // (1) + + template, iterator_t> F> + requires constructible_from, range_reference_t> + constexpr auto fold_left_first_with_iter(R&& r, F f); // (2) +} +``` +* input_iterator[link /reference/iterator/input_iterator.md] +* sentinel_for[link /reference/iterator/sentinel_for.md] +* indirectly-binary-left-foldable[link ./ranges_fold_left.md] +* iter_value_t[link /reference/iterator/iter_value_t.md] +* constructible_from[link /reference/concepts/constructible_from.md] +* iter_reference_t[link /reference/iterator/iter_reference_t.md] +* input_range[link /reference/ranges/input_range.md] +* range_value_t[link /reference/ranges/range_value_t.md] +* iterator_t[link /reference/ranges/iterator_t.md] +* range_reference_t[link /reference/ranges/range_reference_t.md] + +## 概要 + +処理の過程で得られた終端位置を指すイテレータを同時に返す[`fold_left_first`](./ranges_fold_left_first.md)。入力範囲の先頭要素が初期値として使用され、戻り値はイテレータと処理結果のペアとなる。 + +- (1) : 入力としてイテレータ範囲をとるオーバーロード +- (2) : 入力として範囲を直接とるオーバーロード + +## 引数 + +- `first` -- 入力範囲の先頭イテレータ +- `last` -- 入力範囲の番兵(終端イテレータ) +- `r` -- 入力範囲のオブジェクト +- `f` -- 適用する二項演算 + - `f(*first, *first)`のような呼び出しが可能であり(実際にこの様に呼ばれるわけではない)、その戻り値型のオブジェクトを`acc`とすると + - `acc = f(std::move(acc), *first)`のような呼び出しも可能である必要がある + +## テンプレートパラメータ制約 + +二項演算(`F`)は初期値・積算値と入力範囲の参照型に対して[`invocable`](/reference/concepts/invocable.md)であることしか求められていない(`regular_invocable`ではない)ため、適用する二項演算は任意の副作用を伴っていても良い。 + +## 戻り値 + +型`U`を次のように取得して + +```cpp +using U = decltype(ranges::fold_left(std::move(first), last, iter_value_t(*first), f)); +``` +* fold_left[link ./ranges_fold_left.md] +* iter_value_t[link /reference/iterator/iter_value_t.md] + +- (1) : 以下と等価 + ```cpp + if (first == last) + return {std::move(first), optional()}; + optional init(in_place, *first); + for (++first; first != last; ++first) + *init = invoke(f, std::move(*init), *first); + return {std::move(first), std::move(init)}; + ``` + * optional[link /reference/optional/optional.md] + * invoke[link /reference/functional/invoke.md] +- (2) : `r`からイテレータを取得して(1)に委譲 + ```cpp + return ranges::fold_left_first_with_iter(ranges::begin(r), ranges::end(r), f); + ``` + * begin[link /reference/ranges/begin.md] + * end[link /reference/ranges/end.md] + +空の入力範囲に対しては無効値を保持する[`optional`](/reference/optional/optional.md)を返す。入力範囲によらず、戻り値の1つ目の値(イテレータ値)は渡した範囲の終端イテレータ(`last`/`ranges::end(r)`)と同じ位置を指すイテレータとなる(必ずしも同じ型もしくは同じイテレータにならない)。 + +戻り値型はそれぞれ、`U`を次の様に[`fold_left_first_with_iter_result`](/reference/algorithm/ranges_in_value_result.md)の2つ目の引数に当てはめた型となる + +```cpp +template S, + indirectly-binary-left-foldable, I> F> + requires constructible_from, iter_reference_t> +constexpr fold_left_first_with_iter_result> + fold_left_first_with_iter(I first, S last, F f); + +template, iterator_t> F> + requires constructible_from, range_reference_t> +constexpr fold_left_first_with_iter_result, optional> + fold_left_first_with_iter(R&& r, F f); +``` +* fold_left_first_with_iter_result[link /reference/algorithm/ranges_in_value_result.md] +* optional[link /reference/optional/optional.md] +* borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] + +1つ目の引数には入力のイテレータ型が当てられる。 + +## 計算量 + +入力範囲`r`(`[first, last)`)の要素数を`N`とすると、正確に`N - 1`回の`f`の適用が行われる。 + +## 備考 + +戻り値の項で使用している`U`は、指定した二項演算を`f(*first, *first)`のように呼び出した時の戻り値型であり、`fold_left_first_with_iter_result()`の処理内部で積算値の型として使用されるものでもある。 + +`fold_left`同様に、`f`は`*first`の代わりに`U`の右辺値も受け取れる必要がある。二項演算の呼び出しにおいては、第一引数に初期値もしくは積算値が渡され、第二引数にイテレータの間接参照結果が直接渡される。そして、二項演算の適用結果は積算値を保存する変数に直接代入される(つまり、結果を次のステップに引き継ぎたい場合は積算処理も二項演算内で行う必要がある)。詳細は下の実装例を参照。 + +## 例 + +### 基本的な数値集計処理の例 + +```cpp example +#include +#include +#include +#include +#include + +using namespace std::ranges; + +int main() { + // 入力 + range auto rng = views::iota(1, 11); + // 二項演算 + auto op = std::plus<>{}; + + auto [end1, resl] = fold_left_first_with_iter(rng, op); + + std::println("{{ {:s}, {:d} }}", end1 == end(rng), resl.value()); + + + // 入力範囲はfloatのvector + std::vector rngf = { 0.125f, 0.25f, 0.75f }; + + // 計算結果はfloat + auto [end2, reslf] = fold_left_first_with_iter(rngf, op); + + std::println("{{ {:s}, {:g} }}", end2 == end(rngf), reslf.value()); +} +``` +* fold_left_first_with_iter[color ff0000] +* iota[link /reference/ranges/iota_view.md] +* plus[link /reference/functional/plus.md] +* println[link /reference/print/println.md] + +### 出力 +``` +{ true, 55 } +{ true, 1.125 } +``` + +### 空の入力範囲に対する動作の例 + +```cpp example +#include +#include +#include +#include +#include + +using namespace std::ranges; + +int main() { + range auto rng = views::empty; + auto op = std::plus<>{}; + + auto res1 = fold_left(rng, -1, op); + auto res2 = fold_left_first(rng, op); + auto [_, res3] = fold_left_first_with_iter(rng, op); + + std::println("{:d}", res1); + std::println("{:d}", res2.value_or(-1)); + std::println("{:d}", res3.value_or(-1)); +} +``` +* fold_left_first_with_iter[color ff0000] +* fold_left[link ranges_fold_left.md] +* fold_left_first[link ranges_fold_left_first.md] +* println[link /reference/print/println.md] +* value_or[link /reference/optional/optional/value_or.md] + +### 出力 +``` +-1 +-1 +-1 +``` + +## 実装例 + +```cpp +template +using R = decay_t, iter_reference_t>>; + + +template S, + indirectly-binary-left-foldable, I> F> + requires constructible_from, iter_reference_t> +constexpr auto fold_left_first_with_iter(I first, S last, F f) + -> fold_left_first_with_iter_result>> +{ + using U = R; + + if (first == last) { + return {std::move(first), std::optional()}; + } + + std::optional accum(in_place, *first); + + ++first; + + for (; first != last; ++first) { + *accum = invoke(f, std::move(*accum), *first); + } + + return {std::move(first), std::move(accum)}; +} +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 5 + +## 関連項目 + +- [`ranges::fold_left`](ranges_fold_left.md) + - 範囲の左からの`fold` +- [`ranges::fold_right`](ranges_fold_right.md) + - 範囲の右からの`fold` +- [`ranges::fold_left_first`](ranges_fold_left_first.md) + - 範囲の最初の要素を初期値として`fold_left` +- [`ranges::fold_right_last`](ranges_fold_right_last.md) + - 範囲の最後の要素を初期値として`fold_right` +- [`ranges::fold_left_with_iter`](ranges_fold_left_with_iter.md) + - `fold_left`の結果と共に、計算した終端イテレータも返す + +## 参照 + +- [P2322R6 `ranges::fold`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2322r6.html) diff --git a/reference/algorithm/ranges_fold_left_with_iter.md b/reference/algorithm/ranges_fold_left_with_iter.md index c938670c29..681c60c905 100644 --- a/reference/algorithm/ranges_fold_left_with_iter.md +++ b/reference/algorithm/ranges_fold_left_with_iter.md @@ -53,17 +53,22 @@ using U = decay_t>>; * invoke_result_t[link /reference/type_traits/invoke_result.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] -(1)(2)ともに、以下と等価 - -```cpp -if (first == last) - return {std::move(first), U(std::move(init))}; -U accum = invoke(f, std::move(init), *first); -for (++first; first != last; ++first) - accum = invoke(f, std::move(accum), *first); -return {std::move(first), std::move(accum)}; -``` -* invoke[link /reference/functional/invoke.md] +- (1) : 以下と等価 + ```cpp + if (first == last) + return {std::move(first), U(std::move(init))}; + U accum = invoke(f, std::move(init), *first); + for (++first; first != last; ++first) + accum = invoke(f, std::move(accum), *first); + return {std::move(first), std::move(accum)}; + ``` + * invoke[link /reference/functional/invoke.md] +- (2) : `r`からイテレータを取得して(1)に委譲 + ```cpp + return ranges::fold_left_with_iter(ranges::begin(r), ranges::end(r), std::move(init), f); + ``` + * begin[link /reference/ranges/begin.md] + * end[link /reference/ranges/end.md] 空の入力範囲に対しては初期値`init`を返す。入力範囲によらず、戻り値の1つ目の値(イテレータ値)は渡した範囲の終端イテレータ(`last`/`ranges::end(r)`)と同じ位置を指すイテレータとなる(必ずしも同じ型もしくは同じイテレータにならない)。 @@ -226,7 +231,7 @@ constexpr auto fold_left_with_iter(I first, S last, T init, F f) -> fold_left_wi - 範囲の最初の要素を初期値として`fold_left` - [`ranges::fold_right_last`](ranges_fold_right_last.md) - 範囲の最後の要素を初期値として`fold_right` -- [`ranges::fold_left_first_with_iter`](ranges_fold_left_first_with_iter.md.nolink) +- [`ranges::fold_left_first_with_iter`](ranges_fold_left_first_with_iter.md) - `fold_left_first`の結果と共に、計算した終端イテレータも返す ## 参照 diff --git a/reference/algorithm/ranges_fold_right.md b/reference/algorithm/ranges_fold_right.md index 933c272869..5d80277bf9 100644 --- a/reference/algorithm/ranges_fold_right.md +++ b/reference/algorithm/ranges_fold_right.md @@ -302,7 +302,7 @@ constexpr auto fold_right(I first, S last, T init, F f) { - 範囲の最後の要素を初期値として`fold_right` - [`ranges::fold_left_with_iter`](ranges_fold_left_with_iter.md) - `fold_left`の結果と共に、計算した終端イテレータも返す -- [`ranges::fold_left_first_with_iter`](ranges_fold_left_first_with_iter.md.nolink) +- [`ranges::fold_left_first_with_iter`](ranges_fold_left_first_with_iter.md) - `fold_left_first`の結果と共に、計算した終端イテレータも返す ## 参照 diff --git a/reference/algorithm/ranges_fold_right_last.md b/reference/algorithm/ranges_fold_right_last.md index 30d0b7f6d8..83877e710c 100644 --- a/reference/algorithm/ranges_fold_right_last.md +++ b/reference/algorithm/ranges_fold_right_last.md @@ -217,7 +217,7 @@ constexpr auto fold_right_last(I first, S last, F f) { - 範囲の最初の要素を初期値として`fold_left` - [`ranges::fold_left_with_iter`](ranges_fold_left_with_iter.md) - `fold_left`の結果と共に、計算した終端イテレータも返す -- [`ranges::fold_left_first_with_iter`](ranges_fold_left_first_with_iter.md.nolink) +- [`ranges::fold_left_first_with_iter`](ranges_fold_left_first_with_iter.md) - `fold_left_first`の結果と共に、計算した終端イテレータも返す ## 参照 From 339d3119efc1bc733a9f2026a7bd9c7765f9fedb Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 13 Feb 2024 15:20:20 +0900 Subject: [PATCH 0719/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_in_value_result.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/algorithm/ranges_in_value_result.md b/reference/algorithm/ranges_in_value_result.md index 1cc5d96778..ae2d991287 100644 --- a/reference/algorithm/ranges_in_value_result.md +++ b/reference/algorithm/ranges_in_value_result.md @@ -44,7 +44,7 @@ namespace std::ranges { * (1): イテレータと値を格納する型 * (2): [`ranges::fold_left_with_iter`](/reference/algorithm/ranges_fold_left_with_iter.md)で使用するエイリアス -* (3): [`ranges::fold_left_first_with_iter`](/reference/algorithm/ranges_fold_left_first_with_iter.md.nolink)で使用するエイリアス +* (3): [`ranges::fold_left_first_with_iter`](/reference/algorithm/ranges_fold_left_first_with_iter.md)で使用するエイリアス この型は、関数が入力用に範囲を受け取る場合に、処理した範囲の末尾と、それとは別の出力を返すために使用される。 From fd536f9748b8e6d87e341140eb3fd7244a3b31eb Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 13 Feb 2024 16:59:14 +0900 Subject: [PATCH 0720/3948] =?UTF-8?q?algorithm=20:=20fold=E3=81=AE?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=A4=89=E6=9B=B4=E3=81=AA=E3=81=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/reference/algorithm.md b/reference/algorithm.md index 52bb983fb4..c045a2e4fe 100644 --- a/reference/algorithm.md +++ b/reference/algorithm.md @@ -159,6 +159,19 @@ ranges::sort(pv, {}, &Parson::name); | [`ranges::starts_with`](algorithm/ranges_starts_with.md) | 先頭が指定されたシーケンスと一致するかを調べる | C++23 | | [`ranges::ends_with`](algorithm/ranges_ends_with.md) | 末尾が指定されたシーケンスと一致するかを調べる | C++23 | +### `fold`アルゴリズム + +`fold`操作は、初期値及び累積値とともに範囲の各要素について与えられた関数を適用していき、その結果を返すものである。これは、数値集計処理に特化した[`accumulate`](/reference/numeric/accumulate.md)を改善しより汎用的にしたものである。処理を範囲のどちら側から始めるかによって、`foldl`(`fold_left`)と`foldr`(`fold_right`)の2種類がある。 + +| 名前 | 説明 | 対応バージョン | +| ------------------------------------------------------------------------------------ | ---------------------------------------------------------------- | -------------- | +| [`ranges::fold_left`](algorithm/ranges_fold_left.md) | 範囲の左(先頭)からの`fold` | C++23 | +| [`ranges::fold_right`](algorithm/ranges_fold_right.md) | 範囲の右(終端)からの`fold` | C++23 | +| [`ranges::fold_left_first`](algorithm/ranges_fold_left_first.md) | 範囲の左(先頭)からの`fold`、初期値を省略する | C++23 | +| [`ranges::fold_right_last`](algorithm/ranges_fold_right_last.md) | 範囲の右(終端)からの`fold`、初期値を省略する | C++23 | +| [`ranges::fold_left_with_iter`](algorithm/ranges_fold_left_with_iter.md) | 範囲の左(先頭)からの`fold`、終端イテレータを返す | C++23 | +| [`ranges::fold_left_first_with_iter`](algorithm/ranges_fold_left_first_with_iter.md) | 範囲の左(先頭)からの`fold`、初期値を省略し終端イテレータを返す | C++23 | + ## シーケンスを変更する操作 | 名前 | 説明 | 対応バージョン | @@ -420,20 +433,7 @@ ranges::sort(pv, {}, &Parson::name); | [`ranges::prev_permutation`](algorithm/ranges_prev_permutation.md) | 前の順列を生成する | C++20 | | [`ranges::is_permutation`](algorithm/ranges_is_permutation.md) | 範囲が順列かを判定する | C++20 | -### `fold`アルゴリズム - -`fold`操作は、初期値及び累積値とともに範囲の各要素について与えられた関数を適用していき、その結果を返すものである。これは、数値集計処理に特化した[`accumulate`](/reference/numeric/accumulate.md)を改善しより汎用的にしたものである。処理を範囲のどちら側から始めるかによって、`foldl`(`fold_left`)と`foldr`(`fold_right`)の2種類がある。 - -| 名前 | 説明 | 対応バージョン | -|-------------------------------------------------------|------------------------|-------| -| [`ranges::fold_left`](algorithm/ranges_fold_left.md) | 範囲の左(先頭)からの`fold` | C++23 | -| [`ranges::fold_right`](algorithm/ranges_fold_right.md)| 範囲の右(終端)からの`fold` | C++23 | -| [`ranges::fold_left_first`](algorithm/ranges_fold_left_first.md)| 範囲の左(先頭)からの`fold`、初期値を省略する | C++23 | -| [`ranges::fold_right_last`](algorithm/ranges_fold_right_last.md)| 範囲の右(終端)からの`fold`、初期値を省略する | C++23 | -| [`ranges::fold_left_with_iter`](algorithm/ranges_fold_left_with_iter.md) | 範囲の左(先頭)からの`fold`、終端イテレータを返す | C++23 | -| [`ranges::fold_left_first_with_iter`](algorithm/ranges_fold_left_first_with_iter.md) | 範囲の左(先頭)からの`fold`、初期値を省略し終端イテレータを返す | C++23 | - -### 戻り値 +## アルゴリズムの戻り値型 これらの型は、複数の値を1つの戻り値として返すために使われる汎用的な型である。構造化束縛で受け取ることが想定されている。 From 964e2a00ba570c745f4dbb3fb417ff3f659b9a7c Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 13 Feb 2024 17:11:24 +0900 Subject: [PATCH 0721/3948] =?UTF-8?q?=E7=AE=87=E6=9D=A1=E6=9B=B8=E3=81=8D?= =?UTF-8?q?=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_fold_left_first_with_iter.md | 1 + reference/algorithm/ranges_fold_left_with_iter.md | 1 + 2 files changed, 2 insertions(+) diff --git a/reference/algorithm/ranges_fold_left_first_with_iter.md b/reference/algorithm/ranges_fold_left_first_with_iter.md index 93496d7fdd..062e11cabb 100644 --- a/reference/algorithm/ranges_fold_left_first_with_iter.md +++ b/reference/algorithm/ranges_fold_left_first_with_iter.md @@ -69,6 +69,7 @@ using U = decltype(ranges::fold_left(std::move(first), last, iter_value_t(*fi ``` * optional[link /reference/optional/optional.md] * invoke[link /reference/functional/invoke.md] + - (2) : `r`からイテレータを取得して(1)に委譲 ```cpp return ranges::fold_left_first_with_iter(ranges::begin(r), ranges::end(r), f); diff --git a/reference/algorithm/ranges_fold_left_with_iter.md b/reference/algorithm/ranges_fold_left_with_iter.md index 681c60c905..45bd92d39f 100644 --- a/reference/algorithm/ranges_fold_left_with_iter.md +++ b/reference/algorithm/ranges_fold_left_with_iter.md @@ -63,6 +63,7 @@ using U = decay_t>>; return {std::move(first), std::move(accum)}; ``` * invoke[link /reference/functional/invoke.md] + - (2) : `r`からイテレータを取得して(1)に委譲 ```cpp return ranges::fold_left_with_iter(ranges::begin(r), ranges::end(r), std::move(init), f); From 0f1d4b4871304cd4ae5c46c82735fd23198dfca3 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 13 Feb 2024 18:29:51 +0900 Subject: [PATCH 0722/3948] =?UTF-8?q?C++23=20:=20=E3=80=8Cconstexpr?= =?UTF-8?q?=E9=96=A2=E6=95=B0=E5=86=85=E3=81=A7consteval=E9=96=A2=E6=95=B0?= =?UTF-8?q?=E3=82=92=E5=91=BC=E3=81=B3=E5=87=BA=E3=81=9B=E3=81=AA=E3=81=84?= =?UTF-8?q?=E5=95=8F=E9=A1=8C=E3=82=92=E8=BB=BD=E6=B8=9B=E3=80=8D=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20(close=20#1109)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp11/constexpr.md | 2 +- lang/cpp20/immediate_functions.md | 1 + lang/cpp23.md | 2 +- lang/cpp23/consteval_needs_to_propagate_up.md | 108 ++++++++++++++++++ 5 files changed, 112 insertions(+), 3 deletions(-) create mode 100644 lang/cpp23/consteval_needs_to_propagate_up.md diff --git a/implementation-status.md b/implementation-status.md index 123dd1ae4e..1fff18f79e 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -271,7 +271,7 @@ | P2246R1: [静的な診断メッセージの文字エンコーディング](/lang/cpp23/character_encoding_of_diagnostic_text.md) | `static_assert`や`[[deprecated]]`などの診断メッセージの文字集合に関する要件をなくす | - | yes | - | 2022 | | P2448R2: [`constexpr`関数が定数実行できない場合でも適格とする](/lang/cpp23/relaxing_some_constexpr_restrictions.md) | | 13 | 17 (partial) | 2024.0 (partial) | - | | P2647R1: [`constexpr`関数内での`static constexpr`変数を許可](/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md) | `constexpr`関数のローカルで定数を定義できるようにする | 13 | 16 | 2023.2 | - | -| P2564R3: [`constexpr`関数内で`consteval`関数を呼び出せない問題を緩和](/lang/cpp23/consteval_needs_to_propagate_up.md.nolink) | | - | 17 | - | 2024.0 | +| P2564R3: [`constexpr`関数内で`consteval`関数を呼び出せない問題を緩和](/lang/cpp23/consteval_needs_to_propagate_up.md) | `consteval`呼び出しを含む`constexpr`関数を条件付きで`consteval`関数とみなすようにする | - | 17 | - | 2024.0 | | P1102R2: [ラムダ式で`()`を省略できる条件を緩和](/lang/cpp23/down_with_lambda_parens.md) | 修飾や戻り値型をともなってもパラメータリストが空であれば`()`を省略できる | 11 | 13 | 2022.2 | - | | P2173R1: [ラムダ式に対する属性](/lang/cpp23/attributes_on_lambda_expressions.md) | ラムダ式のいくつかの箇所に属性を記述できるようにする | 9 | 13 | 2022.2 | - | | P1774R8: [コード内容の仮定をコンパイラに伝えるassume属性](/lang/cpp23/portable_assumptions.md) | 最適化のために、コードの仮定をコンパイラに伝える属性を標準化する | 13 | - | - | - | diff --git a/lang/cpp11/constexpr.md b/lang/cpp11/constexpr.md index ebbdd69b28..1b28c57e0a 100644 --- a/lang/cpp11/constexpr.md +++ b/lang/cpp11/constexpr.md @@ -206,7 +206,7 @@ GCC 5.2、Clang 3.7、Visual C++ 2015時点で、3つともデフォルトは512 - [C++20 可変サイズをもつコンテナの`constexpr`化](/lang/cpp20/more_constexpr_containers.md) - [C++23 `constexpr`関数が定数実行できない場合でも適格とする](/lang/cpp23/relaxing_some_constexpr_restrictions.md) - [C++23 `constexpr`関数内での`static constexpr`変数を許可](/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md) -- [C++23 `constexpr`関数内で`consteval`関数を呼び出せない問題を緩和](/lang/cpp23/consteval_needs_to_propagate_up.md.nolink) +- [C++23 `constexpr`関数内で`consteval`関数を呼び出せない問題を軽減](/lang/cpp23/consteval_needs_to_propagate_up.md) ## 参照 diff --git a/lang/cpp20/immediate_functions.md b/lang/cpp20/immediate_functions.md index df85a1da78..c0b8a9c570 100644 --- a/lang/cpp20/immediate_functions.md +++ b/lang/cpp20/immediate_functions.md @@ -102,6 +102,7 @@ C++11で導入された`constexpr`指定子によって、関数を定数式評 * [C++11 `constexpr`](/lang/cpp11/constexpr.md) * [C++20 コンパイル時初期化を強制する`constinit`キーワードを追加](constinit.md) * [C++23 `if consteval`](/lang/cpp23/if_consteval.md) +* [C++23 `constexpr`関数内で`consteval`関数を呼び出せない問題を軽減](/lang/cpp23/consteval_needs_to_propagate_up.md) ## 参照 diff --git a/lang/cpp23.md b/lang/cpp23.md index d0da48df29..db6a1a2cc7 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -73,7 +73,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 | [静的な診断メッセージの文字エンコーディング](cpp23/character_encoding_of_diagnostic_text.md) | `static_assert`や`[[deprecated]]`などの診断メッセージの文字集合に関する要件をなくす | | [`constexpr`関数が定数実行できない場合でも適格とする](cpp23/relaxing_some_constexpr_restrictions.md) | 定数式実行できない関数であっても、実際にコンパイル時に評価されない限り`constexpr`指定することを許可する | | [`constexpr`関数内での`static constexpr`変数を許可](cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md) | `constexpr`関数のローカルで定数を定義できるようにする | -| [`constexpr`関数内で`consteval`関数を呼び出せない問題を緩和](cpp23/consteval_needs_to_propagate_up.md.nolink) | | +| [`constexpr`関数内で`consteval`関数を呼び出せない問題を軽減](cpp23/consteval_needs_to_propagate_up.md) | `consteval`呼び出しを含む`constexpr`関数を条件付きで`consteval`関数とみなすようにする | ### ラムダ式 diff --git a/lang/cpp23/consteval_needs_to_propagate_up.md b/lang/cpp23/consteval_needs_to_propagate_up.md new file mode 100644 index 0000000000..5800006e9e --- /dev/null +++ b/lang/cpp23/consteval_needs_to_propagate_up.md @@ -0,0 +1,108 @@ +# constexpr関数内でconsteval関数を呼び出せない問題を軽減 +* cpp23[meta cpp] + +## 概要 +C++23では、`consteval`呼び出しを含む`constexpr`関数を、条件付きで`consteval`関数と見なすようになる。そうすることで、定数式の文脈での`consteval`関数の使用がよりかんたんになる。 + +```cpp example +#include + +consteval bool is_even(int x) { + return x % 2 == 0; +} + +int main() { + constexpr int ar[] = {1, 3, 5}; + + // consteval関数の非定数呼び出しにより (xは定数ではない)、 + // ラムダ式が暗黙にconstevalとなる + static_assert(std::ranges::none_of( + ar, + [](int x) { + return is_even(x); // C++20:NG, C++23:OK + } + )); + + // ラムダ式を明示的にconstevalにする + static_assert(std::ranges::none_of( + ar, + [](int x) consteval { + return is_even(x); // C++20:NG, C++23:OK + } + )); + + // is_evenは明らかに定数式評価される文脈 + // であるため使用可能 + static_assert(std::ranges::none_of( + ar, + is_even // C++20:NG, C++23:OK + )); +} +``` +* std::ranges::none_of[link /reference/algorithm/ranges_none_of.md] + + +## 仕様 +- `constexpr`関数が即時関数の文脈外の`consteval`関数呼び出しを含み、その呼び出しが定数式ではない場合に、その`constexpr`関数は暗黙的に`consteval`関数となる +- 上記の文脈で、即時呼び出しではない`consteval`関数を呼び出す場合、その文脈は暗黙的に`consteval`関数となる + +```cpp +consteval int id(int i) { return i; } +constexpr char id(char c) { return c; } + +template +constexpr int f(T t) { + return t + id(t); +} + +auto a = &f; // OK, fは即時関数ではない +auto b = &f; // エラー!fは即時関数 + +static_assert(f(3) == 6); // OK + +template +constexpr int g(T t) { // id(42)はすでに定数であるため + return t + id(42); // gは即時関数ではない +} + +template +constexpr bool is_not(T t, F f) { + return not f(t); +} + +consteval bool is_even(int i) { return i % 2 == 0; } + +static_assert(is_not(5, is_even)); // OK + +int x = 0; + +template +constexpr T h(T t = id(x)) { // hは即時関数ではない + return t; +} + +template +constexpr T hh() { // hhは即時関数 + return h(); +} + +int i = hh(); // 不適格。hh()は即時関数への昇格式である + +struct A { + int x; + int y = id(x); +}; + +template +constexpr int k(int) { // kは即時関数ではない + return A(42).y; // A(42)は定数式であり、即時関数への昇格がない +} +``` + + +## 関連項目 +- [C++20 即時関数](/lang/cpp20/immediate_functions.md) + + +## 参照 +- [P2564R3 `consteval` needs to propagate up](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2564r3.html) From 743eef73b83f3ea4dfb5e291a833a6e9ab785f27 Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 14 Feb 2024 10:14:41 +0900 Subject: [PATCH 0723/3948] =?UTF-8?q?generator:=20=E4=BE=8B=E7=A4=BA?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20=E7=AC=AC2=E3=83=86=E3=83=B3=E3=83=97?= =?UTF-8?q?=E3=83=AC=E3=83=BC=E3=83=88=E3=83=91=E3=83=A9=E3=83=A1=E3=83=BC?= =?UTF-8?q?=E3=82=BFV=E5=88=A9=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/generator/generator.md | 74 ++++++++++++++++++++++++++++++-- 1 file changed, 71 insertions(+), 3 deletions(-) diff --git a/reference/generator/generator.md b/reference/generator/generator.md index 6d5cf18c7b..fa391b6e89 100644 --- a/reference/generator/generator.md +++ b/reference/generator/generator.md @@ -163,7 +163,7 @@ std::generator evens() int main() { - // ジェネレータにより生成されるレンジのうち + // ジェネレータにより生成されるRangeのうち // 先頭から5個までの要素値を列挙する for (int n : evens() | std::views::take(5)) { std::cout << n << std::endl; @@ -183,7 +183,7 @@ int main() 8 ``` -### 例2: レンジ要素値の逐次生成 +### 例2: Range要素値の逐次生成 ```cpp example #include #include @@ -191,7 +191,7 @@ int main() #include #include -// レンジの要素値を逐次生成するコルーチン +// Rangeの要素値を逐次生成するコルーチン std::generator ints() { int arr[] = {1, 2, 3}; @@ -282,6 +282,74 @@ int main() ``` +### 例4: 第2テンプレートパラメータVの利用 +```cpp example +#include +#include +#include +#include +#include +#include + +// Ref=string_view, V=string のジェネレータコルーチン +auto fizzbuzz() -> + std::generator +{ + for (size_t i = 1; ; ++i) { + if (i % 15 == 0) { + co_yield "FizzBuzz"; + } else if (i % 3 == 0) { + co_yield "Fizz"; + } else if (i % 5 == 0) { + co_yield "Buzz"; + } else { + co_yield std::to_string(i); + } + } +} + +int main() +{ + // std::ranges::to() は変換元Rangeの range_value_t を利用して戻り値型を決定する。 + // ここでは std::vector 型を導出するために、ジェネレータコルーチンの + // 第2テンプレートパラメータ V = std::string として明示指定する必要がある。 + auto vec = fizzbuzz() | std::views::take(15) | std::ranges::to(); + + // もし fizzbuzz() 戻り値型が std::generator であった場合、 + // 変数 vec は std::vector 型となる。このときコルーチン内部実装の + // std::to_string() の戻り値 std::string オブジェクトはco_yield式末尾で寿命が切れるため、 + // 各要素 vec[i] に格納される std::string_view はダングリング(dangling)状態になってしまう。 + + for (const auto& e : vec) { + std::cout << e << std::endl; + } +} +``` +* std::generator[color ff0000] +* co_yield[link /lang/cpp20/coroutines.md] +* std::to_string[link /reference/string/to_string.md] +* std::views::take[link /reference/ranges/take_view.md] + +#### 出力 +``` +1 +2 +Fizz +4 +Buzz +Fizz +7 +8 +Fizz +Buzz +11 +Fizz +13 +14 +FizzBuzz +``` + + ## バージョン ### 言語 - C++23 From 505a00734a3b2449b2ed37343360a7ea70a9bdf5 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 14 Feb 2024 13:18:28 +0900 Subject: [PATCH 0724/3948] =?UTF-8?q?fold=5Fleft(=5Ffirst)=5Fwith=5Fiter?= =?UTF-8?q?=20:=20=E5=BE=97=E3=82=89=E3=82=8C=E3=82=8B=E3=82=A4=E3=83=86?= =?UTF-8?q?=E3=83=AC=E3=83=BC=E3=82=BF=E3=82=92=E5=88=A9=E7=94=A8=E3=81=99?= =?UTF-8?q?=E3=82=8B=E4=BE=8B=E8=BF=BD=E5=8A=A0=20#1088?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ranges_fold_left_first_with_iter.md | 45 +++++++++++++++++++ .../algorithm/ranges_fold_left_with_iter.md | 44 ++++++++++++++++++ 2 files changed, 89 insertions(+) diff --git a/reference/algorithm/ranges_fold_left_first_with_iter.md b/reference/algorithm/ranges_fold_left_first_with_iter.md index 062e11cabb..3a097dd8a7 100644 --- a/reference/algorithm/ranges_fold_left_first_with_iter.md +++ b/reference/algorithm/ranges_fold_left_first_with_iter.md @@ -191,6 +191,51 @@ int main() { -1 ``` +### 戻り値のイテレータを活用する例 + +```cpp example +#include +#include +#include +#include +#include + +using namespace std::ranges; + +int main() { + // forward_rangeな入力 + std::forward_list flist = {2, 4, 6, 7, 9, 3, 1, 4, 10, 3, 2, 6}; + + // take_whileを使用して、先頭から10未満の要素だけを取り出す + forward_range auto rng = flist | views::take_while([](int n) { return n < 10; }); + + auto [last, sum] = fold_left_first_with_iter(rng, std::plus<>{}); + + std::println("sum = {:d}", sum.value_or(0)); + + // 同じ範囲に対して別の処理をしたい + // rng(take_while)をそのまま使うとイテレーション時に終端判定をもう一度行うことになり非効率 + auto [unuse1, mul1] = fold_left_first_with_iter(rng, std::multiplies<>{}); + + // 先ほど求めた終端を使用して元の範囲の上で部分範囲を構築 + auto [unuse2, mul2] = fold_left_first_with_iter(subrange{flist.begin(), last}, std::multiplies<>{}); + + std::println("mul = {:d}, {:d}", mul1.value_or(0), mul2.value_or(0)); +} +``` +* fold_left_first_with_iter[color ff0000] +* take_while[link /reference/ranges/take_while_view.md] +* subrange[link /reference/ranges/subrange.md] +* println[link /reference/print/println.md] +* value_or[link /reference/optional/optional/value_or.md] + +### 出力 + +``` +sum = 36 +mul = 36288, 36288 +``` + ## 実装例 ```cpp diff --git a/reference/algorithm/ranges_fold_left_with_iter.md b/reference/algorithm/ranges_fold_left_with_iter.md index 45bd92d39f..9dc5bddf78 100644 --- a/reference/algorithm/ranges_fold_left_with_iter.md +++ b/reference/algorithm/ranges_fold_left_with_iter.md @@ -185,6 +185,50 @@ int main() { -1 ``` +### 戻り値のイテレータを活用する例 + +```cpp example +#include +#include +#include +#include +#include + +using namespace std::ranges; + +int main() { + // forward_rangeな入力 + std::forward_list flist = {2, 4, 6, 7, 9, 3, 1, 4, 10, 3, 2, 6}; + + // take_whileを使用して、先頭から10未満の要素だけを取り出す + forward_range auto rng = flist | views::take_while([](int n) { return n < 10; }); + + auto [last, sum] = fold_left_with_iter(rng, 0, std::plus<>{}); + + std::println("sum = {:d}", sum); + + // 同じ範囲に対して別の処理をしたい + // rng(take_while)をそのまま使うとイテレーション時に終端判定をもう一度行うことになり非効率 + auto [unuse1, mul1] = fold_left_with_iter(rng, 1, std::multiplies<>{}); + + // 先ほど求めた終端を使用して元の範囲の上で部分範囲を構築 + auto [unuse2, mul2] = fold_left_with_iter(subrange{flist.begin(), last}, 1, std::multiplies<>{}); + + std::println("mul = {:d}, {:d}", mul1, mul2); +} +``` +* fold_left_with_iter[color ff0000] +* take_while[link /reference/ranges/take_while_view.md] +* subrange[link /reference/ranges/subrange.md] +* println[link /reference/print/println.md] + +### 出力 + +``` +sum = 36 +mul = 36288, 36288 +``` + ## 実装例 ```cpp From 1203319a7c09317731b6e5f6a93d691b07a75fa7 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 14 Feb 2024 15:33:29 +0900 Subject: [PATCH 0725/3948] =?UTF-8?q?C++23=20:=20=E3=80=8C=E6=B1=8E?= =?UTF-8?q?=E7=94=A8=E7=9A=84=E3=81=AA=E3=82=BD=E3=83=BC=E3=82=B9=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E3=81=AE=E3=82=A8=E3=83=B3=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=87=E3=82=A3=E3=83=B3=E3=82=B0=E3=81=A8=E3=81=97=E3=81=A6?= =?UTF-8?q?UTF-8=E3=82=92=E3=82=B5=E3=83=9D=E3=83=BC=E3=83=88=E3=80=8D?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20(close=20#1047)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp23.md | 2 +- ...ort_for_utf8_as_a_portable_source_file_encoding.md | 11 +++++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 lang/cpp23/support_for_utf8_as_a_portable_source_file_encoding.md diff --git a/implementation-status.md b/implementation-status.md index 1fff18f79e..fe83155fda 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -278,7 +278,7 @@ | P2316R2: [文字リテラルエンコーディングを一貫させる](/lang/cpp23/consistent_character_literal_encoding.md) | プリプロセッサの条件式での文字リテラルの扱いをC++式と同様にする | yes | yes | 2022.2 | 2022 | | P2334R1: [`elif`/`elifdef`/`elifndef`のサポートを追加](/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md) | `#if`/`#ifdef`/`#ifndef`に対応する複数条件命令のサポートを追加する | 12 | 13 | 2022.2 | - | | P2437R1: [`#warning`のサポートを追加](/lang/cpp23/warning.md) | 多くのC++コンパイラが実装していたプリプロセス時の警告`#warning message`を正式サポート | yes | yes | 2023.2 | yes | -| P2295R6: [汎用的なソースコードのエンコーディングとしてUTF-8をサポート](/lang/cpp23/support_for_utf8_as_a_portable_source_file_encoding.md.nolink) | | 13 | 15 | 2023.2 | 2019 Update 2 | +| P2295R6: [汎用的なソースコードのエンコーディングとしてUTF-8をサポート](/lang/cpp23/support_for_utf8_as_a_portable_source_file_encoding.md) | すべてのコンパイラはUTF-8文字コードのソースコードをサポートしなければならない | 13 | 15 | 2023.2 | 2019 Update 2 | | P2223R2: [行末スペースを無視するよう規定](/lang/cpp23/trimming_whitespaces_before_line_splicing.md) | 行末が「\ 」でおわっていた場合にMSVCは行の継続をしない実装になっていたため動作を共通化するため仕様を規定 | Yes | Yes | 2022.2 | - | diff --git a/lang/cpp23.md b/lang/cpp23.md index db6a1a2cc7..71ab53b4f7 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -98,7 +98,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 | [文字リテラルエンコーディングを一貫させる](cpp23/consistent_character_literal_encoding.md) | プリプロセッサの条件式での文字リテラルの扱いをC++式と同様にする | | [`elif`/`elifdef`/`elifndef`のサポートを追加](cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md) | `#if`/`#ifdef`/`#ifndef`に対応する複数条件命令のサポートを追加する | | [`#warning`のサポートを追加](cpp23/warning.md) | 多くのC++コンパイラが実装していたプリプロセス時の警告`#warning message`を正式サポート | -| [汎用的なソースコードのエンコーディングとしてUTF-8をサポート](cpp23/support_for_utf8_as_a_portable_source_file_encoding.md.nolink) | | +| [汎用的なソースコードのエンコーディングとしてUTF-8をサポート](cpp23/support_for_utf8_as_a_portable_source_file_encoding.md) | すべてのコンパイラはUTF-8文字コードのソースコードをサポートしなければならない | ### 小さな変更 diff --git a/lang/cpp23/support_for_utf8_as_a_portable_source_file_encoding.md b/lang/cpp23/support_for_utf8_as_a_portable_source_file_encoding.md new file mode 100644 index 0000000000..43380ebda5 --- /dev/null +++ b/lang/cpp23/support_for_utf8_as_a_portable_source_file_encoding.md @@ -0,0 +1,11 @@ +# 汎用的なソースコードのエンコーディングとしてUTF-8をサポート +* cpp23[meta cpp] + +## 概要 +C++20まで、ソースコードの文字集合は実装定義だったが、その仕様では移植性に問題があった。C++23からは、すべてのコンパイラはUTF-8文字コードのソースコードをサポートしなければならないことが規定される。 + +コンパイラは、ほかの文字コードと区別するため、入力ファイルがUTF-8であることを決定する実装定義の手段をもたなければならない。つまり、BOM (バイトオーダーマーク) を認識するだけでは十分ではない。 + + +## 参照 +- [P2295R6 Support for UTF-8 as a portable source file encoding](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2295r6.pdf) From 38888cf915e267c80c9d5456e33e206d9d010c4c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 15 Feb 2024 19:09:50 +0900 Subject: [PATCH 0726/3948] =?UTF-8?q?C++23=20:=20=E3=80=8C=E6=B7=BB?= =?UTF-8?q?=E5=AD=97=E6=BC=94=E7=AE=97=E5=AD=90=E3=81=AE=E5=A4=9A=E6=AC=A1?= =?UTF-8?q?=E5=85=83=E3=82=B5=E3=83=9D=E3=83=BC=E3=83=88=E3=80=8D=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20(close=20#1028)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- ...ma_operator_in_subscripting_expressions.md | 3 ++ lang/cpp23.md | 2 +- .../multidimensional_subscript_operator.md | 50 +++++++++++++++++++ reference/mdspan/mdspan.md | 1 + 5 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 lang/cpp23/multidimensional_subscript_operator.md diff --git a/implementation-status.md b/implementation-status.md index fe83155fda..f27f136332 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -257,7 +257,7 @@ | P2324R2: [複合文の末尾へのラベルを許可](/lang/cpp23/labels_at_the_end_of_compound_statements.md) | C互換のため、複合文の末尾でのgoto文のラベルを許可する | 13 | 16 | 2023.2 | - | | P0847R7: [自身のオブジェクトを明示的にパラメータとして指定する](/lang/cpp23/deducing_this.md.nolink) | メンバ関数が`*this`の型・オブジェクトをパラメータとしてとり、`*this`オブジェクトがconst/非const、左辺値/右辺値であるかをメンバ関数内で識別できるようにする | - | 18 | - | 2022 Update 2 (partial) | | P1847R4: [アクセス制御の異なるメンバ変数のレイアウトを宣言順に規定](/lang/cpp23/make_declaration_order_layout_mandated.md) | アクセス制御の異なるメンバ変数のレイアウトは並び替えを許可されていたが宣言順に規定する | Yes | Yes | - | 2022 | -| P2128R6: [添字演算子の多次元サポート](/lang/cpp23/multidimensional_subscript_operator.nd.nolink) | `operator[](int x, int y, int z)`のように添字演算子のオーバーロードで複数のパラメータをとることを許可 | 12 | 15 | 2022.2 | - | +| P2128R6: [添字演算子の多次元サポート](/lang/cpp23/multidimensional_subscript_operator.md) | `operator[](int x, int y, int z)`のように添字演算子のオーバーロードで複数のパラメータをとることを許可 | 12 | 15 | 2022.2 | - | | P1169R4: [`this`ポインタをもつ必要のない演算子を`static`として宣言できるようにする](/lang/cpp23/static_operator.md) | 状態をもたないいくつかの演算子を`static`として宣言できるようにする | 13 | 16 | 2023.2 | - | | P2201R1: [異なる文字エンコーディングをもつ文字列リテラルの連結を不適格とする](/lang/cpp23/mixed_string_literal_concatenation.md) | `auto a = u8"" L"";`のような異なる文字エンコーディング同士での文字列リテラルを連結を禁止する | Yes | Yes | 2022.2 | Yes | | P2029R4: [文字・文字列リテラル中の数値・ユニバーサルキャラクタのエスケープに関する問題解決](/lang/cpp23/numeric_and_universal_character_escapes_in_character_and_string_literals.md.nolink) | | - | - | - | - | diff --git a/lang/cpp20/deprecate_uses_of_the_comma_operator_in_subscripting_expressions.md b/lang/cpp20/deprecate_uses_of_the_comma_operator_in_subscripting_expressions.md index 37d0e11070..46440463d0 100644 --- a/lang/cpp20/deprecate_uses_of_the_comma_operator_in_subscripting_expressions.md +++ b/lang/cpp20/deprecate_uses_of_the_comma_operator_in_subscripting_expressions.md @@ -15,5 +15,8 @@ ar[x, y] // C++17:OK, C++20:非推奨 既存のカンマ演算子をオーバーロードしたコードを使用する場合は、丸カッコで囲むこと。 +## 関連項目 +- [C++23 添字演算子の多次元サポート](/lang/cpp23/multidimensional_subscript_operator.md) + ## 参照 - [P1161R3 Deprecate uses of the comma operator in subscripting expressions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1161r3.html) diff --git a/lang/cpp23.md b/lang/cpp23.md index 71ab53b4f7..0bdead2eee 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -40,7 +40,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 |----------|------| | [自身のオブジェクトを明示的にパラメータとして指定する](cpp23/deducing_this.md.nolink) | メンバ関数が`*this`の型・オブジェクトをパラメータとしてとり、`*this`オブジェクトがconst/非const、左辺値/右辺値であるかをメンバ関数内で識別できるようにする | | [アクセス制御の異なるメンバ変数のレイアウトを宣言順に規定](cpp23/make_declaration_order_layout_mandated.md) | アクセス制御の異なるメンバ変数のレイアウトは並び替えを許可されていたが宣言順に規定する | -| [添字演算子の多次元サポート](cpp23/multidimensional_subscript_operator.nd.nolink) | `operator[](int x, int y, int z)`のように添字演算子のオーバーロードで複数のパラメータをとることを許可 | +| [添字演算子の多次元サポート](cpp23/multidimensional_subscript_operator.md) | `operator[](int x, int y, int z)`のように添字演算子のオーバーロードで複数のパラメータをとることを許可 | | [`this`ポインタをもつ必要のない演算子を`static`として宣言できるようにする](cpp23/static_operator.md) | 状態をもたないいくつかの演算子を`static`として宣言できるようにする | diff --git a/lang/cpp23/multidimensional_subscript_operator.md b/lang/cpp23/multidimensional_subscript_operator.md new file mode 100644 index 0000000000..89306c3bc8 --- /dev/null +++ b/lang/cpp23/multidimensional_subscript_operator.md @@ -0,0 +1,50 @@ +# 添字演算子の多次元サポート +* cpp23[meta cpp] + +## 概要 +C++23では、多次元配列クラスを定義するために必要となる、添字演算子のオーバーロードを定義する際の複数引数を許可する。 + +```cpp +R operator[](int x, int y, int z); +``` + +複数の許可がされるまでは、以下のような回避策がとられていた: + +- 添字アクセスを、関数呼び出し演算子で代用 +- カンマ演算子をオーバーロードして、複数引数をひとつの引数にまとめる + + +## 例 +```cpp example +struct Matrix2x2 { + float data[2 * 2]; + + float& operator[](int x, int y) { + return data[y * 2 + x]; + } +}; + +#include +int main() { + Matrix2x2 mat = { + 1.0f, 2.0f, + 3.0f, 4.0f + }; + + float r = mat[0, 1]; + std::cout << r << std::endl; +} +``` + +### 出力 +``` +3 +``` + +## 関連項目 +- [C++20 添字演算子内でのカンマ演算子の使用を非推奨化](/lang/cpp20/deprecate_uses_of_the_comma_operator_in_subscripting_expressions.md) +- [`std::mdspan`](/reference/mdspan/mdspan.md) + + +## 参照 +- [P2128R6 Multidimensional subscript operator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2128r6.pdf) diff --git a/reference/mdspan/mdspan.md b/reference/mdspan/mdspan.md index 671fa98d38..3d82ef40dd 100644 --- a/reference/mdspan/mdspan.md +++ b/reference/mdspan/mdspan.md @@ -181,6 +181,7 @@ int main() - [`extents`](extents.md) - [LayoutMappingPolicy](LayoutMappingPolicy.md) - [AccessorPolicy](AccessorPolicy.md) +- [C++23 添字演算子の多次元サポート](/lang/cpp23/multidimensional_subscript_operator.md) ## 参照 From 070dd0d0af8e0df080fce7c4ef024349bc4a9bf8 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 16 Feb 2024 16:09:00 +0900 Subject: [PATCH 0727/3948] =?UTF-8?q?C++23=20:=20=E3=80=8C=E7=84=A1?= =?UTF-8?q?=E6=84=8F=E5=91=B3=E3=81=AAexport=E5=AE=A3=E8=A8=80=E3=82=92?= =?UTF-8?q?=E7=A6=81=E6=AD=A2=E3=81=99=E3=82=8B=E3=80=8D=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=20(close=20#1110)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp20/modules.md | 5 +++++ lang/cpp23.md | 2 +- lang/cpp23/meaningful_exports.md | 30 ++++++++++++++++++++++++++++++ 4 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 lang/cpp23/meaningful_exports.md diff --git a/implementation-status.md b/implementation-status.md index f27f136332..210f999584 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -251,7 +251,7 @@ | P2290R3: [エスケープシーケンスの区切り](/lang/cpp23/delimited_escape_sequences.md) | エスケープシーケンスの範囲を明確にする構文を追加する | 13 | 15 | 2023.2 | - | | P2266R3: [暗黙的なムーブを簡略化](/lang/cpp23/simpler_implicit_move.md.nolink) | 参照を返す関数の`return`文で暗黙的にムーブされない問題を修正 | 13 | 13 | 2022.2 | - | | P1787R6: [スコープと名前ルックアップの仕様整理](/lang/cpp23/declarations_and_where_to_find_them.md.nolink) | 複雑で不完全になっているスコープと名前ルックアップの仕様を整理し、一部の問題を解決する | - | - | - | - | -| P2615R1: [無意味なexport宣言を禁止する](/lang/cpp23/meaningful_exports.md.nolink) | | - | - | - | - | +| P2615R1: [無意味なexport宣言を禁止する](/lang/cpp23/meaningful_exports.md) | いくつかの不必要な宣言に対するモジュールexportを禁止する | - | - | - | - | | P2360R0: [初期化文での型の別名宣言を許可](/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md) | `for (using T = int; T e : v) {}`を許可 | 12 | 14 | 2022.2 | - | | P2718R0: [範囲for文が範囲初期化子内で生じた一時オブジェクトを延命することを規定](lang/cpp23/lifetime_extension_in_range_based_for_loop.md) | | - | - | - | - | | P2324R2: [複合文の末尾へのラベルを許可](/lang/cpp23/labels_at_the_end_of_compound_statements.md) | C互換のため、複合文の末尾でのgoto文のラベルを許可する | 13 | 16 | 2023.2 | - | diff --git a/lang/cpp20/modules.md b/lang/cpp20/modules.md index 18ac40167e..dd9cf2a311 100644 --- a/lang/cpp20/modules.md +++ b/lang/cpp20/modules.md @@ -479,6 +479,11 @@ int main() { モジュールは、以上のような問題のないプログラム分割の仕組みとして導入された。 + +## 関連項目 +- [C++23 無意味なexport宣言を禁止する](/lang/cpp23/meaningful_exports.md) + + ## 参照 - [[C++]C++20モジュールの変遷 - Module TSからC++20DISまで - 地面を見下ろす少年の足蹴にされる私](https://onihusube.hatenablog.com/entry/2021/05/28/214612) - [P1103R3 Merging Modules](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1103r3.pdf) diff --git a/lang/cpp23.md b/lang/cpp23.md index 0bdead2eee..8067f76e14 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -22,7 +22,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| | [スコープと名前ルックアップの仕様整理](cpp23/declarations_and_where_to_find_them.md.nolink) | 複雑で不完全になっているスコープと名前ルックアップの仕様を整理し、一部の問題を解決する | -| [無意味なexport宣言を禁止する](cpp23/meaningful_exports.md.nolink) | | +| [無意味なexport宣言を禁止する](cpp23/meaningful_exports.md) | いくつかの不必要な宣言に対するモジュールexportを禁止する | ### 制御構文 diff --git a/lang/cpp23/meaningful_exports.md b/lang/cpp23/meaningful_exports.md new file mode 100644 index 0000000000..638b7c073c --- /dev/null +++ b/lang/cpp23/meaningful_exports.md @@ -0,0 +1,30 @@ +# 無意味なexport宣言を禁止する +* cpp23[meta cpp] + +## 概要 +C++20時点でのモジュール定義では、いくつかの不必要なexport宣言ができてしまっていた。 + +```cpp +template export void f(); +export template void f(); +export template<> void g(int); +template<> export void g(int); +export template struct trait; +``` + +C++23では、本来必要のない以下の宣言に対するexport宣言を禁止する: + +- 明示的なインスタンス化 +- 明示的な特殊化 +- export宣言 + +ただし、この変更のあとでも、`export { … }`で囲まれた中では、これらが含まれていてもコンパイルエラーにはならない。 + + +## 関連項目 +- [C++20 モジュール](/lang/cpp20/modules.md) + + +## 参照 +- [P2615R1 Meaningful exports](https://open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2615r1.html) +- [CWG Issue 2443. Meaningless template exports](https://wg21.cmeerw.net/cwg/issue2443) From d936b9784bebd63ee4e8d51e58e8f38f290b8642 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 16 Feb 2024 21:34:08 +0900 Subject: [PATCH 0728/3948] =?UTF-8?q?C++23=20:=20=E3=80=8C=E5=A4=89?= =?UTF-8?q?=E6=95=B0=E3=83=86=E3=83=B3=E3=83=97=E3=83=AC=E3=83=BC=E3=83=88?= =?UTF-8?q?=E3=81=AE=E9=83=A8=E5=88=86=E7=89=B9=E6=AE=8A=E5=8C=96=E3=82=92?= =?UTF-8?q?=E8=A8=B1=E5=8F=AF=E3=80=8D=E3=82=92=E8=BF=BD=E5=8A=A0=20(close?= =?UTF-8?q?=20#1034)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp14/variable_templates.md | 1 + lang/cpp23.md | 2 +- ...zed_wording_for_partial_specializations.md | 40 +++++++++++++++++++ 4 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 lang/cpp23/generalized_wording_for_partial_specializations.md diff --git a/implementation-status.md b/implementation-status.md index 210f999584..d422d1bc74 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -263,7 +263,7 @@ | P2029R4: [文字・文字列リテラル中の数値・ユニバーサルキャラクタのエスケープに関する問題解決](/lang/cpp23/numeric_and_universal_character_escapes_in_character_and_string_literals.md.nolink) | | - | - | - | - | | P2362R3: [1ワイド文字に収まらないワイド文字リテラルを禁止する](/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md) | エンコード結果として`wchar_t`の大きさに収まらないワイド文字リテラルを禁止する | 13 | 14 | 2023.2 | - | | P2071R2: [名前付きユニバーサルキャラクタ名](/lang/cpp23/named_universal_character_escapes.md) | 16進数のユニバーサルキャラクタだけでなく、その文字の名前を入力できるようにする | 13 | 15 | 2023.2 | - | -| P2096R2: [部分特殊化の汎用化仕様](/lang/cpp23/generalized_wording_for_partial_specializations.md.nolink) | 変数テンプレートの部分特殊化を許可するために部分特殊化の仕様を汎用化 | - | - | - | - | +| P2096R2: [変数テンプレートの部分特殊化を許可](/lang/cpp23/generalized_wording_for_partial_specializations.md) | 変数テンプレートの部分特殊化を許可するために部分特殊化の仕様を汎用化 | - | - | - | - | | P2582R1: [継承コンストラクタからのクラステンプレート引数の推論](/lang/cpp23/class_template_argument_deduction_from_inherited.md) | 継承コンストラクタからもクラステンプレート引数を推論できるようにする | - | - | - | - | | P1938R3: [`if consteval`](/lang/cpp23/if_consteval.md) | コンパイル時の文脈かどうかで分岐させる | 12 | 14 | - | - | | P1401R5: [定数式の文脈での`bool`への縮小変換を許可](/lang/cpp23/narrowing_contextual_conversions_to_bool.md) | `if constexpr(flags & Flags::Exec)`や`static_assert(N);`を許可 | 9 | 13 | 2022.2 | - | diff --git a/lang/cpp14/variable_templates.md b/lang/cpp14/variable_templates.md index 301e947498..c05a84e117 100644 --- a/lang/cpp14/variable_templates.md +++ b/lang/cpp14/variable_templates.md @@ -123,6 +123,7 @@ auto main() -> int ## 関連項目 - [C++11 `constexpr`](/lang/cpp11/constexpr.md) - [C++17 変数テンプレートのデフォルトテンプレート引数を許可](/lang/cpp17/allow_default_template_arguments_of_variable_templates.md) +- [C++23 変数テンプレートの部分特殊化を許可](/lang/cpp23/generalized_wording_for_partial_specializations.md) ## 参照 - [N3651 Variable Templates (Revision 1)](http://open-std.org/JTC1/SC22/WG21/docs/papers/2013/n3651.pdf) diff --git a/lang/cpp23.md b/lang/cpp23.md index 8067f76e14..02ab2a1925 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -59,7 +59,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| -| [部分特殊化の汎用化仕様](cpp23/generalized_wording_for_partial_specializations.md.nolink) | 変数テンプレートの部分特殊化を許可するために部分特殊化の仕様を汎用化 | +| [変数テンプレートの部分特殊化を許可](cpp23/generalized_wording_for_partial_specializations.md) | 変数テンプレートの部分特殊化を許可するために部分特殊化の仕様を汎用化 | | [継承コンストラクタからのクラステンプレート引数の推論](cpp23/class_template_argument_deduction_from_inherited.md) | 継承コンストラクタからもクラステンプレート引数を推論できるようにする | diff --git a/lang/cpp23/generalized_wording_for_partial_specializations.md b/lang/cpp23/generalized_wording_for_partial_specializations.md new file mode 100644 index 0000000000..4c58ca2850 --- /dev/null +++ b/lang/cpp23/generalized_wording_for_partial_specializations.md @@ -0,0 +1,40 @@ +# 変数テンプレートの部分特殊化を許可 +* cpp23[meta cpp] + +## 概要 +変数テンプレートの仕様として、部分特殊化の許可を意図したような仕様はあったが、部分特殊化の多くの仕様はクラステンプレートのみを対象にしていた。 + +C++23では部分特殊化の仕様を見直し、変数テンプレートの部分特殊化を明確に許可する。 + + +## 例 +```cpp example +#include + +template +constexpr T zero = 0; + +template +constexpr T* zero = nullptr; + +int main() { + int x = zero; + int* y = zero; + + std::cout << x << std::endl; + std::cout << y << std::endl; +} +``` + +### 出力例 +``` +0 +(nil) +``` + +## 関連項目 +- [C++14 変数テンプレート](/lang/cpp14/variable_templates.md) + + +## 参照 +- [P2096R2 Generalized wording for partial specializations](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2096r2.html) From 57afeb888266e9a11bb64d6ab0e760c7ab6d968a Mon Sep 17 00:00:00 2001 From: suomesta Date: Sat, 17 Feb 2024 15:25:04 +0900 Subject: [PATCH 0729/3948] fix some wrong link --- reference/barrier/barrier/wait.md | 2 +- reference/chrono/is_pm.md | 2 +- reference/ctime/timespec_get.md | 4 ++-- reference/filesystem/file_time_type.md | 4 ++-- reference/filesystem/path/end.md | 4 ++-- reference/filesystem/space.md | 4 ++-- reference/format/format.md | 8 ++++---- reference/locale/codecvt_byname.md | 2 +- reference/memory/shared_ptr/static_pointer_cast.md | 2 +- reference/queue/queue/pop.md | 2 +- reference/stop_token/nostopstate.md | 2 +- reference/stop_token/stop_callback.md | 2 +- reference/stop_token/stop_source.md | 2 +- reference/stop_token/stop_source/get_token.md | 2 +- reference/stop_token/stop_source/request_stop.md | 2 +- reference/stop_token/stop_source/stop_possible.md | 2 +- reference/stop_token/stop_source/stop_requested.md | 2 +- reference/stop_token/stop_token.md | 2 +- reference/streambuf/basic_streambuf/setbuf.md | 5 +++++ reference/string/basic_string/compare.md | 2 +- reference/thread/jthread.md | 2 +- reference/unordered_map/unordered_map/at.md | 2 +- 22 files changed, 33 insertions(+), 28 deletions(-) diff --git a/reference/barrier/barrier/wait.md b/reference/barrier/barrier/wait.md index 4085eebca4..fe7cdb7dcb 100644 --- a/reference/barrier/barrier/wait.md +++ b/reference/barrier/barrier/wait.md @@ -83,7 +83,7 @@ int main() } ``` * wait[color ff0000] -* arrive[link wait.md] +* arrive[link arrive.md] * arrive_and_wait[link arrive_and_wait.md] * std::move[link /reference/utility/move.md] * std::this_thread::sleep_for[link /reference/thread/this_thread/sleep_for.md] diff --git a/reference/chrono/is_pm.md b/reference/chrono/is_pm.md index 961cfce410..19b64979d3 100644 --- a/reference/chrono/is_pm.md +++ b/reference/chrono/is_pm.md @@ -39,7 +39,7 @@ int main() * chrono::is_pm[color ff0000] * chrono::hh_mm_ss[link hh_mm_ss.md] * time.hours()[link hh_mm_ss/hours.md] -* chrono::is_am[link is_pm.md] +* chrono::is_am[link is_am.md] ### 出力 ``` diff --git a/reference/ctime/timespec_get.md b/reference/ctime/timespec_get.md index 33996f8aed..3aa3744376 100644 --- a/reference/ctime/timespec_get.md +++ b/reference/ctime/timespec_get.md @@ -54,8 +54,8 @@ int main() std::cout << std::ctime(&ts.tv_sec) << std::endl; } ``` -* std::timespec[color ff0000] -* std::timespec_get[link timespec_get.md] +* std::timespec_get[color ff0000] +* std::timespec[link timespec.md] * TIME_UTC[link time_utc.md] * ms.count()[link /reference/chrono/duration/count.md] diff --git a/reference/filesystem/file_time_type.md b/reference/filesystem/file_time_type.md index 257a03feca..fcb3a3b7bf 100644 --- a/reference/filesystem/file_time_type.md +++ b/reference/filesystem/file_time_type.md @@ -60,8 +60,8 @@ int main() fs::last_write_time("regular.txt", fs::file_time_type::clock::now()); } ``` -* fs::last_write_time[color ff0000] -* fs::file_time_type[link file_time_type.md] +* fs::file_time_type[color ff0000] +* fs::last_write_time[link last_write_time.md] * fs::create_directory[link create_directory.md] * tp.time_since_epoch()[link /reference/chrono/time_point/time_since_epoch.md] * sec.count()[link /reference/chrono/duration/count.md] diff --git a/reference/filesystem/path/end.md b/reference/filesystem/path/end.md index 73a77e82a7..4059a501b4 100644 --- a/reference/filesystem/path/end.md +++ b/reference/filesystem/path/end.md @@ -41,7 +41,7 @@ int main() } ``` * end()[color ff0000] -* p.begin()[link end.md] +* p.begin()[link begin.md] * iterator[link iterator.md] #### 出力 @@ -73,7 +73,7 @@ int main() } ``` * end()[color ff0000] -* p.begin()[link end.md] +* p.begin()[link begin.md] * iterator[link iterator.md] #### 出力 diff --git a/reference/filesystem/space.md b/reference/filesystem/space.md index b0e0d5f314..58a48ef390 100644 --- a/reference/filesystem/space.md +++ b/reference/filesystem/space.md @@ -59,8 +59,8 @@ int main() print_space("available", info.available); } ``` -* fs::space_info[color ff0000] -* fs::space[link space.md] +* fs::space[color ff0000] +* fs::space_info[link space_info.md] * std::uintmax_t[link /reference/cstdint/uintmax_t.md] #### 出力例 diff --git a/reference/format/format.md b/reference/format/format.md index 22659c5a62..9ed95e7e4f 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -342,11 +342,11 @@ int main() { #### 出力 ``` -hello -"hello" -hello +0. hello +1. "hello" +2. hello world -"hello\nworld" +3. "hello\nworld" ``` ### コンテナ・Rangeを出力する (C++23) diff --git a/reference/locale/codecvt_byname.md b/reference/locale/codecvt_byname.md index 78955ccf1c..b3502a8554 100644 --- a/reference/locale/codecvt_byname.md +++ b/reference/locale/codecvt_byname.md @@ -9,7 +9,7 @@ namespace std { class codecvt_byname : public codecvt; } ``` -* codecvt[link codecvt_byname.md] +* codecvt[link codecvt.md] ## 概要 diff --git a/reference/memory/shared_ptr/static_pointer_cast.md b/reference/memory/shared_ptr/static_pointer_cast.md index 34c38560b0..5514da6162 100644 --- a/reference/memory/shared_ptr/static_pointer_cast.md +++ b/reference/memory/shared_ptr/static_pointer_cast.md @@ -65,7 +65,7 @@ int main() { } } ``` -* std::static_pointer_cast[link static_pointer_cast.md] +* std::static_pointer_cast[color ff0000] * std::make_shared[link /reference/memory/make_shared.md] ### 出力 diff --git a/reference/queue/queue/pop.md b/reference/queue/queue/pop.md index 5dc5ec3e00..a62ed8eeec 100644 --- a/reference/queue/queue/pop.md +++ b/reference/queue/queue/pop.md @@ -39,7 +39,7 @@ int main() { return 0; } ``` -* pop()[link pop.md] +* pop()[color ff0000] * que.push[link push.md] * que.front()[link front.md] diff --git a/reference/stop_token/nostopstate.md b/reference/stop_token/nostopstate.md index 39ebce17d0..08d29b8c48 100644 --- a/reference/stop_token/nostopstate.md +++ b/reference/stop_token/nostopstate.md @@ -39,9 +39,9 @@ int main() assert(st2.stop_possible() == false); } ``` +* std::nostopstate[color ff0000] * std::stop_token[link stop_token.md] * std::stop_source[link stop_source.md] -* std::nostopstate[link nostopstate.md] * stop_possible()[link stop_token/stop_possible.md] * get_token()[link stop_source/get_token.md] diff --git a/reference/stop_token/stop_callback.md b/reference/stop_token/stop_callback.md index 1d7885aa49..1886e40624 100644 --- a/reference/stop_token/stop_callback.md +++ b/reference/stop_token/stop_callback.md @@ -70,9 +70,9 @@ int main() assert(msg == "hello world"); } ``` +* std::stop_callback[color ff0000] * std::stop_token[link stop_token.md] * std::stop_source[link stop_source.md] -* std::stop_callback[link stop_callback.md] * request_stop()[link stop_source/request_stop.md] * get_token()[link stop_source/get_token.md] diff --git a/reference/stop_token/stop_source.md b/reference/stop_token/stop_source.md index 4f5733efd8..d9cedc0641 100644 --- a/reference/stop_token/stop_source.md +++ b/reference/stop_token/stop_source.md @@ -62,8 +62,8 @@ int main() assert(invoked == true); } ``` +* std::stop_source[color ff0000] * std::stop_token[link stop_token.md] -* std::stop_source[link stop_source.md] * stop_callback[link stop_callback.md] * stop_requested()[link stop_token/stop_requested.md] * request_stop()[link stop_source/request_stop.md] diff --git a/reference/stop_token/stop_source/get_token.md b/reference/stop_token/stop_source/get_token.md index 86587b08ec..3c9852d2f0 100644 --- a/reference/stop_token/stop_source/get_token.md +++ b/reference/stop_token/stop_source/get_token.md @@ -35,11 +35,11 @@ int main() assert(st2.stop_possible() == false); } ``` +* get_token()[color ff0000] * std::stop_token[link ../stop_token.md] * std::stop_source[link ../stop_source.md] * std::nostopstate[link ../nostopstate.md] * stop_possible()[link ../stop_token/stop_requested.md] -* get_token()[link get_token.md] ### 出力 ``` diff --git a/reference/stop_token/stop_source/request_stop.md b/reference/stop_token/stop_source/request_stop.md index 45fd15118e..831701b671 100644 --- a/reference/stop_token/stop_source/request_stop.md +++ b/reference/stop_token/stop_source/request_stop.md @@ -107,11 +107,11 @@ int main() } } ``` +* request_stop()[color ff0000] * stop_source[link ../stop_source.md] * nostopstate[link ../nostopstate.md] * stop_callback[link ../stop_callback.md] * get_token()[link get_token.md] -* request_stop()[link request_stop.md] * condition_variable_any[link /reference/condition_variable/condition_variable_any.md] * cv.wait[link /reference/condition_variable/condition_variable_any/wait.md] * std::this_thread::sleep_for[link /reference/thread/this_thread/sleep_for.md] diff --git a/reference/stop_token/stop_source/stop_possible.md b/reference/stop_token/stop_source/stop_possible.md index 32af6a991e..e538eecfdf 100644 --- a/reference/stop_token/stop_source/stop_possible.md +++ b/reference/stop_token/stop_source/stop_possible.md @@ -32,9 +32,9 @@ int main() assert(ss2.stop_possible() == false); } ``` +* stop_possible()[color ff0000] * stop_source[link ../stop_source.md] * nostopstate[link ../nostopstate.md] -* stop_possible()[link stop_possible.md] ### 出力 ``` diff --git a/reference/stop_token/stop_source/stop_requested.md b/reference/stop_token/stop_source/stop_requested.md index eb4091139e..8f58652155 100644 --- a/reference/stop_token/stop_source/stop_requested.md +++ b/reference/stop_token/stop_source/stop_requested.md @@ -38,9 +38,9 @@ int main() assert(ss2.stop_requested() == false); } ``` +* stop_requested()[color ff0000] * stop_source[link ../stop_source.md] * std::nostopstate[link ../nostopstate.md] -* stop_requested()[link stop_requested.md] * request_stop()[link request_stop.md] ### 出力 diff --git a/reference/stop_token/stop_token.md b/reference/stop_token/stop_token.md index cbf8302ed4..d8998fbe8e 100644 --- a/reference/stop_token/stop_token.md +++ b/reference/stop_token/stop_token.md @@ -58,7 +58,7 @@ int main() assert(st.stop_requested() == true); } ``` -* std::stop_token[link stop_token.md] +* std::stop_token[color ff0000] * std::stop_source[link stop_source.md] * stop_requested()[link stop_token/stop_requested.md] * request_stop()[link stop_source/request_stop.md] diff --git a/reference/streambuf/basic_streambuf/setbuf.md b/reference/streambuf/basic_streambuf/setbuf.md index b1fe4aa9b7..987a6e7840 100644 --- a/reference/streambuf/basic_streambuf/setbuf.md +++ b/reference/streambuf/basic_streambuf/setbuf.md @@ -42,6 +42,11 @@ int main() { } ``` +### 出力例 +``` +ABC +``` + ## バージョン ### 言語 - C++98 diff --git a/reference/string/basic_string/compare.md b/reference/string/basic_string/compare.md index 4e65ba6d22..6797746a7b 100644 --- a/reference/string/basic_string/compare.md +++ b/reference/string/basic_string/compare.md @@ -154,7 +154,7 @@ int main() std::cout << a.compare(c) << std::endl; } ``` -* compare[link compare.md] +* compare[color ff0000] ### 出力例 ``` diff --git a/reference/thread/jthread.md b/reference/thread/jthread.md index 45fd08c05a..8e231b9483 100644 --- a/reference/thread/jthread.md +++ b/reference/thread/jthread.md @@ -153,7 +153,7 @@ int main() return 0; } ``` -* std::jthread[link jthread.md] +* std::jthread[color ff0000] * std::stop_token[link /reference/stop_token/stop_token.md] * std::stop_callback[link /reference/stop_token/stop_callback.md] * get_stop_token()[link jthread/get_stop_token.md] diff --git a/reference/unordered_map/unordered_map/at.md b/reference/unordered_map/unordered_map/at.md index f34d1610a0..755396ff4f 100644 --- a/reference/unordered_map/unordered_map/at.md +++ b/reference/unordered_map/unordered_map/at.md @@ -51,8 +51,8 @@ int main() return 0; } ``` +* c.at[color ff0000] * um.insert[link insert.md] -* c.at[link at.md] ### 出力 ``` From 83974c144e953cce2613b7de0f6b62f2e524bdc0 Mon Sep 17 00:00:00 2001 From: kamitani <48343709+kamitani08@users.noreply.github.com> Date: Mon, 19 Feb 2024 13:52:16 +0900 Subject: [PATCH 0730/3948] =?UTF-8?q?=E3=80=8C=E3=82=B9=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=97=E4=BB=98=E3=81=8D=E5=88=97=E6=8C=99=E5=9E=8B=E3=81=AE?= =?UTF-8?q?using=E5=AE=A3=E8=A8=80=E3=80=8D=E3=81=AE=E3=82=B5=E3=83=B3?= =?UTF-8?q?=E3=83=97=E3=83=AB=E3=82=B3=E3=83=BC=E3=83=89=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit enum class は整数への暗黙的型変換を提供しておらず、サンプルコードの記載方法ではエラーとなっていたため、キャストを使用する形でエラーの回避を行いました。 参考:https://timsong-cpp.github.io/cppwp/n4861/enum#dcl.enum-10 また、出力の方もコンパイルが成功した場合は「1」となる想定の物が「10」と記載されていたため、同コミットでまとめて修正を行っています。 --- lang/cpp20/using_enum.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lang/cpp20/using_enum.md b/lang/cpp20/using_enum.md index 80badcc204..c4e4240855 100644 --- a/lang/cpp20/using_enum.md +++ b/lang/cpp20/using_enum.md @@ -81,20 +81,20 @@ int main() { using enum Enum1; using enum Enum2::Enum; using Enum3::Value3; - std::cout << Value1 << std::endl; + std::cout << static_cast(Value1) << std::endl; std::cout << ::Value1 << std::endl; std::cout << Value2 << std::endl; - std::cout << Value3 << std::endl; - std::cout << Enum3::Value4 << std::endl; - std::cout << Type::Value4 << std::endl; - std::cout << Type().Value4 << std::endl; + std::cout << static_cast(Value3) << std::endl; + std::cout << static_cast(Enum3::Value4) << std::endl; + std::cout << static_cast(Type::Value4) << std::endl; + std::cout << static_cast(Type().Value4) << std::endl; } ``` ### 出力 ``` 0 -10 +1 0 0 1 From 6b575150f49bbf1ae0ef5067bf91619145aa5bb2 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Mon, 19 Feb 2024 16:08:06 +0900 Subject: [PATCH 0731/3948] =?UTF-8?q?=E6=9A=97=E9=BB=99=E7=9A=84=E3=81=AA?= =?UTF-8?q?=E3=83=A0=E3=83=BC=E3=83=96=E3=82=92=E7=B0=A1=E7=95=A5=E5=8C=96?= =?UTF-8?q?=20:=20=E6=A6=82=E8=A6=81=E3=81=BE=E3=81=A7=20#1021?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp23.md | 2 +- lang/cpp23/simpler_implicit_move.md | 92 +++++++++++++++++++++++++++++ 3 files changed, 94 insertions(+), 2 deletions(-) create mode 100644 lang/cpp23/simpler_implicit_move.md diff --git a/implementation-status.md b/implementation-status.md index d422d1bc74..fbf47df5d3 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -249,7 +249,7 @@ |----------|------|------------|----------------|------------|--------------| | P0330R8: [(符号付き)`size_t`リテラルのためのサフィックス](/lang/cpp23/literal_suffix_for_signed_size_t.md) | `42z`/`42Z`とすることで`size_t`に対応する符号付き整数型のリテラルとする | 11 | 13 | 2022.2 | - | | P2290R3: [エスケープシーケンスの区切り](/lang/cpp23/delimited_escape_sequences.md) | エスケープシーケンスの範囲を明確にする構文を追加する | 13 | 15 | 2023.2 | - | -| P2266R3: [暗黙的なムーブを簡略化](/lang/cpp23/simpler_implicit_move.md.nolink) | 参照を返す関数の`return`文で暗黙的にムーブされない問題を修正 | 13 | 13 | 2022.2 | - | +| P2266R3: [暗黙的なムーブを簡略化](/lang/cpp23/simpler_implicit_move.md) | 参照を返す関数の`return`文で暗黙的にムーブされない問題を修正 | 13 | 13 | 2022.2 | - | | P1787R6: [スコープと名前ルックアップの仕様整理](/lang/cpp23/declarations_and_where_to_find_them.md.nolink) | 複雑で不完全になっているスコープと名前ルックアップの仕様を整理し、一部の問題を解決する | - | - | - | - | | P2615R1: [無意味なexport宣言を禁止する](/lang/cpp23/meaningful_exports.md) | いくつかの不必要な宣言に対するモジュールexportを禁止する | - | - | - | - | | P2360R0: [初期化文での型の別名宣言を許可](/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md) | `for (using T = int; T e : v) {}`を許可 | 12 | 14 | 2022.2 | - | diff --git a/lang/cpp23.md b/lang/cpp23.md index 02ab2a1925..4b6f86db45 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -12,7 +12,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| | [(符号付き)`size_t`リテラルのためのサフィックス](cpp23/literal_suffix_for_signed_size_t.md) | `42z`/`42Z`とすることで`size_t`に対応する符号付き整数型のリテラルとする | -| [暗黙的なムーブを簡略化](cpp23/simpler_implicit_move.md.nolink) | 参照を返す関数の`return`文で暗黙的にムーブされない問題を修正 | +| [暗黙的なムーブを簡略化](cpp23/simpler_implicit_move.md) | 参照を返す関数の`return`文で暗黙的にムーブされない問題を修正 | これらに加えて、ライブラリ機能として拡張浮動小数点数型が定義された。[``](/reference/stdfloat.md)を参照。 diff --git a/lang/cpp23/simpler_implicit_move.md b/lang/cpp23/simpler_implicit_move.md new file mode 100644 index 0000000000..9400cc8af9 --- /dev/null +++ b/lang/cpp23/simpler_implicit_move.md @@ -0,0 +1,92 @@ +# 暗黙的なムーブを簡略化 +* cpp23[meta cpp] + +## 概要 + +C++20の暗黙ムーブ仕様においては、暗黙ムーブ可能なもの(関数ローカルのオブジェクト/右辺値参照)が`return`文においてコピーされる場合に、可能ならば暗黙的にムーブして戻り値を構築するものだった。しかし、暗黙ムーブ可能なものを返しており`return`文でコピーが起こらない場合で、暗黙ムーブを行うことが適切な場合がまだ存在していた。 + +C++23ではその様なものを暗黙ムーブの対象に含めるために暗黙ムーブ仕様の調整が行われた。 + +```cpp +// 例示用のムーブ可能な型 +struct Widget { + Widget(Widget&&); +}; + +// Widgetの右辺値から構築可能な型 +struct RRefTaker { + RRefTaker(Widget&&); +}; + + +auto example1(Widget w) -> RRefTaker { + // ローカル変数の暗黙ムーブ + return w; // ok、C++11(CWG1579)から +} + +auto example2(Widget&& w) -> RRefTaker { + // ローカル右辺値参照の暗黙ムーブ + return w; // ok、C++20(P0527)から +} + +auto example3(Widget&& w) -> Widget&& { + // ローカル右辺値参照の暗黙ムーブ(戻り値型が参照型の場合) + return w; // C++20ではng、C++23からok +} + +// 右辺値修飾変換演算子を持つ型 +struct Jeff { + operator int&() &&; +}; + +auto example4(Jeff x) -> int& { + // ローカル変数の暗黙ムーブ(戻り値型が参照型の場合) + return x; // C++20ではng、C++23からok +} +``` + +また同時に、C++11で導入されて以降少しづつその対象(暗黙ムーブが起こる場合および起こる場所)を拡大してきたことで複雑化していた暗黙ムーブ仕様が整理され、その仕様と実装がかなり単純化された。 + +## 仕様 +(執筆中) + +## 例 +(執筆中) + +```cpp example +// (ここには、言語機能の使い方を解説するための、サンプルコードを記述します。) +// (インクルードとmain()関数を含む、実行可能なサンプルコードを記述してください。そのようなコードブロックにはexampleタグを付けます。) + +#include + +int main() +{ + int variable = 0; + std::cout << variable << std::endl; +} +``` +* variable[color ff0000] + +(コードブロック中の識別子に、文字色を付ける例です。) + +### 出力 +``` +0 +``` + +(ここには、サンプルコードの実行結果を記述します。何も出力がない場合は、項目を削除せず、空の出力にしてください。) +(実行結果が処理系・実行環境によって異なる場合は、項目名を「出力例」に変更し、可能であればその理由も併記してください。) + + +## この機能が必要になった背景・経緯 +(執筆中) + +## 検討されたほかの選択肢 +(執筆中) + +## 関連項目 +(執筆中) + +## 参照 + +- [P2266R3 Simpler implicit move](https://wg21.link/p2266r3) From 227e7c3a7e1169e4dd753381aa5f6238b10e3ec0 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 19 Feb 2024 19:10:19 +0900 Subject: [PATCH 0732/3948] =?UTF-8?q?MPIR=E3=81=B8=E3=81=AE=E8=A8=80?= =?UTF-8?q?=E5=8F=8A=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 外部リンクチェックに長期間失敗してるのと、多倍長整数はいまどきほかのがあるので --- third_party_library.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/third_party_library.md b/third_party_library.md index 58a94bae1d..fdff830efd 100644 --- a/third_party_library.md +++ b/third_party_library.md @@ -43,12 +43,6 @@ x86(IA32), x64(AMD64, x86-64)のマシン語命令を実行時に生成するC++ ライセンス:修正BSDライセンス -- [MPIR](http://www.mpir.org/) - -巨大な数を扱うためのライブラリ。GMPより分岐したものであり,Visual C++で容易に使えるようになっていることが特徴である。boost::multiprecisionと組み合わせて使用できる。 -ライセンス:LGPL Version 3.0 - - - [Google Test](https://github.com/google/googletest) C++コードの自動テストを行うフレームワーク。 From 5dd1e3f12ed326f1f9800013d804ab21fd09ad2e Mon Sep 17 00:00:00 2001 From: I <1091761+wx257osn2@users.noreply.github.com> Date: Mon, 19 Feb 2024 20:48:17 +0900 Subject: [PATCH 0733/3948] change description about deprecation of std::allocator --- reference/memory/allocator.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/reference/memory/allocator.md b/reference/memory/allocator.md index b13fc7f282..81a64b3e56 100644 --- a/reference/memory/allocator.md +++ b/reference/memory/allocator.md @@ -75,7 +75,14 @@ C++11から: ## 非推奨・削除の詳細 -C++17から`void`の特殊化版が非推奨となり、C++20で削除された。代わりに[`std::allocator_traits`](allocator_traits.md)クラスの`rebind`機能を使用すること。 +`address`/`max_size`/`construct`/`destroy`/`pointer`/`const_pointer`/`reference`/`const_reference`/`rebind`メンバがC++17から非推奨となり、C++20で削除された。 +これらは特殊なアロケータの実装でない限り共通に定義できるものであるため、アロケータの中間インタフェースである[`std::allocator_traits`](/reference/memory/allocator_traits.md)クラスに、共通のデフォルト実装を定義することとなった。 +以後は[`std::allocator_traits`](allocator_traits.md)`>`クラスの各機能を代替として使用すること。 + +従来`void`の特殊化版は`allocate`/`deallocate`メンバ関数が存在せず、実際に確保するオブジェクトの型(`R`とする)を隠蔽しつつメモリアロケータとしては`std::allocator`を使うことを表明するためにのみ用いられた。 +この際`typename std::allocator::template rebind::other`型から実際に確保するオブジェクト型の`std::allocator`を再束縛していた。 +C++17から`void`の特殊化版が非推奨となり、C++20で削除されたが、これは`std::allocator`もプライマリテンプレートからインスタンス化されるようになったことを意味し、C++20以降も`std::allocator`の使用自体は問題なく可能であることに注意。 +なお、`allocate`/`deallocate`メンバは内部で`sizeof(void)`を要求するため引き続き使用不可能であり、`std::allocator`の使用用途としては従来と同じく再束縛を目的とすることになる(上述のように[`std::allocator_traits`](allocator_traits.md)の代替機能を用いて`typename` [`std::allocator_traits`](allocator_traits.md)`>::template rebind_alloc`のようにする)。 メンバ型の`size_type`と`difference_type`は、C++17で非推奨となったがC++20で非推奨が取り消された。 From 1d65e5e89f7bbbe8d45288ede2c6d7e7b059f53d Mon Sep 17 00:00:00 2001 From: I <1091761+wx257osn2@users.noreply.github.com> Date: Mon, 19 Feb 2024 21:18:12 +0900 Subject: [PATCH 0734/3948] itemize --- reference/memory/allocator.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/reference/memory/allocator.md b/reference/memory/allocator.md index 81a64b3e56..2c78db3210 100644 --- a/reference/memory/allocator.md +++ b/reference/memory/allocator.md @@ -75,16 +75,17 @@ C++11から: ## 非推奨・削除の詳細 -`address`/`max_size`/`construct`/`destroy`/`pointer`/`const_pointer`/`reference`/`const_reference`/`rebind`メンバがC++17から非推奨となり、C++20で削除された。 -これらは特殊なアロケータの実装でない限り共通に定義できるものであるため、アロケータの中間インタフェースである[`std::allocator_traits`](/reference/memory/allocator_traits.md)クラスに、共通のデフォルト実装を定義することとなった。 -以後は[`std::allocator_traits`](allocator_traits.md)`>`クラスの各機能を代替として使用すること。 +- `address`/`max_size`/`construct`/`destroy`/`pointer`/`const_pointer`/`reference`/`const_reference`/`rebind`メンバがC++17から非推奨となり、C++20で削除された。 + - これらは特殊なアロケータの実装でない限り共通に定義できるものであるため、アロケータの中間インタフェースである[`std::allocator_traits`](/reference/memory/allocator_traits.md)クラスに、共通のデフォルト実装を定義することとなった。 + - 以後は[`std::allocator_traits`](allocator_traits.md)`>`クラスの各機能を代替として使用すること。 -従来`void`の特殊化版は`allocate`/`deallocate`メンバ関数が存在せず、実際に確保するオブジェクトの型(`R`とする)を隠蔽しつつメモリアロケータとしては`std::allocator`を使うことを表明するためにのみ用いられた。 -この際`typename std::allocator::template rebind::other`型から実際に確保するオブジェクト型の`std::allocator`を再束縛していた。 -C++17から`void`の特殊化版が非推奨となり、C++20で削除されたが、これは`std::allocator`もプライマリテンプレートからインスタンス化されるようになったことを意味し、C++20以降も`std::allocator`の使用自体は問題なく可能であることに注意。 -なお、`allocate`/`deallocate`メンバは内部で`sizeof(void)`を要求するため引き続き使用不可能であり、`std::allocator`の使用用途としては従来と同じく再束縛を目的とすることになる(上述のように[`std::allocator_traits`](allocator_traits.md)の代替機能を用いて`typename` [`std::allocator_traits`](allocator_traits.md)`>::template rebind_alloc`のようにする)。 +- C++17から`void`の特殊化版が非推奨となり、C++20で削除された。 + - 従来`void`の特殊化版は`allocate`/`deallocate`メンバ関数が存在せず、実際に確保するオブジェクトの型(`R`とする)を隠蔽しつつメモリアロケータとしては`std::allocator`を使うことを表明するためにのみ用いられた。 + この際`typename std::allocator::template rebind::other`型から実際に確保するオブジェクト型の`std::allocator`を再束縛していた。 + - この非推奨・削除は`std::allocator`もプライマリテンプレートからインスタンス化されるようになったことを意味し、C++20以降も`std::allocator`の使用自体は問題なく可能であることに注意。 + - なお、プライマリテンプレートからインスタンス化されるようになっても`allocate`/`deallocate`メンバは内部で`sizeof(void)`を要求するため引き続き使用不可能であり、`std::allocator`の使用用途としては従来と同じく再束縛を目的とすることになる(上述のように[`std::allocator_traits`](allocator_traits.md)の代替機能を用いて`typename` [`std::allocator_traits`](allocator_traits.md)`>::template rebind_alloc`のようにする)。 -メンバ型の`size_type`と`difference_type`は、C++17で非推奨となったがC++20で非推奨が取り消された。 +- メンバ型の`size_type`と`difference_type`は、C++17で非推奨となったがC++20で非推奨が取り消された。 ## 例 ```cpp example From f49fe9995fcff4e7ee8ed9e5af5ff25f37204aaf Mon Sep 17 00:00:00 2001 From: yumetodo Date: Mon, 19 Feb 2024 23:01:17 +0900 Subject: [PATCH 0735/3948] =?UTF-8?q?fix(ci):=20=E7=B5=90=E6=9E=9C?= =?UTF-8?q?=E3=82=92artifact=E3=81=AB=E4=BF=9D=E5=AD=98=E3=81=97=E3=81=A6?= =?UTF-8?q?=E3=81=BF=E3=82=8B=20(#1250)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/outer_link_check.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/outer_link_check.yml b/.github/workflows/outer_link_check.yml index f18d42f48d..89fd9353fc 100644 --- a/.github/workflows/outer_link_check.yml +++ b/.github/workflows/outer_link_check.yml @@ -29,3 +29,9 @@ jobs: run: .github/workflows/script/create_github_issue_when_not_empty.sh check_result.txt ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${{ github.sha }} - name: detect link check check_result run: test -f check_result.txt && test $(wc -l < check_result.txt) -eq 0 + - name: 'Upload Artifact' + uses: actions/upload-artifact@v4 + with: + name: result + path: check_result.tx + retention-days: 5 From deea6843c856c0ae236b8904b563911dbd247eda Mon Sep 17 00:00:00 2001 From: yumetodo Date: Tue, 20 Feb 2024 01:02:46 +0900 Subject: [PATCH 0736/3948] =?UTF-8?q?fix(ci):=20github=20issue=E4=BD=9C?= =?UTF-8?q?=E6=88=90=E3=82=92python=E3=81=A7=E8=A1=8C=E3=81=86=20(#1250)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit jsonのエスケープを的確に行うのに、jqを使う方法も考えたが、面倒なのでpythonで書き直した。 --- .github/workflows/outer_link_check.yml | 2 +- .../create_github_issue_when_not_empty.py | 42 +++++++++++++++++++ .../create_github_issue_when_not_empty.sh | 21 ---------- 3 files changed, 43 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/script/create_github_issue_when_not_empty.py delete mode 100755 .github/workflows/script/create_github_issue_when_not_empty.sh diff --git a/.github/workflows/outer_link_check.yml b/.github/workflows/outer_link_check.yml index 89fd9353fc..a97b875c4a 100644 --- a/.github/workflows/outer_link_check.yml +++ b/.github/workflows/outer_link_check.yml @@ -26,7 +26,7 @@ jobs: run: | { python3 .github/workflows/script/link_check.py --check-outer-link 3>&2 2>&1 1>&3 | tee check_result.txt; } 3>&2 2>&1 1>&3 - name: create github issue when needed - run: .github/workflows/script/create_github_issue_when_not_empty.sh check_result.txt ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${{ github.sha }} + run: python3 .github/workflows/script/create_github_issue_when_not_empty.py check_result.txt ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${{ github.sha }} - name: detect link check check_result run: test -f check_result.txt && test $(wc -l < check_result.txt) -eq 0 - name: 'Upload Artifact' diff --git a/.github/workflows/script/create_github_issue_when_not_empty.py b/.github/workflows/script/create_github_issue_when_not_empty.py new file mode 100644 index 0000000000..a9486ca0a5 --- /dev/null +++ b/.github/workflows/script/create_github_issue_when_not_empty.py @@ -0,0 +1,42 @@ +import sys +import re +import requests + +def print_help(): + print("Usage: python create_github_issue_when_not_empty.py [target file] [github token] [:owner/:repo] [current commit hash]") + sys.exit(1) + +def main(): + if len(sys.argv) != 5: + print_help() + + file_name, token, path, commit_hash = sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4] + + if not re.match(r".+/.+", path): + print_help() + + title = f"Outer link check failed at {commit_hash}" + headers = { + "Content-Type": "application/json", + "Authorization": f"Bearer {token}", + } + try: + with open(file_name, 'r') as file: + body = f"The commit hash was: {commit_hash}\n\n" + file.read() + + response = requests.post( + f"https://api.github.com/repos/{path}/issues", + json={"title": title, "body": body}, + headers=headers + ) + response.raise_for_status() # エラーがあれば例外を発生させる + print("Issue created successfully!") + except FileNotFoundError: + print(f"Error: File '{file_name}' not found.", file=sys.stderr) + sys.exit(2) + except requests.RequestException as e: + print(f"Error creating issue: {e}", file=sys.stderr) + sys.exit(3) + +if __name__ == "__main__": + main() diff --git a/.github/workflows/script/create_github_issue_when_not_empty.sh b/.github/workflows/script/create_github_issue_when_not_empty.sh deleted file mode 100755 index 56433efccd..0000000000 --- a/.github/workflows/script/create_github_issue_when_not_empty.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -if [ $# -ne 4 ] || [ ! -f "$1" ] || [[ "$3" != */* ]]; then - echo "invalid argument" 1>&2 - echo "./create_github_issue_when_not_empty.sh [target file] [github token] [:owner/:repo] [current commit hash]" 1>&2 - exit 1 -fi - -if [ "$(wc -l < "$1")" -eq 0 ]; then - exit 0 -fi -curl --request POST \ - --url "https://api.github.com/repos/$3/issues" \ - --header "authorization: Bearer $2" \ - --header 'content-type: application/json' \ - -d @- << EOF -{ - "title": "outer link check failed at $4", - "body": "The commit hash was: _$4_.\n\n$(perl -pe 's/\n/\\n/g' "$1")" -} -EOF From 2b7c282c1969ff2f283bd3d5240aedbe3b66e160 Mon Sep 17 00:00:00 2001 From: yumetodo Date: Tue, 20 Feb 2024 01:04:12 +0900 Subject: [PATCH 0737/3948] =?UTF-8?q?chore(ci):=20github=20issue=E4=BD=9C?= =?UTF-8?q?=E6=88=90=E6=99=82=E3=81=AErequest=20header=E3=81=ABapi=20versi?= =?UTF-8?q?on=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1250)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 必須ではないと思うがドキュメントに記載があったため https://docs.github.com/ja/rest/issues/issues?apiVersion=2022-11-28#create-an-issue --- .github/workflows/script/create_github_issue_when_not_empty.py | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/script/create_github_issue_when_not_empty.py b/.github/workflows/script/create_github_issue_when_not_empty.py index a9486ca0a5..39bf5ed5b7 100644 --- a/.github/workflows/script/create_github_issue_when_not_empty.py +++ b/.github/workflows/script/create_github_issue_when_not_empty.py @@ -19,6 +19,7 @@ def main(): headers = { "Content-Type": "application/json", "Authorization": f"Bearer {token}", + "X-GitHub-Api-Version": "2022-11-28", } try: with open(file_name, 'r') as file: From ba8fae479cf1ba1be033c22076d82be59ca36135 Mon Sep 17 00:00:00 2001 From: yumetodo Date: Tue, 20 Feb 2024 01:04:34 +0900 Subject: [PATCH 0738/3948] =?UTF-8?q?Revert=20"fix(ci):=20=E7=B5=90?= =?UTF-8?q?=E6=9E=9C=E3=82=92artifact=E3=81=AB=E4=BF=9D=E5=AD=98=E3=81=97?= =?UTF-8?q?=E3=81=A6=E3=81=BF=E3=82=8B=20(#1250)"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f49fe9995fcff4e7ee8ed9e5af5ff25f37204aaf. このタイミングでファイルが上がることは絶対にないし、そもそもteeでコンソールに出している --- .github/workflows/outer_link_check.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/outer_link_check.yml b/.github/workflows/outer_link_check.yml index a97b875c4a..309b0152bd 100644 --- a/.github/workflows/outer_link_check.yml +++ b/.github/workflows/outer_link_check.yml @@ -29,9 +29,3 @@ jobs: run: python3 .github/workflows/script/create_github_issue_when_not_empty.py check_result.txt ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${{ github.sha }} - name: detect link check check_result run: test -f check_result.txt && test $(wc -l < check_result.txt) -eq 0 - - name: 'Upload Artifact' - uses: actions/upload-artifact@v4 - with: - name: result - path: check_result.tx - retention-days: 5 From d631e4f7ca8346fa287a9d719308ebc3e9cd89bc Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 20 Feb 2024 01:07:46 +0900 Subject: [PATCH 0739/3948] =?UTF-8?q?=E6=9A=97=E9=BB=99=E7=9A=84=E3=81=AA?= =?UTF-8?q?=E3=83=A0=E3=83=BC=E3=83=96=E3=82=92=E7=B0=A1=E7=95=A5=E5=8C=96?= =?UTF-8?q?=20:=20=E8=BF=BD=E8=A8=98=20#1021?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23/simpler_implicit_move.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lang/cpp23/simpler_implicit_move.md b/lang/cpp23/simpler_implicit_move.md index 9400cc8af9..cb5cdb15aa 100644 --- a/lang/cpp23/simpler_implicit_move.md +++ b/lang/cpp23/simpler_implicit_move.md @@ -45,6 +45,8 @@ auto example4(Jeff x) -> int& { } ``` +上記例の`example3(), example4()`は、C++20までは戻り値型が右辺値参照型であるために`return`文でコピーは発生しないため、暗黙ムーブの対象になっていなかった。C++23では、これらの場合にも暗黙ムーブが試みられるようになる。 + また同時に、C++11で導入されて以降少しづつその対象(暗黙ムーブが起こる場合および起こる場所)を拡大してきたことで複雑化していた暗黙ムーブ仕様が整理され、その仕様と実装がかなり単純化された。 ## 仕様 From 907d3e161f41297f274af157edee3167b243e3f9 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 20 Feb 2024 17:27:58 +0900 Subject: [PATCH 0740/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E5=88=87?= =?UTF-8?q?=E3=82=8C=E3=82=92=E4=BF=AE=E6=AD=A3=20#1252?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/random/lognormal_distribution.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/random/lognormal_distribution.md b/reference/random/lognormal_distribution.md index 2cc2a0312f..60bde6b8e9 100644 --- a/reference/random/lognormal_distribution.md +++ b/reference/random/lognormal_distribution.md @@ -107,7 +107,7 @@ int main() ``` ``` -このプログラムによってある時に得られた結果([lognormal_distribution.tsv.7z](https://github.com/cpprefjp/image/raw/master/reference/random/lognormal_distribution/lognormal_distribution.tsv.7z))を図示する。 +このプログラムによってある時に得られた結果([lognormal_distribution.tsv](https://github.com/cpprefjp/image/raw/master/reference/random/lognormal_distribution/lognormal_distribution.tsv))を図示する。 ![](https://github.com/cpprefjp/image/raw/master/reference/random/lognormal_distribution/lognormal_distribution.png) From 2673b918eb4ee85e27f243e18807aad34626f2fd Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 20 Feb 2024 19:48:39 +0900 Subject: [PATCH 0741/3948] =?UTF-8?q?=E6=9A=97=E9=BB=99=E7=9A=84=E3=81=AA?= =?UTF-8?q?=E3=83=A0=E3=83=BC=E3=83=96=E3=82=92=E7=B0=A1=E7=95=A5=E5=8C=96?= =?UTF-8?q?=20:=20=E4=BB=95=E6=A7=98=E8=BF=BD=E8=A8=98=20#1021?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23/simpler_implicit_move.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/lang/cpp23/simpler_implicit_move.md b/lang/cpp23/simpler_implicit_move.md index cb5cdb15aa..d8883d4fce 100644 --- a/lang/cpp23/simpler_implicit_move.md +++ b/lang/cpp23/simpler_implicit_move.md @@ -50,6 +50,29 @@ auto example4(Jeff x) -> int& { また同時に、C++11で導入されて以降少しづつその対象(暗黙ムーブが起こる場合および起こる場所)を拡大してきたことで複雑化していた暗黙ムーブ仕様が整理され、その仕様と実装がかなり単純化された。 ## 仕様 + +暗黙ムーブ可能なエンティティ(*implicitly movable entity*)を次のように指定する + +- 自動記憶域期間の非`volatile`オブジェクト型変数 +- 自動記憶域期間の非`volatile`オブジェクト型への右辺値参照 + +暗黙ムーブ可能なエンティティが次の場所で指名されている場合、その式はムーブする資格がある(*move-eligible*な)式となる + +- `return/co_return`文のオペランド + - オペランドは変数名を指定する式(*id-expression*)であり(`()`で囲まれていても良い) + - その変数名は、その文を囲む最も内側の関数(もしくはラムダ式)の本体内もしくは関数引数宣言内の、暗黙ムーブ可能なエンティティを指定している +- `throw`式のオペランド + - オペランドは変数名を指定する式であり(`()`で囲まれていても良い) + - その変数名のスコープは、囲む最も内側のtryブロックのスコープよりも長くなく + - その変数名は暗黙ムーブ可能なエンティティを指定している + +そして、ムーブする資格がある式の値カテゴリは*xvalue*となる。 + +関数の戻り値は`return`文のオペランドからコピー初期化される。C++23において暗黙ムーブが可能な場合とはすなわち、`return`文のオペランドがムーブする資格がある式である場合のことで、その式(オペランド)は実際の値カテゴリがなんであれ*xvalue*として扱われる(つまり、`std::move()`されたのと等しくなる)ことで暗黙ムーブが適用される。 + +ムーブする資格がある式は必ず変数名を指定する式(*id-expression*)であるため、*prvalue*な`return`文オペランドに対して適用される[コピー省略](/lang/cpp17/guaranteed_copy_elision.md)と複合することは無い。NRVOとは複合しうるが、その場合は暗黙ムーブによって呼び出されるムーブコンストラクタの呼び出しがNRVOによって省略される。 + +### 副作用 (執筆中) ## 例 From 02d3eac9df61a2724ba9d8ab4ab5fbf750b6fa45 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 20 Feb 2024 23:16:21 +0900 Subject: [PATCH 0742/3948] =?UTF-8?q?numeric:=20=E9=A3=BD=E5=92=8C?= =?UTF-8?q?=E6=BC=94=E7=AE=97(#1237)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 10 ++-- reference/numeric.md | 13 ++++- reference/numeric/add_sat.md | 74 ++++++++++++++++++++++++++++ reference/numeric/div_sat.md | 77 ++++++++++++++++++++++++++++++ reference/numeric/mul_sat.md | 74 ++++++++++++++++++++++++++++ reference/numeric/saturate_cast.md | 67 ++++++++++++++++++++++++++ reference/numeric/sub_sat.md | 73 ++++++++++++++++++++++++++++ 7 files changed, 382 insertions(+), 6 deletions(-) create mode 100644 reference/numeric/add_sat.md create mode 100644 reference/numeric/div_sat.md create mode 100644 reference/numeric/mul_sat.md create mode 100644 reference/numeric/saturate_cast.md create mode 100644 reference/numeric/sub_sat.md diff --git a/lang/cpp26.md b/lang/cpp26.md index a34ee1cdb3..adb9d0f485 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -155,11 +155,11 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 ### 数値 - [``](/reference/numeric.md)に、飽和演算 (Saturation Arithmetic) として、型の表現可能な範囲で演算を行う以下の関数を追加 - - [`std::add_sat()`](/reference/numeric/add_sat.md.nolink) - - [`std::sub_sat()`](/reference/numeric/sub_sat.md.nolink) - - [`std::mul_sat()`](/reference/numeric/mul_sat.md.nolink) - - [`std::div_sat()`](/reference/numeric/div_sat.md.nolink) - - [`std::saturation_cast()`](/reference/numeric/saturation_cast.md.nolink) + - [`std::add_sat()`](/reference/numeric/add_sat.md) + - [`std::sub_sat()`](/reference/numeric/sub_sat.md) + - [`std::mul_sat()`](/reference/numeric/mul_sat.md) + - [`std::div_sat()`](/reference/numeric/div_sat.md) + - [`std::saturate_cast()`](/reference/numeric/saturate_cast.md) - [``](/reference/cmath.md)の以下の関数を、`constexpr`に対応 (特殊関数と、グローバルの丸めモードに依存する丸め関数以外の全て) - [`std::cos()`](/reference/cmath/cos.md) - [`std::sin()`](/reference/cmath/sin.md) diff --git a/reference/numeric.md b/reference/numeric.md index b30f7bba27..11c2378c39 100644 --- a/reference/numeric.md +++ b/reference/numeric.md @@ -1,7 +1,7 @@ # numeric * numeric[meta header] -`` ヘッダは数値のシーケンスの処理に特化したアルゴリズムを定義する。 +`` ヘッダでは、数値のシーケンスや数値の処理に特化したアルゴリズムを定義する。 ## 集計 @@ -55,6 +55,17 @@ | [`midpoint`](numeric/midpoint.md) | 数値とポインタの中点を求める | C++20 | +## 飽和演算 + +| 名前 | 説明 | 対応バージョン | +|------|------|-------| +| [`add_sat`](numeric/add_sat.md) | 飽和加算`x + y` | C++26 | +| [`sub_sat`](numeric/sub_sat.md) | 飽和減算`x - y` | C++26 | +| [`mul_sat`](numeric/mul_sat.md) | 飽和乗算`x * y` | C++26 | +| [`div_sat`](numeric/div_sat.md) | 飽和除算`x / y` | C++26 | +| [`saturate_cast`](numeric/saturate_cast.md) | 飽和演算あり型キャスト | C++26 | + + ## 関連項目 - [``](/reference/algorithm.md) - より汎用的なアルゴリズム diff --git a/reference/numeric/add_sat.md b/reference/numeric/add_sat.md new file mode 100644 index 0000000000..e1edb44ad8 --- /dev/null +++ b/reference/numeric/add_sat.md @@ -0,0 +1,74 @@ +# add_sat +* numeric[meta header] +* function template[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std { + template + constexpr T add_sat(T x, T y) noexcept; +} +``` + +## 概要 +飽和加算 `x + y` を計算する。 + + +## テンプレートパラメータ制約 +`T`は符号付き整数型または符号無し整数型であること。 + + +## 戻り値 +- 無限の範囲で計算した値`x + y`が型`T`で表現可能ならば、`x + y`を返す +- そうでないとき、型`T`で表現可能な最大値または最小値のうち`x + y`に近い方の値を返す + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + // 1 + 2 = 3 + std::println("{}", std::add_sat(1, 2)); + + // 200 + 200 = 400 -> 255(2**8-1) + std::uint8_t x = 200; + std::println("{}", std::add_sat(x, x)); + + // -100 + -100 = -200 -> -128(-2**7) + std::int8_t y = -100; + std::println("{}", std::add_sat(y, y)); +} +``` +* std::add_sat[color ff0000] +* std::println[link /reference/print/println.md] + +### 出力 +``` +3 +255 +-128 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0543R3 Saturation arithmetic](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p0543r3.html) diff --git a/reference/numeric/div_sat.md b/reference/numeric/div_sat.md new file mode 100644 index 0000000000..fcba015647 --- /dev/null +++ b/reference/numeric/div_sat.md @@ -0,0 +1,77 @@ +# div_sat +* numeric[meta header] +* function template[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std { + template + constexpr T div_sat(T x, T y) noexcept; +} +``` + +## 概要 +飽和除算 `x / y` を計算する。 + + +## テンプレートパラメータ制約 +`T`は符号付き整数型または符号無し整数型であること。 + + +## 事前条件 +`y != 0` + + +## 戻り値 +- `T`が符号付き整数型かつ`x ==` [`numeric_limits::min()`](/reference/limits/numeric_limits/min.md) `&& y == -1`のとき、[`numeric_limits::max()`](/reference/limits/numeric_limits/max.md)を返す +- そうでなければ、`x / y`を返す + + +## 例外 +投げない + + +## 定数式に評価される条件 +事前条件を満たすこと + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + // 10 / 3 = 3 + std::println("{}", std::div_sat(10, 3)); + + // -128 * -1 = 128 -> 127(2**7-1) + std::int8_t x = -128, y = -1; + std::println("{}", std::div_sat(x, y)); +} +``` +* std::div_sat[color ff0000] +* std::println[link /reference/print/println.md] + +### 出力 +``` +3 +127 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0543R3 Saturation arithmetic](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p0543r3.html) diff --git a/reference/numeric/mul_sat.md b/reference/numeric/mul_sat.md new file mode 100644 index 0000000000..c4bcb8d25f --- /dev/null +++ b/reference/numeric/mul_sat.md @@ -0,0 +1,74 @@ +# mul_sat +* numeric[meta header] +* function template[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std { + template + constexpr T mul_sat(T x, T y) noexcept; +} +``` + +## 概要 +飽和乗算 `x * y` を計算する。 + + +## テンプレートパラメータ制約 +`T`は符号付き整数型または符号無し整数型であること。 + + +## 戻り値 +- 無限の範囲で計算した値`x * y`が型`T`で表現可能ならば、`x * y`を返す +- そうでないとき、型`T`で表現可能な最大値または最小値のうち`x * y`に近い方の値を返す + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + // 2 * 3 = 6 + std::println("{}", std::mul_sat(2, 3)); + + // 20 * 20 = 400 -> 255(2**8-1) + std::uint8_t n = 20; + std::println("{}", std::mul_sat(n, n)); + + // -128 * -1 = 128 -> 127(2**7-1) + std::int8_t x = -128, y = -1; + std::println("{}", std::mul_sat(x, y)); +} +``` +* std::mul_sat[color ff0000] +* std::println[link /reference/print/println.md] + +### 出力 +``` +6 +255 +127 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0543R3 Saturation arithmetic](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p0543r3.html) diff --git a/reference/numeric/saturate_cast.md b/reference/numeric/saturate_cast.md new file mode 100644 index 0000000000..68f26b6720 --- /dev/null +++ b/reference/numeric/saturate_cast.md @@ -0,0 +1,67 @@ +# saturate_cast +* numeric[meta header] +* function template[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std { + template + constexpr R saturate_cast(T x) noexcept; +} +``` + +## 概要 +値`x`を変換先の型`R`で表現可能な値へ丸める。 + + +## テンプレートパラメータ制約 +`T`は符号付き整数型または符号無し整数型であること。 + + +## 戻り値 +- 値`x`が型`T`で表現可能ならば、`x`を返す +- そうでないとき、型`T`で表現可能な最大値または最小値のうち`x`に近い方の値を返す + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::println("{}", std::saturate_cast( 100)); + std::println("{}", std::saturate_cast( 200)); + std::println("{}", std::saturate_cast(-200)); +} +``` +* std::saturate_cast[color ff0000] +* std::println[link /reference/print/println.md] + +### 出力 +``` +100 +127 +-128 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0543R3 Saturation arithmetic](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p0543r3.html) diff --git a/reference/numeric/sub_sat.md b/reference/numeric/sub_sat.md new file mode 100644 index 0000000000..a1bfd95092 --- /dev/null +++ b/reference/numeric/sub_sat.md @@ -0,0 +1,73 @@ +# sub_sat +* numeric[meta header] +* function template[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std { + template + constexpr T sub_sat(T x, T y) noexcept; +} +``` + +## 概要 +飽和減算 `x - y` を計算する。 + + +## テンプレートパラメータ制約 +`T`は符号付き整数型または符号無し整数型であること。 + + +## 戻り値 +- 無限の範囲で計算した値`x - y`が型`T`で表現可能ならば、`x - y`を返す +- そうでないとき、型`T`で表現可能な最大値または最小値のうち`x - y`に近い方の値を返す + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + // 3 - 1 = 2 + std::println("{}", std::sub_sat(3, 1)); + + // 1 - 3 = -2 -> 0 + std::println("{}", std::add_sat(1u, 3u)); + + // -100 - 50 = -150 -> -128(-2**7) + std::int8_t x = -100, y = 50; + std::println("{}", std::add_sat(x, y)); +} +``` +* std::sub_sat[color ff0000] +* std::println[link /reference/print/println.md] + +### 出力 +``` +2 +0 +-128 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0543R3 Saturation arithmetic](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p0543r3.html) From 6d3e95be38d0114d6cf93d8b5c30571876e12d7b Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 20 Feb 2024 23:50:18 +0900 Subject: [PATCH 0743/3948] =?UTF-8?q?GitHub=20Issue=E7=99=BA=E8=A1=8C?= =?UTF-8?q?=E3=82=B9=E3=82=AF=E3=83=AA=E3=83=97=E3=83=88=20:=20=E5=A4=96?= =?UTF-8?q?=E9=83=A8=E3=83=AA=E3=83=B3=E3=82=AF=E3=83=81=E3=82=A7=E3=83=83?= =?UTF-8?q?=E3=82=AF=E6=88=90=E5=8A=9F=E6=99=82=E3=81=ABissue=E3=82=92?= =?UTF-8?q?=E4=BD=9C=E3=81=A3=E3=81=A6=E3=81=97=E3=81=BE=E3=81=A3=E3=81=A6?= =?UTF-8?q?=E3=81=84=E3=81=9F=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3=20#1250?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflows/script/create_github_issue_when_not_empty.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/script/create_github_issue_when_not_empty.py b/.github/workflows/script/create_github_issue_when_not_empty.py index 39bf5ed5b7..fa159fedf7 100644 --- a/.github/workflows/script/create_github_issue_when_not_empty.py +++ b/.github/workflows/script/create_github_issue_when_not_empty.py @@ -23,7 +23,10 @@ def main(): } try: with open(file_name, 'r') as file: - body = f"The commit hash was: {commit_hash}\n\n" + file.read() + data = file.read(); + if len(data) == 0: + return + body = f"The commit hash was: {commit_hash}\n\n" + data response = requests.post( f"https://api.github.com/repos/{path}/issues", From 868aa38f3005761c1f313400d3af7146d84c1d82 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 21 Feb 2024 14:59:54 +0900 Subject: [PATCH 0744/3948] =?UTF-8?q?=E6=9A=97=E9=BB=99=E7=9A=84=E3=81=AA?= =?UTF-8?q?=E3=83=A0=E3=83=BC=E3=83=96=E3=82=92=E7=B0=A1=E7=95=A5=E5=8C=96?= =?UTF-8?q?=20:=20=E4=BB=95=E6=A7=98=E3=81=AE=E5=89=AF=E4=BD=9C=E7=94=A8?= =?UTF-8?q?=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6=E8=BF=BD=E8=A8=98=20#1021?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23/simpler_implicit_move.md | 97 +++++++++++++++++++++++++++-- 1 file changed, 91 insertions(+), 6 deletions(-) diff --git a/lang/cpp23/simpler_implicit_move.md b/lang/cpp23/simpler_implicit_move.md index d8883d4fce..2bf2ccd5d6 100644 --- a/lang/cpp23/simpler_implicit_move.md +++ b/lang/cpp23/simpler_implicit_move.md @@ -45,23 +45,23 @@ auto example4(Jeff x) -> int& { } ``` -上記例の`example3(), example4()`は、C++20までは戻り値型が右辺値参照型であるために`return`文でコピーは発生しないため、暗黙ムーブの対象になっていなかった。C++23では、これらの場合にも暗黙ムーブが試みられるようになる。 +上記例の`example3(), example4()`は、C++20までは戻り値型が参照型であるために`return`文でコピーは発生しないため、暗黙ムーブの対象になっていなかった。C++23では、これらの場合にも暗黙ムーブが試みられるようになる。 また同時に、C++11で導入されて以降少しづつその対象(暗黙ムーブが起こる場合および起こる場所)を拡大してきたことで複雑化していた暗黙ムーブ仕様が整理され、その仕様と実装がかなり単純化された。 ## 仕様 -暗黙ムーブ可能なエンティティ(*implicitly movable entity*)を次のように指定する +**暗黙ムーブ可能なエンティティ**(*implicitly movable entity*)を次のどちらかとして指定する - 自動記憶域期間の非`volatile`オブジェクト型変数 - 自動記憶域期間の非`volatile`オブジェクト型への右辺値参照 -暗黙ムーブ可能なエンティティが次の場所で指名されている場合、その式はムーブする資格がある(*move-eligible*な)式となる +暗黙ムーブ可能なエンティティが次の場所で指名されている場合、その式は**ムーブする資格がある式**(*move-eligible*)となる -- `return/co_return`文のオペランド +- `return/co_return`文のオペランド(以下の条件を全て満たすもの) - オペランドは変数名を指定する式(*id-expression*)であり(`()`で囲まれていても良い) - その変数名は、その文を囲む最も内側の関数(もしくはラムダ式)の本体内もしくは関数引数宣言内の、暗黙ムーブ可能なエンティティを指定している -- `throw`式のオペランド +- `throw`式のオペランド(以下の条件を全て満たすもの) - オペランドは変数名を指定する式であり(`()`で囲まれていても良い) - その変数名のスコープは、囲む最も内側のtryブロックのスコープよりも長くなく - その変数名は暗黙ムーブ可能なエンティティを指定している @@ -73,7 +73,92 @@ auto example4(Jeff x) -> int& { ムーブする資格がある式は必ず変数名を指定する式(*id-expression*)であるため、*prvalue*な`return`文オペランドに対して適用される[コピー省略](/lang/cpp17/guaranteed_copy_elision.md)と複合することは無い。NRVOとは複合しうるが、その場合は暗黙ムーブによって呼び出されるムーブコンストラクタの呼び出しがNRVOによって省略される。 ### 副作用 -(執筆中) + +この仕様の単純化はいくつか以前の動作を変更している。 + +まず、`return`文のオペランドがムーブする資格がある式となる場合その式の値カテゴリは*xvalue*として扱われることで、戻り値型推論の結果が変わる場合がある。 + +```cpp +auto f(int n) -> decltype(auto) { + return (n); // かっこに囲まれたid-expression、ムーブする資格がある式 +} +// C++20 : 戻り値型はint& +// C++23 : 戻り値型はint&& + +auto g(int n) -> auto&& { + return n; // id-expression、ムーブする資格がある式 +} +// C++20 : 戻り値型はint& +// C++23 : 戻り値型はint&& +``` + +`decltype(auto)`による戻り値型推論では、`return`文のオペランドを`decltype`することで戻り値型を推論する。`decltype`は変数名に対して使用された時はその変数の宣言された型を取得するが、変数名がかっこに囲まれている場合はかっこに囲まれた*id-expression*として値カテゴリを含めたその式の型を取得する。このため、上記`f()`のように、`decltype(auto)`戻り値型の関数で`return`文のオペランドがかっこに囲まれた変数名であり、C++23でそのオペランドがムーブする資格がある式となる場合、その値カテゴリが変更される(*lvalue* -> *xvalue*)ことによって戻り値型推論結果が変化する。 + +`auto&&`による戻り値型推論は`decltype`と推論方法が異なるものの、やはり`return`文のオペランドの値カテゴリに応じて参照修飾が決定されるため、従来左辺値(*lvalue*)だったオペランドがC++23でムーブする資格がある式となる場合に、値カテゴリが*xvalue*となることによって推論結果が変化する。 + +この他の場合には結果は変化しない。 + +```cpp +auto f1(int n)-> decltype(auto) { + return n; +} +// C++20/23共に戻り値型はint + +auto f2(int n)-> auto { + return n; +} +// C++20/23共に戻り値型はint + +auto f3(int n)-> auto& { + return n; +} +// C++20/23共に戻り値型はint& +// ただし、後述のようにC++23ではエラー + +auto f4(int n)-> const auto& { + return n; +} +// C++20/23共に戻り値型はconst int& +``` + +そして、同様に`return`文オペランドの値カテゴリが変化することによって、ローカル変数の参照を返す一部の関数が不適格になる様になる。 + +```cpp +auto f() -> int& { + int n = 10; + + return n; // ng、nはムーブする資格のある式であり、その型と値カテゴリはint&&(戻り値型と一致しない) +} + +auto g() -> std::reference_wrapper { + int n = 10; + + return n; // ng、nはムーブする資格のある式であり、その型と値カテゴリはint&&(reference_wrapperのコンストラクタで拒否される) +} +``` +* reference_wrapper[link /reference/functional/reference_wrapper.md] + +ただし、ローカル参照変数は暗黙ムーブ可能なエンティティではないため、ローカル参照を返そうとする場合従来通りエラーにはならない。 + +```cpp +auto f() -> int& { + int n = 10; + int& r = n; + + return r; // ok、rはムーブする資格のある式ではなく、その型と値カテゴリはint& +} +``` + +また、この変更とは逆に、ローカル変数の右辺値参照を返そうとする場合が適格になってしまう。 + +```cpp +auto f() -> int&& { + int n = 10; + + return n; // C++20ではng + // C++23ではok、nはムーブする資格のある式であり、その型と値カテゴリはint&& +} +``` ## 例 (執筆中) From 613f556741f6b64759fb87dd525e55e14f2de0c7 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sat, 24 Feb 2024 05:58:47 +0900 Subject: [PATCH 0745/3948] =?UTF-8?q?=E5=9F=BA=E7=A4=8E=E7=9A=84=E3=81=AAR?= =?UTF-8?q?ange=E9=96=A2=E9=80=A3=E3=82=AD=E3=83=BC=E3=83=AF=E3=83=BC?= =?UTF-8?q?=E3=83=89=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 87e148ec94..4982111e8d 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -162,6 +162,28 @@ * std::random_device[link /reference/random/random_device.md] * seed_gen()[link /reference/random/random_device/op_call.md] * [link /reference/ranges.md] + * bidirectional_range[link /reference/ranges/bidirectional_range.md] + * borrowed_range[link /reference/ranges/borrowed_range.md] + * common_range[link /reference/ranges/common_range.md] + * const_iterator_t[link /reference/ranges/const_iterator_t.md] + * const_sentinel_t[link /reference/ranges/const_sentinel_t.md] + * constant_range[link /reference/ranges/constant_range.md] + * contiguous_range[link /reference/ranges/contiguous_range.md] + * forward_range[link /reference/ranges/forward_range.md] + * input_range[link /reference/ranges/input_range.md] + * iterator_t[link /reference/ranges/iterator_t.md] + * output_range[link /reference/ranges/output_range.md] + * random_access_range[link /reference/ranges/random_access_range.md] + * range_difference_t[link /reference/ranges/range_difference_t.md] + * range_reference_t[link /reference/ranges/range_reference_t.md] + * range_rvalue_reference_t[link /reference/ranges/range_reference_t.md] + * range_value_t[link /reference/ranges/range_value_t.md] + * range[link /reference/ranges/range.md] + * sentinel_t[link /reference/ranges/sentinel_t.md] + * sized_range[link /reference/ranges/sized_range.md] + * view_interface[link /reference/ranges/view_interface.md] + * view[link /reference/ranges/view.md] + * viewable_range[link /reference/ranges/viewable_range.md] * [link /reference/ratio.md] * [link /reference/regex.md] * [link /reference/scoped_allocator.md] From 3983f026a31e240e333cda929e12086f94ca1bdb Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sat, 24 Feb 2024 06:02:00 +0900 Subject: [PATCH 0746/3948] =?UTF-8?q?ranges::to=E3=81=AE=E8=AA=AC=E6=98=8E?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges.md | 2 +- reference/ranges/to.md | 197 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 198 insertions(+), 1 deletion(-) create mode 100644 reference/ranges/to.md diff --git a/reference/ranges.md b/reference/ranges.md index dc86669e79..be0067b519 100644 --- a/reference/ranges.md +++ b/reference/ranges.md @@ -403,7 +403,7 @@ range | adaptor(args...) | 名前 | 説明 | 対応バージョン | |----------------------|----------------------------------------------------------------|----------------| -| [`to`](ranges/to.md.nolink) | パイプライン記法でRangeからコンテナを構築する (class template) | C++23 | +| [`to`](ranges/to.md) | パイプライン記法でRangeからコンテナを構築する (class template) | C++23 | | [`from_range_t`](ranges/from_range_t.md) | Rangeからコンテナへの変換を示すタグ型 (class) | C++23 | | [`from_range`](ranges/from_range_t.md) | Rangeからコンテナへの変換を示すタグ値 (variable) | C++23 | diff --git a/reference/ranges/to.md b/reference/ranges/to.md new file mode 100644 index 0000000000..a43eb9c8aa --- /dev/null +++ b/reference/ranges/to.md @@ -0,0 +1,197 @@ +# to +* ranges[meta header] +* std::ranges[meta namespace] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template requires (!view) + constexpr C to(R&& r, Args&&... args); // (1) + + template class C, input_range R, class... Args> + constexpr auto to(R&& r, Args&&... args); // (2) + + template requires (!view) + constexpr auto to(Args&&... args); // (3) + + template class C, class... Args> + constexpr auto to(Args&&... args); // (4) +} +``` + +## 概要 + +Rangeの各要素を要素とするコンテナを構築する。 +この関数は再帰的に適用され、ネストされたRangeにも対応する。 + +- (1): 処理の実体となる関数テンプレート +- (2): (1)のテンプレートテンプレート版 +- (3): Rangeアダプタオブジェクトを返す関数テンプレート +- (4): (3)のテンプレートテンプレート版 + +(2), (4) の存在により、コンテナ型を指定するときにその要素の型を省略して(=テンプレートとして)渡すことができる。 + + +## 適格要件 +- (1), (3): `C` はCV装飾のないクラス型であること。 + + +## 戻り値 + +(1) Rangeの各要素を要素とするコンテナCのオブジェクトを以下の通りに構築して返す。 + +`C`が[`input_range`](input_range.md)ではないか、[`convertible_to`](/reference/concepts/convertible_to.md)`<`[`range_reference_t`](range_reference_t.md)`, `[`range_value_t`](range_value_t.md)`>` である(`R`の要素への参照が`C`の要素に変換できる)場合: + +1. [`constructible_from`](/reference/concepts/constructible_from.md)``である(`C`が`R`と残りの引数で構築できる)場合 + - `C(`[`std::forward`](/reference/utility/forward.md)`(r), `[`std::forward`](/reference/utility/forward.md)`(args)...)` +2. [`constructible_from`](/reference/concepts/constructible_from.md)``である(`C`が[`from_range_t`](from_range_t.md)、`R`、残りの引数で構築できる)場合 + - `C(`[`from_range`](from_range_t.md)`, `[`std::forward`](/reference/utility/forward.md)`(r), `[`std::forward`](/reference/utility/forward.md)`(args)...)` +3. [`common_range`](common_range.md)``が`true`で、[`iterator_traits`](/reference/iterator/iterator_traits.md)`<`[`iterator_t`](iterator_t.md)`>​::​iterator_category`が `input_iterator_tag` から派生する有効な型であり、[`constructible_from`](/reference/concepts/constructible_from.md)`, `[`sentinel_t`](sentinel_t.md)`, Args...>`である(`C`が`R`のイテレータおよび番兵と残りの引数で構築できる)場合 + - `C(`[`ranges::begin(r)`](begin.md)`, `[`ranges::end(r)`](end.md)`, `[`std::forward`](/reference/utility/forward.md)`(args)...)` +4. [`constructible_from`](/reference/concepts/constructible_from.md)``が`true`で、`container-insertable>`が`true`である場合 + - 以下のコードで初期化する + +```cpp +C c(std::forward(args)...); +if constexpr (sized_range && reservable-container) + c.reserve(static_cast>(ranges::size(r))); +ranges::copy(r, container-inserter>(c)); +``` + +[`input_range`](input_range.md)`<`[`range_reference_t`](range_reference_t.md)`>`である場合: + +```cpp +to(r | views::transform([](auto&& elem) { + return to>(std::forward(elem)); +}), std::forward(args)...); +``` + +どの条件にもあてはまらない場合、プログラムは不適格である。 + +(2) `input-iterator` を次のように定義する。 + +```cpp +struct input-iterator { + using iterator_category = input_iterator_tag; + using value_type = range_value_t; + using difference_type = ptrdiff_t; + using pointer = add_pointer_t>; + using reference = range_reference_t; + reference operator*() const; + pointer operator->() const; + input-iterator& operator++(); + input-iterator operator++(int); + bool operator==(const input-iterator&) const; +}; +``` + +また、`DEDUCE_EXPR` を次のように定義する。 + +1. 有効な式ならば、`C(`[`declval`](/reference/utility/declval.md)`(), `[`declval`](/reference/utility/declval.md)`()...)` +2. 有効な式ならば、`C(`[`from_range`](from_range_t.md)`, `[`declval`](/reference/utility/declval.md)`(), `[`declval`](/reference/utility/declval.md)`()...)` +3. 有効な式ならば、`C(`[`declval`](/reference/utility/declval.md)`(), `[`declval`](/reference/utility/declval.md)`(), `[`declval`](/reference/utility/declval.md)`()...)` +4. 1-3が有効でなければ、ill-formed + +このとき、戻り値は `to<`[`decltype`](/lang/cpp11/decltype.md)`(DEDUCE_EXPR)>(`[`std::forward`](/reference/utility/forward.md)`(r), `[`std::forward`](/reference/utility/forward.md)`(args)...)` + +(3), (4): 次の性質をもつ完全転送呼び出しラッパー(*perfect forwarding call wrapper*)であるようなRangeアダプタクロージャオブジェクト`f`を返す。 + +- ターゲットオブジェクトを持たない +- バインドされた引数`bound_args`は、[`decay_t`](/reference/type_traits/decay.md)`...`型のオブジェクトであり、それぞれ[`std::forward`](/reference/utility/forward.md)`(args)...`で直接非リスト初期化(*direct-non-list-initialize*)される +- 呼び出しパターンは`to(r, bound_args...)`である。ただし、`r`は`f`の関数呼び出し式で使用される引数 + + +## 備考 + +本説明に用いる説明専用コンセプトを以下のように定義する。 + +```cpp +template +constexpr bool reservable-container = + sized_range && + requires(Container& c, range_size_t n) { + c.reserve(n); + { c.capacity() } -> same_as; + { c.max_size() } -> same_as; + }; + +template +constexpr bool container-insertable = + requires(Container& c, Ref&& ref) { + requires (requires { c.push_back(std::forward(ref)); } || + requires { c.insert(c.end(), std::forward(ref)); }); + }; + +template +constexpr auto container-inserter(Container& c) { + if constexpr (requires { c.push_back(declval()); }) + return back_inserter(c); + else + return inserter(c, c.end()); +} +``` + +## この機能が必要になった背景・経緯 + +Rangeの各要素を要素とするコンテナを構築するには、従来、次のような方法があった。 + +```cpp example +#include +#include +#include +#include +#include +#include + +int main() { + using namespace std; + using namespace std::literals; + auto str = "the quick brown fox"sv; + vector words; + for(auto&& i : views::split(str, ' ')) { + words.emplace_back(i.begin(), i.end()); + } + println("{}", words); +} +``` + +これを簡潔に書くために、`to`関数が提案された。 + + +## 例 +```cpp example +#include +#include +#include +#include +#include + +int main() { + using namespace std; + using namespace std::literals; + auto str = "the quick brown fox"sv; + auto words = views::split(str, ' ') | ranges::to>(); + println("{}", words); +} +``` +* ranges::to[color ff0000] + +### 出力 +``` +["the", "quick", "brown", "fox"] +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 19.0 (at least) +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 + +- [26.5.7.2 ranges​::​to](https://timsong-cpp.github.io/cppwp/range.utility.conv.to) From 2f19f570ae09539c5b6f56c7fec5169065f4ab17 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sat, 24 Feb 2024 06:09:40 +0900 Subject: [PATCH 0747/3948] =?UTF-8?q?=E4=B8=8D=E5=8F=AF=E8=A6=96=E6=96=87?= =?UTF-8?q?=E5=AD=97=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/to.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/ranges/to.md b/reference/ranges/to.md index a43eb9c8aa..24c3512027 100644 --- a/reference/ranges/to.md +++ b/reference/ranges/to.md @@ -47,7 +47,7 @@ Rangeの各要素を要素とするコンテナを構築する。 - `C(`[`std::forward`](/reference/utility/forward.md)`(r), `[`std::forward`](/reference/utility/forward.md)`(args)...)` 2. [`constructible_from`](/reference/concepts/constructible_from.md)``である(`C`が[`from_range_t`](from_range_t.md)、`R`、残りの引数で構築できる)場合 - `C(`[`from_range`](from_range_t.md)`, `[`std::forward`](/reference/utility/forward.md)`(r), `[`std::forward`](/reference/utility/forward.md)`(args)...)` -3. [`common_range`](common_range.md)``が`true`で、[`iterator_traits`](/reference/iterator/iterator_traits.md)`<`[`iterator_t`](iterator_t.md)`>​::​iterator_category`が `input_iterator_tag` から派生する有効な型であり、[`constructible_from`](/reference/concepts/constructible_from.md)`, `[`sentinel_t`](sentinel_t.md)`, Args...>`である(`C`が`R`のイテレータおよび番兵と残りの引数で構築できる)場合 +3. [`common_range`](common_range.md)``が`true`で、[`iterator_traits`](/reference/iterator/iterator_traits.md)`<`[`iterator_t`](iterator_t.md)`>::iterator_category`が `input_iterator_tag` から派生する有効な型であり、[`constructible_from`](/reference/concepts/constructible_from.md)`, `[`sentinel_t`](sentinel_t.md)`, Args...>`である(`C`が`R`のイテレータおよび番兵と残りの引数で構築できる)場合 - `C(`[`ranges::begin(r)`](begin.md)`, `[`ranges::end(r)`](end.md)`, `[`std::forward`](/reference/utility/forward.md)`(args)...)` 4. [`constructible_from`](/reference/concepts/constructible_from.md)``が`true`で、`container-insertable>`が`true`である場合 - 以下のコードで初期化する @@ -194,4 +194,4 @@ int main() { ## 参照 -- [26.5.7.2 ranges​::​to](https://timsong-cpp.github.io/cppwp/range.utility.conv.to) +- [26.5.7.2 ranges::to](https://timsong-cpp.github.io/cppwp/range.utility.conv.to) From 674da11148032509341c3f890b26c07d3349d9d4 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sat, 24 Feb 2024 06:12:02 +0900 Subject: [PATCH 0748/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp23.md b/lang/cpp23.md index 4b6f86db45..b070b38784 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -134,7 +134,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 - [`std::map::extract()`](/reference/map/map/extract.md) - [``](/reference/ranges.md)に、複数の範囲を綴じ合わせる[`std::views::zip`](/reference/ranges/zip_view.md.nolink)を追加 - [``](/reference/ranges.md)に、複数の範囲の直積をとる[`std::views::cartesian_product`](/reference/ranges/cartesian_product_view.md.nolink)を追加 -- Rangeから任意のコンテナに変換するRangeアダプタ[`std::ranges::to()`](/reference/ranges/to.md.nolink)を追加 +- Rangeから任意のコンテナに変換するRangeアダプタ[`std::ranges::to()`](/reference/ranges/to.md)を追加 - Rangeから任意のコンテナに変換するために、可変長のコンテナ ([`std::array`](/reference/array/array.md)以外) に、以下の機能を追加: - Rangeから変換するコンストラクタ - Rangeを挿入する`insert_range()`メンバ関数 From f00159240d4934af494fa7c38839ea96344ce567 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sat, 24 Feb 2024 06:12:15 +0900 Subject: [PATCH 0749/3948] =?UTF-8?q?ranges::to=E3=81=AE=E8=AA=AC=E6=98=8E?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/to.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/ranges/to.md b/reference/ranges/to.md index 24c3512027..7e8c85d402 100644 --- a/reference/ranges/to.md +++ b/reference/ranges/to.md @@ -27,8 +27,8 @@ Rangeの各要素を要素とするコンテナを構築する。 - (1): 処理の実体となる関数テンプレート - (2): (1)のテンプレートテンプレート版 -- (3): Rangeアダプタオブジェクトを返す関数テンプレート -- (4): (3)のテンプレートテンプレート版 +- (3): (1)に対応するRangeアダプタ +- (4): (2)に対応するRangeアダプタ (2), (4) の存在により、コンテナ型を指定するときにその要素の型を省略して(=テンプレートとして)渡すことができる。 From 284b03c99a37fe159e76832201b291bec9070d4d Mon Sep 17 00:00:00 2001 From: yoh Date: Sat, 24 Feb 2024 16:17:09 +0900 Subject: [PATCH 0750/3948] =?UTF-8?q?generator:=20=E8=AA=AC=E6=98=8E?= =?UTF-8?q?=E5=A2=97=E8=A3=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - iteratorクラスメンバ個別解説を追加 - promise_type::yield_value説明を改善 - 説明用メンバ変数名を明記 - 他調整 --- reference/generator/generator.md | 12 ++--- reference/generator/generator/begin.md | 9 +++- reference/generator/generator/iterator.md | 47 +++++++------------ .../generator/generator/iterator/op_assign.md | 39 +++++++++++++++ .../generator/iterator/op_constructor.md | 38 +++++++++++++++ .../generator/generator/iterator/op_deref.md | 44 +++++++++++++++++ .../generator/generator/iterator/op_equal.md | 41 ++++++++++++++++ .../generator/iterator/op_increment.md | 46 ++++++++++++++++++ reference/generator/generator/promise_type.md | 4 +- .../generator/promise_type/final_suspend.md | 6 ++- .../promise_type/get_return_object.md | 7 ++- .../generator/promise_type/initial_suspend.md | 2 +- .../promise_type/unhandled_exception.md | 4 +- .../generator/promise_type/yield_value.md | 16 +++++-- 14 files changed, 264 insertions(+), 51 deletions(-) create mode 100644 reference/generator/generator/iterator/op_assign.md create mode 100644 reference/generator/generator/iterator/op_constructor.md create mode 100644 reference/generator/generator/iterator/op_deref.md create mode 100644 reference/generator/generator/iterator/op_equal.md create mode 100644 reference/generator/generator/iterator/op_increment.md diff --git a/reference/generator/generator.md b/reference/generator/generator.md index fa391b6e89..82c5e91ac4 100644 --- a/reference/generator/generator.md +++ b/reference/generator/generator.md @@ -18,7 +18,7 @@ namespace std { } ``` * ranges::view_interface[link /reference/ranges/view_interface.md] - +* polymorphic_allocator[link /reference/memory_resource/polymorphic_allocator.md] ## 概要 `generator`クラステンプレートは、[コルーチン](/lang/cpp20/coroutines.md)の評価により生成される要素列のビュー(view)を表現する。 @@ -29,9 +29,9 @@ namespace std { ジェネレータコルーチンでは`co_await`式を利用できない。 ジェネレータコルーチンは遅延評価される。 -ジェネレータコルーチンが返す`generator`オブジェクトを利用するコード(以下、ジェネレータ利用側)において、先頭要素を指す[イテレータ](generator/iterator.md)を取得する([`begin`](generator/begin.md))、またはイテレータのインクリメント操作を行う(`operator++`)までジェネレータコルーチンは再開(resume)されない。 +ジェネレータコルーチンが返す`generator`オブジェクトを利用するコード(以下、ジェネレータ利用側)において、先頭要素を指す[イテレータ](generator/iterator.md)を取得する([`begin`](generator/begin.md))、またはイテレータの[インクリメント操作](generator/iterator/op_increment.md)を行うまでジェネレータコルーチンは再開(resume)されない。 ジェネレータコルーチン本体処理において`co_yield`式に到達すると、生成値を保持してから中断(suspend)しジェネレータ利用側へと制御を戻す。 -ジェネレータ利用側ではイテレータの間接参照(単項`operator*`)を行うことで、ジェネレータによる生成値を取得する。 +ジェネレータ利用側では[イテレータの間接参照](generator/iterator/op_deref.md)を行うことで、ジェネレータによる生成値を取得する。 ### 説明用メンバ @@ -41,10 +41,10 @@ namespace std { - `reference` : [`conditional_t`](/reference/type_traits/conditional.md)`<`[`is_void_v`](/reference/type_traits/is_void.md)`, Ref&&, Ref>` - [`iterator`](generator/iterator.md) : ジェネレータが返すイテレータ型。 -`generator`および[`promise_type`](generator/promise_type.md)の動作説明のため、下記の説明用メンバを用いる。 +`generator`および[`promise_type`](generator/promise_type.md)と[`iterator`](generator/iterator.md)の動作説明のため、下記の説明用メンバを用いる。 -- [`coroutine_handle`](/reference/coroutine/coroutine_handle.md)`<`[`promise_type`](generator/promise_type.md)`>` : コルーチンハンドル(`coroutine_`) -- [`unique_ptr`](/reference/memory/unique_ptr.md)`<`[`stack`](/reference/stack/stack.md)`<`[`coroutine_handle<>`](/reference/coroutine/coroutine_handle.md)`>>`: アクティブスタック(`active_`) +- `coroutine_` : [`coroutine_handle`](/reference/coroutine/coroutine_handle.md)`<`[`promise_type`](generator/promise_type.md)`>`型のコルーチンハンドル +- `active_` : [`unique_ptr`](/reference/memory/unique_ptr.md)`<`[`stack`](/reference/stack/stack.md)`<`[`coroutine_handle<>`](/reference/coroutine/coroutine_handle.md)`>>`型のアクティブスタック ### 第1テンプレートパラメータ`Ref`の概要 diff --git a/reference/generator/generator/begin.md b/reference/generator/generator/begin.md index 735e5e94bf..a26eddc1eb 100644 --- a/reference/generator/generator/begin.md +++ b/reference/generator/generator/begin.md @@ -16,15 +16,16 @@ iterator begin(); ## 事前条件 -ジェネレータコルーチンは[初期サスペンドポイント](/lang/cpp20/coroutines.md)で中断している。 +ジェネレータコルーチンは[初期サスペンドポイント](promise_type/initial_suspend.md)で中断している。 ## 効果 -ジェネレータコルーチンを再開(resume)する。 +[コルーチンハンドル](/reference/coroutine/coroutine_handle.md)をアクティブスタック`*active_`にpushし、ジェネレータコルーチンを[再開(resume)](/reference/coroutine/coroutine_handle/resume.md)する。 ## 戻り値 ジェネレータコルーチンに対応する[`iterator`](iterator.md)オブジェクト。 +同`iterator`オブジェクトの説明用メンバ`coroutine_`は自ジェネレータコルーチンを参照する。 ## 備考 @@ -40,3 +41,7 @@ iterator begin(); - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`generator::iterator::operator++`](iterator/op_increment.md) diff --git a/reference/generator/generator/iterator.md b/reference/generator/generator/iterator.md index f9448c9f6b..2e29cd8a6d 100644 --- a/reference/generator/generator/iterator.md +++ b/reference/generator/generator/iterator.md @@ -8,47 +8,43 @@ namespace std { template class generator::iterator { - public: - using value_type = value; - using difference_type = ptrdiff_t; - - iterator(iterator&& other) noexcept; - iterator& operator=(iterator&& other) noexcept; - - reference operator*() const noexcept(is_nothrow_copy_constructible_v); - iterator& operator++(); - void operator++(int); - - friend bool operator==(const iterator& i, default_sentinel_t); + ... }; } ``` * generator[link ../generator.md] -* value[link ../generator.md] -* reference[link ../generator.md] -* is_nothrow_copy_constructible_v[link /reference/type_traits/is_nothrow_copy_constructible.md] - ## 概要 [`generator`](../generator.md)に対応する説明専用のイテレータ型。 +`iterator`の動作説明のため、下記の説明用メンバを用いる。 + +- `coroutine_` : [`coroutine_handle`](/reference/coroutine/coroutine_handle.md)`<`[`promise_type`](promise_type.md)`>`型のコルーチンハンドル + ## メンバ関数 ### 構築・破棄 | 名前 | 説明 | 対応バージョン | |-----------------|----------------|----------------| -| `(constructor)` | コンストラクタ | C++23 | -| `(destructor)` | デストラクタ | C++23 | -| `operator=` | 代入演算子 | C++23 | +| [`(constructor)`](iterator/op_constructor.md) | コンストラクタ | C++23 | +| `(destructor)` | デストラクタ | C++23 | +| [`operator=`](iterator/op_assign.md) | 代入演算子 | C++23 | ### イテレータ | 名前 | 説明 | 対応バージョン | |-----------------|----------------|----------------| -| `operator*()` | 間接参照 | C++23 | -| `operator++()` | 前置インクリメント | C++23 | -| `operator++(int)` | 後置インクリメント | C++23 | +| [`operator*`](iterator/op_deref.md) | 間接参照 | C++23 | +| [`operator++`](iterator/op_increment.md) | インクリメント | C++23 | + +### 比較演算子 + +| 名前 | 説明 | 対応バージョン | +|-----|-----|-----| +| [`operator==`](iterator/op_equal.md) | 等値比較 | C++23 | +| [`operator!=`](iterator/op_equal.md) | 非等値比較 (`==`により使用可能) | C++23 | + ## メンバ型 @@ -57,13 +53,6 @@ namespace std { | `value_type` | 要素型となる説明用の型[`value`](../generator.md) | C++23 | | `difference_type` | 2つの値の差を表す整数型`ptrdiff_t` | C++23 | -### 比較演算子 - -| 名前 | 説明 | 対応バージョン | -|-----|-----|-----| -| `bool operator==(const iterator&, default_sentinel_t)` | 等値比較 | C++23 | -| `bool operator!=(const iterator&, default_sentinel_t)` | 非等値比較 (`==`により使用可能) | C++23 | - ## バージョン ### 言語 diff --git a/reference/generator/generator/iterator/op_assign.md b/reference/generator/generator/iterator/op_assign.md new file mode 100644 index 0000000000..98c2a9cb5c --- /dev/null +++ b/reference/generator/generator/iterator/op_assign.md @@ -0,0 +1,39 @@ +# operator= +* generator[meta header] +* function[meta id-type] +* std[meta namespace] +* generator::iterator[meta class] +* cpp23[meta cpp] + +```cpp +iterator& operator=(iterator&& other) noexcept; +``` + +## 概要 +ジェネレータコルーチンのイテレータをムーブ代入する。 + + +## 効果 +```cpp +coroutine_ = exchange(other.coroutine_, {}); +``` +* exchange[link /reference/utility/exchange.md] + + +## 戻り値 +`*this` + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): +- [GCC](/implementation.md#gcc): +- [ICC](/implementation.md#icc): +- [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/generator/generator/iterator/op_constructor.md b/reference/generator/generator/iterator/op_constructor.md new file mode 100644 index 0000000000..438fcddca5 --- /dev/null +++ b/reference/generator/generator/iterator/op_constructor.md @@ -0,0 +1,38 @@ +# コンストラクタ +* generator[meta header] +* function[meta id-type] +* std[meta namespace] +* generator::iterator[meta class] +* cpp23[meta cpp] + +```cpp +iterator(iterator&& other) noexcept; +``` + +## 概要 +ジェネレータコルーチンのイテレータをムーブ構築する。 + +ジェネレータコルーチンの有効なイテレータは[`generator::begin()`](../begin.md)によって構築される。 + + +## 効果 +説明用メンバ`coroutine_`を[`exchange`](/reference/utility/exchange.md)`(other.coroutine_, {})`で初期化する。 + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): +- [GCC](/implementation.md#gcc): +- [ICC](/implementation.md#icc): +- [Visual C++](/implementation.md#visual_cpp): + + +## 関連項目 +- [`generator::begin()`](../begin.md) diff --git a/reference/generator/generator/iterator/op_deref.md b/reference/generator/generator/iterator/op_deref.md new file mode 100644 index 0000000000..62e13aa186 --- /dev/null +++ b/reference/generator/generator/iterator/op_deref.md @@ -0,0 +1,44 @@ +# operator* +* generator[meta header] +* function[meta id-type] +* std[meta namespace] +* generator::iterator[meta class] +* cpp23[meta cpp] + +```cpp +reference operator*() const + noexcept(is_nothrow_copy_constructible_v); +``` +* reference[link ../../generator.md] +* is_nothrow_copy_constructible_v[link /reference/type_traits/is_nothrow_copy_constructible.md] + +## 概要 +ジェネレータコルーチンにより生成された値にアクセスする。 + + +## 事前条件 +ある[`generator`](../../generator.md)オブジェクト`x`において`coroutine_`がアクティブスタック`*x.active_`に含まれており、かつアクティブスタックのトップ(`x.active_->top()`)がPromiseオブジェクト`p`をもつ中断されたコルーチンを指すこと。 + + +## 効果 +以下と等価 + +```cpp +return static_cast(*p.value_); +``` +* p.value_[link ../promise_type.md] + + +## 例外 +[`is_nothrow_copy_constructible_v`](/reference/type_traits/is_nothrow_copy_constructible.md)``が`true`のとき、`reference`コピーコンストラクタから送出された例外。 + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): +- [GCC](/implementation.md#gcc): +- [ICC](/implementation.md#icc): +- [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/generator/generator/iterator/op_equal.md b/reference/generator/generator/iterator/op_equal.md new file mode 100644 index 0000000000..fcb783956a --- /dev/null +++ b/reference/generator/generator/iterator/op_equal.md @@ -0,0 +1,41 @@ +# operator== +* generator[meta header] +* function[meta id-type] +* std[meta namespace] +* generator::iterator[meta class] +* cpp23[meta cpp] + +```cpp +friend bool operator==(const iterator& i, default_sentinel_t); + +// operator==により、以下の演算子が使用可能になる +friend bool operator!=(const iterator& i, default_sentinel_t); +``` +* default_sentinel_t[link /reference/iterator/default_sentinel_t.md] + +## 概要 +ジェネレータコルーチンのイテレータが終端まで到達したか否かを判定する。 + + +## 効果 +以下と等価 + +```cpp +return i.coroutine_.done(); +``` +* done()[link /reference/coroutine/coroutine_handle/done.md] + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): +- [GCC](/implementation.md#gcc): +- [ICC](/implementation.md#icc): +- [Visual C++](/implementation.md#visual_cpp): + + +## 関連項目 +- [`generator::end()`](../end.md) diff --git a/reference/generator/generator/iterator/op_increment.md b/reference/generator/generator/iterator/op_increment.md new file mode 100644 index 0000000000..27f16b451a --- /dev/null +++ b/reference/generator/generator/iterator/op_increment.md @@ -0,0 +1,46 @@ +# operator++ +* generator[meta header] +* function[meta id-type] +* std[meta namespace] +* generator::iterator[meta class] +* cpp23[meta cpp] + +```cpp +iterator& operator++(); // (1) +void operator++(int); // (2) +``` + +## 概要 +ジェネレータコルーチンを再開し、次の値生成を促す。 + + +## 事前条件 +ある[`generator`](../../generator.md)オブジェクト`x`において、`coroutine_`がアクティブスタック`*x.active_`に含まれること。 + + +## 効果 +- (1) : 次と等価 + ```cpp + x.active_->top().resume() + ``` + * resume()[link /reference/coroutine/coroutine_handle/resume.md] +- (2) : 次と等価: `++*this` + + +## 戻り値 +- (1) : `*this` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): +- [GCC](/implementation.md#gcc): +- [ICC](/implementation.md#icc): +- [Visual C++](/implementation.md#visual_cpp): + + +## 関連項目 +- [`generator::begin()`](../begin.md) diff --git a/reference/generator/generator/promise_type.md b/reference/generator/generator/promise_type.md index f45d7a5dae..555ecf2432 100644 --- a/reference/generator/generator/promise_type.md +++ b/reference/generator/generator/promise_type.md @@ -22,8 +22,8 @@ namespace std { `generator::promise_type`クラスの動作説明のため、以下の説明専用メンバを用いる。 -- [`add_pointer_t`](/reference/type_traits/add_pointer.md)`<`[`yielded`](../generator.md)`>`型 : `value_` -- [`exception_ptr`](/reference/exception/exception_ptr.md)型 : `except_` +- `value_` : [`add_pointer_t`](/reference/type_traits/add_pointer.md)`<`[`yielded`](../generator.md)`>`型の生成値 +- `except_` : [`exception_ptr`](/reference/exception/exception_ptr.md)型の例外ポインタ ## メンバ関数 diff --git a/reference/generator/generator/promise_type/final_suspend.md b/reference/generator/generator/promise_type/final_suspend.md index e5b01ea541..534adec2ff 100644 --- a/reference/generator/generator/promise_type/final_suspend.md +++ b/reference/generator/generator/promise_type/final_suspend.md @@ -15,14 +15,16 @@ auto final_suspend() noexcept; ## 事前条件 -Promiseオブジェクトが`*this`となる[コルーチンへのハンドル](/reference/coroutine/coroutine_handle.md)が、ある[`generator`オブジェクト](../../generator.md)`x`のアクティブスタックのトップにあること。 +Promiseオブジェクトが`*this`となる[コルーチンへのハンドル](/reference/coroutine/coroutine_handle.md)が、ある[`generator`オブジェクト](../../generator.md)`x`のアクティブスタック(`*active_`)のトップにあること。 この関数はコルーチン実行が最終サスペンドポイントに到達したときに呼び出される。 ## 戻り値 下記動作を行うメンバ関数をもつ、未規定の型のAwaitableオブジェクト。 -コルーチンの中断(suspend)時に、ジェネレータ`x`のアクティブスタックのトップからコルーチンハンドルをpopし、アクティブスタックが空でなければトップ要素が指すコルーチンを再開(resume)する。アクティブスタックが空の場合は、現在の[コルーチンの呼び出し元もしくは再開元(resumer)](/lang/cpp20/coroutines.md)へ制御フローを戻す。 +- コルーチンの中断(suspend)時に、ジェネレータ`x`のアクティブスタック(`*x.active_`)のトップからコルーチンハンドルをpopし、 + - アクティブスタックが空でなければトップ要素(`*x.active_->top()`)が指すコルーチンを[再開(resume)](/reference/coroutine/coroutine_handle/resume.md)する。 + - アクティブスタックが空の場合は、現在の[コルーチンの呼び出し元もしくは再開元(resumer)](/lang/cpp20/coroutines.md)へ制御フローを戻す。 ## 例外 diff --git a/reference/generator/generator/promise_type/get_return_object.md b/reference/generator/generator/promise_type/get_return_object.md index c41948ed96..ec7c9f2962 100644 --- a/reference/generator/generator/promise_type/get_return_object.md +++ b/reference/generator/generator/promise_type/get_return_object.md @@ -11,12 +11,15 @@ generator get_return_object() noexcept; * generator[link ../../generator.md] ## 概要 -ジェネレータ[コルーチン](/lang/cpp20/coroutines.md)の戻り値オブジェクトを生成する。 +ジェネレータ[コルーチン](/lang/cpp20/coroutines.md)の戻り値[`generator`](../../generator.md)オブジェクトを生成する。 プログラマが本関数を直接利用することは想定されていない。 ## 戻り値 -[`coroutine_handle`](/reference/coroutine/coroutine_handle.md)`::`[`from_promise`](/reference/coroutine/coroutine_handle/from_promise.md)`(*this)`で取得したコルーチンハンドルを保持し、[アクティブスタック](../../generator.md)を空(empty)で初期化した、[`generator`](../../generator.md)オブジェクト。 +下記の通り説明専メンバ初期化を行なった[`generator`](../../generator.md)オブジェクト。 + +- コルーチンハンドル`coroutine_` : [`coroutine_handle`](/reference/coroutine/coroutine_handle.md)`::`[`from_promise`](/reference/coroutine/coroutine_handle/from_promise.md)`(*this)` +- アクティブスタック`active_` : 空(empty)スタック ## 例外 diff --git a/reference/generator/generator/promise_type/initial_suspend.md b/reference/generator/generator/promise_type/initial_suspend.md index 428c6b194c..8dfd1369af 100644 --- a/reference/generator/generator/promise_type/initial_suspend.md +++ b/reference/generator/generator/promise_type/initial_suspend.md @@ -16,7 +16,7 @@ suspend_always initial_suspend() const noexcept; ## 戻り値 -[`suspend_always`](/reference/coroutine/suspend_always.md) +[`suspend_always{}`](/reference/coroutine/suspend_always.md) ## 例外 diff --git a/reference/generator/generator/promise_type/unhandled_exception.md b/reference/generator/generator/promise_type/unhandled_exception.md index c0e61fabcd..903308bc13 100644 --- a/reference/generator/generator/promise_type/unhandled_exception.md +++ b/reference/generator/generator/promise_type/unhandled_exception.md @@ -15,11 +15,11 @@ void unhandled_exception(); ## 事前条件 -Promiseオブジェクトが`*this`となる[コルーチンへのハンドル](/reference/coroutine/coroutine_handle.md)が、ある[`generator`オブジェクト](../../generator.md)`x`のアクティブスタックのトップにあること。 +Promiseオブジェクトが`*this`となる[コルーチンへのハンドル](/reference/coroutine/coroutine_handle.md)が、ある[`generator`オブジェクト](../../generator.md)`x`のアクティブスタック`x.active_`のトップにあること。 ## 効果 -Promiseオブジェクトが`*this`となる[コルーチンへのハンドル](/reference/coroutine/coroutine_handle.md)がジェネレータ`x`のアクティブスタックの単独要素であれば、式`throw;`に等しい。 +Promiseオブジェクトが`*this`となる[コルーチンへのハンドル](/reference/coroutine/coroutine_handle.md)がジェネレータ`x`のアクティブスタック`x.active_`の唯一の要素であれば、式`throw`に等しい。 そうでなければ、[説明専用メンバ`except_`](../promise_type.md)に[`current_exception()`](/reference/exception/current_exception.md)を代入する。 diff --git a/reference/generator/generator/promise_type/yield_value.md b/reference/generator/generator/promise_type/yield_value.md index 0bf6d5bff7..51bcb800fe 100644 --- a/reference/generator/generator/promise_type/yield_value.md +++ b/reference/generator/generator/promise_type/yield_value.md @@ -38,8 +38,8 @@ auto yield_value(ranges::elements_of r) noexcept; // (4) ## 事前条件 -- (2) : Promiseオブジェクトが`*this`となる[コルーチンへのハンドル](/reference/coroutine/coroutine_handle.md)が、ある[`generator`オブジェクト](../../generator.md)`x`のアクティブスタックのトップにあること。 -- (3) : Promiseオブジェクトが`*this`となる[コルーチンへのハンドル](/reference/coroutine/coroutine_handle.md)が、ある[`generator`オブジェクト](../../generator.md)`x`のアクティブスタックのトップにあること。ジェネレータ`g.range`に対応するコルーチンが、初期サスペンドポイントにて中断されていること。 +- (2) : Promiseオブジェクトが`*this`となる[コルーチンへのハンドル](/reference/coroutine/coroutine_handle.md)が、ある[`generator`オブジェクト](../../generator.md)`x`のアクティブスタック`x.active_`のトップにあること。 +- (3) : Promiseオブジェクトが`*this`となる[コルーチンへのハンドル](/reference/coroutine/coroutine_handle.md)が、ある[`generator`オブジェクト](../../generator.md)`x`のアクティブスタック`x.active_`のトップにあること。ジェネレータ`g.range`に対応するコルーチンが、[初期サスペンドポイント](initial_suspend.md)にて中断されていること。 ## 効果 @@ -79,8 +79,14 @@ return yield_value(ranges::elements_of(nested( ## 戻り値 - (1) : [`suspend_always{}`](/reference/coroutine/suspend_always.md) -- (2) : `lval`を用いて直接非リスト初期化された[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`<`[`yielded`](../../generator.md)`>`型オブジェクトを保持し、[説明専用メンバ`value_`](../promise_type.md)が保持されたオブジェクトを指してコルーチンを中断(suspend)するメンバ関数をもつ、未規定の型の[Awaitableオブジェクト](/lang/cpp20/coroutines.md)。 -- (3) : ジェネレータ`g.range`の所有権を受け取り、メンバ関数`await_ready`は`false`を返し、メンバ関数`await_suspend`は`x`のアクティブスタックに`g.range`に対応する[コルーチンハンドル](/reference/coroutine/coroutine_handle.md)をpushしてから`g.range`を再開(resume)し、メンバ関数`await_resume`は[説明専用メンバ`except_`](../promise_type.md)が例外を保持している場合に[`rethrow_exception`](/reference/exception/rethrow_exception.md)`(except_)`を行う、未規定の型の[Awaitableオブジェクト](/lang/cpp20/coroutines.md)。 +- (2) : 以下の動作をする未規定の型の[Awaitableオブジェクト](/lang/cpp20/coroutines.md) + - `lval`で直接非リスト初期化された[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`<`[`yielded`](../../generator.md)`>`型オブジェクトを保持する。 + - [説明専用メンバ`value_`](../promise_type.md)が保持オブジェクトを指してコルーチンを中断(suspend)するメンバ関数を持つ。 +- (3) : 以下の動作をする未規定の型の[Awaitableオブジェクト](/lang/cpp20/coroutines.md) + - Range[`g.range`](/reference/ranges/elements_of.md)の所有権を受け取る。 + - メンバ関数`await_ready` : `false`を返す。 + - メンバ関数`await_suspend` : `x`のアクティブスタック`*x.active_`に`g.range.`[`coroutine_`](/reference/coroutine/coroutine_handle.md)をpushしてから`g.range.coroutine_`を[再開(resume)](/reference/coroutine/coroutine_handle/resume.md)する。 + - メンバ関数`await_resume` : [説明専用メンバ`except_`](../promise_type.md)が例外を保持している場合に[`rethrow_exception`](/reference/exception/rethrow_exception.md)`(except_)`を行う。そうでなければ、何もしない。 ## 例外 @@ -89,7 +95,7 @@ return yield_value(ranges::elements_of(nested( ## 備考 -この関数を呼び出す`co_yield`式は`void`型となる。 +ジェネレータコルーチンの`co_yield`式は`void`型となる。 ## バージョン From 24fe7f15722721381ee8f0ad3ce7b3e1fbafaa75 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sat, 24 Feb 2024 23:38:36 +0900 Subject: [PATCH 0751/3948] =?UTF-8?q?typo=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/to.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/ranges/to.md b/reference/ranges/to.md index 7e8c85d402..e55fac84b6 100644 --- a/reference/ranges/to.md +++ b/reference/ranges/to.md @@ -34,7 +34,7 @@ Rangeの各要素を要素とするコンテナを構築する。 ## 適格要件 -- (1), (3): `C` はCV装飾のないクラス型であること。 +- (1), (3): `C` はCV修飾のないクラス型であること。 ## 戻り値 From 7de1886ba9dd411e8f16fe176a9dc67f0a76c066 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sun, 25 Feb 2024 00:34:10 +0900 Subject: [PATCH 0752/3948] =?UTF-8?q?ranges::to=20=E3=83=AA=E3=83=B3?= =?UTF-8?q?=E3=82=AF=E4=BF=AE=E6=AD=A3=E3=81=A8=E8=AA=AC=E6=98=8E=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 3 +++ reference/ranges/to.md | 34 +++++++++++++++++++++++++++------- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 4982111e8d..a09cb39ca1 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -177,6 +177,7 @@ * range_difference_t[link /reference/ranges/range_difference_t.md] * range_reference_t[link /reference/ranges/range_reference_t.md] * range_rvalue_reference_t[link /reference/ranges/range_reference_t.md] + * range_size_t[link /reference/ranges/range_size_t.md] * range_value_t[link /reference/ranges/range_value_t.md] * range[link /reference/ranges/range.md] * sentinel_t[link /reference/ranges/sentinel_t.md] @@ -246,6 +247,8 @@ * [link /reference/unordered_set.md] * std::unordered_set[link /reference/unordered_set/unordered_set.md] * [link /reference/utility.md] + * declval[link /reference/utility/declval.md] + * std::forward[link /reference/utility/forward.md] * std::make_pair[link /reference/utility/make_pair.md] * std::pair[link /reference/utility/pair.md] * [link /reference/valarray.md] diff --git a/reference/ranges/to.md b/reference/ranges/to.md index e55fac84b6..5edbbf82d4 100644 --- a/reference/ranges/to.md +++ b/reference/ranges/to.md @@ -54,10 +54,13 @@ Rangeの各要素を要素とするコンテナを構築する。 ```cpp C c(std::forward(args)...); -if constexpr (sized_range && reservable-container) +if constexpr (sized_range && reservable-container) { c.reserve(static_cast>(ranges::size(r))); +} ranges::copy(r, container-inserter>(c)); ``` +* ranges::size[link /reference/ranges/size.md] +* ranges::copy[link /reference/algorithm/ranges_copy.md] [`input_range`](input_range.md)`<`[`range_reference_t`](range_reference_t.md)`>`である場合: @@ -66,6 +69,7 @@ to(r | views::transform([](auto&& elem) { return to>(std::forward(elem)); }), std::forward(args)...); ``` +* views::transform[link transform_view.md] どの条件にもあてはまらない場合、プログラムは不適格である。 @@ -85,6 +89,9 @@ struct input-iterator { bool operator==(const input-iterator&) const; }; ``` +* input_iterator_tag[link /reference/iterator/iterator_tag.md] +* ptrdiff_t[link /reference/cstddef/ptrdiff_t.md] +* add_pointer_t[link /reference/type_traits/add_pointer.md] また、`DEDUCE_EXPR` を次のように定義する。 @@ -104,18 +111,20 @@ struct input-iterator { ## 備考 -本説明に用いる説明専用コンセプトを以下のように定義する。 +本説明に用いる説明専用要素を以下のように定義する。 ```cpp +// reservable-container: 容量をあらかじめ確保できることを要求するコンセプト template constexpr bool reservable-container = sized_range && requires(Container& c, range_size_t n) { - c.reserve(n); - { c.capacity() } -> same_as; - { c.max_size() } -> same_as; + c.reserve(n); // コンテナのサイズ型を引数とするreserveメンバ関数がある + { c.capacity() } -> same_as; // コンテナのサイズ型を返すcapacityメンバ関数がある + { c.max_size() } -> same_as; // コンテナのサイズ型を返すmax_sizeメンバ関数がある }; +// container-insertable: push_backまたはinsertが使えることを要求するコンセプト template constexpr bool container-insertable = requires(Container& c, Ref&& ref) { @@ -123,14 +132,19 @@ constexpr bool container-insertable = requires { c.insert(c.end(), std::forward(ref)); }); }; +// container-inserter: push_backが使えればback_inserter, そうでなければinserterを返す関数 template constexpr auto container-inserter(Container& c) { - if constexpr (requires { c.push_back(declval()); }) + if constexpr (requires { c.push_back(declval()); }) { return back_inserter(c); - else + } else { return inserter(c, c.end()); + } } ``` +* back_inserter[link /reference/iterator/back_inserter.md] +* inserter[link /reference/iterator/inserter.md] + ## この機能が必要になった背景・経緯 @@ -155,6 +169,9 @@ int main() { println("{}", words); } ``` +* views::split[link split_view.md] +* vector[link /reference/vector/vector.md] +* string[link /reference/string/basic_string.md] これを簡潔に書くために、`to`関数が提案された。 @@ -176,6 +193,9 @@ int main() { } ``` * ranges::to[color ff0000] +* views::split[link split_view.md] +* vector[link /reference/vector/vector.md] +* string[link /reference/string/basic_string.md] ### 出力 ``` From 089593d95e279c2ddc87bcb23dfc7c68e5de0429 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sun, 25 Feb 2024 01:06:17 +0900 Subject: [PATCH 0753/3948] =?UTF-8?q?C++23=E7=9B=AE=E6=AC=A1=E3=81=AE?= =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/cpp23.md b/lang/cpp23.md index b070b38784..c36dbab5e3 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -146,8 +146,8 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 - Rangeを指定の大きさで分割する[`std::views::chunk`](/reference/ranges/chunk_view.md.nolink)と、Rangeを指定の大きさの隣接要素で分割する[`std::views::slide`](/reference/ranges/slide_view.md.nolink)を追加 - Rangeを条件一致する間の要素で分割する[`std::views::chunk_by`](/reference/ranges/chunk_by_view.md.nolink)を追加 - [``](/reference/ranges.md)に、Rangeを等間隔からなるRangeに変換する[`std::views::stride`](/reference/ranges/stride_view.md.nolink)を追加 -- [``](/reference/ranges.md)に、Rangeをムーブするための[`std::views::as_rvalue`](/reference/ranges/as_rvalue.md.nolink)を追加 -- [``](/reference/ranges.md)に、指定した値をN回繰り返すRangeを生成する[`std::views::repeat`](/reference/ranges/repeat.md.nolink)を追加 +- [``](/reference/ranges.md)に、Rangeをムーブするための[`std::views::as_rvalue`](/reference/ranges/as_rvalue_view.md)を追加 +- [``](/reference/ranges.md)に、指定した値をN回繰り返すRangeを生成する[`std::views::repeat`](/reference/ranges/repeat_view.md)を追加 - [``](/reference/ranges.md)に、Rangeをインデックス付きでループさせる[`std::views::enumerate`](/reference/ranges/enumerate.md.nolink)を追加 From 8fa793b4fd5e418cec54b70be5bc4274e37dfbe3 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sun, 25 Feb 2024 01:07:49 +0900 Subject: [PATCH 0754/3948] =?UTF-8?q?views::join=5Fwith=20=E3=81=AE?= =?UTF-8?q?=E8=AA=AC=E6=98=8E=E3=82=92=E8=BF=BD=E5=8A=A0=20#1074?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 4 +- lang/cpp23.md | 2 +- reference/ranges.md | 4 +- reference/ranges/join_view.md | 7 +- reference/ranges/join_with_view.md | 166 +++++++++++++++++++++++++++++ 5 files changed, 177 insertions(+), 6 deletions(-) create mode 100644 reference/ranges/join_with_view.md diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index a09cb39ca1..040138f0a7 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -72,6 +72,8 @@ * [link /reference/codecvt.md] * [link /reference/complex.md] * [link /reference/concepts.md] + * common_reference_with[link /reference/concepts/common_reference_with.md] + * common_with[link /reference/concepts/common_with.md] * same_as[link /reference/concepts/same_as.md] * [link /reference/condition_variable.md] * std::condition_variable[link /reference/condition_variable/condition_variable.md] @@ -176,7 +178,7 @@ * random_access_range[link /reference/ranges/random_access_range.md] * range_difference_t[link /reference/ranges/range_difference_t.md] * range_reference_t[link /reference/ranges/range_reference_t.md] - * range_rvalue_reference_t[link /reference/ranges/range_reference_t.md] + * range_rvalue_reference_t[link /reference/ranges/range_rvalue_reference_t.md] * range_size_t[link /reference/ranges/range_size_t.md] * range_value_t[link /reference/ranges/range_value_t.md] * range[link /reference/ranges/range.md] diff --git a/lang/cpp23.md b/lang/cpp23.md index c36dbab5e3..7e5f8184cf 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -142,7 +142,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 - Rangeを末尾に追加する`append_range()`メンバ関数 - Rangeを代入する`assign_range()`メンバ関数 - ユーザー定義のRangeアダプタがパイプライン演算子 `|` をサポートしやすくするために、[``](/reference/ranges.md)に[`std::ranges::range_adaptor_closure`](/reference/ranges/range_adaptor_closure.md.nolink)クラスを追加 -- [``](/reference/ranges.md)に、Rangeを連結させる[`join_with`](/reference/ranges/join_with.md.nolink)を追加 +- [``](/reference/ranges.md)に、Rangeを連結させる[`join_with`](/reference/ranges/join_with_view.md)を追加 - Rangeを指定の大きさで分割する[`std::views::chunk`](/reference/ranges/chunk_view.md.nolink)と、Rangeを指定の大きさの隣接要素で分割する[`std::views::slide`](/reference/ranges/slide_view.md.nolink)を追加 - Rangeを条件一致する間の要素で分割する[`std::views::chunk_by`](/reference/ranges/chunk_by_view.md.nolink)を追加 - [``](/reference/ranges.md)に、Rangeを等間隔からなるRangeに変換する[`std::views::stride`](/reference/ranges/stride_view.md.nolink)を追加 diff --git a/reference/ranges.md b/reference/ranges.md index be0067b519..5f09f144ff 100644 --- a/reference/ranges.md +++ b/reference/ranges.md @@ -280,8 +280,8 @@ range | adaptor(args...) | 名前 | 説明 | 対応バージョン | |-----------------------------------------------------|---------------------------------------------------------------------------------------------------|----------------| -| [`join_with_view`](ranges/join_with_view.md.nolink) | ネストされたRangeをデリミタで区切りながら平坦にするビュー (class template) | C++23 | -| [`views::join_with`](ranges/join_with_view.md.nolink) | ネストされたRangeをデリミタで区切りながら平坦にするビューを生成する (customization point object) | C++23 | +| [`join_with_view`](ranges/join_with_view.md) | ネストされたRangeをデリミタで区切りながら平坦にするビュー (class template) | C++23 | +| [`views::join_with`](ranges/join_with_view.md) | ネストされたRangeをデリミタで区切りながら平坦にするビューを生成する (customization point object) | C++23 | ### lazy split view diff --git a/reference/ranges/join_view.md b/reference/ranges/join_view.md index 63876aaa98..43b8483f12 100644 --- a/reference/ranges/join_view.md +++ b/reference/ranges/join_view.md @@ -56,8 +56,6 @@ namespace std::ranges { | [`begin`](join_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++20 | | [`end`](join_view/end.md.nolink) | 番兵を取得する | C++20 | -`r`を元のRangeとする。`size`は[`ranges::size`](size.md)`(r)`が有効な式であるときに定義される。 - ## 継承しているメンバ関数 | 名前 | 説明 | 対応バージョン | @@ -99,6 +97,8 @@ int main() { h,e,l,l,o,w,o,r,l,d, ``` +ネストされた `char` のRangeが平坦な `char` のRangeになっている。 + ## バージョン ### 言語 - C++20 @@ -109,6 +109,9 @@ h,e,l,l,o,w,o,r,l,d, - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +## 関連項目 +- [`join_with_view`](join_with_view.md) + ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) - [C++20 ranges](https://techbookfest.org/product/5134506308665344) diff --git a/reference/ranges/join_with_view.md b/reference/ranges/join_with_view.md new file mode 100644 index 0000000000..65df60a045 --- /dev/null +++ b/reference/ranges/join_with_view.md @@ -0,0 +1,166 @@ +# join_with_view +* ranges[meta header] +* std::ranges[meta namespace] +* class template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template + requires view && input_range> + && view + && compatible-joinable-ranges, Pattern> + class join_with_view : public view_interface> { …… }; // (1) + + namespace views { + inline constexpr /*unspecified*/ join_with = /*unspecified*/; // (2) + } +} +``` +* compatible-joinable-ranges[italic] +* bidirectional-common[italic] +* common_with[link /reference/concepts/common_with.md] +* common_reference_with[link /reference/concepts/common_reference_with.md] + +## 概要 + +`join_with_view`は要素がRangeであるRangeの各要素を繋げて1つのRangeとして扱う[`view`](view.md)。 +その際、[`join_view`](join_view.md)と異なり、外側のRangeの各要素の間にデリミタを挿入する。 +デリミタは単一の要素またはRangeである。デリミタがRangeの場合、外側のRangeの各要素の間にデリミタの各要素が毎回挿入される。 + +- (1): `join_with_view`のクラス定義 +- (2): `join_with_view`を生成するRangeアダプタオブジェクト + +### Rangeコンセプト + +| borrowed | sized | output | input | forward | bidirectional | random_access | contiguous | common | viewable | view | +|----------|-------|--------|-------|---------|---------------|---------------|------------|--------|----------|------| +| | | | 〇 | (1) | (2) | | | (3) | ○ | ○ | + +- (1): 外側・内側のRangeが[`forward_range`](forward_range.md)であり、内側Rangeが参照型のとき +- (2): 外側・内側のRangeが[`bidirectional_range`](bidirectional_range.md)であり、内側Rangeが参照型かつ[`common_range`](common_range.md)であるとき +- (3): 外側・内側のRangeが[`forward_range`](forward_range.md)かつ[`common_range`](common_range.md)であり + - `const`ではない場合、内側のRangeは参照型(*prvalue*ではない) + +外側Rangeとは`V`のことであり、内側Rangeとは`range_reference_t`のことである。`const`の場合`V`を`const V`として同様。 + +## 効果 + +- (2): 式`views::join_with(E, F)`の効果は[`join_with_view{E, F}`](join_with_view/op_constructor.md.nolink)と等しい。 + +## 備考 + +本説明に用いる説明専用要素を以下のように定義する。 + +```cpp +namespace std::ranges { + template + concept compatible-joinable-ranges = // 説明専用 + common_with, range_value_t

> && + common_reference_with, range_reference_t

> && + common_reference_with, range_rvalue_reference_t

>; + + template + concept bidirectional-common = bidirectional_range && common_range; // 説明専用 +} +``` + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|--------------------------------------------------|----------------------------------|----------------| +| [`(constructor)`](join_with_view/op_constructor.md.nolink) | コンストラクタ | C++23 | +| [`base`](join_with_view/base.md.nolink) | `V`の参照を取得する | C++23 | +| [`begin`](join_with_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++23 | +| [`end`](join_with_view/end.md.nolink) | 番兵を取得する | C++23 | + +## 継承しているメンバ関数 + +| 名前 | 説明 | 対応バージョン | +|----------------------------------------------|-----------------------------------|----------------| +| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++20 | +| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++20 | +| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | +| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | + +## 推論補助 + +| 名前 | 説明 | 対応バージョン | +|-------------------------------------------------------|------------------------------|----------------| +| [`(deduction_guide)`](join_with_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + using namespace std; + vector sv = {"hello", "world"}; + + for (char c : sv | views::join_with('-')) { + println("{}", c); + } +} +``` +* views::join[color ff0000] + +### 出力 +``` +h +e +l +l +o +- +w +o +r +l +d +``` + +ネストされた `char` のRangeが平坦な `char` のRangeになっている。 + +## 例 (結果を文字列にする) +```cpp example +#include +#include +#include +#include + +int main() { + using namespace std; + vector sv = {"hello", "world"}; + + println("{}", sv | views::join_with("-C++23-"sv) | ranges::to()); +} +``` +* views::join[color ff0000] + +### 出力 +``` +hello-C++23-world +``` + +`join_with`で得られる `char` のRangeは[`string`](/reference/string/basic_string.md)ではないが、[`ranges::to`](to.md)を使って変換できる。 + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.2 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 関連項目 +- [`join_view`](join_view.md) + +## 参照 +- [N4950 24 Ranges library](https://timsong-cpp.github.io/cppwp/ranges) From ff47b79f2932c739749a02e5d9de19b559125901 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sun, 25 Feb 2024 01:12:42 +0900 Subject: [PATCH 0755/3948] =?UTF-8?q?ranges::to=E3=81=B8=E3=81=AE=E3=83=AA?= =?UTF-8?q?=E3=83=B3=E3=82=AF=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/generator/generator.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/generator/generator.md b/reference/generator/generator.md index 82c5e91ac4..236c8f103d 100644 --- a/reference/generator/generator.md +++ b/reference/generator/generator.md @@ -329,6 +329,7 @@ int main() * co_yield[link /lang/cpp20/coroutines.md] * std::to_string[link /reference/string/to_string.md] * std::views::take[link /reference/ranges/take_view.md] +* std::ranges::to[link /reference/ranges/to.md] #### 出力 ``` From 8dec62d7786a676e8800737e4f4eabe909008c12 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sun, 25 Feb 2024 01:16:42 +0900 Subject: [PATCH 0756/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/join_with_view.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/reference/ranges/join_with_view.md b/reference/ranges/join_with_view.md index 65df60a045..5d880b49cb 100644 --- a/reference/ranges/join_with_view.md +++ b/reference/ranges/join_with_view.md @@ -19,8 +19,6 @@ namespace std::ranges { ``` * compatible-joinable-ranges[italic] * bidirectional-common[italic] -* common_with[link /reference/concepts/common_with.md] -* common_reference_with[link /reference/concepts/common_reference_with.md] ## 概要 @@ -107,7 +105,7 @@ int main() { } } ``` -* views::join[color ff0000] +* views::join_with[color ff0000] ### 出力 ``` @@ -140,7 +138,8 @@ int main() { println("{}", sv | views::join_with("-C++23-"sv) | ranges::to()); } ``` -* views::join[color ff0000] +* views::join_with[color ff0000] +* ranges::to[link to.md] ### 出力 ``` From a5a2bc7fa59eb15eff1c8eb5b294e17c7df7ef7a Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sun, 25 Feb 2024 01:20:26 +0900 Subject: [PATCH 0757/3948] =?UTF-8?q?=20=E3=83=AA=E3=83=B3=E3=82=AF?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/join_with_view.md | 1 - 1 file changed, 1 deletion(-) diff --git a/reference/ranges/join_with_view.md b/reference/ranges/join_with_view.md index 5d880b49cb..bb7de30762 100644 --- a/reference/ranges/join_with_view.md +++ b/reference/ranges/join_with_view.md @@ -18,7 +18,6 @@ namespace std::ranges { } ``` * compatible-joinable-ranges[italic] -* bidirectional-common[italic] ## 概要 From e6fcf7458973c69b6f55aa1b1b3c4a54ee40763b Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sun, 25 Feb 2024 01:32:46 +0900 Subject: [PATCH 0758/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp23.md b/lang/cpp23.md index 7e5f8184cf..f73b4ba47a 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -152,7 +152,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 ### アルゴリズム -- [``](/reference/algorithm.md)に、範囲の先頭が指定した範囲と合致するかを判定する[`std::starts_with()`](/reference/algorithm/starts_with.md.nolink)、範囲の末尾が指定した範囲と合致するかを判定する[`std::ends_with()`](/reference/algorithm/ends_with.md.nolink)を追加 +- [``](/reference/algorithm.md)に、範囲の先頭が指定した範囲と合致するかを判定する[`std::starts_with()`](/reference/algorithm/ranges_starts_with.md)、範囲の末尾が指定した範囲と合致するかを判定する[`std::ends_with()`](/reference/algorithm/ranges_ends_with.md)を追加 - [``](/reference/algorithm.md)に、要素を左シフトさせるRangeアルゴリズム[`std::ranges::shift_left()`](/reference/algorithm/ranges_shift_left.md)、要素を右シフトさせるRangeアルゴリズム[`std::ranges::shift_right()`](/reference/algorithm/ranges_shift_right.md)を追加 - [``](/reference/algorithm.md)に、範囲の末尾から要素を検索する以下のアルゴリズムを追加: - [`std::ranges::find_last()`](/reference/algorithm/ranges_find_last.md.nolink) From 426105d468e086c0b7eb3e3cda5e51e60888c3bf Mon Sep 17 00:00:00 2001 From: yumetodo Date: Sun, 25 Feb 2024 12:04:10 +0900 Subject: [PATCH 0759/3948] =?UTF-8?q?fix:=20C++23=E3=81=AEDIS=E3=81=AFN495?= =?UTF-8?q?0=E3=81=A7=E6=B1=BA=E3=81=BE=E3=82=8A=E3=81=A8=E8=A6=8B?= =?UTF-8?q?=E3=81=A6=E8=89=AF=E3=81=95=E3=81=9D=E3=81=86=E3=81=A0=E3=81=A3?= =?UTF-8?q?=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://www.open-std.org/jtc1/sc22/wg21/docs/standards に載っていた。あと https://github.com/timsong-cpp/cppwp/commit/9c553ba3ed728e7f4036f0e663130012ec21a525 でいつものHTML版も生えていた --- international-standard.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/international-standard.md b/international-standard.md index 6fb9e3eeec..ee0609fc90 100644 --- a/international-standard.md +++ b/international-standard.md @@ -13,7 +13,7 @@ C++ の標準規格は、他にも各国の規格化団体によって国際標 | 通称†1 | 名称 | 参照する規格案†2 | 規格案・原案 | `__cplusplus` | |:--|:--|:--|:--|:--| | [C++26](lang/cpp26.md) (C++2c) | ISO/IEC 14882:2026 (予定) | N4971([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4971.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/)) | N4971 N4964 N4958 | -- | -| [C++23](lang/cpp23.md) (C++2b) | ISO/IEC 14882:2023 (予定) | N4950([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4950.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/)) | N4950 N4944 N4928 N4917 N4910 N4901 N4892 N4885 N4878
N4868 N4861 | -- | +| [C++23](lang/cpp23.md) (C++2b) | ISO/IEC 14882:2023 (予定) | N4950([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4950.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4950/)) | N4950 N4944 N4928 N4917 N4910 N4901 N4892 N4885 N4878
N4868 N4861 | -- | | [C++20](lang/cpp20.md) (C++2a) | ISO/IEC 14882:2020 | N4861†3([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/n4861.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4861/)) | N4860 N4849 N4842 N4835 N4830
N4820 N4810 N4800 N4791 N4788†4
N4778 N4762 N4750 N4741 N4727
N4713 N4700 N4687 | `202002L` | | [C++17](lang/cpp17.md) (C++1z) | ISO/IEC 14882:2017 | N4659([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4659.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4659/)) | N4660 N4659 N4640 N4618 N4606
N4594 N4582 N4567 N4527 N4431
N4296 | `201703L` | | [C++14](lang/cpp14.md) (C++1y) | ISO/IEC 14882:2014 | N4140([PDF](https://github.com/cplusplus/draft/blob/master/papers/n4140.pdf?raw=true)/[HTML](https://timsong-cpp.github.io/cppwp/n4140/)) | N4141 N4140 N3937 N3936 N3797
N3691 N3690 N3485 N3376 N3337 | `201402L` | From 79fc60a46544883f2f132639a33ff68adb99e3d4 Mon Sep 17 00:00:00 2001 From: yumetodo Date: Sun, 25 Feb 2024 20:16:22 +0900 Subject: [PATCH 0760/3948] =?UTF-8?q?fix:=20CWG=202518/P2593R1=20=E3=82=92?= =?UTF-8?q?=E5=8F=8D=E6=98=A0=20(#1257)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp11/static_assert.md | 7 +++++-- lang/cpp17/if_constexpr.md | 27 +++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/lang/cpp11/static_assert.md b/lang/cpp11/static_assert.md index ea9cab600f..5d4a674b96 100644 --- a/lang/cpp11/static_assert.md +++ b/lang/cpp11/static_assert.md @@ -28,7 +28,8 @@ static_assert(定数式, 文字列リテラル); - この宣言は、名前空間スコープ、ブロックスコープ、メンバ宣言といった場所で記述できる - 定数式が真であると評価された場合は何も効果がない。定数式が偽であると評価された場合は、指定された文字列リテラルを含む診断メッセージがコンパイラによって問題報告される。ただし、基本ソース文字集合に含まれない文字集合は、診断メッセージに表示することはコンパイラに要求されない - `static_assert`宣言では、新たな型やオブジェクトは宣言しない。また、実行時にサイズや時間コストは発生しない - +- (C++23以降 or CWG 2518が適用された環境): template文(もしくは適切な特殊化や[C++17 constexpr if 文](/lang/cpp17/if_constexpr.md)の中の文)が実際にインスタンス化されるまで、`static_assert`文の宣言は遅延される。 + - [C++17 constexpr if 文](/lang/cpp17/if_constexpr.md)の解説を参照 ## 例 ```cpp example @@ -79,6 +80,7 @@ Boost Static Assertion Libraryが開発されたときに、コンパイル時 ## 関連項目 - [C++17 `static_assert`のメッセージ省略を許可](/lang/cpp17/extending_static_assert.md) +- [C++17 constexpr if 文](/lang/cpp17/if_constexpr.md) - [C++23 定数式の文脈での`bool`への縮小変換を許可](/lang/cpp23/narrowing_contextual_conversions_to_bool.md) @@ -87,4 +89,5 @@ Boost Static Assertion Libraryが開発されたときに、コンパイル時 - [N1604 Proposal to Add Static Assertions to the Core Language (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1604.html) - [N1617 Proposal to Add Static Assertions to the Core Language (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1617.html) - [N1720 Proposal to Add Static Assertions to the Core Language (Revision 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1720.html) - +- [P2593R1: Allowing static_assert(false)](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2593r1.html) +- [Issue 2518: Conformance requirements and #error/#warning - WG21 CWG Issues](https://wg21.cmeerw.net/cwg/issue2518) diff --git a/lang/cpp17/if_constexpr.md b/lang/cpp17/if_constexpr.md index ae6cd312b0..a44aff7fbc 100644 --- a/lang/cpp17/if_constexpr.md +++ b/lang/cpp17/if_constexpr.md @@ -164,6 +164,30 @@ int main() } ``` +### (C++23以降 or CWG 2518が適用された環境) `static_assert`文に関する例外 + +上に述べたように、`constexpr if`文の中の文は破棄文においても、非依存名の検証を行う。このため特に`static_assert`文を使う時に直感的ではない挙動を示していた。 + +C++23以降、もしくはCWG 2518が適用された環境においては、template文(もしくは適切な特殊化や`constexpr if`文の中の文)が実際にインスタンス化されるまで、`static_assert`文の宣言は遅延される。 + +```cpp example +#include +template +void f(T t) { + if constexpr (sizeof(T) == sizeof(std::int32_t)) { + use(t); + } else { + static_assert(false, "must be 32bit"); + } +} + +void g(std::int8_t c) { + std::int32_t n = 0; + f(n); // OK: nはstd::int32_t型なので`use(t);`のほうがインスタンス化されるために、static_assert文は宣言されない。 + f(c); // error: cはstd::int8_t型なので、static_assert文は宣言され、"must be 32bit"とコンパイラが診断メッセージを出力する +} +``` + ### 類似機能との比較 `constexpr if`文の導入によってC++の`if`系の条件分岐は3種類になった。 @@ -429,6 +453,7 @@ template int do_something(Args... args) { - [P0292R1: constexpr if: A slightly different syntax](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0292r1.html) - [P0292R2: constexpr if: A slightly different syntax](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0292r2.html) - [N4603 Editor's Report -- Committee Draft, Standard for Programming Language C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/n4603.html) +- [P2593R1: Allowing static_assert(false)](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2593r1.html) ### 2段階名前探索における注意点について @@ -439,7 +464,9 @@ template int do_something(Args... args) { ### その他 +- [C++11 コンパイル時アサート](/lang/cpp11/static_assert.md) - [Static If I Had a Hammer - Andrei Alexandrescu](http://web.archive.org/web/20201202042515/https://channel9.msdn.com/Events/GoingNative/GoingNative-2012/Static-If-I-Had-a-Hammer) - [C++1z if constexpr文 - Faith and Brave - C++で遊ぼう](https://faithandbrave.hateblo.jp/entry/2016/12/22/171238) - [[cfe-dev] Clang getting involved](https://lists.llvm.org/pipermail/cfe-dev/2014-March/035801.html) - [`__if_exists` Statement | Microsoft Docs](https://docs.microsoft.com/ja-jp/cpp/cpp/if-exists-statement) +- [Issue 2518: Conformance requirements and #error/#warning - WG21 CWG Issues](https://wg21.cmeerw.net/cwg/issue2518) From 5ae498212b279218f89ee9a21bd0e901ce9a716c Mon Sep 17 00:00:00 2001 From: yumetodo Date: Mon, 26 Feb 2024 00:04:11 +0900 Subject: [PATCH 0761/3948] =?UTF-8?q?chore:=20s/=E7=A0=B4=E6=A3=84?= =?UTF-8?q?=E6=96=87/=E5=BB=83=E6=A3=84=E6=96=87/=20(#1257)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ref: - https://github.com/cpprefjp/site/commit/79fc60a46544883f2f132639a33ff68adb99e3d4#r139029850 --- lang/cpp17/if_constexpr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp17/if_constexpr.md b/lang/cpp17/if_constexpr.md index a44aff7fbc..9b7f4953e8 100644 --- a/lang/cpp17/if_constexpr.md +++ b/lang/cpp17/if_constexpr.md @@ -166,7 +166,7 @@ int main() ### (C++23以降 or CWG 2518が適用された環境) `static_assert`文に関する例外 -上に述べたように、`constexpr if`文の中の文は破棄文においても、非依存名の検証を行う。このため特に`static_assert`文を使う時に直感的ではない挙動を示していた。 +上に述べたように、`constexpr if`文の中の文は廃棄文においても、非依存名の検証を行う。このため特に`static_assert`文を使う時に直感的ではない挙動を示していた。 C++23以降、もしくはCWG 2518が適用された環境においては、template文(もしくは適切な特殊化や`constexpr if`文の中の文)が実際にインスタンス化されるまで、`static_assert`文の宣言は遅延される。 From badecd6938de5ed0c497e7ce6e9c50768e4d4040 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Mon, 26 Feb 2024 02:06:21 +0900 Subject: [PATCH 0762/3948] =?UTF-8?q?transform=5Fview:=20=E4=BE=8B?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/transform_view.md | 34 ++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/reference/ranges/transform_view.md b/reference/ranges/transform_view.md index 928b74277d..fd2d1accba 100644 --- a/reference/ranges/transform_view.md +++ b/reference/ranges/transform_view.md @@ -104,6 +104,40 @@ int main() { 149 ``` +## 例 特定のメンバを選択する + +```cpp example +#include +#include +#include + +struct Record { + int id = 0; + std::string name; +}; + +int main() { + using namespace std; + Record records[] = { + {1, "Alice"}, + {2, "Bob"}, + {3, "Charlie"} + }; + + for (int id : records | views::transform(&Record::id)) { + cout << id << '\n'; + } +} +``` +* views::transform[color ff0000] + +### 出力 +``` +1 +2 +3 +``` + ## バージョン ### 言語 - C++20 From 95a829945546cc7d9e7871d69f54fc4e6f2d9add Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Mon, 26 Feb 2024 02:15:59 +0900 Subject: [PATCH 0763/3948] =?UTF-8?q?=E4=B8=80=E9=83=A8=E3=83=AA=E3=83=B3?= =?UTF-8?q?=E3=82=AF=E3=82=92N4950=E3=81=B8=E3=81=AE=E3=83=AA=E3=83=B3?= =?UTF-8?q?=E3=82=AF=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_ends_with.md | 2 +- reference/algorithm/ranges_starts_with.md | 2 +- reference/ranges.md | 1 + reference/ranges/as_rvalue_view.md | 2 +- reference/ranges/join_with_view.md | 2 +- reference/ranges/repeat_view.md | 2 +- reference/ranges/repeat_view/iterator.md | 2 +- reference/ranges/to.md | 2 +- 8 files changed, 8 insertions(+), 7 deletions(-) diff --git a/reference/algorithm/ranges_ends_with.md b/reference/algorithm/ranges_ends_with.md index e5cd294eaa..87d51752d7 100644 --- a/reference/algorithm/ranges_ends_with.md +++ b/reference/algorithm/ranges_ends_with.md @@ -156,4 +156,4 @@ inline constexpr ends_with_impl ends_with; ## 参照 -- [N4892 25 Algorithms library](https://timsong-cpp.github.io/cppwp/algorithms) +- [N4950 27 Algorithms library](https://timsong-cpp.github.io/cppwp/n4950/algorithms) diff --git a/reference/algorithm/ranges_starts_with.md b/reference/algorithm/ranges_starts_with.md index 5622695015..42d0028219 100644 --- a/reference/algorithm/ranges_starts_with.md +++ b/reference/algorithm/ranges_starts_with.md @@ -127,4 +127,4 @@ inline constexpr starts_with_impl starts_with; ## 参照 -- [N4892 25 Algorithms library](https://timsong-cpp.github.io/cppwp/algorithms) +- [N4950 27 Algorithms library](https://timsong-cpp.github.io/cppwp/n4950/algorithms) diff --git a/reference/ranges.md b/reference/ranges.md index 5f09f144ff..0df15fe7ae 100644 --- a/reference/ranges.md +++ b/reference/ranges.md @@ -430,5 +430,6 @@ range | adaptor(args...) ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) +- [N4950 26 Ranges library](https://timsong-cpp.github.io/cppwp/n4950/ranges) - [C++20 ranges](https://techbookfest.org/product/5134506308665344) - [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) diff --git a/reference/ranges/as_rvalue_view.md b/reference/ranges/as_rvalue_view.md index b849c1b65b..68f163a31a 100644 --- a/reference/ranges/as_rvalue_view.md +++ b/reference/ranges/as_rvalue_view.md @@ -180,4 +180,4 @@ constexpr explicit as_rvalue_view(V base); - [Visual C++](/implementation.md#visual_cpp): ? ## 参照 -- [N4950 24 Ranges library](https://timsong-cpp.github.io/cppwp/ranges) +- [N4950 26 Ranges library](https://timsong-cpp.github.io/cppwp/n4950/ranges) diff --git a/reference/ranges/join_with_view.md b/reference/ranges/join_with_view.md index bb7de30762..7e0fcfb80e 100644 --- a/reference/ranges/join_with_view.md +++ b/reference/ranges/join_with_view.md @@ -161,4 +161,4 @@ hello-C++23-world - [`join_view`](join_view.md) ## 参照 -- [N4950 24 Ranges library](https://timsong-cpp.github.io/cppwp/ranges) +- [N4950 26 Ranges library](https://timsong-cpp.github.io/cppwp/n4950/ranges) diff --git a/reference/ranges/repeat_view.md b/reference/ranges/repeat_view.md index 0f2af5d767..07c75def57 100644 --- a/reference/ranges/repeat_view.md +++ b/reference/ranges/repeat_view.md @@ -105,4 +105,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): ? ## 参照 -- [N4917 26 Ranges library](https://timsong-cpp.github.io/cppwp/ranges) +- [N4950 26 Ranges library](https://timsong-cpp.github.io/cppwp/n4950/ranges) diff --git a/reference/ranges/repeat_view/iterator.md b/reference/ranges/repeat_view/iterator.md index 621a15c900..950dadf8f5 100644 --- a/reference/ranges/repeat_view/iterator.md +++ b/reference/ranges/repeat_view/iterator.md @@ -130,4 +130,4 @@ namespace std::ranges { - [Visual C++](/implementation.md#visual_cpp): ? ## 参照 -- [N4917 26 Ranges library](https://timsong-cpp.github.io/cppwp/ranges) +- [N4950 26 Ranges library](https://timsong-cpp.github.io/cppwp/n4950/ranges) diff --git a/reference/ranges/to.md b/reference/ranges/to.md index 5edbbf82d4..11cc00f230 100644 --- a/reference/ranges/to.md +++ b/reference/ranges/to.md @@ -214,4 +214,4 @@ int main() { ## 参照 -- [26.5.7.2 ranges::to](https://timsong-cpp.github.io/cppwp/range.utility.conv.to) +- [26.5.7.2 ranges::to](https://timsong-cpp.github.io/cppwp/n4950/range.utility.conv.to) From 49f914073a7b69b19b48acb6c0fb4c3d612a4b09 Mon Sep 17 00:00:00 2001 From: yumetodo Date: Tue, 27 Feb 2024 00:22:04 +0900 Subject: [PATCH 0764/3948] =?UTF-8?q?fix:=20=E5=8D=98=E3=81=ABCWG=202518?= =?UTF-8?q?=E3=81=8C=E9=81=A9=E7=94=A8=E3=81=95=E3=82=8C=E3=81=9F=E7=92=B0?= =?UTF-8?q?=E5=A2=83=E3=81=A8=E3=81=84=E3=81=86=20(#1257)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pointed by @yohhoy --- lang/cpp11/static_assert.md | 2 +- lang/cpp17/if_constexpr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/cpp11/static_assert.md b/lang/cpp11/static_assert.md index 5d4a674b96..c1369a8b88 100644 --- a/lang/cpp11/static_assert.md +++ b/lang/cpp11/static_assert.md @@ -28,7 +28,7 @@ static_assert(定数式, 文字列リテラル); - この宣言は、名前空間スコープ、ブロックスコープ、メンバ宣言といった場所で記述できる - 定数式が真であると評価された場合は何も効果がない。定数式が偽であると評価された場合は、指定された文字列リテラルを含む診断メッセージがコンパイラによって問題報告される。ただし、基本ソース文字集合に含まれない文字集合は、診断メッセージに表示することはコンパイラに要求されない - `static_assert`宣言では、新たな型やオブジェクトは宣言しない。また、実行時にサイズや時間コストは発生しない -- (C++23以降 or CWG 2518が適用された環境): template文(もしくは適切な特殊化や[C++17 constexpr if 文](/lang/cpp17/if_constexpr.md)の中の文)が実際にインスタンス化されるまで、`static_assert`文の宣言は遅延される。 +- (CWG 2518が適用された環境): template文(もしくは適切な特殊化や[C++17 constexpr if 文](/lang/cpp17/if_constexpr.md)の中の文)が実際にインスタンス化されるまで、`static_assert`文の宣言は遅延される。 - [C++17 constexpr if 文](/lang/cpp17/if_constexpr.md)の解説を参照 ## 例 diff --git a/lang/cpp17/if_constexpr.md b/lang/cpp17/if_constexpr.md index 9b7f4953e8..2b218c451e 100644 --- a/lang/cpp17/if_constexpr.md +++ b/lang/cpp17/if_constexpr.md @@ -164,7 +164,7 @@ int main() } ``` -### (C++23以降 or CWG 2518が適用された環境) `static_assert`文に関する例外 +### (CWG 2518が適用された環境) `static_assert`文に関する例外 上に述べたように、`constexpr if`文の中の文は廃棄文においても、非依存名の検証を行う。このため特に`static_assert`文を使う時に直感的ではない挙動を示していた。 From d3354b9a83e493fe21dd014d5eb1749018fabac4 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 27 Feb 2024 20:11:21 +0900 Subject: [PATCH 0765/3948] =?UTF-8?q?linalg:=20=E3=83=98=E3=83=83=E3=83=80?= =?UTF-8?q?=E6=A6=82=E8=A6=81=E3=81=A8=E9=96=A2=E6=95=B0/=E3=82=AF?= =?UTF-8?q?=E3=83=A9=E3=82=B9=E4=B8=80=E8=A6=A7(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 1 + lang/cpp26.md | 2 +- reference.md | 2 +- reference/linalg.md | 128 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 131 insertions(+), 2 deletions(-) create mode 100644 reference/linalg.md diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 040138f0a7..31799d0595 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -128,6 +128,7 @@ * [link /reference/latch.md] * [link /reference/limits.md] * std::numeric_limits[link /reference/limits/numeric_limits.md] +* [link /reference/linalg.md] * [link /reference/list.md] * std::list[link /reference/list/list.md] * [link /reference/locale.md] diff --git a/lang/cpp26.md b/lang/cpp26.md index adb9d0f485..efdfd5be85 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -59,7 +59,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - 並行処理におけるデータの参照・更新を行うRCU (Read Copy Update) のライブラリとして、[``](/reference/rcu.md.nolink)を追加 - 並行処理において参照中のデータが更新されないよう保護するハザードポインタのライブラリとして、[``](/reference/hazard_pointer.md.nolink)を追加 - デバッグサポートのライブラリとして[``](/reference/debugging.md.nolink)を追加 -- 線形代数ライブラリとして[``](/reference/linalg.md.nolink)を追加 +- 線形代数ライブラリとして[``](/reference/linalg.md)を追加 ### コンテナ diff --git a/reference.md b/reference.md index cefcdc4207..3cf466852d 100644 --- a/reference.md +++ b/reference.md @@ -149,7 +149,7 @@ | [``](/reference/valarray.md) | 数値の配列 | | | [``](/reference/numeric.md) | 一般的な数値操作 | | | [``](/reference/numbers.md) | 数値 | C++20 | -| [``](/reference/linalg.md.nolink) | 線形代数 | C++26 | +| [``](/reference/linalg.md) | 線形代数 | C++26 | ## デバッグライブラリ diff --git a/reference/linalg.md b/reference/linalg.md new file mode 100644 index 0000000000..f485159cad --- /dev/null +++ b/reference/linalg.md @@ -0,0 +1,128 @@ +# linalg +* linalg[meta header] +* cpp26[meta cpp] + +``ヘッダでは、線形代数(linear algebra)に関する基礎的な演算アルゴリズムを提供する。 +本ヘッダが提供するエンティティは、すべて名前空間`std::linalg`に属する。 + +1次元データであるベクトル(vector)や2次元データである行列(matrix)に対して、線形代数分野のデファクトスタンダードとなされる BLAS(Basic Linear Algebra Subprograms) 互換のアルゴリズム、および一部は LAPACK(Linear Algebra PACKage) 互換のアルゴリズム群が提供される。 +BLAS互換アルゴリズムは、演算対象データの次元数に応じて3段階に区分される。 + +- Level 1 BLAS : ベクトルーベクトルの演算 +- Level 2 BLAS : 行列ーベクトルの演算 +- Level 3 BLAS : 行列ー行列の演算 + +例えば、2個の一般行列の積を求める`std::linalg::matrix_product`はLevel 3 BLASルーチン`xGEMM`に対応する。 +(実際のBLASルーチン名は、浮動小数点型の単精度`S`/倍精度`D`とそれぞれの複素数版`C`,`Z`として、プレフィックス`x`部は4種類の文字のいずれかになる。) + +また、多次元配列ビュー[`std::mdpan`](mdspan/mdspan.md)と組み合わせて利用する拡張機能が提供される。 + + +## `std::mdspan`向け機能拡張 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `layout_blas_packed` | BLAS互換の圧縮行列表現に対応する[レイアウトマッピングポリシー](mdspan/LayoutMappingPolicy.md) (class template) | C++26 | +| `scaled` | 読み取り専用の要素値をスカラ倍した`std::mdspan`を作る (function template) | C++26 | +| `scaled_accessor` | `scaled`関数用の[アクセサポリシー](mdspan/AccessorPolicy.md) (class template) | C++26 | +| `conjugated_accessor` | `conjugated`関数用の[アクセサポリシー](mdspan/AccessorPolicy.md) (class template) | C++26 | +| `conjugated` | 読み取り専用の複素共役ビュー`std::mdspan`を作る (function template) | C++26 | +| `layout_transpose` | `transposed`関数用の[レイアウトマッピングポリシー](mdspan/LayoutMappingPolicy.md) (class template) | C++26 | +| `transposed` | 2次元`std::mdspan`の転置ビューを作る (function template) | C++26 | +| `conjugate_transposed` | 読み取り専用の複素共役転置ビュー`std::mdspan`を作る (function template) | C++26 | + + +## BLAS 1アルゴリズム + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `setup_givens_rotation_result` | `setup_givens_rotation`の結果型 (class template) | C++26 | +| `setup_givens_rotation` | xLARTG: ギブンス回転をセットアップする (function template) | C++26 | +| `apply_givens_rotation` | xROT: ベクトルにギブンス回転を適用する (function template) | C++26 | +| `swap_elements` | xSWAP: 2つのベクトル/行列の要素を交換する (function template) | C++26 | +| `scale` | xSCAL: ベクトル/行列の要素にスカラ値を乗算する (function template) | C++26 | +| `copy` | xCOPY: ベクトル/行列の要素をコピー代入する (function template) | C++26 | +| `add` | xAXPY: 2つのベクトル/行列の要素を加算する (function template) | C++26 | +| `dot` | xDOT, xDOTU: 2つのベクトルのドット積を求める (function template) | C++26 | +| `dotc` | xDOTC: 2つのベクトルの複素共役ドット積を求める (function template) | C++26 | +| `sum_of_squares_result` | `vector_sum_of_squares`の結果型 (class template) | C++26 | +| `vector_sum_of_squares` | xLASSQ: ベクトル要素の平方和を求める (class template) | C++26 | +| `vector_two_norm` | xNRM2: ベクトルのユークリッドノルム(Euclidean norm)を求める (class template) | C++26 | +| `vector_abs_sum` | xASUM: ベクトル要素の絶対値和を求める (class template) | C++26 | +| `vector_idx_abs_max` | xIAMAX: ベクトル要素のうち最大絶対値インデクスを返す (class template) | C++26 | +| `matrix_frob_norm` | 行列のフロベニウスノルム(Frobenius norm)を求める (class template) | C++26 | +| `matrix_one_norm` | 行列の1ノルム(One norm)を求める (class template) | C++26 | +| `matrix_inf_norm` | 行列の無限大ノルム(Infinity norm)を求める (class template) | C++26 | + + +## BLAS 2アルゴリズム + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `matrix_vector_product` | xGEMV: 一般行列とベクトルの積を求める (class template) | C++26 | +| `symmetric_matrix_vector_product` | xSYMV: 対称行列とベクトルの積を求める (class template) | C++26 | +| `hermitian_matrix_vector_product` | xHEMV: ハミルトニアン行列とベクトルの積を求める (class template) | C++26 | +| `triangular_matrix_vector_product` | xTRMV: 三角行列とベクトルの積を求める (class template) | C++26 | +| `triangular_matrix_vector_solve` | xTRSV: 三角行列を係数とする行列方程式を解く (class template) | C++26 | +| `matrix_rank_1_update` | xGER, xGERU: 行列のRank-1更新 (class template) | C++26 | +| `matrix_rank_1_update_c` | xGERC: 複素行列のRank-1更新 (class template) | C++26 | +| `symmetric_matrix_rank_1_update` | xSYR: 対称行列のRank-1更新 (class template) | C++26 | +| `hermitian_matrix_rank_1_update` | xHER: ハミルトニアン行列のRank-1更新 (class template) | C++26 | +| `symmetric_matrix_rank_2_update` | xSYR2: 対称行列のRank-2更新 (class template) | C++26 | +| `hermitian_matrix_rank_2_update` | xHER2: ハミルトニアン行列のRank-2更新 (class template) | C++26 | + + +## BLAS 3アルゴリズム + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `matrix_product` | xGEMM: 2つの一般行列の積を求める (class template) | C++26 | +| `symmetric_matrix_product` | xSYMM: 対称行列と行列の積を求める (class template) | C++26 | +| `hermitian_matrix_product` | xHEMM: ハミルトニアン行列と行列の積を求める (class template) | C++26 | +| `triangular_matrix_product` | xTRMM: 三角行列と行列の積を求める (class template) | C++26 | +| `triangular_matrix_left_product` | xTRMM: In-placeに三角行列と行列の積を求める (class template) | C++26 | +| `triangular_matrix_right_product` | xTRMM: In-placeに三角行列と行列の積を求める (class template) | C++26 | +| `symmetric_matrix_rank_k_update` | xSYRK: 対称行列のRank-k更新 (class template) | C++26 | +| `hermitian_matrix_rank_k_update` | xHERK: ハミルトニアン行列のRank-k更新 (class template) | C++26 | +| `symmetric_matrix_rank_2k_update` | xSYR2K: 対称行列のRank-2k更新 (class template) | C++26 | +| `hermitian_matrix_rank_2k_update` | xHER2K: ハミルトニアン行列のRank-2k更新 (class template) | C++26 | +| `triangular_matrix_matrix_left_solve` | xTRSM: 三角行列の連立一次方程式を解く (class template) | C++26 | +| `triangular_matrix_matrix_right_solve` | xTRSM: 三角行列の連立一次方程式を解く (class template) | C++26 | + + +## タグ型 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `column_major_t` | 列優先メモリレイアウトを表現するためのタグ型 (class) | C++26 | +| `column_major` | 列優先メモリレイアウトを表現するためのタグ値 (variable) | C++26 | +| `row_major_t` | 行優先メモリレイアウトを表現するためのタグ型 (class) | C++26 | +| `row_major` | 行優先メモリレイアウトを表現するためのタグ値 (variable) | C++26 | +| `upper_triangle_t` | 上三角行列を表現するためのタグ型 (class) | C++26 | +| `upper_triangle` | 上三角行列を表現するためのタグ値 (variable) | C++26 | +| `lower_triangle_t` | 下三角行列を表現するためのタグ型 (class) | C++26 | +| `lower_triangle` | 下三角行列を表現するためのタグ値 (variable) | C++26 | +| `implicit_unit_diagonal_t` | implicit unit diagonalを表現するためのタグ型 (class) | C++26 | +| `implicit_unit_diagonal` | implicit unit diagonalを表現するためのタグ値 (variable) | C++26 | +| `explicit_diagonal_t` | explicit diagonalを表現するためのタグ型 (class) | C++26 | +| `explicit_diagonal` | explicit diagonalを表現するためのタグ値 (variable) | C++26 | + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [``](mdspan.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) +- [BLAS (Basic Linear Algebra Subprograms)](https://www.netlib.org/blas/) From ea5cfe4a6fcb2ac7ce929a9023266f477b4d43a0 Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 28 Feb 2024 00:48:24 +0900 Subject: [PATCH 0766/3948] =?UTF-8?q?linalg:=20"linear=20algebra=20value?= =?UTF-8?q?=20types"=E8=AA=AC=E6=98=8E(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/linalg.md | 81 +++++++++++++++++++++++++-------------------- reference/mdspan.md | 1 + 2 files changed, 46 insertions(+), 36 deletions(-) diff --git a/reference/linalg.md b/reference/linalg.md index f485159cad..55ce7ea949 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -5,7 +5,7 @@ ``ヘッダでは、線形代数(linear algebra)に関する基礎的な演算アルゴリズムを提供する。 本ヘッダが提供するエンティティは、すべて名前空間`std::linalg`に属する。 -1次元データであるベクトル(vector)や2次元データである行列(matrix)に対して、線形代数分野のデファクトスタンダードとなされる BLAS(Basic Linear Algebra Subprograms) 互換のアルゴリズム、および一部は LAPACK(Linear Algebra PACKage) 互換のアルゴリズム群が提供される。 +1次元データであるベクトル(vector)や2次元データである行列(matrix)に対して、線形代数分野のデファクトスタンダードとされる BLAS(Basic Linear Algebra Subprograms) 互換のアルゴリズム群、いくつかの LAPACK(Linear Algebra PACKage) 互換のアルゴリズムが提供される。 BLAS互換アルゴリズムは、演算対象データの次元数に応じて3段階に区分される。 - Level 1 BLAS : ベクトルーベクトルの演算 @@ -13,22 +13,31 @@ BLAS互換アルゴリズムは、演算対象データの次元数に応じて3 - Level 3 BLAS : 行列ー行列の演算 例えば、2個の一般行列の積を求める`std::linalg::matrix_product`はLevel 3 BLASルーチン`xGEMM`に対応する。 -(実際のBLASルーチン名は、浮動小数点型の単精度`S`/倍精度`D`とそれぞれの複素数版`C`,`Z`として、プレフィックス`x`部は4種類の文字のいずれかになる。) +(実際のBLASルーチン名は、浮動小数点数型の単精度`S`/倍精度`D`とそれぞれの複素数版`C`,`Z`として、プレフィックス`x`部は4種類の文字のいずれかになる。) また、多次元配列ビュー[`std::mdpan`](mdspan/mdspan.md)と組み合わせて利用する拡張機能が提供される。 +## 共通要件 +``ヘッダが提供する演算アルゴリズムは、スカラ値およびベクトル/行列の要素型として線形代数値型(linear algebra value types)を取り扱う。 + +線形代数値型はBLASが取り扱う`float`, `double`, `std::complex`, `std::complex`をはじめ、[`semiregular`](/reference/concepts/semiregular.md)のモデルであれば良い。 +また、線形代数値型の値初期化は加法元(算術型であれば値`0`)であること。 + +プログラム定義型を利用する場合、演算アルゴリズムはカスタマイゼーションポイントとして`abs`, `real`, `imag`, `conj`を非修飾名で呼び出す。 + + ## `std::mdspan`向け機能拡張 | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| `layout_blas_packed` | BLAS互換の圧縮行列表現に対応する[レイアウトマッピングポリシー](mdspan/LayoutMappingPolicy.md) (class template) | C++26 | -| `scaled` | 読み取り専用の要素値をスカラ倍した`std::mdspan`を作る (function template) | C++26 | +| `layout_blas_packed` | 行列要素のBLAS互換パックレイアウトに対応する[レイアウトマッピングポリシー](mdspan/LayoutMappingPolicy.md) (class template) | C++26 | +| `scaled` | 要素値をスカラ倍した読み取り専用`std::mdspan`を作る (function template) | C++26 | | `scaled_accessor` | `scaled`関数用の[アクセサポリシー](mdspan/AccessorPolicy.md) (class template) | C++26 | | `conjugated_accessor` | `conjugated`関数用の[アクセサポリシー](mdspan/AccessorPolicy.md) (class template) | C++26 | | `conjugated` | 読み取り専用の複素共役ビュー`std::mdspan`を作る (function template) | C++26 | | `layout_transpose` | `transposed`関数用の[レイアウトマッピングポリシー](mdspan/LayoutMappingPolicy.md) (class template) | C++26 | -| `transposed` | 2次元`std::mdspan`の転置ビューを作る (function template) | C++26 | +| `transposed` | 2次元`std::mdspan`の行列転置ビューを作る (function template) | C++26 | | `conjugate_transposed` | 読み取り専用の複素共役転置ビュー`std::mdspan`を作る (function template) | C++26 | @@ -41,53 +50,53 @@ BLAS互換アルゴリズムは、演算対象データの次元数に応じて3 | `apply_givens_rotation` | xROT: ベクトルにギブンス回転を適用する (function template) | C++26 | | `swap_elements` | xSWAP: 2つのベクトル/行列の要素を交換する (function template) | C++26 | | `scale` | xSCAL: ベクトル/行列の要素にスカラ値を乗算する (function template) | C++26 | -| `copy` | xCOPY: ベクトル/行列の要素をコピー代入する (function template) | C++26 | +| `copy` | xCOPY: ベクトル/行列の要素をコピーする (function template) | C++26 | | `add` | xAXPY: 2つのベクトル/行列の要素を加算する (function template) | C++26 | | `dot` | xDOT, xDOTU: 2つのベクトルのドット積を求める (function template) | C++26 | | `dotc` | xDOTC: 2つのベクトルの複素共役ドット積を求める (function template) | C++26 | | `sum_of_squares_result` | `vector_sum_of_squares`の結果型 (class template) | C++26 | -| `vector_sum_of_squares` | xLASSQ: ベクトル要素の平方和を求める (class template) | C++26 | -| `vector_two_norm` | xNRM2: ベクトルのユークリッドノルム(Euclidean norm)を求める (class template) | C++26 | -| `vector_abs_sum` | xASUM: ベクトル要素の絶対値和を求める (class template) | C++26 | -| `vector_idx_abs_max` | xIAMAX: ベクトル要素のうち最大絶対値インデクスを返す (class template) | C++26 | -| `matrix_frob_norm` | 行列のフロベニウスノルム(Frobenius norm)を求める (class template) | C++26 | -| `matrix_one_norm` | 行列の1ノルム(One norm)を求める (class template) | C++26 | -| `matrix_inf_norm` | 行列の無限大ノルム(Infinity norm)を求める (class template) | C++26 | +| `vector_sum_of_squares` | xLASSQ: ベクトル要素の平方和を求める (function template) | C++26 | +| `vector_two_norm` | xNRM2: ベクトルのユークリッドノルム(Euclidean norm)を求める (function template) | C++26 | +| `vector_abs_sum` | xASUM: ベクトル要素の絶対値和を求める (function template) | C++26 | +| `vector_idx_abs_max` | xIAMAX: ベクトル要素のうち最大絶対値インデクスを返す (function template) | C++26 | +| `matrix_frob_norm` | 行列のフロベニウスノルム(Frobenius norm)を求める (function template) | C++26 | +| `matrix_one_norm` | 行列の1ノルム(One norm)を求める (function template) | C++26 | +| `matrix_inf_norm` | 行列の無限大ノルム(Infinity norm)を求める (function template) | C++26 | ## BLAS 2アルゴリズム | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| `matrix_vector_product` | xGEMV: 一般行列とベクトルの積を求める (class template) | C++26 | -| `symmetric_matrix_vector_product` | xSYMV: 対称行列とベクトルの積を求める (class template) | C++26 | -| `hermitian_matrix_vector_product` | xHEMV: ハミルトニアン行列とベクトルの積を求める (class template) | C++26 | -| `triangular_matrix_vector_product` | xTRMV: 三角行列とベクトルの積を求める (class template) | C++26 | -| `triangular_matrix_vector_solve` | xTRSV: 三角行列を係数とする行列方程式を解く (class template) | C++26 | -| `matrix_rank_1_update` | xGER, xGERU: 行列のRank-1更新 (class template) | C++26 | -| `matrix_rank_1_update_c` | xGERC: 複素行列のRank-1更新 (class template) | C++26 | -| `symmetric_matrix_rank_1_update` | xSYR: 対称行列のRank-1更新 (class template) | C++26 | -| `hermitian_matrix_rank_1_update` | xHER: ハミルトニアン行列のRank-1更新 (class template) | C++26 | -| `symmetric_matrix_rank_2_update` | xSYR2: 対称行列のRank-2更新 (class template) | C++26 | -| `hermitian_matrix_rank_2_update` | xHER2: ハミルトニアン行列のRank-2更新 (class template) | C++26 | +| `matrix_vector_product` | xGEMV: 一般行列とベクトルの積を求める (function template) | C++26 | +| `symmetric_matrix_vector_product` | xSYMV: 対称行列とベクトルの積を求める (function template) | C++26 | +| `hermitian_matrix_vector_product` | xHEMV: ハミルトニアン行列とベクトルの積を求める (function template) | C++26 | +| `triangular_matrix_vector_product` | xTRMV: 三角行列とベクトルの積を求める (function template) | C++26 | +| `triangular_matrix_vector_solve` | xTRSV: 三角行列を係数とする行列方程式を解く (function template) | C++26 | +| `matrix_rank_1_update` | xGER, xGERU: 行列のRank-1更新 (function template) | C++26 | +| `matrix_rank_1_update_c` | xGERC: 複素行列のRank-1更新 (function template) | C++26 | +| `symmetric_matrix_rank_1_update` | xSYR: 対称行列のRank-1更新 (function template) | C++26 | +| `hermitian_matrix_rank_1_update` | xHER: ハミルトニアン行列のRank-1更新 (function template) | C++26 | +| `symmetric_matrix_rank_2_update` | xSYR2: 対称行列のRank-2更新 (function template) | C++26 | +| `hermitian_matrix_rank_2_update` | xHER2: ハミルトニアン行列のRank-2更新 (function template) | C++26 | ## BLAS 3アルゴリズム | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| `matrix_product` | xGEMM: 2つの一般行列の積を求める (class template) | C++26 | -| `symmetric_matrix_product` | xSYMM: 対称行列と行列の積を求める (class template) | C++26 | -| `hermitian_matrix_product` | xHEMM: ハミルトニアン行列と行列の積を求める (class template) | C++26 | -| `triangular_matrix_product` | xTRMM: 三角行列と行列の積を求める (class template) | C++26 | -| `triangular_matrix_left_product` | xTRMM: In-placeに三角行列と行列の積を求める (class template) | C++26 | -| `triangular_matrix_right_product` | xTRMM: In-placeに三角行列と行列の積を求める (class template) | C++26 | -| `symmetric_matrix_rank_k_update` | xSYRK: 対称行列のRank-k更新 (class template) | C++26 | -| `hermitian_matrix_rank_k_update` | xHERK: ハミルトニアン行列のRank-k更新 (class template) | C++26 | -| `symmetric_matrix_rank_2k_update` | xSYR2K: 対称行列のRank-2k更新 (class template) | C++26 | -| `hermitian_matrix_rank_2k_update` | xHER2K: ハミルトニアン行列のRank-2k更新 (class template) | C++26 | -| `triangular_matrix_matrix_left_solve` | xTRSM: 三角行列の連立一次方程式を解く (class template) | C++26 | -| `triangular_matrix_matrix_right_solve` | xTRSM: 三角行列の連立一次方程式を解く (class template) | C++26 | +| `matrix_product` | xGEMM: 2つの一般行列の積を求める (function template) | C++26 | +| `symmetric_matrix_product` | xSYMM: 対称行列と行列の積を求める (function template) | C++26 | +| `hermitian_matrix_product` | xHEMM: ハミルトニアン行列と行列の積を求める (function template) | C++26 | +| `triangular_matrix_product` | xTRMM: 三角行列と行列の積を求める (function template) | C++26 | +| `triangular_matrix_left_product` | xTRMM: In-placeに三角行列と行列の積を求める (function template) | C++26 | +| `triangular_matrix_right_product` | xTRMM: In-placeに三角行列と行列の積を求める (function template) | C++26 | +| `symmetric_matrix_rank_k_update` | xSYRK: 対称行列のRank-k更新 (function template) | C++26 | +| `hermitian_matrix_rank_k_update` | xHERK: ハミルトニアン行列のRank-k更新 (function template) | C++26 | +| `symmetric_matrix_rank_2k_update` | xSYR2K: 対称行列のRank-2k更新 (function template) | C++26 | +| `hermitian_matrix_rank_2k_update` | xHER2K: ハミルトニアン行列のRank-2k更新 (function template) | C++26 | +| `triangular_matrix_matrix_left_solve` | xTRSM: 三角行列の連立一次方程式を解く (function template) | C++26 | +| `triangular_matrix_matrix_right_solve` | xTRSM: 三角行列の連立一次方程式を解く (function template) | C++26 | ## タグ型 diff --git a/reference/mdspan.md b/reference/mdspan.md index ce88e36f22..cf120b1b95 100644 --- a/reference/mdspan.md +++ b/reference/mdspan.md @@ -55,6 +55,7 @@ ## 関連項目 - C++20 [``](span.md) +- C++26 [``](linalg.md) ## 参照 From 19cfa925b420e862bb10c6d0608a5fe58a62a2ba Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Wed, 28 Feb 2024 03:04:24 +0900 Subject: [PATCH 0767/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/subrange/advance.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/ranges/subrange/advance.md b/reference/ranges/subrange/advance.md index 352a9070e7..d59f572529 100644 --- a/reference/ranges/subrange/advance.md +++ b/reference/ranges/subrange/advance.md @@ -35,6 +35,7 @@ return *this; ranges::advance(begin_, n, end_); return *this; ``` +* ranges::advance[link /reference/iterator/ranges_advance.md] ## 備考 - `subrange`の末端を超えて進めようとした場合、`subrange`の長さは0になる。 From 9f57615b8045ad1f9c7b6e653805f911cfeae045 Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 28 Feb 2024 14:29:24 +0900 Subject: [PATCH 0768/3948] =?UTF-8?q?linalg:=20layout=5Fblas=5Fpacked?= =?UTF-8?q?=E6=A6=82=E8=A6=81(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/linalg.md | 4 +- reference/linalg/layout_blas_packed.md | 99 ++++++++++++ .../linalg/layout_blas_packed/mapping.md | 148 ++++++++++++++++++ reference/mdspan/LayoutMapping.md | 1 + reference/mdspan/LayoutMappingPolicy.md | 1 + 5 files changed, 252 insertions(+), 1 deletion(-) create mode 100644 reference/linalg/layout_blas_packed.md create mode 100644 reference/linalg/layout_blas_packed/mapping.md diff --git a/reference/linalg.md b/reference/linalg.md index 55ce7ea949..b571402841 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -31,7 +31,7 @@ BLAS互換アルゴリズムは、演算対象データの次元数に応じて3 | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| `layout_blas_packed` | 行列要素のBLAS互換パックレイアウトに対応する[レイアウトマッピングポリシー](mdspan/LayoutMappingPolicy.md) (class template) | C++26 | +| [`layout_blas_packed`](linalg/layout_blas_packed.md) | 行列要素のBLAS互換パックレイアウトに対応する[レイアウトマッピングポリシー](mdspan/LayoutMappingPolicy.md) (class template) | C++26 | | `scaled` | 要素値をスカラ倍した読み取り専用`std::mdspan`を作る (function template) | C++26 | | `scaled_accessor` | `scaled`関数用の[アクセサポリシー](mdspan/AccessorPolicy.md) (class template) | C++26 | | `conjugated_accessor` | `conjugated`関数用の[アクセサポリシー](mdspan/AccessorPolicy.md) (class template) | C++26 | @@ -134,4 +134,6 @@ BLAS互換アルゴリズムは、演算対象データの次元数に応じて3 ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) +- [P1674R2: Evolving a Standard C++ Linear Algebra Library from the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1674r2.html) +- [std::linalg: Linear Algebra Coming to Standard C++](https://github.com/CppCon/CppCon2023/blob/main/Presentations/stdlinalg_linear_algebra_coming_to_standard_cpp.pdf), CppCon 2023 - [BLAS (Basic Linear Algebra Subprograms)](https://www.netlib.org/blas/) diff --git a/reference/linalg/layout_blas_packed.md b/reference/linalg/layout_blas_packed.md new file mode 100644 index 0000000000..836714258a --- /dev/null +++ b/reference/linalg/layout_blas_packed.md @@ -0,0 +1,99 @@ +# layout_blas_packed +* linalg[meta header] +* class template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::linalg { + template + class layout_blas_packed; +} +``` + +## 概要 +`layout_blas_packed`は、多次元配列ビュー[`mdspan`](/reference/mdspan/mdspan.md)を用いた正方行列(square matrix)に対して、BLASにおけるパックレイアウトと互換性のある行列要素配置を表現する[レイアウトマッピングポリシー](/reference/mdspan/LayoutMappingPolicy.md)クラスである。 + +- `Triangle` : 指定する行列要素の種別を、上三角[`upper_triangle_t`](upper_triangle_t.md.nolink)または下三角[`lower_triangle_t`](lower_triangle_t.md.nolink)から指定する。 +- `StorageOrder` : 行列要素の格納順を、列優先[`column_major_t`](column_major_t.md.nolink)または行優先[`row_major_t`](row_major_t.md.nolink)から指定する。 + +`layout_blas_packed`を用いて、BLASの Symmetric Packed (SP), Hermitian Packed (HP), Triangular Packed (TP) 行列レイアウトを表現できる。 + + +## 適格要件 +- `Triangle`は[`upper_triangle_t`](upper_triangle_t.md.nolink)または[`lower_triangle_t`](lower_triangle_t.md.nolink)のいずれか +- `StorageOrder`は[`column_major_t`](column_major_t.md.nolink)または[`row_major_t`](row_major_t.md.nolink)のいずれか + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `triangle_type` | `Triangle` | C++26 | +| `storage_order_type` | `StorageOrder` | C++26 | +| [`mapping`](layout_blas_packed/mapping.md) | レイアウトマッピング | C++26 | + + +## 例 +```cpp example +#include +#include +#include +namespace linalg = std::linalg; + +int main() +{ + double arr[] = {1, 2, 3, 4, 5, 6}; + + // 行優先レイアウトの下三角要素から3x3対称行列を構築 + std::mdspan< + double, + std::extents, + linalg::layout_blas_packed + > mat{arr}; + // 1 . . + // 2 4 . + // 3 5 6 + + for (size_t i = 0; i < mat.extent(0); i++) { + for (size_t j = 0; j < mat.extent(1); j++) { + std::print(" {}", mat[i, j]); + } + std::println(""); + } +} +``` +* linalg::layout_blas_packed[color ff0000] +* linalg::lower_triangle[link lower_triangle_t.md.nolink] +* linalg::column_major[link column_major_t.md.nolink] +* mat.extent[link /reference/mdspan/mdspan/extent.md] +* std::print[link /reference/print/print.md] +* std::println[link /reference/print/println.md] + + +### 出力 +``` + 1 2 3 + 2 4 5 + 3 5 6 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`mdspan`](/reference/mdspan/mdspan.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) +- [P1674R2: Evolving a Standard C++ Linear Algebra Library from the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1674r2.html) diff --git a/reference/linalg/layout_blas_packed/mapping.md b/reference/linalg/layout_blas_packed/mapping.md new file mode 100644 index 0000000000..05260eb262 --- /dev/null +++ b/reference/linalg/layout_blas_packed/mapping.md @@ -0,0 +1,148 @@ +# mapping +* linalg[meta header] +* class template[meta id-type] +* std::linalg[meta namespace] +* layout_blas_packed[meta class] +* cpp26[meta cpp] + +```cpp +namespace std::linalg { + template + class layout_blas_packed { + template + struct mapping; + }; +} +``` +* layout_blas_packed[link ../layout_blas_packed.md] +* Extents[link /reference/mdspan/extents.md] + +## 概要 +`layout_blas_packed::mapping`は、BLASにおける正方行列(square matrix)パックレイアウトと互換性のある[レイアウトマッピング](/reference/mdspan/LayoutMapping.md)を表現するクラスである。 + +`layout_blas_packed::mapping`は[トリビアルコピー可能](/reference/type_traits/is_trivially_copyable.md)であり、[`regular`](/reference/concepts/regular.md)のモデルである。 + + +### 説明専用メンバ変数 +`layout_blas_packed::mapping`クラステンプレートは、下記の説明専用メンバ変数を保持する。 + +- `extents_` : `extents_type`型の[多次元配列サイズ情報](/reference/mdspan/extents.md) + + +## 適格要件 +- `Extents`は[`extents`](/reference/mdspan/extents.md)の特殊化であること +- [`Extents::rank()`](/reference/mdspan/extents/rank.md) `== 2` +- 下記いずれかを満たすこと + - `extents_type::static_extent(0) ==` [`dynamic_extent`](/reference/span/dynamic_extent.md)または + - `extents_type::static_extent(1) ==` [`dynamic_extent`](/reference/span/dynamic_extent.md)または + - `extents_type::static_extent(0) == extents_type::static_extent(1)` +- [`Extents::rank_dynamic()`](/reference/mdspan/extents/rank.md) `== 0`のとき、`Ns`を[`Extents::static_extent`](/reference/mdspan/extents/static_extent.md)`(0)`としたとき値`Ns * (Ns + 1)`を`index_type`型で表現できること。 + + +## メンバ関数 +### 構築・破棄 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`(constructor)`](mapping/op_constructor.md.nolink) | コンストラクタ | C++26 | +| `(destructor)` | デストラクタ | C++26 | +| `operator=` | コピー代入演算子 | C++26 | + +### 観測 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `extents` | 多次元配列のサイズ`extents_`を取得する | C++26 | +| [`required_span_size`](mapping/required_span_size.md.nolink) | 要素アクセス範囲を取得する | C++26 | +| [`operator()`](mapping/op_call.md.nolink) | 多次元配列インデクスから要素位置へ変換する | C++26 | +| `stride` | 行列サイズ1x1ならば`1` | C++26 | +| `is_unique` | 行列サイズ1x1ならば`true` | C++26 | +| `is_exhaustive` | `true`を返す | C++26 | +| `is_strided` | 行列サイズ1x1ならば`true` | C++26 | + + +## 静的メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `is_always_unique` | 行または列の静的要素数が1ならば`true` | C++26 | +| `is_always_exhaustive` | `true`を返す | C++26 | +| `is_always_strided` | `is_always_unique();` | C++26 | + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `extents_type` | [`Extents`](/reference/mdspan/extents.md) | C++26 | +| `index_type` | [`Extents::index_type`](/reference/mdspan/extents.md) | C++26 | +| `size_type` | [`Extents::size_type`](/reference/mdspan/extents.md) | C++26 | +| `rank_type` | [`Extents::rank_type`](/reference/mdspan/extents.md) | C++26 | +| `layout_type` | [`layout_blas_packed`](../layout_blas_packed.md) | C++26 | + + +## 非メンバ(*Hidden friends*)関数 +### 比較演算子 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`operator==`](mapping/op_equal.md.nolink) | 等値比較 | C++26 | +| [`operator!=`](mapping/op_equal.md.nolink) | 非等値比較 (`==`により使用可能) | C++26 | + + +## 例 +```cpp example +#include +#include +#include +namespace linalg = std::linalg; + +int main() +{ + double arr[] = {1, 2, 3, 4, 5, 6}; + + // 行優先レイアウトの下三角要素から3x3対称行列を構築 + using LayoutPacked = linalg::layout_blas_packed; + using Mapping = LayoutPacked::mapping>; + std::mdspan mat{arr, Mapping{}}; + // 1 . . + // 2 4 . + // 3 5 6 + + for (size_t i = 0; i < mat.extent(0); i++) { + for (size_t j = 0; j < mat.extent(1); j++) { + std::print(" {}", mat[i, j]); + } + std::println(""); + } +} +``` +* linalg::layout_blas_packed[color ff0000] +* ::mapping[color ff0000] + +### 出力 +``` + 1 2 3 + 2 4 5 + 3 5 6 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`mdspan`](/reference/mdspan/mdspan.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) +- [P1674R2: Evolving a Standard C++ Linear Algebra Library from the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1674r2.html) diff --git a/reference/mdspan/LayoutMapping.md b/reference/mdspan/LayoutMapping.md index 59560df80b..4fde61d7ed 100644 --- a/reference/mdspan/LayoutMapping.md +++ b/reference/mdspan/LayoutMapping.md @@ -93,6 +93,7 @@ LayoutMappingを満たす型`M`は - [`layout_left::mapping`](layout_left/mapping.md) - [`layout_right::mapping`](layout_right/mapping.md) - [`layout_stride::mapping`](layout_stride/mapping.md) +- [`layout_blas_packed::mapping`](/reference/linalg/layout_blas_packed/mapping.md) ## バージョン diff --git a/reference/mdspan/LayoutMappingPolicy.md b/reference/mdspan/LayoutMappingPolicy.md index 3ba9ecd173..08ec23b8bd 100644 --- a/reference/mdspan/LayoutMappingPolicy.md +++ b/reference/mdspan/LayoutMappingPolicy.md @@ -40,6 +40,7 @@ LayoutMappingPolicyを満たす型`MP`は - [`layout_left`](layout_left.md) - [`layout_right`](layout_right.md) - [`layout_stride`](layout_stride.md) +- [`linalg::layout_blas_packed`](/reference/linalg/layout_blas_packed.md) ## バージョン From ad3c2440addb23526972119533f937d6e537a5cb Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 28 Feb 2024 16:02:19 +0900 Subject: [PATCH 0769/3948] =?UTF-8?q?linalg:=20layout=5Ftranspose=E6=A6=82?= =?UTF-8?q?=E8=A6=81(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/linalg.md | 30 +++----- reference/linalg/layout_blas_packed.md | 73 +++++++++++++------ .../linalg/layout_blas_packed/mapping.md | 22 ++++-- reference/linalg/layout_transpose.md | 49 +++++++++++++ 4 files changed, 126 insertions(+), 48 deletions(-) create mode 100644 reference/linalg/layout_transpose.md diff --git a/reference/linalg.md b/reference/linalg.md index b571402841..4893195e7e 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -6,14 +6,14 @@ 本ヘッダが提供するエンティティは、すべて名前空間`std::linalg`に属する。 1次元データであるベクトル(vector)や2次元データである行列(matrix)に対して、線形代数分野のデファクトスタンダードとされる BLAS(Basic Linear Algebra Subprograms) 互換のアルゴリズム群、いくつかの LAPACK(Linear Algebra PACKage) 互換のアルゴリズムが提供される。 -BLAS互換アルゴリズムは、演算対象データの次元数に応じて3段階に区分される。 +BLAS互換アルゴリズムは、演算対象データの次元数や計算オーダーに応じて3段階に区分される。 - Level 1 BLAS : ベクトルーベクトルの演算 - Level 2 BLAS : 行列ーベクトルの演算 - Level 3 BLAS : 行列ー行列の演算 例えば、2個の一般行列の積を求める`std::linalg::matrix_product`はLevel 3 BLASルーチン`xGEMM`に対応する。 -(実際のBLASルーチン名は、浮動小数点数型の単精度`S`/倍精度`D`とそれぞれの複素数版`C`,`Z`として、プレフィックス`x`部は4種類の文字のいずれかになる。) +(実際のBLASルーチン名は、浮動小数点数型の単精度`S`/倍精度`D`とそれぞれの複素数版`C`,`Z`として、プレフィックス`x`部は文字4種類のいずれか。) また、多次元配列ビュー[`std::mdpan`](mdspan/mdspan.md)と組み合わせて利用する拡張機能が提供される。 @@ -21,7 +21,7 @@ BLAS互換アルゴリズムは、演算対象データの次元数に応じて3 ## 共通要件 ``ヘッダが提供する演算アルゴリズムは、スカラ値およびベクトル/行列の要素型として線形代数値型(linear algebra value types)を取り扱う。 -線形代数値型はBLASが取り扱う`float`, `double`, `std::complex`, `std::complex`をはじめ、[`semiregular`](/reference/concepts/semiregular.md)のモデルであれば良い。 +線形代数値型はBLASが取り扱う`float`, `double`, `std::complex`, `std::complex`をはじめ、[`semiregular`](concepts/semiregular.md)のモデルであれば良い。 また、線形代数値型の値初期化は加法元(算術型であれば値`0`)であること。 プログラム定義型を利用する場合、演算アルゴリズムはカスタマイゼーションポイントとして`abs`, `real`, `imag`, `conj`を非修飾名で呼び出す。 @@ -36,7 +36,7 @@ BLAS互換アルゴリズムは、演算対象データの次元数に応じて3 | `scaled_accessor` | `scaled`関数用の[アクセサポリシー](mdspan/AccessorPolicy.md) (class template) | C++26 | | `conjugated_accessor` | `conjugated`関数用の[アクセサポリシー](mdspan/AccessorPolicy.md) (class template) | C++26 | | `conjugated` | 読み取り専用の複素共役ビュー`std::mdspan`を作る (function template) | C++26 | -| `layout_transpose` | `transposed`関数用の[レイアウトマッピングポリシー](mdspan/LayoutMappingPolicy.md) (class template) | C++26 | +| [`layout_transpose`](linalg/layout_transpose.md) | `transposed`関数用の[レイアウトマッピングポリシー](mdspan/LayoutMappingPolicy.md) (class template) | C++26 | | `transposed` | 2次元`std::mdspan`の行列転置ビューを作る (function template) | C++26 | | `conjugate_transposed` | 読み取り専用の複素共役転置ビュー`std::mdspan`を作る (function template) | C++26 | @@ -103,14 +103,14 @@ BLAS互換アルゴリズムは、演算対象データの次元数に応じて3 | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| `column_major_t` | 列優先メモリレイアウトを表現するためのタグ型 (class) | C++26 | -| `column_major` | 列優先メモリレイアウトを表現するためのタグ値 (variable) | C++26 | -| `row_major_t` | 行優先メモリレイアウトを表現するためのタグ型 (class) | C++26 | -| `row_major` | 行優先メモリレイアウトを表現するためのタグ値 (variable) | C++26 | -| `upper_triangle_t` | 上三角行列を表現するためのタグ型 (class) | C++26 | -| `upper_triangle` | 上三角行列を表現するためのタグ値 (variable) | C++26 | -| `lower_triangle_t` | 下三角行列を表現するためのタグ型 (class) | C++26 | -| `lower_triangle` | 下三角行列を表現するためのタグ値 (variable) | C++26 | +| [`column_major_t`](column_major_t.md.nolink) | 列優先(colmun-major)順序を表現するためのタグ型 (class) | C++26 | +| [`column_major`](column_major_t.md.nolink) | 列優先(colmun-major)順序を表現するためのタグ値 (variable) | C++26 | +| [`row_major_t`](row_major_t.md.nolink) | 行優先(row-major)順序を表現するためのタグ型 (class) | C++26 | +| [`row_major`](row_major_t.md.nolink) | 行優先(row-major)順序を表現するためのタグ値 (variable) | C++26 | +| [`upper_triangle_t`](upper_triangle_t.md.nolink) | 上三角行列を表現するためのタグ型 (class) | C++26 | +| [`upper_triangle`](upper_triangle_t.md.nolink) | 上三角行列を表現するためのタグ値 (variable) | C++26 | +| [`lower_triangle_t`](lower_triangle_t.md.nolink) | 下三角行列を表現するためのタグ型 (class) | C++26 | +| [`lower_triangle`](lower_triangle_t.md.nolink) | 下三角行列を表現するためのタグ値 (variable) | C++26 | | `implicit_unit_diagonal_t` | implicit unit diagonalを表現するためのタグ型 (class) | C++26 | | `implicit_unit_diagonal` | implicit unit diagonalを表現するためのタグ値 (variable) | C++26 | | `explicit_diagonal_t` | explicit diagonalを表現するためのタグ型 (class) | C++26 | @@ -121,12 +121,6 @@ BLAS互換アルゴリズムは、演算対象データの次元数に応じて3 ### 言語 - C++26 -### 処理系 -- [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? -- [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? - ## 関連項目 - [``](mdspan.md) diff --git a/reference/linalg/layout_blas_packed.md b/reference/linalg/layout_blas_packed.md index 836714258a..3138c5537c 100644 --- a/reference/linalg/layout_blas_packed.md +++ b/reference/linalg/layout_blas_packed.md @@ -12,7 +12,7 @@ namespace std::linalg { ``` ## 概要 -`layout_blas_packed`は、多次元配列ビュー[`mdspan`](/reference/mdspan/mdspan.md)を用いた正方行列(square matrix)に対して、BLASにおけるパックレイアウトと互換性のある行列要素配置を表現する[レイアウトマッピングポリシー](/reference/mdspan/LayoutMappingPolicy.md)クラスである。 +`layout_blas_packed`は、多次元配列ビュー[`mdspan`](/reference/mdspan/mdspan.md)を用いた正方行列(square matrix)に対して、BLASにおけるパックレイアウトと互換性のある行列要素メモリ配置を表現する[レイアウトマッピングポリシー](/reference/mdspan/LayoutMappingPolicy.md)クラスである。 - `Triangle` : 指定する行列要素の種別を、上三角[`upper_triangle_t`](upper_triangle_t.md.nolink)または下三角[`lower_triangle_t`](lower_triangle_t.md.nolink)から指定する。 - `StorageOrder` : 行列要素の格納順を、列優先[`column_major_t`](column_major_t.md.nolink)または行優先[`row_major_t`](row_major_t.md.nolink)から指定する。 @@ -39,43 +39,72 @@ namespace std::linalg { #include #include #include +#include namespace linalg = std::linalg; +// 行列(matrix)の要素表示 +template +void print_mat(std::string_view name, const std::mdspan& mat) +{ + static_assert(mat.rank() == 2); + std::println("{}:", name); + for (size_t i = 0; i < mat.extent(0); ++i) { + for (size_t j = 0; j < mat.extent(1); ++j) { + std::print(" {:2}", mat[i, j]); + } + std::println(""); + } +} + int main() { - double arr[] = {1, 2, 3, 4, 5, 6}; + double arr[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; - // 行優先レイアウトの下三角要素から3x3対称行列を構築 + // 列優先格納順の下三角要素から4x4対称行列を構築 std::mdspan< double, - std::extents, - linalg::layout_blas_packed - > mat{arr}; - // 1 . . - // 2 4 . - // 3 5 6 - - for (size_t i = 0; i < mat.extent(0); i++) { - for (size_t j = 0; j < mat.extent(1); j++) { - std::print(" {}", mat[i, j]); - } - std::println(""); - } + std::extents, + linalg::layout_blas_packed + > mat1{arr}; + // 1 - - - + // 2 5 - - + // 3 6 8 - + // 4 7 9 10 + print_mat("mat1", mat); + + // 行優先格納順の下三角要素から4x4対称行列を構築 + std::mdspan< + double, + std::extents, + linalg::layout_blas_packed + > mat2{arr}; + // 1 - - - + // 2 3 - - + // 4 5 6 - + // 7 8 9 10 + print_mat("mat2", mat2); } ``` * linalg::layout_blas_packed[color ff0000] -* linalg::lower_triangle[link lower_triangle_t.md.nolink] -* linalg::column_major[link column_major_t.md.nolink] +* linalg::lower_triangle_t[link lower_triangle_t.md.nolink] +* linalg::column_major_t[link column_major_t.md.nolink] +* linalg::row_major_t[link row_major_t.md.nolink] * mat.extent[link /reference/mdspan/mdspan/extent.md] * std::print[link /reference/print/print.md] * std::println[link /reference/print/println.md] - ### 出力 ``` - 1 2 3 - 2 4 5 - 3 5 6 +mat1: + 1 2 3 4 + 2 5 6 7 + 3 6 8 9 + 4 7 9 10 +mat2: + 1 2 4 7 + 2 3 5 8 + 4 5 6 9 + 7 8 9 10 ``` diff --git a/reference/linalg/layout_blas_packed/mapping.md b/reference/linalg/layout_blas_packed/mapping.md index 05260eb262..7e1f272460 100644 --- a/reference/linalg/layout_blas_packed/mapping.md +++ b/reference/linalg/layout_blas_packed/mapping.md @@ -101,13 +101,14 @@ int main() { double arr[] = {1, 2, 3, 4, 5, 6}; - // 行優先レイアウトの下三角要素から3x3対称行列を構築 - using LayoutPacked = linalg::layout_blas_packed; - using Mapping = LayoutPacked::mapping>; - std::mdspan mat{arr, Mapping{}}; - // 1 . . - // 2 4 . - // 3 5 6 + // 行優先格納順の上三角要素から3x3対称行列を構築 + using Ext2D = std::dextents; + using LayoutPacked = linalg::layout_blas_packed; + using Mapping = LayoutPacked::mapping; + std::mdspan mat{arr, Mapping{Ext2D{3, 3}}}; + // 1 2 3 + // - 4 5 + // - - 6 for (size_t i = 0; i < mat.extent(0); i++) { for (size_t j = 0; j < mat.extent(1); j++) { @@ -118,7 +119,12 @@ int main() } ``` * linalg::layout_blas_packed[color ff0000] -* ::mapping[color ff0000] +* LayoutPacked::mapping[color ff0000] +* linalg::upper_triangle_t[link upper_triangle_t.md.nolink] +* linalg::row_major_t[link row_major_t.md.nolink] +* mat.extent[link /reference/mdspan/mdspan/extent.md] +* std::print[link /reference/print/print.md] +* std::println[link /reference/print/println.md] ### 出力 ``` diff --git a/reference/linalg/layout_transpose.md b/reference/linalg/layout_transpose.md new file mode 100644 index 0000000000..0db977228a --- /dev/null +++ b/reference/linalg/layout_transpose.md @@ -0,0 +1,49 @@ +# layout_transpose +* linalg[meta header] +* class template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::linalg { + template + class layout_transpose; +} +``` + +## 概要 +`layout_transpose`は、多次元配列ビュー[`mdspan`](/reference/mdspan/mdspan.md)を用いた行列(matrix)において、転置行列を表現する[レイアウトマッピングポリシー](/reference/mdspan/LayoutMappingPolicy.md)クラスである。 + +`layout_transpose`クラステンプレートは、行列転置操作[`transpose`](transpose.md.nolink)の戻り値型として利用される。 + + +## 適格要件 +`Layout`は[レイアウトマッピングポリシー要件](/reference/mdspan/LayoutMappingPolicy.md)を満たすこと。 + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `nested_layout_type` | `Layout` | C++26 | +| [`mapping`](layout_transpose/mapping.md.nolink) | レイアウトマッピング | C++26 | + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`mdspan`](/reference/mdspan/mdspan.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) +- [P1674R2: Evolving a Standard C++ Linear Algebra Library from the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1674r2.html) From 0c64616e3cf602a3dfe840e06d2a75d647d15936 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 28 Feb 2024 17:22:31 +0900 Subject: [PATCH 0770/3948] =?UTF-8?q?=E6=9A=97=E9=BB=99=E3=83=A0=E3=83=BC?= =?UTF-8?q?=E3=83=96=20=20:=20=E5=A4=89=E5=8C=96=E3=82=92=E8=A1=A8?= =?UTF-8?q?=E3=81=AB=E3=81=BE=E3=81=A8=E3=82=81=E3=81=9F=20#1021?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23/simpler_implicit_move.md | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/lang/cpp23/simpler_implicit_move.md b/lang/cpp23/simpler_implicit_move.md index 2bf2ccd5d6..bef9f698ea 100644 --- a/lang/cpp23/simpler_implicit_move.md +++ b/lang/cpp23/simpler_implicit_move.md @@ -99,23 +99,23 @@ auto g(int n) -> auto&& { この他の場合には結果は変化しない。 ```cpp -auto f1(int n)-> decltype(auto) { +auto f1(int n) -> decltype(auto) { return n; } // C++20/23共に戻り値型はint -auto f2(int n)-> auto { +auto f2(int n) -> auto { return n; } // C++20/23共に戻り値型はint -auto f3(int n)-> auto& { +auto f3(int n) -> auto& { return n; } // C++20/23共に戻り値型はint& // ただし、後述のようにC++23ではエラー -auto f4(int n)-> const auto& { +auto f4(int n) -> const auto& { return n; } // C++20/23共に戻り値型はconst int& @@ -160,6 +160,23 @@ auto f() -> int&& { } ``` +### 副作用早見表 + +任意の型名を`T`(`T&&`は右辺値参照型)として、戻り値型推論とコンパイル可否の変化は次のようにまとめられる + +|関数宣言と`return`文|C++20|C++23| +|---|---|---| +|`auto f(T x) -> decltype(x) { return x; }` |`T` : 〇|`T` : 〇| +|`auto f(T x) -> decltype((x)) { return (x); }` |`T&` : 〇|`T&` : **×**| +|`auto f(T x) -> decltype(auto) { return x; }` |`T` : 〇|`T` : 〇| +|`auto f(T x) -> decltype(auto) { return (x); }` |`T&` : 〇|**`T&&` :** 〇| +|`auto f(T&& x) -> decltype(x) { return x; }` |`T&&` : ×|`T&&` : **〇**| +|`auto f(T&& x) -> decltype((x)) { return (x); }` |`T&` : 〇|`T&` : **×**| +|`auto f(T&& x) -> decltype(auto) { return x; }` |`T&&` : ×|`T&&` : **〇**| +|`auto f(T&& x) -> decltype(auto) { return (x); }`|`T&` : 〇|**`T&&` :** 〇| + +右側2列の各項目内は、推論される戻り値型:コンパイル可否、のように記述しており、コンパイル可否は、〇が適格(コンパイルが通る)、×が不適格(コンパイルエラー)を表す。 + ## 例 (執筆中) @@ -200,3 +217,4 @@ int main() ## 参照 - [P2266R3 Simpler implicit move](https://wg21.link/p2266r3) +- [The Complete Guide to `return x;` - Arthur O'Dwyer - [CppNow 2021] - YouTube](https://www.youtube.com/watch?v=OGKAJD7bmr8) \ No newline at end of file From 81b8f372758ee91560a6f285d04231fd5ee73d05 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 28 Feb 2024 17:42:37 +0900 Subject: [PATCH 0771/3948] =?UTF-8?q?=E6=9A=97=E9=BB=99=E3=83=A0=E3=83=BC?= =?UTF-8?q?=E3=83=96=20:=20=E8=A1=A8=E3=82=92=E6=8B=A1=E5=85=85=20#1021?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23/simpler_implicit_move.md | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/lang/cpp23/simpler_implicit_move.md b/lang/cpp23/simpler_implicit_move.md index bef9f698ea..ca663ba8a2 100644 --- a/lang/cpp23/simpler_implicit_move.md +++ b/lang/cpp23/simpler_implicit_move.md @@ -164,16 +164,20 @@ auto f() -> int&& { 任意の型名を`T`(`T&&`は右辺値参照型)として、戻り値型推論とコンパイル可否の変化は次のようにまとめられる -|関数宣言と`return`文|C++20|C++23| -|---|---|---| -|`auto f(T x) -> decltype(x) { return x; }` |`T` : 〇|`T` : 〇| -|`auto f(T x) -> decltype((x)) { return (x); }` |`T&` : 〇|`T&` : **×**| -|`auto f(T x) -> decltype(auto) { return x; }` |`T` : 〇|`T` : 〇| -|`auto f(T x) -> decltype(auto) { return (x); }` |`T&` : 〇|**`T&&` :** 〇| -|`auto f(T&& x) -> decltype(x) { return x; }` |`T&&` : ×|`T&&` : **〇**| -|`auto f(T&& x) -> decltype((x)) { return (x); }` |`T&` : 〇|`T&` : **×**| -|`auto f(T&& x) -> decltype(auto) { return x; }` |`T&&` : ×|`T&&` : **〇**| -|`auto f(T&& x) -> decltype(auto) { return (x); }`|`T&` : 〇|**`T&&` :** 〇| +|関数宣言と`return`文|C++20まで|C++23から|備考| +|---|---|---|---| +|`auto f(T x) -> decltype(x) { return x; }` |`T` : 〇|`T` : 〇|| +|`auto f(T x) -> decltype((x)) { return (x); }` |`T&` : 〇|`T&` : **×**|ローカル参照を返していた| +|`auto f(T x) -> decltype(auto) { return x; }` |`T` : 〇|`T` : 〇|| +|`auto f(T x) -> decltype(auto) { return (x); }` |`T&` : 〇|**`T&&` :** 〇|ローカル参照を返す| +|`auto f(T&& x) -> decltype(x) { return x; }` |`T&&` : ×|`T&&` : **〇**|`x`がローカル変数の場合ローカル参照を返す| +|`auto f(T&& x) -> decltype((x)) { return (x); }` |`T&` : 〇|`T&` : **×**|`x`がローカル変数の場合ローカル参照を返していた| +|`auto f(T&& x) -> decltype(auto) { return x; }` |`T&&` : ×|`T&&` : **〇**|`x`がローカル変数の場合ローカル参照を返すようになる| +|`auto f(T&& x) -> decltype(auto) { return (x); }`|`T&` : 〇|**`T&&` :** 〇|`x`がローカル変数の場合ローカル参照を返す| +|`auto f(T x) -> auto&& { return x; }` |`T&` : 〇|`T&&` : 〇|ローカル参照を返す| +|`auto f(T x) -> auto&& { return (x); }` |`T&` : 〇|`T&&` : 〇|ローカル参照を返す| +|`auto f(T&& x) -> auto&& { return x; }` |`T&` : 〇|**`T&&` :** 〇|`x`がローカル変数の場合ローカル参照を返す| +|`auto f(T&& x) -> auto&& { return (x); }` |`T&` : 〇|**`T&&` :** 〇|`x`がローカル変数の場合ローカル参照を返す| 右側2列の各項目内は、推論される戻り値型:コンパイル可否、のように記述しており、コンパイル可否は、〇が適格(コンパイルが通る)、×が不適格(コンパイルエラー)を表す。 From 97995901c295b7698267af4eaf1d922e4e98b680 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 28 Feb 2024 17:50:28 +0900 Subject: [PATCH 0772/3948] =?UTF-8?q?=E8=A1=A8=E3=81=AE=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23/simpler_implicit_move.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lang/cpp23/simpler_implicit_move.md b/lang/cpp23/simpler_implicit_move.md index ca663ba8a2..6b93a6c130 100644 --- a/lang/cpp23/simpler_implicit_move.md +++ b/lang/cpp23/simpler_implicit_move.md @@ -165,17 +165,17 @@ auto f() -> int&& { 任意の型名を`T`(`T&&`は右辺値参照型)として、戻り値型推論とコンパイル可否の変化は次のようにまとめられる |関数宣言と`return`文|C++20まで|C++23から|備考| -|---|---|---|---| +|---|:-:|:-:|---| |`auto f(T x) -> decltype(x) { return x; }` |`T` : 〇|`T` : 〇|| |`auto f(T x) -> decltype((x)) { return (x); }` |`T&` : 〇|`T&` : **×**|ローカル参照を返していた| |`auto f(T x) -> decltype(auto) { return x; }` |`T` : 〇|`T` : 〇|| |`auto f(T x) -> decltype(auto) { return (x); }` |`T&` : 〇|**`T&&` :** 〇|ローカル参照を返す| |`auto f(T&& x) -> decltype(x) { return x; }` |`T&&` : ×|`T&&` : **〇**|`x`がローカル変数の場合ローカル参照を返す| -|`auto f(T&& x) -> decltype((x)) { return (x); }` |`T&` : 〇|`T&` : **×**|`x`がローカル変数の場合ローカル参照を返していた| -|`auto f(T&& x) -> decltype(auto) { return x; }` |`T&&` : ×|`T&&` : **〇**|`x`がローカル変数の場合ローカル参照を返すようになる| -|`auto f(T&& x) -> decltype(auto) { return (x); }`|`T&` : 〇|**`T&&` :** 〇|`x`がローカル変数の場合ローカル参照を返す| -|`auto f(T x) -> auto&& { return x; }` |`T&` : 〇|`T&&` : 〇|ローカル参照を返す| -|`auto f(T x) -> auto&& { return (x); }` |`T&` : 〇|`T&&` : 〇|ローカル参照を返す| +|`auto f(T&& x) -> decltype((x)) { return (x); }` |`T&` : 〇|`T&` : **×**|| +|`auto f(T&& x) -> decltype(auto) { return x; }` |`T&&` : ×|`T&&` : **〇**|| +|`auto f(T&& x) -> decltype(auto) { return (x); }`|`T&` : 〇|**`T&&` :** 〇|| +|`auto f(T x) -> auto&& { return x; }` |`T&` : 〇|**`T&&` :** 〇|ローカル参照を返す| +|`auto f(T x) -> auto&& { return (x); }` |`T&` : 〇|**`T&&` :** 〇|ローカル参照を返す| |`auto f(T&& x) -> auto&& { return x; }` |`T&` : 〇|**`T&&` :** 〇|`x`がローカル変数の場合ローカル参照を返す| |`auto f(T&& x) -> auto&& { return (x); }` |`T&` : 〇|**`T&&` :** 〇|`x`がローカル変数の場合ローカル参照を返す| From 300354736781ac9f71642b3b2dc18629d4378783 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 28 Feb 2024 17:57:53 +0900 Subject: [PATCH 0773/3948] =?UTF-8?q?=E5=82=99=E8=80=83=E3=81=AE=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23/simpler_implicit_move.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lang/cpp23/simpler_implicit_move.md b/lang/cpp23/simpler_implicit_move.md index 6b93a6c130..0596df0c1e 100644 --- a/lang/cpp23/simpler_implicit_move.md +++ b/lang/cpp23/simpler_implicit_move.md @@ -170,10 +170,10 @@ auto f() -> int&& { |`auto f(T x) -> decltype((x)) { return (x); }` |`T&` : 〇|`T&` : **×**|ローカル参照を返していた| |`auto f(T x) -> decltype(auto) { return x; }` |`T` : 〇|`T` : 〇|| |`auto f(T x) -> decltype(auto) { return (x); }` |`T&` : 〇|**`T&&` :** 〇|ローカル参照を返す| -|`auto f(T&& x) -> decltype(x) { return x; }` |`T&&` : ×|`T&&` : **〇**|`x`がローカル変数の場合ローカル参照を返す| +|`auto f(T&& x) -> decltype(x) { return x; }` |`T&&` : ×|`T&&` : **〇**|| |`auto f(T&& x) -> decltype((x)) { return (x); }` |`T&` : 〇|`T&` : **×**|| -|`auto f(T&& x) -> decltype(auto) { return x; }` |`T&&` : ×|`T&&` : **〇**|| -|`auto f(T&& x) -> decltype(auto) { return (x); }`|`T&` : 〇|**`T&&` :** 〇|| +|`auto f(T&& x) -> decltype(auto) { return x; }` |`T&&` : ×|`T&&` : **〇**|`x`がローカル変数の場合ローカル参照を返す| +|`auto f(T&& x) -> decltype(auto) { return (x); }`|`T&` : 〇|**`T&&` :** 〇|`x`がローカル変数の場合ローカル参照を返す| |`auto f(T x) -> auto&& { return x; }` |`T&` : 〇|**`T&&` :** 〇|ローカル参照を返す| |`auto f(T x) -> auto&& { return (x); }` |`T&` : 〇|**`T&&` :** 〇|ローカル参照を返す| |`auto f(T&& x) -> auto&& { return x; }` |`T&` : 〇|**`T&&` :** 〇|`x`がローカル変数の場合ローカル参照を返す| From ac864c9c9e78e30dd493f72b974688304ce40d59 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Thu, 29 Feb 2024 12:06:50 +0900 Subject: [PATCH 0774/3948] =?UTF-8?q?=E6=9A=97=E9=BB=99=E7=9A=84=E3=81=AA?= =?UTF-8?q?=E3=83=A0=E3=83=BC=E3=83=96=E3=82=92=E7=B0=A1=E7=95=A5=E5=8C=96?= =?UTF-8?q?=20:=20=E3=82=B5=E3=83=B3=E3=83=97=E3=83=AB=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=89=E3=81=AE=E8=BF=BD=E5=8A=A0=20#1021?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23/simpler_implicit_move.md | 112 ++++++++++++++++++++++------ 1 file changed, 91 insertions(+), 21 deletions(-) diff --git a/lang/cpp23/simpler_implicit_move.md b/lang/cpp23/simpler_implicit_move.md index 0596df0c1e..ad6937ee1d 100644 --- a/lang/cpp23/simpler_implicit_move.md +++ b/lang/cpp23/simpler_implicit_move.md @@ -21,12 +21,12 @@ struct RRefTaker { auto example1(Widget w) -> RRefTaker { // ローカル変数の暗黙ムーブ - return w; // ok、C++11(CWG1579)から + return w; // ok、C++11から } auto example2(Widget&& w) -> RRefTaker { // ローカル右辺値参照の暗黙ムーブ - return w; // ok、C++20(P0527)から + return w; // ok、C++20から } auto example3(Widget&& w) -> Widget&& { @@ -96,7 +96,9 @@ auto g(int n) -> auto&& { `auto&&`による戻り値型推論は`decltype`と推論方法が異なるものの、やはり`return`文のオペランドの値カテゴリに応じて参照修飾が決定されるため、従来左辺値(*lvalue*)だったオペランドがC++23でムーブする資格がある式となる場合に、値カテゴリが*xvalue*となることによって推論結果が変化する。 -この他の場合には結果は変化しない。 +ただし、変更に関わらず、この例のような関数はどちらもローカル変数への参照を返すものであるため、書くべきではない。 + +戻り値型推論においては、この他の場合には結果は変化しない。 ```cpp auto f1(int n) -> decltype(auto) { @@ -172,7 +174,7 @@ auto f() -> int&& { |`auto f(T x) -> decltype(auto) { return (x); }` |`T&` : 〇|**`T&&` :** 〇|ローカル参照を返す| |`auto f(T&& x) -> decltype(x) { return x; }` |`T&&` : ×|`T&&` : **〇**|| |`auto f(T&& x) -> decltype((x)) { return (x); }` |`T&` : 〇|`T&` : **×**|| -|`auto f(T&& x) -> decltype(auto) { return x; }` |`T&&` : ×|`T&&` : **〇**|`x`がローカル変数の場合ローカル参照を返す| +|`auto f(T&& x) -> decltype(auto) { return x; }` |`T&&` : ×|`T&&` : **〇**|`x`がローカル変数の場合ローカル参照を返すようになる| |`auto f(T&& x) -> decltype(auto) { return (x); }`|`T&` : 〇|**`T&&` :** 〇|`x`がローカル変数の場合ローカル参照を返す| |`auto f(T x) -> auto&& { return x; }` |`T&` : 〇|**`T&&` :** 〇|ローカル参照を返す| |`auto f(T x) -> auto&& { return (x); }` |`T&` : 〇|**`T&&` :** 〇|ローカル参照を返す| @@ -182,32 +184,100 @@ auto f() -> int&& { 右側2列の各項目内は、推論される戻り値型:コンパイル可否、のように記述しており、コンパイル可否は、〇が適格(コンパイルが通る)、×が不適格(コンパイルエラー)を表す。 ## 例 -(執筆中) -```cpp example -// (ここには、言語機能の使い方を解説するための、サンプルコードを記述します。) -// (インクルードとmain()関数を含む、実行可能なサンプルコードを記述してください。そのようなコードブロックにはexampleタグを付けます。) +```cpp +struct Weird { + Weird(); + Weird(Weird&); +}; -#include +auto g(bool b) -> Weird { + static Weird w1; + Weird w2; -int main() -{ - int variable = 0; - std::cout << variable << std::endl; + if (b) { + return w1; // ok、w1はムーブする資格のある式ではなく、Weird(Weird&)が呼ばれる + } else { + return w2; // ng、w2はムーブする資格のある式であり、xvalue(Weird&&)となる + } } ``` -* variable[color ff0000] -(コードブロック中の識別子に、文字色を付ける例です。) +```cpp +// 例示用のムーブ可能な型 +struct Widget { + Widget(Widget&&); +}; -### 出力 -``` -0 -``` +auto f1(Widget w) -> Widget { + return w; // ローカル変数の暗黙ムーブ、C++11から +} + +// Widgetの右辺値から構築可能な型 +struct RRefTaker { + // Widgetの右辺値からの変換コンストラクタ + RRefTaker(Widget&&); +}; + +auto f2(Widget w) -> RRefTaker { + return w; // 暗黙ムーブされて構築(変換)、C++11から +} + +auto f3(Widget&& w) -> RRefTaker { + return w; // ローカル右辺値参照の暗黙ムーブ、C++20から +} -(ここには、サンプルコードの実行結果を記述します。何も出力がない場合は、項目を削除せず、空の出力にしてください。) -(実行結果が処理系・実行環境によって異なる場合は、項目名を「出力例」に変更し、可能であればその理由も併記してください。) +[[noreturn]] +void f4(Widget w) { + throw w; // throw式における暗黙ムーブ、C++20から +} + +struct From { + From(Widget const &); + From(Widget&&); +}; + +auto f5() -> From { + Widget w; + return w; // 暗黙ムーブ(コンストラクタによる変換)、C++11から +} + +struct To { + operator Widget() &&; +}; + +auto f6() -> Widget { + To t; + return t; // 暗黙ムーブ(変換演算子による変換)、C++20から +} + +struct V { + V(Widget); // 値で受け取るコンストラクタ +}; +auto f7() -> V { + Widget w; + return w; // 暗黙ムーブ(コンストラクタ引数へのムーブ)、C++20から +} + +// DerivedはBaseを公開継承しているとき +auto f8() -> Base { + Derived result; + return result; // 暗黙ムーブ(基底クラスへの変換)、C++20から +} + +auto f9(Widget&& w) -> Widget&& { + return w; // 戻り値型が参照型の場合の暗黙ムーブ、C++23から +} + +struct J { + operator Widget&() &&; +}; + +auto f10(J x) -> Widget& { + return x; // 戻り値型が参照型の場合の暗黙ムーブ(変換演算子による変換)、C++23から +} +``` ## この機能が必要になった背景・経緯 (執筆中) From 6b609be2bb6e9f3c160836055074b5092bee1b8a Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Thu, 29 Feb 2024 12:18:21 +0900 Subject: [PATCH 0775/3948] =?UTF-8?q?=E8=A1=A8=E5=91=A8=E3=82=8A=E3=81=AE?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23/simpler_implicit_move.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lang/cpp23/simpler_implicit_move.md b/lang/cpp23/simpler_implicit_move.md index ad6937ee1d..f61ff2f24b 100644 --- a/lang/cpp23/simpler_implicit_move.md +++ b/lang/cpp23/simpler_implicit_move.md @@ -168,9 +168,9 @@ auto f() -> int&& { |関数宣言と`return`文|C++20まで|C++23から|備考| |---|:-:|:-:|---| -|`auto f(T x) -> decltype(x) { return x; }` |`T` : 〇|`T` : 〇|| +|`auto f(T x) -> decltype(x) { return x; }` |`T` : 〇| ― || |`auto f(T x) -> decltype((x)) { return (x); }` |`T&` : 〇|`T&` : **×**|ローカル参照を返していた| -|`auto f(T x) -> decltype(auto) { return x; }` |`T` : 〇|`T` : 〇|| +|`auto f(T x) -> decltype(auto) { return x; }` |`T` : 〇| ― || |`auto f(T x) -> decltype(auto) { return (x); }` |`T&` : 〇|**`T&&` :** 〇|ローカル参照を返す| |`auto f(T&& x) -> decltype(x) { return x; }` |`T&&` : ×|`T&&` : **〇**|| |`auto f(T&& x) -> decltype((x)) { return (x); }` |`T&` : 〇|`T&` : **×**|| @@ -181,7 +181,11 @@ auto f() -> int&& { |`auto f(T&& x) -> auto&& { return x; }` |`T&` : 〇|**`T&&` :** 〇|`x`がローカル変数の場合ローカル参照を返す| |`auto f(T&& x) -> auto&& { return (x); }` |`T&` : 〇|**`T&&` :** 〇|`x`がローカル変数の場合ローカル参照を返す| -右側2列の各項目内は、推論される戻り値型:コンパイル可否、のように記述しており、コンパイル可否は、〇が適格(コンパイルが通る)、×が不適格(コンパイルエラー)を表す。 +表の中2列の各項目内は、推論される戻り値型:コンパイル可否、のように記述している。また、表中の記号の意味は次のとおり + +- 〇 : 適格(コンパイルが通る) +- × : 不適格(コンパイルエラー) +- ― : 変化なし ## 例 From fc76618bd1e1be1d071a19d7c5ee3c462e56e494 Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Thu, 29 Feb 2024 23:21:01 +0900 Subject: [PATCH 0776/3948] =?UTF-8?q?typo:=20=E5=8B=95=E4=BD=9C=E6=9C=AA?= =?UTF-8?q?=E5=AE=9A=E7=BE=A9=20->=20=E6=9C=AA=E5=AE=9A=E7=BE=A9=E5=8B=95?= =?UTF-8?q?=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/memory/shared_ptr/const_pointer_cast.md | 2 +- reference/memory/shared_ptr/dynamic_pointer_cast.md | 2 +- reference/memory/shared_ptr/reinterpret_pointer_cast.md | 2 +- reference/memory/shared_ptr/static_pointer_cast.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/memory/shared_ptr/const_pointer_cast.md b/reference/memory/shared_ptr/const_pointer_cast.md index 6df15cd647..628c1ad980 100644 --- a/reference/memory/shared_ptr/const_pointer_cast.md +++ b/reference/memory/shared_ptr/const_pointer_cast.md @@ -35,7 +35,7 @@ namespace std { ## 備考 -- `shared_ptr(const_cast(r.get()))` という方法は動作未定義となるので使用しないこと。 +- `shared_ptr(const_cast(r.get()))` という方法は未定義動作となるので使用しないこと。 ## 例外 diff --git a/reference/memory/shared_ptr/dynamic_pointer_cast.md b/reference/memory/shared_ptr/dynamic_pointer_cast.md index aa1c77dff1..ae416865b2 100644 --- a/reference/memory/shared_ptr/dynamic_pointer_cast.md +++ b/reference/memory/shared_ptr/dynamic_pointer_cast.md @@ -35,7 +35,7 @@ namespace std { ## 備考 -- `shared_ptr(dynamic_cast(r.get()))` という方法は動作未定義となるので使用しないこと。 +- `shared_ptr(dynamic_cast(r.get()))` という方法は未定義動作となるので使用しないこと。 ## 例外 diff --git a/reference/memory/shared_ptr/reinterpret_pointer_cast.md b/reference/memory/shared_ptr/reinterpret_pointer_cast.md index 9054ca33fe..81c9ba5c2b 100644 --- a/reference/memory/shared_ptr/reinterpret_pointer_cast.md +++ b/reference/memory/shared_ptr/reinterpret_pointer_cast.md @@ -35,7 +35,7 @@ namespace std { ## 備考 -- `shared_ptr(reinterpret_cast(r.get()))` という方法は動作未定義となるので使用しないこと。 +- `shared_ptr(reinterpret_cast(r.get()))` という方法は未定義動作となるので使用しないこと。 ## 例外 diff --git a/reference/memory/shared_ptr/static_pointer_cast.md b/reference/memory/shared_ptr/static_pointer_cast.md index 5514da6162..9bed817c3a 100644 --- a/reference/memory/shared_ptr/static_pointer_cast.md +++ b/reference/memory/shared_ptr/static_pointer_cast.md @@ -35,7 +35,7 @@ namespace std { ## 備考 -- `shared_ptr(static_cast(r.get()))` という方法は動作未定義となるので使用しないこと。 +- `shared_ptr(static_cast(r.get()))` という方法は未定義動作となるので使用しないこと。 ## 例 From 8384e0bb49cce5acc30eca4215df91ecd554eddb Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Fri, 1 Mar 2024 12:46:32 +0900 Subject: [PATCH 0777/3948] =?UTF-8?q?=E6=9A=97=E9=BB=99=E3=83=A0=E3=83=BC?= =?UTF-8?q?=E3=83=96=20:=20=E7=B5=8C=E7=B7=AF=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20#1021?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23/simpler_implicit_move.md | 59 ++++++++++++++++++++++++++--- 1 file changed, 53 insertions(+), 6 deletions(-) diff --git a/lang/cpp23/simpler_implicit_move.md b/lang/cpp23/simpler_implicit_move.md index f61ff2f24b..dc7b5733b3 100644 --- a/lang/cpp23/simpler_implicit_move.md +++ b/lang/cpp23/simpler_implicit_move.md @@ -207,6 +207,20 @@ auto g(bool b) -> Weird { } ``` +```cpp +// ムーブしないことを明示する関数、C++20までは使用可能 +template +auto unmove(T&& v) -> T& { + return v; // C++23からng、vはxvalue +} + +// C++23では次のように修正する必要がある +template +auto unmove(T&& v) -> T& { + return static_cast(v); // ok、キャスト式はムーブする資格のある式ではない +} +``` + ```cpp // 例示用のムーブ可能な型 struct Widget { @@ -284,15 +298,48 @@ auto f10(J x) -> Widget& { ``` ## この機能が必要になった背景・経緯 -(執筆中) -## 検討されたほかの選択肢 -(執筆中) +C++20までは戻り値型が参照型である場合に暗黙ムーブが行われていなかった。より正確には、関数戻り値の初期化時に戻り値構築のためのコンストラクタを選択するオーバーロード解決が行われる場合にのみ、暗黙ムーブが考慮されていたが、戻り値型が参照型の場合は参照の初期化だけが起こりコンストラクタ呼び出しは関与しないため暗黙ムーブは考慮されていなかった。 + +これによって、同じ`return`文でも戻り値型が異なることでそのオペランドの扱いが変化してしまっていた。 + +```cpp +// Widget, RRefTakerは上の例を参照 +// どちらも、C++20の場合 + +auto f(Widget&& w) -> RRefTaker { + return w; // ok、wは右辺値として扱われる +} + +auto g(Widget&& w) -> Widget&& { + return w; // ng、wは左辺値として扱われる +} +``` + +この非一貫性を解消することがまず求められていた。 + +また、C++20時点の暗黙ムーブの使用は二段階のオーバーロード解決を行う複雑なものであり、暗黙ムーブが行われるかどうかについて実装間で挙動に差異が生じていた。 + +C++20の仕様は次のようになっていた。 + +暗黙ムーブ可能なエンティティが次のコピー初期化が行われる場所で指名されている場合、コピーの代わりにムーブが使用される場合がある + +- `return/co_return`文のオペランド + - (諸条件はC++23仕様と同一なので省略) +- `throw`式のオペランド + - (諸条件はC++23仕様と同一なので省略) + +これらのコピー初期化が行われる場所において、呼び出されるコンストラクタまたは[`return_­value()`オーバーロード](/lang/cpp20/coroutines.md)を選択するオーバーロード解決は次の順序で実行される + +1. オペランドのid式を右辺値(*rvalue*)としてオーバーロード解決を実行する +2. 1が失敗した(もしくは行われなかった)場合、オペランドのid式を左辺値(*lvalue*)としてオーバーロード解決を実行する + +この最後の手順の1回目のオーバーロード解決時にコピーコンストラクタの代わりにムーブコンストラクタが選択されることによって、C++20の暗黙ムーブは達成されていた。しかし、この手順2における「失敗」という言葉の意味が明確ではなく、それによって実装間で暗黙ムーブが行われるかどうか、あるいは選択されるコンストラクタに差異が生じていた。 -## 関連項目 -(執筆中) +`return`文オペランドの扱いの戻り値型の違いによる非一貫性と、使用の複雑さと曖昧さによる実装間の差異の2つの問題を解決するために、C++23ではムーブする資格がある式という概念を用いて暗黙ムーブの仕様が単純化された。 ## 参照 - [P2266R3 Simpler implicit move](https://wg21.link/p2266r3) -- [The Complete Guide to `return x;` - Arthur O'Dwyer - [CppNow 2021] - YouTube](https://www.youtube.com/watch?v=OGKAJD7bmr8) \ No newline at end of file +- [The Complete Guide to `return x;` - Arthur O'Dwyer - [CppNow 2021] - YouTube](https://www.youtube.com/watch?v=OGKAJD7bmr8) +- [c++ - Does c++23 break unmove - Stack Overflow](https://stackoverflow.com/questions/76647046/does-c23-break-unmove) From c4b15eaed4ad336a858490578ffbb2bd63907a59 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Fri, 1 Mar 2024 14:13:30 +0900 Subject: [PATCH 0778/3948] =?UTF-8?q?=E4=B8=8D=E5=8F=AF=E8=A6=96=E6=96=87?= =?UTF-8?q?=E5=AD=97=E3=81=AE=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23/simpler_implicit_move.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp23/simpler_implicit_move.md b/lang/cpp23/simpler_implicit_move.md index dc7b5733b3..ac669ea6aa 100644 --- a/lang/cpp23/simpler_implicit_move.md +++ b/lang/cpp23/simpler_implicit_move.md @@ -329,7 +329,7 @@ C++20の仕様は次のようになっていた。 - `throw`式のオペランド - (諸条件はC++23仕様と同一なので省略) -これらのコピー初期化が行われる場所において、呼び出されるコンストラクタまたは[`return_­value()`オーバーロード](/lang/cpp20/coroutines.md)を選択するオーバーロード解決は次の順序で実行される +これらのコピー初期化が行われる場所において、呼び出されるコンストラクタまたは[`return_value()`オーバーロード](/lang/cpp20/coroutines.md)を選択するオーバーロード解決は次の順序で実行される 1. オペランドのid式を右辺値(*rvalue*)としてオーバーロード解決を実行する 2. 1が失敗した(もしくは行われなかった)場合、オペランドのid式を左辺値(*lvalue*)としてオーバーロード解決を実行する From dd9230e50d7909b013e4930f029f7b252dc63d70 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Fri, 1 Mar 2024 14:35:04 +0900 Subject: [PATCH 0779/3948] =?UTF-8?q?=E5=BE=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23/simpler_implicit_move.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lang/cpp23/simpler_implicit_move.md b/lang/cpp23/simpler_implicit_move.md index ac669ea6aa..d6d4ceaa34 100644 --- a/lang/cpp23/simpler_implicit_move.md +++ b/lang/cpp23/simpler_implicit_move.md @@ -299,7 +299,7 @@ auto f10(J x) -> Widget& { ## この機能が必要になった背景・経緯 -C++20までは戻り値型が参照型である場合に暗黙ムーブが行われていなかった。より正確には、関数戻り値の初期化時に戻り値構築のためのコンストラクタを選択するオーバーロード解決が行われる場合にのみ、暗黙ムーブが考慮されていたが、戻り値型が参照型の場合は参照の初期化だけが起こりコンストラクタ呼び出しは関与しないため暗黙ムーブは考慮されていなかった。 +C++20までは戻り値型が参照型である場合に暗黙ムーブが行われていなかった。より正確には、関数戻り値の初期化時に初期化のためのコンストラクタを選択するオーバーロード解決が行われる場合にのみ、暗黙ムーブが考慮されていたが、戻り値型が参照型の場合は参照の初期化だけが起こりコンストラクタ呼び出しは関与しないため暗黙ムーブは考慮されていなかった。 これによって、同じ`return`文でも戻り値型が異なることでそのオペランドの扱いが変化してしまっていた。 @@ -318,9 +318,7 @@ auto g(Widget&& w) -> Widget&& { この非一貫性を解消することがまず求められていた。 -また、C++20時点の暗黙ムーブの使用は二段階のオーバーロード解決を行う複雑なものであり、暗黙ムーブが行われるかどうかについて実装間で挙動に差異が生じていた。 - -C++20の仕様は次のようになっていた。 +また、C++20時点の暗黙ムーブの使用は二段階のオーバーロード解決を行う複雑なものであり、暗黙ムーブが行われるかどうかについて実装間で挙動に差異が生じていた。C++20時点の暗黙ムーブの仕様は次のようになっていた 暗黙ムーブ可能なエンティティが次のコピー初期化が行われる場所で指名されている場合、コピーの代わりにムーブが使用される場合がある @@ -334,9 +332,9 @@ C++20の仕様は次のようになっていた。 1. オペランドのid式を右辺値(*rvalue*)としてオーバーロード解決を実行する 2. 1が失敗した(もしくは行われなかった)場合、オペランドのid式を左辺値(*lvalue*)としてオーバーロード解決を実行する -この最後の手順の1回目のオーバーロード解決時にコピーコンストラクタの代わりにムーブコンストラクタが選択されることによって、C++20の暗黙ムーブは達成されていた。しかし、この手順2における「失敗」という言葉の意味が明確ではなく、それによって実装間で暗黙ムーブが行われるかどうか、あるいは選択されるコンストラクタに差異が生じていた。 +この最後の手順の1回目のオーバーロード解決時にコピーコンストラクタの代わりにムーブコンストラクタが選択されることによって、C++20の暗黙ムーブは実行される。しかし、この手順における「失敗」という言葉の意味が明確ではなく、それによって実装間で暗黙ムーブが行われるかどうか、あるいは選択されるコンストラクタに差異が生じていた。 -`return`文オペランドの扱いの戻り値型の違いによる非一貫性と、使用の複雑さと曖昧さによる実装間の差異の2つの問題を解決するために、C++23ではムーブする資格がある式という概念を用いて暗黙ムーブの仕様が単純化された。 +`return`文オペランドの扱いの戻り値型の違いによる非一貫性と、仕様の複雑さと曖昧さによる実装間の差異の2つの問題を解決するために、C++23ではムーブする資格がある式という概念を用いて暗黙ムーブの仕様が単純化された。 ## 参照 From 300f467b154fc15ab169574de793da0cacb92216 Mon Sep 17 00:00:00 2001 From: yoh Date: Sun, 3 Mar 2024 00:10:46 +0900 Subject: [PATCH 0780/3948] =?UTF-8?q?linalg:=20layout=5F*=20=E5=80=8B?= =?UTF-8?q?=E5=88=A5=E3=83=A1=E3=83=B3=E3=83=90(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/linalg.md | 16 +-- reference/linalg/column_major_t.md | 38 ++++++ reference/linalg/layout_blas_packed.md | 12 +- .../linalg/layout_blas_packed/mapping.md | 15 +-- .../layout_blas_packed/mapping/op_call.md | 81 +++++++++++++ .../mapping/op_constructor.md | 111 ++++++++++++++++++ .../layout_blas_packed/mapping/op_equal.md | 69 +++++++++++ .../mapping/required_span_size.md | 59 ++++++++++ reference/linalg/layout_transpose.md | 3 +- reference/linalg/layout_transpose/mapping.md | 104 ++++++++++++++++ .../layout_transpose/mapping/op_call.md | 33 ++++++ .../mapping/op_constructor.md | 32 +++++ .../layout_transpose/mapping/op_equal.md | 43 +++++++ .../linalg/layout_transpose/mapping/stride.md | 36 ++++++ reference/linalg/row_major_t.md | 38 ++++++ 15 files changed, 666 insertions(+), 24 deletions(-) create mode 100644 reference/linalg/column_major_t.md create mode 100644 reference/linalg/layout_blas_packed/mapping/op_call.md create mode 100644 reference/linalg/layout_blas_packed/mapping/op_constructor.md create mode 100644 reference/linalg/layout_blas_packed/mapping/op_equal.md create mode 100644 reference/linalg/layout_blas_packed/mapping/required_span_size.md create mode 100644 reference/linalg/layout_transpose/mapping.md create mode 100644 reference/linalg/layout_transpose/mapping/op_call.md create mode 100644 reference/linalg/layout_transpose/mapping/op_constructor.md create mode 100644 reference/linalg/layout_transpose/mapping/op_equal.md create mode 100644 reference/linalg/layout_transpose/mapping/stride.md create mode 100644 reference/linalg/row_major_t.md diff --git a/reference/linalg.md b/reference/linalg.md index 4893195e7e..6fa205bfd8 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -103,14 +103,14 @@ BLAS互換アルゴリズムは、演算対象データの次元数や計算オ | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`column_major_t`](column_major_t.md.nolink) | 列優先(colmun-major)順序を表現するためのタグ型 (class) | C++26 | -| [`column_major`](column_major_t.md.nolink) | 列優先(colmun-major)順序を表現するためのタグ値 (variable) | C++26 | -| [`row_major_t`](row_major_t.md.nolink) | 行優先(row-major)順序を表現するためのタグ型 (class) | C++26 | -| [`row_major`](row_major_t.md.nolink) | 行優先(row-major)順序を表現するためのタグ値 (variable) | C++26 | -| [`upper_triangle_t`](upper_triangle_t.md.nolink) | 上三角行列を表現するためのタグ型 (class) | C++26 | -| [`upper_triangle`](upper_triangle_t.md.nolink) | 上三角行列を表現するためのタグ値 (variable) | C++26 | -| [`lower_triangle_t`](lower_triangle_t.md.nolink) | 下三角行列を表現するためのタグ型 (class) | C++26 | -| [`lower_triangle`](lower_triangle_t.md.nolink) | 下三角行列を表現するためのタグ値 (variable) | C++26 | +| [`column_major_t`](linalg/column_major_t.md) | 列優先(column-major)順序を表現するためのタグ型 (class) | C++26 | +| [`column_major`](linalg/column_major_t.md) | 列優先(column-major)順序を表現するためのタグ値 (variable) | C++26 | +| [`row_major_t`](linalg/row_major_t.md) | 行優先(row-major)順序を表現するためのタグ型 (class) | C++26 | +| [`row_major`](linalg/row_major_t.md) | 行優先(row-major)順序を表現するためのタグ値 (variable) | C++26 | +| [`upper_triangle_t`](linalg/upper_triangle_t.md.nolink) | 上三角行列を表現するためのタグ型 (class) | C++26 | +| [`upper_triangle`](linalg/upper_triangle_t.md.nolink) | 上三角行列を表現するためのタグ値 (variable) | C++26 | +| [`lower_triangle_t`](linalg/lower_triangle_t.md.nolink) | 下三角行列を表現するためのタグ型 (class) | C++26 | +| [`lower_triangle`](linalg/lower_triangle_t.md.nolink) | 下三角行列を表現するためのタグ値 (variable) | C++26 | | `implicit_unit_diagonal_t` | implicit unit diagonalを表現するためのタグ型 (class) | C++26 | | `implicit_unit_diagonal` | implicit unit diagonalを表現するためのタグ値 (variable) | C++26 | | `explicit_diagonal_t` | explicit diagonalを表現するためのタグ型 (class) | C++26 | diff --git a/reference/linalg/column_major_t.md b/reference/linalg/column_major_t.md new file mode 100644 index 0000000000..ae5a0f4adc --- /dev/null +++ b/reference/linalg/column_major_t.md @@ -0,0 +1,38 @@ +# column_major_t +* linalg[meta header] +* class[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::linalg { + struct column_major_t { explicit column_major_t() = default; }; + + inline constexpr column_major_t column_major{}; +} +``` + +## 概要 +`column_major_t`は、[`layout_blas_packed`](layout_blas_packed.md)を指定した多次元配列ビュー[`mdspan`](/reference/mdspan/mdspan.md)において、要素の格納順が列優先(column-major)であることを指示するためのタグ型である。 + +`column_major_t`型の定数`column_major`が提供される。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`mdspan`](/reference/mdspan/mdspan.md) +- [`layout_blas_packed`](layout_blas_packed.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) diff --git a/reference/linalg/layout_blas_packed.md b/reference/linalg/layout_blas_packed.md index 3138c5537c..67fd430106 100644 --- a/reference/linalg/layout_blas_packed.md +++ b/reference/linalg/layout_blas_packed.md @@ -15,14 +15,14 @@ namespace std::linalg { `layout_blas_packed`は、多次元配列ビュー[`mdspan`](/reference/mdspan/mdspan.md)を用いた正方行列(square matrix)に対して、BLASにおけるパックレイアウトと互換性のある行列要素メモリ配置を表現する[レイアウトマッピングポリシー](/reference/mdspan/LayoutMappingPolicy.md)クラスである。 - `Triangle` : 指定する行列要素の種別を、上三角[`upper_triangle_t`](upper_triangle_t.md.nolink)または下三角[`lower_triangle_t`](lower_triangle_t.md.nolink)から指定する。 -- `StorageOrder` : 行列要素の格納順を、列優先[`column_major_t`](column_major_t.md.nolink)または行優先[`row_major_t`](row_major_t.md.nolink)から指定する。 +- `StorageOrder` : 行列要素の格納順を、列優先[`column_major_t`](column_major_t.md)または行優先[`row_major_t`](row_major_t.md)から指定する。 -`layout_blas_packed`を用いて、BLASの Symmetric Packed (SP), Hermitian Packed (HP), Triangular Packed (TP) 行列レイアウトを表現できる。 +`layout_blas_packed`を用いて、BLASの Symmetric Packed (SP), Hermitian Packed (HP), Triangular Packed (TP) で利用される行列レイアウトを表現できる。 ## 適格要件 - `Triangle`は[`upper_triangle_t`](upper_triangle_t.md.nolink)または[`lower_triangle_t`](lower_triangle_t.md.nolink)のいずれか -- `StorageOrder`は[`column_major_t`](column_major_t.md.nolink)または[`row_major_t`](row_major_t.md.nolink)のいずれか +- `StorageOrder`は[`column_major_t`](column_major_t.md)または[`row_major_t`](row_major_t.md)のいずれか ## メンバ型 @@ -31,7 +31,7 @@ namespace std::linalg { |------|------|----------------| | `triangle_type` | `Triangle` | C++26 | | `storage_order_type` | `StorageOrder` | C++26 | -| [`mapping`](layout_blas_packed/mapping.md) | レイアウトマッピング | C++26 | +| [`mapping`](layout_blas_packed/mapping.md) | レイアウトマッピング (class template) | C++26 | ## 例 @@ -87,8 +87,8 @@ int main() ``` * linalg::layout_blas_packed[color ff0000] * linalg::lower_triangle_t[link lower_triangle_t.md.nolink] -* linalg::column_major_t[link column_major_t.md.nolink] -* linalg::row_major_t[link row_major_t.md.nolink] +* linalg::column_major_t[link column_major_t.md] +* linalg::row_major_t[link row_major_t.md] * mat.extent[link /reference/mdspan/mdspan/extent.md] * std::print[link /reference/print/print.md] * std::println[link /reference/print/println.md] diff --git a/reference/linalg/layout_blas_packed/mapping.md b/reference/linalg/layout_blas_packed/mapping.md index 7e1f272460..2074f2590e 100644 --- a/reference/linalg/layout_blas_packed/mapping.md +++ b/reference/linalg/layout_blas_packed/mapping.md @@ -44,7 +44,7 @@ namespace std::linalg { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`(constructor)`](mapping/op_constructor.md.nolink) | コンストラクタ | C++26 | +| [`(constructor)`](mapping/op_constructor.md) | コンストラクタ | C++26 | | `(destructor)` | デストラクタ | C++26 | | `operator=` | コピー代入演算子 | C++26 | @@ -53,8 +53,8 @@ namespace std::linalg { | 名前 | 説明 | 対応バージョン | |------|------|----------------| | `extents` | 多次元配列のサイズ`extents_`を取得する | C++26 | -| [`required_span_size`](mapping/required_span_size.md.nolink) | 要素アクセス範囲を取得する | C++26 | -| [`operator()`](mapping/op_call.md.nolink) | 多次元配列インデクスから要素位置へ変換する | C++26 | +| [`required_span_size`](mapping/required_span_size.md) | 要素アクセス範囲を取得する | C++26 | +| [`operator()`](mapping/op_call.md) | 多次元配列インデクスから要素位置へ変換する | C++26 | | `stride` | 行列サイズ1x1ならば`1` | C++26 | | `is_unique` | 行列サイズ1x1ならば`true` | C++26 | | `is_exhaustive` | `true`を返す | C++26 | @@ -67,7 +67,7 @@ namespace std::linalg { |------|------|----------------| | `is_always_unique` | 行または列の静的要素数が1ならば`true` | C++26 | | `is_always_exhaustive` | `true`を返す | C++26 | -| `is_always_strided` | `is_always_unique();` | C++26 | +| `is_always_strided` | `is_always_unique()` | C++26 | ## メンバ型 @@ -86,8 +86,8 @@ namespace std::linalg { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`operator==`](mapping/op_equal.md.nolink) | 等値比較 | C++26 | -| [`operator!=`](mapping/op_equal.md.nolink) | 非等値比較 (`==`により使用可能) | C++26 | +| [`operator==`](mapping/op_equal.md) | 等値比較 | C++26 | +| [`operator!=`](mapping/op_equal.md) | 非等値比較 (`==`により使用可能) | C++26 | ## 例 @@ -120,8 +120,6 @@ int main() ``` * linalg::layout_blas_packed[color ff0000] * LayoutPacked::mapping[color ff0000] -* linalg::upper_triangle_t[link upper_triangle_t.md.nolink] -* linalg::row_major_t[link row_major_t.md.nolink] * mat.extent[link /reference/mdspan/mdspan/extent.md] * std::print[link /reference/print/print.md] * std::println[link /reference/print/println.md] @@ -151,4 +149,3 @@ int main() ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) -- [P1674R2: Evolving a Standard C++ Linear Algebra Library from the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1674r2.html) diff --git a/reference/linalg/layout_blas_packed/mapping/op_call.md b/reference/linalg/layout_blas_packed/mapping/op_call.md new file mode 100644 index 0000000000..f19ba3761d --- /dev/null +++ b/reference/linalg/layout_blas_packed/mapping/op_call.md @@ -0,0 +1,81 @@ +# operator() +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* layout_blas_packed::mapping[meta class] +* cpp26[meta cpp] + +```cpp +template +constexpr index_type operator() (Index0 ind0, Index1 ind1) const noexcept; +``` + +## 概要 +2次元インデクス値`ind0, ind1`に対応する要素位置を求める。 + + +## テンプレートパラメータ制約 +- [`is_convertible_v`](/reference/type_traits/is_convertible.md)` == true` +- [`is_convertible_v`](/reference/type_traits/is_convertible.md)` == true` +- [`is_nothrow_convertible_v`](/reference/type_traits/is_nothrow_convertible.md)` == true` +- [`is_nothrow_convertible_v`](/reference/type_traits/is_nothrow_convertible.md)` == true` + + +## 事前条件 +`i`を[`extents_type::index-cast`](/reference/mdspan/extents/index-cast.md)`(ind0)`、`j`を[`extents_type::index-cast`](/reference/mdspan/extents/index-cast.md)`(ind1)`としたとき、2次元インデクス値`i, j`は多次元配列サイズ`extents_`における有効なインデクスであること。 + + +## 戻り値 +`N`を[`extetns_.extent`](/reference/mdspan/extents/extent.md)`(0)`としたとき +- `i > j`ならば`(*this)(j, i)`、そうでなければ +- 下記いずれの条件を満たすならば`i + j * (j + 1)/2`、そうでなければ + - [`is_same_v`](/reference/type_traits/is_same.md)` &&` [`is_same_v`](/reference/type_traits/is_same.md)``が`true`または + - [`is_same_v`](/reference/type_traits/is_same.md)` &&` [`is_same_v`](/reference/type_traits/is_same.md)``が`true` +- `j + N * i - i * (i + 1)/2` + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include +#include +namespace linalg = std::linalg; + +int main() +{ + using Ext3x3 = std::extents; + linalg::layout_blas_packed::mapping map; + // 0 1 2 + // 1 3 4 + // 2 4 5 + assert(map(0, 0) == 0); + assert(map(0, 1) == 1); + assert(map(2, 1) == 4); +} +``` +* mapping[color ff0000] +* linalg::layout_blas_packed[link ../../layout_blas_packed.md] + + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) diff --git a/reference/linalg/layout_blas_packed/mapping/op_constructor.md b/reference/linalg/layout_blas_packed/mapping/op_constructor.md new file mode 100644 index 0000000000..12c90f3e73 --- /dev/null +++ b/reference/linalg/layout_blas_packed/mapping/op_constructor.md @@ -0,0 +1,111 @@ +# コンストラクタ +* linalg[meta header] +* function[meta id-type] +* std::linalg[meta namespace] +* layout_blas_packed::mapping[meta class] +* cpp26[meta cpp] + +```cpp +constexpr mapping() noexcept = default; // (1) + +constexpr mapping(const mapping&) noexcept = default; // (2) + +constexpr mapping(const extents_type&) noexcept; // (3) + +template +constexpr explicit(!is_convertible_v) + mapping(const mapping& other) noexcept; // (4) +``` + +## 概要 +- (1) : デフォルトコンストラクタ +- (2) : コピーコンストラクタ +- (3) : [`extents`](/reference/mdspan/extents.md)からの変換コンストラクタ +- (4) : 他`mapping`からの変換コンストラクタ + + +## テンプレートパラメータ制約 +- (4) : [`is_convertible_v`](/reference/type_traits/is_convertible.md)`` + + +## 事前条件 +- (3) : + - Nを`e.extent(0)`としたとき、N * (N + 1)を`index_type`型で表現できること。 + - `e.extent(0) == e.extent(1)` +- (4) : + - Nを`other.extents().extent(0)`としたとき、N * (N + 1)を`index_type`型で表現できること。 + + +## 効果 +- (3) : `e`を用いて`extents_`を直接非リスト初期化する。 +- (4) : `other.extetns()`を用いて`extents_`を直接非リスト初期化する。 + + +## 例外 +投げない + + +## explicitになる条件 +- (4) : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`` + + +## 例 +```cpp example +#include +#include +#include +namespace linalg = std::linalg; + +using LayoutPacked = linalg::layout_blas_packed +using Ext3x3 = std::extents; +using ExtNxN = std::dextents; + +int main() +{ + // (1) : デフォルトコンストラクタ + { + LayoutPacked::mapping map1; + assert(map1.required_span_size() == 6); + } + // (2) : コピーコンストラクタ + { + LayoutPacked::mapping map2_a; + LayoutPacked::mapping map2_b = map2_a; + assert(map2_a == map2_b); + } + // (3) : extentsからの変換コンストラクタ + { + ExtNxN ext{3, 3}; + LayoutPacked::mapping map3 = ext; + assert(map3.extents() == ext); + } + // (4) : 他mappingからの変換コンストラクタ + { + LayoutPacked::mapping map4_a; + LayoutPacked::mapping map4_b = map4_a; + assert(map4_a == map4_b); + } +} +``` +* mapping[color ff0000] +* linalg::layout_blas_packed[link ../../layout_blas_packed.md] + + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) diff --git a/reference/linalg/layout_blas_packed/mapping/op_equal.md b/reference/linalg/layout_blas_packed/mapping/op_equal.md new file mode 100644 index 0000000000..e5cc2fc3b3 --- /dev/null +++ b/reference/linalg/layout_blas_packed/mapping/op_equal.md @@ -0,0 +1,69 @@ +# operator== +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* layout_blas_packed::mapping[meta class] +* cpp26[meta cpp] + +```cpp +template +friend constexpr bool + operator==(const mapping& x, const mapping& y) noexcept; + +//operator==により、以下のオーバーロードが使用可能になる +template +friend constexpr bool + operator!=(const mapping& x, const mapping& y) noexcept; +``` + +## 概要 +`mapping`の等値比較を行う。 + + +## 戻り値 +`x.extents() == y.extents()` + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include +#include +namespace linalg = std::linalg; + +int main() +{ + using LayoutPacked = linalg::layout_blas_packed; + using Ext3x3 = std::extents; + using ExtNxN = std::dextents; + LayoutPacked::mapping map1; + LayoutPacked::mapping map2{ExtNxN{3, 3}}; + assert(map1 == map2); +} +``` +* mapping[color ff0000] +* linalg::layout_blas_packed[link ../../layout_blas_packed.md] + + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) diff --git a/reference/linalg/layout_blas_packed/mapping/required_span_size.md b/reference/linalg/layout_blas_packed/mapping/required_span_size.md new file mode 100644 index 0000000000..5eceaf35bd --- /dev/null +++ b/reference/linalg/layout_blas_packed/mapping/required_span_size.md @@ -0,0 +1,59 @@ +# required_span_size +* linalg[meta header] +* function[meta id-type] +* std::linalg[meta namespace] +* layout_blas_packed::mapping[meta class] +* cpp26[meta cpp] + +```cpp +constexpr index_type required_span_size() const noexcept; +``` + +## 概要 +メモリブロックに対する要素アクセス範囲を取得する。 + + +## 戻り値 +[`extents_.extent`](/reference/mdspan/extents/extent.md)`(0) * (`[`extents_.extent`](/reference/mdspan/extents/extent.md)`(0) + 1)/2` + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include +#include +namespace linalg = std::linalg; + +int main() +{ + using Ext5x5 = std::extents; + linalg::layout_blas_packed::mapping map; + assert(map.required_span_size() == 15); +} +``` +* required_span_size()[color ff0000] +* linalg::layout_blas_packed[link ../../layout_blas_packed.md] + + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) diff --git a/reference/linalg/layout_transpose.md b/reference/linalg/layout_transpose.md index 0db977228a..33e6a26fbe 100644 --- a/reference/linalg/layout_transpose.md +++ b/reference/linalg/layout_transpose.md @@ -26,7 +26,7 @@ namespace std::linalg { | 名前 | 説明 | 対応バージョン | |------|------|----------------| | `nested_layout_type` | `Layout` | C++26 | -| [`mapping`](layout_transpose/mapping.md.nolink) | レイアウトマッピング | C++26 | +| [`mapping`](layout_transpose/mapping.md) | レイアウトマッピング (class template) | C++26 | ## バージョン @@ -42,6 +42,7 @@ namespace std::linalg { ## 関連項目 - [`mdspan`](/reference/mdspan/mdspan.md) +- [`transpose`](transpose.md.nolink) ## 参照 diff --git a/reference/linalg/layout_transpose/mapping.md b/reference/linalg/layout_transpose/mapping.md new file mode 100644 index 0000000000..1f7b649285 --- /dev/null +++ b/reference/linalg/layout_transpose/mapping.md @@ -0,0 +1,104 @@ +# mapping +* linalg[meta header] +* class template[meta id-type] +* std::linalg[meta namespace] +* layout_transpose[meta class] +* cpp26[meta cpp] + +```cpp +namespace std::linalg { + template + class layout_transpose { + template + struct mapping; + }; +} +``` +* layout_transpose[link ../layout_transpose.md] +* Extents[link /reference/mdspan/extents.md] + +## 概要 +`layout_transpose::mapping`は、任意の[レイアウトマッピングポリシー](/reference/mdspan/LayoutMappingPolicy.md)に対して行列転置操作を行った[レイアウトマッピング](/reference/mdspan/LayoutMapping.md)を表現するクラスである。 + +### 説明専用メンバ +説明専用メンバ型`nested-mapping-type`を`Layout::mapping>`とする。 + +`layout_transpose::mapping`クラステンプレートは、下記の説明専用メンバ変数を保持する。 + +- `nested-mapping_` : `nested-mapping-type`型の入れ子[レイアウトマッピング](/reference/mdspan/LayoutMapping.md) +- `extents_` : `extents_type`型の[多次元配列サイズ情報](/reference/mdspan/extents.md) + + +## 適格要件 +- `Extents`は[`extents`](/reference/mdspan/extents.md)の特殊化であること +- [`Extents::rank()`](/reference/mdspan/extents/rank.md) `== 2` + + +## メンバ関数 +### 構築・破棄 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`(constructor)`](mapping/op_constructor.md) | コンストラクタ | C++26 | +| `(destructor)` | デストラクタ | C++26 | + +### 観測 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `extents` | 多次元配列のサイズ`extents_`を取得する | C++26 | +| `required_span_size` | `nested-mapping_.required_span_size()` | C++26 | +| [`operator()`](mapping/op_call.md) | 多次元配列インデクスから要素位置へ変換する | C++26 | +| `nested_mapping` | 入れ子レイアウトマッピング`nested-mapping_`を取得する | C++26 | +| [`stride`](mapping/stride.md) | 指定次元のストライド幅を取得する | C++26 | +| `is_unique` | `nested-mapping_.is_unique()` | C++26 | +| `is_exhaustive` | `nested-mapping_.is_exhaustive()` | C++26 | +| `is_strided` | `nested-mapping_.is_strided()` | C++26 | + + +## 静的メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `is_always_unique` | `nested-mapping-type::is_always_unique` | C++26 | +| `is_always_exhaustive` | `nested-mapping-type::is_always_exhaustive` | C++26 | +| `is_always_strided` | `nested-mapping-type::is_always_strided` | C++26 | + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `extents_type` | [`Extents`](/reference/mdspan/extents.md) | C++26 | +| `index_type` | [`Extents::index_type`](/reference/mdspan/extents.md) | C++26 | +| `size_type` | [`Extents::size_type`](/reference/mdspan/extents.md) | C++26 | +| `rank_type` | [`Extents::rank_type`](/reference/mdspan/extents.md) | C++26 | +| `layout_type` | [`layout_transpose`](../layout_transpose.md) | C++26 | + + +## 非メンバ(*Hidden friends*)関数 +### 比較演算子 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`operator==`](mapping/op_equal.md) | 等値比較 | C++26 | +| [`operator!=`](mapping/op_equal.md) | 非等値比較 (`==`により使用可能) | C++26 | + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`transpose`](transpose.md.nolink) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) diff --git a/reference/linalg/layout_transpose/mapping/op_call.md b/reference/linalg/layout_transpose/mapping/op_call.md new file mode 100644 index 0000000000..63e62f983f --- /dev/null +++ b/reference/linalg/layout_transpose/mapping/op_call.md @@ -0,0 +1,33 @@ +# operator() +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* layout_transpose::mapping[meta class] +* cpp26[meta cpp] + +```cpp +template +constexpr index_type operator()(Index0 ind0, Index1 ind1) const; +``` + +## 概要 +2次元インデクス値`ind0, ind1`に対応する要素位置を求める。 + + +## 戻り値 +`nested-mapping_(ind1, ind0)` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) diff --git a/reference/linalg/layout_transpose/mapping/op_constructor.md b/reference/linalg/layout_transpose/mapping/op_constructor.md new file mode 100644 index 0000000000..92a7781e1d --- /dev/null +++ b/reference/linalg/layout_transpose/mapping/op_constructor.md @@ -0,0 +1,32 @@ +# コンストラクタ +* linalg[meta header] +* function[meta id-type] +* std::linalg[meta namespace] +* layout_transpose::mapping[meta class] +* cpp26[meta cpp] + +```cpp +constexpr explicit mapping(const nested-mapping-type& map); +``` + +## 概要 +入れ子[レイアウトマッピング](/reference/mdspan/LayoutMapping.md)からの変換コンストラクタ + + +## 効果 +説明専用メンバ`nested-mapping_`を`map`で、`extents_`を`transpose-extents(map.extents())`で初期化する。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) diff --git a/reference/linalg/layout_transpose/mapping/op_equal.md b/reference/linalg/layout_transpose/mapping/op_equal.md new file mode 100644 index 0000000000..3dbadebe0e --- /dev/null +++ b/reference/linalg/layout_transpose/mapping/op_equal.md @@ -0,0 +1,43 @@ +# operator== +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* layout_transpose::mapping[meta class] +* cpp26[meta cpp] + +```cpp +template +friend constexpr bool + operator==(const mapping& x, const mapping& y); + +//operator==により、以下のオーバーロードが使用可能になる +template +friend constexpr bool + operator!=(const mapping& x, const mapping& y); +``` + +## 概要 +`mapping`の等値比較を行う。 + + +## テンプレートパラメータ制約 +式`x.nested-mapping_ == y.nested-mapping_`が適格、かつ結果が`bool`に変換可能であること。 + + +## 戻り値 +`x.nested-mapping_ == y.nested-mapping_` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) diff --git a/reference/linalg/layout_transpose/mapping/stride.md b/reference/linalg/layout_transpose/mapping/stride.md new file mode 100644 index 0000000000..069cd35440 --- /dev/null +++ b/reference/linalg/layout_transpose/mapping/stride.md @@ -0,0 +1,36 @@ +# stride +* linalg[meta header] +* function[meta id-type] +* std::linalg[meta namespace] +* layout_transpose::mapping[meta class] +* cpp26[meta cpp] + +```cpp +constexpr index_type stride(size_t r) const; +``` + +## 概要 +`i`番目次元のストライド幅を取得する。 + + +## 事前条件 +`is_strided() == true`かつ`r < 2` + + +## 戻り値 +`nested-mapping_.stride(r == 0 ? 1 : 0)` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) diff --git a/reference/linalg/row_major_t.md b/reference/linalg/row_major_t.md new file mode 100644 index 0000000000..5ac84fc9f2 --- /dev/null +++ b/reference/linalg/row_major_t.md @@ -0,0 +1,38 @@ +# row_major_t +* linalg[meta header] +* class[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::linalg { + struct row_major_t { explicit row_major_t() = default; }; + + inline constexpr row_major_t row_major{}; +} +``` + +## 概要 +`row_major_t`は、[`layout_blas_packed`](layout_blas_packed.md)を指定した多次元配列ビュー[`mdspan`](/reference/mdspan/mdspan.md)において、要素の格納順が行優先(row-major)であることを指示するためのタグ型である。 + +`row_major_t`型の定数`row_major`が提供される。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`mdspan`](/reference/mdspan/mdspan.md) +- [`layout_blas_packed`](layout_blas_packed.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) From 8306cf4ebf6730e58192cbd3a1d57099c2631534 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Mon, 4 Mar 2024 04:23:31 +0900 Subject: [PATCH 0781/3948] =?UTF-8?q?zip=5Fview=E3=81=AE=E8=AA=AC=E6=98=8E?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20#1063?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23.md | 2 +- reference/flat_map/flat_map/insert.md | 4 +- reference/flat_map/flat_map/insert_range.md | 2 +- reference/iterator/iter_const_reference_t.md | 2 +- reference/ranges.md | 4 +- reference/ranges/elements_view.md | 3 + reference/ranges/zip_view.md | 138 +++++++++++++++++++ reference/tuple/tuple.md | 2 +- reference/utility/pair.md | 2 +- 9 files changed, 150 insertions(+), 9 deletions(-) create mode 100644 reference/ranges/zip_view.md diff --git a/lang/cpp23.md b/lang/cpp23.md index f73b4ba47a..56be147976 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -132,7 +132,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 - 順序付き連想コンテナの要素削除の処理について、一時オブジェクトのコストを抑える拡張が行われた - [`std::map::erase()`](/reference/map/map/erase.md) - [`std::map::extract()`](/reference/map/map/extract.md) -- [``](/reference/ranges.md)に、複数の範囲を綴じ合わせる[`std::views::zip`](/reference/ranges/zip_view.md.nolink)を追加 +- [``](/reference/ranges.md)に、複数の範囲を綴じ合わせる[`std::views::zip`](/reference/ranges/zip_view.md)を追加 - [``](/reference/ranges.md)に、複数の範囲の直積をとる[`std::views::cartesian_product`](/reference/ranges/cartesian_product_view.md.nolink)を追加 - Rangeから任意のコンテナに変換するRangeアダプタ[`std::ranges::to()`](/reference/ranges/to.md)を追加 - Rangeから任意のコンテナに変換するために、可変長のコンテナ ([`std::array`](/reference/array/array.md)以外) に、以下の機能を追加: diff --git a/reference/flat_map/flat_map/insert.md b/reference/flat_map/flat_map/insert.md index 276a869e13..554ad95efc 100644 --- a/reference/flat_map/flat_map/insert.md +++ b/reference/flat_map/flat_map/insert.md @@ -138,7 +138,7 @@ void insert(sorted_unique_t s, ``` * c.keys[link containers.md] * c.values[link containers.md] - * ranges::zip_view[link /ranges/zip_view.md.nolink] + * ranges::zip_view[link /ranges/zip_view.md] * ranges::unique[link /reference/algorithm/ranges_unique.md] * key_equiv[link key_equiv.md] * distance[link /reference/iterator/distance.md] @@ -171,7 +171,7 @@ void insert(sorted_unique_t s, ``` * c.keys[link containers.md] * c.values[link containers.md] - * ranges::zip_view[link /ranges/zip_view.md.nolink] + * ranges::zip_view[link /ranges/zip_view.md] * ranges::unique[link /reference/algorithm/ranges_unique.md] * key_equiv[link key_equiv.md] * distance[link /reference/iterator/distance.md] diff --git a/reference/flat_map/flat_map/insert_range.md b/reference/flat_map/flat_map/insert_range.md index 9abdd94079..5b15851cdc 100644 --- a/reference/flat_map/flat_map/insert_range.md +++ b/reference/flat_map/flat_map/insert_range.md @@ -51,7 +51,7 @@ Rangeを挿入し、コンテナを拡張する。 ``` * c.keys[link containers.md] * c.values[link containers.md] - * ranges::zip_view[link /ranges/zip_view.md.nolink] + * ranges::zip_view[link /ranges/zip_view.md] * ranges::unique[link /reference/algorithm/ranges_unique.md] * key_equiv[link key_equiv.md] * distance[link /reference/iterator/distance.md] diff --git a/reference/iterator/iter_const_reference_t.md b/reference/iterator/iter_const_reference_t.md index 459eb5016e..1b4264ac04 100644 --- a/reference/iterator/iter_const_reference_t.md +++ b/reference/iterator/iter_const_reference_t.md @@ -38,7 +38,7 @@ namespace std { |---|---|---|---| |[`std::vector`](/reference/vector/vector.md)|`bool`|`std::vector::reference`|`bool`| |`const std::vector`|`bool`|`bool`|`bool`| -|[`views::zip`](/reference/ranges/zip_view.md.nolink)|`std::tuple`|`std::tuple`|`std::tuple`| +|[`views::zip`](/reference/ranges/zip_view.md)|`std::tuple`|`std::tuple`|`std::tuple`| |[`views::enumrate`](/reference/ranges/enumrate_view.md.nolink)|`std::tuple`|`std::tuple`|`std::tuple`| 表中の`T, U`はそれそれの`view`に入力された範囲の値型、`D`は`views::enumrate`の入力範囲の`iter_difference_t`とする。 diff --git a/reference/ranges.md b/reference/ranges.md index 0df15fe7ae..d9f342e72a 100644 --- a/reference/ranges.md +++ b/reference/ranges.md @@ -339,8 +339,8 @@ range | adaptor(args...) | 名前 | 説明 | 対応バージョン | |--------------------------------------------------------|-------------------------------------------------------------------------------------|----------------| -| [`zip_view`](ranges/zip_view.md.nolink) | 2つのシーケンスから値を1つずつ取り出した`tuple`のビュー (class template) | C++23 | -| [`views::zip`](ranges/zip_view.md.nolink) | `zip_view`を生成する (customization point object) | C++23 | +| [`zip_view`](ranges/zip_view.md) | 2つのシーケンスから値を1つずつ取り出した`tuple`のビュー (class template) | C++23 | +| [`views::zip`](ranges/zip_view.md) | `zip_view`を生成する (customization point object) | C++23 | ### zip transform view diff --git a/reference/ranges/elements_view.md b/reference/ranges/elements_view.md index aed0aad529..4526000614 100644 --- a/reference/ranges/elements_view.md +++ b/reference/ranges/elements_view.md @@ -167,6 +167,9 @@ three - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +## 関連項目 +- [`zip_view`](zip_view.md) elements_viewの逆(要素からタプルを作る) + ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) - [C++20 ranges](https://techbookfest.org/product/5134506308665344) diff --git a/reference/ranges/zip_view.md b/reference/ranges/zip_view.md new file mode 100644 index 0000000000..272226e45d --- /dev/null +++ b/reference/ranges/zip_view.md @@ -0,0 +1,138 @@ +# zip_view +* ranges[meta header] +* std::ranges[meta namespace] +* class template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template + requires (view && ...) && (sizeof...(Views) > 0) + class zip_view : public view_interface> {…… }; // (1) + + namespace views { + inline constexpr /*unspecified*/ zip = /*unspecified*/; // (2) + } +} +``` + +## 概要 + +`zip_view`は複数のRangeから要素を1つずつ取得した[`tuple`](/reference/tuple/tuple.md)を要素とする[`view`](view.md)。 + +`zip_view`の要素を1つ取得するごとに、各Rangeの要素を1つずつ取得する。 + +zipするRangeのサイズが異なっている場合、`zip_view`のサイズはそれらの中で最小のサイズとなる。 + +- (1): `zip_view`のクラス定義 +- (2): `zip_view`を生成するRangeアダプタオブジェクト + +### Rangeコンセプト + +| borrowed | sized | output | input | forward | bidirectional | random_access | contiguous | common | viewable | view | +|----------|-------|--------|-------|---------|---------------|---------------|------------|--------|----------|------| +| | (1) | 〇 | 〇 | (2) | (3) | (4) | | (5) | ○ | ○ | + +- (1): zipするすべてのRangeが[`sized_range`](sized_range.md)のとき +- (2): zipするすべてのRangeが[`forward_range`](forward_range.md)のとき +- (3): zipするすべてのRangeが[`bidirectional_range`](bidirectional_range.md)のとき +- (4): zipするすべてのRangeが[`random_access`](forward_range.md)のとき +- (5): *zip-is-common*のとき + +## 効果 + +- (2): 式`views::zip(Es...)`の効果は[`zip_view{Es...}`](zip_view/op_constructor.md.nolink)と等しい。 + +## 備考 + +本説明に用いる説明専用要素を以下のように定義する。 + +```cpp +namespace std::ranges { + // 説明専用 + template + concept zip-is-common = + (sizeof...(Rs) == 1 && (common_range && ...)) || + (!(bidirectional_range && ...) && (common_range && ...)) || + ((random_access_range && ...) && (sized_range && ...)); +} +``` + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|--------------------------------------------------|----------------------------------|----------------| +| [`(constructor)`](zip_view/op_constructor.md.nolink) | コンストラクタ | C++23 | +| [`base`](zip_view/base.md.nolink) | `V`の参照を取得する | C++23 | +| [`begin`](zip_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++23 | +| [`end`](zip_view/end.md.nolink) | 番兵を取得する | C++23 | +| [`size`](take_view/size.md.nolink) | 要素数を取得する | C++23 | + +## 継承しているメンバ関数 + +| 名前 | 説明 | 対応バージョン | +|----------------------------------------------|-----------------------------------|----------------| +| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++20 | +| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++20 | +| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | +| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | +| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | + +## 推論補助 + +| 名前 | 説明 | 対応バージョン | +|-------------------------------------------------------|------------------------------|----------------| +| [`(deduction_guide)`](zip_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2}; + const std::list l = {'a', 'b', 'c'}; + + for (auto&& t : std::views::zip(v, l)) { + println("{}", t); + } + + for (auto&& [i, c] : std::views::zip(v, l)) { + i *= 10; // 要素を書き換えても良い + } + + for (auto&& t : std::views::zip(v, l)) { + println("{}", t); + } +} +``` +* std::views::zip[color ff0000] + +### 出力 +``` +(1, 'a') +(2, 'b') +(10, 'a') +(20, 'b') +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 13.2 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 関連項目 +- [`elements_view`](elements_view.md) zipの逆(タプルから要素を取り出す) +- [`zip_transform_view`](zip_transform_view.md.nolink) zipして関数を適用する + +## 参照 +- [N4950 26 Ranges library](https://timsong-cpp.github.io/cppwp/n4950/ranges) diff --git a/reference/tuple/tuple.md b/reference/tuple/tuple.md index 517715021e..cd3cb2f7eb 100644 --- a/reference/tuple/tuple.md +++ b/reference/tuple/tuple.md @@ -146,7 +146,7 @@ hello ### プロキシ参照としての使い方(C++23) -C++23 で[`zip_view`](/reference/ranges/zip_view.md.nolink)などが追加されたことに伴い、すべての要素がプロキシ参照であるような`tuple`は[プロキシ参照](/reference/iterator/indirectly_writable.md)として使用することが出来るようになった。 +C++23 で[`zip_view`](/reference/ranges/zip_view.md)などが追加されたことに伴い、すべての要素がプロキシ参照であるような`tuple`は[プロキシ参照](/reference/iterator/indirectly_writable.md)として使用することが出来るようになった。 ```cpp example #include diff --git a/reference/utility/pair.md b/reference/utility/pair.md index 8cab65a198..3310356283 100644 --- a/reference/utility/pair.md +++ b/reference/utility/pair.md @@ -152,7 +152,7 @@ hello ### プロキシ参照としての使い方(C++23) -C++23 で[`zip_view`](/reference/ranges/zip_view.md.nolink)などが追加されたことに伴い、どちらの要素も[プロキシ参照](/reference/iterator/indirectly_writable.md)であるような`pair`は[プロキシ参照](/reference/iterator/indirectly_writable.md)として使用することが出来るようになった。 +C++23 で[`zip_view`](/reference/ranges/zip_view.md)などが追加されたことに伴い、どちらの要素も[プロキシ参照](/reference/iterator/indirectly_writable.md)であるような`pair`は[プロキシ参照](/reference/iterator/indirectly_writable.md)として使用することが出来るようになった。 ```cpp example #include From 78b8da4fae548d6f482f1318d860bd39eab2d978 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Mon, 4 Mar 2024 04:32:26 +0900 Subject: [PATCH 0782/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20#1063?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map/insert.md | 4 ++-- reference/flat_map/flat_map/insert_range.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/flat_map/flat_map/insert.md b/reference/flat_map/flat_map/insert.md index 554ad95efc..ad5258b082 100644 --- a/reference/flat_map/flat_map/insert.md +++ b/reference/flat_map/flat_map/insert.md @@ -138,7 +138,7 @@ void insert(sorted_unique_t s, ``` * c.keys[link containers.md] * c.values[link containers.md] - * ranges::zip_view[link /ranges/zip_view.md] + * ranges::zip_view[link /reference/ranges/zip_view.md] * ranges::unique[link /reference/algorithm/ranges_unique.md] * key_equiv[link key_equiv.md] * distance[link /reference/iterator/distance.md] @@ -171,7 +171,7 @@ void insert(sorted_unique_t s, ``` * c.keys[link containers.md] * c.values[link containers.md] - * ranges::zip_view[link /ranges/zip_view.md] + * ranges::zip_view[link /reference/ranges/zip_view.md] * ranges::unique[link /reference/algorithm/ranges_unique.md] * key_equiv[link key_equiv.md] * distance[link /reference/iterator/distance.md] diff --git a/reference/flat_map/flat_map/insert_range.md b/reference/flat_map/flat_map/insert_range.md index 5b15851cdc..5ad23d7f2b 100644 --- a/reference/flat_map/flat_map/insert_range.md +++ b/reference/flat_map/flat_map/insert_range.md @@ -51,7 +51,7 @@ Rangeを挿入し、コンテナを拡張する。 ``` * c.keys[link containers.md] * c.values[link containers.md] - * ranges::zip_view[link /ranges/zip_view.md] + * ranges::zip_view[link /reference/ranges/zip_view.md] * ranges::unique[link /reference/algorithm/ranges_unique.md] * key_equiv[link key_equiv.md] * distance[link /reference/iterator/distance.md] From 8fc3e56527c951831e16575c61ea40840d7cc837 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Mon, 4 Mar 2024 12:34:01 +0900 Subject: [PATCH 0783/3948] =?UTF-8?q?string::substr()=20:=20=E5=8F=B3?= =?UTF-8?q?=E8=BE=BA=E5=80=A4=E3=82=AA=E3=83=BC=E3=83=90=E3=83=BC=E3=83=AD?= =?UTF-8?q?=E3=83=BC=E3=83=89=E3=81=AE=E5=8B=95=E4=BD=9C=E3=81=AB=E3=81=A4?= =?UTF-8?q?=E3=81=84=E3=81=A6=E8=BF=BD=E8=A8=98=E3=81=A8=E4=BE=8B=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/string/basic_string/substr.md | 32 ++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/reference/string/basic_string/substr.md b/reference/string/basic_string/substr.md index a7ad8c2185..44120e2a81 100644 --- a/reference/string/basic_string/substr.md +++ b/reference/string/basic_string/substr.md @@ -49,7 +49,7 @@ constexpr basic_string ## 備考 C++23から(2)[右辺値修飾オーバーロード](/lang/cpp11/ref_qualifier_for_this.md)の追加にともない、従来からある(1)はconst左辺値参照オーバーロードに変更される。 -同時にメンバ関数`substr`のライブラリ仕様記述は、新たに追加された`basic_string`コンストラクタを用いて書き直されるものの、基本的な動作はC++20までと同一である。 +同時にメンバ関数`substr`のライブラリ仕様記述は、新たに追加された`basic_string`コンストラクタを用いて書き直される。その後でも基本的な動作はC++20までと同一であるが、(2)のオーバーロードでは右辺値の`std::string`からの部分文字列切り出しが効率化(余計なコピー/アロケーションの削減)される。 ## 例 @@ -82,6 +82,36 @@ llo llo ``` +## C++23の右辺値参照修飾オーバーロード追加後の変更例 + +```cpp +#include +#include + +// 右辺値stringを返す関数 +auto f() -> std::string; + +int main() +{ + std::string s = "some long string that forces allocation"; + + // sから部分文字列のstringをコピーして作成、sは変更されない(この振る舞いは変わらない) + std::string result1 = s.substr(5, 4); + + // C++20 : 一時オブジェクトのstringから部分文字列のstringをコピーして作成 + // C++23 : 一時オブジェクトのstringのリソースを再利用して部分文字列を保持するstringオブジェクトを作成 + std::string result2 = f().substr(5, 4); + + // C++20 : 一時オブジェクトのstringから部分文字列のstringをコピーして作成 + // C++23 : 一時オブジェクトのstringのリソースを再利用して部分文字列を保持するstringオブジェクトを作成 + std::string result3 = std::string("hello").substr(5, 4); + + // C++20 : sから部分文字列のstringをコピーして作成、sは変更されない + // C++23 : sのリソースを再利用して部分文字列を保持するstringオブジェクトを作成、aは有効だが未規定な状態となる(C++23における動作変更) + std::string result4 = std::move(s).substr(5, 4); +} +``` + ## 参照 - [P0980R1 Making `std::string` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0980r1.pdf) - [P2438R2 `std::string::substr() &&`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2438r2.html) From 6dbea0082174c2943618c6410a562c8463d8698a Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Mon, 4 Mar 2024 22:53:24 +0900 Subject: [PATCH 0784/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/zip_view.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/ranges/zip_view.md b/reference/ranges/zip_view.md index 272226e45d..cadd764191 100644 --- a/reference/ranges/zip_view.md +++ b/reference/ranges/zip_view.md @@ -36,7 +36,7 @@ zipするRangeのサイズが異なっている場合、`zip_view`のサイズ - (1): zipするすべてのRangeが[`sized_range`](sized_range.md)のとき - (2): zipするすべてのRangeが[`forward_range`](forward_range.md)のとき - (3): zipするすべてのRangeが[`bidirectional_range`](bidirectional_range.md)のとき -- (4): zipするすべてのRangeが[`random_access`](forward_range.md)のとき +- (4): zipするすべてのRangeが[`random_access_range`](random_access_range.md)のとき - (5): *zip-is-common*のとき ## 効果 From 1495bf6e2dc2fc68ac68fe77cfedca470172a9ce Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 5 Mar 2024 15:05:15 +0900 Subject: [PATCH 0785/3948] =?UTF-8?q?C++11=20=E5=8F=B3=E8=BE=BA=E5=80=A4?= =?UTF-8?q?=E5=8F=82=E7=85=A7=20:=20=E9=96=A2=E9=80=A3=E9=A0=85=E7=9B=AE?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp11/rvalue_ref_and_move_semantics.md | 1 + 1 file changed, 1 insertion(+) diff --git a/lang/cpp11/rvalue_ref_and_move_semantics.md b/lang/cpp11/rvalue_ref_and_move_semantics.md index d258668b87..090492e43a 100644 --- a/lang/cpp11/rvalue_ref_and_move_semantics.md +++ b/lang/cpp11/rvalue_ref_and_move_semantics.md @@ -382,6 +382,7 @@ C++11で非推奨となった`std::auto_ptr`で実現されていた。 - [`move_backward`](/reference/algorithm/move_backward.md) - [`unique_ptr`](/reference/memory/unique_ptr.md) - [`move_iterator`](/reference/iterator/move_iterator.md) +- [C++23 暗黙的なムーブを簡略化](/lang/cpp23/simpler_implicit_move.md) ## 参照 From c27c81f982304152ebb9a2bff52dbe06fb24c198 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 5 Mar 2024 21:29:31 +0900 Subject: [PATCH 0786/3948] linalg: transposed(#1233) --- reference/linalg.md | 12 +- reference/linalg/layout_transpose.md | 4 +- reference/linalg/layout_transpose/mapping.md | 6 +- .../mapping/op_constructor.md | 2 +- .../layout_transpose/transpose-extents.md | 32 +++++ reference/linalg/transposed.md | 120 ++++++++++++++++++ 6 files changed, 162 insertions(+), 14 deletions(-) create mode 100644 reference/linalg/layout_transpose/transpose-extents.md create mode 100644 reference/linalg/transposed.md diff --git a/reference/linalg.md b/reference/linalg.md index 6fa205bfd8..f08d71f9ef 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -32,13 +32,13 @@ BLAS互換アルゴリズムは、演算対象データの次元数や計算オ | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`layout_blas_packed`](linalg/layout_blas_packed.md) | 行列要素のBLAS互換パックレイアウトに対応する[レイアウトマッピングポリシー](mdspan/LayoutMappingPolicy.md) (class template) | C++26 | -| `scaled` | 要素値をスカラ倍した読み取り専用`std::mdspan`を作る (function template) | C++26 | -| `scaled_accessor` | `scaled`関数用の[アクセサポリシー](mdspan/AccessorPolicy.md) (class template) | C++26 | -| `conjugated_accessor` | `conjugated`関数用の[アクセサポリシー](mdspan/AccessorPolicy.md) (class template) | C++26 | -| `conjugated` | 読み取り専用の複素共役ビュー`std::mdspan`を作る (function template) | C++26 | +| [`scaled_accessor`](linalg/scaled_accessor.md.nolink) | `scaled`関数用の[アクセサポリシー](mdspan/AccessorPolicy.md) (class template) | C++26 | +| [`scaled`](linalg/scaled.md.nolink) | 要素値をスカラ倍した読み取り専用`std::mdspan`を作る (function template) | C++26 | +| [`conjugated_accessor`](linalg/conjugated_accessor.md.nolink) | `conjugated`関数用の[アクセサポリシー](mdspan/AccessorPolicy.md) (class template) | C++26 | +| [`conjugated`](linalg/conjugated.md.nolink) | 読み取り専用の複素共役ビュー`std::mdspan`を作る (function template) | C++26 | | [`layout_transpose`](linalg/layout_transpose.md) | `transposed`関数用の[レイアウトマッピングポリシー](mdspan/LayoutMappingPolicy.md) (class template) | C++26 | -| `transposed` | 2次元`std::mdspan`の行列転置ビューを作る (function template) | C++26 | -| `conjugate_transposed` | 読み取り専用の複素共役転置ビュー`std::mdspan`を作る (function template) | C++26 | +| [`transposed`](linalg/transposed.md) | 2次元`std::mdspan`の行列転置ビューを作る (function template) | C++26 | +| [`conjugate_transposed`](linalg/conjugate_transposed.md.nolink) | 読み取り専用の複素共役転置ビュー`std::mdspan`を作る (function template) | C++26 | ## BLAS 1アルゴリズム diff --git a/reference/linalg/layout_transpose.md b/reference/linalg/layout_transpose.md index 33e6a26fbe..c652870be2 100644 --- a/reference/linalg/layout_transpose.md +++ b/reference/linalg/layout_transpose.md @@ -14,7 +14,7 @@ namespace std::linalg { ## 概要 `layout_transpose`は、多次元配列ビュー[`mdspan`](/reference/mdspan/mdspan.md)を用いた行列(matrix)において、転置行列を表現する[レイアウトマッピングポリシー](/reference/mdspan/LayoutMappingPolicy.md)クラスである。 -`layout_transpose`クラステンプレートは、行列転置操作[`transpose`](transpose.md.nolink)の戻り値型として利用される。 +`layout_transpose`クラステンプレートは、行列転置操作[`transposed`](transposed.md)の戻り値型として利用される。 ## 適格要件 @@ -42,7 +42,7 @@ namespace std::linalg { ## 関連項目 - [`mdspan`](/reference/mdspan/mdspan.md) -- [`transpose`](transpose.md.nolink) +- [`transposed`](transposed.md) ## 参照 diff --git a/reference/linalg/layout_transpose/mapping.md b/reference/linalg/layout_transpose/mapping.md index 1f7b649285..7ee2cb39ce 100644 --- a/reference/linalg/layout_transpose/mapping.md +++ b/reference/linalg/layout_transpose/mapping.md @@ -21,7 +21,7 @@ namespace std::linalg { `layout_transpose::mapping`は、任意の[レイアウトマッピングポリシー](/reference/mdspan/LayoutMappingPolicy.md)に対して行列転置操作を行った[レイアウトマッピング](/reference/mdspan/LayoutMapping.md)を表現するクラスである。 ### 説明専用メンバ -説明専用メンバ型`nested-mapping-type`を`Layout::mapping>`とする。 +説明専用メンバ型`nested-mapping-type`を`Layout::mapping<`[`transpose-extents-t`](transpose-extents.md)`>`とする。 `layout_transpose::mapping`クラステンプレートは、下記の説明専用メンバ変数を保持する。 @@ -96,9 +96,5 @@ namespace std::linalg { - [Visual C++](/implementation.md#visual_cpp): ?? -## 関連項目 -- [`transpose`](transpose.md.nolink) - - ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) diff --git a/reference/linalg/layout_transpose/mapping/op_constructor.md b/reference/linalg/layout_transpose/mapping/op_constructor.md index 92a7781e1d..f9e3237804 100644 --- a/reference/linalg/layout_transpose/mapping/op_constructor.md +++ b/reference/linalg/layout_transpose/mapping/op_constructor.md @@ -14,7 +14,7 @@ constexpr explicit mapping(const nested-mapping-type& map); ## 効果 -説明専用メンバ`nested-mapping_`を`map`で、`extents_`を`transpose-extents(map.extents())`で初期化する。 +説明専用メンバ`nested-mapping_`を`map`で、`extents_`を[`transpose-extents`](../transpose-extents.md)`(map.extents())`で初期化する。 ## バージョン diff --git a/reference/linalg/layout_transpose/transpose-extents.md b/reference/linalg/layout_transpose/transpose-extents.md new file mode 100644 index 0000000000..0ce6db8706 --- /dev/null +++ b/reference/linalg/layout_transpose/transpose-extents.md @@ -0,0 +1,32 @@ +# transpose-extents +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + +```cpp +template +constexpr extents + transpose-extents(const extents& in); + +template +using transpose-extents-t = + decltype(transpose-extents(declval())); +``` +* extents[link /reference/mdspan/extents.md] + +## 概要 +行列転置操作の動作説明に用いる説明専用の関数テンプレート + + +## 戻り値 +[`extents`](/reference/mdspan/extents.md)`(in.extent(1), in.extent(0))` + + +## バージョン +### 言語 +- C++26 + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) diff --git a/reference/linalg/transposed.md b/reference/linalg/transposed.md new file mode 100644 index 0000000000..bfcfede270 --- /dev/null +++ b/reference/linalg/transposed.md @@ -0,0 +1,120 @@ +# transposed +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + +```cpp +template +constexpr auto transposed( + mdspan a); +``` +* Extents[link /reference/mdspan/extents.md] +* Layout[link /reference/mdspan/LayoutMappingPolicy.md] +* Accessor[link /reference/mdspan/AccessorPolicy.md] +* mdspan[link /reference/mdspan/mdspan.md] + +## 概要 +行列(matrix)を表現する2次元配列ビュー[`std::mdspan`](/reference/mdspan/mdspan.md)に対して、転置行列(transposed matrix)を表現する新しい2次元配列ビューを作る。 + +本操作により`mdspan`参照先メモリブロックが書き換えられることはなく、戻り値`mdspan`を介した要素アクセス時に行/列を入れ替える転置操作が行われる。 + + +## 適格要件 +[`Extents::rank()`](/reference/mdspan/extents/rank.md) `== 2` + + +## 戻り値 +説明用の型`ReturnExtents`を[`transpose-extents-t`](layout_transpose/transpose-extents.md)``、型`R`を[`mdspan`](/reference/mdspan/mdspan.md)``、型`ReturnLayout`を下記の通りとする。 + +- `Layout`が[`layout_left`](/reference/mdspan/layout_left.md)のとき、[`layout_right`](/reference/mdspan/layout_right.md) +- `Layout`が[`layout_right`](/reference/mdspan/layout_right.md)のとき、[`layout_left`](/reference/mdspan/layout_left.md) +- `Layout`が[`layout_stride`](/reference/mdspan/layout_stride.md)のとき、`layout_stride` +- `Layout`が[`layout_blas_packed`](layout_blas_packed.md)``のとき、`layout_blas_packed` + - `OppositeTriangle`は[`conditional_t`](/reference/type_traits/conditional.md)`<`[`is_same_v`](/reference/type_traits/is_same.md)`, lower_triangle_t, upper_triangle_t>` + - `OppositeStorageOrder`は[`conditional_t`](/reference/type_traits/conditional.md)`<`[`is_same_v`](/reference/type_traits/is_same.md)`, row_major_t, column_major_t>` +- `Layout`が[`layout_transpose`](layout_transpose.md)``のとき、`NestedLayout` +- そうでなければ、[`layout_transpose`](layout_transpose.md)`` + +型`ReturnMapping`を`ReturnLayout::mapping`として、次の値を返す。 + +- `Layout`が[`layout_left`](/reference/mdspan/layout_left.md)または[`layout_right`](/reference/mdspan/layout_right.md)または[`layout_blas_packed`](layout_blas_packed.md)の特殊化であるとき、 + ```cpp + R(a.data_handle(), + ReturnMapping(transpose-extents(a.mapping().extents())), + a.accessor()) + ``` + * transpose-extents[link layout_transpose/transpose-extents.md] +- `Layout`が[`layout_stride`](/reference/mdspan/layout_stride.md)の特殊化であるとき、 + ```cpp + R(a.data_handle(), + ReturnMapping(transpose-extents(a.mapping().extents()), + array{a.mapping().stride(1), a.mapping().stride(0)}), + a.accessor()) + ``` + * transpose-extents[link layout_transpose/transpose-extents.md] +- `Layout`が[`layout_transpose`](layout_transpose.md)の特殊化であるとき、 + ```cpp + R(a.data_handle(), a.mapping().nested_mapping(), a.accessor()) + ``` +- それ以外のとき、 + ```cpp + R(a.data_handle(), ReturnMapping(a.mapping()), a.accessor()) + ``` + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + int arr[] = {1, 2, 3, 4, 5, 6}; + using Ext2D = std::dextents; + + std::mdspan mat0{arr, Ext2D{2, 3}}; + assert(mat0.extent(0) == 2 && mat0.extent(1) == 3); + // 1 2 + // 3 4 + // 5 6 + + auto mat1 = std::linalg::transposed(mat0); + assert(mat1.extent(0) == 3 && mat1.extent(1) == 2); + // 1 3 5 + // 2 4 6 + + // transposed戻り値は書き換え可能なmdspan + mat0[1, 2] = 42; // 6 -> 42 + asssert((mat1[2, 1] == 42)); +} +``` +* std::linalg::transposed[color ff0000] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`mdspan`](/reference/mdspan/mdspan.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) +- [P1674R2: Evolving a Standard C++ Linear Algebra Library from the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1674r2.html) From df36c82652243600fa76ef8b2b36689dfe4a0f24 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Wed, 6 Mar 2024 01:53:27 +0900 Subject: [PATCH 0787/3948] =?UTF-8?q?zip=5Fview=E3=81=AE=E4=BE=8B=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/zip_view.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/reference/ranges/zip_view.md b/reference/ranges/zip_view.md index cadd764191..a56ada8c47 100644 --- a/reference/ranges/zip_view.md +++ b/reference/ranges/zip_view.md @@ -91,33 +91,33 @@ namespace std::ranges { #include #include #include +#include #include int main() { std::vector v = {1, 2}; const std::list l = {'a', 'b', 'c'}; - for (auto&& t : std::views::zip(v, l)) { - println("{}", t); - } + std::println("{}", std::views::zip(v, l)); for (auto&& [i, c] : std::views::zip(v, l)) { i *= 10; // 要素を書き換えても良い } + std::println("{}", std::views::zip(v, l)); - for (auto&& t : std::views::zip(v, l)) { - println("{}", t); - } + // zipした結果を連想コンテナに変換する + const auto m = std::views::zip(v, l) | std::ranges::to>(); + std::println("{}", m); } ``` * std::views::zip[color ff0000] +* std::ranges::to[link to.md] ### 出力 ``` -(1, 'a') -(2, 'b') -(10, 'a') -(20, 'b') +[(1, 'a'), (2, 'b')] +[(10, 'a'), (20, 'b')] +{20: 'b', 10: 'a'} ``` ## バージョン From d43097b5fd5d5a7f7ee5df9ab3213fdadc17a9d6 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Wed, 6 Mar 2024 02:15:39 +0900 Subject: [PATCH 0788/3948] Update zip_view.md --- reference/ranges/zip_view.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/ranges/zip_view.md b/reference/ranges/zip_view.md index a56ada8c47..f7ebc4be80 100644 --- a/reference/ranges/zip_view.md +++ b/reference/ranges/zip_view.md @@ -25,7 +25,7 @@ namespace std::ranges { zipするRangeのサイズが異なっている場合、`zip_view`のサイズはそれらの中で最小のサイズとなる。 - (1): `zip_view`のクラス定義 -- (2): `zip_view`を生成するRangeアダプタオブジェクト +- (2): `zip_view`を生成するカスタマイゼーションポイントオブジェクト(Rangeアダプタオブジェクトではない) ### Rangeコンセプト From 1e44b927e9748b698742b2b06f2130928913a3a6 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Wed, 6 Mar 2024 02:39:55 +0900 Subject: [PATCH 0789/3948] =?UTF-8?q?views::zip=E3=81=AE=E5=8A=B9=E6=9E=9C?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/zip_view.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/reference/ranges/zip_view.md b/reference/ranges/zip_view.md index f7ebc4be80..98a98fd1c8 100644 --- a/reference/ranges/zip_view.md +++ b/reference/ranges/zip_view.md @@ -41,7 +41,10 @@ zipするRangeのサイズが異なっている場合、`zip_view`のサイズ ## 効果 -- (2): 式`views::zip(Es...)`の効果は[`zip_view{Es...}`](zip_view/op_constructor.md.nolink)と等しい。 +- (2): 式`views::zip(Es...)`の効果は次の通り + - `Es`が空でないとき、`zip_view<`[`views​::​all_t`](all.md)`...>(Es...)` と等しい + - `Es`が空のとき、`auto(`[`views​::empty`](empty_view.md)`<`[`tuple`](/reference/tuple/tuple.md)`<>>)` と等しい + ## 備考 @@ -63,7 +66,6 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |--------------------------------------------------|----------------------------------|----------------| | [`(constructor)`](zip_view/op_constructor.md.nolink) | コンストラクタ | C++23 | -| [`base`](zip_view/base.md.nolink) | `V`の参照を取得する | C++23 | | [`begin`](zip_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++23 | | [`end`](zip_view/end.md.nolink) | 番兵を取得する | C++23 | | [`size`](take_view/size.md.nolink) | 要素数を取得する | C++23 | @@ -108,6 +110,9 @@ int main() { // zipした結果を連想コンテナに変換する const auto m = std::views::zip(v, l) | std::ranges::to>(); std::println("{}", m); + + // 何もzipしていないときは空になる + std::println("{}", std::views::zip()); } ``` * std::views::zip[color ff0000] From d02a7eee2d8effa7a2be7795cc280e86a4c24bf8 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Wed, 6 Mar 2024 03:39:59 +0900 Subject: [PATCH 0790/3948] zip_tramsform_view #1063 --- GLOBAL_QUALIFY_LIST.txt | 6 +- reference/algorithm/ranges_transform.md | 1 + reference/ranges.md | 6 +- reference/ranges/transform_view.md | 1 + reference/ranges/zip_transform_view.md | 117 ++++++++++++++++++++++++ reference/ranges/zip_view.md | 2 +- 6 files changed, 128 insertions(+), 5 deletions(-) create mode 100644 reference/ranges/zip_transform_view.md diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 31799d0595..4f53f1f00e 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -74,6 +74,8 @@ * [link /reference/concepts.md] * common_reference_with[link /reference/concepts/common_reference_with.md] * common_with[link /reference/concepts/common_with.md] + * invocable[link /reference/concepts/invocable.md] + * regular_invocable[link /reference/concepts/invocable.md] * same_as[link /reference/concepts/same_as.md] * [link /reference/condition_variable.md] * std::condition_variable[link /reference/condition_variable/condition_variable.md] @@ -238,10 +240,12 @@ * std::tuple[link /reference/tuple/tuple.md] * std::tie[link /reference/tuple/tie.md] * [link /reference/type_traits.md] + * invoke_result_t[link /reference/type_traits/invoke_result.md] + * is_object_v[link /reference/type_traits/is_object.md] * remove_cvref_t[link /reference/type_traits/remove_cvref.md] * std::false_type[link /reference/type_traits/false_type.md] - * std::is_same[link /reference/type_traits/is_same.md] * std::is_same_v[link /reference/type_traits/is_same.md] + * std::is_same[link /reference/type_traits/is_same.md] * std::true_type[link /reference/type_traits/true_type.md] * [link /reference/typeindex.md] * [link /reference/typeinfo.md] diff --git a/reference/algorithm/ranges_transform.md b/reference/algorithm/ranges_transform.md index dbb995a60e..0a52b9b52a 100644 --- a/reference/algorithm/ranges_transform.md +++ b/reference/algorithm/ranges_transform.md @@ -212,3 +212,4 @@ cccc ## 関連項目 - [`transform_view`](/reference/ranges/transform_view.md) : 要素に関数を適用した結果をビューとして提供する +- [`zip_transform_view`](/reference/ranges/zip_transform_view.md) : 複数の範囲から要素を取り出し、関数を適用した結果をビューとして提供する diff --git a/reference/ranges.md b/reference/ranges.md index d9f342e72a..fb89a28136 100644 --- a/reference/ranges.md +++ b/reference/ranges.md @@ -339,15 +339,15 @@ range | adaptor(args...) | 名前 | 説明 | 対応バージョン | |--------------------------------------------------------|-------------------------------------------------------------------------------------|----------------| -| [`zip_view`](ranges/zip_view.md) | 2つのシーケンスから値を1つずつ取り出した`tuple`のビュー (class template) | C++23 | +| [`zip_view`](ranges/zip_view.md) | 複数のシーケンスから値を1つずつ取り出した`tuple`のビュー (class template) | C++23 | | [`views::zip`](ranges/zip_view.md) | `zip_view`を生成する (customization point object) | C++23 | ### zip transform view | 名前 | 説明 | 対応バージョン | |--------------------------------------------------------|-------------------------------------------------------------------------------------|----------------| -| [`zip_transform_view`](ranges/zip_transform_view.md.nolink) | 2つのシーケンスから値を1つずつ取り出し、関数を適用した結果のビュー (class template) | C++23 | -| [`views::zip_transform`](ranges/zip_transform_view.md.nolink) | `zip_transform_view`を生成する (customization point object) | C++23 | +| [`zip_transform_view`](ranges/zip_transform_view.md) | 複数のシーケンスから値を1つずつ取り出し、関数を適用した結果のビュー (class template) | C++23 | +| [`views::zip_transform`](ranges/zip_transform_view.md) | `zip_transform_view`を生成する (customization point object) | C++23 | ### adjacent view diff --git a/reference/ranges/transform_view.md b/reference/ranges/transform_view.md index fd2d1accba..d1a9c73cd6 100644 --- a/reference/ranges/transform_view.md +++ b/reference/ranges/transform_view.md @@ -150,6 +150,7 @@ int main() { ## 関連項目 - [`std::transform`](/reference/algorithm/transform.md), [`std::ranges::transform`](/reference/algorithm/ranges_transform.md): Rangeの要素に先行評価で関数を適用する標準アルゴリズム関数 +- [`zip_transform_view`](zip_transform_view.md) : 複数の範囲から要素を取り出し、関数を適用した結果をビューとして提供する ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/zip_transform_view.md b/reference/ranges/zip_transform_view.md new file mode 100644 index 0000000000..4a3a488bc7 --- /dev/null +++ b/reference/ranges/zip_transform_view.md @@ -0,0 +1,117 @@ +# zip_transform_view +* ranges[meta header] +* std::ranges[meta namespace] +* class template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template + requires (view && ...) && (sizeof...(Views) > 0) && is_object_v && + regular_invocable...> && + can-reference...>> + class zip_transform_view : public view_interface> {…… }; // (1) + + namespace views { + inline constexpr /*unspecified*/ zip_transform = /*unspecified*/; // (2) + } +} +``` +* can-reference[link /reference/iterator/dereferenceable.md] + +## 概要 + +`zip_transform_view`は複数のRangeから要素を1つずつ取得し、それらを引数として関数を呼び出した結果を要素とする[`view`](view.md)。 + +`zip_transform_view`の要素を1つ取得するごとに、各Rangeの要素を1つずつ取得する。 + +zipするRangeのサイズが異なっている場合、`zip_transform_view`のサイズはそれらの中で最小のサイズとなる。 + +- (1): `zip_transform_view`のクラス定義 +- (2): `zip_transform_view`を生成するカスタマイゼーションポイントオブジェクト(Rangeアダプタオブジェクトではない) + + +### Rangeコンセプト + +| borrowed | sized | output | input | forward | bidirectional | random_access | contiguous | common | viewable | view | +|----------|-------|--------|-------|---------|---------------|---------------|------------|--------|----------|------| +| | (1) | 〇 | 〇 | (2) | (3) | (4) | | (5) | ○ | ○ | + +- (1): zipするすべてのRangeが[`sized_range`](sized_range.md)のとき +- (2): zipするすべてのRangeが[`forward_range`](forward_range.md)のとき +- (3): zipするすべてのRangeが[`bidirectional_range`](bidirectional_range.md)のとき +- (4): zipするすべてのRangeが[`random_access_range`](random_access_range.md)のとき +- (5): *zip-is-common*のとき + +## 効果 + +- (2): `F`を部分式、`Es...`を部分式のパックとする。式 `views::zip_transform(F, Es...)` の効果は以下の通り。 + - `Es` が空でないとき、`zip_transform_view(F, Es...)` と等しい + - `Es` が空のとき、 `FD` を [`decay_t`](/reference/type_traits/decay.md)``として、 + - `((void)F, auto(`[`views::empty`](empty_view.md)`<`[`decay_t`](/reference/type_traits/decay.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`>>))` と等しい + - ただし、 [`move_constructible`](/reference/concepts/move_constructible.md)` && `[`regular_invocable`](/reference/concepts/invocable.md)`` が `false`、または [`decay_t`](/reference/type_traits/decay.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`>` がオブジェクト型でないとき、ill-formed + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|--------------------------------------------------|----------------------------------|----------------| +| [`(constructor)`](zip_transform_view/op_constructor.md.nolink) | コンストラクタ | C++23 | +| [`begin`](zip_transform_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++23 | +| [`end`](zip_transform_view/end.md.nolink) | 番兵を取得する | C++23 | +| [`size`](take_view/size.md.nolink) | 要素数を取得する | C++23 | + +## 継承しているメンバ関数 + +| 名前 | 説明 | 対応バージョン | +|----------------------------------------------|-----------------------------------|----------------| +| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++20 | +| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++20 | +| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | +| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | +| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | + +## 推論補助 + +| 名前 | 説明 | 対応バージョン | +|-------------------------------------------------------|------------------------------|----------------| +| [`(deduction_guide)`](zip_transform_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector d = {1, 2, 3}; + std::vector p = {1, 10, 100, 1000}; + + std::println("{}", std::views::zip_transform([](auto x, auto y){ return x * y }, d, p)); +} +``` +* std::views::zip_transform[color ff0000] + +### 出力 +``` +[1, 20, 300] +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 関連項目 +- [`transform_view`](transform_view.md) zipする範囲が1つの場合 +- [`transform`](/reference/algorithm/ranges_transform.md) 2つのRangeから要素を1つずつ取り出して関数を呼び出し、結果を出力するアルゴリズム関数 + +## 参照 +- [N4950 26 Ranges library](https://timsong-cpp.github.io/cppwp/n4950/ranges) diff --git a/reference/ranges/zip_view.md b/reference/ranges/zip_view.md index 98a98fd1c8..ee8d6dde0f 100644 --- a/reference/ranges/zip_view.md +++ b/reference/ranges/zip_view.md @@ -137,7 +137,7 @@ int main() { ## 関連項目 - [`elements_view`](elements_view.md) zipの逆(タプルから要素を取り出す) -- [`zip_transform_view`](zip_transform_view.md.nolink) zipして関数を適用する +- [`zip_transform_view`](zip_transform_view.md) zipして関数を適用する ## 参照 - [N4950 26 Ranges library](https://timsong-cpp.github.io/cppwp/n4950/ranges) From 51b638cebb2aa53f8c32f08fa27e4c9e940fc66c Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Wed, 6 Mar 2024 04:05:10 +0900 Subject: [PATCH 0791/3948] =?UTF-8?q?=E4=B8=8D=E5=8F=AF=E8=A6=96=E6=96=87?= =?UTF-8?q?=E5=AD=97=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/zip_view.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/ranges/zip_view.md b/reference/ranges/zip_view.md index ee8d6dde0f..bf6672a96e 100644 --- a/reference/ranges/zip_view.md +++ b/reference/ranges/zip_view.md @@ -42,8 +42,8 @@ zipするRangeのサイズが異なっている場合、`zip_view`のサイズ ## 効果 - (2): 式`views::zip(Es...)`の効果は次の通り - - `Es`が空でないとき、`zip_view<`[`views​::​all_t`](all.md)`...>(Es...)` と等しい - - `Es`が空のとき、`auto(`[`views​::empty`](empty_view.md)`<`[`tuple`](/reference/tuple/tuple.md)`<>>)` と等しい + - `Es`が空でないとき、`zip_view<`[`views::all_t`](all.md)`...>(Es...)` と等しい + - `Es`が空のとき、`auto(`[`views::empty`](empty_view.md)`<`[`tuple`](/reference/tuple/tuple.md)`<>>)` と等しい ## 備考 From 51f60758826827b0f1bf16daedd587d53bf6ce82 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Wed, 6 Mar 2024 04:17:42 +0900 Subject: [PATCH 0792/3948] adjacent_view #1063 --- reference/ranges.md | 4 +- reference/ranges/adjacent_view.md | 113 ++++++++++++++++++++++++++++++ 2 files changed, 115 insertions(+), 2 deletions(-) create mode 100644 reference/ranges/adjacent_view.md diff --git a/reference/ranges.md b/reference/ranges.md index fb89a28136..b1c0d586e3 100644 --- a/reference/ranges.md +++ b/reference/ranges.md @@ -353,8 +353,8 @@ range | adaptor(args...) | 名前 | 説明 | 対応バージョン | |------------------------------------------------------------------|------------------------------------------------------------------------------------|----------------| -| [`adjacent_view`](ranges/adjacent_view.md.nolink) | 各要素とそれに隣接する要素を指定個数ずつ取り出した`tuple`のビュー (class template) | C++23 | -| [`views::adjacent`](ranges/adjacent_view.md.nolink) | `adjacent_view`を生成する (customization point object) | C++23 | +| [`adjacent_view`](ranges/adjacent_view.md) | 各要素とそれに隣接する要素を指定個数ずつ取り出した`tuple`のビュー (class template) | C++23 | +| [`views::adjacent`](ranges/adjacent_view.md) | `adjacent_view`を生成する (customization point object) | C++23 | ### adjacent transform view diff --git a/reference/ranges/adjacent_view.md b/reference/ranges/adjacent_view.md new file mode 100644 index 0000000000..0a16fc5c22 --- /dev/null +++ b/reference/ranges/adjacent_view.md @@ -0,0 +1,113 @@ +# adjacent_view +* ranges[meta header] +* std::ranges[meta namespace] +* class template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template + requires view && (N > 0) + class adjacent_view : public view_interface> {…… }; // (1) + + namespace views { + inline constexpr /*unspecified*/ adjacent = /*unspecified*/; // (2) + } +} +``` + +## 概要 + +`adjacent_view`は各要素とそれに隣接する要素を指定個数ずつ取り出した[`tuple`](/reference/tuple/tuple.md)を要素とする[`view`](view.md)。 + +`adjacent_view`の要素を1つ取得するごとに、`V` の要素を `N` 個取得する。 + +`N` が元となるRangeの要素数より大きい場合、この[`view`](view.md)は空である。 + +- (1): `adjacent_view`のクラス定義 +- (2): `adjacent_view`を生成するカスタマイゼーションポイントオブジェクト(Rangeアダプタオブジェクトではない) + +### Rangeコンセプト + +| borrowed | sized | output | input | forward | bidirectional | random_access | contiguous | common | viewable | view | +|----------|-------|--------|-------|---------|---------------|---------------|------------|--------|----------|------| +| | (1) | 〇 | 〇 | (1) | (1) | (1) | | (1) | ○ | ○ | + +- (1): 元となるRangeに従う + +## 効果 + +- (2): 式`views::adjacent(E)`の効果は次の通り + - `N` > 0 のとき、`adjacent_view<`[`views::all_t`](all.md)`, N>(E)` と等しい + - `N` = 0 のとき、`auto((void)E, `[`views::empty`](empty_view.md)`<`[`tuple`](/reference/tuple/tuple.md)`<>>))` と等しい + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|-----------------------------------------------------|----------------------------------|----------------| +| [`(constructor)`](adjacent_view/op_constructor.md.nolink) | コンストラクタ | C++23 | +| [`base`](take_view/base.md.nolink) | `V`の参照を取得する | C++23 | +| [`begin`](adjacent_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++23 | +| [`end`](adjacent_view/end.md.nolink) | 番兵を取得する | C++23 | +| [`size`](take_view/size.md.nolink) | 要素数を取得する | C++23 | + +## 継承しているメンバ関数 + +| 名前 | 説明 | 対応バージョン | +|----------------------------------------------|-----------------------------------|----------------| +| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++20 | +| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++20 | +| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | +| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | +| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | + +## 推論補助 + +| 名前 | 説明 | 対応バージョン | +|-------------------------------------------------------|------------------------------|----------------| +| [`(deduction_guide)`](adjacent_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5, 6}; + std::println("{}", v | std::views::adjacent<0>); + std::println("{}", v | std::views::adjacent<1>); + std::println("{}", v | std::views::adjacent<3>); + std::println("{}", v | std::views::adjacent<6>); + std::println("{}", v | std::views::adjacent<7>); +} +``` +* std::views::adjacent[color ff0000] + +### 出力 +``` +[] +[(1), (2), (3), (4), (5), (6)] +[(1, 2, 3), (2, 3, 4), (3, 4, 5), (4, 5, 6)] +[(1, 2, 3, 4, 5, 6)] +[] +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 関連項目 +- [`adjacent_transform_view`](adjacent_transform_view.md.nolink) `adjacent_view` と同じように要素を取得して関数を適用する + +## 参照 +- [N4950 26 Ranges library](https://timsong-cpp.github.io/cppwp/n4950/ranges) From 5722730c08e127f39077b10f5d70113e8cd30ce2 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Wed, 6 Mar 2024 04:20:18 +0900 Subject: [PATCH 0793/3948] update zip_transform_view --- reference/ranges/zip_transform_view.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/reference/ranges/zip_transform_view.md b/reference/ranges/zip_transform_view.md index 4a3a488bc7..dde5504bb5 100644 --- a/reference/ranges/zip_transform_view.md +++ b/reference/ranges/zip_transform_view.md @@ -35,13 +35,9 @@ zipするRangeのサイズが異なっている場合、`zip_transform_view`の | borrowed | sized | output | input | forward | bidirectional | random_access | contiguous | common | viewable | view | |----------|-------|--------|-------|---------|---------------|---------------|------------|--------|----------|------| -| | (1) | 〇 | 〇 | (2) | (3) | (4) | | (5) | ○ | ○ | +| | (1) | 〇 | 〇 | (1) | (1) | (1) | | (1) | ○ | ○ | -- (1): zipするすべてのRangeが[`sized_range`](sized_range.md)のとき -- (2): zipするすべてのRangeが[`forward_range`](forward_range.md)のとき -- (3): zipするすべてのRangeが[`bidirectional_range`](bidirectional_range.md)のとき -- (4): zipするすべてのRangeが[`random_access_range`](random_access_range.md)のとき -- (5): *zip-is-common*のとき +- (1): [`zip_view`](zip_view.md)``に従う ## 効果 From de6c390dc6f762f352943a4152440d38eb0d1387 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Wed, 6 Mar 2024 04:27:45 +0900 Subject: [PATCH 0794/3948] update zip_transform_view --- reference/ranges/zip_transform_view.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/reference/ranges/zip_transform_view.md b/reference/ranges/zip_transform_view.md index dde5504bb5..94b04a4d64 100644 --- a/reference/ranges/zip_transform_view.md +++ b/reference/ranges/zip_transform_view.md @@ -43,8 +43,7 @@ zipするRangeのサイズが異なっている場合、`zip_transform_view`の - (2): `F`を部分式、`Es...`を部分式のパックとする。式 `views::zip_transform(F, Es...)` の効果は以下の通り。 - `Es` が空でないとき、`zip_transform_view(F, Es...)` と等しい - - `Es` が空のとき、 `FD` を [`decay_t`](/reference/type_traits/decay.md)``として、 - - `((void)F, auto(`[`views::empty`](empty_view.md)`<`[`decay_t`](/reference/type_traits/decay.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`>>))` と等しい + - `Es` が空のとき、 `FD` を [`decay_t`](/reference/type_traits/decay.md)``として、`((void)F, auto(`[`views::empty`](empty_view.md)`<`[`decay_t`](/reference/type_traits/decay.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`>>))` と等しい - ただし、 [`move_constructible`](/reference/concepts/move_constructible.md)` && `[`regular_invocable`](/reference/concepts/invocable.md)`` が `false`、または [`decay_t`](/reference/type_traits/decay.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`>` がオブジェクト型でないとき、ill-formed From 5695a7a4fbd422685400adf98dc7bcf663c0ed56 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Wed, 6 Mar 2024 04:47:31 +0900 Subject: [PATCH 0795/3948] adjacent_transform_view #1063 --- GLOBAL_QUALIFY_LIST.txt | 2 + reference/ranges.md | 4 +- reference/ranges/adjacent_transform_view.md | 111 ++++++++++++++++++++ reference/ranges/adjacent_view.md | 8 +- 4 files changed, 119 insertions(+), 6 deletions(-) create mode 100644 reference/ranges/adjacent_transform_view.md diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 4f53f1f00e..5d15ea770a 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -74,7 +74,9 @@ * [link /reference/concepts.md] * common_reference_with[link /reference/concepts/common_reference_with.md] * common_with[link /reference/concepts/common_with.md] + * copy_constructible[link /reference/concepts/copy_constructible.md] * invocable[link /reference/concepts/invocable.md] + * move_constructible[link /reference/concepts/move_constructible.md] * regular_invocable[link /reference/concepts/invocable.md] * same_as[link /reference/concepts/same_as.md] * [link /reference/condition_variable.md] diff --git a/reference/ranges.md b/reference/ranges.md index b1c0d586e3..8432261274 100644 --- a/reference/ranges.md +++ b/reference/ranges.md @@ -360,8 +360,8 @@ range | adaptor(args...) | 名前 | 説明 | 対応バージョン | |------------------------------------------------------------------|------------------------------------------------------------------------------------|----------------| -| [`adjacent_transform_view`](ranges/adjacent_transform_view.md.nolink) | `adjacent_view`と同様に取り出し、関数を適用した結果のビュー (class template) | C++23 | -| [`views::adjacent_transform`](ranges/adjacent_transform_view.md.nolink) | `adjacent_transform_view`を生成する (customization point object) | C++23 | +| [`adjacent_transform_view`](ranges/adjacent_transform_view.md) | `adjacent_view`と同様に取り出し、関数を適用した結果のビュー (class template) | C++23 | +| [`views::adjacent_transform`](ranges/adjacent_transform_view.md) | `adjacent_transform_view`を生成する (customization point object) | C++23 | ### chunk view diff --git a/reference/ranges/adjacent_transform_view.md b/reference/ranges/adjacent_transform_view.md new file mode 100644 index 0000000000..c122908a37 --- /dev/null +++ b/reference/ranges/adjacent_transform_view.md @@ -0,0 +1,111 @@ +# adjacent_transform_view +* ranges[meta header] +* std::ranges[meta namespace] +* class template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template + requires view && (N > 0) && is_object_v && + regular_invocable, N)...> && + can-reference, N)...>> + class adjacent_transform_view : public view_interface> { …… }; // (1) + + namespace views { + inline constexpr /*unspecified*/ adjacent_transform_view = /*unspecified*/; // (2) + } +} +``` +* REPEAT[italic] +* can-reference[link /reference/iterator/dereferenceable.md] + +## 概要 + +`adjacent_transform_view`は各要素とそれに隣接する要素を指定個数ずつ取り出し、それらを引数として関数を呼び出した結果を要素とする[`view`](view.md)。 + +`adjacent_transform_view`の要素を1つ取得するごとに、`V` の要素を `N` 個取得する。 + +`N` が元となるRangeの要素数より大きい場合、この[`view`](view.md)は空である。 + +- (1): `adjacent_transform_view`のクラス定義 +- (2): `adjacent_transform_view`を生成するカスタマイゼーションポイントオブジェクト + + +### Rangeコンセプト + +| borrowed | sized | output | input | forward | bidirectional | random_access | contiguous | common | viewable | view | +|----------|-------|--------|-------|---------|---------------|---------------|------------|--------|----------|------| +| | (1) | 〇 | 〇 | (1) | (1) | (1) | | (1) | ○ | ○ | + +- (1): [`adjacent_view`](adjacent_view.md)``に従う + +## 効果 + +- (2): 式 `views::adjacent_transform(E, F)` の効果は以下の通り。 + - `N` > 0 のとき、`adjacent_transform_view<`[`views::all_t`](all.md)`, `[`decay_t`](/reference/type_traits/decay.md)`, N>(E, F)` と等しい + - `N` = 0 のとき、`((void)E, `[`views::zip_transform`](zip_transform_view.md)`(F))` と等しい(ただし`E`と`F`の評価順は不定) + +## 備考 + +`REPEAT(T, N)` をT型のN個のパックとする。 + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|--------------------------------------------------|----------------------------------|----------------| +| [`(constructor)`](adjacent_transform_view/op_constructor.md.nolink) | コンストラクタ | C++23 | +| [`base`](adjacent_transform_view/base.md.nolink) | `V`の参照を取得する | C++23 | +| [`begin`](adjacent_transform_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++23 | +| [`end`](adjacent_transform_view/end.md.nolink) | 番兵を取得する | C++23 | +| [`size`](adjacent_transform_view/size.md.nolink) | 要素数を取得する | C++23 | + +## 継承しているメンバ関数 + +| 名前 | 説明 | 対応バージョン | +|----------------------------------------------|-----------------------------------|----------------| +| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++20 | +| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++20 | +| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | +| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | +| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | + +## 推論補助 + +| 名前 | 説明 | 対応バージョン | +|-------------------------------------------------------|------------------------------|----------------| +| [`(deduction_guide)`](adjacent_transform_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | + +## 例 +```cpp example +int main() { + // 隣接する要素間の差を計算する + std::vector v = {9, 2, 5, 3, 6, 7}; + std::println("{}", v | std::views::adjacent_transform_view<2>([](auto x, auto y) { return y - x; })); +} +``` +* std::views::adjacent_transform_view[color ff0000] + +### 出力 +``` +[-7, 3, -2, 3, 1] +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 関連項目 +- [`adjacent_difference`](/reference/numeric/adjacent_difference.md) 隣接する2つの要素間の差を計算するアルゴリズム関数 + +## 参照 +- [N4950 26 Ranges library](https://timsong-cpp.github.io/cppwp/n4950/ranges) diff --git a/reference/ranges/adjacent_view.md b/reference/ranges/adjacent_view.md index 0a16fc5c22..ce5b5c064d 100644 --- a/reference/ranges/adjacent_view.md +++ b/reference/ranges/adjacent_view.md @@ -25,7 +25,7 @@ namespace std::ranges { `N` が元となるRangeの要素数より大きい場合、この[`view`](view.md)は空である。 - (1): `adjacent_view`のクラス定義 -- (2): `adjacent_view`を生成するカスタマイゼーションポイントオブジェクト(Rangeアダプタオブジェクトではない) +- (2): `adjacent_view`を生成するカスタマイゼーションポイントオブジェクト ### Rangeコンセプト @@ -47,10 +47,10 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |-----------------------------------------------------|----------------------------------|----------------| | [`(constructor)`](adjacent_view/op_constructor.md.nolink) | コンストラクタ | C++23 | -| [`base`](take_view/base.md.nolink) | `V`の参照を取得する | C++23 | +| [`base`](adjacent_view/base.md.nolink) | `V`の参照を取得する | C++23 | | [`begin`](adjacent_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++23 | | [`end`](adjacent_view/end.md.nolink) | 番兵を取得する | C++23 | -| [`size`](take_view/size.md.nolink) | 要素数を取得する | C++23 | +| [`size`](adjacent_view/size.md.nolink) | 要素数を取得する | C++23 | ## 継承しているメンバ関数 @@ -107,7 +107,7 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): ?? ## 関連項目 -- [`adjacent_transform_view`](adjacent_transform_view.md.nolink) `adjacent_view` と同じように要素を取得して関数を適用する +- [`adjacent_transform_view`](adjacent_transform_view.md) `adjacent_view` と同じように要素を取得して関数を適用する ## 参照 - [N4950 26 Ranges library](https://timsong-cpp.github.io/cppwp/n4950/ranges) From 00300d60326e748f5393732bfcbed72252dad4e6 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Wed, 6 Mar 2024 05:09:48 +0900 Subject: [PATCH 0796/3948] Update zip_transform_view.md --- reference/ranges/zip_transform_view.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/ranges/zip_transform_view.md b/reference/ranges/zip_transform_view.md index 94b04a4d64..93a6dda402 100644 --- a/reference/ranges/zip_transform_view.md +++ b/reference/ranges/zip_transform_view.md @@ -84,7 +84,7 @@ int main() { std::vector d = {1, 2, 3}; std::vector p = {1, 10, 100, 1000}; - std::println("{}", std::views::zip_transform([](auto x, auto y){ return x * y }, d, p)); + std::println("{}", std::views::zip_transform([](auto x, auto y){ return x * y; }, d, p)); } ``` * std::views::zip_transform[color ff0000] From 668c8d53e266fd786a56e3c0d08e22db837f542e Mon Sep 17 00:00:00 2001 From: yumetodo Date: Thu, 7 Mar 2024 01:50:09 +0900 Subject: [PATCH 0797/3948] fix(msvc_ver): add 17.7,17.8,17.9 info MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ところで最近MSがVS2022 Update XXXみたいな呼び方をしているのを見た記憶がないんですが、 @onihusube さんは 7d3e69fd917cb09749aea3855289913420ca5011 でそれをどう確認されたのか気になっています。 とりあえずこのcommitではUpdate XXXは明記しないことにしています。 17.7の情報は以下コメントより。 https://qiita.com/yumetodo/items/8c112fca0a8e6b47072d#comment-d34021f5f21e8df31a4c --- implementation.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/implementation.md b/implementation.md index 6e8714caa6..2b15b1531d 100644 --- a/implementation.md +++ b/implementation.md @@ -141,11 +141,14 @@ | 表記 | 製品名 [Visual Studio バージョン] †1 | VC++ バージョン †2 | `_MSC_VER` | `_MSC_FULL_VER` | |---------------|----------------------------------------|-----------------|------------|-----------------| +| 2022 | Visual Studio 2022 version 17.9.2 | 14.39 | 1939 | 193933521 | +| 2022 | Visual Studio 2022 version 17.8.3 | 14.38 | 1938 | 193833133 | +| 2022 | Visual Studio 2022 version 17.7.0 | 14.37 | 1937 | 193732822 | | 2022 Update 6 | Visual Studio 2022 version 17.6.5 | ?? | 1936 | 193632530 | | 2022 Update 5 | Visual Studio 2022 version 17.5.4 | ?? | 1935 | 193532217 | | 2022 Update 4 | Visual Studio 2022 version 17.4.9 | ?? | 1934 | 193431944 | -| 2022 Update 3 | Visual Studio 2022 version 17.3.6 | 14.30 | 1933 | 193331630 | -| 2022 Update 2 | Visual Studio 2022 version 17.2.2 | 14.30 | 1932 | 193231329 | +| 2022 Update 3 | Visual Studio 2022 version 17.3.6 | 14.33 | 1933 | 193331630 | +| 2022 Update 2 | Visual Studio 2022 version 17.2.2 | 14.32 | 1932 | 193231329 | | 2022 Update 1 | Visual Studio 2022 version 17.0.2 | 14.30 | 1930 | 193030706 | | 2022 | Visual Studio 2022 version 17.0.1 | 14.30 | 1930 | 193030705 | | 2019 Update 11 | Visual Studio 2019 バージョン 16.11.2 | 14.28 | 1929 | 192930133 | From 9ae7f5e3c0ea4ad11c1ab9091d385c87a29a4767 Mon Sep 17 00:00:00 2001 From: yumetodo Date: Thu, 7 Mar 2024 01:58:24 +0900 Subject: [PATCH 0798/3948] =?UTF-8?q?chore:=20VC++=20version=E3=81=AE?= =?UTF-8?q?=E7=A2=BA=E8=AA=8D=E6=96=B9=E6=B3=95=E3=82=92=E6=98=8E=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 多分この方法が一番簡単 --- implementation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/implementation.md b/implementation.md index 2b15b1531d..78f5310cdf 100644 --- a/implementation.md +++ b/implementation.md @@ -233,7 +233,7 @@ | | Microsoft C 6.0 | | 600 | | 1. **^** 製品名の列にはVisual C++コンパイラを含む実際に入手する製品の名称を示す。製品のエディション (Express/Standard/Professional/Enterprise/Community 他) は省略する。Visual Studioの製品バージョンは、製品名に現れていないときは `[ ~ ]` 内に記す。製品バージョンは、2017以降、メインメニューの [ヘルプ]-[Microsoft Visual Studio のバージョン情報] から確認できるものを指す。 -2. **^** VC++バージョンの列にはVisual C++ツールセットのバージョンを記述する。この表では特にVisual C++を入れた時に既定で選択されるツールセットのみについて扱う。 +2. **^** VC++バージョンの列にはVisual C++ツールセットのバージョンを記述する。この表では特にVisual C++を入れた時に既定で選択されるツールセットのみについて扱う。Visual Studio 2022においては`C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC`配下のフォルダ名(`14.39.33519`など)で確認できる。 3. ^ [**a**](#note_ref-t1-3-a) [**b**](#note_ref-t1-3-b) [**c**](#note_ref-t1-3-c) IDEのみ修正され、コンパイラ、ヘッダー、ライブラリ等は変更されなかった。 - [C++17 Features And STL Fixes In VS 2017 15.3 | Visual C++ Team Blog](https://blogs.msdn.microsoft.com/vcblog/2017/08/11/c17-features-and-stl-fixes-in-vs-2017-15-3/) - "*After VS 2017 RTM, the 15.1 and 15.2 updates improved the IDE. The 15.3 update improves both the IDE and the toolset.*" - [Description of Visual Studio 2013 Update 1](https://support.microsoft.com/en-us/help/2911573/description-of-visual-studio-2013-update-1) From b498cdea617c07d167901f0b39c4fee8a05b2806 Mon Sep 17 00:00:00 2001 From: yumetodo Date: Thu, 7 Mar 2024 02:12:38 +0900 Subject: [PATCH 0799/3948] =?UTF-8?q?fix:=2017.6=E3=81=AE=E6=83=85?= =?UTF-8?q?=E5=A0=B1=E3=82=92dev.to=E3=81=AE=E3=82=B3=E3=83=A1=E3=83=B3?= =?UTF-8?q?=E3=83=88=E3=81=AE=E6=83=85=E5=A0=B1=E3=81=AB=E5=B7=AE=E3=81=97?= =?UTF-8?q?=E6=9B=BF=E3=81=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit godboltのバージョンとリリースノートを突き合わせるのはどうも正確性を欠くらしい。 ref: - https://dev.to/xamidi/comment/270ep Co-authored-by: Samiro Discher --- implementation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/implementation.md b/implementation.md index 78f5310cdf..759f41951e 100644 --- a/implementation.md +++ b/implementation.md @@ -144,7 +144,7 @@ | 2022 | Visual Studio 2022 version 17.9.2 | 14.39 | 1939 | 193933521 | | 2022 | Visual Studio 2022 version 17.8.3 | 14.38 | 1938 | 193833133 | | 2022 | Visual Studio 2022 version 17.7.0 | 14.37 | 1937 | 193732822 | -| 2022 Update 6 | Visual Studio 2022 version 17.6.5 | ?? | 1936 | 193632530 | +| 2022 Update 6 | Visual Studio 2022 version 17.6.2 | 14.36 | 1936 | 193632532 | | 2022 Update 5 | Visual Studio 2022 version 17.5.4 | ?? | 1935 | 193532217 | | 2022 Update 4 | Visual Studio 2022 version 17.4.9 | ?? | 1934 | 193431944 | | 2022 Update 3 | Visual Studio 2022 version 17.3.6 | 14.33 | 1933 | 193331630 | From a110a7dfbbe23d9cb594dbf1a58aa195e4aba7aa Mon Sep 17 00:00:00 2001 From: Kasuya Rei Date: Thu, 7 Mar 2024 02:31:25 +0900 Subject: [PATCH 0800/3948] Fix typo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit lang/cpp26.md の typo を修正 --- lang/cpp26.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp26.md b/lang/cpp26.md index efdfd5be85..956bef54e0 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -94,7 +94,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - 以下のアルゴリズムを`constexpr`に対応 - [`std::stable_sort()`](/reference/algorithm/stable_sort.md) / [`std::ranges::stable_sort()`](/reference/algorithm/ranges_stable_sort.md) - [`std::stable_partition()`](/reference/algorithm/stable_partition.md) / [`std::ranges::stable_partition()`](/reference/algorithm/ranges_stable_partition.md) - - [`std::inplace_merge()`](/reference/algorithm/inplace_merge.md) / [`std::ranges::stable_partition()`](/reference/algorithm/ranges_inplace_merge.md) + - [`std::inplace_merge()`](/reference/algorithm/inplace_merge.md) / [`std::ranges::inplace_merge()`](/reference/algorithm/ranges_inplace_merge.md) - Rangeアルゴリズムが完全型を要求しないようにするため、[`std::projected`](/reference/iterator/projected.md)の制約を緩和 From f70ffbb03e4d33a0bae6250b8b310276984faa50 Mon Sep 17 00:00:00 2001 From: suomesta Date: Thu, 7 Mar 2024 23:28:24 +0900 Subject: [PATCH 0801/3948] fix typo in sample --- reference/numeric/sub_sat.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/numeric/sub_sat.md b/reference/numeric/sub_sat.md index a1bfd95092..1ff6a13a25 100644 --- a/reference/numeric/sub_sat.md +++ b/reference/numeric/sub_sat.md @@ -40,11 +40,11 @@ int main() std::println("{}", std::sub_sat(3, 1)); // 1 - 3 = -2 -> 0 - std::println("{}", std::add_sat(1u, 3u)); + std::println("{}", std::sub_sat(1u, 3u)); // -100 - 50 = -150 -> -128(-2**7) std::int8_t x = -100, y = 50; - std::println("{}", std::add_sat(x, y)); + std::println("{}", std::sub_sat(x, y)); } ``` * std::sub_sat[color ff0000] From 9eeee30fa10221a96403272d6e133159642fb739 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Wed, 6 Mar 2024 05:11:37 +0900 Subject: [PATCH 0802/3948] Add println to GLOBAL_QUALIFY_LIST --- GLOBAL_QUALIFY_LIST.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 5d15ea770a..6d485f601f 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -162,6 +162,7 @@ * std::basic_ostream[link /reference/ostream/basic_ostream.md] * std::endl[link /reference/ostream/endl.md] * [link /reference/print.md] + * std::println[link /reference/print/println.md] * [link /reference/queue.md] * [link /reference/random.md] * std::default_random_engine[link /reference/random/default_random_engine.md] From 4bf3b2a7e338b1aedc283dedbbf004b15c2a793a Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Fri, 8 Mar 2024 04:23:51 +0900 Subject: [PATCH 0803/3948] chunk_view #1075 --- lang/cpp23.md | 2 +- reference/ranges.md | 4 +- reference/ranges/chunk_view.md | 154 +++++++++++++++++++++++++++++++++ 3 files changed, 157 insertions(+), 3 deletions(-) create mode 100644 reference/ranges/chunk_view.md diff --git a/lang/cpp23.md b/lang/cpp23.md index 56be147976..4b8cfcbbce 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -143,7 +143,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 - Rangeを代入する`assign_range()`メンバ関数 - ユーザー定義のRangeアダプタがパイプライン演算子 `|` をサポートしやすくするために、[``](/reference/ranges.md)に[`std::ranges::range_adaptor_closure`](/reference/ranges/range_adaptor_closure.md.nolink)クラスを追加 - [``](/reference/ranges.md)に、Rangeを連結させる[`join_with`](/reference/ranges/join_with_view.md)を追加 -- Rangeを指定の大きさで分割する[`std::views::chunk`](/reference/ranges/chunk_view.md.nolink)と、Rangeを指定の大きさの隣接要素で分割する[`std::views::slide`](/reference/ranges/slide_view.md.nolink)を追加 +- Rangeを指定の大きさで分割する[`std::views::chunk`](/reference/ranges/chunk_view.md)と、Rangeを指定の大きさの隣接要素で分割する[`std::views::slide`](/reference/ranges/slide_view.md.nolink)を追加 - Rangeを条件一致する間の要素で分割する[`std::views::chunk_by`](/reference/ranges/chunk_by_view.md.nolink)を追加 - [``](/reference/ranges.md)に、Rangeを等間隔からなるRangeに変換する[`std::views::stride`](/reference/ranges/stride_view.md.nolink)を追加 - [``](/reference/ranges.md)に、Rangeをムーブするための[`std::views::as_rvalue`](/reference/ranges/as_rvalue_view.md)を追加 diff --git a/reference/ranges.md b/reference/ranges.md index 8432261274..6338cd9783 100644 --- a/reference/ranges.md +++ b/reference/ranges.md @@ -367,8 +367,8 @@ range | adaptor(args...) | 名前 | 説明 | 対応バージョン | |---------------------------------------------|--------------------------------------------------------------------|----------------| -| [`chunk_view`](ranges/chunk_view.md.nolink) | シーケンスを指定個数で区切った`view`のシーケンス (class template) | C++23 | -| [`views::chunk`](ranges/chunk_view.md.nolink) | `chunk_view`を生成する (customization point object) | C++23 | +| [`chunk_view`](ranges/chunk_view.md) | シーケンスを指定個数で区切った`view`のシーケンス (class template) | C++23 | +| [`views::chunk`](ranges/chunk_view.md) | `chunk_view`を生成する (customization point object) | C++23 | ### chunk by view diff --git a/reference/ranges/chunk_view.md b/reference/ranges/chunk_view.md new file mode 100644 index 0000000000..9bc6f8e590 --- /dev/null +++ b/reference/ranges/chunk_view.md @@ -0,0 +1,154 @@ +# chunk_view +* ranges[meta header] +* std::ranges[meta namespace] +* class template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template + requires input_range + class chunk_view : public view_interface> {…… }; // (1) + + namespace views { + inline constexpr /*unspecified*/ chunk = /*unspecified*/; // (2) + } +} +``` + +## 概要 + +`chunk_view`はRangeを指定個数ごとに分割した[`view`](view.md)のRange。 + +元となるRangeの要素数が指定個数で割り切れない場合、最後の[`view`](view.md)は余った要素のみを持ち、その要素数は指定個数よりも少なくなる。 + +- (1): `chunk_view`のクラス定義 +- (2): `chunk_view`を生成するカスタマイゼーションポイントオブジェクト + +### Rangeコンセプト + +外側Range + +| borrowed | sized | output | input | forward | bidirectional | random_access | contiguous | common | viewable | view | +|----------|-------|--------|-------|---------|---------------|---------------|------------|--------|----------|------| +| | ※ | 〇 | 〇 | ※ | ※ | ※ | | ※ | ○ | ○ | + +- ※: 元となるRangeに従う + +内側Range + +| borrowed | sized | output | input | forward | bidirectional | random_access | contiguous | common | viewable | view | +|----------|-------|--------|-------|---------|---------------|---------------|------------|--------|----------|------| +| | ※ | 〇 | 〇 | ※ | ※ | ※ | ※ | ※ | ○ | ○ | + +- ※: 元となるRangeに従う + +## 効果 + +- (2): 式`views::chunk(E, N)`の効果は`chunk_view(E, N)`と等しい。 + +## 事前条件 + +- (2): n > 0 + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|-----------------------------------------------------|----------------------------------|----------------| +| [`(constructor)`](chunk_view/op_constructor.md.nolink) | コンストラクタ | C++23 | +| [`base`](chunk_view/base.md.nolink) | `V`の参照を取得する | C++23 | +| [`begin`](chunk_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++23 | +| [`end`](chunk_view/end.md.nolink) | 番兵を取得する | C++23 | +| [`size`](chunk_view/size.md.nolink) | 要素数を取得する | C++23 | + +## 継承しているメンバ関数 + +| 名前 | 説明 | 対応バージョン | +|----------------------------------------------|-----------------------------------|----------------| +| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++20 | +| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++20 | +| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | +| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | +| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | + +## 推論補助 + +| 名前 | 説明 | 対応バージョン | +|-------------------------------------------------------|------------------------------|----------------| +| [`(deduction_guide)`](chunk_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5, 6}; + std::println("{}", v | std::views::chunk(1)); + std::println("{}", v | std::views::chunk(3)); + std::println("{}", v | std::views::chunk(5)); + std::println("{}", v | std::views::chunk(7)); +} +``` +* std::views::chunk[color ff0000] + +### 出力 +``` +[[1], [2], [3], [4], [5], [6]] +[[1, 2, 3], [4, 5, 6]] +[[1, 2, 3, 4, 5], [6]] +[[1, 2, 3, 4, 5, 6]] +``` + +## 例 縦横に並んだ数値を読む +```cpp example +#include +#include +#include +#include +#include + +int main() { + // cin代わりの文字列ストリーム + std::istringstream iss(R"( +2 10 +31 41 59 26 53 58 97 93 23 84 +62 64 33 83 27 95 2 88 41 97 +)"); + + int h, w; + iss >> h >> w; + + const auto table = std::views::istream(iss) + | std::views::chunk(w) + | std::views::take(h) + | std::ranges::to>(); + + std::println("{}", table); +} +``` +* std::views::chunk[color ff0000] +* std::views::take[link take_view.md] +* std::ranges::to[link to.md] + +### 出力 +``` +[[31, 41, 59, 26, 53, 58, 97, 93, 23, 84], [62, 64, 33, 83, 27, 95, 2, 88, 41, 97]] +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 14.0 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [N4950 26 Ranges library](https://timsong-cpp.github.io/cppwp/n4950/ranges) From 80918ec9c1ee68cb9765d28dd7746addb259d6bc Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Fri, 8 Mar 2024 04:37:36 +0900 Subject: [PATCH 0804/3948] slide_view #1075 --- lang/cpp23.md | 2 +- reference/ranges.md | 4 +- reference/ranges/adjacent_transform_view.md | 2 +- reference/ranges/adjacent_view.md | 5 +- reference/ranges/slide_view.md | 120 ++++++++++++++++++++ 5 files changed, 127 insertions(+), 6 deletions(-) create mode 100644 reference/ranges/slide_view.md diff --git a/lang/cpp23.md b/lang/cpp23.md index 4b8cfcbbce..81117d57bf 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -143,7 +143,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 - Rangeを代入する`assign_range()`メンバ関数 - ユーザー定義のRangeアダプタがパイプライン演算子 `|` をサポートしやすくするために、[``](/reference/ranges.md)に[`std::ranges::range_adaptor_closure`](/reference/ranges/range_adaptor_closure.md.nolink)クラスを追加 - [``](/reference/ranges.md)に、Rangeを連結させる[`join_with`](/reference/ranges/join_with_view.md)を追加 -- Rangeを指定の大きさで分割する[`std::views::chunk`](/reference/ranges/chunk_view.md)と、Rangeを指定の大きさの隣接要素で分割する[`std::views::slide`](/reference/ranges/slide_view.md.nolink)を追加 +- Rangeを指定の大きさで分割する[`std::views::chunk`](/reference/ranges/chunk_view.md)と、Rangeを指定の大きさの隣接要素で分割する[`std::views::slide`](/reference/ranges/slide_view.md)を追加 - Rangeを条件一致する間の要素で分割する[`std::views::chunk_by`](/reference/ranges/chunk_by_view.md.nolink)を追加 - [``](/reference/ranges.md)に、Rangeを等間隔からなるRangeに変換する[`std::views::stride`](/reference/ranges/stride_view.md.nolink)を追加 - [``](/reference/ranges.md)に、Rangeをムーブするための[`std::views::as_rvalue`](/reference/ranges/as_rvalue_view.md)を追加 diff --git a/reference/ranges.md b/reference/ranges.md index 6338cd9783..0c8ab7bcc2 100644 --- a/reference/ranges.md +++ b/reference/ranges.md @@ -381,8 +381,8 @@ range | adaptor(args...) | 名前 | 説明 | 対応バージョン | |----------------------------------------|---------------------------------------------------------------------------------|----------------| -| [`slide_view`](ranges/slide_view.md.nolink) | 各要素とそれに隣接する要素を指定個数ずつ見る`view`のシーケンス (class template) | C++23 | -| [`views::slide`](ranges/slide_view.md.nolink) | `slide_view`を生成する (customization point object) | C++23 | +| [`slide_view`](ranges/slide_view.md) | 各要素とそれに隣接する要素を指定個数ずつ見る`view`のシーケンス (class template) | C++23 | +| [`views::slide`](ranges/slide_view.md) | `slide_view`を生成する (customization point object) | C++23 | ### stride view diff --git a/reference/ranges/adjacent_transform_view.md b/reference/ranges/adjacent_transform_view.md index c122908a37..4e4c10baa5 100644 --- a/reference/ranges/adjacent_transform_view.md +++ b/reference/ranges/adjacent_transform_view.md @@ -22,7 +22,7 @@ namespace std::ranges { ## 概要 -`adjacent_transform_view`は各要素とそれに隣接する要素を指定個数ずつ取り出し、それらを引数として関数を呼び出した結果を要素とする[`view`](view.md)。 +`adjacent_transform_view`は各要素とそれに隣接する要素をコンパイル時指定の個数ずつ取り出し、それらを引数として関数を呼び出した結果を要素とする[`view`](view.md)。 `adjacent_transform_view`の要素を1つ取得するごとに、`V` の要素を `N` 個取得する。 diff --git a/reference/ranges/adjacent_view.md b/reference/ranges/adjacent_view.md index ce5b5c064d..b39e3dc454 100644 --- a/reference/ranges/adjacent_view.md +++ b/reference/ranges/adjacent_view.md @@ -18,7 +18,7 @@ namespace std::ranges { ## 概要 -`adjacent_view`は各要素とそれに隣接する要素を指定個数ずつ取り出した[`tuple`](/reference/tuple/tuple.md)を要素とする[`view`](view.md)。 +`adjacent_view`は各要素とそれに隣接する要素をコンパイル時指定の個数ずつ取り出した[`tuple`](/reference/tuple/tuple.md)を要素とする[`view`](view.md)。 `adjacent_view`の要素を1つ取得するごとに、`V` の要素を `N` 個取得する。 @@ -107,7 +107,8 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): ?? ## 関連項目 -- [`adjacent_transform_view`](adjacent_transform_view.md) `adjacent_view` と同じように要素を取得して関数を適用する +- [`adjacent_transform_view`](adjacent_transform_view.md): `adjacent_view` と同じように要素を取得して関数を適用する +- [`slide_view`](slide_view.md): `adjacent_view` と同じように要素を取得するが、個数を実行時に指定する。内側は[`tuple`](/reference/tuple/tuple.md)ではなく[`view`](view.md)となる ## 参照 - [N4950 26 Ranges library](https://timsong-cpp.github.io/cppwp/n4950/ranges) diff --git a/reference/ranges/slide_view.md b/reference/ranges/slide_view.md new file mode 100644 index 0000000000..2fda30e348 --- /dev/null +++ b/reference/ranges/slide_view.md @@ -0,0 +1,120 @@ +# slide_view +* ranges[meta header] +* std::ranges[meta namespace] +* class template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template + requires input_range + class slide_view : public view_interface> {…… }; // (1) + + namespace views { + inline constexpr /*unspecified*/ slide = /*unspecified*/; // (2) + } +} +``` + +## 概要 + +`slide_view`は各要素とそれに隣接する要素を実行時指定の個数ずつ参照する[`view`](view.md)のRange。 + +指定した個数が元となるRangeの要素数より大きい場合、この[`view`](view.md)は空である。 + +- (1): `slide_view`のクラス定義 +- (2): `slide_view`を生成するカスタマイゼーションポイントオブジェクト + +### Rangeコンセプト + +外側Range + +| borrowed | sized | output | input | forward | bidirectional | random_access | contiguous | common | viewable | view | +|----------|-------|--------|-------|---------|---------------|---------------|------------|--------|----------|------| +| | ※ | 〇 | 〇 | ※ | ※ | ※ | | ※ | ○ | ○ | + +- ※: 元となるRangeに従う + +内側Range + +| borrowed | sized | output | input | forward | bidirectional | random_access | contiguous | common | viewable | view | +|----------|-------|--------|-------|---------|---------------|---------------|------------|--------|----------|------| +| | ※ | 〇 | 〇 | ※ | ※ | ※ | ※ | ※ | ○ | ○ | + +- ※: 元となるRangeに従う + +## 効果 + +- (2): 式`views::slide(E, N)`の効果は`slide_view(E, N)`と等しい。 + +## 事前条件 + +- (2): n > 0 + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|-----------------------------------------------------|----------------------------------|----------------| +| [`(constructor)`](slide_view/op_constructor.md.nolink) | コンストラクタ | C++23 | +| [`base`](slide_view/base.md.nolink) | `V`の参照を取得する | C++23 | +| [`begin`](slide_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++23 | +| [`end`](slide_view/end.md.nolink) | 番兵を取得する | C++23 | +| [`size`](slide_view/size.md.nolink) | 要素数を取得する | C++23 | + +## 継承しているメンバ関数 + +| 名前 | 説明 | 対応バージョン | +|----------------------------------------------|-----------------------------------|----------------| +| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++20 | +| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++20 | +| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | +| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | +| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | + +## 推論補助 + +| 名前 | 説明 | 対応バージョン | +|-------------------------------------------------------|------------------------------|----------------| +| [`(deduction_guide)`](slide_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5, 6}; + std::println("{}", v | std::views::slide<1>); + std::println("{}", v | std::views::slide<3>); + std::println("{}", v | std::views::slide<6>); + std::println("{}", v | std::views::slide<7>); +} +``` +* std::views::slide[color ff0000] + +### 出力 +``` +[[1], [2], [3], [4], [5], [6]] +[[1, 2, 3], [2, 3, 4], [3, 4, 5], [4, 5, 6]] +[[1, 2, 3, 4, 5, 6]] +[] +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 14.0 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 関連項目 +- [`adjacent_view`](adjacent_view.md): `slide_view` と同じように要素を取得するが、個数をコンパイル時に指定する。内側はRangeではなく[`tuple`](/reference/tuple/tuple.md)となる + +## 参照 +- [N4950 26 Ranges library](https://timsong-cpp.github.io/cppwp/n4950/ranges) From 9af2af38ffb88f935833f92e772d67a627f028a5 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Fri, 8 Mar 2024 05:01:18 +0900 Subject: [PATCH 0805/3948] chunk_by_view #1076 --- GLOBAL_QUALIFY_LIST.txt | 2 + lang/cpp23.md | 2 +- reference/ranges.md | 12 ++-- reference/ranges/chunk_by_view.md | 109 ++++++++++++++++++++++++++++++ 4 files changed, 118 insertions(+), 7 deletions(-) create mode 100644 reference/ranges/chunk_by_view.md diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 6d485f601f..e7b9d66d57 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -124,6 +124,8 @@ * std::basic_istream[link /reference/istream/basic_istream.md] * [link /reference/iterator.md] * default_sentinel_t[link /reference/iterator/default_sentinel_t.md] + * indirect_binary_predicate[link /reference/iterator/indirect_binary_predicate.md] + * indirect_unary_predicate[link /reference/iterator/indirect_unary_predicate.md] * std::back_inserter[link /reference/iterator/back_inserter.md] * std::begin[link /reference/iterator/begin.md] * std::distance[link /reference/iterator/distance.md] diff --git a/lang/cpp23.md b/lang/cpp23.md index 81117d57bf..dfb7b2f6bf 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -144,7 +144,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 - ユーザー定義のRangeアダプタがパイプライン演算子 `|` をサポートしやすくするために、[``](/reference/ranges.md)に[`std::ranges::range_adaptor_closure`](/reference/ranges/range_adaptor_closure.md.nolink)クラスを追加 - [``](/reference/ranges.md)に、Rangeを連結させる[`join_with`](/reference/ranges/join_with_view.md)を追加 - Rangeを指定の大きさで分割する[`std::views::chunk`](/reference/ranges/chunk_view.md)と、Rangeを指定の大きさの隣接要素で分割する[`std::views::slide`](/reference/ranges/slide_view.md)を追加 -- Rangeを条件一致する間の要素で分割する[`std::views::chunk_by`](/reference/ranges/chunk_by_view.md.nolink)を追加 +- Rangeを条件一致する間の要素で分割する[`std::views::chunk_by`](/reference/ranges/chunk_by_view.md)を追加 - [``](/reference/ranges.md)に、Rangeを等間隔からなるRangeに変換する[`std::views::stride`](/reference/ranges/stride_view.md.nolink)を追加 - [``](/reference/ranges.md)に、Rangeをムーブするための[`std::views::as_rvalue`](/reference/ranges/as_rvalue_view.md)を追加 - [``](/reference/ranges.md)に、指定した値をN回繰り返すRangeを生成する[`std::views::repeat`](/reference/ranges/repeat_view.md)を追加 diff --git a/reference/ranges.md b/reference/ranges.md index 0c8ab7bcc2..a155114d07 100644 --- a/reference/ranges.md +++ b/reference/ranges.md @@ -365,17 +365,17 @@ range | adaptor(args...) ### chunk view -| 名前 | 説明 | 対応バージョン | -|---------------------------------------------|--------------------------------------------------------------------|----------------| +| 名前 | 説明 | 対応バージョン | +|----------------------------------------------|--------------------------------------------------------------------|----------------| | [`chunk_view`](ranges/chunk_view.md) | シーケンスを指定個数で区切った`view`のシーケンス (class template) | C++23 | | [`views::chunk`](ranges/chunk_view.md) | `chunk_view`を生成する (customization point object) | C++23 | ### chunk by view -| 名前 | 説明 | 対応バージョン | -|---------------------------------------------|--------------------------------------------------------------------|----------------| -| [`chunk_by_view`](ranges/chunk_by_view.md.nolink) | 2項述語が偽となる部分で区切った`view`のシーケンス (class template) | C++23 | -| [`views::chunk_by`](ranges/chunk_by_view.md.nolink) | `chunk_by_view`を生成する (customization point object) | C++23 | +| 名前 | 説明 | 対応バージョン | +|----------------------------------------------|--------------------------------------------------------------------|----------------| +| [`chunk_by_view`](ranges/chunk_by_view.md) | 2項述語が偽となる部分で区切った`view`のシーケンス (class template) | C++23 | +| [`views::chunk_by`](ranges/chunk_by_view.md) | `chunk_by_view`を生成する (customization point object) | C++23 | ### slide view diff --git a/reference/ranges/chunk_by_view.md b/reference/ranges/chunk_by_view.md new file mode 100644 index 0000000000..061a35498a --- /dev/null +++ b/reference/ranges/chunk_by_view.md @@ -0,0 +1,109 @@ +# chunk_by_view +* ranges[meta header] +* std::ranges[meta namespace] +* class template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template, iterator_t> Pred> + requires view && is_object_v + class chunk_by_view : public view_interface> {…… }; // (1) + + namespace views { + inline constexpr /*unspecified*/ chunk_by = /*unspecified*/; // (2) + } +} +``` + +## 概要 + +`chunk_by_view`はRangeを指定した二項述語が偽となる場所で分割した[`view`](view.md)のRange。 + +- (1): `chunk_by_view`のクラス定義 +- (2): `chunk_by_view`を生成するカスタマイゼーションポイントオブジェクト + +### Rangeコンセプト + +外側Range + +| borrowed | sized | output | input | forward | bidirectional | random_access | contiguous | common | viewable | view | +|----------|-------|--------|-------|---------|---------------|---------------|------------|--------|----------|------| +| | | 〇 | 〇 | ※ | ※ | | | | ○ | ○ | + +- ※: 元となるRangeに従う + +内側Range + +| borrowed | sized | output | input | forward | bidirectional | random_access | contiguous | common | viewable | view | +|----------|-------|--------|-------|---------|---------------|---------------|------------|--------|----------|------| +| | ※ | 〇 | 〇 | ※ | ※ | ※ | ※ | ※ | ○ | ○ | + +- ※: 元となるRangeに従う + +## 効果 + +- (2): 式`views::chunk_by(E, F)`の効果は`chunk_by_view(E, F)`と等しい。 + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|-----------------------------------------------------|----------------------------------|----------------| +| [`(constructor)`](chunk_by_view/op_constructor.md.nolink) | コンストラクタ | C++23 | +| [`base`](chunk_by_view/base.md.nolink) | `V`の参照を取得する | C++23 | +| [`pred`](chunk_by_view/pred.md.nolink) | 述語を取得する | C++23 | +| [`begin`](chunk_by_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++23 | +| [`end`](chunk_by_view/end.md.nolink) | 番兵を取得する | C++23 | + +## 継承しているメンバ関数 + +| 名前 | 説明 | 対応バージョン | +|----------------------------------------------|-----------------------------------|----------------| +| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++20 | +| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++20 | +| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | +| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | +| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | + +## 推論補助 + +| 名前 | 説明 | 対応バージョン | +|-------------------------------------------------------|------------------------------|----------------| +| [`(deduction_guide)`](chunk_by_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2, 2, 3, 0, 4, 5, 2}; + // 列が転倒する場所で分割 + std::println("{}", v | std::views::chunk_by(std::ranges::less_equal{})); +} +``` +* std::views::chunk_by[color ff0000] +* std::ranges::less_equal[link /reference/functional/functional.md] +* 転倒[link https://ja.wikipedia.org/wiki/%E8%BB%A2%E5%80%92_(%E6%95%B0%E5%AD%A6)] + +### 出力 +``` +[[1, 2, 2, 3], [0, 4, 5], [2]] +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 14.0 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [N4950 26 Ranges library](https://timsong-cpp.github.io/cppwp/n4950/ranges) From 3c620361a2830acf4a614f42d71f1748bd579422 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Fri, 8 Mar 2024 05:05:05 +0900 Subject: [PATCH 0806/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/chunk_by_view.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/ranges/chunk_by_view.md b/reference/ranges/chunk_by_view.md index 061a35498a..99ccd2650a 100644 --- a/reference/ranges/chunk_by_view.md +++ b/reference/ranges/chunk_by_view.md @@ -87,7 +87,7 @@ int main() { } ``` * std::views::chunk_by[color ff0000] -* std::ranges::less_equal[link /reference/functional/functional.md] +* std::ranges::less_equal[link /reference/functional/ranges_less_equal.md] * 転倒[link https://ja.wikipedia.org/wiki/%E8%BB%A2%E5%80%92_(%E6%95%B0%E5%AD%A6)] ### 出力 From 422aeb58a086cc95f6ba3c62960d8e2ab8391b7f Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 8 Mar 2024 16:16:13 +0900 Subject: [PATCH 0807/3948] linalg/transposed: fix markdown(#1233) --- reference/linalg/transposed.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/reference/linalg/transposed.md b/reference/linalg/transposed.md index bfcfede270..e29d0f86cb 100644 --- a/reference/linalg/transposed.md +++ b/reference/linalg/transposed.md @@ -42,13 +42,16 @@ constexpr auto transposed( 型`ReturnMapping`を`ReturnLayout::mapping`として、次の値を返す。 - `Layout`が[`layout_left`](/reference/mdspan/layout_left.md)または[`layout_right`](/reference/mdspan/layout_right.md)または[`layout_blas_packed`](layout_blas_packed.md)の特殊化であるとき、 + ```cpp R(a.data_handle(), ReturnMapping(transpose-extents(a.mapping().extents())), a.accessor()) ``` * transpose-extents[link layout_transpose/transpose-extents.md] + - `Layout`が[`layout_stride`](/reference/mdspan/layout_stride.md)の特殊化であるとき、 + ```cpp R(a.data_handle(), ReturnMapping(transpose-extents(a.mapping().extents()), @@ -56,11 +59,15 @@ constexpr auto transposed( a.accessor()) ``` * transpose-extents[link layout_transpose/transpose-extents.md] + - `Layout`が[`layout_transpose`](layout_transpose.md)の特殊化であるとき、 + ```cpp R(a.data_handle(), a.mapping().nested_mapping(), a.accessor()) ``` + - それ以外のとき、 + ```cpp R(a.data_handle(), ReturnMapping(a.mapping()), a.accessor()) ``` From 07b000531b637b4914149c01389604dadf730b86 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sat, 9 Mar 2024 02:49:28 +0900 Subject: [PATCH 0808/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/zip_view.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/ranges/zip_view.md b/reference/ranges/zip_view.md index bf6672a96e..486fc889d0 100644 --- a/reference/ranges/zip_view.md +++ b/reference/ranges/zip_view.md @@ -68,7 +68,7 @@ namespace std::ranges { | [`(constructor)`](zip_view/op_constructor.md.nolink) | コンストラクタ | C++23 | | [`begin`](zip_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++23 | | [`end`](zip_view/end.md.nolink) | 番兵を取得する | C++23 | -| [`size`](take_view/size.md.nolink) | 要素数を取得する | C++23 | +| [`size`](zip_view/size.md.nolink) | 要素数を取得する | C++23 | ## 継承しているメンバ関数 From 2f0268478e691d8ebe097964e34853c2077136fd Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sat, 9 Mar 2024 02:51:24 +0900 Subject: [PATCH 0809/3948] =?UTF-8?q?=E3=82=B5=E3=83=B3=E3=83=97=E3=83=AB?= =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E3=81=AE=E5=AE=9F=E8=A1=8C=E7=B5=90?= =?UTF-8?q?=E6=9E=9C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/zip_view.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/ranges/zip_view.md b/reference/ranges/zip_view.md index 486fc889d0..bfa7f1951b 100644 --- a/reference/ranges/zip_view.md +++ b/reference/ranges/zip_view.md @@ -123,6 +123,7 @@ int main() { [(1, 'a'), (2, 'b')] [(10, 'a'), (20, 'b')] {20: 'b', 10: 'a'} +[] ``` ## バージョン From d7a2efb7f69a4bef3157967eb05816f2c280ea96 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sat, 9 Mar 2024 03:31:10 +0900 Subject: [PATCH 0810/3948] =?UTF-8?q?ranges=20=E8=A3=9C=E8=B6=B3=E8=AA=AC?= =?UTF-8?q?=E6=98=8E=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges.md | 2 +- reference/ranges/to.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/reference/ranges.md b/reference/ranges.md index a155114d07..10f2e8eff4 100644 --- a/reference/ranges.md +++ b/reference/ranges.md @@ -175,7 +175,7 @@ Rangeファクトリは、Rangeではないオブジェクトから[`view`](rang Rangeアダプタは、既存のRangeに作用して新たな[`view`](ranges/view.md)を生成するものである。 その実体はカスタマイゼーションポイントオブジェクトとなっている。 -RangeアダプタをRangeに作用させる方法には、関数記法とパイプライン記法の2つがある。 +RangeアダプタをRangeに作用させる方法には、一部の例外を除き、関数記法とパイプライン記法の2つがある。 `R`をRangeアダプタ、`r`を元になるRangeとする。このとき、以下の2つの式は同じ[`view`](ranges/view.md)を生成する。 diff --git a/reference/ranges/to.md b/reference/ranges/to.md index 11cc00f230..73ac8d849f 100644 --- a/reference/ranges/to.md +++ b/reference/ranges/to.md @@ -32,6 +32,7 @@ Rangeの各要素を要素とするコンテナを構築する。 (2), (4) の存在により、コンテナ型を指定するときにその要素の型を省略して(=テンプレートとして)渡すことができる。 +`to` は他のRangeアダプタとは異なり先行評価される。コンテナもRangeなので`to`をRangeパイプラインの中間に組み込むこともできるが、[`view`](view.md)だけで構成する場合とは振る舞いが異なることに注意。 ## 適格要件 - (1), (3): `C` はCV修飾のないクラス型であること。 From 71109985b817776ecd05b3807ef1e5f6aba809e0 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sat, 9 Mar 2024 02:29:45 +0900 Subject: [PATCH 0811/3948] stride_view #1081 --- lang/cpp23.md | 2 +- reference/ranges.md | 4 +- reference/ranges/stride_view.md | 103 ++++++++++++++++++++++++++++++++ 3 files changed, 106 insertions(+), 3 deletions(-) create mode 100644 reference/ranges/stride_view.md diff --git a/lang/cpp23.md b/lang/cpp23.md index dfb7b2f6bf..92e1ba9303 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -145,7 +145,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 - [``](/reference/ranges.md)に、Rangeを連結させる[`join_with`](/reference/ranges/join_with_view.md)を追加 - Rangeを指定の大きさで分割する[`std::views::chunk`](/reference/ranges/chunk_view.md)と、Rangeを指定の大きさの隣接要素で分割する[`std::views::slide`](/reference/ranges/slide_view.md)を追加 - Rangeを条件一致する間の要素で分割する[`std::views::chunk_by`](/reference/ranges/chunk_by_view.md)を追加 -- [``](/reference/ranges.md)に、Rangeを等間隔からなるRangeに変換する[`std::views::stride`](/reference/ranges/stride_view.md.nolink)を追加 +- [``](/reference/ranges.md)に、Rangeを等間隔からなるRangeに変換する[`std::views::stride`](/reference/ranges/stride_view.md)を追加 - [``](/reference/ranges.md)に、Rangeをムーブするための[`std::views::as_rvalue`](/reference/ranges/as_rvalue_view.md)を追加 - [``](/reference/ranges.md)に、指定した値をN回繰り返すRangeを生成する[`std::views::repeat`](/reference/ranges/repeat_view.md)を追加 - [``](/reference/ranges.md)に、Rangeをインデックス付きでループさせる[`std::views::enumerate`](/reference/ranges/enumerate.md.nolink)を追加 diff --git a/reference/ranges.md b/reference/ranges.md index 10f2e8eff4..c7d6f5bb66 100644 --- a/reference/ranges.md +++ b/reference/ranges.md @@ -388,8 +388,8 @@ range | adaptor(args...) | 名前 | 説明 | 対応バージョン | |------------------------------------------|-------------------------------------------------------|----------------| -| [`stride_view`](ranges/stride_view.md.nolink) | 要素を指定個数飛ばしに見るビュー (class template) | C++23 | -| [`views::stride`](ranges/stride_view.md.nolink) | `stride_view`を生成する (customization point object) | C++23 | +| [`stride_view`](ranges/stride_view.md) | 要素を指定個数飛ばしに見るビュー (class template) | C++23 | +| [`views::stride`](ranges/stride_view.md) | `stride_view`を生成する (customization point object) | C++23 | ### cartesian product view diff --git a/reference/ranges/stride_view.md b/reference/ranges/stride_view.md new file mode 100644 index 0000000000..3735ceadb0 --- /dev/null +++ b/reference/ranges/stride_view.md @@ -0,0 +1,103 @@ +# stride_view +* ranges[meta header] +* std::ranges[meta namespace] +* class template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template + requires view + class stride_view : public view_interface> {…… }; // (1) + + namespace views { + inline constexpr /*unspecified*/ stride = /*unspecified*/; // (2) + } +} +``` + +## 概要 + +`stride_view`はRangeの要素を指定個数飛ばしに見る[`view`](view.md)。 + +- (1): `stride_view`のクラス定義 +- (2): `stride_view`を生成するカスタマイゼーションポイントオブジェクト(Rangeアダプタオブジェクトではない) + +### Rangeコンセプト + +| borrowed | sized | output | input | forward | bidirectional | random_access | contiguous | common | viewable | view | +|----------|-------|--------|-------|---------|---------------|---------------|------------|--------|----------|------| +| | ※ | ※ | ※ | ※ | ※ | ※ | | ※ | ○ | ○ | + +- ※: 元となるRangeに従う + +## 効果 + +- (2): 式`views::stride(E, N)`の効果は`stride_view(E, N)`と等しい + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|--------------------------------------------------|----------------------------------|----------------| +| [`(constructor)`](stride_view/op_constructor.md.nolink) | コンストラクタ | C++23 | +| [`base`](stride_view/base.md.nolink) | `V`の参照を取得する | C++23 | +| [`stride`](stride_view/stride.md.nolink) | 1回で移動する要素数を取得する | C++23 | +| [`begin`](stride_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++23 | +| [`end`](stride_view/end.md.nolink) | 番兵を取得する | C++23 | +| [`size`](take_view/size.md.nolink) | 要素数を取得する | C++23 | + +## 継承しているメンバ関数 + +| 名前 | 説明 | 対応バージョン | +|----------------------------------------------|-----------------------------------|----------------| +| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++20 | +| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++20 | +| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | +| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | +| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | + +## 推論補助 + +| 名前 | 説明 | 対応バージョン | +|-------------------------------------------------------|------------------------------|----------------| +| [`(deduction_guide)`](stride_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {0, 1, 2, 3, 4, 5, 6}; + + std::println("{}", v | std::views::stride(3)); + + for (auto&& i : v | std::views::stride(3)) { + i *= 10; // 要素を書き換えても良い + } + std::println("{}", v); +} +``` +* std::views::stride[color ff0000] + +### 出力 +``` +[0, 3, 6] +[0, 1, 2, 30, 4, 5, 60] +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 13.2 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [N4950 26 Ranges library](https://timsong-cpp.github.io/cppwp/n4950/ranges) From 5a1743d0b13434f7d38615105e9152a1c039fd7c Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sat, 9 Mar 2024 03:07:22 +0900 Subject: [PATCH 0812/3948] certesian_product_view #1089 --- lang/cpp23.md | 2 +- reference/ranges.md | 4 +- reference/ranges/cartesian_product_view.md | 159 +++++++++++++++++++++ 3 files changed, 162 insertions(+), 3 deletions(-) create mode 100644 reference/ranges/cartesian_product_view.md diff --git a/lang/cpp23.md b/lang/cpp23.md index 92e1ba9303..99f54d02f0 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -133,7 +133,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 - [`std::map::erase()`](/reference/map/map/erase.md) - [`std::map::extract()`](/reference/map/map/extract.md) - [``](/reference/ranges.md)に、複数の範囲を綴じ合わせる[`std::views::zip`](/reference/ranges/zip_view.md)を追加 -- [``](/reference/ranges.md)に、複数の範囲の直積をとる[`std::views::cartesian_product`](/reference/ranges/cartesian_product_view.md.nolink)を追加 +- [``](/reference/ranges.md)に、複数の範囲の直積をとる[`std::views::cartesian_product`](/reference/ranges/cartesian_product_view.md)を追加 - Rangeから任意のコンテナに変換するRangeアダプタ[`std::ranges::to()`](/reference/ranges/to.md)を追加 - Rangeから任意のコンテナに変換するために、可変長のコンテナ ([`std::array`](/reference/array/array.md)以外) に、以下の機能を追加: - Rangeから変換するコンストラクタ diff --git a/reference/ranges.md b/reference/ranges.md index c7d6f5bb66..59e14b1f18 100644 --- a/reference/ranges.md +++ b/reference/ranges.md @@ -395,8 +395,8 @@ range | adaptor(args...) | 名前 | 説明 | 対応バージョン | |---------------------------------------------------------------|------------------------------------------------------------------|----------------| -| [`cartesian_product_view`](ranges/cartesian_product_view.md.nolink) | シーケンスの直積集合のビュー (class template) | C++23 | -| [`views::cartesian_product`](ranges/cartesian_product.md.nolink) | `cartesian_product_view`を生成する (customization point object) | C++23 | +| [`cartesian_product_view`](ranges/cartesian_product_view.md) | シーケンスの直積集合のビュー (class template) | C++23 | +| [`views::cartesian_product`](ranges/cartesian_product.md) | `cartesian_product_view`を生成する (customization point object) | C++23 | ## Range変換 diff --git a/reference/ranges/cartesian_product_view.md b/reference/ranges/cartesian_product_view.md new file mode 100644 index 0000000000..d4353e4913 --- /dev/null +++ b/reference/ranges/cartesian_product_view.md @@ -0,0 +1,159 @@ +# cartesian_product_view +* ranges[meta header] +* std::ranges[meta namespace] +* class template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template + requires (view && ... && view) + class cartesian_product_view : public view_interface> {…… }; // (1) + + namespace views { + inline constexpr /*unspecified*/ cartesian_product = /*unspecified*/; // (2) + } +} +``` + +## 概要 + +`cartesian_product_view`は複数のRangeの直積をとり、その要素を[`tuple`](/reference/tuple/tuple.md)として見せる[`view`](view.md)。 + +この[`view`](view.md)の要素数は、すべての指定したRangeの要素数の積である。 + +- (1): `cartesian_product_view`のクラス定義 +- (2): `cartesian_product_view`を生成するカスタマイゼーションポイントオブジェクト(Rangeアダプタオブジェクトではない) + +### Rangeコンセプト + +| borrowed | sized | output | input | forward | bidirectional | random_access | contiguous | common | viewable | view | +|----------|-------|--------|-------|---------|---------------|---------------|------------|--------|----------|------| +| | (1) | 〇 | 〇 | 〇 | (2) | (3) | | (4) | ○ | ○ | + +- (1): すべてのRangeが[`sized_range`](sized_range.md)のとき +- (2): すべてのRangeが[`bidirectional_range`](bidirectional_range.md)かつ、先頭以外のRangeが*cartesian-product-common-arg*のとき +- (3): すべてのRangeが[`random_access_range`](random_access_range.md)かつ、先頭のRamgeが[`sized_range`](sized_range.md)のとき +- (4): 先頭のRangeが*cartesian-product-common-arg*のとき + +## 効果 + +- (2): 式`views::cartesian_product(Es...)`の効果は次の通り + - `Es`が空でないとき、`cartesian_product_view<`[`views::all_t`](all.md)`...>(Es...)` と等しい + - `Es`が空のとき、[`views::single`](single_view.md)`(`[`tuple`](/reference/tuple/tuple.md)`())` と等しい + + +## 備考 + +本説明に用いる説明専用要素を以下のように定義する。 + +```cpp +namespace std::ranges { + template + concept cartesian-product-is-random-access = // exposition only + (random_access_range> && ... && + (random_access_range> + && sized_range>)); + + template + concept cartesian-product-common-arg = // exposition only + common_range || (sized_range && random_access_range); + + template + concept cartesian-product-is-bidirectional = // exposition only + (bidirectional_range> && ... && + (bidirectional_range> + && cartesian-product-common-arg>)); + + template + concept cartesian-product-is-common = // exposition only + cartesian-product-common-arg; + + template + concept cartesian-product-is-sized = // exposition only + (sized_range && ...); + + template class FirstSent, class First, class... Vs> + concept cartesian-is-sized-sentinel = // exposition only + (sized_sentinel_for>, + iterator_t>> && ... + && (sized_range> + && sized_sentinel_for>, + iterator_t>>)); + + template + constexpr auto cartesian-common-arg-end(R& r) { // exposition only + if constexpr (common_range) { + return ranges::end(r); + } else { + return ranges::begin(r) + ranges::distance(r); + } + } +} +``` + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|--------------------------------------------------|----------------------------------|----------------| +| [`(constructor)`](cartesian_product_view/op_constructor.md.nolink) | コンストラクタ | C++23 | +| [`begin`](cartesian_product_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++23 | +| [`end`](cartesian_product_view/end.md.nolink) | 番兵を取得する | C++23 | +| [`size`](cartesian_product_view/size.md.nolink) | 要素数を取得する | C++23 | + +## 継承しているメンバ関数 + +| 名前 | 説明 | 対応バージョン | +|----------------------------------------------|-----------------------------------|----------------| +| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++20 | +| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++20 | +| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | +| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | +| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | + +## 推論補助 + +| 名前 | 説明 | 対応バージョン | +|-------------------------------------------------------|------------------------------|----------------| +| [`(deduction_guide)`](cartesian_product_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2}; + const std::list l = {'a', 'b', 'c'}; + + std::println("{}", std::views::cartesian_product(v, l)); + + // 空になる場合 + std::println("{}", std::views::cartesian_product()); +} +``` +* std::views::cartesian_product[color ff0000] +* std::ranges::to[link to.md] + +### 出力 +``` +[(1, 'a'), (1, 'b'), (1, 'c'), (2, 'a'), (2, 'b'), (2, 'c')] +[] +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 +- [GCC](/implementation.md#gcc): 13.2 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [N4950 26 Ranges library](https://timsong-cpp.github.io/cppwp/n4950/ranges) From 57215c956447c95603111ace1d7d1c39973f2403 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sat, 9 Mar 2024 03:36:07 +0900 Subject: [PATCH 0813/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges.md | 2 +- reference/ranges/cartesian_product_view.md | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/reference/ranges.md b/reference/ranges.md index 59e14b1f18..c56c466008 100644 --- a/reference/ranges.md +++ b/reference/ranges.md @@ -396,7 +396,7 @@ range | adaptor(args...) | 名前 | 説明 | 対応バージョン | |---------------------------------------------------------------|------------------------------------------------------------------|----------------| | [`cartesian_product_view`](ranges/cartesian_product_view.md) | シーケンスの直積集合のビュー (class template) | C++23 | -| [`views::cartesian_product`](ranges/cartesian_product.md) | `cartesian_product_view`を生成する (customization point object) | C++23 | +| [`views::cartesian_product`](ranges/cartesian_product_view.md) | `cartesian_product_view`を生成する (customization point object) | C++23 | ## Range変換 diff --git a/reference/ranges/cartesian_product_view.md b/reference/ranges/cartesian_product_view.md index d4353e4913..5cffbca2c2 100644 --- a/reference/ranges/cartesian_product_view.md +++ b/reference/ranges/cartesian_product_view.md @@ -137,7 +137,6 @@ int main() { } ``` * std::views::cartesian_product[color ff0000] -* std::ranges::to[link to.md] ### 出力 ``` From c906787fdfefdd7eefbd7b5cc0f0195756bd8d30 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sat, 9 Mar 2024 03:54:00 +0900 Subject: [PATCH 0814/3948] enumerate_view #1146 --- lang/cpp23.md | 2 +- reference/ranges.md | 11 +++- reference/ranges/enumerate_view.md | 100 +++++++++++++++++++++++++++++ 3 files changed, 110 insertions(+), 3 deletions(-) create mode 100644 reference/ranges/enumerate_view.md diff --git a/lang/cpp23.md b/lang/cpp23.md index 99f54d02f0..093c05e037 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -148,7 +148,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 - [``](/reference/ranges.md)に、Rangeを等間隔からなるRangeに変換する[`std::views::stride`](/reference/ranges/stride_view.md)を追加 - [``](/reference/ranges.md)に、Rangeをムーブするための[`std::views::as_rvalue`](/reference/ranges/as_rvalue_view.md)を追加 - [``](/reference/ranges.md)に、指定した値をN回繰り返すRangeを生成する[`std::views::repeat`](/reference/ranges/repeat_view.md)を追加 -- [``](/reference/ranges.md)に、Rangeをインデックス付きでループさせる[`std::views::enumerate`](/reference/ranges/enumerate.md.nolink)を追加 +- [``](/reference/ranges.md)に、Rangeをインデックス付きでループさせる[`std::views::enumerate`](/reference/ranges/enumerate_view.md)を追加 ### アルゴリズム diff --git a/reference/ranges.md b/reference/ranges.md index c56c466008..66c193db16 100644 --- a/reference/ranges.md +++ b/reference/ranges.md @@ -321,8 +321,8 @@ range | adaptor(args...) | 名前 | 説明 | 対応バージョン | |-----------------------------------------------|--------------------------------------------------------------|----------------| -| [`as_const_view`](ranges/as_const_view.md) | 各要素をconstにするビュー (class template) | C++23 | -| [`views::as_const`](ranges/as_const_view.md) | `as_const_view`を生成する (customization point object) | C++23 | +| [`as_const_view`](ranges/as_const_view.md) | 各要素をconstにするビュー (class template) | C++23 | +| [`views::as_const`](ranges/as_const_view.md) | `as_const_view`を生成する (customization point object) | C++23 | ### elements view @@ -335,6 +335,13 @@ range | adaptor(args...) | [`views::keys`](ranges/elements_view.md) | `keys_view`を生成する (customization point object) | C++20 | | [`views::values`](ranges/elements_view.md) | `values_view`を生成する (customization point object) | C++20 | +### enumerate view + +| 名前 | 説明 | 対応バージョン | +|-------------------------------------------------|----------------------------------------------------------|----------------| +| [`enumerate_view`](ranges/enumerate_view.md) | シーケンスにインデックスを付ける`view` (class template) | C++23 | +| [`views::enumerate`](ranges/enumerate_view.md) | `enumerate_view`を生成する (customization point object) | C++23 | + ### zip view | 名前 | 説明 | 対応バージョン | diff --git a/reference/ranges/enumerate_view.md b/reference/ranges/enumerate_view.md new file mode 100644 index 0000000000..b953e6648f --- /dev/null +++ b/reference/ranges/enumerate_view.md @@ -0,0 +1,100 @@ +# enumerate_view +* ranges[meta header] +* std::ranges[meta namespace] +* class template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template + requires range-with-movable-references + class enumerate_view : public view_interface> { …… }; // (1) + + namespace views { + inline constexpr /*unspecified*/ enumerate = /*unspecified*/; // (2) + } +} +``` +* range-with-movable-references[link range-with-movable-references.md.nolink] + +## 概要 + +`enumerate_view`はインデックスを付ける[`view`](view.md)。 + +`enumerate_view`の要素は、インデックスと元のRangeの要素からなる[`tuple`](/reference/tuple/tuple.md)である。 + +- (1): `enumerate_view`のクラス定義 +- (2): `enumerate_view`を生成するRangeアダプタオブジェクト + +### Rangeコンセプト + +| borrowed | sized | output | input | forward | bidirectional | random_access | contiguous | common | viewable | view | +|----------|-------|--------|-------|---------|---------------|---------------|------------|--------|----------|------| +| | ※ | ※ | 〇 | ※ | ※ | ※ | | ※ | ○ | ○ | + +- ※: 元となるRangeに従う + +## 効果 + +- (2): 式`views::enumerate(E)`の効果は`enumerate_view<`[`views::all_t`](all.md)`>(E)` と等しい + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|--------------------------------------------------|----------------------------------|----------------| +| [`(constructor)`](enumerate_view/op_constructor.md.nolink) | コンストラクタ | C++23 | +| [`base`](enumerate_view/base.md.nolink) | `V`の参照を取得する | C++23 | +| [`begin`](enumerate_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++23 | +| [`end`](enumerate_view/end.md.nolink) | 番兵を取得する | C++23 | +| [`size`](enumerate_view/size.md.nolink) | 要素数を取得する | C++23 | + +## 継承しているメンバ関数 + +| 名前 | 説明 | 対応バージョン | +|----------------------------------------------|-----------------------------------|----------------| +| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++20 | +| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++20 | +| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | +| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | +| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | + +## 推論補助 + +| 名前 | 説明 | 対応バージョン | +|-------------------------------------------------------|------------------------------|----------------| +| [`(deduction_guide)`](enumerate_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | + +## 例 +```cpp example +#include +#include +#include + +int main() { + const std::vector v = {'a', 'b', 'c'}; + + std::println("{}", v | std::views::enumerate); +} +``` +* std::views::enumerate[color ff0000] + +### 出力 +``` +[(0, 'a'), (1, 'b'), (2, 'c')] +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [N4950 26 Ranges library](https://timsong-cpp.github.io/cppwp/n4950/ranges) From 032f80acd98943d1195ae6bdb7a6197c3ef904e3 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sat, 9 Mar 2024 04:10:33 +0900 Subject: [PATCH 0815/3948] range-with-movable-references #1146 --- reference/exposition-only.md | 1 + reference/ranges/enumerate_view.md | 2 +- .../ranges/range-with-movable-references.md | 18 ++++++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 reference/ranges/range-with-movable-references.md diff --git a/reference/exposition-only.md b/reference/exposition-only.md index 48716460b1..15294444d4 100644 --- a/reference/exposition-only.md +++ b/reference/exposition-only.md @@ -42,6 +42,7 @@ | [`copyable-box`](ranges/copyable_box.md) | コピー可能、または例外なしでムーブ可能な場合のみ値を保持する型 (class template) | C++20 | | [`simple-view`](ranges/simple-view.md) | 単純なビューを表す (concept) | C++20 | | [`has-arrow`](ranges/has-arrow.md) | [`std::input_iterator`](/reference/iterator/input_iterator.md)を満たし、アロー演算子が使用できる型かを表す (concept) | C++20 | +| [`range-with-movable-references`](ranges/range-with-movable-references.md) | 要素の参照と右辺値参照がムーブ構築できる[`input_range`](/reference/ranges/input_range.md) (concept) | C++23 | | [`different-from`](ranges/different-from.md) | `const`/`volatile`修飾を無視して、2つの型が同じでないことを表す (concept) | C++20 | | [`uses-nonqualification-pointer-conversion`](ranges/subrange/uses-nonqualification-pointer-conversion.md) | 直接変換できない型同士のポインタの変換が必要かどうかを表す (concept) | C++20 | | [`convertible-to-non-slicing`](ranges/subrange/convertible-to-non-slicing.md) | スライシングを起こさずに変換できるかどうかを表す (concept) | C++20 | diff --git a/reference/ranges/enumerate_view.md b/reference/ranges/enumerate_view.md index b953e6648f..9f9682c541 100644 --- a/reference/ranges/enumerate_view.md +++ b/reference/ranges/enumerate_view.md @@ -15,7 +15,7 @@ namespace std::ranges { } } ``` -* range-with-movable-references[link range-with-movable-references.md.nolink] +* range-with-movable-references[link range-with-movable-references.md] ## 概要 diff --git a/reference/ranges/range-with-movable-references.md b/reference/ranges/range-with-movable-references.md new file mode 100644 index 0000000000..c068f0a479 --- /dev/null +++ b/reference/ranges/range-with-movable-references.md @@ -0,0 +1,18 @@ +# range-with-movable-references +* ranges[meta header] +* concept[meta id-type] +* cpp23[meta cpp] + +```cpp +template + concept range-with-movable-references = // 説明専用コンセプト + input_range && move_constructible> && + move_constructible>; +``` + +## 概要 +`range-with-movable-references`は、型`R`が[`input_range`](input_range.md)であり、その要素の参照と右辺値参照がムーブ構築可能であることを表す説明専用コンセプトである。 + +## バージョン +### 言語 +- C++23 From af4c8ae1e2619e0e90aa3e5815c1b4ab98ceaf16 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sat, 9 Mar 2024 04:36:47 +0900 Subject: [PATCH 0816/3948] =?UTF-8?q?Range=E3=82=A2=E3=83=80=E3=83=97?= =?UTF-8?q?=E3=82=BF=E3=81=A7=E3=83=A0=E3=83=BC=E3=83=96=E3=81=AE=E3=81=BF?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E3=81=AA=E5=9E=8B=E3=82=92=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86=E8=A6=81=E4=BB=B6?= =?UTF-8?q?=E3=82=92=E7=B7=A9=E5=92=8C=20#1096?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/exposition-only.md | 4 +- reference/ranges/copyable_box.md | 25 ++++++----- reference/ranges/movable_box.md | 70 ++++++++++++++++++++++++++++++ reference/ranges/single_view.md | 13 +++--- reference/ranges/transform_view.md | 25 +++-------- 5 files changed, 99 insertions(+), 38 deletions(-) create mode 100644 reference/ranges/movable_box.md diff --git a/reference/exposition-only.md b/reference/exposition-only.md index 15294444d4..bfa5938368 100644 --- a/reference/exposition-only.md +++ b/reference/exposition-only.md @@ -39,7 +39,8 @@ | 名前 | 説明 | 対応バージョン | |----------------------------------------------|------------------------------------------------------------------------------------------------------|-----------| -| [`copyable-box`](ranges/copyable_box.md) | コピー可能、または例外なしでムーブ可能な場合のみ値を保持する型 (class template) | C++20 | +| [`copyable-box`](ranges/copyable_box.md) | コピー可能、または例外なしでムーブ可能な場合のみ値を保持する型 (class template) | C++20
C++23で削除 | +| [`movable-box`](ranges/movable_box.md) | 例外なしでムーブ可能な場合のみ値を保持する型 (class template) | C++23 | | [`simple-view`](ranges/simple-view.md) | 単純なビューを表す (concept) | C++20 | | [`has-arrow`](ranges/has-arrow.md) | [`std::input_iterator`](/reference/iterator/input_iterator.md)を満たし、アロー演算子が使用できる型かを表す (concept) | C++20 | | [`range-with-movable-references`](ranges/range-with-movable-references.md) | 要素の参照と右辺値参照がムーブ構築できる[`input_range`](/reference/ranges/input_range.md) (concept) | C++23 | @@ -60,3 +61,4 @@ * [N4861 16.4.2.1 Exposition-only functions](https://timsong-cpp.github.io/cppwp/n4861/expos.only.func) * [LWG 3404 Finish removing `subrange`'s conversions from `pair-like`](https://cplusplus.github.io/LWG/issue3404) * [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) +* [P2494R2 Relaxing range adaptors to allow for move only types](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2494r2.html) diff --git a/reference/ranges/copyable_box.md b/reference/ranges/copyable_box.md index 236cfbacbd..96437ee421 100644 --- a/reference/ranges/copyable_box.md +++ b/reference/ranges/copyable_box.md @@ -2,18 +2,16 @@ * ranges[meta header] * class template[meta id-type] * cpp20[meta cpp] +* cpp23removed[meta cpp] ## 概要 `copyable-box` は、規格の文中に現れる説明専用のクラスである。 -`copyable-box` は、[`std::optional`](/reference/optional/optional.md)``とほとんど同じであるものの、 -`T` が `copyable`のモデルであるか、`is_nothrow_move_constructible_v && is_nothrow_copy_constructible_v`を満たす場合のみ値を保持する。 - -具体的には以下の差分がある。 +`copyable-box` は、[`std::optional`](/reference/optional/optional.md)``とほとんど同じであるものの、以下の差分がある。 ### 差分1 -テンプレートパラメーター制約 `copy_constructible && is_object_v` をもつ。 +テンプレートパラメーター制約 [`copy_constructible`](/reference/concepts/copy_constructible.md)` && `[`is_object_v`](/reference/type_traits/is_object.md)`` をもつ。 ### 差分2 `T`が[`copyable`](/reference/concepts/copyable.md)のモデルでない場合、コピー代入演算子は以下のように定義される。 @@ -51,16 +49,21 @@ constexpr copyable-box& operator=(copyable-box&& that) noexcept(is_nothrow_move_ * emplace[link /reference/optional/optional/emplace.md] * reset[link /reference/optional/optional/reset.md] +### その他 + +以下のことが推奨される。 + +- [`copy_constructible`](/reference/concepts/copy_constructible.md)`` なら、`movable-box` は +`T` が [`copyable`](/reference/concepts/copyable.md)のモデルであるか、[`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)` && `[`is_nothrow_copy_constructible_v`](/reference/type_traits/is_nothrow_copy_constructible.md)``を満たす場合のみ値を保持する。 + +## 備考 + +このクラスはC++23で['movable-box'](movable_box.md)に置き換えられた。 + ## バージョン ### 言語 - C++20 -### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 -- [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 - ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) - [C++20 ranges](https://techbookfest.org/product/5134506308665344) diff --git a/reference/ranges/movable_box.md b/reference/ranges/movable_box.md new file mode 100644 index 0000000000..03bbd0d8f3 --- /dev/null +++ b/reference/ranges/movable_box.md @@ -0,0 +1,70 @@ +# movable-box +* ranges[meta header] +* class template[meta id-type] +* cpp23[meta cpp] + +## 概要 + +`movable-box` は、規格の文中に現れる説明専用のクラスである。 + +`movable-box` は、[`std::optional`](/reference/optional/optional.md)``とほとんど同じであるが、以下の差分をもつ。 + +### 差分1 +テンプレートパラメーター制約 [`move_constructible`](/reference/concepts//move_constructible.md)` && `[`is_object_v`](/reference/type_traits/is_object.md)`` をもつ。 + +### 差分2 +`T`が[`copyable`](/reference/concepts/copyable.md)のモデルでない場合、コピー代入演算子は以下のように定義される。 + +```cpp +constexpr movable-box& operator=(const movable-box& that) noexcept(is_nothrow_copy_constructible_v) { + if (this != addressof(that)) { + if (that) emplace(*that); + else reset(); + } + return *this; +} +``` +* movable-box[italic] +* is_nothrow_copy_constructible_v[link /reference/type_traits/is_nothrow_copy_constructible.md] +* addressof[link /reference/memory/addressof.md] +* emplace[link /reference/optional/optional/emplace.md] +* reset[link /reference/optional/optional/reset.md] + +### 差分3 +`T`が[`movable`](/reference/concepts/movable.md)のモデルでない場合、ムーブ代入演算子は以下のように定義される。 + +```cpp +constexpr movable-box& operator=(movable-box&& that) noexcept(is_nothrow_move_constructible_v) { + if (this != addressof(that)) { + if (that) emplace(std::move(*that)); + else reset(); + } + return *this; +} +``` +* movable-box[italic] +* is_nothrow_move_constructible_v[link /reference/type_traits/is_nothrow_move_constructible.md] +* addressof[link /reference/memory/addressof.md] +* emplace[link /reference/optional/optional/emplace.md] +* reset[link /reference/optional/optional/reset.md] + +### その他 + +以下のことが推奨される。 + +- [`copy_constructible`](/reference/concepts/copy_constructible.md)`` なら、`movable-box` は +`T` が [`copyable`](/reference/concepts/copyable.md)のモデルであるか、[`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)` && `[`is_nothrow_copy_constructible_v`](/reference/type_traits/is_nothrow_copy_constructible.md)``を満たす場合のみ値を保持する。 +- そうでなければ、`movable-box` は +`T` が [`movable`](/reference/concepts/movable.md)のモデルであるか、[`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)``を満たす場合のみ値を保持する。 + +## 備考 + +このクラスは、[`copyable-box`](copyable_box.md)を置き換える形で導入された。 + +## バージョン +### 言語 +- C++23 + +## 参照 +- [N4950 26 Ranges library](https://timsong-cpp.github.io/cppwp/n4950/ranges) +- [P2494R2 Relaxing range adaptors to allow for move only types](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2494r2.html) diff --git a/reference/ranges/single_view.md b/reference/ranges/single_view.md index a4d8ec0cd1..618583cf88 100644 --- a/reference/ranges/single_view.md +++ b/reference/ranges/single_view.md @@ -8,16 +8,17 @@ namespace std::ranges { template requires is_object_v - class single_view : public view_interface> { …… }; // (1) + class single_view : public view_interface> { …… }; // (1) C++20 + + template + requires is_object_v + class single_view : public view_interface> { …… }; // (1) C++23 namespace views { inline constexpr /*unspecified*/ single = /*unspecified*/; // (2) } } ``` -* copy_constructible[link /reference/concepts/copy_constructible.md] -* is_object_v[link /reference/type_traits/is_object.md] -* view_interface[link view_interface.md] ## 概要 - (1): 値を要素1つのRangeに見せる[`view`](view.md) @@ -29,10 +30,6 @@ namespace std::ranges { |----------|-------|--------|-------|---------|---------------|---------------|------------|--------|----------|------| | | ○ | ○ | ○ | ○ | ○ | ○ | ○ | ○ | ○ | ○ | -## テンプレートパラメータ制約 -- [`copy_constructible`](/reference/concepts/copy_constructible.md)`` -- [`is_object_v`](/reference/type_traits/is_object.md)`` - ## 効果 - 式`views::single(E)`の効果は`single_view>(E)`と等しい。 diff --git a/reference/ranges/transform_view.md b/reference/ranges/transform_view.md index d1a9c73cd6..b7fef939c7 100644 --- a/reference/ranges/transform_view.md +++ b/reference/ranges/transform_view.md @@ -10,22 +10,20 @@ namespace std::ranges { requires view && is_object_v && regular_invocable> && can-reference>> - class transform_view : public view_interface> { …… }; // (1) + class transform_view : public view_interface> { …… }; // (1) C++20 + + template + requires view && is_object_v && + regular_invocable> && + can-reference>> + class transform_view : public view_interface> { …… }; // (1) C++23 namespace views { inline constexpr /*unspecified*/ transform = /*unspecified*/; // (2) } } ``` -* input_range[link input_range.md] -* copy_constructible[link /reference/concepts/copy_constructible.md] -* view[link view.md] -* is_object_v[link /reference/type_traits/is_object.md] -* regular_invocable[link /reference/concepts/invocable.md] -* range_reference_t[link range_reference_t.md] * can-reference[link /reference/iterator/dereferenceable.md] -* invoke_result_t[link /reference/type_traits/invoke_result.md] -* view_interface[link view_interface.md] ## 概要 - (1): 指定した関数で各要素を変換した値のRangeとして振る舞う[`view`](view.md) @@ -40,15 +38,6 @@ namespace std::ranges { - (1): `V`に従う - (2): 述語が参照を返す場合 -## テンプレートパラメータ制約 - -- [`input_range`](input_range.md)`` -- [`view`](view.md)`` -- [`copy_constructible`](/reference/concepts/copy_constructible.md)`` -- [`is_object_v`](/reference/type_traits/is_object.md)`` -- [`regular_invocable`](/reference/concepts/invocable.md)`>` -- [`can-reference`](/reference/iterator/dereferenceable.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`>>` - ## 効果 - (2): 式`views::transform(E, P)`の効果は`transform_view(E, P)`と等しい From ac7bc04757d90a527bf22117a4c61c526ddcf140 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sun, 10 Mar 2024 00:51:59 +0900 Subject: [PATCH 0817/3948] Fix typo --- reference/ranges/copyable_box.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/ranges/copyable_box.md b/reference/ranges/copyable_box.md index 96437ee421..98e937cd7b 100644 --- a/reference/ranges/copyable_box.md +++ b/reference/ranges/copyable_box.md @@ -58,7 +58,7 @@ constexpr copyable-box& operator=(copyable-box&& that) noexcept(is_nothrow_move_ ## 備考 -このクラスはC++23で['movable-box'](movable_box.md)に置き換えられた。 +このクラスはC++23で[`movable-box`](movable_box.md)に置き換えられた。 ## バージョン ### 言語 From bef7f7f4803804319d677fe4db916e2e7e9ba4eb Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sun, 10 Mar 2024 00:52:41 +0900 Subject: [PATCH 0818/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/movable_box.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/ranges/movable_box.md b/reference/ranges/movable_box.md index 03bbd0d8f3..e2152b63b0 100644 --- a/reference/ranges/movable_box.md +++ b/reference/ranges/movable_box.md @@ -10,7 +10,7 @@ `movable-box` は、[`std::optional`](/reference/optional/optional.md)``とほとんど同じであるが、以下の差分をもつ。 ### 差分1 -テンプレートパラメーター制約 [`move_constructible`](/reference/concepts//move_constructible.md)` && `[`is_object_v`](/reference/type_traits/is_object.md)`` をもつ。 +テンプレートパラメーター制約 [`move_constructible`](/reference/concepts/move_constructible.md)` && `[`is_object_v`](/reference/type_traits/is_object.md)`` をもつ。 ### 差分2 `T`が[`copyable`](/reference/concepts/copyable.md)のモデルでない場合、コピー代入演算子は以下のように定義される。 From c5f8bd4f6b9174c4f73b87b2ff58e125d4c50d3f Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sun, 10 Mar 2024 01:37:33 +0900 Subject: [PATCH 0819/3948] std::ranges::contains #1087 --- GLOBAL_QUALIFY_LIST.txt | 13 +++ lang/cpp23.md | 2 +- reference/algorithm.md | 40 +++---- reference/algorithm/ranges_contains.md | 92 ++++++++++++++++ .../algorithm/ranges_contains_subrange.md | 103 ++++++++++++++++++ 5 files changed, 230 insertions(+), 20 deletions(-) create mode 100644 reference/algorithm/ranges_contains.md create mode 100644 reference/algorithm/ranges_contains_subrange.md diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index e7b9d66d57..e7ea56fa48 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -109,6 +109,8 @@ * std::forward_list[link /reference/forward_list/forward_list.md] * [link /reference/fstream.md] * [link /reference/functional.md] + * identity[link /reference/functional/identity.md] + * ranges::equal_to[link /reference/functional/ranges_equal_to.md] * [link /reference/future.md] * [link /reference/generator.md] * [link /reference/initializer_list.md] @@ -123,9 +125,18 @@ * [link /reference/istream.md] * std::basic_istream[link /reference/istream/basic_istream.md] * [link /reference/iterator.md] + * bidirectional_iterator[link /reference/iterator/bidirectional_iterator.md] + * contiguous_iterator[link /reference/iterator/contiguous_iterator.md] * default_sentinel_t[link /reference/iterator/default_sentinel_t.md] + * forward_iterator[link /reference/iterator/forward_iterator.md] * indirect_binary_predicate[link /reference/iterator/indirect_binary_predicate.md] * indirect_unary_predicate[link /reference/iterator/indirect_unary_predicate.md] + * indirectly_comparable[link /reference/iterator/indirectly_comparable.md] + * input_iterator[link /reference/iterator/input_iterator.md] + * output_iterator[link /reference/iterator/output_iterator.md] + * projected[link /reference/iterator/projected.md] + * random_access_iterator[link /reference/iterator/random_access_iterator.md] + * sentinel_for[link /reference/iterator/sentinel_for.md] * std::back_inserter[link /reference/iterator/back_inserter.md] * std::begin[link /reference/iterator/begin.md] * std::distance[link /reference/iterator/distance.md] @@ -174,6 +185,7 @@ * [link /reference/ranges.md] * bidirectional_range[link /reference/ranges/bidirectional_range.md] * borrowed_range[link /reference/ranges/borrowed_range.md] + * borrowed_subrange_t[link /reference/ranges/borrowed_subrange_t.md] * common_range[link /reference/ranges/common_range.md] * const_iterator_t[link /reference/ranges/const_iterator_t.md] * const_sentinel_t[link /reference/ranges/const_sentinel_t.md] @@ -192,6 +204,7 @@ * range[link /reference/ranges/range.md] * sentinel_t[link /reference/ranges/sentinel_t.md] * sized_range[link /reference/ranges/sized_range.md] + * subrange[link /reference/ranges/subrange.md] * view_interface[link /reference/ranges/view_interface.md] * view[link /reference/ranges/view.md] * viewable_range[link /reference/ranges/viewable_range.md] diff --git a/lang/cpp23.md b/lang/cpp23.md index 093c05e037..7aaa353d51 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -158,7 +158,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 - [`std::ranges::find_last()`](/reference/algorithm/ranges_find_last.md.nolink) - [`std::ranges::find_last_if()`](/reference/algorithm/find_last_if.md.nolink) - [`std::ranges::find_last_if_not()`](/reference/algorithm/find_last_if_not.md.nolink) -- [``](/reference/algorithm.md)に、範囲に特定の値が含まれているかを判定する[`std::ranges::contains()`](/reference/algorithm/ranges_contains.md.nolink)、[`std::ranges::contains_subrange`](/reference/algorithm/ranges_contains_subrange.md.nolink)を追加 +- [``](/reference/algorithm.md)に、範囲に特定の値が含まれているかを判定する[`std::ranges::contains()`](/reference/algorithm/ranges_contains.md)、[`std::ranges::contains_subrange`](/reference/algorithm/ranges_contains_subrange.md)を追加 - [``](/reference/algorithm.md)に、数値に限定しない汎用的な畳み込みアルゴリズムとして、以下を追加: - [`std::ranges::fold_left()`](/reference/algorithm/ranges_fold_left.md) - [`std::ranges::fold_left_first()`](/reference/algorithm/ranges_fold_left_first.md) diff --git a/reference/algorithm.md b/reference/algorithm.md index c045a2e4fe..58bc01f2a6 100644 --- a/reference/algorithm.md +++ b/reference/algorithm.md @@ -139,25 +139,27 @@ ranges::sort(pv, {}, &Parson::name); | [`equal`](algorithm/equal.md) | 2つの範囲を等値比較する | | | [`search`](algorithm/search.md) | 指定された最初のサブシーケンスを検索する | | | [`search_n`](algorithm/search_n.md) | 指定された最初のサブシーケンスを検索する | | -| [`ranges::all_of`](algorithm/ranges_all_of.md) | 全ての要素が条件を満たしているかを調べる | C++20 | -| [`ranges::any_of`](algorithm/ranges_any_of.md) | どれかの要素が条件を満たしているかを調べる | C++20 | -| [`ranges::none_of`](algorithm/ranges_none_of.md) | 全ての要素が条件を満たしていないかを調べる | C++20 | -| [`ranges::for_each`](algorithm/ranges_for_each.md) | 全ての要素に対して処理を行う | C++20 | -| [`ranges::for_each_n`](algorithm/ranges_for_each_n.md) | 範囲の先頭N個の要素に対して処理を行う | C++20 | -| [`ranges::find`](algorithm/ranges_find.md) | 指定された値を検索する | C++20 | -| [`ranges::find_if`](algorithm/ranges_find_if.md) | 条件を満たす最初の要素を検索する | C++20 | -| [`ranges::find_if_not`](algorithm/ranges_find_if_not.md) | 条件を満たしていない最初の要素を検索する | C++20 | -| [`ranges::find_end`](algorithm/ranges_find_end.md) | 指定された最後のサブシーケンスを検索する | C++20 | -| [`ranges::find_first_of`](algorithm/ranges_find_first_of.md) | ある集合の1つとマッチする最初の要素を検索する | C++20 | -| [`ranges::adjacent_find`](algorithm/ranges_adjacent_find.md) | 隣接する要素で条件を満たしている最初の要素を検索する | C++20 | -| [`ranges::count`](algorithm/ranges_count.md) | 指定された値である要素の数を数える | C++20 | -| [`ranges::count_if`](algorithm/ranges_count_if.md) | 条件を満たしている要素の数を数える | C++20 | -| [`ranges::mismatch`](algorithm/ranges_mismatch.md) | 2つの範囲が一致していない場所を検索する | C++20 | -| [`ranges::equal`](algorithm/ranges_equal.md) | 2つの範囲を等値比較する | C++20 | -| [`ranges::search`](algorithm/ranges_search.md) | 指定された最初のサブシーケンスを検索する | C++20 | -| [`ranges::search_n`](algorithm/ranges_search_n.md) | 指定された最初のサブシーケンスを検索する | C++20 | -| [`ranges::starts_with`](algorithm/ranges_starts_with.md) | 先頭が指定されたシーケンスと一致するかを調べる | C++23 | -| [`ranges::ends_with`](algorithm/ranges_ends_with.md) | 末尾が指定されたシーケンスと一致するかを調べる | C++23 | +| [`ranges::all_of`](algorithm/ranges_all_of.md) | 全ての要素が条件を満たしているかを調べる | C++20 | +| [`ranges::any_of`](algorithm/ranges_any_of.md) | どれかの要素が条件を満たしているかを調べる | C++20 | +| [`ranges::none_of`](algorithm/ranges_none_of.md) | 全ての要素が条件を満たしていないかを調べる | C++20 | +| [`ranges::contains`](algorithm/ranges_contains.md) | シーケンスの中に指定された要素があるか調べる | C++23 | +| [`ranges::contains_subrange`](algorithm/ranges_contains_subrange.md) | シーケンスの中に指定されたシーケンスがあるか調べる | C++23 | +| [`ranges::for_each`](algorithm/ranges_for_each.md) | 全ての要素に対して処理を行う | C++20 | +| [`ranges::for_each_n`](algorithm/ranges_for_each_n.md) | 範囲の先頭N個の要素に対して処理を行う | C++20 | +| [`ranges::find`](algorithm/ranges_find.md) | 指定された値を検索する | C++20 | +| [`ranges::find_if`](algorithm/ranges_find_if.md) | 条件を満たす最初の要素を検索する | C++20 | +| [`ranges::find_if_not`](algorithm/ranges_find_if_not.md) | 条件を満たしていない最初の要素を検索する | C++20 | +| [`ranges::find_end`](algorithm/ranges_find_end.md) | 指定された最後のサブシーケンスを検索する | C++20 | +| [`ranges::find_first_of`](algorithm/ranges_find_first_of.md) | ある集合の1つとマッチする最初の要素を検索する | C++20 | +| [`ranges::adjacent_find`](algorithm/ranges_adjacent_find.md) | 隣接する要素で条件を満たしている最初の要素を検索する | C++20 | +| [`ranges::count`](algorithm/ranges_count.md) | 指定された値である要素の数を数える | C++20 | +| [`ranges::count_if`](algorithm/ranges_count_if.md) | 条件を満たしている要素の数を数える | C++20 | +| [`ranges::mismatch`](algorithm/ranges_mismatch.md) | 2つの範囲が一致していない場所を検索する | C++20 | +| [`ranges::equal`](algorithm/ranges_equal.md) | 2つの範囲を等値比較する | C++20 | +| [`ranges::search`](algorithm/ranges_search.md) | 指定された最初のサブシーケンスを検索する | C++20 | +| [`ranges::search_n`](algorithm/ranges_search_n.md) | 指定された最初のサブシーケンスを検索する | C++20 | +| [`ranges::starts_with`](algorithm/ranges_starts_with.md) | 先頭が指定されたシーケンスと一致するかを調べる | C++23 | +| [`ranges::ends_with`](algorithm/ranges_ends_with.md) | 末尾が指定されたシーケンスと一致するかを調べる | C++23 | ### `fold`アルゴリズム diff --git a/reference/algorithm/ranges_contains.md b/reference/algorithm/ranges_contains.md new file mode 100644 index 0000000000..e9ecabb7c9 --- /dev/null +++ b/reference/algorithm/ranges_contains.md @@ -0,0 +1,92 @@ +# contains +* algorithm[meta header] +* std::ranges[meta namespace] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace ranges { + // (1) + template S, class T, class Proj = identity> + requires indirect_binary_predicate, const T*> + constexpr bool contains(I first, S last, const T& value, Proj proj = {}); + + // (2) + template + requires + indirect_binary_predicate, Proj>, const T*> + constexpr bool contains(R&& r, const T& value, Proj proj = {}); +} +``` + +## 概要 +指定された値が含まれるか調べる。 + +- (1): イテレータ範囲を指定する +- (2): Rangeを直接指定する + +## 戻り値 +```cpp +ranges​::​find(std​::​move(first), last, value, proj) != last +``` +* ranges​::​find[link ranges_find.md] + +## 計算量 +最大で `last - first` 回比較を行う + + +## 例 +```cpp example +#include +#include +#include + +int main() { + constexpr std::array v = { 3, 1, 4 }; + if (std::ranges::contains(v, 1)) { + std::println("found"); + } else { + std::println("not found"); + } +} +``` +* std::ranges::contains[color ff0000] + +### 出力 +``` +found +``` + + +## 実装例 +```cpp +struct contains_impl { + template S, class T, class Proj = identity> + requires indirect_binary_predicate, const T*> + constexpr bool operator()(I first, S last, const T& value, Proj proj = {}) const { + return ranges​::​find(std​::​move(first), last, value, proj) != last; + } + + template + requires indirect_binary_predicate, Proj>, const T*> + constexpr bool operator()(R&& r, const T& value, Proj proj = {}) const { + return ranges​::​find(std::forward(r), value, proj) != last; + } +}; + +inline constexpr contains_impl contains; +``` +* ranges​::​find[link ranges_find.md] + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [N4950 27 Algorithms library](https://timsong-cpp.github.io/cppwp/n4950/algorithms) diff --git a/reference/algorithm/ranges_contains_subrange.md b/reference/algorithm/ranges_contains_subrange.md new file mode 100644 index 0000000000..318f5f7bd2 --- /dev/null +++ b/reference/algorithm/ranges_contains_subrange.md @@ -0,0 +1,103 @@ +# search +* algorithm[meta header] +* std::ranges[meta namespace] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + // (1) + template S1, + forward_iterator I2, sentinel_for S2, + class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> + requires indirectly_comparable + constexpr bool ranges::contains_subrange(I1 first1, S1 last1, I2 first2, S2 last2, + Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); + + // (2) + template + requires indirectly_comparable, iterator_t, Pred, Proj1, Proj2> + constexpr bool ranges::contains_subrange(R1&& r1, R2&& r2, Pred pred = {}, + Proj1 proj1 = {}, Proj2 proj2 = {}); +} +``` + +## 概要 +あるシーケンスの中に、特定のサブシーケンスが含まれるか調べる。 + +- (1): イテレータ範囲を指定する +- (2): Rangeを直接指定する + +サブシーケンスが空の場合は、常に`true`を返す。 + +## 戻り値 +```cpp +first2 == last2 || !ranges​::​search(first1, last1, first2, last2, pred, proj1, proj2).empty() +``` + +## 計算量 +最大で `(last1 - first1) * (last2 - first2)` 回の、対応する比較もしくは述語が適用される + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = { 1,2,1,2,3 }; + std::list ls = { 1,2 }; + + if (std::ranges::contains_subrange(v, ls)) { + std::println("found"); + } else { + std::println("not found"); + } +} +``` +* std::ranges::contains_subrange[color ff0000] + +#### 出力 +``` +found +``` + + +## 実装例 +```cpp +struct contains_subrange_impl { + template S1, + forward_iterator I2, sentinel_for S2, + class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> + requires indirectly_comparable + constexpr bool operator()(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) const { + return first2 == last2 || !ranges​::​search(first1, last1, first2, last2, pred, proj1, proj2).empty(); + } + + template + requires indirectly_comparable, iterator_t, Pred, Proj1, Proj2> + constexpr bool operator()(R1&& r1, R2&& r2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) const { + return ranges::empty(r2) || !ranges​::​search(std::forward(r1), std::forward(r2), pred, proj1, proj2).empty(); + } +}; + +inline constexpr contains_subrange_impl contains_subrange; +``` +* ranges​::​search[link ranges_​search.md] +* ranges::empty[link /reference/ranges/empty.md] + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [N4950 27 Algorithms library](https://timsong-cpp.github.io/cppwp/n4950/algorithms) From 018bcd80bfc5df73940bca5e1d189cf2be966ab9 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sun, 10 Mar 2024 01:39:25 +0900 Subject: [PATCH 0820/3948] =?UTF-8?q?=E4=B8=8D=E5=8F=AF=E8=A6=96=E6=96=87?= =?UTF-8?q?=E5=AD=97=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_contains.md | 10 +++++----- reference/algorithm/ranges_contains_subrange.md | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/reference/algorithm/ranges_contains.md b/reference/algorithm/ranges_contains.md index e9ecabb7c9..014789cd91 100644 --- a/reference/algorithm/ranges_contains.md +++ b/reference/algorithm/ranges_contains.md @@ -27,9 +27,9 @@ namespace ranges { ## 戻り値 ```cpp -ranges​::​find(std​::​move(first), last, value, proj) != last +ranges::find(std::move(first), last, value, proj) != last ``` -* ranges​::​find[link ranges_find.md] +* ranges::find[link ranges_find.md] ## 計算量 最大で `last - first` 回比較を行う @@ -64,19 +64,19 @@ struct contains_impl { template S, class T, class Proj = identity> requires indirect_binary_predicate, const T*> constexpr bool operator()(I first, S last, const T& value, Proj proj = {}) const { - return ranges​::​find(std​::​move(first), last, value, proj) != last; + return ranges::find(std::move(first), last, value, proj) != last; } template requires indirect_binary_predicate, Proj>, const T*> constexpr bool operator()(R&& r, const T& value, Proj proj = {}) const { - return ranges​::​find(std::forward(r), value, proj) != last; + return ranges::find(std::forward(r), value, proj) != last; } }; inline constexpr contains_impl contains; ``` -* ranges​::​find[link ranges_find.md] +* ranges::find[link ranges_find.md] ## バージョン ### 言語 diff --git a/reference/algorithm/ranges_contains_subrange.md b/reference/algorithm/ranges_contains_subrange.md index 318f5f7bd2..460c17b481 100644 --- a/reference/algorithm/ranges_contains_subrange.md +++ b/reference/algorithm/ranges_contains_subrange.md @@ -33,7 +33,7 @@ namespace std::ranges { ## 戻り値 ```cpp -first2 == last2 || !ranges​::​search(first1, last1, first2, last2, pred, proj1, proj2).empty() +first2 == last2 || !ranges::search(first1, last1, first2, last2, pred, proj1, proj2).empty() ``` ## 計算量 @@ -73,20 +73,20 @@ struct contains_subrange_impl { class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> requires indirectly_comparable constexpr bool operator()(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) const { - return first2 == last2 || !ranges​::​search(first1, last1, first2, last2, pred, proj1, proj2).empty(); + return first2 == last2 || !ranges::search(first1, last1, first2, last2, pred, proj1, proj2).empty(); } template requires indirectly_comparable, iterator_t, Pred, Proj1, Proj2> constexpr bool operator()(R1&& r1, R2&& r2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}) const { - return ranges::empty(r2) || !ranges​::​search(std::forward(r1), std::forward(r2), pred, proj1, proj2).empty(); + return ranges::empty(r2) || !ranges::search(std::forward(r1), std::forward(r2), pred, proj1, proj2).empty(); } }; inline constexpr contains_subrange_impl contains_subrange; ``` -* ranges​::​search[link ranges_​search.md] +* ranges::search[link ranges_search.md] * ranges::empty[link /reference/ranges/empty.md] ## バージョン From 4290e9d4a6098fafea20ec4557f0ce4a33ccb586 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sun, 10 Mar 2024 01:42:31 +0900 Subject: [PATCH 0821/3948] Update reverse_view.md --- reference/ranges/reverse_view.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/ranges/reverse_view.md b/reference/ranges/reverse_view.md index 80dabb5ae9..156a8224a0 100644 --- a/reference/ranges/reverse_view.md +++ b/reference/ranges/reverse_view.md @@ -45,7 +45,7 @@ namespace std::ranges { - それ以外のとき、[`subrange`](subrange.md)`(E.end().base(), E.begin().base())`と等しい - それ以外のとき、`reverse_view{E}`と等しい -`V | views::reverse | views::reverse`のように連続して適用したとき、結果として元に戻るのではなく、式の効果自体が`V`と等しくなる。 +`V | views::reverse | views::reverse`のように連続して適用したとき、結果として元に戻るのではなく、初めから逆順にしないようになる。 ## メンバ関数 @@ -184,4 +184,4 @@ namespace std::ranges { ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) - [C++20 ranges](https://techbookfest.org/product/5134506308665344) -- [P2017R1 Conditionally borrowed ranges](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2017r1.html) \ No newline at end of file +- [P2017R1 Conditionally borrowed ranges](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2017r1.html) From 91b999771cf7e08edfed459c6d3b74921f2ec00d Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sun, 10 Mar 2024 11:17:53 +0900 Subject: [PATCH 0822/3948] =?UTF-8?q?=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=BC?= =?UTF-8?q?=E5=AE=9A=E7=BE=A9Range=E3=82=A2=E3=83=80=E3=83=97=E3=82=BF?= =?UTF-8?q?=E3=81=AE=E3=83=91=E3=82=A4=E3=83=97=E3=83=A9=E3=82=A4=E3=83=B3?= =?UTF-8?q?=E6=BC=94=E7=AE=97=E5=AD=90=E5=AF=BE=E5=BF=9C=20#1072?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_DEFINED_WORDS.json | 6 + GLOBAL_QUALIFY_LIST.txt | 2 + lang/cpp23.md | 4 +- lang/cpp26.md | 2 +- reference/functional.md | 1 + reference/functional/bind_back.md | 137 +++++++++++++++++ reference/ranges.md | 19 ++- reference/ranges/range_adaptor_closure.md | 173 ++++++++++++++++++++++ 8 files changed, 337 insertions(+), 7 deletions(-) create mode 100644 reference/functional/bind_back.md create mode 100644 reference/ranges/range_adaptor_closure.md diff --git a/GLOBAL_DEFINED_WORDS.json b/GLOBAL_DEFINED_WORDS.json index 296f9b9ac4..9d9cbfe40a 100644 --- a/GLOBAL_DEFINED_WORDS.json +++ b/GLOBAL_DEFINED_WORDS.json @@ -64,9 +64,15 @@ "プログラム定義型": { "desc": "標準ライブラリの型を除く、ユーザー(プログラマ)によって定義された型のこと" }, + "プログラム定義": { + "desc": "ユーザー(プログラマ)によって定義されること(標準ライブラリで定義されるものを除く)" + }, "ユーザー定義型": { "redirect": "プログラム定義型" }, + "ユーザー定義": { + "redirect": "プログラム定義" + }, "適格要件": { "desc": "満たさなければプログラムが不適格となる要件。`static_assert`や関数のdelete宣言などに相当する" }, diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index e7ea56fa48..50e346b70f 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -259,7 +259,9 @@ * std::tie[link /reference/tuple/tie.md] * [link /reference/type_traits.md] * invoke_result_t[link /reference/type_traits/invoke_result.md] + * is_class_v[link /reference/type_traits/is_class.md] * is_object_v[link /reference/type_traits/is_object.md] + * remove_cv_t[link /reference/type_traits/remove_cv.md] * remove_cvref_t[link /reference/type_traits/remove_cvref.md] * std::false_type[link /reference/type_traits/false_type.md] * std::is_same_v[link /reference/type_traits/is_same.md] diff --git a/lang/cpp23.md b/lang/cpp23.md index 7aaa353d51..a7838b5d5e 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -141,7 +141,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 - Rangeを先頭に追加する`prepend_range()`メンバ関数 - Rangeを末尾に追加する`append_range()`メンバ関数 - Rangeを代入する`assign_range()`メンバ関数 -- ユーザー定義のRangeアダプタがパイプライン演算子 `|` をサポートしやすくするために、[``](/reference/ranges.md)に[`std::ranges::range_adaptor_closure`](/reference/ranges/range_adaptor_closure.md.nolink)クラスを追加 +- ユーザー定義のRangeアダプタがパイプライン演算子 `|` をサポートしやすくするために、[``](/reference/ranges.md)に[`std::ranges::range_adaptor_closure`](/reference/ranges/range_adaptor_closure.md)クラスを追加 - [``](/reference/ranges.md)に、Rangeを連結させる[`join_with`](/reference/ranges/join_with_view.md)を追加 - Rangeを指定の大きさで分割する[`std::views::chunk`](/reference/ranges/chunk_view.md)と、Rangeを指定の大きさの隣接要素で分割する[`std::views::slide`](/reference/ranges/slide_view.md)を追加 - Rangeを条件一致する間の要素で分割する[`std::views::chunk_by`](/reference/ranges/chunk_by_view.md)を追加 @@ -192,7 +192,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 ### 関数オブジェクト - [`std::invoke()`](/reference/functional/invoke.md)の戻り値型を指定するバージョンである[`std::invoke_r()`](/reference/functional/invoke_r.md)を追加 - [`std::function`](/reference/functional/function.md)クラスと等価な機能をもつ、ムーブのみ可能な[`std::move_only_function`](/reference/functional/move_only_function.md)クラスを追加 -- ユーザー定義のRangeアダプタがパイプライン演算子 `|` をサポートしやすくするために、末尾から引数を束縛する[`std::bind_back()`](/reference/functional/bind_back.md.nolink)関数を追加 +- ユーザー定義のRangeアダプタがパイプライン演算子 `|` をサポートしやすくするために、末尾から引数を束縛する[`std::bind_back()`](/reference/functional/bind_back.md)関数を追加 ### メモリ diff --git a/lang/cpp26.md b/lang/cpp26.md index 956bef54e0..899443a53c 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -101,7 +101,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 ### 関数オブジェクト - 所有権を保持しない[`std::function`](/reference/functional/function.md)として、[``](/reference/functional.md)に[`std::function_ref`](/reference/functional/function_ref.md)クラスを追加 - [`std::move_only_function`](/reference/functional/move_only_function.md)のコピー可能版として、[``](/reference/functional.md)に[`std::copyable_function`](/reference/functional/copyable_function.md)クラスを追加 -- [`std::bind_front()`](/reference/functional/bind_front.md)と[`std::bind_back()`](/reference/functional/bind_back.md.nolink)に、非型テンプレート引数として関数を指定するオーバーロードを追加 +- [`std::bind_front()`](/reference/functional/bind_front.md)と[`std::bind_back()`](/reference/functional/bind_back.md)に、非型テンプレート引数として関数を指定するオーバーロードを追加 - 関連して、非型テンプレート引数の関数オブジェクトを反転させられるよう、[`not_fn()`](/reference/functional/not_fn.md)に非型テンプレート引数版のオーバーロードを追加 diff --git a/reference/functional.md b/reference/functional.md index 89b0b5430b..875d5fa181 100644 --- a/reference/functional.md +++ b/reference/functional.md @@ -42,6 +42,7 @@ struct doubler { | 名前 | 説明 | 対応バージョン | |----------------------------------------------------------|----------------------------------------|-------| | [`bind_front`](functional/bind_front.md) | 関数の引数を先頭から順に部分適用する(function template) | C++20 | +| [`bind_back`](functional/bind_back.md) | 関数の引数を末尾から順に部分適用する(function template) | C++23 | | [`bind`](functional/bind.md) | 関数の引数を部分適用する(function template) | C++11 | | [`is_bind_expression`](functional/is_bind_expression.md) | 型を`bind`の式と見なすか判定する(class template) | C++11 | | [`is_placeholder`](functional/is_placeholder.md) | 型がプレースホルダーかどうかを判定する(class template) | C++11 | diff --git a/reference/functional/bind_back.md b/reference/functional/bind_back.md new file mode 100644 index 0000000000..f0e8af0b80 --- /dev/null +++ b/reference/functional/bind_back.md @@ -0,0 +1,137 @@ +# bind_back +* functional[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template + constexpr unspecified bind_back(F&&, Args&&...); +} +``` +* unspecified[italic] + +## 概要 +関数の引数を末尾から順に部分適用する。 + +先頭から適用する場合は[`bind_front`](bind_front.md)を用いる。 + +## テンプレートパラメータ制約 +[`decay_t`](/reference/type_traits/decay.md)``を適用した型を`FD`、 +[`std::decay_t`](/reference/type_traits/decay.md)`...`を適用した型パラメータパックを`BoundArgs`であるとして、 + +- `FD`が[`std::move_constructible`](/reference/concepts/move_constructible.md)要件を満たすこと +- `BoundArgs`のそれぞれの型`Ti`が[オブジェクト型](/reference/type_traits/is_object.md)である場合、[`std::move_constructible`](/reference/concepts/move_constructible.md)要件を満たすこと + + +## 適格要件 +- [`conjunction_v`](/reference/type_traits/conjunction.md)`<`[`is_constructible`](/reference/type_traits/is_constructible.md)`,` [`is_move_constructible`](/reference/type_traits/is_move_constructible.md)`,` [`is_constructible`](/reference/type_traits/is_constructible.md)`...,` [`is_move_constructible`](/reference/type_traits/is_move_constructible.md)`...>`が`true`であること + + +## 戻り値 + +呼び出し可能な`f`を[`std::invoke()`](invoke.md)で呼び出した時に必要な引数列に後方一致する`f`と`args...`を完全転送して保持し、後から残りの引数リストを渡すことで`f`を呼び出せる未規定の関数オブジェクトを返す。 + +返される関数オブジェクトは渡された引数(`f, args...`)を参照として保持せず、適切にコピー/ムーブして保持する。 + +## 例外 +- 関数オブジェクト`f`のムーブによって任意の例外が送出される可能性がある + +## この機能が必要になった背景・経緯 + +C++23で[`Rangeアダプタ`](/reference/ranges/range.md)のユーザー定義がサポートされた。 + +[`Rangeアダプタオブジェクト`](/reference/ranges/range.md)である`adaptor`が2つ以上の引数をとる場合、以下の3つの式は等しい。 + +```cpp +adaptor(range, args...) +adaptor(args...)(range) +range | adaptor(args...) +``` + +ここで、Rangeアダプタオブジェクトの第2引数以降を部分適用した結果が[`Rangeアダプタクロージャオブジェクト`](/reference/ranges/range.md)となる。 +ユーザー定義するRangeアダプタオブジェクトの`operator()`において、この部分適用を行うためのユーティリティとして`bind_back`が提案された。 + +## 例 +```cpp example +#include +#include +#include +#include + +template +class closure_t : public std::ranges::range_adaptor_closure> { + F f; +public: + constexpr closure_t(F f) : f(f) { } + + template + requires std::invocable + constexpr auto operator()(R&& r) const { + return f(std::views::all(std::forward(r))); + } +}; + +template +class adaptor_t { + F f; +public: + constexpr adaptor_t(F f) : f(f) { } + + template + constexpr auto operator()(Args&&... args) const { + if constexpr (std::invocable) { + return f(std::forward(args)...); + } else { + return closure_t(std::bind_back(f, std::forward(args)...)); + } + } +}; + +inline constexpr closure_t user_defined_join + = [] + (R&& r) { + return std::ranges::join_view(std::forward(r)); + }; + +inline constexpr adaptor_t user_defined_transform + = [] + (R&& r, F&& f) { + return std::ranges::transform_view(std::forward(r), std::forward(f)); + }; + +int main() { + std::vector> vv = {{0, 1, 2}, {3, 4, 5}, {6}}; + + std::println("{}", vv | user_defined_join | user_defined_transform([](int x){ return x * x; })); +} +``` +* std::bind_back[color ff0000] +* std::ranges::range_adaptor_closure[link /reference/ranges/range_adaptor_closure.md] +* std::bind_back[link /reference/functional/bind_back.md] +* std::invocable[link /reference/concepts/invocable.md] +* std::views::all[link /reference/ranges/all.md] +* std::ranges::range[link /reference/ranges/range.md] +* std::ranges::viewable_range[link /reference/ranges/viewable_range.md] +* std::ranges::join_view[link /reference/ranges/join_view.md] +* std::ranges::transform_view[link /reference/ranges/transform_view.md] + +### 出力 +``` +[0, 1, 4, 9, 16, 25, 36] +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P2387R3 Pipe support for user-defined range adaptors](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2387r3.html#nanorange) +- [rangesのパイプにアダプトするには](https://onihusube.hatenablog.com/entry/2022/04/24/010041) diff --git a/reference/ranges.md b/reference/ranges.md index 66c193db16..4d4acd76bb 100644 --- a/reference/ranges.md +++ b/reference/ranges.md @@ -172,8 +172,7 @@ Rangeファクトリは、Rangeではないオブジェクトから[`view`](rang ## Rangeアダプタ -Rangeアダプタは、既存のRangeに作用して新たな[`view`](ranges/view.md)を生成するものである。 -その実体はカスタマイゼーションポイントオブジェクトとなっている。 +Rangeアダプタは、既存のRangeに作用して新たなRangeを生成するものである。 RangeアダプタをRangeに作用させる方法には、一部の例外を除き、関数記法とパイプライン記法の2つがある。 @@ -199,7 +198,14 @@ for (auto&& item : r | R) { } ``` -第1引数に[`viewable_range`](ranges/viewable_range.md)を受け取って[`view`](ranges/view.md)を返すカスタマイゼーションポイントオブジェクトを、**Rangeアダプタオブジェクト**という。とくに、1引数のものを**Rangeアダプタクロージャオブジェクト**という。 +**Rangeアダプタオブジェクト**は次のように定義される。 + +- 第1引数に[`viewable_range`](ranges/viewable_range.md)を受け取って[`view`](ranges/view.md)を返すカスタマイゼーションポイントオブジェクト + +また、**Rangeアダプタクロージャオブジェクト**は次のように定義される。 + +- (C++20) [`viewable_range`](ranges/viewable_range.md)を受け取って[`view`](ranges/view.md)を返す単項関数オブジェクト +- (C++23) Rangeを受け取る単項関数オブジェクト Rangeアダプタオブジェクト`adaptor`が2つ以上の引数をとる場合、以下の3つの式は等しい。 @@ -209,7 +215,12 @@ adaptor(args...)(range) range | adaptor(args...) ``` -このとき、`adaptor(args...)`はRangeアダプタクロージャオブジェクトになっている。 +このとき、式`adaptor(args...)`の値がRangeアダプタクロージャオブジェクトになっている。 + +| 名前 | 説明 | 対応バージョン | +|--------------------------------------------------------------|---------------------------------------------------------------------|----------------| +| [`range_adaptor_closure`](ranges/range_adaptor_closure.md) | Rangeアダプタクロージャオブジェクトの基底クラス (class template) | C++23 | + ### all view diff --git a/reference/ranges/range_adaptor_closure.md b/reference/ranges/range_adaptor_closure.md new file mode 100644 index 0000000000..8043ae8bba --- /dev/null +++ b/reference/ranges/range_adaptor_closure.md @@ -0,0 +1,173 @@ +# range_adaptor_closure +* ranges[meta header] +* std::ranges[meta namespace] +* class template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template + requires is_class_v && same_as> + class range_adaptor_closure { }; +} +``` + +## 概要 +`range_adaptor_closure` は、Rangeアダプタクロージャオブジェクトの基底クラスとなる空のクラス。 + +以下の要件を満たす型`T`のオブジェクト`t`は、Rangeアダプタクロージャオブジェクトとなることが保証される。 + +- `t`はRangeを受け取る単項関数オブジェクトである +- `T`は[`derived_from`](/reference/concepts/derived_from.md)`>`のモデルである +- `T`以外の型`U`に対して、`T`は`range_adaptor_closure`の派生クラスではない +- `T`は[`range`](range.md)のモデルではない + +テンプレートパラメーター`D`は不完全型であってもよい。 +ただし、`D`が`|`演算子のオペランドとなる場合は、`D`は完全型かつ[`derived_from`](/reference/concepts/derived_from.md)`>`のモデルでなければならない。 + +CV修飾を含む`D`を引数とする `|` 演算子を含む式の動作は、プログラム定義の`operator|`関数が選択された場合は未定義である。 + +`range_adaptor_closure`を特殊化するプログラムの動作は未定義である。 + +## この機能が必要になった背景・経緯 + +Rangeアダプタはその振る舞いだけが規定されていて、Rangeアダプタとなる要件や、具体的なRangeアダプタのクラスは規定されていなかったため、ユーザーが新たに定義することは困難であった。 + +各処理系がRangeアダプタを実装する際、どのRangeアダプタでも共通するコードを基底クラスにまとめることが行われ、パイプライン記法をサポートする`operator|`も基底クラスに対して実装された。 +そのような経験を踏まえ、Rangeアダプタクロージャオブジェクトの基底クラスとして`range_adaptor_closure`が標準化された。 + +ユーザーは、以下のように`range_adaptor_closure`を継承することで、Rangeアダプタクロージャオブジェクトを定義することができる。 + +```cpp +class user_defined_closure_t : public std::ranges::range_adaptor_closure { +public: + template + constexpr auto operator()(R&& r) const { + // user_defined_viewを構築して返す + return user_defined_view(std::forward(r)); + } +}; + +inline constexpr user_defined_closure_t user_defined; +``` + +パイプライン記法をサポートする方法は規定されていないが、一般には処理系がRangeと`range_adaptor_closure`を引数とする`operator|`を定義することで行われる。 + +## 例 +```cpp example +#include +#include +#include +#include + +template +class closure_t : public std::ranges::range_adaptor_closure> { + F f; +public: + constexpr closure_t(F f) : f(f) { } + + template + requires std::invocable + constexpr auto operator()(R&& r) const { + return f(std::views::all(std::forward(r))); + } +}; + +template +class adaptor_t { + F f; +public: + constexpr adaptor_t(F f) : f(f) { } + + template + constexpr auto operator()(Args&&... args) const { + if constexpr (std::invocable) { + return f(std::forward(args)...); + } else { + return closure_t(std::bind_back(f, std::forward(args)...)); + } + } +}; + +inline constexpr closure_t user_defined_join + = [] + (R&& r) { + return std::ranges::join_view(std::forward(r)); + }; + +inline constexpr adaptor_t user_defined_transform + = [] + (R&& r, F&& f) { + return std::ranges::transform_view(std::forward(r), std::forward(f)); + }; + +int main() { + std::vector> vv = {{0, 1, 2}, {3, 4, 5}, {6}}; + + std::println("{}", vv | user_defined_join | user_defined_transform([](int x){ return x * x; })); +} +``` +* std::ranges::range_adaptor_closure[color ff0000] +* std::bind_back[link /reference/functional/bind_back.md] +* std::invocable[link /reference/concepts/invocable.md] +* std::views::all[link all.md] +* std::ranges::range[link range.md] +* std::ranges::viewable_range[link viewable_range.md] +* std::ranges::join_view[link join_view.md] +* std::ranges::transform_view[link transform_view.md] + +### 出力 +``` +[0, 1, 4, 9, 16, 25, 36] +``` + +## 例 ジェネレータを使用してRangeアダプタを定義する +```cpp example +#include +#include +#include +#include + +class positive_impl : public std::ranges::range_adaptor_closure { +public: + template + constexpr std::generator> operator()(R&& r) const { + for(auto&& n : r) { + if(n > 0) { + co_yield n; + } + } + } +}; + +inline constexpr positive_impl positive; + +int main() { + std::vector v = {0, -1, 2, -3, 4, -5, 6, -7}; + + std::println(v | positive); +} +``` +* std::ranges::range_adaptor_closure[color ff0000] +* std::generator[link /reference/generator/generator.md] +* std::ranges::range[link range.md] +* std::ranges::range_value_t[link range_value_t.md] + +### 出力 +``` +[2, 4, 6] +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [N4950 26 Ranges library](https://timsong-cpp.github.io/cppwp/n4950/ranges) +- [rangesのパイプにアダプトするには](https://onihusube.hatenablog.com/entry/2022/04/24/010041) From a4fff7c3cbb10066a0cdac2d753cc52d3e22f8e7 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sun, 10 Mar 2024 11:30:08 +0900 Subject: [PATCH 0823/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/functional/bind_back.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/functional/bind_back.md b/reference/functional/bind_back.md index f0e8af0b80..7688b21193 100644 --- a/reference/functional/bind_back.md +++ b/reference/functional/bind_back.md @@ -40,9 +40,9 @@ namespace std { ## この機能が必要になった背景・経緯 -C++23で[`Rangeアダプタ`](/reference/ranges/range.md)のユーザー定義がサポートされた。 +C++23で[Rangeアダプタ](/reference/ranges/range.md)のユーザー定義がサポートされた。 -[`Rangeアダプタオブジェクト`](/reference/ranges/range.md)である`adaptor`が2つ以上の引数をとる場合、以下の3つの式は等しい。 +[Rangeアダプタオブジェクト](/reference/ranges/range.md)である`adaptor`が2つ以上の引数をとる場合、以下の3つの式は等しい。 ```cpp adaptor(range, args...) @@ -50,7 +50,7 @@ adaptor(args...)(range) range | adaptor(args...) ``` -ここで、Rangeアダプタオブジェクトの第2引数以降を部分適用した結果が[`Rangeアダプタクロージャオブジェクト`](/reference/ranges/range.md)となる。 +ここで、Rangeアダプタオブジェクトの第2引数以降を部分適用した結果が[Rangeアダプタクロージャオブジェクト](/reference/ranges/range.md)となる。 ユーザー定義するRangeアダプタオブジェクトの`operator()`において、この部分適用を行うためのユーティリティとして`bind_back`が提案された。 ## 例 From 2eb18f413a35848b067ff8e017956ef94f449b9a Mon Sep 17 00:00:00 2001 From: yoh Date: Sun, 10 Mar 2024 20:19:12 +0900 Subject: [PATCH 0824/3948] linalg: scaled(#1233) --- reference/linalg.md | 4 +- reference/linalg/scaled.md | 79 +++++++++++++++++++ reference/linalg/scaled_accessor.md | 76 ++++++++++++++++++ reference/linalg/scaled_accessor/access.md | 32 ++++++++ reference/linalg/scaled_accessor/offset.md | 32 ++++++++ .../linalg/scaled_accessor/op_constructor.md | 44 +++++++++++ 6 files changed, 265 insertions(+), 2 deletions(-) create mode 100644 reference/linalg/scaled.md create mode 100644 reference/linalg/scaled_accessor.md create mode 100644 reference/linalg/scaled_accessor/access.md create mode 100644 reference/linalg/scaled_accessor/offset.md create mode 100644 reference/linalg/scaled_accessor/op_constructor.md diff --git a/reference/linalg.md b/reference/linalg.md index f08d71f9ef..f9dd4f11ab 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -32,8 +32,8 @@ BLAS互換アルゴリズムは、演算対象データの次元数や計算オ | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`layout_blas_packed`](linalg/layout_blas_packed.md) | 行列要素のBLAS互換パックレイアウトに対応する[レイアウトマッピングポリシー](mdspan/LayoutMappingPolicy.md) (class template) | C++26 | -| [`scaled_accessor`](linalg/scaled_accessor.md.nolink) | `scaled`関数用の[アクセサポリシー](mdspan/AccessorPolicy.md) (class template) | C++26 | -| [`scaled`](linalg/scaled.md.nolink) | 要素値をスカラ倍した読み取り専用`std::mdspan`を作る (function template) | C++26 | +| [`scaled_accessor`](linalg/scaled_accessor.md) | `scaled`関数用の[アクセサポリシー](mdspan/AccessorPolicy.md) (class template) | C++26 | +| [`scaled`](linalg/scaled.md) | 要素値をスカラー倍した読み取り専用`std::mdspan`を作る (function template) | C++26 | | [`conjugated_accessor`](linalg/conjugated_accessor.md.nolink) | `conjugated`関数用の[アクセサポリシー](mdspan/AccessorPolicy.md) (class template) | C++26 | | [`conjugated`](linalg/conjugated.md.nolink) | 読み取り専用の複素共役ビュー`std::mdspan`を作る (function template) | C++26 | | [`layout_transpose`](linalg/layout_transpose.md) | `transposed`関数用の[レイアウトマッピングポリシー](mdspan/LayoutMappingPolicy.md) (class template) | C++26 | diff --git a/reference/linalg/scaled.md b/reference/linalg/scaled.md new file mode 100644 index 0000000000..d0ee62546a --- /dev/null +++ b/reference/linalg/scaled.md @@ -0,0 +1,79 @@ +# scaled +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + +```cpp +template +constexpr auto scaled(ScalingFactor alpha, mdspan x); +``` +* Extents[link /reference/mdspan/extents.md] +* Layout[link /reference/mdspan/LayoutMappingPolicy.md] +* Accessor[link /reference/mdspan/AccessorPolicy.md] +* mdspan[link /reference/mdspan/mdspan.md] + +## 概要 +多次元配列ビュー[`std::mdspan`](/reference/mdspan/mdspan.md)に対して、要素値がスカラー倍された新しい多次元配列ビューを作る。 + +本操作により`mdspan`参照先メモリブロックが書き換えられることはなく、戻り値`mdspan`を介した要素アクセス時にスケーリング係数の乗算が行われる。 + + +## 戻り値 +説明用の型`SA`を[`scaled_accessor`](scaled_accessor.md)``として、次の値を返す。 + +```cpp +mdspan( + x.data_handle(), x.mapping(), SA(alpha, x.accessor())) +``` +* mdspan[link /reference/mdspan/mdspan.md] +* Extents[link /reference/mdspan/extents.md] +* Layout[link /reference/mdspan/LayoutMappingPolicy.md] + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + int arr[] = {1, 2, 3, 4}; + std::mdspan vec0{arr, std::extents{}}; + // 1 2 3 4 + + auto vec1 = std::linalg::scaled(2, vec0); + // 2 4 6 8 + assert(vec1[0] == 2); + + // linalg::scaled適用後のmdspan要素は読み取り専用となため、 + // 例えば vec1[0] == 42; はコンパイルエラーを引き起こす。 +} +``` +* std::linalg::scaled[color ff0000] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`mdspan`](/reference/mdspan/mdspan.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) +- [P1674R2: Evolving a Standard C++ Linear Algebra Library from the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1674r2.html) diff --git a/reference/linalg/scaled_accessor.md b/reference/linalg/scaled_accessor.md new file mode 100644 index 0000000000..565f3000e2 --- /dev/null +++ b/reference/linalg/scaled_accessor.md @@ -0,0 +1,76 @@ +# scaled_accessor +* linalg[meta header] +* class template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::linalg { + template + class scaled_accessor; +} +``` +* NestedAccessor[link /reference/mdspan/AccessorPolicy.md] + +## 概要 +`scaled_accessor`は、多次元配列ビュー[`mdspan`](/reference/mdspan/mdspan.md)の全要素をスカラー倍した多次元配列ビューを表現する[アクセサポリシー](/reference/mdspan/AccessorPolicy.md)クラスである。 + +`scaled_accessor`クラステンプレートは、要素スカラー倍操作[`scaled`](scaled.md)の戻り値型として利用される。 +戻り値`mdspad`の要素型は読み取り専用となる。 + +### 説明専用メンバ +`scaled_accessor`クラステンプレートは、下記の説明専用メンバ変数を保持する。 + +- `scaling-factor` : `ScalingFactor`型のスケーリング係数 +- `nested-accessor` : `NestedAccessor`型の入れ子アクセサポリシー + + +## 適格要件 +- `element_type`が適格な型であること +- [`is_copy_constructible_v`](/reference/type_traits/is_copy_constructible.md)` == true` +- [`is_reference_v`](/reference/type_traits/is_reference.md)` == false` +- `ScalingFactor`が[`semiregular`](/reference/concepts/semiregular.md)のモデルであること +- `NestedAccessor`が[アクセサポリシー](/reference/mdspan/AccessorPolicy.md)要件を満たす + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`(constructor)`](scaled_accessor/op_constructor.md) | コンストラクタ | C++26 | +| `(destructor)` | デストラクタ | C++26 | +| [`access`](scaled_accessor/access.md) | 指定オフセット位置にある要素へアクセスする | C++26 | +| [`offset`](scaled_accessor/offset.md) | 指定オフセット位置のハンドルを取得する | C++26 | +| `scaling_factor` | スケーリング係数`scaling-factor`を取得する | C++26 | +| `nested_accessor` | 入れ子アクセサポリシー`nested-accessor`を取得する | C++26 | + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `element_type` | [`add_const_t`](/reference/type_traits/add_const.md)`() * declval())>` | C++26 | +| `reference` | [`remove_const_t`](/reference/type_traits/remove_const.md)`` | C++26 | +| `data_handle_type` | `NestedAccessor::data_handle_type` | C++26 | +| `offset_policy` | `scaled_accessor` | C++26 | + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`mdspan`](/reference/mdspan/mdspan.md) +- [`scaled`](scaled.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) +- [P1674R2: Evolving a Standard C++ Linear Algebra Library from the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1674r2.html) diff --git a/reference/linalg/scaled_accessor/access.md b/reference/linalg/scaled_accessor/access.md new file mode 100644 index 0000000000..57fa1055bb --- /dev/null +++ b/reference/linalg/scaled_accessor/access.md @@ -0,0 +1,32 @@ +# acccess +* linalg[meta header] +* function[meta id-type] +* std::linalg[meta namespace] +* scaled_accessor[meta class] +* cpp26[meta cpp] + +```cpp +constexpr reference access(data_handle_type p, size_t i) const; +``` + +## 概要 +指定オフセット位置にある要素へアクセスする。 + + +## 戻り値 +`scaling_factor() * NestedAccessor::element_type(nested-accessor.access(p, i))` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) diff --git a/reference/linalg/scaled_accessor/offset.md b/reference/linalg/scaled_accessor/offset.md new file mode 100644 index 0000000000..95a88edba7 --- /dev/null +++ b/reference/linalg/scaled_accessor/offset.md @@ -0,0 +1,32 @@ +# offset +* linalg[meta header] +* function[meta id-type] +* std::linalg[meta namespace] +* scaled_accessor[meta class] +* cpp26[meta cpp] + +```cpp +constexpr offset_policy::data_handle_type offset(data_handle_type p, size_t i) const; +``` + +## 概要 +指定オフセット位置のハンドルを取得する。 + + +## 戻り値 +`nested-accessor.offset(p, i)` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) diff --git a/reference/linalg/scaled_accessor/op_constructor.md b/reference/linalg/scaled_accessor/op_constructor.md new file mode 100644 index 0000000000..e6efd62d52 --- /dev/null +++ b/reference/linalg/scaled_accessor/op_constructor.md @@ -0,0 +1,44 @@ +# コンストラクタ +* linalg[meta header] +* function[meta id-type] +* std::linalg[meta namespace] +* scaled_accessor[meta class] +* cpp26[meta cpp] + +```cpp +constexpr scaled_accessor() = default; // (1) + +template +explicit(!is_convertible_v) +constexpr scaled_accessor(const scaled_accessor& other); // (2) + +constexpr scaled_accessor(const ScalingFactor& s, const NestedAccessor& a); // (3) +``` +* is_convertible_v[link /reference/type_traits/is_convertible.md] +* NestedAccessor[link /reference/mdspan/AccessorPolicy.md] +* OtherNestedAccessor[link /reference/mdspan/AccessorPolicy.md] + +## 概要 +- (1) : デフォルトコンストラクタ +- (2) : 他`scaled_accessor`からの変換コンストラクタ +- (3) : `ScalingFactor`と`NestedAccessor`から構築 + + +## 効果 +- (2) : `scaling-factor`を`other.scaling_factor()`で、`nested-accessor`を`other.nested_accessor()`で直接非リスト初期化する。 +- (3) : `scaling-factor`を`s`で、`nested-accessor`を`a`で直接非リスト初期化する。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) From 7d8342fc5451905bb2f9218b25eb902abc0309d6 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Tue, 12 Mar 2024 05:29:10 +0900 Subject: [PATCH 0825/3948] Update range_adaptor_closure.md --- reference/ranges/range_adaptor_closure.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/ranges/range_adaptor_closure.md b/reference/ranges/range_adaptor_closure.md index 8043ae8bba..90a1e5327e 100644 --- a/reference/ranges/range_adaptor_closure.md +++ b/reference/ranges/range_adaptor_closure.md @@ -145,7 +145,7 @@ inline constexpr positive_impl positive; int main() { std::vector v = {0, -1, 2, -3, 4, -5, 6, -7}; - std::println(v | positive); + std::println("{}", v | positive); } ``` * std::ranges::range_adaptor_closure[color ff0000] From 94f1ad54cd875f64836aa570329501948e89e811 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Tue, 12 Mar 2024 06:44:11 +0900 Subject: [PATCH 0826/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/range_adaptor_closure.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reference/ranges/range_adaptor_closure.md b/reference/ranges/range_adaptor_closure.md index 90a1e5327e..a151c4ef34 100644 --- a/reference/ranges/range_adaptor_closure.md +++ b/reference/ranges/range_adaptor_closure.md @@ -170,4 +170,5 @@ int main() { ## 参照 - [N4950 26 Ranges library](https://timsong-cpp.github.io/cppwp/n4950/ranges) -- [rangesのパイプにアダプトするには](https://onihusube.hatenablog.com/entry/2022/04/24/010041) +- [rangesのパイプにアダプトするには](https://onihusube.hatenablog.com/entry/2022/04/24/010041 +- [P2387R3 Pipe support for user-defined range adaptors](https://wg21.link/p2387r3) From e9de46285493da4b067777faedfc09305f8feac6 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Tue, 12 Mar 2024 07:12:54 +0900 Subject: [PATCH 0827/3948] Update range_adaptor_closure.md --- reference/ranges/range_adaptor_closure.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/ranges/range_adaptor_closure.md b/reference/ranges/range_adaptor_closure.md index a151c4ef34..cabde221a9 100644 --- a/reference/ranges/range_adaptor_closure.md +++ b/reference/ranges/range_adaptor_closure.md @@ -66,10 +66,10 @@ class closure_t : public std::ranges::range_adaptor_closure> { public: constexpr closure_t(F f) : f(f) { } - template + template requires std::invocable constexpr auto operator()(R&& r) const { - return f(std::views::all(std::forward(r))); + return f(std::forward(r)); } }; @@ -170,5 +170,5 @@ int main() { ## 参照 - [N4950 26 Ranges library](https://timsong-cpp.github.io/cppwp/n4950/ranges) -- [rangesのパイプにアダプトするには](https://onihusube.hatenablog.com/entry/2022/04/24/010041 +- [rangesのパイプにアダプトするには](https://onihusube.hatenablog.com/entry/2022/04/24/010041) - [P2387R3 Pipe support for user-defined range adaptors](https://wg21.link/p2387r3) From 8ec80d9ac8e75017c6a1d35e7fbe9d57e8d6d62c Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Tue, 12 Mar 2024 07:19:09 +0900 Subject: [PATCH 0828/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/range_adaptor_closure.md | 1 - 1 file changed, 1 deletion(-) diff --git a/reference/ranges/range_adaptor_closure.md b/reference/ranges/range_adaptor_closure.md index cabde221a9..770edfb327 100644 --- a/reference/ranges/range_adaptor_closure.md +++ b/reference/ranges/range_adaptor_closure.md @@ -110,7 +110,6 @@ int main() { * std::ranges::range_adaptor_closure[color ff0000] * std::bind_back[link /reference/functional/bind_back.md] * std::invocable[link /reference/concepts/invocable.md] -* std::views::all[link all.md] * std::ranges::range[link range.md] * std::ranges::viewable_range[link viewable_range.md] * std::ranges::join_view[link join_view.md] From a474b05ee25fd74c38e996cb55208832eca0a1d9 Mon Sep 17 00:00:00 2001 From: komori-n Date: Tue, 12 Mar 2024 20:12:54 +0900 Subject: [PATCH 0829/3948] =?UTF-8?q?microseconds=E3=81=A8weeks=E3=81=AE?= =?UTF-8?q?=E3=82=B0=E3=83=AD=E3=83=BC=E3=83=90=E3=83=AB=E4=BF=AE=E9=A3=BE?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 50e346b70f..eef22c8dca 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -45,21 +45,25 @@ * chrono::duration[link /reference/chrono/duration.md] * chrono::duration_cast[link /reference/chrono/duration_cast.md] * chrono::hours[link /reference/chrono/duration_aliases.md] + * chrono::microseconds[link /reference/chrono/duration_aliases.md] * chrono::milliseconds[link /reference/chrono/duration_aliases.md] * chrono::minutes[link /reference/chrono/duration_aliases.md] * chrono::months[link /reference/chrono/duration_aliases.md] * chrono::nanoseconds[link /reference/chrono/duration_aliases.md] * chrono::seconds[link /reference/chrono/duration_aliases.md] + * chrono::weeks[link /reference/chrono/duration_aliases.md] * chrono::years[link /reference/chrono/duration_aliases.md] * days[link /reference/chrono/duration_aliases.md] * duration[link /reference/chrono/duration.md] * duration_cast[link /reference/chrono/duration_cast.md] * hours[link /reference/chrono/duration_aliases.md] + * microseconds[link /reference/chrono/duration_aliases.md] * milliseconds[link /reference/chrono/duration_aliases.md] * minutes[link /reference/chrono/duration_aliases.md] * months[link /reference/chrono/duration_aliases.md] * nanoseconds[link /reference/chrono/duration_aliases.md] * seconds[link /reference/chrono/duration_aliases.md] + * weeks[link /reference/chrono/duration_aliases.md] * years[link /reference/chrono/duration_aliases.md] * [link /reference/climits.md] * [link /reference/compare.md] From 2079dde1871789376e53808abe998ea70d7d9e52 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 12 Mar 2024 23:39:48 +0900 Subject: [PATCH 0830/3948] linalg: conjugated,conjugate_transposed(#1233) --- reference/linalg.md | 8 +- reference/linalg/conj-if-needed.md | 30 ++++++ reference/linalg/conjugate_transposed.md | 80 ++++++++++++++++ reference/linalg/conjugated.md | 91 +++++++++++++++++++ reference/linalg/conjugated_accessor.md | 74 +++++++++++++++ .../linalg/conjugated_accessor/access.md | 32 +++++++ .../linalg/conjugated_accessor/offset.md | 32 +++++++ .../conjugated_accessor/op_constructor.md | 48 ++++++++++ reference/linalg/layout_transpose.md | 1 + reference/linalg/scaled.md | 16 ++-- .../linalg/scaled_accessor/op_constructor.md | 4 + reference/linalg/transposed.md | 13 +-- 12 files changed, 410 insertions(+), 19 deletions(-) create mode 100644 reference/linalg/conj-if-needed.md create mode 100644 reference/linalg/conjugate_transposed.md create mode 100644 reference/linalg/conjugated.md create mode 100644 reference/linalg/conjugated_accessor.md create mode 100644 reference/linalg/conjugated_accessor/access.md create mode 100644 reference/linalg/conjugated_accessor/offset.md create mode 100644 reference/linalg/conjugated_accessor/op_constructor.md diff --git a/reference/linalg.md b/reference/linalg.md index f9dd4f11ab..e05c99180e 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -21,7 +21,7 @@ BLAS互換アルゴリズムは、演算対象データの次元数や計算オ ## 共通要件 ``ヘッダが提供する演算アルゴリズムは、スカラ値およびベクトル/行列の要素型として線形代数値型(linear algebra value types)を取り扱う。 -線形代数値型はBLASが取り扱う`float`, `double`, `std::complex`, `std::complex`をはじめ、[`semiregular`](concepts/semiregular.md)のモデルであれば良い。 +線形代数値型はBLASが取り扱う`float`, `double`, [`std::complex`](/reference/complex/complex.md)``, [`std::complex`](/reference/complex/complex.md)``をはじめ、[`semiregular`](concepts/semiregular.md)のモデルであれば良い。 また、線形代数値型の値初期化は加法元(算術型であれば値`0`)であること。 プログラム定義型を利用する場合、演算アルゴリズムはカスタマイゼーションポイントとして`abs`, `real`, `imag`, `conj`を非修飾名で呼び出す。 @@ -34,11 +34,11 @@ BLAS互換アルゴリズムは、演算対象データの次元数や計算オ | [`layout_blas_packed`](linalg/layout_blas_packed.md) | 行列要素のBLAS互換パックレイアウトに対応する[レイアウトマッピングポリシー](mdspan/LayoutMappingPolicy.md) (class template) | C++26 | | [`scaled_accessor`](linalg/scaled_accessor.md) | `scaled`関数用の[アクセサポリシー](mdspan/AccessorPolicy.md) (class template) | C++26 | | [`scaled`](linalg/scaled.md) | 要素値をスカラー倍した読み取り専用`std::mdspan`を作る (function template) | C++26 | -| [`conjugated_accessor`](linalg/conjugated_accessor.md.nolink) | `conjugated`関数用の[アクセサポリシー](mdspan/AccessorPolicy.md) (class template) | C++26 | -| [`conjugated`](linalg/conjugated.md.nolink) | 読み取り専用の複素共役ビュー`std::mdspan`を作る (function template) | C++26 | +| [`conjugated_accessor`](linalg/conjugated_accessor.md) | `conjugated`関数用の[アクセサポリシー](mdspan/AccessorPolicy.md) (class template) | C++26 | +| [`conjugated`](linalg/conjugated.md) | 読み取り専用の複素共役ビュー`std::mdspan`を作る (function template) | C++26 | | [`layout_transpose`](linalg/layout_transpose.md) | `transposed`関数用の[レイアウトマッピングポリシー](mdspan/LayoutMappingPolicy.md) (class template) | C++26 | | [`transposed`](linalg/transposed.md) | 2次元`std::mdspan`の行列転置ビューを作る (function template) | C++26 | -| [`conjugate_transposed`](linalg/conjugate_transposed.md.nolink) | 読み取り専用の複素共役転置ビュー`std::mdspan`を作る (function template) | C++26 | +| [`conjugate_transposed`](linalg/conjugate_transposed.md) | 読み取り専用の複素共役転置ビュー`std::mdspan`を作る (function template) | C++26 | ## BLAS 1アルゴリズム diff --git a/reference/linalg/conj-if-needed.md b/reference/linalg/conj-if-needed.md new file mode 100644 index 0000000000..c8775c88b6 --- /dev/null +++ b/reference/linalg/conj-if-needed.md @@ -0,0 +1,30 @@ +# conj-if-needed +* lingalg[meta header] +* function[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + +## 概要 +`conj-if-needed`は、[`std::complex`](/reference/complex/complex.md)などの複素数型に対して複素共役を求める、説明専用の関数オブジェクトである。 + +型`T`の式`E`に対して、式`conj-if-needed(E)`は次と等価である。 + +- `T`が算術型かつ式`conj(E)`が下記宣言を含むコンテキストにおいてオーバーロード解決を行った結果が妥当であるとき、`conj(E)` + ```cpp + template T conj(const T&) = delete; + ``` + +- そうでなければ、`E` + + +## 備考 +オーバーロード解決により選択された関数が入力値の複素共役(complex conjugate)を返さないとき、プログラムは不適格となる。 + + +## バージョン +### 言語 +- C++26 + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) diff --git a/reference/linalg/conjugate_transposed.md b/reference/linalg/conjugate_transposed.md new file mode 100644 index 0000000000..98e6ad4aeb --- /dev/null +++ b/reference/linalg/conjugate_transposed.md @@ -0,0 +1,80 @@ +# conjugate_transposed +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::linalg { + template + constexpr auto conjugate_transposed(mdspan a); +} +``` +* Extents[link /reference/mdspan/extents.md] +* Layout[link /reference/mdspan/LayoutMappingPolicy.md] +* Accessor[link /reference/mdspan/AccessorPolicy.md] +* mdspan[link /reference/mdspan/mdspan.md] + +## 概要 +行列(matrix)を表現する2次元配列ビュー[`std::mdspan`](/reference/mdspan/mdspan.md)に対して、共役転置(conjugate transpose)を表現する新しい2次元配列ビューを作る。 + +本操作により`mdspan`参照先メモリブロックが書き換えられることはなく、戻り値`mdspan`を介した要素アクセス時に共役転置変換が行われる。 + + +## 効果 +以下と等価。 +```cpp +return conjugated(transposed(a)); +``` +* conjugated[link conjugated.md] +* transposed[link transposed.md] + + +## 例 +```cpp example +#include +#include +#include +#include + +int main() +{ + std::complex arr[] = {{1, 1}, {2, 2}, {3, 3}, {4, 4}}; + std::mdspan mat0{arr, 2, 2}; + // 1+i 2+2i + // 3+3i 4+4i + + auto mat1 = std::linalg::conjugate_transposed(mat0); + // 1-i 3-3i + // 2-2i 4-4i + assert(imag(mat1[1, 0]) == -3); + + // linalg::conjugate_transposed適用後のmdspan要素は読み取り専用となり、 + // 例えば mat1[0] = {0, 0}; はコンパイルエラーを引き起こす。 +} +``` +* std::linalg::conjugate_transposed[color ff0000] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`mdspan`](/reference/mdspan/mdspan.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) +- [P1674R2: Evolving a Standard C++ Linear Algebra Library from the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1674r2.html) diff --git a/reference/linalg/conjugated.md b/reference/linalg/conjugated.md new file mode 100644 index 0000000000..78fb8b04a9 --- /dev/null +++ b/reference/linalg/conjugated.md @@ -0,0 +1,91 @@ +# conjugated +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::linalg { + template + constexpr auto conjugated(mdspan a); +} +``` +* Extents[link /reference/mdspan/extents.md] +* Layout[link /reference/mdspan/LayoutMappingPolicy.md] +* Accessor[link /reference/mdspan/AccessorPolicy.md] +* mdspan[link /reference/mdspan/mdspan.md] + +## 概要 +多次元配列ビュー[`std::mdspan`](/reference/mdspan/mdspan.md)に対して、要素値の複素共役変換を行なった新しい多次元配列ビューを作る。 + +本操作により`mdspan`参照先メモリブロックが書き換えられることはなく、戻り値`mdspan`を介した要素アクセス時に複素共役変換が行われる。 + + +## 戻り値 +- `Accessor`が[`conjugated_accessor`](conjugated_accessor.md)の特殊化のとき、説明用の型`A`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``として、 + + ```cpp + mdspan( + a.data_handle(), a.mapping(), a.accessor().nested_accessor()) + ``` + * mdspan[link /reference/mdspan/mdspan.md] + * Extents[link /reference/mdspan/extents.md] + * Layout[link /reference/mdspan/LayoutMappingPolicy.md] + +- そうではないとき、説明用の型`A`を[`conjugated_accessor`](conjugated_accessor.md)``として、 + + ```cpp + mdspan( + a.data_handle(), a.mapping(), conjugated_accessor(a.accessor())) + ``` + * mdspan[link /reference/mdspan/mdspan.md] + * Extents[link /reference/mdspan/extents.md] + * Layout[link /reference/mdspan/LayoutMappingPolicy.md] + + +## 例 +```cpp example +#include +#include +#include +#include + +int main() +{ + std::complex arr[] = {{1, 1}, {2, 2}, {3, 3}}; + std::mdspan vec0{arr, 3}; + // 1+i 2+2i 3+3i + + auto vec1 = std::linalg::conjugated(vec0); + // 1-i 2-2i 3-3i + assert(real(vec1[0]) == 1 && imag(vec1[0]) == -1); + + // linalg::conjugated適用後のmdspan要素は読み取り専用となり、 + // 例えば vec1[0] = {4, 4}; はコンパイルエラーを引き起こす。 +} +``` +* std::linalg::conjugated[color ff0000] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`mdspan`](/reference/mdspan/mdspan.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) +- [P1674R2: Evolving a Standard C++ Linear Algebra Library from the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1674r2.html) diff --git a/reference/linalg/conjugated_accessor.md b/reference/linalg/conjugated_accessor.md new file mode 100644 index 0000000000..4fa5278f85 --- /dev/null +++ b/reference/linalg/conjugated_accessor.md @@ -0,0 +1,74 @@ +# conjugated_accessor +* linalg[meta header] +* class template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::linalg { + template< class NestedAccessor> + class conjugated_accessor; +} +``` +* NestedAccessor[link /reference/mdspan/AccessorPolicy.md] + +## 概要 +`conjugated_accessor`は、多次元配列ビュー[`mdspan`](/reference/mdspan/mdspan.md)の全要素を複素共役した多次元配列ビューを表現する[アクセサポリシー](/reference/mdspan/AccessorPolicy.md)クラスである。 + +`conjugated_accessor`クラステンプレートは、複素共役操作[`conjugated`](conjugated.md)の戻り値型として利用される。 +戻り値`mdspad`の要素型は読み取り専用となる。 + +### 説明専用メンバ +`conjugated_accessor`クラステンプレートは、下記の説明専用メンバ変数を保持する。 + +- `nested-accessor_` : `NestedAccessor`型の入れ子アクセサポリシー + + +## 適格要件 +- `element_type`が適格な型であること +- [`is_copy_constructible_v`](/reference/type_traits/is_copy_constructible.md)` == true` +- [`is_reference_v`](/reference/type_traits/is_reference.md)` == false` +- `NestedAccessor`が[アクセサポリシー](/reference/mdspan/AccessorPolicy.md)要件を満たす + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`(constructor)`](conjugated_accessor/op_constructor.md) | コンストラクタ | C++26 | +| `(destructor)` | デストラクタ | C++26 | +| [`access`](conjugated_accessor/access.md) | 指定オフセット位置にある要素へアクセスする | C++26 | +| [`offset`](conjugated_accessor/offset.md) | 指定オフセット位置のハンドルを取得する | C++26 | +| `nested_accessor` | 入れ子アクセサポリシー`nested-accessor_`を取得する | C++26 | + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `element_type` | [`add_const_t`](/reference/type_traits/add_const.md)`()))>` | C++26 | +| `reference` | [`remove_const_t`](/reference/type_traits/remove_const.md)`` | C++26 | +| `data_handle_type` | `NestedAccessor::data_handle_type` | C++26 | +| `offset_policy` | `conjugated_accessor` | C++26 | + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`mdspan`](/reference/mdspan/mdspan.md) +- [`conjugated`](conjugated.md) +- [`conjugate_transposed`](conjugate_transposed.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) +- [P1674R2: Evolving a Standard C++ Linear Algebra Library from the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1674r2.html) diff --git a/reference/linalg/conjugated_accessor/access.md b/reference/linalg/conjugated_accessor/access.md new file mode 100644 index 0000000000..2e37604237 --- /dev/null +++ b/reference/linalg/conjugated_accessor/access.md @@ -0,0 +1,32 @@ +# acccess +* linalg[meta header] +* function[meta id-type] +* std::linalg[meta namespace] +* conjugated_accessor[meta class] +* cpp26[meta cpp] + +```cpp +constexpr reference access(data_handle_type p, size_t i) const; +``` + +## 概要 +指定オフセット位置にある要素へアクセスする。 + + +## 戻り値 +[`conj-if-needed`](../conj-if-needed.md)`(NestedAccessor::element_type(nested-accessor_.access(p, i)))` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) diff --git a/reference/linalg/conjugated_accessor/offset.md b/reference/linalg/conjugated_accessor/offset.md new file mode 100644 index 0000000000..3dd78c8379 --- /dev/null +++ b/reference/linalg/conjugated_accessor/offset.md @@ -0,0 +1,32 @@ +# offset +* linalg[meta header] +* function[meta id-type] +* std::linalg[meta namespace] +* conjugated_accessor[meta class] +* cpp26[meta cpp] + +```cpp +constexpr offset_policy::data_handle_type offset(data_handle_type p, size_t i) const; +``` + +## 概要 +指定オフセット位置のハンドルを取得する。 + + +## 戻り値 +`nested-accessor_.offset(p, i)` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) diff --git a/reference/linalg/conjugated_accessor/op_constructor.md b/reference/linalg/conjugated_accessor/op_constructor.md new file mode 100644 index 0000000000..2caccac95d --- /dev/null +++ b/reference/linalg/conjugated_accessor/op_constructor.md @@ -0,0 +1,48 @@ +# コンストラクタ +* linalg[meta header] +* function[meta id-type] +* std::linalg[meta namespace] +* conjugated_accessor[meta class] +* cpp26[meta cpp] + +```cpp +constexpr conjugated_accessor() = default; // (1) + +template +explicit(!is_convertible_v) +constexpr conjugated_accessor(const conjugated_accessor& other); // (2) + +constexpr conjugated_accessor(const NestedAccessor& acc); // (3) +``` +* is_convertible_v[link /reference/type_traits/is_convertible.md] +* NestedAccessor[link /reference/mdspan/AccessorPolicy.md] +* OtherNestedAccessor[link /reference/mdspan/AccessorPolicy.md] + +## 概要 +- (1) : デフォルトコンストラクタ +- (2) : 他`conjugated_accessor`からの変換コンストラクタ +- (3) : `NestedAccessor`から構築 + + +## テンプレートパラメータ制約 +- (2) : [`is_constructible_v`](/reference/type_traits/is_convertible.md)` == true` + + +## 効果 +- (2) : `nested-accessor_`を`other.nested_accessor()`で直接非リスト初期化する。 +- (3) : `nested-accessor_`を`acc`で直接非リスト初期化する。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) diff --git a/reference/linalg/layout_transpose.md b/reference/linalg/layout_transpose.md index c652870be2..04478f200b 100644 --- a/reference/linalg/layout_transpose.md +++ b/reference/linalg/layout_transpose.md @@ -43,6 +43,7 @@ namespace std::linalg { ## 関連項目 - [`mdspan`](/reference/mdspan/mdspan.md) - [`transposed`](transposed.md) +- [`conjugate_transposed`](conjugate_transposed.md) ## 参照 diff --git a/reference/linalg/scaled.md b/reference/linalg/scaled.md index d0ee62546a..5dc16a38af 100644 --- a/reference/linalg/scaled.md +++ b/reference/linalg/scaled.md @@ -5,9 +5,11 @@ * cpp26[meta cpp] ```cpp -template -constexpr auto scaled(ScalingFactor alpha, mdspan x); +namespace std::linalg { + template + constexpr auto scaled(ScalingFactor alpha, mdspan x); +} ``` * Extents[link /reference/mdspan/extents.md] * Layout[link /reference/mdspan/LayoutMappingPolicy.md] @@ -41,15 +43,15 @@ mdspan( int main() { int arr[] = {1, 2, 3, 4}; - std::mdspan vec0{arr, std::extents{}}; - // 1 2 3 4 + std::mdspan vec0{arr, 4}; + // 1 2 3 4 auto vec1 = std::linalg::scaled(2, vec0); // 2 4 6 8 assert(vec1[0] == 2); - // linalg::scaled適用後のmdspan要素は読み取り専用となため、 - // 例えば vec1[0] == 42; はコンパイルエラーを引き起こす。 + // linalg::scaled適用後のmdspan要素は読み取り専用となり、 + // 例えば vec1[0] = 42; はコンパイルエラーを引き起こす。 } ``` * std::linalg::scaled[color ff0000] diff --git a/reference/linalg/scaled_accessor/op_constructor.md b/reference/linalg/scaled_accessor/op_constructor.md index e6efd62d52..6a3ee36d45 100644 --- a/reference/linalg/scaled_accessor/op_constructor.md +++ b/reference/linalg/scaled_accessor/op_constructor.md @@ -24,6 +24,10 @@ constexpr scaled_accessor(const ScalingFactor& s, const NestedAccessor& a); // ( - (3) : `ScalingFactor`と`NestedAccessor`から構築 +## テンプレートパラメータ制約 +- (2) : [`is_constructible_v`](/reference/type_traits/is_convertible.md)` == true` + + ## 効果 - (2) : `scaling-factor`を`other.scaling_factor()`で、`nested-accessor`を`other.nested_accessor()`で直接非リスト初期化する。 - (3) : `scaling-factor`を`s`で、`nested-accessor`を`a`で直接非リスト初期化する。 diff --git a/reference/linalg/transposed.md b/reference/linalg/transposed.md index e29d0f86cb..dec56c1af9 100644 --- a/reference/linalg/transposed.md +++ b/reference/linalg/transposed.md @@ -5,12 +5,10 @@ * cpp26[meta cpp] ```cpp -template -constexpr auto transposed( - mdspan a); +namespace std::linalg { + template + constexpr auto transposed(mdspan a); +} ``` * Extents[link /reference/mdspan/extents.md] * Layout[link /reference/mdspan/LayoutMappingPolicy.md] @@ -82,9 +80,8 @@ constexpr auto transposed( int main() { int arr[] = {1, 2, 3, 4, 5, 6}; - using Ext2D = std::dextents; - std::mdspan mat0{arr, Ext2D{2, 3}}; + std::mdspan mat0{arr, 2, 3}; assert(mat0.extent(0) == 2 && mat0.extent(1) == 3); // 1 2 // 3 4 From 89ae27b0cd8d0256805fd9d3baea485efbd79307 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 12 Mar 2024 23:42:00 +0900 Subject: [PATCH 0831/3948] linalg/conj-if-needed: fix meta header(#1233) --- reference/linalg/conj-if-needed.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/linalg/conj-if-needed.md b/reference/linalg/conj-if-needed.md index c8775c88b6..0046a563b7 100644 --- a/reference/linalg/conj-if-needed.md +++ b/reference/linalg/conj-if-needed.md @@ -1,5 +1,5 @@ # conj-if-needed -* lingalg[meta header] +* linalg[meta header] * function[meta id-type] * std::linalg[meta namespace] * cpp26[meta cpp] From 76cc74bf7f8bdc0643b621a8e56310592c8443e4 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Wed, 13 Mar 2024 01:18:20 +0900 Subject: [PATCH 0832/3948] Update range_adaptor_closure.md --- reference/ranges/range_adaptor_closure.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/reference/ranges/range_adaptor_closure.md b/reference/ranges/range_adaptor_closure.md index 770edfb327..b1ca321d94 100644 --- a/reference/ranges/range_adaptor_closure.md +++ b/reference/ranges/range_adaptor_closure.md @@ -50,8 +50,22 @@ public: inline constexpr user_defined_closure_t user_defined; ``` +* std::ranges::range_adaptor_closure[color ff0000] +* std::ranges::viewable_range[link viewable_range.md] + +パイプライン記法をサポートする方法は規定されていないが、一般には処理系がRangeと`range_adaptor_closure`を引数とする以下のような`operator|`を定義することで行われると考えられる。 -パイプライン記法をサポートする方法は規定されていないが、一般には処理系がRangeと`range_adaptor_closure`を引数とする`operator|`を定義することで行われる。 +```cpp +template + requires std::derived_from> && std::invocable +constexpr auto operator| (R&& r, T&& raco) { + return raco(std::forward(r)); +} +``` +* std::ranges::range_adaptor_closure[color ff0000] +* std::ranges::viewable_range[link viewable_range.md] +* std::invocable[link /reference/concepts/invocable.md] +* std::derived_from[link /reference/concepts/derived_from.md] ## 例 ```cpp example From 082924e5203b12ff5ced467256e7355505a604bf Mon Sep 17 00:00:00 2001 From: tshino Date: Mon, 18 Mar 2024 04:07:54 +0900 Subject: [PATCH 0833/3948] =?UTF-8?q?expected::error=5For()=20=E3=81=AE?= =?UTF-8?q?=E6=88=BB=E3=82=8A=E5=80=A4=E5=9E=8B=E3=82=92=20T=20=E3=81=8B?= =?UTF-8?q?=E3=82=89=20E=20=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/expected/expected.void/error_or.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/expected/expected.void/error_or.md b/reference/expected/expected.void/error_or.md index e40c4ecdb6..ef2781826b 100644 --- a/reference/expected/expected.void/error_or.md +++ b/reference/expected/expected.void/error_or.md @@ -7,8 +7,8 @@ ```cpp // expected部分特殊化 -template constexpr T error_or(G&& e) const &; // (1) -template constexpr T error_or(G&& e) &&; // (2) +template constexpr E error_or(G&& e) const &; // (1) +template constexpr E error_or(G&& e) &&; // (2) ``` ## 概要 From 170b0f39f90317c1fe2ed3238e77be5ec3c7f996 Mon Sep 17 00:00:00 2001 From: tshino Date: Mon, 18 Mar 2024 04:08:48 +0900 Subject: [PATCH 0834/3948] =?UTF-8?q?expected::error=5For()=20=E3=81=AE?= =?UTF-8?q?=E6=88=BB=E3=82=8A=E5=80=A4=E5=9E=8B=E3=82=92=20T=20=E3=81=8B?= =?UTF-8?q?=E3=82=89=20E=20=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/expected/expected/error_or.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/expected/expected/error_or.md b/reference/expected/expected/error_or.md index e99602e947..2a171fa458 100644 --- a/reference/expected/expected/error_or.md +++ b/reference/expected/expected/error_or.md @@ -6,8 +6,8 @@ * cpp23[meta cpp] ```cpp -template constexpr T error_or(G&& e) const &; // (1) -template constexpr T error_or(G&& e) &&; // (2) +template constexpr E error_or(G&& e) const &; // (1) +template constexpr E error_or(G&& e) &&; // (2) ``` ## 概要 From 6b1921edfdf810fb2fbe8b8331f00ce60bf979af Mon Sep 17 00:00:00 2001 From: Akiko Kawai Date: Wed, 20 Mar 2024 07:13:44 +0900 Subject: [PATCH 0835/3948] Update implementation-status.md for ICX C++20 --- implementation-status.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/implementation-status.md b/implementation-status.md index fbf47df5d3..c459b7c039 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -193,7 +193,7 @@ | P0962R1: [範囲for文がカスタマイゼーションポイントを見つけるルールを緩和](/lang/cpp20/relaxing_the_range_for_loop_customization_point_finding_rules.md) | `begin()`/`end()`メンバ関数のどちらかが見つからなかった場合に非メンバ関数の`begin()`/`end()`を探しにいく | 8 | 8 | 2021.4 | 2019 Update 5 | | P0969R0: [friend指定された関数内から構造化束縛を使用して非公開メンバ変数にアクセスすることを許可](/lang/cpp20/allow_structured_bindings_to_accessible_members.md) | 構造化束縛の仕様として公開メンバ変数のみを取り出せるようになっていたが、friend指定された関数からは非公開メンバ変数にもアクセスできるようにする | 8 | 8.0 | 2021.4 | 2019 | | P0961R1: [構造化束縛がカスタマイゼーションポイントを見つけるルールを緩和](/lang/cpp20/relaxing_the_structured_bindings_customization_point_finding_rules.md) | 非テンプレートの`get()`メンバ関数が見つかった場合は、非メンバ関数の`get()`を探しにいく | 8 | 8.0 | 2021.4 | 2019 | -| P0634R3: [型の文脈で`typename`の省略を許可](/lang/cpp20/down_with_typename.md) | 型しか現れない文脈では、依存名を解決するための`typename`キーワードを省略できるようにする | 9 | 16 | 2021.4 (2021.6 は未対応) | 2019 Update 9 | +| P0634R3: [型の文脈で`typename`の省略を許可](/lang/cpp20/down_with_typename.md) | 型しか現れない文脈では、依存名を解決するための`typename`キーワードを省略できるようにする | 9 | 16 | 2023.1 | 2019 Update 9 | | P0780R2: [ラムダ式の初期化キャプチャでのパック展開を許可](/lang/cpp20/allow_pack_expansion_in_lambda_init_capture.md) | `[...args = std::move(args)]`のようなキャプチャを許可 | 9
10 | 9.0 | 2021.7 | 2019 Update 2 | | P0479R5: [確率が高い分岐と低い分岐を伝える属性 `[[likely]]`, `[[unlikely]]`](/lang/cpp20/likely_and_unlikely_attributes.md) | 条件分岐の最適化ヒントを与える属性 | 9 (partial, `switch` 文のみ可能)
10 | 12.0 | 2021.7 | 2019 Update 6 | | P0929R2: [抽象型のチェック](/lang/cpp20/checking_for_abstract_class_types.md) | 関数の宣言段階では、パラメータおよび戻り値型が抽象型かどうかをチェックしないようにする | 11 | | | 2019 Update 5 | @@ -201,7 +201,7 @@ | P0722R3: [可変長データを扱うクラスの効率的な`delete`](/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md) | クラスの`delete`演算子が呼び出される前にデストラクタが呼ばれないようにするオプションを追加 | 9 | 6.0 | 2023.0 | 2019 Update 7 | | P1064R0: [定数式からの仮想関数の呼び出しを許可](/lang/cpp20/allow_virtual_function_calls_in_constant_expressions.md) | 仮想関数に`constexpr`を付けられない制限を解除 | 9 | 9.0 | 2021.4 | 2019 Update 9 | | P1327R1: [定数式での`dynamic_cast`、多態的な`typeid`を許可](/lang/cpp20/allowing_dynamic_cast_polymorphic_typeid_in_constant_expressions.md) | 定数式での動的多態を許可 | 10 | 9.0 | 2021.4 | 2019 Update 9 | -| P1002R1: [constexpr関数内でのtry-catchブロックを許可](/lang/cpp20/try-catch_blocks_in_constexpr_functions.md) | constexpr関数内でtry-catchブロックを書けるようにする | 9 | 8.0 | 2021.4 (2021.6 は未対応) | 2019 Update 5 | +| P1002R1: [constexpr関数内でのtry-catchブロックを許可](/lang/cpp20/try-catch_blocks_in_constexpr_functions.md) | constexpr関数内でtry-catchブロックを書けるようにする | 9 | 8.0 | 2023.1 | 2019 Update 5 | | P1073R3: [即時関数](/lang/cpp20/immediate_functions.md) | `consteval`キーワードを追加し、常に定数式評価されるよう指定できるようにする | 11 | 15 | 2021.4 | 2019 Update 10 | | P1330R0: [定数式内での共用体のアクティブメンバの変更を許可](/lang/cpp20/changing_the_active_member_of_a_union_inside_constexpr.md) | 共用体メンバの書き換えを定数式内で行えるようにする | 9 | 9.0 | 2021.4 | 2017 | | P1008R1: [ユーザー宣言したコンストラクタを持つクラスの集成体初期化を禁止](/lang/cpp20/prohibit_aggregates_with_user-declared_constructors.md) | コンストラクタが`delete`/`default`宣言されているクラスを、集成体初期化によってコンストラクタ呼び出しを回避して構築できてしまっていた技法を禁止 | 9 | 8.0 | 2021.4 | 2019 | @@ -214,7 +214,7 @@ | P0960R3: [丸カッコの値リストからの集成体初期化を許可](/lang/cpp20/allow_initializing_aggregates_from_a_parenthesized_list_of_values.md) | `T x{1, 2, 3};`と同様に`T x(1, 2, 3);`でも集成体初期化できるようにする | 10 | No | 2021.4 | 2019 Update 8 | | P1009R2: [`new`式での配列要素数の推論](/lang/cpp20/array_size_deduction_in_new-expressions.md) | `double* p = new double[]{1,2,3};`を許可 | 11 | 9 | 2021.4 | 2019 Update 7 | | P1041R4: [`char16_t`と`char32_t`の文字・文字列リテラルを、文字コードUTF-16/32に規定](/lang/cpp20/make_char16t_char32t_string_literals_be_utf16_32.md) | `__STDC_UTF_16__`、`__STDC_UTF_32__`の定義に関係なく、`char16_t`、`char32_t`のリテラルをUTF-16/32文字コードに規定する | 10 | Yes | 2023.0 | 2015 | -| P1103R3: [モジュール](/lang/cpp20/modules.md) | ヘッダファイル・ソースファイル、インクルードに変わる仕組みとしてモジュールを導入する | 11 (`-fmodules-ts`が必要) | 15
8.0 partial (`-fmodules`, `-fmodules-ts`が必要) | | 2019 Update 8 | +| P1103R3: [モジュール](/lang/cpp20/modules.md) | ヘッダファイル・ソースファイル、インクルードに変わる仕組みとしてモジュールを導入する | 11 (`-fmodules-ts`が必要) | 15
8.0 partial (`-fmodules`, `-fmodules-ts`が必要) | 2023.1 (Partial) | 2019 Update 8 | | P0912R5: [コルーチン](/lang/cpp20/coroutines.md) | 関数実行を中断・再開する仕組みとしてコルーチンを導入する | 10 (`-fcoroutines`が必要) | 8.0 (partial) | 2021.4| 2019 Update 8 | | P1161R3: [添字演算子内でのカンマ演算子の使用を非推奨化](/lang/cpp20/deprecate_uses_of_the_comma_operator_in_subscripting_expressions.md) | `ar[i, j]`を非推奨化。`ar[(i, j)]`はOK | 10 | 9.0 | 2021.6 | 2019 Update 5 | | P1331R2: [constexpr関数内でのトリビアルなデフォルト初期化を許可](/lang/cpp20/permitting_trivial_default_initialization_in_constexpr_contexts.md) | constexpr関数内でのデフォルト初期化を許可し、未初期化値を読むことのみ禁止する | 10 | 10.0 | 2022.3 | 2019 Update 7 | From f99e99b866a4766f911f6ba318c8f29873a58dd1 Mon Sep 17 00:00:00 2001 From: fktn Date: Thu, 21 Mar 2024 01:26:14 +0900 Subject: [PATCH 0836/3948] fixed typo: find_last_nof_of -> find_last_not_of --- reference/string/basic_string.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/string/basic_string.md b/reference/string/basic_string.md index e149400b80..ef2f425d94 100644 --- a/reference/string/basic_string.md +++ b/reference/string/basic_string.md @@ -139,7 +139,7 @@ namespace std { | [`find_first_of`](basic_string/find_first_of.md) | 最初に現れる指定文字を検索する | | | [`find_last_of`](basic_string/find_last_of.md) | 最後に現れる指定文字を検索する | | | [`find_first_not_of`](basic_string/find_first_not_of.md) | 先頭から、指定文字が見つからない位置を検索する | | -| [`find_last_nof_of`](basic_string/find_last_not_of.md) | 末尾から、指定文字が見つからない位置を検索する | | +| [`find_last_not_of`](basic_string/find_last_not_of.md) | 末尾から、指定文字が見つからない位置を検索する | | | [`substr`](basic_string/substr.md) | 部分文字列を取得する | | | [`compare`](basic_string/compare.md) | 他の文字列との比較を行う | | | [`starts_with`](basic_string/starts_with.md) | 指定の文字列で始まるかを判定する | C++20 | From aff8e927502e4f11090b44e7330fe00ed7e061a2 Mon Sep 17 00:00:00 2001 From: Shunsuke Shimizu Date: Fri, 22 Mar 2024 02:29:03 +0900 Subject: [PATCH 0837/3948] Update swap.md Add links to ranges::swap and iter_swap --- reference/utility/swap.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reference/utility/swap.md b/reference/utility/swap.md index 31820431fa..f7c647251c 100644 --- a/reference/utility/swap.md +++ b/reference/utility/swap.md @@ -154,6 +154,11 @@ int main() - [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 - 値版はそれより前から実装されている。 +## 関連項目 +- [`std::ranges::swap()`](/reference/concepts/swap.md) +- [`std::iter_swap()`](/reference/algorithm/iter_swap.md) + + ## 参照 - [LWG Issue 809. `std::swap` should be overloaded for array types](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#809) - C++11で、配列に対するオーバーロードが追加された経緯のレポート From 428490d294cf465ad23915c1d8cbf4e5383c9470 Mon Sep 17 00:00:00 2001 From: suomesta Date: Mon, 25 Mar 2024 23:32:48 +0900 Subject: [PATCH 0838/3948] fix some typo --- reference/list/list/size.md | 2 +- reference/list/list/splice.md | 6 +++--- reference/ranges/size.md | 1 - reference/set/multiset/crend.md | 4 ++-- reference/set/multiset/end.md | 2 +- reference/set/set/crend.md | 6 +++--- reference/set/set/end.md | 2 +- reference/unordered_set/unordered_multiset/end-size_type.md | 2 +- 8 files changed, 12 insertions(+), 13 deletions(-) diff --git a/reference/list/list/size.md b/reference/list/list/size.md index 4809741dbf..0f0b718830 100644 --- a/reference/list/list/size.md +++ b/reference/list/list/size.md @@ -22,7 +22,7 @@ size_type size() const noexcept; // C++11 ## 計算量 -- C++03 : 線形時間 +- C++03 : 実装依存(多くの実装で定数時間 or 線形時間) - C++11 : 定数時間 diff --git a/reference/list/list/splice.md b/reference/list/list/splice.md index 044bd84f66..e58ddeaf27 100644 --- a/reference/list/list/splice.md +++ b/reference/list/list/splice.md @@ -50,9 +50,9 @@ void splice(const_iterator position, list&& x, ## 計算量 - C++03まで - - (1), (2) : `x`の要素数に対して線形時間 - - (3), (4) : 定数時間 - - (5), (6) : `[first, last)`の要素数に対して線形時間 + - (1) : `x`の要素数に対して線形時間 + - (3) : 定数時間 + - (5) : `[first, last)`の要素数に対して線形時間 - C++11から - (1), (2) : 定数時間 - (3), (4) : 定数時間 diff --git a/reference/ranges/size.md b/reference/ranges/size.md index 80d30453e6..c00cb8463e 100644 --- a/reference/ranges/size.md +++ b/reference/ranges/size.md @@ -61,7 +61,6 @@ int main() 4 10 7 -7 ``` ## バージョン diff --git a/reference/set/multiset/crend.md b/reference/set/multiset/crend.md index 48973d85a6..79111ca216 100644 --- a/reference/set/multiset/crend.md +++ b/reference/set/multiset/crend.md @@ -51,6 +51,6 @@ int main() | 名前 | 説明 | |-------------------------|------------------------------| | [`crbegin`](crbegin.md) | 末尾を指す読み取り専用逆イテレータを返す | -| [`cbegin`](begin.md) | 先頭を指す読み取り専用イテレータを返す | -| [`cend`](end.md) | 末尾の次を指す読み取り専用イテレータを返す | +| [`cbegin`](cbegin.md) | 先頭を指す読み取り専用イテレータを返す | +| [`cend`](cend.md) | 末尾の次を指す読み取り専用イテレータを返す | diff --git a/reference/set/multiset/end.md b/reference/set/multiset/end.md index 44fe3e8ba5..80fe4e6153 100644 --- a/reference/set/multiset/end.md +++ b/reference/set/multiset/end.md @@ -23,7 +23,7 @@ const_iterator end() const noexcept; // (2) C++11 ## 備考 -`const` 版ではない `begin` が返す `iterator` も読み取り専用イテレータである。 +`const` 版ではない `end` が返す `iterator` も読み取り専用イテレータである。 (が、`iterator` と `const_iterator` が同じ型とは限らない) diff --git a/reference/set/set/crend.md b/reference/set/set/crend.md index ebf206350a..c41a1bc06f 100644 --- a/reference/set/set/crend.md +++ b/reference/set/set/crend.md @@ -50,7 +50,7 @@ int main() | 名前 | 説明 | |-------------------------|------------------------------| -| [`crbegin`](rbegin.md) | 末尾を指す読み取り専用逆イテレータを返す | -| [`cbegin`](begin.md) | 先頭を指す読み取り専用イテレータを返す | -| [`cend`](end.md) | 末尾の次を指す読み取り専用イテレータを返す | +| [`crbegin`](crbegin.md) | 末尾を指す読み取り専用逆イテレータを返す | +| [`cbegin`](cbegin.md) | 先頭を指す読み取り専用イテレータを返す | +| [`cend`](cend.md) | 末尾の次を指す読み取り専用イテレータを返す | diff --git a/reference/set/set/end.md b/reference/set/set/end.md index 2403d14fdc..ac654ae648 100644 --- a/reference/set/set/end.md +++ b/reference/set/set/end.md @@ -23,7 +23,7 @@ const_iterator end() const noexcept; // (2) C++11 ## 備考 -`const` 版ではない `begin` が返す `iterator` も読み取り専用イテレータである。 +`const` 版ではない `end` が返す `iterator` も読み取り専用イテレータである。 (が、`iterator` と `const_iterator` が同じ型とは限らない) diff --git a/reference/unordered_set/unordered_multiset/end-size_type.md b/reference/unordered_set/unordered_multiset/end-size_type.md index 32bb2e99d5..1ba5b08e20 100644 --- a/reference/unordered_set/unordered_multiset/end-size_type.md +++ b/reference/unordered_set/unordered_multiset/end-size_type.md @@ -29,7 +29,7 @@ const_local_iterator end(size_type n) const; ## 備考 -`const` 版ではない `begin` が返す `local_iterator` も読み取り専用イテレータである。 +`const` 版ではない `end` が返す `local_iterator` も読み取り専用イテレータである。 (が、`local_iterator` と `const_local_iterator` が同じ型とは限らないと思われる) From 6224e96d59d895db36fd6c4c326e644736912da3 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 26 Mar 2024 02:56:14 +0900 Subject: [PATCH 0839/3948] =?UTF-8?q?poisson=5Fdistribution=20:=20?= =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E5=B7=AE=E3=81=97=E6=9B=BF=E3=81=88?= =?UTF-8?q?=20(close=20#1262)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/random/poisson_distribution.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/random/poisson_distribution.md b/reference/random/poisson_distribution.md index 505d9229a0..4c913a3fdf 100644 --- a/reference/random/poisson_distribution.md +++ b/reference/random/poisson_distribution.md @@ -124,7 +124,7 @@ int main() ### 参考 - [ポワソン分布 - Wikipedia](https://ja.wikipedia.org/wiki/ポアソン分布) -- [ポアソン分布 - 統計・データ解析](http://oku.edu.mie-u.ac.jp/~okumura/stat/poisson.php) +- [ポアソン分布 - 統計・データ解析](https://okumuralab.org/~okumura/stat/poisson.html) - [ポアソン分布 - NtRand](http://www.ntrand.com/jp/poisson-distribution/) From c48319e12b5865fe6e8453cf0b77c7635e0c0900 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Tue, 26 Mar 2024 02:54:47 +0900 Subject: [PATCH 0840/3948] =?UTF-8?q?=E3=82=AA=E3=83=97=E3=82=B7=E3=83=A7?= =?UTF-8?q?=E3=83=B3=E6=9B=B8=E5=BC=8F=E3=81=AB=E3=81=8A=E3=81=91=E3=82=8B?= =?UTF-8?q?=E3=83=AD=E3=82=B1=E3=83=BC=E3=83=AB=E3=81=AE=E3=82=AA=E3=83=97?= =?UTF-8?q?=E3=82=B7=E3=83=A7=E3=83=B3=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/format.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/reference/format/format.md b/reference/format/format.md index 9ed95e7e4f..e173ca258b 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -72,7 +72,7 @@ string s3 = format("{} {1}", "a", "b"); // コンパイルエラー 基本的に`printf`の書式を踏襲しているが、あくまでもオプションであり、省略しても``と同じようにデフォルトの書式が使われる。 ``` -[[fill] align] [sign] ['#'] ['0'] [width] ['.' precision] [type] +[[fill] align] [sign] ['#'] ['0'] [width] ['.' precision] ['L'] [type] ``` * `fill` : アライメントに使う文字 (デフォルト: スペース) @@ -90,9 +90,10 @@ string s3 = format("{} {1}", "a", "b"); // コンパイルエラー * 置換フィールドを使って変数で指定できる * `precision` : 精度(浮動小数点数の場合)、使う文字数(文字列の場合) * 置換フィールドを使って変数で指定できる +* `L` : ロケールを考慮する * `type` : 値の表現方法(表を参照) -`printf`との違いとして、デフォルトではロケール非依存(Cロケール固定)である。ロケール依存のフォーマットをするには`n`オプションを使う。 +`printf`との違いとして、デフォルトではロケール非依存(Cロケール固定)である。ロケール依存のフォーマットをするには`L`オプションを使う。 ロケール非依存の場合、算術型の出力は[`to_chars`](/reference/charconv/to_chars.md)と同じになる。 #### 文字列型の場合 @@ -115,7 +116,6 @@ string s3 = format("{} {1}", "a", "b"); // コンパイルエラー | B | 2進数(大文字) | `b`の大文字版 (代替表現の接頭辞 `0B`) | C++20 | | c | 文字として出力 | `static_cast(value)` (収まらないときは`format_error`) | C++20 | | d | 10進数 | `to_chars(first, last, value)` | C++20 | -| n | 10進数(ロケールを考慮する) | ロケール依存の桁区切りを使った`d` | C++20 | | o | 8進数 | `to_chars(first, last, value, 8)` (代替表現の接頭辞 `0`、ただし値が0のときは接頭辞なし) | C++20 | | x | 16進数(小文字) | `to_chars(first, last, value, 16)` (代替表現の接頭辞 `0x`) | C++20 | | X | 16進数(大文字) | `x`の大文字版 (代替表現の接頭辞 `0X`) | C++20 | @@ -133,7 +133,6 @@ string s3 = format("{} {1}", "a", "b"); // コンパイルエラー | A | 16進指数表記(大文字) | `a`の大文字版 | | g | 値に応じた表記(小文字) | `to_chars(first, last, value, chars_format::general, precision)` (精度が指定されたとき)
`to_chars(first, last, value, chars_format::general, 6)` (それ以外) | | G | 値に応じた表記(大文字) | `g`の大文字版 | -| n | ロケールを考慮した値に応じた表記 | ロケールを考慮した`g` | | (なし) | デフォルト | `to_chars(first, last, value, chars_format::fixed, general, precision)` (精度が指定されたとき)
`to_chars(first, last, value)` (それ以外) | #### ポインタの場合 @@ -245,7 +244,7 @@ format("{:<06}", -42); // "-42 " format("{}", 42); // "42" format("{0:b} {0:d} {0:o} {0:x}", 42); // "101010 42 52 2a" format("{0:#x} {0:#X}", 42); // "0x2a 0X2A" -format("{:n}", 1234); // "1,234" (ロケールによる) +format("{:L}", 1234.5678); // "1,234.5678" (ロケールによる) ``` ### コンパイル時の書式文字列チェック From 89d821a70e451523f47cab945528463bf5fc14cb Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Tue, 26 Mar 2024 03:13:40 +0900 Subject: [PATCH 0841/3948] =?UTF-8?q?=E3=83=95=E3=82=A9=E3=83=BC=E3=83=9E?= =?UTF-8?q?=E3=83=83=E3=83=88=E6=9B=B8=E5=BC=8F=E3=81=AE=E8=A1=A8=E3=82=92?= =?UTF-8?q?=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/format.md | 63 +++++++++++++++++++++++++------------- 1 file changed, 42 insertions(+), 21 deletions(-) diff --git a/reference/format/format.md b/reference/format/format.md index e173ca258b..6adcc35dca 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -86,7 +86,7 @@ string s3 = format("{} {1}", "a", "b"); // コンパイルエラー * スペース : 正の数にはスペースを表示する * `#` : 代替表現(`0x`など形式がわかる表記)を使う * `0` : 符号を考慮して0で埋める -* `width` : 幅 (省略時は値に応じて幅が決まり、アライメントは機能しない) +* `width` : 幅 (アライメントもしくは0埋めの幅) * 置換フィールドを使って変数で指定できる * `precision` : 精度(浮動小数点数の場合)、使う文字数(文字列の場合) * 置換フィールドを使って変数で指定できる @@ -100,10 +100,29 @@ string s3 = format("{} {1}", "a", "b"); // コンパイルエラー | type | 意味 |効果 | 対応バージョン | |:-----------|:-------------|--------------------------------------------------------------------------------------|-------| -| s (省略可) | 文字列 | 文字列をそのまま出力 | C++20 | +| s | 文字列 | 文字列をそのまま出力 | C++20 | | ? | デバッグ出力 | 文字・文字列を引用符で囲み、エスケープシーケンスをエスケープして出力 (例:`"\n"`は`"\"\n\""`となる) | C++23 | -#### 文字型 / `bool`型 / 整数型の場合 +デフォルトは `s`。 + +#### 文字型の場合 + +| type | 意味 | 効果 | 対応バージョン | +|:-------|:---------------------------|:--------------------------------------------------------------------------|----------------| +| c | 文字として出力 | `static_cast(value)` (収まらないときは`format_error`) | C++20 | +| ? | デバッグ出力 | 文字・文字列を引用符で囲み、エスケープシーケンスをエスケープして出力 (例:`"\n"`は`"\"\\n\""`となる) | C++23 | + +デフォルトは `c`。 + +整数型のオプションも指定できる。その場合は、十分な大きさの符号なし整数型として扱われる。 + +#### `bool`型の場合 + +デフォルトでは `true` / `false` という文字列を出力する。 + +整数型のオプションも指定できる。その場合は、`unsigned char` に `static_cast` される。 + +#### 整数型の場合 イテレータ範囲`[first, last)`を[`to_chars`](/reference/charconv/to_chars.md)の結果を格納するのに十分な範囲、`value`をフォーマットする値、`charT`を`char`または`wchar_t`とする。 @@ -112,34 +131,36 @@ string s3 = format("{} {1}", "a", "b"); // コンパイルエラー | type | 意味 | 効果 | 対応バージョン | |:-------|:---------------------------|:--------------------------------------------------------------------------|----------------| -| b | 2進数(小文字) | `to_chars(first, last, value, 2)` (代替表現の接頭辞 `0b`) | C++20 | -| B | 2進数(大文字) | `b`の大文字版 (代替表現の接頭辞 `0B`) | C++20 | -| c | 文字として出力 | `static_cast(value)` (収まらないときは`format_error`) | C++20 | +| b, B | 2進数 | `to_chars(first, last, value, 2)` (代替表現の接頭辞 `0b`) | C++20 | | d | 10進数 | `to_chars(first, last, value)` | C++20 | | o | 8進数 | `to_chars(first, last, value, 8)` (代替表現の接頭辞 `0`、ただし値が0のときは接頭辞なし) | C++20 | -| x | 16進数(小文字) | `to_chars(first, last, value, 16)` (代替表現の接頭辞 `0x`) | C++20 | -| X | 16進数(大文字) | `x`の大文字版 (代替表現の接頭辞 `0X`) | C++20 | -| ? | デバッグ出力 | 文字・文字列を引用符で囲み、エスケープシーケンスをエスケープして出力 (例:`"\n"`は`"\"\\n\""`となる) | C++23 | -| (なし) | デフォルト | `d` (整数型の場合)
`c` (文字型の場合)
`"true"`/`"false"`を出力(`bool`型の場合) | C++20 | +| x, X | 16進数 | `to_chars(first, last, value, 16)` (代替表現の接頭辞 `0x`) | C++20 | +| c | 文字として出力 | `static_cast(value)` した値を文字として出力 (収まらないときは`format_error`) | C++20 | + +デフォルトは `d`。 + +2進数・16進数については、大文字のオプションを指定すると代替表現および数値中のアルファベットが大文字になる。 #### 浮動小数点数型の場合 -| type | 意味 | 効果 | -|:-----------|:---------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| f,F | 指数表記しない | `to_chars(first, last, value, chars_format::fixed, precision)` (精度が指定されたとき)
`to_chars(first, last, value, chars_format::fixed, 6)` (それ以外) | -| e | 指数表記(小文字) | `to_chars(first, last, value, chars_format::scientific, precision)` (精度が指定されたとき)
`to_chars(first, last, value, chars_format::scientific, 6)` (それ以外) | -| E | 指数表記(大文字) | `e`の大文字版 | -| a | 16進指数表記(小文字) | `to_chars(first, last, value, chars_format::hex, precision)` (精度が指定されたとき)
`to_chars(first, last, value, chars_format::hex)` (それ以外) | -| A | 16進指数表記(大文字) | `a`の大文字版 | -| g | 値に応じた表記(小文字) | `to_chars(first, last, value, chars_format::general, precision)` (精度が指定されたとき)
`to_chars(first, last, value, chars_format::general, 6)` (それ以外) | -| G | 値に応じた表記(大文字) | `g`の大文字版 | -| (なし) | デフォルト | `to_chars(first, last, value, chars_format::fixed, general, precision)` (精度が指定されたとき)
`to_chars(first, last, value)` (それ以外) | +| type | 意味 | 効果 | +|:-----------|:--------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| f, F | 指数表記しない | `to_chars(first, last, value, chars_format::fixed, precision)` (精度が指定されたとき)
`to_chars(first, last, value, chars_format::fixed, 6)` (それ以外) | +| e, E | 指数表記する | `to_chars(first, last, value, chars_format::scientific, precision)` (精度が指定されたとき)
`to_chars(first, last, value, chars_format::scientific, 6)` (それ以外) | +| a, A | 16進数で指数表記する | `to_chars(first, last, value, chars_format::hex, precision)` (精度が指定されたとき)
`to_chars(first, last, value, chars_format::hex)` (それ以外) | +| g, G | 値に応じて指数表記を使う | `to_chars(first, last, value, chars_format::general, precision)` (精度が指定されたとき)
`to_chars(first, last, value, chars_format::general, 6)` (それ以外) | + +デフォルトは `g`。 + +大文字のオプションを指定すると数値中のアルファベットが大文字になる。 #### ポインタの場合 | type | 意味 | 効果 | |:-----------|:-------------------|:----------------------------------------------------------------------------------------------------------------| -| p (省略可) | アドレスを出力する | `"0x" + to_chars(first, last, reinterpret_cast(value), 16)` | +| p | アドレスを出力する | `0x` につづいて、`to_chars(first, last, reinterpret_cast(value), 16)` の結果を出力する | + +デフォルトは `p`。 ポインタは`void*`のみサポートする。それ以外のポインタは、`void*`にキャストしなければ出力できない。 From 98c71c609bfbd6232d132f9066711cd26df334fd Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Tue, 26 Mar 2024 03:52:36 +0900 Subject: [PATCH 0842/3948] =?UTF-8?q?=E3=82=A2=E3=83=A9=E3=82=A4=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=88=E3=81=AE=E8=A9=B3=E7=B4=B0=E3=82=92=E8=A8=98?= =?UTF-8?q?=E8=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/format.md | 48 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/reference/format/format.md b/reference/format/format.md index 6adcc35dca..60a4f19d63 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -126,8 +126,7 @@ string s3 = format("{} {1}", "a", "b"); // コンパイルエラー イテレータ範囲`[first, last)`を[`to_chars`](/reference/charconv/to_chars.md)の結果を格納するのに十分な範囲、`value`をフォーマットする値、`charT`を`char`または`wchar_t`とする。 -* 以下の表の通りに[`to_chars`](/reference/charconv/to_chars.md)を呼び出したあと、その結果を出力へコピーするかのような振る舞いをする。ただし、実際に[`to_chars`](/reference/charconv/to_chars.md)を呼び出すかどうかは規定されていない。 -* 実際には、出力へコピーする際にパディングなども行われる。 +* ロケールを考慮しない場合、数値を文字列化する部分は以下の表の通りに[`to_chars`](/reference/charconv/to_chars.md)を呼び出した結果と等しくなる。 | type | 意味 | 効果 | 対応バージョン | |:-------|:---------------------------|:--------------------------------------------------------------------------|----------------| @@ -164,6 +163,51 @@ string s3 = format("{} {1}", "a", "b"); // コンパイルエラー ポインタは`void*`のみサポートする。それ以外のポインタは、`void*`にキャストしなければ出力できない。 +#### アライメントの詳細 + +指定した幅が必要な幅より小さい場合や、幅を省略している場合はアライメントは無効となる。 + +アライメントにおいて、一部の文字は大きな幅を持っているとみなされる。 + +UTF-8・UTF-16・UTF-32の文字のシーケンスの場合、その幅はUnicode標準 UAX #29 で定める拡張書記素クラスタの幅の合計となる。 + +以下の文字は2文字分の幅を持つ。 + +- UAX #44 の規定に従って、`East_Asian_Width` が `W` (Wide)または `F` (Fullwidth)であるコードポイント +- `U+4DC0` - `U+4DFF` (Yijing Hexagram Symbols) +- `U+1F300` - `U+1F5FF` (Miscellaneous Symbols and Pictographs) +- `U+1F900` - `U+1F9FF` (Supplemental Symbols and Pictographs) + +それ以外のコードポイントの幅は1である。 + +UTF-8・UTF-16・UTF-32以外の文字のシーケンスの幅は未規定。 + +アライメントに使用する文字は、常に幅1として扱われる。 + +```cpp +std::format("{:*>6}", "あ"); // "****あ" +std::format("{:あ>6}", 'x'); // "あああああx" +``` + +##### 0埋めとの関係 + +アライメント方向が指定されていると、0埋めは無効となる。 + +```cpp +// 0埋めは符号を考慮する +std::format("{:05}", 42); // "00042" +std::format("{:+05}", 42); // "+0042" +std::format("{: 05}", 42); // " 0042" + +// アライメントは符号を考慮しない +std::format("{:0>5}", 42); // "00042" +std::format("{:0>+5}", 42); // "00+42" +std::format("{:0> 5}", 42); // "00 42" + +// 0埋めも指定しているが、アライメント方向が指定されているのでアライメントが優先される +std::format("{:0>05}", -42); // "00-42" +``` + #### Range・シーケンスコンテナの書式 (C++23) Range・シーケンスコンテナに対して使用できる標準のオプション書式は次の通り(`[]`は省略可の意味)。 From 49f50b7ff4af76fbe40ccaea574d5bc0d55d233d Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Thu, 28 Mar 2024 02:35:04 +0900 Subject: [PATCH 0843/3948] =?UTF-8?q?basic=5Fformat=5Farg/op=5Fconstructor?= =?UTF-8?q?=E3=81=AE=E8=AA=AC=E6=98=8E=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/basic_format_arg.md | 28 +++++- .../format/basic_format_arg/op_constructor.md | 87 +++++++++++++++++++ reference/format/make_format_args.md | 85 ++---------------- 3 files changed, 120 insertions(+), 80 deletions(-) create mode 100644 reference/format/basic_format_arg/op_constructor.md diff --git a/reference/format/basic_format_arg.md b/reference/format/basic_format_arg.md index 209c547033..011923ec5a 100644 --- a/reference/format/basic_format_arg.md +++ b/reference/format/basic_format_arg.md @@ -7,7 +7,31 @@ ```cpp namespace std { template - class basic_format_arg; + class basic_format_arg { + public: + class handle; + + private: + using char_type = typename Context::char_type; // exposition only + + variant, + const void*, handle> value; // exposition only + + template explicit basic_format_arg(T& v) noexcept; // exposition only + + public: + basic_format_arg() noexcept; + + explicit operator bool() const noexcept; + + template + decltype(auto) visit(this basic_format_arg arg, Visitor&& vis); + template + R visit(this basic_format_arg arg, Visitor&& vis); + }; } ``` @@ -26,7 +50,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |-----------------|----------------|----------------| -| `(constructor)` | コンストラクタ | C++20 | +| [`(constructor)`](basic_format_arg/op_constructor.md) | コンストラクタ | C++20 | ### 変換演算子 diff --git a/reference/format/basic_format_arg/op_constructor.md b/reference/format/basic_format_arg/op_constructor.md new file mode 100644 index 0000000000..079eb9ef86 --- /dev/null +++ b/reference/format/basic_format_arg/op_constructor.md @@ -0,0 +1,87 @@ +# コンストラクタ + +* format[meta header] +* function[meta id-type] +* std[meta namespace] +* basic_format_arg[meta class] +* cpp20[meta cpp] + +```cpp +namespace std { + template + class basic_format_arg { + private: + using char_type = typename Context::char_type; // exposition only + + variant, + const void*, handle> value; // exposition only + + template explicit basic_format_arg(T& v) noexcept; // (2) exposition only + + public: + basic_format_arg() noexcept; // (1) + }; +} +``` +* varialt[link /reference/varialt/varialt.md] +* monostate[link /reference/varialt/monostate.md] +* basic_string_view[link /reference/string_view/basic_string_view.md] +* handle[link handle.md] +* basic_format_arg[italic] + +## 概要 + +* (1): 空の`basic_format_arg`を構築する +* (2): (説明専用)[`make_format_args`](../make_format_args.md)の内部で使用され、引数から`basic_format_args`を構築する。 + +## テンプレートパラメーター制約 + +- (2): + - `T`はフォーマットできる型であること + +## 事前条件 + +- (2): もし `decay_t` が `char_type*` または `const char_type*` である場合、 `static_cast(v)` はヌル終端された `char_type` の配列を指すこと。 + +## 事後条件 + +- (1): `!(*this)` + +## 例外 + +投げない。 + +## 効果 + +- (1): `value`を[`monostate`](/reference/varialt/monostate.md)で初期化する。 + +- (2): `TD`を`remove_const`として、以下の順に`value`を初期化する。 + - `TD`が`bool`なら、`v`で初期化 + - `TD`が`char`かつ`char_type`が`wchar_t`なら、`value`を`static_cast(v)`で初期化 + - `TD`が`char`かつ`char_type`が`wchar_t`なら、`value`を`static_cast(static_cast(v))`で初期化 + - `TD`が符号つき整数型かつ`sizeof(TD) <= sizeof(int)`なら、`value`を`static_cast(v)`で初期化 + - `TD`が符号なし整数型かつ`sizeof(TD) <= sizeof(unsigned int)`なら、`value`を`static_cast(v)`で初期化 + - `TD`が符号つき整数型かつ`sizeof(TD) <= sizeof(long long int)`なら、`value`を`static_cast(v)`で初期化 + - `TD`が符号なし整数型かつ`sizeof(TD) <= sizeof(unsigned long long int)`なら、`value`を`static_cast(v)`で初期化 + - `TD`が浮動小数点数なら、`v`で初期化 + - `TD`が`basic_string_view`または`basic_string`の特殊化で、`TD::value_type`が`char_type`と等しければ、`value`を`basic_string_view(v.data(), v.size())`で初期化 + - `decay_t`が`char_type*`または `const char_type*` なら、`value`を`static_cast(v)`で初期化 + - `is_void_v>`が`true`、または`is_null_pointer_v`が`true`なら、`value`を`static_cast(v)`で初期化 + - それ以外なら、`value`を`handle(v)`で初期化 + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 + +* [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) diff --git a/reference/format/make_format_args.md b/reference/format/make_format_args.md index b8b852c5c5..3e4ffefad8 100644 --- a/reference/format/make_format_args.md +++ b/reference/format/make_format_args.md @@ -47,92 +47,21 @@ string format(string_view fmt, const Args&... args) ## 事前条件 すべての引数の型`Ti`について`Context::formatter_type`が`Formatter`要件を満たすこと。 -## 効果 - -(2)は次と等しい。 - -```cpp -return make_format_args(args...); -``` -* wformat_context[link /reference/format/basic_format_context.md] +## 戻り値 -(1)は次と等しい。 +### (1) ```cpp return {basic_format_arg(args)...} ``` -* basic_format_arg[link /reference/format/basic_format_arg.md] +* basic_format_arg[link /reference/format/basic_format_arg/op_constructor.md] -ただし、便宜上、[`basic_format_arg`](/reference/format/basic_format_arg.md)は次のprivateメンバを持つとする。 -(これらのprivateメンバは規格に含まれない) +### (2) ```cpp -namespace std { - template - class basic_format_arg { - public: - class handle; - - private: - using charT = typename Context::char_type; - - variant, - const void*, handle> value; - - template explicit basic_format_arg(const T& v) noexcept; // (a) - explicit basic_format_arg(float n) noexcept; // (b) - explicit basic_format_arg(double n) noexcept; // (c) - explicit basic_format_arg(long double n) noexcept; // (d) - explicit basic_format_arg(const charT* s); // (e) - - template - explicit basic_format_arg( - basic_string_view s) noexcept; // (f) - - template - explicit basic_format_arg( - const basic_string& s) noexcept; // (g) - - explicit basic_format_arg(nullptr_t) noexcept; // (h) - - template - explicit basic_format_arg(const T* p) noexcept; // (i) - - template - friend format_arg_store - make_format_args(const Args&... args); - }; -} +return make_format_args(args...); ``` -* variant[link /reference/variant/variant.md] -* monostate[link /reference/variant/monostate.md] -* handle[link /reference/format/basic_format_arg/handle.md] -* basic_string[link /reference/string/basic_string.md] -* basic_string_view[link /reference/string_view/basic_string_view.md] -* basic_format_arg[link /reference/format/basic_format_arg.md] - -ここで、それぞれの効果は次と等しい。 - -* (a): - * `T`が`bool`または`charT`なら、`value`を`v`で初期化 - * または、`T`が`char`かつ`charT`が`wchar_t`なら、`value`を`static_cast(v)`で初期化 - * または、`T`が符号つき整数型かつ`sizeof(T) <= sizeof(int)`なら、`value`を`static_cast(v)`で初期化 - * または、`T`が符号なし整数型かつ`sizeof(T) <= sizeof(unsigned int)`なら、`value`を`static_cast(v)`で初期化 - * または、`T`が符号つき整数型かつ`sizeof(T) <= sizeof(long long int)`なら、`value`を`static_cast(v)`で初期化 - * または、`T`が符号なし整数型かつ`sizeof(T) <= sizeof(unsigned long long int)`なら、`value`を`static_cast(v)`で初期化 - * または、`value`を`handle(v)`で初期化 -* (b),(c),(d): `value`を`n`で初期化 -* (e): `value`を`s`で初期化 (`s`は有効なC文字列であること) -* (f): `value`を`s`で初期化 -* (g): `value`を`basic_string_view(s.data(), s.size())`で初期化 -* (h): `value`を`static_cast(nullptr)`で初期化 -* (i): `value`を`p`で初期化 (`is_void_v`が`true`であること) - -## 戻り値 -`{basic_format_arg(args)...}` +* wformat_context[link /reference/format/basic_format_context.md] ## 実装例 ```cpp @@ -150,7 +79,7 @@ namespace std { } } ``` -* basic_format_arg[link /reference/format/basic_format_arg.md] +* basic_format_arg[link /reference/format/basic_format_arg/op_constructor.md] * wformat_context[link /reference/format/basic_format_context.md] ## バージョン From 018f507010ff8d0516db6b24f959d21cccdf3fa9 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Thu, 28 Mar 2024 02:43:39 +0900 Subject: [PATCH 0844/3948] Fix typo --- reference/format/basic_format_arg/op_constructor.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/format/basic_format_arg/op_constructor.md b/reference/format/basic_format_arg/op_constructor.md index 079eb9ef86..f847702f1e 100644 --- a/reference/format/basic_format_arg/op_constructor.md +++ b/reference/format/basic_format_arg/op_constructor.md @@ -26,8 +26,8 @@ namespace std { }; } ``` -* varialt[link /reference/varialt/varialt.md] -* monostate[link /reference/varialt/monostate.md] +* variant[link /reference/variant/variant.md] +* monostate[link /reference/variant/monostate.md] * basic_string_view[link /reference/string_view/basic_string_view.md] * handle[link handle.md] * basic_format_arg[italic] @@ -56,7 +56,7 @@ namespace std { ## 効果 -- (1): `value`を[`monostate`](/reference/varialt/monostate.md)で初期化する。 +- (1): `value`を[`monostate`](/reference/variant/monostate.md)で初期化する。 - (2): `TD`を`remove_const`として、以下の順に`value`を初期化する。 - `TD`が`bool`なら、`v`で初期化 From 6d8a2a34ad5c20356d3d44f8a71eb81f2a540f2e Mon Sep 17 00:00:00 2001 From: Akiko Kawai Date: Sat, 30 Mar 2024 13:59:01 +0900 Subject: [PATCH 0845/3948] Update C++20 for ICX implementation-status --- implementation-status.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/implementation-status.md b/implementation-status.md index c459b7c039..18eec19cb0 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -188,7 +188,7 @@ | P0692R1: [特殊化のアクセスチェック](/lang/cpp20/access_checking_on_specializations.md) | | Yes | partial | 2021.4 | 2019 Update 6 | | P0624R2: [状態を持たないラムダ式を、デフォルト構築可能、代入可能とする](/lang/cpp20/default_constructible_and_assignable_stateless_lambdas.md) | キャプチャしていないラムダ式をデフォルト構築・代入可能にする | 9 | 8.0 | 2021.4 | 2019 Update 2 | | P0767R1: [PODを非推奨化](/lang/cpp20/deprecate_pod.md) | PODという用語を非推奨化する | | | 2021.4 | 2019 Update 5 | -| P0315R4: [評価されない文脈でのラムダ式](/lang/cpp20/wording_for_lambdas_in_unevaluated_contexts.md) | 評価されない文脈でもラムダ式を書くことができるようにする | 9 | Partial | | 2019 Update 8 | +| P0315R4: [評価されない文脈でのラムダ式](/lang/cpp20/wording_for_lambdas_in_unevaluated_contexts.md) | 評価されない文脈でもラムダ式を書くことができるようにする | 9 | Partial | 2024.0 | 2019 Update 8 | | P0840R2: [空オブジェクトを言語サポート](/lang/cpp20/language_support_for_empty_objects.md) | `[[no_unique_address]]`属性を導入し、空の型のオブジェクトをほかのオブジェクトと共有する最適化を許可する | 9 | 9.0 | 2021.4 | 2019 Update 9 †1 | | P0962R1: [範囲for文がカスタマイゼーションポイントを見つけるルールを緩和](/lang/cpp20/relaxing_the_range_for_loop_customization_point_finding_rules.md) | `begin()`/`end()`メンバ関数のどちらかが見つからなかった場合に非メンバ関数の`begin()`/`end()`を探しにいく | 8 | 8 | 2021.4 | 2019 Update 5 | | P0969R0: [friend指定された関数内から構造化束縛を使用して非公開メンバ変数にアクセスすることを許可](/lang/cpp20/allow_structured_bindings_to_accessible_members.md) | 構造化束縛の仕様として公開メンバ変数のみを取り出せるようになっていたが、friend指定された関数からは非公開メンバ変数にもアクセスできるようにする | 8 | 8.0 | 2021.4 | 2019 | @@ -221,7 +221,7 @@ | P0848R3: [条件付きで特殊メンバ関数をトリビアルに定義するように](/lang/cpp20/conditionally_trivial_special_member_functions.md.nolink) | 制約によってトリビアルな特殊メンバ関数と非トリビアルな特殊メンバ関数をオーバーロードできるようにする | 10 | 16 Partial (consepts 未実装部あり) | 2022.3 | 2019 Update 8 | | P1301R4: [`[[nodiscard]]`属性に理由となる文字列を付加できるようにする](/lang/cpp20/nodiscard_should_have_a_reason.md) | 関数の戻り値を無視してはならない理由を関数宣言に持たせ、警告メッセージに役立てる | 10 | 9.0 | 2021.6 | 2019 Update 5 | | P1099R5: [スコープ付き列挙型のusing宣言](/lang/cpp20/using_enum.md) | `using enum EnumType;`もしくは`using EnumType::enumerator`とすることで、列挙値のスコープ指定を省略できるようにする | 11 | 13 | 2023.0 | 2019 Update 4 | -| P1816R0: [集成体クラステンプレートのテンプレート引数推論](/lang/cpp20/class_template_argument_deduction_for_aggregates.md) | クラステンプレートのテンプレート引数推論はコンストラクタ引数から推論されるが、集成体初期化からも推論できるようにする | 10 | No | | 2019 Update 7 | +| P1816R0: [集成体クラステンプレートのテンプレート引数推論](/lang/cpp20/class_template_argument_deduction_for_aggregates.md) | クラステンプレートのテンプレート引数推論はコンストラクタ引数から推論されるが、集成体初期化からも推論できるようにする | 10 | No | 2024.0 | 2019 Update 7 | | P1668R1: [constexpr関数内で未評価のインラインアセンブリを許可することによる組み込み関数のconstexpr有効化](/lang/cpp20/enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.md) | コンパイル時に評価されない場合にconstexpr関数にasm定義を含めることを許可 | 10 | 10.0 | 2022.3 | 2019 Update 9 | | P0388R4: [要素数不明の配列への変換を許可](/lang/cpp20/permit_conversions_to_arrays_of_unknown_bound.md) | 要素数が判明している配列から、要素数が不明の配列への変換を許可 | 10 | 14 | 2021.6 | 2019 Update 7 | | P1143R2: [コンパイル時初期化を強制する`constinit`キーワードを追加](/lang/cpp20/constinit.md) | 初期化のみコンパイル時におわらせたい場合に使用する | 10 | 10.0 | 2022.3 | 2019 Update 10 | From ddce954473d700359159117b767c212b29804314 Mon Sep 17 00:00:00 2001 From: Akiko Kawai Date: Sat, 30 Mar 2024 14:41:25 +0900 Subject: [PATCH 0846/3948] =?UTF-8?q?Fixed=20[implementation-status]MSVC?= =?UTF-8?q?=E3=81=AE=E5=AF=BE=E5=BF=9C=E9=96=93=E9=81=95=E3=81=84=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/implementation-status.md b/implementation-status.md index 18eec19cb0..c79af23192 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -259,7 +259,7 @@ | P1847R4: [アクセス制御の異なるメンバ変数のレイアウトを宣言順に規定](/lang/cpp23/make_declaration_order_layout_mandated.md) | アクセス制御の異なるメンバ変数のレイアウトは並び替えを許可されていたが宣言順に規定する | Yes | Yes | - | 2022 | | P2128R6: [添字演算子の多次元サポート](/lang/cpp23/multidimensional_subscript_operator.md) | `operator[](int x, int y, int z)`のように添字演算子のオーバーロードで複数のパラメータをとることを許可 | 12 | 15 | 2022.2 | - | | P1169R4: [`this`ポインタをもつ必要のない演算子を`static`として宣言できるようにする](/lang/cpp23/static_operator.md) | 状態をもたないいくつかの演算子を`static`として宣言できるようにする | 13 | 16 | 2023.2 | - | -| P2201R1: [異なる文字エンコーディングをもつ文字列リテラルの連結を不適格とする](/lang/cpp23/mixed_string_literal_concatenation.md) | `auto a = u8"" L"";`のような異なる文字エンコーディング同士での文字列リテラルを連結を禁止する | Yes | Yes | 2022.2 | Yes | +| P2201R1: [異なる文字エンコーディングをもつ文字列リテラルの連結を不適格とする](/lang/cpp23/mixed_string_literal_concatenation.md) | `auto a = u8"" L"";`のような異なる文字エンコーディング同士での文字列リテラルを連結を禁止する | Yes | Yes | 2022.2 | - | | P2029R4: [文字・文字列リテラル中の数値・ユニバーサルキャラクタのエスケープに関する問題解決](/lang/cpp23/numeric_and_universal_character_escapes_in_character_and_string_literals.md.nolink) | | - | - | - | - | | P2362R3: [1ワイド文字に収まらないワイド文字リテラルを禁止する](/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md) | エンコード結果として`wchar_t`の大きさに収まらないワイド文字リテラルを禁止する | 13 | 14 | 2023.2 | - | | P2071R2: [名前付きユニバーサルキャラクタ名](/lang/cpp23/named_universal_character_escapes.md) | 16進数のユニバーサルキャラクタだけでなく、その文字の名前を入力できるようにする | 13 | 15 | 2023.2 | - | From b064d83503032178f77ab0791f70c51f57462533 Mon Sep 17 00:00:00 2001 From: Akiko Kawai Date: Sat, 30 Mar 2024 15:00:47 +0900 Subject: [PATCH 0847/3948] =?UTF-8?q?Re-Fixed=20[implementation-status]MSV?= =?UTF-8?q?C=E3=81=AE=E5=AF=BE=E5=BF=9C=E9=96=93=E9=81=95=E3=81=84?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E3=81=97=E3=81=9F=E3=81=91=E3=81=A9=E9=96=93?= =?UTF-8?q?=E9=81=95=E3=81=84=E3=81=98=E3=82=83=E3=81=AA=E3=81=8B=E3=81=A3?= =?UTF-8?q?=E3=81=9F=E3=81=AE=E3=81=A7=E6=88=BB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/implementation-status.md b/implementation-status.md index c79af23192..18eec19cb0 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -259,7 +259,7 @@ | P1847R4: [アクセス制御の異なるメンバ変数のレイアウトを宣言順に規定](/lang/cpp23/make_declaration_order_layout_mandated.md) | アクセス制御の異なるメンバ変数のレイアウトは並び替えを許可されていたが宣言順に規定する | Yes | Yes | - | 2022 | | P2128R6: [添字演算子の多次元サポート](/lang/cpp23/multidimensional_subscript_operator.md) | `operator[](int x, int y, int z)`のように添字演算子のオーバーロードで複数のパラメータをとることを許可 | 12 | 15 | 2022.2 | - | | P1169R4: [`this`ポインタをもつ必要のない演算子を`static`として宣言できるようにする](/lang/cpp23/static_operator.md) | 状態をもたないいくつかの演算子を`static`として宣言できるようにする | 13 | 16 | 2023.2 | - | -| P2201R1: [異なる文字エンコーディングをもつ文字列リテラルの連結を不適格とする](/lang/cpp23/mixed_string_literal_concatenation.md) | `auto a = u8"" L"";`のような異なる文字エンコーディング同士での文字列リテラルを連結を禁止する | Yes | Yes | 2022.2 | - | +| P2201R1: [異なる文字エンコーディングをもつ文字列リテラルの連結を不適格とする](/lang/cpp23/mixed_string_literal_concatenation.md) | `auto a = u8"" L"";`のような異なる文字エンコーディング同士での文字列リテラルを連結を禁止する | Yes | Yes | 2022.2 | Yes | | P2029R4: [文字・文字列リテラル中の数値・ユニバーサルキャラクタのエスケープに関する問題解決](/lang/cpp23/numeric_and_universal_character_escapes_in_character_and_string_literals.md.nolink) | | - | - | - | - | | P2362R3: [1ワイド文字に収まらないワイド文字リテラルを禁止する](/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md) | エンコード結果として`wchar_t`の大きさに収まらないワイド文字リテラルを禁止する | 13 | 14 | 2023.2 | - | | P2071R2: [名前付きユニバーサルキャラクタ名](/lang/cpp23/named_universal_character_escapes.md) | 16進数のユニバーサルキャラクタだけでなく、その文字の名前を入力できるようにする | 13 | 15 | 2023.2 | - | From 2bb90e8bb43097dffc3c2bc4753b24b39c9ab35c Mon Sep 17 00:00:00 2001 From: hnakashima <69759577+nakashima-hikaru@users.noreply.github.com> Date: Sat, 30 Mar 2024 20:20:28 +0900 Subject: [PATCH 0848/3948] Update ranges_copy.md fix typo --- reference/algorithm/ranges_copy.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/algorithm/ranges_copy.md b/reference/algorithm/ranges_copy.md index 2e773767f5..6b1d7d137d 100644 --- a/reference/algorithm/ranges_copy.md +++ b/reference/algorithm/ranges_copy.md @@ -75,8 +75,8 @@ int main() { std::vector v2(v.size()); // ちゃんと確保しておくこと std::ranges::copy(v, v2.begin()); - // back_inserter を使って v3 へ設定。 - // back_inserter は要素をコピーするときに v3.push_back() するイテレータを作る関数。 + // back_inserter を使って ls3 へ設定。 + // back_inserter は要素をコピーするときに ls3.push_back() するイテレータを作る関数。 std::list ls3; std::ranges::copy(v2, std::back_inserter(ls3)); From cf1a2310e4c8f7de4b5825b96a5173c7738864a7 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sun, 31 Mar 2024 04:28:30 +0900 Subject: [PATCH 0849/3948] Update format.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rangeのフォーマットの細かい点を追記 --- reference/format/format.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/reference/format/format.md b/reference/format/format.md index 60a4f19d63..56ac125991 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -229,21 +229,24 @@ Range・シーケンスコンテナに対して使用できる標準のオプシ | range-type | 意味 | 効果 | 対応バージョン | |------------|------|------|----------------| -| m | `std::map`出力向けの書式 | 全体の囲み文字を`[ ]`の代わりに`{ }`とする。要素型がtuple-like型であれば要素型にも`m`書式を適用する | C++23 | +| m | `std::map`出力向けの書式 | 全体の囲み文字を`[ ]`の代わりに`{ }`とする。要素型にも`m`書式を適用する | C++23 | | s | 文字列として出力 | 要素型が文字型であること。エスケープ処理しない文字列として書式化する | C++23 | | ?s | デバッグ文字列として出力 | 要素型が文字型であること。エスケープした文字列として書式化する | C++23 | -- `?s`書式を指定した場合、`n`オプションと、`range-underlying-spec`は指定できない。 +- `m`書式は、要素が[`std::pair`](/reference/utility/pair.md)とサイズ2の[`std::tuple`](/reference/tuple/tuple.md)の場合のみ指定できる +- `?s`書式を指定した場合、`n`オプションと、`range-underlying-spec`は指定できない - コンテナが[`std::vector`](/reference/vector/vector.md)``である場合、その要素型は`bool`として処理される - Range・シーケンスコンテナでは、要素型がデバッグ出力可能である場合、それがデフォルトで有効となる - 要素型の書式を指定して、デバッグ出力指定をしなければ、デフォルトで有効になっているデバッグ出力を解除できる - コンテナアダプタである[`std::queue`](/reference/queue/queue.md)、[`std::priority_queue`](/reference/queue/priority_queue.md)、[`std::stack`](/reference/stack/stack.md)も使用できる - +- [`std::basic_string`](/reference/string/basic_string.md)と[`std::basic_string_view`](/reference/string_view/basic_string_view.md)はRangeでもあるが、特殊化の優先順位によって標準のフォーマッターが選択されるため、Rangeとしてフォーマットすることはできない #### 連想コンテナの書式 (C++23) -Range・シーケンスコンテナと同じだが、デフォルトで`m`書式を適用する。 +Range・シーケンスコンテナと同じだが、デフォルトで囲み文字を`{ }`とする。 +- メンバ型`key_type`を持つ場合、連想コンテナとみなされる +- さらに、メンバ型`mapped_type`を持ち、要素が[`std::pair`](/reference/utility/pair.md)またはサイズ2の[`std::tuple`](/reference/tuple/tuple.md)の場合、`map`互換のコンテナとみなされる。このとき、要素にも`m`書式を用いる #### pair、tupleの書式 (C++23) From fef3ffc53cd1ed014b56d454bf06c7caf090a92d Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sun, 31 Mar 2024 18:11:01 +0900 Subject: [PATCH 0850/3948] Update std.compat.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "この機能が必要になった背景・経緯"を追加 --- module/std.compat.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/module/std.compat.md b/module/std.compat.md index 3366271e79..c71c002854 100644 --- a/module/std.compat.md +++ b/module/std.compat.md @@ -18,6 +18,20 @@ int main() { } ``` +## 備考 +`std.compat`は[`std`](std.md)の内容をすべて含んでいるので、`std.compat`をインポートする場合は[`std`](std.md)をインポートしなくてよい。 + +## この機能が必要になった背景・経緯 + +標準ライブラリモジュール[`std`](std.md)で、C言語互換ライブラリの内容をグローバル名前空間に導入するかどうかで意見が分かれた結果、別のモジュールとして用意することになった。 + +- C言語互換ライブラリの内容をグローバル名前空間に導入しない場合、既存コードベースを移行するのが難しくなる(例えば、`std::size_t`ではなく`size_t`と書いているコードは多いだろう)。 +- 一方、「``は確実にグローバル名前空間へ名前を導入する一方、`std`名前空間に導入するかどうかは未規定。``はその逆」という混乱した状況を、グローバル名前空間へ名前を導入しない方向へ解決する滅多にない機会でもあった。 + +そこで、2つのモジュールを用意することで両方の課題を解決することとなった。グローバル名前空間を綺麗にしたいユーザーは[`std`](std.md)のみを使用すればよい。 +一方、既存コードの互換性を重視したいときは、`std.compat`をインポートすればよい。 +ただし、この場合でも標準ライブラリのマクロに依存したコードの互換性はない点には注意が必要である。 + ## バージョン ### 言語 - C++23 From afd10bb6e3a429da8dd2a5345219ffe5875bec96 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sun, 31 Mar 2024 18:31:22 +0900 Subject: [PATCH 0851/3948] Update std.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "この機能が必要になった背景・経緯"を追加 --- module/std.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/module/std.md b/module/std.md index 8916a34fd3..9da6f5bb5a 100644 --- a/module/std.md +++ b/module/std.md @@ -47,7 +47,23 @@ int main() { } ``` -グローバル名前空間にも定義を導入したい場合、[`std.compat`](std.compat.md)を使用できる。 +グローバル名前空間にも定義を導入したい場合、`std`の代わりに[`std.compat`](std.compat.md)を使用できる(両方を使う必要はない)。 + +## この機能が必要になった背景・経緯 + +C++20に言語機能としての[モジュール](/lang/cpp20/modules.md)を追加する議論と並行して、標準ライブラリをモジュールへ再編する議論も行われていた。 +例えば、[P0581R1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0581r1.pdf)では以下のモジュールが提案されている。 + +- `std.fundamental` +- `std.core` +- `std.io` +- `std.os` +- `std.concurrency` +- `std.math` +- `std` + +しかし、標準ライブラリ全体の再編はあまりにも壮大であり、C++20には間に合わなかった。 +これではモジュールの恩恵を受けるのが難しいということで、最小限のモジュールとして`std`がC++23に間に合うように追加された。 ## バージョン ### 言語 From 4f5156fc90f197b9264e33006f213298cf42d1a9 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Mon, 1 Apr 2024 07:28:42 +0900 Subject: [PATCH 0852/3948] Update begin.md --- reference/format/basic_format_parse_context/begin.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/reference/format/basic_format_parse_context/begin.md b/reference/format/basic_format_parse_context/begin.md index be15eeaedf..a91ef225b8 100644 --- a/reference/format/basic_format_parse_context/begin.md +++ b/reference/format/basic_format_parse_context/begin.md @@ -10,12 +10,16 @@ constexpr const_iterator begin() const noexcept; ``` ## 概要 -書式文字列の先頭を指すイテレータを取得する。 - +残りの書式文字列の先頭を指すイテレータを取得する。 ## 効果 メンバ変数として保持している、書式文字列の先頭を指すイテレータを返す。 +## 備考 +コンテキストがフォーマッターの[`parse`メンバ関数](../formatter/parse.md)に渡された時点で、この関数の値は以下のいずれかである。 + +- 置換フィールドのオプション`{:options...}`がある場合、`:`の次の文字を指すイテレータ +- オプションがない場合、 [`end()`](end.md) と等しいか、`}`を指すイテレータ ## 例 ### 基本的な使い方 From 194f60ccc5e77e265dafef472e83e4482e62c421 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 1 Apr 2024 18:24:48 +0900 Subject: [PATCH 0853/3948] =?UTF-8?q?map::emplace=20:=20=E6=88=BB=E3=82=8A?= =?UTF-8?q?=E5=80=A4=E3=81=AE=E4=BE=8B=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/map/map/emplace.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/reference/map/map/emplace.md b/reference/map/map/emplace.md index f9118597f6..94d10465e8 100644 --- a/reference/map/map/emplace.md +++ b/reference/map/map/emplace.md @@ -61,6 +61,41 @@ int main() 4 : C ``` +### 戻り値の例 +```cpp example +#include +#include + +int main() +{ + std::map m; + + std::pair::iterator, bool> x = m.emplace(3, 'A'); + const std::pair& v = *x.first; + std::cout << v.first << std::endl; // キー + std::cout << v.second << std::endl; // 値 + std::cout << x.second << std::endl; // 挿入が成功したかどうか + std::cout << std::endl; + + auto y = m.emplace(3, 'A'); + std::cout << y.first->first << std::endl; // キー + std::cout << y.first->second << std::endl; // 値 + std::cout << y.second << std::endl; // 挿入が成功したかどうか +} +``` +* emplace[color ff0000] + +#### 出力 +``` +3 +A +1 + +3 +A +0 +``` + ### キーと値もそれぞれコンストラクタ引数を渡す例 ```cpp example #include From a659a6b0b282b6a5000a8986ee11f8e61d70ef1d Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Tue, 2 Apr 2024 07:24:59 +0900 Subject: [PATCH 0854/3948] =?UTF-8?q?formatter:=20=E8=AA=AC=E6=98=8E?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/formatter.md | 51 ++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/reference/format/formatter.md b/reference/format/formatter.md index 24a788f1a7..800229fddd 100644 --- a/reference/format/formatter.md +++ b/reference/format/formatter.md @@ -44,28 +44,14 @@ namespace std { (1)は、`charT`を`char`または`wchar_t`とすると、標準で以下の特殊化が利用できる。 -- 1 以下のもの。 - ```cpp - template<> struct formatter; - - template<> struct formatter; - - template<> struct formatter; - - template<> struct formatter; - - template struct formatter; - - template - struct formatter, charT>; - - template - struct formatter, charT>; - ``` - * basic_string[link /reference/string/basic_string.md] - * basic_string_view[link /reference/string_view/basic_string_view.md] - -- 2 第1テンプレート引数が`nullptr_t`, `void*`, `const void*`, `bool`, すべてのCV修飾されない標準の整数型, 拡張整数型, 浮動小数点数型であり、第2テンプレート引数が`charT`であるもの。 +- `template<> struct formatter` +- `template<> struct formatter` +- `template<> struct formatter` +- `template<> struct formatter` +- `template struct formatter` +- `template struct formatter<`[`basic_string`](/reference/string/basic_string.md)`, charT>` +- `template struct formatter<`[`basic_string_view`](/reference/string_view/basic_string_view.md)`, charT>` +- 第1テンプレート引数が`nullptr_t`, `void*`, `const void*`, `bool`, すべてのCV修飾されない標準の整数型, 拡張整数型, 浮動小数点数型であり、第2テンプレート引数が`charT`であるもの。 さらに、ユーザーが`formatter`を特殊化した場合、それも有効である。 @@ -96,7 +82,7 @@ namespace std { - 出力は`u`、`fc.locale()`、最後に呼び出された`f.parse(pc)`のイテレータ範囲`[pc.begin(), pc.end())`以外に依存しない - `u`を変更しない -条件内の各要素を、以下のように定義する +条件内の各要素を、以下のように定義する。 - 文字の型を`charT` - 出力イテレータの型を`Out` @@ -109,11 +95,28 @@ namespace std { - `FC`を[`basic_format_context`](basic_format_context.md)`` - `pc`を`PC`のlvalue - `fc`を`FC`のlvalue -- `pc.begin()`は書式文字列中の対応する置換フィールドのオプションの先頭を指す + +ただし、[`parse`](formatter/parse.md)の呼び出し前の状態で、`pc.begin()`は書式文字列中の対応する置換フィールドのオプションの先頭を指す。 + +- オプションが空でなければ、`*pc.begin()`は`:`の次の文字 - オプションが空なら、`pc.begin() == pc.end()`または`*pc.begin() == '}'`である [`std::formattable`](/reference/format/formattable.md)コンセプトも参照。 +フォーマッターは、書式文字列中に置換フィールドが見つかるたびに次のコードと近い形で呼び出される。 + +```cpp +typename FC::template formatter_type f; +pc.advance_to(f.parse(pc)); // オプションを解析し状態を保存する +fc.advance_to(f.format(u, fc)); // 状態をもとにフォーマットを行う +assert(pc.begin() == pc.end() || *pc.begin() == '}'); +``` +* pc.advance_to[link /reference/format/basic_format_parse_context/advance_to.md] +* fc.advance_to[link /reference/format/basic_format_context/advance_to.md] +* f.parse[link formatter/parse.md] +* f.format[link formatter/format.md] + +[handle](/reference/format/basic_format_arg/handle.md)も参照。 ## メンバ関数 From f71ba40b132264533267c4eafb43f5fb4a0d9402 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Tue, 2 Apr 2024 07:25:25 +0900 Subject: [PATCH 0855/3948] =?UTF-8?q?=E6=9B=B8=E5=BC=8F=E6=96=87=E5=AD=97?= =?UTF-8?q?=E5=88=97=E3=81=AE=E5=8F=96=E5=BE=97=E3=81=AE=E3=81=97=E3=81=8B?= =?UTF-8?q?=E3=81=9F=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/format.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/format/format.md b/reference/format/format.md index 56ac125991..8745522d7a 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -622,25 +622,25 @@ int main() template string format(format_string fmt, const Args&... args) { - return vformat(fmt.str, make_format_args(args...)); + return vformat(fmt.get(), make_format_args(args...)); } template wstring format(wformat_string fmt, const Args&... args) { - return vformat(fmt.str, make_wformat_args(args...)); + return vformat(fmt.get(), make_wformat_args(args...)); } template string format(const locale& loc, format_string fmt, const Args&... args) { - return vformat(loc, fmt.str, make_format_args(args...)); + return vformat(loc, fmt.get(), make_format_args(args...)); } template wstring format(const locale& loc, wformat_string fmt, const Args&... args) { - return vformat(loc, fmt.str, make_wformat_args(args...)); + return vformat(loc, fmt.get(), make_wformat_args(args...)); } ``` * string[link /reference/string/basic_string.md] From d548d89055843d52b6c01b4883dd1ac49674d006 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Tue, 2 Apr 2024 07:30:07 +0900 Subject: [PATCH 0856/3948] =?UTF-8?q?=E8=A3=9C=E8=B6=B3=E8=AA=AC=E6=98=8E?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/basic_format_context.md | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/reference/format/basic_format_context.md b/reference/format/basic_format_context.md index 17cf7666aa..e3f5d4020d 100644 --- a/reference/format/basic_format_context.md +++ b/reference/format/basic_format_context.md @@ -26,6 +26,9 @@ namespace std { ## テンプレートパラメータ制約 - `Out`は`OutputIterator`であること +## 備考 + +出力イテレータの型はフォーマット関数に指定したイテレータである必要はない。内部でバッファリングを行う実装が可能である。 ## メンバ関数 @@ -51,26 +54,33 @@ namespace std { class basic_format_context { basic_format_args args_; Out out_; + std::optional locale; public: using iterator = Out; using char_type = charT; template using formatter_type = formatter; - basic_format_arg arg(size_t id) const + basic_format_context(iterator out, std::basic_format_args args, std::optional locale = std::nullopt) + :args_(args) + ,out_(out) + ,locale_(locale) { + } + + basic_format_arg arg(size_t id) const { return args_.get(id); } - std::locale locale(); + std::locale locale() { + return locale_.value_or(std::locale()); + } - iterator out(); - { + iterator out() { return out_; } - void advance_to(iterator it) - { + void advance_to(iterator it) { out_ = it; } }; From 5398590e45f46a3ceeebed25fc7e23c6f1c6a893 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Tue, 2 Apr 2024 07:35:09 +0900 Subject: [PATCH 0857/3948] =?UTF-8?q?=E5=AE=9F=E8=A3=85=E4=BE=8B=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/vformat_to.md | 92 ++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/reference/format/vformat_to.md b/reference/format/vformat_to.md index ce32872781..78737ce054 100644 --- a/reference/format/vformat_to.md +++ b/reference/format/vformat_to.md @@ -65,6 +65,98 @@ namespace std { 書式文字列が正しくなかったり、フォーマット実行時に失敗したりした場合、[`format_error`](format_error.md)を投げる。 +## 実装例 + +```cpp +template +struct ArgVisitor { + ParseContext& pctx; + FormatContext& fctx; + + void operator()(std::monostate) { + } + + using handle = std::basic_format_arg::handle; + void operator()(const handle& handle) { + handle.format(pctx, fctx); + } + + template + void operator()(const T& arg) { + using Formatter = FormatContext::template formatter_type; + Formatter formatter; + pctx.advance_to(formatter.parse(pctx)); + fctx.advance_to(formatter.format(arg, fctx)); + } +}; + +template Out, class Context = basic_format_context> +Out vformat_to(Out out, std::string_view fmt, std::basic_format_args args) { + using ParseContext = std::basic_format_parse_context; + ParseContext pctx{fmt}; + Context fctx{out, args}; // このコンストラクタの存在は未規定 + ArgVisitor visitor{pctx, fctx}; + + size_t next_arg_index = 0; + while (!std::ranges::empty(pctx)) { + auto it = pctx.begin(); + if (*it == '{') { + ++it; + if (it == pctx.end()) { + throw std::format_error("invalid format"); + } else if (*it != '{') { + // インデックスを解析する + size_t index; + if (auto [ptr, ec] = std::from_chars(it, pctx.end(), index); ec == std::errc{}) { + it += (ptr - std::to_address(it)); + pctx.check_arg_id(index); + } else { + index = next_arg_index; + pctx.next_arg_id(); + ++next_arg_index; + } + // オプション開始マークを解析する + if (it == pctx.end()) { + throw std::format_error("invalid format"); + } else if (*it == ':') { + ++it; + } else if (*it != '}') { + throw std::format_error("invalid format"); + } + pctx.advance_to(it); + // フォーマッターを呼び出す + std::visit_format_arg(visitor, args.get(index)); + // 置換フィールドの終端を解析する + if (it == pctx.end() || *it != '}') { + throw std::format_error("invalid format"); + } + pctx.advance_to(++it); + continue; + } + } else if (*it == '}') { + ++it; + if (it == pctx.end() || *it != '}') { + throw std::format_error("invalid format"); + } + } + *out = *it; + pctx.advance_to(++it); + fctx.advance_to(++out); + } + return out; +} +``` +* pctx.advance_to[link /reference/format/basic_format_parse_context/advance_to.md] +* fctx.advance_to[link /reference/format/basic_format_context/advance_to.md] +* formatter.parse[link /reference/format/formatter/parse.md] +* formatter.format[link /reference/format/formatter/format.md] +* std::format_error[link /reference/format/format_error.md] +* std::basic_format_parse_context[link /reference/format/basic_format_parse_context.md] +* std::basic_format_context[link /reference/format/basic_format_context.md] +* std::basic_format_args[link /reference/format/basic_format_args.md] +* std::visit_format_arg[link /reference/format/visit_format_arg.md] +* std::from_chars[link /reference/charconv/from_chars.md] + ## バージョン ### 言語 - C++20 From 963ad2b66de478007b52277909109a1f1c770f2b Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Tue, 2 Apr 2024 07:45:02 +0900 Subject: [PATCH 0858/3948] Fix error --- reference/format/vformat_to.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/format/vformat_to.md b/reference/format/vformat_to.md index 78737ce054..e6a3e14a74 100644 --- a/reference/format/vformat_to.md +++ b/reference/format/vformat_to.md @@ -90,7 +90,7 @@ struct ArgVisitor { } }; -template Out, class Context = basic_format_context> +template Out, class Context = std::basic_format_context> Out vformat_to(Out out, std::string_view fmt, std::basic_format_args args) { using ParseContext = std::basic_format_parse_context; ParseContext pctx{fmt}; From 8ca314b28b9137c18bb99d7f1b9c372243606cd4 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Tue, 2 Apr 2024 07:47:03 +0900 Subject: [PATCH 0859/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/vformat_to.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reference/format/vformat_to.md b/reference/format/vformat_to.md index e6a3e14a74..dd565dd0d5 100644 --- a/reference/format/vformat_to.md +++ b/reference/format/vformat_to.md @@ -154,6 +154,8 @@ Out vformat_to(Out out, std::string_view fmt, std::basic_format_args ar * std::basic_format_parse_context[link /reference/format/basic_format_parse_context.md] * std::basic_format_context[link /reference/format/basic_format_context.md] * std::basic_format_args[link /reference/format/basic_format_args.md] +* std::basic_format_arg[link /reference/format/basic_format_arg.md] +* handle[link /reference/format/basic_format_arg/handle.md] * std::visit_format_arg[link /reference/format/visit_format_arg.md] * std::from_chars[link /reference/charconv/from_chars.md] From 3b1b6189a8eb1ce4a82fc4edc35a005eadcaaf7d Mon Sep 17 00:00:00 2001 From: yumetodo Date: Wed, 3 Apr 2024 18:13:35 +0900 Subject: [PATCH 0860/3948] fix(ci): ripgrep 14.1.0 --- .github/workflows/detect_forbidden_characters.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/detect_forbidden_characters.yml b/.github/workflows/detect_forbidden_characters.yml index 0fa333b698..3db4dd2eeb 100644 --- a/.github/workflows/detect_forbidden_characters.yml +++ b/.github/workflows/detect_forbidden_characters.yml @@ -14,7 +14,7 @@ jobs: build: runs-on: ubuntu-latest env: - RIPGREP_VERSION: 14.0.3 + RIPGREP_VERSION: 14.1.0 BIN_DIR: ${{ github.workspace }}/bin REPO_DIR: repo cache-version: v1 From 8e148d172551919f6053af466778fe544ce9fe97 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sun, 7 Apr 2024 13:58:43 +0900 Subject: [PATCH 0861/3948] =?UTF-8?q?=E5=AE=9F=E8=A3=85=E4=BE=8B=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/format_to_n.md | 68 ++++++++++++++++++++++++++++++ reference/format/formatted_size.md | 53 +++++++++++++++++++++++ reference/format/vformat.md | 37 ++++++++++++++++ 3 files changed, 158 insertions(+) diff --git a/reference/format/format_to_n.md b/reference/format/format_to_n.md index 59b29c5eb8..3647d188fd 100644 --- a/reference/format/format_to_n.md +++ b/reference/format/format_to_n.md @@ -111,6 +111,74 @@ int main() The answer is 42. ``` + +## 実装例 + +```cpp +template +class Wrapper { + std::iter_difference_t count_ = 0; + std::iter_difference_t max_count_; + Out out_; + +public: + using value_type = CharT; + + Wrapper(Out out, std::iter_difference_t max_count) + : max_count_(max_count) + , out_(std::move(out)) + {} + + constexpr void push_back(const value_type& value) { + if (count_ < max_count_) { + *out_ = value; + ++out_; + } + ++count_; + } + + constexpr std::format_to_n_result result() const { + return {out_, count_}; + } +}; + +template +format_to_n_result format_to_n(Out out, iter_difference_t n, format_string fmt, Args&&... args) { + Wrapper wrapper(out, n); + format_to(back_inserter(wrapper), fmt, forward(args)...); + return wrapper.result(); +} + +template +format_to_n_result format_to_n(Out out, iter_difference_t n, wformat_string fmt, Args&&... args) { + Wrapper wrapper(out, n); + format_to(back_inserter(wrapper), fmt, forward(args)...); + return wrapper.result(); +} + +template +format_to_n_result format_to_n(Out out, iter_difference_t n, const locale& loc, format_string fmt, Args&&... args) { + Wrapper wrapper(out, n); + format_to(back_inserter(wrapper), loc, fmt, forward(args)...); + return wrapper.result(); +} + +template +format_to_n_result format_to_n(Out out, iter_difference_t n, const locale& loc, wformat_string fmt, Args&&... args) { + Wrapper wrapper(out, n); + format_to(back_inserter(wrapper), loc, fmt, forward(args)...); + return wrapper.result(); +} +``` +* format_string[link basic_format_string.md] +* wformat_string[link basic_format_string.md] +* format_to[link format_to.md] +* locale[link /reference/locale/locale.md] +* forward[link /reference/utility/forward.md] +* back_inserter[link /reference/iterator/back_inserter.md] +* iter_difference_t[link /reference/iterator/iter_difference_t.md] + + ## バージョン ### 言語 - C++20 diff --git a/reference/format/formatted_size.md b/reference/format/formatted_size.md index 0229779fa8..5680ed13e2 100644 --- a/reference/format/formatted_size.md +++ b/reference/format/formatted_size.md @@ -78,6 +78,59 @@ int main() 17 ``` +## 実装例 + +```cpp +template +class Counter { + size_t count_ = 0; +public: + using value_type = CharT; + + constexpr void push_back(const value_type&) { + count_++; + } + + constexpr size_t size() const { + return count_; + } +}; + +template +size_t formatted_size(format_string fmt, const Args&... args) { + Counter counter; + format_to(back_inserter(counter), fmt, forward(args)...); + return counter.size(); +} + +template +size_t formatted_size(wformat_string fmt, const Args&... args) { + Counter counter; + format_to(back_inserter(counter), fmt, forward(args)...); + return counter.size(); +} + +template +size_t formatted_size(const locale& loc, format_string fmt, const Args&... args) { + Counter counter; + format_to(loc, back_inserter(counter), fmt, forward(args)...); + return counter.size(); +} + +template +size_t formatted_size(const locale& loc, wformat_string fmt, const Args&... args) { + Counter counter; + format_to(loc, back_inserter(counter), fmt, forward(args)...); + return counter.size(); +} +``` +* format_string[link basic_format_string.md] +* wformat_string[link basic_format_string.md] +* format_to[link format_to.md] +* locale[link /reference/locale/locale.md] +* forward[link /reference/utility/forward.md] +* back_inserter[link /reference/iterator/back_inserter.md] + ## バージョン ### 言語 - C++20 diff --git a/reference/format/vformat.md b/reference/format/vformat.md index 0d2f9fc879..54a2f69bc5 100644 --- a/reference/format/vformat.md +++ b/reference/format/vformat.md @@ -44,6 +44,43 @@ namespace std { フォーマット実行時に失敗した場合、[`format_error`](format_error.md)を投げる。 +## 実装例 + +```cpp +string vformat(string_view fmt, format_args args) { + string str; + vformat_to(back_inserter(str), fmt.str, args); + return str; +} + +string vformat(wstring_view fmt, wformat_args args) { + wstring str; + vformat_to(back_inserter(str), fmt.str, args); + return str; +} + +string vformat(const locale& loc, string_view fmt, format_args args) { + string str; + vformat_to(loc, back_inserter(str), fmt.str, args); + return str; +} + +string vformat(const locale& loc, wstring_view fmt, wformat_args args) { + wstring str; + vformat_to(loc, back_inserter(str), fmt.str, args); + return str; +} +``` +* string[link /reference/string/basic_string.md] +* wstring[link /reference/string/basic_string.md] +* string_view[link /reference/string_view/basic_string_view.md] +* wstring_view[link /reference/string_view/basic_string_view.md] +* format_args[link /reference/format/basic_format_args.md] +* wformat_args[link /reference/format/basic_format_args.md] +* locale[link /reference/locale/locale.md] +* vformat_to[link vformat.md] +* back_inserter[link /reference/iterator/back_inserter.md] + ## バージョン ### 言語 - C++20 From 44ce3c2790c0716902bc77f34948ddea553d4e27 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sun, 7 Apr 2024 18:16:24 +0900 Subject: [PATCH 0862/3948] fix some typo --- reference/list/list/size.md | 2 +- reference/list/list/splice.md | 2 +- reference/locale/wstring_convert/op_constructor.md | 2 +- reference/memory/unique_ptr.md | 8 ++++---- reference/span/span/subspan.md | 2 +- reference/string/char_traits.md | 2 +- reference/string/char_traits/not_eof.md | 2 +- reference/unordered_map/unordered_map/bucket.md | 2 +- reference/unordered_map/unordered_map/bucket_size.md | 2 +- reference/unordered_map/unordered_map/insert_or_assign.md | 4 ++-- reference/unordered_map/unordered_map/try_emplace.md | 2 -- 11 files changed, 14 insertions(+), 16 deletions(-) diff --git a/reference/list/list/size.md b/reference/list/list/size.md index 0f0b718830..e77b56c23f 100644 --- a/reference/list/list/size.md +++ b/reference/list/list/size.md @@ -22,7 +22,7 @@ size_type size() const noexcept; // C++11 ## 計算量 -- C++03 : 実装依存(多くの実装で定数時間 or 線形時間) +- C++03 : 実装依存(多くの実装で定数時間 or 線形時間) - C++11 : 定数時間 diff --git a/reference/list/list/splice.md b/reference/list/list/splice.md index e58ddeaf27..137fffa8c9 100644 --- a/reference/list/list/splice.md +++ b/reference/list/list/splice.md @@ -137,7 +137,7 @@ int main() ## 参照 - [LWG Issue 250. splicing invalidates iterators](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#250) -- [LWG Issue 1133. Does N2844 break current specification of `list::splice`?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#250) +- [LWG Issue 1133. Does N2844 break current specification of `list::splice`?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#1133) - [N2350 Container insert/erase and iterator constness (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2350.pdf) - [LWG Issue 3017. `list` `splice` functions should use `addressof`](https://wg21.cmeerw.net/lwg/issue3017) - [LWG Issue 3087. One final `&x` in §[list.ops]](https://wg21.cmeerw.net/lwg/issue3087) diff --git a/reference/locale/wstring_convert/op_constructor.md b/reference/locale/wstring_convert/op_constructor.md index 71a93bbf61..be6c8487df 100644 --- a/reference/locale/wstring_convert/op_constructor.md +++ b/reference/locale/wstring_convert/op_constructor.md @@ -99,6 +99,6 @@ int main() ## 参照 -- [LWG Issue 2175. `wstring_convert` and `wbuffer_convert` validity](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2176) +- [LWG Issue 2175. `wstring_convert` and `wbuffer_convert` validity](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2175) - [LWG Issue 2176. Special members for `wstring_convert` and `wbuffer_convert`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2176) - [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) \ No newline at end of file diff --git a/reference/memory/unique_ptr.md b/reference/memory/unique_ptr.md index cde23f7d46..237576b9cd 100644 --- a/reference/memory/unique_ptr.md +++ b/reference/memory/unique_ptr.md @@ -85,9 +85,9 @@ namespace std { ## ハッシュサポート | 名前 | 説明 | 対応バージョン | -|-----------------------------------------------------------|------------------------------------------|-------| -| `template struct hash;` | `hash`クラスの先行宣言 | C++11 | -| `template struct hash>;` | `hash`クラスの`unique_ptr`に対する特殊化 | C++11 | +|--------------------------------------------------------------|------------------------------------------|-------| +| `template struct hash;` | `hash`クラスの先行宣言 | C++11 | +| `template struct hash>;` | `hash`クラスの`unique_ptr`に対する特殊化 | C++11 | ## 例 @@ -144,7 +144,7 @@ hoge::~hoge() - [C++11 右辺値参照・ムーブセマンティクス](/lang/cpp11/rvalue_ref_and_move_semantics.md) - [Rvalue Reference Recommendations for Chapter 20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1856.html) - `unique_ptr`の追加と`auto_ptr`の非推奨の提案文書。 -- [LWG Issue 673. `unique_ptr` update](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#672) +- [LWG Issue 673. `unique_ptr` update](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#673) - `unique_ptr`を許可するために、インタフェースを改良した経緯 - [LWG Issue 762. `std::unique_ptr` requires complete type?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#762) - [N4089 Safe conversions in `unique_ptr`, revision 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4089.pdf) diff --git a/reference/span/span/subspan.md b/reference/span/span/subspan.md index e452b4c31a..dc501537fb 100644 --- a/reference/span/span/subspan.md +++ b/reference/span/span/subspan.md @@ -73,7 +73,7 @@ constexpr span int main() { std::vector v = {1, 2, 3, 4, 5}; - std::span s = std::span{v}; + std::span s = std::span{v}; // (1) : テンプレート引数として開始位置と要素数を指定して、要素を取得する。 // テンプレート内でこのオーバーロードを使用する場合、s.template subspan<2, 3>(); のように、 diff --git a/reference/string/char_traits.md b/reference/string/char_traits.md index 0771ee496b..15f37ddf65 100644 --- a/reference/string/char_traits.md +++ b/reference/string/char_traits.md @@ -36,7 +36,7 @@ namespace std { | [`find`](char_traits/find.md) | 文字列中から特定の値を検索する | | | [`move`](char_traits/move.md) | 文字列を他のシーケンスにコピーする | | | [`copy`](char_traits/copy.md) | 文字列を他のシーケンスにコピーする | | -| [`not_eof`](char_traits/not_eof.md) | 文字がファイル終端文字(EOF)じゃないかを判定する | | +| [`not_eof`](char_traits/not_eof.md) | 文字がファイル終端文字(EOF)ではないかを判定する | | | [`to_char_type`](char_traits/to_char_type.md) | 数値を文字に変換する | | | [`to_int_type`](char_traits/to_int_type.md) | 文字を数値に変換する | | | [`eq_int_type`](char_traits/eq_int_type.md) | 数値の等値比較 | | diff --git a/reference/string/char_traits/not_eof.md b/reference/string/char_traits/not_eof.md index 380092141d..b53c2f1d6d 100644 --- a/reference/string/char_traits/not_eof.md +++ b/reference/string/char_traits/not_eof.md @@ -10,7 +10,7 @@ static constexpr int_type not_eof(int_type c) noexcept; // C++11 ``` ## 概要 -文字がファイル終端文字(EOF)じゃないかを判定する。 +文字がファイル終端文字(EOF)ではないかを判定する。 ## 戻り値 diff --git a/reference/unordered_map/unordered_map/bucket.md b/reference/unordered_map/unordered_map/bucket.md index 2458b42b5b..d3a1535aec 100644 --- a/reference/unordered_map/unordered_map/bucket.md +++ b/reference/unordered_map/unordered_map/bucket.md @@ -68,7 +68,7 @@ int main() * um.bucket_count()[link bucket_count.md] * um.bucket_size[link bucket_size.md] -### 出力 +### 出力例 ``` bucket_count() = 11 key = E, bucket = 3, bucket_size = 1 diff --git a/reference/unordered_map/unordered_map/bucket_size.md b/reference/unordered_map/unordered_map/bucket_size.md index 39542f16f8..c99cef2346 100644 --- a/reference/unordered_map/unordered_map/bucket_size.md +++ b/reference/unordered_map/unordered_map/bucket_size.md @@ -62,7 +62,7 @@ int main() * um.cbegin[link cbegin-size_type.md] * um.cend[link cend-size_type.md] -### 出力 +### 出力例 ``` bucket_count() = 11 bucket = 0, bucket_size = 1, keys = { B, } diff --git a/reference/unordered_map/unordered_map/insert_or_assign.md b/reference/unordered_map/unordered_map/insert_or_assign.md index c5b85144bc..e407b3ffb3 100644 --- a/reference/unordered_map/unordered_map/insert_or_assign.md +++ b/reference/unordered_map/unordered_map/insert_or_assign.md @@ -32,8 +32,8 @@ iterator insert_or_assign(const_iterator hint, key_type&& k, M&& obj); ## 効果 -- (1)、(3) : `Unordered_map` が `k` と同値のキーを持つ要素 `e` を持っている場合、`e.second` に [`forward`](/reference/utility/forward.md)`(obj)` を代入する。そうでなければ、`k`, [`forward`](/reference/utility/forward.md)`(obj)` から構築した `value_type` 型のオブジェクトを挿入する。 -- (2)、(4) : `Unordered_map` が `k` と同値のキーを持つ要素 `e` を持っている場合、`e.second` に [`forward`](/reference/utility/forward.md)`(obj)` を代入する。そうでなければ、[`move`](/reference/utility/move.md)`(k)`, [`forward`](/reference/utility/forward.md)`(obj)` から構築した `value_type` 型のオブジェクトを挿入する。 +- (1)、(3) : `unordered_map` が `k` と同値のキーを持つ要素 `e` を持っている場合、`e.second` に [`forward`](/reference/utility/forward.md)`(obj)` を代入する。そうでなければ、`k`, [`forward`](/reference/utility/forward.md)`(obj)` から構築した `value_type` 型のオブジェクトを挿入する。 +- (2)、(4) : `unordered_map` が `k` と同値のキーを持つ要素 `e` を持っている場合、`e.second` に [`forward`](/reference/utility/forward.md)`(obj)` を代入する。そうでなければ、[`move`](/reference/utility/move.md)`(k)`, [`forward`](/reference/utility/forward.md)`(obj)` から構築した `value_type` 型のオブジェクトを挿入する。 ## 戻り値 diff --git a/reference/unordered_map/unordered_map/try_emplace.md b/reference/unordered_map/unordered_map/try_emplace.md index b4308056a3..45e7c5254d 100644 --- a/reference/unordered_map/unordered_map/try_emplace.md +++ b/reference/unordered_map/unordered_map/try_emplace.md @@ -40,8 +40,6 @@ iterator try_emplace(const_iterator hint, key_type&& k, Args&&... args); ## 戻り値 -挿入されたかどうかを示す `bool` と、挿入された要素へのイテレータからなる `pair` を返す。挿入されなかったときは、既存要素へのイテレータを返す。 - - (1)、(2) : イテレータと `bool` 値の [`pair`](/reference/utility/pair.md) を返す。 - 挿入された場合には、`first` に挿入された要素へのイテレータ、`second` に `true` が設定される。 - 挿入されなかった場合には、`first` に `k` と等価のキーを持つ既存の要素へのイテレータ、`second` に `false` が設定される。 From ea628fa7aba80cecce9af40d6ef9da8dbae9e0d6 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sun, 7 Apr 2024 19:32:10 +0900 Subject: [PATCH 0863/3948] Update enumerate_view.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 要素の型を追加 --- reference/ranges/enumerate_view.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/ranges/enumerate_view.md b/reference/ranges/enumerate_view.md index 9f9682c541..86e2d90031 100644 --- a/reference/ranges/enumerate_view.md +++ b/reference/ranges/enumerate_view.md @@ -21,7 +21,7 @@ namespace std::ranges { `enumerate_view`はインデックスを付ける[`view`](view.md)。 -`enumerate_view`の要素は、インデックスと元のRangeの要素からなる[`tuple`](/reference/tuple/tuple.md)である。 +`enumerate_view`の要素は、インデックスと元のRangeの要素からなる[`tuple`](/reference/tuple/tuple.md) ([`tuple`](/reference/tuple/tuple.md)`<`[`range_difference_t`](range_difference_t.md)`, `[`range_value_t`](range_value_t.md)`>`)である。 - (1): `enumerate_view`のクラス定義 - (2): `enumerate_view`を生成するRangeアダプタオブジェクト From 02654819aabef357f7e08a1a38297e049613767c Mon Sep 17 00:00:00 2001 From: Shunsuke Shimizu Date: Sun, 7 Apr 2024 21:44:40 +0900 Subject: [PATCH 0864/3948] Add links to basic_istream/read.md --- reference/istream/basic_istream/read.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/reference/istream/basic_istream/read.md b/reference/istream/basic_istream/read.md index 829f0e1536..ffd997e0e8 100644 --- a/reference/istream/basic_istream/read.md +++ b/reference/istream/basic_istream/read.md @@ -15,14 +15,14 @@ basic_istream& read(char_type* s, streamsize n); 実引数として配列要素へのポインタ`s`とその要素数`n`を受け取る。 [`get`](get.md)メンバ関数などと異なり、`s`の末尾にヌル文字を書き込む処理がない。 -また、`n`文字より少ない段階でEOFに達した場合を入力失敗として扱う(`failbit`を立てる)点も、他の多くのメンバ関数と異なる。 +また、`n`文字より少ない段階でEOFに達した場合を入力失敗として扱う([`failbit`](../../ios/ios_base/type-iostate.md)を立てる)点も、他の多くのメンバ関数と異なる。 ## 効果 -1. `sentry`オブジェクトを構築する。`sentry`オブジェクトが失敗を示した場合、何もしない。 -1. `good()`メンバ関数を呼び出して`false`であったら、`setstate(failbit)`を呼び出して終了する。 +1. [`sentry`](sentry.md)オブジェクトを構築する。[`sentry`](sentry.md)オブジェクトが失敗を示した場合、何もしない。 +1. [`good`](../../ios/basic_ios/good.md)`()`メンバ関数を呼び出して`false`であったら、[`setstate`](../../ios/basic_ios/setstate.md)`(`[`failbit`](../../ios/ios_base/type-iostate.md)`)`を呼び出して終了する。 1. 以下のいずれかを満たすまで、文字を入力して書き込む。 - 実引数で指定された`n`文字まで入力した。 - - EOFに達した。この場合、`setstate(failbit | eofbit)`を呼び出す。 + - EOFに達した。この場合、[`setstate`](../../ios/basic_ios/setstate.md)`(`[`failbit`](../../ios/ios_base/type-iostate.md)` | `[`eofbit`](../../ios/ios_base/type-iostate.md)`)`を呼び出す。 ## 戻り値 `*this` @@ -84,6 +84,12 @@ basic_istream& read(char_type* s, streamsize n) { return *this; } ``` +* iostate[link ../../ios/ios_base/type-iostate.md] +* failbit[link ../../ios/ios_base/type-iostate.md] +* eofbit[link ../../ios/ios_base/type-iostate.md] +* sentry[link sentry.md] +* good[link ../../ios/basic_ios/good.md] +* setstate[link ../../ios/basic_ios/setstate.md] ## バージョン ### 言語 From 329b44ce48b582b4ca9c35fdb311eaa446be0017 Mon Sep 17 00:00:00 2001 From: Yuki Nishidate Date: Thu, 11 Apr 2024 08:11:45 +0900 Subject: [PATCH 0865/3948] =?UTF-8?q?nextafter=E3=81=AE=E8=AA=AC=E6=98=8E?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cmath/nextafter.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cmath/nextafter.md b/reference/cmath/nextafter.md index abecec6491..f7c91349f7 100644 --- a/reference/cmath/nextafter.md +++ b/reference/cmath/nextafter.md @@ -61,7 +61,7 @@ namespace std { ## 戻り値 -パラメータ`x`の値をパラメータ`x`の方向に、表現可能な最小の値だけ進めた値を返す。 +パラメータ`x`の値をパラメータ`y`の方向に、表現可能な最小の値だけ進めた値を返す。 `x`と`y`が等値である場合、`y`を返す。 From ee8e4dcb4e6cbedc3d0bfa3f3903137349bcc2fd Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Mon, 15 Apr 2024 14:46:20 +0900 Subject: [PATCH 0866/3948] =?UTF-8?q?parent=5Fpath()=20:=20=E3=83=91?= =?UTF-8?q?=E3=82=B9=E5=90=8D=E6=9C=AB=E5=B0=BE/=E3=81=AE=E6=8C=99?= =?UTF-8?q?=E5=8B=95=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6=E8=BF=BD=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 多分windowsも同じだと思うけど試してません --- reference/filesystem/path/parent_path.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reference/filesystem/path/parent_path.md b/reference/filesystem/path/parent_path.md index 70f6441532..54dbd7913c 100644 --- a/reference/filesystem/path/parent_path.md +++ b/reference/filesystem/path/parent_path.md @@ -32,6 +32,7 @@ int main() fs::path ps[] = { "/foo/bar.txt", // ファイル名を含むパス "/foo/bar/", // ディレクトリパス + "/foo/bar", // ディレクトリパス(末尾/なし) "/" // ルートパスのみ (ルートパスの親はルートパスなのでそのまま返る) }; @@ -46,6 +47,7 @@ int main() ``` "/foo/bar.txt" : "/foo" "/foo/bar/" : "/foo/bar" +"/foo/bar" : "/foo" "/" : "/" ``` From 8ed33cbe79c326dec1ea1e0aa6ef48fdd6d8c29a Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Mon, 15 Apr 2024 23:54:27 +0900 Subject: [PATCH 0867/3948] fix: typo in an example code --- lang/cpp23/relaxing_some_constexpr_restrictions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp23/relaxing_some_constexpr_restrictions.md b/lang/cpp23/relaxing_some_constexpr_restrictions.md index 254dec4eba..6f909e8d0b 100644 --- a/lang/cpp23/relaxing_some_constexpr_restrictions.md +++ b/lang/cpp23/relaxing_some_constexpr_restrictions.md @@ -64,7 +64,7 @@ constexpr #endif void f(std::optional& opt) { - o.reset(); + opt.reset(); } ``` From d9744ca36b456eba18cfe64c461085b490716361 Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Mon, 15 Apr 2024 23:57:01 +0900 Subject: [PATCH 0868/3948] refactor: simplify explanation of P2448R2 relaxing-some-constexpr-restrictions --- lang/cpp23/relaxing_some_constexpr_restrictions.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lang/cpp23/relaxing_some_constexpr_restrictions.md b/lang/cpp23/relaxing_some_constexpr_restrictions.md index 6f909e8d0b..205a7e237e 100644 --- a/lang/cpp23/relaxing_some_constexpr_restrictions.md +++ b/lang/cpp23/relaxing_some_constexpr_restrictions.md @@ -25,7 +25,7 @@ constexpr int g(int x) { return f(x); } // error! fはいかなるxについて しかし、多くの標準ライブラリが`constexpr`対応を進めていくようになり、状況が変化した。 例えば、`std::optional`の`reset`メンバメソッドが`constexpr`に対応するのはC++23以降である。 -これは`std::optional`の内部実装が`union`のアクティブメンバを更新しているからであり、[これを定数式内で実行するにはC++20を待たねばならなかった](/lang/cpp20/changing_the_active_member_of_a_union_inside_constexpr.md)。 +これは`std::optional`の内部実装が`union`のアクティブメンバを更新しているからであり、これを定数式内で実行するにはC++20を待たねばならなかった(参考:[定数式内での共用体のアクティブメンバの変更を許可](/lang/cpp20/changing_the_active_member_of_a_union_inside_constexpr.md))。 よって、以下のコードはC++17では不適格だが、C++23では正しいコードとなる。 @@ -37,7 +37,7 @@ constexpr void f(std::optional& opt) } ``` -これを正しく記述するには、`constexpr`指定をするかどうかをマクロで変更しなければならない。 +多くのバージョンで使われることが想定されるライブラリにおいてこれを最大限活用できるよう記述するには、`constexpr`指定するかどうかをマクロで変更しなければならない。 例えばC++23から`constexpr`になる関数群に対して以下のようなマクロを使うか、 ```cpp @@ -77,9 +77,9 @@ void f(std::optional& opt) このような状況では上記のような解決策を用いてもミスを避けることは容易ではない。 現在、登場時点では定数式内で実行できなかったために`constexpr`されていなかった多くの標準ライブラリ関数が、のちにコア言語機能が追加されて`constexpr`指定されている。 -現時点で`constexpr`されていない関数は次のバージョンで`constexpr`になるかもしれず、よって現在使用されているバージョンである関数が`constexpr`ではないということを指摘することの意味は薄れている。 +そのため、現時点で`constexpr`ではない関数も次のバージョンで`constexpr`になるかもしれず、よって関数が`constexpr`指定されているだけでエラーにする意義は薄れてきた。 -以上を鑑みて、`constexpr`関数が定数式実行可能かどうかを判断するのは、実際に定数式内で実行されてからにした方がよいという結論に至った。 +以上から、コンパイル時に実行できない`constexpr`をエラーとするのは、実際にコンパイル時に呼びだされてからでよい、ということになった。 実際に定数式内で実行できない関数が定数式内で呼び出された場合、これは従来通りエラーとするほかない。 しかし、定数式内で呼び出されていないのならば、定数式内で実行できない関数が存在していてもプログラムを不適格とはしない。 From 1e87ee558aa529cf5c771a119ef36892cfb870b4 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Wed, 17 Apr 2024 15:57:04 +0900 Subject: [PATCH 0869/3948] =?UTF-8?q?fix(cmath):=20=E7=89=B9=E6=AE=8A?= =?UTF-8?q?=E9=96=A2=E6=95=B0=E5=90=8D=E3=81=AB=E3=81=8A=E3=81=84=E3=81=A6?= =?UTF-8?q?=E3=80=8C=E7=AC=AC=E4=B8=80=E7=A8=AE=20=E2=86=92=20=E7=AC=AC1?= =?UTF-8?q?=E7=A8=AE=E3=80=8D=E3=81=AE=E3=82=88=E3=81=86=E3=81=AB=E8=A1=A8?= =?UTF-8?q?=E8=A8=98=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cmath.md | 24 ++++++++++++------------ reference/cmath/comp_ellint_1.md | 10 +++++----- reference/cmath/comp_ellint_2.md | 8 ++++---- reference/cmath/comp_ellint_3.md | 10 +++++----- reference/cmath/cyl_bessel_i.md | 10 +++++----- reference/cmath/cyl_bessel_j.md | 12 ++++++------ reference/cmath/cyl_bessel_k.md | 16 ++++++++-------- reference/cmath/cyl_neumann.md | 12 ++++++------ reference/cmath/ellint_1.md | 8 ++++---- reference/cmath/ellint_2.md | 8 ++++---- reference/cmath/ellint_3.md | 10 +++++----- reference/cmath/sph_bessel.md | 8 ++++---- reference/cmath/sph_neumann.md | 8 ++++---- 13 files changed, 72 insertions(+), 72 deletions(-) diff --git a/reference/cmath.md b/reference/cmath.md index 1834c1ebf5..7f1575d21d 100644 --- a/reference/cmath.md +++ b/reference/cmath.md @@ -307,24 +307,24 @@ NaN を返さなければならないが定義域エラーを報告してはな | [`assoc_laguerre`](cmath/assoc_laguerre.md) | ラゲール陪多項式 | C++17 | | [`assoc_legendre`](cmath/assoc_legendre.md) | ルジャンドル陪関数 | C++17 | | [`beta`](cmath/beta.md) | ベータ関数 | C++17 | -| [`comp_ellint_1`](cmath/comp_ellint_1.md) | 第一種完全楕円積分 | C++17 | -| [`comp_ellint_2`](cmath/comp_ellint_2.md) | 第二種完全楕円積分 | C++17 | -| [`comp_ellint_3`](cmath/comp_ellint_3.md) | 第三種完全楕円積分 | C++17 | -| [`cyl_bessel_i`](cmath/cyl_bessel_i.md) | 第一種変形ベッセル関数 | C++17 | -| [`cyl_bessel_j`](cmath/cyl_bessel_j.md) | 第一種ベッセル関数 | C++17 | -| [`cyl_bessel_k`](cmath/cyl_bessel_k.md) | 第二種変形ベッセル関数 | C++17 | -| [`cyl_neumann`](cmath/cyl_neumann.md) | 第二種ベッセル関数 | C++17 | -| [`ellint_1`](cmath/ellint_1.md) | 第一種不完全楕円積分 | C++17 | -| [`ellint_2`](cmath/ellint_2.md) | 第二種不完全楕円積分 | C++17 | -| [`ellint_3`](cmath/ellint_3.md) | 第三種不完全楕円積分 | C++17 | +| [`comp_ellint_1`](cmath/comp_ellint_1.md) | 第1種完全楕円積分 | C++17 | +| [`comp_ellint_2`](cmath/comp_ellint_2.md) | 第2種完全楕円積分 | C++17 | +| [`comp_ellint_3`](cmath/comp_ellint_3.md) | 第3種完全楕円積分 | C++17 | +| [`cyl_bessel_i`](cmath/cyl_bessel_i.md) | 第1種変形ベッセル関数 | C++17 | +| [`cyl_bessel_j`](cmath/cyl_bessel_j.md) | 第1種ベッセル関数 | C++17 | +| [`cyl_bessel_k`](cmath/cyl_bessel_k.md) | 第2種変形ベッセル関数 | C++17 | +| [`cyl_neumann`](cmath/cyl_neumann.md) | 第2種ベッセル関数 | C++17 | +| [`ellint_1`](cmath/ellint_1.md) | 第1種不完全楕円積分 | C++17 | +| [`ellint_2`](cmath/ellint_2.md) | 第2種不完全楕円積分 | C++17 | +| [`ellint_3`](cmath/ellint_3.md) | 第3種不完全楕円積分 | C++17 | | [`expint`](cmath/expint.md) | 指数積分 | C++17 | | [`hermite`](cmath/hermite.md) | エルミート多項式 | C++17 | | [`laguerre`](cmath/laguerre.md) | ラゲール多項式 | C++17 | | [`legendre`](cmath/legendre.md) | ルジャンドル多項式 | C++17 | | [`riemann_zeta`](cmath/riemann_zeta.md) | リーマンのゼータ関数 | C++17 | -| [`sph_bessel`](cmath/sph_bessel.md) | 第一種球ベッセル関数 | C++17 | +| [`sph_bessel`](cmath/sph_bessel.md) | 第1種球ベッセル関数 | C++17 | | [`sph_legendre`](cmath/sph_legendre.md) | 球面調和関数の *θ* 成分 | C++17 | -| [`sph_neumann`](cmath/sph_neumann.md) | 第二種球ベッセル関数 | C++17 | +| [`sph_neumann`](cmath/sph_neumann.md) | 第2種球ベッセル関数 | C++17 | ## 最近傍整数 diff --git a/reference/cmath/comp_ellint_1.md b/reference/cmath/comp_ellint_1.md index c26d5595cd..ad96b96315 100644 --- a/reference/cmath/comp_ellint_1.md +++ b/reference/cmath/comp_ellint_1.md @@ -27,7 +27,7 @@ namespace std { ## 概要 -第一種完全楕円積分 (complete elliptic integral of the first kind) を計算する。 +第1種完全楕円積分 (complete elliptic integral of the first kind) を計算する。 - (1) : - C++17 : `double`に対するオーバーロード @@ -38,13 +38,13 @@ namespace std { ## 戻り値 -引数 `k` の第一種完全楕円積分 +引数 `k` の第1種完全楕円積分 $$ K(k) = F(k, \pi/2) = \int_0^{\pi/2} \frac{\mathrm d\theta}{\sqrt{1 - k^2 \sin^2 \theta}} \quad \text{for } |k| \le 1 $$ を返す。 -$ F(k, \phi) $ は第一種不完全楕円積分 ([`ellint_1`](ellint_1.md))。 +$ F(k, \phi) $ は第1種不完全楕円積分 ([`ellint_1`](ellint_1.md))。 ## 備考 @@ -73,7 +73,7 @@ comp_ellint_1(1) = nan ## 単振り子の周期と等時性の破れ -単振り子の周期$ T $は、第一種完全楕円積分$ K $を用いて、$ T = 4 \sqrt{\frac{l}{g}} K(\sin(\frac{\theta}{2})) $と書ける($ l $は長さ、$ g $は重力加速度)。$ l = 1 [m]$の時の周期 $ T [s]$と、近似値$ T_0 = 2\pi\sqrt{\frac{l}{g}}$との比$T/T_0$を計算する例。 +単振り子の周期$ T $は、第1種完全楕円積分$ K $を用いて、$ T = 4 \sqrt{\frac{l}{g}} K(\sin(\frac{\theta}{2})) $と書ける($ l $は長さ、$ g $は重力加速度)。$ l = 1 [m]$の時の周期 $ T [s]$と、近似値$ T_0 = 2\pi\sqrt{\frac{l}{g}}$との比$T/T_0$を計算する例。 ```cpp example #include @@ -136,7 +136,7 @@ $$ ## 関連項目 -- 第一種不完全楕円積分 [`ellint_1`](ellint_1.md) +- 第1種不完全楕円積分 [`ellint_1`](ellint_1.md) ## 参照 diff --git a/reference/cmath/comp_ellint_2.md b/reference/cmath/comp_ellint_2.md index 8768d2306c..d2d7123d3f 100644 --- a/reference/cmath/comp_ellint_2.md +++ b/reference/cmath/comp_ellint_2.md @@ -26,7 +26,7 @@ namespace std { * Arithmetic[italic] ## 概要 -第二種完全楕円積分 (complete elliptic integral of the second kind) を計算する。 +第2種完全楕円積分 (complete elliptic integral of the second kind) を計算する。 - (1) : - C++17 : `double`に対するオーバーロード @@ -37,13 +37,13 @@ namespace std { ## 戻り値 -引数 `k` の第二種完全楕円積分 +引数 `k` の第2種完全楕円積分 $$ E(k) = E(k, \pi/2) = \int_0^{\pi/2} \mathrm d\theta ~ \sqrt{1 - k^2 \sin^2 \theta} \quad \text{for } |k| \le 1 $$ を返す。 -$ E(k, \phi) $ は第二種不完全楕円積分 ([`ellint_2`](ellint_2.md))。 +$ E(k, \phi) $ は第2種不完全楕円積分 ([`ellint_2`](ellint_2.md))。 ## 備考 @@ -90,7 +90,7 @@ $$ ## 関連項目 -- 第二種不完全楕円積分 [`ellint_2`](ellint_2.md) +- 第2種不完全楕円積分 [`ellint_2`](ellint_2.md) ## 参照 diff --git a/reference/cmath/comp_ellint_3.md b/reference/cmath/comp_ellint_3.md index 3a234e5037..8bc30bcc8d 100644 --- a/reference/cmath/comp_ellint_3.md +++ b/reference/cmath/comp_ellint_3.md @@ -32,7 +32,7 @@ namespace std { * Arithmetic2[italic] ## 概要 -第三種完全楕円積分 (complete elliptic integral of the third kind) を計算する。 +第3種完全楕円積分 (complete elliptic integral of the third kind) を計算する。 - (1) : - C++17 : `double`に対するオーバーロード @@ -43,7 +43,7 @@ namespace std { ## 戻り値 -引数 `k`, `nu` の第三種完全楕円積分 +引数 `k`, `nu` の第3種完全楕円積分 $$ \Pi(\nu, k) = \Pi(\nu, k, \pi/2) = \int_0^{\pi/2} \frac{\mathrm d\theta}{(1 - \nu \sin^2 \theta) \sqrt{1 - k^2 \sin^2 \theta}} @@ -51,11 +51,11 @@ $$ $$ を返す。 -$ \Pi(\nu, k) $ は第三種不完全楕円積分 ([`ellint_3`](ellint_3.md))。 +$ \Pi(\nu, k) $ は第3種不完全楕円積分 ([`ellint_3`](ellint_3.md))。 ## 備考 -- $\Pi(0, k) = K(k)$ (第一種完全楕円積分 [`comp_ellint_1`](comp_ellint_1.md)) +- $\Pi(0, k) = K(k)$ (第1種完全楕円積分 [`comp_ellint_1`](comp_ellint_1.md)) - (1) : C++23では、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された @@ -120,7 +120,7 @@ GCC 7.1.0–8.0.0 では ## 関連項目 -* 第三種不完全楕円積分 [`ellint_3`](ellint_3.md) +* 第3種不完全楕円積分 [`ellint_3`](ellint_3.md) ## 参照 diff --git a/reference/cmath/cyl_bessel_i.md b/reference/cmath/cyl_bessel_i.md index b6a9ecfadf..f74ca282cd 100644 --- a/reference/cmath/cyl_bessel_i.md +++ b/reference/cmath/cyl_bessel_i.md @@ -32,7 +32,7 @@ namespace std { * Arithmetic2[italic] ## 概要 -第一種変形ベッセル関数 (modified Bessel functions of the first kind) を求める。 +第1種変形ベッセル関数 (modified Bessel functions of the first kind) を求める。 - (1) : - C++17 : `double`に対するオーバーロード @@ -43,13 +43,13 @@ namespace std { ## 戻り値 -引数 `nu`, `x` の第一種変形ベッセル関数 +引数 `nu`, `x` の第1種変形ベッセル関数 $$ I_\nu(x) = i^{-\nu} J_\nu(ix) = \sum_{k=0}^\infty \frac{1}{k! \Gamma(\nu + k + 1)} \left( \frac{x}{2} \right)^{\nu + 2k} \quad \text{for } x \ge 0 $$ を返す。 -$J$ は第一種ベッセル関数 ([`cyl_bessel_j`](cyl_bessel_j.md)) である。 +$J$ は第1種ベッセル関数 ([`cyl_bessel_j`](cyl_bessel_j.md)) である。 ## 備考 @@ -110,8 +110,8 @@ GCC 7.1.0–8.0.0 では `nu < 0` のときに [`std::domain_error`](/reference/ ## 関連項目 -- 第一種ベッセル関数 [`cyl_bessel_j`](cyl_bessel_j.md) -- 第二種変形ベッセル関数 [`cyl_bessel_k`](cyl_bessel_k.md) +- 第1種ベッセル関数 [`cyl_bessel_j`](cyl_bessel_j.md) +- 第2種変形ベッセル関数 [`cyl_bessel_k`](cyl_bessel_k.md) ## 参照 diff --git a/reference/cmath/cyl_bessel_j.md b/reference/cmath/cyl_bessel_j.md index 0958d751ed..d4935036e4 100644 --- a/reference/cmath/cyl_bessel_j.md +++ b/reference/cmath/cyl_bessel_j.md @@ -32,7 +32,7 @@ namespace std { * Arithmetic2[italic] ## 概要 -第一種ベッセル関数 (Bessel functions of the first kind) を求める。 +第1種ベッセル関数 (Bessel functions of the first kind) を求める。 - (1) : - C++17 : `double`に対するオーバーロード @@ -43,7 +43,7 @@ namespace std { ## 戻り値 -引数 `nu`, `x` の第一種ベッセル関数 +引数 `nu`, `x` の第1種ベッセル関数 $$ J_\nu(x) = \sum_{k=0}^\infty \frac{(-1)^k}{k! \Gamma(\nu + k + 1)} \left( \frac{x}{2} \right)^{\nu + 2k} \quad \text{for } x \ge 0 @@ -111,10 +111,10 @@ GCC 7.1.0–8.0.0 では `nu < 0` のときに [`std::domain_error`](/reference/ ## 関連項目 -- 第一種変形ベッセル関数 [`cyl_bessel_i`](cyl_bessel_i.md) -- 第二種変形ベッセル関数 [`cyl_bessel_k`](cyl_bessel_k.md) -- 第二種ベッセル関数 [`cyl_neumann`](cyl_neumann.md) -- 第一種球ベッセル関数 [`sph_bessel`](sph_bessel.md) +- 第1種変形ベッセル関数 [`cyl_bessel_i`](cyl_bessel_i.md) +- 第2種変形ベッセル関数 [`cyl_bessel_k`](cyl_bessel_k.md) +- 第2種ベッセル関数 [`cyl_neumann`](cyl_neumann.md) +- 第1種球ベッセル関数 [`sph_bessel`](sph_bessel.md) ## 参照 diff --git a/reference/cmath/cyl_bessel_k.md b/reference/cmath/cyl_bessel_k.md index 8bdb4b930b..b6f9f4c55b 100644 --- a/reference/cmath/cyl_bessel_k.md +++ b/reference/cmath/cyl_bessel_k.md @@ -32,7 +32,7 @@ namespace std { * Arithmetic2[italic] ## 概要 -第二種変形ベッセル関数 (modified Bessel functions of the second kind) を求める。 +第2種変形ベッセル関数 (modified Bessel functions of the second kind) を求める。 - (1) : - C++17 : `double`に対するオーバーロード @@ -43,7 +43,7 @@ namespace std { ## 戻り値 -引数 `nu`, `x` の第二種変形ベッセル関数 +引数 `nu`, `x` の第2種変形ベッセル関数 $$ K_\nu(x) = \frac{\pi}{2} i^{\nu + 1} \left( J_\nu(ix) + i N_\nu(ix) \right) = \frac{\pi}{2} \frac{I_{-\nu}(x) - I_{\nu}(x)}{\sin \nu \pi} @@ -51,9 +51,9 @@ K_\nu(x) = \frac{\pi}{2} i^{\nu + 1} \left( J_\nu(ix) + i N_\nu(ix) \right) $$ を返す。 $I$, $J$, $N$ はそれぞれ -第一種変形ベッセル関数 ([`cyl_bessel_i`](cyl_bessel_i.md))、 -第一種ベッセル関数 ([`cyl_bessel_j`](cyl_bessel_j.md))、 -第二種ベッセル関数 ([`cyl_neumann`](cyl_neumann.md)) +第1種変形ベッセル関数 ([`cyl_bessel_i`](cyl_bessel_i.md))、 +第1種ベッセル関数 ([`cyl_bessel_j`](cyl_bessel_j.md))、 +第2種ベッセル関数 ([`cyl_neumann`](cyl_neumann.md)) である。 @@ -115,9 +115,9 @@ GCC 7.1.0–8.0.0 では `nu < 0` のときに [`std::domain_error`](/reference/ ## 関連項目 -- 第一種変形ベッセル関数 [`cyl_bessel_i`](cyl_bessel_i.md) -- 第一種ベッセル関数 [`cyl_bessel_j`](cyl_bessel_j.md) -- 第二種ベッセル関数 [`cyl_neumann`](cyl_neumann.md) +- 第1種変形ベッセル関数 [`cyl_bessel_i`](cyl_bessel_i.md) +- 第1種ベッセル関数 [`cyl_bessel_j`](cyl_bessel_j.md) +- 第2種ベッセル関数 [`cyl_neumann`](cyl_neumann.md) ## 参照 diff --git a/reference/cmath/cyl_neumann.md b/reference/cmath/cyl_neumann.md index 548ce68813..ae52c163bd 100644 --- a/reference/cmath/cyl_neumann.md +++ b/reference/cmath/cyl_neumann.md @@ -32,7 +32,7 @@ namespace std { * Arithmetic2[italic] ## 概要 -第二種ベッセル関数 (Bessel functions of the second kind)、ノイマン関数 (Neumann functions) を求める。 +第2種ベッセル関数 (Bessel functions of the second kind)、ノイマン関数 (Neumann functions) を求める。 - (1) : - C++17 : `double`に対するオーバーロード @@ -43,13 +43,13 @@ namespace std { ## 戻り値 -引数 `x` の第二種ベッセル関数 +引数 `x` の第2種ベッセル関数 $$ N_\nu(x) = \frac{J_{\nu}(x) \cos \nu \pi - J_{-\nu}(x)}{\sin \nu \pi} \quad \text{for } x \ge 0 $$ を返す。 -$J$ は第一種ベッセル関数 ([`cyl_bessel_j`](cyl_bessel_j.md)) である。 +$J$ は第1種ベッセル関数 ([`cyl_bessel_j`](cyl_bessel_j.md)) である。 ## 備考 @@ -112,9 +112,9 @@ GCC 7.1.0–8.0.0 では `nu < 0` のときに [`std::domain_error`](/reference/ ## 関連項目 -* 第一種ベッセル関数 [`cyl_bessel_j`](cyl_bessel_j.md) -* 第二種変形ベッセル関数 [`cyl_bessel_k`](cyl_bessel_k.md) -* 第二種球ベッセル関数 [`sph_neumann`](sph_neumann.md) +* 第1種ベッセル関数 [`cyl_bessel_j`](cyl_bessel_j.md) +* 第2種変形ベッセル関数 [`cyl_bessel_k`](cyl_bessel_k.md) +* 第2種球ベッセル関数 [`sph_neumann`](sph_neumann.md) ## 参照 diff --git a/reference/cmath/ellint_1.md b/reference/cmath/ellint_1.md index 7c47a2c82c..fdfdd04ae9 100644 --- a/reference/cmath/ellint_1.md +++ b/reference/cmath/ellint_1.md @@ -32,7 +32,7 @@ namespace std { * Arithmetic2[italic] ## 概要 -第一種不完全楕円積分 (incomplete elliptic integral of the first kind) を計算する。 +第1種不完全楕円積分 (incomplete elliptic integral of the first kind) を計算する。 - (1) : - C++17 : `double`に対するオーバーロード @@ -43,7 +43,7 @@ namespace std { ## 戻り値 -引数 `k`, `phi` の第一種不完全楕円積分 +引数 `k`, `phi` の第1種不完全楕円積分 $$ F(k, \phi) = \int_0^\phi \frac{\mathrm d\theta}{\sqrt{1 - k^2 \sin^2 \theta}} \quad \text{for } |k| \le 1 @@ -52,7 +52,7 @@ $$ ## 備考 -- $ F(k, \pi/2) = K(k)$ (第一種完全楕円積分 [`comp_ellint_1`](comp_ellint_1.md)) +- $ F(k, \pi/2) = K(k)$ (第1種完全楕円積分 [`comp_ellint_1`](comp_ellint_1.md)) - (1) : C++23では、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された @@ -111,7 +111,7 @@ GCC 7.1.0–8.0.0 では `|k| == 1 && |phi| >= π / 2` の場合 `nan` を返す ## 関連項目 -- 第一種完全楕円積分 [`comp_ellint_1`](comp_ellint_1.md) +- 第1種完全楕円積分 [`comp_ellint_1`](comp_ellint_1.md) ## 参照 diff --git a/reference/cmath/ellint_2.md b/reference/cmath/ellint_2.md index 041b8c6b0d..3bd696eaa7 100644 --- a/reference/cmath/ellint_2.md +++ b/reference/cmath/ellint_2.md @@ -32,7 +32,7 @@ namespace std { * Arithmetic2[italic] ## 概要 -第二種不完全楕円積分 (incomplete elliptic integral of the second kind) を計算する。 +第2種不完全楕円積分 (incomplete elliptic integral of the second kind) を計算する。 - (1) : - C++17 : `double`に対するオーバーロード @@ -43,7 +43,7 @@ namespace std { ## 戻り値 -引数 `k`, `phi` の第二種不完全楕円積分 +引数 `k`, `phi` の第2種不完全楕円積分 $$ E(k, \phi) = \int_0^\phi \mathrm d\theta ~ \sqrt{1 - k^2 \sin^2 \theta} \quad \text{for } |k| \le 1 @@ -52,7 +52,7 @@ $$ ## 備考 -- $ E(k, \pi/2) = E(k) $ (第二種完全楕円積分 [`comp_ellint_2`](comp_ellint_2.md)) +- $ E(k, \pi/2) = E(k) $ (第2種完全楕円積分 [`comp_ellint_2`](comp_ellint_2.md)) - (1) : C++23では、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された @@ -106,7 +106,7 @@ ellint_2(1, 0.5 pi) = 1 ## 関連項目 -- 第二種完全楕円積分 [`comp_ellint_2`](comp_ellint_2.md) +- 第2種完全楕円積分 [`comp_ellint_2`](comp_ellint_2.md) ## 参照 diff --git a/reference/cmath/ellint_3.md b/reference/cmath/ellint_3.md index b48b69b775..ab65fba4cf 100644 --- a/reference/cmath/ellint_3.md +++ b/reference/cmath/ellint_3.md @@ -32,7 +32,7 @@ namespace std { * Arithmetic2[italic] ## 概要 -第三種不完全楕円積分 (incomplete elliptic integral of the third kind) を計算する。 +第3種不完全楕円積分 (incomplete elliptic integral of the third kind) を計算する。 - (1) : - C++17 : `double`に対するオーバーロード @@ -43,7 +43,7 @@ namespace std { ## 戻り値 -引数 `k`, `nu`, `phi` の第三種不完全楕円積分 +引数 `k`, `nu`, `phi` の第3種不完全楕円積分 $$ \Pi(\nu, k, \phi) = \int_0^\phi \frac{\mathrm d\theta}{(1 - \nu \sin^2 \theta) \sqrt{1 - k^2 \sin^2 \theta}} @@ -53,8 +53,8 @@ $$ ## 備考 -- $ \Pi(\nu, k, \pi/2) = \Pi(\nu, k) $ (第三種完全楕円積分 [`comp_ellint_3`](comp_ellint_3.md)) -- $ \Pi(0, k, \phi) = F(k, \phi) $ (第一種不完全楕円積分 [`ellint_1`](ellint_1.md)) +- $ \Pi(\nu, k, \pi/2) = \Pi(\nu, k) $ (第3種完全楕円積分 [`comp_ellint_3`](comp_ellint_3.md)) +- $ \Pi(0, k, \phi) = F(k, \phi) $ (第1種不完全楕円積分 [`ellint_1`](ellint_1.md)) - (1) : C++23では、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された @@ -134,7 +134,7 @@ GCC 7.1.0–8.0.0 では `1 - nu * sin^2(phi) < 0` のときに [`std::domain_er ## 関連項目 -- 第三種完全楕円積分 [`comp_ellint_3`](comp_ellint_3.md) +- 第3種完全楕円積分 [`comp_ellint_3`](comp_ellint_3.md) ## 参照 diff --git a/reference/cmath/sph_bessel.md b/reference/cmath/sph_bessel.md index ec9ba8c175..ef75c43ebb 100644 --- a/reference/cmath/sph_bessel.md +++ b/reference/cmath/sph_bessel.md @@ -31,7 +31,7 @@ namespace std { * Arithmetic[italic] ## 概要 -第一種球ベッセル関数 (spherical Bessel functions of the first kind) を求める。 +第1種球ベッセル関数 (spherical Bessel functions of the first kind) を求める。 - (1) : - C++17 : `double`に対するオーバーロード @@ -42,13 +42,13 @@ namespace std { ## 戻り値 -引数 `n`, `x` の第一種球ベッセル関数 +引数 `n`, `x` の第1種球ベッセル関数 $$ j_n(x) = \sqrt{\frac{\pi}{2x}} J_{n + 1/2}(x) \quad \text{for } x \ge 0 $$ を返す。 -$J$ は第一種ベッセル関数 ([`cyl_bessel_j`](cyl_bessel_j.md))。 +$J$ は第1種ベッセル関数 ([`cyl_bessel_j`](cyl_bessel_j.md))。 ## 備考 @@ -114,7 +114,7 @@ $$ ## 関連項目 -- 第一種ベッセル関数 [`cyl_bessel_j`](cyl_bessel_j.md) +- 第1種ベッセル関数 [`cyl_bessel_j`](cyl_bessel_j.md) ## 参照 diff --git a/reference/cmath/sph_neumann.md b/reference/cmath/sph_neumann.md index 9eb76458a3..22adb6eac1 100644 --- a/reference/cmath/sph_neumann.md +++ b/reference/cmath/sph_neumann.md @@ -31,7 +31,7 @@ namespace std { * Arithmetic[italic] ## 概要 -第二種球ベッセル関数 (spherical Bessel functions of the second kind)、球ノイマン関数 (spherical Neumann functions) を求める。 +第2種球ベッセル関数 (spherical Bessel functions of the second kind)、球ノイマン関数 (spherical Neumann functions) を求める。 - (1) : - C++17 : `double`に対するオーバーロード @@ -42,13 +42,13 @@ namespace std { ## 戻り値 -引数 `n`, `x` の第二種球ベッセル関数 +引数 `n`, `x` の第2種球ベッセル関数 $$ n_n(x) = \sqrt{\frac{\pi}{2x}} N_{n + 1/2}(x) \quad \text{for } x \ge 0 $$ を返す。 -$N$ は第二種ベッセル関数 ([`cyl_neumann`](cyl_neumann.md))。 +$N$ は第2種ベッセル関数 ([`cyl_neumann`](cyl_neumann.md))。 ## 備考 @@ -114,7 +114,7 @@ $$ ## 関連項目 -- 第二種ベッセル関数 [`cyl_neumann`](cyl_neumann.md) +- 第2種ベッセル関数 [`cyl_neumann`](cyl_neumann.md) ## 参照 From 2f454c118d3a5db38c9f579ebd22e2d122320eca Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Wed, 17 Apr 2024 16:19:29 +0900 Subject: [PATCH 0870/3948] =?UTF-8?q?style(cmath):=20Markdown=20=E8=A1=A8?= =?UTF-8?q?=E7=B5=84=E3=81=BF=E3=81=AE=E6=A8=AA=E5=B9=85=E6=8F=83=E3=81=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cmath.md | 280 ++++++++++++++++++++++----------------------- 1 file changed, 140 insertions(+), 140 deletions(-) diff --git a/reference/cmath.md b/reference/cmath.md index 7f1575d21d..879e256fa2 100644 --- a/reference/cmath.md +++ b/reference/cmath.md @@ -216,74 +216,74 @@ C++03 までの場合、[`errno`](cerrno/errno.md) でしか通知されない ## 三角関数 -| 名前 | 説明 | 対応バージョン | -|-----------------------------|----------------------------------------------|-------| -| [`sin`](cmath/sin.md) | 正弦関数(サイン) | | -| [`cos`](cmath/cos.md) | 余弦関数(コサイン) | | -| [`tan`](cmath/tan.md) | 正接関数(タンジェント) | | -| [`asin`](cmath/asin.md) | 逆正弦関数(アークサイン) | | -| [`acos`](cmath/acos.md) | 逆余弦関数(アークコサイン) | | -| [`atan`](cmath/atan.md) | 逆正接関数(アークタンジェント) | | -| [`atan2`](cmath/atan2.md) | 対辺と隣辺からの逆正接関数(アークタンジェント) | | +| 名前 | 説明 | 対応バージョン | +|---------------------------|--------------------------------------------------|----------------| +| [`sin`](cmath/sin.md) | 正弦関数(サイン) | | +| [`cos`](cmath/cos.md) | 余弦関数(コサイン) | | +| [`tan`](cmath/tan.md) | 正接関数(タンジェント) | | +| [`asin`](cmath/asin.md) | 逆正弦関数(アークサイン) | | +| [`acos`](cmath/acos.md) | 逆余弦関数(アークコサイン) | | +| [`atan`](cmath/atan.md) | 逆正接関数(アークタンジェント) | | +| [`atan2`](cmath/atan2.md) | 対辺と隣辺からの逆正接関数(アークタンジェント) | | ## 双曲線関数 -| 名前 | 説明 | 対応バージョン | -|-----------------------------|----------------------------------------------|-------| -| [`sinh`](cmath/sinh.md) | 双曲線正弦関数(ハイパボリックサイン) | | -| [`cosh`](cmath/cosh.md) | 双曲線余弦関数(ハイパボリックコサイン) | | -| [`tanh`](cmath/tanh.md) | 双曲線正接関数(ハイパボリックタンジェント) | | -| [`asinh`](cmath/asinh.md) | 逆双曲線正弦関数(エリアハイパボリックサイン) | C++11 | -| [`acosh`](cmath/acosh.md) | 逆双曲線余弦関数(エリアハイパボリックコサイン) | C++11 | -| [`atanh`](cmath/atanh.md) | 逆双曲線正接関数(エリアハイパボリックタンジェント) | C++11 | +| 名前 | 説明 | 対応バージョン | +|---------------------------|------------------------------------------------------|----------------| +| [`sinh`](cmath/sinh.md) | 双曲線正弦関数(ハイパボリックサイン) | | +| [`cosh`](cmath/cosh.md) | 双曲線余弦関数(ハイパボリックコサイン) | | +| [`tanh`](cmath/tanh.md) | 双曲線正接関数(ハイパボリックタンジェント) | | +| [`asinh`](cmath/asinh.md) | 逆双曲線正弦関数(エリアハイパボリックサイン) | C++11 | +| [`acosh`](cmath/acosh.md) | 逆双曲線余弦関数(エリアハイパボリックコサイン) | C++11 | +| [`atanh`](cmath/atanh.md) | 逆双曲線正接関数(エリアハイパボリックタンジェント) | C++11 | ## 指数関数と対数関数 -| 名前 | 説明 | 対応バージョン | -|-----------------------------|-----------------------------------|-------| -| [`exp`](cmath/exp.md) | e (ネイピア数) を底とする指数関数 | | -| [`exp2`](cmath/exp2.md) | 2 を底とする指数関数 | C++11 | -| [`expm1`](cmath/expm1.md) | e (ネイピア数) を底とする指数関数から 1 を引いた値 | C++11 | -| [`log`](cmath/log.md) | e (ネイピア数) を底とする自然対数 | | -| [`log10`](cmath/log10.md) | 10 を底とする常用対数 | | -| [`log1p`](cmath/log1p.md) | 引数に 1 を足した値の、e (ネイピア数) を底とする自然対数 | C++11 | -| [`log2`](cmath/log2.md) | 2 を底とする二進対数 | C++11 | +| 名前 | 説明 | 対応バージョン | +|---------------------------|----------------------------------------------------------|----------------| +| [`exp`](cmath/exp.md) | e (ネイピア数) を底とする指数関数 | | +| [`exp2`](cmath/exp2.md) | 2 を底とする指数関数 | C++11 | +| [`expm1`](cmath/expm1.md) | e (ネイピア数) を底とする指数関数から 1 を引いた値 | C++11 | +| [`log`](cmath/log.md) | e (ネイピア数) を底とする自然対数 | | +| [`log10`](cmath/log10.md) | 10 を底とする常用対数 | | +| [`log1p`](cmath/log1p.md) | 引数に 1 を足した値の、e (ネイピア数) を底とする自然対数 | C++11 | +| [`log2`](cmath/log2.md) | 2 を底とする二進対数 | C++11 | ## 仮数と指数 -| 名前 | 説明 | 対応バージョン | -|-----------|----------------------------------|-------| -| [`ldexp`](cmath/ldexp.md) | 2 の累乗との乗算 | | -| [`frexp`](cmath/frexp.md) | 仮数部と 2 の累乗への分解 | | -| [`ilogb`](cmath/ilogb.md) | 指数部を符号付き整数値として抽出 | C++11 | -| [`logb`](cmath/logb.md) | 指数部を浮動小数点数値として抽出 | C++11 | -| [`modf`](cmath/modf.md) | 整数部と小数部への分解 | | -| [`scalbn`](cmath/scalbn.md) | 内部表現の基数 (`FLT_RADIX`) の累乗との乗算 | C++11 | -| [`scalbln`](cmath/scalbln.md) | 内部表現の基数 (`FLT_RADIX`) の累乗との乗算。乗数として`long`をとる | C++11 | +| 名前 | 説明 | 対応バージョン | +|-------------------------------|---------------------------------------------------------------------|----------------| +| [`ldexp`](cmath/ldexp.md) | 2 の累乗との乗算 | | +| [`frexp`](cmath/frexp.md) | 仮数部と 2 の累乗への分解 | | +| [`ilogb`](cmath/ilogb.md) | 指数部を符号付き整数値として抽出 | C++11 | +| [`logb`](cmath/logb.md) | 指数部を浮動小数点数値として抽出 | C++11 | +| [`modf`](cmath/modf.md) | 整数部と小数部への分解 | | +| [`scalbn`](cmath/scalbn.md) | 内部表現の基数 (`FLT_RADIX`) の累乗との乗算 | C++11 | +| [`scalbln`](cmath/scalbln.md) | 内部表現の基数 (`FLT_RADIX`) の累乗との乗算。乗数として`long`をとる | C++11 | ## 累乗・冪根と絶対値 -| 名前 | 説明 | 対応バージョン | -|-----------------------------|----------------|-------| -| [`pow`](cmath/pow.md) | 累乗 | | -| [`sqrt`](cmath/sqrt.md) | 平方根 | | -| [`cbrt`](cmath/cbrt.md) | 立方根 | C++11 | -| [`hypot`](cmath/hypot.md) | 平方和の平方根 | C++11 | -| [`abs`](cmath/abs.md) | 絶対値 | | -| [`fabs`](cmath/fabs.md) | 絶対値 | | +| 名前 | 説明 | 対応バージョン | +|---------------------------|----------------|----------------| +| [`pow`](cmath/pow.md) | 累乗 | | +| [`sqrt`](cmath/sqrt.md) | 平方根 | | +| [`cbrt`](cmath/cbrt.md) | 立方根 | C++11 | +| [`hypot`](cmath/hypot.md) | 平方和の平方根 | C++11 | +| [`abs`](cmath/abs.md) | 絶対値 | | +| [`fabs`](cmath/fabs.md) | 絶対値 | | ## 誤差関数とガンマ関数 -| 名前 | 説明 | 対応バージョン | -|----------|----------------------|-------| -| [`erf`](cmath/erf.md) | 誤差関数 | C++11 | -| [`erfc`](cmath/erfc.md) | 相補誤差関数 | C++11 | -| [`tgamma`](cmath/tgamma.md) | ガンマ関数 | C++11 | -| [`lgamma`](cmath/lgamma.md) | ガンマ関数の自然対数 | C++11 | +| 名前 | 説明 | 対応バージョン | +|-----------------------------|----------------------|----------------| +| [`erf`](cmath/erf.md) | 誤差関数 | C++11 | +| [`erfc`](cmath/erfc.md) | 相補誤差関数 | C++11 | +| [`tgamma`](cmath/tgamma.md) | ガンマ関数 | C++11 | +| [`lgamma`](cmath/lgamma.md) | ガンマ関数の自然対数 | C++11 | ## その他特殊関数 @@ -302,29 +302,29 @@ NaN を返さなければならないが定義域エラーを報告してはな 特記のない限り、以下の関数は全ての有限値と正負の無限大において定義される。 -| 名前 | 説明 | 対応バージョン | -|------|------|----------------| -| [`assoc_laguerre`](cmath/assoc_laguerre.md) | ラゲール陪多項式 | C++17 | -| [`assoc_legendre`](cmath/assoc_legendre.md) | ルジャンドル陪関数 | C++17 | -| [`beta`](cmath/beta.md) | ベータ関数 | C++17 | -| [`comp_ellint_1`](cmath/comp_ellint_1.md) | 第1種完全楕円積分 | C++17 | -| [`comp_ellint_2`](cmath/comp_ellint_2.md) | 第2種完全楕円積分 | C++17 | -| [`comp_ellint_3`](cmath/comp_ellint_3.md) | 第3種完全楕円積分 | C++17 | -| [`cyl_bessel_i`](cmath/cyl_bessel_i.md) | 第1種変形ベッセル関数 | C++17 | -| [`cyl_bessel_j`](cmath/cyl_bessel_j.md) | 第1種ベッセル関数 | C++17 | -| [`cyl_bessel_k`](cmath/cyl_bessel_k.md) | 第2種変形ベッセル関数 | C++17 | -| [`cyl_neumann`](cmath/cyl_neumann.md) | 第2種ベッセル関数 | C++17 | -| [`ellint_1`](cmath/ellint_1.md) | 第1種不完全楕円積分 | C++17 | -| [`ellint_2`](cmath/ellint_2.md) | 第2種不完全楕円積分 | C++17 | -| [`ellint_3`](cmath/ellint_3.md) | 第3種不完全楕円積分 | C++17 | -| [`expint`](cmath/expint.md) | 指数積分 | C++17 | -| [`hermite`](cmath/hermite.md) | エルミート多項式 | C++17 | -| [`laguerre`](cmath/laguerre.md) | ラゲール多項式 | C++17 | -| [`legendre`](cmath/legendre.md) | ルジャンドル多項式 | C++17 | -| [`riemann_zeta`](cmath/riemann_zeta.md) | リーマンのゼータ関数 | C++17 | -| [`sph_bessel`](cmath/sph_bessel.md) | 第1種球ベッセル関数 | C++17 | -| [`sph_legendre`](cmath/sph_legendre.md) | 球面調和関数の *θ* 成分 | C++17 | -| [`sph_neumann`](cmath/sph_neumann.md) | 第2種球ベッセル関数 | C++17 | +| 名前 | 説明 | 対応バージョン | +|---------------------------------------------|--------------------------|----------------| +| [`assoc_laguerre`](cmath/assoc_laguerre.md) | ラゲール陪多項式 | C++17 | +| [`assoc_legendre`](cmath/assoc_legendre.md) | ルジャンドル陪関数 | C++17 | +| [`beta`](cmath/beta.md) | ベータ関数 | C++17 | +| [`comp_ellint_1`](cmath/comp_ellint_1.md) | 第1種完全楕円積分 | C++17 | +| [`comp_ellint_2`](cmath/comp_ellint_2.md) | 第2種完全楕円積分 | C++17 | +| [`comp_ellint_3`](cmath/comp_ellint_3.md) | 第3種完全楕円積分 | C++17 | +| [`cyl_bessel_i`](cmath/cyl_bessel_i.md) | 第1種変形ベッセル関数 | C++17 | +| [`cyl_bessel_j`](cmath/cyl_bessel_j.md) | 第1種ベッセル関数 | C++17 | +| [`cyl_bessel_k`](cmath/cyl_bessel_k.md) | 第2種変形ベッセル関数 | C++17 | +| [`cyl_neumann`](cmath/cyl_neumann.md) | 第2種ベッセル関数 | C++17 | +| [`ellint_1`](cmath/ellint_1.md) | 第1種不完全楕円積分 | C++17 | +| [`ellint_2`](cmath/ellint_2.md) | 第2種不完全楕円積分 | C++17 | +| [`ellint_3`](cmath/ellint_3.md) | 第3種不完全楕円積分 | C++17 | +| [`expint`](cmath/expint.md) | 指数積分 | C++17 | +| [`hermite`](cmath/hermite.md) | エルミート多項式 | C++17 | +| [`laguerre`](cmath/laguerre.md) | ラゲール多項式 | C++17 | +| [`legendre`](cmath/legendre.md) | ルジャンドル多項式 | C++17 | +| [`riemann_zeta`](cmath/riemann_zeta.md) | リーマンのゼータ関数 | C++17 | +| [`sph_bessel`](cmath/sph_bessel.md) | 第1種球ベッセル関数 | C++17 | +| [`sph_legendre`](cmath/sph_legendre.md) | 球面調和関数の *θ* 成分 | C++17 | +| [`sph_neumann`](cmath/sph_neumann.md) | 第2種球ベッセル関数 | C++17 | ## 最近傍整数 @@ -344,114 +344,114 @@ NaN を返さなければならないが定義域エラーを報告してはな ## 剰余 -| 名前 | 説明 | 対応バージョン | -|-------------|--------------------------|-------| -| [`fmod`](cmath/fmod.md) | 浮動小数点剰余 | | -| [`remainder`](cmath/remainder.md) | 符号付きの浮動小数点剰余 | C++11 | -| [`remquo`](cmath/remquo.md) | 商と浮動小数点剰余 | C++11 | +| 名前 | 説明 | 対応バージョン | +|-----------------------------------|--------------------------|----------------| +| [`fmod`](cmath/fmod.md) | 浮動小数点剰余 | | +| [`remainder`](cmath/remainder.md) | 符号付きの浮動小数点剰余 | C++11 | +| [`remquo`](cmath/remquo.md) | 商と浮動小数点剰余 | C++11 | ## 浮動小数点操作 -| 名前 | 説明 | 対応バージョン | -|--------------|-------------------------------|-------| -| [`copysign`](cmath/copysign.md) | 符号のコピー | C++11 | -| [`nan`](cmath/nanf.md) | 文字列から quiet NaN への変換 | C++11 | -| [`nanf`](cmath/nanf.md) | 文字列から quiet NaN への変換 | C++11 | -| [`nanl`](cmath/nanf.md) | 文字列から quiet NaN への変換 | C++11 | -| [`nextafter`](cmath/nextafter.md) | 指定方向への次の表現可能な値 | C++11 | -| [`nexttoward`](cmath/nexttoward.md) | 指定方向への次の表現可能な値 | C++11 | +| 名前 | 説明 | 対応バージョン | +|-------------------------------------|-------------------------------|----------------| +| [`copysign`](cmath/copysign.md) | 符号のコピー | C++11 | +| [`nan`](cmath/nanf.md) | 文字列から quiet NaN への変換 | C++11 | +| [`nanf`](cmath/nanf.md) | 文字列から quiet NaN への変換 | C++11 | +| [`nanl`](cmath/nanf.md) | 文字列から quiet NaN への変換 | C++11 | +| [`nextafter`](cmath/nextafter.md) | 指定方向への次の表現可能な値 | C++11 | +| [`nexttoward`](cmath/nexttoward.md) | 指定方向への次の表現可能な値 | C++11 | ## 最大値・最小値と正の差 -| 名前 | 説明 | 対応バージョン | -|--------|--------|-------| -| [`fmax`](cmath/fmax.md) | 最大値 | C++11 | -| [`fmin`](cmath/fmin.md) | 最小値 | C++11 | -| [`fdim`](cmath/fdim.md) | 正の差 | C++11 | +| 名前 | 説明 | 対応バージョン | +|-------------------------|--------|----------------| +| [`fmax`](cmath/fmax.md) | 最大値 | C++11 | +| [`fmin`](cmath/fmin.md) | 最小値 | C++11 | +| [`fdim`](cmath/fdim.md) | 正の差 | C++11 | ## 乗算-加算 -| 名前 | 説明 | 対応バージョン | -|-------------------------|------------------|-------| -| [`fma`](cmath/fma.md) | 乗算と加算の合成 | C++11 | +| 名前 | 説明 | 対応バージョン | +|-----------------------|------------------|----------------| +| [`fma`](cmath/fma.md) | 乗算と加算の合成 | C++11 | ## 線形補完 -| 名前 | 説明 | 対応バージョン | -|------|------|----------------| -| [`lerp`](cmath/lerp.md) | 線形補間 | C++20 | +| 名前 | 説明 | 対応バージョン | +|-------------------------|----------|----------------| +| [`lerp`](cmath/lerp.md) | 線形補間 | C++20 | ## 数値分類 -| 名前 | 説明 | 対応バージョン | -|--------------|------------------|-------| -| [`fpclassify`](cmath/fpclassify.md) | 数値を NaN、無限大、正規化数、非正規化数、0 または他の処理系定義のカテゴリに分類 | C++11 | -| [`isfinite`](cmath/isfinite.md) | 数値が有限であるか判定 | C++11 | -| [`isinf`](cmath/isinf.md) | 数値が無限大であるか判定 | C++11 | -| [`isnan`](cmath/isnan.md) | 数値が NaN であるか判定 | C++11 | -| [`isnormal`](cmath/isnormal.md) | 数値が正規化数であるか判定 | C++11 | -| [`signbit`](cmath/signbit.md) | 数値の符号が負であるか判定 | C++11 | +| 名前 | 説明 | 対応バージョン | +|-------------------------------------|----------------------------------------------------------------------------------|----------------| +| [`fpclassify`](cmath/fpclassify.md) | 数値を NaN、無限大、正規化数、非正規化数、0 または他の処理系定義のカテゴリに分類 | C++11 | +| [`isfinite`](cmath/isfinite.md) | 数値が有限であるか判定 | C++11 | +| [`isinf`](cmath/isinf.md) | 数値が無限大であるか判定 | C++11 | +| [`isnan`](cmath/isnan.md) | 数値が NaN であるか判定 | C++11 | +| [`isnormal`](cmath/isnormal.md) | 数値が正規化数であるか判定 | C++11 | +| [`signbit`](cmath/signbit.md) | 数値の符号が負であるか判定 | C++11 | ## 数値比較 -| 名前 | 説明 | 対応バージョン | -|------------------|--------------------------------------------------------|----------------| -| [`isgreater`](cmath/isgreater.md) | 第 1 引数が第 2 引数より大きいか判定 | C++11 | -| [`isgreaterequal`](cmath/isgreaterequal.md) | 第 1 引数が第 2 引数以上か判定 | C++11 | -| [`isless`](cmath/isless.md) | 第 1 引数が第 2 引数より小さいか判定 | C++11 | -| [`islessequal`](cmath/islessequal.md) | 第 1 引数が第 2 引数以下か判定 | C++11 | -| [`islessgreater`](cmath/islessgreater.md) | 第 1 引数が第 2 引数より小さいか、あるいは大きいか判定 | C++11 | -| [`isunordered`](cmath/isunordered.md) | 第 1 引数と第 2 引数が順序付けられていないか判定 | C++11 | +| 名前 | 説明 | 対応バージョン | +|---------------------------------------------|--------------------------------------------------------|----------------| +| [`isgreater`](cmath/isgreater.md) | 第 1 引数が第 2 引数より大きいか判定 | C++11 | +| [`isgreaterequal`](cmath/isgreaterequal.md) | 第 1 引数が第 2 引数以上か判定 | C++11 | +| [`isless`](cmath/isless.md) | 第 1 引数が第 2 引数より小さいか判定 | C++11 | +| [`islessequal`](cmath/islessequal.md) | 第 1 引数が第 2 引数以下か判定 | C++11 | +| [`islessgreater`](cmath/islessgreater.md) | 第 1 引数が第 2 引数より小さいか、あるいは大きいか判定 | C++11 | +| [`isunordered`](cmath/isunordered.md) | 第 1 引数と第 2 引数が順序付けられていないか判定 | C++11 | ## 型 -| 名前 | 説明 | 対応バージョン | -|-----------------------------------|-------------------------------|-------| -| [`float_t`](cmath/float_t.md) | `float` 以上の浮動小数点数型 | C++11 | -| [`double_t`](cmath/double_t.md) | `double` 以上の浮動小数点数型 | C++11 | +| 名前 | 説明 | 対応バージョン | +|---------------------------------|-------------------------------|----------------| +| [`float_t`](cmath/float_t.md) | `float` 以上の浮動小数点数型 | C++11 | +| [`double_t`](cmath/double_t.md) | `double` 以上の浮動小数点数型 | C++11 | ## 数値のマクロ -| 名前 | 説明 | 対応バージョン | -|-------------------------------------|------------------------------|-------| -| [`HUGE_VAL`](cmath/huge_val.md) | `double` 型の正の巨大値 | | -| [`HUGE_VALF`](cmath/huge_valf.md) | `float` 型の正の巨大値 | C++11 | -| [`HUGE_VALL`](cmath/huge_vall.md) | `long double` 型の正の巨大値 | C++11 | -| [`INFINITY`](cmath/infinity.md) | `float` 型の正の無限大 | C++11 | -| [`NAN`](cmath/nan.md) | `float` 型の `quiet NaN` | C++11 | +| 名前 | 説明 | 対応バージョン | +|-----------------------------------|------------------------------|----------------| +| [`HUGE_VAL`](cmath/huge_val.md) | `double` 型の正の巨大値 | | +| [`HUGE_VALF`](cmath/huge_valf.md) | `float` 型の正の巨大値 | C++11 | +| [`HUGE_VALL`](cmath/huge_vall.md) | `long double` 型の正の巨大値 | C++11 | +| [`INFINITY`](cmath/infinity.md) | `float` 型の正の無限大 | C++11 | +| [`NAN`](cmath/nan.md) | `float` 型の `quiet NaN` | C++11 | ## 数値分類のマクロ -| 名前 | 説明 | 対応バージョン | -|-------------------------------------------|---------------------------------------------|-------| -| [`FP_INFINITE`](cmath/fp_infinite.md) | 数値分類で無限大を表す整数定数式 | C++11 | -| [`FP_NAN`](cmath/fp_nan.md) | 数値分類で `NaN` を表す整数定数式 | C++11 | -| [`FP_NORMAL`](cmath/fp_normal.md) | 数値分類で正規化数を表す整数定数式 | C++11 | -| [`FP_SUBNORMAL`](cmath/fp_subnormal.md) | 数値分類で非正規化数を表す整数定数式 | C++11 | -| [`FP_ZERO`](cmath/fp_zero.md) | 数値分類で浮動小数点数の 0 を表す整数定数式 | C++11 | +| 名前 | 説明 | 対応バージョン | +|-----------------------------------------|---------------------------------------------|----------------| +| [`FP_INFINITE`](cmath/fp_infinite.md) | 数値分類で無限大を表す整数定数式 | C++11 | +| [`FP_NAN`](cmath/fp_nan.md) | 数値分類で `NaN` を表す整数定数式 | C++11 | +| [`FP_NORMAL`](cmath/fp_normal.md) | 数値分類で正規化数を表す整数定数式 | C++11 | +| [`FP_SUBNORMAL`](cmath/fp_subnormal.md) | 数値分類で非正規化数を表す整数定数式 | C++11 | +| [`FP_ZERO`](cmath/fp_zero.md) | 数値分類で浮動小数点数の 0 を表す整数定数式 | C++11 | ## その他のマクロ -| 名前 | 説明 | 対応バージョン | -|-------------------------------------------|---------------------------------------------|-------| -| [`FP_FAST_FMA`](cmath/fp_fast_fma.md) | `double` 型の `fma` 関数がより高速な実装であるか | C++11 | -| [`FP_FAST_FMAF`](cmath/fp_fast_fmaf.md) | `float` 型の `fma` 関数がより高速な実装であるか | C++11 | -| [`FP_FAST_FMAL`](cmath/fp_fast_fmal.md) | `long double` 型の `fma` 関数がより高速な実装であるか | C++11 | -| [`FP_ILOGB0`](cmath/fp_ilogb0.md) | `ilogb(0)` の戻り値を表す整数定数式 | C++11 | -| [`FP_ILOGBNAN`](cmath/fp_ilogbnan.md) | `ilogb(NaN)` の戻り値を表す整数定数式 | C++11 | -| [`MATH_ERRNO`](cmath/math_errno.md) | 数学ライブラリ内で`errno`にエラーが設定されたかを表す整数定数 | C++11 | -| [`MATH_ERREXCEPT`](cmath/math_errexcept.md) | 数学ライブラリ内で浮動小数点例外が発生したかを表す整数定数 | C++11 | -| [`math_errhandling`](cmath/math_errhandling.md) | `` 内の関数がエラーをどのように取り扱うかを表すマクロ | C++11 | +| 名前 | 説明 | 対応バージョン | +|-------------------------------------------------|---------------------------------------------------------------|----------------| +| [`FP_FAST_FMA`](cmath/fp_fast_fma.md) | `double` 型の `fma` 関数がより高速な実装であるか | C++11 | +| [`FP_FAST_FMAF`](cmath/fp_fast_fmaf.md) | `float` 型の `fma` 関数がより高速な実装であるか | C++11 | +| [`FP_FAST_FMAL`](cmath/fp_fast_fmal.md) | `long double` 型の `fma` 関数がより高速な実装であるか | C++11 | +| [`FP_ILOGB0`](cmath/fp_ilogb0.md) | `ilogb(0)` の戻り値を表す整数定数式 | C++11 | +| [`FP_ILOGBNAN`](cmath/fp_ilogbnan.md) | `ilogb(NaN)` の戻り値を表す整数定数式 | C++11 | +| [`MATH_ERRNO`](cmath/math_errno.md) | 数学ライブラリ内で`errno`にエラーが設定されたかを表す整数定数 | C++11 | +| [`MATH_ERREXCEPT`](cmath/math_errexcept.md) | 数学ライブラリ内で浮動小数点例外が発生したかを表す整数定数 | C++11 | +| [`math_errhandling`](cmath/math_errhandling.md) | `` 内の関数がエラーをどのように取り扱うかを表すマクロ | C++11 | ## 関連項目 From b4d914dcb056471e2d489660985825742f20d441 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Wed, 17 Apr 2024 16:14:53 +0900 Subject: [PATCH 0871/3948] =?UTF-8?q?fix(cmath):=20=E7=AC=ACn=E7=A8=AE?= =?UTF-8?q?=E7=89=B9=E6=AE=8A=E9=96=A2=E6=95=B0=E9=96=93=E3=82=92=E7=9B=B8?= =?UTF-8?q?=E4=BA=92=E3=83=AA=E3=83=B3=E3=82=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cmath/comp_ellint_1.md | 2 ++ reference/cmath/comp_ellint_2.md | 2 ++ reference/cmath/comp_ellint_3.md | 4 +++- reference/cmath/cyl_bessel_i.md | 2 +- reference/cmath/cyl_bessel_j.md | 2 +- reference/cmath/ellint_1.md | 2 ++ reference/cmath/ellint_2.md | 2 ++ reference/cmath/ellint_3.md | 2 ++ reference/cmath/sph_bessel.md | 1 + reference/cmath/sph_neumann.md | 1 + 10 files changed, 17 insertions(+), 3 deletions(-) diff --git a/reference/cmath/comp_ellint_1.md b/reference/cmath/comp_ellint_1.md index ad96b96315..6ea7c4d0a2 100644 --- a/reference/cmath/comp_ellint_1.md +++ b/reference/cmath/comp_ellint_1.md @@ -136,6 +136,8 @@ $$ ## 関連項目 +- 第2種完全楕円積分 [`comp_ellint_2`](comp_ellint_2.md) +- 第3種完全楕円積分 [`comp_ellint_3`](comp_ellint_3.md) - 第1種不完全楕円積分 [`ellint_1`](ellint_1.md) diff --git a/reference/cmath/comp_ellint_2.md b/reference/cmath/comp_ellint_2.md index d2d7123d3f..50c85c08c8 100644 --- a/reference/cmath/comp_ellint_2.md +++ b/reference/cmath/comp_ellint_2.md @@ -90,6 +90,8 @@ $$ ## 関連項目 +- 第1種完全楕円積分 [`comp_ellint_1`](comp_ellint_1.md) +- 第3種完全楕円積分 [`comp_ellint_3`](comp_ellint_3.md) - 第2種不完全楕円積分 [`ellint_2`](ellint_2.md) diff --git a/reference/cmath/comp_ellint_3.md b/reference/cmath/comp_ellint_3.md index 8bc30bcc8d..aebaa9c0ed 100644 --- a/reference/cmath/comp_ellint_3.md +++ b/reference/cmath/comp_ellint_3.md @@ -120,7 +120,9 @@ GCC 7.1.0–8.0.0 では ## 関連項目 -* 第3種不完全楕円積分 [`ellint_3`](ellint_3.md) +- 第1種完全楕円積分 [`comp_ellint_1`](comp_ellint_1.md) +- 第2種完全楕円積分 [`comp_ellint_2`](comp_ellint_2.md) +- 第3種不完全楕円積分 [`ellint_3`](ellint_3.md) ## 参照 diff --git a/reference/cmath/cyl_bessel_i.md b/reference/cmath/cyl_bessel_i.md index f74ca282cd..6585358768 100644 --- a/reference/cmath/cyl_bessel_i.md +++ b/reference/cmath/cyl_bessel_i.md @@ -110,8 +110,8 @@ GCC 7.1.0–8.0.0 では `nu < 0` のときに [`std::domain_error`](/reference/ ## 関連項目 -- 第1種ベッセル関数 [`cyl_bessel_j`](cyl_bessel_j.md) - 第2種変形ベッセル関数 [`cyl_bessel_k`](cyl_bessel_k.md) +- 第1種ベッセル関数 [`cyl_bessel_j`](cyl_bessel_j.md) ## 参照 diff --git a/reference/cmath/cyl_bessel_j.md b/reference/cmath/cyl_bessel_j.md index d4935036e4..7d9a796aca 100644 --- a/reference/cmath/cyl_bessel_j.md +++ b/reference/cmath/cyl_bessel_j.md @@ -111,9 +111,9 @@ GCC 7.1.0–8.0.0 では `nu < 0` のときに [`std::domain_error`](/reference/ ## 関連項目 +- 第2種ベッセル関数 [`cyl_neumann`](cyl_neumann.md) - 第1種変形ベッセル関数 [`cyl_bessel_i`](cyl_bessel_i.md) - 第2種変形ベッセル関数 [`cyl_bessel_k`](cyl_bessel_k.md) -- 第2種ベッセル関数 [`cyl_neumann`](cyl_neumann.md) - 第1種球ベッセル関数 [`sph_bessel`](sph_bessel.md) diff --git a/reference/cmath/ellint_1.md b/reference/cmath/ellint_1.md index fdfdd04ae9..24045d4ece 100644 --- a/reference/cmath/ellint_1.md +++ b/reference/cmath/ellint_1.md @@ -111,6 +111,8 @@ GCC 7.1.0–8.0.0 では `|k| == 1 && |phi| >= π / 2` の場合 `nan` を返す ## 関連項目 +- 第2種不完全楕円積分 [`ellint_2`](ellint_2.md) +- 第3種不完全楕円積分 [`ellint_3`](ellint_3.md) - 第1種完全楕円積分 [`comp_ellint_1`](comp_ellint_1.md) diff --git a/reference/cmath/ellint_2.md b/reference/cmath/ellint_2.md index 3bd696eaa7..e128264252 100644 --- a/reference/cmath/ellint_2.md +++ b/reference/cmath/ellint_2.md @@ -106,6 +106,8 @@ ellint_2(1, 0.5 pi) = 1 ## 関連項目 +- 第1種不完全楕円積分 [`ellint_1`](ellint_1.md) +- 第3種不完全楕円積分 [`ellint_3`](ellint_3.md) - 第2種完全楕円積分 [`comp_ellint_2`](comp_ellint_2.md) diff --git a/reference/cmath/ellint_3.md b/reference/cmath/ellint_3.md index ab65fba4cf..569f0d90b0 100644 --- a/reference/cmath/ellint_3.md +++ b/reference/cmath/ellint_3.md @@ -134,6 +134,8 @@ GCC 7.1.0–8.0.0 では `1 - nu * sin^2(phi) < 0` のときに [`std::domain_er ## 関連項目 +- 第1種不完全楕円積分 [`ellint_1`](ellint_1.md) +- 第2種不完全楕円積分 [`ellint_2`](ellint_2.md) - 第3種完全楕円積分 [`comp_ellint_3`](comp_ellint_3.md) diff --git a/reference/cmath/sph_bessel.md b/reference/cmath/sph_bessel.md index ef75c43ebb..e9f7413f16 100644 --- a/reference/cmath/sph_bessel.md +++ b/reference/cmath/sph_bessel.md @@ -114,6 +114,7 @@ $$ ## 関連項目 +- 第2種球ベッセル関数 [`sph_neumann`](sph_neumann.md) - 第1種ベッセル関数 [`cyl_bessel_j`](cyl_bessel_j.md) diff --git a/reference/cmath/sph_neumann.md b/reference/cmath/sph_neumann.md index 22adb6eac1..58ceab4a6b 100644 --- a/reference/cmath/sph_neumann.md +++ b/reference/cmath/sph_neumann.md @@ -114,6 +114,7 @@ $$ ## 関連項目 +- 第1種球ベッセル関数 [`sph_bessel`](sph_bessel.md) - 第2種ベッセル関数 [`cyl_neumann`](cyl_neumann.md) From a8976099ef2f10aa426d054031bccd848c627463 Mon Sep 17 00:00:00 2001 From: komori-n Date: Fri, 19 Apr 2024 10:49:16 +0900 Subject: [PATCH 0872/3948] fix: fix argument order for scoped_lock --- reference/mutex/scoped_lock/op_constructor.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/mutex/scoped_lock/op_constructor.md b/reference/mutex/scoped_lock/op_constructor.md index 565f318182..9ca74c4cbd 100644 --- a/reference/mutex/scoped_lock/op_constructor.md +++ b/reference/mutex/scoped_lock/op_constructor.md @@ -7,7 +7,7 @@ ```cpp explicit scoped_lock(MutexTypes&... m); // (1) -explicit scoped_lock(MutexTypes&... m, adopt_lock_t); // (2) +explicit scoped_lock(adopt_lock_t, MutexTypes&... m); // (2) scoped_lock(const scoped_lock&) = delete; // (3) ``` From 4bfd4910e61e7dab64dbf29a5ba7f112bbe0e617 Mon Sep 17 00:00:00 2001 From: Nagarei Date: Fri, 19 Apr 2024 16:38:03 +0900 Subject: [PATCH 0873/3948] fix typo in algorithm's sample code --- reference/algorithm.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/algorithm.md b/reference/algorithm.md index 58bc01f2a6..24441a342b 100644 --- a/reference/algorithm.md +++ b/reference/algorithm.md @@ -109,7 +109,7 @@ sort(pv.begin(), pv.end(), [](auto&& a, auto&& b){ return a.name < b.name; }); // デフォルトの述語(ranges::less{})で、nameでソート ranges::sort(pv, {}, [](auto&& a){ return a.name; }); // std::invokeで呼び出されるため、メンバ変数ポインタでもよい -ranges::sort(pv, {}, &Parson::name); +ranges::sort(pv, {}, &Person::name); ``` * ranges::sort[link algorithm/ranges_sort.md] * ranges::less[link /reference/functional/ranges_less.md] From fabe7cbeb141cbaa865dd967180a7d8934ecb192 Mon Sep 17 00:00:00 2001 From: Nagarei Date: Fri, 19 Apr 2024 16:43:05 +0900 Subject: [PATCH 0874/3948] fix typo in sample code --- reference/new/op_new.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/new/op_new.md b/reference/new/op_new.md index 89b286a5e7..c098d8be1e 100644 --- a/reference/new/op_new.md +++ b/reference/new/op_new.md @@ -136,7 +136,7 @@ int main() // (5) char 配列のスタック領域に、cl 型変数を動的に作成 // 領域のアライメントに注意 alignas(cl) char one_field[sizeof(cl)] = {}; - int* p3 = new(one_field) cl(); + cl* p3 = new(one_field) cl(); p3->~cl(); // delete は使えないため、デストラクタを直接呼び出す } catch (std::bad_alloc& e) { From eee789586e274dcb2402dfe3c0faea2845bbd843 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sat, 20 Apr 2024 16:37:57 +0900 Subject: [PATCH 0875/3948] add reference of --- reference.md | 2 +- reference/cctype.md | 32 ++++++++++++++++++++++ reference/cctype/isalnum.md | 52 +++++++++++++++++++++++++++++++++++ reference/cctype/isalpha.md | 52 +++++++++++++++++++++++++++++++++++ reference/cctype/isblank.md | 53 ++++++++++++++++++++++++++++++++++++ reference/cctype/iscntrl.md | 52 +++++++++++++++++++++++++++++++++++ reference/cctype/isdigit.md | 52 +++++++++++++++++++++++++++++++++++ reference/cctype/isgraph.md | 52 +++++++++++++++++++++++++++++++++++ reference/cctype/islower.md | 52 +++++++++++++++++++++++++++++++++++ reference/cctype/isprint.md | 52 +++++++++++++++++++++++++++++++++++ reference/cctype/ispunct.md | 52 +++++++++++++++++++++++++++++++++++ reference/cctype/isspace.md | 52 +++++++++++++++++++++++++++++++++++ reference/cctype/isupper.md | 52 +++++++++++++++++++++++++++++++++++ reference/cctype/isxdigit.md | 52 +++++++++++++++++++++++++++++++++++ reference/cctype/tolower.md | 44 ++++++++++++++++++++++++++++++ reference/cctype/toupper.md | 44 ++++++++++++++++++++++++++++++ 16 files changed, 746 insertions(+), 1 deletion(-) create mode 100644 reference/cctype.md create mode 100644 reference/cctype/isalnum.md create mode 100644 reference/cctype/isalpha.md create mode 100644 reference/cctype/isblank.md create mode 100644 reference/cctype/iscntrl.md create mode 100644 reference/cctype/isdigit.md create mode 100644 reference/cctype/isgraph.md create mode 100644 reference/cctype/islower.md create mode 100644 reference/cctype/isprint.md create mode 100644 reference/cctype/ispunct.md create mode 100644 reference/cctype/isspace.md create mode 100644 reference/cctype/isupper.md create mode 100644 reference/cctype/isxdigit.md create mode 100644 reference/cctype/tolower.md create mode 100644 reference/cctype/toupper.md diff --git a/reference.md b/reference.md index 3cf466852d..9c7ad99b61 100644 --- a/reference.md +++ b/reference.md @@ -216,7 +216,7 @@ |--------------------------------------|-------------------------------------|----------------| | [``](/reference/cassert.md) | アサート | | | `` | 複素数 | C++11 (C99)
C++17で非推奨
C++20で削除 | -| `` | 文字種別の判定と変換 | | +| [``](/reference/cctype.md) | 文字種別の判定と変換 | | | [``](/reference/cerrno.md) | エラー番号 | | | [``](/reference/cfenv.md) | 浮動小数点環境へのアクセス | C++11 (C99) | | [``](/reference/cfloat.md) | 浮動小数点数の定数 | | diff --git a/reference/cctype.md b/reference/cctype.md new file mode 100644 index 0000000000..a112407d7b --- /dev/null +++ b/reference/cctype.md @@ -0,0 +1,32 @@ +# cctype +* cctype[meta header] + +``ヘッダでは、文字の種別判定関数と変換関数を定義する。これは、C言語の標準ライブラリ``と同じである。 + +全ての関数で、文字は`int`型で表される。 +また、全ての関数はロケールの影響を受ける。 + +## 判定関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`isalnum`](cctype/isalnum.md) | 文字が英数字であるかを判定する | | +| [`isalpha`](cctype/isalpha.md) | 文字が英文字であるかを判定する | | +| [`isblank`](cctype/isblank.md) | 文字が空白文字であるかを判定する | C++11 | +| [`iscntrl`](cctype/iscntrl.md) | 文字が制御文字であるかを判定する | | +| [`isdigit`](cctype/isdigit.md) | 文字が数字であるかを判定する | | +| [`isgraph`](cctype/isgraph.md) | 文字が図表文字であるかを判定する | | +| [`islower`](cctype/islower.md) | 文字が小文字であるかを判定する | | +| [`isprint`](cctype/isprint.md) | 文字が表示文字であるかを判定する | | +| [`ispunct`](cctype/ispunct.md) | 文字が区切り文字であるかを判定する | | +| [`isspace`](cctype/isspace.md) | 文字が空白文字であるかを判定する | | +| [`isupper`](cctype/isupper.md) | 文字が大文字であるかを判定する | | +| [`isxdigit`](cctype/isxdigit.md) | 文字が16進数字であるかを判定する | | + + +## 変換関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`tolower`](cctype/tolower.md) | 文字を小文字に変換する | | +| [`toupper`](cctype/toupper.md) | 文字を大文字に変換する | | diff --git a/reference/cctype/isalnum.md b/reference/cctype/isalnum.md new file mode 100644 index 0000000000..0528d51a40 --- /dev/null +++ b/reference/cctype/isalnum.md @@ -0,0 +1,52 @@ +# isalnum +* cctype[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +namespace std { + int isalnum(int ch); +} +``` + + +## 概要 +`ch` が英数字かどうかを判定する(判定はロケールの影響を受ける)。 + + +## 戻り値 +`ch` が英数字と判定されれば非ゼロを、そうでなければゼロを返す。 + + +## 例 +```cpp example +#include +#include + +int main() { + std::cout << "isalnum('A') = " << std::isalnum('A') << std::endl + << "isalnum('a') = " << std::isalnum('a') << std::endl + << "isalnum('Z') = " << std::isalnum('Z') << std::endl + << "isalnum('z') = " << std::isalnum('z') << std::endl + << "isalnum('3') = " << std::isalnum('3') << std::endl + << "isalnum('.') = " << std::isalnum('.') << std::endl + << "isalnum(' ') = " << std::isalnum(' ') << std::endl + << "isalnum('\\n') = " << std::isalnum('\n') << std::endl + << "isalnum('0x0f') = " << std::isalnum(15) << std::endl; +} +``` +* std::isalnum[color ff0000] + + +## 出力例 +``` +isalnum('A') = 8 +isalnum('a') = 8 +isalnum('Z') = 8 +isalnum('z') = 8 +isalnum('3') = 8 +isalnum('.') = 0 +isalnum(' ') = 0 +isalnum('\n') = 0 +isalnum('0x0f') = 0 +``` diff --git a/reference/cctype/isalpha.md b/reference/cctype/isalpha.md new file mode 100644 index 0000000000..3fce38668d --- /dev/null +++ b/reference/cctype/isalpha.md @@ -0,0 +1,52 @@ +# isalpha +* cctype[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +namespace std { + int isalpha(int ch); +} +``` + + +## 概要 +`ch` が英文字かどうかを判定する(判定はロケールの影響を受ける)。 + + +## 戻り値 +`ch` が英文字と判定されれば非ゼロを、そうでなければゼロを返す。 + + +## 例 +```cpp example +#include +#include + +int main() { + std::cout << "isalpha('A') = " << std::isalpha('A') << std::endl + << "isalpha('a') = " << std::isalpha('a') << std::endl + << "isalpha('Z') = " << std::isalpha('Z') << std::endl + << "isalpha('z') = " << std::isalpha('z') << std::endl + << "isalpha('3') = " << std::isalpha('3') << std::endl + << "isalpha('.') = " << std::isalpha('.') << std::endl + << "isalpha(' ') = " << std::isalpha(' ') << std::endl + << "isalpha('\\n') = " << std::isalpha('\n') << std::endl + << "isalpha('0x0f') = " << std::isalpha(15) << std::endl; +} +``` +* std::isalpha[color ff0000] + + +## 出力例 +``` +isalpha('A') = 1024 +isalpha('a') = 1024 +isalpha('Z') = 1024 +isalpha('z') = 1024 +isalpha('3') = 0 +isalpha('.') = 0 +isalpha(' ') = 0 +isalpha('\n') = 0 +isalpha('0x0f') = 0 +``` diff --git a/reference/cctype/isblank.md b/reference/cctype/isblank.md new file mode 100644 index 0000000000..39871ad13e --- /dev/null +++ b/reference/cctype/isblank.md @@ -0,0 +1,53 @@ +# isblank +* cctype[meta header] +* std[meta namespace] +* function[meta id-type] +* cpp11[meta cpp] + +```cpp +namespace std { + int isblank(int ch); +} +``` + + +## 概要 +`ch` が空白文字かどうかを判定する(判定はロケールの影響を受ける)。 + + +## 戻り値 +`ch` が空白文字と判定されれば非ゼロを、そうでなければゼロを返す。 + + +## 例 +```cpp example +#include +#include + +int main() { + std::cout << "isblank('A') = " << std::isblank('A') << std::endl + << "isblank('a') = " << std::isblank('a') << std::endl + << "isblank('Z') = " << std::isblank('Z') << std::endl + << "isblank('z') = " << std::isblank('z') << std::endl + << "isblank('3') = " << std::isblank('3') << std::endl + << "isblank('.') = " << std::isblank('.') << std::endl + << "isblank(' ') = " << std::isblank(' ') << std::endl + << "isblank('\\n') = " << std::isblank('\n') << std::endl + << "isblank('0x0f') = " << std::isblank(15) << std::endl; +} +``` +* std::isblank[color ff0000] + + +## 出力例 +``` +isblank('A') = 0 +isblank('a') = 0 +isblank('Z') = 0 +isblank('z') = 0 +isblank('3') = 0 +isblank('.') = 0 +isblank(' ') = 1 +isblank('\n') = 0 +isblank('0x0f') = 0 +``` diff --git a/reference/cctype/iscntrl.md b/reference/cctype/iscntrl.md new file mode 100644 index 0000000000..cf1cd89392 --- /dev/null +++ b/reference/cctype/iscntrl.md @@ -0,0 +1,52 @@ +# iscntrl +* cctype[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +namespace std { + int iscntrl(int ch); +} +``` + + +## 概要 +`ch` が制御文字かどうかを判定する(判定はロケールの影響を受ける)。 + + +## 戻り値 +`ch` が制御文字と判定されれば非ゼロを、そうでなければゼロを返す。 + + +## 例 +```cpp example +#include +#include + +int main() { + std::cout << "iscntrl('A') = " << std::iscntrl('A') << std::endl + << "iscntrl('a') = " << std::iscntrl('a') << std::endl + << "iscntrl('Z') = " << std::iscntrl('Z') << std::endl + << "iscntrl('z') = " << std::iscntrl('z') << std::endl + << "iscntrl('3') = " << std::iscntrl('3') << std::endl + << "iscntrl('.') = " << std::iscntrl('.') << std::endl + << "iscntrl(' ') = " << std::iscntrl(' ') << std::endl + << "iscntrl('\\n') = " << std::iscntrl('\n') << std::endl + << "iscntrl('0x0f') = " << std::iscntrl(15) << std::endl; +} +``` +* std::iscntrl[color ff0000] + + +## 出力例 +``` +iscntrl('A') = 0 +iscntrl('a') = 0 +iscntrl('Z') = 0 +iscntrl('z') = 0 +iscntrl('3') = 0 +iscntrl('.') = 0 +iscntrl(' ') = 0 +iscntrl('\n') = 2 +iscntrl('0x0f') = 2 +``` diff --git a/reference/cctype/isdigit.md b/reference/cctype/isdigit.md new file mode 100644 index 0000000000..995c1724ed --- /dev/null +++ b/reference/cctype/isdigit.md @@ -0,0 +1,52 @@ +# isdigit +* cctype[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +namespace std { + int isdigit(int ch); +} +``` + + +## 概要 +`ch` が数字かどうかを判定する(判定はロケールの影響を受ける)。 + + +## 戻り値 +`ch` が数字と判定されれば非ゼロを、そうでなければゼロを返す。 + + +## 例 +```cpp example +#include +#include + +int main() { + std::cout << "isdigit('A') = " << std::isdigit('A') << std::endl + << "isdigit('a') = " << std::isdigit('a') << std::endl + << "isdigit('Z') = " << std::isdigit('Z') << std::endl + << "isdigit('z') = " << std::isdigit('z') << std::endl + << "isdigit('3') = " << std::isdigit('3') << std::endl + << "isdigit('.') = " << std::isdigit('.') << std::endl + << "isdigit(' ') = " << std::isdigit(' ') << std::endl + << "isdigit('\\n') = " << std::isdigit('\n') << std::endl + << "isdigit('0x0f') = " << std::isdigit(15) << std::endl; +} +``` +* std::isdigit[color ff0000] + + +## 出力例 +``` +isdigit('A') = 0 +isdigit('a') = 0 +isdigit('Z') = 0 +isdigit('z') = 0 +isdigit('3') = 1 +isdigit('.') = 0 +isdigit(' ') = 0 +isdigit('\n') = 0 +isdigit('0x0f') = 0 +``` diff --git a/reference/cctype/isgraph.md b/reference/cctype/isgraph.md new file mode 100644 index 0000000000..a1176c7eb5 --- /dev/null +++ b/reference/cctype/isgraph.md @@ -0,0 +1,52 @@ +# isgraph +* cctype[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +namespace std { + int isgraph(int ch); +} +``` + + +## 概要 +`ch` が図表文字(空白を除く表示文字)かどうかを判定する(判定はロケールの影響を受ける)。 + + +## 戻り値 +`ch` が図表文字と判定されれば非ゼロを、そうでなければゼロを返す。 + + +## 例 +```cpp example +#include +#include + +int main() { + std::cout << "isgraph('A') = " << std::isgraph('A') << std::endl + << "isgraph('a') = " << std::isgraph('a') << std::endl + << "isgraph('Z') = " << std::isgraph('Z') << std::endl + << "isgraph('z') = " << std::isgraph('z') << std::endl + << "isgraph('3') = " << std::isgraph('3') << std::endl + << "isgraph('.') = " << std::isgraph('.') << std::endl + << "isgraph(' ') = " << std::isgraph(' ') << std::endl + << "isgraph('\\n') = " << std::isgraph('\n') << std::endl + << "isgraph('0x0f') = " << std::isgraph(15) << std::endl; +} +``` +* std::isgraph[color ff0000] + + +## 出力例 +``` +isgraph('A') = 32768 +isgraph('a') = 32768 +isgraph('Z') = 32768 +isgraph('z') = 32768 +isgraph('3') = 32768 +isgraph('.') = 32768 +isgraph(' ') = 0 +isgraph('\n') = 0 +isgraph('0x0f') = 0 +``` diff --git a/reference/cctype/islower.md b/reference/cctype/islower.md new file mode 100644 index 0000000000..5632c75d87 --- /dev/null +++ b/reference/cctype/islower.md @@ -0,0 +1,52 @@ +# islower +* cctype[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +namespace std { + int islower(int ch); +} +``` + + +## 概要 +`ch` が小文字かどうかを判定する(判定はロケールの影響を受ける)。 + + +## 戻り値 +`ch` が小文字と判定されれば非ゼロを、そうでなければゼロを返す。 + + +## 例 +```cpp example +#include +#include + +int main() { + std::cout << "islower('A') = " << std::islower('A') << std::endl + << "islower('a') = " << std::islower('a') << std::endl + << "islower('Z') = " << std::islower('Z') << std::endl + << "islower('z') = " << std::islower('z') << std::endl + << "islower('3') = " << std::islower('3') << std::endl + << "islower('.') = " << std::islower('.') << std::endl + << "islower(' ') = " << std::islower(' ') << std::endl + << "islower('\\n') = " << std::islower('\n') << std::endl + << "islower('0x0f') = " << std::islower(15) << std::endl; +} +``` +* std::islower[color ff0000] + + +## 出力例 +``` +islower('A') = 0 +islower('a') = 512 +islower('Z') = 0 +islower('z') = 512 +islower('3') = 0 +islower('.') = 0 +islower(' ') = 0 +islower('\n') = 0 +islower('0x0f') = 0 +``` diff --git a/reference/cctype/isprint.md b/reference/cctype/isprint.md new file mode 100644 index 0000000000..321757b415 --- /dev/null +++ b/reference/cctype/isprint.md @@ -0,0 +1,52 @@ +# isprint +* cctype[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +namespace std { + int isprint(int ch); +} +``` + + +## 概要 +`ch` が表示文字かどうかを判定する(判定はロケールの影響を受ける)。 + + +## 戻り値 +`ch` が表示文字と判定されれば非ゼロを、そうでなければゼロを返す。 + + +## 例 +```cpp example +#include +#include + +int main() { + std::cout << "isprint('A') = " << std::isprint('A') << std::endl + << "isprint('a') = " << std::isprint('a') << std::endl + << "isprint('Z') = " << std::isprint('Z') << std::endl + << "isprint('z') = " << std::isprint('z') << std::endl + << "isprint('3') = " << std::isprint('3') << std::endl + << "isprint('.') = " << std::isprint('.') << std::endl + << "isprint(' ') = " << std::isprint(' ') << std::endl + << "isprint('\\n') = " << std::isprint('\n') << std::endl + << "isprint('0x0f') = " << std::isprint(15) << std::endl; +} +``` +* std::isprint[color ff0000] + + +## 出力例 +``` +isprint('A') = 16384 +isprint('a') = 16384 +isprint('Z') = 16384 +isprint('z') = 16384 +isprint('3') = 16384 +isprint('.') = 16384 +isprint(' ') = 16384 +isprint('\n') = 0 +isprint('0x0f') = 0 +``` diff --git a/reference/cctype/ispunct.md b/reference/cctype/ispunct.md new file mode 100644 index 0000000000..4c44ffc4cb --- /dev/null +++ b/reference/cctype/ispunct.md @@ -0,0 +1,52 @@ +# ispunct +* cctype[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +namespace std { + int ispunct(int ch); +} +``` + + +## 概要 +`ch` が区切り文字かどうかを判定する(判定はロケールの影響を受ける)。 + + +## 戻り値 +`ch` が区切り文字と判定されれば非ゼロを、そうでなければゼロを返す。 + + +## 例 +```cpp example +#include +#include + +int main() { + std::cout << "ispunct('A') = " << std::ispunct('A') << std::endl + << "ispunct('a') = " << std::ispunct('a') << std::endl + << "ispunct('Z') = " << std::ispunct('Z') << std::endl + << "ispunct('z') = " << std::ispunct('z') << std::endl + << "ispunct('3') = " << std::ispunct('3') << std::endl + << "ispunct('.') = " << std::ispunct('.') << std::endl + << "ispunct(' ') = " << std::ispunct(' ') << std::endl + << "ispunct('\\n') = " << std::ispunct('\n') << std::endl + << "ispunct('0x0f') = " << std::ispunct(15) << std::endl; +} +``` +* std::ispunct[color ff0000] + + +## 出力例 +``` +ispunct('A') = 0 +ispunct('a') = 0 +ispunct('Z') = 0 +ispunct('z') = 0 +ispunct('3') = 0 +ispunct('.') = 4 +ispunct(' ') = 0 +ispunct('\n') = 0 +ispunct('0x0f') = 0 +``` diff --git a/reference/cctype/isspace.md b/reference/cctype/isspace.md new file mode 100644 index 0000000000..087dd8fc27 --- /dev/null +++ b/reference/cctype/isspace.md @@ -0,0 +1,52 @@ +# isspace +* cctype[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +namespace std { + int isspace(int ch); +} +``` + + +## 概要 +`ch` が空白文字かどうかを判定する(判定はロケールの影響を受ける)。 + + +## 戻り値 +`ch` が空白文字と判定されれば非ゼロを、そうでなければゼロを返す。 + + +## 例 +```cpp example +#include +#include + +int main() { + std::cout << "isspace('A') = " << std::isspace('A') << std::endl + << "isspace('a') = " << std::isspace('a') << std::endl + << "isspace('Z') = " << std::isspace('Z') << std::endl + << "isspace('z') = " << std::isspace('z') << std::endl + << "isspace('3') = " << std::isspace('3') << std::endl + << "isspace('.') = " << std::isspace('.') << std::endl + << "isspace(' ') = " << std::isspace(' ') << std::endl + << "isspace('\\n') = " << std::isspace('\n') << std::endl + << "isspace('0x0f') = " << std::isspace(15) << std::endl; +} +``` +* std::isspace[color ff0000] + + +## 出力例 +``` +isspace('A') = 0 +isspace('a') = 0 +isspace('Z') = 0 +isspace('z') = 0 +isspace('3') = 0 +isspace('.') = 0 +isspace(' ') = 8192 +isspace('\n') = 8192 +isspace('0x0f') = 0 +``` diff --git a/reference/cctype/isupper.md b/reference/cctype/isupper.md new file mode 100644 index 0000000000..26b29e1f7b --- /dev/null +++ b/reference/cctype/isupper.md @@ -0,0 +1,52 @@ +# isupper +* cctype[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +namespace std { + int isupper(int ch); +} +``` + + +## 概要 +`ch` が大文字かどうかを判定する(判定はロケールの影響を受ける)。 + + +## 戻り値 +`ch` が大文字と判定されれば非ゼロを、そうでなければゼロを返す。 + + +## 例 +```cpp example +#include +#include + +int main() { + std::cout << "isupper('A') = " << std::isupper('A') << std::endl + << "isupper('a') = " << std::isupper('a') << std::endl + << "isupper('Z') = " << std::isupper('Z') << std::endl + << "isupper('z') = " << std::isupper('z') << std::endl + << "isupper('3') = " << std::isupper('3') << std::endl + << "isupper('.') = " << std::isupper('.') << std::endl + << "isupper(' ') = " << std::isupper(' ') << std::endl + << "isupper('\\n') = " << std::isupper('\n') << std::endl + << "isupper('0x0f') = " << std::isupper(15) << std::endl; +} +``` +* std::isupper[color ff0000] + + +## 出力例 +``` +isupper('A') = 256 +isupper('a') = 0 +isupper('Z') = 256 +isupper('z') = 0 +isupper('3') = 0 +isupper('.') = 0 +isupper(' ') = 0 +isupper('\n') = 0 +isupper('0x0f') = 0 +``` diff --git a/reference/cctype/isxdigit.md b/reference/cctype/isxdigit.md new file mode 100644 index 0000000000..979820e379 --- /dev/null +++ b/reference/cctype/isxdigit.md @@ -0,0 +1,52 @@ +# isxdigit +* cctype[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +namespace std { + int isxdigit(int ch); +} +``` + + +## 概要 +`ch` が16進数字かどうかを判定する(判定はロケールの影響を受ける)。 + + +## 戻り値 +`ch` が16進数字と判定されれば非ゼロを、そうでなければゼロを返す。 + + +## 例 +```cpp example +#include +#include + +int main() { + std::cout << "isxdigit('A') = " << std::isxdigit('A') << std::endl + << "isxdigit('a') = " << std::isxdigit('a') << std::endl + << "isxdigit('Z') = " << std::isxdigit('Z') << std::endl + << "isxdigit('z') = " << std::isxdigit('z') << std::endl + << "isxdigit('3') = " << std::isxdigit('3') << std::endl + << "isxdigit('.') = " << std::isxdigit('.') << std::endl + << "isxdigit(' ') = " << std::isxdigit(' ') << std::endl + << "isxdigit('\\n') = " << std::isxdigit('\n') << std::endl + << "isxdigit('0x0f') = " << std::isxdigit(15) << std::endl; +} +``` +* std::isxdigit[color ff0000] + + +## 出力例 +``` +isxdigit('A') = 4096 +isxdigit('a') = 4096 +isxdigit('Z') = 0 +isxdigit('z') = 0 +isxdigit('3') = 4096 +isxdigit('.') = 0 +isxdigit(' ') = 0 +isxdigit('\n') = 0 +isxdigit('0x0f') = 0 +``` diff --git a/reference/cctype/tolower.md b/reference/cctype/tolower.md new file mode 100644 index 0000000000..838d96ba00 --- /dev/null +++ b/reference/cctype/tolower.md @@ -0,0 +1,44 @@ +# tolower +* cctype[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +namespace std { + int tolower(int ch); +} +``` + + +## 概要 +`ch` を小文字に変換する(変換はロケールの影響を受ける)。 + + +## 戻り値 +`ch` に小文字があれば、小文字化した `ch`。小文字がなければ `ch`。 + + +## 例 +```cpp example +#include +#include + +int main() { + std::cout << "tolower('A') = " << static_cast(std::tolower('A')) << std::endl + << "tolower('a') = " << static_cast(std::tolower('a')) << std::endl + << "tolower('1') = " << static_cast(std::tolower('1')) << std::endl + << "tolower('.') = " << static_cast(std::tolower('.')) << std::endl + << "tolower('$') = " << static_cast(std::tolower('$')) << std::endl; +} +``` +* std::tolower[color ff0000] + + +## 出力例 +``` +tolower('A') = a +tolower('a') = a +tolower('1') = 1 +tolower('.') = . +tolower('$') = $ +``` diff --git a/reference/cctype/toupper.md b/reference/cctype/toupper.md new file mode 100644 index 0000000000..b484464591 --- /dev/null +++ b/reference/cctype/toupper.md @@ -0,0 +1,44 @@ +# toupper +* cctype[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +namespace std { + int toupper(int ch); +} +``` + + +## 概要 +`ch` を大文字に変換する(変換はロケールの影響を受ける)。 + + +## 戻り値 +`ch` に大文字があれば、大文字化した `ch`。大文字がなければ `ch`。 + + +## 例 +```cpp example +#include +#include + +int main() { + std::cout << "toupper('A') = " << static_cast(std::toupper('A')) << std::endl + << "toupper('a') = " << static_cast(std::toupper('a')) << std::endl + << "toupper('1') = " << static_cast(std::toupper('1')) << std::endl + << "toupper('.') = " << static_cast(std::toupper('.')) << std::endl + << "toupper('$') = " << static_cast(std::toupper('$')) << std::endl; +} +``` +* std::toupper[color ff0000] + + +## 出力例 +``` +toupper('A') = A +toupper('a') = A +toupper('1') = 1 +toupper('.') = . +toupper('$') = $ +``` From 0a7bbedcfb3cbe0c6fc59102d25a3e71a2447461 Mon Sep 17 00:00:00 2001 From: Nagarei Date: Sat, 27 Apr 2024 16:04:39 +0900 Subject: [PATCH 0876/3948] `std::async` throw `std::system_error` https://timsong-cpp.github.io/cppwp/n3337/futures.async --- reference/future/async.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/future/async.md b/reference/future/async.md index 50f3d223fb..de63ef9027 100644 --- a/reference/future/async.md +++ b/reference/future/async.md @@ -85,9 +85,9 @@ namespace std { 非同期実行される関数オブジェクト`f`の結果値取得のための`future`オブジェクトを返す。 ## 例外 -この関数は、以下のerror conditionを持つ[`future_error`](future_error.md)例外オブジェクトを送出する可能性がある: +この関数は、以下のerror conditionを持つ[`system_error`](/reference/system_error/system_error.md)例外オブジェクトを送出する可能性がある: -- [`resource_unavailable_try_again`](future_errc.md) : [`launch::async`](launch.md)が指定され、新たなスレッドを起動しようとしたができなかった +- [`resource_unavailable_try_again`](/reference/system_error/errc.md) : [`launch::async`](launch.md)が指定され、新たなスレッドを起動しようとしたができなかった ## launch::asyncポリシーを指定した場合の注意点 From 4796c01cbd893195591f4f637f2f966066f550bf Mon Sep 17 00:00:00 2001 From: tshino Date: Sun, 28 Apr 2024 12:31:10 +0900 Subject: [PATCH 0877/3948] =?UTF-8?q?promise=E3=83=87=E3=82=B9=E3=83=88?= =?UTF-8?q?=E3=83=A9=E3=82=AF=E3=82=BF=E3=81=AE=E5=8A=B9=E6=9E=9C=E3=81=AB?= =?UTF-8?q?=E4=BE=8B=E5=A4=96=E3=82=92=E6=A0=BC=E7=B4=8D=E3=81=99=E3=82=8B?= =?UTF-8?q?=E5=8B=95=E4=BD=9C=E3=82=92=E8=BF=BD=E8=A8=98=20#1270?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/future/promise/op_destructor.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/future/promise/op_destructor.md b/reference/future/promise/op_destructor.md index 98de6b5112..0d07b50f57 100644 --- a/reference/future/promise/op_destructor.md +++ b/reference/future/promise/op_destructor.md @@ -14,8 +14,8 @@ ## 効果 -共有状態を放棄する - +- 共有状態を持っていればそれを解放する。 +- ただし、持っている共有状態が準備完了状態([`future_status::ready`](../future_status.md))でなければ、error conditionとして[`broken_promise`](../future_errc.md)を持つ[`future_error`](../future_error.md)例外オブジェクトを格納して、準備完了状態にしたのち、それを解放する。 ## 例 ```cpp From 33fdff4259aba54e5639229f70eea4743e48432c Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Mon, 29 Apr 2024 19:32:04 +0900 Subject: [PATCH 0878/3948] Update formatter.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit assertしていた事後条件は規定がないので削除 --- reference/format/formatter.md | 1 - 1 file changed, 1 deletion(-) diff --git a/reference/format/formatter.md b/reference/format/formatter.md index 800229fddd..1f02015d15 100644 --- a/reference/format/formatter.md +++ b/reference/format/formatter.md @@ -109,7 +109,6 @@ namespace std { typename FC::template formatter_type f; pc.advance_to(f.parse(pc)); // オプションを解析し状態を保存する fc.advance_to(f.format(u, fc)); // 状態をもとにフォーマットを行う -assert(pc.begin() == pc.end() || *pc.begin() == '}'); ``` * pc.advance_to[link /reference/format/basic_format_parse_context/advance_to.md] * fc.advance_to[link /reference/format/basic_format_context/advance_to.md] From eddd59506ba4c79f2d70a711cf8ba43c26c847a2 Mon Sep 17 00:00:00 2001 From: tshino Date: Tue, 30 Apr 2024 23:24:33 +0900 Subject: [PATCH 0879/3948] =?UTF-8?q?=E5=85=B1=E6=9C=89=E7=8A=B6=E6=85=8B?= =?UTF-8?q?=E3=82=92=E6=94=BE=E6=A3=84=E3=81=99=E3=82=8B=E3=81=A8=E3=81=8D?= =?UTF-8?q?=E4=BE=8B=E5=A4=96=E3=82=92=E6=A0=BC=E7=B4=8D=E3=81=99=E3=82=8B?= =?UTF-8?q?=E5=8B=95=E4=BD=9C=E3=82=92=E8=BF=BD=E8=A8=98=EF=BC=88=E8=A6=8F?= =?UTF-8?q?=E6=A0=BC=E3=81=AB=E6=98=8E=E8=A8=98=E3=81=95=E3=82=8C=E3=81=9F?= =?UTF-8?q?3=E3=83=A1=E3=82=BD=E3=83=83=E3=83=89=EF=BC=89=20#1270?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/future/packaged_task/op_destructor.md | 4 ++-- reference/future/promise/op_assign.md | 6 ++++-- reference/future/promise/op_destructor.md | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/reference/future/packaged_task/op_destructor.md b/reference/future/packaged_task/op_destructor.md index 8efda1a00c..a2bdd4ee82 100644 --- a/reference/future/packaged_task/op_destructor.md +++ b/reference/future/packaged_task/op_destructor.md @@ -14,8 +14,8 @@ ## 効果 -共有状態を放棄する - +1. まず共有状態が準備完了状態([`future_status::ready`](../future_status.md))でなければ、error conditionとして[`broken_promise`](../future_errc.md)を持つ[`future_error`](../future_error.md)例外オブジェクトを格納したのち、準備完了状態にする。 +2. 共有状態を解放する。 ## 例 ```cpp diff --git a/reference/future/promise/op_assign.md b/reference/future/promise/op_assign.md index 7d81f22b86..fc5d42a353 100644 --- a/reference/future/promise/op_assign.md +++ b/reference/future/promise/op_assign.md @@ -16,8 +16,10 @@ promise& operator=(const promise& rhs) = delete; // (2) ## 効果 -- (1) : 現在の共有状態を放棄し、`promise(std::`[`move`](/reference/utility/move.md)`(rhs)).swap(*this)`する。 - +- (1) : + 1. まず現在の共有状態が準備完了状態([`future_status::ready`](../future_status.md))でなければ、error conditionとして[`broken_promise`](../future_errc.md)を持つ[`future_error`](../future_error.md)例外オブジェクトを格納したのち、準備完了状態にする。 + 2. 現在の共有状態を解放する。 + 3. `promise(std::`[`move`](/reference/utility/move.md)`(rhs)).swap(*this)`する。 ## 戻り値 - (1) : `*this` diff --git a/reference/future/promise/op_destructor.md b/reference/future/promise/op_destructor.md index 0d07b50f57..6203910d34 100644 --- a/reference/future/promise/op_destructor.md +++ b/reference/future/promise/op_destructor.md @@ -14,8 +14,8 @@ ## 効果 -- 共有状態を持っていればそれを解放する。 -- ただし、持っている共有状態が準備完了状態([`future_status::ready`](../future_status.md))でなければ、error conditionとして[`broken_promise`](../future_errc.md)を持つ[`future_error`](../future_error.md)例外オブジェクトを格納して、準備完了状態にしたのち、それを解放する。 +1. まず共有状態が準備完了状態([`future_status::ready`](../future_status.md))でなければ、error conditionとして[`broken_promise`](../future_errc.md)を持つ[`future_error`](../future_error.md)例外オブジェクトを格納したのち、準備完了状態にする。 +2. 共有状態を解放する。 ## 例 ```cpp From 8e854b8d24bb6774f4e3622c881edc0addde5614 Mon Sep 17 00:00:00 2001 From: tshino Date: Wed, 1 May 2024 00:29:19 +0900 Subject: [PATCH 0880/3948] =?UTF-8?q?promise=E3=83=87=E3=82=B9=E3=83=88?= =?UTF-8?q?=E3=83=A9=E3=82=AF=E3=82=BF=E3=81=8C=E4=BE=8B=E5=A4=96=E3=82=92?= =?UTF-8?q?=E6=A0=BC=E7=B4=8D=E3=81=99=E3=82=8B=E3=82=B3=E3=83=BC=E3=83=89?= =?UTF-8?q?=E4=BE=8B=E3=82=92=E4=BD=9C=E6=88=90=20#1270?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/future/promise/op_destructor.md | 37 +++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/reference/future/promise/op_destructor.md b/reference/future/promise/op_destructor.md index 6203910d34..a922bd7d37 100644 --- a/reference/future/promise/op_destructor.md +++ b/reference/future/promise/op_destructor.md @@ -18,11 +18,44 @@ 2. 共有状態を解放する。 ## 例 -```cpp +```cpp example +#include +#include +#include +#include + +void calc(std::promise p) +{ + // 通常行う p.set_value() をしなかったとする + + // ここで promise のデストラクタが例外オブジェクトを書き込む +} + +int main() +{ + std::promise p; + std::future f = p.get_future(); + + std::thread t(calc, std::move(p)); + + try { + std::cout << f.get() << std::endl; // 上で書き込まれた例外が送出される + } + catch (std::future_error& e) { + std::cout << e.what() << std::endl; + } + + t.join(); +} ``` +* std::future[link /reference/future/future.md] +* p.get_future()[link get_future.md] +* std::move[link /reference/utility/move.md] +* f.get()[link /reference/future/future/get.md] -### 出力 +### 出力例 ``` +std::future_error: Broken promise ``` ## バージョン From b9d4a50c1206393ba88cd6366d39fb3aace4d8b9 Mon Sep 17 00:00:00 2001 From: tshino Date: Thu, 2 May 2024 01:01:07 +0900 Subject: [PATCH 0881/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BE=8B?= =?UTF-8?q?=E3=81=AE=E4=B8=80=E8=A1=8C=E3=81=AE=E9=95=B7=E3=81=95=E3=82=92?= =?UTF-8?q?=E7=9F=AD=E3=81=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/future/promise/op_destructor.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reference/future/promise/op_destructor.md b/reference/future/promise/op_destructor.md index a922bd7d37..a4b55f0367 100644 --- a/reference/future/promise/op_destructor.md +++ b/reference/future/promise/op_destructor.md @@ -39,7 +39,8 @@ int main() std::thread t(calc, std::move(p)); try { - std::cout << f.get() << std::endl; // 上で書き込まれた例外が送出される + // 上で書き込まれた例外が送出される + std::cout << f.get() << std::endl; } catch (std::future_error& e) { std::cout << e.what() << std::endl; From 16ab0b8514c8390ce0ee6dd92c0bc2032ad371f2 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Sat, 4 May 2024 20:46:28 +0900 Subject: [PATCH 0882/3948] =?UTF-8?q?view=5Finterface::empty=20:=20LWG=20I?= =?UTF-8?q?ssue=203715=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/view_interface/empty.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/reference/ranges/view_interface/empty.md b/reference/ranges/view_interface/empty.md index f82c4d93f8..268537a793 100644 --- a/reference/ranges/view_interface/empty.md +++ b/reference/ranges/view_interface/empty.md @@ -7,12 +7,13 @@ ```cpp constexpr bool empty() - requires forward_range; // (1) + requires sized_range || forward_range; // (1) constexpr bool empty() const - requires forward_range; // (2) + requires sized_range || forward_range; // (2) ``` * forward_range[link ../forward_range.md] +* forward_range[link ../sized_range.md] ## 概要 Rangeが空かどうかを判定する。 @@ -20,8 +21,8 @@ Rangeが空かどうかを判定する。 ## テンプレートパラメータ制約 [`view_interface`](../view_interface.md)``に対して、 -- (1): `D`が[`forward_range`](../forward_range.md)であること。 -- (2): `const D`が[`forward_range`](../forward_range.md)であること。 +- (1): `D`が[`sized_range`](../sized_range.md)もしくは[`forward_range`](../forward_range.md)であること。 +- (2): `const D`が[`sized_range`](../sized_range.md)もしくは[`forward_range`](../forward_range.md)であること。 ## 戻り値 (1)、(2)共に、以下と等価: @@ -49,3 +50,4 @@ ranges::begin(derived()) == ranges::end(derived()) ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) - [C++20 ranges](https://techbookfest.org/product/5134506308665344) +- [LWG Issue 3715. `view_interface::empty` is overconstrained](https://cplusplus.github.io/LWG/issue3715) From d12d62181564bfc35f400bed89cf4b787d112c44 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sun, 5 May 2024 10:54:15 +0900 Subject: [PATCH 0883/3948] =?UTF-8?q?(recursive=5F)directory=5Fiterator=20?= =?UTF-8?q?:=20=E3=83=87=E3=82=A3=E3=83=AC=E3=82=AF=E3=83=88=E3=83=AA?= =?UTF-8?q?=E3=82=82=E5=88=97=E6=8C=99=E3=81=95=E3=82=8C=E3=82=8B=E3=81=93?= =?UTF-8?q?=E3=81=A8=E3=82=92=E6=98=8E=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ディレクトリもディレクトリファイルというファイルなので、間違っていたわけではない --- reference/filesystem/directory_iterator.md | 2 +- reference/filesystem/recursive_directory_iterator.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/filesystem/directory_iterator.md b/reference/filesystem/directory_iterator.md index 844f2da3b5..94b9c20510 100644 --- a/reference/filesystem/directory_iterator.md +++ b/reference/filesystem/directory_iterator.md @@ -74,7 +74,7 @@ int main() fs::create_directory("dir_a/dir_b"); std::ofstream{"dir_a/dir_b/b.txt"}; - // dir_aディレクトリ直下に含まれる全ファイルを出力 + // dir_aディレクトリ直下に含まれる全ファイル・ディレクトリを出力 for (const fs::directory_entry& x : fs::directory_iterator("dir_a")) { std::cout << x.path() << std::endl; } diff --git a/reference/filesystem/recursive_directory_iterator.md b/reference/filesystem/recursive_directory_iterator.md index 65e497b1a4..5aab4c90de 100644 --- a/reference/filesystem/recursive_directory_iterator.md +++ b/reference/filesystem/recursive_directory_iterator.md @@ -92,7 +92,7 @@ int main() fs::create_directory("dir_a/dir_b"); std::ofstream{"dir_a/dir_b/b.txt"}; - // dir_aディレクトリに含まれる全ファイルを再帰的に出力 + // dir_aディレクトリに含まれる全ファイル・ディレクトリを再帰的に出力 for (const fs::directory_entry& x : fs::recursive_directory_iterator("dir_a")) { std::cout << x.path() << std::endl; } From bcfaf97b5b16446e967007fdb452d332352454d7 Mon Sep 17 00:00:00 2001 From: Kiterai <7496490+Kiterai@users.noreply.github.com> Date: Mon, 6 May 2024 00:05:05 +0900 Subject: [PATCH 0884/3948] Update pragma_operator.md --- lang/cpp11/pragma_operator.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp11/pragma_operator.md b/lang/cpp11/pragma_operator.md index 06294806f8..ef1727c733 100644 --- a/lang/cpp11/pragma_operator.md +++ b/lang/cpp11/pragma_operator.md @@ -43,7 +43,7 @@ int main() int b[N] = {1, 2, 3, 4, 5}; int c[N] = {}; - // OMP_PARALLEL_FORは、 #pragma omp parallel for に展開される + // OMP_PARALLEL_FORは、 _Pragma("omp parallel for") に展開される OMP_PARALLEL_FOR for (int i = 0; i < N; ++i) { c[i] = a[i] + b[i]; From 599f09ff3f94f6c3bb943ef59fa76189808313c6 Mon Sep 17 00:00:00 2001 From: tshino Date: Mon, 6 May 2024 15:09:39 +0900 Subject: [PATCH 0885/3948] =?UTF-8?q?packaged=5Ftask=E3=83=A0=E3=83=BC?= =?UTF-8?q?=E3=83=96=E4=BB=A3=E5=85=A5=E6=BC=94=E7=AE=97=E5=AD=90=E3=81=A8?= =?UTF-8?q?reset=E3=81=AE=E5=8A=B9=E6=9E=9C=E3=82=92=E8=BF=BD=E8=A8=98?= =?UTF-8?q?=E3=80=82=E5=82=99=E8=80=83=E3=81=A7=E5=AE=9F=E8=A3=85=E3=81=AB?= =?UTF-8?q?=E3=81=A4=E3=81=84=E3=81=A6=E8=A3=9C=E8=B6=B3=20#1270?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/future/packaged_task/op_assign.md | 12 +++++++++++- reference/future/packaged_task/reset.md | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/reference/future/packaged_task/op_assign.md b/reference/future/packaged_task/op_assign.md index 2d4f859ffc..5381838401 100644 --- a/reference/future/packaged_task/op_assign.md +++ b/reference/future/packaged_task/op_assign.md @@ -18,7 +18,10 @@ packaged_task& operator=(packaged_task&& rhs) noexcept; // (2) ## 効果 -- (2) : `*this`の共有状態を解放し、`packaged_task(`[`std::move`](/reference/utility/move.md)`(rhs)).swap(*this)`を行う。 +- (2) : + 1. まず現在の共有状態が準備完了状態([`future_status::ready`](../future_status.md))でなければ、error conditionとして[`broken_promise`](../future_errc.md)を持つ[`future_error`](../future_error.md)例外オブジェクトを格納したのち、準備完了状態にする。ただし、実装によっては、この動作が行われない場合がある(備考を参照)。 + 2. 現在の共有状態を解放する。 + 3. `packaged_task(`[`std::move`](/reference/utility/move.md)`(rhs)).swap(*this)`を行う。 ## 戻り値 @@ -29,6 +32,13 @@ packaged_task& operator=(packaged_task&& rhs) noexcept; // (2) - (2) : 投げない +## 備考 +C++11の仕様では、ムーブ代入演算子の効果として古い共有状態は「放棄する(abandon)」ではなく「解放する(release)」となっているが、仕様の他の項目(Shared States, Class template promise, および Class template packaged_task内のvoid reset();)の記載との整合性を欠いており、「放棄する(abandon)」とする方が合理性があるため効果の項にはそのように記載した。 + +「(共有状態を)放棄する(abandon)」とは効果の項(2)の1と2が行われることをいい、「(共有状態を)解放する(release)」とは効果の項(2)の2のみが行われることである。通常、[`promise`](../promise.md)および`packaged_task`は処理結果を提供する側であるため共有状態を所有しなくなるときには前者を行い、[`future`](../future.md)および[`shared_future`](../shared_future.md)は処理結果を受け取る側であるため共有状態を所有しなくなるときには後者を行う。 + +なお、実際の実装ではClangおよびGCCでは「放棄する(abandon)」の動作になっているが、Visual C++では「解放する(release)」の動作になっている。 + ## 例 ```cpp example #include diff --git a/reference/future/packaged_task/reset.md b/reference/future/packaged_task/reset.md index f4333e7edb..59b2d1d70a 100644 --- a/reference/future/packaged_task/reset.md +++ b/reference/future/packaged_task/reset.md @@ -21,7 +21,7 @@ void reset(); ``` * std::move[link /reference/utility/move.md] -によって、新たに共有状態を作成する。古い共有状態は放棄される。 +によって、新たに共有状態を作成する。古い共有状態は放棄される(詳細は[`operator=`](op_assign.md)を参照)。 `f`はメンバ変数として保持している、非同期実行する関数オブジェクト。 From 2486f062f20953bf9500234b60ca893643f59cc9 Mon Sep 17 00:00:00 2001 From: tshino Date: Mon, 6 May 2024 15:17:54 +0900 Subject: [PATCH 0886/3948] =?UTF-8?q?packaged=5Ftask::reset=E3=81=AE?= =?UTF-8?q?=E5=AE=9F=E8=A3=85=E3=81=AE=E5=8B=95=E4=BD=9C=E3=81=AB=E3=81=A4?= =?UTF-8?q?=E3=81=84=E3=81=A6=E3=82=82=E8=BF=BD=E8=A8=98=20#1270?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/future/packaged_task/op_assign.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/future/packaged_task/op_assign.md b/reference/future/packaged_task/op_assign.md index 5381838401..2dd403be6c 100644 --- a/reference/future/packaged_task/op_assign.md +++ b/reference/future/packaged_task/op_assign.md @@ -37,7 +37,7 @@ C++11の仕様では、ムーブ代入演算子の効果として古い共有状 「(共有状態を)放棄する(abandon)」とは効果の項(2)の1と2が行われることをいい、「(共有状態を)解放する(release)」とは効果の項(2)の2のみが行われることである。通常、[`promise`](../promise.md)および`packaged_task`は処理結果を提供する側であるため共有状態を所有しなくなるときには前者を行い、[`future`](../future.md)および[`shared_future`](../shared_future.md)は処理結果を受け取る側であるため共有状態を所有しなくなるときには後者を行う。 -なお、実際の実装ではClangおよびGCCでは「放棄する(abandon)」の動作になっているが、Visual C++では「解放する(release)」の動作になっている。 +なお、`operator=`の実際の実装では、ClangおよびGCCでは「放棄する(abandon)」の動作になっているが、Visual C++では「解放する(release)」の動作になっている。また、[`reset`](reset.md)では、Clang,GCC,Visual C++のいずれも「放棄する(abandon)」の動作になっている。 ## 例 ```cpp example From 4d8ffbea106f17aca2eaa0e822f836f0262e38be Mon Sep 17 00:00:00 2001 From: suomesta Date: Sun, 12 May 2024 15:58:52 +0900 Subject: [PATCH 0887/3948] fix some typo --- reference/algorithm/nth_element.md | 2 +- reference/execution/execution/execution_policy.md | 2 ++ reference/iterator/const_iterator.md | 2 +- reference/iterator/const_sentinel.md | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/reference/algorithm/nth_element.md b/reference/algorithm/nth_element.md index 6c0ddf375d..6c8890ac7b 100644 --- a/reference/algorithm/nth_element.md +++ b/reference/algorithm/nth_element.md @@ -87,7 +87,7 @@ int main() ``` * std::nth_element[color ff0000] -### 出力 +### 出力例 ``` 2 1 diff --git a/reference/execution/execution/execution_policy.md b/reference/execution/execution/execution_policy.md index f1ee35df3e..fdc1ea560a 100644 --- a/reference/execution/execution/execution_policy.md +++ b/reference/execution/execution/execution_policy.md @@ -159,6 +159,8 @@ int main() } } ``` +* std::execution::par[color ff0000] +* std::execution::par_unseq[color ff0000] * count.load[link /reference/atomic/atomic/load.md] * is_always_lock_free[link /reference/atomic/atomic/is_always_lock_free.md.nolink] diff --git a/reference/iterator/const_iterator.md b/reference/iterator/const_iterator.md index d88d0c17b7..91e997fbe8 100644 --- a/reference/iterator/const_iterator.md +++ b/reference/iterator/const_iterator.md @@ -7,7 +7,7 @@ ```cpp namespace std { template - using const_iterator = /*see below*?; + using const_iterator = /*see below*/; } ``` * input_iterator[link input_iterator.md] diff --git a/reference/iterator/const_sentinel.md b/reference/iterator/const_sentinel.md index 591caab8ed..483495e3d2 100644 --- a/reference/iterator/const_sentinel.md +++ b/reference/iterator/const_sentinel.md @@ -7,7 +7,7 @@ ```cpp namespace std { template - using const_sentinel = /*see below*?; + using const_sentinel = /*see below*/; } ``` * semiregular[link /reference/concepts/semiregular.md] From bec6a538a9bffb4315f5198e63708f6440258ad1 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 13 May 2024 14:06:47 +0900 Subject: [PATCH 0888/3948] =?UTF-8?q?bitset=20:=20C++26=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=E3=81=A8=E3=81=97=E3=81=A6string=5Fview=E3=82=92=E3=81=A8?= =?UTF-8?q?=E3=82=8B=E3=82=B3=E3=83=B3=E3=82=B9=E3=83=88=E3=83=A9=E3=82=AF?= =?UTF-8?q?=E3=82=BF=E3=82=92=E8=BF=BD=E5=8A=A0=20(close=20#1197)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/bitset/bitset/op_constructor.md | 69 ++++++++++++++++------- 1 file changed, 48 insertions(+), 21 deletions(-) diff --git a/reference/bitset/bitset/op_constructor.md b/reference/bitset/bitset/op_constructor.md index 1b898c9a8c..03fe984b9a 100644 --- a/reference/bitset/bitset/op_constructor.md +++ b/reference/bitset/bitset/op_constructor.md @@ -17,57 +17,74 @@ explicit bitset( typename basic_string::size_type pos = 0, typename basic_string::size_type n = basic_string::npos); // (3) C++03 - template explicit bitset( const basic_string& str, typename basic_string::size_type pos = 0, typename basic_string::size_type n = basic_string::npos, - CharT zero = CharT('0'), CharT one = CharT('1')); // (3) C++11 - + CharT zero = CharT('0'), + CharT one = CharT('1')); // (3) C++11 template constexpr explicit bitset( const basic_string& str, typename basic_string::size_type pos = 0, typename basic_string::size_type n = basic_string::npos, - CharT zero = CharT('0'), CharT one = CharT('1')); // (3) C++23 + CharT zero = CharT('0'), + CharT one = CharT('1')); // (3) C++23 + +template +constexpr explicit bitset( + basic_string_view str, + typename basic_string_view::size_type pos = 0, + typename basic_string_view::size_type n = + basic_string_view::npos, + CharT zero = CharT('0'), + CharT one = CharT('1')); // (4) C++26 template explicit bitset( const CharT* str, typename basic_string::size_type n = basic_string::npos, - CharT zero = CharT('0'), CharT one = CharT('1')); // (4) C++11 - + CharT zero = CharT('0'), + CharT one = CharT('1')); // (5) C++11 template constexpr explicit bitset( const CharT* str, typename basic_string::size_type n = basic_string::npos, - CharT zero = CharT('0'), CharT one = CharT('1')); // (4) C++23 + CharT zero = CharT('0'), + CharT one = CharT('1')); // (5) C++23 +template +constexpr explicit bitset( + const CharT* str, + typename basic_string_view::size_type n = basic_string_view::npos, + CharT zero = CharT('0'), + CharT one = CharT('1')); // (5) C++26 ``` * basic_string[link /reference/string/basic_string.md] ## bitsetオブジェクトの構築 -- (1) : デフォルトコンストラクタ。 -- (2) : 整数値を受け取るコンストラクタ。 -- (3) : `'0'`と`'1'`の文字で構成される`basic_string`文字列からビット列を構築する。 -- (4) : `'0'`と`'1'`の文字で構成される文字配列からビット列を構築する。 +- (1) : デフォルトコンストラクタ +- (2) : 整数値を受け取るコンストラクタ +- (3) : `'0'`と`'1'`の文字で構成される`basic_string`文字列からビット列を構築する +- (4) : `'0'と`'1'`の文字で構成される`[`basic_string_view`](/reference/string_view/basic_string_view.md)オブジェクトからビット列を構築する +- (5) : `'0'`と`'1'`の文字で構成される文字配列からビット列を構築する ## 要件 -- (3) : `pos <= str.`[`size()`](/reference/string/basic_string/size.md) +- (3), (4) : `pos <= str.`[`size()`](/reference/string/basic_string/size.md) ## 効果 - (1) : 全てのビットを`0`に初期化する。 - (2) : 整数値`val`でビット列を初期化する。`bitset`クラスのテンプレートパラメータ`N`と`val`のビット数のうち、小さい方の大きさで表現可能なビット列となる。クラステンプレートパラメータ`N`よりも`val`のビット数の方が小さい場合は、残りのビットを`0`で初期化する。 -- (3) : 文字列`str`でビット列を初期化する。 +- (3), (4) : 文字列`str`でビット列を初期化する。 - ビット列として扱う文字列は`str`の`n`文字目以降である。`n == npos`の場合は`str`の全文字列を使用する。対象となる文字列範囲を`rstr`とする。 - C++03 : 文字列`rstr`に含まれる文字`CharT('0')`をビット値`0`、文字`CharT('1')`をビット値`1`と見なし、対応する値でビット列を構築する。 - C++11 : 文字列`rstr`に含まれる文字`zero`をビット値`0`、文字`one`をビット値`1`と見なし、対応する値でビット列を構築する。 - クラステンプレートパラメータ`N`と文字列`rstr`の長さのうち、小さい方の大きさで表現可能なビット列となる。クラステンプレートパラメータ`N`よりも文字列`rstr`の長さの方が小さい場合は、残りのビットを`0`で初期化する。 -- (4) : 以下のように初期化する: +- (5) : 以下のように初期化する: ```cpp bitset( @@ -78,10 +95,10 @@ bitset( ## 例外 -- (3) : `pos > str.`[`size()`](/reference/string/basic_string/size.md)の場合、[`out_of_range`](/reference/stdexcept.md)例外を送出する。 +- (3), (4) : `pos > str.`[`size()`](/reference/string/basic_string/size.md)の場合、[`out_of_range`](/reference/stdexcept.md)例外を送出する。 - C++03 : `str`に`'0'`と`'1'`以外の文字が含まれていた場合、[`invalid_argument`](/reference/stdexcept.md)例外を送出する。 - C++11 : `str`に`zero`と`one`以外の文字が含まれていた場合、[`invalid_argument`](/reference/stdexcept.md)例外を送出する。 -- (4) : `str`に`zero`と`one`以外の文字が含まれていた場合、[`invalid_argument`](/reference/stdexcept.md)例外を送出する。 +- (5) : `str`に`zero`と`one`以外の文字が含まれていた場合、[`invalid_argument`](/reference/stdexcept.md)例外を送出する。 ## 例 @@ -103,17 +120,23 @@ int main() std::cout << "(2) : " << bs << std::endl; } - // (3) basic_stringから構築 + // (3) stringから構築 { std::bitset<4> bs(std::string("1010")); std::cout << "(3) : " << bs << std::endl; } - // (4) 文字配列から構築 + // (4) string_viewから構築 { - std::bitset<4> bs("1010"); + std::bitset<4> bs{std::string_view("1010")}; std::cout << "(4) : " << bs << std::endl; } + + // (5) 文字配列から構築 + { + std::bitset<4> bs("1010"); + std::cout << "(5) : " << bs << std::endl; + } } ``` @@ -123,11 +146,12 @@ int main() (2) : 1010 (3) : 1010 (4) : 1010 +(5) : 1010 ``` ### 処理系 -- (4)のコンストラクタ +- (5)のコンストラクタ - [Clang](/implementation.md#clang): 3.0 - [GCC](/implementation.md#gcc): 4.5.4 - [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 @@ -135,5 +159,8 @@ int main() ## 参照 - [LWG Issue 778. `std::bitset` does not have any constructor taking a string literal](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#778) - - (4)のコンストラクタが追加された経緯となるレポート + - (5)のコンストラクタが追加された経緯となるレポート - [P2417R2 A more constexpr bitset](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2417r2.pdf) +- [P2697R1 Interfacing `bitset` with `string_view`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2697r1.pdf) + - C++26から`string_view`を受け取るコンストラクタが追加された + From eb496442ba3d29cfb3705271ca9446d5e92900d9 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 13 May 2024 14:38:59 +0900 Subject: [PATCH 0889/3948] =?UTF-8?q?C++26=20:=20=E3=80=8Cstatic=5Fassert?= =?UTF-8?q?=E3=81=AE=E8=A8=BA=E6=96=AD=E3=83=A1=E3=83=83=E3=82=BB=E3=83=BC?= =?UTF-8?q?=E3=82=B8=E3=81=AB=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=BC=E3=81=8C?= =?UTF-8?q?=E7=94=9F=E6=88=90=E3=81=97=E3=81=9F=E6=96=87=E5=AD=97=E5=88=97?= =?UTF-8?q?=E3=81=AE=E6=8C=87=E5=AE=9A=E3=82=92=E8=A8=B1=E5=8F=AF=E3=80=8D?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20(close=20#1177)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp11/static_assert.md | 1 + lang/cpp26.md | 2 +- .../user-generated_static_assert_messages.md | 51 +++++++++++++++++++ 4 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 lang/cpp26/user-generated_static_assert_messages.md diff --git a/implementation-status.md b/implementation-status.md index 18eec19cb0..cef1f0e7fb 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -302,7 +302,7 @@ | P2361R6: [コンパイル時にのみ使用される文字列の扱いを明確化](/lang/cpp26/unevaluated_strings.md.nolink) | `static_assert`や`[[deprecated]]`などで使用されるコンパイル時の文字列について、文字コードの指定を禁止し、実行時エンコーディングが行われないことを規定 | 14 | 18 | | | | P2552R3: [属性の無視性を見直し](/lang/cpp26/on_the_ignorability_of_standard_attributes.md.nolink) | 構文として適格な属性のみを無視できるようにし、そうでない属性の使用を不適格とする | | | | | | P2738R1: [定数式での`void*`からポインタ型へのキャストを許可](/lang/cpp26/constexpr_cast_from_voidptr.md.nolink) | 型消去のために`void*`からポインタ型へのキャストを許可する | 14 | 17 | | | -| P2741R3: [`static_assert`の診断メッセージにユーザーが生成した文字列の指定を許可](/lang/cpp26/user-generated_static_assert_messages.md.nolink) | `constexpr`な`S.size()`と`S.data()`メンバ関数をもつオブジェクトをコンパイル時文字列として指定できるようにする | 14 | 17 | | | +| P2741R3: [`static_assert`の診断メッセージにユーザーが生成した文字列の指定を許可](/lang/cpp26/user-generated_static_assert_messages.md) | `constexpr`な`S.size()`と`S.data()`メンバ関数をもつオブジェクトをコンパイル時文字列として指定できるようにする | 14 | 17 | | | | P2558R2: [基本文字集合に@、$、\`を追加](/lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md.nolink) | C言語との互換性のためにこれらの文字を基本文字集合に追加 | | Yes | | | | P2662R3: [パラメータパックへのインデックスアクセスを許可](/lang/cpp26/pack_indexing.md.nolink) | 可変引数テンプレートのパラメータパックに添字アクセスできるようにする | | | | | | P2864R2: [非推奨となっていた列挙値から算術型への暗黙変換を削除](/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md.nolink) | C++20から非推奨となっていた列挙値への算術演算で算術型に暗黙変換される仕様を削除 | 14 | 18 | | | diff --git a/lang/cpp11/static_assert.md b/lang/cpp11/static_assert.md index c1369a8b88..64020c3b02 100644 --- a/lang/cpp11/static_assert.md +++ b/lang/cpp11/static_assert.md @@ -82,6 +82,7 @@ Boost Static Assertion Libraryが開発されたときに、コンパイル時 - [C++17 `static_assert`のメッセージ省略を許可](/lang/cpp17/extending_static_assert.md) - [C++17 constexpr if 文](/lang/cpp17/if_constexpr.md) - [C++23 定数式の文脈での`bool`への縮小変換を許可](/lang/cpp23/narrowing_contextual_conversions_to_bool.md) +- [C++26 `static_assert`の診断メッセージにユーザーが生成した文字列の指定を許可](/lang/cpp26/user-generated_static_assert_messages.md) ## 参照 diff --git a/lang/cpp26.md b/lang/cpp26.md index 899443a53c..2f317aa4f5 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -43,7 +43,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| | [定数式での`void*`からポインタ型へのキャストを許可](/lang/cpp26/constexpr_cast_from_voidptr.md.nolink) | 型消去のために`void*`からポインタ型へのキャストを許可する | -| [`static_assert`の診断メッセージにユーザーが生成した文字列の指定を許可](/lang/cpp26/user-generated_static_assert_messages.md.nolink) | `constexpr`な`S.size()`と`S.data()`メンバ関数をもつオブジェクトをコンパイル時文字列として指定できるようにする | +| [`static_assert`の診断メッセージにユーザーが生成した文字列の指定を許可](/lang/cpp26/user-generated_static_assert_messages.md) | `constexpr`な`S.size()`と`S.data()`メンバ関数をもつオブジェクトをコンパイル時文字列として指定できるようにする | ### ソースコード diff --git a/lang/cpp26/user-generated_static_assert_messages.md b/lang/cpp26/user-generated_static_assert_messages.md new file mode 100644 index 0000000000..576d51655c --- /dev/null +++ b/lang/cpp26/user-generated_static_assert_messages.md @@ -0,0 +1,51 @@ +# static_assertの診断メッセージにユーザーが生成した文字列の指定を許可 +* cpp26[meta cpp] + +## 概要 +C++26では、[`static_assert`](/lang/cpp11/static_assert.md)に指定する表明失敗時の診断メッセージとして、文字列リテラルだけでなくユーザー定義型の文字列オブジェクトも指定できるようになる。 + +例として、[`std::format()`](/reference/format/format.md)関数によって作られた[`std::string`](/reference/string/basic_string.md)オブジェクトも診断メッセージとして使用できる。 + +```cpp example +#include +#include + +template +void f() +{ + static_assert( + sizeof(T) == 4, + std::format("type T size should 4, actual:{}", sizeof(T)) + ); +} + +int main() +{ + f(); // OK + f(); // Error! "type T size should 4, actual:8" +} +``` + + +## 仕様 +`static_assert`の構文において、 + +``` +static_assert(定数式, 診断メッセージ); +``` + +診断メッセージが文字列リテラルでない場合、そのオブジェクトMは、以下の要件を満たすこと: + +- `M.size()`から[`std::size_t`](/reference/cstddef/size_t.md)への暗黙変換が定数式であること +- `M.data()`から「`const char`へのポインタ」への暗黙変換が定数式であること +- メッセージのシーケンスに含まれる各文字が、エンコーディング指定されていない文字コード (ordinary literal encoding) であること + - `u8"message"`はNG + - `"message"`はOK + + +## 関連項目 +- [C++11 コンパイル時アサート](/lang/cpp11/static_assert.md) + + +## 参照 +- [P2741R3 user-generated `static_assert` messages](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2741r3.pdf) From ba9a49412500113f7235ff4e65dea28188a05dfc Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 13 May 2024 15:14:50 +0900 Subject: [PATCH 0890/3948] =?UTF-8?q?assert=20:=20C++26=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=E3=81=A8=E3=81=97=E3=81=A6=E3=80=81=E3=82=AB=E3=83=B3=E3=83=9E?= =?UTF-8?q?=E3=82=92=E5=90=AB=E3=82=80=E5=BC=8F=E3=82=92=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E5=BC=8F=E3=81=A8=E3=81=97=E3=81=A6=E6=8C=87=E5=AE=9A=E3=81=A7?= =?UTF-8?q?=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=97=E3=81=9F?= =?UTF-8?q?=20(close=20#1240)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cassert/assert.md | 42 +++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/reference/cassert/assert.md b/reference/cassert/assert.md index 3254fd5001..d10ca3ce0e 100644 --- a/reference/cassert/assert.md +++ b/reference/cassert/assert.md @@ -4,9 +4,11 @@ ```cpp # if !defined(NDEBUG) - #define assert(expr) implementation-defined + #define assert(expr) implementation-defined // (1) C++03 + #define assert(...) implementation-defined // (1) C++26 # else - #define assert(ignore) ((void)0) + #define assert(ignore) ((void)0) // (2) C++03 + #define assert(...) ((void)0) // (2) C++26 # endif ``` @@ -19,14 +21,18 @@ ## 要件 -パラメータの式の型はスカラ型でなければならない。 +- C++14まで : パラメータの式の型はスカラ型でなければならない + - C言語への参照として定義されていた仕様では、`assert`は`void assert(scalar expression);`のような関数として定義されていた ## 効果 - 有効な場合: - - パラメータの式を評価し、偽であった場合(`0`と等しい場合)、式をテキスト化したものに加え`__FILE__`, `__LINE__`, `__func__`の値を標準エラー出力に処理系定義の書式で書き込み、[`abort()`](/reference/cstdlib/abort.md)関数を呼び出してプログラムを異常終了させる。 + - C++03 : パラメータの式を評価し、 + - C++26 : 可変引数パラメータ`__VA_ARGS__`を`bool`に変換し、 + - 真に評価された場合は、なにもしない + - そうでない場合(`0`と等しい場合)、式をテキスト化したもの、([`std::source_location`](/reference/source_location/source_location.md)`::`[`current()`](/reference/source_location/source_location/current.md)で取得できるような) ソースファイル名、行番号、関数名を標準エラー出力に処理系定義の書式で書き込み、[`abort()`](/reference/cstdlib/abort.md)関数を呼び出してプログラムを異常終了させる - 無効な場合: - - パラメータの式は評価はされず、何もしない。 + - パラメータの式は評価はされず、なにもしない このマクロは、定数式内で使用できる。(C++17) @@ -89,6 +95,29 @@ int main() ``` ``` +### カンマを含む条件式をassertマクロで使用する (C++26) +```cpp example +#include +#include + +template +void f() +{ + assert(std::is_same_v); // C++26 : OK + assert((std::is_same_v)); // C++23までは、カンマを含む式は全体を丸カッコで囲む必要がある +} + +int main() +{ + f(); + f(); +} +``` + +### 出力 +``` +``` + ## 参照 - C++14 - 19.3 [assertions] @@ -96,4 +125,5 @@ int main() - [What does it mean for C++ that assert takes a scalar argument?](https://groups.google.com/a/isocpp.org/d/topic/std-discussion/6EHDRo1A2EE/discussion) パラメータの式の型についての要件は参照規格であるCの規定によるものであり、「スカラ型」が[C++におけるスカラ型](/reference/type_traits/is_scalar.md)となるのか、あるいはCにおけるスカラ型の範囲に限定されるのか、少なくともC++14時点でははっきりしていない。 - [LWG Issue 2234. `assert()` should allow usage in constant expressions](http://wg21.cmeerw.net/lwg/issue2234) - +- [P2264R7 Make `assert()` macro user friendly for C and C++](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2264r7.html) + - C++26から、カンマを含む式を条件式として使用できるようになった From 142f30311d60a885501d1d9414f339371aacc4e7 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 13 May 2024 16:11:26 +0900 Subject: [PATCH 0891/3948] =?UTF-8?q?basic=5Fstacktrace=20:=20GCC=E3=81=A7?= =?UTF-8?q?=E5=8B=95=E4=BD=9C=E7=A2=BA=E8=AA=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/stacktrace/basic_stacktrace.md | 25 +++++++++++----- reference/stacktrace/basic_stacktrace/at.md | 6 ++-- .../stacktrace/basic_stacktrace/begin.md | 16 ++++++---- .../stacktrace/basic_stacktrace/cbegin.md | 16 ++++++---- reference/stacktrace/basic_stacktrace/cend.md | 16 ++++++---- .../stacktrace/basic_stacktrace/crbegin.md | 16 ++++++---- .../stacktrace/basic_stacktrace/crend.md | 16 ++++++---- .../stacktrace/basic_stacktrace/current.md | 30 ++++++++++++------- .../stacktrace/basic_stacktrace/empty.md | 2 +- reference/stacktrace/basic_stacktrace/end.md | 16 ++++++---- .../basic_stacktrace/get_allocator.md | 2 +- .../stacktrace/basic_stacktrace/max_size.md | 4 +++ .../stacktrace/basic_stacktrace/op_assign.md | 6 ++-- .../stacktrace/basic_stacktrace/op_at.md | 6 ++-- .../basic_stacktrace/op_compare_3way.md | 2 +- .../basic_stacktrace/op_constructor.md | 2 +- .../stacktrace/basic_stacktrace/op_equal.md | 2 +- .../stacktrace/basic_stacktrace/op_ostream.md | 14 +++++---- .../stacktrace/basic_stacktrace/rbegin.md | 16 ++++++---- reference/stacktrace/basic_stacktrace/rend.md | 16 ++++++---- reference/stacktrace/basic_stacktrace/size.md | 20 ++++++++----- reference/stacktrace/basic_stacktrace/swap.md | 14 +++++---- .../stacktrace/basic_stacktrace/swap_free.md | 14 +++++---- .../stacktrace/basic_stacktrace/to_string.md | 18 ++++++----- 24 files changed, 185 insertions(+), 110 deletions(-) diff --git a/reference/stacktrace/basic_stacktrace.md b/reference/stacktrace/basic_stacktrace.md index e318d69199..49bad48e2f 100644 --- a/reference/stacktrace/basic_stacktrace.md +++ b/reference/stacktrace/basic_stacktrace.md @@ -173,11 +173,15 @@ int main() { ``` * current()[link basic_stacktrace/current.md] -#### 出力例 +#### 出力例 (GCC) ``` - 0# g() at main.cpp:5 - 1# f() at main.cpp:9 - 2# main at main.cpp:13 + 0# g() at /app/example.cpp:5 + 1# f() at /app/example.cpp:10 + 2# main at /app/example.cpp:14 + 3# at :0 + 4# __libc_start_main at :0 + 5# _start at :0 + 6# ``` ### スタックトレースを出力するアサーションマクロを作る @@ -208,9 +212,9 @@ int main() { * std::abort()[link /reference/cstdlib/abort.md] * std::cerr[link /reference/iostream/cerr.md] -#### 出力例 +#### 出力例 (GCC) ``` -Expression 'i >= 0' is false in f() at main.cpp:15 +Expression 'i >= 0' is false in f(int) at /app/example.cpp:15 ``` ## バージョン @@ -219,5 +223,12 @@ Expression 'i >= 0' is false in f() at main.cpp:15 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? +- [GCC](/implementation.md#gcc): 12 - [Visual C++](/implementation.md#visual_cpp): ?? + + +### 備考 +- GCCでは、以下のコンパイルオプションを追加で指定する必要がある: + - 13まで : `-lstdc++_libbacktrace` + - 14以降 : `-lstdc++exp` + diff --git a/reference/stacktrace/basic_stacktrace/at.md b/reference/stacktrace/basic_stacktrace/at.md index 8e34e8f89d..02909efa8b 100644 --- a/reference/stacktrace/basic_stacktrace/at.md +++ b/reference/stacktrace/basic_stacktrace/at.md @@ -42,9 +42,9 @@ int main() { * st.at[color ff0000] * current()[link current.md] -### 出力例 +### 出力例 (GCC) ``` -g() at main.cpp:5 + g() at /app/example.cpp:5 ``` @@ -54,5 +54,5 @@ g() at main.cpp:5 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? +- [GCC](/implementation.md#gcc): 12 - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/begin.md b/reference/stacktrace/basic_stacktrace/begin.md index 15fbe084f4..e123f76efe 100644 --- a/reference/stacktrace/basic_stacktrace/begin.md +++ b/reference/stacktrace/basic_stacktrace/begin.md @@ -27,7 +27,7 @@ void g() { std::stacktrace st = std::stacktrace::current(); std::for_each(st.begin(), st.end(), [](const std::stacktrace_entry& x) { std::cout << x << std::endl; - }): + }); } void f() { @@ -43,11 +43,15 @@ int main() { * current()[link current.md] * std::stacktrace_entry[link /reference/stacktrace/stacktrace_entry.md] -### 出力 +### 出力例 (GCC) ``` -g() at main.cpp:6 -f() at main.cpp:13 -main at main.cpp:17 + g() at /app/example.cpp:6 + f() at /app/example.cpp:13 +main at /app/example.cpp:17 + at :0 +__libc_start_main at :0 +_start at :0 + ``` @@ -57,5 +61,5 @@ main at main.cpp:17 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? +- [GCC](/implementation.md#gcc): 12 - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/cbegin.md b/reference/stacktrace/basic_stacktrace/cbegin.md index b6eb5b65f4..b93bfb1694 100644 --- a/reference/stacktrace/basic_stacktrace/cbegin.md +++ b/reference/stacktrace/basic_stacktrace/cbegin.md @@ -27,7 +27,7 @@ void g() { std::stacktrace st = std::stacktrace::current(); std::for_each(st.cbegin(), st.cend(), [](const std::stacktrace_entry& x) { std::cout << x << std::endl; - }): + }); } void f() { @@ -43,11 +43,15 @@ int main() { * current()[link current.md] * std::stacktrace_entry[link /reference/stacktrace/stacktrace_entry.md] -### 出力 +### 出力例 (GCC) ``` -g() at main.cpp:6 -f() at main.cpp:13 -main at main.cpp:17 + g() at /app/example.cpp:6 + f() at /app/example.cpp:13 +main at /app/example.cpp:17 + at :0 +__libc_start_main at :0 +_start at :0 + ``` @@ -57,5 +61,5 @@ main at main.cpp:17 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? +- [GCC](/implementation.md#gcc): 12 - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/cend.md b/reference/stacktrace/basic_stacktrace/cend.md index 911dc7afb9..22e8ae02e4 100644 --- a/reference/stacktrace/basic_stacktrace/cend.md +++ b/reference/stacktrace/basic_stacktrace/cend.md @@ -27,7 +27,7 @@ void g() { std::stacktrace st = std::stacktrace::current(); std::for_each(st.cbegin(), st.cend(), [](const std::stacktrace_entry& x) { std::cout << x << std::endl; - }): + }); } void f() { @@ -43,11 +43,15 @@ int main() { * current()[link current.md] * std::stacktrace_entry[link /reference/stacktrace/stacktrace_entry.md] -### 出力 +### 出力例 (GCC) ``` -g() at main.cpp:6 -f() at main.cpp:13 -main at main.cpp:17 + g() at /app/example.cpp:6 + f() at /app/example.cpp:13 +main at /app/example.cpp:17 + at :0 +__libc_start_main at :0 +_start at :0 + ``` @@ -57,5 +61,5 @@ main at main.cpp:17 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? +- [GCC](/implementation.md#gcc): 12 - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/crbegin.md b/reference/stacktrace/basic_stacktrace/crbegin.md index 2c7dc66376..14e964e4a8 100644 --- a/reference/stacktrace/basic_stacktrace/crbegin.md +++ b/reference/stacktrace/basic_stacktrace/crbegin.md @@ -30,7 +30,7 @@ void g() { std::stacktrace st = std::stacktrace::current(); std::for_each(st.crbegin(), st.crend(), [](const std::stacktrace_entry& x) { std::cout << x << std::endl; - }): + }); } void f() { @@ -46,11 +46,15 @@ int main() { * current()[link current.md] * std::stacktrace_entry[link /reference/stacktrace/stacktrace_entry.md] -### 出力 +### 出力例 (GCC) ``` -main at main.cpp:17 -f() at main.cpp:13 -g() at main.cpp:6 + +_start at :0 +__libc_start_main at :0 + at :0 +main at /app/example.cpp:17 + f() at /app/example.cpp:13 + g() at /app/example.cpp:6 ``` @@ -60,5 +64,5 @@ g() at main.cpp:6 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? +- [GCC](/implementation.md#gcc): 12 - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/crend.md b/reference/stacktrace/basic_stacktrace/crend.md index 35aee84446..b01ec1af1d 100644 --- a/reference/stacktrace/basic_stacktrace/crend.md +++ b/reference/stacktrace/basic_stacktrace/crend.md @@ -30,7 +30,7 @@ void g() { std::stacktrace st = std::stacktrace::current(); std::for_each(st.crbegin(), st.crend(), [](const std::stacktrace_entry& x) { std::cout << x << std::endl; - }): + }); } void f() { @@ -46,11 +46,15 @@ int main() { * current()[link current.md] * std::stacktrace_entry[link /reference/stacktrace/stacktrace_entry.md] -### 出力 +### 出力例 (GCC) ``` -main at main.cpp:17 -f() at main.cpp:13 -g() at main.cpp:6 + +_start at :0 +__libc_start_main at :0 + at :0 +main at /app/example.cpp:17 + f() at /app/example.cpp:13 + g() at /app/example.cpp:6 ``` @@ -60,5 +64,5 @@ g() at main.cpp:6 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? +- [GCC](/implementation.md#gcc): 12 - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/current.md b/reference/stacktrace/basic_stacktrace/current.md index c55d80f77f..adfb85b77f 100644 --- a/reference/stacktrace/basic_stacktrace/current.md +++ b/reference/stacktrace/basic_stacktrace/current.md @@ -67,11 +67,15 @@ int main() { ``` * current()[color ff0000] -#### 出力例 +#### 出力例 (GCC) ``` - 0# g() at main.cpp:5 - 1# f() at main.cpp:9 - 2# main at main.cpp:13 + 0# g() at /app/example.cpp:5 + 1# f() at /app/example.cpp:9 + 2# main at /app/example.cpp:13 + 3# at :0 + 4# __libc_start_main at :0 + 5# _start at :0 + 6# ``` ### 現在位置からN個を除いたスタックトレースを取得する @@ -93,10 +97,14 @@ int main() { ``` * current[color ff0000] -#### 出力例 +#### 出力例 (GCC) ``` - 0# f() at main.cpp:9 - 1# main at main.cpp:13 + 0# f() at /app/example.cpp:9 + 1# main at /app/example.cpp:13 + 2# at :0 + 3# __libc_start_main at :0 + 4# _start at :0 + 5# ``` ### 指定範囲のスタックトレースを取得する @@ -118,10 +126,10 @@ int main() { ``` * current[color ff0000] -#### 出力例 +#### 出力例 (GCC) ``` - 0# f() at main.cpp:9 - 1# main at main.cpp:13 + 0# f() at /app/example.cpp:9 + 1# main at /app/example.cpp:13 ``` @@ -131,5 +139,5 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? +- [GCC](/implementation.md#gcc): 12 - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/empty.md b/reference/stacktrace/basic_stacktrace/empty.md index 37b248853a..aa6314c8b4 100644 --- a/reference/stacktrace/basic_stacktrace/empty.md +++ b/reference/stacktrace/basic_stacktrace/empty.md @@ -52,5 +52,5 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? +- [GCC](/implementation.md#gcc): 12 - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/end.md b/reference/stacktrace/basic_stacktrace/end.md index c194a257d4..3b273a8038 100644 --- a/reference/stacktrace/basic_stacktrace/end.md +++ b/reference/stacktrace/basic_stacktrace/end.md @@ -27,7 +27,7 @@ void g() { std::stacktrace st = std::stacktrace::current(); std::for_each(st.begin(), st.end(), [](const std::stacktrace_entry& x) { std::cout << x << std::endl; - }): + }); } void f() { @@ -43,11 +43,15 @@ int main() { * current()[link current.md] * std::stacktrace_entry[link /reference/stacktrace/stacktrace_entry.md] -### 出力 +### 出力例 (GCC) ``` -g() at main.cpp:6 -f() at main.cpp:13 -main at main.cpp:17 + g() at /app/example.cpp:6 + f() at /app/example.cpp:13 +main at /app/example.cpp:17 + at :0 +__libc_start_main at :0 +_start at :0 + ``` @@ -57,5 +61,5 @@ main at main.cpp:17 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? +- [GCC](/implementation.md#gcc): 12 - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/get_allocator.md b/reference/stacktrace/basic_stacktrace/get_allocator.md index 15c2029f25..e6861adca1 100644 --- a/reference/stacktrace/basic_stacktrace/get_allocator.md +++ b/reference/stacktrace/basic_stacktrace/get_allocator.md @@ -43,5 +43,5 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? +- [GCC](/implementation.md#gcc): 12 - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/max_size.md b/reference/stacktrace/basic_stacktrace/max_size.md index f7224b35ea..979231d71f 100644 --- a/reference/stacktrace/basic_stacktrace/max_size.md +++ b/reference/stacktrace/basic_stacktrace/max_size.md @@ -43,3 +43,7 @@ int main() { - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + +### 備考 +- GCCでは14時点でコンパイルエラーになる + - [Bug 115063 - compilation error: `std::basic_stracktrace::max_size()`](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115063) diff --git a/reference/stacktrace/basic_stacktrace/op_assign.md b/reference/stacktrace/basic_stacktrace/op_assign.md index db9c6f0475..6a390f194c 100644 --- a/reference/stacktrace/basic_stacktrace/op_assign.md +++ b/reference/stacktrace/basic_stacktrace/op_assign.md @@ -54,9 +54,9 @@ int main() { ``` * current()[link current.md] -### 出力例 +### 出力例 (GCC) ``` -g() at main.cpp:5 + g() at /app/example.cpp:5 ``` @@ -66,5 +66,5 @@ g() at main.cpp:5 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? +- [GCC](/implementation.md#gcc): 12 - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/op_at.md b/reference/stacktrace/basic_stacktrace/op_at.md index 8b7d642cb1..357b2a94a1 100644 --- a/reference/stacktrace/basic_stacktrace/op_at.md +++ b/reference/stacktrace/basic_stacktrace/op_at.md @@ -46,9 +46,9 @@ int main() { * st[0][color ff0000] * current()[link current.md] -### 出力例 +### 出力例 (GCC) ``` -g() at main.cpp:5 + g() at /app/example.cpp:5 ``` @@ -58,5 +58,5 @@ g() at main.cpp:5 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? +- [GCC](/implementation.md#gcc): 12 - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/op_compare_3way.md b/reference/stacktrace/basic_stacktrace/op_compare_3way.md index f99cede2ed..542b1e5499 100644 --- a/reference/stacktrace/basic_stacktrace/op_compare_3way.md +++ b/reference/stacktrace/basic_stacktrace/op_compare_3way.md @@ -67,7 +67,7 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? +- [GCC](/implementation.md#gcc): 12 - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/op_constructor.md b/reference/stacktrace/basic_stacktrace/op_constructor.md index 9c44b68ee7..e078768020 100644 --- a/reference/stacktrace/basic_stacktrace/op_constructor.md +++ b/reference/stacktrace/basic_stacktrace/op_constructor.md @@ -103,5 +103,5 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? +- [GCC](/implementation.md#gcc): 12 - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/op_equal.md b/reference/stacktrace/basic_stacktrace/op_equal.md index e4038633f9..e9a6f4f239 100644 --- a/reference/stacktrace/basic_stacktrace/op_equal.md +++ b/reference/stacktrace/basic_stacktrace/op_equal.md @@ -63,7 +63,7 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? +- [GCC](/implementation.md#gcc): 12 - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/op_ostream.md b/reference/stacktrace/basic_stacktrace/op_ostream.md index aae9af1525..b6204faa52 100644 --- a/reference/stacktrace/basic_stacktrace/op_ostream.md +++ b/reference/stacktrace/basic_stacktrace/op_ostream.md @@ -45,11 +45,15 @@ int main() { ``` * current()[link current.md] -### 出力例 +### 出力例 (GCC) ``` - 0# g() at main.cpp:5 - 1# f() at main.cpp:9 - 2# main at main.cpp:13 + 0# g() at /app/example.cpp:5 + 1# f() at /app/example.cpp:9 + 2# main at /app/example.cpp:13 + 3# at :0 + 4# at :0 + 5# _start at :0 + 6# ``` @@ -59,5 +63,5 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? +- [GCC](/implementation.md#gcc): 12 - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/rbegin.md b/reference/stacktrace/basic_stacktrace/rbegin.md index dce03b134e..0272902e39 100644 --- a/reference/stacktrace/basic_stacktrace/rbegin.md +++ b/reference/stacktrace/basic_stacktrace/rbegin.md @@ -30,7 +30,7 @@ void g() { std::stacktrace st = std::stacktrace::current(); std::for_each(st.rbegin(), st.rend(), [](const std::stacktrace_entry& x) { std::cout << x << std::endl; - }): + }); } void f() { @@ -46,11 +46,15 @@ int main() { * current()[link current.md] * std::stacktrace_entry[link /reference/stacktrace/stacktrace_entry.md] -### 出力 +### 出力例 (GCC) ``` -main at main.cpp:17 -f() at main.cpp:13 -g() at main.cpp:6 + +_start at :0 + at :0 + at :0 +main at /app/example.cpp:17 + f() at /app/example.cpp:13 + g() at /app/example.cpp:6 ``` @@ -60,5 +64,5 @@ g() at main.cpp:6 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? +- [GCC](/implementation.md#gcc): 12 - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/rend.md b/reference/stacktrace/basic_stacktrace/rend.md index 0744d950ff..62f37c8eda 100644 --- a/reference/stacktrace/basic_stacktrace/rend.md +++ b/reference/stacktrace/basic_stacktrace/rend.md @@ -30,7 +30,7 @@ void g() { std::stacktrace st = std::stacktrace::current(); std::for_each(st.rbegin(), st.rend(), [](const std::stacktrace_entry& x) { std::cout << x << std::endl; - }): + }); } void f() { @@ -46,11 +46,15 @@ int main() { * current()[link current.md] * std::stacktrace_entry[link /reference/stacktrace/stacktrace_entry.md] -### 出力 +### 出力例 (GCC) ``` -main at main.cpp:17 -f() at main.cpp:13 -g() at main.cpp:6 + +_start at :0 + at :0 + at :0 +main at /app/example.cpp:17 + f() at /app/example.cpp:13 + g() at /app/example.cpp:6 ``` @@ -60,5 +64,5 @@ g() at main.cpp:6 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? +- [GCC](/implementation.md#gcc): 12 - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/size.md b/reference/stacktrace/basic_stacktrace/size.md index 1d0adafb24..07476a2031 100644 --- a/reference/stacktrace/basic_stacktrace/size.md +++ b/reference/stacktrace/basic_stacktrace/size.md @@ -40,12 +40,16 @@ int main() { * trace.size()[color ff0000] * current()[link current.md] -#### 出力例 +#### 出力例 (GCC) ``` -3 - 0# g() at main.cpp:5 - 1# f() at main.cpp:11 - 2# main at main.cpp:15 +7 + 0# g() at /app/example.cpp:5 + 1# f() at /app/example.cpp:11 + 2# main at /app/example.cpp:15 + 3# at :0 + 4# at :0 + 5# _start at :0 + 6# ``` @@ -71,10 +75,10 @@ int main() { * trace.size()[color ff0000] * current[link current.md] -#### 出力例 +#### 出力例 (GCC) ``` 1 - 0# f() at main.cpp:11 + 0# f() at /app/example.cpp:11 ``` @@ -84,5 +88,5 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? +- [GCC](/implementation.md#gcc): 12 - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/swap.md b/reference/stacktrace/basic_stacktrace/swap.md index 46ff167d35..da8d0404b3 100644 --- a/reference/stacktrace/basic_stacktrace/swap.md +++ b/reference/stacktrace/basic_stacktrace/swap.md @@ -46,11 +46,15 @@ int main() { * a.swap[color ff0000] * current()[link current.md] -### 出力例 +### 出力例 (GCC) ``` - 0# g() at main.cpp:6 - 1# f() at main.cpp:13 - 2# main at main.cpp:17 + 0# g() at /app/example.cpp:6 + 1# f() at /app/example.cpp:13 + 2# main at /app/example.cpp:17 + 3# at :0 + 4# at :0 + 5# _start at :0 + 6# ``` @@ -60,5 +64,5 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? +- [GCC](/implementation.md#gcc): 12 - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/swap_free.md b/reference/stacktrace/basic_stacktrace/swap_free.md index 24797c8de2..c63d6cf35c 100644 --- a/reference/stacktrace/basic_stacktrace/swap_free.md +++ b/reference/stacktrace/basic_stacktrace/swap_free.md @@ -51,11 +51,15 @@ int main() { * std::swap[color ff0000] * current()[link current.md] -### 出力例 +### 出力例 (GCC) ``` - 0# g() at main.cpp:6 - 1# f() at main.cpp:13 - 2# main at main.cpp:17 + 0# g() at /app/example.cpp:6 + 1# f() at /app/example.cpp:13 + 2# main at /app/example.cpp:17 + 3# at :0 + 4# at :0 + 5# _start at :0 + 6# ``` @@ -65,5 +69,5 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? +- [GCC](/implementation.md#gcc): 12 - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/to_string.md b/reference/stacktrace/basic_stacktrace/to_string.md index ad35d05a02..130a114755 100644 --- a/reference/stacktrace/basic_stacktrace/to_string.md +++ b/reference/stacktrace/basic_stacktrace/to_string.md @@ -31,7 +31,7 @@ namespace std { #include void g() { - std::string trace = std::stacktrace::current().to_string(); + std::string trace = std::to_string(std::stacktrace::current()); std::cout << trace << std::endl; } @@ -43,14 +43,18 @@ int main() { f(); } ``` -* to_string()[color ff0000] +* std::to_string[color ff0000] * current()[link current.md] -### 出力例 +### 出力例 (GCC) ``` - 0# g() at main.cpp:5 - 1# f() at main.cpp:10 - 2# main at main.cpp:14 + 0# g() at /app/example.cpp:5 + 1# f() at /app/example.cpp:10 + 2# main at /app/example.cpp:14 + 3# at :0 + 4# at :0 + 5# _start at :0 + 6# ``` @@ -60,5 +64,5 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? +- [GCC](/implementation.md#gcc): 12 - [Visual C++](/implementation.md#visual_cpp): ?? From e349d0e6a3354108e9518857d4d11f4c784c7966 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 13 May 2024 17:54:08 +0900 Subject: [PATCH 0892/3948] =?UTF-8?q?=E3=81=AEbegin=20/=20end=20?= =?UTF-8?q?:=20=E3=83=A1=E3=83=B3=E3=83=90=E9=96=A2=E6=95=B0=E7=89=88?= =?UTF-8?q?=E3=81=A8=E3=81=AE=E3=81=A1=E3=81=8C=E3=81=84=E3=82=92=E8=A8=98?= =?UTF-8?q?=E8=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/begin.md | 6 ++++++ reference/iterator/end.md | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/reference/iterator/begin.md b/reference/iterator/begin.md index 75d79887c3..e866c0373a 100644 --- a/reference/iterator/begin.md +++ b/reference/iterator/begin.md @@ -29,6 +29,12 @@ namespace std { ## 概要 範囲から先頭要素へのイテレータを取得する。 +この関数は、メンバ関数版の`begin()`とちがい、組み込み配列に対しても使用できる。 + +- (1) : 非`const`のコンテナの、先頭要素へのイテレータを取得する +- (2) : `const`のコンテナの、先頭要素へのイテレータを取得する +- (3) : 組み込み配列の、先頭要素へのポインタを取得する + ## 戻り値 - (1) : `return c.begin();` diff --git a/reference/iterator/end.md b/reference/iterator/end.md index 82ed3f6b8c..d18b72256d 100644 --- a/reference/iterator/end.md +++ b/reference/iterator/end.md @@ -29,6 +29,12 @@ namespace std { ## 概要 範囲から、最後尾要素の次を指すイテレータを取得する。 +この関数は、メンバ関数版の`end()`とちがい、組み込み配列に対しても使用できる。 + +- (1) : 非`const`のコンテナの、末尾要素の次を指すイテレータを取得する +- (2) : `const`のコンテナの、末尾要素の次を指すイテレータを取得する +- (3) : 組み込み配列の、末尾要素の次を指すポインタを取得する + ## 戻り値 - (1) : `return c.end();` From 56e4f9b24d73d5d0b111b5a5a6e6768edc5c5d5e Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 13 May 2024 18:30:36 +0900 Subject: [PATCH 0893/3948] =?UTF-8?q?stacktrace=5Fentry=20:=20description,?= =?UTF-8?q?=20source=5Ffile,=20source=5Fline=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/stacktrace/stacktrace_entry.md | 20 +++--- .../stacktrace_entry/description.md | 62 ++++++++++++++++++ .../stacktrace_entry/source_file.md | 62 ++++++++++++++++++ .../stacktrace_entry/source_line.md | 64 +++++++++++++++++++ 4 files changed, 198 insertions(+), 10 deletions(-) create mode 100644 reference/stacktrace/stacktrace_entry/description.md create mode 100644 reference/stacktrace/stacktrace_entry/source_file.md create mode 100644 reference/stacktrace/stacktrace_entry/source_line.md diff --git a/reference/stacktrace/stacktrace_entry.md b/reference/stacktrace/stacktrace_entry.md index 70cfb395c2..eeb157aa7d 100644 --- a/reference/stacktrace/stacktrace_entry.md +++ b/reference/stacktrace/stacktrace_entry.md @@ -36,9 +36,9 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`description`](stacktrace_entry/description.md.nolink) | このオブジェクトを説明する文字列を取得する | C++23 | -| [`source_file`](stacktrace_entry/source_file.md.nolink) | ソースファイル名を取得する | C++23 | -| [`source_line`](stacktrace_entry/source_line.md.nolink) | 行番号を取得する | C++23 | +| [`description`](stacktrace_entry/description.md) | このオブジェクトを説明する文字列を取得する | C++23 | +| [`source_file`](stacktrace_entry/source_file.md) | ソースファイル名を取得する | C++23 | +| [`source_line`](stacktrace_entry/source_line.md) | 行番号を取得する | C++23 | ## メンバ型 @@ -109,14 +109,14 @@ int main() { * std::stacktrace_entry[color ff0000] * std::stacktrace[link basic_stacktrace.md] * current[link basic_stacktrace/current.md] -* entry.description()[link stacktrace_entry/description.md.nolink] -* entry.source_file()[link stacktrace_entry/source_file.md.nolink] -* entry.source_line()[link stacktrace_entry/source_line.md.nolink] +* entry.description()[link stacktrace_entry/description.md] +* entry.source_file()[link stacktrace_entry/source_file.md] +* entry.source_line()[link stacktrace_entry/source_line.md] -### 出力例 +### 出力例 (GCC) ``` -g() at main.cpp:5 -main.cpp +g() +/app/example.cpp 5 ``` @@ -126,5 +126,5 @@ main.cpp ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? +- [GCC](/implementation.md#gcc): 12 - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/stacktrace_entry/description.md b/reference/stacktrace/stacktrace_entry/description.md new file mode 100644 index 0000000000..a23b8ba6a9 --- /dev/null +++ b/reference/stacktrace/stacktrace_entry/description.md @@ -0,0 +1,62 @@ +# description +* stacktrace[meta header] +* std[meta namespace] +* stacktrace_entry[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +string description() const; // (1) C++23 +``` +* string[link /reference/string/basic_string.md] + +## 概要 +このオブジェクトを説明する文字列を取得する。 + + +## 戻り値 +`*this`で表される評価の説明、または空文字列を返す。 + + +## 例外 +内部のデータ構造、または結果文字列のためのメモリ確保ができない場合、[`std::bad_alloc`](/reference/new/bad_alloc.md)例外を送出する。 + + +## 例 +```cpp example +#include +#include + +void g() { + std::stacktrace st = std::stacktrace::current(); + std::stacktrace_entry entry = st[0]; + + std::cout << entry.description() << std::endl; +} + +void f() { + g(); +} + +int main() { + f(); +} +``` +* entry.source_file()[color ff0000] +* std::stacktrace[link /reference/stacktrace/basic_stacktrace.md] +* current[link /reference/stacktrace/basic_stacktrace/current.md] + +### 出力例 (GCC) +``` +g() +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 12 +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/stacktrace_entry/source_file.md b/reference/stacktrace/stacktrace_entry/source_file.md new file mode 100644 index 0000000000..b2951b1f7f --- /dev/null +++ b/reference/stacktrace/stacktrace_entry/source_file.md @@ -0,0 +1,62 @@ +# source_file +* stacktrace[meta header] +* std[meta namespace] +* stacktrace_entry[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +string source_file() const; // (1) C++23 +``` +* string[link /reference/string/basic_string.md] + +## 概要 +ソースファイル名を取得する。 + + +## 戻り値 +`*this`で表される評価の式または文を字句的に含むソースファイルの推定または実際の名前、または空文字列を返す。 + + +## 例外 +内部のデータ構造、または結果文字列のためのメモリ確保ができない場合、[`std::bad_alloc`](/reference/new/bad_alloc.md)例外を送出する。 + + +## 例 +```cpp example +#include +#include + +void g() { + std::stacktrace st = std::stacktrace::current(); + std::stacktrace_entry entry = st[0]; + + std::cout << entry.source_file() << std::endl; +} + +void f() { + g(); +} + +int main() { + f(); +} +``` +* entry.source_file()[color ff0000] +* std::stacktrace[link /reference/stacktrace/basic_stacktrace.md] +* current[link /reference/stacktrace/basic_stacktrace/current.md] + +### 出力例 (GCC) +``` +/app/example.cpp +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 12 +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/stacktrace_entry/source_line.md b/reference/stacktrace/stacktrace_entry/source_line.md new file mode 100644 index 0000000000..0ddcb1d55c --- /dev/null +++ b/reference/stacktrace/stacktrace_entry/source_line.md @@ -0,0 +1,64 @@ +# source_line +* stacktrace[meta header] +* std[meta namespace] +* stacktrace_entry[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +uint_least32_t source_line() const; // (1) C++23 +``` +* uint_least32_t[link /reference/cstdint/uint_least32_t.md] + +## 概要 +行番号を取得する。 + + +## 戻り値 +`*this`で表される評価に字句的に関連する`0`または`1`ベースの行番号を返す。 + +[`source_file()`](source_file.md)が推定のソースファイル名を返す場合は推定の行番号を返し、[`source_file`](source_file.md)が実際のソースファイル名を返す場合は実際の行番号を返す。 + + +## 例外 +内部のデータ構造のメモリ確保ができない場合、[`std::bad_alloc`](/reference/new/bad_alloc.md)例外を送出する。 + + +## 例 +```cpp example +#include +#include + +void g() { + std::stacktrace st = std::stacktrace::current(); + std::stacktrace_entry entry = st[0]; + + std::cout << entry.source_line() << std::endl; +} + +void f() { + g(); +} + +int main() { + f(); +} +``` +* entry.source_file()[color ff0000] +* std::stacktrace[link /reference/stacktrace/basic_stacktrace.md] +* current[link /reference/stacktrace/basic_stacktrace/current.md] + +### 出力例 (GCC) +``` +5 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 12 +- [Visual C++](/implementation.md#visual_cpp): ?? From b22d84d393aa1deb84ba6bc3566dbc9cc8c40389 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 13 May 2024 18:36:43 +0900 Subject: [PATCH 0894/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE?= =?UTF-8?q?=E9=A3=BE=E3=81=AE=E3=83=9F=E3=82=B9=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/stacktrace/stacktrace_entry/description.md | 2 +- reference/stacktrace/stacktrace_entry/source_line.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/stacktrace/stacktrace_entry/description.md b/reference/stacktrace/stacktrace_entry/description.md index a23b8ba6a9..cdea0fe851 100644 --- a/reference/stacktrace/stacktrace_entry/description.md +++ b/reference/stacktrace/stacktrace_entry/description.md @@ -42,7 +42,7 @@ int main() { f(); } ``` -* entry.source_file()[color ff0000] +* entry.description()[color ff0000] * std::stacktrace[link /reference/stacktrace/basic_stacktrace.md] * current[link /reference/stacktrace/basic_stacktrace/current.md] diff --git a/reference/stacktrace/stacktrace_entry/source_line.md b/reference/stacktrace/stacktrace_entry/source_line.md index 0ddcb1d55c..c5278df5ba 100644 --- a/reference/stacktrace/stacktrace_entry/source_line.md +++ b/reference/stacktrace/stacktrace_entry/source_line.md @@ -44,7 +44,7 @@ int main() { f(); } ``` -* entry.source_file()[color ff0000] +* entry.source_line()[color ff0000] * std::stacktrace[link /reference/stacktrace/basic_stacktrace.md] * current[link /reference/stacktrace/basic_stacktrace/current.md] From 53ab5e996db66163a11ae4856253a7b8fa51dbec Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 13 May 2024 18:57:35 +0900 Subject: [PATCH 0895/3948] =?UTF-8?q?stacktrace=5Fentry=20:=20native=5Fhan?= =?UTF-8?q?dle=E3=81=A8operator=20bool=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/stacktrace/stacktrace_entry.md | 4 +- .../stacktrace_entry/native_handle.md | 65 +++++++++++++++++++ .../stacktrace/stacktrace_entry/op_bool.md | 61 +++++++++++++++++ 3 files changed, 128 insertions(+), 2 deletions(-) create mode 100644 reference/stacktrace/stacktrace_entry/native_handle.md create mode 100644 reference/stacktrace/stacktrace_entry/op_bool.md diff --git a/reference/stacktrace/stacktrace_entry.md b/reference/stacktrace/stacktrace_entry.md index eeb157aa7d..8412dcdbc9 100644 --- a/reference/stacktrace/stacktrace_entry.md +++ b/reference/stacktrace/stacktrace_entry.md @@ -28,8 +28,8 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`native_handle`](stacktrace_entry/native_handle.md.nolink) | ハンドルを取得する | C++23 | -| [`operator bool`](stacktrace_entry/op_bool.md.nolink) | 空でないかを判定する | C++23 | +| [`native_handle`](stacktrace_entry/native_handle.md) | ハンドルを取得する | C++23 | +| [`operator bool`](stacktrace_entry/op_bool.md) | 空でないかを判定する | C++23 | ### 照会 diff --git a/reference/stacktrace/stacktrace_entry/native_handle.md b/reference/stacktrace/stacktrace_entry/native_handle.md new file mode 100644 index 0000000000..d5b7f91cff --- /dev/null +++ b/reference/stacktrace/stacktrace_entry/native_handle.md @@ -0,0 +1,65 @@ +# native_handle +* stacktrace[meta header] +* std[meta namespace] +* stacktrace_entry[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr native_handle_type native_handle() const noexcept; // (1) C++23 +``` + +## 概要 +ハンドルを取得する。 + + +## 戻り値 +実装定義のハンドルを返す。 + + +## 備考 +- 変更されていない`stacktrace_entry`オブジェクトに対してこの関数を連続して呼び出すと、同じ値が返される +- GCCでは、libstdc++の内部ライブラリ向けのポインタを整数値型[`std::uintptr_t`](/reference/cstdint/uintptr_t.md)の変換した型になっている + - `__glibcxx_backtrace_pcinfo()`など、内部ライブラリ用であるため、ユーザーがハンドルを便利に使えるようにはなっていない +- MSVCでも内部ライブラリ向けの`void*`型ポインタになっている + - こちらも内部ライブラリ用であるため、ユーザーがハンドルを便利に使えるようにはなっていない + + +## 例 +```cpp example +#include +#include + +void g() { + std::stacktrace st = std::stacktrace::current(); + std::stacktrace_entry entry = st[0]; + + std::cout << entry.native_handle() << std::endl; +} + +void f() { + g(); +} + +int main() { + f(); +} +``` +* entry.native_handle()[color ff0000] +* std::stacktrace[link /reference/stacktrace/basic_stacktrace.md] +* current[link /reference/stacktrace/basic_stacktrace/current.md] + +### 出力例 (GCC) +``` +4199037 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 12 +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/stacktrace_entry/op_bool.md b/reference/stacktrace/stacktrace_entry/op_bool.md new file mode 100644 index 0000000000..28a6af0b36 --- /dev/null +++ b/reference/stacktrace/stacktrace_entry/op_bool.md @@ -0,0 +1,61 @@ +# operator bool +* stacktrace[meta header] +* std[meta namespace] +* stacktrace_entry[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr explicit operator bool() const noexcept; // (1) C++23 +``` + +## 概要 +`stacktrace_entry`が空でないかを判定する。 + + +## 戻り値 +`*this`が空である場合のみ`false`を返す。 + + +## 例 +```cpp example +#include +#include + +void g() { + std::stacktrace st = std::stacktrace::current(); + std::stacktrace_entry entry = st[0]; + + if (entry) { + std::cout << "not empty" << std::endl; + } + else { + std::cout << "empty" << std::endl; + } +} + +void f() { + g(); +} + +int main() { + f(); +} +``` +* std::stacktrace[link /reference/stacktrace/basic_stacktrace.md] +* current[link /reference/stacktrace/basic_stacktrace/current.md] + +### 出力 +``` +not empty +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 12 +- [Visual C++](/implementation.md#visual_cpp): ?? From d6df9bd69cac139c32c816f9c33389b017405276 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 14 May 2024 10:41:57 +0900 Subject: [PATCH 0896/3948] =?UTF-8?q?print=E9=96=A2=E4=BF=82=E3=81=AE?= =?UTF-8?q?=E5=8B=95=E4=BD=9C=E7=A2=BA=E8=AA=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ostream/print.md | 6 +++--- reference/ostream/println.md | 6 +++--- reference/ostream/vprint_nonunicode.md | 6 +++--- reference/ostream/vprint_unicode.md | 6 +++--- reference/print/print.md | 6 +++--- reference/print/println.md | 6 +++--- reference/print/vprint_nonunicode.md | 6 +++--- reference/print/vprint_unicode.md | 6 +++--- 8 files changed, 24 insertions(+), 24 deletions(-) diff --git a/reference/ostream/print.md b/reference/ostream/print.md index b0fe8d5cf5..8b0f87013b 100644 --- a/reference/ostream/print.md +++ b/reference/ostream/print.md @@ -94,10 +94,10 @@ Hello 42 World - C++23 ### 処理系 -- [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? +- [Clang](/implementation.md#clang): 19 +- [GCC](/implementation.md#gcc): 14 - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 ## 関連項目 diff --git a/reference/ostream/println.md b/reference/ostream/println.md index 3b9834ae44..d71760d286 100644 --- a/reference/ostream/println.md +++ b/reference/ostream/println.md @@ -62,10 +62,10 @@ Hello 42 World - C++23 ### 処理系 -- [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? +- [Clang](/implementation.md#clang): 19 +- [GCC](/implementation.md#gcc): 14 - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 ## 関連項目 diff --git a/reference/ostream/vprint_nonunicode.md b/reference/ostream/vprint_nonunicode.md index a2894b7f53..389bae1941 100644 --- a/reference/ostream/vprint_nonunicode.md +++ b/reference/ostream/vprint_nonunicode.md @@ -41,10 +41,10 @@ namespace std { - C++23 ### 処理系 -- [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? +- [Clang](/implementation.md#clang): 19 +- [GCC](/implementation.md#gcc): 14 - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 ## 関連項目 diff --git a/reference/ostream/vprint_unicode.md b/reference/ostream/vprint_unicode.md index ecc6b6f575..28b93175b9 100644 --- a/reference/ostream/vprint_unicode.md +++ b/reference/ostream/vprint_unicode.md @@ -53,10 +53,10 @@ namespace std { - C++23 ### 処理系 -- [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? +- [Clang](/implementation.md#clang): 19 +- [GCC](/implementation.md#gcc): 14 - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 ## 関連項目 diff --git a/reference/print/print.md b/reference/print/print.md index d4f5dea236..09e971a498 100644 --- a/reference/print/print.md +++ b/reference/print/print.md @@ -132,10 +132,10 @@ Hello 42 World - C++23 ### 処理系 -- [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? +- [Clang](/implementation.md#clang): 19 +- [GCC](/implementation.md#gcc): 14 - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 ## 関連項目 diff --git a/reference/print/println.md b/reference/print/println.md index 27f0d8dd28..9c005c6f00 100644 --- a/reference/print/println.md +++ b/reference/print/println.md @@ -100,10 +100,10 @@ Hello 42 World - C++23 ### 処理系 -- [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? +- [Clang](/implementation.md#clang): 19 +- [GCC](/implementation.md#gcc): 14 - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 ## 関連項目 diff --git a/reference/print/vprint_nonunicode.md b/reference/print/vprint_nonunicode.md index d4d6fe31f2..2d86cb036a 100644 --- a/reference/print/vprint_nonunicode.md +++ b/reference/print/vprint_nonunicode.md @@ -51,10 +51,10 @@ namespace std { - C++23 ### 処理系 -- [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? +- [Clang](/implementation.md#clang): 19 +- [GCC](/implementation.md#gcc): 14 - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 ## 関連項目 diff --git a/reference/print/vprint_unicode.md b/reference/print/vprint_unicode.md index bf5736b923..54d6984d39 100644 --- a/reference/print/vprint_unicode.md +++ b/reference/print/vprint_unicode.md @@ -66,10 +66,10 @@ namespace std { - C++23 ### 処理系 -- [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? +- [Clang](/implementation.md#clang): 19 +- [GCC](/implementation.md#gcc): 14 - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 ## 関連項目 From 92d7ba8fbc8ae96827a17cdee0e5f671554ebfa7 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 14 May 2024 11:07:51 +0900 Subject: [PATCH 0897/3948] =?UTF-8?q?print/println=20:=20stdout=E3=81=AE?= =?UTF-8?q?=E4=BE=8B=E3=82=92=E6=94=B9=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/print/print.md | 9 +++++---- reference/print/println.md | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/reference/print/print.md b/reference/print/print.md index 09e971a498..d23f0e61c3 100644 --- a/reference/print/print.md +++ b/reference/print/print.md @@ -109,22 +109,23 @@ Hello 42 World ### モジュールをインポートする例 ```cpp example import std; -import std.compat; +#include int main() { - std::print("Hello {} World\n", 42); // OK + std::print("Hello {} World\n", 42); // stdout / stderrはマクロとして定義される。 // モジュールはマクロをエクスポートしないので、 - // stdout / stderrは使用できない - // std::print(stdout, "Hello {} World\n", 42); // エラー!stdoutが見つからない + // stdout / stderrを使用する場合はをインクルードする必要がある + std::println(stdout, "Hello {} World\n", 42); } ``` #### 出力 ``` Hello 42 World +Hello 42 World ``` ## バージョン diff --git a/reference/print/println.md b/reference/print/println.md index 9c005c6f00..969973215c 100644 --- a/reference/print/println.md +++ b/reference/print/println.md @@ -77,22 +77,23 @@ Hello 42 World ### モジュールをインポートする例 ```cpp example import std; -import std.compat; +#include int main() { - std::println("Hello {} World", 42); // OK + std::println("Hello {} World", 42); // stdout / stderrはマクロとして定義される。 // モジュールはマクロをエクスポートしないので、 - // stdout / stderrは使用できない - // std::println(stdout, "Hello {} World", 42); // エラー!stdoutが見つからない + // stdout / stderrを使用する場合はをインクルードする必要がある + std::println(stdout, "Hello {} World", 42); } ``` #### 出力 ``` Hello 42 World +Hello 42 World ``` ## バージョン From bdc9e06be50e4d7cd0b515219a34d3716b318eea Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 14 May 2024 11:31:44 +0900 Subject: [PATCH 0898/3948] =?UTF-8?q?stacktrace=5Fentry=E3=81=AE=E3=82=AF?= =?UTF-8?q?=E3=82=A8=E3=83=AA=E9=96=A2=E6=95=B0=20:=20=E5=82=99=E8=80=83?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/stacktrace/stacktrace_entry/description.md | 4 ++++ reference/stacktrace/stacktrace_entry/source_file.md | 4 ++++ reference/stacktrace/stacktrace_entry/source_line.md | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/reference/stacktrace/stacktrace_entry/description.md b/reference/stacktrace/stacktrace_entry/description.md index cdea0fe851..df22c7b737 100644 --- a/reference/stacktrace/stacktrace_entry/description.md +++ b/reference/stacktrace/stacktrace_entry/description.md @@ -22,6 +22,10 @@ string description() const; // (1) C++23 内部のデータ構造、または結果文字列のためのメモリ確保ができない場合、[`std::bad_alloc`](/reference/new/bad_alloc.md)例外を送出する。 +## 備考 +- この関数はメモリ確保以外のエラーを「利用可能な情報がない」ものとして扱い、その場合は例外を送出しない + + ## 例 ```cpp example #include diff --git a/reference/stacktrace/stacktrace_entry/source_file.md b/reference/stacktrace/stacktrace_entry/source_file.md index b2951b1f7f..7488b24293 100644 --- a/reference/stacktrace/stacktrace_entry/source_file.md +++ b/reference/stacktrace/stacktrace_entry/source_file.md @@ -22,6 +22,10 @@ string source_file() const; // (1) C++23 内部のデータ構造、または結果文字列のためのメモリ確保ができない場合、[`std::bad_alloc`](/reference/new/bad_alloc.md)例外を送出する。 +## 備考 +- この関数はメモリ確保以外のエラーを「利用可能な情報がない」ものとして扱い、その場合は例外を送出しない + + ## 例 ```cpp example #include diff --git a/reference/stacktrace/stacktrace_entry/source_line.md b/reference/stacktrace/stacktrace_entry/source_line.md index c5278df5ba..d6a9d62e75 100644 --- a/reference/stacktrace/stacktrace_entry/source_line.md +++ b/reference/stacktrace/stacktrace_entry/source_line.md @@ -24,6 +24,10 @@ uint_least32_t source_line() const; // (1) C++23 内部のデータ構造のメモリ確保ができない場合、[`std::bad_alloc`](/reference/new/bad_alloc.md)例外を送出する。 +## 備考 +- この関数はメモリ確保以外のエラーを「利用可能な情報がない」ものとして扱い、その場合は例外を送出しない + + ## 例 ```cpp example #include From 8eb6a1e6b50a53376170399e1e9a45de0fca0214 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 14 May 2024 12:59:29 +0900 Subject: [PATCH 0899/3948] =?UTF-8?q?C++26=E5=AF=BE=E5=BF=9C=E7=8A=B6?= =?UTF-8?q?=E6=B3=81=20:=20libc++=E3=81=AE=E6=96=87=E5=AD=97=E5=88=97?= =?UTF-8?q?=E3=83=95=E3=82=A9=E3=83=BC=E3=83=9E=E3=83=83=E3=83=88=E9=96=A2?= =?UTF-8?q?=E4=BF=82=E3=81=AE=E7=8A=B6=E6=B3=81=E3=83=9A=E3=83=BC=E3=82=B8?= =?UTF-8?q?=E3=82=92=E5=8F=82=E7=85=A7=E3=81=A8=E3=81=97=E3=81=A6=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/implementation-status.md b/implementation-status.md index cef1f0e7fb..3cd6844e0e 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -310,7 +310,9 @@ 各処理系のC++26実装状況ページ: - GCC: [C++26 Support in GCC](https://gcc.gnu.org/projects/cxx-status.html#cxx26) -- Clang: [C++2c implementation status](https://clang.llvm.org/cxx_status.html#cxx26) +- Clang: + - [C++2c implementation status](https://clang.llvm.org/cxx_status.html#cxx26) + - [libc++ Format Status](https://libcxx.llvm.org/Status/Format.html) - Visual C++ (MSVC): - [Change log](https://github.com/microsoft/STL/wiki/Changelog) From 1522cffa6522fbf69a64b0afc6602b0ff74bd481 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 14 May 2024 13:00:46 +0900 Subject: [PATCH 0900/3948] Update user-generated_static_assert_messages.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `std::format()`の`constexpr`対応はまだ --- lang/cpp26/user-generated_static_assert_messages.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp26/user-generated_static_assert_messages.md b/lang/cpp26/user-generated_static_assert_messages.md index 576d51655c..e05ce729d2 100644 --- a/lang/cpp26/user-generated_static_assert_messages.md +++ b/lang/cpp26/user-generated_static_assert_messages.md @@ -4,7 +4,7 @@ ## 概要 C++26では、[`static_assert`](/lang/cpp11/static_assert.md)に指定する表明失敗時の診断メッセージとして、文字列リテラルだけでなくユーザー定義型の文字列オブジェクトも指定できるようになる。 -例として、[`std::format()`](/reference/format/format.md)関数によって作られた[`std::string`](/reference/string/basic_string.md)オブジェクトも診断メッセージとして使用できる。 +例えば、将来的に[`std::format()`](/reference/format/format.md)関数が`constexpr`対応した場合、それによって作られた[`std::string`](/reference/string/basic_string.md)オブジェクトを診断メッセージとして使用できる。 ```cpp example #include From 29081528d7c6ff6087cc1ed28f3bd04a9ec0c515 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 14 May 2024 13:55:20 +0900 Subject: [PATCH 0901/3948] =?UTF-8?q?stacktrace=5Fentry=20:=20=E6=AE=8B?= =?UTF-8?q?=E3=82=8A=E3=81=AE=E3=83=A1=E3=83=B3=E3=83=90=E9=96=A2=E6=95=B0?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/stacktrace/stacktrace_entry.md | 12 ++-- .../stacktrace_entry/op_constructor.md | 33 +++++++++ .../stacktrace/stacktrace_entry/op_equal.md | 67 +++++++++++++++++++ .../stacktrace/stacktrace_entry/op_ostream.md | 62 +++++++++++++++++ .../stacktrace/stacktrace_entry/to_string.md | 62 +++++++++++++++++ 5 files changed, 230 insertions(+), 6 deletions(-) create mode 100644 reference/stacktrace/stacktrace_entry/op_constructor.md create mode 100644 reference/stacktrace/stacktrace_entry/op_equal.md create mode 100644 reference/stacktrace/stacktrace_entry/op_ostream.md create mode 100644 reference/stacktrace/stacktrace_entry/to_string.md diff --git a/reference/stacktrace/stacktrace_entry.md b/reference/stacktrace/stacktrace_entry.md index 8412dcdbc9..7f419f5cf6 100644 --- a/reference/stacktrace/stacktrace_entry.md +++ b/reference/stacktrace/stacktrace_entry.md @@ -19,9 +19,9 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`(constructor)`](stacktrace_entry/op_constructor.md.nolink) | コンストラクタ | C++23 | +| [`(constructor)`](stacktrace_entry/op_constructor.md) | コンストラクタ | C++23 | | `~stacktrace_entry();` | デストラクタ | C++23 | -| [`operator=`](stacktrace_entry/op_assign.md.nolink) | 代入演算子 | C++23 | +| `constexpr stacktrace_entry& operator=(const stacktrace_entry& other) noexcept;` | 代入演算子 | C++23 | ### 観測 @@ -53,23 +53,23 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`operator<<`](stacktrace_entry/op_ostream.md.nolink) | 出力ストリームに出力する | C++23 | +| [`operator<<`](stacktrace_entry/op_ostream.md) | 出力ストリームに出力する | C++23 | ### 文字列への変換 | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`to_string`](stacktrace_entry/to_string.md.nolink) | 文字列に変換する | C++23 | +| [`to_string`](stacktrace_entry/to_string.md) | 文字列に変換する | C++23 | ### 比較演算子 | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`operator==`](stacktrace_entry/op_equal.md.nolink) | 等値比較を行う | C++23 | +| [`operator==`](stacktrace_entry/op_equal.md) | 等値比較を行う | C++23 | | `bool operator!=(const stacktrace_entry&, const stacktrace_entry&) noexcept;` | 非等値比較を行う (`==`により使用可能) | C++23 | -| [`operator<=>`](stacktrace_entry/op_compare_3way.md.nolink) | 三方比較を行う | C++23 | +| `friend constexpr strong_ordering operator<=>(const stacktrace_entry& x, const stacktrace_entry& y) noexcept;` | 三方比較を行う | C++23 | | `strong_ordering operator<(const stacktrace_entry&, const stacktrace_entry&) noexcept;` | 左辺が右辺より小さいかを判定する (`<=>`により使用可能) | C++23 | | `strong_ordering operator<=(const stacktrace_entry&, const stacktrace_entry&) noexcept;` | 左辺が右辺以下かを判定する (`<=>`により使用可能) | C++23 | | `strong_ordering operator>(const stacktrace_entry&, const stacktrace_entry&) noexcept;` | 左辺が右辺より大きいかを判定する (`<=>`により使用可能) | C++23 | diff --git a/reference/stacktrace/stacktrace_entry/op_constructor.md b/reference/stacktrace/stacktrace_entry/op_constructor.md new file mode 100644 index 0000000000..7780923e21 --- /dev/null +++ b/reference/stacktrace/stacktrace_entry/op_constructor.md @@ -0,0 +1,33 @@ +# コンストラクタ +* stacktrace[meta header] +* std[meta namespace] +* stacktrace_entry[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr stacktrace_entry() noexcept; // (1) C++23 + +constexpr +stacktrace_entry(const stacktrace_entry& other) noexcept; // (2) C++23 +``` + +## 概要 +`stacktrace_entry`オブジェクトを構築する。 + +- (1) : デフォルト構築 +- (2) : コピー構築 + + +## 事後条件 +- (1) : `*this`が空になること + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 12 +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/stacktrace_entry/op_equal.md b/reference/stacktrace/stacktrace_entry/op_equal.md new file mode 100644 index 0000000000..5d29430fa0 --- /dev/null +++ b/reference/stacktrace/stacktrace_entry/op_equal.md @@ -0,0 +1,67 @@ +# operator== +* stacktrace[meta header] +* std[meta namespace] +* stacktrace_entry[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +friend bool operator==(const stacktrace_entry& x, + const stacktrace_entry& y) noexcept; +``` + +## 概要 +`stacktrace_entry`同士の等値比較を行う。 + + +## 戻り値 +`x`と`y`が同じスタックトレースエントリを表すか、両方が空の場合のみ`true`を返す。 + + +## 備考 +- この演算子により、`operator!=`が使用可能になる + + +## 例 +```cpp example +#include +#include + +void g() { + std::stacktrace st = std::stacktrace::current(); + std::stacktrace_entry a = st[0]; + std::stacktrace_entry b = st[0]; + std::stacktrace_entry c = st[1]; + + assert(a == b); + assert(a != c); +} + +void f() { + g(); +} + +int main() { + f(); +} +``` +* std::stacktrace[link /reference/stacktrace/basic_stacktrace.md] +* current[link /reference/stacktrace/basic_stacktrace/current.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 12 +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [Hidden Friends](/article/lib/hidden_friends.md) diff --git a/reference/stacktrace/stacktrace_entry/op_ostream.md b/reference/stacktrace/stacktrace_entry/op_ostream.md new file mode 100644 index 0000000000..a7c215306c --- /dev/null +++ b/reference/stacktrace/stacktrace_entry/op_ostream.md @@ -0,0 +1,62 @@ +# operator<< +* stacktrace[meta header] +* std[meta namespace] +* stacktrace_entry[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template + basic_ostream& + operator<<(basic_ostream& os, + const stacktrace_entry& f); +``` + +## 概要 +出力ストリームに出力する。 + + +## 効果 +以下と等価: + +```cpp +return os << to_string(f); +``` +* to_string[link to_string.md] + + +## 例 +```cpp example +#include +#include + +void g() { + std::cout << std::stacktrace::current()[0] << std::endl; +} + +void f() { + g(); +} + +int main() { + f(); +} +``` +* std::stacktrace[link /reference/stacktrace/basic_stacktrace.md] +* current[link /reference/stacktrace/basic_stacktrace/current.md] + +### 出力例 (GCC) +``` + g() at /app/example.cpp:5 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 12 +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/stacktrace_entry/to_string.md b/reference/stacktrace/stacktrace_entry/to_string.md new file mode 100644 index 0000000000..105e00ca40 --- /dev/null +++ b/reference/stacktrace/stacktrace_entry/to_string.md @@ -0,0 +1,62 @@ +# to_string +* stacktrace[meta header] +* std[meta namespace] +* stacktrace_entry[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + string to_string(const stacktrace_entry& f); +} +``` +* string[link /reference/string/basic_string.md] + +## 概要 +文字列化する。 + + +## 戻り値 +`f`のスタックトレースエントリ情報を説明する文字列を返す。 + + +## 備考 +- 実装への推奨として、説明文字列は、[`f.source_file()`](source_file.md)および[`f.source_line()`](source_line.md)の評価を含む情報を提供すべきである + + +## 例 +```cpp example +#include +#include + +void g() { + std::string entry = std::to_string(std::stacktrace::current()[0]); + std::cout << entry << std::endl; +} + +void f() { + g(); +} + +int main() { + f(); +} +``` +* std::to_string[color ff0000] +* std::stacktrace[link /reference/stacktrace/basic_stacktrace.md] +* current[link /reference/stacktrace/basic_stacktrace/current.md] + +### 出力例 (GCC) +``` + g() at /app/example.cpp:5 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 12 +- [Visual C++](/implementation.md#visual_cpp): ?? From 43fb601fc298ae3c3467adbac399598a87c486ee Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 14 May 2024 14:01:39 +0900 Subject: [PATCH 0902/3948] =?UTF-8?q?stacktrace=5Fentry=20:=20=E6=A6=82?= =?UTF-8?q?=E8=A6=81=E6=96=87=E7=AB=A0=E3=82=92=E8=BF=BD=E5=8A=A0=E3=80=82?= =?UTF-8?q?C++23=E3=81=AE=E3=81=AF=E5=AE=8C=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/stacktrace/stacktrace_entry.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reference/stacktrace/stacktrace_entry.md b/reference/stacktrace/stacktrace_entry.md index 7f419f5cf6..fd95a88595 100644 --- a/reference/stacktrace/stacktrace_entry.md +++ b/reference/stacktrace/stacktrace_entry.md @@ -11,7 +11,9 @@ namespace std { ``` ## 概要 +`stacktrace_entry`は、スタックトレースの各エントリ (行) を表すクラスであり、各エントリの情報を問い合せる操作を提供する。 +このクラスは、[`regular`](/reference/concepts/regular.md)および[`three_way_comparable`](/reference/compare/three_way_comparable.md)`<`[`strong_ordering`](/reference/compare/strong_ordering.md)`>`のモデルである。 ## メンバ関数 From 8f62ba9a9a6848dfc540d39796ad29fc2ffc3d26 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 14 May 2024 14:43:39 +0900 Subject: [PATCH 0903/3948] =?UTF-8?q?basic=5Fstacktrace=20:=20libstdc++?= =?UTF-8?q?=E3=81=AF=E5=AE=9F=E8=A3=85=E3=81=A8=E3=81=97=E3=81=A6=E3=82=B7?= =?UTF-8?q?=E3=82=B0=E3=83=8A=E3=83=AB=E5=AE=89=E5=85=A8=E3=81=A7=E3=81=82?= =?UTF-8?q?=E3=82=8B=E3=81=93=E3=81=A8=E3=82=92=E8=A8=98=E8=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/stacktrace/basic_stacktrace.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reference/stacktrace/basic_stacktrace.md b/reference/stacktrace/basic_stacktrace.md index 49bad48e2f..9b92d325f0 100644 --- a/reference/stacktrace/basic_stacktrace.md +++ b/reference/stacktrace/basic_stacktrace.md @@ -27,9 +27,11 @@ namespace std { ### 備考 -- このクラスは、シグナル安全ではない +- このクラスは、仕様としてシグナル安全ではない - 元となった[Boost.Stacktraceライブラリ](https://boost.org/libs/stacktrace)の実装はシグナルハンドラ中でもスタックトレースを出力できる機能を提供するが、標準の本機能はその機能を提供しない - そのような機能は一部のプラットフォームでは実装できないためである + - ただし、実装がシグナル安全である場合がある + - GCC (libstdc++) が内部で使用している[libbacktrace](https://github.com/ianlancetaylor/libbacktrace)ライブラリは、シグナル安全である。ただしlibstdc++の実装仕様としてシグナル安全であるという明記はない ## メンバ関数 From 0b3b945a6d99aa56c955e2abbc367af09a3fa85c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 15 May 2024 12:25:55 +0900 Subject: [PATCH 0904/3948] =?UTF-8?q?format=20:=20C++26=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=E3=81=A8=E3=81=97=E3=81=A6=E3=83=9D=E3=82=A4=E3=83=B3=E3=82=BF?= =?UTF-8?q?=E5=80=A4=E3=82=92=E5=A4=A7=E6=96=87=E5=AD=97=E3=81=A7=E5=87=BA?= =?UTF-8?q?=E5=8A=9B=E3=81=99=E3=82=8BP=E3=82=AA=E3=83=97=E3=82=B7?= =?UTF-8?q?=E3=83=A7=E3=83=B3=E3=82=92=E8=BF=BD=E5=8A=A0=20(close=20#1187)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/format.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/reference/format/format.md b/reference/format/format.md index 8745522d7a..2f280f4945 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -155,9 +155,10 @@ string s3 = format("{} {1}", "a", "b"); // コンパイルエラー #### ポインタの場合 -| type | 意味 | 効果 | -|:-----------|:-------------------|:----------------------------------------------------------------------------------------------------------------| -| p | アドレスを出力する | `0x` につづいて、`to_chars(first, last, reinterpret_cast(value), 16)` の結果を出力する | +| type | 意味 | 効果 | 対応バージョン | +|:-----|:-------------------|:--------------------------------------------------------------------------------------------------|----------------| +| p | アドレスを出力する | `0x` につづいて、`to_chars(first, last, reinterpret_cast(value), 16)` の結果を出力する | C++20 | +| P | アドレスを出力する | pと基本的に同じだが、9桁を超える場合に大文字にし、先頭に`0X`をつける | C++26 | デフォルトは `p`。 @@ -682,3 +683,5 @@ wstring format(const locale& loc, wformat_string fmt, const Args&... ar - [P2286R8 Formatting Ranges](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2286r8.html) - C++23から、Range・コンテナ、`pair`、`tuple`のフォーマット出力、および文字・文字列のデバッグ指定 (`"?"`) が追加された - [P2418R2 Add support for `std::generator`-like types to `std::format`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2418r2.html) +- [P2510R3 Formatting pointers](https://open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2510r3.pdf) + - C++26から、ポインタ値を大文字で出力する`P`オプションが追加された From e6a1afa4e17e3e9cda6ebd5c559a07839bf77644 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 15 May 2024 13:01:24 +0900 Subject: [PATCH 0905/3948] =?UTF-8?q?stacktrace=20:=20formatter=E3=81=AE?= =?UTF-8?q?=E7=89=B9=E6=AE=8A=E5=8C=96=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/stacktrace/basic_stacktrace.md | 10 +++ reference/stacktrace/stacktrace_entry.md | 7 ++ .../stacktrace/stacktrace_entry/formatter.md | 68 +++++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 reference/stacktrace/stacktrace_entry/formatter.md diff --git a/reference/stacktrace/basic_stacktrace.md b/reference/stacktrace/basic_stacktrace.md index 9b92d325f0..18aa7ed551 100644 --- a/reference/stacktrace/basic_stacktrace.md +++ b/reference/stacktrace/basic_stacktrace.md @@ -155,6 +155,13 @@ namespace std { | `template `
`struct hash>;` | `hash`クラスの`basic_stacktrace`に対する特殊化 | C++23 | +### 文字列フォーマットサポート + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `template `
`struct formatter>;` | [`formatter`](/reference/format/formatter.md)の特殊化 | C++23 | + + ## 例 ### 基本的な使い方 ```cpp example @@ -234,3 +241,6 @@ Expression 'i >= 0' is false in f(int) at /app/example.cpp:15 - 13まで : `-lstdc++_libbacktrace` - 14以降 : `-lstdc++exp` + +## 参照 +- [P2693R1 Formatting `thread::id` and `stacktrace`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2693r1.pdf) diff --git a/reference/stacktrace/stacktrace_entry.md b/reference/stacktrace/stacktrace_entry.md index fd95a88595..a71f52ce25 100644 --- a/reference/stacktrace/stacktrace_entry.md +++ b/reference/stacktrace/stacktrace_entry.md @@ -86,6 +86,13 @@ namespace std { | `template <>`
`struct hash;` | `hash`クラスの`stacktrace_entry`に対する特殊化 | C++23 | +## 文字列フォーマットサポート + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`formatter`](stacktrace_entry/formatter.md) | [`std::formatter`](/reference/format/formatter.md)クラスの特殊化 | C++23 | + + ## 例 ```cpp example #include diff --git a/reference/stacktrace/stacktrace_entry/formatter.md b/reference/stacktrace/stacktrace_entry/formatter.md new file mode 100644 index 0000000000..9ba096a8fd --- /dev/null +++ b/reference/stacktrace/stacktrace_entry/formatter.md @@ -0,0 +1,68 @@ +# formatter +* stacktrace[meta header] +* std[meta namespace] +* class[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + struct formatter; +} +``` + +## 概要 +`stacktrace_entry`クラスに対する[`std::formatter`](/reference/format/formatter.md)クラステンプレートの特殊化。 + +フォーマットフラグとしては、以下を使用できる: + +``` +[[fill] [align] [width]] +``` + + +## 例 +```cpp example +#include +#include + +void g() { + std::stacktrace st = std::stacktrace::current(0, 1); + std::stacktrace_entry entry = st[0]; + + std::println("{}", entry); + std::println("{: >30}", entry); +} + +void f() { + g(); +} + +int main() { + f(); +} +``` +* std::stacktrace[link /reference/stacktrace/basic_stacktrace.md] +* current[link /reference/stacktrace/basic_stacktrace/current.md] + +### 出力 +``` + g() at /app/example.cpp:5 + g() at /app/example.cpp:5 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 14 +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`std::format()`](/reference/format/format.md) (フォーマットの詳細) + + +## 参照 +- [P2693R1 Formatting `thread::id` and `stacktrace`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2693r1.pdf) From 39c8d434115cc793b7cdee8a445d614a39f9699e Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 15 May 2024 13:22:22 +0900 Subject: [PATCH 0906/3948] =?UTF-8?q?thread::id=20:=20formatter=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/thread/thread/id.md | 9 +++- reference/thread/thread/id/formatter.md | 65 +++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 reference/thread/thread/id/formatter.md diff --git a/reference/thread/thread/id.md b/reference/thread/thread/id.md index 2c2e9cc7a2..dd6c9da7d2 100644 --- a/reference/thread/thread/id.md +++ b/reference/thread/thread/id.md @@ -62,13 +62,20 @@ namespace std { | `operator<<` | `thread::id`のストリーム出力。 フォーマットは未規定だが、他の識別子と異なることがわかる表現となる。 | C++11 | -## hashサポート +## ハッシュサポート | 名前 | 説明 | 対応バージョン | |--------|-----------------------------------------|-------| | `hash` | `thread::id`での特殊化 (class template) | C++11 | +## 文字列フォーマットサポート + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`formatter`](id/formatter.md) | [`std::formatter`](/reference/format/formatter.md)クラスの特殊化 | C++23 | + + ## 例 ```cpp example #include diff --git a/reference/thread/thread/id/formatter.md b/reference/thread/thread/id/formatter.md new file mode 100644 index 0000000000..9081dcaa63 --- /dev/null +++ b/reference/thread/thread/id/formatter.md @@ -0,0 +1,65 @@ +# formatter +* thread[meta header] +* std[meta namespace] +* thread::id[meta class] +* class[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template + class formatter; +} +``` + +## 概要 +`thread::id`クラスに対する[`std::formatter`](/reference/format/formatter.md)クラステンプレートの特殊化。 + +フォーマットフラグとしては、以下を使用できる: + +``` +[[fill] [align] [width]] +``` + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::println("{}", std::this_thread::get_id()); + std::println("{: >30}", std::this_thread::get_id()); +} +``` +* std::this_thread[link /reference/thread/this_thread.md] +* get_id()[link /reference/thread/this_thread/get_id.md] + +### 出力 +``` +140474254677824 + 140474254677824 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 14 +- [Visual C++](/implementation.md#visual_cpp): ?? + + +### 備考 +- GCCは14.1段階では、[``](/reference/sstream.md)を追加でインクルードしなければコンパイルエラーとなる + - [Bug 115099 - compilation error: format `thread::id`](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115099) + + +## 関連項目 +- [`std::format()`](/reference/format/format.md) (フォーマットの詳細) + + +## 参照 +- [P2693R1 Formatting `thread::id` and `stacktrace`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2693r1.pdf) From 210af738545a0f95e80561a34793b4a931208204 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 15 May 2024 13:29:17 +0900 Subject: [PATCH 0907/3948] =?UTF-8?q?basic=5Fstacktrace=20:=20pmr=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/stacktrace/basic_stacktrace.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reference/stacktrace/basic_stacktrace.md b/reference/stacktrace/basic_stacktrace.md index 18aa7ed551..6833f0febf 100644 --- a/reference/stacktrace/basic_stacktrace.md +++ b/reference/stacktrace/basic_stacktrace.md @@ -10,9 +10,14 @@ namespace std { class basic_stacktrace; using stacktrace = basic_stacktrace>; + + namespace pmr { + using stacktrace = basic_stacktrace>; + } } ``` * allocator[link /reference/memory/allocator.md] +* polymorphic_allocator[link /reference/memory_resource/polymorphic_allocator.md] * stacktrace_entry[link stacktrace_entry.md] ## 概要 @@ -244,3 +249,4 @@ Expression 'i >= 0' is false in f(int) at /app/example.cpp:15 ## 参照 - [P2693R1 Formatting `thread::id` and `stacktrace`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2693r1.pdf) +- [P2301R1 Add a `pmr` alias for `std::stacktrace`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2301r1.html) From cd7aed4ae9a5a212335242bacf44ae21e779275f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 17 May 2024 14:01:28 +0900 Subject: [PATCH 0908/3948] =?UTF-8?q?C++26=E5=AF=BE=E5=BF=9C=E3=81=A8?= =?UTF-8?q?=E3=81=97=E3=81=A6=E3=80=81=E5=AE=9F=E8=A1=8C=E6=99=82=E3=81=AE?= =?UTF-8?q?=E6=9B=B8=E5=BC=8F=E6=96=87=E5=AD=97=E5=88=97=E3=82=B5=E3=83=9D?= =?UTF-8?q?=E3=83=BC=E3=83=88=E3=82=92=E8=A8=98=E8=BC=89=20(close=20#1236)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format.md | 2 + .../basic_format_string/op_constructor.md | 9 ++- reference/format/format.md | 22 ++++++ reference/format/runtime-format-string.md | 50 ++++++++++++++ reference/format/runtime_format.md | 68 +++++++++++++++++++ reference/ostream/print.md | 21 +++++- reference/ostream/println.md | 21 +++++- reference/print/print.md | 20 +++++- reference/print/println.md | 18 +++++ 9 files changed, 227 insertions(+), 4 deletions(-) create mode 100644 reference/format/runtime-format-string.md create mode 100644 reference/format/runtime_format.md diff --git a/reference/format.md b/reference/format.md index 055a6756b8..35aac98b1e 100644 --- a/reference/format.md +++ b/reference/format.md @@ -57,6 +57,8 @@ | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`basic_format_string`](format/basic_format_string.md) | 書式のコンパイル時文字列クラス (class template) | C++23 | +| [`runtime-format-string`](format/runtime-format-string.md) | 説明用としての書式の実行時文字列クラス (class template) | C++26 | +| [`runtime_format`](format/runtime_format.md) | 書式の実行時文字列を指定するために文字列をラップする (function) | C++26 | ## 例外 diff --git a/reference/format/basic_format_string/op_constructor.md b/reference/format/basic_format_string/op_constructor.md index e3f944b66f..50a3e629d4 100644 --- a/reference/format/basic_format_string/op_constructor.md +++ b/reference/format/basic_format_string/op_constructor.md @@ -7,12 +7,18 @@ ```cpp template -consteval basic_format_string(const T& s); +consteval basic_format_string(const T& s); // (1) C++23 + +basic_format_string(runtime-format-string s) noexcept; // (2) C++26 ``` +* runtime-format-string[link /reference/format/runtime-format-string.md] ## 概要 `basic_format_string`オブジェクトを構築する。 +- (1) : コンパイル時の書式文字列を受け取る +- (2) : 実行時の書式文字列を受け取る + ## テンプレートパラメータ制約 - `const T&`は[`convertible_to`](/reference/concepts/convertible_to.md)`<`[`basic_string_view`](/reference/string_view/basic_string_view.md)`>`のモデルであること @@ -90,3 +96,4 @@ namespace std { ## 参照 - [P2216R3 `std::format` improvements](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2216r3.html) +- [P2918R2 Runtime format strings II](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2918r2.html) diff --git a/reference/format/format.md b/reference/format/format.md index 2f280f4945..ea254bb9bd 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -618,6 +618,27 @@ int main() ``` +### 実行時文字列を書式文字列として使用する (C++26) +```cpp example +#include +#include + +int main() +{ + std::string fmt = "{}"; + std::string s = std::format(std::runtime_format(fmt), "Hello"); + + std::cout << s << std::endl; +} +``` +* std::runtime_format[link runtime_format.md] + +#### 出力 +``` +Hello +``` + + ## 実装例 ```cpp template @@ -672,6 +693,7 @@ wstring format(const locale& loc, wformat_string fmt, const Args&... ar - [``](/reference/ostream.md) - [`std::print()`](/reference/ostream/print.md) - [`std::println()`](/reference/ostream/println.md) +- [`std::runtime_format()`](runtime_format.md) ## 参照 diff --git a/reference/format/runtime-format-string.md b/reference/format/runtime-format-string.md new file mode 100644 index 0000000000..cfbbcd18b4 --- /dev/null +++ b/reference/format/runtime-format-string.md @@ -0,0 +1,50 @@ +# runtime-format-string +* format[meta header] +* class[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std { + +template +struct runtime-format-string { +private: + basic_string_view str; // 説明用 + +public: + runtime-format-string(basic_string_view s) noexcept : str(s) {} + + runtime-format-string(const runtime-format-string&) = delete; + const runtime-format-string& operator=(const runtime-format-string&) = delete; +}; + +} +``` + + +## 概要 +`runtime-format-string`クラスは、実行時の書式文字列を表す説明用のクラスであり、ユーザーは使用できない。 + +このクラスは、[`std::string`](/reference/string/basic_string.md)や[`std::string_view`](/reference/string_view/basic_string_view.md)の文字列を、書式文字列として[`std::format()`](/reference/format/format.md)関数に指定するためにある。 + +```cpp +std::string fmt = "{}"; +std::string s = std::format(std::runtime_format(fmt), "Hello"); +``` +* std::format[link format.md] +* std::runtime_format[link runtime_format.md] + + +## バージョン +### 言語 +- C++26 + +## 関連項目 +- [`std::format()`](format.md) +- [`std::runtime_format()`](runtime_format.md) +- [`std::basic_format_string`クラスのコンストラクタ](basic_format_string/op_constructor.md) + + +## 参照 +- [P2918R2 Runtime format strings II](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2918r2.html) diff --git a/reference/format/runtime_format.md b/reference/format/runtime_format.md new file mode 100644 index 0000000000..cee2090df1 --- /dev/null +++ b/reference/format/runtime_format.md @@ -0,0 +1,68 @@ +# runtime_format +* format[meta header] +* function template[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std { + runtime-format-string + runtime_format(string_view fmt) noexcept; // (1) C++26 + + runtime-format-string + runtime_format(wstring_view fmt) noexcept; // (2) C++26 +} +``` +* runtime-format-string[link runtime-format-string.md] +* wstring_view[link /reference/string_view/basic_string_view.md] + +## 概要 +実行時文字列を書式文字列として使用できるようラップする。 + +このクラスは、[`std::string`](/reference/string/basic_string.md)や[`std::string_view`](/reference/string_view/basic_string_view.md)の文字列を、書式文字列として[`std::format()`](/reference/format/format.md)関数に指定するための型に変換する関数である。 + + +## 戻り値 +```cpp +return fmt; +``` + + +## 例 +```cpp example +#include + +int main() +{ + std::string fmt = "{}"; + + std::string s = std::format(std::runtime_format(fmt), "Hello"); + std::println(std::runtime_format(fmt), s); +} +``` +* std::runtime_format[color ff0000] +* std::format[link format.md] + +### 出力 +``` +Hello +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 14 +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`std::format()`](format.md) +- [`runtime-format-string`](runtime-format-string.md) +- [`std::basic_format_string`クラスのコンストラクタ](basic_format_string/op_constructor.md) + + +## 参照 +- [P2918R2 Runtime format strings II](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2918r2.html) diff --git a/reference/ostream/print.md b/reference/ostream/print.md index 8b0f87013b..580ef017df 100644 --- a/reference/ostream/print.md +++ b/reference/ostream/print.md @@ -72,6 +72,7 @@ namespace std { ## 例 +### 基本的な使い方 ```cpp example #include @@ -83,12 +84,29 @@ int main() ``` * std::print[color ff0000] -### 出力 +#### 出力 ``` Hello 42 World Hello 42 World ``` +### 実行時の書式文字列を使用する (C++26) +```cpp example +#include + +int main() +{ + std::string fmt = "{}\n"; + std::print(std::cout, std::runtime_format(fmt), "Hello"); +} +``` +* std::runtime_format[link /reference/format/runtime_format.md] + +#### 出力 +``` +Hello +``` + ## バージョン ### 言語 - C++23 @@ -102,6 +120,7 @@ Hello 42 World ## 関連項目 - [`std::format()`](/reference/format/format.md) +- [`std::runtime_format()`](/reference/format/runtime_format.md) - [`std::println()`](println.md) diff --git a/reference/ostream/println.md b/reference/ostream/println.md index d71760d286..c118335275 100644 --- a/reference/ostream/println.md +++ b/reference/ostream/println.md @@ -40,6 +40,7 @@ namespace std { ## 例 +### 基本的な使い方 ```cpp example #include @@ -51,12 +52,29 @@ int main() ``` * std::println[color ff0000] -### 出力 +#### 出力 ``` Hello 42 World Hello 42 World ``` +### 実行時の書式文字列を使用する (C++26) +```cpp example +#include + +int main() +{ + std::string fmt = "{}"; + std::println(std::cout, std::runtime_format(fmt), "Hello"); +} +``` +* std::runtime_format[link /reference/format/runtime_format.md] + +#### 出力 +``` +Hello +``` + ## バージョン ### 言語 - C++23 @@ -70,6 +88,7 @@ Hello 42 World ## 関連項目 - [`std::format()`](/reference/format/format.md) +- [`std::runtime_format()`](/reference/format/runtime_format.md) - [`std::print()`](print.md) diff --git a/reference/print/print.md b/reference/print/print.md index d23f0e61c3..cd3b732f32 100644 --- a/reference/print/print.md +++ b/reference/print/print.md @@ -118,7 +118,7 @@ int main() // stdout / stderrはマクロとして定義される。 // モジュールはマクロをエクスポートしないので、 // stdout / stderrを使用する場合はをインクルードする必要がある - std::println(stdout, "Hello {} World\n", 42); + std::print(stdout, "Hello {} World\n", 42); } ``` @@ -128,6 +128,23 @@ Hello 42 World Hello 42 World ``` +### 実行時の書式文字列を使用する (C++26) +```cpp example +#include + +int main() +{ + std::string fmt = "{}\n"; + std::print(std::runtime_format(fmt), "Hello"); +} +``` +* std::runtime_format[link /reference/format/runtime_format.md] + +#### 出力 +``` +Hello +``` + ## バージョン ### 言語 - C++23 @@ -141,6 +158,7 @@ Hello 42 World ## 関連項目 - [`std::format()`](/reference/format/format.md) +- [`std::runtime_format()`](/reference/format/runtime_format.md) - [`std::println()`](println.md) diff --git a/reference/print/println.md b/reference/print/println.md index 969973215c..c9b44ad26a 100644 --- a/reference/print/println.md +++ b/reference/print/println.md @@ -96,6 +96,23 @@ Hello 42 World Hello 42 World ``` +### 実行時の書式文字列を使用する (C++26) +```cpp example +#include + +int main() +{ + std::string fmt = "{}"; + std::println(std::runtime_format(fmt), "Hello"); +} +``` +* std::runtime_format[link /reference/format/runtime_format.md] + +#### 出力 +``` +Hello +``` + ## バージョン ### 言語 - C++23 @@ -109,6 +126,7 @@ Hello 42 World ## 関連項目 - [`std::format()`](/reference/format/format.md) +- [`std::runtime_format()`](/reference/format/runtime_format.md) - [`std::print()`](print.md) From 5871133be244bda206b60a0a3226ea55a0b0ab77 Mon Sep 17 00:00:00 2001 From: Kotaro Yoshimoto Date: Fri, 17 May 2024 14:21:26 +0900 Subject: [PATCH 0909/3948] Fix typo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `std::piecewise_linear_distribution::min` の `min` が `mix` になっていたのを修正しました --- reference/random/piecewise_linear_distribution.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/random/piecewise_linear_distribution.md b/reference/random/piecewise_linear_distribution.md index a213d6de17..4fffc975e5 100644 --- a/reference/random/piecewise_linear_distribution.md +++ b/reference/random/piecewise_linear_distribution.md @@ -48,7 +48,7 @@ namespace std { | [`intervals`](piecewise_linear_distribution/intervals.md) | 区間の数列を取得する | C++11 | | [`densities`](piecewise_linear_distribution/densities.md) | 重み付けの数列を取得する | C++11 | | [`param`](piecewise_linear_distribution/param.md) | 分布のパラメータを取得/設定する | C++11 | -| [`mix`](piecewise_linear_distribution/min.md) | 下限を取得する | C++11 | +| [`min`](piecewise_linear_distribution/min.md) | 下限を取得する | C++11 | | [`max`](piecewise_linear_distribution/max.md) | 上限を取得する | C++11 | From 7e81584d47168b40ffeb38ac1ab0cbd8f5bdc6e3 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Fri, 17 May 2024 17:27:41 +0900 Subject: [PATCH 0910/3948] =?UTF-8?q?nexttoward=20:=20typo=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cmath/nexttoward.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cmath/nexttoward.md b/reference/cmath/nexttoward.md index 2ede9b2044..9e97347cca 100644 --- a/reference/cmath/nexttoward.md +++ b/reference/cmath/nexttoward.md @@ -62,7 +62,7 @@ namespace std { ## 戻り値 -パラメータ`x`の値をパラメータ`x`の方向に、表現可能な最小の値だけ進めた値を返す。 +パラメータ`x`の値をパラメータ`y`の方向に、表現可能な最小の値だけ進めた値を返す。 `x`と`y`が等値である場合、`y`を返す。 From dd7c42cc5ecbd1e1fd12fe1aff1ac4c2412e426d Mon Sep 17 00:00:00 2001 From: Kusunose Toru Date: Fri, 17 May 2024 18:10:13 +0900 Subject: [PATCH 0911/3948] Update labels_at_the_end_of_compound_statements.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 参照するCバージョンの修正とその他文言変更 --- lang/cpp23/labels_at_the_end_of_compound_statements.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lang/cpp23/labels_at_the_end_of_compound_statements.md b/lang/cpp23/labels_at_the_end_of_compound_statements.md index 2d85ec9965..c8377072a7 100644 --- a/lang/cpp23/labels_at_the_end_of_compound_statements.md +++ b/lang/cpp23/labels_at_the_end_of_compound_statements.md @@ -2,24 +2,24 @@ * cpp23[meta cpp] ## 概要 -C言語 (C20) との互換性のため、C言語で許可されていた複合文の末尾 (関数末尾など`{}`ブロックの末尾) へのgotoラベルを許可する。 +C言語 (C23) との互換性のため、C言語で新しく許可された複合文の末尾 (関数末尾など`{}`ブロックの末尾) へのgotoラベルを許可する。 関数末尾の例: ```cpp void foo(void) { -first: // C20:OK C++:OK +first: // C23:OK C++:OK int x; -second: // C20:OK C++:OK +second: // C:OK C++:OK x = 1; -last: // C20:OK C++23:OK +last: // C23:OK C++23:OK } ``` ## この機能が必要になった背景・経緯 -CではN2508の提案により、宣言の前など、複合文のあらゆる箇所にgotoラベルを置けるようになり、C++との互換性が改善した。C++では宣言は文として扱われるため宣言の前には以前からgotoラベルを置くことができた。ただし、C++では複合文の末尾にはgotoラベルを置けないという非互換が残っていた。 +CではN2508の提案により、宣言の前など、複合文のあらゆる箇所にgotoラベルを置けるようになり、C++との互換性が改善した。C++では宣言は文として扱われるため宣言の前には以前からgotoラベルを置くことができた。ただし、C++では複合文の末尾にはgotoラベルを置けないため新しい非互換が生じた。 C++23でこの機能を導入することにより、gotoラベルを置ける場所についての非互換がなくなる。 From 00d8910552220adfd340642d4807af72e06557c5 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Sun, 19 May 2024 18:07:05 +0900 Subject: [PATCH 0912/3948] =?UTF-8?q?linalg=20:=20mdspan=E3=82=92=E9=80=9A?= =?UTF-8?q?=E3=81=97=E3=81=A6=E8=A1=8C=E5=88=97=E3=81=AB=E3=82=A2=E3=82=AF?= =?UTF-8?q?=E3=82=BB=E3=82=B9=E3=81=99=E3=82=8B=E8=A8=98=E8=BF=B0=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reference/linalg.md b/reference/linalg.md index e05c99180e..15e561c8cf 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -3,6 +3,7 @@ * cpp26[meta cpp] ``ヘッダでは、線形代数(linear algebra)に関する基礎的な演算アルゴリズムを提供する。 +配列要素にアクセスするアルゴリズムは、多次元配列ビュー[ `std::mdspan` ](mdspan/mdspan.md)を通してその要素にアクセスする。 本ヘッダが提供するエンティティは、すべて名前空間`std::linalg`に属する。 1次元データであるベクトル(vector)や2次元データである行列(matrix)に対して、線形代数分野のデファクトスタンダードとされる BLAS(Basic Linear Algebra Subprograms) 互換のアルゴリズム群、いくつかの LAPACK(Linear Algebra PACKage) 互換のアルゴリズムが提供される。 @@ -15,7 +16,7 @@ BLAS互換アルゴリズムは、演算対象データの次元数や計算オ 例えば、2個の一般行列の積を求める`std::linalg::matrix_product`はLevel 3 BLASルーチン`xGEMM`に対応する。 (実際のBLASルーチン名は、浮動小数点数型の単精度`S`/倍精度`D`とそれぞれの複素数版`C`,`Z`として、プレフィックス`x`部は文字4種類のいずれか。) -また、多次元配列ビュー[`std::mdpan`](mdspan/mdspan.md)と組み合わせて利用する拡張機能が提供される。 +また、`std::mdpan`と組み合わせて利用する拡張機能が提供される。 ## 共通要件 From 0bf7edfb48d450d2465f2903375bc2749536c514 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Sun, 19 May 2024 18:15:43 +0900 Subject: [PATCH 0913/3948] =?UTF-8?q?linalg=20:=20=E3=82=BF=E3=82=B0?= =?UTF-8?q?=E3=81=AB=E9=96=A2=E3=81=99=E3=82=8B=E8=A8=98=E8=BF=B0=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 44 ++++++++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/reference/linalg.md b/reference/linalg.md index 15e561c8cf..0fede62df2 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -100,22 +100,38 @@ BLAS互換アルゴリズムは、演算対象データの次元数や計算オ | `triangular_matrix_matrix_right_solve` | xTRSM: 三角行列の連立一次方程式を解く (function template) | C++26 | -## タグ型 +## タグ +``ヘッダでは、行列の格納順序や三角行列の上下をタグを使って表現している。 -| 名前 | 説明 | 対応バージョン | +以下、型名を掲載するが、変数も次のように宣言されている。 + +```cpp +inline constexpr tag_name_t tag_name; +``` + +### 格納順序 +行列の格納順序を表すタグ。 + +| 型名 | 説明 | 対応バージョン | +|------|------|----------------| +| [`column_major_t`](linalg/column_major_t.md) | 列優先(column-major) | C++26 | +| [`row_major_t`](linalg/row_major_t.md) | 行優先(row-major) | C++26 | + +### 三角行列 +上三角行列か下三角行列かを表すタグ。 + +| 型名 | 説明 | 対応バージョン | +|------|------|----------------| +| [`upper_triangle_t`](linalg/upper_triangle_t.md.nolink) | 上三角行列 | C++26 | +| [`lower_triangle_t`](linalg/lower_triangle_t.md.nolink) | 下三角行列 | C++26 | + +### 対角成分 +行列の全ての対角成分を暗黙に乗法における単位元とみなすかどうかを表すタグ。みなした場合、行列の対角成分にはアクセスせず、値が乗法における単位元であるとして計算する。 + +| 型名 | 説明 | 対応バージョン | |------|------|----------------| -| [`column_major_t`](linalg/column_major_t.md) | 列優先(column-major)順序を表現するためのタグ型 (class) | C++26 | -| [`column_major`](linalg/column_major_t.md) | 列優先(column-major)順序を表現するためのタグ値 (variable) | C++26 | -| [`row_major_t`](linalg/row_major_t.md) | 行優先(row-major)順序を表現するためのタグ型 (class) | C++26 | -| [`row_major`](linalg/row_major_t.md) | 行優先(row-major)順序を表現するためのタグ値 (variable) | C++26 | -| [`upper_triangle_t`](linalg/upper_triangle_t.md.nolink) | 上三角行列を表現するためのタグ型 (class) | C++26 | -| [`upper_triangle`](linalg/upper_triangle_t.md.nolink) | 上三角行列を表現するためのタグ値 (variable) | C++26 | -| [`lower_triangle_t`](linalg/lower_triangle_t.md.nolink) | 下三角行列を表現するためのタグ型 (class) | C++26 | -| [`lower_triangle`](linalg/lower_triangle_t.md.nolink) | 下三角行列を表現するためのタグ値 (variable) | C++26 | -| `implicit_unit_diagonal_t` | implicit unit diagonalを表現するためのタグ型 (class) | C++26 | -| `implicit_unit_diagonal` | implicit unit diagonalを表現するためのタグ値 (variable) | C++26 | -| `explicit_diagonal_t` | explicit diagonalを表現するためのタグ型 (class) | C++26 | -| `explicit_diagonal` | explicit diagonalを表現するためのタグ値 (variable) | C++26 | +| `implicit_unit_diagonal_t` | 全ての対角成分を暗黙に乗法における単位元とみなす | C++26 | +| `explicit_diagonal_t` | 全ての対角成分にアクセスする | C++26 | ## バージョン From 3ae80983ae2855dfe29acbb8ab117e8e3bf1c647 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Sun, 19 May 2024 19:09:53 +0900 Subject: [PATCH 0914/3948] =?UTF-8?q?linalg=20:=20=E3=82=BF=E3=82=B0?= =?UTF-8?q?=E3=81=AE=E8=A9=B3=E7=B4=B0=E9=A0=85=E7=9B=AE=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 8 ++-- reference/linalg/explicit_diagonal_t.md | 39 ++++++++++++++++++++ reference/linalg/implicit_unit_diagonal_t.md | 39 ++++++++++++++++++++ reference/linalg/lower_triangle_t.md | 39 ++++++++++++++++++++ reference/linalg/upper_triangle_t.md | 39 ++++++++++++++++++++ 5 files changed, 160 insertions(+), 4 deletions(-) create mode 100644 reference/linalg/explicit_diagonal_t.md create mode 100644 reference/linalg/implicit_unit_diagonal_t.md create mode 100644 reference/linalg/lower_triangle_t.md create mode 100644 reference/linalg/upper_triangle_t.md diff --git a/reference/linalg.md b/reference/linalg.md index 0fede62df2..1ca3f5f725 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -122,16 +122,16 @@ inline constexpr tag_name_t tag_name; | 型名 | 説明 | 対応バージョン | |------|------|----------------| -| [`upper_triangle_t`](linalg/upper_triangle_t.md.nolink) | 上三角行列 | C++26 | -| [`lower_triangle_t`](linalg/lower_triangle_t.md.nolink) | 下三角行列 | C++26 | +| [`upper_triangle_t`](linalg/upper_triangle_t.md) | 上三角行列 | C++26 | +| [`lower_triangle_t`](linalg/lower_triangle_t.md) | 下三角行列 | C++26 | ### 対角成分 行列の全ての対角成分を暗黙に乗法における単位元とみなすかどうかを表すタグ。みなした場合、行列の対角成分にはアクセスせず、値が乗法における単位元であるとして計算する。 | 型名 | 説明 | 対応バージョン | |------|------|----------------| -| `implicit_unit_diagonal_t` | 全ての対角成分を暗黙に乗法における単位元とみなす | C++26 | -| `explicit_diagonal_t` | 全ての対角成分にアクセスする | C++26 | +| [`implicit_unit_diagonal_t`](linalg/implicit_unit_diagonal_t.md) | 全ての対角成分を暗黙に乗法における単位元とみなす | C++26 | +| [`explicit_diagonal_t`](linalg/explicit_diagonal_t.md) | 全ての対角成分にアクセスする | C++26 | ## バージョン diff --git a/reference/linalg/explicit_diagonal_t.md b/reference/linalg/explicit_diagonal_t.md new file mode 100644 index 0000000000..8e80ebff9e --- /dev/null +++ b/reference/linalg/explicit_diagonal_t.md @@ -0,0 +1,39 @@ +# explicit_diagonal_t +* linalg[meta header] +* class[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::linalg { + struct explicit_diagonal_t { explicit explicit_diagonal_t() = default; }; + + inline constexpr explicit_diagonal_t explicit_diagonal{}; +} +``` + +## 概要 +`explicit_diagonal_t`は行列の対角成分が必要になった時、その成分にアクセスすることを表すタグ型である。 + +`explicit_diagonal_t`型の定数`explicit_diagonal`が提供される。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`mdspan`](/reference/mdspan/mdspan.md) +- [`layout_blas_packed`](layout_blas_packed.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) + diff --git a/reference/linalg/implicit_unit_diagonal_t.md b/reference/linalg/implicit_unit_diagonal_t.md new file mode 100644 index 0000000000..431218cf11 --- /dev/null +++ b/reference/linalg/implicit_unit_diagonal_t.md @@ -0,0 +1,39 @@ +# implicit_unit_diagonal_t +* linalg[meta header] +* class[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::linalg { + struct implicit_unit_diagonal_t { explicit implicit_unit_diagonal_t() = default; }; + + inline constexpr implicit_unit_diagonal_t implicit_unit_diagonal{}; +} +``` + +## 概要 +`implicit_unit_diagonal_t`は、行列の全ての対角成分を暗黙に乗法における単位元とみなすことを表すタグ型である。このタグが渡されると、行列の対角成分が必要になった時、その成分にアクセスせず、乗法における単位元であるとして計算する。 + +`implicit_unit_diagonal_t`型の定数`implicit_unit_diagonal`が提供される。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`mdspan`](/reference/mdspan/mdspan.md) +- [`layout_blas_packed`](layout_blas_packed.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) + diff --git a/reference/linalg/lower_triangle_t.md b/reference/linalg/lower_triangle_t.md new file mode 100644 index 0000000000..0a67c3b752 --- /dev/null +++ b/reference/linalg/lower_triangle_t.md @@ -0,0 +1,39 @@ +# lower_triangle_t +* linalg[meta header] +* class[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::linalg { + struct lower_triangle_t { explicit lower_triangle_t() = default; }; + + inline constexpr lower_triangle_t lower_triangle{}; +} +``` + +## 概要 +`lower_triangle_t`は、行列が下三角行列であることを表すタグ型である。 + +`lower_triangle_t`型の定数`lower_triangle`が提供される。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`mdspan`](/reference/mdspan/mdspan.md) +- [`layout_blas_packed`](layout_blas_packed.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) + diff --git a/reference/linalg/upper_triangle_t.md b/reference/linalg/upper_triangle_t.md new file mode 100644 index 0000000000..096a0ab313 --- /dev/null +++ b/reference/linalg/upper_triangle_t.md @@ -0,0 +1,39 @@ +# upper_triangle_t +* linalg[meta header] +* class[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::linalg { + struct upper_triangle_t { explicit upper_triangle_t() = default; }; + + inline constexpr upper_triangle_t upper_triangle{}; +} +``` + +## 概要 +`upper_triangle_t`は、行列が上三角行列であることを表すタグ型である。 + +`upper_triangle_t`型の定数`upper_triangle`が提供される。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`mdspan`](/reference/mdspan/mdspan.md) +- [`layout_blas_packed`](layout_blas_packed.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) + From 0f8f840932f0602aee682127067506f9b4810b17 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Tue, 21 May 2024 12:12:55 +0900 Subject: [PATCH 0915/3948] =?UTF-8?q?linalg=20:=20layout=5Fblas=5Fpacked?= =?UTF-8?q?=E3=81=AE=E8=A8=98=E8=BF=B0=E3=82=92=E3=82=8F=E3=81=8B=E3=82=8A?= =?UTF-8?q?=E3=82=84=E3=81=99=E3=81=8F=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BLASのpacked layoutを調べなくても良いように修正した。 また、`Triangle`に指定するタグのリンクを修正した。 Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/layout_blas_packed.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/linalg/layout_blas_packed.md b/reference/linalg/layout_blas_packed.md index 67fd430106..5f98a4d289 100644 --- a/reference/linalg/layout_blas_packed.md +++ b/reference/linalg/layout_blas_packed.md @@ -12,16 +12,16 @@ namespace std::linalg { ``` ## 概要 -`layout_blas_packed`は、多次元配列ビュー[`mdspan`](/reference/mdspan/mdspan.md)を用いた正方行列(square matrix)に対して、BLASにおけるパックレイアウトと互換性のある行列要素メモリ配置を表現する[レイアウトマッピングポリシー](/reference/mdspan/LayoutMappingPolicy.md)クラスである。 +`layout_blas_packed`は、0でない成分だけを配列で過不足なく持つ三角行列を表す、多次元配列ビュー[`mdspan`](/reference/mdspan/mdspan.md)の[レイアウトマッピングポリシー](/reference/mdspan/LayoutMappingPolicy.md)クラスであり、BLASにおけるパックレイアウトと互換性がある。 -- `Triangle` : 指定する行列要素の種別を、上三角[`upper_triangle_t`](upper_triangle_t.md.nolink)または下三角[`lower_triangle_t`](lower_triangle_t.md.nolink)から指定する。 +- `Triangle` : 三角行列の種別を、上三角[`upper_triangle_t`](upper_triangle_t.md)または下三角[`lower_triangle_t`](lower_triangle_t.md)から指定する。 - `StorageOrder` : 行列要素の格納順を、列優先[`column_major_t`](column_major_t.md)または行優先[`row_major_t`](row_major_t.md)から指定する。 -`layout_blas_packed`を用いて、BLASの Symmetric Packed (SP), Hermitian Packed (HP), Triangular Packed (TP) で利用される行列レイアウトを表現できる。 +`layout_blas_packed`は、BLASの Symmetric Packed (SP), Hermitian Packed (HP), Triangular Packed (TP) で利用される行列レイアウトを表す。 ## 適格要件 -- `Triangle`は[`upper_triangle_t`](upper_triangle_t.md.nolink)または[`lower_triangle_t`](lower_triangle_t.md.nolink)のいずれか +- `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md)のいずれか - `StorageOrder`は[`column_major_t`](column_major_t.md)または[`row_major_t`](row_major_t.md)のいずれか From 1a60840c38cd8b6787d35d35f5438278beafd0b9 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Tue, 21 May 2024 13:53:50 +0900 Subject: [PATCH 0916/3948] =?UTF-8?q?linalg=20:=20=E3=82=BF=E3=82=B0?= =?UTF-8?q?=E3=81=AE=E5=AE=9A=E6=95=B0=E3=81=AE=E8=A8=98=E8=BF=B0=E3=82=92?= =?UTF-8?q?=E5=AE=A3=E8=A8=80=E3=81=8B=E3=82=89=E5=AE=9A=E7=BE=A9=E3=81=AB?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/linalg.md b/reference/linalg.md index 1ca3f5f725..e24e1d410c 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -103,10 +103,10 @@ BLAS互換アルゴリズムは、演算対象データの次元数や計算オ ## タグ ``ヘッダでは、行列の格納順序や三角行列の上下をタグを使って表現している。 -以下、型名を掲載するが、変数も次のように宣言されている。 +以下、型名を掲載するが、定数も次のように定義されている。 ```cpp -inline constexpr tag_name_t tag_name; +inline constexpr tag_name_t tag_name{}; ``` ### 格納順序 From def14f7d5a62b33f616590b14085b20f6f4cef9c Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Tue, 21 May 2024 14:27:07 +0900 Subject: [PATCH 0917/3948] =?UTF-8?q?linalg=20:=20=E9=96=A2=E9=80=A3?= =?UTF-8?q?=E9=A0=85=E7=9B=AE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/explicit_diagonal_t.md | 2 -- reference/linalg/implicit_unit_diagonal_t.md | 2 -- reference/linalg/layout_blas_packed.md | 4 ++++ reference/linalg/lower_triangle_t.md | 1 - reference/linalg/upper_triangle_t.md | 1 - 5 files changed, 4 insertions(+), 6 deletions(-) diff --git a/reference/linalg/explicit_diagonal_t.md b/reference/linalg/explicit_diagonal_t.md index 8e80ebff9e..2a5c343d85 100644 --- a/reference/linalg/explicit_diagonal_t.md +++ b/reference/linalg/explicit_diagonal_t.md @@ -30,8 +30,6 @@ namespace std::linalg { ## 関連項目 -- [`mdspan`](/reference/mdspan/mdspan.md) -- [`layout_blas_packed`](layout_blas_packed.md) ## 参照 diff --git a/reference/linalg/implicit_unit_diagonal_t.md b/reference/linalg/implicit_unit_diagonal_t.md index 431218cf11..9ee3920995 100644 --- a/reference/linalg/implicit_unit_diagonal_t.md +++ b/reference/linalg/implicit_unit_diagonal_t.md @@ -30,8 +30,6 @@ namespace std::linalg { ## 関連項目 -- [`mdspan`](/reference/mdspan/mdspan.md) -- [`layout_blas_packed`](layout_blas_packed.md) ## 参照 diff --git a/reference/linalg/layout_blas_packed.md b/reference/linalg/layout_blas_packed.md index 5f98a4d289..d898cc39c1 100644 --- a/reference/linalg/layout_blas_packed.md +++ b/reference/linalg/layout_blas_packed.md @@ -121,6 +121,10 @@ mat2: ## 関連項目 - [`mdspan`](/reference/mdspan/mdspan.md) +- [`upper_triangle_t`](upper_triangle_t.md) +- [`lower_triangle_t`](lower_triangle_t.md) +- [`column_major_t`](column_major_t.md) +- [`row_major_t`](row_major_t.md) ## 参照 diff --git a/reference/linalg/lower_triangle_t.md b/reference/linalg/lower_triangle_t.md index 0a67c3b752..2cb069b2b6 100644 --- a/reference/linalg/lower_triangle_t.md +++ b/reference/linalg/lower_triangle_t.md @@ -30,7 +30,6 @@ namespace std::linalg { ## 関連項目 -- [`mdspan`](/reference/mdspan/mdspan.md) - [`layout_blas_packed`](layout_blas_packed.md) diff --git a/reference/linalg/upper_triangle_t.md b/reference/linalg/upper_triangle_t.md index 096a0ab313..f249816420 100644 --- a/reference/linalg/upper_triangle_t.md +++ b/reference/linalg/upper_triangle_t.md @@ -30,7 +30,6 @@ namespace std::linalg { ## 関連項目 -- [`mdspan`](/reference/mdspan/mdspan.md) - [`layout_blas_packed`](layout_blas_packed.md) From 252ccdb7d516542d9a420be23ea00c700ee78e1d Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Tue, 21 May 2024 14:54:58 +0900 Subject: [PATCH 0918/3948] =?UTF-8?q?linalg=20:=20`=E9=85=8D=E5=88=97`?= =?UTF-8?q?=E3=82=92`=E3=83=99=E3=82=AF=E3=83=88=E3=83=AB=E3=82=84?= =?UTF-8?q?=E8=A1=8C=E5=88=97`=E3=81=AB=E4=BF=AE=E6=AD=A3=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/linalg.md b/reference/linalg.md index e24e1d410c..4c2a32f863 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -3,7 +3,7 @@ * cpp26[meta cpp] ``ヘッダでは、線形代数(linear algebra)に関する基礎的な演算アルゴリズムを提供する。 -配列要素にアクセスするアルゴリズムは、多次元配列ビュー[ `std::mdspan` ](mdspan/mdspan.md)を通してその要素にアクセスする。 +ベクトルや行列の成分にアクセスするアルゴリズムは、多次元配列ビュー[ `std::mdspan` ](mdspan/mdspan.md)を通してその要素にアクセスする。 本ヘッダが提供するエンティティは、すべて名前空間`std::linalg`に属する。 1次元データであるベクトル(vector)や2次元データである行列(matrix)に対して、線形代数分野のデファクトスタンダードとされる BLAS(Basic Linear Algebra Subprograms) 互換のアルゴリズム群、いくつかの LAPACK(Linear Algebra PACKage) 互換のアルゴリズムが提供される。 From b18e998669c0d35faf03827397ae3215c95f65d3 Mon Sep 17 00:00:00 2001 From: yuina-blend Date: Tue, 21 May 2024 16:25:12 +0900 Subject: [PATCH 0919/3948] =?UTF-8?q?[Update]=20GCC=E3=81=AE=E5=8B=95?= =?UTF-8?q?=E4=BD=9C=E7=A2=BA=E8=AA=8D=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7?= =?UTF-8?q?=E3=83=B3=E3=82=92=E8=BF=BD=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/string/stod.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/string/stod.md b/reference/string/stod.md index ff1a0d3ef7..81aa191db4 100644 --- a/reference/string/stod.md +++ b/reference/string/stod.md @@ -164,7 +164,7 @@ double stod(const std::wstring& str, std::size_t* idx = nullptr) { ### 処理系 - [Clang](/implementation.md#clang): ? -- [GCC](/implementation.md#gcc): ? +- [GCC](/implementation.md#gcc): 4.8.5 - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 From 60b773476fe3e1332aa896c422f97fbc3a648a5e Mon Sep 17 00:00:00 2001 From: yuina-blend Date: Tue, 21 May 2024 18:01:24 +0900 Subject: [PATCH 0920/3948] =?UTF-8?q?[Fix]=20=E5=87=BA=E5=8A=9B=E4=BE=8B?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/string/stod.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/string/stod.md b/reference/string/stod.md index 81aa191db4..aa31310ef3 100644 --- a/reference/string/stod.md +++ b/reference/string/stod.md @@ -103,6 +103,7 @@ int main() ``` 1.5 1 +---- base = 8 500 250 ---- base = 16 From 1308e37dd3529b0d7771d86c95044764eb887edd Mon Sep 17 00:00:00 2001 From: yuina-blend Date: Tue, 21 May 2024 18:34:30 +0900 Subject: [PATCH 0921/3948] [Fix] typo --- reference/string/stof.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reference/string/stof.md b/reference/string/stof.md index 70de447f1f..83d4a52284 100644 --- a/reference/string/stof.md +++ b/reference/string/stof.md @@ -101,8 +101,10 @@ int main() ### 出力例 ``` +---- decimal point 1.5 1 +---- base = 8 500 250 ---- base = 16 @@ -172,8 +174,8 @@ float stof(const std::wstring& str, std::size_t* idx = nullptr) { ## 関連リンク ### C標準ライブラリに由来する関数 -- `atof`: `stold`は`atof`を`std::string`および`std::wsting`に対応させ、戻り値の型を`float`に変更したものと見なせる。 -- `strtof`, `wcstof`: `stof`は`strtof`および`wcstof`をそれぞれ`std::string`と`std::wsting`に対応させたものと見なせる。 +- `atof`: `stold`は`atof`を`std::string`および`std::wstring`に対応させ、戻り値の型を`float`に変更したものと見なせる。 +- `strtof`, `wcstof`: `stof`は`strtof`および`wcstof`をそれぞれ`std::string`と`std::wstring`に対応させたものと見なせる。 ### ファミリー - [`stoi`](stoi.md): 戻り値の型が`int`となったもの。 From b28fd071d9f94c6ea8158b39e87c1fba27195908 Mon Sep 17 00:00:00 2001 From: yuina-blend Date: Tue, 21 May 2024 18:40:15 +0900 Subject: [PATCH 0922/3948] =?UTF-8?q?[Update]=20gcc=E3=81=AE=E5=8B=95?= =?UTF-8?q?=E4=BD=9C=E7=A2=BA=E8=AA=8D=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7?= =?UTF-8?q?=E3=83=B3=E3=82=92=E8=BF=BD=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/string/stof.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/string/stof.md b/reference/string/stof.md index 70de447f1f..cad7058e70 100644 --- a/reference/string/stof.md +++ b/reference/string/stof.md @@ -164,7 +164,7 @@ float stof(const std::wstring& str, std::size_t* idx = nullptr) { ### 処理系 - [Clang](/implementation.md#clang): ? -- [GCC](/implementation.md#gcc): ? +- [GCC](/implementation.md#gcc): 4.8.5 - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 From 70edaacc6e8278f3d91eacd4d8ccda7652593024 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Tue, 21 May 2024 21:32:20 +0900 Subject: [PATCH 0923/3948] =?UTF-8?q?linalg=20:=20nolink=E3=82=92=E5=89=8A?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/layout_blas_packed.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/linalg/layout_blas_packed.md b/reference/linalg/layout_blas_packed.md index d898cc39c1..27663437cb 100644 --- a/reference/linalg/layout_blas_packed.md +++ b/reference/linalg/layout_blas_packed.md @@ -86,7 +86,7 @@ int main() } ``` * linalg::layout_blas_packed[color ff0000] -* linalg::lower_triangle_t[link lower_triangle_t.md.nolink] +* linalg::lower_triangle_t[link lower_triangle_t.md] * linalg::column_major_t[link column_major_t.md] * linalg::row_major_t[link row_major_t.md] * mat.extent[link /reference/mdspan/mdspan/extent.md] From c8928e428c70f59381bc6fed3fd6af7347363ab0 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 21 May 2024 21:51:54 +0900 Subject: [PATCH 0924/3948] =?UTF-8?q?fix=20typo:=20=E8=AA=A4=E5=AD=97wstin?= =?UTF-8?q?g=E3=82=92CI=E3=81=AB=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/script/ngword_check.py | 1 + reference/string/stod.md | 4 ++-- reference/string/stoi.md | 4 ++-- reference/string/stol.md | 4 ++-- reference/string/stold.md | 4 ++-- reference/string/stoll.md | 4 ++-- reference/string/stoul.md | 4 ++-- reference/string/stoull.md | 4 ++-- 8 files changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/script/ngword_check.py b/.github/workflows/script/ngword_check.py index 96a0f537b0..631d6da97e 100644 --- a/.github/workflows/script/ngword_check.py +++ b/.github/workflows/script/ngword_check.py @@ -28,6 +28,7 @@ ("", "移譲", "委譲"), ("", r'型]\((.*?)\)型', "型](link)"), ("", "constepx", "constexpr"), + ("", "wsting", "wstring"), ("reference/chrono", "dulation", "duration"), ("reference/random", "施行", "試行"), ("reference/random", "疑似", "擬似"), diff --git a/reference/string/stod.md b/reference/string/stod.md index aa31310ef3..2ba9bcf526 100644 --- a/reference/string/stod.md +++ b/reference/string/stod.md @@ -174,8 +174,8 @@ double stod(const std::wstring& str, std::size_t* idx = nullptr) { ## 関連リンク ### C標準ライブラリに由来する関数 -- `atof`: `stod`は`atof`を`std::string`および`std::wsting`に対応させたものと見なせる。 -- `strtod`, `wcstod`: `stod`は`strtod`および`wcstod`をそれぞれ`std::string`と`std::wsting`に対応させたものと見なせる。 +- `atof`: `stod`は`atof`を`std::string`および`std::wstring`に対応させたものと見なせる。 +- `strtod`, `wcstod`: `stod`は`strtod`および`wcstod`をそれぞれ`std::string`と`std::wstring`に対応させたものと見なせる。 ### ファミリー - [`stoi`](stoi.md): 戻り値の型が`int`となったもの。 diff --git a/reference/string/stoi.md b/reference/string/stoi.md index d8b2bc68b4..bd4c3293ed 100644 --- a/reference/string/stoi.md +++ b/reference/string/stoi.md @@ -234,8 +234,8 @@ int stoi(const std::wstring& str, std::size_t* idx = nullptr, int base = 10) { ## 関連リンク ### C標準ライブラリに由来する関数 -- `atoi`: `stoi`は`atoi`を`std::string`および`std::wsting`に対応させたものと見なせる。 -- `strtol`, `wcstol`: `stoi`は`strtol`および`wcstol`をそれぞれ`std::string`と`std::wsting`に対応させ、戻り値の型を`int`に変更したものと見なせる。 +- `atoi`: `stoi`は`atoi`を`std::string`および`std::wstring`に対応させたものと見なせる。 +- `strtol`, `wcstol`: `stoi`は`strtol`および`wcstol`をそれぞれ`std::string`と`std::wsrting`に対応させ、戻り値の型を`int`に変更したものと見なせる。 ### ファミリー - (`stoi`: この関数自身) diff --git a/reference/string/stol.md b/reference/string/stol.md index d275a9eda1..e6ee4ced95 100644 --- a/reference/string/stol.md +++ b/reference/string/stol.md @@ -232,8 +232,8 @@ long stol(const std::wstring& str, std::size_t* idx = nullptr, long base = 10) { ## 関連リンク ### C標準ライブラリに由来する関数 -- `atol`: `stol`は`atol`を`std::string`および`std::wsting`に対応させたものと見なせる。 -- `strtol`, `wcstol`: `stol`は`strtol`および`wcstol`をそれぞれ`std::string`と`std::wsting`に対応させたものと見なせる。 +- `atol`: `stol`は`atol`を`std::string`および`std::wstring`に対応させたものと見なせる。 +- `strtol`, `wcstol`: `stol`は`strtol`および`wcstol`をそれぞれ`std::string`と`std::wsrting`に対応させたものと見なせる。 ### ファミリー - [`stoi`](stoi.md): 戻り値の型が`int`となったもの。 diff --git a/reference/string/stold.md b/reference/string/stold.md index 73df518c8f..3f792315e0 100644 --- a/reference/string/stold.md +++ b/reference/string/stold.md @@ -173,8 +173,8 @@ long double stold(const std::wstring& str, std::size_t* idx = nullptr) { ## 関連リンク ### C標準ライブラリに由来する関数 -- `atof`: `stold`は`atof`を`std::string`および`std::wsting`に対応させ、戻り値の型を`long double`に変更したものと見なせる。 -- `strtold`, `wcstold`: `stold`は`strtold`および`wcstold`をそれぞれ`std::string`と`std::wsting`に対応させたものと見なせる。 +- `atof`: `stold`は`atof`を`std::string`および`std::wstring`に対応させ、戻り値の型を`long double`に変更したものと見なせる。 +- `strtold`, `wcstold`: `stold`は`strtold`および`wcstold`をそれぞれ`std::string`と`std::wstring`に対応させたものと見なせる。 ### ファミリー - [`stoi`](stoi.md): 戻り値の型が`int`となったもの。 diff --git a/reference/string/stoll.md b/reference/string/stoll.md index 8d0012f11a..998ad09f07 100644 --- a/reference/string/stoll.md +++ b/reference/string/stoll.md @@ -237,8 +237,8 @@ long long stoll(const std::wstring& str, std::size_t* idx = nullptr, long long b ## 関連リンク ### C標準ライブラリに由来する関数 -- `atoll`: `stoll`は`atoll`を`std::string`および`std::wsting`に対応させたものと見なせる。 -- `strtoll`, `wcstlol`: `stoll`は`strtoll`および`wcstoll`をそれぞれ`std::string`と`std::wsting`に対応させたものと見なせる。 +- `atoll`: `stoll`は`atoll`を`std::string`および`std::wstring`に対応させたものと見なせる。 +- `strtoll`, `wcstlol`: `stoll`は`strtoll`および`wcstoll`をそれぞれ`std::string`と`std::wstring`に対応させたものと見なせる。 ### ファミリー - [`stoi`](stoi.md): 戻り値の型が`int`となったもの。 diff --git a/reference/string/stoul.md b/reference/string/stoul.md index b541107974..d484ed9480 100644 --- a/reference/string/stoul.md +++ b/reference/string/stoul.md @@ -237,8 +237,8 @@ unsigned long stoul(const std::wstring& str, std::size_t* idx = nullptr, unsigne ## 関連リンク ### C標準ライブラリに由来する関数 -- `atol`: `stoul`は`atol`を`std::string`および`std::wsting`に対応させ、戻り値の型を`unsigned long`に変更したものと見なせる。 -- `strtoul`, `wcstoul`: `stoul`は`strtoul`および`wcstoul`をそれぞれ`std::string`と`std::wsting`に対応させたものと見なせる。 +- `atol`: `stoul`は`atol`を`std::string`および`std::wstring`に対応させ、戻り値の型を`unsigned long`に変更したものと見なせる。 +- `strtoul`, `wcstoul`: `stoul`は`strtoul`および`wcstoul`をそれぞれ`std::string`と`std::wstring`に対応させたものと見なせる。 ### ファミリー - [`stoi`](stoi.md): 戻り値の型が`int`となったもの。 diff --git a/reference/string/stoull.md b/reference/string/stoull.md index 0fd295fc1a..099f842888 100644 --- a/reference/string/stoull.md +++ b/reference/string/stoull.md @@ -237,8 +237,8 @@ unsigned long long stoull(const std::wstring& str, std::size_t* idx = nullptr, u ## 関連リンク ### C標準ライブラリに由来する関数 -- `atoll`: `stoull`は`atoll`を`std::string`および`std::wsting`に対応させ、戻り値の型を`unsigned long long`に変更したものと見なせる。 -- `strtoll`, `wcstoll`: `stoull`は`strtoll`および`wcstoull`をそれぞれ`std::string`と`std::wsting`に対応させたものと見なせる。 +- `atoll`: `stoull`は`atoll`を`std::string`および`std::wstring`に対応させ、戻り値の型を`unsigned long long`に変更したものと見なせる。 +- `strtoll`, `wcstoll`: `stoull`は`strtoll`および`wcstoull`をそれぞれ`std::string`と`std::wstring`に対応させたものと見なせる。 ### ファミリー - [`stoi`](stoi.md): 戻り値の型が`int`となったもの。 From 6c6e404447e412c54bae088a68b7d99b06f00b24 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Wed, 22 May 2024 15:07:03 +0900 Subject: [PATCH 0925/3948] =?UTF-8?q?linalg=20:=20=E8=AA=A4=E5=AD=97?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/linalg.md b/reference/linalg.md index 4c2a32f863..672a048ef7 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -16,7 +16,7 @@ BLAS互換アルゴリズムは、演算対象データの次元数や計算オ 例えば、2個の一般行列の積を求める`std::linalg::matrix_product`はLevel 3 BLASルーチン`xGEMM`に対応する。 (実際のBLASルーチン名は、浮動小数点数型の単精度`S`/倍精度`D`とそれぞれの複素数版`C`,`Z`として、プレフィックス`x`部は文字4種類のいずれか。) -また、`std::mdpan`と組み合わせて利用する拡張機能が提供される。 +また、`std::mdspan`と組み合わせて利用する拡張機能が提供される。 ## 共通要件 From 120f1f627581cf4bda26449fa5f583f221f7ed9c Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Wed, 22 May 2024 16:53:48 +0900 Subject: [PATCH 0926/3948] =?UTF-8?q?reference/string/sto{d,ld}:=20?= =?UTF-8?q?=E5=87=BA=E5=8A=9B=E4=BE=8B=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/string/stod.md | 1 + reference/string/stold.md | 2 ++ 2 files changed, 3 insertions(+) diff --git a/reference/string/stod.md b/reference/string/stod.md index 2ba9bcf526..0f93cc79f5 100644 --- a/reference/string/stod.md +++ b/reference/string/stod.md @@ -101,6 +101,7 @@ int main() ### 出力例 ``` +---- decimal point 1.5 1 ---- base = 8 diff --git a/reference/string/stold.md b/reference/string/stold.md index 3f792315e0..8f3bf834f8 100644 --- a/reference/string/stold.md +++ b/reference/string/stold.md @@ -101,8 +101,10 @@ int main() ### 出力例 ``` +---- decimal point 1.5 1 +---- base = 8 500 250 ---- base = 16 From 6e08bd6c0347b22fa88af6e1d4a6fa933bc75939 Mon Sep 17 00:00:00 2001 From: Nagarei Date: Wed, 22 May 2024 22:41:07 +0900 Subject: [PATCH 0927/3948] =?UTF-8?q?fix=20typo:=20zoned=5Ftime=20?= =?UTF-8?q?=E3=81=AE=E3=82=B5=E3=83=B3=E3=83=97=E3=83=AB=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=89=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/chrono/zoned_time.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/chrono/zoned_time.md b/reference/chrono/zoned_time.md index 03d356f4ae..2d11baae20 100644 --- a/reference/chrono/zoned_time.md +++ b/reference/chrono/zoned_time.md @@ -116,7 +116,7 @@ int main() // UTCタイムゾーンのシステム時間を、日本のローカル時間に変換 chrono::local_time lt = chrono::zoned_time{"Asia/Tokyo", now}.get_local_time(); - std::cout << "7 : "lt << std::endl; + std::cout << "7 : " << lt << std::endl; } ``` * chrono::zoned_time[color ff0000] From 8aa06cdecc223b81b37448811e897eef0c0c1847 Mon Sep 17 00:00:00 2001 From: yuina-blend Date: Fri, 24 May 2024 08:58:23 +0900 Subject: [PATCH 0928/3948] =?UTF-8?q?[Fix]=20srting=E3=81=A8=E3=81=AA?= =?UTF-8?q?=E3=81=A3=E3=81=A6=E3=81=84=E3=81=9F=E3=81=AE=E3=81=A7=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/string/stoi.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/string/stoi.md b/reference/string/stoi.md index bd4c3293ed..de86bacbe9 100644 --- a/reference/string/stoi.md +++ b/reference/string/stoi.md @@ -235,7 +235,7 @@ int stoi(const std::wstring& str, std::size_t* idx = nullptr, int base = 10) { ## 関連リンク ### C標準ライブラリに由来する関数 - `atoi`: `stoi`は`atoi`を`std::string`および`std::wstring`に対応させたものと見なせる。 -- `strtol`, `wcstol`: `stoi`は`strtol`および`wcstol`をそれぞれ`std::string`と`std::wsrting`に対応させ、戻り値の型を`int`に変更したものと見なせる。 +- `strtol`, `wcstol`: `stoi`は`strtol`および`wcstol`をそれぞれ`std::string`と`std::wstring`に対応させ、戻り値の型を`int`に変更したものと見なせる。 ### ファミリー - (`stoi`: この関数自身) From 643030cb7553fe159b0d27b205a7161e1f291693 Mon Sep 17 00:00:00 2001 From: yuina-blend Date: Fri, 24 May 2024 09:00:29 +0900 Subject: [PATCH 0929/3948] [Fix] same typo --- reference/string/stol.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/string/stol.md b/reference/string/stol.md index e6ee4ced95..204cb49908 100644 --- a/reference/string/stol.md +++ b/reference/string/stol.md @@ -233,7 +233,7 @@ long stol(const std::wstring& str, std::size_t* idx = nullptr, long base = 10) { ## 関連リンク ### C標準ライブラリに由来する関数 - `atol`: `stol`は`atol`を`std::string`および`std::wstring`に対応させたものと見なせる。 -- `strtol`, `wcstol`: `stol`は`strtol`および`wcstol`をそれぞれ`std::string`と`std::wsrting`に対応させたものと見なせる。 +- `strtol`, `wcstol`: `stol`は`strtol`および`wcstol`をそれぞれ`std::string`と`std::wstring`に対応させたものと見なせる。 ### ファミリー - [`stoi`](stoi.md): 戻り値の型が`int`となったもの。 From 0eeefc0f1db52a7f5bdf7f2860daebcbefb674a4 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 24 May 2024 18:49:49 +0900 Subject: [PATCH 0930/3948] =?UTF-8?q?error=5Fcode=E3=81=AE=E3=82=B3?= =?UTF-8?q?=E3=83=B3=E3=82=B9=E3=83=88=E3=83=A9=E3=82=AF=E3=82=BF=20:=20Er?= =?UTF-8?q?rorCodeEnum=E3=82=92=E3=81=A8=E3=82=8B=E3=82=AA=E3=83=BC?= =?UTF-8?q?=E3=83=90=E3=83=BC=E3=83=AD=E3=83=BC=E3=83=89=E3=81=AE=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E3=82=92=E8=A8=98=E8=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system_error/error_code/op_constructor.md | 64 ++++++++++++++++++- 1 file changed, 61 insertions(+), 3 deletions(-) diff --git a/reference/system_error/error_code/op_constructor.md b/reference/system_error/error_code/op_constructor.md index 03071efb19..bc4fd6c500 100644 --- a/reference/system_error/error_code/op_constructor.md +++ b/reference/system_error/error_code/op_constructor.md @@ -31,10 +31,12 @@ error_code(ErrorCodeEnum e) noexcept; // (3) ## 備考 -- (3) : [`is_error_code_enum`](../is_error_code_enum.md)が`false`となる場合、この関数はオーバーロード解決から除外される。 +- (3) : [`is_error_code_enum`](../is_error_code_enum.md)が`false`となる場合、この関数はオーバーロード解決から除外される +- (3) : [`make_error_code()`](../make_error_code.md)の呼び出しに`std::`名前空間がついていないことにより、指定された`ErrorCodeEnum`型が定義されている名前空間の`make_error_code()`関数がADLによって探索される ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -107,7 +109,7 @@ int main() * std::errc::invalid_argument[link /reference/system_error/errc.md] * std::generic_category()[link /reference/system_error/generic_category.md] -### 出力 +#### 出力 ``` default ctor success @@ -125,6 +127,63 @@ error generic ``` +### 独自のエラーコードを定義する例 +```cpp example +#include +#include +#include + +namespace mylib { + +enum class my_error { + not_found, +}; + +class my_error_category : public std::error_category { +public: + const char* name() const noexcept override + { + return "my_error_category"; + } + + std::string message(int value) const override + { + if (value == static_cast(my_error::not_found)) + return "not found"; + return "unknown"; + } +}; + +const my_error_category& get_my_error_category() { + static my_error_category cat; + return cat; +} + +std::error_code make_error_code(my_error err) +{ + return std::error_code(static_cast(err), get_my_error_category()); +} +} + +namespace std { + template <> + struct is_error_code_enum : public std::true_type {}; +} + +int main() { + // ecにはmy_error_categoryが設定される + std::error_code ec = mylib::my_error::not_found; + std::cout << ec.message() << std::endl; +} +``` +* ec.message()[link message.md] +* std::error_category[link /reference/system_error/error_category.md] + +#### 出力 +``` +not found +``` + ## バージョン ### 言語 - C++11 @@ -136,4 +195,3 @@ generic - [Visual C++](/implementation.md#visual_cpp): 2010 (enum class未対応のため、ErrorCodeEnumのコンストラクタは動作しない) -## 参照 From 1815c86a37ee1ed57128214c32d7797c2f6ef90d Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 24 May 2024 19:22:57 +0900 Subject: [PATCH 0931/3948] =?UTF-8?q?=E7=94=A8=E8=AA=9E=E5=AE=9A=E7=BE=A9?= =?UTF-8?q?=20:=20ADL=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_DEFINED_WORDS.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/GLOBAL_DEFINED_WORDS.json b/GLOBAL_DEFINED_WORDS.json index 9d9cbfe40a..f48ec03683 100644 --- a/GLOBAL_DEFINED_WORDS.json +++ b/GLOBAL_DEFINED_WORDS.json @@ -88,5 +88,8 @@ }, "標準浮動小数点数型": { "desc": "拡張浮動小数点数型の対義語としてfloat / double / long doubleを指す用語" + }, + "ADL": { + "desc": "実引数依存の名前探索 (Argument Dependent Lookup)。引数の型が所属する名前空間の関数を探索する言語機能" } } From f44efbadac8fe2f59bdf10033031dd0657df1820 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Sat, 25 May 2024 21:07:58 +0900 Subject: [PATCH 0932/3948] =?UTF-8?q?linalg=20:=20setup=5Fgivens=5Frotatio?= =?UTF-8?q?n=E3=81=A8=E3=82=BF=E3=82=B0=E5=AE=9A=E6=95=B0=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 48 ++++++---- reference/linalg/setup_givens_rotation.md | 87 +++++++++++++++++++ .../linalg/setup_givens_rotation_result.md | 56 ++++++++++++ 3 files changed, 175 insertions(+), 16 deletions(-) create mode 100644 reference/linalg/setup_givens_rotation.md create mode 100644 reference/linalg/setup_givens_rotation_result.md diff --git a/reference/linalg.md b/reference/linalg.md index 672a048ef7..1364c4b65e 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -42,12 +42,24 @@ BLAS互換アルゴリズムは、演算対象データの次元数や計算オ | [`conjugate_transposed`](linalg/conjugate_transposed.md) | 読み取り専用の複素共役転置ビュー`std::mdspan`を作る (function template) | C++26 | +## BLASの要件 +BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に制約されていない場合、テンプレートパラメータの名前によって以下の制約を満たすとする。 + +| 名前 | 制約 | +|------|------| +| `ExecutionPolicy` | `is_execution_policy::value == true` | +| `Real` | `complex`が規定できる型 | +| `Triangle` | `upper_triangle_t`または`lower_triangle_t` | +| `DiagonalStorage` | `implicit_unit_diagonal_t`または`implicit_unit_diagonal_t` | + + ## BLAS 1アルゴリズム +`std::mpspan`をパラメータに持つ、この節の全てのアルゴリズムの計算量は渡された`std::mdspan`の`extents`の積の最大値、つまりベクトルや行列の要素数の最大値に線形である。 | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| `setup_givens_rotation_result` | `setup_givens_rotation`の結果型 (class template) | C++26 | -| `setup_givens_rotation` | xLARTG: ギブンス回転をセットアップする (function template) | C++26 | +| [`setup_givens_rotation_result`](linalg/setup_givens_rotation_result.md) | `setup_givens_rotation`の結果型 (class template) | C++26 | +| [`setup_givens_rotation`](linalg/setup_givens_rotation.md) | xLARTG: ギブンス回転をセットアップする (function template) | C++26 | | `apply_givens_rotation` | xROT: ベクトルにギブンス回転を適用する (function template) | C++26 | | `swap_elements` | xSWAP: 2つのベクトル/行列の要素を交換する (function template) | C++26 | | `scale` | xSCAL: ベクトル/行列の要素にスカラ値を乗算する (function template) | C++26 | @@ -103,35 +115,38 @@ BLAS互換アルゴリズムは、演算対象データの次元数や計算オ ## タグ ``ヘッダでは、行列の格納順序や三角行列の上下をタグを使って表現している。 -以下、型名を掲載するが、定数も次のように定義されている。 - -```cpp -inline constexpr tag_name_t tag_name{}; -``` ### 格納順序 行列の格納順序を表すタグ。 -| 型名 | 説明 | 対応バージョン | +| 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`column_major_t`](linalg/column_major_t.md) | 列優先(column-major) | C++26 | -| [`row_major_t`](linalg/row_major_t.md) | 行優先(row-major) | C++26 | +| [`column_major_t`](linalg/column_major_t.md) | 列優先(column-major)を表すタグ型 | C++26 | +| [`column_major`](linalg/column_major_t.md) | 列優先(column-major)を表すタグ値 | C++26 | +| [`row_major_t`](linalg/row_major_t.md) | 行優先(row-major)を表すタグ型 | C++26 | +| [`row_major`](linalg/row_major_t.md) | 行優先(row-major)を表すタグ値 | C++26 | + ### 三角行列 上三角行列か下三角行列かを表すタグ。 -| 型名 | 説明 | 対応バージョン | +| 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`upper_triangle_t`](linalg/upper_triangle_t.md) | 上三角行列 | C++26 | -| [`lower_triangle_t`](linalg/lower_triangle_t.md) | 下三角行列 | C++26 | +| [`upper_triangle_t`](linalg/upper_triangle_t.md) | 上三角行列を表すタグ型 | C++26 | +| [`upper_triangle`](linalg/upper_triangle_t.md) | 上三角行列を表すタグ値 | C++26 | +| [`lower_triangle_t`](linalg/lower_triangle_t.md) | 下三角行列を表すタグ型 | C++26 | +| [`lower_triangle`](linalg/lower_triangle_t.md) | 下三角行列を表すタグ値 | C++26 | + ### 対角成分 行列の全ての対角成分を暗黙に乗法における単位元とみなすかどうかを表すタグ。みなした場合、行列の対角成分にはアクセスせず、値が乗法における単位元であるとして計算する。 -| 型名 | 説明 | 対応バージョン | +| 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`implicit_unit_diagonal_t`](linalg/implicit_unit_diagonal_t.md) | 全ての対角成分を暗黙に乗法における単位元とみなす | C++26 | -| [`explicit_diagonal_t`](linalg/explicit_diagonal_t.md) | 全ての対角成分にアクセスする | C++26 | +| [`implicit_unit_diagonal_t`](linalg/implicit_unit_diagonal_t.md) | 全ての対角成分を暗黙に乗法における単位元とみなすタグ型 | C++26 | +| [`implicit_unit_diagonal`](linalg/implicit_unit_diagonal_t.md) | 全ての対角成分を暗黙に乗法における単位元とみなすタグ値 | C++26 | +| [`explicit_diagonal_t`](linalg/explicit_diagonal_t.md) | 全ての対角成分にアクセスするタグ型 | C++26 | +| [`explicit_diagonal`](linalg/explicit_diagonal_t.md) | 全ての対角成分にアクセスするタグ値 | C++26 | ## バージョン @@ -148,3 +163,4 @@ inline constexpr tag_name_t tag_name{}; - [P1674R2: Evolving a Standard C++ Linear Algebra Library from the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1674r2.html) - [std::linalg: Linear Algebra Coming to Standard C++](https://github.com/CppCon/CppCon2023/blob/main/Presentations/stdlinalg_linear_algebra_coming_to_standard_cpp.pdf), CppCon 2023 - [BLAS (Basic Linear Algebra Subprograms)](https://www.netlib.org/blas/) +- [Numerics library](https://eel.is/c++draft/complex.numbers) diff --git a/reference/linalg/setup_givens_rotation.md b/reference/linalg/setup_givens_rotation.md new file mode 100644 index 0000000000..d8695048fb --- /dev/null +++ b/reference/linalg/setup_givens_rotation.md @@ -0,0 +1,87 @@ +# setup_givens_rotation + +* [mathjax enable] +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::linalg { + template + setup_givens_rotation_result setup_givens_rotation(Real a, Real b) noexcept; // (1) + + template + setup_givens_rotation_result> setup_givens_rotation(complex a, complex b) noexcept; // (2) +} +``` + + +## 概要 +ギブンス回転を計算する。すなわち、以下の式が成り立つような、`Real`型の値`c`と `s`, `r`を計算する。 + +$$ +\begin{split} +\begin{pmatrix} +c & s \\ +-\overline{s} & c +\end{pmatrix} +\begin{pmatrix} +a \\ +b +\end{pmatrix} +&= +\begin{pmatrix} +r \\ +0 +\end{pmatrix},\\ +c^2 + |s|^2 &= 1 +\end{split} +$$ + +ただし、`s`と`r`の型は`a`と`b`の型による。 + +- (1) `a`と`b`の型が`Real`の場合、`s`と`r`の型も`Real`。`r`は$(a, b)^T$のユークリッドノルム、つまり$\sqrt{|a|^2 + |b|^2}$である。 +- (2) `a`と`b`の型が`complex`の場合、`s`と`r`の型も`complex`。以下で定義される$sgn$関数を用いると、`r`は$sgn(a) * \sqrt{|a|^2 + |b|^2}$である。 +$$ +sgn(x)= + \begin{cases} + \frac{x}{|x|} & \text{($x \neq 0$)} \\ + 1 & \text{($x = 0$)} + \end{cases} +$$ + + +## テンプレートパラメータ制約 +- `Real`は`complex`が規定できる型であること。 + + +## 戻り値 +`c`と`s`が入力$(a, b)^T$に対するギブンス回転行列の成分で、`r`を入力$(a, b)^T$のユークリッドノルムとすると、戻り値は`{c, s, r}`である。 + + +## 例 + + +### 出力 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`setup_givens_rotation_result`](setup_givens_rotation_result.md) + + +## 参照 +- [P0788R3 Standard Library Specification in a Concepts and Contracts World](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0788r3.pdf) +- [Working Draft Programming Languages — C++: 28 Numerics libarary](https://eel.is/c++draft/complex.numbers) +- [LAPACK: clartg](https://netlib.org/lapack/explore-html/da/dd3/group__lartg_ga45afd4405cf6da478ce4de9576303369.html#ga45afd4405cf6da478ce4de9576303369) diff --git a/reference/linalg/setup_givens_rotation_result.md b/reference/linalg/setup_givens_rotation_result.md new file mode 100644 index 0000000000..d921a230df --- /dev/null +++ b/reference/linalg/setup_givens_rotation_result.md @@ -0,0 +1,56 @@ +# setup_givens_rotation_result +* linalg[meta header] +* class template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::linalg { + template + struct setup_givens_rotation_result { + Real c; + Real s; + Real r; + }; + + template + struct setup_givens_rotation_result> { + Real c; + complex s; + complex r; + }; +} +``` + +## 概要 +ギブンス回転の結果を表すクラス。詳しくは、[`setup_givens_rotation`](setup_givens_rotation.md)にて。 + + +## テンプレートパラメータ制約 +- `Real`は`complex`が規定できる型であること。 + + +## 例 + + +### 出力 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`setup_givens_rotation`](setup_givens_rotation.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) +- [Numerics library](https://eel.is/c++draft/complex.numbers) \ No newline at end of file From 0cebcd7b2f44fb9b5f221a8c9f161c018f826be1 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Sun, 26 May 2024 00:37:48 +0900 Subject: [PATCH 0933/3948] =?UTF-8?q?linalg=20:=20sgn=E9=96=A2=E6=95=B0?= =?UTF-8?q?=E3=81=AE=E5=AE=9A=E7=BE=A9=E3=81=A7=E3=82=B3=E3=83=AD=E3=83=B3?= =?UTF-8?q?=E3=81=8C=E6=8A=9C=E3=81=91=E3=81=A6=E3=81=84=E3=81=9F(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/setup_givens_rotation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/linalg/setup_givens_rotation.md b/reference/linalg/setup_givens_rotation.md index d8695048fb..cde2e71a9b 100644 --- a/reference/linalg/setup_givens_rotation.md +++ b/reference/linalg/setup_givens_rotation.md @@ -44,7 +44,7 @@ $$ - (1) `a`と`b`の型が`Real`の場合、`s`と`r`の型も`Real`。`r`は$(a, b)^T$のユークリッドノルム、つまり$\sqrt{|a|^2 + |b|^2}$である。 - (2) `a`と`b`の型が`complex`の場合、`s`と`r`の型も`complex`。以下で定義される$sgn$関数を用いると、`r`は$sgn(a) * \sqrt{|a|^2 + |b|^2}$である。 $$ -sgn(x)= +sgn(x):= \begin{cases} \frac{x}{|x|} & \text{($x \neq 0$)} \\ 1 & \text{($x = 0$)} From 3d8a0aed240a440efe09501d88a6c3b7bd697d21 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 6 Jun 2022 03:15:08 +0900 Subject: [PATCH 0934/3948] github: check out the "image" repository --- .github/workflows/build.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 48834405ca..2d412292c9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -54,6 +54,12 @@ jobs: - run: git submodule update -i working-directory: site_generator/cpprefjp/site + # site + - uses: actions/checkout@v2 + with: + repository: cpprefjp/image + path: site_generator/cpprefjp/image + - name: Set up Python 3.x uses: actions/setup-python@v5 with: From 8161c9377bd8be4ef493767fd6710ab3bc61dfda Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 6 Jun 2022 03:23:51 +0900 Subject: [PATCH 0935/3948] =?UTF-8?q?image=E3=83=AA=E3=83=9D=E3=82=B8?= =?UTF-8?q?=E3=83=88=E3=83=AA=E3=81=AE=E7=94=BB=E5=83=8FURL=E3=82=92?= =?UTF-8?q?=E6=A8=99=E6=BA=96=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 10 +++++----- lang/cpp17/type_deduction_for_class_templates.md | 2 +- reference/iterator.md | 2 +- reference/random.md | 4 ++-- reference/random/bernoulli_distribution.md | 2 +- reference/random/cauchy_distribution.md | 4 ++-- reference/random/chi_squared_distribution.md | 4 ++-- reference/random/discrete_distribution.md | 6 +++--- reference/random/exponential_distribution.md | 4 ++-- reference/random/extreme_value_distribution.md | 4 ++-- reference/random/fisher_f_distribution.md | 4 ++-- reference/random/gamma_distribution.md | 4 ++-- reference/random/lognormal_distribution.md | 4 ++-- reference/random/normal_distribution.md | 4 ++-- reference/random/piecewise_constant_distribution.md | 4 ++-- reference/random/piecewise_linear_distribution.md | 4 ++-- reference/random/poisson_distribution.md | 4 ++-- reference/random/student_t_distribution.md | 4 ++-- reference/random/uniform_int_distribution.md | 2 +- reference/random/uniform_real_distribution.md | 4 ++-- reference/random/weibull_distribution.md | 4 ++-- reference/scoped_allocator/scoped_allocator_adaptor.md | 6 +++--- start_editing/random_figure.md | 2 +- 23 files changed, 46 insertions(+), 46 deletions(-) diff --git a/index.md b/index.md index 5d0ae89a47..21d997245b 100644 --- a/index.md +++ b/index.md @@ -89,15 +89,15 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい ### シルバースポンサー -

Fixstars
+
Fixstars
-
Acerola Software
+
Acerola Software
-
vaporoid
+
vaporoid
CubeSoft
-
M.Kohana
+
M.Kohana
pegasys
@@ -118,7 +118,7 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい - [Hashitaku様](https://opencollective.com/hashitaku) -
yukika2e
+
yukika2e
- [ugai様](https://opencollective.com/ugai) diff --git a/lang/cpp17/type_deduction_for_class_templates.md b/lang/cpp17/type_deduction_for_class_templates.md index 2e108d1cc8..a7036694dc 100644 --- a/lang/cpp17/type_deduction_for_class_templates.md +++ b/lang/cpp17/type_deduction_for_class_templates.md @@ -291,4 +291,4 @@ int main() - [P0620R0 Drafting for class template argument deduction issues](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0620r0.html) - [LWG Issue 2981. Remove redundant deduction guides from standard library](https://wg21.cmeerw.net/lwg/issue2981) - [P0702R1 Language support for Constructor Template Argument Deduction](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0702r1.html) -- [Class Template Argument Deduction - A New Abstraction - Zhihao Yuan - CppCon 2017](https://github.com/CppCon/CppCon2017/raw/master/Presentations/Class%20Template%20Argument%20Deduction%20-%20A%20New%20Abstraction/Class%20Template%20Argument%20Deduction%20-%20A%20New%20Abstraction%20-%20Zhihao%20Yuan%20-%20CppCon%202017.pdf) +- [Class Template Argument Deduction - A New Abstraction - Zhihao Yuan - CppCon 2017](https://raw.githubusercontent.com/CppCon/CppCon2017/master/Presentations/Class%20Template%20Argument%20Deduction%20-%20A%20New%20Abstraction/Class%20Template%20Argument%20Deduction%20-%20A%20New%20Abstraction%20-%20Zhihao%20Yuan%20-%20CppCon%202017.pdf) diff --git a/reference/iterator.md b/reference/iterator.md index 4052c30c18..585eb9ff58 100644 --- a/reference/iterator.md +++ b/reference/iterator.md @@ -7,7 +7,7 @@ C++標準ライブラリのイテレータは、以下のように階層的に定義される。 この階層はC++言語機能の継承と同じように見なせる。たとえば、入力イテレータと前方向イテレータはis a関係が成り立っており、前方向イテレータは入力イテレータと見なすことができる。 -![](https://raw.github.com/cpprefjp/image/master/reference/iterator/iterators.jpg) +![](https://raw.githubusercontent.com/cpprefjp/image/master/reference/iterator/iterators.jpg) C++20以降の標準ライブラリでは、任意のイテレータに対して可能な操作によって上記5つに隣接イテレータ(*contiguous iterator*)を加えた6つのイテレータカテゴリを定義する。それぞれ次のイテレータコンセプトが対応する。 diff --git a/reference/random.md b/reference/random.md index 857ce52f60..4df6517ac8 100644 --- a/reference/random.md +++ b/reference/random.md @@ -184,9 +184,9 @@ int main() * dist1(engine)[link random/uniform_real_distribution/op_call.md] * dist2(engine)[link random/normal_distribution/op_call.md] -この例である時得られた [random.tsv](https://github.com/cpprefjp/image/raw/master/reference/random/random.tsv.xz) (ファイルサイズが大きいので添付する上では random.tsv.xz に圧縮) を元に、得られたデータの密度を図示すると、以下のような図が得られた。 +この例である時得られた [random.tsv](https://raw.githubusercontent.com/cpprefjp/image/master/reference/random/random.tsv.xz) (ファイルサイズが大きいので添付する上では random.tsv.xz に圧縮) を元に、得られたデータの密度を図示すると、以下のような図が得られた。 -![](https://github.com/cpprefjp/image/raw/master/reference/random/random.png) +![](https://raw.githubusercontent.com/cpprefjp/image/master/reference/random/random.png) 破線は dist1 (一様分布; min=-1.0f, max=1.0f) 、実線は dist2 (正規分布; mean=1.0f, stdev=0.5f) 、横軸は値、縦軸は密度(値の件数を区間ごとに数えたヒストグラムを全体に占める割合で表したもの)である。 diff --git a/reference/random/bernoulli_distribution.md b/reference/random/bernoulli_distribution.md index 644e2848e8..f1acf3fdb4 100644 --- a/reference/random/bernoulli_distribution.md +++ b/reference/random/bernoulli_distribution.md @@ -101,7 +101,7 @@ int main() このプログラムによってある時に得られた結果([bernoulli_distribution.tsv](https://github.com/cpprefjp/image/blob/master/reference/random/bernoulli_distribution/bernoulli_distribution.tsv))を図示する。 -![](https://raw.github.com/cpprefjp/image/master/reference/random/bernoulli_distribution/bernoulli_distribution.png) +![](https://raw.githubusercontent.com/cpprefjp/image/master/reference/random/bernoulli_distribution/bernoulli_distribution.png) ## バージョン diff --git a/reference/random/cauchy_distribution.md b/reference/random/cauchy_distribution.md index b8e4a01228..0060af5ea7 100644 --- a/reference/random/cauchy_distribution.md +++ b/reference/random/cauchy_distribution.md @@ -107,9 +107,9 @@ int main() ``` ``` -このプログラムによってある時に得られた結果([cauchy_distribution.tsv](https://github.com/cpprefjp/image/raw/master/reference/random/cauchy_distribution/cauchy_distribution.tsv))を図示する。 +このプログラムによってある時に得られた結果([cauchy_distribution.tsv](https://raw.githubusercontent.com/cpprefjp/image/master/reference/random/cauchy_distribution/cauchy_distribution.tsv))を図示する。 -![](https://github.com/cpprefjp/image/raw/master/reference/random/cauchy_distribution/cauchy_distribution.png) +![](https://raw.githubusercontent.com/cpprefjp/image/master/reference/random/cauchy_distribution/cauchy_distribution.png) ## バージョン ### 言語 diff --git a/reference/random/chi_squared_distribution.md b/reference/random/chi_squared_distribution.md index 048eb7ff91..e631765bf6 100644 --- a/reference/random/chi_squared_distribution.md +++ b/reference/random/chi_squared_distribution.md @@ -108,9 +108,9 @@ int main() ``` ``` -このプログラムによってある時に得られた結果([chi_squared_distribution.tsv](https://github.com/cpprefjp/image/raw/master/reference/random/chi_squared_distribution/chi_squared_distribution.tsv))を図示する。 +このプログラムによってある時に得られた結果([chi_squared_distribution.tsv](https://raw.githubusercontent.com/cpprefjp/image/master/reference/random/chi_squared_distribution/chi_squared_distribution.tsv))を図示する。 -![](https://github.com/cpprefjp/image/raw/master/reference/random/chi_squared_distribution/chi_squared_distribution.png) +![](https://raw.githubusercontent.com/cpprefjp/image/master/reference/random/chi_squared_distribution/chi_squared_distribution.png) ## バージョン ### 言語 diff --git a/reference/random/discrete_distribution.md b/reference/random/discrete_distribution.md index 21dc1e94ea..11a9e6e4d2 100644 --- a/reference/random/discrete_distribution.md +++ b/reference/random/discrete_distribution.md @@ -114,10 +114,10 @@ int main() ``` ``` -このプログラムによってある時に得られた結果(;[discrete_distribution.tsv.7z](https://github.com/cpprefjp/image/raw/master/reference/random/discrete_distribution/discrete_distribution.tsv.7z))を図示する。 +このプログラムによってある時に得られた結果(;[discrete_distribution.tsv.7z](https://raw.githubusercontent.com/cpprefjp/image/master/reference/random/discrete_distribution/discrete_distribution.tsv.7z))を図示する。 -![](https://github.com/cpprefjp/image/raw/master/reference/random/discrete_distribution/discrete_distribution.png) -![](https://github.com/cpprefjp/image/raw/master/reference/random/discrete_distribution/discrete_distribution-hist.png) +![](https://raw.githubusercontent.com/cpprefjp/image/master/reference/random/discrete_distribution/discrete_distribution.png) +![](https://raw.githubusercontent.com/cpprefjp/image/master/reference/random/discrete_distribution/discrete_distribution-hist.png) ## バージョン diff --git a/reference/random/exponential_distribution.md b/reference/random/exponential_distribution.md index 16ba26893f..6d46ff1ff2 100644 --- a/reference/random/exponential_distribution.md +++ b/reference/random/exponential_distribution.md @@ -106,9 +106,9 @@ int main() ``` ``` -このプログラムによってある時に得られた結果([exponential_distribution.tsv](https://github.com/cpprefjp/image/raw/master/reference/random/exponential_distribution/exponential_distribution.tsv))を図示する。 +このプログラムによってある時に得られた結果([exponential_distribution.tsv](https://raw.githubusercontent.com/cpprefjp/image/master/reference/random/exponential_distribution/exponential_distribution.tsv))を図示する。 -![](https://github.com/cpprefjp/image/raw/master/reference/random/exponential_distribution/exponential_distribution.png) +![](https://raw.githubusercontent.com/cpprefjp/image/master/reference/random/exponential_distribution/exponential_distribution.png) ## バージョン ### 言語 diff --git a/reference/random/extreme_value_distribution.md b/reference/random/extreme_value_distribution.md index 7b1a2f1f2b..1ec73ffec4 100644 --- a/reference/random/extreme_value_distribution.md +++ b/reference/random/extreme_value_distribution.md @@ -108,9 +108,9 @@ int main() ``` ``` -このプログラムによってある時に得られた結果([extreme_value_distribution.tsv](https://github.com/cpprefjp/image/raw/master/reference/random/extreme_value_distribution/extreme_value_distribution.tsv))を図示する。 +このプログラムによってある時に得られた結果([extreme_value_distribution.tsv](https://raw.githubusercontent.com/cpprefjp/image/master/reference/random/extreme_value_distribution/extreme_value_distribution.tsv))を図示する。 -![](https://github.com/cpprefjp/image/raw/master/reference/random/extreme_value_distribution/extreme_value_distribution.png) +![](https://raw.githubusercontent.com/cpprefjp/image/master/reference/random/extreme_value_distribution/extreme_value_distribution.png) ## バージョン diff --git a/reference/random/fisher_f_distribution.md b/reference/random/fisher_f_distribution.md index 8d4cacc4b6..fdb7a51973 100644 --- a/reference/random/fisher_f_distribution.md +++ b/reference/random/fisher_f_distribution.md @@ -102,9 +102,9 @@ int main() * dist(engine)[link fisher_f_distribution/op_call.md] ### 出力 -このプログラムによってある時に得られた結果([fisher_f_distribution.tsv](https://github.com/cpprefjp/image/raw/master/reference/random/fisher_f_distribution/fisher_f_distribution.tsv))を図示する。 +このプログラムによってある時に得られた結果([fisher_f_distribution.tsv](https://raw.githubusercontent.com/cpprefjp/image/master/reference/random/fisher_f_distribution/fisher_f_distribution.tsv))を図示する。 -![](https://github.com/cpprefjp/image/raw/master/reference/random/fisher_f_distribution/fisher_f_distribution.png) +![](https://raw.githubusercontent.com/cpprefjp/image/master/reference/random/fisher_f_distribution/fisher_f_distribution.png) ## バージョン ### 言語 diff --git a/reference/random/gamma_distribution.md b/reference/random/gamma_distribution.md index b3c7482358..1a052467f1 100644 --- a/reference/random/gamma_distribution.md +++ b/reference/random/gamma_distribution.md @@ -108,9 +108,9 @@ int main() ``` ``` -このプログラムによってある時に得られた結果([gamma_distribution.tsv](https://github.com/cpprefjp/image/raw/master/reference/random/gamma_distribution/gamma_distribution.tsv))を図示する。 +このプログラムによってある時に得られた結果([gamma_distribution.tsv](https://raw.githubusercontent.com/cpprefjp/image/master/reference/random/gamma_distribution/gamma_distribution.tsv))を図示する。 -![](https://github.com/cpprefjp/image/raw/master/reference/random/gamma_distribution/gamma_distribution.png) +![](https://raw.githubusercontent.com/cpprefjp/image/master/reference/random/gamma_distribution/gamma_distribution.png) ## バージョン ### 言語 diff --git a/reference/random/lognormal_distribution.md b/reference/random/lognormal_distribution.md index 60bde6b8e9..ea53f2cb6a 100644 --- a/reference/random/lognormal_distribution.md +++ b/reference/random/lognormal_distribution.md @@ -107,9 +107,9 @@ int main() ``` ``` -このプログラムによってある時に得られた結果([lognormal_distribution.tsv](https://github.com/cpprefjp/image/raw/master/reference/random/lognormal_distribution/lognormal_distribution.tsv))を図示する。 +このプログラムによってある時に得られた結果([lognormal_distribution.tsv](https://raw.githubusercontent.com/cpprefjp/image/master/reference/random/lognormal_distribution/lognormal_distribution.tsv))を図示する。 -![](https://github.com/cpprefjp/image/raw/master/reference/random/lognormal_distribution/lognormal_distribution.png) +![](https://raw.githubusercontent.com/cpprefjp/image/master/reference/random/lognormal_distribution/lognormal_distribution.png) ## バージョン ### 言語 diff --git a/reference/random/normal_distribution.md b/reference/random/normal_distribution.md index c5459affa6..0475667216 100644 --- a/reference/random/normal_distribution.md +++ b/reference/random/normal_distribution.md @@ -106,9 +106,9 @@ int main() ``` ``` -このプログラムによってある時に得られた結果([normal_distribution.tsv](https://github.com/cpprefjp/image/raw/master/reference/random/normal_distribution/normal_distribution.tsv))を図示する。 +このプログラムによってある時に得られた結果([normal_distribution.tsv](https://raw.githubusercontent.com/cpprefjp/image/master/reference/random/normal_distribution/normal_distribution.tsv))を図示する。 -![](https://github.com/cpprefjp/image/raw/master/reference/random/normal_distribution/normal_distribution.png) +![](https://raw.githubusercontent.com/cpprefjp/image/master/reference/random/normal_distribution/normal_distribution.png) ## バージョン ### 言語 diff --git a/reference/random/piecewise_constant_distribution.md b/reference/random/piecewise_constant_distribution.md index 02024632dd..ae61940f66 100644 --- a/reference/random/piecewise_constant_distribution.md +++ b/reference/random/piecewise_constant_distribution.md @@ -100,9 +100,9 @@ int main() ``` ``` -このプログラムによってある時に得られた結果([piecewise_constant_distribution.tsv](https://github.com/cpprefjp/image/raw/master/reference/random/piecewise_constant_distribution/piecewise_constant_distribution.tsv))を図示する。 +このプログラムによってある時に得られた結果([piecewise_constant_distribution.tsv](https://raw.githubusercontent.com/cpprefjp/image/master/reference/random/piecewise_constant_distribution/piecewise_constant_distribution.tsv))を図示する。 -![](https://github.com/cpprefjp/image/raw/master/reference/random/piecewise_constant_distribution/piecewise_constant_distribution.png) +![](https://raw.githubusercontent.com/cpprefjp/image/master/reference/random/piecewise_constant_distribution/piecewise_constant_distribution.png) ## バージョン diff --git a/reference/random/piecewise_linear_distribution.md b/reference/random/piecewise_linear_distribution.md index 4fffc975e5..586acb4d9a 100644 --- a/reference/random/piecewise_linear_distribution.md +++ b/reference/random/piecewise_linear_distribution.md @@ -101,9 +101,9 @@ int main() ``` ``` -このプログラムによってある時に得られた結果([piecewise_linear_distribution.tsv](https://github.com/cpprefjp/image/raw/master/reference/random/piecewise_linear_distribution/piecewise_linear_distribution.tsv))を図示する。 +このプログラムによってある時に得られた結果([piecewise_linear_distribution.tsv](https://raw.githubusercontent.com/cpprefjp/image/master/reference/random/piecewise_linear_distribution/piecewise_linear_distribution.tsv))を図示する。 -![](https://github.com/cpprefjp/image/raw/master/reference/random/piecewise_linear_distribution/piecewise_linear_distribution.png) +![](https://raw.githubusercontent.com/cpprefjp/image/master/reference/random/piecewise_linear_distribution/piecewise_linear_distribution.png) ## バージョン ### 言語 diff --git a/reference/random/poisson_distribution.md b/reference/random/poisson_distribution.md index 4c913a3fdf..9a294e1e4a 100644 --- a/reference/random/poisson_distribution.md +++ b/reference/random/poisson_distribution.md @@ -108,9 +108,9 @@ int main() ``` ``` -このプログラムによってある時に得られた結果([poisson_distribution.tsv](https://github.com/cpprefjp/image/raw/master/reference/random/poisson_distribution/poisson_distribution.tsv))を図示する。 +このプログラムによってある時に得られた結果([poisson_distribution.tsv](https://raw.githubusercontent.com/cpprefjp/image/master/reference/random/poisson_distribution/poisson_distribution.tsv))を図示する。 -![](https://github.com/cpprefjp/image/raw/master/reference/random/poisson_distribution/poisson_distribution.png) +![](https://raw.githubusercontent.com/cpprefjp/image/master/reference/random/poisson_distribution/poisson_distribution.png) ## バージョン ### 言語 diff --git a/reference/random/student_t_distribution.md b/reference/random/student_t_distribution.md index 242f101555..7d0f640f34 100644 --- a/reference/random/student_t_distribution.md +++ b/reference/random/student_t_distribution.md @@ -106,9 +106,9 @@ int main() ``` ``` -このプログラムによってある時に得られた結果([student_t_distribution.tsv](https://github.com/cpprefjp/image/raw/master/reference/random/student_t_distribution/student_t_distribution.tsv))を図示する。 +このプログラムによってある時に得られた結果([student_t_distribution.tsv](https://raw.githubusercontent.com/cpprefjp/image/master/reference/random/student_t_distribution/student_t_distribution.tsv))を図示する。 -![](https://github.com/cpprefjp/image/raw/master/reference/random/student_t_distribution/student_t_distribution.png) +![](https://raw.githubusercontent.com/cpprefjp/image/master/reference/random/student_t_distribution/student_t_distribution.png) ## バージョン diff --git a/reference/random/uniform_int_distribution.md b/reference/random/uniform_int_distribution.md index 2e139bcc1a..97b3a6fc21 100644 --- a/reference/random/uniform_int_distribution.md +++ b/reference/random/uniform_int_distribution.md @@ -105,7 +105,7 @@ int main() このプログラムによってある時に得られた結果([uniform_int_distribution.tsv](https://github.com/cpprefjp/image/blob/master/reference/random/uniform_int_distribution/uniform_int_distribution.tsv))を図示する。 -![](https://raw.github.com/cpprefjp/image/master/reference/random/uniform_int_distribution/uniform_int_distribution.png) +![](https://raw.githubusercontent.com/cpprefjp/image/master/reference/random/uniform_int_distribution/uniform_int_distribution.png) 1,000個程度のデータのため、ある程度は偏りがあるが、誤差の範囲でほぼ等確率で0から9までの値が生成されていることがわかる。 diff --git a/reference/random/uniform_real_distribution.md b/reference/random/uniform_real_distribution.md index 340fcd7aac..49ec30fdc1 100644 --- a/reference/random/uniform_real_distribution.md +++ b/reference/random/uniform_real_distribution.md @@ -98,9 +98,9 @@ int main() このプログラムによってある時に得られた結果([uniform_real_distribution.tsv](https://github.com/cpprefjp/image/blob/master/reference/random/uniform_real_distribution/uniform_real_distribution.tsv))を図示する。 -![](https://raw.github.com/cpprefjp/image/master/reference/random/uniform_real_distribution/uniform_real_distribution_hist.png) +![](https://raw.githubusercontent.com/cpprefjp/image/master/reference/random/uniform_real_distribution/uniform_real_distribution_hist.png) -![](https://raw.github.com/cpprefjp/image/master/reference/random/uniform_real_distribution/uniform_real_distribution.png) +![](https://raw.githubusercontent.com/cpprefjp/image/master/reference/random/uniform_real_distribution/uniform_real_distribution.png) 1,000個程度のデータのため、ある程度は偏りがあるが、誤差の範囲でほぼ等確率で0.0から1.0までの値が生成されていることがわかる。 diff --git a/reference/random/weibull_distribution.md b/reference/random/weibull_distribution.md index f461df9850..398d98fc59 100644 --- a/reference/random/weibull_distribution.md +++ b/reference/random/weibull_distribution.md @@ -108,9 +108,9 @@ int main() ``` ``` -このプログラムによってある時に得られた結果([weibull_distribution.tsv](https://github.com/cpprefjp/image/raw/master/reference/random/weibull_distribution/weibull_distribution.tsv))を図示する。 +このプログラムによってある時に得られた結果([weibull_distribution.tsv](https://raw.githubusercontent.com/cpprefjp/image/master/reference/random/weibull_distribution/weibull_distribution.tsv))を図示する。 -![](https://github.com/cpprefjp/image/raw/master/reference/random/weibull_distribution/weibull_distribution.png) +![](https://raw.githubusercontent.com/cpprefjp/image/master/reference/random/weibull_distribution/weibull_distribution.png) この図において、破線はdist1(a = 1.0, b = 1.0)、実線はdist2(a = 1.0, b = 2.0)を意味する。 diff --git a/reference/scoped_allocator/scoped_allocator_adaptor.md b/reference/scoped_allocator/scoped_allocator_adaptor.md index daf4394db8..4550edb869 100644 --- a/reference/scoped_allocator/scoped_allocator_adaptor.md +++ b/reference/scoped_allocator/scoped_allocator_adaptor.md @@ -17,16 +17,16 @@ namespace std { 以下は、このアダプタクラスを使用することによって変化する、コンテナのメモリイメージである。 -![](https://raw.github.com/cpprefjp/image/master/reference/scoped_allocator/scoped_allocator_adaptor/ScopedAllocatorModel_01.png) +![](https://raw.githubusercontent.com/cpprefjp/image/master/reference/scoped_allocator/scoped_allocator_adaptor/ScopedAllocatorModel_01.png) 図1 コンテナ、および各要素がそれぞれに別個のアロケータオブジェクトを持つ -![](https://raw.github.com/cpprefjp/image/master/reference/scoped_allocator/scoped_allocator_adaptor/ScopedAllocatorModel_02.png) +![](https://raw.githubusercontent.com/cpprefjp/image/master/reference/scoped_allocator/scoped_allocator_adaptor/ScopedAllocatorModel_02.png) 図2 コンテナとその要素で、アロケータオブジェクトの状態を伝播させる(例1) -![](https://raw.github.com/cpprefjp/image/master/reference/scoped_allocator/scoped_allocator_adaptor/ScopedAllocatorModel_03.png) +![](https://raw.githubusercontent.com/cpprefjp/image/master/reference/scoped_allocator/scoped_allocator_adaptor/ScopedAllocatorModel_03.png) 図3 全ての要素にアロケータオブジェクトの状態を伝播させる(例2) diff --git a/start_editing/random_figure.md b/start_editing/random_figure.md index 7508d565cb..df66dd0a7c 100644 --- a/start_editing/random_figure.md +++ b/start_editing/random_figure.md @@ -99,7 +99,7 @@ rscript random_stats.R これで、`png()`関数で指定された画像ファイル名で、図が出力されます。 `std::uniform_int_distribution`クラスのサンプルコードでは、以下のような図が得られました。 -![](https://raw.github.com/cpprefjp/image/master/reference/random/uniform_int_distribution/uniform_int_distribution.png) +![](https://raw.githubusercontent.com/cpprefjp/image/master/reference/random/uniform_int_distribution/uniform_int_distribution.png) この図は「プロット」と呼ばれる種類の図ですが、そのほか「ヒストグラム」等、いろいろな種類の図を出力できます。先ほどのrandom_stats.Rスクリプトに、ヒストグラムの図出力をコメントアウトしてあるので、分布クラスの特性に合わせて、図の種類を使い分けてください。 From 1774c355e3d4566e130b381b62b1ee81ad710e58 Mon Sep 17 00:00:00 2001 From: tshino Date: Tue, 28 May 2024 00:32:54 +0900 Subject: [PATCH 0936/3948] =?UTF-8?q?tuple=5Fcat=E3=81=AE=E8=A6=81?= =?UTF-8?q?=E4=BB=B6=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/tuple/tuple_cat.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/tuple/tuple_cat.md b/reference/tuple/tuple_cat.md index 095d19d563..21245ae0c3 100644 --- a/reference/tuple/tuple_cat.md +++ b/reference/tuple/tuple_cat.md @@ -26,7 +26,7 @@ namespace std { ## 要件 - C++20まで : - `Tuples...`の全ての型が[`std::tuple`](tuple.md)``であること。 - - `Args...`の各型が左辺値参照であればコピー構築可能、そうでなければムーブ構築可能であること。 + - `Tuples...`の各型が左辺値参照であればその要素型`Args...`の各型はコピー構築可能、そうでなければムーブ構築可能であること。 - C++23から : - 本関数の戻り値の[`tuple`](tuple.md)のテンプレートパラメーターパックを`Ctypes`とし、`Ctypes`の全ての要素について、引数`tpls`において対応する要素の型から構築可能であること。 - より厳密には、次のように定義を行い、`(`[`is_constructible_v`](/reference/type_traits/is_constructible.md)` && ...) == true`であること。 From 93c8059cd2c59a6b68cc02dcdaedd073370afd8d Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Fri, 31 May 2024 22:54:27 +0900 Subject: [PATCH 0937/3948] =?UTF-8?q?linalg=20:=20apply=5Fgivens=5Frotatio?= =?UTF-8?q?n=E3=82=92=E8=BF=BD=E5=8A=A0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/apply_givens_rotation.md | 119 ++++++++++++++++++ reference/linalg/compatible-static-extents.md | 46 +++++++ reference/linalg/is_mdspan.md | 39 ++++++ 3 files changed, 204 insertions(+) create mode 100644 reference/linalg/apply_givens_rotation.md create mode 100644 reference/linalg/compatible-static-extents.md create mode 100644 reference/linalg/is_mdspan.md diff --git a/reference/linalg/apply_givens_rotation.md b/reference/linalg/apply_givens_rotation.md new file mode 100644 index 0000000000..fda754ee1e --- /dev/null +++ b/reference/linalg/apply_givens_rotation.md @@ -0,0 +1,119 @@ +# apply_givens_rotation + +* [mathjax enable] +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + + +```cpp +namespace std::linalg { + template + void apply_givens_rotation( + InOutVec1 x, + InOutVec2 y, + Real c, + Real s); // (1) + + template + void apply_givens_rotation( + ExecutionPolicy&& exec, + InOutVec1 x, + InOutVec2 y, + Real c, + Real s); // (2) + + template + void apply_givens_rotation( + InOutVec1 x, + InOutVec2 y, + Real c, + complex s); // (3) + + template + void apply_givens_rotation( + ExecutionPolicy&& exec, + InOutVec1 x, + InOutVec2 y, + Real c, + complex s); // (4) +} +``` + + +## 概要 +`c`と`s`で指定された回転行列を2つの**行**ベクトル`x`と`y`に対して、次のように掛けて代入する。 +$$ +\begin{pmatrix} +\mathbf{x} \\ +\mathbf{y} +\end{pmatrix} +\leftarrow +\begin{pmatrix} +c & s\\ +-\overline{s} & c +\end{pmatrix} +\begin{pmatrix} +\mathbf{x} \\ +\mathbf{y} +\end{pmatrix} +$$ + + +## 適格要件 +- [`compatible-static-extents`](/reference/linalg/compatible-static-extents.md)`(0,0) == true` + + +## 事前条件 +- `x.extent(0) == y.extent(0)` +- $c^2 + |s|^2 = 1$ + + +## 効果 +`c`と`s`で指定された回転を行ベクトル`x`と`y`がこの順に隣り合うとして行う。 + +- (1): 実回転行列に対して逐次実行する。 +- (2): 実回転行列に対して、指定された実行ポリシーに応じて実行する。 +- (3): `s`が複素数の回転行列に対して逐次実行する。 +- (4): `s`が複素数の回転行列に対して、指定された実行ポリシーに応じて実行する。 + + +## 戻り値 +なし + + +## 例 + + +### 出力 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution`](/reference/execution.md) + + +## 参照 +- [P0788R3 Standard Library Specification in a Concepts and Contracts World](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0788r3.pdf) +- [`LAPACK: crot`](https://netlib.org/lapack/explore-html/d1/d45/group__rot_ga25544801d45dcabdec7b24d863ebea9c.html#ga25544801d45dcabdec7b24d863ebea9c) diff --git a/reference/linalg/compatible-static-extents.md b/reference/linalg/compatible-static-extents.md new file mode 100644 index 0000000000..cec4e87975 --- /dev/null +++ b/reference/linalg/compatible-static-extents.md @@ -0,0 +1,46 @@ +# compatible-static-extents + +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + + +```cpp +namespace std::linalg { + template + requires(is-mdspan && is-mdspan) + constexpr bool compatible-static-extents(size_t r1, size_t r2) + { + return MDS1::static_extent(r1) == dynamic_extent || + MDS2::static_extent(r2) == dynamic_extent || + MDS1::static_extent(r1) == MDS2::static_extent(r2); + } +} +``` +* is-mdspan[link /reference/linalg/is_mdspan.md] + + +## 概要 +左の`mdspan`の`r1`番目の静的要素数と右の`mdspan`の`r2`番目の静的要素数に互換性があるかどうかを返す、説明専用の関数である。 + + +## テンプレートパラメータ制約 +- `MDS1`と`MDS2`が両方とも`mdspan`であること。 + + +## 戻り値 +左の`mdspan`の`r1`番目の静的要素数と右の`mdspan`の`r2`番目の静的要素数に互換性がある場合、`true`を返す。そうでない場合は、`false`を返す。 + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`mdspan`](/reference/mdspan.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) diff --git a/reference/linalg/is_mdspan.md b/reference/linalg/is_mdspan.md new file mode 100644 index 0000000000..7228ca1bf9 --- /dev/null +++ b/reference/linalg/is_mdspan.md @@ -0,0 +1,39 @@ +# is-mdspan + +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + + +```cpp +namespace std::linalg { + template + constexpr bool is-mdspan = false; + + template + constexpr bool is-mdspan> = true; +} +``` + + +## 概要 +与えられた型が[`mdspan`](/reference/mdspan.md)かどうかを表す、説明専用の定数である。 + + +## 戻り値 +与えられた型が`mdspan`の場合、`true`を返す。そうでない場合は、`false`を返す。 + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`mdspan`](/reference/mdspan.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) + From b2241ccde984bd9e03b4f796d83a5586c8aa5b39 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Sat, 1 Jun 2024 16:31:18 +0900 Subject: [PATCH 0938/3948] =?UTF-8?q?linalg=20:=20apply=5Fgivens=5Frotatio?= =?UTF-8?q?n=E3=81=AE=E3=83=AA=E3=83=B3=E3=82=AF=E3=81=AE=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 2 +- reference/linalg/apply_givens_rotation.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/reference/linalg.md b/reference/linalg.md index 1364c4b65e..493e23443c 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -60,7 +60,7 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に |------|------|----------------| | [`setup_givens_rotation_result`](linalg/setup_givens_rotation_result.md) | `setup_givens_rotation`の結果型 (class template) | C++26 | | [`setup_givens_rotation`](linalg/setup_givens_rotation.md) | xLARTG: ギブンス回転をセットアップする (function template) | C++26 | -| `apply_givens_rotation` | xROT: ベクトルにギブンス回転を適用する (function template) | C++26 | +| [`apply_givens_rotation`](linalg/apply_givens_rotation.md) | xROT: ベクトルにギブンス回転を適用する (function template) | C++26 | | `swap_elements` | xSWAP: 2つのベクトル/行列の要素を交換する (function template) | C++26 | | `scale` | xSCAL: ベクトル/行列の要素にスカラ値を乗算する (function template) | C++26 | | `copy` | xCOPY: ベクトル/行列の要素をコピーする (function template) | C++26 | diff --git a/reference/linalg/apply_givens_rotation.md b/reference/linalg/apply_givens_rotation.md index fda754ee1e..b93274fb51 100644 --- a/reference/linalg/apply_givens_rotation.md +++ b/reference/linalg/apply_givens_rotation.md @@ -112,6 +112,7 @@ $$ ## 関連項目 - [`execution`](/reference/execution.md) +- [`mdspan`](/reference/mdspan.md) ## 参照 From 6d90730e12098305e7b5b00dde729a374e1407a5 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Sat, 1 Jun 2024 16:28:33 +0900 Subject: [PATCH 0939/3948] =?UTF-8?q?linalg=20:=20swap=5Felements=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 2 +- reference/linalg/swap_elements.md | 81 +++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 reference/linalg/swap_elements.md diff --git a/reference/linalg.md b/reference/linalg.md index 493e23443c..dbc935b30d 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -61,7 +61,7 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に | [`setup_givens_rotation_result`](linalg/setup_givens_rotation_result.md) | `setup_givens_rotation`の結果型 (class template) | C++26 | | [`setup_givens_rotation`](linalg/setup_givens_rotation.md) | xLARTG: ギブンス回転をセットアップする (function template) | C++26 | | [`apply_givens_rotation`](linalg/apply_givens_rotation.md) | xROT: ベクトルにギブンス回転を適用する (function template) | C++26 | -| `swap_elements` | xSWAP: 2つのベクトル/行列の要素を交換する (function template) | C++26 | +| [`swap_elements`](linalg/swap_elements.md) | xSWAP: 2つのベクトル/行列の要素を交換する (function template) | C++26 | | `scale` | xSCAL: ベクトル/行列の要素にスカラ値を乗算する (function template) | C++26 | | `copy` | xCOPY: ベクトル/行列の要素をコピーする (function template) | C++26 | | `add` | xAXPY: 2つのベクトル/行列の要素を加算する (function template) | C++26 | diff --git a/reference/linalg/swap_elements.md b/reference/linalg/swap_elements.md new file mode 100644 index 0000000000..44cdf4065d --- /dev/null +++ b/reference/linalg/swap_elements.md @@ -0,0 +1,81 @@ +# swap_elements + +* [mathjax enable] +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + + +```cpp +namespace std::linalg { + template + void swap_elements(InOutObj1 x, + InOutObj2 y); // (1) + + template + void swap_elements(ExecutionPolicy&& exec, + InOutObj1 x, + InOutObj2 y); // (2) +} +``` + + +## 概要 +同じサイズの2つのベクトル`x`と`y`を交換する。 + + +## テンプレートパラメータ制約 +`x`と`y`の次元が等しくなければならない。 +- `x.rank() == y.rank()` + + +## 適格要件 +- 0以上`x.rank()`未満の整数rに対して、[`compatible-static-extents`](/reference/linalg/compatible-static-extents.md)`(r,r)`が`true` + + +## 事前条件 +`x`と`y`の各次元の要素数が等しくなければならない。 +- `x.extents() == y.extents()` + + +## 効果 +`x`と`y`の対応する成分全てを交換する。 + +- (1): 逐次実行する。 +- (2): 指定された実行ポリシーに応じて実行する。 + + +## 戻り値 +なし + + +## 例 + + +### 出力 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution`](/reference/execution.md) +- [`mdspan`](/reference/mdspan.md) + + +## 参照 +- [P0788R3 Standard Library Specification in a Concepts and Contracts World](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0788r3.pdf) +- [`LAPACK: cswap`](https://netlib.org/lapack/explore-html/d1/d45/group__rot_ga25544801d45dcabdec7b24d863ebea9c.html#ga25544801d45dcabdec7b24d863ebea9c) + From 90fce64a33c1caf75af686eab0a4b9b6ea559703 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Sat, 1 Jun 2024 17:14:20 +0900 Subject: [PATCH 0940/3948] =?UTF-8?q?linalg=20:=20swap=5Felements=E3=81=AE?= =?UTF-8?q?=E5=AE=A3=E8=A8=80=E3=81=A8cswap=E3=81=AE=E3=83=AA=E3=83=B3?= =?UTF-8?q?=E3=82=AF=E3=82=92=E4=BF=AE=E6=AD=A3=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/swap_elements.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/reference/linalg/swap_elements.md b/reference/linalg/swap_elements.md index 44cdf4065d..6e03a9f40b 100644 --- a/reference/linalg/swap_elements.md +++ b/reference/linalg/swap_elements.md @@ -10,16 +10,16 @@ ```cpp namespace std::linalg { template + inout-object InOutObj2> void swap_elements(InOutObj1 x, - InOutObj2 y); // (1) + InOutObj2 y); // (1) template + inout-object InOutObj1, + inout-object InOutObj2> void swap_elements(ExecutionPolicy&& exec, - InOutObj1 x, - InOutObj2 y); // (2) + InOutObj1 x, + InOutObj2 y); // (2) } ``` @@ -77,5 +77,5 @@ namespace std::linalg { ## 参照 - [P0788R3 Standard Library Specification in a Concepts and Contracts World](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0788r3.pdf) -- [`LAPACK: cswap`](https://netlib.org/lapack/explore-html/d1/d45/group__rot_ga25544801d45dcabdec7b24d863ebea9c.html#ga25544801d45dcabdec7b24d863ebea9c) +- [`LAPACK: cswap`](https://netlib.org/lapack/explore-html/d7/d51/group__swap_ga1e8d1bbcbd0307e7a3839d0bd10e4118.html#ga1e8d1bbcbd0307e7a3839d0bd10e4118) From 6b11b92c8a2f6fedbdee135b36128440d8444a03 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Sat, 1 Jun 2024 17:11:37 +0900 Subject: [PATCH 0941/3948] =?UTF-8?q?linalg=20:=20scale=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 2 +- reference/linalg/scale.md | 71 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 reference/linalg/scale.md diff --git a/reference/linalg.md b/reference/linalg.md index dbc935b30d..81ecaf9e47 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -62,7 +62,7 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に | [`setup_givens_rotation`](linalg/setup_givens_rotation.md) | xLARTG: ギブンス回転をセットアップする (function template) | C++26 | | [`apply_givens_rotation`](linalg/apply_givens_rotation.md) | xROT: ベクトルにギブンス回転を適用する (function template) | C++26 | | [`swap_elements`](linalg/swap_elements.md) | xSWAP: 2つのベクトル/行列の要素を交換する (function template) | C++26 | -| `scale` | xSCAL: ベクトル/行列の要素にスカラ値を乗算する (function template) | C++26 | +| [`scale`](linalg/scale.md) | xSCAL: ベクトル/行列の要素にスカラ値を乗算する (function template) | C++26 | | `copy` | xCOPY: ベクトル/行列の要素をコピーする (function template) | C++26 | | `add` | xAXPY: 2つのベクトル/行列の要素を加算する (function template) | C++26 | | `dot` | xDOT, xDOTU: 2つのベクトルのドット積を求める (function template) | C++26 | diff --git a/reference/linalg/scale.md b/reference/linalg/scale.md new file mode 100644 index 0000000000..4f44d419bf --- /dev/null +++ b/reference/linalg/scale.md @@ -0,0 +1,71 @@ +# scale + +* [mathjax enable] +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + + +```cpp +namespace std::linalg { + template + void scale(Scalar alpha, + InOutObj x); // (1) + + template + void scale(ExecutionPolicy&& exec, + Scalar alpha, + InOutObj x); // (2) +} +``` + + +## 概要 +以下のように、ベクトル`x`を`alpha`倍したものを`x`に代入する。 + +$$ +\mathbf{x}\leftarrow\alpha\mathbf{x} +$$ + + +## 効果 +ベクトル`x`を`alpha`倍する。 + +- (1): 逐次実行する。 +- (2): 指定された実行ポリシーに応じて実行する。 + + +## 戻り値 +なし + + +## 例 + + +### 出力 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution`](/reference/execution.md) +- [`mdspan`](/reference/mdspan.md) + + +## 参照 +- [P0788R3 Standard Library Specification in a Concepts and Contracts World](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0788r3.pdf) +- [`LAPACK: cscal`](https://netlib.org/lapack/explore-html/d2/de8/group__scal_gacce468103c83fa18bae078d5f49fefe2.html#gacce468103c83fa18bae078d5f49fefe2) + From 3382e49e11a58b8875db06c68b725aa4794ce352 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Sat, 1 Jun 2024 19:11:25 +0900 Subject: [PATCH 0942/3948] =?UTF-8?q?linalg=20:=20swap=5Felements=E3=81=AE?= =?UTF-8?q?=E6=A6=82=E8=A6=81=E3=82=92=E4=BF=AE=E6=AD=A3=E3=80=82(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/swap_elements.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/linalg/swap_elements.md b/reference/linalg/swap_elements.md index 6e03a9f40b..630dfc91d2 100644 --- a/reference/linalg/swap_elements.md +++ b/reference/linalg/swap_elements.md @@ -25,7 +25,7 @@ namespace std::linalg { ## 概要 -同じサイズの2つのベクトル`x`と`y`を交換する。 +同じサイズの2つの行列またはベクトル`x`と`y`を交換する。 ## テンプレートパラメータ制約 From 2ec4f19fa1be7e642ff43c905626c655151af28c Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Sat, 1 Jun 2024 19:29:46 +0900 Subject: [PATCH 0943/3948] =?UTF-8?q?linalg=20:=20copy=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=E3=80=82(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 2 +- reference/linalg/copy.md | 81 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 reference/linalg/copy.md diff --git a/reference/linalg.md b/reference/linalg.md index 81ecaf9e47..361a30e023 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -63,7 +63,7 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に | [`apply_givens_rotation`](linalg/apply_givens_rotation.md) | xROT: ベクトルにギブンス回転を適用する (function template) | C++26 | | [`swap_elements`](linalg/swap_elements.md) | xSWAP: 2つのベクトル/行列の要素を交換する (function template) | C++26 | | [`scale`](linalg/scale.md) | xSCAL: ベクトル/行列の要素にスカラ値を乗算する (function template) | C++26 | -| `copy` | xCOPY: ベクトル/行列の要素をコピーする (function template) | C++26 | +| [`copy`](linalg/copy.md) | xCOPY: ベクトル/行列の要素をコピーする (function template) | C++26 | | `add` | xAXPY: 2つのベクトル/行列の要素を加算する (function template) | C++26 | | `dot` | xDOT, xDOTU: 2つのベクトルのドット積を求める (function template) | C++26 | | `dotc` | xDOTC: 2つのベクトルの複素共役ドット積を求める (function template) | C++26 | diff --git a/reference/linalg/copy.md b/reference/linalg/copy.md new file mode 100644 index 0000000000..0a44de8bd2 --- /dev/null +++ b/reference/linalg/copy.md @@ -0,0 +1,81 @@ +# copy + +* [mathjax enable] +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + + +```cpp +namespace std::linalg { + template + void copy(InObj x, + OutObj y); // (1) + + template + void copy(ExecutionPolicy&& exec, + InObj x, + OutObj y); // (2) +} +``` + + +## 概要 +同じサイズの行列またはベクトルの`x`と`y`に対して、`x`を`y`にコピーする。 + + +## テンプレートパラメータ制約 +`x`と`y`の次元が等しくなければならない。 +- `x.rank() == y.rank()` + + +## 適格要件 +- 0以上`x.rank()`未満の整数rに対して、[`compatible-static-extents`](/reference/linalg/compatible-static-extents.md)`(r,r)`が`true` + + +## 事前条件 +`x`と`y`の各次元の要素数が等しくなければならない。 +- `x.extents() == y.extents()` + + + +## 効果 +`x`の各成分を`y`にコピーする。 + +- (1): 逐次実行する。 +- (2): 指定された実行ポリシーに応じて実行する。 + + +## 戻り値 +なし + + +## 例 + + +### 出力 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution`](/reference/execution.md) +- [`mdspan`](/reference/mdspan.md) + + +## 参照 +- [P0788R3 Standard Library Specification in a Concepts and Contracts World](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0788r3.pdf) +- [`LAPACK: ccopy`](https://netlib.org/lapack/explore-html/d5/d2b/group__copy_gab395a30db1137d3deabe520b8e73097d.html#gab395a30db1137d3deabe520b8e73097d) From c27bce6dfab27e0cc385447a08061b40b1e856d0 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sun, 2 Jun 2024 14:19:27 +0900 Subject: [PATCH 0944/3948] Update format.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit boolのsオプションを追加 --- reference/format/format.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/format/format.md b/reference/format/format.md index ea254bb9bd..32352010a9 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -118,7 +118,7 @@ string s3 = format("{} {1}", "a", "b"); // コンパイルエラー #### `bool`型の場合 -デフォルトでは `true` / `false` という文字列を出力する。 +デフォルトまたは `s` を指定すると、 `true` / `false` という文字列を出力する。 整数型のオプションも指定できる。その場合は、`unsigned char` に `static_cast` される。 From 7da4216eb6ae93fb2622a8947038b2920a53612a Mon Sep 17 00:00:00 2001 From: Nagarei Date: Sat, 8 Jun 2024 19:22:22 +0900 Subject: [PATCH 0945/3948] Add missing `noexcept` in `shared_ptr` Add missing `noexcept` in `shared_ptr::shared_ptr(nullptr_t)` issue: #1249 --- reference/memory/shared_ptr/op_constructor.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/reference/memory/shared_ptr/op_constructor.md b/reference/memory/shared_ptr/op_constructor.md index 40e698d3f4..9fdd4119db 100644 --- a/reference/memory/shared_ptr/op_constructor.md +++ b/reference/memory/shared_ptr/op_constructor.md @@ -50,7 +50,9 @@ shared_ptr(auto_ptr&& r); // (13) template shared_ptr(unique_ptr&& r); // (14) -constexpr shared_ptr(nullptr_t); // (15) +constexpr shared_ptr(nullptr_t); // (15) C++14 + +constexpr shared_ptr(nullptr_t) noexcept; // (15) C++17 template shared_ptr(shared_ptr&& r, element_type* p) noexcept; // (16) C++20 @@ -283,3 +285,4 @@ int main() - [P0414R1 Merging `shared_ptr` changes from Library Fundamentals to C++17](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0414r1.html) - [P0497R0 Fixes to `shared_ptr` support for arrays](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0497r0.html) - [LWG Issue 2996. Missing rvalue overloads for `shared_ptr` operations](https://wg21.cmeerw.net/lwg/issue2996) +- [LWG Issue 2365. Missing `noexcept` in `shared_ptr::shared_ptr(nullptr_t)`](https://wg21.cmeerw.net/lwg/issue2365) From 9e71889b48f68023590a6be2fc9e047b7c48d440 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 11 Jun 2024 13:29:24 +0900 Subject: [PATCH 0946/3948] =?UTF-8?q?=E3=83=88=E3=83=83=E3=83=97=E3=83=9A?= =?UTF-8?q?=E3=83=BC=E3=82=B8=20:=20HTML=E3=81=AE=E3=83=80=E3=82=A6?= =?UTF-8?q?=E3=83=B3=E3=83=AD=E3=83=BC=E3=83=89=E3=83=AA=E3=83=B3=E3=82=AF?= =?UTF-8?q?=E3=82=92=E8=A8=98=E8=BC=89=20#917?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/index.md b/index.md index 21d997245b..b3a161388e 100644 --- a/index.md +++ b/index.md @@ -12,6 +12,12 @@ 本サイトでは、他サイトおよび規格書の直接的な翻訳ではなく、編集者の調査と考えに基づいた解説を提供していきます。 +## HTMLデータのダウンロード +- [cpprefjp.github.io-master.zip](https://github.com/cpprefjp/cpprefjp.github.io/archive/refs/heads/master.zip) + +ローカルで閲覧できるHTMLを用意しています。 + + ## スポンサーシップ - [cpprefjp - Open Collective](https://opencollective.com/cpprefjp) From 0ba9eff9a08bbe1306a6ab67c847abc87d9cb666 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 11 Jun 2024 13:35:10 +0900 Subject: [PATCH 0947/3948] =?UTF-8?q?=E7=B5=B5=E6=96=87=E5=AD=97=E3=81=AE?= =?UTF-8?q?=E8=A1=A8=E7=A4=BA=E3=83=86=E3=82=B9=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/cpprefjp/site/issues/1274 --- working_style.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/working_style.md b/working_style.md index 592a43d0c6..528e93d8b5 100644 --- a/working_style.md +++ b/working_style.md @@ -45,9 +45,12 @@ C++11以降対応については対応バージョンを明記します。バー - Visual C++: 2003, 2008, 2010 - pgCC: 11.2 -それと、訳語表を随時更新していってください。 +#### 絵文字の表示テスト +- GCC: 12.0 [mark noimpl], 13.1 [mark impl], 14.1 [mark verified] + ### 訳語表 +訳語表は随時更新していってください。 | 英語 | 日本語 | |--------------------|----------------------------------------------| From 2b623ec7ccbfccee55acaef3730a66d46f94da93 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Wed, 29 May 2024 13:02:04 +0900 Subject: [PATCH 0948/3948] =?UTF-8?q?:=20Synopsis=E3=82=B9?= =?UTF-8?q?=E3=82=BF=E3=82=A4=E3=83=AB=E4=BF=AE=E6=AD=A3=20"namespace=20st?= =?UTF-8?q?d=20{"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/numeric/accumulate.md | 2 +- reference/numeric/exclusive_scan.md | 2 +- reference/numeric/inclusive_scan.md | 2 +- reference/numeric/iota.md | 2 +- reference/numeric/reduce.md | 2 +- reference/numeric/transform_exclusive_scan.md | 2 +- reference/numeric/transform_inclusive_scan.md | 2 +- reference/numeric/transform_reduce.md | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/reference/numeric/accumulate.md b/reference/numeric/accumulate.md index 0e1324c5f8..790ed14e5f 100644 --- a/reference/numeric/accumulate.md +++ b/reference/numeric/accumulate.md @@ -4,7 +4,7 @@ * function template[meta id-type] ```cpp -namespace std{ +namespace std { template T accumulate(InputIterator first, InputIterator last, T init); // (1) C++03 template diff --git a/reference/numeric/exclusive_scan.md b/reference/numeric/exclusive_scan.md index c3ea1ad867..85256a183e 100644 --- a/reference/numeric/exclusive_scan.md +++ b/reference/numeric/exclusive_scan.md @@ -5,7 +5,7 @@ * cpp17[meta cpp] ```cpp -namespace std{ +namespace std { template OutputIterator exclusive_scan(InputIterator first, diff --git a/reference/numeric/inclusive_scan.md b/reference/numeric/inclusive_scan.md index 1ec04f4079..d495f4c105 100644 --- a/reference/numeric/inclusive_scan.md +++ b/reference/numeric/inclusive_scan.md @@ -5,7 +5,7 @@ * cpp17[meta cpp] ```cpp -namespace std{ +namespace std { template OutputIterator inclusive_scan(InputIterator first, diff --git a/reference/numeric/iota.md b/reference/numeric/iota.md index 86800506e8..7d285cecaf 100644 --- a/reference/numeric/iota.md +++ b/reference/numeric/iota.md @@ -5,7 +5,7 @@ * cpp11[meta cpp] ```cpp -namespace std{ +namespace std { template void iota(ForwardIterator first, ForwardIterator last, T value); // (1) C++11 diff --git a/reference/numeric/reduce.md b/reference/numeric/reduce.md index c49640fea3..f1f12920de 100644 --- a/reference/numeric/reduce.md +++ b/reference/numeric/reduce.md @@ -5,7 +5,7 @@ * cpp17[meta cpp] ```cpp -namespace std{ +namespace std { template typename iterator_traits::value_type reduce(InputIterator first, InputIterator last); // (1) C++17 diff --git a/reference/numeric/transform_exclusive_scan.md b/reference/numeric/transform_exclusive_scan.md index 1ec2938fcb..ad3648667e 100644 --- a/reference/numeric/transform_exclusive_scan.md +++ b/reference/numeric/transform_exclusive_scan.md @@ -5,7 +5,7 @@ * cpp17[meta cpp] ```cpp -namespace std{ +namespace std { template OutputIterator diff --git a/reference/numeric/transform_inclusive_scan.md b/reference/numeric/transform_inclusive_scan.md index 8c604ea5df..f60a499cc9 100644 --- a/reference/numeric/transform_inclusive_scan.md +++ b/reference/numeric/transform_inclusive_scan.md @@ -5,7 +5,7 @@ * cpp17[meta cpp] ```cpp -namespace std{ +namespace std { template OutputIterator diff --git a/reference/numeric/transform_reduce.md b/reference/numeric/transform_reduce.md index 0c5a6d108a..2bb408cbf2 100644 --- a/reference/numeric/transform_reduce.md +++ b/reference/numeric/transform_reduce.md @@ -5,7 +5,7 @@ * cpp17[meta cpp] ```cpp -namespace std{ +namespace std { template T transform_reduce(InputIterator1 first1, InputIterator1 last1, From d8a5fc4a8c906e9e35cd1b8bea7d2306c0ebde69 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Tue, 11 Jun 2024 14:37:12 +0900 Subject: [PATCH 0949/3948] =?UTF-8?q?=E3=83=AD=E3=83=BC=E3=82=AB=E3=83=AB?= =?UTF-8?q?=E9=96=B2=E8=A6=A7=E7=94=A8=E8=A8=AD=E5=AE=9A=E3=82=92CI?= =?UTF-8?q?=E3=81=AEbuild.sh=E3=81=AB=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/script/build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/script/build.sh b/.github/workflows/script/build.sh index 89d61b64f5..519efd5723 100755 --- a/.github/workflows/script/build.sh +++ b/.github/workflows/script/build.sh @@ -26,6 +26,7 @@ popd mkdir -p cpprefjp/static/static/crsearch pushd cpprefjp/static/static/crsearch ln -s ../../../../crsearch.json/crsearch.json crsearch.json + ln -s ../../../../crsearch.json/crsearch.js crsearch.js popd # サイトの生成 From aaa7f3a8b39ee11c6ce0566dfad76ed6c11ad46c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 11 Jun 2024 17:55:56 +0900 Subject: [PATCH 0950/3948] =?UTF-8?q?reference=20:=20=E3=83=9A=E3=83=BC?= =?UTF-8?q?=E3=82=B8=E5=86=85=E3=83=AA=E3=83=B3=E3=82=AF=E3=81=AE=E3=83=9F?= =?UTF-8?q?=E3=82=B9=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference.md b/reference.md index 9c7ad99b61..87e24640a4 100644 --- a/reference.md +++ b/reference.md @@ -152,7 +152,7 @@ | [``](/reference/linalg.md) | 線形代数 | C++26 | -## デバッグライブラリ +## デバッグライブラリ | ヘッダ | 説明 | 対応バージョン | |----------------------------------------|------------------|----------------| From 4774e3932d936e4a303bf6c70ddd4fd81e4baf28 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 11 Jun 2024 22:45:38 +0900 Subject: [PATCH 0951/3948] =?UTF-8?q?=E5=85=A8=E4=BD=93=20:=20=E5=8B=95?= =?UTF-8?q?=E4=BD=9C=E7=A2=BA=E8=AA=8D=E3=81=97=E3=81=9F=E5=87=A6=E7=90=86?= =?UTF-8?q?=E7=B3=BB=E3=81=AB=E3=80=8C=E6=A4=9C=E8=A8=BC=E6=B8=88=E3=81=BF?= =?UTF-8?q?=E3=80=8D=E3=80=8C=E6=9C=AA=E5=AE=9F=E8=A3=85=E3=80=8D=E3=81=AE?= =?UTF-8?q?=E7=B5=B5=E6=96=87=E5=AD=97=E3=82=92=E5=85=A5=E3=82=8C=E3=81=9F?= =?UTF-8?q?=20#1274?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/all_of.md | 6 +- reference/algorithm/any_of.md | 6 +- reference/algorithm/clamp.md | 4 +- reference/algorithm/copy_if.md | 6 +- reference/algorithm/copy_n.md | 6 +- reference/algorithm/equal.md | 6 +- reference/algorithm/fill_n.md | 2 +- reference/algorithm/for_each.md | 2 +- reference/algorithm/for_each_n.md | 4 +- reference/algorithm/generate_n.md | 2 +- reference/algorithm/is_heap.md | 4 +- reference/algorithm/is_heap_until.md | 4 +- reference/algorithm/is_partitioned.md | 4 +- reference/algorithm/is_permutation.md | 4 +- reference/algorithm/is_sorted.md | 4 +- reference/algorithm/is_sorted_until.md | 4 +- .../lexicographical_compare_three_way.md | 2 +- reference/algorithm/max.md | 4 +- reference/algorithm/min.md | 4 +- reference/algorithm/minmax.md | 4 +- reference/algorithm/minmax_element.md | 4 +- reference/algorithm/mismatch.md | 2 +- reference/algorithm/move.md | 6 +- reference/algorithm/move_backward.md | 6 +- reference/algorithm/none_of.md | 6 +- reference/algorithm/partition_copy.md | 4 +- reference/algorithm/partition_point.md | 4 +- reference/algorithm/ranges_adjacent_find.md | 4 +- reference/algorithm/ranges_all_of.md | 4 +- reference/algorithm/ranges_any_of.md | 4 +- reference/algorithm/ranges_binary_search.md | 4 +- reference/algorithm/ranges_clamp.md | 4 +- reference/algorithm/ranges_copy.md | 4 +- reference/algorithm/ranges_copy_backward.md | 4 +- reference/algorithm/ranges_copy_if.md | 4 +- reference/algorithm/ranges_copy_n.md | 4 +- reference/algorithm/ranges_count.md | 4 +- reference/algorithm/ranges_count_if.md | 4 +- reference/algorithm/ranges_equal.md | 4 +- reference/algorithm/ranges_equal_range.md | 4 +- reference/algorithm/ranges_fill.md | 4 +- reference/algorithm/ranges_fill_n.md | 4 +- reference/algorithm/ranges_find.md | 4 +- reference/algorithm/ranges_find_end.md | 4 +- reference/algorithm/ranges_find_first_of.md | 4 +- reference/algorithm/ranges_find_if.md | 4 +- reference/algorithm/ranges_find_if_not.md | 4 +- reference/algorithm/ranges_fold_left.md | 4 +- reference/algorithm/ranges_fold_left_first.md | 4 +- .../ranges_fold_left_first_with_iter.md | 4 +- .../algorithm/ranges_fold_left_with_iter.md | 4 +- reference/algorithm/ranges_fold_right.md | 4 +- reference/algorithm/ranges_fold_right_last.md | 4 +- reference/algorithm/ranges_for_each.md | 4 +- reference/algorithm/ranges_for_each_n.md | 4 +- reference/algorithm/ranges_generate.md | 4 +- reference/algorithm/ranges_generate_n.md | 4 +- reference/algorithm/ranges_in_found_result.md | 4 +- reference/algorithm/ranges_in_fun_result.md | 4 +- .../algorithm/ranges_in_in_out_result.md | 4 +- reference/algorithm/ranges_in_in_result.md | 4 +- .../algorithm/ranges_in_out_out_result.md | 4 +- reference/algorithm/ranges_in_out_result.md | 4 +- reference/algorithm/ranges_in_value_result.md | 4 +- reference/algorithm/ranges_includes.md | 4 +- reference/algorithm/ranges_inplace_merge.md | 4 +- reference/algorithm/ranges_is_heap.md | 4 +- reference/algorithm/ranges_is_heap_until.md | 4 +- reference/algorithm/ranges_is_partitioned.md | 4 +- reference/algorithm/ranges_is_permutation.md | 4 +- reference/algorithm/ranges_is_sorted.md | 4 +- reference/algorithm/ranges_is_sorted_until.md | 4 +- .../ranges_lexicographical_compare.md | 4 +- reference/algorithm/ranges_lower_bound.md | 4 +- reference/algorithm/ranges_make_heap.md | 4 +- reference/algorithm/ranges_max.md | 4 +- reference/algorithm/ranges_max_element.md | 4 +- reference/algorithm/ranges_merge.md | 4 +- reference/algorithm/ranges_min.md | 4 +- reference/algorithm/ranges_min_element.md | 4 +- reference/algorithm/ranges_min_max_result.md | 4 +- reference/algorithm/ranges_minmax.md | 4 +- reference/algorithm/ranges_minmax_element.md | 4 +- reference/algorithm/ranges_mismatch.md | 4 +- reference/algorithm/ranges_move.md | 4 +- reference/algorithm/ranges_move_backward.md | 4 +- .../algorithm/ranges_next_permutation.md | 4 +- reference/algorithm/ranges_none_of.md | 4 +- reference/algorithm/ranges_nth_element.md | 4 +- reference/algorithm/ranges_partial_sort.md | 4 +- .../algorithm/ranges_partial_sort_copy.md | 4 +- reference/algorithm/ranges_partition.md | 4 +- reference/algorithm/ranges_partition_copy.md | 4 +- reference/algorithm/ranges_partition_point.md | 4 +- reference/algorithm/ranges_pop_heap.md | 4 +- .../algorithm/ranges_prev_permutation.md | 4 +- reference/algorithm/ranges_push_heap.md | 4 +- reference/algorithm/ranges_remove.md | 4 +- reference/algorithm/ranges_remove_copy.md | 4 +- reference/algorithm/ranges_remove_copy_if.md | 4 +- reference/algorithm/ranges_remove_if.md | 4 +- reference/algorithm/ranges_replace.md | 4 +- reference/algorithm/ranges_replace_copy.md | 4 +- reference/algorithm/ranges_replace_copy_if.md | 4 +- reference/algorithm/ranges_replace_if.md | 4 +- reference/algorithm/ranges_reverse.md | 4 +- reference/algorithm/ranges_reverse_copy.md | 4 +- reference/algorithm/ranges_rotate.md | 4 +- reference/algorithm/ranges_rotate_copy.md | 4 +- reference/algorithm/ranges_sample.md | 4 +- reference/algorithm/ranges_search.md | 4 +- reference/algorithm/ranges_search_n.md | 4 +- reference/algorithm/ranges_set_difference.md | 4 +- .../algorithm/ranges_set_intersection.md | 4 +- .../ranges_set_symmetric_difference.md | 4 +- reference/algorithm/ranges_set_union.md | 4 +- reference/algorithm/ranges_shuffle.md | 4 +- reference/algorithm/ranges_sort.md | 4 +- reference/algorithm/ranges_sort_heap.md | 4 +- .../algorithm/ranges_stable_partition.md | 4 +- reference/algorithm/ranges_stable_sort.md | 4 +- reference/algorithm/ranges_swap_ranges.md | 4 +- reference/algorithm/ranges_transform.md | 4 +- reference/algorithm/ranges_unique.md | 4 +- reference/algorithm/ranges_unique_copy.md | 4 +- reference/algorithm/ranges_upper_bound.md | 4 +- reference/algorithm/rotate.md | 4 +- reference/algorithm/sample.md | 4 +- reference/any/any.md | 4 +- reference/any/any/emplace.md | 4 +- reference/any/any/has_value.md | 4 +- reference/any/any/op_assign.md | 4 +- reference/any/any/op_constructor.md | 4 +- reference/any/any/op_destructor.md | 4 +- reference/any/any/reset.md | 4 +- reference/any/any/swap.md | 4 +- reference/any/any/swap_free.md | 4 +- reference/any/any/type.md | 4 +- reference/any/any_cast.md | 4 +- reference/any/bad_any_cast.md | 4 +- reference/any/make_any.md | 4 +- reference/array/array.md | 4 +- reference/array/array/at.md | 4 +- reference/array/array/back.md | 4 +- reference/array/array/begin.md | 4 +- reference/array/array/cbegin.md | 4 +- reference/array/array/cend.md | 4 +- reference/array/array/crbegin.md | 4 +- reference/array/array/crend.md | 4 +- reference/array/array/data.md | 4 +- reference/array/array/empty.md | 4 +- reference/array/array/end.md | 4 +- reference/array/array/fill.md | 4 +- reference/array/array/front.md | 4 +- reference/array/array/get.md | 4 +- reference/array/array/max_size.md | 4 +- reference/array/array/op_at.md | 4 +- reference/array/array/op_compare_3way.md | 2 +- reference/array/array/op_deduction_guide.md | 2 +- reference/array/array/op_equal.md | 4 +- reference/array/array/op_greater.md | 4 +- reference/array/array/op_greater_equal.md | 4 +- reference/array/array/op_initializer.md | 4 +- reference/array/array/op_less.md | 4 +- reference/array/array/op_less_equal.md | 4 +- reference/array/array/op_not_equal.md | 4 +- reference/array/array/rbegin.md | 4 +- reference/array/array/rend.md | 4 +- reference/array/array/size.md | 4 +- reference/array/array/swap.md | 4 +- reference/array/array/swap_free.md | 4 +- reference/array/array/tuple_element.md | 4 +- reference/array/array/tuple_size.md | 4 +- reference/array/to_array.md | 4 +- reference/atomic/atomic.md | 6 +- .../atomic/atomic/compare_exchange_strong.md | 6 +- .../atomic/atomic/compare_exchange_weak.md | 6 +- reference/atomic/atomic/exchange.md | 4 +- reference/atomic/atomic/fetch_add.md | 6 +- reference/atomic/atomic/fetch_and.md | 6 +- reference/atomic/atomic/fetch_or.md | 6 +- reference/atomic/atomic/fetch_sub.md | 6 +- reference/atomic/atomic/fetch_xor.md | 6 +- reference/atomic/atomic/is_lock_free.md | 4 +- reference/atomic/atomic/load.md | 4 +- reference/atomic/atomic/notify_all.md | 6 +- reference/atomic/atomic/notify_one.md | 6 +- reference/atomic/atomic/op_and_assign.md | 6 +- reference/atomic/atomic/op_assign.md | 4 +- reference/atomic/atomic/op_constructor.md | 4 +- reference/atomic/atomic/op_decrement.md | 6 +- reference/atomic/atomic/op_increment.md | 6 +- reference/atomic/atomic/op_minus_assign.md | 4 +- reference/atomic/atomic/op_or_assign.md | 6 +- reference/atomic/atomic/op_plus_assign.md | 6 +- reference/atomic/atomic/op_t.md | 4 +- reference/atomic/atomic/op_xor_assign.md | 6 +- reference/atomic/atomic/store.md | 4 +- reference/atomic/atomic/wait.md | 6 +- .../atomic/atomic_compare_exchange_strong.md | 4 +- ...atomic_compare_exchange_strong_explicit.md | 4 +- .../atomic/atomic_compare_exchange_weak.md | 4 +- .../atomic_compare_exchange_weak_explicit.md | 4 +- reference/atomic/atomic_exchange.md | 4 +- reference/atomic/atomic_exchange_explicit.md | 4 +- reference/atomic/atomic_fetch_add.md | 4 +- reference/atomic/atomic_fetch_add_explicit.md | 4 +- reference/atomic/atomic_fetch_and.md | 4 +- reference/atomic/atomic_fetch_and_explicit.md | 4 +- reference/atomic/atomic_fetch_or.md | 4 +- reference/atomic/atomic_fetch_or_explicit.md | 4 +- reference/atomic/atomic_fetch_sub.md | 4 +- reference/atomic/atomic_fetch_sub_explicit.md | 4 +- reference/atomic/atomic_fetch_xor.md | 4 +- reference/atomic/atomic_fetch_xor_explicit.md | 4 +- reference/atomic/atomic_flag.md | 4 +- reference/atomic/atomic_flag/clear.md | 4 +- reference/atomic/atomic_flag/notify_all.md | 6 +- reference/atomic/atomic_flag/notify_one.md | 6 +- .../atomic/atomic_flag/op_constructor.md | 4 +- reference/atomic/atomic_flag/test.md | 6 +- reference/atomic/atomic_flag/test_and_set.md | 4 +- reference/atomic/atomic_flag/wait.md | 6 +- reference/atomic/atomic_flag_clear.md | 4 +- .../atomic/atomic_flag_clear_explicit.md | 4 +- reference/atomic/atomic_flag_init.md | 4 +- reference/atomic/atomic_flag_notify_all.md | 6 +- reference/atomic/atomic_flag_notify_one.md | 6 +- reference/atomic/atomic_flag_test.md | 6 +- reference/atomic/atomic_flag_test_and_set.md | 4 +- .../atomic_flag_test_and_set_explicit.md | 4 +- reference/atomic/atomic_flag_test_explicit.md | 6 +- reference/atomic/atomic_flag_wait.md | 6 +- reference/atomic/atomic_flag_wait_explicit.md | 6 +- reference/atomic/atomic_init.md | 4 +- reference/atomic/atomic_is_lock_free.md | 4 +- reference/atomic/atomic_load.md | 4 +- reference/atomic/atomic_load_explicit.md | 4 +- reference/atomic/atomic_notify_all.md | 6 +- reference/atomic/atomic_notify_one.md | 6 +- reference/atomic/atomic_ref.md | 4 +- .../atomic_ref/compare_exchange_strong.md | 4 +- .../atomic_ref/compare_exchange_weak.md | 4 +- reference/atomic/atomic_ref/exchange.md | 4 +- reference/atomic/atomic_ref/fetch_add.md | 4 +- reference/atomic/atomic_ref/fetch_and.md | 4 +- reference/atomic/atomic_ref/fetch_or.md | 4 +- reference/atomic/atomic_ref/fetch_sub.md | 4 +- reference/atomic/atomic_ref/fetch_xor.md | 4 +- reference/atomic/atomic_ref/is_lock_free.md | 4 +- reference/atomic/atomic_ref/load.md | 4 +- reference/atomic/atomic_ref/notify_all.md | 6 +- reference/atomic/atomic_ref/notify_one.md | 6 +- reference/atomic/atomic_ref/op_and_assign.md | 4 +- reference/atomic/atomic_ref/op_assign.md | 4 +- reference/atomic/atomic_ref/op_constructor.md | 4 +- reference/atomic/atomic_ref/op_decrement.md | 4 +- reference/atomic/atomic_ref/op_increment.md | 4 +- .../atomic/atomic_ref/op_minus_assign.md | 4 +- reference/atomic/atomic_ref/op_or_assign.md | 4 +- reference/atomic/atomic_ref/op_plus_assign.md | 4 +- reference/atomic/atomic_ref/op_t.md | 4 +- reference/atomic/atomic_ref/op_xor_assign.md | 4 +- reference/atomic/atomic_ref/store.md | 4 +- reference/atomic/atomic_ref/wait.md | 6 +- reference/atomic/atomic_signal_fence.md | 4 +- reference/atomic/atomic_store.md | 4 +- reference/atomic/atomic_store_explicit.md | 4 +- reference/atomic/atomic_thread_fence.md | 4 +- reference/atomic/atomic_var_init.md | 4 +- reference/atomic/atomic_wait.md | 6 +- reference/atomic/atomic_wait_explicit.md | 6 +- reference/atomic/kill_dependency.md | 4 +- reference/atomic/lock_free_property.md | 4 +- reference/atomic/memory_order.md | 4 +- reference/barrier.md | 2 +- reference/barrier/barrier.md | 2 +- reference/barrier/barrier/arrive.md | 2 +- reference/barrier/barrier/arrive_and_drop.md | 2 +- reference/barrier/barrier/arrive_and_wait.md | 2 +- reference/barrier/barrier/max.md | 2 +- reference/barrier/barrier/op_constructor.md | 2 +- reference/barrier/barrier/wait.md | 2 +- reference/bit/bit_cast.md | 2 +- reference/bit/bit_ceil.md | 4 +- reference/bit/bit_floor.md | 2 +- reference/bit/bit_width.md | 2 +- reference/bit/countl_one.md | 4 +- reference/bit/countl_zero.md | 4 +- reference/bit/countr_one.md | 4 +- reference/bit/countr_zero.md | 4 +- reference/bit/has_single_bit.md | 2 +- reference/bit/popcount.md | 4 +- reference/bit/rotl.md | 4 +- reference/bit/rotr.md | 4 +- reference/bitset/bitset/all.md | 6 +- reference/bitset/bitset/to_ullong.md | 6 +- reference/cfenv.md | 2 +- reference/cfenv/fe_all_except.md | 6 +- reference/cfenv/fe_divbyzero.md | 6 +- reference/cfenv/fe_downward.md | 6 +- reference/cfenv/fe_inexact.md | 6 +- reference/cfenv/fe_invalid.md | 6 +- reference/cfenv/fe_overflow.md | 6 +- reference/cfenv/fe_tonearest.md | 6 +- reference/cfenv/fe_towardzero.md | 6 +- reference/cfenv/fe_underflow.md | 6 +- reference/cfenv/fe_upward.md | 6 +- reference/cfenv/feclearexcept.md | 6 +- reference/cfenv/fegetexceptflag.md | 6 +- reference/cfenv/fegetround.md | 6 +- reference/cfenv/feraiseexcept.md | 6 +- reference/cfenv/fesetexceptflag.md | 6 +- reference/cfenv/fesetround.md | 6 +- reference/cfenv/fetestexcept.md | 6 +- reference/cfenv/fexcept_t.md | 6 +- reference/cfloat/dbl_decimal_dig.md | 4 +- reference/cfloat/dbl_has_subnorm.md | 4 +- reference/cfloat/dbl_true_min.md | 4 +- reference/cfloat/decimal_dig.md | 2 +- reference/cfloat/flt_decimal_dig.md | 4 +- reference/cfloat/flt_eval_method.md | 2 +- reference/cfloat/flt_has_subnorm.md | 4 +- reference/cfloat/flt_true_min.md | 4 +- reference/cfloat/ldbl_decimal_dig.md | 4 +- reference/cfloat/ldbl_has_subnorm.md | 4 +- reference/cfloat/ldbl_true_min.md | 4 +- reference/charconv.md | 6 +- reference/charconv/chars_format.md | 2 +- reference/charconv/from_chars.md | 6 +- reference/charconv/from_chars_result.md | 6 +- reference/charconv/to_chars.md | 6 +- reference/charconv/to_chars_result.md | 6 +- reference/chrono/ambiguous_local_time.md | 6 +- reference/chrono/choose.md | 6 +- reference/chrono/clock_cast.md | 6 +- reference/chrono/clock_time_conversion.md | 6 +- reference/chrono/common_type.md | 6 +- reference/chrono/current_zone.md | 6 +- reference/chrono/day.md | 6 +- reference/chrono/day/formatter.md | 6 +- reference/chrono/day/from_stream.md | 6 +- reference/chrono/day/ok.md | 6 +- reference/chrono/day/op_append.md | 6 +- reference/chrono/day/op_compare_3way.md | 6 +- reference/chrono/day/op_constructor.md | 6 +- reference/chrono/day/op_d.md | 6 +- reference/chrono/day/op_decrement.md | 6 +- reference/chrono/day/op_equal.md | 6 +- reference/chrono/day/op_increment.md | 6 +- reference/chrono/day/op_minus.md | 6 +- reference/chrono/day/op_minus_assign.md | 6 +- reference/chrono/day/op_ostream.md | 6 +- reference/chrono/day/op_plus.md | 6 +- reference/chrono/day/op_plus_assign.md | 6 +- reference/chrono/day/op_unsigned_int.md | 6 +- reference/chrono/duration.md | 4 +- reference/chrono/duration/abs.md | 4 +- reference/chrono/duration/ceil.md | 4 +- reference/chrono/duration/count.md | 4 +- reference/chrono/duration/floor.md | 4 +- reference/chrono/duration/formatter.md | 6 +- reference/chrono/duration/from_stream.md | 6 +- reference/chrono/duration/max.md | 4 +- reference/chrono/duration/min.md | 4 +- reference/chrono/duration/op_compare_3way.md | 2 +- reference/chrono/duration/op_constructor.md | 6 +- reference/chrono/duration/op_decrement.md | 4 +- reference/chrono/duration/op_divide.md | 4 +- reference/chrono/duration/op_divide_assign.md | 4 +- reference/chrono/duration/op_equal.md | 4 +- reference/chrono/duration/op_greater.md | 4 +- reference/chrono/duration/op_greater_equal.md | 4 +- reference/chrono/duration/op_h.md | 6 +- reference/chrono/duration/op_increment.md | 4 +- reference/chrono/duration/op_less.md | 4 +- reference/chrono/duration/op_less_equal.md | 4 +- reference/chrono/duration/op_min.md | 6 +- reference/chrono/duration/op_minus.md | 6 +- reference/chrono/duration/op_minus_assign.md | 4 +- reference/chrono/duration/op_modulo.md | 4 +- reference/chrono/duration/op_modulo_assign.md | 4 +- reference/chrono/duration/op_ms.md | 6 +- reference/chrono/duration/op_multiply.md | 4 +- .../chrono/duration/op_multiply_assign.md | 4 +- reference/chrono/duration/op_not_equal.md | 4 +- reference/chrono/duration/op_ns.md | 6 +- reference/chrono/duration/op_ostream.md | 6 +- reference/chrono/duration/op_plus.md | 6 +- reference/chrono/duration/op_plus_assign.md | 4 +- reference/chrono/duration/op_s.md | 6 +- reference/chrono/duration/op_unary_minus.md | 4 +- reference/chrono/duration/op_unary_plus.md | 4 +- reference/chrono/duration/op_us.md | 6 +- reference/chrono/duration/round.md | 4 +- reference/chrono/duration/zero.md | 4 +- reference/chrono/duration_aliases.md | 6 +- reference/chrono/duration_cast.md | 4 +- reference/chrono/duration_values.md | 4 +- reference/chrono/duration_values/max.md | 4 +- reference/chrono/duration_values/min.md | 4 +- reference/chrono/duration_values/zero.md | 4 +- reference/chrono/file_clock.md | 6 +- reference/chrono/file_time.md | 6 +- reference/chrono/format.md | 6 +- reference/chrono/get_leap_second_info.md | 6 +- reference/chrono/get_tzdb.md | 6 +- reference/chrono/get_tzdb_list.md | 6 +- reference/chrono/gps_clock.md | 6 +- reference/chrono/gps_clock/from_utc.md | 6 +- reference/chrono/gps_clock/now.md | 6 +- reference/chrono/gps_clock/to_utc.md | 6 +- reference/chrono/gps_time.md | 6 +- reference/chrono/hh_mm_ss.md | 6 +- reference/chrono/hh_mm_ss/formatter.md | 6 +- reference/chrono/hh_mm_ss/fractional_width.md | 6 +- reference/chrono/hh_mm_ss/hours.md | 6 +- reference/chrono/hh_mm_ss/is_negative.md | 6 +- reference/chrono/hh_mm_ss/minutes.md | 6 +- reference/chrono/hh_mm_ss/op_constructor.md | 6 +- reference/chrono/hh_mm_ss/op_ostream.md | 6 +- reference/chrono/hh_mm_ss/op_precision.md | 6 +- reference/chrono/hh_mm_ss/seconds.md | 6 +- reference/chrono/hh_mm_ss/subseconds.md | 6 +- reference/chrono/hh_mm_ss/to_duration.md | 6 +- reference/chrono/high_resolution_clock.md | 4 +- reference/chrono/high_resolution_clock/now.md | 4 +- reference/chrono/is_am.md | 6 +- reference/chrono/is_clock.md | 6 +- reference/chrono/is_pm.md | 6 +- reference/chrono/last_spec.md | 6 +- reference/chrono/last_spec/op_append.md | 6 +- reference/chrono/leap_second.md | 6 +- reference/chrono/leap_second/date.md | 6 +- .../chrono/leap_second/op_compare_3way.md | 6 +- reference/chrono/leap_second/op_equal.md | 6 +- reference/chrono/leap_second/op_greater.md | 6 +- .../chrono/leap_second/op_greater_equal.md | 6 +- reference/chrono/leap_second/op_less.md | 6 +- reference/chrono/leap_second/op_less_equal.md | 6 +- reference/chrono/leap_second/value.md | 6 +- reference/chrono/leap_second_info.md | 6 +- reference/chrono/local-time-format-t.md | 6 +- .../chrono/local-time-format-t/formatter.md | 6 +- reference/chrono/local_info.md | 6 +- reference/chrono/local_info/formatter.md | 6 +- reference/chrono/local_info/op_ostream.md | 6 +- reference/chrono/local_time.md | 6 +- reference/chrono/local_time_format.md | 6 +- reference/chrono/locate_zone.md | 6 +- reference/chrono/make12.md | 6 +- reference/chrono/make24.md | 6 +- reference/chrono/month.md | 6 +- reference/chrono/month/formatter.md | 6 +- reference/chrono/month/from_stream.md | 6 +- reference/chrono/month/ok.md | 6 +- reference/chrono/month/op_append.md | 6 +- reference/chrono/month/op_compare_3way.md | 6 +- reference/chrono/month/op_constructor.md | 6 +- reference/chrono/month/op_decrement.md | 6 +- reference/chrono/month/op_equal.md | 6 +- reference/chrono/month/op_increment.md | 6 +- reference/chrono/month/op_minus.md | 6 +- reference/chrono/month/op_minus_assign.md | 6 +- reference/chrono/month/op_ostream.md | 6 +- reference/chrono/month/op_plus.md | 6 +- reference/chrono/month/op_plus_assign.md | 6 +- reference/chrono/month/op_unsigned_int.md | 6 +- reference/chrono/month_constants.md | 6 +- reference/chrono/month_day.md | 6 +- reference/chrono/month_day/day.md | 6 +- reference/chrono/month_day/formatter.md | 6 +- reference/chrono/month_day/from_stream.md | 6 +- reference/chrono/month_day/month.md | 6 +- reference/chrono/month_day/ok.md | 6 +- reference/chrono/month_day/op_append.md | 6 +- reference/chrono/month_day/op_compare_3way.md | 6 +- reference/chrono/month_day/op_constructor.md | 6 +- reference/chrono/month_day/op_equal.md | 6 +- reference/chrono/month_day/op_ostream.md | 6 +- reference/chrono/month_day_last.md | 6 +- reference/chrono/month_day_last/formatter.md | 6 +- reference/chrono/month_day_last/month.md | 6 +- reference/chrono/month_day_last/ok.md | 6 +- reference/chrono/month_day_last/op_append.md | 6 +- .../chrono/month_day_last/op_compare_3way.md | 6 +- .../chrono/month_day_last/op_constructor.md | 6 +- reference/chrono/month_day_last/op_equal.md | 6 +- reference/chrono/month_day_last/op_ostream.md | 6 +- reference/chrono/month_weekday.md | 6 +- reference/chrono/month_weekday/formatter.md | 6 +- reference/chrono/month_weekday/month.md | 6 +- reference/chrono/month_weekday/ok.md | 6 +- reference/chrono/month_weekday/op_append.md | 6 +- .../chrono/month_weekday/op_constructor.md | 6 +- reference/chrono/month_weekday/op_equal.md | 6 +- reference/chrono/month_weekday/op_ostream.md | 6 +- .../chrono/month_weekday/weekday_indexed.md | 6 +- reference/chrono/month_weekday_last.md | 6 +- .../chrono/month_weekday_last/formatter.md | 6 +- reference/chrono/month_weekday_last/month.md | 6 +- reference/chrono/month_weekday_last/ok.md | 6 +- .../chrono/month_weekday_last/op_append.md | 6 +- .../month_weekday_last/op_constructor.md | 6 +- .../chrono/month_weekday_last/op_equal.md | 6 +- .../chrono/month_weekday_last/op_ostream.md | 6 +- .../chrono/month_weekday_last/weekday_last.md | 6 +- reference/chrono/nonexistent_local_time.md | 6 +- reference/chrono/parse.md | 6 +- reference/chrono/reload_tzdb.md | 6 +- reference/chrono/remote_version.md | 6 +- reference/chrono/steady_clock.md | 4 +- reference/chrono/steady_clock/now.md | 2 +- reference/chrono/sys_info.md | 6 +- reference/chrono/sys_info/formatter.md | 6 +- reference/chrono/sys_info/op_ostream.md | 6 +- reference/chrono/sys_time.md | 6 +- reference/chrono/system_clock.md | 4 +- reference/chrono/system_clock/from_time_t.md | 4 +- reference/chrono/system_clock/now.md | 4 +- reference/chrono/system_clock/to_time_t.md | 4 +- reference/chrono/tai_clock.md | 6 +- reference/chrono/tai_clock/from_utc.md | 6 +- reference/chrono/tai_clock/now.md | 6 +- reference/chrono/tai_clock/to_utc.md | 6 +- reference/chrono/tai_time.md | 6 +- reference/chrono/time_point.md | 4 +- reference/chrono/time_point/ceil.md | 4 +- reference/chrono/time_point/floor.md | 4 +- reference/chrono/time_point/max.md | 4 +- reference/chrono/time_point/min.md | 4 +- .../chrono/time_point/op_compare_3way.md | 2 +- reference/chrono/time_point/op_constructor.md | 4 +- reference/chrono/time_point/op_equal.md | 4 +- reference/chrono/time_point/op_greater.md | 4 +- .../chrono/time_point/op_greater_equal.md | 4 +- reference/chrono/time_point/op_less.md | 4 +- reference/chrono/time_point/op_less_equal.md | 4 +- reference/chrono/time_point/op_minus.md | 6 +- .../chrono/time_point/op_minus_assign.md | 4 +- reference/chrono/time_point/op_not_equal.md | 4 +- reference/chrono/time_point/op_plus.md | 6 +- reference/chrono/time_point/op_plus_assign.md | 4 +- reference/chrono/time_point/round.md | 4 +- .../chrono/time_point/time_since_epoch.md | 4 +- reference/chrono/time_point_cast.md | 4 +- reference/chrono/time_zone.md | 6 +- reference/chrono/time_zone/get_info.md | 6 +- reference/chrono/time_zone/name.md | 6 +- reference/chrono/time_zone/op_compare_3way.md | 6 +- reference/chrono/time_zone/op_equal.md | 6 +- reference/chrono/time_zone/to_local.md | 6 +- reference/chrono/time_zone/to_sys.md | 6 +- reference/chrono/time_zone_link.md | 6 +- reference/chrono/time_zone_link/name.md | 6 +- .../chrono/time_zone_link/op_compare_3way.md | 6 +- reference/chrono/time_zone_link/op_equal.md | 6 +- reference/chrono/time_zone_link/target.md | 6 +- reference/chrono/treat_as_floating_point.md | 4 +- reference/chrono/tzdb.md | 6 +- reference/chrono/tzdb/current_zone.md | 6 +- reference/chrono/tzdb/locate_zone.md | 6 +- reference/chrono/tzdb_list.md | 6 +- reference/chrono/tzdb_list/begin.md | 6 +- reference/chrono/tzdb_list/cbegin.md | 6 +- reference/chrono/tzdb_list/cend.md | 6 +- reference/chrono/tzdb_list/end.md | 6 +- reference/chrono/tzdb_list/front.md | 6 +- reference/chrono/utc_clock.md | 6 +- reference/chrono/utc_clock/from_sys.md | 6 +- reference/chrono/utc_clock/now.md | 6 +- reference/chrono/utc_clock/to_sys.md | 6 +- reference/chrono/utc_time.md | 6 +- reference/chrono/weekday.md | 6 +- reference/chrono/weekday/c_encoding.md | 6 +- reference/chrono/weekday/formatter.md | 6 +- reference/chrono/weekday/from_stream.md | 6 +- reference/chrono/weekday/iso_encoding.md | 6 +- reference/chrono/weekday/ok.md | 6 +- reference/chrono/weekday/op_at.md | 6 +- reference/chrono/weekday/op_constructor.md | 6 +- reference/chrono/weekday/op_decrement.md | 6 +- reference/chrono/weekday/op_equal.md | 6 +- reference/chrono/weekday/op_increment.md | 6 +- reference/chrono/weekday/op_minus.md | 6 +- reference/chrono/weekday/op_minus_assign.md | 6 +- reference/chrono/weekday/op_ostream.md | 6 +- reference/chrono/weekday/op_plus.md | 6 +- reference/chrono/weekday/op_plus_assign.md | 6 +- reference/chrono/weekday_constants.md | 6 +- reference/chrono/weekday_indexed.md | 6 +- reference/chrono/weekday_indexed/formatter.md | 6 +- reference/chrono/weekday_indexed/index.md | 6 +- reference/chrono/weekday_indexed/ok.md | 6 +- .../chrono/weekday_indexed/op_constructor.md | 6 +- reference/chrono/weekday_indexed/op_equal.md | 6 +- .../chrono/weekday_indexed/op_ostream.md | 6 +- reference/chrono/weekday_indexed/weekday.md | 6 +- reference/chrono/weekday_last.md | 6 +- reference/chrono/weekday_last/formatter.md | 6 +- reference/chrono/weekday_last/ok.md | 6 +- .../chrono/weekday_last/op_constructor.md | 6 +- reference/chrono/weekday_last/op_equal.md | 6 +- reference/chrono/weekday_last/op_ostream.md | 6 +- reference/chrono/weekday_last/weekday.md | 6 +- reference/chrono/year.md | 6 +- reference/chrono/year/formatter.md | 6 +- reference/chrono/year/from_stream.md | 6 +- reference/chrono/year/is_leap.md | 6 +- reference/chrono/year/max.md | 6 +- reference/chrono/year/min.md | 6 +- reference/chrono/year/ok.md | 6 +- reference/chrono/year/op_append.md | 6 +- reference/chrono/year/op_compare_3way.md | 6 +- reference/chrono/year/op_constructor.md | 6 +- reference/chrono/year/op_decrement.md | 6 +- reference/chrono/year/op_equal.md | 6 +- reference/chrono/year/op_increment.md | 6 +- reference/chrono/year/op_int.md | 6 +- reference/chrono/year/op_minus.md | 6 +- reference/chrono/year/op_minus_assign.md | 6 +- reference/chrono/year/op_ostream.md | 6 +- reference/chrono/year/op_plus.md | 6 +- reference/chrono/year/op_plus_assign.md | 6 +- reference/chrono/year/op_unary_minus.md | 6 +- reference/chrono/year/op_unary_plus.md | 6 +- reference/chrono/year/op_y.md | 6 +- reference/chrono/year_month.md | 6 +- reference/chrono/year_month/formatter.md | 6 +- reference/chrono/year_month/from_stream.md | 6 +- reference/chrono/year_month/month.md | 6 +- reference/chrono/year_month/ok.md | 6 +- reference/chrono/year_month/op_append.md | 6 +- .../chrono/year_month/op_compare_3way.md | 6 +- reference/chrono/year_month/op_constructor.md | 6 +- reference/chrono/year_month/op_equal.md | 6 +- reference/chrono/year_month/op_minus.md | 6 +- .../chrono/year_month/op_minus_assign.md | 6 +- reference/chrono/year_month/op_ostream.md | 6 +- reference/chrono/year_month/op_plus.md | 6 +- reference/chrono/year_month/op_plus_assign.md | 6 +- reference/chrono/year_month/year.md | 6 +- reference/chrono/year_month_day.md | 6 +- reference/chrono/year_month_day/day.md | 6 +- reference/chrono/year_month_day/formatter.md | 6 +- .../chrono/year_month_day/from_stream.md | 6 +- reference/chrono/year_month_day/month.md | 6 +- reference/chrono/year_month_day/ok.md | 6 +- .../chrono/year_month_day/op_compare_3way.md | 6 +- .../chrono/year_month_day/op_constructor.md | 6 +- reference/chrono/year_month_day/op_equal.md | 6 +- .../chrono/year_month_day/op_local_days.md | 6 +- reference/chrono/year_month_day/op_minus.md | 6 +- .../chrono/year_month_day/op_minus_assign.md | 6 +- reference/chrono/year_month_day/op_ostream.md | 6 +- reference/chrono/year_month_day/op_plus.md | 6 +- .../chrono/year_month_day/op_plus_assign.md | 6 +- .../chrono/year_month_day/op_sys_days.md | 6 +- reference/chrono/year_month_day/year.md | 6 +- reference/chrono/year_month_day_last.md | 6 +- reference/chrono/year_month_day_last/day.md | 6 +- .../chrono/year_month_day_last/formatter.md | 6 +- reference/chrono/year_month_day_last/month.md | 6 +- .../year_month_day_last/month_day_last.md | 6 +- reference/chrono/year_month_day_last/ok.md | 6 +- .../year_month_day_last/op_compare_3way.md | 6 +- .../year_month_day_last/op_constructor.md | 6 +- .../chrono/year_month_day_last/op_equal.md | 6 +- .../year_month_day_last/op_local_days.md | 6 +- .../chrono/year_month_day_last/op_minus.md | 6 +- .../year_month_day_last/op_minus_assign.md | 6 +- .../chrono/year_month_day_last/op_ostream.md | 6 +- .../chrono/year_month_day_last/op_plus.md | 6 +- .../year_month_day_last/op_plus_assign.md | 6 +- .../chrono/year_month_day_last/op_sys_days.md | 6 +- reference/chrono/year_month_day_last/year.md | 6 +- reference/chrono/year_month_weekday.md | 6 +- .../chrono/year_month_weekday/formatter.md | 6 +- reference/chrono/year_month_weekday/index.md | 6 +- reference/chrono/year_month_weekday/month.md | 6 +- reference/chrono/year_month_weekday/ok.md | 6 +- .../year_month_weekday/op_constructor.md | 6 +- .../chrono/year_month_weekday/op_equal.md | 6 +- .../year_month_weekday/op_local_days.md | 6 +- .../chrono/year_month_weekday/op_minus.md | 6 +- .../year_month_weekday/op_minus_assign.md | 6 +- .../chrono/year_month_weekday/op_ostream.md | 6 +- .../chrono/year_month_weekday/op_plus.md | 6 +- .../year_month_weekday/op_plus_assign.md | 6 +- .../chrono/year_month_weekday/op_sys_days.md | 6 +- .../chrono/year_month_weekday/weekday.md | 6 +- .../year_month_weekday/weekday_indexed.md | 6 +- reference/chrono/year_month_weekday/year.md | 6 +- reference/chrono/year_month_weekday_last.md | 6 +- .../year_month_weekday_last/formatter.md | 6 +- .../chrono/year_month_weekday_last/month.md | 6 +- .../chrono/year_month_weekday_last/ok.md | 6 +- .../year_month_weekday_last/op_constructor.md | 6 +- .../year_month_weekday_last/op_equal.md | 6 +- .../year_month_weekday_last/op_local_days.md | 6 +- .../year_month_weekday_last/op_minus.md | 6 +- .../op_minus_assign.md | 6 +- .../year_month_weekday_last/op_ostream.md | 6 +- .../chrono/year_month_weekday_last/op_plus.md | 6 +- .../year_month_weekday_last/op_plus_assign.md | 6 +- .../year_month_weekday_last/op_sys_days.md | 6 +- .../chrono/year_month_weekday_last/weekday.md | 6 +- .../year_month_weekday_last/weekday_last.md | 6 +- .../chrono/year_month_weekday_last/year.md | 6 +- reference/chrono/zoned_time.md | 6 +- reference/chrono/zoned_time/formatter.md | 6 +- .../chrono/zoned_time/formatter/format.md | 6 +- reference/chrono/zoned_time/get_info.md | 6 +- reference/chrono/zoned_time/get_local_time.md | 6 +- reference/chrono/zoned_time/get_sys_time.md | 6 +- reference/chrono/zoned_time/get_time_zone.md | 6 +- reference/chrono/zoned_time/op_assign.md | 6 +- reference/chrono/zoned_time/op_constructor.md | 6 +- .../chrono/zoned_time/op_deduction_guide.md | 6 +- reference/chrono/zoned_time/op_equal.md | 6 +- reference/chrono/zoned_time/op_local_time.md | 6 +- reference/chrono/zoned_time/op_ostream.md | 6 +- reference/chrono/zoned_time/op_sys_time.md | 6 +- reference/chrono/zoned_traits.md | 6 +- reference/chrono/zoned_traits/default_zone.md | 6 +- reference/chrono/zoned_traits/locate_zone.md | 6 +- reference/climits/char_bit.md | 6 +- reference/climits/char_max.md | 6 +- reference/climits/char_min.md | 6 +- reference/climits/int_max.md | 6 +- reference/climits/int_min.md | 6 +- reference/climits/llong_max.md | 6 +- reference/climits/llong_min.md | 6 +- reference/climits/long_max.md | 6 +- reference/climits/long_min.md | 6 +- reference/climits/mb_len_max.md | 6 +- reference/climits/schar_max.md | 6 +- reference/climits/schar_min.md | 6 +- reference/climits/shrt_max.md | 6 +- reference/climits/shrt_min.md | 6 +- reference/climits/uchar_max.md | 6 +- reference/climits/uint_max.md | 6 +- reference/climits/ullong_max.md | 6 +- reference/climits/ulong_max.md | 6 +- reference/climits/ushrt_max.md | 6 +- reference/cmath/acos.md | 8 +- reference/cmath/acosh.md | 4 +- reference/cmath/asin.md | 8 +- reference/cmath/asinh.md | 4 +- reference/cmath/assoc_laguerre.md | 2 +- reference/cmath/assoc_legendre.md | 2 +- reference/cmath/atan.md | 8 +- reference/cmath/atan2.md | 8 +- reference/cmath/atanh.md | 4 +- reference/cmath/beta.md | 2 +- reference/cmath/cbrt.md | 4 +- reference/cmath/comp_ellint_1.md | 2 +- reference/cmath/comp_ellint_2.md | 2 +- reference/cmath/comp_ellint_3.md | 2 +- reference/cmath/copysign.md | 4 +- reference/cmath/cos.md | 8 +- reference/cmath/cosh.md | 8 +- reference/cmath/cyl_bessel_i.md | 2 +- reference/cmath/cyl_bessel_j.md | 2 +- reference/cmath/cyl_bessel_k.md | 2 +- reference/cmath/cyl_neumann.md | 2 +- reference/cmath/double_t.md | 2 +- reference/cmath/ellint_1.md | 2 +- reference/cmath/ellint_2.md | 2 +- reference/cmath/ellint_3.md | 2 +- reference/cmath/erf.md | 4 +- reference/cmath/erfc.md | 4 +- reference/cmath/exp.md | 8 +- reference/cmath/exp2.md | 4 +- reference/cmath/expint.md | 2 +- reference/cmath/expm1.md | 4 +- reference/cmath/fabs.md | 8 +- reference/cmath/fdim.md | 4 +- reference/cmath/float_t.md | 2 +- reference/cmath/fmax.md | 4 +- reference/cmath/fmin.md | 4 +- reference/cmath/hermite.md | 2 +- reference/cmath/hypot.md | 6 +- reference/cmath/ilogb.md | 4 +- reference/cmath/isfinite.md | 4 +- reference/cmath/isgreater.md | 4 +- reference/cmath/isgreaterequal.md | 4 +- reference/cmath/isinf.md | 4 +- reference/cmath/isless.md | 4 +- reference/cmath/islessequal.md | 4 +- reference/cmath/islessgreater.md | 4 +- reference/cmath/isnan.md | 4 +- reference/cmath/isnormal.md | 4 +- reference/cmath/isunordered.md | 4 +- reference/cmath/laguerre.md | 2 +- reference/cmath/legendre.md | 2 +- reference/cmath/lerp.md | 2 +- reference/cmath/lgamma.md | 4 +- reference/cmath/llrint.md | 6 +- reference/cmath/llround.md | 4 +- reference/cmath/log.md | 8 +- reference/cmath/log10.md | 8 +- reference/cmath/log1p.md | 4 +- reference/cmath/log2.md | 4 +- reference/cmath/logb.md | 4 +- reference/cmath/lrint.md | 6 +- reference/cmath/lround.md | 4 +- reference/cmath/math_errexcept.md | 4 +- reference/cmath/math_errhandling.md | 4 +- reference/cmath/math_errno.md | 4 +- reference/cmath/nanf.md | 4 +- reference/cmath/nearbyint.md | 6 +- reference/cmath/nextafter.md | 4 +- reference/cmath/nexttoward.md | 4 +- reference/cmath/pow.md | 8 +- reference/cmath/remainder.md | 4 +- reference/cmath/remquo.md | 4 +- reference/cmath/riemann_zeta.md | 2 +- reference/cmath/rint.md | 6 +- reference/cmath/scalbln.md | 4 +- reference/cmath/scalbn.md | 4 +- reference/cmath/signbit.md | 4 +- reference/cmath/sin.md | 8 +- reference/cmath/sinh.md | 8 +- reference/cmath/sph_bessel.md | 2 +- reference/cmath/sph_legendre.md | 2 +- reference/cmath/sph_neumann.md | 2 +- reference/cmath/sqrt.md | 8 +- reference/cmath/tan.md | 8 +- reference/cmath/tanh.md | 8 +- reference/cmath/tgamma.md | 4 +- reference/codecvt/codecvt_mode.md | 6 +- reference/codecvt/codecvt_utf16.md | 6 +- reference/codecvt/codecvt_utf8.md | 6 +- reference/codecvt/codecvt_utf8_utf16.md | 6 +- reference/compare.md | 6 +- .../compare/common_comparison_category.md | 6 +- .../compare/compare_partial_order_fallback.md | 2 +- .../compare/compare_strong_order_fallback.md | 2 +- reference/compare/compare_three_way.md | 2 +- .../compare/compare_three_way/op_call.md | 2 +- reference/compare/compare_three_way_result.md | 2 +- .../compare/compare_weak_order_fallback.md | 2 +- .../compare/named_comparison_functions.md | 6 +- reference/compare/partial_order.md | 2 +- reference/compare/partial_ordering.md | 6 +- .../partial_ordering/op_compare_3way.md | 4 +- .../compare/partial_ordering/op_equal.md | 6 +- .../compare/partial_ordering/op_greater.md | 6 +- .../partial_ordering/op_greater_equal.md | 6 +- reference/compare/partial_ordering/op_less.md | 6 +- .../compare/partial_ordering/op_less_equal.md | 6 +- .../compare/partial_ordering/op_not_equal.md | 6 +- reference/compare/strong_order.md | 2 +- reference/compare/strong_ordering.md | 6 +- .../strong_ordering/op_compare_3way.md | 4 +- reference/compare/strong_ordering/op_equal.md | 6 +- .../compare/strong_ordering/op_greater.md | 6 +- .../strong_ordering/op_greater_equal.md | 6 +- reference/compare/strong_ordering/op_less.md | 6 +- .../compare/strong_ordering/op_less_equal.md | 6 +- .../compare/strong_ordering/op_not_equal.md | 6 +- .../strong_ordering/op_partial_ordering.md | 6 +- .../strong_ordering/op_weak_ordering.md | 6 +- reference/compare/three_way_comparable.md | 2 +- reference/compare/weak_order.md | 2 +- reference/compare/weak_ordering.md | 6 +- .../compare/weak_ordering/op_compare_3way.md | 4 +- reference/compare/weak_ordering/op_equal.md | 6 +- reference/compare/weak_ordering/op_greater.md | 6 +- .../compare/weak_ordering/op_greater_equal.md | 6 +- reference/compare/weak_ordering/op_less.md | 6 +- .../compare/weak_ordering/op_less_equal.md | 6 +- .../compare/weak_ordering/op_not_equal.md | 6 +- .../weak_ordering/op_partial_ordering.md | 6 +- reference/complex/complex/abs.md | 4 +- reference/complex/complex/acos.md | 6 +- reference/complex/complex/acosh.md | 6 +- reference/complex/complex/arg.md | 6 +- reference/complex/complex/asin.md | 6 +- reference/complex/complex/asinh.md | 6 +- reference/complex/complex/atan.md | 6 +- reference/complex/complex/atanh.md | 6 +- reference/complex/complex/conj.md | 6 +- reference/complex/complex/cos.md | 4 +- reference/complex/complex/cosh.md | 4 +- reference/complex/complex/exp.md | 4 +- reference/complex/complex/imag_free.md | 6 +- reference/complex/complex/log.md | 4 +- reference/complex/complex/log10.md | 4 +- reference/complex/complex/norm.md | 6 +- reference/complex/complex/op_i.md | 4 +- reference/complex/complex/op_if.md | 4 +- reference/complex/complex/op_il.md | 4 +- reference/complex/complex/polar.md | 4 +- reference/complex/complex/pow.md | 6 +- reference/complex/complex/proj.md | 6 +- reference/complex/complex/real_free.md | 6 +- reference/complex/complex/sin.md | 4 +- reference/complex/complex/sinh.md | 4 +- reference/complex/complex/sqrt.md | 4 +- reference/complex/complex/tan.md | 4 +- reference/complex/complex/tanh.md | 4 +- reference/concepts/assignable_from.md | 4 +- reference/concepts/common_reference_with.md | 4 +- reference/concepts/common_with.md | 4 +- reference/concepts/constructible_from.md | 4 +- reference/concepts/convertible_to.md | 4 +- reference/concepts/copy_constructible.md | 4 +- reference/concepts/copyable.md | 4 +- reference/concepts/default_initializable.md | 4 +- reference/concepts/derived_from.md | 4 +- reference/concepts/destructible.md | 4 +- reference/concepts/equality_comparable.md | 4 +- reference/concepts/equivalence_relation.md | 4 +- reference/concepts/floating_point.md | 4 +- reference/concepts/integral.md | 4 +- reference/concepts/invocable.md | 4 +- reference/concepts/movable.md | 4 +- reference/concepts/move_constructible.md | 4 +- reference/concepts/predicate.md | 4 +- reference/concepts/regular.md | 4 +- reference/concepts/relation.md | 4 +- reference/concepts/same_as.md | 4 +- reference/concepts/semiregular.md | 4 +- reference/concepts/signed_integral.md | 4 +- reference/concepts/strict_weak_order.md | 4 +- reference/concepts/swap.md | 4 +- reference/concepts/swappable.md | 4 +- reference/concepts/totally_ordered.md | 4 +- reference/concepts/unsigned_integral.md | 4 +- .../condition_variable/condition_variable.md | 4 +- .../condition_variable/native_handle.md | 4 +- .../condition_variable/notify_all.md | 4 +- .../notify_all_at_thread_exit.md | 6 +- .../condition_variable/notify_one.md | 4 +- .../condition_variable/op_constructor.md | 4 +- .../condition_variable/op_destructor.md | 4 +- .../condition_variable/wait.md | 4 +- .../condition_variable/wait_for.md | 4 +- .../condition_variable/wait_until.md | 4 +- .../condition_variable_any.md | 2 +- .../condition_variable_any/notify_all.md | 4 +- .../condition_variable_any/notify_one.md | 4 +- .../condition_variable_any/op_constructor.md | 4 +- .../condition_variable_any/op_destructor.md | 4 +- .../condition_variable_any/wait.md | 4 +- .../condition_variable_any/wait_for.md | 4 +- .../condition_variable_any/wait_until.md | 4 +- reference/condition_variable/cv_status.md | 4 +- reference/coroutine.md | 2 +- reference/coroutine/coroutine_handle.md | 2 +- .../coroutine/coroutine_handle/address.md | 2 +- .../coroutine/coroutine_handle/destroy.md | 2 +- reference/coroutine/coroutine_handle/done.md | 2 +- .../coroutine_handle/from_address.md | 2 +- .../coroutine_handle/from_promise.md | 2 +- .../coroutine/coroutine_handle/op_assign.md | 2 +- .../coroutine/coroutine_handle/op_bool.md | 2 +- .../coroutine_handle/op_constructor.md | 2 +- .../coroutine/coroutine_handle/promise.md | 2 +- .../coroutine/coroutine_handle/resume.md | 2 +- reference/coroutine/coroutine_traits.md | 2 +- reference/coroutine/noop_coroutine.md | 2 +- reference/coroutine/noop_coroutine_handle.md | 2 +- reference/coroutine/suspend_always.md | 2 +- reference/coroutine/suspend_never.md | 2 +- reference/cstddef/byte.md | 6 +- reference/cstddef/byte/op_and.md | 4 +- reference/cstddef/byte/op_and_assign.md | 4 +- reference/cstddef/byte/op_flip.md | 4 +- reference/cstddef/byte/op_left_shift.md | 4 +- .../cstddef/byte/op_left_shift_assign.md | 4 +- reference/cstddef/byte/op_or.md | 4 +- reference/cstddef/byte/op_or_assign.md | 4 +- reference/cstddef/byte/op_right_shift.md | 4 +- .../cstddef/byte/op_right_shift_assign.md | 4 +- reference/cstddef/byte/op_xor.md | 4 +- reference/cstddef/byte/op_xor_assign.md | 4 +- reference/cstddef/byte/to_integer.md | 4 +- reference/cstddef/max_align_t.md | 6 +- reference/cstddef/nullptr_t.md | 6 +- reference/cstdint/int16_max.md | 6 +- reference/cstdint/int16_min.md | 6 +- reference/cstdint/int16_t.md | 6 +- reference/cstdint/int32_max.md | 6 +- reference/cstdint/int32_min.md | 6 +- reference/cstdint/int32_t.md | 6 +- reference/cstdint/int64_max.md | 6 +- reference/cstdint/int64_min.md | 6 +- reference/cstdint/int64_t.md | 6 +- reference/cstdint/int8_max.md | 6 +- reference/cstdint/int8_min.md | 6 +- reference/cstdint/int8_t.md | 6 +- reference/cstdint/int_fast16_max.md | 6 +- reference/cstdint/int_fast16_min.md | 6 +- reference/cstdint/int_fast16_t.md | 6 +- reference/cstdint/int_fast32_max.md | 6 +- reference/cstdint/int_fast32_min.md | 6 +- reference/cstdint/int_fast32_t.md | 6 +- reference/cstdint/int_fast64_max.md | 6 +- reference/cstdint/int_fast64_min.md | 6 +- reference/cstdint/int_fast64_t.md | 6 +- reference/cstdint/int_fast8_max.md | 6 +- reference/cstdint/int_fast8_min.md | 6 +- reference/cstdint/int_fast8_t.md | 6 +- reference/cstdint/int_least16_max.md | 6 +- reference/cstdint/int_least16_min.md | 6 +- reference/cstdint/int_least16_t.md | 6 +- reference/cstdint/int_least32_max.md | 6 +- reference/cstdint/int_least32_min.md | 6 +- reference/cstdint/int_least32_t.md | 6 +- reference/cstdint/int_least64_max.md | 6 +- reference/cstdint/int_least64_min.md | 6 +- reference/cstdint/int_least64_t.md | 6 +- reference/cstdint/int_least8_max.md | 6 +- reference/cstdint/int_least8_min.md | 6 +- reference/cstdint/int_least8_t.md | 6 +- reference/cstdint/intmax_max.md | 6 +- reference/cstdint/intmax_min.md | 6 +- reference/cstdint/intmax_t.md | 6 +- reference/cstdint/intptr_max.md | 4 +- reference/cstdint/intptr_min.md | 4 +- reference/cstdint/intptr_t.md | 6 +- reference/cstdint/ptrdiff_max.md | 6 +- reference/cstdint/ptrdiff_min.md | 6 +- reference/cstdint/sig_atomic_max.md | 4 +- reference/cstdint/sig_atomic_min.md | 4 +- reference/cstdint/size_max.md | 4 +- reference/cstdint/uint16_max.md | 6 +- reference/cstdint/uint16_t.md | 6 +- reference/cstdint/uint32_max.md | 6 +- reference/cstdint/uint32_t.md | 6 +- reference/cstdint/uint64_max.md | 6 +- reference/cstdint/uint64_t.md | 6 +- reference/cstdint/uint8_max.md | 6 +- reference/cstdint/uint8_t.md | 6 +- reference/cstdint/uint_fast16_max.md | 6 +- reference/cstdint/uint_fast16_t.md | 6 +- reference/cstdint/uint_fast32_max.md | 6 +- reference/cstdint/uint_fast32_t.md | 6 +- reference/cstdint/uint_fast64_max.md | 6 +- reference/cstdint/uint_fast64_t.md | 6 +- reference/cstdint/uint_fast8_max.md | 6 +- reference/cstdint/uint_fast8_t.md | 6 +- reference/cstdint/uint_least16_max.md | 6 +- reference/cstdint/uint_least16_t.md | 6 +- reference/cstdint/uint_least32_max.md | 6 +- reference/cstdint/uint_least32_t.md | 6 +- reference/cstdint/uint_least64_max.md | 6 +- reference/cstdint/uint_least64_t.md | 6 +- reference/cstdint/uint_least8_max.md | 6 +- reference/cstdint/uint_least8_t.md | 6 +- reference/cstdint/uintmax_max.md | 6 +- reference/cstdint/uintmax_t.md | 6 +- reference/cstdint/uintptr_max.md | 4 +- reference/cstdint/uintptr_t.md | 6 +- reference/cstdint/wchar_max.md | 6 +- reference/cstdint/wchar_min.md | 6 +- reference/cstdint/wint_max.md | 6 +- reference/cstdint/wint_min.md | 6 +- reference/cstdlib/aligned_alloc.md | 6 +- reference/cstdlib/at_quick_exit.md | 6 +- reference/cstdlib/exit_.md | 6 +- reference/cstdlib/quick_exit.md | 6 +- reference/ctime/timespec.md | 4 +- reference/ctime/timespec_get.md | 4 +- reference/deque/deque/cbegin.md | 4 +- reference/deque/deque/cend.md | 4 +- reference/deque/deque/crbegin.md | 4 +- reference/deque/deque/crend.md | 4 +- reference/deque/deque/emplace.md | 4 +- reference/deque/deque/emplace_back.md | 4 +- reference/deque/deque/emplace_front.md | 4 +- reference/deque/deque/erase_free.md | 4 +- reference/deque/deque/erase_if_free.md | 4 +- reference/deque/deque/get_allocator.md | 2 +- reference/deque/deque/op_compare_3way.md | 2 +- reference/deque/deque/op_deduction_guide.md | 2 +- reference/deque/deque/shrink_to_fit.md | 4 +- reference/exception/current_exception.md | 4 +- reference/exception/exception_ptr.md | 4 +- reference/exception/get_terminate.md | 4 +- reference/exception/get_unexpected.md | 4 +- reference/exception/make_exception_ptr.md | 4 +- reference/exception/nested_exception.md | 4 +- .../exception/nested_exception/nested_ptr.md | 4 +- .../nested_exception/op_constructor.md | 6 +- .../nested_exception/rethrow_nested.md | 4 +- reference/exception/rethrow_exception.md | 4 +- reference/exception/rethrow_if_nested.md | 4 +- reference/exception/throw_with_nested.md | 4 +- reference/exception/uncaught_exceptions.md | 6 +- reference/expected.md | 4 +- reference/expected/bad_expected_access.md | 4 +- .../expected/bad_expected_access/error.md | 4 +- .../bad_expected_access/op_constructor.md | 4 +- .../expected/bad_expected_access/what.md | 4 +- reference/expected/expected.md | 4 +- reference/expected/expected.void/and_then.md | 2 +- reference/expected/expected.void/emplace.md | 4 +- reference/expected/expected.void/error.md | 4 +- reference/expected/expected.void/error_or.md | 2 +- reference/expected/expected.void/has_value.md | 4 +- reference/expected/expected.void/op_assign.md | 4 +- reference/expected/expected.void/op_bool.md | 4 +- .../expected/expected.void/op_constructor.md | 4 +- reference/expected/expected.void/op_deref.md | 4 +- .../expected/expected.void/op_destructor.md | 4 +- reference/expected/expected.void/op_equal.md | 4 +- .../expected/expected.void/op_not_equal.md | 4 +- reference/expected/expected.void/or_else.md | 2 +- reference/expected/expected.void/swap.md | 4 +- reference/expected/expected.void/swap_free.md | 4 +- reference/expected/expected.void/transform.md | 2 +- .../expected/expected.void/transform_error.md | 2 +- reference/expected/expected.void/value.md | 4 +- reference/expected/expected/and_then.md | 2 +- reference/expected/expected/emplace.md | 4 +- reference/expected/expected/error.md | 4 +- reference/expected/expected/error_or.md | 2 +- reference/expected/expected/has_value.md | 4 +- reference/expected/expected/op_arrow.md | 4 +- reference/expected/expected/op_assign.md | 4 +- reference/expected/expected/op_bool.md | 4 +- reference/expected/expected/op_constructor.md | 4 +- reference/expected/expected/op_deref.md | 4 +- reference/expected/expected/op_destructor.md | 4 +- reference/expected/expected/op_equal.md | 4 +- reference/expected/expected/op_not_equal.md | 4 +- reference/expected/expected/or_else.md | 2 +- reference/expected/expected/swap.md | 4 +- reference/expected/expected/swap_free.md | 4 +- reference/expected/expected/transform.md | 2 +- .../expected/expected/transform_error.md | 2 +- reference/expected/expected/value.md | 4 +- reference/expected/expected/value_or.md | 4 +- reference/expected/unexpect_t.md | 4 +- reference/expected/unexpected.md | 4 +- reference/expected/unexpected/error.md | 4 +- .../expected/unexpected/op_constructor.md | 4 +- .../expected/unexpected/op_deduction_guide.md | 4 +- reference/expected/unexpected/op_equal.md | 4 +- reference/expected/unexpected/op_not_equal.md | 4 +- reference/expected/unexpected/swap.md | 4 +- reference/expected/unexpected/swap_free.md | 4 +- reference/filesystem/absolute.md | 4 +- reference/filesystem/canonical.md | 4 +- reference/filesystem/copy.md | 4 +- reference/filesystem/copy_file.md | 4 +- reference/filesystem/copy_options.md | 4 +- reference/filesystem/copy_symlink.md | 4 +- reference/filesystem/create_directories.md | 4 +- reference/filesystem/create_directory.md | 4 +- .../filesystem/create_directory_symlink.md | 4 +- reference/filesystem/create_hard_link.md | 4 +- reference/filesystem/create_symlink.md | 4 +- reference/filesystem/current_path.md | 4 +- reference/filesystem/directory_entry.md | 4 +- .../filesystem/directory_entry/assign.md | 2 +- .../filesystem/directory_entry/exists.md | 2 +- .../filesystem/directory_entry/file_size.md | 2 +- .../directory_entry/hard_link_count.md | 2 +- .../directory_entry/is_block_file.md | 2 +- .../directory_entry/is_character_file.md | 2 +- .../directory_entry/is_directory.md | 2 +- .../filesystem/directory_entry/is_fifo.md | 2 +- .../filesystem/directory_entry/is_other.md | 2 +- .../directory_entry/is_regular_file.md | 2 +- .../filesystem/directory_entry/is_socket.md | 2 +- .../filesystem/directory_entry/is_symlink.md | 2 +- .../directory_entry/last_write_time.md | 2 +- .../directory_entry/op_compare_3way.md | 2 +- .../directory_entry/op_constructor.md | 2 +- .../filesystem/directory_entry/op_equal.md | 2 +- .../filesystem/directory_entry/op_greater.md | 2 +- .../directory_entry/op_greater_equal.md | 2 +- .../filesystem/directory_entry/op_less.md | 2 +- .../directory_entry/op_less_equal.md | 2 +- .../directory_entry/op_not_equal.md | 2 +- .../filesystem/directory_entry/op_path.md | 2 +- reference/filesystem/directory_entry/path.md | 2 +- .../filesystem/directory_entry/refresh.md | 2 +- .../directory_entry/replace_filename.md | 2 +- .../filesystem/directory_entry/status.md | 2 +- .../directory_entry/symlink_status.md | 2 +- reference/filesystem/directory_iterator.md | 4 +- .../directory_iterator/begin_free.md | 4 +- .../filesystem/directory_iterator/end_free.md | 4 +- .../directory_iterator/increment.md | 4 +- .../filesystem/directory_iterator/op_arrow.md | 4 +- .../directory_iterator/op_assign.md | 4 +- .../directory_iterator/op_constructor.md | 4 +- .../filesystem/directory_iterator/op_deref.md | 4 +- .../filesystem/directory_iterator/op_equal.md | 4 +- .../directory_iterator/op_increment.md | 4 +- .../directory_iterator/op_not_equal.md | 4 +- reference/filesystem/directory_options.md | 4 +- reference/filesystem/equivalent.md | 4 +- reference/filesystem/exists.md | 4 +- reference/filesystem/file_size.md | 4 +- reference/filesystem/file_status.md | 4 +- .../filesystem/file_status/op_constructor.md | 2 +- reference/filesystem/file_status/op_equal.md | 2 +- .../filesystem/file_status/permissions.md | 2 +- reference/filesystem/file_status/type.md | 2 +- reference/filesystem/file_time_type.md | 4 +- reference/filesystem/file_type.md | 4 +- reference/filesystem/filesystem_error.md | 4 +- reference/filesystem/filesystem_error/code.md | 2 +- .../filesystem_error/op_constructor.md | 2 +- .../filesystem/filesystem_error/path1.md | 2 +- .../filesystem/filesystem_error/path2.md | 2 +- reference/filesystem/filesystem_error/what.md | 2 +- reference/filesystem/hard_link_count.md | 4 +- reference/filesystem/is_block_file.md | 4 +- reference/filesystem/is_character_file.md | 4 +- reference/filesystem/is_directory.md | 4 +- reference/filesystem/is_empty.md | 4 +- reference/filesystem/is_fifo.md | 4 +- reference/filesystem/is_other.md | 4 +- reference/filesystem/is_regular_file.md | 4 +- reference/filesystem/is_socket.md | 4 +- reference/filesystem/is_symlink.md | 4 +- reference/filesystem/last_write_time.md | 4 +- reference/filesystem/path.md | 6 +- reference/filesystem/path/append.md | 4 +- reference/filesystem/path/assign.md | 4 +- reference/filesystem/path/begin.md | 4 +- reference/filesystem/path/c_str.md | 4 +- reference/filesystem/path/clear.md | 4 +- reference/filesystem/path/compare.md | 4 +- reference/filesystem/path/concat.md | 4 +- reference/filesystem/path/empty.md | 4 +- reference/filesystem/path/end.md | 4 +- reference/filesystem/path/extension.md | 6 +- reference/filesystem/path/filename.md | 4 +- reference/filesystem/path/format.md | 4 +- reference/filesystem/path/generic_string.md | 4 +- .../filesystem/path/generic_u16string.md | 4 +- .../filesystem/path/generic_u32string.md | 4 +- reference/filesystem/path/generic_u8string.md | 4 +- reference/filesystem/path/generic_wstring.md | 4 +- reference/filesystem/path/has_extension.md | 4 +- reference/filesystem/path/has_filename.md | 4 +- reference/filesystem/path/has_parent_path.md | 4 +- .../filesystem/path/has_relative_path.md | 4 +- .../filesystem/path/has_root_directory.md | 4 +- reference/filesystem/path/has_root_name.md | 4 +- reference/filesystem/path/has_root_path.md | 4 +- reference/filesystem/path/has_stem.md | 4 +- reference/filesystem/path/hash_value.md | 4 +- reference/filesystem/path/is_absolute.md | 4 +- reference/filesystem/path/is_relative.md | 4 +- reference/filesystem/path/iterator.md | 4 +- reference/filesystem/path/lexically_normal.md | 4 +- .../filesystem/path/lexically_proximate.md | 4 +- .../filesystem/path/lexically_relative.md | 4 +- reference/filesystem/path/make_preferred.md | 4 +- reference/filesystem/path/native.md | 4 +- reference/filesystem/path/op_append.md | 4 +- reference/filesystem/path/op_append_assign.md | 4 +- reference/filesystem/path/op_assign.md | 4 +- reference/filesystem/path/op_compare_3way.md | 2 +- reference/filesystem/path/op_constructor.md | 4 +- reference/filesystem/path/op_equal.md | 4 +- reference/filesystem/path/op_greater.md | 4 +- reference/filesystem/path/op_greater_equal.md | 4 +- reference/filesystem/path/op_istream.md | 4 +- reference/filesystem/path/op_less.md | 4 +- reference/filesystem/path/op_less_equal.md | 4 +- reference/filesystem/path/op_not_equal.md | 4 +- reference/filesystem/path/op_ostream.md | 4 +- reference/filesystem/path/op_plus_assign.md | 4 +- reference/filesystem/path/op_string_type.md | 4 +- reference/filesystem/path/parent_path.md | 4 +- reference/filesystem/path/relative_path.md | 4 +- reference/filesystem/path/remove_filename.md | 4 +- .../filesystem/path/replace_extension.md | 4 +- reference/filesystem/path/replace_filename.md | 4 +- reference/filesystem/path/root_directory.md | 4 +- reference/filesystem/path/root_name.md | 4 +- reference/filesystem/path/root_path.md | 4 +- reference/filesystem/path/stem.md | 6 +- reference/filesystem/path/string.md | 4 +- reference/filesystem/path/swap.md | 4 +- reference/filesystem/path/swap_free.md | 4 +- reference/filesystem/path/u16string.md | 4 +- reference/filesystem/path/u32string.md | 4 +- reference/filesystem/path/u8string.md | 4 +- reference/filesystem/path/wstring.md | 4 +- reference/filesystem/perm_options.md | 4 +- reference/filesystem/permissions.md | 4 +- reference/filesystem/perms.md | 4 +- reference/filesystem/proximate.md | 4 +- reference/filesystem/read_symlink.md | 4 +- .../recursive_directory_iterator.md | 4 +- .../begin_free.md | 4 +- .../recursive_directory_iterator/depth.md | 4 +- .../disable_recursion_pending.md | 4 +- .../recursive_directory_iterator/end_free.md | 4 +- .../recursive_directory_iterator/increment.md | 4 +- .../recursive_directory_iterator/op_arrow.md | 4 +- .../recursive_directory_iterator/op_assign.md | 4 +- .../op_constructor.md | 4 +- .../recursive_directory_iterator/op_deref.md | 4 +- .../recursive_directory_iterator/op_equal.md | 4 +- .../op_increment.md | 4 +- .../op_not_equal.md | 4 +- .../recursive_directory_iterator/options.md | 4 +- .../recursive_directory_iterator/pop.md | 4 +- .../recursion_pending.md | 4 +- reference/filesystem/relative.md | 4 +- reference/filesystem/remove.md | 4 +- reference/filesystem/remove_all.md | 4 +- reference/filesystem/rename.md | 4 +- reference/filesystem/resize_file.md | 4 +- reference/filesystem/space.md | 4 +- reference/filesystem/space_info.md | 4 +- reference/filesystem/status.md | 4 +- reference/filesystem/status_known.md | 4 +- reference/filesystem/symlink_status.md | 4 +- reference/filesystem/temp_directory_path.md | 4 +- reference/filesystem/u8path.md | 6 +- reference/filesystem/weakly_canonical.md | 4 +- .../format/basic_format_context/advance_to.md | 2 +- reference/format/basic_format_context/arg.md | 2 +- .../format/basic_format_context/locale.md | 2 +- reference/format/basic_format_context/out.md | 2 +- .../basic_format_parse_context/advance_to.md | 2 +- .../basic_format_parse_context/begin.md | 2 +- .../format/basic_format_parse_context/end.md | 2 +- reference/format/basic_format_string.md | 2 +- reference/format/basic_format_string/get.md | 2 +- .../basic_format_string/op_constructor.md | 2 +- reference/format/format.md | 2 +- reference/format/formattable.md | 2 +- reference/format/formatter.md | 2 +- reference/format/formatter/format.md | 2 +- reference/format/formatter/parse.md | 2 +- reference/format/runtime_format.md | 2 +- reference/forward_list/forward_list.md | 2 +- reference/forward_list/forward_list/assign.md | 4 +- .../forward_list/forward_list/before_begin.md | 4 +- reference/forward_list/forward_list/begin.md | 4 +- .../forward_list/cbefore_begin.md | 4 +- reference/forward_list/forward_list/cbegin.md | 4 +- reference/forward_list/forward_list/cend.md | 4 +- reference/forward_list/forward_list/clear.md | 2 +- .../forward_list/emplace_after.md | 4 +- .../forward_list/emplace_front.md | 4 +- reference/forward_list/forward_list/empty.md | 2 +- reference/forward_list/forward_list/end.md | 4 +- .../forward_list/forward_list/erase_after.md | 2 +- .../forward_list/forward_list/erase_free.md | 4 +- .../forward_list/erase_if_free.md | 4 +- reference/forward_list/forward_list/front.md | 2 +- .../forward_list/get_allocator.md | 4 +- .../forward_list/forward_list/insert_after.md | 4 +- .../forward_list/forward_list/max_size.md | 2 +- reference/forward_list/forward_list/merge.md | 4 +- .../forward_list/forward_list/op_assign.md | 4 +- .../forward_list/op_compare_3way.md | 2 +- .../forward_list/op_constructor.md | 4 +- .../forward_list/op_deduction_guide.md | 2 +- .../forward_list/op_destructor.md | 4 +- .../forward_list/forward_list/op_equal.md | 4 +- .../forward_list/forward_list/op_greater.md | 4 +- .../forward_list/op_greater_equal.md | 4 +- .../forward_list/forward_list/op_less.md | 4 +- .../forward_list/op_less_equal.md | 4 +- .../forward_list/forward_list/op_not_equal.md | 4 +- .../forward_list/forward_list/pop_front.md | 2 +- .../forward_list/forward_list/push_front.md | 2 +- reference/forward_list/forward_list/remove.md | 4 +- .../forward_list/forward_list/remove_if.md | 4 +- reference/forward_list/forward_list/resize.md | 2 +- .../forward_list/forward_list/reverse.md | 4 +- reference/forward_list/forward_list/sort.md | 4 +- .../forward_list/forward_list/splice_after.md | 2 +- reference/forward_list/forward_list/swap.md | 4 +- .../forward_list/forward_list/swap_free.md | 4 +- reference/forward_list/forward_list/unique.md | 4 +- reference/functional/bad_function_call.md | 4 +- reference/functional/bind.md | 2 +- reference/functional/bind_front.md | 2 +- reference/functional/bit_and.md | 8 +- reference/functional/bit_not.md | 4 +- reference/functional/bit_or.md | 8 +- reference/functional/bit_xor.md | 8 +- .../boyer_moore_horspool_searcher.md | 2 +- .../boyer_moore_horspool_searcher/op_call.md | 2 +- .../op_constructor.md | 2 +- reference/functional/boyer_moore_searcher.md | 2 +- .../boyer_moore_searcher/op_call.md | 2 +- .../boyer_moore_searcher/op_constructor.md | 2 +- reference/functional/cref.md | 2 +- reference/functional/default_searcher.md | 2 +- .../functional/default_searcher/op_call.md | 2 +- .../default_searcher/op_constructor.md | 2 +- reference/functional/function/assign.md | 4 +- reference/functional/function/op_assign.md | 4 +- reference/functional/function/op_bool.md | 4 +- reference/functional/function/op_call.md | 4 +- .../functional/function/op_constructor.md | 4 +- .../functional/function/op_deduction_guide.md | 2 +- .../functional/function/op_destructor.md | 4 +- reference/functional/function/op_equal.md | 4 +- reference/functional/function/op_not_equal.md | 4 +- reference/functional/function/swap.md | 4 +- reference/functional/function/swap_free.md | 4 +- reference/functional/function/target.md | 4 +- reference/functional/function/target_type.md | 4 +- reference/functional/hash.md | 2 +- reference/functional/identity.md | 4 +- reference/functional/invoke.md | 2 +- reference/functional/is_bind_expression.md | 2 +- reference/functional/is_placeholder.md | 2 +- reference/functional/mem_fn.md | 2 +- reference/functional/move_only_function.md | 2 +- .../functional/move_only_function/op_call.md | 2 +- .../move_only_function/op_constructor.md | 2 +- reference/functional/not_fn.md | 4 +- reference/functional/ref.md | 2 +- reference/functional/reference_wrapper.md | 2 +- reference/functional/reference_wrapper/get.md | 2 +- .../functional/reference_wrapper/op_assign.md | 2 +- .../functional/reference_wrapper/op_call.md | 2 +- .../reference_wrapper/op_cast_ref_t.md | 2 +- .../reference_wrapper/op_constructor.md | 2 +- .../reference_wrapper/op_deduction_guide.md | 2 +- reference/future/async.md | 4 +- reference/future/future.md | 4 +- reference/future/future/get.md | 4 +- reference/future/future/op_assign.md | 4 +- reference/future/future/op_constructor.md | 4 +- reference/future/future/op_destructor.md | 4 +- reference/future/future/share.md | 4 +- reference/future/future/valid.md | 4 +- reference/future/future/wait.md | 4 +- reference/future/future/wait_for.md | 4 +- reference/future/future/wait_until.md | 4 +- reference/future/future_category.md | 4 +- reference/future/future_errc.md | 4 +- reference/future/future_error.md | 4 +- reference/future/future_status.md | 4 +- reference/future/is_error_code_enum.md | 4 +- reference/future/launch.md | 4 +- reference/future/make_error_code.md | 4 +- reference/future/make_error_condition.md | 2 +- reference/future/packaged_task.md | 4 +- reference/future/packaged_task/get_future.md | 4 +- .../make_ready_at_thread_exit.md | 6 +- reference/future/packaged_task/op_assign.md | 4 +- reference/future/packaged_task/op_call.md | 4 +- .../future/packaged_task/op_constructor.md | 4 +- .../packaged_task/op_deduction_guide.md | 4 +- .../future/packaged_task/op_destructor.md | 4 +- reference/future/packaged_task/reset.md | 4 +- reference/future/packaged_task/swap.md | 4 +- reference/future/packaged_task/swap_free.md | 4 +- .../future/packaged_task/uses_allocator.md | 4 +- reference/future/packaged_task/valid.md | 4 +- reference/future/promise.md | 4 +- reference/future/promise/get_future.md | 4 +- reference/future/promise/op_assign.md | 4 +- reference/future/promise/op_constructor.md | 4 +- reference/future/promise/op_destructor.md | 4 +- reference/future/promise/set_exception.md | 4 +- .../promise/set_exception_at_thread_exit.md | 6 +- reference/future/promise/set_value.md | 4 +- .../promise/set_value_at_thread_exit.md | 6 +- reference/future/promise/swap.md | 4 +- reference/future/promise/swap_free.md | 4 +- reference/future/promise/uses_allocator.md | 4 +- reference/future/shared_future.md | 4 +- reference/future/shared_future/get.md | 4 +- reference/future/shared_future/op_assign.md | 4 +- .../future/shared_future/op_constructor.md | 4 +- .../future/shared_future/op_destructor.md | 4 +- reference/future/shared_future/valid.md | 4 +- reference/future/shared_future/wait.md | 4 +- reference/future/shared_future/wait_for.md | 4 +- reference/future/shared_future/wait_until.md | 4 +- .../initializer_list/initializer_list.md | 2 +- .../initializer_list/begin.md | 4 +- .../initializer_list/begin_free.md | 4 +- .../initializer_list/initializer_list/end.md | 4 +- .../initializer_list/end_free.md | 4 +- .../initializer_list/op_constructor.md | 4 +- .../initializer_list/initializer_list/size.md | 4 +- reference/iomanip/put_time.md | 4 +- reference/iomanip/quoted.md | 4 +- reference/ios/basic_ios/op_assign.md | 4 +- reference/ios/basic_ios/op_constructor.md | 4 +- reference/ios/defaultfloat.md | 6 +- reference/ios/hexfloat.md | 6 +- reference/ios/io_errc.md | 6 +- reference/ios/ios_base/Init.md | 4 +- reference/ios/ios_base/Init/op_constructor.md | 4 +- reference/ios/ios_base/Init/op_destructor.md | 4 +- reference/ios/ios_base/failure.md | 4 +- .../ios/ios_base/failure/op_constructor.md | 4 +- reference/ios/ios_base/failure/what.md | 4 +- reference/ios/ios_base/flags.md | 4 +- reference/ios/ios_base/getloc.md | 4 +- reference/ios/ios_base/imbue.md | 4 +- reference/ios/ios_base/op_assign.md | 4 +- reference/ios/ios_base/op_constructor.md | 4 +- reference/ios/ios_base/op_destructor.md | 4 +- reference/ios/ios_base/precision.md | 4 +- reference/ios/ios_base/register_callback.md | 4 +- reference/ios/ios_base/setf.md | 4 +- reference/ios/ios_base/type-event.md | 4 +- reference/ios/ios_base/type-event_callback.md | 4 +- reference/ios/ios_base/type-fmtflags.md | 4 +- reference/ios/ios_base/type-iostate.md | 4 +- reference/ios/ios_base/type-openmode.md | 4 +- reference/ios/ios_base/type-seekdir.md | 4 +- reference/ios/ios_base/unsetf.md | 4 +- reference/ios/ios_base/width.md | 4 +- reference/ios/iostream_category.md | 2 +- reference/ios/is_error_code_enum.md | 2 +- reference/ios/make_error_code.md | 2 +- reference/ios/make_error_condition.md | 2 +- reference/iterator/basic_const_iterator.md | 4 +- .../iterator/basic_const_iterator/base.md | 4 +- .../basic_const_iterator/common_type.md | 4 +- .../basic_const_iterator/iter_move.md | 4 +- .../iterator/basic_const_iterator/op_arrow.md | 4 +- .../iterator/basic_const_iterator/op_at.md | 4 +- .../basic_const_iterator/op_compare_3way.md | 4 +- .../basic_const_iterator/op_constructor.md | 4 +- .../basic_const_iterator/op_decrement.md | 4 +- .../iterator/basic_const_iterator/op_deref.md | 4 +- .../iterator/basic_const_iterator/op_equal.md | 4 +- .../basic_const_iterator/op_greater.md | 4 +- .../basic_const_iterator/op_greater_equal.md | 4 +- .../basic_const_iterator/op_increment.md | 4 +- .../iterator/basic_const_iterator/op_less.md | 4 +- .../basic_const_iterator/op_less_equal.md | 4 +- .../iterator/basic_const_iterator/op_minus.md | 4 +- .../basic_const_iterator/op_minus_assign.md | 4 +- .../iterator/basic_const_iterator/op_plus.md | 4 +- .../basic_const_iterator/op_plus_assign.md | 4 +- .../basic_const_iterator/op_unary_minus.md | 4 +- reference/iterator/begin.md | 2 +- reference/iterator/bidirectional_iterator.md | 4 +- reference/iterator/cbegin.md | 4 +- reference/iterator/cend.md | 4 +- reference/iterator/common_iterator.md | 4 +- .../iterator/common_iterator/iter_move.md | 4 +- .../iterator/common_iterator/iter_swap.md | 4 +- .../iterator/common_iterator/op_arrow.md | 4 +- .../iterator/common_iterator/op_assign.md | 4 +- .../common_iterator/op_constructor.md | 4 +- .../iterator/common_iterator/op_deref.md | 4 +- .../iterator/common_iterator/op_equal.md | 4 +- .../iterator/common_iterator/op_increment.md | 4 +- .../iterator/common_iterator/op_minus.md | 4 +- reference/iterator/const_iterator.md | 110 +++++++-------- reference/iterator/const_sentinel.md | 4 +- reference/iterator/contiguous_iterator.md | 4 +- reference/iterator/counted_iterator.md | 4 +- reference/iterator/counted_iterator/base.md | 4 +- reference/iterator/counted_iterator/count.md | 4 +- .../iterator/counted_iterator/iter_move.md | 4 +- .../iterator/counted_iterator/iter_swap.md | 4 +- .../iterator/counted_iterator/op_arrow.md | 4 +- .../iterator/counted_iterator/op_assign.md | 4 +- reference/iterator/counted_iterator/op_at.md | 4 +- .../counted_iterator/op_compare_3way.md | 4 +- .../counted_iterator/op_constructor.md | 4 +- .../iterator/counted_iterator/op_decrement.md | 4 +- .../iterator/counted_iterator/op_deref.md | 4 +- .../iterator/counted_iterator/op_equal.md | 4 +- .../iterator/counted_iterator/op_increment.md | 4 +- .../iterator/counted_iterator/op_minus.md | 4 +- .../counted_iterator/op_minus_assign.md | 4 +- .../iterator/counted_iterator/op_plus.md | 4 +- .../counted_iterator/op_plus_assign.md | 4 +- .../counted_iterator/op_unary_minus.md | 4 +- reference/iterator/crbegin.md | 4 +- reference/iterator/crend.md | 4 +- reference/iterator/data.md | 6 +- reference/iterator/default_sentinel_t.md | 4 +- .../iterator/disable_sized_sentinel_for.md | 4 +- reference/iterator/empty.md | 6 +- reference/iterator/end.md | 2 +- reference/iterator/forward_iterator.md | 4 +- reference/iterator/incrementable.md | 4 +- reference/iterator/incrementable_traits.md | 4 +- .../iterator/indirect_binary_predicate.md | 4 +- .../iterator/indirect_equivalence_relation.md | 4 +- reference/iterator/indirect_result_t.md | 4 +- .../iterator/indirect_strict_weak_order.md | 4 +- .../iterator/indirect_unary_predicate.md | 4 +- reference/iterator/indirectly_comparable.md | 4 +- reference/iterator/indirectly_copyable.md | 4 +- .../iterator/indirectly_copyable_storable.md | 4 +- reference/iterator/indirectly_movable.md | 4 +- .../iterator/indirectly_movable_storable.md | 4 +- reference/iterator/indirectly_readable.md | 4 +- .../iterator/indirectly_readable_traits.md | 4 +- reference/iterator/indirectly_swappable.md | 4 +- .../iterator/indirectly_unary_invocable.md | 4 +- reference/iterator/indirectly_writable.md | 4 +- reference/iterator/input_iterator.md | 4 +- .../iterator/input_or_output_iterator.md | 4 +- reference/iterator/iter_common_reference_t.md | 4 +- reference/iterator/iter_const_reference_t.md | 4 +- reference/iterator/iter_difference_t.md | 4 +- reference/iterator/iter_move.md | 4 +- reference/iterator/iter_reference_t.md | 4 +- reference/iterator/iter_rvalue_reference_t.md | 4 +- reference/iterator/iter_swap.md | 4 +- reference/iterator/iter_value_t.md | 4 +- reference/iterator/make_const_iterator.md | 4 +- reference/iterator/make_const_sentinel.md | 4 +- reference/iterator/make_move_iterator.md | 2 +- reference/iterator/make_reverse_iterator.md | 4 +- reference/iterator/mergeable.md | 4 +- reference/iterator/move_iterator.md | 2 +- reference/iterator/move_iterator/base.md | 2 +- reference/iterator/move_iterator/iter_move.md | 4 +- reference/iterator/move_iterator/iter_swap.md | 4 +- reference/iterator/move_iterator/op_arrow.md | 2 +- reference/iterator/move_iterator/op_assign.md | 4 +- reference/iterator/move_iterator/op_at.md | 2 +- .../iterator/move_iterator/op_compare_3way.md | 2 +- .../iterator/move_iterator/op_constructor.md | 2 +- .../iterator/move_iterator/op_decrement.md | 2 +- reference/iterator/move_iterator/op_deref.md | 2 +- reference/iterator/move_iterator/op_equal.md | 2 +- .../iterator/move_iterator/op_greater.md | 2 +- .../move_iterator/op_greater_equal.md | 2 +- .../iterator/move_iterator/op_increment.md | 2 +- reference/iterator/move_iterator/op_less.md | 2 +- .../iterator/move_iterator/op_less_equal.md | 2 +- reference/iterator/move_iterator/op_minus.md | 2 +- .../iterator/move_iterator/op_minus_assign.md | 2 +- .../iterator/move_iterator/op_not_equal.md | 2 +- reference/iterator/move_iterator/op_plus.md | 2 +- .../iterator/move_iterator/op_plus_assign.md | 2 +- .../iterator/move_iterator/op_unary_minus.md | 2 +- .../iterator/move_iterator/op_unary_plus.md | 2 +- reference/iterator/move_sentinel.md | 4 +- reference/iterator/move_sentinel/base.md | 4 +- reference/iterator/move_sentinel/op_assign.md | 4 +- .../iterator/move_sentinel/op_constructor.md | 4 +- reference/iterator/next.md | 4 +- reference/iterator/output_iterator.md | 4 +- reference/iterator/permutable.md | 4 +- reference/iterator/prev.md | 4 +- reference/iterator/projected.md | 4 +- reference/iterator/random_access_iterator.md | 4 +- reference/iterator/ranges_advance.md | 4 +- reference/iterator/ranges_distance.md | 4 +- reference/iterator/ranges_next.md | 4 +- reference/iterator/ranges_prev.md | 4 +- reference/iterator/rbegin.md | 4 +- reference/iterator/rend.md | 4 +- .../iterator/reverse_iterator/iter_move.md | 4 +- .../iterator/reverse_iterator/iter_swap.md | 4 +- .../reverse_iterator/op_compare_3way.md | 2 +- reference/iterator/sentinel_for.md | 4 +- reference/iterator/size.md | 6 +- reference/iterator/sized_sentinel_for.md | 4 +- reference/iterator/sortable.md | 4 +- reference/iterator/ssize.md | 2 +- reference/iterator/unreachable_sentinel_t.md | 4 +- reference/iterator/weakly_incrementable.md | 4 +- reference/latch.md | 2 +- reference/latch/latch.md | 2 +- reference/latch/latch/arrive_and_wait.md | 2 +- reference/latch/latch/count_down.md | 2 +- reference/latch/latch/max.md | 2 +- reference/latch/latch/op_constructor.md | 2 +- reference/latch/latch/try_wait.md | 2 +- reference/latch/latch/wait.md | 2 +- reference/limits/numeric_limits/lowest.md | 6 +- .../limits/numeric_limits/max_digits10.md | 6 +- reference/list/list/cbegin.md | 4 +- reference/list/list/cend.md | 4 +- reference/list/list/clear.md | 2 +- reference/list/list/crbegin.md | 4 +- reference/list/list/crend.md | 4 +- reference/list/list/emplace.md | 4 +- reference/list/list/emplace_back.md | 4 +- reference/list/list/emplace_front.md | 4 +- reference/list/list/erase_free.md | 4 +- reference/list/list/erase_if_free.md | 4 +- reference/list/list/get_allocator.md | 2 +- reference/list/list/op_deduction_guide.md | 2 +- reference/locale/tolower.md | 8 +- reference/locale/toupper.md | 8 +- reference/locale/wbuffer_convert.md | 4 +- reference/locale/wstring_convert.md | 6 +- reference/locale/wstring_convert/converted.md | 6 +- .../locale/wstring_convert/from_bytes.md | 6 +- .../locale/wstring_convert/op_constructor.md | 6 +- .../locale/wstring_convert/op_destructor.md | 6 +- reference/locale/wstring_convert/state.md | 6 +- reference/locale/wstring_convert/to_bytes.md | 6 +- reference/map/map/at.md | 6 +- reference/map/map/begin.md | 2 +- reference/map/map/cbegin.md | 2 +- reference/map/map/cend.md | 2 +- reference/map/map/clear.md | 2 +- reference/map/map/contains.md | 4 +- reference/map/map/crbegin.md | 2 +- reference/map/map/crend.md | 2 +- reference/map/map/emplace.md | 6 +- reference/map/map/emplace_hint.md | 6 +- reference/map/map/end.md | 2 +- reference/map/map/erase.md | 2 +- reference/map/map/erase_if_free.md | 4 +- reference/map/map/extract.md | 6 +- reference/map/map/get_allocator.md | 2 +- reference/map/map/insert.md | 2 +- reference/map/map/insert_or_assign.md | 4 +- reference/map/map/key_comp.md | 2 +- reference/map/map/max_size.md | 2 +- reference/map/map/merge.md | 6 +- reference/map/map/op_assign.md | 2 +- reference/map/map/op_compare_3way.md | 2 +- reference/map/map/op_constructor.md | 2 +- reference/map/map/op_equal.md | 2 +- reference/map/map/op_greater.md | 2 +- reference/map/map/op_less.md | 2 +- reference/map/map/op_not_equal.md | 2 +- reference/map/map/rbegin.md | 2 +- reference/map/map/rend.md | 2 +- reference/map/map/size.md | 4 +- reference/map/map/swap.md | 4 +- reference/map/map/swap_free.md | 4 +- reference/map/map/try_emplace.md | 4 +- reference/map/map/value_comp.md | 2 +- reference/map/multimap/begin.md | 2 +- reference/map/multimap/cbegin.md | 2 +- reference/map/multimap/cend.md | 2 +- reference/map/multimap/clear.md | 2 +- reference/map/multimap/contains.md | 4 +- reference/map/multimap/crbegin.md | 2 +- reference/map/multimap/crend.md | 2 +- reference/map/multimap/emplace.md | 6 +- reference/map/multimap/emplace_hint.md | 6 +- reference/map/multimap/end.md | 2 +- reference/map/multimap/erase_if_free.md | 4 +- reference/map/multimap/extract.md | 6 +- reference/map/multimap/get_allocator.md | 2 +- reference/map/multimap/insert.md | 2 +- reference/map/multimap/key_comp.md | 2 +- reference/map/multimap/max_size.md | 2 +- reference/map/multimap/merge.md | 6 +- reference/map/multimap/op_assign.md | 2 +- reference/map/multimap/op_compare_3way.md | 2 +- reference/map/multimap/op_constructor.md | 2 +- reference/map/multimap/op_equal.md | 2 +- reference/map/multimap/op_greater.md | 2 +- reference/map/multimap/op_less.md | 2 +- reference/map/multimap/op_not_equal.md | 2 +- reference/map/multimap/rbegin.md | 2 +- reference/map/multimap/rend.md | 2 +- reference/map/multimap/size.md | 4 +- reference/map/multimap/swap.md | 4 +- reference/map/multimap/swap_free.md | 4 +- reference/map/multimap/value_comp.md | 2 +- reference/memory/addressof.md | 4 +- reference/memory/align.md | 6 +- reference/memory/allocate_shared.md | 6 +- .../memory/allocate_shared_for_overwrite.md | 4 +- reference/memory/allocator/construct.md | 4 +- reference/memory/allocator_arg_t.md | 4 +- reference/memory/allocator_traits.md | 6 +- reference/memory/allocator_traits/allocate.md | 6 +- .../memory/allocator_traits/construct.md | 6 +- .../memory/allocator_traits/deallocate.md | 6 +- reference/memory/allocator_traits/destroy.md | 6 +- reference/memory/allocator_traits/max_size.md | 6 +- .../select_on_container_copy_construction.md | 4 +- reference/memory/assume_aligned.md | 8 +- reference/memory/bad_weak_ptr.md | 4 +- reference/memory/construct_at.md | 4 +- reference/memory/declare_no_pointers.md | 4 +- reference/memory/declare_reachable.md | 4 +- reference/memory/default_delete.md | 4 +- reference/memory/destroy.md | 4 +- reference/memory/destroy_at.md | 4 +- reference/memory/destroy_n.md | 4 +- reference/memory/enable_shared_from_this.md | 6 +- .../enable_shared_from_this/op_assign.md | 6 +- .../enable_shared_from_this/op_constructor.md | 6 +- .../enable_shared_from_this/op_destructor.md | 6 +- .../shared_from_this.md | 6 +- .../enable_shared_from_this/weak_from_this.md | 4 +- reference/memory/get_pointer_safety.md | 2 +- reference/memory/make_obj_using_allocator.md | 4 +- reference/memory/make_shared.md | 6 +- reference/memory/make_shared_for_overwrite.md | 4 +- reference/memory/make_unique.md | 6 +- reference/memory/make_unique_for_overwrite.md | 4 +- reference/memory/owner_less.md | 6 +- reference/memory/pointer_safety.md | 2 +- reference/memory/pointer_traits.md | 6 +- reference/memory/pointer_traits/pointer_to.md | 6 +- reference/memory/ranges_construct_at.md | 6 +- reference/memory/ranges_destroy.md | 6 +- reference/memory/ranges_destroy_at.md | 6 +- reference/memory/ranges_destroy_n.md | 6 +- reference/memory/ranges_uninitialized_copy.md | 6 +- .../memory/ranges_uninitialized_copy_n.md | 6 +- .../ranges_uninitialized_default_construct.md | 6 +- ...anges_uninitialized_default_construct_n.md | 6 +- reference/memory/ranges_uninitialized_fill.md | 6 +- .../memory/ranges_uninitialized_fill_n.md | 6 +- reference/memory/ranges_uninitialized_move.md | 6 +- .../memory/ranges_uninitialized_move_n.md | 6 +- .../ranges_uninitialized_value_construct.md | 6 +- .../ranges_uninitialized_value_construct_n.md | 6 +- reference/memory/shared_ptr.md | 6 +- .../atomic_compare_exchange_strong.md | 6 +- ...atomic_compare_exchange_strong_explicit.md | 6 +- .../atomic_compare_exchange_weak.md | 6 +- .../atomic_compare_exchange_weak_explicit.md | 6 +- .../memory/shared_ptr/atomic_exchange.md | 6 +- .../shared_ptr/atomic_exchange_explicit.md | 6 +- .../memory/shared_ptr/atomic_is_lock_free.md | 6 +- reference/memory/shared_ptr/atomic_load.md | 6 +- .../memory/shared_ptr/atomic_load_explicit.md | 6 +- reference/memory/shared_ptr/atomic_store.md | 6 +- .../shared_ptr/atomic_store_explicit.md | 6 +- .../memory/shared_ptr/const_pointer_cast.md | 6 +- .../memory/shared_ptr/dynamic_pointer_cast.md | 6 +- reference/memory/shared_ptr/get.md | 6 +- reference/memory/shared_ptr/get_deleter.md | 6 +- reference/memory/shared_ptr/op_arrow.md | 6 +- reference/memory/shared_ptr/op_assign.md | 6 +- reference/memory/shared_ptr/op_at.md | 2 +- reference/memory/shared_ptr/op_bool.md | 6 +- .../memory/shared_ptr/op_compare_3way.md | 2 +- reference/memory/shared_ptr/op_constructor.md | 6 +- .../memory/shared_ptr/op_deduction_guide.md | 2 +- reference/memory/shared_ptr/op_deref.md | 6 +- reference/memory/shared_ptr/op_equal.md | 6 +- reference/memory/shared_ptr/op_greater.md | 6 +- .../memory/shared_ptr/op_greater_equal.md | 6 +- reference/memory/shared_ptr/op_less.md | 6 +- reference/memory/shared_ptr/op_less_equal.md | 6 +- reference/memory/shared_ptr/op_not_equal.md | 6 +- reference/memory/shared_ptr/op_ostream.md | 6 +- reference/memory/shared_ptr/owner_before.md | 6 +- .../shared_ptr/reinterpret_pointer_cast.md | 2 +- reference/memory/shared_ptr/reset.md | 6 +- .../memory/shared_ptr/static_pointer_cast.md | 4 +- reference/memory/shared_ptr/swap.md | 6 +- reference/memory/shared_ptr/swap_free.md | 6 +- reference/memory/shared_ptr/unique.md | 6 +- reference/memory/shared_ptr/use_count.md | 6 +- reference/memory/to_address.md | 4 +- reference/memory/undeclare_no_pointers.md | 4 +- reference/memory/undeclare_reachable.md | 4 +- ...uninitialized_construct_using_allocator.md | 4 +- reference/memory/uninitialized_copy_n.md | 4 +- .../memory/uninitialized_default_construct.md | 4 +- .../uninitialized_default_construct_n.md | 4 +- reference/memory/uninitialized_move.md | 4 +- reference/memory/uninitialized_move_n.md | 4 +- .../memory/uninitialized_value_construct.md | 4 +- .../memory/uninitialized_value_construct_n.md | 4 +- reference/memory/unique_ptr.md | 4 +- reference/memory/unique_ptr/get.md | 6 +- reference/memory/unique_ptr/get_deleter.md | 6 +- reference/memory/unique_ptr/op_arrow.md | 6 +- reference/memory/unique_ptr/op_assign.md | 6 +- reference/memory/unique_ptr/op_at.md | 6 +- reference/memory/unique_ptr/op_bool.md | 6 +- .../memory/unique_ptr/op_compare_3way.md | 2 +- reference/memory/unique_ptr/op_constructor.md | 6 +- reference/memory/unique_ptr/op_deref.md | 6 +- reference/memory/unique_ptr/op_destructor.md | 6 +- reference/memory/unique_ptr/op_equal.md | 6 +- reference/memory/unique_ptr/op_greater.md | 6 +- .../memory/unique_ptr/op_greater_equal.md | 6 +- reference/memory/unique_ptr/op_less.md | 6 +- reference/memory/unique_ptr/op_less_equal.md | 6 +- reference/memory/unique_ptr/op_not_equal.md | 6 +- reference/memory/unique_ptr/op_ostream.md | 4 +- reference/memory/unique_ptr/release.md | 6 +- reference/memory/unique_ptr/reset.md | 6 +- reference/memory/unique_ptr/swap.md | 6 +- reference/memory/unique_ptr/swap_free.md | 6 +- reference/memory/uses_allocator.md | 6 +- .../uses_allocator_construction_args.md | 4 +- reference/memory/weak_ptr.md | 6 +- reference/memory/weak_ptr/expired.md | 4 +- reference/memory/weak_ptr/lock.md | 4 +- reference/memory/weak_ptr/op_assign.md | 4 +- reference/memory/weak_ptr/op_constructor.md | 4 +- .../memory/weak_ptr/op_deduction_guide.md | 2 +- reference/memory/weak_ptr/op_destructor.md | 4 +- reference/memory/weak_ptr/owner_before.md | 4 +- reference/memory/weak_ptr/reset.md | 4 +- reference/memory/weak_ptr/swap.md | 4 +- reference/memory/weak_ptr/swap_free.md | 4 +- reference/memory/weak_ptr/use_count.md | 4 +- reference/memory_resource.md | 4 +- .../memory_resource/get_default_resource.md | 4 +- reference/memory_resource/memory_resource.md | 4 +- .../memory_resource/allocate.md | 4 +- .../memory_resource/deallocate.md | 4 +- .../memory_resource/do_allocate.md | 4 +- .../memory_resource/do_deallocate.md | 4 +- .../memory_resource/do_is_equal.md | 4 +- .../memory_resource/is_equal.md | 4 +- .../memory_resource/op_equal.md | 4 +- .../memory_resource/op_not_equal.md | 4 +- .../monotonic_buffer_resource.md | 4 +- .../monotonic_buffer_resource/do_allocate.md | 4 +- .../do_deallocate.md | 4 +- .../monotonic_buffer_resource/do_is_equal.md | 4 +- .../op_constructor.md | 4 +- .../op_destructor.md | 4 +- .../monotonic_buffer_resource/release.md | 4 +- .../upstream_resource.md | 4 +- .../memory_resource/new_delete_resource.md | 4 +- .../memory_resource/null_memory_resource.md | 4 +- .../memory_resource/polymorphic_allocator.md | 4 +- .../polymorphic_allocator/allocate.md | 4 +- .../polymorphic_allocator/allocate_bytes.md | 4 +- .../polymorphic_allocator/allocate_object.md | 4 +- .../polymorphic_allocator/construct.md | 4 +- .../polymorphic_allocator/deallocate.md | 4 +- .../polymorphic_allocator/deallocate_bytes.md | 4 +- .../deallocate_object.md | 4 +- .../polymorphic_allocator/delete_object.md | 4 +- .../polymorphic_allocator/destroy.md | 2 +- .../polymorphic_allocator/new_object.md | 4 +- .../polymorphic_allocator/op_constructor.md | 4 +- .../polymorphic_allocator/op_equal.md | 4 +- .../polymorphic_allocator/op_not_equal.md | 4 +- .../polymorphic_allocator/resource.md | 4 +- .../select_on_container_copy_construction.md | 4 +- reference/memory_resource/pool_options.md | 4 +- reference/memory_resource/pool_resource.md | 4 +- .../pool_resource/do_allocate.md | 4 +- .../pool_resource/do_deallocate.md | 4 +- .../pool_resource/do_is_equal.md | 4 +- .../pool_resource/op_constructor.md | 4 +- .../pool_resource/op_destructor.md | 4 +- .../memory_resource/pool_resource/options.md | 4 +- .../memory_resource/pool_resource/release.md | 4 +- .../pool_resource/upstream_resource.md | 4 +- .../memory_resource/set_default_resource.md | 4 +- reference/mutex.md | 2 +- reference/mutex/adopt_lock.md | 4 +- reference/mutex/call_once.md | 4 +- reference/mutex/defer_lock.md | 4 +- reference/mutex/lock.md | 4 +- reference/mutex/lock_guard.md | 4 +- reference/mutex/lock_guard/op_constructor.md | 4 +- reference/mutex/lock_guard/op_destructor.md | 4 +- reference/mutex/mutex.md | 4 +- reference/mutex/mutex/lock.md | 4 +- reference/mutex/mutex/native_handle.md | 4 +- reference/mutex/mutex/op_constructor.md | 4 +- reference/mutex/mutex/op_destructor.md | 4 +- reference/mutex/mutex/try_lock.md | 4 +- reference/mutex/mutex/unlock.md | 4 +- reference/mutex/once_flag.md | 4 +- reference/mutex/once_flag/op_constructor.md | 4 +- reference/mutex/recursive_mutex.md | 4 +- reference/mutex/recursive_mutex/lock.md | 4 +- .../mutex/recursive_mutex/native_handle.md | 4 +- .../mutex/recursive_mutex/op_constructor.md | 4 +- .../mutex/recursive_mutex/op_destructor.md | 4 +- reference/mutex/recursive_mutex/try_lock.md | 4 +- reference/mutex/recursive_mutex/unlock.md | 4 +- reference/mutex/recursive_timed_mutex.md | 4 +- reference/mutex/recursive_timed_mutex/lock.md | 4 +- .../recursive_timed_mutex/native_handle.md | 4 +- .../recursive_timed_mutex/op_constructor.md | 4 +- .../recursive_timed_mutex/op_destructor.md | 4 +- .../mutex/recursive_timed_mutex/try_lock.md | 4 +- .../recursive_timed_mutex/try_lock_for.md | 4 +- .../recursive_timed_mutex/try_lock_until.md | 4 +- .../mutex/recursive_timed_mutex/unlock.md | 4 +- reference/mutex/scoped_lock.md | 4 +- reference/mutex/scoped_lock/op_constructor.md | 4 +- reference/mutex/scoped_lock/op_destructor.md | 4 +- reference/mutex/timed_mutex.md | 4 +- reference/mutex/timed_mutex/lock.md | 4 +- reference/mutex/timed_mutex/native_handle.md | 4 +- reference/mutex/timed_mutex/op_constructor.md | 4 +- reference/mutex/timed_mutex/op_destructor.md | 4 +- reference/mutex/timed_mutex/try_lock.md | 4 +- reference/mutex/timed_mutex/try_lock_for.md | 4 +- reference/mutex/timed_mutex/try_lock_until.md | 4 +- reference/mutex/timed_mutex/unlock.md | 4 +- reference/mutex/try_lock.md | 4 +- reference/mutex/try_to_lock.md | 4 +- reference/mutex/unique_lock.md | 4 +- reference/mutex/unique_lock/lock.md | 4 +- reference/mutex/unique_lock/mutex.md | 4 +- reference/mutex/unique_lock/op_assign.md | 4 +- reference/mutex/unique_lock/op_bool.md | 4 +- reference/mutex/unique_lock/op_constructor.md | 4 +- reference/mutex/unique_lock/op_destructor.md | 4 +- reference/mutex/unique_lock/owns_lock.md | 4 +- reference/mutex/unique_lock/release.md | 4 +- reference/mutex/unique_lock/swap.md | 4 +- reference/mutex/unique_lock/swap_free.md | 4 +- reference/mutex/unique_lock/try_lock.md | 4 +- reference/mutex/unique_lock/try_lock_for.md | 4 +- reference/mutex/unique_lock/try_lock_until.md | 4 +- reference/mutex/unique_lock/unlock.md | 4 +- reference/new/align_val_t.md | 4 +- reference/new/destroying_delete_t.md | 6 +- reference/new/get_new_handler.md | 2 +- ...hardware_constructive_interference_size.md | 2 +- .../hardware_destructive_interference_size.md | 2 +- reference/new/launder.md | 6 +- reference/node_handle/node_handle.md | 6 +- reference/node_handle/node_handle/empty.md | 6 +- .../node_handle/node_handle/get_allocator.md | 6 +- reference/node_handle/node_handle/key.md | 6 +- reference/node_handle/node_handle/mapped.md | 6 +- .../node_handle/node_handle/op_assign.md | 6 +- reference/node_handle/node_handle/op_bool.md | 6 +- .../node_handle/node_handle/op_constructor.md | 6 +- .../node_handle/node_handle/op_destructor.md | 6 +- reference/node_handle/node_handle/swap.md | 6 +- .../node_handle/node_handle/swap_free.md | 6 +- reference/node_handle/node_handle/value.md | 6 +- reference/numbers/e.md | 2 +- reference/numbers/egamma.md | 2 +- reference/numbers/inv_pi.md | 2 +- reference/numbers/inv_sqrt3.md | 2 +- reference/numbers/inv_sqrtpi.md | 2 +- reference/numbers/ln10.md | 2 +- reference/numbers/ln2.md | 2 +- reference/numbers/log10e.md | 2 +- reference/numbers/log2e.md | 2 +- reference/numbers/phi.md | 2 +- reference/numbers/pi.md | 6 +- reference/numbers/sqrt2.md | 2 +- reference/numbers/sqrt3.md | 2 +- reference/numeric/exclusive_scan.md | 2 +- reference/numeric/gcd.md | 4 +- reference/numeric/inclusive_scan.md | 2 +- reference/numeric/iota.md | 6 +- reference/numeric/lcm.md | 4 +- reference/numeric/midpoint.md | 2 +- reference/numeric/reduce.md | 2 +- reference/numeric/transform_exclusive_scan.md | 2 +- reference/numeric/transform_inclusive_scan.md | 2 +- reference/numeric/transform_reduce.md | 2 +- reference/optional/bad_optional_access.md | 4 +- reference/optional/make_optional.md | 4 +- reference/optional/nullopt_t.md | 4 +- reference/optional/optional.md | 4 +- reference/optional/optional/emplace.md | 4 +- reference/optional/optional/has_value.md | 4 +- reference/optional/optional/op_arrow.md | 4 +- reference/optional/optional/op_assign.md | 4 +- reference/optional/optional/op_bool.md | 4 +- .../optional/optional/op_compare_3way.md | 2 +- reference/optional/optional/op_constructor.md | 4 +- .../optional/optional/op_deduction_guide.md | 2 +- reference/optional/optional/op_deref.md | 4 +- reference/optional/optional/op_destructor.md | 4 +- reference/optional/optional/op_equal.md | 4 +- reference/optional/optional/op_greater.md | 4 +- .../optional/optional/op_greater_equal.md | 4 +- reference/optional/optional/op_less.md | 4 +- reference/optional/optional/op_less_equal.md | 4 +- reference/optional/optional/op_not_equal.md | 4 +- reference/optional/optional/reset.md | 4 +- reference/optional/optional/swap.md | 4 +- reference/optional/optional/swap_free.md | 4 +- reference/optional/optional/value.md | 4 +- reference/optional/optional/value_or.md | 4 +- reference/ostream/basic_ostream/op_assign.md | 4 +- .../ostream/basic_ostream/op_constructor.md | 4 +- .../ostream/basic_ostream/op_destructor.md | 4 +- reference/ostream/print.md | 6 +- reference/ostream/println.md | 6 +- reference/ostream/vprint_nonunicode.md | 6 +- reference/ostream/vprint_unicode.md | 6 +- reference/print/print.md | 6 +- reference/print/println.md | 6 +- reference/print/vprint_nonunicode.md | 6 +- reference/print/vprint_unicode.md | 6 +- reference/queue/priority_queue/emplace.md | 2 +- .../queue/priority_queue/op_constructor.md | 2 +- reference/queue/priority_queue/push.md | 2 +- reference/queue/priority_queue/swap.md | 2 +- reference/queue/priority_queue/swap_free.md | 2 +- reference/queue/queue/emplace.md | 2 +- reference/queue/queue/op_compare_3way.md | 2 +- reference/queue/queue/swap.md | 2 +- reference/queue/queue/swap_free.md | 2 +- reference/random/bernoulli_distribution.md | 2 +- .../random/bernoulli_distribution/max.md | 2 +- .../random/bernoulli_distribution/min.md | 2 +- .../random/bernoulli_distribution/op_call.md | 2 +- .../bernoulli_distribution/op_constructor.md | 2 +- .../random/bernoulli_distribution/op_equal.md | 2 +- .../bernoulli_distribution/op_istream.md | 2 +- .../bernoulli_distribution/op_not_equal.md | 2 +- .../bernoulli_distribution/op_ostream.md | 2 +- reference/random/bernoulli_distribution/p.md | 2 +- .../random/bernoulli_distribution/param.md | 2 +- .../random/bernoulli_distribution/reset.md | 2 +- reference/random/binomial_distribution.md | 2 +- reference/random/binomial_distribution/max.md | 2 +- reference/random/binomial_distribution/min.md | 2 +- .../random/binomial_distribution/op_call.md | 2 +- .../binomial_distribution/op_constructor.md | 2 +- .../random/binomial_distribution/op_equal.md | 2 +- .../binomial_distribution/op_istream.md | 2 +- .../binomial_distribution/op_not_equal.md | 2 +- .../binomial_distribution/op_ostream.md | 2 +- reference/random/binomial_distribution/p.md | 2 +- .../random/binomial_distribution/param.md | 2 +- .../random/binomial_distribution/reset.md | 2 +- reference/random/binomial_distribution/t.md | 2 +- reference/random/cauchy_distribution.md | 2 +- reference/random/cauchy_distribution/a.md | 2 +- reference/random/cauchy_distribution/b.md | 2 +- reference/random/cauchy_distribution/max.md | 4 +- reference/random/cauchy_distribution/min.md | 2 +- .../random/cauchy_distribution/op_call.md | 2 +- .../cauchy_distribution/op_constructor.md | 2 +- .../random/cauchy_distribution/op_equal.md | 2 +- .../random/cauchy_distribution/op_istream.md | 2 +- .../cauchy_distribution/op_not_equal.md | 2 +- .../random/cauchy_distribution/op_ostream.md | 2 +- reference/random/cauchy_distribution/param.md | 2 +- reference/random/cauchy_distribution/reset.md | 2 +- reference/random/chi_squared_distribution.md | 2 +- .../random/chi_squared_distribution/max.md | 4 +- .../random/chi_squared_distribution/min.md | 2 +- .../random/chi_squared_distribution/n.md | 2 +- .../chi_squared_distribution/op_call.md | 2 +- .../op_constructor.md | 2 +- .../chi_squared_distribution/op_equal.md | 2 +- .../chi_squared_distribution/op_istream.md | 2 +- .../chi_squared_distribution/op_not_equal.md | 2 +- .../chi_squared_distribution/op_ostream.md | 2 +- .../random/chi_squared_distribution/param.md | 2 +- .../random/chi_squared_distribution/reset.md | 2 +- reference/random/discard_block_engine.md | 2 +- reference/random/discard_block_engine/base.md | 2 +- .../random/discard_block_engine/discard.md | 2 +- reference/random/discard_block_engine/max.md | 2 +- reference/random/discard_block_engine/min.md | 2 +- .../random/discard_block_engine/op_call.md | 2 +- .../discard_block_engine/op_constructor.md | 2 +- .../random/discard_block_engine/op_equal.md | 2 +- .../random/discard_block_engine/op_istream.md | 2 +- .../discard_block_engine/op_not_equal.md | 2 +- .../random/discard_block_engine/op_ostream.md | 2 +- reference/random/discard_block_engine/seed.md | 2 +- reference/random/discrete_distribution.md | 2 +- reference/random/discrete_distribution/max.md | 2 +- reference/random/discrete_distribution/min.md | 2 +- .../random/discrete_distribution/op_call.md | 2 +- .../discrete_distribution/op_constructor.md | 2 +- .../random/discrete_distribution/op_equal.md | 2 +- .../discrete_distribution/op_istream.md | 2 +- .../discrete_distribution/op_not_equal.md | 2 +- .../discrete_distribution/op_ostream.md | 2 +- .../random/discrete_distribution/param.md | 2 +- .../discrete_distribution/probabilities.md | 2 +- .../random/discrete_distribution/reset.md | 2 +- reference/random/exponential_distribution.md | 2 +- .../random/exponential_distribution/lambda.md | 4 +- .../random/exponential_distribution/max.md | 4 +- .../random/exponential_distribution/min.md | 4 +- .../exponential_distribution/op_call.md | 2 +- .../op_constructor.md | 2 +- .../exponential_distribution/op_equal.md | 2 +- .../exponential_distribution/op_istream.md | 2 +- .../exponential_distribution/op_not_equal.md | 2 +- .../exponential_distribution/op_ostream.md | 2 +- .../random/exponential_distribution/param.md | 2 +- .../random/exponential_distribution/reset.md | 2 +- .../random/extreme_value_distribution.md | 2 +- .../random/extreme_value_distribution/a.md | 2 +- .../random/extreme_value_distribution/b.md | 2 +- .../random/extreme_value_distribution/max.md | 2 +- .../random/extreme_value_distribution/min.md | 2 +- .../extreme_value_distribution/op_call.md | 2 +- .../op_constructor.md | 2 +- .../extreme_value_distribution/op_equal.md | 2 +- .../extreme_value_distribution/op_istream.md | 2 +- .../op_not_equal.md | 2 +- .../extreme_value_distribution/op_ostream.md | 2 +- .../extreme_value_distribution/param.md | 2 +- .../extreme_value_distribution/reset.md | 2 +- reference/random/fisher_f_distribution.md | 2 +- reference/random/fisher_f_distribution/m.md | 2 +- reference/random/fisher_f_distribution/max.md | 4 +- reference/random/fisher_f_distribution/min.md | 2 +- reference/random/fisher_f_distribution/n.md | 2 +- .../random/fisher_f_distribution/op_call.md | 2 +- .../fisher_f_distribution/op_constructor.md | 2 +- .../random/fisher_f_distribution/op_equal.md | 2 +- .../fisher_f_distribution/op_istream.md | 2 +- .../fisher_f_distribution/op_not_equal.md | 2 +- .../fisher_f_distribution/op_ostream.md | 2 +- .../random/fisher_f_distribution/param.md | 2 +- .../random/fisher_f_distribution/reset.md | 2 +- reference/random/gamma_distribution.md | 2 +- reference/random/gamma_distribution/alpha.md | 4 +- reference/random/gamma_distribution/beta.md | 4 +- reference/random/gamma_distribution/max.md | 4 +- reference/random/gamma_distribution/min.md | 4 +- .../random/gamma_distribution/op_call.md | 2 +- .../gamma_distribution/op_constructor.md | 2 +- .../random/gamma_distribution/op_equal.md | 2 +- .../random/gamma_distribution/op_istream.md | 2 +- .../random/gamma_distribution/op_not_equal.md | 2 +- .../random/gamma_distribution/op_ostream.md | 2 +- reference/random/gamma_distribution/param.md | 2 +- reference/random/gamma_distribution/reset.md | 2 +- reference/random/generate_canonical.md | 4 +- reference/random/geometric_distribution.md | 2 +- .../random/geometric_distribution/max.md | 2 +- .../random/geometric_distribution/min.md | 2 +- .../random/geometric_distribution/op_call.md | 4 +- .../geometric_distribution/op_constructor.md | 2 +- .../random/geometric_distribution/op_equal.md | 2 +- .../geometric_distribution/op_istream.md | 2 +- .../geometric_distribution/op_not_equal.md | 2 +- .../geometric_distribution/op_ostream.md | 2 +- reference/random/geometric_distribution/p.md | 2 +- .../random/geometric_distribution/param.md | 2 +- .../random/geometric_distribution/reset.md | 2 +- reference/random/independent_bits_engine.md | 2 +- .../random/independent_bits_engine/base.md | 2 +- .../random/independent_bits_engine/discard.md | 2 +- .../random/independent_bits_engine/max.md | 2 +- .../random/independent_bits_engine/min.md | 2 +- .../random/independent_bits_engine/op_call.md | 2 +- .../independent_bits_engine/op_constructor.md | 2 +- .../independent_bits_engine/op_equal.md | 2 +- .../independent_bits_engine/op_istream.md | 2 +- .../independent_bits_engine/op_not_equal.md | 2 +- .../independent_bits_engine/op_ostream.md | 2 +- .../random/independent_bits_engine/seed.md | 2 +- reference/random/knuth_b.md | 2 +- .../random/linear_congruential_engine.md | 2 +- .../linear_congruential_engine/discard.md | 2 +- .../random/linear_congruential_engine/max.md | 2 +- .../random/linear_congruential_engine/min.md | 2 +- .../linear_congruential_engine/op_call.md | 2 +- .../op_constructor.md | 2 +- .../linear_congruential_engine/op_equal.md | 2 +- .../linear_congruential_engine/op_istream.md | 2 +- .../op_not_equal.md | 2 +- .../linear_congruential_engine/op_ostream.md | 2 +- .../random/linear_congruential_engine/seed.md | 2 +- reference/random/lognormal_distribution.md | 2 +- reference/random/lognormal_distribution/m.md | 2 +- .../random/lognormal_distribution/max.md | 4 +- .../random/lognormal_distribution/min.md | 2 +- .../random/lognormal_distribution/op_call.md | 2 +- .../lognormal_distribution/op_constructor.md | 2 +- .../random/lognormal_distribution/op_equal.md | 2 +- .../lognormal_distribution/op_istream.md | 2 +- .../lognormal_distribution/op_not_equal.md | 2 +- .../lognormal_distribution/op_ostream.md | 2 +- .../random/lognormal_distribution/param.md | 2 +- .../random/lognormal_distribution/reset.md | 2 +- reference/random/lognormal_distribution/s.md | 2 +- reference/random/mersenne_twister_engine.md | 2 +- .../random/mersenne_twister_engine/discard.md | 2 +- .../random/mersenne_twister_engine/max.md | 2 +- .../random/mersenne_twister_engine/min.md | 2 +- .../random/mersenne_twister_engine/op_call.md | 2 +- .../mersenne_twister_engine/op_constructor.md | 2 +- .../mersenne_twister_engine/op_equal.md | 2 +- .../mersenne_twister_engine/op_istream.md | 2 +- .../mersenne_twister_engine/op_not_equal.md | 2 +- .../mersenne_twister_engine/op_ostream.md | 2 +- .../random/mersenne_twister_engine/seed.md | 2 +- reference/random/minstd_rand.md | 2 +- reference/random/minstd_rand0.md | 2 +- reference/random/mt19937.md | 2 +- reference/random/mt19937_64.md | 2 +- .../random/negative_binomial_distribution.md | 2 +- .../negative_binomial_distribution/k.md | 2 +- .../negative_binomial_distribution/max.md | 2 +- .../negative_binomial_distribution/min.md | 2 +- .../negative_binomial_distribution/op_call.md | 4 +- .../op_constructor.md | 2 +- .../op_equal.md | 2 +- .../op_istream.md | 2 +- .../op_not_equal.md | 2 +- .../op_ostream.md | 2 +- .../negative_binomial_distribution/p.md | 2 +- .../negative_binomial_distribution/param.md | 2 +- .../negative_binomial_distribution/reset.md | 2 +- reference/random/normal_distribution.md | 2 +- reference/random/normal_distribution/max.md | 4 +- reference/random/normal_distribution/mean.md | 2 +- reference/random/normal_distribution/min.md | 2 +- .../random/normal_distribution/op_call.md | 2 +- .../normal_distribution/op_constructor.md | 2 +- .../random/normal_distribution/op_equal.md | 2 +- .../random/normal_distribution/op_istream.md | 2 +- .../normal_distribution/op_not_equal.md | 2 +- .../random/normal_distribution/op_ostream.md | 2 +- reference/random/normal_distribution/param.md | 2 +- reference/random/normal_distribution/reset.md | 2 +- .../random/normal_distribution/stddev.md | 2 +- .../random/piecewise_constant_distribution.md | 2 +- .../densities.md | 2 +- .../intervals.md | 2 +- .../piecewise_constant_distribution/max.md | 2 +- .../piecewise_constant_distribution/min.md | 2 +- .../op_call.md | 2 +- .../op_constructor.md | 2 +- .../op_equal.md | 2 +- .../op_istream.md | 2 +- .../op_not_equal.md | 2 +- .../op_ostream.md | 2 +- .../piecewise_constant_distribution/param.md | 2 +- .../piecewise_constant_distribution/reset.md | 2 +- .../random/piecewise_linear_distribution.md | 2 +- .../densities.md | 2 +- .../intervals.md | 2 +- .../piecewise_linear_distribution/max.md | 2 +- .../piecewise_linear_distribution/min.md | 2 +- .../piecewise_linear_distribution/op_call.md | 2 +- .../op_constructor.md | 2 +- .../piecewise_linear_distribution/op_equal.md | 2 +- .../op_istream.md | 2 +- .../op_not_equal.md | 2 +- .../op_ostream.md | 2 +- .../piecewise_linear_distribution/param.md | 2 +- .../piecewise_linear_distribution/reset.md | 2 +- reference/random/poisson_distribution.md | 2 +- reference/random/poisson_distribution/max.md | 2 +- reference/random/poisson_distribution/mean.md | 2 +- reference/random/poisson_distribution/min.md | 2 +- .../random/poisson_distribution/op_call.md | 2 +- .../poisson_distribution/op_constructor.md | 2 +- .../random/poisson_distribution/op_equal.md | 2 +- .../random/poisson_distribution/op_istream.md | 2 +- .../poisson_distribution/op_not_equal.md | 2 +- .../random/poisson_distribution/op_ostream.md | 2 +- .../random/poisson_distribution/param.md | 2 +- .../random/poisson_distribution/reset.md | 2 +- reference/random/random_device.md | 6 +- reference/random/random_device/entropy.md | 4 +- reference/random/random_device/max.md | 4 +- reference/random/random_device/min.md | 4 +- reference/random/random_device/op_call.md | 4 +- .../random/random_device/op_constructor.md | 4 +- reference/random/ranlux24.md | 4 +- reference/random/ranlux24_base.md | 2 +- reference/random/ranlux48.md | 4 +- reference/random/ranlux48_base.md | 2 +- reference/random/seed_seq.md | 2 +- reference/random/seed_seq/generate.md | 2 +- reference/random/seed_seq/op_constructor.md | 2 +- reference/random/seed_seq/param.md | 2 +- reference/random/seed_seq/size.md | 2 +- reference/random/shuffle_order_engine.md | 2 +- reference/random/shuffle_order_engine/base.md | 2 +- .../random/shuffle_order_engine/discard.md | 2 +- reference/random/shuffle_order_engine/max.md | 2 +- reference/random/shuffle_order_engine/min.md | 2 +- .../random/shuffle_order_engine/op_call.md | 2 +- .../shuffle_order_engine/op_constructor.md | 2 +- .../random/shuffle_order_engine/op_equal.md | 2 +- .../random/shuffle_order_engine/op_istream.md | 2 +- .../shuffle_order_engine/op_not_equal.md | 2 +- .../random/shuffle_order_engine/op_ostream.md | 2 +- reference/random/shuffle_order_engine/seed.md | 2 +- reference/random/student_t_distribution.md | 2 +- .../random/student_t_distribution/max.md | 4 +- .../random/student_t_distribution/min.md | 2 +- reference/random/student_t_distribution/n.md | 2 +- .../random/student_t_distribution/op_call.md | 2 +- .../student_t_distribution/op_constructor.md | 2 +- .../random/student_t_distribution/op_equal.md | 2 +- .../student_t_distribution/op_istream.md | 2 +- .../student_t_distribution/op_not_equal.md | 2 +- .../student_t_distribution/op_ostream.md | 2 +- .../random/student_t_distribution/param.md | 2 +- .../random/student_t_distribution/reset.md | 2 +- .../random/subtract_with_carry_engine.md | 4 +- .../subtract_with_carry_engine/discard.md | 4 +- .../random/subtract_with_carry_engine/max.md | 4 +- .../random/subtract_with_carry_engine/min.md | 4 +- .../subtract_with_carry_engine/op_call.md | 4 +- .../op_constructor.md | 4 +- .../subtract_with_carry_engine/op_equal.md | 4 +- .../subtract_with_carry_engine/op_istream.md | 4 +- .../op_not_equal.md | 4 +- .../subtract_with_carry_engine/op_ostream.md | 4 +- .../random/subtract_with_carry_engine/seed.md | 4 +- reference/random/uniform_int_distribution.md | 2 +- .../random/uniform_int_distribution/a.md | 2 +- .../random/uniform_int_distribution/b.md | 2 +- .../random/uniform_int_distribution/max.md | 2 +- .../random/uniform_int_distribution/min.md | 2 +- .../uniform_int_distribution/op_call.md | 2 +- .../op_constructor.md | 2 +- .../uniform_int_distribution/op_equal.md | 2 +- .../uniform_int_distribution/op_istream.md | 2 +- .../uniform_int_distribution/op_not_equal.md | 2 +- .../uniform_int_distribution/op_ostream.md | 2 +- .../random/uniform_int_distribution/param.md | 2 +- .../random/uniform_int_distribution/reset.md | 2 +- .../random/uniform_random_bit_generator.md | 4 +- reference/random/uniform_real_distribution.md | 2 +- .../random/uniform_real_distribution/a.md | 2 +- .../random/uniform_real_distribution/b.md | 2 +- .../random/uniform_real_distribution/max.md | 2 +- .../random/uniform_real_distribution/min.md | 2 +- .../uniform_real_distribution/op_call.md | 2 +- .../op_constructor.md | 2 +- .../uniform_real_distribution/op_equal.md | 2 +- .../uniform_real_distribution/op_istream.md | 2 +- .../uniform_real_distribution/op_not_equal.md | 2 +- .../uniform_real_distribution/op_ostream.md | 2 +- .../random/uniform_real_distribution/param.md | 2 +- .../random/uniform_real_distribution/reset.md | 2 +- reference/random/weibull_distribution.md | 2 +- reference/random/weibull_distribution/a.md | 2 +- reference/random/weibull_distribution/b.md | 2 +- reference/random/weibull_distribution/max.md | 2 +- reference/random/weibull_distribution/min.md | 2 +- .../random/weibull_distribution/op_call.md | 2 +- .../weibull_distribution/op_constructor.md | 2 +- .../random/weibull_distribution/op_equal.md | 2 +- .../random/weibull_distribution/op_istream.md | 2 +- .../weibull_distribution/op_not_equal.md | 2 +- .../random/weibull_distribution/op_ostream.md | 2 +- .../random/weibull_distribution/param.md | 2 +- .../random/weibull_distribution/reset.md | 2 +- reference/ranges.md | 6 +- reference/ranges/all.md | 6 +- reference/ranges/as_const_view.md | 4 +- reference/ranges/as_const_view/base.md | 4 +- reference/ranges/as_const_view/begin.md | 4 +- reference/ranges/as_const_view/end.md | 4 +- .../ranges/as_const_view/op_constructor.md | 4 +- .../as_const_view/op_deduction_guide.md | 4 +- reference/ranges/as_const_view/size.md | 130 +++++++++--------- reference/ranges/basic_istream_view.md | 6 +- reference/ranges/begin.md | 6 +- reference/ranges/bidirectional_range.md | 6 +- reference/ranges/borrowed_iterator_t.md | 6 +- reference/ranges/borrowed_range.md | 6 +- reference/ranges/borrowed_subrange_t.md | 6 +- reference/ranges/cartesian_product_view.md | 4 +- reference/ranges/cbegin.md | 6 +- reference/ranges/cdata.md | 6 +- reference/ranges/cend.md | 6 +- reference/ranges/chunk_by_view.md | 2 +- reference/ranges/chunk_view.md | 2 +- reference/ranges/common_range.md | 6 +- reference/ranges/common_view.md | 6 +- reference/ranges/const_iterator_t.md | 4 +- reference/ranges/const_sentinel_t.md | 4 +- reference/ranges/constant_range.md | 4 +- reference/ranges/contiguous_range.md | 6 +- reference/ranges/counted.md | 6 +- reference/ranges/crbegin.md | 6 +- reference/ranges/crend.md | 6 +- reference/ranges/dangling.md | 6 +- reference/ranges/data.md | 6 +- reference/ranges/disable_sized_range.md | 6 +- reference/ranges/drop_view.md | 6 +- reference/ranges/drop_while_view.md | 6 +- reference/ranges/elements_view.md | 6 +- reference/ranges/empty.md | 6 +- reference/ranges/empty_view.md | 6 +- reference/ranges/enable_borrowed_range.md | 6 +- reference/ranges/enable_view.md | 6 +- reference/ranges/end.md | 6 +- reference/ranges/filter_view.md | 6 +- reference/ranges/forward_range.md | 6 +- reference/ranges/input_range.md | 6 +- reference/ranges/iota_view.md | 6 +- reference/ranges/iota_view/begin.md | 6 +- reference/ranges/iota_view/end.md | 6 +- reference/ranges/iota_view/iota_diff_t.md | 6 +- reference/ranges/iota_view/iterator.md | 6 +- reference/ranges/iota_view/op_constructor.md | 6 +- .../ranges/iota_view/op_deduction_guide.md | 6 +- reference/ranges/iota_view/sentinel.md | 6 +- reference/ranges/iota_view/size.md | 6 +- reference/ranges/iterator_t.md | 6 +- reference/ranges/join_view.md | 6 +- reference/ranges/join_with_view.md | 2 +- reference/ranges/lazy_split_view.md | 6 +- reference/ranges/output_range.md | 6 +- reference/ranges/owning_view.md | 6 +- reference/ranges/random_access_range.md | 6 +- reference/ranges/range.md | 6 +- reference/ranges/range_const_reference_t.md | 4 +- reference/ranges/range_difference_t.md | 6 +- reference/ranges/range_reference_t.md | 6 +- reference/ranges/range_rvalue_reference_t.md | 6 +- reference/ranges/range_size_t.md | 6 +- reference/ranges/range_value_t.md | 6 +- reference/ranges/rbegin.md | 6 +- reference/ranges/ref_view.md | 6 +- reference/ranges/rend.md | 6 +- reference/ranges/reverse_view.md | 6 +- reference/ranges/sentinel_t.md | 6 +- reference/ranges/single_view.md | 6 +- reference/ranges/size.md | 6 +- reference/ranges/sized_range.md | 6 +- reference/ranges/slide_view.md | 2 +- reference/ranges/split_view.md | 6 +- reference/ranges/ssize.md | 6 +- reference/ranges/stride_view.md | 4 +- reference/ranges/subrange.md | 6 +- reference/ranges/subrange/advance.md | 6 +- reference/ranges/subrange/begin.md | 6 +- reference/ranges/subrange/empty.md | 6 +- .../ranges/subrange/enable_borrowed_range.md | 6 +- reference/ranges/subrange/end.md | 6 +- reference/ranges/subrange/get.md | 6 +- reference/ranges/subrange/next.md | 6 +- reference/ranges/subrange/op_constructor.md | 6 +- .../ranges/subrange/op_deduction_guide.md | 6 +- reference/ranges/subrange/op_pairlike.md | 6 +- reference/ranges/subrange/prev.md | 6 +- reference/ranges/subrange/size.md | 6 +- reference/ranges/subrange/tuple_element.md | 6 +- reference/ranges/subrange/tuple_size.md | 6 +- reference/ranges/subrange_kind.md | 6 +- reference/ranges/take_view.md | 6 +- reference/ranges/take_while_view.md | 6 +- reference/ranges/to.md | 2 +- reference/ranges/transform_view.md | 6 +- reference/ranges/view.md | 6 +- reference/ranges/view_base.md | 6 +- reference/ranges/view_interface.md | 6 +- reference/ranges/view_interface/back.md | 6 +- reference/ranges/view_interface/cbegin.md | 4 +- reference/ranges/view_interface/cend.md | 4 +- reference/ranges/view_interface/data.md | 6 +- reference/ranges/view_interface/empty.md | 6 +- reference/ranges/view_interface/front.md | 6 +- reference/ranges/view_interface/op_at.md | 6 +- reference/ranges/view_interface/op_bool.md | 6 +- reference/ranges/view_interface/size.md | 6 +- reference/ranges/viewable_range.md | 6 +- reference/ranges/zip_view.md | 4 +- reference/ratio/ratio.md | 4 +- reference/ratio/ratio_add.md | 4 +- reference/ratio/ratio_divide.md | 4 +- reference/ratio/ratio_equal.md | 4 +- reference/ratio/ratio_greater.md | 4 +- reference/ratio/ratio_greater_equal.md | 4 +- reference/ratio/ratio_less.md | 4 +- reference/ratio/ratio_less_equal.md | 4 +- reference/ratio/ratio_multiply.md | 4 +- reference/ratio/ratio_not_equal.md | 4 +- reference/ratio/ratio_subtract.md | 4 +- reference/ratio/si_prefix.md | 4 +- reference/regex/basic_regex.md | 4 +- reference/regex/basic_regex/assign.md | 4 +- reference/regex/basic_regex/flags.md | 4 +- reference/regex/basic_regex/getloc.md | 4 +- reference/regex/basic_regex/imbue.md | 4 +- reference/regex/basic_regex/mark_count.md | 4 +- reference/regex/basic_regex/op_assign.md | 4 +- reference/regex/basic_regex/op_constructor.md | 4 +- .../regex/basic_regex/op_deduction_guide.md | 2 +- reference/regex/basic_regex/op_destructor.md | 4 +- reference/regex/basic_regex/swap.md | 4 +- reference/regex/basic_regex/swap_free.md | 4 +- reference/regex/match_results.md | 4 +- reference/regex/match_results/begin.md | 4 +- reference/regex/match_results/cbegin.md | 4 +- reference/regex/match_results/cend.md | 4 +- reference/regex/match_results/empty.md | 4 +- reference/regex/match_results/end.md | 4 +- reference/regex/match_results/format.md | 4 +- .../regex/match_results/get_allocator.md | 4 +- reference/regex/match_results/length.md | 4 +- reference/regex/match_results/max_size.md | 4 +- reference/regex/match_results/op_assign.md | 4 +- reference/regex/match_results/op_at.md | 4 +- .../regex/match_results/op_constructor.md | 4 +- .../regex/match_results/op_destructor.md | 4 +- reference/regex/match_results/op_equal.md | 4 +- reference/regex/match_results/op_not_equal.md | 4 +- reference/regex/match_results/position.md | 4 +- reference/regex/match_results/prefix.md | 4 +- reference/regex/match_results/ready.md | 4 +- reference/regex/match_results/size.md | 4 +- reference/regex/match_results/str.md | 4 +- reference/regex/match_results/suffix.md | 4 +- reference/regex/match_results/swap.md | 4 +- reference/regex/match_results/swap_free.md | 4 +- reference/regex/regex_constants/error_type.md | 4 +- .../regex/regex_constants/match_flag_type.md | 4 +- .../regex_constants/syntax_option_type.md | 4 +- reference/regex/regex_error.md | 4 +- reference/regex/regex_error/code.md | 4 +- reference/regex/regex_error/op_constructor.md | 4 +- reference/regex/regex_iterator.md | 4 +- reference/regex/regex_iterator/op_arrow.md | 4 +- reference/regex/regex_iterator/op_assign.md | 4 +- .../regex/regex_iterator/op_constructor.md | 4 +- reference/regex/regex_iterator/op_deref.md | 4 +- reference/regex/regex_iterator/op_equal.md | 4 +- .../regex/regex_iterator/op_increment.md | 4 +- .../regex/regex_iterator/op_not_equal.md | 4 +- reference/regex/regex_match.md | 4 +- reference/regex/regex_replace.md | 4 +- reference/regex/regex_search.md | 4 +- reference/regex/regex_token_iterator.md | 4 +- .../regex/regex_token_iterator/op_arrow.md | 4 +- .../regex/regex_token_iterator/op_assign.md | 4 +- .../regex_token_iterator/op_constructor.md | 4 +- .../regex/regex_token_iterator/op_deref.md | 4 +- .../regex/regex_token_iterator/op_equal.md | 4 +- .../regex_token_iterator/op_increment.md | 4 +- .../regex_token_iterator/op_not_equal.md | 4 +- reference/regex/regex_traits.md | 4 +- reference/regex/regex_traits/getloc.md | 4 +- reference/regex/regex_traits/imbue.md | 4 +- reference/regex/regex_traits/isctype.md | 4 +- reference/regex/regex_traits/length.md | 4 +- .../regex/regex_traits/lookup_classname.md | 4 +- .../regex/regex_traits/lookup_collatename.md | 4 +- .../regex/regex_traits/op_constructor.md | 4 +- reference/regex/regex_traits/transform.md | 4 +- .../regex/regex_traits/transform_primary.md | 4 +- reference/regex/regex_traits/translate.md | 4 +- .../regex/regex_traits/translate_nocase.md | 4 +- reference/regex/regex_traits/value.md | 4 +- reference/regex/sub_match.md | 4 +- reference/regex/sub_match/compare.md | 4 +- reference/regex/sub_match/length.md | 4 +- reference/regex/sub_match/op_compare_3way.md | 2 +- reference/regex/sub_match/op_constructor.md | 4 +- reference/regex/sub_match/op_equal.md | 4 +- reference/regex/sub_match/op_greater.md | 4 +- reference/regex/sub_match/op_greater_equal.md | 4 +- reference/regex/sub_match/op_less.md | 4 +- reference/regex/sub_match/op_less_equal.md | 4 +- reference/regex/sub_match/op_not_equal.md | 4 +- reference/regex/sub_match/op_ostream.md | 4 +- reference/regex/sub_match/op_string_type.md | 4 +- reference/regex/sub_match/str.md | 4 +- .../scoped_allocator_adaptor.md | 4 +- .../scoped_allocator_adaptor/allocate.md | 4 +- .../scoped_allocator_adaptor/construct.md | 4 +- .../scoped_allocator_adaptor/deallocate.md | 4 +- .../scoped_allocator_adaptor/destroy.md | 4 +- .../inner_allocator.md | 4 +- .../scoped_allocator_adaptor/max_size.md | 4 +- .../op_constructor.md | 4 +- .../scoped_allocator_adaptor/op_equal.md | 4 +- .../scoped_allocator_adaptor/op_not_equal.md | 4 +- .../outer_allocator.md | 4 +- .../select_on_container_copy_construction.md | 4 +- reference/semaphore/counting_semaphore.md | 2 +- .../semaphore/counting_semaphore/acquire.md | 2 +- reference/semaphore/counting_semaphore/max.md | 2 +- .../counting_semaphore/op_constructor.md | 2 +- .../semaphore/counting_semaphore/release.md | 2 +- .../counting_semaphore/try_acquire.md | 2 +- .../counting_semaphore/try_acquire_for.md | 2 +- .../counting_semaphore/try_acquire_until.md | 2 +- reference/set/multiset/contains.md | 4 +- reference/set/multiset/erase_if_free.md | 4 +- reference/set/multiset/extract.md | 6 +- reference/set/multiset/get_allocator.md | 2 +- reference/set/multiset/merge.md | 6 +- reference/set/set/contains.md | 4 +- reference/set/set/erase_if_free.md | 4 +- reference/set/set/extract.md | 6 +- reference/set/set/get_allocator.md | 2 +- reference/set/set/merge.md | 6 +- reference/set/set/op_compare_3way.md | 2 +- reference/shared_mutex/shared_lock.md | 6 +- reference/shared_mutex/shared_lock/lock.md | 6 +- reference/shared_mutex/shared_lock/mutex.md | 6 +- .../shared_mutex/shared_lock/op_assign.md | 6 +- reference/shared_mutex/shared_lock/op_bool.md | 6 +- .../shared_lock/op_constructor.md | 6 +- .../shared_mutex/shared_lock/op_destructor.md | 6 +- .../shared_mutex/shared_lock/owns_lock.md | 6 +- reference/shared_mutex/shared_lock/release.md | 6 +- reference/shared_mutex/shared_lock/swap.md | 6 +- .../shared_mutex/shared_lock/swap_free.md | 6 +- .../shared_mutex/shared_lock/try_lock.md | 6 +- .../shared_mutex/shared_lock/try_lock_for.md | 6 +- .../shared_lock/try_lock_until.md | 6 +- reference/shared_mutex/shared_lock/unlock.md | 6 +- reference/shared_mutex/shared_mutex.md | 4 +- reference/shared_mutex/shared_mutex/lock.md | 4 +- .../shared_mutex/shared_mutex/lock_shared.md | 4 +- .../shared_mutex/op_constructor.md | 4 +- .../shared_mutex/op_destructor.md | 6 +- .../shared_mutex/shared_mutex/try_lock.md | 4 +- .../shared_mutex/try_lock_shared.md | 4 +- reference/shared_mutex/shared_mutex/unlock.md | 4 +- .../shared_mutex/unlock_shared.md | 4 +- reference/shared_mutex/shared_timed_mutex.md | 6 +- .../shared_mutex/shared_timed_mutex/lock.md | 6 +- .../shared_timed_mutex/lock_shared.md | 6 +- .../shared_timed_mutex/op_constructor.md | 6 +- .../shared_timed_mutex/op_destructor.md | 6 +- .../shared_timed_mutex/try_lock.md | 6 +- .../shared_timed_mutex/try_lock_for.md | 6 +- .../shared_timed_mutex/try_lock_shared.md | 6 +- .../shared_timed_mutex/try_lock_shared_for.md | 6 +- .../try_lock_shared_until.md | 6 +- .../shared_timed_mutex/try_lock_until.md | 6 +- .../shared_mutex/shared_timed_mutex/unlock.md | 6 +- .../shared_timed_mutex/unlock_shared.md | 6 +- reference/source_location.md | 2 +- reference/source_location/source_location.md | 2 +- .../source_location/current.md | 2 +- .../source_location/op_constructor.md | 2 +- reference/span/dynamic_extent.md | 2 +- reference/span/span.md | 6 +- reference/span/span/as_bytes.md | 2 +- reference/span/span/as_writable_bytes.md | 2 +- reference/span/span/at.md | 2 +- reference/span/span/back.md | 2 +- reference/span/span/begin.md | 2 +- reference/span/span/cbegin.md | 4 +- reference/span/span/cend.md | 4 +- reference/span/span/crbegin.md | 4 +- reference/span/span/crend.md | 4 +- reference/span/span/data.md | 2 +- reference/span/span/empty.md | 2 +- reference/span/span/end.md | 2 +- reference/span/span/first.md | 2 +- reference/span/span/front.md | 2 +- reference/span/span/last.md | 2 +- reference/span/span/op_at.md | 2 +- reference/span/span/op_constructor.md | 4 +- reference/span/span/op_deduction_guide.md | 2 +- reference/span/span/rbegin.md | 2 +- reference/span/span/rend.md | 2 +- reference/span/span/size.md | 2 +- reference/span/span/size_bytes.md | 2 +- reference/span/span/subspan.md | 2 +- reference/stack/stack/emplace.md | 4 +- reference/stack/stack/op_compare_3way.md | 2 +- reference/stack/stack/swap.md | 2 +- reference/stack/stack/swap_free.md | 2 +- reference/stacktrace/basic_stacktrace.md | 2 +- reference/stacktrace/basic_stacktrace/at.md | 2 +- .../stacktrace/basic_stacktrace/begin.md | 2 +- .../stacktrace/basic_stacktrace/cbegin.md | 2 +- reference/stacktrace/basic_stacktrace/cend.md | 2 +- .../stacktrace/basic_stacktrace/crbegin.md | 2 +- .../stacktrace/basic_stacktrace/crend.md | 2 +- .../stacktrace/basic_stacktrace/current.md | 2 +- .../stacktrace/basic_stacktrace/empty.md | 2 +- reference/stacktrace/basic_stacktrace/end.md | 2 +- .../basic_stacktrace/get_allocator.md | 2 +- .../stacktrace/basic_stacktrace/op_assign.md | 2 +- .../stacktrace/basic_stacktrace/op_at.md | 2 +- .../basic_stacktrace/op_compare_3way.md | 2 +- .../basic_stacktrace/op_constructor.md | 2 +- .../stacktrace/basic_stacktrace/op_equal.md | 2 +- .../stacktrace/basic_stacktrace/op_ostream.md | 2 +- .../stacktrace/basic_stacktrace/rbegin.md | 2 +- reference/stacktrace/basic_stacktrace/rend.md | 2 +- reference/stacktrace/basic_stacktrace/size.md | 2 +- reference/stacktrace/basic_stacktrace/swap.md | 2 +- .../stacktrace/basic_stacktrace/swap_free.md | 2 +- .../stacktrace/basic_stacktrace/to_string.md | 2 +- reference/stacktrace/stacktrace_entry.md | 2 +- .../stacktrace_entry/description.md | 2 +- .../stacktrace/stacktrace_entry/formatter.md | 2 +- .../stacktrace_entry/native_handle.md | 2 +- .../stacktrace/stacktrace_entry/op_bool.md | 2 +- .../stacktrace_entry/op_constructor.md | 2 +- .../stacktrace/stacktrace_entry/op_equal.md | 2 +- .../stacktrace/stacktrace_entry/op_ostream.md | 2 +- .../stacktrace_entry/source_file.md | 2 +- .../stacktrace_entry/source_line.md | 2 +- .../stacktrace/stacktrace_entry/to_string.md | 2 +- reference/stdfloat/bfloat16_t.md | 2 +- reference/stdfloat/float128_t.md | 2 +- reference/stdfloat/float16_t.md | 2 +- reference/stdfloat/float32_t.md | 2 +- reference/stdfloat/float64_t.md | 2 +- reference/string/basic_string/contains.md | 2 +- reference/string/basic_string/ends_with.md | 6 +- reference/string/basic_string/erase_free.md | 4 +- .../string/basic_string/erase_if_free.md | 4 +- .../string/basic_string/get_allocator.md | 6 +- .../string/basic_string/op_deduction_guide.md | 4 +- reference/string/basic_string/op_s.md | 6 +- reference/string/basic_string/pop_back.md | 4 +- .../string/basic_string/shrink_to_fit.md | 6 +- reference/string/basic_string/starts_with.md | 6 +- reference/string/stod.md | 4 +- reference/string/stof.md | 4 +- reference/string/stoi.md | 2 +- reference/string/stol.md | 2 +- reference/string/stold.md | 2 +- reference/string/stoll.md | 2 +- reference/string/stoul.md | 2 +- reference/string/stoull.md | 2 +- reference/string/to_string.md | 6 +- reference/string/to_wstring.md | 6 +- reference/string_view/basic_string_view.md | 4 +- reference/string_view/basic_string_view/at.md | 4 +- .../string_view/basic_string_view/back.md | 4 +- .../string_view/basic_string_view/begin.md | 4 +- .../string_view/basic_string_view/cbegin.md | 4 +- .../string_view/basic_string_view/cend.md | 4 +- .../string_view/basic_string_view/compare.md | 4 +- .../string_view/basic_string_view/contains.md | 2 +- .../string_view/basic_string_view/copy.md | 4 +- .../string_view/basic_string_view/crbegin.md | 4 +- .../string_view/basic_string_view/crend.md | 4 +- .../string_view/basic_string_view/data.md | 4 +- .../string_view/basic_string_view/empty.md | 4 +- .../string_view/basic_string_view/end.md | 4 +- .../basic_string_view/ends_with.md | 4 +- .../string_view/basic_string_view/find.md | 4 +- .../basic_string_view/find_first_not_of.md | 4 +- .../basic_string_view/find_first_of.md | 4 +- .../basic_string_view/find_last_not_of.md | 4 +- .../basic_string_view/find_last_of.md | 4 +- .../string_view/basic_string_view/front.md | 4 +- .../string_view/basic_string_view/length.md | 4 +- .../string_view/basic_string_view/max_size.md | 4 +- .../string_view/basic_string_view/op_at.md | 4 +- .../basic_string_view/op_compare_3way.md | 2 +- .../basic_string_view/op_constructor.md | 4 +- .../basic_string_view/op_deduction_guide.md | 2 +- .../string_view/basic_string_view/op_equal.md | 4 +- .../basic_string_view/op_greater.md | 4 +- .../basic_string_view/op_greater_equal.md | 4 +- .../string_view/basic_string_view/op_less.md | 4 +- .../basic_string_view/op_less_equal.md | 4 +- .../basic_string_view/op_not_equal.md | 4 +- .../basic_string_view/op_ostream.md | 4 +- .../string_view/basic_string_view/op_sv.md | 4 +- .../string_view/basic_string_view/rbegin.md | 4 +- .../basic_string_view/remove_prefix.md | 4 +- .../basic_string_view/remove_suffix.md | 4 +- .../string_view/basic_string_view/rend.md | 4 +- .../string_view/basic_string_view/rfind.md | 4 +- .../string_view/basic_string_view/size.md | 4 +- .../basic_string_view/starts_with.md | 4 +- .../string_view/basic_string_view/substr.md | 4 +- .../string_view/basic_string_view/swap.md | 4 +- reference/syncstream.md | 4 +- reference/syncstream/basic_osyncstream.md | 4 +- .../syncstream/basic_osyncstream/emit.md | 4 +- .../basic_osyncstream/get_wrapped.md | 4 +- .../syncstream/basic_osyncstream/op_assign.md | 4 +- .../basic_osyncstream/op_constructor.md | 4 +- .../basic_osyncstream/op_destructor.md | 4 +- .../syncstream/basic_osyncstream/rdbuf.md | 4 +- reference/syncstream/basic_syncbuf.md | 4 +- reference/syncstream/basic_syncbuf/emit.md | 4 +- .../syncstream/basic_syncbuf/get_allocator.md | 4 +- .../syncstream/basic_syncbuf/get_wrapped.md | 4 +- .../syncstream/basic_syncbuf/op_assign.md | 4 +- .../basic_syncbuf/op_constructor.md | 4 +- .../syncstream/basic_syncbuf/op_destructor.md | 4 +- .../basic_syncbuf/set_emit_on_sync.md | 4 +- reference/syncstream/basic_syncbuf/swap.md | 4 +- .../syncstream/basic_syncbuf/swap_free.md | 4 +- reference/syncstream/basic_syncbuf/sync.md | 4 +- reference/system_error/error_category.md | 2 +- .../error_category/default_error_condition.md | 4 +- .../system_error/error_category/equivalent.md | 4 +- .../system_error/error_category/message.md | 4 +- reference/system_error/error_category/name.md | 4 +- .../error_category/op_compare_3way.md | 2 +- .../error_category/op_constructor.md | 4 +- .../system_error/error_category/op_equal.md | 4 +- .../system_error/error_category/op_less.md | 4 +- .../error_category/op_not_equal.md | 4 +- reference/system_error/error_code.md | 4 +- reference/system_error/error_code/assign.md | 4 +- reference/system_error/error_code/category.md | 4 +- reference/system_error/error_code/clear.md | 4 +- .../error_code/default_error_condition.md | 4 +- reference/system_error/error_code/message.md | 4 +- .../system_error/error_code/op_assign.md | 2 +- reference/system_error/error_code/op_bool.md | 4 +- .../error_code/op_compare_3way.md | 2 +- .../system_error/error_code/op_constructor.md | 4 +- reference/system_error/error_code/op_less.md | 4 +- .../system_error/error_code/op_ostream.md | 4 +- reference/system_error/error_code/value.md | 4 +- reference/system_error/error_condition.md | 4 +- .../system_error/error_condition/assign.md | 4 +- .../system_error/error_condition/category.md | 4 +- .../system_error/error_condition/clear.md | 4 +- .../system_error/error_condition/message.md | 4 +- .../system_error/error_condition/op_assign.md | 4 +- .../system_error/error_condition/op_bool.md | 4 +- .../error_condition/op_compare_3way.md | 2 +- .../error_condition/op_constructor.md | 4 +- .../system_error/error_condition/op_less.md | 4 +- .../system_error/error_condition/value.md | 4 +- reference/system_error/generic_category.md | 4 +- reference/system_error/is_error_code_enum.md | 4 +- .../system_error/is_error_condition_enum.md | 4 +- reference/system_error/make_error_code.md | 4 +- .../system_error/make_error_condition.md | 4 +- reference/system_error/op_equal.md | 4 +- reference/system_error/op_not_equal.md | 4 +- reference/system_error/system_category.md | 4 +- reference/system_error/system_error.md | 4 +- reference/thread.md | 4 +- reference/thread/jthread.md | 2 +- reference/thread/jthread/detach.md | 2 +- reference/thread/jthread/get_id.md | 2 +- reference/thread/jthread/get_stop_source.md | 2 +- reference/thread/jthread/get_stop_token.md | 2 +- .../thread/jthread/hardware_concurrency.md | 2 +- reference/thread/jthread/id.md | 2 +- reference/thread/jthread/join.md | 2 +- reference/thread/jthread/joinable.md | 2 +- reference/thread/jthread/native_handle.md | 2 +- reference/thread/jthread/op_assign.md | 2 +- reference/thread/jthread/op_constructor.md | 2 +- reference/thread/jthread/op_destructor.md | 2 +- reference/thread/jthread/request_stop.md | 2 +- reference/thread/jthread/swap.md | 2 +- reference/thread/jthread/swap_free.md | 2 +- reference/thread/this_thread.md | 2 +- reference/thread/this_thread/get_id.md | 4 +- reference/thread/this_thread/sleep_for.md | 4 +- reference/thread/this_thread/sleep_until.md | 4 +- reference/thread/this_thread/yield.md | 4 +- reference/thread/thread.md | 4 +- reference/thread/thread/detach.md | 4 +- reference/thread/thread/get_id.md | 4 +- .../thread/thread/hardware_concurrency.md | 4 +- reference/thread/thread/id.md | 2 +- reference/thread/thread/id/formatter.md | 2 +- reference/thread/thread/join.md | 4 +- reference/thread/thread/joinable.md | 4 +- reference/thread/thread/native_handle.md | 2 +- reference/thread/thread/op_assign.md | 4 +- reference/thread/thread/op_constructor.md | 4 +- reference/thread/thread/op_destructor.md | 4 +- reference/thread/thread/swap.md | 4 +- reference/thread/thread/swap_free.md | 4 +- reference/tuple/apply.md | 4 +- reference/tuple/forward_as_tuple.md | 2 +- reference/tuple/ignore.md | 4 +- reference/tuple/make_from_tuple.md | 2 +- reference/tuple/make_tuple.md | 4 +- reference/tuple/tie.md | 4 +- reference/tuple/tuple.md | 6 +- reference/tuple/tuple/common_type.md | 6 +- reference/tuple/tuple/get.md | 2 +- reference/tuple/tuple/op_assign.md | 2 +- reference/tuple/tuple/op_compare_3way.md | 2 +- reference/tuple/tuple/op_constructor.md | 2 +- reference/tuple/tuple/op_deduction_guide.md | 2 +- reference/tuple/tuple/op_equal.md | 2 +- reference/tuple/tuple/op_greater.md | 2 +- reference/tuple/tuple/op_greater_equal.md | 2 +- reference/tuple/tuple/op_less.md | 2 +- reference/tuple/tuple/op_less_equal.md | 2 +- reference/tuple/tuple/op_not_equal.md | 2 +- reference/tuple/tuple/swap.md | 2 +- reference/tuple/tuple/swap_free.md | 4 +- reference/tuple/tuple_cat.md | 2 +- reference/tuple/tuple_element.md | 2 +- reference/tuple/tuple_size.md | 2 +- reference/type_traits/add_const.md | 6 +- reference/type_traits/add_cv.md | 6 +- reference/type_traits/add_lvalue_reference.md | 6 +- reference/type_traits/add_pointer.md | 6 +- reference/type_traits/add_rvalue_reference.md | 6 +- reference/type_traits/add_volatile.md | 6 +- reference/type_traits/aligned_storage.md | 6 +- reference/type_traits/aligned_union.md | 6 +- reference/type_traits/alignment_of.md | 6 +- .../type_traits/basic_common_reference.md | 4 +- reference/type_traits/bool_constant.md | 4 +- reference/type_traits/common_reference.md | 4 +- reference/type_traits/common_type.md | 6 +- reference/type_traits/conditional.md | 6 +- reference/type_traits/conjunction.md | 6 +- reference/type_traits/decay.md | 6 +- reference/type_traits/disjunction.md | 6 +- reference/type_traits/enable_if.md | 6 +- reference/type_traits/extent.md | 6 +- reference/type_traits/false_type.md | 6 +- .../has_unique_object_representations.md | 6 +- .../type_traits/has_virtual_destructor.md | 6 +- reference/type_traits/integral_constant.md | 4 +- reference/type_traits/invoke_result.md | 6 +- reference/type_traits/is_abstract.md | 4 +- reference/type_traits/is_aggregate.md | 4 +- reference/type_traits/is_arithmetic.md | 4 +- reference/type_traits/is_array.md | 4 +- reference/type_traits/is_assignable.md | 2 +- reference/type_traits/is_base_of.md | 6 +- reference/type_traits/is_bounded_array.md | 4 +- reference/type_traits/is_class.md | 4 +- reference/type_traits/is_compound.md | 4 +- reference/type_traits/is_const.md | 4 +- .../type_traits/is_constant_evaluated.md | 6 +- reference/type_traits/is_constructible.md | 4 +- reference/type_traits/is_convertible.md | 6 +- reference/type_traits/is_copy_assignable.md | 4 +- .../type_traits/is_copy_constructible.md | 4 +- .../type_traits/is_default_constructible.md | 6 +- reference/type_traits/is_destructible.md | 4 +- reference/type_traits/is_empty.md | 4 +- reference/type_traits/is_enum.md | 4 +- reference/type_traits/is_final.md | 6 +- reference/type_traits/is_floating_point.md | 4 +- reference/type_traits/is_function.md | 4 +- reference/type_traits/is_fundamental.md | 4 +- reference/type_traits/is_integral.md | 4 +- reference/type_traits/is_invocable.md | 2 +- reference/type_traits/is_invocable_r.md | 2 +- reference/type_traits/is_layout_compatible.md | 2 +- reference/type_traits/is_literal_type.md | 6 +- reference/type_traits/is_lvalue_reference.md | 4 +- .../type_traits/is_member_function_pointer.md | 4 +- .../type_traits/is_member_object_pointer.md | 4 +- reference/type_traits/is_member_pointer.md | 4 +- reference/type_traits/is_move_assignable.md | 4 +- .../type_traits/is_move_constructible.md | 4 +- .../type_traits/is_nothrow_assignable.md | 6 +- .../type_traits/is_nothrow_constructible.md | 4 +- .../type_traits/is_nothrow_convertible.md | 4 +- .../type_traits/is_nothrow_copy_assignable.md | 6 +- .../is_nothrow_copy_constructible.md | 4 +- .../is_nothrow_default_constructible.md | 4 +- .../type_traits/is_nothrow_destructible.md | 6 +- reference/type_traits/is_nothrow_invocable.md | 2 +- .../type_traits/is_nothrow_invocable_r.md | 2 +- .../type_traits/is_nothrow_move_assignable.md | 6 +- .../is_nothrow_move_constructible.md | 6 +- reference/type_traits/is_nothrow_swappable.md | 2 +- .../type_traits/is_nothrow_swappable_with.md | 2 +- reference/type_traits/is_null_pointer.md | 6 +- reference/type_traits/is_object.md | 4 +- reference/type_traits/is_pod.md | 4 +- reference/type_traits/is_pointer.md | 4 +- reference/type_traits/is_polymorphic.md | 4 +- reference/type_traits/is_reference.md | 4 +- reference/type_traits/is_rvalue_reference.md | 4 +- reference/type_traits/is_same.md | 4 +- reference/type_traits/is_scalar.md | 4 +- reference/type_traits/is_scoped_enum.md | 2 +- reference/type_traits/is_signed.md | 4 +- reference/type_traits/is_standard_layout.md | 6 +- reference/type_traits/is_swappable.md | 2 +- reference/type_traits/is_swappable_with.md | 2 +- reference/type_traits/is_trivial.md | 4 +- .../type_traits/is_trivially_assignable.md | 6 +- .../type_traits/is_trivially_constructible.md | 6 +- .../is_trivially_copy_assignable.md | 6 +- .../is_trivially_copy_constructible.md | 6 +- .../type_traits/is_trivially_copyable.md | 6 +- .../is_trivially_default_constructible.md | 6 +- .../type_traits/is_trivially_destructible.md | 6 +- .../is_trivially_move_assignable.md | 6 +- .../is_trivially_move_constructible.md | 6 +- reference/type_traits/is_unbounded_array.md | 4 +- reference/type_traits/is_union.md | 4 +- reference/type_traits/is_unsigned.md | 4 +- reference/type_traits/is_void.md | 4 +- reference/type_traits/is_volatile.md | 4 +- reference/type_traits/make_signed.md | 6 +- reference/type_traits/make_unsigned.md | 6 +- reference/type_traits/negation.md | 6 +- reference/type_traits/rank.md | 6 +- reference/type_traits/remove_all_extents.md | 6 +- reference/type_traits/remove_const.md | 6 +- reference/type_traits/remove_cv.md | 6 +- reference/type_traits/remove_cvref.md | 2 +- reference/type_traits/remove_extent.md | 6 +- reference/type_traits/remove_pointer.md | 6 +- reference/type_traits/remove_reference.md | 6 +- reference/type_traits/remove_volatile.md | 6 +- reference/type_traits/result_of.md | 6 +- reference/type_traits/true_type.md | 6 +- reference/type_traits/type_identity.md | 4 +- reference/type_traits/underlying_type.md | 12 +- reference/type_traits/unwrap_ref_decay.md | 4 +- reference/type_traits/unwrap_reference.md | 4 +- reference/type_traits/void_t.md | 6 +- reference/typeindex/type_index.md | 4 +- reference/typeindex/type_index/hash_code.md | 4 +- reference/typeindex/type_index/name.md | 4 +- .../typeindex/type_index/op_compare_3way.md | 2 +- .../typeindex/type_index/op_constructor.md | 4 +- reference/typeindex/type_index/op_equal.md | 4 +- reference/typeindex/type_index/op_greater.md | 4 +- .../typeindex/type_index/op_greater_equal.md | 4 +- reference/typeindex/type_index/op_less.md | 4 +- .../typeindex/type_index/op_less_equal.md | 4 +- .../typeindex/type_index/op_not_equal.md | 4 +- reference/typeinfo/type_info/hash_code.md | 4 +- reference/unordered_map/unordered_map/at.md | 2 +- .../unordered_map/begin-size_type.md | 4 +- .../unordered_map/unordered_map/begin.md | 4 +- .../unordered_map/unordered_map/bucket.md | 4 +- .../unordered_map/bucket_count.md | 4 +- .../unordered_map/bucket_size.md | 4 +- .../unordered_map/cbegin-size_type.md | 4 +- .../unordered_map/unordered_map/cbegin.md | 4 +- .../unordered_map/cend-size_type.md | 4 +- reference/unordered_map/unordered_map/cend.md | 4 +- .../unordered_map/unordered_map/clear.md | 4 +- .../unordered_map/unordered_map/contains.md | 4 +- .../unordered_map/unordered_map/count.md | 2 +- .../unordered_map/unordered_map/emplace.md | 4 +- .../unordered_map/emplace_hint.md | 4 +- .../unordered_map/unordered_map/empty.md | 4 +- .../unordered_map/end-size_type.md | 4 +- reference/unordered_map/unordered_map/end.md | 4 +- .../unordered_map/equal_range.md | 2 +- .../unordered_map/unordered_map/erase.md | 4 +- .../unordered_map/erase_if_free.md | 4 +- .../unordered_map/unordered_map/extract.md | 6 +- reference/unordered_map/unordered_map/find.md | 2 +- .../unordered_map/get_allocator.md | 6 +- .../unordered_map/hash_function.md | 4 +- .../unordered_map/unordered_map/insert.md | 4 +- .../unordered_map/insert_or_assign.md | 4 +- .../unordered_map/unordered_map/key_eq.md | 4 +- .../unordered_map/load_factor.md | 2 +- .../unordered_map/max_bucket_count.md | 4 +- .../unordered_map/max_load_factor.md | 2 +- .../unordered_map/unordered_map/max_size.md | 4 +- .../unordered_map/unordered_map/merge.md | 6 +- .../unordered_map/unordered_map/op_assign.md | 4 +- .../unordered_map/unordered_map/op_at.md | 2 +- .../unordered_map/op_constructor.md | 4 +- .../unordered_map/op_destructor.md | 4 +- .../unordered_map/unordered_map/op_equal.md | 2 +- .../unordered_map/op_not_equal.md | 2 +- .../unordered_map/unordered_map/rehash.md | 6 +- .../unordered_map/unordered_map/reserve.md | 6 +- reference/unordered_map/unordered_map/size.md | 4 +- reference/unordered_map/unordered_map/swap.md | 4 +- .../unordered_map/unordered_map/swap_free.md | 2 +- .../unordered_map/try_emplace.md | 4 +- .../unordered_multimap/begin-size_type.md | 4 +- .../unordered_map/unordered_multimap/begin.md | 4 +- .../unordered_multimap/bucket.md | 4 +- .../unordered_multimap/bucket_count.md | 4 +- .../unordered_multimap/bucket_size.md | 4 +- .../unordered_multimap/cbegin-size_type.md | 4 +- .../unordered_multimap/cbegin.md | 4 +- .../unordered_multimap/cend-size_type.md | 4 +- .../unordered_map/unordered_multimap/cend.md | 4 +- .../unordered_map/unordered_multimap/clear.md | 4 +- .../unordered_multimap/contains.md | 4 +- .../unordered_map/unordered_multimap/count.md | 2 +- .../unordered_multimap/emplace.md | 4 +- .../unordered_multimap/emplace_hint.md | 4 +- .../unordered_map/unordered_multimap/empty.md | 4 +- .../unordered_multimap/end-size_type.md | 4 +- .../unordered_map/unordered_multimap/end.md | 4 +- .../unordered_multimap/equal_range.md | 2 +- .../unordered_map/unordered_multimap/erase.md | 4 +- .../unordered_multimap/erase_if_free.md | 4 +- .../unordered_multimap/extract.md | 6 +- .../unordered_map/unordered_multimap/find.md | 2 +- .../unordered_multimap/get_allocator.md | 6 +- .../unordered_multimap/hash_function.md | 4 +- .../unordered_multimap/insert.md | 4 +- .../unordered_multimap/key_eq.md | 4 +- .../unordered_multimap/load_factor.md | 2 +- .../unordered_multimap/max_bucket_count.md | 4 +- .../unordered_multimap/max_load_factor.md | 2 +- .../unordered_multimap/max_size.md | 4 +- .../unordered_map/unordered_multimap/merge.md | 6 +- .../unordered_multimap/op_assign.md | 4 +- .../unordered_multimap/op_constructor.md | 4 +- .../unordered_multimap/op_destructor.md | 4 +- .../unordered_multimap/op_equal.md | 2 +- .../unordered_multimap/op_not_equal.md | 2 +- .../unordered_multimap/rehash.md | 6 +- .../unordered_multimap/reserve.md | 6 +- .../unordered_map/unordered_multimap/size.md | 4 +- .../unordered_map/unordered_multimap/swap.md | 4 +- .../unordered_multimap/swap_free.md | 2 +- .../unordered_multiset/begin-size_type.md | 4 +- .../unordered_set/unordered_multiset/begin.md | 4 +- .../unordered_multiset/bucket.md | 4 +- .../unordered_multiset/bucket_count.md | 4 +- .../unordered_multiset/bucket_size.md | 4 +- .../unordered_multiset/cbegin-size_type.md | 4 +- .../unordered_multiset/cbegin.md | 4 +- .../unordered_multiset/cend-size_type.md | 4 +- .../unordered_set/unordered_multiset/cend.md | 4 +- .../unordered_set/unordered_multiset/clear.md | 4 +- .../unordered_multiset/contains.md | 4 +- .../unordered_set/unordered_multiset/count.md | 4 +- .../unordered_multiset/emplace.md | 4 +- .../unordered_multiset/emplace_hint.md | 4 +- .../unordered_set/unordered_multiset/empty.md | 4 +- .../unordered_multiset/end-size_type.md | 4 +- .../unordered_set/unordered_multiset/end.md | 4 +- .../unordered_multiset/equal_range.md | 4 +- .../unordered_set/unordered_multiset/erase.md | 4 +- .../unordered_multiset/erase_if_free.md | 4 +- .../unordered_multiset/extract.md | 6 +- .../unordered_set/unordered_multiset/find.md | 4 +- .../unordered_multiset/get_allocator.md | 6 +- .../unordered_multiset/hash_function.md | 4 +- .../unordered_multiset/insert.md | 4 +- .../unordered_multiset/key_eq.md | 4 +- .../unordered_multiset/load_factor.md | 4 +- .../unordered_multiset/max_bucket_count.md | 4 +- .../unordered_multiset/max_load_factor.md | 4 +- .../unordered_multiset/max_size.md | 4 +- .../unordered_set/unordered_multiset/merge.md | 6 +- .../unordered_multiset/op_assign.md | 4 +- .../unordered_multiset/op_constructor.md | 4 +- .../unordered_multiset/op_destructor.md | 4 +- .../unordered_multiset/op_equal.md | 4 +- .../unordered_multiset/op_not_equal.md | 4 +- .../unordered_multiset/rehash.md | 4 +- .../unordered_multiset/reserve.md | 4 +- .../unordered_set/unordered_multiset/size.md | 4 +- .../unordered_set/unordered_multiset/swap.md | 4 +- .../unordered_multiset/swap_free.md | 4 +- .../unordered_set/begin-size_type.md | 4 +- .../unordered_set/unordered_set/begin.md | 4 +- .../unordered_set/unordered_set/bucket.md | 4 +- .../unordered_set/bucket_count.md | 4 +- .../unordered_set/bucket_size.md | 4 +- .../unordered_set/cbegin-size_type.md | 4 +- .../unordered_set/unordered_set/cbegin.md | 4 +- .../unordered_set/cend-size_type.md | 4 +- reference/unordered_set/unordered_set/cend.md | 4 +- .../unordered_set/unordered_set/clear.md | 4 +- .../unordered_set/unordered_set/contains.md | 4 +- .../unordered_set/unordered_set/count.md | 4 +- .../unordered_set/unordered_set/emplace.md | 4 +- .../unordered_set/emplace_hint.md | 4 +- .../unordered_set/unordered_set/empty.md | 4 +- .../unordered_set/end-size_type.md | 4 +- reference/unordered_set/unordered_set/end.md | 4 +- .../unordered_set/equal_range.md | 4 +- .../unordered_set/unordered_set/erase.md | 4 +- .../unordered_set/erase_if_free.md | 4 +- .../unordered_set/unordered_set/extract.md | 6 +- reference/unordered_set/unordered_set/find.md | 4 +- .../unordered_set/get_allocator.md | 6 +- .../unordered_set/hash_function.md | 4 +- .../unordered_set/unordered_set/insert.md | 4 +- .../unordered_set/unordered_set/key_eq.md | 4 +- .../unordered_set/load_factor.md | 4 +- .../unordered_set/max_bucket_count.md | 4 +- .../unordered_set/max_load_factor.md | 4 +- .../unordered_set/unordered_set/max_size.md | 4 +- .../unordered_set/unordered_set/merge.md | 6 +- .../unordered_set/unordered_set/op_assign.md | 4 +- .../unordered_set/op_constructor.md | 4 +- .../unordered_set/op_destructor.md | 4 +- .../unordered_set/unordered_set/op_equal.md | 4 +- .../unordered_set/op_not_equal.md | 4 +- .../unordered_set/unordered_set/rehash.md | 4 +- .../unordered_set/unordered_set/reserve.md | 4 +- reference/unordered_set/unordered_set/size.md | 4 +- reference/unordered_set/unordered_set/swap.md | 4 +- .../unordered_set/unordered_set/swap_free.md | 4 +- reference/utility/as_const.md | 6 +- reference/utility/cmp_equal.md | 4 +- reference/utility/cmp_greater.md | 4 +- reference/utility/cmp_greater_equal.md | 4 +- reference/utility/cmp_less.md | 4 +- reference/utility/cmp_less_equal.md | 4 +- reference/utility/cmp_not_equal.md | 4 +- reference/utility/declval.md | 4 +- reference/utility/exchange.md | 6 +- reference/utility/forward.md | 4 +- reference/utility/forward_like.md | 4 +- reference/utility/in_place_index_t.md | 4 +- reference/utility/in_place_t.md | 4 +- reference/utility/in_place_type_t.md | 4 +- reference/utility/in_range.md | 4 +- reference/utility/index_sequence.md | 6 +- reference/utility/index_sequence_for.md | 6 +- reference/utility/integer_sequence.md | 6 +- reference/utility/make_index_sequence.md | 6 +- reference/utility/make_integer_sequence.md | 6 +- reference/utility/move.md | 4 +- reference/utility/move_if_noexcept.md | 4 +- reference/utility/pair/common_type.md | 6 +- reference/utility/pair/get.md | 4 +- reference/utility/pair/op_assign.md | 4 +- reference/utility/pair/op_constructor.md | 4 +- reference/utility/pair/op_deduction_guide.md | 2 +- reference/utility/pair/tuple_element.md | 4 +- reference/utility/pair/tuple_size.md | 4 +- reference/utility/piecewise_construct_t.md | 4 +- reference/utility/swap.md | 4 +- reference/utility/to_underlying.md | 4 +- reference/utility/unreachable.md | 4 +- reference/valarray/slice/op_equal.md | 2 +- reference/valarray/valarray/begin_free.md | 4 +- reference/valarray/valarray/end_free.md | 4 +- .../valarray/valarray/op_deduction_guide.md | 2 +- reference/valarray/valarray/swap.md | 4 +- reference/valarray/valarray/swap_free.md | 4 +- reference/variant/bad_variant_access.md | 4 +- reference/variant/holds_alternative.md | 4 +- reference/variant/monostate.md | 4 +- reference/variant/variant.md | 4 +- reference/variant/variant/emplace.md | 4 +- reference/variant/variant/get.md | 4 +- reference/variant/variant/get_if.md | 4 +- reference/variant/variant/index.md | 4 +- reference/variant/variant/op_assign.md | 4 +- reference/variant/variant/op_compare_3way.md | 2 +- reference/variant/variant/op_constructor.md | 4 +- reference/variant/variant/op_destructor.md | 4 +- reference/variant/variant/op_equal.md | 4 +- reference/variant/variant/op_greater.md | 4 +- reference/variant/variant/op_greater_equal.md | 4 +- reference/variant/variant/op_less.md | 4 +- reference/variant/variant/op_less_equal.md | 4 +- reference/variant/variant/op_not_equal.md | 4 +- reference/variant/variant/swap.md | 4 +- reference/variant/variant/swap_free.md | 4 +- .../variant/variant/valueless_by_exception.md | 4 +- reference/variant/variant_alternative.md | 4 +- reference/variant/variant_npos.md | 4 +- reference/variant/variant_size.md | 4 +- reference/variant/visit.md | 4 +- reference/vector/vector/cbegin.md | 4 +- reference/vector/vector/cend.md | 4 +- reference/vector/vector/crbegin.md | 4 +- reference/vector/vector/crend.md | 4 +- reference/vector/vector/data.md | 2 +- reference/vector/vector/emplace.md | 4 +- reference/vector/vector/emplace_back.md | 4 +- reference/vector/vector/erase_free.md | 4 +- reference/vector/vector/erase_if_free.md | 4 +- reference/vector/vector/get_allocator.md | 4 +- reference/vector/vector/op_compare_3way.md | 2 +- reference/vector/vector/op_deduction_guide.md | 2 +- reference/vector/vector/shrink_to_fit.md | 4 +- start_editing.md | 4 +- start_editing/class_template_page.md | 8 +- .../comparison_operator_template_page.md | 8 +- start_editing/concept_template_page.md | 8 +- start_editing/cpo_template_page.md | 4 +- start_editing/function_template_page.md | 8 +- start_editing/header_template_page.md | 8 +- start_editing/type-type_template_page.md | 8 +- 3369 files changed, 7028 insertions(+), 7028 deletions(-) diff --git a/reference/algorithm/all_of.md b/reference/algorithm/all_of.md index ec04e3446d..120a261023 100644 --- a/reference/algorithm/all_of.md +++ b/reference/algorithm/all_of.md @@ -79,10 +79,10 @@ bool all_of(InputIterator first, InputIterator last, Predicate pred) { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.4.7 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 関連項目 diff --git a/reference/algorithm/any_of.md b/reference/algorithm/any_of.md index bed2177538..1923e1dbea 100644 --- a/reference/algorithm/any_of.md +++ b/reference/algorithm/any_of.md @@ -81,9 +81,9 @@ bool any_of(InputIterator first, InputIterator last, Predicate pred) { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.4.7 -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 関連項目 diff --git a/reference/algorithm/clamp.md b/reference/algorithm/clamp.md index 5bd6c23d58..1500a095f9 100644 --- a/reference/algorithm/clamp.md +++ b/reference/algorithm/clamp.md @@ -73,8 +73,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 3.9 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 3.9 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/algorithm/copy_if.md b/reference/algorithm/copy_if.md index c6584609ae..17c3b4e12b 100644 --- a/reference/algorithm/copy_if.md +++ b/reference/algorithm/copy_if.md @@ -106,9 +106,9 @@ OutputIterator copy_if(InputIterator first, InputIterator last, - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.4.7 -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/algorithm/copy_n.md b/reference/algorithm/copy_n.md index 529f8ce0c1..4e495dcde2 100644 --- a/reference/algorithm/copy_n.md +++ b/reference/algorithm/copy_n.md @@ -84,9 +84,9 @@ OutputIterator copy_n(InputIterator first, Size n, OutputIterator result) { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.4.7 -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/algorithm/equal.md b/reference/algorithm/equal.md index 1d5fc2195e..513364df01 100644 --- a/reference/algorithm/equal.md +++ b/reference/algorithm/equal.md @@ -214,10 +214,10 @@ inline bool equal(InputIterator1 first1, InputIterator1 last1, - C++14: 2つ目の終端のイテレータ`last2`を実引数に取るオーバーロードの追加。 ### 処理系(last2を受け取るバージョン) -- [Clang](/implementation.md#clang): 3.4 -- [GCC](/implementation.md#gcc): 4.9 +- [Clang](/implementation.md#clang): 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.9 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] ## 参照 diff --git a/reference/algorithm/fill_n.md b/reference/algorithm/fill_n.md index 4cecdfdad7..d737860ca2 100644 --- a/reference/algorithm/fill_n.md +++ b/reference/algorithm/fill_n.md @@ -98,7 +98,7 @@ fill_n(OutputIterator first, Size n, const T& value) { - [Clang](/implementation.md#clang): - [GCC](/implementation.md#gcc): - [ICC](/implementation.md#icc): -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - C++11への対応(戻り値の変更)は2012から。 diff --git a/reference/algorithm/for_each.md b/reference/algorithm/for_each.md index 5f705128bc..1dace08230 100644 --- a/reference/algorithm/for_each.md +++ b/reference/algorithm/for_each.md @@ -142,7 +142,7 @@ int main() { - [Clang](/implementation.md#clang): - [GCC](/implementation.md#gcc): - [ICC](/implementation.md#icc): -- [Visual C++](/implementation.md#visual_cpp): 2005, 2008, 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2005 [mark verified], 2008 [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - C++11への対応(戻り値のムーブ)は2012から。 diff --git a/reference/algorithm/for_each_n.md b/reference/algorithm/for_each_n.md index b8f6885065..452705bc0a 100644 --- a/reference/algorithm/for_each_n.md +++ b/reference/algorithm/for_each_n.md @@ -89,8 +89,8 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 5.0 -- [GCC](/implementation.md#gcc): 9.3 +- [Clang](/implementation.md#clang): 5.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/algorithm/generate_n.md b/reference/algorithm/generate_n.md index 4d40bb1c47..a858e03a9d 100644 --- a/reference/algorithm/generate_n.md +++ b/reference/algorithm/generate_n.md @@ -104,7 +104,7 @@ generate_n(OutputIterator first, Size n, Generator gen) { - [Clang](/implementation.md#clang): - [GCC](/implementation.md#gcc): - [ICC](/implementation.md#icc): -- [Visual C++](/implementation.md#visual_cpp): 2005, 2008, 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2005 [mark verified], 2008 [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - C++11への対応(戻り値の変更)は2012から。 diff --git a/reference/algorithm/is_heap.md b/reference/algorithm/is_heap.md index ac5d29bc5b..6498b559b7 100644 --- a/reference/algorithm/is_heap.md +++ b/reference/algorithm/is_heap.md @@ -83,9 +83,9 @@ before: is heap? false ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2008では、`_HAS_TRADITIONAL_STL`を1に定義してから``をインクルードすると、`stdext`名前空間で`is_heap`が定義される。 diff --git a/reference/algorithm/is_heap_until.md b/reference/algorithm/is_heap_until.md index 693f054781..094cb609c7 100644 --- a/reference/algorithm/is_heap_until.md +++ b/reference/algorithm/is_heap_until.md @@ -124,9 +124,9 @@ RandomAccessIterator is_heap_until(RandomAccessIterator first, RandomAccessItera ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/algorithm/is_partitioned.md b/reference/algorithm/is_partitioned.md index f1e7a758df..94506f9508 100644 --- a/reference/algorithm/is_partitioned.md +++ b/reference/algorithm/is_partitioned.md @@ -105,9 +105,9 @@ bool is_partitioned(InputIterator first, InputIterator last, Predicate pred) ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/algorithm/is_permutation.md b/reference/algorithm/is_permutation.md index bfab19d412..40483f8a42 100644 --- a/reference/algorithm/is_permutation.md +++ b/reference/algorithm/is_permutation.md @@ -219,9 +219,9 @@ bool is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - C++14で追加されたオーバーロードは2015から実装されている。 ## 参照 diff --git a/reference/algorithm/is_sorted.md b/reference/algorithm/is_sorted.md index e318ba717c..f0c2de657f 100644 --- a/reference/algorithm/is_sorted.md +++ b/reference/algorithm/is_sorted.md @@ -77,9 +77,9 @@ before: is sorted? false ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2008では、`_HAS_TRADITIONAL_STL`を1に定義してから``をインクルードすると、`stdext`名前空間で`is_sorted`が定義される。 diff --git a/reference/algorithm/is_sorted_until.md b/reference/algorithm/is_sorted_until.md index 01bda45f70..621f615d06 100644 --- a/reference/algorithm/is_sorted_until.md +++ b/reference/algorithm/is_sorted_until.md @@ -106,9 +106,9 @@ ForwardIterator is_sorted_until(ForwardIterator first, ForwardIterator last) ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/algorithm/lexicographical_compare_three_way.md b/reference/algorithm/lexicographical_compare_three_way.md index 7daeae3f09..c09cff5426 100644 --- a/reference/algorithm/lexicographical_compare_three_way.md +++ b/reference/algorithm/lexicographical_compare_three_way.md @@ -128,7 +128,7 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? ## 関連項目 diff --git a/reference/algorithm/max.md b/reference/algorithm/max.md index 6c77147b97..1366d76d3e 100644 --- a/reference/algorithm/max.md +++ b/reference/algorithm/max.md @@ -114,9 +114,9 @@ T max(std::initializer_list t, Compare comp) ## initializer_listバージョンの使用可能状況 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] ### 備考 Windows環境においては、``をインクルードすると`max`という名前の関数マクロが定義され、`std::max()`と衝突してしまうという問題がある。 diff --git a/reference/algorithm/min.md b/reference/algorithm/min.md index 1641510429..d4915042c0 100644 --- a/reference/algorithm/min.md +++ b/reference/algorithm/min.md @@ -114,9 +114,9 @@ T min(std::initializer_list t, Compare comp) ## initializer_listバージョンの使用可能状況 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0(initializer_listバージョンが使用可能) +- [GCC](/implementation.md#gcc): 4.7.0(initializer_listバージョンが使用可能) [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] ### 備考 Windows環境においては、``をインクルードすると`min`という名前の関数マクロが定義され、`std::min()`と衝突してしまうという問題がある。 diff --git a/reference/algorithm/minmax.md b/reference/algorithm/minmax.md index 1d9c9a1b0b..5737f9fcf8 100644 --- a/reference/algorithm/minmax.md +++ b/reference/algorithm/minmax.md @@ -146,9 +146,9 @@ std::pair minmax(std::initializer_list init, Compare comp) ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/algorithm/minmax_element.md b/reference/algorithm/minmax_element.md index 793742ceac..a82470b608 100644 --- a/reference/algorithm/minmax_element.md +++ b/reference/algorithm/minmax_element.md @@ -155,9 +155,9 @@ minmax_element(ForwardIterator first, ForwardIterator last) ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/algorithm/mismatch.md b/reference/algorithm/mismatch.md index 836f183685..0e8d63fdbe 100644 --- a/reference/algorithm/mismatch.md +++ b/reference/algorithm/mismatch.md @@ -188,7 +188,7 @@ std::pair mismatch( - [Clang](/implementation.md#clang): ? - [GCC](/implementation.md#gcc): ? - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2005, 2008, 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2005 [mark verified], 2008 [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - C++14で追加されたオーバーロードは2015から実装されている。 ## 参照 diff --git a/reference/algorithm/move.md b/reference/algorithm/move.md index ce9929e354..a52904c38a 100644 --- a/reference/algorithm/move.md +++ b/reference/algorithm/move.md @@ -102,10 +102,10 @@ OutputIterator move(InputIterator first, InputIterator last, OutputIterator resu ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 関連項目 diff --git a/reference/algorithm/move_backward.md b/reference/algorithm/move_backward.md index 693928b9ce..460289ed1d 100644 --- a/reference/algorithm/move_backward.md +++ b/reference/algorithm/move_backward.md @@ -107,10 +107,10 @@ BidirectionalIterator2 move_backward(BidirectionalIterator1 first, Bidirectional ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 関連項目 diff --git a/reference/algorithm/none_of.md b/reference/algorithm/none_of.md index 4af4718ed8..77520c8add 100644 --- a/reference/algorithm/none_of.md +++ b/reference/algorithm/none_of.md @@ -90,10 +90,10 @@ bool none_of(InputIterator first, InputIterator last, Predicate pred) { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.4.7 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 関連項目 diff --git a/reference/algorithm/partition_copy.md b/reference/algorithm/partition_copy.md index adf6fc8128..7c9d56c799 100644 --- a/reference/algorithm/partition_copy.md +++ b/reference/algorithm/partition_copy.md @@ -121,9 +121,9 @@ odds : 1,3,5, ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/algorithm/partition_point.md b/reference/algorithm/partition_point.md index 433353398d..c32df28146 100644 --- a/reference/algorithm/partition_point.md +++ b/reference/algorithm/partition_point.md @@ -108,9 +108,9 @@ partition_point(ForwardIterator first, ForwardIterator last, Predicate pred) ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/algorithm/ranges_adjacent_find.md b/reference/algorithm/ranges_adjacent_find.md index 75e712ffea..03572230ec 100644 --- a/reference/algorithm/ranges_adjacent_find.md +++ b/reference/algorithm/ranges_adjacent_find.md @@ -154,9 +154,9 @@ inline constexpr adjacent_find_impl adjacent_find; ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_all_of.md b/reference/algorithm/ranges_all_of.md index f7e7fa8d99..28dbf31ca9 100644 --- a/reference/algorithm/ranges_all_of.md +++ b/reference/algorithm/ranges_all_of.md @@ -112,9 +112,9 @@ inline constexpr all_of_impl all_of; ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 diff --git a/reference/algorithm/ranges_any_of.md b/reference/algorithm/ranges_any_of.md index ef983c43d3..72d7dc4f59 100644 --- a/reference/algorithm/ranges_any_of.md +++ b/reference/algorithm/ranges_any_of.md @@ -114,9 +114,9 @@ inline constexpr any_of_impl any_of; ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 diff --git a/reference/algorithm/ranges_binary_search.md b/reference/algorithm/ranges_binary_search.md index 744e28660d..54df913138 100644 --- a/reference/algorithm/ranges_binary_search.md +++ b/reference/algorithm/ranges_binary_search.md @@ -101,9 +101,9 @@ found ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_clamp.md b/reference/algorithm/ranges_clamp.md index a4098951c0..8dbf408023 100644 --- a/reference/algorithm/ranges_clamp.md +++ b/reference/algorithm/ranges_clamp.md @@ -67,9 +67,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_copy.md b/reference/algorithm/ranges_copy.md index 6b1d7d137d..69f37d47d8 100644 --- a/reference/algorithm/ranges_copy.md +++ b/reference/algorithm/ranges_copy.md @@ -98,9 +98,9 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_copy_backward.md b/reference/algorithm/ranges_copy_backward.md index 23684cd666..c0de166b38 100644 --- a/reference/algorithm/ranges_copy_backward.md +++ b/reference/algorithm/ranges_copy_backward.md @@ -96,9 +96,9 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_copy_if.md b/reference/algorithm/ranges_copy_if.md index 228372a264..9aa7a1e0b6 100644 --- a/reference/algorithm/ranges_copy_if.md +++ b/reference/algorithm/ranges_copy_if.md @@ -103,9 +103,9 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_copy_n.md b/reference/algorithm/ranges_copy_n.md index 817d7ef2c4..5276890401 100644 --- a/reference/algorithm/ranges_copy_n.md +++ b/reference/algorithm/ranges_copy_n.md @@ -74,9 +74,9 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_count.md b/reference/algorithm/ranges_count.md index b8977916e1..95b91a81ae 100644 --- a/reference/algorithm/ranges_count.md +++ b/reference/algorithm/ranges_count.md @@ -118,9 +118,9 @@ inline constexpr count_impl count; ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_count_if.md b/reference/algorithm/ranges_count_if.md index c7510032d8..ab67dca231 100644 --- a/reference/algorithm/ranges_count_if.md +++ b/reference/algorithm/ranges_count_if.md @@ -116,9 +116,9 @@ inline constexpr count_if_impl count_if; ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_equal.md b/reference/algorithm/ranges_equal.md index 8b5fbc3711..1b3cadf1b5 100644 --- a/reference/algorithm/ranges_equal.md +++ b/reference/algorithm/ranges_equal.md @@ -138,9 +138,9 @@ inline constexpr equal_impl equal; ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_equal_range.md b/reference/algorithm/ranges_equal_range.md index a3a94c7133..a580318ff1 100644 --- a/reference/algorithm/ranges_equal_range.md +++ b/reference/algorithm/ranges_equal_range.md @@ -108,9 +108,9 @@ size: 0 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_fill.md b/reference/algorithm/ranges_fill.md index cf639f76f1..4726a288fc 100644 --- a/reference/algorithm/ranges_fill.md +++ b/reference/algorithm/ranges_fill.md @@ -73,9 +73,9 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_fill_n.md b/reference/algorithm/ranges_fill_n.md index 690d0ad500..4ccd268ed8 100644 --- a/reference/algorithm/ranges_fill_n.md +++ b/reference/algorithm/ranges_fill_n.md @@ -55,9 +55,9 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_find.md b/reference/algorithm/ranges_find.md index deb2ea76be..970c503058 100644 --- a/reference/algorithm/ranges_find.md +++ b/reference/algorithm/ranges_find.md @@ -114,9 +114,9 @@ inline constexpr find_impl find; ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_find_end.md b/reference/algorithm/ranges_find_end.md index 7585026475..ef0bc69de2 100644 --- a/reference/algorithm/ranges_find_end.md +++ b/reference/algorithm/ranges_find_end.md @@ -123,9 +123,9 @@ inline constexpr find_end_impl find_end; ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_find_first_of.md b/reference/algorithm/ranges_find_first_of.md index d917349513..9ed578762d 100644 --- a/reference/algorithm/ranges_find_first_of.md +++ b/reference/algorithm/ranges_find_first_of.md @@ -138,9 +138,9 @@ inline constexpr find_first_of_impl find_first_of; ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_find_if.md b/reference/algorithm/ranges_find_if.md index 94d46985fe..cd50115033 100644 --- a/reference/algorithm/ranges_find_if.md +++ b/reference/algorithm/ranges_find_if.md @@ -111,9 +111,9 @@ inline constexpr find_if_impl find_if; ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_find_if_not.md b/reference/algorithm/ranges_find_if_not.md index 64d460c452..50d8439db7 100644 --- a/reference/algorithm/ranges_find_if_not.md +++ b/reference/algorithm/ranges_find_if_not.md @@ -111,9 +111,9 @@ inline constexpr find_if_not_impl find_if_not; ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_fold_left.md b/reference/algorithm/ranges_fold_left.md index 4fbb3a19b5..3477c8c6d4 100644 --- a/reference/algorithm/ranges_fold_left.md +++ b/reference/algorithm/ranges_fold_left.md @@ -253,8 +253,8 @@ constexpr auto fold_left(I first, S last, T init, F f) { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 5 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 5 [mark verified] ## 関連項目 diff --git a/reference/algorithm/ranges_fold_left_first.md b/reference/algorithm/ranges_fold_left_first.md index ae2564d50c..0365a1065e 100644 --- a/reference/algorithm/ranges_fold_left_first.md +++ b/reference/algorithm/ranges_fold_left_first.md @@ -191,8 +191,8 @@ constexpr auto fold_left_first(I first, S last, F f) { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 5 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 5 [mark verified] ## 関連項目 diff --git a/reference/algorithm/ranges_fold_left_first_with_iter.md b/reference/algorithm/ranges_fold_left_first_with_iter.md index 3a097dd8a7..9f17f8c109 100644 --- a/reference/algorithm/ranges_fold_left_first_with_iter.md +++ b/reference/algorithm/ranges_fold_left_first_with_iter.md @@ -273,8 +273,8 @@ constexpr auto fold_left_first_with_iter(I first, S last, F f) ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 5 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 5 [mark verified] ## 関連項目 diff --git a/reference/algorithm/ranges_fold_left_with_iter.md b/reference/algorithm/ranges_fold_left_with_iter.md index 9dc5bddf78..a1e264bbcb 100644 --- a/reference/algorithm/ranges_fold_left_with_iter.md +++ b/reference/algorithm/ranges_fold_left_with_iter.md @@ -263,8 +263,8 @@ constexpr auto fold_left_with_iter(I first, S last, T init, F f) -> fold_left_wi ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 5 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 5 [mark verified] ## 関連項目 diff --git a/reference/algorithm/ranges_fold_right.md b/reference/algorithm/ranges_fold_right.md index 5d80277bf9..ea0c5ef57d 100644 --- a/reference/algorithm/ranges_fold_right.md +++ b/reference/algorithm/ranges_fold_right.md @@ -289,8 +289,8 @@ constexpr auto fold_right(I first, S last, T init, F f) { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 5 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 5 [mark verified] ## 関連項目 diff --git a/reference/algorithm/ranges_fold_right_last.md b/reference/algorithm/ranges_fold_right_last.md index 83877e710c..0aaef54729 100644 --- a/reference/algorithm/ranges_fold_right_last.md +++ b/reference/algorithm/ranges_fold_right_last.md @@ -204,8 +204,8 @@ constexpr auto fold_right_last(I first, S last, F f) { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 5 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 5 [mark verified] ## 関連項目 diff --git a/reference/algorithm/ranges_for_each.md b/reference/algorithm/ranges_for_each.md index 946d867c68..6ef38d2aa2 100644 --- a/reference/algorithm/ranges_for_each.md +++ b/reference/algorithm/ranges_for_each.md @@ -114,9 +114,9 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 実装例 diff --git a/reference/algorithm/ranges_for_each_n.md b/reference/algorithm/ranges_for_each_n.md index dd7b328cce..bddd5733c4 100644 --- a/reference/algorithm/ranges_for_each_n.md +++ b/reference/algorithm/ranges_for_each_n.md @@ -90,9 +90,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 実装例 diff --git a/reference/algorithm/ranges_generate.md b/reference/algorithm/ranges_generate.md index 174670b73c..3bc406c838 100644 --- a/reference/algorithm/ranges_generate.md +++ b/reference/algorithm/ranges_generate.md @@ -82,9 +82,9 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_generate_n.md b/reference/algorithm/ranges_generate_n.md index 69e58346d1..7db985b467 100644 --- a/reference/algorithm/ranges_generate_n.md +++ b/reference/algorithm/ranges_generate_n.md @@ -68,9 +68,9 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_in_found_result.md b/reference/algorithm/ranges_in_found_result.md index d910039f02..c392f6c709 100644 --- a/reference/algorithm/ranges_in_found_result.md +++ b/reference/algorithm/ranges_in_found_result.md @@ -93,9 +93,9 @@ int main () ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_in_fun_result.md b/reference/algorithm/ranges_in_fun_result.md index e75df53617..f9a16f4aaa 100644 --- a/reference/algorithm/ranges_in_fun_result.md +++ b/reference/algorithm/ranges_in_fun_result.md @@ -99,9 +99,9 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_in_in_out_result.md b/reference/algorithm/ranges_in_in_out_result.md index 0b36c8627e..55fcd85f18 100644 --- a/reference/algorithm/ranges_in_in_out_result.md +++ b/reference/algorithm/ranges_in_in_out_result.md @@ -119,9 +119,9 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_in_in_result.md b/reference/algorithm/ranges_in_in_result.md index db53b6812f..c75af14082 100644 --- a/reference/algorithm/ranges_in_in_result.md +++ b/reference/algorithm/ranges_in_in_result.md @@ -95,9 +95,9 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_in_out_out_result.md b/reference/algorithm/ranges_in_out_out_result.md index 44f050245b..207fd2f91a 100644 --- a/reference/algorithm/ranges_in_out_out_result.md +++ b/reference/algorithm/ranges_in_out_out_result.md @@ -107,9 +107,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_in_out_result.md b/reference/algorithm/ranges_in_out_result.md index 60a20ad34c..ba0241ad9e 100644 --- a/reference/algorithm/ranges_in_out_result.md +++ b/reference/algorithm/ranges_in_out_result.md @@ -163,9 +163,9 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_in_value_result.md b/reference/algorithm/ranges_in_value_result.md index ae2d991287..d38609df9f 100644 --- a/reference/algorithm/ranges_in_value_result.md +++ b/reference/algorithm/ranges_in_value_result.md @@ -79,8 +79,8 @@ namespace std::ranges { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 5 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 5 [mark verified] ## 参照 diff --git a/reference/algorithm/ranges_includes.md b/reference/algorithm/ranges_includes.md index 9d0571aab1..66f6cfda04 100644 --- a/reference/algorithm/ranges_includes.md +++ b/reference/algorithm/ranges_includes.md @@ -96,9 +96,9 @@ false ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_inplace_merge.md b/reference/algorithm/ranges_inplace_merge.md index 8127d7be71..3b5b73f0cc 100644 --- a/reference/algorithm/ranges_inplace_merge.md +++ b/reference/algorithm/ranges_inplace_merge.md @@ -106,9 +106,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_is_heap.md b/reference/algorithm/ranges_is_heap.md index 3d7cffe218..32159b8754 100644 --- a/reference/algorithm/ranges_is_heap.md +++ b/reference/algorithm/ranges_is_heap.md @@ -79,9 +79,9 @@ before: is heap? false ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_is_heap_until.md b/reference/algorithm/ranges_is_heap_until.md index 76bcc3e587..6eb790193a 100644 --- a/reference/algorithm/ranges_is_heap_until.md +++ b/reference/algorithm/ranges_is_heap_until.md @@ -83,9 +83,9 @@ before: is heap? false ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_is_partitioned.md b/reference/algorithm/ranges_is_partitioned.md index 7ae74b2104..ca6ede33be 100644 --- a/reference/algorithm/ranges_is_partitioned.md +++ b/reference/algorithm/ranges_is_partitioned.md @@ -97,9 +97,9 @@ partitioned ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_is_permutation.md b/reference/algorithm/ranges_is_permutation.md index c361920dbb..9ed6aa40c1 100644 --- a/reference/algorithm/ranges_is_permutation.md +++ b/reference/algorithm/ranges_is_permutation.md @@ -100,9 +100,9 @@ false ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_is_sorted.md b/reference/algorithm/ranges_is_sorted.md index 586de76580..5db4b0ce9b 100644 --- a/reference/algorithm/ranges_is_sorted.md +++ b/reference/algorithm/ranges_is_sorted.md @@ -78,9 +78,9 @@ before: is sorted? false ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_is_sorted_until.md b/reference/algorithm/ranges_is_sorted_until.md index ff1c746c0c..b06950f435 100644 --- a/reference/algorithm/ranges_is_sorted_until.md +++ b/reference/algorithm/ranges_is_sorted_until.md @@ -121,9 +121,9 @@ inline constexpr is_sorted_until_impl is_sorted_until; ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_lexicographical_compare.md b/reference/algorithm/ranges_lexicographical_compare.md index e85bdc7723..34deff6682 100644 --- a/reference/algorithm/ranges_lexicographical_compare.md +++ b/reference/algorithm/ranges_lexicographical_compare.md @@ -148,9 +148,9 @@ x less than y ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_lower_bound.md b/reference/algorithm/ranges_lower_bound.md index 096e3675bb..08c91d33a3 100644 --- a/reference/algorithm/ranges_lower_bound.md +++ b/reference/algorithm/ranges_lower_bound.md @@ -152,9 +152,9 @@ id=4 name=Bob pos=2 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_make_heap.md b/reference/algorithm/ranges_make_heap.md index 4679c8fc01..0525fa9cf3 100644 --- a/reference/algorithm/ranges_make_heap.md +++ b/reference/algorithm/ranges_make_heap.md @@ -88,9 +88,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_max.md b/reference/algorithm/ranges_max.md index 1fe53446fc..3a685af8a3 100644 --- a/reference/algorithm/ranges_max.md +++ b/reference/algorithm/ranges_max.md @@ -101,9 +101,9 @@ Windows環境においては、``をインクルードすると`max` ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_max_element.md b/reference/algorithm/ranges_max_element.md index 86a6dab8b9..7f4793388e 100644 --- a/reference/algorithm/ranges_max_element.md +++ b/reference/algorithm/ranges_max_element.md @@ -81,9 +81,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_merge.md b/reference/algorithm/ranges_merge.md index 234e721e61..a51a24e026 100644 --- a/reference/algorithm/ranges_merge.md +++ b/reference/algorithm/ranges_merge.md @@ -133,9 +133,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_min.md b/reference/algorithm/ranges_min.md index 67f024c652..c8fb0877e1 100644 --- a/reference/algorithm/ranges_min.md +++ b/reference/algorithm/ranges_min.md @@ -102,9 +102,9 @@ Windows環境においては、``をインクルードすると`min` ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_min_element.md b/reference/algorithm/ranges_min_element.md index 3b758bc3a0..72390b9137 100644 --- a/reference/algorithm/ranges_min_element.md +++ b/reference/algorithm/ranges_min_element.md @@ -84,9 +84,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_min_max_result.md b/reference/algorithm/ranges_min_max_result.md index 00bb96df58..2e6ae7e787 100644 --- a/reference/algorithm/ranges_min_max_result.md +++ b/reference/algorithm/ranges_min_max_result.md @@ -88,9 +88,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_minmax.md b/reference/algorithm/ranges_minmax.md index 2cbda0b5a1..bd5c656a0f 100644 --- a/reference/algorithm/ranges_minmax.md +++ b/reference/algorithm/ranges_minmax.md @@ -104,9 +104,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_minmax_element.md b/reference/algorithm/ranges_minmax_element.md index 69b9cb6afa..6a21cc38d4 100644 --- a/reference/algorithm/ranges_minmax_element.md +++ b/reference/algorithm/ranges_minmax_element.md @@ -88,9 +88,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_mismatch.md b/reference/algorithm/ranges_mismatch.md index d366cdcd9c..aaca10edee 100644 --- a/reference/algorithm/ranges_mismatch.md +++ b/reference/algorithm/ranges_mismatch.md @@ -165,9 +165,9 @@ inline constexpr mismatch_impl mismatch; ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 diff --git a/reference/algorithm/ranges_move.md b/reference/algorithm/ranges_move.md index 7b4fe35e0b..0b75f515ce 100644 --- a/reference/algorithm/ranges_move.md +++ b/reference/algorithm/ranges_move.md @@ -103,9 +103,9 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_move_backward.md b/reference/algorithm/ranges_move_backward.md index f649a4a920..6bf0da0be5 100644 --- a/reference/algorithm/ranges_move_backward.md +++ b/reference/algorithm/ranges_move_backward.md @@ -114,9 +114,9 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_next_permutation.md b/reference/algorithm/ranges_next_permutation.md index 1d8b6a8aac..f06b19554a 100644 --- a/reference/algorithm/ranges_next_permutation.md +++ b/reference/algorithm/ranges_next_permutation.md @@ -115,9 +115,9 @@ int main () ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_none_of.md b/reference/algorithm/ranges_none_of.md index e90173df91..997ced252d 100644 --- a/reference/algorithm/ranges_none_of.md +++ b/reference/algorithm/ranges_none_of.md @@ -131,9 +131,9 @@ inline constexpr none_of_impl none_of; ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 diff --git a/reference/algorithm/ranges_nth_element.md b/reference/algorithm/ranges_nth_element.md index a606db0968..bcd69094bf 100644 --- a/reference/algorithm/ranges_nth_element.md +++ b/reference/algorithm/ranges_nth_element.md @@ -99,9 +99,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_partial_sort.md b/reference/algorithm/ranges_partial_sort.md index 9d5748cf87..cdd591a3f2 100644 --- a/reference/algorithm/ranges_partial_sort.md +++ b/reference/algorithm/ranges_partial_sort.md @@ -92,9 +92,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_partial_sort_copy.md b/reference/algorithm/ranges_partial_sort_copy.md index 1078006a7f..873c7d0261 100644 --- a/reference/algorithm/ranges_partial_sort_copy.md +++ b/reference/algorithm/ranges_partial_sort_copy.md @@ -118,9 +118,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_partition.md b/reference/algorithm/ranges_partition.md index fdf8f06f64..32aa4228cf 100644 --- a/reference/algorithm/ranges_partition.md +++ b/reference/algorithm/ranges_partition.md @@ -108,9 +108,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_partition_copy.md b/reference/algorithm/ranges_partition_copy.md index 92e2f44e3c..eee1911142 100644 --- a/reference/algorithm/ranges_partition_copy.md +++ b/reference/algorithm/ranges_partition_copy.md @@ -118,9 +118,9 @@ odds : 1,3,5, ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_partition_point.md b/reference/algorithm/ranges_partition_point.md index a6d4d9077e..5a9b01b8bd 100644 --- a/reference/algorithm/ranges_partition_point.md +++ b/reference/algorithm/ranges_partition_point.md @@ -99,9 +99,9 @@ v : 4,2,3,1,5, ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_pop_heap.md b/reference/algorithm/ranges_pop_heap.md index de502d680f..4e77d31d2e 100644 --- a/reference/algorithm/ranges_pop_heap.md +++ b/reference/algorithm/ranges_pop_heap.md @@ -100,9 +100,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_prev_permutation.md b/reference/algorithm/ranges_prev_permutation.md index fde5260635..0f8dfb4eb2 100644 --- a/reference/algorithm/ranges_prev_permutation.md +++ b/reference/algorithm/ranges_prev_permutation.md @@ -111,9 +111,9 @@ int main () ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_push_heap.md b/reference/algorithm/ranges_push_heap.md index 83356ad170..aed525d613 100644 --- a/reference/algorithm/ranges_push_heap.md +++ b/reference/algorithm/ranges_push_heap.md @@ -101,9 +101,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_remove.md b/reference/algorithm/ranges_remove.md index 77087996fd..515d892479 100644 --- a/reference/algorithm/ranges_remove.md +++ b/reference/algorithm/ranges_remove.md @@ -118,9 +118,9 @@ size after: 3 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_remove_copy.md b/reference/algorithm/ranges_remove_copy.md index 7a63b402a2..baf9c73346 100644 --- a/reference/algorithm/ranges_remove_copy.md +++ b/reference/algorithm/ranges_remove_copy.md @@ -107,9 +107,9 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_remove_copy_if.md b/reference/algorithm/ranges_remove_copy_if.md index 423a93b346..eac3d9a063 100644 --- a/reference/algorithm/ranges_remove_copy_if.md +++ b/reference/algorithm/ranges_remove_copy_if.md @@ -97,9 +97,9 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_remove_if.md b/reference/algorithm/ranges_remove_if.md index 32b4e37fea..494d0f6c24 100644 --- a/reference/algorithm/ranges_remove_if.md +++ b/reference/algorithm/ranges_remove_if.md @@ -112,9 +112,9 @@ size after: 2 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_replace.md b/reference/algorithm/ranges_replace.md index a40e837959..153da9cdef 100644 --- a/reference/algorithm/ranges_replace.md +++ b/reference/algorithm/ranges_replace.md @@ -97,9 +97,9 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_replace_copy.md b/reference/algorithm/ranges_replace_copy.md index 642891e7e2..108231a708 100644 --- a/reference/algorithm/ranges_replace_copy.md +++ b/reference/algorithm/ranges_replace_copy.md @@ -107,9 +107,9 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_replace_copy_if.md b/reference/algorithm/ranges_replace_copy_if.md index 6907413b80..3d6e5bbe14 100644 --- a/reference/algorithm/ranges_replace_copy_if.md +++ b/reference/algorithm/ranges_replace_copy_if.md @@ -97,9 +97,9 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_replace_if.md b/reference/algorithm/ranges_replace_if.md index be92ef555a..355979deb2 100644 --- a/reference/algorithm/ranges_replace_if.md +++ b/reference/algorithm/ranges_replace_if.md @@ -91,9 +91,9 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_reverse.md b/reference/algorithm/ranges_reverse.md index 28caf6aa51..1a81f5f7bd 100644 --- a/reference/algorithm/ranges_reverse.md +++ b/reference/algorithm/ranges_reverse.md @@ -72,9 +72,9 @@ esrever ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_reverse_copy.md b/reference/algorithm/ranges_reverse_copy.md index 063c8155da..45806f4426 100644 --- a/reference/algorithm/ranges_reverse_copy.md +++ b/reference/algorithm/ranges_reverse_copy.md @@ -82,9 +82,9 @@ esrever ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_rotate.md b/reference/algorithm/ranges_rotate.md index 23d2346954..0aa974c479 100644 --- a/reference/algorithm/ranges_rotate.md +++ b/reference/algorithm/ranges_rotate.md @@ -145,9 +145,9 @@ swapping 0x1806043(1) <-> 0x1806045(5) ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_rotate_copy.md b/reference/algorithm/ranges_rotate_copy.md index 0331ba6100..4b3e048ef0 100644 --- a/reference/algorithm/ranges_rotate_copy.md +++ b/reference/algorithm/ranges_rotate_copy.md @@ -86,9 +86,9 @@ tatero ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_sample.md b/reference/algorithm/ranges_sample.md index 0b65afd20d..f357752436 100644 --- a/reference/algorithm/ranges_sample.md +++ b/reference/algorithm/ranges_sample.md @@ -129,9 +129,9 @@ bcd ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_search.md b/reference/algorithm/ranges_search.md index 19bab6beb4..f2bdf5183a 100644 --- a/reference/algorithm/ranges_search.md +++ b/reference/algorithm/ranges_search.md @@ -140,9 +140,9 @@ inline constexpr search_impl search; ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_search_n.md b/reference/algorithm/ranges_search_n.md index 4cf0eca165..cd5c0b108f 100644 --- a/reference/algorithm/ranges_search_n.md +++ b/reference/algorithm/ranges_search_n.md @@ -157,9 +157,9 @@ inline constexpr search_n_impl search_n; ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_set_difference.md b/reference/algorithm/ranges_set_difference.md index b65e42f678..1f2b357740 100644 --- a/reference/algorithm/ranges_set_difference.md +++ b/reference/algorithm/ranges_set_difference.md @@ -126,9 +126,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_set_intersection.md b/reference/algorithm/ranges_set_intersection.md index 18d993c42f..8949784d27 100644 --- a/reference/algorithm/ranges_set_intersection.md +++ b/reference/algorithm/ranges_set_intersection.md @@ -130,9 +130,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_set_symmetric_difference.md b/reference/algorithm/ranges_set_symmetric_difference.md index 523137d701..8d5d0c7794 100644 --- a/reference/algorithm/ranges_set_symmetric_difference.md +++ b/reference/algorithm/ranges_set_symmetric_difference.md @@ -136,9 +136,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_set_union.md b/reference/algorithm/ranges_set_union.md index f35bf4bb36..ad5526f312 100644 --- a/reference/algorithm/ranges_set_union.md +++ b/reference/algorithm/ranges_set_union.md @@ -132,9 +132,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_shuffle.md b/reference/algorithm/ranges_shuffle.md index a804b5fe62..5dcc8a46d4 100644 --- a/reference/algorithm/ranges_shuffle.md +++ b/reference/algorithm/ranges_shuffle.md @@ -125,9 +125,9 @@ before: 0123456789abcdef ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_sort.md b/reference/algorithm/ranges_sort.md index c5b53212bd..1145a7faf7 100644 --- a/reference/algorithm/ranges_sort.md +++ b/reference/algorithm/ranges_sort.md @@ -175,9 +175,9 @@ Bob ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_sort_heap.md b/reference/algorithm/ranges_sort_heap.md index 99b319819b..e0fa2480de 100644 --- a/reference/algorithm/ranges_sort_heap.md +++ b/reference/algorithm/ranges_sort_heap.md @@ -95,9 +95,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_stable_partition.md b/reference/algorithm/ranges_stable_partition.md index 8cfe53f6ff..a2324e8770 100644 --- a/reference/algorithm/ranges_stable_partition.md +++ b/reference/algorithm/ranges_stable_partition.md @@ -100,9 +100,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_stable_sort.md b/reference/algorithm/ranges_stable_sort.md index 584ce90ea8..e0c93a7f7e 100644 --- a/reference/algorithm/ranges_stable_sort.md +++ b/reference/algorithm/ranges_stable_sort.md @@ -90,9 +90,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_swap_ranges.md b/reference/algorithm/ranges_swap_ranges.md index 32c56a4d1a..fd7af8d928 100644 --- a/reference/algorithm/ranges_swap_ranges.md +++ b/reference/algorithm/ranges_swap_ranges.md @@ -104,9 +104,9 @@ v2: 3,1,2,1,3, ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_transform.md b/reference/algorithm/ranges_transform.md index 0a52b9b52a..d01c459368 100644 --- a/reference/algorithm/ranges_transform.md +++ b/reference/algorithm/ranges_transform.md @@ -202,9 +202,9 @@ cccc ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_unique.md b/reference/algorithm/ranges_unique.md index 06b8f9d152..766202c785 100644 --- a/reference/algorithm/ranges_unique.md +++ b/reference/algorithm/ranges_unique.md @@ -131,9 +131,9 @@ sorted unique : 1,2,3,4,5 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_unique_copy.md b/reference/algorithm/ranges_unique_copy.md index 1d5b6e38a5..64f65a1176 100644 --- a/reference/algorithm/ranges_unique_copy.md +++ b/reference/algorithm/ranges_unique_copy.md @@ -144,9 +144,9 @@ sorted unique : 1,2,3,4,5 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/ranges_upper_bound.md b/reference/algorithm/ranges_upper_bound.md index 393ea46195..427567d233 100644 --- a/reference/algorithm/ranges_upper_bound.md +++ b/reference/algorithm/ranges_upper_bound.md @@ -140,9 +140,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1.0 +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) diff --git a/reference/algorithm/rotate.md b/reference/algorithm/rotate.md index 9c70fa70e8..43c4325004 100644 --- a/reference/algorithm/rotate.md +++ b/reference/algorithm/rotate.md @@ -154,9 +154,9 @@ swapping 0x1806043(1) <-> 0x1806045(5) ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2005, 2008, 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2005 [mark verified], 2008 [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - C++11への対応(戻り値の変更)は2010から。 diff --git a/reference/algorithm/sample.md b/reference/algorithm/sample.md index 3e7e12ed78..ebca486d33 100644 --- a/reference/algorithm/sample.md +++ b/reference/algorithm/sample.md @@ -118,8 +118,8 @@ bcd - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.2 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.2 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/any/any.md b/reference/any/any.md index e4df296e1a..f811f18c4e 100644 --- a/reference/any/any.md +++ b/reference/any/any.md @@ -137,8 +137,8 @@ bad any_cast - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/any/any/emplace.md b/reference/any/any/emplace.md index 992c0aeda6..e396637561 100644 --- a/reference/any/any/emplace.md +++ b/reference/any/any/emplace.md @@ -91,7 +91,7 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/any/any/has_value.md b/reference/any/any/has_value.md index 91e42cf5a8..0f110d56fd 100644 --- a/reference/any/any/has_value.md +++ b/reference/any/any/has_value.md @@ -42,6 +42,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/any/any/op_assign.md b/reference/any/any/op_assign.md index da09621c44..8dfa758aad 100644 --- a/reference/any/any/op_assign.md +++ b/reference/any/any/op_assign.md @@ -92,7 +92,7 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/any/any/op_constructor.md b/reference/any/any/op_constructor.md index c214c70c03..98dc736471 100644 --- a/reference/any/any/op_constructor.md +++ b/reference/any/any/op_constructor.md @@ -140,7 +140,7 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/any/any/op_destructor.md b/reference/any/any/op_destructor.md index 6d9668c5b7..ca6decd9e9 100644 --- a/reference/any/any/op_destructor.md +++ b/reference/any/any/op_destructor.md @@ -22,6 +22,6 @@ - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/any/any/reset.md b/reference/any/any/reset.md index 10280143ba..d0a0004196 100644 --- a/reference/any/any/reset.md +++ b/reference/any/any/reset.md @@ -46,7 +46,7 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/any/any/swap.md b/reference/any/any/swap.md index 36fba74bc2..8675fc992a 100644 --- a/reference/any/any/swap.md +++ b/reference/any/any/swap.md @@ -51,6 +51,6 @@ Hello - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/any/any/swap_free.md b/reference/any/any/swap_free.md index ef7c53cadf..b662d0f435 100644 --- a/reference/any/any/swap_free.md +++ b/reference/any/any/swap_free.md @@ -51,6 +51,6 @@ Hello - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/any/any/type.md b/reference/any/any/type.md index dab0dd1601..b0ba6b8660 100644 --- a/reference/any/any/type.md +++ b/reference/any/any/type.md @@ -42,6 +42,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/any/any_cast.md b/reference/any/any_cast.md index 74593c4b45..bed4111902 100644 --- a/reference/any/any_cast.md +++ b/reference/any/any_cast.md @@ -146,8 +146,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 diff --git a/reference/any/bad_any_cast.md b/reference/any/bad_any_cast.md index c7a8592ff6..7a11f9fbb6 100644 --- a/reference/any/bad_any_cast.md +++ b/reference/any/bad_any_cast.md @@ -54,8 +54,8 @@ exception : bad any cast - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 diff --git a/reference/any/make_any.md b/reference/any/make_any.md index c60d937860..1be663bd7d 100644 --- a/reference/any/make_any.md +++ b/reference/any/make_any.md @@ -71,6 +71,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/array/array.md b/reference/array/array.md index 855c119a59..5dd350ce1d 100644 --- a/reference/array/array.md +++ b/reference/array/array.md @@ -167,9 +167,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012 +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified] ## 関連項目 diff --git a/reference/array/array/at.md b/reference/array/array/at.md index 13c9da4588..79aabf3bd4 100644 --- a/reference/array/array/at.md +++ b/reference/array/array/at.md @@ -75,9 +75,9 @@ out of range ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012 +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified] ## 参照 diff --git a/reference/array/array/back.md b/reference/array/array/back.md index cb4ce48546..1e39e0bfb9 100644 --- a/reference/array/array/back.md +++ b/reference/array/array/back.md @@ -57,9 +57,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012 +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified] ## 参照 diff --git a/reference/array/array/begin.md b/reference/array/array/begin.md index 42807655c2..78de4e3402 100644 --- a/reference/array/array/begin.md +++ b/reference/array/array/begin.md @@ -64,9 +64,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012 +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified] ## 参照 diff --git a/reference/array/array/cbegin.md b/reference/array/array/cbegin.md index 4d8c78ad9c..03becaf373 100644 --- a/reference/array/array/cbegin.md +++ b/reference/array/array/cbegin.md @@ -63,9 +63,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified] ## 参照 diff --git a/reference/array/array/cend.md b/reference/array/array/cend.md index 110ab037f6..247d957754 100644 --- a/reference/array/array/cend.md +++ b/reference/array/array/cend.md @@ -67,9 +67,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified] ## 参照 diff --git a/reference/array/array/crbegin.md b/reference/array/array/crbegin.md index dbdd8ec9aa..7ef1ca878c 100644 --- a/reference/array/array/crbegin.md +++ b/reference/array/array/crbegin.md @@ -63,9 +63,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified] ## 参照 diff --git a/reference/array/array/crend.md b/reference/array/array/crend.md index c98811f79d..1f1499a76e 100644 --- a/reference/array/array/crend.md +++ b/reference/array/array/crend.md @@ -63,9 +63,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified] ## 参照 diff --git a/reference/array/array/data.md b/reference/array/array/data.md index f850430ec1..333e071532 100644 --- a/reference/array/array/data.md +++ b/reference/array/array/data.md @@ -63,9 +63,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012 +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified] ## 参照 diff --git a/reference/array/array/empty.md b/reference/array/array/empty.md index 3f05c958cd..243f0ffb0a 100644 --- a/reference/array/array/empty.md +++ b/reference/array/array/empty.md @@ -60,9 +60,9 @@ empty_array : true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012 +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified] ## 参照 diff --git a/reference/array/array/end.md b/reference/array/array/end.md index d03f7902e8..cd92e2a276 100644 --- a/reference/array/array/end.md +++ b/reference/array/array/end.md @@ -78,9 +78,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012 +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified] ## 参照 diff --git a/reference/array/array/fill.md b/reference/array/array/fill.md index c2b6fc23f0..64b20296b6 100644 --- a/reference/array/array/fill.md +++ b/reference/array/array/fill.md @@ -55,9 +55,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified] ## 参照 diff --git a/reference/array/array/front.md b/reference/array/array/front.md index b1a65965b2..a980a10486 100644 --- a/reference/array/array/front.md +++ b/reference/array/array/front.md @@ -60,9 +60,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012 +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified] ## 参照 diff --git a/reference/array/array/get.md b/reference/array/array/get.md index 96d905eaed..f95ed69087 100644 --- a/reference/array/array/get.md +++ b/reference/array/array/get.md @@ -114,9 +114,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012 +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified] #### 備考 GCC 4.7の`std::get()`は、`I`の境界チェックがない。 diff --git a/reference/array/array/max_size.md b/reference/array/array/max_size.md index 23e0f80c8f..0d19aa7772 100644 --- a/reference/array/array/max_size.md +++ b/reference/array/array/max_size.md @@ -53,9 +53,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012 +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified] ## 参照 diff --git a/reference/array/array/op_at.md b/reference/array/array/op_at.md index 7642abff4d..688d5fadea 100644 --- a/reference/array/array/op_at.md +++ b/reference/array/array/op_at.md @@ -63,9 +63,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012 +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified] ## 参照 diff --git a/reference/array/array/op_compare_3way.md b/reference/array/array/op_compare_3way.md index 3e86bd600a..834e67629e 100644 --- a/reference/array/array/op_compare_3way.md +++ b/reference/array/array/op_compare_3way.md @@ -74,7 +74,7 @@ equal ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10 +- [GCC](/implementation.md#gcc): 10 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/array/array/op_deduction_guide.md b/reference/array/array/op_deduction_guide.md index 9fce1a4627..e2c173a20b 100644 --- a/reference/array/array/op_deduction_guide.md +++ b/reference/array/array/op_deduction_guide.md @@ -63,7 +63,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 7.1.0 +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/array/array/op_equal.md b/reference/array/array/op_equal.md index 1cfd8b7da9..7f1861c0d4 100644 --- a/reference/array/array/op_equal.md +++ b/reference/array/array/op_equal.md @@ -70,9 +70,9 @@ equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012 +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified] ## 参照 diff --git a/reference/array/array/op_greater.md b/reference/array/array/op_greater.md index d61166fc55..8eb9926af8 100644 --- a/reference/array/array/op_greater.md +++ b/reference/array/array/op_greater.md @@ -58,9 +58,9 @@ greater ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012 +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified] ## 参照 diff --git a/reference/array/array/op_greater_equal.md b/reference/array/array/op_greater_equal.md index d2f41150c0..623abaf421 100644 --- a/reference/array/array/op_greater_equal.md +++ b/reference/array/array/op_greater_equal.md @@ -57,9 +57,9 @@ greater equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012 +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified] ## 参照 diff --git a/reference/array/array/op_initializer.md b/reference/array/array/op_initializer.md index 5f373918c6..c61e36c44b 100644 --- a/reference/array/array/op_initializer.md +++ b/reference/array/array/op_initializer.md @@ -54,9 +54,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012 +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified] ## 参照 diff --git a/reference/array/array/op_less.md b/reference/array/array/op_less.md index 802d8f4d30..cbc38ab2f4 100644 --- a/reference/array/array/op_less.md +++ b/reference/array/array/op_less.md @@ -68,9 +68,9 @@ less ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012 +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified] ## 参照 diff --git a/reference/array/array/op_less_equal.md b/reference/array/array/op_less_equal.md index 3cc899bae7..a24c7a25c2 100644 --- a/reference/array/array/op_less_equal.md +++ b/reference/array/array/op_less_equal.md @@ -58,9 +58,9 @@ less equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012 +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified] ## 参照 diff --git a/reference/array/array/op_not_equal.md b/reference/array/array/op_not_equal.md index f3596f509a..7e5292f311 100644 --- a/reference/array/array/op_not_equal.md +++ b/reference/array/array/op_not_equal.md @@ -62,9 +62,9 @@ equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012 +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified] ## 参照 diff --git a/reference/array/array/rbegin.md b/reference/array/array/rbegin.md index ab54a7b75d..787d4c4f00 100644 --- a/reference/array/array/rbegin.md +++ b/reference/array/array/rbegin.md @@ -62,9 +62,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/array/array/rend.md b/reference/array/array/rend.md index fba7db1a1e..5986151758 100644 --- a/reference/array/array/rend.md +++ b/reference/array/array/rend.md @@ -75,9 +75,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012 +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified] ## 参照 diff --git a/reference/array/array/size.md b/reference/array/array/size.md index 44c46d09be..646a603817 100644 --- a/reference/array/array/size.md +++ b/reference/array/array/size.md @@ -53,9 +53,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012 +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified] ## 参照 diff --git a/reference/array/array/swap.md b/reference/array/array/swap.md index 2c0a9f884d..c99055d24e 100644 --- a/reference/array/array/swap.md +++ b/reference/array/array/swap.md @@ -82,9 +82,9 @@ y : 1 2 3 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012 +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified] ## 参照 diff --git a/reference/array/array/swap_free.md b/reference/array/array/swap_free.md index 589702ed8f..f68c39ed58 100644 --- a/reference/array/array/swap_free.md +++ b/reference/array/array/swap_free.md @@ -75,9 +75,9 @@ y : {4 5 6 } ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/array/array/tuple_element.md b/reference/array/array/tuple_element.md index 31e588609c..feeec4060e 100644 --- a/reference/array/array/tuple_element.md +++ b/reference/array/array/tuple_element.md @@ -58,9 +58,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012 +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified] #### 備考 GCC 4.7、およびVisual C++ 10.0の`array`に対する`tuple_element`の特殊化では、`I`の境界チェックがない。 diff --git a/reference/array/array/tuple_size.md b/reference/array/array/tuple_size.md index a986e08298..2beb7cba60 100644 --- a/reference/array/array/tuple_size.md +++ b/reference/array/array/tuple_size.md @@ -53,9 +53,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012 +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified] ## 参照 diff --git a/reference/array/to_array.md b/reference/array/to_array.md index 15ad63c031..fd960f6958 100644 --- a/reference/array/to_array.md +++ b/reference/array/to_array.md @@ -65,8 +65,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 10.0.0 現在未実装 -- [GCC](/implementation.md#gcc): 10.0.0 +- [Clang](/implementation.md#clang): 10.0.0 現在未実装 [mark verified] +- [GCC](/implementation.md#gcc): 10.0.0 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/atomic/atomic.md b/reference/atomic/atomic.md index 1f0424e7dd..2e403736be 100644 --- a/reference/atomic/atomic.md +++ b/reference/atomic/atomic.md @@ -287,9 +287,9 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ### 備考 - GCC 4.9.2まで、アライメントがおかしくなってセグメンテーションフォルトになるバグがあった。GCC 5.1で修正された。([Bug 65147](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65147)) diff --git a/reference/atomic/atomic/compare_exchange_strong.md b/reference/atomic/atomic/compare_exchange_strong.md index 8a22f0906a..efc248a09a 100644 --- a/reference/atomic/atomic/compare_exchange_strong.md +++ b/reference/atomic/atomic/compare_exchange_strong.md @@ -162,9 +162,9 @@ true - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic/compare_exchange_weak.md b/reference/atomic/atomic/compare_exchange_weak.md index 1c1933d31f..68c4f23bb4 100644 --- a/reference/atomic/atomic/compare_exchange_weak.md +++ b/reference/atomic/atomic/compare_exchange_weak.md @@ -187,9 +187,9 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic/exchange.md b/reference/atomic/atomic/exchange.md index f2eb8036df..ecad452c20 100644 --- a/reference/atomic/atomic/exchange.md +++ b/reference/atomic/atomic/exchange.md @@ -69,9 +69,9 @@ replaced 1 by 2 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic/fetch_add.md b/reference/atomic/atomic/fetch_add.md index 2852a6a3d4..950f569c97 100644 --- a/reference/atomic/atomic/fetch_add.md +++ b/reference/atomic/atomic/fetch_add.md @@ -138,9 +138,9 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic/fetch_and.md b/reference/atomic/atomic/fetch_and.md index 7bd76b8270..673aef1e40 100644 --- a/reference/atomic/atomic/fetch_and.md +++ b/reference/atomic/atomic/fetch_and.md @@ -117,9 +117,9 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic/fetch_or.md b/reference/atomic/atomic/fetch_or.md index 7c6853162d..988ba029e9 100644 --- a/reference/atomic/atomic/fetch_or.md +++ b/reference/atomic/atomic/fetch_or.md @@ -117,9 +117,9 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic/fetch_sub.md b/reference/atomic/atomic/fetch_sub.md index 0d70e4d4e8..16f9bfc1ae 100644 --- a/reference/atomic/atomic/fetch_sub.md +++ b/reference/atomic/atomic/fetch_sub.md @@ -135,9 +135,9 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic/fetch_xor.md b/reference/atomic/atomic/fetch_xor.md index a6f4543bd7..f00b996bf8 100644 --- a/reference/atomic/atomic/fetch_xor.md +++ b/reference/atomic/atomic/fetch_xor.md @@ -119,9 +119,9 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic/is_lock_free.md b/reference/atomic/atomic/is_lock_free.md index 51dceaacf7..f05c74cdf4 100644 --- a/reference/atomic/atomic/is_lock_free.md +++ b/reference/atomic/atomic/is_lock_free.md @@ -58,9 +58,9 @@ atomic is lock-free ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic/load.md b/reference/atomic/atomic/load.md index 81f926f426..122d12e8a9 100644 --- a/reference/atomic/atomic/load.md +++ b/reference/atomic/atomic/load.md @@ -70,9 +70,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic/notify_all.md b/reference/atomic/atomic/notify_all.md index ef107398c0..d861d0a2d3 100644 --- a/reference/atomic/atomic/notify_all.md +++ b/reference/atomic/atomic/notify_all.md @@ -77,9 +77,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/atomic/atomic/notify_one.md b/reference/atomic/atomic/notify_one.md index 097dab9741..9cad212caa 100644 --- a/reference/atomic/atomic/notify_one.md +++ b/reference/atomic/atomic/notify_one.md @@ -103,9 +103,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/atomic/atomic/op_and_assign.md b/reference/atomic/atomic/op_and_assign.md index 04b6ba3849..23312eab7c 100644 --- a/reference/atomic/atomic/op_and_assign.md +++ b/reference/atomic/atomic/op_and_assign.md @@ -111,9 +111,9 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic/op_assign.md b/reference/atomic/atomic/op_assign.md index 9d1f033842..c5e2b19e9b 100644 --- a/reference/atomic/atomic/op_assign.md +++ b/reference/atomic/atomic/op_assign.md @@ -64,9 +64,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] - 2012はコピー代入演算子のdeleteに対応していないため、代わりにprivateで宣言のみ行う手法で代用されている。 diff --git a/reference/atomic/atomic/op_constructor.md b/reference/atomic/atomic/op_constructor.md index 78912aad95..e369031977 100644 --- a/reference/atomic/atomic/op_constructor.md +++ b/reference/atomic/atomic/op_constructor.md @@ -72,9 +72,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] - 2012はコピーコンストラクタのdeleteに対応していないため、代わりにprivateで宣言のみ行う手法で代用されている。 diff --git a/reference/atomic/atomic/op_decrement.md b/reference/atomic/atomic/op_decrement.md index 200a122610..9073ba75f3 100644 --- a/reference/atomic/atomic/op_decrement.md +++ b/reference/atomic/atomic/op_decrement.md @@ -109,9 +109,9 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic/op_increment.md b/reference/atomic/atomic/op_increment.md index 6a7fb2024f..683ee6e013 100644 --- a/reference/atomic/atomic/op_increment.md +++ b/reference/atomic/atomic/op_increment.md @@ -112,9 +112,9 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic/op_minus_assign.md b/reference/atomic/atomic/op_minus_assign.md index cec6f30393..097d5d2c93 100644 --- a/reference/atomic/atomic/op_minus_assign.md +++ b/reference/atomic/atomic/op_minus_assign.md @@ -130,9 +130,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic/op_or_assign.md b/reference/atomic/atomic/op_or_assign.md index ae3f32e88d..4f63f0972c 100644 --- a/reference/atomic/atomic/op_or_assign.md +++ b/reference/atomic/atomic/op_or_assign.md @@ -112,9 +112,9 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic/op_plus_assign.md b/reference/atomic/atomic/op_plus_assign.md index 07447944b0..b8f5b235d7 100644 --- a/reference/atomic/atomic/op_plus_assign.md +++ b/reference/atomic/atomic/op_plus_assign.md @@ -128,9 +128,9 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic/op_t.md b/reference/atomic/atomic/op_t.md index dfc15f5004..d642b30d47 100644 --- a/reference/atomic/atomic/op_t.md +++ b/reference/atomic/atomic/op_t.md @@ -53,9 +53,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic/op_xor_assign.md b/reference/atomic/atomic/op_xor_assign.md index c5cafcc448..c27ab068f5 100644 --- a/reference/atomic/atomic/op_xor_assign.md +++ b/reference/atomic/atomic/op_xor_assign.md @@ -114,9 +114,9 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic/store.md b/reference/atomic/atomic/store.md index 17d7a1df4c..43fb105efb 100644 --- a/reference/atomic/atomic/store.md +++ b/reference/atomic/atomic/store.md @@ -75,9 +75,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic/wait.md b/reference/atomic/atomic/wait.md index 52577ef455..d940060c39 100644 --- a/reference/atomic/atomic/wait.md +++ b/reference/atomic/atomic/wait.md @@ -118,9 +118,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/atomic/atomic_compare_exchange_strong.md b/reference/atomic/atomic_compare_exchange_strong.md index 7dc0f8cbde..7cecd9045b 100644 --- a/reference/atomic/atomic_compare_exchange_strong.md +++ b/reference/atomic/atomic_compare_exchange_strong.md @@ -111,9 +111,9 @@ false 3 3 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic_compare_exchange_strong_explicit.md b/reference/atomic/atomic_compare_exchange_strong_explicit.md index 15f7af0d55..f1f4885f36 100644 --- a/reference/atomic/atomic_compare_exchange_strong_explicit.md +++ b/reference/atomic/atomic_compare_exchange_strong_explicit.md @@ -131,9 +131,9 @@ false 3 3 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic_compare_exchange_weak.md b/reference/atomic/atomic_compare_exchange_weak.md index aac782e9ee..87e0629a95 100644 --- a/reference/atomic/atomic_compare_exchange_weak.md +++ b/reference/atomic/atomic_compare_exchange_weak.md @@ -115,9 +115,9 @@ false 3 3 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic_compare_exchange_weak_explicit.md b/reference/atomic/atomic_compare_exchange_weak_explicit.md index dad825fd85..397bb63923 100644 --- a/reference/atomic/atomic_compare_exchange_weak_explicit.md +++ b/reference/atomic/atomic_compare_exchange_weak_explicit.md @@ -133,9 +133,9 @@ false 3 3 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic_exchange.md b/reference/atomic/atomic_exchange.md index 7fd2153b89..7fa78f8f43 100644 --- a/reference/atomic/atomic_exchange.md +++ b/reference/atomic/atomic_exchange.md @@ -86,9 +86,9 @@ replaced 1 by 2 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic_exchange_explicit.md b/reference/atomic/atomic_exchange_explicit.md index 9af6c0c4d7..42ce1048bf 100644 --- a/reference/atomic/atomic_exchange_explicit.md +++ b/reference/atomic/atomic_exchange_explicit.md @@ -92,9 +92,9 @@ replaced 1 by 2 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic_fetch_add.md b/reference/atomic/atomic_fetch_add.md index ce20d5bdd7..54d691e9f9 100644 --- a/reference/atomic/atomic_fetch_add.md +++ b/reference/atomic/atomic_fetch_add.md @@ -89,9 +89,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic_fetch_add_explicit.md b/reference/atomic/atomic_fetch_add_explicit.md index 12a8925d06..6559e86cc5 100644 --- a/reference/atomic/atomic_fetch_add_explicit.md +++ b/reference/atomic/atomic_fetch_add_explicit.md @@ -92,9 +92,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic_fetch_and.md b/reference/atomic/atomic_fetch_and.md index 9787490851..a1464a21f8 100644 --- a/reference/atomic/atomic_fetch_and.md +++ b/reference/atomic/atomic_fetch_and.md @@ -95,9 +95,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic_fetch_and_explicit.md b/reference/atomic/atomic_fetch_and_explicit.md index 3dc06297e2..1cf4be6d1d 100644 --- a/reference/atomic/atomic_fetch_and_explicit.md +++ b/reference/atomic/atomic_fetch_and_explicit.md @@ -100,9 +100,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic_fetch_or.md b/reference/atomic/atomic_fetch_or.md index 0af271e005..90a49db9f5 100644 --- a/reference/atomic/atomic_fetch_or.md +++ b/reference/atomic/atomic_fetch_or.md @@ -95,9 +95,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic_fetch_or_explicit.md b/reference/atomic/atomic_fetch_or_explicit.md index 8468b7b560..1cb3276243 100644 --- a/reference/atomic/atomic_fetch_or_explicit.md +++ b/reference/atomic/atomic_fetch_or_explicit.md @@ -99,9 +99,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic_fetch_sub.md b/reference/atomic/atomic_fetch_sub.md index c37c3b4f63..79b2a6cd39 100644 --- a/reference/atomic/atomic_fetch_sub.md +++ b/reference/atomic/atomic_fetch_sub.md @@ -88,9 +88,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic_fetch_sub_explicit.md b/reference/atomic/atomic_fetch_sub_explicit.md index 8b58fc2c27..12227f39b9 100644 --- a/reference/atomic/atomic_fetch_sub_explicit.md +++ b/reference/atomic/atomic_fetch_sub_explicit.md @@ -93,9 +93,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic_fetch_xor.md b/reference/atomic/atomic_fetch_xor.md index ab7a22d288..21e2fdbaa0 100644 --- a/reference/atomic/atomic_fetch_xor.md +++ b/reference/atomic/atomic_fetch_xor.md @@ -95,9 +95,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic_fetch_xor_explicit.md b/reference/atomic/atomic_fetch_xor_explicit.md index d842b94533..a92960f978 100644 --- a/reference/atomic/atomic_fetch_xor_explicit.md +++ b/reference/atomic/atomic_fetch_xor_explicit.md @@ -101,9 +101,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic_flag.md b/reference/atomic/atomic_flag.md index 37364b78d4..dac6e849eb 100644 --- a/reference/atomic/atomic_flag.md +++ b/reference/atomic/atomic_flag.md @@ -105,9 +105,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] - 2012はコピーコンストラクタと代入演算子のdelete宣言が存在しない。 diff --git a/reference/atomic/atomic_flag/clear.md b/reference/atomic/atomic_flag/clear.md index 11866bc355..cfed6ae7ad 100644 --- a/reference/atomic/atomic_flag/clear.md +++ b/reference/atomic/atomic_flag/clear.md @@ -80,9 +80,9 @@ false ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/atomic/atomic_flag/notify_all.md b/reference/atomic/atomic_flag/notify_all.md index 75808edd82..051d0604a8 100644 --- a/reference/atomic/atomic_flag/notify_all.md +++ b/reference/atomic/atomic_flag/notify_all.md @@ -73,9 +73,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/atomic/atomic_flag/notify_one.md b/reference/atomic/atomic_flag/notify_one.md index d71d408c4a..aaa9458e4c 100644 --- a/reference/atomic/atomic_flag/notify_one.md +++ b/reference/atomic/atomic_flag/notify_one.md @@ -99,9 +99,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/atomic/atomic_flag/op_constructor.md b/reference/atomic/atomic_flag/op_constructor.md index 783d57dd6a..f511c95f68 100644 --- a/reference/atomic/atomic_flag/op_constructor.md +++ b/reference/atomic/atomic_flag/op_constructor.md @@ -57,9 +57,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2013 +- [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified] - 2012はコピーコンストラクタのdeleteに対応していないため、代わりにprivateで宣言のみ行う手法で代用されている。 ## 参照 diff --git a/reference/atomic/atomic_flag/test.md b/reference/atomic/atomic_flag/test.md index a0b1eda2e8..0004703d70 100644 --- a/reference/atomic/atomic_flag/test.md +++ b/reference/atomic/atomic_flag/test.md @@ -68,9 +68,9 @@ true ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/atomic/atomic_flag/test_and_set.md b/reference/atomic/atomic_flag/test_and_set.md index 53ee8c3830..7ac2cdd48d 100644 --- a/reference/atomic/atomic_flag/test_and_set.md +++ b/reference/atomic/atomic_flag/test_and_set.md @@ -67,9 +67,9 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/atomic/atomic_flag/wait.md b/reference/atomic/atomic_flag/wait.md index f4a550ebf4..4f8c1e35aa 100644 --- a/reference/atomic/atomic_flag/wait.md +++ b/reference/atomic/atomic_flag/wait.md @@ -110,9 +110,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/atomic/atomic_flag_clear.md b/reference/atomic/atomic_flag_clear.md index c05a57bae1..344ca7669d 100644 --- a/reference/atomic/atomic_flag_clear.md +++ b/reference/atomic/atomic_flag_clear.md @@ -73,9 +73,9 @@ false ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/atomic/atomic_flag_clear_explicit.md b/reference/atomic/atomic_flag_clear_explicit.md index 6f899b2b16..cdc49ca536 100644 --- a/reference/atomic/atomic_flag_clear_explicit.md +++ b/reference/atomic/atomic_flag_clear_explicit.md @@ -82,9 +82,9 @@ false ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/atomic/atomic_flag_init.md b/reference/atomic/atomic_flag_init.md index cf6987beb1..bced794a22 100644 --- a/reference/atomic/atomic_flag_init.md +++ b/reference/atomic/atomic_flag_init.md @@ -53,9 +53,9 @@ false ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/atomic/atomic_flag_notify_all.md b/reference/atomic/atomic_flag_notify_all.md index 9a167c58b3..6b9a2b65b2 100644 --- a/reference/atomic/atomic_flag_notify_all.md +++ b/reference/atomic/atomic_flag_notify_all.md @@ -74,9 +74,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/atomic/atomic_flag_notify_one.md b/reference/atomic/atomic_flag_notify_one.md index 872d299c64..cb5fe17f72 100644 --- a/reference/atomic/atomic_flag_notify_one.md +++ b/reference/atomic/atomic_flag_notify_one.md @@ -100,9 +100,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/atomic/atomic_flag_test.md b/reference/atomic/atomic_flag_test.md index f5bec52691..3973f5927e 100644 --- a/reference/atomic/atomic_flag_test.md +++ b/reference/atomic/atomic_flag_test.md @@ -64,9 +64,9 @@ true ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/atomic/atomic_flag_test_and_set.md b/reference/atomic/atomic_flag_test_and_set.md index f62149a35c..20cf956371 100644 --- a/reference/atomic/atomic_flag_test_and_set.md +++ b/reference/atomic/atomic_flag_test_and_set.md @@ -69,9 +69,9 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/atomic/atomic_flag_test_and_set_explicit.md b/reference/atomic/atomic_flag_test_and_set_explicit.md index 935d6f1161..2dcc48633b 100644 --- a/reference/atomic/atomic_flag_test_and_set_explicit.md +++ b/reference/atomic/atomic_flag_test_and_set_explicit.md @@ -68,9 +68,9 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/atomic/atomic_flag_test_explicit.md b/reference/atomic/atomic_flag_test_explicit.md index c18a0d4080..3b260b077a 100644 --- a/reference/atomic/atomic_flag_test_explicit.md +++ b/reference/atomic/atomic_flag_test_explicit.md @@ -72,9 +72,9 @@ true ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/atomic/atomic_flag_wait.md b/reference/atomic/atomic_flag_wait.md index 0ac06ba10f..2452edf275 100644 --- a/reference/atomic/atomic_flag_wait.md +++ b/reference/atomic/atomic_flag_wait.md @@ -110,9 +110,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/atomic/atomic_flag_wait_explicit.md b/reference/atomic/atomic_flag_wait_explicit.md index 6c5fd8f674..5908cb6505 100644 --- a/reference/atomic/atomic_flag_wait_explicit.md +++ b/reference/atomic/atomic_flag_wait_explicit.md @@ -115,9 +115,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/atomic/atomic_init.md b/reference/atomic/atomic_init.md index cacd9c1e7c..4d415534be 100644 --- a/reference/atomic/atomic_init.md +++ b/reference/atomic/atomic_init.md @@ -86,10 +86,10 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.3 +- [Clang](/implementation.md#clang): 3.3 [mark verified] - [GCC](/implementation.md#gcc): - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic_is_lock_free.md b/reference/atomic/atomic_is_lock_free.md index e6ffbd3ce8..91d91013a9 100644 --- a/reference/atomic/atomic_is_lock_free.md +++ b/reference/atomic/atomic_is_lock_free.md @@ -66,9 +66,9 @@ atomic is lock-free ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic_load.md b/reference/atomic/atomic_load.md index fea179a9a5..3bb4becc2c 100644 --- a/reference/atomic/atomic_load.md +++ b/reference/atomic/atomic_load.md @@ -71,9 +71,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic_load_explicit.md b/reference/atomic/atomic_load_explicit.md index 5bbd4bb3c9..45a0d084c2 100644 --- a/reference/atomic/atomic_load_explicit.md +++ b/reference/atomic/atomic_load_explicit.md @@ -81,9 +81,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/atomic/atomic_notify_all.md b/reference/atomic/atomic_notify_all.md index 7dc4559622..d06922820c 100644 --- a/reference/atomic/atomic_notify_all.md +++ b/reference/atomic/atomic_notify_all.md @@ -80,9 +80,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/atomic/atomic_notify_one.md b/reference/atomic/atomic_notify_one.md index 92f202b77c..49fee229ef 100644 --- a/reference/atomic/atomic_notify_one.md +++ b/reference/atomic/atomic_notify_one.md @@ -106,9 +106,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/atomic/atomic_ref.md b/reference/atomic/atomic_ref.md index 2af2f3bd40..0d53ab2c1e 100644 --- a/reference/atomic/atomic_ref.md +++ b/reference/atomic/atomic_ref.md @@ -180,8 +180,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): 10.1 +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/atomic/atomic_ref/compare_exchange_strong.md b/reference/atomic/atomic_ref/compare_exchange_strong.md index 2c113c4297..1b43fc541d 100644 --- a/reference/atomic/atomic_ref/compare_exchange_strong.md +++ b/reference/atomic/atomic_ref/compare_exchange_strong.md @@ -149,7 +149,7 @@ true - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): 10.1 +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/atomic/atomic_ref/compare_exchange_weak.md b/reference/atomic/atomic_ref/compare_exchange_weak.md index 5badb70b7f..27498f6a64 100644 --- a/reference/atomic/atomic_ref/compare_exchange_weak.md +++ b/reference/atomic/atomic_ref/compare_exchange_weak.md @@ -179,7 +179,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): 10.1 +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/atomic/atomic_ref/exchange.md b/reference/atomic/atomic_ref/exchange.md index 18f1f7b639..f2df38029d 100644 --- a/reference/atomic/atomic_ref/exchange.md +++ b/reference/atomic/atomic_ref/exchange.md @@ -56,7 +56,7 @@ replaced 1 by 2 - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): 10.1 +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/atomic/atomic_ref/fetch_add.md b/reference/atomic/atomic_ref/fetch_add.md index 307f186a6e..96d219f99d 100644 --- a/reference/atomic/atomic_ref/fetch_add.md +++ b/reference/atomic/atomic_ref/fetch_add.md @@ -130,7 +130,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): 10.1 +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/atomic/atomic_ref/fetch_and.md b/reference/atomic/atomic_ref/fetch_and.md index ca7570c9ee..a3da5c1be8 100644 --- a/reference/atomic/atomic_ref/fetch_and.md +++ b/reference/atomic/atomic_ref/fetch_and.md @@ -100,7 +100,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): 10.1 +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/atomic/atomic_ref/fetch_or.md b/reference/atomic/atomic_ref/fetch_or.md index 6665aa210c..389e3c6edb 100644 --- a/reference/atomic/atomic_ref/fetch_or.md +++ b/reference/atomic/atomic_ref/fetch_or.md @@ -100,7 +100,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): 10.1 +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/atomic/atomic_ref/fetch_sub.md b/reference/atomic/atomic_ref/fetch_sub.md index e52db8972a..dda6cbccec 100644 --- a/reference/atomic/atomic_ref/fetch_sub.md +++ b/reference/atomic/atomic_ref/fetch_sub.md @@ -125,7 +125,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): 10.1 +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/atomic/atomic_ref/fetch_xor.md b/reference/atomic/atomic_ref/fetch_xor.md index 9815107989..c2e1acf6a5 100644 --- a/reference/atomic/atomic_ref/fetch_xor.md +++ b/reference/atomic/atomic_ref/fetch_xor.md @@ -102,7 +102,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): 10.1 +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/atomic/atomic_ref/is_lock_free.md b/reference/atomic/atomic_ref/is_lock_free.md index b748904c4a..a5a3da3572 100644 --- a/reference/atomic/atomic_ref/is_lock_free.md +++ b/reference/atomic/atomic_ref/is_lock_free.md @@ -56,8 +56,8 @@ atomic_ref is lock-free - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): 10.1 +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/atomic/atomic_ref/load.md b/reference/atomic/atomic_ref/load.md index f41f9ac30b..3342a19d2d 100644 --- a/reference/atomic/atomic_ref/load.md +++ b/reference/atomic/atomic_ref/load.md @@ -67,6 +67,6 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): 10.1 +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/atomic/atomic_ref/notify_all.md b/reference/atomic/atomic_ref/notify_all.md index 0579533ba6..bf7fdf66fd 100644 --- a/reference/atomic/atomic_ref/notify_all.md +++ b/reference/atomic/atomic_ref/notify_all.md @@ -72,9 +72,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/atomic/atomic_ref/notify_one.md b/reference/atomic/atomic_ref/notify_one.md index a15e9e73c0..a6ffed6069 100644 --- a/reference/atomic/atomic_ref/notify_one.md +++ b/reference/atomic/atomic_ref/notify_one.md @@ -99,9 +99,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/atomic/atomic_ref/op_and_assign.md b/reference/atomic/atomic_ref/op_and_assign.md index 5a4ba3bb03..fc1dd2f4cc 100644 --- a/reference/atomic/atomic_ref/op_and_assign.md +++ b/reference/atomic/atomic_ref/op_and_assign.md @@ -93,7 +93,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): 10.1 +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/atomic/atomic_ref/op_assign.md b/reference/atomic/atomic_ref/op_assign.md index 27e1a3256a..9c9dab5d98 100644 --- a/reference/atomic/atomic_ref/op_assign.md +++ b/reference/atomic/atomic_ref/op_assign.md @@ -60,8 +60,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): 10.1 +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/atomic/atomic_ref/op_constructor.md b/reference/atomic/atomic_ref/op_constructor.md index dbd632ea4b..7f3d704424 100644 --- a/reference/atomic/atomic_ref/op_constructor.md +++ b/reference/atomic/atomic_ref/op_constructor.md @@ -57,8 +57,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): 10.1 +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/atomic/atomic_ref/op_decrement.md b/reference/atomic/atomic_ref/op_decrement.md index 2d89b0dcaf..d10929d182 100644 --- a/reference/atomic/atomic_ref/op_decrement.md +++ b/reference/atomic/atomic_ref/op_decrement.md @@ -91,8 +91,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): 10.1 +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/atomic/atomic_ref/op_increment.md b/reference/atomic/atomic_ref/op_increment.md index 911712f700..a89ae165c1 100644 --- a/reference/atomic/atomic_ref/op_increment.md +++ b/reference/atomic/atomic_ref/op_increment.md @@ -93,8 +93,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): 10.1 +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/atomic/atomic_ref/op_minus_assign.md b/reference/atomic/atomic_ref/op_minus_assign.md index 3f1fb93059..7b5db25e7f 100644 --- a/reference/atomic/atomic_ref/op_minus_assign.md +++ b/reference/atomic/atomic_ref/op_minus_assign.md @@ -120,7 +120,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): 10.1 +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/atomic/atomic_ref/op_or_assign.md b/reference/atomic/atomic_ref/op_or_assign.md index 2abc2f024d..a25af24d46 100644 --- a/reference/atomic/atomic_ref/op_or_assign.md +++ b/reference/atomic/atomic_ref/op_or_assign.md @@ -94,7 +94,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): 10.1 +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/atomic/atomic_ref/op_plus_assign.md b/reference/atomic/atomic_ref/op_plus_assign.md index 2b28b4e79d..a0ce8474e9 100644 --- a/reference/atomic/atomic_ref/op_plus_assign.md +++ b/reference/atomic/atomic_ref/op_plus_assign.md @@ -119,7 +119,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): 10.1 +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/atomic/atomic_ref/op_t.md b/reference/atomic/atomic_ref/op_t.md index a9c4cc15b6..67b200fa17 100644 --- a/reference/atomic/atomic_ref/op_t.md +++ b/reference/atomic/atomic_ref/op_t.md @@ -47,7 +47,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): 10.1 +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/atomic/atomic_ref/op_xor_assign.md b/reference/atomic/atomic_ref/op_xor_assign.md index 16695ffc1f..daf5a5a2b7 100644 --- a/reference/atomic/atomic_ref/op_xor_assign.md +++ b/reference/atomic/atomic_ref/op_xor_assign.md @@ -94,7 +94,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): 10.1 +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/atomic/atomic_ref/store.md b/reference/atomic/atomic_ref/store.md index 4a5b646013..9d993cf4d2 100644 --- a/reference/atomic/atomic_ref/store.md +++ b/reference/atomic/atomic_ref/store.md @@ -68,6 +68,6 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): 10.1 +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/atomic/atomic_ref/wait.md b/reference/atomic/atomic_ref/wait.md index 7bc8a699dd..a546c61b64 100644 --- a/reference/atomic/atomic_ref/wait.md +++ b/reference/atomic/atomic_ref/wait.md @@ -110,9 +110,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/atomic/atomic_signal_fence.md b/reference/atomic/atomic_signal_fence.md index c045969cb6..70e79afc81 100644 --- a/reference/atomic/atomic_signal_fence.md +++ b/reference/atomic/atomic_signal_fence.md @@ -44,9 +44,9 @@ namespace std { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/atomic/atomic_store.md b/reference/atomic/atomic_store.md index 8dbb252200..ce97d33c72 100644 --- a/reference/atomic/atomic_store.md +++ b/reference/atomic/atomic_store.md @@ -83,9 +83,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic_store_explicit.md b/reference/atomic/atomic_store_explicit.md index 4043d2a88a..742052570b 100644 --- a/reference/atomic/atomic_store_explicit.md +++ b/reference/atomic/atomic_store_explicit.md @@ -92,9 +92,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/atomic/atomic_thread_fence.md b/reference/atomic/atomic_thread_fence.md index 748ebc2d53..a47bf3fab9 100644 --- a/reference/atomic/atomic_thread_fence.md +++ b/reference/atomic/atomic_thread_fence.md @@ -135,9 +135,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/atomic/atomic_var_init.md b/reference/atomic/atomic_var_init.md index 4ae1ba2c44..490b1131f8 100644 --- a/reference/atomic/atomic_var_init.md +++ b/reference/atomic/atomic_var_init.md @@ -56,9 +56,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 実装例 diff --git a/reference/atomic/atomic_wait.md b/reference/atomic/atomic_wait.md index 3458917f5a..75f0080cb0 100644 --- a/reference/atomic/atomic_wait.md +++ b/reference/atomic/atomic_wait.md @@ -118,9 +118,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/atomic/atomic_wait_explicit.md b/reference/atomic/atomic_wait_explicit.md index a276ab3aa2..07a84ebbff 100644 --- a/reference/atomic/atomic_wait_explicit.md +++ b/reference/atomic/atomic_wait_explicit.md @@ -121,9 +121,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/atomic/kill_dependency.md b/reference/atomic/kill_dependency.md index 30344e9f86..75347c82a5 100644 --- a/reference/atomic/kill_dependency.md +++ b/reference/atomic/kill_dependency.md @@ -97,9 +97,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 実装例 diff --git a/reference/atomic/lock_free_property.md b/reference/atomic/lock_free_property.md index 985b4fa1de..66b2af7a31 100644 --- a/reference/atomic/lock_free_property.md +++ b/reference/atomic/lock_free_property.md @@ -90,9 +90,9 @@ T* : 2 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 関連項目 diff --git a/reference/atomic/memory_order.md b/reference/atomic/memory_order.md index f15821c5db..9657dfa026 100644 --- a/reference/atomic/memory_order.md +++ b/reference/atomic/memory_order.md @@ -89,9 +89,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/barrier.md b/reference/barrier.md index 038547a726..2544afbe2d 100644 --- a/reference/barrier.md +++ b/reference/barrier.md @@ -14,7 +14,7 @@ - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 11.0 +- [Clang](/implementation.md#clang): 11.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/barrier/barrier.md b/reference/barrier/barrier.md index 61d1f35772..9440878df2 100644 --- a/reference/barrier/barrier.md +++ b/reference/barrier/barrier.md @@ -153,7 +153,7 @@ Main 3 - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 11.0 +- [Clang](/implementation.md#clang): 11.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/barrier/barrier/arrive.md b/reference/barrier/barrier/arrive.md index 0f79daa985..3a79b6bf40 100644 --- a/reference/barrier/barrier/arrive.md +++ b/reference/barrier/barrier/arrive.md @@ -111,7 +111,7 @@ main: phase-2 - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 11.0 +- [Clang](/implementation.md#clang): 11.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/barrier/barrier/arrive_and_drop.md b/reference/barrier/barrier/arrive_and_drop.md index ceebaa67f8..8c54f1e472 100644 --- a/reference/barrier/barrier/arrive_and_drop.md +++ b/reference/barrier/barrier/arrive_and_drop.md @@ -112,7 +112,7 @@ main: phase-3 - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 11.0 +- [Clang](/implementation.md#clang): 11.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/barrier/barrier/arrive_and_wait.md b/reference/barrier/barrier/arrive_and_wait.md index 17627b672e..80259d5523 100644 --- a/reference/barrier/barrier/arrive_and_wait.md +++ b/reference/barrier/barrier/arrive_and_wait.md @@ -93,7 +93,7 @@ main: phase-3 - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 11.0 +- [Clang](/implementation.md#clang): 11.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/barrier/barrier/max.md b/reference/barrier/barrier/max.md index cf958d6f04..6551ce8dba 100644 --- a/reference/barrier/barrier/max.md +++ b/reference/barrier/barrier/max.md @@ -45,7 +45,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 11.0 +- [Clang](/implementation.md#clang): 11.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/barrier/barrier/op_constructor.md b/reference/barrier/barrier/op_constructor.md index d49f8f1cfe..88053f1774 100644 --- a/reference/barrier/barrier/op_constructor.md +++ b/reference/barrier/barrier/op_constructor.md @@ -103,7 +103,7 @@ phase-3 @140171067340544 - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 11.0 +- [Clang](/implementation.md#clang): 11.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/barrier/barrier/wait.md b/reference/barrier/barrier/wait.md index fe7cdb7dcb..1f78e962a3 100644 --- a/reference/barrier/barrier/wait.md +++ b/reference/barrier/barrier/wait.md @@ -104,7 +104,7 @@ main: phase-2 - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 11.0 +- [Clang](/implementation.md#clang): 11.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/bit/bit_cast.md b/reference/bit/bit_cast.md index ca959dd621..5ae118bcd3 100644 --- a/reference/bit/bit_cast.md +++ b/reference/bit/bit_cast.md @@ -96,7 +96,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 11.1 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/bit/bit_ceil.md b/reference/bit/bit_ceil.md index 6dff70a379..64f00a81b9 100644 --- a/reference/bit/bit_ceil.md +++ b/reference/bit/bit_ceil.md @@ -103,8 +103,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 9.0 -- [GCC](/implementation.md#gcc): 9.1 +- [Clang](/implementation.md#clang): 9.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/bit/bit_floor.md b/reference/bit/bit_floor.md index 9e019804c9..74843d9921 100644 --- a/reference/bit/bit_floor.md +++ b/reference/bit/bit_floor.md @@ -95,7 +95,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 9.1 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/bit/bit_width.md b/reference/bit/bit_width.md index 120fbfefd0..2a8da7935f 100644 --- a/reference/bit/bit_width.md +++ b/reference/bit/bit_width.md @@ -78,7 +78,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 9.1 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/bit/countl_one.md b/reference/bit/countl_one.md index e997a630a8..b17a7d96fb 100644 --- a/reference/bit/countl_one.md +++ b/reference/bit/countl_one.md @@ -63,8 +63,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 9.0 -- [GCC](/implementation.md#gcc): 9.2 +- [Clang](/implementation.md#clang): 9.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/bit/countl_zero.md b/reference/bit/countl_zero.md index e54492e730..47e4a29786 100644 --- a/reference/bit/countl_zero.md +++ b/reference/bit/countl_zero.md @@ -64,8 +64,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 9.0 -- [GCC](/implementation.md#gcc): 9.2 +- [Clang](/implementation.md#clang): 9.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/bit/countr_one.md b/reference/bit/countr_one.md index a50cf3adbd..971e37e200 100644 --- a/reference/bit/countr_one.md +++ b/reference/bit/countr_one.md @@ -59,8 +59,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 9.0 -- [GCC](/implementation.md#gcc): 9.2 +- [Clang](/implementation.md#clang): 9.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/bit/countr_zero.md b/reference/bit/countr_zero.md index 08bfcf5ec5..13b86d0e07 100644 --- a/reference/bit/countr_zero.md +++ b/reference/bit/countr_zero.md @@ -64,8 +64,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 9.0 -- [GCC](/implementation.md#gcc): 9.2 +- [Clang](/implementation.md#clang): 9.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/bit/has_single_bit.md b/reference/bit/has_single_bit.md index b0df10e20d..f5cfdd81d3 100644 --- a/reference/bit/has_single_bit.md +++ b/reference/bit/has_single_bit.md @@ -87,7 +87,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 9.1 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/bit/popcount.md b/reference/bit/popcount.md index 3aa7d16e0a..70f7338879 100644 --- a/reference/bit/popcount.md +++ b/reference/bit/popcount.md @@ -65,8 +65,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 9.0 -- [GCC](/implementation.md#gcc): 9.2 +- [Clang](/implementation.md#clang): 9.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/bit/rotl.md b/reference/bit/rotl.md index e9629c4991..44ae11f43d 100644 --- a/reference/bit/rotl.md +++ b/reference/bit/rotl.md @@ -66,8 +66,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 9.0 -- [GCC](/implementation.md#gcc): 9.2 +- [Clang](/implementation.md#clang): 9.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/bit/rotr.md b/reference/bit/rotr.md index c6b572442d..d584d3da5c 100644 --- a/reference/bit/rotr.md +++ b/reference/bit/rotr.md @@ -66,8 +66,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 9.0 -- [GCC](/implementation.md#gcc): 9.2 +- [Clang](/implementation.md#clang): 9.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/bitset/bitset/all.md b/reference/bitset/bitset/all.md index b1bc7202ed..41d6ea7d39 100644 --- a/reference/bitset/bitset/all.md +++ b/reference/bitset/bitset/all.md @@ -58,9 +58,9 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/bitset/bitset/to_ullong.md b/reference/bitset/bitset/to_ullong.md index 5b03cf19b6..a36c627998 100644 --- a/reference/bitset/bitset/to_ullong.md +++ b/reference/bitset/bitset/to_ullong.md @@ -47,9 +47,9 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.5.4 -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.5.4 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/cfenv.md b/reference/cfenv.md index 322bf2d610..55df58ca92 100644 --- a/reference/cfenv.md +++ b/reference/cfenv.md @@ -83,7 +83,7 @@ - [Clang](/implementation.md#clang): ? - [GCC](/implementation.md#gcc): ? - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] ## 関連項目 - [``](/reference/cmath.md) diff --git a/reference/cfenv/fe_all_except.md b/reference/cfenv/fe_all_except.md index 43239a1ae1..e01ee2303e 100644 --- a/reference/cfenv/fe_all_except.md +++ b/reference/cfenv/fe_all_except.md @@ -47,10 +47,10 @@ zero divided - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] - コンパイルオプション`/fp:strict`または`#pragma fenv_access (on)`が必要。さもなくば、正しく動作しないおそれがある。 diff --git a/reference/cfenv/fe_divbyzero.md b/reference/cfenv/fe_divbyzero.md index dc1bb7f0e1..030ecfc51f 100644 --- a/reference/cfenv/fe_divbyzero.md +++ b/reference/cfenv/fe_divbyzero.md @@ -47,10 +47,10 @@ zero divided - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] - コンパイルオプション`/fp:strict`または`#pragma fenv_access (on)`が必要。さもなくば、正しく動作しないおそれがある。 diff --git a/reference/cfenv/fe_downward.md b/reference/cfenv/fe_downward.md index 241efacffa..831797391e 100644 --- a/reference/cfenv/fe_downward.md +++ b/reference/cfenv/fe_downward.md @@ -57,10 +57,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] - コンパイルオプション`/fp:strict`または`#pragma fenv_access (on)`が必要。さもなくば、正しく動作しないおそれがある。 diff --git a/reference/cfenv/fe_inexact.md b/reference/cfenv/fe_inexact.md index 5fd6dcabef..a1feecd2a6 100644 --- a/reference/cfenv/fe_inexact.md +++ b/reference/cfenv/fe_inexact.md @@ -42,10 +42,10 @@ raised inexact - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] - コンパイルオプション`/fp:strict`または`#pragma fenv_access (on)`が必要。さもなくば、正しく動作しないおそれがある。 diff --git a/reference/cfenv/fe_invalid.md b/reference/cfenv/fe_invalid.md index 0ed0b32707..95fe60125a 100644 --- a/reference/cfenv/fe_invalid.md +++ b/reference/cfenv/fe_invalid.md @@ -44,10 +44,10 @@ raised invalid - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] - コンパイルオプション`/fp:strict`または`#pragma fenv_access (on)`が必要。さもなくば、正しく動作しないおそれがある。 diff --git a/reference/cfenv/fe_overflow.md b/reference/cfenv/fe_overflow.md index 47bbca266c..aff8528be5 100644 --- a/reference/cfenv/fe_overflow.md +++ b/reference/cfenv/fe_overflow.md @@ -44,10 +44,10 @@ raised overflow - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] - コンパイルオプション`/fp:strict`または`#pragma fenv_access (on)`が必要。さもなくば、正しく動作しないおそれがある。 diff --git a/reference/cfenv/fe_tonearest.md b/reference/cfenv/fe_tonearest.md index 7a77e7ebc1..975d77652d 100644 --- a/reference/cfenv/fe_tonearest.md +++ b/reference/cfenv/fe_tonearest.md @@ -68,10 +68,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] - コンパイルオプション`/fp:strict`または`#pragma fenv_access (on)`が必要。さもなくば、正しく動作しないおそれがある。 diff --git a/reference/cfenv/fe_towardzero.md b/reference/cfenv/fe_towardzero.md index f6e72bb215..aa4b0dc8ef 100644 --- a/reference/cfenv/fe_towardzero.md +++ b/reference/cfenv/fe_towardzero.md @@ -57,10 +57,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] - コンパイルオプション`/fp:strict`または`#pragma fenv_access (on)`が必要。さもなくば、正しく動作しないおそれがある。 diff --git a/reference/cfenv/fe_underflow.md b/reference/cfenv/fe_underflow.md index ae541d9bb0..8d4967252d 100644 --- a/reference/cfenv/fe_underflow.md +++ b/reference/cfenv/fe_underflow.md @@ -43,10 +43,10 @@ raised underflow - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] - コンパイルオプション`/fp:strict`または`#pragma fenv_access (on)`が必要。さもなくば、正しく動作しないおそれがある。 diff --git a/reference/cfenv/fe_upward.md b/reference/cfenv/fe_upward.md index 86dda9469b..7e9ef34f3b 100644 --- a/reference/cfenv/fe_upward.md +++ b/reference/cfenv/fe_upward.md @@ -57,10 +57,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] - コンパイルオプション`/fp:strict`または`#pragma fenv_access (on)`が必要。さもなくば、正しく動作しないおそれがある。 diff --git a/reference/cfenv/feclearexcept.md b/reference/cfenv/feclearexcept.md index 5542cbae3d..04ebdd5da6 100644 --- a/reference/cfenv/feclearexcept.md +++ b/reference/cfenv/feclearexcept.md @@ -58,10 +58,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] - コンパイルオプション`/fp:strict`または`#pragma fenv_access (on)`が必要。さもなくば、正しく動作しないおそれがある。 diff --git a/reference/cfenv/fegetexceptflag.md b/reference/cfenv/fegetexceptflag.md index 372d2f3035..1f09411abc 100644 --- a/reference/cfenv/fegetexceptflag.md +++ b/reference/cfenv/fegetexceptflag.md @@ -62,10 +62,10 @@ zero divided - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] - コンパイルオプション`/fp:strict`または`#pragma fenv_access (on)`が必要。さもなくば、正しく動作しないおそれがある。 diff --git a/reference/cfenv/fegetround.md b/reference/cfenv/fegetround.md index d2f95eee31..042cc5e38d 100644 --- a/reference/cfenv/fegetround.md +++ b/reference/cfenv/fegetround.md @@ -62,9 +62,9 @@ downward - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] - コンパイルオプション`/fp:strict`または`#pragma fenv_access (on)`が必要。さもなくば、正しく動作しないおそれがある。 diff --git a/reference/cfenv/feraiseexcept.md b/reference/cfenv/feraiseexcept.md index b99ee7d5df..73881729fd 100644 --- a/reference/cfenv/feraiseexcept.md +++ b/reference/cfenv/feraiseexcept.md @@ -77,10 +77,10 @@ overflow - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] - コンパイルオプション`/fp:strict`または`#pragma fenv_access (on)`が必要。さもなくば、正しく動作しないおそれがある。 diff --git a/reference/cfenv/fesetexceptflag.md b/reference/cfenv/fesetexceptflag.md index 73564b522c..a1cb6cb138 100644 --- a/reference/cfenv/fesetexceptflag.md +++ b/reference/cfenv/fesetexceptflag.md @@ -71,10 +71,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] - コンパイルオプション`/fp:strict`または`#pragma fenv_access (on)`が必要。さもなくば、正しく動作しないおそれがある。 diff --git a/reference/cfenv/fesetround.md b/reference/cfenv/fesetround.md index 5d2ba80096..43df639e5d 100644 --- a/reference/cfenv/fesetround.md +++ b/reference/cfenv/fesetround.md @@ -94,10 +94,10 @@ upward - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] - コンパイルオプション`/fp:strict`または`#pragma fenv_access (on)`が必要。さもなくば、正しく動作しないおそれがある。 diff --git a/reference/cfenv/fetestexcept.md b/reference/cfenv/fetestexcept.md index 01aac87315..97838e5d07 100644 --- a/reference/cfenv/fetestexcept.md +++ b/reference/cfenv/fetestexcept.md @@ -92,10 +92,10 @@ overflow - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] - コンパイルオプション`/fp:strict`または`#pragma fenv_access (on)`が必要。さもなくば、正しく動作しないおそれがある。 diff --git a/reference/cfenv/fexcept_t.md b/reference/cfenv/fexcept_t.md index a7e48fad47..657fde5344 100644 --- a/reference/cfenv/fexcept_t.md +++ b/reference/cfenv/fexcept_t.md @@ -51,10 +51,10 @@ zero divided - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] - コンパイルオプション`/fp:strict`または`#pragma fenv_access (on)`が必要。さもなくば、正しく動作しないおそれがある。 diff --git a/reference/cfloat/dbl_decimal_dig.md b/reference/cfloat/dbl_decimal_dig.md index ef16da9be1..6e8ebca1a8 100644 --- a/reference/cfloat/dbl_decimal_dig.md +++ b/reference/cfloat/dbl_decimal_dig.md @@ -71,8 +71,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 3.9 -- [GCC](/implementation.md#gcc): (9.1時点で実装なし) +- [Clang](/implementation.md#clang): 3.9 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cfloat/dbl_has_subnorm.md b/reference/cfloat/dbl_has_subnorm.md index f29b3fb00c..279f18e142 100644 --- a/reference/cfloat/dbl_has_subnorm.md +++ b/reference/cfloat/dbl_has_subnorm.md @@ -55,8 +55,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.1時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cfloat/dbl_true_min.md b/reference/cfloat/dbl_true_min.md index 61c29a52f1..9d9138e8a2 100644 --- a/reference/cfloat/dbl_true_min.md +++ b/reference/cfloat/dbl_true_min.md @@ -53,8 +53,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.1時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cfloat/decimal_dig.md b/reference/cfloat/decimal_dig.md index 2e617e5207..c19fb885b8 100644 --- a/reference/cfloat/decimal_dig.md +++ b/reference/cfloat/decimal_dig.md @@ -78,6 +78,6 @@ int main() - [Clang](/implementation.md#clang): ? - [GCC](/implementation.md#gcc): ? - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] - 2013は、正しく実装されていない。C++11での最低値である10と定義されている。しかし、`double`および`long double`がIEEE 754倍精度で実装されているため、少なくとも17以上でなければならない。 - 2015は、正しく17と定義されている。 diff --git a/reference/cfloat/flt_decimal_dig.md b/reference/cfloat/flt_decimal_dig.md index 4f1f04c901..c2771dc771 100644 --- a/reference/cfloat/flt_decimal_dig.md +++ b/reference/cfloat/flt_decimal_dig.md @@ -71,8 +71,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 3.9 -- [GCC](/implementation.md#gcc): (9.1時点で実装なし) +- [Clang](/implementation.md#clang): 3.9 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cfloat/flt_eval_method.md b/reference/cfloat/flt_eval_method.md index eca6f2888e..75665d4279 100644 --- a/reference/cfloat/flt_eval_method.md +++ b/reference/cfloat/flt_eval_method.md @@ -37,7 +37,7 @@ - [Clang](/implementation.md#clang): ? - [GCC](/implementation.md#gcc): ? - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] - `/fp:fast`コンパイラオプションが指定されている場合、-1と定義されている。 - ターゲットのCPUアーキテクチャが`x86`以外である場合、0と定義されている。 - ターゲットのCPUアーキテクチャが`x86`で、SSE2を使用する場合(`/arch:SSE2`以上のコンパイラオプション)、0と定義されている。 diff --git a/reference/cfloat/flt_has_subnorm.md b/reference/cfloat/flt_has_subnorm.md index 043f03e959..1467249db5 100644 --- a/reference/cfloat/flt_has_subnorm.md +++ b/reference/cfloat/flt_has_subnorm.md @@ -55,8 +55,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.1時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cfloat/flt_true_min.md b/reference/cfloat/flt_true_min.md index 8ae3aceaee..d959c4c8df 100644 --- a/reference/cfloat/flt_true_min.md +++ b/reference/cfloat/flt_true_min.md @@ -53,8 +53,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.1時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cfloat/ldbl_decimal_dig.md b/reference/cfloat/ldbl_decimal_dig.md index 1b7243b68b..6788bdd03a 100644 --- a/reference/cfloat/ldbl_decimal_dig.md +++ b/reference/cfloat/ldbl_decimal_dig.md @@ -71,8 +71,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 3.9 -- [GCC](/implementation.md#gcc): (9.1時点で実装なし) +- [Clang](/implementation.md#clang): 3.9 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cfloat/ldbl_has_subnorm.md b/reference/cfloat/ldbl_has_subnorm.md index 94e0ce696a..649e0fc076 100644 --- a/reference/cfloat/ldbl_has_subnorm.md +++ b/reference/cfloat/ldbl_has_subnorm.md @@ -55,8 +55,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.1時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cfloat/ldbl_true_min.md b/reference/cfloat/ldbl_true_min.md index 154ea86090..e22a749e50 100644 --- a/reference/cfloat/ldbl_true_min.md +++ b/reference/cfloat/ldbl_true_min.md @@ -53,8 +53,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.1時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/charconv.md b/reference/charconv.md index bdbe03ca84..da6702674c 100644 --- a/reference/charconv.md +++ b/reference/charconv.md @@ -66,9 +66,9 @@ XMLやJSONに代表されるテキストベースのデータを利用するケ - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0(整数のみ), 14.0(to_chars()のみ浮動小数点もsupport) -- [GCC](/implementation.md#gcc): 8.0(整数のみ), 11.1(full support) -- [Visual C++](/implementation.md#visual_cpp): 2017 update 7(整数のみ), update 9(full support) +- [Clang](/implementation.md#clang): 7.0(整数のみ) [mark verified], 14.0(to_chars()のみ浮動小数点もsupport) [mark verified] +- [GCC](/implementation.md#gcc): 8.0(整数のみ) [mark verified], 11.1(full support) [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 7(整数のみ) [mark verified], update 9(full support) [mark verified] ## 参照 - [C++1z ロケール依存なし、フォーマット解析なしの高速な文字列・数値変換 - Faith and Brave - C++で遊ぼう](https://faithandbrave.hateblo.jp/entry/2016/08/24/181540) diff --git a/reference/charconv/chars_format.md b/reference/charconv/chars_format.md index f58775209d..0501f5c6c0 100644 --- a/reference/charconv/chars_format.md +++ b/reference/charconv/chars_format.md @@ -36,7 +36,7 @@ namespace std { ### 処理系 - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2017 update 8 +- [Visual C++](/implementation.md#visual_cpp): 2017 update 8 [mark verified] ## 関連項目 - [`to_chars`](../charconv/to_chars.md) diff --git a/reference/charconv/from_chars.md b/reference/charconv/from_chars.md index cd41fca037..f0581a3f3d 100644 --- a/reference/charconv/from_chars.md +++ b/reference/charconv/from_chars.md @@ -514,9 +514,9 @@ int main() { - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0(整数のみ) -- [GCC](/implementation.md#gcc): 8.0(整数のみ), 11.1(full support) -- [Visual C++](/implementation.md#visual_cpp): 2017 update 7(整数のみ), update 9(full support) +- [Clang](/implementation.md#clang): 7.0(整数のみ) [mark verified] +- [GCC](/implementation.md#gcc): 8.0(整数のみ) [mark verified], 11.1(full support) [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 7(整数のみ) [mark verified], update 9(full support) [mark verified] ## 関連項目 diff --git a/reference/charconv/from_chars_result.md b/reference/charconv/from_chars_result.md index 1f11dbac71..a0dba968bb 100644 --- a/reference/charconv/from_chars_result.md +++ b/reference/charconv/from_chars_result.md @@ -46,9 +46,9 @@ namespace std { - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.0 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 7 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 7 [mark verified] ## 関連項目 - [`from_chars`](../charconv/from_chars.md) diff --git a/reference/charconv/to_chars.md b/reference/charconv/to_chars.md index 81bc4f0a71..5a5370ac42 100644 --- a/reference/charconv/to_chars.md +++ b/reference/charconv/to_chars.md @@ -391,9 +391,9 @@ z - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0(整数のみ), 14.0(full support) -- [GCC](/implementation.md#gcc): 8.0(整数のみ), 11.1(full support) -- [Visual C++](/implementation.md#visual_cpp): 2017 update 7(整数のみ), update 9(full support) +- [Clang](/implementation.md#clang): 7.0(整数のみ) [mark verified], 14.0(full support) [mark verified] +- [GCC](/implementation.md#gcc): 8.0(整数のみ) [mark verified], 11.1(full support) [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 7(整数のみ) [mark verified], update 9(full support) [mark verified] ## 関連項目 - [`chars_format`](../charconv/chars_format.md) diff --git a/reference/charconv/to_chars_result.md b/reference/charconv/to_chars_result.md index 855bb48092..114b6942e2 100644 --- a/reference/charconv/to_chars_result.md +++ b/reference/charconv/to_chars_result.md @@ -45,9 +45,9 @@ namespace std { - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.0 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 7 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 7 [mark verified] ## 関連項目 - [`to_chars`](../charconv/to_chars.md) diff --git a/reference/chrono/ambiguous_local_time.md b/reference/chrono/ambiguous_local_time.md index 371f211418..e44b258d13 100644 --- a/reference/chrono/ambiguous_local_time.md +++ b/reference/chrono/ambiguous_local_time.md @@ -79,6 +79,6 @@ int main() ``` ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/choose.md b/reference/chrono/choose.md index 86d1e37f0d..ba5913771f 100644 --- a/reference/chrono/choose.md +++ b/reference/chrono/choose.md @@ -69,9 +69,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/clock_cast.md b/reference/chrono/clock_cast.md index b54df361dc..4f69bd19b4 100644 --- a/reference/chrono/clock_cast.md +++ b/reference/chrono/clock_cast.md @@ -129,6 +129,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/clock_time_conversion.md b/reference/chrono/clock_time_conversion.md index 884eea202b..7795ba08d1 100644 --- a/reference/chrono/clock_time_conversion.md +++ b/reference/chrono/clock_time_conversion.md @@ -216,6 +216,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/common_type.md b/reference/chrono/common_type.md index 8eb6405dd7..53c684745d 100644 --- a/reference/chrono/common_type.md +++ b/reference/chrono/common_type.md @@ -97,9 +97,9 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 - [common_type](/reference/type_traits/common_type.md) diff --git a/reference/chrono/current_zone.md b/reference/chrono/current_zone.md index 05d77712fc..7343be17ee 100644 --- a/reference/chrono/current_zone.md +++ b/reference/chrono/current_zone.md @@ -56,6 +56,6 @@ Asia/Tokyo - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/day.md b/reference/chrono/day.md index aa8404c089..20b3854c6f 100644 --- a/reference/chrono/day.md +++ b/reference/chrono/day.md @@ -146,7 +146,7 @@ Mar/01 - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 (入出力ストリームなし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 (入出力ストリームなし) [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/day/formatter.md b/reference/chrono/day/formatter.md index c864b580a8..7dfaba5d45 100644 --- a/reference/chrono/day/formatter.md +++ b/reference/chrono/day/formatter.md @@ -46,9 +46,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/day/from_stream.md b/reference/chrono/day/from_stream.md index 2661692f63..3ce5b90aec 100644 --- a/reference/chrono/day/from_stream.md +++ b/reference/chrono/day/from_stream.md @@ -70,9 +70,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/day/ok.md b/reference/chrono/day/ok.md index 600b9bb7b3..9c04f2eeeb 100644 --- a/reference/chrono/day/ok.md +++ b/reference/chrono/day/ok.md @@ -52,6 +52,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/day/op_append.md b/reference/chrono/day/op_append.md index 5dfd5f08c3..1014f4cec4 100644 --- a/reference/chrono/day/op_append.md +++ b/reference/chrono/day/op_append.md @@ -65,6 +65,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/day/op_compare_3way.md b/reference/chrono/day/op_compare_3way.md index 9a066e775b..b6fa5cd204 100644 --- a/reference/chrono/day/op_compare_3way.md +++ b/reference/chrono/day/op_compare_3way.md @@ -54,6 +54,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/day/op_constructor.md b/reference/chrono/day/op_constructor.md index 29dace54ac..19526df2cd 100644 --- a/reference/chrono/day/op_constructor.md +++ b/reference/chrono/day/op_constructor.md @@ -56,6 +56,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/day/op_d.md b/reference/chrono/day/op_d.md index 58f0870e91..33dd39f752 100644 --- a/reference/chrono/day/op_d.md +++ b/reference/chrono/day/op_d.md @@ -67,6 +67,6 @@ Mar/01 - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/day/op_decrement.md b/reference/chrono/day/op_decrement.md index b0d2daac02..281b488227 100644 --- a/reference/chrono/day/op_decrement.md +++ b/reference/chrono/day/op_decrement.md @@ -69,6 +69,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/day/op_equal.md b/reference/chrono/day/op_equal.md index 23bdab35b3..80e31d4269 100644 --- a/reference/chrono/day/op_equal.md +++ b/reference/chrono/day/op_equal.md @@ -49,6 +49,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/day/op_increment.md b/reference/chrono/day/op_increment.md index 6b32168eec..1a4d07ee4a 100644 --- a/reference/chrono/day/op_increment.md +++ b/reference/chrono/day/op_increment.md @@ -69,6 +69,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/day/op_minus.md b/reference/chrono/day/op_minus.md index 667791cc2c..3674d5f475 100644 --- a/reference/chrono/day/op_minus.md +++ b/reference/chrono/day/op_minus.md @@ -55,6 +55,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/day/op_minus_assign.md b/reference/chrono/day/op_minus_assign.md index eb9ae2e40e..c75bc58889 100644 --- a/reference/chrono/day/op_minus_assign.md +++ b/reference/chrono/day/op_minus_assign.md @@ -52,6 +52,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/day/op_ostream.md b/reference/chrono/day/op_ostream.md index d01d2d9fea..41d72bc4a8 100644 --- a/reference/chrono/day/op_ostream.md +++ b/reference/chrono/day/op_ostream.md @@ -57,9 +57,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/day/op_plus.md b/reference/chrono/day/op_plus.md index e586d6d52f..a89a933c15 100644 --- a/reference/chrono/day/op_plus.md +++ b/reference/chrono/day/op_plus.md @@ -65,6 +65,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/day/op_plus_assign.md b/reference/chrono/day/op_plus_assign.md index 390482704f..ea91df043f 100644 --- a/reference/chrono/day/op_plus_assign.md +++ b/reference/chrono/day/op_plus_assign.md @@ -52,6 +52,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/day/op_unsigned_int.md b/reference/chrono/day/op_unsigned_int.md index cd1b6c55ed..8af9511b43 100644 --- a/reference/chrono/day/op_unsigned_int.md +++ b/reference/chrono/day/op_unsigned_int.md @@ -41,6 +41,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/duration.md b/reference/chrono/duration.md index 9bdcbe1762..a1c3c54be7 100644 --- a/reference/chrono/duration.md +++ b/reference/chrono/duration.md @@ -204,7 +204,7 @@ Tue Oct 16 16:25:11 2012 - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/chrono/duration/abs.md b/reference/chrono/duration/abs.md index d39b3e8938..6804630e3d 100644 --- a/reference/chrono/duration/abs.md +++ b/reference/chrono/duration/abs.md @@ -54,8 +54,8 @@ int main() - C++17 ### 処理系 -- [GCC](/implementation.md#gcc): 7.3 -- [Clang](/implementation.md#clang): 3.8 +- [GCC](/implementation.md#gcc): 7.3 [mark verified] +- [Clang](/implementation.md#clang): 3.8 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/chrono/duration/ceil.md b/reference/chrono/duration/ceil.md index 215ca108c3..4149ad514f 100644 --- a/reference/chrono/duration/ceil.md +++ b/reference/chrono/duration/ceil.md @@ -47,8 +47,8 @@ int main() - C++17 ### 処理系 -- [GCC](/implementation.md#gcc): 7.3 -- [Clang](/implementation.md#clang): 3.8 +- [GCC](/implementation.md#gcc): 7.3 [mark verified] +- [Clang](/implementation.md#clang): 3.8 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/chrono/duration/count.md b/reference/chrono/duration/count.md index db7292ca01..6f2e47f1e9 100644 --- a/reference/chrono/duration/count.md +++ b/reference/chrono/duration/count.md @@ -45,6 +45,6 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.5.1, 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.5.1 [mark verified], 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] diff --git a/reference/chrono/duration/floor.md b/reference/chrono/duration/floor.md index 1017422f04..bfe8df6002 100644 --- a/reference/chrono/duration/floor.md +++ b/reference/chrono/duration/floor.md @@ -47,8 +47,8 @@ int main() - C++17 ### 処理系 -- [GCC](/implementation.md#gcc): 7.3 -- [Clang](/implementation.md#clang): 3.8 +- [GCC](/implementation.md#gcc): 7.3 [mark verified] +- [Clang](/implementation.md#clang): 3.8 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/chrono/duration/formatter.md b/reference/chrono/duration/formatter.md index d95daa4242..5c5fcf1f27 100644 --- a/reference/chrono/duration/formatter.md +++ b/reference/chrono/duration/formatter.md @@ -78,9 +78,9 @@ AM/PM : PM 03:00 - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/duration/from_stream.md b/reference/chrono/duration/from_stream.md index 5c60c8f68a..52fabc2a87 100644 --- a/reference/chrono/duration/from_stream.md +++ b/reference/chrono/duration/from_stream.md @@ -84,9 +84,9 @@ JST - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/duration/max.md b/reference/chrono/duration/max.md index c51b00e5b9..b7d37ee039 100644 --- a/reference/chrono/duration/max.md +++ b/reference/chrono/duration/max.md @@ -48,8 +48,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.5.1, 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.5.1 [mark verified], 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/chrono/duration/min.md b/reference/chrono/duration/min.md index b48e7ca119..cef0c209db 100644 --- a/reference/chrono/duration/min.md +++ b/reference/chrono/duration/min.md @@ -48,8 +48,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.5.1, 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.5.1 [mark verified], 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/chrono/duration/op_compare_3way.md b/reference/chrono/duration/op_compare_3way.md index 7dd9b339ca..8695ca874f 100644 --- a/reference/chrono/duration/op_compare_3way.md +++ b/reference/chrono/duration/op_compare_3way.md @@ -59,7 +59,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10 +- [GCC](/implementation.md#gcc): 10 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/chrono/duration/op_constructor.md b/reference/chrono/duration/op_constructor.md index 95afebbeef..64a1a611bd 100644 --- a/reference/chrono/duration/op_constructor.md +++ b/reference/chrono/duration/op_constructor.md @@ -75,9 +75,9 @@ d5 : 3000 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.4.7 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/chrono/duration/op_decrement.md b/reference/chrono/duration/op_decrement.md index 6d9617b9ef..959aa13f38 100644 --- a/reference/chrono/duration/op_decrement.md +++ b/reference/chrono/duration/op_decrement.md @@ -69,8 +69,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.5.1, 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.5.1 [mark verified], 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/chrono/duration/op_divide.md b/reference/chrono/duration/op_divide.md index 61ff338c02..15ffa95b3d 100644 --- a/reference/chrono/duration/op_divide.md +++ b/reference/chrono/duration/op_divide.md @@ -95,8 +95,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2013でサンプルコードをコンパイルしたところ、duration / durationでコンパイルエラーになった。 diff --git a/reference/chrono/duration/op_divide_assign.md b/reference/chrono/duration/op_divide_assign.md index 9d77d6926b..35ca74a69e 100644 --- a/reference/chrono/duration/op_divide_assign.md +++ b/reference/chrono/duration/op_divide_assign.md @@ -54,8 +54,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.5.1, 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.5.1 [mark verified], 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/chrono/duration/op_equal.md b/reference/chrono/duration/op_equal.md index cb266a7ce1..a896450569 100644 --- a/reference/chrono/duration/op_equal.md +++ b/reference/chrono/duration/op_equal.md @@ -57,8 +57,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 - [N3469 Constexpr Library Additions: chrono, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3469.html) diff --git a/reference/chrono/duration/op_greater.md b/reference/chrono/duration/op_greater.md index e670c5fc47..17bb85f76b 100644 --- a/reference/chrono/duration/op_greater.md +++ b/reference/chrono/duration/op_greater.md @@ -51,8 +51,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 - [N3469 Constexpr Library Additions: chrono, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3469.html) diff --git a/reference/chrono/duration/op_greater_equal.md b/reference/chrono/duration/op_greater_equal.md index 7ae068c48b..97702fa836 100644 --- a/reference/chrono/duration/op_greater_equal.md +++ b/reference/chrono/duration/op_greater_equal.md @@ -51,8 +51,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 - [N3469 Constexpr Library Additions: chrono, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3469.html) diff --git a/reference/chrono/duration/op_h.md b/reference/chrono/duration/op_h.md index 8820c3efc1..f8202ad8a3 100644 --- a/reference/chrono/duration/op_h.md +++ b/reference/chrono/duration/op_h.md @@ -68,10 +68,10 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.4 -- [GCC](/implementation.md#gcc): 4.9.0 +- [Clang](/implementation.md#clang): 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] ## 参照 - [N3642 User-defined Literals for Standard Library Types (part 1 - version 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3642.pdf) diff --git a/reference/chrono/duration/op_increment.md b/reference/chrono/duration/op_increment.md index 2d8c578671..9b537022cb 100644 --- a/reference/chrono/duration/op_increment.md +++ b/reference/chrono/duration/op_increment.md @@ -68,8 +68,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.5.1, 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.5.1 [mark verified], 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/chrono/duration/op_less.md b/reference/chrono/duration/op_less.md index ba5c5c73a1..34a0f8d541 100644 --- a/reference/chrono/duration/op_less.md +++ b/reference/chrono/duration/op_less.md @@ -52,8 +52,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 - [N3469 Constexpr Library Additions: chrono, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3469.html) diff --git a/reference/chrono/duration/op_less_equal.md b/reference/chrono/duration/op_less_equal.md index a1c3547946..2750c36d92 100644 --- a/reference/chrono/duration/op_less_equal.md +++ b/reference/chrono/duration/op_less_equal.md @@ -52,8 +52,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 - [N3469 Constexpr Library Additions: chrono, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3469.html) diff --git a/reference/chrono/duration/op_min.md b/reference/chrono/duration/op_min.md index 01b43dbd78..5d6fbc4058 100644 --- a/reference/chrono/duration/op_min.md +++ b/reference/chrono/duration/op_min.md @@ -68,10 +68,10 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.4 -- [GCC](/implementation.md#gcc): 4.9.0 +- [Clang](/implementation.md#clang): 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] ## 参照 - [N3642 User-defined Literals for Standard Library Types (part 1 - version 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3642.pdf) diff --git a/reference/chrono/duration/op_minus.md b/reference/chrono/duration/op_minus.md index 6e948f9b47..4500a6f706 100644 --- a/reference/chrono/duration/op_minus.md +++ b/reference/chrono/duration/op_minus.md @@ -59,6 +59,6 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] diff --git a/reference/chrono/duration/op_minus_assign.md b/reference/chrono/duration/op_minus_assign.md index 248fe9f500..ed05fb3d0e 100644 --- a/reference/chrono/duration/op_minus_assign.md +++ b/reference/chrono/duration/op_minus_assign.md @@ -55,8 +55,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.5.1, 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.5.1 [mark verified], 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/chrono/duration/op_modulo.md b/reference/chrono/duration/op_modulo.md index 3320456f02..a9f1c51d06 100644 --- a/reference/chrono/duration/op_modulo.md +++ b/reference/chrono/duration/op_modulo.md @@ -93,8 +93,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012, 2013でサンプルコードをコンパイルしたところ、duration % durationでコンパイルエラーになった。 diff --git a/reference/chrono/duration/op_modulo_assign.md b/reference/chrono/duration/op_modulo_assign.md index ab930d7739..cdcff461f7 100644 --- a/reference/chrono/duration/op_modulo_assign.md +++ b/reference/chrono/duration/op_modulo_assign.md @@ -62,8 +62,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.5.1, 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.5.1 [mark verified], 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/chrono/duration/op_ms.md b/reference/chrono/duration/op_ms.md index 84c3ccf01c..c4aa35cb8c 100644 --- a/reference/chrono/duration/op_ms.md +++ b/reference/chrono/duration/op_ms.md @@ -68,10 +68,10 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.4 -- [GCC](/implementation.md#gcc): 4.9.0 +- [Clang](/implementation.md#clang): 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] ## 参照 - [N3642 User-defined Literals for Standard Library Types (part 1 - version 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3642.pdf) diff --git a/reference/chrono/duration/op_multiply.md b/reference/chrono/duration/op_multiply.md index 43b49d27c7..345dc27ddd 100644 --- a/reference/chrono/duration/op_multiply.md +++ b/reference/chrono/duration/op_multiply.md @@ -80,8 +80,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/chrono/duration/op_multiply_assign.md b/reference/chrono/duration/op_multiply_assign.md index d31c58a391..bb7f3e50f5 100644 --- a/reference/chrono/duration/op_multiply_assign.md +++ b/reference/chrono/duration/op_multiply_assign.md @@ -52,8 +52,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.5.1, 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.5.1 [mark verified], 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/chrono/duration/op_not_equal.md b/reference/chrono/duration/op_not_equal.md index fa0e3324f9..2d20757648 100644 --- a/reference/chrono/duration/op_not_equal.md +++ b/reference/chrono/duration/op_not_equal.md @@ -46,8 +46,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 - [N3469 Constexpr Library Additions: chrono, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3469.html) diff --git a/reference/chrono/duration/op_ns.md b/reference/chrono/duration/op_ns.md index cb9013c0e2..8be04be1e5 100644 --- a/reference/chrono/duration/op_ns.md +++ b/reference/chrono/duration/op_ns.md @@ -68,10 +68,10 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.4 -- [GCC](/implementation.md#gcc): 4.9.0 +- [Clang](/implementation.md#clang): 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] ## 参照 - [N3642 User-defined Literals for Standard Library Types (part 1 - version 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3642.pdf) diff --git a/reference/chrono/duration/op_ostream.md b/reference/chrono/duration/op_ostream.md index 044a8c65f8..759979ee9f 100644 --- a/reference/chrono/duration/op_ostream.md +++ b/reference/chrono/duration/op_ostream.md @@ -120,9 +120,9 @@ float sec : 1.23s - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 - [P2051R0 C++ Standard Library Issues to be moved in Prague](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2051r0.html) diff --git a/reference/chrono/duration/op_plus.md b/reference/chrono/duration/op_plus.md index 5a8f4bba89..789b55dc62 100644 --- a/reference/chrono/duration/op_plus.md +++ b/reference/chrono/duration/op_plus.md @@ -59,6 +59,6 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] diff --git a/reference/chrono/duration/op_plus_assign.md b/reference/chrono/duration/op_plus_assign.md index 3445bc1094..3a6b8a9b70 100644 --- a/reference/chrono/duration/op_plus_assign.md +++ b/reference/chrono/duration/op_plus_assign.md @@ -55,8 +55,8 @@ int main() ### 処理系 -- [GCC](/implementation.md#gcc): 4.5.1, 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.5.1 [mark verified], 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/chrono/duration/op_s.md b/reference/chrono/duration/op_s.md index 6ad1b28016..e9419e4639 100644 --- a/reference/chrono/duration/op_s.md +++ b/reference/chrono/duration/op_s.md @@ -68,10 +68,10 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.4 -- [GCC](/implementation.md#gcc): 4.9.0 +- [Clang](/implementation.md#clang): 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] ## 参照 - [N3642 User-defined Literals for Standard Library Types (part 1 - version 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3642.pdf) diff --git a/reference/chrono/duration/op_unary_minus.md b/reference/chrono/duration/op_unary_minus.md index 1ba16314c2..dcc5ff4669 100644 --- a/reference/chrono/duration/op_unary_minus.md +++ b/reference/chrono/duration/op_unary_minus.md @@ -55,8 +55,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.5.1, 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.5.1 [mark verified], 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ### 参照 - [P0548R1 : common_type and duration](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0548r1.pdf) diff --git a/reference/chrono/duration/op_unary_plus.md b/reference/chrono/duration/op_unary_plus.md index 8cbd95396b..989edfe59e 100644 --- a/reference/chrono/duration/op_unary_plus.md +++ b/reference/chrono/duration/op_unary_plus.md @@ -52,8 +52,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.5.1, 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.5.1 [mark verified], 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ### 参照 - [P0548R1 : common_type and duration](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0548r1.pdf) diff --git a/reference/chrono/duration/op_us.md b/reference/chrono/duration/op_us.md index 3119b3370c..35b6afb335 100644 --- a/reference/chrono/duration/op_us.md +++ b/reference/chrono/duration/op_us.md @@ -69,10 +69,10 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.4 -- [GCC](/implementation.md#gcc): 4.9.0 +- [Clang](/implementation.md#clang): 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] ## 参照 - [N3642 User-defined Literals for Standard Library Types (part 1 - version 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3642.pdf) diff --git a/reference/chrono/duration/round.md b/reference/chrono/duration/round.md index 97d082f6bb..fb42c8a01f 100644 --- a/reference/chrono/duration/round.md +++ b/reference/chrono/duration/round.md @@ -51,8 +51,8 @@ int main() - C++17 ### 処理系 -- [GCC](/implementation.md#gcc): 7.3 -- [Clang](/implementation.md#clang): 3.8 +- [GCC](/implementation.md#gcc): 7.3 [mark verified] +- [Clang](/implementation.md#clang): 3.8 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/chrono/duration/zero.md b/reference/chrono/duration/zero.md index 8570d747b4..e9115f8e07 100644 --- a/reference/chrono/duration/zero.md +++ b/reference/chrono/duration/zero.md @@ -47,8 +47,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.5.1, 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.5.1 [mark verified], 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/chrono/duration_aliases.md b/reference/chrono/duration_aliases.md index 85c92b5faf..00491cea5c 100644 --- a/reference/chrono/duration_aliases.md +++ b/reference/chrono/duration_aliases.md @@ -144,9 +144,9 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 関連項目 diff --git a/reference/chrono/duration_cast.md b/reference/chrono/duration_cast.md index 7e9997eeec..223cb7e901 100644 --- a/reference/chrono/duration_cast.md +++ b/reference/chrono/duration_cast.md @@ -51,8 +51,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 関連項目 diff --git a/reference/chrono/duration_values.md b/reference/chrono/duration_values.md index b30fb07a20..581ab9be1f 100644 --- a/reference/chrono/duration_values.md +++ b/reference/chrono/duration_values.md @@ -28,5 +28,5 @@ namespace chrono { - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] diff --git a/reference/chrono/duration_values/max.md b/reference/chrono/duration_values/max.md index a60fd7f5f4..d0d4764ce0 100644 --- a/reference/chrono/duration_values/max.md +++ b/reference/chrono/duration_values/max.md @@ -54,8 +54,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/chrono/duration_values/min.md b/reference/chrono/duration_values/min.md index 662b0e8d02..849236c0ca 100644 --- a/reference/chrono/duration_values/min.md +++ b/reference/chrono/duration_values/min.md @@ -53,8 +53,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/chrono/duration_values/zero.md b/reference/chrono/duration_values/zero.md index aa7d7615be..dff1df6eaa 100644 --- a/reference/chrono/duration_values/zero.md +++ b/reference/chrono/duration_values/zero.md @@ -46,8 +46,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/chrono/file_clock.md b/reference/chrono/file_clock.md index 96330e7c1e..5ea084da99 100644 --- a/reference/chrono/file_clock.md +++ b/reference/chrono/file_clock.md @@ -97,9 +97,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/file_time.md b/reference/chrono/file_time.md index 31069322e6..78f642128b 100644 --- a/reference/chrono/file_time.md +++ b/reference/chrono/file_time.md @@ -209,9 +209,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/format.md b/reference/chrono/format.md index 9107965ba8..09f1d46ef8 100644 --- a/reference/chrono/format.md +++ b/reference/chrono/format.md @@ -104,9 +104,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/get_leap_second_info.md b/reference/chrono/get_leap_second_info.md index 03a4581cab..ffedc03a80 100644 --- a/reference/chrono/get_leap_second_info.md +++ b/reference/chrono/get_leap_second_info.md @@ -74,9 +74,9 @@ true ``` ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/get_tzdb.md b/reference/chrono/get_tzdb.md index c422cb3570..e0d0145d0f 100644 --- a/reference/chrono/get_tzdb.md +++ b/reference/chrono/get_tzdb.md @@ -68,6 +68,6 @@ Asia/Tokyo - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/get_tzdb_list.md b/reference/chrono/get_tzdb_list.md index 43d6016e2d..dbef5c4649 100644 --- a/reference/chrono/get_tzdb_list.md +++ b/reference/chrono/get_tzdb_list.md @@ -64,6 +64,6 @@ Asia/Tokyo - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/gps_clock.md b/reference/chrono/gps_clock.md index 8f3964fc93..2db96f1d65 100644 --- a/reference/chrono/gps_clock.md +++ b/reference/chrono/gps_clock.md @@ -80,9 +80,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/gps_clock/from_utc.md b/reference/chrono/gps_clock/from_utc.md index e9d8043193..4f33d3ecb2 100644 --- a/reference/chrono/gps_clock/from_utc.md +++ b/reference/chrono/gps_clock/from_utc.md @@ -87,6 +87,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/gps_clock/now.md b/reference/chrono/gps_clock/now.md index 6553bcf5c5..7c99542b13 100644 --- a/reference/chrono/gps_clock/now.md +++ b/reference/chrono/gps_clock/now.md @@ -46,6 +46,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/gps_clock/to_utc.md b/reference/chrono/gps_clock/to_utc.md index aa33ab94ed..30b53663ae 100644 --- a/reference/chrono/gps_clock/to_utc.md +++ b/reference/chrono/gps_clock/to_utc.md @@ -83,6 +83,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/gps_time.md b/reference/chrono/gps_time.md index a995ab5936..c378e5d4e6 100644 --- a/reference/chrono/gps_time.md +++ b/reference/chrono/gps_time.md @@ -209,9 +209,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/hh_mm_ss.md b/reference/chrono/hh_mm_ss.md index a5edf92d09..971ef88922 100644 --- a/reference/chrono/hh_mm_ss.md +++ b/reference/chrono/hh_mm_ss.md @@ -115,7 +115,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 10.0 (出力ストリームなし) -- [GCC](/implementation.md#gcc): 11.1 (出力ストリームなし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 10.0 (出力ストリームなし) [mark verified] +- [GCC](/implementation.md#gcc): 11.1 (出力ストリームなし) [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/hh_mm_ss/formatter.md b/reference/chrono/hh_mm_ss/formatter.md index f28beb60de..0e465a6ab5 100644 --- a/reference/chrono/hh_mm_ss/formatter.md +++ b/reference/chrono/hh_mm_ss/formatter.md @@ -77,9 +77,9 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (10.0時点で実装なし) -- [GCC](/implementation.md#gcc): (10.1時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 10.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 10.1 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/hh_mm_ss/fractional_width.md b/reference/chrono/hh_mm_ss/fractional_width.md index 666c9e9960..3c759082e8 100644 --- a/reference/chrono/hh_mm_ss/fractional_width.md +++ b/reference/chrono/hh_mm_ss/fractional_width.md @@ -76,7 +76,7 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 10.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 10.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/hh_mm_ss/hours.md b/reference/chrono/hh_mm_ss/hours.md index 82ca38d726..f4c5f83ee8 100644 --- a/reference/chrono/hh_mm_ss/hours.md +++ b/reference/chrono/hh_mm_ss/hours.md @@ -44,6 +44,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 10.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 10.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/hh_mm_ss/is_negative.md b/reference/chrono/hh_mm_ss/is_negative.md index 7ce718e4de..2a4c29ae28 100644 --- a/reference/chrono/hh_mm_ss/is_negative.md +++ b/reference/chrono/hh_mm_ss/is_negative.md @@ -44,6 +44,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 10.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 10.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/hh_mm_ss/minutes.md b/reference/chrono/hh_mm_ss/minutes.md index 7ec946f796..60f35517de 100644 --- a/reference/chrono/hh_mm_ss/minutes.md +++ b/reference/chrono/hh_mm_ss/minutes.md @@ -44,6 +44,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 10.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 10.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/hh_mm_ss/op_constructor.md b/reference/chrono/hh_mm_ss/op_constructor.md index b99cdfbcd0..f493c429ca 100644 --- a/reference/chrono/hh_mm_ss/op_constructor.md +++ b/reference/chrono/hh_mm_ss/op_constructor.md @@ -95,7 +95,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 10.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 10.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/hh_mm_ss/op_ostream.md b/reference/chrono/hh_mm_ss/op_ostream.md index b266724591..d2bd35dba5 100644 --- a/reference/chrono/hh_mm_ss/op_ostream.md +++ b/reference/chrono/hh_mm_ss/op_ostream.md @@ -65,9 +65,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (10.0時点で実装なし) -- [GCC](/implementation.md#gcc): (10.1時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 10.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 10.1 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/hh_mm_ss/op_precision.md b/reference/chrono/hh_mm_ss/op_precision.md index a33390b3c0..317a2926a4 100644 --- a/reference/chrono/hh_mm_ss/op_precision.md +++ b/reference/chrono/hh_mm_ss/op_precision.md @@ -54,6 +54,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 10.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 10.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/hh_mm_ss/seconds.md b/reference/chrono/hh_mm_ss/seconds.md index 76eab8c9f3..8f0e12925e 100644 --- a/reference/chrono/hh_mm_ss/seconds.md +++ b/reference/chrono/hh_mm_ss/seconds.md @@ -44,6 +44,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 10.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 10.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/hh_mm_ss/subseconds.md b/reference/chrono/hh_mm_ss/subseconds.md index 1f7900b075..26d03363e7 100644 --- a/reference/chrono/hh_mm_ss/subseconds.md +++ b/reference/chrono/hh_mm_ss/subseconds.md @@ -45,6 +45,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 10.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 10.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/hh_mm_ss/to_duration.md b/reference/chrono/hh_mm_ss/to_duration.md index 4cf4d43568..cd29e1e565 100644 --- a/reference/chrono/hh_mm_ss/to_duration.md +++ b/reference/chrono/hh_mm_ss/to_duration.md @@ -52,6 +52,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 10.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 10.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/high_resolution_clock.md b/reference/chrono/high_resolution_clock.md index 7bac8fbde4..fe75819f35 100644 --- a/reference/chrono/high_resolution_clock.md +++ b/reference/chrono/high_resolution_clock.md @@ -81,8 +81,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2015で`steady_clock`の別名に実装が変更された。これはWindows APIの`QueryPerformanceCounter`関数を使用した実装である。 - MSDNライブラリ: [QueryPerformanceCounter](https://docs.microsoft.com/ja-jp/windows/win32/api/profileapi/nf-profileapi-queryperformancecounter) diff --git a/reference/chrono/high_resolution_clock/now.md b/reference/chrono/high_resolution_clock/now.md index 94500d81f1..c7989554a5 100644 --- a/reference/chrono/high_resolution_clock/now.md +++ b/reference/chrono/high_resolution_clock/now.md @@ -51,5 +51,5 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] diff --git a/reference/chrono/is_am.md b/reference/chrono/is_am.md index 9ca1203d90..53e36316ef 100644 --- a/reference/chrono/is_am.md +++ b/reference/chrono/is_am.md @@ -50,6 +50,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 10.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 10.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/is_clock.md b/reference/chrono/is_clock.md index 97aeae1fc5..c7fe8e4de2 100644 --- a/reference/chrono/is_clock.md +++ b/reference/chrono/is_clock.md @@ -63,7 +63,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/is_pm.md b/reference/chrono/is_pm.md index 19b64979d3..dd3dfc0473 100644 --- a/reference/chrono/is_pm.md +++ b/reference/chrono/is_pm.md @@ -50,6 +50,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 10.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 10.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/last_spec.md b/reference/chrono/last_spec.md index aad5c3d759..f467b236c2 100644 --- a/reference/chrono/last_spec.md +++ b/reference/chrono/last_spec.md @@ -65,6 +65,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/last_spec/op_append.md b/reference/chrono/last_spec/op_append.md index b57547ddc1..762c4e09b5 100644 --- a/reference/chrono/last_spec/op_append.md +++ b/reference/chrono/last_spec/op_append.md @@ -61,6 +61,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/leap_second.md b/reference/chrono/leap_second.md index 1f027f8c26..4a69431f23 100644 --- a/reference/chrono/leap_second.md +++ b/reference/chrono/leap_second.md @@ -105,9 +105,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/leap_second/date.md b/reference/chrono/leap_second/date.md index 8b81591a22..eab7f0d54e 100644 --- a/reference/chrono/leap_second/date.md +++ b/reference/chrono/leap_second/date.md @@ -73,6 +73,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/leap_second/op_compare_3way.md b/reference/chrono/leap_second/op_compare_3way.md index c3e2b584dc..393e3634f2 100644 --- a/reference/chrono/leap_second/op_compare_3way.md +++ b/reference/chrono/leap_second/op_compare_3way.md @@ -53,9 +53,9 @@ namespace std::chrono { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/leap_second/op_equal.md b/reference/chrono/leap_second/op_equal.md index c144c4105b..f3e8cd5c55 100644 --- a/reference/chrono/leap_second/op_equal.md +++ b/reference/chrono/leap_second/op_equal.md @@ -85,6 +85,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/leap_second/op_greater.md b/reference/chrono/leap_second/op_greater.md index d11059d8f8..64c99f12cb 100644 --- a/reference/chrono/leap_second/op_greater.md +++ b/reference/chrono/leap_second/op_greater.md @@ -77,6 +77,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/leap_second/op_greater_equal.md b/reference/chrono/leap_second/op_greater_equal.md index c84cec33bf..21a4e79ff3 100644 --- a/reference/chrono/leap_second/op_greater_equal.md +++ b/reference/chrono/leap_second/op_greater_equal.md @@ -77,6 +77,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/leap_second/op_less.md b/reference/chrono/leap_second/op_less.md index d02f17c1c2..3ba2b4cdb7 100644 --- a/reference/chrono/leap_second/op_less.md +++ b/reference/chrono/leap_second/op_less.md @@ -108,6 +108,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/leap_second/op_less_equal.md b/reference/chrono/leap_second/op_less_equal.md index c54c1c8973..d6dd5fe283 100644 --- a/reference/chrono/leap_second/op_less_equal.md +++ b/reference/chrono/leap_second/op_less_equal.md @@ -94,6 +94,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/leap_second/value.md b/reference/chrono/leap_second/value.md index d31d56bcba..9c16441bf6 100644 --- a/reference/chrono/leap_second/value.md +++ b/reference/chrono/leap_second/value.md @@ -76,9 +76,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/leap_second_info.md b/reference/chrono/leap_second_info.md index c18cee0615..8f2c862f07 100644 --- a/reference/chrono/leap_second_info.md +++ b/reference/chrono/leap_second_info.md @@ -72,9 +72,9 @@ true ``` ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/local-time-format-t.md b/reference/chrono/local-time-format-t.md index b78aa67691..1cd47c42ff 100644 --- a/reference/chrono/local-time-format-t.md +++ b/reference/chrono/local-time-format-t.md @@ -83,7 +83,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/local-time-format-t/formatter.md b/reference/chrono/local-time-format-t/formatter.md index 406a437f56..f4f16c8601 100644 --- a/reference/chrono/local-time-format-t/formatter.md +++ b/reference/chrono/local-time-format-t/formatter.md @@ -72,7 +72,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/local_info.md b/reference/chrono/local_info.md index cb15880dbf..bbf90c0565 100644 --- a/reference/chrono/local_info.md +++ b/reference/chrono/local_info.md @@ -110,9 +110,9 @@ JST - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/local_info/formatter.md b/reference/chrono/local_info/formatter.md index 36302317f0..a0d9459418 100644 --- a/reference/chrono/local_info/formatter.md +++ b/reference/chrono/local_info/formatter.md @@ -67,7 +67,7 @@ JST - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/local_info/op_ostream.md b/reference/chrono/local_info/op_ostream.md index 3f04422df6..0816a4bbe6 100644 --- a/reference/chrono/local_info/op_ostream.md +++ b/reference/chrono/local_info/op_ostream.md @@ -64,6 +64,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/local_time.md b/reference/chrono/local_time.md index db628b0098..3a6afb6ad6 100644 --- a/reference/chrono/local_time.md +++ b/reference/chrono/local_time.md @@ -232,9 +232,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 (入出力ストリームなし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 (入出力ストリームなし) [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/local_time_format.md b/reference/chrono/local_time_format.md index 85077a91b5..c9161d6827 100644 --- a/reference/chrono/local_time_format.md +++ b/reference/chrono/local_time_format.md @@ -77,6 +77,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/locate_zone.md b/reference/chrono/locate_zone.md index 7ae502cfc0..4105783b2e 100644 --- a/reference/chrono/locate_zone.md +++ b/reference/chrono/locate_zone.md @@ -82,9 +82,9 @@ Asia/Nicosia - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/make12.md b/reference/chrono/make12.md index c527187b84..743137706b 100644 --- a/reference/chrono/make12.md +++ b/reference/chrono/make12.md @@ -53,6 +53,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 10.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 10.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/make24.md b/reference/chrono/make24.md index 657c04f541..83f8e28a7a 100644 --- a/reference/chrono/make24.md +++ b/reference/chrono/make24.md @@ -57,6 +57,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 10.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 10.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month.md b/reference/chrono/month.md index 90e0893421..b99b56d62a 100644 --- a/reference/chrono/month.md +++ b/reference/chrono/month.md @@ -133,9 +133,9 @@ Jun - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 (入出力ストリームなし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 (入出力ストリームなし) [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/month/formatter.md b/reference/chrono/month/formatter.md index 93e39f537c..53d1d105bb 100644 --- a/reference/chrono/month/formatter.md +++ b/reference/chrono/month/formatter.md @@ -65,9 +65,9 @@ April - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/month/from_stream.md b/reference/chrono/month/from_stream.md index 285d41cda3..dda34a179d 100644 --- a/reference/chrono/month/from_stream.md +++ b/reference/chrono/month/from_stream.md @@ -71,9 +71,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/month/ok.md b/reference/chrono/month/ok.md index e62f6ea1b0..9c1364ea43 100644 --- a/reference/chrono/month/ok.md +++ b/reference/chrono/month/ok.md @@ -52,6 +52,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month/op_append.md b/reference/chrono/month/op_append.md index 8ef66076c4..26387ca902 100644 --- a/reference/chrono/month/op_append.md +++ b/reference/chrono/month/op_append.md @@ -134,6 +134,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month/op_compare_3way.md b/reference/chrono/month/op_compare_3way.md index c80121d7ff..6b4d86117d 100644 --- a/reference/chrono/month/op_compare_3way.md +++ b/reference/chrono/month/op_compare_3way.md @@ -56,6 +56,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month/op_constructor.md b/reference/chrono/month/op_constructor.md index ace4bc3d36..458edeba2a 100644 --- a/reference/chrono/month/op_constructor.md +++ b/reference/chrono/month/op_constructor.md @@ -57,6 +57,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month/op_decrement.md b/reference/chrono/month/op_decrement.md index bc9a40bd07..cece574a8c 100644 --- a/reference/chrono/month/op_decrement.md +++ b/reference/chrono/month/op_decrement.md @@ -69,6 +69,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month/op_equal.md b/reference/chrono/month/op_equal.md index 720e2dd778..bdbbbc4bda 100644 --- a/reference/chrono/month/op_equal.md +++ b/reference/chrono/month/op_equal.md @@ -51,6 +51,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month/op_increment.md b/reference/chrono/month/op_increment.md index e965e8958f..b9ffc4a13a 100644 --- a/reference/chrono/month/op_increment.md +++ b/reference/chrono/month/op_increment.md @@ -69,6 +69,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month/op_minus.md b/reference/chrono/month/op_minus.md index 971e0128d2..28204b1055 100644 --- a/reference/chrono/month/op_minus.md +++ b/reference/chrono/month/op_minus.md @@ -55,6 +55,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month/op_minus_assign.md b/reference/chrono/month/op_minus_assign.md index eaca46022b..5562290cff 100644 --- a/reference/chrono/month/op_minus_assign.md +++ b/reference/chrono/month/op_minus_assign.md @@ -54,6 +54,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month/op_ostream.md b/reference/chrono/month/op_ostream.md index 871c452464..79224147e4 100644 --- a/reference/chrono/month/op_ostream.md +++ b/reference/chrono/month/op_ostream.md @@ -112,9 +112,9 @@ Dec - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/month/op_plus.md b/reference/chrono/month/op_plus.md index 249aee6b67..396f32e94b 100644 --- a/reference/chrono/month/op_plus.md +++ b/reference/chrono/month/op_plus.md @@ -66,6 +66,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month/op_plus_assign.md b/reference/chrono/month/op_plus_assign.md index 6e73bd8e17..702e118cb8 100644 --- a/reference/chrono/month/op_plus_assign.md +++ b/reference/chrono/month/op_plus_assign.md @@ -54,6 +54,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month/op_unsigned_int.md b/reference/chrono/month/op_unsigned_int.md index 0da10ee8f0..1755f2502e 100644 --- a/reference/chrono/month/op_unsigned_int.md +++ b/reference/chrono/month/op_unsigned_int.md @@ -41,6 +41,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month_constants.md b/reference/chrono/month_constants.md index c6386a909a..6a9d25dd8c 100644 --- a/reference/chrono/month_constants.md +++ b/reference/chrono/month_constants.md @@ -72,7 +72,7 @@ Jun - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 9.0 (入出力ストリームなし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 (入出力ストリームなし) [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month_day.md b/reference/chrono/month_day.md index 0ae7efec57..9f127e6e85 100644 --- a/reference/chrono/month_day.md +++ b/reference/chrono/month_day.md @@ -124,6 +124,6 @@ Mar/01 - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 (入出力ストリームなし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 (入出力ストリームなし) [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month_day/day.md b/reference/chrono/month_day/day.md index cc6d8e7ad0..5390e43821 100644 --- a/reference/chrono/month_day/day.md +++ b/reference/chrono/month_day/day.md @@ -48,6 +48,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month_day/formatter.md b/reference/chrono/month_day/formatter.md index 9a48808f53..a7feac4461 100644 --- a/reference/chrono/month_day/formatter.md +++ b/reference/chrono/month_day/formatter.md @@ -57,9 +57,9 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/month_day/from_stream.md b/reference/chrono/month_day/from_stream.md index 71122e8c20..622d536563 100644 --- a/reference/chrono/month_day/from_stream.md +++ b/reference/chrono/month_day/from_stream.md @@ -71,9 +71,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/month_day/month.md b/reference/chrono/month_day/month.md index f206568d90..8363407ba2 100644 --- a/reference/chrono/month_day/month.md +++ b/reference/chrono/month_day/month.md @@ -46,6 +46,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month_day/ok.md b/reference/chrono/month_day/ok.md index d70ea525eb..804bc6e066 100644 --- a/reference/chrono/month_day/ok.md +++ b/reference/chrono/month_day/ok.md @@ -53,6 +53,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month_day/op_append.md b/reference/chrono/month_day/op_append.md index 827124e715..498f05aca0 100644 --- a/reference/chrono/month_day/op_append.md +++ b/reference/chrono/month_day/op_append.md @@ -72,6 +72,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month_day/op_compare_3way.md b/reference/chrono/month_day/op_compare_3way.md index 79f94a6a9b..438fca2ae8 100644 --- a/reference/chrono/month_day/op_compare_3way.md +++ b/reference/chrono/month_day/op_compare_3way.md @@ -62,6 +62,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (10.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 10.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month_day/op_constructor.md b/reference/chrono/month_day/op_constructor.md index c26fa86f04..02a6abe186 100644 --- a/reference/chrono/month_day/op_constructor.md +++ b/reference/chrono/month_day/op_constructor.md @@ -65,6 +65,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month_day/op_equal.md b/reference/chrono/month_day/op_equal.md index 220123f704..4896bd4921 100644 --- a/reference/chrono/month_day/op_equal.md +++ b/reference/chrono/month_day/op_equal.md @@ -56,6 +56,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month_day/op_ostream.md b/reference/chrono/month_day/op_ostream.md index 1358b6bdbe..e3ee971059 100644 --- a/reference/chrono/month_day/op_ostream.md +++ b/reference/chrono/month_day/op_ostream.md @@ -53,9 +53,9 @@ Mar/01 - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/month_day_last.md b/reference/chrono/month_day_last.md index fced325c14..8a4f44d22f 100644 --- a/reference/chrono/month_day_last.md +++ b/reference/chrono/month_day_last.md @@ -118,6 +118,6 @@ Mar/last - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 (出力ストリームなし) -- [GCC](/implementation.md#gcc): 11.1 (出力ストリームなし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 (出力ストリームなし) [mark verified] +- [GCC](/implementation.md#gcc): 11.1 (出力ストリームなし) [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month_day_last/formatter.md b/reference/chrono/month_day_last/formatter.md index 9e4bb64a2f..445699dfd7 100644 --- a/reference/chrono/month_day_last/formatter.md +++ b/reference/chrono/month_day_last/formatter.md @@ -57,9 +57,9 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/month_day_last/month.md b/reference/chrono/month_day_last/month.md index c870623d03..55ed95ef7a 100644 --- a/reference/chrono/month_day_last/month.md +++ b/reference/chrono/month_day_last/month.md @@ -47,6 +47,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month_day_last/ok.md b/reference/chrono/month_day_last/ok.md index 476eaa4d25..cee593b75a 100644 --- a/reference/chrono/month_day_last/ok.md +++ b/reference/chrono/month_day_last/ok.md @@ -44,6 +44,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month_day_last/op_append.md b/reference/chrono/month_day_last/op_append.md index 76031ff3ea..f541b19a4f 100644 --- a/reference/chrono/month_day_last/op_append.md +++ b/reference/chrono/month_day_last/op_append.md @@ -58,6 +58,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month_day_last/op_compare_3way.md b/reference/chrono/month_day_last/op_compare_3way.md index 3efc61a9c6..c953a190ba 100644 --- a/reference/chrono/month_day_last/op_compare_3way.md +++ b/reference/chrono/month_day_last/op_compare_3way.md @@ -64,6 +64,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (10.0時点で実装なし) -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 10.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month_day_last/op_constructor.md b/reference/chrono/month_day_last/op_constructor.md index d81fac540c..f0787080ac 100644 --- a/reference/chrono/month_day_last/op_constructor.md +++ b/reference/chrono/month_day_last/op_constructor.md @@ -60,6 +60,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month_day_last/op_equal.md b/reference/chrono/month_day_last/op_equal.md index 76827a2e67..dd9f63298c 100644 --- a/reference/chrono/month_day_last/op_equal.md +++ b/reference/chrono/month_day_last/op_equal.md @@ -59,6 +59,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month_day_last/op_ostream.md b/reference/chrono/month_day_last/op_ostream.md index ac6643ada7..301d6d689d 100644 --- a/reference/chrono/month_day_last/op_ostream.md +++ b/reference/chrono/month_day_last/op_ostream.md @@ -53,9 +53,9 @@ Mar/last - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/month_weekday.md b/reference/chrono/month_weekday.md index 4420fdac6a..94aa822485 100644 --- a/reference/chrono/month_weekday.md +++ b/reference/chrono/month_weekday.md @@ -132,6 +132,6 @@ Mar/Sun[1] - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 (出力ストリームなし) -- [GCC](/implementation.md#gcc): 11.1 (出力ストリームなし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 (出力ストリームなし) [mark verified] +- [GCC](/implementation.md#gcc): 11.1 (出力ストリームなし) [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month_weekday/formatter.md b/reference/chrono/month_weekday/formatter.md index 059ad00d61..6ebd022d26 100644 --- a/reference/chrono/month_weekday/formatter.md +++ b/reference/chrono/month_weekday/formatter.md @@ -57,9 +57,9 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/month_weekday/month.md b/reference/chrono/month_weekday/month.md index c5f7f3ec36..89f3a850d2 100644 --- a/reference/chrono/month_weekday/month.md +++ b/reference/chrono/month_weekday/month.md @@ -47,6 +47,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month_weekday/ok.md b/reference/chrono/month_weekday/ok.md index 47c9159082..95f4b0b053 100644 --- a/reference/chrono/month_weekday/ok.md +++ b/reference/chrono/month_weekday/ok.md @@ -46,6 +46,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month_weekday/op_append.md b/reference/chrono/month_weekday/op_append.md index 7cafb9f774..686337a1a4 100644 --- a/reference/chrono/month_weekday/op_append.md +++ b/reference/chrono/month_weekday/op_append.md @@ -59,6 +59,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month_weekday/op_constructor.md b/reference/chrono/month_weekday/op_constructor.md index 0ac18a86de..8b02e492e2 100644 --- a/reference/chrono/month_weekday/op_constructor.md +++ b/reference/chrono/month_weekday/op_constructor.md @@ -63,6 +63,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month_weekday/op_equal.md b/reference/chrono/month_weekday/op_equal.md index 64a115ae8b..f4054c32f1 100644 --- a/reference/chrono/month_weekday/op_equal.md +++ b/reference/chrono/month_weekday/op_equal.md @@ -57,6 +57,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month_weekday/op_ostream.md b/reference/chrono/month_weekday/op_ostream.md index 23fb40104e..b58def2027 100644 --- a/reference/chrono/month_weekday/op_ostream.md +++ b/reference/chrono/month_weekday/op_ostream.md @@ -54,9 +54,9 @@ Mar/Sun[1] - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (10.1時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 10.1 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/month_weekday/weekday_indexed.md b/reference/chrono/month_weekday/weekday_indexed.md index f715857c3e..c863c01252 100644 --- a/reference/chrono/month_weekday/weekday_indexed.md +++ b/reference/chrono/month_weekday/weekday_indexed.md @@ -47,6 +47,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month_weekday_last.md b/reference/chrono/month_weekday_last.md index 6069da155f..1e2371100e 100644 --- a/reference/chrono/month_weekday_last.md +++ b/reference/chrono/month_weekday_last.md @@ -132,6 +132,6 @@ Mar/Sun[last] - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 (出力ストリームなし) -- [GCC](/implementation.md#gcc): 11.1 (出力ストリームなし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 (出力ストリームなし) [mark verified] +- [GCC](/implementation.md#gcc): 11.1 (出力ストリームなし) [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month_weekday_last/formatter.md b/reference/chrono/month_weekday_last/formatter.md index 2b13641a51..f3e9e5a0e6 100644 --- a/reference/chrono/month_weekday_last/formatter.md +++ b/reference/chrono/month_weekday_last/formatter.md @@ -58,9 +58,9 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/month_weekday_last/month.md b/reference/chrono/month_weekday_last/month.md index ce1aac6dcd..d93856d156 100644 --- a/reference/chrono/month_weekday_last/month.md +++ b/reference/chrono/month_weekday_last/month.md @@ -48,6 +48,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month_weekday_last/ok.md b/reference/chrono/month_weekday_last/ok.md index 3e592acf68..6ecd9dd8c9 100644 --- a/reference/chrono/month_weekday_last/ok.md +++ b/reference/chrono/month_weekday_last/ok.md @@ -46,6 +46,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month_weekday_last/op_append.md b/reference/chrono/month_weekday_last/op_append.md index 0bb75e882b..0dfd1ef7b7 100644 --- a/reference/chrono/month_weekday_last/op_append.md +++ b/reference/chrono/month_weekday_last/op_append.md @@ -60,6 +60,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month_weekday_last/op_constructor.md b/reference/chrono/month_weekday_last/op_constructor.md index 9da56b9bdb..60ff578903 100644 --- a/reference/chrono/month_weekday_last/op_constructor.md +++ b/reference/chrono/month_weekday_last/op_constructor.md @@ -63,6 +63,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month_weekday_last/op_equal.md b/reference/chrono/month_weekday_last/op_equal.md index 83f783d41b..a6ad10dd5f 100644 --- a/reference/chrono/month_weekday_last/op_equal.md +++ b/reference/chrono/month_weekday_last/op_equal.md @@ -59,6 +59,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month_weekday_last/op_ostream.md b/reference/chrono/month_weekday_last/op_ostream.md index a263924e73..5fda969ea7 100644 --- a/reference/chrono/month_weekday_last/op_ostream.md +++ b/reference/chrono/month_weekday_last/op_ostream.md @@ -55,9 +55,9 @@ Mar/Sun[last] - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (10.1時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 10.1 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/month_weekday_last/weekday_last.md b/reference/chrono/month_weekday_last/weekday_last.md index 6373eb154e..8b570aa74f 100644 --- a/reference/chrono/month_weekday_last/weekday_last.md +++ b/reference/chrono/month_weekday_last/weekday_last.md @@ -48,6 +48,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/nonexistent_local_time.md b/reference/chrono/nonexistent_local_time.md index fb2a03c01e..5099379d48 100644 --- a/reference/chrono/nonexistent_local_time.md +++ b/reference/chrono/nonexistent_local_time.md @@ -85,6 +85,6 @@ int main() ``` ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/parse.md b/reference/chrono/parse.md index 9fd056f283..235391d4ed 100644 --- a/reference/chrono/parse.md +++ b/reference/chrono/parse.md @@ -172,9 +172,9 @@ JST - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/reload_tzdb.md b/reference/chrono/reload_tzdb.md index 865497e39e..378a2e23ad 100644 --- a/reference/chrono/reload_tzdb.md +++ b/reference/chrono/reload_tzdb.md @@ -81,6 +81,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/remote_version.md b/reference/chrono/remote_version.md index 48de4b0a8a..2d20a4615a 100644 --- a/reference/chrono/remote_version.md +++ b/reference/chrono/remote_version.md @@ -59,6 +59,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/steady_clock.md b/reference/chrono/steady_clock.md index c2709b6ab6..b8dbeed13c 100644 --- a/reference/chrono/steady_clock.md +++ b/reference/chrono/steady_clock.md @@ -86,8 +86,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012, 2013は逆行が起こり得る、すなわち正しくない実装であった。 - 2015からは、Windows APIの`QueryPerformanceCounter`関数を使用した実装である。 - MSDNライブラリ: [QueryPerformanceCounter](https://docs.microsoft.com/ja-jp/windows/win32/api/profileapi/nf-profileapi-queryperformancecounter) diff --git a/reference/chrono/steady_clock/now.md b/reference/chrono/steady_clock/now.md index 967b906072..fde25e90e0 100644 --- a/reference/chrono/steady_clock/now.md +++ b/reference/chrono/steady_clock/now.md @@ -52,5 +52,5 @@ int main() - C++11 ### 処理系 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012, 2013は逆行が起こり得る、すなわち正しくない実装であった。 diff --git a/reference/chrono/sys_info.md b/reference/chrono/sys_info.md index 6d02ff8fcb..e861eb9040 100644 --- a/reference/chrono/sys_info.md +++ b/reference/chrono/sys_info.md @@ -86,7 +86,7 @@ JST - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/sys_info/formatter.md b/reference/chrono/sys_info/formatter.md index 4af196033b..97d7f976f8 100644 --- a/reference/chrono/sys_info/formatter.md +++ b/reference/chrono/sys_info/formatter.md @@ -64,7 +64,7 @@ JST - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/sys_info/op_ostream.md b/reference/chrono/sys_info/op_ostream.md index 95eb23dcac..ac7239a1d2 100644 --- a/reference/chrono/sys_info/op_ostream.md +++ b/reference/chrono/sys_info/op_ostream.md @@ -61,6 +61,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/sys_time.md b/reference/chrono/sys_time.md index b25b4acb14..c7d9a214fa 100644 --- a/reference/chrono/sys_time.md +++ b/reference/chrono/sys_time.md @@ -259,9 +259,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 (入出力ストリームなし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 (入出力ストリームなし) [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/system_clock.md b/reference/chrono/system_clock.md index d0603e2920..5cd997425f 100644 --- a/reference/chrono/system_clock.md +++ b/reference/chrono/system_clock.md @@ -105,8 +105,8 @@ Tue Oct 16 15:00:08 2012 - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/chrono/system_clock/from_time_t.md b/reference/chrono/system_clock/from_time_t.md index 8a3bd1fd45..9eba06e096 100644 --- a/reference/chrono/system_clock/from_time_t.md +++ b/reference/chrono/system_clock/from_time_t.md @@ -60,5 +60,5 @@ Tue Sep 27 14:21:13 2011 - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] diff --git a/reference/chrono/system_clock/now.md b/reference/chrono/system_clock/now.md index 9433f9949a..fa896060da 100644 --- a/reference/chrono/system_clock/now.md +++ b/reference/chrono/system_clock/now.md @@ -53,5 +53,5 @@ Fri Dec 20 16:32:56 2019 - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] diff --git a/reference/chrono/system_clock/to_time_t.md b/reference/chrono/system_clock/to_time_t.md index fd74393f37..e8714711fe 100644 --- a/reference/chrono/system_clock/to_time_t.md +++ b/reference/chrono/system_clock/to_time_t.md @@ -56,5 +56,5 @@ Tue Sep 27 14:21:13 2011 - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] diff --git a/reference/chrono/tai_clock.md b/reference/chrono/tai_clock.md index e8a53f3156..5d281f66ea 100644 --- a/reference/chrono/tai_clock.md +++ b/reference/chrono/tai_clock.md @@ -83,9 +83,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/tai_clock/from_utc.md b/reference/chrono/tai_clock/from_utc.md index bb19c999da..2422493956 100644 --- a/reference/chrono/tai_clock/from_utc.md +++ b/reference/chrono/tai_clock/from_utc.md @@ -87,6 +87,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/tai_clock/now.md b/reference/chrono/tai_clock/now.md index b909948eaa..32d3e5a282 100644 --- a/reference/chrono/tai_clock/now.md +++ b/reference/chrono/tai_clock/now.md @@ -46,6 +46,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/tai_clock/to_utc.md b/reference/chrono/tai_clock/to_utc.md index 419a9704c8..7a92545660 100644 --- a/reference/chrono/tai_clock/to_utc.md +++ b/reference/chrono/tai_clock/to_utc.md @@ -82,6 +82,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/tai_time.md b/reference/chrono/tai_time.md index d4b24f1071..edb71db77d 100644 --- a/reference/chrono/tai_time.md +++ b/reference/chrono/tai_time.md @@ -208,9 +208,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/time_point.md b/reference/chrono/time_point.md index 7098302b1e..bee37dec8e 100644 --- a/reference/chrono/time_point.md +++ b/reference/chrono/time_point.md @@ -134,8 +134,8 @@ Thu Jul 18 13:46:26 2013 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/chrono/time_point/ceil.md b/reference/chrono/time_point/ceil.md index 3f4e9adaa4..974cbf6d0d 100644 --- a/reference/chrono/time_point/ceil.md +++ b/reference/chrono/time_point/ceil.md @@ -57,8 +57,8 @@ int main() - C++17 ### 処理系 -- [GCC](/implementation.md#gcc): 7.3 -- [Clang](/implementation.md#clang): 3.8 +- [GCC](/implementation.md#gcc): 7.3 [mark verified] +- [Clang](/implementation.md#clang): 3.8 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/chrono/time_point/floor.md b/reference/chrono/time_point/floor.md index 3094ef640a..1c6668b8f7 100644 --- a/reference/chrono/time_point/floor.md +++ b/reference/chrono/time_point/floor.md @@ -57,8 +57,8 @@ int main() - C++17 ### 処理系 -- [GCC](/implementation.md#gcc): 7.3 -- [Clang](/implementation.md#clang): 3.8 +- [GCC](/implementation.md#gcc): 7.3 [mark verified] +- [Clang](/implementation.md#clang): 3.8 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/chrono/time_point/max.md b/reference/chrono/time_point/max.md index 1ec06bbfb2..551afeb29e 100644 --- a/reference/chrono/time_point/max.md +++ b/reference/chrono/time_point/max.md @@ -50,8 +50,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.5.0 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.5.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/chrono/time_point/min.md b/reference/chrono/time_point/min.md index 4575824c69..31656914c3 100644 --- a/reference/chrono/time_point/min.md +++ b/reference/chrono/time_point/min.md @@ -50,8 +50,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.5.0 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.5.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/chrono/time_point/op_compare_3way.md b/reference/chrono/time_point/op_compare_3way.md index a38acc7e81..946965be41 100644 --- a/reference/chrono/time_point/op_compare_3way.md +++ b/reference/chrono/time_point/op_compare_3way.md @@ -55,7 +55,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10 +- [GCC](/implementation.md#gcc): 10 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/chrono/time_point/op_constructor.md b/reference/chrono/time_point/op_constructor.md index cc64e24ab4..751397d7c8 100644 --- a/reference/chrono/time_point/op_constructor.md +++ b/reference/chrono/time_point/op_constructor.md @@ -65,8 +65,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 - [N3469 Constexpr Library Additions: chrono, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3469.html) diff --git a/reference/chrono/time_point/op_equal.md b/reference/chrono/time_point/op_equal.md index 27b413480d..38d9c71fa1 100644 --- a/reference/chrono/time_point/op_equal.md +++ b/reference/chrono/time_point/op_equal.md @@ -64,8 +64,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 - [N3469 Constexpr Library Additions: chrono, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3469.html) diff --git a/reference/chrono/time_point/op_greater.md b/reference/chrono/time_point/op_greater.md index 14a0914a87..5e09984637 100644 --- a/reference/chrono/time_point/op_greater.md +++ b/reference/chrono/time_point/op_greater.md @@ -56,8 +56,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 - [N3469 Constexpr Library Additions: chrono, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3469.html) diff --git a/reference/chrono/time_point/op_greater_equal.md b/reference/chrono/time_point/op_greater_equal.md index aad6ba394b..78cd5b250a 100644 --- a/reference/chrono/time_point/op_greater_equal.md +++ b/reference/chrono/time_point/op_greater_equal.md @@ -57,8 +57,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 - [N3469 Constexpr Library Additions: chrono, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3469.html) diff --git a/reference/chrono/time_point/op_less.md b/reference/chrono/time_point/op_less.md index cd84040b37..3a0849bb40 100644 --- a/reference/chrono/time_point/op_less.md +++ b/reference/chrono/time_point/op_less.md @@ -56,8 +56,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 - [N3469 Constexpr Library Additions: chrono, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3469.html) diff --git a/reference/chrono/time_point/op_less_equal.md b/reference/chrono/time_point/op_less_equal.md index b7d141b4ec..b85bf1bcfd 100644 --- a/reference/chrono/time_point/op_less_equal.md +++ b/reference/chrono/time_point/op_less_equal.md @@ -57,8 +57,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 - [N3469 Constexpr Library Additions: chrono, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3469.html) diff --git a/reference/chrono/time_point/op_minus.md b/reference/chrono/time_point/op_minus.md index b38628c53c..adefb2d5c0 100644 --- a/reference/chrono/time_point/op_minus.md +++ b/reference/chrono/time_point/op_minus.md @@ -95,9 +95,9 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 - [N3469 Constexpr Library Additions: chrono, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3469.html) diff --git a/reference/chrono/time_point/op_minus_assign.md b/reference/chrono/time_point/op_minus_assign.md index 035a07fb10..765a6f9d13 100644 --- a/reference/chrono/time_point/op_minus_assign.md +++ b/reference/chrono/time_point/op_minus_assign.md @@ -57,8 +57,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.5.0 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.5.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/chrono/time_point/op_not_equal.md b/reference/chrono/time_point/op_not_equal.md index 0ad78ae6ed..ccba8121cc 100644 --- a/reference/chrono/time_point/op_not_equal.md +++ b/reference/chrono/time_point/op_not_equal.md @@ -58,8 +58,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 - [N3469 Constexpr Library Additions: chrono, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3469.html) diff --git a/reference/chrono/time_point/op_plus.md b/reference/chrono/time_point/op_plus.md index 57eaa73399..ba83128e0b 100644 --- a/reference/chrono/time_point/op_plus.md +++ b/reference/chrono/time_point/op_plus.md @@ -85,9 +85,9 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 - [N3469 Constexpr Library Additions: chrono, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3469.html) diff --git a/reference/chrono/time_point/op_plus_assign.md b/reference/chrono/time_point/op_plus_assign.md index 19829c4446..793d5ac297 100644 --- a/reference/chrono/time_point/op_plus_assign.md +++ b/reference/chrono/time_point/op_plus_assign.md @@ -56,8 +56,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.5.0 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.5.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/chrono/time_point/round.md b/reference/chrono/time_point/round.md index e504ce44ff..f0be32bbe9 100644 --- a/reference/chrono/time_point/round.md +++ b/reference/chrono/time_point/round.md @@ -61,8 +61,8 @@ int main() - C++17 ### 処理系 -- [GCC](/implementation.md#gcc): 7.3 -- [Clang](/implementation.md#clang): 3.8 +- [GCC](/implementation.md#gcc): 7.3 [mark verified] +- [Clang](/implementation.md#clang): 3.8 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/chrono/time_point/time_since_epoch.md b/reference/chrono/time_point/time_since_epoch.md index 80b679180d..0e60e73b66 100644 --- a/reference/chrono/time_point/time_since_epoch.md +++ b/reference/chrono/time_point/time_since_epoch.md @@ -48,8 +48,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.5.1, 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.5.1 [mark verified], 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 - [N3469 Constexpr Library Additions: chrono, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3469.html) diff --git a/reference/chrono/time_point_cast.md b/reference/chrono/time_point_cast.md index 0ed013cb0b..accc1d3006 100644 --- a/reference/chrono/time_point_cast.md +++ b/reference/chrono/time_point_cast.md @@ -67,8 +67,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 関連項目 diff --git a/reference/chrono/time_zone.md b/reference/chrono/time_zone.md index 01e7799c9c..354c5daaa0 100644 --- a/reference/chrono/time_zone.md +++ b/reference/chrono/time_zone.md @@ -97,7 +97,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/time_zone/get_info.md b/reference/chrono/time_zone/get_info.md index 139585837c..b983ac4b7d 100644 --- a/reference/chrono/time_zone/get_info.md +++ b/reference/chrono/time_zone/get_info.md @@ -83,6 +83,6 @@ JST - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/time_zone/name.md b/reference/chrono/time_zone/name.md index bfa9a7b284..142488b86a 100644 --- a/reference/chrono/time_zone/name.md +++ b/reference/chrono/time_zone/name.md @@ -47,6 +47,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/time_zone/op_compare_3way.md b/reference/chrono/time_zone/op_compare_3way.md index f166acdcc8..a1e3c59867 100644 --- a/reference/chrono/time_zone/op_compare_3way.md +++ b/reference/chrono/time_zone/op_compare_3way.md @@ -54,6 +54,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/time_zone/op_equal.md b/reference/chrono/time_zone/op_equal.md index b1bb40d63b..d58d6a5f8f 100644 --- a/reference/chrono/time_zone/op_equal.md +++ b/reference/chrono/time_zone/op_equal.md @@ -55,6 +55,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/time_zone/to_local.md b/reference/chrono/time_zone/to_local.md index da1f251f70..24301c0a26 100644 --- a/reference/chrono/time_zone/to_local.md +++ b/reference/chrono/time_zone/to_local.md @@ -64,9 +64,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/time_zone/to_sys.md b/reference/chrono/time_zone/to_sys.md index 96581ff3c9..f5fa214333 100644 --- a/reference/chrono/time_zone/to_sys.md +++ b/reference/chrono/time_zone/to_sys.md @@ -118,9 +118,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/time_zone_link.md b/reference/chrono/time_zone_link.md index d165ea1509..8d2a194c10 100644 --- a/reference/chrono/time_zone_link.md +++ b/reference/chrono/time_zone_link.md @@ -69,9 +69,9 @@ std::cout << linked_tz->name() << std::endl; // Asia/Nicosia - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/time_zone_link/name.md b/reference/chrono/time_zone_link/name.md index c955029c33..6aa0043d87 100644 --- a/reference/chrono/time_zone_link/name.md +++ b/reference/chrono/time_zone_link/name.md @@ -26,7 +26,7 @@ std::string_view name() const noexcept; // (1) C++20 - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/time_zone_link/op_compare_3way.md b/reference/chrono/time_zone_link/op_compare_3way.md index 0a82eecd28..cb8f5fa493 100644 --- a/reference/chrono/time_zone_link/op_compare_3way.md +++ b/reference/chrono/time_zone_link/op_compare_3way.md @@ -34,6 +34,6 @@ return x.name() <=> y.name(); - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/time_zone_link/op_equal.md b/reference/chrono/time_zone_link/op_equal.md index cae152f538..0aa6455313 100644 --- a/reference/chrono/time_zone_link/op_equal.md +++ b/reference/chrono/time_zone_link/op_equal.md @@ -34,7 +34,7 @@ return x.name() == y.name(); - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/time_zone_link/target.md b/reference/chrono/time_zone_link/target.md index 31a614c053..b5c728df09 100644 --- a/reference/chrono/time_zone_link/target.md +++ b/reference/chrono/time_zone_link/target.md @@ -26,7 +26,7 @@ std::string_view target() const noexcept; // (1) C++20 - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/treat_as_floating_point.md b/reference/chrono/treat_as_floating_point.md index 82caf6408d..66cbcf9f60 100644 --- a/reference/chrono/treat_as_floating_point.md +++ b/reference/chrono/treat_as_floating_point.md @@ -59,8 +59,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/chrono/tzdb.md b/reference/chrono/tzdb.md index 5228641b2c..4d8143c098 100644 --- a/reference/chrono/tzdb.md +++ b/reference/chrono/tzdb.md @@ -80,7 +80,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/tzdb/current_zone.md b/reference/chrono/tzdb/current_zone.md index fc9b616873..36a850e3da 100644 --- a/reference/chrono/tzdb/current_zone.md +++ b/reference/chrono/tzdb/current_zone.md @@ -53,6 +53,6 @@ Asia/Tokyo - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/tzdb/locate_zone.md b/reference/chrono/tzdb/locate_zone.md index 1c3ce8cd2e..d02e16814d 100644 --- a/reference/chrono/tzdb/locate_zone.md +++ b/reference/chrono/tzdb/locate_zone.md @@ -82,9 +82,9 @@ Asia/Nicosia - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/tzdb_list.md b/reference/chrono/tzdb_list.md index 42a66ef122..3f927d7282 100644 --- a/reference/chrono/tzdb_list.md +++ b/reference/chrono/tzdb_list.md @@ -96,7 +96,7 @@ Asia/Tokyo - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/tzdb_list/begin.md b/reference/chrono/tzdb_list/begin.md index 66180f9e5a..79daafb07e 100644 --- a/reference/chrono/tzdb_list/begin.md +++ b/reference/chrono/tzdb_list/begin.md @@ -57,7 +57,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/tzdb_list/cbegin.md b/reference/chrono/tzdb_list/cbegin.md index 6657ec4c30..4a3ef347ea 100644 --- a/reference/chrono/tzdb_list/cbegin.md +++ b/reference/chrono/tzdb_list/cbegin.md @@ -60,7 +60,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/tzdb_list/cend.md b/reference/chrono/tzdb_list/cend.md index beaf4530a0..e5048d11e9 100644 --- a/reference/chrono/tzdb_list/cend.md +++ b/reference/chrono/tzdb_list/cend.md @@ -60,7 +60,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/tzdb_list/end.md b/reference/chrono/tzdb_list/end.md index 0e8d157d73..2ae522af83 100644 --- a/reference/chrono/tzdb_list/end.md +++ b/reference/chrono/tzdb_list/end.md @@ -57,7 +57,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/tzdb_list/front.md b/reference/chrono/tzdb_list/front.md index 6d2a8b1829..59a9aa47a2 100644 --- a/reference/chrono/tzdb_list/front.md +++ b/reference/chrono/tzdb_list/front.md @@ -60,7 +60,7 @@ Asia/Tokyo - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/utc_clock.md b/reference/chrono/utc_clock.md index a5e6215f1c..859ad70e5c 100644 --- a/reference/chrono/utc_clock.md +++ b/reference/chrono/utc_clock.md @@ -80,9 +80,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/utc_clock/from_sys.md b/reference/chrono/utc_clock/from_sys.md index 5b67586f60..0616566200 100644 --- a/reference/chrono/utc_clock/from_sys.md +++ b/reference/chrono/utc_clock/from_sys.md @@ -65,9 +65,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/utc_clock/now.md b/reference/chrono/utc_clock/now.md index e4162f9d49..66210c725f 100644 --- a/reference/chrono/utc_clock/now.md +++ b/reference/chrono/utc_clock/now.md @@ -46,6 +46,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/utc_clock/to_sys.md b/reference/chrono/utc_clock/to_sys.md index 3ed3614fee..812678a093 100644 --- a/reference/chrono/utc_clock/to_sys.md +++ b/reference/chrono/utc_clock/to_sys.md @@ -59,9 +59,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/utc_time.md b/reference/chrono/utc_time.md index 2ed6d8d297..ac5a5abeca 100644 --- a/reference/chrono/utc_time.md +++ b/reference/chrono/utc_time.md @@ -203,9 +203,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/weekday.md b/reference/chrono/weekday.md index 399ffa3204..fc53e0a91f 100644 --- a/reference/chrono/weekday.md +++ b/reference/chrono/weekday.md @@ -133,9 +133,9 @@ Sat - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 (入出力ストリームなし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 (入出力ストリームなし) [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/weekday/c_encoding.md b/reference/chrono/weekday/c_encoding.md index f963cbb248..b42ae5ba21 100644 --- a/reference/chrono/weekday/c_encoding.md +++ b/reference/chrono/weekday/c_encoding.md @@ -78,9 +78,9 @@ Saturday : 6 - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 10.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 10.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/weekday/formatter.md b/reference/chrono/weekday/formatter.md index e2baddef0b..1d1bf831e6 100644 --- a/reference/chrono/weekday/formatter.md +++ b/reference/chrono/weekday/formatter.md @@ -64,9 +64,9 @@ Sunday - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/weekday/from_stream.md b/reference/chrono/weekday/from_stream.md index 65232c5f83..ef492d9f77 100644 --- a/reference/chrono/weekday/from_stream.md +++ b/reference/chrono/weekday/from_stream.md @@ -71,9 +71,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/weekday/iso_encoding.md b/reference/chrono/weekday/iso_encoding.md index 89ea0f41e9..1ebee10adb 100644 --- a/reference/chrono/weekday/iso_encoding.md +++ b/reference/chrono/weekday/iso_encoding.md @@ -74,9 +74,9 @@ Sunday : 7 - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 10.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 10.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/weekday/ok.md b/reference/chrono/weekday/ok.md index 81110e62ae..4af8793a9e 100644 --- a/reference/chrono/weekday/ok.md +++ b/reference/chrono/weekday/ok.md @@ -52,9 +52,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 (値7は0にならない), 10.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 (値7は0にならない) [mark verified], 10.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/weekday/op_at.md b/reference/chrono/weekday/op_at.md index 8ac1c59ec8..7c91b3e054 100644 --- a/reference/chrono/weekday/op_at.md +++ b/reference/chrono/weekday/op_at.md @@ -74,6 +74,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/weekday/op_constructor.md b/reference/chrono/weekday/op_constructor.md index 25c2261a79..202f1ecc6c 100644 --- a/reference/chrono/weekday/op_constructor.md +++ b/reference/chrono/weekday/op_constructor.md @@ -82,9 +82,9 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 (値7は0にならない), 10.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 (値7は0にならない) [mark verified], 10.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/weekday/op_decrement.md b/reference/chrono/weekday/op_decrement.md index 435cef2f8f..8c0a584df4 100644 --- a/reference/chrono/weekday/op_decrement.md +++ b/reference/chrono/weekday/op_decrement.md @@ -69,6 +69,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/weekday/op_equal.md b/reference/chrono/weekday/op_equal.md index d3be619177..8ea0d63d8d 100644 --- a/reference/chrono/weekday/op_equal.md +++ b/reference/chrono/weekday/op_equal.md @@ -55,6 +55,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/weekday/op_increment.md b/reference/chrono/weekday/op_increment.md index c2d7d06111..655bdb7e99 100644 --- a/reference/chrono/weekday/op_increment.md +++ b/reference/chrono/weekday/op_increment.md @@ -69,6 +69,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/weekday/op_minus.md b/reference/chrono/weekday/op_minus.md index b91536b184..d2ca3409cd 100644 --- a/reference/chrono/weekday/op_minus.md +++ b/reference/chrono/weekday/op_minus.md @@ -51,6 +51,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/weekday/op_minus_assign.md b/reference/chrono/weekday/op_minus_assign.md index 944492b224..9cdc2f83a2 100644 --- a/reference/chrono/weekday/op_minus_assign.md +++ b/reference/chrono/weekday/op_minus_assign.md @@ -52,6 +52,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/weekday/op_ostream.md b/reference/chrono/weekday/op_ostream.md index 4755937adf..dee4369fa1 100644 --- a/reference/chrono/weekday/op_ostream.md +++ b/reference/chrono/weekday/op_ostream.md @@ -92,9 +92,9 @@ Sat - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/weekday/op_plus.md b/reference/chrono/weekday/op_plus.md index 0a3c4f12be..d71af410b4 100644 --- a/reference/chrono/weekday/op_plus.md +++ b/reference/chrono/weekday/op_plus.md @@ -63,6 +63,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/weekday/op_plus_assign.md b/reference/chrono/weekday/op_plus_assign.md index ef7cf0b2c9..c765001e91 100644 --- a/reference/chrono/weekday/op_plus_assign.md +++ b/reference/chrono/weekday/op_plus_assign.md @@ -52,6 +52,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/weekday_constants.md b/reference/chrono/weekday_constants.md index a0a28d17ab..dcf8e59716 100644 --- a/reference/chrono/weekday_constants.md +++ b/reference/chrono/weekday_constants.md @@ -70,7 +70,7 @@ Sat - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 (入出力ストリームなし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 (入出力ストリームなし) [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/weekday_indexed.md b/reference/chrono/weekday_indexed.md index 6278a3ce5f..fce5588ed5 100644 --- a/reference/chrono/weekday_indexed.md +++ b/reference/chrono/weekday_indexed.md @@ -104,7 +104,7 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 (入出力ストリームなし) -- [GCC](/implementation.md#gcc): (10.1時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 (入出力ストリームなし) [mark verified] +- [GCC](/implementation.md#gcc): 10.1 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/weekday_indexed/formatter.md b/reference/chrono/weekday_indexed/formatter.md index ebf23af1af..1bd12df760 100644 --- a/reference/chrono/weekday_indexed/formatter.md +++ b/reference/chrono/weekday_indexed/formatter.md @@ -66,9 +66,9 @@ Sunday - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/weekday_indexed/index.md b/reference/chrono/weekday_indexed/index.md index 576708e1ba..cb7053089b 100644 --- a/reference/chrono/weekday_indexed/index.md +++ b/reference/chrono/weekday_indexed/index.md @@ -44,7 +44,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/weekday_indexed/ok.md b/reference/chrono/weekday_indexed/ok.md index 5e73b871a5..144cb23a71 100644 --- a/reference/chrono/weekday_indexed/ok.md +++ b/reference/chrono/weekday_indexed/ok.md @@ -53,7 +53,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/weekday_indexed/op_constructor.md b/reference/chrono/weekday_indexed/op_constructor.md index 9f68ee94a2..2a107d530c 100644 --- a/reference/chrono/weekday_indexed/op_constructor.md +++ b/reference/chrono/weekday_indexed/op_constructor.md @@ -60,9 +60,9 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/weekday_indexed/op_equal.md b/reference/chrono/weekday_indexed/op_equal.md index 168cc8c152..5ab5882daf 100644 --- a/reference/chrono/weekday_indexed/op_equal.md +++ b/reference/chrono/weekday_indexed/op_equal.md @@ -58,6 +58,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/weekday_indexed/op_ostream.md b/reference/chrono/weekday_indexed/op_ostream.md index 9e1247802d..d7d9187e64 100644 --- a/reference/chrono/weekday_indexed/op_ostream.md +++ b/reference/chrono/weekday_indexed/op_ostream.md @@ -57,9 +57,9 @@ Sun[1] - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/weekday_indexed/weekday.md b/reference/chrono/weekday_indexed/weekday.md index 6c27d639a4..5e451fd7ee 100644 --- a/reference/chrono/weekday_indexed/weekday.md +++ b/reference/chrono/weekday_indexed/weekday.md @@ -46,7 +46,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/weekday_last.md b/reference/chrono/weekday_last.md index 8ad015ee06..eec8f85f4f 100644 --- a/reference/chrono/weekday_last.md +++ b/reference/chrono/weekday_last.md @@ -100,7 +100,7 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 (入出力ストリームなし) -- [GCC](/implementation.md#gcc): (10.1時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 (入出力ストリームなし) [mark verified] +- [GCC](/implementation.md#gcc): 10.1 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/weekday_last/formatter.md b/reference/chrono/weekday_last/formatter.md index b5b722ecd7..c455f5cb93 100644 --- a/reference/chrono/weekday_last/formatter.md +++ b/reference/chrono/weekday_last/formatter.md @@ -68,9 +68,9 @@ Sunday - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/weekday_last/ok.md b/reference/chrono/weekday_last/ok.md index 11800a94a0..0458f134f0 100644 --- a/reference/chrono/weekday_last/ok.md +++ b/reference/chrono/weekday_last/ok.md @@ -49,7 +49,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/weekday_last/op_constructor.md b/reference/chrono/weekday_last/op_constructor.md index 4a667ee184..d37a0efb24 100644 --- a/reference/chrono/weekday_last/op_constructor.md +++ b/reference/chrono/weekday_last/op_constructor.md @@ -55,6 +55,6 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/weekday_last/op_equal.md b/reference/chrono/weekday_last/op_equal.md index 67378d9f67..7c8e9f85d5 100644 --- a/reference/chrono/weekday_last/op_equal.md +++ b/reference/chrono/weekday_last/op_equal.md @@ -57,6 +57,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/weekday_last/op_ostream.md b/reference/chrono/weekday_last/op_ostream.md index 91d32b6fbd..e1fa841b66 100644 --- a/reference/chrono/weekday_last/op_ostream.md +++ b/reference/chrono/weekday_last/op_ostream.md @@ -53,9 +53,9 @@ Sun[last] - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/weekday_last/weekday.md b/reference/chrono/weekday_last/weekday.md index 216b877766..d66065ecb9 100644 --- a/reference/chrono/weekday_last/weekday.md +++ b/reference/chrono/weekday_last/weekday.md @@ -47,7 +47,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year.md b/reference/chrono/year.md index a2a186b5d0..823e012628 100644 --- a/reference/chrono/year.md +++ b/reference/chrono/year.md @@ -160,7 +160,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 (入出力ストリームなし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 (入出力ストリームなし) [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year/formatter.md b/reference/chrono/year/formatter.md index 585cda9f54..56a21bc95c 100644 --- a/reference/chrono/year/formatter.md +++ b/reference/chrono/year/formatter.md @@ -67,9 +67,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/year/from_stream.md b/reference/chrono/year/from_stream.md index 98ffed589b..7569ad588b 100644 --- a/reference/chrono/year/from_stream.md +++ b/reference/chrono/year/from_stream.md @@ -70,9 +70,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/year/is_leap.md b/reference/chrono/year/is_leap.md index 50c8b524e9..f506b8c175 100644 --- a/reference/chrono/year/is_leap.md +++ b/reference/chrono/year/is_leap.md @@ -60,6 +60,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year/max.md b/reference/chrono/year/max.md index d7ca97d401..3c59569107 100644 --- a/reference/chrono/year/max.md +++ b/reference/chrono/year/max.md @@ -42,6 +42,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year/min.md b/reference/chrono/year/min.md index 7c1d827576..c6326033dc 100644 --- a/reference/chrono/year/min.md +++ b/reference/chrono/year/min.md @@ -42,6 +42,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year/ok.md b/reference/chrono/year/ok.md index fc791d473e..f4bc6b44ea 100644 --- a/reference/chrono/year/ok.md +++ b/reference/chrono/year/ok.md @@ -54,9 +54,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/year/op_append.md b/reference/chrono/year/op_append.md index 6947b42ef2..fb3f209da1 100644 --- a/reference/chrono/year/op_append.md +++ b/reference/chrono/year/op_append.md @@ -135,6 +135,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year/op_compare_3way.md b/reference/chrono/year/op_compare_3way.md index c763dc15cb..818fd1a772 100644 --- a/reference/chrono/year/op_compare_3way.md +++ b/reference/chrono/year/op_compare_3way.md @@ -54,6 +54,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year/op_constructor.md b/reference/chrono/year/op_constructor.md index da5f30810e..08f0ad8886 100644 --- a/reference/chrono/year/op_constructor.md +++ b/reference/chrono/year/op_constructor.md @@ -55,6 +55,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year/op_decrement.md b/reference/chrono/year/op_decrement.md index 199987b775..275a0b58ec 100644 --- a/reference/chrono/year/op_decrement.md +++ b/reference/chrono/year/op_decrement.md @@ -69,6 +69,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year/op_equal.md b/reference/chrono/year/op_equal.md index 1d2925aabd..04329fd16e 100644 --- a/reference/chrono/year/op_equal.md +++ b/reference/chrono/year/op_equal.md @@ -49,6 +49,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year/op_increment.md b/reference/chrono/year/op_increment.md index aecae85ce7..e138e0e04d 100644 --- a/reference/chrono/year/op_increment.md +++ b/reference/chrono/year/op_increment.md @@ -69,6 +69,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year/op_int.md b/reference/chrono/year/op_int.md index 547caca7e6..ae7405f6a7 100644 --- a/reference/chrono/year/op_int.md +++ b/reference/chrono/year/op_int.md @@ -41,6 +41,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year/op_minus.md b/reference/chrono/year/op_minus.md index f426661551..699bf03acc 100644 --- a/reference/chrono/year/op_minus.md +++ b/reference/chrono/year/op_minus.md @@ -54,6 +54,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year/op_minus_assign.md b/reference/chrono/year/op_minus_assign.md index 2db19be2b2..3686248444 100644 --- a/reference/chrono/year/op_minus_assign.md +++ b/reference/chrono/year/op_minus_assign.md @@ -52,6 +52,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year/op_ostream.md b/reference/chrono/year/op_ostream.md index ae3a9a27f8..81560768c5 100644 --- a/reference/chrono/year/op_ostream.md +++ b/reference/chrono/year/op_ostream.md @@ -55,9 +55,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/year/op_plus.md b/reference/chrono/year/op_plus.md index 1f3f3bec19..24d14227be 100644 --- a/reference/chrono/year/op_plus.md +++ b/reference/chrono/year/op_plus.md @@ -61,6 +61,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year/op_plus_assign.md b/reference/chrono/year/op_plus_assign.md index d1be37d058..dcf0c8f95c 100644 --- a/reference/chrono/year/op_plus_assign.md +++ b/reference/chrono/year/op_plus_assign.md @@ -52,6 +52,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year/op_unary_minus.md b/reference/chrono/year/op_unary_minus.md index 2e224f3a32..fb73082793 100644 --- a/reference/chrono/year/op_unary_minus.md +++ b/reference/chrono/year/op_unary_minus.md @@ -52,6 +52,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year/op_unary_plus.md b/reference/chrono/year/op_unary_plus.md index 686014c0da..2bb82d5045 100644 --- a/reference/chrono/year/op_unary_plus.md +++ b/reference/chrono/year/op_unary_plus.md @@ -48,6 +48,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year/op_y.md b/reference/chrono/year/op_y.md index ee47cd55ea..89fa5c1745 100644 --- a/reference/chrono/year/op_y.md +++ b/reference/chrono/year/op_y.md @@ -65,6 +65,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month.md b/reference/chrono/year_month.md index 2a9b798049..2801714e1e 100644 --- a/reference/chrono/year_month.md +++ b/reference/chrono/year_month.md @@ -140,6 +140,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 (入出力ストリームなし) -- [GCC](/implementation.md#gcc): 11.1 (入出力ストリームなし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 (入出力ストリームなし) [mark verified] +- [GCC](/implementation.md#gcc): 11.1 (入出力ストリームなし) [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month/formatter.md b/reference/chrono/year_month/formatter.md index 809124e215..641fc01c10 100644 --- a/reference/chrono/year_month/formatter.md +++ b/reference/chrono/year_month/formatter.md @@ -50,9 +50,9 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/year_month/from_stream.md b/reference/chrono/year_month/from_stream.md index 58e6c56e02..3f8b698fea 100644 --- a/reference/chrono/year_month/from_stream.md +++ b/reference/chrono/year_month/from_stream.md @@ -72,9 +72,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/year_month/month.md b/reference/chrono/year_month/month.md index 89fbcaea46..d6d0181115 100644 --- a/reference/chrono/year_month/month.md +++ b/reference/chrono/year_month/month.md @@ -47,6 +47,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month/ok.md b/reference/chrono/year_month/ok.md index b058d399c9..7a90828980 100644 --- a/reference/chrono/year_month/ok.md +++ b/reference/chrono/year_month/ok.md @@ -45,6 +45,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month/op_append.md b/reference/chrono/year_month/op_append.md index 2fc66bf802..4ea4b1d099 100644 --- a/reference/chrono/year_month/op_append.md +++ b/reference/chrono/year_month/op_append.md @@ -92,6 +92,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month/op_compare_3way.md b/reference/chrono/year_month/op_compare_3way.md index 0795464525..81a95c8c86 100644 --- a/reference/chrono/year_month/op_compare_3way.md +++ b/reference/chrono/year_month/op_compare_3way.md @@ -62,6 +62,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month/op_constructor.md b/reference/chrono/year_month/op_constructor.md index 1cf8bf76ec..90e06d3a14 100644 --- a/reference/chrono/year_month/op_constructor.md +++ b/reference/chrono/year_month/op_constructor.md @@ -66,6 +66,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month/op_equal.md b/reference/chrono/year_month/op_equal.md index 55d60a5d01..38da81756b 100644 --- a/reference/chrono/year_month/op_equal.md +++ b/reference/chrono/year_month/op_equal.md @@ -56,6 +56,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month/op_minus.md b/reference/chrono/year_month/op_minus.md index fabda36ea1..37072343f7 100644 --- a/reference/chrono/year_month/op_minus.md +++ b/reference/chrono/year_month/op_minus.md @@ -57,9 +57,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/year_month/op_minus_assign.md b/reference/chrono/year_month/op_minus_assign.md index f44c6e0f6e..a50a6141b3 100644 --- a/reference/chrono/year_month/op_minus_assign.md +++ b/reference/chrono/year_month/op_minus_assign.md @@ -66,9 +66,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/year_month/op_ostream.md b/reference/chrono/year_month/op_ostream.md index 1632358348..eefe2f47b9 100644 --- a/reference/chrono/year_month/op_ostream.md +++ b/reference/chrono/year_month/op_ostream.md @@ -57,9 +57,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/year_month/op_plus.md b/reference/chrono/year_month/op_plus.md index 8d3f6f3319..ab8270e45b 100644 --- a/reference/chrono/year_month/op_plus.md +++ b/reference/chrono/year_month/op_plus.md @@ -87,9 +87,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/year_month/op_plus_assign.md b/reference/chrono/year_month/op_plus_assign.md index ab13c56320..456d36a09f 100644 --- a/reference/chrono/year_month/op_plus_assign.md +++ b/reference/chrono/year_month/op_plus_assign.md @@ -66,9 +66,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/year_month/year.md b/reference/chrono/year_month/year.md index ef93b7c26d..6fef16c615 100644 --- a/reference/chrono/year_month/year.md +++ b/reference/chrono/year_month/year.md @@ -46,6 +46,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_day.md b/reference/chrono/year_month_day.md index 9ada4327fc..ad70579efc 100644 --- a/reference/chrono/year_month_day.md +++ b/reference/chrono/year_month_day.md @@ -308,6 +308,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 (入出力ストリームなし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 (入出力ストリームなし) [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_day/day.md b/reference/chrono/year_month_day/day.md index 4400fcbdf5..600d82d8a0 100644 --- a/reference/chrono/year_month_day/day.md +++ b/reference/chrono/year_month_day/day.md @@ -47,6 +47,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_day/formatter.md b/reference/chrono/year_month_day/formatter.md index 9b3b223435..beb8363cb1 100644 --- a/reference/chrono/year_month_day/formatter.md +++ b/reference/chrono/year_month_day/formatter.md @@ -72,9 +72,9 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/year_month_day/from_stream.md b/reference/chrono/year_month_day/from_stream.md index 0e33d88aa4..e77f989ff9 100644 --- a/reference/chrono/year_month_day/from_stream.md +++ b/reference/chrono/year_month_day/from_stream.md @@ -72,9 +72,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/year_month_day/month.md b/reference/chrono/year_month_day/month.md index 69ce94a9cb..7a2dddbe70 100644 --- a/reference/chrono/year_month_day/month.md +++ b/reference/chrono/year_month_day/month.md @@ -47,6 +47,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_day/ok.md b/reference/chrono/year_month_day/ok.md index 26b447853f..bb0cde1057 100644 --- a/reference/chrono/year_month_day/ok.md +++ b/reference/chrono/year_month_day/ok.md @@ -48,6 +48,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_day/op_compare_3way.md b/reference/chrono/year_month_day/op_compare_3way.md index e8181980f3..e7285e7773 100644 --- a/reference/chrono/year_month_day/op_compare_3way.md +++ b/reference/chrono/year_month_day/op_compare_3way.md @@ -64,6 +64,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_day/op_constructor.md b/reference/chrono/year_month_day/op_constructor.md index 2700e1d61d..56c8af48cf 100644 --- a/reference/chrono/year_month_day/op_constructor.md +++ b/reference/chrono/year_month_day/op_constructor.md @@ -116,6 +116,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_day/op_equal.md b/reference/chrono/year_month_day/op_equal.md index 8caf2adc38..d100fb8b2c 100644 --- a/reference/chrono/year_month_day/op_equal.md +++ b/reference/chrono/year_month_day/op_equal.md @@ -57,6 +57,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_day/op_local_days.md b/reference/chrono/year_month_day/op_local_days.md index dc9362328a..3fe7688c3a 100644 --- a/reference/chrono/year_month_day/op_local_days.md +++ b/reference/chrono/year_month_day/op_local_days.md @@ -67,9 +67,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/year_month_day/op_minus.md b/reference/chrono/year_month_day/op_minus.md index ff282f3e4c..a0e24c12aa 100644 --- a/reference/chrono/year_month_day/op_minus.md +++ b/reference/chrono/year_month_day/op_minus.md @@ -61,9 +61,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/year_month_day/op_minus_assign.md b/reference/chrono/year_month_day/op_minus_assign.md index 34d7d315c9..cef398bbea 100644 --- a/reference/chrono/year_month_day/op_minus_assign.md +++ b/reference/chrono/year_month_day/op_minus_assign.md @@ -66,9 +66,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/year_month_day/op_ostream.md b/reference/chrono/year_month_day/op_ostream.md index 63e9ba520e..f17063e1ed 100644 --- a/reference/chrono/year_month_day/op_ostream.md +++ b/reference/chrono/year_month_day/op_ostream.md @@ -56,9 +56,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/year_month_day/op_plus.md b/reference/chrono/year_month_day/op_plus.md index 56fc9d8c13..dd5863a184 100644 --- a/reference/chrono/year_month_day/op_plus.md +++ b/reference/chrono/year_month_day/op_plus.md @@ -94,9 +94,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/year_month_day/op_plus_assign.md b/reference/chrono/year_month_day/op_plus_assign.md index 8cbb11d1f7..e643c6b9da 100644 --- a/reference/chrono/year_month_day/op_plus_assign.md +++ b/reference/chrono/year_month_day/op_plus_assign.md @@ -66,9 +66,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/year_month_day/op_sys_days.md b/reference/chrono/year_month_day/op_sys_days.md index 7920dd0c7e..f0cfaced18 100644 --- a/reference/chrono/year_month_day/op_sys_days.md +++ b/reference/chrono/year_month_day/op_sys_days.md @@ -66,9 +66,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/year_month_day/year.md b/reference/chrono/year_month_day/year.md index 313841ebab..fb510deed6 100644 --- a/reference/chrono/year_month_day/year.md +++ b/reference/chrono/year_month_day/year.md @@ -46,6 +46,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_day_last.md b/reference/chrono/year_month_day_last.md index 405ccc77c2..a6cea173da 100644 --- a/reference/chrono/year_month_day_last.md +++ b/reference/chrono/year_month_day_last.md @@ -151,6 +151,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 (出力ストリームなし) -- [GCC](/implementation.md#gcc): 11.1 (出力ストリームなし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 (出力ストリームなし) [mark verified] +- [GCC](/implementation.md#gcc): 11.1 (出力ストリームなし) [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_day_last/day.md b/reference/chrono/year_month_day_last/day.md index 2bd81dcfd0..38c3023ca8 100644 --- a/reference/chrono/year_month_day_last/day.md +++ b/reference/chrono/year_month_day_last/day.md @@ -52,9 +52,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/year_month_day_last/formatter.md b/reference/chrono/year_month_day_last/formatter.md index 01a9edd26f..60051c3ad9 100644 --- a/reference/chrono/year_month_day_last/formatter.md +++ b/reference/chrono/year_month_day_last/formatter.md @@ -72,9 +72,9 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/year_month_day_last/month.md b/reference/chrono/year_month_day_last/month.md index 26f3bb62fa..0e22a559fd 100644 --- a/reference/chrono/year_month_day_last/month.md +++ b/reference/chrono/year_month_day_last/month.md @@ -48,6 +48,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_day_last/month_day_last.md b/reference/chrono/year_month_day_last/month_day_last.md index 4a63aaa8bc..5ee9dc2d03 100644 --- a/reference/chrono/year_month_day_last/month_day_last.md +++ b/reference/chrono/year_month_day_last/month_day_last.md @@ -48,6 +48,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_day_last/ok.md b/reference/chrono/year_month_day_last/ok.md index 36391a22bf..34edbac578 100644 --- a/reference/chrono/year_month_day_last/ok.md +++ b/reference/chrono/year_month_day_last/ok.md @@ -45,6 +45,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_day_last/op_compare_3way.md b/reference/chrono/year_month_day_last/op_compare_3way.md index 4db45fedb1..4baec04a54 100644 --- a/reference/chrono/year_month_day_last/op_compare_3way.md +++ b/reference/chrono/year_month_day_last/op_compare_3way.md @@ -66,6 +66,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_day_last/op_constructor.md b/reference/chrono/year_month_day_last/op_constructor.md index 538c79ecf7..0170c0a987 100644 --- a/reference/chrono/year_month_day_last/op_constructor.md +++ b/reference/chrono/year_month_day_last/op_constructor.md @@ -65,6 +65,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_day_last/op_equal.md b/reference/chrono/year_month_day_last/op_equal.md index 584db1de87..c5118c39a4 100644 --- a/reference/chrono/year_month_day_last/op_equal.md +++ b/reference/chrono/year_month_day_last/op_equal.md @@ -60,6 +60,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_day_last/op_local_days.md b/reference/chrono/year_month_day_last/op_local_days.md index 399ab3c099..cab76090ac 100644 --- a/reference/chrono/year_month_day_last/op_local_days.md +++ b/reference/chrono/year_month_day_last/op_local_days.md @@ -51,9 +51,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/year_month_day_last/op_minus.md b/reference/chrono/year_month_day_last/op_minus.md index 0af9439986..f0ec3aa764 100644 --- a/reference/chrono/year_month_day_last/op_minus.md +++ b/reference/chrono/year_month_day_last/op_minus.md @@ -63,9 +63,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/year_month_day_last/op_minus_assign.md b/reference/chrono/year_month_day_last/op_minus_assign.md index 85c7b0bf37..3da624566c 100644 --- a/reference/chrono/year_month_day_last/op_minus_assign.md +++ b/reference/chrono/year_month_day_last/op_minus_assign.md @@ -68,9 +68,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/year_month_day_last/op_ostream.md b/reference/chrono/year_month_day_last/op_ostream.md index c26cedc89c..4b69bb4fb2 100644 --- a/reference/chrono/year_month_day_last/op_ostream.md +++ b/reference/chrono/year_month_day_last/op_ostream.md @@ -56,9 +56,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/year_month_day_last/op_plus.md b/reference/chrono/year_month_day_last/op_plus.md index 83ae3cf07a..8c06419f8c 100644 --- a/reference/chrono/year_month_day_last/op_plus.md +++ b/reference/chrono/year_month_day_last/op_plus.md @@ -100,9 +100,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/year_month_day_last/op_plus_assign.md b/reference/chrono/year_month_day_last/op_plus_assign.md index 2416910034..a6ff0ec878 100644 --- a/reference/chrono/year_month_day_last/op_plus_assign.md +++ b/reference/chrono/year_month_day_last/op_plus_assign.md @@ -68,9 +68,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/year_month_day_last/op_sys_days.md b/reference/chrono/year_month_day_last/op_sys_days.md index cfb38654fb..80cfd44136 100644 --- a/reference/chrono/year_month_day_last/op_sys_days.md +++ b/reference/chrono/year_month_day_last/op_sys_days.md @@ -55,6 +55,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_day_last/year.md b/reference/chrono/year_month_day_last/year.md index 593c570e83..2d19d2f73c 100644 --- a/reference/chrono/year_month_day_last/year.md +++ b/reference/chrono/year_month_day_last/year.md @@ -47,6 +47,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_weekday.md b/reference/chrono/year_month_weekday.md index f8fa3c9015..0f007f9304 100644 --- a/reference/chrono/year_month_weekday.md +++ b/reference/chrono/year_month_weekday.md @@ -142,6 +142,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 (出力ストリームなし) -- [GCC](/implementation.md#gcc): 11.1 (出力ストリームなし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 (出力ストリームなし) [mark verified] +- [GCC](/implementation.md#gcc): 11.1 (出力ストリームなし) [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_weekday/formatter.md b/reference/chrono/year_month_weekday/formatter.md index 4fb2682367..ad8736f3cb 100644 --- a/reference/chrono/year_month_weekday/formatter.md +++ b/reference/chrono/year_month_weekday/formatter.md @@ -52,9 +52,9 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/year_month_weekday/index.md b/reference/chrono/year_month_weekday/index.md index 6ae55bfa89..ab2c63c018 100644 --- a/reference/chrono/year_month_weekday/index.md +++ b/reference/chrono/year_month_weekday/index.md @@ -51,6 +51,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_weekday/month.md b/reference/chrono/year_month_weekday/month.md index 4a1467338d..9b6915ee68 100644 --- a/reference/chrono/year_month_weekday/month.md +++ b/reference/chrono/year_month_weekday/month.md @@ -48,6 +48,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_weekday/ok.md b/reference/chrono/year_month_weekday/ok.md index 60b83dfa43..e5faf0d9a8 100644 --- a/reference/chrono/year_month_weekday/ok.md +++ b/reference/chrono/year_month_weekday/ok.md @@ -48,6 +48,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_weekday/op_constructor.md b/reference/chrono/year_month_weekday/op_constructor.md index 1498edf331..6dff76d562 100644 --- a/reference/chrono/year_month_weekday/op_constructor.md +++ b/reference/chrono/year_month_weekday/op_constructor.md @@ -82,6 +82,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_weekday/op_equal.md b/reference/chrono/year_month_weekday/op_equal.md index 529a9539b3..1e11fa1e8f 100644 --- a/reference/chrono/year_month_weekday/op_equal.md +++ b/reference/chrono/year_month_weekday/op_equal.md @@ -63,6 +63,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_weekday/op_local_days.md b/reference/chrono/year_month_weekday/op_local_days.md index f94dc2ac04..8d56535c3f 100644 --- a/reference/chrono/year_month_weekday/op_local_days.md +++ b/reference/chrono/year_month_weekday/op_local_days.md @@ -60,9 +60,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/year_month_weekday/op_minus.md b/reference/chrono/year_month_weekday/op_minus.md index 0f0624e517..8a572b2504 100644 --- a/reference/chrono/year_month_weekday/op_minus.md +++ b/reference/chrono/year_month_weekday/op_minus.md @@ -62,9 +62,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/year_month_weekday/op_minus_assign.md b/reference/chrono/year_month_weekday/op_minus_assign.md index 50351c88cb..f34aaa1eb7 100644 --- a/reference/chrono/year_month_weekday/op_minus_assign.md +++ b/reference/chrono/year_month_weekday/op_minus_assign.md @@ -69,9 +69,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/year_month_weekday/op_ostream.md b/reference/chrono/year_month_weekday/op_ostream.md index d01dca61e6..d528a9e7f9 100644 --- a/reference/chrono/year_month_weekday/op_ostream.md +++ b/reference/chrono/year_month_weekday/op_ostream.md @@ -57,9 +57,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/year_month_weekday/op_plus.md b/reference/chrono/year_month_weekday/op_plus.md index 233de3cc2d..143c90fb1d 100644 --- a/reference/chrono/year_month_weekday/op_plus.md +++ b/reference/chrono/year_month_weekday/op_plus.md @@ -99,9 +99,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/year_month_weekday/op_plus_assign.md b/reference/chrono/year_month_weekday/op_plus_assign.md index f35bd52d0e..c2edb22764 100644 --- a/reference/chrono/year_month_weekday/op_plus_assign.md +++ b/reference/chrono/year_month_weekday/op_plus_assign.md @@ -69,9 +69,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/year_month_weekday/op_sys_days.md b/reference/chrono/year_month_weekday/op_sys_days.md index a1b349a5eb..e3e660cd0a 100644 --- a/reference/chrono/year_month_weekday/op_sys_days.md +++ b/reference/chrono/year_month_weekday/op_sys_days.md @@ -59,7 +59,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_weekday/weekday.md b/reference/chrono/year_month_weekday/weekday.md index 5d8190aa79..168574a986 100644 --- a/reference/chrono/year_month_weekday/weekday.md +++ b/reference/chrono/year_month_weekday/weekday.md @@ -53,6 +53,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_weekday/weekday_indexed.md b/reference/chrono/year_month_weekday/weekday_indexed.md index a4b6aa9b49..295613efbb 100644 --- a/reference/chrono/year_month_weekday/weekday_indexed.md +++ b/reference/chrono/year_month_weekday/weekday_indexed.md @@ -47,6 +47,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_weekday/year.md b/reference/chrono/year_month_weekday/year.md index 061d118a22..13aeed52c2 100644 --- a/reference/chrono/year_month_weekday/year.md +++ b/reference/chrono/year_month_weekday/year.md @@ -47,6 +47,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_weekday_last.md b/reference/chrono/year_month_weekday_last.md index 6fe32ef013..b5a0d73214 100644 --- a/reference/chrono/year_month_weekday_last.md +++ b/reference/chrono/year_month_weekday_last.md @@ -142,6 +142,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 (出力ストリームなし) -- [GCC](/implementation.md#gcc): 11.1 (出力ストリームなし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 (出力ストリームなし) [mark verified] +- [GCC](/implementation.md#gcc): 11.1 (出力ストリームなし) [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_weekday_last/formatter.md b/reference/chrono/year_month_weekday_last/formatter.md index b80f0f0b5c..054d5ba202 100644 --- a/reference/chrono/year_month_weekday_last/formatter.md +++ b/reference/chrono/year_month_weekday_last/formatter.md @@ -53,9 +53,9 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/year_month_weekday_last/month.md b/reference/chrono/year_month_weekday_last/month.md index b012d935e0..031784468e 100644 --- a/reference/chrono/year_month_weekday_last/month.md +++ b/reference/chrono/year_month_weekday_last/month.md @@ -49,6 +49,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_weekday_last/ok.md b/reference/chrono/year_month_weekday_last/ok.md index fcf6d0eded..7b4eb5e881 100644 --- a/reference/chrono/year_month_weekday_last/ok.md +++ b/reference/chrono/year_month_weekday_last/ok.md @@ -47,6 +47,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_weekday_last/op_constructor.md b/reference/chrono/year_month_weekday_last/op_constructor.md index 071ebb61a5..5c395d7195 100644 --- a/reference/chrono/year_month_weekday_last/op_constructor.md +++ b/reference/chrono/year_month_weekday_last/op_constructor.md @@ -68,6 +68,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_weekday_last/op_equal.md b/reference/chrono/year_month_weekday_last/op_equal.md index 16b10a8918..16ec216294 100644 --- a/reference/chrono/year_month_weekday_last/op_equal.md +++ b/reference/chrono/year_month_weekday_last/op_equal.md @@ -63,6 +63,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_weekday_last/op_local_days.md b/reference/chrono/year_month_weekday_last/op_local_days.md index 25e04097cb..ac30057b6d 100644 --- a/reference/chrono/year_month_weekday_last/op_local_days.md +++ b/reference/chrono/year_month_weekday_last/op_local_days.md @@ -52,9 +52,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/year_month_weekday_last/op_minus.md b/reference/chrono/year_month_weekday_last/op_minus.md index fe8c2f1664..481088e6f3 100644 --- a/reference/chrono/year_month_weekday_last/op_minus.md +++ b/reference/chrono/year_month_weekday_last/op_minus.md @@ -62,9 +62,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/year_month_weekday_last/op_minus_assign.md b/reference/chrono/year_month_weekday_last/op_minus_assign.md index f2eff19153..43210ca914 100644 --- a/reference/chrono/year_month_weekday_last/op_minus_assign.md +++ b/reference/chrono/year_month_weekday_last/op_minus_assign.md @@ -70,9 +70,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/year_month_weekday_last/op_ostream.md b/reference/chrono/year_month_weekday_last/op_ostream.md index 3d7342a1dc..7141302598 100644 --- a/reference/chrono/year_month_weekday_last/op_ostream.md +++ b/reference/chrono/year_month_weekday_last/op_ostream.md @@ -59,9 +59,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/year_month_weekday_last/op_plus.md b/reference/chrono/year_month_weekday_last/op_plus.md index 9fc1604de2..bdddca3bb8 100644 --- a/reference/chrono/year_month_weekday_last/op_plus.md +++ b/reference/chrono/year_month_weekday_last/op_plus.md @@ -99,9 +99,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/year_month_weekday_last/op_plus_assign.md b/reference/chrono/year_month_weekday_last/op_plus_assign.md index f356d77ea6..2911969256 100644 --- a/reference/chrono/year_month_weekday_last/op_plus_assign.md +++ b/reference/chrono/year_month_weekday_last/op_plus_assign.md @@ -70,9 +70,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/year_month_weekday_last/op_sys_days.md b/reference/chrono/year_month_weekday_last/op_sys_days.md index 15eda1915b..cfb845316a 100644 --- a/reference/chrono/year_month_weekday_last/op_sys_days.md +++ b/reference/chrono/year_month_weekday_last/op_sys_days.md @@ -47,9 +47,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] #### 備考 - GCC 11のtrunkバージョンでは`index() == 0`の場合に間違った値が返る。正式リリース時には直っている可能性がある diff --git a/reference/chrono/year_month_weekday_last/weekday.md b/reference/chrono/year_month_weekday_last/weekday.md index 6fbd0f1e22..e3cd067c9a 100644 --- a/reference/chrono/year_month_weekday_last/weekday.md +++ b/reference/chrono/year_month_weekday_last/weekday.md @@ -54,6 +54,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_weekday_last/weekday_last.md b/reference/chrono/year_month_weekday_last/weekday_last.md index 620553fc92..e2ee4bcd45 100644 --- a/reference/chrono/year_month_weekday_last/weekday_last.md +++ b/reference/chrono/year_month_weekday_last/weekday_last.md @@ -48,6 +48,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_weekday_last/year.md b/reference/chrono/year_month_weekday_last/year.md index 06edce5bcd..4af1c63d5b 100644 --- a/reference/chrono/year_month_weekday_last/year.md +++ b/reference/chrono/year_month_weekday_last/year.md @@ -48,6 +48,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/zoned_time.md b/reference/chrono/zoned_time.md index 2d11baae20..388be88afc 100644 --- a/reference/chrono/zoned_time.md +++ b/reference/chrono/zoned_time.md @@ -206,7 +206,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/zoned_time/formatter.md b/reference/chrono/zoned_time/formatter.md index 79f51cad63..d923b433e7 100644 --- a/reference/chrono/zoned_time/formatter.md +++ b/reference/chrono/zoned_time/formatter.md @@ -89,7 +89,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/zoned_time/formatter/format.md b/reference/chrono/zoned_time/formatter/format.md index 1cad747137..9180740c42 100644 --- a/reference/chrono/zoned_time/formatter/format.md +++ b/reference/chrono/zoned_time/formatter/format.md @@ -42,6 +42,6 @@ return formatter, charT>::format( - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/zoned_time/get_info.md b/reference/chrono/zoned_time/get_info.md index 7d8d039720..df45d1b04a 100644 --- a/reference/chrono/zoned_time/get_info.md +++ b/reference/chrono/zoned_time/get_info.md @@ -58,6 +58,6 @@ JST - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/zoned_time/get_local_time.md b/reference/chrono/zoned_time/get_local_time.md index d570b2d4cc..87a7e37de8 100644 --- a/reference/chrono/zoned_time/get_local_time.md +++ b/reference/chrono/zoned_time/get_local_time.md @@ -76,6 +76,6 @@ local now (JST) converted from local now (UTC) : 2020-01-21 14:10:15 - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/zoned_time/get_sys_time.md b/reference/chrono/zoned_time/get_sys_time.md index f2a454eeb8..ab25d3c6b6 100644 --- a/reference/chrono/zoned_time/get_sys_time.md +++ b/reference/chrono/zoned_time/get_sys_time.md @@ -57,6 +57,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/zoned_time/get_time_zone.md b/reference/chrono/zoned_time/get_time_zone.md index cfdd9521ba..89dd839f85 100644 --- a/reference/chrono/zoned_time/get_time_zone.md +++ b/reference/chrono/zoned_time/get_time_zone.md @@ -51,6 +51,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/zoned_time/op_assign.md b/reference/chrono/zoned_time/op_assign.md index 26ae8ad2f9..59c2bca354 100644 --- a/reference/chrono/zoned_time/op_assign.md +++ b/reference/chrono/zoned_time/op_assign.md @@ -75,6 +75,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/zoned_time/op_constructor.md b/reference/chrono/zoned_time/op_constructor.md index cd2cb09687..a20d0623d2 100644 --- a/reference/chrono/zoned_time/op_constructor.md +++ b/reference/chrono/zoned_time/op_constructor.md @@ -208,9 +208,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/zoned_time/op_deduction_guide.md b/reference/chrono/zoned_time/op_deduction_guide.md index c937d247cf..a018a50853 100644 --- a/reference/chrono/zoned_time/op_deduction_guide.md +++ b/reference/chrono/zoned_time/op_deduction_guide.md @@ -141,9 +141,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 diff --git a/reference/chrono/zoned_time/op_equal.md b/reference/chrono/zoned_time/op_equal.md index ee340479c5..24328c7592 100644 --- a/reference/chrono/zoned_time/op_equal.md +++ b/reference/chrono/zoned_time/op_equal.md @@ -60,6 +60,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/zoned_time/op_local_time.md b/reference/chrono/zoned_time/op_local_time.md index a72b0207b6..d5825b12fb 100644 --- a/reference/chrono/zoned_time/op_local_time.md +++ b/reference/chrono/zoned_time/op_local_time.md @@ -73,6 +73,6 @@ local now (JST) converted from local now (UTC) : 2020-01-21 14:10:15 - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/zoned_time/op_ostream.md b/reference/chrono/zoned_time/op_ostream.md index 3ebca5d43c..9f3931d4ae 100644 --- a/reference/chrono/zoned_time/op_ostream.md +++ b/reference/chrono/zoned_time/op_ostream.md @@ -71,9 +71,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 関連項目 diff --git a/reference/chrono/zoned_time/op_sys_time.md b/reference/chrono/zoned_time/op_sys_time.md index eab4c096f0..822052b22e 100644 --- a/reference/chrono/zoned_time/op_sys_time.md +++ b/reference/chrono/zoned_time/op_sys_time.md @@ -58,6 +58,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/zoned_traits.md b/reference/chrono/zoned_traits.md index 1a05dcfcb9..d42a46d3c3 100644 --- a/reference/chrono/zoned_traits.md +++ b/reference/chrono/zoned_traits.md @@ -65,7 +65,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/zoned_traits/default_zone.md b/reference/chrono/zoned_traits/default_zone.md index 8a0fb5f510..4442ddd150 100644 --- a/reference/chrono/zoned_traits/default_zone.md +++ b/reference/chrono/zoned_traits/default_zone.md @@ -48,7 +48,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/zoned_traits/locate_zone.md b/reference/chrono/zoned_traits/locate_zone.md index de7d222594..862bab765c 100644 --- a/reference/chrono/zoned_traits/locate_zone.md +++ b/reference/chrono/zoned_traits/locate_zone.md @@ -48,7 +48,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (9.0時点で実装なし) -- [GCC](/implementation.md#gcc): (9.2時点で実装なし) -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3時点で実装なし) +- [Clang](/implementation.md#clang): 9.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/climits/char_bit.md b/reference/climits/char_bit.md index 66db6a6b92..0f852ff9e8 100644 --- a/reference/climits/char_bit.md +++ b/reference/climits/char_bit.md @@ -34,7 +34,7 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.3, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.3 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified] diff --git a/reference/climits/char_max.md b/reference/climits/char_max.md index b815fc14f5..83ab3efa04 100644 --- a/reference/climits/char_max.md +++ b/reference/climits/char_max.md @@ -37,7 +37,7 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.3, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.3 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified] diff --git a/reference/climits/char_min.md b/reference/climits/char_min.md index 941cf0afad..599d9dff4e 100644 --- a/reference/climits/char_min.md +++ b/reference/climits/char_min.md @@ -38,7 +38,7 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.3, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.3 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified] diff --git a/reference/climits/int_max.md b/reference/climits/int_max.md index 92f28de419..ccdf2ed4ab 100644 --- a/reference/climits/int_max.md +++ b/reference/climits/int_max.md @@ -38,7 +38,7 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.3, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.3 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified] diff --git a/reference/climits/int_min.md b/reference/climits/int_min.md index 7ed20db9fa..20e473b62d 100644 --- a/reference/climits/int_min.md +++ b/reference/climits/int_min.md @@ -38,7 +38,7 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.3, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.3 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified] diff --git a/reference/climits/llong_max.md b/reference/climits/llong_max.md index 9c4edbb319..d40cbada68 100644 --- a/reference/climits/llong_max.md +++ b/reference/climits/llong_max.md @@ -38,7 +38,7 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.3, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.3 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2005, 2008, 2010 +- [Visual C++](/implementation.md#visual_cpp): 2005 [mark verified], 2008 [mark verified], 2010 [mark verified] diff --git a/reference/climits/llong_min.md b/reference/climits/llong_min.md index 90127aa424..908cfd5884 100644 --- a/reference/climits/llong_min.md +++ b/reference/climits/llong_min.md @@ -38,7 +38,7 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.3, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.3 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2005, 2008, 2010 +- [Visual C++](/implementation.md#visual_cpp): 2005 [mark verified], 2008 [mark verified], 2010 [mark verified] diff --git a/reference/climits/long_max.md b/reference/climits/long_max.md index d5faaa3a66..7a464e39b3 100644 --- a/reference/climits/long_max.md +++ b/reference/climits/long_max.md @@ -38,7 +38,7 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.3, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.3 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified] diff --git a/reference/climits/long_min.md b/reference/climits/long_min.md index 8ffe422adf..bb9cefc28b 100644 --- a/reference/climits/long_min.md +++ b/reference/climits/long_min.md @@ -38,7 +38,7 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.3, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.3 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified] diff --git a/reference/climits/mb_len_max.md b/reference/climits/mb_len_max.md index b57bd45126..9c5a7523c8 100644 --- a/reference/climits/mb_len_max.md +++ b/reference/climits/mb_len_max.md @@ -34,7 +34,7 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.3, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.3 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified] diff --git a/reference/climits/schar_max.md b/reference/climits/schar_max.md index 935bcd38a4..1ff5eab351 100644 --- a/reference/climits/schar_max.md +++ b/reference/climits/schar_max.md @@ -38,7 +38,7 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.3, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.3 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified] diff --git a/reference/climits/schar_min.md b/reference/climits/schar_min.md index 6bf4d9f123..bfb706bbbf 100644 --- a/reference/climits/schar_min.md +++ b/reference/climits/schar_min.md @@ -38,7 +38,7 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.3, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.3 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified] diff --git a/reference/climits/shrt_max.md b/reference/climits/shrt_max.md index 035f63342f..eaf7ba448f 100644 --- a/reference/climits/shrt_max.md +++ b/reference/climits/shrt_max.md @@ -38,7 +38,7 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.3, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.3 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified] diff --git a/reference/climits/shrt_min.md b/reference/climits/shrt_min.md index 546b9711cb..1d79b0b5e8 100644 --- a/reference/climits/shrt_min.md +++ b/reference/climits/shrt_min.md @@ -38,7 +38,7 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.3, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.3 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified] diff --git a/reference/climits/uchar_max.md b/reference/climits/uchar_max.md index 6a0dfa2823..6fad4a1db2 100644 --- a/reference/climits/uchar_max.md +++ b/reference/climits/uchar_max.md @@ -38,7 +38,7 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.3, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.3 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified] diff --git a/reference/climits/uint_max.md b/reference/climits/uint_max.md index 7d9bf52359..a1ba8ae2c8 100644 --- a/reference/climits/uint_max.md +++ b/reference/climits/uint_max.md @@ -38,7 +38,7 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.3, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.3 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified] diff --git a/reference/climits/ullong_max.md b/reference/climits/ullong_max.md index 1380def9cc..6a5a2b7fec 100644 --- a/reference/climits/ullong_max.md +++ b/reference/climits/ullong_max.md @@ -38,7 +38,7 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.3, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.3 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2005, 2008, 2010 +- [Visual C++](/implementation.md#visual_cpp): 2005 [mark verified], 2008 [mark verified], 2010 [mark verified] diff --git a/reference/climits/ulong_max.md b/reference/climits/ulong_max.md index 7558b48417..41331caf65 100644 --- a/reference/climits/ulong_max.md +++ b/reference/climits/ulong_max.md @@ -38,7 +38,7 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.3, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.3 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified] diff --git a/reference/climits/ushrt_max.md b/reference/climits/ushrt_max.md index 3a1c35952f..599ad0a128 100644 --- a/reference/climits/ushrt_max.md +++ b/reference/climits/ushrt_max.md @@ -38,7 +38,7 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.3, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.3 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified] diff --git a/reference/cmath/acos.md b/reference/cmath/acos.md index a1a6723d7b..75be823d9d 100644 --- a/reference/cmath/acos.md +++ b/reference/cmath/acos.md @@ -98,10 +98,10 @@ acos(-1.0) = 3.141593 - C++03 ### 処理系 -- [Clang](/implementation.md#clang): 1.9, 2.9, 3.1 -- [GCC](/implementation.md#gcc): 4.3.4, 4.4.5, 4.5.2, 4.6.1, 4.7.0 -- [ICC](/implementation.md#icc): 10.1, 11.0, 11.1, 12.0 -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 +- [Clang](/implementation.md#clang): 1.9 [mark verified], 2.9 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.4.5 [mark verified], 4.5.2 [mark verified], 4.6.1 [mark verified], 4.7.0 [mark verified] +- [ICC](/implementation.md#icc): 10.1 [mark verified], 11.0 [mark verified], 11.1 [mark verified], 12.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified] #### 備考 特定の環境では、早期に `constexpr` 対応されている場合がある: diff --git a/reference/cmath/acosh.md b/reference/cmath/acosh.md index 580f40969a..fa00c8a384 100644 --- a/reference/cmath/acosh.md +++ b/reference/cmath/acosh.md @@ -91,8 +91,8 @@ acosh(∞) = inf - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 2.9, 3.1 -- [GCC](/implementation.md#gcc): 4.3.4, 4.4.5, 4.5.2, 4.6.1, 4.7.0 +- [Clang](/implementation.md#clang): 2.9 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.4.5 [mark verified], 4.5.2 [mark verified], 4.6.1 [mark verified], 4.7.0 [mark verified] #### 備考 特定の環境では、早期に `constexpr` 対応されている場合がある: diff --git a/reference/cmath/asin.md b/reference/cmath/asin.md index dc4d99d8ec..c95a03bc73 100644 --- a/reference/cmath/asin.md +++ b/reference/cmath/asin.md @@ -94,10 +94,10 @@ asin(1.0) = 1.570796 - C++03 ### 処理系 -- [Clang](/implementation.md#clang): 1.9, 2.9, 3.1 -- [GCC](/implementation.md#gcc): 3.4.6, 4.2.4, 4.3.5, 4.4.5, 4.5.1, 4.5.2, 4.6.1, 4.7.0 -- [ICC](/implementation.md#icc): 10.1, 11.0, 11.1, 12.0 -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 +- [Clang](/implementation.md#clang): 1.9 [mark verified], 2.9 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 3.4.6 [mark verified], 4.2.4 [mark verified], 4.3.5 [mark verified], 4.4.5 [mark verified], 4.5.1 [mark verified], 4.5.2 [mark verified], 4.6.1 [mark verified], 4.7.0 [mark verified] +- [ICC](/implementation.md#icc): 10.1 [mark verified], 11.0 [mark verified], 11.1 [mark verified], 12.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified] #### 備考 特定の環境では、早期に `constexpr` 対応されている場合がある: diff --git a/reference/cmath/asinh.md b/reference/cmath/asinh.md index 2ce92c89d4..f64c9b7025 100644 --- a/reference/cmath/asinh.md +++ b/reference/cmath/asinh.md @@ -85,8 +85,8 @@ asinh(1.0) = 0.881374 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 2.9, 3.1 -- [GCC](/implementation.md#gcc): 4.3.4, 4.4.5, 4.5.2, 4.6.1, 4.7.0 +- [Clang](/implementation.md#clang): 2.9 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.4.5 [mark verified], 4.5.2 [mark verified], 4.6.1 [mark verified], 4.7.0 [mark verified] #### 備考 diff --git a/reference/cmath/assoc_laguerre.md b/reference/cmath/assoc_laguerre.md index 2effc09d63..59f2e3d2fd 100644 --- a/reference/cmath/assoc_laguerre.md +++ b/reference/cmath/assoc_laguerre.md @@ -118,7 +118,7 @@ assoc_laguerre(2, 1, 2) = -1 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 7.1.0 +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/assoc_legendre.md b/reference/cmath/assoc_legendre.md index 6c6839d980..dc96d1b09c 100644 --- a/reference/cmath/assoc_legendre.md +++ b/reference/cmath/assoc_legendre.md @@ -117,7 +117,7 @@ assoc_legendre(2, 2, 1) = 0 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 7.1.0 +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/atan.md b/reference/cmath/atan.md index 457d83f3c6..f795bc0b04 100644 --- a/reference/cmath/atan.md +++ b/reference/cmath/atan.md @@ -85,10 +85,10 @@ atan(∞) = 1.570796 - C++03 ### 処理系 -- [Clang](/implementation.md#clang): 1.9, 2.9, 3.1 -- [GCC](/implementation.md#gcc): 3.4.6, 4.2.4, 4.3.5, 4.4.5, 4.5.1, 4.5.2, 4.6.1, 4.7.0 -- [ICC](/implementation.md#icc): 10.1, 11.0, 11.1, 12.0 -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 +- [Clang](/implementation.md#clang): 1.9 [mark verified], 2.9 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 3.4.6 [mark verified], 4.2.4 [mark verified], 4.3.5 [mark verified], 4.4.5 [mark verified], 4.5.1 [mark verified], 4.5.2 [mark verified], 4.6.1 [mark verified], 4.7.0 [mark verified] +- [ICC](/implementation.md#icc): 10.1 [mark verified], 11.0 [mark verified], 11.1 [mark verified], 12.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified] #### 備考 特定の環境では、早期に `constexpr` 対応されている場合がある: diff --git a/reference/cmath/atan2.md b/reference/cmath/atan2.md index fcbcf04210..809a3b3672 100644 --- a/reference/cmath/atan2.md +++ b/reference/cmath/atan2.md @@ -121,10 +121,10 @@ atan2(-1.0, 1.0) = -0.785398 - C++03 ### 処理系 -- [Clang](/implementation.md#clang): 1.9, 2.9, 3.1 -- [GCC](/implementation.md#gcc): 3.4.6, 4.2.4, 4.3.5, 4.4.5, 4.5.1, 4.5.2, 4.6.1, 4.7.0 -- [ICC](/implementation.md#icc): 10.1, 11.0, 11.1, 12.0 -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 +- [Clang](/implementation.md#clang): 1.9 [mark verified], 2.9 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 3.4.6 [mark verified], 4.2.4 [mark verified], 4.3.5 [mark verified], 4.4.5 [mark verified], 4.5.1 [mark verified], 4.5.2 [mark verified], 4.6.1 [mark verified], 4.7.0 [mark verified] +- [ICC](/implementation.md#icc): 10.1 [mark verified], 11.0 [mark verified], 11.1 [mark verified], 12.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified] #### 備考 特定の環境では、早期に `constexpr` 対応されている場合がある: diff --git a/reference/cmath/atanh.md b/reference/cmath/atanh.md index 6e3bb5445e..0a8febb2d9 100644 --- a/reference/cmath/atanh.md +++ b/reference/cmath/atanh.md @@ -93,8 +93,8 @@ atanh(1.0) = inf - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 2.9, 3.1 -- [GCC](/implementation.md#gcc): 4.3.4, 4.4.5, 4.5.2, 4.6.1, 4.7.0 +- [Clang](/implementation.md#clang): 2.9 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.4.5 [mark verified], 4.5.2 [mark verified], 4.6.1 [mark verified], 4.7.0 [mark verified] #### 備考 特定の環境では、早期に `constexpr` 対応されている場合がある: diff --git a/reference/cmath/beta.md b/reference/cmath/beta.md index 16ca1ded50..226357579a 100644 --- a/reference/cmath/beta.md +++ b/reference/cmath/beta.md @@ -84,7 +84,7 @@ beta(2, 4) = 0.05 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 7.1.0 +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/cbrt.md b/reference/cmath/cbrt.md index 8ae164345a..07cb2f3f40 100644 --- a/reference/cmath/cbrt.md +++ b/reference/cmath/cbrt.md @@ -93,8 +93,8 @@ cbrt(-1.0) = -1.000000 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 2.9, 3.1 -- [GCC](/implementation.md#gcc): 4.3.4, 4.4.5, 4.5.2, 4.6.1, 4.7.0 +- [Clang](/implementation.md#clang): 2.9 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.4.5 [mark verified], 4.5.2 [mark verified], 4.6.1 [mark verified], 4.7.0 [mark verified] #### 備考 特定の環境では、早期に `constexpr` 対応されている場合がある: diff --git a/reference/cmath/comp_ellint_1.md b/reference/cmath/comp_ellint_1.md index 6ea7c4d0a2..2ddd282798 100644 --- a/reference/cmath/comp_ellint_1.md +++ b/reference/cmath/comp_ellint_1.md @@ -118,7 +118,7 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 7.1.0 +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/comp_ellint_2.md b/reference/cmath/comp_ellint_2.md index 50c85c08c8..5e923aab7c 100644 --- a/reference/cmath/comp_ellint_2.md +++ b/reference/cmath/comp_ellint_2.md @@ -77,7 +77,7 @@ comp_ellint_2(1) = 1 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 7.1.0 +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/comp_ellint_3.md b/reference/cmath/comp_ellint_3.md index aebaa9c0ed..395e31c3c0 100644 --- a/reference/cmath/comp_ellint_3.md +++ b/reference/cmath/comp_ellint_3.md @@ -107,7 +107,7 @@ comp_ellint_3(1, 1) = inf ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 7.1.0 +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/copysign.md b/reference/cmath/copysign.md index 22f5656c61..378d7a66a7 100644 --- a/reference/cmath/copysign.md +++ b/reference/cmath/copysign.md @@ -133,8 +133,8 @@ namespace std { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/cos.md b/reference/cmath/cos.md index 8c79ac589e..c86438c446 100644 --- a/reference/cmath/cos.md +++ b/reference/cmath/cos.md @@ -114,10 +114,10 @@ int main() - C++03 ### 処理系 -- [Clang](/implementation.md#clang): 1.9, 2.9, 3.1 -- [GCC](/implementation.md#gcc): 3.4.6, 4.2.4, 4.3.5, 4.4.5, 4.5.1, 4.5.2, 4.6.1, 4.7.0 -- [ICC](/implementation.md#icc): 10.1, 11.0, 11.1, 12.0 -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 +- [Clang](/implementation.md#clang): 1.9 [mark verified], 2.9 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 3.4.6 [mark verified], 4.2.4 [mark verified], 4.3.5 [mark verified], 4.4.5 [mark verified], 4.5.1 [mark verified], 4.5.2 [mark verified], 4.6.1 [mark verified], 4.7.0 [mark verified] +- [ICC](/implementation.md#icc): 10.1 [mark verified], 11.0 [mark verified], 11.1 [mark verified], 12.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified] #### 備考 特定の環境では、早期に `constexpr` 対応されている場合がある: diff --git a/reference/cmath/cosh.md b/reference/cmath/cosh.md index 283d8afb12..ebc6b8c318 100644 --- a/reference/cmath/cosh.md +++ b/reference/cmath/cosh.md @@ -87,10 +87,10 @@ cosh(1.0) = 1.543081 - C++03 ### 処理系 -- [Clang](/implementation.md#clang): 1.9, 2.9, 3.1 -- [GCC](/implementation.md#gcc): 3.4.6, 4.2.4, 4.3.5, 4.4.5, 4.5.1, 4.5.2, 4.6.1, 4.7.0 -- [ICC](/implementation.md#icc): 10.1, 11.0, 11.1, 12.0 -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 +- [Clang](/implementation.md#clang): 1.9 [mark verified], 2.9 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 3.4.6 [mark verified], 4.2.4 [mark verified], 4.3.5 [mark verified], 4.4.5 [mark verified], 4.5.1 [mark verified], 4.5.2 [mark verified], 4.6.1 [mark verified], 4.7.0 [mark verified] +- [ICC](/implementation.md#icc): 10.1 [mark verified], 11.0 [mark verified], 11.1 [mark verified], 12.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified] #### 備考 特定の環境では、早期に `constexpr` 対応されている場合がある: diff --git a/reference/cmath/cyl_bessel_i.md b/reference/cmath/cyl_bessel_i.md index 6585358768..6d66d92253 100644 --- a/reference/cmath/cyl_bessel_i.md +++ b/reference/cmath/cyl_bessel_i.md @@ -99,7 +99,7 @@ cyl_bessel_i(1, 2) = 1.59064 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 7.1.0 +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/cyl_bessel_j.md b/reference/cmath/cyl_bessel_j.md index 7d9a796aca..19c4bf196e 100644 --- a/reference/cmath/cyl_bessel_j.md +++ b/reference/cmath/cyl_bessel_j.md @@ -100,7 +100,7 @@ cyl_bessel_j(1, 0.666667 pi) = 0.568869 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 7.1.0 +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/cyl_bessel_k.md b/reference/cmath/cyl_bessel_k.md index b6f9f4c55b..85a751bf1f 100644 --- a/reference/cmath/cyl_bessel_k.md +++ b/reference/cmath/cyl_bessel_k.md @@ -104,7 +104,7 @@ cyl_bessel_k(1, 2) = 0.139866 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 7.1.0 +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/cyl_neumann.md b/reference/cmath/cyl_neumann.md index ae52c163bd..cd072714d2 100644 --- a/reference/cmath/cyl_neumann.md +++ b/reference/cmath/cyl_neumann.md @@ -101,7 +101,7 @@ cyl_neumann(1, 0.666667 pi) = -0.054725 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 7.1.0 +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/double_t.md b/reference/cmath/double_t.md index 51704418fb..5fecdefac6 100644 --- a/reference/cmath/double_t.md +++ b/reference/cmath/double_t.md @@ -24,7 +24,7 @@ namespace std { - [Clang](/implementation.md#clang): - [GCC](/implementation.md#gcc): - [ICC](/implementation.md#icc): -- [Visual C++](/implementation.md#visual_cpp): 2013, 2015, 2017, 2019, 2022 +- [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified], 2017 [mark verified], 2019 [mark verified], 2022 [mark verified] - 2013, 2015では、常に`double`の別名。 - 2017以降で、ターゲットのCPUアーキテクチャが`x86`以外である場合、`double`の別名。 - 2017以降で、ターゲットのCPUアーキテクチャが`x86`で、SSE2を使用する場合(`/arch:SSE2`以上のコンパイラオプション)、`double`の別名。 diff --git a/reference/cmath/ellint_1.md b/reference/cmath/ellint_1.md index 24045d4ece..18252de203 100644 --- a/reference/cmath/ellint_1.md +++ b/reference/cmath/ellint_1.md @@ -100,7 +100,7 @@ ellint_1(1, 0.5 pi) = nan ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 7.1.0 +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/ellint_2.md b/reference/cmath/ellint_2.md index e128264252..b57fa4e827 100644 --- a/reference/cmath/ellint_2.md +++ b/reference/cmath/ellint_2.md @@ -100,7 +100,7 @@ ellint_2(1, 0.5 pi) = 1 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 7.1.0 +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/ellint_3.md b/reference/cmath/ellint_3.md index 569f0d90b0..3365c71625 100644 --- a/reference/cmath/ellint_3.md +++ b/reference/cmath/ellint_3.md @@ -123,7 +123,7 @@ ellint_3(0.5, 1, 0.5 pi) = (domain_error) ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 7.1.0 +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/erf.md b/reference/cmath/erf.md index b492184f89..32fdcefeac 100644 --- a/reference/cmath/erf.md +++ b/reference/cmath/erf.md @@ -90,8 +90,8 @@ erf(+∞) = 1.000000 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/erfc.md b/reference/cmath/erfc.md index 88aa1bf739..fb6191431e 100644 --- a/reference/cmath/erfc.md +++ b/reference/cmath/erfc.md @@ -90,8 +90,8 @@ erfc(+∞) = 0.000000 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/exp.md b/reference/cmath/exp.md index 6622248ac1..a2d16e2b93 100644 --- a/reference/cmath/exp.md +++ b/reference/cmath/exp.md @@ -92,10 +92,10 @@ exp(-∞) = 0.000000 - C++03 ### 処理系 -- [Clang](/implementation.md#clang): 1.9, 2.9, 3.1 -- [GCC](/implementation.md#gcc): 3.4.6, 4.2.4, 4.3.5, 4.4.5, 4.5.1, 4.5.2, 4.6.1, 4.7.0 -- [ICC](/implementation.md#icc): 10.1, 11.0, 11.1, 12.0 -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 +- [Clang](/implementation.md#clang): 1.9 [mark verified], 2.9 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 3.4.6 [mark verified], 4.2.4 [mark verified], 4.3.5 [mark verified], 4.4.5 [mark verified], 4.5.1 [mark verified], 4.5.2 [mark verified], 4.6.1 [mark verified], 4.7.0 [mark verified] +- [ICC](/implementation.md#icc): 10.1 [mark verified], 11.0 [mark verified], 11.1 [mark verified], 12.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified] #### 備考 特定の環境では、早期に `constexpr` 対応されている場合がある: diff --git a/reference/cmath/exp2.md b/reference/cmath/exp2.md index 35f918b38d..cf5fef37f2 100644 --- a/reference/cmath/exp2.md +++ b/reference/cmath/exp2.md @@ -115,8 +115,8 @@ namespace std { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 2.9, 3.1 -- [GCC](/implementation.md#gcc): 4.3.4, 4.4.5, 4.5.2, 4.6.1, 4.7.0 +- [Clang](/implementation.md#clang): 2.9 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.4.5 [mark verified], 4.5.2 [mark verified], 4.6.1 [mark verified], 4.7.0 [mark verified] #### 備考 特定の環境では、早期に `constexpr` 対応されている場合がある: diff --git a/reference/cmath/expint.md b/reference/cmath/expint.md index ee4e7b02a5..85969848f1 100644 --- a/reference/cmath/expint.md +++ b/reference/cmath/expint.md @@ -79,7 +79,7 @@ expint(∞) = -nan ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 7.1.0 +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/expm1.md b/reference/cmath/expm1.md index eea6930d5a..17755fd1c7 100644 --- a/reference/cmath/expm1.md +++ b/reference/cmath/expm1.md @@ -96,8 +96,8 @@ expm1(-∞) = -1.000000 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 2.9, 3.1 -- [GCC](/implementation.md#gcc): 4.3.4, 4.4.5, 4.5.2, 4.6.1, 4.7.0 +- [Clang](/implementation.md#clang): 2.9 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.4.5 [mark verified], 4.5.2 [mark verified], 4.6.1 [mark verified], 4.7.0 [mark verified] #### 備考 特定の環境では、早期に `constexpr` 対応されている場合がある: diff --git a/reference/cmath/fabs.md b/reference/cmath/fabs.md index ee7a196cc6..dbdc987deb 100644 --- a/reference/cmath/fabs.md +++ b/reference/cmath/fabs.md @@ -93,10 +93,10 @@ fabs(-∞) = inf - C++03 ### 処理系 -- [Clang](/implementation.md#clang): 1.9, 2.9, 3.1 -- [GCC](/implementation.md#gcc): 3.4.6, 4.2.4, 4.3.5, 4.4.5, 4.5.1, 4.5.2, 4.6.1, 4.7.0 -- [ICC](/implementation.md#icc): 10.1, 11.0, 11.1, 12.0 -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 +- [Clang](/implementation.md#clang): 1.9 [mark verified], 2.9 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 3.4.6 [mark verified], 4.2.4 [mark verified], 4.3.5 [mark verified], 4.4.5 [mark verified], 4.5.1 [mark verified], 4.5.2 [mark verified], 4.6.1 [mark verified], 4.7.0 [mark verified] +- [ICC](/implementation.md#icc): 10.1 [mark verified], 11.0 [mark verified], 11.1 [mark verified], 12.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified] #### 備考 特定の環境では、早期に `constexpr` 対応されている場合がある: diff --git a/reference/cmath/fdim.md b/reference/cmath/fdim.md index 34f6d84bd7..00b146ce45 100644 --- a/reference/cmath/fdim.md +++ b/reference/cmath/fdim.md @@ -85,8 +85,8 @@ fdim(+1.0, 0.0) = +1 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/float_t.md b/reference/cmath/float_t.md index 0a05381e8c..9eb93ac0b7 100644 --- a/reference/cmath/float_t.md +++ b/reference/cmath/float_t.md @@ -24,7 +24,7 @@ namespace std { - [Clang](/implementation.md#clang): - [GCC](/implementation.md#gcc): - [ICC](/implementation.md#icc): -- [Visual C++](/implementation.md#visual_cpp): 2013, 2015, 2017, 2019, 2022 +- [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified], 2017 [mark verified], 2019 [mark verified], 2022 [mark verified] - 2013, 2015では、常に`float`の別名。 - 2017以降で、ターゲットのCPUアーキテクチャが`x86`以外である場合、`float`の別名。 - 2017以降で、ターゲットのCPUアーキテクチャが`x86`で、SSE2を使用する場合(`/arch:SSE2`以上のコンパイラオプション)、`float`の別名。 diff --git a/reference/cmath/fmax.md b/reference/cmath/fmax.md index 39d9ca6275..5acd818050 100644 --- a/reference/cmath/fmax.md +++ b/reference/cmath/fmax.md @@ -93,8 +93,8 @@ fmax( nan, nan) = +nan - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/fmin.md b/reference/cmath/fmin.md index 6f95abde92..11bc5ae4e4 100644 --- a/reference/cmath/fmin.md +++ b/reference/cmath/fmin.md @@ -94,8 +94,8 @@ fmin( nan, nan) = +nan - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/hermite.md b/reference/cmath/hermite.md index cfe3004a2b..0d00936a15 100644 --- a/reference/cmath/hermite.md +++ b/reference/cmath/hermite.md @@ -99,7 +99,7 @@ hermite(3, 1) = -4 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 7.1.0 +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/hypot.md b/reference/cmath/hypot.md index 96700b2ce8..9bd9dd2442 100644 --- a/reference/cmath/hypot.md +++ b/reference/cmath/hypot.md @@ -215,9 +215,9 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 2.9, 3.1 -- [GCC](/implementation.md#gcc): 4.3.4, 4.4.5, 4.5.2, 4.6.1, 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015, 2017 +- [Clang](/implementation.md#clang): 2.9 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.4.5 [mark verified], 4.5.2 [mark verified], 4.6.1 [mark verified], 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - 2002, 2003, 2005, 2008, 2010およびそれ以降では、``でグローバル名前空間に以下が定義されている。 - 仮引数・戻り値が`float`型の`_hypotf`関数が定義されている。 - 仮引数・戻り値が`double`型の`hypot`関数と`_hypot`関数が定義されている。 diff --git a/reference/cmath/ilogb.md b/reference/cmath/ilogb.md index 7c1faa8e71..af2c447dab 100644 --- a/reference/cmath/ilogb.md +++ b/reference/cmath/ilogb.md @@ -92,8 +92,8 @@ ilogb(1e-309) = -1027 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/isfinite.md b/reference/cmath/isfinite.md index 395305d823..30ca0708c3 100644 --- a/reference/cmath/isfinite.md +++ b/reference/cmath/isfinite.md @@ -96,8 +96,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/isgreater.md b/reference/cmath/isgreater.md index 37537cceea..9f325007ca 100644 --- a/reference/cmath/isgreater.md +++ b/reference/cmath/isgreater.md @@ -99,8 +99,8 @@ isgreater(nan, nan) = false - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/isgreaterequal.md b/reference/cmath/isgreaterequal.md index c8c03b169a..81362665ce 100644 --- a/reference/cmath/isgreaterequal.md +++ b/reference/cmath/isgreaterequal.md @@ -99,8 +99,8 @@ isgreaterequal(nan, nan) = false - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/isinf.md b/reference/cmath/isinf.md index 2dfd8e152f..f962c92ece 100644 --- a/reference/cmath/isinf.md +++ b/reference/cmath/isinf.md @@ -70,8 +70,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/isless.md b/reference/cmath/isless.md index 30e5078f2b..78fc46a878 100644 --- a/reference/cmath/isless.md +++ b/reference/cmath/isless.md @@ -99,8 +99,8 @@ isless(nan, nan) = false - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/islessequal.md b/reference/cmath/islessequal.md index ffe0a4dd71..44a39cfe6d 100644 --- a/reference/cmath/islessequal.md +++ b/reference/cmath/islessequal.md @@ -99,8 +99,8 @@ islessequal(nan, nan) = false - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/islessgreater.md b/reference/cmath/islessgreater.md index a31690fff1..60cb3e87ab 100644 --- a/reference/cmath/islessgreater.md +++ b/reference/cmath/islessgreater.md @@ -99,8 +99,8 @@ islessgreater(nan, nan) = false - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/isnan.md b/reference/cmath/isnan.md index d9ef052668..440e2a07c6 100644 --- a/reference/cmath/isnan.md +++ b/reference/cmath/isnan.md @@ -74,8 +74,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/isnormal.md b/reference/cmath/isnormal.md index 108f92a633..6aeaa41834 100644 --- a/reference/cmath/isnormal.md +++ b/reference/cmath/isnormal.md @@ -96,8 +96,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/isunordered.md b/reference/cmath/isunordered.md index 3c29cc16aa..7adb781418 100644 --- a/reference/cmath/isunordered.md +++ b/reference/cmath/isunordered.md @@ -82,8 +82,8 @@ isunordered(1, inf) = false - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/laguerre.md b/reference/cmath/laguerre.md index 1f3ada630d..50494f20b0 100644 --- a/reference/cmath/laguerre.md +++ b/reference/cmath/laguerre.md @@ -99,7 +99,7 @@ laguerre(3, 2) = -0.333333 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 7.1.0 +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/legendre.md b/reference/cmath/legendre.md index 2bf88a55b5..5e35b3d88c 100644 --- a/reference/cmath/legendre.md +++ b/reference/cmath/legendre.md @@ -99,7 +99,7 @@ legendre(3, 1) = 1 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 7.1.0 +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/lerp.md b/reference/cmath/lerp.md index 28c70cc811..eec00483fd 100644 --- a/reference/cmath/lerp.md +++ b/reference/cmath/lerp.md @@ -136,7 +136,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 9.1 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/lgamma.md b/reference/cmath/lgamma.md index 57a08370ca..bcb8dd5521 100644 --- a/reference/cmath/lgamma.md +++ b/reference/cmath/lgamma.md @@ -97,8 +97,8 @@ lgamma(+∞) = inf - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/llrint.md b/reference/cmath/llrint.md index ad4bfdedfe..37e2f87703 100644 --- a/reference/cmath/llrint.md +++ b/reference/cmath/llrint.md @@ -157,10 +157,10 @@ llrint(9.22337e+18) = -9223372036854775808, FE_INEXACT = false, FE_INVALID = tru - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0, 4.9.1, 4.9.2, 5.1.0, 5.2.0, 6.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified], 3.7 [mark verified], 3.8 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.1.0 [mark verified], 5.2.0 [mark verified], 6.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/cmath/llround.md b/reference/cmath/llround.md index 468961a058..57a106b16a 100644 --- a/reference/cmath/llround.md +++ b/reference/cmath/llround.md @@ -99,8 +99,8 @@ llround(-2.9) = -3 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/log.md b/reference/cmath/log.md index 3da518e8a0..e750a577d9 100644 --- a/reference/cmath/log.md +++ b/reference/cmath/log.md @@ -94,10 +94,10 @@ log(-1.0) = nan - C++03 ### 処理系 -- [Clang](/implementation.md#clang): 1.9, 2.9, 3.1 -- [GCC](/implementation.md#gcc): 3.4.6, 4.2.4, 4.3.5, 4.4.5, 4.5.1, 4.5.2, 4.6.1, 4.7.0 -- [ICC](/implementation.md#icc): 10.1, 11.0, 11.1, 12.0 -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 +- [Clang](/implementation.md#clang): 1.9 [mark verified], 2.9 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 3.4.6 [mark verified], 4.2.4 [mark verified], 4.3.5 [mark verified], 4.4.5 [mark verified], 4.5.1 [mark verified], 4.5.2 [mark verified], 4.6.1 [mark verified], 4.7.0 [mark verified] +- [ICC](/implementation.md#icc): 10.1 [mark verified], 11.0 [mark verified], 11.1 [mark verified], 12.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified] #### 備考 特定の環境では、早期に `constexpr` 対応されている場合がある: diff --git a/reference/cmath/log10.md b/reference/cmath/log10.md index 1bdbb66a04..7ecd19f593 100644 --- a/reference/cmath/log10.md +++ b/reference/cmath/log10.md @@ -127,10 +127,10 @@ log10(100000000.000000) : 8.000000 - C++03 ### 処理系 -- [Clang](/implementation.md#clang): 1.9, 2.9, 3.1 -- [GCC](/implementation.md#gcc): 3.4.6, 4.2.4, 4.3.5, 4.4.5, 4.5.1, 4.5.2, 4.6.1, 4.7.0 -- [ICC](/implementation.md#icc): 10.1, 11.0, 11.1, 12.0 -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 +- [Clang](/implementation.md#clang): 1.9 [mark verified], 2.9 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 3.4.6 [mark verified], 4.2.4 [mark verified], 4.3.5 [mark verified], 4.4.5 [mark verified], 4.5.1 [mark verified], 4.5.2 [mark verified], 4.6.1 [mark verified], 4.7.0 [mark verified] +- [ICC](/implementation.md#icc): 10.1 [mark verified], 11.0 [mark verified], 11.1 [mark verified], 12.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified] #### 備考 特定の環境では、早期に `constexpr` 対応されている場合がある: diff --git a/reference/cmath/log1p.md b/reference/cmath/log1p.md index 26813a70ad..f8cd0da401 100644 --- a/reference/cmath/log1p.md +++ b/reference/cmath/log1p.md @@ -102,8 +102,8 @@ log1p(-2.0) = -nan ### 処理系 -- [Clang](/implementation.md#clang): 2.9, 3.1 -- [GCC](/implementation.md#gcc): 4.3.4, 4.4.5, 4.5.2, 4.6.1, 4.7.0 +- [Clang](/implementation.md#clang): 2.9 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.4.5 [mark verified], 4.5.2 [mark verified], 4.6.1 [mark verified], 4.7.0 [mark verified] #### 備考 特定の環境では、早期に `constexpr` 対応されている場合がある: diff --git a/reference/cmath/log2.md b/reference/cmath/log2.md index e57ff5ab2a..3995ae4613 100644 --- a/reference/cmath/log2.md +++ b/reference/cmath/log2.md @@ -156,8 +156,8 @@ log2(32) : 5, power of 2 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 2.9, 3.1 -- [GCC](/implementation.md#gcc): 4.3.4, 4.4.5, 4.5.2, 4.6.1, 4.7.0 +- [Clang](/implementation.md#clang): 2.9 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.4.5 [mark verified], 4.5.2 [mark verified], 4.6.1 [mark verified], 4.7.0 [mark verified] #### 備考 特定の環境では、早期に `constexpr` 対応されている場合がある: diff --git a/reference/cmath/logb.md b/reference/cmath/logb.md index 465951a6bd..c0c2f54eaf 100644 --- a/reference/cmath/logb.md +++ b/reference/cmath/logb.md @@ -94,8 +94,8 @@ logb(1e-309) = -1027 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/lrint.md b/reference/cmath/lrint.md index f81ec46648..387b950a3c 100644 --- a/reference/cmath/lrint.md +++ b/reference/cmath/lrint.md @@ -156,10 +156,10 @@ lrint(9.22337e+18) = -9223372036854775808, FE_INEXACT = false, FE_INVALID = true - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0, 4.9.1, 4.9.2, 5.1.0, 5.2.0, 6.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified], 3.7 [mark verified], 3.8 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.1.0 [mark verified], 5.2.0 [mark verified], 6.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] ### 備考 - 本関数は C++11 で追加されたが、Clang(libc++) では C++11 モードでなくても使用可能である diff --git a/reference/cmath/lround.md b/reference/cmath/lround.md index 788e89eaf1..d3bc0e7dbd 100644 --- a/reference/cmath/lround.md +++ b/reference/cmath/lround.md @@ -99,8 +99,8 @@ lround(-2.9) = -3 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/math_errexcept.md b/reference/cmath/math_errexcept.md index 4a89b56376..0b178f2b4c 100644 --- a/reference/cmath/math_errexcept.md +++ b/reference/cmath/math_errexcept.md @@ -70,7 +70,7 @@ FE_DIVBYZERO - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/math_errhandling.md b/reference/cmath/math_errhandling.md index 6c5c3a0327..b0cfd625a2 100644 --- a/reference/cmath/math_errhandling.md +++ b/reference/cmath/math_errhandling.md @@ -105,7 +105,7 @@ log(0) = -inf - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/math_errno.md b/reference/cmath/math_errno.md index 82724a24d4..fc68c77bb2 100644 --- a/reference/cmath/math_errno.md +++ b/reference/cmath/math_errno.md @@ -49,7 +49,7 @@ math error : Numerical argument out of domain - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/nanf.md b/reference/cmath/nanf.md index 14788c5015..8b3ed826f6 100644 --- a/reference/cmath/nanf.md +++ b/reference/cmath/nanf.md @@ -69,7 +69,7 @@ nan(7ff800000000000f) - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/nearbyint.md b/reference/cmath/nearbyint.md index f5d3a067b7..339a58b2c2 100644 --- a/reference/cmath/nearbyint.md +++ b/reference/cmath/nearbyint.md @@ -126,10 +126,10 @@ FE_INEXACT = false - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified], 3.7 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] ### 備考 - 本関数は C++11 で追加されたが、Clang(libc++) では C++11 モードでなくても使用可能である。 diff --git a/reference/cmath/nextafter.md b/reference/cmath/nextafter.md index f7c91349f7..f66bdfebba 100644 --- a/reference/cmath/nextafter.md +++ b/reference/cmath/nextafter.md @@ -105,8 +105,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/nexttoward.md b/reference/cmath/nexttoward.md index 9e97347cca..5d285c4fe4 100644 --- a/reference/cmath/nexttoward.md +++ b/reference/cmath/nexttoward.md @@ -106,8 +106,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/pow.md b/reference/cmath/pow.md index 786a5d4c78..8b27ff64a2 100644 --- a/reference/cmath/pow.md +++ b/reference/cmath/pow.md @@ -150,10 +150,10 @@ pow(2.0, -∞) = 0.000000 - C++03 ### 処理系 -- [Clang](/implementation.md#clang): 1.9, 2.9, 3.1 -- [GCC](/implementation.md#gcc): 3.4.6, 4.2.4, 4.3.5, 4.4.5, 4.5.1, 4.5.2, 4.6.1, 4.7.0 -- [ICC](/implementation.md#icc): 10.1, 11.0, 11.1, 12.0 -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 +- [Clang](/implementation.md#clang): 1.9 [mark verified], 2.9 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 3.4.6 [mark verified], 4.2.4 [mark verified], 4.3.5 [mark verified], 4.4.5 [mark verified], 4.5.1 [mark verified], 4.5.2 [mark verified], 4.6.1 [mark verified], 4.7.0 [mark verified] +- [ICC](/implementation.md#icc): 10.1 [mark verified], 11.0 [mark verified], 11.1 [mark verified], 12.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified] #### 備考 特定の環境では、早期に `constexpr` 対応されている場合がある: diff --git a/reference/cmath/remainder.md b/reference/cmath/remainder.md index 54d5b3a54a..d0e32ab57e 100644 --- a/reference/cmath/remainder.md +++ b/reference/cmath/remainder.md @@ -103,8 +103,8 @@ remainder(6, 2) = 0 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/remquo.md b/reference/cmath/remquo.md index 12002f0809..4696daaf51 100644 --- a/reference/cmath/remquo.md +++ b/reference/cmath/remquo.md @@ -128,8 +128,8 @@ remquo(6, 2) = quotient:3 remainder:0 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/riemann_zeta.md b/reference/cmath/riemann_zeta.md index b6a8981d53..65d1f4dfd3 100644 --- a/reference/cmath/riemann_zeta.md +++ b/reference/cmath/riemann_zeta.md @@ -85,7 +85,7 @@ riemann_zeta(2) = 1.64493 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 7.1.0 +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/rint.md b/reference/cmath/rint.md index 85e053f497..c656b58ffc 100644 --- a/reference/cmath/rint.md +++ b/reference/cmath/rint.md @@ -128,10 +128,10 @@ FE_INEXACT = true - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified], 3.7 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] ### 備考 - 本関数は C++11 で追加されたが、Clang(libc++) では C++11 モードでなくても使用可能である。 diff --git a/reference/cmath/scalbln.md b/reference/cmath/scalbln.md index 41caa90a45..3fee1c1b09 100644 --- a/reference/cmath/scalbln.md +++ b/reference/cmath/scalbln.md @@ -96,8 +96,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/scalbn.md b/reference/cmath/scalbn.md index 8ff816b4ff..f30f9fdb1d 100644 --- a/reference/cmath/scalbn.md +++ b/reference/cmath/scalbn.md @@ -126,8 +126,8 @@ namespace std { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/signbit.md b/reference/cmath/signbit.md index 9f39e4a2a8..70b744e3df 100644 --- a/reference/cmath/signbit.md +++ b/reference/cmath/signbit.md @@ -78,8 +78,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/sin.md b/reference/cmath/sin.md index f149abfca0..60450378af 100644 --- a/reference/cmath/sin.md +++ b/reference/cmath/sin.md @@ -114,10 +114,10 @@ int main() - C++03 ### 処理系 -- [Clang](/implementation.md#clang): 1.9, 2.9, 3.1 -- [GCC](/implementation.md#gcc): 3.4.6, 4.2.4, 4.3.5, 4.4.5, 4.5.1, 4.5.2, 4.6.1, 4.7.0 -- [ICC](/implementation.md#icc): 10.1, 11.0, 11.1, 12.0 -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 +- [Clang](/implementation.md#clang): 1.9 [mark verified], 2.9 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 3.4.6 [mark verified], 4.2.4 [mark verified], 4.3.5 [mark verified], 4.4.5 [mark verified], 4.5.1 [mark verified], 4.5.2 [mark verified], 4.6.1 [mark verified], 4.7.0 [mark verified] +- [ICC](/implementation.md#icc): 10.1 [mark verified], 11.0 [mark verified], 11.1 [mark verified], 12.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified] #### 備考 特定の環境では、早期に `constexpr` 対応されている場合がある: diff --git a/reference/cmath/sinh.md b/reference/cmath/sinh.md index 0be3445468..6e8594c3f0 100644 --- a/reference/cmath/sinh.md +++ b/reference/cmath/sinh.md @@ -87,10 +87,10 @@ sinh(1.0) = 1.175201 - C++03 ### 処理系 -- [Clang](/implementation.md#clang): 1.9, 2.9, 3.1 -- [GCC](/implementation.md#gcc): 3.4.6, 4.2.4, 4.3.5, 4.4.5, 4.5.1, 4.5.2, 4.6.1, 4.7.0 -- [ICC](/implementation.md#icc): 10.1, 11.0, 11.1, 12.0 -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 +- [Clang](/implementation.md#clang): 1.9 [mark verified], 2.9 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 3.4.6 [mark verified], 4.2.4 [mark verified], 4.3.5 [mark verified], 4.4.5 [mark verified], 4.5.1 [mark verified], 4.5.2 [mark verified], 4.6.1 [mark verified], 4.7.0 [mark verified] +- [ICC](/implementation.md#icc): 10.1 [mark verified], 11.0 [mark verified], 11.1 [mark verified], 12.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified] #### 備考 特定の環境では、早期に `constexpr` 対応されている場合がある: diff --git a/reference/cmath/sph_bessel.md b/reference/cmath/sph_bessel.md index e9f7413f16..4b9e4ee788 100644 --- a/reference/cmath/sph_bessel.md +++ b/reference/cmath/sph_bessel.md @@ -100,7 +100,7 @@ sph_bessel(2, 0.5 pi) = 0.137417 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 7.1.0 +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/sph_legendre.md b/reference/cmath/sph_legendre.md index 8f370c09d1..1f32cba3dd 100644 --- a/reference/cmath/sph_legendre.md +++ b/reference/cmath/sph_legendre.md @@ -135,7 +135,7 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 7.1.0 +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/sph_neumann.md b/reference/cmath/sph_neumann.md index 58ceab4a6b..beb75e7fad 100644 --- a/reference/cmath/sph_neumann.md +++ b/reference/cmath/sph_neumann.md @@ -100,7 +100,7 @@ sph_neumann(2, 0.5 pi) = -1.21585 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 7.1.0 +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cmath/sqrt.md b/reference/cmath/sqrt.md index 0b7fe0c501..f837ec613f 100644 --- a/reference/cmath/sqrt.md +++ b/reference/cmath/sqrt.md @@ -102,10 +102,10 @@ sqrt(-1.0) = -nan - C++03 ### 処理系 -- [Clang](/implementation.md#clang): 1.9, 2.9, 3.1 -- [GCC](/implementation.md#gcc): 3.4.6, 4.2.4, 4.3.5, 4.4.5, 4.5.1, 4.5.2, 4.6.1, 4.7.0 -- [ICC](/implementation.md#icc): 10.1, 11.0, 11.1, 12.0 -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 +- [Clang](/implementation.md#clang): 1.9 [mark verified], 2.9 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 3.4.6 [mark verified], 4.2.4 [mark verified], 4.3.5 [mark verified], 4.4.5 [mark verified], 4.5.1 [mark verified], 4.5.2 [mark verified], 4.6.1 [mark verified], 4.7.0 [mark verified] +- [ICC](/implementation.md#icc): 10.1 [mark verified], 11.0 [mark verified], 11.1 [mark verified], 12.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified] #### 備考 特定の環境では、早期に `constexpr` 対応されている場合がある: diff --git a/reference/cmath/tan.md b/reference/cmath/tan.md index 657ad185f2..d72996df4e 100644 --- a/reference/cmath/tan.md +++ b/reference/cmath/tan.md @@ -89,10 +89,10 @@ tan(pi/2) = 16331239353195370.000000 - C++03 ### 処理系 -- [Clang](/implementation.md#clang): 1.9, 2.9, 3.1 -- [GCC](/implementation.md#gcc): 3.4.6, 4.2.4, 4.3.5, 4.4.5, 4.5.1, 4.5.2, 4.6.1, 4.7.0 -- [ICC](/implementation.md#icc): 10.1, 11.0, 11.1, 12.0 -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 +- [Clang](/implementation.md#clang): 1.9 [mark verified], 2.9 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 3.4.6 [mark verified], 4.2.4 [mark verified], 4.3.5 [mark verified], 4.4.5 [mark verified], 4.5.1 [mark verified], 4.5.2 [mark verified], 4.6.1 [mark verified], 4.7.0 [mark verified] +- [ICC](/implementation.md#icc): 10.1 [mark verified], 11.0 [mark verified], 11.1 [mark verified], 12.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified] #### 備考 特定の環境では、早期に `constexpr` 対応されている場合がある: diff --git a/reference/cmath/tanh.md b/reference/cmath/tanh.md index 3c618ea0b7..4e05c79e8b 100644 --- a/reference/cmath/tanh.md +++ b/reference/cmath/tanh.md @@ -84,10 +84,10 @@ tanh(1.0) = 0.761594 - C++03 ### 処理系 -- [Clang](/implementation.md#clang): 1.9, 2.9, 3.1 -- [GCC](/implementation.md#gcc): 3.4.6, 4.2.4, 4.3.5, 4.4.5, 4.5.1, 4.5.2, 4.6.1, 4.7.0 -- [ICC](/implementation.md#icc): 10.1, 11.0, 11.1, 12.0 -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010 +- [Clang](/implementation.md#clang): 1.9 [mark verified], 2.9 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 3.4.6 [mark verified], 4.2.4 [mark verified], 4.3.5 [mark verified], 4.4.5 [mark verified], 4.5.1 [mark verified], 4.5.2 [mark verified], 4.6.1 [mark verified], 4.7.0 [mark verified] +- [ICC](/implementation.md#icc): 10.1 [mark verified], 11.0 [mark verified], 11.1 [mark verified], 12.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified] #### 備考 特定の環境では、早期に `constexpr` 対応されている場合がある: diff --git a/reference/cmath/tgamma.md b/reference/cmath/tgamma.md index f50e846682..4f3e397eb7 100644 --- a/reference/cmath/tgamma.md +++ b/reference/cmath/tgamma.md @@ -100,8 +100,8 @@ tgamma(+∞) = inf - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/codecvt/codecvt_mode.md b/reference/codecvt/codecvt_mode.md index 241143f534..ad9fca2b75 100644 --- a/reference/codecvt/codecvt_mode.md +++ b/reference/codecvt/codecvt_mode.md @@ -47,10 +47,10 @@ Unicode以外のShift_JISやBig5といった文字コードの利用が急激に - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 5.1 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 5.1 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 - [P0618R0 Deprecating ``](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0618r0.html) diff --git a/reference/codecvt/codecvt_utf16.md b/reference/codecvt/codecvt_utf16.md index 0ee5fa8be0..7af7ffb713 100644 --- a/reference/codecvt/codecvt_utf16.md +++ b/reference/codecvt/codecvt_utf16.md @@ -85,10 +85,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 5.1 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 5.1 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 - [N2401 Code Conversion Facets for the Standard C++ Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2401.htm) diff --git a/reference/codecvt/codecvt_utf8.md b/reference/codecvt/codecvt_utf8.md index 0f6edc1df3..fc29491f38 100644 --- a/reference/codecvt/codecvt_utf8.md +++ b/reference/codecvt/codecvt_utf8.md @@ -85,10 +85,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 5.1 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 5.1 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 - [N2401 Code Conversion Facets for the Standard C++ Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2401.htm) diff --git a/reference/codecvt/codecvt_utf8_utf16.md b/reference/codecvt/codecvt_utf8_utf16.md index 4095d4a892..ed3c5387f7 100644 --- a/reference/codecvt/codecvt_utf8_utf16.md +++ b/reference/codecvt/codecvt_utf8_utf16.md @@ -85,10 +85,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 5.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 5.3 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 - [N2401 Code Conversion Facets for the Standard C++ Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2401.htm) diff --git a/reference/compare.md b/reference/compare.md index e93d69dd3e..57292b4402 100644 --- a/reference/compare.md +++ b/reference/compare.md @@ -72,9 +72,9 @@ - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 [mark verified] ## 関連項目 diff --git a/reference/compare/common_comparison_category.md b/reference/compare/common_comparison_category.md index 1dc35ac910..d1abfc4b8f 100644 --- a/reference/compare/common_comparison_category.md +++ b/reference/compare/common_comparison_category.md @@ -101,9 +101,9 @@ false - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 [mark verified] ## 関連項目 diff --git a/reference/compare/compare_partial_order_fallback.md b/reference/compare/compare_partial_order_fallback.md index 8d111ac789..755da7e830 100644 --- a/reference/compare/compare_partial_order_fallback.md +++ b/reference/compare/compare_partial_order_fallback.md @@ -139,7 +139,7 @@ false ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? ## 関連項目 diff --git a/reference/compare/compare_strong_order_fallback.md b/reference/compare/compare_strong_order_fallback.md index 29fcadee39..5122e7c610 100644 --- a/reference/compare/compare_strong_order_fallback.md +++ b/reference/compare/compare_strong_order_fallback.md @@ -112,7 +112,7 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? ## 関連項目 diff --git a/reference/compare/compare_three_way.md b/reference/compare/compare_three_way.md index 86714890e6..e7aad93ba3 100644 --- a/reference/compare/compare_three_way.md +++ b/reference/compare/compare_three_way.md @@ -44,7 +44,7 @@ struct compare_three_way { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? ## 関連項目 diff --git a/reference/compare/compare_three_way/op_call.md b/reference/compare/compare_three_way/op_call.md index 8df83ccb38..40dd7dd009 100644 --- a/reference/compare/compare_three_way/op_call.md +++ b/reference/compare/compare_three_way/op_call.md @@ -89,7 +89,7 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? ## 関連項目 diff --git a/reference/compare/compare_three_way_result.md b/reference/compare/compare_three_way_result.md index 1706db2fd2..386152ebdb 100644 --- a/reference/compare/compare_three_way_result.md +++ b/reference/compare/compare_three_way_result.md @@ -116,7 +116,7 @@ struct compare_three_way_result { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? ## 関連項目 diff --git a/reference/compare/compare_weak_order_fallback.md b/reference/compare/compare_weak_order_fallback.md index 9f8acf2993..c334ce6117 100644 --- a/reference/compare/compare_weak_order_fallback.md +++ b/reference/compare/compare_weak_order_fallback.md @@ -137,7 +137,7 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? ## 関連項目 diff --git a/reference/compare/named_comparison_functions.md b/reference/compare/named_comparison_functions.md index 54e6b8f08d..2778541fdd 100644 --- a/reference/compare/named_comparison_functions.md +++ b/reference/compare/named_comparison_functions.md @@ -116,9 +116,9 @@ constexpr bool is_gteq(partial_ordering cmp) noexcept { return cmp >= 0; } - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 [mark verified] ## 関連項目 diff --git a/reference/compare/partial_order.md b/reference/compare/partial_order.md index 283d853892..e8cbbe5dff 100644 --- a/reference/compare/partial_order.md +++ b/reference/compare/partial_order.md @@ -155,7 +155,7 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? ## 関連項目 diff --git a/reference/compare/partial_ordering.md b/reference/compare/partial_ordering.md index 416faaa2c6..5c97feb24a 100644 --- a/reference/compare/partial_ordering.md +++ b/reference/compare/partial_ordering.md @@ -144,9 +144,9 @@ true - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 [mark verified] ## 関連項目 diff --git a/reference/compare/partial_ordering/op_compare_3way.md b/reference/compare/partial_ordering/op_compare_3way.md index 172a8ec83d..a8a4d78c3d 100644 --- a/reference/compare/partial_ordering/op_compare_3way.md +++ b/reference/compare/partial_ordering/op_compare_3way.md @@ -92,8 +92,8 @@ false ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 [mark verified] ## 関連項目 diff --git a/reference/compare/partial_ordering/op_equal.md b/reference/compare/partial_ordering/op_equal.md index 5bb4b40222..d754a9b6ce 100644 --- a/reference/compare/partial_ordering/op_equal.md +++ b/reference/compare/partial_ordering/op_equal.md @@ -87,9 +87,9 @@ false - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0(1が未実装) -- [GCC](/implementation.md#gcc): 10.1(full support) -- [Visual C++](/implementation.md#visual_cpp): 2019(1が未実装) +- [Clang](/implementation.md#clang): 8.0(1が未実装) [mark verified] +- [GCC](/implementation.md#gcc): 10.1(full support) [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019(1が未実装) [mark verified] ## 関連項目 diff --git a/reference/compare/partial_ordering/op_greater.md b/reference/compare/partial_ordering/op_greater.md index 2d8c973407..d00a679b22 100644 --- a/reference/compare/partial_ordering/op_greater.md +++ b/reference/compare/partial_ordering/op_greater.md @@ -80,9 +80,9 @@ false - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 [mark verified] ## 関連項目 diff --git a/reference/compare/partial_ordering/op_greater_equal.md b/reference/compare/partial_ordering/op_greater_equal.md index 27b0a7e7d6..211fb6afba 100644 --- a/reference/compare/partial_ordering/op_greater_equal.md +++ b/reference/compare/partial_ordering/op_greater_equal.md @@ -79,9 +79,9 @@ false - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 [mark verified] ## 関連項目 diff --git a/reference/compare/partial_ordering/op_less.md b/reference/compare/partial_ordering/op_less.md index 70834cb571..3f5e6405cb 100644 --- a/reference/compare/partial_ordering/op_less.md +++ b/reference/compare/partial_ordering/op_less.md @@ -80,9 +80,9 @@ false - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 [mark verified] ## 関連項目 diff --git a/reference/compare/partial_ordering/op_less_equal.md b/reference/compare/partial_ordering/op_less_equal.md index 93eb9e70cc..b8f20372e7 100644 --- a/reference/compare/partial_ordering/op_less_equal.md +++ b/reference/compare/partial_ordering/op_less_equal.md @@ -80,9 +80,9 @@ false - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 [mark verified] ## 関連項目 diff --git a/reference/compare/partial_ordering/op_not_equal.md b/reference/compare/partial_ordering/op_not_equal.md index 21c4d7a9e4..0a941229ef 100644 --- a/reference/compare/partial_ordering/op_not_equal.md +++ b/reference/compare/partial_ordering/op_not_equal.md @@ -83,9 +83,9 @@ true - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0(1が未実装) -- [GCC](/implementation.md#gcc): 10.1(full support) -- [Visual C++](/implementation.md#visual_cpp): 2019(1が未実装) +- [Clang](/implementation.md#clang): 8.0(1が未実装) [mark verified] +- [GCC](/implementation.md#gcc): 10.1(full support) [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019(1が未実装) [mark verified] ## 関連項目 diff --git a/reference/compare/strong_order.md b/reference/compare/strong_order.md index 8124707eb5..64de26fdb4 100644 --- a/reference/compare/strong_order.md +++ b/reference/compare/strong_order.md @@ -165,7 +165,7 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1(浮動小数点数の比較が未実装) +- [GCC](/implementation.md#gcc): 10.1(浮動小数点数の比較が未実装) [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? ## 関連項目 diff --git a/reference/compare/strong_ordering.md b/reference/compare/strong_ordering.md index fa5e7bef1d..97723685ce 100644 --- a/reference/compare/strong_ordering.md +++ b/reference/compare/strong_ordering.md @@ -119,9 +119,9 @@ true - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 [mark verified] ## 関連項目 diff --git a/reference/compare/strong_ordering/op_compare_3way.md b/reference/compare/strong_ordering/op_compare_3way.md index 0b91574f07..d97f1fdcc4 100644 --- a/reference/compare/strong_ordering/op_compare_3way.md +++ b/reference/compare/strong_ordering/op_compare_3way.md @@ -74,8 +74,8 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 [mark verified] ## 関連項目 diff --git a/reference/compare/strong_ordering/op_equal.md b/reference/compare/strong_ordering/op_equal.md index c5aca4b3bb..4db040e5a0 100644 --- a/reference/compare/strong_ordering/op_equal.md +++ b/reference/compare/strong_ordering/op_equal.md @@ -75,9 +75,9 @@ true - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0(1が未実装) -- [GCC](/implementation.md#gcc): 10.1(full support) -- [Visual C++](/implementation.md#visual_cpp): 2019(1が未実装) +- [Clang](/implementation.md#clang): 8.0(1が未実装) [mark verified] +- [GCC](/implementation.md#gcc): 10.1(full support) [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019(1が未実装) [mark verified] ## 関連項目 diff --git a/reference/compare/strong_ordering/op_greater.md b/reference/compare/strong_ordering/op_greater.md index 610e4860ec..7b0f2d556f 100644 --- a/reference/compare/strong_ordering/op_greater.md +++ b/reference/compare/strong_ordering/op_greater.md @@ -66,9 +66,9 @@ false - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 [mark verified] ## 関連項目 diff --git a/reference/compare/strong_ordering/op_greater_equal.md b/reference/compare/strong_ordering/op_greater_equal.md index 3adb2d96fa..739cac9d48 100644 --- a/reference/compare/strong_ordering/op_greater_equal.md +++ b/reference/compare/strong_ordering/op_greater_equal.md @@ -66,9 +66,9 @@ true - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 [mark verified] ## 関連項目 diff --git a/reference/compare/strong_ordering/op_less.md b/reference/compare/strong_ordering/op_less.md index 3dc0a745e3..c7284f17fc 100644 --- a/reference/compare/strong_ordering/op_less.md +++ b/reference/compare/strong_ordering/op_less.md @@ -66,9 +66,9 @@ false - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 [mark verified] ## 関連項目 diff --git a/reference/compare/strong_ordering/op_less_equal.md b/reference/compare/strong_ordering/op_less_equal.md index 79b5b26896..412e91cf4c 100644 --- a/reference/compare/strong_ordering/op_less_equal.md +++ b/reference/compare/strong_ordering/op_less_equal.md @@ -66,9 +66,9 @@ true - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 [mark verified] ## 関連項目 diff --git a/reference/compare/strong_ordering/op_not_equal.md b/reference/compare/strong_ordering/op_not_equal.md index 5723b17e83..7fdd3d911d 100644 --- a/reference/compare/strong_ordering/op_not_equal.md +++ b/reference/compare/strong_ordering/op_not_equal.md @@ -71,9 +71,9 @@ false - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0(1が未実装) -- [GCC](/implementation.md#gcc): 10.1(full support) -- [Visual C++](/implementation.md#visual_cpp): 2019(1が未実装) +- [Clang](/implementation.md#clang): 8.0(1が未実装) [mark verified] +- [GCC](/implementation.md#gcc): 10.1(full support) [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019(1が未実装) [mark verified] ## 関連項目 diff --git a/reference/compare/strong_ordering/op_partial_ordering.md b/reference/compare/strong_ordering/op_partial_ordering.md index 720044b92d..058a267974 100644 --- a/reference/compare/strong_ordering/op_partial_ordering.md +++ b/reference/compare/strong_ordering/op_partial_ordering.md @@ -63,9 +63,9 @@ false - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 [mark verified] ## 参照 diff --git a/reference/compare/strong_ordering/op_weak_ordering.md b/reference/compare/strong_ordering/op_weak_ordering.md index 188d186f89..ab9d56fee4 100644 --- a/reference/compare/strong_ordering/op_weak_ordering.md +++ b/reference/compare/strong_ordering/op_weak_ordering.md @@ -63,9 +63,9 @@ false - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 [mark verified] ## 参照 diff --git a/reference/compare/three_way_comparable.md b/reference/compare/three_way_comparable.md index 0626c244d0..d16b280be3 100644 --- a/reference/compare/three_way_comparable.md +++ b/reference/compare/three_way_comparable.md @@ -256,7 +256,7 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? ## 関連項目 diff --git a/reference/compare/weak_order.md b/reference/compare/weak_order.md index 6a49ba1f9a..7e6069b1ea 100644 --- a/reference/compare/weak_order.md +++ b/reference/compare/weak_order.md @@ -177,7 +177,7 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? ## 関連項目 diff --git a/reference/compare/weak_ordering.md b/reference/compare/weak_ordering.md index 12b1ed4527..da308443b7 100644 --- a/reference/compare/weak_ordering.md +++ b/reference/compare/weak_ordering.md @@ -154,9 +154,9 @@ true - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 [mark verified] ## 関連項目 diff --git a/reference/compare/weak_ordering/op_compare_3way.md b/reference/compare/weak_ordering/op_compare_3way.md index 3ec8427007..8f6ff7211a 100644 --- a/reference/compare/weak_ordering/op_compare_3way.md +++ b/reference/compare/weak_ordering/op_compare_3way.md @@ -74,8 +74,8 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 [mark verified] ## 関連項目 diff --git a/reference/compare/weak_ordering/op_equal.md b/reference/compare/weak_ordering/op_equal.md index d7cbb36e10..60ea498bba 100644 --- a/reference/compare/weak_ordering/op_equal.md +++ b/reference/compare/weak_ordering/op_equal.md @@ -75,9 +75,9 @@ true - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0(1が未実装) -- [GCC](/implementation.md#gcc): 10.1(full support) -- [Visual C++](/implementation.md#visual_cpp): 2019(1が未実装) +- [Clang](/implementation.md#clang): 8.0(1が未実装) [mark verified] +- [GCC](/implementation.md#gcc): 10.1(full support) [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019(1が未実装) [mark verified] ## 関連項目 diff --git a/reference/compare/weak_ordering/op_greater.md b/reference/compare/weak_ordering/op_greater.md index 038d8de21c..2c847feaf5 100644 --- a/reference/compare/weak_ordering/op_greater.md +++ b/reference/compare/weak_ordering/op_greater.md @@ -66,9 +66,9 @@ false - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 [mark verified] ## 関連項目 diff --git a/reference/compare/weak_ordering/op_greater_equal.md b/reference/compare/weak_ordering/op_greater_equal.md index 2e4c521332..3780b9f210 100644 --- a/reference/compare/weak_ordering/op_greater_equal.md +++ b/reference/compare/weak_ordering/op_greater_equal.md @@ -66,9 +66,9 @@ true - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 [mark verified] ## 関連項目 diff --git a/reference/compare/weak_ordering/op_less.md b/reference/compare/weak_ordering/op_less.md index 4b2ef8131f..6ea35588ca 100644 --- a/reference/compare/weak_ordering/op_less.md +++ b/reference/compare/weak_ordering/op_less.md @@ -66,9 +66,9 @@ false - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 [mark verified] ## 関連項目 diff --git a/reference/compare/weak_ordering/op_less_equal.md b/reference/compare/weak_ordering/op_less_equal.md index d71c57b88c..814de49488 100644 --- a/reference/compare/weak_ordering/op_less_equal.md +++ b/reference/compare/weak_ordering/op_less_equal.md @@ -66,9 +66,9 @@ true - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 [mark verified] ## 関連項目 diff --git a/reference/compare/weak_ordering/op_not_equal.md b/reference/compare/weak_ordering/op_not_equal.md index 5f3b1eb179..b13ea01d0d 100644 --- a/reference/compare/weak_ordering/op_not_equal.md +++ b/reference/compare/weak_ordering/op_not_equal.md @@ -71,9 +71,9 @@ false - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0(1が未実装) -- [GCC](/implementation.md#gcc): 10.1(full support) -- [Visual C++](/implementation.md#visual_cpp): 2019(1が未実装) +- [Clang](/implementation.md#clang): 8.0(1が未実装) [mark verified] +- [GCC](/implementation.md#gcc): 10.1(full support) [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019(1が未実装) [mark verified] ## 関連項目 diff --git a/reference/compare/weak_ordering/op_partial_ordering.md b/reference/compare/weak_ordering/op_partial_ordering.md index 8cf568167a..8807cea4ad 100644 --- a/reference/compare/weak_ordering/op_partial_ordering.md +++ b/reference/compare/weak_ordering/op_partial_ordering.md @@ -63,9 +63,9 @@ false - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 [mark verified] ## 参照 diff --git a/reference/complex/complex/abs.md b/reference/complex/complex/abs.md index d49ea11fba..ca5c58020f 100644 --- a/reference/complex/complex/abs.md +++ b/reference/complex/complex/abs.md @@ -75,8 +75,8 @@ abs( (1,2) ) = 2.23607 - C++98 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/complex/complex/acos.md b/reference/complex/complex/acos.md index cce0c2b23a..f8fecc107f 100644 --- a/reference/complex/complex/acos.md +++ b/reference/complex/complex/acos.md @@ -83,10 +83,10 @@ acos( (1,2) ) = (1.14372,-1.52857) - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ### 備考 - libstdc++ では(規格通りに)C++11 以降のモードでなければ本関数は使用できないが、libc++ では C++98 モードでも使用することができる。(上記の [Clang](/implementation.md#clang) が C++11 モードになっていないのはそのため) diff --git a/reference/complex/complex/acosh.md b/reference/complex/complex/acosh.md index 4d21c8906d..f66ea35fef 100644 --- a/reference/complex/complex/acosh.md +++ b/reference/complex/complex/acosh.md @@ -81,10 +81,10 @@ acosh( (1,2) ) = (1.52857,1.14372) - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ### 備考 - libstdc++ では(規格通りに)C++11 以降のモードでなければ本関数は使用できないが、libc++ では C++98 モードでも使用することができる。(上記の [Clang](/implementation.md#clang) が C++11 モードになっていないのはそのため) diff --git a/reference/complex/complex/arg.md b/reference/complex/complex/arg.md index 1dc6749ff6..7a52d63920 100644 --- a/reference/complex/complex/arg.md +++ b/reference/complex/complex/arg.md @@ -73,9 +73,9 @@ arg( (1,2) ) = 1.10715 - C++98(追加のオーバーロードは C++11 から) ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4(追加のオーバーロード含む) -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0(追加のオーバーロード以外) -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0(追加のオーバーロード含む) +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4(追加のオーバーロード含む) [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0(追加のオーバーロード以外) [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0(追加のオーバーロード含む) [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/complex/complex/asin.md b/reference/complex/complex/asin.md index bb9144bf87..7d28e86d1f 100644 --- a/reference/complex/complex/asin.md +++ b/reference/complex/complex/asin.md @@ -65,10 +65,10 @@ asin( (1,2) ) = (0.427079,1.52857) - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ### 備考 - libstdc++ では(規格通りに)C++11 以降のモードでなければ本関数は使用できないが、libc++ では C++98 モードでも使用することができる。(上記の [Clang](/implementation.md#clang) が C++11 モードになっていないのはそのため) diff --git a/reference/complex/complex/asinh.md b/reference/complex/complex/asinh.md index 573d5735c4..f5d4770282 100644 --- a/reference/complex/complex/asinh.md +++ b/reference/complex/complex/asinh.md @@ -80,10 +80,10 @@ asinh( (1,2) ) = (1.46935,1.06344) - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ### 備考 - libstdc++ では(規格通りに)C++11 以降のモードでなければ本関数は使用できないが、libc++ では C++98 モードでも使用することができる。(上記の [Clang](/implementation.md#clang) が C++11 モードになっていないのはそのため) diff --git a/reference/complex/complex/atan.md b/reference/complex/complex/atan.md index 5ef964f86a..8b5fa2984d 100644 --- a/reference/complex/complex/atan.md +++ b/reference/complex/complex/atan.md @@ -65,10 +65,10 @@ atan( (1,2) ) = (1.33897,0.402359) - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ### 備考 - libstdc++ では(規格通りに)C++11 以降のモードでなければ本関数は使用できないが、libc++ では C++98 モードでも使用することができる。(上記の [Clang](/implementation.md#clang) が C++11 モードになっていないのはそのため) diff --git a/reference/complex/complex/atanh.md b/reference/complex/complex/atanh.md index 647d3a854b..04b6397627 100644 --- a/reference/complex/complex/atanh.md +++ b/reference/complex/complex/atanh.md @@ -81,10 +81,10 @@ atanh( (1,2) ) = (0.173287,1.1781) - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ### 備考 - libstdc++ では(規格通りに)C++11 以降のモードでなければ本関数は使用できないが、libc++ では C++98 モードでも使用することができる。(上記の [Clang](/implementation.md#clang) が C++11 モードになっていないのはそのため) diff --git a/reference/complex/complex/conj.md b/reference/complex/complex/conj.md index ef7443fa5c..4127b4372e 100644 --- a/reference/complex/complex/conj.md +++ b/reference/complex/complex/conj.md @@ -65,9 +65,9 @@ conj( (1,2) ) = (1,-2) - C++98(追加のオーバーロードは C++11 から) ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4(追加のオーバーロード含む) -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0(追加のオーバーロード以外) -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0(追加のオーバーロード含む) +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4(追加のオーバーロード含む) [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0(追加のオーバーロード以外) [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0(追加のオーバーロード含む) [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/complex/complex/cos.md b/reference/complex/complex/cos.md index 23e94c54e7..fc185cdb7f 100644 --- a/reference/complex/complex/cos.md +++ b/reference/complex/complex/cos.md @@ -63,8 +63,8 @@ cos( (1,2) ) = (2.03272,-3.0519) - C++98 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/complex/complex/cosh.md b/reference/complex/complex/cosh.md index 7c5a5b3c8b..bc7d126771 100644 --- a/reference/complex/complex/cosh.md +++ b/reference/complex/complex/cosh.md @@ -76,8 +76,8 @@ cosh( (1,2) ) = (-0.642148,1.06861) - C++98 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/complex/complex/exp.md b/reference/complex/complex/exp.md index e41786c5bb..dd3121d55f 100644 --- a/reference/complex/complex/exp.md +++ b/reference/complex/complex/exp.md @@ -77,8 +77,8 @@ exp( (1,2) ) = (-1.1312,2.47173) - C++98 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/complex/complex/imag_free.md b/reference/complex/complex/imag_free.md index 486c8f8f72..a72b9fa823 100644 --- a/reference/complex/complex/imag_free.md +++ b/reference/complex/complex/imag_free.md @@ -68,9 +68,9 @@ int main() - C++98(追加のオーバーロードは C++11 から) ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4(追加のオーバーロード含む) -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0(追加のオーバーロード以外) -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0(追加のオーバーロード含む) +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4(追加のオーバーロード含む) [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0(追加のオーバーロード以外) [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0(追加のオーバーロード含む) [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/complex/complex/log.md b/reference/complex/complex/log.md index d8ae510873..be10de5083 100644 --- a/reference/complex/complex/log.md +++ b/reference/complex/complex/log.md @@ -80,8 +80,8 @@ log( (1,2) ) = (0.804719,1.10715) - C++98 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/complex/complex/log10.md b/reference/complex/complex/log10.md index 97c43987fb..f6c276856e 100644 --- a/reference/complex/complex/log10.md +++ b/reference/complex/complex/log10.md @@ -62,8 +62,8 @@ log10( (1,2) ) = (0.349485,0.480829) - C++98 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/complex/complex/norm.md b/reference/complex/complex/norm.md index 244cb4675a..dae06644db 100644 --- a/reference/complex/complex/norm.md +++ b/reference/complex/complex/norm.md @@ -70,9 +70,9 @@ norm( (1,2) ) = 5 - C++98(追加のオーバーロードは C++11 から) ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4(追加のオーバーロード含む) -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0(追加のオーバーロード以外) -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0(追加のオーバーロード含む) +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4(追加のオーバーロード含む) [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0(追加のオーバーロード以外) [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0(追加のオーバーロード含む) [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/complex/complex/op_i.md b/reference/complex/complex/op_i.md index cc4da8f727..5f61a960b7 100644 --- a/reference/complex/complex/op_i.md +++ b/reference/complex/complex/op_i.md @@ -53,8 +53,8 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.4 -- [GCC](/implementation.md#gcc): 4.9.0 +- [Clang](/implementation.md#clang): 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/complex/complex/op_if.md b/reference/complex/complex/op_if.md index 48704ab86a..31590b47d1 100644 --- a/reference/complex/complex/op_if.md +++ b/reference/complex/complex/op_if.md @@ -53,8 +53,8 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.4 -- [GCC](/implementation.md#gcc): 4.9.0 +- [Clang](/implementation.md#clang): 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/complex/complex/op_il.md b/reference/complex/complex/op_il.md index 7d531dc903..cb2d72b97e 100644 --- a/reference/complex/complex/op_il.md +++ b/reference/complex/complex/op_il.md @@ -53,8 +53,8 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.4 -- [GCC](/implementation.md#gcc): 4.9.0 +- [Clang](/implementation.md#clang): 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/complex/complex/polar.md b/reference/complex/complex/polar.md index 7d9f91bbab..8fdcfc9bcd 100644 --- a/reference/complex/complex/polar.md +++ b/reference/complex/complex/polar.md @@ -60,8 +60,8 @@ polar(1.0, pi / 4.0) = (0.707107,0.707107) - C++98 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/complex/complex/pow.md b/reference/complex/complex/pow.md index b5352ff2bf..8135bf4e0c 100644 --- a/reference/complex/complex/pow.md +++ b/reference/complex/complex/pow.md @@ -112,9 +112,9 @@ pow( (1,2), (3,4) ) = (0.12901,0.0339241) - C++98 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4(追加のオーバーロード含む) -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0(追加のオーバーロード以外) -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0(追加のオーバーロード含む) +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4(追加のオーバーロード含む) [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0(追加のオーバーロード以外) [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0(追加のオーバーロード含む) [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/complex/complex/proj.md b/reference/complex/complex/proj.md index e395b6bc1d..b310bd3a5c 100644 --- a/reference/complex/complex/proj.md +++ b/reference/complex/complex/proj.md @@ -99,10 +99,10 @@ proj( (nan,-inf) ) = (inf,-0) - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ### 備考 - libstdc++ では(規格通りに)C++11 以降のモードでなければ本関数は使用できないが、libc++ では C++98 モードでも使用することができる。(上記の [Clang](/implementation.md#clang) が C++11 モードになっていないのはそのため) diff --git a/reference/complex/complex/real_free.md b/reference/complex/complex/real_free.md index 24508361a0..9c65a3d9e8 100644 --- a/reference/complex/complex/real_free.md +++ b/reference/complex/complex/real_free.md @@ -70,9 +70,9 @@ int main() - C++98(追加のオーバーロードは C++11 から) ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4(追加のオーバーロード含む) -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0(追加のオーバーロード以外) -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0(追加のオーバーロード含む) +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4(追加のオーバーロード含む) [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0(追加のオーバーロード以外) [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0(追加のオーバーロード含む) [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/complex/complex/sin.md b/reference/complex/complex/sin.md index f33626e480..5162b0368b 100644 --- a/reference/complex/complex/sin.md +++ b/reference/complex/complex/sin.md @@ -63,8 +63,8 @@ sin( (1,2) ) = (3.16578,1.9596) - C++98 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/complex/complex/sinh.md b/reference/complex/complex/sinh.md index 180e77b34b..89d797f1b0 100644 --- a/reference/complex/complex/sinh.md +++ b/reference/complex/complex/sinh.md @@ -76,8 +76,8 @@ sinh( (1,2) ) = (-0.489056,1.40312) - C++98 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/complex/complex/sqrt.md b/reference/complex/complex/sqrt.md index f1e1034dfc..b55fdd50bc 100644 --- a/reference/complex/complex/sqrt.md +++ b/reference/complex/complex/sqrt.md @@ -99,8 +99,8 @@ sqrt(-1.0 - 1.0i) = (0.45509,-1.09868) - C++98 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/complex/complex/tan.md b/reference/complex/complex/tan.md index bc3a34bd24..614690cddd 100644 --- a/reference/complex/complex/tan.md +++ b/reference/complex/complex/tan.md @@ -63,8 +63,8 @@ tan( (1,2) ) = (0.0338128,1.01479) - C++98 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/complex/complex/tanh.md b/reference/complex/complex/tanh.md index ee06c23dd6..f3697a90c5 100644 --- a/reference/complex/complex/tanh.md +++ b/reference/complex/complex/tanh.md @@ -73,8 +73,8 @@ tanh( (1,2) ) = (1.16674,-0.243458) - C++98 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/concepts/assignable_from.md b/reference/concepts/assignable_from.md index 950aa72333..33ed68acef 100644 --- a/reference/concepts/assignable_from.md +++ b/reference/concepts/assignable_from.md @@ -101,8 +101,8 @@ S& is not assignable from S ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark verified] ## 関連項目 diff --git a/reference/concepts/common_reference_with.md b/reference/concepts/common_reference_with.md index ed23d35e35..a601ac68f0 100644 --- a/reference/concepts/common_reference_with.md +++ b/reference/concepts/common_reference_with.md @@ -83,8 +83,8 @@ T, U share a common reference type ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark verified] ## 関連項目 diff --git a/reference/concepts/common_with.md b/reference/concepts/common_with.md index 83ab9c767b..2fa4efb7de 100644 --- a/reference/concepts/common_with.md +++ b/reference/concepts/common_with.md @@ -89,8 +89,8 @@ T, U share a common type ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark verified] ## 関連項目 diff --git a/reference/concepts/constructible_from.md b/reference/concepts/constructible_from.md index ea9434932d..a44d12d06e 100644 --- a/reference/concepts/constructible_from.md +++ b/reference/concepts/constructible_from.md @@ -74,8 +74,8 @@ std::span is not constructible from std::array ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark verified] ## 関連項目 diff --git a/reference/concepts/convertible_to.md b/reference/concepts/convertible_to.md index cd446206b5..6c641be9a4 100644 --- a/reference/concepts/convertible_to.md +++ b/reference/concepts/convertible_to.md @@ -128,8 +128,8 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark verified] ## 関連項目 diff --git a/reference/concepts/copy_constructible.md b/reference/concepts/copy_constructible.md index a30d3c2f4a..1c7268d421 100644 --- a/reference/concepts/copy_constructible.md +++ b/reference/concepts/copy_constructible.md @@ -83,8 +83,8 @@ C is copy constructible ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark verified] ## 関連項目 diff --git a/reference/concepts/copyable.md b/reference/concepts/copyable.md index ba78b8f155..efb5d4c63b 100644 --- a/reference/concepts/copyable.md +++ b/reference/concepts/copyable.md @@ -93,8 +93,8 @@ not_copyable2 is not copyable ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark verified] ## 関連項目 diff --git a/reference/concepts/default_initializable.md b/reference/concepts/default_initializable.md index f71e8f9a6f..9cf1c7f6d9 100644 --- a/reference/concepts/default_initializable.md +++ b/reference/concepts/default_initializable.md @@ -79,8 +79,8 @@ S is not default initializable ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark verified] ## 関連項目 diff --git a/reference/concepts/derived_from.md b/reference/concepts/derived_from.md index eadff76d8a..869a70edd1 100644 --- a/reference/concepts/derived_from.md +++ b/reference/concepts/derived_from.md @@ -96,8 +96,8 @@ U is base class of T ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark verified] ## 関連項目 diff --git a/reference/concepts/destructible.md b/reference/concepts/destructible.md index 3d17350b22..8ade811f2f 100644 --- a/reference/concepts/destructible.md +++ b/reference/concepts/destructible.md @@ -72,8 +72,8 @@ void is not destructible ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark verified] ## 関連項目 diff --git a/reference/concepts/equality_comparable.md b/reference/concepts/equality_comparable.md index 86ea1439fb..2a2f6f59ed 100644 --- a/reference/concepts/equality_comparable.md +++ b/reference/concepts/equality_comparable.md @@ -240,8 +240,8 @@ S2 is not equality comparable with int ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark verified] ## 関連項目 diff --git a/reference/concepts/equivalence_relation.md b/reference/concepts/equivalence_relation.md index 4385a32e1b..3944513209 100644 --- a/reference/concepts/equivalence_relation.md +++ b/reference/concepts/equivalence_relation.md @@ -84,8 +84,8 @@ equivalence_relation_s1s2 is equivalence relation between S2 and S1 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark verified] ## 関連項目 diff --git a/reference/concepts/floating_point.md b/reference/concepts/floating_point.md index ad97a1b8c4..137db73aa6 100644 --- a/reference/concepts/floating_point.md +++ b/reference/concepts/floating_point.md @@ -72,8 +72,8 @@ double& is not floating point ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 5 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 5 [mark verified] ## 関連項目 diff --git a/reference/concepts/integral.md b/reference/concepts/integral.md index a6d803d8f0..24464dbf30 100644 --- a/reference/concepts/integral.md +++ b/reference/concepts/integral.md @@ -70,8 +70,8 @@ std::integral_constant is not integral ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark verified] ## 関連項目 diff --git a/reference/concepts/invocable.md b/reference/concepts/invocable.md index a3dc2b4f91..6a98cf9cdd 100644 --- a/reference/concepts/invocable.md +++ b/reference/concepts/invocable.md @@ -179,8 +179,8 @@ not_invocable(int) is not regular_invocable ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark verified] ## 関連項目 diff --git a/reference/concepts/movable.md b/reference/concepts/movable.md index a27836457d..2227b92e1b 100644 --- a/reference/concepts/movable.md +++ b/reference/concepts/movable.md @@ -91,8 +91,8 @@ not_movable2 is not movable ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark verified] ## 関連項目 diff --git a/reference/concepts/move_constructible.md b/reference/concepts/move_constructible.md index 5700ce3739..b0a2ee4d98 100644 --- a/reference/concepts/move_constructible.md +++ b/reference/concepts/move_constructible.md @@ -74,8 +74,8 @@ M is move constructible ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark verified] ## 関連項目 diff --git a/reference/concepts/predicate.md b/reference/concepts/predicate.md index ff2c272b52..0ffe307729 100644 --- a/reference/concepts/predicate.md +++ b/reference/concepts/predicate.md @@ -89,8 +89,8 @@ not_predicate(int) is not predicate ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark verified] ## 関連項目 diff --git a/reference/concepts/regular.md b/reference/concepts/regular.md index 2b1515a3f2..32982b1d85 100644 --- a/reference/concepts/regular.md +++ b/reference/concepts/regular.md @@ -93,8 +93,8 @@ semiregular is not regular ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark verified] ## 関連項目 diff --git a/reference/concepts/relation.md b/reference/concepts/relation.md index 9bb2bb7291..ad191c3954 100644 --- a/reference/concepts/relation.md +++ b/reference/concepts/relation.md @@ -94,8 +94,8 @@ not_relation_s1s2 is not relation between S1 and S2 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark verified] ## 関連項目 diff --git a/reference/concepts/same_as.md b/reference/concepts/same_as.md index 55847fa4f9..bb7ce99bd8 100644 --- a/reference/concepts/same_as.md +++ b/reference/concepts/same_as.md @@ -77,8 +77,8 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark verified] ## 関連項目 diff --git a/reference/concepts/semiregular.md b/reference/concepts/semiregular.md index 3826ff0813..4a21ae050f 100644 --- a/reference/concepts/semiregular.md +++ b/reference/concepts/semiregular.md @@ -78,8 +78,8 @@ copyable is not semiregular ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark verified] ## 関連項目 diff --git a/reference/concepts/signed_integral.md b/reference/concepts/signed_integral.md index 32338f447f..a4397033e3 100644 --- a/reference/concepts/signed_integral.md +++ b/reference/concepts/signed_integral.md @@ -77,8 +77,8 @@ std::integral_constant is not signed_integral ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark verified] ## 関連項目 diff --git a/reference/concepts/strict_weak_order.md b/reference/concepts/strict_weak_order.md index 7b684ec67d..542693b741 100644 --- a/reference/concepts/strict_weak_order.md +++ b/reference/concepts/strict_weak_order.md @@ -84,8 +84,8 @@ strict_weak_order_s1s2 is strict weak order between S2 and S1 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark verified] ## 関連項目 diff --git a/reference/concepts/swap.md b/reference/concepts/swap.md index d89cebcc22..726018ae08 100644 --- a/reference/concepts/swap.md +++ b/reference/concepts/swap.md @@ -163,8 +163,8 @@ a = {0, 2, 4, 6, }, b = {1, 3, 5, 7, } ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark verified] ## 関連項目 diff --git a/reference/concepts/swappable.md b/reference/concepts/swappable.md index 45216dac3d..e17c553e4d 100644 --- a/reference/concepts/swappable.md +++ b/reference/concepts/swappable.md @@ -203,8 +203,8 @@ NS::S2 is not swappable with NS::S1 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark verified] ## 関連項目 diff --git a/reference/concepts/totally_ordered.md b/reference/concepts/totally_ordered.md index feaab818d0..7bed3af79c 100644 --- a/reference/concepts/totally_ordered.md +++ b/reference/concepts/totally_ordered.md @@ -211,8 +211,8 @@ S2 is not totally ordered with int ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark verified] ## 関連項目 diff --git a/reference/concepts/unsigned_integral.md b/reference/concepts/unsigned_integral.md index 803182214d..764d82bb3f 100644 --- a/reference/concepts/unsigned_integral.md +++ b/reference/concepts/unsigned_integral.md @@ -77,8 +77,8 @@ std::integral_constant is not unsigned_integral ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark verified] ## 関連項目 diff --git a/reference/condition_variable/condition_variable.md b/reference/condition_variable/condition_variable.md index c2905834fb..c16402a1fa 100644 --- a/reference/condition_variable/condition_variable.md +++ b/reference/condition_variable/condition_variable.md @@ -122,9 +122,9 @@ process data ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/condition_variable/condition_variable/native_handle.md b/reference/condition_variable/condition_variable/native_handle.md index 8c5301a2c9..da463b0497 100644 --- a/reference/condition_variable/condition_variable/native_handle.md +++ b/reference/condition_variable/condition_variable/native_handle.md @@ -51,9 +51,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/condition_variable/condition_variable/notify_all.md b/reference/condition_variable/condition_variable/notify_all.md index 0775898536..8cd8ef379a 100644 --- a/reference/condition_variable/condition_variable/notify_all.md +++ b/reference/condition_variable/condition_variable/notify_all.md @@ -98,9 +98,9 @@ process data ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/condition_variable/condition_variable/notify_all_at_thread_exit.md b/reference/condition_variable/condition_variable/notify_all_at_thread_exit.md index 4c7b939802..9f13e89fc7 100644 --- a/reference/condition_variable/condition_variable/notify_all_at_thread_exit.md +++ b/reference/condition_variable/condition_variable/notify_all_at_thread_exit.md @@ -118,10 +118,10 @@ data is ready: true - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 5.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 5.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/condition_variable/condition_variable/notify_one.md b/reference/condition_variable/condition_variable/notify_one.md index 00792f14d3..f59f2e8c24 100644 --- a/reference/condition_variable/condition_variable/notify_one.md +++ b/reference/condition_variable/condition_variable/notify_one.md @@ -95,9 +95,9 @@ process data ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/condition_variable/condition_variable/op_constructor.md b/reference/condition_variable/condition_variable/op_constructor.md index 4bb76f5138..98acafd486 100644 --- a/reference/condition_variable/condition_variable/op_constructor.md +++ b/reference/condition_variable/condition_variable/op_constructor.md @@ -41,9 +41,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] - 2012までは、delete宣言に対応していないため、代わりにprivateで宣言のみ行う手法で代用されている。 ## 参照 diff --git a/reference/condition_variable/condition_variable/op_destructor.md b/reference/condition_variable/condition_variable/op_destructor.md index 76055bf026..2ae9ee0b12 100644 --- a/reference/condition_variable/condition_variable/op_destructor.md +++ b/reference/condition_variable/condition_variable/op_destructor.md @@ -39,9 +39,9 @@ ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/condition_variable/condition_variable/wait.md b/reference/condition_variable/condition_variable/wait.md index 8467865482..939314c11d 100644 --- a/reference/condition_variable/condition_variable/wait.md +++ b/reference/condition_variable/condition_variable/wait.md @@ -157,9 +157,9 @@ process data ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/condition_variable/condition_variable/wait_for.md b/reference/condition_variable/condition_variable/wait_for.md index f7557104c3..84414c8159 100644 --- a/reference/condition_variable/condition_variable/wait_for.md +++ b/reference/condition_variable/condition_variable/wait_for.md @@ -177,9 +177,9 @@ process data ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/condition_variable/condition_variable/wait_until.md b/reference/condition_variable/condition_variable/wait_until.md index 8a666cd710..2f6a6c55e5 100644 --- a/reference/condition_variable/condition_variable/wait_until.md +++ b/reference/condition_variable/condition_variable/wait_until.md @@ -187,9 +187,9 @@ process data ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/condition_variable/condition_variable_any.md b/reference/condition_variable/condition_variable_any.md index 7008bfba43..0c8369217c 100644 --- a/reference/condition_variable/condition_variable_any.md +++ b/reference/condition_variable/condition_variable_any.md @@ -106,7 +106,7 @@ process data - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/condition_variable/condition_variable_any/notify_all.md b/reference/condition_variable/condition_variable_any/notify_all.md index 02e1da8350..29c1b229e8 100644 --- a/reference/condition_variable/condition_variable_any/notify_all.md +++ b/reference/condition_variable/condition_variable_any/notify_all.md @@ -100,9 +100,9 @@ process data ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/condition_variable/condition_variable_any/notify_one.md b/reference/condition_variable/condition_variable_any/notify_one.md index 8eed05e984..dd0ad3ad74 100644 --- a/reference/condition_variable/condition_variable_any/notify_one.md +++ b/reference/condition_variable/condition_variable_any/notify_one.md @@ -96,9 +96,9 @@ process data ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/condition_variable/condition_variable_any/op_constructor.md b/reference/condition_variable/condition_variable_any/op_constructor.md index df05c17c2b..820e59296b 100644 --- a/reference/condition_variable/condition_variable_any/op_constructor.md +++ b/reference/condition_variable/condition_variable_any/op_constructor.md @@ -42,9 +42,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] - 2012までは、delete宣言に対応していないため、代わりにprivateで宣言のみ行う手法で代用されている。 diff --git a/reference/condition_variable/condition_variable_any/op_destructor.md b/reference/condition_variable/condition_variable_any/op_destructor.md index 8c8a5efe4b..14c65e85ed 100644 --- a/reference/condition_variable/condition_variable_any/op_destructor.md +++ b/reference/condition_variable/condition_variable_any/op_destructor.md @@ -38,9 +38,9 @@ ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/condition_variable/condition_variable_any/wait.md b/reference/condition_variable/condition_variable_any/wait.md index 2abc1bc1ae..3694af8c13 100644 --- a/reference/condition_variable/condition_variable_any/wait.md +++ b/reference/condition_variable/condition_variable_any/wait.md @@ -172,9 +172,9 @@ process data ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/condition_variable/condition_variable_any/wait_for.md b/reference/condition_variable/condition_variable_any/wait_for.md index 54b0fb60ad..fc78b53cc3 100644 --- a/reference/condition_variable/condition_variable_any/wait_for.md +++ b/reference/condition_variable/condition_variable_any/wait_for.md @@ -193,9 +193,9 @@ process data ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/condition_variable/condition_variable_any/wait_until.md b/reference/condition_variable/condition_variable_any/wait_until.md index c8f577edf0..b319626c9c 100644 --- a/reference/condition_variable/condition_variable_any/wait_until.md +++ b/reference/condition_variable/condition_variable_any/wait_until.md @@ -206,9 +206,9 @@ process data ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/condition_variable/cv_status.md b/reference/condition_variable/cv_status.md index 8c99443978..b0dd31e004 100644 --- a/reference/condition_variable/cv_status.md +++ b/reference/condition_variable/cv_status.md @@ -40,9 +40,9 @@ namespace std { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 (partial), 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 (partial) [mark verified], 2013 [mark verified] - 2012までは、スコープ付き列挙体(`enum class`)に対応していないため、代わりに名前空間`std::cv_status`に`enum cv_status`を定義する形になっている。 diff --git a/reference/coroutine.md b/reference/coroutine.md index e3fad274c7..2797c28776 100644 --- a/reference/coroutine.md +++ b/reference/coroutine.md @@ -50,7 +50,7 @@ ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 11.1 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? ## 関連項目 diff --git a/reference/coroutine/coroutine_handle.md b/reference/coroutine/coroutine_handle.md index 2070d733d8..98de8c5ed3 100644 --- a/reference/coroutine/coroutine_handle.md +++ b/reference/coroutine/coroutine_handle.md @@ -187,7 +187,7 @@ result=42 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 11.1 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/coroutine/coroutine_handle/address.md b/reference/coroutine/coroutine_handle/address.md index 18af2f7a70..c76150ec1f 100644 --- a/reference/coroutine/coroutine_handle/address.md +++ b/reference/coroutine/coroutine_handle/address.md @@ -45,7 +45,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 11.1 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/coroutine/coroutine_handle/destroy.md b/reference/coroutine/coroutine_handle/destroy.md index e89cc413a5..f0679d4ca0 100644 --- a/reference/coroutine/coroutine_handle/destroy.md +++ b/reference/coroutine/coroutine_handle/destroy.md @@ -36,7 +36,7 @@ void destroy() const; ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 11.1 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/coroutine/coroutine_handle/done.md b/reference/coroutine/coroutine_handle/done.md index 96e91b6e2a..3b5855996c 100644 --- a/reference/coroutine/coroutine_handle/done.md +++ b/reference/coroutine/coroutine_handle/done.md @@ -28,7 +28,7 @@ bool done() const; ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 11.1 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/coroutine/coroutine_handle/from_address.md b/reference/coroutine/coroutine_handle/from_address.md index 56855dd24a..c38e21ecba 100644 --- a/reference/coroutine/coroutine_handle/from_address.md +++ b/reference/coroutine/coroutine_handle/from_address.md @@ -35,7 +35,7 @@ coroutine_handle::from_address(void* addr); // (2) ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 11.1 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/coroutine/coroutine_handle/from_promise.md b/reference/coroutine/coroutine_handle/from_promise.md index 6b8c9293e0..f3b46f7e58 100644 --- a/reference/coroutine/coroutine_handle/from_promise.md +++ b/reference/coroutine/coroutine_handle/from_promise.md @@ -35,7 +35,7 @@ Promiseオブジェクトから対応するコルーチンハンドルを取得 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 11.1 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/coroutine/coroutine_handle/op_assign.md b/reference/coroutine/coroutine_handle/op_assign.md index 1b06bba062..01e0354edb 100644 --- a/reference/coroutine/coroutine_handle/op_assign.md +++ b/reference/coroutine/coroutine_handle/op_assign.md @@ -51,7 +51,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 11.1 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/coroutine/coroutine_handle/op_bool.md b/reference/coroutine/coroutine_handle/op_bool.md index 8e1fafd49c..b5ae6cae90 100644 --- a/reference/coroutine/coroutine_handle/op_bool.md +++ b/reference/coroutine/coroutine_handle/op_bool.md @@ -50,7 +50,7 @@ empty coroutine ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 11.1 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/coroutine/coroutine_handle/op_constructor.md b/reference/coroutine/coroutine_handle/op_constructor.md index 0dc51d3d91..db45848550 100644 --- a/reference/coroutine/coroutine_handle/op_constructor.md +++ b/reference/coroutine/coroutine_handle/op_constructor.md @@ -49,7 +49,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 11.1 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/coroutine/coroutine_handle/promise.md b/reference/coroutine/coroutine_handle/promise.md index 46057acdc4..336e908f18 100644 --- a/reference/coroutine/coroutine_handle/promise.md +++ b/reference/coroutine/coroutine_handle/promise.md @@ -31,7 +31,7 @@ Promise& promise() const; ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 11.1 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/coroutine/coroutine_handle/resume.md b/reference/coroutine/coroutine_handle/resume.md index 3724af2678..38967708ae 100644 --- a/reference/coroutine/coroutine_handle/resume.md +++ b/reference/coroutine/coroutine_handle/resume.md @@ -32,7 +32,7 @@ void resume() const; ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 11.1 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/coroutine/coroutine_traits.md b/reference/coroutine/coroutine_traits.md index 06554cf6db..1fe6a6c4af 100644 --- a/reference/coroutine/coroutine_traits.md +++ b/reference/coroutine/coroutine_traits.md @@ -120,7 +120,7 @@ main#2 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 11.1 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/coroutine/noop_coroutine.md b/reference/coroutine/noop_coroutine.md index b950820ccb..2d5de67eee 100644 --- a/reference/coroutine/noop_coroutine.md +++ b/reference/coroutine/noop_coroutine.md @@ -145,7 +145,7 @@ coro#1 0 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 11.1 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/coroutine/noop_coroutine_handle.md b/reference/coroutine/noop_coroutine_handle.md index 074d574d3c..adcd4a0963 100644 --- a/reference/coroutine/noop_coroutine_handle.md +++ b/reference/coroutine/noop_coroutine_handle.md @@ -81,7 +81,7 @@ namespace std { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 11.1 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/coroutine/suspend_always.md b/reference/coroutine/suspend_always.md index ed82a74061..74f2ab1753 100644 --- a/reference/coroutine/suspend_always.md +++ b/reference/coroutine/suspend_always.md @@ -113,7 +113,7 @@ result=42 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 11.1 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/coroutine/suspend_never.md b/reference/coroutine/suspend_never.md index e398116f4d..3b0752ff57 100644 --- a/reference/coroutine/suspend_never.md +++ b/reference/coroutine/suspend_never.md @@ -114,7 +114,7 @@ result=42 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 11.1 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cstddef/byte.md b/reference/cstddef/byte.md index 4e72e22c99..269d6e938e 100644 --- a/reference/cstddef/byte.md +++ b/reference/cstddef/byte.md @@ -86,9 +86,9 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 5.0 -- [GCC](/implementation.md#gcc): 7.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 3(`_HAS_STD_BYTE`を`0`に定義することで無効化できる) +- [Clang](/implementation.md#clang): 5.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 3(`_HAS_STD_BYTE`を`0`に定義することで無効化できる) [mark verified] ## 関連項目 diff --git a/reference/cstddef/byte/op_and.md b/reference/cstddef/byte/op_and.md index 2e6414f9a6..5e0d78b4eb 100644 --- a/reference/cstddef/byte/op_and.md +++ b/reference/cstddef/byte/op_and.md @@ -51,8 +51,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 5.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 5.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cstddef/byte/op_and_assign.md b/reference/cstddef/byte/op_and_assign.md index baf0b2381b..9c9fbe2bbf 100644 --- a/reference/cstddef/byte/op_and_assign.md +++ b/reference/cstddef/byte/op_and_assign.md @@ -51,8 +51,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 5.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 5.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cstddef/byte/op_flip.md b/reference/cstddef/byte/op_flip.md index 83cad35ae6..cee165c755 100644 --- a/reference/cstddef/byte/op_flip.md +++ b/reference/cstddef/byte/op_flip.md @@ -53,8 +53,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 5.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 5.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cstddef/byte/op_left_shift.md b/reference/cstddef/byte/op_left_shift.md index 9a9ccd09f3..64bdbbf8b4 100644 --- a/reference/cstddef/byte/op_left_shift.md +++ b/reference/cstddef/byte/op_left_shift.md @@ -54,8 +54,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 5.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 5.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cstddef/byte/op_left_shift_assign.md b/reference/cstddef/byte/op_left_shift_assign.md index c779db808e..2142298a1a 100644 --- a/reference/cstddef/byte/op_left_shift_assign.md +++ b/reference/cstddef/byte/op_left_shift_assign.md @@ -54,8 +54,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 5.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 5.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cstddef/byte/op_or.md b/reference/cstddef/byte/op_or.md index 9db8a57795..46aa0aa0b9 100644 --- a/reference/cstddef/byte/op_or.md +++ b/reference/cstddef/byte/op_or.md @@ -51,8 +51,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 5.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 5.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cstddef/byte/op_or_assign.md b/reference/cstddef/byte/op_or_assign.md index d78b6b402b..39a1075121 100644 --- a/reference/cstddef/byte/op_or_assign.md +++ b/reference/cstddef/byte/op_or_assign.md @@ -51,8 +51,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 5.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 5.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cstddef/byte/op_right_shift.md b/reference/cstddef/byte/op_right_shift.md index 10ac5f7eba..f7cca21c18 100644 --- a/reference/cstddef/byte/op_right_shift.md +++ b/reference/cstddef/byte/op_right_shift.md @@ -54,8 +54,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 5.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 5.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cstddef/byte/op_right_shift_assign.md b/reference/cstddef/byte/op_right_shift_assign.md index 9d6b7a7d09..b5175a16e3 100644 --- a/reference/cstddef/byte/op_right_shift_assign.md +++ b/reference/cstddef/byte/op_right_shift_assign.md @@ -54,8 +54,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 5.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 5.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cstddef/byte/op_xor.md b/reference/cstddef/byte/op_xor.md index 9802dd662a..9112538461 100644 --- a/reference/cstddef/byte/op_xor.md +++ b/reference/cstddef/byte/op_xor.md @@ -51,8 +51,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 5.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 5.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cstddef/byte/op_xor_assign.md b/reference/cstddef/byte/op_xor_assign.md index 87a6aa08fe..6e519343aa 100644 --- a/reference/cstddef/byte/op_xor_assign.md +++ b/reference/cstddef/byte/op_xor_assign.md @@ -51,8 +51,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 5.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 5.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cstddef/byte/to_integer.md b/reference/cstddef/byte/to_integer.md index 85dac4c867..3e6854b757 100644 --- a/reference/cstddef/byte/to_integer.md +++ b/reference/cstddef/byte/to_integer.md @@ -59,6 +59,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 5.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 5.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cstddef/max_align_t.md b/reference/cstddef/max_align_t.md index 6ea08a2771..9e99e20786 100644 --- a/reference/cstddef/max_align_t.md +++ b/reference/cstddef/max_align_t.md @@ -63,10 +63,10 @@ is_pod: 1 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.5 -- [GCC](/implementation.md#gcc): 4.9 +- [Clang](/implementation.md#clang): 3.5 [mark verified] +- [GCC](/implementation.md#gcc): 4.9 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 関連項目 diff --git a/reference/cstddef/nullptr_t.md b/reference/cstddef/nullptr_t.md index 330e7c098c..f5a6ae5d29 100644 --- a/reference/cstddef/nullptr_t.md +++ b/reference/cstddef/nullptr_t.md @@ -51,10 +51,10 @@ is_class: 0 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.6.4 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.6.4 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] - 2010, 2012では[`is_scalar`](../type_traits/is_scalar.md)``が`false_type`(からの派生クラス)となっているバグがある。 diff --git a/reference/cstdint/int16_max.md b/reference/cstdint/int16_max.md index c2bf7cdb06..1572e6fffc 100644 --- a/reference/cstdint/int16_max.md +++ b/reference/cstdint/int16_max.md @@ -39,9 +39,9 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.4 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012以降、値の型は`short`となっており、標準規格に合致していないことに注意。 diff --git a/reference/cstdint/int16_min.md b/reference/cstdint/int16_min.md index f6ef6e2df7..801932b02b 100644 --- a/reference/cstdint/int16_min.md +++ b/reference/cstdint/int16_min.md @@ -39,8 +39,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.4 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] diff --git a/reference/cstdint/int16_t.md b/reference/cstdint/int16_t.md index 8f1dd2f224..8032fb57bb 100644 --- a/reference/cstdint/int16_t.md +++ b/reference/cstdint/int16_t.md @@ -26,10 +26,10 @@ namespace std { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/cstdint/int32_max.md b/reference/cstdint/int32_max.md index 8ef40d95f0..518a3915d0 100644 --- a/reference/cstdint/int32_max.md +++ b/reference/cstdint/int32_max.md @@ -39,8 +39,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.4 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] diff --git a/reference/cstdint/int32_min.md b/reference/cstdint/int32_min.md index 6239c32952..68d08f2a7a 100644 --- a/reference/cstdint/int32_min.md +++ b/reference/cstdint/int32_min.md @@ -39,8 +39,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.4 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] diff --git a/reference/cstdint/int32_t.md b/reference/cstdint/int32_t.md index a5e363f160..20a63b2905 100644 --- a/reference/cstdint/int32_t.md +++ b/reference/cstdint/int32_t.md @@ -26,10 +26,10 @@ namespace std { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/cstdint/int64_max.md b/reference/cstdint/int64_max.md index 2df5345ee9..dff7a034f1 100644 --- a/reference/cstdint/int64_max.md +++ b/reference/cstdint/int64_max.md @@ -39,8 +39,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.4 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] diff --git a/reference/cstdint/int64_min.md b/reference/cstdint/int64_min.md index 79b096db56..cdd96d25a7 100644 --- a/reference/cstdint/int64_min.md +++ b/reference/cstdint/int64_min.md @@ -39,8 +39,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.4 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] diff --git a/reference/cstdint/int64_t.md b/reference/cstdint/int64_t.md index 811e3acfe9..0988d99ed4 100644 --- a/reference/cstdint/int64_t.md +++ b/reference/cstdint/int64_t.md @@ -26,10 +26,10 @@ namespace std { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/cstdint/int8_max.md b/reference/cstdint/int8_max.md index 71fc37a874..245af0668b 100644 --- a/reference/cstdint/int8_max.md +++ b/reference/cstdint/int8_max.md @@ -41,9 +41,9 @@ Visual C++では、`static_cast(INT8_MAX)`としないと、このとおり - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.4 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012以降、値の型は`char`となっており、標準規格に合致していないことに注意。 diff --git a/reference/cstdint/int8_min.md b/reference/cstdint/int8_min.md index 00baffc9f0..338af512ac 100644 --- a/reference/cstdint/int8_min.md +++ b/reference/cstdint/int8_min.md @@ -39,8 +39,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.4 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] diff --git a/reference/cstdint/int8_t.md b/reference/cstdint/int8_t.md index 53f90f4258..650c3d280c 100644 --- a/reference/cstdint/int8_t.md +++ b/reference/cstdint/int8_t.md @@ -26,10 +26,10 @@ namespace std { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/cstdint/int_fast16_max.md b/reference/cstdint/int_fast16_max.md index f37329db5f..e7ae058b61 100644 --- a/reference/cstdint/int_fast16_max.md +++ b/reference/cstdint/int_fast16_max.md @@ -15,7 +15,7 @@ - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/int_fast16_min.md b/reference/cstdint/int_fast16_min.md index 4a6df438c6..63de1921e0 100644 --- a/reference/cstdint/int_fast16_min.md +++ b/reference/cstdint/int_fast16_min.md @@ -15,7 +15,7 @@ - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/int_fast16_t.md b/reference/cstdint/int_fast16_t.md index 87e99430f6..6075bba9e8 100644 --- a/reference/cstdint/int_fast16_t.md +++ b/reference/cstdint/int_fast16_t.md @@ -21,7 +21,7 @@ namespace std { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/int_fast32_max.md b/reference/cstdint/int_fast32_max.md index 511877d268..f864bcb2a6 100644 --- a/reference/cstdint/int_fast32_max.md +++ b/reference/cstdint/int_fast32_max.md @@ -15,7 +15,7 @@ - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/int_fast32_min.md b/reference/cstdint/int_fast32_min.md index 374b6e74fe..405db6e921 100644 --- a/reference/cstdint/int_fast32_min.md +++ b/reference/cstdint/int_fast32_min.md @@ -15,7 +15,7 @@ - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/int_fast32_t.md b/reference/cstdint/int_fast32_t.md index 9d7d14d42a..1722d67466 100644 --- a/reference/cstdint/int_fast32_t.md +++ b/reference/cstdint/int_fast32_t.md @@ -21,7 +21,7 @@ namespace std { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/int_fast64_max.md b/reference/cstdint/int_fast64_max.md index d8d43dbc2a..c01b4e58a7 100644 --- a/reference/cstdint/int_fast64_max.md +++ b/reference/cstdint/int_fast64_max.md @@ -15,7 +15,7 @@ - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/int_fast64_min.md b/reference/cstdint/int_fast64_min.md index 91bbb5beca..0131bce400 100644 --- a/reference/cstdint/int_fast64_min.md +++ b/reference/cstdint/int_fast64_min.md @@ -15,7 +15,7 @@ - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/int_fast64_t.md b/reference/cstdint/int_fast64_t.md index 0d84fc3611..600ee1eff6 100644 --- a/reference/cstdint/int_fast64_t.md +++ b/reference/cstdint/int_fast64_t.md @@ -21,7 +21,7 @@ namespace std { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/int_fast8_max.md b/reference/cstdint/int_fast8_max.md index 62c02f774e..a6d302737b 100644 --- a/reference/cstdint/int_fast8_max.md +++ b/reference/cstdint/int_fast8_max.md @@ -15,7 +15,7 @@ - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/int_fast8_min.md b/reference/cstdint/int_fast8_min.md index d611f6a5cc..7424bf47ab 100644 --- a/reference/cstdint/int_fast8_min.md +++ b/reference/cstdint/int_fast8_min.md @@ -15,7 +15,7 @@ - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/int_fast8_t.md b/reference/cstdint/int_fast8_t.md index 74566f938f..d9bd037fd9 100644 --- a/reference/cstdint/int_fast8_t.md +++ b/reference/cstdint/int_fast8_t.md @@ -21,7 +21,7 @@ namespace std { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/int_least16_max.md b/reference/cstdint/int_least16_max.md index 9df25dbc98..edf45c06aa 100644 --- a/reference/cstdint/int_least16_max.md +++ b/reference/cstdint/int_least16_max.md @@ -15,7 +15,7 @@ - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/int_least16_min.md b/reference/cstdint/int_least16_min.md index 86f9a141eb..1322524c81 100644 --- a/reference/cstdint/int_least16_min.md +++ b/reference/cstdint/int_least16_min.md @@ -15,7 +15,7 @@ - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/int_least16_t.md b/reference/cstdint/int_least16_t.md index c82e649f63..8e50916f7b 100644 --- a/reference/cstdint/int_least16_t.md +++ b/reference/cstdint/int_least16_t.md @@ -21,7 +21,7 @@ namespace std { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/int_least32_max.md b/reference/cstdint/int_least32_max.md index c94ad5b6d7..e9b4e9eee3 100644 --- a/reference/cstdint/int_least32_max.md +++ b/reference/cstdint/int_least32_max.md @@ -15,7 +15,7 @@ - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/int_least32_min.md b/reference/cstdint/int_least32_min.md index a500569c59..76e791f0c5 100644 --- a/reference/cstdint/int_least32_min.md +++ b/reference/cstdint/int_least32_min.md @@ -15,7 +15,7 @@ - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/int_least32_t.md b/reference/cstdint/int_least32_t.md index 25d9f93e26..ab60338f5b 100644 --- a/reference/cstdint/int_least32_t.md +++ b/reference/cstdint/int_least32_t.md @@ -21,7 +21,7 @@ namespace std { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/int_least64_max.md b/reference/cstdint/int_least64_max.md index 029ef9e215..66297f5316 100644 --- a/reference/cstdint/int_least64_max.md +++ b/reference/cstdint/int_least64_max.md @@ -15,7 +15,7 @@ - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/int_least64_min.md b/reference/cstdint/int_least64_min.md index 7f88fdde0d..d5868cf165 100644 --- a/reference/cstdint/int_least64_min.md +++ b/reference/cstdint/int_least64_min.md @@ -15,7 +15,7 @@ - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/int_least64_t.md b/reference/cstdint/int_least64_t.md index 29171d8709..5ff26c1ec9 100644 --- a/reference/cstdint/int_least64_t.md +++ b/reference/cstdint/int_least64_t.md @@ -21,7 +21,7 @@ namespace std { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/int_least8_max.md b/reference/cstdint/int_least8_max.md index ab57906213..d18bffb7c6 100644 --- a/reference/cstdint/int_least8_max.md +++ b/reference/cstdint/int_least8_max.md @@ -15,7 +15,7 @@ - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/int_least8_min.md b/reference/cstdint/int_least8_min.md index cde3f1d22e..52d83d0fbd 100644 --- a/reference/cstdint/int_least8_min.md +++ b/reference/cstdint/int_least8_min.md @@ -15,7 +15,7 @@ - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/int_least8_t.md b/reference/cstdint/int_least8_t.md index 12b7306289..7bb330a6f6 100644 --- a/reference/cstdint/int_least8_t.md +++ b/reference/cstdint/int_least8_t.md @@ -21,7 +21,7 @@ namespace std { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/intmax_max.md b/reference/cstdint/intmax_max.md index 84d612f9f8..ff6b558d2b 100644 --- a/reference/cstdint/intmax_max.md +++ b/reference/cstdint/intmax_max.md @@ -15,7 +15,7 @@ - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/intmax_min.md b/reference/cstdint/intmax_min.md index c22ece17c4..80f772a196 100644 --- a/reference/cstdint/intmax_min.md +++ b/reference/cstdint/intmax_min.md @@ -15,7 +15,7 @@ - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/intmax_t.md b/reference/cstdint/intmax_t.md index 370bfd5298..d5553e767a 100644 --- a/reference/cstdint/intmax_t.md +++ b/reference/cstdint/intmax_t.md @@ -19,7 +19,7 @@ namespace std { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/intptr_max.md b/reference/cstdint/intptr_max.md index 0e6fe22b69..a4c67b1501 100644 --- a/reference/cstdint/intptr_max.md +++ b/reference/cstdint/intptr_max.md @@ -38,8 +38,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.4 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cstdint/intptr_min.md b/reference/cstdint/intptr_min.md index 578dea95a9..66f373e33c 100644 --- a/reference/cstdint/intptr_min.md +++ b/reference/cstdint/intptr_min.md @@ -38,8 +38,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.4 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cstdint/intptr_t.md b/reference/cstdint/intptr_t.md index de911480db..4311223b15 100644 --- a/reference/cstdint/intptr_t.md +++ b/reference/cstdint/intptr_t.md @@ -75,8 +75,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.3.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] - 2005, 2008では、``にグローバル名前空間で定義されている。 diff --git a/reference/cstdint/ptrdiff_max.md b/reference/cstdint/ptrdiff_max.md index 9accf841fa..9bbf244a2b 100644 --- a/reference/cstdint/ptrdiff_max.md +++ b/reference/cstdint/ptrdiff_max.md @@ -15,7 +15,7 @@ - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/ptrdiff_min.md b/reference/cstdint/ptrdiff_min.md index 5d364b0335..2cb3ae8122 100644 --- a/reference/cstdint/ptrdiff_min.md +++ b/reference/cstdint/ptrdiff_min.md @@ -15,7 +15,7 @@ - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/sig_atomic_max.md b/reference/cstdint/sig_atomic_max.md index ecd7ddf972..44cf332d5a 100644 --- a/reference/cstdint/sig_atomic_max.md +++ b/reference/cstdint/sig_atomic_max.md @@ -38,8 +38,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.4 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cstdint/sig_atomic_min.md b/reference/cstdint/sig_atomic_min.md index 356dfbe73f..7ed0d464d5 100644 --- a/reference/cstdint/sig_atomic_min.md +++ b/reference/cstdint/sig_atomic_min.md @@ -38,8 +38,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.4 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cstdint/size_max.md b/reference/cstdint/size_max.md index fa1c748b54..13bac70b9d 100644 --- a/reference/cstdint/size_max.md +++ b/reference/cstdint/size_max.md @@ -37,8 +37,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.4 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cstdint/uint16_max.md b/reference/cstdint/uint16_max.md index c168ce6ca5..bfb5cc98d8 100644 --- a/reference/cstdint/uint16_max.md +++ b/reference/cstdint/uint16_max.md @@ -39,9 +39,9 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.4 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012以降、値の型は`unsigned short`となっており、標準規格に合致していないことに注意。 diff --git a/reference/cstdint/uint16_t.md b/reference/cstdint/uint16_t.md index 6229d3b9a7..3b5bbada57 100644 --- a/reference/cstdint/uint16_t.md +++ b/reference/cstdint/uint16_t.md @@ -26,10 +26,10 @@ namespace std { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/cstdint/uint32_max.md b/reference/cstdint/uint32_max.md index 81a9a08c56..d5d954d245 100644 --- a/reference/cstdint/uint32_max.md +++ b/reference/cstdint/uint32_max.md @@ -39,8 +39,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.4 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] diff --git a/reference/cstdint/uint32_t.md b/reference/cstdint/uint32_t.md index d716291e46..2d08af6d6d 100644 --- a/reference/cstdint/uint32_t.md +++ b/reference/cstdint/uint32_t.md @@ -26,10 +26,10 @@ namespace std { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/cstdint/uint64_max.md b/reference/cstdint/uint64_max.md index a8bd8c4eec..fed5baefdb 100644 --- a/reference/cstdint/uint64_max.md +++ b/reference/cstdint/uint64_max.md @@ -39,8 +39,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.4 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] diff --git a/reference/cstdint/uint64_t.md b/reference/cstdint/uint64_t.md index 75fa852f43..b3bded6b2f 100644 --- a/reference/cstdint/uint64_t.md +++ b/reference/cstdint/uint64_t.md @@ -26,10 +26,10 @@ namespace std { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/cstdint/uint8_max.md b/reference/cstdint/uint8_max.md index cb74b8cfbe..7491090d85 100644 --- a/reference/cstdint/uint8_max.md +++ b/reference/cstdint/uint8_max.md @@ -40,9 +40,9 @@ Visual C++では、`static_cast(UINT8_MAX)`としないと、このとお - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.4 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012以降、値の型は`unsigned char`となっており、標準規格に合致していないことに注意。 diff --git a/reference/cstdint/uint8_t.md b/reference/cstdint/uint8_t.md index 22ef173e9b..94b19b6d24 100644 --- a/reference/cstdint/uint8_t.md +++ b/reference/cstdint/uint8_t.md @@ -26,10 +26,10 @@ namespace std { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/cstdint/uint_fast16_max.md b/reference/cstdint/uint_fast16_max.md index 1b2b2eb13b..0a6da25d9d 100644 --- a/reference/cstdint/uint_fast16_max.md +++ b/reference/cstdint/uint_fast16_max.md @@ -15,7 +15,7 @@ - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/uint_fast16_t.md b/reference/cstdint/uint_fast16_t.md index 5e5fefa7ee..f58a9f9869 100644 --- a/reference/cstdint/uint_fast16_t.md +++ b/reference/cstdint/uint_fast16_t.md @@ -21,7 +21,7 @@ namespace std { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/uint_fast32_max.md b/reference/cstdint/uint_fast32_max.md index 8887fc78d3..1486be9686 100644 --- a/reference/cstdint/uint_fast32_max.md +++ b/reference/cstdint/uint_fast32_max.md @@ -15,7 +15,7 @@ - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/uint_fast32_t.md b/reference/cstdint/uint_fast32_t.md index 3fd70ab11c..11fabe0264 100644 --- a/reference/cstdint/uint_fast32_t.md +++ b/reference/cstdint/uint_fast32_t.md @@ -21,7 +21,7 @@ namespace std { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/uint_fast64_max.md b/reference/cstdint/uint_fast64_max.md index d4eac11310..e99ad21dab 100644 --- a/reference/cstdint/uint_fast64_max.md +++ b/reference/cstdint/uint_fast64_max.md @@ -15,7 +15,7 @@ - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/uint_fast64_t.md b/reference/cstdint/uint_fast64_t.md index 4903c2ac8a..c8099520aa 100644 --- a/reference/cstdint/uint_fast64_t.md +++ b/reference/cstdint/uint_fast64_t.md @@ -21,7 +21,7 @@ namespace std { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/uint_fast8_max.md b/reference/cstdint/uint_fast8_max.md index daf6da85c8..e1eb4b1373 100644 --- a/reference/cstdint/uint_fast8_max.md +++ b/reference/cstdint/uint_fast8_max.md @@ -15,7 +15,7 @@ - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/uint_fast8_t.md b/reference/cstdint/uint_fast8_t.md index 4c6aa0557a..3a2ae88ab1 100644 --- a/reference/cstdint/uint_fast8_t.md +++ b/reference/cstdint/uint_fast8_t.md @@ -21,7 +21,7 @@ namespace std { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/uint_least16_max.md b/reference/cstdint/uint_least16_max.md index d66742de89..786d179b84 100644 --- a/reference/cstdint/uint_least16_max.md +++ b/reference/cstdint/uint_least16_max.md @@ -15,7 +15,7 @@ - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/uint_least16_t.md b/reference/cstdint/uint_least16_t.md index d7ca18e26c..e283d824cb 100644 --- a/reference/cstdint/uint_least16_t.md +++ b/reference/cstdint/uint_least16_t.md @@ -21,7 +21,7 @@ namespace std { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/uint_least32_max.md b/reference/cstdint/uint_least32_max.md index a67001ec90..de0971649c 100644 --- a/reference/cstdint/uint_least32_max.md +++ b/reference/cstdint/uint_least32_max.md @@ -15,7 +15,7 @@ - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/uint_least32_t.md b/reference/cstdint/uint_least32_t.md index c142572b28..64b8e28f92 100644 --- a/reference/cstdint/uint_least32_t.md +++ b/reference/cstdint/uint_least32_t.md @@ -21,7 +21,7 @@ namespace std { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/uint_least64_max.md b/reference/cstdint/uint_least64_max.md index ace8cbbfdc..25d63108da 100644 --- a/reference/cstdint/uint_least64_max.md +++ b/reference/cstdint/uint_least64_max.md @@ -15,7 +15,7 @@ - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/uint_least64_t.md b/reference/cstdint/uint_least64_t.md index f04c329b36..f8690b6055 100644 --- a/reference/cstdint/uint_least64_t.md +++ b/reference/cstdint/uint_least64_t.md @@ -21,7 +21,7 @@ namespace std { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/uint_least8_max.md b/reference/cstdint/uint_least8_max.md index 9f551b97b9..fec8b8526f 100644 --- a/reference/cstdint/uint_least8_max.md +++ b/reference/cstdint/uint_least8_max.md @@ -15,7 +15,7 @@ - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/uint_least8_t.md b/reference/cstdint/uint_least8_t.md index 20f6115d8c..f1ae3f39f8 100644 --- a/reference/cstdint/uint_least8_t.md +++ b/reference/cstdint/uint_least8_t.md @@ -21,7 +21,7 @@ namespace std { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/uintmax_max.md b/reference/cstdint/uintmax_max.md index 90f11a14b9..4a3abc8426 100644 --- a/reference/cstdint/uintmax_max.md +++ b/reference/cstdint/uintmax_max.md @@ -15,7 +15,7 @@ - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/uintmax_t.md b/reference/cstdint/uintmax_t.md index 3d5922e9cc..b2b0b65bbc 100644 --- a/reference/cstdint/uintmax_t.md +++ b/reference/cstdint/uintmax_t.md @@ -19,7 +19,7 @@ namespace std { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/cstdint/uintptr_max.md b/reference/cstdint/uintptr_max.md index 9300b9db37..92c10c661b 100644 --- a/reference/cstdint/uintptr_max.md +++ b/reference/cstdint/uintptr_max.md @@ -38,8 +38,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.4 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cstdint/uintptr_t.md b/reference/cstdint/uintptr_t.md index 4ee1fbe0fc..3681bef3c8 100644 --- a/reference/cstdint/uintptr_t.md +++ b/reference/cstdint/uintptr_t.md @@ -32,8 +32,8 @@ namespace std { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.3.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] - 2005, 2008では、``にグローバル名前空間で定義されている。 diff --git a/reference/cstdint/wchar_max.md b/reference/cstdint/wchar_max.md index 20792451ce..528969baa0 100644 --- a/reference/cstdint/wchar_max.md +++ b/reference/cstdint/wchar_max.md @@ -36,8 +36,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.3 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.3 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] diff --git a/reference/cstdint/wchar_min.md b/reference/cstdint/wchar_min.md index d0072f1223..fac479e697 100644 --- a/reference/cstdint/wchar_min.md +++ b/reference/cstdint/wchar_min.md @@ -36,8 +36,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.3 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.3 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] diff --git a/reference/cstdint/wint_max.md b/reference/cstdint/wint_max.md index 5ba39d183c..785494ede4 100644 --- a/reference/cstdint/wint_max.md +++ b/reference/cstdint/wint_max.md @@ -37,8 +37,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.4 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] diff --git a/reference/cstdint/wint_min.md b/reference/cstdint/wint_min.md index 8f3ad3145e..8c44958daa 100644 --- a/reference/cstdint/wint_min.md +++ b/reference/cstdint/wint_min.md @@ -37,8 +37,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.4 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] diff --git a/reference/cstdlib/aligned_alloc.md b/reference/cstdlib/aligned_alloc.md index e3f72b9365..deae2f5758 100644 --- a/reference/cstdlib/aligned_alloc.md +++ b/reference/cstdlib/aligned_alloc.md @@ -54,9 +54,9 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 3.4 -- [GCC](/implementation.md#gcc): 8.3 -- [Visual C++](/implementation.md#visual_cpp): (2019 Update 3の時点では未実装) +- [Clang](/implementation.md#clang): 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 8.3 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] #### 備考 - Clangは、グローバル名前空間 (POSIXの実装) では、3.1で動作確認できた diff --git a/reference/cstdlib/at_quick_exit.md b/reference/cstdlib/at_quick_exit.md index 7ea7f71d9e..b40a96bc60 100644 --- a/reference/cstdlib/at_quick_exit.md +++ b/reference/cstdlib/at_quick_exit.md @@ -61,10 +61,10 @@ on exit - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.4 -- [GCC](/implementation.md#gcc): 4.8 +- [Clang](/implementation.md#clang): 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.8 [mark verified] - [ICC](/implementation.md#icc): -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] ## 参照 diff --git a/reference/cstdlib/exit_.md b/reference/cstdlib/exit_.md index e06d954d8c..49c03a2c61 100644 --- a/reference/cstdlib/exit_.md +++ b/reference/cstdlib/exit_.md @@ -73,10 +73,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3 [mark verified] - [ICC](/implementation.md#icc): -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] ## 関連項目 diff --git a/reference/cstdlib/quick_exit.md b/reference/cstdlib/quick_exit.md index 84b6d08a95..746c794472 100644 --- a/reference/cstdlib/quick_exit.md +++ b/reference/cstdlib/quick_exit.md @@ -61,10 +61,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.4 -- [GCC](/implementation.md#gcc): 4.8 +- [Clang](/implementation.md#clang): 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.8 [mark verified] - [ICC](/implementation.md#icc): -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] ## 関連項目 diff --git a/reference/ctime/timespec.md b/reference/ctime/timespec.md index 9d7c92b882..3095bed5f8 100644 --- a/reference/ctime/timespec.md +++ b/reference/ctime/timespec.md @@ -70,8 +70,8 @@ Fri May 24 16:19:59 2019 - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 9.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? #### 備考 diff --git a/reference/ctime/timespec_get.md b/reference/ctime/timespec_get.md index 3aa3744376..601540ab67 100644 --- a/reference/ctime/timespec_get.md +++ b/reference/ctime/timespec_get.md @@ -72,8 +72,8 @@ Fri May 24 16:19:59 2019 - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 9.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? #### 備考 diff --git a/reference/deque/deque/cbegin.md b/reference/deque/deque/cbegin.md index e2d91545f3..06b5e2ee11 100644 --- a/reference/deque/deque/cbegin.md +++ b/reference/deque/deque/cbegin.md @@ -62,9 +62,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/deque/deque/cend.md b/reference/deque/deque/cend.md index 1a62d22a7b..be536a3937 100644 --- a/reference/deque/deque/cend.md +++ b/reference/deque/deque/cend.md @@ -65,9 +65,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/deque/deque/crbegin.md b/reference/deque/deque/crbegin.md index 3efe5bc3bd..4f3387846e 100644 --- a/reference/deque/deque/crbegin.md +++ b/reference/deque/deque/crbegin.md @@ -61,9 +61,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/deque/deque/crend.md b/reference/deque/deque/crend.md index 32906938bf..c21941b5ae 100644 --- a/reference/deque/deque/crend.md +++ b/reference/deque/deque/crend.md @@ -61,9 +61,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/deque/deque/emplace.md b/reference/deque/deque/emplace.md index 75d6f9ff25..ca1870f334 100644 --- a/reference/deque/deque/emplace.md +++ b/reference/deque/deque/emplace.md @@ -68,9 +68,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] - 2010にも`emplace`は存在するが、`insert`相当の機能しかない。 diff --git a/reference/deque/deque/emplace_back.md b/reference/deque/deque/emplace_back.md index 43a517edb8..8592139a5e 100644 --- a/reference/deque/deque/emplace_back.md +++ b/reference/deque/deque/emplace_back.md @@ -71,9 +71,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] - 2010にも`emplace_back`は存在するが、`push_back`相当の機能しかない。 diff --git a/reference/deque/deque/emplace_front.md b/reference/deque/deque/emplace_front.md index aefffe97b8..aff678682f 100644 --- a/reference/deque/deque/emplace_front.md +++ b/reference/deque/deque/emplace_front.md @@ -71,9 +71,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] - 2010にも`emplace_front`は存在するが、`push_front`相当の機能しかない。 diff --git a/reference/deque/deque/erase_free.md b/reference/deque/deque/erase_free.md index c6439601a6..5ed9fec9a9 100644 --- a/reference/deque/deque/erase_free.md +++ b/reference/deque/deque/erase_free.md @@ -66,8 +66,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 9.1 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/deque/deque/erase_if_free.md b/reference/deque/deque/erase_if_free.md index f7b971a6f1..03c68fadb2 100644 --- a/reference/deque/deque/erase_if_free.md +++ b/reference/deque/deque/erase_if_free.md @@ -66,8 +66,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 9.1 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/deque/deque/get_allocator.md b/reference/deque/deque/get_allocator.md index 056e8f0cb1..598d275b2f 100644 --- a/reference/deque/deque/get_allocator.md +++ b/reference/deque/deque/get_allocator.md @@ -65,7 +65,7 @@ int main () - [Clang](/implementation.md#clang): ? - [GCC](/implementation.md#gcc): ? - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2002, 2003, 2005, 2008, 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2002 [mark verified], 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - 2012, 2013は、`noexcept`が実装されていないため、`throw()`が修飾されている。 - 2015からは、`noexcept`が修飾されている。 diff --git a/reference/deque/deque/op_compare_3way.md b/reference/deque/deque/op_compare_3way.md index fd47ade567..9103489576 100644 --- a/reference/deque/deque/op_compare_3way.md +++ b/reference/deque/deque/op_compare_3way.md @@ -74,7 +74,7 @@ int main () ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10 +- [GCC](/implementation.md#gcc): 10 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/deque/deque/op_deduction_guide.md b/reference/deque/deque/op_deduction_guide.md index e2f3260034..3564d08ab8 100644 --- a/reference/deque/deque/op_deduction_guide.md +++ b/reference/deque/deque/op_deduction_guide.md @@ -63,7 +63,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/deque/deque/shrink_to_fit.md b/reference/deque/deque/shrink_to_fit.md index 207caa9136..c010a1cb06 100644 --- a/reference/deque/deque/shrink_to_fit.md +++ b/reference/deque/deque/shrink_to_fit.md @@ -38,9 +38,9 @@ void shrink_to_fit(); ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/exception/current_exception.md b/reference/exception/current_exception.md index c121386082..50054389ef 100644 --- a/reference/exception/current_exception.md +++ b/reference/exception/current_exception.md @@ -80,9 +80,9 @@ terminate called after throwing an instance of 'std::runtime_error' ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/exception/exception_ptr.md b/reference/exception/exception_ptr.md index e530e03ad8..72e9281ae4 100644 --- a/reference/exception/exception_ptr.md +++ b/reference/exception/exception_ptr.md @@ -94,9 +94,9 @@ error! ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - 2010では、`bool`への暗黙の変換、`!=`での比較が実装されていない。上記コード例の1.と3.そして`error`の箇所にある`if`はコンパイルエラーになる。 diff --git a/reference/exception/get_terminate.md b/reference/exception/get_terminate.md index c3ce0e82ce..d4437ad433 100644 --- a/reference/exception/get_terminate.md +++ b/reference/exception/get_terminate.md @@ -58,9 +58,9 @@ on terminate ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.9.0 +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/exception/get_unexpected.md b/reference/exception/get_unexpected.md index ffa63910c8..76e5aaeedb 100644 --- a/reference/exception/get_unexpected.md +++ b/reference/exception/get_unexpected.md @@ -62,9 +62,9 @@ on expected ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.9.0 +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/exception/make_exception_ptr.md b/reference/exception/make_exception_ptr.md index d15d309524..bcbb73433c 100644 --- a/reference/exception/make_exception_ptr.md +++ b/reference/exception/make_exception_ptr.md @@ -68,9 +68,9 @@ error!!! ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 実装例 diff --git a/reference/exception/nested_exception.md b/reference/exception/nested_exception.md index 221e31e2a6..be8d09af7a 100644 --- a/reference/exception/nested_exception.md +++ b/reference/exception/nested_exception.md @@ -73,9 +73,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] ## 参照 diff --git a/reference/exception/nested_exception/nested_ptr.md b/reference/exception/nested_exception/nested_ptr.md index b3898fa9dd..5cf1622772 100644 --- a/reference/exception/nested_exception/nested_ptr.md +++ b/reference/exception/nested_exception/nested_ptr.md @@ -68,9 +68,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] ## 参照 diff --git a/reference/exception/nested_exception/op_constructor.md b/reference/exception/nested_exception/op_constructor.md index a192b5b72a..f8c2c37450 100644 --- a/reference/exception/nested_exception/op_constructor.md +++ b/reference/exception/nested_exception/op_constructor.md @@ -57,10 +57,10 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 3 -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 3 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] ## 参照 diff --git a/reference/exception/nested_exception/rethrow_nested.md b/reference/exception/nested_exception/rethrow_nested.md index b39535d533..82e66f2808 100644 --- a/reference/exception/nested_exception/rethrow_nested.md +++ b/reference/exception/nested_exception/rethrow_nested.md @@ -70,9 +70,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] ## 参照 diff --git a/reference/exception/rethrow_exception.md b/reference/exception/rethrow_exception.md index c84d46525b..d7a72f1130 100644 --- a/reference/exception/rethrow_exception.md +++ b/reference/exception/rethrow_exception.md @@ -76,9 +76,9 @@ terminate called after throwing an instance of 'std::runtime_error' ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/exception/rethrow_if_nested.md b/reference/exception/rethrow_if_nested.md index 863024070a..44a36adcd3 100644 --- a/reference/exception/rethrow_if_nested.md +++ b/reference/exception/rethrow_if_nested.md @@ -112,9 +112,9 @@ inner ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] ## 参照 diff --git a/reference/exception/throw_with_nested.md b/reference/exception/throw_with_nested.md index 6f65441aea..6e54f5aa29 100644 --- a/reference/exception/throw_with_nested.md +++ b/reference/exception/throw_with_nested.md @@ -104,9 +104,9 @@ inner ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] ## 参照 diff --git a/reference/exception/uncaught_exceptions.md b/reference/exception/uncaught_exceptions.md index e94edfcd85..af07952d1b 100644 --- a/reference/exception/uncaught_exceptions.md +++ b/reference/exception/uncaught_exceptions.md @@ -81,9 +81,9 @@ catch exception 2 - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 6 -- [GCC](/implementation.md#gcc): 3.7 -- [Visual C++](/implementation.md#visual_cpp): 2015, 2017 +- [Clang](/implementation.md#clang): 6 [mark verified] +- [GCC](/implementation.md#gcc): 3.7 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified], 2017 [mark verified] ## 参照 - [C++1z 現在発生している例外の数を取得するuncaught_exceptions()関数 - Faith and Brave - C++で遊ぼう](https://faithandbrave.hateblo.jp/entry/2016/06/22/171639) diff --git a/reference/expected.md b/reference/expected.md index 1c16e793e0..53e2ebc695 100644 --- a/reference/expected.md +++ b/reference/expected.md @@ -18,8 +18,8 @@ - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/bad_expected_access.md b/reference/expected/bad_expected_access.md index 1f18724c7e..ef6264e347 100644 --- a/reference/expected/bad_expected_access.md +++ b/reference/expected/bad_expected_access.md @@ -65,8 +65,8 @@ error: invalid - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/bad_expected_access/error.md b/reference/expected/bad_expected_access/error.md index 66947a8e76..5b90d7a957 100644 --- a/reference/expected/bad_expected_access/error.md +++ b/reference/expected/bad_expected_access/error.md @@ -60,8 +60,8 @@ throw:ERR - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/bad_expected_access/op_constructor.md b/reference/expected/bad_expected_access/op_constructor.md index 4049783bdd..98fd1304c1 100644 --- a/reference/expected/bad_expected_access/op_constructor.md +++ b/reference/expected/bad_expected_access/op_constructor.md @@ -42,8 +42,8 @@ int main() - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/bad_expected_access/what.md b/reference/expected/bad_expected_access/what.md index 38ad29ef36..6a2b70f308 100644 --- a/reference/expected/bad_expected_access/what.md +++ b/reference/expected/bad_expected_access/what.md @@ -54,8 +54,8 @@ bad access to std::expected without expected value - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/expected.md b/reference/expected/expected.md index 23da5b5149..f6a4362a5b 100644 --- a/reference/expected/expected.md +++ b/reference/expected/expected.md @@ -198,8 +198,8 @@ int main() - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/expected.void/and_then.md b/reference/expected/expected.void/and_then.md index 47c6b5f6dd..e4b8b2894f 100644 --- a/reference/expected/expected.void/and_then.md +++ b/reference/expected/expected.void/and_then.md @@ -121,7 +121,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.0 +- [GCC](/implementation.md#gcc): 13.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/expected.void/emplace.md b/reference/expected/expected.void/emplace.md index bffef043ec..3355a6a94c 100644 --- a/reference/expected/expected.void/emplace.md +++ b/reference/expected/expected.void/emplace.md @@ -45,8 +45,8 @@ int main() - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/expected.void/error.md b/reference/expected/expected.void/error.md index 36d7ca92ca..54bb42da90 100644 --- a/reference/expected/expected.void/error.md +++ b/reference/expected/expected.void/error.md @@ -61,8 +61,8 @@ ERR - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/expected.void/error_or.md b/reference/expected/expected.void/error_or.md index ef2781826b..80330d15de 100644 --- a/reference/expected/expected.void/error_or.md +++ b/reference/expected/expected.void/error_or.md @@ -56,7 +56,7 @@ ERR ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.0 +- [GCC](/implementation.md#gcc): 13.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/expected.void/has_value.md b/reference/expected/expected.void/has_value.md index a75f832859..951e28d11c 100644 --- a/reference/expected/expected.void/has_value.md +++ b/reference/expected/expected.void/has_value.md @@ -51,8 +51,8 @@ int main() - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/expected.void/op_assign.md b/reference/expected/expected.void/op_assign.md index e62f9f5ef2..8bcc57acde 100644 --- a/reference/expected/expected.void/op_assign.md +++ b/reference/expected/expected.void/op_assign.md @@ -161,8 +161,8 @@ int main() - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/expected.void/op_bool.md b/reference/expected/expected.void/op_bool.md index 0e30c76dd4..9775346edb 100644 --- a/reference/expected/expected.void/op_bool.md +++ b/reference/expected/expected.void/op_bool.md @@ -61,8 +61,8 @@ unex=42 - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/expected.void/op_constructor.md b/reference/expected/expected.void/op_constructor.md index 760c12b569..84266a1934 100644 --- a/reference/expected/expected.void/op_constructor.md +++ b/reference/expected/expected.void/op_constructor.md @@ -249,8 +249,8 @@ int main() - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/expected.void/op_deref.md b/reference/expected/expected.void/op_deref.md index 429ee518fa..99521a8758 100644 --- a/reference/expected/expected.void/op_deref.md +++ b/reference/expected/expected.void/op_deref.md @@ -53,8 +53,8 @@ int main() - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/expected.void/op_destructor.md b/reference/expected/expected.void/op_destructor.md index 9696d45f1b..b089ce1e8e 100644 --- a/reference/expected/expected.void/op_destructor.md +++ b/reference/expected/expected.void/op_destructor.md @@ -27,8 +27,8 @@ constexpr ~expected(); - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/expected.void/op_equal.md b/reference/expected/expected.void/op_equal.md index 62e228e97f..d61ff5eda7 100644 --- a/reference/expected/expected.void/op_equal.md +++ b/reference/expected/expected.void/op_equal.md @@ -72,8 +72,8 @@ int main() - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/expected.void/op_not_equal.md b/reference/expected/expected.void/op_not_equal.md index dd282393cf..9c203450b1 100644 --- a/reference/expected/expected.void/op_not_equal.md +++ b/reference/expected/expected.void/op_not_equal.md @@ -71,8 +71,8 @@ int main() - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/expected.void/or_else.md b/reference/expected/expected.void/or_else.md index 6b73a22c28..d5dae6b815 100644 --- a/reference/expected/expected.void/or_else.md +++ b/reference/expected/expected.void/or_else.md @@ -115,7 +115,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.0 +- [GCC](/implementation.md#gcc): 13.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/expected.void/swap.md b/reference/expected/expected.void/swap.md index 4a50254754..57e27cfe98 100644 --- a/reference/expected/expected.void/swap.md +++ b/reference/expected/expected.void/swap.md @@ -88,8 +88,8 @@ int main() - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/expected.void/swap_free.md b/reference/expected/expected.void/swap_free.md index a6f7cebbec..97a98ff56c 100644 --- a/reference/expected/expected.void/swap_free.md +++ b/reference/expected/expected.void/swap_free.md @@ -57,8 +57,8 @@ int main() - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/expected.void/transform.md b/reference/expected/expected.void/transform.md index 0729603452..7f4ecf74f9 100644 --- a/reference/expected/expected.void/transform.md +++ b/reference/expected/expected.void/transform.md @@ -95,7 +95,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.0 +- [GCC](/implementation.md#gcc): 13.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/expected.void/transform_error.md b/reference/expected/expected.void/transform_error.md index 5e9310a81d..faf79df9b8 100644 --- a/reference/expected/expected.void/transform_error.md +++ b/reference/expected/expected.void/transform_error.md @@ -89,7 +89,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.0 +- [GCC](/implementation.md#gcc): 13.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/expected.void/value.md b/reference/expected/expected.void/value.md index a69e3d1d17..cfd3689d5f 100644 --- a/reference/expected/expected.void/value.md +++ b/reference/expected/expected.void/value.md @@ -58,8 +58,8 @@ throw:42 - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/expected/and_then.md b/reference/expected/expected/and_then.md index 358fdfb1bc..534fd20750 100644 --- a/reference/expected/expected/and_then.md +++ b/reference/expected/expected/and_then.md @@ -122,7 +122,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.0 +- [GCC](/implementation.md#gcc): 13.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/expected/emplace.md b/reference/expected/expected/emplace.md index 31871cd0a4..c7d374fedd 100644 --- a/reference/expected/expected/emplace.md +++ b/reference/expected/expected/emplace.md @@ -115,8 +115,8 @@ int main() - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/expected/error.md b/reference/expected/expected/error.md index 0803dd3d94..e15a2e80a6 100644 --- a/reference/expected/expected/error.md +++ b/reference/expected/expected/error.md @@ -60,8 +60,8 @@ ERR - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/expected/error_or.md b/reference/expected/expected/error_or.md index 2a171fa458..f6baece702 100644 --- a/reference/expected/expected/error_or.md +++ b/reference/expected/expected/error_or.md @@ -55,7 +55,7 @@ ERR ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.0 +- [GCC](/implementation.md#gcc): 13.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/expected/has_value.md b/reference/expected/expected/has_value.md index a828c2a92a..f890a397fc 100644 --- a/reference/expected/expected/has_value.md +++ b/reference/expected/expected/has_value.md @@ -51,8 +51,8 @@ int main() - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/expected/op_arrow.md b/reference/expected/expected/op_arrow.md index 21f76bd96b..9356fbd458 100644 --- a/reference/expected/expected/op_arrow.md +++ b/reference/expected/expected/op_arrow.md @@ -56,8 +56,8 @@ int main() - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/expected/op_assign.md b/reference/expected/expected/op_assign.md index ba763681a0..90316fa6d3 100644 --- a/reference/expected/expected/op_assign.md +++ b/reference/expected/expected/op_assign.md @@ -237,8 +237,8 @@ int main() - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/expected/op_bool.md b/reference/expected/expected/op_bool.md index e7cee7513b..d2666754d3 100644 --- a/reference/expected/expected/op_bool.md +++ b/reference/expected/expected/op_bool.md @@ -63,8 +63,8 @@ unex=42 - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/expected/op_constructor.md b/reference/expected/expected/op_constructor.md index 4daa20aabd..43c739071f 100644 --- a/reference/expected/expected/op_constructor.md +++ b/reference/expected/expected/op_constructor.md @@ -313,8 +313,8 @@ int main() - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/expected/op_deref.md b/reference/expected/expected/op_deref.md index e26e01ebec..43e8e5ec52 100644 --- a/reference/expected/expected/op_deref.md +++ b/reference/expected/expected/op_deref.md @@ -61,8 +61,8 @@ int main() - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/expected/op_destructor.md b/reference/expected/expected/op_destructor.md index 23add4ea40..22ef6aa62a 100644 --- a/reference/expected/expected/op_destructor.md +++ b/reference/expected/expected/op_destructor.md @@ -27,8 +27,8 @@ constexpr ~expected(); - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/expected/op_equal.md b/reference/expected/expected/op_equal.md index e9daee414e..25e4668a72 100644 --- a/reference/expected/expected/op_equal.md +++ b/reference/expected/expected/op_equal.md @@ -85,8 +85,8 @@ int main() - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/expected/op_not_equal.md b/reference/expected/expected/op_not_equal.md index 0d64264ebd..bce953cf52 100644 --- a/reference/expected/expected/op_not_equal.md +++ b/reference/expected/expected/op_not_equal.md @@ -82,8 +82,8 @@ int main() - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/expected/or_else.md b/reference/expected/expected/or_else.md index bd4680b7b3..111100851d 100644 --- a/reference/expected/expected/or_else.md +++ b/reference/expected/expected/or_else.md @@ -128,7 +128,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.0 +- [GCC](/implementation.md#gcc): 13.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/expected/swap.md b/reference/expected/expected/swap.md index ac5f63df26..9a4225f2cd 100644 --- a/reference/expected/expected/swap.md +++ b/reference/expected/expected/swap.md @@ -113,8 +113,8 @@ int main() - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/expected/swap_free.md b/reference/expected/expected/swap_free.md index e3772eabff..4ecebe4283 100644 --- a/reference/expected/expected/swap_free.md +++ b/reference/expected/expected/swap_free.md @@ -57,8 +57,8 @@ int main() - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/expected/transform.md b/reference/expected/expected/transform.md index 8a3259a49e..1905d5ceb5 100644 --- a/reference/expected/expected/transform.md +++ b/reference/expected/expected/transform.md @@ -99,7 +99,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.0 +- [GCC](/implementation.md#gcc): 13.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/expected/transform_error.md b/reference/expected/expected/transform_error.md index d36c518c91..881c7c9e52 100644 --- a/reference/expected/expected/transform_error.md +++ b/reference/expected/expected/transform_error.md @@ -96,7 +96,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.0 +- [GCC](/implementation.md#gcc): 13.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/expected/value.md b/reference/expected/expected/value.md index ab4a91004c..ede35fc45c 100644 --- a/reference/expected/expected/value.md +++ b/reference/expected/expected/value.md @@ -64,8 +64,8 @@ throw:ERR - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/expected/value_or.md b/reference/expected/expected/value_or.md index e7431122aa..4f28b25fe1 100644 --- a/reference/expected/expected/value_or.md +++ b/reference/expected/expected/value_or.md @@ -54,8 +54,8 @@ int main() - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/unexpect_t.md b/reference/expected/unexpect_t.md index 5ef5320353..f64b2c48b6 100644 --- a/reference/expected/unexpect_t.md +++ b/reference/expected/unexpect_t.md @@ -47,8 +47,8 @@ int main() - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/unexpected.md b/reference/expected/unexpected.md index 6e8f00f677..87ddde4db1 100644 --- a/reference/expected/unexpected.md +++ b/reference/expected/unexpected.md @@ -114,8 +114,8 @@ int main() - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/unexpected/error.md b/reference/expected/unexpected/error.md index 8a6d6922bf..4ffa36ade6 100644 --- a/reference/expected/unexpected/error.md +++ b/reference/expected/unexpected/error.md @@ -54,8 +54,8 @@ ERR - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/unexpected/op_constructor.md b/reference/expected/unexpected/op_constructor.md index 763cccae60..02406bb5d0 100644 --- a/reference/expected/unexpected/op_constructor.md +++ b/reference/expected/unexpected/op_constructor.md @@ -136,8 +136,8 @@ int main() - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/unexpected/op_deduction_guide.md b/reference/expected/unexpected/op_deduction_guide.md index 0927d9d581..cfe96555ff 100644 --- a/reference/expected/unexpected/op_deduction_guide.md +++ b/reference/expected/unexpected/op_deduction_guide.md @@ -41,8 +41,8 @@ int main() - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/unexpected/op_equal.md b/reference/expected/unexpected/op_equal.md index 988a9f4661..61581a19b6 100644 --- a/reference/expected/unexpected/op_equal.md +++ b/reference/expected/unexpected/op_equal.md @@ -48,8 +48,8 @@ int main() - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/unexpected/op_not_equal.md b/reference/expected/unexpected/op_not_equal.md index 1b7786aa01..97cdbab9bd 100644 --- a/reference/expected/unexpected/op_not_equal.md +++ b/reference/expected/unexpected/op_not_equal.md @@ -50,8 +50,8 @@ int main() - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/unexpected/swap.md b/reference/expected/unexpected/swap.md index 19b821f9d8..1752d8c01c 100644 --- a/reference/expected/unexpected/swap.md +++ b/reference/expected/unexpected/swap.md @@ -63,8 +63,8 @@ int main() - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/expected/unexpected/swap_free.md b/reference/expected/unexpected/swap_free.md index 778781ee2d..208384af64 100644 --- a/reference/expected/unexpected/swap_free.md +++ b/reference/expected/unexpected/swap_free.md @@ -55,8 +55,8 @@ int main() - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/filesystem/absolute.md b/reference/filesystem/absolute.md index b6ac3f925b..cd4e9fbfaa 100644 --- a/reference/filesystem/absolute.md +++ b/reference/filesystem/absolute.md @@ -66,6 +66,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/canonical.md b/reference/filesystem/canonical.md index 0f92da9b15..2c0d5bfbee 100644 --- a/reference/filesystem/canonical.md +++ b/reference/filesystem/canonical.md @@ -73,8 +73,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/copy.md b/reference/filesystem/copy.md index 6a4ff6215f..fda98b0572 100644 --- a/reference/filesystem/copy.md +++ b/reference/filesystem/copy.md @@ -185,8 +185,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/copy_file.md b/reference/filesystem/copy_file.md index e8034eae76..4cbe89bbf9 100644 --- a/reference/filesystem/copy_file.md +++ b/reference/filesystem/copy_file.md @@ -92,8 +92,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/copy_options.md b/reference/filesystem/copy_options.md index 70802ce221..1c5247dc59 100644 --- a/reference/filesystem/copy_options.md +++ b/reference/filesystem/copy_options.md @@ -59,8 +59,8 @@ namespace std::filesystem { - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/copy_symlink.md b/reference/filesystem/copy_symlink.md index d5b24828cf..0502c1bb30 100644 --- a/reference/filesystem/copy_symlink.md +++ b/reference/filesystem/copy_symlink.md @@ -71,6 +71,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/create_directories.md b/reference/filesystem/create_directories.md index 69fd113860..50bbeaceb6 100644 --- a/reference/filesystem/create_directories.md +++ b/reference/filesystem/create_directories.md @@ -65,8 +65,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/create_directory.md b/reference/filesystem/create_directory.md index dca20f8a39..5bb79e6831 100644 --- a/reference/filesystem/create_directory.md +++ b/reference/filesystem/create_directory.md @@ -79,6 +79,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/create_directory_symlink.md b/reference/filesystem/create_directory_symlink.md index ff42a0ac92..9b9e6c1819 100644 --- a/reference/filesystem/create_directory_symlink.md +++ b/reference/filesystem/create_directory_symlink.md @@ -67,6 +67,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/create_hard_link.md b/reference/filesystem/create_hard_link.md index a27c654172..f44d9febde 100644 --- a/reference/filesystem/create_hard_link.md +++ b/reference/filesystem/create_hard_link.md @@ -71,6 +71,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/create_symlink.md b/reference/filesystem/create_symlink.md index cc23ce7eae..2a4cfa9308 100644 --- a/reference/filesystem/create_symlink.md +++ b/reference/filesystem/create_symlink.md @@ -68,6 +68,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/current_path.md b/reference/filesystem/current_path.md index e772854734..ea089221bc 100644 --- a/reference/filesystem/current_path.md +++ b/reference/filesystem/current_path.md @@ -76,6 +76,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/directory_entry.md b/reference/filesystem/directory_entry.md index c254e22069..7cdd21a91e 100644 --- a/reference/filesystem/directory_entry.md +++ b/reference/filesystem/directory_entry.md @@ -106,8 +106,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/directory_entry/assign.md b/reference/filesystem/directory_entry/assign.md index e15b725f8b..d39a9cc3fb 100644 --- a/reference/filesystem/directory_entry/assign.md +++ b/reference/filesystem/directory_entry/assign.md @@ -57,5 +57,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/directory_entry/exists.md b/reference/filesystem/directory_entry/exists.md index b9c7fcf2d2..2b5d03195d 100644 --- a/reference/filesystem/directory_entry/exists.md +++ b/reference/filesystem/directory_entry/exists.md @@ -61,5 +61,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/directory_entry/file_size.md b/reference/filesystem/directory_entry/file_size.md index 563666e82e..f96bd8317d 100644 --- a/reference/filesystem/directory_entry/file_size.md +++ b/reference/filesystem/directory_entry/file_size.md @@ -70,5 +70,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/directory_entry/hard_link_count.md b/reference/filesystem/directory_entry/hard_link_count.md index d06abd0d8c..674f2afeb4 100644 --- a/reference/filesystem/directory_entry/hard_link_count.md +++ b/reference/filesystem/directory_entry/hard_link_count.md @@ -63,5 +63,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/directory_entry/is_block_file.md b/reference/filesystem/directory_entry/is_block_file.md index 162cc7c549..b9355c0482 100644 --- a/reference/filesystem/directory_entry/is_block_file.md +++ b/reference/filesystem/directory_entry/is_block_file.md @@ -61,5 +61,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/directory_entry/is_character_file.md b/reference/filesystem/directory_entry/is_character_file.md index 8833fd78c1..b481767996 100644 --- a/reference/filesystem/directory_entry/is_character_file.md +++ b/reference/filesystem/directory_entry/is_character_file.md @@ -61,5 +61,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/directory_entry/is_directory.md b/reference/filesystem/directory_entry/is_directory.md index c69e38fce4..ddb0c52e0b 100644 --- a/reference/filesystem/directory_entry/is_directory.md +++ b/reference/filesystem/directory_entry/is_directory.md @@ -61,5 +61,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/directory_entry/is_fifo.md b/reference/filesystem/directory_entry/is_fifo.md index c414d94b5c..7c478d1f0a 100644 --- a/reference/filesystem/directory_entry/is_fifo.md +++ b/reference/filesystem/directory_entry/is_fifo.md @@ -61,5 +61,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/directory_entry/is_other.md b/reference/filesystem/directory_entry/is_other.md index f2ccdfec1d..cc5fecb3d8 100644 --- a/reference/filesystem/directory_entry/is_other.md +++ b/reference/filesystem/directory_entry/is_other.md @@ -61,5 +61,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/directory_entry/is_regular_file.md b/reference/filesystem/directory_entry/is_regular_file.md index b089fb0865..c1e81139a1 100644 --- a/reference/filesystem/directory_entry/is_regular_file.md +++ b/reference/filesystem/directory_entry/is_regular_file.md @@ -61,5 +61,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/directory_entry/is_socket.md b/reference/filesystem/directory_entry/is_socket.md index cb849f99fc..266a521622 100644 --- a/reference/filesystem/directory_entry/is_socket.md +++ b/reference/filesystem/directory_entry/is_socket.md @@ -61,5 +61,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/directory_entry/is_symlink.md b/reference/filesystem/directory_entry/is_symlink.md index 7e5a838f19..299ddd0c27 100644 --- a/reference/filesystem/directory_entry/is_symlink.md +++ b/reference/filesystem/directory_entry/is_symlink.md @@ -64,5 +64,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/directory_entry/last_write_time.md b/reference/filesystem/directory_entry/last_write_time.md index 061aef1c63..ddcc12fb36 100644 --- a/reference/filesystem/directory_entry/last_write_time.md +++ b/reference/filesystem/directory_entry/last_write_time.md @@ -84,5 +84,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/directory_entry/op_compare_3way.md b/reference/filesystem/directory_entry/op_compare_3way.md index 1a2619d497..1a1f54479d 100644 --- a/reference/filesystem/directory_entry/op_compare_3way.md +++ b/reference/filesystem/directory_entry/op_compare_3way.md @@ -61,7 +61,7 @@ equal ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10 +- [GCC](/implementation.md#gcc): 10 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/filesystem/directory_entry/op_constructor.md b/reference/filesystem/directory_entry/op_constructor.md index be88b4f224..48611fcbcc 100644 --- a/reference/filesystem/directory_entry/op_constructor.md +++ b/reference/filesystem/directory_entry/op_constructor.md @@ -65,5 +65,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/directory_entry/op_equal.md b/reference/filesystem/directory_entry/op_equal.md index fc55346ccf..b3ad5fbf96 100644 --- a/reference/filesystem/directory_entry/op_equal.md +++ b/reference/filesystem/directory_entry/op_equal.md @@ -58,7 +58,7 @@ equal ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/directory_entry/op_greater.md b/reference/filesystem/directory_entry/op_greater.md index 72d8d33ab5..655c2db958 100644 --- a/reference/filesystem/directory_entry/op_greater.md +++ b/reference/filesystem/directory_entry/op_greater.md @@ -54,7 +54,7 @@ greater ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ## 参照 diff --git a/reference/filesystem/directory_entry/op_greater_equal.md b/reference/filesystem/directory_entry/op_greater_equal.md index 35e96dea3b..25a519cf90 100644 --- a/reference/filesystem/directory_entry/op_greater_equal.md +++ b/reference/filesystem/directory_entry/op_greater_equal.md @@ -54,7 +54,7 @@ greater equal ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ## 参照 diff --git a/reference/filesystem/directory_entry/op_less.md b/reference/filesystem/directory_entry/op_less.md index 73ddd958f5..8c7b2cc7ae 100644 --- a/reference/filesystem/directory_entry/op_less.md +++ b/reference/filesystem/directory_entry/op_less.md @@ -54,7 +54,7 @@ less ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ## 参照 diff --git a/reference/filesystem/directory_entry/op_less_equal.md b/reference/filesystem/directory_entry/op_less_equal.md index 996120600c..4fa955bec6 100644 --- a/reference/filesystem/directory_entry/op_less_equal.md +++ b/reference/filesystem/directory_entry/op_less_equal.md @@ -54,7 +54,7 @@ less equal ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ## 参照 diff --git a/reference/filesystem/directory_entry/op_not_equal.md b/reference/filesystem/directory_entry/op_not_equal.md index adc36a22f9..a56b607f1d 100644 --- a/reference/filesystem/directory_entry/op_not_equal.md +++ b/reference/filesystem/directory_entry/op_not_equal.md @@ -54,7 +54,7 @@ not equal ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ## 参照 diff --git a/reference/filesystem/directory_entry/op_path.md b/reference/filesystem/directory_entry/op_path.md index c173d6ece5..bfb26e2d3d 100644 --- a/reference/filesystem/directory_entry/op_path.md +++ b/reference/filesystem/directory_entry/op_path.md @@ -56,5 +56,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/directory_entry/path.md b/reference/filesystem/directory_entry/path.md index f100db6a8b..a06d59e70f 100644 --- a/reference/filesystem/directory_entry/path.md +++ b/reference/filesystem/directory_entry/path.md @@ -57,5 +57,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/directory_entry/refresh.md b/reference/filesystem/directory_entry/refresh.md index 25c1020160..4abcd1580a 100644 --- a/reference/filesystem/directory_entry/refresh.md +++ b/reference/filesystem/directory_entry/refresh.md @@ -93,5 +93,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/directory_entry/replace_filename.md b/reference/filesystem/directory_entry/replace_filename.md index 8189b8954b..6fb6d1a9a5 100644 --- a/reference/filesystem/directory_entry/replace_filename.md +++ b/reference/filesystem/directory_entry/replace_filename.md @@ -70,5 +70,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/directory_entry/status.md b/reference/filesystem/directory_entry/status.md index 285da7a9c2..6f3f77acb6 100644 --- a/reference/filesystem/directory_entry/status.md +++ b/reference/filesystem/directory_entry/status.md @@ -85,5 +85,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/directory_entry/symlink_status.md b/reference/filesystem/directory_entry/symlink_status.md index 72707e1fed..2850821334 100644 --- a/reference/filesystem/directory_entry/symlink_status.md +++ b/reference/filesystem/directory_entry/symlink_status.md @@ -88,5 +88,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/directory_iterator.md b/reference/filesystem/directory_iterator.md index 94b9c20510..a3831c57e3 100644 --- a/reference/filesystem/directory_iterator.md +++ b/reference/filesystem/directory_iterator.md @@ -96,7 +96,7 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/directory_iterator/begin_free.md b/reference/filesystem/directory_iterator/begin_free.md index f7605ba581..221e93e2b6 100644 --- a/reference/filesystem/directory_iterator/begin_free.md +++ b/reference/filesystem/directory_iterator/begin_free.md @@ -62,6 +62,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/directory_iterator/end_free.md b/reference/filesystem/directory_iterator/end_free.md index 0e384ee887..e1e8bf1f01 100644 --- a/reference/filesystem/directory_iterator/end_free.md +++ b/reference/filesystem/directory_iterator/end_free.md @@ -63,6 +63,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/directory_iterator/increment.md b/reference/filesystem/directory_iterator/increment.md index cba9bb5535..7f95845dd5 100644 --- a/reference/filesystem/directory_iterator/increment.md +++ b/reference/filesystem/directory_iterator/increment.md @@ -67,8 +67,8 @@ after : "dir/a.txt" - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/directory_iterator/op_arrow.md b/reference/filesystem/directory_iterator/op_arrow.md index 8fc0a7c918..52b6dc1ac6 100644 --- a/reference/filesystem/directory_iterator/op_arrow.md +++ b/reference/filesystem/directory_iterator/op_arrow.md @@ -49,6 +49,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/directory_iterator/op_assign.md b/reference/filesystem/directory_iterator/op_assign.md index bb7b8a8d6b..2853ca9c08 100644 --- a/reference/filesystem/directory_iterator/op_assign.md +++ b/reference/filesystem/directory_iterator/op_assign.md @@ -68,6 +68,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/directory_iterator/op_constructor.md b/reference/filesystem/directory_iterator/op_constructor.md index 0bb967aefe..8b5d4a044d 100644 --- a/reference/filesystem/directory_iterator/op_constructor.md +++ b/reference/filesystem/directory_iterator/op_constructor.md @@ -109,8 +109,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/directory_iterator/op_deref.md b/reference/filesystem/directory_iterator/op_deref.md index 1f51d5068b..0407d159de 100644 --- a/reference/filesystem/directory_iterator/op_deref.md +++ b/reference/filesystem/directory_iterator/op_deref.md @@ -51,6 +51,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/directory_iterator/op_equal.md b/reference/filesystem/directory_iterator/op_equal.md index de0d501625..80e2a9b21e 100644 --- a/reference/filesystem/directory_iterator/op_equal.md +++ b/reference/filesystem/directory_iterator/op_equal.md @@ -51,6 +51,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/directory_iterator/op_increment.md b/reference/filesystem/directory_iterator/op_increment.md index 8db27358c4..e0b5affc1d 100644 --- a/reference/filesystem/directory_iterator/op_increment.md +++ b/reference/filesystem/directory_iterator/op_increment.md @@ -64,6 +64,6 @@ after : "dir/a.txt" - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/directory_iterator/op_not_equal.md b/reference/filesystem/directory_iterator/op_not_equal.md index 92ce4b98b7..1f82ceb532 100644 --- a/reference/filesystem/directory_iterator/op_not_equal.md +++ b/reference/filesystem/directory_iterator/op_not_equal.md @@ -50,6 +50,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/directory_options.md b/reference/filesystem/directory_options.md index f9c94c1498..853923075b 100644 --- a/reference/filesystem/directory_options.md +++ b/reference/filesystem/directory_options.md @@ -70,6 +70,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.2 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.2 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/equivalent.md b/reference/filesystem/equivalent.md index 0105fafc53..b016213a7a 100644 --- a/reference/filesystem/equivalent.md +++ b/reference/filesystem/equivalent.md @@ -73,6 +73,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/exists.md b/reference/filesystem/exists.md index 8508e8552a..912e2253da 100644 --- a/reference/filesystem/exists.md +++ b/reference/filesystem/exists.md @@ -89,6 +89,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/file_size.md b/reference/filesystem/file_size.md index 07c94ab692..d427b5cd03 100644 --- a/reference/filesystem/file_size.md +++ b/reference/filesystem/file_size.md @@ -68,6 +68,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/file_status.md b/reference/filesystem/file_status.md index 419587bf25..573c071554 100644 --- a/reference/filesystem/file_status.md +++ b/reference/filesystem/file_status.md @@ -74,6 +74,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/file_status/op_constructor.md b/reference/filesystem/file_status/op_constructor.md index 740fc9469e..619a7194db 100644 --- a/reference/filesystem/file_status/op_constructor.md +++ b/reference/filesystem/file_status/op_constructor.md @@ -60,5 +60,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 4.8.1 +- [GCC](/implementation.md#gcc): 4.8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/file_status/op_equal.md b/reference/filesystem/file_status/op_equal.md index 94e9e52891..001732febe 100644 --- a/reference/filesystem/file_status/op_equal.md +++ b/reference/filesystem/file_status/op_equal.md @@ -57,7 +57,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10 +- [GCC](/implementation.md#gcc): 10 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/filesystem/file_status/permissions.md b/reference/filesystem/file_status/permissions.md index dc48efa54b..ea22e7a27b 100644 --- a/reference/filesystem/file_status/permissions.md +++ b/reference/filesystem/file_status/permissions.md @@ -52,5 +52,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/file_status/type.md b/reference/filesystem/file_status/type.md index 77583de5b9..d33629d02e 100644 --- a/reference/filesystem/file_status/type.md +++ b/reference/filesystem/file_status/type.md @@ -52,5 +52,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/file_time_type.md b/reference/filesystem/file_time_type.md index fcb3a3b7bf..377840dbce 100644 --- a/reference/filesystem/file_time_type.md +++ b/reference/filesystem/file_time_type.md @@ -128,8 +128,8 @@ dir time : Wed Jul 15 23:08:06 2020 - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/file_type.md b/reference/filesystem/file_type.md index 52646f3682..eb4886f6ab 100644 --- a/reference/filesystem/file_type.md +++ b/reference/filesystem/file_type.md @@ -111,8 +111,8 @@ regular file - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/filesystem_error.md b/reference/filesystem/filesystem_error.md index 449928c39a..eaa537c59a 100644 --- a/reference/filesystem/filesystem_error.md +++ b/reference/filesystem/filesystem_error.md @@ -63,6 +63,6 @@ filesystem error: cannot copy file: No such file or directory [a/from.txt] [b/to - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/filesystem_error/code.md b/reference/filesystem/filesystem_error/code.md index 682f784ef9..a17e7e6fa9 100644 --- a/reference/filesystem/filesystem_error/code.md +++ b/reference/filesystem/filesystem_error/code.md @@ -53,5 +53,5 @@ generic:2 ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/filesystem_error/op_constructor.md b/reference/filesystem/filesystem_error/op_constructor.md index 45c30a329b..4c46667980 100644 --- a/reference/filesystem/filesystem_error/op_constructor.md +++ b/reference/filesystem/filesystem_error/op_constructor.md @@ -115,7 +115,7 @@ filesystem error: can't copy file. source file doesn't found: No such file or di ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 4.8.1 +- [GCC](/implementation.md#gcc): 4.8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/filesystem_error/path1.md b/reference/filesystem/filesystem_error/path1.md index 9c6ed6a8cb..197a5b6922 100644 --- a/reference/filesystem/filesystem_error/path1.md +++ b/reference/filesystem/filesystem_error/path1.md @@ -58,5 +58,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/filesystem_error/path2.md b/reference/filesystem/filesystem_error/path2.md index b5f0400d48..d38e955aaf 100644 --- a/reference/filesystem/filesystem_error/path2.md +++ b/reference/filesystem/filesystem_error/path2.md @@ -58,5 +58,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/filesystem_error/what.md b/reference/filesystem/filesystem_error/what.md index 1bd430f4de..ed147a12ee 100644 --- a/reference/filesystem/filesystem_error/what.md +++ b/reference/filesystem/filesystem_error/what.md @@ -54,7 +54,7 @@ filesystem error: can't copy file. source file doesn't found: No such file or di ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/hard_link_count.md b/reference/filesystem/hard_link_count.md index 5a2e1f99f8..02b2f20ed5 100644 --- a/reference/filesystem/hard_link_count.md +++ b/reference/filesystem/hard_link_count.md @@ -59,6 +59,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/is_block_file.md b/reference/filesystem/is_block_file.md index d6eac89c3b..8343461380 100644 --- a/reference/filesystem/is_block_file.md +++ b/reference/filesystem/is_block_file.md @@ -92,6 +92,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/is_character_file.md b/reference/filesystem/is_character_file.md index 0854eec9ef..40acbaea28 100644 --- a/reference/filesystem/is_character_file.md +++ b/reference/filesystem/is_character_file.md @@ -92,6 +92,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/is_directory.md b/reference/filesystem/is_directory.md index 0b13668c16..90cc5e1399 100644 --- a/reference/filesystem/is_directory.md +++ b/reference/filesystem/is_directory.md @@ -95,6 +95,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/is_empty.md b/reference/filesystem/is_empty.md index da4477e9d3..8e79fb66ef 100644 --- a/reference/filesystem/is_empty.md +++ b/reference/filesystem/is_empty.md @@ -73,8 +73,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/is_fifo.md b/reference/filesystem/is_fifo.md index 2fc2882af1..3ddfd4df71 100644 --- a/reference/filesystem/is_fifo.md +++ b/reference/filesystem/is_fifo.md @@ -93,6 +93,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/is_other.md b/reference/filesystem/is_other.md index a9ebc516ad..c08eb6cb6f 100644 --- a/reference/filesystem/is_other.md +++ b/reference/filesystem/is_other.md @@ -89,6 +89,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/is_regular_file.md b/reference/filesystem/is_regular_file.md index c134e3a55a..6260bb6d27 100644 --- a/reference/filesystem/is_regular_file.md +++ b/reference/filesystem/is_regular_file.md @@ -97,6 +97,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/is_socket.md b/reference/filesystem/is_socket.md index 70b7595934..56f6b6a532 100644 --- a/reference/filesystem/is_socket.md +++ b/reference/filesystem/is_socket.md @@ -99,6 +99,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/is_symlink.md b/reference/filesystem/is_symlink.md index c5146d1aaa..16f076dc03 100644 --- a/reference/filesystem/is_symlink.md +++ b/reference/filesystem/is_symlink.md @@ -96,6 +96,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/last_write_time.md b/reference/filesystem/last_write_time.md index c5731d1d57..644f280354 100644 --- a/reference/filesystem/last_write_time.md +++ b/reference/filesystem/last_write_time.md @@ -96,6 +96,6 @@ dir time : Fri Jun 15 14:19:03 2018 - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/path.md b/reference/filesystem/path.md index 4d29d5e374..2ee24d21ea 100644 --- a/reference/filesystem/path.md +++ b/reference/filesystem/path.md @@ -287,7 +287,7 @@ generic format : C:/a/b/c.txt - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/append.md b/reference/filesystem/path/append.md index 35d724ef06..f21ca56148 100644 --- a/reference/filesystem/path/append.md +++ b/reference/filesystem/path/append.md @@ -170,8 +170,8 @@ h : "D:bar" ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] ### 備考 - GCC 8.1 (SVN) の`operator/=`では、ルートディレクトリを持つパスを加算すると、左辺が削除されないバグがある diff --git a/reference/filesystem/path/assign.md b/reference/filesystem/path/assign.md index aded291aa5..2beda0b64e 100644 --- a/reference/filesystem/path/assign.md +++ b/reference/filesystem/path/assign.md @@ -147,5 +147,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/begin.md b/reference/filesystem/path/begin.md index ed913e7c6c..be21ad61d0 100644 --- a/reference/filesystem/path/begin.md +++ b/reference/filesystem/path/begin.md @@ -92,5 +92,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/c_str.md b/reference/filesystem/path/c_str.md index 4a8a0d9986..f6b16311de 100644 --- a/reference/filesystem/path/c_str.md +++ b/reference/filesystem/path/c_str.md @@ -71,5 +71,5 @@ foo/bar ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/clear.md b/reference/filesystem/path/clear.md index 5338a6d483..0423ecceb6 100644 --- a/reference/filesystem/path/clear.md +++ b/reference/filesystem/path/clear.md @@ -51,5 +51,5 @@ cleared ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/compare.md b/reference/filesystem/path/compare.md index ef2444e911..76d715fe4e 100644 --- a/reference/filesystem/path/compare.md +++ b/reference/filesystem/path/compare.md @@ -65,5 +65,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/concat.md b/reference/filesystem/path/concat.md index 4e9c326d2c..b624572d63 100644 --- a/reference/filesystem/path/concat.md +++ b/reference/filesystem/path/concat.md @@ -72,5 +72,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/empty.md b/reference/filesystem/path/empty.md index 9b212737e8..1de60dc181 100644 --- a/reference/filesystem/path/empty.md +++ b/reference/filesystem/path/empty.md @@ -52,8 +52,8 @@ p2 : not empty ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] ## 参照 diff --git a/reference/filesystem/path/end.md b/reference/filesystem/path/end.md index 4059a501b4..5bb4d56ea8 100644 --- a/reference/filesystem/path/end.md +++ b/reference/filesystem/path/end.md @@ -92,5 +92,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/extension.md b/reference/filesystem/path/extension.md index dd7c61038d..463cb4289d 100644 --- a/reference/filesystem/path/extension.md +++ b/reference/filesystem/path/extension.md @@ -100,6 +100,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 9.0 -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [Clang](/implementation.md#clang): 9.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/filename.md b/reference/filesystem/path/filename.md index 6c9d5cb85e..6fa4407a6b 100644 --- a/reference/filesystem/path/filename.md +++ b/reference/filesystem/path/filename.md @@ -103,5 +103,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/format.md b/reference/filesystem/path/format.md index f885f230f0..74b4f618a9 100644 --- a/reference/filesystem/path/format.md +++ b/reference/filesystem/path/format.md @@ -31,8 +31,8 @@ namespace std::filesystem { ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] ## 参照 diff --git a/reference/filesystem/path/generic_string.md b/reference/filesystem/path/generic_string.md index 3b872aab58..ee4f40f421 100644 --- a/reference/filesystem/path/generic_string.md +++ b/reference/filesystem/path/generic_string.md @@ -119,5 +119,5 @@ foo/bar ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/generic_u16string.md b/reference/filesystem/path/generic_u16string.md index 4b4da8d10d..b1f5b20a73 100644 --- a/reference/filesystem/path/generic_u16string.md +++ b/reference/filesystem/path/generic_u16string.md @@ -66,5 +66,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/generic_u32string.md b/reference/filesystem/path/generic_u32string.md index 6dcf62831e..98b2f7b42d 100644 --- a/reference/filesystem/path/generic_u32string.md +++ b/reference/filesystem/path/generic_u32string.md @@ -66,5 +66,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/generic_u8string.md b/reference/filesystem/path/generic_u8string.md index 90d1a0e857..c0c4a325ad 100644 --- a/reference/filesystem/path/generic_u8string.md +++ b/reference/filesystem/path/generic_u8string.md @@ -76,8 +76,8 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] ## 関連項目 diff --git a/reference/filesystem/path/generic_wstring.md b/reference/filesystem/path/generic_wstring.md index be50b107c8..b001767a91 100644 --- a/reference/filesystem/path/generic_wstring.md +++ b/reference/filesystem/path/generic_wstring.md @@ -52,5 +52,5 @@ foo/bar ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/has_extension.md b/reference/filesystem/path/has_extension.md index 9ccd953c83..62931977a9 100644 --- a/reference/filesystem/path/has_extension.md +++ b/reference/filesystem/path/has_extension.md @@ -99,5 +99,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/has_filename.md b/reference/filesystem/path/has_filename.md index 6f03b7e0a6..14f13a0318 100644 --- a/reference/filesystem/path/has_filename.md +++ b/reference/filesystem/path/has_filename.md @@ -99,5 +99,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/has_parent_path.md b/reference/filesystem/path/has_parent_path.md index d336c8d9fa..5557b5db12 100644 --- a/reference/filesystem/path/has_parent_path.md +++ b/reference/filesystem/path/has_parent_path.md @@ -103,5 +103,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/has_relative_path.md b/reference/filesystem/path/has_relative_path.md index b4c5730df8..90cccc0f69 100644 --- a/reference/filesystem/path/has_relative_path.md +++ b/reference/filesystem/path/has_relative_path.md @@ -103,5 +103,5 @@ has relative path from root path ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/has_root_directory.md b/reference/filesystem/path/has_root_directory.md index 89a03848d8..113c21436d 100644 --- a/reference/filesystem/path/has_root_directory.md +++ b/reference/filesystem/path/has_root_directory.md @@ -93,5 +93,5 @@ has root directory ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/has_root_name.md b/reference/filesystem/path/has_root_name.md index 51440912fb..e79fc22ed7 100644 --- a/reference/filesystem/path/has_root_name.md +++ b/reference/filesystem/path/has_root_name.md @@ -93,5 +93,5 @@ has root name ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/has_root_path.md b/reference/filesystem/path/has_root_path.md index f74c5edafd..2d23438e35 100644 --- a/reference/filesystem/path/has_root_path.md +++ b/reference/filesystem/path/has_root_path.md @@ -93,5 +93,5 @@ has root path ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/has_stem.md b/reference/filesystem/path/has_stem.md index 945860d946..2a1e863ba0 100644 --- a/reference/filesystem/path/has_stem.md +++ b/reference/filesystem/path/has_stem.md @@ -99,5 +99,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/hash_value.md b/reference/filesystem/path/hash_value.md index 67c39da23c..fe73024256 100644 --- a/reference/filesystem/path/hash_value.md +++ b/reference/filesystem/path/hash_value.md @@ -46,5 +46,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/is_absolute.md b/reference/filesystem/path/is_absolute.md index 576d64d2e9..d84d415e30 100644 --- a/reference/filesystem/path/is_absolute.md +++ b/reference/filesystem/path/is_absolute.md @@ -102,8 +102,8 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] ## 参照 diff --git a/reference/filesystem/path/is_relative.md b/reference/filesystem/path/is_relative.md index 7da22d2ec7..ca4819aeb4 100644 --- a/reference/filesystem/path/is_relative.md +++ b/reference/filesystem/path/is_relative.md @@ -100,5 +100,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/iterator.md b/reference/filesystem/path/iterator.md index 3f6210116d..c6f1520ab4 100644 --- a/reference/filesystem/path/iterator.md +++ b/reference/filesystem/path/iterator.md @@ -125,8 +125,8 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] ## 関連項目 diff --git a/reference/filesystem/path/lexically_normal.md b/reference/filesystem/path/lexically_normal.md index 338dc88893..a40bdcb215 100644 --- a/reference/filesystem/path/lexically_normal.md +++ b/reference/filesystem/path/lexically_normal.md @@ -67,5 +67,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/lexically_proximate.md b/reference/filesystem/path/lexically_proximate.md index 7491a7efb2..8fc7d509b1 100644 --- a/reference/filesystem/path/lexically_proximate.md +++ b/reference/filesystem/path/lexically_proximate.md @@ -57,5 +57,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/lexically_relative.md b/reference/filesystem/path/lexically_relative.md index efd8b4fe11..6ef7bf47fe 100644 --- a/reference/filesystem/path/lexically_relative.md +++ b/reference/filesystem/path/lexically_relative.md @@ -63,5 +63,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/make_preferred.md b/reference/filesystem/path/make_preferred.md index c442c252de..ba22bcdb4a 100644 --- a/reference/filesystem/path/make_preferred.md +++ b/reference/filesystem/path/make_preferred.md @@ -78,5 +78,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/native.md b/reference/filesystem/path/native.md index 41c871470c..b8cf9aef99 100644 --- a/reference/filesystem/path/native.md +++ b/reference/filesystem/path/native.md @@ -71,5 +71,5 @@ foo/bar ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/op_append.md b/reference/filesystem/path/op_append.md index db3dbe49dd..d7a508195e 100644 --- a/reference/filesystem/path/op_append.md +++ b/reference/filesystem/path/op_append.md @@ -153,5 +153,5 @@ h : "D:bar" ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/op_append_assign.md b/reference/filesystem/path/op_append_assign.md index 9640e45dff..b36afc3f07 100644 --- a/reference/filesystem/path/op_append_assign.md +++ b/reference/filesystem/path/op_append_assign.md @@ -174,8 +174,8 @@ h : "D:bar" ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] ### 備考 - GCC 8.1 (SVN) の`operator/=`では、ルートディレクトリを持つパスを加算すると、左辺が削除されないバグがある diff --git a/reference/filesystem/path/op_assign.md b/reference/filesystem/path/op_assign.md index 9fd0a1d057..34f0d2ec4d 100644 --- a/reference/filesystem/path/op_assign.md +++ b/reference/filesystem/path/op_assign.md @@ -146,5 +146,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/op_compare_3way.md b/reference/filesystem/path/op_compare_3way.md index b6ca289fa9..f72a07bf33 100644 --- a/reference/filesystem/path/op_compare_3way.md +++ b/reference/filesystem/path/op_compare_3way.md @@ -62,7 +62,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10 +- [GCC](/implementation.md#gcc): 10 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/filesystem/path/op_constructor.md b/reference/filesystem/path/op_constructor.md index 71b931945c..5308621fb8 100644 --- a/reference/filesystem/path/op_constructor.md +++ b/reference/filesystem/path/op_constructor.md @@ -190,8 +190,8 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] ## 関連項目 diff --git a/reference/filesystem/path/op_equal.md b/reference/filesystem/path/op_equal.md index fe27e58ec5..7f109b846e 100644 --- a/reference/filesystem/path/op_equal.md +++ b/reference/filesystem/path/op_equal.md @@ -73,8 +73,8 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] ## 参照 diff --git a/reference/filesystem/path/op_greater.md b/reference/filesystem/path/op_greater.md index b1f0f48c0f..7d7db65903 100644 --- a/reference/filesystem/path/op_greater.md +++ b/reference/filesystem/path/op_greater.md @@ -48,8 +48,8 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] ## 参照 diff --git a/reference/filesystem/path/op_greater_equal.md b/reference/filesystem/path/op_greater_equal.md index c5b4393f75..58d819157a 100644 --- a/reference/filesystem/path/op_greater_equal.md +++ b/reference/filesystem/path/op_greater_equal.md @@ -50,8 +50,8 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] ## 参照 diff --git a/reference/filesystem/path/op_istream.md b/reference/filesystem/path/op_istream.md index 929b607d0e..0a0fc012fd 100644 --- a/reference/filesystem/path/op_istream.md +++ b/reference/filesystem/path/op_istream.md @@ -101,8 +101,8 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] ## 参照 diff --git a/reference/filesystem/path/op_less.md b/reference/filesystem/path/op_less.md index ff6b6d9ea4..ef0ec288a7 100644 --- a/reference/filesystem/path/op_less.md +++ b/reference/filesystem/path/op_less.md @@ -49,8 +49,8 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) diff --git a/reference/filesystem/path/op_less_equal.md b/reference/filesystem/path/op_less_equal.md index 4df566923c..69f3593615 100644 --- a/reference/filesystem/path/op_less_equal.md +++ b/reference/filesystem/path/op_less_equal.md @@ -50,8 +50,8 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] ## 参照 diff --git a/reference/filesystem/path/op_not_equal.md b/reference/filesystem/path/op_not_equal.md index cd5627c313..29d4a6fce9 100644 --- a/reference/filesystem/path/op_not_equal.md +++ b/reference/filesystem/path/op_not_equal.md @@ -55,8 +55,8 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] ## 参照 diff --git a/reference/filesystem/path/op_ostream.md b/reference/filesystem/path/op_ostream.md index 8e05a8d2db..3f7712eafd 100644 --- a/reference/filesystem/path/op_ostream.md +++ b/reference/filesystem/path/op_ostream.md @@ -83,8 +83,8 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] ## 参照 diff --git a/reference/filesystem/path/op_plus_assign.md b/reference/filesystem/path/op_plus_assign.md index 211695b7ab..16b766c8d7 100644 --- a/reference/filesystem/path/op_plus_assign.md +++ b/reference/filesystem/path/op_plus_assign.md @@ -73,5 +73,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/op_string_type.md b/reference/filesystem/path/op_string_type.md index d804d4e42d..9fa5813948 100644 --- a/reference/filesystem/path/op_string_type.md +++ b/reference/filesystem/path/op_string_type.md @@ -69,5 +69,5 @@ foo/bar ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/parent_path.md b/reference/filesystem/path/parent_path.md index 54dbd7913c..dcfc3a2214 100644 --- a/reference/filesystem/path/parent_path.md +++ b/reference/filesystem/path/parent_path.md @@ -89,8 +89,8 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] ## 参照 diff --git a/reference/filesystem/path/relative_path.md b/reference/filesystem/path/relative_path.md index 968f547be4..c6d29dc52a 100644 --- a/reference/filesystem/path/relative_path.md +++ b/reference/filesystem/path/relative_path.md @@ -81,5 +81,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/remove_filename.md b/reference/filesystem/path/remove_filename.md index 9f03e9d82f..1391fa0f0c 100644 --- a/reference/filesystem/path/remove_filename.md +++ b/reference/filesystem/path/remove_filename.md @@ -108,5 +108,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/replace_extension.md b/reference/filesystem/path/replace_extension.md index 10ba6a7e4d..3c983b954f 100644 --- a/reference/filesystem/path/replace_extension.md +++ b/reference/filesystem/path/replace_extension.md @@ -64,5 +64,5 @@ p3 : "/foo.md" ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/replace_filename.md b/reference/filesystem/path/replace_filename.md index b3728a5439..a6c1917fef 100644 --- a/reference/filesystem/path/replace_filename.md +++ b/reference/filesystem/path/replace_filename.md @@ -69,5 +69,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/root_directory.md b/reference/filesystem/path/root_directory.md index c202f6840b..5a64996d77 100644 --- a/reference/filesystem/path/root_directory.md +++ b/reference/filesystem/path/root_directory.md @@ -74,5 +74,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/root_name.md b/reference/filesystem/path/root_name.md index 5fc87fa5d6..9727c59b28 100644 --- a/reference/filesystem/path/root_name.md +++ b/reference/filesystem/path/root_name.md @@ -77,5 +77,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/root_path.md b/reference/filesystem/path/root_path.md index 65ae43c0c7..17ee74baaf 100644 --- a/reference/filesystem/path/root_path.md +++ b/reference/filesystem/path/root_path.md @@ -78,5 +78,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/stem.md b/reference/filesystem/path/stem.md index 8eaa0efc77..9d2902b36d 100644 --- a/reference/filesystem/path/stem.md +++ b/reference/filesystem/path/stem.md @@ -99,6 +99,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 9.0 -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [Clang](/implementation.md#clang): 9.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/string.md b/reference/filesystem/path/string.md index 7df1ad64ac..3503db135d 100644 --- a/reference/filesystem/path/string.md +++ b/reference/filesystem/path/string.md @@ -119,5 +119,5 @@ foo/bar ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/swap.md b/reference/filesystem/path/swap.md index 19d0de12d6..f89875f5b5 100644 --- a/reference/filesystem/path/swap.md +++ b/reference/filesystem/path/swap.md @@ -57,5 +57,5 @@ b : "/foo/a.txt" ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/swap_free.md b/reference/filesystem/path/swap_free.md index 0914f7929b..7d60ce8c2c 100644 --- a/reference/filesystem/path/swap_free.md +++ b/reference/filesystem/path/swap_free.md @@ -54,5 +54,5 @@ b : "/foo/a.txt" ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/u16string.md b/reference/filesystem/path/u16string.md index 11d724f591..4b1767fcdc 100644 --- a/reference/filesystem/path/u16string.md +++ b/reference/filesystem/path/u16string.md @@ -65,5 +65,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/u32string.md b/reference/filesystem/path/u32string.md index 13ebb7d0c3..b50427a4dc 100644 --- a/reference/filesystem/path/u32string.md +++ b/reference/filesystem/path/u32string.md @@ -65,5 +65,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/path/u8string.md b/reference/filesystem/path/u8string.md index e8e2e6c7bc..bdc01f02cc 100644 --- a/reference/filesystem/path/u8string.md +++ b/reference/filesystem/path/u8string.md @@ -76,8 +76,8 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] ## 関連項目 diff --git a/reference/filesystem/path/wstring.md b/reference/filesystem/path/wstring.md index 20bb7df46c..885f0c15b0 100644 --- a/reference/filesystem/path/wstring.md +++ b/reference/filesystem/path/wstring.md @@ -52,5 +52,5 @@ foo/bar ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/perm_options.md b/reference/filesystem/perm_options.md index 7262aa7519..0a2c44482f 100644 --- a/reference/filesystem/perm_options.md +++ b/reference/filesystem/perm_options.md @@ -60,6 +60,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/permissions.md b/reference/filesystem/permissions.md index e691e841f7..c5feedc314 100644 --- a/reference/filesystem/permissions.md +++ b/reference/filesystem/permissions.md @@ -61,8 +61,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/perms.md b/reference/filesystem/perms.md index 82a69422c8..94e5f56c69 100644 --- a/reference/filesystem/perms.md +++ b/reference/filesystem/perms.md @@ -95,6 +95,6 @@ owner can write the file - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/proximate.md b/reference/filesystem/proximate.md index 4a22422ff6..86623aea14 100644 --- a/reference/filesystem/proximate.md +++ b/reference/filesystem/proximate.md @@ -67,6 +67,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/read_symlink.md b/reference/filesystem/read_symlink.md index 52ecac84b9..5fbd57711b 100644 --- a/reference/filesystem/read_symlink.md +++ b/reference/filesystem/read_symlink.md @@ -57,6 +57,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/recursive_directory_iterator.md b/reference/filesystem/recursive_directory_iterator.md index 5aab4c90de..53a0e879b1 100644 --- a/reference/filesystem/recursive_directory_iterator.md +++ b/reference/filesystem/recursive_directory_iterator.md @@ -115,7 +115,7 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/recursive_directory_iterator/begin_free.md b/reference/filesystem/recursive_directory_iterator/begin_free.md index 4270a9c4bf..efb7583203 100644 --- a/reference/filesystem/recursive_directory_iterator/begin_free.md +++ b/reference/filesystem/recursive_directory_iterator/begin_free.md @@ -62,6 +62,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/recursive_directory_iterator/depth.md b/reference/filesystem/recursive_directory_iterator/depth.md index b5ee3c0f22..24c85b9853 100644 --- a/reference/filesystem/recursive_directory_iterator/depth.md +++ b/reference/filesystem/recursive_directory_iterator/depth.md @@ -61,6 +61,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/recursive_directory_iterator/disable_recursion_pending.md b/reference/filesystem/recursive_directory_iterator/disable_recursion_pending.md index b76a89e77d..e0c8afcd2c 100644 --- a/reference/filesystem/recursive_directory_iterator/disable_recursion_pending.md +++ b/reference/filesystem/recursive_directory_iterator/disable_recursion_pending.md @@ -64,6 +64,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/recursive_directory_iterator/end_free.md b/reference/filesystem/recursive_directory_iterator/end_free.md index b98184274c..9c55a9f8cf 100644 --- a/reference/filesystem/recursive_directory_iterator/end_free.md +++ b/reference/filesystem/recursive_directory_iterator/end_free.md @@ -63,6 +63,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/recursive_directory_iterator/increment.md b/reference/filesystem/recursive_directory_iterator/increment.md index 51f1bffcd4..f672af53bd 100644 --- a/reference/filesystem/recursive_directory_iterator/increment.md +++ b/reference/filesystem/recursive_directory_iterator/increment.md @@ -67,8 +67,8 @@ after : "dir/a.txt" - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/recursive_directory_iterator/op_arrow.md b/reference/filesystem/recursive_directory_iterator/op_arrow.md index 1d13e54535..e223b0e083 100644 --- a/reference/filesystem/recursive_directory_iterator/op_arrow.md +++ b/reference/filesystem/recursive_directory_iterator/op_arrow.md @@ -49,6 +49,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/recursive_directory_iterator/op_assign.md b/reference/filesystem/recursive_directory_iterator/op_assign.md index 29248ba168..b044344914 100644 --- a/reference/filesystem/recursive_directory_iterator/op_assign.md +++ b/reference/filesystem/recursive_directory_iterator/op_assign.md @@ -76,6 +76,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/recursive_directory_iterator/op_constructor.md b/reference/filesystem/recursive_directory_iterator/op_constructor.md index 57545d5b33..6a4ed5f22f 100644 --- a/reference/filesystem/recursive_directory_iterator/op_constructor.md +++ b/reference/filesystem/recursive_directory_iterator/op_constructor.md @@ -111,8 +111,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/recursive_directory_iterator/op_deref.md b/reference/filesystem/recursive_directory_iterator/op_deref.md index 0822810608..a4c85df55d 100644 --- a/reference/filesystem/recursive_directory_iterator/op_deref.md +++ b/reference/filesystem/recursive_directory_iterator/op_deref.md @@ -51,6 +51,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/recursive_directory_iterator/op_equal.md b/reference/filesystem/recursive_directory_iterator/op_equal.md index cec716ec7d..ab3ded2de8 100644 --- a/reference/filesystem/recursive_directory_iterator/op_equal.md +++ b/reference/filesystem/recursive_directory_iterator/op_equal.md @@ -52,6 +52,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/recursive_directory_iterator/op_increment.md b/reference/filesystem/recursive_directory_iterator/op_increment.md index 7243621fd1..981b1a7378 100644 --- a/reference/filesystem/recursive_directory_iterator/op_increment.md +++ b/reference/filesystem/recursive_directory_iterator/op_increment.md @@ -64,6 +64,6 @@ after : "dir/a.txt" - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/recursive_directory_iterator/op_not_equal.md b/reference/filesystem/recursive_directory_iterator/op_not_equal.md index 42b30a6de5..39f7313546 100644 --- a/reference/filesystem/recursive_directory_iterator/op_not_equal.md +++ b/reference/filesystem/recursive_directory_iterator/op_not_equal.md @@ -51,6 +51,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/recursive_directory_iterator/options.md b/reference/filesystem/recursive_directory_iterator/options.md index 9b920d5c49..a3ebee98a6 100644 --- a/reference/filesystem/recursive_directory_iterator/options.md +++ b/reference/filesystem/recursive_directory_iterator/options.md @@ -51,6 +51,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/recursive_directory_iterator/pop.md b/reference/filesystem/recursive_directory_iterator/pop.md index d71229cb81..1a0e307278 100644 --- a/reference/filesystem/recursive_directory_iterator/pop.md +++ b/reference/filesystem/recursive_directory_iterator/pop.md @@ -65,8 +65,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/recursive_directory_iterator/recursion_pending.md b/reference/filesystem/recursive_directory_iterator/recursion_pending.md index 5e3afd7b2d..fac527fd28 100644 --- a/reference/filesystem/recursive_directory_iterator/recursion_pending.md +++ b/reference/filesystem/recursive_directory_iterator/recursion_pending.md @@ -64,6 +64,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/relative.md b/reference/filesystem/relative.md index 9e24f4ce84..2492f168ad 100644 --- a/reference/filesystem/relative.md +++ b/reference/filesystem/relative.md @@ -66,6 +66,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/remove.md b/reference/filesystem/remove.md index 7b2cfa6f4b..ba301f3a68 100644 --- a/reference/filesystem/remove.md +++ b/reference/filesystem/remove.md @@ -74,6 +74,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/remove_all.md b/reference/filesystem/remove_all.md index ac7f89e8df..f9131f3ed5 100644 --- a/reference/filesystem/remove_all.md +++ b/reference/filesystem/remove_all.md @@ -79,8 +79,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/rename.md b/reference/filesystem/rename.md index f4d23b96bc..34b9b82ace 100644 --- a/reference/filesystem/rename.md +++ b/reference/filesystem/rename.md @@ -103,6 +103,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/resize_file.md b/reference/filesystem/resize_file.md index acbc12041c..5cb3940aae 100644 --- a/reference/filesystem/resize_file.md +++ b/reference/filesystem/resize_file.md @@ -71,8 +71,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/space.md b/reference/filesystem/space.md index 58a48ef390..c82e9d9cd8 100644 --- a/reference/filesystem/space.md +++ b/reference/filesystem/space.md @@ -79,6 +79,6 @@ available : 1048580096[B] (1000[MB]) - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/space_info.md b/reference/filesystem/space_info.md index 8f6e5d7b1b..e51642897d 100644 --- a/reference/filesystem/space_info.md +++ b/reference/filesystem/space_info.md @@ -80,8 +80,8 @@ available : 1048580096[B] (1000[MB]) - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/status.md b/reference/filesystem/status.md index c7f9f15e90..cbe8059c54 100644 --- a/reference/filesystem/status.md +++ b/reference/filesystem/status.md @@ -117,6 +117,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/status_known.md b/reference/filesystem/status_known.md index 25ceff71dd..ef70ee321d 100644 --- a/reference/filesystem/status_known.md +++ b/reference/filesystem/status_known.md @@ -58,6 +58,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/symlink_status.md b/reference/filesystem/symlink_status.md index 8be7a5d004..5514d9e2ab 100644 --- a/reference/filesystem/symlink_status.md +++ b/reference/filesystem/symlink_status.md @@ -115,6 +115,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/temp_directory_path.md b/reference/filesystem/temp_directory_path.md index c0ac7395d0..1684bbd8e4 100644 --- a/reference/filesystem/temp_directory_path.md +++ b/reference/filesystem/temp_directory_path.md @@ -57,6 +57,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/filesystem/u8path.md b/reference/filesystem/u8path.md index 272a49ca3b..7c6f9e8219 100644 --- a/reference/filesystem/u8path.md +++ b/reference/filesystem/u8path.md @@ -75,6 +75,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 7 [mark verified] diff --git a/reference/filesystem/weakly_canonical.md b/reference/filesystem/weakly_canonical.md index 1620b7d3d7..b29c529b12 100644 --- a/reference/filesystem/weakly_canonical.md +++ b/reference/filesystem/weakly_canonical.md @@ -76,8 +76,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/format/basic_format_context/advance_to.md b/reference/format/basic_format_context/advance_to.md index dac5edc89d..1c1be86218 100644 --- a/reference/format/basic_format_context/advance_to.md +++ b/reference/format/basic_format_context/advance_to.md @@ -30,7 +30,7 @@ out_ = std::move(it); ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13 +- [GCC](/implementation.md#gcc): 13 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 diff --git a/reference/format/basic_format_context/arg.md b/reference/format/basic_format_context/arg.md index 5787680bb6..6ad4b11557 100644 --- a/reference/format/basic_format_context/arg.md +++ b/reference/format/basic_format_context/arg.md @@ -21,7 +21,7 @@ basic_format_arg arg(size_t id) const; ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13 +- [GCC](/implementation.md#gcc): 13 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/format/basic_format_context/locale.md b/reference/format/basic_format_context/locale.md index 5990d19ea6..1632f7e532 100644 --- a/reference/format/basic_format_context/locale.md +++ b/reference/format/basic_format_context/locale.md @@ -24,7 +24,7 @@ std::locale locale(); ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13 +- [GCC](/implementation.md#gcc): 13 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 diff --git a/reference/format/basic_format_context/out.md b/reference/format/basic_format_context/out.md index d6e5676539..421f14a2e1 100644 --- a/reference/format/basic_format_context/out.md +++ b/reference/format/basic_format_context/out.md @@ -30,7 +30,7 @@ return std::move(out_); ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13 +- [GCC](/implementation.md#gcc): 13 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 diff --git a/reference/format/basic_format_parse_context/advance_to.md b/reference/format/basic_format_parse_context/advance_to.md index 8d2967bf92..b48b6d0317 100644 --- a/reference/format/basic_format_parse_context/advance_to.md +++ b/reference/format/basic_format_parse_context/advance_to.md @@ -44,7 +44,7 @@ begin_ = it; ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13 +- [GCC](/implementation.md#gcc): 13 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 diff --git a/reference/format/basic_format_parse_context/begin.md b/reference/format/basic_format_parse_context/begin.md index a91ef225b8..3cd18512a4 100644 --- a/reference/format/basic_format_parse_context/begin.md +++ b/reference/format/basic_format_parse_context/begin.md @@ -82,7 +82,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13 +- [GCC](/implementation.md#gcc): 13 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 diff --git a/reference/format/basic_format_parse_context/end.md b/reference/format/basic_format_parse_context/end.md index b71998a6df..df3c8e54a5 100644 --- a/reference/format/basic_format_parse_context/end.md +++ b/reference/format/basic_format_parse_context/end.md @@ -78,7 +78,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13 +- [GCC](/implementation.md#gcc): 13 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 diff --git a/reference/format/basic_format_string.md b/reference/format/basic_format_string.md index 35af1c5afd..fd812599d0 100644 --- a/reference/format/basic_format_string.md +++ b/reference/format/basic_format_string.md @@ -108,7 +108,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 diff --git a/reference/format/basic_format_string/get.md b/reference/format/basic_format_string/get.md index c13972bf08..bf0f40166e 100644 --- a/reference/format/basic_format_string/get.md +++ b/reference/format/basic_format_string/get.md @@ -44,7 +44,7 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/format/basic_format_string/op_constructor.md b/reference/format/basic_format_string/op_constructor.md index 50a3e629d4..4092566455 100644 --- a/reference/format/basic_format_string/op_constructor.md +++ b/reference/format/basic_format_string/op_constructor.md @@ -90,7 +90,7 @@ namespace std { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/format/format.md b/reference/format/format.md index 32352010a9..320fced218 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -682,7 +682,7 @@ wstring format(const locale& loc, wformat_string fmt, const Args&... ar ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13 +- [GCC](/implementation.md#gcc): 13 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/format/formattable.md b/reference/format/formattable.md index cc329fe3ef..7e9906010f 100644 --- a/reference/format/formattable.md +++ b/reference/format/formattable.md @@ -69,7 +69,7 @@ hello ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13 +- [GCC](/implementation.md#gcc): 13 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/format/formatter.md b/reference/format/formatter.md index 1f02015d15..1c85b3d09f 100644 --- a/reference/format/formatter.md +++ b/reference/format/formatter.md @@ -237,7 +237,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13 +- [GCC](/implementation.md#gcc): 13 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/format/formatter/format.md b/reference/format/formatter/format.md index b15b0553c3..196158686e 100644 --- a/reference/format/formatter/format.md +++ b/reference/format/formatter/format.md @@ -56,6 +56,6 @@ typename FormatContext::iterator ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13 +- [GCC](/implementation.md#gcc): 13 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/format/formatter/parse.md b/reference/format/formatter/parse.md index 8f73eb06ee..01e62c07d0 100644 --- a/reference/format/formatter/parse.md +++ b/reference/format/formatter/parse.md @@ -48,6 +48,6 @@ constexpr typename ParseContext::iterator ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13 +- [GCC](/implementation.md#gcc): 13 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/format/runtime_format.md b/reference/format/runtime_format.md index cee2090df1..754b96924d 100644 --- a/reference/format/runtime_format.md +++ b/reference/format/runtime_format.md @@ -54,7 +54,7 @@ Hello ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 14 +- [GCC](/implementation.md#gcc): 14 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/forward_list/forward_list.md b/reference/forward_list/forward_list.md index 91d9d18aef..e89a102a91 100644 --- a/reference/forward_list/forward_list.md +++ b/reference/forward_list/forward_list.md @@ -308,7 +308,7 @@ root ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/forward_list/forward_list/assign.md b/reference/forward_list/forward_list/assign.md index 8c423c5578..53827c58c2 100644 --- a/reference/forward_list/forward_list/assign.md +++ b/reference/forward_list/forward_list/assign.md @@ -122,9 +122,9 @@ ls3 : 1 2 3 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - (3) `initializer_list`のオーバーロードは2013から。 diff --git a/reference/forward_list/forward_list/before_begin.md b/reference/forward_list/forward_list/before_begin.md index d9502d4b11..0f40a3ba24 100644 --- a/reference/forward_list/forward_list/before_begin.md +++ b/reference/forward_list/forward_list/before_begin.md @@ -68,9 +68,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/forward_list/forward_list/begin.md b/reference/forward_list/forward_list/begin.md index 907456fb07..b602b378c6 100644 --- a/reference/forward_list/forward_list/begin.md +++ b/reference/forward_list/forward_list/begin.md @@ -54,9 +54,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/forward_list/forward_list/cbefore_begin.md b/reference/forward_list/forward_list/cbefore_begin.md index 33083f0052..e8d30da47c 100644 --- a/reference/forward_list/forward_list/cbefore_begin.md +++ b/reference/forward_list/forward_list/cbefore_begin.md @@ -68,9 +68,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/forward_list/forward_list/cbegin.md b/reference/forward_list/forward_list/cbegin.md index c2243b79b5..f11c47d264 100644 --- a/reference/forward_list/forward_list/cbegin.md +++ b/reference/forward_list/forward_list/cbegin.md @@ -53,9 +53,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/forward_list/forward_list/cend.md b/reference/forward_list/forward_list/cend.md index a32f1a014c..47e6ade799 100644 --- a/reference/forward_list/forward_list/cend.md +++ b/reference/forward_list/forward_list/cend.md @@ -56,9 +56,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/forward_list/forward_list/clear.md b/reference/forward_list/forward_list/clear.md index 40a002362f..9ed363e438 100644 --- a/reference/forward_list/forward_list/clear.md +++ b/reference/forward_list/forward_list/clear.md @@ -66,7 +66,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/forward_list/forward_list/emplace_after.md b/reference/forward_list/forward_list/emplace_after.md index ebfd19ceb1..9d3a266a23 100644 --- a/reference/forward_list/forward_list/emplace_after.md +++ b/reference/forward_list/forward_list/emplace_after.md @@ -73,9 +73,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - 2010は、可変引数テンプレートに対応していないため、`args`に1つしか実引数を渡せない。 - 2012は、可変引数テンプレートに対応していないため、不完全な実装である。 diff --git a/reference/forward_list/forward_list/emplace_front.md b/reference/forward_list/forward_list/emplace_front.md index 2b00a19bff..da5cac4fec 100644 --- a/reference/forward_list/forward_list/emplace_front.md +++ b/reference/forward_list/forward_list/emplace_front.md @@ -74,9 +74,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - 2010は、可変引数テンプレートに対応していないため、`args`に1つしか実引数を渡せない。 - 2012は、可変引数テンプレートに対応していないため、不完全な実装である。 diff --git a/reference/forward_list/forward_list/empty.md b/reference/forward_list/forward_list/empty.md index 502d5cabab..8fecaa0c77 100644 --- a/reference/forward_list/forward_list/empty.md +++ b/reference/forward_list/forward_list/empty.md @@ -61,7 +61,7 @@ false ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/forward_list/forward_list/end.md b/reference/forward_list/forward_list/end.md index 3eb5ce0f85..2d27a22300 100644 --- a/reference/forward_list/forward_list/end.md +++ b/reference/forward_list/forward_list/end.md @@ -70,9 +70,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/forward_list/forward_list/erase_after.md b/reference/forward_list/forward_list/erase_after.md index 805ec3c5ab..cc243f3570 100644 --- a/reference/forward_list/forward_list/erase_after.md +++ b/reference/forward_list/forward_list/erase_after.md @@ -133,7 +133,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/forward_list/forward_list/erase_free.md b/reference/forward_list/forward_list/erase_free.md index 4412b45456..9e8ca21341 100644 --- a/reference/forward_list/forward_list/erase_free.md +++ b/reference/forward_list/forward_list/erase_free.md @@ -59,8 +59,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 9.1 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/forward_list/forward_list/erase_if_free.md b/reference/forward_list/forward_list/erase_if_free.md index bd0d058a91..3902ee1eb6 100644 --- a/reference/forward_list/forward_list/erase_if_free.md +++ b/reference/forward_list/forward_list/erase_if_free.md @@ -59,8 +59,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 9.1 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/forward_list/forward_list/front.md b/reference/forward_list/forward_list/front.md index 4340d16f17..2554c3d597 100644 --- a/reference/forward_list/forward_list/front.md +++ b/reference/forward_list/forward_list/front.md @@ -48,7 +48,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/forward_list/forward_list/get_allocator.md b/reference/forward_list/forward_list/get_allocator.md index 33ef2cdb9a..6a7e195627 100644 --- a/reference/forward_list/forward_list/get_allocator.md +++ b/reference/forward_list/forward_list/get_allocator.md @@ -48,9 +48,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - 2010は、`noexcept`が修飾されていない。 - 2012, 2013は、`noexcept`が実装されていないため、`throw()`が修飾されている。 diff --git a/reference/forward_list/forward_list/insert_after.md b/reference/forward_list/forward_list/insert_after.md index 2352f90bf1..d14fb26dbf 100644 --- a/reference/forward_list/forward_list/insert_after.md +++ b/reference/forward_list/forward_list/insert_after.md @@ -132,9 +132,9 @@ insert initializer_list : 1 2 3 4 5 6 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - (5) `initializer_list`を仮引数に持つものは、2013から。 diff --git a/reference/forward_list/forward_list/max_size.md b/reference/forward_list/forward_list/max_size.md index d3861c6d1a..767be51043 100644 --- a/reference/forward_list/forward_list/max_size.md +++ b/reference/forward_list/forward_list/max_size.md @@ -52,7 +52,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/forward_list/forward_list/merge.md b/reference/forward_list/forward_list/merge.md index b15d163e39..def48c94c6 100644 --- a/reference/forward_list/forward_list/merge.md +++ b/reference/forward_list/forward_list/merge.md @@ -85,9 +85,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0(&&バージョンのみ実装されている) +- [GCC](/implementation.md#gcc): 4.7.0(&&バージョンのみ実装されている) [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): , 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - 2010は、`&`バージョン(1)と(3)のみ実装されている。 ## 参照 diff --git a/reference/forward_list/forward_list/op_assign.md b/reference/forward_list/forward_list/op_assign.md index a721bd0e51..f9668a31ed 100644 --- a/reference/forward_list/forward_list/op_assign.md +++ b/reference/forward_list/forward_list/op_assign.md @@ -98,9 +98,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - (3) `initializer_list`のオーバーロードは2013から。 diff --git a/reference/forward_list/forward_list/op_compare_3way.md b/reference/forward_list/forward_list/op_compare_3way.md index 755fa32a8b..d6ddd2f5b0 100644 --- a/reference/forward_list/forward_list/op_compare_3way.md +++ b/reference/forward_list/forward_list/op_compare_3way.md @@ -74,7 +74,7 @@ int main () ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10 +- [GCC](/implementation.md#gcc): 10 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/forward_list/forward_list/op_constructor.md b/reference/forward_list/forward_list/op_constructor.md index 128c2807e9..8429ac4d3e 100644 --- a/reference/forward_list/forward_list/op_constructor.md +++ b/reference/forward_list/forward_list/op_constructor.md @@ -168,9 +168,9 @@ ls7 : 1 2 3 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - (1)と(2)は2010当初からC++14のとおり実装されている。 - (5)のオーバーロードも、2010当初から、デフォルト実引数を用いずアロケータを引数に取るものと取らないもの、2つのオーバーロードで実現されている。 - (8), (9)のオーバーロードは2012から。 diff --git a/reference/forward_list/forward_list/op_deduction_guide.md b/reference/forward_list/forward_list/op_deduction_guide.md index 9efa796903..27df64fa37 100644 --- a/reference/forward_list/forward_list/op_deduction_guide.md +++ b/reference/forward_list/forward_list/op_deduction_guide.md @@ -58,7 +58,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/forward_list/forward_list/op_destructor.md b/reference/forward_list/forward_list/op_destructor.md index d675181b74..1876f6e24f 100644 --- a/reference/forward_list/forward_list/op_destructor.md +++ b/reference/forward_list/forward_list/op_destructor.md @@ -27,9 +27,9 @@ ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/forward_list/forward_list/op_equal.md b/reference/forward_list/forward_list/op_equal.md index 5cd8904ce7..8068b3c45d 100644 --- a/reference/forward_list/forward_list/op_equal.md +++ b/reference/forward_list/forward_list/op_equal.md @@ -72,9 +72,9 @@ false ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/forward_list/forward_list/op_greater.md b/reference/forward_list/forward_list/op_greater.md index 36691c7007..b1a193aa33 100644 --- a/reference/forward_list/forward_list/op_greater.md +++ b/reference/forward_list/forward_list/op_greater.md @@ -53,9 +53,9 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/forward_list/forward_list/op_greater_equal.md b/reference/forward_list/forward_list/op_greater_equal.md index 6670c89d06..8454428fbf 100644 --- a/reference/forward_list/forward_list/op_greater_equal.md +++ b/reference/forward_list/forward_list/op_greater_equal.md @@ -53,9 +53,9 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/forward_list/forward_list/op_less.md b/reference/forward_list/forward_list/op_less.md index 29d9b65c26..c89361bfdf 100644 --- a/reference/forward_list/forward_list/op_less.md +++ b/reference/forward_list/forward_list/op_less.md @@ -63,9 +63,9 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/forward_list/forward_list/op_less_equal.md b/reference/forward_list/forward_list/op_less_equal.md index 122293d96d..806877e6dd 100644 --- a/reference/forward_list/forward_list/op_less_equal.md +++ b/reference/forward_list/forward_list/op_less_equal.md @@ -54,9 +54,9 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/forward_list/forward_list/op_not_equal.md b/reference/forward_list/forward_list/op_not_equal.md index 88d3facc5b..c4cf3cdc2e 100644 --- a/reference/forward_list/forward_list/op_not_equal.md +++ b/reference/forward_list/forward_list/op_not_equal.md @@ -63,9 +63,9 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/forward_list/forward_list/pop_front.md b/reference/forward_list/forward_list/pop_front.md index 123a851eab..f98ce7122c 100644 --- a/reference/forward_list/forward_list/pop_front.md +++ b/reference/forward_list/forward_list/pop_front.md @@ -58,7 +58,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/forward_list/forward_list/push_front.md b/reference/forward_list/forward_list/push_front.md index 20b8d1ac21..91b73c17b5 100644 --- a/reference/forward_list/forward_list/push_front.md +++ b/reference/forward_list/forward_list/push_front.md @@ -61,7 +61,7 @@ world ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/forward_list/forward_list/remove.md b/reference/forward_list/forward_list/remove.md index 38088c749b..582523dcc9 100644 --- a/reference/forward_list/forward_list/remove.md +++ b/reference/forward_list/forward_list/remove.md @@ -63,9 +63,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/forward_list/forward_list/remove_if.md b/reference/forward_list/forward_list/remove_if.md index c708f24c54..bb72b799ff 100644 --- a/reference/forward_list/forward_list/remove_if.md +++ b/reference/forward_list/forward_list/remove_if.md @@ -66,9 +66,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/forward_list/forward_list/resize.md b/reference/forward_list/forward_list/resize.md index 5f3b1af0ba..4c8695a37f 100644 --- a/reference/forward_list/forward_list/resize.md +++ b/reference/forward_list/forward_list/resize.md @@ -79,7 +79,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/forward_list/forward_list/reverse.md b/reference/forward_list/forward_list/reverse.md index 8aecb68546..bdcb38f4a4 100644 --- a/reference/forward_list/forward_list/reverse.md +++ b/reference/forward_list/forward_list/reverse.md @@ -60,9 +60,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/forward_list/forward_list/sort.md b/reference/forward_list/forward_list/sort.md index ed6365c915..f3eb88beb8 100644 --- a/reference/forward_list/forward_list/sort.md +++ b/reference/forward_list/forward_list/sort.md @@ -67,9 +67,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/forward_list/forward_list/splice_after.md b/reference/forward_list/forward_list/splice_after.md index cf07b48606..d5404cf6ea 100644 --- a/reference/forward_list/forward_list/splice_after.md +++ b/reference/forward_list/forward_list/splice_after.md @@ -126,7 +126,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0(右辺値参照バージョンのみ実装されている) +- [GCC](/implementation.md#gcc): 4.7.0(右辺値参照バージョンのみ実装されている) [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/forward_list/forward_list/swap.md b/reference/forward_list/forward_list/swap.md index 2edb1f4972..8db3d4c4b2 100644 --- a/reference/forward_list/forward_list/swap.md +++ b/reference/forward_list/forward_list/swap.md @@ -76,9 +76,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/forward_list/forward_list/swap_free.md b/reference/forward_list/forward_list/swap_free.md index 60444a3c91..93a7f90c09 100644 --- a/reference/forward_list/forward_list/swap_free.md +++ b/reference/forward_list/forward_list/swap_free.md @@ -71,9 +71,9 @@ ls2 : {4 5 6 } ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/forward_list/forward_list/unique.md b/reference/forward_list/forward_list/unique.md index 340c86a394..e1e6b520a8 100644 --- a/reference/forward_list/forward_list/unique.md +++ b/reference/forward_list/forward_list/unique.md @@ -82,9 +82,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/functional/bad_function_call.md b/reference/functional/bad_function_call.md index 713478dd0a..4170a52ca1 100644 --- a/reference/functional/bad_function_call.md +++ b/reference/functional/bad_function_call.md @@ -47,9 +47,9 @@ bad function call ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.4 +- [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ### 参照 diff --git a/reference/functional/bind.md b/reference/functional/bind.md index 9808b53cc0..ca058697cc 100644 --- a/reference/functional/bind.md +++ b/reference/functional/bind.md @@ -111,7 +111,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/bind_front.md b/reference/functional/bind_front.md index e8cabe7375..90cde94e35 100644 --- a/reference/functional/bind_front.md +++ b/reference/functional/bind_front.md @@ -125,7 +125,7 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 9.1 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/bit_and.md b/reference/functional/bit_and.md index 0174f92bbb..9b5d54d462 100644 --- a/reference/functional/bit_and.md +++ b/reference/functional/bit_and.md @@ -99,16 +99,16 @@ int main() ## C++11バージョン ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? ## C++14バージョン ### 処理系 -- [Clang](/implementation.md#clang): 3.4 -- [GCC](/implementation.md#gcc): 4.9 +- [Clang](/implementation.md#clang): 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.9 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/bit_not.md b/reference/functional/bit_not.md index a5a4a45029..a3a29a1c2e 100644 --- a/reference/functional/bit_not.md +++ b/reference/functional/bit_not.md @@ -91,8 +91,8 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.4 -- [GCC](/implementation.md#gcc): 4.9 +- [Clang](/implementation.md#clang): 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.9 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/bit_or.md b/reference/functional/bit_or.md index 5e8b866c06..1efde6904c 100644 --- a/reference/functional/bit_or.md +++ b/reference/functional/bit_or.md @@ -98,16 +98,16 @@ int main() ## C++11バージョン ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? ## C++14バージョン ### 処理系 -- [Clang](/implementation.md#clang): 3.4 -- [GCC](/implementation.md#gcc): 4.9 +- [Clang](/implementation.md#clang): 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.9 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/bit_xor.md b/reference/functional/bit_xor.md index 577fe0946e..cc7146c790 100644 --- a/reference/functional/bit_xor.md +++ b/reference/functional/bit_xor.md @@ -99,16 +99,16 @@ int main() ## C++11バージョン ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? ## C++14バージョン ### 処理系 -- [Clang](/implementation.md#clang): 3.4 -- [GCC](/implementation.md#gcc): 4.9 +- [Clang](/implementation.md#clang): 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.9 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/boyer_moore_horspool_searcher.md b/reference/functional/boyer_moore_horspool_searcher.md index 1556ef201d..294741ce18 100644 --- a/reference/functional/boyer_moore_horspool_searcher.md +++ b/reference/functional/boyer_moore_horspool_searcher.md @@ -103,7 +103,7 @@ abaa ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 7.3 +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 diff --git a/reference/functional/boyer_moore_horspool_searcher/op_call.md b/reference/functional/boyer_moore_horspool_searcher/op_call.md index 22e9ee2acf..9ba4739afd 100644 --- a/reference/functional/boyer_moore_horspool_searcher/op_call.md +++ b/reference/functional/boyer_moore_horspool_searcher/op_call.md @@ -96,7 +96,7 @@ abaa ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 7.3 +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/boyer_moore_horspool_searcher/op_constructor.md b/reference/functional/boyer_moore_horspool_searcher/op_constructor.md index 54a33d62fa..e61c035ff3 100644 --- a/reference/functional/boyer_moore_horspool_searcher/op_constructor.md +++ b/reference/functional/boyer_moore_horspool_searcher/op_constructor.md @@ -81,5 +81,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 7.3 +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/boyer_moore_searcher.md b/reference/functional/boyer_moore_searcher.md index 3fcd8a4afd..6f91bedbd2 100644 --- a/reference/functional/boyer_moore_searcher.md +++ b/reference/functional/boyer_moore_searcher.md @@ -103,7 +103,7 @@ abaa ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 7.3 +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 diff --git a/reference/functional/boyer_moore_searcher/op_call.md b/reference/functional/boyer_moore_searcher/op_call.md index c45c36981a..b8395b81ed 100644 --- a/reference/functional/boyer_moore_searcher/op_call.md +++ b/reference/functional/boyer_moore_searcher/op_call.md @@ -96,7 +96,7 @@ abaa ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 7.3 +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/boyer_moore_searcher/op_constructor.md b/reference/functional/boyer_moore_searcher/op_constructor.md index 21595bb6e1..f9c8eda861 100644 --- a/reference/functional/boyer_moore_searcher/op_constructor.md +++ b/reference/functional/boyer_moore_searcher/op_constructor.md @@ -81,5 +81,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 7.3 +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/cref.md b/reference/functional/cref.md index 37e37eaa01..21b6c3bb48 100644 --- a/reference/functional/cref.md +++ b/reference/functional/cref.md @@ -71,7 +71,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/default_searcher.md b/reference/functional/default_searcher.md index 1757d3e37e..fa506c74ce 100644 --- a/reference/functional/default_searcher.md +++ b/reference/functional/default_searcher.md @@ -95,7 +95,7 @@ abaa ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 7.3 +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 diff --git a/reference/functional/default_searcher/op_call.md b/reference/functional/default_searcher/op_call.md index f34654db19..26a66caec1 100644 --- a/reference/functional/default_searcher/op_call.md +++ b/reference/functional/default_searcher/op_call.md @@ -96,7 +96,7 @@ abaa ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 7.3 +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/default_searcher/op_constructor.md b/reference/functional/default_searcher/op_constructor.md index ea787ffa72..baa9a0279d 100644 --- a/reference/functional/default_searcher/op_constructor.md +++ b/reference/functional/default_searcher/op_constructor.md @@ -75,7 +75,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 7.3 +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/function/assign.md b/reference/functional/function/assign.md index 390f07b9ee..ce5a583364 100644 --- a/reference/functional/function/assign.md +++ b/reference/functional/function/assign.md @@ -68,8 +68,8 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): (4.8.2時点で実装していない) +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.8.2 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/function/op_assign.md b/reference/functional/function/op_assign.md index 26e3b31294..e8c55dc308 100644 --- a/reference/functional/function/op_assign.md +++ b/reference/functional/function/op_assign.md @@ -70,8 +70,8 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/function/op_bool.md b/reference/functional/function/op_bool.md index fbd8b2276c..4bafe051d2 100644 --- a/reference/functional/function/op_bool.md +++ b/reference/functional/function/op_bool.md @@ -49,8 +49,8 @@ not empty ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/function/op_call.md b/reference/functional/function/op_call.md index 870fa64dd4..3e7e019702 100644 --- a/reference/functional/function/op_call.md +++ b/reference/functional/function/op_call.md @@ -56,8 +56,8 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/function/op_constructor.md b/reference/functional/function/op_constructor.md index 064c9db8dd..f0a1d8bceb 100644 --- a/reference/functional/function/op_constructor.md +++ b/reference/functional/function/op_constructor.md @@ -231,8 +231,8 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6(アロケータを受け取るバージョンは、4.8.2時点でサポートされていない) +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6(アロケータを受け取るバージョンは、4.8.2時点でサポートされていない) [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/function/op_deduction_guide.md b/reference/functional/function/op_deduction_guide.md index f330677598..fbda0db09a 100644 --- a/reference/functional/function/op_deduction_guide.md +++ b/reference/functional/function/op_deduction_guide.md @@ -82,7 +82,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 7.1 +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/function/op_destructor.md b/reference/functional/function/op_destructor.md index 5b27d0968a..83fa383c38 100644 --- a/reference/functional/function/op_destructor.md +++ b/reference/functional/function/op_destructor.md @@ -23,8 +23,8 @@ ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/function/op_equal.md b/reference/functional/function/op_equal.md index 193a577126..dac4fa4184 100644 --- a/reference/functional/function/op_equal.md +++ b/reference/functional/function/op_equal.md @@ -60,8 +60,8 @@ not empty ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.6.4 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.6.4 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/function/op_not_equal.md b/reference/functional/function/op_not_equal.md index 44d0c93578..78f351ddb8 100644 --- a/reference/functional/function/op_not_equal.md +++ b/reference/functional/function/op_not_equal.md @@ -60,8 +60,8 @@ empty ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.6.4 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.6.4 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/function/swap.md b/reference/functional/function/swap.md index 8540ca0011..8181040030 100644 --- a/reference/functional/function/swap.md +++ b/reference/functional/function/swap.md @@ -62,8 +62,8 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/function/swap_free.md b/reference/functional/function/swap_free.md index c3343b4022..e79bdfe64e 100644 --- a/reference/functional/function/swap_free.md +++ b/reference/functional/function/swap_free.md @@ -60,8 +60,8 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/function/target.md b/reference/functional/function/target.md index 81506ec2fc..dfc4448eef 100644 --- a/reference/functional/function/target.md +++ b/reference/functional/function/target.md @@ -78,8 +78,8 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/function/target_type.md b/reference/functional/function/target_type.md index ff3cd8f0c2..3a75a1bf77 100644 --- a/reference/functional/function/target_type.md +++ b/reference/functional/function/target_type.md @@ -54,8 +54,8 @@ f has ident ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/hash.md b/reference/functional/hash.md index 764b4ff5c0..7129a58c88 100644 --- a/reference/functional/hash.md +++ b/reference/functional/hash.md @@ -180,7 +180,7 @@ found : 3 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/identity.md b/reference/functional/identity.md index 4bb18e412a..f677413b59 100644 --- a/reference/functional/identity.md +++ b/reference/functional/identity.md @@ -79,8 +79,8 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 1 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 1 [mark verified] ## 参照 diff --git a/reference/functional/invoke.md b/reference/functional/invoke.md index 82cb8e6051..40e9cddeee 100644 --- a/reference/functional/invoke.md +++ b/reference/functional/invoke.md @@ -126,7 +126,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified], 2017 [mark verified] ## 関連項目 diff --git a/reference/functional/is_bind_expression.md b/reference/functional/is_bind_expression.md index b6d74fe04c..ec78f45da0 100644 --- a/reference/functional/is_bind_expression.md +++ b/reference/functional/is_bind_expression.md @@ -53,7 +53,7 @@ int main() {} ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/is_placeholder.md b/reference/functional/is_placeholder.md index 516823a84f..da7d8597f4 100644 --- a/reference/functional/is_placeholder.md +++ b/reference/functional/is_placeholder.md @@ -46,7 +46,7 @@ int main() {} ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/mem_fn.md b/reference/functional/mem_fn.md index 11b63dec35..7942cc8082 100644 --- a/reference/functional/mem_fn.md +++ b/reference/functional/mem_fn.md @@ -84,7 +84,7 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/move_only_function.md b/reference/functional/move_only_function.md index dce2306850..66ccd0b1b3 100644 --- a/reference/functional/move_only_function.md +++ b/reference/functional/move_only_function.md @@ -229,7 +229,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 12.1 +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/move_only_function/op_call.md b/reference/functional/move_only_function/op_call.md index fcc09a5ff9..6171d394cb 100644 --- a/reference/functional/move_only_function/op_call.md +++ b/reference/functional/move_only_function/op_call.md @@ -63,7 +63,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 12.1 +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/move_only_function/op_constructor.md b/reference/functional/move_only_function/op_constructor.md index 338da0c7b1..78d76f7404 100644 --- a/reference/functional/move_only_function/op_constructor.md +++ b/reference/functional/move_only_function/op_constructor.md @@ -200,7 +200,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 12.1 +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/not_fn.md b/reference/functional/not_fn.md index 7eb0d2faee..a7f76664ac 100644 --- a/reference/functional/not_fn.md +++ b/reference/functional/not_fn.md @@ -120,8 +120,8 @@ true - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 3.9.1 -- [GCC](/implementation.md#gcc): 7.2 +- [Clang](/implementation.md#clang): 3.9.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/ref.md b/reference/functional/ref.md index f05d180a07..d5f907f748 100644 --- a/reference/functional/ref.md +++ b/reference/functional/ref.md @@ -69,7 +69,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/reference_wrapper.md b/reference/functional/reference_wrapper.md index 3b6103970a..15a729151e 100644 --- a/reference/functional/reference_wrapper.md +++ b/reference/functional/reference_wrapper.md @@ -127,7 +127,7 @@ my_struct& get_my_struct() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/reference_wrapper/get.md b/reference/functional/reference_wrapper/get.md index dfd38cb438..3e6ee6963d 100644 --- a/reference/functional/reference_wrapper/get.md +++ b/reference/functional/reference_wrapper/get.md @@ -52,7 +52,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/reference_wrapper/op_assign.md b/reference/functional/reference_wrapper/op_assign.md index f5e7311e92..429d9c5f72 100644 --- a/reference/functional/reference_wrapper/op_assign.md +++ b/reference/functional/reference_wrapper/op_assign.md @@ -57,7 +57,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/reference_wrapper/op_call.md b/reference/functional/reference_wrapper/op_call.md index d7d0c014db..3a75348421 100644 --- a/reference/functional/reference_wrapper/op_call.md +++ b/reference/functional/reference_wrapper/op_call.md @@ -69,7 +69,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/reference_wrapper/op_cast_ref_t.md b/reference/functional/reference_wrapper/op_cast_ref_t.md index f68e826bf7..c6778ac42b 100644 --- a/reference/functional/reference_wrapper/op_cast_ref_t.md +++ b/reference/functional/reference_wrapper/op_cast_ref_t.md @@ -51,7 +51,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/reference_wrapper/op_constructor.md b/reference/functional/reference_wrapper/op_constructor.md index 7446aac1f8..d8d3698167 100644 --- a/reference/functional/reference_wrapper/op_constructor.md +++ b/reference/functional/reference_wrapper/op_constructor.md @@ -70,7 +70,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/functional/reference_wrapper/op_deduction_guide.md b/reference/functional/reference_wrapper/op_deduction_guide.md index 80aa2a5863..65d040c3b2 100644 --- a/reference/functional/reference_wrapper/op_deduction_guide.md +++ b/reference/functional/reference_wrapper/op_deduction_guide.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 7.2 +- [GCC](/implementation.md#gcc): 7.2 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 diff --git a/reference/future/async.md b/reference/future/async.md index de63ef9027..875ee46ded 100644 --- a/reference/future/async.md +++ b/reference/future/async.md @@ -191,9 +191,9 @@ foo() = 3 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/future.md b/reference/future/future.md index 1c6a393cd5..cdfb01e64f 100644 --- a/reference/future/future.md +++ b/reference/future/future.md @@ -97,9 +97,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] - 2012段階の`std::thread`クラスは、コンストラクタに引数をムーブで渡すことができない。そのため、`promise`オブジェクトはスレッド間の共有オブジェクトにする必要がある。(所有権が曖昧になるため、スタイルとしてはよくない) [#737812 - std::thread does not accept std::move](https://connect.microsoft.com/VisualStudio/feedback/details/737812) diff --git a/reference/future/future/get.md b/reference/future/future/get.md index b9f0709906..5c2343a5c4 100644 --- a/reference/future/future/get.md +++ b/reference/future/future/get.md @@ -201,9 +201,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] - 2012段階の`std::thread`クラスは、コンストラクタに引数をムーブで渡すことができない。そのため、`promise`オブジェクトはスレッド間の共有オブジェクトにする必要がある。(所有権が曖昧になるため、スタイルとしてはよくない) [#737812 - std::thread does not accept std::move](https://connect.microsoft.com/VisualStudio/feedback/details/737812) diff --git a/reference/future/future/op_assign.md b/reference/future/future/op_assign.md index 4633ce96e6..4711d38a43 100644 --- a/reference/future/future/op_assign.md +++ b/reference/future/future/op_assign.md @@ -55,9 +55,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/future/op_constructor.md b/reference/future/future/op_constructor.md index 20c7ef2dc0..53dbfffa4d 100644 --- a/reference/future/future/op_constructor.md +++ b/reference/future/future/op_constructor.md @@ -55,9 +55,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/future/op_destructor.md b/reference/future/future/op_destructor.md index 194d1bc12b..8dcc12b5af 100644 --- a/reference/future/future/op_destructor.md +++ b/reference/future/future/op_destructor.md @@ -36,9 +36,9 @@ ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/future/share.md b/reference/future/future/share.md index 1ffe97eaf0..41cbed53c3 100644 --- a/reference/future/future/share.md +++ b/reference/future/future/share.md @@ -82,9 +82,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/future/valid.md b/reference/future/future/valid.md index 77413457fe..bcd9024598 100644 --- a/reference/future/future/valid.md +++ b/reference/future/future/valid.md @@ -59,9 +59,9 @@ false ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/future/wait.md b/reference/future/future/wait.md index cc378303bc..43bf1d5ce3 100644 --- a/reference/future/future/wait.md +++ b/reference/future/future/wait.md @@ -66,9 +66,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] - 2012段階の`std::thread`クラスは、コンストラクタに引数をムーブで渡すことができない。そのため、`promise`オブジェクトはスレッド間の共有オブジェクトにする必要がある。(所有権が曖昧になるため、スタイルとしてはよくない) [#737812 - std::thread does not accept std::move](https://connect.microsoft.com/VisualStudio/feedback/details/737812) diff --git a/reference/future/future/wait_for.md b/reference/future/future/wait_for.md index 283b189b7a..fd77159de7 100644 --- a/reference/future/future/wait_for.md +++ b/reference/future/future/wait_for.md @@ -82,9 +82,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] - 2012段階の`std::thread`クラスは、コンストラクタに引数をムーブで渡すことができない。そのため、`promise`オブジェクトはスレッド間の共有オブジェクトにする必要がある。(所有権が曖昧になるため、スタイルとしてはよくない) [#737812 - std::thread does not accept std::move](https://connect.microsoft.com/VisualStudio/feedback/details/737812) diff --git a/reference/future/future/wait_until.md b/reference/future/future/wait_until.md index 43ef88fcb0..6a84f1213b 100644 --- a/reference/future/future/wait_until.md +++ b/reference/future/future/wait_until.md @@ -91,9 +91,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] - 2012段階の`std::thread`クラスは、コンストラクタに引数をムーブで渡すことができない。そのため、`promise`オブジェクトはスレッド間の共有オブジェクトにする必要がある。(所有権が曖昧になるため、スタイルとしてはよくない) [#737812 - std::thread does not accept std::move](https://connect.microsoft.com/VisualStudio/feedback/details/737812) diff --git a/reference/future/future_category.md b/reference/future/future_category.md index 7a3563ad10..9064dc494e 100644 --- a/reference/future/future_category.md +++ b/reference/future/future_category.md @@ -62,9 +62,9 @@ Broken promise ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/future_errc.md b/reference/future/future_errc.md index 5c885720e4..90c2c529ec 100644 --- a/reference/future/future_errc.md +++ b/reference/future/future_errc.md @@ -42,9 +42,9 @@ future操作に関するエラー値。 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/future_error.md b/reference/future/future_error.md index f48212dfa7..2c7c3cde7b 100644 --- a/reference/future/future_error.md +++ b/reference/future/future_error.md @@ -78,9 +78,9 @@ what:Promise already satisfied ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/future_status.md b/reference/future/future_status.md index f27618d371..7fe31e375b 100644 --- a/reference/future/future_status.md +++ b/reference/future/future_status.md @@ -30,9 +30,9 @@ namespace std { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/is_error_code_enum.md b/reference/future/is_error_code_enum.md index 2e0947336d..af6bb9b9a6 100644 --- a/reference/future/is_error_code_enum.md +++ b/reference/future/is_error_code_enum.md @@ -47,9 +47,9 @@ Broken promise ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/launch.md b/reference/future/launch.md index f5d0de9c53..f0ea8f0db8 100644 --- a/reference/future/launch.md +++ b/reference/future/launch.md @@ -34,9 +34,9 @@ namespace std { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/make_error_code.md b/reference/future/make_error_code.md index 3b32e3534b..98b00a7015 100644 --- a/reference/future/make_error_code.md +++ b/reference/future/make_error_code.md @@ -58,9 +58,9 @@ message : Broken promise ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/make_error_condition.md b/reference/future/make_error_condition.md index 014b36582f..613424f25e 100644 --- a/reference/future/make_error_condition.md +++ b/reference/future/make_error_condition.md @@ -60,7 +60,7 @@ message : Broken promise ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/future/packaged_task.md b/reference/future/packaged_task.md index 45a7b47f88..6324f7a8d0 100644 --- a/reference/future/packaged_task.md +++ b/reference/future/packaged_task.md @@ -124,9 +124,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/packaged_task/get_future.md b/reference/future/packaged_task/get_future.md index 3b8c52508b..3861b43ce1 100644 --- a/reference/future/packaged_task/get_future.md +++ b/reference/future/packaged_task/get_future.md @@ -81,9 +81,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/packaged_task/make_ready_at_thread_exit.md b/reference/future/packaged_task/make_ready_at_thread_exit.md index 33f0812d42..b23a914253 100644 --- a/reference/future/packaged_task/make_ready_at_thread_exit.md +++ b/reference/future/packaged_task/make_ready_at_thread_exit.md @@ -82,10 +82,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.5 -- [GCC](/implementation.md#gcc): 5.0 +- [Clang](/implementation.md#clang): 3.5 [mark verified] +- [GCC](/implementation.md#gcc): 5.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/packaged_task/op_assign.md b/reference/future/packaged_task/op_assign.md index 2dd403be6c..e324f583e9 100644 --- a/reference/future/packaged_task/op_assign.md +++ b/reference/future/packaged_task/op_assign.md @@ -70,9 +70,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/packaged_task/op_call.md b/reference/future/packaged_task/op_call.md index 3d7f6bdab9..86e69853c3 100644 --- a/reference/future/packaged_task/op_call.md +++ b/reference/future/packaged_task/op_call.md @@ -98,9 +98,9 @@ error! ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/packaged_task/op_constructor.md b/reference/future/packaged_task/op_constructor.md index f70521e253..dc60a0569d 100644 --- a/reference/future/packaged_task/op_constructor.md +++ b/reference/future/packaged_task/op_constructor.md @@ -106,9 +106,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 (11.0はアロケータを引数に取るものがコンパイルできない?) +- [Visual C++](/implementation.md#visual_cpp): 2012 (11.0はアロケータを引数に取るものがコンパイルできない?) [mark verified] ## 参照 diff --git a/reference/future/packaged_task/op_deduction_guide.md b/reference/future/packaged_task/op_deduction_guide.md index e730510418..d99598b5fe 100644 --- a/reference/future/packaged_task/op_deduction_guide.md +++ b/reference/future/packaged_task/op_deduction_guide.md @@ -80,8 +80,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 18 -- [GCC](/implementation.md#gcc): 11 +- [Clang](/implementation.md#clang): 18 [mark verified] +- [GCC](/implementation.md#gcc): 11 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/future/packaged_task/op_destructor.md b/reference/future/packaged_task/op_destructor.md index a2bdd4ee82..83d5c8b3a6 100644 --- a/reference/future/packaged_task/op_destructor.md +++ b/reference/future/packaged_task/op_destructor.md @@ -31,9 +31,9 @@ ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/packaged_task/reset.md b/reference/future/packaged_task/reset.md index 59b2d1d70a..dde088d1b0 100644 --- a/reference/future/packaged_task/reset.md +++ b/reference/future/packaged_task/reset.md @@ -80,9 +80,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/packaged_task/swap.md b/reference/future/packaged_task/swap.md index 7c8fc39702..c50374b84d 100644 --- a/reference/future/packaged_task/swap.md +++ b/reference/future/packaged_task/swap.md @@ -67,9 +67,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/packaged_task/swap_free.md b/reference/future/packaged_task/swap_free.md index bf27035faa..1686fac01a 100644 --- a/reference/future/packaged_task/swap_free.md +++ b/reference/future/packaged_task/swap_free.md @@ -69,9 +69,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/packaged_task/uses_allocator.md b/reference/future/packaged_task/uses_allocator.md index 2e77e22296..0ff4135eb0 100644 --- a/reference/future/packaged_task/uses_allocator.md +++ b/reference/future/packaged_task/uses_allocator.md @@ -31,9 +31,9 @@ namespace std { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/packaged_task/valid.md b/reference/future/packaged_task/valid.md index f9231419aa..92685815f5 100644 --- a/reference/future/packaged_task/valid.md +++ b/reference/future/packaged_task/valid.md @@ -55,9 +55,9 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/promise.md b/reference/future/promise.md index 2beb34fa84..88be903588 100644 --- a/reference/future/promise.md +++ b/reference/future/promise.md @@ -118,9 +118,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/promise/get_future.md b/reference/future/promise/get_future.md index c37c439d59..dcfd6f9a9d 100644 --- a/reference/future/promise/get_future.md +++ b/reference/future/promise/get_future.md @@ -94,9 +94,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/promise/op_assign.md b/reference/future/promise/op_assign.md index fc5d42a353..f9aea350f4 100644 --- a/reference/future/promise/op_assign.md +++ b/reference/future/promise/op_assign.md @@ -49,9 +49,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/promise/op_constructor.md b/reference/future/promise/op_constructor.md index 3c81f1abd6..7f10dc14c7 100644 --- a/reference/future/promise/op_constructor.md +++ b/reference/future/promise/op_constructor.md @@ -67,9 +67,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/promise/op_destructor.md b/reference/future/promise/op_destructor.md index a4b55f0367..4f919d0cd5 100644 --- a/reference/future/promise/op_destructor.md +++ b/reference/future/promise/op_destructor.md @@ -65,9 +65,9 @@ std::future_error: Broken promise ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/promise/set_exception.md b/reference/future/promise/set_exception.md index 8581cff265..cab3d3183e 100644 --- a/reference/future/promise/set_exception.md +++ b/reference/future/promise/set_exception.md @@ -87,9 +87,9 @@ invalid argument! ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/promise/set_exception_at_thread_exit.md b/reference/future/promise/set_exception_at_thread_exit.md index eb0ec872e0..cb7b114347 100644 --- a/reference/future/promise/set_exception_at_thread_exit.md +++ b/reference/future/promise/set_exception_at_thread_exit.md @@ -91,10 +91,10 @@ invalid argument! - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 5.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 5.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/promise/set_value.md b/reference/future/promise/set_value.md index d36c6c4561..e46e9d720d 100644 --- a/reference/future/promise/set_value.md +++ b/reference/future/promise/set_value.md @@ -210,9 +210,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/promise/set_value_at_thread_exit.md b/reference/future/promise/set_value_at_thread_exit.md index 601af1ce9f..528849ed85 100644 --- a/reference/future/promise/set_value_at_thread_exit.md +++ b/reference/future/promise/set_value_at_thread_exit.md @@ -223,10 +223,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 5.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 5.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/promise/swap.md b/reference/future/promise/swap.md index d3b6ef19d6..0a9c0e48a1 100644 --- a/reference/future/promise/swap.md +++ b/reference/future/promise/swap.md @@ -72,9 +72,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/promise/swap_free.md b/reference/future/promise/swap_free.md index 5eb6e95199..6fda2951f1 100644 --- a/reference/future/promise/swap_free.md +++ b/reference/future/promise/swap_free.md @@ -70,9 +70,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/promise/uses_allocator.md b/reference/future/promise/uses_allocator.md index eaac50f65a..c0f5e354c0 100644 --- a/reference/future/promise/uses_allocator.md +++ b/reference/future/promise/uses_allocator.md @@ -31,9 +31,9 @@ namespace std { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/shared_future.md b/reference/future/shared_future.md index 5eb4e50b30..d918ca0df0 100644 --- a/reference/future/shared_future.md +++ b/reference/future/shared_future.md @@ -102,9 +102,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/shared_future/get.md b/reference/future/shared_future/get.md index 8956a3a945..0108b936a2 100644 --- a/reference/future/shared_future/get.md +++ b/reference/future/shared_future/get.md @@ -164,9 +164,9 @@ thread:1 sum:40 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/shared_future/op_assign.md b/reference/future/shared_future/op_assign.md index 9ece7045fc..93002e6308 100644 --- a/reference/future/shared_future/op_assign.md +++ b/reference/future/shared_future/op_assign.md @@ -90,9 +90,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/shared_future/op_constructor.md b/reference/future/shared_future/op_constructor.md index 248285ec3e..0404ed859d 100644 --- a/reference/future/shared_future/op_constructor.md +++ b/reference/future/shared_future/op_constructor.md @@ -91,9 +91,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/shared_future/op_destructor.md b/reference/future/shared_future/op_destructor.md index e099af16c2..ea7c348157 100644 --- a/reference/future/shared_future/op_destructor.md +++ b/reference/future/shared_future/op_destructor.md @@ -35,9 +35,9 @@ ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/shared_future/valid.md b/reference/future/shared_future/valid.md index b59ad44d21..996faff6bb 100644 --- a/reference/future/shared_future/valid.md +++ b/reference/future/shared_future/valid.md @@ -53,9 +53,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/shared_future/wait.md b/reference/future/shared_future/wait.md index a556efa79f..37982656bc 100644 --- a/reference/future/shared_future/wait.md +++ b/reference/future/shared_future/wait.md @@ -69,9 +69,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/shared_future/wait_for.md b/reference/future/shared_future/wait_for.md index 4a39307e7a..1b355f86f7 100644 --- a/reference/future/shared_future/wait_for.md +++ b/reference/future/shared_future/wait_for.md @@ -82,9 +82,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/future/shared_future/wait_until.md b/reference/future/shared_future/wait_until.md index 752959d3bf..24feae0cea 100644 --- a/reference/future/shared_future/wait_until.md +++ b/reference/future/shared_future/wait_until.md @@ -92,9 +92,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/initializer_list/initializer_list.md b/reference/initializer_list/initializer_list.md index ce25ed53e9..4718fc8401 100644 --- a/reference/initializer_list/initializer_list.md +++ b/reference/initializer_list/initializer_list.md @@ -77,7 +77,7 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.4.0 +- [GCC](/implementation.md#gcc): 4.4.0 [mark verified] ## 関連項目 diff --git a/reference/initializer_list/initializer_list/begin.md b/reference/initializer_list/initializer_list/begin.md index 99607e786c..8854951930 100644 --- a/reference/initializer_list/initializer_list/begin.md +++ b/reference/initializer_list/initializer_list/begin.md @@ -51,8 +51,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.4.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.0 [mark verified] ## 参照 diff --git a/reference/initializer_list/initializer_list/begin_free.md b/reference/initializer_list/initializer_list/begin_free.md index 8e2a6f89f4..cd6d4f9d91 100644 --- a/reference/initializer_list/initializer_list/begin_free.md +++ b/reference/initializer_list/initializer_list/begin_free.md @@ -54,8 +54,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] ## 参照 diff --git a/reference/initializer_list/initializer_list/end.md b/reference/initializer_list/initializer_list/end.md index 130fbccf47..635339d2e1 100644 --- a/reference/initializer_list/initializer_list/end.md +++ b/reference/initializer_list/initializer_list/end.md @@ -56,8 +56,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.4.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.0 [mark verified] ## 参照 diff --git a/reference/initializer_list/initializer_list/end_free.md b/reference/initializer_list/initializer_list/end_free.md index 85e20a1c65..cf0f08c158 100644 --- a/reference/initializer_list/initializer_list/end_free.md +++ b/reference/initializer_list/initializer_list/end_free.md @@ -56,8 +56,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] ## 参照 diff --git a/reference/initializer_list/initializer_list/op_constructor.md b/reference/initializer_list/initializer_list/op_constructor.md index ec02681c1d..592081ccd7 100644 --- a/reference/initializer_list/initializer_list/op_constructor.md +++ b/reference/initializer_list/initializer_list/op_constructor.md @@ -37,8 +37,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.4.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.0 [mark verified] ## 参照 diff --git a/reference/initializer_list/initializer_list/size.md b/reference/initializer_list/initializer_list/size.md index 98a2d4f2d8..94646278cf 100644 --- a/reference/initializer_list/initializer_list/size.md +++ b/reference/initializer_list/initializer_list/size.md @@ -49,8 +49,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.4.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.0 [mark verified] ## 参照 diff --git a/reference/iomanip/put_time.md b/reference/iomanip/put_time.md index 7abfd6c00c..6102db6697 100644 --- a/reference/iomanip/put_time.md +++ b/reference/iomanip/put_time.md @@ -89,8 +89,8 @@ Thu Dec 25 15:12:30 2014 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 5.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 5.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/iomanip/quoted.md b/reference/iomanip/quoted.md index eb1fd9babf..ab4856125c 100644 --- a/reference/iomanip/quoted.md +++ b/reference/iomanip/quoted.md @@ -132,8 +132,8 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.4 -- [GCC](/implementation.md#gcc): 4.9 +- [Clang](/implementation.md#clang): 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.9 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ios/basic_ios/op_assign.md b/reference/ios/basic_ios/op_assign.md index 1f12eb866a..0cabe78f62 100644 --- a/reference/ios/basic_ios/op_assign.md +++ b/reference/ios/basic_ios/op_assign.md @@ -34,8 +34,8 @@ public: ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5.0, 3.6.0, 3.7.0, 3.8.0 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0, 4.9.1, 4.9.2, 5.1.0, 5.2.0, 6.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5.0 [mark verified], 3.6.0 [mark verified], 3.7.0 [mark verified], 3.8.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.1.0 [mark verified], 5.2.0 [mark verified], 6.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ios/basic_ios/op_constructor.md b/reference/ios/basic_ios/op_constructor.md index 8140d5de06..4905f91106 100644 --- a/reference/ios/basic_ios/op_constructor.md +++ b/reference/ios/basic_ios/op_constructor.md @@ -45,8 +45,8 @@ public: ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5.0, 3.6.0, 3.7.0, 3.8.0 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0, 4.9.1, 4.9.2, 5.1.0, 5.2.0, 6.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5.0 [mark verified], 3.6.0 [mark verified], 3.7.0 [mark verified], 3.8.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.1.0 [mark verified], 5.2.0 [mark verified], 6.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ios/defaultfloat.md b/reference/ios/defaultfloat.md index 07639a3053..30a7096ebb 100644 --- a/reference/ios/defaultfloat.md +++ b/reference/ios/defaultfloat.md @@ -82,10 +82,10 @@ namespace std { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 5.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 5.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified] ## 参照 - [`fixed`](fixed.md) diff --git a/reference/ios/hexfloat.md b/reference/ios/hexfloat.md index 7a0efd1f4e..4be2088427 100644 --- a/reference/ios/hexfloat.md +++ b/reference/ios/hexfloat.md @@ -29,9 +29,9 @@ namespace std { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 5.0 -- [Visual C++](/implementation.md#visual_cpp): 2008, 2010, 2012 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 5.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 [mark verified], 2010 [mark verified], 2012 [mark verified] #### 備考 diff --git a/reference/ios/io_errc.md b/reference/ios/io_errc.md index dbfc4e84c8..c0c6fcde74 100644 --- a/reference/ios/io_errc.md +++ b/reference/ios/io_errc.md @@ -34,10 +34,10 @@ namespace std { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5.0, 3.6.0, 3.7.0, 3.8.0 -- [GCC](/implementation.md#gcc): 5.1.0, 5.2.0, 6.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5.0 [mark verified], 3.6.0 [mark verified], 3.7.0 [mark verified], 3.8.0 [mark verified] +- [GCC](/implementation.md#gcc): 5.1.0 [mark verified], 5.2.0 [mark verified], 6.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012 (ただし、10.0はenum class非対応のため不完全) +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 (ただし、10.0はenum class非対応のため不完全) [mark verified] ## 参照 diff --git a/reference/ios/ios_base/Init.md b/reference/ios/ios_base/Init.md index 15a01cde1e..665d246988 100644 --- a/reference/ios/ios_base/Init.md +++ b/reference/ios/ios_base/Init.md @@ -34,8 +34,8 @@ namespace std { - C++98 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5.0, 3.6.0, 3.7.0, 3.8.0 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0, 4.9.1, 4.9.2, 5.1.0, 5.2.0, 6.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5.0 [mark verified], 3.6.0 [mark verified], 3.7.0 [mark verified], 3.8.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.1.0 [mark verified], 5.2.0 [mark verified], 6.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ios/ios_base/Init/op_constructor.md b/reference/ios/ios_base/Init/op_constructor.md index 26cf83cb35..f3d01ac9dd 100644 --- a/reference/ios/ios_base/Init/op_constructor.md +++ b/reference/ios/ios_base/Init/op_constructor.md @@ -22,8 +22,8 @@ Init(); - C++98 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5.0, 3.6.0, 3.7.0, 3.8.0 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0, 4.9.1, 4.9.2, 5.1.0, 5.2.0, 6.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5.0 [mark verified], 3.6.0 [mark verified], 3.7.0 [mark verified], 3.8.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.1.0 [mark verified], 5.2.0 [mark verified], 6.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ios/ios_base/Init/op_destructor.md b/reference/ios/ios_base/Init/op_destructor.md index df52bf9126..6df9b86e5e 100644 --- a/reference/ios/ios_base/Init/op_destructor.md +++ b/reference/ios/ios_base/Init/op_destructor.md @@ -22,8 +22,8 @@ - C++98 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5.0, 3.6.0, 3.7.0, 3.8.0 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0, 4.9.1, 4.9.2, 5.1.0, 5.2.0, 6.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5.0 [mark verified], 3.6.0 [mark verified], 3.7.0 [mark verified], 3.8.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.1.0 [mark verified], 5.2.0 [mark verified], 6.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ios/ios_base/failure.md b/reference/ios/ios_base/failure.md index 26816fa36b..50f2175d1d 100644 --- a/reference/ios/ios_base/failure.md +++ b/reference/ios/ios_base/failure.md @@ -61,8 +61,8 @@ C++11 からは、エラー内容としてメッセージだけではなく、[` - C++98 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5.0, 3.6.0, 3.7.0, 3.8.0 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0, 4.9.1, 4.9.2, 5.1.0, 5.2.0, 6.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5.0 [mark verified], 3.6.0 [mark verified], 3.7.0 [mark verified], 3.8.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.1.0 [mark verified], 5.2.0 [mark verified], 6.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ios/ios_base/failure/op_constructor.md b/reference/ios/ios_base/failure/op_constructor.md index 8a1e73e340..1b068c3602 100644 --- a/reference/ios/ios_base/failure/op_constructor.md +++ b/reference/ios/ios_base/failure/op_constructor.md @@ -75,8 +75,8 @@ error message: No such file or directory - C++98 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5.0, 3.6.0, 3.7.0, 3.8.0 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0, 4.9.1, 4.9.2, 5.1.0, 5.2.0, 6.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5.0 [mark verified], 3.6.0 [mark verified], 3.7.0 [mark verified], 3.8.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.1.0 [mark verified], 5.2.0 [mark verified], 6.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ios/ios_base/failure/what.md b/reference/ios/ios_base/failure/what.md index a3ef1b4eeb..8c010e1f0b 100644 --- a/reference/ios/ios_base/failure/what.md +++ b/reference/ios/ios_base/failure/what.md @@ -46,8 +46,8 @@ error message - C++98 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5.0, 3.6.0, 3.7.0, 3.8.0 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0, 4.9.1, 4.9.2, 5.1.0, 5.2.0, 6.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5.0 [mark verified], 3.6.0 [mark verified], 3.7.0 [mark verified], 3.8.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.1.0 [mark verified], 5.2.0 [mark verified], 6.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ios/ios_base/flags.md b/reference/ios/ios_base/flags.md index 5b111be2bc..d51f00a3c3 100644 --- a/reference/ios/ios_base/flags.md +++ b/reference/ios/ios_base/flags.md @@ -85,8 +85,8 @@ int main() - C++98 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5.0, 3.6.0, 3.7.0, 3.8.0 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0, 4.9.1, 4.9.2, 5.1.0, 5.2.0, 6.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5.0 [mark verified], 3.6.0 [mark verified], 3.7.0 [mark verified], 3.8.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.1.0 [mark verified], 5.2.0 [mark verified], 6.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ios/ios_base/getloc.md b/reference/ios/ios_base/getloc.md index fcc7ae3c52..1c5c21f74c 100644 --- a/reference/ios/ios_base/getloc.md +++ b/reference/ios/ios_base/getloc.md @@ -56,8 +56,8 @@ en_US.UTF-8 - C++98 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5.0, 3.6.0, 3.7.0, 3.8.0 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0, 4.9.1, 4.9.2, 5.1.0, 5.2.0, 6.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5.0 [mark verified], 3.6.0 [mark verified], 3.7.0 [mark verified], 3.8.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.1.0 [mark verified], 5.2.0 [mark verified], 6.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ios/ios_base/imbue.md b/reference/ios/ios_base/imbue.md index f7fc7b126b..bcf870b3d1 100644 --- a/reference/ios/ios_base/imbue.md +++ b/reference/ios/ios_base/imbue.md @@ -62,8 +62,8 @@ int main() - C++98 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5.0, 3.6.0, 3.7.0, 3.8.0 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0, 4.9.1, 4.9.2, 5.1.0, 5.2.0, 6.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5.0 [mark verified], 3.6.0 [mark verified], 3.7.0 [mark verified], 3.8.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.1.0 [mark verified], 5.2.0 [mark verified], 6.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ios/ios_base/op_assign.md b/reference/ios/ios_base/op_assign.md index 0a3b54d33e..55fe54c5c0 100644 --- a/reference/ios/ios_base/op_assign.md +++ b/reference/ios/ios_base/op_assign.md @@ -31,8 +31,8 @@ public: - C++98 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5.0, 3.6.0, 3.7.0, 3.8.0 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0, 4.9.1, 4.9.2, 5.1.0, 5.2.0, 6.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5.0 [mark verified], 3.6.0 [mark verified], 3.7.0 [mark verified], 3.8.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.1.0 [mark verified], 5.2.0 [mark verified], 6.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ios/ios_base/op_constructor.md b/reference/ios/ios_base/op_constructor.md index 0f02d2535d..891ac736b4 100644 --- a/reference/ios/ios_base/op_constructor.md +++ b/reference/ios/ios_base/op_constructor.md @@ -39,8 +39,8 @@ public: - C++98 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5.0, 3.6.0, 3.7.0, 3.8.0 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0, 4.9.1, 4.9.2, 5.1.0, 5.2.0, 6.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5.0 [mark verified], 3.6.0 [mark verified], 3.7.0 [mark verified], 3.8.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.1.0 [mark verified], 5.2.0 [mark verified], 6.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ios/ios_base/op_destructor.md b/reference/ios/ios_base/op_destructor.md index fdd0e08d96..8231a0cbea 100644 --- a/reference/ios/ios_base/op_destructor.md +++ b/reference/ios/ios_base/op_destructor.md @@ -23,8 +23,8 @@ virtual ~ios_base(); - C++98 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5.0, 3.6.0, 3.7.0, 3.8.0 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0, 4.9.1, 4.9.2, 5.1.0, 5.2.0, 6.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5.0 [mark verified], 3.6.0 [mark verified], 3.7.0 [mark verified], 3.8.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.1.0 [mark verified], 5.2.0 [mark verified], 6.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ios/ios_base/precision.md b/reference/ios/ios_base/precision.md index 15f2a4c5d6..5fb796fabc 100644 --- a/reference/ios/ios_base/precision.md +++ b/reference/ios/ios_base/precision.md @@ -74,8 +74,8 @@ int main() - C++98 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5.0, 3.6.0, 3.7.0, 3.8.0 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0, 4.9.1, 4.9.2, 5.1.0, 5.2.0, 6.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5.0 [mark verified], 3.6.0 [mark verified], 3.7.0 [mark verified], 3.8.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.1.0 [mark verified], 5.2.0 [mark verified], 6.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ios/ios_base/register_callback.md b/reference/ios/ios_base/register_callback.md index 45df7a602e..efba09c023 100644 --- a/reference/ios/ios_base/register_callback.md +++ b/reference/ios/ios_base/register_callback.md @@ -117,8 +117,8 @@ event = erase_event, index = 0 - C++98 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5.0, 3.6.0, 3.7.0, 3.8.0 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0, 4.9.1, 4.9.2, 5.1.0, 5.2.0, 6.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5.0 [mark verified], 3.6.0 [mark verified], 3.7.0 [mark verified], 3.8.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.1.0 [mark verified], 5.2.0 [mark verified], 6.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ios/ios_base/setf.md b/reference/ios/ios_base/setf.md index f787bad0ba..7b8ab15097 100644 --- a/reference/ios/ios_base/setf.md +++ b/reference/ios/ios_base/setf.md @@ -77,8 +77,8 @@ true - C++98 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5.0, 3.6.0, 3.7.0, 3.8.0 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0, 4.9.1, 4.9.2, 5.1.0, 5.2.0, 6.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5.0 [mark verified], 3.6.0 [mark verified], 3.7.0 [mark verified], 3.8.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.1.0 [mark verified], 5.2.0 [mark verified], 6.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ios/ios_base/type-event.md b/reference/ios/ios_base/type-event.md index 3886c40327..bc59431738 100644 --- a/reference/ios/ios_base/type-event.md +++ b/reference/ios/ios_base/type-event.md @@ -99,8 +99,8 @@ event = erase_event, str = ss1, index = 0, getloc.name = C - C++98 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5.0, 3.6.0, 3.7.0, 3.8.0 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0, 4.9.1, 4.9.2, 5.1.0, 5.2.0, 6.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5.0 [mark verified], 3.6.0 [mark verified], 3.7.0 [mark verified], 3.8.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.1.0 [mark verified], 5.2.0 [mark verified], 6.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ios/ios_base/type-event_callback.md b/reference/ios/ios_base/type-event_callback.md index 218fcf2d2e..723f9a00bd 100644 --- a/reference/ios/ios_base/type-event_callback.md +++ b/reference/ios/ios_base/type-event_callback.md @@ -28,8 +28,8 @@ using event_callback = void(*)(event ev, ios_base& str, int index); - C++98 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5.0, 3.6.0, 3.7.0, 3.8.0 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0, 4.9.1, 4.9.2, 5.1.0, 5.2.0, 6.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5.0 [mark verified], 3.6.0 [mark verified], 3.7.0 [mark verified], 3.8.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.1.0 [mark verified], 5.2.0 [mark verified], 6.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ios/ios_base/type-fmtflags.md b/reference/ios/ios_base/type-fmtflags.md index b1cca8cf21..961545911b 100644 --- a/reference/ios/ios_base/type-fmtflags.md +++ b/reference/ios/ios_base/type-fmtflags.md @@ -259,8 +259,8 @@ int main() - C++11(`fixed | scientific` による 16 進浮動小数点出力のみ) ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5.0, 3.6.0, 3.7.0, 3.8.0 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0, 4.9.1, 4.9.2, 5.1.0, 5.2.0, 6.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5.0 [mark verified], 3.6.0 [mark verified], 3.7.0 [mark verified], 3.8.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.1.0 [mark verified], 5.2.0 [mark verified], 6.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ios/ios_base/type-iostate.md b/reference/ios/ios_base/type-iostate.md index dd49e4362e..c03dd199a1 100644 --- a/reference/ios/ios_base/type-iostate.md +++ b/reference/ios/ios_base/type-iostate.md @@ -93,8 +93,8 @@ failbit = false - C++98 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5.0, 3.6.0, 3.7.0, 3.8.0 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0, 4.9.1, 4.9.2, 5.1.0, 5.2.0, 6.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5.0 [mark verified], 3.6.0 [mark verified], 3.7.0 [mark verified], 3.8.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.1.0 [mark verified], 5.2.0 [mark verified], 6.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ios/ios_base/type-openmode.md b/reference/ios/ios_base/type-openmode.md index 034a5f9ef3..726c56f5f2 100644 --- a/reference/ios/ios_base/type-openmode.md +++ b/reference/ios/ios_base/type-openmode.md @@ -133,8 +133,8 @@ test1TE2ST3 - C++98 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5.0, 3.6.0, 3.7.0, 3.8.0 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0, 4.9.1, 4.9.2, 5.1.0, 5.2.0, 6.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5.0 [mark verified], 3.6.0 [mark verified], 3.7.0 [mark verified], 3.8.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.1.0 [mark verified], 5.2.0 [mark verified], 6.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ios/ios_base/type-seekdir.md b/reference/ios/ios_base/type-seekdir.md index e5b3a674d9..77d2c1e203 100644 --- a/reference/ios/ios_base/type-seekdir.md +++ b/reference/ios/ios_base/type-seekdir.md @@ -124,7 +124,7 @@ ABCrefjpYZ - C++98 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5.0, 3.6.0, 3.7.0, 3.8.0 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0, 4.9.1, 4.9.2, 5.1.0, 5.2.0, 6.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5.0 [mark verified], 3.6.0 [mark verified], 3.7.0 [mark verified], 3.8.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.1.0 [mark verified], 5.2.0 [mark verified], 6.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ios/ios_base/unsetf.md b/reference/ios/ios_base/unsetf.md index f805f920e5..df86397c51 100644 --- a/reference/ios/ios_base/unsetf.md +++ b/reference/ios/ios_base/unsetf.md @@ -94,8 +94,8 @@ true - C++98 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5.0, 3.6.0, 3.7.0, 3.8.0 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0, 4.9.1, 4.9.2, 5.1.0, 5.2.0, 6.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5.0 [mark verified], 3.6.0 [mark verified], 3.7.0 [mark verified], 3.8.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.1.0 [mark verified], 5.2.0 [mark verified], 6.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ios/ios_base/width.md b/reference/ios/ios_base/width.md index e44b2f5fef..832b38a366 100644 --- a/reference/ios/ios_base/width.md +++ b/reference/ios/ios_base/width.md @@ -63,8 +63,8 @@ int main() - C++98 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5.0, 3.6.0, 3.7.0, 3.8.0 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0, 4.9.1, 4.9.2, 5.1.0, 5.2.0, 6.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5.0 [mark verified], 3.6.0 [mark verified], 3.7.0 [mark verified], 3.8.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.1.0 [mark verified], 5.2.0 [mark verified], 6.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ios/iostream_category.md b/reference/ios/iostream_category.md index 14a73c5895..68f25c52a4 100644 --- a/reference/ios/iostream_category.md +++ b/reference/ios/iostream_category.md @@ -63,7 +63,7 @@ iostream stream error - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified] ## 参照 diff --git a/reference/ios/is_error_code_enum.md b/reference/ios/is_error_code_enum.md index b058053452..78703ce4c7 100644 --- a/reference/ios/is_error_code_enum.md +++ b/reference/ios/is_error_code_enum.md @@ -47,7 +47,7 @@ iostream stream error - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/ios/make_error_code.md b/reference/ios/make_error_code.md index 5e69290596..228bd95712 100644 --- a/reference/ios/make_error_code.md +++ b/reference/ios/make_error_code.md @@ -60,7 +60,7 @@ message : iostream stream error - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified] ## 参照 diff --git a/reference/ios/make_error_condition.md b/reference/ios/make_error_condition.md index 901e550b9d..e52c2b7c3a 100644 --- a/reference/ios/make_error_condition.md +++ b/reference/ios/make_error_condition.md @@ -61,7 +61,7 @@ message : iostream stream error - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified] ## 参照 diff --git a/reference/iterator/basic_const_iterator.md b/reference/iterator/basic_const_iterator.md index e3784acf17..b73036e646 100644 --- a/reference/iterator/basic_const_iterator.md +++ b/reference/iterator/basic_const_iterator.md @@ -123,8 +123,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 diff --git a/reference/iterator/basic_const_iterator/base.md b/reference/iterator/basic_const_iterator/base.md index c8f53374ae..3b9268733a 100644 --- a/reference/iterator/basic_const_iterator/base.md +++ b/reference/iterator/basic_const_iterator/base.md @@ -55,8 +55,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 diff --git a/reference/iterator/basic_const_iterator/common_type.md b/reference/iterator/basic_const_iterator/common_type.md index cc4aa27de6..88be1e536f 100644 --- a/reference/iterator/basic_const_iterator/common_type.md +++ b/reference/iterator/basic_const_iterator/common_type.md @@ -73,8 +73,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 関連項目 diff --git a/reference/iterator/basic_const_iterator/iter_move.md b/reference/iterator/basic_const_iterator/iter_move.md index 022a1fe645..8cb1348f2b 100644 --- a/reference/iterator/basic_const_iterator/iter_move.md +++ b/reference/iterator/basic_const_iterator/iter_move.md @@ -77,8 +77,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 diff --git a/reference/iterator/basic_const_iterator/op_arrow.md b/reference/iterator/basic_const_iterator/op_arrow.md index 6b4a247bd4..cd01a78f74 100644 --- a/reference/iterator/basic_const_iterator/op_arrow.md +++ b/reference/iterator/basic_const_iterator/op_arrow.md @@ -67,8 +67,8 @@ call const : 1 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 diff --git a/reference/iterator/basic_const_iterator/op_at.md b/reference/iterator/basic_const_iterator/op_at.md index 00f9f55a80..121d7e55b1 100644 --- a/reference/iterator/basic_const_iterator/op_at.md +++ b/reference/iterator/basic_const_iterator/op_at.md @@ -56,8 +56,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 diff --git a/reference/iterator/basic_const_iterator/op_compare_3way.md b/reference/iterator/basic_const_iterator/op_compare_3way.md index e4294b7c8c..1af8a59ffb 100644 --- a/reference/iterator/basic_const_iterator/op_compare_3way.md +++ b/reference/iterator/basic_const_iterator/op_compare_3way.md @@ -95,8 +95,8 @@ false ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 diff --git a/reference/iterator/basic_const_iterator/op_constructor.md b/reference/iterator/basic_const_iterator/op_constructor.md index 40b7ccc3d3..4a0e0688c8 100644 --- a/reference/iterator/basic_const_iterator/op_constructor.md +++ b/reference/iterator/basic_const_iterator/op_constructor.md @@ -80,8 +80,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 diff --git a/reference/iterator/basic_const_iterator/op_decrement.md b/reference/iterator/basic_const_iterator/op_decrement.md index d53aef4f59..635a410b9d 100644 --- a/reference/iterator/basic_const_iterator/op_decrement.md +++ b/reference/iterator/basic_const_iterator/op_decrement.md @@ -71,8 +71,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 diff --git a/reference/iterator/basic_const_iterator/op_deref.md b/reference/iterator/basic_const_iterator/op_deref.md index e856b9bfcc..b93d4c3544 100644 --- a/reference/iterator/basic_const_iterator/op_deref.md +++ b/reference/iterator/basic_const_iterator/op_deref.md @@ -51,8 +51,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 diff --git a/reference/iterator/basic_const_iterator/op_equal.md b/reference/iterator/basic_const_iterator/op_equal.md index d9bfd98ecd..dc3b1a55c4 100644 --- a/reference/iterator/basic_const_iterator/op_equal.md +++ b/reference/iterator/basic_const_iterator/op_equal.md @@ -96,8 +96,8 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 diff --git a/reference/iterator/basic_const_iterator/op_greater.md b/reference/iterator/basic_const_iterator/op_greater.md index 9feb50dd98..1ab08feab8 100644 --- a/reference/iterator/basic_const_iterator/op_greater.md +++ b/reference/iterator/basic_const_iterator/op_greater.md @@ -100,8 +100,8 @@ false ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 diff --git a/reference/iterator/basic_const_iterator/op_greater_equal.md b/reference/iterator/basic_const_iterator/op_greater_equal.md index 30d4283c7c..36c64b3e4f 100644 --- a/reference/iterator/basic_const_iterator/op_greater_equal.md +++ b/reference/iterator/basic_const_iterator/op_greater_equal.md @@ -100,8 +100,8 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 diff --git a/reference/iterator/basic_const_iterator/op_increment.md b/reference/iterator/basic_const_iterator/op_increment.md index 6a67cbc7ed..bc2c4c577e 100644 --- a/reference/iterator/basic_const_iterator/op_increment.md +++ b/reference/iterator/basic_const_iterator/op_increment.md @@ -73,8 +73,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 diff --git a/reference/iterator/basic_const_iterator/op_less.md b/reference/iterator/basic_const_iterator/op_less.md index dcc2b40091..d8da4d0b8f 100644 --- a/reference/iterator/basic_const_iterator/op_less.md +++ b/reference/iterator/basic_const_iterator/op_less.md @@ -100,8 +100,8 @@ false ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 diff --git a/reference/iterator/basic_const_iterator/op_less_equal.md b/reference/iterator/basic_const_iterator/op_less_equal.md index 2dd0ba4074..13fb1c0ff5 100644 --- a/reference/iterator/basic_const_iterator/op_less_equal.md +++ b/reference/iterator/basic_const_iterator/op_less_equal.md @@ -100,8 +100,8 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 diff --git a/reference/iterator/basic_const_iterator/op_minus.md b/reference/iterator/basic_const_iterator/op_minus.md index 76a2945f07..4c1b545464 100644 --- a/reference/iterator/basic_const_iterator/op_minus.md +++ b/reference/iterator/basic_const_iterator/op_minus.md @@ -85,8 +85,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 diff --git a/reference/iterator/basic_const_iterator/op_minus_assign.md b/reference/iterator/basic_const_iterator/op_minus_assign.md index c54ef70b6f..4e54866dd2 100644 --- a/reference/iterator/basic_const_iterator/op_minus_assign.md +++ b/reference/iterator/basic_const_iterator/op_minus_assign.md @@ -55,8 +55,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 diff --git a/reference/iterator/basic_const_iterator/op_plus.md b/reference/iterator/basic_const_iterator/op_plus.md index 6b86486740..a3b0c83245 100644 --- a/reference/iterator/basic_const_iterator/op_plus.md +++ b/reference/iterator/basic_const_iterator/op_plus.md @@ -66,8 +66,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 diff --git a/reference/iterator/basic_const_iterator/op_plus_assign.md b/reference/iterator/basic_const_iterator/op_plus_assign.md index a5b708b6e2..741efcdb52 100644 --- a/reference/iterator/basic_const_iterator/op_plus_assign.md +++ b/reference/iterator/basic_const_iterator/op_plus_assign.md @@ -56,8 +56,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 diff --git a/reference/iterator/basic_const_iterator/op_unary_minus.md b/reference/iterator/basic_const_iterator/op_unary_minus.md index 5e991296db..7b1f974788 100644 --- a/reference/iterator/basic_const_iterator/op_unary_minus.md +++ b/reference/iterator/basic_const_iterator/op_unary_minus.md @@ -61,8 +61,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 diff --git a/reference/iterator/begin.md b/reference/iterator/begin.md index e866c0373a..9bb8652b16 100644 --- a/reference/iterator/begin.md +++ b/reference/iterator/begin.md @@ -96,7 +96,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/iterator/bidirectional_iterator.md b/reference/iterator/bidirectional_iterator.md index c85f4c49b3..c604a34e72 100644 --- a/reference/iterator/bidirectional_iterator.md +++ b/reference/iterator/bidirectional_iterator.md @@ -116,8 +116,8 @@ std::ostream_iterator is not bidirectional_iterator ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 関連項目 diff --git a/reference/iterator/cbegin.md b/reference/iterator/cbegin.md index 2688a4c032..1be42dc089 100644 --- a/reference/iterator/cbegin.md +++ b/reference/iterator/cbegin.md @@ -60,8 +60,8 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.4 -- [GCC](/implementation.md#gcc): 5.0 +- [Clang](/implementation.md#clang): 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 5.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/iterator/cend.md b/reference/iterator/cend.md index bde2b7f563..db2ff91cd6 100644 --- a/reference/iterator/cend.md +++ b/reference/iterator/cend.md @@ -60,8 +60,8 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.4 -- [GCC](/implementation.md#gcc): 5.0 +- [Clang](/implementation.md#clang): 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 5.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/iterator/common_iterator.md b/reference/iterator/common_iterator.md index 9b94324ea1..3ed5352869 100644 --- a/reference/iterator/common_iterator.md +++ b/reference/iterator/common_iterator.md @@ -137,8 +137,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 [mark verified] ## 関連項目 diff --git a/reference/iterator/common_iterator/iter_move.md b/reference/iterator/common_iterator/iter_move.md index f2afd766a6..3b111f3346 100644 --- a/reference/iterator/common_iterator/iter_move.md +++ b/reference/iterator/common_iterator/iter_move.md @@ -84,8 +84,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 [mark verified] ## 関連項目 diff --git a/reference/iterator/common_iterator/iter_swap.md b/reference/iterator/common_iterator/iter_swap.md index b1a62876bb..d6c283432d 100644 --- a/reference/iterator/common_iterator/iter_swap.md +++ b/reference/iterator/common_iterator/iter_swap.md @@ -94,8 +94,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 [mark verified] ## 関連項目 diff --git a/reference/iterator/common_iterator/op_arrow.md b/reference/iterator/common_iterator/op_arrow.md index df4f11843b..7ece47fc32 100644 --- a/reference/iterator/common_iterator/op_arrow.md +++ b/reference/iterator/common_iterator/op_arrow.md @@ -69,8 +69,8 @@ indirectly_readable && ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 [mark verified] ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/iterator/common_iterator/op_assign.md b/reference/iterator/common_iterator/op_assign.md index 34a91aa65b..b86eb379ca 100644 --- a/reference/iterator/common_iterator/op_assign.md +++ b/reference/iterator/common_iterator/op_assign.md @@ -39,8 +39,8 @@ common_iterator& operator=(const common_iterator& x); ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 [mark verified] ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/iterator/common_iterator/op_constructor.md b/reference/iterator/common_iterator/op_constructor.md index 260568aeec..6f470c8934 100644 --- a/reference/iterator/common_iterator/op_constructor.md +++ b/reference/iterator/common_iterator/op_constructor.md @@ -83,8 +83,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 [mark verified] ## 関連項目 diff --git a/reference/iterator/common_iterator/op_deref.md b/reference/iterator/common_iterator/op_deref.md index 0a52510bff..5058f262bb 100644 --- a/reference/iterator/common_iterator/op_deref.md +++ b/reference/iterator/common_iterator/op_deref.md @@ -64,8 +64,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 [mark verified] ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/iterator/common_iterator/op_equal.md b/reference/iterator/common_iterator/op_equal.md index 0a900c34b1..67cae50ff1 100644 --- a/reference/iterator/common_iterator/op_equal.md +++ b/reference/iterator/common_iterator/op_equal.md @@ -104,8 +104,8 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 [mark verified] ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/iterator/common_iterator/op_increment.md b/reference/iterator/common_iterator/op_increment.md index cc59edbef7..8706b1013f 100644 --- a/reference/iterator/common_iterator/op_increment.md +++ b/reference/iterator/common_iterator/op_increment.md @@ -82,8 +82,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 [mark verified] ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/iterator/common_iterator/op_minus.md b/reference/iterator/common_iterator/op_minus.md index 53073a1fbf..b71ef55730 100644 --- a/reference/iterator/common_iterator/op_minus.md +++ b/reference/iterator/common_iterator/op_minus.md @@ -80,8 +80,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 [mark verified] ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/iterator/const_iterator.md b/reference/iterator/const_iterator.md index 91e997fbe8..7df5c7612a 100644 --- a/reference/iterator/const_iterator.md +++ b/reference/iterator/const_iterator.md @@ -1,55 +1,55 @@ -# const_iterator -* iterator[meta header] -* std[meta namespace] -* type-alias[meta id-type] -* cpp23[meta cpp] - -```cpp -namespace std { - template - using const_iterator = /*see below*/; -} -``` -* input_iterator[link input_iterator.md] - -## 概要 - -任意のイテレータ型`I`を、定数イテレータ型へ変換する。 - -## 効果 - -- `I`が[`constant-iterator`](constant-iterator.md)のモデルとなる場合 : `I` -- それ以外の場合 : [`basic_const_iterator`](basic_const_iterator.md)`` - -## 例 -```cpp example -#include - -int main() { - static_assert(std::same_as, std::basic_const_iterator>); - static_assert(std::same_as, const int*>); - - using vec_iter = std::vector::iterator; - - static_assert(std::same_as, std::basic_const_iterator>); - static_assert(std::same_as>, std::const_iterator>); -} -``` -* std::const_iterator[color ff0000] - -### 出力 -``` -``` - -## バージョン -### 言語 -- C++23 - -### 処理系 -- [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 - -## 参照 - -- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) +# const_iterator +* iterator[meta header] +* std[meta namespace] +* type-alias[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template + using const_iterator = /*see below*/; +} +``` +* input_iterator[link input_iterator.md] + +## 概要 + +任意のイテレータ型`I`を、定数イテレータ型へ変換する。 + +## 効果 + +- `I`が[`constant-iterator`](constant-iterator.md)のモデルとなる場合 : `I` +- それ以外の場合 : [`basic_const_iterator`](basic_const_iterator.md)`` + +## 例 +```cpp example +#include + +int main() { + static_assert(std::same_as, std::basic_const_iterator>); + static_assert(std::same_as, const int*>); + + using vec_iter = std::vector::iterator; + + static_assert(std::same_as, std::basic_const_iterator>); + static_assert(std::same_as>, std::const_iterator>); +} +``` +* std::const_iterator[color ff0000] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) diff --git a/reference/iterator/const_sentinel.md b/reference/iterator/const_sentinel.md index 483495e3d2..c174d4bad1 100644 --- a/reference/iterator/const_sentinel.md +++ b/reference/iterator/const_sentinel.md @@ -52,8 +52,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 diff --git a/reference/iterator/contiguous_iterator.md b/reference/iterator/contiguous_iterator.md index 0271281b18..712c3e7a7d 100644 --- a/reference/iterator/contiguous_iterator.md +++ b/reference/iterator/contiguous_iterator.md @@ -98,8 +98,8 @@ std::ostream_iterator is not contiguous_iterator ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 関連項目 diff --git a/reference/iterator/counted_iterator.md b/reference/iterator/counted_iterator.md index 20d01029c8..abfe1184ea 100644 --- a/reference/iterator/counted_iterator.md +++ b/reference/iterator/counted_iterator.md @@ -131,8 +131,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 8 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 8 [mark verified] ## 関連項目 diff --git a/reference/iterator/counted_iterator/base.md b/reference/iterator/counted_iterator/base.md index f66dcb9472..27134d33a9 100644 --- a/reference/iterator/counted_iterator/base.md +++ b/reference/iterator/counted_iterator/base.md @@ -55,8 +55,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 8 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 8 [mark verified] ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/iterator/counted_iterator/count.md b/reference/iterator/counted_iterator/count.md index 186f10f211..b5eaeae2df 100644 --- a/reference/iterator/counted_iterator/count.md +++ b/reference/iterator/counted_iterator/count.md @@ -54,8 +54,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 8 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 8 [mark verified] ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/iterator/counted_iterator/iter_move.md b/reference/iterator/counted_iterator/iter_move.md index 6a19d74163..00ef58d829 100644 --- a/reference/iterator/counted_iterator/iter_move.md +++ b/reference/iterator/counted_iterator/iter_move.md @@ -76,8 +76,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 [mark verified] ## 関連項目 diff --git a/reference/iterator/counted_iterator/iter_swap.md b/reference/iterator/counted_iterator/iter_swap.md index 30c4a7deb4..3d0405be63 100644 --- a/reference/iterator/counted_iterator/iter_swap.md +++ b/reference/iterator/counted_iterator/iter_swap.md @@ -81,8 +81,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 [mark verified] ## 関連項目 diff --git a/reference/iterator/counted_iterator/op_arrow.md b/reference/iterator/counted_iterator/op_arrow.md index 48c0a7ab0f..4fcfcfeb70 100644 --- a/reference/iterator/counted_iterator/op_arrow.md +++ b/reference/iterator/counted_iterator/op_arrow.md @@ -67,8 +67,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 12.0 -- [Visual C++](/implementation.md#visual_cpp): 2022 +- [GCC](/implementation.md#gcc): 12.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 [mark verified] ## 参照 - [P2259R1 Repairing input range adaptors and `counted_iterator`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2259r1.html) diff --git a/reference/iterator/counted_iterator/op_assign.md b/reference/iterator/counted_iterator/op_assign.md index 53fcd0fc4a..b22c79462b 100644 --- a/reference/iterator/counted_iterator/op_assign.md +++ b/reference/iterator/counted_iterator/op_assign.md @@ -32,8 +32,8 @@ constexpr counted_iterator& operator=(const counted_iterator& x); ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 8 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 8 [mark verified] ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/iterator/counted_iterator/op_at.md b/reference/iterator/counted_iterator/op_at.md index 1ca1784d2d..07170721d0 100644 --- a/reference/iterator/counted_iterator/op_at.md +++ b/reference/iterator/counted_iterator/op_at.md @@ -59,8 +59,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 8 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 8 [mark verified] ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/iterator/counted_iterator/op_compare_3way.md b/reference/iterator/counted_iterator/op_compare_3way.md index 849bf047ba..c505e5e391 100644 --- a/reference/iterator/counted_iterator/op_compare_3way.md +++ b/reference/iterator/counted_iterator/op_compare_3way.md @@ -96,8 +96,8 @@ false ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 [mark verified] ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/iterator/counted_iterator/op_constructor.md b/reference/iterator/counted_iterator/op_constructor.md index 4e47751e3e..bf30c6bcce 100644 --- a/reference/iterator/counted_iterator/op_constructor.md +++ b/reference/iterator/counted_iterator/op_constructor.md @@ -67,8 +67,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 8 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 8 [mark verified] ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/iterator/counted_iterator/op_decrement.md b/reference/iterator/counted_iterator/op_decrement.md index eab0590c91..9b88f07d29 100644 --- a/reference/iterator/counted_iterator/op_decrement.md +++ b/reference/iterator/counted_iterator/op_decrement.md @@ -82,8 +82,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 [mark verified] ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/iterator/counted_iterator/op_deref.md b/reference/iterator/counted_iterator/op_deref.md index 68890e3f32..9d9bed5037 100644 --- a/reference/iterator/counted_iterator/op_deref.md +++ b/reference/iterator/counted_iterator/op_deref.md @@ -60,8 +60,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 8 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 8 [mark verified] ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/iterator/counted_iterator/op_equal.md b/reference/iterator/counted_iterator/op_equal.md index eceeae1cd4..a446c71c19 100644 --- a/reference/iterator/counted_iterator/op_equal.md +++ b/reference/iterator/counted_iterator/op_equal.md @@ -98,8 +98,8 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 [mark verified] ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/iterator/counted_iterator/op_increment.md b/reference/iterator/counted_iterator/op_increment.md index 313715cd86..f3cc8ae6a6 100644 --- a/reference/iterator/counted_iterator/op_increment.md +++ b/reference/iterator/counted_iterator/op_increment.md @@ -94,8 +94,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 [mark verified] ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/iterator/counted_iterator/op_minus.md b/reference/iterator/counted_iterator/op_minus.md index 03f0e9b52f..772ef00e7d 100644 --- a/reference/iterator/counted_iterator/op_minus.md +++ b/reference/iterator/counted_iterator/op_minus.md @@ -82,8 +82,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 [mark verified] ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/iterator/counted_iterator/op_minus_assign.md b/reference/iterator/counted_iterator/op_minus_assign.md index 732a3a273b..f3c68f284d 100644 --- a/reference/iterator/counted_iterator/op_minus_assign.md +++ b/reference/iterator/counted_iterator/op_minus_assign.md @@ -65,8 +65,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 [mark verified] ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/iterator/counted_iterator/op_plus.md b/reference/iterator/counted_iterator/op_plus.md index e1fb301afe..7cc74ad0f0 100644 --- a/reference/iterator/counted_iterator/op_plus.md +++ b/reference/iterator/counted_iterator/op_plus.md @@ -79,8 +79,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 [mark verified] ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/iterator/counted_iterator/op_plus_assign.md b/reference/iterator/counted_iterator/op_plus_assign.md index b2ed9d86d7..4ef840d422 100644 --- a/reference/iterator/counted_iterator/op_plus_assign.md +++ b/reference/iterator/counted_iterator/op_plus_assign.md @@ -64,8 +64,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 [mark verified] ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/iterator/counted_iterator/op_unary_minus.md b/reference/iterator/counted_iterator/op_unary_minus.md index 1132eea2d5..cf2ace4b04 100644 --- a/reference/iterator/counted_iterator/op_unary_minus.md +++ b/reference/iterator/counted_iterator/op_unary_minus.md @@ -60,8 +60,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 9 [mark verified] ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/iterator/crbegin.md b/reference/iterator/crbegin.md index 7c5e77d41c..1b3a8481a9 100644 --- a/reference/iterator/crbegin.md +++ b/reference/iterator/crbegin.md @@ -86,8 +86,8 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.4 -- [GCC](/implementation.md#gcc): 5.0 +- [Clang](/implementation.md#clang): 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 5.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/iterator/crend.md b/reference/iterator/crend.md index 16da92e41e..01db6bd29b 100644 --- a/reference/iterator/crend.md +++ b/reference/iterator/crend.md @@ -86,8 +86,8 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.4 -- [GCC](/implementation.md#gcc): 5.0 +- [Clang](/implementation.md#clang): 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 5.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/iterator/data.md b/reference/iterator/data.md index ea54be6b53..ed7f419c8c 100644 --- a/reference/iterator/data.md +++ b/reference/iterator/data.md @@ -80,10 +80,10 @@ array size:1 at 0x22e42b0 - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 3.6 -- [GCC](/implementation.md#gcc): 6.1 +- [Clang](/implementation.md#clang): 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 6.1 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] ## 参照 diff --git a/reference/iterator/default_sentinel_t.md b/reference/iterator/default_sentinel_t.md index 48941620f8..3ad3e1c355 100644 --- a/reference/iterator/default_sentinel_t.md +++ b/reference/iterator/default_sentinel_t.md @@ -52,8 +52,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 7 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 7 [mark verified] ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/iterator/disable_sized_sentinel_for.md b/reference/iterator/disable_sized_sentinel_for.md index 56a3b6d7fe..ab8760c2a3 100644 --- a/reference/iterator/disable_sized_sentinel_for.md +++ b/reference/iterator/disable_sized_sentinel_for.md @@ -40,8 +40,8 @@ namespace std { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 関連項目 diff --git a/reference/iterator/empty.md b/reference/iterator/empty.md index da2e9f12d7..d0f3c93735 100644 --- a/reference/iterator/empty.md +++ b/reference/iterator/empty.md @@ -92,10 +92,10 @@ false - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 3.6 -- [GCC](/implementation.md#gcc): 6.1 +- [Clang](/implementation.md#clang): 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 6.1 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] ## 参照 diff --git a/reference/iterator/end.md b/reference/iterator/end.md index d18b72256d..9ce6ab36f4 100644 --- a/reference/iterator/end.md +++ b/reference/iterator/end.md @@ -96,7 +96,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/iterator/forward_iterator.md b/reference/iterator/forward_iterator.md index c0d462e4e4..7947edc144 100644 --- a/reference/iterator/forward_iterator.md +++ b/reference/iterator/forward_iterator.md @@ -115,8 +115,8 @@ std::ostream_iterator is not forward_iterator ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 関連項目 diff --git a/reference/iterator/incrementable.md b/reference/iterator/incrementable.md index 0ca128affd..ae957aaa37 100644 --- a/reference/iterator/incrementable.md +++ b/reference/iterator/incrementable.md @@ -103,8 +103,8 @@ sample_weak_incrementable is not incrementable ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 関連項目 diff --git a/reference/iterator/incrementable_traits.md b/reference/iterator/incrementable_traits.md index 5315ed5ce9..f899a91ce0 100644 --- a/reference/iterator/incrementable_traits.md +++ b/reference/iterator/incrementable_traits.md @@ -122,8 +122,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 関連項目 diff --git a/reference/iterator/indirect_binary_predicate.md b/reference/iterator/indirect_binary_predicate.md index 1c50e9922f..1afed55369 100644 --- a/reference/iterator/indirect_binary_predicate.md +++ b/reference/iterator/indirect_binary_predicate.md @@ -86,8 +86,8 @@ std::istream_iterator and double* is not indirect_binary_predicate int(cons ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 関連項目 diff --git a/reference/iterator/indirect_equivalence_relation.md b/reference/iterator/indirect_equivalence_relation.md index 2c618dcbf4..e9d63421fe 100644 --- a/reference/iterator/indirect_equivalence_relation.md +++ b/reference/iterator/indirect_equivalence_relation.md @@ -89,8 +89,8 @@ std::istream_iterator is not indirect_equivalence_relation void(const int&, ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 関連項目 diff --git a/reference/iterator/indirect_result_t.md b/reference/iterator/indirect_result_t.md index 40ff439278..eaa48597a8 100644 --- a/reference/iterator/indirect_result_t.md +++ b/reference/iterator/indirect_result_t.md @@ -52,8 +52,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 参照 diff --git a/reference/iterator/indirect_strict_weak_order.md b/reference/iterator/indirect_strict_weak_order.md index 0c7cd39615..3605c4e86b 100644 --- a/reference/iterator/indirect_strict_weak_order.md +++ b/reference/iterator/indirect_strict_weak_order.md @@ -88,8 +88,8 @@ std::istream_iterator is not indirect_strict_weak_order void(const int&, co ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 関連項目 diff --git a/reference/iterator/indirect_unary_predicate.md b/reference/iterator/indirect_unary_predicate.md index b3fa2588cc..2b488b36ec 100644 --- a/reference/iterator/indirect_unary_predicate.md +++ b/reference/iterator/indirect_unary_predicate.md @@ -86,8 +86,8 @@ std::istream_iterator is not indirect_unary_predicate void(const int&) ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 関連項目 diff --git a/reference/iterator/indirectly_comparable.md b/reference/iterator/indirectly_comparable.md index 66bd81ce8d..00edf09220 100644 --- a/reference/iterator/indirectly_comparable.md +++ b/reference/iterator/indirectly_comparable.md @@ -76,8 +76,8 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 関連項目 diff --git a/reference/iterator/indirectly_copyable.md b/reference/iterator/indirectly_copyable.md index 9a2e0e1d58..77a4df426f 100644 --- a/reference/iterator/indirectly_copyable.md +++ b/reference/iterator/indirectly_copyable.md @@ -86,8 +86,8 @@ del_copy_assign* is not indirectly_copyable del_copy_assign* ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 関連項目 diff --git a/reference/iterator/indirectly_copyable_storable.md b/reference/iterator/indirectly_copyable_storable.md index 750a141c3a..39f008c45c 100644 --- a/reference/iterator/indirectly_copyable_storable.md +++ b/reference/iterator/indirectly_copyable_storable.md @@ -113,8 +113,8 @@ del_copy_assign* is not indirectly_copyable_storable del_copy_assign* ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 関連項目 diff --git a/reference/iterator/indirectly_movable.md b/reference/iterator/indirectly_movable.md index e42f7e5c6a..4cb3a590e0 100644 --- a/reference/iterator/indirectly_movable.md +++ b/reference/iterator/indirectly_movable.md @@ -80,8 +80,8 @@ std::ostream_iterator is not indirectly_movable std::istream_iterator ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 関連項目 diff --git a/reference/iterator/indirectly_movable_storable.md b/reference/iterator/indirectly_movable_storable.md index c3182e55b4..e6c6bde6be 100644 --- a/reference/iterator/indirectly_movable_storable.md +++ b/reference/iterator/indirectly_movable_storable.md @@ -104,8 +104,8 @@ del_copy_ctor* is not indirectly_movable_storable del_copy_ctor* ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 関連項目 diff --git a/reference/iterator/indirectly_readable.md b/reference/iterator/indirectly_readable.md index af05d5349c..7de3e01a84 100644 --- a/reference/iterator/indirectly_readable.md +++ b/reference/iterator/indirectly_readable.md @@ -102,8 +102,8 @@ std::optional is not indirectly readable ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 関連項目 diff --git a/reference/iterator/indirectly_readable_traits.md b/reference/iterator/indirectly_readable_traits.md index c8fbdf2f68..c8b9ef2e2b 100644 --- a/reference/iterator/indirectly_readable_traits.md +++ b/reference/iterator/indirectly_readable_traits.md @@ -140,8 +140,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 関連項目 diff --git a/reference/iterator/indirectly_swappable.md b/reference/iterator/indirectly_swappable.md index 037f205fdc..f9c8f34f4f 100644 --- a/reference/iterator/indirectly_swappable.md +++ b/reference/iterator/indirectly_swappable.md @@ -82,8 +82,8 @@ del_copy_ctor* is not indirectly_swappable del_copy_ctor* ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 関連項目 diff --git a/reference/iterator/indirectly_unary_invocable.md b/reference/iterator/indirectly_unary_invocable.md index 2a07efedfa..a7d8165ce2 100644 --- a/reference/iterator/indirectly_unary_invocable.md +++ b/reference/iterator/indirectly_unary_invocable.md @@ -107,8 +107,8 @@ std::istream_iterator is not indirectly_unary_invocable int(int&&) ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 関連項目 diff --git a/reference/iterator/indirectly_writable.md b/reference/iterator/indirectly_writable.md index f0974db85e..5add5958b0 100644 --- a/reference/iterator/indirectly_writable.md +++ b/reference/iterator/indirectly_writable.md @@ -194,8 +194,8 @@ ret_proxy_tuple is indirectly writable std::tuple> ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 関連項目 diff --git a/reference/iterator/input_iterator.md b/reference/iterator/input_iterator.md index 2bcb77bd18..25d12448cc 100644 --- a/reference/iterator/input_iterator.md +++ b/reference/iterator/input_iterator.md @@ -102,8 +102,8 @@ std::ostream_iterator is not input_iterator ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 関連項目 diff --git a/reference/iterator/input_or_output_iterator.md b/reference/iterator/input_or_output_iterator.md index 3f8e960415..982e8844e8 100644 --- a/reference/iterator/input_or_output_iterator.md +++ b/reference/iterator/input_or_output_iterator.md @@ -95,8 +95,8 @@ sample_weak_incrementable is not input_or_output_iterator ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 関連項目 diff --git a/reference/iterator/iter_common_reference_t.md b/reference/iterator/iter_common_reference_t.md index cf9dc1061c..07e5eb9288 100644 --- a/reference/iterator/iter_common_reference_t.md +++ b/reference/iterator/iter_common_reference_t.md @@ -45,8 +45,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 関連項目 diff --git a/reference/iterator/iter_const_reference_t.md b/reference/iterator/iter_const_reference_t.md index 1b4264ac04..aefaf7a21c 100644 --- a/reference/iterator/iter_const_reference_t.md +++ b/reference/iterator/iter_const_reference_t.md @@ -83,8 +83,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 diff --git a/reference/iterator/iter_difference_t.md b/reference/iterator/iter_difference_t.md index e998057a2a..c9bddbc3ad 100644 --- a/reference/iterator/iter_difference_t.md +++ b/reference/iterator/iter_difference_t.md @@ -54,8 +54,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 関連項目 diff --git a/reference/iterator/iter_move.md b/reference/iterator/iter_move.md index 9815d507aa..1bacb608d2 100644 --- a/reference/iterator/iter_move.md +++ b/reference/iterator/iter_move.md @@ -116,8 +116,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 4 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 4 [mark verified] ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/iterator/iter_reference_t.md b/reference/iterator/iter_reference_t.md index 48adf9cdd1..36f3785b44 100644 --- a/reference/iterator/iter_reference_t.md +++ b/reference/iterator/iter_reference_t.md @@ -43,8 +43,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 関連項目 diff --git a/reference/iterator/iter_rvalue_reference_t.md b/reference/iterator/iter_rvalue_reference_t.md index 1dc7aa6530..9cb24c447c 100644 --- a/reference/iterator/iter_rvalue_reference_t.md +++ b/reference/iterator/iter_rvalue_reference_t.md @@ -48,8 +48,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 関連項目 diff --git a/reference/iterator/iter_swap.md b/reference/iterator/iter_swap.md index 2405315d38..41c720906e 100644 --- a/reference/iterator/iter_swap.md +++ b/reference/iterator/iter_swap.md @@ -119,8 +119,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 4 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 4 [mark verified] ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/iterator/iter_value_t.md b/reference/iterator/iter_value_t.md index 7f3520a2dc..693ffb7a23 100644 --- a/reference/iterator/iter_value_t.md +++ b/reference/iterator/iter_value_t.md @@ -54,8 +54,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 関連項目 diff --git a/reference/iterator/make_const_iterator.md b/reference/iterator/make_const_iterator.md index 2660d8b43a..5c6a27cb6d 100644 --- a/reference/iterator/make_const_iterator.md +++ b/reference/iterator/make_const_iterator.md @@ -58,8 +58,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 diff --git a/reference/iterator/make_const_sentinel.md b/reference/iterator/make_const_sentinel.md index 3301702e8d..40e842dcb3 100644 --- a/reference/iterator/make_const_sentinel.md +++ b/reference/iterator/make_const_sentinel.md @@ -62,8 +62,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 diff --git a/reference/iterator/make_move_iterator.md b/reference/iterator/make_move_iterator.md index 166ee16ef0..9e032f9a5d 100644 --- a/reference/iterator/make_move_iterator.md +++ b/reference/iterator/make_move_iterator.md @@ -64,7 +64,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/iterator/make_reverse_iterator.md b/reference/iterator/make_reverse_iterator.md index 6998582c93..244140110b 100644 --- a/reference/iterator/make_reverse_iterator.md +++ b/reference/iterator/make_reverse_iterator.md @@ -61,8 +61,8 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.5 -- [GCC](/implementation.md#gcc): 5.0 +- [Clang](/implementation.md#clang): 3.5 [mark verified] +- [GCC](/implementation.md#gcc): 5.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/iterator/mergeable.md b/reference/iterator/mergeable.md index 2373c7801a..caedb57780 100644 --- a/reference/iterator/mergeable.md +++ b/reference/iterator/mergeable.md @@ -79,8 +79,8 @@ false ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 関連項目 diff --git a/reference/iterator/move_iterator.md b/reference/iterator/move_iterator.md index 4c2e7a1baa..56f23972f4 100644 --- a/reference/iterator/move_iterator.md +++ b/reference/iterator/move_iterator.md @@ -132,7 +132,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/iterator/move_iterator/base.md b/reference/iterator/move_iterator/base.md index d6fc8b4a40..aa39f598e7 100644 --- a/reference/iterator/move_iterator/base.md +++ b/reference/iterator/move_iterator/base.md @@ -57,7 +57,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/iterator/move_iterator/iter_move.md b/reference/iterator/move_iterator/iter_move.md index 8409c38334..2fd5c26f49 100644 --- a/reference/iterator/move_iterator/iter_move.md +++ b/reference/iterator/move_iterator/iter_move.md @@ -73,8 +73,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 7 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 7 [mark verified] ## 関連項目 diff --git a/reference/iterator/move_iterator/iter_swap.md b/reference/iterator/move_iterator/iter_swap.md index 7bf48ef735..7484433211 100644 --- a/reference/iterator/move_iterator/iter_swap.md +++ b/reference/iterator/move_iterator/iter_swap.md @@ -92,8 +92,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 7 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 7 [mark verified] ## 関連項目 diff --git a/reference/iterator/move_iterator/op_arrow.md b/reference/iterator/move_iterator/op_arrow.md index 9b07ad0661..eac4ea2515 100644 --- a/reference/iterator/move_iterator/op_arrow.md +++ b/reference/iterator/move_iterator/op_arrow.md @@ -53,7 +53,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/iterator/move_iterator/op_assign.md b/reference/iterator/move_iterator/op_assign.md index f80469dab2..42def6003d 100644 --- a/reference/iterator/move_iterator/op_assign.md +++ b/reference/iterator/move_iterator/op_assign.md @@ -67,9 +67,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 参照 diff --git a/reference/iterator/move_iterator/op_at.md b/reference/iterator/move_iterator/op_at.md index b1a294d4b8..961b87960e 100644 --- a/reference/iterator/move_iterator/op_at.md +++ b/reference/iterator/move_iterator/op_at.md @@ -58,7 +58,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/iterator/move_iterator/op_compare_3way.md b/reference/iterator/move_iterator/op_compare_3way.md index 34745f6fda..904e7b5187 100644 --- a/reference/iterator/move_iterator/op_compare_3way.md +++ b/reference/iterator/move_iterator/op_compare_3way.md @@ -60,7 +60,7 @@ equal ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10 +- [GCC](/implementation.md#gcc): 10 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/iterator/move_iterator/op_constructor.md b/reference/iterator/move_iterator/op_constructor.md index 8dfe741fc8..5c9df17b9e 100644 --- a/reference/iterator/move_iterator/op_constructor.md +++ b/reference/iterator/move_iterator/op_constructor.md @@ -80,7 +80,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/iterator/move_iterator/op_decrement.md b/reference/iterator/move_iterator/op_decrement.md index 3e74dff26f..66a7337838 100644 --- a/reference/iterator/move_iterator/op_decrement.md +++ b/reference/iterator/move_iterator/op_decrement.md @@ -71,7 +71,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/iterator/move_iterator/op_deref.md b/reference/iterator/move_iterator/op_deref.md index 2a2e242f02..a7946cdf74 100644 --- a/reference/iterator/move_iterator/op_deref.md +++ b/reference/iterator/move_iterator/op_deref.md @@ -56,7 +56,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/iterator/move_iterator/op_equal.md b/reference/iterator/move_iterator/op_equal.md index cf851262af..34ea75dce8 100644 --- a/reference/iterator/move_iterator/op_equal.md +++ b/reference/iterator/move_iterator/op_equal.md @@ -94,7 +94,7 @@ equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/iterator/move_iterator/op_greater.md b/reference/iterator/move_iterator/op_greater.md index d6818b44dc..6ce11e8784 100644 --- a/reference/iterator/move_iterator/op_greater.md +++ b/reference/iterator/move_iterator/op_greater.md @@ -65,7 +65,7 @@ greater ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/iterator/move_iterator/op_greater_equal.md b/reference/iterator/move_iterator/op_greater_equal.md index 701907db3e..e87fe0d713 100644 --- a/reference/iterator/move_iterator/op_greater_equal.md +++ b/reference/iterator/move_iterator/op_greater_equal.md @@ -65,7 +65,7 @@ greater ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/iterator/move_iterator/op_increment.md b/reference/iterator/move_iterator/op_increment.md index 6932c26e8b..9526fcd2b0 100644 --- a/reference/iterator/move_iterator/op_increment.md +++ b/reference/iterator/move_iterator/op_increment.md @@ -72,7 +72,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/iterator/move_iterator/op_less.md b/reference/iterator/move_iterator/op_less.md index 5e8eab85e3..4541aaa58d 100644 --- a/reference/iterator/move_iterator/op_less.md +++ b/reference/iterator/move_iterator/op_less.md @@ -66,7 +66,7 @@ less ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/iterator/move_iterator/op_less_equal.md b/reference/iterator/move_iterator/op_less_equal.md index 842d979624..77d43398f6 100644 --- a/reference/iterator/move_iterator/op_less_equal.md +++ b/reference/iterator/move_iterator/op_less_equal.md @@ -65,7 +65,7 @@ less ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/iterator/move_iterator/op_minus.md b/reference/iterator/move_iterator/op_minus.md index bc320bfc3b..cf039059b6 100644 --- a/reference/iterator/move_iterator/op_minus.md +++ b/reference/iterator/move_iterator/op_minus.md @@ -82,7 +82,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/iterator/move_iterator/op_minus_assign.md b/reference/iterator/move_iterator/op_minus_assign.md index 5ec3ee2b1e..1439d689b3 100644 --- a/reference/iterator/move_iterator/op_minus_assign.md +++ b/reference/iterator/move_iterator/op_minus_assign.md @@ -59,7 +59,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/iterator/move_iterator/op_not_equal.md b/reference/iterator/move_iterator/op_not_equal.md index ba2cf3b10b..4087bbef28 100644 --- a/reference/iterator/move_iterator/op_not_equal.md +++ b/reference/iterator/move_iterator/op_not_equal.md @@ -81,7 +81,7 @@ not equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/iterator/move_iterator/op_plus.md b/reference/iterator/move_iterator/op_plus.md index d60ae43300..94bfe064c8 100644 --- a/reference/iterator/move_iterator/op_plus.md +++ b/reference/iterator/move_iterator/op_plus.md @@ -70,7 +70,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/iterator/move_iterator/op_plus_assign.md b/reference/iterator/move_iterator/op_plus_assign.md index 569ba75a20..f45ec1451b 100644 --- a/reference/iterator/move_iterator/op_plus_assign.md +++ b/reference/iterator/move_iterator/op_plus_assign.md @@ -58,7 +58,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/iterator/move_iterator/op_unary_minus.md b/reference/iterator/move_iterator/op_unary_minus.md index 83b23d7335..34e4690dd6 100644 --- a/reference/iterator/move_iterator/op_unary_minus.md +++ b/reference/iterator/move_iterator/op_unary_minus.md @@ -53,7 +53,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/iterator/move_iterator/op_unary_plus.md b/reference/iterator/move_iterator/op_unary_plus.md index 245b2511b9..ea853c30ce 100644 --- a/reference/iterator/move_iterator/op_unary_plus.md +++ b/reference/iterator/move_iterator/op_unary_plus.md @@ -54,7 +54,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/iterator/move_sentinel.md b/reference/iterator/move_sentinel.md index 3934767a10..28120c4ec7 100644 --- a/reference/iterator/move_sentinel.md +++ b/reference/iterator/move_sentinel.md @@ -70,8 +70,8 @@ void move_if(I first, S last, O out, Pred pred) { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 7 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 7 [mark verified] ## 関連項目 diff --git a/reference/iterator/move_sentinel/base.md b/reference/iterator/move_sentinel/base.md index 9ae94ad384..06bae0e977 100644 --- a/reference/iterator/move_sentinel/base.md +++ b/reference/iterator/move_sentinel/base.md @@ -23,8 +23,8 @@ constexpr S base() const; ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 7 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 7 [mark verified] ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/iterator/move_sentinel/op_assign.md b/reference/iterator/move_sentinel/op_assign.md index da9978c309..887cd9ec0a 100644 --- a/reference/iterator/move_sentinel/op_assign.md +++ b/reference/iterator/move_sentinel/op_assign.md @@ -31,8 +31,8 @@ return *this; ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 7 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 7 [mark verified] ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/iterator/move_sentinel/op_constructor.md b/reference/iterator/move_sentinel/op_constructor.md index 58f4ed3f8f..0e4c98537c 100644 --- a/reference/iterator/move_sentinel/op_constructor.md +++ b/reference/iterator/move_sentinel/op_constructor.md @@ -64,8 +64,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 7 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 7 [mark verified] ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/iterator/next.md b/reference/iterator/next.md index 666dc3bfa3..255c293756 100644 --- a/reference/iterator/next.md +++ b/reference/iterator/next.md @@ -68,8 +68,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.4.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/iterator/output_iterator.md b/reference/iterator/output_iterator.md index 431c9b1ba9..dc5b13d567 100644 --- a/reference/iterator/output_iterator.md +++ b/reference/iterator/output_iterator.md @@ -97,8 +97,8 @@ int* const is not output_iterator ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 関連項目 diff --git a/reference/iterator/permutable.md b/reference/iterator/permutable.md index 945f432800..7d94b5f852 100644 --- a/reference/iterator/permutable.md +++ b/reference/iterator/permutable.md @@ -76,8 +76,8 @@ std::ostream_iterator is not permutable ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 関連項目 diff --git a/reference/iterator/prev.md b/reference/iterator/prev.md index e3ef6bef5e..5d2cff7847 100644 --- a/reference/iterator/prev.md +++ b/reference/iterator/prev.md @@ -68,8 +68,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.4 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/iterator/projected.md b/reference/iterator/projected.md index 3e53a73318..9e769a725f 100644 --- a/reference/iterator/projected.md +++ b/reference/iterator/projected.md @@ -82,8 +82,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 関連項目 diff --git a/reference/iterator/random_access_iterator.md b/reference/iterator/random_access_iterator.md index fe2a3e5f19..d17132a3f3 100644 --- a/reference/iterator/random_access_iterator.md +++ b/reference/iterator/random_access_iterator.md @@ -140,8 +140,8 @@ std::ostream_iterator is not random_access_iterator ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 関連項目 diff --git a/reference/iterator/ranges_advance.md b/reference/iterator/ranges_advance.md index 781d03c0ea..eb165ddd7a 100644 --- a/reference/iterator/ranges_advance.md +++ b/reference/iterator/ranges_advance.md @@ -119,8 +119,8 @@ diff : 2 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 5 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 5 [mark verified] ## 関連項目 diff --git a/reference/iterator/ranges_distance.md b/reference/iterator/ranges_distance.md index e058d313b3..be9ed8c213 100644 --- a/reference/iterator/ranges_distance.md +++ b/reference/iterator/ranges_distance.md @@ -95,8 +95,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 5 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 5 [mark verified] ## 関連項目 diff --git a/reference/iterator/ranges_next.md b/reference/iterator/ranges_next.md index 3062d963d4..58c578ee47 100644 --- a/reference/iterator/ranges_next.md +++ b/reference/iterator/ranges_next.md @@ -133,8 +133,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 5 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 5 [mark verified] ## 関連項目 diff --git a/reference/iterator/ranges_prev.md b/reference/iterator/ranges_prev.md index e5be4ac5d9..2fea54213d 100644 --- a/reference/iterator/ranges_prev.md +++ b/reference/iterator/ranges_prev.md @@ -115,8 +115,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 5 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 5 [mark verified] ## 関連項目 diff --git a/reference/iterator/rbegin.md b/reference/iterator/rbegin.md index b11e245774..173f6b21ab 100644 --- a/reference/iterator/rbegin.md +++ b/reference/iterator/rbegin.md @@ -113,8 +113,8 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.4 -- [GCC](/implementation.md#gcc): 5.0 +- [Clang](/implementation.md#clang): 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 5.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/iterator/rend.md b/reference/iterator/rend.md index 91b9f37eb1..e4c6643627 100644 --- a/reference/iterator/rend.md +++ b/reference/iterator/rend.md @@ -113,8 +113,8 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.4 -- [GCC](/implementation.md#gcc): 5.0 +- [Clang](/implementation.md#clang): 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 5.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/iterator/reverse_iterator/iter_move.md b/reference/iterator/reverse_iterator/iter_move.md index edf61ec14b..856b8e2f89 100644 --- a/reference/iterator/reverse_iterator/iter_move.md +++ b/reference/iterator/reverse_iterator/iter_move.md @@ -86,8 +86,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 関連項目 diff --git a/reference/iterator/reverse_iterator/iter_swap.md b/reference/iterator/reverse_iterator/iter_swap.md index 04653c48d0..699b86599f 100644 --- a/reference/iterator/reverse_iterator/iter_swap.md +++ b/reference/iterator/reverse_iterator/iter_swap.md @@ -101,8 +101,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 関連項目 diff --git a/reference/iterator/reverse_iterator/op_compare_3way.md b/reference/iterator/reverse_iterator/op_compare_3way.md index 2ae3e44d71..22f134d1bb 100644 --- a/reference/iterator/reverse_iterator/op_compare_3way.md +++ b/reference/iterator/reverse_iterator/op_compare_3way.md @@ -63,7 +63,7 @@ equal ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10 +- [GCC](/implementation.md#gcc): 10 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 diff --git a/reference/iterator/sentinel_for.md b/reference/iterator/sentinel_for.md index 35eecb5e43..22a5dbfc01 100644 --- a/reference/iterator/sentinel_for.md +++ b/reference/iterator/sentinel_for.md @@ -97,8 +97,8 @@ int* is not sentinel for double* ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 関連項目 diff --git a/reference/iterator/size.md b/reference/iterator/size.md index 7455d477de..cba14eef4b 100644 --- a/reference/iterator/size.md +++ b/reference/iterator/size.md @@ -88,10 +88,10 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 3.6 -- [GCC](/implementation.md#gcc): 6.1 +- [Clang](/implementation.md#clang): 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 6.1 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] ## 関連項目 diff --git a/reference/iterator/sized_sentinel_for.md b/reference/iterator/sized_sentinel_for.md index 5f4a285b94..e276a0ad2b 100644 --- a/reference/iterator/sized_sentinel_for.md +++ b/reference/iterator/sized_sentinel_for.md @@ -116,8 +116,8 @@ sample_sentinel is not sized sentinel for sample_sized_iterator ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 関連項目 diff --git a/reference/iterator/sortable.md b/reference/iterator/sortable.md index ecfac8ea61..df8356c30c 100644 --- a/reference/iterator/sortable.md +++ b/reference/iterator/sortable.md @@ -78,8 +78,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 関連項目 diff --git a/reference/iterator/ssize.md b/reference/iterator/ssize.md index 6bb79bf899..263580943b 100644 --- a/reference/iterator/ssize.md +++ b/reference/iterator/ssize.md @@ -64,7 +64,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 9.0 +- [Clang](/implementation.md#clang): 9.0 [mark verified] - [GCC](/implementation.md#gcc): - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/iterator/unreachable_sentinel_t.md b/reference/iterator/unreachable_sentinel_t.md index 2b7aa91f57..feab3f163e 100644 --- a/reference/iterator/unreachable_sentinel_t.md +++ b/reference/iterator/unreachable_sentinel_t.md @@ -67,8 +67,8 @@ i ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 5 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 5 [mark verified] ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/iterator/weakly_incrementable.md b/reference/iterator/weakly_incrementable.md index 3fd39e8184..6e0bc7c2e6 100644 --- a/reference/iterator/weakly_incrementable.md +++ b/reference/iterator/weakly_incrementable.md @@ -110,8 +110,8 @@ sample_not_incrementable is not weakly incrementable ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 関連項目 diff --git a/reference/latch.md b/reference/latch.md index 58b6c37281..e3cc3d522a 100644 --- a/reference/latch.md +++ b/reference/latch.md @@ -14,7 +14,7 @@ - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 11.0 +- [Clang](/implementation.md#clang): 11.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/latch/latch.md b/reference/latch/latch.md index f611011ecc..c8f2f7e7a8 100644 --- a/reference/latch/latch.md +++ b/reference/latch/latch.md @@ -124,7 +124,7 @@ Worker#3:42 - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 11.0 +- [Clang](/implementation.md#clang): 11.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/latch/latch/arrive_and_wait.md b/reference/latch/latch/arrive_and_wait.md index 4d0aed8f93..1d570d96ae 100644 --- a/reference/latch/latch/arrive_and_wait.md +++ b/reference/latch/latch/arrive_and_wait.md @@ -83,7 +83,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 11.0 +- [Clang](/implementation.md#clang): 11.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/latch/latch/count_down.md b/reference/latch/latch/count_down.md index 924d445da9..52aa87b5ad 100644 --- a/reference/latch/latch/count_down.md +++ b/reference/latch/latch/count_down.md @@ -75,7 +75,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 11.0 +- [Clang](/implementation.md#clang): 11.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/latch/latch/max.md b/reference/latch/latch/max.md index 8900be04be..edf68e7625 100644 --- a/reference/latch/latch/max.md +++ b/reference/latch/latch/max.md @@ -45,7 +45,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 11.0 +- [Clang](/implementation.md#clang): 11.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/latch/latch/op_constructor.md b/reference/latch/latch/op_constructor.md index d666ef6628..df92fa6dd5 100644 --- a/reference/latch/latch/op_constructor.md +++ b/reference/latch/latch/op_constructor.md @@ -44,7 +44,7 @@ int main() {} - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 11.0 +- [Clang](/implementation.md#clang): 11.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/latch/latch/try_wait.md b/reference/latch/latch/try_wait.md index f6eedba488..5d3b245d3d 100644 --- a/reference/latch/latch/try_wait.md +++ b/reference/latch/latch/try_wait.md @@ -71,7 +71,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 11.0 +- [Clang](/implementation.md#clang): 11.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/latch/latch/wait.md b/reference/latch/latch/wait.md index 7d2a90824e..c289e8c52f 100644 --- a/reference/latch/latch/wait.md +++ b/reference/latch/latch/wait.md @@ -70,7 +70,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 11.0 +- [Clang](/implementation.md#clang): 11.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/limits/numeric_limits/lowest.md b/reference/limits/numeric_limits/lowest.md index dc176d0c10..abd42846c1 100644 --- a/reference/limits/numeric_limits/lowest.md +++ b/reference/limits/numeric_limits/lowest.md @@ -57,10 +57,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.5.4 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.5.4 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 関連項目 diff --git a/reference/limits/numeric_limits/max_digits10.md b/reference/limits/numeric_limits/max_digits10.md index d5869cfae4..0bc95e073f 100644 --- a/reference/limits/numeric_limits/max_digits10.md +++ b/reference/limits/numeric_limits/max_digits10.md @@ -110,10 +110,10 @@ float max_digits10 : 9 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.5.4 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.5.4 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ### 参照 * [A Proposal to add a max significant decimal digits value to the C++ Standard Library Numeric limits](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1822.pdf) diff --git a/reference/list/list/cbegin.md b/reference/list/list/cbegin.md index 02de26b20f..843a33ac0e 100644 --- a/reference/list/list/cbegin.md +++ b/reference/list/list/cbegin.md @@ -53,9 +53,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 参照 diff --git a/reference/list/list/cend.md b/reference/list/list/cend.md index 734a991935..a71f3067e3 100644 --- a/reference/list/list/cend.md +++ b/reference/list/list/cend.md @@ -57,9 +57,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 参照 diff --git a/reference/list/list/clear.md b/reference/list/list/clear.md index 5479cb85fe..db936aaf44 100644 --- a/reference/list/list/clear.md +++ b/reference/list/list/clear.md @@ -62,7 +62,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/list/list/crbegin.md b/reference/list/list/crbegin.md index d09515ed39..60487764f5 100644 --- a/reference/list/list/crbegin.md +++ b/reference/list/list/crbegin.md @@ -53,9 +53,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 参照 diff --git a/reference/list/list/crend.md b/reference/list/list/crend.md index c6e680cb4c..d8fbbf25f0 100644 --- a/reference/list/list/crend.md +++ b/reference/list/list/crend.md @@ -53,9 +53,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 参照 diff --git a/reference/list/list/emplace.md b/reference/list/list/emplace.md index f8b80f2a44..b681e0138a 100644 --- a/reference/list/list/emplace.md +++ b/reference/list/list/emplace.md @@ -68,8 +68,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.6.4 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.6.4 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/list/list/emplace_back.md b/reference/list/list/emplace_back.md index ba9e1a3238..1ffa5206b0 100644 --- a/reference/list/list/emplace_back.md +++ b/reference/list/list/emplace_back.md @@ -70,8 +70,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.6.4 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.6.4 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/list/list/emplace_front.md b/reference/list/list/emplace_front.md index 61e6838953..599ee0e5ea 100644 --- a/reference/list/list/emplace_front.md +++ b/reference/list/list/emplace_front.md @@ -70,8 +70,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.6.4 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.6.4 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/list/list/erase_free.md b/reference/list/list/erase_free.md index 775837855d..8f1c859cf8 100644 --- a/reference/list/list/erase_free.md +++ b/reference/list/list/erase_free.md @@ -59,8 +59,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 9.1 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/list/list/erase_if_free.md b/reference/list/list/erase_if_free.md index 992bf176c1..68d1d03938 100644 --- a/reference/list/list/erase_if_free.md +++ b/reference/list/list/erase_if_free.md @@ -59,8 +59,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 9.1 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/list/list/get_allocator.md b/reference/list/list/get_allocator.md index 7916cf0332..3806188bf0 100644 --- a/reference/list/list/get_allocator.md +++ b/reference/list/list/get_allocator.md @@ -52,6 +52,6 @@ int main() - [Clang](/implementation.md#clang): ? - [GCC](/implementation.md#gcc): ? - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2002, 2003, 2005, 2008, 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2002 [mark verified], 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - 2012, 2013は、`noexcept`が実装されていないため、`throw()`が修飾されている。 - 2015からは、`noexcept`が修飾されている。 diff --git a/reference/list/list/op_deduction_guide.md b/reference/list/list/op_deduction_guide.md index b6906179bf..fe63d096d4 100644 --- a/reference/list/list/op_deduction_guide.md +++ b/reference/list/list/op_deduction_guide.md @@ -63,7 +63,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/locale/tolower.md b/reference/locale/tolower.md index 12112f34af..2bed21102c 100644 --- a/reference/locale/tolower.md +++ b/reference/locale/tolower.md @@ -49,10 +49,10 @@ a - C++03 ### 処理系 -- [Clang](/implementation.md#clang): 1.9, 2.9, 3.1 -- [GCC](/implementation.md#gcc): 3.4.6, 4.2.4, 4.3.5, 4.4.5, 4.5.2, 4.6.3, 4.7.0 -- [ICC](/implementation.md#icc): 10.1, 11.0, 11.1, 12.0 -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010, 2012 +- [Clang](/implementation.md#clang): 1.9 [mark verified], 2.9 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 3.4.6 [mark verified], 4.2.4 [mark verified], 4.3.5 [mark verified], 4.4.5 [mark verified], 4.5.2 [mark verified], 4.6.3 [mark verified], 4.7.0 [mark verified] +- [ICC](/implementation.md#icc): 10.1 [mark verified], 11.0 [mark verified], 11.1 [mark verified], 12.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified], 2012 [mark verified] ## 実装例 diff --git a/reference/locale/toupper.md b/reference/locale/toupper.md index 1869243a48..2a1e4b0323 100644 --- a/reference/locale/toupper.md +++ b/reference/locale/toupper.md @@ -49,10 +49,10 @@ A - C++03 ### 処理系 -- [Clang](/implementation.md#clang): 1.9, 2.9, 3.1 -- [GCC](/implementation.md#gcc): 3.4.6, 4.2.4, 4.3.5, 4.4.5, 4.5.2, 4.6.3, 4.7.0 -- [ICC](/implementation.md#icc): 10.1, 11.0, 11.1, 12.0 -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010, 2012 +- [Clang](/implementation.md#clang): 1.9 [mark verified], 2.9 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 3.4.6 [mark verified], 4.2.4 [mark verified], 4.3.5 [mark verified], 4.4.5 [mark verified], 4.5.2 [mark verified], 4.6.3 [mark verified], 4.7.0 [mark verified] +- [ICC](/implementation.md#icc): 10.1 [mark verified], 11.0 [mark verified], 11.1 [mark verified], 12.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified], 2012 [mark verified] ## 実装例 ```cpp diff --git a/reference/locale/wbuffer_convert.md b/reference/locale/wbuffer_convert.md index 0c2163b898..fb533769da 100644 --- a/reference/locale/wbuffer_convert.md +++ b/reference/locale/wbuffer_convert.md @@ -56,10 +56,10 @@ Unicode以外のShift_JISやBig5といった文字コードの利用が急激に - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] - [GCC](/implementation.md#gcc): - [ICC](/implementation.md#icc): -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/locale/wstring_convert.md b/reference/locale/wstring_convert.md index 24bb9da6b9..54c1b3783b 100644 --- a/reference/locale/wstring_convert.md +++ b/reference/locale/wstring_convert.md @@ -112,10 +112,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 5.1 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 5.1 [mark verified] - [ICC](/implementation.md#icc): -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/locale/wstring_convert/converted.md b/reference/locale/wstring_convert/converted.md index ef6ea37714..a4cf7e1c0c 100644 --- a/reference/locale/wstring_convert/converted.md +++ b/reference/locale/wstring_convert/converted.md @@ -67,10 +67,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 5.1 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 5.1 [mark verified] - [ICC](/implementation.md#icc): -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/locale/wstring_convert/from_bytes.md b/reference/locale/wstring_convert/from_bytes.md index 92924b7d23..0d19374072 100644 --- a/reference/locale/wstring_convert/from_bytes.md +++ b/reference/locale/wstring_convert/from_bytes.md @@ -101,9 +101,9 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 5.1 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 5.1 [mark verified] - [ICC](/implementation.md#icc): -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/locale/wstring_convert/op_constructor.md b/reference/locale/wstring_convert/op_constructor.md index be6c8487df..5437345fa2 100644 --- a/reference/locale/wstring_convert/op_constructor.md +++ b/reference/locale/wstring_convert/op_constructor.md @@ -92,10 +92,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 5.1 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 5.1 [mark verified] - [ICC](/implementation.md#icc): -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/locale/wstring_convert/op_destructor.md b/reference/locale/wstring_convert/op_destructor.md index db2afb559c..5470f64448 100644 --- a/reference/locale/wstring_convert/op_destructor.md +++ b/reference/locale/wstring_convert/op_destructor.md @@ -21,9 +21,9 @@ - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 5.1 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 5.1 [mark verified] - [ICC](/implementation.md#icc): -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/locale/wstring_convert/state.md b/reference/locale/wstring_convert/state.md index c45ae6474c..be434a5ce8 100644 --- a/reference/locale/wstring_convert/state.md +++ b/reference/locale/wstring_convert/state.md @@ -68,9 +68,9 @@ converted all - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 5.1 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 5.1 [mark verified] - [ICC](/implementation.md#icc): -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/locale/wstring_convert/to_bytes.md b/reference/locale/wstring_convert/to_bytes.md index ff11529d24..7e8d568f27 100644 --- a/reference/locale/wstring_convert/to_bytes.md +++ b/reference/locale/wstring_convert/to_bytes.md @@ -101,9 +101,9 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4 -- [GCC](/implementation.md#gcc): 5.1 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 5.1 [mark verified] - [ICC](/implementation.md#icc): -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/map/map/at.md b/reference/map/map/at.md index 76eb2dc7c2..f4816ab8c6 100644 --- a/reference/map/map/at.md +++ b/reference/map/map/at.md @@ -62,10 +62,10 @@ exception std::out_of_range ``` ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/map/map/begin.md b/reference/map/map/begin.md index 509972917b..42ce65231a 100644 --- a/reference/map/map/begin.md +++ b/reference/map/map/begin.md @@ -71,7 +71,7 @@ int main() - C++03 ### 処理系 -- [Clang](/implementation.md#clang): 2.9, 3.0, 3.1, 3.2, 3.3 +- [Clang](/implementation.md#clang): 2.9 [mark verified], 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified] - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/map/map/cbegin.md b/reference/map/map/cbegin.md index cfdd8f467d..fef90ecddf 100644 --- a/reference/map/map/cbegin.md +++ b/reference/map/map/cbegin.md @@ -64,7 +64,7 @@ int main() ``` ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified] - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/map/map/cend.md b/reference/map/map/cend.md index b35609733e..585cbf7329 100644 --- a/reference/map/map/cend.md +++ b/reference/map/map/cend.md @@ -70,7 +70,7 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 3.1, 3.2, 3.3 +- [Clang](/implementation.md#clang): 3.0 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified] - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/map/map/clear.md b/reference/map/map/clear.md index 4da367be61..51a5a64362 100644 --- a/reference/map/map/clear.md +++ b/reference/map/map/clear.md @@ -59,7 +59,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/map/map/contains.md b/reference/map/map/contains.md index 6b35fbba73..7974dba342 100644 --- a/reference/map/map/contains.md +++ b/reference/map/map/contains.md @@ -70,8 +70,8 @@ contain ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 1 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 1 [mark verified] ## 参照 - [P0458R2 Checking for Existence of an Element in Associative Containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0458r2.html) diff --git a/reference/map/map/crbegin.md b/reference/map/map/crbegin.md index 5b724949f3..2a159e8908 100644 --- a/reference/map/map/crbegin.md +++ b/reference/map/map/crbegin.md @@ -61,7 +61,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/map/map/crend.md b/reference/map/map/crend.md index f896d56bf3..56969981c0 100644 --- a/reference/map/map/crend.md +++ b/reference/map/map/crend.md @@ -57,7 +57,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] diff --git a/reference/map/map/emplace.md b/reference/map/map/emplace.md index 94d10465e8..d3d7a013d2 100644 --- a/reference/map/map/emplace.md +++ b/reference/map/map/emplace.md @@ -145,10 +145,10 @@ CCC : (1, 2) - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 3.3 -- [GCC](/implementation.md#gcc): 4.8.5 +- [Clang](/implementation.md#clang): 3.2 3.3 [mark verified] +- [GCC](/implementation.md#gcc): 4.8.5 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/map/map/emplace_hint.md b/reference/map/map/emplace_hint.md index 75625bf07b..e1a3e1de1a 100644 --- a/reference/map/map/emplace_hint.md +++ b/reference/map/map/emplace_hint.md @@ -72,10 +72,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.8.5 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.8.5 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/map/map/end.md b/reference/map/map/end.md index 64199b90fc..24a465a391 100644 --- a/reference/map/map/end.md +++ b/reference/map/map/end.md @@ -73,7 +73,7 @@ int main() - C++03 ### 処理系 -- [Clang](/implementation.md#clang): 2.9, 3.0, 3.1, 3.2, 3.3 +- [Clang](/implementation.md#clang): 2.9 [mark verified], 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified] - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/map/map/erase.md b/reference/map/map/erase.md index de6be33b32..6ed310bf16 100644 --- a/reference/map/map/erase.md +++ b/reference/map/map/erase.md @@ -168,7 +168,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/map/map/erase_if_free.md b/reference/map/map/erase_if_free.md index 8fdf9b54f0..7b48c194e8 100644 --- a/reference/map/map/erase_if_free.md +++ b/reference/map/map/erase_if_free.md @@ -76,8 +76,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 9.1 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/map/map/extract.md b/reference/map/map/extract.md index d181eed22f..9083621c15 100644 --- a/reference/map/map/extract.md +++ b/reference/map/map/extract.md @@ -91,10 +91,10 @@ m2 : ### 処理系 -- [Clang](/implementation.md#clang): 7.0.0 -- [GCC](/implementation.md#gcc): 7.1.0 +- [Clang](/implementation.md#clang): 7.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 [mark verified] ## 関連項目 diff --git a/reference/map/map/get_allocator.md b/reference/map/map/get_allocator.md index 6d9518b540..b738036e04 100644 --- a/reference/map/map/get_allocator.md +++ b/reference/map/map/get_allocator.md @@ -67,6 +67,6 @@ b - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2002, 2003, 2005, 2008, 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2002 [mark verified], 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - 2012, 2013は、`noexcept`が実装されていないため、`throw()`が修飾されている。 - 2015からは、`noexcept`が修飾されている。 diff --git a/reference/map/map/insert.md b/reference/map/map/insert.md index f5a846253f..b8c44319b8 100644 --- a/reference/map/map/insert.md +++ b/reference/map/map/insert.md @@ -156,7 +156,7 @@ int main () - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/map/map/insert_or_assign.md b/reference/map/map/insert_or_assign.md index 22eead3982..6825c7d2a8 100644 --- a/reference/map/map/insert_or_assign.md +++ b/reference/map/map/insert_or_assign.md @@ -95,8 +95,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 3.7.0 -- [GCC](/implementation.md#gcc): 6.1.0 +- [Clang](/implementation.md#clang): 3.7.0 [mark verified] +- [GCC](/implementation.md#gcc): 6.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/map/map/key_comp.md b/reference/map/map/key_comp.md index d152ac11e1..cb6a0c063c 100644 --- a/reference/map/map/key_comp.md +++ b/reference/map/map/key_comp.md @@ -47,7 +47,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/map/map/max_size.md b/reference/map/map/max_size.md index d7500ace46..31969994b8 100644 --- a/reference/map/map/max_size.md +++ b/reference/map/map/max_size.md @@ -48,7 +48,7 @@ int main () - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/map/map/merge.md b/reference/map/map/merge.md index 6ab9b65807..425ff823fd 100644 --- a/reference/map/map/merge.md +++ b/reference/map/map/merge.md @@ -91,10 +91,10 @@ m2 : - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 8.0.0 -- [GCC](/implementation.md#gcc): 7.1.0 +- [Clang](/implementation.md#clang): 8.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 [mark verified] ## 参照 diff --git a/reference/map/map/op_assign.md b/reference/map/map/op_assign.md index da17e632a2..f7cca0dade 100644 --- a/reference/map/map/op_assign.md +++ b/reference/map/map/op_assign.md @@ -80,7 +80,7 @@ Size of m2: 5 - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/map/map/op_compare_3way.md b/reference/map/map/op_compare_3way.md index 5706a79564..330b051d75 100644 --- a/reference/map/map/op_compare_3way.md +++ b/reference/map/map/op_compare_3way.md @@ -78,7 +78,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10 +- [GCC](/implementation.md#gcc): 10 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/map/map/op_constructor.md b/reference/map/map/op_constructor.md index 6a4d691a92..044525df93 100644 --- a/reference/map/map/op_constructor.md +++ b/reference/map/map/op_constructor.md @@ -136,7 +136,7 @@ Size of c2: 2 - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/map/map/op_equal.md b/reference/map/map/op_equal.md index e520b4dd37..b308793eaf 100644 --- a/reference/map/map/op_equal.md +++ b/reference/map/map/op_equal.md @@ -62,7 +62,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/map/map/op_greater.md b/reference/map/map/op_greater.md index eb2f31f349..99bcbd3f09 100644 --- a/reference/map/map/op_greater.md +++ b/reference/map/map/op_greater.md @@ -65,7 +65,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/map/map/op_less.md b/reference/map/map/op_less.md index ccb82bfae7..e3d2883901 100644 --- a/reference/map/map/op_less.md +++ b/reference/map/map/op_less.md @@ -69,7 +69,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/map/map/op_not_equal.md b/reference/map/map/op_not_equal.md index 4897d7d51a..b667658034 100644 --- a/reference/map/map/op_not_equal.md +++ b/reference/map/map/op_not_equal.md @@ -64,7 +64,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/map/map/rbegin.md b/reference/map/map/rbegin.md index aa43704549..528d7f85b5 100644 --- a/reference/map/map/rbegin.md +++ b/reference/map/map/rbegin.md @@ -64,7 +64,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/map/map/rend.md b/reference/map/map/rend.md index d6288d767b..48417195f4 100644 --- a/reference/map/map/rend.md +++ b/reference/map/map/rend.md @@ -57,7 +57,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/map/map/size.md b/reference/map/map/size.md index 7d6ea4b5a5..dbd2e09e3b 100644 --- a/reference/map/map/size.md +++ b/reference/map/map/size.md @@ -58,9 +58,9 @@ int main () ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/map/map/swap.md b/reference/map/map/swap.md index ed884268f8..06962518d7 100644 --- a/reference/map/map/swap.md +++ b/reference/map/map/swap.md @@ -72,9 +72,9 @@ m2 : {[10,a], [20,b], [30,c], } ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/map/map/swap_free.md b/reference/map/map/swap_free.md index e9756b9e56..c0777215c3 100644 --- a/reference/map/map/swap_free.md +++ b/reference/map/map/swap_free.md @@ -82,9 +82,9 @@ m2 : {[10,a], [20,b], [30,c], } ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/map/map/try_emplace.md b/reference/map/map/try_emplace.md index b9cb7d7b38..f43067b02d 100644 --- a/reference/map/map/try_emplace.md +++ b/reference/map/map/try_emplace.md @@ -108,8 +108,8 @@ false, 114, false - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 3.7.0 -- [GCC](/implementation.md#gcc): 6.1.0 +- [Clang](/implementation.md#clang): 3.7.0 [mark verified] +- [GCC](/implementation.md#gcc): 6.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/map/map/value_comp.md b/reference/map/map/value_comp.md index 4879142c1a..09140fe00c 100644 --- a/reference/map/map/value_comp.md +++ b/reference/map/map/value_comp.md @@ -54,7 +54,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/map/multimap/begin.md b/reference/map/multimap/begin.md index d0fe47e760..46e8832dbf 100644 --- a/reference/map/multimap/begin.md +++ b/reference/map/multimap/begin.md @@ -74,7 +74,7 @@ int main() - C++03 ### 処理系 -- [Clang](/implementation.md#clang): 2.9, 3.0, 3.1, 3.2, 3.3 +- [Clang](/implementation.md#clang): 2.9 [mark verified], 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified] - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/map/multimap/cbegin.md b/reference/map/multimap/cbegin.md index 8b5408b04e..895761a30e 100644 --- a/reference/map/multimap/cbegin.md +++ b/reference/map/multimap/cbegin.md @@ -66,7 +66,7 @@ int main() ``` ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified] - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/map/multimap/cend.md b/reference/map/multimap/cend.md index 4df914fa00..bdec05eab5 100644 --- a/reference/map/multimap/cend.md +++ b/reference/map/multimap/cend.md @@ -73,7 +73,7 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 3.1, 3.2, 3.3 +- [Clang](/implementation.md#clang): 3.0 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified] - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/map/multimap/clear.md b/reference/map/multimap/clear.md index 3c4e9c7168..539894179a 100644 --- a/reference/map/multimap/clear.md +++ b/reference/map/multimap/clear.md @@ -60,7 +60,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/map/multimap/contains.md b/reference/map/multimap/contains.md index 4a902da65a..c13b617750 100644 --- a/reference/map/multimap/contains.md +++ b/reference/map/multimap/contains.md @@ -70,8 +70,8 @@ contain ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 1 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 1 [mark verified] ## 参照 - [P0458R2 Checking for Existence of an Element in Associative Containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0458r2.html) diff --git a/reference/map/multimap/crbegin.md b/reference/map/multimap/crbegin.md index 6e492f98d8..4c93666f82 100644 --- a/reference/map/multimap/crbegin.md +++ b/reference/map/multimap/crbegin.md @@ -62,7 +62,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/map/multimap/crend.md b/reference/map/multimap/crend.md index 214442dbde..d91b0ded1f 100644 --- a/reference/map/multimap/crend.md +++ b/reference/map/multimap/crend.md @@ -58,7 +58,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] diff --git a/reference/map/multimap/emplace.md b/reference/map/multimap/emplace.md index d2f2f1eb7c..97f1392123 100644 --- a/reference/map/multimap/emplace.md +++ b/reference/map/multimap/emplace.md @@ -105,10 +105,10 @@ CCC : (1, 2) - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 3.3 -- [GCC](/implementation.md#gcc): 4.8.5 +- [Clang](/implementation.md#clang): 3.2 3.3 [mark verified] +- [GCC](/implementation.md#gcc): 4.8.5 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/map/multimap/emplace_hint.md b/reference/map/multimap/emplace_hint.md index 369fd71157..5d23eb921e 100644 --- a/reference/map/multimap/emplace_hint.md +++ b/reference/map/multimap/emplace_hint.md @@ -71,10 +71,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.8.5 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.8.5 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/map/multimap/end.md b/reference/map/multimap/end.md index 4ec49d6782..826c870306 100644 --- a/reference/map/multimap/end.md +++ b/reference/map/multimap/end.md @@ -76,7 +76,7 @@ int main() - C++03 ### 処理系 -- [Clang](/implementation.md#clang): 2.9, 3.0, 3.1, 3.2, 3.3 +- [Clang](/implementation.md#clang): 2.9 [mark verified], 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified] - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/map/multimap/erase_if_free.md b/reference/map/multimap/erase_if_free.md index ab62c46f01..e5d0cbd827 100644 --- a/reference/map/multimap/erase_if_free.md +++ b/reference/map/multimap/erase_if_free.md @@ -76,8 +76,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 9.1 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/map/multimap/extract.md b/reference/map/multimap/extract.md index a4fd6d89ec..0a15458ddd 100644 --- a/reference/map/multimap/extract.md +++ b/reference/map/multimap/extract.md @@ -91,10 +91,10 @@ m2 : ### 処理系 -- [Clang](/implementation.md#clang): 7.0.0 -- [GCC](/implementation.md#gcc): 7.1.0 +- [Clang](/implementation.md#clang): 7.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 [mark verified] ## 関連項目 diff --git a/reference/map/multimap/get_allocator.md b/reference/map/multimap/get_allocator.md index 475edd6422..a96bc5a414 100644 --- a/reference/map/multimap/get_allocator.md +++ b/reference/map/multimap/get_allocator.md @@ -66,6 +66,6 @@ b - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2002, 2003, 2005, 2008, 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2002 [mark verified], 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - 2012, 2013は、`noexcept`が実装されていないため、`throw()`が修飾されている。 - 2015からは、`noexcept`が修飾されている。 diff --git a/reference/map/multimap/insert.md b/reference/map/multimap/insert.md index 11af3b64d6..61d6150197 100644 --- a/reference/map/multimap/insert.md +++ b/reference/map/multimap/insert.md @@ -118,7 +118,7 @@ int main () - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/map/multimap/key_comp.md b/reference/map/multimap/key_comp.md index 23c5b64f3c..b10bcc46a3 100644 --- a/reference/map/multimap/key_comp.md +++ b/reference/map/multimap/key_comp.md @@ -49,7 +49,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/map/multimap/max_size.md b/reference/map/multimap/max_size.md index 993e30d681..092052afdc 100644 --- a/reference/map/multimap/max_size.md +++ b/reference/map/multimap/max_size.md @@ -48,7 +48,7 @@ int main () - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/map/multimap/merge.md b/reference/map/multimap/merge.md index fca7f2b74e..4c0468a3aa 100644 --- a/reference/map/multimap/merge.md +++ b/reference/map/multimap/merge.md @@ -91,10 +91,10 @@ m2 : - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 8.0.0 -- [GCC](/implementation.md#gcc): 7.1.0 +- [Clang](/implementation.md#clang): 8.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 [mark verified] ## 参照 diff --git a/reference/map/multimap/op_assign.md b/reference/map/multimap/op_assign.md index b3c7f12f2e..e08cd37013 100644 --- a/reference/map/multimap/op_assign.md +++ b/reference/map/multimap/op_assign.md @@ -80,7 +80,7 @@ Size of m2: 6 - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/map/multimap/op_compare_3way.md b/reference/map/multimap/op_compare_3way.md index 374521a01b..f73d868b70 100644 --- a/reference/map/multimap/op_compare_3way.md +++ b/reference/map/multimap/op_compare_3way.md @@ -78,7 +78,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/map/multimap/op_constructor.md b/reference/map/multimap/op_constructor.md index b2d9289a01..399f10e856 100644 --- a/reference/map/multimap/op_constructor.md +++ b/reference/map/multimap/op_constructor.md @@ -139,7 +139,7 @@ Size of m2: 3 - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/map/multimap/op_equal.md b/reference/map/multimap/op_equal.md index 99363d07d5..fc1baff422 100644 --- a/reference/map/multimap/op_equal.md +++ b/reference/map/multimap/op_equal.md @@ -63,7 +63,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/map/multimap/op_greater.md b/reference/map/multimap/op_greater.md index 967138ed4d..e094857f67 100644 --- a/reference/map/multimap/op_greater.md +++ b/reference/map/multimap/op_greater.md @@ -65,7 +65,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/map/multimap/op_less.md b/reference/map/multimap/op_less.md index a53e54856f..62b80c81ba 100644 --- a/reference/map/multimap/op_less.md +++ b/reference/map/multimap/op_less.md @@ -69,7 +69,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/map/multimap/op_not_equal.md b/reference/map/multimap/op_not_equal.md index cf1ea03153..4d9d0dbe84 100644 --- a/reference/map/multimap/op_not_equal.md +++ b/reference/map/multimap/op_not_equal.md @@ -63,7 +63,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/map/multimap/rbegin.md b/reference/map/multimap/rbegin.md index 50c1cc14b3..6f6e815914 100644 --- a/reference/map/multimap/rbegin.md +++ b/reference/map/multimap/rbegin.md @@ -65,7 +65,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/map/multimap/rend.md b/reference/map/multimap/rend.md index 8dda7f3c1c..9d2bbe3fe1 100644 --- a/reference/map/multimap/rend.md +++ b/reference/map/multimap/rend.md @@ -58,7 +58,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/map/multimap/size.md b/reference/map/multimap/size.md index b268ff51e4..8a95e295dc 100644 --- a/reference/map/multimap/size.md +++ b/reference/map/multimap/size.md @@ -58,9 +58,9 @@ int main () ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/map/multimap/swap.md b/reference/map/multimap/swap.md index 5ac1f52d02..c46cb7728b 100644 --- a/reference/map/multimap/swap.md +++ b/reference/map/multimap/swap.md @@ -72,9 +72,9 @@ m2 : {[10,a], [20,b], [30,c], } ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/map/multimap/swap_free.md b/reference/map/multimap/swap_free.md index ea68598fe1..df9fad8800 100644 --- a/reference/map/multimap/swap_free.md +++ b/reference/map/multimap/swap_free.md @@ -81,9 +81,9 @@ m2 : {[10,a], [20,b], [30,c], } ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/map/multimap/value_comp.md b/reference/map/multimap/value_comp.md index 7160e3b86a..d1983175ae 100644 --- a/reference/map/multimap/value_comp.md +++ b/reference/map/multimap/value_comp.md @@ -55,7 +55,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/memory/addressof.md b/reference/memory/addressof.md index a15986a6c6..0f06e0e477 100644 --- a/reference/memory/addressof.md +++ b/reference/memory/addressof.md @@ -76,9 +76,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] - 2012はマニュアル(MSDNライブラリ)に記載がないものの、実装されている。 ## 参照 diff --git a/reference/memory/align.md b/reference/memory/align.md index 0ebe39dbf9..910ef95479 100644 --- a/reference/memory/align.md +++ b/reference/memory/align.md @@ -58,10 +58,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 5.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 5.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] - 2012はマニュアル(MSDNライブラリ)に記載がないものの、実装されている。 diff --git a/reference/memory/allocate_shared.md b/reference/memory/allocate_shared.md index 71eb477946..17a5ac19ac 100644 --- a/reference/memory/allocate_shared.md +++ b/reference/memory/allocate_shared.md @@ -121,10 +121,10 @@ int main() { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2, 3.3 -- [GCC](/implementation.md#gcc): 4.7.3, 4.8.2 +- [Clang](/implementation.md#clang): 3.2 [mark verified], 3.3 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.3 [mark verified], 4.8.2 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] - 2012までは、可変引数テンプレートに対応していないため、不完全な実装である。 diff --git a/reference/memory/allocate_shared_for_overwrite.md b/reference/memory/allocate_shared_for_overwrite.md index 4bfc4d91ec..efc54ee6f8 100644 --- a/reference/memory/allocate_shared_for_overwrite.md +++ b/reference/memory/allocate_shared_for_overwrite.md @@ -84,8 +84,8 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 10.0.0 現在未対応 -- [GCC](/implementation.md#gcc): 10.0.0 現在未対応 +- [Clang](/implementation.md#clang): 10.0.0 現在未対応 [mark verified] +- [GCC](/implementation.md#gcc): 10.0.0 現在未対応 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/memory/allocator/construct.md b/reference/memory/allocator/construct.md index 19d3803ffd..55dcca99ef 100644 --- a/reference/memory/allocator/construct.md +++ b/reference/memory/allocator/construct.md @@ -74,8 +74,8 @@ int main() ### C++11版の処理系対応状況 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/memory/allocator_arg_t.md b/reference/memory/allocator_arg_t.md index 11eacf5fb9..468cee7014 100644 --- a/reference/memory/allocator_arg_t.md +++ b/reference/memory/allocator_arg_t.md @@ -28,8 +28,8 @@ namespace std { ### 処理系 - [Clang](/implementation.md#clang): ? -- [GCC](/implementation.md#gcc): 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 - [`std::tuple`](/reference/tuple/tuple.md)クラス diff --git a/reference/memory/allocator_traits.md b/reference/memory/allocator_traits.md index ba8698d1d7..f54b89d8b5 100644 --- a/reference/memory/allocator_traits.md +++ b/reference/memory/allocator_traits.md @@ -201,10 +201,10 @@ int main() { - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.7.3 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.7.3 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 - [Allocators@C++11 - Cryolite](http://www.slideshare.net/Cryolite/allocator11final) diff --git a/reference/memory/allocator_traits/allocate.md b/reference/memory/allocator_traits/allocate.md index 80960b9894..6f49d7947c 100644 --- a/reference/memory/allocator_traits/allocate.md +++ b/reference/memory/allocator_traits/allocate.md @@ -54,10 +54,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.7.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.3 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/memory/allocator_traits/construct.md b/reference/memory/allocator_traits/construct.md index 5e8bdc87cd..4ba9b16bdf 100644 --- a/reference/memory/allocator_traits/construct.md +++ b/reference/memory/allocator_traits/construct.md @@ -67,10 +67,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.7.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.3 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] - 2012までは、可変引数テンプレートに対応していないため、不完全な実装である。 diff --git a/reference/memory/allocator_traits/deallocate.md b/reference/memory/allocator_traits/deallocate.md index 6eb8d9da3f..dfe1e9ac6d 100644 --- a/reference/memory/allocator_traits/deallocate.md +++ b/reference/memory/allocator_traits/deallocate.md @@ -52,10 +52,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.7.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.3 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/memory/allocator_traits/destroy.md b/reference/memory/allocator_traits/destroy.md index 9427434cf2..5506fc1e97 100644 --- a/reference/memory/allocator_traits/destroy.md +++ b/reference/memory/allocator_traits/destroy.md @@ -68,10 +68,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.7.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.3 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/memory/allocator_traits/max_size.md b/reference/memory/allocator_traits/max_size.md index 12e5ad4338..70e4a7cf27 100644 --- a/reference/memory/allocator_traits/max_size.md +++ b/reference/memory/allocator_traits/max_size.md @@ -50,10 +50,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.7.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.3 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 - [LWG Issue 2162. `allocator_traits::max_size` missing `noexcept`](https://wg21.cmeerw.net/lwg/issue2162) diff --git a/reference/memory/allocator_traits/select_on_container_copy_construction.md b/reference/memory/allocator_traits/select_on_container_copy_construction.md index ce5ce27ab1..d2b54a3a70 100644 --- a/reference/memory/allocator_traits/select_on_container_copy_construction.md +++ b/reference/memory/allocator_traits/select_on_container_copy_construction.md @@ -117,9 +117,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/memory/assume_aligned.md b/reference/memory/assume_aligned.md index edfa2e3d50..7dbb19567b 100644 --- a/reference/memory/assume_aligned.md +++ b/reference/memory/assume_aligned.md @@ -327,10 +327,10 @@ template < std::size_t N, typename T > - C++20 ### 処理系 -- [Clang](/implementation.md#clang): † -- [GCC](/implementation.md#gcc): † ‡ -- [ICC](/implementation.md#icc): † -- [Visual C++](/implementation.md#visual_cpp): † +- [Clang](/implementation.md#clang): † [mark verified] +- [GCC](/implementation.md#gcc): † ‡ [mark verified] +- [ICC](/implementation.md#icc): † [mark verified] +- [Visual C++](/implementation.md#visual_cpp): † [mark verified] †2019-04-29 時点で正式リリース版の対応はまだ無い。処理系独自拡張による等価な実装はあり。 ‡2019-04-29 時点で `GCC-10.0.0 20190426 (experimental)` では使用可能を確認。 diff --git a/reference/memory/bad_weak_ptr.md b/reference/memory/bad_weak_ptr.md index 7306c45cf9..f9d96d0584 100644 --- a/reference/memory/bad_weak_ptr.md +++ b/reference/memory/bad_weak_ptr.md @@ -58,9 +58,9 @@ bad_weak_ptr ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.4, 4.7.2(what()が"std::bad_weak_ptr"を返すので規格違反。バグ報告済み: [#55847](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55847)。4.7.3で修正されている。) +- [GCC](/implementation.md#gcc): 4.4 [mark verified], 4.7.2(what()が"std::bad_weak_ptr"を返すので規格違反。バグ報告済み: [#55847](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55847)。4.7.3で修正されている。) [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1), 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] - 2010までは`what()`が`"tr1::bad_weak_ptr"`を返す。 ## 参照 diff --git a/reference/memory/construct_at.md b/reference/memory/construct_at.md index 8bebb251cd..0b993944fe 100644 --- a/reference/memory/construct_at.md +++ b/reference/memory/construct_at.md @@ -77,8 +77,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 12.0 -- [GCC](/implementation.md#gcc): 10.1 +- [Clang](/implementation.md#clang): 12.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/memory/declare_no_pointers.md b/reference/memory/declare_no_pointers.md index bbbc4dc965..45a6d7f7be 100644 --- a/reference/memory/declare_no_pointers.md +++ b/reference/memory/declare_no_pointers.md @@ -107,9 +107,9 @@ int main() ### 処理系 - [GCC](/implementation.md#gcc): ? -- [Clang](/implementation.md#clang): 3.4 (relaxed実装) +- [Clang](/implementation.md#clang): 3.4 (relaxed実装) [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 (relaxed実装) +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 (relaxed実装) [mark verified] ## 参照 diff --git a/reference/memory/declare_reachable.md b/reference/memory/declare_reachable.md index 735b448c1d..cced62c90e 100644 --- a/reference/memory/declare_reachable.md +++ b/reference/memory/declare_reachable.md @@ -80,9 +80,9 @@ int main() ### 処理系 - [GCC](/implementation.md#gcc): ? -- [Clang](/implementation.md#clang): 3.4 (relaxed実装) +- [Clang](/implementation.md#clang): 3.4 (relaxed実装) [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 (relaxed実装) +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 (relaxed実装) [mark verified] ## 参照 * [C++0x ガベージコレクションと到達可能性ベースリーク検知の最小支援 - Faith and Brave - C++で遊ぼう](http://faithandbrave.hateblo.jp/entry/20081117/1226913980) diff --git a/reference/memory/default_delete.md b/reference/memory/default_delete.md index 9bf2d54add..daa4caa748 100644 --- a/reference/memory/default_delete.md +++ b/reference/memory/default_delete.md @@ -78,9 +78,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.4, 4.7.2 +- [GCC](/implementation.md#gcc): 4.4 [mark verified], 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/memory/destroy.md b/reference/memory/destroy.md index 294969c838..3bf2f008c8 100644 --- a/reference/memory/destroy.md +++ b/reference/memory/destroy.md @@ -85,8 +85,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/memory/destroy_at.md b/reference/memory/destroy_at.md index 4b04500c03..5a23e4e0ec 100644 --- a/reference/memory/destroy_at.md +++ b/reference/memory/destroy_at.md @@ -69,8 +69,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/memory/destroy_n.md b/reference/memory/destroy_n.md index 22b9947c34..5364002863 100644 --- a/reference/memory/destroy_n.md +++ b/reference/memory/destroy_n.md @@ -86,8 +86,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/memory/enable_shared_from_this.md b/reference/memory/enable_shared_from_this.md index bec49a50ce..2b372426cd 100644 --- a/reference/memory/enable_shared_from_this.md +++ b/reference/memory/enable_shared_from_this.md @@ -93,10 +93,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1), 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/memory/enable_shared_from_this/op_assign.md b/reference/memory/enable_shared_from_this/op_assign.md index 1bb472fbde..047c1b27ec 100644 --- a/reference/memory/enable_shared_from_this/op_assign.md +++ b/reference/memory/enable_shared_from_this/op_assign.md @@ -23,7 +23,7 @@ enable_shared_from_this& operator=(const enable_shared_from_this&) noexcept; - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1), 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/memory/enable_shared_from_this/op_constructor.md b/reference/memory/enable_shared_from_this/op_constructor.md index 57af413025..8629bc188a 100644 --- a/reference/memory/enable_shared_from_this/op_constructor.md +++ b/reference/memory/enable_shared_from_this/op_constructor.md @@ -25,10 +25,10 @@ enable_shared_from_this(const enable_shared_from_this&) noexcept; // (2) - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1), 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 - [P0033R0 Re-enabling `shared_from_this`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0033r0.html) diff --git a/reference/memory/enable_shared_from_this/op_destructor.md b/reference/memory/enable_shared_from_this/op_destructor.md index be7cbdbb7f..fccbc4431c 100644 --- a/reference/memory/enable_shared_from_this/op_destructor.md +++ b/reference/memory/enable_shared_from_this/op_destructor.md @@ -18,10 +18,10 @@ - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1), 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 - [P0033R0 Re-enabling `shared_from_this`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0033r0.html) diff --git a/reference/memory/enable_shared_from_this/shared_from_this.md b/reference/memory/enable_shared_from_this/shared_from_this.md index ef7121902f..d3c806b7b4 100644 --- a/reference/memory/enable_shared_from_this/shared_from_this.md +++ b/reference/memory/enable_shared_from_this/shared_from_this.md @@ -72,10 +72,10 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1), 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 - [P0033R0 Re-enabling `shared_from_this`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0033r0.html) diff --git a/reference/memory/enable_shared_from_this/weak_from_this.md b/reference/memory/enable_shared_from_this/weak_from_this.md index a8c5ea7deb..3a552a4265 100644 --- a/reference/memory/enable_shared_from_this/weak_from_this.md +++ b/reference/memory/enable_shared_from_this/weak_from_this.md @@ -56,8 +56,8 @@ int main() - C++17 ### 処理系 -- [GCC](/implementation.md#gcc): 7.3 -- [Clang](/implementation.md#clang): 3.9 +- [GCC](/implementation.md#gcc): 7.3 [mark verified] +- [Clang](/implementation.md#clang): 3.9 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/memory/get_pointer_safety.md b/reference/memory/get_pointer_safety.md index b0472fa271..05ac5e1c43 100644 --- a/reference/memory/get_pointer_safety.md +++ b/reference/memory/get_pointer_safety.md @@ -32,7 +32,7 @@ namespace std { - [Clang](/implementation.md#clang): - [GCC](/implementation.md#gcc): - [ICC](/implementation.md#icc): -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/memory/make_obj_using_allocator.md b/reference/memory/make_obj_using_allocator.md index abd2a8cc12..545cac027c 100644 --- a/reference/memory/make_obj_using_allocator.md +++ b/reference/memory/make_obj_using_allocator.md @@ -91,8 +91,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): ??(9.0.0 の時点で未実装) -- [GCC](/implementation.md#gcc): 9.1.0 +- [Clang](/implementation.md#clang): 9.0.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/memory/make_shared.md b/reference/memory/make_shared.md index 3519a46bc1..9be943d808 100644 --- a/reference/memory/make_shared.md +++ b/reference/memory/make_shared.md @@ -105,10 +105,10 @@ int main() { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2, 3.3 -- [GCC](/implementation.md#gcc): 4.4, 4.7.3, 4.8.2 +- [Clang](/implementation.md#clang): 3.2 [mark verified], 3.3 [mark verified] +- [GCC](/implementation.md#gcc): 4.4 [mark verified], 4.7.3 [mark verified], 4.8.2 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] - 2010〜2012 でも使用可能だが、コンパイラが可変引数テンプレートに対応していないため、最大10個の引数を受け取れる形で実装されている。 diff --git a/reference/memory/make_shared_for_overwrite.md b/reference/memory/make_shared_for_overwrite.md index e95f9967d8..1256852e0a 100644 --- a/reference/memory/make_shared_for_overwrite.md +++ b/reference/memory/make_shared_for_overwrite.md @@ -79,8 +79,8 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 10.0.0 現在未対応 -- [GCC](/implementation.md#gcc): 10.0.0 現在未対応 +- [Clang](/implementation.md#clang): 10.0.0 現在未対応 [mark verified] +- [GCC](/implementation.md#gcc): 10.0.0 現在未対応 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/memory/make_unique.md b/reference/memory/make_unique.md index b15e45c441..5f3f377df7 100644 --- a/reference/memory/make_unique.md +++ b/reference/memory/make_unique.md @@ -82,10 +82,10 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.4 -- [GCC](/implementation.md#gcc): 4.9 +- [Clang](/implementation.md#clang): 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.9 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/memory/make_unique_for_overwrite.md b/reference/memory/make_unique_for_overwrite.md index 35fe5abf68..6c17786ae3 100644 --- a/reference/memory/make_unique_for_overwrite.md +++ b/reference/memory/make_unique_for_overwrite.md @@ -70,8 +70,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 10.0.0 現在未対応 -- [GCC](/implementation.md#gcc): 10.0.0 現在未対応 +- [Clang](/implementation.md#clang): 10.0.0 現在未対応 [mark verified] +- [GCC](/implementation.md#gcc): 10.0.0 現在未対応 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/memory/owner_less.md b/reference/memory/owner_less.md index 6e3d41d5ce..b73dd55e55 100644 --- a/reference/memory/owner_less.md +++ b/reference/memory/owner_less.md @@ -168,10 +168,10 @@ false - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.4.7 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/memory/pointer_safety.md b/reference/memory/pointer_safety.md index 79ef952547..d9581bcec8 100644 --- a/reference/memory/pointer_safety.md +++ b/reference/memory/pointer_safety.md @@ -43,7 +43,7 @@ namespace std { - [Clang](/implementation.md#clang): ? - [GCC](/implementation.md#gcc): ? - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 - [C++0x ガベージコレクションと到達可能性ベースリーク検知の最小支援 - Faith and Brave - C++で遊ぼう](http://faithandbrave.hateblo.jp/entry/20081117/1226913980) diff --git a/reference/memory/pointer_traits.md b/reference/memory/pointer_traits.md index 2f143ad931..40a9892907 100644 --- a/reference/memory/pointer_traits.md +++ b/reference/memory/pointer_traits.md @@ -72,10 +72,10 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.7.3 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.7.3 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/memory/pointer_traits/pointer_to.md b/reference/memory/pointer_traits/pointer_to.md index 8e8a0c30bf..a5aa7af282 100644 --- a/reference/memory/pointer_traits/pointer_to.md +++ b/reference/memory/pointer_traits/pointer_to.md @@ -49,10 +49,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.7.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.3 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/memory/ranges_construct_at.md b/reference/memory/ranges_construct_at.md index 6688f6eb1e..cc1c09bfb8 100644 --- a/reference/memory/ranges_construct_at.md +++ b/reference/memory/ranges_construct_at.md @@ -78,9 +78,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 10.2.0 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.2.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 diff --git a/reference/memory/ranges_destroy.md b/reference/memory/ranges_destroy.md index 4799f5fd1d..b013d80bd0 100644 --- a/reference/memory/ranges_destroy.md +++ b/reference/memory/ranges_destroy.md @@ -102,9 +102,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 10.2.0 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.2.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 diff --git a/reference/memory/ranges_destroy_at.md b/reference/memory/ranges_destroy_at.md index cb1014ddd8..0bdaa25e8c 100644 --- a/reference/memory/ranges_destroy_at.md +++ b/reference/memory/ranges_destroy_at.md @@ -68,9 +68,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 10.2.0 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.2.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 diff --git a/reference/memory/ranges_destroy_n.md b/reference/memory/ranges_destroy_n.md index 3e1ca1afcd..32645d979d 100644 --- a/reference/memory/ranges_destroy_n.md +++ b/reference/memory/ranges_destroy_n.md @@ -89,9 +89,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 10.2.0 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.2.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 diff --git a/reference/memory/ranges_uninitialized_copy.md b/reference/memory/ranges_uninitialized_copy.md index 381a318742..34796e6d2f 100644 --- a/reference/memory/ranges_uninitialized_copy.md +++ b/reference/memory/ranges_uninitialized_copy.md @@ -142,9 +142,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 10.2.0 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.2.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 diff --git a/reference/memory/ranges_uninitialized_copy_n.md b/reference/memory/ranges_uninitialized_copy_n.md index ba3edaebdc..a6ab82f5d6 100644 --- a/reference/memory/ranges_uninitialized_copy_n.md +++ b/reference/memory/ranges_uninitialized_copy_n.md @@ -121,9 +121,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 10.2.0 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.2.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 diff --git a/reference/memory/ranges_uninitialized_default_construct.md b/reference/memory/ranges_uninitialized_default_construct.md index 7e4ae7e346..ee6fac6fab 100644 --- a/reference/memory/ranges_uninitialized_default_construct.md +++ b/reference/memory/ranges_uninitialized_default_construct.md @@ -125,9 +125,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 10.2.0 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.2.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 diff --git a/reference/memory/ranges_uninitialized_default_construct_n.md b/reference/memory/ranges_uninitialized_default_construct_n.md index e1ff737166..92c66aaa2a 100644 --- a/reference/memory/ranges_uninitialized_default_construct_n.md +++ b/reference/memory/ranges_uninitialized_default_construct_n.md @@ -95,9 +95,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 10.2.0 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.2.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 diff --git a/reference/memory/ranges_uninitialized_fill.md b/reference/memory/ranges_uninitialized_fill.md index 27c6f35d0c..c75b8ac4aa 100644 --- a/reference/memory/ranges_uninitialized_fill.md +++ b/reference/memory/ranges_uninitialized_fill.md @@ -120,9 +120,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 10.2.0 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.2.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 diff --git a/reference/memory/ranges_uninitialized_fill_n.md b/reference/memory/ranges_uninitialized_fill_n.md index 4490ea5693..77209759b9 100644 --- a/reference/memory/ranges_uninitialized_fill_n.md +++ b/reference/memory/ranges_uninitialized_fill_n.md @@ -90,9 +90,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 10.2.0 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.2.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 diff --git a/reference/memory/ranges_uninitialized_move.md b/reference/memory/ranges_uninitialized_move.md index d19f2cb1d5..36604fd06b 100644 --- a/reference/memory/ranges_uninitialized_move.md +++ b/reference/memory/ranges_uninitialized_move.md @@ -144,9 +144,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 10.2.0 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.2.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 diff --git a/reference/memory/ranges_uninitialized_move_n.md b/reference/memory/ranges_uninitialized_move_n.md index 0b646f6a38..1107df6b11 100644 --- a/reference/memory/ranges_uninitialized_move_n.md +++ b/reference/memory/ranges_uninitialized_move_n.md @@ -122,9 +122,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 10.2.0 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.2.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 diff --git a/reference/memory/ranges_uninitialized_value_construct.md b/reference/memory/ranges_uninitialized_value_construct.md index 2d26b966a1..6be80bdb48 100644 --- a/reference/memory/ranges_uninitialized_value_construct.md +++ b/reference/memory/ranges_uninitialized_value_construct.md @@ -121,9 +121,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 10.2.0 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.2.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 diff --git a/reference/memory/ranges_uninitialized_value_construct_n.md b/reference/memory/ranges_uninitialized_value_construct_n.md index ba2cf6981a..b550410aec 100644 --- a/reference/memory/ranges_uninitialized_value_construct_n.md +++ b/reference/memory/ranges_uninitialized_value_construct_n.md @@ -96,9 +96,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 10.2.0 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.2.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 diff --git a/reference/memory/shared_ptr.md b/reference/memory/shared_ptr.md index 796eb02a74..5397305d8d 100644 --- a/reference/memory/shared_ptr.md +++ b/reference/memory/shared_ptr.md @@ -207,10 +207,10 @@ Y dtor - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1), 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/memory/shared_ptr/atomic_compare_exchange_strong.md b/reference/memory/shared_ptr/atomic_compare_exchange_strong.md index 34571b12ca..978e8cf204 100644 --- a/reference/memory/shared_ptr/atomic_compare_exchange_strong.md +++ b/reference/memory/shared_ptr/atomic_compare_exchange_strong.md @@ -82,10 +82,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.3 -- [GCC](/implementation.md#gcc): 5.0 +- [Clang](/implementation.md#clang): 3.3 [mark verified] +- [GCC](/implementation.md#gcc): 5.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/memory/shared_ptr/atomic_compare_exchange_strong_explicit.md b/reference/memory/shared_ptr/atomic_compare_exchange_strong_explicit.md index d87cd9c12a..d8c5f820f6 100644 --- a/reference/memory/shared_ptr/atomic_compare_exchange_strong_explicit.md +++ b/reference/memory/shared_ptr/atomic_compare_exchange_strong_explicit.md @@ -92,10 +92,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.3 -- [GCC](/implementation.md#gcc): 5.0 +- [Clang](/implementation.md#clang): 3.3 [mark verified] +- [GCC](/implementation.md#gcc): 5.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/memory/shared_ptr/atomic_compare_exchange_weak.md b/reference/memory/shared_ptr/atomic_compare_exchange_weak.md index 8a8d5d53c2..36146f0e71 100644 --- a/reference/memory/shared_ptr/atomic_compare_exchange_weak.md +++ b/reference/memory/shared_ptr/atomic_compare_exchange_weak.md @@ -81,10 +81,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.3 -- [GCC](/implementation.md#gcc): 5.0 +- [Clang](/implementation.md#clang): 3.3 [mark verified] +- [GCC](/implementation.md#gcc): 5.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/memory/shared_ptr/atomic_compare_exchange_weak_explicit.md b/reference/memory/shared_ptr/atomic_compare_exchange_weak_explicit.md index 665cd61862..71ca34753a 100644 --- a/reference/memory/shared_ptr/atomic_compare_exchange_weak_explicit.md +++ b/reference/memory/shared_ptr/atomic_compare_exchange_weak_explicit.md @@ -90,10 +90,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.3 -- [GCC](/implementation.md#gcc): 5.0 +- [Clang](/implementation.md#clang): 3.3 [mark verified] +- [GCC](/implementation.md#gcc): 5.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/memory/shared_ptr/atomic_exchange.md b/reference/memory/shared_ptr/atomic_exchange.md index 0397fea06d..4aa17f26f2 100644 --- a/reference/memory/shared_ptr/atomic_exchange.md +++ b/reference/memory/shared_ptr/atomic_exchange.md @@ -73,10 +73,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.3 -- [GCC](/implementation.md#gcc): 5.0 +- [Clang](/implementation.md#clang): 3.3 [mark verified] +- [GCC](/implementation.md#gcc): 5.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/memory/shared_ptr/atomic_exchange_explicit.md b/reference/memory/shared_ptr/atomic_exchange_explicit.md index 574fc88566..05b02df40a 100644 --- a/reference/memory/shared_ptr/atomic_exchange_explicit.md +++ b/reference/memory/shared_ptr/atomic_exchange_explicit.md @@ -76,10 +76,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.3 -- [GCC](/implementation.md#gcc): 5.0 +- [Clang](/implementation.md#clang): 3.3 [mark verified] +- [GCC](/implementation.md#gcc): 5.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/memory/shared_ptr/atomic_is_lock_free.md b/reference/memory/shared_ptr/atomic_is_lock_free.md index 281dafdfdb..42d63173c0 100644 --- a/reference/memory/shared_ptr/atomic_is_lock_free.md +++ b/reference/memory/shared_ptr/atomic_is_lock_free.md @@ -72,10 +72,10 @@ shared_ptr isn't lock-free ### 処理系 -- [Clang](/implementation.md#clang): 3.3 -- [GCC](/implementation.md#gcc): 5.0 +- [Clang](/implementation.md#clang): 3.3 [mark verified] +- [GCC](/implementation.md#gcc): 5.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/memory/shared_ptr/atomic_load.md b/reference/memory/shared_ptr/atomic_load.md index 94b1b3ef19..1c39621918 100644 --- a/reference/memory/shared_ptr/atomic_load.md +++ b/reference/memory/shared_ptr/atomic_load.md @@ -75,10 +75,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.3 -- [GCC](/implementation.md#gcc): 5.0 +- [Clang](/implementation.md#clang): 3.3 [mark verified] +- [GCC](/implementation.md#gcc): 5.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/memory/shared_ptr/atomic_load_explicit.md b/reference/memory/shared_ptr/atomic_load_explicit.md index 12b91bdaaa..3b3e89d0d1 100644 --- a/reference/memory/shared_ptr/atomic_load_explicit.md +++ b/reference/memory/shared_ptr/atomic_load_explicit.md @@ -78,10 +78,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.3 -- [GCC](/implementation.md#gcc): 5.0 +- [Clang](/implementation.md#clang): 3.3 [mark verified] +- [GCC](/implementation.md#gcc): 5.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/memory/shared_ptr/atomic_store.md b/reference/memory/shared_ptr/atomic_store.md index fa00e9399b..a6194f0a4e 100644 --- a/reference/memory/shared_ptr/atomic_store.md +++ b/reference/memory/shared_ptr/atomic_store.md @@ -79,10 +79,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.3 -- [GCC](/implementation.md#gcc): 5.0 +- [Clang](/implementation.md#clang): 3.3 [mark verified] +- [GCC](/implementation.md#gcc): 5.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/memory/shared_ptr/atomic_store_explicit.md b/reference/memory/shared_ptr/atomic_store_explicit.md index bc1e5c5f0e..e51443ce28 100644 --- a/reference/memory/shared_ptr/atomic_store_explicit.md +++ b/reference/memory/shared_ptr/atomic_store_explicit.md @@ -82,10 +82,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.3 -- [GCC](/implementation.md#gcc): 5.0 +- [Clang](/implementation.md#clang): 3.3 [mark verified] +- [GCC](/implementation.md#gcc): 5.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/memory/shared_ptr/const_pointer_cast.md b/reference/memory/shared_ptr/const_pointer_cast.md index 628c1ad980..3a1e7247f8 100644 --- a/reference/memory/shared_ptr/const_pointer_cast.md +++ b/reference/memory/shared_ptr/const_pointer_cast.md @@ -67,10 +67,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1), 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/memory/shared_ptr/dynamic_pointer_cast.md b/reference/memory/shared_ptr/dynamic_pointer_cast.md index ae416865b2..d9fc1b6c90 100644 --- a/reference/memory/shared_ptr/dynamic_pointer_cast.md +++ b/reference/memory/shared_ptr/dynamic_pointer_cast.md @@ -87,10 +87,10 @@ B::call() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1), 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/memory/shared_ptr/get.md b/reference/memory/shared_ptr/get.md index 0d30157b5e..6c9c1af543 100644 --- a/reference/memory/shared_ptr/get.md +++ b/reference/memory/shared_ptr/get.md @@ -48,10 +48,10 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1), 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/memory/shared_ptr/get_deleter.md b/reference/memory/shared_ptr/get_deleter.md index 4c16c3bb01..c5a97e73d2 100644 --- a/reference/memory/shared_ptr/get_deleter.md +++ b/reference/memory/shared_ptr/get_deleter.md @@ -60,8 +60,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1), 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/memory/shared_ptr/op_arrow.md b/reference/memory/shared_ptr/op_arrow.md index fd4e5e4cff..b6a41ea5fa 100644 --- a/reference/memory/shared_ptr/op_arrow.md +++ b/reference/memory/shared_ptr/op_arrow.md @@ -54,7 +54,7 @@ hello - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1), 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/memory/shared_ptr/op_assign.md b/reference/memory/shared_ptr/op_assign.md index 135b1b1fd4..cb15085fd3 100644 --- a/reference/memory/shared_ptr/op_assign.md +++ b/reference/memory/shared_ptr/op_assign.md @@ -131,10 +131,10 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.6(unique_ptr以外), 4.4.7 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.3.6(unique_ptr以外) [mark verified], 4.4.7 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1), 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] - 2008は(1), (2), (5)変形のみ - 2008, 2010の(5)は、仮引数の型が`auto_ptr&&`ではなく`auto_ptr&`になっている。 diff --git a/reference/memory/shared_ptr/op_at.md b/reference/memory/shared_ptr/op_at.md index 3802074060..4669009460 100644 --- a/reference/memory/shared_ptr/op_at.md +++ b/reference/memory/shared_ptr/op_at.md @@ -59,6 +59,6 @@ int main() - C++17 ### 処理系 -- [GCC](/implementation.md#gcc): 7.2 +- [GCC](/implementation.md#gcc): 7.2 [mark verified] - [Clang](/implementation.md#clang): - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/memory/shared_ptr/op_bool.md b/reference/memory/shared_ptr/op_bool.md index 706d25fb49..5dd1b2460c 100644 --- a/reference/memory/shared_ptr/op_bool.md +++ b/reference/memory/shared_ptr/op_bool.md @@ -49,10 +49,10 @@ p has resource - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.4.7 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1), 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] - 2012までは、コンパイラが`explicit operator bool`に対応していないため、不透明な型へのポインタ型への変換演算子関数として実装されている。 diff --git a/reference/memory/shared_ptr/op_compare_3way.md b/reference/memory/shared_ptr/op_compare_3way.md index 2938f9bbbd..b135169f6f 100644 --- a/reference/memory/shared_ptr/op_compare_3way.md +++ b/reference/memory/shared_ptr/op_compare_3way.md @@ -84,7 +84,7 @@ p3 is nullptr ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10 +- [GCC](/implementation.md#gcc): 10 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/memory/shared_ptr/op_constructor.md b/reference/memory/shared_ptr/op_constructor.md index 9fdd4119db..25a864be2f 100644 --- a/reference/memory/shared_ptr/op_constructor.md +++ b/reference/memory/shared_ptr/op_constructor.md @@ -267,10 +267,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 (unique_ptr, nullptr以外), 4.4.7 (nullptr以外), 4.6.4 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 (unique_ptr [mark verified], nullptr以外) [mark verified], 4.4.7 (nullptr以外) [mark verified], 4.6.4 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1), 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] - 2008は(1), (2), (3), (4), (8), (9), (12), (13)のみ - 2008, 2010の(13)は、仮引数の型が`auto_ptr&&`ではなく`auto_ptr&`になっている。 diff --git a/reference/memory/shared_ptr/op_deduction_guide.md b/reference/memory/shared_ptr/op_deduction_guide.md index e674d6b21a..77883c4b9f 100644 --- a/reference/memory/shared_ptr/op_deduction_guide.md +++ b/reference/memory/shared_ptr/op_deduction_guide.md @@ -75,7 +75,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 7.1.0 +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/memory/shared_ptr/op_deref.md b/reference/memory/shared_ptr/op_deref.md index bad7510c9e..43681bb391 100644 --- a/reference/memory/shared_ptr/op_deref.md +++ b/reference/memory/shared_ptr/op_deref.md @@ -55,10 +55,10 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1), 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/memory/shared_ptr/op_equal.md b/reference/memory/shared_ptr/op_equal.md index ab176979e2..86efd1a163 100644 --- a/reference/memory/shared_ptr/op_equal.md +++ b/reference/memory/shared_ptr/op_equal.md @@ -72,10 +72,10 @@ p3 is nullptr - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.6 (`nullptr`バージョン以外), 4.6.4 -- [Clang](/implementation.md#clang): 3.0 (`nullptr`バージョン以外), 3.3 +- [GCC](/implementation.md#gcc): 4.3.6 (`nullptr`バージョン以外) [mark verified], 4.6.4 [mark verified] +- [Clang](/implementation.md#clang): 3.0 (`nullptr`バージョン以外) [mark verified], 3.3 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1), 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] - 2012までは`nullptr`バージョンがない。 diff --git a/reference/memory/shared_ptr/op_greater.md b/reference/memory/shared_ptr/op_greater.md index 1962d081d8..b91470f192 100644 --- a/reference/memory/shared_ptr/op_greater.md +++ b/reference/memory/shared_ptr/op_greater.md @@ -69,10 +69,10 @@ false - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.6 (`nullptr`バージョン以外), 4.7.4 -- [Clang](/implementation.md#clang): 3.0 (`nullptr`バージョン以外), 3.3 +- [GCC](/implementation.md#gcc): 4.3.6 (`nullptr`バージョン以外) [mark verified], 4.7.4 [mark verified] +- [Clang](/implementation.md#clang): 3.0 (`nullptr`バージョン以外) [mark verified], 3.3 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] - 2012までは`nullptr`バージョンがない。 diff --git a/reference/memory/shared_ptr/op_greater_equal.md b/reference/memory/shared_ptr/op_greater_equal.md index da474f9a1d..3e8b17da22 100644 --- a/reference/memory/shared_ptr/op_greater_equal.md +++ b/reference/memory/shared_ptr/op_greater_equal.md @@ -69,10 +69,10 @@ false - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.6 (`nullptr`バージョン以外), 4.7.4 -- [Clang](/implementation.md#clang): 3.0 (`nullptr`バージョン以外), 3.3 +- [GCC](/implementation.md#gcc): 4.3.6 (`nullptr`バージョン以外) [mark verified], 4.7.4 [mark verified] +- [Clang](/implementation.md#clang): 3.0 (`nullptr`バージョン以外) [mark verified], 3.3 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] - 2012までは`nullptr`バージョンがない。 diff --git a/reference/memory/shared_ptr/op_less.md b/reference/memory/shared_ptr/op_less.md index fc0d0304e1..f0d025421d 100644 --- a/reference/memory/shared_ptr/op_less.md +++ b/reference/memory/shared_ptr/op_less.md @@ -75,10 +75,10 @@ true - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.6 (`nullptr`バージョン以外), 4.7.4 -- [Clang](/implementation.md#clang): 3.0 (`nullptr`バージョン以外), 3.3 +- [GCC](/implementation.md#gcc): 4.3.6 (`nullptr`バージョン以外) [mark verified], 4.7.4 [mark verified] +- [Clang](/implementation.md#clang): 3.0 (`nullptr`バージョン以外) [mark verified], 3.3 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1), 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] - 2012までは`nullptr`バージョンがない。 diff --git a/reference/memory/shared_ptr/op_less_equal.md b/reference/memory/shared_ptr/op_less_equal.md index 7c53b03fc9..f6a658576b 100644 --- a/reference/memory/shared_ptr/op_less_equal.md +++ b/reference/memory/shared_ptr/op_less_equal.md @@ -69,10 +69,10 @@ true - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.6 (`nullptr`バージョン以外), 4.7.4 -- [Clang](/implementation.md#clang): 3.0 (`nullptr`バージョン以外), 3.3 +- [GCC](/implementation.md#gcc): 4.3.6 (`nullptr`バージョン以外) [mark verified], 4.7.4 [mark verified] +- [Clang](/implementation.md#clang): 3.0 (`nullptr`バージョン以外) [mark verified], 3.3 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] - 2012までは`nullptr`バージョンがない。 diff --git a/reference/memory/shared_ptr/op_not_equal.md b/reference/memory/shared_ptr/op_not_equal.md index 171fe0e65b..3f1ee3e717 100644 --- a/reference/memory/shared_ptr/op_not_equal.md +++ b/reference/memory/shared_ptr/op_not_equal.md @@ -67,10 +67,10 @@ p3 is not nullptr - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.6 (`nullptr`バージョン以外), 4.6.4 -- [Clang](/implementation.md#clang): 3.0 (`nullptr`バージョン以外), 3.3 +- [GCC](/implementation.md#gcc): 4.3.6 (`nullptr`バージョン以外) [mark verified], 4.6.4 [mark verified] +- [Clang](/implementation.md#clang): 3.0 (`nullptr`バージョン以外) [mark verified], 3.3 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1), 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] - 2012までは`nullptr`バージョンがない。 diff --git a/reference/memory/shared_ptr/op_ostream.md b/reference/memory/shared_ptr/op_ostream.md index 52092f8356..a977b1f8bb 100644 --- a/reference/memory/shared_ptr/op_ostream.md +++ b/reference/memory/shared_ptr/op_ostream.md @@ -55,8 +55,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1), 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/memory/shared_ptr/owner_before.md b/reference/memory/shared_ptr/owner_before.md index d3d9cc42ac..06752b4fde 100644 --- a/reference/memory/shared_ptr/owner_before.md +++ b/reference/memory/shared_ptr/owner_before.md @@ -91,10 +91,10 @@ false - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.4.7 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/memory/shared_ptr/reinterpret_pointer_cast.md b/reference/memory/shared_ptr/reinterpret_pointer_cast.md index 81c9ba5c2b..91afa8de74 100644 --- a/reference/memory/shared_ptr/reinterpret_pointer_cast.md +++ b/reference/memory/shared_ptr/reinterpret_pointer_cast.md @@ -74,7 +74,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 7.3 +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/memory/shared_ptr/reset.md b/reference/memory/shared_ptr/reset.md index b6d66f7b0c..a62c6e4852 100644 --- a/reference/memory/shared_ptr/reset.md +++ b/reference/memory/shared_ptr/reset.md @@ -67,7 +67,7 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1), 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/memory/shared_ptr/static_pointer_cast.md b/reference/memory/shared_ptr/static_pointer_cast.md index 9bed817c3a..e44b0f7555 100644 --- a/reference/memory/shared_ptr/static_pointer_cast.md +++ b/reference/memory/shared_ptr/static_pointer_cast.md @@ -80,9 +80,9 @@ B::call() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.4 +- [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1), 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/memory/shared_ptr/swap.md b/reference/memory/shared_ptr/swap.md index ed721e69af..81425942bb 100644 --- a/reference/memory/shared_ptr/swap.md +++ b/reference/memory/shared_ptr/swap.md @@ -60,7 +60,7 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1), 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/memory/shared_ptr/swap_free.md b/reference/memory/shared_ptr/swap_free.md index 8372655147..cba035670b 100644 --- a/reference/memory/shared_ptr/swap_free.md +++ b/reference/memory/shared_ptr/swap_free.md @@ -62,7 +62,7 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1), 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] diff --git a/reference/memory/shared_ptr/unique.md b/reference/memory/shared_ptr/unique.md index 9702cde3fc..a2b1d9d7e4 100644 --- a/reference/memory/shared_ptr/unique.md +++ b/reference/memory/shared_ptr/unique.md @@ -67,10 +67,10 @@ non unique - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.4.7 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1), 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/memory/shared_ptr/use_count.md b/reference/memory/shared_ptr/use_count.md index 2d3e646e46..2d038fc499 100644 --- a/reference/memory/shared_ptr/use_count.md +++ b/reference/memory/shared_ptr/use_count.md @@ -53,10 +53,10 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.4.7 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1), 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/memory/to_address.md b/reference/memory/to_address.md index 98a1321d37..be56297919 100644 --- a/reference/memory/to_address.md +++ b/reference/memory/to_address.md @@ -103,8 +103,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 6.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 6.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/memory/undeclare_no_pointers.md b/reference/memory/undeclare_no_pointers.md index 781a668b35..88d0212c21 100644 --- a/reference/memory/undeclare_no_pointers.md +++ b/reference/memory/undeclare_no_pointers.md @@ -56,9 +56,9 @@ int main() ### 処理系 - [GCC](/implementation.md#gcc): ? -- [Clang](/implementation.md#clang): 3.4 (relaxed実装) +- [Clang](/implementation.md#clang): 3.4 (relaxed実装) [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 (relaxed実装) +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 (relaxed実装) [mark verified] ## 参照 diff --git a/reference/memory/undeclare_reachable.md b/reference/memory/undeclare_reachable.md index 95d090859b..b082d11197 100644 --- a/reference/memory/undeclare_reachable.md +++ b/reference/memory/undeclare_reachable.md @@ -68,9 +68,9 @@ int main() ### 処理系 - [GCC](/implementation.md#gcc): ? -- [Clang](/implementation.md#clang): 3.4 (relaxed実装) +- [Clang](/implementation.md#clang): 3.4 (relaxed実装) [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 (relaxed実装) +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 (relaxed実装) [mark verified] ## 参照 diff --git a/reference/memory/uninitialized_construct_using_allocator.md b/reference/memory/uninitialized_construct_using_allocator.md index 5bedd71484..9682763dee 100644 --- a/reference/memory/uninitialized_construct_using_allocator.md +++ b/reference/memory/uninitialized_construct_using_allocator.md @@ -90,8 +90,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): ??(9.0.0 の時点で未実装) -- [GCC](/implementation.md#gcc): 9.1.0 +- [Clang](/implementation.md#clang): 9.0.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/memory/uninitialized_copy_n.md b/reference/memory/uninitialized_copy_n.md index 461b339bae..3e5b4fba24 100644 --- a/reference/memory/uninitialized_copy_n.md +++ b/reference/memory/uninitialized_copy_n.md @@ -113,8 +113,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.4.7 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/memory/uninitialized_default_construct.md b/reference/memory/uninitialized_default_construct.md index d3b092fa59..64df4a7ddd 100644 --- a/reference/memory/uninitialized_default_construct.md +++ b/reference/memory/uninitialized_default_construct.md @@ -100,8 +100,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/memory/uninitialized_default_construct_n.md b/reference/memory/uninitialized_default_construct_n.md index 40207f3335..104b396f2c 100644 --- a/reference/memory/uninitialized_default_construct_n.md +++ b/reference/memory/uninitialized_default_construct_n.md @@ -99,8 +99,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/memory/uninitialized_move.md b/reference/memory/uninitialized_move.md index bc78fbf44f..ac90325b3b 100644 --- a/reference/memory/uninitialized_move.md +++ b/reference/memory/uninitialized_move.md @@ -104,8 +104,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/memory/uninitialized_move_n.md b/reference/memory/uninitialized_move_n.md index 26888fc1a2..174645b7dd 100644 --- a/reference/memory/uninitialized_move_n.md +++ b/reference/memory/uninitialized_move_n.md @@ -104,8 +104,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/memory/uninitialized_value_construct.md b/reference/memory/uninitialized_value_construct.md index ed381b073f..e0d530b553 100644 --- a/reference/memory/uninitialized_value_construct.md +++ b/reference/memory/uninitialized_value_construct.md @@ -94,8 +94,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/memory/uninitialized_value_construct_n.md b/reference/memory/uninitialized_value_construct_n.md index f27882d749..2dc93acf2a 100644 --- a/reference/memory/uninitialized_value_construct_n.md +++ b/reference/memory/uninitialized_value_construct_n.md @@ -94,8 +94,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/memory/unique_ptr.md b/reference/memory/unique_ptr.md index 237576b9cd..1753359dd3 100644 --- a/reference/memory/unique_ptr.md +++ b/reference/memory/unique_ptr.md @@ -130,9 +130,9 @@ hoge::~hoge() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.4, 4.7.2 +- [GCC](/implementation.md#gcc): 4.4 [mark verified], 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 関連項目 diff --git a/reference/memory/unique_ptr/get.md b/reference/memory/unique_ptr/get.md index 2876ad8017..e0631593ec 100644 --- a/reference/memory/unique_ptr/get.md +++ b/reference/memory/unique_ptr/get.md @@ -48,10 +48,10 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.4.7 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/memory/unique_ptr/get_deleter.md b/reference/memory/unique_ptr/get_deleter.md index 73dc0eb677..2996744d84 100644 --- a/reference/memory/unique_ptr/get_deleter.md +++ b/reference/memory/unique_ptr/get_deleter.md @@ -46,10 +46,10 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.4.7 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/memory/unique_ptr/op_arrow.md b/reference/memory/unique_ptr/op_arrow.md index dcc9843439..ef1f1f9e64 100644 --- a/reference/memory/unique_ptr/op_arrow.md +++ b/reference/memory/unique_ptr/op_arrow.md @@ -50,10 +50,10 @@ hello - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.4.7 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/memory/unique_ptr/op_assign.md b/reference/memory/unique_ptr/op_assign.md index bffce536bc..5cbe92b208 100644 --- a/reference/memory/unique_ptr/op_assign.md +++ b/reference/memory/unique_ptr/op_assign.md @@ -105,10 +105,10 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.4.7 (nullptr_tのオーバーロード以外), 4.6.4 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.4.7 (nullptr_tのオーバーロード以外) [mark verified], 4.6.4 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] - 2010にはnullptr_tのオーバーロードがない。 - 2012までは、delete宣言に対応していないため、代わりにprivateで宣言のみ行う手法で代用されている。 diff --git a/reference/memory/unique_ptr/op_at.md b/reference/memory/unique_ptr/op_at.md index 319849610c..e50e11db53 100644 --- a/reference/memory/unique_ptr/op_at.md +++ b/reference/memory/unique_ptr/op_at.md @@ -50,10 +50,10 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.4.7 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/memory/unique_ptr/op_bool.md b/reference/memory/unique_ptr/op_bool.md index 8dd564e714..0bd1a9ccd0 100644 --- a/reference/memory/unique_ptr/op_bool.md +++ b/reference/memory/unique_ptr/op_bool.md @@ -50,10 +50,10 @@ p has resource - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.4.7 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] - 2012までは、コンパイラが`explicit operator bool`に対応していないため、不透明な型へのポインタ型への変換演算子関数として実装されている。 diff --git a/reference/memory/unique_ptr/op_compare_3way.md b/reference/memory/unique_ptr/op_compare_3way.md index 42125823c4..1fa1f245a0 100644 --- a/reference/memory/unique_ptr/op_compare_3way.md +++ b/reference/memory/unique_ptr/op_compare_3way.md @@ -90,7 +90,7 @@ p2 is nullptr ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10 +- [GCC](/implementation.md#gcc): 10 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/memory/unique_ptr/op_constructor.md b/reference/memory/unique_ptr/op_constructor.md index e63bf2eabe..a23183cb00 100644 --- a/reference/memory/unique_ptr/op_constructor.md +++ b/reference/memory/unique_ptr/op_constructor.md @@ -160,10 +160,10 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.4.7 (nullptr_tのオーバーロード以外), 4.6.4 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.4.7 (nullptr_tのオーバーロード以外) [mark verified], 4.6.4 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] - 2012までは、delete宣言に対応していないため、代わりにprivateで宣言のみ行う手法で代用されている。 diff --git a/reference/memory/unique_ptr/op_deref.md b/reference/memory/unique_ptr/op_deref.md index 1bfd37e7cb..b19c1c8037 100644 --- a/reference/memory/unique_ptr/op_deref.md +++ b/reference/memory/unique_ptr/op_deref.md @@ -52,10 +52,10 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.4.7 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/memory/unique_ptr/op_destructor.md b/reference/memory/unique_ptr/op_destructor.md index 9626191ac0..25b1553426 100644 --- a/reference/memory/unique_ptr/op_destructor.md +++ b/reference/memory/unique_ptr/op_destructor.md @@ -23,10 +23,10 @@ constexpr ~unique_ptr(); // C++23 - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.4.7 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/memory/unique_ptr/op_equal.md b/reference/memory/unique_ptr/op_equal.md index b9ede623b4..c37169b64c 100644 --- a/reference/memory/unique_ptr/op_equal.md +++ b/reference/memory/unique_ptr/op_equal.md @@ -74,10 +74,10 @@ p2 is nullptr - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.4.7 (`nullptr`バージョン以外), 4.6.4 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.4.7 (`nullptr`バージョン以外) [mark verified], 4.6.4 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] - 2012までは`nullptr`バージョンがない。 diff --git a/reference/memory/unique_ptr/op_greater.md b/reference/memory/unique_ptr/op_greater.md index 151f3dbcae..fde6c3f53b 100644 --- a/reference/memory/unique_ptr/op_greater.md +++ b/reference/memory/unique_ptr/op_greater.md @@ -69,10 +69,10 @@ false - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.4.7 (`nullptr`バージョン以外), 4.7.4 -- [Clang](/implementation.md#clang): 3.0 (`nullptr`バージョン以外), 3.3 +- [GCC](/implementation.md#gcc): 4.4.7 (`nullptr`バージョン以外) [mark verified], 4.7.4 [mark verified] +- [Clang](/implementation.md#clang): 3.0 (`nullptr`バージョン以外) [mark verified], 3.3 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] - 2012までは`nullptr`バージョンがない。 diff --git a/reference/memory/unique_ptr/op_greater_equal.md b/reference/memory/unique_ptr/op_greater_equal.md index 267ced55d9..eedb1dfeb4 100644 --- a/reference/memory/unique_ptr/op_greater_equal.md +++ b/reference/memory/unique_ptr/op_greater_equal.md @@ -69,10 +69,10 @@ false - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.4.7 (`nullptr`バージョン以外), 4.7.4 -- [Clang](/implementation.md#clang): 3.0 (`nullptr`バージョン以外), 3.3 +- [GCC](/implementation.md#gcc): 4.4.7 (`nullptr`バージョン以外) [mark verified], 4.7.4 [mark verified] +- [Clang](/implementation.md#clang): 3.0 (`nullptr`バージョン以外) [mark verified], 3.3 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] - 2012までは`nullptr`バージョンがない。 diff --git a/reference/memory/unique_ptr/op_less.md b/reference/memory/unique_ptr/op_less.md index edf98f2b0e..b9fda1c5e1 100644 --- a/reference/memory/unique_ptr/op_less.md +++ b/reference/memory/unique_ptr/op_less.md @@ -71,10 +71,10 @@ true - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.4.7 (`nullptr`バージョン以外), 4.7.4 -- [Clang](/implementation.md#clang): 3.0 (`nullptr`バージョン以外), 3.3 +- [GCC](/implementation.md#gcc): 4.4.7 (`nullptr`バージョン以外) [mark verified], 4.7.4 [mark verified] +- [Clang](/implementation.md#clang): 3.0 (`nullptr`バージョン以外) [mark verified], 3.3 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] - 2012までは`nullptr`バージョンがない。 diff --git a/reference/memory/unique_ptr/op_less_equal.md b/reference/memory/unique_ptr/op_less_equal.md index 663e8a42d1..738c3e6541 100644 --- a/reference/memory/unique_ptr/op_less_equal.md +++ b/reference/memory/unique_ptr/op_less_equal.md @@ -69,10 +69,10 @@ true - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.4.7 (`nullptr`バージョン以外), 4.7.4 -- [Clang](/implementation.md#clang): 3.0 (`nullptr`バージョン以外), 3.3 +- [GCC](/implementation.md#gcc): 4.4.7 (`nullptr`バージョン以外) [mark verified], 4.7.4 [mark verified] +- [Clang](/implementation.md#clang): 3.0 (`nullptr`バージョン以外) [mark verified], 3.3 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] - 2012までは`nullptr`バージョンがない。 diff --git a/reference/memory/unique_ptr/op_not_equal.md b/reference/memory/unique_ptr/op_not_equal.md index 698faed96b..85c2dd109a 100644 --- a/reference/memory/unique_ptr/op_not_equal.md +++ b/reference/memory/unique_ptr/op_not_equal.md @@ -70,10 +70,10 @@ p3 is not nullptr - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.4.7 (`nullptr`バージョン以外), 4.6.4 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.4.7 (`nullptr`バージョン以外) [mark verified], 4.6.4 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] - 2012までは`nullptr`バージョンがない。 diff --git a/reference/memory/unique_ptr/op_ostream.md b/reference/memory/unique_ptr/op_ostream.md index fca2caab9a..282ff58d34 100644 --- a/reference/memory/unique_ptr/op_ostream.md +++ b/reference/memory/unique_ptr/op_ostream.md @@ -58,8 +58,8 @@ int main() - C++17 ### 処理系 -- [GCC](/implementation.md#gcc): 10 -- [Clang](/implementation.md#clang): 7.0 +- [GCC](/implementation.md#gcc): 10 [mark verified] +- [Clang](/implementation.md#clang): 7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/memory/unique_ptr/release.md b/reference/memory/unique_ptr/release.md index 074cc13c0f..3b7adb81d3 100644 --- a/reference/memory/unique_ptr/release.md +++ b/reference/memory/unique_ptr/release.md @@ -57,10 +57,10 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.4.7 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/memory/unique_ptr/reset.md b/reference/memory/unique_ptr/reset.md index 11e85d8f68..d8e0422294 100644 --- a/reference/memory/unique_ptr/reset.md +++ b/reference/memory/unique_ptr/reset.md @@ -74,10 +74,10 @@ p doesn't have resource - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.4.7 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] - 2012までは、delete宣言に対応していないため、代わりにprivateで宣言のみ行う手法で代用されている。 diff --git a/reference/memory/unique_ptr/swap.md b/reference/memory/unique_ptr/swap.md index 3cd9b0f1b6..bf78cf50d3 100644 --- a/reference/memory/unique_ptr/swap.md +++ b/reference/memory/unique_ptr/swap.md @@ -61,10 +61,10 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.4.7 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/memory/unique_ptr/swap_free.md b/reference/memory/unique_ptr/swap_free.md index 8d67c3ff00..2bb60fa523 100644 --- a/reference/memory/unique_ptr/swap_free.md +++ b/reference/memory/unique_ptr/swap_free.md @@ -61,10 +61,10 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.4.7 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/memory/uses_allocator.md b/reference/memory/uses_allocator.md index b312c61232..047f0b3f7d 100644 --- a/reference/memory/uses_allocator.md +++ b/reference/memory/uses_allocator.md @@ -92,10 +92,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.6.4 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.6.4 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 関連項目 diff --git a/reference/memory/uses_allocator_construction_args.md b/reference/memory/uses_allocator_construction_args.md index 3596122c20..3fbbeec455 100644 --- a/reference/memory/uses_allocator_construction_args.md +++ b/reference/memory/uses_allocator_construction_args.md @@ -231,8 +231,8 @@ tuple(piecewise_construct_t, tuple(allocator_arg_t, MyAlloc, 3, ), tuple(4, MyAl - C++20 ### 処理系 -- [Clang](/implementation.md#clang): ??(9.0.0 の時点で未実装) -- [GCC](/implementation.md#gcc): 9.1.0 +- [Clang](/implementation.md#clang): 9.0.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/memory/weak_ptr.md b/reference/memory/weak_ptr.md index fdc5ce63b2..40a554bce5 100644 --- a/reference/memory/weak_ptr.md +++ b/reference/memory/weak_ptr.md @@ -106,10 +106,10 @@ shared_ptr managed object deleted. - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1), 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2008 (TR1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/memory/weak_ptr/expired.md b/reference/memory/weak_ptr/expired.md index de482f04c6..8d98c08d3e 100644 --- a/reference/memory/weak_ptr/expired.md +++ b/reference/memory/weak_ptr/expired.md @@ -61,7 +61,7 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/memory/weak_ptr/lock.md b/reference/memory/weak_ptr/lock.md index 02dcc9dcb8..78317deaf0 100644 --- a/reference/memory/weak_ptr/lock.md +++ b/reference/memory/weak_ptr/lock.md @@ -89,8 +89,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/memory/weak_ptr/op_assign.md b/reference/memory/weak_ptr/op_assign.md index f5771baa94..18beef1d8a 100644 --- a/reference/memory/weak_ptr/op_assign.md +++ b/reference/memory/weak_ptr/op_assign.md @@ -136,8 +136,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/memory/weak_ptr/op_constructor.md b/reference/memory/weak_ptr/op_constructor.md index 54bdeb3090..1af17989e2 100644 --- a/reference/memory/weak_ptr/op_constructor.md +++ b/reference/memory/weak_ptr/op_constructor.md @@ -131,8 +131,8 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/memory/weak_ptr/op_deduction_guide.md b/reference/memory/weak_ptr/op_deduction_guide.md index de17764e92..f426ebfd22 100644 --- a/reference/memory/weak_ptr/op_deduction_guide.md +++ b/reference/memory/weak_ptr/op_deduction_guide.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 7.1.0 +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/memory/weak_ptr/op_destructor.md b/reference/memory/weak_ptr/op_destructor.md index 5b31c3bc6b..ee7e69931a 100644 --- a/reference/memory/weak_ptr/op_destructor.md +++ b/reference/memory/weak_ptr/op_destructor.md @@ -18,7 +18,7 @@ - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/memory/weak_ptr/owner_before.md b/reference/memory/weak_ptr/owner_before.md index 3bf54f4377..61798d25ab 100644 --- a/reference/memory/weak_ptr/owner_before.md +++ b/reference/memory/weak_ptr/owner_before.md @@ -67,8 +67,8 @@ false - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.4.7 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/memory/weak_ptr/reset.md b/reference/memory/weak_ptr/reset.md index f5524efa95..7bd0645515 100644 --- a/reference/memory/weak_ptr/reset.md +++ b/reference/memory/weak_ptr/reset.md @@ -50,7 +50,7 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/memory/weak_ptr/swap.md b/reference/memory/weak_ptr/swap.md index 8fc9dbbcb3..8f21fbb4d3 100644 --- a/reference/memory/weak_ptr/swap.md +++ b/reference/memory/weak_ptr/swap.md @@ -74,7 +74,7 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/memory/weak_ptr/swap_free.md b/reference/memory/weak_ptr/swap_free.md index 90e20a0d53..f6e88b8234 100644 --- a/reference/memory/weak_ptr/swap_free.md +++ b/reference/memory/weak_ptr/swap_free.md @@ -76,7 +76,7 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/memory/weak_ptr/use_count.md b/reference/memory/weak_ptr/use_count.md index e830ea1896..d784d70ac1 100644 --- a/reference/memory/weak_ptr/use_count.md +++ b/reference/memory/weak_ptr/use_count.md @@ -52,7 +52,7 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Clang](/implementation.md#clang): 3.0 +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/memory_resource.md b/reference/memory_resource.md index 46ac6ba6ca..d682a40bbf 100644 --- a/reference/memory_resource.md +++ b/reference/memory_resource.md @@ -93,8 +93,8 @@ auto r = v1 == v2; ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 関連項目 [``](scoped_allocator.md) diff --git a/reference/memory_resource/get_default_resource.md b/reference/memory_resource/get_default_resource.md index fad041ccc7..995fa4c14f 100644 --- a/reference/memory_resource/get_default_resource.md +++ b/reference/memory_resource/get_default_resource.md @@ -55,8 +55,8 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 関連項目 - [`memory_resource`](memory_resource.md) \ No newline at end of file diff --git a/reference/memory_resource/memory_resource.md b/reference/memory_resource/memory_resource.md index 1ad1d604c4..5fdb1744d2 100644 --- a/reference/memory_resource/memory_resource.md +++ b/reference/memory_resource/memory_resource.md @@ -170,8 +170,8 @@ false ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 関連項目 - [`synchronized_pool_resource`](/reference/memory_resource/pool_resource.md) diff --git a/reference/memory_resource/memory_resource/allocate.md b/reference/memory_resource/memory_resource/allocate.md index 9f8cbaf38b..6b3f3b9f0e 100644 --- a/reference/memory_resource/memory_resource/allocate.md +++ b/reference/memory_resource/memory_resource/allocate.md @@ -78,8 +78,8 @@ int main(){ ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 参照 - [P0220R1 Adopt Library Fundamentals V1 TS Components for C++17 (R1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0220r1.html) diff --git a/reference/memory_resource/memory_resource/deallocate.md b/reference/memory_resource/memory_resource/deallocate.md index 952dc1f534..6151aac3c3 100644 --- a/reference/memory_resource/memory_resource/deallocate.md +++ b/reference/memory_resource/memory_resource/deallocate.md @@ -71,5 +71,5 @@ int main(){ ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] diff --git a/reference/memory_resource/memory_resource/do_allocate.md b/reference/memory_resource/memory_resource/do_allocate.md index a388a5109e..3490d7933c 100644 --- a/reference/memory_resource/memory_resource/do_allocate.md +++ b/reference/memory_resource/memory_resource/do_allocate.md @@ -35,8 +35,8 @@ virtual void* do_allocate(std::size_t bytes, std::size_t alignment) = 0; ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 関連項目 - [`do_deallocate`](do_deallocate.md) diff --git a/reference/memory_resource/memory_resource/do_deallocate.md b/reference/memory_resource/memory_resource/do_deallocate.md index 3b3d10d3ac..95af5a2861 100644 --- a/reference/memory_resource/memory_resource/do_deallocate.md +++ b/reference/memory_resource/memory_resource/do_deallocate.md @@ -33,8 +33,8 @@ virtual void do_deallocate(void* p, std::size_t bytes, std::size_t alignment) = ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 関連項目 - [`do_allocate`](do_allocate.md) diff --git a/reference/memory_resource/memory_resource/do_is_equal.md b/reference/memory_resource/memory_resource/do_is_equal.md index 8af7065319..5e03e2d00e 100644 --- a/reference/memory_resource/memory_resource/do_is_equal.md +++ b/reference/memory_resource/memory_resource/do_is_equal.md @@ -28,8 +28,8 @@ virtual bool do_is_equal(const memory_resource& other) const noexcept = 0; ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 関連項目 - [`is_equal`](is_equal.md) \ No newline at end of file diff --git a/reference/memory_resource/memory_resource/is_equal.md b/reference/memory_resource/memory_resource/is_equal.md index 428bc83801..8452ba2207 100644 --- a/reference/memory_resource/memory_resource/is_equal.md +++ b/reference/memory_resource/memory_resource/is_equal.md @@ -53,8 +53,8 @@ false ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 関連項目 - [`do_is_equal`](do_is_equal.md) \ No newline at end of file diff --git a/reference/memory_resource/memory_resource/op_equal.md b/reference/memory_resource/memory_resource/op_equal.md index 141e7e0efe..109769eecb 100644 --- a/reference/memory_resource/memory_resource/op_equal.md +++ b/reference/memory_resource/memory_resource/op_equal.md @@ -60,8 +60,8 @@ false ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 関連項目 - [`is_equal`](is_equal.md) diff --git a/reference/memory_resource/memory_resource/op_not_equal.md b/reference/memory_resource/memory_resource/op_not_equal.md index 8116e92399..2dc44264c3 100644 --- a/reference/memory_resource/memory_resource/op_not_equal.md +++ b/reference/memory_resource/memory_resource/op_not_equal.md @@ -57,8 +57,8 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 関連項目 - [`is_equal`](is_equal.md) diff --git a/reference/memory_resource/monotonic_buffer_resource.md b/reference/memory_resource/monotonic_buffer_resource.md index aff8127dc7..281daea1de 100644 --- a/reference/memory_resource/monotonic_buffer_resource.md +++ b/reference/memory_resource/monotonic_buffer_resource.md @@ -72,8 +72,8 @@ namespace std::pmr { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 関連項目 - [`memory_resource`](memory_resource.md) diff --git a/reference/memory_resource/monotonic_buffer_resource/do_allocate.md b/reference/memory_resource/monotonic_buffer_resource/do_allocate.md index 10eb9ac81d..53e63c2186 100644 --- a/reference/memory_resource/monotonic_buffer_resource/do_allocate.md +++ b/reference/memory_resource/monotonic_buffer_resource/do_allocate.md @@ -44,8 +44,8 @@ void* do_allocate(std::size_t bytes, std::size_t alignment) override; ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 関連項目 - [`memory_resource`](/reference/memory_resource/memory_resource.md) diff --git a/reference/memory_resource/monotonic_buffer_resource/do_deallocate.md b/reference/memory_resource/monotonic_buffer_resource/do_deallocate.md index f7f88a3162..0a928d5f9f 100644 --- a/reference/memory_resource/monotonic_buffer_resource/do_deallocate.md +++ b/reference/memory_resource/monotonic_buffer_resource/do_deallocate.md @@ -26,8 +26,8 @@ void do_deallocate(void* p, std::size_t bytes, std::size_t alignment) override; ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 関連項目 - [`release`](release.md) diff --git a/reference/memory_resource/monotonic_buffer_resource/do_is_equal.md b/reference/memory_resource/monotonic_buffer_resource/do_is_equal.md index db3b281fa7..c53d630729 100644 --- a/reference/memory_resource/monotonic_buffer_resource/do_is_equal.md +++ b/reference/memory_resource/monotonic_buffer_resource/do_is_equal.md @@ -27,8 +27,8 @@ bool do_is_equal(const memory_resource& other) const noexcept override; ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 関連項目 - [`memory_resource`](/reference/memory_resource/memory_resource.md) diff --git a/reference/memory_resource/monotonic_buffer_resource/op_constructor.md b/reference/memory_resource/monotonic_buffer_resource/op_constructor.md index 5e4b44da3e..67e7ebe4da 100644 --- a/reference/memory_resource/monotonic_buffer_resource/op_constructor.md +++ b/reference/memory_resource/monotonic_buffer_resource/op_constructor.md @@ -123,8 +123,8 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 関連項目 - [`pool_options`](../pool_options.md) diff --git a/reference/memory_resource/monotonic_buffer_resource/op_destructor.md b/reference/memory_resource/monotonic_buffer_resource/op_destructor.md index b0c734ba82..7a4829db8f 100644 --- a/reference/memory_resource/monotonic_buffer_resource/op_destructor.md +++ b/reference/memory_resource/monotonic_buffer_resource/op_destructor.md @@ -23,8 +23,8 @@ virtual ~monotonic_buffer_resource(); ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 関連項目 - [`release`](release.md) diff --git a/reference/memory_resource/monotonic_buffer_resource/release.md b/reference/memory_resource/monotonic_buffer_resource/release.md index 9519b40b37..1591e9caeb 100644 --- a/reference/memory_resource/monotonic_buffer_resource/release.md +++ b/reference/memory_resource/monotonic_buffer_resource/release.md @@ -52,8 +52,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 関連項目 - [`memory_resource`](/reference/memory_resource/memory_resource.md) diff --git a/reference/memory_resource/monotonic_buffer_resource/upstream_resource.md b/reference/memory_resource/monotonic_buffer_resource/upstream_resource.md index 45769c0735..606b0e728b 100644 --- a/reference/memory_resource/monotonic_buffer_resource/upstream_resource.md +++ b/reference/memory_resource/monotonic_buffer_resource/upstream_resource.md @@ -44,8 +44,8 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 関連項目 - [`memory_resource`](/reference/memory_resource/memory_resource.md) diff --git a/reference/memory_resource/new_delete_resource.md b/reference/memory_resource/new_delete_resource.md index 4425293f89..44070eda85 100644 --- a/reference/memory_resource/new_delete_resource.md +++ b/reference/memory_resource/new_delete_resource.md @@ -55,8 +55,8 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 関連項目 - [`memory_resource`](memory_resource.md) diff --git a/reference/memory_resource/null_memory_resource.md b/reference/memory_resource/null_memory_resource.md index 45d40fce70..7cd0304a82 100644 --- a/reference/memory_resource/null_memory_resource.md +++ b/reference/memory_resource/null_memory_resource.md @@ -69,8 +69,8 @@ bad allocation ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 関連項目 - [`memory_resource`](memory_resource.md) diff --git a/reference/memory_resource/polymorphic_allocator.md b/reference/memory_resource/polymorphic_allocator.md index df5b1de9d0..3ee66e2c6d 100644 --- a/reference/memory_resource/polymorphic_allocator.md +++ b/reference/memory_resource/polymorphic_allocator.md @@ -76,8 +76,8 @@ C++20にてC++プログラミングにおいての基礎部品となる型(*vo ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 関連項目 - [`memory_resource`](memory_resource.md) diff --git a/reference/memory_resource/polymorphic_allocator/allocate.md b/reference/memory_resource/polymorphic_allocator/allocate.md index b93511615d..e3358f1975 100644 --- a/reference/memory_resource/polymorphic_allocator/allocate.md +++ b/reference/memory_resource/polymorphic_allocator/allocate.md @@ -79,8 +79,8 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 関連項目 - [`memory_resource::allocate`](/reference/memory_resource/memory_resource/allocate.md) diff --git a/reference/memory_resource/polymorphic_allocator/allocate_bytes.md b/reference/memory_resource/polymorphic_allocator/allocate_bytes.md index 4166297b9a..6586eaa467 100644 --- a/reference/memory_resource/polymorphic_allocator/allocate_bytes.md +++ b/reference/memory_resource/polymorphic_allocator/allocate_bytes.md @@ -105,8 +105,8 @@ address : 0x1c38150 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 update 9 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 update 9 [mark verified] ## 関連項目 - [`memory_resource::allocate`](/reference/memory_resource/memory_resource/allocate.md) diff --git a/reference/memory_resource/polymorphic_allocator/allocate_object.md b/reference/memory_resource/polymorphic_allocator/allocate_object.md index 0c800f9386..8ce6a8c278 100644 --- a/reference/memory_resource/polymorphic_allocator/allocate_object.md +++ b/reference/memory_resource/polymorphic_allocator/allocate_object.md @@ -97,8 +97,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 update 9 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 update 9 [mark verified] ## 関連項目 - [`allocate_bytes`](/reference/memory_resource/polymorphic_allocator/allocate_bytes.md) diff --git a/reference/memory_resource/polymorphic_allocator/construct.md b/reference/memory_resource/polymorphic_allocator/construct.md index da2b4f6eb0..f226361eb1 100644 --- a/reference/memory_resource/polymorphic_allocator/construct.md +++ b/reference/memory_resource/polymorphic_allocator/construct.md @@ -363,8 +363,8 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] - 2017, 2019共に(1)以外のオーバーロードを提供していないが、[`pair`](/reference/utility/pair.md) の各要素に対する [uses-allocator 構築](/reference/memory/uses_allocator.md)をサポートしている。(ただし、C++20 モードでもネストした [`pair`](/reference/utility/pair.md) はサポートされていない) ## 関連項目 diff --git a/reference/memory_resource/polymorphic_allocator/deallocate.md b/reference/memory_resource/polymorphic_allocator/deallocate.md index b01e446539..e63faa7726 100644 --- a/reference/memory_resource/polymorphic_allocator/deallocate.md +++ b/reference/memory_resource/polymorphic_allocator/deallocate.md @@ -80,8 +80,8 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 関連項目 - [`memory_resource::deallocate`](/reference/memory_resource/memory_resource/deallocate.md) diff --git a/reference/memory_resource/polymorphic_allocator/deallocate_bytes.md b/reference/memory_resource/polymorphic_allocator/deallocate_bytes.md index 6d89c866b4..8579681b5f 100644 --- a/reference/memory_resource/polymorphic_allocator/deallocate_bytes.md +++ b/reference/memory_resource/polymorphic_allocator/deallocate_bytes.md @@ -98,8 +98,8 @@ address : 0x1c38150 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 update 9 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 update 9 [mark verified] ## 関連項目 - [`memory_resource::deallocate`](/reference/memory_resource/memory_resource/deallocate.md) diff --git a/reference/memory_resource/polymorphic_allocator/deallocate_object.md b/reference/memory_resource/polymorphic_allocator/deallocate_object.md index f493aed4eb..5649baa4e7 100644 --- a/reference/memory_resource/polymorphic_allocator/deallocate_object.md +++ b/reference/memory_resource/polymorphic_allocator/deallocate_object.md @@ -88,8 +88,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 update 9 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 update 9 [mark verified] ## 関連項目 - [`deallocate_bytes`](/reference/memory_resource/polymorphic_allocator/deallocate_bytes.md) diff --git a/reference/memory_resource/polymorphic_allocator/delete_object.md b/reference/memory_resource/polymorphic_allocator/delete_object.md index 3bc11f1ae0..d99a0534eb 100644 --- a/reference/memory_resource/polymorphic_allocator/delete_object.md +++ b/reference/memory_resource/polymorphic_allocator/delete_object.md @@ -94,8 +94,8 @@ address : 0x1a2b960 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 update 9 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 update 9 [mark verified] ## 参照 - [P0339R6 polymorphic_allocator<> as a vocabulary type](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0339r6.pdf) diff --git a/reference/memory_resource/polymorphic_allocator/destroy.md b/reference/memory_resource/polymorphic_allocator/destroy.md index aaaa2436d5..81cf4cac02 100644 --- a/reference/memory_resource/polymorphic_allocator/destroy.md +++ b/reference/memory_resource/polymorphic_allocator/destroy.md @@ -84,7 +84,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? - 2017, 2019共にこの関数は実装されなかった diff --git a/reference/memory_resource/polymorphic_allocator/new_object.md b/reference/memory_resource/polymorphic_allocator/new_object.md index 8af71512bb..6cff189acf 100644 --- a/reference/memory_resource/polymorphic_allocator/new_object.md +++ b/reference/memory_resource/polymorphic_allocator/new_object.md @@ -92,8 +92,8 @@ address : 0x1a2b960 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 update 9 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 update 9 [mark verified] ## 参照 - [P0339R6 polymorphic_allocator<> as a vocabulary type](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0339r6.pdf) diff --git a/reference/memory_resource/polymorphic_allocator/op_constructor.md b/reference/memory_resource/polymorphic_allocator/op_constructor.md index ab4329f103..1fdbcee0b9 100644 --- a/reference/memory_resource/polymorphic_allocator/op_constructor.md +++ b/reference/memory_resource/polymorphic_allocator/op_constructor.md @@ -82,8 +82,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 参照 - [P0220R1 Adopt Library Fundamentals V1 TS Components for C++17 (R1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0220r1.html) diff --git a/reference/memory_resource/polymorphic_allocator/op_equal.md b/reference/memory_resource/polymorphic_allocator/op_equal.md index a39ea343f7..ec93aa67c0 100644 --- a/reference/memory_resource/polymorphic_allocator/op_equal.md +++ b/reference/memory_resource/polymorphic_allocator/op_equal.md @@ -89,8 +89,8 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 関連項目 - [`operator==`](/reference/memory_resource/memory_resource/op_equal.md) diff --git a/reference/memory_resource/polymorphic_allocator/op_not_equal.md b/reference/memory_resource/polymorphic_allocator/op_not_equal.md index 08a714517a..64fecb1fd3 100644 --- a/reference/memory_resource/polymorphic_allocator/op_not_equal.md +++ b/reference/memory_resource/polymorphic_allocator/op_not_equal.md @@ -58,8 +58,8 @@ false ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 (2), 13.1 (1) -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 (2), 2022 17.4 (1) +- [GCC](/implementation.md#gcc): 9.1 (2) [mark verified], 13.1 (1) [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 (2) [mark verified], 2022 17.4 (1) [mark verified] ## 関連項目 - [`operator!=`](/reference/memory_resource/memory_resource/op_not_equal.md) diff --git a/reference/memory_resource/polymorphic_allocator/resource.md b/reference/memory_resource/polymorphic_allocator/resource.md index ef32a1cff2..7352f24f93 100644 --- a/reference/memory_resource/polymorphic_allocator/resource.md +++ b/reference/memory_resource/polymorphic_allocator/resource.md @@ -44,8 +44,8 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 参照 - [P0220R1 Adopt Library Fundamentals V1 TS Components for C++17 (R1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0220r1.html) diff --git a/reference/memory_resource/polymorphic_allocator/select_on_container_copy_construction.md b/reference/memory_resource/polymorphic_allocator/select_on_container_copy_construction.md index a1c5b4fad5..03502a37a6 100644 --- a/reference/memory_resource/polymorphic_allocator/select_on_container_copy_construction.md +++ b/reference/memory_resource/polymorphic_allocator/select_on_container_copy_construction.md @@ -48,8 +48,8 @@ false ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 関連項目 - [`select_on_container_copy_construction`](/reference/memory/allocator_traits/select_on_container_copy_construction.md) diff --git a/reference/memory_resource/pool_options.md b/reference/memory_resource/pool_options.md index e90d05cfa1..f4d198d37c 100644 --- a/reference/memory_resource/pool_options.md +++ b/reference/memory_resource/pool_options.md @@ -38,8 +38,8 @@ namespace std::pmr { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 関連項目 diff --git a/reference/memory_resource/pool_resource.md b/reference/memory_resource/pool_resource.md index 0604e8d290..371b110e58 100644 --- a/reference/memory_resource/pool_resource.md +++ b/reference/memory_resource/pool_resource.md @@ -99,8 +99,8 @@ namespace std::pmr { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 関連項目 - [`pool_options`](pool_options.md) diff --git a/reference/memory_resource/pool_resource/do_allocate.md b/reference/memory_resource/pool_resource/do_allocate.md index 6ce29274d7..c0151f58f9 100644 --- a/reference/memory_resource/pool_resource/do_allocate.md +++ b/reference/memory_resource/pool_resource/do_allocate.md @@ -43,8 +43,8 @@ void* do_allocate(std::size_t bytes, std::size_t alignment) override; ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 関連項目 - [`memory_resource`](/reference/memory_resource/memory_resource.md) diff --git a/reference/memory_resource/pool_resource/do_deallocate.md b/reference/memory_resource/pool_resource/do_deallocate.md index fcdca6e8ea..79a994726f 100644 --- a/reference/memory_resource/pool_resource/do_deallocate.md +++ b/reference/memory_resource/pool_resource/do_deallocate.md @@ -37,8 +37,8 @@ void do_deallocate(void* p, std::size_t bytes, std::size_t alignment) override; ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 関連項目 - [`pool_options`](/reference/memory_resource/pool_options.md) diff --git a/reference/memory_resource/pool_resource/do_is_equal.md b/reference/memory_resource/pool_resource/do_is_equal.md index 6f0b0cadcb..a3d12e8a8d 100644 --- a/reference/memory_resource/pool_resource/do_is_equal.md +++ b/reference/memory_resource/pool_resource/do_is_equal.md @@ -27,8 +27,8 @@ bool do_is_equal(const memory_resource& other) const noexcept override; ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 関連項目 - [`memory_resource`](/reference/memory_resource/memory_resource.md) diff --git a/reference/memory_resource/pool_resource/op_constructor.md b/reference/memory_resource/pool_resource/op_constructor.md index c8083ac001..bd0883de84 100644 --- a/reference/memory_resource/pool_resource/op_constructor.md +++ b/reference/memory_resource/pool_resource/op_constructor.md @@ -99,8 +99,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 関連項目 - [`pool_options`](/reference/memory_resource/pool_options.md) diff --git a/reference/memory_resource/pool_resource/op_destructor.md b/reference/memory_resource/pool_resource/op_destructor.md index 813df0581e..80c701940e 100644 --- a/reference/memory_resource/pool_resource/op_destructor.md +++ b/reference/memory_resource/pool_resource/op_destructor.md @@ -24,8 +24,8 @@ virtual ~pool_resource(); ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 関連項目 - [`release`](release.md) diff --git a/reference/memory_resource/pool_resource/options.md b/reference/memory_resource/pool_resource/options.md index 37be88f184..e096829107 100644 --- a/reference/memory_resource/pool_resource/options.md +++ b/reference/memory_resource/pool_resource/options.md @@ -63,8 +63,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 関連項目 - [`pool_options`](/reference/memory_resource/pool_options.md) diff --git a/reference/memory_resource/pool_resource/release.md b/reference/memory_resource/pool_resource/release.md index ff90c19bb8..082d31a23c 100644 --- a/reference/memory_resource/pool_resource/release.md +++ b/reference/memory_resource/pool_resource/release.md @@ -51,8 +51,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 関連項目 - [`memory_resource`](/reference/memory_resource/memory_resource.md) diff --git a/reference/memory_resource/pool_resource/upstream_resource.md b/reference/memory_resource/pool_resource/upstream_resource.md index 97a30aaa1e..d7599668af 100644 --- a/reference/memory_resource/pool_resource/upstream_resource.md +++ b/reference/memory_resource/pool_resource/upstream_resource.md @@ -47,8 +47,8 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 関連項目 - [`memory_resource`](/reference/memory_resource/memory_resource.md) diff --git a/reference/memory_resource/set_default_resource.md b/reference/memory_resource/set_default_resource.md index 075677080a..58b7bfef2f 100644 --- a/reference/memory_resource/set_default_resource.md +++ b/reference/memory_resource/set_default_resource.md @@ -77,8 +77,8 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 関連項目 - [`memory_resource`](memory_resource.md) diff --git a/reference/mutex.md b/reference/mutex.md index 12715f7111..1c052126f0 100644 --- a/reference/mutex.md +++ b/reference/mutex.md @@ -42,7 +42,7 @@ - C++11 ### 処理系 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 関連項目 diff --git a/reference/mutex/adopt_lock.md b/reference/mutex/adopt_lock.md index 8ed862e4b7..f82c3ca121 100644 --- a/reference/mutex/adopt_lock.md +++ b/reference/mutex/adopt_lock.md @@ -51,9 +51,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012, 2013は`constexpr`が実装されていないため、代わりに`adopt_lock`には`const`が修飾されている。 diff --git a/reference/mutex/call_once.md b/reference/mutex/call_once.md index 58d1dcc46c..db64a4928d 100644 --- a/reference/mutex/call_once.md +++ b/reference/mutex/call_once.md @@ -82,9 +82,9 @@ initialize ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/mutex/defer_lock.md b/reference/mutex/defer_lock.md index 9a543c671a..dc94749c74 100644 --- a/reference/mutex/defer_lock.md +++ b/reference/mutex/defer_lock.md @@ -49,9 +49,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012, 2013は`constexpr`が実装されていないため、代わりに`defer_lock`には`const`が修飾されている。 diff --git a/reference/mutex/lock.md b/reference/mutex/lock.md index c16a22c2f9..af209a99bf 100644 --- a/reference/mutex/lock.md +++ b/reference/mutex/lock.md @@ -102,9 +102,9 @@ Visual C++ 11.0, 12.0では、このコードは正常に動作せず、1件目 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/mutex/lock_guard.md b/reference/mutex/lock_guard.md index 25a66cbb8a..6a1d08a748 100644 --- a/reference/mutex/lock_guard.md +++ b/reference/mutex/lock_guard.md @@ -99,9 +99,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 関連項目 diff --git a/reference/mutex/lock_guard/op_constructor.md b/reference/mutex/lock_guard/op_constructor.md index a55b523d21..77da0cdd16 100644 --- a/reference/mutex/lock_guard/op_constructor.md +++ b/reference/mutex/lock_guard/op_constructor.md @@ -65,9 +65,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012はコピーコンストラクタのdeleteに対応していないため、代わりにprivateで宣言のみ行う手法で代用されている。 diff --git a/reference/mutex/lock_guard/op_destructor.md b/reference/mutex/lock_guard/op_destructor.md index e6414ef30b..eb47cdbd22 100644 --- a/reference/mutex/lock_guard/op_destructor.md +++ b/reference/mutex/lock_guard/op_destructor.md @@ -27,9 +27,9 @@ m.unlock(); ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/mutex/mutex.md b/reference/mutex/mutex.md index 7142302bf5..636dfffe9d 100644 --- a/reference/mutex/mutex.md +++ b/reference/mutex/mutex.md @@ -88,9 +88,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/mutex/mutex/lock.md b/reference/mutex/mutex/lock.md index 89cab1e468..00f7512ef9 100644 --- a/reference/mutex/mutex/lock.md +++ b/reference/mutex/mutex/lock.md @@ -75,9 +75,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/mutex/mutex/native_handle.md b/reference/mutex/mutex/native_handle.md index 4ba52a2f32..93d5e7ebc7 100644 --- a/reference/mutex/mutex/native_handle.md +++ b/reference/mutex/mutex/native_handle.md @@ -58,9 +58,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/mutex/mutex/op_constructor.md b/reference/mutex/mutex/op_constructor.md index a725c6695e..6f454ebfab 100644 --- a/reference/mutex/mutex/op_constructor.md +++ b/reference/mutex/mutex/op_constructor.md @@ -99,9 +99,9 @@ A ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012, 2013, 2015は、デフォルトコンストラクタに`constexpr`が修飾されていない。 - 2012はコピーコンストラクタのdeleteに対応していないため、代わりにprivateで宣言のみ行う手法で代用されている。 diff --git a/reference/mutex/mutex/op_destructor.md b/reference/mutex/mutex/op_destructor.md index e670a9481c..98d1a4a85e 100644 --- a/reference/mutex/mutex/op_destructor.md +++ b/reference/mutex/mutex/op_destructor.md @@ -19,9 +19,9 @@ ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/mutex/mutex/try_lock.md b/reference/mutex/mutex/try_lock.md index fe3c9b77c6..2ae1dce41a 100644 --- a/reference/mutex/mutex/try_lock.md +++ b/reference/mutex/mutex/try_lock.md @@ -83,9 +83,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/mutex/mutex/unlock.md b/reference/mutex/mutex/unlock.md index d3308cf6f5..28863e64f7 100644 --- a/reference/mutex/mutex/unlock.md +++ b/reference/mutex/mutex/unlock.md @@ -71,9 +71,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/mutex/once_flag.md b/reference/mutex/once_flag.md index dd4fbf76b6..69e201facf 100644 --- a/reference/mutex/once_flag.md +++ b/reference/mutex/once_flag.md @@ -67,9 +67,9 @@ initialize ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/mutex/once_flag/op_constructor.md b/reference/mutex/once_flag/op_constructor.md index 2ded49c1ac..d56eb1cdbf 100644 --- a/reference/mutex/once_flag/op_constructor.md +++ b/reference/mutex/once_flag/op_constructor.md @@ -35,9 +35,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012はコピーコンストラクタのdeleteに対応していないため、代わりにprivateで宣言のみ行う手法で代用されている。 diff --git a/reference/mutex/recursive_mutex.md b/reference/mutex/recursive_mutex.md index 1d0b901cfe..5bfb6069cd 100644 --- a/reference/mutex/recursive_mutex.md +++ b/reference/mutex/recursive_mutex.md @@ -99,9 +99,9 @@ count == 2 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/mutex/recursive_mutex/lock.md b/reference/mutex/recursive_mutex/lock.md index 4be0683159..d4ce6b6d23 100644 --- a/reference/mutex/recursive_mutex/lock.md +++ b/reference/mutex/recursive_mutex/lock.md @@ -100,9 +100,9 @@ count == 2 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/mutex/recursive_mutex/native_handle.md b/reference/mutex/recursive_mutex/native_handle.md index 4bfeedcf08..81e9d7e25f 100644 --- a/reference/mutex/recursive_mutex/native_handle.md +++ b/reference/mutex/recursive_mutex/native_handle.md @@ -57,9 +57,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/mutex/recursive_mutex/op_constructor.md b/reference/mutex/recursive_mutex/op_constructor.md index ba473cd3c6..58ca27f8f8 100644 --- a/reference/mutex/recursive_mutex/op_constructor.md +++ b/reference/mutex/recursive_mutex/op_constructor.md @@ -49,9 +49,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012はコピーコンストラクタのdeleteに対応していないため、代わりにprivateで宣言のみ行う手法で代用されている。 diff --git a/reference/mutex/recursive_mutex/op_destructor.md b/reference/mutex/recursive_mutex/op_destructor.md index 50073829c8..73f11c610a 100644 --- a/reference/mutex/recursive_mutex/op_destructor.md +++ b/reference/mutex/recursive_mutex/op_destructor.md @@ -19,9 +19,9 @@ ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/mutex/recursive_mutex/try_lock.md b/reference/mutex/recursive_mutex/try_lock.md index 911fdfa44f..7544bc65a7 100644 --- a/reference/mutex/recursive_mutex/try_lock.md +++ b/reference/mutex/recursive_mutex/try_lock.md @@ -106,9 +106,9 @@ count == 2 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/mutex/recursive_mutex/unlock.md b/reference/mutex/recursive_mutex/unlock.md index 2cdf194090..1afaef1d9c 100644 --- a/reference/mutex/recursive_mutex/unlock.md +++ b/reference/mutex/recursive_mutex/unlock.md @@ -103,9 +103,9 @@ count == 2 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/mutex/recursive_timed_mutex.md b/reference/mutex/recursive_timed_mutex.md index d2681b85f5..44429ecb45 100644 --- a/reference/mutex/recursive_timed_mutex.md +++ b/reference/mutex/recursive_timed_mutex.md @@ -125,9 +125,9 @@ count == 2 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012, 2013は、(2)での実引数の受け渡しにムーブを使用しない問題がある。上記の例でも、`std::unique_ptr`の実引数でコンパイルエラーになる。 ## 参照 diff --git a/reference/mutex/recursive_timed_mutex/lock.md b/reference/mutex/recursive_timed_mutex/lock.md index ce6b4baf09..469fc15c78 100644 --- a/reference/mutex/recursive_timed_mutex/lock.md +++ b/reference/mutex/recursive_timed_mutex/lock.md @@ -97,9 +97,9 @@ count == 2 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/mutex/recursive_timed_mutex/native_handle.md b/reference/mutex/recursive_timed_mutex/native_handle.md index e73e430bfe..fd8b393407 100644 --- a/reference/mutex/recursive_timed_mutex/native_handle.md +++ b/reference/mutex/recursive_timed_mutex/native_handle.md @@ -58,9 +58,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/mutex/recursive_timed_mutex/op_constructor.md b/reference/mutex/recursive_timed_mutex/op_constructor.md index 784b19441b..803fc2a471 100644 --- a/reference/mutex/recursive_timed_mutex/op_constructor.md +++ b/reference/mutex/recursive_timed_mutex/op_constructor.md @@ -49,9 +49,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012はコピーコンストラクタのdeleteに対応していないため、代わりにprivateで宣言のみ行う手法で代用されている。 diff --git a/reference/mutex/recursive_timed_mutex/op_destructor.md b/reference/mutex/recursive_timed_mutex/op_destructor.md index f2f06a90dc..6ba2f78783 100644 --- a/reference/mutex/recursive_timed_mutex/op_destructor.md +++ b/reference/mutex/recursive_timed_mutex/op_destructor.md @@ -19,9 +19,9 @@ ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/mutex/recursive_timed_mutex/try_lock.md b/reference/mutex/recursive_timed_mutex/try_lock.md index 47fe79a5ac..0136e295b0 100644 --- a/reference/mutex/recursive_timed_mutex/try_lock.md +++ b/reference/mutex/recursive_timed_mutex/try_lock.md @@ -102,9 +102,9 @@ count == 2 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/mutex/recursive_timed_mutex/try_lock_for.md b/reference/mutex/recursive_timed_mutex/try_lock_for.md index a2ab20ee4f..ad3d4f360c 100644 --- a/reference/mutex/recursive_timed_mutex/try_lock_for.md +++ b/reference/mutex/recursive_timed_mutex/try_lock_for.md @@ -90,9 +90,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/mutex/recursive_timed_mutex/try_lock_until.md b/reference/mutex/recursive_timed_mutex/try_lock_until.md index 6d222075cc..3503cc1463 100644 --- a/reference/mutex/recursive_timed_mutex/try_lock_until.md +++ b/reference/mutex/recursive_timed_mutex/try_lock_until.md @@ -101,9 +101,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/mutex/recursive_timed_mutex/unlock.md b/reference/mutex/recursive_timed_mutex/unlock.md index a649857634..53914135e0 100644 --- a/reference/mutex/recursive_timed_mutex/unlock.md +++ b/reference/mutex/recursive_timed_mutex/unlock.md @@ -96,9 +96,9 @@ count == 2 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/mutex/scoped_lock.md b/reference/mutex/scoped_lock.md index 9dfcfdda19..e8a75a55a6 100644 --- a/reference/mutex/scoped_lock.md +++ b/reference/mutex/scoped_lock.md @@ -84,8 +84,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 5.0 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 5.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? ## 関連項目 diff --git a/reference/mutex/scoped_lock/op_constructor.md b/reference/mutex/scoped_lock/op_constructor.md index 9ca74c4cbd..386b88e8e2 100644 --- a/reference/mutex/scoped_lock/op_constructor.md +++ b/reference/mutex/scoped_lock/op_constructor.md @@ -73,6 +73,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 5.0 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 5.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/mutex/scoped_lock/op_destructor.md b/reference/mutex/scoped_lock/op_destructor.md index 3acf6aaaad..d459075334 100644 --- a/reference/mutex/scoped_lock/op_destructor.md +++ b/reference/mutex/scoped_lock/op_destructor.md @@ -22,6 +22,6 @@ - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 5.0 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 5.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/mutex/timed_mutex.md b/reference/mutex/timed_mutex.md index 2ec093a096..b33cf4e22d 100644 --- a/reference/mutex/timed_mutex.md +++ b/reference/mutex/timed_mutex.md @@ -107,9 +107,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 - [N2528: Timed_mutex in C++0x](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2528.html) diff --git a/reference/mutex/timed_mutex/lock.md b/reference/mutex/timed_mutex/lock.md index afba82b683..56722e6324 100644 --- a/reference/mutex/timed_mutex/lock.md +++ b/reference/mutex/timed_mutex/lock.md @@ -77,9 +77,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/mutex/timed_mutex/native_handle.md b/reference/mutex/timed_mutex/native_handle.md index 66790508a0..8abb7a5360 100644 --- a/reference/mutex/timed_mutex/native_handle.md +++ b/reference/mutex/timed_mutex/native_handle.md @@ -57,9 +57,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/mutex/timed_mutex/op_constructor.md b/reference/mutex/timed_mutex/op_constructor.md index 9d1b27f24f..6e944edd3a 100644 --- a/reference/mutex/timed_mutex/op_constructor.md +++ b/reference/mutex/timed_mutex/op_constructor.md @@ -45,9 +45,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012はコピーコンストラクタのdeleteに対応していないため、代わりにprivateで宣言のみ行う手法で代用されている。 diff --git a/reference/mutex/timed_mutex/op_destructor.md b/reference/mutex/timed_mutex/op_destructor.md index 7bab9b94ec..2eca8d07bf 100644 --- a/reference/mutex/timed_mutex/op_destructor.md +++ b/reference/mutex/timed_mutex/op_destructor.md @@ -19,9 +19,9 @@ ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/mutex/timed_mutex/try_lock.md b/reference/mutex/timed_mutex/try_lock.md index f188c26019..f572ba07a3 100644 --- a/reference/mutex/timed_mutex/try_lock.md +++ b/reference/mutex/timed_mutex/try_lock.md @@ -85,9 +85,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/mutex/timed_mutex/try_lock_for.md b/reference/mutex/timed_mutex/try_lock_for.md index 6e8cfe20d0..1180392846 100644 --- a/reference/mutex/timed_mutex/try_lock_for.md +++ b/reference/mutex/timed_mutex/try_lock_for.md @@ -94,9 +94,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/mutex/timed_mutex/try_lock_until.md b/reference/mutex/timed_mutex/try_lock_until.md index e346799440..b6d08cd6d0 100644 --- a/reference/mutex/timed_mutex/try_lock_until.md +++ b/reference/mutex/timed_mutex/try_lock_until.md @@ -105,9 +105,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/mutex/timed_mutex/unlock.md b/reference/mutex/timed_mutex/unlock.md index 1dfe0ab39f..fc278c4318 100644 --- a/reference/mutex/timed_mutex/unlock.md +++ b/reference/mutex/timed_mutex/unlock.md @@ -72,9 +72,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/mutex/try_lock.md b/reference/mutex/try_lock.md index c1053d2883..09155577fd 100644 --- a/reference/mutex/try_lock.md +++ b/reference/mutex/try_lock.md @@ -104,9 +104,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/mutex/try_to_lock.md b/reference/mutex/try_to_lock.md index bebb717a29..3f88e3e6ed 100644 --- a/reference/mutex/try_to_lock.md +++ b/reference/mutex/try_to_lock.md @@ -55,9 +55,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012, 2013は`constexpr`が実装されていないため、代わりに`try_to_lock`には`const`が修飾されている。 diff --git a/reference/mutex/unique_lock.md b/reference/mutex/unique_lock.md index daa7e4f47c..9573285bb9 100644 --- a/reference/mutex/unique_lock.md +++ b/reference/mutex/unique_lock.md @@ -131,9 +131,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 関連項目 diff --git a/reference/mutex/unique_lock/lock.md b/reference/mutex/unique_lock/lock.md index a685df3279..3530342208 100644 --- a/reference/mutex/unique_lock/lock.md +++ b/reference/mutex/unique_lock/lock.md @@ -82,9 +82,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012, 2013は、例外の節で説明している`system_error`を投げる処理が実装されていない。 diff --git a/reference/mutex/unique_lock/mutex.md b/reference/mutex/unique_lock/mutex.md index ed5a603cd3..176db7f6c9 100644 --- a/reference/mutex/unique_lock/mutex.md +++ b/reference/mutex/unique_lock/mutex.md @@ -57,9 +57,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/mutex/unique_lock/op_assign.md b/reference/mutex/unique_lock/op_assign.md index db319f422f..643391e6b8 100644 --- a/reference/mutex/unique_lock/op_assign.md +++ b/reference/mutex/unique_lock/op_assign.md @@ -58,9 +58,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/mutex/unique_lock/op_bool.md b/reference/mutex/unique_lock/op_bool.md index a7d739c3af..0e4b4f06bf 100644 --- a/reference/mutex/unique_lock/op_bool.md +++ b/reference/mutex/unique_lock/op_bool.md @@ -82,9 +82,9 @@ locked ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/mutex/unique_lock/op_constructor.md b/reference/mutex/unique_lock/op_constructor.md index 3719400c87..aff6cd4e47 100644 --- a/reference/mutex/unique_lock/op_constructor.md +++ b/reference/mutex/unique_lock/op_constructor.md @@ -137,9 +137,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012はコピーコンストラクタのdeleteに対応していないため、代わりにprivateで宣言のみ行う手法で代用されている。 ## 参照 diff --git a/reference/mutex/unique_lock/op_destructor.md b/reference/mutex/unique_lock/op_destructor.md index 8ac4f8583d..200586f169 100644 --- a/reference/mutex/unique_lock/op_destructor.md +++ b/reference/mutex/unique_lock/op_destructor.md @@ -30,9 +30,9 @@ if (owns_lock()) { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/mutex/unique_lock/owns_lock.md b/reference/mutex/unique_lock/owns_lock.md index 3a883bc7f9..40a9b80f02 100644 --- a/reference/mutex/unique_lock/owns_lock.md +++ b/reference/mutex/unique_lock/owns_lock.md @@ -64,9 +64,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/mutex/unique_lock/release.md b/reference/mutex/unique_lock/release.md index c0e4c7d09b..3d4a7c4490 100644 --- a/reference/mutex/unique_lock/release.md +++ b/reference/mutex/unique_lock/release.md @@ -82,9 +82,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/mutex/unique_lock/swap.md b/reference/mutex/unique_lock/swap.md index 3233ee36fa..5937aa10ac 100644 --- a/reference/mutex/unique_lock/swap.md +++ b/reference/mutex/unique_lock/swap.md @@ -54,9 +54,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/mutex/unique_lock/swap_free.md b/reference/mutex/unique_lock/swap_free.md index 64ba6b648e..21e620c439 100644 --- a/reference/mutex/unique_lock/swap_free.md +++ b/reference/mutex/unique_lock/swap_free.md @@ -59,9 +59,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/mutex/unique_lock/try_lock.md b/reference/mutex/unique_lock/try_lock.md index f20d5a5439..4290fa49b5 100644 --- a/reference/mutex/unique_lock/try_lock.md +++ b/reference/mutex/unique_lock/try_lock.md @@ -96,9 +96,9 @@ terminate called after throwing an instance of 'std::system_error' ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012, 2013は、例外の節で説明している`system_error`を投げる処理が実装されていない。 diff --git a/reference/mutex/unique_lock/try_lock_for.md b/reference/mutex/unique_lock/try_lock_for.md index 01db8a7d4d..0807669fe0 100644 --- a/reference/mutex/unique_lock/try_lock_for.md +++ b/reference/mutex/unique_lock/try_lock_for.md @@ -97,9 +97,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012, 2013は、例外の節で説明している`system_error`を投げる処理が実装されていない。 diff --git a/reference/mutex/unique_lock/try_lock_until.md b/reference/mutex/unique_lock/try_lock_until.md index 308a1ccc6e..f3df32e226 100644 --- a/reference/mutex/unique_lock/try_lock_until.md +++ b/reference/mutex/unique_lock/try_lock_until.md @@ -104,9 +104,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012, 2013は、例外の節で説明している`system_error`を投げる処理が実装されていない。 diff --git a/reference/mutex/unique_lock/unlock.md b/reference/mutex/unique_lock/unlock.md index f7d5514603..f3ca64b966 100644 --- a/reference/mutex/unique_lock/unlock.md +++ b/reference/mutex/unique_lock/unlock.md @@ -80,9 +80,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/new/align_val_t.md b/reference/new/align_val_t.md index 714d3e3378..1a6e91c452 100644 --- a/reference/new/align_val_t.md +++ b/reference/new/align_val_t.md @@ -19,8 +19,8 @@ C++17において、動的メモリ確保時のアライメント指定がサポ - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? ## 関連項目 diff --git a/reference/new/destroying_delete_t.md b/reference/new/destroying_delete_t.md index fdf24f428a..d54a80ca82 100644 --- a/reference/new/destroying_delete_t.md +++ b/reference/new/destroying_delete_t.md @@ -23,9 +23,9 @@ C++20にて追加された[*destroying operator delete*](/lang/cpp20/efficient_s - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 16 -- [GCC](/implementation.md#gcc): 9 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 7 +- [Clang](/implementation.md#clang): 16 [mark verified] +- [GCC](/implementation.md#gcc): 9 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 7 [mark verified] ## 関連項目 - [C++20 可変長データを扱うクラスの効率的な`delete`](/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md) diff --git a/reference/new/get_new_handler.md b/reference/new/get_new_handler.md index 55ae92cf44..e6121ffbe8 100644 --- a/reference/new/get_new_handler.md +++ b/reference/new/get_new_handler.md @@ -60,5 +60,5 @@ int main() - [Clang](/implementation.md#clang): - [GCC](/implementation.md#gcc): - [ICC](/implementation.md#icc): -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] diff --git a/reference/new/hardware_constructive_interference_size.md b/reference/new/hardware_constructive_interference_size.md index 4d4d0820af..f75d652bb9 100644 --- a/reference/new/hardware_constructive_interference_size.md +++ b/reference/new/hardware_constructive_interference_size.md @@ -56,7 +56,7 @@ hardware_constructive_interference_size : 64 ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 12.1 +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/new/hardware_destructive_interference_size.md b/reference/new/hardware_destructive_interference_size.md index 78ca67e869..645a59e5cc 100644 --- a/reference/new/hardware_destructive_interference_size.md +++ b/reference/new/hardware_destructive_interference_size.md @@ -115,7 +115,7 @@ hardware_destructive_interference_size : 64 ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 12.1 +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/new/launder.md b/reference/new/launder.md index e151a8d447..de85dcdfc4 100644 --- a/reference/new/launder.md +++ b/reference/new/launder.md @@ -136,10 +136,10 @@ void tong() { ### 処理系 -- [Clang](/implementation.md#clang): 6.0.0 -- [GCC](/implementation.md#gcc): 7.1.0 +- [Clang](/implementation.md#clang): 6.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2017 update 7 +- [Visual C++](/implementation.md#visual_cpp): 2017 update 7 [mark verified] ## 関連項目 diff --git a/reference/node_handle/node_handle.md b/reference/node_handle/node_handle.md index c2cd8cce43..0f3ba51b10 100644 --- a/reference/node_handle/node_handle.md +++ b/reference/node_handle/node_handle.md @@ -133,10 +133,10 @@ m2 : - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0.0 -- [GCC](/implementation.md#gcc): 7.1.0 +- [Clang](/implementation.md#clang): 7.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 [mark verified] ## 関連項目 diff --git a/reference/node_handle/node_handle/empty.md b/reference/node_handle/node_handle/empty.md index 080dedc716..a197c009ae 100644 --- a/reference/node_handle/node_handle/empty.md +++ b/reference/node_handle/node_handle/empty.md @@ -37,10 +37,10 @@ true - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0.0 -- [GCC](/implementation.md#gcc): 7.1.0 +- [Clang](/implementation.md#clang): 7.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 [mark verified] ## 参照 diff --git a/reference/node_handle/node_handle/get_allocator.md b/reference/node_handle/node_handle/get_allocator.md index 95f23a4e5f..d860f39f24 100644 --- a/reference/node_handle/node_handle/get_allocator.md +++ b/reference/node_handle/node_handle/get_allocator.md @@ -48,10 +48,10 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0.0 -- [GCC](/implementation.md#gcc): 7.1.0 +- [Clang](/implementation.md#clang): 7.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 [mark verified] ## 参照 diff --git a/reference/node_handle/node_handle/key.md b/reference/node_handle/node_handle/key.md index 7f01972bcd..8b46675c89 100644 --- a/reference/node_handle/node_handle/key.md +++ b/reference/node_handle/node_handle/key.md @@ -61,10 +61,10 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0.0 -- [GCC](/implementation.md#gcc): 7.1.0 +- [Clang](/implementation.md#clang): 7.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 [mark verified] ## 参照 diff --git a/reference/node_handle/node_handle/mapped.md b/reference/node_handle/node_handle/mapped.md index 207f497187..c5909723e2 100644 --- a/reference/node_handle/node_handle/mapped.md +++ b/reference/node_handle/node_handle/mapped.md @@ -56,10 +56,10 @@ nya - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0.0 -- [GCC](/implementation.md#gcc): 7.1.0 +- [Clang](/implementation.md#clang): 7.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 [mark verified] ## 参照 diff --git a/reference/node_handle/node_handle/op_assign.md b/reference/node_handle/node_handle/op_assign.md index 95040bf845..f72652e477 100644 --- a/reference/node_handle/node_handle/op_assign.md +++ b/reference/node_handle/node_handle/op_assign.md @@ -61,10 +61,10 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0.0 -- [GCC](/implementation.md#gcc): 7.1.0 +- [Clang](/implementation.md#clang): 7.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 [mark verified] ## 参照 diff --git a/reference/node_handle/node_handle/op_bool.md b/reference/node_handle/node_handle/op_bool.md index bec4712855..d5b3ef3e35 100644 --- a/reference/node_handle/node_handle/op_bool.md +++ b/reference/node_handle/node_handle/op_bool.md @@ -39,10 +39,10 @@ false - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0.0 -- [GCC](/implementation.md#gcc): 7.1.0 +- [Clang](/implementation.md#clang): 7.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 [mark verified] ## 参照 diff --git a/reference/node_handle/node_handle/op_constructor.md b/reference/node_handle/node_handle/op_constructor.md index 86daaffd7d..46562e8055 100644 --- a/reference/node_handle/node_handle/op_constructor.md +++ b/reference/node_handle/node_handle/op_constructor.md @@ -49,10 +49,10 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0.0 -- [GCC](/implementation.md#gcc): 7.1.0 +- [Clang](/implementation.md#clang): 7.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 [mark verified] ## 参照 diff --git a/reference/node_handle/node_handle/op_destructor.md b/reference/node_handle/node_handle/op_destructor.md index 0dfe5b0257..3c5632e36e 100644 --- a/reference/node_handle/node_handle/op_destructor.md +++ b/reference/node_handle/node_handle/op_destructor.md @@ -40,10 +40,10 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0.0 -- [GCC](/implementation.md#gcc): 7.1.0 +- [Clang](/implementation.md#clang): 7.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 [mark verified] ## 参照 diff --git a/reference/node_handle/node_handle/swap.md b/reference/node_handle/node_handle/swap.md index e243fb0c2a..c3f3741ac2 100644 --- a/reference/node_handle/node_handle/swap.md +++ b/reference/node_handle/node_handle/swap.md @@ -82,10 +82,10 @@ node2 : [10, a] - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0.0 -- [GCC](/implementation.md#gcc): 7.1.0 +- [Clang](/implementation.md#clang): 7.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 [mark verified] ## 関連項目 - [node_handle](/reference/node_handle/node_handle.md) diff --git a/reference/node_handle/node_handle/swap_free.md b/reference/node_handle/node_handle/swap_free.md index b5ed9a4d65..676ddfe2b6 100644 --- a/reference/node_handle/node_handle/swap_free.md +++ b/reference/node_handle/node_handle/swap_free.md @@ -70,10 +70,10 @@ node2 : [10, a] - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0.0 -- [GCC](/implementation.md#gcc): 7.1.0 +- [Clang](/implementation.md#clang): 7.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 [mark verified] ## 関連項目 - [node_handle](/reference/node_handle/node_handle.md) diff --git a/reference/node_handle/node_handle/value.md b/reference/node_handle/node_handle/value.md index e38f5c41e8..455d15d147 100644 --- a/reference/node_handle/node_handle/value.md +++ b/reference/node_handle/node_handle/value.md @@ -50,10 +50,10 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0.0 -- [GCC](/implementation.md#gcc): 7.1.0 +- [Clang](/implementation.md#clang): 7.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 [mark verified] ## 参照 diff --git a/reference/numbers/e.md b/reference/numbers/e.md index b5398523db..0bbb99ebaf 100644 --- a/reference/numbers/e.md +++ b/reference/numbers/e.md @@ -58,5 +58,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10.1 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/numbers/egamma.md b/reference/numbers/egamma.md index eee50656c1..ba67a7b84d 100644 --- a/reference/numbers/egamma.md +++ b/reference/numbers/egamma.md @@ -58,5 +58,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10.1 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/numbers/inv_pi.md b/reference/numbers/inv_pi.md index e6a75174e2..ef1db0bdef 100644 --- a/reference/numbers/inv_pi.md +++ b/reference/numbers/inv_pi.md @@ -64,5 +64,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10.1 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/numbers/inv_sqrt3.md b/reference/numbers/inv_sqrt3.md index 506fc2c9ea..f60f846ed5 100644 --- a/reference/numbers/inv_sqrt3.md +++ b/reference/numbers/inv_sqrt3.md @@ -89,7 +89,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10.1 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/numbers/inv_sqrtpi.md b/reference/numbers/inv_sqrtpi.md index 0d3e6f4fb7..376ac65a86 100644 --- a/reference/numbers/inv_sqrtpi.md +++ b/reference/numbers/inv_sqrtpi.md @@ -58,5 +58,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10.1 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/numbers/ln10.md b/reference/numbers/ln10.md index 36400c4acf..b24cde1dd5 100644 --- a/reference/numbers/ln10.md +++ b/reference/numbers/ln10.md @@ -65,5 +65,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10.1 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/numbers/ln2.md b/reference/numbers/ln2.md index d7d8a77e2c..cd484fb129 100644 --- a/reference/numbers/ln2.md +++ b/reference/numbers/ln2.md @@ -65,5 +65,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10.1 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/numbers/log10e.md b/reference/numbers/log10e.md index 0269f89dda..c94f4943bd 100644 --- a/reference/numbers/log10e.md +++ b/reference/numbers/log10e.md @@ -67,5 +67,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10.1 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/numbers/log2e.md b/reference/numbers/log2e.md index 6b225a932f..67ca91aacd 100644 --- a/reference/numbers/log2e.md +++ b/reference/numbers/log2e.md @@ -67,5 +67,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10.1 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/numbers/phi.md b/reference/numbers/phi.md index daa102b4f8..43d846b043 100644 --- a/reference/numbers/phi.md +++ b/reference/numbers/phi.md @@ -58,7 +58,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10.1 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/numbers/pi.md b/reference/numbers/pi.md index 240c6e118c..88911655a0 100644 --- a/reference/numbers/pi.md +++ b/reference/numbers/pi.md @@ -64,6 +64,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 11 -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 5 +- [Clang](/implementation.md#clang): 11 [mark verified] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 5 [mark verified] diff --git a/reference/numbers/sqrt2.md b/reference/numbers/sqrt2.md index 778b2b0de3..32b44749fb 100644 --- a/reference/numbers/sqrt2.md +++ b/reference/numbers/sqrt2.md @@ -65,5 +65,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10.1 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/numbers/sqrt3.md b/reference/numbers/sqrt3.md index 2e99f6c115..36046a152d 100644 --- a/reference/numbers/sqrt3.md +++ b/reference/numbers/sqrt3.md @@ -65,5 +65,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10.1 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/numeric/exclusive_scan.md b/reference/numeric/exclusive_scan.md index 85256a183e..e7e5c35ceb 100644 --- a/reference/numeric/exclusive_scan.md +++ b/reference/numeric/exclusive_scan.md @@ -176,7 +176,7 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 +- [Clang](/implementation.md#clang): 7.0 [mark verified] - [GCC](/implementation.md#gcc): - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/numeric/gcd.md b/reference/numeric/gcd.md index 88a5ace8d5..68ef4a17db 100644 --- a/reference/numeric/gcd.md +++ b/reference/numeric/gcd.md @@ -134,8 +134,8 @@ int main() { - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.0 -- [GCC](/implementation.md#gcc): 7.1.0 +- [Clang](/implementation.md#clang): 4.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/numeric/inclusive_scan.md b/reference/numeric/inclusive_scan.md index d495f4c105..cd8fdfbc56 100644 --- a/reference/numeric/inclusive_scan.md +++ b/reference/numeric/inclusive_scan.md @@ -223,7 +223,7 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 +- [Clang](/implementation.md#clang): 7.0 [mark verified] - [GCC](/implementation.md#gcc): - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/numeric/iota.md b/reference/numeric/iota.md index 7d285cecaf..6fbc8984d5 100644 --- a/reference/numeric/iota.md +++ b/reference/numeric/iota.md @@ -87,10 +87,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.5 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.5 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2008 +- [Visual C++](/implementation.md#visual_cpp): 2008 [mark verified] ## 実装例 diff --git a/reference/numeric/lcm.md b/reference/numeric/lcm.md index c49c3fd10b..fb9a9f5c13 100644 --- a/reference/numeric/lcm.md +++ b/reference/numeric/lcm.md @@ -139,8 +139,8 @@ int main() { - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.0 -- [GCC](/implementation.md#gcc): 7.1.0 +- [Clang](/implementation.md#clang): 4.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/numeric/midpoint.md b/reference/numeric/midpoint.md index bff0567e2d..a4501acce3 100644 --- a/reference/numeric/midpoint.md +++ b/reference/numeric/midpoint.md @@ -151,7 +151,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 9.1 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/numeric/reduce.md b/reference/numeric/reduce.md index f1f12920de..05b42ab005 100644 --- a/reference/numeric/reduce.md +++ b/reference/numeric/reduce.md @@ -154,7 +154,7 @@ product : 120 - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 5.0.0 +- [Clang](/implementation.md#clang): 5.0.0 [mark verified] - [GCC](/implementation.md#gcc): - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/numeric/transform_exclusive_scan.md b/reference/numeric/transform_exclusive_scan.md index ad3648667e..3fccea3818 100644 --- a/reference/numeric/transform_exclusive_scan.md +++ b/reference/numeric/transform_exclusive_scan.md @@ -130,7 +130,7 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 +- [Clang](/implementation.md#clang): 7.0 [mark verified] - [GCC](/implementation.md#gcc): - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/numeric/transform_inclusive_scan.md b/reference/numeric/transform_inclusive_scan.md index f60a499cc9..2c9c0767d6 100644 --- a/reference/numeric/transform_inclusive_scan.md +++ b/reference/numeric/transform_inclusive_scan.md @@ -189,7 +189,7 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 +- [Clang](/implementation.md#clang): 7.0 [mark verified] - [GCC](/implementation.md#gcc): - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/numeric/transform_reduce.md b/reference/numeric/transform_reduce.md index 2bb408cbf2..a0731dc3c4 100644 --- a/reference/numeric/transform_reduce.md +++ b/reference/numeric/transform_reduce.md @@ -193,7 +193,7 @@ sum3 : 30 - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 5.0.0 +- [Clang](/implementation.md#clang): 5.0.0 [mark verified] - [GCC](/implementation.md#gcc): - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/optional/bad_optional_access.md b/reference/optional/bad_optional_access.md index 894769d1e3..d58b0bd25c 100644 --- a/reference/optional/bad_optional_access.md +++ b/reference/optional/bad_optional_access.md @@ -53,8 +53,8 @@ exception : bad optional access - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.2 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/optional/make_optional.md b/reference/optional/make_optional.md index ed9cf25b70..86dd062aab 100644 --- a/reference/optional/make_optional.md +++ b/reference/optional/make_optional.md @@ -82,7 +82,7 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.2 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/optional/nullopt_t.md b/reference/optional/nullopt_t.md index 6d0d8a1e1c..ac544ad02b 100644 --- a/reference/optional/nullopt_t.md +++ b/reference/optional/nullopt_t.md @@ -48,8 +48,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.2 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/optional/optional.md b/reference/optional/optional.md index 72847dfc1b..868f5cb868 100644 --- a/reference/optional/optional.md +++ b/reference/optional/optional.md @@ -185,8 +185,8 @@ error - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.2 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/optional/optional/emplace.md b/reference/optional/optional/emplace.md index 35d5406d60..526f276e6a 100644 --- a/reference/optional/optional/emplace.md +++ b/reference/optional/optional/emplace.md @@ -103,8 +103,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.2 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/optional/optional/has_value.md b/reference/optional/optional/has_value.md index a6a085248b..ed239e5ef2 100644 --- a/reference/optional/optional/has_value.md +++ b/reference/optional/optional/has_value.md @@ -42,8 +42,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.2 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/optional/optional/op_arrow.md b/reference/optional/optional/op_arrow.md index 3f5fae1dd4..262f6c1870 100644 --- a/reference/optional/optional/op_arrow.md +++ b/reference/optional/optional/op_arrow.md @@ -58,8 +58,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.2 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/optional/optional/op_assign.md b/reference/optional/optional/op_assign.md index 68749dd030..e300b3e18c 100644 --- a/reference/optional/optional/op_assign.md +++ b/reference/optional/optional/op_assign.md @@ -171,8 +171,8 @@ int main() - C++17 ### 処理系 -- [GCC](/implementation.md#gcc): 7.2 -- [Clang](/implementation.md#clang): 4.0.1 +- [GCC](/implementation.md#gcc): 7.2 [mark verified] +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/optional/optional/op_bool.md b/reference/optional/optional/op_bool.md index 96efad48b7..af979712c3 100644 --- a/reference/optional/optional/op_bool.md +++ b/reference/optional/optional/op_bool.md @@ -49,8 +49,8 @@ p2 doesn't have value - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.2 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/optional/optional/op_compare_3way.md b/reference/optional/optional/op_compare_3way.md index 139816117f..0cd38a58ea 100644 --- a/reference/optional/optional/op_compare_3way.md +++ b/reference/optional/optional/op_compare_3way.md @@ -113,7 +113,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10 +- [GCC](/implementation.md#gcc): 10 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/optional/optional/op_constructor.md b/reference/optional/optional/op_constructor.md index f5e34ceda0..4d9a0d21a8 100644 --- a/reference/optional/optional/op_constructor.md +++ b/reference/optional/optional/op_constructor.md @@ -211,8 +211,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.2 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/optional/optional/op_deduction_guide.md b/reference/optional/optional/op_deduction_guide.md index 624a31540d..39f09a88d4 100644 --- a/reference/optional/optional/op_deduction_guide.md +++ b/reference/optional/optional/op_deduction_guide.md @@ -44,6 +44,6 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 7.2 +- [GCC](/implementation.md#gcc): 7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/optional/optional/op_deref.md b/reference/optional/optional/op_deref.md index cda323dc53..faa7134447 100644 --- a/reference/optional/optional/op_deref.md +++ b/reference/optional/optional/op_deref.md @@ -73,8 +73,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.2 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/optional/optional/op_destructor.md b/reference/optional/optional/op_destructor.md index 94c1610c10..f0df6a1652 100644 --- a/reference/optional/optional/op_destructor.md +++ b/reference/optional/optional/op_destructor.md @@ -62,8 +62,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.2 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/optional/optional/op_equal.md b/reference/optional/optional/op_equal.md index 416c31df28..b9079f2e26 100644 --- a/reference/optional/optional/op_equal.md +++ b/reference/optional/optional/op_equal.md @@ -104,8 +104,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.2 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/optional/optional/op_greater.md b/reference/optional/optional/op_greater.md index 07e39dea26..13bfe1ae2d 100644 --- a/reference/optional/optional/op_greater.md +++ b/reference/optional/optional/op_greater.md @@ -93,8 +93,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.2 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/optional/optional/op_greater_equal.md b/reference/optional/optional/op_greater_equal.md index d7ceff76b7..4b2d6504cd 100644 --- a/reference/optional/optional/op_greater_equal.md +++ b/reference/optional/optional/op_greater_equal.md @@ -93,8 +93,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.2 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/optional/optional/op_less.md b/reference/optional/optional/op_less.md index ff86c98eef..1c19fa5903 100644 --- a/reference/optional/optional/op_less.md +++ b/reference/optional/optional/op_less.md @@ -93,8 +93,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.2 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/optional/optional/op_less_equal.md b/reference/optional/optional/op_less_equal.md index d9af21a967..8cbe8e8712 100644 --- a/reference/optional/optional/op_less_equal.md +++ b/reference/optional/optional/op_less_equal.md @@ -93,8 +93,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.2 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/optional/optional/op_not_equal.md b/reference/optional/optional/op_not_equal.md index 3775884849..f70ff943d1 100644 --- a/reference/optional/optional/op_not_equal.md +++ b/reference/optional/optional/op_not_equal.md @@ -91,8 +91,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.2 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/optional/optional/reset.md b/reference/optional/optional/reset.md index 60017468d2..8672bc3c36 100644 --- a/reference/optional/optional/reset.md +++ b/reference/optional/optional/reset.md @@ -54,8 +54,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.2 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/optional/optional/swap.md b/reference/optional/optional/swap.md index fafdbb56e9..9f06cdc875 100644 --- a/reference/optional/optional/swap.md +++ b/reference/optional/optional/swap.md @@ -114,8 +114,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.2 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/optional/optional/swap_free.md b/reference/optional/optional/swap_free.md index e5d4506492..ec529679c0 100644 --- a/reference/optional/optional/swap_free.md +++ b/reference/optional/optional/swap_free.md @@ -104,8 +104,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.2 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/optional/optional/value.md b/reference/optional/optional/value.md index cc1a2c79f4..0a8841ecf1 100644 --- a/reference/optional/optional/value.md +++ b/reference/optional/optional/value.md @@ -66,8 +66,8 @@ p2 exception : bad optional access - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.2 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/optional/optional/value_or.md b/reference/optional/optional/value_or.md index 98a173e014..4ede16539c 100644 --- a/reference/optional/optional/value_or.md +++ b/reference/optional/optional/value_or.md @@ -62,8 +62,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.2 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ostream/basic_ostream/op_assign.md b/reference/ostream/basic_ostream/op_assign.md index 814d1aa37a..32ab5a19d2 100644 --- a/reference/ostream/basic_ostream/op_assign.md +++ b/reference/ostream/basic_ostream/op_assign.md @@ -41,8 +41,8 @@ protected: ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5.0, 3.6.0, 3.7.0, 3.8.0 -- [GCC](/implementation.md#gcc): 5.1.0, 5.2.0, 6.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5.0 [mark verified], 3.6.0 [mark verified], 3.7.0 [mark verified], 3.8.0 [mark verified] +- [GCC](/implementation.md#gcc): 5.1.0 [mark verified], 5.2.0 [mark verified], 6.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ostream/basic_ostream/op_constructor.md b/reference/ostream/basic_ostream/op_constructor.md index 0819f6eeb7..60f90ff130 100644 --- a/reference/ostream/basic_ostream/op_constructor.md +++ b/reference/ostream/basic_ostream/op_constructor.md @@ -40,8 +40,8 @@ protected: ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5.0, 3.6.0, 3.7.0, 3.8.0 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0, 4.9.1, 4.9.2, 5.1.0, 5.2.0, 6.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5.0 [mark verified], 3.6.0 [mark verified], 3.7.0 [mark verified], 3.8.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.1.0 [mark verified], 5.2.0 [mark verified], 6.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ostream/basic_ostream/op_destructor.md b/reference/ostream/basic_ostream/op_destructor.md index c86f1e259f..6df9a183a0 100644 --- a/reference/ostream/basic_ostream/op_destructor.md +++ b/reference/ostream/basic_ostream/op_destructor.md @@ -24,8 +24,8 @@ virtual ~basic_ostream(); ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5.0, 3.6.0, 3.7.0, 3.8.0 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.1, 4.8.2, 4.9.0, 4.9.1, 4.9.2, 5.1.0, 5.2.0, 6.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5.0 [mark verified], 3.6.0 [mark verified], 3.7.0 [mark verified], 3.8.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.1.0 [mark verified], 5.2.0 [mark verified], 6.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ostream/print.md b/reference/ostream/print.md index 580ef017df..6610e59ea7 100644 --- a/reference/ostream/print.md +++ b/reference/ostream/print.md @@ -112,10 +112,10 @@ Hello - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 19 -- [GCC](/implementation.md#gcc): 14 +- [Clang](/implementation.md#clang): 19 [mark verified] +- [GCC](/implementation.md#gcc): 14 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] ## 関連項目 diff --git a/reference/ostream/println.md b/reference/ostream/println.md index c118335275..f5fee4e20d 100644 --- a/reference/ostream/println.md +++ b/reference/ostream/println.md @@ -80,10 +80,10 @@ Hello - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 19 -- [GCC](/implementation.md#gcc): 14 +- [Clang](/implementation.md#clang): 19 [mark verified] +- [GCC](/implementation.md#gcc): 14 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] ## 関連項目 diff --git a/reference/ostream/vprint_nonunicode.md b/reference/ostream/vprint_nonunicode.md index 389bae1941..448d76a13f 100644 --- a/reference/ostream/vprint_nonunicode.md +++ b/reference/ostream/vprint_nonunicode.md @@ -41,10 +41,10 @@ namespace std { - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 19 -- [GCC](/implementation.md#gcc): 14 +- [Clang](/implementation.md#clang): 19 [mark verified] +- [GCC](/implementation.md#gcc): 14 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] ## 関連項目 diff --git a/reference/ostream/vprint_unicode.md b/reference/ostream/vprint_unicode.md index 28b93175b9..c1b4a8618f 100644 --- a/reference/ostream/vprint_unicode.md +++ b/reference/ostream/vprint_unicode.md @@ -53,10 +53,10 @@ namespace std { - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 19 -- [GCC](/implementation.md#gcc): 14 +- [Clang](/implementation.md#clang): 19 [mark verified] +- [GCC](/implementation.md#gcc): 14 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] ## 関連項目 diff --git a/reference/print/print.md b/reference/print/print.md index cd3b732f32..359159b75c 100644 --- a/reference/print/print.md +++ b/reference/print/print.md @@ -150,10 +150,10 @@ Hello - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 19 -- [GCC](/implementation.md#gcc): 14 +- [Clang](/implementation.md#clang): 19 [mark verified] +- [GCC](/implementation.md#gcc): 14 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] ## 関連項目 diff --git a/reference/print/println.md b/reference/print/println.md index c9b44ad26a..542fd0bf0f 100644 --- a/reference/print/println.md +++ b/reference/print/println.md @@ -118,10 +118,10 @@ Hello - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 19 -- [GCC](/implementation.md#gcc): 14 +- [Clang](/implementation.md#clang): 19 [mark verified] +- [GCC](/implementation.md#gcc): 14 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] ## 関連項目 diff --git a/reference/print/vprint_nonunicode.md b/reference/print/vprint_nonunicode.md index 2d86cb036a..bdeee9d6ba 100644 --- a/reference/print/vprint_nonunicode.md +++ b/reference/print/vprint_nonunicode.md @@ -51,10 +51,10 @@ namespace std { - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 19 -- [GCC](/implementation.md#gcc): 14 +- [Clang](/implementation.md#clang): 19 [mark verified] +- [GCC](/implementation.md#gcc): 14 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] ## 関連項目 diff --git a/reference/print/vprint_unicode.md b/reference/print/vprint_unicode.md index 54d6984d39..652f0d9c1a 100644 --- a/reference/print/vprint_unicode.md +++ b/reference/print/vprint_unicode.md @@ -66,10 +66,10 @@ namespace std { - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 19 -- [GCC](/implementation.md#gcc): 14 +- [Clang](/implementation.md#clang): 19 [mark verified] +- [GCC](/implementation.md#gcc): 14 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] ## 関連項目 diff --git a/reference/queue/priority_queue/emplace.md b/reference/queue/priority_queue/emplace.md index 3798767235..16a617f1cd 100644 --- a/reference/queue/priority_queue/emplace.md +++ b/reference/queue/priority_queue/emplace.md @@ -67,7 +67,7 @@ int main () ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/queue/priority_queue/op_constructor.md b/reference/queue/priority_queue/op_constructor.md index 78e2550c7b..0623ab810a 100644 --- a/reference/queue/priority_queue/op_constructor.md +++ b/reference/queue/priority_queue/op_constructor.md @@ -201,7 +201,7 @@ que5 : 5 4 3 2 1 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0(アロケータ付き初期化以外は使用可能) +- [GCC](/implementation.md#gcc): 4.7.0(アロケータ付き初期化以外は使用可能) [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/queue/priority_queue/push.md b/reference/queue/priority_queue/push.md index e3671282d4..b9191e89aa 100644 --- a/reference/queue/priority_queue/push.md +++ b/reference/queue/priority_queue/push.md @@ -70,7 +70,7 @@ int main() ### 右辺値参照バージョンの使用可能状況 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/queue/priority_queue/swap.md b/reference/queue/priority_queue/swap.md index 5284e2940d..f7a2e30fff 100644 --- a/reference/queue/priority_queue/swap.md +++ b/reference/queue/priority_queue/swap.md @@ -81,7 +81,7 @@ int main () ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/queue/priority_queue/swap_free.md b/reference/queue/priority_queue/swap_free.md index 547c319982..1bc31e0026 100644 --- a/reference/queue/priority_queue/swap_free.md +++ b/reference/queue/priority_queue/swap_free.md @@ -80,7 +80,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/queue/queue/emplace.md b/reference/queue/queue/emplace.md index 16f8224907..35e94b1b2d 100644 --- a/reference/queue/queue/emplace.md +++ b/reference/queue/queue/emplace.md @@ -76,7 +76,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/queue/queue/op_compare_3way.md b/reference/queue/queue/op_compare_3way.md index ff63e54a82..451160c784 100644 --- a/reference/queue/queue/op_compare_3way.md +++ b/reference/queue/queue/op_compare_3way.md @@ -55,7 +55,7 @@ int main () ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10 +- [GCC](/implementation.md#gcc): 10 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/queue/queue/swap.md b/reference/queue/queue/swap.md index e2084de047..f13775d98e 100644 --- a/reference/queue/queue/swap.md +++ b/reference/queue/queue/swap.md @@ -76,7 +76,7 @@ int main () ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/queue/queue/swap_free.md b/reference/queue/queue/swap_free.md index b08659d17c..01d5fcdd3b 100644 --- a/reference/queue/queue/swap_free.md +++ b/reference/queue/queue/swap_free.md @@ -78,7 +78,7 @@ int main () ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/random/bernoulli_distribution.md b/reference/random/bernoulli_distribution.md index f1acf3fdb4..127a27ec1b 100644 --- a/reference/random/bernoulli_distribution.md +++ b/reference/random/bernoulli_distribution.md @@ -110,7 +110,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/bernoulli_distribution/max.md b/reference/random/bernoulli_distribution/max.md index 1d15a6d395..acdb5f8ad7 100644 --- a/reference/random/bernoulli_distribution/max.md +++ b/reference/random/bernoulli_distribution/max.md @@ -43,7 +43,7 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/bernoulli_distribution/min.md b/reference/random/bernoulli_distribution/min.md index 20d679a5e8..b8508c9e93 100644 --- a/reference/random/bernoulli_distribution/min.md +++ b/reference/random/bernoulli_distribution/min.md @@ -43,7 +43,7 @@ false ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/bernoulli_distribution/op_call.md b/reference/random/bernoulli_distribution/op_call.md index 0d242810a6..9a19aaca66 100644 --- a/reference/random/bernoulli_distribution/op_call.md +++ b/reference/random/bernoulli_distribution/op_call.md @@ -87,7 +87,7 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/bernoulli_distribution/op_constructor.md b/reference/random/bernoulli_distribution/op_constructor.md index 5aec738761..f7e8673f19 100644 --- a/reference/random/bernoulli_distribution/op_constructor.md +++ b/reference/random/bernoulli_distribution/op_constructor.md @@ -96,7 +96,7 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/bernoulli_distribution/op_equal.md b/reference/random/bernoulli_distribution/op_equal.md index 12229ee901..5d6359cacd 100644 --- a/reference/random/bernoulli_distribution/op_equal.md +++ b/reference/random/bernoulli_distribution/op_equal.md @@ -54,7 +54,7 @@ equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/bernoulli_distribution/op_istream.md b/reference/random/bernoulli_distribution/op_istream.md index 36d40820ee..914bcee82d 100644 --- a/reference/random/bernoulli_distribution/op_istream.md +++ b/reference/random/bernoulli_distribution/op_istream.md @@ -73,7 +73,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/bernoulli_distribution/op_not_equal.md b/reference/random/bernoulli_distribution/op_not_equal.md index 93b5d91198..58da568ed0 100644 --- a/reference/random/bernoulli_distribution/op_not_equal.md +++ b/reference/random/bernoulli_distribution/op_not_equal.md @@ -54,7 +54,7 @@ not equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/bernoulli_distribution/op_ostream.md b/reference/random/bernoulli_distribution/op_ostream.md index fe634c14d0..34d8e7eb39 100644 --- a/reference/random/bernoulli_distribution/op_ostream.md +++ b/reference/random/bernoulli_distribution/op_ostream.md @@ -52,7 +52,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/bernoulli_distribution/p.md b/reference/random/bernoulli_distribution/p.md index 4895bf38e6..e3b51cb0bd 100644 --- a/reference/random/bernoulli_distribution/p.md +++ b/reference/random/bernoulli_distribution/p.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/bernoulli_distribution/param.md b/reference/random/bernoulli_distribution/param.md index db65d190d8..ed3c1bb1f2 100644 --- a/reference/random/bernoulli_distribution/param.md +++ b/reference/random/bernoulli_distribution/param.md @@ -51,7 +51,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/bernoulli_distribution/reset.md b/reference/random/bernoulli_distribution/reset.md index 64b42ff6ff..ffac2b245c 100644 --- a/reference/random/bernoulli_distribution/reset.md +++ b/reference/random/bernoulli_distribution/reset.md @@ -61,7 +61,7 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/binomial_distribution.md b/reference/random/binomial_distribution.md index 716eafc2a1..62571d00d8 100644 --- a/reference/random/binomial_distribution.md +++ b/reference/random/binomial_distribution.md @@ -105,7 +105,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/binomial_distribution/max.md b/reference/random/binomial_distribution/max.md index f201bd7932..e10ea018c8 100644 --- a/reference/random/binomial_distribution/max.md +++ b/reference/random/binomial_distribution/max.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/binomial_distribution/min.md b/reference/random/binomial_distribution/min.md index c3384a0b3e..19440aff8b 100644 --- a/reference/random/binomial_distribution/min.md +++ b/reference/random/binomial_distribution/min.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/binomial_distribution/op_call.md b/reference/random/binomial_distribution/op_call.md index 96871cdc94..00c3bb046d 100644 --- a/reference/random/binomial_distribution/op_call.md +++ b/reference/random/binomial_distribution/op_call.md @@ -75,7 +75,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/binomial_distribution/op_constructor.md b/reference/random/binomial_distribution/op_constructor.md index 8e3eed9430..c2fcf99dbd 100644 --- a/reference/random/binomial_distribution/op_constructor.md +++ b/reference/random/binomial_distribution/op_constructor.md @@ -74,7 +74,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/binomial_distribution/op_equal.md b/reference/random/binomial_distribution/op_equal.md index c61ffecd48..4488826185 100644 --- a/reference/random/binomial_distribution/op_equal.md +++ b/reference/random/binomial_distribution/op_equal.md @@ -55,7 +55,7 @@ equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/binomial_distribution/op_istream.md b/reference/random/binomial_distribution/op_istream.md index 607274a367..920f78cfba 100644 --- a/reference/random/binomial_distribution/op_istream.md +++ b/reference/random/binomial_distribution/op_istream.md @@ -73,7 +73,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/binomial_distribution/op_not_equal.md b/reference/random/binomial_distribution/op_not_equal.md index f91f3c091d..ae76a5ec85 100644 --- a/reference/random/binomial_distribution/op_not_equal.md +++ b/reference/random/binomial_distribution/op_not_equal.md @@ -55,7 +55,7 @@ not equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/binomial_distribution/op_ostream.md b/reference/random/binomial_distribution/op_ostream.md index 537d9f8361..d39e609af9 100644 --- a/reference/random/binomial_distribution/op_ostream.md +++ b/reference/random/binomial_distribution/op_ostream.md @@ -52,7 +52,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/binomial_distribution/p.md b/reference/random/binomial_distribution/p.md index 0488b00b8a..cd13b98679 100644 --- a/reference/random/binomial_distribution/p.md +++ b/reference/random/binomial_distribution/p.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/binomial_distribution/param.md b/reference/random/binomial_distribution/param.md index f3f054fefa..0c28832d4a 100644 --- a/reference/random/binomial_distribution/param.md +++ b/reference/random/binomial_distribution/param.md @@ -51,7 +51,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/binomial_distribution/reset.md b/reference/random/binomial_distribution/reset.md index fcc2f84a19..747ec78904 100644 --- a/reference/random/binomial_distribution/reset.md +++ b/reference/random/binomial_distribution/reset.md @@ -61,7 +61,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/binomial_distribution/t.md b/reference/random/binomial_distribution/t.md index e0844d086f..e4bf9c93ba 100644 --- a/reference/random/binomial_distribution/t.md +++ b/reference/random/binomial_distribution/t.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/cauchy_distribution.md b/reference/random/cauchy_distribution.md index 0060af5ea7..3ae8835265 100644 --- a/reference/random/cauchy_distribution.md +++ b/reference/random/cauchy_distribution.md @@ -117,7 +117,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/random/cauchy_distribution/a.md b/reference/random/cauchy_distribution/a.md index 594658dc88..b51b40b6fe 100644 --- a/reference/random/cauchy_distribution/a.md +++ b/reference/random/cauchy_distribution/a.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/cauchy_distribution/b.md b/reference/random/cauchy_distribution/b.md index 8da44f1698..362d4d0666 100644 --- a/reference/random/cauchy_distribution/b.md +++ b/reference/random/cauchy_distribution/b.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/cauchy_distribution/max.md b/reference/random/cauchy_distribution/max.md index 223d1ede73..d3e29d7ada 100644 --- a/reference/random/cauchy_distribution/max.md +++ b/reference/random/cauchy_distribution/max.md @@ -42,8 +42,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.7.2 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/cauchy_distribution/min.md b/reference/random/cauchy_distribution/min.md index 15c8eaeb5c..00580c46c1 100644 --- a/reference/random/cauchy_distribution/min.md +++ b/reference/random/cauchy_distribution/min.md @@ -42,7 +42,7 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [GCC](/implementation.md#gcc): - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/cauchy_distribution/op_call.md b/reference/random/cauchy_distribution/op_call.md index 0b22bab564..9a4d080675 100644 --- a/reference/random/cauchy_distribution/op_call.md +++ b/reference/random/cauchy_distribution/op_call.md @@ -84,7 +84,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/cauchy_distribution/op_constructor.md b/reference/random/cauchy_distribution/op_constructor.md index 6012670db4..92deedd227 100644 --- a/reference/random/cauchy_distribution/op_constructor.md +++ b/reference/random/cauchy_distribution/op_constructor.md @@ -96,7 +96,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/cauchy_distribution/op_equal.md b/reference/random/cauchy_distribution/op_equal.md index 5c7c8b1120..71c1f3333f 100644 --- a/reference/random/cauchy_distribution/op_equal.md +++ b/reference/random/cauchy_distribution/op_equal.md @@ -55,7 +55,7 @@ equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/cauchy_distribution/op_istream.md b/reference/random/cauchy_distribution/op_istream.md index 13cd70ca75..581be55b09 100644 --- a/reference/random/cauchy_distribution/op_istream.md +++ b/reference/random/cauchy_distribution/op_istream.md @@ -73,7 +73,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/cauchy_distribution/op_not_equal.md b/reference/random/cauchy_distribution/op_not_equal.md index 98543bf353..47f2ffe50e 100644 --- a/reference/random/cauchy_distribution/op_not_equal.md +++ b/reference/random/cauchy_distribution/op_not_equal.md @@ -55,7 +55,7 @@ not equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/cauchy_distribution/op_ostream.md b/reference/random/cauchy_distribution/op_ostream.md index 16e8cfd50c..0a851d2750 100644 --- a/reference/random/cauchy_distribution/op_ostream.md +++ b/reference/random/cauchy_distribution/op_ostream.md @@ -52,7 +52,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/cauchy_distribution/param.md b/reference/random/cauchy_distribution/param.md index 064c92771b..687345e4fb 100644 --- a/reference/random/cauchy_distribution/param.md +++ b/reference/random/cauchy_distribution/param.md @@ -51,7 +51,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/cauchy_distribution/reset.md b/reference/random/cauchy_distribution/reset.md index cbf6b391cc..b9a3068e57 100644 --- a/reference/random/cauchy_distribution/reset.md +++ b/reference/random/cauchy_distribution/reset.md @@ -61,7 +61,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/chi_squared_distribution.md b/reference/random/chi_squared_distribution.md index e631765bf6..1dd4952cf2 100644 --- a/reference/random/chi_squared_distribution.md +++ b/reference/random/chi_squared_distribution.md @@ -118,7 +118,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/random/chi_squared_distribution/max.md b/reference/random/chi_squared_distribution/max.md index 96995eee61..d8200484f7 100644 --- a/reference/random/chi_squared_distribution/max.md +++ b/reference/random/chi_squared_distribution/max.md @@ -42,8 +42,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.7.2 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/chi_squared_distribution/min.md b/reference/random/chi_squared_distribution/min.md index 341999bd3d..82408af789 100644 --- a/reference/random/chi_squared_distribution/min.md +++ b/reference/random/chi_squared_distribution/min.md @@ -42,7 +42,7 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [GCC](/implementation.md#gcc): - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/chi_squared_distribution/n.md b/reference/random/chi_squared_distribution/n.md index e0febfc5ac..bdb360846a 100644 --- a/reference/random/chi_squared_distribution/n.md +++ b/reference/random/chi_squared_distribution/n.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/chi_squared_distribution/op_call.md b/reference/random/chi_squared_distribution/op_call.md index 005921e693..ba3520ca8b 100644 --- a/reference/random/chi_squared_distribution/op_call.md +++ b/reference/random/chi_squared_distribution/op_call.md @@ -84,7 +84,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/chi_squared_distribution/op_constructor.md b/reference/random/chi_squared_distribution/op_constructor.md index c17ce7bddd..f6b9664fb2 100644 --- a/reference/random/chi_squared_distribution/op_constructor.md +++ b/reference/random/chi_squared_distribution/op_constructor.md @@ -95,7 +95,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/chi_squared_distribution/op_equal.md b/reference/random/chi_squared_distribution/op_equal.md index 29e6352f1c..3919320ee9 100644 --- a/reference/random/chi_squared_distribution/op_equal.md +++ b/reference/random/chi_squared_distribution/op_equal.md @@ -55,7 +55,7 @@ equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/chi_squared_distribution/op_istream.md b/reference/random/chi_squared_distribution/op_istream.md index 4c465091af..0804e9a21f 100644 --- a/reference/random/chi_squared_distribution/op_istream.md +++ b/reference/random/chi_squared_distribution/op_istream.md @@ -73,7 +73,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/chi_squared_distribution/op_not_equal.md b/reference/random/chi_squared_distribution/op_not_equal.md index e86eb6041c..6ca5f9d6e7 100644 --- a/reference/random/chi_squared_distribution/op_not_equal.md +++ b/reference/random/chi_squared_distribution/op_not_equal.md @@ -55,7 +55,7 @@ not equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/chi_squared_distribution/op_ostream.md b/reference/random/chi_squared_distribution/op_ostream.md index 72cbd05d2e..8f74c030df 100644 --- a/reference/random/chi_squared_distribution/op_ostream.md +++ b/reference/random/chi_squared_distribution/op_ostream.md @@ -52,7 +52,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/chi_squared_distribution/param.md b/reference/random/chi_squared_distribution/param.md index 1ffd6fa137..20814f1845 100644 --- a/reference/random/chi_squared_distribution/param.md +++ b/reference/random/chi_squared_distribution/param.md @@ -51,7 +51,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/chi_squared_distribution/reset.md b/reference/random/chi_squared_distribution/reset.md index 290b7204f7..95d29e5098 100644 --- a/reference/random/chi_squared_distribution/reset.md +++ b/reference/random/chi_squared_distribution/reset.md @@ -61,7 +61,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/discard_block_engine.md b/reference/random/discard_block_engine.md index 422614b464..f202a336eb 100644 --- a/reference/random/discard_block_engine.md +++ b/reference/random/discard_block_engine.md @@ -154,7 +154,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/random/discard_block_engine/base.md b/reference/random/discard_block_engine/base.md index 4806083362..be34f1623a 100644 --- a/reference/random/discard_block_engine/base.md +++ b/reference/random/discard_block_engine/base.md @@ -44,7 +44,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/discard_block_engine/discard.md b/reference/random/discard_block_engine/discard.md index 84880ddeeb..a4731a32ef 100644 --- a/reference/random/discard_block_engine/discard.md +++ b/reference/random/discard_block_engine/discard.md @@ -71,7 +71,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/discard_block_engine/max.md b/reference/random/discard_block_engine/max.md index ef9e58b5b3..238737c4f3 100644 --- a/reference/random/discard_block_engine/max.md +++ b/reference/random/discard_block_engine/max.md @@ -47,7 +47,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/discard_block_engine/min.md b/reference/random/discard_block_engine/min.md index f35dd0407b..a772cdf566 100644 --- a/reference/random/discard_block_engine/min.md +++ b/reference/random/discard_block_engine/min.md @@ -47,7 +47,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/discard_block_engine/op_call.md b/reference/random/discard_block_engine/op_call.md index 726eddecfb..ca660608ff 100644 --- a/reference/random/discard_block_engine/op_call.md +++ b/reference/random/discard_block_engine/op_call.md @@ -67,7 +67,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/discard_block_engine/op_constructor.md b/reference/random/discard_block_engine/op_constructor.md index ca5c1a398e..6709715cc8 100644 --- a/reference/random/discard_block_engine/op_constructor.md +++ b/reference/random/discard_block_engine/op_constructor.md @@ -113,7 +113,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/discard_block_engine/op_equal.md b/reference/random/discard_block_engine/op_equal.md index 40abc1ac73..ba06938a3f 100644 --- a/reference/random/discard_block_engine/op_equal.md +++ b/reference/random/discard_block_engine/op_equal.md @@ -56,7 +56,7 @@ equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/discard_block_engine/op_istream.md b/reference/random/discard_block_engine/op_istream.md index 8936b30c14..dd59a61d6d 100644 --- a/reference/random/discard_block_engine/op_istream.md +++ b/reference/random/discard_block_engine/op_istream.md @@ -76,7 +76,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/discard_block_engine/op_not_equal.md b/reference/random/discard_block_engine/op_not_equal.md index 223a0a977f..e2c679d066 100644 --- a/reference/random/discard_block_engine/op_not_equal.md +++ b/reference/random/discard_block_engine/op_not_equal.md @@ -58,7 +58,7 @@ not equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/discard_block_engine/op_ostream.md b/reference/random/discard_block_engine/op_ostream.md index 6a445ba42d..f15da3c84c 100644 --- a/reference/random/discard_block_engine/op_ostream.md +++ b/reference/random/discard_block_engine/op_ostream.md @@ -55,7 +55,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/discard_block_engine/seed.md b/reference/random/discard_block_engine/seed.md index 5bb5720fe5..8a059d374f 100644 --- a/reference/random/discard_block_engine/seed.md +++ b/reference/random/discard_block_engine/seed.md @@ -107,7 +107,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/discrete_distribution.md b/reference/random/discrete_distribution.md index 11a9e6e4d2..aae3510448 100644 --- a/reference/random/discrete_distribution.md +++ b/reference/random/discrete_distribution.md @@ -126,7 +126,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 4.5.3 +- [GCC](/implementation.md#gcc): 4.5.3 [mark verified] - [ICC](/implementation.md#icc): - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/random/discrete_distribution/max.md b/reference/random/discrete_distribution/max.md index faeeb8d488..3ecc8e4aed 100644 --- a/reference/random/discrete_distribution/max.md +++ b/reference/random/discrete_distribution/max.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/discrete_distribution/min.md b/reference/random/discrete_distribution/min.md index 75c65e389b..87c3969c85 100644 --- a/reference/random/discrete_distribution/min.md +++ b/reference/random/discrete_distribution/min.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/discrete_distribution/op_call.md b/reference/random/discrete_distribution/op_call.md index 0ff470418c..745d03593c 100644 --- a/reference/random/discrete_distribution/op_call.md +++ b/reference/random/discrete_distribution/op_call.md @@ -89,7 +89,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/discrete_distribution/op_constructor.md b/reference/random/discrete_distribution/op_constructor.md index 3f9043c83e..e7e5b9531a 100644 --- a/reference/random/discrete_distribution/op_constructor.md +++ b/reference/random/discrete_distribution/op_constructor.md @@ -135,7 +135,7 @@ parameter constructor : 2 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/discrete_distribution/op_equal.md b/reference/random/discrete_distribution/op_equal.md index a9882b7715..766d41a1bb 100644 --- a/reference/random/discrete_distribution/op_equal.md +++ b/reference/random/discrete_distribution/op_equal.md @@ -55,7 +55,7 @@ equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/discrete_distribution/op_istream.md b/reference/random/discrete_distribution/op_istream.md index 9a49598778..2ddd28f9dd 100644 --- a/reference/random/discrete_distribution/op_istream.md +++ b/reference/random/discrete_distribution/op_istream.md @@ -73,7 +73,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/discrete_distribution/op_not_equal.md b/reference/random/discrete_distribution/op_not_equal.md index 1baf066527..852718b3e8 100644 --- a/reference/random/discrete_distribution/op_not_equal.md +++ b/reference/random/discrete_distribution/op_not_equal.md @@ -55,7 +55,7 @@ not equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/discrete_distribution/op_ostream.md b/reference/random/discrete_distribution/op_ostream.md index 0509b565b8..07f3aaa8ff 100644 --- a/reference/random/discrete_distribution/op_ostream.md +++ b/reference/random/discrete_distribution/op_ostream.md @@ -52,7 +52,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/discrete_distribution/param.md b/reference/random/discrete_distribution/param.md index 8b63d7cd2d..f1aa642d01 100644 --- a/reference/random/discrete_distribution/param.md +++ b/reference/random/discrete_distribution/param.md @@ -51,7 +51,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/discrete_distribution/probabilities.md b/reference/random/discrete_distribution/probabilities.md index 0e4ad3bd9e..82721a0646 100644 --- a/reference/random/discrete_distribution/probabilities.md +++ b/reference/random/discrete_distribution/probabilities.md @@ -49,7 +49,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/discrete_distribution/reset.md b/reference/random/discrete_distribution/reset.md index 9920f100aa..343b8ec09b 100644 --- a/reference/random/discrete_distribution/reset.md +++ b/reference/random/discrete_distribution/reset.md @@ -59,7 +59,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/exponential_distribution.md b/reference/random/exponential_distribution.md index 6d46ff1ff2..1bec2268ca 100644 --- a/reference/random/exponential_distribution.md +++ b/reference/random/exponential_distribution.md @@ -116,7 +116,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/random/exponential_distribution/lambda.md b/reference/random/exponential_distribution/lambda.md index dfb887a86a..cff3e4234a 100644 --- a/reference/random/exponential_distribution/lambda.md +++ b/reference/random/exponential_distribution/lambda.md @@ -42,8 +42,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.7.2 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/exponential_distribution/max.md b/reference/random/exponential_distribution/max.md index 9b558502d9..2a1ef5416f 100644 --- a/reference/random/exponential_distribution/max.md +++ b/reference/random/exponential_distribution/max.md @@ -42,8 +42,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.7.2 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/exponential_distribution/min.md b/reference/random/exponential_distribution/min.md index 985a9e5158..00ece21ce9 100644 --- a/reference/random/exponential_distribution/min.md +++ b/reference/random/exponential_distribution/min.md @@ -42,8 +42,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.7.2 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/exponential_distribution/op_call.md b/reference/random/exponential_distribution/op_call.md index fb156d4e93..2db55d534a 100644 --- a/reference/random/exponential_distribution/op_call.md +++ b/reference/random/exponential_distribution/op_call.md @@ -84,7 +84,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/exponential_distribution/op_constructor.md b/reference/random/exponential_distribution/op_constructor.md index 54272a6382..9c8745954c 100644 --- a/reference/random/exponential_distribution/op_constructor.md +++ b/reference/random/exponential_distribution/op_constructor.md @@ -73,7 +73,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/exponential_distribution/op_equal.md b/reference/random/exponential_distribution/op_equal.md index 35697a0a12..67899eb921 100644 --- a/reference/random/exponential_distribution/op_equal.md +++ b/reference/random/exponential_distribution/op_equal.md @@ -55,7 +55,7 @@ equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/exponential_distribution/op_istream.md b/reference/random/exponential_distribution/op_istream.md index 41a2e64fa2..36cf601bba 100644 --- a/reference/random/exponential_distribution/op_istream.md +++ b/reference/random/exponential_distribution/op_istream.md @@ -73,7 +73,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/exponential_distribution/op_not_equal.md b/reference/random/exponential_distribution/op_not_equal.md index 08c13e27b9..a02b57ea0d 100644 --- a/reference/random/exponential_distribution/op_not_equal.md +++ b/reference/random/exponential_distribution/op_not_equal.md @@ -55,7 +55,7 @@ not equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/exponential_distribution/op_ostream.md b/reference/random/exponential_distribution/op_ostream.md index 411cfba0ab..7e517d24c7 100644 --- a/reference/random/exponential_distribution/op_ostream.md +++ b/reference/random/exponential_distribution/op_ostream.md @@ -52,7 +52,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/exponential_distribution/param.md b/reference/random/exponential_distribution/param.md index 3d0f2ca2df..9e8c1a98c1 100644 --- a/reference/random/exponential_distribution/param.md +++ b/reference/random/exponential_distribution/param.md @@ -51,7 +51,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/exponential_distribution/reset.md b/reference/random/exponential_distribution/reset.md index cf7de65cac..21ec39a9dc 100644 --- a/reference/random/exponential_distribution/reset.md +++ b/reference/random/exponential_distribution/reset.md @@ -61,7 +61,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/extreme_value_distribution.md b/reference/random/extreme_value_distribution.md index 1ec73ffec4..a1bbe23d7b 100644 --- a/reference/random/extreme_value_distribution.md +++ b/reference/random/extreme_value_distribution.md @@ -119,7 +119,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/random/extreme_value_distribution/a.md b/reference/random/extreme_value_distribution/a.md index 7a102c05e8..3939199c22 100644 --- a/reference/random/extreme_value_distribution/a.md +++ b/reference/random/extreme_value_distribution/a.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/extreme_value_distribution/b.md b/reference/random/extreme_value_distribution/b.md index e19bd177ca..5d8ccceb34 100644 --- a/reference/random/extreme_value_distribution/b.md +++ b/reference/random/extreme_value_distribution/b.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/extreme_value_distribution/max.md b/reference/random/extreme_value_distribution/max.md index d36bf9945d..19aad6fb1b 100644 --- a/reference/random/extreme_value_distribution/max.md +++ b/reference/random/extreme_value_distribution/max.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/extreme_value_distribution/min.md b/reference/random/extreme_value_distribution/min.md index dd7b2b4e84..b1d659adbc 100644 --- a/reference/random/extreme_value_distribution/min.md +++ b/reference/random/extreme_value_distribution/min.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/extreme_value_distribution/op_call.md b/reference/random/extreme_value_distribution/op_call.md index b611d56a7b..d5fbcbfc36 100644 --- a/reference/random/extreme_value_distribution/op_call.md +++ b/reference/random/extreme_value_distribution/op_call.md @@ -84,7 +84,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/extreme_value_distribution/op_constructor.md b/reference/random/extreme_value_distribution/op_constructor.md index e89d92fca9..8d31c0c2aa 100644 --- a/reference/random/extreme_value_distribution/op_constructor.md +++ b/reference/random/extreme_value_distribution/op_constructor.md @@ -94,7 +94,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/extreme_value_distribution/op_equal.md b/reference/random/extreme_value_distribution/op_equal.md index 6dd59ff002..ca59ba6036 100644 --- a/reference/random/extreme_value_distribution/op_equal.md +++ b/reference/random/extreme_value_distribution/op_equal.md @@ -55,7 +55,7 @@ equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/extreme_value_distribution/op_istream.md b/reference/random/extreme_value_distribution/op_istream.md index 7865c33880..de3684172e 100644 --- a/reference/random/extreme_value_distribution/op_istream.md +++ b/reference/random/extreme_value_distribution/op_istream.md @@ -73,7 +73,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/extreme_value_distribution/op_not_equal.md b/reference/random/extreme_value_distribution/op_not_equal.md index 8b66d0d6c0..12325571b5 100644 --- a/reference/random/extreme_value_distribution/op_not_equal.md +++ b/reference/random/extreme_value_distribution/op_not_equal.md @@ -55,7 +55,7 @@ not equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/extreme_value_distribution/op_ostream.md b/reference/random/extreme_value_distribution/op_ostream.md index d44a448d62..b6f192003f 100644 --- a/reference/random/extreme_value_distribution/op_ostream.md +++ b/reference/random/extreme_value_distribution/op_ostream.md @@ -52,7 +52,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/extreme_value_distribution/param.md b/reference/random/extreme_value_distribution/param.md index cd05762e41..0688b3467c 100644 --- a/reference/random/extreme_value_distribution/param.md +++ b/reference/random/extreme_value_distribution/param.md @@ -51,7 +51,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/extreme_value_distribution/reset.md b/reference/random/extreme_value_distribution/reset.md index 98f0a8871b..6336a6c003 100644 --- a/reference/random/extreme_value_distribution/reset.md +++ b/reference/random/extreme_value_distribution/reset.md @@ -61,7 +61,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/fisher_f_distribution.md b/reference/random/fisher_f_distribution.md index fdb7a51973..fe65c52618 100644 --- a/reference/random/fisher_f_distribution.md +++ b/reference/random/fisher_f_distribution.md @@ -112,7 +112,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/random/fisher_f_distribution/m.md b/reference/random/fisher_f_distribution/m.md index f60eac72a9..b8b482fe69 100644 --- a/reference/random/fisher_f_distribution/m.md +++ b/reference/random/fisher_f_distribution/m.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/fisher_f_distribution/max.md b/reference/random/fisher_f_distribution/max.md index 91d1afaa0e..91524b02c4 100644 --- a/reference/random/fisher_f_distribution/max.md +++ b/reference/random/fisher_f_distribution/max.md @@ -42,8 +42,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.7.2 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/fisher_f_distribution/min.md b/reference/random/fisher_f_distribution/min.md index 85d159616a..81263d10ea 100644 --- a/reference/random/fisher_f_distribution/min.md +++ b/reference/random/fisher_f_distribution/min.md @@ -42,7 +42,7 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [GCC](/implementation.md#gcc): - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/fisher_f_distribution/n.md b/reference/random/fisher_f_distribution/n.md index d258fcf1e8..815ca72a47 100644 --- a/reference/random/fisher_f_distribution/n.md +++ b/reference/random/fisher_f_distribution/n.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/fisher_f_distribution/op_call.md b/reference/random/fisher_f_distribution/op_call.md index 822e11887a..13f62b1ad6 100644 --- a/reference/random/fisher_f_distribution/op_call.md +++ b/reference/random/fisher_f_distribution/op_call.md @@ -84,7 +84,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/fisher_f_distribution/op_constructor.md b/reference/random/fisher_f_distribution/op_constructor.md index acd0a7a23b..c6b93b75ad 100644 --- a/reference/random/fisher_f_distribution/op_constructor.md +++ b/reference/random/fisher_f_distribution/op_constructor.md @@ -96,7 +96,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/fisher_f_distribution/op_equal.md b/reference/random/fisher_f_distribution/op_equal.md index 3730e1d9d2..a529d5e43f 100644 --- a/reference/random/fisher_f_distribution/op_equal.md +++ b/reference/random/fisher_f_distribution/op_equal.md @@ -55,7 +55,7 @@ equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/fisher_f_distribution/op_istream.md b/reference/random/fisher_f_distribution/op_istream.md index df5d15d1ac..de311e8881 100644 --- a/reference/random/fisher_f_distribution/op_istream.md +++ b/reference/random/fisher_f_distribution/op_istream.md @@ -73,7 +73,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/fisher_f_distribution/op_not_equal.md b/reference/random/fisher_f_distribution/op_not_equal.md index 5219ddbf36..aa9711cdc3 100644 --- a/reference/random/fisher_f_distribution/op_not_equal.md +++ b/reference/random/fisher_f_distribution/op_not_equal.md @@ -55,7 +55,7 @@ not equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/fisher_f_distribution/op_ostream.md b/reference/random/fisher_f_distribution/op_ostream.md index bc85eee304..fb7c23c1b7 100644 --- a/reference/random/fisher_f_distribution/op_ostream.md +++ b/reference/random/fisher_f_distribution/op_ostream.md @@ -52,7 +52,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/fisher_f_distribution/param.md b/reference/random/fisher_f_distribution/param.md index 97e110e38b..7b44b207cc 100644 --- a/reference/random/fisher_f_distribution/param.md +++ b/reference/random/fisher_f_distribution/param.md @@ -51,7 +51,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/fisher_f_distribution/reset.md b/reference/random/fisher_f_distribution/reset.md index 0f3b3bafc1..0060b3b390 100644 --- a/reference/random/fisher_f_distribution/reset.md +++ b/reference/random/fisher_f_distribution/reset.md @@ -61,7 +61,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/gamma_distribution.md b/reference/random/gamma_distribution.md index 1a052467f1..89f0e08c1c 100644 --- a/reference/random/gamma_distribution.md +++ b/reference/random/gamma_distribution.md @@ -118,7 +118,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/random/gamma_distribution/alpha.md b/reference/random/gamma_distribution/alpha.md index a42dca8087..ff4d124760 100644 --- a/reference/random/gamma_distribution/alpha.md +++ b/reference/random/gamma_distribution/alpha.md @@ -42,8 +42,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.7.2 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/gamma_distribution/beta.md b/reference/random/gamma_distribution/beta.md index bc6e830219..2db64bb55d 100644 --- a/reference/random/gamma_distribution/beta.md +++ b/reference/random/gamma_distribution/beta.md @@ -42,8 +42,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.7.2 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/gamma_distribution/max.md b/reference/random/gamma_distribution/max.md index 5c5e83b2ff..85f14e1f51 100644 --- a/reference/random/gamma_distribution/max.md +++ b/reference/random/gamma_distribution/max.md @@ -42,8 +42,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.7.2 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/gamma_distribution/min.md b/reference/random/gamma_distribution/min.md index f2397a3b0b..faeaece8d1 100644 --- a/reference/random/gamma_distribution/min.md +++ b/reference/random/gamma_distribution/min.md @@ -42,8 +42,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.7.2 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/gamma_distribution/op_call.md b/reference/random/gamma_distribution/op_call.md index dfcbabeeb5..2584cc71bd 100644 --- a/reference/random/gamma_distribution/op_call.md +++ b/reference/random/gamma_distribution/op_call.md @@ -84,7 +84,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/gamma_distribution/op_constructor.md b/reference/random/gamma_distribution/op_constructor.md index 8df6dc1055..70ea1c2aa1 100644 --- a/reference/random/gamma_distribution/op_constructor.md +++ b/reference/random/gamma_distribution/op_constructor.md @@ -75,7 +75,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/gamma_distribution/op_equal.md b/reference/random/gamma_distribution/op_equal.md index 8f3c4a6a81..e53949b678 100644 --- a/reference/random/gamma_distribution/op_equal.md +++ b/reference/random/gamma_distribution/op_equal.md @@ -55,7 +55,7 @@ equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/gamma_distribution/op_istream.md b/reference/random/gamma_distribution/op_istream.md index df99de1013..018bbd53d0 100644 --- a/reference/random/gamma_distribution/op_istream.md +++ b/reference/random/gamma_distribution/op_istream.md @@ -73,7 +73,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/gamma_distribution/op_not_equal.md b/reference/random/gamma_distribution/op_not_equal.md index 15b50cd584..eab9b304b4 100644 --- a/reference/random/gamma_distribution/op_not_equal.md +++ b/reference/random/gamma_distribution/op_not_equal.md @@ -55,7 +55,7 @@ not equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/gamma_distribution/op_ostream.md b/reference/random/gamma_distribution/op_ostream.md index 147760a9f3..bba51b012a 100644 --- a/reference/random/gamma_distribution/op_ostream.md +++ b/reference/random/gamma_distribution/op_ostream.md @@ -52,7 +52,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/gamma_distribution/param.md b/reference/random/gamma_distribution/param.md index 62d3277860..be41e703c7 100644 --- a/reference/random/gamma_distribution/param.md +++ b/reference/random/gamma_distribution/param.md @@ -51,7 +51,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/gamma_distribution/reset.md b/reference/random/gamma_distribution/reset.md index 7c86ed1484..0fdf47216d 100644 --- a/reference/random/gamma_distribution/reset.md +++ b/reference/random/gamma_distribution/reset.md @@ -61,7 +61,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/generate_canonical.md b/reference/random/generate_canonical.md index 1b17fa0981..5ec3e4750f 100644 --- a/reference/random/generate_canonical.md +++ b/reference/random/generate_canonical.md @@ -69,8 +69,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.4 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/geometric_distribution.md b/reference/random/geometric_distribution.md index 7350f757a3..9a95ab1a3b 100644 --- a/reference/random/geometric_distribution.md +++ b/reference/random/geometric_distribution.md @@ -107,7 +107,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/geometric_distribution/max.md b/reference/random/geometric_distribution/max.md index bf454ef34b..7ebea6c001 100644 --- a/reference/random/geometric_distribution/max.md +++ b/reference/random/geometric_distribution/max.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/geometric_distribution/min.md b/reference/random/geometric_distribution/min.md index db661f33ac..d0873eb698 100644 --- a/reference/random/geometric_distribution/min.md +++ b/reference/random/geometric_distribution/min.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/geometric_distribution/op_call.md b/reference/random/geometric_distribution/op_call.md index 14229bd5d1..1ea44060ac 100644 --- a/reference/random/geometric_distribution/op_call.md +++ b/reference/random/geometric_distribution/op_call.md @@ -74,8 +74,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.7.2(パラメータを渡さないバージョンのみ) +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.2(パラメータを渡さないバージョンのみ) [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/geometric_distribution/op_constructor.md b/reference/random/geometric_distribution/op_constructor.md index a83eab0385..7cfcc47ba0 100644 --- a/reference/random/geometric_distribution/op_constructor.md +++ b/reference/random/geometric_distribution/op_constructor.md @@ -74,7 +74,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/geometric_distribution/op_equal.md b/reference/random/geometric_distribution/op_equal.md index 4b33483cb9..be52686f44 100644 --- a/reference/random/geometric_distribution/op_equal.md +++ b/reference/random/geometric_distribution/op_equal.md @@ -55,7 +55,7 @@ equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/geometric_distribution/op_istream.md b/reference/random/geometric_distribution/op_istream.md index d37e845a64..d97333b4f7 100644 --- a/reference/random/geometric_distribution/op_istream.md +++ b/reference/random/geometric_distribution/op_istream.md @@ -73,7 +73,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/geometric_distribution/op_not_equal.md b/reference/random/geometric_distribution/op_not_equal.md index 53bc38700a..d5b8d212d5 100644 --- a/reference/random/geometric_distribution/op_not_equal.md +++ b/reference/random/geometric_distribution/op_not_equal.md @@ -55,7 +55,7 @@ not equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/geometric_distribution/op_ostream.md b/reference/random/geometric_distribution/op_ostream.md index 8d6d106bd6..1c1f32d621 100644 --- a/reference/random/geometric_distribution/op_ostream.md +++ b/reference/random/geometric_distribution/op_ostream.md @@ -52,7 +52,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/geometric_distribution/p.md b/reference/random/geometric_distribution/p.md index 9bdff6f6e2..cfa7e935ff 100644 --- a/reference/random/geometric_distribution/p.md +++ b/reference/random/geometric_distribution/p.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/geometric_distribution/param.md b/reference/random/geometric_distribution/param.md index 6c1828b821..ea774a3eea 100644 --- a/reference/random/geometric_distribution/param.md +++ b/reference/random/geometric_distribution/param.md @@ -51,7 +51,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/geometric_distribution/reset.md b/reference/random/geometric_distribution/reset.md index b965880bd2..59e031c108 100644 --- a/reference/random/geometric_distribution/reset.md +++ b/reference/random/geometric_distribution/reset.md @@ -61,7 +61,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/independent_bits_engine.md b/reference/random/independent_bits_engine.md index a6f7ac2705..ec8f86f93e 100644 --- a/reference/random/independent_bits_engine.md +++ b/reference/random/independent_bits_engine.md @@ -120,7 +120,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/random/independent_bits_engine/base.md b/reference/random/independent_bits_engine/base.md index 67e70fda29..f4b5699d11 100644 --- a/reference/random/independent_bits_engine/base.md +++ b/reference/random/independent_bits_engine/base.md @@ -44,7 +44,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/independent_bits_engine/discard.md b/reference/random/independent_bits_engine/discard.md index 6a0f38a196..45b3628a4a 100644 --- a/reference/random/independent_bits_engine/discard.md +++ b/reference/random/independent_bits_engine/discard.md @@ -73,7 +73,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/independent_bits_engine/max.md b/reference/random/independent_bits_engine/max.md index a114b6c492..1d261f1650 100644 --- a/reference/random/independent_bits_engine/max.md +++ b/reference/random/independent_bits_engine/max.md @@ -48,7 +48,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/independent_bits_engine/min.md b/reference/random/independent_bits_engine/min.md index 5af1160da7..fb75890334 100644 --- a/reference/random/independent_bits_engine/min.md +++ b/reference/random/independent_bits_engine/min.md @@ -48,7 +48,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/independent_bits_engine/op_call.md b/reference/random/independent_bits_engine/op_call.md index f7d2719929..36b6157a81 100644 --- a/reference/random/independent_bits_engine/op_call.md +++ b/reference/random/independent_bits_engine/op_call.md @@ -67,7 +67,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/independent_bits_engine/op_constructor.md b/reference/random/independent_bits_engine/op_constructor.md index 653c0a1f89..e8e3750b1e 100644 --- a/reference/random/independent_bits_engine/op_constructor.md +++ b/reference/random/independent_bits_engine/op_constructor.md @@ -115,7 +115,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/independent_bits_engine/op_equal.md b/reference/random/independent_bits_engine/op_equal.md index 16beed9f86..d13e70155a 100644 --- a/reference/random/independent_bits_engine/op_equal.md +++ b/reference/random/independent_bits_engine/op_equal.md @@ -59,7 +59,7 @@ equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/independent_bits_engine/op_istream.md b/reference/random/independent_bits_engine/op_istream.md index 225d30de2d..319650cc61 100644 --- a/reference/random/independent_bits_engine/op_istream.md +++ b/reference/random/independent_bits_engine/op_istream.md @@ -79,7 +79,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/independent_bits_engine/op_not_equal.md b/reference/random/independent_bits_engine/op_not_equal.md index b90e11f7e0..c040e8941e 100644 --- a/reference/random/independent_bits_engine/op_not_equal.md +++ b/reference/random/independent_bits_engine/op_not_equal.md @@ -61,7 +61,7 @@ not equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/independent_bits_engine/op_ostream.md b/reference/random/independent_bits_engine/op_ostream.md index 8e67d9e5a7..ea9b04b4e4 100644 --- a/reference/random/independent_bits_engine/op_ostream.md +++ b/reference/random/independent_bits_engine/op_ostream.md @@ -56,7 +56,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/independent_bits_engine/seed.md b/reference/random/independent_bits_engine/seed.md index f81756c798..102bd50211 100644 --- a/reference/random/independent_bits_engine/seed.md +++ b/reference/random/independent_bits_engine/seed.md @@ -108,7 +108,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/knuth_b.md b/reference/random/knuth_b.md index fbe54170c2..327897c3fd 100644 --- a/reference/random/knuth_b.md +++ b/reference/random/knuth_b.md @@ -94,7 +94,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/linear_congruential_engine.md b/reference/random/linear_congruential_engine.md index 11a6f14c46..6011bbc5bc 100644 --- a/reference/random/linear_congruential_engine.md +++ b/reference/random/linear_congruential_engine.md @@ -142,6 +142,6 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/random/linear_congruential_engine/discard.md b/reference/random/linear_congruential_engine/discard.md index 83892d3eab..c4ab3fe416 100644 --- a/reference/random/linear_congruential_engine/discard.md +++ b/reference/random/linear_congruential_engine/discard.md @@ -72,7 +72,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/linear_congruential_engine/max.md b/reference/random/linear_congruential_engine/max.md index be00515711..57ea8a8480 100644 --- a/reference/random/linear_congruential_engine/max.md +++ b/reference/random/linear_congruential_engine/max.md @@ -47,7 +47,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/linear_congruential_engine/min.md b/reference/random/linear_congruential_engine/min.md index 02d034e94c..dc9f873afd 100644 --- a/reference/random/linear_congruential_engine/min.md +++ b/reference/random/linear_congruential_engine/min.md @@ -47,7 +47,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/linear_congruential_engine/op_call.md b/reference/random/linear_congruential_engine/op_call.md index 4605b00185..439d1b40f3 100644 --- a/reference/random/linear_congruential_engine/op_call.md +++ b/reference/random/linear_congruential_engine/op_call.md @@ -67,7 +67,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/linear_congruential_engine/op_constructor.md b/reference/random/linear_congruential_engine/op_constructor.md index de99fd2763..86189541c9 100644 --- a/reference/random/linear_congruential_engine/op_constructor.md +++ b/reference/random/linear_congruential_engine/op_constructor.md @@ -96,7 +96,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/linear_congruential_engine/op_equal.md b/reference/random/linear_congruential_engine/op_equal.md index e9d1cd4e94..02ab8d7aa4 100644 --- a/reference/random/linear_congruential_engine/op_equal.md +++ b/reference/random/linear_congruential_engine/op_equal.md @@ -56,7 +56,7 @@ equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/linear_congruential_engine/op_istream.md b/reference/random/linear_congruential_engine/op_istream.md index 751725d01c..5c9ba054c5 100644 --- a/reference/random/linear_congruential_engine/op_istream.md +++ b/reference/random/linear_congruential_engine/op_istream.md @@ -76,7 +76,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/linear_congruential_engine/op_not_equal.md b/reference/random/linear_congruential_engine/op_not_equal.md index 204a51c812..c13d6e8b04 100644 --- a/reference/random/linear_congruential_engine/op_not_equal.md +++ b/reference/random/linear_congruential_engine/op_not_equal.md @@ -58,7 +58,7 @@ not equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/linear_congruential_engine/op_ostream.md b/reference/random/linear_congruential_engine/op_ostream.md index 185b2ea8bc..b1b739763e 100644 --- a/reference/random/linear_congruential_engine/op_ostream.md +++ b/reference/random/linear_congruential_engine/op_ostream.md @@ -55,7 +55,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/linear_congruential_engine/seed.md b/reference/random/linear_congruential_engine/seed.md index 4c0e11c40d..6d9ce25fd8 100644 --- a/reference/random/linear_congruential_engine/seed.md +++ b/reference/random/linear_congruential_engine/seed.md @@ -102,7 +102,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/lognormal_distribution.md b/reference/random/lognormal_distribution.md index ea53f2cb6a..ac717b74e1 100644 --- a/reference/random/lognormal_distribution.md +++ b/reference/random/lognormal_distribution.md @@ -117,7 +117,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/random/lognormal_distribution/m.md b/reference/random/lognormal_distribution/m.md index 4c7ce43b08..0d5dc6a1a6 100644 --- a/reference/random/lognormal_distribution/m.md +++ b/reference/random/lognormal_distribution/m.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/lognormal_distribution/max.md b/reference/random/lognormal_distribution/max.md index e86e17384f..6a7ee893b5 100644 --- a/reference/random/lognormal_distribution/max.md +++ b/reference/random/lognormal_distribution/max.md @@ -42,8 +42,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.7.2 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/lognormal_distribution/min.md b/reference/random/lognormal_distribution/min.md index 1e711ba55c..1d45fddafc 100644 --- a/reference/random/lognormal_distribution/min.md +++ b/reference/random/lognormal_distribution/min.md @@ -42,7 +42,7 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [GCC](/implementation.md#gcc): - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/lognormal_distribution/op_call.md b/reference/random/lognormal_distribution/op_call.md index cc0e4673ad..3940da958d 100644 --- a/reference/random/lognormal_distribution/op_call.md +++ b/reference/random/lognormal_distribution/op_call.md @@ -84,7 +84,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/lognormal_distribution/op_constructor.md b/reference/random/lognormal_distribution/op_constructor.md index 9bf9d9e83b..99e650aaad 100644 --- a/reference/random/lognormal_distribution/op_constructor.md +++ b/reference/random/lognormal_distribution/op_constructor.md @@ -96,7 +96,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/lognormal_distribution/op_equal.md b/reference/random/lognormal_distribution/op_equal.md index 68e7ef27b9..8e0c9ecb6f 100644 --- a/reference/random/lognormal_distribution/op_equal.md +++ b/reference/random/lognormal_distribution/op_equal.md @@ -55,7 +55,7 @@ equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/lognormal_distribution/op_istream.md b/reference/random/lognormal_distribution/op_istream.md index d1d505a7c7..73a4be9083 100644 --- a/reference/random/lognormal_distribution/op_istream.md +++ b/reference/random/lognormal_distribution/op_istream.md @@ -73,7 +73,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/lognormal_distribution/op_not_equal.md b/reference/random/lognormal_distribution/op_not_equal.md index ff10194321..40e739d5b0 100644 --- a/reference/random/lognormal_distribution/op_not_equal.md +++ b/reference/random/lognormal_distribution/op_not_equal.md @@ -55,7 +55,7 @@ not equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/lognormal_distribution/op_ostream.md b/reference/random/lognormal_distribution/op_ostream.md index 2f9dadaf01..58ad07ef04 100644 --- a/reference/random/lognormal_distribution/op_ostream.md +++ b/reference/random/lognormal_distribution/op_ostream.md @@ -52,7 +52,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/lognormal_distribution/param.md b/reference/random/lognormal_distribution/param.md index e8bb32eb29..ea0aaacc4a 100644 --- a/reference/random/lognormal_distribution/param.md +++ b/reference/random/lognormal_distribution/param.md @@ -51,7 +51,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/lognormal_distribution/reset.md b/reference/random/lognormal_distribution/reset.md index dbe896b60a..879fba35ea 100644 --- a/reference/random/lognormal_distribution/reset.md +++ b/reference/random/lognormal_distribution/reset.md @@ -65,7 +65,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/lognormal_distribution/s.md b/reference/random/lognormal_distribution/s.md index 7badd3536a..c938db0491 100644 --- a/reference/random/lognormal_distribution/s.md +++ b/reference/random/lognormal_distribution/s.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/mersenne_twister_engine.md b/reference/random/mersenne_twister_engine.md index b2a03f602d..9761383bf4 100644 --- a/reference/random/mersenne_twister_engine.md +++ b/reference/random/mersenne_twister_engine.md @@ -166,7 +166,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/mersenne_twister_engine/discard.md b/reference/random/mersenne_twister_engine/discard.md index 9e03a01a68..8d8d888d28 100644 --- a/reference/random/mersenne_twister_engine/discard.md +++ b/reference/random/mersenne_twister_engine/discard.md @@ -71,7 +71,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/mersenne_twister_engine/max.md b/reference/random/mersenne_twister_engine/max.md index c97cf81f00..bc61342c1e 100644 --- a/reference/random/mersenne_twister_engine/max.md +++ b/reference/random/mersenne_twister_engine/max.md @@ -46,7 +46,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/mersenne_twister_engine/min.md b/reference/random/mersenne_twister_engine/min.md index 393a2146f9..40eb5899ac 100644 --- a/reference/random/mersenne_twister_engine/min.md +++ b/reference/random/mersenne_twister_engine/min.md @@ -46,7 +46,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/mersenne_twister_engine/op_call.md b/reference/random/mersenne_twister_engine/op_call.md index 6ecff3f507..31b18f357c 100644 --- a/reference/random/mersenne_twister_engine/op_call.md +++ b/reference/random/mersenne_twister_engine/op_call.md @@ -66,7 +66,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/mersenne_twister_engine/op_constructor.md b/reference/random/mersenne_twister_engine/op_constructor.md index f4dab58427..1df5e50f44 100644 --- a/reference/random/mersenne_twister_engine/op_constructor.md +++ b/reference/random/mersenne_twister_engine/op_constructor.md @@ -98,7 +98,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/mersenne_twister_engine/op_equal.md b/reference/random/mersenne_twister_engine/op_equal.md index 4ef5f2984c..eae86854df 100644 --- a/reference/random/mersenne_twister_engine/op_equal.md +++ b/reference/random/mersenne_twister_engine/op_equal.md @@ -58,7 +58,7 @@ equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/mersenne_twister_engine/op_istream.md b/reference/random/mersenne_twister_engine/op_istream.md index 3c04d5eab8..4efe16d6fd 100644 --- a/reference/random/mersenne_twister_engine/op_istream.md +++ b/reference/random/mersenne_twister_engine/op_istream.md @@ -78,7 +78,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/mersenne_twister_engine/op_not_equal.md b/reference/random/mersenne_twister_engine/op_not_equal.md index d1d240ce40..e01606c65b 100644 --- a/reference/random/mersenne_twister_engine/op_not_equal.md +++ b/reference/random/mersenne_twister_engine/op_not_equal.md @@ -60,7 +60,7 @@ not equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/mersenne_twister_engine/op_ostream.md b/reference/random/mersenne_twister_engine/op_ostream.md index e4d3794f08..5265f447a2 100644 --- a/reference/random/mersenne_twister_engine/op_ostream.md +++ b/reference/random/mersenne_twister_engine/op_ostream.md @@ -57,7 +57,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/mersenne_twister_engine/seed.md b/reference/random/mersenne_twister_engine/seed.md index 00c03e4ece..d602a71d48 100644 --- a/reference/random/mersenne_twister_engine/seed.md +++ b/reference/random/mersenne_twister_engine/seed.md @@ -103,7 +103,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/minstd_rand.md b/reference/random/minstd_rand.md index 718600f0df..8fce062f54 100644 --- a/reference/random/minstd_rand.md +++ b/reference/random/minstd_rand.md @@ -106,7 +106,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/minstd_rand0.md b/reference/random/minstd_rand0.md index 2809d0d34a..fff56cb265 100644 --- a/reference/random/minstd_rand0.md +++ b/reference/random/minstd_rand0.md @@ -108,7 +108,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/mt19937.md b/reference/random/mt19937.md index 8eacf647a7..f2493a35bc 100644 --- a/reference/random/mt19937.md +++ b/reference/random/mt19937.md @@ -102,7 +102,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/mt19937_64.md b/reference/random/mt19937_64.md index 7a5ac234c0..6c577c1aaf 100644 --- a/reference/random/mt19937_64.md +++ b/reference/random/mt19937_64.md @@ -99,7 +99,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/negative_binomial_distribution.md b/reference/random/negative_binomial_distribution.md index 0dd417c262..91516aafd0 100644 --- a/reference/random/negative_binomial_distribution.md +++ b/reference/random/negative_binomial_distribution.md @@ -103,7 +103,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/negative_binomial_distribution/k.md b/reference/random/negative_binomial_distribution/k.md index 9607874f0e..098b68f494 100644 --- a/reference/random/negative_binomial_distribution/k.md +++ b/reference/random/negative_binomial_distribution/k.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/negative_binomial_distribution/max.md b/reference/random/negative_binomial_distribution/max.md index 060c1022fb..488416e61d 100644 --- a/reference/random/negative_binomial_distribution/max.md +++ b/reference/random/negative_binomial_distribution/max.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/negative_binomial_distribution/min.md b/reference/random/negative_binomial_distribution/min.md index 4ed4bf771c..719a6671c0 100644 --- a/reference/random/negative_binomial_distribution/min.md +++ b/reference/random/negative_binomial_distribution/min.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/negative_binomial_distribution/op_call.md b/reference/random/negative_binomial_distribution/op_call.md index b2e9ee9cdb..42490ed1c2 100644 --- a/reference/random/negative_binomial_distribution/op_call.md +++ b/reference/random/negative_binomial_distribution/op_call.md @@ -74,8 +74,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.7.2(パラメータを渡さないバージョンのみ) +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.2(パラメータを渡さないバージョンのみ) [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/negative_binomial_distribution/op_constructor.md b/reference/random/negative_binomial_distribution/op_constructor.md index bea08204bc..d1dfca1531 100644 --- a/reference/random/negative_binomial_distribution/op_constructor.md +++ b/reference/random/negative_binomial_distribution/op_constructor.md @@ -74,7 +74,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/negative_binomial_distribution/op_equal.md b/reference/random/negative_binomial_distribution/op_equal.md index d4472014e4..e4277689ad 100644 --- a/reference/random/negative_binomial_distribution/op_equal.md +++ b/reference/random/negative_binomial_distribution/op_equal.md @@ -55,7 +55,7 @@ equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/negative_binomial_distribution/op_istream.md b/reference/random/negative_binomial_distribution/op_istream.md index 0f250f580d..b2eaee051b 100644 --- a/reference/random/negative_binomial_distribution/op_istream.md +++ b/reference/random/negative_binomial_distribution/op_istream.md @@ -73,7 +73,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/negative_binomial_distribution/op_not_equal.md b/reference/random/negative_binomial_distribution/op_not_equal.md index 680617ed07..08be26431b 100644 --- a/reference/random/negative_binomial_distribution/op_not_equal.md +++ b/reference/random/negative_binomial_distribution/op_not_equal.md @@ -55,7 +55,7 @@ not equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/negative_binomial_distribution/op_ostream.md b/reference/random/negative_binomial_distribution/op_ostream.md index 3e8f502edc..1c4429fffc 100644 --- a/reference/random/negative_binomial_distribution/op_ostream.md +++ b/reference/random/negative_binomial_distribution/op_ostream.md @@ -52,7 +52,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/negative_binomial_distribution/p.md b/reference/random/negative_binomial_distribution/p.md index c24d5144cc..43f46fc255 100644 --- a/reference/random/negative_binomial_distribution/p.md +++ b/reference/random/negative_binomial_distribution/p.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/negative_binomial_distribution/param.md b/reference/random/negative_binomial_distribution/param.md index 7e8b979bdf..f8815a32fc 100644 --- a/reference/random/negative_binomial_distribution/param.md +++ b/reference/random/negative_binomial_distribution/param.md @@ -51,7 +51,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/negative_binomial_distribution/reset.md b/reference/random/negative_binomial_distribution/reset.md index fa99518e86..ff484332ec 100644 --- a/reference/random/negative_binomial_distribution/reset.md +++ b/reference/random/negative_binomial_distribution/reset.md @@ -61,7 +61,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/normal_distribution.md b/reference/random/normal_distribution.md index 0475667216..47d04b4b1e 100644 --- a/reference/random/normal_distribution.md +++ b/reference/random/normal_distribution.md @@ -116,7 +116,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/random/normal_distribution/max.md b/reference/random/normal_distribution/max.md index 24e3fae63f..471b052fb5 100644 --- a/reference/random/normal_distribution/max.md +++ b/reference/random/normal_distribution/max.md @@ -47,8 +47,8 @@ inf - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.7.2 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/normal_distribution/mean.md b/reference/random/normal_distribution/mean.md index ff31b7a755..259e607fce 100644 --- a/reference/random/normal_distribution/mean.md +++ b/reference/random/normal_distribution/mean.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/normal_distribution/min.md b/reference/random/normal_distribution/min.md index 8ffd60a3e4..c897be9c46 100644 --- a/reference/random/normal_distribution/min.md +++ b/reference/random/normal_distribution/min.md @@ -42,7 +42,7 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [GCC](/implementation.md#gcc): - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/normal_distribution/op_call.md b/reference/random/normal_distribution/op_call.md index 5789102cfd..a7116bf0e9 100644 --- a/reference/random/normal_distribution/op_call.md +++ b/reference/random/normal_distribution/op_call.md @@ -84,7 +84,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/normal_distribution/op_constructor.md b/reference/random/normal_distribution/op_constructor.md index 20a7fe9402..4a1260d992 100644 --- a/reference/random/normal_distribution/op_constructor.md +++ b/reference/random/normal_distribution/op_constructor.md @@ -96,7 +96,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/normal_distribution/op_equal.md b/reference/random/normal_distribution/op_equal.md index 9001f49cad..3085667d8d 100644 --- a/reference/random/normal_distribution/op_equal.md +++ b/reference/random/normal_distribution/op_equal.md @@ -55,7 +55,7 @@ equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/normal_distribution/op_istream.md b/reference/random/normal_distribution/op_istream.md index a23c58c6e3..83549cf4f7 100644 --- a/reference/random/normal_distribution/op_istream.md +++ b/reference/random/normal_distribution/op_istream.md @@ -73,7 +73,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/normal_distribution/op_not_equal.md b/reference/random/normal_distribution/op_not_equal.md index 00ce0533bc..e0a4edfa54 100644 --- a/reference/random/normal_distribution/op_not_equal.md +++ b/reference/random/normal_distribution/op_not_equal.md @@ -55,7 +55,7 @@ not equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/normal_distribution/op_ostream.md b/reference/random/normal_distribution/op_ostream.md index 1ee0e61863..61ae6a8899 100644 --- a/reference/random/normal_distribution/op_ostream.md +++ b/reference/random/normal_distribution/op_ostream.md @@ -52,7 +52,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/normal_distribution/param.md b/reference/random/normal_distribution/param.md index 9b084c32a1..772718b8a0 100644 --- a/reference/random/normal_distribution/param.md +++ b/reference/random/normal_distribution/param.md @@ -51,7 +51,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/normal_distribution/reset.md b/reference/random/normal_distribution/reset.md index c9e563577d..c1f6ef0e8b 100644 --- a/reference/random/normal_distribution/reset.md +++ b/reference/random/normal_distribution/reset.md @@ -65,7 +65,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/normal_distribution/stddev.md b/reference/random/normal_distribution/stddev.md index fa0ba64738..742cb22888 100644 --- a/reference/random/normal_distribution/stddev.md +++ b/reference/random/normal_distribution/stddev.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/piecewise_constant_distribution.md b/reference/random/piecewise_constant_distribution.md index ae61940f66..c78ce1736e 100644 --- a/reference/random/piecewise_constant_distribution.md +++ b/reference/random/piecewise_constant_distribution.md @@ -111,7 +111,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 4.5.3, 4.6.1 +- [GCC](/implementation.md#gcc): 4.5.3 [mark verified], 4.6.1 [mark verified] - [ICC](/implementation.md#icc): - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/random/piecewise_constant_distribution/densities.md b/reference/random/piecewise_constant_distribution/densities.md index 706d8bd25b..6d536f11bf 100644 --- a/reference/random/piecewise_constant_distribution/densities.md +++ b/reference/random/piecewise_constant_distribution/densities.md @@ -58,7 +58,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/piecewise_constant_distribution/intervals.md b/reference/random/piecewise_constant_distribution/intervals.md index f4da14ac20..be218d42cf 100644 --- a/reference/random/piecewise_constant_distribution/intervals.md +++ b/reference/random/piecewise_constant_distribution/intervals.md @@ -59,7 +59,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/piecewise_constant_distribution/max.md b/reference/random/piecewise_constant_distribution/max.md index 20c96461c6..ecddb22660 100644 --- a/reference/random/piecewise_constant_distribution/max.md +++ b/reference/random/piecewise_constant_distribution/max.md @@ -54,7 +54,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/piecewise_constant_distribution/min.md b/reference/random/piecewise_constant_distribution/min.md index f8bc8512ea..b85df2a6c9 100644 --- a/reference/random/piecewise_constant_distribution/min.md +++ b/reference/random/piecewise_constant_distribution/min.md @@ -54,7 +54,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/piecewise_constant_distribution/op_call.md b/reference/random/piecewise_constant_distribution/op_call.md index b768c28829..b8c9cc1a2c 100644 --- a/reference/random/piecewise_constant_distribution/op_call.md +++ b/reference/random/piecewise_constant_distribution/op_call.md @@ -103,7 +103,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/piecewise_constant_distribution/op_constructor.md b/reference/random/piecewise_constant_distribution/op_constructor.md index f75ff920a3..1492019dd6 100644 --- a/reference/random/piecewise_constant_distribution/op_constructor.md +++ b/reference/random/piecewise_constant_distribution/op_constructor.md @@ -141,7 +141,7 @@ parameter constructor : 0.49003 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/piecewise_constant_distribution/op_equal.md b/reference/random/piecewise_constant_distribution/op_equal.md index 0c86d9fce3..1c49ec310f 100644 --- a/reference/random/piecewise_constant_distribution/op_equal.md +++ b/reference/random/piecewise_constant_distribution/op_equal.md @@ -74,7 +74,7 @@ equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/piecewise_constant_distribution/op_istream.md b/reference/random/piecewise_constant_distribution/op_istream.md index 8fc62b4b10..007a2da692 100644 --- a/reference/random/piecewise_constant_distribution/op_istream.md +++ b/reference/random/piecewise_constant_distribution/op_istream.md @@ -85,7 +85,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/piecewise_constant_distribution/op_not_equal.md b/reference/random/piecewise_constant_distribution/op_not_equal.md index 2d6985531e..786b170047 100644 --- a/reference/random/piecewise_constant_distribution/op_not_equal.md +++ b/reference/random/piecewise_constant_distribution/op_not_equal.md @@ -74,7 +74,7 @@ not equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/piecewise_constant_distribution/op_ostream.md b/reference/random/piecewise_constant_distribution/op_ostream.md index 6175a42dfa..d9c1ff8267 100644 --- a/reference/random/piecewise_constant_distribution/op_ostream.md +++ b/reference/random/piecewise_constant_distribution/op_ostream.md @@ -64,7 +64,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/piecewise_constant_distribution/param.md b/reference/random/piecewise_constant_distribution/param.md index 19bae44e4b..db3610bc7a 100644 --- a/reference/random/piecewise_constant_distribution/param.md +++ b/reference/random/piecewise_constant_distribution/param.md @@ -67,7 +67,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/piecewise_constant_distribution/reset.md b/reference/random/piecewise_constant_distribution/reset.md index ac47e1cafb..9837caf0a5 100644 --- a/reference/random/piecewise_constant_distribution/reset.md +++ b/reference/random/piecewise_constant_distribution/reset.md @@ -70,7 +70,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/piecewise_linear_distribution.md b/reference/random/piecewise_linear_distribution.md index 586acb4d9a..d7c72de145 100644 --- a/reference/random/piecewise_linear_distribution.md +++ b/reference/random/piecewise_linear_distribution.md @@ -111,7 +111,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/random/piecewise_linear_distribution/densities.md b/reference/random/piecewise_linear_distribution/densities.md index abc38110c1..fb660c7222 100644 --- a/reference/random/piecewise_linear_distribution/densities.md +++ b/reference/random/piecewise_linear_distribution/densities.md @@ -59,7 +59,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/piecewise_linear_distribution/intervals.md b/reference/random/piecewise_linear_distribution/intervals.md index d96c59c42b..81eb4e7b3b 100644 --- a/reference/random/piecewise_linear_distribution/intervals.md +++ b/reference/random/piecewise_linear_distribution/intervals.md @@ -59,7 +59,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/piecewise_linear_distribution/max.md b/reference/random/piecewise_linear_distribution/max.md index d235f8c5f1..b489dd6599 100644 --- a/reference/random/piecewise_linear_distribution/max.md +++ b/reference/random/piecewise_linear_distribution/max.md @@ -54,7 +54,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/piecewise_linear_distribution/min.md b/reference/random/piecewise_linear_distribution/min.md index 612c40cb40..dc4c940814 100644 --- a/reference/random/piecewise_linear_distribution/min.md +++ b/reference/random/piecewise_linear_distribution/min.md @@ -54,7 +54,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/piecewise_linear_distribution/op_call.md b/reference/random/piecewise_linear_distribution/op_call.md index fe07c84a35..e48a5ae88a 100644 --- a/reference/random/piecewise_linear_distribution/op_call.md +++ b/reference/random/piecewise_linear_distribution/op_call.md @@ -102,7 +102,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/piecewise_linear_distribution/op_constructor.md b/reference/random/piecewise_linear_distribution/op_constructor.md index 4c0769f3ca..829ab519fb 100644 --- a/reference/random/piecewise_linear_distribution/op_constructor.md +++ b/reference/random/piecewise_linear_distribution/op_constructor.md @@ -143,7 +143,7 @@ parameter constructor : 0.260002 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/piecewise_linear_distribution/op_equal.md b/reference/random/piecewise_linear_distribution/op_equal.md index 4f3900d373..499f65d11c 100644 --- a/reference/random/piecewise_linear_distribution/op_equal.md +++ b/reference/random/piecewise_linear_distribution/op_equal.md @@ -74,7 +74,7 @@ equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/piecewise_linear_distribution/op_istream.md b/reference/random/piecewise_linear_distribution/op_istream.md index 763e0734d3..648fdd746b 100644 --- a/reference/random/piecewise_linear_distribution/op_istream.md +++ b/reference/random/piecewise_linear_distribution/op_istream.md @@ -85,7 +85,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/piecewise_linear_distribution/op_not_equal.md b/reference/random/piecewise_linear_distribution/op_not_equal.md index 2adcd04fb9..c638b5cb9f 100644 --- a/reference/random/piecewise_linear_distribution/op_not_equal.md +++ b/reference/random/piecewise_linear_distribution/op_not_equal.md @@ -74,7 +74,7 @@ not equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/piecewise_linear_distribution/op_ostream.md b/reference/random/piecewise_linear_distribution/op_ostream.md index 32621adebc..99f3cb3f55 100644 --- a/reference/random/piecewise_linear_distribution/op_ostream.md +++ b/reference/random/piecewise_linear_distribution/op_ostream.md @@ -64,7 +64,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/piecewise_linear_distribution/param.md b/reference/random/piecewise_linear_distribution/param.md index 2a0feeee8e..5f981e4b39 100644 --- a/reference/random/piecewise_linear_distribution/param.md +++ b/reference/random/piecewise_linear_distribution/param.md @@ -71,7 +71,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/piecewise_linear_distribution/reset.md b/reference/random/piecewise_linear_distribution/reset.md index 71b2a52e1a..1eb37982d8 100644 --- a/reference/random/piecewise_linear_distribution/reset.md +++ b/reference/random/piecewise_linear_distribution/reset.md @@ -70,7 +70,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/poisson_distribution.md b/reference/random/poisson_distribution.md index 9a294e1e4a..d4939dae97 100644 --- a/reference/random/poisson_distribution.md +++ b/reference/random/poisson_distribution.md @@ -118,7 +118,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/random/poisson_distribution/max.md b/reference/random/poisson_distribution/max.md index d2bbd7cb67..7734e9da11 100644 --- a/reference/random/poisson_distribution/max.md +++ b/reference/random/poisson_distribution/max.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/poisson_distribution/mean.md b/reference/random/poisson_distribution/mean.md index 87d5635186..a0c0016c5c 100644 --- a/reference/random/poisson_distribution/mean.md +++ b/reference/random/poisson_distribution/mean.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/poisson_distribution/min.md b/reference/random/poisson_distribution/min.md index f65d641b50..59e781c9d7 100644 --- a/reference/random/poisson_distribution/min.md +++ b/reference/random/poisson_distribution/min.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/poisson_distribution/op_call.md b/reference/random/poisson_distribution/op_call.md index ce92423f5d..6c3e9453f7 100644 --- a/reference/random/poisson_distribution/op_call.md +++ b/reference/random/poisson_distribution/op_call.md @@ -84,7 +84,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/poisson_distribution/op_constructor.md b/reference/random/poisson_distribution/op_constructor.md index 6e940b5941..d6b9445702 100644 --- a/reference/random/poisson_distribution/op_constructor.md +++ b/reference/random/poisson_distribution/op_constructor.md @@ -75,7 +75,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/poisson_distribution/op_equal.md b/reference/random/poisson_distribution/op_equal.md index e59d9bae3d..1c00c5b7e1 100644 --- a/reference/random/poisson_distribution/op_equal.md +++ b/reference/random/poisson_distribution/op_equal.md @@ -55,7 +55,7 @@ equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/poisson_distribution/op_istream.md b/reference/random/poisson_distribution/op_istream.md index eef3fdf982..6f986d2519 100644 --- a/reference/random/poisson_distribution/op_istream.md +++ b/reference/random/poisson_distribution/op_istream.md @@ -73,7 +73,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/poisson_distribution/op_not_equal.md b/reference/random/poisson_distribution/op_not_equal.md index 780c716187..c4e4d8fbb6 100644 --- a/reference/random/poisson_distribution/op_not_equal.md +++ b/reference/random/poisson_distribution/op_not_equal.md @@ -55,7 +55,7 @@ not equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/poisson_distribution/op_ostream.md b/reference/random/poisson_distribution/op_ostream.md index 85d56dea04..211427f72d 100644 --- a/reference/random/poisson_distribution/op_ostream.md +++ b/reference/random/poisson_distribution/op_ostream.md @@ -52,7 +52,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/poisson_distribution/param.md b/reference/random/poisson_distribution/param.md index 3ad57cdf06..88608feaf6 100644 --- a/reference/random/poisson_distribution/param.md +++ b/reference/random/poisson_distribution/param.md @@ -51,7 +51,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/poisson_distribution/reset.md b/reference/random/poisson_distribution/reset.md index d8a4d636dc..97b9075c30 100644 --- a/reference/random/poisson_distribution/reset.md +++ b/reference/random/poisson_distribution/reset.md @@ -61,7 +61,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/random_device.md b/reference/random/random_device.md index 7a31d246fd..c34bca9db6 100644 --- a/reference/random/random_device.md +++ b/reference/random/random_device.md @@ -161,10 +161,10 @@ jyiasder - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.2 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 備考 diff --git a/reference/random/random_device/entropy.md b/reference/random/random_device/entropy.md index 8d585a516e..548f7e6096 100644 --- a/reference/random/random_device/entropy.md +++ b/reference/random/random_device/entropy.md @@ -51,9 +51,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/random/random_device/max.md b/reference/random/random_device/max.md index cb082d1343..c9afd1a423 100644 --- a/reference/random/random_device/max.md +++ b/reference/random/random_device/max.md @@ -45,9 +45,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/random/random_device/min.md b/reference/random/random_device/min.md index 027c08b58a..f3e61b2123 100644 --- a/reference/random/random_device/min.md +++ b/reference/random/random_device/min.md @@ -45,9 +45,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/random/random_device/op_call.md b/reference/random/random_device/op_call.md index 8954f59669..2b43dc2f11 100644 --- a/reference/random/random_device/op_call.md +++ b/reference/random/random_device/op_call.md @@ -61,9 +61,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/random/random_device/op_constructor.md b/reference/random/random_device/op_constructor.md index 901b374121..cfc1661bc3 100644 --- a/reference/random/random_device/op_constructor.md +++ b/reference/random/random_device/op_constructor.md @@ -70,9 +70,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/random/ranlux24.md b/reference/random/ranlux24.md index fb8ca50e55..d19935ba16 100644 --- a/reference/random/ranlux24.md +++ b/reference/random/ranlux24.md @@ -94,9 +94,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/random/ranlux24_base.md b/reference/random/ranlux24_base.md index f4ca138a13..640571dc08 100644 --- a/reference/random/ranlux24_base.md +++ b/reference/random/ranlux24_base.md @@ -37,4 +37,4 @@ namespace std { - [Clang](/implementation.md#clang): ? - [GCC](/implementation.md#gcc): ? - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] diff --git a/reference/random/ranlux48.md b/reference/random/ranlux48.md index 1833e05624..c082a775e6 100644 --- a/reference/random/ranlux48.md +++ b/reference/random/ranlux48.md @@ -94,9 +94,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/random/ranlux48_base.md b/reference/random/ranlux48_base.md index c76d1e1d28..9a41594634 100644 --- a/reference/random/ranlux48_base.md +++ b/reference/random/ranlux48_base.md @@ -36,4 +36,4 @@ namespace std { - [Clang](/implementation.md#clang): ? - [GCC](/implementation.md#gcc): ? - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] diff --git a/reference/random/seed_seq.md b/reference/random/seed_seq.md index 514361b071..89b47c8e2e 100644 --- a/reference/random/seed_seq.md +++ b/reference/random/seed_seq.md @@ -114,7 +114,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/seed_seq/generate.md b/reference/random/seed_seq/generate.md index 440728c5f8..9d2533f978 100644 --- a/reference/random/seed_seq/generate.md +++ b/reference/random/seed_seq/generate.md @@ -105,7 +105,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/seed_seq/op_constructor.md b/reference/random/seed_seq/op_constructor.md index 26b63d2934..c478b41100 100644 --- a/reference/random/seed_seq/op_constructor.md +++ b/reference/random/seed_seq/op_constructor.md @@ -134,7 +134,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/seed_seq/param.md b/reference/random/seed_seq/param.md index 345b79e849..5315f0b4f1 100644 --- a/reference/random/seed_seq/param.md +++ b/reference/random/seed_seq/param.md @@ -79,7 +79,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/seed_seq/size.md b/reference/random/seed_seq/size.md index 98cd08d6f9..4899e62435 100644 --- a/reference/random/seed_seq/size.md +++ b/reference/random/seed_seq/size.md @@ -47,7 +47,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/shuffle_order_engine.md b/reference/random/shuffle_order_engine.md index 29f5021685..3f05337d2a 100644 --- a/reference/random/shuffle_order_engine.md +++ b/reference/random/shuffle_order_engine.md @@ -159,7 +159,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/random/shuffle_order_engine/base.md b/reference/random/shuffle_order_engine/base.md index b833e86a45..bf7aa2649c 100644 --- a/reference/random/shuffle_order_engine/base.md +++ b/reference/random/shuffle_order_engine/base.md @@ -44,7 +44,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/shuffle_order_engine/discard.md b/reference/random/shuffle_order_engine/discard.md index fbfe97d03f..69f8c4cdc2 100644 --- a/reference/random/shuffle_order_engine/discard.md +++ b/reference/random/shuffle_order_engine/discard.md @@ -72,7 +72,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/shuffle_order_engine/max.md b/reference/random/shuffle_order_engine/max.md index ad499df5f9..57edfc396e 100644 --- a/reference/random/shuffle_order_engine/max.md +++ b/reference/random/shuffle_order_engine/max.md @@ -47,7 +47,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/shuffle_order_engine/min.md b/reference/random/shuffle_order_engine/min.md index cf4cc49466..04e1f8103e 100644 --- a/reference/random/shuffle_order_engine/min.md +++ b/reference/random/shuffle_order_engine/min.md @@ -47,7 +47,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/shuffle_order_engine/op_call.md b/reference/random/shuffle_order_engine/op_call.md index 1c36efa82c..dacaada0f0 100644 --- a/reference/random/shuffle_order_engine/op_call.md +++ b/reference/random/shuffle_order_engine/op_call.md @@ -67,7 +67,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/shuffle_order_engine/op_constructor.md b/reference/random/shuffle_order_engine/op_constructor.md index 92e8b8a626..abe0ff202a 100644 --- a/reference/random/shuffle_order_engine/op_constructor.md +++ b/reference/random/shuffle_order_engine/op_constructor.md @@ -113,7 +113,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/shuffle_order_engine/op_equal.md b/reference/random/shuffle_order_engine/op_equal.md index 4489c5014b..afb282a16d 100644 --- a/reference/random/shuffle_order_engine/op_equal.md +++ b/reference/random/shuffle_order_engine/op_equal.md @@ -56,7 +56,7 @@ equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/shuffle_order_engine/op_istream.md b/reference/random/shuffle_order_engine/op_istream.md index 5f7187420a..47617264f7 100644 --- a/reference/random/shuffle_order_engine/op_istream.md +++ b/reference/random/shuffle_order_engine/op_istream.md @@ -76,7 +76,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/shuffle_order_engine/op_not_equal.md b/reference/random/shuffle_order_engine/op_not_equal.md index 6bfa2c6e54..b5483c6c89 100644 --- a/reference/random/shuffle_order_engine/op_not_equal.md +++ b/reference/random/shuffle_order_engine/op_not_equal.md @@ -58,7 +58,7 @@ not equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/shuffle_order_engine/op_ostream.md b/reference/random/shuffle_order_engine/op_ostream.md index 2f3e46739f..62a3d08cea 100644 --- a/reference/random/shuffle_order_engine/op_ostream.md +++ b/reference/random/shuffle_order_engine/op_ostream.md @@ -55,7 +55,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/shuffle_order_engine/seed.md b/reference/random/shuffle_order_engine/seed.md index 75d6a3dcd6..28236133d6 100644 --- a/reference/random/shuffle_order_engine/seed.md +++ b/reference/random/shuffle_order_engine/seed.md @@ -107,7 +107,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/student_t_distribution.md b/reference/random/student_t_distribution.md index 7d0f640f34..18d3e39300 100644 --- a/reference/random/student_t_distribution.md +++ b/reference/random/student_t_distribution.md @@ -117,7 +117,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/random/student_t_distribution/max.md b/reference/random/student_t_distribution/max.md index 68daa2a381..b8a8fc6960 100644 --- a/reference/random/student_t_distribution/max.md +++ b/reference/random/student_t_distribution/max.md @@ -42,8 +42,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.7.2 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/student_t_distribution/min.md b/reference/random/student_t_distribution/min.md index 3e6a9c939c..55752454a2 100644 --- a/reference/random/student_t_distribution/min.md +++ b/reference/random/student_t_distribution/min.md @@ -42,7 +42,7 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified] - [GCC](/implementation.md#gcc): - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/student_t_distribution/n.md b/reference/random/student_t_distribution/n.md index d76a29cf8d..bc0675fe33 100644 --- a/reference/random/student_t_distribution/n.md +++ b/reference/random/student_t_distribution/n.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/student_t_distribution/op_call.md b/reference/random/student_t_distribution/op_call.md index 779ddb4bd6..43d355b717 100644 --- a/reference/random/student_t_distribution/op_call.md +++ b/reference/random/student_t_distribution/op_call.md @@ -84,7 +84,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/student_t_distribution/op_constructor.md b/reference/random/student_t_distribution/op_constructor.md index 714ad3345f..c1962c39c4 100644 --- a/reference/random/student_t_distribution/op_constructor.md +++ b/reference/random/student_t_distribution/op_constructor.md @@ -96,7 +96,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/student_t_distribution/op_equal.md b/reference/random/student_t_distribution/op_equal.md index acc0e90b4e..d9c9883bc7 100644 --- a/reference/random/student_t_distribution/op_equal.md +++ b/reference/random/student_t_distribution/op_equal.md @@ -55,7 +55,7 @@ equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/student_t_distribution/op_istream.md b/reference/random/student_t_distribution/op_istream.md index d3ad5c925a..093f2ec5f0 100644 --- a/reference/random/student_t_distribution/op_istream.md +++ b/reference/random/student_t_distribution/op_istream.md @@ -73,7 +73,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/student_t_distribution/op_not_equal.md b/reference/random/student_t_distribution/op_not_equal.md index 3925c8d384..fb6f605e12 100644 --- a/reference/random/student_t_distribution/op_not_equal.md +++ b/reference/random/student_t_distribution/op_not_equal.md @@ -55,7 +55,7 @@ not equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/student_t_distribution/op_ostream.md b/reference/random/student_t_distribution/op_ostream.md index 8f091d7671..2c81fbe94c 100644 --- a/reference/random/student_t_distribution/op_ostream.md +++ b/reference/random/student_t_distribution/op_ostream.md @@ -52,7 +52,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/student_t_distribution/param.md b/reference/random/student_t_distribution/param.md index fd299e7530..daf5d4eeaa 100644 --- a/reference/random/student_t_distribution/param.md +++ b/reference/random/student_t_distribution/param.md @@ -51,7 +51,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/student_t_distribution/reset.md b/reference/random/student_t_distribution/reset.md index 881e50ad24..b96044c52e 100644 --- a/reference/random/student_t_distribution/reset.md +++ b/reference/random/student_t_distribution/reset.md @@ -61,7 +61,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/subtract_with_carry_engine.md b/reference/random/subtract_with_carry_engine.md index 241dbef1c5..e431324628 100644 --- a/reference/random/subtract_with_carry_engine.md +++ b/reference/random/subtract_with_carry_engine.md @@ -142,9 +142,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - 2008には、`std::tr1::subtract_with_carry`が存在する。 ## 参照 diff --git a/reference/random/subtract_with_carry_engine/discard.md b/reference/random/subtract_with_carry_engine/discard.md index f58e0d9bc0..b65a4fe849 100644 --- a/reference/random/subtract_with_carry_engine/discard.md +++ b/reference/random/subtract_with_carry_engine/discard.md @@ -72,9 +72,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/random/subtract_with_carry_engine/max.md b/reference/random/subtract_with_carry_engine/max.md index 1bcc3ef2dd..b3154d230c 100644 --- a/reference/random/subtract_with_carry_engine/max.md +++ b/reference/random/subtract_with_carry_engine/max.md @@ -48,9 +48,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/random/subtract_with_carry_engine/min.md b/reference/random/subtract_with_carry_engine/min.md index 9125d785a6..94b4118cd3 100644 --- a/reference/random/subtract_with_carry_engine/min.md +++ b/reference/random/subtract_with_carry_engine/min.md @@ -48,9 +48,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/random/subtract_with_carry_engine/op_call.md b/reference/random/subtract_with_carry_engine/op_call.md index df1ad45bac..4c2530f7f7 100644 --- a/reference/random/subtract_with_carry_engine/op_call.md +++ b/reference/random/subtract_with_carry_engine/op_call.md @@ -68,9 +68,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/random/subtract_with_carry_engine/op_constructor.md b/reference/random/subtract_with_carry_engine/op_constructor.md index 355dce826d..7ac7e3709d 100644 --- a/reference/random/subtract_with_carry_engine/op_constructor.md +++ b/reference/random/subtract_with_carry_engine/op_constructor.md @@ -104,9 +104,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/random/subtract_with_carry_engine/op_equal.md b/reference/random/subtract_with_carry_engine/op_equal.md index 76a0480909..8a16ef2e5b 100644 --- a/reference/random/subtract_with_carry_engine/op_equal.md +++ b/reference/random/subtract_with_carry_engine/op_equal.md @@ -56,9 +56,9 @@ equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/random/subtract_with_carry_engine/op_istream.md b/reference/random/subtract_with_carry_engine/op_istream.md index ec76e30313..3b5a3aed5e 100644 --- a/reference/random/subtract_with_carry_engine/op_istream.md +++ b/reference/random/subtract_with_carry_engine/op_istream.md @@ -76,9 +76,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/random/subtract_with_carry_engine/op_not_equal.md b/reference/random/subtract_with_carry_engine/op_not_equal.md index 8bd49a7219..08d15e2df7 100644 --- a/reference/random/subtract_with_carry_engine/op_not_equal.md +++ b/reference/random/subtract_with_carry_engine/op_not_equal.md @@ -58,9 +58,9 @@ not equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/random/subtract_with_carry_engine/op_ostream.md b/reference/random/subtract_with_carry_engine/op_ostream.md index 90c724c186..7f47a98d76 100644 --- a/reference/random/subtract_with_carry_engine/op_ostream.md +++ b/reference/random/subtract_with_carry_engine/op_ostream.md @@ -55,9 +55,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/random/subtract_with_carry_engine/seed.md b/reference/random/subtract_with_carry_engine/seed.md index 07a5699e57..8b01bdd5ed 100644 --- a/reference/random/subtract_with_carry_engine/seed.md +++ b/reference/random/subtract_with_carry_engine/seed.md @@ -105,9 +105,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/random/uniform_int_distribution.md b/reference/random/uniform_int_distribution.md index 97b3a6fc21..65110008c9 100644 --- a/reference/random/uniform_int_distribution.md +++ b/reference/random/uniform_int_distribution.md @@ -116,7 +116,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/uniform_int_distribution/a.md b/reference/random/uniform_int_distribution/a.md index 918096d95b..8624377abe 100644 --- a/reference/random/uniform_int_distribution/a.md +++ b/reference/random/uniform_int_distribution/a.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/uniform_int_distribution/b.md b/reference/random/uniform_int_distribution/b.md index 624946e38c..61399e267a 100644 --- a/reference/random/uniform_int_distribution/b.md +++ b/reference/random/uniform_int_distribution/b.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/uniform_int_distribution/max.md b/reference/random/uniform_int_distribution/max.md index 74f20d757c..fe55fa090e 100644 --- a/reference/random/uniform_int_distribution/max.md +++ b/reference/random/uniform_int_distribution/max.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/uniform_int_distribution/min.md b/reference/random/uniform_int_distribution/min.md index 66bbb631c8..4c16fa5be5 100644 --- a/reference/random/uniform_int_distribution/min.md +++ b/reference/random/uniform_int_distribution/min.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/uniform_int_distribution/op_call.md b/reference/random/uniform_int_distribution/op_call.md index bac3a7f13b..6eec7acff6 100644 --- a/reference/random/uniform_int_distribution/op_call.md +++ b/reference/random/uniform_int_distribution/op_call.md @@ -85,7 +85,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/uniform_int_distribution/op_constructor.md b/reference/random/uniform_int_distribution/op_constructor.md index 907af0cf05..0335d5c4ae 100644 --- a/reference/random/uniform_int_distribution/op_constructor.md +++ b/reference/random/uniform_int_distribution/op_constructor.md @@ -79,7 +79,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/uniform_int_distribution/op_equal.md b/reference/random/uniform_int_distribution/op_equal.md index 02d1fb0fd9..83c2765197 100644 --- a/reference/random/uniform_int_distribution/op_equal.md +++ b/reference/random/uniform_int_distribution/op_equal.md @@ -55,7 +55,7 @@ equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/uniform_int_distribution/op_istream.md b/reference/random/uniform_int_distribution/op_istream.md index 2ba9daac82..bb34b8b44b 100644 --- a/reference/random/uniform_int_distribution/op_istream.md +++ b/reference/random/uniform_int_distribution/op_istream.md @@ -73,7 +73,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/uniform_int_distribution/op_not_equal.md b/reference/random/uniform_int_distribution/op_not_equal.md index dc8576a53e..62702471e3 100644 --- a/reference/random/uniform_int_distribution/op_not_equal.md +++ b/reference/random/uniform_int_distribution/op_not_equal.md @@ -55,7 +55,7 @@ not equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/uniform_int_distribution/op_ostream.md b/reference/random/uniform_int_distribution/op_ostream.md index 2ccc88a971..1737734d04 100644 --- a/reference/random/uniform_int_distribution/op_ostream.md +++ b/reference/random/uniform_int_distribution/op_ostream.md @@ -52,7 +52,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/uniform_int_distribution/param.md b/reference/random/uniform_int_distribution/param.md index f7ea5e85dd..f7b3b8c3dd 100644 --- a/reference/random/uniform_int_distribution/param.md +++ b/reference/random/uniform_int_distribution/param.md @@ -51,7 +51,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/uniform_int_distribution/reset.md b/reference/random/uniform_int_distribution/reset.md index 36bd7fffde..18938fd659 100644 --- a/reference/random/uniform_int_distribution/reset.md +++ b/reference/random/uniform_int_distribution/reset.md @@ -59,7 +59,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/uniform_random_bit_generator.md b/reference/random/uniform_random_bit_generator.md index 03c02d27ba..cecbc707c6 100644 --- a/reference/random/uniform_random_bit_generator.md +++ b/reference/random/uniform_random_bit_generator.md @@ -82,8 +82,8 @@ std::exponential_distribution<> is not uniform random bit generator ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark verified] ## 関連項目 diff --git a/reference/random/uniform_real_distribution.md b/reference/random/uniform_real_distribution.md index 49ec30fdc1..cccb1c74e6 100644 --- a/reference/random/uniform_real_distribution.md +++ b/reference/random/uniform_real_distribution.md @@ -111,7 +111,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/uniform_real_distribution/a.md b/reference/random/uniform_real_distribution/a.md index 89d61a4584..859cb25f1c 100644 --- a/reference/random/uniform_real_distribution/a.md +++ b/reference/random/uniform_real_distribution/a.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/uniform_real_distribution/b.md b/reference/random/uniform_real_distribution/b.md index 849733e6b6..ac7e56ea4d 100644 --- a/reference/random/uniform_real_distribution/b.md +++ b/reference/random/uniform_real_distribution/b.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/uniform_real_distribution/max.md b/reference/random/uniform_real_distribution/max.md index 3e58d88954..d5df0a9b18 100644 --- a/reference/random/uniform_real_distribution/max.md +++ b/reference/random/uniform_real_distribution/max.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/uniform_real_distribution/min.md b/reference/random/uniform_real_distribution/min.md index 757ce37cb1..e2dad07414 100644 --- a/reference/random/uniform_real_distribution/min.md +++ b/reference/random/uniform_real_distribution/min.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/uniform_real_distribution/op_call.md b/reference/random/uniform_real_distribution/op_call.md index 216ca4ef76..8ee256abe3 100644 --- a/reference/random/uniform_real_distribution/op_call.md +++ b/reference/random/uniform_real_distribution/op_call.md @@ -85,7 +85,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/uniform_real_distribution/op_constructor.md b/reference/random/uniform_real_distribution/op_constructor.md index 52a8f4efc8..d64649495b 100644 --- a/reference/random/uniform_real_distribution/op_constructor.md +++ b/reference/random/uniform_real_distribution/op_constructor.md @@ -75,7 +75,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/uniform_real_distribution/op_equal.md b/reference/random/uniform_real_distribution/op_equal.md index 67a3eba84a..83e190b036 100644 --- a/reference/random/uniform_real_distribution/op_equal.md +++ b/reference/random/uniform_real_distribution/op_equal.md @@ -55,7 +55,7 @@ equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/uniform_real_distribution/op_istream.md b/reference/random/uniform_real_distribution/op_istream.md index 41fc4079a6..ca22f71e77 100644 --- a/reference/random/uniform_real_distribution/op_istream.md +++ b/reference/random/uniform_real_distribution/op_istream.md @@ -73,7 +73,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/uniform_real_distribution/op_not_equal.md b/reference/random/uniform_real_distribution/op_not_equal.md index 017aff8b43..bc017b67cd 100644 --- a/reference/random/uniform_real_distribution/op_not_equal.md +++ b/reference/random/uniform_real_distribution/op_not_equal.md @@ -55,7 +55,7 @@ not equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/uniform_real_distribution/op_ostream.md b/reference/random/uniform_real_distribution/op_ostream.md index 60487d86b2..41aeb776c8 100644 --- a/reference/random/uniform_real_distribution/op_ostream.md +++ b/reference/random/uniform_real_distribution/op_ostream.md @@ -52,7 +52,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/uniform_real_distribution/param.md b/reference/random/uniform_real_distribution/param.md index 497b0d6c10..fd7ff849ce 100644 --- a/reference/random/uniform_real_distribution/param.md +++ b/reference/random/uniform_real_distribution/param.md @@ -51,7 +51,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/uniform_real_distribution/reset.md b/reference/random/uniform_real_distribution/reset.md index 89439eb2c7..119fad1d53 100644 --- a/reference/random/uniform_real_distribution/reset.md +++ b/reference/random/uniform_real_distribution/reset.md @@ -59,7 +59,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/weibull_distribution.md b/reference/random/weibull_distribution.md index 398d98fc59..e920151b0e 100644 --- a/reference/random/weibull_distribution.md +++ b/reference/random/weibull_distribution.md @@ -121,7 +121,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/random/weibull_distribution/a.md b/reference/random/weibull_distribution/a.md index 880be3b679..abac8dd05b 100644 --- a/reference/random/weibull_distribution/a.md +++ b/reference/random/weibull_distribution/a.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/weibull_distribution/b.md b/reference/random/weibull_distribution/b.md index db4ca6a7e8..42992de818 100644 --- a/reference/random/weibull_distribution/b.md +++ b/reference/random/weibull_distribution/b.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/weibull_distribution/max.md b/reference/random/weibull_distribution/max.md index ac8488c3ee..ad682e131d 100644 --- a/reference/random/weibull_distribution/max.md +++ b/reference/random/weibull_distribution/max.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/weibull_distribution/min.md b/reference/random/weibull_distribution/min.md index e7de241b20..1a2c3dbfa8 100644 --- a/reference/random/weibull_distribution/min.md +++ b/reference/random/weibull_distribution/min.md @@ -43,7 +43,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/weibull_distribution/op_call.md b/reference/random/weibull_distribution/op_call.md index 71b51aeaa6..d197c467a5 100644 --- a/reference/random/weibull_distribution/op_call.md +++ b/reference/random/weibull_distribution/op_call.md @@ -84,7 +84,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/weibull_distribution/op_constructor.md b/reference/random/weibull_distribution/op_constructor.md index eeb34c7f9b..064cc65073 100644 --- a/reference/random/weibull_distribution/op_constructor.md +++ b/reference/random/weibull_distribution/op_constructor.md @@ -94,7 +94,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/weibull_distribution/op_equal.md b/reference/random/weibull_distribution/op_equal.md index 0129c15f44..34d15f1933 100644 --- a/reference/random/weibull_distribution/op_equal.md +++ b/reference/random/weibull_distribution/op_equal.md @@ -55,7 +55,7 @@ equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/weibull_distribution/op_istream.md b/reference/random/weibull_distribution/op_istream.md index c02900b8f7..2f6c9365d9 100644 --- a/reference/random/weibull_distribution/op_istream.md +++ b/reference/random/weibull_distribution/op_istream.md @@ -73,7 +73,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/weibull_distribution/op_not_equal.md b/reference/random/weibull_distribution/op_not_equal.md index 8b20b6c57e..88ad9fe668 100644 --- a/reference/random/weibull_distribution/op_not_equal.md +++ b/reference/random/weibull_distribution/op_not_equal.md @@ -55,7 +55,7 @@ not equal ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/weibull_distribution/op_ostream.md b/reference/random/weibull_distribution/op_ostream.md index c165df9c09..e9519683c9 100644 --- a/reference/random/weibull_distribution/op_ostream.md +++ b/reference/random/weibull_distribution/op_ostream.md @@ -52,7 +52,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/weibull_distribution/param.md b/reference/random/weibull_distribution/param.md index a6f29520c9..08050982ea 100644 --- a/reference/random/weibull_distribution/param.md +++ b/reference/random/weibull_distribution/param.md @@ -51,7 +51,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/weibull_distribution/reset.md b/reference/random/weibull_distribution/reset.md index 2b742cbc36..a44c101c94 100644 --- a/reference/random/weibull_distribution/reset.md +++ b/reference/random/weibull_distribution/reset.md @@ -61,7 +61,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.2 +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ranges.md b/reference/ranges.md index 4d4acd76bb..7cedda936f 100644 --- a/reference/ranges.md +++ b/reference/ranges.md @@ -436,10 +436,10 @@ range | adaptor(args...) - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 - [``](iterator.md) diff --git a/reference/ranges/all.md b/reference/ranges/all.md index f0d0da82cc..d26702c6cb 100644 --- a/reference/ranges/all.md +++ b/reference/ranges/all.md @@ -58,10 +58,10 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4892 24 Ranges library](https://timsong-cpp.github.io/cppwp/ranges) diff --git a/reference/ranges/as_const_view.md b/reference/ranges/as_const_view.md index 9a4832ccb6..53d93ab596 100644 --- a/reference/ranges/as_const_view.md +++ b/reference/ranges/as_const_view.md @@ -98,8 +98,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 diff --git a/reference/ranges/as_const_view/base.md b/reference/ranges/as_const_view/base.md index 1afffb6bb3..cd2d89fa70 100644 --- a/reference/ranges/as_const_view/base.md +++ b/reference/ranges/as_const_view/base.md @@ -63,8 +63,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 diff --git a/reference/ranges/as_const_view/begin.md b/reference/ranges/as_const_view/begin.md index 4a1ef49137..ccd9c8247c 100644 --- a/reference/ranges/as_const_view/begin.md +++ b/reference/ranges/as_const_view/begin.md @@ -65,8 +65,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 diff --git a/reference/ranges/as_const_view/end.md b/reference/ranges/as_const_view/end.md index 3783bdaadc..5b08c30cc1 100644 --- a/reference/ranges/as_const_view/end.md +++ b/reference/ranges/as_const_view/end.md @@ -61,8 +61,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 diff --git a/reference/ranges/as_const_view/op_constructor.md b/reference/ranges/as_const_view/op_constructor.md index 32832d8016..072c233cc9 100644 --- a/reference/ranges/as_const_view/op_constructor.md +++ b/reference/ranges/as_const_view/op_constructor.md @@ -52,8 +52,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 diff --git a/reference/ranges/as_const_view/op_deduction_guide.md b/reference/ranges/as_const_view/op_deduction_guide.md index 1a33d8f8f4..6223e704ba 100644 --- a/reference/ranges/as_const_view/op_deduction_guide.md +++ b/reference/ranges/as_const_view/op_deduction_guide.md @@ -54,8 +54,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 diff --git a/reference/ranges/as_const_view/size.md b/reference/ranges/as_const_view/size.md index d1739631bc..392911257e 100644 --- a/reference/ranges/as_const_view/size.md +++ b/reference/ranges/as_const_view/size.md @@ -1,65 +1,65 @@ -# size -* ranges[meta header] -* std::ranges[meta namespace] -* as_const_view[meta class] -* function[meta id-type] -* cpp23[meta cpp] - -```cpp -constexpr auto size() requires sized_range; // (1) -constexpr auto size() const requires sized_range; // (2) -``` -* sized_range[link /reference/ranges/sized_range.md] - -## 概要 - -`view`の要素数を取得する。 - -この関数で得られる`as_const_view`の要素数は、元のRange(`V`)の要素数と一致する。 - -## 戻り値 - -入力`view`(`V`)のオブジェクトを`base_`というメンバに保持するとして、(1)(2)どちらも - -```cpp -return ranges::size(base_); -``` -* size[link /reference/ranges/size.md] - -## 例 - -```cpp example -#include -#include -#include - -int main() { - std::vector vec = {1, 2, 3, 4, 5}; - - std::ranges::as_const_view acv{vec}; - - std::cout << acv.size() << '\n'; - std::cout << vec.size() << '\n'; -} -``` -* size[color ff0000] - -### 出力 - -``` -5 -5 -``` - -## バージョン -### 言語 -- C++23 - -### 処理系 -- [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 - -## 参照 - -- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) +# size +* ranges[meta header] +* std::ranges[meta namespace] +* as_const_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr auto size() requires sized_range; // (1) +constexpr auto size() const requires sized_range; // (2) +``` +* sized_range[link /reference/ranges/sized_range.md] + +## 概要 + +`view`の要素数を取得する。 + +この関数で得られる`as_const_view`の要素数は、元のRange(`V`)の要素数と一致する。 + +## 戻り値 + +入力`view`(`V`)のオブジェクトを`base_`というメンバに保持するとして、(1)(2)どちらも + +```cpp +return ranges::size(base_); +``` +* size[link /reference/ranges/size.md] + +## 例 + +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + std::ranges::as_const_view acv{vec}; + + std::cout << acv.size() << '\n'; + std::cout << vec.size() << '\n'; +} +``` +* size[color ff0000] + +### 出力 + +``` +5 +5 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) diff --git a/reference/ranges/basic_istream_view.md b/reference/ranges/basic_istream_view.md index c030b8bacc..4015db8e4d 100644 --- a/reference/ranges/basic_istream_view.md +++ b/reference/ranges/basic_istream_view.md @@ -181,10 +181,10 @@ namespace std::ranges { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 - [`istream_iterator`](/reference/iterator/istream_iterator.md): ストリームからデータを読み込む入力イテレータ diff --git a/reference/ranges/begin.md b/reference/ranges/begin.md index 3ea651f950..93263398b9 100644 --- a/reference/ranges/begin.md +++ b/reference/ranges/begin.md @@ -85,10 +85,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 - [`std::begin`](/reference/iterator/begin.md) diff --git a/reference/ranges/bidirectional_range.md b/reference/ranges/bidirectional_range.md index cb159731f8..8d79e74f0a 100644 --- a/reference/ranges/bidirectional_range.md +++ b/reference/ranges/bidirectional_range.md @@ -48,10 +48,10 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/borrowed_iterator_t.md b/reference/ranges/borrowed_iterator_t.md index f53d9fca07..b475184bcb 100644 --- a/reference/ranges/borrowed_iterator_t.md +++ b/reference/ranges/borrowed_iterator_t.md @@ -74,10 +74,10 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/borrowed_range.md b/reference/ranges/borrowed_range.md index 6ea3aaf0f0..2903e02baf 100644 --- a/reference/ranges/borrowed_range.md +++ b/reference/ranges/borrowed_range.md @@ -58,10 +58,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/borrowed_subrange_t.md b/reference/ranges/borrowed_subrange_t.md index 9e06a88c0e..0668d29e6b 100644 --- a/reference/ranges/borrowed_subrange_t.md +++ b/reference/ranges/borrowed_subrange_t.md @@ -70,10 +70,10 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/cartesian_product_view.md b/reference/ranges/cartesian_product_view.md index 5cffbca2c2..f4b3219308 100644 --- a/reference/ranges/cartesian_product_view.md +++ b/reference/ranges/cartesian_product_view.md @@ -149,8 +149,8 @@ int main() { - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 13.2 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 13.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ranges/cbegin.md b/reference/ranges/cbegin.md index 0953d768ef..0438c68a52 100644 --- a/reference/ranges/cbegin.md +++ b/reference/ranges/cbegin.md @@ -70,10 +70,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 - [`std::cbegin`](/reference/iterator/cbegin.md) diff --git a/reference/ranges/cdata.md b/reference/ranges/cdata.md index 1399209172..dff8fd6db4 100644 --- a/reference/ranges/cdata.md +++ b/reference/ranges/cdata.md @@ -72,10 +72,10 @@ array size:1 at 0x556ec23ba2b0 - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/cend.md b/reference/ranges/cend.md index dbbcbe1d15..39cae89367 100644 --- a/reference/ranges/cend.md +++ b/reference/ranges/cend.md @@ -68,10 +68,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 - [`std::cend`](/reference/iterator/cend.md) diff --git a/reference/ranges/chunk_by_view.md b/reference/ranges/chunk_by_view.md index 99ccd2650a..8ff94d4eb6 100644 --- a/reference/ranges/chunk_by_view.md +++ b/reference/ranges/chunk_by_view.md @@ -101,7 +101,7 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 14.0 +- [GCC](/implementation.md#gcc): 14.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ranges/chunk_view.md b/reference/ranges/chunk_view.md index 9bc6f8e590..6ca1a52501 100644 --- a/reference/ranges/chunk_view.md +++ b/reference/ranges/chunk_view.md @@ -146,7 +146,7 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 14.0 +- [GCC](/implementation.md#gcc): 14.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ranges/common_range.md b/reference/ranges/common_range.md index 689491fc1c..8fe68d450d 100644 --- a/reference/ranges/common_range.md +++ b/reference/ranges/common_range.md @@ -33,10 +33,10 @@ namespace std::ranges { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 diff --git a/reference/ranges/common_view.md b/reference/ranges/common_view.md index ec0c3c6e46..10213afb59 100644 --- a/reference/ranges/common_view.md +++ b/reference/ranges/common_view.md @@ -180,10 +180,10 @@ namespace std::ranges { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 diff --git a/reference/ranges/const_iterator_t.md b/reference/ranges/const_iterator_t.md index 183bca235e..a69c00ed18 100644 --- a/reference/ranges/const_iterator_t.md +++ b/reference/ranges/const_iterator_t.md @@ -41,8 +41,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 diff --git a/reference/ranges/const_sentinel_t.md b/reference/ranges/const_sentinel_t.md index e0ef6c9c88..7fe2311787 100644 --- a/reference/ranges/const_sentinel_t.md +++ b/reference/ranges/const_sentinel_t.md @@ -45,8 +45,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 diff --git a/reference/ranges/constant_range.md b/reference/ranges/constant_range.md index 4843aa1536..f621a0cd16 100644 --- a/reference/ranges/constant_range.md +++ b/reference/ranges/constant_range.md @@ -43,8 +43,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 diff --git a/reference/ranges/contiguous_range.md b/reference/ranges/contiguous_range.md index 381e7dd852..686b1e1307 100644 --- a/reference/ranges/contiguous_range.md +++ b/reference/ranges/contiguous_range.md @@ -59,10 +59,10 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/counted.md b/reference/ranges/counted.md index 379bb71630..b4a84f7fe9 100644 --- a/reference/ranges/counted.md +++ b/reference/ranges/counted.md @@ -68,10 +68,10 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/crbegin.md b/reference/ranges/crbegin.md index fe119a51d7..0df83f406e 100644 --- a/reference/ranges/crbegin.md +++ b/reference/ranges/crbegin.md @@ -97,10 +97,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 - [`std::crbegin`](/reference/iterator/crbegin.md) diff --git a/reference/ranges/crend.md b/reference/ranges/crend.md index bd3393e115..5e85208e05 100644 --- a/reference/ranges/crend.md +++ b/reference/ranges/crend.md @@ -97,10 +97,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 - [`std::crend`](/reference/iterator/crend.md) diff --git a/reference/ranges/dangling.md b/reference/ranges/dangling.md index 785115d3e7..3205939ca2 100644 --- a/reference/ranges/dangling.md +++ b/reference/ranges/dangling.md @@ -70,10 +70,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/data.md b/reference/ranges/data.md index f46a4ee852..6cad9c0bdd 100644 --- a/reference/ranges/data.md +++ b/reference/ranges/data.md @@ -67,10 +67,10 @@ array size:1 at 0x5596494f02b0 - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 - [`std::data`](/reference/iterator/data.md) diff --git a/reference/ranges/disable_sized_range.md b/reference/ranges/disable_sized_range.md index aac6512f31..d1e4fdb4c2 100644 --- a/reference/ranges/disable_sized_range.md +++ b/reference/ranges/disable_sized_range.md @@ -28,10 +28,10 @@ namespace std::ranges { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/drop_view.md b/reference/ranges/drop_view.md index 167b243a99..0d7fc58912 100644 --- a/reference/ranges/drop_view.md +++ b/reference/ranges/drop_view.md @@ -106,10 +106,10 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/drop_while_view.md b/reference/ranges/drop_while_view.md index e8f0da54b7..2c94c9965b 100644 --- a/reference/ranges/drop_while_view.md +++ b/reference/ranges/drop_while_view.md @@ -100,10 +100,10 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/elements_view.md b/reference/ranges/elements_view.md index 4526000614..edbb9e6588 100644 --- a/reference/ranges/elements_view.md +++ b/reference/ranges/elements_view.md @@ -162,10 +162,10 @@ three - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 - [`zip_view`](zip_view.md) elements_viewの逆(要素からタプルを作る) diff --git a/reference/ranges/empty.md b/reference/ranges/empty.md index 727f17e392..6db3ae67d7 100644 --- a/reference/ranges/empty.md +++ b/reference/ranges/empty.md @@ -69,10 +69,10 @@ false - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 - [`std::empty`](/reference/iterator/empty.md) diff --git a/reference/ranges/empty_view.md b/reference/ranges/empty_view.md index fa588adb76..14304e371d 100644 --- a/reference/ranges/empty_view.md +++ b/reference/ranges/empty_view.md @@ -91,10 +91,10 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/enable_borrowed_range.md b/reference/ranges/enable_borrowed_range.md index f6e3d44fde..3a4de6e656 100644 --- a/reference/ranges/enable_borrowed_range.md +++ b/reference/ranges/enable_borrowed_range.md @@ -39,10 +39,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/enable_view.md b/reference/ranges/enable_view.md index 4f9948c94f..888d827a62 100644 --- a/reference/ranges/enable_view.md +++ b/reference/ranges/enable_view.md @@ -63,10 +63,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/end.md b/reference/ranges/end.md index 6c02d6b453..2c53473a13 100644 --- a/reference/ranges/end.md +++ b/reference/ranges/end.md @@ -85,10 +85,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 - [`std::end`](/reference/iterator/end.md) diff --git a/reference/ranges/filter_view.md b/reference/ranges/filter_view.md index 215673df66..ff09dcee76 100644 --- a/reference/ranges/filter_view.md +++ b/reference/ranges/filter_view.md @@ -113,10 +113,10 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/forward_range.md b/reference/ranges/forward_range.md index 3c67b3b2af..e9597bc280 100644 --- a/reference/ranges/forward_range.md +++ b/reference/ranges/forward_range.md @@ -50,10 +50,10 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/input_range.md b/reference/ranges/input_range.md index 3d25375cfa..4de98643ec 100644 --- a/reference/ranges/input_range.md +++ b/reference/ranges/input_range.md @@ -46,10 +46,10 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/iota_view.md b/reference/ranges/iota_view.md index 00249329f7..8e1373da5d 100644 --- a/reference/ranges/iota_view.md +++ b/reference/ranges/iota_view.md @@ -189,10 +189,10 @@ FizzBuzz - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 - [`std::iota`](/reference/numeric/iota.md), [`std::ranges::iota`](/reference/numeric/ranges_iota.md): Rangeに先行評価で増加列を書き込む標準アルゴリズム関数 diff --git a/reference/ranges/iota_view/begin.md b/reference/ranges/iota_view/begin.md index 1ca5205a31..8c7e86c396 100644 --- a/reference/ranges/iota_view/begin.md +++ b/reference/ranges/iota_view/begin.md @@ -50,10 +50,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/iota_view/end.md b/reference/ranges/iota_view/end.md index e6fb5b4b31..617d10113a 100644 --- a/reference/ranges/iota_view/end.md +++ b/reference/ranges/iota_view/end.md @@ -62,10 +62,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/iota_view/iota_diff_t.md b/reference/ranges/iota_view/iota_diff_t.md index 04a4a78a2e..d8fc02712c 100644 --- a/reference/ranges/iota_view/iota_diff_t.md +++ b/reference/ranges/iota_view/iota_diff_t.md @@ -37,10 +37,10 @@ using _Iota_diff_t = conditional_t, - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/iota_view/iterator.md b/reference/ranges/iota_view/iterator.md index e59a769b3b..8c93dd333f 100644 --- a/reference/ranges/iota_view/iterator.md +++ b/reference/ranges/iota_view/iterator.md @@ -198,10 +198,10 @@ namespace std::ranges { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/iota_view/op_constructor.md b/reference/ranges/iota_view/op_constructor.md index b8327a6ebe..3bef32c0bf 100644 --- a/reference/ranges/iota_view/op_constructor.md +++ b/reference/ranges/iota_view/op_constructor.md @@ -73,10 +73,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/iota_view/op_deduction_guide.md b/reference/ranges/iota_view/op_deduction_guide.md index c337e2bf7c..e4066645c0 100644 --- a/reference/ranges/iota_view/op_deduction_guide.md +++ b/reference/ranges/iota_view/op_deduction_guide.md @@ -45,10 +45,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 - [C++17 クラステンプレートのテンプレート引数推論](/lang/cpp17/type_deduction_for_class_templates.md) diff --git a/reference/ranges/iota_view/sentinel.md b/reference/ranges/iota_view/sentinel.md index 01b83187a6..cc1e10536a 100644 --- a/reference/ranges/iota_view/sentinel.md +++ b/reference/ranges/iota_view/sentinel.md @@ -58,10 +58,10 @@ namespace std::ranges { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/iota_view/size.md b/reference/ranges/iota_view/size.md index abab7bdc27..9b7361f602 100644 --- a/reference/ranges/iota_view/size.md +++ b/reference/ranges/iota_view/size.md @@ -56,10 +56,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/iterator_t.md b/reference/ranges/iterator_t.md index 6c6bbf8ebc..b5a4b27645 100644 --- a/reference/ranges/iterator_t.md +++ b/reference/ranges/iterator_t.md @@ -37,10 +37,10 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/join_view.md b/reference/ranges/join_view.md index 43b8483f12..a9a3d5d340 100644 --- a/reference/ranges/join_view.md +++ b/reference/ranges/join_view.md @@ -104,10 +104,10 @@ h,e,l,l,o,w,o,r,l,d, - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 - [`join_with_view`](join_with_view.md) diff --git a/reference/ranges/join_with_view.md b/reference/ranges/join_with_view.md index 7e0fcfb80e..ed47370d6a 100644 --- a/reference/ranges/join_with_view.md +++ b/reference/ranges/join_with_view.md @@ -153,7 +153,7 @@ hello-C++23-world ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.2 +- [GCC](/implementation.md#gcc): 13.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ranges/lazy_split_view.md b/reference/ranges/lazy_split_view.md index 2464188f0a..da299f76e9 100644 --- a/reference/ranges/lazy_split_view.md +++ b/reference/ranges/lazy_split_view.md @@ -168,10 +168,10 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [P2210R2 Superior String Splitting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2210r2.html) diff --git a/reference/ranges/output_range.md b/reference/ranges/output_range.md index d0eef1bf15..77bceeaebc 100644 --- a/reference/ranges/output_range.md +++ b/reference/ranges/output_range.md @@ -54,10 +54,10 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/owning_view.md b/reference/ranges/owning_view.md index 2dd2519d9c..4fe88c5536 100644 --- a/reference/ranges/owning_view.md +++ b/reference/ranges/owning_view.md @@ -159,10 +159,10 @@ namespace std::ranges { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4892 24 Ranges library](https://timsong-cpp.github.io/cppwp/ranges) diff --git a/reference/ranges/random_access_range.md b/reference/ranges/random_access_range.md index af17b2a6b8..793f1f7ed0 100644 --- a/reference/ranges/random_access_range.md +++ b/reference/ranges/random_access_range.md @@ -50,10 +50,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/range.md b/reference/ranges/range.md index 919c122499..6b319a387a 100644 --- a/reference/ranges/range.md +++ b/reference/ranges/range.md @@ -63,10 +63,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/range_const_reference_t.md b/reference/ranges/range_const_reference_t.md index ae2fe2e014..c169356d49 100644 --- a/reference/ranges/range_const_reference_t.md +++ b/reference/ranges/range_const_reference_t.md @@ -41,8 +41,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 diff --git a/reference/ranges/range_difference_t.md b/reference/ranges/range_difference_t.md index 7b8f8b6f2c..6bcbb61759 100644 --- a/reference/ranges/range_difference_t.md +++ b/reference/ranges/range_difference_t.md @@ -38,10 +38,10 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/range_reference_t.md b/reference/ranges/range_reference_t.md index eaddfadec2..e0ae7ec67d 100644 --- a/reference/ranges/range_reference_t.md +++ b/reference/ranges/range_reference_t.md @@ -38,10 +38,10 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/range_rvalue_reference_t.md b/reference/ranges/range_rvalue_reference_t.md index f5bd318520..975e272bac 100644 --- a/reference/ranges/range_rvalue_reference_t.md +++ b/reference/ranges/range_rvalue_reference_t.md @@ -38,10 +38,10 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/range_size_t.md b/reference/ranges/range_size_t.md index 41af88e7c1..a7784a2e6e 100644 --- a/reference/ranges/range_size_t.md +++ b/reference/ranges/range_size_t.md @@ -38,10 +38,10 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/range_value_t.md b/reference/ranges/range_value_t.md index e29cf8a5bd..f7febe687f 100644 --- a/reference/ranges/range_value_t.md +++ b/reference/ranges/range_value_t.md @@ -38,10 +38,10 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/rbegin.md b/reference/ranges/rbegin.md index f20d4e5d67..71c0bcc9c7 100644 --- a/reference/ranges/rbegin.md +++ b/reference/ranges/rbegin.md @@ -98,10 +98,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 - [`std::rbegin`](/reference/iterator/rbegin.md) diff --git a/reference/ranges/ref_view.md b/reference/ranges/ref_view.md index dd73e17df4..9d9341dab1 100644 --- a/reference/ranges/ref_view.md +++ b/reference/ranges/ref_view.md @@ -147,10 +147,10 @@ namespace std::ranges { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/rend.md b/reference/ranges/rend.md index 2518b36225..042f4d95a0 100644 --- a/reference/ranges/rend.md +++ b/reference/ranges/rend.md @@ -100,10 +100,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 - [`std::rend`](/reference/iterator/rend.md) diff --git a/reference/ranges/reverse_view.md b/reference/ranges/reverse_view.md index 156a8224a0..1d799ae4a6 100644 --- a/reference/ranges/reverse_view.md +++ b/reference/ranges/reverse_view.md @@ -176,10 +176,10 @@ namespace std::ranges { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/sentinel_t.md b/reference/ranges/sentinel_t.md index de6df0df5a..30a8b813d9 100644 --- a/reference/ranges/sentinel_t.md +++ b/reference/ranges/sentinel_t.md @@ -38,10 +38,10 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/single_view.md b/reference/ranges/single_view.md index 618583cf88..0ec0b96e0f 100644 --- a/reference/ranges/single_view.md +++ b/reference/ranges/single_view.md @@ -142,10 +142,10 @@ namespace std::ranges { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/size.md b/reference/ranges/size.md index c00cb8463e..a16584c32f 100644 --- a/reference/ranges/size.md +++ b/reference/ranges/size.md @@ -68,10 +68,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 - [`std::size`](/reference/iterator/size.md) diff --git a/reference/ranges/sized_range.md b/reference/ranges/sized_range.md index 77e0f69288..c296a9af89 100644 --- a/reference/ranges/sized_range.md +++ b/reference/ranges/sized_range.md @@ -62,10 +62,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/slide_view.md b/reference/ranges/slide_view.md index 2fda30e348..7bcf4998b4 100644 --- a/reference/ranges/slide_view.md +++ b/reference/ranges/slide_view.md @@ -109,7 +109,7 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 14.0 +- [GCC](/implementation.md#gcc): 14.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ranges/split_view.md b/reference/ranges/split_view.md index cc16b95fb7..90c3ad58dc 100644 --- a/reference/ranges/split_view.md +++ b/reference/ranges/split_view.md @@ -114,10 +114,10 @@ world - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [P2210R2 Superior String Splitting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2210r2.html) diff --git a/reference/ranges/ssize.md b/reference/ranges/ssize.md index d39cc4155b..437092cd3e 100644 --- a/reference/ranges/ssize.md +++ b/reference/ranges/ssize.md @@ -59,10 +59,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 - [`std::ssize`](/reference/iterator/ssize.md) diff --git a/reference/ranges/stride_view.md b/reference/ranges/stride_view.md index 3735ceadb0..6f26792ce7 100644 --- a/reference/ranges/stride_view.md +++ b/reference/ranges/stride_view.md @@ -94,8 +94,8 @@ int main() { - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 13.2 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 13.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ranges/subrange.md b/reference/ranges/subrange.md index 510fddb0e3..7742b21a61 100644 --- a/reference/ranges/subrange.md +++ b/reference/ranges/subrange.md @@ -81,10 +81,10 @@ namespace std::ranges { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/subrange/advance.md b/reference/ranges/subrange/advance.md index d59f572529..f4e069ac62 100644 --- a/reference/ranges/subrange/advance.md +++ b/reference/ranges/subrange/advance.md @@ -89,10 +89,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/subrange/begin.md b/reference/ranges/subrange/begin.md index 3f4081cf9f..c243775f13 100644 --- a/reference/ranges/subrange/begin.md +++ b/reference/ranges/subrange/begin.md @@ -50,10 +50,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/subrange/empty.md b/reference/ranges/subrange/empty.md index e956c41d1a..c685254405 100644 --- a/reference/ranges/subrange/empty.md +++ b/reference/ranges/subrange/empty.md @@ -44,10 +44,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/subrange/enable_borrowed_range.md b/reference/ranges/subrange/enable_borrowed_range.md index 7bbff5362b..63eedce175 100644 --- a/reference/ranges/subrange/enable_borrowed_range.md +++ b/reference/ranges/subrange/enable_borrowed_range.md @@ -40,10 +40,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/subrange/end.md b/reference/ranges/subrange/end.md index db9e31ada6..f509c2e67e 100644 --- a/reference/ranges/subrange/end.md +++ b/reference/ranges/subrange/end.md @@ -45,10 +45,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/subrange/get.md b/reference/ranges/subrange/get.md index ed5ba4cc7b..c53240ac89 100644 --- a/reference/ranges/subrange/get.md +++ b/reference/ranges/subrange/get.md @@ -66,10 +66,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/subrange/next.md b/reference/ranges/subrange/next.md index 9091900f52..413c85af1c 100644 --- a/reference/ranges/subrange/next.md +++ b/reference/ranges/subrange/next.md @@ -76,10 +76,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/subrange/op_constructor.md b/reference/ranges/subrange/op_constructor.md index 86a51709c4..522eeffd58 100644 --- a/reference/ranges/subrange/op_constructor.md +++ b/reference/ranges/subrange/op_constructor.md @@ -122,10 +122,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/subrange/op_deduction_guide.md b/reference/ranges/subrange/op_deduction_guide.md index 8b9be3a373..44eb62c083 100644 --- a/reference/ranges/subrange/op_deduction_guide.md +++ b/reference/ranges/subrange/op_deduction_guide.md @@ -63,10 +63,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 - [C++17 クラステンプレートのテンプレート引数推論](/lang/cpp17/type_deduction_for_class_templates.md) diff --git a/reference/ranges/subrange/op_pairlike.md b/reference/ranges/subrange/op_pairlike.md index 7f17e9929b..4ca2a1de99 100644 --- a/reference/ranges/subrange/op_pairlike.md +++ b/reference/ranges/subrange/op_pairlike.md @@ -49,10 +49,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/subrange/prev.md b/reference/ranges/subrange/prev.md index 416d1b073e..a07ae84bfd 100644 --- a/reference/ranges/subrange/prev.md +++ b/reference/ranges/subrange/prev.md @@ -62,10 +62,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/subrange/size.md b/reference/ranges/subrange/size.md index 1f1b13d272..4eddd9763c 100644 --- a/reference/ranges/subrange/size.md +++ b/reference/ranges/subrange/size.md @@ -50,10 +50,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/subrange/tuple_element.md b/reference/ranges/subrange/tuple_element.md index 18de89212f..4d692b184f 100644 --- a/reference/ranges/subrange/tuple_element.md +++ b/reference/ranges/subrange/tuple_element.md @@ -66,10 +66,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/subrange/tuple_size.md b/reference/ranges/subrange/tuple_size.md index 320bbef5a5..58d6e91873 100644 --- a/reference/ranges/subrange/tuple_size.md +++ b/reference/ranges/subrange/tuple_size.md @@ -44,10 +44,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/subrange_kind.md b/reference/ranges/subrange_kind.md index 455e9fc0fd..88285aba6a 100644 --- a/reference/ranges/subrange_kind.md +++ b/reference/ranges/subrange_kind.md @@ -18,10 +18,10 @@ namespace std::ranges { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/take_view.md b/reference/ranges/take_view.md index 7fd51bd91b..c0a154b4f5 100644 --- a/reference/ranges/take_view.md +++ b/reference/ranges/take_view.md @@ -170,10 +170,10 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/take_while_view.md b/reference/ranges/take_while_view.md index 6d6514cb89..4a26432ef9 100644 --- a/reference/ranges/take_while_view.md +++ b/reference/ranges/take_while_view.md @@ -100,10 +100,10 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/to.md b/reference/ranges/to.md index 73ac8d849f..7890d91670 100644 --- a/reference/ranges/to.md +++ b/reference/ranges/to.md @@ -208,7 +208,7 @@ int main() { - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 19.0 (at least) +- [Clang](/implementation.md#clang): 19.0 (at least) [mark verified] - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ranges/transform_view.md b/reference/ranges/transform_view.md index b7fef939c7..cefa5c55cd 100644 --- a/reference/ranges/transform_view.md +++ b/reference/ranges/transform_view.md @@ -132,10 +132,10 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 - [`std::transform`](/reference/algorithm/transform.md), [`std::ranges::transform`](/reference/algorithm/ranges_transform.md): Rangeの要素に先行評価で関数を適用する標準アルゴリズム関数 diff --git a/reference/ranges/view.md b/reference/ranges/view.md index ac2b10319d..2686333bb2 100644 --- a/reference/ranges/view.md +++ b/reference/ranges/view.md @@ -68,10 +68,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/view_base.md b/reference/ranges/view_base.md index 5c92cba02d..52b272dc69 100644 --- a/reference/ranges/view_base.md +++ b/reference/ranges/view_base.md @@ -42,10 +42,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/view_interface.md b/reference/ranges/view_interface.md index 505a2706f0..4d39635ebb 100644 --- a/reference/ranges/view_interface.md +++ b/reference/ranges/view_interface.md @@ -46,10 +46,10 @@ namespace std::ranges { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 diff --git a/reference/ranges/view_interface/back.md b/reference/ranges/view_interface/back.md index d8b255c873..ab75247776 100644 --- a/reference/ranges/view_interface/back.md +++ b/reference/ranges/view_interface/back.md @@ -45,10 +45,10 @@ Rangeの末尾の要素を取得する。 - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/view_interface/cbegin.md b/reference/ranges/view_interface/cbegin.md index e02a0de9ed..39c4b302d7 100644 --- a/reference/ranges/view_interface/cbegin.md +++ b/reference/ranges/view_interface/cbegin.md @@ -37,8 +37,8 @@ return ranges::cbegin(derived()); ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 diff --git a/reference/ranges/view_interface/cend.md b/reference/ranges/view_interface/cend.md index 78325c7093..5c652bc215 100644 --- a/reference/ranges/view_interface/cend.md +++ b/reference/ranges/view_interface/cend.md @@ -37,8 +37,8 @@ return ranges::cend(derived()); ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 diff --git a/reference/ranges/view_interface/data.md b/reference/ranges/view_interface/data.md index d5102ee1e8..d42c3a64f9 100644 --- a/reference/ranges/view_interface/data.md +++ b/reference/ranges/view_interface/data.md @@ -43,10 +43,10 @@ to_address(ranges::begin(derived())); - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/view_interface/empty.md b/reference/ranges/view_interface/empty.md index 268537a793..3ed312c3e5 100644 --- a/reference/ranges/view_interface/empty.md +++ b/reference/ranges/view_interface/empty.md @@ -42,10 +42,10 @@ ranges::begin(derived()) == ranges::end(derived()) - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/view_interface/front.md b/reference/ranges/view_interface/front.md index d884d2d451..d7b45e158c 100644 --- a/reference/ranges/view_interface/front.md +++ b/reference/ranges/view_interface/front.md @@ -43,10 +43,10 @@ Rangeの先頭の要素を取得する。 - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/view_interface/op_at.md b/reference/ranges/view_interface/op_at.md index c0ace2c687..c52ada1e10 100644 --- a/reference/ranges/view_interface/op_at.md +++ b/reference/ranges/view_interface/op_at.md @@ -38,10 +38,10 @@ ranges::begin(derived())[n]; - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/view_interface/op_bool.md b/reference/ranges/view_interface/op_bool.md index 5a33bf4737..d02e69d765 100644 --- a/reference/ranges/view_interface/op_bool.md +++ b/reference/ranges/view_interface/op_bool.md @@ -38,10 +38,10 @@ Rangeが空かどうかを判定する。 - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/view_interface/size.md b/reference/ranges/view_interface/size.md index e23455667a..73bbe46b1c 100644 --- a/reference/ranges/view_interface/size.md +++ b/reference/ranges/view_interface/size.md @@ -44,10 +44,10 @@ ranges::end(derived()) - ranges::begin(derived()); - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/viewable_range.md b/reference/ranges/viewable_range.md index 2ec364d469..0c4d05d169 100644 --- a/reference/ranges/viewable_range.md +++ b/reference/ranges/viewable_range.md @@ -43,10 +43,10 @@ Rangeアダプタを適用するには、`viewable_range`である必要があ - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 13.0.0 -- [GCC](/implementation.md#gcc): 10.1.0 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) diff --git a/reference/ranges/zip_view.md b/reference/ranges/zip_view.md index bfa7f1951b..b55e45a004 100644 --- a/reference/ranges/zip_view.md +++ b/reference/ranges/zip_view.md @@ -131,8 +131,8 @@ int main() { - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0 -- [GCC](/implementation.md#gcc): 13.2 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 13.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ratio/ratio.md b/reference/ratio/ratio.md index 593f1bd029..d183d239fb 100644 --- a/reference/ratio/ratio.md +++ b/reference/ratio/ratio.md @@ -52,8 +52,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.4.7 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ratio/ratio_add.md b/reference/ratio/ratio_add.md index 42a100ec50..003cb7278e 100644 --- a/reference/ratio/ratio_add.md +++ b/reference/ratio/ratio_add.md @@ -48,8 +48,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.6.4 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.6.4 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ratio/ratio_divide.md b/reference/ratio/ratio_divide.md index 36c53f13d4..8147d02da3 100644 --- a/reference/ratio/ratio_divide.md +++ b/reference/ratio/ratio_divide.md @@ -48,8 +48,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.6.4 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.6.4 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ratio/ratio_equal.md b/reference/ratio/ratio_equal.md index 73d4f0b70c..77885ddb37 100644 --- a/reference/ratio/ratio_equal.md +++ b/reference/ratio/ratio_equal.md @@ -47,8 +47,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.4.7 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ratio/ratio_greater.md b/reference/ratio/ratio_greater.md index cbd2a76be5..39651f6652 100644 --- a/reference/ratio/ratio_greater.md +++ b/reference/ratio/ratio_greater.md @@ -47,8 +47,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.4.7 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ratio/ratio_greater_equal.md b/reference/ratio/ratio_greater_equal.md index 91472e8c2f..1ad6acc1f2 100644 --- a/reference/ratio/ratio_greater_equal.md +++ b/reference/ratio/ratio_greater_equal.md @@ -47,8 +47,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.4.7 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ratio/ratio_less.md b/reference/ratio/ratio_less.md index faf532fba1..4eb50668b3 100644 --- a/reference/ratio/ratio_less.md +++ b/reference/ratio/ratio_less.md @@ -49,8 +49,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.4.7 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ratio/ratio_less_equal.md b/reference/ratio/ratio_less_equal.md index e02139c9a9..c92b769956 100644 --- a/reference/ratio/ratio_less_equal.md +++ b/reference/ratio/ratio_less_equal.md @@ -47,8 +47,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.4.7 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ratio/ratio_multiply.md b/reference/ratio/ratio_multiply.md index ef9a5c30ab..056b5711e9 100644 --- a/reference/ratio/ratio_multiply.md +++ b/reference/ratio/ratio_multiply.md @@ -79,8 +79,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.6.4 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.6.4 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ratio/ratio_not_equal.md b/reference/ratio/ratio_not_equal.md index a26164230c..f7c2ff4d86 100644 --- a/reference/ratio/ratio_not_equal.md +++ b/reference/ratio/ratio_not_equal.md @@ -47,8 +47,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.4.7 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ratio/ratio_subtract.md b/reference/ratio/ratio_subtract.md index 97b26ccfdf..8f04dab8f2 100644 --- a/reference/ratio/ratio_subtract.md +++ b/reference/ratio/ratio_subtract.md @@ -48,8 +48,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.6.4 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.6.4 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ratio/si_prefix.md b/reference/ratio/si_prefix.md index f4f6cf25ca..a3fcae033a 100644 --- a/reference/ratio/si_prefix.md +++ b/reference/ratio/si_prefix.md @@ -113,8 +113,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.4.7 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? ### 備考 diff --git a/reference/regex/basic_regex.md b/reference/regex/basic_regex.md index cebf18db58..5d7c9fdc55 100644 --- a/reference/regex/basic_regex.md +++ b/reference/regex/basic_regex.md @@ -144,8 +144,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 4.9.2, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/basic_regex/assign.md b/reference/regex/basic_regex/assign.md index 04eca5af70..eb2bf8bebc 100644 --- a/reference/regex/basic_regex/assign.md +++ b/reference/regex/basic_regex/assign.md @@ -121,8 +121,8 @@ true - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 4.9.2, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/basic_regex/flags.md b/reference/regex/basic_regex/flags.md index 5b202d95d3..1abb19e9f1 100644 --- a/reference/regex/basic_regex/flags.md +++ b/reference/regex/basic_regex/flags.md @@ -73,7 +73,7 @@ egrep is not set - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 4.9.2, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/basic_regex/getloc.md b/reference/regex/basic_regex/getloc.md index 6cc7514713..6a640c7da3 100644 --- a/reference/regex/basic_regex/getloc.md +++ b/reference/regex/basic_regex/getloc.md @@ -55,7 +55,7 @@ true - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 4.9.2, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/basic_regex/imbue.md b/reference/regex/basic_regex/imbue.md index a7eb1507ca..ac65546dd0 100644 --- a/reference/regex/basic_regex/imbue.md +++ b/reference/regex/basic_regex/imbue.md @@ -70,8 +70,8 @@ true - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 4.9.2, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/basic_regex/mark_count.md b/reference/regex/basic_regex/mark_count.md index 129c23703a..e4e7de5052 100644 --- a/reference/regex/basic_regex/mark_count.md +++ b/reference/regex/basic_regex/mark_count.md @@ -49,7 +49,7 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 4.9.2, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/basic_regex/op_assign.md b/reference/regex/basic_regex/op_assign.md index 8427200973..d039241b4a 100644 --- a/reference/regex/basic_regex/op_assign.md +++ b/reference/regex/basic_regex/op_assign.md @@ -89,8 +89,8 @@ true - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 4.9.2, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/basic_regex/op_constructor.md b/reference/regex/basic_regex/op_constructor.md index 0019e12b03..2b2e0b702a 100644 --- a/reference/regex/basic_regex/op_constructor.md +++ b/reference/regex/basic_regex/op_constructor.md @@ -134,8 +134,8 @@ false - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 4.9.2, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/basic_regex/op_deduction_guide.md b/reference/regex/basic_regex/op_deduction_guide.md index 695731c270..1e638cb323 100644 --- a/reference/regex/basic_regex/op_deduction_guide.md +++ b/reference/regex/basic_regex/op_deduction_guide.md @@ -54,7 +54,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/basic_regex/op_destructor.md b/reference/regex/basic_regex/op_destructor.md index f04eb82bc9..b8325e09cc 100644 --- a/reference/regex/basic_regex/op_destructor.md +++ b/reference/regex/basic_regex/op_destructor.md @@ -48,7 +48,7 @@ true - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 4.9.2, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/basic_regex/swap.md b/reference/regex/basic_regex/swap.md index 35d4ca605d..c4d25f5a20 100644 --- a/reference/regex/basic_regex/swap.md +++ b/reference/regex/basic_regex/swap.md @@ -98,7 +98,7 @@ suffix:' 123 def ' - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 4.9.2, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/basic_regex/swap_free.md b/reference/regex/basic_regex/swap_free.md index 4c3314dfc1..ea047ce684 100644 --- a/reference/regex/basic_regex/swap_free.md +++ b/reference/regex/basic_regex/swap_free.md @@ -98,7 +98,7 @@ suffix:' 123 def ' - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 4.9.2, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/match_results.md b/reference/regex/match_results.md index c6d15df401..468205cf51 100644 --- a/reference/regex/match_results.md +++ b/reference/regex/match_results.md @@ -187,7 +187,7 @@ The C++14 is very cool!! - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 4.9.2, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/match_results/begin.md b/reference/regex/match_results/begin.md index 9e4c47958a..fca6c19df5 100644 --- a/reference/regex/match_results/begin.md +++ b/reference/regex/match_results/begin.md @@ -65,7 +65,7 @@ str() = 'defgh', range = [10, 15), matched = true - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/match_results/cbegin.md b/reference/regex/match_results/cbegin.md index b7fe2f1d77..1ad38a906f 100644 --- a/reference/regex/match_results/cbegin.md +++ b/reference/regex/match_results/cbegin.md @@ -65,8 +65,8 @@ str() = 'defgh', range = [10, 15), matched = true - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/match_results/cend.md b/reference/regex/match_results/cend.md index d6ed8778b1..5ae928b7f1 100644 --- a/reference/regex/match_results/cend.md +++ b/reference/regex/match_results/cend.md @@ -63,8 +63,8 @@ str() = 'defgh', range = [10, 15), matched = true - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/match_results/empty.md b/reference/regex/match_results/empty.md index 5411842ff5..b3e0b22f6f 100644 --- a/reference/regex/match_results/empty.md +++ b/reference/regex/match_results/empty.md @@ -75,8 +75,8 @@ match:ready = true, empty = false - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/match_results/end.md b/reference/regex/match_results/end.md index 6b1debc640..db25b96f44 100644 --- a/reference/regex/match_results/end.md +++ b/reference/regex/match_results/end.md @@ -64,7 +64,7 @@ str() = 'defgh', range = [10, 15), matched = true - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/match_results/format.md b/reference/regex/match_results/format.md index 6b9e056c5c..2c8fe5e42c 100644 --- a/reference/regex/match_results/format.md +++ b/reference/regex/match_results/format.md @@ -94,7 +94,7 @@ abcdef [123] - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/match_results/get_allocator.md b/reference/regex/match_results/get_allocator.md index bf972191d5..87a8d1a081 100644 --- a/reference/regex/match_results/get_allocator.md +++ b/reference/regex/match_results/get_allocator.md @@ -110,8 +110,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/match_results/length.md b/reference/regex/match_results/length.md index a8535b077b..307c715a3d 100644 --- a/reference/regex/match_results/length.md +++ b/reference/regex/match_results/length.md @@ -64,7 +64,7 @@ str(3) = 'defgh', length(3) = 5 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/match_results/max_size.md b/reference/regex/match_results/max_size.md index ff868536b5..db7f701fa9 100644 --- a/reference/regex/match_results/max_size.md +++ b/reference/regex/match_results/max_size.md @@ -46,7 +46,7 @@ max_size = 768614336404564650 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/match_results/op_assign.md b/reference/regex/match_results/op_assign.md index 020732717c..40465f41aa 100644 --- a/reference/regex/match_results/op_assign.md +++ b/reference/regex/match_results/op_assign.md @@ -130,8 +130,8 @@ suffix:' ' - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/match_results/op_at.md b/reference/regex/match_results/op_at.md index e898e412d0..a2b593f2ad 100644 --- a/reference/regex/match_results/op_at.md +++ b/reference/regex/match_results/op_at.md @@ -73,7 +73,7 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/match_results/op_constructor.md b/reference/regex/match_results/op_constructor.md index 28b7be2210..a7f503564b 100644 --- a/reference/regex/match_results/op_constructor.md +++ b/reference/regex/match_results/op_constructor.md @@ -145,8 +145,8 @@ suffix:' ' - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/match_results/op_destructor.md b/reference/regex/match_results/op_destructor.md index 555d61b798..b099dbacde 100644 --- a/reference/regex/match_results/op_destructor.md +++ b/reference/regex/match_results/op_destructor.md @@ -26,7 +26,7 @@ - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 4.9.2, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/match_results/op_equal.md b/reference/regex/match_results/op_equal.md index f56b103713..0183158d8a 100644 --- a/reference/regex/match_results/op_equal.md +++ b/reference/regex/match_results/op_equal.md @@ -85,7 +85,7 @@ true - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/match_results/op_not_equal.md b/reference/regex/match_results/op_not_equal.md index 1c9deab96c..f6693dcddf 100644 --- a/reference/regex/match_results/op_not_equal.md +++ b/reference/regex/match_results/op_not_equal.md @@ -76,8 +76,8 @@ false - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/match_results/position.md b/reference/regex/match_results/position.md index 24c7701596..c1250c893b 100644 --- a/reference/regex/match_results/position.md +++ b/reference/regex/match_results/position.md @@ -65,7 +65,7 @@ str(3) = 'defgh', position(3) = 10 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/match_results/prefix.md b/reference/regex/match_results/prefix.md index dcac90ba10..faf6283ba3 100644 --- a/reference/regex/match_results/prefix.md +++ b/reference/regex/match_results/prefix.md @@ -127,7 +127,7 @@ prefix(): str() = ' ', range = [3, 4), matched = true - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/match_results/ready.md b/reference/regex/match_results/ready.md index 0cd4f3ed07..5905cadc87 100644 --- a/reference/regex/match_results/ready.md +++ b/reference/regex/match_results/ready.md @@ -73,7 +73,7 @@ match:ready = true, empty = false - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/match_results/size.md b/reference/regex/match_results/size.md index a5e7c660d5..98b652e6de 100644 --- a/reference/regex/match_results/size.md +++ b/reference/regex/match_results/size.md @@ -80,7 +80,7 @@ match:ready = true, size = 4 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/match_results/str.md b/reference/regex/match_results/str.md index 7bf4d1dfba..809d866b50 100644 --- a/reference/regex/match_results/str.md +++ b/reference/regex/match_results/str.md @@ -64,7 +64,7 @@ str(3) = 'defgh', length(3) = 5 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/match_results/suffix.md b/reference/regex/match_results/suffix.md index d4c608ccf1..eff978312b 100644 --- a/reference/regex/match_results/suffix.md +++ b/reference/regex/match_results/suffix.md @@ -127,7 +127,7 @@ suffix(): str() = '', range = [8, 8), matched = false - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/match_results/swap.md b/reference/regex/match_results/swap.md index 7d177add32..8ca13d1375 100644 --- a/reference/regex/match_results/swap.md +++ b/reference/regex/match_results/swap.md @@ -87,7 +87,7 @@ abc - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/match_results/swap_free.md b/reference/regex/match_results/swap_free.md index 2f5c295186..9579cf93b0 100644 --- a/reference/regex/match_results/swap_free.md +++ b/reference/regex/match_results/swap_free.md @@ -86,7 +86,7 @@ abc - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/regex_constants/error_type.md b/reference/regex/regex_constants/error_type.md index 1c393e66f7..afd8b85451 100644 --- a/reference/regex/regex_constants/error_type.md +++ b/reference/regex/regex_constants/error_type.md @@ -68,8 +68,8 @@ namespace regex_constants { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 4.9.2, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/regex_constants/match_flag_type.md b/reference/regex/regex_constants/match_flag_type.md index 75eea15352..1233090d4a 100644 --- a/reference/regex/regex_constants/match_flag_type.md +++ b/reference/regex/regex_constants/match_flag_type.md @@ -68,8 +68,8 @@ namespace regex_constants{ - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 4.9.2, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/regex_constants/syntax_option_type.md b/reference/regex/regex_constants/syntax_option_type.md index 529566bef4..fd3eaa8405 100644 --- a/reference/regex/regex_constants/syntax_option_type.md +++ b/reference/regex/regex_constants/syntax_option_type.md @@ -67,8 +67,8 @@ namespace regex_constants { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 4.9.2, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/regex_error.md b/reference/regex/regex_error.md index f0423cd39f..c518689156 100644 --- a/reference/regex/regex_error.md +++ b/reference/regex/regex_error.md @@ -95,8 +95,8 @@ The expression contained mismatched ( and ). - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/regex/regex_error/code.md b/reference/regex/regex_error/code.md index 939fd7a6c7..d94c6be26a 100644 --- a/reference/regex/regex_error/code.md +++ b/reference/regex/regex_error/code.md @@ -47,7 +47,7 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/regex_error/op_constructor.md b/reference/regex/regex_error/op_constructor.md index 908dc6586f..3da9d03a21 100644 --- a/reference/regex/regex_error/op_constructor.md +++ b/reference/regex/regex_error/op_constructor.md @@ -37,7 +37,7 @@ Segmentation fault - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/regex_iterator.md b/reference/regex/regex_iterator.md index b26eb95863..6afd97a34a 100644 --- a/reference/regex/regex_iterator.md +++ b/reference/regex/regex_iterator.md @@ -142,8 +142,8 @@ position = 13, length = 3, str = '999' - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/regex/regex_iterator/op_arrow.md b/reference/regex/regex_iterator/op_arrow.md index 96c1203607..fcbc5761c3 100644 --- a/reference/regex/regex_iterator/op_arrow.md +++ b/reference/regex/regex_iterator/op_arrow.md @@ -61,8 +61,8 @@ prefix = 'def', str = '456', suffix = 'ghi' - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/regex_iterator/op_assign.md b/reference/regex/regex_iterator/op_assign.md index eefcc6a5d5..a3a2666739 100644 --- a/reference/regex/regex_iterator/op_assign.md +++ b/reference/regex/regex_iterator/op_assign.md @@ -74,8 +74,8 @@ position = 15, length = 3, str = '333', prefix = '+++', suffix = '---' - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/regex_iterator/op_constructor.md b/reference/regex/regex_iterator/op_constructor.md index 4d64e48121..f5bfb08810 100644 --- a/reference/regex/regex_iterator/op_constructor.md +++ b/reference/regex/regex_iterator/op_constructor.md @@ -78,8 +78,8 @@ match:11 - C++11(一部 C++14) ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/regex_iterator/op_deref.md b/reference/regex/regex_iterator/op_deref.md index 8608cd490e..6366635bce 100644 --- a/reference/regex/regex_iterator/op_deref.md +++ b/reference/regex/regex_iterator/op_deref.md @@ -62,8 +62,8 @@ prefix = 'def', str = '456', suffix = 'ghi' - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/regex_iterator/op_equal.md b/reference/regex/regex_iterator/op_equal.md index 6a55cd2eb3..5a241a5cf5 100644 --- a/reference/regex/regex_iterator/op_equal.md +++ b/reference/regex/regex_iterator/op_equal.md @@ -75,8 +75,8 @@ it2:'1'(3, 4) - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/regex_iterator/op_increment.md b/reference/regex/regex_iterator/op_increment.md index e01e94fc6a..91c893e18d 100644 --- a/reference/regex/regex_iterator/op_increment.md +++ b/reference/regex/regex_iterator/op_increment.md @@ -94,8 +94,8 @@ position = 9, length = 0, str = '', prefix = '' - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/regex_iterator/op_not_equal.md b/reference/regex/regex_iterator/op_not_equal.md index 4392728b22..ef656011b4 100644 --- a/reference/regex/regex_iterator/op_not_equal.md +++ b/reference/regex/regex_iterator/op_not_equal.md @@ -66,8 +66,8 @@ it2:'1'(1, 2) - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/regex_match.md b/reference/regex/regex_match.md index fc96f351b0..b39d2ef565 100644 --- a/reference/regex/regex_match.md +++ b/reference/regex/regex_match.md @@ -196,8 +196,8 @@ str = 'abc123def', position = 0 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 4.9.2, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/regex_replace.md b/reference/regex/regex_replace.md index 9f16da580f..1b131f713f 100644 --- a/reference/regex/regex_replace.md +++ b/reference/regex/regex_replace.md @@ -237,8 +237,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 4.9.2, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/regex_search.md b/reference/regex/regex_search.md index c8de30af69..cd0a109184 100644 --- a/reference/regex/regex_search.md +++ b/reference/regex/regex_search.md @@ -197,8 +197,8 @@ str = '123', position = 3 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 4.9.2, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/regex_token_iterator.md b/reference/regex/regex_token_iterator.md index 85196ce387..b16e4c13f1 100644 --- a/reference/regex/regex_token_iterator.md +++ b/reference/regex/regex_token_iterator.md @@ -183,8 +183,8 @@ match range = (67, 73), str = 'value3' - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/regex/regex_token_iterator/op_arrow.md b/reference/regex/regex_token_iterator/op_arrow.md index c219609dc0..0916093f29 100644 --- a/reference/regex/regex_token_iterator/op_arrow.md +++ b/reference/regex/regex_token_iterator/op_arrow.md @@ -67,8 +67,8 @@ match range = (67, 73), str = 'value3' - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/regex_token_iterator/op_assign.md b/reference/regex/regex_token_iterator/op_assign.md index 977ea30c21..82f21cac78 100644 --- a/reference/regex/regex_token_iterator/op_assign.md +++ b/reference/regex/regex_token_iterator/op_assign.md @@ -80,8 +80,8 @@ match range = (67, 73), str = 'value3' - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/regex_token_iterator/op_constructor.md b/reference/regex/regex_token_iterator/op_constructor.md index 151d8038a6..3f9403e0b2 100644 --- a/reference/regex/regex_token_iterator/op_constructor.md +++ b/reference/regex/regex_token_iterator/op_constructor.md @@ -154,8 +154,8 @@ match range = (67, 73), str = 'value3' - C++11(一部 C++14) ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/regex_token_iterator/op_deref.md b/reference/regex/regex_token_iterator/op_deref.md index 4e536bd91f..c27ceb510e 100644 --- a/reference/regex/regex_token_iterator/op_deref.md +++ b/reference/regex/regex_token_iterator/op_deref.md @@ -68,8 +68,8 @@ match range = (67, 73), str = 'value3' - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/regex_token_iterator/op_equal.md b/reference/regex/regex_token_iterator/op_equal.md index 934ba0d3ce..f11dbbd05f 100644 --- a/reference/regex/regex_token_iterator/op_equal.md +++ b/reference/regex/regex_token_iterator/op_equal.md @@ -78,8 +78,8 @@ match range = (53, 64), str = 'enumerator2' - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/regex_token_iterator/op_increment.md b/reference/regex/regex_token_iterator/op_increment.md index ca5afd0335..3a70f33363 100644 --- a/reference/regex/regex_token_iterator/op_increment.md +++ b/reference/regex/regex_token_iterator/op_increment.md @@ -103,8 +103,8 @@ match range = (73, 77), str = ', };' - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/regex_token_iterator/op_not_equal.md b/reference/regex/regex_token_iterator/op_not_equal.md index 4765f6dfbd..85f09568fd 100644 --- a/reference/regex/regex_token_iterator/op_not_equal.md +++ b/reference/regex/regex_token_iterator/op_not_equal.md @@ -70,8 +70,8 @@ match range = (31, 42), str = 'enumerator1' - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/regex_traits.md b/reference/regex/regex_traits.md index 53a4e57774..fba5f7edcc 100644 --- a/reference/regex/regex_traits.md +++ b/reference/regex/regex_traits.md @@ -98,8 +98,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 4.9.2, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/regex_traits/getloc.md b/reference/regex/regex_traits/getloc.md index d80897e5d7..bb0bbde274 100644 --- a/reference/regex/regex_traits/getloc.md +++ b/reference/regex/regex_traits/getloc.md @@ -48,8 +48,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 4.9.2, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/regex_traits/imbue.md b/reference/regex/regex_traits/imbue.md index e9a7c6bf41..6cb4babbbf 100644 --- a/reference/regex/regex_traits/imbue.md +++ b/reference/regex/regex_traits/imbue.md @@ -47,8 +47,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 4.9.2, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/regex_traits/isctype.md b/reference/regex/regex_traits/isctype.md index 0e89df1f37..1c299d97cd 100644 --- a/reference/regex/regex_traits/isctype.md +++ b/reference/regex/regex_traits/isctype.md @@ -57,8 +57,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 4.9.2, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/regex_traits/length.md b/reference/regex/regex_traits/length.md index db4decb9b3..5929a0e030 100644 --- a/reference/regex/regex_traits/length.md +++ b/reference/regex/regex_traits/length.md @@ -46,8 +46,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 4.9.2, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/regex_traits/lookup_classname.md b/reference/regex/regex_traits/lookup_classname.md index d0f69ecae9..adcebf00cb 100644 --- a/reference/regex/regex_traits/lookup_classname.md +++ b/reference/regex/regex_traits/lookup_classname.md @@ -86,8 +86,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 4.9.2, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/regex_traits/lookup_collatename.md b/reference/regex/regex_traits/lookup_collatename.md index 6c44861e52..d2b7a366f8 100644 --- a/reference/regex/regex_traits/lookup_collatename.md +++ b/reference/regex/regex_traits/lookup_collatename.md @@ -52,8 +52,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 5.1.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 5.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/regex_traits/op_constructor.md b/reference/regex/regex_traits/op_constructor.md index 7bc7282e9b..d5fafff3a2 100644 --- a/reference/regex/regex_traits/op_constructor.md +++ b/reference/regex/regex_traits/op_constructor.md @@ -38,8 +38,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 4.9.2, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/regex_traits/transform.md b/reference/regex/regex_traits/transform.md index 05333044d6..70ca006311 100644 --- a/reference/regex/regex_traits/transform.md +++ b/reference/regex/regex_traits/transform.md @@ -71,8 +71,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 4.9.2, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/regex_traits/transform_primary.md b/reference/regex/regex_traits/transform_primary.md index b5d82b6291..dc4e45ba43 100644 --- a/reference/regex/regex_traits/transform_primary.md +++ b/reference/regex/regex_traits/transform_primary.md @@ -61,8 +61,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 4.9.2, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/regex_traits/translate.md b/reference/regex/regex_traits/translate.md index 618d4db272..5a6f9737da 100644 --- a/reference/regex/regex_traits/translate.md +++ b/reference/regex/regex_traits/translate.md @@ -46,8 +46,8 @@ A - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 4.9.2, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/regex_traits/translate_nocase.md b/reference/regex/regex_traits/translate_nocase.md index 1ef4d28ea2..7b9734d73c 100644 --- a/reference/regex/regex_traits/translate_nocase.md +++ b/reference/regex/regex_traits/translate_nocase.md @@ -50,8 +50,8 @@ a - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 4.9.2, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/regex_traits/value.md b/reference/regex/regex_traits/value.md index 012eddfd55..5b2d05d1e5 100644 --- a/reference/regex/regex_traits/value.md +++ b/reference/regex/regex_traits/value.md @@ -48,8 +48,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 4.9.2, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/sub_match.md b/reference/regex/sub_match.md index 1b770329dd..29b00cab03 100644 --- a/reference/regex/sub_match.md +++ b/reference/regex/sub_match.md @@ -123,7 +123,7 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/sub_match/compare.md b/reference/regex/sub_match/compare.md index 4d6b5bab3f..905fa92965 100644 --- a/reference/regex/sub_match/compare.md +++ b/reference/regex/sub_match/compare.md @@ -69,7 +69,7 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/sub_match/length.md b/reference/regex/sub_match/length.md index f2df7541d2..c5dd363f0b 100644 --- a/reference/regex/sub_match/length.md +++ b/reference/regex/sub_match/length.md @@ -60,7 +60,7 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/sub_match/op_compare_3way.md b/reference/regex/sub_match/op_compare_3way.md index 74019384a9..f1f7e96c2f 100644 --- a/reference/regex/sub_match/op_compare_3way.md +++ b/reference/regex/sub_match/op_compare_3way.md @@ -132,7 +132,7 @@ false ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10 +- [GCC](/implementation.md#gcc): 10 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 diff --git a/reference/regex/sub_match/op_constructor.md b/reference/regex/sub_match/op_constructor.md index dddd932a29..ad62546c00 100644 --- a/reference/regex/sub_match/op_constructor.md +++ b/reference/regex/sub_match/op_constructor.md @@ -50,7 +50,7 @@ false - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/sub_match/op_equal.md b/reference/regex/sub_match/op_equal.md index 0b13718566..d558d191cd 100644 --- a/reference/regex/sub_match/op_equal.md +++ b/reference/regex/sub_match/op_equal.md @@ -127,8 +127,8 @@ false - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/sub_match/op_greater.md b/reference/regex/sub_match/op_greater.md index c48dabd22f..09cc94e8ad 100644 --- a/reference/regex/sub_match/op_greater.md +++ b/reference/regex/sub_match/op_greater.md @@ -117,8 +117,8 @@ true - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/sub_match/op_greater_equal.md b/reference/regex/sub_match/op_greater_equal.md index ad6dc8425d..48363e2aca 100644 --- a/reference/regex/sub_match/op_greater_equal.md +++ b/reference/regex/sub_match/op_greater_equal.md @@ -117,8 +117,8 @@ true - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/sub_match/op_less.md b/reference/regex/sub_match/op_less.md index cb24b90584..6f4c0ce251 100644 --- a/reference/regex/sub_match/op_less.md +++ b/reference/regex/sub_match/op_less.md @@ -124,8 +124,8 @@ false - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/sub_match/op_less_equal.md b/reference/regex/sub_match/op_less_equal.md index 493ea706b4..38d512a015 100644 --- a/reference/regex/sub_match/op_less_equal.md +++ b/reference/regex/sub_match/op_less_equal.md @@ -117,8 +117,8 @@ false - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/sub_match/op_not_equal.md b/reference/regex/sub_match/op_not_equal.md index 2d5b2b153e..cf9eacb739 100644 --- a/reference/regex/sub_match/op_not_equal.md +++ b/reference/regex/sub_match/op_not_equal.md @@ -117,8 +117,8 @@ true - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/sub_match/op_ostream.md b/reference/regex/sub_match/op_ostream.md index fd09eb60c3..c515304a7d 100644 --- a/reference/regex/sub_match/op_ostream.md +++ b/reference/regex/sub_match/op_ostream.md @@ -62,7 +62,7 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/sub_match/op_string_type.md b/reference/regex/sub_match/op_string_type.md index 06589af189..b83e003d57 100644 --- a/reference/regex/sub_match/op_string_type.md +++ b/reference/regex/sub_match/op_string_type.md @@ -59,7 +59,7 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/regex/sub_match/str.md b/reference/regex/sub_match/str.md index 41393400cb..6a67c93878 100644 --- a/reference/regex/sub_match/str.md +++ b/reference/regex/sub_match/str.md @@ -59,7 +59,7 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/scoped_allocator/scoped_allocator_adaptor.md b/reference/scoped_allocator/scoped_allocator_adaptor.md index 4550edb869..22ad337c5a 100644 --- a/reference/scoped_allocator/scoped_allocator_adaptor.md +++ b/reference/scoped_allocator/scoped_allocator_adaptor.md @@ -265,8 +265,8 @@ element allocator : 2 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6 -- [GCC](/implementation.md#gcc): 4.7.3, 4.8.1, 4.8.2, 4.9.0, 4.9.1, 5.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5 [mark verified], 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.3 [mark verified], 4.8.1 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/scoped_allocator/scoped_allocator_adaptor/allocate.md b/reference/scoped_allocator/scoped_allocator_adaptor/allocate.md index 8b0e88895a..68433f1db9 100644 --- a/reference/scoped_allocator/scoped_allocator_adaptor/allocate.md +++ b/reference/scoped_allocator/scoped_allocator_adaptor/allocate.md @@ -73,8 +73,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.7.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/scoped_allocator/scoped_allocator_adaptor/construct.md b/reference/scoped_allocator/scoped_allocator_adaptor/construct.md index 837bbee42e..b7d8ee171e 100644 --- a/reference/scoped_allocator/scoped_allocator_adaptor/construct.md +++ b/reference/scoped_allocator/scoped_allocator_adaptor/construct.md @@ -223,8 +223,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.3 (`forward_as_tuple()`まで含めた完全な実装) -- [GCC](/implementation.md#gcc): 4.7.3 +- [Clang](/implementation.md#clang): 3.3 (`forward_as_tuple()`まで含めた完全な実装) [mark verified] +- [GCC](/implementation.md#gcc): 4.7.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/scoped_allocator/scoped_allocator_adaptor/deallocate.md b/reference/scoped_allocator/scoped_allocator_adaptor/deallocate.md index b725e1b973..ac9f8bb1d2 100644 --- a/reference/scoped_allocator/scoped_allocator_adaptor/deallocate.md +++ b/reference/scoped_allocator/scoped_allocator_adaptor/deallocate.md @@ -68,7 +68,7 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.7.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/scoped_allocator/scoped_allocator_adaptor/destroy.md b/reference/scoped_allocator/scoped_allocator_adaptor/destroy.md index 4ba0677d11..cea6eedd57 100644 --- a/reference/scoped_allocator/scoped_allocator_adaptor/destroy.md +++ b/reference/scoped_allocator/scoped_allocator_adaptor/destroy.md @@ -86,7 +86,7 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.3 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/scoped_allocator/scoped_allocator_adaptor/inner_allocator.md b/reference/scoped_allocator/scoped_allocator_adaptor/inner_allocator.md index f0d145a34c..3066560d7e 100644 --- a/reference/scoped_allocator/scoped_allocator_adaptor/inner_allocator.md +++ b/reference/scoped_allocator/scoped_allocator_adaptor/inner_allocator.md @@ -98,7 +98,7 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.7.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/scoped_allocator/scoped_allocator_adaptor/max_size.md b/reference/scoped_allocator/scoped_allocator_adaptor/max_size.md index 11e75cf67b..a8f4a87b6d 100644 --- a/reference/scoped_allocator/scoped_allocator_adaptor/max_size.md +++ b/reference/scoped_allocator/scoped_allocator_adaptor/max_size.md @@ -64,7 +64,7 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.7.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/scoped_allocator/scoped_allocator_adaptor/op_constructor.md b/reference/scoped_allocator/scoped_allocator_adaptor/op_constructor.md index cf6c4ad22c..6cb445d3ef 100644 --- a/reference/scoped_allocator/scoped_allocator_adaptor/op_constructor.md +++ b/reference/scoped_allocator/scoped_allocator_adaptor/op_constructor.md @@ -109,7 +109,7 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.7.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/scoped_allocator/scoped_allocator_adaptor/op_equal.md b/reference/scoped_allocator/scoped_allocator_adaptor/op_equal.md index 12e1ecb9a7..db9124a9cf 100644 --- a/reference/scoped_allocator/scoped_allocator_adaptor/op_equal.md +++ b/reference/scoped_allocator/scoped_allocator_adaptor/op_equal.md @@ -70,7 +70,7 @@ equal - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.7.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/scoped_allocator/scoped_allocator_adaptor/op_not_equal.md b/reference/scoped_allocator/scoped_allocator_adaptor/op_not_equal.md index 19552ce8e1..4ed4508da7 100644 --- a/reference/scoped_allocator/scoped_allocator_adaptor/op_not_equal.md +++ b/reference/scoped_allocator/scoped_allocator_adaptor/op_not_equal.md @@ -69,8 +69,8 @@ equal - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.7.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/scoped_allocator/scoped_allocator_adaptor/outer_allocator.md b/reference/scoped_allocator/scoped_allocator_adaptor/outer_allocator.md index ab2176430a..c5313e970f 100644 --- a/reference/scoped_allocator/scoped_allocator_adaptor/outer_allocator.md +++ b/reference/scoped_allocator/scoped_allocator_adaptor/outer_allocator.md @@ -98,7 +98,7 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.7.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/scoped_allocator/scoped_allocator_adaptor/select_on_container_copy_construction.md b/reference/scoped_allocator/scoped_allocator_adaptor/select_on_container_copy_construction.md index 1e0156709e..325dc9f97e 100644 --- a/reference/scoped_allocator/scoped_allocator_adaptor/select_on_container_copy_construction.md +++ b/reference/scoped_allocator/scoped_allocator_adaptor/select_on_container_copy_construction.md @@ -63,7 +63,7 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.3 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/semaphore/counting_semaphore.md b/reference/semaphore/counting_semaphore.md index fa107a488f..03558e00b1 100644 --- a/reference/semaphore/counting_semaphore.md +++ b/reference/semaphore/counting_semaphore.md @@ -130,7 +130,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 11.0 +- [Clang](/implementation.md#clang): 11.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/semaphore/counting_semaphore/acquire.md b/reference/semaphore/counting_semaphore/acquire.md index 98a70413c3..66593890c8 100644 --- a/reference/semaphore/counting_semaphore/acquire.md +++ b/reference/semaphore/counting_semaphore/acquire.md @@ -78,7 +78,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 11.0 +- [Clang](/implementation.md#clang): 11.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/semaphore/counting_semaphore/max.md b/reference/semaphore/counting_semaphore/max.md index 92de926d73..c95f3f8766 100644 --- a/reference/semaphore/counting_semaphore/max.md +++ b/reference/semaphore/counting_semaphore/max.md @@ -52,7 +52,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 11.0 +- [Clang](/implementation.md#clang): 11.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/semaphore/counting_semaphore/op_constructor.md b/reference/semaphore/counting_semaphore/op_constructor.md index d96c05fe96..a239e699c3 100644 --- a/reference/semaphore/counting_semaphore/op_constructor.md +++ b/reference/semaphore/counting_semaphore/op_constructor.md @@ -48,7 +48,7 @@ int main() {} - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 11.0 +- [Clang](/implementation.md#clang): 11.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/semaphore/counting_semaphore/release.md b/reference/semaphore/counting_semaphore/release.md index 7a84a72a44..eeeee9b82c 100644 --- a/reference/semaphore/counting_semaphore/release.md +++ b/reference/semaphore/counting_semaphore/release.md @@ -74,7 +74,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 11.0 +- [Clang](/implementation.md#clang): 11.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/semaphore/counting_semaphore/try_acquire.md b/reference/semaphore/counting_semaphore/try_acquire.md index 19adfa460c..0a992364de 100644 --- a/reference/semaphore/counting_semaphore/try_acquire.md +++ b/reference/semaphore/counting_semaphore/try_acquire.md @@ -76,7 +76,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 11.0 +- [Clang](/implementation.md#clang): 11.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/semaphore/counting_semaphore/try_acquire_for.md b/reference/semaphore/counting_semaphore/try_acquire_for.md index 1bf0c43feb..b3ae834a92 100644 --- a/reference/semaphore/counting_semaphore/try_acquire_for.md +++ b/reference/semaphore/counting_semaphore/try_acquire_for.md @@ -79,7 +79,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 11.0 +- [Clang](/implementation.md#clang): 11.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/semaphore/counting_semaphore/try_acquire_until.md b/reference/semaphore/counting_semaphore/try_acquire_until.md index ba4586532a..7fcde80e7c 100644 --- a/reference/semaphore/counting_semaphore/try_acquire_until.md +++ b/reference/semaphore/counting_semaphore/try_acquire_until.md @@ -82,7 +82,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 11.0 +- [Clang](/implementation.md#clang): 11.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/set/multiset/contains.md b/reference/set/multiset/contains.md index 10f93aa92d..182a5dbedc 100644 --- a/reference/set/multiset/contains.md +++ b/reference/set/multiset/contains.md @@ -66,8 +66,8 @@ contain ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 1 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 1 [mark verified] ## 参照 - [P0458R2 Checking for Existence of an Element in Associative Containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0458r2.html) diff --git a/reference/set/multiset/erase_if_free.md b/reference/set/multiset/erase_if_free.md index 4bc7b1d9b8..911273825d 100644 --- a/reference/set/multiset/erase_if_free.md +++ b/reference/set/multiset/erase_if_free.md @@ -70,8 +70,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 9.1 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/set/multiset/extract.md b/reference/set/multiset/extract.md index 84ab53b629..9187b14ec1 100644 --- a/reference/set/multiset/extract.md +++ b/reference/set/multiset/extract.md @@ -128,10 +128,10 @@ s2 = { 1, 2 } ### 処理系 -- [Clang](/implementation.md#clang): 7.0.0 -- [GCC](/implementation.md#gcc): 7.1.0 +- [Clang](/implementation.md#clang): 7.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 [mark verified] ## 関連項目 diff --git a/reference/set/multiset/get_allocator.md b/reference/set/multiset/get_allocator.md index e93849eb7b..b8bb6a1c06 100644 --- a/reference/set/multiset/get_allocator.md +++ b/reference/set/multiset/get_allocator.md @@ -63,6 +63,6 @@ int main() - [Clang](/implementation.md#clang): ? - [GCC](/implementation.md#gcc): ? - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2002, 2003, 2005, 2008, 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2002 [mark verified], 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - 2012, 2013は、`noexcept`が実装されていないため、`throw()`が修飾されている。 - 2015からは、`noexcept`が修飾されている。 diff --git a/reference/set/multiset/merge.md b/reference/set/multiset/merge.md index 1beb41f4ce..8de86225a9 100644 --- a/reference/set/multiset/merge.md +++ b/reference/set/multiset/merge.md @@ -84,10 +84,10 @@ s2 = { 10, 10, 20, 30 } - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 8.0.0 -- [GCC](/implementation.md#gcc): 7.1.0 +- [Clang](/implementation.md#clang): 8.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 [mark verified] ## 参照 diff --git a/reference/set/set/contains.md b/reference/set/set/contains.md index fc3f07756e..4e54d6a9eb 100644 --- a/reference/set/set/contains.md +++ b/reference/set/set/contains.md @@ -66,8 +66,8 @@ contain ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 1 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 1 [mark verified] ## 参照 - [P0458R2 Checking for Existence of an Element in Associative Containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0458r2.html) diff --git a/reference/set/set/erase_if_free.md b/reference/set/set/erase_if_free.md index 0ad8a473e4..ef6be21991 100644 --- a/reference/set/set/erase_if_free.md +++ b/reference/set/set/erase_if_free.md @@ -70,8 +70,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 9.1 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/set/set/extract.md b/reference/set/set/extract.md index 43a428d31d..3637b42674 100644 --- a/reference/set/set/extract.md +++ b/reference/set/set/extract.md @@ -128,10 +128,10 @@ s2 = { 1, 2 } ### 処理系 -- [Clang](/implementation.md#clang): 7.0.0 -- [GCC](/implementation.md#gcc): 7.1.0 +- [Clang](/implementation.md#clang): 7.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 [mark verified] ## 関連項目 diff --git a/reference/set/set/get_allocator.md b/reference/set/set/get_allocator.md index 967389686c..52a82caab6 100644 --- a/reference/set/set/get_allocator.md +++ b/reference/set/set/get_allocator.md @@ -63,6 +63,6 @@ int main() - [Clang](/implementation.md#clang): ? - [GCC](/implementation.md#gcc): ? - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2002, 2003, 2005, 2008, 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2002 [mark verified], 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - 2012, 2013は、`noexcept`が実装されていないため、`throw()`が修飾されている。 - 2015からは、`noexcept`が修飾されている。 diff --git a/reference/set/set/merge.md b/reference/set/set/merge.md index 77a3e8f1a0..a36d471845 100644 --- a/reference/set/set/merge.md +++ b/reference/set/set/merge.md @@ -80,10 +80,10 @@ s2 = { 10, 20, 30 } - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 8.0.0 -- [GCC](/implementation.md#gcc): 7.1.0 +- [Clang](/implementation.md#clang): 8.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 [mark verified] ## 参照 diff --git a/reference/set/set/op_compare_3way.md b/reference/set/set/op_compare_3way.md index 81aa66894b..f76dfad5b0 100644 --- a/reference/set/set/op_compare_3way.md +++ b/reference/set/set/op_compare_3way.md @@ -78,7 +78,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10 +- [GCC](/implementation.md#gcc): 10 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/shared_mutex/shared_lock.md b/reference/shared_mutex/shared_lock.md index 0d929e1213..46bf230d66 100644 --- a/reference/shared_mutex/shared_lock.md +++ b/reference/shared_mutex/shared_lock.md @@ -95,10 +95,10 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.4 -- [GCC](/implementation.md#gcc): 4.9 +- [Clang](/implementation.md#clang): 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.9 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] ## 参照 diff --git a/reference/shared_mutex/shared_lock/lock.md b/reference/shared_mutex/shared_lock/lock.md index 352caffef3..5839bacef0 100644 --- a/reference/shared_mutex/shared_lock/lock.md +++ b/reference/shared_mutex/shared_lock/lock.md @@ -71,7 +71,7 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.5 -- [GCC](/implementation.md#gcc): 4.9 +- [Clang](/implementation.md#clang): 3.5 [mark verified] +- [GCC](/implementation.md#gcc): 4.9 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] diff --git a/reference/shared_mutex/shared_lock/mutex.md b/reference/shared_mutex/shared_lock/mutex.md index 6e71ad4a70..9a26f7066f 100644 --- a/reference/shared_mutex/shared_lock/mutex.md +++ b/reference/shared_mutex/shared_lock/mutex.md @@ -48,7 +48,7 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.5 -- [GCC](/implementation.md#gcc): 4.9 +- [Clang](/implementation.md#clang): 3.5 [mark verified] +- [GCC](/implementation.md#gcc): 4.9 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] diff --git a/reference/shared_mutex/shared_lock/op_assign.md b/reference/shared_mutex/shared_lock/op_assign.md index 5b0687bf4a..0fba48a9ef 100644 --- a/reference/shared_mutex/shared_lock/op_assign.md +++ b/reference/shared_mutex/shared_lock/op_assign.md @@ -57,7 +57,7 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.5 -- [GCC](/implementation.md#gcc): 4.9 +- [Clang](/implementation.md#clang): 3.5 [mark verified] +- [GCC](/implementation.md#gcc): 4.9 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] diff --git a/reference/shared_mutex/shared_lock/op_bool.md b/reference/shared_mutex/shared_lock/op_bool.md index 7462575912..91788c8dab 100644 --- a/reference/shared_mutex/shared_lock/op_bool.md +++ b/reference/shared_mutex/shared_lock/op_bool.md @@ -85,7 +85,7 @@ locked - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.5 -- [GCC](/implementation.md#gcc): 4.9 +- [Clang](/implementation.md#clang): 3.5 [mark verified] +- [GCC](/implementation.md#gcc): 4.9 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] diff --git a/reference/shared_mutex/shared_lock/op_constructor.md b/reference/shared_mutex/shared_lock/op_constructor.md index 0cd07eb6b2..9f6e274ec6 100644 --- a/reference/shared_mutex/shared_lock/op_constructor.md +++ b/reference/shared_mutex/shared_lock/op_constructor.md @@ -146,7 +146,7 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.5 -- [GCC](/implementation.md#gcc): 4.9 +- [Clang](/implementation.md#clang): 3.5 [mark verified] +- [GCC](/implementation.md#gcc): 4.9 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] diff --git a/reference/shared_mutex/shared_lock/op_destructor.md b/reference/shared_mutex/shared_lock/op_destructor.md index c02a07c96c..2f879669fb 100644 --- a/reference/shared_mutex/shared_lock/op_destructor.md +++ b/reference/shared_mutex/shared_lock/op_destructor.md @@ -29,7 +29,7 @@ if (owns_lock()) { - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.5 -- [GCC](/implementation.md#gcc): 4.9 +- [Clang](/implementation.md#clang): 3.5 [mark verified] +- [GCC](/implementation.md#gcc): 4.9 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] diff --git a/reference/shared_mutex/shared_lock/owns_lock.md b/reference/shared_mutex/shared_lock/owns_lock.md index 1e9e04ede6..8e6509a25c 100644 --- a/reference/shared_mutex/shared_lock/owns_lock.md +++ b/reference/shared_mutex/shared_lock/owns_lock.md @@ -66,7 +66,7 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.5 -- [GCC](/implementation.md#gcc): 4.9 +- [Clang](/implementation.md#clang): 3.5 [mark verified] +- [GCC](/implementation.md#gcc): 4.9 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] diff --git a/reference/shared_mutex/shared_lock/release.md b/reference/shared_mutex/shared_lock/release.md index 980d0eed2f..0640a47aa0 100644 --- a/reference/shared_mutex/shared_lock/release.md +++ b/reference/shared_mutex/shared_lock/release.md @@ -60,7 +60,7 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.5 -- [GCC](/implementation.md#gcc): 4.9 +- [Clang](/implementation.md#clang): 3.5 [mark verified] +- [GCC](/implementation.md#gcc): 4.9 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] diff --git a/reference/shared_mutex/shared_lock/swap.md b/reference/shared_mutex/shared_lock/swap.md index a15338d284..8e2efe3f1e 100644 --- a/reference/shared_mutex/shared_lock/swap.md +++ b/reference/shared_mutex/shared_lock/swap.md @@ -53,7 +53,7 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.5 -- [GCC](/implementation.md#gcc): 4.9 +- [Clang](/implementation.md#clang): 3.5 [mark verified] +- [GCC](/implementation.md#gcc): 4.9 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] diff --git a/reference/shared_mutex/shared_lock/swap_free.md b/reference/shared_mutex/shared_lock/swap_free.md index b0f2c6f32a..bf087c5c14 100644 --- a/reference/shared_mutex/shared_lock/swap_free.md +++ b/reference/shared_mutex/shared_lock/swap_free.md @@ -58,7 +58,7 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.5 -- [GCC](/implementation.md#gcc): 4.9 +- [Clang](/implementation.md#clang): 3.5 [mark verified] +- [GCC](/implementation.md#gcc): 4.9 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] diff --git a/reference/shared_mutex/shared_lock/try_lock.md b/reference/shared_mutex/shared_lock/try_lock.md index ecff3a1800..d418765d80 100644 --- a/reference/shared_mutex/shared_lock/try_lock.md +++ b/reference/shared_mutex/shared_lock/try_lock.md @@ -79,7 +79,7 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.5 -- [GCC](/implementation.md#gcc): 4.9 +- [Clang](/implementation.md#clang): 3.5 [mark verified] +- [GCC](/implementation.md#gcc): 4.9 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] diff --git a/reference/shared_mutex/shared_lock/try_lock_for.md b/reference/shared_mutex/shared_lock/try_lock_for.md index e9a1106837..b6dcd547c9 100644 --- a/reference/shared_mutex/shared_lock/try_lock_for.md +++ b/reference/shared_mutex/shared_lock/try_lock_for.md @@ -81,7 +81,7 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.5 -- [GCC](/implementation.md#gcc): 4.9 +- [Clang](/implementation.md#clang): 3.5 [mark verified] +- [GCC](/implementation.md#gcc): 4.9 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] diff --git a/reference/shared_mutex/shared_lock/try_lock_until.md b/reference/shared_mutex/shared_lock/try_lock_until.md index 2eecf04e4b..a7c728c772 100644 --- a/reference/shared_mutex/shared_lock/try_lock_until.md +++ b/reference/shared_mutex/shared_lock/try_lock_until.md @@ -91,7 +91,7 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.5 -- [GCC](/implementation.md#gcc): 4.9 +- [Clang](/implementation.md#clang): 3.5 [mark verified] +- [GCC](/implementation.md#gcc): 4.9 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] diff --git a/reference/shared_mutex/shared_lock/unlock.md b/reference/shared_mutex/shared_lock/unlock.md index c7cfc95615..0ff21a9a72 100644 --- a/reference/shared_mutex/shared_lock/unlock.md +++ b/reference/shared_mutex/shared_lock/unlock.md @@ -68,7 +68,7 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.5 -- [GCC](/implementation.md#gcc): 4.9 +- [Clang](/implementation.md#clang): 3.5 [mark verified] +- [GCC](/implementation.md#gcc): 4.9 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] diff --git a/reference/shared_mutex/shared_mutex.md b/reference/shared_mutex/shared_mutex.md index 18e66ae31b..bd39450c15 100644 --- a/reference/shared_mutex/shared_mutex.md +++ b/reference/shared_mutex/shared_mutex.md @@ -173,8 +173,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 3.7.1 -- [GCC](/implementation.md#gcc): 6.3 +- [Clang](/implementation.md#clang): 3.7.1 [mark verified] +- [GCC](/implementation.md#gcc): 6.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/shared_mutex/shared_mutex/lock.md b/reference/shared_mutex/shared_mutex/lock.md index 0a43b0f6dc..90606748a5 100644 --- a/reference/shared_mutex/shared_mutex/lock.md +++ b/reference/shared_mutex/shared_mutex/lock.md @@ -86,7 +86,7 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 3.7.1 -- [GCC](/implementation.md#gcc): 6.3 +- [Clang](/implementation.md#clang): 3.7.1 [mark verified] +- [GCC](/implementation.md#gcc): 6.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/shared_mutex/shared_mutex/lock_shared.md b/reference/shared_mutex/shared_mutex/lock_shared.md index cca3f50bb4..078a2353ec 100644 --- a/reference/shared_mutex/shared_mutex/lock_shared.md +++ b/reference/shared_mutex/shared_mutex/lock_shared.md @@ -86,7 +86,7 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 3.7.1 -- [GCC](/implementation.md#gcc): 6.3 +- [Clang](/implementation.md#clang): 3.7.1 [mark verified] +- [GCC](/implementation.md#gcc): 6.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/shared_mutex/shared_mutex/op_constructor.md b/reference/shared_mutex/shared_mutex/op_constructor.md index a21535f228..932acdf21e 100644 --- a/reference/shared_mutex/shared_mutex/op_constructor.md +++ b/reference/shared_mutex/shared_mutex/op_constructor.md @@ -44,7 +44,7 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 3.7.1 -- [GCC](/implementation.md#gcc): 6.3 +- [Clang](/implementation.md#clang): 3.7.1 [mark verified] +- [GCC](/implementation.md#gcc): 6.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/shared_mutex/shared_mutex/op_destructor.md b/reference/shared_mutex/shared_mutex/op_destructor.md index 148d1878fe..f30c3ce1d5 100644 --- a/reference/shared_mutex/shared_mutex/op_destructor.md +++ b/reference/shared_mutex/shared_mutex/op_destructor.md @@ -18,7 +18,7 @@ - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 3.7.1 -- [GCC](/implementation.md#gcc): 6.3 +- [Clang](/implementation.md#clang): 3.7.1 [mark verified] +- [GCC](/implementation.md#gcc): 6.3 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] diff --git a/reference/shared_mutex/shared_mutex/try_lock.md b/reference/shared_mutex/shared_mutex/try_lock.md index 0b1cb6d8f7..1568ff8336 100644 --- a/reference/shared_mutex/shared_mutex/try_lock.md +++ b/reference/shared_mutex/shared_mutex/try_lock.md @@ -95,7 +95,7 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 3.7.1 -- [GCC](/implementation.md#gcc): 6.3 +- [Clang](/implementation.md#clang): 3.7.1 [mark verified] +- [GCC](/implementation.md#gcc): 6.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/shared_mutex/shared_mutex/try_lock_shared.md b/reference/shared_mutex/shared_mutex/try_lock_shared.md index b32d8a8251..f3eac4d57c 100644 --- a/reference/shared_mutex/shared_mutex/try_lock_shared.md +++ b/reference/shared_mutex/shared_mutex/try_lock_shared.md @@ -95,7 +95,7 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 3.7.1 -- [GCC](/implementation.md#gcc): 6.3 +- [Clang](/implementation.md#clang): 3.7.1 [mark verified] +- [GCC](/implementation.md#gcc): 6.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/shared_mutex/shared_mutex/unlock.md b/reference/shared_mutex/shared_mutex/unlock.md index 6e4eda07d3..7992ad8e93 100644 --- a/reference/shared_mutex/shared_mutex/unlock.md +++ b/reference/shared_mutex/shared_mutex/unlock.md @@ -82,7 +82,7 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 3.7.1 -- [GCC](/implementation.md#gcc): 6.3 +- [Clang](/implementation.md#clang): 3.7.1 [mark verified] +- [GCC](/implementation.md#gcc): 6.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/shared_mutex/shared_mutex/unlock_shared.md b/reference/shared_mutex/shared_mutex/unlock_shared.md index c97faf7db8..a20f637c31 100644 --- a/reference/shared_mutex/shared_mutex/unlock_shared.md +++ b/reference/shared_mutex/shared_mutex/unlock_shared.md @@ -82,7 +82,7 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 3.7.1 -- [GCC](/implementation.md#gcc): 6.3 +- [Clang](/implementation.md#clang): 3.7.1 [mark verified] +- [GCC](/implementation.md#gcc): 6.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/shared_mutex/shared_timed_mutex.md b/reference/shared_mutex/shared_timed_mutex.md index c80dfc9c0f..c27d1dd1c5 100644 --- a/reference/shared_mutex/shared_timed_mutex.md +++ b/reference/shared_mutex/shared_timed_mutex.md @@ -179,10 +179,10 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.5 -- [GCC](/implementation.md#gcc): 4.9 +- [Clang](/implementation.md#clang): 3.5 [mark verified] +- [GCC](/implementation.md#gcc): 4.9 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] ## 関連項目 diff --git a/reference/shared_mutex/shared_timed_mutex/lock.md b/reference/shared_mutex/shared_timed_mutex/lock.md index 7e1cbe90f3..1eb1e08a69 100644 --- a/reference/shared_mutex/shared_timed_mutex/lock.md +++ b/reference/shared_mutex/shared_timed_mutex/lock.md @@ -86,7 +86,7 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.5 -- [GCC](/implementation.md#gcc): 4.9 +- [Clang](/implementation.md#clang): 3.5 [mark verified] +- [GCC](/implementation.md#gcc): 4.9 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] diff --git a/reference/shared_mutex/shared_timed_mutex/lock_shared.md b/reference/shared_mutex/shared_timed_mutex/lock_shared.md index 50457f5c38..bfaa17de0d 100644 --- a/reference/shared_mutex/shared_timed_mutex/lock_shared.md +++ b/reference/shared_mutex/shared_timed_mutex/lock_shared.md @@ -86,7 +86,7 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.5 -- [GCC](/implementation.md#gcc): 4.9 +- [Clang](/implementation.md#clang): 3.5 [mark verified] +- [GCC](/implementation.md#gcc): 4.9 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] diff --git a/reference/shared_mutex/shared_timed_mutex/op_constructor.md b/reference/shared_mutex/shared_timed_mutex/op_constructor.md index f27fe2a849..7331f4a86a 100644 --- a/reference/shared_mutex/shared_timed_mutex/op_constructor.md +++ b/reference/shared_mutex/shared_timed_mutex/op_constructor.md @@ -44,7 +44,7 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.5 -- [GCC](/implementation.md#gcc): 4.9 +- [Clang](/implementation.md#clang): 3.5 [mark verified] +- [GCC](/implementation.md#gcc): 4.9 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] diff --git a/reference/shared_mutex/shared_timed_mutex/op_destructor.md b/reference/shared_mutex/shared_timed_mutex/op_destructor.md index e33fa8ed97..8919adc4ce 100644 --- a/reference/shared_mutex/shared_timed_mutex/op_destructor.md +++ b/reference/shared_mutex/shared_timed_mutex/op_destructor.md @@ -26,7 +26,7 @@ - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.5 -- [GCC](/implementation.md#gcc): 4.9 +- [Clang](/implementation.md#clang): 3.5 [mark verified] +- [GCC](/implementation.md#gcc): 4.9 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] diff --git a/reference/shared_mutex/shared_timed_mutex/try_lock.md b/reference/shared_mutex/shared_timed_mutex/try_lock.md index b4eb516c26..0434962082 100644 --- a/reference/shared_mutex/shared_timed_mutex/try_lock.md +++ b/reference/shared_mutex/shared_timed_mutex/try_lock.md @@ -95,7 +95,7 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.5 -- [GCC](/implementation.md#gcc): 4.9 +- [Clang](/implementation.md#clang): 3.5 [mark verified] +- [GCC](/implementation.md#gcc): 4.9 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] diff --git a/reference/shared_mutex/shared_timed_mutex/try_lock_for.md b/reference/shared_mutex/shared_timed_mutex/try_lock_for.md index c81eb4c38e..20cce3fbd2 100644 --- a/reference/shared_mutex/shared_timed_mutex/try_lock_for.md +++ b/reference/shared_mutex/shared_timed_mutex/try_lock_for.md @@ -102,7 +102,7 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.5 -- [GCC](/implementation.md#gcc): 4.9 +- [Clang](/implementation.md#clang): 3.5 [mark verified] +- [GCC](/implementation.md#gcc): 4.9 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] diff --git a/reference/shared_mutex/shared_timed_mutex/try_lock_shared.md b/reference/shared_mutex/shared_timed_mutex/try_lock_shared.md index 509cd794c5..4bb78564d0 100644 --- a/reference/shared_mutex/shared_timed_mutex/try_lock_shared.md +++ b/reference/shared_mutex/shared_timed_mutex/try_lock_shared.md @@ -95,7 +95,7 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.5 -- [GCC](/implementation.md#gcc): 4.9 +- [Clang](/implementation.md#clang): 3.5 [mark verified] +- [GCC](/implementation.md#gcc): 4.9 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] diff --git a/reference/shared_mutex/shared_timed_mutex/try_lock_shared_for.md b/reference/shared_mutex/shared_timed_mutex/try_lock_shared_for.md index f7ff9abb7c..fcc814c0a0 100644 --- a/reference/shared_mutex/shared_timed_mutex/try_lock_shared_for.md +++ b/reference/shared_mutex/shared_timed_mutex/try_lock_shared_for.md @@ -99,7 +99,7 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.5 -- [GCC](/implementation.md#gcc): 4.9 +- [Clang](/implementation.md#clang): 3.5 [mark verified] +- [GCC](/implementation.md#gcc): 4.9 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] diff --git a/reference/shared_mutex/shared_timed_mutex/try_lock_shared_until.md b/reference/shared_mutex/shared_timed_mutex/try_lock_shared_until.md index 782990278f..de53869e94 100644 --- a/reference/shared_mutex/shared_timed_mutex/try_lock_shared_until.md +++ b/reference/shared_mutex/shared_timed_mutex/try_lock_shared_until.md @@ -110,7 +110,7 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.5 -- [GCC](/implementation.md#gcc): 4.9 +- [Clang](/implementation.md#clang): 3.5 [mark verified] +- [GCC](/implementation.md#gcc): 4.9 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] diff --git a/reference/shared_mutex/shared_timed_mutex/try_lock_until.md b/reference/shared_mutex/shared_timed_mutex/try_lock_until.md index e186a92d9c..ef560189db 100644 --- a/reference/shared_mutex/shared_timed_mutex/try_lock_until.md +++ b/reference/shared_mutex/shared_timed_mutex/try_lock_until.md @@ -113,7 +113,7 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.5 -- [GCC](/implementation.md#gcc): 4.9 +- [Clang](/implementation.md#clang): 3.5 [mark verified] +- [GCC](/implementation.md#gcc): 4.9 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] diff --git a/reference/shared_mutex/shared_timed_mutex/unlock.md b/reference/shared_mutex/shared_timed_mutex/unlock.md index f7e36da044..6a7e83ba2a 100644 --- a/reference/shared_mutex/shared_timed_mutex/unlock.md +++ b/reference/shared_mutex/shared_timed_mutex/unlock.md @@ -82,7 +82,7 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.5 -- [GCC](/implementation.md#gcc): 4.9 +- [Clang](/implementation.md#clang): 3.5 [mark verified] +- [GCC](/implementation.md#gcc): 4.9 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] diff --git a/reference/shared_mutex/shared_timed_mutex/unlock_shared.md b/reference/shared_mutex/shared_timed_mutex/unlock_shared.md index 84a440f339..c7ba525ce9 100644 --- a/reference/shared_mutex/shared_timed_mutex/unlock_shared.md +++ b/reference/shared_mutex/shared_timed_mutex/unlock_shared.md @@ -82,7 +82,7 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.5 -- [GCC](/implementation.md#gcc): 4.9 +- [Clang](/implementation.md#clang): 3.5 [mark verified] +- [GCC](/implementation.md#gcc): 4.9 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] diff --git a/reference/source_location.md b/reference/source_location.md index 676ab38e47..127a4d3b5b 100644 --- a/reference/source_location.md +++ b/reference/source_location.md @@ -16,7 +16,7 @@ ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 11.1 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/source_location/source_location.md b/reference/source_location/source_location.md index abccdb775f..e15fec6026 100644 --- a/reference/source_location/source_location.md +++ b/reference/source_location/source_location.md @@ -90,7 +90,7 @@ C言語から引き継いだ定義済みマクロ`__LINE__`、`__FILE__`や[事 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 11.1 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/source_location/source_location/current.md b/reference/source_location/source_location/current.md index 3f4af27b74..cb2d796783 100644 --- a/reference/source_location/source_location/current.md +++ b/reference/source_location/source_location/current.md @@ -108,7 +108,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 11.1 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/source_location/source_location/op_constructor.md b/reference/source_location/source_location/op_constructor.md index fce53f3353..38411c92bf 100644 --- a/reference/source_location/source_location/op_constructor.md +++ b/reference/source_location/source_location/op_constructor.md @@ -59,7 +59,7 @@ source_location() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 12.0 +- [GCC](/implementation.md#gcc): 12.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/span/dynamic_extent.md b/reference/span/dynamic_extent.md index 213d78b373..4a74e7f1a0 100644 --- a/reference/span/dynamic_extent.md +++ b/reference/span/dynamic_extent.md @@ -73,7 +73,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 9.0 +- [Clang](/implementation.md#clang): 9.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/span/span.md b/reference/span/span.md index 2468231219..f04dee8859 100644 --- a/reference/span/span.md +++ b/reference/span/span.md @@ -265,9 +265,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 9.0 -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 +- [Clang](/implementation.md#clang): 9.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 6 [mark verified] ## 参照 diff --git a/reference/span/span/as_bytes.md b/reference/span/span/as_bytes.md index c91999bb03..16fcb4397c 100644 --- a/reference/span/span/as_bytes.md +++ b/reference/span/span/as_bytes.md @@ -73,6 +73,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 9.0 +- [Clang](/implementation.md#clang): 9.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/span/span/as_writable_bytes.md b/reference/span/span/as_writable_bytes.md index c76735964e..4b55186383 100644 --- a/reference/span/span/as_writable_bytes.md +++ b/reference/span/span/as_writable_bytes.md @@ -86,6 +86,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 9.0 +- [Clang](/implementation.md#clang): 9.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/span/span/at.md b/reference/span/span/at.md index 987f6b4aa0..3f20152761 100644 --- a/reference/span/span/at.md +++ b/reference/span/span/at.md @@ -60,7 +60,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 14 +- [GCC](/implementation.md#gcc): 14 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/span/span/back.md b/reference/span/span/back.md index 7ce3835331..0db3735a71 100644 --- a/reference/span/span/back.md +++ b/reference/span/span/back.md @@ -60,6 +60,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 9.0 +- [Clang](/implementation.md#clang): 9.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/span/span/begin.md b/reference/span/span/begin.md index 5bbfa25e2d..0b31fd74a9 100644 --- a/reference/span/span/begin.md +++ b/reference/span/span/begin.md @@ -91,7 +91,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 9.0 +- [Clang](/implementation.md#clang): 9.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/span/span/cbegin.md b/reference/span/span/cbegin.md index c9fb1fa9b6..672999f8ba 100644 --- a/reference/span/span/cbegin.md +++ b/reference/span/span/cbegin.md @@ -56,8 +56,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 - [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) diff --git a/reference/span/span/cend.md b/reference/span/span/cend.md index 75ce8d1373..2a538a2b05 100644 --- a/reference/span/span/cend.md +++ b/reference/span/span/cend.md @@ -70,8 +70,8 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 - [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) diff --git a/reference/span/span/crbegin.md b/reference/span/span/crbegin.md index b322bc1c98..e5f1bdad08 100644 --- a/reference/span/span/crbegin.md +++ b/reference/span/span/crbegin.md @@ -55,8 +55,8 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 - [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) diff --git a/reference/span/span/crend.md b/reference/span/span/crend.md index a69a4fab65..68c234eb1f 100644 --- a/reference/span/span/crend.md +++ b/reference/span/span/crend.md @@ -69,8 +69,8 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 - [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) diff --git a/reference/span/span/data.md b/reference/span/span/data.md index be2b58f2c2..7f54f01c0b 100644 --- a/reference/span/span/data.md +++ b/reference/span/span/data.md @@ -54,6 +54,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 9.0 +- [Clang](/implementation.md#clang): 9.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/span/span/empty.md b/reference/span/span/empty.md index 18fdc3b6a7..b6d8c6a44e 100644 --- a/reference/span/span/empty.md +++ b/reference/span/span/empty.md @@ -61,6 +61,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 9.0 +- [Clang](/implementation.md#clang): 9.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/span/span/end.md b/reference/span/span/end.md index 52a6931c2c..99f192b295 100644 --- a/reference/span/span/end.md +++ b/reference/span/span/end.md @@ -91,7 +91,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 9.0 +- [Clang](/implementation.md#clang): 9.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/span/span/first.md b/reference/span/span/first.md index 733e55568a..acdf611878 100644 --- a/reference/span/span/first.md +++ b/reference/span/span/first.md @@ -90,7 +90,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 9.0 +- [Clang](/implementation.md#clang): 9.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/span/span/front.md b/reference/span/span/front.md index 98bdae588b..356ff7d8e1 100644 --- a/reference/span/span/front.md +++ b/reference/span/span/front.md @@ -59,6 +59,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 9.0 +- [Clang](/implementation.md#clang): 9.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/span/span/last.md b/reference/span/span/last.md index cd2bcc686b..11cd8656f1 100644 --- a/reference/span/span/last.md +++ b/reference/span/span/last.md @@ -91,7 +91,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 9.0 +- [Clang](/implementation.md#clang): 9.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/span/span/op_at.md b/reference/span/span/op_at.md index b6d818f2dc..5c84465a56 100644 --- a/reference/span/span/op_at.md +++ b/reference/span/span/op_at.md @@ -60,7 +60,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 9.0 +- [Clang](/implementation.md#clang): 9.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/span/span/op_constructor.md b/reference/span/span/op_constructor.md index adf6ea57a5..797d6c2654 100644 --- a/reference/span/span/op_constructor.md +++ b/reference/span/span/op_constructor.md @@ -329,8 +329,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): (10.0.0 現在、実装は P1394R4 以前の不完全なものである) -- [GCC](/implementation.md#gcc): 10.0.1 +- [Clang](/implementation.md#clang): (10.0.0 現在、実装は P1394R4 以前の不完全なものである) [mark verified] +- [GCC](/implementation.md#gcc): 10.0.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/span/span/op_deduction_guide.md b/reference/span/span/op_deduction_guide.md index c756458d21..6d0053b011 100644 --- a/reference/span/span/op_deduction_guide.md +++ b/reference/span/span/op_deduction_guide.md @@ -127,6 +127,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 9.0 +- [Clang](/implementation.md#clang): 9.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/span/span/rbegin.md b/reference/span/span/rbegin.md index e54407d591..8fc00b06bd 100644 --- a/reference/span/span/rbegin.md +++ b/reference/span/span/rbegin.md @@ -66,6 +66,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 9.0 +- [Clang](/implementation.md#clang): 9.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/span/span/rend.md b/reference/span/span/rend.md index 6fb7fa9975..3761f4c7a7 100644 --- a/reference/span/span/rend.md +++ b/reference/span/span/rend.md @@ -66,6 +66,6 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 9.0 +- [Clang](/implementation.md#clang): 9.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/span/span/size.md b/reference/span/span/size.md index 884a4544a4..3ef4e207d8 100644 --- a/reference/span/span/size.md +++ b/reference/span/span/size.md @@ -51,7 +51,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 9.0 +- [Clang](/implementation.md#clang): 9.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/span/span/size_bytes.md b/reference/span/span/size_bytes.md index 6345f39ca8..751d6648e3 100644 --- a/reference/span/span/size_bytes.md +++ b/reference/span/span/size_bytes.md @@ -56,7 +56,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 9.0 +- [Clang](/implementation.md#clang): 9.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/span/span/subspan.md b/reference/span/span/subspan.md index dc501537fb..24af924a9c 100644 --- a/reference/span/span/subspan.md +++ b/reference/span/span/subspan.md @@ -109,7 +109,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 9.0 +- [Clang](/implementation.md#clang): 9.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stack/stack/emplace.md b/reference/stack/stack/emplace.md index 868df52dcf..926aad9bf1 100644 --- a/reference/stack/stack/emplace.md +++ b/reference/stack/stack/emplace.md @@ -75,8 +75,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.4 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stack/stack/op_compare_3way.md b/reference/stack/stack/op_compare_3way.md index 7ed9940aa8..f481edf6ed 100644 --- a/reference/stack/stack/op_compare_3way.md +++ b/reference/stack/stack/op_compare_3way.md @@ -52,7 +52,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10 +- [GCC](/implementation.md#gcc): 10 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stack/stack/swap.md b/reference/stack/stack/swap.md index 21b937c845..ce95524211 100644 --- a/reference/stack/stack/swap.md +++ b/reference/stack/stack/swap.md @@ -88,7 +88,7 @@ void swap(stack& s) noexcept(noexcept(swap(c, s.c))) ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/stack/stack/swap_free.md b/reference/stack/stack/swap_free.md index 0e044ab6c9..96ee9ce468 100644 --- a/reference/stack/stack/swap_free.md +++ b/reference/stack/stack/swap_free.md @@ -84,7 +84,7 @@ y : 4 1 3 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/stacktrace/basic_stacktrace.md b/reference/stacktrace/basic_stacktrace.md index 6833f0febf..ce1c9a4e53 100644 --- a/reference/stacktrace/basic_stacktrace.md +++ b/reference/stacktrace/basic_stacktrace.md @@ -237,7 +237,7 @@ Expression 'i >= 0' is false in f(int) at /app/example.cpp:15 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 12 +- [GCC](/implementation.md#gcc): 12 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/at.md b/reference/stacktrace/basic_stacktrace/at.md index 02909efa8b..49fa885b59 100644 --- a/reference/stacktrace/basic_stacktrace/at.md +++ b/reference/stacktrace/basic_stacktrace/at.md @@ -54,5 +54,5 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 12 +- [GCC](/implementation.md#gcc): 12 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/begin.md b/reference/stacktrace/basic_stacktrace/begin.md index e123f76efe..0de8e5b1ec 100644 --- a/reference/stacktrace/basic_stacktrace/begin.md +++ b/reference/stacktrace/basic_stacktrace/begin.md @@ -61,5 +61,5 @@ _start at :0 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 12 +- [GCC](/implementation.md#gcc): 12 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/cbegin.md b/reference/stacktrace/basic_stacktrace/cbegin.md index b93bfb1694..aab2ddbaa1 100644 --- a/reference/stacktrace/basic_stacktrace/cbegin.md +++ b/reference/stacktrace/basic_stacktrace/cbegin.md @@ -61,5 +61,5 @@ _start at :0 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 12 +- [GCC](/implementation.md#gcc): 12 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/cend.md b/reference/stacktrace/basic_stacktrace/cend.md index 22e8ae02e4..307955ddd7 100644 --- a/reference/stacktrace/basic_stacktrace/cend.md +++ b/reference/stacktrace/basic_stacktrace/cend.md @@ -61,5 +61,5 @@ _start at :0 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 12 +- [GCC](/implementation.md#gcc): 12 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/crbegin.md b/reference/stacktrace/basic_stacktrace/crbegin.md index 14e964e4a8..d3c729795b 100644 --- a/reference/stacktrace/basic_stacktrace/crbegin.md +++ b/reference/stacktrace/basic_stacktrace/crbegin.md @@ -64,5 +64,5 @@ main at /app/example.cpp:17 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 12 +- [GCC](/implementation.md#gcc): 12 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/crend.md b/reference/stacktrace/basic_stacktrace/crend.md index b01ec1af1d..6c47b057a2 100644 --- a/reference/stacktrace/basic_stacktrace/crend.md +++ b/reference/stacktrace/basic_stacktrace/crend.md @@ -64,5 +64,5 @@ main at /app/example.cpp:17 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 12 +- [GCC](/implementation.md#gcc): 12 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/current.md b/reference/stacktrace/basic_stacktrace/current.md index adfb85b77f..1027d956ba 100644 --- a/reference/stacktrace/basic_stacktrace/current.md +++ b/reference/stacktrace/basic_stacktrace/current.md @@ -139,5 +139,5 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 12 +- [GCC](/implementation.md#gcc): 12 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/empty.md b/reference/stacktrace/basic_stacktrace/empty.md index aa6314c8b4..aaeb8e5677 100644 --- a/reference/stacktrace/basic_stacktrace/empty.md +++ b/reference/stacktrace/basic_stacktrace/empty.md @@ -52,5 +52,5 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 12 +- [GCC](/implementation.md#gcc): 12 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/end.md b/reference/stacktrace/basic_stacktrace/end.md index 3b273a8038..f8f8409fe1 100644 --- a/reference/stacktrace/basic_stacktrace/end.md +++ b/reference/stacktrace/basic_stacktrace/end.md @@ -61,5 +61,5 @@ _start at :0 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 12 +- [GCC](/implementation.md#gcc): 12 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/get_allocator.md b/reference/stacktrace/basic_stacktrace/get_allocator.md index e6861adca1..44153124c4 100644 --- a/reference/stacktrace/basic_stacktrace/get_allocator.md +++ b/reference/stacktrace/basic_stacktrace/get_allocator.md @@ -43,5 +43,5 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 12 +- [GCC](/implementation.md#gcc): 12 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/op_assign.md b/reference/stacktrace/basic_stacktrace/op_assign.md index 6a390f194c..9a1ab187cf 100644 --- a/reference/stacktrace/basic_stacktrace/op_assign.md +++ b/reference/stacktrace/basic_stacktrace/op_assign.md @@ -66,5 +66,5 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 12 +- [GCC](/implementation.md#gcc): 12 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/op_at.md b/reference/stacktrace/basic_stacktrace/op_at.md index 357b2a94a1..cb94229069 100644 --- a/reference/stacktrace/basic_stacktrace/op_at.md +++ b/reference/stacktrace/basic_stacktrace/op_at.md @@ -58,5 +58,5 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 12 +- [GCC](/implementation.md#gcc): 12 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/op_compare_3way.md b/reference/stacktrace/basic_stacktrace/op_compare_3way.md index 542b1e5499..18990a4d31 100644 --- a/reference/stacktrace/basic_stacktrace/op_compare_3way.md +++ b/reference/stacktrace/basic_stacktrace/op_compare_3way.md @@ -67,7 +67,7 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 12 +- [GCC](/implementation.md#gcc): 12 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/op_constructor.md b/reference/stacktrace/basic_stacktrace/op_constructor.md index e078768020..de8e867a9c 100644 --- a/reference/stacktrace/basic_stacktrace/op_constructor.md +++ b/reference/stacktrace/basic_stacktrace/op_constructor.md @@ -103,5 +103,5 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 12 +- [GCC](/implementation.md#gcc): 12 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/op_equal.md b/reference/stacktrace/basic_stacktrace/op_equal.md index e9a6f4f239..d95caa3566 100644 --- a/reference/stacktrace/basic_stacktrace/op_equal.md +++ b/reference/stacktrace/basic_stacktrace/op_equal.md @@ -63,7 +63,7 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 12 +- [GCC](/implementation.md#gcc): 12 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/op_ostream.md b/reference/stacktrace/basic_stacktrace/op_ostream.md index b6204faa52..314b09505f 100644 --- a/reference/stacktrace/basic_stacktrace/op_ostream.md +++ b/reference/stacktrace/basic_stacktrace/op_ostream.md @@ -63,5 +63,5 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 12 +- [GCC](/implementation.md#gcc): 12 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/rbegin.md b/reference/stacktrace/basic_stacktrace/rbegin.md index 0272902e39..b9a7aac1ae 100644 --- a/reference/stacktrace/basic_stacktrace/rbegin.md +++ b/reference/stacktrace/basic_stacktrace/rbegin.md @@ -64,5 +64,5 @@ main at /app/example.cpp:17 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 12 +- [GCC](/implementation.md#gcc): 12 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/rend.md b/reference/stacktrace/basic_stacktrace/rend.md index 62f37c8eda..0492eff000 100644 --- a/reference/stacktrace/basic_stacktrace/rend.md +++ b/reference/stacktrace/basic_stacktrace/rend.md @@ -64,5 +64,5 @@ main at /app/example.cpp:17 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 12 +- [GCC](/implementation.md#gcc): 12 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/size.md b/reference/stacktrace/basic_stacktrace/size.md index 07476a2031..6a10ac55cd 100644 --- a/reference/stacktrace/basic_stacktrace/size.md +++ b/reference/stacktrace/basic_stacktrace/size.md @@ -88,5 +88,5 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 12 +- [GCC](/implementation.md#gcc): 12 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/swap.md b/reference/stacktrace/basic_stacktrace/swap.md index da8d0404b3..0967ba36dd 100644 --- a/reference/stacktrace/basic_stacktrace/swap.md +++ b/reference/stacktrace/basic_stacktrace/swap.md @@ -64,5 +64,5 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 12 +- [GCC](/implementation.md#gcc): 12 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/swap_free.md b/reference/stacktrace/basic_stacktrace/swap_free.md index c63d6cf35c..f338161774 100644 --- a/reference/stacktrace/basic_stacktrace/swap_free.md +++ b/reference/stacktrace/basic_stacktrace/swap_free.md @@ -69,5 +69,5 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 12 +- [GCC](/implementation.md#gcc): 12 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/basic_stacktrace/to_string.md b/reference/stacktrace/basic_stacktrace/to_string.md index 130a114755..0fb338d0ed 100644 --- a/reference/stacktrace/basic_stacktrace/to_string.md +++ b/reference/stacktrace/basic_stacktrace/to_string.md @@ -64,5 +64,5 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 12 +- [GCC](/implementation.md#gcc): 12 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/stacktrace_entry.md b/reference/stacktrace/stacktrace_entry.md index a71f52ce25..b4fa77a4ad 100644 --- a/reference/stacktrace/stacktrace_entry.md +++ b/reference/stacktrace/stacktrace_entry.md @@ -135,5 +135,5 @@ g() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 12 +- [GCC](/implementation.md#gcc): 12 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/stacktrace_entry/description.md b/reference/stacktrace/stacktrace_entry/description.md index df22c7b737..37c299bbe8 100644 --- a/reference/stacktrace/stacktrace_entry/description.md +++ b/reference/stacktrace/stacktrace_entry/description.md @@ -62,5 +62,5 @@ g() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 12 +- [GCC](/implementation.md#gcc): 12 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/stacktrace_entry/formatter.md b/reference/stacktrace/stacktrace_entry/formatter.md index 9ba096a8fd..db3ec7f027 100644 --- a/reference/stacktrace/stacktrace_entry/formatter.md +++ b/reference/stacktrace/stacktrace_entry/formatter.md @@ -56,7 +56,7 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 14 +- [GCC](/implementation.md#gcc): 14 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/stacktrace_entry/native_handle.md b/reference/stacktrace/stacktrace_entry/native_handle.md index d5b7f91cff..996b6975db 100644 --- a/reference/stacktrace/stacktrace_entry/native_handle.md +++ b/reference/stacktrace/stacktrace_entry/native_handle.md @@ -61,5 +61,5 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 12 +- [GCC](/implementation.md#gcc): 12 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/stacktrace_entry/op_bool.md b/reference/stacktrace/stacktrace_entry/op_bool.md index 28a6af0b36..d6e62b1cae 100644 --- a/reference/stacktrace/stacktrace_entry/op_bool.md +++ b/reference/stacktrace/stacktrace_entry/op_bool.md @@ -57,5 +57,5 @@ not empty ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 12 +- [GCC](/implementation.md#gcc): 12 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/stacktrace_entry/op_constructor.md b/reference/stacktrace/stacktrace_entry/op_constructor.md index 7780923e21..ae87e8610a 100644 --- a/reference/stacktrace/stacktrace_entry/op_constructor.md +++ b/reference/stacktrace/stacktrace_entry/op_constructor.md @@ -29,5 +29,5 @@ stacktrace_entry(const stacktrace_entry& other) noexcept; // (2) C++23 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 12 +- [GCC](/implementation.md#gcc): 12 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/stacktrace_entry/op_equal.md b/reference/stacktrace/stacktrace_entry/op_equal.md index 5d29430fa0..4d549c3251 100644 --- a/reference/stacktrace/stacktrace_entry/op_equal.md +++ b/reference/stacktrace/stacktrace_entry/op_equal.md @@ -59,7 +59,7 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 12 +- [GCC](/implementation.md#gcc): 12 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/stacktrace_entry/op_ostream.md b/reference/stacktrace/stacktrace_entry/op_ostream.md index a7c215306c..41769250d5 100644 --- a/reference/stacktrace/stacktrace_entry/op_ostream.md +++ b/reference/stacktrace/stacktrace_entry/op_ostream.md @@ -58,5 +58,5 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 12 +- [GCC](/implementation.md#gcc): 12 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/stacktrace_entry/source_file.md b/reference/stacktrace/stacktrace_entry/source_file.md index 7488b24293..a3e7d02d0a 100644 --- a/reference/stacktrace/stacktrace_entry/source_file.md +++ b/reference/stacktrace/stacktrace_entry/source_file.md @@ -62,5 +62,5 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 12 +- [GCC](/implementation.md#gcc): 12 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/stacktrace_entry/source_line.md b/reference/stacktrace/stacktrace_entry/source_line.md index d6a9d62e75..1adecc5b2c 100644 --- a/reference/stacktrace/stacktrace_entry/source_line.md +++ b/reference/stacktrace/stacktrace_entry/source_line.md @@ -64,5 +64,5 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 12 +- [GCC](/implementation.md#gcc): 12 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stacktrace/stacktrace_entry/to_string.md b/reference/stacktrace/stacktrace_entry/to_string.md index 105e00ca40..98372eb085 100644 --- a/reference/stacktrace/stacktrace_entry/to_string.md +++ b/reference/stacktrace/stacktrace_entry/to_string.md @@ -58,5 +58,5 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 12 +- [GCC](/implementation.md#gcc): 12 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stdfloat/bfloat16_t.md b/reference/stdfloat/bfloat16_t.md index 95fec2634a..d4b04444ad 100644 --- a/reference/stdfloat/bfloat16_t.md +++ b/reference/stdfloat/bfloat16_t.md @@ -167,7 +167,7 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stdfloat/float128_t.md b/reference/stdfloat/float128_t.md index 2ce8adee12..0472946b48 100644 --- a/reference/stdfloat/float128_t.md +++ b/reference/stdfloat/float128_t.md @@ -165,7 +165,7 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stdfloat/float16_t.md b/reference/stdfloat/float16_t.md index ed7cacc630..6834622594 100644 --- a/reference/stdfloat/float16_t.md +++ b/reference/stdfloat/float16_t.md @@ -165,7 +165,7 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stdfloat/float32_t.md b/reference/stdfloat/float32_t.md index f562c5c8fa..3ffb0ed3c9 100644 --- a/reference/stdfloat/float32_t.md +++ b/reference/stdfloat/float32_t.md @@ -165,7 +165,7 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/stdfloat/float64_t.md b/reference/stdfloat/float64_t.md index 4bfe085ee0..b1e89ed2a9 100644 --- a/reference/stdfloat/float64_t.md +++ b/reference/stdfloat/float64_t.md @@ -165,7 +165,7 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 13.1 +- [GCC](/implementation.md#gcc): 13.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string/basic_string/contains.md b/reference/string/basic_string/contains.md index b4b0abd01d..52cd09cc0f 100644 --- a/reference/string/basic_string/contains.md +++ b/reference/string/basic_string/contains.md @@ -73,7 +73,7 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 12.0 +- [Clang](/implementation.md#clang): 12.0 [mark verified] - [GCC](/implementation.md#gcc): - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string/basic_string/ends_with.md b/reference/string/basic_string/ends_with.md index f2119430e6..32b045272f 100644 --- a/reference/string/basic_string/ends_with.md +++ b/reference/string/basic_string/ends_with.md @@ -74,9 +74,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 update 1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 update 1 [mark verified] ## 参照 - [P0457R2 String Prefix and Suffix Checking](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0457r2.html) diff --git a/reference/string/basic_string/erase_free.md b/reference/string/basic_string/erase_free.md index 971ac0507a..35d7ec1a3d 100644 --- a/reference/string/basic_string/erase_free.md +++ b/reference/string/basic_string/erase_free.md @@ -63,8 +63,8 @@ HelloWorld - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 9.1 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string/basic_string/erase_if_free.md b/reference/string/basic_string/erase_if_free.md index cd8af1d522..e994f3d7de 100644 --- a/reference/string/basic_string/erase_if_free.md +++ b/reference/string/basic_string/erase_if_free.md @@ -63,8 +63,8 @@ HelloWorld - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 9.1 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string/basic_string/get_allocator.md b/reference/string/basic_string/get_allocator.md index 1c9085a026..704b7929fd 100644 --- a/reference/string/basic_string/get_allocator.md +++ b/reference/string/basic_string/get_allocator.md @@ -53,11 +53,11 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.4, 4.6.4, 4.7.3, 4.8.2 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.2 [mark verified] - [GCC](/implementation.md#gcc): - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2002, 2003, 2005, 2008, 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2002 [mark verified], 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - 2012, 2013は、`noexcept`が実装されていないため、`throw()`が修飾されている。 - 2015からは、`noexcept`が修飾されている。 diff --git a/reference/string/basic_string/op_deduction_guide.md b/reference/string/basic_string/op_deduction_guide.md index 65e7d0bee3..cda97ea537 100644 --- a/reference/string/basic_string/op_deduction_guide.md +++ b/reference/string/basic_string/op_deduction_guide.md @@ -94,8 +94,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 8.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string/basic_string/op_s.md b/reference/string/basic_string/op_s.md index add5b32b3c..e755c67dfe 100644 --- a/reference/string/basic_string/op_s.md +++ b/reference/string/basic_string/op_s.md @@ -75,10 +75,10 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.4 -- [GCC](/implementation.md#gcc): 4.9.0 +- [Clang](/implementation.md#clang): 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] ## 参照 diff --git a/reference/string/basic_string/pop_back.md b/reference/string/basic_string/pop_back.md index fdfc98c9ab..6c69afabf6 100644 --- a/reference/string/basic_string/pop_back.md +++ b/reference/string/basic_string/pop_back.md @@ -53,8 +53,8 @@ hello - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.7.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.3 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/string/basic_string/shrink_to_fit.md b/reference/string/basic_string/shrink_to_fit.md index eee5ba7012..0499b056df 100644 --- a/reference/string/basic_string/shrink_to_fit.md +++ b/reference/string/basic_string/shrink_to_fit.md @@ -74,10 +74,10 @@ void basic_string::shrink_to_fit() { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.4 -- [GCC](/implementation.md#gcc): 4.5.4, 4.6.4, 4.7.3, 4.8.2 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.3 [mark verified], 4.8.2 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified] ## 関連項目 diff --git a/reference/string/basic_string/starts_with.md b/reference/string/basic_string/starts_with.md index 6e2f1c96f4..0c5d10c172 100644 --- a/reference/string/basic_string/starts_with.md +++ b/reference/string/basic_string/starts_with.md @@ -74,9 +74,9 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 update 1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 update 1 [mark verified] ## 参照 - [P0457R2 String Prefix and Suffix Checking](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0457r2.html) diff --git a/reference/string/stod.md b/reference/string/stod.md index 0f93cc79f5..cbf7ef2175 100644 --- a/reference/string/stod.md +++ b/reference/string/stod.md @@ -166,9 +166,9 @@ double stod(const std::wstring& str, std::size_t* idx = nullptr) { ### 処理系 - [Clang](/implementation.md#clang): ? -- [GCC](/implementation.md#gcc): 4.8.5 +- [GCC](/implementation.md#gcc): 4.8.5 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ただし、Visual C++ 10.0, 11.0は十六進法に対応していない(12.0は未確認)。 diff --git a/reference/string/stof.md b/reference/string/stof.md index 9c51028250..95ab2cb9cb 100644 --- a/reference/string/stof.md +++ b/reference/string/stof.md @@ -166,9 +166,9 @@ float stof(const std::wstring& str, std::size_t* idx = nullptr) { ### 処理系 - [Clang](/implementation.md#clang): ? -- [GCC](/implementation.md#gcc): 4.8.5 +- [GCC](/implementation.md#gcc): 4.8.5 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ただし、Visual C++ 10.0, 11.0は十六進法に対応していない(12.0は未確認)。 diff --git a/reference/string/stoi.md b/reference/string/stoi.md index de86bacbe9..91dec0477e 100644 --- a/reference/string/stoi.md +++ b/reference/string/stoi.md @@ -229,7 +229,7 @@ int stoi(const std::wstring& str, std::size_t* idx = nullptr, int base = 10) { - [Clang](/implementation.md#clang): ? - [GCC](/implementation.md#gcc): ? - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 関連リンク diff --git a/reference/string/stol.md b/reference/string/stol.md index 204cb49908..d558864eea 100644 --- a/reference/string/stol.md +++ b/reference/string/stol.md @@ -227,7 +227,7 @@ long stol(const std::wstring& str, std::size_t* idx = nullptr, long base = 10) { - [Clang](/implementation.md#clang): ? - [GCC](/implementation.md#gcc): ? - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 関連リンク diff --git a/reference/string/stold.md b/reference/string/stold.md index 8f3bf834f8..8481acdddc 100644 --- a/reference/string/stold.md +++ b/reference/string/stold.md @@ -168,7 +168,7 @@ long double stold(const std::wstring& str, std::size_t* idx = nullptr) { - [Clang](/implementation.md#clang): ? - [GCC](/implementation.md#gcc): ? - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ただし、Visual C++ 10.0, 11.0は十六進法に対応していない(12.0は未確認)。 diff --git a/reference/string/stoll.md b/reference/string/stoll.md index 998ad09f07..8dcb6ff153 100644 --- a/reference/string/stoll.md +++ b/reference/string/stoll.md @@ -232,7 +232,7 @@ long long stoll(const std::wstring& str, std::size_t* idx = nullptr, long long b - [Clang](/implementation.md#clang): ? - [GCC](/implementation.md#gcc): ? - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 関連リンク diff --git a/reference/string/stoul.md b/reference/string/stoul.md index d484ed9480..0cdb0ef75c 100644 --- a/reference/string/stoul.md +++ b/reference/string/stoul.md @@ -232,7 +232,7 @@ unsigned long stoul(const std::wstring& str, std::size_t* idx = nullptr, unsigne - [Clang](/implementation.md#clang): ? - [GCC](/implementation.md#gcc): ? - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 関連リンク diff --git a/reference/string/stoull.md b/reference/string/stoull.md index 099f842888..4396231668 100644 --- a/reference/string/stoull.md +++ b/reference/string/stoull.md @@ -232,7 +232,7 @@ unsigned long long stoull(const std::wstring& str, std::size_t* idx = nullptr, u - [Clang](/implementation.md#clang): ? - [GCC](/implementation.md#gcc): ? - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 関連リンク diff --git a/reference/string/to_string.md b/reference/string/to_string.md index dd608ebfce..0ee447df28 100644 --- a/reference/string/to_string.md +++ b/reference/string/to_string.md @@ -169,10 +169,10 @@ std::string to_string(long double val) - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.5.4 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.5.4 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - 2010は、不完全な実装。以下の型のみ多重定義されている。 - `long long` - `unsigned long long` diff --git a/reference/string/to_wstring.md b/reference/string/to_wstring.md index d29a5ca927..37e49c9eeb 100644 --- a/reference/string/to_wstring.md +++ b/reference/string/to_wstring.md @@ -179,10 +179,10 @@ std::wstring to_wstring(long double val) - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.5.4 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.5.4 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - 2010は、不完全な実装。以下の型のみ多重定義されている。 - `long long` - `unsigned long long` diff --git a/reference/string_view/basic_string_view.md b/reference/string_view/basic_string_view.md index da546eea56..96b45116c1 100644 --- a/reference/string_view/basic_string_view.md +++ b/reference/string_view/basic_string_view.md @@ -303,8 +303,8 @@ C - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/at.md b/reference/string_view/basic_string_view/at.md index b3600e6fdc..7d1ebc8667 100644 --- a/reference/string_view/basic_string_view/at.md +++ b/reference/string_view/basic_string_view/at.md @@ -49,7 +49,7 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/back.md b/reference/string_view/basic_string_view/back.md index 3daa37822c..360eab74d4 100644 --- a/reference/string_view/basic_string_view/back.md +++ b/reference/string_view/basic_string_view/back.md @@ -54,7 +54,7 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/begin.md b/reference/string_view/basic_string_view/begin.md index 9f6abd2935..07d56a859e 100644 --- a/reference/string_view/basic_string_view/begin.md +++ b/reference/string_view/basic_string_view/begin.md @@ -50,7 +50,7 @@ o - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/cbegin.md b/reference/string_view/basic_string_view/cbegin.md index 0868f6ab47..4f1c8c874f 100644 --- a/reference/string_view/basic_string_view/cbegin.md +++ b/reference/string_view/basic_string_view/cbegin.md @@ -50,7 +50,7 @@ o - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/cend.md b/reference/string_view/basic_string_view/cend.md index a4d076af06..c177a904db 100644 --- a/reference/string_view/basic_string_view/cend.md +++ b/reference/string_view/basic_string_view/cend.md @@ -54,7 +54,7 @@ o - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/compare.md b/reference/string_view/basic_string_view/compare.md index b75a42bc39..362bd15fd2 100644 --- a/reference/string_view/basic_string_view/compare.md +++ b/reference/string_view/basic_string_view/compare.md @@ -124,7 +124,7 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/contains.md b/reference/string_view/basic_string_view/contains.md index a99cb51a54..1cad2cabd2 100644 --- a/reference/string_view/basic_string_view/contains.md +++ b/reference/string_view/basic_string_view/contains.md @@ -69,7 +69,7 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 12.0 +- [Clang](/implementation.md#clang): 12.0 [mark verified] - [GCC](/implementation.md#gcc): - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/copy.md b/reference/string_view/basic_string_view/copy.md index add3b126ca..e311b893b5 100644 --- a/reference/string_view/basic_string_view/copy.md +++ b/reference/string_view/basic_string_view/copy.md @@ -88,8 +88,8 @@ llo - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/crbegin.md b/reference/string_view/basic_string_view/crbegin.md index 21e7c8ef0d..d3b1c1ea73 100644 --- a/reference/string_view/basic_string_view/crbegin.md +++ b/reference/string_view/basic_string_view/crbegin.md @@ -53,7 +53,7 @@ H - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/crend.md b/reference/string_view/basic_string_view/crend.md index 318882db0d..caa8a0932b 100644 --- a/reference/string_view/basic_string_view/crend.md +++ b/reference/string_view/basic_string_view/crend.md @@ -53,7 +53,7 @@ H - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/data.md b/reference/string_view/basic_string_view/data.md index 9feb96eec6..8962fb8586 100644 --- a/reference/string_view/basic_string_view/data.md +++ b/reference/string_view/basic_string_view/data.md @@ -59,7 +59,7 @@ c : Hello World - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/empty.md b/reference/string_view/basic_string_view/empty.md index e2a5fb5e2f..509f39c4e4 100644 --- a/reference/string_view/basic_string_view/empty.md +++ b/reference/string_view/basic_string_view/empty.md @@ -50,8 +50,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/end.md b/reference/string_view/basic_string_view/end.md index a84cd1d21a..e8c863758d 100644 --- a/reference/string_view/basic_string_view/end.md +++ b/reference/string_view/basic_string_view/end.md @@ -54,7 +54,7 @@ o - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/ends_with.md b/reference/string_view/basic_string_view/ends_with.md index 42c0e3644f..2e9b2ac53d 100644 --- a/reference/string_view/basic_string_view/ends_with.md +++ b/reference/string_view/basic_string_view/ends_with.md @@ -82,8 +82,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 9.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 diff --git a/reference/string_view/basic_string_view/find.md b/reference/string_view/basic_string_view/find.md index 1707b286c3..142accc87b 100644 --- a/reference/string_view/basic_string_view/find.md +++ b/reference/string_view/basic_string_view/find.md @@ -101,8 +101,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/find_first_not_of.md b/reference/string_view/basic_string_view/find_first_not_of.md index 11f7199396..e87371fe88 100644 --- a/reference/string_view/basic_string_view/find_first_not_of.md +++ b/reference/string_view/basic_string_view/find_first_not_of.md @@ -98,7 +98,7 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/find_first_of.md b/reference/string_view/basic_string_view/find_first_of.md index 0f73479742..5c7d4d063b 100644 --- a/reference/string_view/basic_string_view/find_first_of.md +++ b/reference/string_view/basic_string_view/find_first_of.md @@ -82,7 +82,7 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/find_last_not_of.md b/reference/string_view/basic_string_view/find_last_not_of.md index abb43beed5..32cbf0bf5e 100644 --- a/reference/string_view/basic_string_view/find_last_not_of.md +++ b/reference/string_view/basic_string_view/find_last_not_of.md @@ -99,7 +99,7 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/find_last_of.md b/reference/string_view/basic_string_view/find_last_of.md index d6580a2679..8c7f549753 100644 --- a/reference/string_view/basic_string_view/find_last_of.md +++ b/reference/string_view/basic_string_view/find_last_of.md @@ -85,7 +85,7 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/front.md b/reference/string_view/basic_string_view/front.md index 63b7f59cb1..762fba64b4 100644 --- a/reference/string_view/basic_string_view/front.md +++ b/reference/string_view/basic_string_view/front.md @@ -53,7 +53,7 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/length.md b/reference/string_view/basic_string_view/length.md index 8f44b1d40c..8dc0f8efd5 100644 --- a/reference/string_view/basic_string_view/length.md +++ b/reference/string_view/basic_string_view/length.md @@ -54,7 +54,7 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/max_size.md b/reference/string_view/basic_string_view/max_size.md index 91c0f83dfc..f0f83a1363 100644 --- a/reference/string_view/basic_string_view/max_size.md +++ b/reference/string_view/basic_string_view/max_size.md @@ -48,7 +48,7 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/op_at.md b/reference/string_view/basic_string_view/op_at.md index c01475df10..b6c89e4e10 100644 --- a/reference/string_view/basic_string_view/op_at.md +++ b/reference/string_view/basic_string_view/op_at.md @@ -57,7 +57,7 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/op_compare_3way.md b/reference/string_view/basic_string_view/op_compare_3way.md index d885c78d89..e22fe1cd5d 100644 --- a/reference/string_view/basic_string_view/op_compare_3way.md +++ b/reference/string_view/basic_string_view/op_compare_3way.md @@ -66,7 +66,7 @@ equal ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10 +- [GCC](/implementation.md#gcc): 10 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/op_constructor.md b/reference/string_view/basic_string_view/op_constructor.md index 87c4e83782..0c849b8830 100644 --- a/reference/string_view/basic_string_view/op_constructor.md +++ b/reference/string_view/basic_string_view/op_constructor.md @@ -165,8 +165,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 (5以外) -- [GCC](/implementation.md#gcc): 7.1 (5以外), 10.1 +- [Clang](/implementation.md#clang): 4.0 (5以外) [mark verified] +- [GCC](/implementation.md#gcc): 7.1 (5以外) [mark verified], 10.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/op_deduction_guide.md b/reference/string_view/basic_string_view/op_deduction_guide.md index 2e4afdd5b7..a199df4fe2 100644 --- a/reference/string_view/basic_string_view/op_deduction_guide.md +++ b/reference/string_view/basic_string_view/op_deduction_guide.md @@ -57,7 +57,7 @@ Hello ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10.1 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/op_equal.md b/reference/string_view/basic_string_view/op_equal.md index 2919eb6e97..982f397dd4 100644 --- a/reference/string_view/basic_string_view/op_equal.md +++ b/reference/string_view/basic_string_view/op_equal.md @@ -57,8 +57,8 @@ equal - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/op_greater.md b/reference/string_view/basic_string_view/op_greater.md index 210a1d5042..12ed1c68d7 100644 --- a/reference/string_view/basic_string_view/op_greater.md +++ b/reference/string_view/basic_string_view/op_greater.md @@ -53,8 +53,8 @@ greater - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/op_greater_equal.md b/reference/string_view/basic_string_view/op_greater_equal.md index 6594a449e0..269a782f29 100644 --- a/reference/string_view/basic_string_view/op_greater_equal.md +++ b/reference/string_view/basic_string_view/op_greater_equal.md @@ -53,8 +53,8 @@ greater equal - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/op_less.md b/reference/string_view/basic_string_view/op_less.md index fa1f09b447..e59d11c581 100644 --- a/reference/string_view/basic_string_view/op_less.md +++ b/reference/string_view/basic_string_view/op_less.md @@ -53,8 +53,8 @@ less - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/op_less_equal.md b/reference/string_view/basic_string_view/op_less_equal.md index a2aae9478a..c405b26a7c 100644 --- a/reference/string_view/basic_string_view/op_less_equal.md +++ b/reference/string_view/basic_string_view/op_less_equal.md @@ -53,8 +53,8 @@ less equal - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/op_not_equal.md b/reference/string_view/basic_string_view/op_not_equal.md index 68e46fe07b..5b763e280a 100644 --- a/reference/string_view/basic_string_view/op_not_equal.md +++ b/reference/string_view/basic_string_view/op_not_equal.md @@ -53,8 +53,8 @@ not equal - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/op_ostream.md b/reference/string_view/basic_string_view/op_ostream.md index bce2a8bc23..65a25398a7 100644 --- a/reference/string_view/basic_string_view/op_ostream.md +++ b/reference/string_view/basic_string_view/op_ostream.md @@ -49,7 +49,7 @@ Hello - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/op_sv.md b/reference/string_view/basic_string_view/op_sv.md index 2cd1b5df3b..73aa146043 100644 --- a/reference/string_view/basic_string_view/op_sv.md +++ b/reference/string_view/basic_string_view/op_sv.md @@ -94,8 +94,8 @@ Hel - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/rbegin.md b/reference/string_view/basic_string_view/rbegin.md index 64cb756794..e725118178 100644 --- a/reference/string_view/basic_string_view/rbegin.md +++ b/reference/string_view/basic_string_view/rbegin.md @@ -53,7 +53,7 @@ H - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/remove_prefix.md b/reference/string_view/basic_string_view/remove_prefix.md index 40c9257770..a819f88801 100644 --- a/reference/string_view/basic_string_view/remove_prefix.md +++ b/reference/string_view/basic_string_view/remove_prefix.md @@ -51,7 +51,7 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/remove_suffix.md b/reference/string_view/basic_string_view/remove_suffix.md index 7e7681c10c..714cb00bc9 100644 --- a/reference/string_view/basic_string_view/remove_suffix.md +++ b/reference/string_view/basic_string_view/remove_suffix.md @@ -50,7 +50,7 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/rend.md b/reference/string_view/basic_string_view/rend.md index c0b14143c4..dd16b1252a 100644 --- a/reference/string_view/basic_string_view/rend.md +++ b/reference/string_view/basic_string_view/rend.md @@ -53,7 +53,7 @@ H - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/rfind.md b/reference/string_view/basic_string_view/rfind.md index c158277677..942bbf1a33 100644 --- a/reference/string_view/basic_string_view/rfind.md +++ b/reference/string_view/basic_string_view/rfind.md @@ -102,7 +102,7 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/size.md b/reference/string_view/basic_string_view/size.md index a3dec81c46..6e7864c732 100644 --- a/reference/string_view/basic_string_view/size.md +++ b/reference/string_view/basic_string_view/size.md @@ -58,7 +58,7 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/starts_with.md b/reference/string_view/basic_string_view/starts_with.md index 63e2e3c225..acd4c72f3f 100644 --- a/reference/string_view/basic_string_view/starts_with.md +++ b/reference/string_view/basic_string_view/starts_with.md @@ -82,8 +82,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 7.0 -- [GCC](/implementation.md#gcc): 9.1 +- [Clang](/implementation.md#clang): 7.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 diff --git a/reference/string_view/basic_string_view/substr.md b/reference/string_view/basic_string_view/substr.md index 9f7941186e..2974a14df5 100644 --- a/reference/string_view/basic_string_view/substr.md +++ b/reference/string_view/basic_string_view/substr.md @@ -61,7 +61,7 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/string_view/basic_string_view/swap.md b/reference/string_view/basic_string_view/swap.md index c0d2a1c051..23fee538bd 100644 --- a/reference/string_view/basic_string_view/swap.md +++ b/reference/string_view/basic_string_view/swap.md @@ -55,7 +55,7 @@ AAA - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/syncstream.md b/reference/syncstream.md index 16d918d789..848fa33027 100644 --- a/reference/syncstream.md +++ b/reference/syncstream.md @@ -31,8 +31,8 @@ ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 update 10 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 update 10 [mark verified] ## 関連項目 diff --git a/reference/syncstream/basic_osyncstream.md b/reference/syncstream/basic_osyncstream.md index b3f79b0cce..ed3bbe1284 100644 --- a/reference/syncstream/basic_osyncstream.md +++ b/reference/syncstream/basic_osyncstream.md @@ -160,8 +160,8 @@ aGoodbye, Planet! ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 update 10 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 update 10 [mark verified] ## 関連項目 diff --git a/reference/syncstream/basic_osyncstream/emit.md b/reference/syncstream/basic_osyncstream/emit.md index f4fb1d29be..59493c5283 100644 --- a/reference/syncstream/basic_osyncstream/emit.md +++ b/reference/syncstream/basic_osyncstream/emit.md @@ -70,8 +70,8 @@ Greetings. ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 update 10 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 update 10 [mark verified] ## 参照 diff --git a/reference/syncstream/basic_osyncstream/get_wrapped.md b/reference/syncstream/basic_osyncstream/get_wrapped.md index 5534fdd112..e1581670a3 100644 --- a/reference/syncstream/basic_osyncstream/get_wrapped.md +++ b/reference/syncstream/basic_osyncstream/get_wrapped.md @@ -54,8 +54,8 @@ Hello, World! ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 update 10 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 update 10 [mark verified] ## 参照 diff --git a/reference/syncstream/basic_osyncstream/op_assign.md b/reference/syncstream/basic_osyncstream/op_assign.md index 04f401e4c3..0e0b3c123b 100644 --- a/reference/syncstream/basic_osyncstream/op_assign.md +++ b/reference/syncstream/basic_osyncstream/op_assign.md @@ -63,8 +63,8 @@ Hello, World! ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 update 10 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 update 10 [mark verified] ## 参照 diff --git a/reference/syncstream/basic_osyncstream/op_constructor.md b/reference/syncstream/basic_osyncstream/op_constructor.md index 3e86b8a664..8039478608 100644 --- a/reference/syncstream/basic_osyncstream/op_constructor.md +++ b/reference/syncstream/basic_osyncstream/op_constructor.md @@ -61,8 +61,8 @@ Hello, World! ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 update 10 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 update 10 [mark verified] ## 参照 diff --git a/reference/syncstream/basic_osyncstream/op_destructor.md b/reference/syncstream/basic_osyncstream/op_destructor.md index fc8ee8dbb9..f365c1ea9a 100644 --- a/reference/syncstream/basic_osyncstream/op_destructor.md +++ b/reference/syncstream/basic_osyncstream/op_destructor.md @@ -45,8 +45,8 @@ Hello, World! ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 update 10 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 update 10 [mark verified] ## 参照 diff --git a/reference/syncstream/basic_osyncstream/rdbuf.md b/reference/syncstream/basic_osyncstream/rdbuf.md index 259b75d756..fbc0e01607 100644 --- a/reference/syncstream/basic_osyncstream/rdbuf.md +++ b/reference/syncstream/basic_osyncstream/rdbuf.md @@ -53,8 +53,8 @@ Hello, World! ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 update 10 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 update 10 [mark verified] ## 参照 diff --git a/reference/syncstream/basic_syncbuf.md b/reference/syncstream/basic_syncbuf.md index 17b1a8dbd9..f9b3a26808 100644 --- a/reference/syncstream/basic_syncbuf.md +++ b/reference/syncstream/basic_syncbuf.md @@ -133,8 +133,8 @@ Goodbye, Planet! ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 update 10 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 update 10 [mark verified] ## 関連項目 diff --git a/reference/syncstream/basic_syncbuf/emit.md b/reference/syncstream/basic_syncbuf/emit.md index 6a8a0417b5..602a83711d 100644 --- a/reference/syncstream/basic_syncbuf/emit.md +++ b/reference/syncstream/basic_syncbuf/emit.md @@ -86,8 +86,8 @@ Goodbye, Planet! ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 update 10 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 update 10 [mark verified] ## 参照 diff --git a/reference/syncstream/basic_syncbuf/get_allocator.md b/reference/syncstream/basic_syncbuf/get_allocator.md index 3d7c3ad9cd..aa1b25cca9 100644 --- a/reference/syncstream/basic_syncbuf/get_allocator.md +++ b/reference/syncstream/basic_syncbuf/get_allocator.md @@ -49,8 +49,8 @@ Hello, World! ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 update 10 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 update 10 [mark verified] ## 参照 diff --git a/reference/syncstream/basic_syncbuf/get_wrapped.md b/reference/syncstream/basic_syncbuf/get_wrapped.md index 6483e90997..7a56f6b90a 100644 --- a/reference/syncstream/basic_syncbuf/get_wrapped.md +++ b/reference/syncstream/basic_syncbuf/get_wrapped.md @@ -54,8 +54,8 @@ Hello, World! ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 update 10 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 update 10 [mark verified] ## 参照 diff --git a/reference/syncstream/basic_syncbuf/op_assign.md b/reference/syncstream/basic_syncbuf/op_assign.md index 3749495916..b31527d6d1 100644 --- a/reference/syncstream/basic_syncbuf/op_assign.md +++ b/reference/syncstream/basic_syncbuf/op_assign.md @@ -67,8 +67,8 @@ Hello, World! ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 update 10 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 update 10 [mark verified] ## 参照 diff --git a/reference/syncstream/basic_syncbuf/op_constructor.md b/reference/syncstream/basic_syncbuf/op_constructor.md index 3efa11cfe4..6bd4e1e356 100644 --- a/reference/syncstream/basic_syncbuf/op_constructor.md +++ b/reference/syncstream/basic_syncbuf/op_constructor.md @@ -66,8 +66,8 @@ Hello, World! ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 update 10 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 update 10 [mark verified] ## 参照 diff --git a/reference/syncstream/basic_syncbuf/op_destructor.md b/reference/syncstream/basic_syncbuf/op_destructor.md index a78100c0b6..cf48c7889d 100644 --- a/reference/syncstream/basic_syncbuf/op_destructor.md +++ b/reference/syncstream/basic_syncbuf/op_destructor.md @@ -45,8 +45,8 @@ Hello, World! ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 update 10 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 update 10 [mark verified] ## 参照 diff --git a/reference/syncstream/basic_syncbuf/set_emit_on_sync.md b/reference/syncstream/basic_syncbuf/set_emit_on_sync.md index cb78502081..31506dde5e 100644 --- a/reference/syncstream/basic_syncbuf/set_emit_on_sync.md +++ b/reference/syncstream/basic_syncbuf/set_emit_on_sync.md @@ -57,8 +57,8 @@ Hello, World! ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 update 10 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 update 10 [mark verified] ## 参照 diff --git a/reference/syncstream/basic_syncbuf/swap.md b/reference/syncstream/basic_syncbuf/swap.md index 2ede82f0f5..4e3f50fc05 100644 --- a/reference/syncstream/basic_syncbuf/swap.md +++ b/reference/syncstream/basic_syncbuf/swap.md @@ -64,8 +64,8 @@ Hello, World! ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 update 10 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 update 10 [mark verified] ## 参照 diff --git a/reference/syncstream/basic_syncbuf/swap_free.md b/reference/syncstream/basic_syncbuf/swap_free.md index 9571d80ac7..1aaecf1f6f 100644 --- a/reference/syncstream/basic_syncbuf/swap_free.md +++ b/reference/syncstream/basic_syncbuf/swap_free.md @@ -63,8 +63,8 @@ Hello, World! ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 update 10 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 update 10 [mark verified] ## 参照 diff --git a/reference/syncstream/basic_syncbuf/sync.md b/reference/syncstream/basic_syncbuf/sync.md index 81fd6cda4d..6dab3253d8 100644 --- a/reference/syncstream/basic_syncbuf/sync.md +++ b/reference/syncstream/basic_syncbuf/sync.md @@ -56,8 +56,8 @@ Hello, World! ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 11.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 update 10 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 update 10 [mark verified] ## 参照 diff --git a/reference/system_error/error_category.md b/reference/system_error/error_category.md index bde401d72d..6c3af9e7aa 100644 --- a/reference/system_error/error_category.md +++ b/reference/system_error/error_category.md @@ -91,7 +91,7 @@ user defined error ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/system_error/error_category/default_error_condition.md b/reference/system_error/error_category/default_error_condition.md index 6316cd1839..0e65535fb9 100644 --- a/reference/system_error/error_category/default_error_condition.md +++ b/reference/system_error/error_category/default_error_condition.md @@ -57,9 +57,9 @@ Not a directory ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 参照 diff --git a/reference/system_error/error_category/equivalent.md b/reference/system_error/error_category/equivalent.md index aebd3b4358..30fb7dd97e 100644 --- a/reference/system_error/error_category/equivalent.md +++ b/reference/system_error/error_category/equivalent.md @@ -68,8 +68,8 @@ false ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 参照 diff --git a/reference/system_error/error_category/message.md b/reference/system_error/error_category/message.md index 04ef9efeec..0b0283d1cf 100644 --- a/reference/system_error/error_category/message.md +++ b/reference/system_error/error_category/message.md @@ -48,9 +48,9 @@ Not a directory ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 参照 diff --git a/reference/system_error/error_category/name.md b/reference/system_error/error_category/name.md index 5a71cef655..9f156908f3 100644 --- a/reference/system_error/error_category/name.md +++ b/reference/system_error/error_category/name.md @@ -51,9 +51,9 @@ system ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 参照 diff --git a/reference/system_error/error_category/op_compare_3way.md b/reference/system_error/error_category/op_compare_3way.md index ca3e16c59e..386948595f 100644 --- a/reference/system_error/error_category/op_compare_3way.md +++ b/reference/system_error/error_category/op_compare_3way.md @@ -70,7 +70,7 @@ true ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10 +- [GCC](/implementation.md#gcc): 10 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/system_error/error_category/op_constructor.md b/reference/system_error/error_category/op_constructor.md index 564629b244..0a422cab26 100644 --- a/reference/system_error/error_category/op_constructor.md +++ b/reference/system_error/error_category/op_constructor.md @@ -59,9 +59,9 @@ user defined error ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 (ただしnoexceptは使用不可) +- [Visual C++](/implementation.md#visual_cpp): 2010 (ただしnoexceptは使用不可) [mark verified] ## 参照 diff --git a/reference/system_error/error_category/op_equal.md b/reference/system_error/error_category/op_equal.md index b1f26b0c3a..24e492064d 100644 --- a/reference/system_error/error_category/op_equal.md +++ b/reference/system_error/error_category/op_equal.md @@ -60,9 +60,9 @@ false ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 参照 diff --git a/reference/system_error/error_category/op_less.md b/reference/system_error/error_category/op_less.md index 6274b03736..e83f4a9329 100644 --- a/reference/system_error/error_category/op_less.md +++ b/reference/system_error/error_category/op_less.md @@ -56,9 +56,9 @@ false ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 参照 diff --git a/reference/system_error/error_category/op_not_equal.md b/reference/system_error/error_category/op_not_equal.md index aebcc0c341..25523aaa23 100644 --- a/reference/system_error/error_category/op_not_equal.md +++ b/reference/system_error/error_category/op_not_equal.md @@ -56,9 +56,9 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 参照 diff --git a/reference/system_error/error_code.md b/reference/system_error/error_code.md index 705e8b446f..80bd480849 100644 --- a/reference/system_error/error_code.md +++ b/reference/system_error/error_code.md @@ -97,9 +97,9 @@ Invalid argument ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 参照 diff --git a/reference/system_error/error_code/assign.md b/reference/system_error/error_code/assign.md index 3a737eec49..ea5ca5e311 100644 --- a/reference/system_error/error_code/assign.md +++ b/reference/system_error/error_code/assign.md @@ -68,9 +68,9 @@ generic ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 参照 diff --git a/reference/system_error/error_code/category.md b/reference/system_error/error_code/category.md index 71d3761dd7..be31d4187b 100644 --- a/reference/system_error/error_code/category.md +++ b/reference/system_error/error_code/category.md @@ -53,9 +53,9 @@ generic ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 参照 diff --git a/reference/system_error/error_code/clear.md b/reference/system_error/error_code/clear.md index bb3768ee90..1878bf93be 100644 --- a/reference/system_error/error_code/clear.md +++ b/reference/system_error/error_code/clear.md @@ -68,9 +68,9 @@ system ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 参照 diff --git a/reference/system_error/error_code/default_error_condition.md b/reference/system_error/error_code/default_error_condition.md index 13f9127113..8764b48b39 100644 --- a/reference/system_error/error_code/default_error_condition.md +++ b/reference/system_error/error_code/default_error_condition.md @@ -84,9 +84,9 @@ Invalid argument ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 参照 diff --git a/reference/system_error/error_code/message.md b/reference/system_error/error_code/message.md index 0cc17fc5a0..89979ed7b4 100644 --- a/reference/system_error/error_code/message.md +++ b/reference/system_error/error_code/message.md @@ -46,9 +46,9 @@ Invalid argument ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 参照 diff --git a/reference/system_error/error_code/op_assign.md b/reference/system_error/error_code/op_assign.md index 6065f0a69c..4151abf962 100644 --- a/reference/system_error/error_code/op_assign.md +++ b/reference/system_error/error_code/op_assign.md @@ -82,7 +82,7 @@ generic ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/system_error/error_code/op_bool.md b/reference/system_error/error_code/op_bool.md index cce6be505b..b8ad869a8e 100644 --- a/reference/system_error/error_code/op_bool.md +++ b/reference/system_error/error_code/op_bool.md @@ -67,9 +67,9 @@ error! : Invalid argument ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 参照 diff --git a/reference/system_error/error_code/op_compare_3way.md b/reference/system_error/error_code/op_compare_3way.md index e69eca5317..f5ed306d48 100644 --- a/reference/system_error/error_code/op_compare_3way.md +++ b/reference/system_error/error_code/op_compare_3way.md @@ -69,7 +69,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10 +- [GCC](/implementation.md#gcc): 10 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/system_error/error_code/op_constructor.md b/reference/system_error/error_code/op_constructor.md index bc4fd6c500..a961148de4 100644 --- a/reference/system_error/error_code/op_constructor.md +++ b/reference/system_error/error_code/op_constructor.md @@ -190,8 +190,8 @@ not found ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 (enum class未対応のため、ErrorCodeEnumのコンストラクタは動作しない) +- [Visual C++](/implementation.md#visual_cpp): 2010 (enum class未対応のため、ErrorCodeEnumのコンストラクタは動作しない) [mark verified] diff --git a/reference/system_error/error_code/op_less.md b/reference/system_error/error_code/op_less.md index ff4d23a499..6c14b79e1f 100644 --- a/reference/system_error/error_code/op_less.md +++ b/reference/system_error/error_code/op_less.md @@ -58,8 +58,8 @@ false ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 参照 diff --git a/reference/system_error/error_code/op_ostream.md b/reference/system_error/error_code/op_ostream.md index db80fce462..0fe39bd789 100644 --- a/reference/system_error/error_code/op_ostream.md +++ b/reference/system_error/error_code/op_ostream.md @@ -55,9 +55,9 @@ generic:22 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 参照 diff --git a/reference/system_error/error_code/value.md b/reference/system_error/error_code/value.md index e74d5698c4..edbe7f24ff 100644 --- a/reference/system_error/error_code/value.md +++ b/reference/system_error/error_code/value.md @@ -49,9 +49,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 参照 diff --git a/reference/system_error/error_condition.md b/reference/system_error/error_condition.md index 39fea2f8b1..92e95afa89 100644 --- a/reference/system_error/error_condition.md +++ b/reference/system_error/error_condition.md @@ -98,9 +98,9 @@ Invalid argument ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 参照 diff --git a/reference/system_error/error_condition/assign.md b/reference/system_error/error_condition/assign.md index b72e0abe4d..ff61f46898 100644 --- a/reference/system_error/error_condition/assign.md +++ b/reference/system_error/error_condition/assign.md @@ -68,9 +68,9 @@ generic ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 参照 diff --git a/reference/system_error/error_condition/category.md b/reference/system_error/error_condition/category.md index 6cc9904697..4c590dd39f 100644 --- a/reference/system_error/error_condition/category.md +++ b/reference/system_error/error_condition/category.md @@ -53,9 +53,9 @@ generic ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 参照 diff --git a/reference/system_error/error_condition/clear.md b/reference/system_error/error_condition/clear.md index 1c45bca3bf..28ba0a87a5 100644 --- a/reference/system_error/error_condition/clear.md +++ b/reference/system_error/error_condition/clear.md @@ -69,9 +69,9 @@ generic ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 参照 diff --git a/reference/system_error/error_condition/message.md b/reference/system_error/error_condition/message.md index 9cc99b2174..7400fabb7b 100644 --- a/reference/system_error/error_condition/message.md +++ b/reference/system_error/error_condition/message.md @@ -52,9 +52,9 @@ Invalid argument ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 参照 diff --git a/reference/system_error/error_condition/op_assign.md b/reference/system_error/error_condition/op_assign.md index 9eedcdf753..a435cc522d 100644 --- a/reference/system_error/error_condition/op_assign.md +++ b/reference/system_error/error_condition/op_assign.md @@ -75,9 +75,9 @@ generic ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 参照 diff --git a/reference/system_error/error_condition/op_bool.md b/reference/system_error/error_condition/op_bool.md index 6a7b210a21..cd1d8c8d8e 100644 --- a/reference/system_error/error_condition/op_bool.md +++ b/reference/system_error/error_condition/op_bool.md @@ -67,9 +67,9 @@ error! : Invalid argument ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 参照 diff --git a/reference/system_error/error_condition/op_compare_3way.md b/reference/system_error/error_condition/op_compare_3way.md index 0e7991235f..da9ced458e 100644 --- a/reference/system_error/error_condition/op_compare_3way.md +++ b/reference/system_error/error_condition/op_compare_3way.md @@ -69,7 +69,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10 +- [GCC](/implementation.md#gcc): 10 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/system_error/error_condition/op_constructor.md b/reference/system_error/error_condition/op_constructor.md index de19728886..063a823dcf 100644 --- a/reference/system_error/error_condition/op_constructor.md +++ b/reference/system_error/error_condition/op_constructor.md @@ -121,9 +121,9 @@ generic ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 参照 diff --git a/reference/system_error/error_condition/op_less.md b/reference/system_error/error_condition/op_less.md index 9ab45fb4ca..4d00986713 100644 --- a/reference/system_error/error_condition/op_less.md +++ b/reference/system_error/error_condition/op_less.md @@ -58,8 +58,8 @@ false ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 参照 diff --git a/reference/system_error/error_condition/value.md b/reference/system_error/error_condition/value.md index 880b4b3c42..dd87ec46e2 100644 --- a/reference/system_error/error_condition/value.md +++ b/reference/system_error/error_condition/value.md @@ -49,9 +49,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 参照 diff --git a/reference/system_error/generic_category.md b/reference/system_error/generic_category.md index f83fdecc65..5e6f02d8af 100644 --- a/reference/system_error/generic_category.md +++ b/reference/system_error/generic_category.md @@ -64,9 +64,9 @@ Invalid argument ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 参照 diff --git a/reference/system_error/is_error_code_enum.md b/reference/system_error/is_error_code_enum.md index 4cb935ec4c..a2883e6477 100644 --- a/reference/system_error/is_error_code_enum.md +++ b/reference/system_error/is_error_code_enum.md @@ -56,8 +56,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5.0, 3.6.0, 3.7.0, 3.8.0 -- [GCC](/implementation.md#gcc): 4.4.7, 4.5.4, 4.6.4, 4.7.0, 4.7.3, 4.8.2, 4.9.0, 4.9.1, 4.9.2, 5.1.0, 5.2.0, 6.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5.0 [mark verified], 3.6.0 [mark verified], 3.7.0 [mark verified], 3.8.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.0 [mark verified], 4.7.3 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.1.0 [mark verified], 5.2.0 [mark verified], 6.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/system_error/is_error_condition_enum.md b/reference/system_error/is_error_condition_enum.md index 1d65073991..b39ac4b790 100644 --- a/reference/system_error/is_error_condition_enum.md +++ b/reference/system_error/is_error_condition_enum.md @@ -59,8 +59,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1, 3.2, 3.3, 3.4, 3.5.0, 3.6.0, 3.7.0, 3.8.0 -- [GCC](/implementation.md#gcc): 4.4.7, 4.5.4, 4.6.4, 4.7.0, 4.7.3, 4.8.2, 4.9.0, 4.9.1, 4.9.2, 5.1.0, 5.2.0, 6.0.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5.0 [mark verified], 3.6.0 [mark verified], 3.7.0 [mark verified], 3.8.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified], 4.5.4 [mark verified], 4.6.4 [mark verified], 4.7.0 [mark verified], 4.7.3 [mark verified], 4.8.2 [mark verified], 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.1.0 [mark verified], 5.2.0 [mark verified], 6.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/system_error/make_error_code.md b/reference/system_error/make_error_code.md index 4ecc11888b..421899bea5 100644 --- a/reference/system_error/make_error_code.md +++ b/reference/system_error/make_error_code.md @@ -60,9 +60,9 @@ message : Invalid argument ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 参照 diff --git a/reference/system_error/make_error_condition.md b/reference/system_error/make_error_condition.md index 0b7928f159..025c694311 100644 --- a/reference/system_error/make_error_condition.md +++ b/reference/system_error/make_error_condition.md @@ -60,9 +60,9 @@ message : Invalid argument ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 参照 diff --git a/reference/system_error/op_equal.md b/reference/system_error/op_equal.md index b6221a0e7b..fd18efcf18 100644 --- a/reference/system_error/op_equal.md +++ b/reference/system_error/op_equal.md @@ -111,9 +111,9 @@ error_condition == error_condition : false ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 参照 diff --git a/reference/system_error/op_not_equal.md b/reference/system_error/op_not_equal.md index 0e061e8b6c..df61c70cdf 100644 --- a/reference/system_error/op_not_equal.md +++ b/reference/system_error/op_not_equal.md @@ -76,9 +76,9 @@ error_condition != error_condition : true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 関連項目 diff --git a/reference/system_error/system_category.md b/reference/system_error/system_category.md index 6df87710e9..833ea27c20 100644 --- a/reference/system_error/system_category.md +++ b/reference/system_error/system_category.md @@ -63,9 +63,9 @@ Invalid argument ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 参照 diff --git a/reference/system_error/system_error.md b/reference/system_error/system_error.md index 040f70953c..83b40b7bcf 100644 --- a/reference/system_error/system_error.md +++ b/reference/system_error/system_error.md @@ -64,8 +64,8 @@ system error!: Invalid argument ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] diff --git a/reference/thread.md b/reference/thread.md index b821c96d98..1f80006eb4 100644 --- a/reference/thread.md +++ b/reference/thread.md @@ -22,9 +22,9 @@ - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.6.3, 4.7.0 +- [GCC](/implementation.md#gcc): 4.6.3 [mark verified], 4.7.0 [mark verified] GCC/pthread環境でスレッドサポートを有効化するには -pthread オプション指定が必要。(GCC 4.7.0で確認) -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 - [The cpp-threads Archives](https://www.decadent.org.uk/pipermail/cpp-threads/) diff --git a/reference/thread/jthread.md b/reference/thread/jthread.md index 8e231b9483..9ba75dc41e 100644 --- a/reference/thread/jthread.md +++ b/reference/thread/jthread.md @@ -168,5 +168,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10.2.0 +- [GCC](/implementation.md#gcc): 10.2.0 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/thread/jthread/detach.md b/reference/thread/jthread/detach.md index 332334ad5a..d4c1c3940f 100644 --- a/reference/thread/jthread/detach.md +++ b/reference/thread/jthread/detach.md @@ -85,5 +85,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10.2.0 +- [GCC](/implementation.md#gcc): 10.2.0 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/thread/jthread/get_id.md b/reference/thread/jthread/get_id.md index 0e1fbd7a44..f0488976ac 100644 --- a/reference/thread/jthread/get_id.md +++ b/reference/thread/jthread/get_id.md @@ -56,5 +56,5 @@ thread::id of a non-executing thread ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10.2.0 +- [GCC](/implementation.md#gcc): 10.2.0 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/thread/jthread/get_stop_source.md b/reference/thread/jthread/get_stop_source.md index 731841a25f..ea0ced847c 100644 --- a/reference/thread/jthread/get_stop_source.md +++ b/reference/thread/jthread/get_stop_source.md @@ -60,5 +60,5 @@ exit t1 thread ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10.2.0 +- [GCC](/implementation.md#gcc): 10.2.0 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/thread/jthread/get_stop_token.md b/reference/thread/jthread/get_stop_token.md index 053785ba85..c0b7b2efc1 100644 --- a/reference/thread/jthread/get_stop_token.md +++ b/reference/thread/jthread/get_stop_token.md @@ -65,5 +65,5 @@ exit t thread ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10.2.0 +- [GCC](/implementation.md#gcc): 10.2.0 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/thread/jthread/hardware_concurrency.md b/reference/thread/jthread/hardware_concurrency.md index 3e27d7447a..72f24553e8 100644 --- a/reference/thread/jthread/hardware_concurrency.md +++ b/reference/thread/jthread/hardware_concurrency.md @@ -48,5 +48,5 @@ concurrency=12 ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10.2.0 +- [GCC](/implementation.md#gcc): 10.2.0 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/thread/jthread/id.md b/reference/thread/jthread/id.md index 26b88b32b1..5aabf6b108 100644 --- a/reference/thread/jthread/id.md +++ b/reference/thread/jthread/id.md @@ -54,5 +54,5 @@ main=140029246990144 ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10.2.0 +- [GCC](/implementation.md#gcc): 10.2.0 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/thread/jthread/join.md b/reference/thread/jthread/join.md index 4c4ef0e2f5..c27b500a36 100644 --- a/reference/thread/jthread/join.md +++ b/reference/thread/jthread/join.md @@ -69,5 +69,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10.2.0 +- [GCC](/implementation.md#gcc): 10.2.0 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/thread/jthread/joinable.md b/reference/thread/jthread/joinable.md index 5ef51fc803..c35bb51d74 100644 --- a/reference/thread/jthread/joinable.md +++ b/reference/thread/jthread/joinable.md @@ -51,5 +51,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10.2.0 +- [GCC](/implementation.md#gcc): 10.2.0 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/thread/jthread/native_handle.md b/reference/thread/jthread/native_handle.md index 406be18b2b..57c34e53b2 100644 --- a/reference/thread/jthread/native_handle.md +++ b/reference/thread/jthread/native_handle.md @@ -55,5 +55,5 @@ func ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10.2.0 +- [GCC](/implementation.md#gcc): 10.2.0 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/thread/jthread/op_assign.md b/reference/thread/jthread/op_assign.md index d6b9d89e20..92c84fb547 100644 --- a/reference/thread/jthread/op_assign.md +++ b/reference/thread/jthread/op_assign.md @@ -63,5 +63,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10.2.0 +- [GCC](/implementation.md#gcc): 10.2.0 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/thread/jthread/op_constructor.md b/reference/thread/jthread/op_constructor.md index d8cb21af3e..e56789e7a0 100644 --- a/reference/thread/jthread/op_constructor.md +++ b/reference/thread/jthread/op_constructor.md @@ -165,5 +165,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10.2.0 +- [GCC](/implementation.md#gcc): 10.2.0 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/thread/jthread/op_destructor.md b/reference/thread/jthread/op_destructor.md index 8778279a62..6c412f3771 100644 --- a/reference/thread/jthread/op_destructor.md +++ b/reference/thread/jthread/op_destructor.md @@ -83,5 +83,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10.2.0 +- [GCC](/implementation.md#gcc): 10.2.0 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/thread/jthread/request_stop.md b/reference/thread/jthread/request_stop.md index 1f98f5e9a8..b5116c7601 100644 --- a/reference/thread/jthread/request_stop.md +++ b/reference/thread/jthread/request_stop.md @@ -66,5 +66,5 @@ exit t1 thread ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10.2.0 +- [GCC](/implementation.md#gcc): 10.2.0 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/thread/jthread/swap.md b/reference/thread/jthread/swap.md index 675aaeb138..5243d3fc59 100644 --- a/reference/thread/jthread/swap.md +++ b/reference/thread/jthread/swap.md @@ -50,5 +50,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10.2.0 +- [GCC](/implementation.md#gcc): 10.2.0 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/thread/jthread/swap_free.md b/reference/thread/jthread/swap_free.md index 1387c1e2c1..20cc700088 100644 --- a/reference/thread/jthread/swap_free.md +++ b/reference/thread/jthread/swap_free.md @@ -57,5 +57,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10.2.0 +- [GCC](/implementation.md#gcc): 10.2.0 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/thread/this_thread.md b/reference/thread/this_thread.md index 80899f01e4..8fe8167993 100644 --- a/reference/thread/this_thread.md +++ b/reference/thread/this_thread.md @@ -38,4 +38,4 @@ void sleep_for(const chrono::duration& rel_time); - [Clang](/implementation.md#clang): - [GCC](/implementation.md#gcc): - [ICC](/implementation.md#icc): -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] diff --git a/reference/thread/this_thread/get_id.md b/reference/thread/this_thread/get_id.md index ce64a3a765..b8c04d09f6 100644 --- a/reference/thread/this_thread/get_id.md +++ b/reference/thread/this_thread/get_id.md @@ -51,9 +51,9 @@ thread_id=538af0 ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 4.6.3, 4.7.0 +- [GCC](/implementation.md#gcc): 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/thread/this_thread/sleep_for.md b/reference/thread/this_thread/sleep_for.md index b8ccef0230..efa54dac7f 100644 --- a/reference/thread/this_thread/sleep_for.md +++ b/reference/thread/this_thread/sleep_for.md @@ -57,9 +57,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 4.6.3, 4.7.0 +- [GCC](/implementation.md#gcc): 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/thread/this_thread/sleep_until.md b/reference/thread/this_thread/sleep_until.md index 4fd2cf73ab..e5164a7d41 100644 --- a/reference/thread/this_thread/sleep_until.md +++ b/reference/thread/this_thread/sleep_until.md @@ -64,9 +64,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 4.6.3, 4.7.0 +- [GCC](/implementation.md#gcc): 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/thread/this_thread/yield.md b/reference/thread/this_thread/yield.md index ed9dccab9a..5411308db8 100644 --- a/reference/thread/this_thread/yield.md +++ b/reference/thread/this_thread/yield.md @@ -73,9 +73,9 @@ result=42 ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 4.6.3, 4.7.0 +- [GCC](/implementation.md#gcc): 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/thread/thread.md b/reference/thread/thread.md index 361cbe1873..010f2f9f4f 100644 --- a/reference/thread/thread.md +++ b/reference/thread/thread.md @@ -100,9 +100,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012はメモリリークするバグあり [link](http://stackoverflow.com/questions/14238670/is-this-a-big-bug-of-microsofts-implementation-of-stdthread) ## 参照 diff --git a/reference/thread/thread/detach.md b/reference/thread/thread/detach.md index 2daffc95e3..b7778f4cd4 100644 --- a/reference/thread/thread/detach.md +++ b/reference/thread/thread/detach.md @@ -81,8 +81,8 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 4.6.3, 4.7.0 +- [GCC](/implementation.md#gcc): 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/thread/thread/get_id.md b/reference/thread/thread/get_id.md index 4751634054..84ef05266a 100644 --- a/reference/thread/thread/get_id.md +++ b/reference/thread/thread/get_id.md @@ -53,9 +53,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 4.6.3, 4.7.0 +- [GCC](/implementation.md#gcc): 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/thread/thread/hardware_concurrency.md b/reference/thread/thread/hardware_concurrency.md index 7e61472e1a..a588424403 100644 --- a/reference/thread/thread/hardware_concurrency.md +++ b/reference/thread/thread/hardware_concurrency.md @@ -49,9 +49,9 @@ concurrency=4 ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 4.6.3, 4.7.0 +- [GCC](/implementation.md#gcc): 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/thread/thread/id.md b/reference/thread/thread/id.md index dd6c9da7d2..0f360a6800 100644 --- a/reference/thread/thread/id.md +++ b/reference/thread/thread/id.md @@ -104,7 +104,7 @@ main=824a30 - [Clang](/implementation.md#clang): - [GCC](/implementation.md#gcc): - [ICC](/implementation.md#icc): -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 - [LWG Issue 783. `thread::id` reuse](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#783) diff --git a/reference/thread/thread/id/formatter.md b/reference/thread/thread/id/formatter.md index 9081dcaa63..d1b84cef70 100644 --- a/reference/thread/thread/id/formatter.md +++ b/reference/thread/thread/id/formatter.md @@ -48,7 +48,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 14 +- [GCC](/implementation.md#gcc): 14 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/thread/thread/join.md b/reference/thread/thread/join.md index 89b6b88daa..a04a16e414 100644 --- a/reference/thread/thread/join.md +++ b/reference/thread/thread/join.md @@ -70,9 +70,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 4.6.3, 4.7.0 +- [GCC](/implementation.md#gcc): 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012現在はバグ有り [std::thread::join() hangs if called after main() exits when using VS2012 RC](https://connect.microsoft.com/VisualStudio/feedback/details/747145/) - main 関数を抜けた後に join() を呼ぶとハングアップするというもの diff --git a/reference/thread/thread/joinable.md b/reference/thread/thread/joinable.md index 6f593a667e..ddf1e08641 100644 --- a/reference/thread/thread/joinable.md +++ b/reference/thread/thread/joinable.md @@ -48,8 +48,8 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 4.6.3, 4.7.0 +- [GCC](/implementation.md#gcc): 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/thread/thread/native_handle.md b/reference/thread/thread/native_handle.md index 6687b711c7..bff4585a3b 100644 --- a/reference/thread/thread/native_handle.md +++ b/reference/thread/thread/native_handle.md @@ -57,7 +57,7 @@ func - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/thread/thread/op_assign.md b/reference/thread/thread/op_assign.md index 1b412378fb..a039408daa 100644 --- a/reference/thread/thread/op_assign.md +++ b/reference/thread/thread/op_assign.md @@ -62,9 +62,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 4.6.3, 4.7.0 +- [GCC](/implementation.md#gcc): 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/thread/thread/op_constructor.md b/reference/thread/thread/op_constructor.md index b3a7409808..d4ca422012 100644 --- a/reference/thread/thread/op_constructor.md +++ b/reference/thread/thread/op_constructor.md @@ -102,9 +102,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 4.6.3, 4.7.0 +- [GCC](/implementation.md#gcc): 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012, 2013は、(2)での実引数の受け渡しにムーブを使用しない問題がある。上記の例でも、`std::unique_ptr`の実引数でコンパイルエラーになる。 - 2012はコピーコンストラクタのdeleteに対応していないため、代わりにprivateで宣言のみ行う手法で代用されている。 diff --git a/reference/thread/thread/op_destructor.md b/reference/thread/thread/op_destructor.md index 4f66590b23..4a808b1468 100644 --- a/reference/thread/thread/op_destructor.md +++ b/reference/thread/thread/op_destructor.md @@ -44,9 +44,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 4.6.3, 4.7.0 +- [GCC](/implementation.md#gcc): 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/thread/thread/swap.md b/reference/thread/thread/swap.md index 38aac123e9..0d16bb76a4 100644 --- a/reference/thread/thread/swap.md +++ b/reference/thread/thread/swap.md @@ -50,9 +50,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 4.6.3, 4.7.0 +- [GCC](/implementation.md#gcc): 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/thread/thread/swap_free.md b/reference/thread/thread/swap_free.md index d9d731ca27..03e9c0065d 100644 --- a/reference/thread/thread/swap_free.md +++ b/reference/thread/thread/swap_free.md @@ -55,9 +55,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/tuple/apply.md b/reference/tuple/apply.md index f78a536d59..fb7e104039 100644 --- a/reference/tuple/apply.md +++ b/reference/tuple/apply.md @@ -111,8 +111,8 @@ hello - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 3.9.1 -- [GCC](/implementation.md#gcc): 7.1.0 +- [Clang](/implementation.md#clang): 3.9.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/tuple/forward_as_tuple.md b/reference/tuple/forward_as_tuple.md index 82e5c72da2..f78e4365eb 100644 --- a/reference/tuple/forward_as_tuple.md +++ b/reference/tuple/forward_as_tuple.md @@ -59,7 +59,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/tuple/ignore.md b/reference/tuple/ignore.md index 3ec1949b89..46b212ca59 100644 --- a/reference/tuple/ignore.md +++ b/reference/tuple/ignore.md @@ -24,9 +24,9 @@ namespace std { ### 処理系 - [Clang](/implementation.md#clang): ? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): -- [Visual C++](/implementation.md#visual_cpp): 2008, 2010 +- [Visual C++](/implementation.md#visual_cpp): 2008 [mark verified], 2010 [mark verified] ## 関連項目 diff --git a/reference/tuple/make_from_tuple.md b/reference/tuple/make_from_tuple.md index 5aca1111f2..93f7a68a6a 100644 --- a/reference/tuple/make_from_tuple.md +++ b/reference/tuple/make_from_tuple.md @@ -129,7 +129,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2017 +- [Visual C++](/implementation.md#visual_cpp): 2017 [mark verified] ## 関連項目 diff --git a/reference/tuple/make_tuple.md b/reference/tuple/make_tuple.md index 237294775a..9f28b2315f 100644 --- a/reference/tuple/make_tuple.md +++ b/reference/tuple/make_tuple.md @@ -67,9 +67,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2008, 2010 +- [Visual C++](/implementation.md#visual_cpp): 2008 [mark verified], 2010 [mark verified] ## 参照 diff --git a/reference/tuple/tie.md b/reference/tuple/tie.md index f27dd96162..255593bd64 100644 --- a/reference/tuple/tie.md +++ b/reference/tuple/tie.md @@ -148,9 +148,9 @@ text, b.txt ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2008, 2010 +- [Visual C++](/implementation.md#visual_cpp): 2008 [mark verified], 2010 [mark verified] ## 関連項目 diff --git a/reference/tuple/tuple.md b/reference/tuple/tuple.md index cd3cb2f7eb..8cf65409b3 100644 --- a/reference/tuple/tuple.md +++ b/reference/tuple/tuple.md @@ -253,10 +253,10 @@ after b: i=0, d=0 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.4, 4.4.4, 4.5.2, 4.6.1 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.4.4 [mark verified], 4.5.2 [mark verified], 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2008, 2010 +- [Visual C++](/implementation.md#visual_cpp): 2008 [mark verified], 2010 [mark verified] ## 関連項目 diff --git a/reference/tuple/tuple/common_type.md b/reference/tuple/tuple/common_type.md index f6d8d89022..6f8b7fd5f1 100644 --- a/reference/tuple/tuple/common_type.md +++ b/reference/tuple/tuple/common_type.md @@ -35,9 +35,9 @@ namespace std { - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 - [common_type](/reference/type_traits/common_type.md) diff --git a/reference/tuple/tuple/get.md b/reference/tuple/tuple/get.md index e2a5c71893..ded2a8e270 100644 --- a/reference/tuple/tuple/get.md +++ b/reference/tuple/tuple/get.md @@ -171,7 +171,7 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/tuple/tuple/op_assign.md b/reference/tuple/tuple/op_assign.md index 46582ddf28..b073fde732 100644 --- a/reference/tuple/tuple/op_assign.md +++ b/reference/tuple/tuple/op_assign.md @@ -159,7 +159,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/tuple/tuple/op_compare_3way.md b/reference/tuple/tuple/op_compare_3way.md index 1a6c4b76a5..8463292fbd 100644 --- a/reference/tuple/tuple/op_compare_3way.md +++ b/reference/tuple/tuple/op_compare_3way.md @@ -88,7 +88,7 @@ false ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10 +- [GCC](/implementation.md#gcc): 10 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/tuple/tuple/op_constructor.md b/reference/tuple/tuple/op_constructor.md index cc7f01e037..45fea3163b 100644 --- a/reference/tuple/tuple/op_constructor.md +++ b/reference/tuple/tuple/op_constructor.md @@ -430,7 +430,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/tuple/tuple/op_deduction_guide.md b/reference/tuple/tuple/op_deduction_guide.md index 7a47f16f2b..e71650e12c 100644 --- a/reference/tuple/tuple/op_deduction_guide.md +++ b/reference/tuple/tuple/op_deduction_guide.md @@ -79,7 +79,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 7.1.0 +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/tuple/tuple/op_equal.md b/reference/tuple/tuple/op_equal.md index 567726a2b3..0e28dd8dd7 100644 --- a/reference/tuple/tuple/op_equal.md +++ b/reference/tuple/tuple/op_equal.md @@ -84,7 +84,7 @@ false ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/tuple/tuple/op_greater.md b/reference/tuple/tuple/op_greater.md index d2ba113dff..06204958d4 100644 --- a/reference/tuple/tuple/op_greater.md +++ b/reference/tuple/tuple/op_greater.md @@ -64,7 +64,7 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/tuple/tuple/op_greater_equal.md b/reference/tuple/tuple/op_greater_equal.md index 02cb81f975..f2bb11cc89 100644 --- a/reference/tuple/tuple/op_greater_equal.md +++ b/reference/tuple/tuple/op_greater_equal.md @@ -70,7 +70,7 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/tuple/tuple/op_less.md b/reference/tuple/tuple/op_less.md index 00b54db389..b979d40d99 100644 --- a/reference/tuple/tuple/op_less.md +++ b/reference/tuple/tuple/op_less.md @@ -74,7 +74,7 @@ false ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/tuple/tuple/op_less_equal.md b/reference/tuple/tuple/op_less_equal.md index 6a7d4ed311..c46867c353 100644 --- a/reference/tuple/tuple/op_less_equal.md +++ b/reference/tuple/tuple/op_less_equal.md @@ -70,7 +70,7 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/tuple/tuple/op_not_equal.md b/reference/tuple/tuple/op_not_equal.md index fab8da6ee3..10006f1fe1 100644 --- a/reference/tuple/tuple/op_not_equal.md +++ b/reference/tuple/tuple/op_not_equal.md @@ -66,7 +66,7 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/tuple/tuple/swap.md b/reference/tuple/tuple/swap.md index d361d7fb2c..b11be51ba6 100644 --- a/reference/tuple/tuple/swap.md +++ b/reference/tuple/tuple/swap.md @@ -69,7 +69,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): - [Visual C++](/implementation.md#visual_cpp): diff --git a/reference/tuple/tuple/swap_free.md b/reference/tuple/tuple/swap_free.md index 8f26bbd29d..73e82a782c 100644 --- a/reference/tuple/tuple/swap_free.md +++ b/reference/tuple/tuple/swap_free.md @@ -73,8 +73,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/tuple/tuple_cat.md b/reference/tuple/tuple_cat.md index 21245ae0c3..f446c9d230 100644 --- a/reference/tuple/tuple_cat.md +++ b/reference/tuple/tuple_cat.md @@ -92,7 +92,7 @@ World ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/tuple/tuple_element.md b/reference/tuple/tuple_element.md index 06543ace0c..f9324b83cf 100644 --- a/reference/tuple/tuple_element.md +++ b/reference/tuple/tuple_element.md @@ -91,7 +91,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/tuple/tuple_size.md b/reference/tuple/tuple_size.md index d20516e291..bc2159448b 100644 --- a/reference/tuple/tuple_size.md +++ b/reference/tuple/tuple_size.md @@ -78,7 +78,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/type_traits/add_const.md b/reference/type_traits/add_const.md index 1590135ecc..1fbff3dbc5 100644 --- a/reference/type_traits/add_const.md +++ b/reference/type_traits/add_const.md @@ -47,9 +47,9 @@ int main() {} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - `add_const_t`は2013から diff --git a/reference/type_traits/add_cv.md b/reference/type_traits/add_cv.md index 834865df7a..47dd58d9dc 100644 --- a/reference/type_traits/add_cv.md +++ b/reference/type_traits/add_cv.md @@ -66,9 +66,9 @@ int main() {} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - `add_cv_t`は2013から diff --git a/reference/type_traits/add_lvalue_reference.md b/reference/type_traits/add_lvalue_reference.md index 34d1cca344..0f42fca0d1 100644 --- a/reference/type_traits/add_lvalue_reference.md +++ b/reference/type_traits/add_lvalue_reference.md @@ -47,9 +47,9 @@ int main() {} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2008には、名前空間`std::tr1`に同じ効果の`add_reference`が存在する。これは提案時の名前である。 - 2010~2013にも、名前空間`std`および`std::tr1`に`add_reference`が存在する。 - `add_lvalue_reference_t`は2013から diff --git a/reference/type_traits/add_pointer.md b/reference/type_traits/add_pointer.md index aca5d26a03..2897bed249 100644 --- a/reference/type_traits/add_pointer.md +++ b/reference/type_traits/add_pointer.md @@ -46,9 +46,9 @@ int main() {} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - `add_pointer_t`は2013から diff --git a/reference/type_traits/add_rvalue_reference.md b/reference/type_traits/add_rvalue_reference.md index 46a0887100..c7012aadb4 100644 --- a/reference/type_traits/add_rvalue_reference.md +++ b/reference/type_traits/add_rvalue_reference.md @@ -47,9 +47,9 @@ int main() {} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - `add_rvalue_reference_t`は2013から diff --git a/reference/type_traits/add_volatile.md b/reference/type_traits/add_volatile.md index 3ea1d1cda9..507a905290 100644 --- a/reference/type_traits/add_volatile.md +++ b/reference/type_traits/add_volatile.md @@ -47,9 +47,9 @@ int main() {} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - `add_volatile_t`は2013から diff --git a/reference/type_traits/aligned_storage.md b/reference/type_traits/aligned_storage.md index 688a1a3e26..0bebec2a6b 100644 --- a/reference/type_traits/aligned_storage.md +++ b/reference/type_traits/aligned_storage.md @@ -197,9 +197,9 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.5.4 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.5.4 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2010までは、`Align`のデフォルト実引数が定義されていない。 - 2012からは、`Align`のデフォルト実引数は`std::alignment_of::value`と定義されている。 - `aligned_storage_t`は2013から diff --git a/reference/type_traits/aligned_union.md b/reference/type_traits/aligned_union.md index 840f4e410a..f72c04b43c 100644 --- a/reference/type_traits/aligned_union.md +++ b/reference/type_traits/aligned_union.md @@ -112,9 +112,9 @@ hello - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.3 -- [GCC](/implementation.md#gcc): 5.0 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.3 [mark verified] +- [GCC](/implementation.md#gcc): 5.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012は、`alignment_value`が定義されていない。 - 2012は、可変引数テンプレートに対応していないため、不完全な実装である。 - `aligned_union_t`は2013から diff --git a/reference/type_traits/alignment_of.md b/reference/type_traits/alignment_of.md index 2ae2361858..7e182a1eae 100644 --- a/reference/type_traits/alignment_of.md +++ b/reference/type_traits/alignment_of.md @@ -55,9 +55,9 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.6.4 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.6.4 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/type_traits/basic_common_reference.md b/reference/type_traits/basic_common_reference.md index 75f11fdf28..ab6650e52a 100644 --- a/reference/type_traits/basic_common_reference.md +++ b/reference/type_traits/basic_common_reference.md @@ -84,8 +84,8 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark verified] ## 関連項目 diff --git a/reference/type_traits/bool_constant.md b/reference/type_traits/bool_constant.md index 9df13e592d..4eb90a1543 100644 --- a/reference/type_traits/bool_constant.md +++ b/reference/type_traits/bool_constant.md @@ -60,8 +60,8 @@ true - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 3.7.1 -- [GCC](/implementation.md#gcc): 6.1 +- [Clang](/implementation.md#clang): 3.7.1 [mark verified] +- [GCC](/implementation.md#gcc): 6.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/type_traits/common_reference.md b/reference/type_traits/common_reference.md index 5e118dda01..94bdfbacf1 100644 --- a/reference/type_traits/common_reference.md +++ b/reference/type_traits/common_reference.md @@ -107,8 +107,8 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark verified] ## 関連項目 diff --git a/reference/type_traits/common_type.md b/reference/type_traits/common_type.md index 88220bb651..650efc9903 100644 --- a/reference/type_traits/common_type.md +++ b/reference/type_traits/common_type.md @@ -164,9 +164,9 @@ struct common_type { - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.4.7 -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012までは、可変引数テンプレートに対応していないため、不完全な実装である。 - `common_type_t`は、2013から。 diff --git a/reference/type_traits/conditional.md b/reference/type_traits/conditional.md index 63638c141a..042767a463 100644 --- a/reference/type_traits/conditional.md +++ b/reference/type_traits/conditional.md @@ -65,9 +65,9 @@ int main() {} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - `conditional_t`は、2013から。 diff --git a/reference/type_traits/conjunction.md b/reference/type_traits/conjunction.md index 2654fcfae7..3f32e3593b 100644 --- a/reference/type_traits/conjunction.md +++ b/reference/type_traits/conjunction.md @@ -80,9 +80,9 @@ Tはムーブ構築/代入どちらかが不可 - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 3.8 -- [GCC](/implementation.md#gcc): 6.3 -- [Visual C++](/implementation.md#visual_cpp): 2015 update2, 2017 +- [Clang](/implementation.md#clang): 3.8 [mark verified] +- [GCC](/implementation.md#gcc): 6.3 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2015 update2 [mark verified], 2017 [mark verified] - `conjunction_v`は、2015 update3までは定義されているが有効化されていない。 diff --git a/reference/type_traits/decay.md b/reference/type_traits/decay.md index a137930500..fd6cc48ad6 100644 --- a/reference/type_traits/decay.md +++ b/reference/type_traits/decay.md @@ -93,9 +93,9 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.4.7 -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - `decay_t`は、2013から。 diff --git a/reference/type_traits/disjunction.md b/reference/type_traits/disjunction.md index 3f21f8b1e5..23df2ea753 100644 --- a/reference/type_traits/disjunction.md +++ b/reference/type_traits/disjunction.md @@ -87,9 +87,9 @@ Tは何らかのポインタ - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 3.8 -- [GCC](/implementation.md#gcc): 6.3 -- [Visual C++](/implementation.md#visual_cpp): 2015 update2, 2017 +- [Clang](/implementation.md#clang): 3.8 [mark verified] +- [GCC](/implementation.md#gcc): 6.3 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2015 update2 [mark verified], 2017 [mark verified] - `disjunction_v`は、2015 update3までは定義されているが有効化されていない。 diff --git a/reference/type_traits/enable_if.md b/reference/type_traits/enable_if.md index 529e7b1c45..26311d3dd8 100644 --- a/reference/type_traits/enable_if.md +++ b/reference/type_traits/enable_if.md @@ -62,9 +62,9 @@ Tは整数型以外 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - `enable_if_t`は、2013から。 diff --git a/reference/type_traits/extent.md b/reference/type_traits/extent.md index b23cee1448..e004c31578 100644 --- a/reference/type_traits/extent.md +++ b/reference/type_traits/extent.md @@ -52,9 +52,9 @@ int main() {} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/type_traits/false_type.md b/reference/type_traits/false_type.md index d76785c0d7..af2cccb07b 100644 --- a/reference/type_traits/false_type.md +++ b/reference/type_traits/false_type.md @@ -39,9 +39,9 @@ int main(){} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.3.4, 4.5.3, 4.6.2, 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.5.3 [mark verified], 4.6.2 [mark verified], 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] #### 備考 上の例でコンパイラによってはエラーになる。GCC 4.3.4, 4.5.3, Visual C++ 2010 は [`integral_constant`](integral_constant.md) が `operator value_type()` を持っていないためエラーになる。 diff --git a/reference/type_traits/has_unique_object_representations.md b/reference/type_traits/has_unique_object_representations.md index af63374bf4..27af0e4178 100644 --- a/reference/type_traits/has_unique_object_representations.md +++ b/reference/type_traits/has_unique_object_representations.md @@ -109,9 +109,9 @@ false - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 6.0 -- [GCC](/implementation.md#gcc): 7.1 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 3 +- [Clang](/implementation.md#clang): 6.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 3 [mark verified] ## 関連項目 diff --git a/reference/type_traits/has_virtual_destructor.md b/reference/type_traits/has_virtual_destructor.md index 91ed051f0b..9667ef765b 100644 --- a/reference/type_traits/has_virtual_destructor.md +++ b/reference/type_traits/has_virtual_destructor.md @@ -136,9 +136,9 @@ safe_derived : - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.3 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.3 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/type_traits/integral_constant.md b/reference/type_traits/integral_constant.md index c45fcd342d..009c864054 100644 --- a/reference/type_traits/integral_constant.md +++ b/reference/type_traits/integral_constant.md @@ -51,8 +51,8 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.4, 4.5.3, 4.6.2, 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.5.3 [mark verified], 4.6.2 [mark verified], 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - `operator value_type`関数の実装状況は次のとおり。 - 2012~2013は、`operator value_type() const`と定義されている。`constexpr`と`noexcept`修飾がされていない。 - 2015では、C++14の仕様どおりに実装されている。 diff --git a/reference/type_traits/invoke_result.md b/reference/type_traits/invoke_result.md index 7a0b6ada5d..9bd31fffca 100644 --- a/reference/type_traits/invoke_result.md +++ b/reference/type_traits/invoke_result.md @@ -109,9 +109,9 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 6.0 -- [GCC](/implementation.md#gcc): 7.3 -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 3 +- [Clang](/implementation.md#clang): 6.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 3 [mark verified] ## 参照 - [P0604R0 Resolving GB 55, US 84, US 85, US 86](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0604r0.html) diff --git a/reference/type_traits/is_abstract.md b/reference/type_traits/is_abstract.md index d2b774dc15..8440e737de 100644 --- a/reference/type_traits/is_abstract.md +++ b/reference/type_traits/is_abstract.md @@ -67,8 +67,8 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.4, 4.5.3, 4.6.2, 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.5.3 [mark verified], 4.6.2 [mark verified], 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] #### 備考 上の例でコンパイラによってはエラーになる。GCC 4.3.4, 4.5.3, Visual C++ 2010 は `integral_constant` が `operator bool()` を持っていないためエラーになる。 diff --git a/reference/type_traits/is_aggregate.md b/reference/type_traits/is_aggregate.md index 30d459b64d..cf338d8739 100644 --- a/reference/type_traits/is_aggregate.md +++ b/reference/type_traits/is_aggregate.md @@ -77,8 +77,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 5.0 -- [GCC](/implementation.md#gcc): 7.2 +- [Clang](/implementation.md#clang): 5.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.2 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/type_traits/is_arithmetic.md b/reference/type_traits/is_arithmetic.md index 6a1c566193..6ed3b1ad99 100644 --- a/reference/type_traits/is_arithmetic.md +++ b/reference/type_traits/is_arithmetic.md @@ -60,8 +60,8 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.4, 4.5.3, 4.6.2, 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.5.3 [mark verified], 4.6.2 [mark verified], 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] #### 備考 上の例でコンパイラによってはエラーになる。GCC 4.3.4, 4.5.3, Visual C++ 2010 は [`integral_constant`](integral_constant.md) が `operator bool()` を持っていないためエラーになる。 diff --git a/reference/type_traits/is_array.md b/reference/type_traits/is_array.md index 5f6b94aae8..5e49440d8f 100644 --- a/reference/type_traits/is_array.md +++ b/reference/type_traits/is_array.md @@ -64,8 +64,8 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.4, 4.5.3, 4.6.1, 4.7.2 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.5.3 [mark verified], 4.6.1 [mark verified], 4.7.2 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] #### 備考 上の例でコンパイラによってはエラーになる。GCC 4.3.4, 4.5.3, Visual C++ 2010 は [`integral_constant`](integral_constant.md) が `operator bool()` を持っていないためエラーになる。 diff --git a/reference/type_traits/is_assignable.md b/reference/type_traits/is_assignable.md index d117a84da3..cc5c8d01b1 100644 --- a/reference/type_traits/is_assignable.md +++ b/reference/type_traits/is_assignable.md @@ -69,7 +69,7 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] ## 参照 diff --git a/reference/type_traits/is_base_of.md b/reference/type_traits/is_base_of.md index 76c01b3df8..db5bbcb4d9 100644 --- a/reference/type_traits/is_base_of.md +++ b/reference/type_traits/is_base_of.md @@ -62,9 +62,9 @@ int main() {} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/type_traits/is_bounded_array.md b/reference/type_traits/is_bounded_array.md index d42d43e0aa..aa81de36e2 100644 --- a/reference/type_traits/is_bounded_array.md +++ b/reference/type_traits/is_bounded_array.md @@ -52,8 +52,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 9.0 -- [GCC](/implementation.md#gcc): 9.1 +- [Clang](/implementation.md#clang): 9.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/type_traits/is_class.md b/reference/type_traits/is_class.md index 7e30dc2758..90e661cf4d 100644 --- a/reference/type_traits/is_class.md +++ b/reference/type_traits/is_class.md @@ -71,8 +71,8 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.4, 4.5.3, 4.6.1, 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.5.3 [mark verified], 4.6.1 [mark verified], 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] #### 備考 上の例でコンパイラによってはエラーになる。GCC 4.3.4, 4.5.3, Visual C++ 2010 は [`integral_constant`](integral_constant.md) が `operator bool()` を持っていないためエラーになる。また、GCC 4.3.4, Visual C++ 2010 は `enum class` に対応していたいためにエラーになる。 diff --git a/reference/type_traits/is_compound.md b/reference/type_traits/is_compound.md index e5004f4ad4..67640a075e 100644 --- a/reference/type_traits/is_compound.md +++ b/reference/type_traits/is_compound.md @@ -65,8 +65,8 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.4, 4.5.3, 4.6.2, 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.5.3 [mark verified], 4.6.2 [mark verified], 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012までは、テンプレート実引数に`std::nullptr_t`やそのCV修飾を渡した場合、誤って`true_type`からの派生になっている。 #### 備考 diff --git a/reference/type_traits/is_const.md b/reference/type_traits/is_const.md index 4aad67ee47..a68e8b3908 100644 --- a/reference/type_traits/is_const.md +++ b/reference/type_traits/is_const.md @@ -56,8 +56,8 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.4, 4.5.3, 4.6.2, 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.5.3 [mark verified], 4.6.2 [mark verified], 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] #### 備考 上の例でコンパイラによってはエラーになる。GCC 4.3.4, 4.5.3, Visual C++ 2010 は `integral_constant` が `operator bool()` を持っていないためエラーになる。 diff --git a/reference/type_traits/is_constant_evaluated.md b/reference/type_traits/is_constant_evaluated.md index 795dd774d6..e6071ddeb6 100644 --- a/reference/type_traits/is_constant_evaluated.md +++ b/reference/type_traits/is_constant_evaluated.md @@ -137,10 +137,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 9 -- [GCC](/implementation.md#gcc): 9.1 +- [Clang](/implementation.md#clang): 9 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 update5 +- [Visual C++](/implementation.md#visual_cpp): 2019 update5 [mark verified] ## 関連項目 - [C++20 コンパイル時初期化を強制する`constinit`キーワードを追加](/lang/cpp20/constinit.md) diff --git a/reference/type_traits/is_constructible.md b/reference/type_traits/is_constructible.md index ffcf9d11a8..170fed0100 100644 --- a/reference/type_traits/is_constructible.md +++ b/reference/type_traits/is_constructible.md @@ -59,8 +59,8 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.4, 4.5.3, 4.6.2, 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.5.3 [mark verified], 4.6.2 [mark verified], 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012までは、可変引数テンプレートに対応していないため、不完全な実装である。 - 2012~2013は、不具合がある模様。 diff --git a/reference/type_traits/is_convertible.md b/reference/type_traits/is_convertible.md index e93cb5916f..3ed9f1aa4b 100644 --- a/reference/type_traits/is_convertible.md +++ b/reference/type_traits/is_convertible.md @@ -72,9 +72,9 @@ int main() {} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 関連項目 diff --git a/reference/type_traits/is_copy_assignable.md b/reference/type_traits/is_copy_assignable.md index 0536426f52..2bf5f47c2e 100644 --- a/reference/type_traits/is_copy_assignable.md +++ b/reference/type_traits/is_copy_assignable.md @@ -83,8 +83,8 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012は、誤って`std::is_copy_assignable`が`true_type`になっている。 - 2012~2013は、C++11の定義に基づく実装となっている。 diff --git a/reference/type_traits/is_copy_constructible.md b/reference/type_traits/is_copy_constructible.md index 91067d04ae..4cdcceafd5 100644 --- a/reference/type_traits/is_copy_constructible.md +++ b/reference/type_traits/is_copy_constructible.md @@ -80,8 +80,8 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012~2013には、提案時の名前である`has_copy_constructor`も存在する。 - 2012は、`is_copy_constructible`が誤って`true_type`になっている。 - 2012~2013は、C++11の定義に基づく実装となっている。 diff --git a/reference/type_traits/is_default_constructible.md b/reference/type_traits/is_default_constructible.md index b6ae8807ec..93b5be927a 100644 --- a/reference/type_traits/is_default_constructible.md +++ b/reference/type_traits/is_default_constructible.md @@ -73,9 +73,9 @@ int main(){} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012~2013には、提案時の名前である`has_default_constructor`も存在する。 - 2012~2013は、`std::is_default_constructible`のような要素数の指定がない配列型において、誤って`true_type`になっている。`has_default_constructor`も同様である。 diff --git a/reference/type_traits/is_destructible.md b/reference/type_traits/is_destructible.md index 584790056f..ac48204fd5 100644 --- a/reference/type_traits/is_destructible.md +++ b/reference/type_traits/is_destructible.md @@ -82,8 +82,8 @@ int main(){} ### 処理系 - [Clang](/implementation.md#clang) 3.1, 3.2, 3.3, 3.4(revision 188080) -- [GCC](/implementation.md#gcc): 4.7.3, 4.8.0, 4.8.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.7.3 [mark verified], 4.8.0 [mark verified], 4.8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012~2013は、`delete`定義されたデストラクタを持つクラスにおいて、誤って`std::true_type`になっている。 #### 備考 diff --git a/reference/type_traits/is_empty.md b/reference/type_traits/is_empty.md index e50506d62f..fa25db2b29 100644 --- a/reference/type_traits/is_empty.md +++ b/reference/type_traits/is_empty.md @@ -76,8 +76,8 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.4, 4.5.3, 4.6.2, 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.5.3 [mark verified], 4.6.2 [mark verified], 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] #### 備考 上の例でコンパイラによってはエラーになる。GCC 4.3.4, 4.5.3, Visual C++ 2010 は `integral_constant` が `operator bool()` を持っていないためエラーになる。 diff --git a/reference/type_traits/is_enum.md b/reference/type_traits/is_enum.md index d65ae53aa2..4d7102d73f 100644 --- a/reference/type_traits/is_enum.md +++ b/reference/type_traits/is_enum.md @@ -62,8 +62,8 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.4, 4.5.3, 4.6.1, 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.5.3 [mark verified], 4.6.1 [mark verified], 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] #### 備考 上の例でコンパイラによってはエラーになる。GCC 4.3.4, 4.5.3, Visual C++ 2010 は [`integral_constant`](integral_constant.md) が `operator bool` を持っていないためエラーになる。また、GCC 4.3.4 および Visual C++ 2010 は `enum class` に対応していないためエラーになる。 diff --git a/reference/type_traits/is_final.md b/reference/type_traits/is_final.md index 2f675175e5..0a5decc9e9 100644 --- a/reference/type_traits/is_final.md +++ b/reference/type_traits/is_final.md @@ -56,9 +56,9 @@ int main(){} - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.5 -- [GCC](/implementation.md#gcc): 5.0 -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Clang](/implementation.md#clang): 3.5 [mark verified] +- [GCC](/implementation.md#gcc): 5.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] ## 関連項目 diff --git a/reference/type_traits/is_floating_point.md b/reference/type_traits/is_floating_point.md index bb08713ecf..e951b4d473 100644 --- a/reference/type_traits/is_floating_point.md +++ b/reference/type_traits/is_floating_point.md @@ -58,8 +58,8 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.4, 4.5.3, 4.6.1, 4.7.2 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.5.3 [mark verified], 4.6.1 [mark verified], 4.7.2 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] #### 備考 上の例でコンパイラによってはエラーになる。GCC 4.3.4, 4.5.3, Visual C++ 2010 は [`integral_constant`](integral_constant.md) が `operator bool()` を持っていないためエラーになる。 diff --git a/reference/type_traits/is_function.md b/reference/type_traits/is_function.md index 5a468aba75..63ddc252d9 100644 --- a/reference/type_traits/is_function.md +++ b/reference/type_traits/is_function.md @@ -59,9 +59,9 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.5.3, 4.6.1, 4.7.0 +- [GCC](/implementation.md#gcc): 4.5.3 [mark verified], 4.6.1 [mark verified], 4.7.0 [mark verified] - [Clang](/implementation.md#clang) 3.1, 3.2, 3.3 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2010までは、関数への右辺値参照型をテンプレート実引数に渡すとコンパイルエラーになる。上記例では、`std::is_function`の場合が該当する。 #### 備考 diff --git a/reference/type_traits/is_fundamental.md b/reference/type_traits/is_fundamental.md index fa0c1fe223..8864b18c0b 100644 --- a/reference/type_traits/is_fundamental.md +++ b/reference/type_traits/is_fundamental.md @@ -66,8 +66,8 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.4, 4.5.3, 4.6.2, 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.5.3 [mark verified], 4.6.2 [mark verified], 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012までは、テンプレート実引数に`std::nullptr_t`やそのCV修飾を渡した場合、誤って`true_type`からの派生になっている。 #### 備考 diff --git a/reference/type_traits/is_integral.md b/reference/type_traits/is_integral.md index e02141f7c2..1256a6922b 100644 --- a/reference/type_traits/is_integral.md +++ b/reference/type_traits/is_integral.md @@ -75,8 +75,8 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.4, 4.5.3, 4.6.1, 4.7.2 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.5.3 [mark verified], 4.6.1 [mark verified], 4.7.2 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] #### 備考 上の例でコンパイラによってはエラーになる。GCC 4.3.4, 4.5.3, Visual C++ 2010 は [`integral_constant`](integral_constant.md) が `operator bool()` を持っていないためエラーになる。 diff --git a/reference/type_traits/is_invocable.md b/reference/type_traits/is_invocable.md index fec8f87292..11179e5da0 100644 --- a/reference/type_traits/is_invocable.md +++ b/reference/type_traits/is_invocable.md @@ -128,7 +128,7 @@ false ### 処理系 - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 3 +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 3 [mark verified] ## 参照 - [C++1z 関数が呼び出し可能かを判定する型特性 - Faith and Brave - C++で遊ぼう](https://faithandbrave.hateblo.jp/entry/2016/05/13/183857) diff --git a/reference/type_traits/is_invocable_r.md b/reference/type_traits/is_invocable_r.md index 84996582c2..ab1bfcfdcc 100644 --- a/reference/type_traits/is_invocable_r.md +++ b/reference/type_traits/is_invocable_r.md @@ -121,7 +121,7 @@ false ### 処理系 - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 3 +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 3 [mark verified] ## 参照 - [C++1z 関数が呼び出し可能かを判定する型特性 - Faith and Brave - C++で遊ぼう](https://faithandbrave.hateblo.jp/entry/2016/05/13/183857) diff --git a/reference/type_traits/is_layout_compatible.md b/reference/type_traits/is_layout_compatible.md index d2cf1daca1..d784f3e467 100644 --- a/reference/type_traits/is_layout_compatible.md +++ b/reference/type_traits/is_layout_compatible.md @@ -77,7 +77,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 12.1 +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/type_traits/is_literal_type.md b/reference/type_traits/is_literal_type.md index 9581cc5f2f..8edb4bec67 100644 --- a/reference/type_traits/is_literal_type.md +++ b/reference/type_traits/is_literal_type.md @@ -78,9 +78,9 @@ int main() {} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.6.4 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.6.4 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012~2013は、C++11の定義に基づく実装となっている。すなわち、テンプレート実引数として`void`を渡すと`std::false_type`からの派生になる。 ### 備考 diff --git a/reference/type_traits/is_lvalue_reference.md b/reference/type_traits/is_lvalue_reference.md index 834dcb4d45..875f90ebd2 100644 --- a/reference/type_traits/is_lvalue_reference.md +++ b/reference/type_traits/is_lvalue_reference.md @@ -64,8 +64,8 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.4, 4.5.3, 4.6.1, 4.7.2 -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.5.3 [mark verified], 4.6.1 [mark verified], 4.7.2 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] #### 備考 上の例でコンパイラによってはエラーになる。GCC 4.3.4, 4.5.3, Visual C++ 2010 は [`integral_constant`](integral_constant.md) が `operator bool()` を持っていないためエラーになる。 diff --git a/reference/type_traits/is_member_function_pointer.md b/reference/type_traits/is_member_function_pointer.md index 53ced1632c..43d3ec69a0 100644 --- a/reference/type_traits/is_member_function_pointer.md +++ b/reference/type_traits/is_member_function_pointer.md @@ -71,8 +71,8 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.4, 4.6.1, 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.6.1 [mark verified], 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] #### 備考 上の例でコンパイラによってはエラーになる。GCC 4.3.4, 4.5.3, Visual C++ 2010 は [`integral_constant`](integral_constant.md) が `operator bool()` を持っていないためエラーになる。 diff --git a/reference/type_traits/is_member_object_pointer.md b/reference/type_traits/is_member_object_pointer.md index 7bf435a9f2..85bf189462 100644 --- a/reference/type_traits/is_member_object_pointer.md +++ b/reference/type_traits/is_member_object_pointer.md @@ -70,8 +70,8 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.4, 4.5.3, 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.5.3 [mark verified], 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] #### 備考 上の例でコンパイラによってはエラーになる。GCC 4.3.4, 4.5.3, Visual C++ 2010 は [`integral_constant`](integral_constant.md) が `operator bool()` を持っていないためエラーになる。 diff --git a/reference/type_traits/is_member_pointer.md b/reference/type_traits/is_member_pointer.md index 158c64448a..01f470d69a 100644 --- a/reference/type_traits/is_member_pointer.md +++ b/reference/type_traits/is_member_pointer.md @@ -66,8 +66,8 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.4, 4.5.3, 4.6.2, 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.5.3 [mark verified], 4.6.2 [mark verified], 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] #### 備考 上の例でコンパイラによってはエラーになる。GCC 4.3.4, 4.5.3, Visual C++ 2010 は `integral_constant` が `operator bool()` を持っていないためエラーになる。 diff --git a/reference/type_traits/is_move_assignable.md b/reference/type_traits/is_move_assignable.md index 4fe57ab8f1..5bffa40e4e 100644 --- a/reference/type_traits/is_move_assignable.md +++ b/reference/type_traits/is_move_assignable.md @@ -83,8 +83,8 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.8.0 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.8.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012は、誤って`std::is_move_assignable`が`true_type`になっている。 - 2012~2013は、C++11の定義に基づく実装となっている。 diff --git a/reference/type_traits/is_move_constructible.md b/reference/type_traits/is_move_constructible.md index 957a3c5caa..2753f36183 100644 --- a/reference/type_traits/is_move_constructible.md +++ b/reference/type_traits/is_move_constructible.md @@ -79,8 +79,8 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012~2013には、提案時の名前である`has_move_constructor`も存在する。 - 2012は、誤って`void`と参照型において`true_type`になっている。上記例のうち、`std::is_move_constructible`, `std::is_move_constructible`, `std::is_move_constructible`が該当する。 - 2012~2013は、上記例のうち`is_move_constructible`に関するものにおいて、誤った結果になる。これは、[`is_constructible`](is_constructible.md)の不具合に由来する。 diff --git a/reference/type_traits/is_nothrow_assignable.md b/reference/type_traits/is_nothrow_assignable.md index 5b0e1968bd..bdc1b5a275 100644 --- a/reference/type_traits/is_nothrow_assignable.md +++ b/reference/type_traits/is_nothrow_assignable.md @@ -66,9 +66,9 @@ int main() {} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.7.3 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.3 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/type_traits/is_nothrow_constructible.md b/reference/type_traits/is_nothrow_constructible.md index ac22155ce7..d23c360eb2 100644 --- a/reference/type_traits/is_nothrow_constructible.md +++ b/reference/type_traits/is_nothrow_constructible.md @@ -68,8 +68,8 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.7.0, 4.8.0 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified], 4.8.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012は、可変引数テンプレートに対応していないため、不完全な実装である。 diff --git a/reference/type_traits/is_nothrow_convertible.md b/reference/type_traits/is_nothrow_convertible.md index dfd05b4ca8..03f2101832 100644 --- a/reference/type_traits/is_nothrow_convertible.md +++ b/reference/type_traits/is_nothrow_convertible.md @@ -79,8 +79,8 @@ int main() {} - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 9.0 -- [GCC](/implementation.md#gcc): 9.1 +- [Clang](/implementation.md#clang): 9.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/type_traits/is_nothrow_copy_assignable.md b/reference/type_traits/is_nothrow_copy_assignable.md index 3af51b304a..98f222d481 100644 --- a/reference/type_traits/is_nothrow_copy_assignable.md +++ b/reference/type_traits/is_nothrow_copy_assignable.md @@ -94,9 +94,9 @@ int main() {} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.7.3 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.3 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012~2013には、提案時の名前である`has_nothrow_assign`, `has_nothrow_copy_assign`も存在する。 diff --git a/reference/type_traits/is_nothrow_copy_constructible.md b/reference/type_traits/is_nothrow_copy_constructible.md index 45b1beb509..39deb2cc65 100644 --- a/reference/type_traits/is_nothrow_copy_constructible.md +++ b/reference/type_traits/is_nothrow_copy_constructible.md @@ -91,8 +91,8 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.7.0, 4.8.0 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified], 4.8.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012~2013には、提案時の名前である`has_nothrow_copy`, `has_nothrow_copy_constructor`も存在する。 - 2012は、すべてのクラス型において`true_type`になるかのような挙動を示した。上記例のうち`s`, `t`, `u`で`true_type`となった。ただし、2013で非対応の構文については適宜変更の上で試した。 - 2013は、C++11に準拠する実装となっている。 diff --git a/reference/type_traits/is_nothrow_default_constructible.md b/reference/type_traits/is_nothrow_default_constructible.md index 0e3cb393a1..045dcc9860 100644 --- a/reference/type_traits/is_nothrow_default_constructible.md +++ b/reference/type_traits/is_nothrow_default_constructible.md @@ -76,8 +76,8 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.8.0 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.8.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012~2013には、提案時の名前である`has_nothrow_constructor`, `has_nothrow_default_constructor`も存在する。 - 2012は`void`において、誤って`false_type`になっている。 - 2013までは`std::is_default_constructible`のような要素数の指定がない配列型において、誤って`false_type`になっている。 diff --git a/reference/type_traits/is_nothrow_destructible.md b/reference/type_traits/is_nothrow_destructible.md index 200cdeb524..e114caf79b 100644 --- a/reference/type_traits/is_nothrow_destructible.md +++ b/reference/type_traits/is_nothrow_destructible.md @@ -72,9 +72,9 @@ int main() {} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.8.1 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.8.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012は、正しく実装されていない。常に`true_type`になっている。 diff --git a/reference/type_traits/is_nothrow_invocable.md b/reference/type_traits/is_nothrow_invocable.md index 956266de9e..6dec300a99 100644 --- a/reference/type_traits/is_nothrow_invocable.md +++ b/reference/type_traits/is_nothrow_invocable.md @@ -72,7 +72,7 @@ false ### 処理系 - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 3 +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 3 [mark verified] ## 参照 - [C++1z 関数が呼び出し可能かを判定する型特性 - Faith and Brave - C++で遊ぼう](https://faithandbrave.hateblo.jp/entry/2016/05/13/183857) diff --git a/reference/type_traits/is_nothrow_invocable_r.md b/reference/type_traits/is_nothrow_invocable_r.md index 765cf26ebe..e50de182c6 100644 --- a/reference/type_traits/is_nothrow_invocable_r.md +++ b/reference/type_traits/is_nothrow_invocable_r.md @@ -95,7 +95,7 @@ false ### 処理系 - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 3 +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 3 [mark verified] ## 参照 - [C++1z 関数が呼び出し可能かを判定する型特性 - Faith and Brave - C++で遊ぼう](https://faithandbrave.hateblo.jp/entry/2016/05/13/183857) diff --git a/reference/type_traits/is_nothrow_move_assignable.md b/reference/type_traits/is_nothrow_move_assignable.md index 189045825b..48f1e6f4e2 100644 --- a/reference/type_traits/is_nothrow_move_assignable.md +++ b/reference/type_traits/is_nothrow_move_assignable.md @@ -94,9 +94,9 @@ int main() {} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.7.3 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.3 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012~2013には、提案時の名前である`has_nothrow_move_assign`も存在する。 - 2012は、`int`などの組込型において、誤って`false_type`になっている。 diff --git a/reference/type_traits/is_nothrow_move_constructible.md b/reference/type_traits/is_nothrow_move_constructible.md index 1ffc1945d6..68c7e163a0 100644 --- a/reference/type_traits/is_nothrow_move_constructible.md +++ b/reference/type_traits/is_nothrow_move_constructible.md @@ -93,9 +93,9 @@ int main() {} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.7.3 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.3 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012は、すべてのクラス型において`true_type`になるかのような挙動を示した。上記例のクラス`C`の場合に、`true_type`となった。 diff --git a/reference/type_traits/is_nothrow_swappable.md b/reference/type_traits/is_nothrow_swappable.md index af02442d65..89d0e25ce0 100644 --- a/reference/type_traits/is_nothrow_swappable.md +++ b/reference/type_traits/is_nothrow_swappable.md @@ -78,7 +78,7 @@ false ### 処理系 - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 update3, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2015 update3 [mark verified], 2017 [mark verified] - 2015 update3では、インテリセンスで表示されないが変数テンプレート共々定義されており利用可能である ## 参照 diff --git a/reference/type_traits/is_nothrow_swappable_with.md b/reference/type_traits/is_nothrow_swappable_with.md index db7930a5ba..bb1144ece9 100644 --- a/reference/type_traits/is_nothrow_swappable_with.md +++ b/reference/type_traits/is_nothrow_swappable_with.md @@ -78,7 +78,7 @@ false ### 処理系 - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 update3, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2015 update3 [mark verified], 2017 [mark verified] - 2015 update3では、インテリセンスで表示されないが変数テンプレート共々定義されており利用可能である ## 参照 diff --git a/reference/type_traits/is_null_pointer.md b/reference/type_traits/is_null_pointer.md index 6ffda6d067..0b7329cf27 100644 --- a/reference/type_traits/is_null_pointer.md +++ b/reference/type_traits/is_null_pointer.md @@ -54,9 +54,9 @@ int main(){} - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.4 -- [GCC](/implementation.md#gcc): 4.9 -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Clang](/implementation.md#clang): 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.9 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] ## 参照 diff --git a/reference/type_traits/is_object.md b/reference/type_traits/is_object.md index 44607d810c..0f8ca68339 100644 --- a/reference/type_traits/is_object.md +++ b/reference/type_traits/is_object.md @@ -62,8 +62,8 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.4, 4.5.3, 4.6.2, 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.5.3 [mark verified], 4.6.2 [mark verified], 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] #### 備考 上の例でコンパイラによってはエラーになる。GCC 4.3.4, 4.5.3, Visual C++ 2010 は `integral_constant` が `operator bool()` を持っていないためエラーになる。 diff --git a/reference/type_traits/is_pod.md b/reference/type_traits/is_pod.md index 7faded88f4..c108875eff 100644 --- a/reference/type_traits/is_pod.md +++ b/reference/type_traits/is_pod.md @@ -75,8 +75,8 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.4, 4.5.3, 4.6.2, 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.5.3 [mark verified], 4.6.2 [mark verified], 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2008~2012は、`void`とPODなクラスへの参照(上記例のうち`POD_struct&`)において、誤って`false_type`になっている。 - 2013のみは、組込型への参照において、誤って`false_type`になっている。 diff --git a/reference/type_traits/is_pointer.md b/reference/type_traits/is_pointer.md index 49c4821ec5..0c9b5857d7 100644 --- a/reference/type_traits/is_pointer.md +++ b/reference/type_traits/is_pointer.md @@ -72,8 +72,8 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.4, 4.5.3, 4.6.2, 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.5.3 [mark verified], 4.6.2 [mark verified], 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] #### 備考 上の例でコンパイラによってはエラーになる。GCC 4.3.4, 4.5.3, Visual C++ 2010.0 は [`integral_constant`](integral_constant.md) が `operator bool()` を持っていないためエラーになる。また、GCC 4,3,4, 4.5.3 は `nullptr_t` 型に対応していないためエラーになる。 diff --git a/reference/type_traits/is_polymorphic.md b/reference/type_traits/is_polymorphic.md index ff07303a29..25c3e704ee 100644 --- a/reference/type_traits/is_polymorphic.md +++ b/reference/type_traits/is_polymorphic.md @@ -65,8 +65,8 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.4, 4.5.3, 4.6.2, 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.5.3 [mark verified], 4.6.2 [mark verified], 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] #### 備考 上の例でコンパイラによってはエラーになる。GCC 4.3.4, 4.5.3, Visual C++ 2010.0 は `integral_constant` が `operator bool()` を持っていないためエラーになる。 diff --git a/reference/type_traits/is_reference.md b/reference/type_traits/is_reference.md index 89b9f936f5..a0d14e5b3b 100644 --- a/reference/type_traits/is_reference.md +++ b/reference/type_traits/is_reference.md @@ -57,8 +57,8 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.4, 4.5.3, 4.6.1, 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.5.3 [mark verified], 4.6.1 [mark verified], 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] #### 備考 上の例でコンパイラによってはエラーになる。GCC 4.3.4, 4.5.3, Visual C++ 2010.0 は [`integral_constant`](integral_constant.md) が `operator bool()` を持っていないためエラーになる。 diff --git a/reference/type_traits/is_rvalue_reference.md b/reference/type_traits/is_rvalue_reference.md index 68740a69c9..f47531b995 100644 --- a/reference/type_traits/is_rvalue_reference.md +++ b/reference/type_traits/is_rvalue_reference.md @@ -64,8 +64,8 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.4, 4.5.3, 4.6.1, 4.7.2 -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.5.3 [mark verified], 4.6.1 [mark verified], 4.7.2 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2010は、関数への右辺値参照(上記例のうち`void (&&)()`)において、誤って`false_type`になっている。 #### 備考 diff --git a/reference/type_traits/is_same.md b/reference/type_traits/is_same.md index 2025c4af25..372693be2b 100644 --- a/reference/type_traits/is_same.md +++ b/reference/type_traits/is_same.md @@ -63,8 +63,8 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.4, 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/type_traits/is_scalar.md b/reference/type_traits/is_scalar.md index 4f74a43ab5..a0b17f327b 100644 --- a/reference/type_traits/is_scalar.md +++ b/reference/type_traits/is_scalar.md @@ -70,8 +70,8 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.4, 4.5.3, 4.6.2, 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.5.3 [mark verified], 4.6.2 [mark verified], 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2010~2012は、`is_scalar<`[`nullptr_t`](../cstddef/nullptr_t.md)`>`が`false_type`からの派生クラスとなっている #### 備考 diff --git a/reference/type_traits/is_scoped_enum.md b/reference/type_traits/is_scoped_enum.md index edfb928000..d54fb327a3 100644 --- a/reference/type_traits/is_scoped_enum.md +++ b/reference/type_traits/is_scoped_enum.md @@ -48,7 +48,7 @@ int main() { - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 12.0 +- [Clang](/implementation.md#clang): 12.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/type_traits/is_signed.md b/reference/type_traits/is_signed.md index d7165dc7fe..43b4fd4eda 100644 --- a/reference/type_traits/is_signed.md +++ b/reference/type_traits/is_signed.md @@ -62,8 +62,8 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.4, 4.5.3, 4.6.2, 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.5.3 [mark verified], 4.6.2 [mark verified], 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2008は、TR1の定義に基づく実装となっている。すなわち、`T`が整数型でなければ必ず`false_type`になる。上記例では`std::is_signed`が該当する。 #### 備考 diff --git a/reference/type_traits/is_standard_layout.md b/reference/type_traits/is_standard_layout.md index 44465a67a4..b554a44c32 100644 --- a/reference/type_traits/is_standard_layout.md +++ b/reference/type_traits/is_standard_layout.md @@ -73,9 +73,9 @@ int main() {} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.5.4 -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.5.4 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 関連項目 diff --git a/reference/type_traits/is_swappable.md b/reference/type_traits/is_swappable.md index ef17373249..1e83734c8b 100644 --- a/reference/type_traits/is_swappable.md +++ b/reference/type_traits/is_swappable.md @@ -72,7 +72,7 @@ false ### 処理系 - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 update3, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2015 update3 [mark verified], 2017 [mark verified] - 2015 update3では、インテリセンスで表示されないが変数テンプレート共々定義されており利用可能である ## 参照 diff --git a/reference/type_traits/is_swappable_with.md b/reference/type_traits/is_swappable_with.md index 50f0099494..faa61b8634 100644 --- a/reference/type_traits/is_swappable_with.md +++ b/reference/type_traits/is_swappable_with.md @@ -112,7 +112,7 @@ true ### 処理系 - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 update3, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2015 update3 [mark verified], 2017 [mark verified] - 2015 update3では、インテリセンスで表示されないが変数テンプレート共々定義されており利用可能である ## 参照 diff --git a/reference/type_traits/is_trivial.md b/reference/type_traits/is_trivial.md index 1a3677574a..81656bf6ba 100644 --- a/reference/type_traits/is_trivial.md +++ b/reference/type_traits/is_trivial.md @@ -68,8 +68,8 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.4, 4.5.3, 4.6.2, 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.5.3 [mark verified], 4.6.2 [mark verified], 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2010は、クラスへの参照型(上記例のうち`trivial_class&`)において、誤って`false_type`になっている。 #### 備考 diff --git a/reference/type_traits/is_trivially_assignable.md b/reference/type_traits/is_trivially_assignable.md index 0723892574..b0e5010bed 100644 --- a/reference/type_traits/is_trivially_assignable.md +++ b/reference/type_traits/is_trivially_assignable.md @@ -83,9 +83,9 @@ int main() {} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 5.0 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 5.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012は、`is_assignable`と同一の実装になっている。 diff --git a/reference/type_traits/is_trivially_constructible.md b/reference/type_traits/is_trivially_constructible.md index d2bd002493..e5e2785734 100644 --- a/reference/type_traits/is_trivially_constructible.md +++ b/reference/type_traits/is_trivially_constructible.md @@ -83,9 +83,9 @@ int main() {} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 5.0 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 5.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012は、`is_constructible`と同一の実装になっている。 diff --git a/reference/type_traits/is_trivially_copy_assignable.md b/reference/type_traits/is_trivially_copy_assignable.md index 43ea80514c..66e4222b51 100644 --- a/reference/type_traits/is_trivially_copy_assignable.md +++ b/reference/type_traits/is_trivially_copy_assignable.md @@ -90,9 +90,9 @@ int main() {} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 5.0 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 5.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/type_traits/is_trivially_copy_constructible.md b/reference/type_traits/is_trivially_copy_constructible.md index 54fa08d7e0..82f4255a02 100644 --- a/reference/type_traits/is_trivially_copy_constructible.md +++ b/reference/type_traits/is_trivially_copy_constructible.md @@ -90,9 +90,9 @@ int main() {} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 5.0 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 5.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/type_traits/is_trivially_copyable.md b/reference/type_traits/is_trivially_copyable.md index c116b55b1c..7b68c54d44 100644 --- a/reference/type_traits/is_trivially_copyable.md +++ b/reference/type_traits/is_trivially_copyable.md @@ -224,9 +224,9 @@ int main() {} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 5.0 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 5.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012~2013は、正しく実装されていない。`is_trivially_copy_constructible`と同一の実装になっている。 diff --git a/reference/type_traits/is_trivially_default_constructible.md b/reference/type_traits/is_trivially_default_constructible.md index ec0d6f93e8..591135e2fc 100644 --- a/reference/type_traits/is_trivially_default_constructible.md +++ b/reference/type_traits/is_trivially_default_constructible.md @@ -83,9 +83,9 @@ int main() {} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 5.0 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 5.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/type_traits/is_trivially_destructible.md b/reference/type_traits/is_trivially_destructible.md index 30d94ce529..1f4fa497e0 100644 --- a/reference/type_traits/is_trivially_destructible.md +++ b/reference/type_traits/is_trivially_destructible.md @@ -137,9 +137,9 @@ destruct - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.8.2 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.8.2 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] #### 備考 diff --git a/reference/type_traits/is_trivially_move_assignable.md b/reference/type_traits/is_trivially_move_assignable.md index ac73516232..25f117c3eb 100644 --- a/reference/type_traits/is_trivially_move_assignable.md +++ b/reference/type_traits/is_trivially_move_assignable.md @@ -89,9 +89,9 @@ int main() {} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.3 -- [GCC](/implementation.md#gcc): 5.0 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.3 [mark verified] +- [GCC](/implementation.md#gcc): 5.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ### 備考 Clang 3.0から3.2は、上記例の`Y`クラスがトリビアルにムーブ代入可能と判定される。Clang 3.3から修正されている。 diff --git a/reference/type_traits/is_trivially_move_constructible.md b/reference/type_traits/is_trivially_move_constructible.md index 3546d1add5..40a9529185 100644 --- a/reference/type_traits/is_trivially_move_constructible.md +++ b/reference/type_traits/is_trivially_move_constructible.md @@ -90,9 +90,9 @@ int main() {} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.3 -- [GCC](/implementation.md#gcc): 5.0 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.3 [mark verified] +- [GCC](/implementation.md#gcc): 5.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ### 備考 Clang 3.0から3.2は、上記例の`Y`クラスがトリビアルにムーブ構築可能と判定される。Clang 3.3から修正されている。 diff --git a/reference/type_traits/is_unbounded_array.md b/reference/type_traits/is_unbounded_array.md index 58285f41e1..393130e9d1 100644 --- a/reference/type_traits/is_unbounded_array.md +++ b/reference/type_traits/is_unbounded_array.md @@ -53,8 +53,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 9.0 -- [GCC](/implementation.md#gcc): 9.1 +- [Clang](/implementation.md#clang): 9.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/type_traits/is_union.md b/reference/type_traits/is_union.md index dc5b6343c7..50e41e4ef2 100644 --- a/reference/type_traits/is_union.md +++ b/reference/type_traits/is_union.md @@ -59,8 +59,8 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.4, 4.5.3, 4.6.1, 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.5.3 [mark verified], 4.6.1 [mark verified], 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] #### 備考 上の例でコンパイラによってはエラーになる。GCC 4.3.4, 4.5.3, Visual C++ 2010 は [`integral_constant`](integral_constant.md) が `operator bool()` を持っていないためエラーになる。 diff --git a/reference/type_traits/is_unsigned.md b/reference/type_traits/is_unsigned.md index 5ec14ed1b9..443446530f 100644 --- a/reference/type_traits/is_unsigned.md +++ b/reference/type_traits/is_unsigned.md @@ -62,8 +62,8 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.4, 4.5.3, 4.6.2, 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.5.3 [mark verified], 4.6.2 [mark verified], 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] #### 備考 上の例でコンパイラによってはエラーになる。GCC 4.3.4, 4.5.3, Visual C++ 2010 は `integral_constant` が `operator bool()` を持っていないためエラーになる。 diff --git a/reference/type_traits/is_void.md b/reference/type_traits/is_void.md index 8cf83d5c6b..4e2086b4a1 100644 --- a/reference/type_traits/is_void.md +++ b/reference/type_traits/is_void.md @@ -56,8 +56,8 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.4, 4.5.3, 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.5.3 [mark verified], 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] #### 備考 上の例でコンパイラによってはエラーになる。GCC 4.3.4, 4.5.3, Visual C++ 2010 は [`integral_constant`](integral_constant.md) が `operator bool()` を持っていないためエラーになる。 diff --git a/reference/type_traits/is_volatile.md b/reference/type_traits/is_volatile.md index bb0dfb59ce..76f62ef9d0 100644 --- a/reference/type_traits/is_volatile.md +++ b/reference/type_traits/is_volatile.md @@ -56,8 +56,8 @@ int main(){} - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.3.4, 4.5.3, 4.6.2, 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.5.3 [mark verified], 4.6.2 [mark verified], 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] #### 備考 上の例でコンパイラによってはエラーになる。GCC 4.3.4, 4.5.3, Visual C++ 2010 は `integral_constant` が `operator bool()` を持っていないためエラーになる。 diff --git a/reference/type_traits/make_signed.md b/reference/type_traits/make_signed.md index 4807d41c7b..56df3c296a 100644 --- a/reference/type_traits/make_signed.md +++ b/reference/type_traits/make_signed.md @@ -72,9 +72,9 @@ int main() {} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.4.7 -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2010は、cv修飾修飾されている型において、コンパイルエラーになるバグがある。 - `make_signed_t`は2013から diff --git a/reference/type_traits/make_unsigned.md b/reference/type_traits/make_unsigned.md index b60912c52d..210ae1831d 100644 --- a/reference/type_traits/make_unsigned.md +++ b/reference/type_traits/make_unsigned.md @@ -72,9 +72,9 @@ int main() {} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.4.7 -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2010は、cv修飾修飾されている型において、コンパイルエラーになるバグがある。 - `make_unsigned_t`は2013から diff --git a/reference/type_traits/negation.md b/reference/type_traits/negation.md index bc8ba82e8b..99355eaeaa 100644 --- a/reference/type_traits/negation.md +++ b/reference/type_traits/negation.md @@ -76,9 +76,9 @@ struct negation : bool_constant {}; - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 3.8 -- [GCC](/implementation.md#gcc): 6.3 -- [Visual C++](/implementation.md#visual_cpp): 2015 update2, 2017 +- [Clang](/implementation.md#clang): 3.8 [mark verified] +- [GCC](/implementation.md#gcc): 6.3 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2015 update2 [mark verified], 2017 [mark verified] - `negation_v`は、2015ではインテリセンスからは見えないが利用可能である。 ## 参照 diff --git a/reference/type_traits/rank.md b/reference/type_traits/rank.md index 8673a3c151..126af104b7 100644 --- a/reference/type_traits/rank.md +++ b/reference/type_traits/rank.md @@ -49,9 +49,9 @@ int main() {} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/type_traits/remove_all_extents.md b/reference/type_traits/remove_all_extents.md index 256fd6fc97..b1ab49f2de 100644 --- a/reference/type_traits/remove_all_extents.md +++ b/reference/type_traits/remove_all_extents.md @@ -65,9 +65,9 @@ int main() {} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - `remove_all_extents_t`は2013から diff --git a/reference/type_traits/remove_const.md b/reference/type_traits/remove_const.md index 73747d1094..344b6bdd93 100644 --- a/reference/type_traits/remove_const.md +++ b/reference/type_traits/remove_const.md @@ -71,9 +71,9 @@ int main() {} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - `remove_const_t`は2013から diff --git a/reference/type_traits/remove_cv.md b/reference/type_traits/remove_cv.md index 54ba382bbd..6e2f386740 100644 --- a/reference/type_traits/remove_cv.md +++ b/reference/type_traits/remove_cv.md @@ -71,9 +71,9 @@ int main() {} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - `remove_cv_t`は2013から diff --git a/reference/type_traits/remove_cvref.md b/reference/type_traits/remove_cvref.md index dc223cf6bc..bebdacd05e 100644 --- a/reference/type_traits/remove_cvref.md +++ b/reference/type_traits/remove_cvref.md @@ -54,7 +54,7 @@ int main() {} - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 6.0 +- [Clang](/implementation.md#clang): 6.0 [mark verified] - [GCC](/implementation.md#gcc): - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/type_traits/remove_extent.md b/reference/type_traits/remove_extent.md index 6d3ff7ec85..32f157a61c 100644 --- a/reference/type_traits/remove_extent.md +++ b/reference/type_traits/remove_extent.md @@ -65,9 +65,9 @@ int main() {} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - `remove_extent_t`は2013から diff --git a/reference/type_traits/remove_pointer.md b/reference/type_traits/remove_pointer.md index 341d45e90e..6bd8bcd5c6 100644 --- a/reference/type_traits/remove_pointer.md +++ b/reference/type_traits/remove_pointer.md @@ -47,9 +47,9 @@ int main() {} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - `remove_pointer_t`は2013から diff --git a/reference/type_traits/remove_reference.md b/reference/type_traits/remove_reference.md index 64a4026c4b..3d16c6dc21 100644 --- a/reference/type_traits/remove_reference.md +++ b/reference/type_traits/remove_reference.md @@ -45,9 +45,9 @@ int main() {} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - `remove_reference_t`は2013から diff --git a/reference/type_traits/remove_volatile.md b/reference/type_traits/remove_volatile.md index 35fcf0aa39..4617ebfeda 100644 --- a/reference/type_traits/remove_volatile.md +++ b/reference/type_traits/remove_volatile.md @@ -65,9 +65,9 @@ int main() {} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - `remove_volatile_t`は2013から diff --git a/reference/type_traits/result_of.md b/reference/type_traits/result_of.md index 32ab20ad65..ad960eecab 100644 --- a/reference/type_traits/result_of.md +++ b/reference/type_traits/result_of.md @@ -144,9 +144,9 @@ Hello World - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.6.4 -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.6.4 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2008~2010は、TR1に基づく実装である。`decltype`を使用せず、関数オブジェクトに定義された`result_type`が使用される。 - 2012までは、可変引数テンプレートに対応していないため、不完全な実装である。 - `result_of_t`は、2013から。 diff --git a/reference/type_traits/true_type.md b/reference/type_traits/true_type.md index 4e5a5c2169..4625345df4 100644 --- a/reference/type_traits/true_type.md +++ b/reference/type_traits/true_type.md @@ -39,9 +39,9 @@ int main(){} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.3.4, 4.5.3, 4.6.2, 4.7.0 -- [Visual C++](/implementation.md#visual_cpp): 2010 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.4 [mark verified], 4.5.3 [mark verified], 4.6.2 [mark verified], 4.7.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] #### 備考 上の例でコンパイラによってはエラーになる。GCC 4.3.4, 4.5.3, Visual C++ 2010 は [`integral_constant`](integral_constant.md) が `operator value_type()` を持っていないためエラーになる。 diff --git a/reference/type_traits/type_identity.md b/reference/type_traits/type_identity.md index 33a751b47e..9b6d21ceed 100644 --- a/reference/type_traits/type_identity.md +++ b/reference/type_traits/type_identity.md @@ -139,8 +139,8 @@ int main() { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 9.1 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/type_traits/underlying_type.md b/reference/type_traits/underlying_type.md index 9dee82364b..ac1e03fcac 100644 --- a/reference/type_traits/underlying_type.md +++ b/reference/type_traits/underlying_type.md @@ -116,17 +116,17 @@ int main() {} ### 処理系 #### underlying_type -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] #### P0340R3: Making `std::underlying_type` SFINAE-friendly 以下の処理系ではコンパイル時の言語バージョンスイッチに関わらずP0340R3の修正が適用されている -- [Clang](/implementation.md#clang): 9.0 -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 5 +- [Clang](/implementation.md#clang): 9.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 5 [mark verified] ## 関連項目 - [C++11 スコープを持つ列挙型](/lang/cpp11/scoped_enum.md) diff --git a/reference/type_traits/unwrap_ref_decay.md b/reference/type_traits/unwrap_ref_decay.md index 777954c0af..337f9c9188 100644 --- a/reference/type_traits/unwrap_ref_decay.md +++ b/reference/type_traits/unwrap_ref_decay.md @@ -104,8 +104,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 9.1 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/type_traits/unwrap_reference.md b/reference/type_traits/unwrap_reference.md index 6251cd535d..a870b356b3 100644 --- a/reference/type_traits/unwrap_reference.md +++ b/reference/type_traits/unwrap_reference.md @@ -98,8 +98,8 @@ namespace std { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 9.1 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/type_traits/void_t.md b/reference/type_traits/void_t.md index 284bb45673..c366b20955 100644 --- a/reference/type_traits/void_t.md +++ b/reference/type_traits/void_t.md @@ -94,9 +94,9 @@ false - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 3.6 -- [GCC](/implementation.md#gcc): 6.3 -- [Visual C++](/implementation.md#visual_cpp): 2015, 2017 +- [Clang](/implementation.md#clang): 3.6 [mark verified] +- [GCC](/implementation.md#gcc): 6.3 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified], 2017 [mark verified] - 2015では備考にある複雑な実装になっている。 ## 参照 diff --git a/reference/typeindex/type_index.md b/reference/typeindex/type_index.md index d5d33f15db..dd4072d16a 100644 --- a/reference/typeindex/type_index.md +++ b/reference/typeindex/type_index.md @@ -73,9 +73,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/typeindex/type_index/hash_code.md b/reference/typeindex/type_index/hash_code.md index 3b8a754cd8..deba409a39 100644 --- a/reference/typeindex/type_index/hash_code.md +++ b/reference/typeindex/type_index/hash_code.md @@ -72,9 +72,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/typeindex/type_index/name.md b/reference/typeindex/type_index/name.md index 68a40d52f3..93c06749f6 100644 --- a/reference/typeindex/type_index/name.md +++ b/reference/typeindex/type_index/name.md @@ -51,9 +51,9 @@ c ### 処理系 - [Clang](/implementation.md#clang): ? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/typeindex/type_index/op_compare_3way.md b/reference/typeindex/type_index/op_compare_3way.md index f51e68f5a0..411600cf02 100644 --- a/reference/typeindex/type_index/op_compare_3way.md +++ b/reference/typeindex/type_index/op_compare_3way.md @@ -56,7 +56,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10 +- [GCC](/implementation.md#gcc): 10 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/typeindex/type_index/op_constructor.md b/reference/typeindex/type_index/op_constructor.md index 1093c1df94..0507875ac2 100644 --- a/reference/typeindex/type_index/op_constructor.md +++ b/reference/typeindex/type_index/op_constructor.md @@ -41,7 +41,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] diff --git a/reference/typeindex/type_index/op_equal.md b/reference/typeindex/type_index/op_equal.md index 0f9e6801e5..97a5be0a39 100644 --- a/reference/typeindex/type_index/op_equal.md +++ b/reference/typeindex/type_index/op_equal.md @@ -56,9 +56,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/typeindex/type_index/op_greater.md b/reference/typeindex/type_index/op_greater.md index b444bd0c02..82a4562b52 100644 --- a/reference/typeindex/type_index/op_greater.md +++ b/reference/typeindex/type_index/op_greater.md @@ -71,8 +71,8 @@ char ### 処理系 - [Clang](/implementation.md#clang): ? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] diff --git a/reference/typeindex/type_index/op_greater_equal.md b/reference/typeindex/type_index/op_greater_equal.md index 64460adc13..747b9b7115 100644 --- a/reference/typeindex/type_index/op_greater_equal.md +++ b/reference/typeindex/type_index/op_greater_equal.md @@ -71,8 +71,8 @@ char ### 処理系 - [Clang](/implementation.md#clang): ? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] diff --git a/reference/typeindex/type_index/op_less.md b/reference/typeindex/type_index/op_less.md index 2e57c4b14c..dab6aca886 100644 --- a/reference/typeindex/type_index/op_less.md +++ b/reference/typeindex/type_index/op_less.md @@ -70,7 +70,7 @@ int ### 処理系 - [Clang](/implementation.md#clang): ? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] diff --git a/reference/typeindex/type_index/op_less_equal.md b/reference/typeindex/type_index/op_less_equal.md index 7a9b94334c..feb19fcffb 100644 --- a/reference/typeindex/type_index/op_less_equal.md +++ b/reference/typeindex/type_index/op_less_equal.md @@ -71,8 +71,8 @@ int ### 処理系 - [Clang](/implementation.md#clang): ? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] diff --git a/reference/typeindex/type_index/op_not_equal.md b/reference/typeindex/type_index/op_not_equal.md index 3a1b32c033..ad9a16215a 100644 --- a/reference/typeindex/type_index/op_not_equal.md +++ b/reference/typeindex/type_index/op_not_equal.md @@ -49,9 +49,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] ## 参照 diff --git a/reference/typeinfo/type_info/hash_code.md b/reference/typeinfo/type_info/hash_code.md index ca4f62188e..fa9bb5bbb9 100644 --- a/reference/typeinfo/type_info/hash_code.md +++ b/reference/typeinfo/type_info/hash_code.md @@ -50,9 +50,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/unordered_map/unordered_map/at.md b/reference/unordered_map/unordered_map/at.md index 755396ff4f..53bee16ce4 100644 --- a/reference/unordered_map/unordered_map/at.md +++ b/reference/unordered_map/unordered_map/at.md @@ -69,7 +69,7 @@ exception std::out_of_range - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/unordered_map/unordered_map/begin-size_type.md b/reference/unordered_map/unordered_map/begin-size_type.md index 6307f6ff63..c15b1d1f39 100644 --- a/reference/unordered_map/unordered_map/begin-size_type.md +++ b/reference/unordered_map/unordered_map/begin-size_type.md @@ -83,8 +83,8 @@ bucket = 10, bucket_size = 1, keys = { A, } - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_map/begin.md b/reference/unordered_map/unordered_map/begin.md index 8f621567f6..69a43cb569 100644 --- a/reference/unordered_map/unordered_map/begin.md +++ b/reference/unordered_map/unordered_map/begin.md @@ -71,8 +71,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1 -- [GCC](/implementation.md#gcc): 4.4.7, 4.5.3, 4.6.3, 4.7.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_map/bucket.md b/reference/unordered_map/unordered_map/bucket.md index d3a1535aec..2f7729450f 100644 --- a/reference/unordered_map/unordered_map/bucket.md +++ b/reference/unordered_map/unordered_map/bucket.md @@ -84,8 +84,8 @@ key = H, bucket = 6, bucket_size = 0 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.2 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++:](/implementation.md#visual_cpp) ? diff --git a/reference/unordered_map/unordered_map/bucket_count.md b/reference/unordered_map/unordered_map/bucket_count.md index 70420cea83..cb7658b70b 100644 --- a/reference/unordered_map/unordered_map/bucket_count.md +++ b/reference/unordered_map/unordered_map/bucket_count.md @@ -56,8 +56,8 @@ bucket count is 11 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.4.7 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_map/bucket_size.md b/reference/unordered_map/unordered_map/bucket_size.md index c99cef2346..05d99ed36c 100644 --- a/reference/unordered_map/unordered_map/bucket_size.md +++ b/reference/unordered_map/unordered_map/bucket_size.md @@ -83,8 +83,8 @@ bucket = 10, bucket_size = 1, keys = { A, } - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.2 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++:](/implementation.md#visual_cpp) ? diff --git a/reference/unordered_map/unordered_map/cbegin-size_type.md b/reference/unordered_map/unordered_map/cbegin-size_type.md index a39239a76b..fdbf603422 100644 --- a/reference/unordered_map/unordered_map/cbegin-size_type.md +++ b/reference/unordered_map/unordered_map/cbegin-size_type.md @@ -82,8 +82,8 @@ bucket = 10, bucket_size = 1, keys = { A, } - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_map/cbegin.md b/reference/unordered_map/unordered_map/cbegin.md index 312a768bf0..e3efa4ab5a 100644 --- a/reference/unordered_map/unordered_map/cbegin.md +++ b/reference/unordered_map/unordered_map/cbegin.md @@ -62,8 +62,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1 -- [GCC](/implementation.md#gcc): 4.4.7, 4.5.3, 4.6.3, 4.7.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_map/cend-size_type.md b/reference/unordered_map/unordered_map/cend-size_type.md index d09c2f4e79..f6738baf64 100644 --- a/reference/unordered_map/unordered_map/cend-size_type.md +++ b/reference/unordered_map/unordered_map/cend-size_type.md @@ -82,8 +82,8 @@ bucket = 10, bucket_size = 1, keys = { A, } - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_map/cend.md b/reference/unordered_map/unordered_map/cend.md index 4910ba48f1..9cd78ca7df 100644 --- a/reference/unordered_map/unordered_map/cend.md +++ b/reference/unordered_map/unordered_map/cend.md @@ -66,8 +66,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1 -- [GCC](/implementation.md#gcc): 4.4.7, 4.5.3, 4.6.3, 4.7.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_map/clear.md b/reference/unordered_map/unordered_map/clear.md index d1de03e672..1d0ce4f0c2 100644 --- a/reference/unordered_map/unordered_map/clear.md +++ b/reference/unordered_map/unordered_map/clear.md @@ -66,8 +66,8 @@ true - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_map/contains.md b/reference/unordered_map/unordered_map/contains.md index 4cc60fa562..bce59c04c1 100644 --- a/reference/unordered_map/unordered_map/contains.md +++ b/reference/unordered_map/unordered_map/contains.md @@ -76,8 +76,8 @@ contain ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 1 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 1 [mark verified] ## 参照 - [P0458R2 Checking for Existence of an Element in Associative Containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0458r2.html) diff --git a/reference/unordered_map/unordered_map/count.md b/reference/unordered_map/unordered_map/count.md index c22a78e32e..83ba572345 100644 --- a/reference/unordered_map/unordered_map/count.md +++ b/reference/unordered_map/unordered_map/count.md @@ -80,7 +80,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/unordered_map/unordered_map/emplace.md b/reference/unordered_map/unordered_map/emplace.md index 4d4c709177..bf2efefc94 100644 --- a/reference/unordered_map/unordered_map/emplace.md +++ b/reference/unordered_map/unordered_map/emplace.md @@ -131,8 +131,8 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_map/emplace_hint.md b/reference/unordered_map/unordered_map/emplace_hint.md index 5d661e3a5d..cb630248aa 100644 --- a/reference/unordered_map/unordered_map/emplace_hint.md +++ b/reference/unordered_map/unordered_map/emplace_hint.md @@ -130,8 +130,8 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_map/empty.md b/reference/unordered_map/unordered_map/empty.md index 7f34078632..50c3005b90 100644 --- a/reference/unordered_map/unordered_map/empty.md +++ b/reference/unordered_map/unordered_map/empty.md @@ -68,8 +68,8 @@ true - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_map/end-size_type.md b/reference/unordered_map/unordered_map/end-size_type.md index 7606a94381..18bc6bb360 100644 --- a/reference/unordered_map/unordered_map/end-size_type.md +++ b/reference/unordered_map/unordered_map/end-size_type.md @@ -83,8 +83,8 @@ bucket = 10, bucket_size = 1, keys = { A, } - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_map/end.md b/reference/unordered_map/unordered_map/end.md index 78123aee8c..76b508131c 100644 --- a/reference/unordered_map/unordered_map/end.md +++ b/reference/unordered_map/unordered_map/end.md @@ -73,8 +73,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1 -- [GCC](/implementation.md#gcc): 4.4.7, 4.5.3, 4.6.3, 4.7.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_map/equal_range.md b/reference/unordered_map/unordered_map/equal_range.md index ef259a158c..4b6f787964 100644 --- a/reference/unordered_map/unordered_map/equal_range.md +++ b/reference/unordered_map/unordered_map/equal_range.md @@ -107,7 +107,7 @@ up:1 - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/unordered_map/unordered_map/erase.md b/reference/unordered_map/unordered_map/erase.md index ba3dbaa804..066fdf4f74 100644 --- a/reference/unordered_map/unordered_map/erase.md +++ b/reference/unordered_map/unordered_map/erase.md @@ -196,8 +196,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_map/erase_if_free.md b/reference/unordered_map/unordered_map/erase_if_free.md index dadb218c82..b2f2d8c5f2 100644 --- a/reference/unordered_map/unordered_map/erase_if_free.md +++ b/reference/unordered_map/unordered_map/erase_if_free.md @@ -76,8 +76,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 9.1 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/unordered_map/unordered_map/extract.md b/reference/unordered_map/unordered_map/extract.md index 6602e6cfaa..200425e7c9 100644 --- a/reference/unordered_map/unordered_map/extract.md +++ b/reference/unordered_map/unordered_map/extract.md @@ -83,10 +83,10 @@ m2 : ### 処理系 -- [Clang](/implementation.md#clang): 7.0.0 -- [GCC](/implementation.md#gcc): 7.1.0 +- [Clang](/implementation.md#clang): 7.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 [mark verified] ## 関連項目 diff --git a/reference/unordered_map/unordered_map/find.md b/reference/unordered_map/unordered_map/find.md index 2c8bafe508..912c23c02c 100644 --- a/reference/unordered_map/unordered_map/find.md +++ b/reference/unordered_map/unordered_map/find.md @@ -81,7 +81,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/unordered_map/unordered_map/get_allocator.md b/reference/unordered_map/unordered_map/get_allocator.md index 3c7e9e6811..5bdfe6ed86 100644 --- a/reference/unordered_map/unordered_map/get_allocator.md +++ b/reference/unordered_map/unordered_map/get_allocator.md @@ -43,10 +43,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - 2010は、`noexcept`が修飾されていない。 - 2012, 2013は、`noexcept`が実装されていないため、`throw()`が修飾されている。 diff --git a/reference/unordered_map/unordered_map/hash_function.md b/reference/unordered_map/unordered_map/hash_function.md index a598559cae..a2a00e68a6 100644 --- a/reference/unordered_map/unordered_map/hash_function.md +++ b/reference/unordered_map/unordered_map/hash_function.md @@ -68,8 +68,8 @@ hash("2nd") = 12978775524054262047 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_map/insert.md b/reference/unordered_map/unordered_map/insert.md index 390f67e240..6b0e903f34 100644 --- a/reference/unordered_map/unordered_map/insert.md +++ b/reference/unordered_map/unordered_map/insert.md @@ -243,8 +243,8 @@ insert initializer_list : (7,7th), (8,8th), (6,6th), (5,five), (4,four), (3,thre - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_map/insert_or_assign.md b/reference/unordered_map/unordered_map/insert_or_assign.md index e407b3ffb3..a1fc699bd5 100644 --- a/reference/unordered_map/unordered_map/insert_or_assign.md +++ b/reference/unordered_map/unordered_map/insert_or_assign.md @@ -115,8 +115,8 @@ key = two, value = 42, is inserted = false, is empty = true ### 処理系 -- [Clang](/implementation.md#clang): 3.7.0 -- [GCC](/implementation.md#gcc): 6.1.0 +- [Clang](/implementation.md#clang): 3.7.0 [mark verified] +- [GCC](/implementation.md#gcc): 6.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/unordered_map/unordered_map/key_eq.md b/reference/unordered_map/unordered_map/key_eq.md index 1c5c4b777e..53fa6e33e0 100644 --- a/reference/unordered_map/unordered_map/key_eq.md +++ b/reference/unordered_map/unordered_map/key_eq.md @@ -66,8 +66,8 @@ eq("1st", "2nd") = true - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_map/load_factor.md b/reference/unordered_map/unordered_map/load_factor.md index 19359f354d..f8ff477f5c 100644 --- a/reference/unordered_map/unordered_map/load_factor.md +++ b/reference/unordered_map/unordered_map/load_factor.md @@ -78,7 +78,7 @@ current load_factor: 0.5 - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/unordered_map/unordered_map/max_bucket_count.md b/reference/unordered_map/unordered_map/max_bucket_count.md index 8528951f1d..5876c30bc3 100644 --- a/reference/unordered_map/unordered_map/max_bucket_count.md +++ b/reference/unordered_map/unordered_map/max_bucket_count.md @@ -50,8 +50,8 @@ max bucket count is 576460752303423487 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_map/max_load_factor.md b/reference/unordered_map/unordered_map/max_load_factor.md index 77ce33d85a..0611743d43 100644 --- a/reference/unordered_map/unordered_map/max_load_factor.md +++ b/reference/unordered_map/unordered_map/max_load_factor.md @@ -130,7 +130,7 @@ new load_factor: 1.125 - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/unordered_map/unordered_map/max_size.md b/reference/unordered_map/unordered_map/max_size.md index a0d0362fa4..55f6243fb6 100644 --- a/reference/unordered_map/unordered_map/max_size.md +++ b/reference/unordered_map/unordered_map/max_size.md @@ -51,8 +51,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1 -- [GCC](/implementation.md#gcc): 4.4.7, 4.5.3, 4.6.3, 4.7.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_map/merge.md b/reference/unordered_map/unordered_map/merge.md index 7cfb7d89fc..68c2de140c 100644 --- a/reference/unordered_map/unordered_map/merge.md +++ b/reference/unordered_map/unordered_map/merge.md @@ -85,10 +85,10 @@ m2 : - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0.0 -- [GCC](/implementation.md#gcc): 7.1.0 +- [Clang](/implementation.md#clang): 7.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 [mark verified] ## 参照 diff --git a/reference/unordered_map/unordered_map/op_assign.md b/reference/unordered_map/unordered_map/op_assign.md index 78d4f81340..34f376dae7 100644 --- a/reference/unordered_map/unordered_map/op_assign.md +++ b/reference/unordered_map/unordered_map/op_assign.md @@ -76,8 +76,8 @@ unordered_map& operator=(initializer_list il); // (3) - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1 -- [GCC](/implementation.md#gcc): 4.4.7, 4.5.3, 4.6.3, 4.7.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_map/op_at.md b/reference/unordered_map/unordered_map/op_at.md index a1c7fbebe4..d4d4e79101 100644 --- a/reference/unordered_map/unordered_map/op_at.md +++ b/reference/unordered_map/unordered_map/op_at.md @@ -70,7 +70,7 @@ size=2 - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/unordered_map/unordered_map/op_constructor.md b/reference/unordered_map/unordered_map/op_constructor.md index 460492d9c2..e7bc4911e0 100644 --- a/reference/unordered_map/unordered_map/op_constructor.md +++ b/reference/unordered_map/unordered_map/op_constructor.md @@ -210,8 +210,8 @@ unordered_map(initializer_list il, - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1 -- [GCC](/implementation.md#gcc): 4.4.7, 4.5.3, 4.6.3, 4.7.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_map/op_destructor.md b/reference/unordered_map/unordered_map/op_destructor.md index dbff0043a4..68fcbe72ab 100644 --- a/reference/unordered_map/unordered_map/op_destructor.md +++ b/reference/unordered_map/unordered_map/op_destructor.md @@ -26,8 +26,8 @@ - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++:](/implementation.md#visual_cpp) ? diff --git a/reference/unordered_map/unordered_map/op_equal.md b/reference/unordered_map/unordered_map/op_equal.md index a7b4734fa0..c18ac50c20 100644 --- a/reference/unordered_map/unordered_map/op_equal.md +++ b/reference/unordered_map/unordered_map/op_equal.md @@ -83,7 +83,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/unordered_map/unordered_map/op_not_equal.md b/reference/unordered_map/unordered_map/op_not_equal.md index 1675978af1..f9283c6aba 100644 --- a/reference/unordered_map/unordered_map/op_not_equal.md +++ b/reference/unordered_map/unordered_map/op_not_equal.md @@ -77,7 +77,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/unordered_map/unordered_map/rehash.md b/reference/unordered_map/unordered_map/rehash.md index 8ec9a0e84f..7f3d4a489e 100644 --- a/reference/unordered_map/unordered_map/rehash.md +++ b/reference/unordered_map/unordered_map/rehash.md @@ -103,10 +103,10 @@ new load_factor: 0.363636 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.4.7 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ### 備考 - Clang 3.3 以降は C++17 モードでなくても C++17 の条件でのリハッシュとなっている。 diff --git a/reference/unordered_map/unordered_map/reserve.md b/reference/unordered_map/unordered_map/reserve.md index 620f8ffc5b..464c33c00f 100644 --- a/reference/unordered_map/unordered_map/reserve.md +++ b/reference/unordered_map/unordered_map/reserve.md @@ -105,10 +105,10 @@ new load_factor: 0.363636 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.5.4 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.5.4 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ### 備考 - Clang 3.3 以降は C++17 モードでなくても C++17 の条件でのリハッシュとなっている。 diff --git a/reference/unordered_map/unordered_map/size.md b/reference/unordered_map/unordered_map/size.md index 6920012ecb..bc5cc38f5e 100644 --- a/reference/unordered_map/unordered_map/size.md +++ b/reference/unordered_map/unordered_map/size.md @@ -57,8 +57,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1 -- [GCC](/implementation.md#gcc): 4.4.7, 4.5.3, 4.6.3, 4.7.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_map/swap.md b/reference/unordered_map/unordered_map/swap.md index 5e224ca94c..43bf2a01e3 100644 --- a/reference/unordered_map/unordered_map/swap.md +++ b/reference/unordered_map/unordered_map/swap.md @@ -100,8 +100,8 @@ um2 after : (9th, 9), (7th, 7), (5th, 5), (3rd, 3), (1st, 1), - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.2 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_map/swap_free.md b/reference/unordered_map/unordered_map/swap_free.md index e0be4602f5..135fad75bb 100644 --- a/reference/unordered_map/unordered_map/swap_free.md +++ b/reference/unordered_map/unordered_map/swap_free.md @@ -89,7 +89,7 @@ um2 : {[10,a], [20,b], [30,c], } - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/unordered_map/unordered_map/try_emplace.md b/reference/unordered_map/unordered_map/try_emplace.md index 45e7c5254d..d172d00eb4 100644 --- a/reference/unordered_map/unordered_map/try_emplace.md +++ b/reference/unordered_map/unordered_map/try_emplace.md @@ -119,8 +119,8 @@ key = two, value = 2, is inserted = false, is empty = false ### 処理系 -- [Clang](/implementation.md#clang): 3.7.0 -- [GCC](/implementation.md#gcc): 6.1.0 +- [Clang](/implementation.md#clang): 3.7.0 [mark verified] +- [GCC](/implementation.md#gcc): 6.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/unordered_map/unordered_multimap/begin-size_type.md b/reference/unordered_map/unordered_multimap/begin-size_type.md index bb7872e3cf..1a41447750 100644 --- a/reference/unordered_map/unordered_multimap/begin-size_type.md +++ b/reference/unordered_map/unordered_multimap/begin-size_type.md @@ -83,8 +83,8 @@ bucket = 10, bucket_size = 1, keys = { A, } - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_multimap/begin.md b/reference/unordered_map/unordered_multimap/begin.md index 32991df771..475536af10 100644 --- a/reference/unordered_map/unordered_multimap/begin.md +++ b/reference/unordered_map/unordered_multimap/begin.md @@ -71,8 +71,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.6.4 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.6.4 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_multimap/bucket.md b/reference/unordered_map/unordered_multimap/bucket.md index 6dfc5982e6..ad908cc31d 100644 --- a/reference/unordered_map/unordered_multimap/bucket.md +++ b/reference/unordered_map/unordered_multimap/bucket.md @@ -84,8 +84,8 @@ key = H, bucket = 6, bucket_size = 0 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.2 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++:](/implementation.md#visual_cpp) ? diff --git a/reference/unordered_map/unordered_multimap/bucket_count.md b/reference/unordered_map/unordered_multimap/bucket_count.md index 805cd04830..29ee1ff44f 100644 --- a/reference/unordered_map/unordered_multimap/bucket_count.md +++ b/reference/unordered_map/unordered_multimap/bucket_count.md @@ -56,8 +56,8 @@ bucket count is 11 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.4.7 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_multimap/bucket_size.md b/reference/unordered_map/unordered_multimap/bucket_size.md index a599cc4361..d59bd03e51 100644 --- a/reference/unordered_map/unordered_multimap/bucket_size.md +++ b/reference/unordered_map/unordered_multimap/bucket_size.md @@ -83,8 +83,8 @@ bucket = 10, bucket_size = 1, keys = { A, } - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.2 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++:](/implementation.md#visual_cpp) ? diff --git a/reference/unordered_map/unordered_multimap/cbegin-size_type.md b/reference/unordered_map/unordered_multimap/cbegin-size_type.md index 5ae696f0ab..d1261fae4a 100644 --- a/reference/unordered_map/unordered_multimap/cbegin-size_type.md +++ b/reference/unordered_map/unordered_multimap/cbegin-size_type.md @@ -82,8 +82,8 @@ bucket = 10, bucket_size = 1, keys = { A, } - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_multimap/cbegin.md b/reference/unordered_map/unordered_multimap/cbegin.md index 8716bb5d77..c5cc22b90f 100644 --- a/reference/unordered_map/unordered_multimap/cbegin.md +++ b/reference/unordered_map/unordered_multimap/cbegin.md @@ -62,8 +62,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.6.4 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.6.4 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_multimap/cend-size_type.md b/reference/unordered_map/unordered_multimap/cend-size_type.md index b5795611b0..494ea0ce12 100644 --- a/reference/unordered_map/unordered_multimap/cend-size_type.md +++ b/reference/unordered_map/unordered_multimap/cend-size_type.md @@ -82,8 +82,8 @@ bucket = 10, bucket_size = 1, keys = { A, } - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_multimap/cend.md b/reference/unordered_map/unordered_multimap/cend.md index db2dd05552..4ed55af0fd 100644 --- a/reference/unordered_map/unordered_multimap/cend.md +++ b/reference/unordered_map/unordered_multimap/cend.md @@ -66,8 +66,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.6.4 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.6.4 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_multimap/clear.md b/reference/unordered_map/unordered_multimap/clear.md index 198b94f463..e4d2525812 100644 --- a/reference/unordered_map/unordered_multimap/clear.md +++ b/reference/unordered_map/unordered_multimap/clear.md @@ -66,8 +66,8 @@ true - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_multimap/contains.md b/reference/unordered_map/unordered_multimap/contains.md index 18c5315962..7aea1e1ffe 100644 --- a/reference/unordered_map/unordered_multimap/contains.md +++ b/reference/unordered_map/unordered_multimap/contains.md @@ -75,8 +75,8 @@ contain ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 1 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 1 [mark verified] ## 参照 - [P0458R2 Checking for Existence of an Element in Associative Containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0458r2.html) diff --git a/reference/unordered_map/unordered_multimap/count.md b/reference/unordered_map/unordered_multimap/count.md index 532d65b503..0b3d80ddd6 100644 --- a/reference/unordered_map/unordered_multimap/count.md +++ b/reference/unordered_map/unordered_multimap/count.md @@ -82,7 +82,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/unordered_map/unordered_multimap/emplace.md b/reference/unordered_map/unordered_multimap/emplace.md index eb3cff0d51..3ebd5d241b 100644 --- a/reference/unordered_map/unordered_multimap/emplace.md +++ b/reference/unordered_map/unordered_multimap/emplace.md @@ -118,8 +118,8 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_multimap/emplace_hint.md b/reference/unordered_map/unordered_multimap/emplace_hint.md index ba4ee8aa38..6dd712fe9b 100644 --- a/reference/unordered_map/unordered_multimap/emplace_hint.md +++ b/reference/unordered_map/unordered_multimap/emplace_hint.md @@ -156,8 +156,8 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_multimap/empty.md b/reference/unordered_map/unordered_multimap/empty.md index 2a158c05f1..0b4775a358 100644 --- a/reference/unordered_map/unordered_multimap/empty.md +++ b/reference/unordered_map/unordered_multimap/empty.md @@ -68,8 +68,8 @@ true - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.7.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.3 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_multimap/end-size_type.md b/reference/unordered_map/unordered_multimap/end-size_type.md index 035fed5320..a4c3deb1e5 100644 --- a/reference/unordered_map/unordered_multimap/end-size_type.md +++ b/reference/unordered_map/unordered_multimap/end-size_type.md @@ -83,8 +83,8 @@ bucket = 10, bucket_size = 1, keys = { A, } - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_multimap/end.md b/reference/unordered_map/unordered_multimap/end.md index 416e1810a2..04e9bff607 100644 --- a/reference/unordered_map/unordered_multimap/end.md +++ b/reference/unordered_map/unordered_multimap/end.md @@ -73,8 +73,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.6.4 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.6.4 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_multimap/equal_range.md b/reference/unordered_map/unordered_multimap/equal_range.md index ae0904c154..533f2f3a7b 100644 --- a/reference/unordered_map/unordered_multimap/equal_range.md +++ b/reference/unordered_map/unordered_multimap/equal_range.md @@ -112,7 +112,7 @@ second:1 - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/unordered_map/unordered_multimap/erase.md b/reference/unordered_map/unordered_multimap/erase.md index f062651279..fe33203ee6 100644 --- a/reference/unordered_map/unordered_multimap/erase.md +++ b/reference/unordered_map/unordered_multimap/erase.md @@ -197,8 +197,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_multimap/erase_if_free.md b/reference/unordered_map/unordered_multimap/erase_if_free.md index a3443865a9..1ea5de5d76 100644 --- a/reference/unordered_map/unordered_multimap/erase_if_free.md +++ b/reference/unordered_map/unordered_multimap/erase_if_free.md @@ -77,8 +77,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 9.1 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/unordered_map/unordered_multimap/extract.md b/reference/unordered_map/unordered_multimap/extract.md index 6f91cbfd03..2c4033978e 100644 --- a/reference/unordered_map/unordered_multimap/extract.md +++ b/reference/unordered_map/unordered_multimap/extract.md @@ -83,10 +83,10 @@ m2 : ### 処理系 -- [Clang](/implementation.md#clang): 7.0.0 -- [GCC](/implementation.md#gcc): 7.1.0 +- [Clang](/implementation.md#clang): 7.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 [mark verified] ## 関連項目 diff --git a/reference/unordered_map/unordered_multimap/find.md b/reference/unordered_map/unordered_multimap/find.md index 4ca158824c..d31985692e 100644 --- a/reference/unordered_map/unordered_multimap/find.md +++ b/reference/unordered_map/unordered_multimap/find.md @@ -83,7 +83,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/unordered_map/unordered_multimap/get_allocator.md b/reference/unordered_map/unordered_multimap/get_allocator.md index 6aeaa05ac9..745d784f58 100644 --- a/reference/unordered_map/unordered_multimap/get_allocator.md +++ b/reference/unordered_map/unordered_multimap/get_allocator.md @@ -43,10 +43,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - 2010は、`noexcept`が修飾されていない。 - 2012, 2013は、`noexcept`が実装されていないため、`throw()`が修飾されている。 diff --git a/reference/unordered_map/unordered_multimap/hash_function.md b/reference/unordered_map/unordered_multimap/hash_function.md index ffdf4439b7..6d7e705b25 100644 --- a/reference/unordered_map/unordered_multimap/hash_function.md +++ b/reference/unordered_map/unordered_multimap/hash_function.md @@ -68,8 +68,8 @@ hash("2nd") = 12978775524054262047 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_multimap/insert.md b/reference/unordered_map/unordered_multimap/insert.md index d60870c883..49b058d6ea 100644 --- a/reference/unordered_map/unordered_multimap/insert.md +++ b/reference/unordered_map/unordered_multimap/insert.md @@ -231,8 +231,8 @@ insert initializer_list : (7,7th), (8,8th), (6,6th), (5,5th), (5,five), (4,four) - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_multimap/key_eq.md b/reference/unordered_map/unordered_multimap/key_eq.md index 6f5537999d..0843232d26 100644 --- a/reference/unordered_map/unordered_multimap/key_eq.md +++ b/reference/unordered_map/unordered_multimap/key_eq.md @@ -66,8 +66,8 @@ eq("1st", "2nd") = true - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_multimap/load_factor.md b/reference/unordered_map/unordered_multimap/load_factor.md index 9d06b95e8d..9a41c7905f 100644 --- a/reference/unordered_map/unordered_multimap/load_factor.md +++ b/reference/unordered_map/unordered_multimap/load_factor.md @@ -79,7 +79,7 @@ current load_factor: 0.5 - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/unordered_map/unordered_multimap/max_bucket_count.md b/reference/unordered_map/unordered_multimap/max_bucket_count.md index d078075cb0..ca3bc3d6aa 100644 --- a/reference/unordered_map/unordered_multimap/max_bucket_count.md +++ b/reference/unordered_map/unordered_multimap/max_bucket_count.md @@ -50,8 +50,8 @@ max bucket count is 576460752303423487 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.3.6 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_multimap/max_load_factor.md b/reference/unordered_map/unordered_multimap/max_load_factor.md index 17579c558b..160c947964 100644 --- a/reference/unordered_map/unordered_multimap/max_load_factor.md +++ b/reference/unordered_map/unordered_multimap/max_load_factor.md @@ -132,7 +132,7 @@ new load_factor: 1.125 - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 diff --git a/reference/unordered_map/unordered_multimap/max_size.md b/reference/unordered_map/unordered_multimap/max_size.md index 1d0cd0cf69..8db7d77893 100644 --- a/reference/unordered_map/unordered_multimap/max_size.md +++ b/reference/unordered_map/unordered_multimap/max_size.md @@ -51,8 +51,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.3 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.3 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_multimap/merge.md b/reference/unordered_map/unordered_multimap/merge.md index 3531421bcc..3e57d7b00f 100644 --- a/reference/unordered_map/unordered_multimap/merge.md +++ b/reference/unordered_map/unordered_multimap/merge.md @@ -84,10 +84,10 @@ m2 : - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0.0 -- [GCC](/implementation.md#gcc): 7.1.0 +- [Clang](/implementation.md#clang): 7.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 [mark verified] ## 参照 diff --git a/reference/unordered_map/unordered_multimap/op_assign.md b/reference/unordered_map/unordered_multimap/op_assign.md index dc4d79ae04..0c9c0ee7ec 100644 --- a/reference/unordered_map/unordered_multimap/op_assign.md +++ b/reference/unordered_map/unordered_multimap/op_assign.md @@ -76,8 +76,8 @@ unordered_multimap& operator=(initializer_list il); // (3) - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1 -- [GCC](/implementation.md#gcc): 4.4.7, 4.5.3, 4.6.3, 4.7.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_multimap/op_constructor.md b/reference/unordered_map/unordered_multimap/op_constructor.md index 16246a678a..766900cdfc 100644 --- a/reference/unordered_map/unordered_multimap/op_constructor.md +++ b/reference/unordered_map/unordered_multimap/op_constructor.md @@ -214,8 +214,8 @@ unordered_multimap(initializer_list il, - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1 -- [GCC](/implementation.md#gcc): 4.4.7, 4.5.3, 4.6.3, 4.7.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_multimap/op_destructor.md b/reference/unordered_map/unordered_multimap/op_destructor.md index afae8eca6f..84018747fc 100644 --- a/reference/unordered_map/unordered_multimap/op_destructor.md +++ b/reference/unordered_map/unordered_multimap/op_destructor.md @@ -26,8 +26,8 @@ - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++:](/implementation.md#visual_cpp) ? diff --git a/reference/unordered_map/unordered_multimap/op_equal.md b/reference/unordered_map/unordered_multimap/op_equal.md index ca2d9e828e..379ca8e684 100644 --- a/reference/unordered_map/unordered_multimap/op_equal.md +++ b/reference/unordered_map/unordered_multimap/op_equal.md @@ -87,7 +87,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/unordered_map/unordered_multimap/op_not_equal.md b/reference/unordered_map/unordered_multimap/op_not_equal.md index 73b81dadc9..825509c6b3 100644 --- a/reference/unordered_map/unordered_multimap/op_not_equal.md +++ b/reference/unordered_map/unordered_multimap/op_not_equal.md @@ -88,7 +88,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/unordered_map/unordered_multimap/rehash.md b/reference/unordered_map/unordered_multimap/rehash.md index 466473a035..8db1407938 100644 --- a/reference/unordered_map/unordered_multimap/rehash.md +++ b/reference/unordered_map/unordered_multimap/rehash.md @@ -103,10 +103,10 @@ new load_factor: 0.363636 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.4.7 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ### 備考 - Clang 3.3 以降は C++17 モードでなくても C++17 の条件でのリハッシュとなっている。 diff --git a/reference/unordered_map/unordered_multimap/reserve.md b/reference/unordered_map/unordered_multimap/reserve.md index 31d597e51f..e4c13bac6e 100644 --- a/reference/unordered_map/unordered_multimap/reserve.md +++ b/reference/unordered_map/unordered_multimap/reserve.md @@ -105,10 +105,10 @@ new load_factor: 0.363636 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.5.4 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.5.4 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ### 備考 - Clang 3.3 以降は C++17 モードでなくても C++17 の条件でのリハッシュとなっている。 diff --git a/reference/unordered_map/unordered_multimap/size.md b/reference/unordered_map/unordered_multimap/size.md index a27e4d6e14..40cab4e3b4 100644 --- a/reference/unordered_map/unordered_multimap/size.md +++ b/reference/unordered_map/unordered_multimap/size.md @@ -57,8 +57,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.4.7, 4.5.3, 4.6.3, 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_multimap/swap.md b/reference/unordered_map/unordered_multimap/swap.md index c3818ab85e..46ddbc7216 100644 --- a/reference/unordered_map/unordered_multimap/swap.md +++ b/reference/unordered_map/unordered_multimap/swap.md @@ -100,8 +100,8 @@ um2 after : (7th, 7), (7th, 7), (5th, 5), (5th, 5), (9th, 9), (9th, 9), (3rd, 3) - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.2 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_map/unordered_multimap/swap_free.md b/reference/unordered_map/unordered_multimap/swap_free.md index 808090c546..0b088bdd5f 100644 --- a/reference/unordered_map/unordered_multimap/swap_free.md +++ b/reference/unordered_map/unordered_multimap/swap_free.md @@ -90,7 +90,7 @@ um2 : {[10,a], [20,b], [30,c], [30,d], [30,e], } - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 参照 diff --git a/reference/unordered_set/unordered_multiset/begin-size_type.md b/reference/unordered_set/unordered_multiset/begin-size_type.md index 83f4b251ae..f77ec85370 100644 --- a/reference/unordered_set/unordered_multiset/begin-size_type.md +++ b/reference/unordered_set/unordered_multiset/begin-size_type.md @@ -83,8 +83,8 @@ bucket = 10, bucket_size = 0, keys = { } - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_multiset/begin.md b/reference/unordered_set/unordered_multiset/begin.md index e3ccf2d325..c071882966 100644 --- a/reference/unordered_set/unordered_multiset/begin.md +++ b/reference/unordered_set/unordered_multiset/begin.md @@ -70,8 +70,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1 -- [GCC](/implementation.md#gcc): 4.4.7, 4.5.3, 4.6.3, 4.7.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_multiset/bucket.md b/reference/unordered_set/unordered_multiset/bucket.md index e744de4d78..d970e5566b 100644 --- a/reference/unordered_set/unordered_multiset/bucket.md +++ b/reference/unordered_set/unordered_multiset/bucket.md @@ -83,8 +83,8 @@ key = H, bucket = 3, bucket_size = 0 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.2 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++:](/implementation.md#visual_cpp) ? diff --git a/reference/unordered_set/unordered_multiset/bucket_count.md b/reference/unordered_set/unordered_multiset/bucket_count.md index 242432a794..1622b10f87 100644 --- a/reference/unordered_set/unordered_multiset/bucket_count.md +++ b/reference/unordered_set/unordered_multiset/bucket_count.md @@ -49,8 +49,8 @@ bucket count is 11 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_multiset/bucket_size.md b/reference/unordered_set/unordered_multiset/bucket_size.md index f6b396b88b..9a31becc56 100644 --- a/reference/unordered_set/unordered_multiset/bucket_size.md +++ b/reference/unordered_set/unordered_multiset/bucket_size.md @@ -74,8 +74,8 @@ bucket = 10, bucket_size = 0, keys = { } - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.2 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++:](/implementation.md#visual_cpp) ? diff --git a/reference/unordered_set/unordered_multiset/cbegin-size_type.md b/reference/unordered_set/unordered_multiset/cbegin-size_type.md index 28137ac046..6859d72a6e 100644 --- a/reference/unordered_set/unordered_multiset/cbegin-size_type.md +++ b/reference/unordered_set/unordered_multiset/cbegin-size_type.md @@ -76,8 +76,8 @@ bucket = 10, bucket_size = 0, keys = { } - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_multiset/cbegin.md b/reference/unordered_set/unordered_multiset/cbegin.md index 3c3c92fb7f..e5c62c1553 100644 --- a/reference/unordered_set/unordered_multiset/cbegin.md +++ b/reference/unordered_set/unordered_multiset/cbegin.md @@ -58,8 +58,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1 -- [GCC](/implementation.md#gcc): 4.4.7, 4.5.3, 4.6.3, 4.7.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_multiset/cend-size_type.md b/reference/unordered_set/unordered_multiset/cend-size_type.md index 0966e94d7d..870fb4ab80 100644 --- a/reference/unordered_set/unordered_multiset/cend-size_type.md +++ b/reference/unordered_set/unordered_multiset/cend-size_type.md @@ -76,8 +76,8 @@ bucket = 10, bucket_size = 0, keys = { } - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_multiset/cend.md b/reference/unordered_set/unordered_multiset/cend.md index de6e866661..5c9233d2c8 100644 --- a/reference/unordered_set/unordered_multiset/cend.md +++ b/reference/unordered_set/unordered_multiset/cend.md @@ -58,8 +58,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1 -- [GCC](/implementation.md#gcc): 4.4.7, 4.5.3, 4.6.3, 4.7.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_multiset/clear.md b/reference/unordered_set/unordered_multiset/clear.md index 647dab4483..8ba2f6e249 100644 --- a/reference/unordered_set/unordered_multiset/clear.md +++ b/reference/unordered_set/unordered_multiset/clear.md @@ -66,8 +66,8 @@ true - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_multiset/contains.md b/reference/unordered_set/unordered_multiset/contains.md index 1c76896113..49d00282e4 100644 --- a/reference/unordered_set/unordered_multiset/contains.md +++ b/reference/unordered_set/unordered_multiset/contains.md @@ -73,8 +73,8 @@ contain ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 1 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 1 [mark verified] ## 参照 - [P0458R2 Checking for Existence of an Element in Associative Containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0458r2.html) diff --git a/reference/unordered_set/unordered_multiset/count.md b/reference/unordered_set/unordered_multiset/count.md index 7e85a8f807..84d7aeb983 100644 --- a/reference/unordered_set/unordered_multiset/count.md +++ b/reference/unordered_set/unordered_multiset/count.md @@ -79,8 +79,8 @@ count of 8:0 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_multiset/emplace.md b/reference/unordered_set/unordered_multiset/emplace.md index 5d58a9cd3d..8b0d1a122e 100644 --- a/reference/unordered_set/unordered_multiset/emplace.md +++ b/reference/unordered_set/unordered_multiset/emplace.md @@ -136,8 +136,8 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_multiset/emplace_hint.md b/reference/unordered_set/unordered_multiset/emplace_hint.md index a25c5940a9..3c706b81bf 100644 --- a/reference/unordered_set/unordered_multiset/emplace_hint.md +++ b/reference/unordered_set/unordered_multiset/emplace_hint.md @@ -170,8 +170,8 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_multiset/empty.md b/reference/unordered_set/unordered_multiset/empty.md index 4964890999..55556a578d 100644 --- a/reference/unordered_set/unordered_multiset/empty.md +++ b/reference/unordered_set/unordered_multiset/empty.md @@ -67,8 +67,8 @@ true - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1 -- [GCC](/implementation.md#gcc): 4.4.7, 4.5.3, 4.6.3, 4.7.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_multiset/end-size_type.md b/reference/unordered_set/unordered_multiset/end-size_type.md index 1ba5b08e20..0eb591e854 100644 --- a/reference/unordered_set/unordered_multiset/end-size_type.md +++ b/reference/unordered_set/unordered_multiset/end-size_type.md @@ -83,8 +83,8 @@ bucket = 10, bucket_size = 0, keys = { } - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_multiset/end.md b/reference/unordered_set/unordered_multiset/end.md index 9e4462a51b..b16ed623e5 100644 --- a/reference/unordered_set/unordered_multiset/end.md +++ b/reference/unordered_set/unordered_multiset/end.md @@ -70,8 +70,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1 -- [GCC](/implementation.md#gcc): 4.4.7, 4.5.3, 4.6.3, 4.7.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_multiset/equal_range.md b/reference/unordered_set/unordered_multiset/equal_range.md index c33e8e2675..db8e2b7e98 100644 --- a/reference/unordered_set/unordered_multiset/equal_range.md +++ b/reference/unordered_set/unordered_multiset/equal_range.md @@ -97,8 +97,8 @@ equal_range(8): [10, 10) - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1 -- [GCC](/implementation.md#gcc): 4.4.7, 4.5.3, 4.6.3, 4.7.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_multiset/erase.md b/reference/unordered_set/unordered_multiset/erase.md index 57702ba2a5..3b593a23a0 100644 --- a/reference/unordered_set/unordered_multiset/erase.md +++ b/reference/unordered_set/unordered_multiset/erase.md @@ -183,8 +183,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_multiset/erase_if_free.md b/reference/unordered_set/unordered_multiset/erase_if_free.md index 496e40d04f..10bf147e62 100644 --- a/reference/unordered_set/unordered_multiset/erase_if_free.md +++ b/reference/unordered_set/unordered_multiset/erase_if_free.md @@ -70,8 +70,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 9.1 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/unordered_set/unordered_multiset/extract.md b/reference/unordered_set/unordered_multiset/extract.md index 13dd5676ab..50b21f1e56 100644 --- a/reference/unordered_set/unordered_multiset/extract.md +++ b/reference/unordered_set/unordered_multiset/extract.md @@ -124,10 +124,10 @@ s2 = { 3, 1 } ### 処理系 -- [Clang](/implementation.md#clang): 7.0.0 -- [GCC](/implementation.md#gcc): 7.1.0 +- [Clang](/implementation.md#clang): 7.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 [mark verified] ## 関連項目 diff --git a/reference/unordered_set/unordered_multiset/find.md b/reference/unordered_set/unordered_multiset/find.md index 01503911c1..bc0fefa02a 100644 --- a/reference/unordered_set/unordered_multiset/find.md +++ b/reference/unordered_set/unordered_multiset/find.md @@ -89,8 +89,8 @@ not found - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_multiset/get_allocator.md b/reference/unordered_set/unordered_multiset/get_allocator.md index 87a192d5f5..6a86be685a 100644 --- a/reference/unordered_set/unordered_multiset/get_allocator.md +++ b/reference/unordered_set/unordered_multiset/get_allocator.md @@ -96,10 +96,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1 -- [GCC](/implementation.md#gcc): 4.4.7, 4.5.3, 4.6.3, 4.7.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - 2010は、`noexcept`が修飾されていない。 - 2012, 2013は、`noexcept`が実装されていないため、`throw()`が修飾されている。 diff --git a/reference/unordered_set/unordered_multiset/hash_function.md b/reference/unordered_set/unordered_multiset/hash_function.md index e495ba9576..64a9e4f650 100644 --- a/reference/unordered_set/unordered_multiset/hash_function.md +++ b/reference/unordered_set/unordered_multiset/hash_function.md @@ -63,8 +63,8 @@ hash(2) = 2 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_multiset/insert.md b/reference/unordered_set/unordered_multiset/insert.md index 09d2f8b213..8731400d77 100644 --- a/reference/unordered_set/unordered_multiset/insert.md +++ b/reference/unordered_set/unordered_multiset/insert.md @@ -181,8 +181,8 @@ insert initializer_list : 7 8 6 5 5 5 4 4 3 3 2 2 1 1 0 0 0 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_multiset/key_eq.md b/reference/unordered_set/unordered_multiset/key_eq.md index 36f7e8dac6..dc640d569d 100644 --- a/reference/unordered_set/unordered_multiset/key_eq.md +++ b/reference/unordered_set/unordered_multiset/key_eq.md @@ -61,8 +61,8 @@ eq(1, 1) = true - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_multiset/load_factor.md b/reference/unordered_set/unordered_multiset/load_factor.md index bdc4af3417..5514c82302 100644 --- a/reference/unordered_set/unordered_multiset/load_factor.md +++ b/reference/unordered_set/unordered_multiset/load_factor.md @@ -79,8 +79,8 @@ size is 20, bucket_count is 23, load_factor is 0.869565 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_multiset/max_bucket_count.md b/reference/unordered_set/unordered_multiset/max_bucket_count.md index 8973c886b5..6b1a1eb045 100644 --- a/reference/unordered_set/unordered_multiset/max_bucket_count.md +++ b/reference/unordered_set/unordered_multiset/max_bucket_count.md @@ -49,8 +49,8 @@ max bucket count is 2305843009213693951 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_multiset/max_load_factor.md b/reference/unordered_set/unordered_multiset/max_load_factor.md index b4f1166ad7..437cd640ba 100644 --- a/reference/unordered_set/unordered_multiset/max_load_factor.md +++ b/reference/unordered_set/unordered_multiset/max_load_factor.md @@ -165,8 +165,8 @@ size is 27, bucket_count is 29, load_factor is 0.931035, bucket_count * max_load - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_multiset/max_size.md b/reference/unordered_set/unordered_multiset/max_size.md index e608bfecfc..63210aa913 100644 --- a/reference/unordered_set/unordered_multiset/max_size.md +++ b/reference/unordered_set/unordered_multiset/max_size.md @@ -50,8 +50,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1 -- [GCC](/implementation.md#gcc): 4.4.7, 4.5.3, 4.6.3, 4.7.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_multiset/merge.md b/reference/unordered_set/unordered_multiset/merge.md index efa7a87a8e..2f8258fd48 100644 --- a/reference/unordered_set/unordered_multiset/merge.md +++ b/reference/unordered_set/unordered_multiset/merge.md @@ -77,10 +77,10 @@ s2 = { 10, 10, 20, 30 } - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0.0 -- [GCC](/implementation.md#gcc): 7.1.0 +- [Clang](/implementation.md#clang): 7.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 [mark verified] ## 参照 diff --git a/reference/unordered_set/unordered_multiset/op_assign.md b/reference/unordered_set/unordered_multiset/op_assign.md index 881f7f2686..62ee6e0b7d 100644 --- a/reference/unordered_set/unordered_multiset/op_assign.md +++ b/reference/unordered_set/unordered_multiset/op_assign.md @@ -71,8 +71,8 @@ unordered_multiset& operator=(initializer_list il); // (3) - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1 -- [GCC](/implementation.md#gcc): 4.4.7, 4.5.3, 4.6.3, 4.7.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_multiset/op_constructor.md b/reference/unordered_set/unordered_multiset/op_constructor.md index 45cc197006..e6fe7d5fb4 100644 --- a/reference/unordered_set/unordered_multiset/op_constructor.md +++ b/reference/unordered_set/unordered_multiset/op_constructor.md @@ -215,8 +215,8 @@ unordered_multiset(initializer_list il, - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1 -- [GCC](/implementation.md#gcc): 4.4.7, 4.5.3, 4.6.3, 4.7.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_multiset/op_destructor.md b/reference/unordered_set/unordered_multiset/op_destructor.md index 2402ce88c0..b92b8cc89d 100644 --- a/reference/unordered_set/unordered_multiset/op_destructor.md +++ b/reference/unordered_set/unordered_multiset/op_destructor.md @@ -26,8 +26,8 @@ - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++:](/implementation.md#visual_cpp) ? diff --git a/reference/unordered_set/unordered_multiset/op_equal.md b/reference/unordered_set/unordered_multiset/op_equal.md index 2010735ca1..3a3d2321df 100644 --- a/reference/unordered_set/unordered_multiset/op_equal.md +++ b/reference/unordered_set/unordered_multiset/op_equal.md @@ -93,8 +93,8 @@ ums1 == ums3:true - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1 -- [GCC](/implementation.md#gcc): 4.4.7, 4.5.3, 4.6.3, 4.7.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_multiset/op_not_equal.md b/reference/unordered_set/unordered_multiset/op_not_equal.md index b093299eae..1e89a57ba2 100644 --- a/reference/unordered_set/unordered_multiset/op_not_equal.md +++ b/reference/unordered_set/unordered_multiset/op_not_equal.md @@ -94,8 +94,8 @@ ums1 != ums3:false - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1 -- [GCC](/implementation.md#gcc): 4.4.7, 4.5.3, 4.6.3, 4.7.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_multiset/rehash.md b/reference/unordered_set/unordered_multiset/rehash.md index b6b84bed8b..354edf18b8 100644 --- a/reference/unordered_set/unordered_multiset/rehash.md +++ b/reference/unordered_set/unordered_multiset/rehash.md @@ -84,8 +84,8 @@ bucket_count is 13 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_multiset/reserve.md b/reference/unordered_set/unordered_multiset/reserve.md index e96a671000..14596455a0 100644 --- a/reference/unordered_set/unordered_multiset/reserve.md +++ b/reference/unordered_set/unordered_multiset/reserve.md @@ -87,8 +87,8 @@ bucket_count is 13 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_multiset/size.md b/reference/unordered_set/unordered_multiset/size.md index 0c39d0e71c..64391771c4 100644 --- a/reference/unordered_set/unordered_multiset/size.md +++ b/reference/unordered_set/unordered_multiset/size.md @@ -56,8 +56,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1 -- [GCC](/implementation.md#gcc): 4.4.7, 4.5.3, 4.6.3, 4.7.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_multiset/swap.md b/reference/unordered_set/unordered_multiset/swap.md index 1614879a45..0c9207ab90 100644 --- a/reference/unordered_set/unordered_multiset/swap.md +++ b/reference/unordered_set/unordered_multiset/swap.md @@ -97,8 +97,8 @@ ums2 after : 9 9 7 7 5 5 1 1 3 3 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.2 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_multiset/swap_free.md b/reference/unordered_set/unordered_multiset/swap_free.md index be449c50b4..9394b34181 100644 --- a/reference/unordered_set/unordered_multiset/swap_free.md +++ b/reference/unordered_set/unordered_multiset/swap_free.md @@ -76,8 +76,8 @@ ums2 after:3, 3, 2, 2, 1, 1, - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_set/begin-size_type.md b/reference/unordered_set/unordered_set/begin-size_type.md index ae34f0e20a..2076654602 100644 --- a/reference/unordered_set/unordered_set/begin-size_type.md +++ b/reference/unordered_set/unordered_set/begin-size_type.md @@ -77,8 +77,8 @@ bucket = 4, bucket_size = 2, keys = { C, B, } - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_set/begin.md b/reference/unordered_set/unordered_set/begin.md index f09cf33cb2..672b8f4934 100644 --- a/reference/unordered_set/unordered_set/begin.md +++ b/reference/unordered_set/unordered_set/begin.md @@ -71,8 +71,8 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1 -- [GCC](/implementation.md#gcc): 4.4.7, 4.5.3, 4.6.3, 4.7.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_set/bucket.md b/reference/unordered_set/unordered_set/bucket.md index 78903cdc72..c8c990ed47 100644 --- a/reference/unordered_set/unordered_set/bucket.md +++ b/reference/unordered_set/unordered_set/bucket.md @@ -78,8 +78,8 @@ key = H, bucket = 2, bucket_size = 0 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.2 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++:](/implementation.md#visual_cpp) ? diff --git a/reference/unordered_set/unordered_set/bucket_count.md b/reference/unordered_set/unordered_set/bucket_count.md index b2e6dc1a77..c496ef7855 100644 --- a/reference/unordered_set/unordered_set/bucket_count.md +++ b/reference/unordered_set/unordered_set/bucket_count.md @@ -49,8 +49,8 @@ bucket count is 5 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_set/bucket_size.md b/reference/unordered_set/unordered_set/bucket_size.md index 2107abf841..31bf37f81c 100644 --- a/reference/unordered_set/unordered_set/bucket_size.md +++ b/reference/unordered_set/unordered_set/bucket_size.md @@ -68,8 +68,8 @@ bucket = 4, bucket_size = 2, keys = { C, B, } - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.2 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++:](/implementation.md#visual_cpp) ? diff --git a/reference/unordered_set/unordered_set/cbegin-size_type.md b/reference/unordered_set/unordered_set/cbegin-size_type.md index 0c10a67183..2ad2f5744d 100644 --- a/reference/unordered_set/unordered_set/cbegin-size_type.md +++ b/reference/unordered_set/unordered_set/cbegin-size_type.md @@ -70,8 +70,8 @@ bucket = 4, bucket_size = 2, keys = { C, B, } - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_set/cbegin.md b/reference/unordered_set/unordered_set/cbegin.md index a6b323cd9c..b349917783 100644 --- a/reference/unordered_set/unordered_set/cbegin.md +++ b/reference/unordered_set/unordered_set/cbegin.md @@ -58,8 +58,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1 -- [GCC](/implementation.md#gcc): 4.4.7, 4.5.3, 4.6.3, 4.7.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_set/cend-size_type.md b/reference/unordered_set/unordered_set/cend-size_type.md index 5920f31557..6971498d1c 100644 --- a/reference/unordered_set/unordered_set/cend-size_type.md +++ b/reference/unordered_set/unordered_set/cend-size_type.md @@ -70,8 +70,8 @@ bucket = 4, bucket_size = 2, keys = { C, B, } - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_set/cend.md b/reference/unordered_set/unordered_set/cend.md index f71ca590a0..8e48fcc5cd 100644 --- a/reference/unordered_set/unordered_set/cend.md +++ b/reference/unordered_set/unordered_set/cend.md @@ -58,8 +58,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1 -- [GCC](/implementation.md#gcc): 4.4.7, 4.5.3, 4.6.3, 4.7.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_set/clear.md b/reference/unordered_set/unordered_set/clear.md index cfd28cded6..e54f8a9f44 100644 --- a/reference/unordered_set/unordered_set/clear.md +++ b/reference/unordered_set/unordered_set/clear.md @@ -66,8 +66,8 @@ true - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_set/contains.md b/reference/unordered_set/unordered_set/contains.md index d79dc3f4a7..27b783ab89 100644 --- a/reference/unordered_set/unordered_set/contains.md +++ b/reference/unordered_set/unordered_set/contains.md @@ -71,8 +71,8 @@ contain ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 9.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 1 +- [GCC](/implementation.md#gcc): 9.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 1 [mark verified] ## 参照 - [P0458R2 Checking for Existence of an Element in Associative Containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0458r2.html) diff --git a/reference/unordered_set/unordered_set/count.md b/reference/unordered_set/unordered_set/count.md index 925ac8195c..5374612fde 100644 --- a/reference/unordered_set/unordered_set/count.md +++ b/reference/unordered_set/unordered_set/count.md @@ -79,8 +79,8 @@ count of 8:0 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_set/emplace.md b/reference/unordered_set/unordered_set/emplace.md index aa9d04b14c..029f90af4c 100644 --- a/reference/unordered_set/unordered_set/emplace.md +++ b/reference/unordered_set/unordered_set/emplace.md @@ -151,8 +151,8 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_set/emplace_hint.md b/reference/unordered_set/unordered_set/emplace_hint.md index 1d53455abd..ed32ac3ffb 100644 --- a/reference/unordered_set/unordered_set/emplace_hint.md +++ b/reference/unordered_set/unordered_set/emplace_hint.md @@ -147,8 +147,8 @@ int main() ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_set/empty.md b/reference/unordered_set/unordered_set/empty.md index ae49a91ef1..a3281777d1 100644 --- a/reference/unordered_set/unordered_set/empty.md +++ b/reference/unordered_set/unordered_set/empty.md @@ -67,8 +67,8 @@ true - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1 -- [GCC](/implementation.md#gcc): 4.4.7, 4.5.3, 4.6.3, 4.7.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_set/end-size_type.md b/reference/unordered_set/unordered_set/end-size_type.md index 8e3b13568d..0b2d98e0a9 100644 --- a/reference/unordered_set/unordered_set/end-size_type.md +++ b/reference/unordered_set/unordered_set/end-size_type.md @@ -77,8 +77,8 @@ bucket = 4, bucket_size = 2, keys = { C, B, } - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_set/end.md b/reference/unordered_set/unordered_set/end.md index 7080032f72..5d5de06c5c 100644 --- a/reference/unordered_set/unordered_set/end.md +++ b/reference/unordered_set/unordered_set/end.md @@ -70,8 +70,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1 -- [GCC](/implementation.md#gcc): 4.4.7, 4.5.3, 4.6.3, 4.7.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_set/equal_range.md b/reference/unordered_set/unordered_set/equal_range.md index 320ed107f9..60c1abf6fc 100644 --- a/reference/unordered_set/unordered_set/equal_range.md +++ b/reference/unordered_set/unordered_set/equal_range.md @@ -99,8 +99,8 @@ equal_range(8): [5, 5) - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1 -- [GCC](/implementation.md#gcc): 4.4.7, 4.5.3, 4.6.3, 4.7.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_set/erase.md b/reference/unordered_set/unordered_set/erase.md index ed87777ada..29788a14d1 100644 --- a/reference/unordered_set/unordered_set/erase.md +++ b/reference/unordered_set/unordered_set/erase.md @@ -182,8 +182,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_set/erase_if_free.md b/reference/unordered_set/unordered_set/erase_if_free.md index 7d248e1d3c..01b6b4eb29 100644 --- a/reference/unordered_set/unordered_set/erase_if_free.md +++ b/reference/unordered_set/unordered_set/erase_if_free.md @@ -70,8 +70,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 9.1 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/unordered_set/unordered_set/extract.md b/reference/unordered_set/unordered_set/extract.md index d123a2fbad..7e902f5367 100644 --- a/reference/unordered_set/unordered_set/extract.md +++ b/reference/unordered_set/unordered_set/extract.md @@ -124,10 +124,10 @@ s2 = { 3, 2 } ### 処理系 -- [Clang](/implementation.md#clang): 7.0.0 -- [GCC](/implementation.md#gcc): 7.1.0 +- [Clang](/implementation.md#clang): 7.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 [mark verified] ## 関連項目 diff --git a/reference/unordered_set/unordered_set/find.md b/reference/unordered_set/unordered_set/find.md index 3d80342a5a..51fd19ffc8 100644 --- a/reference/unordered_set/unordered_set/find.md +++ b/reference/unordered_set/unordered_set/find.md @@ -86,8 +86,8 @@ not found - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_set/get_allocator.md b/reference/unordered_set/unordered_set/get_allocator.md index a68d731d97..36991575dc 100644 --- a/reference/unordered_set/unordered_set/get_allocator.md +++ b/reference/unordered_set/unordered_set/get_allocator.md @@ -96,10 +96,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1 -- [GCC](/implementation.md#gcc): 4.4.7, 4.5.3, 4.6.3, 4.7.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - 2010は、`noexcept`が修飾されていない。 - 2012, 2013は、`noexcept`が実装されていないため、`throw()`が修飾されている。 diff --git a/reference/unordered_set/unordered_set/hash_function.md b/reference/unordered_set/unordered_set/hash_function.md index 901ddd7c52..a6b5bbf089 100644 --- a/reference/unordered_set/unordered_set/hash_function.md +++ b/reference/unordered_set/unordered_set/hash_function.md @@ -63,8 +63,8 @@ hash(2) = 2 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_set/insert.md b/reference/unordered_set/unordered_set/insert.md index 525f2a215b..e6779f65ad 100644 --- a/reference/unordered_set/unordered_set/insert.md +++ b/reference/unordered_set/unordered_set/insert.md @@ -197,8 +197,8 @@ insert initializer_list : 7 8 6 5 4 3 2 1 0 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_set/key_eq.md b/reference/unordered_set/unordered_set/key_eq.md index 0201175b10..8be0bf7fee 100644 --- a/reference/unordered_set/unordered_set/key_eq.md +++ b/reference/unordered_set/unordered_set/key_eq.md @@ -61,8 +61,8 @@ eq(1, 1) = true - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_set/load_factor.md b/reference/unordered_set/unordered_set/load_factor.md index e87b23785c..7e755e4aae 100644 --- a/reference/unordered_set/unordered_set/load_factor.md +++ b/reference/unordered_set/unordered_set/load_factor.md @@ -79,8 +79,8 @@ size is 10, bucket_count is 11, load_factor is 0.909091 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_set/max_bucket_count.md b/reference/unordered_set/unordered_set/max_bucket_count.md index 1ea83f048b..ce2f112476 100644 --- a/reference/unordered_set/unordered_set/max_bucket_count.md +++ b/reference/unordered_set/unordered_set/max_bucket_count.md @@ -49,8 +49,8 @@ max bucket count is 2305843009213693951 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_set/max_load_factor.md b/reference/unordered_set/unordered_set/max_load_factor.md index af775465f6..d222f45d88 100644 --- a/reference/unordered_set/unordered_set/max_load_factor.md +++ b/reference/unordered_set/unordered_set/max_load_factor.md @@ -165,8 +165,8 @@ size is 27, bucket_count is 29, load_factor is 0.931035, bucket_count * max_load - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_set/max_size.md b/reference/unordered_set/unordered_set/max_size.md index 8d9ff39295..769203e9e1 100644 --- a/reference/unordered_set/unordered_set/max_size.md +++ b/reference/unordered_set/unordered_set/max_size.md @@ -50,8 +50,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1 -- [GCC](/implementation.md#gcc): 4.4.7, 4.5.3, 4.6.3, 4.7.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_set/merge.md b/reference/unordered_set/unordered_set/merge.md index bb27064403..4ec3484c90 100644 --- a/reference/unordered_set/unordered_set/merge.md +++ b/reference/unordered_set/unordered_set/merge.md @@ -78,10 +78,10 @@ s2 = { 20, 30, 10 } - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0.0 -- [GCC](/implementation.md#gcc): 7.1.0 +- [Clang](/implementation.md#clang): 7.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 +- [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 [mark verified] ## 参照 diff --git a/reference/unordered_set/unordered_set/op_assign.md b/reference/unordered_set/unordered_set/op_assign.md index ab7b61faaa..aa5b94719c 100644 --- a/reference/unordered_set/unordered_set/op_assign.md +++ b/reference/unordered_set/unordered_set/op_assign.md @@ -71,8 +71,8 @@ unordered_set& operator=(initializer_list il); // (3) - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1 -- [GCC](/implementation.md#gcc): 4.4.7, 4.5.3, 4.6.3, 4.7.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_set/op_constructor.md b/reference/unordered_set/unordered_set/op_constructor.md index 35b256e33a..83ceb4e1ed 100644 --- a/reference/unordered_set/unordered_set/op_constructor.md +++ b/reference/unordered_set/unordered_set/op_constructor.md @@ -215,8 +215,8 @@ unordered_set(initializer_list il, - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1 -- [GCC](/implementation.md#gcc): 4.4.7, 4.5.3, 4.6.3, 4.7.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_set/op_destructor.md b/reference/unordered_set/unordered_set/op_destructor.md index 1be833102a..6865246bef 100644 --- a/reference/unordered_set/unordered_set/op_destructor.md +++ b/reference/unordered_set/unordered_set/op_destructor.md @@ -26,8 +26,8 @@ - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++:](/implementation.md#visual_cpp) ? diff --git a/reference/unordered_set/unordered_set/op_equal.md b/reference/unordered_set/unordered_set/op_equal.md index f121d9ecf8..2e2da83c7e 100644 --- a/reference/unordered_set/unordered_set/op_equal.md +++ b/reference/unordered_set/unordered_set/op_equal.md @@ -90,8 +90,8 @@ us1 == us3:true - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1 -- [GCC](/implementation.md#gcc): 4.4.7, 4.5.3, 4.6.3, 4.7.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_set/op_not_equal.md b/reference/unordered_set/unordered_set/op_not_equal.md index 647d311988..72f12373d1 100644 --- a/reference/unordered_set/unordered_set/op_not_equal.md +++ b/reference/unordered_set/unordered_set/op_not_equal.md @@ -92,8 +92,8 @@ us1 != us3:false - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1 -- [GCC](/implementation.md#gcc): 4.4.7, 4.5.3, 4.6.3, 4.7.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_set/rehash.md b/reference/unordered_set/unordered_set/rehash.md index ebdc09d172..cbcb5d2724 100644 --- a/reference/unordered_set/unordered_set/rehash.md +++ b/reference/unordered_set/unordered_set/rehash.md @@ -84,8 +84,8 @@ bucket_count is 7 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_set/reserve.md b/reference/unordered_set/unordered_set/reserve.md index 86e0ea1580..776c83ea35 100644 --- a/reference/unordered_set/unordered_set/reserve.md +++ b/reference/unordered_set/unordered_set/reserve.md @@ -87,8 +87,8 @@ bucket_count is 7 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_set/size.md b/reference/unordered_set/unordered_set/size.md index 5a7f9948b3..34403bc927 100644 --- a/reference/unordered_set/unordered_set/size.md +++ b/reference/unordered_set/unordered_set/size.md @@ -56,8 +56,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0, 3.1 -- [GCC](/implementation.md#gcc): 4.4.7, 4.5.3, 4.6.3, 4.7.0 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_set/swap.md b/reference/unordered_set/unordered_set/swap.md index ad65fac7b1..d0923a2c16 100644 --- a/reference/unordered_set/unordered_set/swap.md +++ b/reference/unordered_set/unordered_set/swap.md @@ -97,8 +97,8 @@ us2 after : 9 7 5 3 1 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.2 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/unordered_set/unordered_set/swap_free.md b/reference/unordered_set/unordered_set/swap_free.md index e956475467..708773b280 100644 --- a/reference/unordered_set/unordered_set/swap_free.md +++ b/reference/unordered_set/unordered_set/swap_free.md @@ -76,8 +76,8 @@ us2 after:3, 2, 1, - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.1 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? diff --git a/reference/utility/as_const.md b/reference/utility/as_const.md index f584b276e3..bacf0fbed7 100644 --- a/reference/utility/as_const.md +++ b/reference/utility/as_const.md @@ -68,10 +68,10 @@ const - C++17 ## 処理系 -- [Clang](/implementation.md#clang): 3.8 -- [GCC](/implementation.md#gcc): 7.1 +- [Clang](/implementation.md#clang): 3.8 [mark verified] +- [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 Update 2 +- [Visual C++](/implementation.md#visual_cpp): 2015 Update 2 [mark verified] ## 参照 diff --git a/reference/utility/cmp_equal.md b/reference/utility/cmp_equal.md index a0ab1b9cd7..196ee97f70 100644 --- a/reference/utility/cmp_equal.md +++ b/reference/utility/cmp_equal.md @@ -88,8 +88,8 @@ true ## 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 7 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 7 [mark verified] ## 参照 diff --git a/reference/utility/cmp_greater.md b/reference/utility/cmp_greater.md index 4704f132b7..57a08c4f1e 100644 --- a/reference/utility/cmp_greater.md +++ b/reference/utility/cmp_greater.md @@ -80,8 +80,8 @@ true ## 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 7 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 7 [mark verified] ## 参照 diff --git a/reference/utility/cmp_greater_equal.md b/reference/utility/cmp_greater_equal.md index 9013db2a8a..85aa6c9896 100644 --- a/reference/utility/cmp_greater_equal.md +++ b/reference/utility/cmp_greater_equal.md @@ -80,8 +80,8 @@ true ## 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 7 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 7 [mark verified] ## 参照 diff --git a/reference/utility/cmp_less.md b/reference/utility/cmp_less.md index 3049c2f6be..911652985e 100644 --- a/reference/utility/cmp_less.md +++ b/reference/utility/cmp_less.md @@ -87,8 +87,8 @@ true ## 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 7 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 7 [mark verified] ## 関連項目 diff --git a/reference/utility/cmp_less_equal.md b/reference/utility/cmp_less_equal.md index 1caa8cd4fc..85ab986627 100644 --- a/reference/utility/cmp_less_equal.md +++ b/reference/utility/cmp_less_equal.md @@ -79,8 +79,8 @@ true ## 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 7 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 7 [mark verified] ## 参照 diff --git a/reference/utility/cmp_not_equal.md b/reference/utility/cmp_not_equal.md index 5a6ca57548..a1167c21ed 100644 --- a/reference/utility/cmp_not_equal.md +++ b/reference/utility/cmp_not_equal.md @@ -76,8 +76,8 @@ true ## 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 7 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 7 [mark verified] ## 参照 diff --git a/reference/utility/declval.md b/reference/utility/declval.md index cac152ae15..1422a7519c 100644 --- a/reference/utility/declval.md +++ b/reference/utility/declval.md @@ -81,9 +81,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/utility/exchange.md b/reference/utility/exchange.md index 8736609591..0cb767a2ca 100644 --- a/reference/utility/exchange.md +++ b/reference/utility/exchange.md @@ -199,10 +199,10 @@ Hello 0x7ffc560ca4cc - C++14 ### 処理系 -- [GCC](/implementation.md#gcc): 4.9.0 -- [Clang](/implementation.md#clang): 3.4 +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified] +- [Clang](/implementation.md#clang): 3.4 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] ## 関連項目 diff --git a/reference/utility/forward.md b/reference/utility/forward.md index 45ddedf201..e5d0c95eae 100644 --- a/reference/utility/forward.md +++ b/reference/utility/forward.md @@ -107,9 +107,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/utility/forward_like.md b/reference/utility/forward_like.md index 04ad4e233e..0566ae3edd 100644 --- a/reference/utility/forward_like.md +++ b/reference/utility/forward_like.md @@ -127,10 +127,10 @@ template - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 16.0.0 +- [Clang](/implementation.md#clang): 16.0.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2022 17.4 +- [Visual C++](/implementation.md#visual_cpp): 2022 17.4 [mark verified] ## 参照 diff --git a/reference/utility/in_place_index_t.md b/reference/utility/in_place_index_t.md index 2eb70bd6a0..450d23a688 100644 --- a/reference/utility/in_place_index_t.md +++ b/reference/utility/in_place_index_t.md @@ -55,8 +55,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.0 -- [GCC](/implementation.md#gcc): 7.1.0 +- [Clang](/implementation.md#clang): 4.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/utility/in_place_t.md b/reference/utility/in_place_t.md index 7feeaaf0c9..f54333aa2a 100644 --- a/reference/utility/in_place_t.md +++ b/reference/utility/in_place_t.md @@ -52,8 +52,8 @@ AAA - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.2 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/utility/in_place_type_t.md b/reference/utility/in_place_type_t.md index db6e1a71ac..e7d773a088 100644 --- a/reference/utility/in_place_type_t.md +++ b/reference/utility/in_place_type_t.md @@ -57,8 +57,8 @@ zzz - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/utility/in_range.md b/reference/utility/in_range.md index 96638e1d0d..188b816357 100644 --- a/reference/utility/in_range.md +++ b/reference/utility/in_range.md @@ -73,8 +73,8 @@ int main() { ## 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10.1 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 7 +- [GCC](/implementation.md#gcc): 10.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 7 [mark verified] ## 参照 diff --git a/reference/utility/index_sequence.md b/reference/utility/index_sequence.md index 7de93bbe60..6054eb354a 100644 --- a/reference/utility/index_sequence.md +++ b/reference/utility/index_sequence.md @@ -50,10 +50,10 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.4 -- [GCC](/implementation.md#gcc): 4.9.0 +- [Clang](/implementation.md#clang): 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] ### 備考 - GCC 4.9.2で、`std::index_sequence`を関数のパラメータとして受け取るとコンパイルエラーになる問題があった([Bug 65790](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65790))。GCC 5.2.0で修正された。 diff --git a/reference/utility/index_sequence_for.md b/reference/utility/index_sequence_for.md index 8f1a909400..f8ff872e33 100644 --- a/reference/utility/index_sequence_for.md +++ b/reference/utility/index_sequence_for.md @@ -66,10 +66,10 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.4 -- [GCC](/implementation.md#gcc): 4.9.0 +- [Clang](/implementation.md#clang): 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] ## 参照 diff --git a/reference/utility/integer_sequence.md b/reference/utility/integer_sequence.md index 59d76c4856..956178f389 100644 --- a/reference/utility/integer_sequence.md +++ b/reference/utility/integer_sequence.md @@ -54,10 +54,10 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.4 -- [GCC](/implementation.md#gcc): 4.9.0 +- [Clang](/implementation.md#clang): 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] ## 参照 - [N3658 Compile-time integer sequences](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3658.html) diff --git a/reference/utility/make_index_sequence.md b/reference/utility/make_index_sequence.md index c69d7a8db7..c0d5fe789e 100644 --- a/reference/utility/make_index_sequence.md +++ b/reference/utility/make_index_sequence.md @@ -57,10 +57,10 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.4 -- [GCC](/implementation.md#gcc): 4.9.0 +- [Clang](/implementation.md#clang): 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] ## 参照 diff --git a/reference/utility/make_integer_sequence.md b/reference/utility/make_integer_sequence.md index ef52b5ad39..f00c147619 100644 --- a/reference/utility/make_integer_sequence.md +++ b/reference/utility/make_integer_sequence.md @@ -61,10 +61,10 @@ int main() - C++14 ### 処理系 -- [Clang](/implementation.md#clang): 3.4 -- [GCC](/implementation.md#gcc): 4.9.0 +- [Clang](/implementation.md#clang): 3.4 [mark verified] +- [GCC](/implementation.md#gcc): 4.9.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2015 +- [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] ## 参照 diff --git a/reference/utility/move.md b/reference/utility/move.md index 129a1aa3da..ade880c939 100644 --- a/reference/utility/move.md +++ b/reference/utility/move.md @@ -77,9 +77,9 @@ move ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/utility/move_if_noexcept.md b/reference/utility/move_if_noexcept.md index 43d53b3d74..7bacc63f15 100644 --- a/reference/utility/move_if_noexcept.md +++ b/reference/utility/move_if_noexcept.md @@ -89,9 +89,9 @@ copy ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012は正しく実装されていないと思われる。上記「例」のコードにおいて、ともにmoveしてしまう結果となる。 diff --git a/reference/utility/pair/common_type.md b/reference/utility/pair/common_type.md index eb41b66900..7257a45516 100644 --- a/reference/utility/pair/common_type.md +++ b/reference/utility/pair/common_type.md @@ -34,9 +34,9 @@ namespace std { - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.6.1 -- [Visual C++](/implementation.md#visual_cpp): 2012 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] ## 関連項目 - [common_type](/reference/type_traits/common_type.md) diff --git a/reference/utility/pair/get.md b/reference/utility/pair/get.md index 8cae587644..370594d113 100644 --- a/reference/utility/pair/get.md +++ b/reference/utility/pair/get.md @@ -139,9 +139,9 @@ a ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 関連項目 diff --git a/reference/utility/pair/op_assign.md b/reference/utility/pair/op_assign.md index 3e48d1d6cd..abd960fab0 100644 --- a/reference/utility/pair/op_assign.md +++ b/reference/utility/pair/op_assign.md @@ -152,9 +152,9 @@ p4 : (1,abc) ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - (1), (3)はそれより前から実装されている。 ## 参照 diff --git a/reference/utility/pair/op_constructor.md b/reference/utility/pair/op_constructor.md index c0eedfa560..1d5f1127e0 100644 --- a/reference/utility/pair/op_constructor.md +++ b/reference/utility/pair/op_constructor.md @@ -280,9 +280,9 @@ p8 : (X(1 2 3),Y(4 5)) ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - C++03で規定されていたものは、2010より前のバージョンから実装されている。 - 2010までは、(11) `std::piecewise_construct`版が実装されていない。 - 2013までは、デフォルトコンストラクタに`constexpr`が付与されていない。 diff --git a/reference/utility/pair/op_deduction_guide.md b/reference/utility/pair/op_deduction_guide.md index 2ab369075d..056bf76595 100644 --- a/reference/utility/pair/op_deduction_guide.md +++ b/reference/utility/pair/op_deduction_guide.md @@ -46,7 +46,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 7.1.0 +- [GCC](/implementation.md#gcc): 7.1.0 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/utility/pair/tuple_element.md b/reference/utility/pair/tuple_element.md index 4727718d4c..ce9d689681 100644 --- a/reference/utility/pair/tuple_element.md +++ b/reference/utility/pair/tuple_element.md @@ -58,9 +58,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 - [`tuple_element - `](/reference/tuple/tuple_element.md) diff --git a/reference/utility/pair/tuple_size.md b/reference/utility/pair/tuple_size.md index d12becee4e..590f3bca89 100644 --- a/reference/utility/pair/tuple_size.md +++ b/reference/utility/pair/tuple_size.md @@ -50,9 +50,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1), 2010, 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 - [LWG Issue 2313. `tuple_size` should always derive from `integral_constant`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2313) diff --git a/reference/utility/piecewise_construct_t.md b/reference/utility/piecewise_construct_t.md index c02f0773fb..cc7f347921 100644 --- a/reference/utility/piecewise_construct_t.md +++ b/reference/utility/piecewise_construct_t.md @@ -61,9 +61,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 diff --git a/reference/utility/swap.md b/reference/utility/swap.md index f7c647251c..df1b79acad 100644 --- a/reference/utility/swap.md +++ b/reference/utility/swap.md @@ -149,9 +149,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2012, 2013, 2015 +- [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 値版はそれより前から実装されている。 ## 関連項目 diff --git a/reference/utility/to_underlying.md b/reference/utility/to_underlying.md index 1dc8a047ba..3802c063b6 100644 --- a/reference/utility/to_underlying.md +++ b/reference/utility/to_underlying.md @@ -59,8 +59,8 @@ int main() { - C++23 ### 処理系 -- [GCC](/implementation.md#gcc): 11.1 -- [Clang](/implementation.md#clang): 13.0 +- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [Clang](/implementation.md#clang): 13.0 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 diff --git a/reference/utility/unreachable.md b/reference/utility/unreachable.md index 90ea2d7759..4ccd0cd6fa 100644 --- a/reference/utility/unreachable.md +++ b/reference/utility/unreachable.md @@ -63,8 +63,8 @@ int main() - C++23 ### 処理系 -- [Clang](/implementation.md#clang): 15.0 -- [GCC](/implementation.md#gcc): 12.1 +- [Clang](/implementation.md#clang): 15.0 [mark verified] +- [GCC](/implementation.md#gcc): 12.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/valarray/slice/op_equal.md b/reference/valarray/slice/op_equal.md index d6c48e0052..6a3e79beaf 100644 --- a/reference/valarray/slice/op_equal.md +++ b/reference/valarray/slice/op_equal.md @@ -56,7 +56,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10 +- [GCC](/implementation.md#gcc): 10 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/valarray/valarray/begin_free.md b/reference/valarray/valarray/begin_free.md index 3167dc01f5..4460703dd0 100644 --- a/reference/valarray/valarray/begin_free.md +++ b/reference/valarray/valarray/begin_free.md @@ -77,8 +77,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.6.4 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.6.4 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/valarray/valarray/end_free.md b/reference/valarray/valarray/end_free.md index f2d48fef89..c233825323 100644 --- a/reference/valarray/valarray/end_free.md +++ b/reference/valarray/valarray/end_free.md @@ -77,8 +77,8 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.6.4 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.6.4 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/valarray/valarray/op_deduction_guide.md b/reference/valarray/valarray/op_deduction_guide.md index fa999feddf..73a485edc9 100644 --- a/reference/valarray/valarray/op_deduction_guide.md +++ b/reference/valarray/valarray/op_deduction_guide.md @@ -52,7 +52,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/valarray/valarray/swap.md b/reference/valarray/valarray/swap.md index 2fe2dba5f1..2b4a8ca2e7 100644 --- a/reference/valarray/valarray/swap.md +++ b/reference/valarray/valarray/swap.md @@ -69,8 +69,8 @@ b : {1,2,3} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.7.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/valarray/valarray/swap_free.md b/reference/valarray/valarray/swap_free.md index f7ad54f8de..c998b7aec0 100644 --- a/reference/valarray/valarray/swap_free.md +++ b/reference/valarray/valarray/swap_free.md @@ -71,8 +71,8 @@ b : {1,2,3} - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.0 -- [GCC](/implementation.md#gcc): 4.7.3 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/variant/bad_variant_access.md b/reference/variant/bad_variant_access.md index a73d4d4a6e..a406e44207 100644 --- a/reference/variant/bad_variant_access.md +++ b/reference/variant/bad_variant_access.md @@ -65,6 +65,6 @@ error : Unexpected index - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/variant/holds_alternative.md b/reference/variant/holds_alternative.md index 6d67d1fab2..f4a1776257 100644 --- a/reference/variant/holds_alternative.md +++ b/reference/variant/holds_alternative.md @@ -54,7 +54,7 @@ vはint型を現在保持していない - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/variant/monostate.md b/reference/variant/monostate.md index 911a626761..5b34cbd903 100644 --- a/reference/variant/monostate.md +++ b/reference/variant/monostate.md @@ -80,8 +80,8 @@ empty - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.3 -- [GCC](/implementation.md#gcc): 4.0 +- [Clang](/implementation.md#clang): 7.3 [mark verified] +- [GCC](/implementation.md#gcc): 4.0 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/variant/variant.md b/reference/variant/variant.md index fb0dae86ab..9b61abcbba 100644 --- a/reference/variant/variant.md +++ b/reference/variant/variant.md @@ -185,8 +185,8 @@ Hello - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/variant/variant/emplace.md b/reference/variant/variant/emplace.md index 53483df850..0924c70bc5 100644 --- a/reference/variant/variant/emplace.md +++ b/reference/variant/variant/emplace.md @@ -184,8 +184,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 diff --git a/reference/variant/variant/get.md b/reference/variant/variant/get.md index a9247aa6c7..8429c36bf7 100644 --- a/reference/variant/variant/get.md +++ b/reference/variant/variant/get.md @@ -207,8 +207,8 @@ int main() { - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/variant/variant/get_if.md b/reference/variant/variant/get_if.md index 8b3ef6e496..9606f74944 100644 --- a/reference/variant/variant/get_if.md +++ b/reference/variant/variant/get_if.md @@ -137,6 +137,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/variant/variant/index.md b/reference/variant/variant/index.md index 1d9de42a96..becd533442 100644 --- a/reference/variant/variant/index.md +++ b/reference/variant/variant/index.md @@ -48,6 +48,6 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/variant/variant/op_assign.md b/reference/variant/variant/op_assign.md index 21d1c4a92d..9c7962ed58 100644 --- a/reference/variant/variant/op_assign.md +++ b/reference/variant/variant/op_assign.md @@ -188,8 +188,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/variant/variant/op_compare_3way.md b/reference/variant/variant/op_compare_3way.md index 072bf4493a..a17e672885 100644 --- a/reference/variant/variant/op_compare_3way.md +++ b/reference/variant/variant/op_compare_3way.md @@ -71,7 +71,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10 +- [GCC](/implementation.md#gcc): 10 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/variant/variant/op_constructor.md b/reference/variant/variant/op_constructor.md index fdfaca3ed8..7b50d0ec46 100644 --- a/reference/variant/variant/op_constructor.md +++ b/reference/variant/variant/op_constructor.md @@ -357,8 +357,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/variant/variant/op_destructor.md b/reference/variant/variant/op_destructor.md index 9a5b3eb0a8..f784201e90 100644 --- a/reference/variant/variant/op_destructor.md +++ b/reference/variant/variant/op_destructor.md @@ -28,8 +28,8 @@ constexpr ~variant(); // C++23 - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/variant/variant/op_equal.md b/reference/variant/variant/op_equal.md index 770b793151..fb29873a87 100644 --- a/reference/variant/variant/op_equal.md +++ b/reference/variant/variant/op_equal.md @@ -52,8 +52,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.2 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.2 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/variant/variant/op_greater.md b/reference/variant/variant/op_greater.md index c264760d36..7557a7e727 100644 --- a/reference/variant/variant/op_greater.md +++ b/reference/variant/variant/op_greater.md @@ -52,8 +52,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.2 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.2 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/variant/variant/op_greater_equal.md b/reference/variant/variant/op_greater_equal.md index 6891d6d2f2..117c3941e1 100644 --- a/reference/variant/variant/op_greater_equal.md +++ b/reference/variant/variant/op_greater_equal.md @@ -53,8 +53,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.2 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.2 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/variant/variant/op_less.md b/reference/variant/variant/op_less.md index 202eaa1bae..974d6c4749 100644 --- a/reference/variant/variant/op_less.md +++ b/reference/variant/variant/op_less.md @@ -52,8 +52,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.2 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.2 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/variant/variant/op_less_equal.md b/reference/variant/variant/op_less_equal.md index 85b57f01fe..5082317e2e 100644 --- a/reference/variant/variant/op_less_equal.md +++ b/reference/variant/variant/op_less_equal.md @@ -53,8 +53,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.2 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.2 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/variant/variant/op_not_equal.md b/reference/variant/variant/op_not_equal.md index f0c3c44fea..22fca6c92f 100644 --- a/reference/variant/variant/op_not_equal.md +++ b/reference/variant/variant/op_not_equal.md @@ -52,8 +52,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.2 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.2 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/variant/variant/swap.md b/reference/variant/variant/swap.md index 8785fd27b2..e5d3e8a90e 100644 --- a/reference/variant/variant/swap.md +++ b/reference/variant/variant/swap.md @@ -68,8 +68,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 diff --git a/reference/variant/variant/swap_free.md b/reference/variant/variant/swap_free.md index b74fa172d3..f92262dbf5 100644 --- a/reference/variant/variant/swap_free.md +++ b/reference/variant/variant/swap_free.md @@ -71,8 +71,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 diff --git a/reference/variant/variant/valueless_by_exception.md b/reference/variant/variant/valueless_by_exception.md index b8e13586bc..89da166937 100644 --- a/reference/variant/variant/valueless_by_exception.md +++ b/reference/variant/variant/valueless_by_exception.md @@ -101,6 +101,6 @@ empty - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/variant/variant_alternative.md b/reference/variant/variant_alternative.md index f299873317..f20a57ec47 100644 --- a/reference/variant/variant_alternative.md +++ b/reference/variant/variant_alternative.md @@ -123,8 +123,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/variant/variant_npos.md b/reference/variant/variant_npos.md index a31de13e1e..fe8720e75d 100644 --- a/reference/variant/variant_npos.md +++ b/reference/variant/variant_npos.md @@ -55,6 +55,6 @@ empty - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0.1 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0.1 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/variant/variant_size.md b/reference/variant/variant_size.md index e6ca8f6724..d4685f01fa 100644 --- a/reference/variant/variant_size.md +++ b/reference/variant/variant_size.md @@ -86,8 +86,8 @@ int main() - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/variant/visit.md b/reference/variant/visit.md index 9e033a950e..6599712d54 100644 --- a/reference/variant/visit.md +++ b/reference/variant/visit.md @@ -189,8 +189,8 @@ HelloHello - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 4.0 -- [GCC](/implementation.md#gcc): 7.3 +- [Clang](/implementation.md#clang): 4.0 [mark verified] +- [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/vector/vector/cbegin.md b/reference/vector/vector/cbegin.md index 269fb3bd48..a00c06b27b 100644 --- a/reference/vector/vector/cbegin.md +++ b/reference/vector/vector/cbegin.md @@ -62,9 +62,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/vector/vector/cend.md b/reference/vector/vector/cend.md index 03e8592525..d0d8ec657e 100644 --- a/reference/vector/vector/cend.md +++ b/reference/vector/vector/cend.md @@ -66,9 +66,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 - [P0784R7 More constexpr containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0784r7.html) diff --git a/reference/vector/vector/crbegin.md b/reference/vector/vector/crbegin.md index 43b0284d60..c447bcc0f2 100644 --- a/reference/vector/vector/crbegin.md +++ b/reference/vector/vector/crbegin.md @@ -62,9 +62,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 - [P1004R2 Making `std::vector` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1004r2.pdf) diff --git a/reference/vector/vector/crend.md b/reference/vector/vector/crend.md index a245fcc970..a807a9da32 100644 --- a/reference/vector/vector/crend.md +++ b/reference/vector/vector/crend.md @@ -62,9 +62,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/reference/vector/vector/data.md b/reference/vector/vector/data.md index b682b360c4..bcd99e9c2a 100644 --- a/reference/vector/vector/data.md +++ b/reference/vector/vector/data.md @@ -64,7 +64,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ### 備考 diff --git a/reference/vector/vector/emplace.md b/reference/vector/vector/emplace.md index 2d8f7adb18..21a9e50ac2 100644 --- a/reference/vector/vector/emplace.md +++ b/reference/vector/vector/emplace.md @@ -82,9 +82,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2013 +- [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified] ## 参照 diff --git a/reference/vector/vector/emplace_back.md b/reference/vector/vector/emplace_back.md index 101600beae..e02d56747f 100644 --- a/reference/vector/vector/emplace_back.md +++ b/reference/vector/vector/emplace_back.md @@ -79,9 +79,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2013 +- [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified] ## 参照 diff --git a/reference/vector/vector/erase_free.md b/reference/vector/vector/erase_free.md index ca5f2048df..81a12080a0 100644 --- a/reference/vector/vector/erase_free.md +++ b/reference/vector/vector/erase_free.md @@ -67,8 +67,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 9.1 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/vector/vector/erase_if_free.md b/reference/vector/vector/erase_if_free.md index 45b5098932..5112a379aa 100644 --- a/reference/vector/vector/erase_if_free.md +++ b/reference/vector/vector/erase_if_free.md @@ -67,8 +67,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 8.0 -- [GCC](/implementation.md#gcc): 9.1 +- [Clang](/implementation.md#clang): 8.0 [mark verified] +- [GCC](/implementation.md#gcc): 9.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/vector/vector/get_allocator.md b/reference/vector/vector/get_allocator.md index eebedde5b2..b70a861374 100644 --- a/reference/vector/vector/get_allocator.md +++ b/reference/vector/vector/get_allocator.md @@ -49,9 +49,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.7.0 +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2002, 2003, 2005, 2008, 2010, 2012, 2013, 2015, 2017 +- [Visual C++](/implementation.md#visual_cpp): 2002 [mark verified], 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - 2012, 2013は、`noexcept`が実装されていないため、`throw()`が修飾されている。 - 2015からは、`noexcept`が修飾されている。 diff --git a/reference/vector/vector/op_compare_3way.md b/reference/vector/vector/op_compare_3way.md index be8db1d553..83300b8b2a 100644 --- a/reference/vector/vector/op_compare_3way.md +++ b/reference/vector/vector/op_compare_3way.md @@ -71,7 +71,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 10 +- [GCC](/implementation.md#gcc): 10 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/vector/vector/op_deduction_guide.md b/reference/vector/vector/op_deduction_guide.md index 8a41fc914f..f935a13e9c 100644 --- a/reference/vector/vector/op_deduction_guide.md +++ b/reference/vector/vector/op_deduction_guide.md @@ -63,7 +63,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): -- [GCC](/implementation.md#gcc): 8.1 +- [GCC](/implementation.md#gcc): 8.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/vector/vector/shrink_to_fit.md b/reference/vector/vector/shrink_to_fit.md index 0a74a8d4c6..686f2ad5a3 100644 --- a/reference/vector/vector/shrink_to_fit.md +++ b/reference/vector/vector/shrink_to_fit.md @@ -72,9 +72,9 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 4.6.1 +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 diff --git a/start_editing.md b/start_editing.md index 8301f9cd45..9c6c8d9153 100644 --- a/start_editing.md +++ b/start_editing.md @@ -174,8 +174,8 @@ Pull Requestのレビューが滞っていた場合、Pull Requestの提出者 ## 処理系 ### バージョン - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10 -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 1 +- [GCC](/implementation.md#gcc): 10 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 1 [mark verified] ``` バージョンの表記としては、とくにVisual C++は本サイト独自の表記法がありますので、以下のページを確認してください。 diff --git a/start_editing/class_template_page.md b/start_editing/class_template_page.md index e7441bb072..9d2676d074 100644 --- a/start_editing/class_template_page.md +++ b/start_editing/class_template_page.md @@ -156,10 +156,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 1.9, 2.9, 3.0, 3.1, 3.2, 3.3 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.3, 4.6.3, 4.7.2, 4.8.1 -- [ICC](/implementation.md#icc): 10.1, 11.0, 11.1, 12.0 -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010, 2012 +- [Clang](/implementation.md#clang): 1.9 [mark verified], 2.9 [mark verified], 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.2 [mark verified], 4.8.1 [mark verified] +- [ICC](/implementation.md#icc): 10.1 [mark verified], 11.0 [mark verified], 11.1 [mark verified], 12.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified], 2012 [mark verified] (ここには、その機能が存在する言語のバージョンと、確認がとれたコンパイラとそのバージョンを記述します。) (これらの項目を削除した場合、C++03のあらゆる環境で使用できることを意味します。) diff --git a/start_editing/comparison_operator_template_page.md b/start_editing/comparison_operator_template_page.md index 8dc4cbf996..65007f5cbd 100644 --- a/start_editing/comparison_operator_template_page.md +++ b/start_editing/comparison_operator_template_page.md @@ -149,10 +149,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 1.9, 2.9, 3.0, 3.1, 3.2, 3.3 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.3, 4.6.3, 4.7.2, 4.8.1 -- [ICC](/implementation.md#icc): 10.1, 11.0, 11.1, 12.0 -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010, 2012 +- [Clang](/implementation.md#clang): 1.9 [mark verified], 2.9 [mark verified], 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.2 [mark verified], 4.8.1 [mark verified] +- [ICC](/implementation.md#icc): 10.1 [mark verified], 11.0 [mark verified], 11.1 [mark verified], 12.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified], 2012 [mark verified] (ここには、その機能が存在する言語のバージョンと、確認がとれたコンパイラとそのバージョンを記述します。) (これらの項目を削除した場合、C++03のあらゆる環境で使用できることを意味します。) diff --git a/start_editing/concept_template_page.md b/start_editing/concept_template_page.md index 6d7dcbb557..e295832fe0 100644 --- a/start_editing/concept_template_page.md +++ b/start_editing/concept_template_page.md @@ -113,10 +113,10 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 1.9, 2.9, 3.0, 3.1, 3.2, 3.3 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.3, 4.6.3, 4.7.2, 4.8.1 -- [ICC](/implementation.md#icc): 10.1, 11.0, 11.1, 12.0 -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010, 2012, 2019 Update 3 +- [Clang](/implementation.md#clang): 1.9 [mark verified], 2.9 [mark verified], 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.2 [mark verified], 4.8.1 [mark verified] +- [ICC](/implementation.md#icc): 10.1 [mark verified], 11.0 [mark verified], 11.1 [mark verified], 12.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified], 2012 [mark verified], 2019 Update 3 [mark verified] (ここには、その機能が存在する言語のバージョンと、確認がとれたコンパイラとそのバージョンを記述します。) (確認のテストできないときは、??を記述してください。) diff --git a/start_editing/cpo_template_page.md b/start_editing/cpo_template_page.md index 7af00f7b5c..d6c6a94a46 100644 --- a/start_editing/cpo_template_page.md +++ b/start_editing/cpo_template_page.md @@ -100,8 +100,8 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 11.0 -- [GCC](/implementation.md#gcc): 10.0 +- [Clang](/implementation.md#clang): 11.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.0 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? (ここには、その機能が存在する言語のバージョンと、確認がとれたコンパイラとそのバージョンを記述します。) diff --git a/start_editing/function_template_page.md b/start_editing/function_template_page.md index df78be2b4f..ed4324687f 100644 --- a/start_editing/function_template_page.md +++ b/start_editing/function_template_page.md @@ -152,10 +152,10 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 1.9, 2.9, 3.0, 3.1, 3.2, 3.3 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.3, 4.6.3, 4.7.2, 4.8.1 -- [ICC](/implementation.md#icc): 10.1, 11.0, 11.1, 12.0 -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010, 2012 +- [Clang](/implementation.md#clang): 1.9 [mark verified], 2.9 [mark verified], 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.2 [mark verified], 4.8.1 [mark verified] +- [ICC](/implementation.md#icc): 10.1 [mark verified], 11.0 [mark verified], 11.1 [mark verified], 12.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified], 2012 [mark verified] (ここには、その機能が存在する言語のバージョンと、確認がとれたコンパイラとそのバージョンを記述します。) (これらの項目を削除した場合、C++03のあらゆる環境で使用できることを意味します。) diff --git a/start_editing/header_template_page.md b/start_editing/header_template_page.md index 5fb97a0497..9a3c743783 100644 --- a/start_editing/header_template_page.md +++ b/start_editing/header_template_page.md @@ -48,10 +48,10 @@ - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 1.9, 2.9, 3.0, 3.1, 3.2, 3.3 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.3, 4.6.3, 4.7.2, 4.8.1 -- [ICC](/implementation.md#icc): 10.1, 11.0, 11.1, 12.0 -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010, 2012 +- [Clang](/implementation.md#clang): 1.9 [mark verified], 2.9 [mark verified], 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.2 [mark verified], 4.8.1 [mark verified] +- [ICC](/implementation.md#icc): 10.1 [mark verified], 11.0 [mark verified], 11.1 [mark verified], 12.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified], 2012 [mark verified] (ここには、そのヘッダファイルが存在する言語のバージョンと、確認がとれたコンパイラとそのバージョンを記述します。) (これらの項目を削除した場合、C++03のあらゆる環境で使用できることを意味します。) diff --git a/start_editing/type-type_template_page.md b/start_editing/type-type_template_page.md index 6a2894e2d3..77a2d5fecc 100644 --- a/start_editing/type-type_template_page.md +++ b/start_editing/type-type_template_page.md @@ -76,10 +76,10 @@ typedef origin_type new_type; ### 処理系 -- [Clang](/implementation.md#clang): 1.9, 2.9, 3.0, 3.1, 3.2, 3.3 -- [GCC](/implementation.md#gcc): 4.3.6, 4.4.7, 4.5.3, 4.6.3, 4.7.2, 4.8.1 -- [ICC](/implementation.md#icc): 10.1, 11.0, 11.1, 12.0 -- [Visual C++](/implementation.md#visual_cpp): 2003, 2005, 2008, 2010, 2012 +- [Clang](/implementation.md#clang): 1.9 [mark verified], 2.9 [mark verified], 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified] +- [GCC](/implementation.md#gcc): 4.3.6 [mark verified], 4.4.7 [mark verified], 4.5.3 [mark verified], 4.6.3 [mark verified], 4.7.2 [mark verified], 4.8.1 [mark verified] +- [ICC](/implementation.md#icc): 10.1 [mark verified], 11.0 [mark verified], 11.1 [mark verified], 12.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified], 2012 [mark verified] (ここには、その機能が存在する言語のバージョンと、確認がとれたコンパイラとそのバージョンを記述します。) (これらの項目を削除した場合、C++03のあらゆる環境で使用できることを意味します。) From 5a982c6dd233f434b440821a255c41dbd0924a43 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 11 Jun 2024 22:55:48 +0900 Subject: [PATCH 0952/3948] =?UTF-8?q?=E7=B7=A8=E9=9B=86=E8=80=85=E5=90=91?= =?UTF-8?q?=E3=81=91=E3=83=89=E3=82=AD=E3=83=A5=E3=83=A1=E3=83=B3=E3=83=88?= =?UTF-8?q?=20:=20=E5=8B=95=E4=BD=9C=E6=A4=9C=E8=A8=BC=E3=83=90=E3=83=BC?= =?UTF-8?q?=E3=82=B8=E3=83=A7=E3=83=B3=E3=81=AB=E4=BD=B5=E8=A8=98=E3=81=99?= =?UTF-8?q?=E3=82=8B=E7=B5=B5=E6=96=87=E5=AD=97=E3=81=AB=E3=81=A4=E3=81=84?= =?UTF-8?q?=E3=81=A6=E8=A8=98=E8=BC=89=20#1274?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start_editing.md | 9 +++++++-- working_style.md | 9 ++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/start_editing.md b/start_editing.md index 9c6c8d9153..4ac193aa88 100644 --- a/start_editing.md +++ b/start_editing.md @@ -174,10 +174,15 @@ Pull Requestのレビューが滞っていた場合、Pull Requestの提出者 ## 処理系 ### バージョン - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 10 [mark verified] -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 1 [mark verified] +- [GCC](/implementation.md#gcc): 9, [mark noimpl], 10 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 1 [mark impl] ``` +- mark noimpl : 未実装を表す絵文字 +- mark impl : 動作確認はできていないけど、リリースノートやそれに類するドキュメントには実装済みと書かれていることを表す絵文字 +- mark verified : 動作検証済み + + バージョンの表記としては、とくにVisual C++は本サイト独自の表記法がありますので、以下のページを確認してください。 - [処理系](implementation.md) diff --git a/working_style.md b/working_style.md index 528e93d8b5..f7668d1664 100644 --- a/working_style.md +++ b/working_style.md @@ -45,9 +45,16 @@ C++11以降対応については対応バージョンを明記します。バー - Visual C++: 2003, 2008, 2010 - pgCC: 11.2 -#### 絵文字の表示テスト +表記するバージョンには、「未実装」「実装済み」「動作検証済み」を表す絵文字指定を併記してください。 + - GCC: 12.0 [mark noimpl], 13.1 [mark impl], 14.1 [mark verified] +ここで、各指定は以下を意味します。 + +- mark noimpl : 未実装を表す絵文字 +- mark impl : 動作確認はできていないけど、リリースノートやそれに類するドキュメントには実装済みと書かれていることを表す絵文字 +- mark verified : 動作検証済み + ### 訳語表 訳語表は随時更新していってください。 From 71cff38538892e6070c850bf83201d4d27a5f45a Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 11 Jun 2024 23:13:38 +0900 Subject: [PATCH 0953/3948] =?UTF-8?q?basic=5Fstacktrace=20:=20Clang?= =?UTF-8?q?=E3=81=AE=E6=9C=AA=E5=AE=9F=E8=A3=85=E3=83=90=E3=83=BC=E3=82=B8?= =?UTF-8?q?=E3=83=A7=E3=83=B3=E3=81=A8Visual=20C++=E3=81=AE=E5=AE=9F?= =?UTF-8?q?=E8=A3=85=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3=E3=82=92?= =?UTF-8?q?=E8=A8=98=E8=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/stacktrace/basic_stacktrace.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/stacktrace/basic_stacktrace.md b/reference/stacktrace/basic_stacktrace.md index ce1c9a4e53..fa1b3632ae 100644 --- a/reference/stacktrace/basic_stacktrace.md +++ b/reference/stacktrace/basic_stacktrace.md @@ -236,9 +236,9 @@ Expression 'i >= 0' is false in f(int) at /app/example.cpp:15 - C++23 ### 処理系 -- [Clang](/implementation.md#clang): ?? +- [Clang](/implementation.md#clang): 18 [mark noimpl] - [GCC](/implementation.md#gcc): 12 [mark verified] -- [Visual C++](/implementation.md#visual_cpp): ?? +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 4 [mark impl] ### 備考 From f1c050d3f2acbbd399550fcf2f8859dda2960efa Mon Sep 17 00:00:00 2001 From: Yuki Nishidate Date: Wed, 12 Jun 2024 23:35:34 +0900 Subject: [PATCH 0954/3948] Fix typo --- lang/cpp11/defaulted_and_deleted_functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp11/defaulted_and_deleted_functions.md b/lang/cpp11/defaulted_and_deleted_functions.md index 733bc3397a..23f08f71d2 100644 --- a/lang/cpp11/defaulted_and_deleted_functions.md +++ b/lang/cpp11/defaulted_and_deleted_functions.md @@ -104,7 +104,7 @@ int main() }; // コンパイルエラー!= deleteはここではなく、最初の宣言に対して指定しなければならない - sometype::somtype() = delete; + sometype::sometype() = delete; ``` - 削除定義された関数は、暗黙的にインラインとなる。もしその関数が外部リンケージを持ち、ひとつの翻訳単位で削除定義された場合、全ての翻訳単位で削除定義される。削除定義された関数は、 From 439aededa674eeece8990ecdc8f785264ed6830b Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Thu, 13 Jun 2024 21:47:23 +0900 Subject: [PATCH 0955/3948] =?UTF-8?q?linalg=20:=20add=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0(#1233).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/add.md | 96 ++++++++++++++++++++++++++++ reference/linalg/addable.md | 57 +++++++++++++++++ reference/linalg/possibly-addable.md | 55 ++++++++++++++++ 3 files changed, 208 insertions(+) create mode 100644 reference/linalg/add.md create mode 100644 reference/linalg/addable.md create mode 100644 reference/linalg/possibly-addable.md diff --git a/reference/linalg/add.md b/reference/linalg/add.md new file mode 100644 index 0000000000..fd21543dad --- /dev/null +++ b/reference/linalg/add.md @@ -0,0 +1,96 @@ +# add + +* [mathjax enable] +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + + +```cpp +namespace std::linalg { + template + void add(InObj1 x, + InObj2 y, + OutObj z); // (1) + + template + void add(ExecutionPolicy&& exec, + InObj1 x, + InObj2 y, + OutObj z); // (2) +} +``` + + +## 概要 +同じサイズの行列またはベクトルの`x`と`y`、`z`に対して、$x + y$ を`z`に代入する: + +$$ +z \leftarrow x + y +$$ + + +## テンプレートパラメータ制約 +`x`と`y`、`z`の次元が全て等しくなければならない。 +- `x.rank() == y.rank() && y.rank() == z.rank()` + + +## 適格要件 +行列またはベクトルの`x`、`y`、`z`の各次元の静的要素数が同じであること。 + +- [`possibly-addable`](possibly-addable.md)`() == true` + + +## 事前条件 +行列またはベクトルの`x`、`y`、`z`の各次元が同じであること。 + +- [`addable`](addable.md)`(x, y, z) == true` + + +## 効果 +$x + y$ を`z`に代入する。 + +- (1): 逐次実行する。 +- (2): 指定された実行ポリシーに応じて実行する。 + + +## 戻り値 +なし + + +## 備考 +`z`を`x`または`y`としてもよい。 + + +## 例 + + +### 出力 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution`](/reference/execution.md) +- [`mdspan`](/reference/mdspan.md) + + +## 参照 +- [P0788R3 Standard Library Specification in a Concepts and Contracts World](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0788r3.pdf) +- [`LAPACK: caxpy`](https://netlib.org/lapack/explore-html/d5/d4b/group__axpy_ga0b7bac1f4d42514074a48f14f5f9caa0.html#ga0b7bac1f4d42514074a48f14f5f9caa0) + diff --git a/reference/linalg/addable.md b/reference/linalg/addable.md new file mode 100644 index 0000000000..1f6e46f79c --- /dev/null +++ b/reference/linalg/addable.md @@ -0,0 +1,57 @@ +# addable + +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + + +```cpp +namespace std::linalg { +constexpr bool addable( + const in-vector auto& in1, + const in-vector auto& in2, + const in-vector auto& out) +{ + return out.extent(0) == in1.extent(0) && + out.extent(0) == in2.extent(0); +} // (1) + +constexpr bool addable( + const in-matrix auto& in1, + const in-matrix auto& in2, + const in-matrix auto& out) +{ + return out.extent(0) == in1.extent(0) && + out.extent(1) == in1.extent(1) && + out.extent(0) == in2.extent(0) && + out.extent(1) == in2.extent(1); +} // (2) +} +``` + + +## 概要 +テンプレートパラメータに指定されたベクトルまたは行列の次元が同じかどうかを判定する、説明専用の関数である。 + + +## 戻り値 +`In1`、`In2`、`Out`の各次元が同じ場合`true`を返す。そうでない場合は、`false`を返す。 + +- (1): ベクトル +- (2): 行列 + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`mdspan`](/reference/mdspan.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) + + diff --git a/reference/linalg/possibly-addable.md b/reference/linalg/possibly-addable.md new file mode 100644 index 0000000000..3b34fa1dd0 --- /dev/null +++ b/reference/linalg/possibly-addable.md @@ -0,0 +1,55 @@ +# possibly-addable + +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + + +```cpp +namespace std::linalg { + template + constexpr bool possibly-addable() + { + return compatible-static-extents(0, 0) && + compatible-static-extents(0, 0) && + compatible-static-extents(0, 0); + } // (1) + + template + constexpr bool possibly-addable() + { + return compatible-static-extents(0, 0) && + compatible-static-extents(1, 1) && + compatible-static-extents(0, 0) && + compatible-static-extents(1, 1) && + compatible-static-extents(0, 0) && + compatible-static-extents(1, 1); + } // (2) +} +``` + + +## 概要 +テンプレートパラメータに指定されたベクトルまたは行列の次元が同じかどうかを静的要素数で判定する、説明専用の関数である。 + + +## 戻り値 +`In1`、`In2`、`Out`の各次元の静的要素数が同じ場合`true`を返す。そうでない場合は、`false`を返す。 + +- (1): ベクトル +- (2): 行列 + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`mdspan`](/reference/mdspan.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) + From 5ac418093b505b39ae5725362b41d5030352873b Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 14 Jun 2024 14:17:35 +0900 Subject: [PATCH 0956/3948] =?UTF-8?q?=E8=A8=80=E8=AA=9E=E6=A9=9F=E8=83=BD?= =?UTF-8?q?=20:=20=E3=83=9A=E3=83=BC=E3=82=B8=E3=82=BF=E3=82=A4=E3=83=88?= =?UTF-8?q?=E3=83=AB=E3=81=AE=E6=9C=AB=E5=B0=BE=E3=81=AB=E6=8F=90=E6=A1=88?= =?UTF-8?q?=E6=96=87=E6=9B=B8=E3=81=AE=E7=95=AA=E5=8F=B7=E3=82=92=E8=A8=98?= =?UTF-8?q?=E8=BC=89=20#1288?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 11 +++-------- lang/cpp11/alias_templates.md | 2 +- lang/cpp11/alignas.md | 2 +- lang/cpp11/alignof.md | 2 +- lang/cpp11/attributes.md | 2 +- lang/cpp11/auto.md | 2 +- lang/cpp11/char16_32.md | 2 +- lang/cpp11/constexpr.md | 2 +- lang/cpp11/decltype.md | 2 +- lang/cpp11/defaulted_and_deleted_functions.md | 2 +- lang/cpp11/delegating_constructors.md | 2 +- lang/cpp11/explicit_conversion_operator.md | 2 +- lang/cpp11/extend_friend_targets.md | 2 +- lang/cpp11/extern_template.md | 2 +- lang/cpp11/func.md | 2 +- lang/cpp11/inheriting_constructors.md | 2 +- lang/cpp11/initializer_lists.md | 2 +- lang/cpp11/inline_namespaces.md | 2 +- lang/cpp11/lambda_expressions.md | 2 +- .../local_and_unnamed_type_as_template_arguments.md | 2 +- lang/cpp11/long_long_type.md | 2 +- lang/cpp11/noexcept.md | 2 +- lang/cpp11/non_static_data_member_initializers.md | 2 +- lang/cpp11/nullptr.md | 2 +- lang/cpp11/override_final.md | 2 +- lang/cpp11/pragma_operator.md | 2 +- lang/cpp11/range_based_for.md | 2 +- lang/cpp11/raw_string_literals.md | 2 +- lang/cpp11/ref_qualifier_for_this.md | 2 +- lang/cpp11/right_angle_brackets.md | 2 +- lang/cpp11/rvalue_ref_and_move_semantics.md | 2 +- lang/cpp11/scoped_enum.md | 2 +- lang/cpp11/sfinae_expressions.md | 2 +- lang/cpp11/static_assert.md | 2 +- lang/cpp11/static_initialization_thread_safely.md | 2 +- lang/cpp11/thread_local_storage.md | 2 +- lang/cpp11/trailing_return_types.md | 2 +- lang/cpp11/uniform_initialization.md | 2 +- lang/cpp11/unrestricted_unions.md | 2 +- lang/cpp11/user_defined_literals.md | 2 +- lang/cpp11/utf8_string_literals.md | 2 +- lang/cpp11/variadic_macros.md | 2 +- lang/cpp11/variadic_templates.md | 2 +- lang/cpp14/binary_literals.md | 2 +- ...brace_elision_in_array_temporary_initialization.md | 2 +- lang/cpp14/deprecated_attr.md | 2 +- lang/cpp14/digit_separators.md | 2 +- lang/cpp14/generic_lambdas.md | 2 +- lang/cpp14/initialize_capture.md | 2 +- lang/cpp14/relaxing_constraints_on_constexpr.md | 2 +- .../return_type_deduction_for_normal_functions.md | 2 +- lang/cpp14/sized_deallocation.md | 2 +- lang/cpp14/variable_templates.md | 2 +- lang/cpp17.md | 2 +- ..._evaluation_for_all_non-type_template_arguments.md | 2 +- ...allow_typename_in_a_template_template_parameter.md | 2 +- .../attributes_for_namespaces_and_enumerators.md | 2 +- lang/cpp17/constexpr_lambda.md | 2 +- lang/cpp17/construction_enum_class_values.md | 2 +- ...declaring_non-type_template_arguments_with_auto.md | 2 +- ...dynamic_memory_allocation_for_over-aligned_data.md | 2 +- .../exception_spec_be_part_of_the_type_system.md | 2 +- lang/cpp17/expression_evaluation_order.md | 2 +- lang/cpp17/extending_static_assert.md | 2 +- lang/cpp17/extension_to_aggregate_initialization.md | 2 +- lang/cpp17/fallthrough.md | 2 +- lang/cpp17/folding_expressions.md | 2 +- lang/cpp17/generalizing_the_range-based_for_loop.md | 2 +- lang/cpp17/guaranteed_copy_elision.md | 2 +- lang/cpp17/has_include.md | 2 +- lang/cpp17/hexadecimal_floating_literals.md | 2 +- lang/cpp17/if_constexpr.md | 2 +- lang/cpp17/inline_variables.md | 2 +- lang/cpp17/lambda_capture_of_this_by_value.md | 2 +- lang/cpp17/maybe_unused.md | 2 +- lang/cpp17/nested_namespace.md | 2 +- ..._rules_for_auto_deduction_from_braced-init-list.md | 2 +- lang/cpp17/nodiscard.md | 2 +- lang/cpp17/non_standard_attributes.md | 2 +- lang/cpp17/pack_expansions_in_using.md | 2 +- .../remove_deprecated_exception_specifications.md | 2 +- lang/cpp17/remove_deprecated_increment_of_bool.md | 2 +- .../remove_deprecated_use_of_the_register_keyword.md | 2 +- lang/cpp17/removing_trigraphs.md | 2 +- ...t_of_class_objects_containing_reference_members.md | 2 +- lang/cpp17/selection_statements_with_initializer.md | 2 +- lang/cpp17/structured_bindings.md | 2 +- lang/cpp17/type_deduction_for_class_templates.md | 2 +- lang/cpp17/using_attribute_namespaces.md | 2 +- lang/cpp17/utf8_character_literals.md | 2 +- lang/cpp20/access_checking_on_specializations.md | 2 +- ...adl_and_function_templates_that_are_not_visible.md | 2 +- ..._aggregates_from_a_parenthesized_list_of_values.md | 2 +- lang/cpp20/allow_lambda_capture_equal_this.md | 2 +- .../allow_pack_expansion_in_lambda_init_capture.md | 2 +- ...allow_structured_bindings_to_accessible_members.md | 2 +- ..._virtual_function_calls_in_constant_expressions.md | 2 +- ...cast_polymorphic_typeid_in_constant_expressions.md | 2 +- lang/cpp20/array_size_deduction_in_new-expressions.md | 2 +- ...g_the_active_member_of_a_union_inside_constexpr.md | 2 +- lang/cpp20/char8_t.md | 2 +- lang/cpp20/checking_for_abstract_class_types.md | 2 +- ...lass_template_argument_deduction_for_aggregates.md | 2 +- ...template_argument_deduction_for_alias_templates.md | 2 +- .../class_types_in_non-type_template_parameters.md | 2 +- lang/cpp20/concepts.md | 2 +- lang/cpp20/consistent_comparison.md | 2 +- lang/cpp20/constinit.md | 2 +- ..._pointer_to_bool_should_be_considered_narrowing.md | 4 ++-- lang/cpp20/coroutines.md | 2 +- ..._constructible_and_assignable_stateless_lambdas.md | 2 +- .../default_member_initializers_for_bit_fields.md | 2 +- .../deprecate_implicit_capture_of_this_via_defcopy.md | 2 +- lang/cpp20/deprecate_pod.md | 2 +- ..._the_comma_operator_in_subscripting_expressions.md | 2 +- lang/cpp20/deprecating_volatile.md | 2 +- lang/cpp20/designated_initialization.md | 2 +- lang/cpp20/down_with_typename.md | 2 +- ...ficient_sized_delete_for_variable_sized_classes.md | 2 +- ...valuated_inline-assembly_in_constexpr_functions.md | 2 +- lang/cpp20/explicit_bool.md | 2 +- ..._bindings_to_be_more_like_variable_declarations.md | 2 +- .../familiar_template_syntax_for_generic_lambdas.md | 2 +- .../fixing_const_qualified_pointers_to_members.md | 2 +- lang/cpp20/immediate_functions.md | 2 +- lang/cpp20/language_support_for_empty_objects.md | 2 +- ...less_eager_instantiation_of_constexpr_functions.md | 2 +- lang/cpp20/likely_and_unlikely_attributes.md | 2 +- ...ake_char16t_char32t_string_literals_be_utf16_32.md | 2 +- lang/cpp20/modules.md | 2 +- lang/cpp20/more_constexpr_containers.md | 2 +- lang/cpp20/nested_inline_mamespaces.md | 2 +- lang/cpp20/nodiscard_should_have_a_reason.md | 2 +- .../permit_conversions_to_arrays_of_unknown_bound.md | 2 +- ...al_default_initialization_in_constexpr_contexts.md | 2 +- ...ibit_aggregates_with_user-declared_constructors.md | 2 +- .../range-based_for_statements_with_initializer.md | 2 +- .../cpp20/reference_capture_of_structured_bindings.md | 2 +- ...ange_for_loop_customization_point_finding_rules.md | 2 +- ...ured_bindings_customization_point_finding_rules.md | 2 +- ..._const_mismatch_with_defaulted_copy_constructor.md | 2 +- lang/cpp20/signed_integers_are_twos_complement.md | 2 +- lang/cpp20/simplifying_implicit_lambda_capture.md | 2 +- lang/cpp20/try-catch_blocks_in_constexpr_functions.md | 2 +- lang/cpp20/using_enum.md | 2 +- lang/cpp20/va_opt.md | 2 +- .../wording_for_lambdas_in_unevaluated_contexts.md | 2 +- ...r_preprocessing_directives_elifdef_and_elifndef.md | 2 +- lang/cpp23/attributes_on_lambda_expressions.md | 2 +- lang/cpp23/character_encoding_of_diagnostic_text.md | 2 +- ...lass_template_argument_deduction_from_inherited.md | 2 +- lang/cpp23/consistent_character_literal_encoding.md | 2 +- lang/cpp23/consteval_needs_to_propagate_up.md | 2 +- lang/cpp23/delimited_escape_sequences.md | 2 +- lang/cpp23/down_with_lambda_parens.md | 2 +- ...xtend_init_statement_to_allow_alias_declaration.md | 2 +- ...generalized_wording_for_partial_specializations.md | 2 +- lang/cpp23/if_consteval.md | 2 +- .../cpp23/labels_at_the_end_of_compound_statements.md | 2 +- .../lifetime_extension_in_range_based_for_loop.md | 2 +- lang/cpp23/literal_suffix_for_signed_size_t.md | 2 +- lang/cpp23/make_declaration_order_layout_mandated.md | 2 +- lang/cpp23/meaningful_exports.md | 2 +- lang/cpp23/mixed_string_literal_concatenation.md | 2 +- lang/cpp23/multidimensional_subscript_operator.md | 2 +- lang/cpp23/named_universal_character_escapes.md | 2 +- .../cpp23/narrowing_contextual_conversions_to_bool.md | 2 +- .../non_literal_variables_in_constexpr_functions.md | 2 +- ...atic_constexpr_variables_in_constexpr_functions.md | 2 +- lang/cpp23/portable_assumptions.md | 2 +- lang/cpp23/relaxing_some_constexpr_restrictions.md | 2 +- ...rals_and_multicharacter_wide_character_literals.md | 2 +- lang/cpp23/simpler_implicit_move.md | 2 +- lang/cpp23/static_operator.md | 2 +- ...ort_for_utf8_as_a_portable_source_file_encoding.md | 2 +- .../trimming_whitespaces_before_line_splicing.md | 2 +- lang/cpp23/warning.md | 2 +- lang/cpp26/user-generated_static_assert_messages.md | 2 +- 178 files changed, 181 insertions(+), 186 deletions(-) diff --git a/implementation-status.md b/implementation-status.md index 3cd6844e0e..d13c7277f4 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -120,7 +120,7 @@ | P0188R1: [`[[fallthrough]]`属性](/lang/cpp17/fallthrough.md) | `case`節で`break`や`return`を書かなかった場合に、それが意図したフォールスルーであることをコンパイラに伝える属性 | 7 | 3.9 | 18.0 | 2017 | | P0189R1: [`[[nodiscard]]`属性](/lang/cpp17/nodiscard.md) | 関数の戻り値を無視してはならないことをユーザーに伝える属性 | 4.8からは`[[gnu::warn_unused_result]]`を使用すること
7からサポート | 3.9 | 18.0 | 2017 Update 3 | | P0212R1: [`[[maybe_unused]]`属性](/lang/cpp17/maybe_unused.md) | 使用しない可能性がある変数であることをコンパイラに伝える属性 | 4.8からは`[[gnu::unused]]`を使用すること
7からサポート | 3.9 | 18.0 | 2017 Update 3 | -| P0017R1: [基底クラスのメンバ変数を集成体初期化するための波カッコを省略できるようにする][P0017R1] | 基底クラスのメンバを集成体初期化するために、`derived d {{42}};`の代わりに`derived d {42};`と書けるようにする | 7 | 3.9 | 19.1 | 2017 Update 7 | +| P0017R1: [基底クラスのメンバ変数を集成体初期化するための波カッコを省略できるようにする](/lang/cpp17/extension_to_aggregate_initialization.md) | 基底クラスのメンバを集成体初期化するために、`derived d {{42}};`の代わりに`derived d {42};`と書けるようにする | 7 | 3.9 | 19.1 | 2017 Update 7 | | P0170R1: [ラムダ式を`constexpr`として使用できるようにする](/lang/cpp17/constexpr_lambda.md) | ラムダ式の関数オブジェクトが定数式の文脈で使用された場合に、それがコンパイル時に評価されるようにする | 7 | 5 | 19.0 | 2017 Update 3 | | P0184R0: [範囲for文のための`begin()`と`end()`関数が、異なる型を返すことを許可](/lang/cpp17/generalizing_the_range-based_for_loop.md) | `begin()`と`end()`が異なるイテレータ型を返せるようにすることで、終端イテレータを定義しやすくする | 6 | 3.9 | 18.0 | 2017 | | P0018R3: [ラムダ式での`*this`のコピーキャプチャ](/lang/cpp17/lambda_capture_of_this_by_value.md) | キャプチャリストに`*this`を指定することで、`*this`をコピーキャプチャする | 7 | 3.9 | 19.0 | 2017 Update 3 | @@ -134,9 +134,7 @@ | P0145R3: [厳密な式の評価順](/lang/cpp17/expression_evaluation_order.md) | 式の項が評価される順序を厳密に規定する。
`b = a;`の式が右から順番(a, bの順)に評価される | 7 | 4 | 19.1 | 2017 Update 7 | | P0283R2: [不明な属性を無視する](/lang/cpp17/non_standard_attributes.md) | 実装が知らない名前空間の属性は無視する | 4.8 | 3.0 | 18.0 | 2015 | | P0292R2: [constexpr if文](/lang/cpp17/if_constexpr.md) | `if constexpr(cond)`とすることで、そのif文はコンパイル時に処理される | 7 | 3.9 | 19.0 | 2017 Update 3 | -| P0296R2: [処理の進行保証][P0296R2] | 並行処理に関して「処理の進行」を明確に定義
(TODO:言葉の定義だけなので実装状況ページからは取り除く) | No | No | No | No | | P0386R2: [インライン変数](/lang/cpp17/inline_variables.md) | インライン指定を関数だけでなく変数にも指定できるようにする | 7 | 3.9 | 19.0 | 2017 Update 5 | -| P0391R0: [templated entityという用語を導入][P0391R0] | (TODO:言葉の定義だけなので実装状況ページからは取り除く) | - | - | - | - | | P0217R3: [構造化束縛](/lang/cpp17/structured_bindings.md) | タプルやユーザー定義型を分解して受け取れるようにする
`tuple f();`
`const auto [a, b] = f(); // aはintの値、bはstringの値` | 7 | 4 | 18.0 | 2017 Update 3 | | P0305R1: [if文とswitch文の条件式と初期化を分離](/lang/cpp17/selection_statements_with_initializer.md) | `if (init; condition)`のように初期化と条件式を分けて記述できるようにする | 7 | 3.9 | 18.0 | 2017 Update 3 | | P0137R1: [参照メンバをもつクラスの置き換え](/lang/cpp17/replacement_of_class_objects_containing_reference_members.md) | 参照型メンバや`const`メンバ変数を含むクラスについてこれまで結果は未定義とされていた配置`new`によるオブジェクトの置き換えを条件付きで可能とする | 7 | 6.0 | No | 2017 Update 7 | @@ -148,9 +146,6 @@ [P0136R1]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0136r1.html -[P0017R1]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0017r1.html -[P0296R2]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0296r2.html -[P0391R0]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0391r0.html [P0512R0]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0512r0.pdf [P0490R0]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0490r0.html [P0522R0]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0522r0.html @@ -177,7 +172,7 @@ | P0428R2: [ジェネリックラムダのテンプレート構文](/lang/cpp20/familiar_template_syntax_for_generic_lambdas.md) | ジェネリックラムダでテンプレートパラメータを定義できるようにする | 8 | 9.0 | 2021.4 | 2019 Update 2 | | P0704R1: [`const`修飾されたメンバポインタの制限を修正](/lang/cpp20/fixing_const_qualified_pointers_to_members.md) | `.*`演算子での左辺値の`const`メンバ関数呼び出しを許可する | 8 | 6.0 | 2021.4 | 2015 | | P0306R4: [可変引数が空でない場合のトークン置換](/lang/cpp20/va_opt.md) | プリプロセッサの置換で可変引数が空の場合に余計なカンマが付いてしまう問題に対処 | 8 (partial, `#__VA_OPT__`による文字列化が未サポート) | 6.0
9.0 ([p1042](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1042r1.html)) | 2021.4 | 2019 Update 5 | -| P0329R4: [指示付き初期化](/lang/cpp20/designated_initialization.md) | | 8 | 6.0 (partial) | 2021.4 | 2019 Update 1 | +| P0329R4: [指示付き初期化](/lang/cpp20/designated_initialization.md) | 波カッコによる集成体初期化でメンバ名を指定して初期化できるようにする | 8 | 6.0 (partial) | 2021.4 | 2019 Update 1 | | P0734R0: [コンセプト](/lang/cpp20/concepts.md) | テンプレートパラメータに対する制約を行う | 10 | 10.0 (partial) | 2021.6 | 2019 Update 3 | | P0614R1: [初期化式をともなう範囲for文](/lang/cpp20/range-based_for_statements_with_initializer.md) | 範囲for文スコープで使用する変数の初期化のための構文を追加 | 9 | 8.0 | 2021.7 | 2019 Update 5 | | P0588R1: [暗黙のラムダキャプチャを簡略化](/lang/cpp20/simplifying_implicit_lambda_capture.md) | ラムダ式のキャプチャに関する仕様整理 | 8 | No | 2021.4 | 2019 Update 4 | @@ -253,7 +248,7 @@ | P1787R6: [スコープと名前ルックアップの仕様整理](/lang/cpp23/declarations_and_where_to_find_them.md.nolink) | 複雑で不完全になっているスコープと名前ルックアップの仕様を整理し、一部の問題を解決する | - | - | - | - | | P2615R1: [無意味なexport宣言を禁止する](/lang/cpp23/meaningful_exports.md) | いくつかの不必要な宣言に対するモジュールexportを禁止する | - | - | - | - | | P2360R0: [初期化文での型の別名宣言を許可](/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md) | `for (using T = int; T e : v) {}`を許可 | 12 | 14 | 2022.2 | - | -| P2718R0: [範囲for文が範囲初期化子内で生じた一時オブジェクトを延命することを規定](lang/cpp23/lifetime_extension_in_range_based_for_loop.md) | | - | - | - | - | +| P2718R0: [範囲for文が範囲初期化子内で生じた一時オブジェクトを延命することを規定](lang/cpp23/lifetime_extension_in_range_based_for_loop.md) | 範囲初期化子内で生じた一時オブジェクトは範囲for文の終わりまで延命される | - | - | - | - | | P2324R2: [複合文の末尾へのラベルを許可](/lang/cpp23/labels_at_the_end_of_compound_statements.md) | C互換のため、複合文の末尾でのgoto文のラベルを許可する | 13 | 16 | 2023.2 | - | | P0847R7: [自身のオブジェクトを明示的にパラメータとして指定する](/lang/cpp23/deducing_this.md.nolink) | メンバ関数が`*this`の型・オブジェクトをパラメータとしてとり、`*this`オブジェクトがconst/非const、左辺値/右辺値であるかをメンバ関数内で識別できるようにする | - | 18 | - | 2022 Update 2 (partial) | | P1847R4: [アクセス制御の異なるメンバ変数のレイアウトを宣言順に規定](/lang/cpp23/make_declaration_order_layout_mandated.md) | アクセス制御の異なるメンバ変数のレイアウトは並び替えを許可されていたが宣言順に規定する | Yes | Yes | - | 2022 | diff --git a/lang/cpp11/alias_templates.md b/lang/cpp11/alias_templates.md index 171441855b..53ee5059d2 100644 --- a/lang/cpp11/alias_templates.md +++ b/lang/cpp11/alias_templates.md @@ -1,4 +1,4 @@ -# エイリアステンプレート +# エイリアステンプレート [N2258] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/alignas.md b/lang/cpp11/alignas.md index a913e2bd0a..3427b7f9d9 100644 --- a/lang/cpp11/alignas.md +++ b/lang/cpp11/alignas.md @@ -1,4 +1,4 @@ -# alignas +# alignas [N2341] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/alignof.md b/lang/cpp11/alignof.md index 312b658cf9..61d4251e77 100644 --- a/lang/cpp11/alignof.md +++ b/lang/cpp11/alignof.md @@ -1,4 +1,4 @@ -# alignof +# alignof [N2341] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/attributes.md b/lang/cpp11/attributes.md index 443e638ba7..613da48005 100644 --- a/lang/cpp11/attributes.md +++ b/lang/cpp11/attributes.md @@ -1,4 +1,4 @@ -# 属性構文 +# 属性構文 [N2761] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/auto.md b/lang/cpp11/auto.md index a9ab081080..d5566c1754 100644 --- a/lang/cpp11/auto.md +++ b/lang/cpp11/auto.md @@ -1,4 +1,4 @@ -# auto +# auto [N1984] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/char16_32.md b/lang/cpp11/char16_32.md index a37cc16fc8..a12af8688f 100644 --- a/lang/cpp11/char16_32.md +++ b/lang/cpp11/char16_32.md @@ -1,4 +1,4 @@ -# char16_tとchar32_t +# char16_tとchar32_t [N2249] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/constexpr.md b/lang/cpp11/constexpr.md index 1b28c57e0a..44b3a5d479 100644 --- a/lang/cpp11/constexpr.md +++ b/lang/cpp11/constexpr.md @@ -1,4 +1,4 @@ -# constexpr +# constexpr [N2235] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/decltype.md b/lang/cpp11/decltype.md index 602486c079..88693da6c5 100644 --- a/lang/cpp11/decltype.md +++ b/lang/cpp11/decltype.md @@ -1,4 +1,4 @@ -# decltype +# decltype [N2343] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/defaulted_and_deleted_functions.md b/lang/cpp11/defaulted_and_deleted_functions.md index 23f08f71d2..5d229bd62f 100644 --- a/lang/cpp11/defaulted_and_deleted_functions.md +++ b/lang/cpp11/defaulted_and_deleted_functions.md @@ -1,4 +1,4 @@ -# 関数のdefault/delete宣言 +# 関数のdefault/delete宣言 [N2346] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/delegating_constructors.md b/lang/cpp11/delegating_constructors.md index 89285941f6..f65566c9c1 100644 --- a/lang/cpp11/delegating_constructors.md +++ b/lang/cpp11/delegating_constructors.md @@ -1,4 +1,4 @@ -# 委譲コンストラクタ +# 委譲コンストラクタ [N1986] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/explicit_conversion_operator.md b/lang/cpp11/explicit_conversion_operator.md index 1fb322b4ed..52802ad208 100644 --- a/lang/cpp11/explicit_conversion_operator.md +++ b/lang/cpp11/explicit_conversion_operator.md @@ -1,4 +1,4 @@ -# 明示的な型変換演算子のオーバーロード +# 明示的な型変換演算子のオーバーロード [N2437] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/extend_friend_targets.md b/lang/cpp11/extend_friend_targets.md index 0b6670555e..75a7492326 100644 --- a/lang/cpp11/extend_friend_targets.md +++ b/lang/cpp11/extend_friend_targets.md @@ -1,4 +1,4 @@ -# friend宣言できる対象を拡張 +# friend宣言できる対象を拡張 [N1791] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/extern_template.md b/lang/cpp11/extern_template.md index 092746c123..2a31d1e8cb 100644 --- a/lang/cpp11/extern_template.md +++ b/lang/cpp11/extern_template.md @@ -1,4 +1,4 @@ -# extern template +# extern template [N1987] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/func.md b/lang/cpp11/func.md index bad2b78c33..e894f7befa 100644 --- a/lang/cpp11/func.md +++ b/lang/cpp11/func.md @@ -1,4 +1,4 @@ -# 事前定義識別子\_\_func\_\_ +# 事前定義識別子\_\_func\_\_ [N1653] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/inheriting_constructors.md b/lang/cpp11/inheriting_constructors.md index 6e7c8bc126..a84dcc7711 100644 --- a/lang/cpp11/inheriting_constructors.md +++ b/lang/cpp11/inheriting_constructors.md @@ -1,4 +1,4 @@ -# 継承コンストラクタ +# 継承コンストラクタ [N2540] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/initializer_lists.md b/lang/cpp11/initializer_lists.md index edafb40052..79ca2b4a19 100644 --- a/lang/cpp11/initializer_lists.md +++ b/lang/cpp11/initializer_lists.md @@ -1,4 +1,4 @@ -# 初期化子リスト +# 初期化子リスト [N2672] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/inline_namespaces.md b/lang/cpp11/inline_namespaces.md index e732d5755c..929243944d 100644 --- a/lang/cpp11/inline_namespaces.md +++ b/lang/cpp11/inline_namespaces.md @@ -1,4 +1,4 @@ -# インライン名前空間 +# インライン名前空間 [N2535] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/lambda_expressions.md b/lang/cpp11/lambda_expressions.md index a49355d457..38783f5426 100644 --- a/lang/cpp11/lambda_expressions.md +++ b/lang/cpp11/lambda_expressions.md @@ -1,4 +1,4 @@ -# ラムダ式 +# ラムダ式 [N2927] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/local_and_unnamed_type_as_template_arguments.md b/lang/cpp11/local_and_unnamed_type_as_template_arguments.md index 11e90c0bfa..8eeb04d6e0 100644 --- a/lang/cpp11/local_and_unnamed_type_as_template_arguments.md +++ b/lang/cpp11/local_and_unnamed_type_as_template_arguments.md @@ -1,4 +1,4 @@ -# ローカル型と無名型を、テンプレート引数として使用することを許可 +# ローカル型と無名型を、テンプレート引数として使用することを許可 [N2657] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/long_long_type.md b/lang/cpp11/long_long_type.md index ac70a4694a..cf62830df2 100644 --- a/lang/cpp11/long_long_type.md +++ b/lang/cpp11/long_long_type.md @@ -1,4 +1,4 @@ -# long long型 +# long long型 [N1811] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/noexcept.md b/lang/cpp11/noexcept.md index 2ac2aff52c..afef96b59c 100644 --- a/lang/cpp11/noexcept.md +++ b/lang/cpp11/noexcept.md @@ -1,4 +1,4 @@ -# noexcept +# noexcept [N3050] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/non_static_data_member_initializers.md b/lang/cpp11/non_static_data_member_initializers.md index 4f9ec87219..6764a34ba2 100644 --- a/lang/cpp11/non_static_data_member_initializers.md +++ b/lang/cpp11/non_static_data_member_initializers.md @@ -1,4 +1,4 @@ -# 非静的メンバ変数の初期化 +# 非静的メンバ変数の初期化 [N2756] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/nullptr.md b/lang/cpp11/nullptr.md index 9bc46a45ea..6fa57226c0 100644 --- a/lang/cpp11/nullptr.md +++ b/lang/cpp11/nullptr.md @@ -1,4 +1,4 @@ -# nullptr +# nullptr [N2431] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/override_final.md b/lang/cpp11/override_final.md index c3d6c8fcdd..1959240449 100644 --- a/lang/cpp11/override_final.md +++ b/lang/cpp11/override_final.md @@ -1,4 +1,4 @@ -# overrideとfinal +# overrideとfinal [N2928] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/pragma_operator.md b/lang/cpp11/pragma_operator.md index ef1727c733..ed565e3601 100644 --- a/lang/cpp11/pragma_operator.md +++ b/lang/cpp11/pragma_operator.md @@ -1,4 +1,4 @@ -# Pragma演算子 +# Pragma演算子 [N1653] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/range_based_for.md b/lang/cpp11/range_based_for.md index 741fa25388..8c80c934be 100644 --- a/lang/cpp11/range_based_for.md +++ b/lang/cpp11/range_based_for.md @@ -1,4 +1,4 @@ -# 範囲for文 +# 範囲for文 [N2930] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/raw_string_literals.md b/lang/cpp11/raw_string_literals.md index 1a12d53029..a5b59af2f1 100644 --- a/lang/cpp11/raw_string_literals.md +++ b/lang/cpp11/raw_string_literals.md @@ -1,4 +1,4 @@ -# 生文字列リテラル +# 生文字列リテラル [N2442] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/ref_qualifier_for_this.md b/lang/cpp11/ref_qualifier_for_this.md index 9cb1015f53..1d206e5e80 100644 --- a/lang/cpp11/ref_qualifier_for_this.md +++ b/lang/cpp11/ref_qualifier_for_this.md @@ -1,4 +1,4 @@ -# メンバ関数の左辺値/右辺値修飾 +# メンバ関数の左辺値/右辺値修飾 [N2439] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/right_angle_brackets.md b/lang/cpp11/right_angle_brackets.md index bf510f32a1..51ce4ae734 100644 --- a/lang/cpp11/right_angle_brackets.md +++ b/lang/cpp11/right_angle_brackets.md @@ -1,4 +1,4 @@ -# テンプレートの右山カッコ +# テンプレートの右山カッコ [N1757] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/rvalue_ref_and_move_semantics.md b/lang/cpp11/rvalue_ref_and_move_semantics.md index 090492e43a..4a59d7ee48 100644 --- a/lang/cpp11/rvalue_ref_and_move_semantics.md +++ b/lang/cpp11/rvalue_ref_and_move_semantics.md @@ -1,4 +1,4 @@ -# 右辺値参照・ムーブセマンティクス +# 右辺値参照・ムーブセマンティクス [N2118] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/scoped_enum.md b/lang/cpp11/scoped_enum.md index d7ec1d4b9f..8c214254fe 100644 --- a/lang/cpp11/scoped_enum.md +++ b/lang/cpp11/scoped_enum.md @@ -1,4 +1,4 @@ -# スコープを持つ列挙型 +# スコープを持つ列挙型 [N2347] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/sfinae_expressions.md b/lang/cpp11/sfinae_expressions.md index 8526b91695..c87e8a5f9e 100644 --- a/lang/cpp11/sfinae_expressions.md +++ b/lang/cpp11/sfinae_expressions.md @@ -1,4 +1,4 @@ -# 任意の式によるSFINAE +# 任意の式によるSFINAE [N2634] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/static_assert.md b/lang/cpp11/static_assert.md index 64020c3b02..a7de6eaec4 100644 --- a/lang/cpp11/static_assert.md +++ b/lang/cpp11/static_assert.md @@ -1,4 +1,4 @@ -# コンパイル時アサート +# コンパイル時アサート [N1720] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/static_initialization_thread_safely.md b/lang/cpp11/static_initialization_thread_safely.md index 6f104e0503..c1a11b39a2 100644 --- a/lang/cpp11/static_initialization_thread_safely.md +++ b/lang/cpp11/static_initialization_thread_safely.md @@ -1,4 +1,4 @@ -# ブロックスコープを持つstatic変数初期化のスレッドセーフ化 +# ブロックスコープを持つstatic変数初期化のスレッドセーフ化 [N2660] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/thread_local_storage.md b/lang/cpp11/thread_local_storage.md index f4324385e6..66df732936 100644 --- a/lang/cpp11/thread_local_storage.md +++ b/lang/cpp11/thread_local_storage.md @@ -1,4 +1,4 @@ -# スレッドローカルストレージ +# スレッドローカルストレージ [N2659] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/trailing_return_types.md b/lang/cpp11/trailing_return_types.md index 6362c800a9..efee5fa5aa 100644 --- a/lang/cpp11/trailing_return_types.md +++ b/lang/cpp11/trailing_return_types.md @@ -1,4 +1,4 @@ -# 戻り値の型を後置する関数宣言構文 +# 戻り値の型を後置する関数宣言構文 [N2541] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/uniform_initialization.md b/lang/cpp11/uniform_initialization.md index 4a3e17a93c..5475183cf8 100644 --- a/lang/cpp11/uniform_initialization.md +++ b/lang/cpp11/uniform_initialization.md @@ -1,4 +1,4 @@ -# 一様初期化 +# 一様初期化 [N2672] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/unrestricted_unions.md b/lang/cpp11/unrestricted_unions.md index f8ce219d9f..afc3fa54a5 100644 --- a/lang/cpp11/unrestricted_unions.md +++ b/lang/cpp11/unrestricted_unions.md @@ -1,4 +1,4 @@ -# 共用体の制限解除 +# 共用体の制限解除 [N2544] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/user_defined_literals.md b/lang/cpp11/user_defined_literals.md index 167fd6c2cb..7d1c89ca11 100644 --- a/lang/cpp11/user_defined_literals.md +++ b/lang/cpp11/user_defined_literals.md @@ -1,4 +1,4 @@ -# ユーザー定義リテラル +# ユーザー定義リテラル [N2765] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/utf8_string_literals.md b/lang/cpp11/utf8_string_literals.md index b9dc4e996c..a1f8bd9d33 100644 --- a/lang/cpp11/utf8_string_literals.md +++ b/lang/cpp11/utf8_string_literals.md @@ -1,4 +1,4 @@ -# UTF-8文字列リテラル +# UTF-8文字列リテラル [N2442] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/variadic_macros.md b/lang/cpp11/variadic_macros.md index 7e191f9f3b..afa3077f50 100644 --- a/lang/cpp11/variadic_macros.md +++ b/lang/cpp11/variadic_macros.md @@ -1,4 +1,4 @@ -# 可変引数マクロ +# 可変引数マクロ [N1653] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp11/variadic_templates.md b/lang/cpp11/variadic_templates.md index 36185d6999..fdbabf6b1f 100644 --- a/lang/cpp11/variadic_templates.md +++ b/lang/cpp11/variadic_templates.md @@ -1,4 +1,4 @@ -# 可変引数テンプレート +# 可変引数テンプレート [N2242] * cpp11[meta cpp] ## 概要 diff --git a/lang/cpp14/binary_literals.md b/lang/cpp14/binary_literals.md index f9d4570446..b0860f37f3 100644 --- a/lang/cpp14/binary_literals.md +++ b/lang/cpp14/binary_literals.md @@ -1,4 +1,4 @@ -# 2進数リテラル +# 2進数リテラル [N3472] * cpp14[meta cpp] ## 概要 diff --git a/lang/cpp14/brace_elision_in_array_temporary_initialization.md b/lang/cpp14/brace_elision_in_array_temporary_initialization.md index 9b42e3fa06..41e8c36558 100644 --- a/lang/cpp14/brace_elision_in_array_temporary_initialization.md +++ b/lang/cpp14/brace_elision_in_array_temporary_initialization.md @@ -1,4 +1,4 @@ -# ネストする集成体初期化における波カッコ省略を許可 +# ネストする集成体初期化における波カッコ省略を許可 [N3653] * cpp14[meta cpp] ## 概要 diff --git a/lang/cpp14/deprecated_attr.md b/lang/cpp14/deprecated_attr.md index fbe530fa8c..3491ccfb9c 100644 --- a/lang/cpp14/deprecated_attr.md +++ b/lang/cpp14/deprecated_attr.md @@ -1,4 +1,4 @@ -# [[deprecated]]属性 +# [[deprecated]]属性 [N3760] * cpp14[meta cpp] ## 概要 diff --git a/lang/cpp14/digit_separators.md b/lang/cpp14/digit_separators.md index b7c8ca24c0..ac95c7c567 100644 --- a/lang/cpp14/digit_separators.md +++ b/lang/cpp14/digit_separators.md @@ -1,4 +1,4 @@ -# 数値リテラルの桁区切り文字 +# 数値リテラルの桁区切り文字 [N3781] * cpp14[meta cpp] ## 概要 diff --git a/lang/cpp14/generic_lambdas.md b/lang/cpp14/generic_lambdas.md index e27e08376a..d92b15b61d 100644 --- a/lang/cpp14/generic_lambdas.md +++ b/lang/cpp14/generic_lambdas.md @@ -1,4 +1,4 @@ -# ジェネリックラムダ +# ジェネリックラムダ [N3649] * cpp14[meta cpp] ## 概要 diff --git a/lang/cpp14/initialize_capture.md b/lang/cpp14/initialize_capture.md index e62d64b95f..4b984b47cb 100644 --- a/lang/cpp14/initialize_capture.md +++ b/lang/cpp14/initialize_capture.md @@ -1,4 +1,4 @@ -# ラムダ式の初期化キャプチャ +# ラムダ式の初期化キャプチャ [N3648] * cpp14[meta cpp] ## 概要 diff --git a/lang/cpp14/relaxing_constraints_on_constexpr.md b/lang/cpp14/relaxing_constraints_on_constexpr.md index 943cc064d7..c6d840d01d 100644 --- a/lang/cpp14/relaxing_constraints_on_constexpr.md +++ b/lang/cpp14/relaxing_constraints_on_constexpr.md @@ -1,4 +1,4 @@ -# constexprの制限緩和 +# constexprの制限緩和 [N3652] * cpp14[meta cpp] ## 概要 diff --git a/lang/cpp14/return_type_deduction_for_normal_functions.md b/lang/cpp14/return_type_deduction_for_normal_functions.md index 66f5caa619..f2434536c5 100644 --- a/lang/cpp14/return_type_deduction_for_normal_functions.md +++ b/lang/cpp14/return_type_deduction_for_normal_functions.md @@ -1,4 +1,4 @@ -# 通常関数の戻り値型推論 +# 通常関数の戻り値型推論 [N3638] * cpp14[meta cpp] ## 概要 diff --git a/lang/cpp14/sized_deallocation.md b/lang/cpp14/sized_deallocation.md index d2da7e97c7..1d130364df 100644 --- a/lang/cpp14/sized_deallocation.md +++ b/lang/cpp14/sized_deallocation.md @@ -1,4 +1,4 @@ -# サイズ付きデアロケーション +# サイズ付きデアロケーション [N3778] * cpp14[meta cpp] ## 概要 diff --git a/lang/cpp14/variable_templates.md b/lang/cpp14/variable_templates.md index c05a84e117..97cbadc517 100644 --- a/lang/cpp14/variable_templates.md +++ b/lang/cpp14/variable_templates.md @@ -1,4 +1,4 @@ -# 変数テンプレート +# 変数テンプレート [N3651] * cpp14[meta cpp] ## 概要 diff --git a/lang/cpp17.md b/lang/cpp17.md index 90d96f4ccf..06805f4c57 100644 --- a/lang/cpp17.md +++ b/lang/cpp17.md @@ -38,7 +38,7 @@ C++17以降、言語の策定にship train modelというリリース体制が | [参照メンバをもつクラスの置き換え](cpp17/replacement_of_class_objects_containing_reference_members.md) | 参照型メンバや`const`メンバ変数を含むクラスについてこれまで結果は未定義とされていた配置`new`によるオブジェクトの置き換えを条件付きで可能とする | | [`enum class`変数の初期値として整数を指定する際の規則を調整](cpp17/construction_enum_class_values.md) | キャストを使用することなく整数を初期値として使用し、`E e{0};`のような初期化を許可 | | [アライメント指定されたデータの動的メモリ確保](cpp17/dynamic_memory_allocation_for_over-aligned_data.md) | `operator new`と`operator delete`でアライメント値を取得できるようにする | -| [集成体初期化の拡張](cpp17/extension_to_aggregate_initialization.md) | 集成体初期化で基底クラスも入れ子に集成体初期化可能になる | +| [基底クラスのメンバ変数を集成体初期化するための波カッコを省略できるようにする](cpp17/extension_to_aggregate_initialization.md) | 基底クラスのメンバを集成体初期化するために、 `derived d {{42}};` の代わりに `derived d {42};` と書けるようにする | ### 制御構文 diff --git a/lang/cpp17/allow_constant_evaluation_for_all_non-type_template_arguments.md b/lang/cpp17/allow_constant_evaluation_for_all_non-type_template_arguments.md index aec3ca9b37..19f66f972b 100644 --- a/lang/cpp17/allow_constant_evaluation_for_all_non-type_template_arguments.md +++ b/lang/cpp17/allow_constant_evaluation_for_all_non-type_template_arguments.md @@ -1,4 +1,4 @@ -# 全ての非型テンプレート引数の定数式評価を許可 +# 全ての非型テンプレート引数の定数式評価を許可 [N4268] * cpp17[meta cpp] diff --git a/lang/cpp17/allow_typename_in_a_template_template_parameter.md b/lang/cpp17/allow_typename_in_a_template_template_parameter.md index c04f78fa55..e4dee187ae 100644 --- a/lang/cpp17/allow_typename_in_a_template_template_parameter.md +++ b/lang/cpp17/allow_typename_in_a_template_template_parameter.md @@ -1,4 +1,4 @@ -# テンプレートテンプレートパラメータにtypenameキーワードの使用を許可 +# テンプレートテンプレートパラメータにtypenameキーワードの使用を許可 [N4051] * cpp17[meta cpp] ## 概要 diff --git a/lang/cpp17/attributes_for_namespaces_and_enumerators.md b/lang/cpp17/attributes_for_namespaces_and_enumerators.md index ff3ed0cab5..78aee629be 100644 --- a/lang/cpp17/attributes_for_namespaces_and_enumerators.md +++ b/lang/cpp17/attributes_for_namespaces_and_enumerators.md @@ -1,4 +1,4 @@ -# 名前空間と列挙子への属性付加を許可 +# 名前空間と列挙子への属性付加を許可 [N4266] * cpp17[meta cpp] ## 概要 diff --git a/lang/cpp17/constexpr_lambda.md b/lang/cpp17/constexpr_lambda.md index 1f5ec0f3ae..f0ca914948 100644 --- a/lang/cpp17/constexpr_lambda.md +++ b/lang/cpp17/constexpr_lambda.md @@ -1,4 +1,4 @@ -# constexpr ラムダ +# constexpr ラムダ [P0170R1] * cpp17[meta cpp] diff --git a/lang/cpp17/construction_enum_class_values.md b/lang/cpp17/construction_enum_class_values.md index ba552450d4..b4e8f25891 100644 --- a/lang/cpp17/construction_enum_class_values.md +++ b/lang/cpp17/construction_enum_class_values.md @@ -1,4 +1,4 @@ -# enum class変数の初期値として整数を指定する際の規則を調整 +# enum class変数の初期値として整数を指定する際の規則を調整 [P0138R2] * cpp17[meta cpp] ## 概要 diff --git a/lang/cpp17/declaring_non-type_template_arguments_with_auto.md b/lang/cpp17/declaring_non-type_template_arguments_with_auto.md index 9a6d32a28a..e532dd3f09 100644 --- a/lang/cpp17/declaring_non-type_template_arguments_with_auto.md +++ b/lang/cpp17/declaring_non-type_template_arguments_with_auto.md @@ -1,4 +1,4 @@ -# 非型テンプレートパラメータのauto宣言 +# 非型テンプレートパラメータのauto宣言 [P0127R2] * cpp17[meta cpp] diff --git a/lang/cpp17/dynamic_memory_allocation_for_over-aligned_data.md b/lang/cpp17/dynamic_memory_allocation_for_over-aligned_data.md index 9be63837de..8a14b5487c 100644 --- a/lang/cpp17/dynamic_memory_allocation_for_over-aligned_data.md +++ b/lang/cpp17/dynamic_memory_allocation_for_over-aligned_data.md @@ -1,4 +1,4 @@ -# アライメント指定されたデータの動的メモリ確保 +# アライメント指定されたデータの動的メモリ確保 [P0035R4] * cpp17[meta cpp] ## 概要 diff --git a/lang/cpp17/exception_spec_be_part_of_the_type_system.md b/lang/cpp17/exception_spec_be_part_of_the_type_system.md index 9c9199ba1d..7be6cb8d9a 100644 --- a/lang/cpp17/exception_spec_be_part_of_the_type_system.md +++ b/lang/cpp17/exception_spec_be_part_of_the_type_system.md @@ -1,4 +1,4 @@ -# 例外仕様を型システムの一部にする +# 例外仕様を型システムの一部にする [P0012R1] * cpp17[meta cpp] ## 概要 diff --git a/lang/cpp17/expression_evaluation_order.md b/lang/cpp17/expression_evaluation_order.md index 0bdd872135..4fe26553c0 100644 --- a/lang/cpp17/expression_evaluation_order.md +++ b/lang/cpp17/expression_evaluation_order.md @@ -1,4 +1,4 @@ -# 厳密な式の評価順 +# 厳密な式の評価順 [P0145R3] * cpp17[meta cpp] ## 概要 diff --git a/lang/cpp17/extending_static_assert.md b/lang/cpp17/extending_static_assert.md index bb7f9744e5..8ae20ef828 100644 --- a/lang/cpp17/extending_static_assert.md +++ b/lang/cpp17/extending_static_assert.md @@ -1,4 +1,4 @@ -# static_assert のメッセージ省略を許可 +# static_assert のメッセージ省略を許可 [N3928] * cpp17[meta cpp] ## 概要 diff --git a/lang/cpp17/extension_to_aggregate_initialization.md b/lang/cpp17/extension_to_aggregate_initialization.md index d3648db384..f595a0b3ff 100644 --- a/lang/cpp17/extension_to_aggregate_initialization.md +++ b/lang/cpp17/extension_to_aggregate_initialization.md @@ -1,4 +1,4 @@ -# 集成体初期化の拡張 +# 基底クラスのメンバ変数を集成体初期化するための波カッコを省略できるようにする [P0017R1] * cpp17[meta cpp] diff --git a/lang/cpp17/fallthrough.md b/lang/cpp17/fallthrough.md index 5e3ecc0f48..eb8f4be434 100644 --- a/lang/cpp17/fallthrough.md +++ b/lang/cpp17/fallthrough.md @@ -1,4 +1,4 @@ -# [[fallthrough]]属性 +# [[fallthrough]]属性 [P0188R1] * cpp17[meta cpp] ## 概要 diff --git a/lang/cpp17/folding_expressions.md b/lang/cpp17/folding_expressions.md index 1a0b7f62b3..03ed8df24c 100644 --- a/lang/cpp17/folding_expressions.md +++ b/lang/cpp17/folding_expressions.md @@ -1,4 +1,4 @@ -# 畳み込み式 +# 畳み込み式 [N4295] * cpp17[meta cpp] ## 概要 diff --git a/lang/cpp17/generalizing_the_range-based_for_loop.md b/lang/cpp17/generalizing_the_range-based_for_loop.md index f08c7183b9..df1a379340 100644 --- a/lang/cpp17/generalizing_the_range-based_for_loop.md +++ b/lang/cpp17/generalizing_the_range-based_for_loop.md @@ -1,4 +1,4 @@ -# 範囲 for ループの制限緩和 +# 範囲 for ループの制限緩和 [P0184R0] * cpp17[meta cpp] ## 概要 diff --git a/lang/cpp17/guaranteed_copy_elision.md b/lang/cpp17/guaranteed_copy_elision.md index 620afa4ed2..5a96ad1c75 100644 --- a/lang/cpp17/guaranteed_copy_elision.md +++ b/lang/cpp17/guaranteed_copy_elision.md @@ -1,4 +1,4 @@ -# 値のコピー省略を保証 +# 値のコピー省略を保証 [P0135R1] * cpp17[meta cpp] diff --git a/lang/cpp17/has_include.md b/lang/cpp17/has_include.md index f1c370de76..8c4821ae7a 100644 --- a/lang/cpp17/has_include.md +++ b/lang/cpp17/has_include.md @@ -1,4 +1,4 @@ -# __has_include +# __has_include [P0061R1] * cpp17[meta cpp] ## 概要 diff --git a/lang/cpp17/hexadecimal_floating_literals.md b/lang/cpp17/hexadecimal_floating_literals.md index 4ff845fe7c..6515d12827 100644 --- a/lang/cpp17/hexadecimal_floating_literals.md +++ b/lang/cpp17/hexadecimal_floating_literals.md @@ -1,4 +1,4 @@ -# 十六進浮動小数点数リテラル +# 十六進浮動小数点数リテラル [P0245R1] * cpp17[meta cpp] * [mathjax enable] diff --git a/lang/cpp17/if_constexpr.md b/lang/cpp17/if_constexpr.md index 2b218c451e..4d528aedfe 100644 --- a/lang/cpp17/if_constexpr.md +++ b/lang/cpp17/if_constexpr.md @@ -1,4 +1,4 @@ -# constexpr if 文 +# constexpr if 文 [P0292R2] * cpp17[meta cpp] ## 概要 diff --git a/lang/cpp17/inline_variables.md b/lang/cpp17/inline_variables.md index ac00023678..f10059f8fd 100644 --- a/lang/cpp17/inline_variables.md +++ b/lang/cpp17/inline_variables.md @@ -1,4 +1,4 @@ -# インライン変数 +# インライン変数 [P0386R2] * cpp17[meta cpp] ## 概要 diff --git a/lang/cpp17/lambda_capture_of_this_by_value.md b/lang/cpp17/lambda_capture_of_this_by_value.md index 2f6b1b87c5..391681d8eb 100644 --- a/lang/cpp17/lambda_capture_of_this_by_value.md +++ b/lang/cpp17/lambda_capture_of_this_by_value.md @@ -1,4 +1,4 @@ -# ラムダ式での*thisのコピーキャプチャ +# ラムダ式での*thisのコピーキャプチャ [P0018R3] * cpp17[meta cpp] ## 概要 diff --git a/lang/cpp17/maybe_unused.md b/lang/cpp17/maybe_unused.md index b2ad194ce3..f04dbd6f8b 100644 --- a/lang/cpp17/maybe_unused.md +++ b/lang/cpp17/maybe_unused.md @@ -1,4 +1,4 @@ -# [[maybe_unused]]属性 +# [[maybe_unused]]属性 [P0212R1] * cpp17[meta cpp] ## 概要 diff --git a/lang/cpp17/nested_namespace.md b/lang/cpp17/nested_namespace.md index 20b67b9808..0fb30e022a 100644 --- a/lang/cpp17/nested_namespace.md +++ b/lang/cpp17/nested_namespace.md @@ -1,4 +1,4 @@ -# 入れ子名前空間の定義 +# 入れ子名前空間の定義 [N4230] * cpp17[meta cpp] ## 概要 diff --git a/lang/cpp17/new_rules_for_auto_deduction_from_braced-init-list.md b/lang/cpp17/new_rules_for_auto_deduction_from_braced-init-list.md index ec02c73af0..d457cf6ef2 100644 --- a/lang/cpp17/new_rules_for_auto_deduction_from_braced-init-list.md +++ b/lang/cpp17/new_rules_for_auto_deduction_from_braced-init-list.md @@ -1,4 +1,4 @@ -# 波括弧初期化の型推論の新規則 +# 波括弧初期化の型推論の新規則 [N3922] * cpp17[meta cpp] ## 概要 diff --git a/lang/cpp17/nodiscard.md b/lang/cpp17/nodiscard.md index ebdc0c1eab..2328e65a46 100644 --- a/lang/cpp17/nodiscard.md +++ b/lang/cpp17/nodiscard.md @@ -1,4 +1,4 @@ -# [[nodiscard]]属性 +# [[nodiscard]]属性 [P0189R1] * cpp17[meta cpp] ## 概要 diff --git a/lang/cpp17/non_standard_attributes.md b/lang/cpp17/non_standard_attributes.md index bcf4f8d76b..d93d20f322 100644 --- a/lang/cpp17/non_standard_attributes.md +++ b/lang/cpp17/non_standard_attributes.md @@ -1,4 +1,4 @@ -# 不明な属性を無視する +# 不明な属性を無視する [P0283R2] * cpp17[meta cpp] ## 概要 diff --git a/lang/cpp17/pack_expansions_in_using.md b/lang/cpp17/pack_expansions_in_using.md index e305c40bff..fcf3d40391 100644 --- a/lang/cpp17/pack_expansions_in_using.md +++ b/lang/cpp17/pack_expansions_in_using.md @@ -1,4 +1,4 @@ -# using宣言のパック展開 +# using宣言のパック展開 [P0195R2] * cpp17[meta cpp] ## 概要 diff --git a/lang/cpp17/remove_deprecated_exception_specifications.md b/lang/cpp17/remove_deprecated_exception_specifications.md index 1bcadfd2e2..253a54d7c7 100644 --- a/lang/cpp17/remove_deprecated_exception_specifications.md +++ b/lang/cpp17/remove_deprecated_exception_specifications.md @@ -1,4 +1,4 @@ -# 非推奨だった古い例外仕様を削除 +# 非推奨だった古い例外仕様を削除 [P0003R5] * cpp17[meta cpp] ## 概要 diff --git a/lang/cpp17/remove_deprecated_increment_of_bool.md b/lang/cpp17/remove_deprecated_increment_of_bool.md index fc4f690ab7..261ef394b5 100644 --- a/lang/cpp17/remove_deprecated_increment_of_bool.md +++ b/lang/cpp17/remove_deprecated_increment_of_bool.md @@ -1,4 +1,4 @@ -# 非推奨だった bool 型に対するインクリメント演算子を削除 +# 非推奨だった bool 型に対するインクリメント演算子を削除 [P0002R1] * cpp17[meta cpp] ## 概要 diff --git a/lang/cpp17/remove_deprecated_use_of_the_register_keyword.md b/lang/cpp17/remove_deprecated_use_of_the_register_keyword.md index 238790f2e0..a10725393c 100644 --- a/lang/cpp17/remove_deprecated_use_of_the_register_keyword.md +++ b/lang/cpp17/remove_deprecated_use_of_the_register_keyword.md @@ -1,4 +1,4 @@ -# 非推奨だったregisterキーワードを削除 +# 非推奨だったregisterキーワードを削除 [P0001R1] * cpp17[meta cpp] ## 概要 diff --git a/lang/cpp17/removing_trigraphs.md b/lang/cpp17/removing_trigraphs.md index 269fd37b7b..76051b646c 100644 --- a/lang/cpp17/removing_trigraphs.md +++ b/lang/cpp17/removing_trigraphs.md @@ -1,4 +1,4 @@ -# トライグラフの削除 +# トライグラフの削除 [N4086] * cpp17[meta cpp] ## 概要 diff --git a/lang/cpp17/replacement_of_class_objects_containing_reference_members.md b/lang/cpp17/replacement_of_class_objects_containing_reference_members.md index ecf1f23c2d..4ea19fb20d 100644 --- a/lang/cpp17/replacement_of_class_objects_containing_reference_members.md +++ b/lang/cpp17/replacement_of_class_objects_containing_reference_members.md @@ -1,4 +1,4 @@ -# 参照メンバをもつクラスの置き換え +# 参照メンバをもつクラスの置き換え [P0137R1] * cpp17[meta cpp] ## 概要 diff --git a/lang/cpp17/selection_statements_with_initializer.md b/lang/cpp17/selection_statements_with_initializer.md index 0039fe4b8a..da175269d3 100644 --- a/lang/cpp17/selection_statements_with_initializer.md +++ b/lang/cpp17/selection_statements_with_initializer.md @@ -1,4 +1,4 @@ -# if文とswitch文の条件式と初期化を分離 +# if文とswitch文の条件式と初期化を分離 [P0305R1] * cpp17[meta cpp] ## 概要 diff --git a/lang/cpp17/structured_bindings.md b/lang/cpp17/structured_bindings.md index 6dc9d99714..9d9184fe2f 100644 --- a/lang/cpp17/structured_bindings.md +++ b/lang/cpp17/structured_bindings.md @@ -1,4 +1,4 @@ -# 構造化束縛 +# 構造化束縛 [P0217R3] * cpp17[meta cpp] ## 概要 diff --git a/lang/cpp17/type_deduction_for_class_templates.md b/lang/cpp17/type_deduction_for_class_templates.md index a7036694dc..ce3f0a7e88 100644 --- a/lang/cpp17/type_deduction_for_class_templates.md +++ b/lang/cpp17/type_deduction_for_class_templates.md @@ -1,4 +1,4 @@ -# クラステンプレートのテンプレート引数推論 +# クラステンプレートのテンプレート引数推論 [P0091R3] * cpp17[meta cpp] ## 概要 diff --git a/lang/cpp17/using_attribute_namespaces.md b/lang/cpp17/using_attribute_namespaces.md index 4c755f8725..bfc96aaa46 100644 --- a/lang/cpp17/using_attribute_namespaces.md +++ b/lang/cpp17/using_attribute_namespaces.md @@ -1,4 +1,4 @@ -# 属性の名前空間指定に繰り返しをなくす +# 属性の名前空間指定に繰り返しをなくす [P0028R4] * cpp17[meta cpp] ## 概要 diff --git a/lang/cpp17/utf8_character_literals.md b/lang/cpp17/utf8_character_literals.md index 7c93dac3e5..479966b3ec 100644 --- a/lang/cpp17/utf8_character_literals.md +++ b/lang/cpp17/utf8_character_literals.md @@ -1,4 +1,4 @@ -# UTF-8文字リテラル +# UTF-8文字リテラル [N4267] * cpp17[meta cpp] ## 概要 diff --git a/lang/cpp20/access_checking_on_specializations.md b/lang/cpp20/access_checking_on_specializations.md index fb23dfe799..def88c4282 100644 --- a/lang/cpp20/access_checking_on_specializations.md +++ b/lang/cpp20/access_checking_on_specializations.md @@ -1,4 +1,4 @@ -# 特殊化のアクセスチェック +# 特殊化のアクセスチェック [P0692R1] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/adl_and_function_templates_that_are_not_visible.md b/lang/cpp20/adl_and_function_templates_that_are_not_visible.md index 0854827db4..ceb421b9b3 100644 --- a/lang/cpp20/adl_and_function_templates_that_are_not_visible.md +++ b/lang/cpp20/adl_and_function_templates_that_are_not_visible.md @@ -1,4 +1,4 @@ -# 関数テンプレートに明示的に型指定した場合にADLで見つからない問題を修正 +# 関数テンプレートに明示的に型指定した場合にADLで見つからない問題を修正 [P0846R0] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/allow_initializing_aggregates_from_a_parenthesized_list_of_values.md b/lang/cpp20/allow_initializing_aggregates_from_a_parenthesized_list_of_values.md index e643696d06..91b855942a 100644 --- a/lang/cpp20/allow_initializing_aggregates_from_a_parenthesized_list_of_values.md +++ b/lang/cpp20/allow_initializing_aggregates_from_a_parenthesized_list_of_values.md @@ -1,4 +1,4 @@ -# 丸カッコの値リストからの集成体初期化を許可 +# 丸カッコの値リストからの集成体初期化を許可 [P0960R3] * cpp20[meta cpp] diff --git a/lang/cpp20/allow_lambda_capture_equal_this.md b/lang/cpp20/allow_lambda_capture_equal_this.md index 58a60e79df..715e4dbadf 100644 --- a/lang/cpp20/allow_lambda_capture_equal_this.md +++ b/lang/cpp20/allow_lambda_capture_equal_this.md @@ -1,4 +1,4 @@ -# ラムダ式のキャプチャとして[=, this]を許可する +# ラムダ式のキャプチャとして[=, this]を許可する [P0409R2] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/allow_pack_expansion_in_lambda_init_capture.md b/lang/cpp20/allow_pack_expansion_in_lambda_init_capture.md index 4fb0076d62..eaf47d8df3 100644 --- a/lang/cpp20/allow_pack_expansion_in_lambda_init_capture.md +++ b/lang/cpp20/allow_pack_expansion_in_lambda_init_capture.md @@ -1,4 +1,4 @@ -# ラムダ式の初期化キャプチャでのパック展開を許可 +# ラムダ式の初期化キャプチャでのパック展開を許可 [P0780R2] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/allow_structured_bindings_to_accessible_members.md b/lang/cpp20/allow_structured_bindings_to_accessible_members.md index 8568f6a9e4..a66e450c03 100644 --- a/lang/cpp20/allow_structured_bindings_to_accessible_members.md +++ b/lang/cpp20/allow_structured_bindings_to_accessible_members.md @@ -1,4 +1,4 @@ -# friend指定された関数内から構造化束縛を使用して非公開メンバ変数にアクセスすることを許可 +# friend指定された関数内から構造化束縛を使用して非公開メンバ変数にアクセスすることを許可 [P0969R0] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/allow_virtual_function_calls_in_constant_expressions.md b/lang/cpp20/allow_virtual_function_calls_in_constant_expressions.md index 8bbe3cee90..8f9620e9b6 100644 --- a/lang/cpp20/allow_virtual_function_calls_in_constant_expressions.md +++ b/lang/cpp20/allow_virtual_function_calls_in_constant_expressions.md @@ -1,4 +1,4 @@ -# 定数式からの仮想関数の呼び出しを許可 +# 定数式からの仮想関数の呼び出しを許可 [P1064R0] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/allowing_dynamic_cast_polymorphic_typeid_in_constant_expressions.md b/lang/cpp20/allowing_dynamic_cast_polymorphic_typeid_in_constant_expressions.md index 26f0b526f7..71a567688d 100644 --- a/lang/cpp20/allowing_dynamic_cast_polymorphic_typeid_in_constant_expressions.md +++ b/lang/cpp20/allowing_dynamic_cast_polymorphic_typeid_in_constant_expressions.md @@ -1,4 +1,4 @@ -# 定数式での`dynamic_cast`、多態的な`typeid`を許可 +# 定数式での`dynamic_cast`、多態的な`typeid`を許可 [P1327R1] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/array_size_deduction_in_new-expressions.md b/lang/cpp20/array_size_deduction_in_new-expressions.md index 9916a0ea47..caa300bfa1 100644 --- a/lang/cpp20/array_size_deduction_in_new-expressions.md +++ b/lang/cpp20/array_size_deduction_in_new-expressions.md @@ -1,4 +1,4 @@ -# new式での配列要素数の推論 +# new式での配列要素数の推論 [P1009R2] * cpp20[meta cpp] diff --git a/lang/cpp20/changing_the_active_member_of_a_union_inside_constexpr.md b/lang/cpp20/changing_the_active_member_of_a_union_inside_constexpr.md index 96cfa1b726..333be083c8 100644 --- a/lang/cpp20/changing_the_active_member_of_a_union_inside_constexpr.md +++ b/lang/cpp20/changing_the_active_member_of_a_union_inside_constexpr.md @@ -1,4 +1,4 @@ -# 定数式内での共用体のアクティブメンバの変更を許可 +# 定数式内での共用体のアクティブメンバの変更を許可 [P1330R0] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/char8_t.md b/lang/cpp20/char8_t.md index 2d412d3fd8..68fb50beb6 100644 --- a/lang/cpp20/char8_t.md +++ b/lang/cpp20/char8_t.md @@ -1,4 +1,4 @@ -# UTF-8エンコーディングされた文字の型として`char8_t`を追加 +# UTF-8エンコーディングされた文字の型として`char8_t`を追加 [P0482R6] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/checking_for_abstract_class_types.md b/lang/cpp20/checking_for_abstract_class_types.md index cf8b4f5727..e4000dd54c 100644 --- a/lang/cpp20/checking_for_abstract_class_types.md +++ b/lang/cpp20/checking_for_abstract_class_types.md @@ -1,4 +1,4 @@ -# 抽象型のチェック +# 抽象型のチェック [P0929R2] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/class_template_argument_deduction_for_aggregates.md b/lang/cpp20/class_template_argument_deduction_for_aggregates.md index 87ebb8287f..21fd47e947 100644 --- a/lang/cpp20/class_template_argument_deduction_for_aggregates.md +++ b/lang/cpp20/class_template_argument_deduction_for_aggregates.md @@ -1,4 +1,4 @@ -# 集成体クラステンプレートのテンプレート引数推論 +# 集成体クラステンプレートのテンプレート引数推論 [P1816R0] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/class_template_argument_deduction_for_alias_templates.md b/lang/cpp20/class_template_argument_deduction_for_alias_templates.md index 4fdc9b8438..9eccf5faf5 100644 --- a/lang/cpp20/class_template_argument_deduction_for_alias_templates.md +++ b/lang/cpp20/class_template_argument_deduction_for_alias_templates.md @@ -1,4 +1,4 @@ -# エイリアステンプレート経由でのクラステンプレートのテンプレート引数推論 +# エイリアステンプレート経由でのクラステンプレートのテンプレート引数推論 [P1814R0] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/class_types_in_non-type_template_parameters.md b/lang/cpp20/class_types_in_non-type_template_parameters.md index c44d566f7c..eea126fa7f 100644 --- a/lang/cpp20/class_types_in_non-type_template_parameters.md +++ b/lang/cpp20/class_types_in_non-type_template_parameters.md @@ -1,4 +1,4 @@ -# 非型テンプレートパラメータとしてクラス型を許可する +# 非型テンプレートパラメータとしてクラス型を許可する [P0732R2] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/concepts.md b/lang/cpp20/concepts.md index 77d6a159f1..340bd7dc93 100644 --- a/lang/cpp20/concepts.md +++ b/lang/cpp20/concepts.md @@ -1,4 +1,4 @@ -# コンセプト +# コンセプト [P0734R0] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/consistent_comparison.md b/lang/cpp20/consistent_comparison.md index dc9123b0b2..53209f1cd7 100644 --- a/lang/cpp20/consistent_comparison.md +++ b/lang/cpp20/consistent_comparison.md @@ -1,4 +1,4 @@ -# 一貫比較 +# 一貫比較 [P0515R3] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/constinit.md b/lang/cpp20/constinit.md index 343186f49a..82f66caeb7 100644 --- a/lang/cpp20/constinit.md +++ b/lang/cpp20/constinit.md @@ -1,4 +1,4 @@ -# コンパイル時初期化を強制する`constinit`キーワードを追加 +# コンパイル時初期化を強制する`constinit`キーワードを追加 [P1143R2] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/converting_from_pointer_to_bool_should_be_considered_narrowing.md b/lang/cpp20/converting_from_pointer_to_bool_should_be_considered_narrowing.md index 2df22bf8c0..0cf4402aa1 100644 --- a/lang/cpp20/converting_from_pointer_to_bool_should_be_considered_narrowing.md +++ b/lang/cpp20/converting_from_pointer_to_bool_should_be_considered_narrowing.md @@ -1,4 +1,4 @@ -# ポインタから`bool`への変換を縮小変換とする +# ポインタから`bool`への変換を縮小変換とする [P1957R2] * cpp20[meta cpp] ## 概要 @@ -64,4 +64,4 @@ std::variant v = b[1]; // boolを保持して構築 - [P1957R2 Converting from `T*` to `bool` should be considered narrowing (re: US 212)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1957r2.html) - [LWG Issue 3228. Surprising `variant` construction](https://cplusplus.github.io/LWG/issue3228) -- [P0608R3 A sane `variant` converting constructor](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0608r3.html) \ No newline at end of file +- [P0608R3 A sane `variant` converting constructor](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0608r3.html) diff --git a/lang/cpp20/coroutines.md b/lang/cpp20/coroutines.md index 133f5dce0a..cc7d161e04 100644 --- a/lang/cpp20/coroutines.md +++ b/lang/cpp20/coroutines.md @@ -1,4 +1,4 @@ -# コルーチン +# コルーチン [P0912R5] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/default_constructible_and_assignable_stateless_lambdas.md b/lang/cpp20/default_constructible_and_assignable_stateless_lambdas.md index 54c60d3ce0..1420fbd9f6 100644 --- a/lang/cpp20/default_constructible_and_assignable_stateless_lambdas.md +++ b/lang/cpp20/default_constructible_and_assignable_stateless_lambdas.md @@ -1,4 +1,4 @@ -# 状態を持たないラムダ式を、デフォルト構築可能、代入可能とする +# 状態を持たないラムダ式を、デフォルト構築可能、代入可能とする [P0624R2] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/default_member_initializers_for_bit_fields.md b/lang/cpp20/default_member_initializers_for_bit_fields.md index 71f625e646..b4edb5594a 100644 --- a/lang/cpp20/default_member_initializers_for_bit_fields.md +++ b/lang/cpp20/default_member_initializers_for_bit_fields.md @@ -1,4 +1,4 @@ -# ビットフィールドのメンバ変数初期化 +# ビットフィールドのメンバ変数初期化 [P0683R1] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/deprecate_implicit_capture_of_this_via_defcopy.md b/lang/cpp20/deprecate_implicit_capture_of_this_via_defcopy.md index c557cb099b..412554fab2 100644 --- a/lang/cpp20/deprecate_implicit_capture_of_this_via_defcopy.md +++ b/lang/cpp20/deprecate_implicit_capture_of_this_via_defcopy.md @@ -1,4 +1,4 @@ -# [=]によるthisの暗黙のキャプチャを非推奨化 +# [=]によるthisの暗黙のキャプチャを非推奨化 [P0806R2] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/deprecate_pod.md b/lang/cpp20/deprecate_pod.md index b0a96eda1e..f0550541c8 100644 --- a/lang/cpp20/deprecate_pod.md +++ b/lang/cpp20/deprecate_pod.md @@ -1,4 +1,4 @@ -# PODを非推奨化 +# PODを非推奨化 [P0767R1] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/deprecate_uses_of_the_comma_operator_in_subscripting_expressions.md b/lang/cpp20/deprecate_uses_of_the_comma_operator_in_subscripting_expressions.md index 46440463d0..b85ae365f7 100644 --- a/lang/cpp20/deprecate_uses_of_the_comma_operator_in_subscripting_expressions.md +++ b/lang/cpp20/deprecate_uses_of_the_comma_operator_in_subscripting_expressions.md @@ -1,4 +1,4 @@ -# 添字演算子内でのカンマ演算子の使用を非推奨化 +# 添字演算子内でのカンマ演算子の使用を非推奨化 [P1161R3] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/deprecating_volatile.md b/lang/cpp20/deprecating_volatile.md index 92c5e983fb..484101b073 100644 --- a/lang/cpp20/deprecating_volatile.md +++ b/lang/cpp20/deprecating_volatile.md @@ -1,4 +1,4 @@ -# ほとんどの`volatile`を非推奨化 +# ほとんどの`volatile`を非推奨化 [P1152R4] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/designated_initialization.md b/lang/cpp20/designated_initialization.md index 46ba380d3c..21eb9b3388 100644 --- a/lang/cpp20/designated_initialization.md +++ b/lang/cpp20/designated_initialization.md @@ -1,4 +1,4 @@ -# 指示付き初期化 +# 指示付き初期化 [P0329R4] * cpp20[meta cpp] diff --git a/lang/cpp20/down_with_typename.md b/lang/cpp20/down_with_typename.md index 4f956646ea..7d86fa8985 100644 --- a/lang/cpp20/down_with_typename.md +++ b/lang/cpp20/down_with_typename.md @@ -1,4 +1,4 @@ -# 型の文脈でtypenameの省略を許可 +# 型の文脈でtypenameの省略を許可 [P0634R3] * cpp20[meta cpp] diff --git a/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md b/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md index 2d16ae931f..246e37c9a1 100644 --- a/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md +++ b/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md @@ -1,4 +1,4 @@ -# 可変長データを扱うクラスの効率的な`delete` +# 可変長データを扱うクラスの効率的なdelete [P0722R3] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.md b/lang/cpp20/enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.md index 69f5924435..2a996c7516 100644 --- a/lang/cpp20/enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.md +++ b/lang/cpp20/enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.md @@ -1,4 +1,4 @@ -# constexpr関数内で未評価のインラインアセンブリを許可することによる組み込み関数のconstexpr有効化 +# constexpr関数内で未評価のインラインアセンブリを許可することによる組み込み関数のconstexpr有効化 [P1668R1] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/explicit_bool.md b/lang/cpp20/explicit_bool.md index 1981098fda..344d574f9e 100644 --- a/lang/cpp20/explicit_bool.md +++ b/lang/cpp20/explicit_bool.md @@ -1,4 +1,4 @@ -# 関数を条件付きでexplicitにする構文を追加 +# 関数を条件付きでexplicitにする構文を追加 [P0892R2] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/extending_structured_bindings_to_be_more_like_variable_declarations.md b/lang/cpp20/extending_structured_bindings_to_be_more_like_variable_declarations.md index 75c5dbe23e..ae1d35a1e8 100644 --- a/lang/cpp20/extending_structured_bindings_to_be_more_like_variable_declarations.md +++ b/lang/cpp20/extending_structured_bindings_to_be_more_like_variable_declarations.md @@ -1,4 +1,4 @@ -# 構造化束縛を拡張して通常の変数宣言のように使用できるようにする +# 構造化束縛を拡張して通常の変数宣言のように使用できるようにする [P1091R3] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/familiar_template_syntax_for_generic_lambdas.md b/lang/cpp20/familiar_template_syntax_for_generic_lambdas.md index 8cf5bea35f..1e91bb228d 100644 --- a/lang/cpp20/familiar_template_syntax_for_generic_lambdas.md +++ b/lang/cpp20/familiar_template_syntax_for_generic_lambdas.md @@ -1,4 +1,4 @@ -# ジェネリックラムダのテンプレート構文 +# ジェネリックラムダのテンプレート構文 [P0428R2] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/fixing_const_qualified_pointers_to_members.md b/lang/cpp20/fixing_const_qualified_pointers_to_members.md index b0aa89c665..e5781123ae 100644 --- a/lang/cpp20/fixing_const_qualified_pointers_to_members.md +++ b/lang/cpp20/fixing_const_qualified_pointers_to_members.md @@ -1,4 +1,4 @@ -# const修飾されたメンバポインタの制限を修正 +# const修飾されたメンバポインタの制限を修正 [P0704R1] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/immediate_functions.md b/lang/cpp20/immediate_functions.md index c0b8a9c570..94dc248583 100644 --- a/lang/cpp20/immediate_functions.md +++ b/lang/cpp20/immediate_functions.md @@ -1,4 +1,4 @@ -# 即時関数 +# 即時関数 [P1073R3] * cpp20[meta cpp] diff --git a/lang/cpp20/language_support_for_empty_objects.md b/lang/cpp20/language_support_for_empty_objects.md index 6901d033c5..14d3c4804f 100644 --- a/lang/cpp20/language_support_for_empty_objects.md +++ b/lang/cpp20/language_support_for_empty_objects.md @@ -1,4 +1,4 @@ -# 空オブジェクトに対する最適化を支援する属性[[no_unique_address]] +# 空オブジェクトに対する最適化を支援する属性[[no_unique_address]] [P0840R2] * cpp20[meta cpp] diff --git a/lang/cpp20/less_eager_instantiation_of_constexpr_functions.md b/lang/cpp20/less_eager_instantiation_of_constexpr_functions.md index f9059335c7..f1fc80c787 100644 --- a/lang/cpp20/less_eager_instantiation_of_constexpr_functions.md +++ b/lang/cpp20/less_eager_instantiation_of_constexpr_functions.md @@ -1,4 +1,4 @@ -# 評価されない文脈での定数式評価によって特殊メンバ関数がインスタンス化されることを規定 +# 評価されない文脈での定数式評価によって特殊メンバ関数がインスタンス化されることを規定 [P0859R0] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/likely_and_unlikely_attributes.md b/lang/cpp20/likely_and_unlikely_attributes.md index 378e98ad66..78625c5381 100644 --- a/lang/cpp20/likely_and_unlikely_attributes.md +++ b/lang/cpp20/likely_and_unlikely_attributes.md @@ -1,4 +1,4 @@ -# 確率が高い分岐と低い分岐を伝える属性 [[likely]], [[unlikely]] +# 確率が高い分岐と低い分岐を伝える属性 [[likely]], [[unlikely]] [P0479R5] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/make_char16t_char32t_string_literals_be_utf16_32.md b/lang/cpp20/make_char16t_char32t_string_literals_be_utf16_32.md index 70c64443d2..0ea8e2d7b5 100644 --- a/lang/cpp20/make_char16t_char32t_string_literals_be_utf16_32.md +++ b/lang/cpp20/make_char16t_char32t_string_literals_be_utf16_32.md @@ -1,4 +1,4 @@ -# char16_tとchar32_tの文字・文字列リテラルを、文字コードUTF-16/32に規定 +# char16_tとchar32_tの文字・文字列リテラルを、文字コードUTF-16/32に規定 [P1041R4] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/modules.md b/lang/cpp20/modules.md index dd9cf2a311..7bcd78598b 100644 --- a/lang/cpp20/modules.md +++ b/lang/cpp20/modules.md @@ -1,4 +1,4 @@ -# モジュール +# モジュール [P1103R3] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/more_constexpr_containers.md b/lang/cpp20/more_constexpr_containers.md index 78d291f097..98cd1f0867 100644 --- a/lang/cpp20/more_constexpr_containers.md +++ b/lang/cpp20/more_constexpr_containers.md @@ -1,4 +1,4 @@ -# 可変サイズをもつコンテナのconstexpr化 +# 可変サイズをもつコンテナのconstexpr化 [P0784R7] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/nested_inline_mamespaces.md b/lang/cpp20/nested_inline_mamespaces.md index 759e6553ac..7b91ac6dd1 100644 --- a/lang/cpp20/nested_inline_mamespaces.md +++ b/lang/cpp20/nested_inline_mamespaces.md @@ -1,4 +1,4 @@ -# 入れ子名前空間定義でのインライン名前空間 +# 入れ子名前空間定義でのインライン名前空間 [P1094R2] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/nodiscard_should_have_a_reason.md b/lang/cpp20/nodiscard_should_have_a_reason.md index f878d2e223..8f8d86e37a 100644 --- a/lang/cpp20/nodiscard_should_have_a_reason.md +++ b/lang/cpp20/nodiscard_should_have_a_reason.md @@ -1,4 +1,4 @@ -# [[nodiscard]]属性に理由となる文字列を付加できるようにする +# [[nodiscard]]属性に理由となる文字列を付加できるようにする [P1301R4] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/permit_conversions_to_arrays_of_unknown_bound.md b/lang/cpp20/permit_conversions_to_arrays_of_unknown_bound.md index b540cc2b15..cf3a5780c1 100644 --- a/lang/cpp20/permit_conversions_to_arrays_of_unknown_bound.md +++ b/lang/cpp20/permit_conversions_to_arrays_of_unknown_bound.md @@ -1,4 +1,4 @@ -# 要素数不明の配列への変換を許可 +# 要素数不明の配列への変換を許可 [P0388R4] * cpp20[meta cpp] diff --git a/lang/cpp20/permitting_trivial_default_initialization_in_constexpr_contexts.md b/lang/cpp20/permitting_trivial_default_initialization_in_constexpr_contexts.md index d25f9c7fe6..268c00f4cd 100644 --- a/lang/cpp20/permitting_trivial_default_initialization_in_constexpr_contexts.md +++ b/lang/cpp20/permitting_trivial_default_initialization_in_constexpr_contexts.md @@ -1,4 +1,4 @@ -# constexpr関数内でのトリビアルなデフォルト初期化を許可 +# constexpr関数内でのトリビアルなデフォルト初期化を許可 [P1331R2] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/prohibit_aggregates_with_user-declared_constructors.md b/lang/cpp20/prohibit_aggregates_with_user-declared_constructors.md index d1a57ce805..5c638117e3 100644 --- a/lang/cpp20/prohibit_aggregates_with_user-declared_constructors.md +++ b/lang/cpp20/prohibit_aggregates_with_user-declared_constructors.md @@ -1,4 +1,4 @@ -# ユーザー宣言したコンストラクタを持つクラスの集成体初期化を禁止 +# ユーザー宣言したコンストラクタを持つクラスの集成体初期化を禁止 [P1008R1] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/range-based_for_statements_with_initializer.md b/lang/cpp20/range-based_for_statements_with_initializer.md index 33db92eb7d..af28928cc6 100644 --- a/lang/cpp20/range-based_for_statements_with_initializer.md +++ b/lang/cpp20/range-based_for_statements_with_initializer.md @@ -1,4 +1,4 @@ -# 初期化式をともなう範囲for文 +# 初期化式をともなう範囲for文 [P0614R1] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/reference_capture_of_structured_bindings.md b/lang/cpp20/reference_capture_of_structured_bindings.md index 25230502c5..6c436a215c 100644 --- a/lang/cpp20/reference_capture_of_structured_bindings.md +++ b/lang/cpp20/reference_capture_of_structured_bindings.md @@ -1,4 +1,4 @@ -# 構造化束縛した変数の参照キャプチャを許可 +# 構造化束縛した変数の参照キャプチャを許可 [P1381R1] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/relaxing_the_range_for_loop_customization_point_finding_rules.md b/lang/cpp20/relaxing_the_range_for_loop_customization_point_finding_rules.md index a70582faf2..f1dc654f89 100644 --- a/lang/cpp20/relaxing_the_range_for_loop_customization_point_finding_rules.md +++ b/lang/cpp20/relaxing_the_range_for_loop_customization_point_finding_rules.md @@ -1,4 +1,4 @@ -# 範囲for文がカスタマイゼーションポイントを見つけるルールを緩和 +# 範囲for文がカスタマイゼーションポイントを見つけるルールを緩和 [P0962R1] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/relaxing_the_structured_bindings_customization_point_finding_rules.md b/lang/cpp20/relaxing_the_structured_bindings_customization_point_finding_rules.md index e5a9bef4a8..85607bc22e 100644 --- a/lang/cpp20/relaxing_the_structured_bindings_customization_point_finding_rules.md +++ b/lang/cpp20/relaxing_the_structured_bindings_customization_point_finding_rules.md @@ -1,4 +1,4 @@ -# 構造化束縛がカスタマイゼーションポイントを見つけるルールを緩和 +# 構造化束縛がカスタマイゼーションポイントを見つけるルールを緩和 [P0961R1] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/resolving_const_mismatch_with_defaulted_copy_constructor.md b/lang/cpp20/resolving_const_mismatch_with_defaulted_copy_constructor.md index 3e7fc3e37e..06ff7ff03b 100644 --- a/lang/cpp20/resolving_const_mismatch_with_defaulted_copy_constructor.md +++ b/lang/cpp20/resolving_const_mismatch_with_defaulted_copy_constructor.md @@ -1,4 +1,4 @@ -# デフォルトのコピーコンストラクタと非constなコンストラクタが衝突する問題を修正 +# デフォルトのコピーコンストラクタと非constなコンストラクタが衝突する問題を修正 [P0641R2] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/signed_integers_are_twos_complement.md b/lang/cpp20/signed_integers_are_twos_complement.md index 125151a46d..68606c12e9 100644 --- a/lang/cpp20/signed_integers_are_twos_complement.md +++ b/lang/cpp20/signed_integers_are_twos_complement.md @@ -1,4 +1,4 @@ -# 符号付き整数型が2の補数表現であることを規定 +# 符号付き整数型が2の補数表現であることを規定 [P1236R1] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/simplifying_implicit_lambda_capture.md b/lang/cpp20/simplifying_implicit_lambda_capture.md index 0b54668fdc..9e7e3eae00 100644 --- a/lang/cpp20/simplifying_implicit_lambda_capture.md +++ b/lang/cpp20/simplifying_implicit_lambda_capture.md @@ -1,4 +1,4 @@ -# 暗黙のラムダキャプチャを簡略化 +# 暗黙のラムダキャプチャを簡略化 [P0588R1] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/try-catch_blocks_in_constexpr_functions.md b/lang/cpp20/try-catch_blocks_in_constexpr_functions.md index 4079a64a87..c33558df50 100644 --- a/lang/cpp20/try-catch_blocks_in_constexpr_functions.md +++ b/lang/cpp20/try-catch_blocks_in_constexpr_functions.md @@ -1,4 +1,4 @@ -# constexpr関数内でのtry-catchブロックを許可 +# constexpr関数内でのtry-catchブロックを許可 [P1002R1] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/using_enum.md b/lang/cpp20/using_enum.md index c4e4240855..cde6bcb744 100644 --- a/lang/cpp20/using_enum.md +++ b/lang/cpp20/using_enum.md @@ -1,4 +1,4 @@ -# スコープ付き列挙型のusing宣言 +# スコープ付き列挙型のusing宣言 [P1099R5] * cpp20[meta cpp] diff --git a/lang/cpp20/va_opt.md b/lang/cpp20/va_opt.md index dcf82ce2d2..d0e2d13f5b 100644 --- a/lang/cpp20/va_opt.md +++ b/lang/cpp20/va_opt.md @@ -1,4 +1,4 @@ -# 可変引数が空でない場合のトークン置換 +# 可変引数が空でない場合のトークン置換 [P0306R4] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp20/wording_for_lambdas_in_unevaluated_contexts.md b/lang/cpp20/wording_for_lambdas_in_unevaluated_contexts.md index 91a11fb102..fec2f2ee66 100644 --- a/lang/cpp20/wording_for_lambdas_in_unevaluated_contexts.md +++ b/lang/cpp20/wording_for_lambdas_in_unevaluated_contexts.md @@ -1,4 +1,4 @@ -# 評価されない文脈でのラムダ式 +# 評価されない文脈でのラムダ式 [P0315R4] * cpp20[meta cpp] ## 概要 diff --git a/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md b/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md index b7881a9b67..24606375ab 100644 --- a/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md +++ b/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md @@ -1,4 +1,4 @@ -# elif/elifdef/elifndefのサポートを追加 +# elif/elifdef/elifndefのサポートを追加 [P2334R1] * cpp23[meta cpp] ## 概要 diff --git a/lang/cpp23/attributes_on_lambda_expressions.md b/lang/cpp23/attributes_on_lambda_expressions.md index 8c78b4065f..30cd03e4b9 100644 --- a/lang/cpp23/attributes_on_lambda_expressions.md +++ b/lang/cpp23/attributes_on_lambda_expressions.md @@ -1,4 +1,4 @@ -# ラムダ式に対する属性 +# ラムダ式に対する属性 [P2173R1] * cpp23[meta cpp] ## 概要 diff --git a/lang/cpp23/character_encoding_of_diagnostic_text.md b/lang/cpp23/character_encoding_of_diagnostic_text.md index c47a366e73..53dfff304d 100644 --- a/lang/cpp23/character_encoding_of_diagnostic_text.md +++ b/lang/cpp23/character_encoding_of_diagnostic_text.md @@ -1,4 +1,4 @@ -# 静的な診断メッセージの文字エンコーディング +# 静的な診断メッセージの文字エンコーディング [P2246R1] * cpp23[meta cpp] ## 概要 diff --git a/lang/cpp23/class_template_argument_deduction_from_inherited.md b/lang/cpp23/class_template_argument_deduction_from_inherited.md index db16325035..ba94fb0f2c 100644 --- a/lang/cpp23/class_template_argument_deduction_from_inherited.md +++ b/lang/cpp23/class_template_argument_deduction_from_inherited.md @@ -1,4 +1,4 @@ -# 継承コンストラクタからのクラステンプレート引数の推論 +# 継承コンストラクタからのクラステンプレート引数の推論 [P2582R1] * cpp23[meta cpp] ## 概要 diff --git a/lang/cpp23/consistent_character_literal_encoding.md b/lang/cpp23/consistent_character_literal_encoding.md index d21dc25147..17106dec61 100644 --- a/lang/cpp23/consistent_character_literal_encoding.md +++ b/lang/cpp23/consistent_character_literal_encoding.md @@ -1,4 +1,4 @@ -# 文字リテラルエンコーディングを一貫させる +# 文字リテラルエンコーディングを一貫させる [P2316R2] * cpp23[meta cpp] ## 概要 diff --git a/lang/cpp23/consteval_needs_to_propagate_up.md b/lang/cpp23/consteval_needs_to_propagate_up.md index 5800006e9e..8f7b945f1f 100644 --- a/lang/cpp23/consteval_needs_to_propagate_up.md +++ b/lang/cpp23/consteval_needs_to_propagate_up.md @@ -1,4 +1,4 @@ -# constexpr関数内でconsteval関数を呼び出せない問題を軽減 +# constexpr関数内でconsteval関数を呼び出せない問題を軽減 [P2564R3] * cpp23[meta cpp] ## 概要 diff --git a/lang/cpp23/delimited_escape_sequences.md b/lang/cpp23/delimited_escape_sequences.md index 975f02e067..b096127058 100644 --- a/lang/cpp23/delimited_escape_sequences.md +++ b/lang/cpp23/delimited_escape_sequences.md @@ -1,4 +1,4 @@ -# エスケープシーケンスの区切り +# エスケープシーケンスの区切り [P2290R3] * cpp23[meta cpp] ## 概要 diff --git a/lang/cpp23/down_with_lambda_parens.md b/lang/cpp23/down_with_lambda_parens.md index 38c1da716a..a993635f36 100644 --- a/lang/cpp23/down_with_lambda_parens.md +++ b/lang/cpp23/down_with_lambda_parens.md @@ -1,4 +1,4 @@ -# ラムダ式で()を省略できる条件を緩和 +# ラムダ式で()を省略できる条件を緩和 [P1102R2] * cpp23[meta cpp] ## 概要 diff --git a/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md b/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md index 69cb5695f8..bb3aeda352 100644 --- a/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md +++ b/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md @@ -1,4 +1,4 @@ -# 初期化文での型の別名宣言を許可 +# 初期化文での型の別名宣言を許可 [P2360R0] * cpp23[meta cpp] ## 概要 diff --git a/lang/cpp23/generalized_wording_for_partial_specializations.md b/lang/cpp23/generalized_wording_for_partial_specializations.md index 4c58ca2850..a872492de3 100644 --- a/lang/cpp23/generalized_wording_for_partial_specializations.md +++ b/lang/cpp23/generalized_wording_for_partial_specializations.md @@ -1,4 +1,4 @@ -# 変数テンプレートの部分特殊化を許可 +# 変数テンプレートの部分特殊化を許可 [P2096R2] * cpp23[meta cpp] ## 概要 diff --git a/lang/cpp23/if_consteval.md b/lang/cpp23/if_consteval.md index 0c7247d29f..856fae791c 100644 --- a/lang/cpp23/if_consteval.md +++ b/lang/cpp23/if_consteval.md @@ -1,4 +1,4 @@ -# if consteval +# if consteval [P1938R3] * cpp23[meta cpp] ## 概要 diff --git a/lang/cpp23/labels_at_the_end_of_compound_statements.md b/lang/cpp23/labels_at_the_end_of_compound_statements.md index c8377072a7..dacce86cb3 100644 --- a/lang/cpp23/labels_at_the_end_of_compound_statements.md +++ b/lang/cpp23/labels_at_the_end_of_compound_statements.md @@ -1,4 +1,4 @@ -# 複合文の末尾へのラベルを許可 +# 複合文の末尾へのラベルを許可 [P2324R2] * cpp23[meta cpp] ## 概要 diff --git a/lang/cpp23/lifetime_extension_in_range_based_for_loop.md b/lang/cpp23/lifetime_extension_in_range_based_for_loop.md index 4265b36f11..21d2f13e73 100644 --- a/lang/cpp23/lifetime_extension_in_range_based_for_loop.md +++ b/lang/cpp23/lifetime_extension_in_range_based_for_loop.md @@ -1,4 +1,4 @@ -# 範囲for文が範囲初期化子内で生じた一時オブジェクトを延命することを規定 +# 範囲for文が範囲初期化子内で生じた一時オブジェクトを延命することを規定 [P2718R0] * cpp23[meta cpp] diff --git a/lang/cpp23/literal_suffix_for_signed_size_t.md b/lang/cpp23/literal_suffix_for_signed_size_t.md index aa551dbcab..5a31e63cc8 100644 --- a/lang/cpp23/literal_suffix_for_signed_size_t.md +++ b/lang/cpp23/literal_suffix_for_signed_size_t.md @@ -1,4 +1,4 @@ -# (符号付き)size_tリテラルのためのサフィックス +# (符号付き)size_tリテラルのためのサフィックス [P0330R8] * cpp23[meta cpp] ## 概要 diff --git a/lang/cpp23/make_declaration_order_layout_mandated.md b/lang/cpp23/make_declaration_order_layout_mandated.md index 3737326121..3bdb83bfa9 100644 --- a/lang/cpp23/make_declaration_order_layout_mandated.md +++ b/lang/cpp23/make_declaration_order_layout_mandated.md @@ -1,4 +1,4 @@ -# アクセス制御の異なるメンバ変数のレイアウトを宣言順に規定 +# アクセス制御の異なるメンバ変数のレイアウトを宣言順に規定 [P1847R4] * cpp23[meta cpp] ## 概要 diff --git a/lang/cpp23/meaningful_exports.md b/lang/cpp23/meaningful_exports.md index 638b7c073c..c1bfe2765c 100644 --- a/lang/cpp23/meaningful_exports.md +++ b/lang/cpp23/meaningful_exports.md @@ -1,4 +1,4 @@ -# 無意味なexport宣言を禁止する +# 無意味なexport宣言を禁止する [P2615R1] * cpp23[meta cpp] ## 概要 diff --git a/lang/cpp23/mixed_string_literal_concatenation.md b/lang/cpp23/mixed_string_literal_concatenation.md index 538bbc8fb0..b93c80edb0 100644 --- a/lang/cpp23/mixed_string_literal_concatenation.md +++ b/lang/cpp23/mixed_string_literal_concatenation.md @@ -1,4 +1,4 @@ -# 異なる文字エンコーディングをもつ文字列リテラルの連結を不適格とする +# 異なる文字エンコーディングをもつ文字列リテラルの連結を不適格とする [P2201R1] * cpp23[meta cpp] ## 概要 diff --git a/lang/cpp23/multidimensional_subscript_operator.md b/lang/cpp23/multidimensional_subscript_operator.md index 89306c3bc8..3e7df114dc 100644 --- a/lang/cpp23/multidimensional_subscript_operator.md +++ b/lang/cpp23/multidimensional_subscript_operator.md @@ -1,4 +1,4 @@ -# 添字演算子の多次元サポート +# 添字演算子の多次元サポート [P2128R6] * cpp23[meta cpp] ## 概要 diff --git a/lang/cpp23/named_universal_character_escapes.md b/lang/cpp23/named_universal_character_escapes.md index 8a38ffbe32..489dfb672e 100644 --- a/lang/cpp23/named_universal_character_escapes.md +++ b/lang/cpp23/named_universal_character_escapes.md @@ -1,4 +1,4 @@ -# 名前付きユニバーサルキャラクタ名 +# 名前付きユニバーサルキャラクタ名 [P2071R2] * cpp23[meta cpp] ## 概要 diff --git a/lang/cpp23/narrowing_contextual_conversions_to_bool.md b/lang/cpp23/narrowing_contextual_conversions_to_bool.md index 2730e9a171..ece89bd082 100644 --- a/lang/cpp23/narrowing_contextual_conversions_to_bool.md +++ b/lang/cpp23/narrowing_contextual_conversions_to_bool.md @@ -1,4 +1,4 @@ -# 定数式の文脈でのboolへの縮小変換を許可 +# 定数式の文脈でのboolへの縮小変換を許可 [P1401R5] * cpp23[meta cpp] ## 概要 diff --git a/lang/cpp23/non_literal_variables_in_constexpr_functions.md b/lang/cpp23/non_literal_variables_in_constexpr_functions.md index 0cd51f8066..e00bd42b94 100644 --- a/lang/cpp23/non_literal_variables_in_constexpr_functions.md +++ b/lang/cpp23/non_literal_variables_in_constexpr_functions.md @@ -1,4 +1,4 @@ -# 定数式内での非リテラル変数、静的変数・スレッドローカル変数およびgotoとラベルの存在を許可する +# 定数式内での非リテラル変数、静的変数・スレッドローカル変数およびgotoとラベルの存在を許可する [P2242R3] * cpp23[meta cpp] ## 概要 diff --git a/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md b/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md index 431608eb6d..d394617d38 100644 --- a/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md +++ b/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md @@ -1,4 +1,4 @@ -# constexpr関数内でのstatic constexpr変数を許可 +# constexpr関数内でのstatic constexpr変数を許可 [P2647R1] * cpp23[meta cpp] ## 概要 diff --git a/lang/cpp23/portable_assumptions.md b/lang/cpp23/portable_assumptions.md index 8c8ebf1c0f..7e7506e4a9 100644 --- a/lang/cpp23/portable_assumptions.md +++ b/lang/cpp23/portable_assumptions.md @@ -1,4 +1,4 @@ -# コード内容の仮定をコンパイラに伝える`assume`属性 +# コード内容の仮定をコンパイラに伝える`assume`属性 [P1774R8] * cpp23[meta cpp] ## 概要 diff --git a/lang/cpp23/relaxing_some_constexpr_restrictions.md b/lang/cpp23/relaxing_some_constexpr_restrictions.md index 205a7e237e..f187fd29fa 100644 --- a/lang/cpp23/relaxing_some_constexpr_restrictions.md +++ b/lang/cpp23/relaxing_some_constexpr_restrictions.md @@ -1,4 +1,4 @@ -# constexpr関数が定数実行できない場合でも適格とする +# constexpr関数が定数実行できない場合でも適格とする [P2448R2] * cpp23[meta cpp] ## 概要 diff --git a/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md b/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md index ea946f5c9b..83a1153f74 100644 --- a/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md +++ b/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md @@ -1,4 +1,4 @@ -# 1ワイド文字に収まらないワイド文字リテラルを禁止する +# 1ワイド文字に収まらないワイド文字リテラルを禁止する [P2362R3] * cpp23[meta cpp] ## 概要 diff --git a/lang/cpp23/simpler_implicit_move.md b/lang/cpp23/simpler_implicit_move.md index d6d4ceaa34..86746ed6fc 100644 --- a/lang/cpp23/simpler_implicit_move.md +++ b/lang/cpp23/simpler_implicit_move.md @@ -1,4 +1,4 @@ -# 暗黙的なムーブを簡略化 +# 暗黙的なムーブを簡略化 [P2266R3] * cpp23[meta cpp] ## 概要 diff --git a/lang/cpp23/static_operator.md b/lang/cpp23/static_operator.md index 82da0f5a2f..10a20d9273 100644 --- a/lang/cpp23/static_operator.md +++ b/lang/cpp23/static_operator.md @@ -1,4 +1,4 @@ -# thisポインタをもつ必要のない演算子をstaticとして宣言できるようにする +# thisポインタをもつ必要のない演算子をstaticとして宣言できるようにする [P1169R4] * cpp23[meta cpp] ## 概要 diff --git a/lang/cpp23/support_for_utf8_as_a_portable_source_file_encoding.md b/lang/cpp23/support_for_utf8_as_a_portable_source_file_encoding.md index 43380ebda5..ea297b07e5 100644 --- a/lang/cpp23/support_for_utf8_as_a_portable_source_file_encoding.md +++ b/lang/cpp23/support_for_utf8_as_a_portable_source_file_encoding.md @@ -1,4 +1,4 @@ -# 汎用的なソースコードのエンコーディングとしてUTF-8をサポート +# 汎用的なソースコードのエンコーディングとしてUTF-8をサポート [P2295R6] * cpp23[meta cpp] ## 概要 diff --git a/lang/cpp23/trimming_whitespaces_before_line_splicing.md b/lang/cpp23/trimming_whitespaces_before_line_splicing.md index d17c4a5491..fe51f851a3 100644 --- a/lang/cpp23/trimming_whitespaces_before_line_splicing.md +++ b/lang/cpp23/trimming_whitespaces_before_line_splicing.md @@ -1,4 +1,4 @@ -# 行末スペースを無視するよう規定 +# 行末スペースを無視するよう規定 [P2223R2] * cpp23[meta cpp] ## 概要 diff --git a/lang/cpp23/warning.md b/lang/cpp23/warning.md index 2695381db8..4706b00c5f 100644 --- a/lang/cpp23/warning.md +++ b/lang/cpp23/warning.md @@ -1,4 +1,4 @@ -# #warningのサポートを追加 +# #warningのサポートを追加 [P2437R1] * cpp23[meta cpp] ## 概要 diff --git a/lang/cpp26/user-generated_static_assert_messages.md b/lang/cpp26/user-generated_static_assert_messages.md index e05ce729d2..06e1dadb8c 100644 --- a/lang/cpp26/user-generated_static_assert_messages.md +++ b/lang/cpp26/user-generated_static_assert_messages.md @@ -1,4 +1,4 @@ -# static_assertの診断メッセージにユーザーが生成した文字列の指定を許可 +# static_assertの診断メッセージにユーザーが生成した文字列の指定を許可 [P2741R3] * cpp26[meta cpp] ## 概要 From d71da861640733ff4be8d5ed1a1cb56c08861781 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 14 Jun 2024 16:41:55 +0900 Subject: [PATCH 0957/3948] =?UTF-8?q?linalg=20add=20:=20=E8=A1=A8=E7=A4=BA?= =?UTF-8?q?=E5=B4=A9=E3=82=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 箇条書きの前には空行が必要 https://github.com/cpprefjp/site/blob/master/NOTICE.md --- reference/linalg/add.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/linalg/add.md b/reference/linalg/add.md index fd21543dad..cffbd4bd04 100644 --- a/reference/linalg/add.md +++ b/reference/linalg/add.md @@ -37,8 +37,8 @@ $$ ## テンプレートパラメータ制約 -`x`と`y`、`z`の次元が全て等しくなければならない。 -- `x.rank() == y.rank() && y.rank() == z.rank()` +- `x`と`y`、`z`の次元が全て等しくなければならない。 + - `x.rank() == y.rank() && y.rank() == z.rank()` ## 適格要件 From 9e5c6479908f5a1d97935540bea95d64cd23f03a Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sat, 15 Jun 2024 17:38:41 +0900 Subject: [PATCH 0958/3948] Update contract-based_programming.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 経緯を補足 --- lang/future/contract-based_programming.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lang/future/contract-based_programming.md b/lang/future/contract-based_programming.md index 6be82eb06a..c57629ed67 100644 --- a/lang/future/contract-based_programming.md +++ b/lang/future/contract-based_programming.md @@ -4,7 +4,9 @@ ## 概要 将来のC++では、いわゆる[契約プログラミング](https://ja.wikipedia.org/wiki/%E5%A5%91%E7%B4%84%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%9F%E3%83%B3%E3%82%B0)が検討されている。 -以下の内容はC++20で予定されていた仕様に基づいており、今後変わる可能性が高い。 +この機能は一度はC++20のドラフトに取り込まれたが、実装が進む中で問題が見つかり最終的に取り除かれた。現在ではC++26以降を目標に議論されている。 + +以下の内容はC++20で予定されていた仕様に基づいており、最新の案とは異なる。 ## 例 ```cpp example From 5be9a45de2f2cb0015415120583a579005a96f1e Mon Sep 17 00:00:00 2001 From: yoh Date: Sat, 15 Jun 2024 21:35:49 +0900 Subject: [PATCH 0959/3948] cpp11/range_based_for: markup code --- lang/cpp11/range_based_for.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lang/cpp11/range_based_for.md b/lang/cpp11/range_based_for.md index 8c80c934be..33a5db8681 100644 --- a/lang/cpp11/range_based_for.md +++ b/lang/cpp11/range_based_for.md @@ -34,9 +34,9 @@ for (const auto& e : v) { | 変数宣言 | e を変更可能か? | コンテナ内の要素を変更可能か? | |-----------------|------------------|--------------------------------| -| const auto& e | No | No | -| auto& e | Yes | Yes | -| auto e | Yes | No | +| `const auto& e` | No | No | +| `auto& e` | Yes | Yes | +| `auto e` | Yes | No | [auto]: /lang/cpp11/auto.md From ee14b21b1760925247e1d2c5871ec6f266aa007f Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Sun, 16 Jun 2024 17:54:12 +0900 Subject: [PATCH 0960/3948] =?UTF-8?q?linalg=20:=20dot=E3=81=A8add=E3=81=AE?= =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=82=92linalg.md=E3=81=AB=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 4 +- reference/linalg/dot.md | 107 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 109 insertions(+), 2 deletions(-) create mode 100644 reference/linalg/dot.md diff --git a/reference/linalg.md b/reference/linalg.md index 361a30e023..f89902f662 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -64,8 +64,8 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に | [`swap_elements`](linalg/swap_elements.md) | xSWAP: 2つのベクトル/行列の要素を交換する (function template) | C++26 | | [`scale`](linalg/scale.md) | xSCAL: ベクトル/行列の要素にスカラ値を乗算する (function template) | C++26 | | [`copy`](linalg/copy.md) | xCOPY: ベクトル/行列の要素をコピーする (function template) | C++26 | -| `add` | xAXPY: 2つのベクトル/行列の要素を加算する (function template) | C++26 | -| `dot` | xDOT, xDOTU: 2つのベクトルのドット積を求める (function template) | C++26 | +| [`add`](linalg/add.md) | xAXPY: 2つのベクトル/行列の要素を加算する (function template) | C++26 | +| [`dot`](linalg/dot.md) | xDOT, xDOTU: 2つのベクトルのドット積を求める (function template) | C++26 | | `dotc` | xDOTC: 2つのベクトルの複素共役ドット積を求める (function template) | C++26 | | `sum_of_squares_result` | `vector_sum_of_squares`の結果型 (class template) | C++26 | | `vector_sum_of_squares` | xLASSQ: ベクトル要素の平方和を求める (function template) | C++26 | diff --git a/reference/linalg/dot.md b/reference/linalg/dot.md new file mode 100644 index 0000000000..8c023bda7f --- /dev/null +++ b/reference/linalg/dot.md @@ -0,0 +1,107 @@ +# dot + +* [mathjax enable] +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + + +```cpp +namespace std::linalg { + template + Scalar dot(InVec1 v1, + InVec2 v2, + Scalar init); // (1) + + template + Scalar dot(ExecutionPolicy&& exec, + InVec1 v1, + InVec2 v2, + Scalar init); // (2) + + template + auto dot(InVec1 v1, + InVec2 v2); // (3) + + template + auto dot(ExecutionPolicy&& exec, + InVec1 v1, + InVec2 v2); // (4) +} +``` + +## 概要 +2つのベクトル`v1`、`v2`の内積を計算する。 + + +## 適格要件 +2つのベクトルの静的な要素数が同じであること。 + +- [`compatible-static-extents`](compatible-static-extents.md)`(0, 0) == true` + + +## 事前条件 +2つのベクトルの次元が同じであること。 + +- `v1.extent(0) == v2.extent(0)` + + +## 効果 +- (1), (2): なし +- (3), (4): `T`を各ベクトルの値型の積の型`decltype(declval() * declval())`とする。 + + (3): `dot(v1, v2, T{})`を返す。 + + (4): `dot(std::forward(exec), v1, v2, T{})`を返す。 + + +## 戻り値 +2つのベクトルの次元を`N`とする。 + +- (1): もし`N`が0なら`init`を返す。そうでない場合は、共役を取らない内積、つまり以下の式の`Scalar`型の値を返す。 + +$$ +\verb|init| + \sum_{i = 0}^{N - 1} \verb|v1|[i] * \verb|v2|[i] +$$ + +- (2): (1)の並列アルゴリズム版。 +- (3): (1)の`init`を和の各項の型のデフォルト値に置き換えて計算する。 +- (4): (3)の並列アルゴリズム版。 + + +## 備考 +- (1), (2): もし`InVec1::value_type`、`InVec2::value_type`、`Scalar`が全て浮動小数点数型または`std::complex`の特殊化で、`Scalar`が`InVec1::value_type`と`InVec2::value_type`より精度が高い場合、和の各項は`Scalar`またはより高い精度の型が使われる。 + + +## 例 + + +### 出力 + + +## バージョン +### 言語 +- C++11 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution`](/reference/execution.md) +- [`mdspan`](/reference/mdspan.md) + + +## 参照 +- [P0788R3 Standard Library Specification in a Concepts and Contracts World](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0788r3.pdf) +- [`LAPACK: cdotu`](https://netlib.org/lapack/explore-html/d1/dcc/group__dot_ga2cce681b6aed3728b893a555b3bee55c.html#ga2cce681b6aed3728b893a555b3bee55c) From 2db36f3aae0f7de19e52537883e34e2d420a1a6a Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Sun, 16 Jun 2024 18:11:26 +0900 Subject: [PATCH 0961/3948] =?UTF-8?q?linalg=20:=20dotc=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 2 +- reference/linalg/dotc.md | 106 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 reference/linalg/dotc.md diff --git a/reference/linalg.md b/reference/linalg.md index f89902f662..fcfea6de57 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -66,7 +66,7 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に | [`copy`](linalg/copy.md) | xCOPY: ベクトル/行列の要素をコピーする (function template) | C++26 | | [`add`](linalg/add.md) | xAXPY: 2つのベクトル/行列の要素を加算する (function template) | C++26 | | [`dot`](linalg/dot.md) | xDOT, xDOTU: 2つのベクトルのドット積を求める (function template) | C++26 | -| `dotc` | xDOTC: 2つのベクトルの複素共役ドット積を求める (function template) | C++26 | +| [`dotc`](linalg/dotc.md) | xDOTC: 2つのベクトルの複素共役ドット積を求める (function template) | C++26 | | `sum_of_squares_result` | `vector_sum_of_squares`の結果型 (class template) | C++26 | | `vector_sum_of_squares` | xLASSQ: ベクトル要素の平方和を求める (function template) | C++26 | | `vector_two_norm` | xNRM2: ベクトルのユークリッドノルム(Euclidean norm)を求める (function template) | C++26 | diff --git a/reference/linalg/dotc.md b/reference/linalg/dotc.md new file mode 100644 index 0000000000..e5c920564b --- /dev/null +++ b/reference/linalg/dotc.md @@ -0,0 +1,106 @@ +# dotc + +* [mathjax enable] +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + + +```cpp +namespace std::linalg { + template + Scalar dotc(InVec1 v1, + InVec2 v2, + Scalar init); // (1) + + template + Scalar dotc(ExecutionPolicy&& exec, + InVec1 v1, + InVec2 v2, + Scalar init); // (2) + + template + auto dotc(InVec1 v1, + InVec2 v2); // (3) + + template + auto dotc(ExecutionPolicy&& exec, + InVec1 v1, + InVec2 v2); // (4) +} +``` + +## 概要 +2つのベクトル`v1`、`v2`のエルミート内積を計算する。 + + +## 適格要件 +2つのベクトルの静的な要素数が同じであること。 + +- [`compatible-static-extents`](compatible-static-extents.md)`(0, 0) == true` + + +## 事前条件 +2つのベクトルの次元が同じであること。 + +- `v1.extent(0) == v2.extent(0)` + + +## 効果 +- (1): [`dot`](dot.md)`(`[`conjugated`](conjugated.md)`(v1), v2, init)`を返す。 +- (2): `dot(std::forward(exec), conjugated(v1), v2, init)`を返す。 +- (3), (4): `T`を各ベクトルの値型の積の型`decltype(conj-if-needed(declval()) * declval())`とする。 + + (3): `dotc(v1, v2, T{})`を返す。 + + (4): `dotc(std::forward(exec), v1, v2, T{})`を返す。 + + +## 戻り値 +2つのベクトルの次元を`N`とする。 + +- (1): もし`N`が0なら`init`を返す。そうでない場合は、共役を取らない内積、つまり以下の式の`Scalar`型の値を返す。 + +$$ +\verb|init| + \sum_{i = 0}^{N - 1} \overline{\verb|v1|[i]} * \verb|v2|[i] +$$ + +- (2): (1)の並列アルゴリズム版。 +- (3): (1)の`init`を和の各項の型のデフォルト値に置き換えて計算する。 +- (4): (3)の並列アルゴリズム版。 + + +## 例 + + +### 出力 + + +## バージョン +### 言語 +- C++11 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`dot`](dot.md) +- [`execution`](/reference/execution.md) +- [`mdspan`](/reference/mdspan.md) + + +## 参照 +- [P0788R3 Standard Library Specification in a Concepts and Contracts World](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0788r3.pdf) +- [`LAPACK: cdotc`](https://netlib.org/lapack/explore-html/d1/dcc/group__dot_ga5c189335a4e6130a2206c190579b1571.html#ga5c189335a4e6130a2206c190579b1571) + From fec7d6af95f407a33076dbf210f2ccdb56a785f1 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Mon, 17 Jun 2024 18:07:07 +0900 Subject: [PATCH 0962/3948] =?UTF-8?q?linalg=20:=20sum=5Fof=5Fsquares?= =?UTF-8?q?=E9=96=A2=E9=80=A3=E3=82=92=E8=BF=BD=E5=8A=A0=E3=80=82(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 4 +- reference/linalg/sum_of_squares_result.md | 45 +++++++++++ reference/linalg/vector_sum_of_squares.md | 91 +++++++++++++++++++++++ 3 files changed, 138 insertions(+), 2 deletions(-) create mode 100644 reference/linalg/sum_of_squares_result.md create mode 100644 reference/linalg/vector_sum_of_squares.md diff --git a/reference/linalg.md b/reference/linalg.md index fcfea6de57..3d0c17b51f 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -67,8 +67,8 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に | [`add`](linalg/add.md) | xAXPY: 2つのベクトル/行列の要素を加算する (function template) | C++26 | | [`dot`](linalg/dot.md) | xDOT, xDOTU: 2つのベクトルのドット積を求める (function template) | C++26 | | [`dotc`](linalg/dotc.md) | xDOTC: 2つのベクトルの複素共役ドット積を求める (function template) | C++26 | -| `sum_of_squares_result` | `vector_sum_of_squares`の結果型 (class template) | C++26 | -| `vector_sum_of_squares` | xLASSQ: ベクトル要素の平方和を求める (function template) | C++26 | +| [`sum_of_squares_result`](linalg/sum_of_squares_result.md) | `vector_sum_of_squares`の結果型 (class template) | C++26 | +| [`vector_sum_of_squares`](linalg/vector_sum_of_squares.md) | xLASSQ: ベクトル要素の平方和を求める (function template) | C++26 | | `vector_two_norm` | xNRM2: ベクトルのユークリッドノルム(Euclidean norm)を求める (function template) | C++26 | | `vector_abs_sum` | xASUM: ベクトル要素の絶対値和を求める (function template) | C++26 | | `vector_idx_abs_max` | xIAMAX: ベクトル要素のうち最大絶対値インデクスを返す (function template) | C++26 | diff --git a/reference/linalg/sum_of_squares_result.md b/reference/linalg/sum_of_squares_result.md new file mode 100644 index 0000000000..97b3a17ba1 --- /dev/null +++ b/reference/linalg/sum_of_squares_result.md @@ -0,0 +1,45 @@ +# sum_of_squares_result + +* linalg[meta header] +* class template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::linalg { + template + struct sum_of_squares_result { + Scalar scaling_factor; + Scalar scaled_sum_of_squares; + }; +} +``` + +## 概要 +スケールされた、ベクトルの成分の2乗和の結果を表すクラス。詳しくは、[`vector_sum_of_squares`](vector_sum_of_squares.md)にて。 + + +## 例 + + +### 出力 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`vector_sum_of_squares`](vector_sum_of_squares.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) +- [`LAPACK: classq`](https://netlib.org/lapack/explore-html/d8/d76/group__lassq_gab70baa330cb7a13111b72aef0734e26d.html#gab70baa330cb7a13111b72aef0734e26d) diff --git a/reference/linalg/vector_sum_of_squares.md b/reference/linalg/vector_sum_of_squares.md new file mode 100644 index 0000000000..e0e607efa3 --- /dev/null +++ b/reference/linalg/vector_sum_of_squares.md @@ -0,0 +1,91 @@ +# sum_of_squares_result + +* [mathjax enable] +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::linalg { + template + sum_of_squares_result vector_sum_of_squares( + InVec v, + sum_of_squares_result init); // (1) + + template + sum_of_squares_result vector_sum_of_squares( + ExecutionPolicy&& exec, + InVec v, + sum_of_squares_result init); // (2) +} +``` + + +## 概要 +アンダーフローとオーバーフローが起きないようスケールされた、ベクトルの成分の2乗和を計算する。すなわち、戻り値を`result`とし、説明用の関数 + +```cpp + template + Scalar get_sum_of_squares(sum_of_squares_result result) { + return std::pow(result.scaling_factor, 2) * result.scaled_sum_of_squares; + } +``` + +を定義すると、以下の式が成り立つように計算する。 + +$$ +\verb|get_sum_of_squares(result)| = \sum_{i = 0}^{n - 1} |\verb|v[|i\verb|]||^2 + \verb|get_sum_of_squares(init)| +$$ + +ただし、`n`は`v`の次元である。 + + +## 適格要件 +- `decltype(abs-if-needed(declval()))`が`Scalar`に変換可能。 + + +## 効果 +- (1): 以下の条件を満たす`sum_of_squares_result`型の値`result`を返す。 + + `result.scaling_factor`が`init.scaling_factor`と$\max_{i = 0, \dots, n - 1}|\verb|v[|i\verb|]||$の最大値。ただし、`n`は`v`の次元である。 + + 概要に記載した式を満たす。 +- (2): (1)の並列アルゴリズム版。 + + +## 戻り値 +`sum_of_squares_result` + + +## 備考 +- `init.scaled_sum_of_squares`は0以上でなければならない。 +- もし`InVec::value_type`と`Scalar`がどちらも浮動小数点数型または`std::complex`の特殊化で、`Scalar`が`InVec::value_type`より精度が高い場合、和の各項は`Scalar`またはより高い精度の型が使われる。 + + +## 例 + + +### 出力 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution`](/reference/execution.md) +- [`mdspan`](/reference/mdspan.md) +- [`sum_of_squares_result`](sum_of_squares_result.md) + + +## 参照 +- [P0788R3 Standard Library Specification in a Concepts and Contracts World](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0788r3.pdf) +- [LAPACK: classq](https://netlib.org/lapack/explore-html/d8/d76/group__lassq_gab70baa330cb7a13111b72aef0734e26d.html#gab70baa330cb7a13111b72aef0734e26d) From d8117d886c863b329694a192731ddd37f700e6e4 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Tue, 18 Jun 2024 14:28:49 +0900 Subject: [PATCH 0963/3948] =?UTF-8?q?linalg=20:=20conj-if-needed=E3=81=AE?= =?UTF-8?q?=E6=A6=82=E8=A6=81=E3=82=92=E4=BF=AE=E6=AD=A3=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/conj-if-needed.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/linalg/conj-if-needed.md b/reference/linalg/conj-if-needed.md index 0046a563b7..ca2011d3d0 100644 --- a/reference/linalg/conj-if-needed.md +++ b/reference/linalg/conj-if-needed.md @@ -9,7 +9,7 @@ 型`T`の式`E`に対して、式`conj-if-needed(E)`は次と等価である。 -- `T`が算術型かつ式`conj(E)`が下記宣言を含むコンテキストにおいてオーバーロード解決を行った結果が妥当であるとき、`conj(E)` +- `T`が算術型でなく、式`conj(E)`が下記宣言を含むコンテキストにおいてオーバーロード解決を行った結果が妥当であるとき、`conj(E)` ```cpp template T conj(const T&) = delete; ``` From d741acc5c59b3de4706221a5913be43f4050a089 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Tue, 18 Jun 2024 14:33:56 +0900 Subject: [PATCH 0964/3948] =?UTF-8?q?linalg=20:=20abs-if-needed=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/abs-if-needed.md | 34 +++++++++++++++++++++++ reference/linalg/vector_sum_of_squares.md | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 reference/linalg/abs-if-needed.md diff --git a/reference/linalg/abs-if-needed.md b/reference/linalg/abs-if-needed.md new file mode 100644 index 0000000000..c7daf9baee --- /dev/null +++ b/reference/linalg/abs-if-needed.md @@ -0,0 +1,34 @@ +# abs-if-needed + +* linalg[meta header] +* function[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + +## 概要 +`abs-if-needed`は、必要に応じて絶対値を計算する、説明専用の関数オブジェクトである。 + +型`T`の式`E`に対して、式`abs-if-needed(E)`は次と等価である。 + +1. もし`T`が符号なし整数なら、`E` + +2. そうでない場合、もし`T`が算術型なら、`std::abs(E)` + +3. そうでない場合、式`abs(E)`が下記宣言を含むコンテキストにおいてオーバーロード解決を行った結果が妥当であるとき、`abs(E)` + ```cpp + template T conj(const T&) = delete; + ``` + + +## 備考 +オーバーロード解決により選択された関数が入力値の絶対値を返さないとき、プログラムは不適格となる。 + + +## バージョン +### 言語 +- C++26 + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) + diff --git a/reference/linalg/vector_sum_of_squares.md b/reference/linalg/vector_sum_of_squares.md index e0e607efa3..475f3d4148 100644 --- a/reference/linalg/vector_sum_of_squares.md +++ b/reference/linalg/vector_sum_of_squares.md @@ -44,7 +44,7 @@ $$ ## 適格要件 -- `decltype(abs-if-needed(declval()))`が`Scalar`に変換可能。 +- `decltype(`[`abs-if-needed`](abs-if-needed.md)`(declval()))`が`Scalar`に変換可能。 ## 効果 From c47e0213c492fc97f33287ab9550d223ab5d1af1 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Tue, 18 Jun 2024 14:47:07 +0900 Subject: [PATCH 0965/3948] =?UTF-8?q?linalg=20:=20vector=5Ftwo=5Fnorm?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 2 +- reference/linalg/vector_two_norm.md | 77 +++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 reference/linalg/vector_two_norm.md diff --git a/reference/linalg.md b/reference/linalg.md index 3d0c17b51f..6183ed5dca 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -69,7 +69,7 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に | [`dotc`](linalg/dotc.md) | xDOTC: 2つのベクトルの複素共役ドット積を求める (function template) | C++26 | | [`sum_of_squares_result`](linalg/sum_of_squares_result.md) | `vector_sum_of_squares`の結果型 (class template) | C++26 | | [`vector_sum_of_squares`](linalg/vector_sum_of_squares.md) | xLASSQ: ベクトル要素の平方和を求める (function template) | C++26 | -| `vector_two_norm` | xNRM2: ベクトルのユークリッドノルム(Euclidean norm)を求める (function template) | C++26 | +| [`vector_two_norm`](linalg/vector_two_norm.md) | xNRM2: ベクトルのユークリッドノルム(Euclidean norm)を求める (function template) | C++26 | | `vector_abs_sum` | xASUM: ベクトル要素の絶対値和を求める (function template) | C++26 | | `vector_idx_abs_max` | xIAMAX: ベクトル要素のうち最大絶対値インデクスを返す (function template) | C++26 | | `matrix_frob_norm` | 行列のフロベニウスノルム(Frobenius norm)を求める (function template) | C++26 | diff --git a/reference/linalg/vector_two_norm.md b/reference/linalg/vector_two_norm.md new file mode 100644 index 0000000000..7184760aa7 --- /dev/null +++ b/reference/linalg/vector_two_norm.md @@ -0,0 +1,77 @@ +# vector_two_norm + +* [mathjax enable] +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::linalg { + template + Scalar vector_two_norm(InVec v, + Scalar init); // (1) + + template + Scalar vector_two_norm(ExecutionPolicy&& exec, + InVec v, + Scalar init); // (2) +} +``` + + +## 概要 +ベクトルのユークリッドノルムを計算する。 + +- (1): 逐次実行する。 +- (2): 指定された実行ポリシーに応じて実行する。 + + +## 適格要件 +- `decltype(init + `[`abs-if-needed`](abs-if-needed.md)`(declval()) * abs-if-needed(declval()))`が`Scalar`に変換可能。 + + +## 戻り値 +`n`を`v`の次元とすると、 + +$$ +\sqrt{\sum_{i = 0}^{n - 1} |\verb|v[|i\verb|]||^2 + \verb|init|^2} +$$ + +を返す。 + + +## 備考 +- `init.scaled_sum_of_squares`は0以上でなければならない。 +- もし`InVec::value_type`と`Scalar`がどちらも浮動小数点数型または`std::complex`の特殊化で、`Scalar`が`InVec::value_type`より精度が高い場合、和の各項は`Scalar`またはより高い精度の型が使われる。 + + +## 例 + + +### 出力 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution`](/reference/execution.md) +- [`mdspan`](/reference/mdspan.md) + + +## 参照 +- [P0788R3 Standard Library Specification in a Concepts and Contracts World](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0788r3.pdf) +- [LAPACK: dnrm2](https://netlib.org/lapack/explore-html/d1/d2a/group__nrm2_gab5393665c8f0e7d5de9bd1dd2ff0d9d0.html#gab5393665c8f0e7d5de9bd1dd2ff0d9d0) + From 53a83937be756ab3abd954a1894aeac3ceaf6620 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Tue, 18 Jun 2024 15:01:22 +0900 Subject: [PATCH 0966/3948] =?UTF-8?q?linalg=20:=20vector=5Ftwo=5Fnorm?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/vector_two_norm.md | 33 ++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/reference/linalg/vector_two_norm.md b/reference/linalg/vector_two_norm.md index 7184760aa7..0bcb7e9e90 100644 --- a/reference/linalg/vector_two_norm.md +++ b/reference/linalg/vector_two_norm.md @@ -8,17 +8,21 @@ ```cpp namespace std::linalg { - template - Scalar vector_two_norm(InVec v, - Scalar init); // (1) + template + Scalar vector_two_norm(InVec v, Scalar init); // (1) template Scalar vector_two_norm(ExecutionPolicy&& exec, InVec v, - Scalar init); // (2) + Scalar init); // (2) + + template + auto vector_two_norm(InVec v); // (3) + + template + auto vector_two_norm(ExecutionPolicy&& exec, InVec v); // (4) } ``` @@ -28,25 +32,34 @@ namespace std::linalg { - (1): 逐次実行する。 - (2): 指定された実行ポリシーに応じて実行する。 +- (3): (1)で`init`に`InVec::value_type`のデフォルト値を与えて逐次実行する。 +- (4): (2)で`init`に`InVec::value_type`のデフォルト値を与えて、指定された実行ポリシーに応じて実行する。 ## 適格要件 -- `decltype(init + `[`abs-if-needed`](abs-if-needed.md)`(declval()) * abs-if-needed(declval()))`が`Scalar`に変換可能。 +- (1), (2): `decltype(init + `[`abs-if-needed`](abs-if-needed.md)`(declval()) * abs-if-needed(declval()))`が`Scalar`に変換可能。 + +## 効果 +- (3), (4): `T`を`decltype(abs-if-needed(declval()) * abs-if-needed(declval()))`とすると、 + + (3): `vector_two_norm(v, T{})`を返す。 + + (4): `vector_two_norm(std::forward(exec), v, T{})`を返す。 ## 戻り値 -`n`を`v`の次元とすると、 +- (1), (2): `n`を`v`の次元とすると、以下の式の値を返す。 $$ \sqrt{\sum_{i = 0}^{n - 1} |\verb|v[|i\verb|]||^2 + \verb|init|^2} $$ -を返す。 + +- (3), (4): `T`を`decltype(abs-if-needed(declval()) * abs-if-needed(declval()))`とすると、 + + (3): `vector_two_norm(v, T{})`を返す。 + + (4): `vector_two_norm(std::forward(exec), v, T{})`を返す。 ## 備考 -- `init.scaled_sum_of_squares`は0以上でなければならない。 -- もし`InVec::value_type`と`Scalar`がどちらも浮動小数点数型または`std::complex`の特殊化で、`Scalar`が`InVec::value_type`より精度が高い場合、和の各項は`Scalar`またはより高い精度の型が使われる。 +- (1), (2): もし`InVec::value_type`と`Scalar`がどちらも浮動小数点数型または`std::complex`の特殊化で、`Scalar`が`InVec::value_type`より精度が高い場合、和の各項は`Scalar`またはより高い精度の型が使われる。 ## 例 From 0a2aa08beb530dcf5891a7708c8ca6813308d41b Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 18 Jun 2024 15:21:55 +0900 Subject: [PATCH 0967/3948] =?UTF-8?q?split=5Fview=E3=81=AE=E5=A4=96?= =?UTF-8?q?=E5=81=B4range=E3=81=AF=E5=B8=B8=E3=81=AB.back()=E3=82=92?= =?UTF-8?q?=E6=8C=81=E3=81=9F=E3=81=AA=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/split_view.md | 1 - 1 file changed, 1 deletion(-) diff --git a/reference/ranges/split_view.md b/reference/ranges/split_view.md index 90c3ad58dc..411ef0e7c8 100644 --- a/reference/ranges/split_view.md +++ b/reference/ranges/split_view.md @@ -74,7 +74,6 @@ namespace std::ranges { | [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++20 | | [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++20 | | [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | -| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | | [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | | [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | From 6563c2907bb5d60e9fadabdb88b2aebbd17d4fcb Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 18 Jun 2024 19:19:29 +0900 Subject: [PATCH 0968/3948] =?UTF-8?q?stacktrace=5Fentry::dsecription=20:?= =?UTF-8?q?=20=E3=81=93=E3=81=AE=E9=96=A2=E6=95=B0=E3=81=A7=E3=81=AF?= =?UTF-8?q?=E9=96=A2=E6=95=B0=E5=90=8D=E3=82=92=E5=8F=96=E5=BE=97=E3=81=A7?= =?UTF-8?q?=E3=81=8D=E3=82=8B=E3=81=93=E3=81=A8=E3=80=81=E5=8F=96=E5=BE=97?= =?UTF-8?q?=E3=81=A7=E3=81=8D=E3=81=AA=E3=81=84=E5=A0=B4=E5=90=88=E3=81=8C?= =?UTF-8?q?=E3=81=82=E3=82=8B=E3=81=93=E3=81=A8=E3=82=92=E8=A8=98=E8=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/stacktrace/stacktrace_entry/description.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reference/stacktrace/stacktrace_entry/description.md b/reference/stacktrace/stacktrace_entry/description.md index 37c299bbe8..1b70e02fd0 100644 --- a/reference/stacktrace/stacktrace_entry/description.md +++ b/reference/stacktrace/stacktrace_entry/description.md @@ -13,6 +13,8 @@ string description() const; // (1) C++23 ## 概要 このオブジェクトを説明する文字列を取得する。 +この関数は、関数名の文字列が返ることが想定される。ただし、コンパイラの最適化によって関数名の情報が取得できない可能性がある。 + ## 戻り値 `*this`で表される評価の説明、または空文字列を返す。 From eed3fa08125314c79240db31165bd2ed5a7308de Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Wed, 19 Jun 2024 15:32:00 +0900 Subject: [PATCH 0969/3948] =?UTF-8?q?linalg=20:=20abs-if-needed=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/abs-if-needed.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reference/linalg/abs-if-needed.md b/reference/linalg/abs-if-needed.md index c7daf9baee..9d95d9306a 100644 --- a/reference/linalg/abs-if-needed.md +++ b/reference/linalg/abs-if-needed.md @@ -16,7 +16,8 @@ 3. そうでない場合、式`abs(E)`が下記宣言を含むコンテキストにおいてオーバーロード解決を行った結果が妥当であるとき、`abs(E)` ```cpp - template T conj(const T&) = delete; + template + T abs(const T&) = delete; ``` From c5cacdf1735c17e040505f0bebfc8c2073a8e6d8 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Wed, 19 Jun 2024 19:39:43 +0900 Subject: [PATCH 0970/3948] =?UTF-8?q?linalg=20:=20vector=5Fabs=5Fsum?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 2 +- reference/linalg/imag-if-needed.md | 32 +++++++ reference/linalg/real-if-needed.md | 32 +++++++ reference/linalg/vector_abs_sum.md | 132 +++++++++++++++++++++++++++++ 4 files changed, 197 insertions(+), 1 deletion(-) create mode 100644 reference/linalg/imag-if-needed.md create mode 100644 reference/linalg/real-if-needed.md create mode 100644 reference/linalg/vector_abs_sum.md diff --git a/reference/linalg.md b/reference/linalg.md index 6183ed5dca..2d959e5cd8 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -70,7 +70,7 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に | [`sum_of_squares_result`](linalg/sum_of_squares_result.md) | `vector_sum_of_squares`の結果型 (class template) | C++26 | | [`vector_sum_of_squares`](linalg/vector_sum_of_squares.md) | xLASSQ: ベクトル要素の平方和を求める (function template) | C++26 | | [`vector_two_norm`](linalg/vector_two_norm.md) | xNRM2: ベクトルのユークリッドノルム(Euclidean norm)を求める (function template) | C++26 | -| `vector_abs_sum` | xASUM: ベクトル要素の絶対値和を求める (function template) | C++26 | +| [`vector_abs_sum`](linalg/vector_abs_sum.md) | xASUM: ベクトル要素の絶対値和を求める (function template) | C++26 | | `vector_idx_abs_max` | xIAMAX: ベクトル要素のうち最大絶対値インデクスを返す (function template) | C++26 | | `matrix_frob_norm` | 行列のフロベニウスノルム(Frobenius norm)を求める (function template) | C++26 | | `matrix_one_norm` | 行列の1ノルム(One norm)を求める (function template) | C++26 | diff --git a/reference/linalg/imag-if-needed.md b/reference/linalg/imag-if-needed.md new file mode 100644 index 0000000000..07b134af7c --- /dev/null +++ b/reference/linalg/imag-if-needed.md @@ -0,0 +1,32 @@ +# imag-if-needed + +* linalg[meta header] +* function[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + +## 概要 +`imag-if-needed`は、必要に応じて複素数の虚部を返す、説明専用の関数オブジェクトである。 + +型`T`の式`E`に対して、式`imag-if-needed(E)`は次と等価である。 + +1. `T`が算術型でなく、式`imag(E)`が下記宣言を含むコンテキストにおいてオーバーロード解決を行った結果が妥当であるとき、`imag(E)` + ```cpp + template + T imag(const T&) = delete; + ``` +2. そうでない場合、`((void)E, T{})` + + +## 備考 +オーバーロード解決により選択された関数が入力された複素数の実部を返さないとき、プログラムは不適格となる。 + + +## バージョン +### 言語 +- C++26 + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) + diff --git a/reference/linalg/real-if-needed.md b/reference/linalg/real-if-needed.md new file mode 100644 index 0000000000..179fa62657 --- /dev/null +++ b/reference/linalg/real-if-needed.md @@ -0,0 +1,32 @@ +# real-if-needed + +* linalg[meta header] +* function[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + +## 概要 +`real-if-needed`は、必要に応じて複素数の実部を返す、説明専用の関数オブジェクトである。 + +型`T`の式`E`に対して、式`real-if-needed(E)`は次と等価である。 + +1. `T`が算術型でなく、式`real(E)`が下記宣言を含むコンテキストにおいてオーバーロード解決を行った結果が妥当であるとき、`real(E)` + ```cpp + template + T real(const T&) = delete; + ``` +2. そうでない場合、`E` + + +## 備考 +オーバーロード解決により選択された関数が入力された複素数の実部を返さないとき、プログラムは不適格となる。 + + +## バージョン +### 言語 +- C++26 + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) + diff --git a/reference/linalg/vector_abs_sum.md b/reference/linalg/vector_abs_sum.md new file mode 100644 index 0000000000..5bfcedf83a --- /dev/null +++ b/reference/linalg/vector_abs_sum.md @@ -0,0 +1,132 @@ +# vector_abs_sum + +* [mathjax enable] +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::linalg { + template + Scalar vector_abs_sum(InVec v, Scalar init); // (1) + + template + Scalar vector_abs_sum(ExecutionPolicy&& exec, + InVec v, + Scalar init); // (2) + + template + auto vector_abs_sum(InVec v); // (3) + + template + auto vector_abs_sum(ExecutionPolicy&& exec, InVec v); // (4) +} +``` + + +## 概要 +ベクトルの各成分の絶対値の和(1ノルム)を計算する。 + +- (1): 逐次実行する。 +- (2): 指定された実行ポリシーに応じて実行する。 +- (3): (1)で`init`に`InVec::value_type`のデフォルト値を与えて逐次実行する。 +- (4): (2)で`init`に`InVec::value_type`のデフォルト値を与えて、指定された実行ポリシーに応じて実行する。 + + +## 適格要件 +- (1), (2): `decltype(init + `[`abs-if-needed`](abs-if-needed.md)`(`[`real-if-needed`](real-if-needed.md)`(declval())) + abs-if-needed(`[`imag-if-needed`](imag-if-needed.md)`(declval())))`が`Scalar`に変換可能。 + +## 効果 +- (3), (4): `T`を`typename InVec::value_type`とすると、 + + (3): `vector_abs_sum(v, T{})`を返す。 + + (4): `vector_abs_sum(std::forward(exec), v, T{})`を返す。 + + +## 戻り値 +- (1), (2): `N`を`v`の次元`v.extent(0)`とすると、以下を返す。 + 1. もし`N`が0なら`init` + 2. そうでない場合、もし`InVec::value_type`が算術型なら以下の式の値 + +$$ +\sum_{i = 0}^{N - 1} |\verb|v[|i\verb|]|| + \verb|init| +$$ + + 3. そうでない場合、以下の式の値 + +$$ +\sum_{i = 0}^{N - 1} \left\{|\mathrm{Re}(\verb|v[|i\verb|]|)| + |\mathrm{Im}(\verb|v[|i\verb|]|)|\right\} + \verb|init| +$$ + + +- (3), (4): `T`を`typename InVec::value_type`とすると、 + + (3): `vector_abs_sum(v, T{})`を返す。 + + (4): `vector_abs_sum(std::forward(exec), v, T{})`を返す。 + + +## 備考 +- (1), (2): もし`InVec::value_type`と`Scalar`がどちらも浮動小数点数型または`std::complex`の特殊化で、`Scalar`が`InVec::value_type`より精度が高い場合、和の各項は`Scalar`またはより高い精度の型が使われる。 + + +## 例 +**[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** + +```cpp +#include +#include +#include +#include +#include +#include + +int main() +{ + constexpr size_t N = 4; + + std::array vec(N); + + std::mdspan v(vec.data(), N); + + for(int i = 0; i < v.extent(0); ++i) v(i) = std::pow(-1.0, i) / (i + 1); + + std::cout << std::linalg::vector_abs_sum(v, -5.0 / 6) << '\n' // (1) + << std::linalg::vector_abs_sum(std::execution::par, v, -5.0 / 6) << '\n' // (2) + << std::linalg::vector_abs_sum(v) << '\n' // (3) + << std::linalg::vector_abs_sum(std::execution::par, v) << '\n'; // (4) + + return 0; +} +``` + + +### 出力 +``` +1.25 +1.25 +2.08333 +2.08333 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution`](/reference/execution.md) +- [`mdspan`](/reference/mdspan.md) + + +## 参照 +- [P0788R3 Standard Library Specification in a Concepts and Contracts World](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0788r3.pdf) +- [LAPACK: dzasum](https://netlib.org/lapack/explore-html/d5/d72/group__asum_gaf23444d1c822b34db864558d7afc76dd.html#gaf23444d1c822b34db864558d7afc76dd) + From d9a7c7835f303996e5bef9d9fb382c1a851af087 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Thu, 20 Jun 2024 10:46:32 +0900 Subject: [PATCH 0971/3948] =?UTF-8?q?linalg=20:=20vector=5Fidx=5Fabs=5Fmax?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 2 +- reference/linalg/vector_idx_abs_max.md | 104 +++++++++++++++++++++++++ 2 files changed, 105 insertions(+), 1 deletion(-) create mode 100644 reference/linalg/vector_idx_abs_max.md diff --git a/reference/linalg.md b/reference/linalg.md index 2d959e5cd8..8768027134 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -71,7 +71,7 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に | [`vector_sum_of_squares`](linalg/vector_sum_of_squares.md) | xLASSQ: ベクトル要素の平方和を求める (function template) | C++26 | | [`vector_two_norm`](linalg/vector_two_norm.md) | xNRM2: ベクトルのユークリッドノルム(Euclidean norm)を求める (function template) | C++26 | | [`vector_abs_sum`](linalg/vector_abs_sum.md) | xASUM: ベクトル要素の絶対値和を求める (function template) | C++26 | -| `vector_idx_abs_max` | xIAMAX: ベクトル要素のうち最大絶対値インデクスを返す (function template) | C++26 | +| [`vector_idx_abs_max`](linalg/vector_idx_abs_max.md) | xIAMAX: ベクトル要素のうち最大絶対値インデクスを返す (function template) | C++26 | | `matrix_frob_norm` | 行列のフロベニウスノルム(Frobenius norm)を求める (function template) | C++26 | | `matrix_one_norm` | 行列の1ノルム(One norm)を求める (function template) | C++26 | | `matrix_inf_norm` | 行列の無限大ノルム(Infinity norm)を求める (function template) | C++26 | diff --git a/reference/linalg/vector_idx_abs_max.md b/reference/linalg/vector_idx_abs_max.md new file mode 100644 index 0000000000..75efd86b5c --- /dev/null +++ b/reference/linalg/vector_idx_abs_max.md @@ -0,0 +1,104 @@ +# vector_abs_sum + +* [mathjax enable] +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::linalg { + template + typename InVec::size_type vector_idx_abs_max(InVec v); // (1) + + template + typename InVec::size_type vector_idx_abs_max(ExecutionPolicy&& exec, + InVec v); // (2) +} +``` + + +## 概要 +ベクトルの各成分の絶対値が最大となるインデックスを計算する。 + +- (1): 逐次実行する。 +- (2): 指定された実行ポリシーに応じて実行する。 + + +## 適格要件 +- (1), (2): `T`を`decltype(`[`abs-if-needed`](abs-if-needed.md)`(`[`real-if-needed`](real-if-needed.md)`(declval())) + abs-if-needed(`[`imag-if-needed`](imag-if-needed.md)`(declval())))`とすると、`declval() < declval()`が有効な式であること。 + + +## 戻り値 +- (1), (2): `N`を`v`の次元`v.extent(0)`とすると、以下を返す。 + 1. もし`N`が0なら`std::numeric_limits::max()` + 2. そうでない場合、もし`InVec::value_type`が算術型なら絶対値が最大の最初の`v`の成分のインデックス。つまり、 + $$ + \argmax_{i = 0, \dots, N - 1} |\verb|v[|i\verb|]|| + $$ + 3. そうでない場合、 + + $$ + \argmax_{i = 0, \dots, N - 1}\left\{|\mathrm{Re}(\verb|v[|i\verb|]|)| + |\mathrm{Im}(\verb|v[|i\verb|]|)|\right\} + $$ + + +## 例 +**[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** + +```cpp +#include +#include +#include +#include +#include +#include + +int main() +{ + constexpr size_t N = 4; + + std::array vec(N); + + std::mdspan v(vec.data(), N); + + for(int i = 0; i < v.extent(0); ++i) { + v(i) = std::pow(-1.0, i) / (i + 1); + } + + std::cout << stdex::linalg::vector_idx_abs_max(v) << '\n' // (1) + << stdex::linalg::vector_idx_abs_max(std::execution::par, v) << '\n'; // (2) + + return 0; +} +``` + + +### 出力 +``` +0 +0 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution`](/reference/execution.md) +- [`mdspan`](/reference/mdspan.md) + + +## 参照 +- [P0788R3 Standard Library Specification in a Concepts and Contracts World](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0788r3.pdf) +- [LAPACK: icamax](https://netlib.org/lapack/explore-html/dd/d52/group__iamax_gafdf273dcc3f020e2aa5c716c1b3d7265.html#gafdf273dcc3f020e2aa5c716c1b3d7265) + + From 1e07392983870e0b01b5e125f5897b702b4765cb Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Thu, 20 Jun 2024 11:04:38 +0900 Subject: [PATCH 0972/3948] =?UTF-8?q?linalg=20:=20vector=5Ftwo=5Fnorm?= =?UTF-8?q?=E3=81=AB=E4=BE=8B=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/vector_two_norm.md | 34 +++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/reference/linalg/vector_two_norm.md b/reference/linalg/vector_two_norm.md index 0bcb7e9e90..2da40436ce 100644 --- a/reference/linalg/vector_two_norm.md +++ b/reference/linalg/vector_two_norm.md @@ -63,9 +63,43 @@ $$ ## 例 +**[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** + +```cpp +#include +#include +#include +#include +#include +#include + +int main() +{ + constexpr size_t N = 4; + + std::array vec(N); + + std::mdspan v(vec.data(), N); + + for(int i = 0; i < v.extent(0); ++i) v(i) = std::pow(-1.0, i) / (i + 1); + + std::cout << std::linalg::vector_two_norm(v, 1.0 / 5) << '\n' // (1) + << std::linalg::vector_two_norm(std::execution::par, v, 1.0 / 5) << '\n' // (2) + << std::linalg::vector_two_norm(v) << '\n' // (3) + << std::linalg::vector_two_norm(std::execution::par, v) << '\n'; // (4) + + return 0; +} +``` ### 出力 +``` +1.46361 +1.46361 +1.42361 +1.42361 +``` ## バージョン From b6148aca2c7d7e3dc0b426e42f8877ef3020d440 Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 20 Jun 2024 18:40:21 +0900 Subject: [PATCH 0973/3948] =?UTF-8?q?chrono/last=5Fspec:=20=E8=AA=AC?= =?UTF-8?q?=E6=98=8E=E3=81=AE=E8=A1=A8=E7=8F=BE=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/chrono.md | 4 ++-- reference/chrono/last_spec.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/chrono.md b/reference/chrono.md index 259a9bcd82..c8b3d8c302 100644 --- a/reference/chrono.md +++ b/reference/chrono.md @@ -119,7 +119,7 @@ | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`last_spec`](chrono/last_spec.md) | 月の最終日、週の最終日など、文脈に応じた「最後」を表す型 (class) | C++20 | +| [`last_spec`](chrono/last_spec.md) | 月の最終日、月の最終曜日など、文脈に応じた「最後」を表す型 (class) | C++20 | | [`day`](chrono/day.md) | 未規定の月の指定した日を表す型 (class) | C++20 | | [`month`](chrono/month.md) | 月単体の値を表す型 (class) | C++20 | | [`year`](chrono/year.md) | カレンダーの年を表す型 (class) | C++20 | @@ -224,7 +224,7 @@ | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`last`](chrono/last_spec.md) | 月の最終日、週の最終日など、文脈に応じた「最後」を表す定数 (variable) | C++20 | +| [`last`](chrono/last_spec.md) | 月の最終日、月の最終曜日など、文脈に応じた「最後」を表す定数 (variable) | C++20 | ### 曜日 diff --git a/reference/chrono/last_spec.md b/reference/chrono/last_spec.md index f467b236c2..0b66dd40cb 100644 --- a/reference/chrono/last_spec.md +++ b/reference/chrono/last_spec.md @@ -15,7 +15,7 @@ namespace std::chrono { ``` ## 概要 -`last_spec`は、月の最終日、週の最終日など、文脈に応じた「最後」を表す型である。その型の値として`last`が定義される。 +`last_spec`は、月の最終日、月の最終曜日など、文脈に応じた「最後」を表す型である。その型の値として`last`が定義される。 ## 非メンバ関数 From e02d8afc3cb9d94bd70430b42671aa460080dcad Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Fri, 21 Jun 2024 14:34:15 +0900 Subject: [PATCH 0974/3948] =?UTF-8?q?linalg=20:=20=E4=BE=8B=E3=81=AEarray?= =?UTF-8?q?=E3=81=AE=E5=88=9D=E6=9C=9F=E5=8C=96=E3=82=92=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/vector_abs_sum.md | 2 +- reference/linalg/vector_idx_abs_max.md | 2 +- reference/linalg/vector_two_norm.md | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/reference/linalg/vector_abs_sum.md b/reference/linalg/vector_abs_sum.md index 5bfcedf83a..efb733751d 100644 --- a/reference/linalg/vector_abs_sum.md +++ b/reference/linalg/vector_abs_sum.md @@ -85,7 +85,7 @@ int main() { constexpr size_t N = 4; - std::array vec(N); + std::array vec; std::mdspan v(vec.data(), N); diff --git a/reference/linalg/vector_idx_abs_max.md b/reference/linalg/vector_idx_abs_max.md index 75efd86b5c..a7e1c80b3b 100644 --- a/reference/linalg/vector_idx_abs_max.md +++ b/reference/linalg/vector_idx_abs_max.md @@ -58,7 +58,7 @@ int main() { constexpr size_t N = 4; - std::array vec(N); + std::array vec; std::mdspan v(vec.data(), N); diff --git a/reference/linalg/vector_two_norm.md b/reference/linalg/vector_two_norm.md index 2da40436ce..5cc9d1a7f6 100644 --- a/reference/linalg/vector_two_norm.md +++ b/reference/linalg/vector_two_norm.md @@ -77,11 +77,13 @@ int main() { constexpr size_t N = 4; - std::array vec(N); + std::array vec; std::mdspan v(vec.data(), N); - for(int i = 0; i < v.extent(0); ++i) v(i) = std::pow(-1.0, i) / (i + 1); + for(int i = 0; i < v.extent(0); ++i) { + v(i) = std::pow(-1.0, i) / (i + 1); + } std::cout << std::linalg::vector_two_norm(v, 1.0 / 5) << '\n' // (1) << std::linalg::vector_two_norm(std::execution::par, v, 1.0 / 5) << '\n' // (2) From 9a7ce19111eafcadfa6d28ef833bf06e611f7230 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Fri, 21 Jun 2024 14:35:36 +0900 Subject: [PATCH 0975/3948] =?UTF-8?q?linalg=20:=20matrix=5Ffrob=5Fnorm?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 2 +- reference/linalg/matrix_frob_norm.md | 128 +++++++++++++++++++++++++++ 2 files changed, 129 insertions(+), 1 deletion(-) create mode 100644 reference/linalg/matrix_frob_norm.md diff --git a/reference/linalg.md b/reference/linalg.md index 8768027134..37503ccb51 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -72,7 +72,7 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に | [`vector_two_norm`](linalg/vector_two_norm.md) | xNRM2: ベクトルのユークリッドノルム(Euclidean norm)を求める (function template) | C++26 | | [`vector_abs_sum`](linalg/vector_abs_sum.md) | xASUM: ベクトル要素の絶対値和を求める (function template) | C++26 | | [`vector_idx_abs_max`](linalg/vector_idx_abs_max.md) | xIAMAX: ベクトル要素のうち最大絶対値インデクスを返す (function template) | C++26 | -| `matrix_frob_norm` | 行列のフロベニウスノルム(Frobenius norm)を求める (function template) | C++26 | +| [`matrix_frob_norm`](linalg/matrix_frob_norm.md) | 行列のフロベニウスノルム(Frobenius norm)を求める (function template) | C++26 | | `matrix_one_norm` | 行列の1ノルム(One norm)を求める (function template) | C++26 | | `matrix_inf_norm` | 行列の無限大ノルム(Infinity norm)を求める (function template) | C++26 | diff --git a/reference/linalg/matrix_frob_norm.md b/reference/linalg/matrix_frob_norm.md new file mode 100644 index 0000000000..ff80a90a55 --- /dev/null +++ b/reference/linalg/matrix_frob_norm.md @@ -0,0 +1,128 @@ +# matrix_frob_norm + +* [mathjax enable] +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::linalg { + template + Scalar matrix_frob_norm(InMat A, Scalar init); // (1) + + template + Scalar matrix_frob_norm( + ExecutionPolicy&& exec, + InMat A, + Scalar init); // (2) + + template + auto matrix_frob_norm(InMat A); // (3) + + template + auto matrix_frob_norm(ExecutionPolicy&& exec, InMat A); // (4) +} +``` + + +## 概要 +行列のフロベニウスノルムを計算する。 + +- (1): 逐次実行する。 +- (2): 指定された実行ポリシーに応じて実行する。 +- (3): (1)で`init`に`InMat::value_type`のデフォルト値を与えて逐次実行する。 +- (4): (2)で`init`に`InMat::value_type`のデフォルト値を与えて、指定された実行ポリシーに応じて実行する。 + + +## 適格要件 +- (1), (2): `decltype(init + `[`abs-if-needed`](abs-if-needed.md)`(declval()) * abs-if-needed(declval()))`が`Scalar`に変換可能。 + +## 効果 +- (3), (4): `T`を`decltype(abs-if-needed(declval()) * abs-if-needed(declval()))`とすると、 + + (3): `matrix_frob_norm(v, T{})`を返す。 + + (4): `matrix_frob_norm(std::forward(exec), v, T{})`を返す。 + + +## 戻り値 +- (1), (2): `A`が $m \times n$ 行列とすると、以下の式の値を返す。 + +$$ +\sqrt{\sum_{i = 0}^{m - 1} \sum_{j = 0}^{n - 1} |\verb|A[|i, j\verb|]||^2 + \verb|init|^2} +$$ + +- (3), (4): `T`を`decltype(abs-if-needed(declval()) * abs-if-needed(declval()))`とすると、 + + (3): `matrix_frob_norm(v, T{})`を返す。 + + (4): `matrix_frob_norm(std::forward(exec), v, T{})`を返す。 + + +## 備考 +- (1), (2): もし`InMat::value_type`と`Scalar`がどちらも浮動小数点数型または`std::complex`の特殊化で、`Scalar`が`InMat::value_type`より精度が高い場合、和の各項は`Scalar`またはより高い精度の型が使われる。 + + +## 例 +**[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** + +```cpp +#include +#include +#include +#include +#include +#include + +int main() +{ + constexpr size_t M = 4; + constexpr size_t N = 4; + + std::array vec; + + std::mdspan v(vec.data(), M, N); + + for(int i = 0; i < A.extent(0); ++i) { + for(int j = 0; j < A.extent(1); ++j) { + A(i,j) = ((i + j) % 2 == 0 ? 1.0 : -1.0) / (i * A.extent(1) + j + 1); + } + } + + std::cout << stdex::linalg::matrix_frob_norm(A, 1.0 / (M + N + 1)) << '\n' + << stdex::linalg::matrix_frob_norm(std::execution::par, A, 1.0 / (M + N + 1)) << '\n' + << stdex::linalg::matrix_frob_norm(A) << '\n' + << stdex::linalg::matrix_frob_norm(std::execution::par, A) << '\n'; + + return 0; +} +``` + + +### 出力 +``` +1.2636 +1.2636 +1.25871 +1.25871 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution`](/reference/execution.md) +- [`mdspan`](/reference/mdspan.md) + + +## 参照 +- [P0788R3 Standard Library Specification in a Concepts and Contracts World](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0788r3.pdf) + From d09b68e396825e3f18046c686930bec978652dda Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Fri, 21 Jun 2024 15:20:26 +0900 Subject: [PATCH 0976/3948] =?UTF-8?q?linalg=20:=20vector=5Fsum=5Fof=5Fsqua?= =?UTF-8?q?res=E3=81=AB=E4=BE=8B=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/vector_sum_of_squares.md | 50 +++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/reference/linalg/vector_sum_of_squares.md b/reference/linalg/vector_sum_of_squares.md index 475f3d4148..564216e6d9 100644 --- a/reference/linalg/vector_sum_of_squares.md +++ b/reference/linalg/vector_sum_of_squares.md @@ -64,9 +64,59 @@ $$ ## 例 +**[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** + +```cpp +#include +#include +#include +#include +#include +#include + + +template +Scalar get_sum_of_squares(std::linalg::sum_of_squares_result result) { + return std::pow(result.scaling_factor, 2) * result.scaled_sum_of_squares; +} + + +int main() +{ + constexpr size_t N = 4; + + std::array vec; + + std::mdspan v(vec.data(), N); + + for(int i = 0; i < v.extent(0); ++i) { + v(i) = std::pow(-1.0, i) / (i + 1); + } + + auto init = std::linalg::sum_of_squares_result{.scaling_factor = 1.0 / 5, + .scaled_sum_of_squares = 1.0}; + + std::cout << get_sum_of_squares( + std::linalg::vector_sum_of_squares(v, init)) // (1) + << get_sum_of_squares( + std::linalg::vector_sum_of_squares(std::execution::par, v, init)) << '\n' // (2) + << get_sum_of_squares( + std::linalg::vector_sum_of_squares(v)) << '\n' // (3) + << get_sum_of_squares( + std::linalg::vector_sum_of_squares(std::execution::par, v)) << '\n'; // (4) + + return 0; +} +``` ### 出力 +``` +1.46361 +1.46361 +1.42361 +1.42361 +``` ## バージョン From 5e3a1e9358dce420871a0369d821b230a8668c6a Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Sat, 22 Jun 2024 12:06:03 +0900 Subject: [PATCH 0977/3948] =?UTF-8?q?linalg=20:=20=E7=B4=B0=E3=81=8B?= =?UTF-8?q?=E3=81=AA=E4=BF=AE=E6=AD=A3=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/matrix_frob_norm.md | 16 ++++++++-------- reference/linalg/vector_idx_abs_max.md | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/reference/linalg/matrix_frob_norm.md b/reference/linalg/matrix_frob_norm.md index ff80a90a55..727a0f3d16 100644 --- a/reference/linalg/matrix_frob_norm.md +++ b/reference/linalg/matrix_frob_norm.md @@ -42,8 +42,8 @@ namespace std::linalg { ## 効果 - (3), (4): `T`を`decltype(abs-if-needed(declval()) * abs-if-needed(declval()))`とすると、 - + (3): `matrix_frob_norm(v, T{})`を返す。 - + (4): `matrix_frob_norm(std::forward(exec), v, T{})`を返す。 + + (3): `matrix_frob_norm(A, T{})`を返す。 + + (4): `matrix_frob_norm(std::forward(exec), A, T{})`を返す。 ## 戻り値 @@ -54,8 +54,8 @@ $$ $$ - (3), (4): `T`を`decltype(abs-if-needed(declval()) * abs-if-needed(declval()))`とすると、 - + (3): `matrix_frob_norm(v, T{})`を返す。 - + (4): `matrix_frob_norm(std::forward(exec), v, T{})`を返す。 + + (3): `matrix_frob_norm(A, T{})`を返す。 + + (4): `matrix_frob_norm(std::forward(exec), A, T{})`を返す。 ## 備考 @@ -88,10 +88,10 @@ int main() } } - std::cout << stdex::linalg::matrix_frob_norm(A, 1.0 / (M + N + 1)) << '\n' - << stdex::linalg::matrix_frob_norm(std::execution::par, A, 1.0 / (M + N + 1)) << '\n' - << stdex::linalg::matrix_frob_norm(A) << '\n' - << stdex::linalg::matrix_frob_norm(std::execution::par, A) << '\n'; + std::cout << std::linalg::matrix_frob_norm(A, 1.0 / (M * N + 1)) << '\n' + << std::linalg::matrix_frob_norm(std::execution::par, A, 1.0 / (M * N + 1)) << '\n' + << std::linalg::matrix_frob_norm(A) << '\n' + << std::linalg::matrix_frob_norm(std::execution::par, A) << '\n'; return 0; } diff --git a/reference/linalg/vector_idx_abs_max.md b/reference/linalg/vector_idx_abs_max.md index a7e1c80b3b..f43aeb0e7a 100644 --- a/reference/linalg/vector_idx_abs_max.md +++ b/reference/linalg/vector_idx_abs_max.md @@ -66,8 +66,8 @@ int main() v(i) = std::pow(-1.0, i) / (i + 1); } - std::cout << stdex::linalg::vector_idx_abs_max(v) << '\n' // (1) - << stdex::linalg::vector_idx_abs_max(std::execution::par, v) << '\n'; // (2) + std::cout << std::linalg::vector_idx_abs_max(v) << '\n' // (1) + << std::linalg::vector_idx_abs_max(std::execution::par, v) << '\n'; // (2) return 0; } From 2b134c353aea5353a72b0d9255fb5c3852c68609 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Sat, 22 Jun 2024 12:07:01 +0900 Subject: [PATCH 0978/3948] =?UTF-8?q?linalg=20:=20matrix=5Fone=5Fnorm?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 2 +- reference/linalg/matrix_one_norm.md | 131 ++++++++++++++++++++++++++++ 2 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 reference/linalg/matrix_one_norm.md diff --git a/reference/linalg.md b/reference/linalg.md index 37503ccb51..f1fba87b52 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -73,7 +73,7 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に | [`vector_abs_sum`](linalg/vector_abs_sum.md) | xASUM: ベクトル要素の絶対値和を求める (function template) | C++26 | | [`vector_idx_abs_max`](linalg/vector_idx_abs_max.md) | xIAMAX: ベクトル要素のうち最大絶対値インデクスを返す (function template) | C++26 | | [`matrix_frob_norm`](linalg/matrix_frob_norm.md) | 行列のフロベニウスノルム(Frobenius norm)を求める (function template) | C++26 | -| `matrix_one_norm` | 行列の1ノルム(One norm)を求める (function template) | C++26 | +| [`matrix_one_norm`](linalg/matrix_one_norm.md) | 行列の1ノルム(One norm)を求める (function template) | C++26 | | `matrix_inf_norm` | 行列の無限大ノルム(Infinity norm)を求める (function template) | C++26 | diff --git a/reference/linalg/matrix_one_norm.md b/reference/linalg/matrix_one_norm.md new file mode 100644 index 0000000000..28e4399e48 --- /dev/null +++ b/reference/linalg/matrix_one_norm.md @@ -0,0 +1,131 @@ +# matrix_one_norm + +* [mathjax enable] +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::linalg { + template + Scalar matrix_one_norm(InMat A, Scalar init); // (1) + + template + Scalar matrix_one_norm( + ExecutionPolicy&& exec, + InMat A, + Scalar init); // (2) + + template + auto matrix_one_norm(InMat A); // (3) + + template + auto matrix_one_norm(ExecutionPolicy&& exec, InMat A); // (4) +} +``` + + +## 概要 +行列の1ノルムを計算する。 + +- (1): 逐次実行する。 +- (2): 指定された実行ポリシーに応じて実行する。 +- (3): (1)で`init`に`InMat::value_type`のデフォルト値を与えて逐次実行する。 +- (4): (2)で`init`に`InMat::value_type`のデフォルト値を与えて、指定された実行ポリシーに応じて実行する。 + + +## 適格要件 +- (1), (2): `decltype(`[`abs-if-needed`](abs-if-needed.md)`(declval()))`が`Scalar`に変換可能。 + + +## 効果 +- (3), (4): `T`を`decltype(abs-if-needed(declval()))`とすると、 + + (3): `matrix_one_norm(A, T{})`を返す。 + + (4): `matrix_one_norm(std::forward(exec), A, T{})`を返す。 + + +## 戻り値 +- (1), (2): `A`が $m \times n$ 行列とすると、以下の値を返す。 + 1. もし、`n`が0なら`init` + 2. そうでないなら、以下の式の値 + +$$ +\verb|init| + \max_{j = 0, \dots ,n - 1}\sum_{i = 0}^{m - 1} |\verb|A[|i, j\verb|]|| +$$ + +- (3), (4): `T`を`decltype(abs-if-needed(declval()))`とすると、 + + (3): `matrix_one_norm(A, T{})`を返す。 + + (4): `matrix_one_norm(std::forward(exec), A, T{})`を返す。 + + +## 備考 +- (1), (2): もし`InMat::value_type`と`Scalar`がどちらも浮動小数点数型または`std::complex`の特殊化で、`Scalar`が`InMat::value_type`より精度が高い場合、和の各項は`Scalar`またはより高い精度の型が使われる。 + + +## 例 +**[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** + +```cpp +#include +#include +#include +#include +#include +#include + +int main() +{ + constexpr size_t M = 4; + constexpr size_t N = 4; + + std::array vec; + + std::mdspan v(vec.data(), M, N); + + for(int i = 0; i < A.extent(0); ++i) { + for(int j = 0; j < A.extent(1); ++j) { + A(i,j) = ((i + j) % 2 == 0 ? 1.0 : -1.0) / (i * A.extent(1) + j + 1); + } + } + + std::cout << std::linalg::matrix_one_norm(A, -1.0 / 9 - 1.0 / 13) << '\n' + << std::linalg::matrix_one_norm(std::execution::par, A, -1.0 / 9 - 1.0 / 13) << '\n' + << std::linalg::matrix_one_norm(A) << '\n' + << std::linalg::matrix_one_norm(std::execution::par, A) << '\n'; + + return 0; +} +``` + + +### 出力 +``` +1.2 +1.2 +1.38803 +1.38803 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution`](/reference/execution.md) +- [`mdspan`](/reference/mdspan.md) + + +## 参照 +- [P0788R3 Standard Library Specification in a Concepts and Contracts World](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0788r3.pdf) + From d565808f5f5213124bd43cbf2633eea9ae271e4f Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Sat, 22 Jun 2024 15:18:55 +0900 Subject: [PATCH 0979/3948] =?UTF-8?q?linalg=20:=20sum=5Fof=5Fsquares=5Fres?= =?UTF-8?q?ult=E3=81=AE=E4=BE=8B=E3=82=92=E5=89=8A=E9=99=A4=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/sum_of_squares_result.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/reference/linalg/sum_of_squares_result.md b/reference/linalg/sum_of_squares_result.md index 97b3a17ba1..bd42246a4b 100644 --- a/reference/linalg/sum_of_squares_result.md +++ b/reference/linalg/sum_of_squares_result.md @@ -19,12 +19,6 @@ namespace std::linalg { スケールされた、ベクトルの成分の2乗和の結果を表すクラス。詳しくは、[`vector_sum_of_squares`](vector_sum_of_squares.md)にて。 -## 例 - - -### 出力 - - ## バージョン ### 言語 - C++26 From 1b89c3ce9584d4364ceb0c10fe23bdc7e7811e1a Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Sun, 23 Jun 2024 13:36:57 +0900 Subject: [PATCH 0980/3948] =?UTF-8?q?linalg=20:=20matrix=5Finf=5Fnorm?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 2 +- reference/linalg/matrix_inf_norm.md | 131 ++++++++++++++++++++++++++++ 2 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 reference/linalg/matrix_inf_norm.md diff --git a/reference/linalg.md b/reference/linalg.md index f1fba87b52..677e32fe28 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -74,7 +74,7 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に | [`vector_idx_abs_max`](linalg/vector_idx_abs_max.md) | xIAMAX: ベクトル要素のうち最大絶対値インデクスを返す (function template) | C++26 | | [`matrix_frob_norm`](linalg/matrix_frob_norm.md) | 行列のフロベニウスノルム(Frobenius norm)を求める (function template) | C++26 | | [`matrix_one_norm`](linalg/matrix_one_norm.md) | 行列の1ノルム(One norm)を求める (function template) | C++26 | -| `matrix_inf_norm` | 行列の無限大ノルム(Infinity norm)を求める (function template) | C++26 | +| [`matrix_inf_norm`](linalg/matrix_inf_norm.md) | 行列の無限大ノルム(Infinity norm)を求める (function template) | C++26 | ## BLAS 2アルゴリズム diff --git a/reference/linalg/matrix_inf_norm.md b/reference/linalg/matrix_inf_norm.md new file mode 100644 index 0000000000..328b5093d2 --- /dev/null +++ b/reference/linalg/matrix_inf_norm.md @@ -0,0 +1,131 @@ +# matrix_inf_norm + +* [mathjax enable] +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::linalg { + template + Scalar matrix_inf_norm(InMat A, Scalar init); // (1) + + template + Scalar matrix_inf_norm( + ExecutionPolicy&& exec, + InMat A, + Scalar init); // (2) + + template + auto matrix_inf_norm(InMat A); // (3) + + template + auto matrix_inf_norm(ExecutionPolicy&& exec, InMat A); // (4) +} +``` + + +## 概要 +行列の無限大ノルムを計算する。 + +- (1): 逐次実行する。 +- (2): 指定された実行ポリシーに応じて実行する。 +- (3): (1)で`init`に`InMat::value_type`のデフォルト値を与えて逐次実行する。 +- (4): (2)で`init`に`InMat::value_type`のデフォルト値を与えて、指定された実行ポリシーに応じて実行する。 + + +## 適格要件 +- (1), (2): `decltype(`[`abs-if-needed`](abs-if-needed.md)`(declval()))`が`Scalar`に変換可能。 + + +## 効果 +- (3), (4): `T`を`decltype(abs-if-needed(declval()))`とすると、 + + (3): `matrix_inf_norm(A, T{})`を返す。 + + (4): `matrix_inf_norm(std::forward(exec), A, T{})`を返す。 + + +## 戻り値 +- (1), (2): `A`が $m \times n$ 行列とすると、以下の値を返す。 + 1. もし、`m`が0なら`init` + 2. そうでないなら、以下の式の値 + +$$ +\verb|init| + \max_{i = 0, \dots ,m - 1}\sum_{j = 0}^{n - 1} |\verb|A[|i, j\verb|]|| +$$ + +- (3), (4): `T`を`decltype(abs-if-needed(declval()))`とすると、 + + (3): `matrix_inf_norm(A, T{})`を返す。 + + (4): `matrix_inf_norm(std::forward(exec), A, T{})`を返す。 + + +## 備考 +- (1), (2): もし`InMat::value_type`と`Scalar`がどちらも浮動小数点数型または`std::complex`の特殊化で、`Scalar`が`InMat::value_type`より精度が高い場合、和の各項は`Scalar`またはより高い精度の型が使われる。 + + +## 例 +**[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** + +```cpp +#include +#include +#include +#include +#include +#include + +int main() +{ + constexpr size_t M = 4; + constexpr size_t N = 4; + + std::array mat; + + std::mdspan A(mat.data(), M, N); + + for(int i = 0; i < A.extent(0); ++i) { + for(int j = 0; j < A.extent(1); ++j) { + A(i,j) = ((i + j) % 2 == 0 ? 1.0 : -1.0) / (i * A.extent(1) + j + 1); + } + } + + std::cout << std::linalg::matrix_inf_norm(A, -1.0 / 3) << '\n' + << std::linalg::matrix_inf_norm(std::execution::par, A, -1.0 / 3) << '\n' + << std::linalg::matrix_inf_norm(A) << '\n' + << std::linalg::matrix_inf_norm(std::execution::par, A) << '\n'; + + return 0; +} +``` + + +### 出力 +``` +1.75 +1.75 +2.08333 +2.08333 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution`](/reference/execution.md) +- [`mdspan`](/reference/mdspan.md) + + +## 参照 +- [P0788R3 Standard Library Specification in a Concepts and Contracts World](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0788r3.pdf) + From 083e86c2c65a1cefe442ad07ba806e4cb35c74a8 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Sun, 23 Jun 2024 13:54:28 +0900 Subject: [PATCH 0981/3948] =?UTF-8?q?linalg=20:=20=E8=A1=8C=E5=88=97?= =?UTF-8?q?=E3=83=8E=E3=83=AB=E3=83=A0=E3=81=AE=E4=BE=8B=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/matrix_frob_norm.md | 12 ++++++------ reference/linalg/matrix_one_norm.md | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/reference/linalg/matrix_frob_norm.md b/reference/linalg/matrix_frob_norm.md index 727a0f3d16..44e67ef2ae 100644 --- a/reference/linalg/matrix_frob_norm.md +++ b/reference/linalg/matrix_frob_norm.md @@ -78,9 +78,9 @@ int main() constexpr size_t M = 4; constexpr size_t N = 4; - std::array vec; + std::array mat; - std::mdspan v(vec.data(), M, N); + std::mdspan A(mat.data(), M, N); for(int i = 0; i < A.extent(0); ++i) { for(int j = 0; j < A.extent(1); ++j) { @@ -100,10 +100,10 @@ int main() ### 出力 ``` -1.2636 -1.2636 -1.25871 -1.25871 +1.58781 +1.58781 +1.58435 +1.58435 ``` diff --git a/reference/linalg/matrix_one_norm.md b/reference/linalg/matrix_one_norm.md index 28e4399e48..10fd69e87a 100644 --- a/reference/linalg/matrix_one_norm.md +++ b/reference/linalg/matrix_one_norm.md @@ -81,9 +81,9 @@ int main() constexpr size_t M = 4; constexpr size_t N = 4; - std::array vec; + std::array mat; - std::mdspan v(vec.data(), M, N); + std::mdspan A(mat.data(), M, N); for(int i = 0; i < A.extent(0); ++i) { for(int j = 0; j < A.extent(1); ++j) { From 7cad8290373b2d9f64cc35f8edd7dbc666422034 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Sun, 23 Jun 2024 14:30:38 +0900 Subject: [PATCH 0982/3948] =?UTF-8?q?linalg=20:=20dotc=E3=81=AB=E4=BE=8B?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/dotc.md | 42 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/reference/linalg/dotc.md b/reference/linalg/dotc.md index e5c920564b..4ca16f3f2f 100644 --- a/reference/linalg/dotc.md +++ b/reference/linalg/dotc.md @@ -78,9 +78,51 @@ $$ ## 例 +**[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** + +```cpp +#include +#include +#include +#include +#include +#include +#include +#include + +int main() +{ + constexpr size_t N = 4; + + std::vector> a_vec(N); + std::mdspan a(a_vec.data(), N); + + for(int i = 0; i < a.extent(0); ++i) { + auto sign = i % 2 == 0 ? 1.0 : -1.0; + a[i].real(sign / (2 * i + 1)); + a[i].imag(-sign / (2 * (i + 1))); + } + + std::vector> b_vec(a_vec); + std::mdspan b(b_vec.data(), N); + + std::cout << std::linalg::dotc(a, b, std::complex(-std::numbers::pi * std::numbers::pi / 6, 0)) << '\n' // (1) + << std::linalg::dotc(std::execution::par, a, b, std::complex(-std::numbers::pi * std::numbers::pi / 6, 0)) << '\n' // (2) + << std::linalg::dotc(a, b) << '\n' // (3) + << std::linalg::dotc(std::execution::par, a, b) << '\n'; // (4) + + return 0; +} +``` ### 出力 +``` +(-0.117512,-4.62593e-19) +(-0.117512,0) +(1.52742,-4.62593e-19) +(1.52742,0) +``` ## バージョン From 0512389eb0396ecf5f9388d793a63664ef867e0d Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Sun, 23 Jun 2024 14:33:24 +0900 Subject: [PATCH 0983/3948] =?UTF-8?q?linalg=20:=20mdspan=E3=81=AE=E6=88=90?= =?UTF-8?q?=E5=88=86=E3=81=B8=E3=81=AE=E3=82=A2=E3=82=AF=E3=82=BB=E3=82=B9?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/matrix_frob_norm.md | 2 +- reference/linalg/matrix_inf_norm.md | 2 +- reference/linalg/matrix_one_norm.md | 2 +- reference/linalg/vector_abs_sum.md | 4 +++- reference/linalg/vector_idx_abs_max.md | 2 +- reference/linalg/vector_sum_of_squares.md | 2 +- reference/linalg/vector_two_norm.md | 2 +- 7 files changed, 9 insertions(+), 7 deletions(-) diff --git a/reference/linalg/matrix_frob_norm.md b/reference/linalg/matrix_frob_norm.md index 44e67ef2ae..93bc6b362f 100644 --- a/reference/linalg/matrix_frob_norm.md +++ b/reference/linalg/matrix_frob_norm.md @@ -84,7 +84,7 @@ int main() for(int i = 0; i < A.extent(0); ++i) { for(int j = 0; j < A.extent(1); ++j) { - A(i,j) = ((i + j) % 2 == 0 ? 1.0 : -1.0) / (i * A.extent(1) + j + 1); + A[i,j] = ((i + j) % 2 == 0 ? 1.0 : -1.0) / (i * A.extent(1) + j + 1); } } diff --git a/reference/linalg/matrix_inf_norm.md b/reference/linalg/matrix_inf_norm.md index 328b5093d2..1778fffdc0 100644 --- a/reference/linalg/matrix_inf_norm.md +++ b/reference/linalg/matrix_inf_norm.md @@ -87,7 +87,7 @@ int main() for(int i = 0; i < A.extent(0); ++i) { for(int j = 0; j < A.extent(1); ++j) { - A(i,j) = ((i + j) % 2 == 0 ? 1.0 : -1.0) / (i * A.extent(1) + j + 1); + A[i,j] = ((i + j) % 2 == 0 ? 1.0 : -1.0) / (i * A.extent(1) + j + 1); } } diff --git a/reference/linalg/matrix_one_norm.md b/reference/linalg/matrix_one_norm.md index 10fd69e87a..9117543704 100644 --- a/reference/linalg/matrix_one_norm.md +++ b/reference/linalg/matrix_one_norm.md @@ -87,7 +87,7 @@ int main() for(int i = 0; i < A.extent(0); ++i) { for(int j = 0; j < A.extent(1); ++j) { - A(i,j) = ((i + j) % 2 == 0 ? 1.0 : -1.0) / (i * A.extent(1) + j + 1); + A[i,j] = ((i + j) % 2 == 0 ? 1.0 : -1.0) / (i * A.extent(1) + j + 1); } } diff --git a/reference/linalg/vector_abs_sum.md b/reference/linalg/vector_abs_sum.md index efb733751d..72543f3fac 100644 --- a/reference/linalg/vector_abs_sum.md +++ b/reference/linalg/vector_abs_sum.md @@ -89,7 +89,9 @@ int main() std::mdspan v(vec.data(), N); - for(int i = 0; i < v.extent(0); ++i) v(i) = std::pow(-1.0, i) / (i + 1); + for(int i = 0; i < v.extent(0); ++i) { + v[i] = std::pow(-1.0, i) / (i + 1); + } std::cout << std::linalg::vector_abs_sum(v, -5.0 / 6) << '\n' // (1) << std::linalg::vector_abs_sum(std::execution::par, v, -5.0 / 6) << '\n' // (2) diff --git a/reference/linalg/vector_idx_abs_max.md b/reference/linalg/vector_idx_abs_max.md index f43aeb0e7a..fbf1a1be17 100644 --- a/reference/linalg/vector_idx_abs_max.md +++ b/reference/linalg/vector_idx_abs_max.md @@ -63,7 +63,7 @@ int main() std::mdspan v(vec.data(), N); for(int i = 0; i < v.extent(0); ++i) { - v(i) = std::pow(-1.0, i) / (i + 1); + v[i] = std::pow(-1.0, i) / (i + 1); } std::cout << std::linalg::vector_idx_abs_max(v) << '\n' // (1) diff --git a/reference/linalg/vector_sum_of_squares.md b/reference/linalg/vector_sum_of_squares.md index 564216e6d9..fbebfbbdce 100644 --- a/reference/linalg/vector_sum_of_squares.md +++ b/reference/linalg/vector_sum_of_squares.md @@ -90,7 +90,7 @@ int main() std::mdspan v(vec.data(), N); for(int i = 0; i < v.extent(0); ++i) { - v(i) = std::pow(-1.0, i) / (i + 1); + v[i] = std::pow(-1.0, i) / (i + 1); } auto init = std::linalg::sum_of_squares_result{.scaling_factor = 1.0 / 5, diff --git a/reference/linalg/vector_two_norm.md b/reference/linalg/vector_two_norm.md index 5cc9d1a7f6..a69f7d157f 100644 --- a/reference/linalg/vector_two_norm.md +++ b/reference/linalg/vector_two_norm.md @@ -82,7 +82,7 @@ int main() std::mdspan v(vec.data(), N); for(int i = 0; i < v.extent(0); ++i) { - v(i) = std::pow(-1.0, i) / (i + 1); + v[i] = std::pow(-1.0, i) / (i + 1); } std::cout << std::linalg::vector_two_norm(v, 1.0 / 5) << '\n' // (1) From ce9c6a00eac7366a389310f2418f295369daeda2 Mon Sep 17 00:00:00 2001 From: I <1091761+wx257osn2@users.noreply.github.com> Date: Mon, 24 Jun 2024 18:48:57 +0900 Subject: [PATCH 0984/3948] fix typo --- reference/system_error/error_code.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/system_error/error_code.md b/reference/system_error/error_code.md index 80bd480849..97fc793b57 100644 --- a/reference/system_error/error_code.md +++ b/reference/system_error/error_code.md @@ -13,7 +13,7 @@ namespace std { ## 概要 `error_code`は、OSのAPIで発生するエラー値およびそのエラーメッセージを扱うクラスである。 -このクラス主に、[`system_error`](system_error.md)例外クラスに付加する情報として使用する。 +このクラスは主に、[`system_error`](system_error.md)例外クラスに付加する情報として使用する。 ## メンバ関数 From ac5303ab1b577a790d0f1fb277966734bdbbab17 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Tue, 25 Jun 2024 12:50:24 +0900 Subject: [PATCH 0985/3948] =?UTF-8?q?linalg=20:=20matrix=5Fvector=5Fproduc?= =?UTF-8?q?t=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 2 +- reference/linalg/matrix_vector_product.md | 200 ++++++++++++++++++++++ reference/linalg/multipliable.md | 65 +++++++ reference/linalg/possibly-multipliable.md | 59 +++++++ 4 files changed, 325 insertions(+), 1 deletion(-) create mode 100644 reference/linalg/matrix_vector_product.md create mode 100644 reference/linalg/multipliable.md create mode 100644 reference/linalg/possibly-multipliable.md diff --git a/reference/linalg.md b/reference/linalg.md index 677e32fe28..21c82f0e2f 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -81,7 +81,7 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| `matrix_vector_product` | xGEMV: 一般行列とベクトルの積を求める (function template) | C++26 | +| [`matrix_vector_product`](linalg/matrix_vector_product.md) | xGEMV: 一般行列とベクトルの積を求める (function template) | C++26 | | `symmetric_matrix_vector_product` | xSYMV: 対称行列とベクトルの積を求める (function template) | C++26 | | `hermitian_matrix_vector_product` | xHEMV: ハミルトニアン行列とベクトルの積を求める (function template) | C++26 | | `triangular_matrix_vector_product` | xTRMV: 三角行列とベクトルの積を求める (function template) | C++26 | diff --git a/reference/linalg/matrix_vector_product.md b/reference/linalg/matrix_vector_product.md new file mode 100644 index 0000000000..615ddbce53 --- /dev/null +++ b/reference/linalg/matrix_vector_product.md @@ -0,0 +1,200 @@ +# matrix_vector_product + + +* [mathjax enable] +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + + +```cpp +namespace std::linalg { + template + void matrix_vector_product(InMat A, + InVec x, + OutVec y); + + template + void matrix_vector_product(ExecutionPolicy&& exec, + InMat A, + InVec x, + OutVec y); + + template + void matrix_vector_product(InMat A, + InVec1 x, + InVec2 y, + OutVec z); + + template + void matrix_vector_product(ExecutionPolicy&& exec, + InMat A, + InVec1 x, + InVec2 y, + OutVec z); +} +``` + + +## 概要 +(ここには、関数・変数・定数の概要を記述します。必須事項です。) + +(必要な項目を省略する場合には、「(執筆中)」と書いておいてください。) + + +## テンプレートパラメータ制約 +(ここには、関数がオーバーロード解決に参加するための条件を記載します。SFINAE-friendlyな関数の条件、制約テンプレートによるオーバーロードの条件などを記載します。) + + +## 適格要件 +- (1), (2), (3), (4): [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` +- (3), (4): [`possibly-addable`](possibly-addable.md)`()`が`true` + + +## 事前条件 +- (1), (2), (3), (4): [`multipliable`](multipliable.md)`(A,x,y) == true` +- (3), (4): [`addable`](addable.md)`(x, y, z) == true` + + +## 効果 +- (1), (2): $y \leftarrow Ax$ +- (3), (4): $z \leftarrow y + Ax$ + + +## 戻り値 +なし + + +## 計算量 +$O(\verb|A.extent(1)|\times \verb|x.extent(0)|)$ + + +## 備考 +- (3), (4): `z`に`y`を入れても良い。 + + +## 例 +```cpp example +#include +#include +#include +#include +#include + +template +void print(const Vector& v, const std::string& name) { + for (int i = 0; i < v.extent(0); ++i) { + std::cout << name << "[" << i << "]" << " = " << v[i] << '\n'; + } +} + +int main() +{ + constexpr size_t N = 4; + constexpr size_t M = 2; + + std::vector A_vec(N*M); + std::vector x_vec(M); + std::array y_vec, z_vec; + + std::mdspan A(A_vec.data(), N, M); + std::mdspan x(x_vec.data(), M); + std::mdspan y(y_vec.data(), N); + std::mdspan z(z_vec.data(), N); + + for(int i = 0; i < A.extent(0); ++i) { + for(int j = 0; j < A.extent(1); ++j) { + A[i,j] = 100.0 * i + j; + } + } + + for(int j = 0; j < x.extent(0); ++j) { + x[j] = 1.0 * j; + } + for(int i = 0; i < y.extent(0); ++i) { + y[i] = -1.0 * i; + } + + // (1) + std::cout << "(1)\n"; + std::linalg::matrix_vector_product(A, x, y); + print(y, "y"); + + // (2) + std::cout << "(2)\n"; + std::linalg::matrix_vector_product(std::execution::par, A, x, y); + print(y, "y"); + + // (3) + std::cout << "(3)\n"; + std::linalg::matrix_vector_product(A, x, y, z); + print(z, "z"); + + // (4) + std::cout << "(4)\n"; + std::linalg::matrix_vector_product(std::execution::par, A, x, y, z); + print(z, "z"); + + return 0; +} +``` + + +### 出力 +``` +(1) +y[0] = 1 +y[1] = 101 +y[2] = 201 +y[3] = 301 +(2) +y[0] = 1 +y[1] = 101 +y[2] = 201 +y[3] = 301 +(3) +z[0] = 2 +z[1] = 202 +z[2] = 402 +z[3] = 602 +(4) +z[0] = 2 +z[1] = 202 +z[2] = 402 +z[3] = 602 +``` + + +## バージョン +### 言語 +- C++11 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution`](/reference/execution.md) +- [`mdspan`](/reference/mdspan.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) +- [LAPACK: cgemv](https://netlib.org/lapack/explore-html/d7/dda/group__gemv_ga44c85a0d7ecd60a6bc8ca27b222d7792.html#ga44c85a0d7ecd60a6bc8ca27b222d7792) + diff --git a/reference/linalg/multipliable.md b/reference/linalg/multipliable.md new file mode 100644 index 0000000000..71e7453236 --- /dev/null +++ b/reference/linalg/multipliable.md @@ -0,0 +1,65 @@ +# multipliable + +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + + +```cpp +namespace std::linalg { + constexpr bool multipliable( + const in-matrix auto& in_mat, + const in-vector auto& in_vec, + const in-vector auto& out_vec) + { + return out_vec.extent(0) == in_mat.extent(0) && + in_mat.extent(1) == in_vec.extent(0); + } // (1) + + constexpr bool multipliable( + const in-vector auto& in_vec, + const in-matrix auto& in_mat, + const in-vector auto& out_vec) + { + return out_vec.extent(0) == in_mat.extent(1) && + in_mat.extent(0) == in_vec.extent(0); + } // (2) + + constexpr bool multipliable( + const in-matrix auto& in_mat1, + const in-matrix auto& in_mat2, + const in-matrix auto& out_mat) + { + return out_mat.extent(0) == in_mat1.extent(0) && + out_mat.extent(1) == in_mat2.extent(1) && + in1_mat.extent(1) == in_mat2.extent(0); + } // (3) +} +``` + + +## 概要 +テンプレートパラメータに指定されたベクトルや行列が掛けられるかを静的要素数で判定する、説明専用の関数である。 + + +## 戻り値 +`InMat`型の変数を`A`, `InVec`型の変数を`x`, `OutVec`型の変数を`y`とする。 +- (1): $y \leftarrow Ax$が可能なら`true`、そうでないなら`false` +- (2): $y^t \leftarrow x^t A$が可能なら`true`、そうでないなら`false` +- (3): `InMat1`型の変数を`A`, `InMat2`型の変数を`B`, `OutMat`型の変数`C`とすると、$C \leftarrow AB$が可能なら`true`、そうでないなら`false` + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`mdspan`](/reference/mdspan.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) + + diff --git a/reference/linalg/possibly-multipliable.md b/reference/linalg/possibly-multipliable.md new file mode 100644 index 0000000000..296e359549 --- /dev/null +++ b/reference/linalg/possibly-multipliable.md @@ -0,0 +1,59 @@ +# possibly-multipliable + +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + + +```cpp +namespace std::linalg { + template + constexpr bool possibly-multipliable() + { + return compatible-static-extents(0, 0) && + compatible-static-extents(1, 0); + } // (1) + + template + constexpr bool possibly-multipliable() + { + return compatible-static-extents(0, 1) && + compatible-static-extents(0, 0); + } // (2) + + template + constexpr bool possibly-multipliable() + { + return compatible-static-extents(0, 0) && + compatible-static-extents(1, 1) && + compatible-static-extents(1, 0); + } // (3) +} +``` + + +## 概要 +テンプレートパラメータに指定されたベクトルや行列が掛けられるかを静的要素数で判定する、説明専用の関数である。 + + +## 戻り値 +`InMat`型の変数を`A`, `InVec`型の変数を`x`, `OutVec`型の変数を`y`とする。 +- (1): $y \leftarrow Ax$が可能なら`true`、そうでないなら`false` +- (2): $y^t \leftarrow x^t A$が可能なら`true`、そうでないなら`false` +- (3): `InMat1`型の変数を`A`, `InMat2`型の変数を`B`, `OutMat`型の変数`C`とすると、$C \leftarrow AB$が可能なら`true`、そうでないなら`false` + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`mdspan`](/reference/mdspan.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) + + From c8d55fb2e1546a676aa1d39c75cbc9a62c69e948 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Tue, 25 Jun 2024 12:51:33 +0900 Subject: [PATCH 0986/3948] =?UTF-8?q?linalg=20:=20=E5=8F=82=E7=85=A7?= =?UTF-8?q?=E3=81=A8=E4=BE=8B=E3=81=AE=E4=BF=AE=E6=AD=A3=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/add.md | 2 +- reference/linalg/apply_givens_rotation.md | 2 +- reference/linalg/copy.md | 2 +- reference/linalg/dot.md | 2 +- reference/linalg/dotc.md | 4 ++-- reference/linalg/matrix_frob_norm.md | 4 ++-- reference/linalg/matrix_inf_norm.md | 4 ++-- reference/linalg/matrix_one_norm.md | 4 ++-- reference/linalg/scale.md | 2 +- reference/linalg/setup_givens_rotation.md | 2 +- reference/linalg/swap_elements.md | 2 +- reference/linalg/vector_abs_sum.md | 4 ++-- reference/linalg/vector_idx_abs_max.md | 4 ++-- reference/linalg/vector_sum_of_squares.md | 4 ++-- reference/linalg/vector_two_norm.md | 4 ++-- 15 files changed, 23 insertions(+), 23 deletions(-) diff --git a/reference/linalg/add.md b/reference/linalg/add.md index cffbd4bd04..61c0489af3 100644 --- a/reference/linalg/add.md +++ b/reference/linalg/add.md @@ -91,6 +91,6 @@ $x + y$ を`z`に代入する。 ## 参照 -- [P0788R3 Standard Library Specification in a Concepts and Contracts World](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0788r3.pdf) +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - [`LAPACK: caxpy`](https://netlib.org/lapack/explore-html/d5/d4b/group__axpy_ga0b7bac1f4d42514074a48f14f5f9caa0.html#ga0b7bac1f4d42514074a48f14f5f9caa0) diff --git a/reference/linalg/apply_givens_rotation.md b/reference/linalg/apply_givens_rotation.md index b93274fb51..d9c76b06ec 100644 --- a/reference/linalg/apply_givens_rotation.md +++ b/reference/linalg/apply_givens_rotation.md @@ -116,5 +116,5 @@ $$ ## 参照 -- [P0788R3 Standard Library Specification in a Concepts and Contracts World](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0788r3.pdf) +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - [`LAPACK: crot`](https://netlib.org/lapack/explore-html/d1/d45/group__rot_ga25544801d45dcabdec7b24d863ebea9c.html#ga25544801d45dcabdec7b24d863ebea9c) diff --git a/reference/linalg/copy.md b/reference/linalg/copy.md index 0a44de8bd2..6f9619c074 100644 --- a/reference/linalg/copy.md +++ b/reference/linalg/copy.md @@ -77,5 +77,5 @@ namespace std::linalg { ## 参照 -- [P0788R3 Standard Library Specification in a Concepts and Contracts World](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0788r3.pdf) +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - [`LAPACK: ccopy`](https://netlib.org/lapack/explore-html/d5/d2b/group__copy_gab395a30db1137d3deabe520b8e73097d.html#gab395a30db1137d3deabe520b8e73097d) diff --git a/reference/linalg/dot.md b/reference/linalg/dot.md index 8c023bda7f..c04c8e84eb 100644 --- a/reference/linalg/dot.md +++ b/reference/linalg/dot.md @@ -103,5 +103,5 @@ $$ ## 参照 -- [P0788R3 Standard Library Specification in a Concepts and Contracts World](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0788r3.pdf) +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - [`LAPACK: cdotu`](https://netlib.org/lapack/explore-html/d1/dcc/group__dot_ga2cce681b6aed3728b893a555b3bee55c.html#ga2cce681b6aed3728b893a555b3bee55c) diff --git a/reference/linalg/dotc.md b/reference/linalg/dotc.md index 4ca16f3f2f..e910eaf201 100644 --- a/reference/linalg/dotc.md +++ b/reference/linalg/dotc.md @@ -80,7 +80,7 @@ $$ ## 例 **[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** -```cpp +```cpp example #include #include #include @@ -143,6 +143,6 @@ int main() ## 参照 -- [P0788R3 Standard Library Specification in a Concepts and Contracts World](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0788r3.pdf) +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - [`LAPACK: cdotc`](https://netlib.org/lapack/explore-html/d1/dcc/group__dot_ga5c189335a4e6130a2206c190579b1571.html#ga5c189335a4e6130a2206c190579b1571) diff --git a/reference/linalg/matrix_frob_norm.md b/reference/linalg/matrix_frob_norm.md index 93bc6b362f..f8f6cd64c8 100644 --- a/reference/linalg/matrix_frob_norm.md +++ b/reference/linalg/matrix_frob_norm.md @@ -65,7 +65,7 @@ $$ ## 例 **[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** -```cpp +```cpp example #include #include #include @@ -124,5 +124,5 @@ int main() ## 参照 -- [P0788R3 Standard Library Specification in a Concepts and Contracts World](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0788r3.pdf) +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) diff --git a/reference/linalg/matrix_inf_norm.md b/reference/linalg/matrix_inf_norm.md index 1778fffdc0..4d6b49f724 100644 --- a/reference/linalg/matrix_inf_norm.md +++ b/reference/linalg/matrix_inf_norm.md @@ -68,7 +68,7 @@ $$ ## 例 **[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** -```cpp +```cpp example #include #include #include @@ -127,5 +127,5 @@ int main() ## 参照 -- [P0788R3 Standard Library Specification in a Concepts and Contracts World](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0788r3.pdf) +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) diff --git a/reference/linalg/matrix_one_norm.md b/reference/linalg/matrix_one_norm.md index 9117543704..66ebffef01 100644 --- a/reference/linalg/matrix_one_norm.md +++ b/reference/linalg/matrix_one_norm.md @@ -68,7 +68,7 @@ $$ ## 例 **[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** -```cpp +```cpp example #include #include #include @@ -127,5 +127,5 @@ int main() ## 参照 -- [P0788R3 Standard Library Specification in a Concepts and Contracts World](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0788r3.pdf) +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) diff --git a/reference/linalg/scale.md b/reference/linalg/scale.md index 4f44d419bf..aab3496cd3 100644 --- a/reference/linalg/scale.md +++ b/reference/linalg/scale.md @@ -66,6 +66,6 @@ $$ ## 参照 -- [P0788R3 Standard Library Specification in a Concepts and Contracts World](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0788r3.pdf) +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - [`LAPACK: cscal`](https://netlib.org/lapack/explore-html/d2/de8/group__scal_gacce468103c83fa18bae078d5f49fefe2.html#gacce468103c83fa18bae078d5f49fefe2) diff --git a/reference/linalg/setup_givens_rotation.md b/reference/linalg/setup_givens_rotation.md index cde2e71a9b..3c6c8958e4 100644 --- a/reference/linalg/setup_givens_rotation.md +++ b/reference/linalg/setup_givens_rotation.md @@ -82,6 +82,6 @@ $$ ## 参照 -- [P0788R3 Standard Library Specification in a Concepts and Contracts World](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0788r3.pdf) +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - [Working Draft Programming Languages — C++: 28 Numerics libarary](https://eel.is/c++draft/complex.numbers) - [LAPACK: clartg](https://netlib.org/lapack/explore-html/da/dd3/group__lartg_ga45afd4405cf6da478ce4de9576303369.html#ga45afd4405cf6da478ce4de9576303369) diff --git a/reference/linalg/swap_elements.md b/reference/linalg/swap_elements.md index 630dfc91d2..f878975996 100644 --- a/reference/linalg/swap_elements.md +++ b/reference/linalg/swap_elements.md @@ -76,6 +76,6 @@ namespace std::linalg { ## 参照 -- [P0788R3 Standard Library Specification in a Concepts and Contracts World](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0788r3.pdf) +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - [`LAPACK: cswap`](https://netlib.org/lapack/explore-html/d7/d51/group__swap_ga1e8d1bbcbd0307e7a3839d0bd10e4118.html#ga1e8d1bbcbd0307e7a3839d0bd10e4118) diff --git a/reference/linalg/vector_abs_sum.md b/reference/linalg/vector_abs_sum.md index 72543f3fac..de6983f762 100644 --- a/reference/linalg/vector_abs_sum.md +++ b/reference/linalg/vector_abs_sum.md @@ -73,7 +73,7 @@ $$ ## 例 **[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** -```cpp +```cpp example #include #include #include @@ -129,6 +129,6 @@ int main() ## 参照 -- [P0788R3 Standard Library Specification in a Concepts and Contracts World](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0788r3.pdf) +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - [LAPACK: dzasum](https://netlib.org/lapack/explore-html/d5/d72/group__asum_gaf23444d1c822b34db864558d7afc76dd.html#gaf23444d1c822b34db864558d7afc76dd) diff --git a/reference/linalg/vector_idx_abs_max.md b/reference/linalg/vector_idx_abs_max.md index fbf1a1be17..85a8f153b7 100644 --- a/reference/linalg/vector_idx_abs_max.md +++ b/reference/linalg/vector_idx_abs_max.md @@ -46,7 +46,7 @@ namespace std::linalg { ## 例 **[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** -```cpp +```cpp example #include #include #include @@ -98,7 +98,7 @@ int main() ## 参照 -- [P0788R3 Standard Library Specification in a Concepts and Contracts World](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0788r3.pdf) +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - [LAPACK: icamax](https://netlib.org/lapack/explore-html/dd/d52/group__iamax_gafdf273dcc3f020e2aa5c716c1b3d7265.html#gafdf273dcc3f020e2aa5c716c1b3d7265) diff --git a/reference/linalg/vector_sum_of_squares.md b/reference/linalg/vector_sum_of_squares.md index fbebfbbdce..880f3fd967 100644 --- a/reference/linalg/vector_sum_of_squares.md +++ b/reference/linalg/vector_sum_of_squares.md @@ -66,7 +66,7 @@ $$ ## 例 **[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** -```cpp +```cpp example #include #include #include @@ -137,5 +137,5 @@ int main() ## 参照 -- [P0788R3 Standard Library Specification in a Concepts and Contracts World](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0788r3.pdf) +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - [LAPACK: classq](https://netlib.org/lapack/explore-html/d8/d76/group__lassq_gab70baa330cb7a13111b72aef0734e26d.html#gab70baa330cb7a13111b72aef0734e26d) diff --git a/reference/linalg/vector_two_norm.md b/reference/linalg/vector_two_norm.md index a69f7d157f..8d6c1c939f 100644 --- a/reference/linalg/vector_two_norm.md +++ b/reference/linalg/vector_two_norm.md @@ -65,7 +65,7 @@ $$ ## 例 **[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** -```cpp +```cpp example #include #include #include @@ -121,6 +121,6 @@ int main() ## 参照 -- [P0788R3 Standard Library Specification in a Concepts and Contracts World](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0788r3.pdf) +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - [LAPACK: dnrm2](https://netlib.org/lapack/explore-html/d1/d2a/group__nrm2_gab5393665c8f0e7d5de9bd1dd2ff0d9d0.html#gab5393665c8f0e7d5de9bd1dd2ff0d9d0) From 1a807433330cb9e2e330de21225fa31f8fa59775 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Tue, 25 Jun 2024 13:38:38 +0900 Subject: [PATCH 0987/3948] =?UTF-8?q?linalg=20:=20=E6=9B=B8=E3=81=8D?= =?UTF-8?q?=E5=BF=98=E3=82=8C=E3=81=A6=E3=81=84=E3=81=9F=E3=81=93=E3=81=A8?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/matrix_vector_product.md | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/reference/linalg/matrix_vector_product.md b/reference/linalg/matrix_vector_product.md index 615ddbce53..2b862f9192 100644 --- a/reference/linalg/matrix_vector_product.md +++ b/reference/linalg/matrix_vector_product.md @@ -15,7 +15,7 @@ namespace std::linalg { out-vector OutVec> void matrix_vector_product(InMat A, InVec x, - OutVec y); + OutVec y); // (1) template #include @@ -180,7 +181,7 @@ z[3] = 602 ## バージョン ### 言語 -- C++11 +- C++26 ### 処理系 - [Clang](/implementation.md#clang): ?? From 7f99ecebe5642aa1eeaa85ae69b01fecb42cdfa2 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Tue, 25 Jun 2024 13:39:34 +0900 Subject: [PATCH 0988/3948] =?UTF-8?q?linalg=20:=20C++=E3=81=AE=E3=83=90?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3=E3=82=92=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/dot.md | 2 +- reference/linalg/dotc.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/linalg/dot.md b/reference/linalg/dot.md index c04c8e84eb..d5884d7976 100644 --- a/reference/linalg/dot.md +++ b/reference/linalg/dot.md @@ -88,7 +88,7 @@ $$ ## バージョン ### 言語 -- C++11 +- C++26 ### 処理系 - [Clang](/implementation.md#clang): ?? diff --git a/reference/linalg/dotc.md b/reference/linalg/dotc.md index e910eaf201..59efd533ae 100644 --- a/reference/linalg/dotc.md +++ b/reference/linalg/dotc.md @@ -127,7 +127,7 @@ int main() ## バージョン ### 言語 -- C++11 +- C++26 ### 処理系 - [Clang](/implementation.md#clang): ?? From 902bbcac00c3e36c5104db735fcfd68980b284de Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Tue, 25 Jun 2024 16:19:32 +0900 Subject: [PATCH 0989/3948] =?UTF-8?q?linalg=20:=20symmetric=5Fmatrix=5Fvec?= =?UTF-8?q?tor=5Fproduct=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 2 +- .../linalg/symmetric_matrix_vector_product.md | 223 ++++++++++++++++++ 2 files changed, 224 insertions(+), 1 deletion(-) create mode 100644 reference/linalg/symmetric_matrix_vector_product.md diff --git a/reference/linalg.md b/reference/linalg.md index 21c82f0e2f..f126390c48 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -82,7 +82,7 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`matrix_vector_product`](linalg/matrix_vector_product.md) | xGEMV: 一般行列とベクトルの積を求める (function template) | C++26 | -| `symmetric_matrix_vector_product` | xSYMV: 対称行列とベクトルの積を求める (function template) | C++26 | +| [`symmetric_matrix_vector_product`](linalg/symmetric_matrix_vector_product.md) | xSYMV: 対称行列とベクトルの積を求める (function template) | C++26 | | `hermitian_matrix_vector_product` | xHEMV: ハミルトニアン行列とベクトルの積を求める (function template) | C++26 | | `triangular_matrix_vector_product` | xTRMV: 三角行列とベクトルの積を求める (function template) | C++26 | | `triangular_matrix_vector_solve` | xTRSV: 三角行列を係数とする行列方程式を解く (function template) | C++26 | diff --git a/reference/linalg/symmetric_matrix_vector_product.md b/reference/linalg/symmetric_matrix_vector_product.md new file mode 100644 index 0000000000..1120a318db --- /dev/null +++ b/reference/linalg/symmetric_matrix_vector_product.md @@ -0,0 +1,223 @@ +# symmetric_matrix_vector_product + + +* [mathjax enable] +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + + +```cpp +namespace std::linalg { + template + void symmetric_matrix_vector_product(InMat A, + Triangle t, + InVec x, + OutVec y); // (1) + + template + void symmetric_matrix_vector_product(ExecutionPolicy&& exec, + InMat A, + Triangle t, + InVec x, + OutVec y); // (2) + + template + void symmetric_matrix_vector_product( + InMat A, + Triangle t, + InVec1 x, + InVec2 y, + OutVec z); // (3) + + template + void symmetric_matrix_vector_product( + ExecutionPolicy&& exec, + InMat A, + Triangle t, + InVec1 x, + InVec2 y, + OutVec z); // (4) +} +``` + + +## 概要 +対称行列とベクトルの積を計算する。 +引数`t`は対称行列の成分が上三角にあるのか、それとも下三角にあるのかを示す。 + +- (1): $y \leftarrow Ax$ +- (2): (1)を指定された実行ポリシーで実行する。 +- (3): $z \leftarrow y + Ax$ +- (4): (3)を指定された実行ポリシーで実行する。 + + +## 適格要件 +- (1), (2), (3), (4): `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 +- (1), (2), (3), (4): [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) +- (1), (2), (3), (4): [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` +- (3), (4): [`possibly-addable`](possibly-addable.md)`()`が`true` + + +## 事前条件 +- (1), (2), (3), (4): `A.extent(0) == A.extent(1)` +- (1), (2), (3), (4): [`multipliable`](multipliable.md)`(A, x, y) == true` +- (3), (4): [`addable`](addable.md)`(x, y, z) == true` + + +## 効果 +対称行列の成分の位置を示す`t`を考慮した、対称行列とベクトルの積を計算する。 + +- (1), (2): $y \leftarrow Ax$ +- (3), (4): $z \leftarrow y + Ax$ + + +## 戻り値 +なし + + +## 計算量 +$O(\verb|A.extent(1)|\times \verb|x.extent(0)|)$ + + +## 備考 +- (3), (4): `z`に`y`を入れても良い。 + + +## 例 +**[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** + +```cpp example +#include +#include +#include +#include +#include + +template +void print(const Vector& v, const std::string& name) { + for (int i = 0; i < v.extent(0); ++i) { + std::cout << name << "[" << i << "]" << " = " << v[i] << '\n'; + } +} + +int main() +{ + constexpr size_t N = 4; + constexpr size_t M = 4; + + std::vector A_vec(N*M); + std::vector x_vec(M); + std::array y_vec, z_vec; + + std::mdspan< + double, + std::extents, + std::linalg::layout_blas_packed< + std::linalg::upper_triangle_t, + std::linalg::row_major_t> + > A(A_vec.data()); + std::mdspan x(x_vec.data(), M); + std::mdspan y(y_vec.data(), N); + std::mdspan z(z_vec.data(), N); + + for(int i = 0; i < A.extent(0); ++i) { + for(int j = i; j < A.extent(1); ++j) { + A[i,j] = A.extent(1) * i + j; + } + } + + for(int j = 0; j < x.extent(0); ++j) { + x[j] = j; + } + for(int i = 0; i < y.extent(0); ++i) { + y[i] = -i; + } + + // (1) + std::cout << "(1)\n"; + std::linalg::symmetric_matrix_vector_product(A, std::linalg::upper_triangle, x, y); + print(y, "y"); + + // (2) + std::cout << "(2)\n"; + std::linalg::symmetric_matrix_vector_product(std::execution::par, A, std::linalg::upper_triangle, x, y); + print(y, "y"); + + // (3) + std::cout << "(3)\n"; + std::linalg::symmetric_matrix_vector_product(A, std::linalg::upper_triangle, x, y, z); + print(z, "z"); + + // (4) + std::cout << "(4)\n"; + std::linalg::symmetric_matrix_vector_product(std::execution::par, A, std::linalg::upper_triangle, x, y, z); + print(z, "z"); + + return 0; +} +``` + + +### 出力 +``` +(1) +y[0] = 14 +y[1] = 38 +y[2] = 59 +y[3] = 74 +(2) +y[0] = 14 +y[1] = 38 +y[2] = 59 +y[3] = 74 +(3) +z[0] = 28 +z[1] = 76 +z[2] = 118 +z[3] = 148 +(4) +z[0] = 28 +z[1] = 76 +z[2] = 118 +z[3] = 148 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution`](/reference/execution.md) +- [`mdspan`](/reference/mdspan.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) +- [LAPACK: csymv](https://netlib.org/lapack/explore-html/db/d17/group__hemv_gab137e328e44dc1530ab0a93ff65c108a.html#gab137e328e44dc1530ab0a93ff65c108a) + From 4f45356bb536068c5e28e244bcbf632f2dd66027 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Tue, 25 Jun 2024 16:20:37 +0900 Subject: [PATCH 0990/3948] =?UTF-8?q?linalg=20:=20=E4=BE=8B=E3=81=AE?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E3=81=A8=E3=82=B3=E3=83=BC=E3=83=89=E3=81=AE?= =?UTF-8?q?=E6=95=B4=E7=90=86=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/layout_blas_packed.md | 2 +- reference/linalg/matrix_vector_product.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/linalg/layout_blas_packed.md b/reference/linalg/layout_blas_packed.md index 27663437cb..a1be8da219 100644 --- a/reference/linalg/layout_blas_packed.md +++ b/reference/linalg/layout_blas_packed.md @@ -70,7 +70,7 @@ int main() // 2 5 - - // 3 6 8 - // 4 7 9 10 - print_mat("mat1", mat); + print_mat("mat1", mat1); // 行優先格納順の下三角要素から4x4対称行列を構築 std::mdspan< diff --git a/reference/linalg/matrix_vector_product.md b/reference/linalg/matrix_vector_product.md index 2b862f9192..8c08e3b38c 100644 --- a/reference/linalg/matrix_vector_product.md +++ b/reference/linalg/matrix_vector_product.md @@ -64,7 +64,7 @@ namespace std::linalg { ## 事前条件 -- (1), (2), (3), (4): [`multipliable`](multipliable.md)`(A,x,y) == true` +- (1), (2), (3), (4): [`multipliable`](multipliable.md)`(A, x, y) == true` - (3), (4): [`addable`](addable.md)`(x, y, z) == true` @@ -123,10 +123,10 @@ int main() } for(int j = 0; j < x.extent(0); ++j) { - x[j] = 1.0 * j; + x[j] = j; } for(int i = 0; i < y.extent(0); ++i) { - y[i] = -1.0 * i; + y[i] = -i; } // (1) From 5d0c10029a321139af2564da89b833c44b40b50d Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 25 Jun 2024 16:29:48 +0900 Subject: [PATCH 0991/3948] layout_blas_packed/mapping: fix markup --- reference/linalg/layout_blas_packed/mapping/op_call.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/linalg/layout_blas_packed/mapping/op_call.md b/reference/linalg/layout_blas_packed/mapping/op_call.md index f19ba3761d..acbfd10ee2 100644 --- a/reference/linalg/layout_blas_packed/mapping/op_call.md +++ b/reference/linalg/layout_blas_packed/mapping/op_call.md @@ -27,6 +27,7 @@ constexpr index_type operator() (Index0 ind0, Index1 ind1) const noexcept; ## 戻り値 `N`を[`extetns_.extent`](/reference/mdspan/extents/extent.md)`(0)`としたとき + - `i > j`ならば`(*this)(j, i)`、そうでなければ - 下記いずれの条件を満たすならば`i + j * (j + 1)/2`、そうでなければ - [`is_same_v`](/reference/type_traits/is_same.md)` &&` [`is_same_v`](/reference/type_traits/is_same.md)``が`true`または From 17c594a2e02c0f17280415486fc4491812ca4e0c Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 25 Jun 2024 17:35:29 +0900 Subject: [PATCH 0992/3948] =?UTF-8?q?span,mdspan:=20C++26=20P3029R1?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/mdspan/de-ice.md | 2 +- reference/mdspan/mdspan/op_deduction_guide.md | 21 ++++++-- reference/mdspan/strided_slice.md | 2 +- reference/mdspan/submdspan_extents.md | 6 +-- .../integral-constant-like.md | 5 +- reference/span/maybe-static-ext.md | 25 ++++++++++ reference/span/span/op_deduction_guide.md | 48 +++++++++++++++---- 7 files changed, 87 insertions(+), 22 deletions(-) rename reference/{mdspan => span}/integral-constant-like.md (75%) create mode 100644 reference/span/maybe-static-ext.md diff --git a/reference/mdspan/de-ice.md b/reference/mdspan/de-ice.md index b2f611d270..9d555cf63d 100644 --- a/reference/mdspan/de-ice.md +++ b/reference/mdspan/de-ice.md @@ -10,7 +10,7 @@ constexpr T de-ice(T val) { return val; } template constexpr auto de-ice(T) { return T::value; } ``` -* integral-constant-like[link integral-constant-like.md] +* integral-constant-like[link /reference/span/integral-constant-like.md] ## 概要 `de-ice`は[`submdspan`](submdspan.md)動作説明用の関数テンプレートである。 diff --git a/reference/mdspan/mdspan/op_deduction_guide.md b/reference/mdspan/mdspan/op_deduction_guide.md index 9cc9bff945..5e84cc0b63 100644 --- a/reference/mdspan/mdspan/op_deduction_guide.md +++ b/reference/mdspan/mdspan/op_deduction_guide.md @@ -19,7 +19,7 @@ namespace std { template requires ((is_convertible_v && ...) && sizeof...(Integrals) > 0) explicit mdspan(ElementType*, Integrals...) - -> mdspan>; // (3) + -> mdspan...>>; // (3) template mdspan(ElementType*, span) @@ -52,6 +52,7 @@ namespace std { * extents[link ../extents.md] * dextents[link ../extents.md] * span[link /reference/span/span.md] +* maybe-static-ext[link /reference/span/maybe-static-ext.md] * array[link /reference/array/array.md] * is_array_v[link /reference/type_traits/is_array.md] * is_pointer_v[link /reference/type_traits/is_pointer.md] @@ -76,6 +77,10 @@ namespace std { #include #include #include +#include + +template +constexpr auto Int = std::integral_constant{}; int main() { @@ -101,10 +106,15 @@ int main() // m2 := 0次元配列ビュー } { // (3) : 要素数リストから型推論 - std::mdspan m3{arr, 2, 3}; - static_assert(m3.rank_dynamic() == 2); - assert(m3.size() == 6); - // m3 := 動的要素数 2x3 の2次元配列ビュー + std::mdspan m3a{arr, 2, 3}; + static_assert(m3a.rank_dynamic() == 2); + assert(m3a.size() == 6); + // m3a := 動的要素数 2x3 の2次元配列ビュー + + std::mdspan m3b{arr, Int<2>, Int<3>}; + static_assert(m3b.rank_dynamic() == 0); + assert(m3b.size() == 6); + // m3b := 静的要素数 2x3 の2次元配列ビュー } { // (4) : 要素数spanから型推論 int exts[] = {2, 3}; @@ -179,3 +189,4 @@ int main() ## 参照 - [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) +- [P3029R1 Better `mdspan`'s CTAD](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3029r1.html) diff --git a/reference/mdspan/strided_slice.md b/reference/mdspan/strided_slice.md index b7003c043f..0636491d00 100644 --- a/reference/mdspan/strided_slice.md +++ b/reference/mdspan/strided_slice.md @@ -36,7 +36,7 @@ std::strided_slice{.offset=1, .extent=10, .stride=3} ## 適格要件 -`OffsetType`, `ExtentType`, `StrideType`は符号付き整数型または符号無し整数型、もしくは[`integral-constant-like`](integral-constant-like.md)のモデルであること。 +`OffsetType`, `ExtentType`, `StrideType`は符号付き整数型または符号無し整数型、もしくは[`integral-constant-like`](/reference/span/integral-constant-like.md)のモデルであること。 ## メンバ型 diff --git a/reference/mdspan/submdspan_extents.md b/reference/mdspan/submdspan_extents.md index 13ba564f84..4c885ac344 100644 --- a/reference/mdspan/submdspan_extents.md +++ b/reference/mdspan/submdspan_extents.md @@ -55,9 +55,9 @@ namespace std { - [`SubExtents::rank()`](extents/rank.md)は、型`S_k`が[`convertible_to`](/reference/concepts/convertible_to.md)``のモデルではない`k`の個数に等しく、かつ - `map-rank[k] !=` [`dynamic_extent`](/reference/span/dynamic_extent.md)を満たす`Extents`の次元インデクス`k`について、[`SubExtents::static_extent`](extents/static_extent.md)`(map-rank[k])`が下記と等しいこと - [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true`のとき、[`SubExtents::static_extent`](extents/static_extent.md)`(k)`、そうでなければ、 - - 型`S_k`が[`index-pair-like`](index-pair-like.md)のモデルかつ`tuple_element_t<0, S_k>`および`tuple_element_t<1, S_k>`がいずれも[`integral-constant-like`](integral-constant-like.md)のモデルであるとき、[`de-ice`](de-ice.md)`(tuple_element_t<1, S_k>) -` [`de-ice`](de-ice.md)`(tuple_element_t<0, S_k>)`、そうでなければ - - 型`S_k`が[`strided_slice`](strided_slice.md)の特殊化かつメンバ型`extent_type`が`S_k::extent_type() == 0`かつ[`integral-constant-like`](integral-constant-like.md)のモデルであるとき、値`0`、そうでなければ - - 型`S_k`が[`strided_slice`](strided_slice.md)の特殊化かつメンバ型`extent_type`および`stride_type`がいずれも[`integral-constant-like`](integral-constant-like.md)のモデルであるとき、`1 + (`[`de-ice`](de-ice.md)`(S_k::extent_type()) - 1) /` [`de-ice`](de-ice.md)`(S_k::stride_type())`、そうでなければ + - 型`S_k`が[`index-pair-like`](index-pair-like.md)のモデルかつ`tuple_element_t<0, S_k>`および`tuple_element_t<1, S_k>`がいずれも[`integral-constant-like`](/reference/span/integral-constant-like.md)のモデルであるとき、[`de-ice`](de-ice.md)`(tuple_element_t<1, S_k>) -` [`de-ice`](de-ice.md)`(tuple_element_t<0, S_k>)`、そうでなければ + - 型`S_k`が[`strided_slice`](strided_slice.md)の特殊化かつメンバ型`extent_type`が`S_k::extent_type() == 0`かつ[`integral-constant-like`](/reference/span/integral-constant-like.md)のモデルであるとき、値`0`、そうでなければ + - 型`S_k`が[`strided_slice`](strided_slice.md)の特殊化かつメンバ型`extent_type`および`stride_type`がいずれも[`integral-constant-like`](/reference/span/integral-constant-like.md)のモデルであるとき、`1 + (`[`de-ice`](de-ice.md)`(S_k::extent_type()) - 1) /` [`de-ice`](de-ice.md)`(S_k::stride_type())`、そうでなければ - [`dynamic_extent`](/reference/span/dynamic_extent.md) 以下を満たす`SubExtents`型の値`ext`を返す。 diff --git a/reference/mdspan/integral-constant-like.md b/reference/span/integral-constant-like.md similarity index 75% rename from reference/mdspan/integral-constant-like.md rename to reference/span/integral-constant-like.md index d45e5abaf4..3af0844898 100644 --- a/reference/mdspan/integral-constant-like.md +++ b/reference/span/integral-constant-like.md @@ -1,5 +1,5 @@ # integral-constant-like -* mdspan[meta header] +* span[meta header] * concept[meta id-type] * cpp26[meta cpp] @@ -21,7 +21,7 @@ concept integral-constant-like = // exposition only * equality_comparable_with[link /reference/concepts/equality_comparable.md] ## 概要 -`integral-constant-like`は、型`T`が整数定数と互換があることを表す説明専用コンセプトである。 +`integral-constant-like`は、型`T`が整数定数型[`std::integral_constant`](/reference/type_traits/integral_constant.md)と互換があることを表す説明専用コンセプトである。 ## バージョン @@ -31,3 +31,4 @@ concept integral-constant-like = // exposition only ## 参照 - [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) +- [P3029R1 Better `mdspan`'s CTAD](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3029r1.html) diff --git a/reference/span/maybe-static-ext.md b/reference/span/maybe-static-ext.md new file mode 100644 index 0000000000..54c3d1d0b0 --- /dev/null +++ b/reference/span/maybe-static-ext.md @@ -0,0 +1,25 @@ +# maybe-static-ext +* span[meta header] +* variable[meta id-type] +* cpp26[meta cpp] + +```cpp +template + constexpr size_t maybe-static-ext = dynamic_extent; // exposition only +template + constexpr size_t maybe-static-ext = {T::value}; +``` +* dynamic_extent[link dynamic_extent.md] +* integral-constant-like[link integral-constant-like.md] + +## 概要 +`maybe-static-ext`は、型`T`から[`dynamic_extent`](dynamic_extent.md)または静的要素数を取り出す説明専用定数である。 + + +## バージョン +### 言語 +- C++26 + + +## 参照 +- [P3029R1 Better `mdspan`'s CTAD](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3029r1.html) diff --git a/reference/span/span/op_deduction_guide.md b/reference/span/span/op_deduction_guide.md index 6d0053b011..5afd8ea6b8 100644 --- a/reference/span/span/op_deduction_guide.md +++ b/reference/span/span/op_deduction_guide.md @@ -7,30 +7,41 @@ ```cpp namespace std { - template - span(It, End) -> span>>; // (1) + template + span(It, EndOrSize) + -> span>>; // (1) C++20 + template + span(It, EndOrSize) + -> span>, + maybe-static-ext>; // (1) C++26 - template - span(T (&)[N]) -> span; // (2) + template + span(T (&)[N]) -> span; // (2) - template - span(array&) -> span; // (3) + template + span(array&) -> span; // (3) - template - span(const array&) -> span; // (4) + template + span(const array&) -> span; // (4) template - span(R&&) -> span>>; // (5) + span(R&&) + -> span>>; // (5) } ``` +* remove_reference_t[link /reference/type_traits/remove_reference.md] +* iter_reference_t[link /reference/iterator/iter_reference_t.md] +* maybe-static-ext[link /reference/span/maybe-static-ext.md] * array[link /reference/array/array.md] * size_t[link /reference/cstddef/size_t.md] ## 概要 `std::span`クラステンプレートの型推論補助。 -- (1) : メモリ連続性をもつイテレータから、要素型を推論する。要素数はデフォルトの[`std::dynamic_extent`](/reference/span/dynamic_extent.md)を使用する +- (1) : メモリ連続性をもつイテレータから、要素型を推論する。 + - C++20 : 要素数はデフォルトの[`std::dynamic_extent`](/reference/span/dynamic_extent.md)を使用する + - C++26 : `EndOrSize`が整数定数型[`std::integral_constant`](/reference/type_traits/integral_constant.md)互換のときは静的な要素数を推論し、そうでなければ動的な要素数を使用する - (2) : 組み込み配列への参照から、要素型と静的な要素数を推論する - (3) : `std::array`型オブジェクトから、要素型と静的な要素数を推論する - (4) : `const`の`std::array`型オブジェクトから、要素型と静的な要素数を推論する @@ -63,6 +74,18 @@ int main() static_assert(decltype(s)::extent == std::dynamic_extent); } + // (1): C++26以降 + { + std::vector v = {1, 2, 3, 4, 5}; + std::span s{v.begin(), std::integral_constant{}}; + // std::span + + static_assert(std::is_same_v< + decltype(s)::element_type, + int + >); + static_assert(decltype(s)::extent == 5); + } // (2) { @@ -130,3 +153,8 @@ int main() - [Clang](/implementation.md#clang): 9.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3029R1 Better `mdspan`'s CTAD](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3029r1.html) + - C++26から、(1)で静的な要素数への推論がサポートされる。 From 417ea3031d564d8c68fec29786bde9de0c2f56ea Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 25 Jun 2024 17:44:14 +0900 Subject: [PATCH 0993/3948] =?UTF-8?q?mdspan/=E6=8E=A8=E8=AB=96=E8=A3=9C?= =?UTF-8?q?=E5=8A=A9:=20P3029R1=E5=AF=BE=E5=BF=9C=E3=81=8CC++26=E4=BB=A5?= =?UTF-8?q?=E9=99=8D=E3=82=92=E6=98=8E=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/mdspan/mdspan/op_deduction_guide.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/reference/mdspan/mdspan/op_deduction_guide.md b/reference/mdspan/mdspan/op_deduction_guide.md index 5e84cc0b63..93fdb4afed 100644 --- a/reference/mdspan/mdspan/op_deduction_guide.md +++ b/reference/mdspan/mdspan/op_deduction_guide.md @@ -19,7 +19,11 @@ namespace std { template requires ((is_convertible_v && ...) && sizeof...(Integrals) > 0) explicit mdspan(ElementType*, Integrals...) - -> mdspan...>>; // (3) + -> mdspan>; // (3) C++23 + template + requires ((is_convertible_v && ...) && sizeof...(Integrals) > 0) + explicit mdspan(ElementType*, Integrals...) + -> mdspan...>>; // (3) C++26 template mdspan(ElementType*, span) @@ -105,12 +109,13 @@ int main() assert(m2[] == *ptr); // m2 := 0次元配列ビュー } - { // (3) : 要素数リストから型推論 + { // (3) : C++23 要素数リストから型推論 std::mdspan m3a{arr, 2, 3}; static_assert(m3a.rank_dynamic() == 2); assert(m3a.size() == 6); // m3a := 動的要素数 2x3 の2次元配列ビュー - + } + { // (3) : C++26 整数定数要素数リストから型推論 std::mdspan m3b{arr, Int<2>, Int<3>}; static_assert(m3b.rank_dynamic() == 0); assert(m3b.size() == 6); @@ -190,3 +195,4 @@ int main() ## 参照 - [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) - [P3029R1 Better `mdspan`'s CTAD](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3029r1.html) + - C++26から、(3)で静的要素数への推論がサポートされる。 From ef67876a82181126ea2fa0bf6c62de609fdab61f Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Wed, 26 Jun 2024 11:41:39 +0900 Subject: [PATCH 0994/3948] =?UTF-8?q?linalg=20:=20hermitian=5Fmatrix=5Fvec?= =?UTF-8?q?tor=5Fproduct=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 2 +- .../linalg/hermitian_matrix_vector_product.md | 225 ++++++++++++++++++ 2 files changed, 226 insertions(+), 1 deletion(-) create mode 100644 reference/linalg/hermitian_matrix_vector_product.md diff --git a/reference/linalg.md b/reference/linalg.md index f126390c48..4453ea7f09 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -83,7 +83,7 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に |------|------|----------------| | [`matrix_vector_product`](linalg/matrix_vector_product.md) | xGEMV: 一般行列とベクトルの積を求める (function template) | C++26 | | [`symmetric_matrix_vector_product`](linalg/symmetric_matrix_vector_product.md) | xSYMV: 対称行列とベクトルの積を求める (function template) | C++26 | -| `hermitian_matrix_vector_product` | xHEMV: ハミルトニアン行列とベクトルの積を求める (function template) | C++26 | +| [`hermitian_matrix_vector_product`](linalg/hermitian_matrix_vector_product.md) | xHEMV: ハミルトニアン行列とベクトルの積を求める (function template) | C++26 | | `triangular_matrix_vector_product` | xTRMV: 三角行列とベクトルの積を求める (function template) | C++26 | | `triangular_matrix_vector_solve` | xTRSV: 三角行列を係数とする行列方程式を解く (function template) | C++26 | | `matrix_rank_1_update` | xGER, xGERU: 行列のRank-1更新 (function template) | C++26 | diff --git a/reference/linalg/hermitian_matrix_vector_product.md b/reference/linalg/hermitian_matrix_vector_product.md new file mode 100644 index 0000000000..f8aa26946c --- /dev/null +++ b/reference/linalg/hermitian_matrix_vector_product.md @@ -0,0 +1,225 @@ +# hermitian_matrix_vector_product + + +* [mathjax enable] +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + + +```cpp +namespace std::linalg { + template + void hermitian_matrix_vector_product(InMat A, + Triangle t, + InVec x, + OutVec y); // (1) + + template + void hermitian_matrix_vector_product(ExecutionPolicy&& exec, + InMat A, + Triangle t, + InVec x, + OutVec y); // (2) + + template + void hermitian_matrix_vector_product( + InMat A, + Triangle t, + InVec1 x, + InVec2 y, + OutVec z); // (3) + + template + void hermitian_matrix_vector_product( + ExecutionPolicy&& exec, + InMat A, + Triangle t, + InVec1 x, + InVec2 y, + OutVec z); // (4) +} +``` + + +## 概要 +エルミート行列とベクトルの積を計算する。 +引数`t`は対称行列の成分が上三角にあるのか、それとも下三角にあるのかを示す。 + +- (1): $y \leftarrow Ax$ +- (2): (1)を指定された実行ポリシーで実行する。 +- (3): $z \leftarrow y + Ax$ +- (4): (3)を指定された実行ポリシーで実行する。 + + +## 適格要件 +- (1), (2), (3), (4): `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 +- (1), (2), (3), (4): [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) +- (1), (2), (3), (4): [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` +- (3), (4): [`possibly-addable`](possibly-addable.md)`()`が`true` + + +## 事前条件 +- (1), (2), (3), (4): `A.extent(0) == A.extent(1)` +- (1), (2), (3), (4): [`multipliable`](multipliable.md)`(A, x, y) == true` +- (3), (4): [`addable`](addable.md)`(x, y, z) == true` + + +## 効果 +エルミート行列の成分の位置を示す`t`を考慮した、エルミート行列とベクトルの積を計算する。 + +- (1), (2): $y \leftarrow Ax$ +- (3), (4): $z \leftarrow y + Ax$ + + +## 戻り値 +なし + + +## 計算量 +$O(\verb|A.extent(1)|\times \verb|x.extent(0)|)$ + + +## 備考 +- (3), (4): `z`に`y`を入れても良い。 + + +## 例 +**[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** + +```cpp example +#include +#include +#include +#include +#include +#include + +template +void print(const Vector& v, const std::string& name) { + for (int i = 0; i < v.extent(0); ++i) { + std::cout << name << "[" << i << "]" << " = " << v[i] << '\n'; + } +} + +int main() +{ + constexpr size_t N = 4; + constexpr size_t M = 4; + + std::vector> A_vec(N*M); + std::vector x_vec(M); + std::array y_vec, z_vec; + + std::mdspan< + double, + std::extents, + std::linalg::layout_blas_packed< + std::linalg::upper_triangle_t, + std::linalg::row_major_t> + > A(A_vec.data()); + std::mdspan x(x_vec.data(), M); + std::mdspan y(y_vec.data(), N); + std::mdspan z(z_vec.data(), N); + + for(int i = 0; i < A.extent(0); ++i) { + for(int j = i; j < A.extent(1); ++j) { + A[i,j] = std::complex(i, j); + } + } + + for(int j = 0; j < x.extent(0); ++j) { + x[j] = j; + } + + // (1) + std::cout << "(1)\n"; + std::linalg::hermitian_matrix_vector_product(A, std::linalg::upper_triangle, x, y); + print(y, "y"); + + // (2) + std::cout << "(2)\n"; + std::linalg::hermitian_matrix_vector_product(std::execution::par, A, std::linalg::upper_triangle, x, y); + print(y, "y"); + + for(int i = 0; i < y.extent(0); ++i) { + y[i] = -i; + } + + // (3) + std::cout << "(3)\n"; + std::linalg::hermitian_matrix_vector_product(A, std::linalg::upper_triangle, x, y, z); + print(z, "z"); + + // (4) + std::cout << "(4)\n"; + std::linalg::hermitian_matrix_vector_product(std::execution::par, A, std::linalg::upper_triangle, x, y, z); + print(z, "z"); + + return 0; +} +``` + + +### 出力 +``` +(1) +y[0] = (0,14) +y[1] = (6,14) +y[2] = (11,11) +y[3] = (14,0) +(2) +y[0] = (0,14) +y[1] = (6,14) +y[2] = (11,11) +y[3] = (14,0) +(3) +z[0] = (0,14) +z[1] = (5,14) +z[2] = (9,11) +z[3] = (11,0) +(4) +z[0] = (0,14) +z[1] = (5,14) +z[2] = (9,11) +z[3] = (11,0) +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution`](/reference/execution.md) +- [`mdspan`](/reference/mdspan.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) +- [LAPACK: csymv](https://netlib.org/lapack/explore-html/db/d17/group__hemv_gab137e328e44dc1530ab0a93ff65c108a.html#gab137e328e44dc1530ab0a93ff65c108a) + From e80f97d28bc2a44aa7e93aa8327273ae771effb5 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Wed, 26 Jun 2024 11:42:24 +0900 Subject: [PATCH 0995/3948] =?UTF-8?q?linalg=20:=20=E4=BE=8B=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- .../linalg/symmetric_matrix_vector_product.md | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/reference/linalg/symmetric_matrix_vector_product.md b/reference/linalg/symmetric_matrix_vector_product.md index 1120a318db..3a6c5317c4 100644 --- a/reference/linalg/symmetric_matrix_vector_product.md +++ b/reference/linalg/symmetric_matrix_vector_product.md @@ -147,9 +147,6 @@ int main() for(int j = 0; j < x.extent(0); ++j) { x[j] = j; } - for(int i = 0; i < y.extent(0); ++i) { - y[i] = -i; - } // (1) std::cout << "(1)\n"; @@ -161,6 +158,10 @@ int main() std::linalg::symmetric_matrix_vector_product(std::execution::par, A, std::linalg::upper_triangle, x, y); print(y, "y"); + for(int i = 0; i < y.extent(0); ++i) { + y[i] = -i; + } + // (3) std::cout << "(3)\n"; std::linalg::symmetric_matrix_vector_product(A, std::linalg::upper_triangle, x, y, z); @@ -189,15 +190,15 @@ y[1] = 38 y[2] = 59 y[3] = 74 (3) -z[0] = 28 -z[1] = 76 -z[2] = 118 -z[3] = 148 +z[0] = 14 +z[1] = 37 +z[2] = 57 +z[3] = 71 (4) -z[0] = 28 -z[1] = 76 -z[2] = 118 -z[3] = 148 +z[0] = 14 +z[1] = 37 +z[2] = 57 +z[3] = 71 ``` From b2837286b9880068137bc50f805a9f4d61bbfb0f Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Wed, 26 Jun 2024 11:45:26 +0900 Subject: [PATCH 0996/3948] =?UTF-8?q?linalg=20:=20=E4=BE=8B=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/hermitian_matrix_vector_product.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/linalg/hermitian_matrix_vector_product.md b/reference/linalg/hermitian_matrix_vector_product.md index f8aa26946c..1a1942027e 100644 --- a/reference/linalg/hermitian_matrix_vector_product.md +++ b/reference/linalg/hermitian_matrix_vector_product.md @@ -129,7 +129,7 @@ int main() std::array y_vec, z_vec; std::mdspan< - double, + std::complex, std::extents, std::linalg::layout_blas_packed< std::linalg::upper_triangle_t, From ba49e5a641ce0dec61b678eb393b4777156c6399 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Wed, 26 Jun 2024 12:41:50 +0900 Subject: [PATCH 0997/3948] =?UTF-8?q?linalg=20:=20=E4=BE=8B=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- .../linalg/hermitian_matrix_vector_product.md | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/reference/linalg/hermitian_matrix_vector_product.md b/reference/linalg/hermitian_matrix_vector_product.md index 1a1942027e..99b1c10447 100644 --- a/reference/linalg/hermitian_matrix_vector_product.md +++ b/reference/linalg/hermitian_matrix_vector_product.md @@ -140,7 +140,8 @@ int main() std::mdspan z(z_vec.data(), N); for(int i = 0; i < A.extent(0); ++i) { - for(int j = i; j < A.extent(1); ++j) { + A[i,i] = std::complex(i, 0); + for(int j = i + 1; j < A.extent(1); ++j) { A[i,j] = std::complex(i, j); } } @@ -182,24 +183,24 @@ int main() ``` (1) y[0] = (0,14) -y[1] = (6,14) -y[2] = (11,11) -y[3] = (14,0) +y[1] = (6,13) +y[2] = (11,7) +y[3] = (14,-9) (2) y[0] = (0,14) -y[1] = (6,14) -y[2] = (11,11) -y[3] = (14,0) +y[1] = (6,13) +y[2] = (11,7) +y[3] = (14,-9) (3) z[0] = (0,14) -z[1] = (5,14) -z[2] = (9,11) -z[3] = (11,0) +z[1] = (5,13) +z[2] = (9,7) +z[3] = (11,-9) (4) z[0] = (0,14) -z[1] = (5,14) -z[2] = (9,11) -z[3] = (11,0) +z[1] = (5,13) +z[2] = (9,7) +z[3] = (11,-9) ``` From 279afa6a3d54ff005c618e50fc8f91d0922ec948 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Thu, 27 Jun 2024 14:12:35 +0900 Subject: [PATCH 0998/3948] =?UTF-8?q?linalg=20:=20triangular=5Fmatrix=5Fve?= =?UTF-8?q?ctor=5Fproduct=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 2 +- .../triangular_matrix_vector_product.md | 330 ++++++++++++++++++ 2 files changed, 331 insertions(+), 1 deletion(-) create mode 100644 reference/linalg/triangular_matrix_vector_product.md diff --git a/reference/linalg.md b/reference/linalg.md index 4453ea7f09..e1fc708488 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -84,7 +84,7 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に | [`matrix_vector_product`](linalg/matrix_vector_product.md) | xGEMV: 一般行列とベクトルの積を求める (function template) | C++26 | | [`symmetric_matrix_vector_product`](linalg/symmetric_matrix_vector_product.md) | xSYMV: 対称行列とベクトルの積を求める (function template) | C++26 | | [`hermitian_matrix_vector_product`](linalg/hermitian_matrix_vector_product.md) | xHEMV: ハミルトニアン行列とベクトルの積を求める (function template) | C++26 | -| `triangular_matrix_vector_product` | xTRMV: 三角行列とベクトルの積を求める (function template) | C++26 | +| [`triangular_matrix_vector_product`](linalg/triangular_matrix_vector_product.md) | xTRMV: 三角行列とベクトルの積を求める (function template) | C++26 | | `triangular_matrix_vector_solve` | xTRSV: 三角行列を係数とする行列方程式を解く (function template) | C++26 | | `matrix_rank_1_update` | xGER, xGERU: 行列のRank-1更新 (function template) | C++26 | | `matrix_rank_1_update_c` | xGERC: 複素行列のRank-1更新 (function template) | C++26 | diff --git a/reference/linalg/triangular_matrix_vector_product.md b/reference/linalg/triangular_matrix_vector_product.md new file mode 100644 index 0000000000..1c6655fe37 --- /dev/null +++ b/reference/linalg/triangular_matrix_vector_product.md @@ -0,0 +1,330 @@ +# triangular_matrix_vector_product + + +* [mathjax enable] +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + + +```cpp +namespace std::linalg { + template + void triangular_matrix_vector_product( + InMat A, + Triangle t, + DiagonalStorage d, + InVec x, + OutVec y); // (1) + + template + void triangular_matrix_vector_product( + ExecutionPolicy&& exec, + InMat A, + Triangle t, + DiagonalStorage d, + InVec x, + OutVec y); // (2) + + template + void triangular_matrix_vector_product( + InMat A, + Triangle t, + DiagonalStorage d, + InOutVec y); // (3) + + template + void triangular_matrix_vector_product( + ExecutionPolicy&& exec, + InMat A, + Triangle t, + DiagonalStorage d, + InOutVec y); // (4) + + template + void triangular_matrix_vector_product(InMat A, + Triangle t, + DiagonalStorage d, + InVec1 x, + InVec2 y, + OutVec z); // (5) + + template + void triangular_matrix_vector_product(ExecutionPolicy&& exec, + InMat A, + Triangle t, + DiagonalStorage d, + InVec1 x, + InVec2 y, + OutVec z); // (6) +} +``` + + +## 概要 +三角行列とベクトルの積を計算する。 +引数`t`は対称行列の成分が上三角にあるのか、それとも下三角にあるのかを示す。 +引数`d`は対称行列の対角成分を暗黙に乗法における単位元とみなすかどうかを指定する。 + +- (1): $y \leftarrow Ax$ +- (2): (1)を指定された実行ポリシーで実行する。 +- (3): $y \leftarrow Ay$ +- (4): (3)を指定された実行ポリシーで実行する。 +- (5): $z \leftarrow y + Ax$ +- (6): (3)を指定された実行ポリシーで実行する。 + + +## 適格要件 +- 共通: + + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) + + `DiagonalStorage`は[`implicit_unit_diagonal_t`](implicit_unit_diagonal_t.md)または[`explicit_diagonal_t`](explicit_diagonal_t.md) + + `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (つまり`y`に結果を代入できること) +- (1), (2), (5), (6): [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (つまり$Ax$を計算できること) +- (5), (6): [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (つまり`z`に結果を代入できること) + + +## 事前条件 +- 共通: + + `A.extent(0) == A.extent(1)` (つまり`A`が正方行列であること) + + `A.extent(0) == y.extent(0)` (つまり`y`に結果を代入できること) +- (1), (2), (5), (6): `A.extent(0) == x.extent(0)` (つまり$Ax$を計算できること) +- (5), (6): `A.extent(0) == z.extent(0)` (つまり`z`に結果を代入できること) + + +## 効果 +対称行列の成分の位置を示す`t`と対角成分へアクセスするかどうかを示す`d`を考慮した、対称行列とベクトルの積を計算する。 + +- (1), (2): $y \leftarrow Ax$ +- (3), (4): $y \leftarrow Ay$ +- (5), (6): $z \leftarrow y + Ax$ + + +## 戻り値 +なし + + +## 計算量 +$O(\verb|A.extent(1)|\times \verb|x.extent(0)|)$ + + +## 備考 +- (4): in-placeアルゴリズムなので並列実行を妨げるが、ベクトル化といった`ExecutionPolicy`特有の最適化はできる。 +- (5), (6): `z`に`y`を入れても良い。 + + +## 例 +**[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** + +```cpp example +#include +#include +#include +#include +#include + +template +void print(const Vector& v, const std::string& name) { + for (int i = 0; i < v.extent(0); ++i) { + std::cout << name << "[" << i << "]" << " = " << v[i] << '\n'; + } +} + +template +void init(Vector& v) { + for (int i = 0; i < v.extent(0); ++i) { + v[i] = i; + } +} + +int main() +{ + constexpr size_t N = 4; + constexpr size_t M = 4; + + std::vector A_vec(N*M); + std::vector x_vec(M); + std::array y_vec, z_vec; + + std::mdspan< + double, + std::extents, + std::linalg::layout_blas_packed< + std::linalg::upper_triangle_t, + std::linalg::row_major_t> + > A(A_vec.data()); + std::mdspan x(x_vec.data(), M); + std::mdspan y(y_vec.data(), N); + std::mdspan z(z_vec.data(), N); + + for(int i = 0; i < A.extent(0); ++i) { + for(int j = i + 1; j < A.extent(1); ++j) { + A[i,j] = A.extent(1) * i + j; + } + } + + init(x); + + // (1) + std::cout << "(1)\n"; + std::linalg::triangular_matrix_vector_product( + A, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + x, + y); + print(y, "y"); + + // (2) + std::cout << "(2)\n"; + std::linalg::triangular_matrix_vector_product( + std::execution::par, + A, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + x, + y); + print(y, "y"); + + init(y); + + // (3) + std::cout << "(3)\n"; + std::linalg::triangular_matrix_vector_product( + A, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + y); + print(y, "y"); + + init(y); + + // (4) + std::cout << "(4)\n"; + std::linalg::triangular_matrix_vector_product( + std::execution::par, + A, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + y); + print(y, "y"); + + init(y); + + // (5) + std::cout << "(5)\n"; + std::linalg::triangular_matrix_vector_product( + A, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + x, + y, + z); + print(z, "z"); + + // (6) + std::cout << "(6)\n"; + std::linalg::triangular_matrix_vector_product( + std::execution::par, + A, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + x, + y, + z); + print(z, "z"); + + return 0; +} +``` + + +### 出力 +``` +(1) +y[0] = 14 +y[1] = 34 +y[2] = 35 +y[3] = 3 +(2) +y[0] = 14 +y[1] = 34 +y[2] = 35 +y[3] = 3 +(3) +y[0] = 14 +y[1] = 34 +y[2] = 35 +y[3] = 3 +(4) +y[0] = 14 +y[1] = 34 +y[2] = 35 +y[3] = 3 +(5) +z[0] = 14 +z[1] = 35 +z[2] = 37 +z[3] = 6 +(6) +z[0] = 14 +z[1] = 35 +z[2] = 37 +z[3] = 6 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution`](/reference/execution.md) +- [`mdspan`](/reference/mdspan.md) +- [`upper_triangle_t`](upper_triangle_t.md) +- [`lower_triangle_t`](lower_triangle_t.md) +- [`implicit_unit_diagonal`](implicit_unit_diagonal_t.md) +- [`explicit_diagonal`](explicit_diagonal_t.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) +- [LAPACK: ctrmv](https://netlib.org/lapack/explore-html/d6/d1c/group__trmv_ga0adaf80ae1dfe117390bd7030fd865f1.html#ga0adaf80ae1dfe117390bd7030fd865f1) + + From 2dc1e5aaf161efb922a3105116b3d74b9e9e3a40 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Thu, 27 Jun 2024 14:13:41 +0900 Subject: [PATCH 0999/3948] =?UTF-8?q?linalg=20:=20=E8=A6=81=E4=BB=B6?= =?UTF-8?q?=E3=81=A8=E9=96=A2=E9=80=A3=E9=A0=85=E7=9B=AE=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- .../linalg/hermitian_matrix_vector_product.md | 15 ++++++++++----- .../linalg/symmetric_matrix_vector_product.md | 10 +++++++--- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/reference/linalg/hermitian_matrix_vector_product.md b/reference/linalg/hermitian_matrix_vector_product.md index 99b1c10447..650923eef8 100644 --- a/reference/linalg/hermitian_matrix_vector_product.md +++ b/reference/linalg/hermitian_matrix_vector_product.md @@ -70,15 +70,18 @@ namespace std::linalg { ## 適格要件 -- (1), (2), (3), (4): `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 -- (1), (2), (3), (4): [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) -- (1), (2), (3), (4): [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` +- 共通: + + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) + + `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) + + [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` - (3), (4): [`possibly-addable`](possibly-addable.md)`()`が`true` ## 事前条件 -- (1), (2), (3), (4): `A.extent(0) == A.extent(1)` -- (1), (2), (3), (4): [`multipliable`](multipliable.md)`(A, x, y) == true` +- 共通: + + `A.extent(0) == A.extent(1)` + + [`multipliable`](multipliable.md)`(A, x, y) == true` - (3), (4): [`addable`](addable.md)`(x, y, z) == true` @@ -218,6 +221,8 @@ z[3] = (11,-9) ## 関連項目 - [`execution`](/reference/execution.md) - [`mdspan`](/reference/mdspan.md) +- [`upper_triangle_t`](upper_triangle_t.md) +- [`lower_triangle_t`](lower_triangle_t.md) ## 参照 diff --git a/reference/linalg/symmetric_matrix_vector_product.md b/reference/linalg/symmetric_matrix_vector_product.md index 3a6c5317c4..aa39fc3287 100644 --- a/reference/linalg/symmetric_matrix_vector_product.md +++ b/reference/linalg/symmetric_matrix_vector_product.md @@ -70,9 +70,11 @@ namespace std::linalg { ## 適格要件 -- (1), (2), (3), (4): `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 -- (1), (2), (3), (4): [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) -- (1), (2), (3), (4): [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` +- 共通: + + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) + + `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) + + [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` - (3), (4): [`possibly-addable`](possibly-addable.md)`()`が`true` @@ -216,6 +218,8 @@ z[3] = 71 ## 関連項目 - [`execution`](/reference/execution.md) - [`mdspan`](/reference/mdspan.md) +- [`upper_triangle_t`](upper_triangle_t.md) +- [`lower_triangle_t`](lower_triangle_t.md) ## 参照 From dcd99498b2596f0fda301b61813324ff9fd2735d Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Sat, 29 Jun 2024 11:13:04 +0900 Subject: [PATCH 1000/3948] =?UTF-8?q?linalg=20:=20=E8=AA=AC=E6=98=8E?= =?UTF-8?q?=E3=82=92=E3=82=88=E3=82=8A=E6=AD=A3=E7=A2=BA=E3=81=AB=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/triangular_matrix_vector_product.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/linalg/triangular_matrix_vector_product.md b/reference/linalg/triangular_matrix_vector_product.md index 1c6655fe37..d6b7b77fdd 100644 --- a/reference/linalg/triangular_matrix_vector_product.md +++ b/reference/linalg/triangular_matrix_vector_product.md @@ -99,7 +99,7 @@ namespace std::linalg { - (3): $y \leftarrow Ay$ - (4): (3)を指定された実行ポリシーで実行する。 - (5): $z \leftarrow y + Ax$ -- (6): (3)を指定された実行ポリシーで実行する。 +- (6): (5)を指定された実行ポリシーで実行する。 ## 適格要件 @@ -108,9 +108,9 @@ namespace std::linalg { + `DiagonalStorage`は[`implicit_unit_diagonal_t`](implicit_unit_diagonal_t.md)または[`explicit_diagonal_t`](explicit_diagonal_t.md) + `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) - + [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (つまり`y`に結果を代入できること) -- (1), (2), (5), (6): [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (つまり$Ax$を計算できること) -- (5), (6): [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (つまり`z`に結果を代入できること) + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (つまり`A`の次元と`y`の次元が同じであること) +- (1), (2), (5), (6): [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (つまり`A`の次元と`x`の次元が同じであること) +- (5), (6): [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (つまり`A`の次元と`x`の次元が同じであること) ## 事前条件 From d00e1cd3c53468084370d039849280f8d8a9244d Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Sat, 29 Jun 2024 11:13:58 +0900 Subject: [PATCH 1001/3948] =?UTF-8?q?linalg=20:=20triangular=5Fmatrix=5Fve?= =?UTF-8?q?ctor=5Fsolve=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 2 +- .../linalg/triangular_matrix_vector_solve.md | 389 ++++++++++++++++++ 2 files changed, 390 insertions(+), 1 deletion(-) create mode 100644 reference/linalg/triangular_matrix_vector_solve.md diff --git a/reference/linalg.md b/reference/linalg.md index e1fc708488..d813b052ff 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -85,7 +85,7 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に | [`symmetric_matrix_vector_product`](linalg/symmetric_matrix_vector_product.md) | xSYMV: 対称行列とベクトルの積を求める (function template) | C++26 | | [`hermitian_matrix_vector_product`](linalg/hermitian_matrix_vector_product.md) | xHEMV: ハミルトニアン行列とベクトルの積を求める (function template) | C++26 | | [`triangular_matrix_vector_product`](linalg/triangular_matrix_vector_product.md) | xTRMV: 三角行列とベクトルの積を求める (function template) | C++26 | -| `triangular_matrix_vector_solve` | xTRSV: 三角行列を係数とする行列方程式を解く (function template) | C++26 | +| [`triangular_matrix_vector_solve`](linalg/triangular_matrix_vector_solve.md) | xTRSV: 三角行列を係数とする行列方程式を解く (function template) | C++26 | | `matrix_rank_1_update` | xGER, xGERU: 行列のRank-1更新 (function template) | C++26 | | `matrix_rank_1_update_c` | xGERC: 複素行列のRank-1更新 (function template) | C++26 | | `symmetric_matrix_rank_1_update` | xSYR: 対称行列のRank-1更新 (function template) | C++26 | diff --git a/reference/linalg/triangular_matrix_vector_solve.md b/reference/linalg/triangular_matrix_vector_solve.md new file mode 100644 index 0000000000..837e31526a --- /dev/null +++ b/reference/linalg/triangular_matrix_vector_solve.md @@ -0,0 +1,389 @@ +# triangular_matrix_vector_solve + + +* [mathjax enable] +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + + +```cpp +namespace std::linalg { + template + void triangular_matrix_vector_solve( + InMat A, + Triangle t, + DiagonalStorage d, + InVec b, + OutVec x, + BinaryDivideOp divide); // (1) + + template + void triangular_matrix_vector_solve( + ExecutionPolicy&& exec, + InMat A, + Triangle t, + DiagonalStorage d, + InVec b, + OutVec x, + BinaryDivideOp divide); // (2) + + template + void triangular_matrix_vector_solve( + InMat A, + Triangle t, + DiagonalStorage d, + InVec b, + OutVec x); // (3) + + template + void triangular_matrix_vector_solve( + ExecutionPolicy&& exec, + InMat A, + Triangle t, + DiagonalStorage d, + InVec b, + OutVec x); // (4) + + template + void triangular_matrix_vector_solve( + InMat A, + Triangle t, + DiagonalStorage d, + InOutVec b, + BinaryDivideOp divide); // (5) + + template + void triangular_matrix_vector_solve( + ExecutionPolicy&& exec, + InMat A, + Triangle t, + DiagonalStorage d, + InOutVec b, + BinaryDivideOp divide); // (6) + + template + void triangular_matrix_vector_solve( + InMat A, + Triangle t, + DiagonalStorage d, + InOutVec b); // (7) + + template + void triangular_matrix_vector_solve( + ExecutionPolicy&& exec, + InMat A, + Triangle t, + DiagonalStorage d, + InOutVec b); // (8) +} +``` + + +## 概要 +三角行列に対して、連立一次方程式を解く。 +引数`t`は対称行列の成分が上三角にあるのか、それとも下三角にあるのかを示す。 +引数`d`には対称行列の対角成分を暗黙に乗法における単位元とみなすかどうかを指定する。 +引数`divide`には値の割り算を指定する。この引数は非可換な掛け算を持つ値型をサポートするためにある。 + +- (1): 連立一次方程式 $Ay = b$ を解き、`y`を`x`に代入する。もし解が存在しないなら、`x`は有効だが未規定。 +- (2): (1)を指定された実行ポリシーで実行する。 +- (3): 割り算に[`std::divedes`](/reference/functional/divides.md)``を用いて、(1)を行う。 +- (4): (3)を指定された実行ポリシーで実行する。 +- (5): `x`に`b`を使って、in-placeに(1)を行う。 +- (6): (5)を指定された実行ポリシーで実行する。 +- (7): 割り算に[`std::divedes`](/reference/functional/divides.md)``を用いて、(5)を行う。 +- (8): (7)を指定された実行ポリシーで実行する。 + + +## 適格要件 +- 共通: + + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) + + `DiagonalStorage`は[`implicit_unit_diagonal_t`](implicit_unit_diagonal_t.md)または[`explicit_diagonal_t`](explicit_diagonal_t.md) + + `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (つまり`A`の次元と`b`の次元が同じであること) +- (1), (2), (3), (4): [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (つまり`A`の次元と`b`の次元が同じであること) + + +## 事前条件 +- 共通: + + `A.extent(0) == A.extent(1)` (つまり`A`が正方行列であること) + + `A.extent(0) == b.extent(0)` (つまり`A`の次元と`b`の次元が同じであること) +- (1), (2), (3), (4): `A.extent(0) == x.extent(0)` (つまり`A`の次元と`x`の次元が同じであること) + + +## 効果 +対称行列の成分の位置を示す`t`と対角成分へアクセスするかどうかを示す`d`を考慮して、連立一次方程式の解を求める。 + +- (1), (2): 連立一次方程式 $Ay = b$ を解き、`y`を`x`に代入する。もし解が存在しないなら、`x`は有効だが未規定。 +- (3): `triangular_matrix_vector_solve(A, t, d, b, x, divides{})`と同じ。 +- (4): `triangular_matrix_vector_solve(std::forward(exec), A, t, d, b, x, divides{})`と同じ。 +- (5), (6): `x`に`b`を使って、in-placeに(1)を行う。 +- (7): `triangular_matrix_vector_solve(A, t, d, b, divides{})`と同じ。 +- (8): `triangular_matrix_vector_solve(std::forward(exec), A, t, d, b, divides{})`と同じ。 + + +## 戻り値 +なし + + +## 計算量 +$O(\verb|A.extent(1)|\times \verb|x.extent(0)|)$ + + +## 備考 +- (6), (8): in-placeアルゴリズムなので並列実行を妨げるが、ベクトル化といった`ExecutionPolicy`特有の最適化はできる。 + + +## 例 +**[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** + +```cpp example +#include +#include +#include +#include +#include +#include + +template +void print(const Vector& v, const std::string& name) { + for (int i = 0; i < v.extent(0); ++i) { + std::cout << name << "[" << i << "]" << " = " << v[i] << '\n'; + } +} + +template +void init(Vector& v) { + for (int i = 0; i < v.extent(0); ++i) { + v[i] = i; + } +} + +int main() +{ + constexpr size_t N = 4; + + std::vector A_vec(N * N); + std::vector x_vec(N); + std::array b_vec; + + std::mdspan< + double, + std::extents, + std::linalg::layout_blas_packed< + std::linalg::upper_triangle_t, + std::linalg::row_major_t> + > A(A_vec.data()); + std::mdspan x(x_vec.data(), N); + std::mdspan b(b_vec.data(), N); + + for(int i = 0; i < A.extent(0); ++i) { + for(int j = i + 1; j < A.extent(1); ++j) { + A[i,j] = A.extent(1) * i + j; + } + } + + init(b); + + // (1) + std::cout << "(1)\n"; + std::linalg::triangular_matrix_vector_solve( + A, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + b, + x, + std::divides{}); + print(x, "x"); + + // (2) + std::cout << "(2)\n"; + std::linalg::triangular_matrix_vector_solve( + std::execution::par, + A, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + b, + x, + std::divides{}); + print(x, "x"); + + // (3) + std::cout << "(3)\n"; + std::linalg::triangular_matrix_vector_solve( + A, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + b, + x); + print(x, "x"); + + // (4) + std::cout << "(4)\n"; + std::linalg::triangular_matrix_vector_solve( + std::execution::par, + A, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + b, + x); + print(x, "x"); + + // (5) + std::cout << "(5)\n"; + std::linalg::triangular_matrix_vector_solve( + A, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + b, + std::divides{}); + print(b, "b"); + + init(b); + + // (6) + std::cout << "(6)\n"; + std::linalg::triangular_matrix_vector_solve( + std::execution::par, + A, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + b, + std::divides{}); + print(b, "b"); + + init(b); + + // (7) + std::cout << "(7)\n"; + std::linalg::triangular_matrix_vector_solve( + A, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + b); + print(b, "b"); + + init(b); + + // (8) + std::cout << "(8)\n"; + std::linalg::triangular_matrix_vector_solve( + std::execution::par, + A, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + b); + print(b, "b"); + + return 0; +} +``` + + +### 出力 +``` +(1) +x[0] = -3 +x[1] = -4 +x[2] = -1 +x[3] = 3 +(2) +x[0] = -3 +x[1] = -4 +x[2] = -1 +x[3] = 3 +(3) +x[0] = -3 +x[1] = -4 +x[2] = -1 +x[3] = 3 +(4) +x[0] = -3 +x[1] = -4 +x[2] = -1 +x[3] = 3 +(5) +b[0] = -3 +b[1] = -4 +b[2] = -1 +b[3] = 3 +(6) +b[0] = -3 +b[1] = -4 +b[2] = -1 +b[3] = 3 +(7) +b[0] = -3 +b[1] = -4 +b[2] = -1 +b[3] = 3 +(8) +b[0] = -3 +b[1] = -4 +b[2] = -1 +b[3] = 3 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution`](/reference/execution.md) +- [`mdspan`](/reference/mdspan.md) +- [`upper_triangle_t`](upper_triangle_t.md) +- [`lower_triangle_t`](lower_triangle_t.md) +- [`implicit_unit_diagonal`](implicit_unit_diagonal_t.md) +- [`explicit_diagonal`](explicit_diagonal_t.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) +- [LAPACK: trmv](https://netlib.org/lapack/explore-html/dd/dc3/group__trsv.html) From 8585636996f8ec64fe627659a02b0c87e3e702f3 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Sun, 30 Jun 2024 12:04:52 +0900 Subject: [PATCH 1002/3948] =?UTF-8?q?linalg=20:=20matrix=5Frank=5F1=5Fupda?= =?UTF-8?q?te=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 2 +- reference/linalg/matrix_rank_1_update.md | 174 +++++++++++++++++++++++ 2 files changed, 175 insertions(+), 1 deletion(-) create mode 100644 reference/linalg/matrix_rank_1_update.md diff --git a/reference/linalg.md b/reference/linalg.md index d813b052ff..1cf1e7e36f 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -86,7 +86,7 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に | [`hermitian_matrix_vector_product`](linalg/hermitian_matrix_vector_product.md) | xHEMV: ハミルトニアン行列とベクトルの積を求める (function template) | C++26 | | [`triangular_matrix_vector_product`](linalg/triangular_matrix_vector_product.md) | xTRMV: 三角行列とベクトルの積を求める (function template) | C++26 | | [`triangular_matrix_vector_solve`](linalg/triangular_matrix_vector_solve.md) | xTRSV: 三角行列を係数とする行列方程式を解く (function template) | C++26 | -| `matrix_rank_1_update` | xGER, xGERU: 行列のRank-1更新 (function template) | C++26 | +| [`matrix_rank_1_update`](linalg/matrix_rank_1_update.md) | xGER, xGERU: 行列のRank-1更新 (function template) | C++26 | | `matrix_rank_1_update_c` | xGERC: 複素行列のRank-1更新 (function template) | C++26 | | `symmetric_matrix_rank_1_update` | xSYR: 対称行列のRank-1更新 (function template) | C++26 | | `hermitian_matrix_rank_1_update` | xHER: ハミルトニアン行列のRank-1更新 (function template) | C++26 | diff --git a/reference/linalg/matrix_rank_1_update.md b/reference/linalg/matrix_rank_1_update.md new file mode 100644 index 0000000000..9273d75416 --- /dev/null +++ b/reference/linalg/matrix_rank_1_update.md @@ -0,0 +1,174 @@ +# matrix_rank_1_update + + +* [mathjax enable] +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + + +```cpp +namespace std::linalg { + template + void matrix_rank_1_update( + InVec1 x, + InVec2 y, + InOutMat A); // (1) + + template + void matrix_rank_1_update( + ExecutionPolicy&& exec, + InVec1 x, + InVec2 y, + InOutMat A); // (2) +} +``` + + +## 概要 +非対称かつ共役を取らないrank-1 updateを行う。 + +- (1): $A \leftarrow A + xy^T$ +- (2): (1)を指定された実行ポリシーで実行する。 + + +## 適格要件 +- [`possibly-multipliable`](possibly-multipliable.md)`() == true` + + +## 事前条件 +- [`multipliable`](multipliable.md)`(A, y, x) == true` + + +## 効果 +- (1): $A \leftarrow A + xy^T$ +- (2): (1)を指定された実行ポリシーで実行する。 + + +## 戻り値 +なし + + +## 計算量 +$O(\verb|x.extent(0)|\times \verb|y.extent(0)|)$ + + +## 例 +**[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** + +```cpp example +#include +#include +#include +#include +#include + +template +void print_mat(const Matrix& v) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = 0; j < A.extent(1) - 1; ++j) { + std::cout << A[i, j] << ' '; + } + std::cout << A[i, A.extent(1) - 1] << '\n'; + } +} + +template +void init_vec(Vector& v) { + for (int i = 0; i < v.extent(0); ++i) { + v[i] = i; + } +} + +template +void init_mat(Matrix& A) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = 0; j < A.extent(1); ++j) { + A[i,j] = A.extent(1) * i + j; + } + } +} + +int main() +{ + constexpr size_t N = 4; + + std::vector A_vec(N * N); + std::vector x_vec(N); + std::array y_vec; + + std::mdspan< + double, + std::extents> A(A_vec.data()); + std::mdspan x(x_vec.data(), N); + std::mdspan y(y_vec.data(), N); + + init_mat(A) + init_vec(x); + init_vec(y); + + // (1) + std::cout << "(1)\n"; + std::linalg::matrix_rank_1_update( + x, + y, + A); + print_mat(A); + + init_mat(A); + + // (2) + std::cout << "(2)\n"; + std::linalg::matrix_rank_1_update( + std::execution::par, + x, + y, + A); + print_mat(A); + + return 0; +} +``` + + +### 出力 +``` +(1) +0 1 2 3 +4 6 8 10 +8 11 14 17 +12 16 20 24 +(2) +0 1 2 3 +4 6 8 10 +8 11 14 17 +12 16 20 24 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution`](/reference/execution.md) +- [`mdspan`](/reference/mdspan.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) +- [LAPACK: ger: general matrix rank-1 update](https://netlib.org/lapack/explore-html/d8/d75/group__ger.html) + From 5b559387f4b0771958e5a072f01e4a711588d06b Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sun, 30 Jun 2024 18:51:06 +0900 Subject: [PATCH 1003/3948] =?UTF-8?q?format:=20=E8=AA=AC=E6=98=8E=E3=82=92?= =?UTF-8?q?=E5=BE=AE=E8=AA=BF=E6=95=B4=20&=20=E3=83=AA=E3=83=B3=E3=82=AF?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/format.md | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/reference/format/format.md b/reference/format/format.md index 320fced218..b34cca7adc 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -69,7 +69,7 @@ string s3 = format("{} {1}", "a", "b"); // コンパイルエラー ### 標準のオプション書式 組み込みの型に対して使える標準のオプション書式は次の通り(`[]`は省略可の意味)。 -基本的に`printf`の書式を踏襲しているが、あくまでもオプションであり、省略しても``と同じようにデフォルトの書式が使われる。 +基本的に`printf`の書式を踏襲しているが、オプションをすべて省略しても(`{}`だけでも)デフォルトの書式が使われる。 ``` [[fill] align] [sign] ['#'] ['0'] [width] ['.' precision] ['L'] [type] @@ -153,6 +153,8 @@ string s3 = format("{} {1}", "a", "b"); // コンパイルエラー 大文字のオプションを指定すると数値中のアルファベットが大文字になる。 +精度のふるまいについては[`to_chars`](/reference/charconv/to_chars.md)を参照。 + #### ポインタの場合 | type | 意味 | 効果 | 対応バージョン | @@ -190,8 +192,6 @@ std::format("{:*>6}", "あ"); // "****あ" std::format("{:あ>6}", 'x'); // "あああああx" ``` -##### 0埋めとの関係 - アライメント方向が指定されていると、0埋めは無効となる。 ```cpp @@ -211,6 +211,12 @@ std::format("{:0>05}", -42); // "00-42" #### Range・シーケンスコンテナの書式 (C++23) +Range・シーケンスコンテナのフォーマットでは、要素の間に区切り文字を挿入して、全体を囲み文字で囲んで出力する。各要素は再帰的にフォーマットされる。 + +```cpp +std::format("{}", std::vector{1, 2, 3}); // "[1, 2, 3]" +``` + Range・シーケンスコンテナに対して使用できる標準のオプション書式は次の通り(`[]`は省略可の意味)。 ``` @@ -233,6 +239,7 @@ Range・シーケンスコンテナに対して使用できる標準のオプシ | m | `std::map`出力向けの書式 | 全体の囲み文字を`[ ]`の代わりに`{ }`とする。要素型にも`m`書式を適用する | C++23 | | s | 文字列として出力 | 要素型が文字型であること。エスケープ処理しない文字列として書式化する | C++23 | | ?s | デバッグ文字列として出力 | 要素型が文字型であること。エスケープした文字列として書式化する | C++23 | +| (なし) | デフォルト | 囲み文字を`[ ]`、区切り文字を`, `として書式化する | C++23 | - `m`書式は、要素が[`std::pair`](/reference/utility/pair.md)とサイズ2の[`std::tuple`](/reference/tuple/tuple.md)の場合のみ指定できる - `?s`書式を指定した場合、`n`オプションと、`range-underlying-spec`は指定できない @@ -241,6 +248,7 @@ Range・シーケンスコンテナに対して使用できる標準のオプシ - 要素型の書式を指定して、デバッグ出力指定をしなければ、デフォルトで有効になっているデバッグ出力を解除できる - コンテナアダプタである[`std::queue`](/reference/queue/queue.md)、[`std::priority_queue`](/reference/queue/priority_queue.md)、[`std::stack`](/reference/stack/stack.md)も使用できる - [`std::basic_string`](/reference/string/basic_string.md)と[`std::basic_string_view`](/reference/string_view/basic_string_view.md)はRangeでもあるが、特殊化の優先順位によって標準のフォーマッターが選択されるため、Rangeとしてフォーマットすることはできない +- デフォルト書式に対応する`type`がないため、明示的に指定することはできない #### 連想コンテナの書式 (C++23) @@ -249,6 +257,11 @@ Range・シーケンスコンテナと同じだが、デフォルトで囲み文 - メンバ型`key_type`を持つ場合、連想コンテナとみなされる - さらに、メンバ型`mapped_type`を持ち、要素が[`std::pair`](/reference/utility/pair.md)またはサイズ2の[`std::tuple`](/reference/tuple/tuple.md)の場合、`map`互換のコンテナとみなされる。このとき、要素にも`m`書式を用いる +```cpp +std::map m {{1, "aaa"}, {2, "bbb"}}; +std::format("{}", m); // {1: "aaa", 2: "bbb"} +``` + #### pair、tupleの書式 (C++23) [`std::pair`](/reference/utility/pair.md)と[`std::tuple`](/reference/tuple/tuple.md)に対して使用できる標準のオプション書式は次の通り(`[]`は省略可の意味)。 @@ -275,7 +288,7 @@ Range・シーケンスコンテナと同じだが、デフォルトで囲み文 - 要素型ごとに個別に書式を指定することはできない - デバッグ出力可能な要素型の場合、デバッグ出力は常に有効 - +- デフォルト書式に対応する`type`がないため、明示的に指定することはできない ### 書式例 @@ -359,10 +372,9 @@ return vformat(loc, fmt.str, make_wformat_args(args...)); // (4) * マルチバイト文字列、ワイド文字列の区別は、可変長引数部分で受け取れる文字列の型にも適用される。 * 例えば、フォーマット文字列がマルチバイトの場合、引数にワイド文字列を渡すことは標準ではできない。 - * ユーザー定義フォーマッターで拡張することは可能。 -* [`to_chars`](/reference/charconv/to_chars.md)はワイド文字列に対応していない。 - * ワイド文字列版のときはマルチバイト文字列から変換すると考えられる。 - * あるいは、`to_wchars`のようなものを作り、それを使うことも考えられる。 + * ユーザー定義フォーマッターで拡張することは可能。ただし、ユーザー定義の名前に依存しない特殊化は`std`名前空間に追加できない。 +* `format`の結果は一部[`to_chars`](/reference/charconv/to_chars.md)によって定義されているが、[`to_chars`](/reference/charconv/to_chars.md)自体はワイド文字列に対応していない。 + * もし何らかの手段でマルチバイト文字列に変換すれば、[`to_chars`](/reference/charconv/to_chars.md)に一致する、と解釈できる。 ## 例 ### 基本的な使い方 (C++20) From 2d2a3c7ca7459556dc9b5bee49935309d8814814 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sun, 30 Jun 2024 19:51:45 +0900 Subject: [PATCH 1004/3948] =?UTF-8?q?to=5Fchars:=20=E7=B2=BE=E5=BA=A6?= =?UTF-8?q?=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6=E8=A3=9C=E8=B6=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/charconv/to_chars.md | 8 +++++++- reference/format/format.md | 4 +++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/reference/charconv/to_chars.md b/reference/charconv/to_chars.md index 5a5370ac42..9cccf2cbdc 100644 --- a/reference/charconv/to_chars.md +++ b/reference/charconv/to_chars.md @@ -144,7 +144,12 @@ C++標準はこれら関数の実装の詳細について何も規定しない 出力文字列が最も短くなるように変換される。 `chars_format::general`が指定された場合は(2)(3)(4)(5)と同等。 -- (10)(11)(12)(13) : `fmt`と`precision`によって指定されたフォーマット指定子と精度を用いて、Cロケールで`printf`によって行われたかのように浮動小数点数を文字列へ変換する。 +- (10)(11)(12)(13) : `fmt`と`precision`によって指定されたフォーマット指定子と精度を用いて、Cロケールで`printf`によって行われたかのように浮動小数点数を文字列へ変換する。 + 精度は、`chars_format::fixed`では小数点以下の正確な桁数、`chars_format::scientific`と`chars_format::hex`では最小の桁数を表す。 + `chars_format::general`が指定された場合は次のようになる。 + - 指数表記したときの指数を`X`、`precision`と1の大きいほうを`P`とする。 + - `P > X ≥ −4` のとき、精度 `P - 1 - X` で固定小数形式を使用する。 + - それ以外の場合は、精度 `P - 1` で指数形式を使用する。 出力文字列が最も短くなるようにとは、小数点の前に少なくとも1桁あり、対応する[`from_chars`](../charconv/from_chars.md)関数によって値を正確に復元できるような最小の文字数、になることである。 そのような文字列表現が複数ある場合、`value`の値との差が最も小さくなる物が選ばれ、それも複数あるときは[`std::round_to_nearest`](/reference/limits/float_round_style.md)に従った丸めによって一つを選択する。 @@ -409,3 +414,4 @@ z - C++23での(1)constexpr指定 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で拡張浮動小数点数型に対応した +- [C言語リファレンス - fprintf](https://ja.cppreference.com/w/c/io/fprintf) diff --git a/reference/format/format.md b/reference/format/format.md index b34cca7adc..a26f023b66 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -153,7 +153,9 @@ string s3 = format("{} {1}", "a", "b"); // コンパイルエラー 大文字のオプションを指定すると数値中のアルファベットが大文字になる。 -精度のふるまいについては[`to_chars`](/reference/charconv/to_chars.md)を参照。 +「値に応じて」の詳細や、精度の意味については[`to_chars`](/reference/charconv/to_chars.md)を参照。 + +代替表現を指定すると、小数点以下が何もなくても小数点記号を出力する。`g`/`G`の場合は、代替表現を指定しないかぎり末尾の0およびそれによって不要になる小数点を出力しない。 #### ポインタの場合 From 729c591bbe355498deac9e145923ec2dd078aed6 Mon Sep 17 00:00:00 2001 From: suomesta Date: Mon, 1 Jul 2024 22:15:19 +0900 Subject: [PATCH 1005/3948] fix some typo --- lang/cpp23.md | 1 - lang/cpp23/simpler_implicit_move.md | 2 +- reference/execution/execution/execution_policy.md | 2 +- reference/format/range_format.md | 2 +- reference/iterator/reverse_iterator/op_plus.md | 2 +- reference/iterator/reverse_iterator/op_plus_assign.md | 2 +- 6 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lang/cpp23.md b/lang/cpp23.md index a7838b5d5e..cde2d49c15 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -217,7 +217,6 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 ### 型特性 - [``](/reference/type_traits.md)に、スコープ付き列挙型かを判定する型特性[`std::is_scoped_enum`](/reference/type_traits/is_scoped_enum.md)を追加 -- [``](/reference/type_traits.md)に、第1テンプレート引数についている型修飾を外す型特性として、以下を追加: - [``](/reference/type_traits.md)に、一時オブジェクトの参照への束縛を検出するための型特性として、以下を追加: - [`std::reference_constructs_from_temporary`](/reference/type_traits/reference_constructs_from_temporary.md) - [`std::reference_converts_from_temporary`](/reference/type_traits/reference_converts_from_temporary.md) diff --git a/lang/cpp23/simpler_implicit_move.md b/lang/cpp23/simpler_implicit_move.md index 86746ed6fc..1906cc1c29 100644 --- a/lang/cpp23/simpler_implicit_move.md +++ b/lang/cpp23/simpler_implicit_move.md @@ -318,7 +318,7 @@ auto g(Widget&& w) -> Widget&& { この非一貫性を解消することがまず求められていた。 -また、C++20時点の暗黙ムーブの使用は二段階のオーバーロード解決を行う複雑なものであり、暗黙ムーブが行われるかどうかについて実装間で挙動に差異が生じていた。C++20時点の暗黙ムーブの仕様は次のようになっていた +また、C++20時点の暗黙ムーブの仕様は二段階のオーバーロード解決を行う複雑なものであり、暗黙ムーブが行われるかどうかについて実装間で挙動に差異が生じていた。C++20時点の暗黙ムーブの仕様は次のようになっていた 暗黙ムーブ可能なエンティティが次のコピー初期化が行われる場所で指名されている場合、コピーの代わりにムーブが使用される場合がある diff --git a/reference/execution/execution/execution_policy.md b/reference/execution/execution/execution_policy.md index fdc1ea560a..3a546b20d8 100644 --- a/reference/execution/execution/execution_policy.md +++ b/reference/execution/execution/execution_policy.md @@ -133,7 +133,7 @@ int main() // マルチスレッド化の場合は、ミューテックスかアトミック操作でデータ競合を回避する std::mutex m; - std::for_each(std::execution::par, a.begin(), b.end(), [&](int x) { + std::for_each(std::execution::par, a.begin(), a.end(), [&](int x) { std::lock_guard lk{m}; b.push_back(x); }); diff --git a/reference/format/range_format.md b/reference/format/range_format.md index be68bcd919..799c4d1f09 100644 --- a/reference/format/range_format.md +++ b/reference/format/range_format.md @@ -32,7 +32,7 @@ Rangeの書式種別を表す列挙型。 ## 備考 -- `disable`は値0であるため、`bool`型に変換して有効かどうかを判定するための使用できる +- `disabled`は値0であるため、`bool`型に変換して有効かどうかを判定するために使用できる ## バージョン diff --git a/reference/iterator/reverse_iterator/op_plus.md b/reference/iterator/reverse_iterator/op_plus.md index f12632ae11..f8d03707d6 100644 --- a/reference/iterator/reverse_iterator/op_plus.md +++ b/reference/iterator/reverse_iterator/op_plus.md @@ -18,7 +18,7 @@ namespace std { ``` ## 概要 -イテレータを`N`回進める。 +イテレータを`n`回進める。 `reverse_iterator`は逆方向に進める。 diff --git a/reference/iterator/reverse_iterator/op_plus_assign.md b/reference/iterator/reverse_iterator/op_plus_assign.md index cb3dce50b8..0294d08c05 100644 --- a/reference/iterator/reverse_iterator/op_plus_assign.md +++ b/reference/iterator/reverse_iterator/op_plus_assign.md @@ -10,7 +10,7 @@ constexpr reverse_iterator& operator+=(difference_type n); // C++17 ``` ## 概要 -イテレータ自身を`N`回進める。 +イテレータ自身を`n`回進める。 `reverse_iterator`なので逆方向に進める。 From 2a6ccb456b0364efd2a7d5e947623d17efa3500b Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 2 Jul 2024 14:17:21 +0900 Subject: [PATCH 1006/3948] fix links to `swappable_with` concept MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit swappable_withコンセプト説明はswappableコンセプトページに統合されている。 --- reference/type_traits/is_nothrow_swappable_with.md | 2 +- reference/type_traits/is_swappable_with.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/type_traits/is_nothrow_swappable_with.md b/reference/type_traits/is_nothrow_swappable_with.md index bb1144ece9..88059dd5eb 100644 --- a/reference/type_traits/is_nothrow_swappable_with.md +++ b/reference/type_traits/is_nothrow_swappable_with.md @@ -24,7 +24,7 @@ namespace std { ## 効果 -型`T`と`U`の間で[`std::swappable_with`](/reference/concepts/swappable_with.md.nolink)要件を満たしており、2つのswap関数が共に例外を投げない場合は[`true_type`](true_type.md)から派生し、そうでなければ[`false_type`](false_type.md)から派生する。 +型`T`と`U`の間で[`std::swappable_with`](/reference/concepts/swappable.md)要件を満たしており、2つのswap関数が共に例外を投げない場合は[`true_type`](true_type.md)から派生し、そうでなければ[`false_type`](false_type.md)から派生する。 型`T`と`U`は参照でなければswapできないので`T`と`U`が参照でない場合、結果は`false`となる。 diff --git a/reference/type_traits/is_swappable_with.md b/reference/type_traits/is_swappable_with.md index faa61b8634..c3572b1434 100644 --- a/reference/type_traits/is_swappable_with.md +++ b/reference/type_traits/is_swappable_with.md @@ -23,11 +23,11 @@ namespace std { ## 効果 -型`T`と`U`の間で[`std::swappable_with`](/reference/concepts/swappable_with.md.nolink)要件を満たしていれば[`true_type`](true_type.md)から派生し、そうでなければ[`false_type`](false_type.md)から派生する。 +型`T`と`U`の間で[`std::swappable_with`](/reference/concepts/swappable.md)要件を満たしていれば[`true_type`](true_type.md)から派生し、そうでなければ[`false_type`](false_type.md)から派生する。 型`T`と`U`は参照でなければswapできないので`T`と`U`が参照でない場合、結果は`false`となる。 -簡単に説明すると[`std::swappable_with`](/reference/concepts/swappable_with.md.nolink)要件を満たすとは、2引数を取りその引数の値を入れ替えるswap関数が以下のようなコードで見つかることである。 +簡単に説明すると[`std::swappable_with`](/reference/concepts/swappable.md)要件を満たすとは、2引数を取りその引数の値を入れ替えるswap関数が以下のようなコードで見つかることである。 ```cpp #include From e7325de7c19f5f56d99b70645599b8881d0e181f Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Tue, 2 Jul 2024 16:25:53 +0900 Subject: [PATCH 1007/3948] =?UTF-8?q?linalg=20:=20matrix=5Frank=5F1=5Fupda?= =?UTF-8?q?te=5Fc=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 2 +- reference/linalg/matrix_rank_1_update_c.md | 179 +++++++++++++++++++++ 2 files changed, 180 insertions(+), 1 deletion(-) create mode 100644 reference/linalg/matrix_rank_1_update_c.md diff --git a/reference/linalg.md b/reference/linalg.md index 1cf1e7e36f..db22cacffa 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -87,7 +87,7 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に | [`triangular_matrix_vector_product`](linalg/triangular_matrix_vector_product.md) | xTRMV: 三角行列とベクトルの積を求める (function template) | C++26 | | [`triangular_matrix_vector_solve`](linalg/triangular_matrix_vector_solve.md) | xTRSV: 三角行列を係数とする行列方程式を解く (function template) | C++26 | | [`matrix_rank_1_update`](linalg/matrix_rank_1_update.md) | xGER, xGERU: 行列のRank-1更新 (function template) | C++26 | -| `matrix_rank_1_update_c` | xGERC: 複素行列のRank-1更新 (function template) | C++26 | +| [`matrix_rank_1_update_c`](linalg/matrix_rank_1_update_c.md) | xGERC: 複素行列のRank-1更新 (function template) | C++26 | | `symmetric_matrix_rank_1_update` | xSYR: 対称行列のRank-1更新 (function template) | C++26 | | `hermitian_matrix_rank_1_update` | xHER: ハミルトニアン行列のRank-1更新 (function template) | C++26 | | `symmetric_matrix_rank_2_update` | xSYR2: 対称行列のRank-2更新 (function template) | C++26 | diff --git a/reference/linalg/matrix_rank_1_update_c.md b/reference/linalg/matrix_rank_1_update_c.md new file mode 100644 index 0000000000..504c35a41e --- /dev/null +++ b/reference/linalg/matrix_rank_1_update_c.md @@ -0,0 +1,179 @@ +# matrix_rank_1_update_c + + +* [mathjax enable] +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + + +```cpp +namespace std::linalg { + template + void matrix_rank_1_update_c( + InVec1 x, + InVec2 y, + InOutMat A); // (1) + + template + void matrix_rank_1_update_c( + ExecutionPolicy&& exec, + InVec1 x, + InVec2 y, + InOutMat A); // (2) +} +``` + + +## 概要 +非対称で共役を取るrank-1 updateを行う。 + +- (1): $A \leftarrow A + xy^*$ +- (2): (1)を指定された実行ポリシーで実行する。 + + +## 適格要件 +- [`possibly-multipliable`](possibly-multipliable.md)`() == true` + + +## 事前条件 +- [`multipliable`](multipliable.md)`(A, y, x) == true` + + +## 効果 +- (1): [`matrix_rank_1_update`](matrix_rank_1_update.md)`(x, conjugated(y), A)`と同じ。 +- (2): `matrix_rank_1_update(std::forward(exec), x, conjugated(y), A)`と同じ。 + + +## 戻り値 +なし + + +## 計算量 +$O(\verb|x.extent(0)|\times \verb|y.extent(0)|)$ + + +## 例 +**[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** + +```cpp example +#include +#include +#include +#include +#include + +template +void print_mat(const Matrix& A) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = 0; j < A.extent(1) - 1; ++j) { + std::cout << A[i, j] << ' '; + } + std::cout << A[i, A.extent(1) - 1] << '\n'; + } +} + +template +void init_vec(Vector& v) { + for (int i = 0; i < v.extent(0); ++i) { + v[i] = std::complex(i, 0); + } +} + +template +void init_mat(Matrix& A) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = 0; j < A.extent(1); ++j) { + A[i,j] = std::complex(i, j); + } + } +} + +int main() +{ + constexpr size_t N = 4; + + std::vector> A_vec(N * N); + std::vector> x_vec(N); + std::array, N> y_vec; + + std::mdspan< + std::complex, + std::extents> A(A_vec.data()); + std::mdspan x(x_vec.data(), N); + std::mdspan y(y_vec.data(), N); + + init_mat(A); + init_vec(x); + init_vec(y); + + for (int i = 0; i < y.extent(0); ++i) { + y[i] *= std::complex(0, 1); + } + + // (1) + std::cout << "(1)\n"; + std::linalg::matrix_rank_1_update_c( + x, + y, + A); + print_mat(A); + + init_mat(A); + + // (2) + std::cout << "(2)\n"; + std::linalg::matrix_rank_1_update_c( + std::execution::par, + x, + y, + A); + print_mat(A); + + return 0; +} +``` + + +### 出力 +``` +(1) +(0,0) (0,1) (0,2) (0,3) +(1,0) (1,0) (1,0) (1,0) +(2,0) (2,-1) (2,-2) (2,-3) +(3,0) (3,-2) (3,-4) (3,-6) +(2) +(0,0) (0,1) (0,2) (0,3) +(1,0) (1,0) (1,0) (1,0) +(2,0) (2,-1) (2,-2) (2,-3) +(3,0) (3,-2) (3,-4) (3,-6) +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution`](/reference/execution.md) +- [`mdspan`](/reference/mdspan.md) +- [`matrix_rank_1_update`](matrix_rank_1_update.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) +- [LAPACK: ger: general matrix rank-1 update](https://netlib.org/lapack/explore-html/d8/d75/group__ger.html) + From e1b7ee314b72fcb8db7f253dabfb3b063243ecc6 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Tue, 2 Jul 2024 16:27:21 +0900 Subject: [PATCH 1008/3948] =?UTF-8?q?linalg=20:=20=E4=BE=8B=E3=81=AE?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E3=81=A8=E3=83=AA=E3=83=B3=E3=82=AF=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/matrix_rank_1_update.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/reference/linalg/matrix_rank_1_update.md b/reference/linalg/matrix_rank_1_update.md index 9273d75416..72770bced1 100644 --- a/reference/linalg/matrix_rank_1_update.md +++ b/reference/linalg/matrix_rank_1_update.md @@ -70,7 +70,7 @@ $O(\verb|x.extent(0)|\times \verb|y.extent(0)|)$ #include template -void print_mat(const Matrix& v) { +void print_mat(const Matrix& A) { for(int i = 0; i < A.extent(0); ++i) { for(int j = 0; j < A.extent(1) - 1; ++j) { std::cout << A[i, j] << ' '; @@ -109,7 +109,7 @@ int main() std::mdspan x(x_vec.data(), N); std::mdspan y(y_vec.data(), N); - init_mat(A) + init_mat(A); init_vec(x); init_vec(y); @@ -166,6 +166,7 @@ int main() ## 関連項目 - [`execution`](/reference/execution.md) - [`mdspan`](/reference/mdspan.md) +- [`matrix_rank_1_update_c`](matrix_rank_1_update_c.md) ## 参照 From 17a5018ace5f594d425561943e3366811868e0ae Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 3 Jul 2024 11:25:48 +0900 Subject: [PATCH 1009/3948] =?UTF-8?q?C++23=20:=20=5F=5Fcplusplus=E3=81=AE?= =?UTF-8?q?=E5=80=A4=E3=82=92=E8=A8=98=E8=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23.md | 1 + lang/cpp23/predefined_macros.md | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 lang/cpp23/predefined_macros.md diff --git a/lang/cpp23.md b/lang/cpp23.md index cde2d49c15..df7b9f18be 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -105,6 +105,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| +| [更新された定義済みマクロ](cpp23/predefined_macros.md) | 標準規格で定義されたマクロの更新 | | [参照するPOSIX規格を更新](cpp23/update_normative_reference_to_posix.md) | 新しいPOSIX規格の機能を標準C++が参照していたため、参照するPOSIX規格のバージョンを更新 | | [行末スペースを無視するよう規定](cpp23/trimming_whitespaces_before_line_splicing.md) | 行末が「\ 」でおわっていた場合にMSVCは行の継続をしない実装になっていたため動作を共通化するため仕様を規定 | diff --git a/lang/cpp23/predefined_macros.md b/lang/cpp23/predefined_macros.md new file mode 100644 index 0000000000..0233a0e1e5 --- /dev/null +++ b/lang/cpp23/predefined_macros.md @@ -0,0 +1,14 @@ +# 更新された定義済みマクロ +* cpp23[meta cpp] + +## 概要 + +定義済みマクロの値が、以下のように更新された: + +| マクロ名 | 値 | 説明 | +|---------------|-----------|-------------------------| +| `__cplusplus` | `202302L` | C++のバージョン値を表す | + + +## 参照 +- [N4951 Editors’ Report: Programming Languages — C++](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4951.html) From e71dc9165c07afe49a5ff38b1266c1cca73df1ca Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Wed, 3 Jul 2024 16:08:27 +0900 Subject: [PATCH 1010/3948] =?UTF-8?q?linalg=20:=20symmetric=5Fmatrix=5Fran?= =?UTF-8?q?k=5F1=5Fupdate=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 2 +- .../linalg/symmetric_matrix_rank_1_update.md | 246 ++++++++++++++++++ 2 files changed, 247 insertions(+), 1 deletion(-) create mode 100644 reference/linalg/symmetric_matrix_rank_1_update.md diff --git a/reference/linalg.md b/reference/linalg.md index db22cacffa..709f011db1 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -88,7 +88,7 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に | [`triangular_matrix_vector_solve`](linalg/triangular_matrix_vector_solve.md) | xTRSV: 三角行列を係数とする行列方程式を解く (function template) | C++26 | | [`matrix_rank_1_update`](linalg/matrix_rank_1_update.md) | xGER, xGERU: 行列のRank-1更新 (function template) | C++26 | | [`matrix_rank_1_update_c`](linalg/matrix_rank_1_update_c.md) | xGERC: 複素行列のRank-1更新 (function template) | C++26 | -| `symmetric_matrix_rank_1_update` | xSYR: 対称行列のRank-1更新 (function template) | C++26 | +| [`symmetric_matrix_rank_1_update`](linalg/symmetric_matrix_rank_1_update.md) | xSYR: 対称行列のRank-1更新 (function template) | C++26 | | `hermitian_matrix_rank_1_update` | xHER: ハミルトニアン行列のRank-1更新 (function template) | C++26 | | `symmetric_matrix_rank_2_update` | xSYR2: 対称行列のRank-2更新 (function template) | C++26 | | `hermitian_matrix_rank_2_update` | xHER2: ハミルトニアン行列のRank-2更新 (function template) | C++26 | diff --git a/reference/linalg/symmetric_matrix_rank_1_update.md b/reference/linalg/symmetric_matrix_rank_1_update.md new file mode 100644 index 0000000000..848cb42263 --- /dev/null +++ b/reference/linalg/symmetric_matrix_rank_1_update.md @@ -0,0 +1,246 @@ +# symmetric_matrix_rank_1_update + + +* [mathjax enable] +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + + +```cpp +namespace std::linalg { + template + void symmetric_matrix_rank_1_update( + InVec x, + InOutMat A, + Triangle t); // (1) + + template + void symmetric_matrix_rank_1_update( + ExecutionPolicy&& exec, + InVec x, + InOutMat A, + Triangle t); // (2) + + template + void symmetric_matrix_rank_1_update( + Scalar alpha, + InVec x, + InOutMat A, + Triangle t); // (3) + + template + void symmetric_matrix_rank_1_update( + ExecutionPolicy&& exec, + Scalar alpha, + InVec x, + InOutMat A, + Triangle t); // (4) +} +``` + + +## 概要 +対称かつ共役を取らないrank-1 updateを対称行列に行う。 +引数`t`は対称行列の成分が上三角にあるのか、それとも下三角にあるのかを示す。 + +- (1): $A \leftarrow A + xx^T$ +- (2): (1)を指定された実行ポリシーで実行する。 +- (3): $A \leftarrow A + \alpha xx^T$ +- (4): (3)を指定された実行ポリシーで実行する。 + + +## 適格要件 +- `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) +- `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 +- [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) +- [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (つまり`A`の次元と`x`の次元が同じであること) + + +## 事前条件 +- `A.extent(0) == A.extent(1)` +- `A.extent(0) == x.extent(0)` + + +## 効果 +- (1), (2): $A \leftarrow A + xx^T$ +- (3), (4): $A \leftarrow A + \alpha xx^T$ + + +## 戻り値 +なし + + +## 計算量 +$O((\verb|x.extent(0)|)^2)$ + + +## 備考 +(3), (4)は$A \leftarrow A - xx^T$を行うために用意された。 + + +## 例 +**[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** + +```cpp example +#include +#include +#include +#include +#include + +template +void print_mat(const Matrix& A) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = 0; j < i; ++j) { + std::cout << A[j, i] << ' '; + } + for(int j = i; j < A.extent(1) - 1; ++j) { + std::cout << A[i, j] << ' '; + } + std::cout << A[i, A.extent(1) - 1] << '\n'; + } +} + +template +void init_vec(Vector& v) { + for (int i = 0; i < v.extent(0); ++i) { + v[i] = i; + } +} + +template +void init_mat(Matrix& A) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = i; j < A.extent(1); ++j) { + A[i,j] = A.extent(1) * i + j; + } + } +} + +int main() +{ + constexpr size_t N = 4; + + std::vector A_vec(N * N); + std::vector x_vec(N); + std::array y_vec; + + std::mdspan< + double, + std::extents, + std::linalg::layout_blas_packed< + std::linalg::upper_triangle_t, + std::linalg::row_major_t> + > A(A_vec.data()); + std::mdspan x(x_vec.data(), N); + std::mdspan y(y_vec.data(), N); + + init_mat(A); + init_vec(x); + init_vec(y); + + // (1) + std::cout << "(1)\n"; + std::linalg::matrix_rank_1_update( + x, + A, + std::linalg::upper_triangle); + print_mat(A); + + // (2) + init_mat(A); + std::cout << "(2)\n"; + std::linalg::matrix_rank_1_update( + std::execution::par, + x, + A, + std::linalg::upper_triangle); + print_mat(A); + + // (3) + init_mat(A); + std::cout << "(3)\n"; + std::linalg::matrix_rank_1_update( + -1.0, + x, + A, + std::linalg::upper_triangle); + print_mat(A); + + // (4) + init_mat(A); + std::cout << "(4)\n"; + std::linalg::matrix_rank_1_update( + std::execution::par, + -1.0, + x, + A, + std::linalg::upper_triangle); + print_mat(A); + + return 0; +} +``` + + +### 出力 +``` +(1) +0 1 2 3 +1 6 8 10 +2 8 14 17 +3 14 17 24 +(2) +0 1 2 3 +1 6 8 10 +2 8 14 17 +3 14 17 24 +(3) +0 1 2 3 +1 4 4 4 +2 4 6 5 +3 4 5 6 +(4) +0 1 2 3 +1 4 4 4 +2 4 6 5 +3 4 5 6 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution`](/reference/execution.md) +- [`mdspan`](/reference/mdspan.md) +- [`upper_triangle_t`](upper_triangle_t.md) +- [`lower_triangle_t`](lower_triangle_t.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) +- [LAPACK: {he,sy}r: Hermitian/symmetric rank-1 update](https://netlib.org/lapack/explore-html/dc/d82/group__her.html) + From 4e4963e52e6d12cb17e1985368ddbd71ef6f0b54 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 4 Jul 2024 18:10:11 +0900 Subject: [PATCH 1011/3948] =?UTF-8?q?=E5=9B=BD=E9=9A=9B=E6=A8=99=E6=BA=96?= =?UTF-8?q?=E8=A6=8F=E6=A0=BC=20:=20C++23=E3=81=AE=5F=5Fcplusplus=E5=80=A4?= =?UTF-8?q?=E3=82=92=E8=A8=98=E8=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- international-standard.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/international-standard.md b/international-standard.md index ee0609fc90..b6aef0602b 100644 --- a/international-standard.md +++ b/international-standard.md @@ -13,7 +13,7 @@ C++ の標準規格は、他にも各国の規格化団体によって国際標 | 通称†1 | 名称 | 参照する規格案†2 | 規格案・原案 | `__cplusplus` | |:--|:--|:--|:--|:--| | [C++26](lang/cpp26.md) (C++2c) | ISO/IEC 14882:2026 (予定) | N4971([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4971.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/)) | N4971 N4964 N4958 | -- | -| [C++23](lang/cpp23.md) (C++2b) | ISO/IEC 14882:2023 (予定) | N4950([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4950.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4950/)) | N4950 N4944 N4928 N4917 N4910 N4901 N4892 N4885 N4878
N4868 N4861 | -- | +| [C++23](lang/cpp23.md) (C++2b) | ISO/IEC 14882:2023 (予定) | N4950([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4950.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4950/)) | N4950 N4944 N4928 N4917 N4910 N4901 N4892 N4885 N4878
N4868 N4861 | `202302L` | | [C++20](lang/cpp20.md) (C++2a) | ISO/IEC 14882:2020 | N4861†3([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/n4861.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4861/)) | N4860 N4849 N4842 N4835 N4830
N4820 N4810 N4800 N4791 N4788†4
N4778 N4762 N4750 N4741 N4727
N4713 N4700 N4687 | `202002L` | | [C++17](lang/cpp17.md) (C++1z) | ISO/IEC 14882:2017 | N4659([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4659.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4659/)) | N4660 N4659 N4640 N4618 N4606
N4594 N4582 N4567 N4527 N4431
N4296 | `201703L` | | [C++14](lang/cpp14.md) (C++1y) | ISO/IEC 14882:2014 | N4140([PDF](https://github.com/cplusplus/draft/blob/master/papers/n4140.pdf?raw=true)/[HTML](https://timsong-cpp.github.io/cppwp/n4140/)) | N4141 N4140 N3937 N3936 N3797
N3691 N3690 N3485 N3376 N3337 | `201402L` | From dbb77b64298cdef79784e31d44807d058e40d583 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Thu, 4 Jul 2024 18:27:11 +0900 Subject: [PATCH 1012/3948] =?UTF-8?q?linalg=20:=20hermitian=5Fmatrix=5Fran?= =?UTF-8?q?k=5F1=5Fupdate=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 2 +- .../linalg/hermitian_matrix_rank_1_update.md | 247 ++++++++++++++++++ 2 files changed, 248 insertions(+), 1 deletion(-) create mode 100644 reference/linalg/hermitian_matrix_rank_1_update.md diff --git a/reference/linalg.md b/reference/linalg.md index 709f011db1..b2ab5c9e69 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -89,7 +89,7 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に | [`matrix_rank_1_update`](linalg/matrix_rank_1_update.md) | xGER, xGERU: 行列のRank-1更新 (function template) | C++26 | | [`matrix_rank_1_update_c`](linalg/matrix_rank_1_update_c.md) | xGERC: 複素行列のRank-1更新 (function template) | C++26 | | [`symmetric_matrix_rank_1_update`](linalg/symmetric_matrix_rank_1_update.md) | xSYR: 対称行列のRank-1更新 (function template) | C++26 | -| `hermitian_matrix_rank_1_update` | xHER: ハミルトニアン行列のRank-1更新 (function template) | C++26 | +| [`hermitian_matrix_rank_1_update`](linalg/hermitian_matrix_rank_1_update.md) | xHER: ハミルトニアン行列のRank-1更新 (function template) | C++26 | | `symmetric_matrix_rank_2_update` | xSYR2: 対称行列のRank-2更新 (function template) | C++26 | | `hermitian_matrix_rank_2_update` | xHER2: ハミルトニアン行列のRank-2更新 (function template) | C++26 | diff --git a/reference/linalg/hermitian_matrix_rank_1_update.md b/reference/linalg/hermitian_matrix_rank_1_update.md new file mode 100644 index 0000000000..1f46e31526 --- /dev/null +++ b/reference/linalg/hermitian_matrix_rank_1_update.md @@ -0,0 +1,247 @@ +# hermitian_matrix_rank_1_update + + +* [mathjax enable] +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + + +```cpp +namespace std::linalg { + template + void hermitian_matrix_rank_1_update( + InVec x, + InOutMat A, + Triangle t); // (1) + + template + void hermitian_matrix_rank_1_update( + ExecutionPolicy&& exec, + InVec x, + InOutMat A, + Triangle t); // (2) + + template + void hermitian_matrix_rank_1_update( + Scalar alpha, + InVec x, + InOutMat A, + Triangle t); // (3) + + template + void hermitian_matrix_rank_1_update( + ExecutionPolicy&& exec, + Scalar alpha, + InVec x, + InOutMat A, + Triangle t); // (4) +} +``` + + +## 概要 +エルミートな(対称かつ共役を取る)rank-1 updateをエルミート行列に行う。 +引数`t`は対称行列の成分が上三角にあるのか、それとも下三角にあるのかを示す。 + +- (1): $A \leftarrow A + xx^*$ +- (2): (1)を指定された実行ポリシーで実行する。 +- (3): $A \leftarrow A + \alpha xx^*$ +- (4): (3)を指定された実行ポリシーで実行する。 + + +## 適格要件 +- `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) +- `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 +- [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) +- [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (つまり`A`の次元と`x`の次元が同じであること) + + +## 事前条件 +- `A.extent(0) == A.extent(1)` +- `A.extent(0) == x.extent(0)` + + +## 効果 +- (1), (2): $A \leftarrow A + xx^T$ +- (3), (4): $A \leftarrow A + \alpha xx^T$ + + +## 戻り値 +なし + + +## 計算量 +$O((\verb|x.extent(0)|)^2)$ + + +## 備考 +(3), (4)は$A \leftarrow A - xx^T$を行うために用意された。 + + +## 例 +**[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** + +```cpp example +#include +#include +#include +#include +#include + +template +void print_mat(const Matrix& A) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = 0; j < i; ++j) { + std::cout << A[j, i] << ' '; + } + for(int j = i; j < A.extent(1) - 1; ++j) { + std::cout << A[i, j] << ' '; + } + std::cout << A[i, A.extent(1) - 1] << '\n'; + } +} + +template +void init_vec(Vector& v) { + for (int i = 0; i < v.extent(0); ++i) { + v[i] = std::complex(0, i); + } +} + +template +void init_mat(Matrix& A) { + for(int i = 0; i < A.extent(0); ++i) { + A[i,j] = std::complex(i, 0); + for(int j = i + 1; j < A.extent(1); ++j) { + A[i,j] = std::complex(i, j); + } + } +} + +int main() +{ + constexpr size_t N = 4; + + std::vector> A_vec(N * N); + std::vector> x_vec(N); + std::array, N> y_vec; + + std::mdspan< + std::complex, + std::extents, + std::linalg::layout_blas_packed< + std::linalg::upper_triangle_t, + std::linalg::row_major_t> + > A(A_vec.data()); + std::mdspan x(x_vec.data(), N); + std::mdspan y(y_vec.data(), N); + + init_mat(A); + init_vec(x); + init_vec(y); + + // (1) + std::cout << "(1)\n"; + std::linalg::matrix_rank_1_update( + x, + A, + std::linalg::upper_triangle); + print_mat(A); + + // (2) + init_mat(A); + std::cout << "(2)\n"; + std::linalg::hermitian_matrix_rank_1_update( + std::execution::par, + x, + A, + std::linalg::upper_triangle); + print_mat(A); + + // (3) + init_mat(A); + std::cout << "(3)\n"; + std::linalg::hermitian_matrix_rank_1_update( + -1.0, + x, + A, + std::linalg::upper_triangle); + print_mat(A); + + // (4) + init_mat(A); + std::cout << "(4)\n"; + std::linalg::hermitian_matrix_rank_1_update( + std::execution::par, + -1.0, + x, + A, + std::linalg::upper_triangle); + print_mat(A); + + return 0; +} +``` + + +### 出力 +``` +(1) +(0,0) (1,0) (2,0) (3,0) +(1,0) (2,0) (3,2) (4,3) +(2,0) (3,-2) (6,0) (8,3) +(3,0) (4,-3) (8,-3) (12,0) +(2) +(0,0) (1,0) (2,0) (3,0) +(1,0) (2,0) (3,2) (4,3) +(2,0) (3,-2) (6,0) (8,3) +(3,0) (4,-3) (8,-3) (12,0) +(3) +(0,0) (1,0) (2,0) (3,0) +(1,0) (0,0) (-1,2) (-2,3) +(2,0) (-1,-2) (-2,0) (-4,3) +(3,0) (-2,-3) (-4,-3) (-6,0) +(4) +(0,0) (1,0) (2,0) (3,0) +(1,0) (0,0) (-1,2) (-2,3) +(2,0) (-1,-2) (-2,0) (-4,3) +(3,0) (-2,-3) (-4,-3) (-6,0) +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution`](/reference/execution.md) +- [`mdspan`](/reference/mdspan.md) +- [`upper_triangle_t`](upper_triangle_t.md) +- [`lower_triangle_t`](lower_triangle_t.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) +- [LAPACK: {he,sy}r: Hermitian/symmetric rank-1 update](https://netlib.org/lapack/explore-html/dc/d82/group__her.html) + From 5125497c9785c05d9083241fda5ca7561868bb94 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Thu, 4 Jul 2024 18:27:59 +0900 Subject: [PATCH 1013/3948] =?UTF-8?q?linalg=20:=20=E4=BE=8B=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/symmetric_matrix_rank_1_update.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/linalg/symmetric_matrix_rank_1_update.md b/reference/linalg/symmetric_matrix_rank_1_update.md index 848cb42263..276943aa81 100644 --- a/reference/linalg/symmetric_matrix_rank_1_update.md +++ b/reference/linalg/symmetric_matrix_rank_1_update.md @@ -155,7 +155,7 @@ int main() // (1) std::cout << "(1)\n"; - std::linalg::matrix_rank_1_update( + std::linalg::symmetric_matrix_rank_1_update( x, A, std::linalg::upper_triangle); @@ -164,7 +164,7 @@ int main() // (2) init_mat(A); std::cout << "(2)\n"; - std::linalg::matrix_rank_1_update( + std::linalg::symmetric_matrix_rank_1_update( std::execution::par, x, A, @@ -174,7 +174,7 @@ int main() // (3) init_mat(A); std::cout << "(3)\n"; - std::linalg::matrix_rank_1_update( + std::linalg::symmetric_matrix_rank_1_update( -1.0, x, A, @@ -184,7 +184,7 @@ int main() // (4) init_mat(A); std::cout << "(4)\n"; - std::linalg::matrix_rank_1_update( + std::linalg::symmetric_matrix_rank_1_update( std::execution::par, -1.0, x, From 5726d3751c34e141fd4eb7361c33f2e5494037e2 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Fri, 5 Jul 2024 17:57:02 +0900 Subject: [PATCH 1014/3948] =?UTF-8?q?linalg=20:=20symmetric=5Fmatrix=5Fran?= =?UTF-8?q?k=5F2=5Fupdate=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 2 +- .../linalg/symmetric_matrix_rank_2_update.md | 189 ++++++++++++++++++ 2 files changed, 190 insertions(+), 1 deletion(-) create mode 100644 reference/linalg/symmetric_matrix_rank_2_update.md diff --git a/reference/linalg.md b/reference/linalg.md index b2ab5c9e69..dbe3afaca2 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -90,7 +90,7 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に | [`matrix_rank_1_update_c`](linalg/matrix_rank_1_update_c.md) | xGERC: 複素行列のRank-1更新 (function template) | C++26 | | [`symmetric_matrix_rank_1_update`](linalg/symmetric_matrix_rank_1_update.md) | xSYR: 対称行列のRank-1更新 (function template) | C++26 | | [`hermitian_matrix_rank_1_update`](linalg/hermitian_matrix_rank_1_update.md) | xHER: ハミルトニアン行列のRank-1更新 (function template) | C++26 | -| `symmetric_matrix_rank_2_update` | xSYR2: 対称行列のRank-2更新 (function template) | C++26 | +| [`symmetric_matrix_rank_2_update`](linalg/symmetric_matrix_rank_2_update.md) | xSYR2: 対称行列のRank-2更新 (function template) | C++26 | | `hermitian_matrix_rank_2_update` | xHER2: ハミルトニアン行列のRank-2更新 (function template) | C++26 | diff --git a/reference/linalg/symmetric_matrix_rank_2_update.md b/reference/linalg/symmetric_matrix_rank_2_update.md new file mode 100644 index 0000000000..32255bfd56 --- /dev/null +++ b/reference/linalg/symmetric_matrix_rank_2_update.md @@ -0,0 +1,189 @@ +# symmetric_matrix_rank_2_update + + +* [mathjax enable] +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + + +```cpp +namespace std::linalg { + template + void symmetric_matrix_rank_2_update( + InVec1 x, + InVec2 y, + InOutMat A, + Triangle t); // (1) + + template + void symmetric_matrix_rank_2_update( + ExecutionPolicy&& exec, + InVec1 x, + InVec2 y, + InOutMat A, + Triangle t); // (2) +} +``` + + +## 概要 +対称かつ共役を取らないrank-2 updateを対称行列に行う。 +引数`t`は対称行列の成分が上三角にあるのか、それとも下三角にあるのかを示す。 + +- (1): $A \leftarrow A + xy^T + yx^T$ +- (2): (1)を指定された実行ポリシーで実行する。 + + +## 適格要件 +- `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) +- `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 +- [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` + + +## 事前条件 +- `A.extent(0) == A.extent(1)` +- [`multipliable`](multipliable.md)`(A, x, y) == true` + + +## 効果 +$A \leftarrow A + xx^T$ + + +## 戻り値 +なし + + +## 計算量 +$O(\verb|x.extent(0)| \times \verb|y.extent(0)|)$ + + +## 例 +**[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** + +```cpp example +#include +#include +#include +#include +#include + +template +void print_mat(const Matrix& A) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = 0; j < i; ++j) { + std::cout << A[j, i] << ' '; + } + for(int j = i; j < A.extent(1) - 1; ++j) { + std::cout << A[i, j] << ' '; + } + std::cout << A[i, A.extent(1) - 1] << '\n'; + } +} + +template +void init_mat(Matrix& A) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = i; j < A.extent(1); ++j) { + A[i,j] = A.extent(1) * i + j; + } + } +} + +int main() +{ + constexpr size_t N = 4; + + std::vector A_vec(N * N); + std::vector x_vec(N); + std::array y_vec; + + std::mdspan< + double, + std::extents, + std::linalg::layout_blas_packed< + std::linalg::upper_triangle_t, + std::linalg::row_major_t> + > A(A_vec.data()); + std::mdspan x(x_vec.data(), N); + std::mdspan y(y_vec.data(), N); + + init_mat(A); + + for (int i = 0; i < x.extent(0); ++i) { + x[i] = i; + } + for (int i = 0; i < y.extent(0); ++i) { + y[i] = i + y.extent(0); + } + + // (1) + std::cout << "(1)\n"; + std::linalg::symmetric_matrix_rank_1_update( + x, + y, + A, + std::linalg::upper_triangle); + print_mat(A); + + // (2) + init_mat(A); + std::cout << "(2)\n"; + std::linalg::symmetric_matrix_rank_1_update( + std::execution::par, + x, + y, + A, + std::linalg::upper_triangle); + print_mat(A); + + return 0; +} +``` + + +### 出力 +``` +(1) +0 5 10 15 +5 15 22 29 +10 22 34 43 +15 29 43 57 +(2) +0 5 10 15 +5 15 22 29 +10 22 34 43 +15 29 43 57 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution`](/reference/execution.md) +- [`mdspan`](/reference/mdspan.md) +- [`upper_triangle_t`](upper_triangle_t.md) +- [`lower_triangle_t`](lower_triangle_t.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) +- [LAPACK: {he,sy}r: Hermitian/symmetric rank-2 update](https://netlib.org/lapack/explore-html/dd/de5/group__her2.html) + From 257b66dfc134e796a279f6a5a124d80db0eca7cd Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Sat, 6 Jul 2024 14:57:34 +0900 Subject: [PATCH 1015/3948] =?UTF-8?q?linalg=20:=20hermitian=5Fmatrix=5Fran?= =?UTF-8?q?k=5F2=5Fupdate=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 2 +- .../linalg/hermitian_matrix_rank_2_update.md | 191 ++++++++++++++++++ 2 files changed, 192 insertions(+), 1 deletion(-) create mode 100644 reference/linalg/hermitian_matrix_rank_2_update.md diff --git a/reference/linalg.md b/reference/linalg.md index dbe3afaca2..1b2276d895 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -91,7 +91,7 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に | [`symmetric_matrix_rank_1_update`](linalg/symmetric_matrix_rank_1_update.md) | xSYR: 対称行列のRank-1更新 (function template) | C++26 | | [`hermitian_matrix_rank_1_update`](linalg/hermitian_matrix_rank_1_update.md) | xHER: ハミルトニアン行列のRank-1更新 (function template) | C++26 | | [`symmetric_matrix_rank_2_update`](linalg/symmetric_matrix_rank_2_update.md) | xSYR2: 対称行列のRank-2更新 (function template) | C++26 | -| `hermitian_matrix_rank_2_update` | xHER2: ハミルトニアン行列のRank-2更新 (function template) | C++26 | +| [`hermitian_matrix_rank_2_update`](linalg/hermitian_matrix_rank_2_update.md) | xHER2: ハミルトニアン行列のRank-2更新 (function template) | C++26 | ## BLAS 3アルゴリズム diff --git a/reference/linalg/hermitian_matrix_rank_2_update.md b/reference/linalg/hermitian_matrix_rank_2_update.md new file mode 100644 index 0000000000..620e977c1c --- /dev/null +++ b/reference/linalg/hermitian_matrix_rank_2_update.md @@ -0,0 +1,191 @@ +# hermitian_matrix_rank_2_update + + +* [mathjax enable] +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + + +```cpp +namespace std::linalg { + template + void hermitian_matrix_rank_2_update( + InVec1 x, + InVec2 y, + InOutMat A, + Triangle t); // (1) + + template + void hermitian_matrix_rank_2_update( + ExecutionPolicy&& exec, + InVec1 x, + InVec2 y, + InOutMat A, + Triangle t); // (2) +} +``` + + +## 概要 +エルミートな(対称かつ共役を取る)rank-2 updateをエルミート行列に行う。 +引数`t`は対称行列の成分が上三角にあるのか、それとも下三角にあるのかを示す。 + +- (1): $A \leftarrow A + xy^* + yx^*$ +- (2): (1)を指定された実行ポリシーで実行する。 + + +## 適格要件 +- `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) +- `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 +- [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` + + +## 事前条件 +- `A.extent(0) == A.extent(1)` +- [`multipliable`](multipliable.md)`(A, x, y) == true` + + +## 効果 +- (1), (2): $A \leftarrow A + xy^* + yx^*$ + + +## 戻り値 +なし + + +## 計算量 +$O(\verb|x.extent(0)| \times \verb|y.extent(0)|)$ + + +## 例 +**[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** + +```cpp example +#include +#include +#include +#include +#include + +template +void print_mat(const Matrix& A) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = 0; j < i; ++j) { + std::cout << A[j, i] << ' '; + } + for(int j = i; j < A.extent(1) - 1; ++j) { + std::cout << A[i, j] << ' '; + } + std::cout << A[i, A.extent(1) - 1] << '\n'; + } +} + +template +void init_mat(Matrix& A) { + for(int i = 0; i < A.extent(0); ++i) { + A[i,j] = std::complex(i, 0); + for(int j = i + 1; j < A.extent(1); ++j) { + A[i,j] = std::complex(i, j); + } + } +} + +int main() +{ + constexpr size_t N = 4; + + std::vector> A_vec(N * N); + std::vector> x_vec(N); + std::array, N> y_vec; + + std::mdspan< + std::complex, + std::extents, + std::linalg::layout_blas_packed< + std::linalg::upper_triangle_t, + std::linalg::row_major_t> + > A(A_vec.data()); + std::mdspan x(x_vec.data(), N); + std::mdspan y(y_vec.data(), N); + + init_mat(A); + + for (int i = 0; i < x.extent(0); ++i) { + x[i] = std::complex(0, i); + } + + for (int i = 0; i < y.extent(0); ++i) { + y[i] = std::complex(0, i + y.extent(0)); + } + + + // (1) + std::cout << "(1)\n"; + std::linalg::hermitian_matrix_rank_2_update( + x, + y, + A, + std::linalg::upper_triangle); + print_mat(A); + + // (2) + init_mat(A); + std::cout << "(2)\n"; + std::linalg::hermitian_matrix_rank_2_update( + std::execution::par, + x, + y, + A, + std::linalg::upper_triangle); + print_mat(A); + + return 0; +} +``` + + +### 出力 +``` +(1) +(0,0) (4,1) (8,2) (12,3) +(4,1) (11,0) (17,2) (23,3) +(8,2) (17,2) (26,0) (34,3) +(12,3) (23,3) (34,3) (45,0) +(2) +(0,0) (4,1) (8,2) (12,3) +(4,1) (11,0) (17,2) (23,3) +(8,2) (17,2) (26,0) (34,3) +(12,3) (23,3) (34,3) (45,0) +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution`](/reference/execution.md) +- [`mdspan`](/reference/mdspan.md) +- [`upper_triangle_t`](upper_triangle_t.md) +- [`lower_triangle_t`](lower_triangle_t.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) +- [LAPACK: {he,sy}r: Hermitian/symmetric rank-2 update](https://netlib.org/lapack/explore-html/dd/de5/group__her2.html) From 8efd3c9bcea824575b6ea54d2a8976360205dd84 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Sat, 6 Jul 2024 14:58:05 +0900 Subject: [PATCH 1016/3948] =?UTF-8?q?linalg=20:=20=E4=BE=8B=E3=81=AE?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/hermitian_matrix_rank_1_update.md | 5 +---- reference/linalg/symmetric_matrix_rank_1_update.md | 3 --- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/reference/linalg/hermitian_matrix_rank_1_update.md b/reference/linalg/hermitian_matrix_rank_1_update.md index 1f46e31526..b1df1f3c1c 100644 --- a/reference/linalg/hermitian_matrix_rank_1_update.md +++ b/reference/linalg/hermitian_matrix_rank_1_update.md @@ -138,7 +138,6 @@ int main() std::vector> A_vec(N * N); std::vector> x_vec(N); - std::array, N> y_vec; std::mdspan< std::complex, @@ -148,15 +147,13 @@ int main() std::linalg::row_major_t> > A(A_vec.data()); std::mdspan x(x_vec.data(), N); - std::mdspan y(y_vec.data(), N); init_mat(A); init_vec(x); - init_vec(y); // (1) std::cout << "(1)\n"; - std::linalg::matrix_rank_1_update( + std::linalg::hermitian_matrix_rank_1_update( x, A, std::linalg::upper_triangle); diff --git a/reference/linalg/symmetric_matrix_rank_1_update.md b/reference/linalg/symmetric_matrix_rank_1_update.md index 276943aa81..52cc757f23 100644 --- a/reference/linalg/symmetric_matrix_rank_1_update.md +++ b/reference/linalg/symmetric_matrix_rank_1_update.md @@ -137,7 +137,6 @@ int main() std::vector A_vec(N * N); std::vector x_vec(N); - std::array y_vec; std::mdspan< double, @@ -147,11 +146,9 @@ int main() std::linalg::row_major_t> > A(A_vec.data()); std::mdspan x(x_vec.data(), N); - std::mdspan y(y_vec.data(), N); init_mat(A); init_vec(x); - init_vec(y); // (1) std::cout << "(1)\n"; From 978a5209978260fd9322904a799ad61d838e015a Mon Sep 17 00:00:00 2001 From: suomesta Date: Sat, 6 Jul 2024 17:13:49 +0900 Subject: [PATCH 1017/3948] fix some typo --- reference/algorithm/ranges_ends_with.md | 4 ++-- reference/algorithm/ranges_shift_left.md | 4 ++-- reference/algorithm/ranges_shift_right.md | 4 ++-- reference/algorithm/ranges_starts_with.md | 4 ++-- reference/optional/optional/op_destructor.md | 24 ++++++++++++-------- reference/tuple/tuple_cat.md | 2 +- 6 files changed, 24 insertions(+), 18 deletions(-) diff --git a/reference/algorithm/ranges_ends_with.md b/reference/algorithm/ranges_ends_with.md index 87d51752d7..4ec8b780de 100644 --- a/reference/algorithm/ranges_ends_with.md +++ b/reference/algorithm/ranges_ends_with.md @@ -23,7 +23,7 @@ namespace std::ranges { S2 last2, Pred pred = {}, Proj1 proj1 = {}, - Proj2 proj2 = {}); // (1) C++20 + Proj2 proj2 = {}); // (1) C++23 template shift_left(I first, S last, - iter_difference_t n); // (1) C++20 + iter_difference_t n); // (1) C++23 template requires permutable> constexpr borrowed_subrange_t shift_left(R&& r, - range_difference_t n); // (2) C++20 + range_difference_t n); // (2) C++23 } ``` * permutable[link /reference/iterator/permutable.md] diff --git a/reference/algorithm/ranges_shift_right.md b/reference/algorithm/ranges_shift_right.md index 8ee0dabda0..1a59d172c8 100644 --- a/reference/algorithm/ranges_shift_right.md +++ b/reference/algorithm/ranges_shift_right.md @@ -11,13 +11,13 @@ namespace std::ranges { constexpr subrange shift_right(I first, S last, - iter_difference_t n); // (1) C++20 + iter_difference_t n); // (1) C++23 template requires permutable> constexpr borrowed_subrange_t shift_right(R&& r, - range_difference_t n); // (2) C++20 + range_difference_t n); // (2) C++23 } ``` * permutable[link /reference/iterator/permutable.md] diff --git a/reference/algorithm/ranges_starts_with.md b/reference/algorithm/ranges_starts_with.md index 42d0028219..77cb580de3 100644 --- a/reference/algorithm/ranges_starts_with.md +++ b/reference/algorithm/ranges_starts_with.md @@ -21,7 +21,7 @@ namespace std::ranges { S2 last2, Pred pred = {}, Proj1 proj1 = {}, - Proj2 proj2 = {}); // (1) C++20 + Proj2 proj2 = {}); // (1) C++23 template a; - std::optional b; - std::optional c; - - std::optional opt_int; -} // Aのデストラクタが呼ばれる - // Bのデストラクタは呼ばれない - // Cのデストラクタは呼ばれる - // opt_intのデストラクタは呼ばれない + { + std::optional a = std::make_optional(); + std::optional b = std::make_optional(); + std::optional c = std::make_optional(); + + std::optional opt_int = 1; + } // Aのデストラクタが呼ばれる + // Bのデストラクタは呼ばれない + // Cのデストラクタは呼ばれる + // opt_intのデストラクタは呼ばれない + + { + std::optional a_null; + } // Aのデストラクタは呼ばれない +} ``` ### 出力 diff --git a/reference/tuple/tuple_cat.md b/reference/tuple/tuple_cat.md index f446c9d230..f4fa33b6d9 100644 --- a/reference/tuple/tuple_cat.md +++ b/reference/tuple/tuple_cat.md @@ -44,7 +44,7 @@ namespace std { ## 戻り値 -`Tuples...`の全ての`tuple`型の要素型全てを取り出し、`std::`[`forward`](/reference/utility/forward.md)`(x)`して構築される1つの[`tuple`](tuple.md)`オブジェクト。 +`Tuples...`の全ての`tuple`型の要素型全てを取り出し、`std::`[`forward`](/reference/utility/forward.md)`(x)`して構築される1つの[`tuple`](tuple.md)オブジェクト。 ## 備考 From d9fb8cf0f3d03c4d14381004a52e693a77c012a6 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sat, 6 Jul 2024 17:19:12 +0900 Subject: [PATCH 1018/3948] update link to C++26 working draft --- international-standard.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/international-standard.md b/international-standard.md index b6aef0602b..30247de25d 100644 --- a/international-standard.md +++ b/international-standard.md @@ -12,7 +12,7 @@ C++ の標準規格は、他にも各国の規格化団体によって国際標 | 通称†1
| 名称 | 参照する規格案†2 | 規格案・原案 | `__cplusplus` | |:--|:--|:--|:--|:--| -| [C++26](lang/cpp26.md) (C++2c) | ISO/IEC 14882:2026 (予定) | N4971([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4971.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/)) | N4971 N4964 N4958 | -- | +| [C++26](lang/cpp26.md) (C++2c) | ISO/IEC 14882:2026 (予定) | N4981([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/n4981.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/)) | N4981 N4971 N4964 N4958 | -- | | [C++23](lang/cpp23.md) (C++2b) | ISO/IEC 14882:2023 (予定) | N4950([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4950.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4950/)) | N4950 N4944 N4928 N4917 N4910 N4901 N4892 N4885 N4878
N4868 N4861 | `202302L` | | [C++20](lang/cpp20.md) (C++2a) | ISO/IEC 14882:2020 | N4861†3([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/n4861.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4861/)) | N4860 N4849 N4842 N4835 N4830
N4820 N4810 N4800 N4791 N4788†4
N4778 N4762 N4750 N4741 N4727
N4713 N4700 N4687 | `202002L` | | [C++17](lang/cpp17.md) (C++1z) | ISO/IEC 14882:2017 | N4659([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4659.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4659/)) | N4660 N4659 N4640 N4618 N4606
N4594 N4582 N4567 N4527 N4431
N4296 | `201703L` | From 8583508d15a8d4541f71f21a37a60ac44c143829 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sun, 7 Jul 2024 10:39:14 +0900 Subject: [PATCH 1019/3948] add pages ranges_find_last(s) to algorithm --- lang/cpp23.md | 6 +- reference/algorithm.md | 3 + reference/algorithm/ranges_find_last.md | 91 +++++++++++++++++++ reference/algorithm/ranges_find_last_if.md | 88 ++++++++++++++++++ .../algorithm/ranges_find_last_if_not.md | 88 ++++++++++++++++++ 5 files changed, 273 insertions(+), 3 deletions(-) create mode 100644 reference/algorithm/ranges_find_last.md create mode 100644 reference/algorithm/ranges_find_last_if.md create mode 100644 reference/algorithm/ranges_find_last_if_not.md diff --git a/lang/cpp23.md b/lang/cpp23.md index df7b9f18be..e25aa698e6 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -156,9 +156,9 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 - [``](/reference/algorithm.md)に、範囲の先頭が指定した範囲と合致するかを判定する[`std::starts_with()`](/reference/algorithm/ranges_starts_with.md)、範囲の末尾が指定した範囲と合致するかを判定する[`std::ends_with()`](/reference/algorithm/ranges_ends_with.md)を追加 - [``](/reference/algorithm.md)に、要素を左シフトさせるRangeアルゴリズム[`std::ranges::shift_left()`](/reference/algorithm/ranges_shift_left.md)、要素を右シフトさせるRangeアルゴリズム[`std::ranges::shift_right()`](/reference/algorithm/ranges_shift_right.md)を追加 - [``](/reference/algorithm.md)に、範囲の末尾から要素を検索する以下のアルゴリズムを追加: - - [`std::ranges::find_last()`](/reference/algorithm/ranges_find_last.md.nolink) - - [`std::ranges::find_last_if()`](/reference/algorithm/find_last_if.md.nolink) - - [`std::ranges::find_last_if_not()`](/reference/algorithm/find_last_if_not.md.nolink) + - [`std::ranges::find_last()`](/reference/algorithm/ranges_find_last.md) + - [`std::ranges::find_last_if()`](/reference/algorithm/find_last_if.md) + - [`std::ranges::find_last_if_not()`](/reference/algorithm/find_last_if_not.md) - [``](/reference/algorithm.md)に、範囲に特定の値が含まれているかを判定する[`std::ranges::contains()`](/reference/algorithm/ranges_contains.md)、[`std::ranges::contains_subrange`](/reference/algorithm/ranges_contains_subrange.md)を追加 - [``](/reference/algorithm.md)に、数値に限定しない汎用的な畳み込みアルゴリズムとして、以下を追加: - [`std::ranges::fold_left()`](/reference/algorithm/ranges_fold_left.md) diff --git a/reference/algorithm.md b/reference/algorithm.md index 24441a342b..34fe94c3f4 100644 --- a/reference/algorithm.md +++ b/reference/algorithm.md @@ -149,6 +149,9 @@ ranges::sort(pv, {}, &Person::name); | [`ranges::find`](algorithm/ranges_find.md) | 指定された値を検索する | C++20 | | [`ranges::find_if`](algorithm/ranges_find_if.md) | 条件を満たす最初の要素を検索する | C++20 | | [`ranges::find_if_not`](algorithm/ranges_find_if_not.md) | 条件を満たしていない最初の要素を検索する | C++20 | +| [`ranges::find_last`](algorithm/ranges_find_last.md) | 指定された値を末尾から検索する | C++23 | +| [`ranges::find_last_if`](algorithm/ranges_find_last_if.md) | 条件を満たす最後の要素を検索する | C++23 | +| [`ranges::find_last_if_not`](algorithm/ranges_find_last_if_not.md) | 条件を満たしていない最後の要素を検索する | C++23 | | [`ranges::find_end`](algorithm/ranges_find_end.md) | 指定された最後のサブシーケンスを検索する | C++20 | | [`ranges::find_first_of`](algorithm/ranges_find_first_of.md) | ある集合の1つとマッチする最初の要素を検索する | C++20 | | [`ranges::adjacent_find`](algorithm/ranges_adjacent_find.md) | 隣接する要素で条件を満たしている最初の要素を検索する | C++20 | diff --git a/reference/algorithm/ranges_find_last.md b/reference/algorithm/ranges_find_last.md new file mode 100644 index 0000000000..b0ef64abcb --- /dev/null +++ b/reference/algorithm/ranges_find_last.md @@ -0,0 +1,91 @@ +# find_last +* algorithm[meta header] +* std::ranges[meta namespace] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template S, + class T, + class Proj = identity> + requires indirect_binary_predicate, const T*> + constexpr ranges::subrange + find_last(I first, + S last, + const T& value, + Proj proj = {}); // (1) C++23 + + template + requires indirect_binary_predicate, Proj>, const T*> + constexpr ranges::borrowed_subrange_t + find_last(R&& r, + const T& value, + Proj proj = {}); // (2) C++23 +} +``` +* forward_iterator[link /reference/iterator/forward_iterator.md] +* sentinel_for[link /reference/iterator/sentinel_for.md] +* borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* iterator_t[link /reference/ranges/iterator_t.md] +* identity[link /reference/functional/identity.md] +* indirect_binary_predicate[link /reference/iterator/indirect_binary_predicate.md] +* ranges::equal_to[link /reference/functional/ranges_equal_to.md] +* forward_range[link /reference/ranges/forward_range.md] +* projected[link /reference/iterator/projected.md] + +## 概要 +指定された値を末尾から検索する。 + +- (1): イテレータ範囲を指定する +- (2): Rangeを直接指定する + + +## 戻り値 +`[first,last)` あるいは `r` 内のイテレータ i について、[`invoke`](/reference/functional/invoke.md)`(proj, *i) == value` であるような最後のイテレータ `i` を `ranges::subrange{i, last}` として返す。そのようなイテレータが見つからなかった場合は `ranges::subrange{last, last}` を返す。 + +## 計算量 +最大で `last - first` 回比較を行う + + +## 例 +```cpp example +#include +#include +#include + +int main() { + constexpr std::array v = { 3, 1, 4, 1, 5 }; + const auto result = std::ranges::find_last(v, 1); + if (result.begin() == v.end()) { + std::cout << "not found" << std::endl; + } else { + std::cout << "found: " << *result.begin() << std::endl; + std::cout << " pos: " << std::distance(v.begin(), result.begin()) << std::endl; + } +} +``` +* std::ranges::find_last[color ff0000] + +### 出力 +``` +found: 1 + pos: 3 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.2 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P1223R5 find_last](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1223r5.pdf) diff --git a/reference/algorithm/ranges_find_last_if.md b/reference/algorithm/ranges_find_last_if.md new file mode 100644 index 0000000000..dd79e70f8a --- /dev/null +++ b/reference/algorithm/ranges_find_last_if.md @@ -0,0 +1,88 @@ +# find_last_if +* algorithm[meta header] +* std::ranges[meta namespace] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template S, + class Proj = identity, + indirect_unary_predicate> Pred> + constexpr ranges::subrange + find_last_if(I first, + S last, + Pred pred, + Proj proj = {}); // (1) C++23 + + template , Proj>> Pred> + constexpr ranges::borrowed_subrange_t + find_last_if(R&& r, + Pred pred, + Proj proj = {}); // (2) C++23 +} +``` +* forward_iterator[link /reference/iterator/forward_iterator.md] +* sentinel_for[link /reference/iterator/sentinel_for.md] +* borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* iterator_t[link /reference/ranges/iterator_t.md] +* identity[link /reference/functional/identity.md] +* indirect_unary_predicate[link /reference/iterator/indirect_unary_predicate.md] +* forward_range[link /reference/ranges/forward_range.md] +* projected[link /reference/iterator/projected.md] + +## 概要 +範囲の中から、指定された条件を満たす最後の要素を検索する。 + +* (1): イテレータ範囲を指定する +* (2): Rangeを直接指定する + + +## 戻り値 +`[first,last)` あるいは `r` 内のイテレータ `i` について、[`invoke`](/reference/functional/invoke.md)`(pred, `[`invoke`](/reference/functional/invoke.md)`(proj, *i)) != false` である最後のイテレータ `i` を `ranges::subrange{i, last}` として返す。そのようなイテレータが見つからなかった場合は `ranges::subrange{last, last}` を返す。 + + +## 計算量 +最大で `last - first` 回述語による比較を行う + + +## 例 +```cpp example +#include +#include +#include + +int main() { + constexpr std::array v = { 3, 1, 4, 1, 5 }; + const auto result = std::ranges::find_last_if(v, [](int x) { return x == 1; }); + if (result.begin() == v.end()) { + std::cout << "not found" << std::endl; + } else { + std::cout << "found: " << *result.begin() << std::endl; + std::cout << " pos: " << std::distance(v.begin(), result.begin()) << std::endl; + } +} +``` +* std::ranges::find_last_if[color ff0000] + +### 出力 +``` +found: 1 + pos: 3 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.2 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P1223R5 find_last](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1223r5.pdf) diff --git a/reference/algorithm/ranges_find_last_if_not.md b/reference/algorithm/ranges_find_last_if_not.md new file mode 100644 index 0000000000..234cd1fbcc --- /dev/null +++ b/reference/algorithm/ranges_find_last_if_not.md @@ -0,0 +1,88 @@ +# find_last_if_not +* algorithm[meta header] +* std::ranges[meta namespace] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template S, + class Proj = identity, + indirect_unary_predicate> Pred> + constexpr ranges::subrange + find_last_if_not(I first, + S last, + Pred pred, + Proj proj = {}); // (1) C++23 + + template , Proj>> Pred> + constexpr ranges::borrowed_subrange_t + find_last_if_not(R&& r, + Pred pred, + Proj proj = {}); // (2) C++23 +} +``` +* forward_iterator[link /reference/iterator/forward_iterator.md] +* sentinel_for[link /reference/iterator/sentinel_for.md] +* borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* iterator_t[link /reference/ranges/iterator_t.md] +* identity[link /reference/functional/identity.md] +* indirect_unary_predicate[link /reference/iterator/indirect_unary_predicate.md] +* forward_range[link /reference/ranges/forward_range.md] +* projected[link /reference/iterator/projected.md] + +## 概要 +範囲の中から、指定された条件を満たさない最後の要素を検索する。 + +- (1): イテレータ範囲を指定する +- (2): Rangeを直接指定する + + +## 戻り値 +`[first,last)` あるいは `r` 内のイテレータ `i` について、[`invoke`](/reference/functional/invoke.md)`(pred, `[`invoke`](/reference/functional/invoke.md)`(proj, *i)) == false` である最後のイテレータ `i` を `ranges::subrange{i, last}` として返す。そのようなイテレータが見つからなかった場合は `ranges::subrange{last, last}` を返す。 + + +## 計算量 +最大で `last - first` 回述語による比較を行う + + +## 例 +```cpp example +#include +#include +#include + +int main() { + constexpr std::array v = { 3, 1, 4, 1, 5 }; + const auto result = std::ranges::find_last_if_not(v, [](int x) { return x != 1; }); + if (result.begin() == v.end()) { + std::cout << "not found" << std::endl; + } else { + std::cout << "found: " << *result.begin() << std::endl; + std::cout << " pos: " << std::distance(v.begin(), result.begin()) << std::endl; + } +} +``` +* std::ranges::find_last_if_not[color ff0000] + +### 出力 +``` +found: 1 + pos: 3 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.2 +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P1223R5 find_last](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1223r5.pdf) From 3f17545b1923de2d05bd119e3a93f26511c8024d Mon Sep 17 00:00:00 2001 From: suomesta Date: Sun, 7 Jul 2024 10:48:19 +0900 Subject: [PATCH 1020/3948] fix wrong link --- lang/cpp23.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/cpp23.md b/lang/cpp23.md index e25aa698e6..9da6aea8ef 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -157,8 +157,8 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 - [``](/reference/algorithm.md)に、要素を左シフトさせるRangeアルゴリズム[`std::ranges::shift_left()`](/reference/algorithm/ranges_shift_left.md)、要素を右シフトさせるRangeアルゴリズム[`std::ranges::shift_right()`](/reference/algorithm/ranges_shift_right.md)を追加 - [``](/reference/algorithm.md)に、範囲の末尾から要素を検索する以下のアルゴリズムを追加: - [`std::ranges::find_last()`](/reference/algorithm/ranges_find_last.md) - - [`std::ranges::find_last_if()`](/reference/algorithm/find_last_if.md) - - [`std::ranges::find_last_if_not()`](/reference/algorithm/find_last_if_not.md) + - [`std::ranges::find_last_if()`](/reference/algorithm/ranges_find_last_if.md) + - [`std::ranges::find_last_if_not()`](/reference/algorithm/ranges_find_last_if_not.md) - [``](/reference/algorithm.md)に、範囲に特定の値が含まれているかを判定する[`std::ranges::contains()`](/reference/algorithm/ranges_contains.md)、[`std::ranges::contains_subrange`](/reference/algorithm/ranges_contains_subrange.md)を追加 - [``](/reference/algorithm.md)に、数値に限定しない汎用的な畳み込みアルゴリズムとして、以下を追加: - [`std::ranges::fold_left()`](/reference/algorithm/ranges_fold_left.md) From 6df30cbbc73f73123a127cb5a759f831e621f9fc Mon Sep 17 00:00:00 2001 From: suomesta Date: Sun, 7 Jul 2024 15:36:42 +0900 Subject: [PATCH 1021/3948] fix sample to run --- reference/algorithm/ranges_find.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/algorithm/ranges_find.md b/reference/algorithm/ranges_find.md index 970c503058..9e404321cd 100644 --- a/reference/algorithm/ranges_find.md +++ b/reference/algorithm/ranges_find.md @@ -59,7 +59,7 @@ namespace std::ranges { int main() { constexpr std::array v = { 3, 1, 4 }; - constexpr auto result = std::ranges::find(v, 1); + const auto result = std::ranges::find(v, 1); if (result == v.end()) { std::cout << "not found" << std::endl; } else { From ac2ed4c717ccb5f1c2a34b629e57cc649d6ab8bf Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Sun, 7 Jul 2024 19:26:17 +0900 Subject: [PATCH 1022/3948] =?UTF-8?q?linalg=20:=20matrix=5Fproduct?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 2 +- reference/linalg/matrix_product.md | 201 +++++++++++++++++++++++++++++ 2 files changed, 202 insertions(+), 1 deletion(-) create mode 100644 reference/linalg/matrix_product.md diff --git a/reference/linalg.md b/reference/linalg.md index 1b2276d895..35f8c95eb9 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -98,7 +98,7 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| `matrix_product` | xGEMM: 2つの一般行列の積を求める (function template) | C++26 | +| [`matrix_product`](linalg/matrix_product.md) | xGEMM: 2つの一般行列の積を求める (function template) | C++26 | | `symmetric_matrix_product` | xSYMM: 対称行列と行列の積を求める (function template) | C++26 | | `hermitian_matrix_product` | xHEMM: ハミルトニアン行列と行列の積を求める (function template) | C++26 | | `triangular_matrix_product` | xTRMM: 三角行列と行列の積を求める (function template) | C++26 | diff --git a/reference/linalg/matrix_product.md b/reference/linalg/matrix_product.md new file mode 100644 index 0000000000..52adef9267 --- /dev/null +++ b/reference/linalg/matrix_product.md @@ -0,0 +1,201 @@ +# matrix_product + + +* [mathjax enable] +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + + +```cpp +namespace std::linalg { + template + void matrix_product(InMat1 A, + InMat2 B, + OutMat C); // (1) + + template + void matrix_product(ExecutionPolicy&& exec, + InMat1 A, + InMat2 B, + OutMat C); // (2) + + template + void matrix_product(InMat1 A, + InMat2 B, + InMat3 E, + OutMat C); // (3) + + template + void matrix_product(ExecutionPolicy&& exec, + InMat1 A, + InMat2 B, + InMat3 E, + OutMat C); // (4) +} +``` + + +## 概要 +行列同士の積を計算する。 + +- (1): $C \leftarrow AB$ +- (2): (1)を指定された実行ポリシーで実行する。 +- (3): $C \leftarrow E + AB$ +- (4): (3)を指定された実行ポリシーで実行する。 + + +## 適格要件 +- (1), (2), (3), (4): [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` +- (3), (4): [`possibly-addable`](possibly-addable.md)`()`が`true` + + +## 事前条件 +- (1), (2), (3), (4): [`multipliable`](multipliable.md)`(A, B, C) == true` +- (3), (4): [`addable`](addable.md)`(E, E, C) == true` + + +## 効果 +- (1), (2): $C \leftarrow AB$ +- (3), (4): $C \leftarrow E + AB$ + + +## 戻り値 +なし + + +## 計算量 +$O(\verb|A.extent(0)| \times \verb|A.extent(1)| \times \verb|B.extent(1)|)$ + + +## 備考 +- (3), (4): `C`に`E`を入れても良い。 + + +## 例 +**[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** + +```cpp example +#include +#include +#include +#include +#include + +template +void print_mat(const Matrix& A) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = 0; j < A.extent(1) - 1; ++j) { + std::cout << A[i, j] << ' '; + } + std::cout << A[i, A.extent(1) - 1] << '\n'; + } +} + +template +void init_mat(Matrix& A) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = 0; j < A.extent(1); ++j) { + A[i, j] = i * A.extent(1) + j; + } + } +} + +int main() +{ + constexpr size_t N = 2; + + std::vector A_vec(N * N); + std::vector B_vec(N * N); + std::vector C_vec(N * N); + std::vector E_vec(N * N); + + std::mdspan A(A_vec.data(), N, N); + std::mdspan B(B_vec.data(), N, N); + std::mdspan C(C_vec.data(), N, N); + std::mdspan E(E_vec.data(), N, N); + + init_mat(A); + init_mat(B); + init_mat(E); + + for(int i = 0; i < B.extent(0); ++i) { + for(int j = 0; j < B.extent(1); ++j) { + B[i, j] += 4; + } + } + + // (1) + std::cout << "(1)\n"; + std::linalg::matrix_product(A, B, C); + print_mat(C); + + // (2) + std::cout << "(2)\n"; + std::linalg::matrix_product(std::execution::par, A, B, C); + print_mat(C); + + // (3) + std::cout << "(3)\n"; + std::linalg::matrix_product(A, B, E, C); + print_mat(C); + + // (4) + std::cout << "(4)\n"; + std::linalg::matrix_product(std::execution::par, A, B, E, C); + print_mat(C); + + return 0; +} +``` + + +### 出力 +``` +(1) +6 7 +26 31 +(2) +6 7 +26 31 +(3) +6 8 +28 34 +(4) +6 8 +28 34 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution`](/reference/execution.md) +- [`mdspan`](/reference/mdspan.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) +- [LAPACK: gemm](https://netlib.org/lapack/explore-html/dd/d09/group__gemm.html) From ea903c0dad90abd4b7746d736d6462179c61254f Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Sun, 7 Jul 2024 21:23:44 +0900 Subject: [PATCH 1023/3948] =?UTF-8?q?borrowed=5Fiterator=5Ft=E3=81=B8?= =?UTF-8?q?=E3=81=AE=E3=83=AA=E3=83=B3=E3=82=AF=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/algorithm/ranges_find_last.md | 1 - reference/algorithm/ranges_find_last_if.md | 1 - reference/algorithm/ranges_find_last_if_not.md | 1 - 3 files changed, 3 deletions(-) diff --git a/reference/algorithm/ranges_find_last.md b/reference/algorithm/ranges_find_last.md index b0ef64abcb..47afea8da5 100644 --- a/reference/algorithm/ranges_find_last.md +++ b/reference/algorithm/ranges_find_last.md @@ -29,7 +29,6 @@ namespace std::ranges { ``` * forward_iterator[link /reference/iterator/forward_iterator.md] * sentinel_for[link /reference/iterator/sentinel_for.md] -* borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] * iterator_t[link /reference/ranges/iterator_t.md] * identity[link /reference/functional/identity.md] * indirect_binary_predicate[link /reference/iterator/indirect_binary_predicate.md] diff --git a/reference/algorithm/ranges_find_last_if.md b/reference/algorithm/ranges_find_last_if.md index dd79e70f8a..b7d008bf0a 100644 --- a/reference/algorithm/ranges_find_last_if.md +++ b/reference/algorithm/ranges_find_last_if.md @@ -27,7 +27,6 @@ namespace std::ranges { ``` * forward_iterator[link /reference/iterator/forward_iterator.md] * sentinel_for[link /reference/iterator/sentinel_for.md] -* borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] * iterator_t[link /reference/ranges/iterator_t.md] * identity[link /reference/functional/identity.md] * indirect_unary_predicate[link /reference/iterator/indirect_unary_predicate.md] diff --git a/reference/algorithm/ranges_find_last_if_not.md b/reference/algorithm/ranges_find_last_if_not.md index 234cd1fbcc..d9dd8b90f1 100644 --- a/reference/algorithm/ranges_find_last_if_not.md +++ b/reference/algorithm/ranges_find_last_if_not.md @@ -27,7 +27,6 @@ namespace std::ranges { ``` * forward_iterator[link /reference/iterator/forward_iterator.md] * sentinel_for[link /reference/iterator/sentinel_for.md] -* borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] * iterator_t[link /reference/ranges/iterator_t.md] * identity[link /reference/functional/identity.md] * indirect_unary_predicate[link /reference/iterator/indirect_unary_predicate.md] From 2838b3898db0a4371de5228312a431c88fa3aa2c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 8 Jul 2024 15:48:42 +0900 Subject: [PATCH 1024/3948] =?UTF-8?q?=E8=A8=80=E8=AA=9E=E6=A9=9F=E8=83=BD?= =?UTF-8?q?=20:=20=E9=96=A2=E9=80=A3=E9=A0=85=E7=9B=AE=E3=81=AB=E8=AA=98?= =?UTF-8?q?=E5=B0=8E=E3=81=99=E3=82=8B=E6=B3=A8=E6=84=8F=E4=BA=8B=E9=A0=85?= =?UTF-8?q?=E3=82=92=E8=A8=98=E8=BC=89=E3=80=82=E6=B3=A8=E6=84=8F=E4=BA=8B?= =?UTF-8?q?=E9=A0=85=E3=82=92=E6=9B=B4=E6=96=B0=E3=81=99=E3=82=8B=E3=82=B9?= =?UTF-8?q?=E3=82=AF=E3=83=AA=E3=83=97=E3=83=88=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20#1275?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflows/script/update_lang_caution.py | 98 +++++++++++++++++++ lang/cpp11/alias_templates.md | 9 +- lang/cpp11/alignas.md | 11 ++- lang/cpp11/alignof.md | 11 ++- lang/cpp11/attributes.md | 11 ++- lang/cpp11/auto.md | 12 ++- lang/cpp11/c99_predefined_macros.md | 11 ++- lang/cpp11/char16_32.md | 12 ++- lang/cpp11/constexpr.md | 11 ++- lang/cpp11/decltype.md | 12 ++- lang/cpp11/defaulted_and_deleted_functions.md | 10 +- lang/cpp11/delegating_constructors.md | 9 +- ...ent_name_specifier_outside_of_templates.md | 9 +- .../deprecation_of_the_register_keyword.md | 11 ++- lang/cpp11/earlier_declarated_array_bounds.md | 9 +- lang/cpp11/explicit_conversion_operator.md | 10 +- lang/cpp11/extend_friend_targets.md | 9 +- ...n_static_data_members_without_an_object.md | 9 +- lang/cpp11/extern_template.md | 9 +- lang/cpp11/feature_test_macros.md | 10 +- lang/cpp11/func.md | 9 +- ...l_scope_syntax_in_nested_name_specifier.md | 9 +- lang/cpp11/inheriting_constructors.md | 9 +- lang/cpp11/initializer_lists.md | 11 ++- lang/cpp11/inline_namespaces.md | 11 ++- lang/cpp11/lambda_expressions.md | 11 ++- ..._and_unnamed_type_as_template_arguments.md | 9 +- lang/cpp11/long_long_type.md | 11 ++- lang/cpp11/noexcept.md | 11 ++- .../non_static_data_member_initializers.md | 11 ++- lang/cpp11/nullptr.md | 11 ++- lang/cpp11/override_final.md | 12 ++- lang/cpp11/pragma_operator.md | 9 +- lang/cpp11/predefined_macros.md | 12 ++- lang/cpp11/range_based_for.md | 12 ++- lang/cpp11/raw_string_literals.md | 9 +- lang/cpp11/recursive_template_limit.md | 9 +- lang/cpp11/ref_qualifier_for_this.md | 11 ++- lang/cpp11/reference_collapsing.md | 10 +- lang/cpp11/remove_export_templates.md | 9 +- lang/cpp11/reserved_namespaces_for_posix.md | 9 +- .../result_of_integer_division_and_modulo.md | 9 +- lang/cpp11/right_angle_brackets.md | 9 +- lang/cpp11/rvalue_ref_and_move_semantics.md | 12 ++- lang/cpp11/scoped_enum.md | 11 ++- lang/cpp11/sfinae_expressions.md | 11 ++- lang/cpp11/static_assert.md | 12 ++- .../static_initialization_thread_safely.md | 9 +- lang/cpp11/string_literal_concatenation.md | 9 +- lang/cpp11/thread_local_storage.md | 11 ++- ...railing_comma_following_enumerator_list.md | 9 +- lang/cpp11/trailing_return_types.md | 11 ++- lang/cpp11/uniform_initialization.md | 11 ++- lang/cpp11/unrestricted_unions.md | 9 +- lang/cpp11/user_defined_literals.md | 11 ++- lang/cpp11/utf8_string_literals.md | 11 ++- lang/cpp11/variadic_macros.md | 11 ++- lang/cpp11/variadic_templates.md | 11 ++- lang/cpp14/binary_literals.md | 11 ++- ...ision_in_array_temporary_initialization.md | 9 +- lang/cpp14/clarifying_memory_allocation.md | 12 ++- lang/cpp14/decltype_auto.md | 11 ++- lang/cpp14/deprecated_attr.md | 11 ++- lang/cpp14/digit_separators.md | 11 ++- lang/cpp14/feature_test_macros.md | 10 +- lang/cpp14/generic_lambdas.md | 12 ++- lang/cpp14/initialize_capture.md | 11 ++- .../member_initializers_and_aggregates.md | 11 ++- lang/cpp14/no_whitespace_literal_operators.md | 11 ++- ...e_template_parameters_of_type_nullptr_t.md | 11 ++- ...laceholder_type_in_trailing_return_type.md | 11 ++- lang/cpp14/predefined_macros.md | 9 +- .../relaxing_constraints_on_constexpr.md | 11 ++- ...urn_type_deduction_for_normal_functions.md | 11 ++- lang/cpp14/sized_deallocation.md | 12 ++- lang/cpp14/variable_templates.md | 11 ++- ...ion_for_all_non-type_template_arguments.md | 10 +- ...emplate_arguments_of_variable_templates.md | 10 +- ...pename_in_a_template_template_parameter.md | 10 +- ...tributes_for_namespaces_and_enumerators.md | 12 ++- lang/cpp17/constexpr_lambda.md | 10 +- lang/cpp17/construction_enum_class_values.md | 12 ++- ...g_non-type_template_arguments_with_auto.md | 12 ++- ...memory_allocation_for_over-aligned_data.md | 12 ++- ...ception_spec_be_part_of_the_type_system.md | 12 ++- lang/cpp17/expression_evaluation_order.md | 12 ++- lang/cpp17/extending_static_assert.md | 12 ++- .../extension_to_aggregate_initialization.md | 12 ++- lang/cpp17/fallthrough.md | 12 ++- lang/cpp17/feature_test_macros.md | 10 +- lang/cpp17/folding_expressions.md | 12 ++- .../generalizing_the_range-based_for_loop.md | 12 ++- lang/cpp17/guaranteed_copy_elision.md | 10 +- lang/cpp17/has_include.md | 10 +- lang/cpp17/hexadecimal_floating_literals.md | 10 +- lang/cpp17/if_constexpr.md | 12 ++- lang/cpp17/inline_variables.md | 12 ++- lang/cpp17/lambda_capture_of_this_by_value.md | 12 ++- .../lambda_to_noexcept_function_pointer.md | 11 ++- lang/cpp17/maybe_unused.md | 12 ++- lang/cpp17/nested_namespace.md | 12 ++- ...or_auto_deduction_from_braced-init-list.md | 12 ++- lang/cpp17/nodiscard.md | 12 ++- lang/cpp17/non_standard_attributes.md | 12 ++- lang/cpp17/pack_expansions_in_using.md | 12 ++- lang/cpp17/predefined_macros.md | 11 ++- ...ove_deprecated_exception_specifications.md | 12 ++- .../remove_deprecated_increment_of_bool.md | 12 ++- ..._deprecated_use_of_the_register_keyword.md | 12 ++- lang/cpp17/removing_trigraphs.md | 10 +- ...ss_objects_containing_reference_members.md | 9 +- .../selection_statements_with_initializer.md | 12 ++- lang/cpp17/structured_bindings.md | 12 ++- .../type_deduction_for_class_templates.md | 12 ++- lang/cpp17/using_attribute_namespaces.md | 12 ++- lang/cpp17/utf8_character_literals.md | 11 ++- .../access_checking_on_specializations.md | 9 +- ...function_templates_that_are_not_visible.md | 10 +- ...tes_from_a_parenthesized_list_of_values.md | 12 ++- lang/cpp20/allow_lambda_capture_equal_this.md | 12 ++- ...w_pack_expansion_in_lambda_init_capture.md | 12 ++- ...ructured_bindings_to_accessible_members.md | 12 ++- ..._function_calls_in_constant_expressions.md | 12 ++- ...ymorphic_typeid_in_constant_expressions.md | 12 ++- ...array_size_deduction_in_new-expressions.md | 12 ++- ...tive_member_of_a_union_inside_constexpr.md | 12 ++- lang/cpp20/char8_t.md | 12 ++- .../checking_for_abstract_class_types.md | 10 +- ...plate_argument_deduction_for_aggregates.md | 12 ++- ..._argument_deduction_for_alias_templates.md | 12 ++- ...s_types_in_non-type_template_parameters.md | 12 ++- lang/cpp20/concepts.md | 12 ++- lang/cpp20/consistent_comparison.md | 12 ++- lang/cpp20/constinit.md | 12 ++- ..._to_bool_should_be_considered_narrowing.md | 12 ++- lang/cpp20/coroutines.md | 12 ++- ...ctible_and_assignable_stateless_lambdas.md | 12 ++- ...ault_member_initializers_for_bit_fields.md | 11 ++- ...te_implicit_capture_of_this_via_defcopy.md | 12 ++- lang/cpp20/deprecate_pod.md | 12 ++- ...ma_operator_in_subscripting_expressions.md | 12 ++- lang/cpp20/deprecating_volatile.md | 10 +- lang/cpp20/designated_initialization.md | 10 +- lang/cpp20/down_with_typename.md | 10 +- ...sized_delete_for_variable_sized_classes.md | 12 ++- ..._inline-assembly_in_constexpr_functions.md | 12 ++- lang/cpp20/explicit_bool.md | 12 ++- ...s_to_be_more_like_variable_declarations.md | 12 ++- ...iar_template_syntax_for_generic_lambdas.md | 12 ++- lang/cpp20/feature_test_macros.md | 10 +- ...ing_const_qualified_pointers_to_members.md | 12 ++- ...function_templates_with_auto_parameters.md | 12 ++- lang/cpp20/immediate_functions.md | 12 ++- ...jects_for_low-level_object_manipulation.md | 12 ++- .../language_support_for_empty_objects.md | 12 ++- ...er_instantiation_of_constexpr_functions.md | 10 +- lang/cpp20/likely_and_unlikely_attributes.md | 12 ++- ...16t_char32t_string_literals_be_utf16_32.md | 12 ++- lang/cpp20/modules.md | 12 ++- lang/cpp20/more_constexpr_containers.md | 12 ++- lang/cpp20/nested_inline_mamespaces.md | 12 ++- lang/cpp20/nodiscard_for_constructors.md | 12 ++- lang/cpp20/nodiscard_should_have_a_reason.md | 12 ++- ..._conversions_to_arrays_of_unknown_bound.md | 10 +- ...lt_initialization_in_constexpr_contexts.md | 12 ++- lang/cpp20/predefined_macros.md | 10 +- ...regates_with_user-declared_constructors.md | 10 +- ...e-based_for_statements_with_initializer.md | 12 ++- ...eference_capture_of_structured_bindings.md | 12 ++- ..._loop_customization_point_finding_rules.md | 12 ++- ...dings_customization_point_finding_rules.md | 12 ++- ...recated_nothrow_exception_specification.md | 12 ++- ...ing_attribute_namespaces_for_future_use.md | 12 ++- ...ismatch_with_defaulted_copy_constructor.md | 10 +- .../signed_integers_are_twos_complement.md | 12 ++- .../simplifying_implicit_lambda_capture.md | 11 ++- ...try-catch_blocks_in_constexpr_functions.md | 12 ++- ...e_the_reference_to_the_unicode_standard.md | 10 +- lang/cpp20/using_enum.md | 12 ++- lang/cpp20/va_opt.md | 12 ++- ...ing_for_lambdas_in_unevaluated_contexts.md | 12 ++- ...cessing_directives_elifdef_and_elifndef.md | 10 +- .../cpp23/attributes_on_lambda_expressions.md | 12 ++- .../character_encoding_of_diagnostic_text.md | 10 +- ...plate_argument_deduction_from_inherited.md | 12 ++- .../consistent_character_literal_encoding.md | 10 +- lang/cpp23/consteval_needs_to_propagate_up.md | 12 ++- lang/cpp23/delimited_escape_sequences.md | 12 ++- lang/cpp23/down_with_lambda_parens.md | 12 ++- ...it_statement_to_allow_alias_declaration.md | 12 ++- lang/cpp23/feature_test_macros.md | 10 +- ...zed_wording_for_partial_specializations.md | 12 ++- lang/cpp23/if_consteval.md | 12 ++- ...abels_at_the_end_of_compound_statements.md | 10 +- ...etime_extension_in_range_based_for_loop.md | 12 ++- .../cpp23/literal_suffix_for_signed_size_t.md | 12 ++- .../make_declaration_order_layout_mandated.md | 10 +- lang/cpp23/meaningful_exports.md | 12 ++- .../mixed_string_literal_concatenation.md | 10 +- .../multidimensional_subscript_operator.md | 12 ++- .../named_universal_character_escapes.md | 12 ++- ...arrowing_contextual_conversions_to_bool.md | 12 ++- ...iteral_variables_in_constexpr_functions.md | 12 ++- ...stexpr_variables_in_constexpr_functions.md | 12 ++- lang/cpp23/portable_assumptions.md | 12 ++- lang/cpp23/predefined_macros.md | 10 +- .../relaxing_some_constexpr_restrictions.md | 12 ++- ..._multicharacter_wide_character_literals.md | 9 +- lang/cpp23/simpler_implicit_move.md | 10 +- lang/cpp23/static_operator.md | 12 ++- ...utf8_as_a_portable_source_file_encoding.md | 10 +- ...imming_whitespaces_before_line_splicing.md | 10 +- .../update_normative_reference_to_posix.md | 10 +- lang/cpp23/warning.md | 10 +- .../user-generated_static_assert_messages.md | 12 ++- lang/future/contract-based_programming.md | 4 +- start_editing/lang_template_page.md | 25 ++++- 217 files changed, 2131 insertions(+), 365 deletions(-) create mode 100644 .github/workflows/script/update_lang_caution.py diff --git a/.github/workflows/script/update_lang_caution.py b/.github/workflows/script/update_lang_caution.py new file mode 100644 index 0000000000..524716ba08 --- /dev/null +++ b/.github/workflows/script/update_lang_caution.py @@ -0,0 +1,98 @@ +# 言語機能ページに注意事項を記載・更新する +# リポジトリのトップディレクトリで以下を実行する +# python3 .github/workflows/script/update_lang_caution.py + +import glob +import os +import sys +import re + +LANG_CAUTION = '''このページはC++{}に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。''' + +FUTURE_LANG_CAUTION = '''このページはC++{}に採用される見込みの言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。''' + +FUTURE_LANG_VERSION = 26 + +START_CAUTION = "<-- start lang caution -->" +LAST_CAUTION = "<-- last lang caution -->" + +def update_lang_caution(text: str, filename: str) -> str: + version = 0 + new_lines = [] + is_version_line = False + start_lang_caution = False + end_lang_caution = False + found_relative_page = False + for line in text.splitlines(): + m = re.search(r'\* cpp(.*?)\[meta cpp\]', line) + if m: + version = int(m[1]) + new_lines.append(line) + is_version_line = True + continue + + if start_lang_caution: + if line == LAST_CAUTION: + start_lang_caution = False + end_lang_caution = True + continue + + if len(line) <= 0: + new_lines.append(line) + continue + + if line == "## 関連項目": + new_lines.append("## 関連項目") + found_relative_page = True + continue + elif line == "## 関連項目": + found_relative_page = True + + if not end_lang_caution: + is_lang_caution = False + if line == START_CAUTION: + start_lang_caution = True + is_lang_caution = True + elif is_version_line: + is_version_line = False + if not start_lang_caution: + is_lang_caution = True + + if is_lang_caution: + caution_text = LANG_CAUTION if version < FUTURE_LANG_VERSION else FUTURE_LANG_CAUTION + new_lines.append(START_CAUTION) + new_lines.append("") + new_lines.append(caution_text.format(version)) + new_lines.append("") + new_lines.append(LAST_CAUTION) + if not start_lang_caution: + new_lines.append("") + + if not start_lang_caution: + new_lines.append(line) + continue + + new_lines.append(line) + + new_text = "\n".join(new_lines) + if not found_relative_page: + new_text = new_text.replace("[関連項目](#relative_page)", "関連項目") + return new_text + +if __name__ == '__main__': + for p in sorted(list(glob.glob("lang/**/*.md", recursive=True))): + if p.count("/") <= 1: + continue + + with open(p) as f: + text = f.read() + + new_text = update_lang_caution(text, p) + if text != new_text and text != (new_text + "\n") and (text + "\n") != new_text: + print("hit {}".format(p)) + with open(p, 'w') as f: + f.write(new_text) diff --git a/lang/cpp11/alias_templates.md b/lang/cpp11/alias_templates.md index 53ee5059d2..93d3fecd24 100644 --- a/lang/cpp11/alias_templates.md +++ b/lang/cpp11/alias_templates.md @@ -1,6 +1,14 @@ # エイリアステンプレート [N2258] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 「エイリアステンプレート (alias templates)」は、テンプレートによって型の別名を定義する機能である。これによって、パラメータ化した型の別名付けができる。 @@ -100,4 +108,3 @@ typedef void_alloc::rebind::other int_alloc; - [N1489 Templates aliases for C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1489.pdf) - [N2112 Templates Aliases](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2112.pdf) - [N2258 Templates Aliases](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf) - diff --git a/lang/cpp11/alignas.md b/lang/cpp11/alignas.md index 3427b7f9d9..44ee2cd7a7 100644 --- a/lang/cpp11/alignas.md +++ b/lang/cpp11/alignas.md @@ -1,6 +1,14 @@ # alignas [N2341] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 `alignas()`は、コンパイラに対し変数をメモリ上の特定の位置に配置(アライメント)するように要求するキーワードである。「アライン アズ (align as)」と読む。 @@ -101,11 +109,10 @@ C++03で変数のアライメントを行うにはコンパイラの拡張機能 N2341 からはわからない、恐らくないと思われる。 -## 関連項目 +## 関連項目 - [C++11 `alignof`](/lang/cpp11/alignof.md) - [C++17 アライメント指定されたデータの動的メモリ確保](/lang/cpp17/dynamic_memory_allocation_for_over-aligned_data.md) ## 参照 - [N2341 Adding Alignment Support to the C++ Programming Language / Wording](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf) - diff --git a/lang/cpp11/alignof.md b/lang/cpp11/alignof.md index 61d4251e77..533b4fd42e 100644 --- a/lang/cpp11/alignof.md +++ b/lang/cpp11/alignof.md @@ -1,6 +1,14 @@ # alignof [N2341] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 `alignof()`は、指定した型がメモリ上のどの位置に配置されるか(アライメント)取得する演算子である。「アライン オブ (align of)」と読む。 @@ -70,7 +78,7 @@ C++03で型のアライメントサイズを得るにはコンパイラの拡張 N2341 からはわからない、恐らくないと思われる。 -## 関連項目 +## 関連項目 - [C++11 `alignas`](/lang/cpp11/alignas.md) - [`std::max_align_t`](/reference/cstddef/max_align_t.md) - [C++17 アライメント指定されたデータの動的メモリ確保](/lang/cpp17/dynamic_memory_allocation_for_over-aligned_data.md) @@ -78,4 +86,3 @@ N2341 からはわからない、恐らくないと思われる。 ## 参照 - [N2341 Adding Alignment Support to the C++ Programming Language / Wording](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf) - diff --git a/lang/cpp11/attributes.md b/lang/cpp11/attributes.md index 613da48005..d2a5122775 100644 --- a/lang/cpp11/attributes.md +++ b/lang/cpp11/attributes.md @@ -1,6 +1,14 @@ # 属性構文 [N2761] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 属性(attributes)は、ソースコードに対して追加の情報をコンパイラに伝えるための構文である。 @@ -152,7 +160,7 @@ C++11で採用されたもの以外で検討された以下の機能は、属性 - ポインタの所有者(解放する責任を持つユーザー)であることを明示する`owner`属性 -## 関連項目 +## 関連項目 - [C++14 `[[deprecated]]`属性](/lang/cpp14/deprecated_attr.md) - [C++17 `[[maybe_unused]]`属性](/lang/cpp17/maybe_unused.md) - [C++17 `[[nodiscard]]`属性](/lang/cpp17/nodiscard.md) @@ -170,4 +178,3 @@ C++11で採用されたもの以外で検討された以下の機能は、属性 - [N2643 C++ Data-Dependency Ordering: Function Annotation](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2643.html) - [N2761 Towards support for attributes in C++ (Revision 6) ](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2761.pdf) - [(抄訳)N4215 `memory_order_consume`の利用と実装に向けて[§5-6のみ]](http://d.hatena.ne.jp/yohhoy/20141115/p1) - diff --git a/lang/cpp11/auto.md b/lang/cpp11/auto.md index d5566c1754..714ed57df4 100644 --- a/lang/cpp11/auto.md +++ b/lang/cpp11/auto.md @@ -1,6 +1,14 @@ # auto [N1984] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++11 から、変数宣言時に具体的な型名のかわりに `auto` キーワードを指定する事によって、変数の型を初期化子から推論できるようになった。 @@ -357,7 +365,7 @@ std::pair& p = foo(); しかし、この使用法も規格から落とされた。 -## 関連項目 +## 関連項目 - [C++11 戻り値の型を後置する関数宣言構文](trailing_return_types.md) - [C++11 `decltype`](decltype.md) - [C++11 ラムダ式](lambda_expressions.md) @@ -379,4 +387,4 @@ std::pair& p = foo(); - [N2337 The Syntax of auto Declarations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2337.pdf) - [N2546 Removal of auto as a storage-class specifier](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2546.htm) - [N2712 Non-static data member initializers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2712.html) -- [N2713 Allow auto for non-static data members](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2713.html) +- [N2713 Allow auto for non-static data members](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2713.html) \ No newline at end of file diff --git a/lang/cpp11/c99_predefined_macros.md b/lang/cpp11/c99_predefined_macros.md index a200b278bf..9a2ebf05e3 100644 --- a/lang/cpp11/c99_predefined_macros.md +++ b/lang/cpp11/c99_predefined_macros.md @@ -1,6 +1,14 @@ # C99互換で導入された定義済みマクロ * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 定義済みマクロの値が、以下のように更新された: @@ -11,11 +19,10 @@ | `__STDC_ISO_10646__` | `wchar_t`の文字が、Unicodeの規格であるISO/IEC 10646の、yyyymm年の仕様を満たしている場合に定義される。
このマクロの値は、`yyyymmL`の形式の整数値として定義される。yは年、mは月を表す。yとmそれぞれの個数は、桁数を表す。 | -## 関連項目 +## 関連項目 - [C++11 更新された定義済みマクロ](predefined_macros.md) ## 参照 - [N1653 Working draft changes for C99 preprocessor synchronization](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm) - [CWG Issue 630. Equality of narrow and wide character values in the basic character set](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#630) - diff --git a/lang/cpp11/char16_32.md b/lang/cpp11/char16_32.md index a12af8688f..968c867cfc 100644 --- a/lang/cpp11/char16_32.md +++ b/lang/cpp11/char16_32.md @@ -1,6 +1,14 @@ # char16_tとchar32_t [N2249] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 `char16_t`はUTF-16符号化形式の文字型、`char32_t`はUTF-32符号化形式の文字型である。 @@ -124,7 +132,7 @@ int main() この機能が提案された2004年当時にはすでにUCS/Unicodeが広く普及していた。多くのユーザーがその文字コードを扱うことを望んでいたために、標準C++で正式にサポートすることとなった。 -## 関連項目 +## 関連項目 - [`u16string`](/reference/string/basic_string.md) - [`u32string`](/reference/string/basic_string.md) - [`wstring_convert`](/reference/locale/wstring_convert.md) @@ -143,4 +151,4 @@ int main() - [N2018 New Character Types in C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2018.html) - [N2149 New Character Types in C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2149.html) - [N2249 New Character Types in C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2249.html) -- [N2170 Universal Character Names in Literals](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2170.html) +- [N2170 Universal Character Names in Literals](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2170.html) \ No newline at end of file diff --git a/lang/cpp11/constexpr.md b/lang/cpp11/constexpr.md index 44b3a5d479..a4667ade4a 100644 --- a/lang/cpp11/constexpr.md +++ b/lang/cpp11/constexpr.md @@ -1,6 +1,14 @@ # constexpr [N2235] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 `constexpr`は、汎用的に定数式を表現するための機能である。 @@ -191,7 +199,7 @@ GCC 5.2、Clang 3.7、Visual C++ 2015時点で、3つともデフォルトは512 また、`constexpr`は、値を計算するテンプレートメタプログラムを置き換えて使用できる。テンプレートメタプログラミングでは、非型テンプレートパラメータによって整数型の値をコンパイル時に計算することはできた。しかし、浮動小数点数型の値や、その他多くの値に関する計算が難しく、構文もまた通常の関数とはかけ離れていた(浮動小数点数型の値の計算は、分数形式にすれば、できることはできる)。値をコンパイル時に計算するためには、今後はテンプレートメタプログラミングよりも`constexpr`を積極的に使用していくとよいだろう。 -## 関連項目 +## 関連項目 - [C++11 ユーザー定義リテラル](user_defined_literals.md) - [C++14 `constexpr`の制限緩和](/lang/cpp14/relaxing_constraints_on_constexpr.md) - [C++17 `constexpr`ラムダ](/lang/cpp17/constexpr_lambda.md) @@ -219,4 +227,3 @@ GCC 5.2、Clang 3.7、Visual C++ 2015時点で、3つともデフォルトは512 - リテラル型のメンバ変数のみを持つクラスは、`constexpr`コンストラクタを明示的に定義しなくても、リテラル型となる - [CWG Issue 699. Must constexpr member functions be defined in the class member-specification?](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#699) - ゼロ割りの扱い、再帰回数の規定 - diff --git a/lang/cpp11/decltype.md b/lang/cpp11/decltype.md index 88693da6c5..3262354b71 100644 --- a/lang/cpp11/decltype.md +++ b/lang/cpp11/decltype.md @@ -1,6 +1,14 @@ # decltype [N2343] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 `decltype` は、オペランドで指定した式の型を取得する機能である。 型を指定する必要のある個所で `decltype` を使用することによって、具体的な型名を指定する代わりに式から取得した型を指定できるようになった。 @@ -247,7 +255,7 @@ GCC や Clang には `decltype` が導入される前から、同様の機能を `decltype` のオペランドは式のみしか許されていないが、`typeof` は式だけでなく型そのものも許されている。 -## 関連項目 +## 関連項目 - [C++11 戻り値の型を後置する関数宣言構文](trailing_return_types.md) - [C++11 `auto`](auto.md) - [C++11 ラムダ式](lambda_expressions.md) @@ -268,4 +276,4 @@ GCC や Clang には `decltype` が導入される前から、同様の機能を - [N3233 US22/DE9 Revisited: Decltype and Call Expressions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3233.html) - [N3276 US22/DE9 Revisited: Decltype and Call Expressions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3276.pdf) - [CWG Issue 743. Use of decltype in a nested-name-specifier](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#743) -- [CWG Issue 950. Use of decltype as a class-name](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#950) +- [CWG Issue 950. Use of decltype as a class-name](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#950) \ No newline at end of file diff --git a/lang/cpp11/defaulted_and_deleted_functions.md b/lang/cpp11/defaulted_and_deleted_functions.md index 5d229bd62f..1048d3e4d8 100644 --- a/lang/cpp11/defaulted_and_deleted_functions.md +++ b/lang/cpp11/defaulted_and_deleted_functions.md @@ -1,6 +1,14 @@ # 関数のdefault/delete宣言 [N2346] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 クラスを定義した際、以下のメンバ関数が暗黙的に定義される: @@ -123,4 +131,4 @@ int main() - [N2210 Defaulted and Deleted Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2210.html) - [N2326 Defaulted and Deleted Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2326.html) - [N3172 To move or not to move](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3174.pdf) -- [N2346 Defaulted and Deleted Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm) +- [N2346 Defaulted and Deleted Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm) \ No newline at end of file diff --git a/lang/cpp11/delegating_constructors.md b/lang/cpp11/delegating_constructors.md index f65566c9c1..8fda468b1e 100644 --- a/lang/cpp11/delegating_constructors.md +++ b/lang/cpp11/delegating_constructors.md @@ -1,6 +1,14 @@ # 委譲コンストラクタ [N1986] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 「委譲コンストラクタ (delegating constructors)」は、コンストラクタから、同じクラスの他のコンストラクタに処理を委譲する機能である。 @@ -82,4 +90,3 @@ ECMA規格となっているC++/CLIには、この問題を解決するための - [N1618 Delegating Constructors (revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1618.pdf) - [N1895 Delegating Constructors (revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1895.pdf) - [N1986 Delegating Constructors (revision 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf) - diff --git a/lang/cpp11/dependent_name_specifier_outside_of_templates.md b/lang/cpp11/dependent_name_specifier_outside_of_templates.md index 87be4bc664..755ea6c63b 100644 --- a/lang/cpp11/dependent_name_specifier_outside_of_templates.md +++ b/lang/cpp11/dependent_name_specifier_outside_of_templates.md @@ -1,6 +1,14 @@ # 依存名に対するtypenameとtemplateの制限緩和 * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 テンプレート内で、テンプレートパラメータに依存する名前を使用する場合には、`typename`キーワードを先頭に付ける必要がある。 @@ -38,4 +46,3 @@ int main() ## 参照 - [CWG Issue 382. Allow `typename` outside of templates](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#382) - [CWG Issue 468. Allow `::template` outside of templates](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#468) - diff --git a/lang/cpp11/deprecation_of_the_register_keyword.md b/lang/cpp11/deprecation_of_the_register_keyword.md index 21989b3bc7..b8d6077bed 100644 --- a/lang/cpp11/deprecation_of_the_register_keyword.md +++ b/lang/cpp11/deprecation_of_the_register_keyword.md @@ -1,6 +1,14 @@ # registerキーワードを非推奨化 * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 `register`キーワードが非推奨化された。 @@ -17,11 +25,10 @@ register int v = 42; `register`はよく使われる英単語であるため、将来的にこのキーワードをほかの用途に再利用することを目標とする。 -## 関連項目 +## 関連項目 - [C++17 非推奨だったregisterキーワードを削除](/lang/cpp17/remove_deprecated_use_of_the_register_keyword.md) ## 参照 - [CWG Issue 809. Deprecation of the `register` keyword](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#809) - diff --git a/lang/cpp11/earlier_declarated_array_bounds.md b/lang/cpp11/earlier_declarated_array_bounds.md index 80728dca6f..e82c262515 100644 --- a/lang/cpp11/earlier_declarated_array_bounds.md +++ b/lang/cpp11/earlier_declarated_array_bounds.md @@ -1,6 +1,14 @@ # 宣言時に要素数を指定した配列オブジェクトの、定義時の要素数を規定 * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 `static`メンバや`extern`として宣言した配列を定義した際、宣言時に指定した要素数として定義されることが規定された。 @@ -19,4 +27,3 @@ int S::y[]; // 要素数は10 ## 参照 - [CWG Issue 619. Completeness of array types](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#619) - diff --git a/lang/cpp11/explicit_conversion_operator.md b/lang/cpp11/explicit_conversion_operator.md index 52802ad208..b61a80980c 100644 --- a/lang/cpp11/explicit_conversion_operator.md +++ b/lang/cpp11/explicit_conversion_operator.md @@ -1,6 +1,14 @@ # 明示的な型変換演算子のオーバーロード [N2437] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 型変換演算子のオーバーロードをする際、`operator`キーワードの前に`explicit`を付加することで、その型変換演算子は明示的な型変換が行われる文脈でのみ呼び出されるようになる: @@ -73,4 +81,4 @@ int main() - [N1592 Explicit Conversion Operators](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1592.pdf) - [N2223 Explicit Conversion Operator Draft Working Paper](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2223.pdf) - [N2333 Explicit Conversion Operator Draft Working Paper Revision 1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2333.html) -- [N2437 Explicit Conversion Operator Draft Working Paper (revision 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf) +- [N2437 Explicit Conversion Operator Draft Working Paper (revision 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf) \ No newline at end of file diff --git a/lang/cpp11/extend_friend_targets.md b/lang/cpp11/extend_friend_targets.md index 75a7492326..e2f9cfbb65 100644 --- a/lang/cpp11/extend_friend_targets.md +++ b/lang/cpp11/extend_friend_targets.md @@ -1,6 +1,14 @@ # friend宣言できる対象を拡張 [N1791] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 C++03までの`friend`宣言は、直接のクラス型のみを指定できた。 @@ -53,4 +61,3 @@ int main() - [N1616 Extended friend Declarations (Rev. 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1616.pdf) - [N1722 Extended friend Declarations (Rev. 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1722.pdf) - [N1791 Extended friend Declarations (Rev. 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1791.pdf) - diff --git a/lang/cpp11/extending_sizeof_to_apply_to_non_static_data_members_without_an_object.md b/lang/cpp11/extending_sizeof_to_apply_to_non_static_data_members_without_an_object.md index 82280554b8..8b7b3c6a95 100644 --- a/lang/cpp11/extending_sizeof_to_apply_to_non_static_data_members_without_an_object.md +++ b/lang/cpp11/extending_sizeof_to_apply_to_non_static_data_members_without_an_object.md @@ -1,6 +1,14 @@ # sizeof演算子にクラスの非静的メンバを、オブジェクトを作らずに指定できるようにする * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 クラスの非静的メンバ変数のサイズを取得したい場合、そのクラスのオブジェクトを生成してから`sizeof`演算子にメンバを指定する必要があった。その制限が外され、クラスと非静的メンバ変数を、スコープ解決演算子 `::` 区切りで`sizeof`演算子に指定できるようになった: @@ -26,4 +34,3 @@ int main() - [CWG Issue 613. Unevaluated uses of non-static class members](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#613) - [N2150 Extending sizeof to apply to non-static data members without an object](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2150.html) - [N2253 Extending sizeof to apply to non-static data members without an object (revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2253.html) - diff --git a/lang/cpp11/extern_template.md b/lang/cpp11/extern_template.md index 2a31d1e8cb..615e256382 100644 --- a/lang/cpp11/extern_template.md +++ b/lang/cpp11/extern_template.md @@ -1,6 +1,14 @@ # extern template [N1987] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 `extern template`は、指定したテンプレートを、その翻訳単位でインスタンス化しないことを指示するための機能である。 @@ -56,4 +64,3 @@ void user2() ## 参照 - [N1448 Controlling Implicit Template Instantiation](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1448.pdf) - [N1987 Adding "extern template" (version 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1987.htm) - diff --git a/lang/cpp11/feature_test_macros.md b/lang/cpp11/feature_test_macros.md index 7c82044446..0e270cc8a1 100644 --- a/lang/cpp11/feature_test_macros.md +++ b/lang/cpp11/feature_test_macros.md @@ -1,6 +1,14 @@ # 機能テストマクロ * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 SD-6 は C++11 の機能について以下のテストマクロを定義することを推奨している: @@ -29,4 +37,4 @@ SD-6 は C++11 の機能について以下のテストマクロを定義する | `__has_cpp_attribute(noreturn)` | `200809` | [属性](attributes.md#noreturn) | predefined | ## 参照 -- [SD-6: SG10 Feature Test Recommendations: Standard C++](https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations#recs.cpp11) +- [SD-6: SG10 Feature Test Recommendations: Standard C++](https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations#recs.cpp11) \ No newline at end of file diff --git a/lang/cpp11/func.md b/lang/cpp11/func.md index e894f7befa..db9fe7f724 100644 --- a/lang/cpp11/func.md +++ b/lang/cpp11/func.md @@ -1,6 +1,14 @@ # 事前定義識別子\_\_func\_\_ [N1653] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 C99互換として、事前定義識別子(predefined identifier)の`__func__`が導入された。 @@ -83,4 +91,3 @@ S::print() : print - [N1534 Proposed addition of `__func__` predefined identifier from C99](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1534.txt) - [5.41 Function Names as Strings - GCC](https://gcc.gnu.org/onlinedocs/gcc-3.3.5/gcc/Function-Names.html) - [Predefined macros | Microsoft Docs](https://docs.microsoft.com/ja-JP/cpp/preprocessor/predefined-macros?view=vs-2019) - diff --git a/lang/cpp11/global_scope_syntax_in_nested_name_specifier.md b/lang/cpp11/global_scope_syntax_in_nested_name_specifier.md index cb3df12a39..1bce9882b9 100644 --- a/lang/cpp11/global_scope_syntax_in_nested_name_specifier.md +++ b/lang/cpp11/global_scope_syntax_in_nested_name_specifier.md @@ -1,6 +1,14 @@ # 入れ子名の指定にグローバルスコープ :: を付加することを許可 * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 入れ子名を指定する構文において、先頭にグローバルスコープの指定`::`を付加することが許可された。 @@ -37,4 +45,3 @@ nested-name-specifier: ## 参照 - [CWG Issue 355. Global-scope `::` in nested-name-specifier](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#355) - diff --git a/lang/cpp11/inheriting_constructors.md b/lang/cpp11/inheriting_constructors.md index a84dcc7711..df94c217de 100644 --- a/lang/cpp11/inheriting_constructors.md +++ b/lang/cpp11/inheriting_constructors.md @@ -1,6 +1,14 @@ # 継承コンストラクタ [N2540] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 「継承コンストラクタ (inheriting constructors)」は、基底クラスで定義したコンストラクタ群を、派生クラスでそのまま使用できるようにするための糖衣構文である。 @@ -95,4 +103,3 @@ struct Derived : Base { - [N2438 Inheriting Constructors (revision 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2438.htm) - [N2512 Inheriting Constructors (revision 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2512.html) - [N2540 Inheriting Constructors (revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2540.htm) - diff --git a/lang/cpp11/initializer_lists.md b/lang/cpp11/initializer_lists.md index 79ca2b4a19..b3adc1a56e 100644 --- a/lang/cpp11/initializer_lists.md +++ b/lang/cpp11/initializer_lists.md @@ -1,6 +1,14 @@ # 初期化子リスト [N2672] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 「初期化子リスト (initializer lists)」は、ユーザー定義型のオブジェクトに対して、波カッコによるリスト初期化を使用できるようにするようオーバーロードする機能である。 @@ -331,7 +339,7 @@ std::vector v(ar, ar + N); この問題を解決するために、波カッコによるリスト初期化をユーザー定義型でオーバーロードする機能が求められ、[`std::initializer_list`](/reference/initializer_list/initializer_list.md)クラスとオーバーロード機能が導入された。 -## 関連項目 +## 関連項目 - [C++11 一様初期化](uniform_initialization.md) @@ -350,4 +358,3 @@ std::vector v(ar, ar + N); - [N2640 Initializer Lists - Alternative Mechanism and Rationale (v. 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2640.pdf) - [N2672 Initializer List proposed wording](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm) - [CWG Issue 1030. Evaluation order in initializer-lists used in aggregate initialization](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1030) - diff --git a/lang/cpp11/inline_namespaces.md b/lang/cpp11/inline_namespaces.md index 929243944d..4bc0ae4d19 100644 --- a/lang/cpp11/inline_namespaces.md +++ b/lang/cpp11/inline_namespaces.md @@ -1,6 +1,14 @@ # インライン名前空間 [N2535] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 インライン名前空間 (inline namespace)は、名前空間内の機能に透過的にアクセスするための機能である。`inline namespace`によって定義した名前空間の機能には、その名前空間を指定しなくてもアクセスできる。 @@ -217,7 +225,7 @@ v2 ``` -## 関連項目 +## 関連項目 - 時間間隔オブジェクトのリテラル - [`operator"" ns`](/reference/chrono/duration/op_ns.md) - [`operator"" us`](/reference/chrono/duration/op_us.md) @@ -243,4 +251,3 @@ v2 - [CWG Issue 812. Duplicate names in inline namespaces](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#812) - [CWG Issue 861. Unintended ambiguity in inline namespace lookup](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#861) - [Inline namespaces and ambigous declarations - Stackoverflow](http://stackoverflow.com/questions/27252466/inline-namespaces-and-ambigous-declarations/) - diff --git a/lang/cpp11/lambda_expressions.md b/lang/cpp11/lambda_expressions.md index 38783f5426..b5f93a62d2 100644 --- a/lang/cpp11/lambda_expressions.md +++ b/lang/cpp11/lambda_expressions.md @@ -1,6 +1,14 @@ # ラムダ式 [N2927] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 「ラムダ式(lambda expressions)」は、簡易的な関数オブジェクトをその場で定義するための機能である。 @@ -523,7 +531,7 @@ for_each(array, array + 4, <&>(double d) ( sum += factor ∗ d )); なお、C++11時点のラムダ式はテンプレートを扱えないが、これはコンパイラの実装が難しい、という理由での見送りである。 -## 関連項目 +## 関連項目 - [C++11 ローカル型と無名型を、テンプレート引数として使用することを許可](local_and_unnamed_type_as_template_arguments.md) - [C++14 ジェネリックラムダ](/lang/cpp14/generic_lambdas.md) - [C++14 ラムダ式の初期化キャプチャ](/lang/cpp14/initialize_capture.md) @@ -554,4 +562,3 @@ for_each(array, array + 4, <&>(double d) ( sum += factor ∗ d )); - [N3043 Converting Lambdas to Function Pointers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3043.html) - [N3052 Converting Lambdas to Function Pointers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3052.html) - [CWG Issue 975. Restrictions on return type deduction for lambdas](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#975) - diff --git a/lang/cpp11/local_and_unnamed_type_as_template_arguments.md b/lang/cpp11/local_and_unnamed_type_as_template_arguments.md index 8eeb04d6e0..3203e8bcca 100644 --- a/lang/cpp11/local_and_unnamed_type_as_template_arguments.md +++ b/lang/cpp11/local_and_unnamed_type_as_template_arguments.md @@ -1,6 +1,14 @@ # ローカル型と無名型を、テンプレート引数として使用することを許可 [N2657] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 ローカルで定義した型と、名前のない型を、テンプレート引数として渡すことが許可された。 @@ -42,4 +50,3 @@ int main() - [N2402 Names, Linkage, and Templates (rev 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2402.pdf) - [N2635 Local and Unnamed Types as Template Arguments](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2635.html) - [N2657 Local and Unnamed Types as Template Arguments](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm) - diff --git a/lang/cpp11/long_long_type.md b/lang/cpp11/long_long_type.md index cf62830df2..cf67cdb50d 100644 --- a/lang/cpp11/long_long_type.md +++ b/lang/cpp11/long_long_type.md @@ -1,6 +1,14 @@ # long long型 [N1811] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C99互換として、`long long`整数型が追加された。 @@ -51,7 +59,7 @@ int main() `long long`のように、`long`を2つ連続させることで「`long`より大きな型」であることを表現するのは非常に醜いものではあるが、C99およびコンパイラの実装による事実上の標準があったために、C++もそれにならった。ただし、これは128ビット整数型に対応する際に`long long long`型を定義することは意味しない。その際は、改めて型の定義を議論する必要があるが、いまは`long long`で64ビット整数型を表現することとした。 -## 関連項目 +## 関連項目 - [`LLONG_MIN`](/reference/climits/llong_min.md) - [`LLONG_MAX`](/reference/climits/llong_max.md) - [`ULLONG_MAX`](/reference/climits/ullong_max.md) @@ -68,4 +76,3 @@ int main() - [N1565 Adding the `long long` type to C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1565.pdf) - [N1735 Adding the `long long` type to C++ (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1735.pdf) - [N1811 Adding the `long long` type to C++ (Revision 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1811.pdf) - diff --git a/lang/cpp11/noexcept.md b/lang/cpp11/noexcept.md index afef96b59c..c035ada198 100644 --- a/lang/cpp11/noexcept.md +++ b/lang/cpp11/noexcept.md @@ -1,6 +1,14 @@ # noexcept [N3050] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++11で導入された`noexcept`キーワードには、以下の2つの意味がある: @@ -165,7 +173,7 @@ int main() そういった例外を送出しない判定や指定は、従来の`throw`キーワードによる例外仕様の範囲を超えていた。そのために、`noexcept`という機能が新設され、その機能で必要十分となったために従来の例外仕様は非推奨となった。 -## 関連項目 +## 関連項目 - [標準ライブラリにおける、関数に`noexcept`を付けない条件](/article/lib/dont_use_noexcept.md) - [`move_if_noexcept`](/reference/utility/move_if_noexcept.md) - [`is_nothrow_constructible`](/reference/type_traits/is_nothrow_constructible.md) @@ -189,4 +197,3 @@ int main() - [N3205 Delete operators default to `noexcept`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3205.htm) - [N3103 Security impact of `noexcept`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3103.pdf) - [ムーブによるpop - Faith and Brave - C++で遊ぼう](http://faithandbrave.hateblo.jp/entry/20130604/1370327651) - diff --git a/lang/cpp11/non_static_data_member_initializers.md b/lang/cpp11/non_static_data_member_initializers.md index 6764a34ba2..8e4b8cef1c 100644 --- a/lang/cpp11/non_static_data_member_initializers.md +++ b/lang/cpp11/non_static_data_member_initializers.md @@ -1,6 +1,14 @@ # 非静的メンバ変数の初期化 [N2756] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 非静的メンバ変数の定義時に、`=`演算子もしくは`{ }`波カッコ初期化子によるコンストラクタ構文で、初期化式を記述できる。 @@ -51,7 +59,7 @@ int main() ``` -## 関連項目 +## 関連項目 - [C++14 宣言時のメンバ初期化を持つ型の集成体初期化を許可](/lang/cpp14/member_initializers_and_aggregates.md) - [C++17 インライン変数](/lang/cpp17/inline_variables.md) - 静的メンバ変数は、インライン変数とすることで定義時に初期化できる @@ -64,4 +72,3 @@ int main() - [N2426 Class member initializers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2426.htm) - [N2628 Non-static data member initializers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2628.html) - [N2756 Non-static data member initializers](http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2008/n2756.htm) - diff --git a/lang/cpp11/nullptr.md b/lang/cpp11/nullptr.md index 6fa57226c0..4ba227a6d7 100644 --- a/lang/cpp11/nullptr.md +++ b/lang/cpp11/nullptr.md @@ -1,6 +1,14 @@ # nullptr [N2431] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 `nullptr`は、ヌルポインタ値を表すキーワードである。 @@ -115,7 +123,7 @@ private: これは言語機能ではなくライブラリで解決する案である。この案の問題としては、`nullptr`オブジェクトを使用する前に、ヘッダをインクルードしなければならない、というものがある。ヌルポインタ値は多くの一般的な状況で必要になるため、ヘッダをインクルードしない選択肢として、キーワードの`nullptr`が採用された。 -## 関連項目 +## 関連項目 - [`NULL`](/reference/cstddef/null.md) - [`nullptr_t`](/reference/cstddef/nullptr_t.md) @@ -125,4 +133,3 @@ private: - [N1601 A name for the null pointer: `nullptr` (revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1601.pdf) - [N2214 A name for the null pointer: `nullptr` (revision 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2214.pdf) - [N2431 A name for the null pointer: `nullptr` (revision 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf) - diff --git a/lang/cpp11/override_final.md b/lang/cpp11/override_final.md index 1959240449..154be55825 100644 --- a/lang/cpp11/override_final.md +++ b/lang/cpp11/override_final.md @@ -1,6 +1,14 @@ # overrideとfinal [N2928] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 `override`は仮想メンバ関数のオーバーライドを明示的に宣言するキーワードである。 @@ -410,7 +418,7 @@ struct D explicit : B - 以上の経緯を経てC++11では、`override`と`final`コンテキスト依存キーワードの追加のみが行われた。 -## 関連項目 +## 関連項目 - [`is_final`](/reference/type_traits/is_final.md) @@ -424,4 +432,4 @@ struct D explicit : B - [N3163 Override Control Using Contextual Keywords](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3163.pdf) - [N3206 Override control: Eliminating Attributes](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3206.htm) - [N3234 Remove explicit from class-head](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3234.pdf) -- [N3272 Follow-up on override control](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3272.htm) +- [N3272 Follow-up on override control](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3272.htm) \ No newline at end of file diff --git a/lang/cpp11/pragma_operator.md b/lang/cpp11/pragma_operator.md index ed565e3601..841aaca8d6 100644 --- a/lang/cpp11/pragma_operator.md +++ b/lang/cpp11/pragma_operator.md @@ -1,6 +1,14 @@ # Pragma演算子 [N1653] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 C99互換として、Pragma演算子が導入された。 @@ -66,4 +74,3 @@ int main() ## 参照 - [N1653 Working draft changes for C99 preprocessor synchronization](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm) - diff --git a/lang/cpp11/predefined_macros.md b/lang/cpp11/predefined_macros.md index 61deae3b4f..c5ebaaafdd 100644 --- a/lang/cpp11/predefined_macros.md +++ b/lang/cpp11/predefined_macros.md @@ -1,6 +1,14 @@ # 更新された定義済みマクロ * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 定義済みマクロの値が、以下のように更新された: @@ -19,7 +27,7 @@ | `__STDC_MB_MIGHT_NEQ_WC__` | このマクロが整数型の定数`1`として定義されている場合、基本文字集合に含まれる文字のリテラルが、`char`と`wchar_t`で異なる値を持つ可能性がある。
このマクロが定義されない場合には`'x' == L'x'`が`true`であることが保証され、そうでなければされない。 | -## 関連項目 +## 関連項目 - [C++11 C99互換で導入された定義済みマクロ](c99_predefined_macros.md) @@ -27,4 +35,4 @@ - [N2693 Requirements on programs and backwards compatibility](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2693.html) - [CWG Issue 1169. Missing feature macro for strict pointer safety](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1169) - [P2186R2 Removing Garbage Collection Support](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2186r2.html) - - C++23でのマクロ`__STDCPP_STRICT_POINTER_SAFETY__`削除 + - C++23でのマクロ`__STDCPP_STRICT_POINTER_SAFETY__`削除 \ No newline at end of file diff --git a/lang/cpp11/range_based_for.md b/lang/cpp11/range_based_for.md index 33a5db8681..2c8219c038 100644 --- a/lang/cpp11/range_based_for.md +++ b/lang/cpp11/range_based_for.md @@ -1,6 +1,14 @@ # 範囲for文 [N2930] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 範囲for文(The range-based for statement)は配列やコンテナを簡潔に扱うためのfor文の別表現である。 @@ -355,7 +363,7 @@ int main() また、C++23からは`for-range-initializer`の寿命が条件を満たせば延長されるようになったので([C++23 範囲for文が範囲初期化子内で生じた一時オブジェクトを延命することを規定](/lang/cpp23/lifetime_extension_in_range_based_for_loop.md))、この問題を踏みにくくなっている。 -## 関連項目 +## 関連項目 - [C++17 範囲forの制限緩和 — `begin` と `end` の型が異なることを許可](/lang/cpp17/generalizing_the_range-based_for_loop.md) - [C++20 範囲for文がカスタマイゼーションポイントを見つけるルールを緩和](/lang/cpp20/relaxing_the_range_for_loop_customization_point_finding_rules.md) @@ -366,4 +374,4 @@ int main() - [N2930 Range-Based For Loop Wording (Without Concepts)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2930.html) - [N3337 Working Draft, Standard for Programming Language C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3337.pdf) - [一時オブジェクトの寿命と右辺値参照、ムーブセマンティクスのお話 - Qiita](https://qiita.com/rinse_/items/ad0cc7e351e836595c94) -- [c++ - Safe to erase from map inside range based for? - Stack Overflow](https://stackoverflow.com/questions/25246937/safe-to-erase-from-map-inside-range-based-for) +- [c++ - Safe to erase from map inside range based for? - Stack Overflow](https://stackoverflow.com/questions/25246937/safe-to-erase-from-map-inside-range-based-for) \ No newline at end of file diff --git a/lang/cpp11/raw_string_literals.md b/lang/cpp11/raw_string_literals.md index a5b59af2f1..6fc3b8bdf9 100644 --- a/lang/cpp11/raw_string_literals.md +++ b/lang/cpp11/raw_string_literals.md @@ -1,6 +1,14 @@ # 生文字列リテラル [N2442] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 `R`プレフィックスを付けた文字列リテラル内の丸カッコ`( )`で囲まれた部分は、エスケープシーケンスが無視される。この機能を「生文字列リテラル (Raw string literals)」という。 @@ -266,4 +274,3 @@ Perl、Python、Luaやその他の言語ではこの問題に対応するため - [N2384 Raw and Unicode String Literals; Unified Proposal (Rev. 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2384.html) - [N2442 Raw and Unicode String Literals; Unified Proposal (Rev. 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm) - [N3077 Alternative approach to Raw String issues](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3077.html) - diff --git a/lang/cpp11/recursive_template_limit.md b/lang/cpp11/recursive_template_limit.md index c54d80ca5b..3834d8543f 100644 --- a/lang/cpp11/recursive_template_limit.md +++ b/lang/cpp11/recursive_template_limit.md @@ -1,6 +1,14 @@ # テンプレート再帰回数の制限緩和 * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 C++03まで、テンプレートの再帰回数は、「17回以上であることを実装に推奨する」というものであった。 @@ -60,4 +68,3 @@ int main() - テンプレートの再帰によって、コンパイル時間がどれくらい延びるかのレポートがある記事 - [C++ Language Features/Controlling implementation limits - Clang Compiler User’s Manual](http://clang.llvm.org/docs/UsersManual.html#cmdoption-ftemplate-depth) - [3.5 Options Controlling C++ Dialect - GCC Command Options](https://gcc.gnu.org/onlinedocs/gcc/gcc-command-options/options-controlling-c%2B%2B-dialect.html) - diff --git a/lang/cpp11/ref_qualifier_for_this.md b/lang/cpp11/ref_qualifier_for_this.md index 1d206e5e80..9a5ea25215 100644 --- a/lang/cpp11/ref_qualifier_for_this.md +++ b/lang/cpp11/ref_qualifier_for_this.md @@ -1,6 +1,14 @@ # メンバ関数の左辺値/右辺値修飾 [N2439] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 メンバ関数の`CV`修飾は、`*this`が`const`/`volatile`である場合とそうでない場合でメンバ関数をオーバーロードできる。 @@ -103,7 +111,7 @@ int main() ``` -## 関連項目 +## 関連項目 - [C++20 `const`修飾されたメンバポインタの制限を修正](/lang/cpp20/fixing_const_qualified_pointers_to_members.md) @@ -112,4 +120,3 @@ int main() - [N1821 Extending Move Semantics To `*this` (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1821.htm) - [N2377 Extending move semantics to `*this` (revised wording)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2377.htm) - [N2439 Extending move semantics to `*this` (revised wording)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2439.htm) - diff --git a/lang/cpp11/reference_collapsing.md b/lang/cpp11/reference_collapsing.md index 89a56e73a5..6fc14ffe85 100644 --- a/lang/cpp11/reference_collapsing.md +++ b/lang/cpp11/reference_collapsing.md @@ -1,6 +1,14 @@ # 参照への参照を折りたたむ * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 C++03までは、`T&`型に左辺値参照を足すと、「参照への参照 (reference to reference)」となってしまいコンパイルエラーとなっていた。 @@ -45,4 +53,4 @@ int main() ## 参照 -- [CWG Issue 988. Reference-to-reference collapsing with decltype](https://wg21.cmeerw.net/cwg/issue988) +- [CWG Issue 988. Reference-to-reference collapsing with decltype](https://wg21.cmeerw.net/cwg/issue988) \ No newline at end of file diff --git a/lang/cpp11/remove_export_templates.md b/lang/cpp11/remove_export_templates.md index b77cc7a2cd..30b93e30cd 100644 --- a/lang/cpp11/remove_export_templates.md +++ b/lang/cpp11/remove_export_templates.md @@ -1,6 +1,14 @@ # テンプレートのエクスポート機能を削除 * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 C++11では、テンプレート定義をエクスポートする機能を削除する。 @@ -33,4 +41,3 @@ EDGフロントエンドとそれを使用するコンパイラのComeauとICC - [CWG Issue 820. Deprecation of export](https://wg21.cmeerw.net/cwg/issue820) - [Using export keyword with templates - StackOverflow](http://stackoverflow.com/questions/5416872/using-export-keyword-with-templates) - [N1426 Why We Can't Afford Export](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1426.pdf) - diff --git a/lang/cpp11/reserved_namespaces_for_posix.md b/lang/cpp11/reserved_namespaces_for_posix.md index e416fda36b..5b709ded2e 100644 --- a/lang/cpp11/reserved_namespaces_for_posix.md +++ b/lang/cpp11/reserved_namespaces_for_posix.md @@ -1,6 +1,14 @@ # POSIX用の名前空間を予約 * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 将来の標準化のために、POSIX用の名前空間として`std::posix`と`::posix`を予約する。 @@ -9,4 +17,3 @@ ## 参照 - [N2542 Reserved namespaces for POSIX](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2542.htm) - diff --git a/lang/cpp11/result_of_integer_division_and_modulo.md b/lang/cpp11/result_of_integer_division_and_modulo.md index d48980cc8e..82d8388aae 100644 --- a/lang/cpp11/result_of_integer_division_and_modulo.md +++ b/lang/cpp11/result_of_integer_division_and_modulo.md @@ -1,6 +1,14 @@ # 整数に対する除算と剰余算の丸め結果を規定 * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 整数`a`, `b`に対する除算`a/b`の結果(商)と剰余算`a%b`の結果(余り)について`(a/b)*b + a%b = a`という等式が成り立つことが規定されているが、C++03まで、少なくとも一方が負の数である場合の余りの符号は実装定義だった。このため先述の等式により商も実装定義となっていた。C++11ではC99に合わせて「商の小数部がゼロ方向に切り捨てられた結果となること」が規定された。 @@ -40,4 +48,3 @@ int main() - [N2730 Expedited core issues handling (revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2730.html) - [N2757 Expedited core issues handling (revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2757.htm) - [C++ における整数型の怪と "移植性のある" オーバーフローチェッカー (第1回 : 整数型の怪と対策の不足)](http://qiita.com/a4lg/items/541c9d9dd5d874eeef2f) - diff --git a/lang/cpp11/right_angle_brackets.md b/lang/cpp11/right_angle_brackets.md index 51ce4ae734..3af3608e6e 100644 --- a/lang/cpp11/right_angle_brackets.md +++ b/lang/cpp11/right_angle_brackets.md @@ -1,6 +1,14 @@ # テンプレートの右山カッコ [N1757] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 C++03では、2つ以上連続する右山カッコが出現する場合には、間にスペースを入力する必要があった: @@ -100,4 +108,3 @@ C++11で採択された方式は、テンプレートの型パラメータと非 - [N1649 Right Angle Brackets](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1649.html) - [N1699 Right Angle Brackets (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1699.html) - [N1757 Right Angle Brackets (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html) - diff --git a/lang/cpp11/rvalue_ref_and_move_semantics.md b/lang/cpp11/rvalue_ref_and_move_semantics.md index 4a59d7ee48..cb2b68cabd 100644 --- a/lang/cpp11/rvalue_ref_and_move_semantics.md +++ b/lang/cpp11/rvalue_ref_and_move_semantics.md @@ -1,6 +1,14 @@ # 右辺値参照・ムーブセマンティクス [N2118] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 ムーブセマンティクスはコピーコストの削減を主な目的としており、また所有権の移動を実現する。 右辺値参照はムーブ元のオブジェクト(右辺値)を束縛するための言語機能である。 @@ -374,7 +382,7 @@ C++11で非推奨となった`std::auto_ptr`で実現されていた。 -## 関連項目 +## 関連項目 - [`move`](/reference/utility/move.md) - [`forward`](/reference/utility/forward.md) - [`move_if_noexcept`](/reference/utility/move_if_noexcept.md) @@ -402,4 +410,4 @@ C++11で非推奨となった`std::auto_ptr`で実現されていた。 - [N2983 Allowing Move Constructors to Throw](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2983.html) - ムーブコンストラクタから例外を送出することを許可した経緯 - [P0135R0 Wording for guaranteed copy elision through simplified value categories](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0135r1.html) - - C++17 値カテゴリの定義 + - C++17 値カテゴリの定義 \ No newline at end of file diff --git a/lang/cpp11/scoped_enum.md b/lang/cpp11/scoped_enum.md index 8c214254fe..bc506220e2 100644 --- a/lang/cpp11/scoped_enum.md +++ b/lang/cpp11/scoped_enum.md @@ -1,6 +1,14 @@ # スコープを持つ列挙型 [N2347] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 `enum class`で定義した列挙型は、従来の`enum`に加えて、「整数型への暗黙の型変換を行わない」「列挙型のスコープを持つ」という機能を持つ。 @@ -90,7 +98,7 @@ C++03は、C99の列挙型に対する改善は提供していたが、依然と ECMA規格になっているC++/CLIが、現在のスコープを持つ列挙型と等価の機能を持っていたために、その経験を標準C++に取り入れることとなった。 -## 関連項目 +## 関連項目 - [`underlying_type`](/reference/type_traits/underlying_type.md) @@ -101,4 +109,3 @@ ECMA規格になっているC++/CLIが、現在のスコープを持つ列挙型 - [N2213 Strongly Typed Enums (revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2213.pdf) - [N2347 Strongly Typed Enums (revision 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf) - [N2499 Forward declaration of enumerations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2499.pdf) - diff --git a/lang/cpp11/sfinae_expressions.md b/lang/cpp11/sfinae_expressions.md index c87e8a5f9e..e5aad73b10 100644 --- a/lang/cpp11/sfinae_expressions.md +++ b/lang/cpp11/sfinae_expressions.md @@ -1,6 +1,14 @@ # 任意の式によるSFINAE [N2634] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 「SFINAE (Substitution Failure Is Not An Errorの略称、スフィネェと読む)」は、テンプレートの置き換えに失敗した際に、即時にコンパイルエラーとはせず、置き換えに失敗した関数をオーバーロード解決の候補から除外するという言語機能である。 @@ -268,7 +276,7 @@ int main() ``` -## 関連項目 +## 関連項目 - [``](/reference/type_traits.md) - [`declval`](/reference/utility/declval.md) - [`enable_if`](/reference/type_traits/enable_if.md) @@ -277,4 +285,3 @@ int main() ## 参照 - [CWG Issue 339. Overload resolution in operand of `sizeof` in constant expression](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#339) - [N2634 Solving the SFINAE problem for expressions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2634.html) - diff --git a/lang/cpp11/static_assert.md b/lang/cpp11/static_assert.md index a7de6eaec4..3257a8f391 100644 --- a/lang/cpp11/static_assert.md +++ b/lang/cpp11/static_assert.md @@ -1,6 +1,14 @@ # コンパイル時アサート [N1720] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 `static_assert`宣言は、指定した定数式が真であることを表明するための機能である。 @@ -78,7 +86,7 @@ Boost Static Assertion Libraryが開発されたときに、コンパイル時 コンパイル時アサートのために`BOOST_STATIC_ASSERT`や`STATIC_CHECK`のようなマクロを使用することは、名前空間を汚染する問題があるが、コア言語にその機能を追加することでその問題は解消される。 -## 関連項目 +## 関連項目 - [C++17 `static_assert`のメッセージ省略を許可](/lang/cpp17/extending_static_assert.md) - [C++17 constexpr if 文](/lang/cpp17/if_constexpr.md) - [C++23 定数式の文脈での`bool`への縮小変換を許可](/lang/cpp23/narrowing_contextual_conversions_to_bool.md) @@ -91,4 +99,4 @@ Boost Static Assertion Libraryが開発されたときに、コンパイル時 - [N1617 Proposal to Add Static Assertions to the Core Language (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1617.html) - [N1720 Proposal to Add Static Assertions to the Core Language (Revision 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1720.html) - [P2593R1: Allowing static_assert(false)](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2593r1.html) -- [Issue 2518: Conformance requirements and #error/#warning - WG21 CWG Issues](https://wg21.cmeerw.net/cwg/issue2518) +- [Issue 2518: Conformance requirements and #error/#warning - WG21 CWG Issues](https://wg21.cmeerw.net/cwg/issue2518) \ No newline at end of file diff --git a/lang/cpp11/static_initialization_thread_safely.md b/lang/cpp11/static_initialization_thread_safely.md index c1a11b39a2..c5c4af8681 100644 --- a/lang/cpp11/static_initialization_thread_safely.md +++ b/lang/cpp11/static_initialization_thread_safely.md @@ -1,6 +1,14 @@ # ブロックスコープを持つstatic変数初期化のスレッドセーフ化 [N2660] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 ブロックスコープを持つ`static`変数の初期化は、スレッドセーフであることが規定された。 @@ -97,4 +105,3 @@ int main() - [N2513 Dynamic Initialization and Destruction with Concurrency](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2513.html) - [N2660 Dynamic Initialization and Destruction with Concurrency](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2660.htm) - [C++0x時代の Double-Checked Locking - yamasaのネタ帳](http://yamasa.hatenablog.jp/entry/20100128/1264693781) - diff --git a/lang/cpp11/string_literal_concatenation.md b/lang/cpp11/string_literal_concatenation.md index c314155ad8..3329ed51a9 100644 --- a/lang/cpp11/string_literal_concatenation.md +++ b/lang/cpp11/string_literal_concatenation.md @@ -1,6 +1,14 @@ # 文字列リテラルとワイド文字列リテラルの結合 * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 C99互換として、文字列リテラルとワイド文字列リテラルが並んでいたとき、ワイド文字列リテラルとして結合することが規定された。 @@ -33,4 +41,3 @@ hello world ## 参照 - [N1653 Working draft changes for C99 preprocessor synchronization](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm) - [WG14/N951 String literals and concatenation](http://www.open-std.org/jtc1/sc22/wg14/www/docs/n951.htm) - diff --git a/lang/cpp11/thread_local_storage.md b/lang/cpp11/thread_local_storage.md index 66df732936..bfaa7f0dbd 100644 --- a/lang/cpp11/thread_local_storage.md +++ b/lang/cpp11/thread_local_storage.md @@ -1,6 +1,14 @@ # スレッドローカルストレージ [N2659] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 変数宣言の際に、記憶域として`thread_local`キーワードを指定することで、スレッドごとの静的記憶域に変数が保持される。 @@ -100,7 +108,7 @@ thread2 : 4 各ベンダーのこれらの経験を標準C++に導入することとなった。 -## 関連項目 +## 関連項目 - [`exit`](/reference/cstdlib/exit.md) - [`quick_exit`](/reference/cstdlib/quick_exit.md) - [`_at_thread_exit`系の関数が存在している理由](/article/lib/at_thread_exit.md) @@ -115,4 +123,3 @@ thread2 : 4 - [N2659 Thread-Local Storage](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2659.htm) - [Why does Apple clang disallow C++11 `thread_local` when 'official' clang supports it - Stack Overflow](http://stackoverflow.com/a/29929949/463412) - Apple実装のClang(Xcode 7以下に付属のもの)が`thread_local`機能をサポートしない理由 - diff --git a/lang/cpp11/trailing_comma_following_enumerator_list.md b/lang/cpp11/trailing_comma_following_enumerator_list.md index 93558afd55..5e81e5ead5 100644 --- a/lang/cpp11/trailing_comma_following_enumerator_list.md +++ b/lang/cpp11/trailing_comma_following_enumerator_list.md @@ -1,6 +1,14 @@ # 列挙子の末尾へのカンマ付加を許可 * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 C99互換として、末尾の列挙子の後ろにカンマを書くことが許可された。 @@ -41,4 +49,3 @@ int main() {} ## 参照 - [CWG Issue 518. Trailing comma following enumerator-list](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#518) - diff --git a/lang/cpp11/trailing_return_types.md b/lang/cpp11/trailing_return_types.md index efee5fa5aa..15000efa52 100644 --- a/lang/cpp11/trailing_return_types.md +++ b/lang/cpp11/trailing_return_types.md @@ -1,6 +1,14 @@ # 戻り値の型を後置する関数宣言構文 [N2541] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 従来の関数宣言構文では、戻り値の型は先頭に記述していた。 @@ -100,7 +108,7 @@ auto f = [](int a, int b) -> int { return a + b; } しかし、この構文は採用されなかった。ラムダ導入子は関数宣言構文にとってはただのマーキングであり機能を持たないが、`auto`の場合はプレースホルダーであるために、将来的にそれを`auto*`、`auto&`のように、置き換えられる戻り値の型をさらに修飾できるようにするためである。 -## 関連項目 +## 関連項目 - [C++14 通常関数の戻り値型推論](/lang/cpp14/return_type_deduction_for_normal_functions.md) @@ -113,4 +121,3 @@ auto f = [](int a, int b) -> int { return a + b; } - ラムダ式の仕様と合わせて「trailing-return-type」という言葉が使われるようになった - [N2931 Unified Function Syntax](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2931.html) - [N2954 Unified Function Syntax](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2954.html) - diff --git a/lang/cpp11/uniform_initialization.md b/lang/cpp11/uniform_initialization.md index 5475183cf8..71d8d3190e 100644 --- a/lang/cpp11/uniform_initialization.md +++ b/lang/cpp11/uniform_initialization.md @@ -1,6 +1,14 @@ # 一様初期化 [N2672] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 「一様初期化 (uniform initialization)」は、コンストラクタの呼び出しを、リスト初期化と合わせて波カッコ `{ }`で記述する構文である。 @@ -189,7 +197,7 @@ int main() ``` -## 関連項目 +## 関連項目 - [C++11 初期化子リスト](initializer_lists.md) @@ -200,4 +208,3 @@ int main() - [N2640 Initializer Lists - Alternative Mechanism and Rationale (v. 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2640.pdf) - [N2672 Initializer List proposed wording](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm) - [CWG Issue 1030. Evaluation order in initializer-lists used in aggregate initialization](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1030) - diff --git a/lang/cpp11/unrestricted_unions.md b/lang/cpp11/unrestricted_unions.md index afc3fa54a5..5075981211 100644 --- a/lang/cpp11/unrestricted_unions.md +++ b/lang/cpp11/unrestricted_unions.md @@ -1,6 +1,14 @@ # 共用体の制限解除 [N2544] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 共用体のメンバ変数として、クラスオブジェクトを保持できるようになった: @@ -67,4 +75,3 @@ hello - [N2430 Unrestricted Unions (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2430.pdf) - [N2544 Unrestricted Unions (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf) - [Boost Variant Library](http://www.boost.org/libs/variant) - diff --git a/lang/cpp11/user_defined_literals.md b/lang/cpp11/user_defined_literals.md index 7d1c89ca11..f7bf4a324e 100644 --- a/lang/cpp11/user_defined_literals.md +++ b/lang/cpp11/user_defined_literals.md @@ -1,6 +1,14 @@ # ユーザー定義リテラル [N2765] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 ユーザー定義リテラル(User-defined literals)は、`123`、`3.14`、`"hello"`といったリテラルに対して付けられるサフィックスをオーバーロードできるようにすることで、ユーザーがリテラルに意味を持たせられるようにする機能である。 @@ -356,7 +364,7 @@ DecimalFloat f = 12.34df; リテラル名がサフィックスであることを明示的にするために、今日の`DecimalFloat operator"" df(long double)`という形式になった。 -## 関連項目 +## 関連項目 - [C++14 リテラル演算子のスペースを省略可能とする](/lang/cpp14/no_whitespace_literal_operators.md) - [`std::basic_string`の文字列リテラル`s`](/reference/string/basic_string/op_s.md) - [`std::complex`の浮動小数点数リテラル`if`](/reference/complex/complex/op_if.md) @@ -379,4 +387,3 @@ DecimalFloat f = 12.34df; - [N2765 User-defined Literals (aka. Extensible Literals (revision 5))](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2765.pdf) - [CWG Issue 935. Missing overloads for character types for user-defined literals](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#935) - [CWG Issue 1479. Literal operators and default arguments](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1479) - diff --git a/lang/cpp11/utf8_string_literals.md b/lang/cpp11/utf8_string_literals.md index a1f8bd9d33..076b4d9e0f 100644 --- a/lang/cpp11/utf8_string_literals.md +++ b/lang/cpp11/utf8_string_literals.md @@ -1,6 +1,14 @@ # UTF-8文字列リテラル [N2442] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 `char`の文字列リテラルに`u8`プレフィックスを付けることで、その文字列リテラルはUCS/Unicode文字コードのUTF-8符号化形式にエンコードされる。 @@ -62,7 +70,7 @@ int main() ``` -## 関連項目 +## 関連項目 - [C++11 `char16_t`と`char32_t`](char16_32.md) - [C++17 UTF-8文字リテラル](/lang/cpp17/utf8_character_literals.md) - [C++20 UTF-8エンコーディングされた文字の型として`char8_t`を追加](/lang/cpp20/char8_t.md) @@ -76,4 +84,3 @@ int main() - [N2295 Raw and Unicode String Literals; Unified Proposal](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2295.html) - [N2384 Raw and Unicode String Literals; Unified Proposal (Rev. 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2384.html) - [N2442 Raw and Unicode String Literals; Unified Proposal (Rev. 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm) - diff --git a/lang/cpp11/variadic_macros.md b/lang/cpp11/variadic_macros.md index afa3077f50..28027f2c21 100644 --- a/lang/cpp11/variadic_macros.md +++ b/lang/cpp11/variadic_macros.md @@ -1,6 +1,14 @@ # 可変引数マクロ [N1653] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C99互換として、可変引数マクロ(variadic macros)が導入された。 @@ -69,11 +77,10 @@ f2 ``` -## 関連項目 +## 関連項目 - [C++11 可変引数テンプレート](variadic_templates.md) - [C++20 可変引数が空でない場合のトークン置換](/lang/cpp20/va_opt.md) ## 参照 - [N1653 Working draft changes for C99 preprocessor synchronization](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm) - diff --git a/lang/cpp11/variadic_templates.md b/lang/cpp11/variadic_templates.md index fdbabf6b1f..0f44f02a00 100644 --- a/lang/cpp11/variadic_templates.md +++ b/lang/cpp11/variadic_templates.md @@ -1,6 +1,14 @@ # 可変引数テンプレート [N2242] * cpp11[meta cpp] +<-- start lang caution --> + +このページはC++11に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 「可変引数テンプレート (variadic templates)」は、任意の型とそのオブジェクトを任意の数だけ受け取る機能である。これによって、「最大でN個のパラメータを受け取る関数テンプレートやクラステンプレート」を実装する際に、N個のオーバーロードをユーザーが用意する必要なく、ひとつの実装だけで済むようになる。 @@ -378,7 +386,7 @@ void f(const T1& t1, const T2& t2, const T3& t3); この問題を解決するために、任意の数だけ任意の型のパラメータを受け取る機能が必要とされ、可変引数テンプレートが導入された。 -## 関連項目 +## 関連項目 - [C++11 可変引数マクロ](variadic_macros.md) - [C++17 畳み込み式](/lang/cpp17/folding_expressions.md) - [C++26 パラメータパックへのインデックスアクセスを許可](/lang/cpp26/pack_indexing.md.nolink) @@ -394,4 +402,3 @@ void f(const T1& t1, const T2& t2, const T3& t3); - [N2242 Proposed Wording for Variadic Templates (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2242.pdf) - [N2488 Extending Variadic Template Template Parameters](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2488.pdf) - [N2555 Extending Variadic Template Template Parameters (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2555.pdf) - diff --git a/lang/cpp14/binary_literals.md b/lang/cpp14/binary_literals.md index b0860f37f3..1eb8531ae1 100644 --- a/lang/cpp14/binary_literals.md +++ b/lang/cpp14/binary_literals.md @@ -1,6 +1,14 @@ # 2進数リテラル [N3472] * cpp14[meta cpp] +<-- start lang caution --> + +このページはC++14に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 整数リテラルのプレフィックスとして`0b`もしくは`0B`を付けることで、2進数を表す値を記述できる。 @@ -55,11 +63,10 @@ int main() こういった経緯から、C++標準で2進数リテラルをサポートすることとなった。 -## 関連項目 +## 関連項目 - [C++14 数値リテラルの桁区切り文字](digit_separators.md) - [`bitset`](/reference/bitset/bitset.md) ## 参照 - [N3472 - Binary Literals in the C++ Core Language](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3472.pdf) - diff --git a/lang/cpp14/brace_elision_in_array_temporary_initialization.md b/lang/cpp14/brace_elision_in_array_temporary_initialization.md index 41e8c36558..933d86d429 100644 --- a/lang/cpp14/brace_elision_in_array_temporary_initialization.md +++ b/lang/cpp14/brace_elision_in_array_temporary_initialization.md @@ -1,6 +1,14 @@ # ネストする集成体初期化における波カッコ省略を許可 [N3653] * cpp14[meta cpp] +<-- start lang caution --> + +このページはC++14に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 C++11では、集成体初期化とリスト初期化の両方を含む場合、二重に波カッコを書くことが必須となっていた。そのため、`public`メンバ変数として組み込み配列を持つ[`std::array`](/reference/array/array.md)クラスのオブジェクトを初期化する場合、以下のように、不要とも思える二重の波カッコを書かなければならなかった: @@ -35,4 +43,3 @@ int x[2][2] = {1, 2, 3, 4}; - [vector/arrayとUniform initialization+Initializer list - yohhoyの日記](http://d.hatena.ne.jp/yohhoy/20120724/p1) - [initializer-listによるaggregate初期化の制約緩和 - yohhoyの日記](http://d.hatena.ne.jp/yohhoy/20131116/p1) - [N3653 - Member initializers and aggregates](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3653.html) - diff --git a/lang/cpp14/clarifying_memory_allocation.md b/lang/cpp14/clarifying_memory_allocation.md index 80c321ce01..8008b72c01 100644 --- a/lang/cpp14/clarifying_memory_allocation.md +++ b/lang/cpp14/clarifying_memory_allocation.md @@ -1,6 +1,14 @@ # 動的メモリ確保の省略の許可 * cpp14[meta cpp] +<-- start lang caution --> + +このページはC++14に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 以前の仕様では、`new`式による動的メモリ確保はコードに書かれた通りに実行されなければならず、ひとまとめにしたり省略したりすることはできなかった。 @@ -149,7 +157,7 @@ C++11時点で既に、そのような最適化を行うメモリアロケータ それによって、ミクロな範囲での`new/delete`式の省略が許可され、マクロな範囲の様々な情報を考慮してそれを行う事が可能となった。 -## 関連項目 +## 関連項目 - [C++20 可変サイズをもつコンテナの`constexpr`化](/lang/cpp20/more_constexpr_containers.md) @@ -157,4 +165,4 @@ C++11時点で既に、そのような最適化を行うメモリアロケータ ## 参照 - [N3664 Clarifying Memory Allocation](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3664.html) -- [C++14言語編 - slideshare](https://www.slideshare.net/kariya_mitsuru/c14-84084931) +- [C++14言語編 - slideshare](https://www.slideshare.net/kariya_mitsuru/c14-84084931) \ No newline at end of file diff --git a/lang/cpp14/decltype_auto.md b/lang/cpp14/decltype_auto.md index 9ef4f775a3..40ce597d19 100644 --- a/lang/cpp14/decltype_auto.md +++ b/lang/cpp14/decltype_auto.md @@ -1,6 +1,14 @@ # decltype(auto) * cpp14[meta cpp] +<-- start lang caution --> + +このページはC++14に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 `decltype(auto)`は、`decltype`に与える式を右辺の式で置き換えて型推論する機能である。 @@ -64,6 +72,5 @@ int main() `decltype(auto)`は、C++14で導入された「[通常関数の戻り値型推論](return_type_deduction_for_normal_functions.md)」の機能で、参照の変数を参照のまま`return`文で返せるようにするために導入された。 -## 関連項目 +## 関連項目 - [C++14 通常関数の戻り値型推論](return_type_deduction_for_normal_functions.md) - diff --git a/lang/cpp14/deprecated_attr.md b/lang/cpp14/deprecated_attr.md index 3491ccfb9c..4322cce795 100644 --- a/lang/cpp14/deprecated_attr.md +++ b/lang/cpp14/deprecated_attr.md @@ -1,6 +1,14 @@ # [[deprecated]]属性 [N3760] * cpp14[meta cpp] +<-- start lang caution --> + +このページはC++14に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 `[[deprecated]]`は、対象となる機能が非推奨であることを示す属性である。 @@ -121,7 +129,7 @@ prog.cc:45:3: warning: 'class_templ' is deprecated: don't use class_templ関連項目 - [C++11 属性構文](/lang/cpp11/attributes.md) - [C++23 ラムダ式に対する属性](/lang/cpp23/attributes_on_lambda_expressions.md) @@ -129,4 +137,3 @@ prog.cc:45:3: warning: 'class_templ' is deprecated: don't use class_templ + +このページはC++14に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 整数リテラルと浮動小数点数リテラルには、途中にシングルクォーテーション(`'`)を入力することで、値を読みやすくできる。 @@ -120,7 +128,7 @@ C++14という言語バージョンは、C++11の仕様に対するバグ修正 これらが検討された上で、上付きカンマと見なせるシングルクォーテーション(`'`)が採用された。 -## 関連項目 +## 関連項目 - [C++14 2進数リテラル](binary_literals.md) @@ -136,4 +144,3 @@ C++14という言語バージョンは、C++11の仕様に対するバグ修正 - Java 7 : [Underscores in Numeric Literals](http://docs.oracle.com/javase/7/docs/technotes/guides/language/underscores-literals.html) - Ada : [Ada '83 Language Reference Manual](http://archive.adaic.com/standards/83lrm/html/lrm-02-04.html#2.4) - diff --git a/lang/cpp14/feature_test_macros.md b/lang/cpp14/feature_test_macros.md index 22c7641c9b..8843b34b0f 100644 --- a/lang/cpp14/feature_test_macros.md +++ b/lang/cpp14/feature_test_macros.md @@ -1,6 +1,14 @@ # 機能テストマクロ * cpp14[meta cpp] +<-- start lang caution --> + +このページはC++14に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 SD-6 は C++14 の機能について以下のテストマクロを定義することを推奨している: @@ -40,4 +48,4 @@ SD-6 は C++14 の機能について以下のテストマクロを定義する | `__has_include()` | `1` | [共有ロック](/reference/shared_mutex.md) | predefined | ## 参照 -- [SD-6: SG10 Feature Test Recommendations: Standard C++](https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations#recs.cpp14) +- [SD-6: SG10 Feature Test Recommendations: Standard C++](https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations#recs.cpp14) \ No newline at end of file diff --git a/lang/cpp14/generic_lambdas.md b/lang/cpp14/generic_lambdas.md index d92b15b61d..d61ead3ca5 100644 --- a/lang/cpp14/generic_lambdas.md +++ b/lang/cpp14/generic_lambdas.md @@ -1,6 +1,14 @@ # ジェネリックラムダ [N3649] * cpp14[meta cpp] +<-- start lang caution --> + +このページはC++14に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 ジェネリックラムダ(generic lambdas)は、[C++11のラムダ式](/lang/cpp11/lambda_expressions.md)を拡張して、パラメータにテンプレートを使用できるようにした機能である。 @@ -120,7 +128,7 @@ HelloWorld これが現在`auto`を書くようになったのは、可読性のためである。 -## 関連項目 +## 関連項目 - [C++11 ラムダ式](/lang/cpp11/lambda_expressions.md) - [C++14 ラムダ式の初期化キャプチャ](initialize_capture.md) - [C++14 通常関数の戻り値型推論](return_type_deduction_for_normal_functions.md) @@ -131,4 +139,4 @@ HelloWorld ## 参照 - [N3418 Proposal for Generic (Polymorphic) Lambda Expressions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3418.pdf) - [N3559 Proposal for Generic (Polymorphic) Lambda Expressions (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3559.pdf) -- [N3649 Generic (Polymorphic) Lambda Expressions (Revision 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3649.html) +- [N3649 Generic (Polymorphic) Lambda Expressions (Revision 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3649.html) \ No newline at end of file diff --git a/lang/cpp14/initialize_capture.md b/lang/cpp14/initialize_capture.md index 4b984b47cb..33e66ae6d8 100644 --- a/lang/cpp14/initialize_capture.md +++ b/lang/cpp14/initialize_capture.md @@ -1,6 +1,14 @@ # ラムダ式の初期化キャプチャ [N3648] * cpp14[meta cpp] +<-- start lang caution --> + +このページはC++14に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 「初期化キャプチャ(init-capture)」は、任意の式の結果をラムダ式にキャプチャする機能である。 @@ -137,7 +145,7 @@ int main() ``` -## 関連項目 +## 関連項目 - [C++11 ラムダ式](/lang/cpp11/lambda_expressions.md) - [C++14 ジェネリックラムダ](generic_lambdas.md) @@ -145,4 +153,3 @@ int main() ## 参照 - [N3610 Generic lambda-capture initializers, supporting capture-by-move](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3610.html) - [N3648 Wording Changes for Generalized Lambda-capture](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3648.html) - diff --git a/lang/cpp14/member_initializers_and_aggregates.md b/lang/cpp14/member_initializers_and_aggregates.md index 9e1e855e8a..22fbd8d0ac 100644 --- a/lang/cpp14/member_initializers_and_aggregates.md +++ b/lang/cpp14/member_initializers_and_aggregates.md @@ -1,6 +1,14 @@ # 宣言時のメンバ初期化を持つ型の集成体初期化を許可 * cpp14[meta cpp] +<-- start lang caution --> + +このページはC++14に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++11で導入された[メンバ初期化子](/lang/cpp11/non_static_data_member_initializers.md)は集成体の初期化と組み合わせて使用することができない問題があった。 @@ -27,9 +35,8 @@ int main() - 集成体の定義として「非静的メンバ変数の初期化をもたない」ことが条件になっていたが、それを削除 -## 関連項目 +## 関連項目 - [C++11 非静的メンバ変数の初期化](/lang/cpp11/non_static_data_member_initializers.md) ## 参照 - [N3653 - Member initializers and aggregates](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3653.html) - diff --git a/lang/cpp14/no_whitespace_literal_operators.md b/lang/cpp14/no_whitespace_literal_operators.md index 10641a0932..4688dcf095 100644 --- a/lang/cpp14/no_whitespace_literal_operators.md +++ b/lang/cpp14/no_whitespace_literal_operators.md @@ -1,6 +1,14 @@ # リテラル演算子のスペースを省略可能とする * cpp14[meta cpp] +<-- start lang caution --> + +このページはC++14に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 リテラル演算子を定義する際に、これまでは以下のように、`operator""`とサフィックス名の間に、ひとつ以上のスペースが必要だった。 @@ -43,10 +51,9 @@ hello ``` -## 関連項目 +## 関連項目 - [C++11 ユーザー定義リテラル](/lang/cpp11/user_defined_literals.md) ## 参照 - [CWG Issue 1473. Syntax of literal-operator-id](https://wg21.cmeerw.net/cwg/issue1473) - diff --git a/lang/cpp14/nontype_template_parameters_of_type_nullptr_t.md b/lang/cpp14/nontype_template_parameters_of_type_nullptr_t.md index 0350fdf354..560705c708 100644 --- a/lang/cpp14/nontype_template_parameters_of_type_nullptr_t.md +++ b/lang/cpp14/nontype_template_parameters_of_type_nullptr_t.md @@ -1,6 +1,14 @@ # nullptr_t型の定数式を非型テンプレートパラメータとすることを許可 * cpp14[meta cpp] +<-- start lang caution --> + +このページはC++14に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 [`nullptr_t`](/reference/cstddef/nullptr_t.md)型の定数式を非型テンプレートパラメータとすることが許可された。 @@ -23,10 +31,9 @@ int main() ``` -## 関連項目 +## 関連項目 - [C++11 `nullptr`](/lang/cpp11/nullptr.md) ## 参照 - [CWG Issue 1398. Non-type template parameters of type `std::nullptr_t`](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1398) - diff --git a/lang/cpp14/placeholder_type_in_trailing_return_type.md b/lang/cpp14/placeholder_type_in_trailing_return_type.md index 502bdca23b..f6a5a0b704 100644 --- a/lang/cpp14/placeholder_type_in_trailing_return_type.md +++ b/lang/cpp14/placeholder_type_in_trailing_return_type.md @@ -1,6 +1,14 @@ # 後置戻り値型をプレースホルダーにすることを許可 * cpp14[meta cpp] +<-- start lang caution --> + +このページはC++14に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 [戻り値の型を後置する関数宣言構文](/lang/cpp11/trailing_return_types.md)と[ラムダ式](/lang/cpp11/lambda_expressions.md)の、後置戻り値型(trailing return type)を`auto`プレースホルダーとし、そのプレースホルダーを修飾することで、戻り値型の推論を補助できる。 @@ -47,7 +55,6 @@ int main() この機能は、C++14で導入された「[通常関数の戻り値型推論](return_type_deduction_for_normal_functions.md)」の機能において、ラムダ式から参照の戻り値を返すことを目的として導入された。 -## 関連項目 +## 関連項目 - [C++14 通常関数の戻り値型推論](return_type_deduction_for_normal_functions.md) - diff --git a/lang/cpp14/predefined_macros.md b/lang/cpp14/predefined_macros.md index 32c1e562e9..54d5dfbd3c 100644 --- a/lang/cpp14/predefined_macros.md +++ b/lang/cpp14/predefined_macros.md @@ -1,6 +1,14 @@ # 更新された定義済みマクロ * cpp14[meta cpp] +<-- start lang caution --> + +このページはC++14に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 定義済みマクロの値が、以下のように更新された: @@ -8,4 +16,3 @@ | マクロ名 | 値 | 説明 | |---------------|-----------|-------------------------| | `__cplusplus` | `201402L` | C++のバージョン値を表す | - diff --git a/lang/cpp14/relaxing_constraints_on_constexpr.md b/lang/cpp14/relaxing_constraints_on_constexpr.md index c6d840d01d..cc3d664265 100644 --- a/lang/cpp14/relaxing_constraints_on_constexpr.md +++ b/lang/cpp14/relaxing_constraints_on_constexpr.md @@ -1,6 +1,14 @@ # constexprの制限緩和 [N3652] * cpp14[meta cpp] +<-- start lang caution --> + +このページはC++14に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++11で、汎用定数式の機能である[`constexpr`](/lang/cpp11/constexpr.md)が導入された。 @@ -197,7 +205,7 @@ C++は直交性を重視して設計されており、直接関係ない機能 C++14では、`constexpr`関数、`constexpr`メンバ関数、暗黙の`const`といった制限を緩和する。 -## 関連項目 +## 関連項目 - [C++11 `constexpr`](/lang/cpp11/constexpr.md) @@ -205,4 +213,3 @@ C++14では、`constexpr`関数、`constexpr`メンバ関数、暗黙の`const` - [N3597 Relaxing constraints on `constexpr` functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3597.html) - [N3598 `constexpr` member functions and implicit `const`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3598.html) - [N3652 Relaxing constraints on `constexpr` functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3652.html) - diff --git a/lang/cpp14/return_type_deduction_for_normal_functions.md b/lang/cpp14/return_type_deduction_for_normal_functions.md index f2434536c5..040f506be8 100644 --- a/lang/cpp14/return_type_deduction_for_normal_functions.md +++ b/lang/cpp14/return_type_deduction_for_normal_functions.md @@ -1,6 +1,14 @@ # 通常関数の戻り値型推論 [N3638] * cpp14[meta cpp] +<-- start lang caution --> + +このページはC++14に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 関数宣言の構文において、先頭の戻り値型を`auto`もしくは[`decltype(auto)`](decltype_auto.md)とすることで、戻り値の型が関数の`return`文から推論される。 @@ -224,7 +232,7 @@ auto g(F f) { return f(); } [戻り値の型を後置する関数宣言構文](/lang/cpp11/trailing_return_types.md)のページを参照。 -## 関連項目 +## 関連項目 - [C++11 戻り値の型を後置する関数宣言構文](/lang/cpp11/trailing_return_types.md) - [C++14 `decltype(auto)`](decltype_auto.md) - [C++14 後置戻り値型をプレースホルダーにすることを許可](placeholder_type_in_trailing_return_type.md) @@ -237,4 +245,3 @@ auto g(F f) { return f(); } - [N3638 Return type deduction for normal functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3638.html) - [CWG Issue 1048. `auto` deduction and lambda return type deduction.](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1048) - [CWG Issue 1588. Deducing cv-qualified `auto`](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1588) - diff --git a/lang/cpp14/sized_deallocation.md b/lang/cpp14/sized_deallocation.md index 1d130364df..d3271b8096 100644 --- a/lang/cpp14/sized_deallocation.md +++ b/lang/cpp14/sized_deallocation.md @@ -1,6 +1,14 @@ # サイズ付きデアロケーション [N3778] * cpp14[meta cpp] +<-- start lang caution --> + +このページはC++14に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++03ではクラス用の`delete`演算子として、サイズをとるバージョンをオーバーロードできた。C++14では、それに対応するグローバルの`delete`演算子を定義できるようにする。 @@ -93,7 +101,7 @@ delete with two arguments, 13 - Clangは3.7以降、サイズをとる`delete`演算子を使用する場合、`-fsized-deallocation`オプションを付ける必要がある。 -## 関連項目 +## 関連項目 - [`allocator::deallocate`](/reference/memory/allocator/deallocate.md) - [`operator delete`](/reference/new/op_delete.md) - [`operator delete[]`](/reference/new/op_delete[].md) @@ -104,4 +112,4 @@ delete with two arguments, 13 - [N3536 C++ Sized Deallocation](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3536.html) - [N3663 C++ Sized Deallocation](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3663.html) - [N3778 C++ Sized Deallocation](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3778.html) -- [LWG Issue 2458. N3778 and new library deallocation signatures](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2458) +- [LWG Issue 2458. N3778 and new library deallocation signatures](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2458) \ No newline at end of file diff --git a/lang/cpp14/variable_templates.md b/lang/cpp14/variable_templates.md index 97cbadc517..37eed78f89 100644 --- a/lang/cpp14/variable_templates.md +++ b/lang/cpp14/variable_templates.md @@ -1,6 +1,14 @@ # 変数テンプレート [N3651] * cpp14[meta cpp] +<-- start lang caution --> + +このページはC++14に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 変数定義時のテンプレート指定を可能にする。 @@ -120,7 +128,7 @@ auto main() -> int - `const`または`constexpr`と組み合わせて用いる提案があったが、ワーキンググループの多数意見によりC++14の対象では制限しない事にした。(N3651) - テンプレートテンプレートについても提案があったが、ワーキンググループで複数の不要論がありC++14では含めない事にした。(N3651) -## 関連項目 +## 関連項目 - [C++11 `constexpr`](/lang/cpp11/constexpr.md) - [C++17 変数テンプレートのデフォルトテンプレート引数を許可](/lang/cpp17/allow_default_template_arguments_of_variable_templates.md) - [C++23 変数テンプレートの部分特殊化を許可](/lang/cpp23/generalized_wording_for_partial_specializations.md) @@ -129,4 +137,3 @@ auto main() -> int - [N3651 Variable Templates (Revision 1)](http://open-std.org/JTC1/SC22/WG21/docs/papers/2013/n3651.pdf) - [Trip Report: ISO C++ Spring 2013 Meeting](https://isocpp.org/blog/2013/04/trip-report-iso-c-spring-2013-meeting) - [変数テンプレートをラムダ式でキャプチャするときの注意 - Faith and Brave - C++で遊ぼう](http://faithandbrave.hateblo.jp/entry/2014/01/21/162701) - diff --git a/lang/cpp17/allow_constant_evaluation_for_all_non-type_template_arguments.md b/lang/cpp17/allow_constant_evaluation_for_all_non-type_template_arguments.md index 19f66f972b..1a5f04d3ee 100644 --- a/lang/cpp17/allow_constant_evaluation_for_all_non-type_template_arguments.md +++ b/lang/cpp17/allow_constant_evaluation_for_all_non-type_template_arguments.md @@ -2,6 +2,14 @@ * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 C++17では、非型テンプレート引数(non-type template argument)で扱える型はとくに変わらないが、渡せる値についての制限緩和が行われる。 @@ -114,4 +122,4 @@ A c; // ok! ## 参照 - [N4198 Allow constant evaluation for all non-type template arguments](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4198.html) - [N4268 Allow constant evaluation for all non-type template arguments](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4268.html) -- [C++1z 全ての非型テンプレート引数の定数式評価を許可 - Faith and Brave - C++で遊ぼう](https://faithandbrave.hateblo.jp/entry/2016/10/27/180801) +- [C++1z 全ての非型テンプレート引数の定数式評価を許可 - Faith and Brave - C++で遊ぼう](https://faithandbrave.hateblo.jp/entry/2016/10/27/180801) \ No newline at end of file diff --git a/lang/cpp17/allow_default_template_arguments_of_variable_templates.md b/lang/cpp17/allow_default_template_arguments_of_variable_templates.md index 363d1c5d04..f8c14b0986 100644 --- a/lang/cpp17/allow_default_template_arguments_of_variable_templates.md +++ b/lang/cpp17/allow_default_template_arguments_of_variable_templates.md @@ -1,6 +1,14 @@ # 変数テンプレートのデフォルトテンプレート引数を許可 * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 C++17では、[変数テンプレート](/lang/cpp14/variable_templates.md)のテンプレートパラメータがデフォルト引数を持てることとなった。 @@ -28,4 +36,4 @@ int main() ## 参照 -- [CWG Issue 2032. Default template-arguments of variable templates](https://wg21.cmeerw.net/cwg/issue2032) +- [CWG Issue 2032. Default template-arguments of variable templates](https://wg21.cmeerw.net/cwg/issue2032) \ No newline at end of file diff --git a/lang/cpp17/allow_typename_in_a_template_template_parameter.md b/lang/cpp17/allow_typename_in_a_template_template_parameter.md index e4dee187ae..2b05c7f5db 100644 --- a/lang/cpp17/allow_typename_in_a_template_template_parameter.md +++ b/lang/cpp17/allow_typename_in_a_template_template_parameter.md @@ -1,6 +1,14 @@ # テンプレートテンプレートパラメータにtypenameキーワードの使用を許可 [N4051] * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 テンプレートパラメータはほとんどの箇所で`class`キーワードと`typename`キーワードの両方を使用できたが、テンプレートテンプレートパラメータのクラステンプレート部分については`class`キーワードしか使用できなかった。 @@ -45,4 +53,4 @@ int main() ``` ## 参照 -- [N4051 Allow `typename` in a template template parameter](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4051.html) +- [N4051 Allow `typename` in a template template parameter](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4051.html) \ No newline at end of file diff --git a/lang/cpp17/attributes_for_namespaces_and_enumerators.md b/lang/cpp17/attributes_for_namespaces_and_enumerators.md index 78aee629be..7fd5c70142 100644 --- a/lang/cpp17/attributes_for_namespaces_and_enumerators.md +++ b/lang/cpp17/attributes_for_namespaces_and_enumerators.md @@ -1,6 +1,14 @@ # 名前空間と列挙子への属性付加を許可 [N4266] * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 名前空間と列挙子への属性付加が可能となった。 @@ -61,9 +69,9 @@ namespace [[deprecated]] bar { 2 warnings generated. ``` -## 関連項目 +## 関連項目 - [C++11 属性構文](/lang/cpp11/attributes.md) ## 参照 - [N4196 Attributes for namespaces and enumerators](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4196.html) -- [N4266 Attributes for namespaces and enumerators](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4266.html) +- [N4266 Attributes for namespaces and enumerators](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4266.html) \ No newline at end of file diff --git a/lang/cpp17/constexpr_lambda.md b/lang/cpp17/constexpr_lambda.md index f0ca914948..d67e01f5d8 100644 --- a/lang/cpp17/constexpr_lambda.md +++ b/lang/cpp17/constexpr_lambda.md @@ -2,6 +2,14 @@ * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 C++17から、ラムダ式をconstexpr関数として使えるようになった。 @@ -193,4 +201,4 @@ C++14まではラムダ式がコンパイル時に呼び出せないため、 ## 参照 (執筆中) -- [P0170R1 Wording for Constexpr Lambda](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0170r1.pdf) +- [P0170R1 Wording for Constexpr Lambda](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0170r1.pdf) \ No newline at end of file diff --git a/lang/cpp17/construction_enum_class_values.md b/lang/cpp17/construction_enum_class_values.md index b4e8f25891..f776f8493b 100644 --- a/lang/cpp17/construction_enum_class_values.md +++ b/lang/cpp17/construction_enum_class_values.md @@ -1,6 +1,14 @@ # enum class変数の初期値として整数を指定する際の規則を調整 [P0138R2] * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++11にてスコープを持つ列挙型が導入された。これは基底型を明示することができ、従来の列挙型と異なり整数型への暗黙の型変換を行わない。 @@ -96,9 +104,9 @@ enum class byte : unsigned char { }; C++17ではスコープを持つ列挙型の初期化ルールを緩和し、簡潔な記述を実現するとともに、意図せず精度を失う変換を行う危険性を排除した。 -## 関連項目 +## 関連項目 - [C++11 スコープを持つ列挙型](/lang/cpp11/scoped_enum.md) - [`std::byte`](/reference/cstddef/byte.md) ## 参照 -- [P0138R2 Construction Rules for enum class Values.](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0138r2.pdf) +- [P0138R2 Construction Rules for enum class Values.](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0138r2.pdf) \ No newline at end of file diff --git a/lang/cpp17/declaring_non-type_template_arguments_with_auto.md b/lang/cpp17/declaring_non-type_template_arguments_with_auto.md index e532dd3f09..0ba305a8b6 100644 --- a/lang/cpp17/declaring_non-type_template_arguments_with_auto.md +++ b/lang/cpp17/declaring_non-type_template_arguments_with_auto.md @@ -2,6 +2,14 @@ * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++14まで、以下のように書いていた「指定された型の定数を受け取る」意図の非型テンプレートパラメータ(non-type template parameter)だが、 @@ -91,7 +99,7 @@ S s; // desired instantiation template struct S; // type of v is deduced ``` -## 関連項目 +## 関連項目 - [C++17 全ての非型テンプレート引数の定数式評価を許可](/lang/cpp17/allow_constant_evaluation_for_all_non-type_template_arguments.md) - [C++20 非型テンプレートパラメータとしてクラス型を許可する](/lang/cpp20/class_types_in_non-type_template_parameters.md) @@ -99,4 +107,4 @@ template struct S; // type of v is deduced ## 参照 - [P0127R1 Declaring non-type template arguments with auto](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0127r1.html) - [P0127R2 Declaring non-type template parameters with auto](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0127r2.html) -- [C++1z 非型テンプレートパラメータのauto宣言 - Faith and Brave - C++で遊ぼう](https://faithandbrave.hateblo.jp/entry/2016/10/26/180406) +- [C++1z 非型テンプレートパラメータのauto宣言 - Faith and Brave - C++で遊ぼう](https://faithandbrave.hateblo.jp/entry/2016/10/26/180406) \ No newline at end of file diff --git a/lang/cpp17/dynamic_memory_allocation_for_over-aligned_data.md b/lang/cpp17/dynamic_memory_allocation_for_over-aligned_data.md index 8a14b5487c..412876e18d 100644 --- a/lang/cpp17/dynamic_memory_allocation_for_over-aligned_data.md +++ b/lang/cpp17/dynamic_memory_allocation_for_over-aligned_data.md @@ -1,6 +1,14 @@ # アライメント指定されたデータの動的メモリ確保 [P0035R4] * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 クラスのアライメント要求がデフォルトで満たされるものより大きい場合でも、動的に確保されたメモリ領域が指定したアライメントを満たしていることが保証される。 @@ -37,7 +45,7 @@ void* operator new(std::size_t size, std::align_val_t alignment); `new T`の呼び出しが[`align_val_t`](/reference/new/align_val_t.md)を取る[`new`](/reference/new/op_new.md)で解決される場合、`align_val_t`の値は`alignof(T)`の結果になる。 -## 関連項目 +## 関連項目 - [``](/reference/new.md) - [`std::align`](/reference/memory/align.md) - [C++11 `alignas`](/lang/cpp11/alignas.md) @@ -45,4 +53,4 @@ void* operator new(std::size_t size, std::align_val_t alignment); ## 参照 - [P0035R4 Dynamic memory allocation for over-aligned data](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0035r4.html) -- [New `new()` - The C++17's Alignment Parameter for Operator `new()`](https://www.bfilipek.com/2019/08/newnew-align.html) +- [New `new()` - The C++17's Alignment Parameter for Operator `new()`](https://www.bfilipek.com/2019/08/newnew-align.html) \ No newline at end of file diff --git a/lang/cpp17/exception_spec_be_part_of_the_type_system.md b/lang/cpp17/exception_spec_be_part_of_the_type_system.md index 7be6cb8d9a..d735f47075 100644 --- a/lang/cpp17/exception_spec_be_part_of_the_type_system.md +++ b/lang/cpp17/exception_spec_be_part_of_the_type_system.md @@ -1,6 +1,14 @@ # 例外仕様を型システムの一部にする [P0012R1] * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 [`noexcept`](/lang/cpp11/noexcept.md)による例外仕様が、関数の型の一部として扱われるようになる。 @@ -78,10 +86,10 @@ C++11で[`noexcept`](/lang/cpp11/noexcept.md)が導入されたことにより そのほか、次期標準で考えられているトランザクショナルメモリ機能において、トランザクション内で安全に使える機能の条件を決める上で、「関数に`noexcept`が付いていること」というものが必要となった。 -## 関連項目 +## 関連項目 - [C++11 noexcept](/lang/cpp11/noexcept.md) - [C++17 noexcept付きのラムダ式から変換する関数ポインタにnoexceptを付加する](lambda_to_noexcept_function_pointer.md) ## 参照 -- [P0012R1 Make exception specifications be part of the type system, version 5](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0012r1.html) +- [P0012R1 Make exception specifications be part of the type system, version 5](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0012r1.html) \ No newline at end of file diff --git a/lang/cpp17/expression_evaluation_order.md b/lang/cpp17/expression_evaluation_order.md index 4fe26553c0..9be6c3effe 100644 --- a/lang/cpp17/expression_evaluation_order.md +++ b/lang/cpp17/expression_evaluation_order.md @@ -1,6 +1,14 @@ # 厳密な式の評価順 [P0145R3] * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++14までは演算子オペランドにあたる部分式の評価順序は未規定(unspecified)であったが、 @@ -158,9 +166,9 @@ C++の既存のプログラムを壊すこと無く、なおかつ、 対象を限定して注意深く変更した結果である。 -## 関連項目 +## 関連項目 ## 参照 - [P0145R3 Refining Expression Evaluation Order for Idiomatic C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0145r3.pdf) -- [P0400R0 Wording for Order of Evaluation of Function Arguments](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0400r0.html) +- [P0400R0 Wording for Order of Evaluation of Function Arguments](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0400r0.html) \ No newline at end of file diff --git a/lang/cpp17/extending_static_assert.md b/lang/cpp17/extending_static_assert.md index 8ae20ef828..96d6c6e6a1 100644 --- a/lang/cpp17/extending_static_assert.md +++ b/lang/cpp17/extending_static_assert.md @@ -1,6 +1,14 @@ # static_assert のメッセージ省略を許可 [N3928] * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 `static_assert` は [C++11](/lang/cpp11/static_assert.md) で導入されたが、第2引数に診断メッセージを指定しなければならなかった。 C++17 ではこれを省略できるようになった。 @@ -64,10 +72,10 @@ example_static_assert.cpp:5:3: error: static_assert failed * 『`static_assert` は1つ以上の`定数式`を取り、診断メッセージはテキストに変換した`定数式`を含む』 -## 関連項目 +## 関連項目 - [C++11 `static_assert`](/lang/cpp11/static_assert.md) ## 参照 - [N3846 Extending `static_assert`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3846.pdf) -- [N3928 Extending `static_assert`, v2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3928.pdf) +- [N3928 Extending `static_assert`, v2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3928.pdf) \ No newline at end of file diff --git a/lang/cpp17/extension_to_aggregate_initialization.md b/lang/cpp17/extension_to_aggregate_initialization.md index f595a0b3ff..b2c9414184 100644 --- a/lang/cpp17/extension_to_aggregate_initialization.md +++ b/lang/cpp17/extension_to_aggregate_initialization.md @@ -2,6 +2,14 @@ * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++17 から集成体初期化が拡張され、基底クラスを持つ型の初期化が簡潔に記述できるようになった。 @@ -117,11 +125,11 @@ int main() この機能により C++17 以降では記述が簡潔になり、実装労力の低減、ソースコードの可読性の向上が図られた。 -## 関連項目 +## 関連項目 1. [C++14 / 宣言時のメンバ初期化を持つ型の集成体初期化を許可](../cpp14/brace_elision_in_array_temporary_initialization.md) ## 参照 -1. [P0017R1 Extension to aggregate initialization](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0017r1.html) +1. [P0017R1 Extension to aggregate initialization](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0017r1.html) \ No newline at end of file diff --git a/lang/cpp17/fallthrough.md b/lang/cpp17/fallthrough.md index eb8f4be434..5e35908756 100644 --- a/lang/cpp17/fallthrough.md +++ b/lang/cpp17/fallthrough.md @@ -1,6 +1,14 @@ # [[fallthrough]]属性 [P0188R1] * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 `[[fallthrough]]`属性は意図したフォールスルーであることをコンパイラに伝え、警告を抑制するための属性である。 @@ -51,9 +59,9 @@ fallthrough.cpp:12:3: note: here ^~~~ ``` -## 関連項目 +## 関連項目 - [C++11 属性構文](/lang/cpp11/attributes.md) ## 参照 - [P0068R0 Proposal of [[unused]], [[nodiscard]] and [[fallthrough]] attributes.](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0068r0.pdf) -- [P0188R1 Wording for [[fallthrough]] attribute.](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0188r1.pdf) +- [P0188R1 Wording for [[fallthrough]] attribute.](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0188r1.pdf) \ No newline at end of file diff --git a/lang/cpp17/feature_test_macros.md b/lang/cpp17/feature_test_macros.md index 435e6699a5..3b618d8c8f 100644 --- a/lang/cpp17/feature_test_macros.md +++ b/lang/cpp17/feature_test_macros.md @@ -1,6 +1,14 @@ # 機能テストマクロ * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 SD-6 は C++17 の機能について以下のテストマクロを定義することを推奨している: @@ -90,4 +98,4 @@ SD-6 は C++17 の機能について以下のテストマクロを定義する ## 参照 -- [SD-6: SG10 Feature Test Recommendations: Standard C++](https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations#recs.cpp17) +- [SD-6: SG10 Feature Test Recommendations: Standard C++](https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations#recs.cpp17) \ No newline at end of file diff --git a/lang/cpp17/folding_expressions.md b/lang/cpp17/folding_expressions.md index 03ed8df24c..60cba9317a 100644 --- a/lang/cpp17/folding_expressions.md +++ b/lang/cpp17/folding_expressions.md @@ -1,6 +1,14 @@ # 畳み込み式 [N4295] * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 畳み込み式 (fold expression) は可変引数テンプレートのパラメータパックに対して二項演算を累積的に行う (畳み込む fold)。 @@ -232,7 +240,7 @@ auto res = (std::string(args) + ...); で提案されていたが削除された (理由は発見できず)。 -## 関連項目 +## 関連項目 - [C++11 可変引数テンプレート](/lang/cpp11/variadic_templates.md) - [`std::accumulate`](/reference/numeric/accumulate.md) — イテレータ範囲について累積的に二項演算を行う @@ -243,4 +251,4 @@ auto res = (std::string(args) + ...); * [N4295 Folding expressions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4295.html) * [N4358 Unary Folds and Empty Parameter Packs](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4358.pdf) * [P0036 Unary Folds and Empty Parameter Packs (revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0036r0.pdf) -* [Nifty Fold Expression Tricks - foonathan::blog()](https://foonathan.net/2020/05/fold-tricks/) +* [Nifty Fold Expression Tricks - foonathan::blog()](https://foonathan.net/2020/05/fold-tricks/) \ No newline at end of file diff --git a/lang/cpp17/generalizing_the_range-based_for_loop.md b/lang/cpp17/generalizing_the_range-based_for_loop.md index df1a379340..e400fc3616 100644 --- a/lang/cpp17/generalizing_the_range-based_for_loop.md +++ b/lang/cpp17/generalizing_the_range-based_for_loop.md @@ -1,6 +1,14 @@ # 範囲 for ループの制限緩和 [P0184R0] * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 [範囲 for 文は C++11 で導入された](/lang/cpp11/range_based_for.md) が、 @@ -138,11 +146,11 @@ Range TS (technical specification) では `Sentinel` (番兵) 等の範囲の終 [Boost.Foreach](http://boost.org/libs/foreach) のようなマクロは避けるべきだとされた。 -## 関連項目 +## 関連項目 - [C++11 範囲 for 文](/lang/cpp11/range_based_for.md) - [C++20 範囲for文がカスタマイゼーションポイントを見つけるルールを緩和](/lang/cpp20/relaxing_the_range_for_loop_customization_point_finding_rules.md) ## 参照 - [P0184R0 Generalizing the Range-Based For Loop](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0184r0.html) -- [N4128 Ranges for the Standard Library, Revision 1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4128.html) +- [N4128 Ranges for the Standard Library, Revision 1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4128.html) \ No newline at end of file diff --git a/lang/cpp17/guaranteed_copy_elision.md b/lang/cpp17/guaranteed_copy_elision.md index 5a96ad1c75..448649cf21 100644 --- a/lang/cpp17/guaranteed_copy_elision.md +++ b/lang/cpp17/guaranteed_copy_elision.md @@ -2,6 +2,14 @@ * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 C++11で右辺値参照を導入するときに規定された「値カテゴリー (value category)」の仕様(C++17で更新)を利用し、[`prvalue`](../cpp11/rvalue_ref_and_move_semantics.md)[注1]というカテゴリーの値を、オブジェクトの初期化のために使用する場合に、コピーが省略される。 @@ -170,4 +178,4 @@ Foo x = foo(); // error Foo型のコピーコンストラクタが必要 - [Guaranteed Copy Elision](https://jonasdevlieghere.com/guaranteed-copy-elision/) ## 注釈 -1. **^** [右辺値、左辺値などの細かい定義 - Qiita](https://qiita.com/rinse_/items/cffa87016b7de49391ae)を参照 +1. **^** [右辺値、左辺値などの細かい定義 - Qiita](https://qiita.com/rinse_/items/cffa87016b7de49391ae)を参照 \ No newline at end of file diff --git a/lang/cpp17/has_include.md b/lang/cpp17/has_include.md index 8c4821ae7a..9972b6917a 100644 --- a/lang/cpp17/has_include.md +++ b/lang/cpp17/has_include.md @@ -1,6 +1,14 @@ # __has_include [P0061R1] * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 `__has_include`はインクルードするファイルが存在するかどうかを返す述語である。 @@ -95,4 +103,4 @@ has_include.cpp:23:4: warning: "fuga" is not found [-W#warnings] ``` ## 参照 -- [P0061R1 __has_include for C++17](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0061r1.html) +- [P0061R1 __has_include for C++17](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0061r1.html) \ No newline at end of file diff --git a/lang/cpp17/hexadecimal_floating_literals.md b/lang/cpp17/hexadecimal_floating_literals.md index 6515d12827..c239faf66d 100644 --- a/lang/cpp17/hexadecimal_floating_literals.md +++ b/lang/cpp17/hexadecimal_floating_literals.md @@ -1,5 +1,13 @@ # 十六進浮動小数点数リテラル [P0245R1] * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + * [mathjax enable] ## 概要 @@ -77,4 +85,4 @@ C99 で十六進浮動小数リテラルが採用された。 ## 参照 * [P0245R0 Hexadecimal floating literals for C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0245r0.html) -* [P0245R1 Hexadecimal floating literals for C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0245r1.html) +* [P0245R1 Hexadecimal floating literals for C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0245r1.html) \ No newline at end of file diff --git a/lang/cpp17/if_constexpr.md b/lang/cpp17/if_constexpr.md index 4d528aedfe..0c1b360046 100644 --- a/lang/cpp17/if_constexpr.md +++ b/lang/cpp17/if_constexpr.md @@ -1,6 +1,14 @@ # constexpr if 文 [P0292R2] * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 constexpr if文とは、文を条件付きコンパイルすることを目的とした制御構文である。 @@ -433,7 +441,7 @@ template int do_something(Args... args) { 旧来のテンプレート特殊化・SFINAE・タグディスパッチ・EBO・再帰的な派生などの技法を用いた複雑な代替手段もあるが、 それらを一つ一つここで紹介することは避ける。 -## 関連項目 +## 関連項目 - [`std::conditional`](/reference/type_traits/conditional.md) - [C++23 定数式の文脈での`bool`への縮小変換を許可](/lang/cpp23/narrowing_contextual_conversions_to_bool.md) @@ -469,4 +477,4 @@ template int do_something(Args... args) { - [C++1z if constexpr文 - Faith and Brave - C++で遊ぼう](https://faithandbrave.hateblo.jp/entry/2016/12/22/171238) - [[cfe-dev] Clang getting involved](https://lists.llvm.org/pipermail/cfe-dev/2014-March/035801.html) - [`__if_exists` Statement | Microsoft Docs](https://docs.microsoft.com/ja-jp/cpp/cpp/if-exists-statement) -- [Issue 2518: Conformance requirements and #error/#warning - WG21 CWG Issues](https://wg21.cmeerw.net/cwg/issue2518) +- [Issue 2518: Conformance requirements and #error/#warning - WG21 CWG Issues](https://wg21.cmeerw.net/cwg/issue2518) \ No newline at end of file diff --git a/lang/cpp17/inline_variables.md b/lang/cpp17/inline_variables.md index f10059f8fd..20ef21ee3f 100644 --- a/lang/cpp17/inline_variables.md +++ b/lang/cpp17/inline_variables.md @@ -1,6 +1,14 @@ # インライン変数 [P0386R2] * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 外部リンケージを持つ変数に対しインライン`inline`を指定することで、複数の翻訳単位で同じ変数を定義できるようになり、変数の実体はただ一つとすることができる。 @@ -273,7 +281,7 @@ func 表示されるアドレスは環境によって異なる可能性がある。 -## 関連項目 +## 関連項目 - [C++11 constexpr](/lang/cpp11/constexpr.md) ## 参照 @@ -283,4 +291,4 @@ func - [P0386R2 - Inline Variables](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0386r2.pdf), 2016-06-24 - [P0607R0 - Inline Variables for the Standard Library](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0607r0.html), 2017-02-27 - [C++1z インライン変数 - Faith and Brave - C++で遊ぼう](https://faithandbrave.hateblo.jp/entry/2016/11/11/172954) -- [インライン変数が翻訳単位毎に別々の実体となってしまう - Stackoverflow](https://ja.stackoverflow.com/questions/93046/) +- [インライン変数が翻訳単位毎に別々の実体となってしまう - Stackoverflow](https://ja.stackoverflow.com/questions/93046/) \ No newline at end of file diff --git a/lang/cpp17/lambda_capture_of_this_by_value.md b/lang/cpp17/lambda_capture_of_this_by_value.md index 391681d8eb..2340d2a4f8 100644 --- a/lang/cpp17/lambda_capture_of_this_by_value.md +++ b/lang/cpp17/lambda_capture_of_this_by_value.md @@ -1,6 +1,14 @@ # ラムダ式での*thisのコピーキャプチャ [P0018R3] * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++14までラムダ式で`[this]`のようにキャプチャをすると、`this`ポインタがコピーされていた。その場合、非同期処理のような状況で、ラムダ式の関数オブジェクトが呼び出されたときに、`this`ポインタが指すオブジェクトの寿命が尽きている場合がある。 @@ -68,7 +76,7 @@ exit ``` -## 関連項目 +## 関連項目 - [C++11 ラムダ式](/lang/cpp11/lambda_expressions.md) @@ -76,4 +84,4 @@ exit - [P0018R0 Lambda Capture of `*this` by Value](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0018r0.html) - [P0018R1 Lambda Capture of `*this` by Value](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0018r1.html) - [P0018R2 Lambda Capture of `*this` by Value](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0018r2.html) -- [P0018R3 Lambda Capture of `*this` by Value as `[=,*this]`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0018r3.html) +- [P0018R3 Lambda Capture of `*this` by Value as `[=,*this]`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0018r3.html) \ No newline at end of file diff --git a/lang/cpp17/lambda_to_noexcept_function_pointer.md b/lang/cpp17/lambda_to_noexcept_function_pointer.md index 8d1f0c3b1e..6b8d71d829 100644 --- a/lang/cpp17/lambda_to_noexcept_function_pointer.md +++ b/lang/cpp17/lambda_to_noexcept_function_pointer.md @@ -1,6 +1,14 @@ # noexcept付きのラムダ式から変換する関数ポインタにnoexceptを付加する * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 キャプチャを持たない非ジェネリックなラムダ式は、関数ポインタに変換できる。そのラムダ式が例外を投げない指定をされていた場合、変換された関数ポインタもまた`noexcept`を持つ。 @@ -40,7 +48,7 @@ true ``` -## 関連項目 +## 関連項目 - [C++17 例外仕様を型システムの一部にする](exception_spec_be_part_of_the_type_system.md) - [C++11 ラムダ式](/lang/cpp11/lambda_expressions.md) - [C++14 ジェネリックラムダ](/lang/cpp14/generic_lambdas.md) @@ -48,4 +56,3 @@ true ## 参照 - [CWG Issue 1722. Should lambda to function pointer conversion function be `noexcept`?](https://wg21.cmeerw.net/cwg/issue1722) - diff --git a/lang/cpp17/maybe_unused.md b/lang/cpp17/maybe_unused.md index f04dbd6f8b..7832e097e4 100644 --- a/lang/cpp17/maybe_unused.md +++ b/lang/cpp17/maybe_unused.md @@ -1,6 +1,14 @@ # [[maybe_unused]]属性 [P0212R1] * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 `[[maybe_unused]]`属性は意図的に未使用の要素を定義していることをコンパイラに伝え、警告を抑制するための属性である。 @@ -113,9 +121,9 @@ maybe_unused.cpp:12:8: warning: unused variable 'b2' [-Wunused-variable] P0068R0では`[[unused]]`という名前で提案されたが、いわゆる自転車置き場の議論の末の投票によって、採用された名前は`[[maybe_unused]]`になった。 -## 関連項目 +## 関連項目 - [C++11 属性構文](/lang/cpp11/attributes.md) ## 参照 - [P0068R0 Proposal of [[unused]], [[nodiscard]] and [[fallthrough]] attributes.](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0068r0.pdf) -- [P0212R1 Wording for [[maybe_unused]] attribute.](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0212r1.pdf) +- [P0212R1 Wording for [[maybe_unused]] attribute.](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0212r1.pdf) \ No newline at end of file diff --git a/lang/cpp17/nested_namespace.md b/lang/cpp17/nested_namespace.md index 0fb30e022a..2745b55138 100644 --- a/lang/cpp17/nested_namespace.md +++ b/lang/cpp17/nested_namespace.md @@ -1,6 +1,14 @@ # 入れ子名前空間の定義 [N4230] * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 一度の定義だけで入れ子状になった名前空間を定義可能となる。 @@ -53,7 +61,7 @@ a legacy nested namespace definition is workded. この機能はC++0x当時から提案されており、以前の提案等については以下参照されたい。 -## 関連項目 +## 関連項目 - [C++20 入れ子名前空間定義でのインライン名前空間](/lang/cpp20/nested_inline_mamespaces.md) @@ -61,4 +69,4 @@ a legacy nested namespace definition is workded. - 言語仕様: §7.3.1 §A.6 - [N4230 Nested namespace definition (revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4230.html) - [N1524 Nested Namespace Definition Proposal](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1524.htm) - - [N2869 State of C++ Evolution (Post San Francisco 2008)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2869.html) + - [N2869 State of C++ Evolution (Post San Francisco 2008)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2869.html) \ No newline at end of file diff --git a/lang/cpp17/new_rules_for_auto_deduction_from_braced-init-list.md b/lang/cpp17/new_rules_for_auto_deduction_from_braced-init-list.md index d457cf6ef2..2a635eaece 100644 --- a/lang/cpp17/new_rules_for_auto_deduction_from_braced-init-list.md +++ b/lang/cpp17/new_rules_for_auto_deduction_from_braced-init-list.md @@ -1,6 +1,14 @@ # 波括弧初期化の型推論の新規則 [N3922] * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 これまでは `auto var{arg};` (単一要素), `auto var{arg1, arg2,...};` (複数要素) で `var` はいずれも @@ -83,7 +91,7 @@ i が提案されたが採用されなかった。 -## 関連項目 +## 関連項目 * [C++11 初期化リスト](/lang/cpp11/initializer_lists.md) @@ -92,4 +100,4 @@ i * [N3681 Auto and braced-init-lists](http://open-std.org/JTC1/SC22/WG21/docs/papers/2013/n3681.html) * [N3912 Auto and braced-init-lists, continued](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3912.html) -* [N3922 New Rules for auto deduction from braced-init-list](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3922.html) +* [N3922 New Rules for auto deduction from braced-init-list](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3922.html) \ No newline at end of file diff --git a/lang/cpp17/nodiscard.md b/lang/cpp17/nodiscard.md index 2328e65a46..489a4d2d17 100644 --- a/lang/cpp17/nodiscard.md +++ b/lang/cpp17/nodiscard.md @@ -1,6 +1,14 @@ # [[nodiscard]]属性 [P0189R1] * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 `[[nodiscard]]`属性は関数の戻り値を破棄してはならないことをコンパイラに伝え、破棄した場合に警告するための属性である。 @@ -48,7 +56,7 @@ nodiscard.cpp:11:3: warning: ignoring return value of function declared with 'no 2 warnings generated. ``` -## 関連項目 +## 関連項目 - [C++11 属性構文](/lang/cpp11/attributes.md) - [C++20 `[[nodiscard]]`をコンストラクタのオーバーロードごとに付加できるようにする](/lang/cpp20/nodiscard_for_constructors.md) - C++17対応のコンパイラでも使用できる可能性がある @@ -58,4 +66,4 @@ nodiscard.cpp:11:3: warning: ignoring return value of function declared with 'no ## 参照 - [P0068R0 Proposal of [[unused]], [[nodiscard]] and [[fallthrough]] attributes.](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0068r0.pdf) -- [P0189R1 Wording for [[nodiscard]] attribute.](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0189r1.pdf) +- [P0189R1 Wording for [[nodiscard]] attribute.](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0189r1.pdf) \ No newline at end of file diff --git a/lang/cpp17/non_standard_attributes.md b/lang/cpp17/non_standard_attributes.md index d93d20f322..ad9fbd5897 100644 --- a/lang/cpp17/non_standard_attributes.md +++ b/lang/cpp17/non_standard_attributes.md @@ -1,6 +1,14 @@ # 不明な属性を無視する [P0283R2] * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 コンパイラにとって不明な属性は無視する。 @@ -46,8 +54,8 @@ non_standard_attributes.cpp:7:3: warning: unknown attribute 'unknown_attribute' プログラマが意図的に未知の属性を指定していて、警告が不要な場合はコンパイラオプションで警告を抑制できる。Clang++の場合は`-Wno-unknown-attributes`オプション、GCCの場合は`-Wno-attributes`オプションを指定する。 -## 関連項目 +## 関連項目 - [C++11 属性構文](/lang/cpp11/attributes.md) ## 参照 -- [P0283R2 Standard and non-standard attributes.](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0283r2.html) +- [P0283R2 Standard and non-standard attributes.](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0283r2.html) \ No newline at end of file diff --git a/lang/cpp17/pack_expansions_in_using.md b/lang/cpp17/pack_expansions_in_using.md index fcf3d40391..de332e0a1a 100644 --- a/lang/cpp17/pack_expansions_in_using.md +++ b/lang/cpp17/pack_expansions_in_using.md @@ -1,6 +1,14 @@ # using宣言のパック展開 [P0195R2] * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++17にて`using`宣言の仕様が拡張され、パラメータパックが指定できるようになった。 @@ -174,8 +182,8 @@ ForString:hello2 この問題を解決するためC++17では`using`でパック展開ができるようになった。 -## 関連項目 +## 関連項目 - [可変引数テンプレート](/lang/cpp11/variadic_templates.md) ## 参照 -- [P0195R2 Pack expansions in using-declarations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0195r2.html) +- [P0195R2 Pack expansions in using-declarations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0195r2.html) \ No newline at end of file diff --git a/lang/cpp17/predefined_macros.md b/lang/cpp17/predefined_macros.md index 047efa9d5e..c084697551 100644 --- a/lang/cpp17/predefined_macros.md +++ b/lang/cpp17/predefined_macros.md @@ -1,6 +1,14 @@ # 更新された定義済みマクロ * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 定義済みマクロの値が、以下のように更新された: @@ -16,6 +24,5 @@ | `__STDCPP_DEFAULT_NEW_ALIGNMENT__` | 実装定義 | 動的メモリ確保時のデフォルトのアライメント値 | -## 関連項目 +## 関連項目 - [C++17 アライメント指定されたデータの動的メモリ確保](dynamic_memory_allocation_for_over-aligned_data.md) - diff --git a/lang/cpp17/remove_deprecated_exception_specifications.md b/lang/cpp17/remove_deprecated_exception_specifications.md index 253a54d7c7..127715a9b2 100644 --- a/lang/cpp17/remove_deprecated_exception_specifications.md +++ b/lang/cpp17/remove_deprecated_exception_specifications.md @@ -1,6 +1,14 @@ # 非推奨だった古い例外仕様を削除 [P0003R5] * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++11で[`noexcept`](/lang/cpp11/noexcept.md)機能が入ったことにより、従来の`throw`キーワードを使用した「例外仕様 (Exception Specification)」は「動的例外仕様 (Dynamic Exception Specification)」という名前に変更され、非推奨となっていた。 @@ -54,11 +62,11 @@ C++固有の問題としては、以下のような問題があった: C++でもJavaを含むこれらの問題は認識されており、動的例外仕様の代わりとなるnoexcept例外仕様が新設された。代わりの機能ができたことで動的例外仕様は非推奨となり、noexcept例外仕様への移行する猶予期間が設けられた後、C++17でこの機能が削除されることとなった。 -## 関連項目 +## 関連項目 - [C++11 noexcept](/lang/cpp11/noexcept.md) - [C++20 `throw()`による例外送出しない指定を削除](/lang/cpp20/remove_deprecated_nothrow_exception_specification.md) ## 参照 - [P0003R4 Removing Deprecated Exception Specifications from C++17](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0003r4.html) -- [P0003R5 Removing Deprecated Exception Specifications from C++17](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0003r5.html) +- [P0003R5 Removing Deprecated Exception Specifications from C++17](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0003r5.html) \ No newline at end of file diff --git a/lang/cpp17/remove_deprecated_increment_of_bool.md b/lang/cpp17/remove_deprecated_increment_of_bool.md index 261ef394b5..3ff243c755 100644 --- a/lang/cpp17/remove_deprecated_increment_of_bool.md +++ b/lang/cpp17/remove_deprecated_increment_of_bool.md @@ -1,6 +1,14 @@ # 非推奨だった bool 型に対するインクリメント演算子を削除 [P0002R1] * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++17では`bool`型に対する前置および後置の`operator ++`を削除する。 @@ -146,7 +154,7 @@ Therac-25はカナダ原子力公社(AECL)とフランスCGR-MeV社によって C++14で`std::exchange()`が導入されたことにより、唯一使いみちのあった後置の`operator++`の必要性もなくなり、C++17で削除されたと推測される。 -## 関連項目 +## 関連項目 - [`std::exchange()`](/reference/utility/exchange.md) @@ -163,4 +171,4 @@ C++14で`std::exchange()`が導入されたことにより、唯一使いみち 1. [An Investigation of Therac-25 Accidents - I](http://web.archive.org/web/20171206153409/http://courses.cs.vt.edu/professionalism/Therac_25/Therac_1.html) 2. [Therac-25 - II](http://web.archive.org/web/20171212115910/http://courses.cs.vt.edu/professionalism/Therac_25/Therac_2.html) 3. [Therac-25 - III](http://web.archive.org/web/20170215125239/http://courses.cs.vt.edu/professionalism/Therac_25/Therac_3.html) -- [Therac-25 - Wikipedia](https://en.wikipedia.org/wiki/Therac-25) +- [Therac-25 - Wikipedia](https://en.wikipedia.org/wiki/Therac-25) \ No newline at end of file diff --git a/lang/cpp17/remove_deprecated_use_of_the_register_keyword.md b/lang/cpp17/remove_deprecated_use_of_the_register_keyword.md index a10725393c..bffa62989b 100644 --- a/lang/cpp17/remove_deprecated_use_of_the_register_keyword.md +++ b/lang/cpp17/remove_deprecated_use_of_the_register_keyword.md @@ -1,6 +1,14 @@ # 非推奨だったregisterキーワードを削除 [P0001R1] * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++17ではC++11で非推奨化された`register`キーワードを削除する。 @@ -17,11 +25,11 @@ register int v = 42; `register`キーワードはC++17標準では使用しなくなるが、将来のために予約されたままとなる。 -## 関連項目 +## 関連項目 - [C++11 registerキーワードを非推奨化](/lang/cpp11/deprecation_of_the_register_keyword.md) ## 参照 - [P0001R1: Remove Deprecated Use of the register Keyword](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0001r1.html) -- [P0001R0: Remove Deprecated Use of the register Keyword](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0001r0.html) +- [P0001R0: Remove Deprecated Use of the register Keyword](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0001r0.html) \ No newline at end of file diff --git a/lang/cpp17/removing_trigraphs.md b/lang/cpp17/removing_trigraphs.md index 76051b646c..8b0967eabb 100644 --- a/lang/cpp17/removing_trigraphs.md +++ b/lang/cpp17/removing_trigraphs.md @@ -1,6 +1,14 @@ # トライグラフの削除 [N4086] * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 トライグラフが削除された。 @@ -91,4 +99,4 @@ GCC などのコンパイラはデフォルトでトライグラフを無効に ## 参照 * [N3981 Removing trigraphs??!](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3981.html) -* [N4086 Removing trigraphs??!](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4086.html) +* [N4086 Removing trigraphs??!](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4086.html) \ No newline at end of file diff --git a/lang/cpp17/replacement_of_class_objects_containing_reference_members.md b/lang/cpp17/replacement_of_class_objects_containing_reference_members.md index 4ea19fb20d..2aa783929a 100644 --- a/lang/cpp17/replacement_of_class_objects_containing_reference_members.md +++ b/lang/cpp17/replacement_of_class_objects_containing_reference_members.md @@ -1,6 +1,14 @@ # 参照メンバをもつクラスの置き換え [P0137R1] * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 `placement new`を使用して、参照型や`const`メンバ変数を含む構造体/クラスを置き換える際、オブジェクト生存期間(lifetime)に基づいた最適化の抑止をコンパイラに伝える関数[`std::launder()`](/reference/new/launder.md)を用いることで、未定義動作となるような文脈で参照型や`const`メンバ変数へのアクセスができる。 @@ -92,4 +100,3 @@ public: - [Pointer safety and placement new](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4303.html) - [Implementability of std::optional (std :: optionalの実装可能性) ](https://groups.google.com/a/isocpp.org/forum/#!msg/std-proposals/93ebFsxCjvQ/Q5LUnO8339wJ) - [Lifetime - cppreference.com](https://en.cppreference.com/w/cpp/language/lifetime) - diff --git a/lang/cpp17/selection_statements_with_initializer.md b/lang/cpp17/selection_statements_with_initializer.md index da175269d3..b72260aa53 100644 --- a/lang/cpp17/selection_statements_with_initializer.md +++ b/lang/cpp17/selection_statements_with_initializer.md @@ -1,6 +1,14 @@ # if文とswitch文の条件式と初期化を分離 [P0305R1] * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 従来`for`文しか使用できなかった初期化を`if`文と`switch`文でも使えるようになった。 @@ -203,10 +211,10 @@ if (it != m.end()) { return it->size(); } 新しい概念を教えたり広めたりするコストが掛かる。さらに`for`文と文法の一貫性を取れる機会が失われてしまう問題がある。 -## 関連項目 +## 関連項目 - [C++20 初期化式をともなう範囲for文](/lang/cpp20/range-based_for_statements_with_initializer.md) - [C++23 初期化文での型の別名宣言を許可](/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md) ## 参照 -- [P0305R1 Selection statements with initializer.](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0305r1.html) +- [P0305R1 Selection statements with initializer.](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0305r1.html) \ No newline at end of file diff --git a/lang/cpp17/structured_bindings.md b/lang/cpp17/structured_bindings.md index 9d9184fe2f..261e9ac82b 100644 --- a/lang/cpp17/structured_bindings.md +++ b/lang/cpp17/structured_bindings.md @@ -1,6 +1,14 @@ # 構造化束縛 [P0217R3] * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 「構造化束縛 (structured bindings)」は、組やタプル、配列や構造体を分解して各要素を取り出す機能である。 @@ -326,7 +334,7 @@ auto { w, {x, y}, z } = f(); // このような、tuple内にあるpairを同時 ``` -## 関連項目 +## 関連項目 - [C++20 friend指定された関数内から構造化束縛を使用して非公開メンバ変数にアクセスすることを許可](/lang/cpp20/allow_structured_bindings_to_accessible_members.md) - [C++20 構造化束縛がカスタマイゼーションポイントを見つけるルールを緩和](/lang/cpp20/relaxing_the_structured_bindings_customization_point_finding_rules.md) - [C++20 構造化束縛を拡張して通常の変数宣言のように使用できるようにする](/lang/cpp20/extending_structured_bindings_to_be_more_like_variable_declarations.md) @@ -341,4 +349,4 @@ auto { w, {x, y}, z } = f(); // このような、tuple内にあるpairを同時 - [P0217R2 Proposed wording for structured bindings](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0217r2.html) - [P0217R3 Proposed wording for structured bindings](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0217r3.html) - [P0615R0 Renaming for structured bindings](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0615r0.html) -- [LWG DR2770 `tuple_size` specialization breaks decomposition declarations](http://wg21.cmeerw.net/lwg/issue2770) +- [LWG DR2770 `tuple_size` specialization breaks decomposition declarations](http://wg21.cmeerw.net/lwg/issue2770) \ No newline at end of file diff --git a/lang/cpp17/type_deduction_for_class_templates.md b/lang/cpp17/type_deduction_for_class_templates.md index ce3f0a7e88..4c7d684272 100644 --- a/lang/cpp17/type_deduction_for_class_templates.md +++ b/lang/cpp17/type_deduction_for_class_templates.md @@ -1,6 +1,14 @@ # クラステンプレートのテンプレート引数推論 [P0091R3] * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 コンストラクタに渡される値によって、クラステンプレートのテンプレート引数を推論する。 @@ -273,7 +281,7 @@ int main() - 循環的な複雑さ (Cyclomatic complexity) を軽減するために大きな関数をクラスで置き換える便利な手法が、関数テンプレートでは使用できなかった -## 関連項目 +## 関連項目 - [`std::pair`の推論補助](/reference/utility/pair/op_deduction_guide.md) - [`std::tuple`の推論補助](/reference/tuple/tuple/op_deduction_guide.md) - `std::pair`と`std::tuple`の推論補助の例からは、[`std::make_pair()`](/reference/utility/make_pair.md)のような生成関数の必要性が薄くなることと、標準ライブラリ内の生成関数と推論補助で、小さな機能的差異があることがわかる @@ -291,4 +299,4 @@ int main() - [P0620R0 Drafting for class template argument deduction issues](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0620r0.html) - [LWG Issue 2981. Remove redundant deduction guides from standard library](https://wg21.cmeerw.net/lwg/issue2981) - [P0702R1 Language support for Constructor Template Argument Deduction](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0702r1.html) -- [Class Template Argument Deduction - A New Abstraction - Zhihao Yuan - CppCon 2017](https://raw.githubusercontent.com/CppCon/CppCon2017/master/Presentations/Class%20Template%20Argument%20Deduction%20-%20A%20New%20Abstraction/Class%20Template%20Argument%20Deduction%20-%20A%20New%20Abstraction%20-%20Zhihao%20Yuan%20-%20CppCon%202017.pdf) +- [Class Template Argument Deduction - A New Abstraction - Zhihao Yuan - CppCon 2017](https://raw.githubusercontent.com/CppCon/CppCon2017/master/Presentations/Class%20Template%20Argument%20Deduction%20-%20A%20New%20Abstraction/Class%20Template%20Argument%20Deduction%20-%20A%20New%20Abstraction%20-%20Zhihao%20Yuan%20-%20CppCon%202017.pdf) \ No newline at end of file diff --git a/lang/cpp17/using_attribute_namespaces.md b/lang/cpp17/using_attribute_namespaces.md index bfc96aaa46..bd23c19a77 100644 --- a/lang/cpp17/using_attribute_namespaces.md +++ b/lang/cpp17/using_attribute_namespaces.md @@ -1,6 +1,14 @@ # 属性の名前空間指定に繰り返しをなくす [P0028R4] * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 複数の属性を指定する際`using`により名前空間を指定できる。 @@ -57,8 +65,8 @@ using_attribute_namespaces.cpp:13:13: error: attribute with scope specifier cann 1 error generated. ``` -## 関連項目 +## 関連項目 - [C++11 属性構文](/lang/cpp11/attributes.md) ## 参照 -- [P0028R4 Using attribute namespaces without repetition.](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0028r4.html) +- [P0028R4 Using attribute namespaces without repetition.](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0028r4.html) \ No newline at end of file diff --git a/lang/cpp17/utf8_character_literals.md b/lang/cpp17/utf8_character_literals.md index 479966b3ec..c486f134d5 100644 --- a/lang/cpp17/utf8_character_literals.md +++ b/lang/cpp17/utf8_character_literals.md @@ -1,6 +1,14 @@ # UTF-8文字リテラル [N4267] * cpp17[meta cpp] +<-- start lang caution --> + +このページはC++17に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++14までは、UTF-8エンコーディングであることを示す`u8`プレフィックスを、文字列リテラルに対してのみ指定できた。C++17では、文字リテラルに対しても`u8`プレフィックスを付けられる。 @@ -18,7 +26,7 @@ C++20ではUTF-8文字リテラルの型が[`char`ではなく`char8_t`になる - そのコードポイント範囲を超える値が指定された場合、プログラムは不適格となる -## 関連項目 +## 関連項目 - [C++11 UTF-8文字列リテラル](/lang/cpp11/utf8_string_literals.md) - [C++11 `char16_t`と`char32_t`](/lang/cpp11/char16_32.md) - [C++20 UTF-8エンコーディングされた文字の型として`char8_t`を追加](/lang/cpp20/char8_t.md) @@ -29,4 +37,3 @@ C++20ではUTF-8文字リテラルの型が[`char`ではなく`char8_t`になる - [N4267 Adding `u8` character literals](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4267.html) - [C0 Controls and Basic Latin - The Unicode Consortium](http://www.unicode.org/charts/PDF/U0000.pdf) - [基本ラテン文字 (Unicodeのブロック) - Wikipedia](https://ja.wikipedia.org/wiki/%E5%9F%BA%E6%9C%AC%E3%83%A9%E3%83%86%E3%83%B3%E6%96%87%E5%AD%97_(Unicode%E3%81%AE%E3%83%96%E3%83%AD%E3%83%83%E3%82%AF)) - diff --git a/lang/cpp20/access_checking_on_specializations.md b/lang/cpp20/access_checking_on_specializations.md index def88c4282..b80a26c32a 100644 --- a/lang/cpp20/access_checking_on_specializations.md +++ b/lang/cpp20/access_checking_on_specializations.md @@ -1,6 +1,14 @@ # 特殊化のアクセスチェック [P0692R1] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 クラス`C`の内側で宣言されたクラス(ローカルクラス`impl`)が`private/protected`で宣言されている場合、テンプレートの文脈で`C`の外側から`impl`を参照することは禁止されていた。しかし、実際にはほぼ全てのコンパイラでこれは許可されており、実際に使用されていた。 @@ -145,4 +153,3 @@ namespace option3 { ## 参照 - [P0692R1 Access Checking on Specializations](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0692r1.html) - diff --git a/lang/cpp20/adl_and_function_templates_that_are_not_visible.md b/lang/cpp20/adl_and_function_templates_that_are_not_visible.md index ceb421b9b3..fe061cd64c 100644 --- a/lang/cpp20/adl_and_function_templates_that_are_not_visible.md +++ b/lang/cpp20/adl_and_function_templates_that_are_not_visible.md @@ -1,6 +1,14 @@ # 関数テンプレートに明示的に型指定した場合にADLで見つからない問題を修正 [P0846R0] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 C++17までは、以下のコードが不適格だった: @@ -61,4 +69,4 @@ int main() { ``` ## 参照 -- [P0846R0 ADL and Function Templates that are not Visible](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0846r0.html) +- [P0846R0 ADL and Function Templates that are not Visible](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0846r0.html) \ No newline at end of file diff --git a/lang/cpp20/allow_initializing_aggregates_from_a_parenthesized_list_of_values.md b/lang/cpp20/allow_initializing_aggregates_from_a_parenthesized_list_of_values.md index 91b855942a..b9686a4ed9 100644 --- a/lang/cpp20/allow_initializing_aggregates_from_a_parenthesized_list_of_values.md +++ b/lang/cpp20/allow_initializing_aggregates_from_a_parenthesized_list_of_values.md @@ -2,6 +2,14 @@ * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++20では、波カッコと同様に丸カッコでも集成体初期化できる。 @@ -122,11 +130,11 @@ explicit A(T1 t1, … , Tk tk); しかし、前者は参照型でないメンバーを左辺値で初期化することができない(関数テンプレートではないことに注意)。 後者はムーブが必要になってしまうという問題があった。 -## 関連項目 +## 関連項目 - [一様初期化](/lang/cpp11/uniform_initialization.md) ## 参照 - [P0960R3 Allow initializing aggregates from a parenthesized list of values](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0960r3.html) -- [C++ Core Guidelines ES.23: Prefer the {}-initializer syntax](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#es23-prefer-the--initializer-syntax) 常に波カッコで初期化することを推奨している。 +- [C++ Core Guidelines ES.23: Prefer the {}-initializer syntax](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#es23-prefer-the--initializer-syntax) 常に波カッコで初期化することを推奨している。 \ No newline at end of file diff --git a/lang/cpp20/allow_lambda_capture_equal_this.md b/lang/cpp20/allow_lambda_capture_equal_this.md index 715e4dbadf..8c8cc2e0b9 100644 --- a/lang/cpp20/allow_lambda_capture_equal_this.md +++ b/lang/cpp20/allow_lambda_capture_equal_this.md @@ -1,6 +1,14 @@ # ラムダ式のキャプチャとして[=, this]を許可する [P0409R2] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++17まで、ラムダ式のキャプチャとして`[=, this]`は指定できなかった。これは、デフォルトコピーキャプチャ (`=`) に、`this`ポインタのコピーキャプチャが含まれるため、重複指定はできないというものである。 @@ -34,10 +42,10 @@ int main() ``` -## 関連項目 +## 関連項目 - [C++11 ラムダ式](/lang/cpp11/lambda_expressions.md) - [C++20 `[=]`による`this`の暗黙のキャプチャを非推奨化](deprecate_implicit_capture_of_this_via_defcopy.md) ## 参照 -- [P0409R2 Allow lambda capture `[=, this]`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0409r2.html) +- [P0409R2 Allow lambda capture `[=, this]`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0409r2.html) \ No newline at end of file diff --git a/lang/cpp20/allow_pack_expansion_in_lambda_init_capture.md b/lang/cpp20/allow_pack_expansion_in_lambda_init_capture.md index eaf47d8df3..8bece858e6 100644 --- a/lang/cpp20/allow_pack_expansion_in_lambda_init_capture.md +++ b/lang/cpp20/allow_pack_expansion_in_lambda_init_capture.md @@ -1,6 +1,14 @@ # ラムダ式の初期化キャプチャでのパック展開を許可 [P0780R2] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 [ラムダ式](/lang/cpp11/lambda_expressions.md)の[初期化キャプチャ](../cpp14/initialize_capture.md)で、パック展開ができるようになった。 @@ -130,11 +138,11 @@ auto f(Args... args) { のような位置で提案されていた。これが現在のようになったのは、`...` の位置が導入する名前に先行する、既存の慣行と一致するようにするためである。 -## 関連項目 +## 関連項目 - [C++11 ラムダ式](/lang/cpp11/lambda_expressions.md) - [C++14 ラムダ式の初期化キャプチャ](../cpp14/initialize_capture.md) ## 参照 - [P0780R2 Allow pack expansion in lambda init-capture](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0780r2.html) - [CWG 1760: Access of member corresponding to init-capture](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1760) -- [P2095R0 Resolve lambda init-capture pack grammar (CWG2378)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2095r0.html) +- [P2095R0 Resolve lambda init-capture pack grammar (CWG2378)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2095r0.html) \ No newline at end of file diff --git a/lang/cpp20/allow_structured_bindings_to_accessible_members.md b/lang/cpp20/allow_structured_bindings_to_accessible_members.md index a66e450c03..e00dafa584 100644 --- a/lang/cpp20/allow_structured_bindings_to_accessible_members.md +++ b/lang/cpp20/allow_structured_bindings_to_accessible_members.md @@ -1,6 +1,14 @@ # friend指定された関数内から構造化束縛を使用して非公開メンバ変数にアクセスすることを許可 [P0969R0] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++17までの構造化束縛では、publicアクセス指定されたメンバ変数のみ抽出できる仕様となっていた。 @@ -43,9 +51,9 @@ int main() { ``` -## 関連項目 +## 関連項目 - [C++17 構造化束縛](/lang/cpp17/structured_bindings.md) ## 参照 -- [P0969R0 Allow structured bindings to accessible members](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0969r0.pdf) +- [P0969R0 Allow structured bindings to accessible members](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0969r0.pdf) \ No newline at end of file diff --git a/lang/cpp20/allow_virtual_function_calls_in_constant_expressions.md b/lang/cpp20/allow_virtual_function_calls_in_constant_expressions.md index 8f9620e9b6..92057fd4ca 100644 --- a/lang/cpp20/allow_virtual_function_calls_in_constant_expressions.md +++ b/lang/cpp20/allow_virtual_function_calls_in_constant_expressions.md @@ -1,6 +1,14 @@ # 定数式からの仮想関数の呼び出しを許可 [P1064R0] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++20では、仮想関数に対して`constexpr`を指定し、定数式の文脈で呼び出せるようになる。 @@ -28,9 +36,9 @@ int main() ``` -## 関連項目 +## 関連項目 - [C++11 constexpr](/lang/cpp11/constexpr.md) ## 参照 -- [P1064R0 Allowing Virtual Function Calls in Constant Expressions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1064r0.html) +- [P1064R0 Allowing Virtual Function Calls in Constant Expressions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1064r0.html) \ No newline at end of file diff --git a/lang/cpp20/allowing_dynamic_cast_polymorphic_typeid_in_constant_expressions.md b/lang/cpp20/allowing_dynamic_cast_polymorphic_typeid_in_constant_expressions.md index 71a567688d..47e9962222 100644 --- a/lang/cpp20/allowing_dynamic_cast_polymorphic_typeid_in_constant_expressions.md +++ b/lang/cpp20/allowing_dynamic_cast_polymorphic_typeid_in_constant_expressions.md @@ -1,6 +1,14 @@ # 定数式での`dynamic_cast`、多態的な`typeid`を許可 [P1327R1] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++20より、`constexpr`関数内(定数式)で`dynamic_cast`および多態的な型に対する`typeid`を使用することができるようになる。 @@ -94,7 +102,7 @@ false その後、実装可能性に関する懸念は払拭されたため、C++23に導入される予定である。 -## 関連項目 +## 関連項目 - [C++20 定数式からの仮想関数の呼び出しを許可](/lang/cpp20/allow_virtual_function_calls_in_constant_expressions.md) @@ -103,4 +111,4 @@ false - [P1327R1 Allowing dynamic_cast, polymorphic typeid in Constant Expressions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1327r1.html) - [P1328R0 Making std::type_info::operator== constexpr](https://wg21.link/P1328) -- [P1328 Making std::type_info::operator== constexpr - cplusplus/papers](https://github.com/cplusplus/papers/issues/70) +- [P1328 Making std::type_info::operator== constexpr - cplusplus/papers](https://github.com/cplusplus/papers/issues/70) \ No newline at end of file diff --git a/lang/cpp20/array_size_deduction_in_new-expressions.md b/lang/cpp20/array_size_deduction_in_new-expressions.md index caa300bfa1..38c8f90d92 100644 --- a/lang/cpp20/array_size_deduction_in_new-expressions.md +++ b/lang/cpp20/array_size_deduction_in_new-expressions.md @@ -2,6 +2,14 @@ * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++20では、`new`式で配列の要素数を推論できる。 @@ -62,10 +70,10 @@ double* p = new double[]{1,2,3} // エラー `new`式で要素数を必須とする強い理由がないため、推論できるようになった。 -## 関連項目 +## 関連項目 * [丸カッコの値リストからの集成体初期化を許可](allow_initializing_aggregates_from_a_parenthesized_list_of_values.md) ## 参照 -* [P1009R2 Array size deduction in new-expressions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1009r2.pdf) +* [P1009R2 Array size deduction in new-expressions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1009r2.pdf) \ No newline at end of file diff --git a/lang/cpp20/changing_the_active_member_of_a_union_inside_constexpr.md b/lang/cpp20/changing_the_active_member_of_a_union_inside_constexpr.md index 333be083c8..3f82156d44 100644 --- a/lang/cpp20/changing_the_active_member_of_a_union_inside_constexpr.md +++ b/lang/cpp20/changing_the_active_member_of_a_union_inside_constexpr.md @@ -1,6 +1,14 @@ # 定数式内での共用体のアクティブメンバの変更を許可 [P1330R0] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++20より、共用体初期化後に別のメンバを初期化する事(アクティブメンバの切り替え)が定数式で行えるようになる。 @@ -34,7 +42,7 @@ int main() { 静的リフレクション機能を見据えて`std::string`の`constexpr`対応が急がれており、その障壁を取り除くべく、共用体のアクティブメンバ切り替えは定数式で許可される事となった。 -## 関連項目 +## 関連項目 - [可変サイズをもつコンテナの`constexpr`化](more_constexpr_containers.md) @@ -42,4 +50,4 @@ int main() { - [P1330R0 Changing the active member of a union inside constexpr](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1330r0.pdf) - [P0980R0 Making std::string constexpr](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0980r1.pdf) -- [std::stringのSSO(Small-string optimization)がどうなっているか調べた - melpon/qiita](https://github.com/melpon/qiita/tree/master/items/stdstringのSSO(Small-string%20optimization)がどうなっているか調べた) +- [std::stringのSSO(Small-string optimization)がどうなっているか調べた - melpon/qiita](https://github.com/melpon/qiita/tree/master/items/stdstringのSSO(Small-string%20optimization)がどうなっているか調べた) \ No newline at end of file diff --git a/lang/cpp20/char8_t.md b/lang/cpp20/char8_t.md index 68fb50beb6..6d2a7d3990 100644 --- a/lang/cpp20/char8_t.md +++ b/lang/cpp20/char8_t.md @@ -1,6 +1,14 @@ # UTF-8エンコーディングされた文字の型として`char8_t`を追加 [P0482R6] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 UTF-8でエンコードされた文字を格納することを想定した型として、符号なし文字型`char8_t`型を追加する。 @@ -140,7 +148,7 @@ enum class char8_t : unsigned char {}; ``` -## 関連項目 +## 関連項目 - [char16_tとchar32_t](/lang/cpp11/char16_32.md) - [UTF-8文字列リテラル](/lang/cpp11/utf8_string_literals.md) @@ -171,4 +179,4 @@ enum class char8_t : unsigned char {}; - [P1423R3: char8_t backward compatibility remediation](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1423r3.html) - [Proposal for a C/C++ language extension to support portable UTF-16](http://web.archive.org/web/20140701223639/http://www.unicode.org/~asmus/stdc-utf-16.txt) -- [char8_tによせて - なるせにっき](https://naruse.hateblo.jp/entry/2018/12/24/013446) +- [char8_tによせて - なるせにっき](https://naruse.hateblo.jp/entry/2018/12/24/013446) \ No newline at end of file diff --git a/lang/cpp20/checking_for_abstract_class_types.md b/lang/cpp20/checking_for_abstract_class_types.md index e4000dd54c..14e0f528fa 100644 --- a/lang/cpp20/checking_for_abstract_class_types.md +++ b/lang/cpp20/checking_for_abstract_class_types.md @@ -1,6 +1,14 @@ # 抽象型のチェック [P0929R2] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 C++17までは以下の仕様があったため、抽象クラスに早期の制限があった: @@ -20,4 +28,4 @@ C++20ではこれを適格とし、先行宣言と同様にクラスの完全性 ## 参照 -- [P0929R2 Checking for abstract class types](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0929r2.html) +- [P0929R2 Checking for abstract class types](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0929r2.html) \ No newline at end of file diff --git a/lang/cpp20/class_template_argument_deduction_for_aggregates.md b/lang/cpp20/class_template_argument_deduction_for_aggregates.md index 21fd47e947..20169b4c8f 100644 --- a/lang/cpp20/class_template_argument_deduction_for_aggregates.md +++ b/lang/cpp20/class_template_argument_deduction_for_aggregates.md @@ -1,6 +1,14 @@ # 集成体クラステンプレートのテンプレート引数推論 [P1816R0] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++17で導入されたクラステンプレートのテンプレート引数推論は、コンストラクタ引数からテンプレート引数を推論するものであった。 @@ -17,7 +25,7 @@ Point p1{3.0, 4.0}; // C++17:NG C++20:OK ``` -## 関連項目 +## 関連項目 - [C++17 クラステンプレートのテンプレート引数推論](/lang/cpp17/type_deduction_for_class_templates.md) @@ -25,4 +33,4 @@ Point p1{3.0, 4.0}; // C++17:NG C++20:OK - [P1021R4 Filling holes in Class Template Argument Deduction](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1021r4.html) - 提案の元になった文書 - [P1816R0 Wording for class template argument deduction for aggregates](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1816r0.pdf) - - C++20に採択された提案文書 + - C++20に採択された提案文書 \ No newline at end of file diff --git a/lang/cpp20/class_template_argument_deduction_for_alias_templates.md b/lang/cpp20/class_template_argument_deduction_for_alias_templates.md index 9eccf5faf5..313c11a4a8 100644 --- a/lang/cpp20/class_template_argument_deduction_for_alias_templates.md +++ b/lang/cpp20/class_template_argument_deduction_for_alias_templates.md @@ -1,6 +1,14 @@ # エイリアステンプレート経由でのクラステンプレートのテンプレート引数推論 [P1814R0] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++17で導入されたクラステンプレートのテンプレート引数推論は、コンストラクタ引数からテンプレート引数を推論するものであった。しかし、そのクラステンプレートのエイリアステンプレートを定義した場合に、エイリアステンプレートの変数定義からはクラステンプレートのテンプレート引数を推論できない問題があった。 @@ -62,9 +70,9 @@ B b2(&d, &d); // エラー! CからBを推論できない * std::integral[link /reference/concepts/integral.md] -## 関連項目 +## 関連項目 - [C++17 クラステンプレートのテンプレート引数推論](/lang/cpp17/type_deduction_for_class_templates.md) ## 参照 -- [P1814R0 Wording for Class Template Argument Deduction for Alias Templates](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1814r0.html) +- [P1814R0 Wording for Class Template Argument Deduction for Alias Templates](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1814r0.html) \ No newline at end of file diff --git a/lang/cpp20/class_types_in_non-type_template_parameters.md b/lang/cpp20/class_types_in_non-type_template_parameters.md index eea126fa7f..9df91ede14 100644 --- a/lang/cpp20/class_types_in_non-type_template_parameters.md +++ b/lang/cpp20/class_types_in_non-type_template_parameters.md @@ -1,6 +1,14 @@ # 非型テンプレートパラメータとしてクラス型を許可する [P0732R2] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 これまで、非型テンプレートパラメータ (non-type template parameter) としては、整数型、ポインタ、参照、[`std::nullptr_t`](/reference/cstddef/nullptr_t.md)、[プレースホルダ型](/lang/cpp17/declaring_non-type_template_arguments_with_auto.md)の値しか受け取ることが許可されていなかった。 @@ -107,10 +115,10 @@ int main() { - GCC 10では`pair`が構造的型とみなされないバグがある。GCC 11で修正済み -## 関連項目 +## 関連項目 - [C++17 非型テンプレートパラメータの`auto`宣言](/lang/cpp17/declaring_non-type_template_arguments_with_auto.md) ## 参照 - [P0732R2 Class Types in Non-Type Template Parameters](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0732r2.pdf) -- [P1907R1 Inconsistencies with non-type template parameters](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1907r1.html) +- [P1907R1 Inconsistencies with non-type template parameters](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1907r1.html) \ No newline at end of file diff --git a/lang/cpp20/concepts.md b/lang/cpp20/concepts.md index 340bd7dc93..94b2888067 100644 --- a/lang/cpp20/concepts.md +++ b/lang/cpp20/concepts.md @@ -1,6 +1,14 @@ # コンセプト [P0734R0] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++20から導入される「コンセプト (concepts)」は、テンプレートパラメータを制約する機能である。この機能を使用することで、以下のような面でプログラミングのしやすさが向上する: @@ -961,7 +969,7 @@ C++14の策定において、コンセプトの複雑さを回避して必要最 軽量コンセプトとしてなるべく早くプログラマにこの機能を導入するつもりだったが、その後コンセプトをさらに仕様拡張としていくことを考えると、最初の設計から大幅に違ったものになってしまう懸念があった。また、コンセプトは標準ライブラリの仕様に適用すべきものであるため、より完全なものが求められた。そのため、軽量コンセプトという予定はなくなり、より時間をかけて完全なコンセプトの仕様を策定することとなり、C++20で導入されることとなった。 -## 関連項目 +## 関連項目 - [``](/reference/concepts.md) - [``](/reference/iterator.md) - [``](/reference/ranges.md) @@ -976,4 +984,4 @@ C++14の策定において、コンセプトの複雑さを回避して必要最 - [P1452R2 On the non-uniform semantics of return-type-requirements](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1452r2.html) - [P1616R1 Using unconstrained template template parameters with constrained templates](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1616r1.html) - [C++ Concepts - complete overview (Jakub Cislo)](http://programowaniezpasja.pl/wp-content/uploads/2019/05/Cpp_Concepts_-_complete_overview_-_Jakub_Cislo.pdf) -- [Multiple destructors with C++ concepts - Sandor Dargo's Blog](https://www.sandordargo.com/blog/2021/06/16/multiple-destructors-with-cpp-concepts) +- [Multiple destructors with C++ concepts - Sandor Dargo's Blog](https://www.sandordargo.com/blog/2021/06/16/multiple-destructors-with-cpp-concepts) \ No newline at end of file diff --git a/lang/cpp20/consistent_comparison.md b/lang/cpp20/consistent_comparison.md index 53209f1cd7..91c1df4578 100644 --- a/lang/cpp20/consistent_comparison.md +++ b/lang/cpp20/consistent_comparison.md @@ -1,6 +1,14 @@ # 一貫比較 [P0515R3] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 新しく三方比較演算子`<=>`が導入されることにより、順序付けと同値比較の6つの関係演算子(`<`, `<=`, `>`, `>=`, `==`, `!=`)を容易に実装することができるようになる。 @@ -776,7 +784,7 @@ struct has_vector { |関数/メンバポインタ|`std::strong_equality`|あらゆるポインタ変換が施された後、同じポインタ型にならなければ比較不可| |[`std::nullptr_t`](/reference/cstddef/nullptr_t.md)|`std::strong_equality`|| -## 関連項目 +## 関連項目 - [``](/reference/compare.md) - 比較カテゴリ型 @@ -835,4 +843,4 @@ struct has_vector { - [P0436R1 An Extensible Approach to Obtaining Selected Operators](http://wg21.link/P0436R1) - [P0474R0 Comparison in C++: Basic Facilities](http://wg21.link/P0474R0) - [P0481R0 T. Van Eerd. “Bravely Default](http://wg21.link/P0481R0) - - [P0432R0 D. Stone. “Implicit and Explicit Default Comparison Operators](http://wg21.link/P0432R0) + - [P0432R0 D. Stone. “Implicit and Explicit Default Comparison Operators](http://wg21.link/P0432R0) \ No newline at end of file diff --git a/lang/cpp20/constinit.md b/lang/cpp20/constinit.md index 82f66caeb7..e23305588b 100644 --- a/lang/cpp20/constinit.md +++ b/lang/cpp20/constinit.md @@ -1,6 +1,14 @@ # コンパイル時初期化を強制する`constinit`キーワードを追加 [P1143R2] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 変数に対する`constinit`指定は、静的初期化(*static initialization*)が可能な変数に対して、その初期化がコンパイル時に完了することを保証する。 @@ -193,7 +201,7 @@ int main() {} `constinit`はキーワードとして追加されており、C++コードのすべての所で予約語として扱われる。そのため、変数名や関数名などとして使用する事はできない。これは、C++17以前に対する破壊的変更となるが、一般的な単語ではなかったため問題にならないと判断されたようである。 -## 関連項目 +## 関連項目 - [C++11 `constexpr`](/lang/cpp11/constexpr.md) - [`mutex`のコンストラクタ](/reference/mutex/mutex/op_constructor.md) @@ -205,4 +213,4 @@ int main() {} - [P1143R2 Adding the `constinit` keyword](https://wg21.link/P1143) - [Constant initialization - Andrzej's C++ blog](https://akrzemi1.wordpress.com/2012/05/27/constant-initialization/) - [`mutex`のconstexprコンストラクタ - yohhoyの日記](https://yohhoy.hatenadiary.jp/entry/20120621/p1) -- [Static Initialization Order Fiasco - in neuro](https://yohhoy.hatenadiary.jp/entry/20120621/p1) +- [Static Initialization Order Fiasco - in neuro](https://yohhoy.hatenadiary.jp/entry/20120621/p1) \ No newline at end of file diff --git a/lang/cpp20/converting_from_pointer_to_bool_should_be_considered_narrowing.md b/lang/cpp20/converting_from_pointer_to_bool_should_be_considered_narrowing.md index 0cf4402aa1..7b2b886e82 100644 --- a/lang/cpp20/converting_from_pointer_to_bool_should_be_considered_narrowing.md +++ b/lang/cpp20/converting_from_pointer_to_bool_should_be_considered_narrowing.md @@ -1,6 +1,14 @@ # ポインタから`bool`への変換を縮小変換とする [P1957R2] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 ポインタ型(メンバポインタも含む)から`bool`型への変換が、縮小変換として規定されるようになる。 @@ -55,7 +63,7 @@ std::variant v = b[1]; // boolを保持して構築 `{}`初期化では縮小変換が禁止されているためこれは破壊的変更となるが、そのような変換は多くの場合バグの可能性が高いこと、MSVCは非リテラルのポインタから`bool`への変換を縮小変換として扱っていたことなどから、影響は少なくメリットの方が大きいと判断されたようだ。 -## 関連項目 +## 関連項目 - [`std::variant::`コンストラクタ](/reference/variant/variant/op_constructor.md) - [`std::variant::operator=`](/reference/variant/variant/op_assign.md) @@ -64,4 +72,4 @@ std::variant v = b[1]; // boolを保持して構築 - [P1957R2 Converting from `T*` to `bool` should be considered narrowing (re: US 212)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1957r2.html) - [LWG Issue 3228. Surprising `variant` construction](https://cplusplus.github.io/LWG/issue3228) -- [P0608R3 A sane `variant` converting constructor](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0608r3.html) +- [P0608R3 A sane `variant` converting constructor](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0608r3.html) \ No newline at end of file diff --git a/lang/cpp20/coroutines.md b/lang/cpp20/coroutines.md index cc7d161e04..b01763587e 100644 --- a/lang/cpp20/coroutines.md +++ b/lang/cpp20/coroutines.md @@ -1,6 +1,14 @@ # コルーチン [P0912R5] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 処理途中でのサスペンド(中断)/レジューム(再開)をサポートする一般化された関数として、[コルーチン](https://ja.wikipedia.org/wiki/%E3%82%B3%E3%83%AB%E3%83%BC%E3%83%81%E3%83%B3)が導入される。 @@ -608,7 +616,7 @@ C++20コルーチンに関するキーワードは、いずれも接頭辞`co_` 何度かの改名提案([P0071R0](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0071r0.html)、[P1485R1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1485r1.html))も提出されたが、いずれも否決されてC++20仕様に落ち着いた。 -## 関連項目 +## 関連項目 - C++20 [``](/reference/coroutine.md) - C++23 [``](/reference/generator.md) @@ -626,4 +634,4 @@ C++20コルーチンに関するキーワードは、いずれも接頭辞`co_` - [C++ Coroutines: Understanding the promise type](https://lewissbaker.github.io/2018/09/05/understanding-the-promise-type) - [C++ Coroutines: Understanding Symmetric Transfer](https://lewissbaker.github.io/2020/05/11/understanding_symmetric_transfer) - [C++ co_awaiting coroutines](https://web.archive.org/web/20210421165652/https://blog.panicsoftware.com/co_awaiting-coroutines/) -- [20分くらいでわかった気分になれるC++20コルーチン](https://www.slideshare.net/yohhoy/20c20) +- [20分くらいでわかった気分になれるC++20コルーチン](https://www.slideshare.net/yohhoy/20c20) \ No newline at end of file diff --git a/lang/cpp20/default_constructible_and_assignable_stateless_lambdas.md b/lang/cpp20/default_constructible_and_assignable_stateless_lambdas.md index 1420fbd9f6..9cad42c30f 100644 --- a/lang/cpp20/default_constructible_and_assignable_stateless_lambdas.md +++ b/lang/cpp20/default_constructible_and_assignable_stateless_lambdas.md @@ -1,6 +1,14 @@ # 状態を持たないラムダ式を、デフォルト構築可能、代入可能とする [P0624R2] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++17まではラムダ式の生成するクロージャ型に定義される特殊メンバ関数はコピー/ムーブコンストラクタとデストラクタのみだったが、C++20からは状態を持たない、すなわちキャプチャをしていないラムダ式の場合にのみそのクロージャ型はデフォルトコンストラクタと代入演算子を持つようになる。 @@ -155,8 +163,8 @@ set1 = set2; // C++17まではコンパイルエラー C++20では同時に[評価されない文脈にラムダ式を書くことができるようになった](./wording_for_lambdas_in_unevaluated_contexts.md)ため、この様な場合にラムダ式のクロージャ型を直接取得し渡すことができ、余計なコードをほとんど削減することができるようになる。 -## 関連項目 +## 関連項目 - [評価されない文脈でのラムダ式](./wording_for_lambdas_in_unevaluated_contexts.md) ## 参照 -- [P0624R2 Default constructible and assignable stateless lambdas](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0624r2.pdf) +- [P0624R2 Default constructible and assignable stateless lambdas](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0624r2.pdf) \ No newline at end of file diff --git a/lang/cpp20/default_member_initializers_for_bit_fields.md b/lang/cpp20/default_member_initializers_for_bit_fields.md index b4edb5594a..3d3bdb4d98 100644 --- a/lang/cpp20/default_member_initializers_for_bit_fields.md +++ b/lang/cpp20/default_member_initializers_for_bit_fields.md @@ -1,6 +1,14 @@ # ビットフィールドのメンバ変数初期化 [P0683R1] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++11で導入された[非静的メンバ変数の初期化子](/lang/cpp11/non_static_data_member_initializers.md)では、ビットフィールドは対象外であった。 @@ -68,7 +76,7 @@ int main() ``` -## 関連項目 +## 関連項目 - [C++11 非静的メンバ変数の初期化](/lang/cpp11/non_static_data_member_initializers.md) @@ -76,4 +84,3 @@ int main() - [P0187R0 Proposal of Bitfield Default Member Initializers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0187r0.pdf) - [R0187R1 Proposal/Wording for Bit-field Default Member Initializer Syntax](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0187r1.pdf) - [P0683R1 Default member initializers for bit-fields](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0683r1.html) - diff --git a/lang/cpp20/deprecate_implicit_capture_of_this_via_defcopy.md b/lang/cpp20/deprecate_implicit_capture_of_this_via_defcopy.md index 412554fab2..795b36fe40 100644 --- a/lang/cpp20/deprecate_implicit_capture_of_this_via_defcopy.md +++ b/lang/cpp20/deprecate_implicit_capture_of_this_via_defcopy.md @@ -1,6 +1,14 @@ # [=]によるthisの暗黙のキャプチャを非推奨化 [P0806R2] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++20からは、ラムダ式でのデフォルトコピーのキャプチャ指定`[=]`での`this`ポインタのキャプチャは非推奨となる。 @@ -38,10 +46,10 @@ int main() ``` -## 関連項目 +## 関連項目 - [C++11 ラムダ式](/lang/cpp11/lambda_expressions.md) - [C++20 ラムダ式のキャプチャとして`[=, this]`を許可する](allow_lambda_capture_equal_this.md) ## 参照 -- [P0806R2 Deprecate implicit capture of this via `[=]`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0806r2.html) +- [P0806R2 Deprecate implicit capture of this via `[=]`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0806r2.html) \ No newline at end of file diff --git a/lang/cpp20/deprecate_pod.md b/lang/cpp20/deprecate_pod.md index f0550541c8..03c4da1066 100644 --- a/lang/cpp20/deprecate_pod.md +++ b/lang/cpp20/deprecate_pod.md @@ -1,13 +1,21 @@ # PODを非推奨化 [P0767R1] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 [POD (Plain Old Data) という型の分類](/reference/type_traits/is_pod.md)は、C++11において[トリビアル型](/reference/type_traits/is_trivial.md)と[スタンダードレイアウト型](/reference/type_traits/is_standard_layout.md)に用語が分割された。 C++20では規格の文面に残っていた「POD」の使用をやめ、スタンダードレイアウト型などのほかの型分類に置き換えた。 -## 関連項目 +## 関連項目 - [`is_pod`](/reference/type_traits/is_pod.md) - [`aligned_storage`](/reference/type_traits/aligned_storage.md) - [`aligned_union`](/reference/type_traits/aligned_union.md) @@ -18,4 +26,4 @@ C++20では規格の文面に残っていた「POD」の使用をやめ、スタ - [P0767R1 Deprecate POD](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0767r1.html) - [N2342 POD's Revisited; Resolving Core Issue 568 (Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2342.htm) - [C++0x POD再考 - Faith and Brave - C++で遊ぼう](https://faithandbrave.hateblo.jp/entry/20081127/1227777378) - - C++11においてPODという用語が分割された文書 + - C++11においてPODという用語が分割された文書 \ No newline at end of file diff --git a/lang/cpp20/deprecate_uses_of_the_comma_operator_in_subscripting_expressions.md b/lang/cpp20/deprecate_uses_of_the_comma_operator_in_subscripting_expressions.md index b85ae365f7..d5e8cabe3a 100644 --- a/lang/cpp20/deprecate_uses_of_the_comma_operator_in_subscripting_expressions.md +++ b/lang/cpp20/deprecate_uses_of_the_comma_operator_in_subscripting_expressions.md @@ -1,6 +1,14 @@ # 添字演算子内でのカンマ演算子の使用を非推奨化 [P1161R3] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 多次元配列クラスを設計する場合などで、単一の引数しかとれない添字演算子に`ar[x, y]`のようにカンマ演算子をオーバーロードして複数のインデックスを指定できるようにすることがあった。 @@ -15,8 +23,8 @@ ar[x, y] // C++17:OK, C++20:非推奨 既存のカンマ演算子をオーバーロードしたコードを使用する場合は、丸カッコで囲むこと。 -## 関連項目 +## 関連項目 - [C++23 添字演算子の多次元サポート](/lang/cpp23/multidimensional_subscript_operator.md) ## 参照 -- [P1161R3 Deprecate uses of the comma operator in subscripting expressions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1161r3.html) +- [P1161R3 Deprecate uses of the comma operator in subscripting expressions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1161r3.html) \ No newline at end of file diff --git a/lang/cpp20/deprecating_volatile.md b/lang/cpp20/deprecating_volatile.md index 484101b073..e839c4a6e0 100644 --- a/lang/cpp20/deprecating_volatile.md +++ b/lang/cpp20/deprecating_volatile.md @@ -1,6 +1,14 @@ # ほとんどの`volatile`を非推奨化 [P1152R4] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 C++20より、`volatile`の本来の役割に照らして不正確、あるいは誤解を招く用法や無意味な用法について非推奨とされるようになる。 @@ -381,4 +389,4 @@ volatile device dev; - [P1831R0 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1831r0.html) - [P1831R0 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - [P2327R0 De-deprecating volatile compound assignment](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2327r1.pdf) -- [CWG Issue 2654. Un-deprecation of compound volatile assignments](https://cplusplus.github.io/CWG/issues/2654.html) +- [CWG Issue 2654. Un-deprecation of compound volatile assignments](https://cplusplus.github.io/CWG/issues/2654.html) \ No newline at end of file diff --git a/lang/cpp20/designated_initialization.md b/lang/cpp20/designated_initialization.md index 21eb9b3388..f21a37367f 100644 --- a/lang/cpp20/designated_initialization.md +++ b/lang/cpp20/designated_initialization.md @@ -2,6 +2,14 @@ * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 C++20では、波カッコによる集成体初期化においてメンバ名を指定して初期化が行える。 @@ -107,4 +115,4 @@ struct A a = {.x = 1, 2}; // Cでは有効、C++20では無効 ## 参照 -* [P0329R4 Designated initialization](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0329r4.pdf) +* [P0329R4 Designated initialization](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0329r4.pdf) \ No newline at end of file diff --git a/lang/cpp20/down_with_typename.md b/lang/cpp20/down_with_typename.md index 7d86fa8985..6694575063 100644 --- a/lang/cpp20/down_with_typename.md +++ b/lang/cpp20/down_with_typename.md @@ -2,6 +2,14 @@ * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 型しか現れない文脈では、依存名を解決するための`typename`キーワードを省略できるようにする。 @@ -82,4 +90,4 @@ struct Derived: T::Base // typename不要 ## 参照 -- [P0634R3 Down with `typename`!](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0634r3.html) +- [P0634R3 Down with `typename`!](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0634r3.html) \ No newline at end of file diff --git a/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md b/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md index 246e37c9a1..90f56aa926 100644 --- a/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md +++ b/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md @@ -1,6 +1,14 @@ # 可変長データを扱うクラスの効率的なdelete [P0722R3] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 従来のクラススコープでの`operator delete`オーバーロードにおいて、オーバーロードされた`operator delete`が呼び出されるのはそのクラスのオブジェクトが破棄された後であり、そのオーバーロード内からはそのクラスのオブジェクト(及びメンバ)にアクセスすることはできなかった。 @@ -420,7 +428,7 @@ struct S { 結局、`std::destroying_delete_t`を第二引数に取る形が一番シンプルかつ可読性が高いとして採用された。 -## 関連項目 +## 関連項目 - [C++14 サイズ付きデアロケーション](/lang/cpp14/sized_deallocation.md) - [`std::destroying_delete_t`](/reference/new/destroying_delete_t.md) @@ -429,4 +437,4 @@ struct S { - [P0722R3 Efficient sized delete for variable sized classes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0722r3.html) - [P0722R1 Efficient sized delete for variable sized classes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0722r1.html) -- [CWG Issue 2248. Problems with sized delete](https://cplusplus.github.io/CWG/issues/2248) +- [CWG Issue 2248. Problems with sized delete](https://cplusplus.github.io/CWG/issues/2248) \ No newline at end of file diff --git a/lang/cpp20/enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.md b/lang/cpp20/enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.md index 2a996c7516..0a947a7980 100644 --- a/lang/cpp20/enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.md +++ b/lang/cpp20/enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.md @@ -1,6 +1,14 @@ # constexpr関数内で未評価のインラインアセンブリを許可することによる組み込み関数のconstexpr有効化 [P1668R1] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 `asm`宣言によるインラインアセンブリは`constexpr`関数内に現れる事が禁止されていたため、`constexpr`関数内に書く事は出来なかった。C++20からはコンパイル時に評価されない限り、`asm`宣言を`constexpr`関数内に書く事ができるようになる。 @@ -93,10 +101,10 @@ int main() { 副次的だが、複雑なインラインアセンブリによる記述とともにシンプルなC++コードによる記述が同居している事で、インラインアセンブリが何をしているのかをユーザーが理解しやすくなるという効果もある。 -## 関連項目 +## 関連項目 - [`is_constant_evaluated`](/reference/type_traits/is_constant_evaluated.md) ## 参照 -- [P1668R1 Enabling constexpr Intrinsics By Permitting Unevaluated inline-assembly in constexpr Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1668r1.html) +- [P1668R1 Enabling constexpr Intrinsics By Permitting Unevaluated inline-assembly in constexpr Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1668r1.html) \ No newline at end of file diff --git a/lang/cpp20/explicit_bool.md b/lang/cpp20/explicit_bool.md index 344d574f9e..64a1ffee3c 100644 --- a/lang/cpp20/explicit_bool.md +++ b/lang/cpp20/explicit_bool.md @@ -1,6 +1,14 @@ # 関数を条件付きでexplicitにする構文を追加 [P0892R2] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++20では、関数を条件付きで`explicit`にする構文が追加された。コンストラクタと変換演算子に指定する`explicit`指定子に、`explicit(true)`、`explicit(false)`のように`bool`に変換可能な定数式を指定する。`true`に評価される値を指定することで、その関数は`explicit`となる。 @@ -157,11 +165,11 @@ struct pair { * std::is_convertible_v[link /reference/type_traits/is_convertible.md] -## 関連項目 +## 関連項目 - [`pair`のコンストラクタ](/reference/utility/pair/op_constructor.md) - [`tuple`のコンストラクタ](/reference/tuple/tuple/op_constructor.md) - [`optional`のコンストラクタ](/reference/optional/optional/op_constructor.md) ## 参照 -- [P0892R2 explicit(bool)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0892r2.html) +- [P0892R2 explicit(bool)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0892r2.html) \ No newline at end of file diff --git a/lang/cpp20/extending_structured_bindings_to_be_more_like_variable_declarations.md b/lang/cpp20/extending_structured_bindings_to_be_more_like_variable_declarations.md index ae1d35a1e8..8873ff8d07 100644 --- a/lang/cpp20/extending_structured_bindings_to_be_more_like_variable_declarations.md +++ b/lang/cpp20/extending_structured_bindings_to_be_more_like_variable_declarations.md @@ -1,6 +1,14 @@ # 構造化束縛を拡張して通常の変数宣言のように使用できるようにする [P1091R3] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++17で導入された構造化束縛宣言に指定しておけるのはCV修飾のみで、記憶域クラスや`constexpr`等を指定することは出来なかった。 このため、`thread_local`指定の変数や`constexpr`変数などの初期化のために構造化束縛を用いることが出来なかった。 @@ -125,7 +133,7 @@ int main() ただ、今回見送られた残りのものも将来的には許可される可能性がある。 -## 関連項目 +## 関連項目 - [C++17 構造化束縛](/lang/cpp17/structured_bindings.md) - [C++20 構造化束縛した変数の参照キャプチャを許可](/lang/cpp20/reference_capture_of_structured_bindings.md) @@ -134,4 +142,4 @@ int main() - [P1091R0 Extending structured bindings to be more like variable declarations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1091r0.html) - [P1091R1 Extending structured bindings to be more like variable declarations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1091r1.html) - [P1091R2 Extending structured bindings to be more like variable declarations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1091r2.html) -- [P1091R3 Extending structured bindings to be more like variable declarations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1091r3.html) +- [P1091R3 Extending structured bindings to be more like variable declarations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1091r3.html) \ No newline at end of file diff --git a/lang/cpp20/familiar_template_syntax_for_generic_lambdas.md b/lang/cpp20/familiar_template_syntax_for_generic_lambdas.md index 1e91bb228d..5a08c58096 100644 --- a/lang/cpp20/familiar_template_syntax_for_generic_lambdas.md +++ b/lang/cpp20/familiar_template_syntax_for_generic_lambdas.md @@ -1,6 +1,14 @@ # ジェネリックラムダのテンプレート構文 [P0428R2] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++14では、ラムダ式のパラメータ型に`auto`キーワードを使用することで、任意の型のパラメータを受け取れるようになった: @@ -124,10 +132,10 @@ auto f = [](Args&&... args) { * std::forward[link /reference/utility/forward.md] -## 関連項目 +## 関連項目 - [C++11 ラムダ式](/lang/cpp11/lambda_expressions.md) - [C++14 ジェネリックラムダ](/lang/cpp14/generic_lambdas.md) ## 参照 -- [P0428R2 Familiar template syntax for generic lambdas](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0428r2.pdf) +- [P0428R2 Familiar template syntax for generic lambdas](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0428r2.pdf) \ No newline at end of file diff --git a/lang/cpp20/feature_test_macros.md b/lang/cpp20/feature_test_macros.md index ece68f1b89..e8a9335cf1 100644 --- a/lang/cpp20/feature_test_macros.md +++ b/lang/cpp20/feature_test_macros.md @@ -1,6 +1,14 @@ # 機能テストマクロ * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 ### 言語機能 @@ -101,4 +109,4 @@ ## 参照 -- [SD-FeatureTest: Feature-Test Macros and Policies - isocpp](https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations) +- [SD-FeatureTest: Feature-Test Macros and Policies - isocpp](https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations) \ No newline at end of file diff --git a/lang/cpp20/fixing_const_qualified_pointers_to_members.md b/lang/cpp20/fixing_const_qualified_pointers_to_members.md index e5781123ae..cd37f49178 100644 --- a/lang/cpp20/fixing_const_qualified_pointers_to_members.md +++ b/lang/cpp20/fixing_const_qualified_pointers_to_members.md @@ -1,6 +1,14 @@ # const修飾されたメンバポインタの制限を修正 [P0704R1] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++11で[メンバ関数を左辺値/右辺値修飾](/lang/cpp11/ref_qualifier_for_this.md)する機能が導入された。その際、以下の例において、同じ関数を呼び出す場合でも、メンバ関数ポインタを介した方だけが不適格となっていた: @@ -18,9 +26,9 @@ C++20ではこの式が許可され、仕様としては以下のように`const 「`.*`式において、右辺値オブジェクトに対して左辺値修飾された非`const`のメンバ関数ポインタを呼び出すことは不適格となる」 -## 関連項目 +## 関連項目 - [C++11 メンバ関数の左辺値/右辺値修飾](/lang/cpp11/ref_qualifier_for_this.md) ## 参照 -- [P0704R1 Fixing const-qualified pointers to members](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0704r1.html) +- [P0704R1 Fixing const-qualified pointers to members](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0704r1.html) \ No newline at end of file diff --git a/lang/cpp20/function_templates_with_auto_parameters.md b/lang/cpp20/function_templates_with_auto_parameters.md index 88ab7ff9b1..dfb0844cd9 100644 --- a/lang/cpp20/function_templates_with_auto_parameters.md +++ b/lang/cpp20/function_templates_with_auto_parameters.md @@ -1,6 +1,14 @@ # autoパラメータによる関数テンプレートの簡易定義 * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++14で導入された[ジェネリックラムダ](/lang/cpp14/generic_lambdas.md)と同様に、通常の関数もパラメータ型を`auto`にすることで、簡易的に関数テンプレートを定義できるようにする。 @@ -39,10 +47,10 @@ int main() 0.3 ``` -## 関連項目 +## 関連項目 - [C++14 ジェネリックラムダ](/lang/cpp14/generic_lambdas.md) - [C++20 コンセプト](concepts.md) ## 参照 -- [P1141R2 Yet another approach for constrained declarations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1141r2.html) +- [P1141R2 Yet another approach for constrained declarations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1141r2.html) \ No newline at end of file diff --git a/lang/cpp20/immediate_functions.md b/lang/cpp20/immediate_functions.md index 94dc248583..3aab076fef 100644 --- a/lang/cpp20/immediate_functions.md +++ b/lang/cpp20/immediate_functions.md @@ -2,6 +2,14 @@ * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++20では、関数またはメンバ関数に対して、`consteval`キーワードで常に定数式評価されるよう指定できる。そのような関数を**即時関数**(immediate function)という。 @@ -97,7 +105,7 @@ C++11で導入された`constexpr`指定子によって、関数を定数式評 当初は `constexpr!`というキーワードが提案されていたが、最終的に`consteval`になった。 -## 関連項目 +## 関連項目 * [C++11 `constexpr`](/lang/cpp11/constexpr.md) * [C++20 コンパイル時初期化を強制する`constinit`キーワードを追加](constinit.md) @@ -106,4 +114,4 @@ C++11で導入された`constexpr`指定子によって、関数を定数式評 ## 参照 -* [P1073R3 Immediate functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1073r3.html) +* [P1073R3 Immediate functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1073r3.html) \ No newline at end of file diff --git a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md index 1b8fb0efb9..1abdbef19e 100644 --- a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md +++ b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md @@ -1,6 +1,14 @@ # 未初期化領域への暗黙的なオブジェクト構築 * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 `new`式ではなく`malloc()`等他の方法で確保されたメモリ領域には、明示的にオブジェクトの構築を行うまで想定する型のオブジェクトは生存期間内になく、そのアクセス(読み書き)は未定義動作となる。 @@ -393,7 +401,7 @@ unique_ptr Stream::read() { なお、2番目の特殊なライブラリ関数もC++23で`std::start_lifetime_as()`として追加されている。 -## 関連項目 +## 関連項目 - [`start_lifetime_as()`](/reference/memory/start_lifetime_as.md.nolink) - [`start_lifetime_as_array()`](/reference/memory/start_lifetime_as_array.md.nolink) @@ -405,4 +413,4 @@ unique_ptr Stream::read() { - [P0593R0 What to do with buffers that are not arrays, and undefined behavior thereof?](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0593r0.html) - [CWG Issue 2325. `std::launder` and reuse of character buffers](https://cplusplus.github.io/CWG/issues/2325.html) - [CWG Issue 2605. Implicit-lifetime aggregates](https://cplusplus.github.io/CWG/issues/2605.html) -- [P1839R5 Accessing Object Representations](https://wg21.link/p1839r5) +- [P1839R5 Accessing Object Representations](https://wg21.link/p1839r5) \ No newline at end of file diff --git a/lang/cpp20/language_support_for_empty_objects.md b/lang/cpp20/language_support_for_empty_objects.md index 14d3c4804f..e44221ece6 100644 --- a/lang/cpp20/language_support_for_empty_objects.md +++ b/lang/cpp20/language_support_for_empty_objects.md @@ -2,6 +2,14 @@ * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++20では、空オブジェクトに対する最適化を支援する属性`[[no_unique_address]]`が追加された。 @@ -119,9 +127,9 @@ int main() `[[no_unique_address]]`を使うことで、基底クラスのサブオブジェクトだけでなくメンバ変数のサイズも0にできるので、EBOのために設計を変える必要がなくなる。 -## 関連項目 +## 関連項目 - [C++11 属性構文](/lang/cpp11/attributes.md) - [`is_empty`](/reference/type_traits/is_empty.md) ## 参照 -- [P0840R2 Language support for empty objects](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0840r2.html) +- [P0840R2 Language support for empty objects](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0840r2.html) \ No newline at end of file diff --git a/lang/cpp20/less_eager_instantiation_of_constexpr_functions.md b/lang/cpp20/less_eager_instantiation_of_constexpr_functions.md index f1fc80c787..0620316fbd 100644 --- a/lang/cpp20/less_eager_instantiation_of_constexpr_functions.md +++ b/lang/cpp20/less_eager_instantiation_of_constexpr_functions.md @@ -1,6 +1,14 @@ # 評価されない文脈での定数式評価によって特殊メンバ関数がインスタンス化されることを規定 [P0859R0] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 以前まで、デフォルトコンストラクタやムーブコンストラクタといった特殊メンバ関数は、odr-usedになった段階で定義される規定になっていた。しかし、`sizeof`や`decltype`のオペランドのような評価されない文脈においてはodr-usedにならないため、そのような文脈では特殊メンバ関数が使用できなかった。 @@ -30,4 +38,4 @@ int n = sizeof(short{duration(duration())}); ## 参照 - [CWG Issue 1581. When are constexpr member functions defined?](https://wg21.cmeerw.net/cwg/issue1581) -- [P0859R0: Core Issue 1581: When are constexpr member functions defined?](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0859r0.html) +- [P0859R0: Core Issue 1581: When are constexpr member functions defined?](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0859r0.html) \ No newline at end of file diff --git a/lang/cpp20/likely_and_unlikely_attributes.md b/lang/cpp20/likely_and_unlikely_attributes.md index 78625c5381..134f043937 100644 --- a/lang/cpp20/likely_and_unlikely_attributes.md +++ b/lang/cpp20/likely_and_unlikely_attributes.md @@ -1,6 +1,14 @@ # 確率が高い分岐と低い分岐を伝える属性 [[likely]], [[unlikely]] [P0479R5] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 if文やswitch文といった分岐制御構文において、条件分岐先のうちどれが実行される可能性が高いかという情報を、C++コンパイラへ最適化ヒントとして与える属性である。 これらの属性を適切に用いると、C++コンパイラはより高速に動作するプログラムを生成する可能性がある。 @@ -63,7 +71,7 @@ std::string fizzbuzz(int n) GCCやClangなど一部C++コンパイラでは独自拡張として同等機能を提供しており、Linuxカーネルや大規模OSSによる広い利用実績があったため、C++標準の属性として採用された。 -## 関連項目 +## 関連項目 - [C++23 `[[assume]]`属性](/lang/cpp23/portable_assumptions.md) @@ -72,4 +80,4 @@ GCCやClangなど一部C++コンパイラでは独自拡張として同等機能 - [GCC __builtin_expect組み込み関数](https://gcc.gnu.org/onlinedocs/gcc/extensions-to-the-c-language-family/other-built-in-functions-provided-by-gcc.html) - [Clang __builtin_expect組み込み関数](https://llvm.org/docs/BranchWeightMetadata.html) - [P0479R2 Attributes for Likely and Unlikely Statements (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0479r2.html) -- [P0479R5 Proposed wording for likely and unlikely attributes (Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0479r5.html) +- [P0479R5 Proposed wording for likely and unlikely attributes (Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0479r5.html) \ No newline at end of file diff --git a/lang/cpp20/make_char16t_char32t_string_literals_be_utf16_32.md b/lang/cpp20/make_char16t_char32t_string_literals_be_utf16_32.md index 0ea8e2d7b5..8024ceda99 100644 --- a/lang/cpp20/make_char16t_char32t_string_literals_be_utf16_32.md +++ b/lang/cpp20/make_char16t_char32t_string_literals_be_utf16_32.md @@ -1,6 +1,14 @@ # char16_tとchar32_tの文字・文字列リテラルを、文字コードUTF-16/32に規定 [P1041R4] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++11で追加された文字型[`char16_t`と`char32_t`](/lang/cpp11/char16_32.md)の文字・文字列リテラルの文字コード、C++20からはUTF-16とUTF-32であることが規定される。 @@ -22,11 +30,11 @@ C++20では、無条件にUTF-16とUTF-32であることが規定される。 実際にはすべての実装でこれらの文字・文字列リテラルはUTF-16とUTF-32にエンコーディングされるため、要件を示すだけではなく、より明確にするために、`char16_t`と`char32_t`の文字・文字列リテラルがUTF-16とUTF-32文字コードであることを規定する。 -## 関連項目 +## 関連項目 - [C++11 `char16_t`と`char32_t`](/lang/cpp11/char16_32.md) - [C++11 UTF-8文字列リテラル](/lang/cpp11/utf8_string_literals.md) - [C++17 UTF-8文字リテラル](/lang/cpp17/utf8_character_literals.md) ## 参照 -- [P1041R4 Make `char16_t`/`char32_t` string literals be UTF-16/32](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1041r4.html) +- [P1041R4 Make `char16_t`/`char32_t` string literals be UTF-16/32](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1041r4.html) \ No newline at end of file diff --git a/lang/cpp20/modules.md b/lang/cpp20/modules.md index 7bcd78598b..b266f80a71 100644 --- a/lang/cpp20/modules.md +++ b/lang/cpp20/modules.md @@ -1,6 +1,14 @@ # モジュール [P1103R3] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++20では、ヘッダーファイル・ソースファイルに代わる新たなファイル分割の仕組みとしてモジュールが導入された。 @@ -480,7 +488,7 @@ int main() { モジュールは、以上のような問題のないプログラム分割の仕組みとして導入された。 -## 関連項目 +## 関連項目 - [C++23 無意味なexport宣言を禁止する](/lang/cpp23/meaningful_exports.md) @@ -496,4 +504,4 @@ Standard library header units for C++20](http://www.open-std.org/jtc1/sc22/wg21/ Mitigating minor modules maladies](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1766r1.html) - [P1811R0 Relaxing redefinition restrictions for re-exportation robustness](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1811r0.html#problem) - 同時に到達可能とならなければODR違反にならないという仕様が削除された。また、インポータブルヘッダーの`#include`を`import`に置き換えるかは処理系定義となった。 + 同時に到達可能とならなければODR違反にならないという仕様が削除された。また、インポータブルヘッダーの`#include`を`import`に置き換えるかは処理系定義となった。 \ No newline at end of file diff --git a/lang/cpp20/more_constexpr_containers.md b/lang/cpp20/more_constexpr_containers.md index 98cd1f0867..1f0d0d409a 100644 --- a/lang/cpp20/more_constexpr_containers.md +++ b/lang/cpp20/more_constexpr_containers.md @@ -1,6 +1,14 @@ # 可変サイズをもつコンテナのconstexpr化 [P0784R7] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++20より、定数式における動的メモリ確保と解放が許可される。それに伴い、`std::vector`と`std::string`の全メンバ関数が`constexpr`対応し、定数式で使用できるようになる。 @@ -328,7 +336,7 @@ int main() { これらの問題について、`std::mark_immutable_if_constexpr()`によるアプローチを標準化委員会が嫌ったことと、2つ目の問題の解決が簡単ではなかった(時間がかかり得た)事から、コンパイル時に確保したメモリを実行時に持ち越すことについてはC++20への導入を見送ることとなった。 -## 関連項目 +## 関連項目 - [動的メモリ確保の省略の許可](/lang/cpp14/clarifying_memory_allocation.md) - [`allocator`](/reference/memory/allocator.md) @@ -348,4 +356,4 @@ int main() { - [P0784R7 More constexpr containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0784r7.html) - [動的メモリー確保 - 江添亮の入門C++](https://ezoeryou.github.io/cpp-intro/#動的メモリー確保) - [N3664 Clarifying Memory Allocation](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3664.html) -- [P1974R0 Non-transient constexpr allocation using propconst](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1974r0.pdf) +- [P1974R0 Non-transient constexpr allocation using propconst](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1974r0.pdf) \ No newline at end of file diff --git a/lang/cpp20/nested_inline_mamespaces.md b/lang/cpp20/nested_inline_mamespaces.md index 7b91ac6dd1..3a18da4721 100644 --- a/lang/cpp20/nested_inline_mamespaces.md +++ b/lang/cpp20/nested_inline_mamespaces.md @@ -1,6 +1,14 @@ # 入れ子名前空間定義でのインライン名前空間 [P1094R2] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++17で、入れ子の名前空間を`namespace ns1::ns2::ns3 {}`のように簡易的に定義できるようになったが、インライン名前空間の指定はできなかった。 @@ -25,10 +33,10 @@ namespace ns3 { ``` -## 関連項目 +## 関連項目 - [C++11 インライン名前空間](/lang/cpp11/inline_namespaces.md) - [C++17 入れ子名前空間の定義](/lang/cpp17/nested_namespace.md) ## 参照 -- [P1094R2 Nested Inline Namespaces](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1094r2.html) +- [P1094R2 Nested Inline Namespaces](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1094r2.html) \ No newline at end of file diff --git a/lang/cpp20/nodiscard_for_constructors.md b/lang/cpp20/nodiscard_for_constructors.md index 0c2d764f02..7cf4e088f2 100644 --- a/lang/cpp20/nodiscard_for_constructors.md +++ b/lang/cpp20/nodiscard_for_constructors.md @@ -1,6 +1,14 @@ # [[nodiscard]]をコンストラクタのオーバーロードごとに付加できるようにする * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 戻り値が使用されない場合に警告を出力させる[`[[nodiscard]]`属性](/lang/cpp17/nodiscard.md)を、コンストラクタのオーバーロードに付加できるようにする。 @@ -50,10 +58,10 @@ prog.cc:11:12: note: declared here ``` -## 関連項目 +## 関連項目 - [C++17 `[[nodiscard]]`属性](/lang/cpp17/nodiscard.md) - [C++20 `[[nodiscard]]`属性に理由となる文字列を付加できるようにする](nodiscard_should_have_a_reason.md) ## 参照 -- [P1771R1 `[[nodiscard]]` for constructors](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1771r1.pdf) +- [P1771R1 `[[nodiscard]]` for constructors](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1771r1.pdf) \ No newline at end of file diff --git a/lang/cpp20/nodiscard_should_have_a_reason.md b/lang/cpp20/nodiscard_should_have_a_reason.md index 8f8d86e37a..9d061c9fbd 100644 --- a/lang/cpp20/nodiscard_should_have_a_reason.md +++ b/lang/cpp20/nodiscard_should_have_a_reason.md @@ -1,6 +1,14 @@ # [[nodiscard]]属性に理由となる文字列を付加できるようにする [P1301R4] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 戻り値が使用されない場合に警告を出力させる[`[[nodiscard]]`属性](/lang/cpp17/nodiscard.md)に、戻り値を無視してはならない理由を文字列リテラルとして指定できるようにする。 @@ -84,10 +92,10 @@ prog.cc:26:8: note: declared here ``` -## 関連項目 +## 関連項目 - [C++17 `[[nodiscard]]`属性](/lang/cpp17/nodiscard.md) - [C++20 `[[nodiscard]]`をコンストラクタのオーバーロードごとに付加できるようにする](nodiscard_for_constructors.md) ## 参照 -- [P1301R4 `[[nodiscard("should have a reason")]]`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1301r4.html) +- [P1301R4 `[[nodiscard("should have a reason")]]`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1301r4.html) \ No newline at end of file diff --git a/lang/cpp20/permit_conversions_to_arrays_of_unknown_bound.md b/lang/cpp20/permit_conversions_to_arrays_of_unknown_bound.md index cf3a5780c1..5954a8f861 100644 --- a/lang/cpp20/permit_conversions_to_arrays_of_unknown_bound.md +++ b/lang/cpp20/permit_conversions_to_arrays_of_unknown_bound.md @@ -2,6 +2,14 @@ * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 C++20では、要素数が既知の配列型から要素数不明の配列型への暗黙変換が可能になる。 @@ -108,4 +116,4 @@ g(arr); // OK ## 参照 -* [P0388R4 Permit conversions to arrays of unknown bound](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0388r4.html) +* [P0388R4 Permit conversions to arrays of unknown bound](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0388r4.html) \ No newline at end of file diff --git a/lang/cpp20/permitting_trivial_default_initialization_in_constexpr_contexts.md b/lang/cpp20/permitting_trivial_default_initialization_in_constexpr_contexts.md index 268c00f4cd..bdf68c4833 100644 --- a/lang/cpp20/permitting_trivial_default_initialization_in_constexpr_contexts.md +++ b/lang/cpp20/permitting_trivial_default_initialization_in_constexpr_contexts.md @@ -1,6 +1,14 @@ # constexpr関数内でのトリビアルなデフォルト初期化を許可 [P1331R2] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 型`T`の変数を単に`T t;`のように(関数スコープで)初期化した時、`T`がクラス型であり非トリビアルなデフォルトコンストラクタを持っているか、集成体型であり全てのメンバがデフォルトメンバ初期化によって初期化されていれば、`t`は初期化されており値は決定的である。しかし、組み込み型など[トリビアルにデフォルト構築可能](/reference/type_traits/is_trivially_default_constructible.md)な型の場合はその初期化は実装定義であり、その値の読み取りは未定義動作である。 @@ -113,10 +121,10 @@ int main() { そのため、トリビアルな型のローカル変数のトリビアルなデフォルト初期化そのものは未定義動作ではなく、その値の読み取りが未定義動作であり、そのような初期化そのものを禁止するのは過度な制限であるとして緩和される事となった。ただし、その値の読み取りは依然として未定義動作であり、定数式で現れてはならない。 -## 関連項目 +## 関連項目 - [可変サイズをもつコンテナの`constexpr`化](more_constexpr_containers.md) ## 参照 -- [P1331R2 Permitting trivial default initialization in constexpr contexts](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1331r2.pdf) +- [P1331R2 Permitting trivial default initialization in constexpr contexts](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1331r2.pdf) \ No newline at end of file diff --git a/lang/cpp20/predefined_macros.md b/lang/cpp20/predefined_macros.md index 6552c88c62..f0b0c6bf24 100644 --- a/lang/cpp20/predefined_macros.md +++ b/lang/cpp20/predefined_macros.md @@ -1,6 +1,14 @@ # 更新された定義済みマクロ * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 定義済みマクロの値が、以下のように更新された: @@ -11,4 +19,4 @@ ## 参照 -- [N4859 Editors' Report -- Programming Languages -- C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/n4859.html) +- [N4859 Editors' Report -- Programming Languages -- C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/n4859.html) \ No newline at end of file diff --git a/lang/cpp20/prohibit_aggregates_with_user-declared_constructors.md b/lang/cpp20/prohibit_aggregates_with_user-declared_constructors.md index 5c638117e3..0b8756e49c 100644 --- a/lang/cpp20/prohibit_aggregates_with_user-declared_constructors.md +++ b/lang/cpp20/prohibit_aggregates_with_user-declared_constructors.md @@ -1,6 +1,14 @@ # ユーザー宣言したコンストラクタを持つクラスの集成体初期化を禁止 [P1008R1] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 ユーザー宣言されたコンストラクタをもつクラスを、集成体初期化によってコンストラクタを回避してオブジェクト構築できてしまっていた技法を禁止する。 @@ -106,4 +114,4 @@ int main() { ## 参照 -- [P1008R1 Prohibit aggregates with user-declared constructors](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1008r1.pdf) +- [P1008R1 Prohibit aggregates with user-declared constructors](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1008r1.pdf) \ No newline at end of file diff --git a/lang/cpp20/range-based_for_statements_with_initializer.md b/lang/cpp20/range-based_for_statements_with_initializer.md index af28928cc6..8265768703 100644 --- a/lang/cpp20/range-based_for_statements_with_initializer.md +++ b/lang/cpp20/range-based_for_statements_with_initializer.md @@ -1,6 +1,14 @@ # 初期化式をともなう範囲for文 [P0614R1] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 if文、switch文、for文と同様に、範囲for文でもそのスコープで使用する変数の初期化ができるよう構文を追加する。 @@ -113,10 +121,10 @@ int main() ``` -## 関連項目 +## 関連項目 - [C++17 if文とswitch文の条件式と初期化を分離](/lang/cpp17/selection_statements_with_initializer.md) - [C++23 初期化文での型の別名宣言を許可](/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md) ## 参照 -- [P0614R1 Range-based for statements with initializer](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0614r1.html) +- [P0614R1 Range-based for statements with initializer](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0614r1.html) \ No newline at end of file diff --git a/lang/cpp20/reference_capture_of_structured_bindings.md b/lang/cpp20/reference_capture_of_structured_bindings.md index 6c436a215c..58673dec13 100644 --- a/lang/cpp20/reference_capture_of_structured_bindings.md +++ b/lang/cpp20/reference_capture_of_structured_bindings.md @@ -1,6 +1,14 @@ # 構造化束縛した変数の参照キャプチャを許可 [P1381R1] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 構造化束縛した変数はラムダ式で参照キャプチャできない規定となっていたが、これを許可する。ただし、ビットフィールドを構造化束縛した変数は参照キャプチャできない。 @@ -29,10 +37,10 @@ int main() { - 参照キャプチャできない要素として、ビットフィールド、構造化束縛した変数、無名共用体のメンバの3つがあったが、C++20ではこの不許可リストから「構造化束縛した変数」が削除された -## 関連項目 +## 関連項目 - [C++17 構造化束縛](/lang/cpp17/structured_bindings.md) - [C++20 構造化束縛を拡張して通常の変数宣言のように使用できるようにする](extending_structured_bindings_to_be_more_like_variable_declarations.md) ## 参照 -- [P1381R1 Reference capture of structured bindings](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1381r1.html) +- [P1381R1 Reference capture of structured bindings](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1381r1.html) \ No newline at end of file diff --git a/lang/cpp20/relaxing_the_range_for_loop_customization_point_finding_rules.md b/lang/cpp20/relaxing_the_range_for_loop_customization_point_finding_rules.md index f1dc654f89..a9b5ceb34a 100644 --- a/lang/cpp20/relaxing_the_range_for_loop_customization_point_finding_rules.md +++ b/lang/cpp20/relaxing_the_range_for_loop_customization_point_finding_rules.md @@ -1,6 +1,14 @@ # 範囲for文がカスタマイゼーションポイントを見つけるルールを緩和 [P0962R1] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++17までは、範囲for文に指定するシーケンスの型が`begin`/`end`メンバのどちらかでも持っていれば`begin()`/`end()`メンバ関数を使用し、どちらも持っていなければADLで非メンバ関数の`begin()`/`end()`を探索する仕様となっていた。 @@ -55,10 +63,10 @@ o ``` -## 関連項目 +## 関連項目 - [C++11 範囲for文](/lang/cpp11/range_based_for.md) - [C++17 範囲forの制限緩和 — `begin` と `end` の型が異なることを許可](/lang/cpp17/generalizing_the_range-based_for_loop.md) ## 参照 -- [P0962R1 Relaxing the range-for loop customization point finding rules](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0962r1.html) +- [P0962R1 Relaxing the range-for loop customization point finding rules](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0962r1.html) \ No newline at end of file diff --git a/lang/cpp20/relaxing_the_structured_bindings_customization_point_finding_rules.md b/lang/cpp20/relaxing_the_structured_bindings_customization_point_finding_rules.md index 85607bc22e..3420cd9ca6 100644 --- a/lang/cpp20/relaxing_the_structured_bindings_customization_point_finding_rules.md +++ b/lang/cpp20/relaxing_the_structured_bindings_customization_point_finding_rules.md @@ -1,6 +1,14 @@ # 構造化束縛がカスタマイゼーションポイントを見つけるルールを緩和 [P0961R1] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++17までは、構造化束縛する対象の型が`get()`メンバ関数を持っていればその関数でメンバ変数を抽出し、持っていなければ非メンバ関数の`get()`関数で抽出する仕様となっていた。 @@ -48,9 +56,9 @@ int main() ``` -## 関連項目 +## 関連項目 - [C++17 構造化束縛](/lang/cpp17/structured_bindings.md) ## 参照 -- [P0961R1 Relaxing the structured bindings customization point finding rules](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0961r1.html) +- [P0961R1 Relaxing the structured bindings customization point finding rules](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0961r1.html) \ No newline at end of file diff --git a/lang/cpp20/remove_deprecated_nothrow_exception_specification.md b/lang/cpp20/remove_deprecated_nothrow_exception_specification.md index 43f6d61db7..58fb85bbc6 100644 --- a/lang/cpp20/remove_deprecated_nothrow_exception_specification.md +++ b/lang/cpp20/remove_deprecated_nothrow_exception_specification.md @@ -1,6 +1,14 @@ # throw()による例外送出しない指定を削除 * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++11で例外送出しないことを指定する[`noexcept`](/lang/cpp11/noexcept.md)が追加されたことによって古い例外仕様は非推奨化の後に削除されたが、なにも例外送出しないことを表す`throw()`指定は`noexcept`と同じ意味になるよう仕様が変更されて非推奨機能として維持されていた。 @@ -13,10 +21,10 @@ void f() throw(); C++20では、非推奨とされていた`throw()`指定の機能を削除する。代わりに`noexcept`を使用すること。 -## 関連項目 +## 関連項目 - [C++11 noexcept](/lang/cpp11/noexcept.md) - [C++17 非推奨だった古い例外仕様を削除](/lang/cpp17/remove_deprecated_exception_specifications.md) ## 参照 -- [P0619R4 Reviewing Deprecated Facilities of C++17 for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0619r4.html) +- [P0619R4 Reviewing Deprecated Facilities of C++17 for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0619r4.html) \ No newline at end of file diff --git a/lang/cpp20/reserving_attribute_namespaces_for_future_use.md b/lang/cpp20/reserving_attribute_namespaces_for_future_use.md index 9d64bd84cf..7f32e16ed9 100644 --- a/lang/cpp20/reserving_attribute_namespaces_for_future_use.md +++ b/lang/cpp20/reserving_attribute_namespaces_for_future_use.md @@ -1,6 +1,14 @@ # 属性の名前空間を予約 * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 将来的に標準で定義する属性のために、以下の名前空間の属性を予約する: @@ -8,8 +16,8 @@ - `std`および`std` + 数字の名前空間の属性 -## 関連項目 +## 関連項目 - [C++11 属性構文](/lang/cpp11/attributes.md) ## 参照 -- [P1908R1 Reserving Attribute Namespaces for Future Use](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1908r1.pdf) +- [P1908R1 Reserving Attribute Namespaces for Future Use](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1908r1.pdf) \ No newline at end of file diff --git a/lang/cpp20/resolving_const_mismatch_with_defaulted_copy_constructor.md b/lang/cpp20/resolving_const_mismatch_with_defaulted_copy_constructor.md index 06ff7ff03b..b2becb2f5b 100644 --- a/lang/cpp20/resolving_const_mismatch_with_defaulted_copy_constructor.md +++ b/lang/cpp20/resolving_const_mismatch_with_defaulted_copy_constructor.md @@ -1,6 +1,14 @@ # デフォルトのコピーコンストラクタと非constなコンストラクタが衝突する問題を修正 [P0641R2] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 C++17までは以下のように、自身の型の非`const`なオブジェクトをとるコンストラクタをもつクラスを定義し、 @@ -38,4 +46,4 @@ C++20では、このコードを適格とする。 ## 参照 -- [P0641R2 Resolving Core Issue #1331 (`const` mismatch with defaulted copy constructor)](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0641r2.html) +- [P0641R2 Resolving Core Issue #1331 (`const` mismatch with defaulted copy constructor)](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0641r2.html) \ No newline at end of file diff --git a/lang/cpp20/signed_integers_are_twos_complement.md b/lang/cpp20/signed_integers_are_twos_complement.md index 68606c12e9..cd9a35a4cc 100644 --- a/lang/cpp20/signed_integers_are_twos_complement.md +++ b/lang/cpp20/signed_integers_are_twos_complement.md @@ -1,6 +1,14 @@ # 符号付き整数型が2の補数表現であることを規定 [P1236R1] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++20では、符号付き整数型のビット表現を「2の補数 (Two's Complement)」に規定する。 @@ -130,7 +138,7 @@ Visual Studio、GCC、Clangといった主要な処理系が、2の補数以外 C11規格は、2の補数のほかに、1の補数表現 (Ones' complement) と符号ビット付き絶対値表現 (Signed magnitude) を許可しているが、C++では本文書の概要にも記載したように、ハッシュ値の一意性と全順序をサポートするため、2の補数に規定する。 -## 関連項目 +## 関連項目 - [`std::has_unique_object_representations`](/reference/type_traits/has_unique_object_representations.md) @@ -140,4 +148,4 @@ C11規格は、2の補数のほかに、1の補数表現 (Ones' complement) と - [P0907R4 Signed Integers are Two's Complement](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0907r4.html) - 元になった提案文書 - [符号付き整数型の負数表現を 2 の補数と規定 (P1236R1) - cppmap](https://cppmap.github.io/standardization/cpp20/#2-p1236r1) -- [2の補数表現における演算](http://www.cc.kyoto-su.ac.jp/~kbys/kiso/number/int-op.html) +- [2の補数表現における演算](http://www.cc.kyoto-su.ac.jp/~kbys/kiso/number/int-op.html) \ No newline at end of file diff --git a/lang/cpp20/simplifying_implicit_lambda_capture.md b/lang/cpp20/simplifying_implicit_lambda_capture.md index 9e7e3eae00..7e73596438 100644 --- a/lang/cpp20/simplifying_implicit_lambda_capture.md +++ b/lang/cpp20/simplifying_implicit_lambda_capture.md @@ -1,6 +1,14 @@ # 暗黙のラムダキャプチャを簡略化 [P0588R1] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 ここでは、ラムダ式での暗黙のキャプチャについて、以下の問題を解決する: @@ -24,10 +32,9 @@ void f() { 構造化束縛で導入された名前はラムダ式でキャプチャできない、と明記された。しかしその後、「[構造化束縛を拡張して通常の変数宣言のように使用できるようにする](extending_structured_bindings_to_be_more_like_variable_declarations.md)」の仕様でそれが可能となったため、この仕様変更は打ち消された。 -## 関連項目 +## 関連項目 - [C++17 構造化束縛](/lang/cpp17/structured_bindings.md) - [C++20 構造化束縛を拡張して通常の変数宣言のように使用できるようにする](extending_structured_bindings_to_be_more_like_variable_declarations.md) ## 参照 - [P0588R1 Simplifying implicit lambda capture](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0588r1.html) - diff --git a/lang/cpp20/try-catch_blocks_in_constexpr_functions.md b/lang/cpp20/try-catch_blocks_in_constexpr_functions.md index c33558df50..5c99de5984 100644 --- a/lang/cpp20/try-catch_blocks_in_constexpr_functions.md +++ b/lang/cpp20/try-catch_blocks_in_constexpr_functions.md @@ -1,6 +1,14 @@ # constexpr関数内でのtry-catchブロックを許可 [P1002R1] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++20では、`constexpr`関数内でのtry-catchブロックの使用を許可する。ただし、`throw`式は従来通り許可せず、コンパイルエラーとなる (`throw`式は`constexpr`関数におけるアサーションのような役割)。 @@ -21,9 +29,9 @@ constexpr int f(int x) { この機能が必要になったのは、リフレクションとメタプログラミングのためである。コンパイル時定数として[`std::vector`](/reference/vector/vector.md)を使用できるようにするためには、try-catchブロックを許可することが必要であった。libc++での[`vector::insert()`](/reference/vector/vector/insert.md)の実装において、try-catchブロックを使用して強い例外安全性の保証を提供している。 -## 関連項目 +## 関連項目 - [C++20 可変サイズをもつコンテナの`constexpr`化](more_constexpr_containers.md) ## 参照 -- [P1002R1 Try-catch blocks in constexpr functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1002r1.pdf) +- [P1002R1 Try-catch blocks in constexpr functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1002r1.pdf) \ No newline at end of file diff --git a/lang/cpp20/update_the_reference_to_the_unicode_standard.md b/lang/cpp20/update_the_reference_to_the_unicode_standard.md index e0908ebac5..57d751b341 100644 --- a/lang/cpp20/update_the_reference_to_the_unicode_standard.md +++ b/lang/cpp20/update_the_reference_to_the_unicode_standard.md @@ -1,6 +1,14 @@ # Unicode標準への参照を更新 * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 Unicode標準 (ISO/IEC 10646) としてこれまで、「ISO/IEC 10646-1:1993, Information technology — Universal Multiple-Octet Coded Character Set (UCS) — Part 1: Architecture and Basic Multilingual Plane」が参照されていた。 @@ -23,4 +31,4 @@ Unicode標準での用語定義が変更されたことにも影響がある。U ## 参照 -- [P1025R1 Update The Reference To The Unicode Standard](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1025r1.html) +- [P1025R1 Update The Reference To The Unicode Standard](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1025r1.html) \ No newline at end of file diff --git a/lang/cpp20/using_enum.md b/lang/cpp20/using_enum.md index cde6bcb744..50f661ffda 100644 --- a/lang/cpp20/using_enum.md +++ b/lang/cpp20/using_enum.md @@ -2,6 +2,14 @@ * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 名前空間のように、`using enum EnumType;`もしくは`using EnumType::enumerator`とすることで、列挙値のスコープ指定を省略できる。 @@ -110,10 +118,10 @@ C言語形式の列挙型を改善するために[スコープを持つ列挙型 これにより、C言語形式の列挙型をスコープを持つ列挙型へ置き換えるというリファクタリングをする際、(整数との暗黙変換を別とすれば)ソースコードレベルの互換性を保って置き換えることができるようにもなった。 -## 関連項目 +## 関連項目 - [スコープを持つ列挙型](/lang/cpp11/scoped_enum.md) ## 参照 -- [P1099R5 Using Enum](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1099r5.html) +- [P1099R5 Using Enum](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1099r5.html) \ No newline at end of file diff --git a/lang/cpp20/va_opt.md b/lang/cpp20/va_opt.md index d0e2d13f5b..1382eff726 100644 --- a/lang/cpp20/va_opt.md +++ b/lang/cpp20/va_opt.md @@ -1,6 +1,14 @@ # 可変引数が空でない場合のトークン置換 [P0306R4] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 新たなプリプロセスマクロ`__VA_OPT__`を追加する。このマクロは、マクロのパラメータとして受け取った可変引数が空でない場合に置換するトークンを指定する機能を持つ。 @@ -45,9 +53,9 @@ int main() ``` -## 関連項目 +## 関連項目 - [C++11 可変引数マクロ](/lang/cpp11/variadic_macros.md) ## 参照 -- [P0306R4 Comma omission and comma deletion](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0306r4.html) +- [P0306R4 Comma omission and comma deletion](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0306r4.html) \ No newline at end of file diff --git a/lang/cpp20/wording_for_lambdas_in_unevaluated_contexts.md b/lang/cpp20/wording_for_lambdas_in_unevaluated_contexts.md index fec2f2ee66..b630e29c57 100644 --- a/lang/cpp20/wording_for_lambdas_in_unevaluated_contexts.md +++ b/lang/cpp20/wording_for_lambdas_in_unevaluated_contexts.md @@ -1,6 +1,14 @@ # 評価されない文脈でのラムダ式 [P0315R4] * cpp20[meta cpp] +<-- start lang caution --> + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++17まではラムダ式が評価されない文脈に現れることはできなかったが、C++20からは評価されない文脈にラムダ式を書くことができるようになる。 @@ -130,11 +138,11 @@ C++17までは、ラムダ式をSFINAEの文脈で用いて擬似的なコンセ ただし、ラムダ式が外部リンケージを持つエンティティのシグネチャに現れる事は相変わらず禁止されている。ラムダ式を用いてSFINAEするなど、そのような事がしたい場合には[コンセプト](./concepts.md)を用いる事でより容易に目的を達成できる。 -## 関連項目 +## 関連項目 - [状態を持たないラムダ式を、デフォルト構築可能、代入可能とする](/lang/cpp20/default_constructible_and_assignable_stateless_lambdas.md) ## 参照 - [P0315R0 Wording for lambdas in unevaluated contexts](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0315r0.pdf) - [P0315R4 Wording for lambdas in unevaluated contexts](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0315r4.pdf) - [CWG Issue.1607 Lambdas in template parameters](https://wg21.cmeerw.net/cwg/issue1607) -- [C++標準化委員会の文書: P0310R--P0319R0 - 本の虫](https://ezoeryou.github.io/blog/article/2016-07-27-cpp-P0310R0-P0319R0.html) +- [C++標準化委員会の文書: P0310R--P0319R0 - 本の虫](https://ezoeryou.github.io/blog/article/2016-07-27-cpp-P0310R0-P0319R0.html) \ No newline at end of file diff --git a/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md b/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md index 24606375ab..531f80b993 100644 --- a/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md +++ b/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md @@ -1,6 +1,14 @@ # elif/elifdef/elifndefのサポートを追加 [P2334R1] * cpp23[meta cpp] +<-- start lang caution --> + +このページはC++23に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 C++23では、以下のプリプロセス時条件式が追加される: @@ -28,4 +36,4 @@ C++23では、以下のプリプロセス時条件式が追加される: ## 参照 -- [P2334R1 Add support for preprocessing directives elifdef and elifndef](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2334r1.pdf) +- [P2334R1 Add support for preprocessing directives elifdef and elifndef](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2334r1.pdf) \ No newline at end of file diff --git a/lang/cpp23/attributes_on_lambda_expressions.md b/lang/cpp23/attributes_on_lambda_expressions.md index 30cd03e4b9..7bb70ec96a 100644 --- a/lang/cpp23/attributes_on_lambda_expressions.md +++ b/lang/cpp23/attributes_on_lambda_expressions.md @@ -1,6 +1,14 @@ # ラムダ式に対する属性 [P2173R1] * cpp23[meta cpp] +<-- start lang caution --> + +このページはC++23に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++23では、ラムダ式のいくつかの箇所に属性を指定できる。 @@ -41,10 +49,10 @@ int main() ``` ``` -## 関連項目 +## 関連項目 - [C++11 ラムダ式](/lang/cpp11/lambda_expressions.md) - [C++11 属性構文](/lang/cpp11/attributes.md) ## 参照 -- [P2173R1 Attributes on Lambda-Expressions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2173r1.pdf) +- [P2173R1 Attributes on Lambda-Expressions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2173r1.pdf) \ No newline at end of file diff --git a/lang/cpp23/character_encoding_of_diagnostic_text.md b/lang/cpp23/character_encoding_of_diagnostic_text.md index 53dfff304d..dec01dca13 100644 --- a/lang/cpp23/character_encoding_of_diagnostic_text.md +++ b/lang/cpp23/character_encoding_of_diagnostic_text.md @@ -1,6 +1,14 @@ # 静的な診断メッセージの文字エンコーディング [P2246R1] * cpp23[meta cpp] +<-- start lang caution --> + +このページはC++23に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 C++23では、コンパイル時に診断メッセージを出力させる以下の機能について、ソースコードのエンコーディングが実行環境のエンコーディングで表現できない場合にどうするかの規定を見直す: @@ -15,4 +23,4 @@ C++20までは、「基本ソース文字集合に含まれない文字は出力 ## 参照 - [P2246R1 Character encoding of diagnostic text](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2246r1.pdf) -- [WG14 N2563 Character encoding of diagnostic text](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2563.pdf) +- [WG14 N2563 Character encoding of diagnostic text](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2563.pdf) \ No newline at end of file diff --git a/lang/cpp23/class_template_argument_deduction_from_inherited.md b/lang/cpp23/class_template_argument_deduction_from_inherited.md index ba94fb0f2c..89d13fb607 100644 --- a/lang/cpp23/class_template_argument_deduction_from_inherited.md +++ b/lang/cpp23/class_template_argument_deduction_from_inherited.md @@ -1,6 +1,14 @@ # 継承コンストラクタからのクラステンプレート引数の推論 [P2582R1] * cpp23[meta cpp] +<-- start lang caution --> + +このページはC++23に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++23では、派生クラスで定義した継承コンストラクタからでも、クラステンプレート引数を推論できるようになる。 @@ -53,10 +61,10 @@ G g(true, 'a', 1); // OK。Gに推論される ``` -## 関連項目 +## 関連項目 - [C++11 継承コンストラクタ](/lang/cpp11/inheriting_constructors.md) - [C++17 クラステンプレートのテンプレート引数推論](/lang/cpp17/type_deduction_for_class_templates.md) ## 参照 -- [P2582R1 Wording for class template argument deduction from inherited constructors](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2582r1.pdf) +- [P2582R1 Wording for class template argument deduction from inherited constructors](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2582r1.pdf) \ No newline at end of file diff --git a/lang/cpp23/consistent_character_literal_encoding.md b/lang/cpp23/consistent_character_literal_encoding.md index 17106dec61..34537e3bd9 100644 --- a/lang/cpp23/consistent_character_literal_encoding.md +++ b/lang/cpp23/consistent_character_literal_encoding.md @@ -1,6 +1,14 @@ # 文字リテラルエンコーディングを一貫させる [P2316R2] * cpp23[meta cpp] +<-- start lang caution --> + +このページはC++23に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 C++20までは、以下のような、プリプロセッサ上での文字リテラルの比較と、if文での文字リテラルの比較が同じであるという保証がなかった。 @@ -21,4 +29,4 @@ if ('A' == 0x41){} ## 参照 -- [P2316R2 Consistent character literal encoding](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2316r2.pdf) +- [P2316R2 Consistent character literal encoding](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2316r2.pdf) \ No newline at end of file diff --git a/lang/cpp23/consteval_needs_to_propagate_up.md b/lang/cpp23/consteval_needs_to_propagate_up.md index 8f7b945f1f..a0ba126e38 100644 --- a/lang/cpp23/consteval_needs_to_propagate_up.md +++ b/lang/cpp23/consteval_needs_to_propagate_up.md @@ -1,6 +1,14 @@ # constexpr関数内でconsteval関数を呼び出せない問題を軽減 [P2564R3] * cpp23[meta cpp] +<-- start lang caution --> + +このページはC++23に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++23では、`consteval`呼び出しを含む`constexpr`関数を、条件付きで`consteval`関数と見なすようになる。そうすることで、定数式の文脈での`consteval`関数の使用がよりかんたんになる。 @@ -100,9 +108,9 @@ constexpr int k(int) { // kは即時関数ではない ``` -## 関連項目 +## 関連項目 - [C++20 即時関数](/lang/cpp20/immediate_functions.md) ## 参照 -- [P2564R3 `consteval` needs to propagate up](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2564r3.html) +- [P2564R3 `consteval` needs to propagate up](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2564r3.html) \ No newline at end of file diff --git a/lang/cpp23/delimited_escape_sequences.md b/lang/cpp23/delimited_escape_sequences.md index b096127058..ca351ab411 100644 --- a/lang/cpp23/delimited_escape_sequences.md +++ b/lang/cpp23/delimited_escape_sequences.md @@ -1,6 +1,14 @@ # エスケープシーケンスの区切り [P2290R3] * cpp23[meta cpp] +<-- start lang caution --> + +このページはC++23に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++23では、文字列リテラル中に記述するエスケープシーケンスとユニバーサルキャラクタ名の範囲を明確にするための波カッコ (`{}`) で囲む構文が追加される。 @@ -31,9 +39,9 @@ u8"\u{1F1F8}"; // C++23 : 5文字のコードポイントも記述できる 8進数または16進数によるエスケープシーケンスは、8進数は3文字まで、16進数は無制限の文字数という制限の違いがあり、また、8進数または16進数ではない文字が現れることでエスケープシーケンスの範囲が終了するため注意が必要であった。 -## 関連項目 +## 関連項目 - [C++11 `char16_t`と`char32_t`](/lang/cpp11/char16_32.md) ## 参照 -- [P2290R3 Delimited escape sequences](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2290r3.pdf) +- [P2290R3 Delimited escape sequences](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2290r3.pdf) \ No newline at end of file diff --git a/lang/cpp23/down_with_lambda_parens.md b/lang/cpp23/down_with_lambda_parens.md index a993635f36..557c4a58c6 100644 --- a/lang/cpp23/down_with_lambda_parens.md +++ b/lang/cpp23/down_with_lambda_parens.md @@ -1,6 +1,14 @@ # ラムダ式で()を省略できる条件を緩和 [P1102R2] * cpp23[meta cpp] +<-- start lang caution --> + +このページはC++23に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++23では、ラムダ式のパラメータリストが空であれば、以下の要素を含む場合であってもパラメータリストの `()` を省略できる。 @@ -24,10 +32,10 @@ auto f5 = [] constexpr mutable noexcept -> bool { return true; }; // C++23 OK ``` -## 関連項目 +## 関連項目 - [C++11 ラムダ式](/lang/cpp11/lambda_expressions.md) - [C++23 `this`ポインタをもつ必要のない演算子を`static`として宣言できるようにする](/lang/cpp23/static_operator.md) ## 参照 -- [P1102R2 Down with `()`!](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1102r2.html) +- [P1102R2 Down with `()`!](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1102r2.html) \ No newline at end of file diff --git a/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md b/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md index bb3aeda352..6fe9cd4b73 100644 --- a/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md +++ b/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md @@ -1,6 +1,14 @@ # 初期化文での型の別名宣言を許可 [P2360R0] * cpp23[meta cpp] +<-- start lang caution --> + +このページはC++23に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 `if`文、`switch`文、範囲`for`文で初期化文を指定できるが、C++20までその初期化文では`typedef`による型の別名定義はできたが、`using`による型の別名定義はできなかった。 @@ -38,10 +46,10 @@ int main() } ``` -## 関連項目 +## 関連項目 - [C++17 if文とswitch文の条件式と初期化を分離](/lang/cpp17/selection_statements_with_initializer.md) - [C++20 初期化式をともなう範囲for文](/lang/cpp20/range-based_for_statements_with_initializer.md) ## 参照 -- [P2360R0 Extend init-statement to allow alias-declaration](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2360r0.html) +- [P2360R0 Extend init-statement to allow alias-declaration](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2360r0.html) \ No newline at end of file diff --git a/lang/cpp23/feature_test_macros.md b/lang/cpp23/feature_test_macros.md index 8bf3ab16e7..a0f9877dc4 100644 --- a/lang/cpp23/feature_test_macros.md +++ b/lang/cpp23/feature_test_macros.md @@ -1,6 +1,14 @@ # 機能テストマクロ * cpp23[meta cpp] +<-- start lang caution --> + +このページはC++23に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 ### 言語機能 @@ -20,4 +28,4 @@ ## 参照 -- [SD-FeatureTest: Feature-Test Macros and Policies - isocpp](https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations) +- [SD-FeatureTest: Feature-Test Macros and Policies - isocpp](https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations) \ No newline at end of file diff --git a/lang/cpp23/generalized_wording_for_partial_specializations.md b/lang/cpp23/generalized_wording_for_partial_specializations.md index a872492de3..7feeb55a3f 100644 --- a/lang/cpp23/generalized_wording_for_partial_specializations.md +++ b/lang/cpp23/generalized_wording_for_partial_specializations.md @@ -1,6 +1,14 @@ # 変数テンプレートの部分特殊化を許可 [P2096R2] * cpp23[meta cpp] +<-- start lang caution --> + +このページはC++23に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 変数テンプレートの仕様として、部分特殊化の許可を意図したような仕様はあったが、部分特殊化の多くの仕様はクラステンプレートのみを対象にしていた。 @@ -32,9 +40,9 @@ int main() { (nil) ``` -## 関連項目 +## 関連項目 - [C++14 変数テンプレート](/lang/cpp14/variable_templates.md) ## 参照 -- [P2096R2 Generalized wording for partial specializations](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2096r2.html) +- [P2096R2 Generalized wording for partial specializations](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2096r2.html) \ No newline at end of file diff --git a/lang/cpp23/if_consteval.md b/lang/cpp23/if_consteval.md index 856fae791c..15b1d65a83 100644 --- a/lang/cpp23/if_consteval.md +++ b/lang/cpp23/if_consteval.md @@ -1,6 +1,14 @@ # if consteval [P1938R3] * cpp23[meta cpp] +<-- start lang caution --> + +このページはC++23に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++23では、`constexpr`関数がコンパイル時に呼ばれたかを判定するための構文として、`if consteval`を導入する。これは「consteval if文」と呼ばれる。 @@ -101,10 +109,10 @@ constexpr size_t strlen(char const* s) { -## 関連項目 +## 関連項目 - [`std::is_constant_evaluated()`](/reference/type_traits/is_constant_evaluated.md) - [C++20 即時関数](/lang/cpp20/immediate_functions.md) ## 参照 -- [P1938R3 `if consteval`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1938r3.html) +- [P1938R3 `if consteval`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1938r3.html) \ No newline at end of file diff --git a/lang/cpp23/labels_at_the_end_of_compound_statements.md b/lang/cpp23/labels_at_the_end_of_compound_statements.md index dacce86cb3..88ddf35bcc 100644 --- a/lang/cpp23/labels_at_the_end_of_compound_statements.md +++ b/lang/cpp23/labels_at_the_end_of_compound_statements.md @@ -1,6 +1,14 @@ # 複合文の末尾へのラベルを許可 [P2324R2] * cpp23[meta cpp] +<-- start lang caution --> + +このページはC++23に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 C言語 (C23) との互換性のため、C言語で新しく許可された複合文の末尾 (関数末尾など`{}`ブロックの末尾) へのgotoラベルを許可する。 @@ -26,4 +34,4 @@ C++23でこの機能を導入することにより、gotoラベルを置ける ## 参照 - [P2324R2 Labels at the end of compound statements (C compatibility)](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2324r2.pdf) -- [C2X Proposal: WG14 N2508 Free Positioning of Labels Inside Compound Statements (updates N2496)](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2508.pdf) +- [C2X Proposal: WG14 N2508 Free Positioning of Labels Inside Compound Statements (updates N2496)](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2508.pdf) \ No newline at end of file diff --git a/lang/cpp23/lifetime_extension_in_range_based_for_loop.md b/lang/cpp23/lifetime_extension_in_range_based_for_loop.md index 21d2f13e73..c72b35aaf5 100644 --- a/lang/cpp23/lifetime_extension_in_range_based_for_loop.md +++ b/lang/cpp23/lifetime_extension_in_range_based_for_loop.md @@ -2,6 +2,14 @@ * cpp23[meta cpp] +<-- start lang caution --> + +このページはC++23に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 仕様 範囲for文 @@ -132,7 +140,7 @@ void foo() { 一時オブジェクトの寿命について、範囲for文に限定しない汎用的な方法も検討されたが、最終的には範囲for文の例外規定となった。 -## 関連項目 +## 関連項目 - [範囲for文](/lang/cpp11/range_based_for.md) @@ -141,4 +149,4 @@ void foo() { - [地に足のついた範囲for文 - 地面を見下ろす少年の足蹴にされる私](https://onihusube.hatenablog.com/entry/2022/12/05/000923) - [範囲for文範囲初期化子内の一時オブジェクト延命の説明見直し #1246](https://github.com/cpprefjp/site/issues/1246) -- [Are function parameter objects temporary objects?](https://stackoverflow.com/questions/77676199/are-function-parameter-objects-temporary-objects/77676480) +- [Are function parameter objects temporary objects?](https://stackoverflow.com/questions/77676199/are-function-parameter-objects-temporary-objects/77676480) \ No newline at end of file diff --git a/lang/cpp23/literal_suffix_for_signed_size_t.md b/lang/cpp23/literal_suffix_for_signed_size_t.md index 5a31e63cc8..0c9212fd2b 100644 --- a/lang/cpp23/literal_suffix_for_signed_size_t.md +++ b/lang/cpp23/literal_suffix_for_signed_size_t.md @@ -1,6 +1,14 @@ # (符号付き)size_tリテラルのためのサフィックス [P0330R8] * cpp23[meta cpp] +<-- start lang caution --> + +このページはC++23に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++23では、符号なし整数型[`size_t`](/reference/cstddef/size_t.md)に対応する符号付き整数型を表すリテラルの`z`および`Z`サフィックスを追加する。符号なしを表す`u`および`U`サフィックスをともに使用することで[`size_t`](/reference/cstddef/size_t.md)型のリテラルを記述できる。 @@ -52,10 +60,10 @@ case 1はコンパイルエラーとなる。[`std::min()`](/reference/algorithm case 2はC++23で導入する[`size_t`](/reference/cstddef/size_t.md)型リテラルを使用するため、問題なく動作する。 -## 関連項目 +## 関連項目 - [`std::cmp_less()`](/reference/utility/cmp_less.md) - [`std::ssize()`](/reference/iterator/ssize.md) ## 参照 -- [P0330R8 Literal Suffix for (signed) `size_t`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p0330r8.html) +- [P0330R8 Literal Suffix for (signed) `size_t`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p0330r8.html) \ No newline at end of file diff --git a/lang/cpp23/make_declaration_order_layout_mandated.md b/lang/cpp23/make_declaration_order_layout_mandated.md index 3bdb83bfa9..553fbfc235 100644 --- a/lang/cpp23/make_declaration_order_layout_mandated.md +++ b/lang/cpp23/make_declaration_order_layout_mandated.md @@ -1,6 +1,14 @@ # アクセス制御の異なるメンバ変数のレイアウトを宣言順に規定 [P1847R4] * cpp23[meta cpp] +<-- start lang caution --> + +このページはC++23に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 以下のようなアクセス制御の異なるメンバ変数のメモリレイアウトは、実装に対して自由に並び替えてよい、という規定になっていたが、これを宣言順に規定する。 @@ -20,4 +28,4 @@ public: ## 参照 -- [P1847R4 Make declaration order layout mandated](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1847r4.pdf) +- [P1847R4 Make declaration order layout mandated](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1847r4.pdf) \ No newline at end of file diff --git a/lang/cpp23/meaningful_exports.md b/lang/cpp23/meaningful_exports.md index c1bfe2765c..e31e14bf87 100644 --- a/lang/cpp23/meaningful_exports.md +++ b/lang/cpp23/meaningful_exports.md @@ -1,6 +1,14 @@ # 無意味なexport宣言を禁止する [P2615R1] * cpp23[meta cpp] +<-- start lang caution --> + +このページはC++23に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++20時点でのモジュール定義では、いくつかの不必要なexport宣言ができてしまっていた。 @@ -21,10 +29,10 @@ C++23では、本来必要のない以下の宣言に対するexport宣言を禁 ただし、この変更のあとでも、`export { … }`で囲まれた中では、これらが含まれていてもコンパイルエラーにはならない。 -## 関連項目 +## 関連項目 - [C++20 モジュール](/lang/cpp20/modules.md) ## 参照 - [P2615R1 Meaningful exports](https://open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2615r1.html) -- [CWG Issue 2443. Meaningless template exports](https://wg21.cmeerw.net/cwg/issue2443) +- [CWG Issue 2443. Meaningless template exports](https://wg21.cmeerw.net/cwg/issue2443) \ No newline at end of file diff --git a/lang/cpp23/mixed_string_literal_concatenation.md b/lang/cpp23/mixed_string_literal_concatenation.md index b93c80edb0..ce4b343c46 100644 --- a/lang/cpp23/mixed_string_literal_concatenation.md +++ b/lang/cpp23/mixed_string_literal_concatenation.md @@ -1,6 +1,14 @@ # 異なる文字エンコーディングをもつ文字列リテラルの連結を不適格とする [P2201R1] * cpp23[meta cpp] +<-- start lang caution --> + +このページはC++23に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 C++20までは、実装定義の動作として`L""`、`u8""`、`u""`、`U""`のようなエンコーディングが混在する文字列リテラルの連結を条件付きで許可していたが、これを禁止とする。 @@ -31,4 +39,4 @@ void f() { ## 参照 -- [P2201R1: Mixed string literal concatenation](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2201r1.html) +- [P2201R1: Mixed string literal concatenation](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2201r1.html) \ No newline at end of file diff --git a/lang/cpp23/multidimensional_subscript_operator.md b/lang/cpp23/multidimensional_subscript_operator.md index 3e7df114dc..ddecaa7769 100644 --- a/lang/cpp23/multidimensional_subscript_operator.md +++ b/lang/cpp23/multidimensional_subscript_operator.md @@ -1,6 +1,14 @@ # 添字演算子の多次元サポート [P2128R6] * cpp23[meta cpp] +<-- start lang caution --> + +このページはC++23に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++23では、多次元配列クラスを定義するために必要となる、添字演算子のオーバーロードを定義する際の複数引数を許可する。 @@ -41,10 +49,10 @@ int main() { 3 ``` -## 関連項目 +## 関連項目 - [C++20 添字演算子内でのカンマ演算子の使用を非推奨化](/lang/cpp20/deprecate_uses_of_the_comma_operator_in_subscripting_expressions.md) - [`std::mdspan`](/reference/mdspan/mdspan.md) ## 参照 -- [P2128R6 Multidimensional subscript operator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2128r6.pdf) +- [P2128R6 Multidimensional subscript operator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2128r6.pdf) \ No newline at end of file diff --git a/lang/cpp23/named_universal_character_escapes.md b/lang/cpp23/named_universal_character_escapes.md index 489dfb672e..facbcc229a 100644 --- a/lang/cpp23/named_universal_character_escapes.md +++ b/lang/cpp23/named_universal_character_escapes.md @@ -1,6 +1,14 @@ # 名前付きユニバーサルキャラクタ名 [P2071R2] * cpp23[meta cpp] +<-- start lang caution --> + +このページはC++23に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 これまで、Unicodeのユニバーサルキャラクタ名を指定するためには、`u8"\u0100"`のように`\u`または`\U`に続いてコードポイントを記述していた。 @@ -49,10 +57,10 @@ int main() Ā̀ ``` -## 関連項目 +## 関連項目 - [C++11 `char16_t`と`char32_t`](/lang/cpp11/char16_32.md) ## 参照 - [P2173R1 Attributes on Lambda-Expressions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2173r1.pdf) - [Unicode Character “Ā” (U+0100)](https://www.compart.com/en/unicode/U+0100) -- [Unicode Character “◌̀” (U+0300)](https://www.compart.com/en/unicode/U+0300) +- [Unicode Character “◌̀” (U+0300)](https://www.compart.com/en/unicode/U+0300) \ No newline at end of file diff --git a/lang/cpp23/narrowing_contextual_conversions_to_bool.md b/lang/cpp23/narrowing_contextual_conversions_to_bool.md index ece89bd082..8d383a5473 100644 --- a/lang/cpp23/narrowing_contextual_conversions_to_bool.md +++ b/lang/cpp23/narrowing_contextual_conversions_to_bool.md @@ -1,6 +1,14 @@ # 定数式の文脈でのboolへの縮小変換を許可 [P1401R5] * cpp23[meta cpp] +<-- start lang caution --> + +このページはC++23に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++23では、以下の定数式文脈での`bool`への縮小変換を許可する: @@ -31,10 +39,10 @@ if constexpr(flags & Flags::Exec) { … } // C++23以降 if constexpr (sizeof(int[2])) { … } // C++23:OK 縮小変換 ``` -## 関連項目 +## 関連項目 - [C++11 コンパイル時アサート](/lang/cpp11/static_assert.md) - [C++17 `constexpr if`文](/lang/cpp17/if_constexpr.md) ## 参照 -- [P1401R5 Narrowing contextual conversions to `bool`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1401r5.html) +- [P1401R5 Narrowing contextual conversions to `bool`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1401r5.html) \ No newline at end of file diff --git a/lang/cpp23/non_literal_variables_in_constexpr_functions.md b/lang/cpp23/non_literal_variables_in_constexpr_functions.md index e00bd42b94..28e088557a 100644 --- a/lang/cpp23/non_literal_variables_in_constexpr_functions.md +++ b/lang/cpp23/non_literal_variables_in_constexpr_functions.md @@ -1,6 +1,14 @@ # 定数式内での非リテラル変数、静的変数・スレッドローカル変数およびgotoとラベルの存在を許可する [P2242R3] * cpp23[meta cpp] +<-- start lang caution --> + +このページはC++23に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 `constexpr`関数が非リテラル変数、静的変数・スレッドローカル変数およびgoto文とラベルを含むことを許可する。 @@ -20,7 +28,7 @@ ただし、`constexpr`内に存在することが許可されたものの定数式として評価できるわけではないので、これらの機能は依然としてコンパイル時に使用することはできない。 -## 関連項目 +## 関連項目 - [C++20 - constexpr関数内でのtry-catchブロックを許可](/lang/cpp20/try-catch_blocks_in_constexpr_functions.md) - [C++20 - constexpr関数内で未評価のインラインアセンブリを許可することによる組み込み関数のconstexpr有効化](/lang/cpp20/enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.md) @@ -28,4 +36,4 @@ ## 参照 -- [P2242R3 - Non-literal variables (and labels and gotos) in constexpr functions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2242r3.html) +- [P2242R3 - Non-literal variables (and labels and gotos) in constexpr functions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2242r3.html) \ No newline at end of file diff --git a/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md b/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md index d394617d38..696f276a04 100644 --- a/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md +++ b/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md @@ -1,6 +1,14 @@ # constexpr関数内でのstatic constexpr変数を許可 [P2647R1] * cpp23[meta cpp] +<-- start lang caution --> + +このページはC++23に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++23からは、`constexpr`関数内で定数を定義するために、`static constexpr`変数を使用できるようになる。 @@ -19,8 +27,8 @@ constexpr char xdigit(int n) { C++20までは`constexpr`内で`static constexpr`変数を定義できなかったため、関数外での`static constexpr`変数の定義や、`consteval`関数で定数を返すなどの回避策がとられていたが、C++23からはそのような回避策が必要なくなる。 -## 関連項目 +## 関連項目 - [C++23 定数式内での非リテラル変数、静的変数・スレッドローカル変数およびgotoとラベルの存在を許可する](/lang/cpp23/non_literal_variables_in_constexpr_functions.md) ## 参照 -- [P2647R1 Permitting `static constexpr` variables in `constexpr` functions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2647r1.html) +- [P2647R1 Permitting `static constexpr` variables in `constexpr` functions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2647r1.html) \ No newline at end of file diff --git a/lang/cpp23/portable_assumptions.md b/lang/cpp23/portable_assumptions.md index 7e7506e4a9..32316f200c 100644 --- a/lang/cpp23/portable_assumptions.md +++ b/lang/cpp23/portable_assumptions.md @@ -1,6 +1,14 @@ # コード内容の仮定をコンパイラに伝える`assume`属性 [P1774R8] * cpp23[meta cpp] +<-- start lang caution --> + +このページはC++23に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 あるコード地点において実行時に満たすべき仮定(assumption)を、C++コンパイラへ最適化ヒントとして与える属性である。 `assume`属性を適切に用いると、C++コンパイラはより高速に動作し、サイズの小さいプログラムを生成する可能性がある。 @@ -56,11 +64,11 @@ int f(int y) 主要C++コンパイラでは独自拡張として同等機能を提供しており、高パフォーマンスや低レイテンシなアプリ開発向けでは有用であるため、C++標準の属性として採用された。 -## 関連項目 +## 関連項目 - [C++20 `[[likely]]`, `[[unlikely]]`属性](/lang/cpp20/likely_and_unlikely_attributes.md) ## 参照 - [Clang Builtin Functions `__builtin_assume`](https://clang.llvm.org/docs/LanguageExtensions.html) - [MSVC Compiler intrinsics `__assume`](https://learn.microsoft.com/en-us/cpp/intrinsics/assume) -- [P1774R8 Portable assumptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1774r8.pdf) +- [P1774R8 Portable assumptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1774r8.pdf) \ No newline at end of file diff --git a/lang/cpp23/predefined_macros.md b/lang/cpp23/predefined_macros.md index 0233a0e1e5..6aa42e5d39 100644 --- a/lang/cpp23/predefined_macros.md +++ b/lang/cpp23/predefined_macros.md @@ -1,6 +1,14 @@ # 更新された定義済みマクロ * cpp23[meta cpp] +<-- start lang caution --> + +このページはC++23に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 定義済みマクロの値が、以下のように更新された: @@ -11,4 +19,4 @@ ## 参照 -- [N4951 Editors’ Report: Programming Languages — C++](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4951.html) +- [N4951 Editors’ Report: Programming Languages — C++](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4951.html) \ No newline at end of file diff --git a/lang/cpp23/relaxing_some_constexpr_restrictions.md b/lang/cpp23/relaxing_some_constexpr_restrictions.md index f187fd29fa..c473f793c5 100644 --- a/lang/cpp23/relaxing_some_constexpr_restrictions.md +++ b/lang/cpp23/relaxing_some_constexpr_restrictions.md @@ -1,6 +1,14 @@ # constexpr関数が定数実行できない場合でも適格とする [P2448R2] * cpp23[meta cpp] +<-- start lang caution --> + +このページはC++23に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 いかなる呼び出しにおいても定数式実行できない`constexpr`関数が存在しても、プログラムが不適格にならないようにする。 @@ -105,11 +113,11 @@ void f(std::optional& opt) また、陽に`default`指定された関数は、それが`constexpr-suitable`である限り、暗黙に`constexpr`指定される。 `constexpr-suitable`とは、コルーチン関数ではなく、仮想基底クラスを持つクラスのコンストラクタまたはデストラクタでもない関数を指す。 -## 関連項目 +## 関連項目 - [C++20 - constexpr関数内でのtry-catchブロックを許可](/lang/cpp20/try-catch_blocks_in_constexpr_functions.md) - [C++20 - constexpr関数内で未評価のインラインアセンブリを許可することによる組み込み関数のconstexpr有効化](/lang/cpp20/enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.md) ## 参照 -- [P2448R2 - Relaxing some constexpr restrictions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2448r2.html) +- [P2448R2 - Relaxing some constexpr restrictions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2448r2.html) \ No newline at end of file diff --git a/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md b/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md index 83a1153f74..50fcf7747e 100644 --- a/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md +++ b/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md @@ -1,6 +1,14 @@ # 1ワイド文字に収まらないワイド文字リテラルを禁止する [P2362R3] * cpp23[meta cpp] +<-- start lang caution --> + +このページはC++23に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 C++23では、ワイド文字リテラルとして、以下を禁止する: @@ -24,4 +32,3 @@ wchar_t c = 'é́'; // C++20:OK, C++23:NG \u0065\u0301 ## 参照 - [P2362R3 Remove non-encodable wide character literals and multicharacter wide character literals](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2362r3.pdf) - diff --git a/lang/cpp23/simpler_implicit_move.md b/lang/cpp23/simpler_implicit_move.md index 1906cc1c29..2d8fa5284d 100644 --- a/lang/cpp23/simpler_implicit_move.md +++ b/lang/cpp23/simpler_implicit_move.md @@ -1,6 +1,14 @@ # 暗黙的なムーブを簡略化 [P2266R3] * cpp23[meta cpp] +<-- start lang caution --> + +このページはC++23に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 C++20の暗黙ムーブ仕様においては、暗黙ムーブ可能なもの(関数ローカルのオブジェクト/右辺値参照)が`return`文においてコピーされる場合に、可能ならば暗黙的にムーブして戻り値を構築するものだった。しかし、暗黙ムーブ可能なものを返しており`return`文でコピーが起こらない場合で、暗黙ムーブを行うことが適切な場合がまだ存在していた。 @@ -340,4 +348,4 @@ auto g(Widget&& w) -> Widget&& { - [P2266R3 Simpler implicit move](https://wg21.link/p2266r3) - [The Complete Guide to `return x;` - Arthur O'Dwyer - [CppNow 2021] - YouTube](https://www.youtube.com/watch?v=OGKAJD7bmr8) -- [c++ - Does c++23 break unmove - Stack Overflow](https://stackoverflow.com/questions/76647046/does-c23-break-unmove) +- [c++ - Does c++23 break unmove - Stack Overflow](https://stackoverflow.com/questions/76647046/does-c23-break-unmove) \ No newline at end of file diff --git a/lang/cpp23/static_operator.md b/lang/cpp23/static_operator.md index 10a20d9273..eb8a2b8162 100644 --- a/lang/cpp23/static_operator.md +++ b/lang/cpp23/static_operator.md @@ -1,6 +1,14 @@ # thisポインタをもつ必要のない演算子をstaticとして宣言できるようにする [P1169R4] * cpp23[meta cpp] +<-- start lang caution --> + +このページはC++23に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 以下の演算子が`this`ポインタを必要としない (状態をもたない) 場合、演算子オーバーロードを`static`として定義できる: @@ -49,11 +57,11 @@ int main() 状態をもたない関数オブジェクトでは`this`ポインタの受け渡しは必要なく、無駄である。必要ないもののためにコストを支払わないという基本的な思想に反していたため、`this`ポインタの受け渡しをなくせる機能として、`static`指定の許可を導入した。 -## 関連項目 +## 関連項目 - [C++11 ラムダ式](/lang/cpp11/lambda_expressions.md) - [`std::function::`推論補助](/reference/functional/function/op_deduction_guide.md) ## 参照 - [P1169R4 `static operator()`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1169r4.html) -- [P2589R0 `static operator[]`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2589r0.pdf) +- [P2589R0 `static operator[]`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2589r0.pdf) \ No newline at end of file diff --git a/lang/cpp23/support_for_utf8_as_a_portable_source_file_encoding.md b/lang/cpp23/support_for_utf8_as_a_portable_source_file_encoding.md index ea297b07e5..1f85393142 100644 --- a/lang/cpp23/support_for_utf8_as_a_portable_source_file_encoding.md +++ b/lang/cpp23/support_for_utf8_as_a_portable_source_file_encoding.md @@ -1,6 +1,14 @@ # 汎用的なソースコードのエンコーディングとしてUTF-8をサポート [P2295R6] * cpp23[meta cpp] +<-- start lang caution --> + +このページはC++23に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 C++20まで、ソースコードの文字集合は実装定義だったが、その仕様では移植性に問題があった。C++23からは、すべてのコンパイラはUTF-8文字コードのソースコードをサポートしなければならないことが規定される。 @@ -8,4 +16,4 @@ C++20まで、ソースコードの文字集合は実装定義だったが、そ ## 参照 -- [P2295R6 Support for UTF-8 as a portable source file encoding](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2295r6.pdf) +- [P2295R6 Support for UTF-8 as a portable source file encoding](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2295r6.pdf) \ No newline at end of file diff --git a/lang/cpp23/trimming_whitespaces_before_line_splicing.md b/lang/cpp23/trimming_whitespaces_before_line_splicing.md index fe51f851a3..690e28500a 100644 --- a/lang/cpp23/trimming_whitespaces_before_line_splicing.md +++ b/lang/cpp23/trimming_whitespaces_before_line_splicing.md @@ -1,6 +1,14 @@ # 行末スペースを無視するよう規定 [P2223R2] * cpp23[meta cpp] +<-- start lang caution --> + +このページはC++23に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 `\` (バックスラッシュ) 後の行末スペースを無視するよう規定する。 @@ -58,4 +66,4 @@ int main() { ## 参照 -- [P2223R2 Trimming whitespaces before line splicing](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2223r2.pdf) +- [P2223R2 Trimming whitespaces before line splicing](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2223r2.pdf) \ No newline at end of file diff --git a/lang/cpp23/update_normative_reference_to_posix.md b/lang/cpp23/update_normative_reference_to_posix.md index 1ea84a54db..b452b2a0d2 100644 --- a/lang/cpp23/update_normative_reference_to_posix.md +++ b/lang/cpp23/update_normative_reference_to_posix.md @@ -1,6 +1,14 @@ # 参照するPOSIX規格を更新 * cpp23[meta cpp] +<-- start lang caution --> + +このページはC++23に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 C++20まではPOSIX規格としてISO/IEC 9945:2003 (別名POSIX.1-2001 aka The Single UNIX Specification, version 3) を参照していた。 @@ -39,4 +47,4 @@ POSIX.1-2001のスレッドセーフ関数 (Thread-Safe Functions : TSF) オプ ## 参照 -- [P2227R0 Update normative reference to POSIX](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2227r0.html) +- [P2227R0 Update normative reference to POSIX](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2227r0.html) \ No newline at end of file diff --git a/lang/cpp23/warning.md b/lang/cpp23/warning.md index 4706b00c5f..4fd054a686 100644 --- a/lang/cpp23/warning.md +++ b/lang/cpp23/warning.md @@ -1,6 +1,14 @@ # #warningのサポートを追加 [P2437R1] * cpp23[meta cpp] +<-- start lang caution --> + +このページはC++23に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + +<-- last lang caution --> + ## 概要 C++23では、プリプロセッサ命令として、特定のコードに到達した際に警告メッセージを出力する `#warning` をサポートする。 @@ -53,4 +61,4 @@ Hello ## 参照 -- [P2437R1 Support for `#warning`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2437r1.pdf) +- [P2437R1 Support for `#warning`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2437r1.pdf) \ No newline at end of file diff --git a/lang/cpp26/user-generated_static_assert_messages.md b/lang/cpp26/user-generated_static_assert_messages.md index 06e1dadb8c..53a361bbf3 100644 --- a/lang/cpp26/user-generated_static_assert_messages.md +++ b/lang/cpp26/user-generated_static_assert_messages.md @@ -1,6 +1,14 @@ # static_assertの診断メッセージにユーザーが生成した文字列の指定を許可 [P2741R3] * cpp26[meta cpp] +<-- start lang caution --> + +このページはC++26に採用される見込みの言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 C++26では、[`static_assert`](/lang/cpp11/static_assert.md)に指定する表明失敗時の診断メッセージとして、文字列リテラルだけでなくユーザー定義型の文字列オブジェクトも指定できるようになる。 @@ -43,9 +51,9 @@ static_assert(定数式, 診断メッセージ); - `"message"`はOK -## 関連項目 +## 関連項目 - [C++11 コンパイル時アサート](/lang/cpp11/static_assert.md) ## 参照 -- [P2741R3 user-generated `static_assert` messages](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2741r3.pdf) +- [P2741R3 user-generated `static_assert` messages](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2741r3.pdf) \ No newline at end of file diff --git a/lang/future/contract-based_programming.md b/lang/future/contract-based_programming.md index c57629ed67..4d05db8c7f 100644 --- a/lang/future/contract-based_programming.md +++ b/lang/future/contract-based_programming.md @@ -259,11 +259,11 @@ struct derived : base { なお、[`assert`マクロ](/reference/cassert/assert.md)は関数形式のマクロなので、`[[assert]]`属性を置換してしまうことはない。 -## 関連項目 +## 関連項目 - [C++11 属性構文](/lang/cpp11/attributes.md) - [C++11 コンパイル時アサート](/lang/cpp11/static_assert.md) - [`assert`マクロ](/reference/cassert/assert.md) ## 参照 - [P0542R5 Support for contract based programming in C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0542r5.html) -- [ET: Inheritance Inheritance and contracts - Eiffel.org](https://www.eiffel.org/doc/eiffel/ET-_Inheritance#Inheritance_and_contracts) +- [ET: Inheritance Inheritance and contracts - Eiffel.org](https://www.eiffel.org/doc/eiffel/ET-_Inheritance#Inheritance_and_contracts) \ No newline at end of file diff --git a/start_editing/lang_template_page.md b/start_editing/lang_template_page.md index e66a017efa..20e089f9f2 100644 --- a/start_editing/lang_template_page.md +++ b/start_editing/lang_template_page.md @@ -30,6 +30,27 @@ +(確定した言語バージョンに対する注意事項は以下) + +<-- start lang caution --> + +このページはC++XXに採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + + +(確定前の言語バージョンに対する注意事項は以下) + +<-- start lang caution --> + +このページはC++26に採用される見込みの言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 + +<-- last lang caution --> + ## 概要 (ここには、言語機能の概要を記載します。) @@ -39,6 +60,8 @@ ## 仕様 (ここには、言語機能の仕様を記載します。最初のコミットから完璧にする必要はありません。徐々に詳細にしていけばOKです。) +(同じ言語バージョン内で他の仕様更新と変更箇所が衝突する場合があります。その場合は、可能であればそれらの変更を考慮・マージした仕様で記載してください。) + ## 例 ```cpp example @@ -74,7 +97,7 @@ int main() (ここには、その言語機能が実際に採用されるまでに検討された、ほかの設計選択を記述します。どのような選択肢があって今の言語機能となったのかがわかるようにします。) -## 関連項目 +## ## 関連項目 (ここには、その言語機能と関連のあるcpprefjpサイト内の項目へのリンクを記述します。とくに必要がないと判断した場合、項目を削除してください。) From cba02fbcfad656a9469f6457c427b850c45d5274 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 8 Jul 2024 16:22:25 +0900 Subject: [PATCH 1025/3948] =?UTF-8?q?=E8=A8=80=E8=AA=9E=E6=A9=9F=E8=83=BD?= =?UTF-8?q?=20:=20=E6=B3=A8=E6=84=8F=E6=96=87=E7=AB=A0=E3=81=AE=E6=A7=8B?= =?UTF-8?q?=E6=96=87=E3=83=9F=E3=82=B9=E3=82=92=E4=BF=AE=E6=AD=A3=20#1292?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/script/update_lang_caution.py | 4 ++-- lang/cpp11/alias_templates.md | 6 +++--- lang/cpp11/alignas.md | 6 +++--- lang/cpp11/alignof.md | 6 +++--- lang/cpp11/attributes.md | 6 +++--- lang/cpp11/auto.md | 4 ++-- lang/cpp11/c99_predefined_macros.md | 6 +++--- lang/cpp11/char16_32.md | 4 ++-- lang/cpp11/constexpr.md | 6 +++--- lang/cpp11/decltype.md | 4 ++-- lang/cpp11/defaulted_and_deleted_functions.md | 4 ++-- lang/cpp11/delegating_constructors.md | 6 +++--- .../dependent_name_specifier_outside_of_templates.md | 6 +++--- lang/cpp11/deprecation_of_the_register_keyword.md | 6 +++--- lang/cpp11/earlier_declarated_array_bounds.md | 6 +++--- lang/cpp11/explicit_conversion_operator.md | 4 ++-- lang/cpp11/extend_friend_targets.md | 6 +++--- ..._apply_to_non_static_data_members_without_an_object.md | 6 +++--- lang/cpp11/extern_template.md | 6 +++--- lang/cpp11/feature_test_macros.md | 4 ++-- lang/cpp11/func.md | 6 +++--- .../cpp11/global_scope_syntax_in_nested_name_specifier.md | 6 +++--- lang/cpp11/inheriting_constructors.md | 6 +++--- lang/cpp11/initializer_lists.md | 6 +++--- lang/cpp11/inline_namespaces.md | 6 +++--- lang/cpp11/lambda_expressions.md | 6 +++--- .../cpp11/local_and_unnamed_type_as_template_arguments.md | 6 +++--- lang/cpp11/long_long_type.md | 6 +++--- lang/cpp11/noexcept.md | 6 +++--- lang/cpp11/non_static_data_member_initializers.md | 6 +++--- lang/cpp11/nullptr.md | 6 +++--- lang/cpp11/override_final.md | 4 ++-- lang/cpp11/pragma_operator.md | 6 +++--- lang/cpp11/predefined_macros.md | 4 ++-- lang/cpp11/range_based_for.md | 4 ++-- lang/cpp11/raw_string_literals.md | 6 +++--- lang/cpp11/recursive_template_limit.md | 6 +++--- lang/cpp11/ref_qualifier_for_this.md | 6 +++--- lang/cpp11/reference_collapsing.md | 4 ++-- lang/cpp11/remove_export_templates.md | 6 +++--- lang/cpp11/reserved_namespaces_for_posix.md | 6 +++--- lang/cpp11/result_of_integer_division_and_modulo.md | 6 +++--- lang/cpp11/right_angle_brackets.md | 6 +++--- lang/cpp11/rvalue_ref_and_move_semantics.md | 4 ++-- lang/cpp11/scoped_enum.md | 6 +++--- lang/cpp11/sfinae_expressions.md | 6 +++--- lang/cpp11/static_assert.md | 4 ++-- lang/cpp11/static_initialization_thread_safely.md | 6 +++--- lang/cpp11/string_literal_concatenation.md | 6 +++--- lang/cpp11/thread_local_storage.md | 6 +++--- lang/cpp11/trailing_comma_following_enumerator_list.md | 6 +++--- lang/cpp11/trailing_return_types.md | 6 +++--- lang/cpp11/uniform_initialization.md | 6 +++--- lang/cpp11/unrestricted_unions.md | 6 +++--- lang/cpp11/user_defined_literals.md | 6 +++--- lang/cpp11/utf8_string_literals.md | 6 +++--- lang/cpp11/variadic_macros.md | 6 +++--- lang/cpp11/variadic_templates.md | 6 +++--- lang/cpp14/binary_literals.md | 6 +++--- .../brace_elision_in_array_temporary_initialization.md | 6 +++--- lang/cpp14/clarifying_memory_allocation.md | 4 ++-- lang/cpp14/decltype_auto.md | 6 +++--- lang/cpp14/deprecated_attr.md | 6 +++--- lang/cpp14/digit_separators.md | 5 ++--- lang/cpp14/feature_test_macros.md | 4 ++-- lang/cpp14/generic_lambdas.md | 4 ++-- lang/cpp14/initialize_capture.md | 6 +++--- lang/cpp14/member_initializers_and_aggregates.md | 6 +++--- lang/cpp14/no_whitespace_literal_operators.md | 6 +++--- .../nontype_template_parameters_of_type_nullptr_t.md | 6 +++--- lang/cpp14/placeholder_type_in_trailing_return_type.md | 5 ++--- lang/cpp14/predefined_macros.md | 6 +++--- lang/cpp14/relaxing_constraints_on_constexpr.md | 6 +++--- lang/cpp14/return_type_deduction_for_normal_functions.md | 6 +++--- lang/cpp14/sized_deallocation.md | 4 ++-- lang/cpp14/variable_templates.md | 6 +++--- ...tant_evaluation_for_all_non-type_template_arguments.md | 4 ++-- ...ow_default_template_arguments_of_variable_templates.md | 4 ++-- .../allow_typename_in_a_template_template_parameter.md | 4 ++-- lang/cpp17/attributes_for_namespaces_and_enumerators.md | 4 ++-- lang/cpp17/constexpr_lambda.md | 4 ++-- lang/cpp17/construction_enum_class_values.md | 4 ++-- .../declaring_non-type_template_arguments_with_auto.md | 4 ++-- .../dynamic_memory_allocation_for_over-aligned_data.md | 4 ++-- lang/cpp17/exception_spec_be_part_of_the_type_system.md | 4 ++-- lang/cpp17/expression_evaluation_order.md | 4 ++-- lang/cpp17/extending_static_assert.md | 4 ++-- lang/cpp17/extension_to_aggregate_initialization.md | 4 ++-- lang/cpp17/fallthrough.md | 4 ++-- lang/cpp17/feature_test_macros.md | 4 ++-- lang/cpp17/folding_expressions.md | 4 ++-- lang/cpp17/generalizing_the_range-based_for_loop.md | 4 ++-- lang/cpp17/guaranteed_copy_elision.md | 4 ++-- lang/cpp17/has_include.md | 4 ++-- lang/cpp17/hexadecimal_floating_literals.md | 4 ++-- lang/cpp17/if_constexpr.md | 4 ++-- lang/cpp17/inline_variables.md | 4 ++-- lang/cpp17/lambda_capture_of_this_by_value.md | 4 ++-- lang/cpp17/lambda_to_noexcept_function_pointer.md | 6 +++--- lang/cpp17/maybe_unused.md | 4 ++-- lang/cpp17/nested_namespace.md | 4 ++-- .../new_rules_for_auto_deduction_from_braced-init-list.md | 4 ++-- lang/cpp17/nodiscard.md | 4 ++-- lang/cpp17/non_standard_attributes.md | 4 ++-- lang/cpp17/pack_expansions_in_using.md | 4 ++-- lang/cpp17/predefined_macros.md | 6 +++--- lang/cpp17/remove_deprecated_exception_specifications.md | 4 ++-- lang/cpp17/remove_deprecated_increment_of_bool.md | 4 ++-- .../remove_deprecated_use_of_the_register_keyword.md | 4 ++-- lang/cpp17/removing_trigraphs.md | 4 ++-- ...ement_of_class_objects_containing_reference_members.md | 6 +++--- lang/cpp17/selection_statements_with_initializer.md | 4 ++-- lang/cpp17/structured_bindings.md | 4 ++-- lang/cpp17/type_deduction_for_class_templates.md | 4 ++-- lang/cpp17/using_attribute_namespaces.md | 4 ++-- lang/cpp17/utf8_character_literals.md | 6 +++--- lang/cpp20/access_checking_on_specializations.md | 6 +++--- .../adl_and_function_templates_that_are_not_visible.md | 4 ++-- ...zing_aggregates_from_a_parenthesized_list_of_values.md | 4 ++-- lang/cpp20/allow_lambda_capture_equal_this.md | 4 ++-- lang/cpp20/allow_pack_expansion_in_lambda_init_capture.md | 4 ++-- .../allow_structured_bindings_to_accessible_members.md | 4 ++-- ...llow_virtual_function_calls_in_constant_expressions.md | 4 ++-- ...mic_cast_polymorphic_typeid_in_constant_expressions.md | 4 ++-- lang/cpp20/array_size_deduction_in_new-expressions.md | 4 ++-- ...nging_the_active_member_of_a_union_inside_constexpr.md | 4 ++-- lang/cpp20/char8_t.md | 4 ++-- lang/cpp20/checking_for_abstract_class_types.md | 4 ++-- .../class_template_argument_deduction_for_aggregates.md | 4 ++-- ...ass_template_argument_deduction_for_alias_templates.md | 4 ++-- lang/cpp20/class_types_in_non-type_template_parameters.md | 4 ++-- lang/cpp20/concepts.md | 4 ++-- lang/cpp20/consistent_comparison.md | 4 ++-- lang/cpp20/constinit.md | 4 ++-- ...from_pointer_to_bool_should_be_considered_narrowing.md | 4 ++-- lang/cpp20/coroutines.md | 4 ++-- ...ault_constructible_and_assignable_stateless_lambdas.md | 4 ++-- lang/cpp20/default_member_initializers_for_bit_fields.md | 6 +++--- .../deprecate_implicit_capture_of_this_via_defcopy.md | 4 ++-- lang/cpp20/deprecate_pod.md | 4 ++-- ...s_of_the_comma_operator_in_subscripting_expressions.md | 4 ++-- lang/cpp20/deprecating_volatile.md | 4 ++-- lang/cpp20/designated_initialization.md | 4 ++-- lang/cpp20/down_with_typename.md | 4 ++-- .../efficient_sized_delete_for_variable_sized_classes.md | 4 ++-- ..._unevaluated_inline-assembly_in_constexpr_functions.md | 4 ++-- lang/cpp20/explicit_bool.md | 4 ++-- ...ured_bindings_to_be_more_like_variable_declarations.md | 4 ++-- .../cpp20/familiar_template_syntax_for_generic_lambdas.md | 4 ++-- lang/cpp20/feature_test_macros.md | 4 ++-- lang/cpp20/fixing_const_qualified_pointers_to_members.md | 4 ++-- lang/cpp20/function_templates_with_auto_parameters.md | 4 ++-- lang/cpp20/immediate_functions.md | 4 ++-- ...eation_of_objects_for_low-level_object_manipulation.md | 4 ++-- lang/cpp20/language_support_for_empty_objects.md | 4 ++-- .../less_eager_instantiation_of_constexpr_functions.md | 4 ++-- lang/cpp20/likely_and_unlikely_attributes.md | 4 ++-- .../make_char16t_char32t_string_literals_be_utf16_32.md | 4 ++-- lang/cpp20/modules.md | 4 ++-- lang/cpp20/more_constexpr_containers.md | 4 ++-- lang/cpp20/nested_inline_mamespaces.md | 4 ++-- lang/cpp20/nodiscard_for_constructors.md | 4 ++-- lang/cpp20/nodiscard_should_have_a_reason.md | 4 ++-- .../permit_conversions_to_arrays_of_unknown_bound.md | 4 ++-- ...rivial_default_initialization_in_constexpr_contexts.md | 4 ++-- lang/cpp20/predefined_macros.md | 4 ++-- ...prohibit_aggregates_with_user-declared_constructors.md | 4 ++-- lang/cpp20/range-based_for_statements_with_initializer.md | 4 ++-- lang/cpp20/reference_capture_of_structured_bindings.md | 4 ++-- ...he_range_for_loop_customization_point_finding_rules.md | 4 ++-- ...ructured_bindings_customization_point_finding_rules.md | 4 ++-- .../remove_deprecated_nothrow_exception_specification.md | 4 ++-- .../reserving_attribute_namespaces_for_future_use.md | 4 ++-- ...ving_const_mismatch_with_defaulted_copy_constructor.md | 4 ++-- lang/cpp20/signed_integers_are_twos_complement.md | 4 ++-- lang/cpp20/simplifying_implicit_lambda_capture.md | 6 +++--- lang/cpp20/try-catch_blocks_in_constexpr_functions.md | 4 ++-- .../cpp20/update_the_reference_to_the_unicode_standard.md | 4 ++-- lang/cpp20/using_enum.md | 4 ++-- lang/cpp20/va_opt.md | 4 ++-- lang/cpp20/wording_for_lambdas_in_unevaluated_contexts.md | 4 ++-- ...t_for_preprocessing_directives_elifdef_and_elifndef.md | 4 ++-- lang/cpp23/attributes_on_lambda_expressions.md | 4 ++-- lang/cpp23/character_encoding_of_diagnostic_text.md | 4 ++-- .../class_template_argument_deduction_from_inherited.md | 4 ++-- lang/cpp23/consistent_character_literal_encoding.md | 4 ++-- lang/cpp23/consteval_needs_to_propagate_up.md | 4 ++-- lang/cpp23/delimited_escape_sequences.md | 4 ++-- lang/cpp23/down_with_lambda_parens.md | 4 ++-- .../extend_init_statement_to_allow_alias_declaration.md | 4 ++-- lang/cpp23/feature_test_macros.md | 4 ++-- .../generalized_wording_for_partial_specializations.md | 4 ++-- lang/cpp23/if_consteval.md | 4 ++-- lang/cpp23/labels_at_the_end_of_compound_statements.md | 4 ++-- lang/cpp23/lifetime_extension_in_range_based_for_loop.md | 4 ++-- lang/cpp23/literal_suffix_for_signed_size_t.md | 4 ++-- lang/cpp23/make_declaration_order_layout_mandated.md | 4 ++-- lang/cpp23/meaningful_exports.md | 4 ++-- lang/cpp23/mixed_string_literal_concatenation.md | 4 ++-- lang/cpp23/multidimensional_subscript_operator.md | 4 ++-- lang/cpp23/named_universal_character_escapes.md | 4 ++-- lang/cpp23/narrowing_contextual_conversions_to_bool.md | 4 ++-- .../cpp23/non_literal_variables_in_constexpr_functions.md | 4 ++-- ...g_static_constexpr_variables_in_constexpr_functions.md | 4 ++-- lang/cpp23/portable_assumptions.md | 4 ++-- lang/cpp23/predefined_macros.md | 4 ++-- lang/cpp23/relaxing_some_constexpr_restrictions.md | 4 ++-- ...literals_and_multicharacter_wide_character_literals.md | 6 +++--- lang/cpp23/simpler_implicit_move.md | 4 ++-- lang/cpp23/static_operator.md | 4 ++-- ...support_for_utf8_as_a_portable_source_file_encoding.md | 4 ++-- lang/cpp23/trimming_whitespaces_before_line_splicing.md | 4 ++-- lang/cpp23/update_normative_reference_to_posix.md | 4 ++-- lang/cpp23/warning.md | 4 ++-- lang/cpp26/user-generated_static_assert_messages.md | 4 ++-- start_editing/lang_template_page.md | 8 ++++---- 216 files changed, 499 insertions(+), 501 deletions(-) diff --git a/.github/workflows/script/update_lang_caution.py b/.github/workflows/script/update_lang_caution.py index 524716ba08..ede5bf02e1 100644 --- a/.github/workflows/script/update_lang_caution.py +++ b/.github/workflows/script/update_lang_caution.py @@ -17,8 +17,8 @@ FUTURE_LANG_VERSION = 26 -START_CAUTION = "<-- start lang caution -->" -LAST_CAUTION = "<-- last lang caution -->" +START_CAUTION = "" +LAST_CAUTION = "" def update_lang_caution(text: str, filename: str) -> str: version = 0 diff --git a/lang/cpp11/alias_templates.md b/lang/cpp11/alias_templates.md index 93d3fecd24..2b34249017 100644 --- a/lang/cpp11/alias_templates.md +++ b/lang/cpp11/alias_templates.md @@ -1,13 +1,13 @@ # エイリアステンプレート [N2258] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 「エイリアステンプレート (alias templates)」は、テンプレートによって型の別名を定義する機能である。これによって、パラメータ化した型の別名付けができる。 @@ -107,4 +107,4 @@ typedef void_alloc::rebind::other int_alloc; - [N1451 A Case for Template Aliasing](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1451.html) - [N1489 Templates aliases for C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1489.pdf) - [N2112 Templates Aliases](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2112.pdf) -- [N2258 Templates Aliases](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf) +- [N2258 Templates Aliases](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf) \ No newline at end of file diff --git a/lang/cpp11/alignas.md b/lang/cpp11/alignas.md index 44ee2cd7a7..4786b90c98 100644 --- a/lang/cpp11/alignas.md +++ b/lang/cpp11/alignas.md @@ -1,13 +1,13 @@ # alignas [N2341] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 `alignas()`は、コンパイラに対し変数をメモリ上の特定の位置に配置(アライメント)するように要求するキーワードである。「アライン アズ (align as)」と読む。 @@ -115,4 +115,4 @@ N2341 からはわからない、恐らくないと思われる。 ## 参照 -- [N2341 Adding Alignment Support to the C++ Programming Language / Wording](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf) +- [N2341 Adding Alignment Support to the C++ Programming Language / Wording](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf) \ No newline at end of file diff --git a/lang/cpp11/alignof.md b/lang/cpp11/alignof.md index 533b4fd42e..35472e4629 100644 --- a/lang/cpp11/alignof.md +++ b/lang/cpp11/alignof.md @@ -1,13 +1,13 @@ # alignof [N2341] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 `alignof()`は、指定した型がメモリ上のどの位置に配置されるか(アライメント)取得する演算子である。「アライン オブ (align of)」と読む。 @@ -85,4 +85,4 @@ N2341 からはわからない、恐らくないと思われる。 ## 参照 -- [N2341 Adding Alignment Support to the C++ Programming Language / Wording](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf) +- [N2341 Adding Alignment Support to the C++ Programming Language / Wording](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf) \ No newline at end of file diff --git a/lang/cpp11/attributes.md b/lang/cpp11/attributes.md index d2a5122775..ef465af360 100644 --- a/lang/cpp11/attributes.md +++ b/lang/cpp11/attributes.md @@ -1,13 +1,13 @@ # 属性構文 [N2761] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 属性(attributes)は、ソースコードに対して追加の情報をコンパイラに伝えるための構文である。 @@ -177,4 +177,4 @@ C++11で採用されたもの以外で検討された以下の機能は、属性 - [N2418 Towards support for attributes in C++ (Revision 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2418.pdf) - [N2643 C++ Data-Dependency Ordering: Function Annotation](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2643.html) - [N2761 Towards support for attributes in C++ (Revision 6) ](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2761.pdf) -- [(抄訳)N4215 `memory_order_consume`の利用と実装に向けて[§5-6のみ]](http://d.hatena.ne.jp/yohhoy/20141115/p1) +- [(抄訳)N4215 `memory_order_consume`の利用と実装に向けて[§5-6のみ]](http://d.hatena.ne.jp/yohhoy/20141115/p1) \ No newline at end of file diff --git a/lang/cpp11/auto.md b/lang/cpp11/auto.md index 714ed57df4..23907ac336 100644 --- a/lang/cpp11/auto.md +++ b/lang/cpp11/auto.md @@ -1,13 +1,13 @@ # auto [N1984] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++11 から、変数宣言時に具体的な型名のかわりに `auto` キーワードを指定する事によって、変数の型を初期化子から推論できるようになった。 diff --git a/lang/cpp11/c99_predefined_macros.md b/lang/cpp11/c99_predefined_macros.md index 9a2ebf05e3..a1066e83e0 100644 --- a/lang/cpp11/c99_predefined_macros.md +++ b/lang/cpp11/c99_predefined_macros.md @@ -1,13 +1,13 @@ # C99互換で導入された定義済みマクロ * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 定義済みマクロの値が、以下のように更新された: @@ -25,4 +25,4 @@ ## 参照 - [N1653 Working draft changes for C99 preprocessor synchronization](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm) -- [CWG Issue 630. Equality of narrow and wide character values in the basic character set](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#630) +- [CWG Issue 630. Equality of narrow and wide character values in the basic character set](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#630) \ No newline at end of file diff --git a/lang/cpp11/char16_32.md b/lang/cpp11/char16_32.md index 968c867cfc..5e4af4f700 100644 --- a/lang/cpp11/char16_32.md +++ b/lang/cpp11/char16_32.md @@ -1,13 +1,13 @@ # char16_tとchar32_t [N2249] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 `char16_t`はUTF-16符号化形式の文字型、`char32_t`はUTF-32符号化形式の文字型である。 diff --git a/lang/cpp11/constexpr.md b/lang/cpp11/constexpr.md index a4667ade4a..b2c08fd27c 100644 --- a/lang/cpp11/constexpr.md +++ b/lang/cpp11/constexpr.md @@ -1,13 +1,13 @@ # constexpr [N2235] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 `constexpr`は、汎用的に定数式を表現するための機能である。 @@ -226,4 +226,4 @@ GCC 5.2、Clang 3.7、Visual C++ 2015時点で、3つともデフォルトは512 - [CWG Issue 644. Should a trivial class type be a literal type?](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#644) - リテラル型のメンバ変数のみを持つクラスは、`constexpr`コンストラクタを明示的に定義しなくても、リテラル型となる - [CWG Issue 699. Must constexpr member functions be defined in the class member-specification?](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#699) - - ゼロ割りの扱い、再帰回数の規定 + - ゼロ割りの扱い、再帰回数の規定 \ No newline at end of file diff --git a/lang/cpp11/decltype.md b/lang/cpp11/decltype.md index 3262354b71..9eba0a2415 100644 --- a/lang/cpp11/decltype.md +++ b/lang/cpp11/decltype.md @@ -1,13 +1,13 @@ # decltype [N2343] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 `decltype` は、オペランドで指定した式の型を取得する機能である。 diff --git a/lang/cpp11/defaulted_and_deleted_functions.md b/lang/cpp11/defaulted_and_deleted_functions.md index 1048d3e4d8..737eded017 100644 --- a/lang/cpp11/defaulted_and_deleted_functions.md +++ b/lang/cpp11/defaulted_and_deleted_functions.md @@ -1,13 +1,13 @@ # 関数のdefault/delete宣言 [N2346] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 クラスを定義した際、以下のメンバ関数が暗黙的に定義される: diff --git a/lang/cpp11/delegating_constructors.md b/lang/cpp11/delegating_constructors.md index 8fda468b1e..95712392ba 100644 --- a/lang/cpp11/delegating_constructors.md +++ b/lang/cpp11/delegating_constructors.md @@ -1,13 +1,13 @@ # 委譲コンストラクタ [N1986] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 「委譲コンストラクタ (delegating constructors)」は、コンストラクタから、同じクラスの他のコンストラクタに処理を委譲する機能である。 @@ -89,4 +89,4 @@ ECMA規格となっているC++/CLIには、この問題を解決するための - [N1581 Delegating Constructors](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1581.pdf) - [N1618 Delegating Constructors (revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1618.pdf) - [N1895 Delegating Constructors (revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1895.pdf) -- [N1986 Delegating Constructors (revision 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf) +- [N1986 Delegating Constructors (revision 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf) \ No newline at end of file diff --git a/lang/cpp11/dependent_name_specifier_outside_of_templates.md b/lang/cpp11/dependent_name_specifier_outside_of_templates.md index 755ea6c63b..adc15f4385 100644 --- a/lang/cpp11/dependent_name_specifier_outside_of_templates.md +++ b/lang/cpp11/dependent_name_specifier_outside_of_templates.md @@ -1,13 +1,13 @@ # 依存名に対するtypenameとtemplateの制限緩和 * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 テンプレート内で、テンプレートパラメータに依存する名前を使用する場合には、`typename`キーワードを先頭に付ける必要がある。 @@ -45,4 +45,4 @@ int main() ## 参照 - [CWG Issue 382. Allow `typename` outside of templates](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#382) -- [CWG Issue 468. Allow `::template` outside of templates](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#468) +- [CWG Issue 468. Allow `::template` outside of templates](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#468) \ No newline at end of file diff --git a/lang/cpp11/deprecation_of_the_register_keyword.md b/lang/cpp11/deprecation_of_the_register_keyword.md index b8d6077bed..6853e47bf1 100644 --- a/lang/cpp11/deprecation_of_the_register_keyword.md +++ b/lang/cpp11/deprecation_of_the_register_keyword.md @@ -1,13 +1,13 @@ # registerキーワードを非推奨化 * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 `register`キーワードが非推奨化された。 @@ -31,4 +31,4 @@ register int v = 42; ## 参照 -- [CWG Issue 809. Deprecation of the `register` keyword](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#809) +- [CWG Issue 809. Deprecation of the `register` keyword](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#809) \ No newline at end of file diff --git a/lang/cpp11/earlier_declarated_array_bounds.md b/lang/cpp11/earlier_declarated_array_bounds.md index e82c262515..94d7461278 100644 --- a/lang/cpp11/earlier_declarated_array_bounds.md +++ b/lang/cpp11/earlier_declarated_array_bounds.md @@ -1,13 +1,13 @@ # 宣言時に要素数を指定した配列オブジェクトの、定義時の要素数を規定 * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 `static`メンバや`extern`として宣言した配列を定義した際、宣言時に指定した要素数として定義されることが規定された。 @@ -26,4 +26,4 @@ int S::y[]; // 要素数は10 ## 参照 -- [CWG Issue 619. Completeness of array types](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#619) +- [CWG Issue 619. Completeness of array types](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#619) \ No newline at end of file diff --git a/lang/cpp11/explicit_conversion_operator.md b/lang/cpp11/explicit_conversion_operator.md index b61a80980c..393523cdf7 100644 --- a/lang/cpp11/explicit_conversion_operator.md +++ b/lang/cpp11/explicit_conversion_operator.md @@ -1,13 +1,13 @@ # 明示的な型変換演算子のオーバーロード [N2437] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 型変換演算子のオーバーロードをする際、`operator`キーワードの前に`explicit`を付加することで、その型変換演算子は明示的な型変換が行われる文脈でのみ呼び出されるようになる: diff --git a/lang/cpp11/extend_friend_targets.md b/lang/cpp11/extend_friend_targets.md index e2f9cfbb65..3452a098b9 100644 --- a/lang/cpp11/extend_friend_targets.md +++ b/lang/cpp11/extend_friend_targets.md @@ -1,13 +1,13 @@ # friend宣言できる対象を拡張 [N1791] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 C++03までの`friend`宣言は、直接のクラス型のみを指定できた。 @@ -60,4 +60,4 @@ int main() - [N1520 Extended friend Declarations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1520.pdf) - [N1616 Extended friend Declarations (Rev. 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1616.pdf) - [N1722 Extended friend Declarations (Rev. 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1722.pdf) -- [N1791 Extended friend Declarations (Rev. 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1791.pdf) +- [N1791 Extended friend Declarations (Rev. 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1791.pdf) \ No newline at end of file diff --git a/lang/cpp11/extending_sizeof_to_apply_to_non_static_data_members_without_an_object.md b/lang/cpp11/extending_sizeof_to_apply_to_non_static_data_members_without_an_object.md index 8b7b3c6a95..1b8e16d853 100644 --- a/lang/cpp11/extending_sizeof_to_apply_to_non_static_data_members_without_an_object.md +++ b/lang/cpp11/extending_sizeof_to_apply_to_non_static_data_members_without_an_object.md @@ -1,13 +1,13 @@ # sizeof演算子にクラスの非静的メンバを、オブジェクトを作らずに指定できるようにする * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 クラスの非静的メンバ変数のサイズを取得したい場合、そのクラスのオブジェクトを生成してから`sizeof`演算子にメンバを指定する必要があった。その制限が外され、クラスと非静的メンバ変数を、スコープ解決演算子 `::` 区切りで`sizeof`演算子に指定できるようになった: @@ -33,4 +33,4 @@ int main() - [CWG Issue 198. Definition of "use" in local and nested classes](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#198) - [CWG Issue 613. Unevaluated uses of non-static class members](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#613) - [N2150 Extending sizeof to apply to non-static data members without an object](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2150.html) -- [N2253 Extending sizeof to apply to non-static data members without an object (revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2253.html) +- [N2253 Extending sizeof to apply to non-static data members without an object (revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2253.html) \ No newline at end of file diff --git a/lang/cpp11/extern_template.md b/lang/cpp11/extern_template.md index 615e256382..c32818e017 100644 --- a/lang/cpp11/extern_template.md +++ b/lang/cpp11/extern_template.md @@ -1,13 +1,13 @@ # extern template [N1987] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 `extern template`は、指定したテンプレートを、その翻訳単位でインスタンス化しないことを指示するための機能である。 @@ -63,4 +63,4 @@ void user2() ## 参照 - [N1448 Controlling Implicit Template Instantiation](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1448.pdf) -- [N1987 Adding "extern template" (version 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1987.htm) +- [N1987 Adding "extern template" (version 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1987.htm) \ No newline at end of file diff --git a/lang/cpp11/feature_test_macros.md b/lang/cpp11/feature_test_macros.md index 0e270cc8a1..fdbc237484 100644 --- a/lang/cpp11/feature_test_macros.md +++ b/lang/cpp11/feature_test_macros.md @@ -1,13 +1,13 @@ # 機能テストマクロ * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp11/func.md b/lang/cpp11/func.md index db9fe7f724..403f0db999 100644 --- a/lang/cpp11/func.md +++ b/lang/cpp11/func.md @@ -1,13 +1,13 @@ # 事前定義識別子\_\_func\_\_ [N1653] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 C99互換として、事前定義識別子(predefined identifier)の`__func__`が導入された。 @@ -90,4 +90,4 @@ S::print() : print ## 参照 - [N1534 Proposed addition of `__func__` predefined identifier from C99](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1534.txt) - [5.41 Function Names as Strings - GCC](https://gcc.gnu.org/onlinedocs/gcc-3.3.5/gcc/Function-Names.html) -- [Predefined macros | Microsoft Docs](https://docs.microsoft.com/ja-JP/cpp/preprocessor/predefined-macros?view=vs-2019) +- [Predefined macros | Microsoft Docs](https://docs.microsoft.com/ja-JP/cpp/preprocessor/predefined-macros?view=vs-2019) \ No newline at end of file diff --git a/lang/cpp11/global_scope_syntax_in_nested_name_specifier.md b/lang/cpp11/global_scope_syntax_in_nested_name_specifier.md index 1bce9882b9..7eaa5fa386 100644 --- a/lang/cpp11/global_scope_syntax_in_nested_name_specifier.md +++ b/lang/cpp11/global_scope_syntax_in_nested_name_specifier.md @@ -1,13 +1,13 @@ # 入れ子名の指定にグローバルスコープ :: を付加することを許可 * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 入れ子名を指定する構文において、先頭にグローバルスコープの指定`::`を付加することが許可された。 @@ -44,4 +44,4 @@ nested-name-specifier: ## 参照 -- [CWG Issue 355. Global-scope `::` in nested-name-specifier](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#355) +- [CWG Issue 355. Global-scope `::` in nested-name-specifier](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#355) \ No newline at end of file diff --git a/lang/cpp11/inheriting_constructors.md b/lang/cpp11/inheriting_constructors.md index df94c217de..e99d4013c8 100644 --- a/lang/cpp11/inheriting_constructors.md +++ b/lang/cpp11/inheriting_constructors.md @@ -1,13 +1,13 @@ # 継承コンストラクタ [N2540] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 「継承コンストラクタ (inheriting constructors)」は、基底クラスで定義したコンストラクタ群を、派生クラスでそのまま使用できるようにするための糖衣構文である。 @@ -102,4 +102,4 @@ struct Derived : Base { - [N2376 Inheriting Constructors (revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2376.html) - [N2438 Inheriting Constructors (revision 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2438.htm) - [N2512 Inheriting Constructors (revision 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2512.html) -- [N2540 Inheriting Constructors (revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2540.htm) +- [N2540 Inheriting Constructors (revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2540.htm) \ No newline at end of file diff --git a/lang/cpp11/initializer_lists.md b/lang/cpp11/initializer_lists.md index b3adc1a56e..962448cb40 100644 --- a/lang/cpp11/initializer_lists.md +++ b/lang/cpp11/initializer_lists.md @@ -1,13 +1,13 @@ # 初期化子リスト [N2672] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 「初期化子リスト (initializer lists)」は、ユーザー定義型のオブジェクトに対して、波カッコによるリスト初期化を使用できるようにするようオーバーロードする機能である。 @@ -357,4 +357,4 @@ std::vector v(ar, ar + N); - [N2575 Initializer Lists - Alternative Mechanism and Rationale](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2575.pdf) - [N2640 Initializer Lists - Alternative Mechanism and Rationale (v. 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2640.pdf) - [N2672 Initializer List proposed wording](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm) -- [CWG Issue 1030. Evaluation order in initializer-lists used in aggregate initialization](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1030) +- [CWG Issue 1030. Evaluation order in initializer-lists used in aggregate initialization](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1030) \ No newline at end of file diff --git a/lang/cpp11/inline_namespaces.md b/lang/cpp11/inline_namespaces.md index 4bc0ae4d19..a25299be57 100644 --- a/lang/cpp11/inline_namespaces.md +++ b/lang/cpp11/inline_namespaces.md @@ -1,13 +1,13 @@ # インライン名前空間 [N2535] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 インライン名前空間 (inline namespace)は、名前空間内の機能に透過的にアクセスするための機能である。`inline namespace`によって定義した名前空間の機能には、その名前空間を指定しなくてもアクセスできる。 @@ -250,4 +250,4 @@ v2 - [7.9 Namespace Association - Using the GNU Compiler Collection (GCC)](https://gcc.gnu.org/onlinedocs/gcc-4.9.4/gcc/Namespace-Association.html) - [CWG Issue 812. Duplicate names in inline namespaces](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#812) - [CWG Issue 861. Unintended ambiguity in inline namespace lookup](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#861) -- [Inline namespaces and ambigous declarations - Stackoverflow](http://stackoverflow.com/questions/27252466/inline-namespaces-and-ambigous-declarations/) +- [Inline namespaces and ambigous declarations - Stackoverflow](http://stackoverflow.com/questions/27252466/inline-namespaces-and-ambigous-declarations/) \ No newline at end of file diff --git a/lang/cpp11/lambda_expressions.md b/lang/cpp11/lambda_expressions.md index b5f93a62d2..dd1bd263d6 100644 --- a/lang/cpp11/lambda_expressions.md +++ b/lang/cpp11/lambda_expressions.md @@ -1,13 +1,13 @@ # ラムダ式 [N2927] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 「ラムダ式(lambda expressions)」は、簡易的な関数オブジェクトをその場で定義するための機能である。 @@ -561,4 +561,4 @@ for_each(array, array + 4, <&>(double d) ( sum += factor ∗ d )); - [N2957 Reaching Scope of Lambda Expressions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2957.html) - [N3043 Converting Lambdas to Function Pointers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3043.html) - [N3052 Converting Lambdas to Function Pointers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3052.html) -- [CWG Issue 975. Restrictions on return type deduction for lambdas](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#975) +- [CWG Issue 975. Restrictions on return type deduction for lambdas](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#975) \ No newline at end of file diff --git a/lang/cpp11/local_and_unnamed_type_as_template_arguments.md b/lang/cpp11/local_and_unnamed_type_as_template_arguments.md index 3203e8bcca..8370caab9b 100644 --- a/lang/cpp11/local_and_unnamed_type_as_template_arguments.md +++ b/lang/cpp11/local_and_unnamed_type_as_template_arguments.md @@ -1,13 +1,13 @@ # ローカル型と無名型を、テンプレート引数として使用することを許可 [N2657] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 ローカルで定義した型と、名前のない型を、テンプレート引数として渡すことが許可された。 @@ -49,4 +49,4 @@ int main() - [N2187 Names, Linkage, and Templates (rev 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2187.pdf) - [N2402 Names, Linkage, and Templates (rev 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2402.pdf) - [N2635 Local and Unnamed Types as Template Arguments](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2635.html) -- [N2657 Local and Unnamed Types as Template Arguments](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm) +- [N2657 Local and Unnamed Types as Template Arguments](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm) \ No newline at end of file diff --git a/lang/cpp11/long_long_type.md b/lang/cpp11/long_long_type.md index cf67cdb50d..784b873066 100644 --- a/lang/cpp11/long_long_type.md +++ b/lang/cpp11/long_long_type.md @@ -1,13 +1,13 @@ # long long型 [N1811] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C99互換として、`long long`整数型が追加された。 @@ -75,4 +75,4 @@ int main() - [N0715 Incorporate the `long long` integral data type in C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/1995/N0715.ps) - [N1565 Adding the `long long` type to C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1565.pdf) - [N1735 Adding the `long long` type to C++ (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1735.pdf) -- [N1811 Adding the `long long` type to C++ (Revision 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1811.pdf) +- [N1811 Adding the `long long` type to C++ (Revision 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1811.pdf) \ No newline at end of file diff --git a/lang/cpp11/noexcept.md b/lang/cpp11/noexcept.md index c035ada198..3a4bfa56d2 100644 --- a/lang/cpp11/noexcept.md +++ b/lang/cpp11/noexcept.md @@ -1,13 +1,13 @@ # noexcept [N3050] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++11で導入された`noexcept`キーワードには、以下の2つの意味がある: @@ -196,4 +196,4 @@ int main() - [N3204 Deducing "`noexcept`" for destructors](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3204.htm) - [N3205 Delete operators default to `noexcept`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3205.htm) - [N3103 Security impact of `noexcept`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3103.pdf) -- [ムーブによるpop - Faith and Brave - C++で遊ぼう](http://faithandbrave.hateblo.jp/entry/20130604/1370327651) +- [ムーブによるpop - Faith and Brave - C++で遊ぼう](http://faithandbrave.hateblo.jp/entry/20130604/1370327651) \ No newline at end of file diff --git a/lang/cpp11/non_static_data_member_initializers.md b/lang/cpp11/non_static_data_member_initializers.md index 8e4b8cef1c..d2f6a64cb8 100644 --- a/lang/cpp11/non_static_data_member_initializers.md +++ b/lang/cpp11/non_static_data_member_initializers.md @@ -1,13 +1,13 @@ # 非静的メンバ変数の初期化 [N2756] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 非静的メンバ変数の定義時に、`=`演算子もしくは`{ }`波カッコ初期化子によるコンストラクタ構文で、初期化式を記述できる。 @@ -71,4 +71,4 @@ int main() - [N2354 Class member initializers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2354.htm) - [N2426 Class member initializers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2426.htm) - [N2628 Non-static data member initializers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2628.html) -- [N2756 Non-static data member initializers](http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2008/n2756.htm) +- [N2756 Non-static data member initializers](http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2008/n2756.htm) \ No newline at end of file diff --git a/lang/cpp11/nullptr.md b/lang/cpp11/nullptr.md index 4ba227a6d7..c36181e2ff 100644 --- a/lang/cpp11/nullptr.md +++ b/lang/cpp11/nullptr.md @@ -1,13 +1,13 @@ # nullptr [N2431] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 `nullptr`は、ヌルポインタ値を表すキーワードである。 @@ -132,4 +132,4 @@ private: - [N1488 A name for the null pointer: `nullptr`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1488.pdf) - [N1601 A name for the null pointer: `nullptr` (revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1601.pdf) - [N2214 A name for the null pointer: `nullptr` (revision 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2214.pdf) -- [N2431 A name for the null pointer: `nullptr` (revision 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf) +- [N2431 A name for the null pointer: `nullptr` (revision 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf) \ No newline at end of file diff --git a/lang/cpp11/override_final.md b/lang/cpp11/override_final.md index 154be55825..06fa189b6f 100644 --- a/lang/cpp11/override_final.md +++ b/lang/cpp11/override_final.md @@ -1,13 +1,13 @@ # overrideとfinal [N2928] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 `override`は仮想メンバ関数のオーバーライドを明示的に宣言するキーワードである。 diff --git a/lang/cpp11/pragma_operator.md b/lang/cpp11/pragma_operator.md index 841aaca8d6..6e71a2fafa 100644 --- a/lang/cpp11/pragma_operator.md +++ b/lang/cpp11/pragma_operator.md @@ -1,13 +1,13 @@ # Pragma演算子 [N1653] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 C99互換として、Pragma演算子が導入された。 @@ -73,4 +73,4 @@ int main() ``` ## 参照 -- [N1653 Working draft changes for C99 preprocessor synchronization](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm) +- [N1653 Working draft changes for C99 preprocessor synchronization](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm) \ No newline at end of file diff --git a/lang/cpp11/predefined_macros.md b/lang/cpp11/predefined_macros.md index c5ebaaafdd..41d9f43a29 100644 --- a/lang/cpp11/predefined_macros.md +++ b/lang/cpp11/predefined_macros.md @@ -1,13 +1,13 @@ # 更新された定義済みマクロ * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp11/range_based_for.md b/lang/cpp11/range_based_for.md index 2c8219c038..17ee409e7c 100644 --- a/lang/cpp11/range_based_for.md +++ b/lang/cpp11/range_based_for.md @@ -1,13 +1,13 @@ # 範囲for文 [N2930] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 範囲for文(The range-based for statement)は配列やコンテナを簡潔に扱うためのfor文の別表現である。 diff --git a/lang/cpp11/raw_string_literals.md b/lang/cpp11/raw_string_literals.md index 6fc3b8bdf9..98ef7b863f 100644 --- a/lang/cpp11/raw_string_literals.md +++ b/lang/cpp11/raw_string_literals.md @@ -1,13 +1,13 @@ # 生文字列リテラル [N2442] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 `R`プレフィックスを付けた文字列リテラル内の丸カッコ`( )`で囲まれた部分は、エスケープシーケンスが無視される。この機能を「生文字列リテラル (Raw string literals)」という。 @@ -273,4 +273,4 @@ Perl、Python、Luaやその他の言語ではこの問題に対応するため - [N2295 Raw and Unicode String Literals; Unified Proposal](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2295.html) - [N2384 Raw and Unicode String Literals; Unified Proposal (Rev. 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2384.html) - [N2442 Raw and Unicode String Literals; Unified Proposal (Rev. 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm) -- [N3077 Alternative approach to Raw String issues](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3077.html) +- [N3077 Alternative approach to Raw String issues](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3077.html) \ No newline at end of file diff --git a/lang/cpp11/recursive_template_limit.md b/lang/cpp11/recursive_template_limit.md index 3834d8543f..b0f6da923c 100644 --- a/lang/cpp11/recursive_template_limit.md +++ b/lang/cpp11/recursive_template_limit.md @@ -1,13 +1,13 @@ # テンプレート再帰回数の制限緩和 * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 C++03まで、テンプレートの再帰回数は、「17回以上であることを実装に推奨する」というものであった。 @@ -67,4 +67,4 @@ int main() - [Variadic Templates for C++0x](https://web.archive.org/web/20230430062038/http://www.jot.fm/issues/issue_2008_02/article2/) - テンプレートの再帰によって、コンパイル時間がどれくらい延びるかのレポートがある記事 - [C++ Language Features/Controlling implementation limits - Clang Compiler User’s Manual](http://clang.llvm.org/docs/UsersManual.html#cmdoption-ftemplate-depth) -- [3.5 Options Controlling C++ Dialect - GCC Command Options](https://gcc.gnu.org/onlinedocs/gcc/gcc-command-options/options-controlling-c%2B%2B-dialect.html) +- [3.5 Options Controlling C++ Dialect - GCC Command Options](https://gcc.gnu.org/onlinedocs/gcc/gcc-command-options/options-controlling-c%2B%2B-dialect.html) \ No newline at end of file diff --git a/lang/cpp11/ref_qualifier_for_this.md b/lang/cpp11/ref_qualifier_for_this.md index 9a5ea25215..ef6c41baf4 100644 --- a/lang/cpp11/ref_qualifier_for_this.md +++ b/lang/cpp11/ref_qualifier_for_this.md @@ -1,13 +1,13 @@ # メンバ関数の左辺値/右辺値修飾 [N2439] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 メンバ関数の`CV`修飾は、`*this`が`const`/`volatile`である場合とそうでない場合でメンバ関数をオーバーロードできる。 @@ -119,4 +119,4 @@ int main() - [N1784 A proposal to add l-value member function qualifier](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1784.htm) - [N1821 Extending Move Semantics To `*this` (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1821.htm) - [N2377 Extending move semantics to `*this` (revised wording)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2377.htm) -- [N2439 Extending move semantics to `*this` (revised wording)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2439.htm) +- [N2439 Extending move semantics to `*this` (revised wording)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2439.htm) \ No newline at end of file diff --git a/lang/cpp11/reference_collapsing.md b/lang/cpp11/reference_collapsing.md index 6fc14ffe85..2168a08d4c 100644 --- a/lang/cpp11/reference_collapsing.md +++ b/lang/cpp11/reference_collapsing.md @@ -1,13 +1,13 @@ # 参照への参照を折りたたむ * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 C++03までは、`T&`型に左辺値参照を足すと、「参照への参照 (reference to reference)」となってしまいコンパイルエラーとなっていた。 diff --git a/lang/cpp11/remove_export_templates.md b/lang/cpp11/remove_export_templates.md index 30b93e30cd..1d7e79a086 100644 --- a/lang/cpp11/remove_export_templates.md +++ b/lang/cpp11/remove_export_templates.md @@ -1,13 +1,13 @@ # テンプレートのエクスポート機能を削除 * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 C++11では、テンプレート定義をエクスポートする機能を削除する。 @@ -40,4 +40,4 @@ EDGフロントエンドとそれを使用するコンパイラのComeauとICC - [N3065 Removing Export](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3065.html) - [CWG Issue 820. Deprecation of export](https://wg21.cmeerw.net/cwg/issue820) - [Using export keyword with templates - StackOverflow](http://stackoverflow.com/questions/5416872/using-export-keyword-with-templates) -- [N1426 Why We Can't Afford Export](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1426.pdf) +- [N1426 Why We Can't Afford Export](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1426.pdf) \ No newline at end of file diff --git a/lang/cpp11/reserved_namespaces_for_posix.md b/lang/cpp11/reserved_namespaces_for_posix.md index 5b709ded2e..16813d6571 100644 --- a/lang/cpp11/reserved_namespaces_for_posix.md +++ b/lang/cpp11/reserved_namespaces_for_posix.md @@ -1,13 +1,13 @@ # POSIX用の名前空間を予約 * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 将来の標準化のために、POSIX用の名前空間として`std::posix`と`::posix`を予約する。 @@ -16,4 +16,4 @@ ## 参照 -- [N2542 Reserved namespaces for POSIX](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2542.htm) +- [N2542 Reserved namespaces for POSIX](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2542.htm) \ No newline at end of file diff --git a/lang/cpp11/result_of_integer_division_and_modulo.md b/lang/cpp11/result_of_integer_division_and_modulo.md index 82d8388aae..29d0d45050 100644 --- a/lang/cpp11/result_of_integer_division_and_modulo.md +++ b/lang/cpp11/result_of_integer_division_and_modulo.md @@ -1,13 +1,13 @@ # 整数に対する除算と剰余算の丸め結果を規定 * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 整数`a`, `b`に対する除算`a/b`の結果(商)と剰余算`a%b`の結果(余り)について`(a/b)*b + a%b = a`という等式が成り立つことが規定されているが、C++03まで、少なくとも一方が負の数である場合の余りの符号は実装定義だった。このため先述の等式により商も実装定義となっていた。C++11ではC99に合わせて「商の小数部がゼロ方向に切り捨てられた結果となること」が規定された。 @@ -47,4 +47,4 @@ int main() - [N2707 Expedited core issues handling](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2707.html) - [N2730 Expedited core issues handling (revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2730.html) - [N2757 Expedited core issues handling (revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2757.htm) -- [C++ における整数型の怪と "移植性のある" オーバーフローチェッカー (第1回 : 整数型の怪と対策の不足)](http://qiita.com/a4lg/items/541c9d9dd5d874eeef2f) +- [C++ における整数型の怪と "移植性のある" オーバーフローチェッカー (第1回 : 整数型の怪と対策の不足)](http://qiita.com/a4lg/items/541c9d9dd5d874eeef2f) \ No newline at end of file diff --git a/lang/cpp11/right_angle_brackets.md b/lang/cpp11/right_angle_brackets.md index 3af3608e6e..63abe59455 100644 --- a/lang/cpp11/right_angle_brackets.md +++ b/lang/cpp11/right_angle_brackets.md @@ -1,13 +1,13 @@ # テンプレートの右山カッコ [N1757] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 C++03では、2つ以上連続する右山カッコが出現する場合には、間にスペースを入力する必要があった: @@ -107,4 +107,4 @@ C++11で採択された方式は、テンプレートの型パラメータと非 ## 参照 - [N1649 Right Angle Brackets](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1649.html) - [N1699 Right Angle Brackets (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1699.html) -- [N1757 Right Angle Brackets (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html) +- [N1757 Right Angle Brackets (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html) \ No newline at end of file diff --git a/lang/cpp11/rvalue_ref_and_move_semantics.md b/lang/cpp11/rvalue_ref_and_move_semantics.md index cb2b68cabd..07f6c01b4a 100644 --- a/lang/cpp11/rvalue_ref_and_move_semantics.md +++ b/lang/cpp11/rvalue_ref_and_move_semantics.md @@ -1,13 +1,13 @@ # 右辺値参照・ムーブセマンティクス [N2118] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 ムーブセマンティクスはコピーコストの削減を主な目的としており、また所有権の移動を実現する。 diff --git a/lang/cpp11/scoped_enum.md b/lang/cpp11/scoped_enum.md index bc506220e2..28340f4d26 100644 --- a/lang/cpp11/scoped_enum.md +++ b/lang/cpp11/scoped_enum.md @@ -1,13 +1,13 @@ # スコープを持つ列挙型 [N2347] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 `enum class`で定義した列挙型は、従来の`enum`に加えて、「整数型への暗黙の型変換を行わない」「列挙型のスコープを持つ」という機能を持つ。 @@ -108,4 +108,4 @@ ECMA規格になっているC++/CLIが、現在のスコープを持つ列挙型 - [N1579 Strongly Typed Enums (revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1719.pdf) - [N2213 Strongly Typed Enums (revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2213.pdf) - [N2347 Strongly Typed Enums (revision 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf) -- [N2499 Forward declaration of enumerations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2499.pdf) +- [N2499 Forward declaration of enumerations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2499.pdf) \ No newline at end of file diff --git a/lang/cpp11/sfinae_expressions.md b/lang/cpp11/sfinae_expressions.md index e5aad73b10..dd5682c0ab 100644 --- a/lang/cpp11/sfinae_expressions.md +++ b/lang/cpp11/sfinae_expressions.md @@ -1,13 +1,13 @@ # 任意の式によるSFINAE [N2634] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 「SFINAE (Substitution Failure Is Not An Errorの略称、スフィネェと読む)」は、テンプレートの置き換えに失敗した際に、即時にコンパイルエラーとはせず、置き換えに失敗した関数をオーバーロード解決の候補から除外するという言語機能である。 @@ -284,4 +284,4 @@ int main() ## 参照 - [CWG Issue 339. Overload resolution in operand of `sizeof` in constant expression](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#339) -- [N2634 Solving the SFINAE problem for expressions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2634.html) +- [N2634 Solving the SFINAE problem for expressions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2634.html) \ No newline at end of file diff --git a/lang/cpp11/static_assert.md b/lang/cpp11/static_assert.md index 3257a8f391..b11c71f394 100644 --- a/lang/cpp11/static_assert.md +++ b/lang/cpp11/static_assert.md @@ -1,13 +1,13 @@ # コンパイル時アサート [N1720] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 `static_assert`宣言は、指定した定数式が真であることを表明するための機能である。 diff --git a/lang/cpp11/static_initialization_thread_safely.md b/lang/cpp11/static_initialization_thread_safely.md index c5c4af8681..8f0c46ff8e 100644 --- a/lang/cpp11/static_initialization_thread_safely.md +++ b/lang/cpp11/static_initialization_thread_safely.md @@ -1,13 +1,13 @@ # ブロックスコープを持つstatic変数初期化のスレッドセーフ化 [N2660] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 ブロックスコープを持つ`static`変数の初期化は、スレッドセーフであることが規定された。 @@ -104,4 +104,4 @@ int main() - [N2444 Dynamic Initialization and Destruction with Concurrency](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2444.html) - [N2513 Dynamic Initialization and Destruction with Concurrency](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2513.html) - [N2660 Dynamic Initialization and Destruction with Concurrency](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2660.htm) -- [C++0x時代の Double-Checked Locking - yamasaのネタ帳](http://yamasa.hatenablog.jp/entry/20100128/1264693781) +- [C++0x時代の Double-Checked Locking - yamasaのネタ帳](http://yamasa.hatenablog.jp/entry/20100128/1264693781) \ No newline at end of file diff --git a/lang/cpp11/string_literal_concatenation.md b/lang/cpp11/string_literal_concatenation.md index 3329ed51a9..3c980eb43f 100644 --- a/lang/cpp11/string_literal_concatenation.md +++ b/lang/cpp11/string_literal_concatenation.md @@ -1,13 +1,13 @@ # 文字列リテラルとワイド文字列リテラルの結合 * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 C99互換として、文字列リテラルとワイド文字列リテラルが並んでいたとき、ワイド文字列リテラルとして結合することが規定された。 @@ -40,4 +40,4 @@ hello world ## 参照 - [N1653 Working draft changes for C99 preprocessor synchronization](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm) -- [WG14/N951 String literals and concatenation](http://www.open-std.org/jtc1/sc22/wg14/www/docs/n951.htm) +- [WG14/N951 String literals and concatenation](http://www.open-std.org/jtc1/sc22/wg14/www/docs/n951.htm) \ No newline at end of file diff --git a/lang/cpp11/thread_local_storage.md b/lang/cpp11/thread_local_storage.md index bfaa7f0dbd..52cc0a3230 100644 --- a/lang/cpp11/thread_local_storage.md +++ b/lang/cpp11/thread_local_storage.md @@ -1,13 +1,13 @@ # スレッドローカルストレージ [N2659] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 変数宣言の際に、記憶域として`thread_local`キーワードを指定することで、スレッドごとの静的記憶域に変数が保持される。 @@ -122,4 +122,4 @@ thread2 : 4 - [N2545 Thread-Local Storage](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2545.html) - [N2659 Thread-Local Storage](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2659.htm) - [Why does Apple clang disallow C++11 `thread_local` when 'official' clang supports it - Stack Overflow](http://stackoverflow.com/a/29929949/463412) - - Apple実装のClang(Xcode 7以下に付属のもの)が`thread_local`機能をサポートしない理由 + - Apple実装のClang(Xcode 7以下に付属のもの)が`thread_local`機能をサポートしない理由 \ No newline at end of file diff --git a/lang/cpp11/trailing_comma_following_enumerator_list.md b/lang/cpp11/trailing_comma_following_enumerator_list.md index 5e81e5ead5..aa7bdd73a7 100644 --- a/lang/cpp11/trailing_comma_following_enumerator_list.md +++ b/lang/cpp11/trailing_comma_following_enumerator_list.md @@ -1,13 +1,13 @@ # 列挙子の末尾へのカンマ付加を許可 * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 C99互換として、末尾の列挙子の後ろにカンマを書くことが許可された。 @@ -48,4 +48,4 @@ int main() {} ## 参照 -- [CWG Issue 518. Trailing comma following enumerator-list](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#518) +- [CWG Issue 518. Trailing comma following enumerator-list](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#518) \ No newline at end of file diff --git a/lang/cpp11/trailing_return_types.md b/lang/cpp11/trailing_return_types.md index 15000efa52..b12bcd4194 100644 --- a/lang/cpp11/trailing_return_types.md +++ b/lang/cpp11/trailing_return_types.md @@ -1,13 +1,13 @@ # 戻り値の型を後置する関数宣言構文 [N2541] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 従来の関数宣言構文では、戻り値の型は先頭に記述していた。 @@ -120,4 +120,4 @@ auto f = [](int a, int b) -> int { return a + b; } - [N2927 New wording for C++0x Lambdas (rev. 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2927.pdf) - ラムダ式の仕様と合わせて「trailing-return-type」という言葉が使われるようになった - [N2931 Unified Function Syntax](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2931.html) -- [N2954 Unified Function Syntax](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2954.html) +- [N2954 Unified Function Syntax](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2954.html) \ No newline at end of file diff --git a/lang/cpp11/uniform_initialization.md b/lang/cpp11/uniform_initialization.md index 71d8d3190e..b9705fa306 100644 --- a/lang/cpp11/uniform_initialization.md +++ b/lang/cpp11/uniform_initialization.md @@ -1,13 +1,13 @@ # 一様初期化 [N2672] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 「一様初期化 (uniform initialization)」は、コンストラクタの呼び出しを、リスト初期化と合わせて波カッコ `{ }`で記述する構文である。 @@ -207,4 +207,4 @@ int main() - [N2575 Initializer Lists - Alternative Mechanism and Rationale](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2575.pdf) - [N2640 Initializer Lists - Alternative Mechanism and Rationale (v. 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2640.pdf) - [N2672 Initializer List proposed wording](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm) -- [CWG Issue 1030. Evaluation order in initializer-lists used in aggregate initialization](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1030) +- [CWG Issue 1030. Evaluation order in initializer-lists used in aggregate initialization](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1030) \ No newline at end of file diff --git a/lang/cpp11/unrestricted_unions.md b/lang/cpp11/unrestricted_unions.md index 5075981211..8d3671031b 100644 --- a/lang/cpp11/unrestricted_unions.md +++ b/lang/cpp11/unrestricted_unions.md @@ -1,13 +1,13 @@ # 共用体の制限解除 [N2544] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 共用体のメンバ変数として、クラスオブジェクトを保持できるようになった: @@ -74,4 +74,4 @@ hello ## 参照 - [N2430 Unrestricted Unions (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2430.pdf) - [N2544 Unrestricted Unions (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf) -- [Boost Variant Library](http://www.boost.org/libs/variant) +- [Boost Variant Library](http://www.boost.org/libs/variant) \ No newline at end of file diff --git a/lang/cpp11/user_defined_literals.md b/lang/cpp11/user_defined_literals.md index f7bf4a324e..5970ee0ed7 100644 --- a/lang/cpp11/user_defined_literals.md +++ b/lang/cpp11/user_defined_literals.md @@ -1,13 +1,13 @@ # ユーザー定義リテラル [N2765] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 ユーザー定義リテラル(User-defined literals)は、`123`、`3.14`、`"hello"`といったリテラルに対して付けられるサフィックスをオーバーロードできるようにすることで、ユーザーがリテラルに意味を持たせられるようにする機能である。 @@ -386,4 +386,4 @@ DecimalFloat f = 12.34df; - [N2750 User-defined Literals (aka. Extensible Literals (revision 4))](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2750.pdf) - [N2765 User-defined Literals (aka. Extensible Literals (revision 5))](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2765.pdf) - [CWG Issue 935. Missing overloads for character types for user-defined literals](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#935) -- [CWG Issue 1479. Literal operators and default arguments](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1479) +- [CWG Issue 1479. Literal operators and default arguments](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1479) \ No newline at end of file diff --git a/lang/cpp11/utf8_string_literals.md b/lang/cpp11/utf8_string_literals.md index 076b4d9e0f..8d1c9bf062 100644 --- a/lang/cpp11/utf8_string_literals.md +++ b/lang/cpp11/utf8_string_literals.md @@ -1,13 +1,13 @@ # UTF-8文字列リテラル [N2442] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 `char`の文字列リテラルに`u8`プレフィックスを付けることで、その文字列リテラルはUCS/Unicode文字コードのUTF-8符号化形式にエンコードされる。 @@ -83,4 +83,4 @@ int main() - [N2209 UTF-8 String Literals](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2209.html) - [N2295 Raw and Unicode String Literals; Unified Proposal](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2295.html) - [N2384 Raw and Unicode String Literals; Unified Proposal (Rev. 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2384.html) -- [N2442 Raw and Unicode String Literals; Unified Proposal (Rev. 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm) +- [N2442 Raw and Unicode String Literals; Unified Proposal (Rev. 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm) \ No newline at end of file diff --git a/lang/cpp11/variadic_macros.md b/lang/cpp11/variadic_macros.md index 28027f2c21..5049cca1b4 100644 --- a/lang/cpp11/variadic_macros.md +++ b/lang/cpp11/variadic_macros.md @@ -1,13 +1,13 @@ # 可変引数マクロ [N1653] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C99互換として、可変引数マクロ(variadic macros)が導入された。 @@ -83,4 +83,4 @@ f2 ## 参照 -- [N1653 Working draft changes for C99 preprocessor synchronization](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm) +- [N1653 Working draft changes for C99 preprocessor synchronization](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm) \ No newline at end of file diff --git a/lang/cpp11/variadic_templates.md b/lang/cpp11/variadic_templates.md index 0f44f02a00..adf5bfb450 100644 --- a/lang/cpp11/variadic_templates.md +++ b/lang/cpp11/variadic_templates.md @@ -1,13 +1,13 @@ # 可変引数テンプレート [N2242] * cpp11[meta cpp] -<-- start lang caution --> + このページはC++11に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 「可変引数テンプレート (variadic templates)」は、任意の型とそのオブジェクトを任意の数だけ受け取る機能である。これによって、「最大でN個のパラメータを受け取る関数テンプレートやクラステンプレート」を実装する際に、N個のオーバーロードをユーザーが用意する必要なく、ひとつの実装だけで済むようになる。 @@ -401,4 +401,4 @@ void f(const T1& t1, const T2& t2, const T3& t3); - [N2191 Proposed Wording for Variadic Templates (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2191.pdf) - [N2242 Proposed Wording for Variadic Templates (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2242.pdf) - [N2488 Extending Variadic Template Template Parameters](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2488.pdf) -- [N2555 Extending Variadic Template Template Parameters (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2555.pdf) +- [N2555 Extending Variadic Template Template Parameters (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2555.pdf) \ No newline at end of file diff --git a/lang/cpp14/binary_literals.md b/lang/cpp14/binary_literals.md index 1eb8531ae1..20a3d19da5 100644 --- a/lang/cpp14/binary_literals.md +++ b/lang/cpp14/binary_literals.md @@ -1,13 +1,13 @@ # 2進数リテラル [N3472] * cpp14[meta cpp] -<-- start lang caution --> + このページはC++14に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 整数リテラルのプレフィックスとして`0b`もしくは`0B`を付けることで、2進数を表す値を記述できる。 @@ -69,4 +69,4 @@ int main() ## 参照 -- [N3472 - Binary Literals in the C++ Core Language](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3472.pdf) +- [N3472 - Binary Literals in the C++ Core Language](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3472.pdf) \ No newline at end of file diff --git a/lang/cpp14/brace_elision_in_array_temporary_initialization.md b/lang/cpp14/brace_elision_in_array_temporary_initialization.md index 933d86d429..ea09d709d1 100644 --- a/lang/cpp14/brace_elision_in_array_temporary_initialization.md +++ b/lang/cpp14/brace_elision_in_array_temporary_initialization.md @@ -1,13 +1,13 @@ # ネストする集成体初期化における波カッコ省略を許可 [N3653] * cpp14[meta cpp] -<-- start lang caution --> + このページはC++14に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 C++11では、集成体初期化とリスト初期化の両方を含む場合、二重に波カッコを書くことが必須となっていた。そのため、`public`メンバ変数として組み込み配列を持つ[`std::array`](/reference/array/array.md)クラスのオブジェクトを初期化する場合、以下のように、不要とも思える二重の波カッコを書かなければならなかった: @@ -42,4 +42,4 @@ int x[2][2] = {1, 2, 3, 4}; - [CWG Issue 1270. Brace elision in array temporary initialization](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1270) - [vector/arrayとUniform initialization+Initializer list - yohhoyの日記](http://d.hatena.ne.jp/yohhoy/20120724/p1) - [initializer-listによるaggregate初期化の制約緩和 - yohhoyの日記](http://d.hatena.ne.jp/yohhoy/20131116/p1) -- [N3653 - Member initializers and aggregates](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3653.html) +- [N3653 - Member initializers and aggregates](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3653.html) \ No newline at end of file diff --git a/lang/cpp14/clarifying_memory_allocation.md b/lang/cpp14/clarifying_memory_allocation.md index 8008b72c01..039593c3cf 100644 --- a/lang/cpp14/clarifying_memory_allocation.md +++ b/lang/cpp14/clarifying_memory_allocation.md @@ -1,13 +1,13 @@ # 動的メモリ確保の省略の許可 * cpp14[meta cpp] -<-- start lang caution --> + このページはC++14に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp14/decltype_auto.md b/lang/cpp14/decltype_auto.md index 40ce597d19..9bf9e83773 100644 --- a/lang/cpp14/decltype_auto.md +++ b/lang/cpp14/decltype_auto.md @@ -1,13 +1,13 @@ # decltype(auto) * cpp14[meta cpp] -<-- start lang caution --> + このページはC++14に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 `decltype(auto)`は、`decltype`に与える式を右辺の式で置き換えて型推論する機能である。 @@ -73,4 +73,4 @@ int main() ## 関連項目 -- [C++14 通常関数の戻り値型推論](return_type_deduction_for_normal_functions.md) +- [C++14 通常関数の戻り値型推論](return_type_deduction_for_normal_functions.md) \ No newline at end of file diff --git a/lang/cpp14/deprecated_attr.md b/lang/cpp14/deprecated_attr.md index 4322cce795..7249301917 100644 --- a/lang/cpp14/deprecated_attr.md +++ b/lang/cpp14/deprecated_attr.md @@ -1,13 +1,13 @@ # [[deprecated]]属性 [N3760] * cpp14[meta cpp] -<-- start lang caution --> + このページはC++14に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 `[[deprecated]]`は、対象となる機能が非推奨であることを示す属性である。 @@ -136,4 +136,4 @@ prog.cc:45:3: warning: 'class_templ' is deprecated: don't use class_templ + このページはC++14に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 整数リテラルと浮動小数点数リテラルには、途中にシングルクォーテーション(`'`)を入力することで、値を読みやすくできる。 @@ -143,4 +143,3 @@ C++14という言語バージョンは、C++11の仕様に対するバグ修正 - Ruby : [アンダーバーによる数値の区切り](http://www.rubylife.jp/ini/num/index2.html) - Java 7 : [Underscores in Numeric Literals](http://docs.oracle.com/javase/7/docs/technotes/guides/language/underscores-literals.html) - Ada : [Ada '83 Language Reference Manual](http://archive.adaic.com/standards/83lrm/html/lrm-02-04.html#2.4) - diff --git a/lang/cpp14/feature_test_macros.md b/lang/cpp14/feature_test_macros.md index 8843b34b0f..e6338422f3 100644 --- a/lang/cpp14/feature_test_macros.md +++ b/lang/cpp14/feature_test_macros.md @@ -1,13 +1,13 @@ # 機能テストマクロ * cpp14[meta cpp] -<-- start lang caution --> + このページはC++14に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp14/generic_lambdas.md b/lang/cpp14/generic_lambdas.md index d61ead3ca5..71e85c56ad 100644 --- a/lang/cpp14/generic_lambdas.md +++ b/lang/cpp14/generic_lambdas.md @@ -1,13 +1,13 @@ # ジェネリックラムダ [N3649] * cpp14[meta cpp] -<-- start lang caution --> + このページはC++14に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 ジェネリックラムダ(generic lambdas)は、[C++11のラムダ式](/lang/cpp11/lambda_expressions.md)を拡張して、パラメータにテンプレートを使用できるようにした機能である。 diff --git a/lang/cpp14/initialize_capture.md b/lang/cpp14/initialize_capture.md index 33e66ae6d8..bbd9a25d90 100644 --- a/lang/cpp14/initialize_capture.md +++ b/lang/cpp14/initialize_capture.md @@ -1,13 +1,13 @@ # ラムダ式の初期化キャプチャ [N3648] * cpp14[meta cpp] -<-- start lang caution --> + このページはC++14に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 「初期化キャプチャ(init-capture)」は、任意の式の結果をラムダ式にキャプチャする機能である。 @@ -152,4 +152,4 @@ int main() ## 参照 - [N3610 Generic lambda-capture initializers, supporting capture-by-move](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3610.html) -- [N3648 Wording Changes for Generalized Lambda-capture](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3648.html) +- [N3648 Wording Changes for Generalized Lambda-capture](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3648.html) \ No newline at end of file diff --git a/lang/cpp14/member_initializers_and_aggregates.md b/lang/cpp14/member_initializers_and_aggregates.md index 22fbd8d0ac..d7a2254826 100644 --- a/lang/cpp14/member_initializers_and_aggregates.md +++ b/lang/cpp14/member_initializers_and_aggregates.md @@ -1,13 +1,13 @@ # 宣言時のメンバ初期化を持つ型の集成体初期化を許可 * cpp14[meta cpp] -<-- start lang caution --> + このページはC++14に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++11で導入された[メンバ初期化子](/lang/cpp11/non_static_data_member_initializers.md)は集成体の初期化と組み合わせて使用することができない問題があった。 @@ -39,4 +39,4 @@ int main() - [C++11 非静的メンバ変数の初期化](/lang/cpp11/non_static_data_member_initializers.md) ## 参照 -- [N3653 - Member initializers and aggregates](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3653.html) +- [N3653 - Member initializers and aggregates](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3653.html) \ No newline at end of file diff --git a/lang/cpp14/no_whitespace_literal_operators.md b/lang/cpp14/no_whitespace_literal_operators.md index 4688dcf095..3ab2981bb9 100644 --- a/lang/cpp14/no_whitespace_literal_operators.md +++ b/lang/cpp14/no_whitespace_literal_operators.md @@ -1,13 +1,13 @@ # リテラル演算子のスペースを省略可能とする * cpp14[meta cpp] -<-- start lang caution --> + このページはC++14に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 リテラル演算子を定義する際に、これまでは以下のように、`operator""`とサフィックス名の間に、ひとつ以上のスペースが必要だった。 @@ -56,4 +56,4 @@ hello ## 参照 -- [CWG Issue 1473. Syntax of literal-operator-id](https://wg21.cmeerw.net/cwg/issue1473) +- [CWG Issue 1473. Syntax of literal-operator-id](https://wg21.cmeerw.net/cwg/issue1473) \ No newline at end of file diff --git a/lang/cpp14/nontype_template_parameters_of_type_nullptr_t.md b/lang/cpp14/nontype_template_parameters_of_type_nullptr_t.md index 560705c708..274dc94f31 100644 --- a/lang/cpp14/nontype_template_parameters_of_type_nullptr_t.md +++ b/lang/cpp14/nontype_template_parameters_of_type_nullptr_t.md @@ -1,13 +1,13 @@ # nullptr_t型の定数式を非型テンプレートパラメータとすることを許可 * cpp14[meta cpp] -<-- start lang caution --> + このページはC++14に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 [`nullptr_t`](/reference/cstddef/nullptr_t.md)型の定数式を非型テンプレートパラメータとすることが許可された。 @@ -36,4 +36,4 @@ int main() ## 参照 -- [CWG Issue 1398. Non-type template parameters of type `std::nullptr_t`](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1398) +- [CWG Issue 1398. Non-type template parameters of type `std::nullptr_t`](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1398) \ No newline at end of file diff --git a/lang/cpp14/placeholder_type_in_trailing_return_type.md b/lang/cpp14/placeholder_type_in_trailing_return_type.md index f6a5a0b704..d490d58b39 100644 --- a/lang/cpp14/placeholder_type_in_trailing_return_type.md +++ b/lang/cpp14/placeholder_type_in_trailing_return_type.md @@ -1,13 +1,13 @@ # 後置戻り値型をプレースホルダーにすることを許可 * cpp14[meta cpp] -<-- start lang caution --> + このページはC++14に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 [戻り値の型を後置する関数宣言構文](/lang/cpp11/trailing_return_types.md)と[ラムダ式](/lang/cpp11/lambda_expressions.md)の、後置戻り値型(trailing return type)を`auto`プレースホルダーとし、そのプレースホルダーを修飾することで、戻り値型の推論を補助できる。 @@ -57,4 +57,3 @@ int main() ## 関連項目 - [C++14 通常関数の戻り値型推論](return_type_deduction_for_normal_functions.md) - diff --git a/lang/cpp14/predefined_macros.md b/lang/cpp14/predefined_macros.md index 54d5dfbd3c..82bdeb0fac 100644 --- a/lang/cpp14/predefined_macros.md +++ b/lang/cpp14/predefined_macros.md @@ -1,13 +1,13 @@ # 更新された定義済みマクロ * cpp14[meta cpp] -<-- start lang caution --> + このページはC++14に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 @@ -15,4 +15,4 @@ | マクロ名 | 値 | 説明 | |---------------|-----------|-------------------------| -| `__cplusplus` | `201402L` | C++のバージョン値を表す | +| `__cplusplus` | `201402L` | C++のバージョン値を表す | \ No newline at end of file diff --git a/lang/cpp14/relaxing_constraints_on_constexpr.md b/lang/cpp14/relaxing_constraints_on_constexpr.md index cc3d664265..dacd6abadd 100644 --- a/lang/cpp14/relaxing_constraints_on_constexpr.md +++ b/lang/cpp14/relaxing_constraints_on_constexpr.md @@ -1,13 +1,13 @@ # constexprの制限緩和 [N3652] * cpp14[meta cpp] -<-- start lang caution --> + このページはC++14に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++11で、汎用定数式の機能である[`constexpr`](/lang/cpp11/constexpr.md)が導入された。 @@ -212,4 +212,4 @@ C++14では、`constexpr`関数、`constexpr`メンバ関数、暗黙の`const` ## 参照 - [N3597 Relaxing constraints on `constexpr` functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3597.html) - [N3598 `constexpr` member functions and implicit `const`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3598.html) -- [N3652 Relaxing constraints on `constexpr` functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3652.html) +- [N3652 Relaxing constraints on `constexpr` functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3652.html) \ No newline at end of file diff --git a/lang/cpp14/return_type_deduction_for_normal_functions.md b/lang/cpp14/return_type_deduction_for_normal_functions.md index 040f506be8..05edc55cf2 100644 --- a/lang/cpp14/return_type_deduction_for_normal_functions.md +++ b/lang/cpp14/return_type_deduction_for_normal_functions.md @@ -1,13 +1,13 @@ # 通常関数の戻り値型推論 [N3638] * cpp14[meta cpp] -<-- start lang caution --> + このページはC++14に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 関数宣言の構文において、先頭の戻り値型を`auto`もしくは[`decltype(auto)`](decltype_auto.md)とすることで、戻り値の型が関数の`return`文から推論される。 @@ -244,4 +244,4 @@ auto g(F f) { return f(); } - [N3582 Return type deduction for normal functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3582.html) - [N3638 Return type deduction for normal functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3638.html) - [CWG Issue 1048. `auto` deduction and lambda return type deduction.](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1048) -- [CWG Issue 1588. Deducing cv-qualified `auto`](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1588) +- [CWG Issue 1588. Deducing cv-qualified `auto`](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1588) \ No newline at end of file diff --git a/lang/cpp14/sized_deallocation.md b/lang/cpp14/sized_deallocation.md index d3271b8096..9733d5fd90 100644 --- a/lang/cpp14/sized_deallocation.md +++ b/lang/cpp14/sized_deallocation.md @@ -1,13 +1,13 @@ # サイズ付きデアロケーション [N3778] * cpp14[meta cpp] -<-- start lang caution --> + このページはC++14に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++03ではクラス用の`delete`演算子として、サイズをとるバージョンをオーバーロードできた。C++14では、それに対応するグローバルの`delete`演算子を定義できるようにする。 diff --git a/lang/cpp14/variable_templates.md b/lang/cpp14/variable_templates.md index 37eed78f89..63d09298a4 100644 --- a/lang/cpp14/variable_templates.md +++ b/lang/cpp14/variable_templates.md @@ -1,13 +1,13 @@ # 変数テンプレート [N3651] * cpp14[meta cpp] -<-- start lang caution --> + このページはC++14に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 変数定義時のテンプレート指定を可能にする。 @@ -136,4 +136,4 @@ auto main() -> int ## 参照 - [N3651 Variable Templates (Revision 1)](http://open-std.org/JTC1/SC22/WG21/docs/papers/2013/n3651.pdf) - [Trip Report: ISO C++ Spring 2013 Meeting](https://isocpp.org/blog/2013/04/trip-report-iso-c-spring-2013-meeting) -- [変数テンプレートをラムダ式でキャプチャするときの注意 - Faith and Brave - C++で遊ぼう](http://faithandbrave.hateblo.jp/entry/2014/01/21/162701) +- [変数テンプレートをラムダ式でキャプチャするときの注意 - Faith and Brave - C++で遊ぼう](http://faithandbrave.hateblo.jp/entry/2014/01/21/162701) \ No newline at end of file diff --git a/lang/cpp17/allow_constant_evaluation_for_all_non-type_template_arguments.md b/lang/cpp17/allow_constant_evaluation_for_all_non-type_template_arguments.md index 1a5f04d3ee..bb3aa3b224 100644 --- a/lang/cpp17/allow_constant_evaluation_for_all_non-type_template_arguments.md +++ b/lang/cpp17/allow_constant_evaluation_for_all_non-type_template_arguments.md @@ -2,13 +2,13 @@ * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 C++17では、非型テンプレート引数(non-type template argument)で扱える型はとくに変わらないが、渡せる値についての制限緩和が行われる。 diff --git a/lang/cpp17/allow_default_template_arguments_of_variable_templates.md b/lang/cpp17/allow_default_template_arguments_of_variable_templates.md index f8c14b0986..a617781318 100644 --- a/lang/cpp17/allow_default_template_arguments_of_variable_templates.md +++ b/lang/cpp17/allow_default_template_arguments_of_variable_templates.md @@ -1,13 +1,13 @@ # 変数テンプレートのデフォルトテンプレート引数を許可 * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 C++17では、[変数テンプレート](/lang/cpp14/variable_templates.md)のテンプレートパラメータがデフォルト引数を持てることとなった。 diff --git a/lang/cpp17/allow_typename_in_a_template_template_parameter.md b/lang/cpp17/allow_typename_in_a_template_template_parameter.md index 2b05c7f5db..9150ce9b3b 100644 --- a/lang/cpp17/allow_typename_in_a_template_template_parameter.md +++ b/lang/cpp17/allow_typename_in_a_template_template_parameter.md @@ -1,13 +1,13 @@ # テンプレートテンプレートパラメータにtypenameキーワードの使用を許可 [N4051] * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 テンプレートパラメータはほとんどの箇所で`class`キーワードと`typename`キーワードの両方を使用できたが、テンプレートテンプレートパラメータのクラステンプレート部分については`class`キーワードしか使用できなかった。 diff --git a/lang/cpp17/attributes_for_namespaces_and_enumerators.md b/lang/cpp17/attributes_for_namespaces_and_enumerators.md index 7fd5c70142..f7b9ab09b1 100644 --- a/lang/cpp17/attributes_for_namespaces_and_enumerators.md +++ b/lang/cpp17/attributes_for_namespaces_and_enumerators.md @@ -1,13 +1,13 @@ # 名前空間と列挙子への属性付加を許可 [N4266] * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp17/constexpr_lambda.md b/lang/cpp17/constexpr_lambda.md index d67e01f5d8..a3c3d9b7e7 100644 --- a/lang/cpp17/constexpr_lambda.md +++ b/lang/cpp17/constexpr_lambda.md @@ -2,13 +2,13 @@ * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp17/construction_enum_class_values.md b/lang/cpp17/construction_enum_class_values.md index f776f8493b..2f6b48e2bc 100644 --- a/lang/cpp17/construction_enum_class_values.md +++ b/lang/cpp17/construction_enum_class_values.md @@ -1,13 +1,13 @@ # enum class変数の初期値として整数を指定する際の規則を調整 [P0138R2] * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++11にてスコープを持つ列挙型が導入された。これは基底型を明示することができ、従来の列挙型と異なり整数型への暗黙の型変換を行わない。 diff --git a/lang/cpp17/declaring_non-type_template_arguments_with_auto.md b/lang/cpp17/declaring_non-type_template_arguments_with_auto.md index 0ba305a8b6..7faa77fa08 100644 --- a/lang/cpp17/declaring_non-type_template_arguments_with_auto.md +++ b/lang/cpp17/declaring_non-type_template_arguments_with_auto.md @@ -2,13 +2,13 @@ * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++14まで、以下のように書いていた「指定された型の定数を受け取る」意図の非型テンプレートパラメータ(non-type template parameter)だが、 diff --git a/lang/cpp17/dynamic_memory_allocation_for_over-aligned_data.md b/lang/cpp17/dynamic_memory_allocation_for_over-aligned_data.md index 412876e18d..ceb1daf17f 100644 --- a/lang/cpp17/dynamic_memory_allocation_for_over-aligned_data.md +++ b/lang/cpp17/dynamic_memory_allocation_for_over-aligned_data.md @@ -1,13 +1,13 @@ # アライメント指定されたデータの動的メモリ確保 [P0035R4] * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp17/exception_spec_be_part_of_the_type_system.md b/lang/cpp17/exception_spec_be_part_of_the_type_system.md index d735f47075..4ae6a5bba8 100644 --- a/lang/cpp17/exception_spec_be_part_of_the_type_system.md +++ b/lang/cpp17/exception_spec_be_part_of_the_type_system.md @@ -1,13 +1,13 @@ # 例外仕様を型システムの一部にする [P0012R1] * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 [`noexcept`](/lang/cpp11/noexcept.md)による例外仕様が、関数の型の一部として扱われるようになる。 diff --git a/lang/cpp17/expression_evaluation_order.md b/lang/cpp17/expression_evaluation_order.md index 9be6c3effe..bfe7a07917 100644 --- a/lang/cpp17/expression_evaluation_order.md +++ b/lang/cpp17/expression_evaluation_order.md @@ -1,13 +1,13 @@ # 厳密な式の評価順 [P0145R3] * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp17/extending_static_assert.md b/lang/cpp17/extending_static_assert.md index 96d6c6e6a1..3fc1bc7906 100644 --- a/lang/cpp17/extending_static_assert.md +++ b/lang/cpp17/extending_static_assert.md @@ -1,13 +1,13 @@ # static_assert のメッセージ省略を許可 [N3928] * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 `static_assert` は [C++11](/lang/cpp11/static_assert.md) で導入されたが、第2引数に診断メッセージを指定しなければならなかった。 diff --git a/lang/cpp17/extension_to_aggregate_initialization.md b/lang/cpp17/extension_to_aggregate_initialization.md index b2c9414184..7b42690e6c 100644 --- a/lang/cpp17/extension_to_aggregate_initialization.md +++ b/lang/cpp17/extension_to_aggregate_initialization.md @@ -2,13 +2,13 @@ * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp17/fallthrough.md b/lang/cpp17/fallthrough.md index 5e35908756..f809ea834d 100644 --- a/lang/cpp17/fallthrough.md +++ b/lang/cpp17/fallthrough.md @@ -1,13 +1,13 @@ # [[fallthrough]]属性 [P0188R1] * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp17/feature_test_macros.md b/lang/cpp17/feature_test_macros.md index 3b618d8c8f..91cfd4e192 100644 --- a/lang/cpp17/feature_test_macros.md +++ b/lang/cpp17/feature_test_macros.md @@ -1,13 +1,13 @@ # 機能テストマクロ * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp17/folding_expressions.md b/lang/cpp17/folding_expressions.md index 60cba9317a..408b058618 100644 --- a/lang/cpp17/folding_expressions.md +++ b/lang/cpp17/folding_expressions.md @@ -1,13 +1,13 @@ # 畳み込み式 [N4295] * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp17/generalizing_the_range-based_for_loop.md b/lang/cpp17/generalizing_the_range-based_for_loop.md index e400fc3616..818f3b526e 100644 --- a/lang/cpp17/generalizing_the_range-based_for_loop.md +++ b/lang/cpp17/generalizing_the_range-based_for_loop.md @@ -1,13 +1,13 @@ # 範囲 for ループの制限緩和 [P0184R0] * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp17/guaranteed_copy_elision.md b/lang/cpp17/guaranteed_copy_elision.md index 448649cf21..df83a6b77d 100644 --- a/lang/cpp17/guaranteed_copy_elision.md +++ b/lang/cpp17/guaranteed_copy_elision.md @@ -2,13 +2,13 @@ * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 C++11で右辺値参照を導入するときに規定された「値カテゴリー (value category)」の仕様(C++17で更新)を利用し、[`prvalue`](../cpp11/rvalue_ref_and_move_semantics.md)[注1]というカテゴリーの値を、オブジェクトの初期化のために使用する場合に、コピーが省略される。 diff --git a/lang/cpp17/has_include.md b/lang/cpp17/has_include.md index 9972b6917a..46c583c24d 100644 --- a/lang/cpp17/has_include.md +++ b/lang/cpp17/has_include.md @@ -1,13 +1,13 @@ # __has_include [P0061R1] * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp17/hexadecimal_floating_literals.md b/lang/cpp17/hexadecimal_floating_literals.md index c239faf66d..914023b131 100644 --- a/lang/cpp17/hexadecimal_floating_literals.md +++ b/lang/cpp17/hexadecimal_floating_literals.md @@ -1,12 +1,12 @@ # 十六進浮動小数点数リテラル [P0245R1] * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + * [mathjax enable] diff --git a/lang/cpp17/if_constexpr.md b/lang/cpp17/if_constexpr.md index 0c1b360046..48028fc0c6 100644 --- a/lang/cpp17/if_constexpr.md +++ b/lang/cpp17/if_constexpr.md @@ -1,13 +1,13 @@ # constexpr if 文 [P0292R2] * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp17/inline_variables.md b/lang/cpp17/inline_variables.md index 20ef21ee3f..937afd223b 100644 --- a/lang/cpp17/inline_variables.md +++ b/lang/cpp17/inline_variables.md @@ -1,13 +1,13 @@ # インライン変数 [P0386R2] * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp17/lambda_capture_of_this_by_value.md b/lang/cpp17/lambda_capture_of_this_by_value.md index 2340d2a4f8..2e91fe9cbe 100644 --- a/lang/cpp17/lambda_capture_of_this_by_value.md +++ b/lang/cpp17/lambda_capture_of_this_by_value.md @@ -1,13 +1,13 @@ # ラムダ式での*thisのコピーキャプチャ [P0018R3] * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++14までラムダ式で`[this]`のようにキャプチャをすると、`this`ポインタがコピーされていた。その場合、非同期処理のような状況で、ラムダ式の関数オブジェクトが呼び出されたときに、`this`ポインタが指すオブジェクトの寿命が尽きている場合がある。 diff --git a/lang/cpp17/lambda_to_noexcept_function_pointer.md b/lang/cpp17/lambda_to_noexcept_function_pointer.md index 6b8d71d829..c0532d9d11 100644 --- a/lang/cpp17/lambda_to_noexcept_function_pointer.md +++ b/lang/cpp17/lambda_to_noexcept_function_pointer.md @@ -1,13 +1,13 @@ # noexcept付きのラムダ式から変換する関数ポインタにnoexceptを付加する * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 キャプチャを持たない非ジェネリックなラムダ式は、関数ポインタに変換できる。そのラムダ式が例外を投げない指定をされていた場合、変換された関数ポインタもまた`noexcept`を持つ。 @@ -55,4 +55,4 @@ true ## 参照 -- [CWG Issue 1722. Should lambda to function pointer conversion function be `noexcept`?](https://wg21.cmeerw.net/cwg/issue1722) +- [CWG Issue 1722. Should lambda to function pointer conversion function be `noexcept`?](https://wg21.cmeerw.net/cwg/issue1722) \ No newline at end of file diff --git a/lang/cpp17/maybe_unused.md b/lang/cpp17/maybe_unused.md index 7832e097e4..0c61865ae7 100644 --- a/lang/cpp17/maybe_unused.md +++ b/lang/cpp17/maybe_unused.md @@ -1,13 +1,13 @@ # [[maybe_unused]]属性 [P0212R1] * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp17/nested_namespace.md b/lang/cpp17/nested_namespace.md index 2745b55138..37c3df4f46 100644 --- a/lang/cpp17/nested_namespace.md +++ b/lang/cpp17/nested_namespace.md @@ -1,13 +1,13 @@ # 入れ子名前空間の定義 [N4230] * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 一度の定義だけで入れ子状になった名前空間を定義可能となる。 diff --git a/lang/cpp17/new_rules_for_auto_deduction_from_braced-init-list.md b/lang/cpp17/new_rules_for_auto_deduction_from_braced-init-list.md index 2a635eaece..017d28e058 100644 --- a/lang/cpp17/new_rules_for_auto_deduction_from_braced-init-list.md +++ b/lang/cpp17/new_rules_for_auto_deduction_from_braced-init-list.md @@ -1,13 +1,13 @@ # 波括弧初期化の型推論の新規則 [N3922] * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp17/nodiscard.md b/lang/cpp17/nodiscard.md index 489a4d2d17..7346a5df01 100644 --- a/lang/cpp17/nodiscard.md +++ b/lang/cpp17/nodiscard.md @@ -1,13 +1,13 @@ # [[nodiscard]]属性 [P0189R1] * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp17/non_standard_attributes.md b/lang/cpp17/non_standard_attributes.md index ad9fbd5897..c0fabc99d7 100644 --- a/lang/cpp17/non_standard_attributes.md +++ b/lang/cpp17/non_standard_attributes.md @@ -1,13 +1,13 @@ # 不明な属性を無視する [P0283R2] * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp17/pack_expansions_in_using.md b/lang/cpp17/pack_expansions_in_using.md index de332e0a1a..c2b4a7e841 100644 --- a/lang/cpp17/pack_expansions_in_using.md +++ b/lang/cpp17/pack_expansions_in_using.md @@ -1,13 +1,13 @@ # using宣言のパック展開 [P0195R2] * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp17/predefined_macros.md b/lang/cpp17/predefined_macros.md index c084697551..a1462c55ee 100644 --- a/lang/cpp17/predefined_macros.md +++ b/lang/cpp17/predefined_macros.md @@ -1,13 +1,13 @@ # 更新された定義済みマクロ * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 @@ -25,4 +25,4 @@ ## 関連項目 -- [C++17 アライメント指定されたデータの動的メモリ確保](dynamic_memory_allocation_for_over-aligned_data.md) +- [C++17 アライメント指定されたデータの動的メモリ確保](dynamic_memory_allocation_for_over-aligned_data.md) \ No newline at end of file diff --git a/lang/cpp17/remove_deprecated_exception_specifications.md b/lang/cpp17/remove_deprecated_exception_specifications.md index 127715a9b2..8d645f0457 100644 --- a/lang/cpp17/remove_deprecated_exception_specifications.md +++ b/lang/cpp17/remove_deprecated_exception_specifications.md @@ -1,13 +1,13 @@ # 非推奨だった古い例外仕様を削除 [P0003R5] * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++11で[`noexcept`](/lang/cpp11/noexcept.md)機能が入ったことにより、従来の`throw`キーワードを使用した「例外仕様 (Exception Specification)」は「動的例外仕様 (Dynamic Exception Specification)」という名前に変更され、非推奨となっていた。 diff --git a/lang/cpp17/remove_deprecated_increment_of_bool.md b/lang/cpp17/remove_deprecated_increment_of_bool.md index 3ff243c755..4888e6a5d8 100644 --- a/lang/cpp17/remove_deprecated_increment_of_bool.md +++ b/lang/cpp17/remove_deprecated_increment_of_bool.md @@ -1,13 +1,13 @@ # 非推奨だった bool 型に対するインクリメント演算子を削除 [P0002R1] * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp17/remove_deprecated_use_of_the_register_keyword.md b/lang/cpp17/remove_deprecated_use_of_the_register_keyword.md index bffa62989b..4bbea0c54e 100644 --- a/lang/cpp17/remove_deprecated_use_of_the_register_keyword.md +++ b/lang/cpp17/remove_deprecated_use_of_the_register_keyword.md @@ -1,13 +1,13 @@ # 非推奨だったregisterキーワードを削除 [P0001R1] * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp17/removing_trigraphs.md b/lang/cpp17/removing_trigraphs.md index 8b0967eabb..32b4e85805 100644 --- a/lang/cpp17/removing_trigraphs.md +++ b/lang/cpp17/removing_trigraphs.md @@ -1,13 +1,13 @@ # トライグラフの削除 [N4086] * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp17/replacement_of_class_objects_containing_reference_members.md b/lang/cpp17/replacement_of_class_objects_containing_reference_members.md index 2aa783929a..c14c128a54 100644 --- a/lang/cpp17/replacement_of_class_objects_containing_reference_members.md +++ b/lang/cpp17/replacement_of_class_objects_containing_reference_members.md @@ -1,13 +1,13 @@ # 参照メンバをもつクラスの置き換え [P0137R1] * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 `placement new`を使用して、参照型や`const`メンバ変数を含む構造体/クラスを置き換える際、オブジェクト生存期間(lifetime)に基づいた最適化の抑止をコンパイラに伝える関数[`std::launder()`](/reference/new/launder.md)を用いることで、未定義動作となるような文脈で参照型や`const`メンバ変数へのアクセスができる。 @@ -99,4 +99,4 @@ public: - [std::launder - cppreference.com](https://en.cppreference.com/w/cpp/utility/launder) - [Pointer safety and placement new](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4303.html) - [Implementability of std::optional (std :: optionalの実装可能性) ](https://groups.google.com/a/isocpp.org/forum/#!msg/std-proposals/93ebFsxCjvQ/Q5LUnO8339wJ) -- [Lifetime - cppreference.com](https://en.cppreference.com/w/cpp/language/lifetime) +- [Lifetime - cppreference.com](https://en.cppreference.com/w/cpp/language/lifetime) \ No newline at end of file diff --git a/lang/cpp17/selection_statements_with_initializer.md b/lang/cpp17/selection_statements_with_initializer.md index b72260aa53..853453de27 100644 --- a/lang/cpp17/selection_statements_with_initializer.md +++ b/lang/cpp17/selection_statements_with_initializer.md @@ -1,13 +1,13 @@ # if文とswitch文の条件式と初期化を分離 [P0305R1] * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp17/structured_bindings.md b/lang/cpp17/structured_bindings.md index 261e9ac82b..c0b07bf728 100644 --- a/lang/cpp17/structured_bindings.md +++ b/lang/cpp17/structured_bindings.md @@ -1,13 +1,13 @@ # 構造化束縛 [P0217R3] * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 「構造化束縛 (structured bindings)」は、組やタプル、配列や構造体を分解して各要素を取り出す機能である。 diff --git a/lang/cpp17/type_deduction_for_class_templates.md b/lang/cpp17/type_deduction_for_class_templates.md index 4c7d684272..34ece2891c 100644 --- a/lang/cpp17/type_deduction_for_class_templates.md +++ b/lang/cpp17/type_deduction_for_class_templates.md @@ -1,13 +1,13 @@ # クラステンプレートのテンプレート引数推論 [P0091R3] * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 コンストラクタに渡される値によって、クラステンプレートのテンプレート引数を推論する。 diff --git a/lang/cpp17/using_attribute_namespaces.md b/lang/cpp17/using_attribute_namespaces.md index bd23c19a77..5d944df0bb 100644 --- a/lang/cpp17/using_attribute_namespaces.md +++ b/lang/cpp17/using_attribute_namespaces.md @@ -1,13 +1,13 @@ # 属性の名前空間指定に繰り返しをなくす [P0028R4] * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp17/utf8_character_literals.md b/lang/cpp17/utf8_character_literals.md index c486f134d5..e0efe041a8 100644 --- a/lang/cpp17/utf8_character_literals.md +++ b/lang/cpp17/utf8_character_literals.md @@ -1,13 +1,13 @@ # UTF-8文字リテラル [N4267] * cpp17[meta cpp] -<-- start lang caution --> + このページはC++17に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++14までは、UTF-8エンコーディングであることを示す`u8`プレフィックスを、文字列リテラルに対してのみ指定できた。C++17では、文字リテラルに対しても`u8`プレフィックスを付けられる。 @@ -36,4 +36,4 @@ C++20ではUTF-8文字リテラルの型が[`char`ではなく`char8_t`になる ## 参照 - [N4267 Adding `u8` character literals](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4267.html) - [C0 Controls and Basic Latin - The Unicode Consortium](http://www.unicode.org/charts/PDF/U0000.pdf) -- [基本ラテン文字 (Unicodeのブロック) - Wikipedia](https://ja.wikipedia.org/wiki/%E5%9F%BA%E6%9C%AC%E3%83%A9%E3%83%86%E3%83%B3%E6%96%87%E5%AD%97_(Unicode%E3%81%AE%E3%83%96%E3%83%AD%E3%83%83%E3%82%AF)) +- [基本ラテン文字 (Unicodeのブロック) - Wikipedia](https://ja.wikipedia.org/wiki/%E5%9F%BA%E6%9C%AC%E3%83%A9%E3%83%86%E3%83%B3%E6%96%87%E5%AD%97_(Unicode%E3%81%AE%E3%83%96%E3%83%AD%E3%83%83%E3%82%AF)) \ No newline at end of file diff --git a/lang/cpp20/access_checking_on_specializations.md b/lang/cpp20/access_checking_on_specializations.md index b80a26c32a..e7e3e1126a 100644 --- a/lang/cpp20/access_checking_on_specializations.md +++ b/lang/cpp20/access_checking_on_specializations.md @@ -1,13 +1,13 @@ # 特殊化のアクセスチェック [P0692R1] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 @@ -152,4 +152,4 @@ namespace option3 { ## 参照 -- [P0692R1 Access Checking on Specializations](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0692r1.html) +- [P0692R1 Access Checking on Specializations](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0692r1.html) \ No newline at end of file diff --git a/lang/cpp20/adl_and_function_templates_that_are_not_visible.md b/lang/cpp20/adl_and_function_templates_that_are_not_visible.md index fe061cd64c..360530f8df 100644 --- a/lang/cpp20/adl_and_function_templates_that_are_not_visible.md +++ b/lang/cpp20/adl_and_function_templates_that_are_not_visible.md @@ -1,13 +1,13 @@ # 関数テンプレートに明示的に型指定した場合にADLで見つからない問題を修正 [P0846R0] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 C++17までは、以下のコードが不適格だった: diff --git a/lang/cpp20/allow_initializing_aggregates_from_a_parenthesized_list_of_values.md b/lang/cpp20/allow_initializing_aggregates_from_a_parenthesized_list_of_values.md index b9686a4ed9..eda127df37 100644 --- a/lang/cpp20/allow_initializing_aggregates_from_a_parenthesized_list_of_values.md +++ b/lang/cpp20/allow_initializing_aggregates_from_a_parenthesized_list_of_values.md @@ -2,13 +2,13 @@ * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp20/allow_lambda_capture_equal_this.md b/lang/cpp20/allow_lambda_capture_equal_this.md index 8c8cc2e0b9..f2ca69bffc 100644 --- a/lang/cpp20/allow_lambda_capture_equal_this.md +++ b/lang/cpp20/allow_lambda_capture_equal_this.md @@ -1,13 +1,13 @@ # ラムダ式のキャプチャとして[=, this]を許可する [P0409R2] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++17まで、ラムダ式のキャプチャとして`[=, this]`は指定できなかった。これは、デフォルトコピーキャプチャ (`=`) に、`this`ポインタのコピーキャプチャが含まれるため、重複指定はできないというものである。 diff --git a/lang/cpp20/allow_pack_expansion_in_lambda_init_capture.md b/lang/cpp20/allow_pack_expansion_in_lambda_init_capture.md index 8bece858e6..e4171c60f9 100644 --- a/lang/cpp20/allow_pack_expansion_in_lambda_init_capture.md +++ b/lang/cpp20/allow_pack_expansion_in_lambda_init_capture.md @@ -1,13 +1,13 @@ # ラムダ式の初期化キャプチャでのパック展開を許可 [P0780R2] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 [ラムダ式](/lang/cpp11/lambda_expressions.md)の[初期化キャプチャ](../cpp14/initialize_capture.md)で、パック展開ができるようになった。 diff --git a/lang/cpp20/allow_structured_bindings_to_accessible_members.md b/lang/cpp20/allow_structured_bindings_to_accessible_members.md index e00dafa584..7eed7ff0dd 100644 --- a/lang/cpp20/allow_structured_bindings_to_accessible_members.md +++ b/lang/cpp20/allow_structured_bindings_to_accessible_members.md @@ -1,13 +1,13 @@ # friend指定された関数内から構造化束縛を使用して非公開メンバ変数にアクセスすることを許可 [P0969R0] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++17までの構造化束縛では、publicアクセス指定されたメンバ変数のみ抽出できる仕様となっていた。 diff --git a/lang/cpp20/allow_virtual_function_calls_in_constant_expressions.md b/lang/cpp20/allow_virtual_function_calls_in_constant_expressions.md index 92057fd4ca..6a6643aaed 100644 --- a/lang/cpp20/allow_virtual_function_calls_in_constant_expressions.md +++ b/lang/cpp20/allow_virtual_function_calls_in_constant_expressions.md @@ -1,13 +1,13 @@ # 定数式からの仮想関数の呼び出しを許可 [P1064R0] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++20では、仮想関数に対して`constexpr`を指定し、定数式の文脈で呼び出せるようになる。 diff --git a/lang/cpp20/allowing_dynamic_cast_polymorphic_typeid_in_constant_expressions.md b/lang/cpp20/allowing_dynamic_cast_polymorphic_typeid_in_constant_expressions.md index 47e9962222..79fb171a64 100644 --- a/lang/cpp20/allowing_dynamic_cast_polymorphic_typeid_in_constant_expressions.md +++ b/lang/cpp20/allowing_dynamic_cast_polymorphic_typeid_in_constant_expressions.md @@ -1,13 +1,13 @@ # 定数式での`dynamic_cast`、多態的な`typeid`を許可 [P1327R1] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp20/array_size_deduction_in_new-expressions.md b/lang/cpp20/array_size_deduction_in_new-expressions.md index 38c8f90d92..34a3005acd 100644 --- a/lang/cpp20/array_size_deduction_in_new-expressions.md +++ b/lang/cpp20/array_size_deduction_in_new-expressions.md @@ -2,13 +2,13 @@ * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp20/changing_the_active_member_of_a_union_inside_constexpr.md b/lang/cpp20/changing_the_active_member_of_a_union_inside_constexpr.md index 3f82156d44..6cd672333a 100644 --- a/lang/cpp20/changing_the_active_member_of_a_union_inside_constexpr.md +++ b/lang/cpp20/changing_the_active_member_of_a_union_inside_constexpr.md @@ -1,13 +1,13 @@ # 定数式内での共用体のアクティブメンバの変更を許可 [P1330R0] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp20/char8_t.md b/lang/cpp20/char8_t.md index 6d2a7d3990..3b1decd0a3 100644 --- a/lang/cpp20/char8_t.md +++ b/lang/cpp20/char8_t.md @@ -1,13 +1,13 @@ # UTF-8エンコーディングされた文字の型として`char8_t`を追加 [P0482R6] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp20/checking_for_abstract_class_types.md b/lang/cpp20/checking_for_abstract_class_types.md index 14e0f528fa..55f911cad1 100644 --- a/lang/cpp20/checking_for_abstract_class_types.md +++ b/lang/cpp20/checking_for_abstract_class_types.md @@ -1,13 +1,13 @@ # 抽象型のチェック [P0929R2] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 C++17までは以下の仕様があったため、抽象クラスに早期の制限があった: diff --git a/lang/cpp20/class_template_argument_deduction_for_aggregates.md b/lang/cpp20/class_template_argument_deduction_for_aggregates.md index 20169b4c8f..33d7311745 100644 --- a/lang/cpp20/class_template_argument_deduction_for_aggregates.md +++ b/lang/cpp20/class_template_argument_deduction_for_aggregates.md @@ -1,13 +1,13 @@ # 集成体クラステンプレートのテンプレート引数推論 [P1816R0] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++17で導入されたクラステンプレートのテンプレート引数推論は、コンストラクタ引数からテンプレート引数を推論するものであった。 diff --git a/lang/cpp20/class_template_argument_deduction_for_alias_templates.md b/lang/cpp20/class_template_argument_deduction_for_alias_templates.md index 313c11a4a8..848b543cad 100644 --- a/lang/cpp20/class_template_argument_deduction_for_alias_templates.md +++ b/lang/cpp20/class_template_argument_deduction_for_alias_templates.md @@ -1,13 +1,13 @@ # エイリアステンプレート経由でのクラステンプレートのテンプレート引数推論 [P1814R0] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++17で導入されたクラステンプレートのテンプレート引数推論は、コンストラクタ引数からテンプレート引数を推論するものであった。しかし、そのクラステンプレートのエイリアステンプレートを定義した場合に、エイリアステンプレートの変数定義からはクラステンプレートのテンプレート引数を推論できない問題があった。 diff --git a/lang/cpp20/class_types_in_non-type_template_parameters.md b/lang/cpp20/class_types_in_non-type_template_parameters.md index 9df91ede14..741e364847 100644 --- a/lang/cpp20/class_types_in_non-type_template_parameters.md +++ b/lang/cpp20/class_types_in_non-type_template_parameters.md @@ -1,13 +1,13 @@ # 非型テンプレートパラメータとしてクラス型を許可する [P0732R2] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 これまで、非型テンプレートパラメータ (non-type template parameter) としては、整数型、ポインタ、参照、[`std::nullptr_t`](/reference/cstddef/nullptr_t.md)、[プレースホルダ型](/lang/cpp17/declaring_non-type_template_arguments_with_auto.md)の値しか受け取ることが許可されていなかった。 diff --git a/lang/cpp20/concepts.md b/lang/cpp20/concepts.md index 94b2888067..97d65c35c7 100644 --- a/lang/cpp20/concepts.md +++ b/lang/cpp20/concepts.md @@ -1,13 +1,13 @@ # コンセプト [P0734R0] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++20から導入される「コンセプト (concepts)」は、テンプレートパラメータを制約する機能である。この機能を使用することで、以下のような面でプログラミングのしやすさが向上する: diff --git a/lang/cpp20/consistent_comparison.md b/lang/cpp20/consistent_comparison.md index 91c1df4578..5b8cac2d3e 100644 --- a/lang/cpp20/consistent_comparison.md +++ b/lang/cpp20/consistent_comparison.md @@ -1,13 +1,13 @@ # 一貫比較 [P0515R3] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 新しく三方比較演算子`<=>`が導入されることにより、順序付けと同値比較の6つの関係演算子(`<`, `<=`, `>`, `>=`, `==`, `!=`)を容易に実装することができるようになる。 diff --git a/lang/cpp20/constinit.md b/lang/cpp20/constinit.md index e23305588b..278c0de2dd 100644 --- a/lang/cpp20/constinit.md +++ b/lang/cpp20/constinit.md @@ -1,13 +1,13 @@ # コンパイル時初期化を強制する`constinit`キーワードを追加 [P1143R2] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp20/converting_from_pointer_to_bool_should_be_considered_narrowing.md b/lang/cpp20/converting_from_pointer_to_bool_should_be_considered_narrowing.md index 7b2b886e82..2c03a7b4d8 100644 --- a/lang/cpp20/converting_from_pointer_to_bool_should_be_considered_narrowing.md +++ b/lang/cpp20/converting_from_pointer_to_bool_should_be_considered_narrowing.md @@ -1,13 +1,13 @@ # ポインタから`bool`への変換を縮小変換とする [P1957R2] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp20/coroutines.md b/lang/cpp20/coroutines.md index b01763587e..a85f035951 100644 --- a/lang/cpp20/coroutines.md +++ b/lang/cpp20/coroutines.md @@ -1,13 +1,13 @@ # コルーチン [P0912R5] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 処理途中でのサスペンド(中断)/レジューム(再開)をサポートする一般化された関数として、[コルーチン](https://ja.wikipedia.org/wiki/%E3%82%B3%E3%83%AB%E3%83%BC%E3%83%81%E3%83%B3)が導入される。 diff --git a/lang/cpp20/default_constructible_and_assignable_stateless_lambdas.md b/lang/cpp20/default_constructible_and_assignable_stateless_lambdas.md index 9cad42c30f..43c2c464d5 100644 --- a/lang/cpp20/default_constructible_and_assignable_stateless_lambdas.md +++ b/lang/cpp20/default_constructible_and_assignable_stateless_lambdas.md @@ -1,13 +1,13 @@ # 状態を持たないラムダ式を、デフォルト構築可能、代入可能とする [P0624R2] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp20/default_member_initializers_for_bit_fields.md b/lang/cpp20/default_member_initializers_for_bit_fields.md index 3d3bdb4d98..89b4aa3f70 100644 --- a/lang/cpp20/default_member_initializers_for_bit_fields.md +++ b/lang/cpp20/default_member_initializers_for_bit_fields.md @@ -1,13 +1,13 @@ # ビットフィールドのメンバ変数初期化 [P0683R1] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++11で導入された[非静的メンバ変数の初期化子](/lang/cpp11/non_static_data_member_initializers.md)では、ビットフィールドは対象外であった。 @@ -83,4 +83,4 @@ int main() ## 参照 - [P0187R0 Proposal of Bitfield Default Member Initializers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0187r0.pdf) - [R0187R1 Proposal/Wording for Bit-field Default Member Initializer Syntax](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0187r1.pdf) -- [P0683R1 Default member initializers for bit-fields](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0683r1.html) +- [P0683R1 Default member initializers for bit-fields](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0683r1.html) \ No newline at end of file diff --git a/lang/cpp20/deprecate_implicit_capture_of_this_via_defcopy.md b/lang/cpp20/deprecate_implicit_capture_of_this_via_defcopy.md index 795b36fe40..a2006710a1 100644 --- a/lang/cpp20/deprecate_implicit_capture_of_this_via_defcopy.md +++ b/lang/cpp20/deprecate_implicit_capture_of_this_via_defcopy.md @@ -1,13 +1,13 @@ # [=]によるthisの暗黙のキャプチャを非推奨化 [P0806R2] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++20からは、ラムダ式でのデフォルトコピーのキャプチャ指定`[=]`での`this`ポインタのキャプチャは非推奨となる。 diff --git a/lang/cpp20/deprecate_pod.md b/lang/cpp20/deprecate_pod.md index 03c4da1066..8bc6023617 100644 --- a/lang/cpp20/deprecate_pod.md +++ b/lang/cpp20/deprecate_pod.md @@ -1,13 +1,13 @@ # PODを非推奨化 [P0767R1] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 [POD (Plain Old Data) という型の分類](/reference/type_traits/is_pod.md)は、C++11において[トリビアル型](/reference/type_traits/is_trivial.md)と[スタンダードレイアウト型](/reference/type_traits/is_standard_layout.md)に用語が分割された。 diff --git a/lang/cpp20/deprecate_uses_of_the_comma_operator_in_subscripting_expressions.md b/lang/cpp20/deprecate_uses_of_the_comma_operator_in_subscripting_expressions.md index d5e8cabe3a..be7420c5ba 100644 --- a/lang/cpp20/deprecate_uses_of_the_comma_operator_in_subscripting_expressions.md +++ b/lang/cpp20/deprecate_uses_of_the_comma_operator_in_subscripting_expressions.md @@ -1,13 +1,13 @@ # 添字演算子内でのカンマ演算子の使用を非推奨化 [P1161R3] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 多次元配列クラスを設計する場合などで、単一の引数しかとれない添字演算子に`ar[x, y]`のようにカンマ演算子をオーバーロードして複数のインデックスを指定できるようにすることがあった。 diff --git a/lang/cpp20/deprecating_volatile.md b/lang/cpp20/deprecating_volatile.md index e839c4a6e0..9586db0d60 100644 --- a/lang/cpp20/deprecating_volatile.md +++ b/lang/cpp20/deprecating_volatile.md @@ -1,13 +1,13 @@ # ほとんどの`volatile`を非推奨化 [P1152R4] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp20/designated_initialization.md b/lang/cpp20/designated_initialization.md index f21a37367f..257318aedd 100644 --- a/lang/cpp20/designated_initialization.md +++ b/lang/cpp20/designated_initialization.md @@ -2,13 +2,13 @@ * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 C++20では、波カッコによる集成体初期化においてメンバ名を指定して初期化が行える。 diff --git a/lang/cpp20/down_with_typename.md b/lang/cpp20/down_with_typename.md index 6694575063..332621f08e 100644 --- a/lang/cpp20/down_with_typename.md +++ b/lang/cpp20/down_with_typename.md @@ -2,13 +2,13 @@ * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md b/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md index 90f56aa926..e995bf5771 100644 --- a/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md +++ b/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md @@ -1,13 +1,13 @@ # 可変長データを扱うクラスの効率的なdelete [P0722R3] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp20/enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.md b/lang/cpp20/enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.md index 0a947a7980..ecbff6e9f8 100644 --- a/lang/cpp20/enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.md +++ b/lang/cpp20/enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.md @@ -1,13 +1,13 @@ # constexpr関数内で未評価のインラインアセンブリを許可することによる組み込み関数のconstexpr有効化 [P1668R1] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp20/explicit_bool.md b/lang/cpp20/explicit_bool.md index 64a1ffee3c..c8e39641d4 100644 --- a/lang/cpp20/explicit_bool.md +++ b/lang/cpp20/explicit_bool.md @@ -1,13 +1,13 @@ # 関数を条件付きでexplicitにする構文を追加 [P0892R2] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++20では、関数を条件付きで`explicit`にする構文が追加された。コンストラクタと変換演算子に指定する`explicit`指定子に、`explicit(true)`、`explicit(false)`のように`bool`に変換可能な定数式を指定する。`true`に評価される値を指定することで、その関数は`explicit`となる。 diff --git a/lang/cpp20/extending_structured_bindings_to_be_more_like_variable_declarations.md b/lang/cpp20/extending_structured_bindings_to_be_more_like_variable_declarations.md index 8873ff8d07..9d73404bc7 100644 --- a/lang/cpp20/extending_structured_bindings_to_be_more_like_variable_declarations.md +++ b/lang/cpp20/extending_structured_bindings_to_be_more_like_variable_declarations.md @@ -1,13 +1,13 @@ # 構造化束縛を拡張して通常の変数宣言のように使用できるようにする [P1091R3] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++17で導入された構造化束縛宣言に指定しておけるのはCV修飾のみで、記憶域クラスや`constexpr`等を指定することは出来なかった。 diff --git a/lang/cpp20/familiar_template_syntax_for_generic_lambdas.md b/lang/cpp20/familiar_template_syntax_for_generic_lambdas.md index 5a08c58096..bd15670786 100644 --- a/lang/cpp20/familiar_template_syntax_for_generic_lambdas.md +++ b/lang/cpp20/familiar_template_syntax_for_generic_lambdas.md @@ -1,13 +1,13 @@ # ジェネリックラムダのテンプレート構文 [P0428R2] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++14では、ラムダ式のパラメータ型に`auto`キーワードを使用することで、任意の型のパラメータを受け取れるようになった: diff --git a/lang/cpp20/feature_test_macros.md b/lang/cpp20/feature_test_macros.md index e8a9335cf1..848a1a5422 100644 --- a/lang/cpp20/feature_test_macros.md +++ b/lang/cpp20/feature_test_macros.md @@ -1,13 +1,13 @@ # 機能テストマクロ * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp20/fixing_const_qualified_pointers_to_members.md b/lang/cpp20/fixing_const_qualified_pointers_to_members.md index cd37f49178..b5fb535496 100644 --- a/lang/cpp20/fixing_const_qualified_pointers_to_members.md +++ b/lang/cpp20/fixing_const_qualified_pointers_to_members.md @@ -1,13 +1,13 @@ # const修飾されたメンバポインタの制限を修正 [P0704R1] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++11で[メンバ関数を左辺値/右辺値修飾](/lang/cpp11/ref_qualifier_for_this.md)する機能が導入された。その際、以下の例において、同じ関数を呼び出す場合でも、メンバ関数ポインタを介した方だけが不適格となっていた: diff --git a/lang/cpp20/function_templates_with_auto_parameters.md b/lang/cpp20/function_templates_with_auto_parameters.md index dfb0844cd9..445873b433 100644 --- a/lang/cpp20/function_templates_with_auto_parameters.md +++ b/lang/cpp20/function_templates_with_auto_parameters.md @@ -1,13 +1,13 @@ # autoパラメータによる関数テンプレートの簡易定義 * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++14で導入された[ジェネリックラムダ](/lang/cpp14/generic_lambdas.md)と同様に、通常の関数もパラメータ型を`auto`にすることで、簡易的に関数テンプレートを定義できるようにする。 diff --git a/lang/cpp20/immediate_functions.md b/lang/cpp20/immediate_functions.md index 3aab076fef..4bcdff0d84 100644 --- a/lang/cpp20/immediate_functions.md +++ b/lang/cpp20/immediate_functions.md @@ -2,13 +2,13 @@ * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md index 1abdbef19e..632a6de5e0 100644 --- a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md +++ b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md @@ -1,13 +1,13 @@ # 未初期化領域への暗黙的なオブジェクト構築 * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp20/language_support_for_empty_objects.md b/lang/cpp20/language_support_for_empty_objects.md index e44221ece6..f1b35705ee 100644 --- a/lang/cpp20/language_support_for_empty_objects.md +++ b/lang/cpp20/language_support_for_empty_objects.md @@ -2,13 +2,13 @@ * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp20/less_eager_instantiation_of_constexpr_functions.md b/lang/cpp20/less_eager_instantiation_of_constexpr_functions.md index 0620316fbd..3628038c7c 100644 --- a/lang/cpp20/less_eager_instantiation_of_constexpr_functions.md +++ b/lang/cpp20/less_eager_instantiation_of_constexpr_functions.md @@ -1,13 +1,13 @@ # 評価されない文脈での定数式評価によって特殊メンバ関数がインスタンス化されることを規定 [P0859R0] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 以前まで、デフォルトコンストラクタやムーブコンストラクタといった特殊メンバ関数は、odr-usedになった段階で定義される規定になっていた。しかし、`sizeof`や`decltype`のオペランドのような評価されない文脈においてはodr-usedにならないため、そのような文脈では特殊メンバ関数が使用できなかった。 diff --git a/lang/cpp20/likely_and_unlikely_attributes.md b/lang/cpp20/likely_and_unlikely_attributes.md index 134f043937..f368c8873a 100644 --- a/lang/cpp20/likely_and_unlikely_attributes.md +++ b/lang/cpp20/likely_and_unlikely_attributes.md @@ -1,13 +1,13 @@ # 確率が高い分岐と低い分岐を伝える属性 [[likely]], [[unlikely]] [P0479R5] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 if文やswitch文といった分岐制御構文において、条件分岐先のうちどれが実行される可能性が高いかという情報を、C++コンパイラへ最適化ヒントとして与える属性である。 diff --git a/lang/cpp20/make_char16t_char32t_string_literals_be_utf16_32.md b/lang/cpp20/make_char16t_char32t_string_literals_be_utf16_32.md index 8024ceda99..69046036e2 100644 --- a/lang/cpp20/make_char16t_char32t_string_literals_be_utf16_32.md +++ b/lang/cpp20/make_char16t_char32t_string_literals_be_utf16_32.md @@ -1,13 +1,13 @@ # char16_tとchar32_tの文字・文字列リテラルを、文字コードUTF-16/32に規定 [P1041R4] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++11で追加された文字型[`char16_t`と`char32_t`](/lang/cpp11/char16_32.md)の文字・文字列リテラルの文字コード、C++20からはUTF-16とUTF-32であることが規定される。 diff --git a/lang/cpp20/modules.md b/lang/cpp20/modules.md index b266f80a71..08c718408e 100644 --- a/lang/cpp20/modules.md +++ b/lang/cpp20/modules.md @@ -1,13 +1,13 @@ # モジュール [P1103R3] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++20では、ヘッダーファイル・ソースファイルに代わる新たなファイル分割の仕組みとしてモジュールが導入された。 diff --git a/lang/cpp20/more_constexpr_containers.md b/lang/cpp20/more_constexpr_containers.md index 1f0d0d409a..b8d3fafa98 100644 --- a/lang/cpp20/more_constexpr_containers.md +++ b/lang/cpp20/more_constexpr_containers.md @@ -1,13 +1,13 @@ # 可変サイズをもつコンテナのconstexpr化 [P0784R7] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp20/nested_inline_mamespaces.md b/lang/cpp20/nested_inline_mamespaces.md index 3a18da4721..a7afbfdcf6 100644 --- a/lang/cpp20/nested_inline_mamespaces.md +++ b/lang/cpp20/nested_inline_mamespaces.md @@ -1,13 +1,13 @@ # 入れ子名前空間定義でのインライン名前空間 [P1094R2] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++17で、入れ子の名前空間を`namespace ns1::ns2::ns3 {}`のように簡易的に定義できるようになったが、インライン名前空間の指定はできなかった。 diff --git a/lang/cpp20/nodiscard_for_constructors.md b/lang/cpp20/nodiscard_for_constructors.md index 7cf4e088f2..85ba40bd05 100644 --- a/lang/cpp20/nodiscard_for_constructors.md +++ b/lang/cpp20/nodiscard_for_constructors.md @@ -1,13 +1,13 @@ # [[nodiscard]]をコンストラクタのオーバーロードごとに付加できるようにする * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 戻り値が使用されない場合に警告を出力させる[`[[nodiscard]]`属性](/lang/cpp17/nodiscard.md)を、コンストラクタのオーバーロードに付加できるようにする。 diff --git a/lang/cpp20/nodiscard_should_have_a_reason.md b/lang/cpp20/nodiscard_should_have_a_reason.md index 9d061c9fbd..e9d845f475 100644 --- a/lang/cpp20/nodiscard_should_have_a_reason.md +++ b/lang/cpp20/nodiscard_should_have_a_reason.md @@ -1,13 +1,13 @@ # [[nodiscard]]属性に理由となる文字列を付加できるようにする [P1301R4] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 戻り値が使用されない場合に警告を出力させる[`[[nodiscard]]`属性](/lang/cpp17/nodiscard.md)に、戻り値を無視してはならない理由を文字列リテラルとして指定できるようにする。 diff --git a/lang/cpp20/permit_conversions_to_arrays_of_unknown_bound.md b/lang/cpp20/permit_conversions_to_arrays_of_unknown_bound.md index 5954a8f861..1bdd5244ed 100644 --- a/lang/cpp20/permit_conversions_to_arrays_of_unknown_bound.md +++ b/lang/cpp20/permit_conversions_to_arrays_of_unknown_bound.md @@ -2,13 +2,13 @@ * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp20/permitting_trivial_default_initialization_in_constexpr_contexts.md b/lang/cpp20/permitting_trivial_default_initialization_in_constexpr_contexts.md index bdf68c4833..d3567af8a8 100644 --- a/lang/cpp20/permitting_trivial_default_initialization_in_constexpr_contexts.md +++ b/lang/cpp20/permitting_trivial_default_initialization_in_constexpr_contexts.md @@ -1,13 +1,13 @@ # constexpr関数内でのトリビアルなデフォルト初期化を許可 [P1331R2] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp20/predefined_macros.md b/lang/cpp20/predefined_macros.md index f0b0c6bf24..e1ba995986 100644 --- a/lang/cpp20/predefined_macros.md +++ b/lang/cpp20/predefined_macros.md @@ -1,13 +1,13 @@ # 更新された定義済みマクロ * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp20/prohibit_aggregates_with_user-declared_constructors.md b/lang/cpp20/prohibit_aggregates_with_user-declared_constructors.md index 0b8756e49c..dad12cf5dc 100644 --- a/lang/cpp20/prohibit_aggregates_with_user-declared_constructors.md +++ b/lang/cpp20/prohibit_aggregates_with_user-declared_constructors.md @@ -1,13 +1,13 @@ # ユーザー宣言したコンストラクタを持つクラスの集成体初期化を禁止 [P1008R1] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 ユーザー宣言されたコンストラクタをもつクラスを、集成体初期化によってコンストラクタを回避してオブジェクト構築できてしまっていた技法を禁止する。 diff --git a/lang/cpp20/range-based_for_statements_with_initializer.md b/lang/cpp20/range-based_for_statements_with_initializer.md index 8265768703..a717559109 100644 --- a/lang/cpp20/range-based_for_statements_with_initializer.md +++ b/lang/cpp20/range-based_for_statements_with_initializer.md @@ -1,13 +1,13 @@ # 初期化式をともなう範囲for文 [P0614R1] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 if文、switch文、for文と同様に、範囲for文でもそのスコープで使用する変数の初期化ができるよう構文を追加する。 diff --git a/lang/cpp20/reference_capture_of_structured_bindings.md b/lang/cpp20/reference_capture_of_structured_bindings.md index 58673dec13..0606597210 100644 --- a/lang/cpp20/reference_capture_of_structured_bindings.md +++ b/lang/cpp20/reference_capture_of_structured_bindings.md @@ -1,13 +1,13 @@ # 構造化束縛した変数の参照キャプチャを許可 [P1381R1] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 構造化束縛した変数はラムダ式で参照キャプチャできない規定となっていたが、これを許可する。ただし、ビットフィールドを構造化束縛した変数は参照キャプチャできない。 diff --git a/lang/cpp20/relaxing_the_range_for_loop_customization_point_finding_rules.md b/lang/cpp20/relaxing_the_range_for_loop_customization_point_finding_rules.md index a9b5ceb34a..f7af4f4bc3 100644 --- a/lang/cpp20/relaxing_the_range_for_loop_customization_point_finding_rules.md +++ b/lang/cpp20/relaxing_the_range_for_loop_customization_point_finding_rules.md @@ -1,13 +1,13 @@ # 範囲for文がカスタマイゼーションポイントを見つけるルールを緩和 [P0962R1] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++17までは、範囲for文に指定するシーケンスの型が`begin`/`end`メンバのどちらかでも持っていれば`begin()`/`end()`メンバ関数を使用し、どちらも持っていなければADLで非メンバ関数の`begin()`/`end()`を探索する仕様となっていた。 diff --git a/lang/cpp20/relaxing_the_structured_bindings_customization_point_finding_rules.md b/lang/cpp20/relaxing_the_structured_bindings_customization_point_finding_rules.md index 3420cd9ca6..62c18ce2ac 100644 --- a/lang/cpp20/relaxing_the_structured_bindings_customization_point_finding_rules.md +++ b/lang/cpp20/relaxing_the_structured_bindings_customization_point_finding_rules.md @@ -1,13 +1,13 @@ # 構造化束縛がカスタマイゼーションポイントを見つけるルールを緩和 [P0961R1] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++17までは、構造化束縛する対象の型が`get()`メンバ関数を持っていればその関数でメンバ変数を抽出し、持っていなければ非メンバ関数の`get()`関数で抽出する仕様となっていた。 diff --git a/lang/cpp20/remove_deprecated_nothrow_exception_specification.md b/lang/cpp20/remove_deprecated_nothrow_exception_specification.md index 58fb85bbc6..bab8f2cf8f 100644 --- a/lang/cpp20/remove_deprecated_nothrow_exception_specification.md +++ b/lang/cpp20/remove_deprecated_nothrow_exception_specification.md @@ -1,13 +1,13 @@ # throw()による例外送出しない指定を削除 * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++11で例外送出しないことを指定する[`noexcept`](/lang/cpp11/noexcept.md)が追加されたことによって古い例外仕様は非推奨化の後に削除されたが、なにも例外送出しないことを表す`throw()`指定は`noexcept`と同じ意味になるよう仕様が変更されて非推奨機能として維持されていた。 diff --git a/lang/cpp20/reserving_attribute_namespaces_for_future_use.md b/lang/cpp20/reserving_attribute_namespaces_for_future_use.md index 7f32e16ed9..652bab43c1 100644 --- a/lang/cpp20/reserving_attribute_namespaces_for_future_use.md +++ b/lang/cpp20/reserving_attribute_namespaces_for_future_use.md @@ -1,13 +1,13 @@ # 属性の名前空間を予約 * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 将来的に標準で定義する属性のために、以下の名前空間の属性を予約する: diff --git a/lang/cpp20/resolving_const_mismatch_with_defaulted_copy_constructor.md b/lang/cpp20/resolving_const_mismatch_with_defaulted_copy_constructor.md index b2becb2f5b..558609396a 100644 --- a/lang/cpp20/resolving_const_mismatch_with_defaulted_copy_constructor.md +++ b/lang/cpp20/resolving_const_mismatch_with_defaulted_copy_constructor.md @@ -1,13 +1,13 @@ # デフォルトのコピーコンストラクタと非constなコンストラクタが衝突する問題を修正 [P0641R2] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 C++17までは以下のように、自身の型の非`const`なオブジェクトをとるコンストラクタをもつクラスを定義し、 diff --git a/lang/cpp20/signed_integers_are_twos_complement.md b/lang/cpp20/signed_integers_are_twos_complement.md index cd9a35a4cc..b8f277cf66 100644 --- a/lang/cpp20/signed_integers_are_twos_complement.md +++ b/lang/cpp20/signed_integers_are_twos_complement.md @@ -1,13 +1,13 @@ # 符号付き整数型が2の補数表現であることを規定 [P1236R1] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++20では、符号付き整数型のビット表現を「2の補数 (Two's Complement)」に規定する。 diff --git a/lang/cpp20/simplifying_implicit_lambda_capture.md b/lang/cpp20/simplifying_implicit_lambda_capture.md index 7e73596438..2adf847c89 100644 --- a/lang/cpp20/simplifying_implicit_lambda_capture.md +++ b/lang/cpp20/simplifying_implicit_lambda_capture.md @@ -1,13 +1,13 @@ # 暗黙のラムダキャプチャを簡略化 [P0588R1] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 ここでは、ラムダ式での暗黙のキャプチャについて、以下の問題を解決する: @@ -37,4 +37,4 @@ void f() { - [C++20 構造化束縛を拡張して通常の変数宣言のように使用できるようにする](extending_structured_bindings_to_be_more_like_variable_declarations.md) ## 参照 -- [P0588R1 Simplifying implicit lambda capture](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0588r1.html) +- [P0588R1 Simplifying implicit lambda capture](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0588r1.html) \ No newline at end of file diff --git a/lang/cpp20/try-catch_blocks_in_constexpr_functions.md b/lang/cpp20/try-catch_blocks_in_constexpr_functions.md index 5c99de5984..390f029ff3 100644 --- a/lang/cpp20/try-catch_blocks_in_constexpr_functions.md +++ b/lang/cpp20/try-catch_blocks_in_constexpr_functions.md @@ -1,13 +1,13 @@ # constexpr関数内でのtry-catchブロックを許可 [P1002R1] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++20では、`constexpr`関数内でのtry-catchブロックの使用を許可する。ただし、`throw`式は従来通り許可せず、コンパイルエラーとなる (`throw`式は`constexpr`関数におけるアサーションのような役割)。 diff --git a/lang/cpp20/update_the_reference_to_the_unicode_standard.md b/lang/cpp20/update_the_reference_to_the_unicode_standard.md index 57d751b341..37ea70aefe 100644 --- a/lang/cpp20/update_the_reference_to_the_unicode_standard.md +++ b/lang/cpp20/update_the_reference_to_the_unicode_standard.md @@ -1,13 +1,13 @@ # Unicode標準への参照を更新 * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 Unicode標準 (ISO/IEC 10646) としてこれまで、「ISO/IEC 10646-1:1993, Information technology — Universal Multiple-Octet Coded Character Set (UCS) — Part 1: Architecture and Basic Multilingual Plane」が参照されていた。 diff --git a/lang/cpp20/using_enum.md b/lang/cpp20/using_enum.md index 50f661ffda..f484e57a1b 100644 --- a/lang/cpp20/using_enum.md +++ b/lang/cpp20/using_enum.md @@ -2,13 +2,13 @@ * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp20/va_opt.md b/lang/cpp20/va_opt.md index 1382eff726..5b23670201 100644 --- a/lang/cpp20/va_opt.md +++ b/lang/cpp20/va_opt.md @@ -1,13 +1,13 @@ # 可変引数が空でない場合のトークン置換 [P0306R4] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 新たなプリプロセスマクロ`__VA_OPT__`を追加する。このマクロは、マクロのパラメータとして受け取った可変引数が空でない場合に置換するトークンを指定する機能を持つ。 diff --git a/lang/cpp20/wording_for_lambdas_in_unevaluated_contexts.md b/lang/cpp20/wording_for_lambdas_in_unevaluated_contexts.md index b630e29c57..73d50d05e1 100644 --- a/lang/cpp20/wording_for_lambdas_in_unevaluated_contexts.md +++ b/lang/cpp20/wording_for_lambdas_in_unevaluated_contexts.md @@ -1,13 +1,13 @@ # 評価されない文脈でのラムダ式 [P0315R4] * cpp20[meta cpp] -<-- start lang caution --> + このページはC++20に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md b/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md index 531f80b993..b08bfdd8db 100644 --- a/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md +++ b/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md @@ -1,13 +1,13 @@ # elif/elifdef/elifndefのサポートを追加 [P2334R1] * cpp23[meta cpp] -<-- start lang caution --> + このページはC++23に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 C++23では、以下のプリプロセス時条件式が追加される: diff --git a/lang/cpp23/attributes_on_lambda_expressions.md b/lang/cpp23/attributes_on_lambda_expressions.md index 7bb70ec96a..2f6f162d77 100644 --- a/lang/cpp23/attributes_on_lambda_expressions.md +++ b/lang/cpp23/attributes_on_lambda_expressions.md @@ -1,13 +1,13 @@ # ラムダ式に対する属性 [P2173R1] * cpp23[meta cpp] -<-- start lang caution --> + このページはC++23に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++23では、ラムダ式のいくつかの箇所に属性を指定できる。 diff --git a/lang/cpp23/character_encoding_of_diagnostic_text.md b/lang/cpp23/character_encoding_of_diagnostic_text.md index dec01dca13..31dbb98bdf 100644 --- a/lang/cpp23/character_encoding_of_diagnostic_text.md +++ b/lang/cpp23/character_encoding_of_diagnostic_text.md @@ -1,13 +1,13 @@ # 静的な診断メッセージの文字エンコーディング [P2246R1] * cpp23[meta cpp] -<-- start lang caution --> + このページはC++23に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 C++23では、コンパイル時に診断メッセージを出力させる以下の機能について、ソースコードのエンコーディングが実行環境のエンコーディングで表現できない場合にどうするかの規定を見直す: diff --git a/lang/cpp23/class_template_argument_deduction_from_inherited.md b/lang/cpp23/class_template_argument_deduction_from_inherited.md index 89d13fb607..b6f22acbe7 100644 --- a/lang/cpp23/class_template_argument_deduction_from_inherited.md +++ b/lang/cpp23/class_template_argument_deduction_from_inherited.md @@ -1,13 +1,13 @@ # 継承コンストラクタからのクラステンプレート引数の推論 [P2582R1] * cpp23[meta cpp] -<-- start lang caution --> + このページはC++23に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++23では、派生クラスで定義した継承コンストラクタからでも、クラステンプレート引数を推論できるようになる。 diff --git a/lang/cpp23/consistent_character_literal_encoding.md b/lang/cpp23/consistent_character_literal_encoding.md index 34537e3bd9..716d42ac26 100644 --- a/lang/cpp23/consistent_character_literal_encoding.md +++ b/lang/cpp23/consistent_character_literal_encoding.md @@ -1,13 +1,13 @@ # 文字リテラルエンコーディングを一貫させる [P2316R2] * cpp23[meta cpp] -<-- start lang caution --> + このページはC++23に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 C++20までは、以下のような、プリプロセッサ上での文字リテラルの比較と、if文での文字リテラルの比較が同じであるという保証がなかった。 diff --git a/lang/cpp23/consteval_needs_to_propagate_up.md b/lang/cpp23/consteval_needs_to_propagate_up.md index a0ba126e38..135fdb0377 100644 --- a/lang/cpp23/consteval_needs_to_propagate_up.md +++ b/lang/cpp23/consteval_needs_to_propagate_up.md @@ -1,13 +1,13 @@ # constexpr関数内でconsteval関数を呼び出せない問題を軽減 [P2564R3] * cpp23[meta cpp] -<-- start lang caution --> + このページはC++23に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++23では、`consteval`呼び出しを含む`constexpr`関数を、条件付きで`consteval`関数と見なすようになる。そうすることで、定数式の文脈での`consteval`関数の使用がよりかんたんになる。 diff --git a/lang/cpp23/delimited_escape_sequences.md b/lang/cpp23/delimited_escape_sequences.md index ca351ab411..667cb89c44 100644 --- a/lang/cpp23/delimited_escape_sequences.md +++ b/lang/cpp23/delimited_escape_sequences.md @@ -1,13 +1,13 @@ # エスケープシーケンスの区切り [P2290R3] * cpp23[meta cpp] -<-- start lang caution --> + このページはC++23に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++23では、文字列リテラル中に記述するエスケープシーケンスとユニバーサルキャラクタ名の範囲を明確にするための波カッコ (`{}`) で囲む構文が追加される。 diff --git a/lang/cpp23/down_with_lambda_parens.md b/lang/cpp23/down_with_lambda_parens.md index 557c4a58c6..d34ff34e32 100644 --- a/lang/cpp23/down_with_lambda_parens.md +++ b/lang/cpp23/down_with_lambda_parens.md @@ -1,13 +1,13 @@ # ラムダ式で()を省略できる条件を緩和 [P1102R2] * cpp23[meta cpp] -<-- start lang caution --> + このページはC++23に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++23では、ラムダ式のパラメータリストが空であれば、以下の要素を含む場合であってもパラメータリストの `()` を省略できる。 diff --git a/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md b/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md index 6fe9cd4b73..524a3aef6d 100644 --- a/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md +++ b/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md @@ -1,13 +1,13 @@ # 初期化文での型の別名宣言を許可 [P2360R0] * cpp23[meta cpp] -<-- start lang caution --> + このページはC++23に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 `if`文、`switch`文、範囲`for`文で初期化文を指定できるが、C++20までその初期化文では`typedef`による型の別名定義はできたが、`using`による型の別名定義はできなかった。 diff --git a/lang/cpp23/feature_test_macros.md b/lang/cpp23/feature_test_macros.md index a0f9877dc4..e1dfe85931 100644 --- a/lang/cpp23/feature_test_macros.md +++ b/lang/cpp23/feature_test_macros.md @@ -1,13 +1,13 @@ # 機能テストマクロ * cpp23[meta cpp] -<-- start lang caution --> + このページはC++23に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp23/generalized_wording_for_partial_specializations.md b/lang/cpp23/generalized_wording_for_partial_specializations.md index 7feeb55a3f..2c0a54ae72 100644 --- a/lang/cpp23/generalized_wording_for_partial_specializations.md +++ b/lang/cpp23/generalized_wording_for_partial_specializations.md @@ -1,13 +1,13 @@ # 変数テンプレートの部分特殊化を許可 [P2096R2] * cpp23[meta cpp] -<-- start lang caution --> + このページはC++23に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 変数テンプレートの仕様として、部分特殊化の許可を意図したような仕様はあったが、部分特殊化の多くの仕様はクラステンプレートのみを対象にしていた。 diff --git a/lang/cpp23/if_consteval.md b/lang/cpp23/if_consteval.md index 15b1d65a83..2a4dde12c8 100644 --- a/lang/cpp23/if_consteval.md +++ b/lang/cpp23/if_consteval.md @@ -1,13 +1,13 @@ # if consteval [P1938R3] * cpp23[meta cpp] -<-- start lang caution --> + このページはC++23に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++23では、`constexpr`関数がコンパイル時に呼ばれたかを判定するための構文として、`if consteval`を導入する。これは「consteval if文」と呼ばれる。 diff --git a/lang/cpp23/labels_at_the_end_of_compound_statements.md b/lang/cpp23/labels_at_the_end_of_compound_statements.md index 88ddf35bcc..fcad6a6af4 100644 --- a/lang/cpp23/labels_at_the_end_of_compound_statements.md +++ b/lang/cpp23/labels_at_the_end_of_compound_statements.md @@ -1,13 +1,13 @@ # 複合文の末尾へのラベルを許可 [P2324R2] * cpp23[meta cpp] -<-- start lang caution --> + このページはC++23に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 C言語 (C23) との互換性のため、C言語で新しく許可された複合文の末尾 (関数末尾など`{}`ブロックの末尾) へのgotoラベルを許可する。 diff --git a/lang/cpp23/lifetime_extension_in_range_based_for_loop.md b/lang/cpp23/lifetime_extension_in_range_based_for_loop.md index c72b35aaf5..e3ec776887 100644 --- a/lang/cpp23/lifetime_extension_in_range_based_for_loop.md +++ b/lang/cpp23/lifetime_extension_in_range_based_for_loop.md @@ -2,13 +2,13 @@ * cpp23[meta cpp] -<-- start lang caution --> + このページはC++23に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 仕様 diff --git a/lang/cpp23/literal_suffix_for_signed_size_t.md b/lang/cpp23/literal_suffix_for_signed_size_t.md index 0c9212fd2b..e61c985643 100644 --- a/lang/cpp23/literal_suffix_for_signed_size_t.md +++ b/lang/cpp23/literal_suffix_for_signed_size_t.md @@ -1,13 +1,13 @@ # (符号付き)size_tリテラルのためのサフィックス [P0330R8] * cpp23[meta cpp] -<-- start lang caution --> + このページはC++23に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++23では、符号なし整数型[`size_t`](/reference/cstddef/size_t.md)に対応する符号付き整数型を表すリテラルの`z`および`Z`サフィックスを追加する。符号なしを表す`u`および`U`サフィックスをともに使用することで[`size_t`](/reference/cstddef/size_t.md)型のリテラルを記述できる。 diff --git a/lang/cpp23/make_declaration_order_layout_mandated.md b/lang/cpp23/make_declaration_order_layout_mandated.md index 553fbfc235..22d80f2604 100644 --- a/lang/cpp23/make_declaration_order_layout_mandated.md +++ b/lang/cpp23/make_declaration_order_layout_mandated.md @@ -1,13 +1,13 @@ # アクセス制御の異なるメンバ変数のレイアウトを宣言順に規定 [P1847R4] * cpp23[meta cpp] -<-- start lang caution --> + このページはC++23に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 以下のようなアクセス制御の異なるメンバ変数のメモリレイアウトは、実装に対して自由に並び替えてよい、という規定になっていたが、これを宣言順に規定する。 diff --git a/lang/cpp23/meaningful_exports.md b/lang/cpp23/meaningful_exports.md index e31e14bf87..3313123f35 100644 --- a/lang/cpp23/meaningful_exports.md +++ b/lang/cpp23/meaningful_exports.md @@ -1,13 +1,13 @@ # 無意味なexport宣言を禁止する [P2615R1] * cpp23[meta cpp] -<-- start lang caution --> + このページはC++23に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++20時点でのモジュール定義では、いくつかの不必要なexport宣言ができてしまっていた。 diff --git a/lang/cpp23/mixed_string_literal_concatenation.md b/lang/cpp23/mixed_string_literal_concatenation.md index ce4b343c46..b647b464cf 100644 --- a/lang/cpp23/mixed_string_literal_concatenation.md +++ b/lang/cpp23/mixed_string_literal_concatenation.md @@ -1,13 +1,13 @@ # 異なる文字エンコーディングをもつ文字列リテラルの連結を不適格とする [P2201R1] * cpp23[meta cpp] -<-- start lang caution --> + このページはC++23に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 C++20までは、実装定義の動作として`L""`、`u8""`、`u""`、`U""`のようなエンコーディングが混在する文字列リテラルの連結を条件付きで許可していたが、これを禁止とする。 diff --git a/lang/cpp23/multidimensional_subscript_operator.md b/lang/cpp23/multidimensional_subscript_operator.md index ddecaa7769..ff6bf8e98f 100644 --- a/lang/cpp23/multidimensional_subscript_operator.md +++ b/lang/cpp23/multidimensional_subscript_operator.md @@ -1,13 +1,13 @@ # 添字演算子の多次元サポート [P2128R6] * cpp23[meta cpp] -<-- start lang caution --> + このページはC++23に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++23では、多次元配列クラスを定義するために必要となる、添字演算子のオーバーロードを定義する際の複数引数を許可する。 diff --git a/lang/cpp23/named_universal_character_escapes.md b/lang/cpp23/named_universal_character_escapes.md index facbcc229a..0efb58be20 100644 --- a/lang/cpp23/named_universal_character_escapes.md +++ b/lang/cpp23/named_universal_character_escapes.md @@ -1,13 +1,13 @@ # 名前付きユニバーサルキャラクタ名 [P2071R2] * cpp23[meta cpp] -<-- start lang caution --> + このページはC++23に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 これまで、Unicodeのユニバーサルキャラクタ名を指定するためには、`u8"\u0100"`のように`\u`または`\U`に続いてコードポイントを記述していた。 diff --git a/lang/cpp23/narrowing_contextual_conversions_to_bool.md b/lang/cpp23/narrowing_contextual_conversions_to_bool.md index 8d383a5473..b3ce704c2b 100644 --- a/lang/cpp23/narrowing_contextual_conversions_to_bool.md +++ b/lang/cpp23/narrowing_contextual_conversions_to_bool.md @@ -1,13 +1,13 @@ # 定数式の文脈でのboolへの縮小変換を許可 [P1401R5] * cpp23[meta cpp] -<-- start lang caution --> + このページはC++23に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++23では、以下の定数式文脈での`bool`への縮小変換を許可する: diff --git a/lang/cpp23/non_literal_variables_in_constexpr_functions.md b/lang/cpp23/non_literal_variables_in_constexpr_functions.md index 28e088557a..94c9498636 100644 --- a/lang/cpp23/non_literal_variables_in_constexpr_functions.md +++ b/lang/cpp23/non_literal_variables_in_constexpr_functions.md @@ -1,13 +1,13 @@ # 定数式内での非リテラル変数、静的変数・スレッドローカル変数およびgotoとラベルの存在を許可する [P2242R3] * cpp23[meta cpp] -<-- start lang caution --> + このページはC++23に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md b/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md index 696f276a04..a1bacee1bd 100644 --- a/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md +++ b/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md @@ -1,13 +1,13 @@ # constexpr関数内でのstatic constexpr変数を許可 [P2647R1] * cpp23[meta cpp] -<-- start lang caution --> + このページはC++23に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++23からは、`constexpr`関数内で定数を定義するために、`static constexpr`変数を使用できるようになる。 diff --git a/lang/cpp23/portable_assumptions.md b/lang/cpp23/portable_assumptions.md index 32316f200c..5e011eec58 100644 --- a/lang/cpp23/portable_assumptions.md +++ b/lang/cpp23/portable_assumptions.md @@ -1,13 +1,13 @@ # コード内容の仮定をコンパイラに伝える`assume`属性 [P1774R8] * cpp23[meta cpp] -<-- start lang caution --> + このページはC++23に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 あるコード地点において実行時に満たすべき仮定(assumption)を、C++コンパイラへ最適化ヒントとして与える属性である。 diff --git a/lang/cpp23/predefined_macros.md b/lang/cpp23/predefined_macros.md index 6aa42e5d39..9dbe36de1a 100644 --- a/lang/cpp23/predefined_macros.md +++ b/lang/cpp23/predefined_macros.md @@ -1,13 +1,13 @@ # 更新された定義済みマクロ * cpp23[meta cpp] -<-- start lang caution --> + このページはC++23に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp23/relaxing_some_constexpr_restrictions.md b/lang/cpp23/relaxing_some_constexpr_restrictions.md index c473f793c5..28be60df05 100644 --- a/lang/cpp23/relaxing_some_constexpr_restrictions.md +++ b/lang/cpp23/relaxing_some_constexpr_restrictions.md @@ -1,13 +1,13 @@ # constexpr関数が定数実行できない場合でも適格とする [P2448R2] * cpp23[meta cpp] -<-- start lang caution --> + このページはC++23に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md b/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md index 50fcf7747e..bd96605421 100644 --- a/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md +++ b/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md @@ -1,13 +1,13 @@ # 1ワイド文字に収まらないワイド文字リテラルを禁止する [P2362R3] * cpp23[meta cpp] -<-- start lang caution --> + このページはC++23に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 C++23では、ワイド文字リテラルとして、以下を禁止する: @@ -31,4 +31,4 @@ wchar_t c = 'é́'; // C++20:OK, C++23:NG \u0065\u0301 ## 参照 -- [P2362R3 Remove non-encodable wide character literals and multicharacter wide character literals](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2362r3.pdf) +- [P2362R3 Remove non-encodable wide character literals and multicharacter wide character literals](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2362r3.pdf) \ No newline at end of file diff --git a/lang/cpp23/simpler_implicit_move.md b/lang/cpp23/simpler_implicit_move.md index 2d8fa5284d..b1359bab92 100644 --- a/lang/cpp23/simpler_implicit_move.md +++ b/lang/cpp23/simpler_implicit_move.md @@ -1,13 +1,13 @@ # 暗黙的なムーブを簡略化 [P2266R3] * cpp23[meta cpp] -<-- start lang caution --> + このページはC++23に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 diff --git a/lang/cpp23/static_operator.md b/lang/cpp23/static_operator.md index eb8a2b8162..90d62ff87d 100644 --- a/lang/cpp23/static_operator.md +++ b/lang/cpp23/static_operator.md @@ -1,13 +1,13 @@ # thisポインタをもつ必要のない演算子をstaticとして宣言できるようにする [P1169R4] * cpp23[meta cpp] -<-- start lang caution --> + このページはC++23に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 以下の演算子が`this`ポインタを必要としない (状態をもたない) 場合、演算子オーバーロードを`static`として定義できる: diff --git a/lang/cpp23/support_for_utf8_as_a_portable_source_file_encoding.md b/lang/cpp23/support_for_utf8_as_a_portable_source_file_encoding.md index 1f85393142..5ecc79c7bd 100644 --- a/lang/cpp23/support_for_utf8_as_a_portable_source_file_encoding.md +++ b/lang/cpp23/support_for_utf8_as_a_portable_source_file_encoding.md @@ -1,13 +1,13 @@ # 汎用的なソースコードのエンコーディングとしてUTF-8をサポート [P2295R6] * cpp23[meta cpp] -<-- start lang caution --> + このページはC++23に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 C++20まで、ソースコードの文字集合は実装定義だったが、その仕様では移植性に問題があった。C++23からは、すべてのコンパイラはUTF-8文字コードのソースコードをサポートしなければならないことが規定される。 diff --git a/lang/cpp23/trimming_whitespaces_before_line_splicing.md b/lang/cpp23/trimming_whitespaces_before_line_splicing.md index 690e28500a..1901ad5e6e 100644 --- a/lang/cpp23/trimming_whitespaces_before_line_splicing.md +++ b/lang/cpp23/trimming_whitespaces_before_line_splicing.md @@ -1,13 +1,13 @@ # 行末スペースを無視するよう規定 [P2223R2] * cpp23[meta cpp] -<-- start lang caution --> + このページはC++23に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 `\` (バックスラッシュ) 後の行末スペースを無視するよう規定する。 diff --git a/lang/cpp23/update_normative_reference_to_posix.md b/lang/cpp23/update_normative_reference_to_posix.md index b452b2a0d2..a37bbae126 100644 --- a/lang/cpp23/update_normative_reference_to_posix.md +++ b/lang/cpp23/update_normative_reference_to_posix.md @@ -1,13 +1,13 @@ # 参照するPOSIX規格を更新 * cpp23[meta cpp] -<-- start lang caution --> + このページはC++23に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 C++20まではPOSIX規格としてISO/IEC 9945:2003 (別名POSIX.1-2001 aka The Single UNIX Specification, version 3) を参照していた。 diff --git a/lang/cpp23/warning.md b/lang/cpp23/warning.md index 4fd054a686..4575a076d8 100644 --- a/lang/cpp23/warning.md +++ b/lang/cpp23/warning.md @@ -1,13 +1,13 @@ # #warningのサポートを追加 [P2437R1] * cpp23[meta cpp] -<-- start lang caution --> + このページはC++23に採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 -<-- last lang caution --> + ## 概要 C++23では、プリプロセッサ命令として、特定のコードに到達した際に警告メッセージを出力する `#warning` をサポートする。 diff --git a/lang/cpp26/user-generated_static_assert_messages.md b/lang/cpp26/user-generated_static_assert_messages.md index 53a361bbf3..76eb694c38 100644 --- a/lang/cpp26/user-generated_static_assert_messages.md +++ b/lang/cpp26/user-generated_static_assert_messages.md @@ -1,13 +1,13 @@ # static_assertの診断メッセージにユーザーが生成した文字列の指定を許可 [P2741R3] * cpp26[meta cpp] -<-- start lang caution --> + このページはC++26に採用される見込みの言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 C++26では、[`static_assert`](/lang/cpp11/static_assert.md)に指定する表明失敗時の診断メッセージとして、文字列リテラルだけでなくユーザー定義型の文字列オブジェクトも指定できるようになる。 diff --git a/start_editing/lang_template_page.md b/start_editing/lang_template_page.md index 20e089f9f2..0e8d24234d 100644 --- a/start_editing/lang_template_page.md +++ b/start_editing/lang_template_page.md @@ -32,24 +32,24 @@ (確定した言語バージョンに対する注意事項は以下) -<-- start lang caution --> + このページはC++XXに採用された言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + (確定前の言語バージョンに対する注意事項は以下) -<-- start lang caution --> + このページはC++26に採用される見込みの言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 -<-- last lang caution --> + ## 概要 (ここには、言語機能の概要を記載します。) From 641d6a7b3bf0cd6a0a80d64dc209a0c0ba244bbd Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 8 Jul 2024 16:33:21 +0900 Subject: [PATCH 1026/3948] =?UTF-8?q?=E8=A8=80=E8=AA=9E=E6=A9=9F=E8=83=BD?= =?UTF-8?q?=20:=20=E9=96=A2=E9=80=A3=E9=A0=85=E7=9B=AE=E3=81=B8=E3=81=AE?= =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=83=9F=E3=82=B9=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20#1292?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/script/update_lang_caution.py | 4 ++-- lang/cpp11/alias_templates.md | 2 +- lang/cpp11/alignas.md | 2 +- lang/cpp11/alignof.md | 2 +- lang/cpp11/attributes.md | 2 +- lang/cpp11/auto.md | 2 +- lang/cpp11/c99_predefined_macros.md | 2 +- lang/cpp11/char16_32.md | 2 +- lang/cpp11/constexpr.md | 2 +- lang/cpp11/decltype.md | 2 +- lang/cpp11/defaulted_and_deleted_functions.md | 2 +- lang/cpp11/delegating_constructors.md | 2 +- lang/cpp11/dependent_name_specifier_outside_of_templates.md | 2 +- lang/cpp11/deprecation_of_the_register_keyword.md | 2 +- lang/cpp11/earlier_declarated_array_bounds.md | 2 +- lang/cpp11/explicit_conversion_operator.md | 2 +- lang/cpp11/extend_friend_targets.md | 2 +- ...f_to_apply_to_non_static_data_members_without_an_object.md | 2 +- lang/cpp11/extern_template.md | 2 +- lang/cpp11/feature_test_macros.md | 2 +- lang/cpp11/func.md | 2 +- lang/cpp11/global_scope_syntax_in_nested_name_specifier.md | 2 +- lang/cpp11/inheriting_constructors.md | 2 +- lang/cpp11/initializer_lists.md | 2 +- lang/cpp11/inline_namespaces.md | 2 +- lang/cpp11/lambda_expressions.md | 2 +- lang/cpp11/local_and_unnamed_type_as_template_arguments.md | 2 +- lang/cpp11/long_long_type.md | 2 +- lang/cpp11/noexcept.md | 2 +- lang/cpp11/non_static_data_member_initializers.md | 2 +- lang/cpp11/nullptr.md | 2 +- lang/cpp11/override_final.md | 2 +- lang/cpp11/pragma_operator.md | 2 +- lang/cpp11/predefined_macros.md | 2 +- lang/cpp11/range_based_for.md | 2 +- lang/cpp11/raw_string_literals.md | 2 +- lang/cpp11/recursive_template_limit.md | 2 +- lang/cpp11/ref_qualifier_for_this.md | 2 +- lang/cpp11/reference_collapsing.md | 2 +- lang/cpp11/remove_export_templates.md | 2 +- lang/cpp11/reserved_namespaces_for_posix.md | 2 +- lang/cpp11/result_of_integer_division_and_modulo.md | 2 +- lang/cpp11/right_angle_brackets.md | 2 +- lang/cpp11/rvalue_ref_and_move_semantics.md | 2 +- lang/cpp11/scoped_enum.md | 2 +- lang/cpp11/sfinae_expressions.md | 2 +- lang/cpp11/static_assert.md | 2 +- lang/cpp11/static_initialization_thread_safely.md | 2 +- lang/cpp11/string_literal_concatenation.md | 2 +- lang/cpp11/thread_local_storage.md | 2 +- lang/cpp11/trailing_comma_following_enumerator_list.md | 2 +- lang/cpp11/trailing_return_types.md | 2 +- lang/cpp11/uniform_initialization.md | 2 +- lang/cpp11/unrestricted_unions.md | 2 +- lang/cpp11/user_defined_literals.md | 2 +- lang/cpp11/utf8_string_literals.md | 2 +- lang/cpp11/variadic_macros.md | 2 +- lang/cpp11/variadic_templates.md | 2 +- lang/cpp14/binary_literals.md | 2 +- lang/cpp14/brace_elision_in_array_temporary_initialization.md | 2 +- lang/cpp14/clarifying_memory_allocation.md | 2 +- lang/cpp14/decltype_auto.md | 2 +- lang/cpp14/deprecated_attr.md | 2 +- lang/cpp14/digit_separators.md | 4 ++-- lang/cpp14/feature_test_macros.md | 2 +- lang/cpp14/generic_lambdas.md | 2 +- lang/cpp14/initialize_capture.md | 2 +- lang/cpp14/member_initializers_and_aggregates.md | 2 +- lang/cpp14/no_whitespace_literal_operators.md | 2 +- lang/cpp14/nontype_template_parameters_of_type_nullptr_t.md | 2 +- lang/cpp14/placeholder_type_in_trailing_return_type.md | 4 ++-- lang/cpp14/predefined_macros.md | 2 +- lang/cpp14/relaxing_constraints_on_constexpr.md | 2 +- lang/cpp14/return_type_deduction_for_normal_functions.md | 2 +- lang/cpp14/sized_deallocation.md | 2 +- lang/cpp14/variable_templates.md | 2 +- ...constant_evaluation_for_all_non-type_template_arguments.md | 2 +- .../allow_default_template_arguments_of_variable_templates.md | 2 +- lang/cpp17/allow_typename_in_a_template_template_parameter.md | 2 +- lang/cpp17/attributes_for_namespaces_and_enumerators.md | 2 +- lang/cpp17/constexpr_lambda.md | 2 +- lang/cpp17/construction_enum_class_values.md | 2 +- lang/cpp17/declaring_non-type_template_arguments_with_auto.md | 2 +- lang/cpp17/dynamic_memory_allocation_for_over-aligned_data.md | 2 +- lang/cpp17/exception_spec_be_part_of_the_type_system.md | 2 +- lang/cpp17/expression_evaluation_order.md | 2 +- lang/cpp17/extending_static_assert.md | 2 +- lang/cpp17/extension_to_aggregate_initialization.md | 2 +- lang/cpp17/fallthrough.md | 2 +- lang/cpp17/feature_test_macros.md | 2 +- lang/cpp17/folding_expressions.md | 2 +- lang/cpp17/generalizing_the_range-based_for_loop.md | 2 +- lang/cpp17/guaranteed_copy_elision.md | 2 +- lang/cpp17/has_include.md | 2 +- lang/cpp17/hexadecimal_floating_literals.md | 2 +- lang/cpp17/if_constexpr.md | 2 +- lang/cpp17/inline_variables.md | 2 +- lang/cpp17/lambda_capture_of_this_by_value.md | 2 +- lang/cpp17/lambda_to_noexcept_function_pointer.md | 2 +- lang/cpp17/maybe_unused.md | 2 +- lang/cpp17/nested_namespace.md | 2 +- .../new_rules_for_auto_deduction_from_braced-init-list.md | 2 +- lang/cpp17/nodiscard.md | 2 +- lang/cpp17/non_standard_attributes.md | 2 +- lang/cpp17/pack_expansions_in_using.md | 2 +- lang/cpp17/predefined_macros.md | 2 +- lang/cpp17/remove_deprecated_exception_specifications.md | 2 +- lang/cpp17/remove_deprecated_increment_of_bool.md | 2 +- lang/cpp17/remove_deprecated_use_of_the_register_keyword.md | 2 +- lang/cpp17/removing_trigraphs.md | 2 +- ...placement_of_class_objects_containing_reference_members.md | 2 +- lang/cpp17/selection_statements_with_initializer.md | 2 +- lang/cpp17/structured_bindings.md | 2 +- lang/cpp17/type_deduction_for_class_templates.md | 2 +- lang/cpp17/using_attribute_namespaces.md | 2 +- lang/cpp17/utf8_character_literals.md | 2 +- lang/cpp20/access_checking_on_specializations.md | 2 +- lang/cpp20/adl_and_function_templates_that_are_not_visible.md | 2 +- ...ializing_aggregates_from_a_parenthesized_list_of_values.md | 2 +- lang/cpp20/allow_lambda_capture_equal_this.md | 2 +- lang/cpp20/allow_pack_expansion_in_lambda_init_capture.md | 2 +- lang/cpp20/allow_structured_bindings_to_accessible_members.md | 2 +- .../allow_virtual_function_calls_in_constant_expressions.md | 2 +- ...dynamic_cast_polymorphic_typeid_in_constant_expressions.md | 2 +- lang/cpp20/array_size_deduction_in_new-expressions.md | 2 +- .../changing_the_active_member_of_a_union_inside_constexpr.md | 2 +- lang/cpp20/char8_t.md | 2 +- lang/cpp20/checking_for_abstract_class_types.md | 2 +- .../cpp20/class_template_argument_deduction_for_aggregates.md | 2 +- .../class_template_argument_deduction_for_alias_templates.md | 2 +- lang/cpp20/class_types_in_non-type_template_parameters.md | 2 +- lang/cpp20/concepts.md | 2 +- lang/cpp20/consistent_comparison.md | 2 +- lang/cpp20/constinit.md | 2 +- ...ing_from_pointer_to_bool_should_be_considered_narrowing.md | 2 +- lang/cpp20/coroutines.md | 2 +- .../default_constructible_and_assignable_stateless_lambdas.md | 2 +- lang/cpp20/default_member_initializers_for_bit_fields.md | 2 +- lang/cpp20/deprecate_implicit_capture_of_this_via_defcopy.md | 2 +- lang/cpp20/deprecate_pod.md | 2 +- ..._uses_of_the_comma_operator_in_subscripting_expressions.md | 2 +- lang/cpp20/deprecating_volatile.md | 2 +- lang/cpp20/designated_initialization.md | 2 +- lang/cpp20/down_with_typename.md | 2 +- .../efficient_sized_delete_for_variable_sized_classes.md | 2 +- ...ting_unevaluated_inline-assembly_in_constexpr_functions.md | 2 +- lang/cpp20/explicit_bool.md | 2 +- ...ructured_bindings_to_be_more_like_variable_declarations.md | 2 +- lang/cpp20/familiar_template_syntax_for_generic_lambdas.md | 2 +- lang/cpp20/feature_test_macros.md | 2 +- lang/cpp20/fixing_const_qualified_pointers_to_members.md | 2 +- lang/cpp20/function_templates_with_auto_parameters.md | 2 +- lang/cpp20/immediate_functions.md | 2 +- ...t_creation_of_objects_for_low-level_object_manipulation.md | 2 +- lang/cpp20/language_support_for_empty_objects.md | 2 +- lang/cpp20/less_eager_instantiation_of_constexpr_functions.md | 2 +- lang/cpp20/likely_and_unlikely_attributes.md | 2 +- .../cpp20/make_char16t_char32t_string_literals_be_utf16_32.md | 2 +- lang/cpp20/modules.md | 2 +- lang/cpp20/more_constexpr_containers.md | 2 +- lang/cpp20/nested_inline_mamespaces.md | 2 +- lang/cpp20/nodiscard_for_constructors.md | 2 +- lang/cpp20/nodiscard_should_have_a_reason.md | 2 +- lang/cpp20/permit_conversions_to_arrays_of_unknown_bound.md | 2 +- ...ng_trivial_default_initialization_in_constexpr_contexts.md | 2 +- lang/cpp20/predefined_macros.md | 2 +- .../prohibit_aggregates_with_user-declared_constructors.md | 2 +- lang/cpp20/range-based_for_statements_with_initializer.md | 2 +- lang/cpp20/reference_capture_of_structured_bindings.md | 2 +- ...ng_the_range_for_loop_customization_point_finding_rules.md | 2 +- ...e_structured_bindings_customization_point_finding_rules.md | 2 +- .../remove_deprecated_nothrow_exception_specification.md | 2 +- lang/cpp20/reserving_attribute_namespaces_for_future_use.md | 2 +- ...esolving_const_mismatch_with_defaulted_copy_constructor.md | 2 +- lang/cpp20/signed_integers_are_twos_complement.md | 2 +- lang/cpp20/simplifying_implicit_lambda_capture.md | 2 +- lang/cpp20/try-catch_blocks_in_constexpr_functions.md | 2 +- lang/cpp20/update_the_reference_to_the_unicode_standard.md | 2 +- lang/cpp20/using_enum.md | 2 +- lang/cpp20/va_opt.md | 2 +- lang/cpp20/wording_for_lambdas_in_unevaluated_contexts.md | 2 +- ...pport_for_preprocessing_directives_elifdef_and_elifndef.md | 2 +- lang/cpp23/attributes_on_lambda_expressions.md | 2 +- lang/cpp23/character_encoding_of_diagnostic_text.md | 2 +- .../cpp23/class_template_argument_deduction_from_inherited.md | 2 +- lang/cpp23/consistent_character_literal_encoding.md | 2 +- lang/cpp23/consteval_needs_to_propagate_up.md | 2 +- lang/cpp23/delimited_escape_sequences.md | 2 +- lang/cpp23/down_with_lambda_parens.md | 2 +- .../cpp23/extend_init_statement_to_allow_alias_declaration.md | 2 +- lang/cpp23/feature_test_macros.md | 2 +- lang/cpp23/generalized_wording_for_partial_specializations.md | 2 +- lang/cpp23/if_consteval.md | 2 +- lang/cpp23/labels_at_the_end_of_compound_statements.md | 2 +- lang/cpp23/lifetime_extension_in_range_based_for_loop.md | 2 +- lang/cpp23/literal_suffix_for_signed_size_t.md | 2 +- lang/cpp23/make_declaration_order_layout_mandated.md | 2 +- lang/cpp23/meaningful_exports.md | 2 +- lang/cpp23/mixed_string_literal_concatenation.md | 2 +- lang/cpp23/multidimensional_subscript_operator.md | 2 +- lang/cpp23/named_universal_character_escapes.md | 2 +- lang/cpp23/narrowing_contextual_conversions_to_bool.md | 2 +- lang/cpp23/non_literal_variables_in_constexpr_functions.md | 2 +- ...tting_static_constexpr_variables_in_constexpr_functions.md | 2 +- lang/cpp23/portable_assumptions.md | 2 +- lang/cpp23/predefined_macros.md | 2 +- lang/cpp23/relaxing_some_constexpr_restrictions.md | 2 +- ...ter_literals_and_multicharacter_wide_character_literals.md | 2 +- lang/cpp23/simpler_implicit_move.md | 2 +- lang/cpp23/static_operator.md | 2 +- .../support_for_utf8_as_a_portable_source_file_encoding.md | 2 +- lang/cpp23/trimming_whitespaces_before_line_splicing.md | 2 +- lang/cpp23/update_normative_reference_to_posix.md | 2 +- lang/cpp23/warning.md | 2 +- lang/cpp26/user-generated_static_assert_messages.md | 2 +- start_editing/lang_template_page.md | 4 ++-- 216 files changed, 220 insertions(+), 220 deletions(-) diff --git a/.github/workflows/script/update_lang_caution.py b/.github/workflows/script/update_lang_caution.py index ede5bf02e1..1cf2e3d08c 100644 --- a/.github/workflows/script/update_lang_caution.py +++ b/.github/workflows/script/update_lang_caution.py @@ -9,11 +9,11 @@ LANG_CAUTION = '''このページはC++{}に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。''' +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。''' FUTURE_LANG_CAUTION = '''このページはC++{}に採用される見込みの言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。''' +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。''' FUTURE_LANG_VERSION = 26 diff --git a/lang/cpp11/alias_templates.md b/lang/cpp11/alias_templates.md index 2b34249017..c2108cbf73 100644 --- a/lang/cpp11/alias_templates.md +++ b/lang/cpp11/alias_templates.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/alignas.md b/lang/cpp11/alignas.md index 4786b90c98..a97dbd4a0d 100644 --- a/lang/cpp11/alignas.md +++ b/lang/cpp11/alignas.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/alignof.md b/lang/cpp11/alignof.md index 35472e4629..08731ddf93 100644 --- a/lang/cpp11/alignof.md +++ b/lang/cpp11/alignof.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/attributes.md b/lang/cpp11/attributes.md index ef465af360..803308f061 100644 --- a/lang/cpp11/attributes.md +++ b/lang/cpp11/attributes.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/auto.md b/lang/cpp11/auto.md index 23907ac336..5273c1cbfe 100644 --- a/lang/cpp11/auto.md +++ b/lang/cpp11/auto.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/c99_predefined_macros.md b/lang/cpp11/c99_predefined_macros.md index a1066e83e0..c4060ebbb8 100644 --- a/lang/cpp11/c99_predefined_macros.md +++ b/lang/cpp11/c99_predefined_macros.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/char16_32.md b/lang/cpp11/char16_32.md index 5e4af4f700..b60008aa3d 100644 --- a/lang/cpp11/char16_32.md +++ b/lang/cpp11/char16_32.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/constexpr.md b/lang/cpp11/constexpr.md index b2c08fd27c..8e8b96c5fa 100644 --- a/lang/cpp11/constexpr.md +++ b/lang/cpp11/constexpr.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/decltype.md b/lang/cpp11/decltype.md index 9eba0a2415..05e9f974de 100644 --- a/lang/cpp11/decltype.md +++ b/lang/cpp11/decltype.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/defaulted_and_deleted_functions.md b/lang/cpp11/defaulted_and_deleted_functions.md index 737eded017..bb5bff003c 100644 --- a/lang/cpp11/defaulted_and_deleted_functions.md +++ b/lang/cpp11/defaulted_and_deleted_functions.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/delegating_constructors.md b/lang/cpp11/delegating_constructors.md index 95712392ba..8bf2fa178f 100644 --- a/lang/cpp11/delegating_constructors.md +++ b/lang/cpp11/delegating_constructors.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/dependent_name_specifier_outside_of_templates.md b/lang/cpp11/dependent_name_specifier_outside_of_templates.md index adc15f4385..96c2678447 100644 --- a/lang/cpp11/dependent_name_specifier_outside_of_templates.md +++ b/lang/cpp11/dependent_name_specifier_outside_of_templates.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/deprecation_of_the_register_keyword.md b/lang/cpp11/deprecation_of_the_register_keyword.md index 6853e47bf1..de0e1de6e9 100644 --- a/lang/cpp11/deprecation_of_the_register_keyword.md +++ b/lang/cpp11/deprecation_of_the_register_keyword.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/earlier_declarated_array_bounds.md b/lang/cpp11/earlier_declarated_array_bounds.md index 94d7461278..133f953271 100644 --- a/lang/cpp11/earlier_declarated_array_bounds.md +++ b/lang/cpp11/earlier_declarated_array_bounds.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/explicit_conversion_operator.md b/lang/cpp11/explicit_conversion_operator.md index 393523cdf7..22d5b87b8e 100644 --- a/lang/cpp11/explicit_conversion_operator.md +++ b/lang/cpp11/explicit_conversion_operator.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/extend_friend_targets.md b/lang/cpp11/extend_friend_targets.md index 3452a098b9..0a11daa113 100644 --- a/lang/cpp11/extend_friend_targets.md +++ b/lang/cpp11/extend_friend_targets.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/extending_sizeof_to_apply_to_non_static_data_members_without_an_object.md b/lang/cpp11/extending_sizeof_to_apply_to_non_static_data_members_without_an_object.md index 1b8e16d853..d13a9b3d04 100644 --- a/lang/cpp11/extending_sizeof_to_apply_to_non_static_data_members_without_an_object.md +++ b/lang/cpp11/extending_sizeof_to_apply_to_non_static_data_members_without_an_object.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/extern_template.md b/lang/cpp11/extern_template.md index c32818e017..e62ec385d3 100644 --- a/lang/cpp11/extern_template.md +++ b/lang/cpp11/extern_template.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/feature_test_macros.md b/lang/cpp11/feature_test_macros.md index fdbc237484..82389f169d 100644 --- a/lang/cpp11/feature_test_macros.md +++ b/lang/cpp11/feature_test_macros.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/func.md b/lang/cpp11/func.md index 403f0db999..e6a6baa91f 100644 --- a/lang/cpp11/func.md +++ b/lang/cpp11/func.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/global_scope_syntax_in_nested_name_specifier.md b/lang/cpp11/global_scope_syntax_in_nested_name_specifier.md index 7eaa5fa386..8787c5e7c0 100644 --- a/lang/cpp11/global_scope_syntax_in_nested_name_specifier.md +++ b/lang/cpp11/global_scope_syntax_in_nested_name_specifier.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/inheriting_constructors.md b/lang/cpp11/inheriting_constructors.md index e99d4013c8..10dda8705d 100644 --- a/lang/cpp11/inheriting_constructors.md +++ b/lang/cpp11/inheriting_constructors.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/initializer_lists.md b/lang/cpp11/initializer_lists.md index 962448cb40..fd0dffab9c 100644 --- a/lang/cpp11/initializer_lists.md +++ b/lang/cpp11/initializer_lists.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/inline_namespaces.md b/lang/cpp11/inline_namespaces.md index a25299be57..36986907ac 100644 --- a/lang/cpp11/inline_namespaces.md +++ b/lang/cpp11/inline_namespaces.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/lambda_expressions.md b/lang/cpp11/lambda_expressions.md index dd1bd263d6..f1d58c96e4 100644 --- a/lang/cpp11/lambda_expressions.md +++ b/lang/cpp11/lambda_expressions.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/local_and_unnamed_type_as_template_arguments.md b/lang/cpp11/local_and_unnamed_type_as_template_arguments.md index 8370caab9b..4b7096e83e 100644 --- a/lang/cpp11/local_and_unnamed_type_as_template_arguments.md +++ b/lang/cpp11/local_and_unnamed_type_as_template_arguments.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/long_long_type.md b/lang/cpp11/long_long_type.md index 784b873066..4d38aaec05 100644 --- a/lang/cpp11/long_long_type.md +++ b/lang/cpp11/long_long_type.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/noexcept.md b/lang/cpp11/noexcept.md index 3a4bfa56d2..5bd496b725 100644 --- a/lang/cpp11/noexcept.md +++ b/lang/cpp11/noexcept.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/non_static_data_member_initializers.md b/lang/cpp11/non_static_data_member_initializers.md index d2f6a64cb8..991ae8f0b5 100644 --- a/lang/cpp11/non_static_data_member_initializers.md +++ b/lang/cpp11/non_static_data_member_initializers.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/nullptr.md b/lang/cpp11/nullptr.md index c36181e2ff..509336fc4a 100644 --- a/lang/cpp11/nullptr.md +++ b/lang/cpp11/nullptr.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/override_final.md b/lang/cpp11/override_final.md index 06fa189b6f..a1d082e0af 100644 --- a/lang/cpp11/override_final.md +++ b/lang/cpp11/override_final.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/pragma_operator.md b/lang/cpp11/pragma_operator.md index 6e71a2fafa..698fb535a4 100644 --- a/lang/cpp11/pragma_operator.md +++ b/lang/cpp11/pragma_operator.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/predefined_macros.md b/lang/cpp11/predefined_macros.md index 41d9f43a29..4595795b4a 100644 --- a/lang/cpp11/predefined_macros.md +++ b/lang/cpp11/predefined_macros.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/range_based_for.md b/lang/cpp11/range_based_for.md index 17ee409e7c..17a78d0757 100644 --- a/lang/cpp11/range_based_for.md +++ b/lang/cpp11/range_based_for.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/raw_string_literals.md b/lang/cpp11/raw_string_literals.md index 98ef7b863f..20bdfe8f90 100644 --- a/lang/cpp11/raw_string_literals.md +++ b/lang/cpp11/raw_string_literals.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/recursive_template_limit.md b/lang/cpp11/recursive_template_limit.md index b0f6da923c..e32a1a0fe8 100644 --- a/lang/cpp11/recursive_template_limit.md +++ b/lang/cpp11/recursive_template_limit.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/ref_qualifier_for_this.md b/lang/cpp11/ref_qualifier_for_this.md index ef6c41baf4..aa174c9ce7 100644 --- a/lang/cpp11/ref_qualifier_for_this.md +++ b/lang/cpp11/ref_qualifier_for_this.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/reference_collapsing.md b/lang/cpp11/reference_collapsing.md index 2168a08d4c..3afd95492c 100644 --- a/lang/cpp11/reference_collapsing.md +++ b/lang/cpp11/reference_collapsing.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/remove_export_templates.md b/lang/cpp11/remove_export_templates.md index 1d7e79a086..6d4877a3bf 100644 --- a/lang/cpp11/remove_export_templates.md +++ b/lang/cpp11/remove_export_templates.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/reserved_namespaces_for_posix.md b/lang/cpp11/reserved_namespaces_for_posix.md index 16813d6571..c2625e06c3 100644 --- a/lang/cpp11/reserved_namespaces_for_posix.md +++ b/lang/cpp11/reserved_namespaces_for_posix.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/result_of_integer_division_and_modulo.md b/lang/cpp11/result_of_integer_division_and_modulo.md index 29d0d45050..3408e1c7b0 100644 --- a/lang/cpp11/result_of_integer_division_and_modulo.md +++ b/lang/cpp11/result_of_integer_division_and_modulo.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/right_angle_brackets.md b/lang/cpp11/right_angle_brackets.md index 63abe59455..29920e67cb 100644 --- a/lang/cpp11/right_angle_brackets.md +++ b/lang/cpp11/right_angle_brackets.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/rvalue_ref_and_move_semantics.md b/lang/cpp11/rvalue_ref_and_move_semantics.md index 07f6c01b4a..6d27237e89 100644 --- a/lang/cpp11/rvalue_ref_and_move_semantics.md +++ b/lang/cpp11/rvalue_ref_and_move_semantics.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/scoped_enum.md b/lang/cpp11/scoped_enum.md index 28340f4d26..b404da8389 100644 --- a/lang/cpp11/scoped_enum.md +++ b/lang/cpp11/scoped_enum.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/sfinae_expressions.md b/lang/cpp11/sfinae_expressions.md index dd5682c0ab..ab49073964 100644 --- a/lang/cpp11/sfinae_expressions.md +++ b/lang/cpp11/sfinae_expressions.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/static_assert.md b/lang/cpp11/static_assert.md index b11c71f394..0d76aaab1b 100644 --- a/lang/cpp11/static_assert.md +++ b/lang/cpp11/static_assert.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/static_initialization_thread_safely.md b/lang/cpp11/static_initialization_thread_safely.md index 8f0c46ff8e..cc7deff90a 100644 --- a/lang/cpp11/static_initialization_thread_safely.md +++ b/lang/cpp11/static_initialization_thread_safely.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/string_literal_concatenation.md b/lang/cpp11/string_literal_concatenation.md index 3c980eb43f..dd9f678ef3 100644 --- a/lang/cpp11/string_literal_concatenation.md +++ b/lang/cpp11/string_literal_concatenation.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/thread_local_storage.md b/lang/cpp11/thread_local_storage.md index 52cc0a3230..685fc26fa7 100644 --- a/lang/cpp11/thread_local_storage.md +++ b/lang/cpp11/thread_local_storage.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/trailing_comma_following_enumerator_list.md b/lang/cpp11/trailing_comma_following_enumerator_list.md index aa7bdd73a7..1050fb2311 100644 --- a/lang/cpp11/trailing_comma_following_enumerator_list.md +++ b/lang/cpp11/trailing_comma_following_enumerator_list.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/trailing_return_types.md b/lang/cpp11/trailing_return_types.md index b12bcd4194..3ccc8ea022 100644 --- a/lang/cpp11/trailing_return_types.md +++ b/lang/cpp11/trailing_return_types.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/uniform_initialization.md b/lang/cpp11/uniform_initialization.md index b9705fa306..bb09025941 100644 --- a/lang/cpp11/uniform_initialization.md +++ b/lang/cpp11/uniform_initialization.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/unrestricted_unions.md b/lang/cpp11/unrestricted_unions.md index 8d3671031b..1fde6b9e23 100644 --- a/lang/cpp11/unrestricted_unions.md +++ b/lang/cpp11/unrestricted_unions.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/user_defined_literals.md b/lang/cpp11/user_defined_literals.md index 5970ee0ed7..144f806afe 100644 --- a/lang/cpp11/user_defined_literals.md +++ b/lang/cpp11/user_defined_literals.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/utf8_string_literals.md b/lang/cpp11/utf8_string_literals.md index 8d1c9bf062..919685ca12 100644 --- a/lang/cpp11/utf8_string_literals.md +++ b/lang/cpp11/utf8_string_literals.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/variadic_macros.md b/lang/cpp11/variadic_macros.md index 5049cca1b4..efd3507d40 100644 --- a/lang/cpp11/variadic_macros.md +++ b/lang/cpp11/variadic_macros.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp11/variadic_templates.md b/lang/cpp11/variadic_templates.md index adf5bfb450..045a6d03d1 100644 --- a/lang/cpp11/variadic_templates.md +++ b/lang/cpp11/variadic_templates.md @@ -5,7 +5,7 @@ このページはC++11に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp14/binary_literals.md b/lang/cpp14/binary_literals.md index 20a3d19da5..b07e75791a 100644 --- a/lang/cpp14/binary_literals.md +++ b/lang/cpp14/binary_literals.md @@ -5,7 +5,7 @@ このページはC++14に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp14/brace_elision_in_array_temporary_initialization.md b/lang/cpp14/brace_elision_in_array_temporary_initialization.md index ea09d709d1..7218dae71d 100644 --- a/lang/cpp14/brace_elision_in_array_temporary_initialization.md +++ b/lang/cpp14/brace_elision_in_array_temporary_initialization.md @@ -5,7 +5,7 @@ このページはC++14に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp14/clarifying_memory_allocation.md b/lang/cpp14/clarifying_memory_allocation.md index 039593c3cf..a023eda466 100644 --- a/lang/cpp14/clarifying_memory_allocation.md +++ b/lang/cpp14/clarifying_memory_allocation.md @@ -5,7 +5,7 @@ このページはC++14に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp14/decltype_auto.md b/lang/cpp14/decltype_auto.md index 9bf9e83773..3e5d131c2f 100644 --- a/lang/cpp14/decltype_auto.md +++ b/lang/cpp14/decltype_auto.md @@ -5,7 +5,7 @@ このページはC++14に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp14/deprecated_attr.md b/lang/cpp14/deprecated_attr.md index 7249301917..0dfa33f04c 100644 --- a/lang/cpp14/deprecated_attr.md +++ b/lang/cpp14/deprecated_attr.md @@ -5,7 +5,7 @@ このページはC++14に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp14/digit_separators.md b/lang/cpp14/digit_separators.md index 9e5e8ad11e..c677b1915a 100644 --- a/lang/cpp14/digit_separators.md +++ b/lang/cpp14/digit_separators.md @@ -5,7 +5,7 @@ このページはC++14に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 @@ -142,4 +142,4 @@ C++14という言語バージョンは、C++11の仕様に対するバグ修正 - Perl : [Underscores in numbers](http://www.perlmonks.org/?node=72112) - Ruby : [アンダーバーによる数値の区切り](http://www.rubylife.jp/ini/num/index2.html) - Java 7 : [Underscores in Numeric Literals](http://docs.oracle.com/javase/7/docs/technotes/guides/language/underscores-literals.html) -- Ada : [Ada '83 Language Reference Manual](http://archive.adaic.com/standards/83lrm/html/lrm-02-04.html#2.4) +- Ada : [Ada '83 Language Reference Manual](http://archive.adaic.com/standards/83lrm/html/lrm-02-04.html#2.4) \ No newline at end of file diff --git a/lang/cpp14/feature_test_macros.md b/lang/cpp14/feature_test_macros.md index e6338422f3..99ef09394c 100644 --- a/lang/cpp14/feature_test_macros.md +++ b/lang/cpp14/feature_test_macros.md @@ -5,7 +5,7 @@ このページはC++14に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp14/generic_lambdas.md b/lang/cpp14/generic_lambdas.md index 71e85c56ad..94b918f4e7 100644 --- a/lang/cpp14/generic_lambdas.md +++ b/lang/cpp14/generic_lambdas.md @@ -5,7 +5,7 @@ このページはC++14に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp14/initialize_capture.md b/lang/cpp14/initialize_capture.md index bbd9a25d90..7b5e943edc 100644 --- a/lang/cpp14/initialize_capture.md +++ b/lang/cpp14/initialize_capture.md @@ -5,7 +5,7 @@ このページはC++14に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp14/member_initializers_and_aggregates.md b/lang/cpp14/member_initializers_and_aggregates.md index d7a2254826..8a208da141 100644 --- a/lang/cpp14/member_initializers_and_aggregates.md +++ b/lang/cpp14/member_initializers_and_aggregates.md @@ -5,7 +5,7 @@ このページはC++14に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp14/no_whitespace_literal_operators.md b/lang/cpp14/no_whitespace_literal_operators.md index 3ab2981bb9..5f5613fd7f 100644 --- a/lang/cpp14/no_whitespace_literal_operators.md +++ b/lang/cpp14/no_whitespace_literal_operators.md @@ -5,7 +5,7 @@ このページはC++14に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp14/nontype_template_parameters_of_type_nullptr_t.md b/lang/cpp14/nontype_template_parameters_of_type_nullptr_t.md index 274dc94f31..e26937a298 100644 --- a/lang/cpp14/nontype_template_parameters_of_type_nullptr_t.md +++ b/lang/cpp14/nontype_template_parameters_of_type_nullptr_t.md @@ -5,7 +5,7 @@ このページはC++14に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp14/placeholder_type_in_trailing_return_type.md b/lang/cpp14/placeholder_type_in_trailing_return_type.md index d490d58b39..ce35c338d6 100644 --- a/lang/cpp14/placeholder_type_in_trailing_return_type.md +++ b/lang/cpp14/placeholder_type_in_trailing_return_type.md @@ -5,7 +5,7 @@ このページはC++14に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 @@ -56,4 +56,4 @@ int main() ## 関連項目 -- [C++14 通常関数の戻り値型推論](return_type_deduction_for_normal_functions.md) +- [C++14 通常関数の戻り値型推論](return_type_deduction_for_normal_functions.md) \ No newline at end of file diff --git a/lang/cpp14/predefined_macros.md b/lang/cpp14/predefined_macros.md index 82bdeb0fac..db52387e94 100644 --- a/lang/cpp14/predefined_macros.md +++ b/lang/cpp14/predefined_macros.md @@ -5,7 +5,7 @@ このページはC++14に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp14/relaxing_constraints_on_constexpr.md b/lang/cpp14/relaxing_constraints_on_constexpr.md index dacd6abadd..2d65d8e3ee 100644 --- a/lang/cpp14/relaxing_constraints_on_constexpr.md +++ b/lang/cpp14/relaxing_constraints_on_constexpr.md @@ -5,7 +5,7 @@ このページはC++14に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp14/return_type_deduction_for_normal_functions.md b/lang/cpp14/return_type_deduction_for_normal_functions.md index 05edc55cf2..fe8dc74d55 100644 --- a/lang/cpp14/return_type_deduction_for_normal_functions.md +++ b/lang/cpp14/return_type_deduction_for_normal_functions.md @@ -5,7 +5,7 @@ このページはC++14に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp14/sized_deallocation.md b/lang/cpp14/sized_deallocation.md index 9733d5fd90..dd98f00a9b 100644 --- a/lang/cpp14/sized_deallocation.md +++ b/lang/cpp14/sized_deallocation.md @@ -5,7 +5,7 @@ このページはC++14に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp14/variable_templates.md b/lang/cpp14/variable_templates.md index 63d09298a4..139b45ad00 100644 --- a/lang/cpp14/variable_templates.md +++ b/lang/cpp14/variable_templates.md @@ -5,7 +5,7 @@ このページはC++14に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/allow_constant_evaluation_for_all_non-type_template_arguments.md b/lang/cpp17/allow_constant_evaluation_for_all_non-type_template_arguments.md index bb3aa3b224..dce9e1fb01 100644 --- a/lang/cpp17/allow_constant_evaluation_for_all_non-type_template_arguments.md +++ b/lang/cpp17/allow_constant_evaluation_for_all_non-type_template_arguments.md @@ -6,7 +6,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/allow_default_template_arguments_of_variable_templates.md b/lang/cpp17/allow_default_template_arguments_of_variable_templates.md index a617781318..95f72144da 100644 --- a/lang/cpp17/allow_default_template_arguments_of_variable_templates.md +++ b/lang/cpp17/allow_default_template_arguments_of_variable_templates.md @@ -5,7 +5,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/allow_typename_in_a_template_template_parameter.md b/lang/cpp17/allow_typename_in_a_template_template_parameter.md index 9150ce9b3b..b545de5d6c 100644 --- a/lang/cpp17/allow_typename_in_a_template_template_parameter.md +++ b/lang/cpp17/allow_typename_in_a_template_template_parameter.md @@ -5,7 +5,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/attributes_for_namespaces_and_enumerators.md b/lang/cpp17/attributes_for_namespaces_and_enumerators.md index f7b9ab09b1..88efd883fc 100644 --- a/lang/cpp17/attributes_for_namespaces_and_enumerators.md +++ b/lang/cpp17/attributes_for_namespaces_and_enumerators.md @@ -5,7 +5,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/constexpr_lambda.md b/lang/cpp17/constexpr_lambda.md index a3c3d9b7e7..5a118885dc 100644 --- a/lang/cpp17/constexpr_lambda.md +++ b/lang/cpp17/constexpr_lambda.md @@ -6,7 +6,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/construction_enum_class_values.md b/lang/cpp17/construction_enum_class_values.md index 2f6b48e2bc..97f69dffcd 100644 --- a/lang/cpp17/construction_enum_class_values.md +++ b/lang/cpp17/construction_enum_class_values.md @@ -5,7 +5,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/declaring_non-type_template_arguments_with_auto.md b/lang/cpp17/declaring_non-type_template_arguments_with_auto.md index 7faa77fa08..7b4d8e2b64 100644 --- a/lang/cpp17/declaring_non-type_template_arguments_with_auto.md +++ b/lang/cpp17/declaring_non-type_template_arguments_with_auto.md @@ -6,7 +6,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/dynamic_memory_allocation_for_over-aligned_data.md b/lang/cpp17/dynamic_memory_allocation_for_over-aligned_data.md index ceb1daf17f..2aed473815 100644 --- a/lang/cpp17/dynamic_memory_allocation_for_over-aligned_data.md +++ b/lang/cpp17/dynamic_memory_allocation_for_over-aligned_data.md @@ -5,7 +5,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/exception_spec_be_part_of_the_type_system.md b/lang/cpp17/exception_spec_be_part_of_the_type_system.md index 4ae6a5bba8..245cb7cc08 100644 --- a/lang/cpp17/exception_spec_be_part_of_the_type_system.md +++ b/lang/cpp17/exception_spec_be_part_of_the_type_system.md @@ -5,7 +5,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/expression_evaluation_order.md b/lang/cpp17/expression_evaluation_order.md index bfe7a07917..048406bfd6 100644 --- a/lang/cpp17/expression_evaluation_order.md +++ b/lang/cpp17/expression_evaluation_order.md @@ -5,7 +5,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/extending_static_assert.md b/lang/cpp17/extending_static_assert.md index 3fc1bc7906..40eddc1bee 100644 --- a/lang/cpp17/extending_static_assert.md +++ b/lang/cpp17/extending_static_assert.md @@ -5,7 +5,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/extension_to_aggregate_initialization.md b/lang/cpp17/extension_to_aggregate_initialization.md index 7b42690e6c..8e72218485 100644 --- a/lang/cpp17/extension_to_aggregate_initialization.md +++ b/lang/cpp17/extension_to_aggregate_initialization.md @@ -6,7 +6,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/fallthrough.md b/lang/cpp17/fallthrough.md index f809ea834d..301ebec53f 100644 --- a/lang/cpp17/fallthrough.md +++ b/lang/cpp17/fallthrough.md @@ -5,7 +5,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/feature_test_macros.md b/lang/cpp17/feature_test_macros.md index 91cfd4e192..3ce2236ad5 100644 --- a/lang/cpp17/feature_test_macros.md +++ b/lang/cpp17/feature_test_macros.md @@ -5,7 +5,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/folding_expressions.md b/lang/cpp17/folding_expressions.md index 408b058618..72d559fd6e 100644 --- a/lang/cpp17/folding_expressions.md +++ b/lang/cpp17/folding_expressions.md @@ -5,7 +5,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/generalizing_the_range-based_for_loop.md b/lang/cpp17/generalizing_the_range-based_for_loop.md index 818f3b526e..344ac88660 100644 --- a/lang/cpp17/generalizing_the_range-based_for_loop.md +++ b/lang/cpp17/generalizing_the_range-based_for_loop.md @@ -5,7 +5,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/guaranteed_copy_elision.md b/lang/cpp17/guaranteed_copy_elision.md index df83a6b77d..4cf9aeef98 100644 --- a/lang/cpp17/guaranteed_copy_elision.md +++ b/lang/cpp17/guaranteed_copy_elision.md @@ -6,7 +6,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/has_include.md b/lang/cpp17/has_include.md index 46c583c24d..2cfaaba58a 100644 --- a/lang/cpp17/has_include.md +++ b/lang/cpp17/has_include.md @@ -5,7 +5,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/hexadecimal_floating_literals.md b/lang/cpp17/hexadecimal_floating_literals.md index 914023b131..e976eef46a 100644 --- a/lang/cpp17/hexadecimal_floating_literals.md +++ b/lang/cpp17/hexadecimal_floating_literals.md @@ -4,7 +4,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/if_constexpr.md b/lang/cpp17/if_constexpr.md index 48028fc0c6..c2febe1f40 100644 --- a/lang/cpp17/if_constexpr.md +++ b/lang/cpp17/if_constexpr.md @@ -5,7 +5,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/inline_variables.md b/lang/cpp17/inline_variables.md index 937afd223b..3afbdae0de 100644 --- a/lang/cpp17/inline_variables.md +++ b/lang/cpp17/inline_variables.md @@ -5,7 +5,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/lambda_capture_of_this_by_value.md b/lang/cpp17/lambda_capture_of_this_by_value.md index 2e91fe9cbe..027b4c9399 100644 --- a/lang/cpp17/lambda_capture_of_this_by_value.md +++ b/lang/cpp17/lambda_capture_of_this_by_value.md @@ -5,7 +5,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/lambda_to_noexcept_function_pointer.md b/lang/cpp17/lambda_to_noexcept_function_pointer.md index c0532d9d11..0afb67e62d 100644 --- a/lang/cpp17/lambda_to_noexcept_function_pointer.md +++ b/lang/cpp17/lambda_to_noexcept_function_pointer.md @@ -5,7 +5,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/maybe_unused.md b/lang/cpp17/maybe_unused.md index 0c61865ae7..0bbbbc5e66 100644 --- a/lang/cpp17/maybe_unused.md +++ b/lang/cpp17/maybe_unused.md @@ -5,7 +5,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/nested_namespace.md b/lang/cpp17/nested_namespace.md index 37c3df4f46..d84c561c42 100644 --- a/lang/cpp17/nested_namespace.md +++ b/lang/cpp17/nested_namespace.md @@ -5,7 +5,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/new_rules_for_auto_deduction_from_braced-init-list.md b/lang/cpp17/new_rules_for_auto_deduction_from_braced-init-list.md index 017d28e058..5627e23b2f 100644 --- a/lang/cpp17/new_rules_for_auto_deduction_from_braced-init-list.md +++ b/lang/cpp17/new_rules_for_auto_deduction_from_braced-init-list.md @@ -5,7 +5,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/nodiscard.md b/lang/cpp17/nodiscard.md index 7346a5df01..a2d9bea3ba 100644 --- a/lang/cpp17/nodiscard.md +++ b/lang/cpp17/nodiscard.md @@ -5,7 +5,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/non_standard_attributes.md b/lang/cpp17/non_standard_attributes.md index c0fabc99d7..b4843517b2 100644 --- a/lang/cpp17/non_standard_attributes.md +++ b/lang/cpp17/non_standard_attributes.md @@ -5,7 +5,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/pack_expansions_in_using.md b/lang/cpp17/pack_expansions_in_using.md index c2b4a7e841..911ef2e1b9 100644 --- a/lang/cpp17/pack_expansions_in_using.md +++ b/lang/cpp17/pack_expansions_in_using.md @@ -5,7 +5,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/predefined_macros.md b/lang/cpp17/predefined_macros.md index a1462c55ee..aebe7b629b 100644 --- a/lang/cpp17/predefined_macros.md +++ b/lang/cpp17/predefined_macros.md @@ -5,7 +5,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/remove_deprecated_exception_specifications.md b/lang/cpp17/remove_deprecated_exception_specifications.md index 8d645f0457..9cbf8ee251 100644 --- a/lang/cpp17/remove_deprecated_exception_specifications.md +++ b/lang/cpp17/remove_deprecated_exception_specifications.md @@ -5,7 +5,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/remove_deprecated_increment_of_bool.md b/lang/cpp17/remove_deprecated_increment_of_bool.md index 4888e6a5d8..cb4a2fe810 100644 --- a/lang/cpp17/remove_deprecated_increment_of_bool.md +++ b/lang/cpp17/remove_deprecated_increment_of_bool.md @@ -5,7 +5,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/remove_deprecated_use_of_the_register_keyword.md b/lang/cpp17/remove_deprecated_use_of_the_register_keyword.md index 4bbea0c54e..e16ff1aa34 100644 --- a/lang/cpp17/remove_deprecated_use_of_the_register_keyword.md +++ b/lang/cpp17/remove_deprecated_use_of_the_register_keyword.md @@ -5,7 +5,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/removing_trigraphs.md b/lang/cpp17/removing_trigraphs.md index 32b4e85805..ea8f27cc68 100644 --- a/lang/cpp17/removing_trigraphs.md +++ b/lang/cpp17/removing_trigraphs.md @@ -5,7 +5,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/replacement_of_class_objects_containing_reference_members.md b/lang/cpp17/replacement_of_class_objects_containing_reference_members.md index c14c128a54..c005c77677 100644 --- a/lang/cpp17/replacement_of_class_objects_containing_reference_members.md +++ b/lang/cpp17/replacement_of_class_objects_containing_reference_members.md @@ -5,7 +5,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/selection_statements_with_initializer.md b/lang/cpp17/selection_statements_with_initializer.md index 853453de27..9015a14814 100644 --- a/lang/cpp17/selection_statements_with_initializer.md +++ b/lang/cpp17/selection_statements_with_initializer.md @@ -5,7 +5,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/structured_bindings.md b/lang/cpp17/structured_bindings.md index c0b07bf728..ce661c6932 100644 --- a/lang/cpp17/structured_bindings.md +++ b/lang/cpp17/structured_bindings.md @@ -5,7 +5,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/type_deduction_for_class_templates.md b/lang/cpp17/type_deduction_for_class_templates.md index 34ece2891c..5f3edea731 100644 --- a/lang/cpp17/type_deduction_for_class_templates.md +++ b/lang/cpp17/type_deduction_for_class_templates.md @@ -5,7 +5,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/using_attribute_namespaces.md b/lang/cpp17/using_attribute_namespaces.md index 5d944df0bb..a587e9b7f7 100644 --- a/lang/cpp17/using_attribute_namespaces.md +++ b/lang/cpp17/using_attribute_namespaces.md @@ -5,7 +5,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp17/utf8_character_literals.md b/lang/cpp17/utf8_character_literals.md index e0efe041a8..ca2bb8ce55 100644 --- a/lang/cpp17/utf8_character_literals.md +++ b/lang/cpp17/utf8_character_literals.md @@ -5,7 +5,7 @@ このページはC++17に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/access_checking_on_specializations.md b/lang/cpp20/access_checking_on_specializations.md index e7e3e1126a..74dcccd32a 100644 --- a/lang/cpp20/access_checking_on_specializations.md +++ b/lang/cpp20/access_checking_on_specializations.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/adl_and_function_templates_that_are_not_visible.md b/lang/cpp20/adl_and_function_templates_that_are_not_visible.md index 360530f8df..996c53ae40 100644 --- a/lang/cpp20/adl_and_function_templates_that_are_not_visible.md +++ b/lang/cpp20/adl_and_function_templates_that_are_not_visible.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/allow_initializing_aggregates_from_a_parenthesized_list_of_values.md b/lang/cpp20/allow_initializing_aggregates_from_a_parenthesized_list_of_values.md index eda127df37..28a7025834 100644 --- a/lang/cpp20/allow_initializing_aggregates_from_a_parenthesized_list_of_values.md +++ b/lang/cpp20/allow_initializing_aggregates_from_a_parenthesized_list_of_values.md @@ -6,7 +6,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/allow_lambda_capture_equal_this.md b/lang/cpp20/allow_lambda_capture_equal_this.md index f2ca69bffc..f125c03cba 100644 --- a/lang/cpp20/allow_lambda_capture_equal_this.md +++ b/lang/cpp20/allow_lambda_capture_equal_this.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/allow_pack_expansion_in_lambda_init_capture.md b/lang/cpp20/allow_pack_expansion_in_lambda_init_capture.md index e4171c60f9..300dd5820a 100644 --- a/lang/cpp20/allow_pack_expansion_in_lambda_init_capture.md +++ b/lang/cpp20/allow_pack_expansion_in_lambda_init_capture.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/allow_structured_bindings_to_accessible_members.md b/lang/cpp20/allow_structured_bindings_to_accessible_members.md index 7eed7ff0dd..94a6b8f193 100644 --- a/lang/cpp20/allow_structured_bindings_to_accessible_members.md +++ b/lang/cpp20/allow_structured_bindings_to_accessible_members.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/allow_virtual_function_calls_in_constant_expressions.md b/lang/cpp20/allow_virtual_function_calls_in_constant_expressions.md index 6a6643aaed..38fafeba35 100644 --- a/lang/cpp20/allow_virtual_function_calls_in_constant_expressions.md +++ b/lang/cpp20/allow_virtual_function_calls_in_constant_expressions.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/allowing_dynamic_cast_polymorphic_typeid_in_constant_expressions.md b/lang/cpp20/allowing_dynamic_cast_polymorphic_typeid_in_constant_expressions.md index 79fb171a64..723cff331a 100644 --- a/lang/cpp20/allowing_dynamic_cast_polymorphic_typeid_in_constant_expressions.md +++ b/lang/cpp20/allowing_dynamic_cast_polymorphic_typeid_in_constant_expressions.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/array_size_deduction_in_new-expressions.md b/lang/cpp20/array_size_deduction_in_new-expressions.md index 34a3005acd..cf15d21fc4 100644 --- a/lang/cpp20/array_size_deduction_in_new-expressions.md +++ b/lang/cpp20/array_size_deduction_in_new-expressions.md @@ -6,7 +6,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/changing_the_active_member_of_a_union_inside_constexpr.md b/lang/cpp20/changing_the_active_member_of_a_union_inside_constexpr.md index 6cd672333a..e1a81ed042 100644 --- a/lang/cpp20/changing_the_active_member_of_a_union_inside_constexpr.md +++ b/lang/cpp20/changing_the_active_member_of_a_union_inside_constexpr.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/char8_t.md b/lang/cpp20/char8_t.md index 3b1decd0a3..5cd00f1fec 100644 --- a/lang/cpp20/char8_t.md +++ b/lang/cpp20/char8_t.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/checking_for_abstract_class_types.md b/lang/cpp20/checking_for_abstract_class_types.md index 55f911cad1..41a1ff9f70 100644 --- a/lang/cpp20/checking_for_abstract_class_types.md +++ b/lang/cpp20/checking_for_abstract_class_types.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/class_template_argument_deduction_for_aggregates.md b/lang/cpp20/class_template_argument_deduction_for_aggregates.md index 33d7311745..d55445ee88 100644 --- a/lang/cpp20/class_template_argument_deduction_for_aggregates.md +++ b/lang/cpp20/class_template_argument_deduction_for_aggregates.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/class_template_argument_deduction_for_alias_templates.md b/lang/cpp20/class_template_argument_deduction_for_alias_templates.md index 848b543cad..fbd29c5cb5 100644 --- a/lang/cpp20/class_template_argument_deduction_for_alias_templates.md +++ b/lang/cpp20/class_template_argument_deduction_for_alias_templates.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/class_types_in_non-type_template_parameters.md b/lang/cpp20/class_types_in_non-type_template_parameters.md index 741e364847..743d86a476 100644 --- a/lang/cpp20/class_types_in_non-type_template_parameters.md +++ b/lang/cpp20/class_types_in_non-type_template_parameters.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/concepts.md b/lang/cpp20/concepts.md index 97d65c35c7..fbf72869a6 100644 --- a/lang/cpp20/concepts.md +++ b/lang/cpp20/concepts.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/consistent_comparison.md b/lang/cpp20/consistent_comparison.md index 5b8cac2d3e..92abbb27a3 100644 --- a/lang/cpp20/consistent_comparison.md +++ b/lang/cpp20/consistent_comparison.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/constinit.md b/lang/cpp20/constinit.md index 278c0de2dd..3997d19d83 100644 --- a/lang/cpp20/constinit.md +++ b/lang/cpp20/constinit.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/converting_from_pointer_to_bool_should_be_considered_narrowing.md b/lang/cpp20/converting_from_pointer_to_bool_should_be_considered_narrowing.md index 2c03a7b4d8..486be44f1f 100644 --- a/lang/cpp20/converting_from_pointer_to_bool_should_be_considered_narrowing.md +++ b/lang/cpp20/converting_from_pointer_to_bool_should_be_considered_narrowing.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/coroutines.md b/lang/cpp20/coroutines.md index a85f035951..cd7a359c28 100644 --- a/lang/cpp20/coroutines.md +++ b/lang/cpp20/coroutines.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/default_constructible_and_assignable_stateless_lambdas.md b/lang/cpp20/default_constructible_and_assignable_stateless_lambdas.md index 43c2c464d5..9ada4dbecd 100644 --- a/lang/cpp20/default_constructible_and_assignable_stateless_lambdas.md +++ b/lang/cpp20/default_constructible_and_assignable_stateless_lambdas.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/default_member_initializers_for_bit_fields.md b/lang/cpp20/default_member_initializers_for_bit_fields.md index 89b4aa3f70..5715932113 100644 --- a/lang/cpp20/default_member_initializers_for_bit_fields.md +++ b/lang/cpp20/default_member_initializers_for_bit_fields.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/deprecate_implicit_capture_of_this_via_defcopy.md b/lang/cpp20/deprecate_implicit_capture_of_this_via_defcopy.md index a2006710a1..75358f7929 100644 --- a/lang/cpp20/deprecate_implicit_capture_of_this_via_defcopy.md +++ b/lang/cpp20/deprecate_implicit_capture_of_this_via_defcopy.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/deprecate_pod.md b/lang/cpp20/deprecate_pod.md index 8bc6023617..8c0c1a2199 100644 --- a/lang/cpp20/deprecate_pod.md +++ b/lang/cpp20/deprecate_pod.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/deprecate_uses_of_the_comma_operator_in_subscripting_expressions.md b/lang/cpp20/deprecate_uses_of_the_comma_operator_in_subscripting_expressions.md index be7420c5ba..367b697eae 100644 --- a/lang/cpp20/deprecate_uses_of_the_comma_operator_in_subscripting_expressions.md +++ b/lang/cpp20/deprecate_uses_of_the_comma_operator_in_subscripting_expressions.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/deprecating_volatile.md b/lang/cpp20/deprecating_volatile.md index 9586db0d60..6efb68a5ae 100644 --- a/lang/cpp20/deprecating_volatile.md +++ b/lang/cpp20/deprecating_volatile.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/designated_initialization.md b/lang/cpp20/designated_initialization.md index 257318aedd..57e3f14918 100644 --- a/lang/cpp20/designated_initialization.md +++ b/lang/cpp20/designated_initialization.md @@ -6,7 +6,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/down_with_typename.md b/lang/cpp20/down_with_typename.md index 332621f08e..90eb921e4c 100644 --- a/lang/cpp20/down_with_typename.md +++ b/lang/cpp20/down_with_typename.md @@ -6,7 +6,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md b/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md index e995bf5771..2dc51b7685 100644 --- a/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md +++ b/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.md b/lang/cpp20/enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.md index ecbff6e9f8..7e6af1ac6f 100644 --- a/lang/cpp20/enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.md +++ b/lang/cpp20/enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/explicit_bool.md b/lang/cpp20/explicit_bool.md index c8e39641d4..3f744c5f73 100644 --- a/lang/cpp20/explicit_bool.md +++ b/lang/cpp20/explicit_bool.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/extending_structured_bindings_to_be_more_like_variable_declarations.md b/lang/cpp20/extending_structured_bindings_to_be_more_like_variable_declarations.md index 9d73404bc7..d3999893f7 100644 --- a/lang/cpp20/extending_structured_bindings_to_be_more_like_variable_declarations.md +++ b/lang/cpp20/extending_structured_bindings_to_be_more_like_variable_declarations.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/familiar_template_syntax_for_generic_lambdas.md b/lang/cpp20/familiar_template_syntax_for_generic_lambdas.md index bd15670786..5c8013d87e 100644 --- a/lang/cpp20/familiar_template_syntax_for_generic_lambdas.md +++ b/lang/cpp20/familiar_template_syntax_for_generic_lambdas.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/feature_test_macros.md b/lang/cpp20/feature_test_macros.md index 848a1a5422..846643653b 100644 --- a/lang/cpp20/feature_test_macros.md +++ b/lang/cpp20/feature_test_macros.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/fixing_const_qualified_pointers_to_members.md b/lang/cpp20/fixing_const_qualified_pointers_to_members.md index b5fb535496..054b5f288b 100644 --- a/lang/cpp20/fixing_const_qualified_pointers_to_members.md +++ b/lang/cpp20/fixing_const_qualified_pointers_to_members.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/function_templates_with_auto_parameters.md b/lang/cpp20/function_templates_with_auto_parameters.md index 445873b433..4a41098250 100644 --- a/lang/cpp20/function_templates_with_auto_parameters.md +++ b/lang/cpp20/function_templates_with_auto_parameters.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/immediate_functions.md b/lang/cpp20/immediate_functions.md index 4bcdff0d84..945957495f 100644 --- a/lang/cpp20/immediate_functions.md +++ b/lang/cpp20/immediate_functions.md @@ -6,7 +6,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md index 632a6de5e0..397f83ecf9 100644 --- a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md +++ b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/language_support_for_empty_objects.md b/lang/cpp20/language_support_for_empty_objects.md index f1b35705ee..d7556df214 100644 --- a/lang/cpp20/language_support_for_empty_objects.md +++ b/lang/cpp20/language_support_for_empty_objects.md @@ -6,7 +6,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/less_eager_instantiation_of_constexpr_functions.md b/lang/cpp20/less_eager_instantiation_of_constexpr_functions.md index 3628038c7c..a5b2da250d 100644 --- a/lang/cpp20/less_eager_instantiation_of_constexpr_functions.md +++ b/lang/cpp20/less_eager_instantiation_of_constexpr_functions.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/likely_and_unlikely_attributes.md b/lang/cpp20/likely_and_unlikely_attributes.md index f368c8873a..c1b05c11ea 100644 --- a/lang/cpp20/likely_and_unlikely_attributes.md +++ b/lang/cpp20/likely_and_unlikely_attributes.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/make_char16t_char32t_string_literals_be_utf16_32.md b/lang/cpp20/make_char16t_char32t_string_literals_be_utf16_32.md index 69046036e2..6d28f5e090 100644 --- a/lang/cpp20/make_char16t_char32t_string_literals_be_utf16_32.md +++ b/lang/cpp20/make_char16t_char32t_string_literals_be_utf16_32.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/modules.md b/lang/cpp20/modules.md index 08c718408e..d1eade1b5a 100644 --- a/lang/cpp20/modules.md +++ b/lang/cpp20/modules.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/more_constexpr_containers.md b/lang/cpp20/more_constexpr_containers.md index b8d3fafa98..d6eb1a19e2 100644 --- a/lang/cpp20/more_constexpr_containers.md +++ b/lang/cpp20/more_constexpr_containers.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/nested_inline_mamespaces.md b/lang/cpp20/nested_inline_mamespaces.md index a7afbfdcf6..49c1dde459 100644 --- a/lang/cpp20/nested_inline_mamespaces.md +++ b/lang/cpp20/nested_inline_mamespaces.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/nodiscard_for_constructors.md b/lang/cpp20/nodiscard_for_constructors.md index 85ba40bd05..bd3a0a9799 100644 --- a/lang/cpp20/nodiscard_for_constructors.md +++ b/lang/cpp20/nodiscard_for_constructors.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/nodiscard_should_have_a_reason.md b/lang/cpp20/nodiscard_should_have_a_reason.md index e9d845f475..d50e28347a 100644 --- a/lang/cpp20/nodiscard_should_have_a_reason.md +++ b/lang/cpp20/nodiscard_should_have_a_reason.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/permit_conversions_to_arrays_of_unknown_bound.md b/lang/cpp20/permit_conversions_to_arrays_of_unknown_bound.md index 1bdd5244ed..61e5cf72cd 100644 --- a/lang/cpp20/permit_conversions_to_arrays_of_unknown_bound.md +++ b/lang/cpp20/permit_conversions_to_arrays_of_unknown_bound.md @@ -6,7 +6,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/permitting_trivial_default_initialization_in_constexpr_contexts.md b/lang/cpp20/permitting_trivial_default_initialization_in_constexpr_contexts.md index d3567af8a8..2a6192d39d 100644 --- a/lang/cpp20/permitting_trivial_default_initialization_in_constexpr_contexts.md +++ b/lang/cpp20/permitting_trivial_default_initialization_in_constexpr_contexts.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/predefined_macros.md b/lang/cpp20/predefined_macros.md index e1ba995986..698a7dc3d8 100644 --- a/lang/cpp20/predefined_macros.md +++ b/lang/cpp20/predefined_macros.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/prohibit_aggregates_with_user-declared_constructors.md b/lang/cpp20/prohibit_aggregates_with_user-declared_constructors.md index dad12cf5dc..2a995d1ff3 100644 --- a/lang/cpp20/prohibit_aggregates_with_user-declared_constructors.md +++ b/lang/cpp20/prohibit_aggregates_with_user-declared_constructors.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/range-based_for_statements_with_initializer.md b/lang/cpp20/range-based_for_statements_with_initializer.md index a717559109..02e7dcd7de 100644 --- a/lang/cpp20/range-based_for_statements_with_initializer.md +++ b/lang/cpp20/range-based_for_statements_with_initializer.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/reference_capture_of_structured_bindings.md b/lang/cpp20/reference_capture_of_structured_bindings.md index 0606597210..51656fbbe1 100644 --- a/lang/cpp20/reference_capture_of_structured_bindings.md +++ b/lang/cpp20/reference_capture_of_structured_bindings.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/relaxing_the_range_for_loop_customization_point_finding_rules.md b/lang/cpp20/relaxing_the_range_for_loop_customization_point_finding_rules.md index f7af4f4bc3..f24a6e3009 100644 --- a/lang/cpp20/relaxing_the_range_for_loop_customization_point_finding_rules.md +++ b/lang/cpp20/relaxing_the_range_for_loop_customization_point_finding_rules.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/relaxing_the_structured_bindings_customization_point_finding_rules.md b/lang/cpp20/relaxing_the_structured_bindings_customization_point_finding_rules.md index 62c18ce2ac..a9ff87a99b 100644 --- a/lang/cpp20/relaxing_the_structured_bindings_customization_point_finding_rules.md +++ b/lang/cpp20/relaxing_the_structured_bindings_customization_point_finding_rules.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/remove_deprecated_nothrow_exception_specification.md b/lang/cpp20/remove_deprecated_nothrow_exception_specification.md index bab8f2cf8f..088f25b9a6 100644 --- a/lang/cpp20/remove_deprecated_nothrow_exception_specification.md +++ b/lang/cpp20/remove_deprecated_nothrow_exception_specification.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/reserving_attribute_namespaces_for_future_use.md b/lang/cpp20/reserving_attribute_namespaces_for_future_use.md index 652bab43c1..fdaead292c 100644 --- a/lang/cpp20/reserving_attribute_namespaces_for_future_use.md +++ b/lang/cpp20/reserving_attribute_namespaces_for_future_use.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/resolving_const_mismatch_with_defaulted_copy_constructor.md b/lang/cpp20/resolving_const_mismatch_with_defaulted_copy_constructor.md index 558609396a..11ba585ac9 100644 --- a/lang/cpp20/resolving_const_mismatch_with_defaulted_copy_constructor.md +++ b/lang/cpp20/resolving_const_mismatch_with_defaulted_copy_constructor.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/signed_integers_are_twos_complement.md b/lang/cpp20/signed_integers_are_twos_complement.md index b8f277cf66..d8360109f0 100644 --- a/lang/cpp20/signed_integers_are_twos_complement.md +++ b/lang/cpp20/signed_integers_are_twos_complement.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/simplifying_implicit_lambda_capture.md b/lang/cpp20/simplifying_implicit_lambda_capture.md index 2adf847c89..7470fc3714 100644 --- a/lang/cpp20/simplifying_implicit_lambda_capture.md +++ b/lang/cpp20/simplifying_implicit_lambda_capture.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/try-catch_blocks_in_constexpr_functions.md b/lang/cpp20/try-catch_blocks_in_constexpr_functions.md index 390f029ff3..82881aead4 100644 --- a/lang/cpp20/try-catch_blocks_in_constexpr_functions.md +++ b/lang/cpp20/try-catch_blocks_in_constexpr_functions.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/update_the_reference_to_the_unicode_standard.md b/lang/cpp20/update_the_reference_to_the_unicode_standard.md index 37ea70aefe..c4368c534c 100644 --- a/lang/cpp20/update_the_reference_to_the_unicode_standard.md +++ b/lang/cpp20/update_the_reference_to_the_unicode_standard.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/using_enum.md b/lang/cpp20/using_enum.md index f484e57a1b..7121649931 100644 --- a/lang/cpp20/using_enum.md +++ b/lang/cpp20/using_enum.md @@ -6,7 +6,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/va_opt.md b/lang/cpp20/va_opt.md index 5b23670201..96d19e56f2 100644 --- a/lang/cpp20/va_opt.md +++ b/lang/cpp20/va_opt.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp20/wording_for_lambdas_in_unevaluated_contexts.md b/lang/cpp20/wording_for_lambdas_in_unevaluated_contexts.md index 73d50d05e1..4a220551d2 100644 --- a/lang/cpp20/wording_for_lambdas_in_unevaluated_contexts.md +++ b/lang/cpp20/wording_for_lambdas_in_unevaluated_contexts.md @@ -5,7 +5,7 @@ このページはC++20に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md b/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md index b08bfdd8db..50f00f7b5d 100644 --- a/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md +++ b/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md @@ -5,7 +5,7 @@ このページはC++23に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp23/attributes_on_lambda_expressions.md b/lang/cpp23/attributes_on_lambda_expressions.md index 2f6f162d77..7ef22e2362 100644 --- a/lang/cpp23/attributes_on_lambda_expressions.md +++ b/lang/cpp23/attributes_on_lambda_expressions.md @@ -5,7 +5,7 @@ このページはC++23に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp23/character_encoding_of_diagnostic_text.md b/lang/cpp23/character_encoding_of_diagnostic_text.md index 31dbb98bdf..07c4ded971 100644 --- a/lang/cpp23/character_encoding_of_diagnostic_text.md +++ b/lang/cpp23/character_encoding_of_diagnostic_text.md @@ -5,7 +5,7 @@ このページはC++23に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp23/class_template_argument_deduction_from_inherited.md b/lang/cpp23/class_template_argument_deduction_from_inherited.md index b6f22acbe7..2e59fab64b 100644 --- a/lang/cpp23/class_template_argument_deduction_from_inherited.md +++ b/lang/cpp23/class_template_argument_deduction_from_inherited.md @@ -5,7 +5,7 @@ このページはC++23に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp23/consistent_character_literal_encoding.md b/lang/cpp23/consistent_character_literal_encoding.md index 716d42ac26..6e935b573c 100644 --- a/lang/cpp23/consistent_character_literal_encoding.md +++ b/lang/cpp23/consistent_character_literal_encoding.md @@ -5,7 +5,7 @@ このページはC++23に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp23/consteval_needs_to_propagate_up.md b/lang/cpp23/consteval_needs_to_propagate_up.md index 135fdb0377..e3f7c3327f 100644 --- a/lang/cpp23/consteval_needs_to_propagate_up.md +++ b/lang/cpp23/consteval_needs_to_propagate_up.md @@ -5,7 +5,7 @@ このページはC++23に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp23/delimited_escape_sequences.md b/lang/cpp23/delimited_escape_sequences.md index 667cb89c44..ce5ff8f594 100644 --- a/lang/cpp23/delimited_escape_sequences.md +++ b/lang/cpp23/delimited_escape_sequences.md @@ -5,7 +5,7 @@ このページはC++23に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp23/down_with_lambda_parens.md b/lang/cpp23/down_with_lambda_parens.md index d34ff34e32..d5b20422ff 100644 --- a/lang/cpp23/down_with_lambda_parens.md +++ b/lang/cpp23/down_with_lambda_parens.md @@ -5,7 +5,7 @@ このページはC++23に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md b/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md index 524a3aef6d..484797e3e4 100644 --- a/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md +++ b/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md @@ -5,7 +5,7 @@ このページはC++23に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp23/feature_test_macros.md b/lang/cpp23/feature_test_macros.md index e1dfe85931..ced7f4e36f 100644 --- a/lang/cpp23/feature_test_macros.md +++ b/lang/cpp23/feature_test_macros.md @@ -5,7 +5,7 @@ このページはC++23に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp23/generalized_wording_for_partial_specializations.md b/lang/cpp23/generalized_wording_for_partial_specializations.md index 2c0a54ae72..8a8bd8ffa7 100644 --- a/lang/cpp23/generalized_wording_for_partial_specializations.md +++ b/lang/cpp23/generalized_wording_for_partial_specializations.md @@ -5,7 +5,7 @@ このページはC++23に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp23/if_consteval.md b/lang/cpp23/if_consteval.md index 2a4dde12c8..7d8d7baae9 100644 --- a/lang/cpp23/if_consteval.md +++ b/lang/cpp23/if_consteval.md @@ -5,7 +5,7 @@ このページはC++23に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp23/labels_at_the_end_of_compound_statements.md b/lang/cpp23/labels_at_the_end_of_compound_statements.md index fcad6a6af4..f61bdd74b5 100644 --- a/lang/cpp23/labels_at_the_end_of_compound_statements.md +++ b/lang/cpp23/labels_at_the_end_of_compound_statements.md @@ -5,7 +5,7 @@ このページはC++23に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp23/lifetime_extension_in_range_based_for_loop.md b/lang/cpp23/lifetime_extension_in_range_based_for_loop.md index e3ec776887..7e3e11524f 100644 --- a/lang/cpp23/lifetime_extension_in_range_based_for_loop.md +++ b/lang/cpp23/lifetime_extension_in_range_based_for_loop.md @@ -6,7 +6,7 @@ このページはC++23に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp23/literal_suffix_for_signed_size_t.md b/lang/cpp23/literal_suffix_for_signed_size_t.md index e61c985643..a18ee9fd81 100644 --- a/lang/cpp23/literal_suffix_for_signed_size_t.md +++ b/lang/cpp23/literal_suffix_for_signed_size_t.md @@ -5,7 +5,7 @@ このページはC++23に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp23/make_declaration_order_layout_mandated.md b/lang/cpp23/make_declaration_order_layout_mandated.md index 22d80f2604..1a663fa84a 100644 --- a/lang/cpp23/make_declaration_order_layout_mandated.md +++ b/lang/cpp23/make_declaration_order_layout_mandated.md @@ -5,7 +5,7 @@ このページはC++23に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp23/meaningful_exports.md b/lang/cpp23/meaningful_exports.md index 3313123f35..b4961a5c26 100644 --- a/lang/cpp23/meaningful_exports.md +++ b/lang/cpp23/meaningful_exports.md @@ -5,7 +5,7 @@ このページはC++23に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp23/mixed_string_literal_concatenation.md b/lang/cpp23/mixed_string_literal_concatenation.md index b647b464cf..852d6d4ab4 100644 --- a/lang/cpp23/mixed_string_literal_concatenation.md +++ b/lang/cpp23/mixed_string_literal_concatenation.md @@ -5,7 +5,7 @@ このページはC++23に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp23/multidimensional_subscript_operator.md b/lang/cpp23/multidimensional_subscript_operator.md index ff6bf8e98f..4d85b0a39b 100644 --- a/lang/cpp23/multidimensional_subscript_operator.md +++ b/lang/cpp23/multidimensional_subscript_operator.md @@ -5,7 +5,7 @@ このページはC++23に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp23/named_universal_character_escapes.md b/lang/cpp23/named_universal_character_escapes.md index 0efb58be20..2feee22a62 100644 --- a/lang/cpp23/named_universal_character_escapes.md +++ b/lang/cpp23/named_universal_character_escapes.md @@ -5,7 +5,7 @@ このページはC++23に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp23/narrowing_contextual_conversions_to_bool.md b/lang/cpp23/narrowing_contextual_conversions_to_bool.md index b3ce704c2b..36e45e7129 100644 --- a/lang/cpp23/narrowing_contextual_conversions_to_bool.md +++ b/lang/cpp23/narrowing_contextual_conversions_to_bool.md @@ -5,7 +5,7 @@ このページはC++23に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp23/non_literal_variables_in_constexpr_functions.md b/lang/cpp23/non_literal_variables_in_constexpr_functions.md index 94c9498636..e60b206085 100644 --- a/lang/cpp23/non_literal_variables_in_constexpr_functions.md +++ b/lang/cpp23/non_literal_variables_in_constexpr_functions.md @@ -5,7 +5,7 @@ このページはC++23に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md b/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md index a1bacee1bd..86f3ac78ad 100644 --- a/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md +++ b/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md @@ -5,7 +5,7 @@ このページはC++23に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp23/portable_assumptions.md b/lang/cpp23/portable_assumptions.md index 5e011eec58..e80c8e4ed9 100644 --- a/lang/cpp23/portable_assumptions.md +++ b/lang/cpp23/portable_assumptions.md @@ -5,7 +5,7 @@ このページはC++23に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp23/predefined_macros.md b/lang/cpp23/predefined_macros.md index 9dbe36de1a..1e18baedd8 100644 --- a/lang/cpp23/predefined_macros.md +++ b/lang/cpp23/predefined_macros.md @@ -5,7 +5,7 @@ このページはC++23に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp23/relaxing_some_constexpr_restrictions.md b/lang/cpp23/relaxing_some_constexpr_restrictions.md index 28be60df05..0dc0ed1524 100644 --- a/lang/cpp23/relaxing_some_constexpr_restrictions.md +++ b/lang/cpp23/relaxing_some_constexpr_restrictions.md @@ -5,7 +5,7 @@ このページはC++23に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md b/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md index bd96605421..d983554ab5 100644 --- a/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md +++ b/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md @@ -5,7 +5,7 @@ このページはC++23に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp23/simpler_implicit_move.md b/lang/cpp23/simpler_implicit_move.md index b1359bab92..71b40f5709 100644 --- a/lang/cpp23/simpler_implicit_move.md +++ b/lang/cpp23/simpler_implicit_move.md @@ -5,7 +5,7 @@ このページはC++23に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp23/static_operator.md b/lang/cpp23/static_operator.md index 90d62ff87d..d2a1b7262e 100644 --- a/lang/cpp23/static_operator.md +++ b/lang/cpp23/static_operator.md @@ -5,7 +5,7 @@ このページはC++23に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp23/support_for_utf8_as_a_portable_source_file_encoding.md b/lang/cpp23/support_for_utf8_as_a_portable_source_file_encoding.md index 5ecc79c7bd..8457251863 100644 --- a/lang/cpp23/support_for_utf8_as_a_portable_source_file_encoding.md +++ b/lang/cpp23/support_for_utf8_as_a_portable_source_file_encoding.md @@ -5,7 +5,7 @@ このページはC++23に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp23/trimming_whitespaces_before_line_splicing.md b/lang/cpp23/trimming_whitespaces_before_line_splicing.md index 1901ad5e6e..5f97c4768a 100644 --- a/lang/cpp23/trimming_whitespaces_before_line_splicing.md +++ b/lang/cpp23/trimming_whitespaces_before_line_splicing.md @@ -5,7 +5,7 @@ このページはC++23に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp23/update_normative_reference_to_posix.md b/lang/cpp23/update_normative_reference_to_posix.md index a37bbae126..605bdfc9d1 100644 --- a/lang/cpp23/update_normative_reference_to_posix.md +++ b/lang/cpp23/update_normative_reference_to_posix.md @@ -5,7 +5,7 @@ このページはC++23に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp23/warning.md b/lang/cpp23/warning.md index 4575a076d8..fdc8f98fa1 100644 --- a/lang/cpp23/warning.md +++ b/lang/cpp23/warning.md @@ -5,7 +5,7 @@ このページはC++23に採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/lang/cpp26/user-generated_static_assert_messages.md b/lang/cpp26/user-generated_static_assert_messages.md index 76eb694c38..89b2aa3cb1 100644 --- a/lang/cpp26/user-generated_static_assert_messages.md +++ b/lang/cpp26/user-generated_static_assert_messages.md @@ -5,7 +5,7 @@ このページはC++26に採用される見込みの言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 diff --git a/start_editing/lang_template_page.md b/start_editing/lang_template_page.md index 0e8d24234d..212d17556d 100644 --- a/start_editing/lang_template_page.md +++ b/start_editing/lang_template_page.md @@ -36,7 +36,7 @@ このページはC++XXに採用された言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 @@ -47,7 +47,7 @@ このページはC++26に採用される見込みの言語機能の変更を解説しています。 -のちのC++規格でさらに変更される場合があるため[関連項目](#relative_page)を参照してください。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 From d837379c34e50fca26968cbe45c42a0747a2b8fc Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Mon, 8 Jul 2024 19:34:18 +0900 Subject: [PATCH 1027/3948] =?UTF-8?q?linalg=20:=20symmetric=5Fmatrix=5Fpro?= =?UTF-8?q?duct=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 2 +- reference/linalg/symmetric_matrix_product.md | 365 +++++++++++++++++++ 2 files changed, 366 insertions(+), 1 deletion(-) create mode 100644 reference/linalg/symmetric_matrix_product.md diff --git a/reference/linalg.md b/reference/linalg.md index 35f8c95eb9..7f1d16ae52 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -99,7 +99,7 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`matrix_product`](linalg/matrix_product.md) | xGEMM: 2つの一般行列の積を求める (function template) | C++26 | -| `symmetric_matrix_product` | xSYMM: 対称行列と行列の積を求める (function template) | C++26 | +| [`symmetric_matrix_product`](linalg/symmetric_matrix_product.md) | xSYMM: 対称行列と行列の積を求める (function template) | C++26 | | `hermitian_matrix_product` | xHEMM: ハミルトニアン行列と行列の積を求める (function template) | C++26 | | `triangular_matrix_product` | xTRMM: 三角行列と行列の積を求める (function template) | C++26 | | `triangular_matrix_left_product` | xTRMM: In-placeに三角行列と行列の積を求める (function template) | C++26 | diff --git a/reference/linalg/symmetric_matrix_product.md b/reference/linalg/symmetric_matrix_product.md new file mode 100644 index 0000000000..4928b2465d --- /dev/null +++ b/reference/linalg/symmetric_matrix_product.md @@ -0,0 +1,365 @@ +# symmetric_matrix_product + + +* [mathjax enable] +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + + +```cpp +namespace std::linalg { + template + void symmetric_matrix_product( + InMat1 A, + Triangle t, + InMat2 B, + OutMat C); // (1) + + template + void symmetric_matrix_product( + ExecutionPolicy&& exec, + InMat1 A, + Triangle t, + InMat2 B, + OutMat C); // (2) + + template + void symmetric_matrix_product( + InMat1 A, + InMat2 B, + Triangle t, + OutMat C); // (3) + + template + void symmetric_matrix_product( + ExecutionPolicy&& exec, + InMat1 A, + InMat2 B, + Triangle t, + OutMat C); // (4) + + template + void symmetric_matrix_product( + InMat1 A, + Triangle t, + InMat2 B, + InMat3 E, + OutMat C); // (5) + + template + void symmetric_matrix_product( + ExecutionPolicy&& exec, + InMat1 A, + Triangle t, + InMat2 B, + InMat3 E, + OutMat C); // (6) + + template + void symmetric_matrix_product( + InMat1 A, + InMat2 B, + Triangle t, + InMat3 E, + OutMat C); // (7) + + template + void symmetric_matrix_product( + ExecutionPolicy&& exec, + InMat1 A, + InMat2 B, + Triangle t, + InMat3 E, + OutMat C); // (8) +} +``` + + +## 概要 +行列同士の積を計算する。 + +- (1): 三角行列`A`と行列`B`に対し、$C \leftarrow AB$ +- (2): (1)を指定された実行ポリシーで実行する。 +- (3): 行列`A`と三角行列`B`に対し、$C \leftarrow AB$ +- (4): (3)を指定された実行ポリシーで実行する。 +- (5): 三角行列`A`と行列`B`に対し、$C \leftarrow E + AB$ +- (6): (5)を指定された実行ポリシーで実行する。 +- (7): 行列`A`と三角行列`B`に対し、$C \leftarrow E + AB$ +- (8): (7)を指定された実行ポリシーで実行する。 + + +## 適格要件 +- 共通 + + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) + + [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` +- (1), (2), (5), (6): `InMat1`(`A`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 +- (1), (2), (5), (6): [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) +- (3), (4), (7), (8): `InMat2`(`B`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 +- (3), (4), (7), (8): [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`B`が正方行列であること) +- (5), (6), (7), (8): [`possibly-addable`](possibly-addable.md)`()`が`true` + + +## 事前条件 +- 共通 + + [`multipliable`](multipliable.md)`(A, B, C) == true` +- (1), (2), (5), (6): [`A.extent(0) == A.extent(1)`] +- (3), (4), (7), (8): [`B.extent(0) == B.extent(1)`] +- (5), (6), (7), (8): [`addable`](addable.md)`(E, E, C) == true` + + +## 効果 +- (1), (2): 三角行列`A`と行列`B`に対し、$C \leftarrow AB$ +- (3), (4): 行列`A`と三角行列`B`に対し、$C \leftarrow AB$ +- (5), (6): 三角行列`A`と行列`B`に対し、$C \leftarrow E + AB$ +- (7), (8): 行列`A`と三角行列`B`に対し、$C \leftarrow E + AB$ + + +## 戻り値 +なし + + +## 計算量 +$O(\verb|A.extent(0)| \times \verb|A.extent(1)| \times \verb|B.extent(1)|)$ + + +## 備考 +- (5), (6), (7), (8): `C`に`E`を入れても良い。 + + +## 例 +**[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** + +```cpp example +#include +#include +#include +#include +#include + +template +void print_mat(const Matrix& A) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = 0; j < A.extent(1) - 1; ++j) { + std::cout << A[i, j] << ' '; + } + std::cout << A[i, A.extent(1) - 1] << '\n'; + } +} + +template +void init_mat(Matrix& A, typename Matrix::value_type geta = 1) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = 0; j < A.extent(1); ++j) { + A[i, j] = i * A.extent(1) + j + geta; + } + } +} + +template +void init_symm_mat(Matrix& A) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = i; j < A.extent(1); ++j) { + A[i, j] = i * A.extent(1) + j; + } + } +} + +int main() +{ + constexpr size_t N = 2; + + std::vector A_vec(N * N); + std::vector B_vec(N * N); + std::vector C_vec(N * N); + std::vector E_vec(N * N); + + std::mdspan C(C_vec.data(), N, N); + std::mdspan E(E_vec.data(), N, N); + + init_mat(E, N * N); + + { + std::mdspan< + double, + std::extents, + std::linalg::layout_blas_packed< + std::linalg::upper_triangle_t, + std::linalg::row_major_t> + > A(A_vec.data()); + std::mdspan B(B_vec.data(), N, N); + + init_symm_mat(A); + init_mat(B); + + // (1) + std::cout << "(1)\n"; + std::linalg::symmetric_matrix_product(A, std::linalg::upper_triangle, B, C); + print_mat(C); + + // (2) + std::cout << "(2)\n"; + std::linalg::symmetric_matrix_product(std::execution::par, A, std::linalg::upper_triangle, B, C); + print_mat(C); + } + + { + std::mdspan A(A_vec.data(), N, N); + std::mdspan< + double, + std::extents, + std::linalg::layout_blas_packed< + std::linalg::upper_triangle_t, + std::linalg::row_major_t> + > B(B_vec.data()); + + init_mat(A); + init_symm_mat(B); + + // (3) + std::cout << "(3)\n"; + std::linalg::symmetric_matrix_product(A, B, std::linalg::upper_triangle, C); + print_mat(C); + + // (4) + std::cout << "(4)\n"; + std::linalg::symmetric_matrix_product(std::execution::par, A, B, std::linalg::upper_triangle, C); + print_mat(C); + } + + { + std::mdspan< + double, + std::extents, + std::linalg::layout_blas_packed< + std::linalg::upper_triangle_t, + std::linalg::row_major_t> + > A(A_vec.data()); + std::mdspan B(B_vec.data(), N, N); + + init_symm_mat(A); + init_mat(B); + + // (5) + std::cout << "(5)\n"; + std::linalg::symmetric_matrix_product(A, std::linalg::upper_triangle, B, E, C); + print_mat(C); + + // (6) + std::cout << "(6)\n"; + std::linalg::symmetric_matrix_product(std::execution::par, A, std::linalg::upper_triangle, B, E, C); + print_mat(C); + } + + { + std::mdspan A(A_vec.data(), N, N); + std::mdspan< + double, + std::extents, + std::linalg::layout_blas_packed< + std::linalg::upper_triangle_t, + std::linalg::row_major_t> + > B(B_vec.data()); + + init_mat(A); + init_symm_mat(B); + + // (7) + std::cout << "(7)\n"; + std::linalg::symmetric_matrix_product(A, B, std::linalg::upper_triangle, E, C); + print_mat(C); + + // (8) + std::cout << "(8)\n"; + std::linalg::symmetric_matrix_product(std::execution::par, A, B, std::linalg::upper_triangle, E, C); + print_mat(C); + } + + return 0; +} +``` + + +### 出力 +``` +(1) +7 8 +11 16 +(2) +7 8 +11 16 +(3) +5 8 +11 18 +(4) +5 8 +11 18 +(5) +11 13 +17 23 +(6) +11 13 +17 23 +(7) +9 13 +17 25 +(8) +9 13 +17 25 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution`](/reference/execution.md) +- [`mdspan`](/reference/mdspan.md) +- [`upper_triangle_t`](upper_triangle_t.md) +- [`lower_triangle_t`](lower_triangle_t.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) +- [LAPACK: {he,sy}mm: Hermitian/symmetric matrix-matrix multiply](https://netlib.org/lapack/explore-html/d0/d16/group__hemm.html) From eefba0f990e13b10ca9512973deb3f2cda889d73 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Tue, 9 Jul 2024 15:05:05 +0900 Subject: [PATCH 1028/3948] =?UTF-8?q?linalg=20:=20=E4=B8=89=E8=A7=92?= =?UTF-8?q?=E8=A1=8C=E5=88=97=E3=82=92=E5=AF=BE=E7=A7=B0=E8=A1=8C=E5=88=97?= =?UTF-8?q?=E3=81=AB=E4=BF=AE=E6=AD=A3=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/symmetric_matrix_product.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/reference/linalg/symmetric_matrix_product.md b/reference/linalg/symmetric_matrix_product.md index 4928b2465d..ecd5e66d5c 100644 --- a/reference/linalg/symmetric_matrix_product.md +++ b/reference/linalg/symmetric_matrix_product.md @@ -112,13 +112,13 @@ namespace std::linalg { ## 概要 行列同士の積を計算する。 -- (1): 三角行列`A`と行列`B`に対し、$C \leftarrow AB$ +- (1): 対称行列`A`と行列`B`に対し、$C \leftarrow AB$ - (2): (1)を指定された実行ポリシーで実行する。 -- (3): 行列`A`と三角行列`B`に対し、$C \leftarrow AB$ +- (3): 行列`A`と対称行列`B`に対し、$C \leftarrow AB$ - (4): (3)を指定された実行ポリシーで実行する。 -- (5): 三角行列`A`と行列`B`に対し、$C \leftarrow E + AB$ +- (5): 対称行列`A`と行列`B`に対し、$C \leftarrow E + AB$ - (6): (5)を指定された実行ポリシーで実行する。 -- (7): 行列`A`と三角行列`B`に対し、$C \leftarrow E + AB$ +- (7): 行列`A`と対称行列`B`に対し、$C \leftarrow E + AB$ - (8): (7)を指定された実行ポリシーで実行する。 @@ -142,10 +142,10 @@ namespace std::linalg { ## 効果 -- (1), (2): 三角行列`A`と行列`B`に対し、$C \leftarrow AB$ -- (3), (4): 行列`A`と三角行列`B`に対し、$C \leftarrow AB$ -- (5), (6): 三角行列`A`と行列`B`に対し、$C \leftarrow E + AB$ -- (7), (8): 行列`A`と三角行列`B`に対し、$C \leftarrow E + AB$ +- (1), (2): 対称行列`A`と行列`B`に対し、$C \leftarrow AB$ +- (3), (4): 行列`A`と対称行列`B`に対し、$C \leftarrow AB$ +- (5), (6): 対称行列`A`と行列`B`に対し、$C \leftarrow E + AB$ +- (7), (8): 行列`A`と対称行列`B`に対し、$C \leftarrow E + AB$ ## 戻り値 From 048b96e30b240aedbf7eb809dbb31cad25a4a28d Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Tue, 9 Jul 2024 15:50:42 +0900 Subject: [PATCH 1029/3948] =?UTF-8?q?linalg=20:=20hermitian=5Fmartix=5Fpro?= =?UTF-8?q?duct=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 2 +- reference/linalg/hermitian_matrix_product.md | 353 +++++++++++++++++++ 2 files changed, 354 insertions(+), 1 deletion(-) create mode 100644 reference/linalg/hermitian_matrix_product.md diff --git a/reference/linalg.md b/reference/linalg.md index 7f1d16ae52..25a51569d6 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -100,7 +100,7 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に |------|------|----------------| | [`matrix_product`](linalg/matrix_product.md) | xGEMM: 2つの一般行列の積を求める (function template) | C++26 | | [`symmetric_matrix_product`](linalg/symmetric_matrix_product.md) | xSYMM: 対称行列と行列の積を求める (function template) | C++26 | -| `hermitian_matrix_product` | xHEMM: ハミルトニアン行列と行列の積を求める (function template) | C++26 | +| [`hermitian_matrix_product`](linalg/hermitian_matrix_product.md) | xHEMM: ハミルトニアン行列と行列の積を求める (function template) | C++26 | | `triangular_matrix_product` | xTRMM: 三角行列と行列の積を求める (function template) | C++26 | | `triangular_matrix_left_product` | xTRMM: In-placeに三角行列と行列の積を求める (function template) | C++26 | | `triangular_matrix_right_product` | xTRMM: In-placeに三角行列と行列の積を求める (function template) | C++26 | diff --git a/reference/linalg/hermitian_matrix_product.md b/reference/linalg/hermitian_matrix_product.md new file mode 100644 index 0000000000..d19cdc911e --- /dev/null +++ b/reference/linalg/hermitian_matrix_product.md @@ -0,0 +1,353 @@ +# hermitian_matrix_product + + +* [mathjax enable] +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + + +```cpp +namespace std::linalg { + template + void hermitian_matrix_product( + InMat1 A, + Triangle t, + InMat2 B, + OutMat C); // (1) + + template + void hermitian_matrix_product( + ExecutionPolicy&& exec, + InMat1 A, + Triangle t, + InMat2 B, + OutMat C); // (2) + + template + void hermitian_matrix_product( + InMat1 A, + InMat2 B, + Triangle t, + OutMat C); // (3) + + template + void hermitian_matrix_product( + ExecutionPolicy&& exec, + InMat1 A, + InMat2 B, + Triangle t, + OutMat C); // (4) + + template + void hermitian_matrix_product( + InMat1 A, + Triangle t, + InMat2 B, + InMat3 E, + OutMat C); // (5) + + template + void hermitian_matrix_product( + ExecutionPolicy&& exec, + InMat1 A, + Triangle t, + InMat2 B, + InMat3 E, + OutMat C); // (6) + + template + void hermitian_matrix_product( + InMat1 A, + InMat2 B, + Triangle t, + InMat3 E, + OutMat C); // (7) + + template + void hermitian_matrix_product( + ExecutionPolicy&& exec, + InMat1 A, + InMat2 B, + Triangle t, + InMat3 E, + OutMat C); // (8) +} +``` + + +## 概要 +行列同士の積を計算する。 + +- (1): エルミート行列`A`と行列`B`に対し、$C \leftarrow AB$ +- (2): (1)を指定された実行ポリシーで実行する。 +- (3): 行列`A`とエルミート行列`B`に対し、$C \leftarrow AB$ +- (4): (3)を指定された実行ポリシーで実行する。 +- (5): エルミート行列`A`と行列`B`に対し、$C \leftarrow E + AB$ +- (6): (5)を指定された実行ポリシーで実行する。 +- (7): 行列`A`とエルミート行列`B`に対し、$C \leftarrow E + AB$ +- (8): (7)を指定された実行ポリシーで実行する。 + + +## 適格要件 +- 共通 + + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) + + [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` +- (1), (2), (5), (6): `InMat1`(`A`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 +- (1), (2), (5), (6): [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) +- (3), (4), (7), (8): `InMat2`(`B`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 +- (3), (4), (7), (8): [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`B`が正方行列であること) +- (5), (6), (7), (8): [`possibly-addable`](possibly-addable.md)`()`が`true` + + +## 事前条件 +- 共通 + + [`multipliable`](multipliable.md)`(A, B, C) == true` +- (1), (2), (5), (6): [`A.extent(0) == A.extent(1)`] +- (3), (4), (7), (8): [`B.extent(0) == B.extent(1)`] +- (5), (6), (7), (8): [`addable`](addable.md)`(E, E, C) == true` + + +## 効果 +- (1), (2): エルミート行列`A`と行列`B`に対し、$C \leftarrow AB$ +- (3), (4): 行列`A`とエルミート行列`B`に対し、$C \leftarrow AB$ +- (5), (6): エルミート行列`A`と行列`B`に対し、$C \leftarrow E + AB$ +- (7), (8): 行列`A`とエルミート行列`B`に対し、$C \leftarrow E + AB$ + + +## 戻り値 +なし + + +## 計算量 +$O(\verb|A.extent(0)| \times \verb|A.extent(1)| \times \verb|B.extent(1)|)$ + + +## 備考 +- (5), (6), (7), (8): `C`に`E`を入れても良い。 + + +## 例 +**[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** + +```cpp example +#include +#include +#include +#include +#include +#include + +template +void print_mat(const Matrix& A) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = 0; j < A.extent(1) - 1; ++j) { + std::cout << A[i, j] << ' '; + } + std::cout << A[i, A.extent(1) - 1] << '\n'; + } +} + +template +void init_mat(Matrix& A, typename Matrix::value_type geta = 0) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = 0; j < A.extent(1); ++j) { + A[i, j] = std::complex(i + geta, j + geta); + } + } +} + +template +void init_herm_mat(Matrix& A) { + for(int i = 0; i < A.extent(0); ++i) { + A[i, i] = std::complex(i, 0); + for(int j = i + 1; j < A.extent(1); ++j) { + A[i, j] = std::complex(i, j); + } + } +} + +int main() +{ + constexpr size_t N = 2; + + using Scalar = std::complex; + using Vector = std::vector; + using HermitianMatrix = std::mdspan< + Scalar, + std::extents, + std::linalg::layout_blas_packed< + std::linalg::upper_triangle_t, + std::linalg::row_major_t> + >; + + Vector A_vec(N * N); + Vector B_vec(N * N); + Vector C_vec(N * N); + Vector E_vec(N * N); + + std::mdspan C(C_vec.data(), N, N); + std::mdspan E(E_vec.data(), N, N); + + init_mat(E, N * N); + + { + HermitianMatrix A(A_vec.data()); + std::mdspan B(B_vec.data(), N, N); + + init_herm_mat(A); + init_mat(B); + + // (1) + std::cout << "(1)\n"; + std::linalg::hermitian_matrix_product(A, std::linalg::upper_triangle, B, C); + print_mat(C); + + // (2) + std::cout << "(2)\n"; + std::linalg::hermitian_matrix_product(std::execution::par, A, std::linalg::upper_triangle, B, C); + print_mat(C); + } + + { + std::mdspan A(A_vec.data(), N, N); + HermitianMatrix B(B_vec.data()); + + init_mat(A); + init_herm_mat(B); + + // (3) + std::cout << "(3)\n"; + std::linalg::hermitian_matrix_product(A, B, std::linalg::upper_triangle, C); + print_mat(C); + + // (4) + std::cout << "(4)\n"; + std::linalg::hermitian_matrix_product(std::execution::par, A, B, std::linalg::upper_triangle, C); + print_mat(C); + } + + { + HermitianMatrix A(A_vec.data()); + std::mdspan B(B_vec.data(), N, N); + + init_herm_mat(A); + init_mat(B); + + // (5) + std::cout << "(5)\n"; + std::linalg::hermitian_matrix_product(A, std::linalg::upper_triangle, B, E, C); + print_mat(C); + + // (6) + std::cout << "(6)\n"; + std::linalg::hermitian_matrix_product(std::execution::par, A, std::linalg::upper_triangle, B, E, C); + print_mat(C); + } + + { + std::mdspan A(A_vec.data(), N, N); + HermitianMatrix B(B_vec.data()); + + init_mat(A); + init_herm_mat(B); + + // (7) + std::cout << "(7)\n"; + std::linalg::hermitian_matrix_product(A, B, std::linalg::upper_triangle, E, C); + print_mat(C); + + // (8) + std::cout << "(8)\n"; + std::linalg::hermitian_matrix_product(std::execution::par, A, B, std::linalg::upper_triangle, E, C); + print_mat(C); + } + + return 0; +} +``` + + +### 出力 +``` +(1) +(0,1) (-1,1) +(1,0) (2,1) +(2) +(0,1) (-1,1) +(1,0) (2,1) +(3) +(0,-1) (1,0) +(0,-3) (3,2) +(4) +(0,-1) (1,0) +(0,-3) (3,2) +(5) +(4,5) (3,6) +(6,4) (7,6) +(6) +(4,5) (3,6) +(6,4) (7,6) +(7) +(4,3) (5,5) +(5,1) (8,7) +(8) +(4,3) (5,5) +(5,1) (8,7) +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution`](/reference/execution.md) +- [`mdspan`](/reference/mdspan.md) +- [`upper_triangle_t`](upper_triangle_t.md) +- [`lower_triangle_t`](lower_triangle_t.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) +- [LAPACK: {he,sy}mm: Hermitian/hermitian matrix-matrix multiply](https://netlib.org/lapack/explore-html/d0/d16/group__hemm.html) From a6e4d8dcb2e239e73d93f6936cadb5e8beb27060 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Tue, 9 Jul 2024 15:51:13 +0900 Subject: [PATCH 1030/3948] =?UTF-8?q?linalg=20:=20=E4=BE=8B=E3=81=A7`#incl?= =?UTF-8?q?ude=20`=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/hermitian_matrix_rank_1_update.md | 1 + reference/linalg/hermitian_matrix_rank_2_update.md | 1 + 2 files changed, 2 insertions(+) diff --git a/reference/linalg/hermitian_matrix_rank_1_update.md b/reference/linalg/hermitian_matrix_rank_1_update.md index b1df1f3c1c..3486d4f860 100644 --- a/reference/linalg/hermitian_matrix_rank_1_update.md +++ b/reference/linalg/hermitian_matrix_rank_1_update.md @@ -97,6 +97,7 @@ $O((\verb|x.extent(0)|)^2)$ ```cpp example #include +#include #include #include #include diff --git a/reference/linalg/hermitian_matrix_rank_2_update.md b/reference/linalg/hermitian_matrix_rank_2_update.md index 620e977c1c..6841357c87 100644 --- a/reference/linalg/hermitian_matrix_rank_2_update.md +++ b/reference/linalg/hermitian_matrix_rank_2_update.md @@ -71,6 +71,7 @@ $O(\verb|x.extent(0)| \times \verb|y.extent(0)|)$ ```cpp example #include +#include #include #include #include From c9baae05b0020e86402d504f20d5c461dd77fecd Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Wed, 10 Jul 2024 14:51:42 +0900 Subject: [PATCH 1031/3948] =?UTF-8?q?linalg=20:=20triangular=5Fmatrix=5Fpr?= =?UTF-8?q?oduct=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 誤植を修正 Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 4 +- reference/linalg/triangular_matrix_product.md | 421 ++++++++++++++++++ 2 files changed, 423 insertions(+), 2 deletions(-) create mode 100644 reference/linalg/triangular_matrix_product.md diff --git a/reference/linalg.md b/reference/linalg.md index 25a51569d6..34306408cb 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -50,7 +50,7 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に | `ExecutionPolicy` | `is_execution_policy::value == true` | | `Real` | `complex`が規定できる型 | | `Triangle` | `upper_triangle_t`または`lower_triangle_t` | -| `DiagonalStorage` | `implicit_unit_diagonal_t`または`implicit_unit_diagonal_t` | +| `DiagonalStorage` | `implicit_unit_diagonal_t`または`explicit_diagonal_t` | ## BLAS 1アルゴリズム @@ -101,7 +101,7 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に | [`matrix_product`](linalg/matrix_product.md) | xGEMM: 2つの一般行列の積を求める (function template) | C++26 | | [`symmetric_matrix_product`](linalg/symmetric_matrix_product.md) | xSYMM: 対称行列と行列の積を求める (function template) | C++26 | | [`hermitian_matrix_product`](linalg/hermitian_matrix_product.md) | xHEMM: ハミルトニアン行列と行列の積を求める (function template) | C++26 | -| `triangular_matrix_product` | xTRMM: 三角行列と行列の積を求める (function template) | C++26 | +| [`triangular_matrix_product`](linalg/triangular_matrix_product.md) | xTRMM: 三角行列と行列の積を求める (function template) | C++26 | | `triangular_matrix_left_product` | xTRMM: In-placeに三角行列と行列の積を求める (function template) | C++26 | | `triangular_matrix_right_product` | xTRMM: In-placeに三角行列と行列の積を求める (function template) | C++26 | | `symmetric_matrix_rank_k_update` | xSYRK: 対称行列のRank-k更新 (function template) | C++26 | diff --git a/reference/linalg/triangular_matrix_product.md b/reference/linalg/triangular_matrix_product.md new file mode 100644 index 0000000000..b644a7de9c --- /dev/null +++ b/reference/linalg/triangular_matrix_product.md @@ -0,0 +1,421 @@ +# triangular_matrix_product + + +* [mathjax enable] +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + + +```cpp +namespace std::linalg { + template + void triangular_matrix_product( + InMat1 A, + Triangle t, + DiagonalStorage d, + InMat2 B, + OutMat C); // (1) + + template + void triangular_matrix_product( + ExecutionPolicy&& exec, + InMat1 A, + Triangle t, + DiagonalStorage d, + InMat2 B, + OutMat C); // (2) + + template + void triangular_matrix_product( + InMat1 A, + InMat2 B, + Triangle t, + DiagonalStorage d, + OutMat C); // (3) + + template + void triangular_matrix_product( + ExecutionPolicy&& exec, + InMat1 A, + InMat2 B, + Triangle t, + DiagonalStorage d, + OutMat C); // (4) + + template + void triangular_matrix_product( + InMat1 A, + Triangle t, + DiagonalStorage d, + InMat2 B, + InMat3 E, + OutMat C); // (5) + + template + void triangular_matrix_product( + ExecutionPolicy&& exec, + InMat1 A, + Triangle t, + DiagonalStorage d, + InMat2 B, + InMat3 E, + OutMat C); // (6) + + template + void triangular_matrix_product( + InMat1 A, + InMat2 B, + Triangle t, + DiagonalStorage d, + InMat3 E, + OutMat C); // (7) + + template + void triangular_matrix_product( + ExecutionPolicy&& exec, + InMat1 A, + InMat2 B, + Triangle t, + DiagonalStorage d, + InMat3 E, + OutMat C); // (8) +} +``` + + +## 概要 +三角行列と行列の積を計算する。 + +- (1): 三角行列`A`と行列`B`に対し、$C \leftarrow AB$ +- (2): (1)を指定された実行ポリシーで実行する。 +- (3): 行列`A`と三角行列`B`に対し、$C \leftarrow AB$ +- (4): (3)を指定された実行ポリシーで実行する。 +- (5): 三角行列`A`と行列`B`に対し、$C \leftarrow E + AB$ +- (6): (5)を指定された実行ポリシーで実行する。 +- (7): 行列`A`と三角行列`B`に対し、$C \leftarrow E + AB$ +- (8): (7)を指定された実行ポリシーで実行する。 + + +## 適格要件 +- 共通 + + `DiagonalStorage`が[`implicit_unit_diagonal_t`](implicit_unit_diagonal_t.md)または[`explicit_diagonal_t`](explicit_diagonal_t.md) + + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) + + [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` +- (1), (2), (5), (6): + + `InMat1`(`A`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) +- (3), (4), (7), (8): + + `InMat2`(`B`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`B`が正方行列であること) +- (5), (6), (7), (8): [`possibly-addable`](possibly-addable.md)`()`が`true` +- (2), (4), (6), (8): `is_execution_policy::value`が`true` + + +## 事前条件 +- 共通 + + [`multipliable`](multipliable.md)`(A, B, C) == true` +- (1), (2), (5), (6): [`A.extent(0) == A.extent(1)`] +- (3), (4), (7), (8): [`B.extent(0) == B.extent(1)`] +- (5), (6), (7), (8): [`addable`](addable.md)`(E, E, C) == true` + + +## 効果 +- (1), (2): 三角行列`A`と行列`B`に対し、$C \leftarrow AB$ +- (3), (4): 行列`A`と三角行列`B`に対し、$C \leftarrow AB$ +- (5), (6): 三角行列`A`と行列`B`に対し、$C \leftarrow E + AB$ +- (7), (8): 行列`A`と三角行列`B`に対し、$C \leftarrow E + AB$ + + +## 戻り値 +なし + + +## 計算量 +$O(\verb|A.extent(0)| \times \verb|A.extent(1)| \times \verb|B.extent(1)|)$ + + +## 備考 +- (5), (6), (7), (8): `C`に`E`を入れても良い。 + + +## 例 +**[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** + +```cpp example +#include +#include +#include +#include +#include + +template +void print_mat(const Matrix& A) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = 0; j < A.extent(1) - 1; ++j) { + std::cout << A[i, j] << ' '; + } + std::cout << A[i, A.extent(1) - 1] << '\n'; + } +} + +template +void init_mat(Matrix& A, typename Matrix::value_type geta = 1) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = 0; j < A.extent(1); ++j) { + A[i, j] = i * A.extent(1) + j + geta; + } + } +} + +template +void init_tria_mat(Matrix& A) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = i + 1; j < A.extent(1); ++j) { + A[i, j] = i * A.extent(1) + j; + } + } +} + +int main() +{ + constexpr size_t N = 2; + + using Scalar = double; + using Vector = std::vector; + using TriangularMatrix = std::mdspan< + Scalar, + std::extents, + std::linalg::layout_blas_packed< + std::linalg::upper_triangle_t, + std::linalg::row_major_t> + >; + + Vector A_vec(N * N); + Vector B_vec(N * N); + Vector C_vec(N * N); + Vector E_vec(N * N); + + std::mdspan C(C_vec.data(), N, N); + std::mdspan E(E_vec.data(), N, N); + + init_mat(E, N * N); + + { + TriangularMatrix A(A_vec.data()); + std::mdspan B(B_vec.data(), N, N); + + init_tria_mat(A); + init_mat(B); + + // (1) + std::cout << "(1)\n"; + std::linalg::triangular_matrix_product( + A, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + B, + C); + print_mat(C); + + // (2) + std::cout << "(2)\n"; + std::linalg::triangular_matrix_product( + std::execution::par, + A, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + B, + C); + print_mat(C); + } + + { + std::mdspan A(A_vec.data(), N, N); + TriangularMatrix B(B_vec.data()); + + init_mat(A); + init_tria_mat(B); + + // (3) + std::cout << "(3)\n"; + std::linalg::triangular_matrix_product( + A, + B, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + C); + print_mat(C); + + // (4) + std::cout << "(4)\n"; + std::linalg::triangular_matrix_product( + std::execution::par, + A, + B, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + C); + print_mat(C); + } + + { + TriangularMatrix A(A_vec.data()); + std::mdspan B(B_vec.data(), N, N); + + init_tria_mat(A); + init_mat(B); + + // (5) + std::cout << "(5)\n"; + std::linalg::triangular_matrix_product( + A, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + B, + E, + C); + print_mat(C); + + // (6) + std::cout << "(6)\n"; + std::linalg::triangular_matrix_product( + std::execution::par, + A, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + B, + E, + C); + print_mat(C); + } + + { + std::mdspan A(A_vec.data(), N, N); + TriangularMatrix B(B_vec.data()); + + init_mat(A); + init_tria_mat(B); + + // (7) + std::cout << "(7)\n"; + std::linalg::triangular_matrix_product( + A, + B, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + E, + C); + print_mat(C); + + // (8) + std::cout << "(8)\n"; + std::linalg::triangular_matrix_product( + std::execution::par, + A, + B, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + E, + C); + print_mat(C); + } + + return 0; +} +``` + + +### 出力 +``` +(1) +4 6 +3 4 +(2) +4 6 +3 4 +(3) +1 3 +3 7 +(4) +1 3 +3 7 +(5) +8 11 +9 11 +(6) +8 11 +9 11 +(7) +5 8 +9 14 +(8) +5 8 +9 14 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution`](/reference/execution.md) +- [`mdspan`](/reference/mdspan.md) +- [`upper_triangle_t`](upper_triangle_t.md) +- [`lower_triangle_t`](lower_triangle_t.md) +- [`implicit_unit_diagonal_t`](implicit_unit_diagonal_t.md) +- [`explicit_diagonal_t`](explicit_diagonal_t.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) +- [LAPACK: trmm: triangular matrix-matrix multiply](https://netlib.org/lapack/explore-html/dd/dab/group__trmm.html) From 2d887fe2f05e5d98c46395de2754a9ea07dd69fe Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Wed, 10 Jul 2024 15:01:47 +0900 Subject: [PATCH 1032/3948] =?UTF-8?q?linalg=20:=20=E7=90=86=E8=A7=A3?= =?UTF-8?q?=E3=81=97=E3=82=84=E3=81=99=E3=81=84=E3=82=88=E3=81=86=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/hermitian_matrix_product.md | 20 +++--- reference/linalg/symmetric_matrix_product.md | 70 ++++++++------------ 2 files changed, 40 insertions(+), 50 deletions(-) diff --git a/reference/linalg/hermitian_matrix_product.md b/reference/linalg/hermitian_matrix_product.md index d19cdc911e..654029134d 100644 --- a/reference/linalg/hermitian_matrix_product.md +++ b/reference/linalg/hermitian_matrix_product.md @@ -110,7 +110,7 @@ namespace std::linalg { ## 概要 -行列同士の積を計算する。 +エルミート行列と行列の積を計算する。 - (1): エルミート行列`A`と行列`B`に対し、$C \leftarrow AB$ - (2): (1)を指定された実行ポリシーで実行する。 @@ -126,10 +126,12 @@ namespace std::linalg { - 共通 + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) + [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` -- (1), (2), (5), (6): `InMat1`(`A`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 -- (1), (2), (5), (6): [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) -- (3), (4), (7), (8): `InMat2`(`B`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 -- (3), (4), (7), (8): [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`B`が正方行列であること) +- (1), (2), (5), (6): + + `InMat1`(`A`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) +- (3), (4), (7), (8): + + `InMat2`(`B`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`B`が正方行列であること) - (5), (6), (7), (8): [`possibly-addable`](possibly-addable.md)`()`が`true` @@ -226,7 +228,7 @@ int main() { HermitianMatrix A(A_vec.data()); - std::mdspan B(B_vec.data(), N, N); + std::mdspan B(B_vec.data(), N, N); init_herm_mat(A); init_mat(B); @@ -243,7 +245,7 @@ int main() } { - std::mdspan A(A_vec.data(), N, N); + std::mdspan A(A_vec.data(), N, N); HermitianMatrix B(B_vec.data()); init_mat(A); @@ -262,7 +264,7 @@ int main() { HermitianMatrix A(A_vec.data()); - std::mdspan B(B_vec.data(), N, N); + std::mdspan B(B_vec.data(), N, N); init_herm_mat(A); init_mat(B); @@ -279,7 +281,7 @@ int main() } { - std::mdspan A(A_vec.data(), N, N); + std::mdspan A(A_vec.data(), N, N); HermitianMatrix B(B_vec.data()); init_mat(A); diff --git a/reference/linalg/symmetric_matrix_product.md b/reference/linalg/symmetric_matrix_product.md index ecd5e66d5c..6fbd57b8b5 100644 --- a/reference/linalg/symmetric_matrix_product.md +++ b/reference/linalg/symmetric_matrix_product.md @@ -110,7 +110,7 @@ namespace std::linalg { ## 概要 -行列同士の積を計算する。 +対称行列と行列の積を計算する。 - (1): 対称行列`A`と行列`B`に対し、$C \leftarrow AB$ - (2): (1)を指定された実行ポリシーで実行する。 @@ -126,10 +126,12 @@ namespace std::linalg { - 共通 + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) + [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` -- (1), (2), (5), (6): `InMat1`(`A`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 -- (1), (2), (5), (6): [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) -- (3), (4), (7), (8): `InMat2`(`B`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 -- (3), (4), (7), (8): [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`B`が正方行列であること) +- (1), (2), (5), (6): + + `InMat1`(`A`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) +- (3), (4), (7), (8): + + `InMat2`(`B`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`B`が正方行列であること) - (5), (6), (7), (8): [`possibly-addable`](possibly-addable.md)`()`が`true` @@ -202,10 +204,20 @@ int main() { constexpr size_t N = 2; - std::vector A_vec(N * N); - std::vector B_vec(N * N); - std::vector C_vec(N * N); - std::vector E_vec(N * N); + using Scalar = double; + using Vector = std::vector; + using SymmetricMatrix = std::mdspan< + Scalar, + std::extents, + std::linalg::layout_blas_packed< + std::linalg::upper_triangle_t, + std::linalg::row_major_t> + >; + + Vector A_vec(N * N); + Vector B_vec(N * N); + Vector C_vec(N * N); + Vector E_vec(N * N); std::mdspan C(C_vec.data(), N, N); std::mdspan E(E_vec.data(), N, N); @@ -213,14 +225,8 @@ int main() init_mat(E, N * N); { - std::mdspan< - double, - std::extents, - std::linalg::layout_blas_packed< - std::linalg::upper_triangle_t, - std::linalg::row_major_t> - > A(A_vec.data()); - std::mdspan B(B_vec.data(), N, N); + SymmetricMatrix A(A_vec.data()); + std::mdspan B(B_vec.data(), N, N); init_symm_mat(A); init_mat(B); @@ -237,14 +243,8 @@ int main() } { - std::mdspan A(A_vec.data(), N, N); - std::mdspan< - double, - std::extents, - std::linalg::layout_blas_packed< - std::linalg::upper_triangle_t, - std::linalg::row_major_t> - > B(B_vec.data()); + std::mdspan A(A_vec.data(), N, N); + SymmetricMatrix B(B_vec.data()); init_mat(A); init_symm_mat(B); @@ -261,14 +261,8 @@ int main() } { - std::mdspan< - double, - std::extents, - std::linalg::layout_blas_packed< - std::linalg::upper_triangle_t, - std::linalg::row_major_t> - > A(A_vec.data()); - std::mdspan B(B_vec.data(), N, N); + SymmetricMatrix A(A_vec.data()); + std::mdspan B(B_vec.data(), N, N); init_symm_mat(A); init_mat(B); @@ -285,14 +279,8 @@ int main() } { - std::mdspan A(A_vec.data(), N, N); - std::mdspan< - double, - std::extents, - std::linalg::layout_blas_packed< - std::linalg::upper_triangle_t, - std::linalg::row_major_t> - > B(B_vec.data()); + std::mdspan A(A_vec.data(), N, N); + SymmetricMatrix B(B_vec.data()); init_mat(A); init_symm_mat(B); From b6e197f7d208dd061f63ab9f3be1b1ab45974d09 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Wed, 10 Jul 2024 15:46:47 +0900 Subject: [PATCH 1033/3948] =?UTF-8?q?linalg=20:=20ExecutionPolicy=E3=81=AE?= =?UTF-8?q?=E5=88=B6=E7=B4=84=E3=82=92=E6=98=8E=E6=96=87=E5=8C=96=20(#1233?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/add.md | 5 ++--- reference/linalg/apply_givens_rotation.md | 5 ++++- reference/linalg/copy.md | 4 ++-- reference/linalg/dot.md | 6 +++--- reference/linalg/dotc.md | 6 +++--- reference/linalg/hermitian_matrix_product.md | 1 + reference/linalg/hermitian_matrix_rank_1_update.md | 10 ++++++---- reference/linalg/hermitian_matrix_rank_2_update.md | 8 +++++--- reference/linalg/hermitian_matrix_vector_product.md | 1 + reference/linalg/matrix_frob_norm.md | 1 + reference/linalg/matrix_inf_norm.md | 1 + reference/linalg/matrix_one_norm.md | 1 + reference/linalg/matrix_product.md | 1 + reference/linalg/matrix_rank_1_update.md | 3 ++- reference/linalg/matrix_rank_1_update_c.md | 3 ++- reference/linalg/matrix_vector_product.md | 1 + reference/linalg/scale.md | 4 ++++ reference/linalg/setup_givens_rotation.md | 2 +- reference/linalg/setup_givens_rotation_result.md | 2 +- reference/linalg/swap_elements.md | 3 ++- reference/linalg/symmetric_matrix_product.md | 1 + reference/linalg/symmetric_matrix_rank_1_update.md | 10 ++++++---- reference/linalg/symmetric_matrix_rank_2_update.md | 9 +++++---- reference/linalg/symmetric_matrix_vector_product.md | 1 + reference/linalg/triangular_matrix_product.md | 2 +- reference/linalg/triangular_matrix_vector_product.md | 1 + reference/linalg/triangular_matrix_vector_solve.md | 1 + reference/linalg/vector_abs_sum.md | 1 + reference/linalg/vector_idx_abs_max.md | 1 + reference/linalg/vector_sum_of_squares.md | 3 ++- reference/linalg/vector_two_norm.md | 2 ++ 31 files changed, 66 insertions(+), 34 deletions(-) diff --git a/reference/linalg/add.md b/reference/linalg/add.md index 61c0489af3..d110d039be 100644 --- a/reference/linalg/add.md +++ b/reference/linalg/add.md @@ -42,9 +42,8 @@ $$ ## 適格要件 -行列またはベクトルの`x`、`y`、`z`の各次元の静的要素数が同じであること。 - -- [`possibly-addable`](possibly-addable.md)`() == true` +- (1), (2): [`possibly-addable`](possibly-addable.md)`()`が`true` (行列またはベクトルの`x`、`y`、`z`の各次元の静的要素数が同じ) +- (2): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` ## 事前条件 diff --git a/reference/linalg/apply_givens_rotation.md b/reference/linalg/apply_givens_rotation.md index d9c76b06ec..11ff401f73 100644 --- a/reference/linalg/apply_givens_rotation.md +++ b/reference/linalg/apply_givens_rotation.md @@ -72,7 +72,10 @@ $$ ## 適格要件 -- [`compatible-static-extents`](/reference/linalg/compatible-static-extents.md)`(0,0) == true` +- 共通: + + `Real`が`complex`を規定できる型であること + + [`compatible-static-extents`](/reference/linalg/compatible-static-extents.md)`(0,0) == true` +- (2), (4): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` ## 事前条件 diff --git a/reference/linalg/copy.md b/reference/linalg/copy.md index 6f9619c074..5863738090 100644 --- a/reference/linalg/copy.md +++ b/reference/linalg/copy.md @@ -34,8 +34,8 @@ namespace std::linalg { ## 適格要件 -- 0以上`x.rank()`未満の整数rに対して、[`compatible-static-extents`](/reference/linalg/compatible-static-extents.md)`(r,r)`が`true` - +- (1), (2): 0以上`x.rank()`未満の整数rに対して、[`compatible-static-extents`](/reference/linalg/compatible-static-extents.md)`(r,r)`が`true` +- (2): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` ## 事前条件 `x`と`y`の各次元の要素数が等しくなければならない。 diff --git a/reference/linalg/dot.md b/reference/linalg/dot.md index d5884d7976..8dea516866 100644 --- a/reference/linalg/dot.md +++ b/reference/linalg/dot.md @@ -44,9 +44,9 @@ namespace std::linalg { ## 適格要件 -2つのベクトルの静的な要素数が同じであること。 - -- [`compatible-static-extents`](compatible-static-extents.md)`(0, 0) == true` +- 共通: + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (2つのベクトルの静的な要素数が同じ) +- (2), (4): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` ## 事前条件 diff --git a/reference/linalg/dotc.md b/reference/linalg/dotc.md index 59efd533ae..1349e6d16d 100644 --- a/reference/linalg/dotc.md +++ b/reference/linalg/dotc.md @@ -44,9 +44,9 @@ namespace std::linalg { ## 適格要件 -2つのベクトルの静的な要素数が同じであること。 - -- [`compatible-static-extents`](compatible-static-extents.md)`(0, 0) == true` +- 共通: + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (2つのベクトルの静的な要素数が同じ) +- (2), (4): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` ## 事前条件 diff --git a/reference/linalg/hermitian_matrix_product.md b/reference/linalg/hermitian_matrix_product.md index 654029134d..cba4988bfd 100644 --- a/reference/linalg/hermitian_matrix_product.md +++ b/reference/linalg/hermitian_matrix_product.md @@ -133,6 +133,7 @@ namespace std::linalg { + `InMat2`(`B`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`B`が正方行列であること) - (5), (6), (7), (8): [`possibly-addable`](possibly-addable.md)`()`が`true` +- (2), (4), (6), (8): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` ## 事前条件 diff --git a/reference/linalg/hermitian_matrix_rank_1_update.md b/reference/linalg/hermitian_matrix_rank_1_update.md index 3486d4f860..446426dff8 100644 --- a/reference/linalg/hermitian_matrix_rank_1_update.md +++ b/reference/linalg/hermitian_matrix_rank_1_update.md @@ -64,10 +64,12 @@ namespace std::linalg { ## 適格要件 -- `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) -- `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 -- [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) -- [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (つまり`A`の次元と`x`の次元が同じであること) +- 共通: + + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) + + `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (つまり`A`の次元と`x`の次元が同じであること) +- (2), (4): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` ## 事前条件 diff --git a/reference/linalg/hermitian_matrix_rank_2_update.md b/reference/linalg/hermitian_matrix_rank_2_update.md index 6841357c87..624e82e2ed 100644 --- a/reference/linalg/hermitian_matrix_rank_2_update.md +++ b/reference/linalg/hermitian_matrix_rank_2_update.md @@ -44,9 +44,11 @@ namespace std::linalg { ## 適格要件 -- `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) -- `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 -- [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` +- 共通: + + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) + + `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + + [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` +- (2): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` ## 事前条件 diff --git a/reference/linalg/hermitian_matrix_vector_product.md b/reference/linalg/hermitian_matrix_vector_product.md index 650923eef8..1c8b85a455 100644 --- a/reference/linalg/hermitian_matrix_vector_product.md +++ b/reference/linalg/hermitian_matrix_vector_product.md @@ -76,6 +76,7 @@ namespace std::linalg { + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) + [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` - (3), (4): [`possibly-addable`](possibly-addable.md)`()`が`true` +- (2), (4): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` ## 事前条件 diff --git a/reference/linalg/matrix_frob_norm.md b/reference/linalg/matrix_frob_norm.md index f8f6cd64c8..544a175ec2 100644 --- a/reference/linalg/matrix_frob_norm.md +++ b/reference/linalg/matrix_frob_norm.md @@ -39,6 +39,7 @@ namespace std::linalg { ## 適格要件 - (1), (2): `decltype(init + `[`abs-if-needed`](abs-if-needed.md)`(declval()) * abs-if-needed(declval()))`が`Scalar`に変換可能。 +- (2), (4): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` ## 効果 - (3), (4): `T`を`decltype(abs-if-needed(declval()) * abs-if-needed(declval()))`とすると、 diff --git a/reference/linalg/matrix_inf_norm.md b/reference/linalg/matrix_inf_norm.md index 4d6b49f724..76844e8537 100644 --- a/reference/linalg/matrix_inf_norm.md +++ b/reference/linalg/matrix_inf_norm.md @@ -39,6 +39,7 @@ namespace std::linalg { ## 適格要件 - (1), (2): `decltype(`[`abs-if-needed`](abs-if-needed.md)`(declval()))`が`Scalar`に変換可能。 +- (2), (4): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` ## 効果 diff --git a/reference/linalg/matrix_one_norm.md b/reference/linalg/matrix_one_norm.md index 66ebffef01..a0cd520e9a 100644 --- a/reference/linalg/matrix_one_norm.md +++ b/reference/linalg/matrix_one_norm.md @@ -39,6 +39,7 @@ namespace std::linalg { ## 適格要件 - (1), (2): `decltype(`[`abs-if-needed`](abs-if-needed.md)`(declval()))`が`Scalar`に変換可能。 +- (2), (4): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` ## 効果 diff --git a/reference/linalg/matrix_product.md b/reference/linalg/matrix_product.md index 52adef9267..a42c9c6560 100644 --- a/reference/linalg/matrix_product.md +++ b/reference/linalg/matrix_product.md @@ -61,6 +61,7 @@ namespace std::linalg { ## 適格要件 - (1), (2), (3), (4): [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` - (3), (4): [`possibly-addable`](possibly-addable.md)`()`が`true` +- (2), (4): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` ## 事前条件 diff --git a/reference/linalg/matrix_rank_1_update.md b/reference/linalg/matrix_rank_1_update.md index 72770bced1..72497d418a 100644 --- a/reference/linalg/matrix_rank_1_update.md +++ b/reference/linalg/matrix_rank_1_update.md @@ -39,7 +39,8 @@ namespace std::linalg { ## 適格要件 -- [`possibly-multipliable`](possibly-multipliable.md)`() == true` +- (1), (2): [`possibly-multipliable`](possibly-multipliable.md)`() == true` +- (2): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` ## 事前条件 diff --git a/reference/linalg/matrix_rank_1_update_c.md b/reference/linalg/matrix_rank_1_update_c.md index 504c35a41e..c5cc655dfe 100644 --- a/reference/linalg/matrix_rank_1_update_c.md +++ b/reference/linalg/matrix_rank_1_update_c.md @@ -39,7 +39,8 @@ namespace std::linalg { ## 適格要件 -- [`possibly-multipliable`](possibly-multipliable.md)`() == true` +- (1), (2): [`possibly-multipliable`](possibly-multipliable.md)`() == true` +- (2): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` ## 事前条件 diff --git a/reference/linalg/matrix_vector_product.md b/reference/linalg/matrix_vector_product.md index 8c08e3b38c..0743dd73cc 100644 --- a/reference/linalg/matrix_vector_product.md +++ b/reference/linalg/matrix_vector_product.md @@ -61,6 +61,7 @@ namespace std::linalg { ## 適格要件 - (1), (2), (3), (4): [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` - (3), (4): [`possibly-addable`](possibly-addable.md)`()`が`true` +- (2), (4): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` ## 事前条件 diff --git a/reference/linalg/scale.md b/reference/linalg/scale.md index aab3496cd3..7ce8d8ca2b 100644 --- a/reference/linalg/scale.md +++ b/reference/linalg/scale.md @@ -32,6 +32,10 @@ $$ $$ +## 適格要件 +- (2): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` + + ## 効果 ベクトル`x`を`alpha`倍する。 diff --git a/reference/linalg/setup_givens_rotation.md b/reference/linalg/setup_givens_rotation.md index 3c6c8958e4..18c9bb4ac8 100644 --- a/reference/linalg/setup_givens_rotation.md +++ b/reference/linalg/setup_givens_rotation.md @@ -52,7 +52,7 @@ sgn(x):= $$ -## テンプレートパラメータ制約 +## 適格要件 - `Real`は`complex`が規定できる型であること。 diff --git a/reference/linalg/setup_givens_rotation_result.md b/reference/linalg/setup_givens_rotation_result.md index d921a230df..b38e24b361 100644 --- a/reference/linalg/setup_givens_rotation_result.md +++ b/reference/linalg/setup_givens_rotation_result.md @@ -26,7 +26,7 @@ namespace std::linalg { ギブンス回転の結果を表すクラス。詳しくは、[`setup_givens_rotation`](setup_givens_rotation.md)にて。 -## テンプレートパラメータ制約 +## 適格要件 - `Real`は`complex`が規定できる型であること。 diff --git a/reference/linalg/swap_elements.md b/reference/linalg/swap_elements.md index f878975996..4fc87ae70b 100644 --- a/reference/linalg/swap_elements.md +++ b/reference/linalg/swap_elements.md @@ -34,7 +34,8 @@ namespace std::linalg { ## 適格要件 -- 0以上`x.rank()`未満の整数rに対して、[`compatible-static-extents`](/reference/linalg/compatible-static-extents.md)`(r,r)`が`true` +- (1), (2): 0以上`x.rank()`未満の整数rに対して、[`compatible-static-extents`](/reference/linalg/compatible-static-extents.md)`(r,r)`が`true` +- (2): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` ## 事前条件 diff --git a/reference/linalg/symmetric_matrix_product.md b/reference/linalg/symmetric_matrix_product.md index 6fbd57b8b5..46a826621f 100644 --- a/reference/linalg/symmetric_matrix_product.md +++ b/reference/linalg/symmetric_matrix_product.md @@ -133,6 +133,7 @@ namespace std::linalg { + `InMat2`(`B`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`B`が正方行列であること) - (5), (6), (7), (8): [`possibly-addable`](possibly-addable.md)`()`が`true` +- (2), (4), (6), (8): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` ## 事前条件 diff --git a/reference/linalg/symmetric_matrix_rank_1_update.md b/reference/linalg/symmetric_matrix_rank_1_update.md index 52cc757f23..25c297b643 100644 --- a/reference/linalg/symmetric_matrix_rank_1_update.md +++ b/reference/linalg/symmetric_matrix_rank_1_update.md @@ -64,10 +64,12 @@ namespace std::linalg { ## 適格要件 -- `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) -- `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 -- [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) -- [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (つまり`A`の次元と`x`の次元が同じであること) +- 共通: + + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) + + `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (つまり`A`の次元と`x`の次元が同じであること) +- (2), (4): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` ## 事前条件 diff --git a/reference/linalg/symmetric_matrix_rank_2_update.md b/reference/linalg/symmetric_matrix_rank_2_update.md index 32255bfd56..045c2f1910 100644 --- a/reference/linalg/symmetric_matrix_rank_2_update.md +++ b/reference/linalg/symmetric_matrix_rank_2_update.md @@ -44,10 +44,11 @@ namespace std::linalg { ## 適格要件 -- `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) -- `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 -- [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` - +- 共通: + + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) + + `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + + [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` +- (2): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` ## 事前条件 - `A.extent(0) == A.extent(1)` diff --git a/reference/linalg/symmetric_matrix_vector_product.md b/reference/linalg/symmetric_matrix_vector_product.md index aa39fc3287..ebf381b849 100644 --- a/reference/linalg/symmetric_matrix_vector_product.md +++ b/reference/linalg/symmetric_matrix_vector_product.md @@ -76,6 +76,7 @@ namespace std::linalg { + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) + [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` - (3), (4): [`possibly-addable`](possibly-addable.md)`()`が`true` +- (2), (4): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` ## 事前条件 diff --git a/reference/linalg/triangular_matrix_product.md b/reference/linalg/triangular_matrix_product.md index b644a7de9c..f6febd6485 100644 --- a/reference/linalg/triangular_matrix_product.md +++ b/reference/linalg/triangular_matrix_product.md @@ -150,7 +150,7 @@ namespace std::linalg { + `InMat2`(`B`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`B`が正方行列であること) - (5), (6), (7), (8): [`possibly-addable`](possibly-addable.md)`()`が`true` -- (2), (4), (6), (8): `is_execution_policy::value`が`true` +- (2), (4), (6), (8): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` ## 事前条件 diff --git a/reference/linalg/triangular_matrix_vector_product.md b/reference/linalg/triangular_matrix_vector_product.md index d6b7b77fdd..98b73fef04 100644 --- a/reference/linalg/triangular_matrix_vector_product.md +++ b/reference/linalg/triangular_matrix_vector_product.md @@ -111,6 +111,7 @@ namespace std::linalg { + [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (つまり`A`の次元と`y`の次元が同じであること) - (1), (2), (5), (6): [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (つまり`A`の次元と`x`の次元が同じであること) - (5), (6): [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (つまり`A`の次元と`x`の次元が同じであること) +- (2), (4), (6): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` ## 事前条件 diff --git a/reference/linalg/triangular_matrix_vector_solve.md b/reference/linalg/triangular_matrix_vector_solve.md index 837e31526a..89fbdf5e68 100644 --- a/reference/linalg/triangular_matrix_vector_solve.md +++ b/reference/linalg/triangular_matrix_vector_solve.md @@ -141,6 +141,7 @@ namespace std::linalg { + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) + [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (つまり`A`の次元と`b`の次元が同じであること) - (1), (2), (3), (4): [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (つまり`A`の次元と`b`の次元が同じであること) +- (2), (4), (6), (8): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` ## 事前条件 diff --git a/reference/linalg/vector_abs_sum.md b/reference/linalg/vector_abs_sum.md index de6983f762..837a368333 100644 --- a/reference/linalg/vector_abs_sum.md +++ b/reference/linalg/vector_abs_sum.md @@ -38,6 +38,7 @@ namespace std::linalg { ## 適格要件 - (1), (2): `decltype(init + `[`abs-if-needed`](abs-if-needed.md)`(`[`real-if-needed`](real-if-needed.md)`(declval())) + abs-if-needed(`[`imag-if-needed`](imag-if-needed.md)`(declval())))`が`Scalar`に変換可能。 +- (2), (4): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` ## 効果 - (3), (4): `T`を`typename InVec::value_type`とすると、 diff --git a/reference/linalg/vector_idx_abs_max.md b/reference/linalg/vector_idx_abs_max.md index 85a8f153b7..87b5300fc0 100644 --- a/reference/linalg/vector_idx_abs_max.md +++ b/reference/linalg/vector_idx_abs_max.md @@ -27,6 +27,7 @@ namespace std::linalg { ## 適格要件 - (1), (2): `T`を`decltype(`[`abs-if-needed`](abs-if-needed.md)`(`[`real-if-needed`](real-if-needed.md)`(declval())) + abs-if-needed(`[`imag-if-needed`](imag-if-needed.md)`(declval())))`とすると、`declval() < declval()`が有効な式であること。 +- (2): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` ## 戻り値 diff --git a/reference/linalg/vector_sum_of_squares.md b/reference/linalg/vector_sum_of_squares.md index 880f3fd967..98ed9076e9 100644 --- a/reference/linalg/vector_sum_of_squares.md +++ b/reference/linalg/vector_sum_of_squares.md @@ -44,7 +44,8 @@ $$ ## 適格要件 -- `decltype(`[`abs-if-needed`](abs-if-needed.md)`(declval()))`が`Scalar`に変換可能。 +- (1), (2): `decltype(`[`abs-if-needed`](abs-if-needed.md)`(declval()))`が`Scalar`に変換可能。 +- (2): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` ## 効果 diff --git a/reference/linalg/vector_two_norm.md b/reference/linalg/vector_two_norm.md index 8d6c1c939f..1178dc20cc 100644 --- a/reference/linalg/vector_two_norm.md +++ b/reference/linalg/vector_two_norm.md @@ -38,6 +38,8 @@ namespace std::linalg { ## 適格要件 - (1), (2): `decltype(init + `[`abs-if-needed`](abs-if-needed.md)`(declval()) * abs-if-needed(declval()))`が`Scalar`に変換可能。 +- (2), (4): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` + ## 効果 - (3), (4): `T`を`decltype(abs-if-needed(declval()) * abs-if-needed(declval()))`とすると、 From 164e997afe208a6460ea6baba2d5ef566a04b0a0 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 10 Jul 2024 16:47:57 +0900 Subject: [PATCH 1034/3948] =?UTF-8?q?=E8=A8=80=E8=AA=9E=E6=A9=9F=E8=83=BD?= =?UTF-8?q?=20:=20=E3=83=9A=E3=83=BC=E3=82=B8=E5=90=8D=E3=82=92=E3=82=8F?= =?UTF-8?q?=E3=81=8B=E3=82=8A=E3=82=84=E3=81=99=E3=81=8F=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E8=A6=8B=E7=9B=B4=E3=81=97=20#1276?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 18 +++++++++--------- lang/cpp11.md | 6 +++--- lang/cpp11/auto.md | 4 ++-- lang/cpp11/constexpr.md | 10 +++++----- lang/cpp11/decltype.md | 4 ++-- lang/cpp11/right_angle_brackets.md | 4 ++-- lang/cpp11/unrestricted_unions.md | 4 ++-- lang/cpp14.md | 2 +- lang/cpp14/feature_test_macros.md | 4 ++-- .../cpp14/relaxing_constraints_on_constexpr.md | 4 ++-- lang/cpp17.md | 6 +++--- lang/cpp17/feature_test_macros.md | 4 ++-- .../generalizing_the_range-based_for_loop.md | 4 ++-- lang/cpp17/hexadecimal_floating_literals.md | 4 ++-- ...for_auto_deduction_from_braced-init-list.md | 4 ++-- lang/cpp20.md | 4 ++-- lang/cpp20/consistent_comparison.md | 4 ++-- lang/cpp20/feature_test_macros.md | 6 +++--- lang/cpp20/immediate_functions.md | 4 ++-- lang/cpp23/consteval_needs_to_propagate_up.md | 4 ++-- lang/cpp23/if_consteval.md | 4 ++-- .../lexicographical_compare_three_way.md | 4 ++-- reference/algorithm/sort.md | 2 +- reference/compare.md | 2 +- .../compare/common_comparison_category.md | 2 +- .../compare/compare_partial_order_fallback.md | 2 +- .../compare/compare_strong_order_fallback.md | 2 +- reference/compare/compare_three_way.md | 2 +- reference/compare/compare_three_way/op_call.md | 2 +- reference/compare/compare_three_way_result.md | 2 +- .../compare/compare_weak_order_fallback.md | 2 +- .../compare/named_comparison_functions.md | 4 ++-- reference/compare/partial_order.md | 2 +- reference/compare/partial_ordering.md | 4 ++-- .../partial_ordering/op_compare_3way.md | 4 ++-- reference/compare/partial_ordering/op_equal.md | 4 ++-- .../compare/partial_ordering/op_greater.md | 4 ++-- .../partial_ordering/op_greater_equal.md | 4 ++-- reference/compare/partial_ordering/op_less.md | 4 ++-- .../compare/partial_ordering/op_less_equal.md | 4 ++-- .../compare/partial_ordering/op_not_equal.md | 4 ++-- reference/compare/strong_order.md | 2 +- reference/compare/strong_ordering.md | 2 +- .../compare/strong_ordering/op_compare_3way.md | 4 ++-- reference/compare/strong_ordering/op_equal.md | 4 ++-- .../compare/strong_ordering/op_greater.md | 4 ++-- .../strong_ordering/op_greater_equal.md | 4 ++-- reference/compare/strong_ordering/op_less.md | 4 ++-- .../compare/strong_ordering/op_less_equal.md | 4 ++-- .../compare/strong_ordering/op_not_equal.md | 4 ++-- reference/compare/three_way_comparable.md | 2 +- reference/compare/weak_order.md | 2 +- reference/compare/weak_ordering.md | 2 +- .../compare/weak_ordering/op_compare_3way.md | 4 ++-- reference/compare/weak_ordering/op_equal.md | 4 ++-- reference/compare/weak_ordering/op_greater.md | 4 ++-- .../compare/weak_ordering/op_greater_equal.md | 4 ++-- reference/compare/weak_ordering/op_less.md | 4 ++-- .../compare/weak_ordering/op_less_equal.md | 4 ++-- .../compare/weak_ordering/op_not_equal.md | 4 ++-- reference/map/map.md | 2 +- reference/source_location/source_location.md | 2 +- .../source_location/source_location/current.md | 2 +- 63 files changed, 120 insertions(+), 120 deletions(-) diff --git a/implementation-status.md b/implementation-status.md index d13c7277f4..c2dcdce470 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -16,7 +16,7 @@ |----------------------------------|------|-----|-------|-----|------| | N2341: [`alignas`](/lang/cpp11/alignas.md) | アライメント指定 | 4.8 | 3.0 | 15.0 | 2015
2003あるいはそれ以前からある`__declspec(align(x))`構文で代替可能。 | | N2341: [`alignof`](/lang/cpp11/alignof.md) | アライメント取得 | 4.5 | 3.3 | 15.0 | 2015
2003あるいはそれ以前よりある`__alignof`で代替可能。 | -| N1984: [`auto`](/lang/cpp11/auto.md) | 型推論 | 4.4 | 2.9 | 12.0 | 2010 | +| N1984: [変数の型推論のためのauto](/lang/cpp11/auto.md) | 型推論 | 4.4 | 2.9 | 12.0 | 2010 | | N2343: [`decltype`](/lang/cpp11/decltype.md) | 式の型を取得 | 4.3 | 2.9 | 13.0 | 2010 (partial)
2012 | | N1653: C99互換のプリプロセッサ | [可変引数マクロ](/lang/cpp11/variadic_macros.md)、[Pragma演算子](/lang/cpp11/pragma_operator.md)、[`__func__`](/lang/cpp11/func.md) | 4.3 | 2.9 | 11.1 | 2005 (partial): 可変引数のみ `_Pragma`の代わりに`__pragma`が存在する。
2019 Update 6 | | N2235: [`constexpr`](/lang/cpp11/constexpr.md) | 定数式 | 4.6 | 3.1 | 13.0 (partial)
14.0 | 2015 (partial)
2015 Update 1 | @@ -36,13 +36,13 @@ | N2765: [ユーザー定義リテラル](/lang/cpp11/user_defined_literals.md) | リテラルのサフィックスをユーザー定義する | 4.7 | 3.1 | 15.0 | 2015 | | N2541: [戻り値の型を後置する関数宣言構文](/lang/cpp11/trailing_return_types.md) | 以下のような形式での関数宣言
`auto f(arg_types...) -> return_type` | 4.4 | 2.9 | 12.0 | 2010 | | N2431: [`nullptr`](/lang/cpp11/nullptr.md) | ヌルポインタを表すポインタリテラル | 4.6 | 3.0 | 11.1 | 2010 | -| N1757: [テンプレートの右山カッコ](/lang/cpp11/right_angle_brackets.md) | `vector>`のように、`>>`をスペースを空けずに記述可能にする | 4.3 | 2.9 | 11.1 | 2005 | +| N1757: [テンプレートでの連続した右山カッコを許可](/lang/cpp11/right_angle_brackets.md) | `vector>`のように、`>>`をスペースを空けずに記述可能にする | 4.3 | 2.9 | 11.1 | 2005 | | N2118: [右辺値参照・ムーブセマンティクス](/lang/cpp11/rvalue_ref_and_move_semantics.md) | 右辺値によるオーバーロード、およびそれによるリソースの所有権移動 | 4.3 (partial)
4.6 | 2.9 | 12.0 | 2010 (partial) ムーブコンストラクタと代入演算子の暗黙定義に対応していない。
2015 | | N1720: [コンパイル時アサート](/lang/cpp11/static_assert.md) | コンパイル時に条件式が真であることを表明する | 4.3 | 2.9 | 11.1 | 2010 | | N2347: [`enum`の先行宣言](/lang/cpp11/scoped_enum.md#extended-unscoped-enum) | | 4.6 | 3.1 | 11.1 (partial)
14.0 | 2012 | | N2347: [スコープを持つ列挙型](/lang/cpp11/scoped_enum.md) | 強い型付けとスコープを持つ列挙型 | 4.4 | 2.9 | 11.1 (partial)
14.0 | 2012 | | N2258: [エイリアステンプレート](/lang/cpp11/alias_templates.md) | テンプレートによって型の別名を定義する | 4.7 | 3.0 | 12.1 | 2013 | -| N2544: [共用体の制限解除](/lang/cpp11/unrestricted_unions.md) | 共用体のメンバ変数として、クラスオブジェクトを持つ | 4.6 | 3.1 | 14.0(Linux系OSおよびMacのみ。Windowsは非対応) | 2015 | +| N2544: [共用体でクラスオブジェクトをもつことを許可](/lang/cpp11/unrestricted_unions.md) | 共用体のメンバ変数として、クラスオブジェクトを持つ | 4.6 | 3.1 | 14.0(Linux系OSおよびMacのみ。Windowsは非対応) | 2015 | | N2242: [可変引数テンプレート](/lang/cpp11/variadic_templates.md) | 任意の数のテンプレートパラメータを受け取れるようにする | 4.3 (partial)
4.4 | 2.9 | 12.1 | 2013 | | N2930: [範囲for文](/lang/cpp11/range_based_for.md) | 配列やコンテナといった範囲を表すオブジェクトを、簡潔に走査する | 4.6 | 3.0 | 13.0 | 2012 | | N2928: [`override`と`final`](/lang/cpp11/override_final.md) | メンバ関数のオーバーライド指定、および派生クラスでのオーバーロードを禁止する指定 | 4.7 | 2.9 | 14.0 | 2005 (partial): `override`のみ。`final`の代わりにsealedが存在する。ただし両者ともデストラクタには指定できない。
2012 | @@ -79,7 +79,7 @@ | N3648: [ラムダ式の初期化キャプチャ](/lang/cpp14/initialize_capture.md) | キャプチャに代入構文を導入し、一つの変数に複数のキャプチャ方法を指定可能にする | 4.9 | 3.4 | 15.0 | 2015 | | N3649: [ジェネリックラムダ](/lang/cpp14/generic_lambdas.md) | ラムダ式のパラメータを`auto`にすることで、ジェネリックな関数呼び出し演算子を持つ関数オブジェクトを生成する | 4.9 | 3.4 | 16.0 | 2015 | | N3651: [変数テンプレート](/lang/cpp14/variable_templates.md) | 変数定義時のテンプレート指定を可能にする。 | 5.1 | 3.4 | 16.0 | 2015 Update 2 | -| N3652: [`constexpr`の制限緩和](/lang/cpp14/relaxing_constraints_on_constexpr.md) | `if`文、`switch`文による条件分岐の許可。
`for`文、`while`文、`do-while`文によるループの許可。
`void`戻り値型の許可
初期化を伴う変数宣言の許可。
変数書き換えの許可。 | 5.1 | 3.3(partial)
3.4 | 16.0 | 2017 | +| N3652: [`constexpr`関数内での条件分岐とループの文を許可](/lang/cpp14/relaxing_constraints_on_constexpr.md) | `if`文、`switch`文による条件分岐の許可。
`for`文、`while`文、`do-while`文によるループの許可。
`void`戻り値型の許可
初期化を伴う変数宣言の許可。
変数書き換えの許可。 | 5.1 | 3.3(partial)
3.4 | 16.0 | 2017 | | N3653: [宣言時のメンバ初期化を持つ型の集成体初期化を許可](/lang/cpp14/brace_elision_in_array_temporary_initialization.md) | 一様初期化と初期化子リストを組み合わせた際、二重に波カッコが必要となっていた仕様を緩和し、波カッコを省略できるようにする | 5.1 | 3.3 | 16.0 | 2017 | | N3760: [`[[deprecated]]`属性](/lang/cpp14/deprecated_attr.md) | 非推奨の機能であることを示す属性。 | 4.9 | 3.4 | 15.0
(Linux/Mac OS) | 2015
それ以前は`__declspec(deprecated)`で代替可能 | | N3781: [数値リテラルの桁区切り文字](/lang/cpp14/digit_separators.md) | シングルクォーテーションで数値リテラルを桁区切りする。 | 4.9 | 3.4 | 16.0 | 2015 | @@ -106,7 +106,7 @@ | N3928: [メッセージなしの`static_assert`](/lang/cpp17/extending_static_assert.md) | デフォルトの表明メッセージを使用する | 6 | 3.5 | 18.0 | 2017 | | N4086: [トライグラフを削除](/lang/cpp17/removing_trigraphs.md) | | 5.1 | 3.5 | 19.1 | 2010 | | N4051: [テンプレートテンプレートパラメータに`typename`を許可](/lang/cpp17/allow_typename_in_a_template_template_parameter.md) | `class`キーワードしか使用できなかった部分に、`typename`を許可 | 5.0 | 3.5 | 17.0 | 2015 | -| N3922: [単一要素初期化子リストを`auto`で受け取った場合の型を変更](/lang/cpp17/new_rules_for_auto_deduction_from_braced-init-list.md) | `initializer_list`だったのを`T`に変更 | 5 | 3.8 | 17.0 | 2015 | +| N3922: [単一要素の波カッコ初期化を非配列とする](/lang/cpp17/new_rules_for_auto_deduction_from_braced-init-list.md) | `initializer_list`だったのを`T`に変更 | 5 | 3.8 | 17.0 | 2015 | | N4295: [畳み込み式](/lang/cpp17/folding_expressions.md) | パラメータパックに対する2項演算の集積処理 | 6 | 3.6 | 19.0 | 2017 Update 5 | | N4267: [UTF-8文字リテラル](/lang/cpp17/utf8_character_literals.md) | 文字列リテラルだけでなく、文字リテラルにもUTF-8指定できるようにする | 6 | 3.6 | 17.0 | 2015 | | N4230: [入れ子名前空間の定義](/lang/cpp17/nested_namespace.md) | `namespace A::B {}`のように、入れ子の名前空間を簡単に定義できるようにする | 6 | 3.6 | 17.0 | 2015 Update 3 | @@ -122,10 +122,10 @@ | P0212R1: [`[[maybe_unused]]`属性](/lang/cpp17/maybe_unused.md) | 使用しない可能性がある変数であることをコンパイラに伝える属性 | 4.8からは`[[gnu::unused]]`を使用すること
7からサポート | 3.9 | 18.0 | 2017 Update 3 | | P0017R1: [基底クラスのメンバ変数を集成体初期化するための波カッコを省略できるようにする](/lang/cpp17/extension_to_aggregate_initialization.md) | 基底クラスのメンバを集成体初期化するために、`derived d {{42}};`の代わりに`derived d {42};`と書けるようにする | 7 | 3.9 | 19.1 | 2017 Update 7 | | P0170R1: [ラムダ式を`constexpr`として使用できるようにする](/lang/cpp17/constexpr_lambda.md) | ラムダ式の関数オブジェクトが定数式の文脈で使用された場合に、それがコンパイル時に評価されるようにする | 7 | 5 | 19.0 | 2017 Update 3 | -| P0184R0: [範囲for文のための`begin()`と`end()`関数が、異なる型を返すことを許可](/lang/cpp17/generalizing_the_range-based_for_loop.md) | `begin()`と`end()`が異なるイテレータ型を返せるようにすることで、終端イテレータを定義しやすくする | 6 | 3.9 | 18.0 | 2017 | +| P0184R0: [範囲for文のイテレータ型が一致しないことを許可](/lang/cpp17/generalizing_the_range-based_for_loop.md) | `begin()`と`end()`が異なるイテレータ型を返せるようにすることで、終端イテレータを定義しやすくする | 6 | 3.9 | 18.0 | 2017 | | P0018R3: [ラムダ式での`*this`のコピーキャプチャ](/lang/cpp17/lambda_capture_of_this_by_value.md) | キャプチャリストに`*this`を指定することで、`*this`をコピーキャプチャする | 7 | 3.9 | 19.0 | 2017 Update 3 | | P0138R2: [`enum class`変数の初期値として整数を指定する際の規則を調整](/lang/cpp17/construction_enum_class_values.md) | キャストを使用することなく整数を初期値として使用し、`E e{0};`のような初期化を許可 | 7 | 3.9 | 19.0 | 2017 Update 3 | -| P0245R1: [浮動小数点数の16進数リテラル](/lang/cpp17/hexadecimal_floating_literals.md) | `hexfloat`マニピュレータや`printf()`の16進数出力に合わせて、浮動小数点数のリテラルも16進数表記できるようにする | 3.0 | 3.0 | 18.0 | 2017 Update 5 | +| P0245R1: [16進浮動小数点数リテラル](/lang/cpp17/hexadecimal_floating_literals.md) | `hexfloat`マニピュレータや`printf()`の16進数出力に合わせて、浮動小数点数のリテラルも16進数表記できるようにする | 3.0 | 3.0 | 18.0 | 2017 Update 5 | | P0028R4: [属性の名前空間指定に繰り返しをなくす](/lang/cpp17/using_attribute_namespaces.md) | `[[using CC: opt(1), debug]]`のように属性の名前空間宣言をまとめて行う | 7 | 3.9 | 18.0 | 2017 Update 3 | | P0035R4: [アライメント指定されたデータの動的メモリ確保](/lang/cpp17/dynamic_memory_allocation_for_over-aligned_data.md) | `operator new`と`operator delete`でアライメント値を取得できるようにする | 7 | 4 | No | 2017 Update 5 | | P0091R3: [クラステンプレートのテンプレート引数推論](/lang/cpp17/type_deduction_for_class_templates.md) | コンストラクタの引数からクラスのテンプレート引数を推論できるようにする | 7 | 5 | 19.1 | 2017 Update 7 | @@ -179,7 +179,7 @@ | P0846R0: [関数テンプレートに明示的に型指定した場合にADLで見つからない問題を修正](/lang/cpp20/adl_and_function_templates_that_are_not_visible.md) | 名前空間内の関数テンプレートをテンプレート引数指定かつ非修飾・ADLで正しく呼び出せるよう修正 | 9 | 9.0 | 2021.4 | 2019 Update 1 | | P0641R2: [デフォルトのコピーコンストラクタと非`const`なコンストラクタが衝突する問題を修正](/lang/cpp20/resolving_const_mismatch_with_defaulted_copy_constructor.md) | 非`const`なオブジェクトをとるコンストラクタを定義すると、そのクラスをラップしたクラスのコピーコンストラクタが不適格になってしまう問題を修正 | 9 | 8.0 | 2021.4 | 2015 | | P0859R0: [評価されない文脈での定数式評価によって特殊メンバ関数がインスタンス化されることを規定](/lang/cpp20/less_eager_instantiation_of_constexpr_functions.md) | `sizeof`や`decltype`などの評価されない文脈において定数式評価を行った場合に、ムーブコンストラクタのような特殊メンバ関数が定義されることを規定 | 9 | 8 | | Partial in 2019 Update 7 | -| P0515R3: [一貫比較](/lang/cpp20/consistent_comparison.md) | 三方比較演算子によって比較演算子の自動生成を行うようにする | 10 | 8.0 (partial) | 2021.4 | 2019 | +| P0515R3: [`<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) | 三方比較演算子によって比較演算子の自動生成を行うようにする | 10 | 8.0 (partial) | 2021.4 | 2019 | | P0692R1: [特殊化のアクセスチェック](/lang/cpp20/access_checking_on_specializations.md) | | Yes | partial | 2021.4 | 2019 Update 6 | | P0624R2: [状態を持たないラムダ式を、デフォルト構築可能、代入可能とする](/lang/cpp20/default_constructible_and_assignable_stateless_lambdas.md) | キャプチャしていないラムダ式をデフォルト構築・代入可能にする | 9 | 8.0 | 2021.4 | 2019 Update 2 | | P0767R1: [PODを非推奨化](/lang/cpp20/deprecate_pod.md) | PODという用語を非推奨化する | | | 2021.4 | 2019 Update 5 | @@ -197,7 +197,7 @@ | P1064R0: [定数式からの仮想関数の呼び出しを許可](/lang/cpp20/allow_virtual_function_calls_in_constant_expressions.md) | 仮想関数に`constexpr`を付けられない制限を解除 | 9 | 9.0 | 2021.4 | 2019 Update 9 | | P1327R1: [定数式での`dynamic_cast`、多態的な`typeid`を許可](/lang/cpp20/allowing_dynamic_cast_polymorphic_typeid_in_constant_expressions.md) | 定数式での動的多態を許可 | 10 | 9.0 | 2021.4 | 2019 Update 9 | | P1002R1: [constexpr関数内でのtry-catchブロックを許可](/lang/cpp20/try-catch_blocks_in_constexpr_functions.md) | constexpr関数内でtry-catchブロックを書けるようにする | 9 | 8.0 | 2023.1 | 2019 Update 5 | -| P1073R3: [即時関数](/lang/cpp20/immediate_functions.md) | `consteval`キーワードを追加し、常に定数式評価されるよう指定できるようにする | 11 | 15 | 2021.4 | 2019 Update 10 | +| P1073R3: [常に定数式評価する`consteval`](/lang/cpp20/immediate_functions.md) | `consteval`キーワードを追加し、常に定数式評価されるよう指定できるようにする | 11 | 15 | 2021.4 | 2019 Update 10 | | P1330R0: [定数式内での共用体のアクティブメンバの変更を許可](/lang/cpp20/changing_the_active_member_of_a_union_inside_constexpr.md) | 共用体メンバの書き換えを定数式内で行えるようにする | 9 | 9.0 | 2021.4 | 2017 | | P1008R1: [ユーザー宣言したコンストラクタを持つクラスの集成体初期化を禁止](/lang/cpp20/prohibit_aggregates_with_user-declared_constructors.md) | コンストラクタが`delete`/`default`宣言されているクラスを、集成体初期化によってコンストラクタ呼び出しを回避して構築できてしまっていた技法を禁止 | 9 | 8.0 | 2021.4 | 2019 | | P0892R2: [関数を条件付きで`explicit`にする構文を追加](/lang/cpp20/explicit_bool.md) | `explicit(true)`のように`explicit`に真理値パラメータを指定できるようにする | 9 | 9.0 | 2021.4 | 2019 Update 2 | diff --git a/lang/cpp11.md b/lang/cpp11.md index 9c88c33ae6..5debfbce1e 100644 --- a/lang/cpp11.md +++ b/lang/cpp11.md @@ -14,7 +14,7 @@ C++11とは、2011年8月に改訂され、ISO/IEC 14882:2011で標準規格化 | 言語機能 | 説明 | |----------------|------| -| [`auto`](cpp11/auto.md) | 型推論 | +| [変数の型推論のための`auto`](cpp11/auto.md) | 型推論 | | [`decltype`](cpp11/decltype.md) | 式の型を取得 | | [範囲for文](cpp11/range_based_for.md) | 配列やコンテナといった範囲を表すオブジェクトを、簡潔に走査する | | [初期化子リスト](cpp11/initializer_lists.md) | 波括弧による初期化をユーザー定義する。`vector v = {1, 2, 3};`など。 | @@ -47,14 +47,14 @@ C++11とは、2011年8月に改訂され、ISO/IEC 14882:2011で標準規格化 | 言語機能 | 説明 | |----------------|------| | [スコープを持つ列挙型](cpp11/scoped_enum.md) | 強い型付けとスコープを持つ列挙型の導入と、それにともなって従来の列挙型を機能拡張 | -| [共用体の制限解除](cpp11/unrestricted_unions.md) | 共用体のメンバ変数として、クラスオブジェクトを持てるようにする | +| [共用体でクラスオブジェクトをもつことを許可](cpp11/unrestricted_unions.md) | 共用体のメンバ変数として、クラスオブジェクトを持てるようにする | ### テンプレート関係の機能 | 言語機能 | 説明 | |----------------|------| -| [テンプレートの右山カッコ](cpp11/right_angle_brackets.md) | `vector>`のように、`>>`をスペースを空けずに記述可能にする | +| [テンプレートでの連続した右山カッコを許可](cpp11/right_angle_brackets.md) | `vector>`のように、`>>`をスペースを空けずに記述可能にする | | [`extern template`](cpp11/extern_template.md) | テンプレートのインスタンス化を抑止する | | [エイリアステンプレート](cpp11/alias_templates.md) | テンプレートによって型の別名を定義する | | [可変引数テンプレート](cpp11/variadic_templates.md) | 任意の数のテンプレートパラメータを受け取れるようにする | diff --git a/lang/cpp11/auto.md b/lang/cpp11/auto.md index 5273c1cbfe..5c5e23a363 100644 --- a/lang/cpp11/auto.md +++ b/lang/cpp11/auto.md @@ -1,4 +1,4 @@ -# auto [N1984] +# 変数の型推論のためのauto [N1984] * cpp11[meta cpp] @@ -387,4 +387,4 @@ std::pair& p = foo(); - [N2337 The Syntax of auto Declarations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2337.pdf) - [N2546 Removal of auto as a storage-class specifier](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2546.htm) - [N2712 Non-static data member initializers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2712.html) -- [N2713 Allow auto for non-static data members](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2713.html) \ No newline at end of file +- [N2713 Allow auto for non-static data members](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2713.html) diff --git a/lang/cpp11/constexpr.md b/lang/cpp11/constexpr.md index 8e8b96c5fa..1fafdaab03 100644 --- a/lang/cpp11/constexpr.md +++ b/lang/cpp11/constexpr.md @@ -201,15 +201,15 @@ GCC 5.2、Clang 3.7、Visual C++ 2015時点で、3つともデフォルトは512 ## 関連項目 - [C++11 ユーザー定義リテラル](user_defined_literals.md) -- [C++14 `constexpr`の制限緩和](/lang/cpp14/relaxing_constraints_on_constexpr.md) +- [C++14 `constexpr`関数内での条件分岐とループの文を許可](/lang/cpp14/relaxing_constraints_on_constexpr.md) - [C++17 `constexpr`ラムダ](/lang/cpp17/constexpr_lambda.md) -- [C++20 即時関数](/lang/cpp20/immediate_functions.md) +- [C++20 常に定数式評価する`consteval`](/lang/cpp20/immediate_functions.md) - [C++20 定数式からの仮想関数の呼び出しを許可](/lang/cpp20/allow_virtual_function_calls_in_constant_expressions.md) - [C++20 定数式での`dynamic_cast`、多態的な`typeid`を許可](/lang/cpp20/allowing_dynamic_cast_polymorphic_typeid_in_constant_expressions.md) - [C++20 `constexpr`関数内でのtry-catchブロックを許可](/lang/cpp20/try-catch_blocks_in_constexpr_functions.md) - [C++20 定数式内での共用体のアクティブメンバの変更を許可](/lang/cpp20/changing_the_active_member_of_a_union_inside_constexpr.md) -- [C++20 constexpr関数内でのトリビアルなデフォルト初期化を許可](/lang/cpp20/permitting_trivial_default_initialization_in_constexpr_contexts.md) -- [C++20 constexpr関数内で未評価のインラインアセンブリを許可することによる組み込み関数のconstexpr有効化](/lang/cpp20/enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.md) +- [C++20 `constexpr`関数内でのトリビアルなデフォルト初期化を許可](/lang/cpp20/permitting_trivial_default_initialization_in_constexpr_contexts.md) +- [C++20 `constexpr`関数内で未評価のインラインアセンブリを許可することによる組み込み関数の`constexpr`有効化](/lang/cpp20/enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.md) - [C++20 コンパイル時初期化を強制する`constinit`キーワードを追加](/lang/cpp20/constinit.md) - [C++20 可変サイズをもつコンテナの`constexpr`化](/lang/cpp20/more_constexpr_containers.md) - [C++23 `constexpr`関数が定数実行できない場合でも適格とする](/lang/cpp23/relaxing_some_constexpr_restrictions.md) @@ -226,4 +226,4 @@ GCC 5.2、Clang 3.7、Visual C++ 2015時点で、3つともデフォルトは512 - [CWG Issue 644. Should a trivial class type be a literal type?](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#644) - リテラル型のメンバ変数のみを持つクラスは、`constexpr`コンストラクタを明示的に定義しなくても、リテラル型となる - [CWG Issue 699. Must constexpr member functions be defined in the class member-specification?](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#699) - - ゼロ割りの扱い、再帰回数の規定 \ No newline at end of file + - ゼロ割りの扱い、再帰回数の規定 diff --git a/lang/cpp11/decltype.md b/lang/cpp11/decltype.md index 05e9f974de..eb9bb67d69 100644 --- a/lang/cpp11/decltype.md +++ b/lang/cpp11/decltype.md @@ -257,7 +257,7 @@ GCC や Clang には `decltype` が導入される前から、同様の機能を ## 関連項目 - [C++11 戻り値の型を後置する関数宣言構文](trailing_return_types.md) -- [C++11 `auto`](auto.md) +- [C++11 変数の型推論のための`auto`](auto.md) - [C++11 ラムダ式](lambda_expressions.md) - [C++14 `decltype(auto)`](../cpp14/decltype_auto.md) @@ -276,4 +276,4 @@ GCC や Clang には `decltype` が導入される前から、同様の機能を - [N3233 US22/DE9 Revisited: Decltype and Call Expressions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3233.html) - [N3276 US22/DE9 Revisited: Decltype and Call Expressions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3276.pdf) - [CWG Issue 743. Use of decltype in a nested-name-specifier](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#743) -- [CWG Issue 950. Use of decltype as a class-name](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#950) \ No newline at end of file +- [CWG Issue 950. Use of decltype as a class-name](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#950) diff --git a/lang/cpp11/right_angle_brackets.md b/lang/cpp11/right_angle_brackets.md index 29920e67cb..235306c19e 100644 --- a/lang/cpp11/right_angle_brackets.md +++ b/lang/cpp11/right_angle_brackets.md @@ -1,4 +1,4 @@ -# テンプレートの右山カッコ [N1757] +# テンプレートでの連続した右山カッコを許可 [N1757] * cpp11[meta cpp] @@ -107,4 +107,4 @@ C++11で採択された方式は、テンプレートの型パラメータと非 ## 参照 - [N1649 Right Angle Brackets](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1649.html) - [N1699 Right Angle Brackets (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1699.html) -- [N1757 Right Angle Brackets (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html) \ No newline at end of file +- [N1757 Right Angle Brackets (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html) diff --git a/lang/cpp11/unrestricted_unions.md b/lang/cpp11/unrestricted_unions.md index 1fde6b9e23..ace4074811 100644 --- a/lang/cpp11/unrestricted_unions.md +++ b/lang/cpp11/unrestricted_unions.md @@ -1,4 +1,4 @@ -# 共用体の制限解除 [N2544] +# 共用体でクラスオブジェクトをもつことを許可 [N2544] * cpp11[meta cpp] @@ -74,4 +74,4 @@ hello ## 参照 - [N2430 Unrestricted Unions (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2430.pdf) - [N2544 Unrestricted Unions (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf) -- [Boost Variant Library](http://www.boost.org/libs/variant) \ No newline at end of file +- [Boost Variant Library](http://www.boost.org/libs/variant) diff --git a/lang/cpp14.md b/lang/cpp14.md index 1bfbfa9aba..7ab6c41a7d 100644 --- a/lang/cpp14.md +++ b/lang/cpp14.md @@ -19,7 +19,7 @@ C++14とは、2014年12月に改訂され、ISO/IEC 14882:2014で標準規格化 | [ラムダ式の初期化キャプチャ](cpp14/initialize_capture.md) | キャプチャに代入構文を導入し、一つの変数に複数のキャプチャ方法を指定可能にする | | [ジェネリックラムダ](cpp14/generic_lambdas.md) | ラムダ式のパラメータを`auto`にすることで、ジェネリックな関数呼び出し演算子を持つ関数オブジェクトを生成する | | [変数テンプレート](cpp14/variable_templates.md) | 変数定義時のテンプレート指定を可能にする | -| [`constexpr`の制限緩和](cpp14/relaxing_constraints_on_constexpr.md) | `if`文、`switch`文による条件分岐の許可。
`for`文、`while`文、`do-while`文によるループの許可。
`void`戻り値型の許可
初期化を伴う変数宣言の許可。
変数書き換えの許可 | +| [`constexpr`関数内での条件分岐とループの文を許可](cpp14/relaxing_constraints_on_constexpr.md) | `if`文、`switch`文による条件分岐の許可。
`for`文、`while`文、`do-while`文によるループの許可。
`void`戻り値型の許可
初期化を伴う変数宣言の許可。
変数書き換えの許可 | | [宣言時のメンバ初期化を持つ型の集成体初期化を許可](cpp14/member_initializers_and_aggregates.md) | 集成体において、宣言時に初期化されているメンバを持つことを許可する | | [ネストする集成体初期化における波カッコ省略を許可](cpp14/brace_elision_in_array_temporary_initialization.md) | 一様初期化と初期化子リストを組み合わせた際、二重に波カッコが必要となっていた仕様を緩和し、波カッコを省略できるようにする | | [`[[deprecated]]`属性](cpp14/deprecated_attr.md) | 非推奨の機能であることを示す属性 | diff --git a/lang/cpp14/feature_test_macros.md b/lang/cpp14/feature_test_macros.md index 99ef09394c..93018d3bdc 100644 --- a/lang/cpp14/feature_test_macros.md +++ b/lang/cpp14/feature_test_macros.md @@ -17,7 +17,7 @@ SD-6 は C++14 の機能について以下のテストマクロを定義する |----------|----|------|--------| | `__cpp_aggregate_nsdmi` | `201304` | メンバ初期化子と集約 | predefined | | `__cpp_binary_literals` | `201304` | [二進数リテラル](binary_literals.md) | predefined | -| `__cpp_constexpr` | `201304` | [`constexpr`の制限緩和/`constexpr` メンバ関数の暗黙的な `const`](relaxing_constraints_on_constexpr.md) | predefined | +| `__cpp_constexpr` | `201304` | [`constexpr`関数内での条件分岐とループの文を許可/`constexpr` メンバ関数の暗黙的な `const`](relaxing_constraints_on_constexpr.md) | predefined | | `__cpp_decltype_auto` | `201304` | [通常関数の戻り値型推論](return_type_deduction_for_normal_functions.md) | predefined | | `__cpp_generic_lambdas` | `201304` | [ジェネリックラムダ](generic_lambdas.md) | predefined | | `__cpp_init_captures` | `201304` | [ラムダ式の初期化キャプチャ](initialize_capture.md) | predefined | @@ -48,4 +48,4 @@ SD-6 は C++14 の機能について以下のテストマクロを定義する | `__has_include()` | `1` | [共有ロック](/reference/shared_mutex.md) | predefined | ## 参照 -- [SD-6: SG10 Feature Test Recommendations: Standard C++](https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations#recs.cpp14) \ No newline at end of file +- [SD-6: SG10 Feature Test Recommendations: Standard C++](https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations#recs.cpp14) diff --git a/lang/cpp14/relaxing_constraints_on_constexpr.md b/lang/cpp14/relaxing_constraints_on_constexpr.md index 2d65d8e3ee..3319d0c414 100644 --- a/lang/cpp14/relaxing_constraints_on_constexpr.md +++ b/lang/cpp14/relaxing_constraints_on_constexpr.md @@ -1,4 +1,4 @@ -# constexprの制限緩和 [N3652] +# `constexpr`関数内での条件分岐とループの文を許可 [N3652] * cpp14[meta cpp] @@ -212,4 +212,4 @@ C++14では、`constexpr`関数、`constexpr`メンバ関数、暗黙の`const` ## 参照 - [N3597 Relaxing constraints on `constexpr` functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3597.html) - [N3598 `constexpr` member functions and implicit `const`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3598.html) -- [N3652 Relaxing constraints on `constexpr` functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3652.html) \ No newline at end of file +- [N3652 Relaxing constraints on `constexpr` functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3652.html) diff --git a/lang/cpp17.md b/lang/cpp17.md index 06805f4c57..ddb23a0844 100644 --- a/lang/cpp17.md +++ b/lang/cpp17.md @@ -27,10 +27,10 @@ C++17以降、言語の策定にship train modelというリリース体制が | 言語機能 | 説明 | |----------|------| -| [十六進浮動小数点数リテラル](cpp17/hexadecimal_floating_literals.md) | 十六進数表記で浮動小数点数リテラルを記述できるようにする | +| [16進浮動小数点数リテラル](cpp17/hexadecimal_floating_literals.md) | 十六進数表記で浮動小数点数リテラルを記述できるようにする | | [インライン変数](cpp17/inline_variables.md) | `inline`指定をすることで翻訳単位を跨いでひとつのオブジェクトになる変数を定義する | | [構造化束縛](cpp17/structured_bindings.md) | 組・タプル・配列を展開して変数定義する | -| [波括弧初期化の型推論の新規則](cpp17/new_rules_for_auto_deduction_from_braced-init-list.md) | 波括弧初期化子が単一要素の場合は `T` に推論,複数要素の場合は不適格 | +| [単一要素の波カッコ初期化を非配列とする](cpp17/new_rules_for_auto_deduction_from_braced-init-list.md) | 波括弧初期化子が単一要素の場合は `T` に推論,複数要素の場合は不適格 | | [`[[maybe_unused]]`属性](cpp17/maybe_unused.md) | 使用しない可能性のある変数に対する警告を抑制する | | [`[[nodiscard]]`属性](cpp17/nodiscard.md) | 戻り値を捨ててはならないことを指定する | | [値のコピー省略を保証](cpp17/guaranteed_copy_elision.md) | 右辺値を変数の初期化のために使用する場合、コピーもムーブも省略することを保証 | @@ -48,7 +48,7 @@ C++17以降、言語の策定にship train modelというリリース体制が | [`if`文と`switch`文の条件式と初期化を分離](cpp17/selection_statements_with_initializer.md) | `if (init; condition)`のように初期化と条件式を分けて記述できるようにする | | [`[[fallthrough]]`属性](cpp17/fallthrough.md) | フォールスルー時の警告を抑制する | | [`constexpr if`文](cpp17/if_constexpr.md) | `if constexpr(cond)`とすることで、その`if`文はコンパイル時に処理される | -| [範囲 `for` ループの制限緩和](cpp17/generalizing_the_range-based_for_loop.md) | 範囲 `for` 文の `begin()` と `end()` が異なるイテレータ型を返せるようにすることで、終端イテレータを定義しやすくする | +| [範囲for文のイテレータ型が一致しないことを許可](cpp17/generalizing_the_range-based_for_loop.md) | 範囲 `for` 文の `begin()` と `end()` が異なるイテレータ型を返せるようにすることで、終端イテレータを定義しやすくする | ### ラムダ式 diff --git a/lang/cpp17/feature_test_macros.md b/lang/cpp17/feature_test_macros.md index 3ce2236ad5..de1e956713 100644 --- a/lang/cpp17/feature_test_macros.md +++ b/lang/cpp17/feature_test_macros.md @@ -17,7 +17,7 @@ SD-6 は C++17 の機能について以下のテストマクロを定義する | マクロ名 | 値 | 機能 | |----------|----|------| -| `__cpp_hex_float` | `201603` | [十六進浮動小数点数リテラル](hexadecimal_floating_literals.md) | +| `__cpp_hex_float` | `201603` | [16進浮動小数点数リテラル](hexadecimal_floating_literals.md) | | `__cpp_inline_variables` | `201606` | [インライン変数](inline_variables.md) | | `__cpp_aligned_new` | `201606` | [アライメント指定されたデータの動的メモリ確保](dynamic_memory_allocation_for_over-aligned_data.md) | | `__cpp_guaranteed_copy_elision` | `201606` | [値のコピー省略を保証](guaranteed_copy_elision.md) | @@ -98,4 +98,4 @@ SD-6 は C++17 の機能について以下のテストマクロを定義する ## 参照 -- [SD-6: SG10 Feature Test Recommendations: Standard C++](https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations#recs.cpp17) \ No newline at end of file +- [SD-6: SG10 Feature Test Recommendations: Standard C++](https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations#recs.cpp17) diff --git a/lang/cpp17/generalizing_the_range-based_for_loop.md b/lang/cpp17/generalizing_the_range-based_for_loop.md index 344ac88660..3a7da034d4 100644 --- a/lang/cpp17/generalizing_the_range-based_for_loop.md +++ b/lang/cpp17/generalizing_the_range-based_for_loop.md @@ -1,4 +1,4 @@ -# 範囲 for ループの制限緩和 [P0184R0] +# 範囲for文のイテレータ型が一致しないことを許可 [P0184R0] * cpp17[meta cpp] @@ -153,4 +153,4 @@ Range TS (technical specification) では `Sentinel` (番兵) 等の範囲の終 ## 参照 - [P0184R0 Generalizing the Range-Based For Loop](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0184r0.html) -- [N4128 Ranges for the Standard Library, Revision 1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4128.html) \ No newline at end of file +- [N4128 Ranges for the Standard Library, Revision 1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4128.html) diff --git a/lang/cpp17/hexadecimal_floating_literals.md b/lang/cpp17/hexadecimal_floating_literals.md index e976eef46a..e457733b58 100644 --- a/lang/cpp17/hexadecimal_floating_literals.md +++ b/lang/cpp17/hexadecimal_floating_literals.md @@ -1,4 +1,4 @@ -# 十六進浮動小数点数リテラル [P0245R1] +# 16進浮動小数点数リテラル [P0245R1] * cpp17[meta cpp] @@ -85,4 +85,4 @@ C99 で十六進浮動小数リテラルが採用された。 ## 参照 * [P0245R0 Hexadecimal floating literals for C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0245r0.html) -* [P0245R1 Hexadecimal floating literals for C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0245r1.html) \ No newline at end of file +* [P0245R1 Hexadecimal floating literals for C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0245r1.html) diff --git a/lang/cpp17/new_rules_for_auto_deduction_from_braced-init-list.md b/lang/cpp17/new_rules_for_auto_deduction_from_braced-init-list.md index 5627e23b2f..658b2b6e0a 100644 --- a/lang/cpp17/new_rules_for_auto_deduction_from_braced-init-list.md +++ b/lang/cpp17/new_rules_for_auto_deduction_from_braced-init-list.md @@ -1,4 +1,4 @@ -# 波括弧初期化の型推論の新規則 [N3922] +# 単一要素の波カッコ初期化を非配列とする [N3922] * cpp17[meta cpp] @@ -100,4 +100,4 @@ i * [N3681 Auto and braced-init-lists](http://open-std.org/JTC1/SC22/WG21/docs/papers/2013/n3681.html) * [N3912 Auto and braced-init-lists, continued](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3912.html) -* [N3922 New Rules for auto deduction from braced-init-list](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3922.html) \ No newline at end of file +* [N3922 New Rules for auto deduction from braced-init-list](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3922.html) diff --git a/lang/cpp20.md b/lang/cpp20.md index 9acb56e12d..81111018ab 100644 --- a/lang/cpp20.md +++ b/lang/cpp20.md @@ -11,7 +11,7 @@ C++20とは、2020年中に改訂され、ISO/IEC 14882:2020で標準規格化 | 言語機能 | 説明 | |----------|------| -| [一貫比較](cpp20/consistent_comparison.md) | 三方比較演算子によって比較演算子の自動生成を行うようにする | +| [`<=>`/`==`による比較演算子の自動定義](cpp20/consistent_comparison.md) | 三方比較演算子によって比較演算子の自動生成を行うようにする | | [ビットフィールドのメンバ変数初期化](cpp20/default_member_initializers_for_bit_fields.md) | ビットフィールドメンバ変数のデフォルト値を設定する構文を追加する | | [関数を条件付きで`explicit`にする構文を追加](cpp20/explicit_bool.md) | `explicit(true)`のように`explicit`に真理値パラメータを指定できるようにする | | [`const`修飾されたメンバポインタの制限を修正](cpp20/fixing_const_qualified_pointers_to_members.md) | `.*`演算子での左辺値の`const`メンバ関数呼び出しを許可する | @@ -99,7 +99,7 @@ C++20とは、2020年中に改訂され、ISO/IEC 14882:2020で標準規格化 | [定数式からの仮想関数の呼び出しを許可](cpp20/allow_virtual_function_calls_in_constant_expressions.md) | 仮想関数に`constexpr`を付けられない制限を解除 | | [定数式での`dynamic_cast`、多態的な`typeid`を許可](cpp20/allowing_dynamic_cast_polymorphic_typeid_in_constant_expressions.md) | 定数式での動的多態を許可 | | [constexpr関数内でのtry-catchブロックを許可](cpp20/try-catch_blocks_in_constexpr_functions.md) | constexpr関数内で`try-catch`ブロックを書けるようにする | -| [即時関数](cpp20/immediate_functions.md) | `consteval`キーワードを追加し、常に定数式評価されるよう指定できるようにする | +| [常に定数式評価する`consteval`](cpp20/immediate_functions.md) | `consteval`キーワードを追加し、常に定数式評価されるよう指定できるようにする | | [定数式内での共用体のアクティブメンバの変更を許可](cpp20/changing_the_active_member_of_a_union_inside_constexpr.md) | 共用体メンバの書き換えを定数式内で行えるようにする | | [constexpr関数内でのトリビアルなデフォルト初期化を許可](cpp20/permitting_trivial_default_initialization_in_constexpr_contexts.md) | constexpr関数内でのデフォルト初期化を許可し、未初期化値を読むことのみ禁止する | | [constexpr関数内で未評価のインラインアセンブリを許可することによる組み込み関数のconstexpr有効化](cpp20/enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.md) | コンパイル時に評価されない場合にconstexpr関数にasm定義を含めることを許可 | diff --git a/lang/cpp20/consistent_comparison.md b/lang/cpp20/consistent_comparison.md index 92abbb27a3..d831455e0c 100644 --- a/lang/cpp20/consistent_comparison.md +++ b/lang/cpp20/consistent_comparison.md @@ -1,4 +1,4 @@ -# 一貫比較 [P0515R3] +# `<=>`/`==`による比較演算子の自動定義 [P0515R3] * cpp20[meta cpp] @@ -843,4 +843,4 @@ struct has_vector { - [P0436R1 An Extensible Approach to Obtaining Selected Operators](http://wg21.link/P0436R1) - [P0474R0 Comparison in C++: Basic Facilities](http://wg21.link/P0474R0) - [P0481R0 T. Van Eerd. “Bravely Default](http://wg21.link/P0481R0) - - [P0432R0 D. Stone. “Implicit and Explicit Default Comparison Operators](http://wg21.link/P0432R0) \ No newline at end of file + - [P0432R0 D. Stone. “Implicit and Explicit Default Comparison Operators](http://wg21.link/P0432R0) diff --git a/lang/cpp20/feature_test_macros.md b/lang/cpp20/feature_test_macros.md index 846643653b..94415e1724 100644 --- a/lang/cpp20/feature_test_macros.md +++ b/lang/cpp20/feature_test_macros.md @@ -22,14 +22,14 @@ |`__cpp_constexpr`|`201907L`
`202002L`|[定数式からの仮想関数の呼び出しを許可](allow_virtual_function_calls_in_constant_expressions.md)
[定数式での`dynamic_cast`、多態的な`typeid`を許可](allowing_dynamic_cast_polymorphic_typeid_in_constant_expressions.md)
[constexpr関数内でのtry-catchブロックを許可](try-catch_blocks_in_constexpr_functions.md)
[定数式内での共用体のアクティブメンバの変更を許可](changing_the_active_member_of_a_union_inside_constexpr.md)
[constexpr関数内でのトリビアルなデフォルト初期化を許可](permitting_trivial_default_initialization_in_constexpr_contexts.md)
[constexpr関数内で未評価のインラインアセンブリを許可することによる組み込み関数のconstexpr有効化](enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.md)| |`__cpp_constexpr_dynamic_alloc`|`201907L`|[可変サイズをもつコンテナの`constexpr`化](more_constexpr_containers.md)| |`__cpp_constexpr_in_decltype`|`201711L`|[評価されない文脈での定数式評価によって特殊メンバ関数がインスタンス化されることを規定](less_eager_instantiation_of_constexpr_functions.md)| -|`__cpp_consteval`|`201811L`|[即時関数](immediate_functions.md)| +|`__cpp_consteval`|`201811L`|[常に定数式評価する`consteval`](immediate_functions.md)| |`__cpp_constinit`|`201907L`|[コンパイル時初期化を強制する`constinit`キーワードを追加](constinit.md)| |`__cpp_deduction_guides`|`201907L`|[集成体クラステンプレートのテンプレート引数推論](class_template_argument_deduction_for_aggregates.md)
[エイリアステンプレート経由でのクラステンプレートのテンプレート引数推論](class_template_argument_deduction_for_alias_templates.md)| |`__cpp_designated_initializers`|`201707L`|[指示付き初期化](designated_initialization.md)| |`__cpp_generic_lambdas`|`201707L`|[ジェネリックラムダのテンプレート構文](familiar_template_syntax_for_generic_lambdas.md)| |`__cpp_impl_coroutine`|`201902L`|[コルーチン](coroutines.md)| |`__cpp_impl_destroying_delete`|`201806L`|[可変長データを扱うクラスの効率的な`delete`](efficient_sized_delete_for_variable_sized_classes.md)| -|`__cpp_impl_three_way_comparison`|`201907L`|[一貫比較](consistent_comparison.md)| +|`__cpp_impl_three_way_comparison`|`201907L`|[`<=>`/`==`による比較演算子の自動定義](consistent_comparison.md)| |`__cpp_init_captures`|`201803L`|[ラムダ式の初期化キャプチャでのパック展開を許可](allow_pack_expansion_in_lambda_init_capture.md)| |`__cpp_modules`|`201907L`|[モジュール](modules.md)| |`__cpp_nontype_template_args`|`201911L`|[非型テンプレートパラメータとしてクラス型を許可する](class_types_in_non-type_template_parameters.md)| @@ -109,4 +109,4 @@ ## 参照 -- [SD-FeatureTest: Feature-Test Macros and Policies - isocpp](https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations) \ No newline at end of file +- [SD-FeatureTest: Feature-Test Macros and Policies - isocpp](https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations) diff --git a/lang/cpp20/immediate_functions.md b/lang/cpp20/immediate_functions.md index 945957495f..e629bcb059 100644 --- a/lang/cpp20/immediate_functions.md +++ b/lang/cpp20/immediate_functions.md @@ -1,4 +1,4 @@ -# 即時関数 [P1073R3] +# 常に定数式評価する`consteval` [P1073R3] * cpp20[meta cpp] @@ -114,4 +114,4 @@ C++11で導入された`constexpr`指定子によって、関数を定数式評 ## 参照 -* [P1073R3 Immediate functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1073r3.html) \ No newline at end of file +* [P1073R3 Immediate functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1073r3.html) diff --git a/lang/cpp23/consteval_needs_to_propagate_up.md b/lang/cpp23/consteval_needs_to_propagate_up.md index e3f7c3327f..e44c94055d 100644 --- a/lang/cpp23/consteval_needs_to_propagate_up.md +++ b/lang/cpp23/consteval_needs_to_propagate_up.md @@ -109,8 +109,8 @@ constexpr int k(int) { // kは即時関数ではない ## 関連項目 -- [C++20 即時関数](/lang/cpp20/immediate_functions.md) +- [C++20 常に定数式評価する`consteval`](/lang/cpp20/immediate_functions.md) ## 参照 -- [P2564R3 `consteval` needs to propagate up](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2564r3.html) \ No newline at end of file +- [P2564R3 `consteval` needs to propagate up](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2564r3.html) diff --git a/lang/cpp23/if_consteval.md b/lang/cpp23/if_consteval.md index 7d8d7baae9..2aec5cb209 100644 --- a/lang/cpp23/if_consteval.md +++ b/lang/cpp23/if_consteval.md @@ -111,8 +111,8 @@ constexpr size_t strlen(char const* s) { ## 関連項目 - [`std::is_constant_evaluated()`](/reference/type_traits/is_constant_evaluated.md) -- [C++20 即時関数](/lang/cpp20/immediate_functions.md) +- [C++20 常に定数式評価する`consteval`](/lang/cpp20/immediate_functions.md) ## 参照 -- [P1938R3 `if consteval`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1938r3.html) \ No newline at end of file +- [P1938R3 `if consteval`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1938r3.html) diff --git a/reference/algorithm/lexicographical_compare_three_way.md b/reference/algorithm/lexicographical_compare_three_way.md index c09cff5426..c60f0ad445 100644 --- a/reference/algorithm/lexicographical_compare_three_way.md +++ b/reference/algorithm/lexicographical_compare_three_way.md @@ -133,8 +133,8 @@ true ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) -- [lexicographical_compare()](lexicographical_compare.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) +- [`lexicographical_compare()`](lexicographical_compare.md) ## 参照 diff --git a/reference/algorithm/sort.md b/reference/algorithm/sort.md index 0336f637be..f88eae8163 100644 --- a/reference/algorithm/sort.md +++ b/reference/algorithm/sort.md @@ -234,7 +234,7 @@ int main() { ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) ## 参照 - [LWG Issue 713. `sort()` complexity is too lax](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#713) diff --git a/reference/compare.md b/reference/compare.md index 57292b4402..f744843f94 100644 --- a/reference/compare.md +++ b/reference/compare.md @@ -78,7 +78,7 @@ ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) ## 参照 diff --git a/reference/compare/common_comparison_category.md b/reference/compare/common_comparison_category.md index d1abfc4b8f..ba9a1c749a 100644 --- a/reference/compare/common_comparison_category.md +++ b/reference/compare/common_comparison_category.md @@ -107,7 +107,7 @@ false ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) ## 参照 diff --git a/reference/compare/compare_partial_order_fallback.md b/reference/compare/compare_partial_order_fallback.md index 755da7e830..270978837b 100644 --- a/reference/compare/compare_partial_order_fallback.md +++ b/reference/compare/compare_partial_order_fallback.md @@ -144,7 +144,7 @@ false ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) ## 参照 diff --git a/reference/compare/compare_strong_order_fallback.md b/reference/compare/compare_strong_order_fallback.md index 5122e7c610..9427e219af 100644 --- a/reference/compare/compare_strong_order_fallback.md +++ b/reference/compare/compare_strong_order_fallback.md @@ -117,7 +117,7 @@ true ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) ## 参照 diff --git a/reference/compare/compare_three_way.md b/reference/compare/compare_three_way.md index e7aad93ba3..58978f4c7f 100644 --- a/reference/compare/compare_three_way.md +++ b/reference/compare/compare_three_way.md @@ -49,7 +49,7 @@ struct compare_three_way { ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) ## 参照 diff --git a/reference/compare/compare_three_way/op_call.md b/reference/compare/compare_three_way/op_call.md index 40dd7dd009..a4e1e061b5 100644 --- a/reference/compare/compare_three_way/op_call.md +++ b/reference/compare/compare_three_way/op_call.md @@ -94,7 +94,7 @@ true ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) ## 参照 diff --git a/reference/compare/compare_three_way_result.md b/reference/compare/compare_three_way_result.md index 386152ebdb..9728ea4d26 100644 --- a/reference/compare/compare_three_way_result.md +++ b/reference/compare/compare_three_way_result.md @@ -121,7 +121,7 @@ struct compare_three_way_result { ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) ## 参照 diff --git a/reference/compare/compare_weak_order_fallback.md b/reference/compare/compare_weak_order_fallback.md index c334ce6117..fdda64453b 100644 --- a/reference/compare/compare_weak_order_fallback.md +++ b/reference/compare/compare_weak_order_fallback.md @@ -142,7 +142,7 @@ true ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) ## 参照 diff --git a/reference/compare/named_comparison_functions.md b/reference/compare/named_comparison_functions.md index 2778541fdd..06a43e93f2 100644 --- a/reference/compare/named_comparison_functions.md +++ b/reference/compare/named_comparison_functions.md @@ -122,9 +122,9 @@ constexpr bool is_gteq(partial_ordering cmp) noexcept { return cmp >= 0; } ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) ## 参照 - [P0515R3 Consistent comparison](http://wg21.link/p0515) -- [P0768R1 Library support for the spaceship (comparison) operator](http://wg21.link/p0768) \ No newline at end of file +- [P0768R1 Library support for the spaceship (comparison) operator](http://wg21.link/p0768) diff --git a/reference/compare/partial_order.md b/reference/compare/partial_order.md index e8cbbe5dff..09a430e0a6 100644 --- a/reference/compare/partial_order.md +++ b/reference/compare/partial_order.md @@ -160,7 +160,7 @@ true ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) - [`weak_order`](weak_order.md) - [`partial_ordering`](partial_ordering.md) - [`compare_partial_order_fallback`](compare_partial_order_fallback.md) diff --git a/reference/compare/partial_ordering.md b/reference/compare/partial_ordering.md index 5c97feb24a..a3ac6fea8e 100644 --- a/reference/compare/partial_ordering.md +++ b/reference/compare/partial_ordering.md @@ -150,7 +150,7 @@ true ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) ## 参照 @@ -159,4 +159,4 @@ true - [P0768R1 Library support for the spaceship (comparison) operator](http://wg21.link/p0768) - [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) - [全順序集合と半順序集合](http://proofcafe.org/k27c8/math/math/relation/page/totally_orderd_relation_and_partial_orderd_relation/) - - サンプルコードの半順序関係の参考 \ No newline at end of file + - サンプルコードの半順序関係の参考 diff --git a/reference/compare/partial_ordering/op_compare_3way.md b/reference/compare/partial_ordering/op_compare_3way.md index a8a4d78c3d..f464460a82 100644 --- a/reference/compare/partial_ordering/op_compare_3way.md +++ b/reference/compare/partial_ordering/op_compare_3way.md @@ -97,11 +97,11 @@ false ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) ## 参照 - [P0515R3 Consistent comparison](http://wg21.link/p0515) - [P0768R1 Library support for the spaceship (comparison) operator](http://wg21.link/p0768) -- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) \ No newline at end of file +- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) diff --git a/reference/compare/partial_ordering/op_equal.md b/reference/compare/partial_ordering/op_equal.md index d754a9b6ce..d7627d73a0 100644 --- a/reference/compare/partial_ordering/op_equal.md +++ b/reference/compare/partial_ordering/op_equal.md @@ -93,11 +93,11 @@ false ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) ## 参照 - [P0515R3 Consistent comparison](http://wg21.link/p0515) - [P0768R1 Library support for the spaceship (comparison) operator](http://wg21.link/p0768) -- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) \ No newline at end of file +- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) diff --git a/reference/compare/partial_ordering/op_greater.md b/reference/compare/partial_ordering/op_greater.md index d00a679b22..ca9b75eac2 100644 --- a/reference/compare/partial_ordering/op_greater.md +++ b/reference/compare/partial_ordering/op_greater.md @@ -86,11 +86,11 @@ false ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) ## 参照 - [P0515R3 Consistent comparison](http://wg21.link/p0515) - [P0768R1 Library support for the spaceship (comparison) operator](http://wg21.link/p0768) -- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) \ No newline at end of file +- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) diff --git a/reference/compare/partial_ordering/op_greater_equal.md b/reference/compare/partial_ordering/op_greater_equal.md index 211fb6afba..912b027b88 100644 --- a/reference/compare/partial_ordering/op_greater_equal.md +++ b/reference/compare/partial_ordering/op_greater_equal.md @@ -85,11 +85,11 @@ false ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) ## 参照 - [P0515R3 Consistent comparison](http://wg21.link/p0515) - [P0768R1 Library support for the spaceship (comparison) operator](http://wg21.link/p0768) -- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) \ No newline at end of file +- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) diff --git a/reference/compare/partial_ordering/op_less.md b/reference/compare/partial_ordering/op_less.md index 3f5e6405cb..26c63c9add 100644 --- a/reference/compare/partial_ordering/op_less.md +++ b/reference/compare/partial_ordering/op_less.md @@ -86,11 +86,11 @@ false ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) ## 参照 - [P0515R3 Consistent comparison](http://wg21.link/p0515) - [P0768R1 Library support for the spaceship (comparison) operator](http://wg21.link/p0768) -- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) \ No newline at end of file +- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) diff --git a/reference/compare/partial_ordering/op_less_equal.md b/reference/compare/partial_ordering/op_less_equal.md index b8f20372e7..519b48e594 100644 --- a/reference/compare/partial_ordering/op_less_equal.md +++ b/reference/compare/partial_ordering/op_less_equal.md @@ -86,11 +86,11 @@ false ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) ## 参照 - [P0515R3 Consistent comparison](http://wg21.link/p0515) - [P0768R1 Library support for the spaceship (comparison) operator](http://wg21.link/p0768) -- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) \ No newline at end of file +- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) diff --git a/reference/compare/partial_ordering/op_not_equal.md b/reference/compare/partial_ordering/op_not_equal.md index 0a941229ef..986a40bfe6 100644 --- a/reference/compare/partial_ordering/op_not_equal.md +++ b/reference/compare/partial_ordering/op_not_equal.md @@ -89,11 +89,11 @@ true ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) ## 参照 - [P0515R3 Consistent comparison](http://wg21.link/p0515) - [P0768R1 Library support for the spaceship (comparison) operator](http://wg21.link/p0768) -- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) \ No newline at end of file +- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) diff --git a/reference/compare/strong_order.md b/reference/compare/strong_order.md index 64de26fdb4..686fcd8147 100644 --- a/reference/compare/strong_order.md +++ b/reference/compare/strong_order.md @@ -170,7 +170,7 @@ true ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) - [`strong_ordering`](strong_ordering.md) - [`compare_strong_order_fallback`](compare_strong_order_fallback.md) diff --git a/reference/compare/strong_ordering.md b/reference/compare/strong_ordering.md index 97723685ce..8b10e1c74e 100644 --- a/reference/compare/strong_ordering.md +++ b/reference/compare/strong_ordering.md @@ -125,7 +125,7 @@ true ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) ## 参照 diff --git a/reference/compare/strong_ordering/op_compare_3way.md b/reference/compare/strong_ordering/op_compare_3way.md index d97f1fdcc4..d82ad34d11 100644 --- a/reference/compare/strong_ordering/op_compare_3way.md +++ b/reference/compare/strong_ordering/op_compare_3way.md @@ -79,11 +79,11 @@ true ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) ## 参照 - [P0515R3 Consistent comparison](http://wg21.link/p0515) - [P0768R1 Library support for the spaceship (comparison) operator](http://wg21.link/p0768) -- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) \ No newline at end of file +- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) diff --git a/reference/compare/strong_ordering/op_equal.md b/reference/compare/strong_ordering/op_equal.md index 4db040e5a0..9f05e31d79 100644 --- a/reference/compare/strong_ordering/op_equal.md +++ b/reference/compare/strong_ordering/op_equal.md @@ -81,11 +81,11 @@ true ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) ## 参照 - [P0515R3 Consistent comparison](http://wg21.link/p0515) - [P0768R1 Library support for the spaceship (comparison) operator](http://wg21.link/p0768) -- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) \ No newline at end of file +- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) diff --git a/reference/compare/strong_ordering/op_greater.md b/reference/compare/strong_ordering/op_greater.md index 7b0f2d556f..711f8f9286 100644 --- a/reference/compare/strong_ordering/op_greater.md +++ b/reference/compare/strong_ordering/op_greater.md @@ -72,11 +72,11 @@ false ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) ## 参照 - [P0515R3 Consistent comparison](http://wg21.link/p0515) - [P0768R1 Library support for the spaceship (comparison) operator](http://wg21.link/p0768) -- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) \ No newline at end of file +- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) diff --git a/reference/compare/strong_ordering/op_greater_equal.md b/reference/compare/strong_ordering/op_greater_equal.md index 739cac9d48..beca4eeda7 100644 --- a/reference/compare/strong_ordering/op_greater_equal.md +++ b/reference/compare/strong_ordering/op_greater_equal.md @@ -72,11 +72,11 @@ true ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) ## 参照 - [P0515R3 Consistent comparison](http://wg21.link/p0515) - [P0768R1 Library support for the spaceship (comparison) operator](http://wg21.link/p0768) -- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) \ No newline at end of file +- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) diff --git a/reference/compare/strong_ordering/op_less.md b/reference/compare/strong_ordering/op_less.md index c7284f17fc..a2c1c054e9 100644 --- a/reference/compare/strong_ordering/op_less.md +++ b/reference/compare/strong_ordering/op_less.md @@ -72,11 +72,11 @@ false ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) ## 参照 - [P0515R3 Consistent comparison](http://wg21.link/p0515) - [P0768R1 Library support for the spaceship (comparison) operator](http://wg21.link/p0768) -- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) \ No newline at end of file +- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) diff --git a/reference/compare/strong_ordering/op_less_equal.md b/reference/compare/strong_ordering/op_less_equal.md index 412e91cf4c..0384e8a824 100644 --- a/reference/compare/strong_ordering/op_less_equal.md +++ b/reference/compare/strong_ordering/op_less_equal.md @@ -72,11 +72,11 @@ true ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) ## 参照 - [P0515R3 Consistent comparison](http://wg21.link/p0515) - [P0768R1 Library support for the spaceship (comparison) operator](http://wg21.link/p0768) -- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) \ No newline at end of file +- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) diff --git a/reference/compare/strong_ordering/op_not_equal.md b/reference/compare/strong_ordering/op_not_equal.md index 7fdd3d911d..e2fb0d7f30 100644 --- a/reference/compare/strong_ordering/op_not_equal.md +++ b/reference/compare/strong_ordering/op_not_equal.md @@ -77,11 +77,11 @@ false ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) ## 参照 - [P0515R3 Consistent comparison](http://wg21.link/p0515) - [P0768R1 Library support for the spaceship (comparison) operator](http://wg21.link/p0768) -- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) \ No newline at end of file +- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) diff --git a/reference/compare/three_way_comparable.md b/reference/compare/three_way_comparable.md index d16b280be3..bd25f06c34 100644 --- a/reference/compare/three_way_comparable.md +++ b/reference/compare/three_way_comparable.md @@ -261,7 +261,7 @@ int main() { ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) ## 参照 diff --git a/reference/compare/weak_order.md b/reference/compare/weak_order.md index 7e6069b1ea..cc44775a84 100644 --- a/reference/compare/weak_order.md +++ b/reference/compare/weak_order.md @@ -182,7 +182,7 @@ true ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) - [`strong_order`](strong_order.md) - [`weak_ordering`](weak_ordering.md) - [`compare_weak_order_fallback`](compare_weak_order_fallback.md) diff --git a/reference/compare/weak_ordering.md b/reference/compare/weak_ordering.md index da308443b7..0f20437fee 100644 --- a/reference/compare/weak_ordering.md +++ b/reference/compare/weak_ordering.md @@ -160,7 +160,7 @@ true ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) ## 参照 diff --git a/reference/compare/weak_ordering/op_compare_3way.md b/reference/compare/weak_ordering/op_compare_3way.md index 8f6ff7211a..5244944bbb 100644 --- a/reference/compare/weak_ordering/op_compare_3way.md +++ b/reference/compare/weak_ordering/op_compare_3way.md @@ -79,11 +79,11 @@ true ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) ## 参照 - [P0515R3 Consistent comparison](http://wg21.link/p0515) - [P0768R1 Library support for the spaceship (comparison) operator](http://wg21.link/p0768) -- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) \ No newline at end of file +- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) diff --git a/reference/compare/weak_ordering/op_equal.md b/reference/compare/weak_ordering/op_equal.md index 60ea498bba..f7f8ec4a22 100644 --- a/reference/compare/weak_ordering/op_equal.md +++ b/reference/compare/weak_ordering/op_equal.md @@ -81,11 +81,11 @@ true ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) ## 参照 - [P0515R3 Consistent comparison](http://wg21.link/p0515) - [P0768R1 Library support for the spaceship (comparison) operator](http://wg21.link/p0768) -- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) \ No newline at end of file +- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) diff --git a/reference/compare/weak_ordering/op_greater.md b/reference/compare/weak_ordering/op_greater.md index 2c847feaf5..fcfeb7a2a6 100644 --- a/reference/compare/weak_ordering/op_greater.md +++ b/reference/compare/weak_ordering/op_greater.md @@ -72,11 +72,11 @@ false ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) ## 参照 - [P0515R3 Consistent comparison](http://wg21.link/p0515) - [P0768R1 Library support for the spaceship (comparison) operator](http://wg21.link/p0768) -- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) \ No newline at end of file +- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) diff --git a/reference/compare/weak_ordering/op_greater_equal.md b/reference/compare/weak_ordering/op_greater_equal.md index 3780b9f210..e9f29e615a 100644 --- a/reference/compare/weak_ordering/op_greater_equal.md +++ b/reference/compare/weak_ordering/op_greater_equal.md @@ -72,11 +72,11 @@ true ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) ## 参照 - [P0515R3 Consistent comparison](http://wg21.link/p0515) - [P0768R1 Library support for the spaceship (comparison) operator](http://wg21.link/p0768) -- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) \ No newline at end of file +- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) diff --git a/reference/compare/weak_ordering/op_less.md b/reference/compare/weak_ordering/op_less.md index 6ea35588ca..2220e5041c 100644 --- a/reference/compare/weak_ordering/op_less.md +++ b/reference/compare/weak_ordering/op_less.md @@ -72,11 +72,11 @@ false ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) ## 参照 - [P0515R3 Consistent comparison](http://wg21.link/p0515) - [P0768R1 Library support for the spaceship (comparison) operator](http://wg21.link/p0768) -- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) \ No newline at end of file +- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) diff --git a/reference/compare/weak_ordering/op_less_equal.md b/reference/compare/weak_ordering/op_less_equal.md index 814de49488..29a6441494 100644 --- a/reference/compare/weak_ordering/op_less_equal.md +++ b/reference/compare/weak_ordering/op_less_equal.md @@ -72,11 +72,11 @@ true ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) ## 参照 - [P0515R3 Consistent comparison](http://wg21.link/p0515) - [P0768R1 Library support for the spaceship (comparison) operator](http://wg21.link/p0768) -- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) \ No newline at end of file +- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) diff --git a/reference/compare/weak_ordering/op_not_equal.md b/reference/compare/weak_ordering/op_not_equal.md index b13ea01d0d..05fd85355b 100644 --- a/reference/compare/weak_ordering/op_not_equal.md +++ b/reference/compare/weak_ordering/op_not_equal.md @@ -77,11 +77,11 @@ false ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) ## 参照 - [P0515R3 Consistent comparison](http://wg21.link/p0515) - [P0768R1 Library support for the spaceship (comparison) operator](http://wg21.link/p0768) -- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) \ No newline at end of file +- [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) diff --git a/reference/map/map.md b/reference/map/map.md index 6c8e0a2335..f87575b987 100644 --- a/reference/map/map.md +++ b/reference/map/map.md @@ -418,7 +418,7 @@ int main() { ## 関連項目 -- [C++20 一貫比較](/lang/cpp20/consistent_comparison.md) +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) ## 参照 diff --git a/reference/source_location/source_location.md b/reference/source_location/source_location.md index e15fec6026..fdd4cd6284 100644 --- a/reference/source_location/source_location.md +++ b/reference/source_location/source_location.md @@ -97,7 +97,7 @@ C言語から引き継いだ定義済みマクロ`__LINE__`、`__FILE__`や[事 ## 関連項目 - [C++11 事前定義識別子`__func__`](/lang/cpp11/func.md) -- [C++20 即時関数](/lang/cpp20/immediate_functions.md) +- [C++20 常に定数式評価する`consteval`](/lang/cpp20/immediate_functions.md) ## 参照 diff --git a/reference/source_location/source_location/current.md b/reference/source_location/source_location/current.md index cb2d796783..b124100ec1 100644 --- a/reference/source_location/source_location/current.md +++ b/reference/source_location/source_location/current.md @@ -113,7 +113,7 @@ int main() - [Visual C++](/implementation.md#visual_cpp): ?? ## 関連項目 -- [C++20 即時関数](/lang/cpp20/immediate_functions.md) +- [C++20 常に定数式評価する`consteval`](/lang/cpp20/immediate_functions.md) ## 参照 From 77b552005374a32154d5dcd412a2e83a34fa00e2 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Thu, 11 Jul 2024 10:40:13 +0900 Subject: [PATCH 1035/3948] =?UTF-8?q?linalg=20:=20triangular=5Fmatrix=5Fle?= =?UTF-8?q?ft=5Fproduct=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 2 +- .../linalg/triangular_matrix_left_product.md | 191 ++++++++++++++++++ 2 files changed, 192 insertions(+), 1 deletion(-) create mode 100644 reference/linalg/triangular_matrix_left_product.md diff --git a/reference/linalg.md b/reference/linalg.md index 34306408cb..635897c5f6 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -102,7 +102,7 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に | [`symmetric_matrix_product`](linalg/symmetric_matrix_product.md) | xSYMM: 対称行列と行列の積を求める (function template) | C++26 | | [`hermitian_matrix_product`](linalg/hermitian_matrix_product.md) | xHEMM: ハミルトニアン行列と行列の積を求める (function template) | C++26 | | [`triangular_matrix_product`](linalg/triangular_matrix_product.md) | xTRMM: 三角行列と行列の積を求める (function template) | C++26 | -| `triangular_matrix_left_product` | xTRMM: In-placeに三角行列と行列の積を求める (function template) | C++26 | +| [`triangular_matrix_left_product`](linalg/triangular_matrix_left_product.md) | xTRMM: In-placeに三角行列と行列の積を求める (function template) | C++26 | | `triangular_matrix_right_product` | xTRMM: In-placeに三角行列と行列の積を求める (function template) | C++26 | | `symmetric_matrix_rank_k_update` | xSYRK: 対称行列のRank-k更新 (function template) | C++26 | | `hermitian_matrix_rank_k_update` | xHERK: ハミルトニアン行列のRank-k更新 (function template) | C++26 | diff --git a/reference/linalg/triangular_matrix_left_product.md b/reference/linalg/triangular_matrix_left_product.md new file mode 100644 index 0000000000..497f6a28e0 --- /dev/null +++ b/reference/linalg/triangular_matrix_left_product.md @@ -0,0 +1,191 @@ +# triangular_matrix_left_product + + +* [mathjax enable] +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + + +```cpp +namespace std::linalg { + template + void triangular_matrix_left_product( + InMat A, + Triangle t, + DiagonalStorage d, + InOutMat C); // (1) + + template + void triangular_matrix_left_product( + ExecutionPolicy&& exec, + InMat A, + Triangle t, + DiagonalStorage d, + InOutMat C); // (2) +} +``` + + +## 概要 +三角行列の上下と対角成分のアクセス方法を考慮した、三角行列と行列の積をin-placeに計算する。 + +- (1): 三角行列`A`と行列`C`に対し、$C \leftarrow AC$ +- (2): (1)を指定された実行ポリシーで実行する。 + + +## 適格要件 +- 共通 + + `DiagonalStorage`が[`implicit_unit_diagonal_t`](implicit_unit_diagonal_t.md)または[`explicit_diagonal_t`](explicit_diagonal_t.md) + + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) + + [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` + + `InMat`(`A`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) +- (2): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` + + +## 事前条件 +- [`multipliable`](multipliable.md)`(A, C, C)`が`true` +- `A.extent(0) == A.extent(1)` + + +## 効果 +- 三角行列`A`と行列`C`に対し、$C \leftarrow AC$ + + +## 戻り値 +なし + + +## 計算量 +$O(\verb|A.extent(0)| \times \verb|A.extent(1)| \times \verb|C.extent(0)|)$ + + +## 例 +**[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** + +```cpp example +#include +#include +#include +#include +#include + +template +void print_mat(const Matrix& A) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = 0; j < A.extent(1) - 1; ++j) { + std::cout << A[i, j] << ' '; + } + std::cout << A[i, A.extent(1) - 1] << '\n'; + } +} + +template +void init_mat(Matrix& A, typename Matrix::value_type geta = 1) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = 0; j < A.extent(1); ++j) { + A[i, j] = i * A.extent(1) + j + geta; + } + } +} + +template +void init_tria_mat(Matrix& A) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = i + 1; j < A.extent(1); ++j) { + A[i, j] = i * A.extent(1) + j; + } + } +} + +int main() +{ + constexpr size_t N = 2; + + using Scalar = double; + using Vector = std::vector; + using TriangularMatrix = std::mdspan< + Scalar, + std::extents, + std::linalg::layout_blas_packed< + std::linalg::upper_triangle_t, + std::linalg::row_major_t> + >; + + Vector A_vec(N * N); + Vector C_vec(N * N); + + TriangularMatrix A(A_vec.data()); + std::mdspan C(C_vec.data(), N, N); + + init_tria_mat(A); + init_mat(C); + + // (1) + std::cout << "(1)\n"; + std::linalg::triangular_matrix_left_product( + A, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + C); + print_mat(C); + + // (2) + init_mat(C); + std::cout << "(2)\n"; + std::linalg::triangular_matrix_left_product( + std::execution::par, + A, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + C); + print_mat(C); + + return 0; +} +``` + + +### 出力 +``` +(1) +1 3 +3 7 +(2) +1 3 +3 7 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution`](/reference/execution.md) +- [`mdspan`](/reference/mdspan.md) +- [`upper_triangle_t`](upper_triangle_t.md) +- [`lower_triangle_t`](lower_triangle_t.md) +- [`implicit_unit_diagonal_t`](implicit_unit_diagonal_t.md) +- [`explicit_diagonal_t`](explicit_diagonal_t.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) +- [LAPACK: trmm: triangular matrix-matrix multiply](https://netlib.org/lapack/explore-html/dd/dab/group__trmm.html) From 7282dc32844e625aae53da097a177c575b61df83 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Thu, 11 Jul 2024 10:40:50 +0900 Subject: [PATCH 1036/3948] =?UTF-8?q?linalg=20:=20=E4=BD=99=E8=A8=88?= =?UTF-8?q?=E3=81=AA=E3=82=AB=E3=83=83=E3=82=B3=E3=82=92=E5=89=8A=E9=99=A4?= =?UTF-8?q?=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/hermitian_matrix_product.md | 4 ++-- reference/linalg/symmetric_matrix_product.md | 4 ++-- reference/linalg/triangular_matrix_product.md | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/reference/linalg/hermitian_matrix_product.md b/reference/linalg/hermitian_matrix_product.md index cba4988bfd..dc3c1696ad 100644 --- a/reference/linalg/hermitian_matrix_product.md +++ b/reference/linalg/hermitian_matrix_product.md @@ -139,8 +139,8 @@ namespace std::linalg { ## 事前条件 - 共通 + [`multipliable`](multipliable.md)`(A, B, C) == true` -- (1), (2), (5), (6): [`A.extent(0) == A.extent(1)`] -- (3), (4), (7), (8): [`B.extent(0) == B.extent(1)`] +- (1), (2), (5), (6): `A.extent(0) == A.extent(1)` +- (3), (4), (7), (8): `B.extent(0) == B.extent(1)` - (5), (6), (7), (8): [`addable`](addable.md)`(E, E, C) == true` diff --git a/reference/linalg/symmetric_matrix_product.md b/reference/linalg/symmetric_matrix_product.md index 46a826621f..52897a0b58 100644 --- a/reference/linalg/symmetric_matrix_product.md +++ b/reference/linalg/symmetric_matrix_product.md @@ -139,8 +139,8 @@ namespace std::linalg { ## 事前条件 - 共通 + [`multipliable`](multipliable.md)`(A, B, C) == true` -- (1), (2), (5), (6): [`A.extent(0) == A.extent(1)`] -- (3), (4), (7), (8): [`B.extent(0) == B.extent(1)`] +- (1), (2), (5), (6): `A.extent(0) == A.extent(1)` +- (3), (4), (7), (8): `B.extent(0) == B.extent(1)` - (5), (6), (7), (8): [`addable`](addable.md)`(E, E, C) == true` diff --git a/reference/linalg/triangular_matrix_product.md b/reference/linalg/triangular_matrix_product.md index f6febd6485..8956496ec0 100644 --- a/reference/linalg/triangular_matrix_product.md +++ b/reference/linalg/triangular_matrix_product.md @@ -156,8 +156,8 @@ namespace std::linalg { ## 事前条件 - 共通 + [`multipliable`](multipliable.md)`(A, B, C) == true` -- (1), (2), (5), (6): [`A.extent(0) == A.extent(1)`] -- (3), (4), (7), (8): [`B.extent(0) == B.extent(1)`] +- (1), (2), (5), (6): `A.extent(0) == A.extent(1)` +- (3), (4), (7), (8): `B.extent(0) == B.extent(1)` - (5), (6), (7), (8): [`addable`](addable.md)`(E, E, C) == true` From 810f928e365029981b2e3e5e2baa9c48e4c22370 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 11 Jul 2024 14:40:21 +0900 Subject: [PATCH 1037/3948] =?UTF-8?q?=E3=82=B9=E3=83=9D=E3=83=B3=E3=82=B5?= =?UTF-8?q?=E3=83=BC=E8=BF=BD=E5=8A=A0=EF=BC=9A=20=E3=83=86=E3=82=AF?= =?UTF-8?q?=E3=83=8B=E3=82=AB=E3=83=AB=E3=82=A2=E3=83=BC=E3=83=84=E7=A4=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.md b/index.md index b3a161388e..6b60b0816a 100644 --- a/index.md +++ b/index.md @@ -107,6 +107,8 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい
pegasys
+
technical arts
+ ### ブロンズスポンサー From 94d1eced0b8ba8b85dbef3eeebc88ef1fca629a9 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 11 Jul 2024 14:47:56 +0900 Subject: [PATCH 1038/3948] =?UTF-8?q?=E3=83=AD=E3=82=B4=E3=82=B5=E3=82=A4?= =?UTF-8?q?=E3=82=BA=E3=82=92=E8=AA=BF=E6=95=B4=20#1297?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.md b/index.md index 6b60b0816a..bf53aa6f21 100644 --- a/index.md +++ b/index.md @@ -107,7 +107,7 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい
pegasys
-
technical arts
+
technical arts
### ブロンズスポンサー From 0ee79ff478e2f18eb89dc3a93bc1fbf85b8accdc Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 11 Jul 2024 18:31:02 +0900 Subject: [PATCH 1039/3948] linalg/vector_idx_abs_max: fix page title --- reference/linalg/vector_idx_abs_max.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/linalg/vector_idx_abs_max.md b/reference/linalg/vector_idx_abs_max.md index 87b5300fc0..63d50f909d 100644 --- a/reference/linalg/vector_idx_abs_max.md +++ b/reference/linalg/vector_idx_abs_max.md @@ -1,4 +1,4 @@ -# vector_abs_sum +# vector_idx_abs_sum * [mathjax enable] * linalg[meta header] From d73c2fc1e8347eae196749671ab4fa2ac56ed1be Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 11 Jul 2024 19:10:41 +0900 Subject: [PATCH 1040/3948] linalg: refine BLAS1 functions (#1233) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Markdownリストレイアウト崩れ修正 - 一部に内部リンク付与 - 例示コードのハイライト指定 --- reference/linalg/apply_givens_rotation.md | 5 +++-- reference/linalg/copy.md | 4 +++- reference/linalg/dot.md | 8 +++---- reference/linalg/dotc.md | 12 +++++----- reference/linalg/matrix_frob_norm.md | 18 +++++++-------- reference/linalg/matrix_inf_norm.md | 16 +++++++------- reference/linalg/matrix_one_norm.md | 16 +++++++------- reference/linalg/setup_givens_rotation.md | 11 ++++++---- .../linalg/setup_givens_rotation_result.md | 4 +++- reference/linalg/swap_elements.md | 2 ++ reference/linalg/vector_abs_sum.md | 20 ++++++++--------- reference/linalg/vector_idx_abs_max.md | 22 ++++++++++--------- reference/linalg/vector_sum_of_squares.md | 15 ++++++++----- reference/linalg/vector_two_norm.md | 18 +++++++-------- 14 files changed, 93 insertions(+), 78 deletions(-) diff --git a/reference/linalg/apply_givens_rotation.md b/reference/linalg/apply_givens_rotation.md index 11ff401f73..1e8d4ed205 100644 --- a/reference/linalg/apply_givens_rotation.md +++ b/reference/linalg/apply_givens_rotation.md @@ -50,6 +50,7 @@ namespace std::linalg { complex s); // (4) } ``` +* complex[link /reference/complex/complex.md] ## 概要 @@ -73,8 +74,8 @@ $$ ## 適格要件 - 共通: - + `Real`が`complex`を規定できる型であること - + [`compatible-static-extents`](/reference/linalg/compatible-static-extents.md)`(0,0) == true` + + `Real`が[`complex`](/reference/complex/complex.md)``を規定できる型であること + + [`compatible-static-extents`](/reference/linalg/compatible-static-extents.md)`(0,0) == true` - (2), (4): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` diff --git a/reference/linalg/copy.md b/reference/linalg/copy.md index 5863738090..668b6ff2c0 100644 --- a/reference/linalg/copy.md +++ b/reference/linalg/copy.md @@ -30,15 +30,17 @@ namespace std::linalg { ## テンプレートパラメータ制約 `x`と`y`の次元が等しくなければならない。 + - `x.rank() == y.rank()` ## 適格要件 -- (1), (2): 0以上`x.rank()`未満の整数rに対して、[`compatible-static-extents`](/reference/linalg/compatible-static-extents.md)`(r,r)`が`true` +- (1), (2): 0以上[`x.rank()`](/reference/mdspan/mdspan/rank.md)未満の整数`r`に対して、[`compatible-static-extents`](/reference/linalg/compatible-static-extents.md)`(r,r)`が`true` - (2): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` ## 事前条件 `x`と`y`の各次元の要素数が等しくなければならない。 + - `x.extents() == y.extents()` diff --git a/reference/linalg/dot.md b/reference/linalg/dot.md index 8dea516866..95bf0a5c3d 100644 --- a/reference/linalg/dot.md +++ b/reference/linalg/dot.md @@ -45,7 +45,7 @@ namespace std::linalg { ## 適格要件 - 共通: - + [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (2つのベクトルの静的な要素数が同じ) + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (2つのベクトルの静的な要素数が同じ) - (2), (4): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` @@ -58,8 +58,8 @@ namespace std::linalg { ## 効果 - (1), (2): なし - (3), (4): `T`を各ベクトルの値型の積の型`decltype(declval() * declval())`とする。 - + (3): `dot(v1, v2, T{})`を返す。 - + (4): `dot(std::forward(exec), v1, v2, T{})`を返す。 + + (3): `dot(v1, v2, T{})`を返す。 + + (4): `dot(std::forward(exec), v1, v2, T{})`を返す。 ## 戻り値 @@ -77,7 +77,7 @@ $$ ## 備考 -- (1), (2): もし`InVec1::value_type`、`InVec2::value_type`、`Scalar`が全て浮動小数点数型または`std::complex`の特殊化で、`Scalar`が`InVec1::value_type`と`InVec2::value_type`より精度が高い場合、和の各項は`Scalar`またはより高い精度の型が使われる。 +- (1), (2): もし`InVec1::value_type`、`InVec2::value_type`、`Scalar`が全て浮動小数点数型または[`std::complex`](/reference/complex/complex.md)の特殊化で、`Scalar`が`InVec1::value_type`と`InVec2::value_type`より精度が高い場合、和の各項は`Scalar`またはより高い精度の型が使われる。 ## 例 diff --git a/reference/linalg/dotc.md b/reference/linalg/dotc.md index 1349e6d16d..a8dd353507 100644 --- a/reference/linalg/dotc.md +++ b/reference/linalg/dotc.md @@ -45,7 +45,7 @@ namespace std::linalg { ## 適格要件 - 共通: - + [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (2つのベクトルの静的な要素数が同じ) + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (2つのベクトルの静的な要素数が同じ) - (2), (4): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` @@ -57,10 +57,10 @@ namespace std::linalg { ## 効果 - (1): [`dot`](dot.md)`(`[`conjugated`](conjugated.md)`(v1), v2, init)`を返す。 -- (2): `dot(std::forward(exec), conjugated(v1), v2, init)`を返す。 -- (3), (4): `T`を各ベクトルの値型の積の型`decltype(conj-if-needed(declval()) * declval())`とする。 - + (3): `dotc(v1, v2, T{})`を返す。 - + (4): `dotc(std::forward(exec), v1, v2, T{})`を返す。 +- (2): [`dot`](dot.md)`(std::forward(exec),` [`conjugated`](conjugated.md)`(v1), v2, init)`を返す。 +- (3), (4): `T`を各ベクトルの値型の積の型`decltype(`[`conj-if-needed`](conj-if-needed.md)`(declval()) * declval())`とする。 + + (3): `dotc(v1, v2, T{})`を返す。 + + (4): `dotc(std::forward(exec), v1, v2, T{})`を返す。 ## 戻り値 @@ -114,7 +114,7 @@ int main() return 0; } ``` - +* std::linalg::dotc[color ff0000] ### 出力 ``` diff --git a/reference/linalg/matrix_frob_norm.md b/reference/linalg/matrix_frob_norm.md index 544a175ec2..44a97bd118 100644 --- a/reference/linalg/matrix_frob_norm.md +++ b/reference/linalg/matrix_frob_norm.md @@ -38,13 +38,13 @@ namespace std::linalg { ## 適格要件 -- (1), (2): `decltype(init + `[`abs-if-needed`](abs-if-needed.md)`(declval()) * abs-if-needed(declval()))`が`Scalar`に変換可能。 +- (1), (2): `decltype(init +` [`abs-if-needed`](abs-if-needed.md)`(declval()) * abs-if-needed(declval()))`が`Scalar`に変換可能。 - (2), (4): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` ## 効果 -- (3), (4): `T`を`decltype(abs-if-needed(declval()) * abs-if-needed(declval()))`とすると、 - + (3): `matrix_frob_norm(A, T{})`を返す。 - + (4): `matrix_frob_norm(std::forward(exec), A, T{})`を返す。 +- (3), (4): `T`を`decltype(`[`abs-if-needed`](abs-if-needed.md)`(declval()) * abs-if-needed(declval()))`とすると、 + + (3): `matrix_frob_norm(A, T{})`を返す。 + + (4): `matrix_frob_norm(std::forward(exec), A, T{})`を返す。 ## 戻り値 @@ -54,13 +54,13 @@ $$ \sqrt{\sum_{i = 0}^{m - 1} \sum_{j = 0}^{n - 1} |\verb|A[|i, j\verb|]||^2 + \verb|init|^2} $$ -- (3), (4): `T`を`decltype(abs-if-needed(declval()) * abs-if-needed(declval()))`とすると、 - + (3): `matrix_frob_norm(A, T{})`を返す。 - + (4): `matrix_frob_norm(std::forward(exec), A, T{})`を返す。 +- (3), (4): `T`を`decltype(`[`abs-if-needed`](abs-if-needed.md)`(declval()) * abs-if-needed(declval()))`とすると、 + + (3): `matrix_frob_norm(A, T{})`を返す。 + + (4): `matrix_frob_norm(std::forward(exec), A, T{})`を返す。 ## 備考 -- (1), (2): もし`InMat::value_type`と`Scalar`がどちらも浮動小数点数型または`std::complex`の特殊化で、`Scalar`が`InMat::value_type`より精度が高い場合、和の各項は`Scalar`またはより高い精度の型が使われる。 +- (1), (2): もし`InMat::value_type`と`Scalar`がどちらも浮動小数点数型または[`std::complex`](/reference/complex/complex.md)の特殊化で、`Scalar`が`InMat::value_type`より精度が高い場合、和の各項は`Scalar`またはより高い精度の型が使われる。 ## 例 @@ -97,7 +97,7 @@ int main() return 0; } ``` - +* std::linalg::matrix_frob_norm[color ff0000] ### 出力 ``` diff --git a/reference/linalg/matrix_inf_norm.md b/reference/linalg/matrix_inf_norm.md index 76844e8537..f112728885 100644 --- a/reference/linalg/matrix_inf_norm.md +++ b/reference/linalg/matrix_inf_norm.md @@ -43,9 +43,9 @@ namespace std::linalg { ## 効果 -- (3), (4): `T`を`decltype(abs-if-needed(declval()))`とすると、 - + (3): `matrix_inf_norm(A, T{})`を返す。 - + (4): `matrix_inf_norm(std::forward(exec), A, T{})`を返す。 +- (3), (4): `T`を`decltype(`[`abs-if-needed`](abs-if-needed.md)`(declval()))`とすると、 + + (3): `matrix_inf_norm(A, T{})`を返す。 + + (4): `matrix_inf_norm(std::forward(exec), A, T{})`を返す。 ## 戻り値 @@ -57,13 +57,13 @@ $$ \verb|init| + \max_{i = 0, \dots ,m - 1}\sum_{j = 0}^{n - 1} |\verb|A[|i, j\verb|]|| $$ -- (3), (4): `T`を`decltype(abs-if-needed(declval()))`とすると、 - + (3): `matrix_inf_norm(A, T{})`を返す。 - + (4): `matrix_inf_norm(std::forward(exec), A, T{})`を返す。 +- (3), (4): `T`を`decltype(`[`abs-if-needed`](abs-if-needed.md)`(declval()))`とすると、 + + (3): `matrix_inf_norm(A, T{})`を返す。 + + (4): `matrix_inf_norm(std::forward(exec), A, T{})`を返す。 ## 備考 -- (1), (2): もし`InMat::value_type`と`Scalar`がどちらも浮動小数点数型または`std::complex`の特殊化で、`Scalar`が`InMat::value_type`より精度が高い場合、和の各項は`Scalar`またはより高い精度の型が使われる。 +- (1), (2): もし`InMat::value_type`と`Scalar`がどちらも浮動小数点数型または[`std::complex`](/reference/complex/complex.md)の特殊化で、`Scalar`が`InMat::value_type`より精度が高い場合、和の各項は`Scalar`またはより高い精度の型が使われる。 ## 例 @@ -100,7 +100,7 @@ int main() return 0; } ``` - +* std::linalg::matrix_inf_norm[color ff0000] ### 出力 ``` diff --git a/reference/linalg/matrix_one_norm.md b/reference/linalg/matrix_one_norm.md index a0cd520e9a..f736b56f97 100644 --- a/reference/linalg/matrix_one_norm.md +++ b/reference/linalg/matrix_one_norm.md @@ -43,9 +43,9 @@ namespace std::linalg { ## 効果 -- (3), (4): `T`を`decltype(abs-if-needed(declval()))`とすると、 - + (3): `matrix_one_norm(A, T{})`を返す。 - + (4): `matrix_one_norm(std::forward(exec), A, T{})`を返す。 +- (3), (4): `T`を`decltype(`[`abs-if-needed`](abs-if-needed.md)`(declval()))`とすると、 + + (3): `matrix_one_norm(A, T{})`を返す。 + + (4): `matrix_one_norm(std::forward(exec), A, T{})`を返す。 ## 戻り値 @@ -57,13 +57,13 @@ $$ \verb|init| + \max_{j = 0, \dots ,n - 1}\sum_{i = 0}^{m - 1} |\verb|A[|i, j\verb|]|| $$ -- (3), (4): `T`を`decltype(abs-if-needed(declval()))`とすると、 - + (3): `matrix_one_norm(A, T{})`を返す。 - + (4): `matrix_one_norm(std::forward(exec), A, T{})`を返す。 +- (3), (4): `T`を`decltype(`[`abs-if-needed`](abs-if-needed.md)`(declval()))`とすると、 + + (3): `matrix_one_norm(A, T{})`を返す。 + + (4): `matrix_one_norm(std::forward(exec), A, T{})`を返す。 ## 備考 -- (1), (2): もし`InMat::value_type`と`Scalar`がどちらも浮動小数点数型または`std::complex`の特殊化で、`Scalar`が`InMat::value_type`より精度が高い場合、和の各項は`Scalar`またはより高い精度の型が使われる。 +- (1), (2): もし`InMat::value_type`と`Scalar`がどちらも浮動小数点数型または[`std::complex`](/reference/complex/complex.md)の特殊化で、`Scalar`が`InMat::value_type`より精度が高い場合、和の各項は`Scalar`またはより高い精度の型が使われる。 ## 例 @@ -100,7 +100,7 @@ int main() return 0; } ``` - +* std::linalg::matrix_one_norm[color ff0000] ### 出力 ``` diff --git a/reference/linalg/setup_givens_rotation.md b/reference/linalg/setup_givens_rotation.md index 18c9bb4ac8..f91e115746 100644 --- a/reference/linalg/setup_givens_rotation.md +++ b/reference/linalg/setup_givens_rotation.md @@ -9,13 +9,16 @@ ```cpp namespace std::linalg { template - setup_givens_rotation_result setup_givens_rotation(Real a, Real b) noexcept; // (1) + setup_givens_rotation_result + setup_givens_rotation(Real a, Real b) noexcept; // (1) template - setup_givens_rotation_result> setup_givens_rotation(complex a, complex b) noexcept; // (2) + setup_givens_rotation_result> + setup_givens_rotation(complex a, complex b) noexcept; // (2) } ``` - +* setup_givens_rotation_result[link setup_givens_rotation_result.md] +* complex[link /reference/complex/complex.md] ## 概要 ギブンス回転を計算する。すなわち、以下の式が成り立つような、`Real`型の値`c`と `s`, `r`を計算する。 @@ -53,7 +56,7 @@ $$ ## 適格要件 -- `Real`は`complex`が規定できる型であること。 +- `Real`は[`complex`](/reference/complex/complex.md)``が規定できる型であること。 ## 戻り値 diff --git a/reference/linalg/setup_givens_rotation_result.md b/reference/linalg/setup_givens_rotation_result.md index b38e24b361..5cd7204204 100644 --- a/reference/linalg/setup_givens_rotation_result.md +++ b/reference/linalg/setup_givens_rotation_result.md @@ -21,13 +21,15 @@ namespace std::linalg { }; } ``` +* complex[link /reference/complex/complex.md] + ## 概要 ギブンス回転の結果を表すクラス。詳しくは、[`setup_givens_rotation`](setup_givens_rotation.md)にて。 ## 適格要件 -- `Real`は`complex`が規定できる型であること。 +- `Real`は[`complex`](/reference/complex/complex.md)``が規定できる型であること。 ## 例 diff --git a/reference/linalg/swap_elements.md b/reference/linalg/swap_elements.md index 4fc87ae70b..a8be2a4869 100644 --- a/reference/linalg/swap_elements.md +++ b/reference/linalg/swap_elements.md @@ -30,6 +30,7 @@ namespace std::linalg { ## テンプレートパラメータ制約 `x`と`y`の次元が等しくなければならない。 + - `x.rank() == y.rank()` @@ -40,6 +41,7 @@ namespace std::linalg { ## 事前条件 `x`と`y`の各次元の要素数が等しくなければならない。 + - `x.extents() == y.extents()` diff --git a/reference/linalg/vector_abs_sum.md b/reference/linalg/vector_abs_sum.md index 837a368333..774fb08c27 100644 --- a/reference/linalg/vector_abs_sum.md +++ b/reference/linalg/vector_abs_sum.md @@ -37,25 +37,25 @@ namespace std::linalg { ## 適格要件 -- (1), (2): `decltype(init + `[`abs-if-needed`](abs-if-needed.md)`(`[`real-if-needed`](real-if-needed.md)`(declval())) + abs-if-needed(`[`imag-if-needed`](imag-if-needed.md)`(declval())))`が`Scalar`に変換可能。 +- (1), (2): `decltype(init +` [`abs-if-needed`](abs-if-needed.md)`(`[`real-if-needed`](real-if-needed.md)`(declval())) + abs-if-needed(`[`imag-if-needed`](imag-if-needed.md)`(declval())))`が`Scalar`に変換可能。 - (2), (4): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` ## 効果 - (3), (4): `T`を`typename InVec::value_type`とすると、 - + (3): `vector_abs_sum(v, T{})`を返す。 - + (4): `vector_abs_sum(std::forward(exec), v, T{})`を返す。 + + (3): `vector_abs_sum(v, T{})`を返す。 + + (4): `vector_abs_sum(std::forward(exec), v, T{})`を返す。 ## 戻り値 - (1), (2): `N`を`v`の次元`v.extent(0)`とすると、以下を返す。 - 1. もし`N`が0なら`init` - 2. そうでない場合、もし`InVec::value_type`が算術型なら以下の式の値 + - もし`N`が0なら`init` + - そうでない場合、もし`InVec::value_type`が算術型なら以下の式の値 $$ \sum_{i = 0}^{N - 1} |\verb|v[|i\verb|]|| + \verb|init| $$ - 3. そうでない場合、以下の式の値 + - そうでない場合、以下の式の値 $$ \sum_{i = 0}^{N - 1} \left\{|\mathrm{Re}(\verb|v[|i\verb|]|)| + |\mathrm{Im}(\verb|v[|i\verb|]|)|\right\} + \verb|init| @@ -63,12 +63,12 @@ $$ - (3), (4): `T`を`typename InVec::value_type`とすると、 - + (3): `vector_abs_sum(v, T{})`を返す。 - + (4): `vector_abs_sum(std::forward(exec), v, T{})`を返す。 + + (3): `vector_abs_sum(v, T{})`を返す。 + + (4): `vector_abs_sum(std::forward(exec), v, T{})`を返す。 ## 備考 -- (1), (2): もし`InVec::value_type`と`Scalar`がどちらも浮動小数点数型または`std::complex`の特殊化で、`Scalar`が`InVec::value_type`より精度が高い場合、和の各項は`Scalar`またはより高い精度の型が使われる。 +- (1), (2): もし`InVec::value_type`と`Scalar`がどちらも浮動小数点数型または[`std::complex`](/reference/complex/complex.md)の特殊化で、`Scalar`が`InVec::value_type`より精度が高い場合、和の各項は`Scalar`またはより高い精度の型が使われる。 ## 例 @@ -102,7 +102,7 @@ int main() return 0; } ``` - +* std::linalg::vector_abs_sum[color ff0000] ### 出力 ``` diff --git a/reference/linalg/vector_idx_abs_max.md b/reference/linalg/vector_idx_abs_max.md index 63d50f909d..85b4e234d8 100644 --- a/reference/linalg/vector_idx_abs_max.md +++ b/reference/linalg/vector_idx_abs_max.md @@ -32,16 +32,18 @@ namespace std::linalg { ## 戻り値 - (1), (2): `N`を`v`の次元`v.extent(0)`とすると、以下を返す。 - 1. もし`N`が0なら`std::numeric_limits::max()` - 2. そうでない場合、もし`InVec::value_type`が算術型なら絶対値が最大の最初の`v`の成分のインデックス。つまり、 - $$ - \argmax_{i = 0, \dots, N - 1} |\verb|v[|i\verb|]|| - $$ - 3. そうでない場合、 + + もし`N`が0なら[`std::numeric_limits`](/reference/limits/numeric_limits.md)`::max()` + + そうでない場合、もし`InVec::value_type`が算術型なら絶対値が最大の最初の`v`の成分のインデックス。つまり、 - $$ - \argmax_{i = 0, \dots, N - 1}\left\{|\mathrm{Re}(\verb|v[|i\verb|]|)| + |\mathrm{Im}(\verb|v[|i\verb|]|)|\right\} - $$ +$$ +\argmax_{i = 0, \dots, N - 1} |\verb|v[|i\verb|]|| +$$ + + + そうでない場合、 + +$$ +\argmax_{i = 0, \dots, N - 1}\left\{|\mathrm{Re}(\verb|v[|i\verb|]|)| + |\mathrm{Im}(\verb|v[|i\verb|]|)|\right\} +$$ ## 例 @@ -73,7 +75,7 @@ int main() return 0; } ``` - +* std::linalg::vector_idx_abs_max[color ff0000] ### 出力 ``` diff --git a/reference/linalg/vector_sum_of_squares.md b/reference/linalg/vector_sum_of_squares.md index 98ed9076e9..be29e69b50 100644 --- a/reference/linalg/vector_sum_of_squares.md +++ b/reference/linalg/vector_sum_of_squares.md @@ -22,6 +22,7 @@ namespace std::linalg { sum_of_squares_result init); // (2) } ``` +* sum_of_squares_result[link sum_of_squares_result.md] ## 概要 @@ -33,6 +34,7 @@ namespace std::linalg { return std::pow(result.scaling_factor, 2) * result.scaled_sum_of_squares; } ``` +* sum_of_squares_result[link sum_of_squares_result.md] を定義すると、以下の式が成り立つように計算する。 @@ -49,19 +51,19 @@ $$ ## 効果 -- (1): 以下の条件を満たす`sum_of_squares_result`型の値`result`を返す。 - + `result.scaling_factor`が`init.scaling_factor`と$\max_{i = 0, \dots, n - 1}|\verb|v[|i\verb|]||$の最大値。ただし、`n`は`v`の次元である。 - + 概要に記載した式を満たす。 +- (1): 以下の条件を満たす[`sum_of_squares_result`](sum_of_squares_result.md)``型の値`result`を返す。 + + `result.scaling_factor`が`init.scaling_factor`と$\max_{i = 0, \dots, n - 1}|\verb|v[|i\verb|]||$の最大値。ただし、`n`は`v`の次元である。 + + 概要に記載した式を満たす。 - (2): (1)の並列アルゴリズム版。 ## 戻り値 -`sum_of_squares_result` +[`sum_of_squares_result`](sum_of_squares_result.md)`` ## 備考 - `init.scaled_sum_of_squares`は0以上でなければならない。 -- もし`InVec::value_type`と`Scalar`がどちらも浮動小数点数型または`std::complex`の特殊化で、`Scalar`が`InVec::value_type`より精度が高い場合、和の各項は`Scalar`またはより高い精度の型が使われる。 +- もし`InVec::value_type`と`Scalar`がどちらも浮動小数点数型または[`std::complex`](/reference/complex/complex.md)の特殊化で、`Scalar`が`InVec::value_type`より精度が高い場合、和の各項は`Scalar`またはより高い精度の型が使われる。 ## 例 @@ -109,7 +111,8 @@ int main() return 0; } ``` - +* std::linalg::vector_sum_of_squares[color ff0000] +* std::linalg::sum_of_squares_result[link sum_of_squares_result.md] ### 出力 ``` diff --git a/reference/linalg/vector_two_norm.md b/reference/linalg/vector_two_norm.md index 1178dc20cc..46ce843d5e 100644 --- a/reference/linalg/vector_two_norm.md +++ b/reference/linalg/vector_two_norm.md @@ -37,14 +37,14 @@ namespace std::linalg { ## 適格要件 -- (1), (2): `decltype(init + `[`abs-if-needed`](abs-if-needed.md)`(declval()) * abs-if-needed(declval()))`が`Scalar`に変換可能。 +- (1), (2): `decltype(init +` [`abs-if-needed`](abs-if-needed.md)`(declval()) * abs-if-needed(declval()))`が`Scalar`に変換可能。 - (2), (4): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` ## 効果 -- (3), (4): `T`を`decltype(abs-if-needed(declval()) * abs-if-needed(declval()))`とすると、 - + (3): `vector_two_norm(v, T{})`を返す。 - + (4): `vector_two_norm(std::forward(exec), v, T{})`を返す。 +- (3), (4): `T`を`decltype(`[`abs-if-needed`](abs-if-needed.md)`(declval()) * abs-if-needed(declval()))`とすると、 + + (3): `vector_two_norm(v, T{})`を返す。 + + (4): `vector_two_norm(std::forward(exec), v, T{})`を返す。 ## 戻り値 @@ -55,13 +55,13 @@ $$ $$ -- (3), (4): `T`を`decltype(abs-if-needed(declval()) * abs-if-needed(declval()))`とすると、 - + (3): `vector_two_norm(v, T{})`を返す。 - + (4): `vector_two_norm(std::forward(exec), v, T{})`を返す。 +- (3), (4): `T`を`decltype(`[`abs-if-needed`](abs-if-needed.md)`(declval()) * abs-if-needed(declval()))`とすると、 + + (3): `vector_two_norm(v, T{})`を返す。 + + (4): `vector_two_norm(std::forward(exec), v, T{})`を返す。 ## 備考 -- (1), (2): もし`InVec::value_type`と`Scalar`がどちらも浮動小数点数型または`std::complex`の特殊化で、`Scalar`が`InVec::value_type`より精度が高い場合、和の各項は`Scalar`またはより高い精度の型が使われる。 +- (1), (2): もし`InVec::value_type`と`Scalar`がどちらも浮動小数点数型または[`std::complex`](/reference/complex/complex.md)の特殊化で、`Scalar`が`InVec::value_type`より精度が高い場合、和の各項は`Scalar`またはより高い精度の型が使われる。 ## 例 @@ -95,7 +95,7 @@ int main() return 0; } ``` - +* std::linalg::vector_two_norm[color ff0000] ### 出力 ``` From 0909134b7d506ed4734efccde10f97c93320f410 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Fri, 12 Jul 2024 10:08:28 +0900 Subject: [PATCH 1041/3948] =?UTF-8?q?linalg=20:=20triangular=5Fmatrix=5Fri?= =?UTF-8?q?ght=5Fproduct=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 2 +- .../linalg/triangular_matrix_right_product.md | 191 ++++++++++++++++++ 2 files changed, 192 insertions(+), 1 deletion(-) create mode 100644 reference/linalg/triangular_matrix_right_product.md diff --git a/reference/linalg.md b/reference/linalg.md index 635897c5f6..bfd8c8a400 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -103,7 +103,7 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に | [`hermitian_matrix_product`](linalg/hermitian_matrix_product.md) | xHEMM: ハミルトニアン行列と行列の積を求める (function template) | C++26 | | [`triangular_matrix_product`](linalg/triangular_matrix_product.md) | xTRMM: 三角行列と行列の積を求める (function template) | C++26 | | [`triangular_matrix_left_product`](linalg/triangular_matrix_left_product.md) | xTRMM: In-placeに三角行列と行列の積を求める (function template) | C++26 | -| `triangular_matrix_right_product` | xTRMM: In-placeに三角行列と行列の積を求める (function template) | C++26 | +| [`triangular_matrix_right_product`](linalg/triangular_matrix_right_product.md) | xTRMM: In-placeに三角行列と行列の積を求める (function template) | C++26 | | `symmetric_matrix_rank_k_update` | xSYRK: 対称行列のRank-k更新 (function template) | C++26 | | `hermitian_matrix_rank_k_update` | xHERK: ハミルトニアン行列のRank-k更新 (function template) | C++26 | | `symmetric_matrix_rank_2k_update` | xSYR2K: 対称行列のRank-2k更新 (function template) | C++26 | diff --git a/reference/linalg/triangular_matrix_right_product.md b/reference/linalg/triangular_matrix_right_product.md new file mode 100644 index 0000000000..2e0925d431 --- /dev/null +++ b/reference/linalg/triangular_matrix_right_product.md @@ -0,0 +1,191 @@ +# triangular_matrix_right_product + + +* [mathjax enable] +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + + +```cpp +namespace std::linalg { + template + void triangular_matrix_right_product( + InMat A, + Triangle t, + DiagonalStorage d, + InOutMat C); // (1) + + template + void triangular_matrix_right_product( + ExecutionPolicy&& exec, + InMat A, + Triangle t, + DiagonalStorage d, + InOutMat C); // (2) +} +``` + + +## 概要 +三角行列の上下と対角成分のアクセス方法を考慮した、三角行列と行列の積をin-placeに計算する。 + +- (1): 三角行列`A`と行列`C`に対し、$C \leftarrow CA$ +- (2): (1)を指定された実行ポリシーで実行する。 + + +## 適格要件 +- 共通 + + `DiagonalStorage`が[`implicit_unit_diagonal_t`](implicit_unit_diagonal_t.md)または[`explicit_diagonal_t`](explicit_diagonal_t.md) + + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) + + [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` + + `InMat`(`A`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) +- (2): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` + + +## 事前条件 +- [`multipliable`](multipliable.md)`(C, A, C)`が`true` +- `A.extent(0) == A.extent(1)` + + +## 効果 +- 三角行列`A`と行列`C`に対し、$C \leftarrow CA$ + + +## 戻り値 +なし + + +## 計算量 +$O(\verb|A.extent(0)| \times \verb|A.extent(1)| \times \verb|C.extent(0)|)$ + + +## 例 +**[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** + +```cpp example +#include +#include +#include +#include +#include + +template +void print_mat(const Matrix& A) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = 0; j < A.extent(1) - 1; ++j) { + std::cout << A[i, j] << ' '; + } + std::cout << A[i, A.extent(1) - 1] << '\n'; + } +} + +template +void init_mat(Matrix& A, typename Matrix::value_type geta = 1) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = 0; j < A.extent(1); ++j) { + A[i, j] = i * A.extent(1) + j + geta; + } + } +} + +template +void init_tria_mat(Matrix& A) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = i + 1; j < A.extent(1); ++j) { + A[i, j] = i * A.extent(1) + j; + } + } +} + +int main() +{ + constexpr size_t N = 2; + + using Scalar = double; + using Vector = std::vector; + using TriangularMatrix = std::mdspan< + Scalar, + std::extents, + std::linalg::layout_blas_packed< + std::linalg::upper_triangle_t, + std::linalg::row_major_t> + >; + + Vector A_vec(N * N); + Vector C_vec(N * N); + + TriangularMatrix A(A_vec.data()); + std::mdspan C(C_vec.data(), N, N); + + init_tria_mat(A); + init_mat(C); + + // (1) + std::cout << "(1)\n"; + std::linalg::triangular_matrix_left_product( + A, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + C); + print_mat(C); + + // (2) + init_mat(C); + std::cout << "(2)\n"; + std::linalg::triangular_matrix_left_product( + std::execution::par, + A, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + C); + print_mat(C); + + return 0; +} +``` + + +### 出力 +``` +(1) +1 3 +3 7 +(2) +1 3 +3 7 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution`](/reference/execution.md) +- [`mdspan`](/reference/mdspan.md) +- [`upper_triangle_t`](upper_triangle_t.md) +- [`lower_triangle_t`](lower_triangle_t.md) +- [`implicit_unit_diagonal_t`](implicit_unit_diagonal_t.md) +- [`explicit_diagonal_t`](explicit_diagonal_t.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) +- [LAPACK: trmm: triangular matrix-matrix multiply](https://netlib.org/lapack/explore-html/dd/dab/group__trmm.html) From eac2703ed2e2f22bfc30756ecbcc34396716e202 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Fri, 12 Jul 2024 10:09:02 +0900 Subject: [PATCH 1042/3948] =?UTF-8?q?linalg=20:=20=E5=87=BA=E5=8A=9B?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/triangular_matrix_left_product.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/linalg/triangular_matrix_left_product.md b/reference/linalg/triangular_matrix_left_product.md index 497f6a28e0..7b4c1980df 100644 --- a/reference/linalg/triangular_matrix_left_product.md +++ b/reference/linalg/triangular_matrix_left_product.md @@ -158,11 +158,11 @@ int main() ### 出力 ``` (1) -1 3 -3 7 +4 6 +3 4 (2) -1 3 -3 7 +4 6 +3 4 ``` From 54b9c75adb0f7442d17ff489649e8a8eb980b740 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Fri, 12 Jul 2024 10:51:08 +0900 Subject: [PATCH 1043/3948] =?UTF-8?q?linalg=20:=20BLAS3=E3=81=AE=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E4=BE=8B=E3=81=AB=E3=83=AA=E3=83=B3=E3=82=AF?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/hermitian_matrix_product.md | 8 ++++++++ reference/linalg/matrix_product.md | 4 ++++ reference/linalg/symmetric_matrix_product.md | 8 ++++++++ reference/linalg/triangular_matrix_left_product.md | 9 +++++++++ reference/linalg/triangular_matrix_product.md | 9 +++++++++ reference/linalg/triangular_matrix_right_product.md | 9 +++++++++ 6 files changed, 47 insertions(+) diff --git a/reference/linalg/hermitian_matrix_product.md b/reference/linalg/hermitian_matrix_product.md index dc3c1696ad..06298e4c7d 100644 --- a/reference/linalg/hermitian_matrix_product.md +++ b/reference/linalg/hermitian_matrix_product.md @@ -302,6 +302,14 @@ int main() return 0; } ``` +* .extent[link /reference/mdspan/extents/extent.md] +* std::mdspan[link /reference/mdspan/mdspan.md] +* std::extents[link /reference/mdspan/extents.md] +* std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] +* std::linalg::upper_triangle_t[link /reference/linalg/upper_triangle_t.md] +* std::linalg::row_major_t[link /reference/linalg/row_major_t.md] +* std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] +* std::execution::par[link /reference/execution/execution/execution_policy.md] ### 出力 diff --git a/reference/linalg/matrix_product.md b/reference/linalg/matrix_product.md index a42c9c6560..0c6437d2c7 100644 --- a/reference/linalg/matrix_product.md +++ b/reference/linalg/matrix_product.md @@ -162,6 +162,10 @@ int main() return 0; } ``` +* .extent[link /reference/mdspan/extents/extent.md] +* std::mdspan[link /reference/mdspan/mdspan.md] +* std::extents[link /reference/mdspan/extents.md] +* std::execution::par[link /reference/execution/execution/execution_policy.md] ### 出力 diff --git a/reference/linalg/symmetric_matrix_product.md b/reference/linalg/symmetric_matrix_product.md index 52897a0b58..563d710939 100644 --- a/reference/linalg/symmetric_matrix_product.md +++ b/reference/linalg/symmetric_matrix_product.md @@ -300,6 +300,14 @@ int main() return 0; } ``` +* .extent[link /reference/mdspan/extents/extent.md] +* std::mdspan[link /reference/mdspan/mdspan.md] +* std::extents[link /reference/mdspan/extents.md] +* std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] +* std::linalg::upper_triangle_t[link /reference/linalg/upper_triangle_t.md] +* std::linalg::row_major_t[link /reference/linalg/row_major_t.md] +* std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] +* std::execution::par[link /reference/execution/execution/execution_policy.md] ### 出力 diff --git a/reference/linalg/triangular_matrix_left_product.md b/reference/linalg/triangular_matrix_left_product.md index 7b4c1980df..37c3bba97c 100644 --- a/reference/linalg/triangular_matrix_left_product.md +++ b/reference/linalg/triangular_matrix_left_product.md @@ -153,6 +153,15 @@ int main() return 0; } ``` +* .extent[link /reference/mdspan/extents/extent.md] +* std::mdspan[link /reference/mdspan/mdspan.md] +* std::extents[link /reference/mdspan/extents.md] +* std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] +* std::linalg::upper_triangle_t[link /reference/linalg/upper_triangle_t.md] +* std::linalg::row_major_t[link /reference/linalg/row_major_t.md] +* std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] +* std::linalg::implicit_unit_diagonal[link /reference/linalg/implicit_unit_diagonal_t.md] +* std::execution::par[link /reference/execution/execution/execution_policy.md] ### 出力 diff --git a/reference/linalg/triangular_matrix_product.md b/reference/linalg/triangular_matrix_product.md index 8956496ec0..5658be1be9 100644 --- a/reference/linalg/triangular_matrix_product.md +++ b/reference/linalg/triangular_matrix_product.md @@ -365,6 +365,15 @@ int main() return 0; } ``` +* .extent[link /reference/mdspan/extents/extent.md] +* std::mdspan[link /reference/mdspan/mdspan.md] +* std::extents[link /reference/mdspan/extents.md] +* std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] +* std::linalg::upper_triangle_t[link /reference/linalg/upper_triangle_t.md] +* std::linalg::row_major_t[link /reference/linalg/row_major_t.md] +* std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] +* std::linalg::implicit_unit_diagonal[link /reference/linalg/implicit_unit_diagonal_t.md] +* std::execution::par[link /reference/execution/execution/execution_policy.md] ### 出力 diff --git a/reference/linalg/triangular_matrix_right_product.md b/reference/linalg/triangular_matrix_right_product.md index 2e0925d431..734043ce38 100644 --- a/reference/linalg/triangular_matrix_right_product.md +++ b/reference/linalg/triangular_matrix_right_product.md @@ -153,6 +153,15 @@ int main() return 0; } ``` +* .extent[link /reference/mdspan/extents/extent.md] +* std::mdspan[link /reference/mdspan/mdspan.md] +* std::extents[link /reference/mdspan/extents.md] +* std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] +* std::linalg::upper_triangle_t[link /reference/linalg/upper_triangle_t.md] +* std::linalg::row_major_t[link /reference/linalg/row_major_t.md] +* std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] +* std::linalg::implicit_unit_diagonal[link /reference/linalg/implicit_unit_diagonal_t.md] +* std::execution::par[link /reference/execution/execution/execution_policy.md] ### 出力 From a65c8e5a3ff9f1334fee5ba5f7447dd96c262422 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Fri, 12 Jul 2024 10:54:58 +0900 Subject: [PATCH 1044/3948] =?UTF-8?q?linalg=20:=20=E4=B8=8D=E8=A6=81?= =?UTF-8?q?=E3=81=AA=E3=83=AA=E3=83=B3=E3=82=AF=E3=82=92=E5=89=8A=E9=99=A4?= =?UTF-8?q?=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/matrix_product.md | 1 - 1 file changed, 1 deletion(-) diff --git a/reference/linalg/matrix_product.md b/reference/linalg/matrix_product.md index 0c6437d2c7..f48f31a844 100644 --- a/reference/linalg/matrix_product.md +++ b/reference/linalg/matrix_product.md @@ -164,7 +164,6 @@ int main() ``` * .extent[link /reference/mdspan/extents/extent.md] * std::mdspan[link /reference/mdspan/mdspan.md] -* std::extents[link /reference/mdspan/extents.md] * std::execution::par[link /reference/execution/execution/execution_policy.md] From 2819232f6315dcf3440504bb89196840f051434f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 12 Jul 2024 11:29:46 +0900 Subject: [PATCH 1045/3948] =?UTF-8?q?poisson=5Fdistribution=20:=20?= =?UTF-8?q?=E4=BE=8B=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/random/poisson_distribution.md | 50 +++++++++++++++++++++--- 1 file changed, 45 insertions(+), 5 deletions(-) diff --git a/reference/random/poisson_distribution.md b/reference/random/poisson_distribution.md index d4939dae97..d9c3c52223 100644 --- a/reference/random/poisson_distribution.md +++ b/reference/random/poisson_distribution.md @@ -22,7 +22,7 @@ $$ p(x \mid \mu) = \frac{e^{-\mu} \mu^x}{x!} $$ この数式においてμ(mu)は、平均値(mean)である。 -ポワソン分布は、以下のような用途に使用できる: +ポワソン分布は、まれにしか起こらない事象が何回起こるかを求めるために使用できる確率分布である。以下のような用途に使用できる: - ある交差点で1時間に起きる事故の件数 - 国道1キロメートル当たりのレストランの数 @@ -80,6 +80,7 @@ $$ p(x \mid \mu) = \frac{e^{-\mu} \mu^x}{x!} $$ ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -104,7 +105,7 @@ int main() * std::ofstream[link /reference/fstream/basic_ofstream.md] * dist(engine)[link poisson_distribution/op_call.md] -### 出力 +#### 出力 ``` ``` @@ -112,19 +113,58 @@ int main() ![](https://raw.githubusercontent.com/cpprefjp/image/master/reference/random/poisson_distribution/poisson_distribution.png) + +### 地震が1ヶ月に平均1回起こるとして1年間をシミュレート +```cpp example +#include +#include + +int main() { + // 平均的に1ヶ月に1回の地震が起こるとする + double average_quakes = 1.0; + + std::random_device seed_gen; + std::default_random_engine engine{seed_gen()}; + std::poisson_distribution dist{average_quakes}; + + // 1年間 (12ヶ月) の地震の回数をシミュレート + for (int month = 1; month <= 12; ++month) { + int quakes = dist(engine); + std::cout << "Month " << month << ": " << quakes << " earthquake(s)\n"; + } +} +``` +* std::poisson_distribution[color ff0000] +* dist(engine)[link poisson_distribution/op_call.md] + +#### 出力例 +``` +Month 1: 1 earthquake(s) +Month 2: 2 earthquake(s) +Month 3: 2 earthquake(s) +Month 4: 0 earthquake(s) +Month 5: 0 earthquake(s) +Month 6: 1 earthquake(s) +Month 7: 1 earthquake(s) +Month 8: 1 earthquake(s) +Month 9: 2 earthquake(s) +Month 10: 2 earthquake(s) +Month 11: 2 earthquake(s) +Month 12: 1 earthquake(s) +``` + ## バージョン ### 言語 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): +- [Clang](/implementation.md#clang): 7 [mark verified] - [GCC](/implementation.md#gcc): 4.7.2 [mark verified] -- [ICC](/implementation.md#icc): - [Visual C++](/implementation.md#visual_cpp): ### 参考 - [ポワソン分布 - Wikipedia](https://ja.wikipedia.org/wiki/ポアソン分布) - [ポアソン分布 - 統計・データ解析](https://okumuralab.org/~okumura/stat/poisson.html) - [ポアソン分布 - NtRand](http://www.ntrand.com/jp/poisson-distribution/) - +- [[データ分析]ポアソン分布 ~ 100年に1人の天才は何人現れる?:やさしい確率分布 - @IT](https://atmarkit.itmedia.co.jp/ait/articles/2407/11/news002.html) From c7e4c78d7b4c106e9ba43a0c771aa937fe30d6f1 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 12 Jul 2024 11:47:00 +0900 Subject: [PATCH 1046/3948] =?UTF-8?q?exponential=5Fdistribution=20:=20?= =?UTF-8?q?=E4=BE=8B=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/random/exponential_distribution.md | 70 +++++++++++++++++++- 1 file changed, 67 insertions(+), 3 deletions(-) diff --git a/reference/random/exponential_distribution.md b/reference/random/exponential_distribution.md index 1bec2268ca..3382371064 100644 --- a/reference/random/exponential_distribution.md +++ b/reference/random/exponential_distribution.md @@ -79,6 +79,7 @@ $$ p(x \mid \lambda) = \lambda e^{-\lambda x} $$ ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -102,7 +103,7 @@ int main() * std::ofstream[link /reference/fstream/basic_ofstream.md] * dist(engine)[link exponential_distribution/op_call.md] -### 出力 +#### 出力 ``` ``` @@ -110,14 +111,77 @@ int main() ![](https://raw.githubusercontent.com/cpprefjp/image/master/reference/random/exponential_distribution/exponential_distribution.png) +### コールセンターに電話がかかってくる時間間隔をシミュレート +```cpp example +#include +#include + +int main() { + // 平均的に1時間に30回(1回あたり2分間隔)の電話がかかってくる + double average_calls_per_hour = 30.0; + + std::random_device seed_gen; + std::default_random_engine engine{seed_gen()}; + + // 指数分布を定義 (平均値は1/lambdaで定義されるため逆数をとる) + std::exponential_distribution dist{average_calls_per_hour / 60.0}; + + // 1時間分の電話の間隔をシミュレート + double time = 0; + while (time < 60) { + double wait_time = dist(engine); + time += wait_time; + if (time < 60) { + std::cout << "Phone call after " << wait_time << " minute wait\n"; + } + } +} +``` +* std::exponential_distribution[color ff0000] +* dist(engine)[link exponential_distribution/op_call.md] + +#### 出力例 +``` +Phone call after 0.118293 minute wait +Phone call after 2.67793 minute wait +Phone call after 3.46596 minute wait +Phone call after 1.58166 minute wait +Phone call after 0.704957 minute wait +Phone call after 2.09809 minute wait +Phone call after 0.168292 minute wait +Phone call after 1.05299 minute wait +Phone call after 3.4055 minute wait +Phone call after 1.06941 minute wait +Phone call after 4.99887 minute wait +Phone call after 3.4023 minute wait +Phone call after 3.37294 minute wait +Phone call after 1.69335 minute wait +Phone call after 1.21446 minute wait +Phone call after 0.765484 minute wait +Phone call after 0.590176 minute wait +Phone call after 0.0506416 minute wait +Phone call after 1.64168 minute wait +Phone call after 1.93174 minute wait +Phone call after 0.903994 minute wait +Phone call after 3.06768 minute wait +Phone call after 2.37803 minute wait +Phone call after 0.597241 minute wait +Phone call after 1.67885 minute wait +Phone call after 0.756916 minute wait +Phone call after 2.09694 minute wait +Phone call after 1.22043 minute wait +Phone call after 3.05816 minute wait +Phone call after 3.10884 minute wait +Phone call after 2.60918 minute wait +``` + ## バージョン ### 言語 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): +- [Clang](/implementation.md#clang): 7.1 [mark verified] - [GCC](/implementation.md#gcc): 4.7.2 [mark verified] -- [ICC](/implementation.md#icc): - [Visual C++](/implementation.md#visual_cpp): ### 参考 From 5e743f5713c1e34640d601c07ff7f8b03669871f Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Fri, 12 Jul 2024 12:22:35 +0900 Subject: [PATCH 1047/3948] =?UTF-8?q?linalg=20:=20=E3=83=AC=E3=82=A4?= =?UTF-8?q?=E3=82=A2=E3=82=A6=E3=83=88=E3=81=AE=E8=AA=BF=E6=95=B4=E3=81=A8?= =?UTF-8?q?argmax=E3=81=AE=E3=82=A8=E3=83=A9=E3=83=BC=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/vector_abs_sum.md | 18 +++++++++--------- reference/linalg/vector_idx_abs_max.md | 12 ++++++------ reference/linalg/vector_sum_of_squares.md | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/reference/linalg/vector_abs_sum.md b/reference/linalg/vector_abs_sum.md index 774fb08c27..d1f87f25f8 100644 --- a/reference/linalg/vector_abs_sum.md +++ b/reference/linalg/vector_abs_sum.md @@ -48,18 +48,18 @@ namespace std::linalg { ## 戻り値 - (1), (2): `N`を`v`の次元`v.extent(0)`とすると、以下を返す。 - - もし`N`が0なら`init` - - そうでない場合、もし`InVec::value_type`が算術型なら以下の式の値 + + もし`N`が0なら`init` + + そうでない場合、もし`InVec::value_type`が算術型なら以下の式の値 -$$ -\sum_{i = 0}^{N - 1} |\verb|v[|i\verb|]|| + \verb|init| -$$ + $$ + \sum_{i = 0}^{N - 1} |\verb|v[|i\verb|]|| + \verb|init| + $$ - - そうでない場合、以下の式の値 + + そうでない場合、以下の式の値 -$$ -\sum_{i = 0}^{N - 1} \left\{|\mathrm{Re}(\verb|v[|i\verb|]|)| + |\mathrm{Im}(\verb|v[|i\verb|]|)|\right\} + \verb|init| -$$ + $$ + \sum_{i = 0}^{N - 1} \left\{|\mathrm{Re}(\verb|v[|i\verb|]|)| + |\mathrm{Im}(\verb|v[|i\verb|]|)|\right\} + \verb|init| + $$ - (3), (4): `T`を`typename InVec::value_type`とすると、 diff --git a/reference/linalg/vector_idx_abs_max.md b/reference/linalg/vector_idx_abs_max.md index 85b4e234d8..756b4f8773 100644 --- a/reference/linalg/vector_idx_abs_max.md +++ b/reference/linalg/vector_idx_abs_max.md @@ -35,15 +35,15 @@ namespace std::linalg { + もし`N`が0なら[`std::numeric_limits`](/reference/limits/numeric_limits.md)`::max()` + そうでない場合、もし`InVec::value_type`が算術型なら絶対値が最大の最初の`v`の成分のインデックス。つまり、 -$$ -\argmax_{i = 0, \dots, N - 1} |\verb|v[|i\verb|]|| -$$ + $$ + \mathop{\mathrm{argmax}}\limits_{i = 0, \dots, N - 1} |\verb|v[|i\verb|]|| + $$ + そうでない場合、 -$$ -\argmax_{i = 0, \dots, N - 1}\left\{|\mathrm{Re}(\verb|v[|i\verb|]|)| + |\mathrm{Im}(\verb|v[|i\verb|]|)|\right\} -$$ + $$ + \mathop{\mathrm{argmax}}\limits_{i = 0, \dots, N - 1}\left\{|\mathrm{Re}(\verb|v[|i\verb|]|)| + |\mathrm{Im}(\verb|v[|i\verb|]|)|\right\} + $$ ## 例 diff --git a/reference/linalg/vector_sum_of_squares.md b/reference/linalg/vector_sum_of_squares.md index be29e69b50..8b546813bf 100644 --- a/reference/linalg/vector_sum_of_squares.md +++ b/reference/linalg/vector_sum_of_squares.md @@ -1,4 +1,4 @@ -# sum_of_squares_result +# vector_sum_of_squares * [mathjax enable] * linalg[meta header] From 9dae3cf32805754936870534e3910c277b37577d Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 12 Jul 2024 12:38:45 +0900 Subject: [PATCH 1048/3948] =?UTF-8?q?matrix=5Finf=5Fnorm=20/=20matrix=5Fon?= =?UTF-8?q?e=5Fnorm=20:=20=E7=95=AA=E5=8F=B7=E4=BB=98=E3=81=8D=E3=83=AA?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=81=8C=E9=80=9A=E5=B8=B8=E3=81=AE=E3=83=AA?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=81=AB=E3=81=AA=E3=81=A3=E3=81=A6=E3=81=97?= =?UTF-8?q?=E3=81=BE=E3=81=86=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=20#1298?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/linalg/matrix_inf_norm.md | 4 ++-- reference/linalg/matrix_one_norm.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/linalg/matrix_inf_norm.md b/reference/linalg/matrix_inf_norm.md index f112728885..93c3390e53 100644 --- a/reference/linalg/matrix_inf_norm.md +++ b/reference/linalg/matrix_inf_norm.md @@ -50,8 +50,8 @@ namespace std::linalg { ## 戻り値 - (1), (2): `A`が $m \times n$ 行列とすると、以下の値を返す。 - 1. もし、`m`が0なら`init` - 2. そうでないなら、以下の式の値 + 1. もし、`m`が0なら`init` + 2. そうでないなら、以下の式の値 $$ \verb|init| + \max_{i = 0, \dots ,m - 1}\sum_{j = 0}^{n - 1} |\verb|A[|i, j\verb|]|| diff --git a/reference/linalg/matrix_one_norm.md b/reference/linalg/matrix_one_norm.md index f736b56f97..e4d7e5c703 100644 --- a/reference/linalg/matrix_one_norm.md +++ b/reference/linalg/matrix_one_norm.md @@ -50,8 +50,8 @@ namespace std::linalg { ## 戻り値 - (1), (2): `A`が $m \times n$ 行列とすると、以下の値を返す。 - 1. もし、`n`が0なら`init` - 2. そうでないなら、以下の式の値 + 1. もし、`n`が0なら`init` + 2. そうでないなら、以下の式の値 $$ \verb|init| + \max_{j = 0, \dots ,n - 1}\sum_{i = 0}^{m - 1} |\verb|A[|i, j\verb|]|| From 94669bfb50f4fe4664568864d048a6f6377f8166 Mon Sep 17 00:00:00 2001 From: tshino Date: Fri, 12 Jul 2024 20:54:29 +0900 Subject: [PATCH 1049/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E3=82=B3?= =?UTF-8?q?=E3=83=A1=E3=83=B3=E3=83=88=E5=86=85=E3=81=AE=E6=8F=90=E6=A1=88?= =?UTF-8?q?=E6=96=87=E6=9B=B8=E7=95=AA=E5=8F=B7=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp17/if_constexpr.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/cpp17/if_constexpr.md b/lang/cpp17/if_constexpr.md index c2febe1f40..b417ae33fa 100644 --- a/lang/cpp17/if_constexpr.md +++ b/lang/cpp17/if_constexpr.md @@ -364,7 +364,7 @@ constexpr_if (condition) constexpr_else statement -// P0128R0 +// P0128R1 constexpr if (condition) statement constexpr_else constexpr if (condition) @@ -477,4 +477,4 @@ template int do_something(Args... args) { - [C++1z if constexpr文 - Faith and Brave - C++で遊ぼう](https://faithandbrave.hateblo.jp/entry/2016/12/22/171238) - [[cfe-dev] Clang getting involved](https://lists.llvm.org/pipermail/cfe-dev/2014-March/035801.html) - [`__if_exists` Statement | Microsoft Docs](https://docs.microsoft.com/ja-jp/cpp/cpp/if-exists-statement) -- [Issue 2518: Conformance requirements and #error/#warning - WG21 CWG Issues](https://wg21.cmeerw.net/cwg/issue2518) \ No newline at end of file +- [Issue 2518: Conformance requirements and #error/#warning - WG21 CWG Issues](https://wg21.cmeerw.net/cwg/issue2518) From 4b1055b6b5f81678b538ba9cfbdc6473ccdee1ef Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Sat, 13 Jul 2024 12:13:38 +0900 Subject: [PATCH 1050/3948] =?UTF-8?q?linalg=20:=20symmetric=5Fmatrix=5Fran?= =?UTF-8?q?k=5Fk=5Fupdate=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 2 +- .../linalg/symmetric_matrix_rank_k_update.md | 237 ++++++++++++++++++ 2 files changed, 238 insertions(+), 1 deletion(-) create mode 100644 reference/linalg/symmetric_matrix_rank_k_update.md diff --git a/reference/linalg.md b/reference/linalg.md index bfd8c8a400..ec44c480e6 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -104,7 +104,7 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に | [`triangular_matrix_product`](linalg/triangular_matrix_product.md) | xTRMM: 三角行列と行列の積を求める (function template) | C++26 | | [`triangular_matrix_left_product`](linalg/triangular_matrix_left_product.md) | xTRMM: In-placeに三角行列と行列の積を求める (function template) | C++26 | | [`triangular_matrix_right_product`](linalg/triangular_matrix_right_product.md) | xTRMM: In-placeに三角行列と行列の積を求める (function template) | C++26 | -| `symmetric_matrix_rank_k_update` | xSYRK: 対称行列のRank-k更新 (function template) | C++26 | +| [`symmetric_matrix_rank_k_update`](linalg/symmetric_matrix_rank_k_update.md) | xSYRK: 対称行列のRank-k更新 (function template) | C++26 | | `hermitian_matrix_rank_k_update` | xHERK: ハミルトニアン行列のRank-k更新 (function template) | C++26 | | `symmetric_matrix_rank_2k_update` | xSYR2K: 対称行列のRank-2k更新 (function template) | C++26 | | `hermitian_matrix_rank_2k_update` | xHER2K: ハミルトニアン行列のRank-2k更新 (function template) | C++26 | diff --git a/reference/linalg/symmetric_matrix_rank_k_update.md b/reference/linalg/symmetric_matrix_rank_k_update.md new file mode 100644 index 0000000000..70c09faacd --- /dev/null +++ b/reference/linalg/symmetric_matrix_rank_k_update.md @@ -0,0 +1,237 @@ +# symmetric_matrix_rank_k_update + + +* [mathjax enable] +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + + +```cpp +namespace std::linalg { + template + void symmetric_matrix_rank_k_update( + Scalar alpha, + InMat A, + InOutMat C, + Triangle t); // (1) + + template + void symmetric_matrix_rank_k_update( + ExecutionPolicy&& exec, + Scalar alpha, + InMat A, + InOutMat C, + Triangle t); // (2) + + template + void symmetric_matrix_rank_k_update( + InMat A, + InOutMat C, + Triangle t); // (3) + + template + void symmetric_matrix_rank_k_update( + ExecutionPolicy&& exec, + InMat A, + InOutMat C, + Triangle t); // (4) +} +``` + + +## 概要 +対称かつ共役を取らないrank-k updateを対称行列に行う。 +引数`t`は対称行列の成分が上三角にあるのか、それとも下三角にあるのかを示す。 + +- (1): $C \leftarrow C + \alpha AA^T$ +- (2): (1)を指定された実行ポリシーで実行する。 +- (3): $C \leftarrow C + AA^T$ +- (4): (3)を指定された実行ポリシーで実行する。 + + +## 適格要件 +- 共通: + + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) + + `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`C`が正方行列であること) + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (つまり`A`の次元と`C`の次元が同じであること) +- (2), (4): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` + + +## 事前条件 +- `A.extent(0) == A.extent(1)` +- `C.extent(0) == C.extent(1)` +- `A.extent(0) == C.extent(0)` + + +## 効果 +- (1), (2): $C \leftarrow C + \alpha AA^T$ +- (3), (4): $C \leftarrow C + AA^T$ + + +## 戻り値 +なし + + +## 計算量 +$O(\verb|A.extent(0)| \times \verb|A.extent(1)| \times \verb|C.extent(0)|)$ + + +## 例 +**[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** + +```cpp example +#include +#include +#include +#include +#include + +template +void print_mat(const Matrix& A) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = 0; j < i; ++j) { + std::cout << A[j, i] << ' '; + } + for(int j = i; j < A.extent(1) - 1; ++j) { + std::cout << A[i, j] << ' '; + } + std::cout << A[i, A.extent(1) - 1] << '\n'; + } +} + +template +void init_mat(Matrix& A) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = 0; j < A.extent(1); ++j) { + A[i,j] = A.extent(1) * i + j; + } + } +} + +template +void init_symm_mat(Matrix& A) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = i; j < A.extent(1); ++j) { + A[i, j] = i * A.extent(1) + j; + } + } +} + +int main() +{ + constexpr size_t N = 2; + + std::vector A_vec(N * N); + std::vector C_vec(N * N); + + std::mdspan A(A_vec.data()); + std::mdspan< + double, + std::extents, + std::linalg::layout_blas_packed< + std::linalg::upper_triangle_t, + std::linalg::row_major_t> + > C(C_vec.data()); + + init_mat(A); + init_symm_mat(C); + + // (1) + std::cout << "(1)\n"; + std::linalg::symmetric_matrix_rank_k_update( + -1.0, + A, + C, + std::linalg::upper_triangle); + print_mat(C); + + // (2) + init_symm_mat(C); + std::cout << "(2)\n"; + std::linalg::symmetric_matrix_rank_k_update( + std::execution::par, + -1.0, + A, + C, + std::linalg::upper_triangle); + print_mat(C); + + // (3) + init_symm_mat(C); + std::cout << "(3)\n"; + std::linalg::symmetric_matrix_rank_k_update( + A, + C, + std::linalg::upper_triangle); + print_mat(C); + + // (4) + init_symm_mat(C); + std::cout << "(4)\n"; + std::linalg::symmetric_matrix_rank_k_update( + std::execution::par, + A, + C, + std::linalg::upper_triangle); + print_mat(C); + + return 0; +} +``` + + +### 出力 +``` +(1) +-1 -2 +-2 -10 +(2) +-1 -2 +-2 -10 +(3) +1 4 +4 16 +(4) +1 4 +4 16 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution`](/reference/execution.md) +- [`mdspan`](/reference/mdspan.md) +- [`upper_triangle_t`](upper_triangle_t.md) +- [`lower_triangle_t`](lower_triangle_t.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) +- [LAPACK: {he,sy}rk: Hermitian/symmetric rank-k update](https://netlib.org/lapack/explore-html/d4/d6e/group__herk.html) + From 3ea73336ab1379ad7fecb28245aa46e989b924bc Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Sat, 13 Jul 2024 12:41:59 +0900 Subject: [PATCH 1051/3948] =?UTF-8?q?linalg=20:=20=E3=82=A4=E3=83=B3?= =?UTF-8?q?=E3=83=87=E3=83=B3=E3=83=88=E3=81=A8=E3=83=AA=E3=83=B3=E3=82=AF?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/hermitian_matrix_product.md | 20 +++++++++---------- reference/linalg/matrix_product.md | 3 ++- reference/linalg/symmetric_matrix_product.md | 18 ++++++++--------- .../linalg/symmetric_matrix_rank_k_update.md | 8 ++++++++ .../linalg/triangular_matrix_left_product.md | 12 +++++------ reference/linalg/triangular_matrix_product.md | 20 +++++++++---------- .../linalg/triangular_matrix_right_product.md | 12 +++++------ 7 files changed, 51 insertions(+), 42 deletions(-) diff --git a/reference/linalg/hermitian_matrix_product.md b/reference/linalg/hermitian_matrix_product.md index 06298e4c7d..83643973ab 100644 --- a/reference/linalg/hermitian_matrix_product.md +++ b/reference/linalg/hermitian_matrix_product.md @@ -124,21 +124,21 @@ namespace std::linalg { ## 適格要件 - 共通 - + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) - + [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` -- (1), (2), (5), (6): - + `InMat1`(`A`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 - + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) -- (3), (4), (7), (8): - + `InMat2`(`B`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 - + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`B`が正方行列であること) + + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) + + [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` + - (1), (2), (5), (6): + + `InMat1`(`A`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) + - (3), (4), (7), (8): + + `InMat2`(`B`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`B`が正方行列であること) - (5), (6), (7), (8): [`possibly-addable`](possibly-addable.md)`()`が`true` - (2), (4), (6), (8): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` ## 事前条件 - 共通 - + [`multipliable`](multipliable.md)`(A, B, C) == true` + + [`multipliable`](multipliable.md)`(A, B, C) == true` - (1), (2), (5), (6): `A.extent(0) == A.extent(1)` - (3), (4), (7), (8): `B.extent(0) == B.extent(1)` - (5), (6), (7), (8): [`addable`](addable.md)`(E, E, C) == true` @@ -302,7 +302,7 @@ int main() return 0; } ``` -* .extent[link /reference/mdspan/extents/extent.md] +* A.extent[link /reference/mdspan/extents/extent.md] * std::mdspan[link /reference/mdspan/mdspan.md] * std::extents[link /reference/mdspan/extents.md] * std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] diff --git a/reference/linalg/matrix_product.md b/reference/linalg/matrix_product.md index f48f31a844..e006869fd7 100644 --- a/reference/linalg/matrix_product.md +++ b/reference/linalg/matrix_product.md @@ -162,7 +162,8 @@ int main() return 0; } ``` -* .extent[link /reference/mdspan/extents/extent.md] +* A.extent[link /reference/mdspan/extents/extent.md] +* B.extent[link /reference/mdspan/extents/extent.md] * std::mdspan[link /reference/mdspan/mdspan.md] * std::execution::par[link /reference/execution/execution/execution_policy.md] diff --git a/reference/linalg/symmetric_matrix_product.md b/reference/linalg/symmetric_matrix_product.md index 563d710939..a17dcba485 100644 --- a/reference/linalg/symmetric_matrix_product.md +++ b/reference/linalg/symmetric_matrix_product.md @@ -124,14 +124,14 @@ namespace std::linalg { ## 適格要件 - 共通 - + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) - + [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` -- (1), (2), (5), (6): - + `InMat1`(`A`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 - + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) -- (3), (4), (7), (8): - + `InMat2`(`B`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 - + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`B`が正方行列であること) + + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) + + [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` + - (1), (2), (5), (6): + + `InMat1`(`A`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) + - (3), (4), (7), (8): + + `InMat2`(`B`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`B`が正方行列であること) - (5), (6), (7), (8): [`possibly-addable`](possibly-addable.md)`()`が`true` - (2), (4), (6), (8): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` @@ -300,7 +300,7 @@ int main() return 0; } ``` -* .extent[link /reference/mdspan/extents/extent.md] +* A.extent[link /reference/mdspan/extents/extent.md] * std::mdspan[link /reference/mdspan/mdspan.md] * std::extents[link /reference/mdspan/extents.md] * std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] diff --git a/reference/linalg/symmetric_matrix_rank_k_update.md b/reference/linalg/symmetric_matrix_rank_k_update.md index 70c09faacd..abe8000c43 100644 --- a/reference/linalg/symmetric_matrix_rank_k_update.md +++ b/reference/linalg/symmetric_matrix_rank_k_update.md @@ -194,6 +194,14 @@ int main() return 0; } ``` +* A.extent[link /reference/mdspan/extents/extent.md] +* std::mdspan[link /reference/mdspan/mdspan.md] +* std::extents[link /reference/mdspan/extents.md] +* std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] +* std::linalg::upper_triangle_t[link /reference/linalg/upper_triangle_t.md] +* std::linalg::row_major_t[link /reference/linalg/row_major_t.md] +* std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] +* std::execution::par[link /reference/execution/execution/execution_policy.md] ### 出力 diff --git a/reference/linalg/triangular_matrix_left_product.md b/reference/linalg/triangular_matrix_left_product.md index 37c3bba97c..1a7c574f23 100644 --- a/reference/linalg/triangular_matrix_left_product.md +++ b/reference/linalg/triangular_matrix_left_product.md @@ -44,11 +44,11 @@ namespace std::linalg { ## 適格要件 - 共通 - + `DiagonalStorage`が[`implicit_unit_diagonal_t`](implicit_unit_diagonal_t.md)または[`explicit_diagonal_t`](explicit_diagonal_t.md) - + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) - + [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` - + `InMat`(`A`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 - + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) + + `DiagonalStorage`が[`implicit_unit_diagonal_t`](implicit_unit_diagonal_t.md)または[`explicit_diagonal_t`](explicit_diagonal_t.md) + + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) + + [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` + + `InMat`(`A`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) - (2): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` @@ -153,7 +153,7 @@ int main() return 0; } ``` -* .extent[link /reference/mdspan/extents/extent.md] +* A.extent[link /reference/mdspan/extents/extent.md] * std::mdspan[link /reference/mdspan/mdspan.md] * std::extents[link /reference/mdspan/extents.md] * std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] diff --git a/reference/linalg/triangular_matrix_product.md b/reference/linalg/triangular_matrix_product.md index 5658be1be9..52fec14eea 100644 --- a/reference/linalg/triangular_matrix_product.md +++ b/reference/linalg/triangular_matrix_product.md @@ -140,15 +140,15 @@ namespace std::linalg { ## 適格要件 - 共通 - + `DiagonalStorage`が[`implicit_unit_diagonal_t`](implicit_unit_diagonal_t.md)または[`explicit_diagonal_t`](explicit_diagonal_t.md) - + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) - + [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` -- (1), (2), (5), (6): - + `InMat1`(`A`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 - + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) -- (3), (4), (7), (8): - + `InMat2`(`B`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 - + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`B`が正方行列であること) + + `DiagonalStorage`が[`implicit_unit_diagonal_t`](implicit_unit_diagonal_t.md)または[`explicit_diagonal_t`](explicit_diagonal_t.md) + + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) + + [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` + - (1), (2), (5), (6): + + `InMat1`(`A`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) + - (3), (4), (7), (8): + + `InMat2`(`B`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`B`が正方行列であること) - (5), (6), (7), (8): [`possibly-addable`](possibly-addable.md)`()`が`true` - (2), (4), (6), (8): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` @@ -365,7 +365,7 @@ int main() return 0; } ``` -* .extent[link /reference/mdspan/extents/extent.md] +* A.extent[link /reference/mdspan/extents/extent.md] * std::mdspan[link /reference/mdspan/mdspan.md] * std::extents[link /reference/mdspan/extents.md] * std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] diff --git a/reference/linalg/triangular_matrix_right_product.md b/reference/linalg/triangular_matrix_right_product.md index 734043ce38..563efbeb42 100644 --- a/reference/linalg/triangular_matrix_right_product.md +++ b/reference/linalg/triangular_matrix_right_product.md @@ -44,11 +44,11 @@ namespace std::linalg { ## 適格要件 - 共通 - + `DiagonalStorage`が[`implicit_unit_diagonal_t`](implicit_unit_diagonal_t.md)または[`explicit_diagonal_t`](explicit_diagonal_t.md) - + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) - + [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` - + `InMat`(`A`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 - + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) + + `DiagonalStorage`が[`implicit_unit_diagonal_t`](implicit_unit_diagonal_t.md)または[`explicit_diagonal_t`](explicit_diagonal_t.md) + + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) + + [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` + + `InMat`(`A`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) - (2): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` @@ -153,7 +153,7 @@ int main() return 0; } ``` -* .extent[link /reference/mdspan/extents/extent.md] +* A.extent[link /reference/mdspan/extents/extent.md] * std::mdspan[link /reference/mdspan/mdspan.md] * std::extents[link /reference/mdspan/extents.md] * std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] From 45af15c8adc0904949f31353ed9c09c7c7243813 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Sun, 14 Jul 2024 15:33:34 +0900 Subject: [PATCH 1052/3948] =?UTF-8?q?linalg=20:=20hermitian=5Fmatrix=5Fran?= =?UTF-8?q?k=5Fk=5Fupdate=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 2 +- .../linalg/hermitian_matrix_rank_k_update.md | 251 ++++++++++++++++++ 2 files changed, 252 insertions(+), 1 deletion(-) create mode 100644 reference/linalg/hermitian_matrix_rank_k_update.md diff --git a/reference/linalg.md b/reference/linalg.md index ec44c480e6..40cf13ca38 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -105,7 +105,7 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に | [`triangular_matrix_left_product`](linalg/triangular_matrix_left_product.md) | xTRMM: In-placeに三角行列と行列の積を求める (function template) | C++26 | | [`triangular_matrix_right_product`](linalg/triangular_matrix_right_product.md) | xTRMM: In-placeに三角行列と行列の積を求める (function template) | C++26 | | [`symmetric_matrix_rank_k_update`](linalg/symmetric_matrix_rank_k_update.md) | xSYRK: 対称行列のRank-k更新 (function template) | C++26 | -| `hermitian_matrix_rank_k_update` | xHERK: ハミルトニアン行列のRank-k更新 (function template) | C++26 | +| [`hermitian_matrix_rank_k_update`](linalg/hermitian_matrix_rank_k_update.md) | xHERK: ハミルトニアン行列のRank-k更新 (function template) | C++26 | | `symmetric_matrix_rank_2k_update` | xSYR2K: 対称行列のRank-2k更新 (function template) | C++26 | | `hermitian_matrix_rank_2k_update` | xHER2K: ハミルトニアン行列のRank-2k更新 (function template) | C++26 | | `triangular_matrix_matrix_left_solve` | xTRSM: 三角行列の連立一次方程式を解く (function template) | C++26 | diff --git a/reference/linalg/hermitian_matrix_rank_k_update.md b/reference/linalg/hermitian_matrix_rank_k_update.md new file mode 100644 index 0000000000..a30d7dda05 --- /dev/null +++ b/reference/linalg/hermitian_matrix_rank_k_update.md @@ -0,0 +1,251 @@ +# hermitian_matrix_rank_k_update + + +* [mathjax enable] +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + + +```cpp +namespace std::linalg { + template + void hermitian_matrix_rank_k_update( + Scalar alpha, + InMat A, + InOutMat C, + Triangle t); // (1) + + template + void hermitian_matrix_rank_k_update( + ExecutionPolicy&& exec, + Scalar alpha, + InMat A, + InOutMat C, + Triangle t); // (2) + + template + void hermitian_matrix_rank_k_update( + InMat A, + InOutMat C, + Triangle t); // (3) + + template + void hermitian_matrix_rank_k_update( + ExecutionPolicy&& exec, + InMat A, + InOutMat C, + Triangle t); // (4) +} +``` + + +## 概要 +エルミートな(対称かつ共役を取る)rank-k updateをエルミート行列に行う。 +引数`t`は対称行列の成分が上三角にあるのか、それとも下三角にあるのかを示す。 + +- (1): $C \leftarrow C + \alpha AA^*$ +- (2): (1)を指定された実行ポリシーで実行する。 +- (3): $C \leftarrow C + AA^*$ +- (4): (3)を指定された実行ポリシーで実行する。 + + +## 適格要件 +- 共通: + + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) + + `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`C`が正方行列であること) + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (つまり`A`の次元と`C`の次元が同じであること) +- (2), (4): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` + + +## 事前条件 +- `A.extent(0) == A.extent(1)` +- `C.extent(0) == C.extent(1)` +- `A.extent(0) == C.extent(0)` + + +## 効果 +- (1), (2): $C \leftarrow C + \alpha AA^*$ +- (3), (4): $C \leftarrow C + AA^*$ + + +## 戻り値 +なし + + +## 計算量 +$O(\verb|A.extent(0)| \times \verb|A.extent(1)| \times \verb|C.extent(0)|)$ + + +## 例 +**[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** + +```cpp example +#include +#include +#include +#include +#include + +template +void print_mat(const Matrix& A) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = 0; j < i; ++j) { + std::cout << A[j, i] << ' '; + } + for(int j = i; j < A.extent(1) - 1; ++j) { + std::cout << A[i, j] << ' '; + } + std::cout << A[i, A.extent(1) - 1] << '\n'; + } +} + +template +void init_mat(Matrix& A) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = 0; j < A.extent(1); ++j) { + A[i,j] = std::complex(i, j); + } + } +} + +template +void init_herm_mat(Matrix& A) { + for(int i = 0; i < A.extent(0); ++i) { + A[i, i] = std::complex(i, 0); + for(int j = i + 1; j < A.extent(1); ++j) { + A[i, j] = std::complex(i, j); + } + } +} + +int main() +{ + constexpr size_t N = 2; + + using Scalar = std::complex; + using Vector = std::vector; + using HermitianMatrix = std::mdspan< + Scalar, + std::extents, + std::linalg::layout_blas_packed< + std::linalg::upper_triangle_t, + std::linalg::row_major_t> + >; + + Vector A_vec(N * N); + Vector C_vec(N * N); + + std::mdspan A(A_vec.data()); + HermitianMatrix C(C_vec.data()); + + init_mat(A); + init_herm_mat(C); + + // (1) + std::cout << "(1)\n"; + std::linalg::hermitian_matrix_rank_k_update( + -1.0, + A, + C, + std::linalg::upper_triangle); + print_mat(C); + + // (2) + init_herm_mat(C); + std::cout << "(2)\n"; + std::linalg::hermitian_matrix_rank_k_update( + std::execution::par, + -1.0, + A, + C, + std::linalg::upper_triangle); + print_mat(C); + + // (3) + init_herm_mat(C); + std::cout << "(3)\n"; + std::linalg::hermitian_matrix_rank_k_update( + A, + C, + std::linalg::upper_triangle); + print_mat(C); + + // (4) + init_herm_mat(C); + std::cout << "(4)\n"; + std::linalg::hermitian_matrix_rank_k_update( + std::execution::par, + A, + C, + std::linalg::upper_triangle); + print_mat(C); + + return 0; +} +``` +* A.extent[link /reference/mdspan/extents/extent.md] +* std::mdspan[link /reference/mdspan/mdspan.md] +* std::extents[link /reference/mdspan/extents.md] +* std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] +* std::linalg::upper_triangle_t[link /reference/linalg/upper_triangle_t.md] +* std::linalg::row_major_t[link /reference/linalg/row_major_t.md] +* std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] +* std::execution::par[link /reference/execution/execution/execution_policy.md] +* std::linalg::hermitian_matrix_rank_k_update[color ff0000] + + +### 出力 +``` +(1) +(-1,0) (-1,0) +(-1,0) (-1,0) +(2) +(-1,0) (-1,0) +(-1,0) (-1,0) +(3) +(1,0) (1,2) +(1,-2) (3,0) +(4) +(1,0) (1,2) +(1,-2) (3,0) +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution`](/reference/execution.md) +- [`mdspan`](/reference/mdspan.md) +- [`upper_triangle_t`](upper_triangle_t.md) +- [`lower_triangle_t`](lower_triangle_t.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) +- [LAPACK: {he,sy}rk: Hermitian/symmetric rank-k update](https://netlib.org/lapack/explore-html/d4/d6e/group__herk.html) + From 96e31dd7ad4cda1805bec2830c56e21e72f6b585 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Sun, 14 Jul 2024 15:37:23 +0900 Subject: [PATCH 1053/3948] =?UTF-8?q?linalg=20:=20=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=89=E4=BE=8B=E3=81=AEBLAS=203=E3=81=AE=E9=96=A2=E6=95=B0?= =?UTF-8?q?=E3=82=92=E8=B5=A4=E5=AD=97=E3=81=A7=E5=BC=B7=E8=AA=BF=20(#1233?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/hermitian_matrix_product.md | 1 + reference/linalg/matrix_product.md | 1 + reference/linalg/symmetric_matrix_product.md | 1 + reference/linalg/symmetric_matrix_rank_k_update.md | 1 + reference/linalg/triangular_matrix_left_product.md | 1 + reference/linalg/triangular_matrix_product.md | 1 + reference/linalg/triangular_matrix_right_product.md | 1 + 7 files changed, 7 insertions(+) diff --git a/reference/linalg/hermitian_matrix_product.md b/reference/linalg/hermitian_matrix_product.md index 83643973ab..13d66ccecc 100644 --- a/reference/linalg/hermitian_matrix_product.md +++ b/reference/linalg/hermitian_matrix_product.md @@ -310,6 +310,7 @@ int main() * std::linalg::row_major_t[link /reference/linalg/row_major_t.md] * std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] * std::execution::par[link /reference/execution/execution/execution_policy.md] +* std::linalg::hermitian_matrix_product[color ff0000] ### 出力 diff --git a/reference/linalg/matrix_product.md b/reference/linalg/matrix_product.md index e006869fd7..204239b40f 100644 --- a/reference/linalg/matrix_product.md +++ b/reference/linalg/matrix_product.md @@ -166,6 +166,7 @@ int main() * B.extent[link /reference/mdspan/extents/extent.md] * std::mdspan[link /reference/mdspan/mdspan.md] * std::execution::par[link /reference/execution/execution/execution_policy.md] +* std::linalg::matrix_product[color ff0000] ### 出力 diff --git a/reference/linalg/symmetric_matrix_product.md b/reference/linalg/symmetric_matrix_product.md index a17dcba485..4249892821 100644 --- a/reference/linalg/symmetric_matrix_product.md +++ b/reference/linalg/symmetric_matrix_product.md @@ -308,6 +308,7 @@ int main() * std::linalg::row_major_t[link /reference/linalg/row_major_t.md] * std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] * std::execution::par[link /reference/execution/execution/execution_policy.md] +* std::linalg::symmetric_matrix_product[color ff0000] ### 出力 diff --git a/reference/linalg/symmetric_matrix_rank_k_update.md b/reference/linalg/symmetric_matrix_rank_k_update.md index abe8000c43..a9da6fda4e 100644 --- a/reference/linalg/symmetric_matrix_rank_k_update.md +++ b/reference/linalg/symmetric_matrix_rank_k_update.md @@ -202,6 +202,7 @@ int main() * std::linalg::row_major_t[link /reference/linalg/row_major_t.md] * std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] * std::execution::par[link /reference/execution/execution/execution_policy.md] +* std::linalg::symmetric_matrix_rank_k_update[color ff0000] ### 出力 diff --git a/reference/linalg/triangular_matrix_left_product.md b/reference/linalg/triangular_matrix_left_product.md index 1a7c574f23..aef6a654e4 100644 --- a/reference/linalg/triangular_matrix_left_product.md +++ b/reference/linalg/triangular_matrix_left_product.md @@ -162,6 +162,7 @@ int main() * std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] * std::linalg::implicit_unit_diagonal[link /reference/linalg/implicit_unit_diagonal_t.md] * std::execution::par[link /reference/execution/execution/execution_policy.md] +* std::linalg::triangular_matrix_left_product[color ff0000] ### 出力 diff --git a/reference/linalg/triangular_matrix_product.md b/reference/linalg/triangular_matrix_product.md index 52fec14eea..b64852d10b 100644 --- a/reference/linalg/triangular_matrix_product.md +++ b/reference/linalg/triangular_matrix_product.md @@ -374,6 +374,7 @@ int main() * std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] * std::linalg::implicit_unit_diagonal[link /reference/linalg/implicit_unit_diagonal_t.md] * std::execution::par[link /reference/execution/execution/execution_policy.md] +* std::linalg::triangular_matrix_product[color ff0000] ### 出力 diff --git a/reference/linalg/triangular_matrix_right_product.md b/reference/linalg/triangular_matrix_right_product.md index 563efbeb42..3e3adbb11d 100644 --- a/reference/linalg/triangular_matrix_right_product.md +++ b/reference/linalg/triangular_matrix_right_product.md @@ -162,6 +162,7 @@ int main() * std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] * std::linalg::implicit_unit_diagonal[link /reference/linalg/implicit_unit_diagonal_t.md] * std::execution::par[link /reference/execution/execution/execution_policy.md] +* std::linalg::triangular_matrix_left_product[color ff0000] ### 出力 From 357e1dbfea616de927ac6f3259703c518aaf03e5 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Mon, 15 Jul 2024 12:25:59 +0900 Subject: [PATCH 1054/3948] =?UTF-8?q?linalg=20:=20symmetric=5Fmatrix=5Fran?= =?UTF-8?q?k=5F2k=5Fupdate=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 2 +- .../linalg/symmetric_matrix_rank_2k_update.md | 201 ++++++++++++++++++ 2 files changed, 202 insertions(+), 1 deletion(-) create mode 100644 reference/linalg/symmetric_matrix_rank_2k_update.md diff --git a/reference/linalg.md b/reference/linalg.md index 40cf13ca38..2b95d67645 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -106,7 +106,7 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に | [`triangular_matrix_right_product`](linalg/triangular_matrix_right_product.md) | xTRMM: In-placeに三角行列と行列の積を求める (function template) | C++26 | | [`symmetric_matrix_rank_k_update`](linalg/symmetric_matrix_rank_k_update.md) | xSYRK: 対称行列のRank-k更新 (function template) | C++26 | | [`hermitian_matrix_rank_k_update`](linalg/hermitian_matrix_rank_k_update.md) | xHERK: ハミルトニアン行列のRank-k更新 (function template) | C++26 | -| `symmetric_matrix_rank_2k_update` | xSYR2K: 対称行列のRank-2k更新 (function template) | C++26 | +| [`symmetric_matrix_rank_2k_update`](linalg/symmetric_matrix_rank_2k_update.md) | xSYR2K: 対称行列のRank-2k更新 (function template) | C++26 | | `hermitian_matrix_rank_2k_update` | xHER2K: ハミルトニアン行列のRank-2k更新 (function template) | C++26 | | `triangular_matrix_matrix_left_solve` | xTRSM: 三角行列の連立一次方程式を解く (function template) | C++26 | | `triangular_matrix_matrix_right_solve` | xTRSM: 三角行列の連立一次方程式を解く (function template) | C++26 | diff --git a/reference/linalg/symmetric_matrix_rank_2k_update.md b/reference/linalg/symmetric_matrix_rank_2k_update.md new file mode 100644 index 0000000000..cf3f3ae9af --- /dev/null +++ b/reference/linalg/symmetric_matrix_rank_2k_update.md @@ -0,0 +1,201 @@ +# symmetric_matrix_rank_2k_update + + +* [mathjax enable] +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + + +```cpp +namespace std::linalg { + template + void symmetric_matrix_rank_2k_update( + InMat1 A, + InMat2 B, + InOutMat C, + Triangle t); // (1) + + template + void symmetric_matrix_rank_2k_update( + ExecutionPolicy&& exec, + InMat1 A, + InMat2 B, + InOutMat C, + Triangle t); // (2) +} +``` + + +## 概要 +対称かつ共役を取らないrank-2k updateを対称行列に行う。 +引数`t`は対称行列の成分が上三角にあるのか、それとも下三角にあるのかを示す。 + +- (1): $C \leftarrow C + AB^T + BA^T$ +- (2): (1)を指定された実行ポリシーで実行する。 + + +## 適格要件 +- 共通: + + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) + + `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + + [`possibly-addable`](possibly-addable.md)`()`が`true` + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) +- (2): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` + + +## 事前条件 +- `A.extent(0) == A.extent(1)` +- [`addable`](addable.md)`(A, B, C)`が`true` + + +## 効果 +$C \leftarrow C + AB^T + BA^T$ + + +## 戻り値 +なし + + +## 計算量 +$O(\verb|A.extent(0)| \times \verb|A.extent(1)| \times \verb|C.extent(0)|)$ + + +## 例 +**[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** + +```cpp example +#include +#include +#include +#include +#include + +template +void print_mat(const Matrix& A) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = 0; j < i; ++j) { + std::cout << A[j, i] << ' '; + } + for(int j = i; j < A.extent(1) - 1; ++j) { + std::cout << A[i, j] << ' '; + } + std::cout << A[i, A.extent(1) - 1] << '\n'; + } +} + +template +void init_mat(Matrix& A, double geta = 0.0) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = 0; j < A.extent(1); ++j) { + A[i,j] = A.extent(1) * i + j + geta; + } + } +} + +template +void init_symm_mat(Matrix& A) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = i; j < A.extent(1); ++j) { + A[i, j] = i * A.extent(1) + j; + } + } +} + +int main() +{ + constexpr size_t N = 2; + + std::vector A_vec(N * N); + std::vector B_vec(N * N); + std::vector C_vec(N * N); + + std::mdspan A(A_vec.data()); + std::mdspan B(B_vec.data()); + std::mdspan< + double, + std::extents, + std::linalg::layout_blas_packed< + std::linalg::upper_triangle_t, + std::linalg::row_major_t> + > C(C_vec.data()); + + init_mat(A); + init_mat(B, 1); + init_symm_mat(C); + + // (1) + std::cout << "(1)\n"; + std::linalg::symmetric_matrix_rank_k_update( + A, + B, + C, + std::linalg::upper_triangle); + print_mat(C); + + // (2) + init_symm_mat(C); + std::cout << "(2)\n"; + std::linalg::symmetric_matrix_rank_k_update( + std::execution::par, + A, + B, + C, + std::linalg::upper_triangle); + print_mat(C); + + return 0; +} +``` +* A.extent[link /reference/mdspan/extents/extent.md] +* std::mdspan[link /reference/mdspan/mdspan.md] +* std::extents[link /reference/mdspan/extents.md] +* std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] +* std::linalg::upper_triangle_t[link /reference/linalg/upper_triangle_t.md] +* std::linalg::row_major_t[link /reference/linalg/row_major_t.md] +* std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] +* std::execution::par[link /reference/execution/execution/execution_policy.md] +* std::linalg::symmetric_matrix_rank_2k_update[color ff0000] + + +### 出力 +``` +(1) +4 13 +13 39 +(2) +4 13 +13 39 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution`](/reference/execution.md) +- [`mdspan`](/reference/mdspan.md) +- [`upper_triangle_t`](upper_triangle_t.md) +- [`lower_triangle_t`](lower_triangle_t.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) +- [LAPACK: {he,sy}r2k: Hermitian/symmetric rank-2k update](https://netlib.org/lapack/explore-html/d8/d94/group__her2k.html) + From 42e737a30289e193c76be21fcf1a4d62afd4e36f Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Mon, 15 Jul 2024 12:28:21 +0900 Subject: [PATCH 1055/3948] =?UTF-8?q?linalg=20:=20=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=89=E4=BE=8B=E3=81=AE=E9=96=A2=E6=95=B0=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/symmetric_matrix_rank_2k_update.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/linalg/symmetric_matrix_rank_2k_update.md b/reference/linalg/symmetric_matrix_rank_2k_update.md index cf3f3ae9af..24064ae819 100644 --- a/reference/linalg/symmetric_matrix_rank_2k_update.md +++ b/reference/linalg/symmetric_matrix_rank_2k_update.md @@ -134,7 +134,7 @@ int main() // (1) std::cout << "(1)\n"; - std::linalg::symmetric_matrix_rank_k_update( + std::linalg::symmetric_matrix_rank_2k_update( A, B, C, @@ -144,7 +144,7 @@ int main() // (2) init_symm_mat(C); std::cout << "(2)\n"; - std::linalg::symmetric_matrix_rank_k_update( + std::linalg::symmetric_matrix_rank_2k_update( std::execution::par, A, B, From 7d2dee72e518024b65747c48d69a36f99ac16ac1 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Tue, 16 Jul 2024 10:00:21 +0900 Subject: [PATCH 1056/3948] =?UTF-8?q?linalg=20:=20hermitian=5Fmatrix=5Fran?= =?UTF-8?q?k=5F2k=5Fupdate=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 2 +- .../linalg/hermitian_matrix_rank_2k_update.md | 207 ++++++++++++++++++ 2 files changed, 208 insertions(+), 1 deletion(-) create mode 100644 reference/linalg/hermitian_matrix_rank_2k_update.md diff --git a/reference/linalg.md b/reference/linalg.md index 2b95d67645..2e343f8f37 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -107,7 +107,7 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に | [`symmetric_matrix_rank_k_update`](linalg/symmetric_matrix_rank_k_update.md) | xSYRK: 対称行列のRank-k更新 (function template) | C++26 | | [`hermitian_matrix_rank_k_update`](linalg/hermitian_matrix_rank_k_update.md) | xHERK: ハミルトニアン行列のRank-k更新 (function template) | C++26 | | [`symmetric_matrix_rank_2k_update`](linalg/symmetric_matrix_rank_2k_update.md) | xSYR2K: 対称行列のRank-2k更新 (function template) | C++26 | -| `hermitian_matrix_rank_2k_update` | xHER2K: ハミルトニアン行列のRank-2k更新 (function template) | C++26 | +| [`hermitian_matrix_rank_2k_update`](linalg/hermitian_matrix_rank_2k_update.md) | xHER2K: ハミルトニアン行列のRank-2k更新 (function template) | C++26 | | `triangular_matrix_matrix_left_solve` | xTRSM: 三角行列の連立一次方程式を解く (function template) | C++26 | | `triangular_matrix_matrix_right_solve` | xTRSM: 三角行列の連立一次方程式を解く (function template) | C++26 | diff --git a/reference/linalg/hermitian_matrix_rank_2k_update.md b/reference/linalg/hermitian_matrix_rank_2k_update.md new file mode 100644 index 0000000000..bfde5f949a --- /dev/null +++ b/reference/linalg/hermitian_matrix_rank_2k_update.md @@ -0,0 +1,207 @@ +# hermitian_matrix_rank_2k_update + + +* [mathjax enable] +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + + +```cpp +namespace std::linalg { + template + void hermitian_matrix_rank_2k_update( + InMat1 A, + InMat2 B, + InOutMat C, + Triangle t); // (1) + + template + void hermitian_matrix_rank_2k_update( + ExecutionPolicy&& exec, + InMat1 A, + InMat2 B, + InOutMat C, + Triangle t); // (2) +} +``` + + +## 概要 +エルミートな(対称かつ共役を取る)rank-2k updateを対称行列に行う。 +引数`t`は対称行列の成分が上三角にあるのか、それとも下三角にあるのかを示す。 + +- (1): $C \leftarrow C + AB^* + BA^*$ +- (2): (1)を指定された実行ポリシーで実行する。 + + +## 適格要件 +- 共通: + + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) + + `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + + [`possibly-addable`](possibly-addable.md)`()`が`true` + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) +- (2): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` + + +## 事前条件 +- `A.extent(0) == A.extent(1)` +- [`addable`](addable.md)`(A, B, C)`が`true` + + +## 効果 +$C \leftarrow C + AB^* + BA^*$ + + +## 戻り値 +なし + + +## 計算量 +$O(\verb|A.extent(0)| \times \verb|A.extent(1)| \times \verb|C.extent(0)|)$ + + +## 例 +**[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** + +```cpp example +#include +#include +#include +#include +#include + +template +void print_mat(const Matrix& A) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = 0; j < i; ++j) { + std::cout << A[j, i] << ' '; + } + for(int j = i; j < A.extent(1) - 1; ++j) { + std::cout << A[i, j] << ' '; + } + std::cout << A[i, A.extent(1) - 1] << '\n'; + } +} + +template +void init_mat(Matrix& A, double geta = 0.0) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = 0; j < A.extent(1); ++j) { + A[i,j] = std::complex(i + geta, j + geta); + } + } +} + +template +void init_herm_mat(Matrix& A) { + for(int i = 0; i < A.extent(0); ++i) { + A[i, i] = std::complex(i, 0); + for(int j = i + 1; j < A.extent(1); ++j) { + A[i, j] = std::complex(i, j); + } + } +} + +int main() +{ + constexpr size_t N = 2; + + using Scalar = std::complex; + using Vector = std::vector; + using HermitianMatrix = std::mdspan< + Scalar, + std::extents, + std::linalg::layout_blas_packed< + std::linalg::upper_triangle_t, + std::linalg::row_major_t> + >; + + Vector A_vec(N * N); + Vector B_vec(N * N); + Vector C_vec(N * N); + + std::mdspan A(A_vec.data()); + std::mdspan B(B_vec.data()); + HermitianMatrix C(C_vec.data()); + + init_mat(A); + init_mat(B, 1); + init_herm_mat(C); + + // (1) + std::cout << "(1)\n"; + std::linalg::hermitian_matrix_rank_2k_update( + A, + B, + C, + std::linalg::upper_triangle); + print_mat(C); + + // (2) + init_herm_mat(C); + std::cout << "(2)\n"; + std::linalg::hermitian_matrix_rank_2k_update( + std::execution::par, + A, + B, + C, + std::linalg::upper_triangle); + print_mat(C); + + return 0; +} +``` +* A.extent[link /reference/mdspan/extents/extent.md] +* std::complex[link /reference/complex/complex.md] +* std::mdspan[link /reference/mdspan/mdspan.md] +* std::extents[link /reference/mdspan/extents.md] +* std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] +* std::linalg::upper_triangle_t[link /reference/linalg/upper_triangle_t.md] +* std::linalg::row_major_t[link /reference/linalg/row_major_t.md] +* std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] +* std::execution::par[link /reference/execution/execution/execution_policy.md] +* std::linalg::hermitian_matrix_rank_2k_update[color ff0000] + + +### 出力 +``` +(1) +(4,0) (6,4) +(6,-4) (13,0) +(2) +(4,0) (6,4) +(6,-4) (13,0) +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution`](/reference/execution.md) +- [`mdspan`](/reference/mdspan.md) +- [`upper_triangle_t`](upper_triangle_t.md) +- [`lower_triangle_t`](lower_triangle_t.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) +- [LAPACK: {he,sy}r2k: Hermitian/symmetric rank-2k update](https://netlib.org/lapack/explore-html/d8/d94/group__her2k.html) + From ad3c81fe77dfd24ed0afe9434d9e85132e3c089f Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Tue, 16 Jul 2024 10:01:01 +0900 Subject: [PATCH 1057/3948] =?UTF-8?q?linalg=20:=20=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=89=E4=BE=8B=E3=81=ABstd::complex=E3=81=AE=E3=83=AA?= =?UTF-8?q?=E3=83=B3=E3=82=AF=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/hermitian_matrix_product.md | 1 + reference/linalg/hermitian_matrix_rank_k_update.md | 1 + 2 files changed, 2 insertions(+) diff --git a/reference/linalg/hermitian_matrix_product.md b/reference/linalg/hermitian_matrix_product.md index 13d66ccecc..d72c378cf2 100644 --- a/reference/linalg/hermitian_matrix_product.md +++ b/reference/linalg/hermitian_matrix_product.md @@ -303,6 +303,7 @@ int main() } ``` * A.extent[link /reference/mdspan/extents/extent.md] +* std::complex[link /reference/complex/complex.md] * std::mdspan[link /reference/mdspan/mdspan.md] * std::extents[link /reference/mdspan/extents.md] * std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] diff --git a/reference/linalg/hermitian_matrix_rank_k_update.md b/reference/linalg/hermitian_matrix_rank_k_update.md index a30d7dda05..acca5bc651 100644 --- a/reference/linalg/hermitian_matrix_rank_k_update.md +++ b/reference/linalg/hermitian_matrix_rank_k_update.md @@ -200,6 +200,7 @@ int main() } ``` * A.extent[link /reference/mdspan/extents/extent.md] +* std::complex[link /reference/complex/complex.md] * std::mdspan[link /reference/mdspan/mdspan.md] * std::extents[link /reference/mdspan/extents.md] * std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] From 049395fc5df9360d6510e01f138b685620e97321 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Tue, 16 Jul 2024 10:35:10 +0900 Subject: [PATCH 1058/3948] =?UTF-8?q?linalg=20:=20=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=89=E4=BE=8B=E3=81=AB=E3=83=AA=E3=83=B3=E3=82=AF=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- .../linalg/hermitian_matrix_rank_1_update.md | 11 +++++++++++ .../linalg/hermitian_matrix_rank_2_update.md | 12 ++++++++++++ .../linalg/hermitian_matrix_vector_product.md | 13 +++++++++++++ reference/linalg/matrix_rank_1_update.md | 5 +++++ reference/linalg/matrix_rank_1_update_c.md | 8 ++++++++ reference/linalg/matrix_vector_product.md | 7 +++++++ .../linalg/symmetric_matrix_rank_1_update.md | 10 ++++++++++ .../linalg/symmetric_matrix_rank_2_update.md | 15 +++++++++++++-- .../linalg/symmetric_matrix_vector_product.md | 11 +++++++++++ .../linalg/triangular_matrix_vector_product.md | 11 +++++++++++ .../linalg/triangular_matrix_vector_solve.md | 11 +++++++++++ 11 files changed, 112 insertions(+), 2 deletions(-) diff --git a/reference/linalg/hermitian_matrix_rank_1_update.md b/reference/linalg/hermitian_matrix_rank_1_update.md index 446426dff8..72e9d987d8 100644 --- a/reference/linalg/hermitian_matrix_rank_1_update.md +++ b/reference/linalg/hermitian_matrix_rank_1_update.md @@ -196,6 +196,17 @@ int main() return 0; } ``` +* A.extent[link /reference/mdspan/extents/extent.md] +* v.extent[link /reference/mdspan/extents/extent.md] +* std::complex[link /reference/complex/complex.md] +* std::mdspan[link /reference/mdspan/mdspan.md] +* std::extents[link /reference/mdspan/extents.md] +* std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] +* std::linalg::upper_triangle_t[link /reference/linalg/upper_triangle_t.md] +* std::linalg::row_major_t[link /reference/linalg/row_major_t.md] +* std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] +* std::execution::par[link /reference/execution/execution/execution_policy.md] +* std::linalg::hermitian_matrix_rank_1_update[color ff0000] ### 出力 diff --git a/reference/linalg/hermitian_matrix_rank_2_update.md b/reference/linalg/hermitian_matrix_rank_2_update.md index 624e82e2ed..97e505cd6e 100644 --- a/reference/linalg/hermitian_matrix_rank_2_update.md +++ b/reference/linalg/hermitian_matrix_rank_2_update.md @@ -154,6 +154,18 @@ int main() return 0; } ``` +* A.extent[link /reference/mdspan/extents/extent.md] +* x.extent[link /reference/mdspan/extents/extent.md] +* y.extent[link /reference/mdspan/extents/extent.md] +* std::complex[link /reference/complex/complex.md] +* std::mdspan[link /reference/mdspan/mdspan.md] +* std::extents[link /reference/mdspan/extents.md] +* std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] +* std::linalg::upper_triangle_t[link /reference/linalg/upper_triangle_t.md] +* std::linalg::row_major_t[link /reference/linalg/row_major_t.md] +* std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] +* std::execution::par[link /reference/execution/execution/execution_policy.md] +* std::linalg::hermitian_matrix_rank_2_update[color ff0000] ### 出力 diff --git a/reference/linalg/hermitian_matrix_vector_product.md b/reference/linalg/hermitian_matrix_vector_product.md index 1c8b85a455..d67ddb744f 100644 --- a/reference/linalg/hermitian_matrix_vector_product.md +++ b/reference/linalg/hermitian_matrix_vector_product.md @@ -181,6 +181,19 @@ int main() return 0; } ``` +* A.extent[link /reference/mdspan/extents/extent.md] +* v.extent[link /reference/mdspan/extents/extent.md] +* x.extent[link /reference/mdspan/extents/extent.md] +* y.extent[link /reference/mdspan/extents/extent.md] +* std::complex[link /reference/complex/complex.md] +* std::mdspan[link /reference/mdspan/mdspan.md] +* std::extents[link /reference/mdspan/extents.md] +* std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] +* std::linalg::upper_triangle_t[link /reference/linalg/upper_triangle_t.md] +* std::linalg::row_major_t[link /reference/linalg/row_major_t.md] +* std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] +* std::execution::par[link /reference/execution/execution/execution_policy.md] +* std::linalg::hermitian_matrix_vector_product[color ff0000] ### 出力 diff --git a/reference/linalg/matrix_rank_1_update.md b/reference/linalg/matrix_rank_1_update.md index 72497d418a..891c037284 100644 --- a/reference/linalg/matrix_rank_1_update.md +++ b/reference/linalg/matrix_rank_1_update.md @@ -136,6 +136,11 @@ int main() return 0; } ``` +* A.extent[link /reference/mdspan/extents/extent.md] +* v.extent[link /reference/mdspan/extents/extent.md] +* std::mdspan[link /reference/mdspan/mdspan.md] +* std::execution::par[link /reference/execution/execution/execution_policy.md] +* std::linalg::matrix_rank_1_update[color ff0000] ### 出力 diff --git a/reference/linalg/matrix_rank_1_update_c.md b/reference/linalg/matrix_rank_1_update_c.md index c5cc655dfe..5823fd0dbd 100644 --- a/reference/linalg/matrix_rank_1_update_c.md +++ b/reference/linalg/matrix_rank_1_update_c.md @@ -65,6 +65,7 @@ $O(\verb|x.extent(0)|\times \verb|y.extent(0)|)$ ```cpp example #include +#include #include #include #include @@ -140,6 +141,13 @@ int main() return 0; } ``` +* A.extent[link /reference/mdspan/extents/extent.md] +* v.extent[link /reference/mdspan/extents/extent.md] +* y.extent[link /reference/mdspan/extents/extent.md] +* std::complex[link /reference/complex/complex.md] +* std::mdspan[link /reference/mdspan/mdspan.md] +* std::execution::par[link /reference/execution/execution/execution_policy.md] +* std::linalg::matrix_rank_1_update[color ff0000] ### 出力 diff --git a/reference/linalg/matrix_vector_product.md b/reference/linalg/matrix_vector_product.md index 0743dd73cc..03662a70ac 100644 --- a/reference/linalg/matrix_vector_product.md +++ b/reference/linalg/matrix_vector_product.md @@ -153,6 +153,13 @@ int main() return 0; } ``` +* A.extent[link /reference/mdspan/extents/extent.md] +* v.extent[link /reference/mdspan/extents/extent.md] +* x.extent[link /reference/mdspan/extents/extent.md] +* y.extent[link /reference/mdspan/extents/extent.md] +* std::mdspan[link /reference/mdspan/mdspan.md] +* std::execution::par[link /reference/execution/execution/execution_policy.md] +* std::linalg::matrix_vector_product[color ff0000] ### 出力 diff --git a/reference/linalg/symmetric_matrix_rank_1_update.md b/reference/linalg/symmetric_matrix_rank_1_update.md index 25c297b643..a8c3273e3c 100644 --- a/reference/linalg/symmetric_matrix_rank_1_update.md +++ b/reference/linalg/symmetric_matrix_rank_1_update.md @@ -194,6 +194,16 @@ int main() return 0; } ``` +* A.extent[link /reference/mdspan/extents/extent.md] +* v.extent[link /reference/mdspan/extents/extent.md] +* std::mdspan[link /reference/mdspan/mdspan.md] +* std::extents[link /reference/mdspan/extents.md] +* std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] +* std::linalg::upper_triangle_t[link /reference/linalg/upper_triangle_t.md] +* std::linalg::row_major_t[link /reference/linalg/row_major_t.md] +* std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] +* std::execution::par[link /reference/execution/execution/execution_policy.md] +* std::linalg::symmetric_matrix_rank_1_update[color ff0000] ### 出力 diff --git a/reference/linalg/symmetric_matrix_rank_2_update.md b/reference/linalg/symmetric_matrix_rank_2_update.md index 045c2f1910..8083739523 100644 --- a/reference/linalg/symmetric_matrix_rank_2_update.md +++ b/reference/linalg/symmetric_matrix_rank_2_update.md @@ -128,7 +128,7 @@ int main() // (1) std::cout << "(1)\n"; - std::linalg::symmetric_matrix_rank_1_update( + std::linalg::symmetric_matrix_rank_2_update( x, y, A, @@ -138,7 +138,7 @@ int main() // (2) init_mat(A); std::cout << "(2)\n"; - std::linalg::symmetric_matrix_rank_1_update( + std::linalg::symmetric_matrix_rank_2_update( std::execution::par, x, y, @@ -149,6 +149,17 @@ int main() return 0; } ``` +* A.extent[link /reference/mdspan/extents/extent.md] +* x.extent[link /reference/mdspan/extents/extent.md] +* y.extent[link /reference/mdspan/extents/extent.md] +* std::mdspan[link /reference/mdspan/mdspan.md] +* std::extents[link /reference/mdspan/extents.md] +* std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] +* std::linalg::upper_triangle_t[link /reference/linalg/upper_triangle_t.md] +* std::linalg::row_major_t[link /reference/linalg/row_major_t.md] +* std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] +* std::execution::par[link /reference/execution/execution/execution_policy.md] +* std::linalg::symmetric_matrix_rank_2_update[color ff0000] ### 出力 diff --git a/reference/linalg/symmetric_matrix_vector_product.md b/reference/linalg/symmetric_matrix_vector_product.md index ebf381b849..bba7a726fd 100644 --- a/reference/linalg/symmetric_matrix_vector_product.md +++ b/reference/linalg/symmetric_matrix_vector_product.md @@ -178,6 +178,17 @@ int main() return 0; } ``` +* A.extent[link /reference/mdspan/extents/extent.md] +* v.extent[link /reference/mdspan/extents/extent.md] +* x.extent[link /reference/mdspan/extents/extent.md] +* std::mdspan[link /reference/mdspan/mdspan.md] +* std::extents[link /reference/mdspan/extents.md] +* std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] +* std::linalg::upper_triangle_t[link /reference/linalg/upper_triangle_t.md] +* std::linalg::row_major_t[link /reference/linalg/row_major_t.md] +* std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] +* std::execution::par[link /reference/execution/execution/execution_policy.md] +* std::linalg::symmetric_matrix_vector_product[color ff0000] ### 出力 diff --git a/reference/linalg/triangular_matrix_vector_product.md b/reference/linalg/triangular_matrix_vector_product.md index 98b73fef04..e9547c8c95 100644 --- a/reference/linalg/triangular_matrix_vector_product.md +++ b/reference/linalg/triangular_matrix_vector_product.md @@ -267,6 +267,17 @@ int main() return 0; } ``` +* A.extent[link /reference/mdspan/extents/extent.md] +* v.extent[link /reference/mdspan/extents/extent.md] +* std::mdspan[link /reference/mdspan/mdspan.md] +* std::extents[link /reference/mdspan/extents.md] +* std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] +* std::linalg::upper_triangle_t[link /reference/linalg/upper_triangle_t.md] +* std::linalg::row_major_t[link /reference/linalg/row_major_t.md] +* std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] +* std::linalg::implicit_unit_diagonal[link /reference/linalg/implicit_unit_diagonal_t.md] +* std::execution::par[link /reference/execution/execution/execution_policy.md] +* std::linalg::triangular_matrix_vector_product[color ff0000] ### 出力 diff --git a/reference/linalg/triangular_matrix_vector_solve.md b/reference/linalg/triangular_matrix_vector_solve.md index 89fbdf5e68..d4c71663bb 100644 --- a/reference/linalg/triangular_matrix_vector_solve.md +++ b/reference/linalg/triangular_matrix_vector_solve.md @@ -318,6 +318,17 @@ int main() return 0; } ``` +* A.extent[link /reference/mdspan/extents/extent.md] +* v.extent[link /reference/mdspan/extents/extent.md] +* std::mdspan[link /reference/mdspan/mdspan.md] +* std::extents[link /reference/mdspan/extents.md] +* std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] +* std::linalg::upper_triangle_t[link /reference/linalg/upper_triangle_t.md] +* std::linalg::row_major_t[link /reference/linalg/row_major_t.md] +* std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] +* std::linalg::implicit_unit_diagonal[link /reference/linalg/implicit_unit_diagonal_t.md] +* std::execution::par[link /reference/execution/execution/execution_policy.md] +* std::linalg::triangular_matrix_vector_solve[color ff0000] ### 出力 From 005f130af2eae5531e8279f1b6d9421f387fd4ee Mon Sep 17 00:00:00 2001 From: raclamusi Date: Tue, 16 Jul 2024 18:17:30 +0900 Subject: [PATCH 1059/3948] Revert "Merge branch 'master' of https://github.com/cpprefjp/site" This reverts commit 3bf0c4f6679b61894eb7cc13f249a299eb5577ff, reversing changes made to 049395fc5df9360d6510e01f138b685620e97321. --- reference/new/op_new.md | 2 +- reference/new/op_new[].md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/new/op_new.md b/reference/new/op_new.md index 39845d2666..c098d8be1e 100644 --- a/reference/new/op_new.md +++ b/reference/new/op_new.md @@ -131,7 +131,7 @@ int main() // (3) cl 型変数を動的に作成 // 確保失敗時にヌルポインタが返される cl* p2 = new (std::nothrow) cl(); - delete p2; // 通常の delete 式で記憶域を解放する + delete p2; // 配置 delete と言うものはないので、通常の delete 式で記憶域を解放する // (5) char 配列のスタック領域に、cl 型変数を動的に作成 // 領域のアライメントに注意 diff --git a/reference/new/op_new[].md b/reference/new/op_new[].md index 2017f41df6..8be12c5756 100644 --- a/reference/new/op_new[].md +++ b/reference/new/op_new[].md @@ -117,7 +117,7 @@ int main() // (3) 3 要素の cl 型配列を動的に作成 // 確保失敗時にヌルポインタが返される cl* p2 = new (std::nothrow) cl[3]; - delete[] p2; // 通常の delete 式で記憶域を解放する + delete[] p2; // 配置 delete と言うものはないので、通常の delete 式で記憶域を解放する // (5) char 配列のスタック領域に、3 要素の cl 型配列を動的に作成 // ただし、危険なため、使用してはいけない From 0b27920eb5f0d83dfdaee394f727eef78daa770d Mon Sep 17 00:00:00 2001 From: raclamusi Date: Tue, 16 Jul 2024 18:43:27 +0900 Subject: [PATCH 1060/3948] =?UTF-8?q?=E3=82=A4=E3=83=B3=E3=83=A9=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=82=B3=E3=83=BC=E3=83=89=E3=83=96=E3=83=AD=E3=83=83?= =?UTF-8?q?=E3=82=AF=E3=81=AE=E7=AF=84=E5=9B=B2=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp11/attributes.md | 2 +- reference/bitset/bitset/op_constructor.md | 2 +- reference/iterator/ranges_next.md | 2 +- reference/iterator/ranges_prev.md | 2 +- reference/mutex/recursive_timed_mutex/try_lock_until.md | 2 +- reference/mutex/timed_mutex/try_lock_until.md | 2 +- reference/numeric/inner_product.md | 8 ++++---- reference/optional/optional/emplace.md | 2 +- .../shared_timed_mutex/try_lock_shared_until.md | 2 +- .../shared_mutex/shared_timed_mutex/try_lock_until.md | 2 +- reference/span/span/op_constructor.md | 2 +- start_editing/directory_structure.md | 2 +- 12 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lang/cpp11/attributes.md b/lang/cpp11/attributes.md index 803308f061..0259f3a4aa 100644 --- a/lang/cpp11/attributes.md +++ b/lang/cpp11/attributes.md @@ -154,7 +154,7 @@ C++11で採用されたもの以外で検討された以下の機能は、属性 以下の属性は、C++11時点では採用されていない: - 関数が同じ引数に対して同じ戻り値を返すことを明示する`pure`属性 -- `if`文や`switch文`の`case`に指定する条件式のヒット率が高いことを指示する`probably`属性 +- `if`文や`switch`文の`case`に指定する条件式のヒット率が高いことを指示する`probably`属性 - 関数が非推奨であることを指示する`deprecated`属性 - 基底クラスによって関数を隠蔽しないことを明示する`not_hiding`属性 - ポインタの所有者(解放する責任を持つユーザー)であることを明示する`owner`属性 diff --git a/reference/bitset/bitset/op_constructor.md b/reference/bitset/bitset/op_constructor.md index 03fe984b9a..3cd4a189bc 100644 --- a/reference/bitset/bitset/op_constructor.md +++ b/reference/bitset/bitset/op_constructor.md @@ -68,7 +68,7 @@ constexpr explicit bitset( - (1) : デフォルトコンストラクタ - (2) : 整数値を受け取るコンストラクタ - (3) : `'0'`と`'1'`の文字で構成される`basic_string`文字列からビット列を構築する -- (4) : `'0'と`'1'`の文字で構成される`[`basic_string_view`](/reference/string_view/basic_string_view.md)オブジェクトからビット列を構築する +- (4) : `'0'`と`'1'`の文字で構成される[`basic_string_view`](/reference/string_view/basic_string_view.md)オブジェクトからビット列を構築する - (5) : `'0'`と`'1'`の文字で構成される文字配列からビット列を構築する diff --git a/reference/iterator/ranges_next.md b/reference/iterator/ranges_next.md index 58c578ee47..66c57e8af7 100644 --- a/reference/iterator/ranges_next.md +++ b/reference/iterator/ranges_next.md @@ -144,7 +144,7 @@ int main() { | [`prev()`](prev.md) | `n`回後方に進めたイテレータを返す | | [`advance()`](advance.md) | `n`回イテレータを進める | | [`rangse::prev()`](ranges_prev.md) | `n`回後方に進めたイテレータを返す | -| [`ranges::advance()`](ranges_advance.md) |`n`回あるいは`boundまで`イテレータを進める | +| [`ranges::advance()`](ranges_advance.md) |`n`回あるいは`bound`までイテレータを進める | ## 参照 diff --git a/reference/iterator/ranges_prev.md b/reference/iterator/ranges_prev.md index 2fea54213d..639f463298 100644 --- a/reference/iterator/ranges_prev.md +++ b/reference/iterator/ranges_prev.md @@ -126,7 +126,7 @@ int main() { | [`prev()`](prev.md) | `n`回後方に進めたイテレータを返す | | [`advance()`](advance.md) | `n`回イテレータを進める | | [`ranges::next()`](ranges_next.md) | `n`回あるいは`bound`まで前方に進めたイテレータを返す | -| [`ranges::advance()`](ranges_advance.md) |`n`回あるいは`boundまで`イテレータを進める | +| [`ranges::advance()`](ranges_advance.md) |`n`回あるいは`bound`までイテレータを進める | ## 参照 diff --git a/reference/mutex/recursive_timed_mutex/try_lock_until.md b/reference/mutex/recursive_timed_mutex/try_lock_until.md index 3503cc1463..b2a8604850 100644 --- a/reference/mutex/recursive_timed_mutex/try_lock_until.md +++ b/reference/mutex/recursive_timed_mutex/try_lock_until.md @@ -24,7 +24,7 @@ bool try_lock_until(const chrono::time_point& abs_time); 所有権が取得できるまで、もしくは`abs_time`時間に到達するまでこの関数はブロッキングする。 -`abs_timeにすでに到達していた場合`、この関数は[`try_lock()`](try_lock.md)と同じ効果をもち、ブロッキングせずにミューテックスの所有権取得を試みる。 +`abs_time`にすでに到達していた場合、この関数は[`try_lock()`](try_lock.md)と同じ効果をもち、ブロッキングせずにミューテックスの所有権取得を試みる。 ## 戻り値 diff --git a/reference/mutex/timed_mutex/try_lock_until.md b/reference/mutex/timed_mutex/try_lock_until.md index b6d08cd6d0..d087e83b1b 100644 --- a/reference/mutex/timed_mutex/try_lock_until.md +++ b/reference/mutex/timed_mutex/try_lock_until.md @@ -28,7 +28,7 @@ bool try_lock_until(const chrono::time_point& abs_time); 所有権が取得できるまで、もしくは`abs_time`時間に到達するまでこの関数はブロッキングする。 -`abs_timeにすでに到達していた場合`、この関数は[`try_lock()`](try_lock.md)と同じ効果をもち、ブロッキングせずにミューテックスの所有権取得を試みる。 +`abs_time`にすでに到達していた場合、この関数は[`try_lock()`](try_lock.md)と同じ効果をもち、ブロッキングせずにミューテックスの所有権取得を試みる。 ## 戻り値 diff --git a/reference/numeric/inner_product.md b/reference/numeric/inner_product.md index a15b27bd93..1631e9b95c 100644 --- a/reference/numeric/inner_product.md +++ b/reference/numeric/inner_product.md @@ -60,11 +60,11 @@ namespace std { ## 効果 - (1) : - - C++03 : `acc = init;`、イテレータ範囲`[first1, last1)`の各イテレータを`i`、イテレータ範囲`[first2, first2 + (last1 - first1))`の各イテレータ`をj`として、`acc = acc + (*i) * (*j);` の演算を行い、`acc`を返す - - C++20 : `acc = init;`、イテレータ範囲`[first1, last1)`の各イテレータを`i`、イテレータ範囲`[first2, first2 + (last1 - first1))`の各イテレータ`をj`として、`acc =` [`std::move`](/reference/utility/move.md)`(acc) + (*i) * (*j);` の演算を行い、`acc`を返す + - C++03 : `acc = init;`、イテレータ範囲`[first1, last1)`の各イテレータを`i`、イテレータ範囲`[first2, first2 + (last1 - first1))`の各イテレータを`j`として、`acc = acc + (*i) * (*j);` の演算を行い、`acc`を返す + - C++20 : `acc = init;`、イテレータ範囲`[first1, last1)`の各イテレータを`i`、イテレータ範囲`[first2, first2 + (last1 - first1))`の各イテレータを`j`として、`acc =` [`std::move`](/reference/utility/move.md)`(acc) + (*i) * (*j);` の演算を行い、`acc`を返す - (2) : - - C++03 : `acc = init;`、イテレータ範囲`[first1, last1)`の各イテレータを`i`、イテレータ範囲`[first2, first2 + (last1 - first1))`の各イテレータ`をj`として、`acc = binary_op1(acc, binary_op2((*i), (*j)));` の演算を行い、`acc`を返す - - C++20 : `acc = init;`、イテレータ範囲`[first1, last1)`の各イテレータを`i`、イテレータ範囲`[first2, first2 + (last1 - first1))`の各イテレータ`をj`として、`acc = binary_op1(`[`std::move`](/reference/utility/move.md)`(acc), binary_op2((*i), (*j)));` の演算を行い、`acc`を返す + - C++03 : `acc = init;`、イテレータ範囲`[first1, last1)`の各イテレータを`i`、イテレータ範囲`[first2, first2 + (last1 - first1))`の各イテレータを`j`として、`acc = binary_op1(acc, binary_op2((*i), (*j)));` の演算を行い、`acc`を返す + - C++20 : `acc = init;`、イテレータ範囲`[first1, last1)`の各イテレータを`i`、イテレータ範囲`[first2, first2 + (last1 - first1))`の各イテレータを`j`として、`acc = binary_op1(`[`std::move`](/reference/utility/move.md)`(acc), binary_op2((*i), (*j)));` の演算を行い、`acc`を返す ## 戻り値 diff --git a/reference/optional/optional/emplace.md b/reference/optional/optional/emplace.md index 526f276e6a..6d8b578cb3 100644 --- a/reference/optional/optional/emplace.md +++ b/reference/optional/optional/emplace.md @@ -32,7 +32,7 @@ constexpr T& emplace(std::initializer_list il, Args&&... args); // (2) C++23 まず、共通の動作として、[`reset()`](reset.md)メンバ関数を呼び出す。 - (1) : 型`T`の有効値を、[`std::forward`](/reference/utility/forward.md)`(args)...`を引数として構築する -- (2) : 型`T`の有効値を、`ilと`[`std::forward`](/reference/utility/forward.md)`(args)...`を引数として構築する +- (2) : 型`T`の有効値を、`il`と[`std::forward`](/reference/utility/forward.md)`(args)...`を引数として構築する ## 戻り値 diff --git a/reference/shared_mutex/shared_timed_mutex/try_lock_shared_until.md b/reference/shared_mutex/shared_timed_mutex/try_lock_shared_until.md index de53869e94..6d7e43ff12 100644 --- a/reference/shared_mutex/shared_timed_mutex/try_lock_shared_until.md +++ b/reference/shared_mutex/shared_timed_mutex/try_lock_shared_until.md @@ -28,7 +28,7 @@ bool try_lock_shared_until(const chrono::time_point& abs_time); 共有所有権が取得できるまで、もしくは`abs_time`時間に到達するまでこの関数はブロッキングする。 -`abs_timeにすでに到達していた場合`、この関数は[`try_lock_shared()`](try_lock_shared.md)と同じ効果をもち、ブロッキングせずにミューテックスの共有所有権の取得を試みる。 +`abs_time`にすでに到達していた場合、この関数は[`try_lock_shared()`](try_lock_shared.md)と同じ効果をもち、ブロッキングせずにミューテックスの共有所有権の取得を試みる。 ## 戻り値 diff --git a/reference/shared_mutex/shared_timed_mutex/try_lock_until.md b/reference/shared_mutex/shared_timed_mutex/try_lock_until.md index ef560189db..06401b21f8 100644 --- a/reference/shared_mutex/shared_timed_mutex/try_lock_until.md +++ b/reference/shared_mutex/shared_timed_mutex/try_lock_until.md @@ -28,7 +28,7 @@ bool try_lock_until(const chrono::time_point& abs_time); 排他所有権が取得できるまで、もしくは`abs_time`時間に到達するまでこの関数はブロッキングする。 -`abs_timeにすでに到達していた場合`、この関数は[`try_lock()`](try_lock.md)と同じ効果をもち、ブロッキングせずにミューテックスの排他所有の権取得を試みる。 +`abs_time`にすでに到達していた場合、この関数は[`try_lock()`](try_lock.md)と同じ効果をもち、ブロッキングせずにミューテックスの排他所有の権取得を試みる。 ## 戻り値 diff --git a/reference/span/span/op_constructor.md b/reference/span/span/op_constructor.md index 797d6c2654..5b084d70ee 100644 --- a/reference/span/span/op_constructor.md +++ b/reference/span/span/op_constructor.md @@ -80,7 +80,7 @@ constexpr explicit(extent != dynamic_extent) - (4), (5), (6) : - `extent ==` [`dynamic_extent`](/reference/span/dynamic_extent.md) `|| N == extent`が`true`であること - [`remove_pointer_t`](/reference/type_traits/remove_pointer.md)``を型`U`であるとして、 - - [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`trueであること` (この制約の意図は、配列の要素型から`element_type`へ、修飾の変換のみを許可すること) + - [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true`であること (この制約の意図は、配列の要素型から`element_type`へ、修飾の変換のみを許可すること) - (7) : - 型 `U` を [`std::remove_reference_t`](/reference/type_traits/remove_reference.md)`<`[`std::iter_reference_t`](/reference/iterator/iter_reference_t.md)`>`とするとき - 型 `R` はコンセプト `std::ranges::contiguous_range` 及び `std::ranges::sized_range` を満たしていること diff --git a/start_editing/directory_structure.md b/start_editing/directory_structure.md index 64b072dc0a..ff632e83c9 100644 --- a/start_editing/directory_structure.md +++ b/start_editing/directory_structure.md @@ -27,7 +27,7 @@ reference階層とmodule階層は上記以外は同じであるため、以下 - `std::swap()` - `std::erase()`/`std::erase_if()` - `floor()`/`ceil()`/`round()` (chrono) - - 特殊な例として、[`std::expected`](/reference/expected/expected.md)では[`部分特殊化](/reference/expected/expected.void.md)のためにクラス階層を分離している。これは各メンバ説明の差分が大きいためである + - 特殊な例として、[`std::expected`](/reference/expected/expected.md)では[部分特殊化](/reference/expected/expected.void.md)のためにクラス階層を分離している。これは各メンバ説明の差分が大きいためである - 演算子オーバーロードは、`operator<<` (出力ストリームへの出力) と `std::operator>>` (入力ストリームからの入力) を除き、左辺のクラスに属するものとする - 特殊な例として、[`std::error_code`](/reference/system_error/error_code.md)と[`std::error_condition`](/reference/system_error/error_condition.md)の比較演算子は、クラス階層ではなくヘッダ階層としている。これは所属関係がむずかしいためである From ddd80639fd55a326d4c38a1b70f1b5b203540f02 Mon Sep 17 00:00:00 2001 From: raclamusi Date: Tue, 16 Jul 2024 18:44:23 +0900 Subject: [PATCH 1061/3948] =?UTF-8?q?=E3=82=A4=E3=83=B3=E3=83=A9=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=82=B3=E3=83=BC=E3=83=89=E3=83=96=E3=83=AD=E3=83=83?= =?UTF-8?q?=E3=82=AF=E3=81=AE=E5=85=A8=E8=A7=92=E6=96=87=E5=AD=97=E3=81=AE?= =?UTF-8?q?=20typo=20=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...constant_evaluation_for_all_non-type_template_arguments.md | 2 +- reference/iterator/istream_iterator/op_increment.md | 4 ++-- reference/memory/allocate_shared.md | 4 ++-- reference/memory/allocator/destroy.md | 4 ++-- reference/node_handle/node_handle/op_destructor.md | 2 +- reference/ostream/emit_on_flush.md | 2 +- reference/ostream/flush_emit.md | 2 +- reference/ostream/noemit_on_flush.md | 2 +- reference/syncstream/basic_osyncstream/op_constructor.md | 2 +- reference/type_traits/aligned_union.md | 4 ++-- 10 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lang/cpp17/allow_constant_evaluation_for_all_non-type_template_arguments.md b/lang/cpp17/allow_constant_evaluation_for_all_non-type_template_arguments.md index dce9e1fb01..6e348ae5f8 100644 --- a/lang/cpp17/allow_constant_evaluation_for_all_non-type_template_arguments.md +++ b/lang/cpp17/allow_constant_evaluation_for_all_non-type_template_arguments.md @@ -44,7 +44,7 @@ C++14からC++17にかけて、次の表のような変更があったと考え | 整数または列挙 | 任意の定数式 | | ポインタ型 | 正確な構文と実体、配列、関数、リンケージを使用して静的記憶期間オブジェクトまたは関数を参照する。NULLポインタに評価される任意の定数式 | | 参照型 | 正確な構文とオブジェクト、関数、リンケージを使用して静的記憶期間オブジェクトまたは関数を参照する | -| メンバへのポインタ | 正確な構文と`&X::y` 、またはメンバへのポインタが`NULL`に評価される任意の定数式 | +| メンバへのポインタ | 正確な構文と`&X::y` 、またはメンバへのポインタが`NULL`に評価される任意の定数式 | | [`std::nullptr_t`](/reference/cstddef/nullptr_t.md) | 任意の定数式 | から diff --git a/reference/iterator/istream_iterator/op_increment.md b/reference/iterator/istream_iterator/op_increment.md index d2baaefc51..d3d5b03a70 100644 --- a/reference/iterator/istream_iterator/op_increment.md +++ b/reference/iterator/istream_iterator/op_increment.md @@ -16,12 +16,12 @@ istream_iterator operator++(int); ## 効果 前置`operator++`: -`*in_stream ≫ value;` +`*in_stream >> value;` `return *this;` 後置`operator++`: `istream_iterator tmp = *this;` -`*in_stream ≫ value;` +`*in_stream >> value;` `return tmp;` ※`in_stream`は、メンバ変数として保持している入力ストリームオブジェクトへのポインタ diff --git a/reference/memory/allocate_shared.md b/reference/memory/allocate_shared.md index 17a5ac19ac..9c2faaf86c 100644 --- a/reference/memory/allocate_shared.md +++ b/reference/memory/allocate_shared.md @@ -63,13 +63,13 @@ namespace std { それぞれ、`pv`は型`U`のオブジェクトを保持するのに適したストレージを指し、型`A2`の`a2`は、`value_type`が`remove_cv_t`になるように`allocate_shared`に渡されるアロケーター`a`のリバウンドコピーである。ここで、リバウンドコピーとは、参照カウンタと型`T`の本体を連続メモリ領域に配置するためには`T`のサイズより大きい領域をアロケートする必要があるために`allocator_traits::rebind_alloc`を用いて再束縛されたものである。 -非配列型Uの(サブ)オブジェクトがデフォルトの初期値を持つように指定されている場合、この関数は、式 `allocator_traits::construct(a2、pv)`を介してこの(サブ)オブジェクトを初期化する。ここで、`pv`は、型`U`のオブジェクトを保持するのに適したストレージを指し、タイプ`A2`の`a2`は、`value_type`が`remove_cv_t`になるように、`allocate_shared`に渡されるアロケーター`a`のリバウンドコピーである。 +非配列型Uの(サブ)オブジェクトがデフォルトの初期値を持つように指定されている場合、この関数は、式 `allocator_traits::construct(a2, pv)`を介してこの(サブ)オブジェクトを初期化する。ここで、`pv`は、型`U`のオブジェクトを保持するのに適したストレージを指し、タイプ`A2`の`a2`は、`value_type`が`remove_cv_t`になるように、`allocate_shared`に渡されるアロケーター`a`のリバウンドコピーである。 配列要素は、アドレスの昇順で初期化される。 戻り値によって管理されるオブジェクトの`lifetime`が終了するか、配列要素の初期化が例外をスローすると、初期化された要素は元の構造の逆の順序で破棄される。 -この関数によって初期化された非配列型`U`の(サブ)オブジェクトが破棄される場合、式`allocator_traits::destroy(a2、pv)`によって破棄される。`pv`はその型のオブジェクトを指す。`remove_cv_t`および型`A2`の`a2`は、`value_type`が`remove_cv_t`になるように`allocate_shared`に渡されるアロケーター`a`の再束縛されたコピーである。 +この関数によって初期化された非配列型`U`の(サブ)オブジェクトが破棄される場合、式`allocator_traits::destroy(a2, pv)`によって破棄される。`pv`はその型のオブジェクトを指す。`remove_cv_t`および型`A2`の`a2`は、`value_type`が`remove_cv_t`になるように`allocate_shared`に渡されるアロケーター`a`の再束縛されたコピーである。 - (1) : 初期値`T(forward(args)...)`を持つ型`T`のオブジェクトへの`shared_ptr`を返す。Tが配列型でない場合にのみ、このオーバーロードはオーバーロード解決に関与する。この関数によって呼び出される`shared_ptr`コンストラクタは、型`T`の新しく構築されたオブジェクトのアドレスで`shared_from_this`を有効にする。 - (2) : デフォルトの初期値を持つ`U[N]`型のオブジェクトへの`shared_ptr`を返す。ここで、`U`は`remove_extent_t`である。`T`の形式が`U[]`の場合にのみ、このオーバーロードはオーバーロード解決に関与する。 diff --git a/reference/memory/allocator/destroy.md b/reference/memory/allocator/destroy.md index 381c88ff5e..cf65df1d40 100644 --- a/reference/memory/allocator/destroy.md +++ b/reference/memory/allocator/destroy.md @@ -23,8 +23,8 @@ void destroy(U* p); ## 効果 -- C++03 : `((T*)p)->˜T()` -- C++11 : `p->˜U()` +- C++03 : `((T*)p)->~T()` +- C++11 : `p->~U()` ## 戻り値 diff --git a/reference/node_handle/node_handle/op_destructor.md b/reference/node_handle/node_handle/op_destructor.md index 3c5632e36e..3db26cae4b 100644 --- a/reference/node_handle/node_handle/op_destructor.md +++ b/reference/node_handle/node_handle/op_destructor.md @@ -14,7 +14,7 @@ ## 効果 -`ptr_!= nullptr` の場合、`std::allocator_traits::destroy` を呼び出して `ptr_` が指す `container_node_type` オブジェクト内の `value_type` サブオブジェクトを破棄し、次に `std::allocator_traits::template rebind_traits::deallocate` を呼び出して `ptr_` の割り当てを解除する。 +`ptr_ != nullptr` の場合、`std::allocator_traits::destroy` を呼び出して `ptr_` が指す `container_node_type` オブジェクト内の `value_type` サブオブジェクトを破棄し、次に `std::allocator_traits::template rebind_traits::deallocate` を呼び出して `ptr_` の割り当てを解除する。 ## 戻り値 diff --git a/reference/ostream/emit_on_flush.md b/reference/ostream/emit_on_flush.md index ebc7eba730..01414bdb23 100644 --- a/reference/ostream/emit_on_flush.md +++ b/reference/ostream/emit_on_flush.md @@ -17,7 +17,7 @@ namespace std { ## 効果 -`os.rdbuf()`が`std::basic_syncbuf*`である場合、これを`buf`とすると、`buf->set_emit_on_sync(true)`を呼び出す。 +`os.rdbuf()`が`std::basic_syncbuf*`である場合、これを`buf`とすると、`buf->set_emit_on_sync(true)`を呼び出す。 それ以外の場合、このマニピュレータは効果がない。 diff --git a/reference/ostream/flush_emit.md b/reference/ostream/flush_emit.md index bd68d98fd7..240bbd380d 100644 --- a/reference/ostream/flush_emit.md +++ b/reference/ostream/flush_emit.md @@ -19,7 +19,7 @@ namespace std { ## 効果 `os.flush()`を呼び出す。 -続いて`os.rdbuf()`が`std::basic_syncbuf*`である場合、これを`buf`とすると、`buf->emit()`を呼び出す。 +続いて`os.rdbuf()`が`std::basic_syncbuf*`である場合、これを`buf`とすると、`buf->emit()`を呼び出す。 ## 戻り値 diff --git a/reference/ostream/noemit_on_flush.md b/reference/ostream/noemit_on_flush.md index 8196112fc5..acb6018b87 100644 --- a/reference/ostream/noemit_on_flush.md +++ b/reference/ostream/noemit_on_flush.md @@ -17,7 +17,7 @@ namespace std { ## 効果 -`os.rdbuf()`が`std::basic_syncbuf*`である場合、これを`buf`とすると、`buf->set_emit_on_sync(false)`を呼び出す。 +`os.rdbuf()`が`std::basic_syncbuf*`である場合、これを`buf`とすると、`buf->set_emit_on_sync(false)`を呼び出す。 それ以外の場合、このマニピュレータは効果がない。 diff --git a/reference/syncstream/basic_osyncstream/op_constructor.md b/reference/syncstream/basic_osyncstream/op_constructor.md index 8039478608..bd81a85a2e 100644 --- a/reference/syncstream/basic_osyncstream/op_constructor.md +++ b/reference/syncstream/basic_osyncstream/op_constructor.md @@ -29,7 +29,7 @@ basic_osyncstream(basic_osyncstream&& other) noexcept; - (1) : 提供されるストリームバッファ(`buf`)、アロケータ(`allocator`)を使用してプライベートメンバの[`std::basic_syncbuf`](../basic_syncbuf.md)を初期化し、そのポインタを用いて基底クラスである[`std::basic_ostream`](../../ostream/basic_ostream.md)を初期化する。 - (2)(3) : (1)に委譲。 - (4) : (3)に委譲。 -- (5) : 対応する`other`のサブオブジェクトから基底クラスとプライベートメンバの`std::basic_syncbuf`をムーブ構築し、基底クラスの初期化を完了するために`std::basic_ostream::set_rdbuf(addressof(sb))`を呼び出す。 +- (5) : 対応する`other`のサブオブジェクトから基底クラスとプライベートメンバの`std::basic_syncbuf`をムーブ構築し、基底クラスの初期化を完了するために`std::basic_ostream::set_rdbuf(addressof(sb))`を呼び出す。 ## 事後条件 diff --git a/reference/type_traits/aligned_union.md b/reference/type_traits/aligned_union.md index f72c04b43c..606f7d2a53 100644 --- a/reference/type_traits/aligned_union.md +++ b/reference/type_traits/aligned_union.md @@ -53,9 +53,9 @@ namespace std { - 第1テンプレートパラメータが無意味 - この機能は、可変個のすべての型のサイズとアライメントを推論し、それらの最大値を実際のストレージとして使用する。先頭のテンプレートパラメータはストレージの最小サイズである。すべての型がそれより小さい場合でも、ストレージは第1テンプレートパラメータより小さくならない - - 最小サイズを必要とすることはめずらしいことであり、ほとんどの場合は`aligned_union_t<0、Ts...>`のように使用する。この引数`0`は機能に精通していなければ理解しにくい + - 最小サイズを必要とすることはめずらしいことであり、ほとんどの場合は`aligned_union_t<0, Ts...>`のように使用する。この引数`0`は機能に精通していなければ理解しにくい - サイズとアライメントの推論が[`aligned_storage`](aligned_storage.md)と一貫していない - - 一貫した仕様であるならば、`aligned_union_t<0、T>`のような型をひとつだけ指定する用途につながるが、現在の仕様は何を意図していたのか不明である + - 一貫した仕様であるならば、`aligned_union_t<0, T>`のような型をひとつだけ指定する用途につながるが、現在の仕様は何を意図していたのか不明である この機能を以下のように置き換えることを推奨する: From dae7d3d3ac1b7babdf79a975931548f08dba78ba Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Wed, 17 Jul 2024 14:31:13 +0900 Subject: [PATCH 1062/3948] =?UTF-8?q?linalg=20:=20triangular=5Fmatrix=5Fma?= =?UTF-8?q?trix=5Fleft=5Fsolve=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 2 +- .../triangular_matrix_matrix_left_solve.md | 279 ++++++++++++++++++ 2 files changed, 280 insertions(+), 1 deletion(-) create mode 100644 reference/linalg/triangular_matrix_matrix_left_solve.md diff --git a/reference/linalg.md b/reference/linalg.md index 2e343f8f37..d3f458107e 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -108,7 +108,7 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に | [`hermitian_matrix_rank_k_update`](linalg/hermitian_matrix_rank_k_update.md) | xHERK: ハミルトニアン行列のRank-k更新 (function template) | C++26 | | [`symmetric_matrix_rank_2k_update`](linalg/symmetric_matrix_rank_2k_update.md) | xSYR2K: 対称行列のRank-2k更新 (function template) | C++26 | | [`hermitian_matrix_rank_2k_update`](linalg/hermitian_matrix_rank_2k_update.md) | xHER2K: ハミルトニアン行列のRank-2k更新 (function template) | C++26 | -| `triangular_matrix_matrix_left_solve` | xTRSM: 三角行列の連立一次方程式を解く (function template) | C++26 | +| [`triangular_matrix_matrix_left_solve`](linalg/triangular_matrix_matrix_left_solve.md) | xTRSM: 三角行列の連立一次方程式を解く (function template) | C++26 | | `triangular_matrix_matrix_right_solve` | xTRSM: 三角行列の連立一次方程式を解く (function template) | C++26 | diff --git a/reference/linalg/triangular_matrix_matrix_left_solve.md b/reference/linalg/triangular_matrix_matrix_left_solve.md new file mode 100644 index 0000000000..89c1074e8f --- /dev/null +++ b/reference/linalg/triangular_matrix_matrix_left_solve.md @@ -0,0 +1,279 @@ +# triangular_matrix_matrix_left_solve + + +* [mathjax enable] +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + + +```cpp +namespace std::linalg { + template + void triangular_matrix_matrix_left_solve( + InMat1 A, + Triangle t, + DiagonalStorage d, + InMat2 B, + OutMat X, + BinaryDivideOp divide); // (1) + + template + void triangular_matrix_matrix_left_solve( + ExecutionPolicy&& exec, + InMat1 A, + Triangle t, + DiagonalStorage d, + InMat2 B, + OutMat X, + BinaryDivideOp divide); // (2) + + template + void triangular_matrix_matrix_left_solve( + InMat1 A, + Triangle t, + DiagonalStorage d, + InMat2 B, + OutMat X); // (3) + + template + void triangular_matrix_matrix_left_solve( + ExecutionPolicy&& exec, + InMat1 A, + Triangle t, + DiagonalStorage d, + InMat2 B, + OutMat X); // (4) +} +``` + + +## 概要 +三角行列に対して、連立一次方程式を解く。 +引数`t`は対称行列の成分が上三角にあるのか、それとも下三角にあるのかを示す。 +引数`d`には対称行列の対角成分を暗黙に乗法における単位元とみなすかどうかを指定する。 +引数`divide`には値の割り算を指定する。この引数は非可換な掛け算を持つ値型をサポートするためにある。 + +- (1): 連立一次方程式 $AY = B$ を解き、`Y`を`X`に代入する。もし解が存在しないなら、`X`は有効だが未規定。 +- (2): (1)を指定された実行ポリシーで実行する。 +- (3): 割り算に[`std::divides`](/reference/functional/divides.md)``を用いて、(1)を行う。 +- (4): (3)を指定された実行ポリシーで実行する。 + + +## 適格要件 +- 共通: + + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) + + `DiagonalStorage`は[`implicit_unit_diagonal_t`](implicit_unit_diagonal_t.md)または[`explicit_diagonal_t`](explicit_diagonal_t.md) + + `InMat1`(`A`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + + [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) +- (2), (4): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` + + +## 事前条件 +- [`multipliable`](multipliable.md)`(A, X, B)`が`true` +- `A.extent(0) == A.extent(1)` (つまり`A`が正方行列であること) + + +## 効果 +対称行列の成分の位置を示す`t`と対角成分へアクセスするかどうかを示す`d`を考慮して、連立一次方程式の解を求める。 + +- (1), (2): 連立一次方程式 $AY = B$ を解き、`Y`を`X`に代入する。もし解が存在しないなら、`X`は有効だが未規定。 +- (3): `triangular_matrix_matrix_left_solve(A, t, d, B, X, divides{})`と同じ。 +- (4): `triangular_matrix_matrix_left_solve(std::forward(exec), A, t, d, B, X, divides{})`と同じ。 + + +## 戻り値 +なし + + +## 計算量 +$O(\verb|A.extent(0)| \times (\verb|X.extent(0)|)^2)$ + + +## 備考 +- 三角行列が左側にあるので、非可換な掛け算の場合の`divide`の望ましい実装は数学では$y^{-1}x$と同等と思われる。ここで`x`は最初の引数で`y`は2番目の引数、$y^{-1}$は`y`の掛け算での逆元である。 + + +## 例 +**[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** + +```cpp example +#include +#include +#include +#include +#include +#include + +template +void print_mat(const Matrix& A) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = 0; j < A.extent(1) - 1; ++j) { + std::cout << A[i, j] << ' '; + } + std::cout << A[i, A.extent(1) - 1] << '\n'; + } +} + +template +void init_mat(Matrix& A, typename Matrix::value_type geta = 1) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = 0; j < A.extent(1); ++j) { + A[i, j] = i * A.extent(1) + j + geta; + } + } +} + +template +void init_tria_mat(Matrix& A) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = i + 1; j < A.extent(1); ++j) { + A[i, j] = i * A.extent(1) + j; + } + } +} + +int main() +{ + constexpr size_t N = 4; + + std::vector A_vec(N * N); + std::vector X_vec(N * N); + std::vector B_vec(N * N); + + std::mdspan< + double, + std::extents, + std::linalg::layout_blas_packed< + std::linalg::upper_triangle_t, + std::linalg::row_major_t> + > A(A_vec.data()); + std::mdspan X(X_vec.data(), N, N); + std::mdspan B(B_vec.data(), N, N); + + init_mat(A) + init_mat(B); + + // (1) + std::cout << "(1)\n"; + std::linalg::triangular_matrix_matrix_left_solve( + A, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + B, + X, + std::divides{}); + print_mat(X); + + // (2) + std::cout << "(2)\n"; + std::linalg::triangular_matrix_matrix_left_solve( + std::execution::par, + A, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + B, + X, + std::divides{}); + print(X); + + // (3) + std::cout << "(3)\n"; + std::linalg::triangular_matrix_matrix_left_solve( + A, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + B, + X); + print(X); + + // (4) + std::cout << "(4)\n"; + std::linalg::triangular_matrix_matrix_left_solve( + std::execution::par, + A, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + B, + X); + print(X); + + return 0; +} +``` +* A.extent[link /reference/mdspan/extents/extent.md] +* v.extent[link /reference/mdspan/extents/extent.md] +* std::mdspan[link /reference/mdspan/mdspan.md] +* std::extents[link /reference/mdspan/extents.md] +* std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] +* std::linalg::upper_triangle_t[link /reference/linalg/upper_triangle_t.md] +* std::linalg::row_major_t[link /reference/linalg/row_major_t.md] +* std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] +* std::linalg::implicit_unit_diagonal[link /reference/linalg/implicit_unit_diagonal_t.md] +* std::execution::par[link /reference/execution/execution/execution_policy.md] +* std::linalg::triangular_matrix_matrix_left_solve[color ff0000] + + +### 出力 +``` +(1) +-2 -2 +2 3 +(2) +-2 -2 +2 3 +(3) +-2 -2 +2 3 +(4) +-2 -2 +2 3 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution`](/reference/execution.md) +- [`mdspan`](/reference/mdspan.md) +- [`upper_triangle_t`](upper_triangle_t.md) +- [`lower_triangle_t`](lower_triangle_t.md) +- [`implicit_unit_diagonal`](implicit_unit_diagonal_t.md) +- [`explicit_diagonal`](explicit_diagonal_t.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) +- [LAPACK: trsm](https://netlib.org/lapack/explore-html/d9/de5/group__trsm.html) + From fe869d5b73f73b4743bd7df6c91772a8eef3746b Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Wed, 17 Jul 2024 14:31:59 +0900 Subject: [PATCH 1063/3948] linalg : fix typo. (#1233) Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/triangular_matrix_vector_solve.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/linalg/triangular_matrix_vector_solve.md b/reference/linalg/triangular_matrix_vector_solve.md index d4c71663bb..b587f9ad52 100644 --- a/reference/linalg/triangular_matrix_vector_solve.md +++ b/reference/linalg/triangular_matrix_vector_solve.md @@ -125,11 +125,11 @@ namespace std::linalg { - (1): 連立一次方程式 $Ay = b$ を解き、`y`を`x`に代入する。もし解が存在しないなら、`x`は有効だが未規定。 - (2): (1)を指定された実行ポリシーで実行する。 -- (3): 割り算に[`std::divedes`](/reference/functional/divides.md)``を用いて、(1)を行う。 +- (3): 割り算に[`std::divides`](/reference/functional/divides.md)``を用いて、(1)を行う。 - (4): (3)を指定された実行ポリシーで実行する。 - (5): `x`に`b`を使って、in-placeに(1)を行う。 - (6): (5)を指定された実行ポリシーで実行する。 -- (7): 割り算に[`std::divedes`](/reference/functional/divides.md)``を用いて、(5)を行う。 +- (7): 割り算に[`std::divides`](/reference/functional/divides.md)``を用いて、(5)を行う。 - (8): (7)を指定された実行ポリシーで実行する。 From c84c78865ce78853654b463989873ec034c97296 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Wed, 17 Jul 2024 14:39:35 +0900 Subject: [PATCH 1064/3948] =?UTF-8?q?linalg=20:=20=E4=BE=8B=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- .../linalg/triangular_matrix_matrix_left_solve.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/reference/linalg/triangular_matrix_matrix_left_solve.md b/reference/linalg/triangular_matrix_matrix_left_solve.md index 89c1074e8f..f8c68987ae 100644 --- a/reference/linalg/triangular_matrix_matrix_left_solve.md +++ b/reference/linalg/triangular_matrix_matrix_left_solve.md @@ -138,10 +138,10 @@ void print_mat(const Matrix& A) { } template -void init_mat(Matrix& A, typename Matrix::value_type geta = 1) { +void init_mat(Matrix& A) { for(int i = 0; i < A.extent(0); ++i) { for(int j = 0; j < A.extent(1); ++j) { - A[i, j] = i * A.extent(1) + j + geta; + A[i, j] = i * A.extent(1) + j; } } } @@ -173,7 +173,7 @@ int main() std::mdspan X(X_vec.data(), N, N); std::mdspan B(B_vec.data(), N, N); - init_mat(A) + init_tria_mat(A); init_mat(B); // (1) @@ -197,7 +197,7 @@ int main() B, X, std::divides{}); - print(X); + print_mat(X); // (3) std::cout << "(3)\n"; @@ -207,7 +207,7 @@ int main() std::linalg::implicit_unit_diagonal, B, X); - print(X); + print_mat(X); // (4) std::cout << "(4)\n"; @@ -218,13 +218,12 @@ int main() std::linalg::implicit_unit_diagonal, B, X); - print(X); + print_mat(X); return 0; } ``` * A.extent[link /reference/mdspan/extents/extent.md] -* v.extent[link /reference/mdspan/extents/extent.md] * std::mdspan[link /reference/mdspan/mdspan.md] * std::extents[link /reference/mdspan/extents.md] * std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] From 37f60c5b903e13d13943cd7667449850714d440e Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Wed, 17 Jul 2024 17:21:31 +0900 Subject: [PATCH 1065/3948] =?UTF-8?q?std::unique=5Fptr=E3=81=AB=E8=87=AA?= =?UTF-8?q?=E4=BD=9C=E3=83=87=E3=83=AA=E3=83=BC=E3=82=BF=E3=81=AE=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/memory/unique_ptr/op_constructor.md | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/reference/memory/unique_ptr/op_constructor.md b/reference/memory/unique_ptr/op_constructor.md index a23183cb00..48c6eb1bdd 100644 --- a/reference/memory/unique_ptr/op_constructor.md +++ b/reference/memory/unique_ptr/op_constructor.md @@ -118,6 +118,20 @@ unique_ptr p(new T(), deleter); // pはdeleterへの参照を保持する #include #include +using AllocTraits = std::allocator_traits>; + +class Deleter { + public: + explicit Deleter(const std::allocator& alloc) : alloc_(alloc) {} + + void operator()(int* p) { + AllocTraits::destroy(alloc_, p); + AllocTraits::deallocate(alloc_, p, 1); + } + private: + std::allocator alloc_; +}; + int main() { // (1) デフォルト構築 @@ -133,6 +147,16 @@ int main() std::unique_ptr p3(new int(3), std::default_delete()); assert(p3); + // 自作デリータを使った例 + { + std::allocator alloc; + int* p = AllocTraits::allocate(alloc, 1); + AllocTraits::construct(alloc, p, 4); + std::unique_ptr p4(p, Deleter(alloc)); + assert(p4); + assert(*p4 == 4); + } + // (5) 他のunique_ptrから所有権を譲渡する std::unique_ptr p5 = std::move(p3); assert(*p5 == 3); @@ -147,6 +171,12 @@ int main() assert(*static_cast(p7.get()) == 3); } ``` +* std::allocator_traits[link /reference/memory/allocator_traits.md] +* std::allocator[link /reference/memory/allocator.md] +* destroy[link /reference/memory/allocator_traits/destroy.md] +* deallocate[link /reference/memory/allocator_traits/deallocate.md] +* allocate[link /reference/memory/allocator_traits/allocate.md] +* construct[link /reference/memory/allocator_traits/construct.md] * std::default_delete[link /reference/memory/default_delete.md] * std::move[link /reference/utility/move.md] * get()[link get.md] From bb6a33fb193cb4e62fb340c597030a8340429682 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Thu, 18 Jul 2024 11:03:48 +0900 Subject: [PATCH 1066/3948] =?UTF-8?q?linalg=20:=20=E8=A6=8B=E9=80=83?= =?UTF-8?q?=E3=81=97=E3=81=9F=E9=96=A2=E6=95=B0=E3=82=AA=E3=83=BC=E3=83=90?= =?UTF-8?q?=E3=83=BC=E3=83=AD=E3=83=BC=E3=83=89=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- .../triangular_matrix_matrix_left_solve.md | 125 +++++++++++++++++- 1 file changed, 119 insertions(+), 6 deletions(-) diff --git a/reference/linalg/triangular_matrix_matrix_left_solve.md b/reference/linalg/triangular_matrix_matrix_left_solve.md index f8c68987ae..85e0bd5b79 100644 --- a/reference/linalg/triangular_matrix_matrix_left_solve.md +++ b/reference/linalg/triangular_matrix_matrix_left_solve.md @@ -65,6 +65,54 @@ namespace std::linalg { DiagonalStorage d, InMat2 B, OutMat X); // (4) + + template + void triangular_matrix_matrix_left_solve( + InMat A, + Triangle t, + DiagonalStorage d, + InOutMat B, + BinaryDivideOp divide); // (5) + + template + void triangular_matrix_matrix_left_solve( + ExecutionPolicy&& exec, + InMat A, + Triangle t, + DiagonalStorage d, + InOutMat B, + BinaryDivideOp divide); // (6) + + template + void triangular_matrix_matrix_left_solve( + InMat A, + Triangle t, + DiagonalStorage d, + InOutMat B); // (7) + + template + void triangular_matrix_matrix_left_solve( + ExecutionPolicy&& exec, + InMat A, + Triangle t, + DiagonalStorage d, + InOutMat B); // (8) } ``` @@ -79,21 +127,28 @@ namespace std::linalg { - (2): (1)を指定された実行ポリシーで実行する。 - (3): 割り算に[`std::divides`](/reference/functional/divides.md)``を用いて、(1)を行う。 - (4): (3)を指定された実行ポリシーで実行する。 +- (5): `X`に`B`を使って、in-placeに(1)を行う。 +- (6): (5)を指定された実行ポリシーで実行する。 +- (7): 割り算に[`std::divides`](/reference/functional/divides.md)``を用いて、(5)を行う。 +- (8): (7)を指定された実行ポリシーで実行する。 ## 適格要件 - 共通: + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) + `DiagonalStorage`は[`implicit_unit_diagonal_t`](implicit_unit_diagonal_t.md)または[`explicit_diagonal_t`](explicit_diagonal_t.md) - + `InMat1`(`A`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 - + [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` + + `decltype(A)`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) -- (2), (4): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` +- (1), (2), (3), (4): [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` +- (5), (6), (7), (8): [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` +- (2), (4), (6), (8): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` ## 事前条件 -- [`multipliable`](multipliable.md)`(A, X, B)`が`true` -- `A.extent(0) == A.extent(1)` (つまり`A`が正方行列であること) +- 共通: + + `A.extent(0) == A.extent(1)` (つまり`A`が正方行列であること) +- (1), (2), (3), (4): [`multipliable`](multipliable.md)`(A, X, B)`が`true` +- (5), (6), (7), (8): [`multipliable`](multipliable.md)`(A, B, B)`が`true` ## 効果 @@ -102,6 +157,9 @@ namespace std::linalg { - (1), (2): 連立一次方程式 $AY = B$ を解き、`Y`を`X`に代入する。もし解が存在しないなら、`X`は有効だが未規定。 - (3): `triangular_matrix_matrix_left_solve(A, t, d, B, X, divides{})`と同じ。 - (4): `triangular_matrix_matrix_left_solve(std::forward(exec), A, t, d, B, X, divides{})`と同じ。 +- (5), (6): `X`に`B`を使って、in-placeに(1)を行う。 +- (7): `triangular_matrix_matrix_left_solve(A, t, d, B, divides{})`と同じ。 +- (8): `triangular_matrix_matrix_left_solve(std::forward(exec), A, t, d, B, divides{})`と同じ。 ## 戻り値 @@ -109,7 +167,7 @@ namespace std::linalg { ## 計算量 -$O(\verb|A.extent(0)| \times (\verb|X.extent(0)|)^2)$ +$O((\verb|A.extent(0)|)^2 \times \verb|B.extent(1)|)$ ## 備考 @@ -220,6 +278,49 @@ int main() X); print_mat(X); + // (5) + std::cout << "(5)\n"; + std::linalg::triangular_matrix_matrix_left_solve( + A, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + B, + std::divides{}); + print_mat(B); + + // (6) + init_mat(B); + std::cout << "(6)\n"; + std::linalg::triangular_matrix_matrix_left_solve( + std::execution::par, + A, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + B, + std::divides{}); + print_mat(B); + + // (7) + init_mat(B); + std::cout << "(7)\n"; + std::linalg::triangular_matrix_matrix_left_solve( + A, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + B); + print_mat(B); + + // (8) + init_mat(B); + std::cout << "(8)\n"; + std::linalg::triangular_matrix_matrix_left_solve( + std::execution::par, + A, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + B); + print_mat(B); + return 0; } ``` @@ -249,6 +350,18 @@ int main() (4) -2 -2 2 3 +(5) +-2 -2 +2 3 +(6) +-2 -2 +2 3 +(7) +-2 -2 +2 3 +(8) +-2 -2 +2 3 ``` From ad1f2ed629033c147d39060bbe6c9c9b1ae19055 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Thu, 18 Jul 2024 11:32:33 +0900 Subject: [PATCH 1067/3948] =?UTF-8?q?linalg=20:=20triangular=5Fmatrix=5Fma?= =?UTF-8?q?trix=5Fright=5Fsolve=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg.md | 2 +- .../triangular_matrix_matrix_right_solve.md | 391 ++++++++++++++++++ 2 files changed, 392 insertions(+), 1 deletion(-) create mode 100644 reference/linalg/triangular_matrix_matrix_right_solve.md diff --git a/reference/linalg.md b/reference/linalg.md index d3f458107e..e2e2e3bbfe 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -109,7 +109,7 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に | [`symmetric_matrix_rank_2k_update`](linalg/symmetric_matrix_rank_2k_update.md) | xSYR2K: 対称行列のRank-2k更新 (function template) | C++26 | | [`hermitian_matrix_rank_2k_update`](linalg/hermitian_matrix_rank_2k_update.md) | xHER2K: ハミルトニアン行列のRank-2k更新 (function template) | C++26 | | [`triangular_matrix_matrix_left_solve`](linalg/triangular_matrix_matrix_left_solve.md) | xTRSM: 三角行列の連立一次方程式を解く (function template) | C++26 | -| `triangular_matrix_matrix_right_solve` | xTRSM: 三角行列の連立一次方程式を解く (function template) | C++26 | +| [`triangular_matrix_matrix_right_solve`](linalg/triangular_matrix_matrix_right_solve.md) | xTRSM: 三角行列の連立一次方程式を解く (function template) | C++26 | ## タグ diff --git a/reference/linalg/triangular_matrix_matrix_right_solve.md b/reference/linalg/triangular_matrix_matrix_right_solve.md new file mode 100644 index 0000000000..561622a289 --- /dev/null +++ b/reference/linalg/triangular_matrix_matrix_right_solve.md @@ -0,0 +1,391 @@ +# triangular_matrix_matrix_right_solve + + +* [mathjax enable] +* linalg[meta header] +* function template[meta id-type] +* std::linalg[meta namespace] +* cpp26[meta cpp] + + +```cpp +namespace std::linalg { + template + void triangular_matrix_matrix_right_solve( + InMat1 A, + Triangle t, + DiagonalStorage d, + InMat2 B, + OutMat X, + BinaryDivideOp divide); // (1) + + template + void triangular_matrix_matrix_right_solve( + ExecutionPolicy&& exec, + InMat1 A, + Triangle t, + DiagonalStorage d, + InMat2 B, + OutMat X, + BinaryDivideOp divide); // (2) + + template + void triangular_matrix_matrix_right_solve( + InMat1 A, + Triangle t, + DiagonalStorage d, + InMat2 B, + OutMat X); // (3) + + template + void triangular_matrix_matrix_right_solve( + ExecutionPolicy&& exec, + InMat1 A, + Triangle t, + DiagonalStorage d, + InMat2 B, + OutMat X); // (4) + + template + void triangular_matrix_matrix_right_solve( + InMat A, + Triangle t, + DiagonalStorage d, + InOutMat B, + BinaryDivideOp divide); // (5) + + template + void triangular_matrix_matrix_right_solve( + ExecutionPolicy&& exec, + InMat A, + Triangle t, + DiagonalStorage d, + InOutMat B, + BinaryDivideOp divide); // (6) + + template + void triangular_matrix_matrix_right_solve( + InMat A, + Triangle t, + DiagonalStorage d, + InOutMat B); // (7) + + template + void triangular_matrix_matrix_right_solve( + ExecutionPolicy&& exec, + InMat A, + Triangle t, + DiagonalStorage d, + InOutMat B); // (8) +} +``` + + +## 概要 +三角行列に対して、連立一次方程式を解く。 +引数`t`は対称行列の成分が上三角にあるのか、それとも下三角にあるのかを示す。 +引数`d`には対称行列の対角成分を暗黙に乗法における単位元とみなすかどうかを指定する。 +引数`divide`には値の割り算を指定する。この引数は非可換な掛け算を持つ値型をサポートするためにある。 + +- (1): 連立一次方程式 $YA = B$ を解き、`Y`を`X`に代入する。もし解が存在しないなら、`X`は有効だが未規定。 +- (2): (1)を指定された実行ポリシーで実行する。 +- (3): 割り算に[`std::divides`](/reference/functional/divides.md)``を用いて、(1)を行う。 +- (4): (3)を指定された実行ポリシーで実行する。 +- (5): `X`に`B`を使って、in-placeに(1)を行う。 +- (6): (5)を指定された実行ポリシーで実行する。 +- (7): 割り算に[`std::divides`](/reference/functional/divides.md)``を用いて、(5)を行う。 +- (8): (7)を指定された実行ポリシーで実行する。 + + +## 適格要件 +- 共通: + + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) + + `DiagonalStorage`は[`implicit_unit_diagonal_t`](implicit_unit_diagonal_t.md)または[`explicit_diagonal_t`](explicit_diagonal_t.md) + + `decltype(A)`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) +- (1), (2), (3), (4): [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` +- (5), (6), (7), (8): [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` +- (2), (4), (6), (8): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` + + +## 事前条件 +- 共通: + + `A.extent(0) == A.extent(1)` (つまり`A`が正方行列であること) +- (1), (2), (3), (4): [`multipliable`](multipliable.md)`(X, A, B)`が`true` +- (5), (6), (7), (8): [`multipliable`](multipliable.md)`(B, A, B)`が`true` + + +## 効果 +対称行列の成分の位置を示す`t`と対角成分へアクセスするかどうかを示す`d`を考慮して、連立一次方程式の解を求める。 + +- (1), (2): 連立一次方程式 $AY = B$ を解き、`Y`を`X`に代入する。もし解が存在しないなら、`X`は有効だが未規定。 +- (3): `triangular_matrix_matrix_right_solve(A, t, d, B, X, divides{})`と同じ。 +- (4): `triangular_matrix_matrix_right_solve(std::forward(exec), A, t, d, B, X, divides{})`と同じ。 +- (5), (6): `X`に`B`を使って、in-placeに(1)を行う。 +- (7): `triangular_matrix_matrix_right_solve(A, t, d, B, divides{})`と同じ。 +- (8): `triangular_matrix_matrix_right_solve(std::forward(exec), A, t, d, B, divides{})`と同じ。 + + +## 戻り値 +なし + + +## 計算量 +$O((\verb|A.extent(0)|)^2 \times \verb|B.extent(0)|)$ + + +## 備考 +- 三角行列が左側にあるので、非可換な掛け算の場合の`divide`の望ましい実装は数学では$xy^{-1}$と同等と思われる。ここで`x`は最初の引数で`y`は2番目の引数、$y^{-1}$は`y`の掛け算での逆元である。 + + +## 例 +**[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** + +```cpp example +#include +#include +#include +#include +#include +#include + +template +void print_mat(const Matrix& A) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = 0; j < A.extent(1) - 1; ++j) { + std::cout << A[i, j] << ' '; + } + std::cout << A[i, A.extent(1) - 1] << '\n'; + } +} + +template +void init_mat(Matrix& A) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = 0; j < A.extent(1); ++j) { + A[i, j] = i * A.extent(1) + j; + } + } +} + +template +void init_tria_mat(Matrix& A) { + for(int i = 0; i < A.extent(0); ++i) { + for(int j = i + 1; j < A.extent(1); ++j) { + A[i, j] = i * A.extent(1) + j; + } + } +} + +int main() +{ + constexpr size_t N = 4; + + std::vector A_vec(N * N); + std::vector X_vec(N * N); + std::vector B_vec(N * N); + + std::mdspan< + double, + std::extents, + std::linalg::layout_blas_packed< + std::linalg::upper_triangle_t, + std::linalg::row_major_t> + > A(A_vec.data()); + std::mdspan X(X_vec.data(), N, N); + std::mdspan B(B_vec.data(), N, N); + + init_tria_mat(A); + init_mat(B); + + // (1) + std::cout << "(1)\n"; + std::linalg::triangular_matrix_matrix_right_solve( + A, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + B, + X, + std::divides{}); + print_mat(X); + + // (2) + std::cout << "(2)\n"; + std::linalg::triangular_matrix_matrix_right_solve( + std::execution::par, + A, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + B, + X, + std::divides{}); + print_mat(X); + + // (3) + std::cout << "(3)\n"; + std::linalg::triangular_matrix_matrix_right_solve( + A, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + B, + X); + print_mat(X); + + // (4) + std::cout << "(4)\n"; + std::linalg::triangular_matrix_matrix_right_solve( + std::execution::par, + A, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + B, + X); + print_mat(X); + + // (5) + std::cout << "(5)\n"; + std::linalg::triangular_matrix_matrix_right_solve( + A, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + B, + std::divides{}); + print_mat(B); + + // (6) + init_mat(B); + std::cout << "(6)\n"; + std::linalg::triangular_matrix_matrix_right_solve( + std::execution::par, + A, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + B, + std::divides{}); + print_mat(B); + + // (7) + init_mat(B); + std::cout << "(7)\n"; + std::linalg::triangular_matrix_matrix_right_solve( + A, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + B); + print_mat(B); + + // (8) + init_mat(B); + std::cout << "(8)\n"; + std::linalg::triangular_matrix_matrix_right_solve( + std::execution::par, + A, + std::linalg::upper_triangle, + std::linalg::implicit_unit_diagonal, + B); + print_mat(B); + + return 0; +} +``` +* A.extent[link /reference/mdspan/extents/extent.md] +* std::mdspan[link /reference/mdspan/mdspan.md] +* std::extents[link /reference/mdspan/extents.md] +* std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] +* std::linalg::upper_triangle_t[link /reference/linalg/upper_triangle_t.md] +* std::linalg::row_major_t[link /reference/linalg/row_major_t.md] +* std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] +* std::linalg::implicit_unit_diagonal[link /reference/linalg/implicit_unit_diagonal_t.md] +* std::execution::par[link /reference/execution/execution/execution_policy.md] +* std::linalg::triangular_matrix_matrix_right_solve[color ff0000] + + +### 出力 +``` +(1) +0 1 +2 1 +(2) +0 1 +2 1 +(3) +0 1 +2 1 +(4) +0 1 +2 1 +(5) +0 1 +2 1 +(6) +0 1 +2 1 +(7) +0 1 +2 1 +(8) +0 1 +2 1 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution`](/reference/execution.md) +- [`mdspan`](/reference/mdspan.md) +- [`upper_triangle_t`](upper_triangle_t.md) +- [`lower_triangle_t`](lower_triangle_t.md) +- [`implicit_unit_diagonal`](implicit_unit_diagonal_t.md) +- [`explicit_diagonal`](explicit_diagonal_t.md) + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) +- [LAPACK: trsm](https://netlib.org/lapack/explore-html/d9/de5/group__trsm.html) + From 4baab1d2e6a346af85afe1cc9f61f356627e63c4 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 18 Jul 2024 17:50:24 +0900 Subject: [PATCH 1068/3948] =?UTF-8?q?=E3=82=B9=E3=83=9D=E3=83=B3=E3=82=B5?= =?UTF-8?q?=E3=83=BC=E6=9B=B4=E6=96=B0=20#1301?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.md b/index.md index bf53aa6f21..98dc7efb00 100644 --- a/index.md +++ b/index.md @@ -130,6 +130,8 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい - [ugai様](https://opencollective.com/ugai) +
USAMI Kenta
+ スポンサーシップについては、以下のページを参照ください。 From 0ed791c866e8d0547c8bee66e80ee33d41eead5f Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 18 Jul 2024 19:05:39 +0900 Subject: [PATCH 1069/3948] =?UTF-8?q?mdspan/dims:=20C++26=20P2389R2?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/mdspan.md | 1 + reference/mdspan/extents.md | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/reference/mdspan.md b/reference/mdspan.md index cf120b1b95..852fdef26a 100644 --- a/reference/mdspan.md +++ b/reference/mdspan.md @@ -11,6 +11,7 @@ |------|------|-------| | [`extents`](mdspan/extents.md) | 多次元配列のサイズを表す値 (class template) | C++23 | | [`dextents`](mdspan/extents.md) | 全次元が動的な多次元配列のサイズを表す値 (alias template) | C++23 | +| [`dims`](mdspan/extents.md) | 全次元が動的な多次元配列のサイズを表す値 (alias template) | C++26 | ## レイアウトマッピング diff --git a/reference/mdspan/extents.md b/reference/mdspan/extents.md index 3851a56db7..930c8075e9 100644 --- a/reference/mdspan/extents.md +++ b/reference/mdspan/extents.md @@ -11,6 +11,9 @@ namespace std { template using dextents = see below; + + template + using dims = see below; // C++26以降 } ``` * see below[italic] @@ -43,6 +46,9 @@ array dynamic-extents; エイリアステンプレート`dextents`は、次元数`Rank`かつ全次元が動的要素数で指定される`extents`を生成する。 例えば`dextents`は`extents`の略記となる。 +C++26では、テンプレートパラメータ`IndexType`がデフォルト引数`size_t`をもつエイリアステンプレート`dims`が追加される。 +例えば`dims<2>`は`dextents`と等価であり、`extents`の略記となる。 + ## 適格要件 @@ -95,8 +101,13 @@ int main() // 固定要素数 3x3 の2次元配列サイズ std::extents ext3x3; +#if 1 // 動的要素数からなる2次元配列サイズを 4x2 で初期化 std::dextents ext2d{4, 2}; +#else + // C++26: dims<2>はdextentsと等価 + std::dims<2> ext2d{4, 2}; +#endif // 2個の動的要素数(高さ,幅)と静的要素数(RGBA=4)からなる3次元配列サイズ using ColorImageExt = std::extents; @@ -105,6 +116,7 @@ int main() ``` * std::extents[color ff0000] * std::dextents[color ff0000] +* std::dims[color ff0000] ### 出力 ``` @@ -129,3 +141,5 @@ int main() ## 参照 - [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) - [P2599R2 `index_type` & `size_type` in `mdspan`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2599r2.pdf) +- [P2389R2 `dextents` Index Type Parameter](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2389r2.html) + - C++26から、エイリアステンプレート`dims`が追加される。 From 7e2cd224ec51ca7abe9379321c1c747b6a1e4a9c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 18 Jul 2024 22:21:17 +0900 Subject: [PATCH 1070/3948] =?UTF-8?q?=E3=83=88=E3=83=83=E3=83=97=E3=83=9A?= =?UTF-8?q?=E3=83=BC=E3=82=B8=20:=20=E3=82=B9=E3=83=9D=E3=83=B3=E3=82=B5?= =?UTF-8?q?=E3=83=BC=E3=81=AE=E6=8E=B2=E8=BC=89=E6=9C=9F=E9=99=90=E3=82=92?= =?UTF-8?q?=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF=E3=81=99=E3=82=8B=E3=81=9F?= =?UTF-8?q?=E3=82=81=E3=81=AB=E6=96=B0=E8=A6=8F=E6=A7=8B=E6=96=87=E3=82=92?= =?UTF-8?q?=E5=B0=8E=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/cpprefjp/site_generator/issues/87 --- index.md | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/index.md b/index.md index 98dc7efb00..7ac6c02f67 100644 --- a/index.md +++ b/index.md @@ -26,7 +26,7 @@ ご支援いただくユーザーの方々には、以下の特典があります。 -- 本ページ (cpprefjpサイトのトップページ) に、金額順でロゴを表示させていただきます (金額が同じ場合は登録順) +- 本ページ (cpprefjpサイトのトップページ) に1年間、金額順でロゴを表示させていただきます (金額が同じ場合は登録順) - シルバースポンサー以上の方は、[cpprefjp/site](https://github.com/cpprefjp/site)リポジトリのissueとして、採用情報を投稿できます (一週間ほどで閉じます) ご支援いただいた資金は、貢献度に応じてコントリビューターに分配させていただきます。 @@ -86,51 +86,52 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい ### ゴールドスポンサー -- Hiroshi様 +[sponsor name:Hiroshi様, note:pk0612, period:2025-02-01, fee:1000, amount:1] -
shiguredo
+[sponsor name:cocotone様, img:https://raw.githubusercontent.com/cpprefjp/image/master/sponsors/cocotone/cocotone.png, link:https://www.cocotone.jp, size:560, fee:75, amount:12] -
cocotone
+[sponsor name:shiguredo様, img:https://raw.githubusercontent.com/cpprefjp/image/master/sponsors/shiguredo/shiguredo.png, link:https://shiguredo.jp/, size:560, period:2024-10-27, fee:800, amount:1] ### シルバースポンサー -
Fixstars
+[sponsor name:Acerola Software様, img:https://github.com/cpprefjp/image/raw/master/sponsors/Acerola/as_logo.png, link:https://acerola-software.jp/, size:400, fee:15, amount:12] -
Acerola Software
+[sponsor name:Fixstars様, img:https://github.com/cpprefjp/image/raw/master/sponsors/Fixstars/fixstars-logo.png, link:https://www.fixstars.com/, size:400, fee:10, amount:12] -
vaporoid
+[sponsor name:pegasys様, img:https://tmpgenc.pegasys-inc.com/images/pegasys_logo.png, link:https://www.pegasys-inc.com/, size:320, fee:10, amount:12] -
CubeSoft
+[sponsor name:vaporoid様, img:https://github.com/cpprefjp/image/raw/master/sponsors/vaporoid/cpprefjp-400x150.png, link:https://vaporoid.com/sys/, size:400, fee:8, amount:12] -
M.Kohana
+[sponsor name:CubeSoft様, img:https://raw.githubusercontent.com/cube-soft/cube.assets/master/home/banner/large.png, link:https://www.cube-soft.jp/, size:400, fee:8, amount:12] -
pegasys
+[sponsor name:M.Kohana様, img:https://github.com/cpprefjp/image/raw/master/sponsors/m_kohana/m_kohana.jpg, link:https://mkohana.github.io/, size:320, fee:8, amount:12] + +[sponsor name:有限会社テクニカルアーツ様, img:https://raw.githubusercontent.com/cpprefjp/image/master/sponsors/technical_arts/TechnicalArtsLogo3.png, link:https://www.techarts.co.jp/, size:400, fee:8, amount:12] -
technical arts
### ブロンズスポンサー -
odan
+[sponsor name:イシハラユウヤ様, fee:5, amount:12] -
unagi
+[sponsor name:Megumi Nakagami様, link:https://opencollective.com/meg_nakagami, fee:5, amount:12] -- [nodchip](https://twitter.com/nodchip) +[sponsor name:minachun / J.Minami様, img:https://raw.githubusercontent.com/minachun/minachun/main/banner.png, link:https://github.com/minachun/minachun, fee:5, amount:12, note:Junichirou Minami] -- イシハラユウヤ様 -- [Megumi Nakagami様](https://opencollective.com/meg_nakagami) +[sponsor name:odan様, img:https://odan.dev/icon.jpeg, link:https://opencollective.com/odan, size:320, fee:50, amount:1] +[sponsor name:unagi様, img:https://www.unagiworks.net/blog/wp-content/uploads/2019/01/logo.gif, fee:50, amount:1, period:2025-07-02] -
minachun / J.Minami
+[sponsor name:nodchip様, link:https://twitter.com/nodchip, note:Hisayori Noda, fee:50, amount:1, period:2024-11-07] -- [Hashitaku様](https://opencollective.com/hashitaku) +[sponsor name:Hashitaku様, link:https://opencollective.com/hashitaku, fee:20, amount:1, period:2024-05-08] -
yukika2e
+[sponsor name:yukika2e様, img:https://github.com/cpprefjp/image/raw/master/sponsors/yukika2e/yukika2e.png, fee:10, amount:1, period:2024-05-18] -- [ugai様](https://opencollective.com/ugai) +[sponsor name:ugai様, link:https://opencollective.com/ugai, fee:5, amount:1, period:2025-02-06] -
USAMI Kenta
+[sponsor name:USAMI Kenta, img:https://gravatar.com/userimage/33138763/7af48baae61cde116bd8d28a5158946e.jpeg?size=256, link:https://github.com/zonuexe, size:256, fee:5, amount:12] スポンサーシップについては、以下のページを参照ください。 From 53c02d0e10dbd88492607e9c8b7f6ecdd4d16cb1 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 18 Jul 2024 22:30:26 +0900 Subject: [PATCH 1071/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=83=9F?= =?UTF-8?q?=E3=82=B9=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/index.md b/index.md index 7ac6c02f67..057eda11da 100644 --- a/index.md +++ b/index.md @@ -95,17 +95,17 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい ### シルバースポンサー -[sponsor name:Acerola Software様, img:https://github.com/cpprefjp/image/raw/master/sponsors/Acerola/as_logo.png, link:https://acerola-software.jp/, size:400, fee:15, amount:12] +[sponsor name:Acerola Software様, img:https://raw.githubusercontent.com/cpprefjp/image/master/sponsors/Acerola/as_logo.png, link:https://acerola-software.jp/, size:400, fee:15, amount:12] -[sponsor name:Fixstars様, img:https://github.com/cpprefjp/image/raw/master/sponsors/Fixstars/fixstars-logo.png, link:https://www.fixstars.com/, size:400, fee:10, amount:12] +[sponsor name:Fixstars様, img:ttps://raw.githubusercontent.com/cpprefjp/image/master/sponsors/Fixstars/fixstars-logo.png, link:https://www.fixstars.com/, size:400, fee:10, amount:12] [sponsor name:pegasys様, img:https://tmpgenc.pegasys-inc.com/images/pegasys_logo.png, link:https://www.pegasys-inc.com/, size:320, fee:10, amount:12] -[sponsor name:vaporoid様, img:https://github.com/cpprefjp/image/raw/master/sponsors/vaporoid/cpprefjp-400x150.png, link:https://vaporoid.com/sys/, size:400, fee:8, amount:12] +[sponsor name:vaporoid様, img:https://raw.githubusercontent.com/cpprefjp/image/master/sponsors/vaporoid/cpprefjp-400x150.png, link:https://vaporoid.com/sys/, size:400, fee:8, amount:12] [sponsor name:CubeSoft様, img:https://raw.githubusercontent.com/cube-soft/cube.assets/master/home/banner/large.png, link:https://www.cube-soft.jp/, size:400, fee:8, amount:12] -[sponsor name:M.Kohana様, img:https://github.com/cpprefjp/image/raw/master/sponsors/m_kohana/m_kohana.jpg, link:https://mkohana.github.io/, size:320, fee:8, amount:12] +[sponsor name:M.Kohana様, img:https://raw.githubusercontent.com/cpprefjp/image/master/sponsors/m_kohana/m_kohana.jpg, link:https://mkohana.github.io/, size:320, fee:8, amount:12] [sponsor name:有限会社テクニカルアーツ様, img:https://raw.githubusercontent.com/cpprefjp/image/master/sponsors/technical_arts/TechnicalArtsLogo3.png, link:https://www.techarts.co.jp/, size:400, fee:8, amount:12] @@ -127,7 +127,7 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい [sponsor name:Hashitaku様, link:https://opencollective.com/hashitaku, fee:20, amount:1, period:2024-05-08] -[sponsor name:yukika2e様, img:https://github.com/cpprefjp/image/raw/master/sponsors/yukika2e/yukika2e.png, fee:10, amount:1, period:2024-05-18] +[sponsor name:yukika2e様, img:https://raw.githubusercontent.com/cpprefjp/image/master/sponsors/yukika2e/yukika2e.png, fee:10, amount:1, period:2024-05-18] [sponsor name:ugai様, link:https://opencollective.com/ugai, fee:5, amount:1, period:2025-02-06] From ba894d0f63aa949b03d81275f2d0b7349f3e2183 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 18 Jul 2024 22:35:12 +0900 Subject: [PATCH 1072/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=83=9F?= =?UTF-8?q?=E3=82=B9=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.md b/index.md index 057eda11da..3ca223fda7 100644 --- a/index.md +++ b/index.md @@ -97,7 +97,7 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい [sponsor name:Acerola Software様, img:https://raw.githubusercontent.com/cpprefjp/image/master/sponsors/Acerola/as_logo.png, link:https://acerola-software.jp/, size:400, fee:15, amount:12] -[sponsor name:Fixstars様, img:ttps://raw.githubusercontent.com/cpprefjp/image/master/sponsors/Fixstars/fixstars-logo.png, link:https://www.fixstars.com/, size:400, fee:10, amount:12] +[sponsor name:Fixstars様, img:https://raw.githubusercontent.com/cpprefjp/image/master/sponsors/Fixstars/fixstars-logo.png, link:https://www.fixstars.com/, size:400, fee:10, amount:12] [sponsor name:pegasys様, img:https://tmpgenc.pegasys-inc.com/images/pegasys_logo.png, link:https://www.pegasys-inc.com/, size:320, fee:10, amount:12] From 86cd612abfc2425a3b715c954f68cba6d175c97e Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 19 Jul 2024 00:07:53 +0900 Subject: [PATCH 1073/3948] =?UTF-8?q?functional/reference=5Fwrapper:=20LWG?= =?UTF-8?q?3041=E3=81=B8=E8=A8=80=E5=8F=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/functional/reference_wrapper/op_constructor.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/reference/functional/reference_wrapper/op_constructor.md b/reference/functional/reference_wrapper/op_constructor.md index d8d3698167..1ce16282d0 100644 --- a/reference/functional/reference_wrapper/op_constructor.md +++ b/reference/functional/reference_wrapper/op_constructor.md @@ -21,10 +21,10 @@ constexpr reference_wrapper(const reference_wrapper& x) noexcept; // (2) C++20 ## 概要 与えられた参照で、参照オブジェクトを構築する。 -- (1) : `T& r = ` [`forward`](/reference/utility/forward.md)`(u)`のように作成した`r`への参照を保持する`reference_wrapper`オブジェクトを構築する - `u`が右辺値参照、もしくは参照とCV修飾を除去した`U`が`reference_wrapper`である(`is_same_v, reference_wrapper> == true`となる)場合、このコンストラクタはオーバーロード解決に参加しない +- (1) : `T& r =` [`forward`](/reference/utility/forward.md)`(u)`のように作成した`r`への参照を保持する`reference_wrapper`オブジェクトを構築する + `u`が右辺値参照、もしくは参照とCV修飾を除去した`U`が`reference_wrapper`である([`is_same_v`](/reference/type_traits/is_same.md)`<`[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`, reference_wrapper> == true`となる)場合、このコンストラクタはオーバーロード解決に参加しない -- (2) : `x.`[`get()`](/reference/functional/reference_wrapper/get.md)への参照を保持する`reference_wrapper`オブジェクトを構築する +- (2) : `x.`[`get()`](get.md)への参照を保持する`reference_wrapper`オブジェクトを構築する ## 例外 - (1) : 投げない(右辺値参照を受け取らない限り`noexcept`指定される) @@ -77,3 +77,4 @@ int main() ## 参照 - [LWG Issue 2993. `reference_wrapper` conversion from `T&&`](https://wg21.cmeerw.net/lwg/issue2993) +- [LWG Issue 3041. Unnecessary decay in reference_wrapper](https://wg21.cmeerw.net/lwg/issue3041) From 21b92fb310eff55621c1cebf19fd9aa2ef1b6844 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 19 Jul 2024 01:39:47 +0900 Subject: [PATCH 1074/3948] =?UTF-8?q?=E7=94=A8=E8=AA=9E=E7=B5=B1=E4=B8=80?= =?UTF-8?q?=20:=20=E6=8B=AC=E5=BC=A7=20=E2=86=92=20=E3=82=AB=E3=83=83?= =?UTF-8?q?=E3=82=B3=20#1295?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/script/ngword_check.py | 1 + implementation-status.md | 2 +- international-standard.md | 2 +- lang/cpp11.md | 2 +- lang/cpp11/decltype.md | 10 +++++----- lang/cpp17.md | 2 +- lang/cpp17/folding_expressions.md | 4 ++-- lang/cpp17/if_constexpr.md | 4 ++-- lang/cpp17/selection_statements_with_initializer.md | 8 ++++---- lang/cpp20/concepts.md | 4 ++-- lang/cpp20/coroutines.md | 6 +++--- reference/concepts/Invoke.md | 2 +- reference/regex/basic_regex/mark_count.md | 2 +- reference/regex/match_results.md | 2 +- reference/regex/match_results/op_at.md | 2 +- reference/regex/match_results/size.md | 2 +- reference/type_traits.md | 2 +- .../type_traits/reference_constructs_from_temporary.md | 2 +- .../type_traits/reference_converts_from_temporary.md | 2 +- 19 files changed, 31 insertions(+), 30 deletions(-) diff --git a/.github/workflows/script/ngword_check.py b/.github/workflows/script/ngword_check.py index 631d6da97e..44103c0c6b 100644 --- a/.github/workflows/script/ngword_check.py +++ b/.github/workflows/script/ngword_check.py @@ -27,6 +27,7 @@ ("", "子ルーチン", "コルーチン"), ("", "移譲", "委譲"), ("", r'型]\((.*?)\)型', "型](link)"), + ("", "括弧", "カッコ"), ("", "constepx", "constexpr"), ("", "wsting", "wstring"), ("reference/chrono", "dulation", "duration"), diff --git a/implementation-status.md b/implementation-status.md index c2dcdce470..186f123efd 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -49,7 +49,7 @@ | N2761: [属性構文](/lang/cpp11/attributes.md) | `[[attr]]`構文による、クラス、関数、変数の属性指定 | 4.8 | 3.3 | 12.1 | 2015 | | N2439: [メンバ関数の左辺値/右辺値修飾](/lang/cpp11/ref_qualifier_for_this.md) | オブジェクトが左辺値/右辺値の場合のみ呼び出し可能であることの指定 | 4.8.1 | 2.9 | 14.0 | 2015 | | N2756: [非静的メンバ変数の初期化](/lang/cpp11/non_static_data_member_initializers.md) | メンバ変数を、宣言と同時に初期値指定する | 4.7 | 3.0 | 14.0 | 2013 | -| N2672: [初期化子リスト](/lang/cpp11/initializer_lists.md) | 波括弧による初期化をユーザー定義する。`vector v = {1, 2, 3};`など。 | 4.4 | 3.1 | 14.0 | 2013 | +| N2672: [初期化子リスト](/lang/cpp11/initializer_lists.md) | 波カッコによる初期化をユーザー定義する。`vector v = {1, 2, 3};`など。 | 4.4 | 3.1 | 14.0 | 2013 | | N2672: [一様初期化](/lang/cpp11/uniform_initialization.md) | コンストラクタ呼び出しを波カッコで行う。 `T x { a, b, c };` | 4.4 | 3.1 | 13.0(partial)
14.0 | 2013 | | N3050: [`noexcept`](/lang/cpp11/noexcept.md) | 関数の例外指定、例外を投げる可能性のある式かbool値を返す演算子 | 4.6 | 3.0 | 13.0(partial)
14.0 | 2015 | | N2634: [任意の式によるSFINAE](/lang/cpp11/sfinae_expressions.md) | 特定の式が有効かどうかで、その関数をオーバーロード解決に含めるかどうかを決定する | 4.4 | 2.9 | 12.0 | 2015 Update 1 (partial)
2017 Update 7 | diff --git a/international-standard.md b/international-standard.md index 30247de25d..25111dfebd 100644 --- a/international-standard.md +++ b/international-standard.md @@ -21,7 +21,7 @@ C++ の標準規格は、他にも各国の規格化団体によって国際標 | C++03 | ISO/IEC 14882:2003 | N1577 | N1577 ? | `199711L`
(C++98 と同じ) | | C++98 | ISO/IEC 14882:1998 | ? | ? | `199711L` | -1. **^** 括弧内は策定時・標準化前に一時的に用いられた通称 +1. **^** カッコ内は策定時・標準化前に一時的に用いられた通称 2. **^** 最終国際規格案はPDFやHTMLなどの形で一般公開されていないため、それにほぼ同一の内容の規格案を参照する。 3. **^** N4861 は、C++20 DISであるN4860に対するデザインレベルの差とC++17との相互参照がない以外の差はないため、事実上 N4861 が C++20 を参照する時に用いられる。 4. **^** N4788 は政治的事情により撤回された (参照 N4792) diff --git a/lang/cpp11.md b/lang/cpp11.md index 5debfbce1e..aa26f219aa 100644 --- a/lang/cpp11.md +++ b/lang/cpp11.md @@ -17,7 +17,7 @@ C++11とは、2011年8月に改訂され、ISO/IEC 14882:2011で標準規格化 | [変数の型推論のための`auto`](cpp11/auto.md) | 型推論 | | [`decltype`](cpp11/decltype.md) | 式の型を取得 | | [範囲for文](cpp11/range_based_for.md) | 配列やコンテナといった範囲を表すオブジェクトを、簡潔に走査する | -| [初期化子リスト](cpp11/initializer_lists.md) | 波括弧による初期化をユーザー定義する。`vector v = {1, 2, 3};`など。 | +| [初期化子リスト](cpp11/initializer_lists.md) | 波カッコによる初期化をユーザー定義する。`vector v = {1, 2, 3};`など。 | | [一様初期化](cpp11/uniform_initialization.md) | コンストラクタの呼び出しを、波カッコで行う。`T x {a, b, c};` | | [右辺値参照・ムーブセマンティクス](cpp11/rvalue_ref_and_move_semantics.md) | 右辺値によるオーバーロード、およびそれによるリソースの所有権移動 | | [ラムダ式](cpp11/lambda_expressions.md) | 関数オブジェクトをその場に書く | diff --git a/lang/cpp11/decltype.md b/lang/cpp11/decltype.md index eb9bb67d69..f6f8caeb69 100644 --- a/lang/cpp11/decltype.md +++ b/lang/cpp11/decltype.md @@ -17,7 +17,7 @@ int i = 0; decltype(i) j = 0; // j は int 型 decltype(i)* p = &i; // p は int* 型 -decltype((i)) k = i; // k は int& 型(変数名 i の周りの余分な丸括弧に注意) +decltype((i)) k = i; // k は int& 型(変数名 i の周りの余分な丸カッコに注意) template auto add(const T& lhs, const U& rhs) @@ -38,7 +38,7 @@ decltype(s)::U l{}; // l は S::U 型(つまり int 型) `e` を式とすると、`decltype(e)` が意味する型は以下のとおりである。 -- `e` が丸括弧で囲まれていない識別子の場合、あるいは、丸括弧で囲まれていないクラスメンバアクセスの場合、`decltype(e)` は `e` で指定された実体の型である。 +- `e` が丸カッコで囲まれていない識別子の場合、あるいは、丸カッコで囲まれていないクラスメンバアクセスの場合、`decltype(e)` は `e` で指定された実体の型である。 もしそのような実体が無いか、あるいは、`e` がオーバーロードされた複数の関数を指す場合、プログラムは不適格である。 - そうではなくて、もし `e` が xvalue の場合、`e` の型を `T` とすると、`decltype(e)` は `T&&` である。 - そうではなくて、もし `e` が lvalue の場合、`e` の型を `T` とすると、`decltype(e)` は `T&` である。 @@ -46,9 +46,9 @@ decltype(s)::U l{}; // l は S::U 型(つまり int 型) `decltype` のオペランドは「評価されないオペランド」である。 -ラムダ式の関数本体で、外部の自動変数に対して `decltype` を余分な丸括弧付きで使用した場合、クロージャ型のメンバ変数に対する `decltype` とみなされる。 +ラムダ式の関数本体で、外部の自動変数に対して `decltype` を余分な丸カッコ付きで使用した場合、クロージャ型のメンバ変数に対する `decltype` とみなされる。 -`sizeof` とは異なり、`decltype` のオペランドには丸括弧が必須である。(`sizeof i` はOKだが、`decltype i` はNG) +`sizeof` とは異なり、`decltype` のオペランドには丸カッコが必須である。(`sizeof i` はOKだが、`decltype i` はNG) ## 例 @@ -85,7 +85,7 @@ int main() { int i = 10; decltype(i) j = i; // j は int 型 - decltype((i)) k = i; // k は int& 型(i は lvalue で丸括弧が付いているので) + decltype((i)) k = i; // k は int& 型(i は lvalue で丸カッコが付いているので) i = 42; std::cout << j << ", " << k << '\n'; diff --git a/lang/cpp17.md b/lang/cpp17.md index ddb23a0844..5f36bfe5a9 100644 --- a/lang/cpp17.md +++ b/lang/cpp17.md @@ -30,7 +30,7 @@ C++17以降、言語の策定にship train modelというリリース体制が | [16進浮動小数点数リテラル](cpp17/hexadecimal_floating_literals.md) | 十六進数表記で浮動小数点数リテラルを記述できるようにする | | [インライン変数](cpp17/inline_variables.md) | `inline`指定をすることで翻訳単位を跨いでひとつのオブジェクトになる変数を定義する | | [構造化束縛](cpp17/structured_bindings.md) | 組・タプル・配列を展開して変数定義する | -| [単一要素の波カッコ初期化を非配列とする](cpp17/new_rules_for_auto_deduction_from_braced-init-list.md) | 波括弧初期化子が単一要素の場合は `T` に推論,複数要素の場合は不適格 | +| [単一要素の波カッコ初期化を非配列とする](cpp17/new_rules_for_auto_deduction_from_braced-init-list.md) | 波カッコ初期化子が単一要素の場合は `T` に推論,複数要素の場合は不適格 | | [`[[maybe_unused]]`属性](cpp17/maybe_unused.md) | 使用しない可能性のある変数に対する警告を抑制する | | [`[[nodiscard]]`属性](cpp17/nodiscard.md) | 戻り値を捨ててはならないことを指定する | | [値のコピー省略を保証](cpp17/guaranteed_copy_elision.md) | 右辺値を変数の初期化のために使用する場合、コピーもムーブも省略することを保証 | diff --git a/lang/cpp17/folding_expressions.md b/lang/cpp17/folding_expressions.md index 72d559fd6e..080253f9b1 100644 --- a/lang/cpp17/folding_expressions.md +++ b/lang/cpp17/folding_expressions.md @@ -26,7 +26,7 @@ * pack[italic] * init[italic] -* 畳み込み式は括弧 `()` で囲まれなければならない +* 畳み込み式はカッコ `()` で囲まれなければならない * `op` は後述する二項演算子 二項畳み込み (3)(4) の場合 `op` は同一でなければならない * `pack` は未展開のパラメータパック (規格ではキャスト式 cast-expression と呼ばれる) @@ -251,4 +251,4 @@ auto res = (std::string(args) + ...); * [N4295 Folding expressions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4295.html) * [N4358 Unary Folds and Empty Parameter Packs](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4358.pdf) * [P0036 Unary Folds and Empty Parameter Packs (revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0036r0.pdf) -* [Nifty Fold Expression Tricks - foonathan::blog()](https://foonathan.net/2020/05/fold-tricks/) \ No newline at end of file +* [Nifty Fold Expression Tricks - foonathan::blog()](https://foonathan.net/2020/05/fold-tricks/) diff --git a/lang/cpp17/if_constexpr.md b/lang/cpp17/if_constexpr.md index b417ae33fa..86e7ac2536 100644 --- a/lang/cpp17/if_constexpr.md +++ b/lang/cpp17/if_constexpr.md @@ -373,9 +373,9 @@ constexpr_else statement ``` -静的な条件分岐の各分岐を囲む波括弧 `{ ... }` に関しては、 +静的な条件分岐の各分岐を囲む波カッコ `{ ... }` に関しては、 廃棄された分岐の構文解析を行わない N3329 においては必須とされた。 -つまり、構文解析は行わずに単に括弧だけの対応を取ることにより分岐の終わりを調べる。 +つまり、構文解析は行わずに単にカッコだけの対応を取ることにより分岐の終わりを調べる。 しかし、N3613 における批判により、結局はテンプレートの2段階名前探索と同様に、 廃棄された分岐でも構文解析は実施され、非依存名に関しては1段階目で検証されることとなった。 これにより通常の`if`文と同様に `{ ... }` は任意となった。 diff --git a/lang/cpp17/selection_statements_with_initializer.md b/lang/cpp17/selection_statements_with_initializer.md index 9015a14814..9b3b3028c3 100644 --- a/lang/cpp17/selection_statements_with_initializer.md +++ b/lang/cpp17/selection_statements_with_initializer.md @@ -185,15 +185,15 @@ status_code foo() { 従来の記述を面倒に思い、時にプログラマは外側のスコープを省略して書いてしまう: ```cpp -//{ この括弧を省略してしまった +//{ このカッコを省略してしまった auto it = m.find(10); if (it != m.end()) { return it->size(); } -//} この括弧を省略してしまった +//} このカッコを省略してしまった // "it" は不要なのにここでも使えてしまう、すなわちリークしてしまう ``` -大抵は括弧を省略しても同じ効果を得られるし、変数がリークしても問題にならないが、オブジェクトの生存期間が大事な場合もある。 +大抵はカッコを省略しても同じ効果を得られるし、変数がリークしても問題にならないが、オブジェクトの生存期間が大事な場合もある。 例えばミューテックスのロックがリークすると予測しづらいバグが発生しやすい。 新しい記法を使えば、初期化に使用した変数のスコープは`if`文または `switch`文の内部に限定されるため、 @@ -217,4 +217,4 @@ if (it != m.end()) { return it->size(); } ## 参照 -- [P0305R1 Selection statements with initializer.](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0305r1.html) \ No newline at end of file +- [P0305R1 Selection statements with initializer.](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0305r1.html) diff --git a/lang/cpp20/concepts.md b/lang/cpp20/concepts.md index fbf72869a6..3f80a1a9ec 100644 --- a/lang/cpp20/concepts.md +++ b/lang/cpp20/concepts.md @@ -424,7 +424,7 @@ int main() { - ここでは、関数形式でローカルパラメータをひとつ (`T i`) とるrequires式によってコンセプト`R`を定義している - ローカルパラメータである`T i`の変数定義では、`T`型に対して「コピー構築可能であること」といった要求は行わず、そのような評価はコンパイル時にも行われない。これは[`std::declval()`](/reference/utility/declval.md)関数と同様に、「`T`型のなんらかの値」であることのみを表し、特定の値は持たず、構築もされない -- パラメータリスト後の波括弧 { } で囲まれた本体中には、要件のシーケンスをセミコロン区切りで記述する。各要件は、ローカルパラメータ、テンプレートパラメータ、およびその文脈から見えるほかの宣言を参照できる +- パラメータリスト後の波カッコ { } で囲まれた本体中には、要件のシーケンスをセミコロン区切りで記述する。各要件は、ローカルパラメータ、テンプレートパラメータ、およびその文脈から見えるほかの宣言を参照できる - ローカルパラメータは、リンケージ、記憶域、生存期間をもたない @@ -984,4 +984,4 @@ C++14の策定において、コンセプトの複雑さを回避して必要最 - [P1452R2 On the non-uniform semantics of return-type-requirements](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1452r2.html) - [P1616R1 Using unconstrained template template parameters with constrained templates](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1616r1.html) - [C++ Concepts - complete overview (Jakub Cislo)](http://programowaniezpasja.pl/wp-content/uploads/2019/05/Cpp_Concepts_-_complete_overview_-_Jakub_Cislo.pdf) -- [Multiple destructors with C++ concepts - Sandor Dargo's Blog](https://www.sandordargo.com/blog/2021/06/16/multiple-destructors-with-cpp-concepts) \ No newline at end of file +- [Multiple destructors with C++ concepts - Sandor Dargo's Blog](https://www.sandordargo.com/blog/2021/06/16/multiple-destructors-with-cpp-concepts) diff --git a/lang/cpp20/coroutines.md b/lang/cpp20/coroutines.md index cd7a359c28..763a5db47b 100644 --- a/lang/cpp20/coroutines.md +++ b/lang/cpp20/coroutines.md @@ -53,12 +53,12 @@ C++コルーチンの特徴は次の通り: C++コルーチン動作理解の助けとなるよう、ここでは細部を省略した説明を行う。 コルーチン実行の基本動作は、それぞれ下記ように説明される: -- 呼出し: 通常の関数と同様に、括弧(`()`)を用いた関数呼び出し構文を用いる。コルーチンに対応するユーザ定義Promiseオブジェクトが自動的に生成されるため、そこからコルーチンハンドルを取得する。 +- 呼出し: 通常の関数と同様に、カッコ(`()`)を用いた関数呼び出し構文を用いる。コルーチンに対応するユーザ定義Promiseオブジェクトが自動的に生成されるため、そこからコルーチンハンドルを取得する。 - 中断: コルーチン本体にて`co_yield`式または`co_await`式を記述する。中断されたコルーチンから呼出元へは、コルーチンハンドルを内包するコルーチン戻り値型オブジェクトを返す。 - 再開: コルーチン中断により返された戻り値型オブジェクトを介して、コルーチンハンドルの再開関数[`resume`](/reference/coroutine/coroutine_handle/resume.md)を呼び出す。 - 復帰: コルーチン本体にて`co_return`文を記述、またはコルーチン本体終端まで到達する。全てのローカル変数とPromiseオブジェクトは破棄される。 -この4種類の基本動作に対して、次のカスタマイズポイントが提供される。括弧内はコルーチンライブラリが実装すべきカスタマイズポイント名: +この4種類の基本動作に対して、次のカスタマイズポイントが提供される。カッコ内はコルーチンライブラリが実装すべきカスタマイズポイント名: - コルーチン呼出し直後の動作: 初期サスペンドポイント(`initial_suspend`)にて、コルーチン本体の開始前に中断して戻り値型オブジェクトを返すか、そのままコルーチン本体を実行継続するかを制御する。 - コルーチン復帰直前の動作: 最終サスペンドポイント(`final_suspend`)にて、コルーチンを最後に中断して戻り値型オブジェクトを返すか、そのままコルーチンに関するリソースを破棄するかを制御する。前者を選択した場合、リソースリークを防ぐためコルーチンハンドルの破棄関数[`destroy`](/reference/coroutine/coroutine_handle/destroy.md)呼出しが必要となる。 @@ -634,4 +634,4 @@ C++20コルーチンに関するキーワードは、いずれも接頭辞`co_` - [C++ Coroutines: Understanding the promise type](https://lewissbaker.github.io/2018/09/05/understanding-the-promise-type) - [C++ Coroutines: Understanding Symmetric Transfer](https://lewissbaker.github.io/2020/05/11/understanding_symmetric_transfer) - [C++ co_awaiting coroutines](https://web.archive.org/web/20210421165652/https://blog.panicsoftware.com/co_awaiting-coroutines/) -- [20分くらいでわかった気分になれるC++20コルーチン](https://www.slideshare.net/yohhoy/20c20) \ No newline at end of file +- [20分くらいでわかった気分になれるC++20コルーチン](https://www.slideshare.net/yohhoy/20c20) diff --git a/reference/concepts/Invoke.md b/reference/concepts/Invoke.md index 904dd091c5..02b077b0a6 100644 --- a/reference/concepts/Invoke.md +++ b/reference/concepts/Invoke.md @@ -10,7 +10,7 @@ C++における関数呼び出しという性質を抽象化しまとめた、 - C++23からは、仮想操作 *INVOKE*`` を実体化した[`std::invoke_r`](/reference/functional/invoke_r.md)関数テンプレートが提供される。 ## 用語定義 -- *call-signature* とは、戻り値型に続けて丸括弧の中に0個以上の引数型を並べたものである。 *cf.* `int ( std::string, int )` +- *call-signature* とは、戻り値型に続けて丸カッコの中に0個以上の引数型を並べたものである。 *cf.* `int ( std::string, int )` - *callable-type* とは、関数呼び出し演算子を適用できる型 ( 関数、関数への参照、関数へのポインタ、`operator ()` をオーバーロードした型もしくはそれを(直接または間接的に) `public` 継承した型 ) もしくはメンバへのポインタ型を指す。 - *callable-object* は、 *callable-type* 型のオブジェクトである。 - *call-wrapper-type* は、 *callable-object* を保持し、自身に対する関数呼び出し操作が行われたとき、保持しているオブジェクトに委譲する。 diff --git a/reference/regex/basic_regex/mark_count.md b/reference/regex/basic_regex/mark_count.md index e4e7de5052..00c2c3be76 100644 --- a/reference/regex/basic_regex/mark_count.md +++ b/reference/regex/basic_regex/mark_count.md @@ -18,7 +18,7 @@ unsigned int mark_count() const; ## 備考 -キャプチャグループとは、正規表現内の丸括弧で囲まれた部分の事である。 +キャプチャグループとは、正規表現内の丸カッコで囲まれた部分の事である。 キャプチャグループは、その正規表現内の後方や、[`regex_replace`](../regex_replace.md) による置換時などに使用することができる。 また、[`match_results`](../match_results.md) オブジェクトを使用することによって、[`regex_match`](../regex_match.md) や [`regex_search`](../regex_search.md) 等の結果として受け取ることもできる。 その場合、キャプチャグループに対応する部分は [`match_results`](../match_results.md) オブジェクトのメンバ関数で [`sub_match`](../sub_match.md) オブジェクトとして([`operator[]`](../match_results/op_at.md))、あるいは文字列として([`str`](../match_results/str.md))アクセス可能である。 diff --git a/reference/regex/match_results.md b/reference/regex/match_results.md index 468205cf51..9107ef03d9 100644 --- a/reference/regex/match_results.md +++ b/reference/regex/match_results.md @@ -47,7 +47,7 @@ namespace std { マッチ結果を格納した `match_results` オブジェクトは、マッチが成功した場合には 1 つ以上の要素を格納しているため、[`empty`](match_results/empty.md)`() == false` となる。 マッチに成功し [`empty`](match_results/empty.md)`() == false` となった `match_results` オブジェクトに格納されている各要素(サブマッチ:[`sub_match`](sub_match.md))には、標準シーケンスコンテナの [`vector`](../vector.md) 等と同様に [`operator[]`](match_results/op_at.md) で直接アクセスすることができるだけでなく、 [`str`](match_results/str.md)、[`position`](match_results/position.md)、[`length`](match_results/length.md) といったメンバ関数で各要素の内容にアクセスすることもできる。 -最初の要素には、マッチした文字列全体を表すサブマッチが格納され、以降に各キャプチャグループ(正規表現内の括弧で囲まれた部分に対応する)が続く。 +最初の要素には、マッチした文字列全体を表すサブマッチが格納され、以降に各キャプチャグループ(正規表現内のカッコで囲まれた部分に対応する)が続く。 また、マッチした文字列だけでなく、マッチした文字列の前([`prefix`](match_results/prefix.md))、および、後([`suffix`](match_results/suffix.md))を指すサブマッチも保持している。 さらに、マッチした結果を用いた書式出力機能も有する([`format`](match_results/format.md))。 diff --git a/reference/regex/match_results/op_at.md b/reference/regex/match_results/op_at.md index a2b593f2ad..38bc53fac2 100644 --- a/reference/regex/match_results/op_at.md +++ b/reference/regex/match_results/op_at.md @@ -18,7 +18,7 @@ const_reference operator[](size_type n) const; ## 戻り値 -`n` 番目のキャプチャグループ(正規表現内の括弧で囲まれた部分)に対応する [`sub_match`](../sub_match.md) オブジェクトへの参照。 +`n` 番目のキャプチャグループ(正規表現内のカッコで囲まれた部分)に対応する [`sub_match`](../sub_match.md) オブジェクトへの参照。 `n == 0` の場合、マッチした文字列全体に対応する [`sub_match`](../sub_match.md) オブジェクトへの参照を返す。 `n >=` [`size`](size.md)`()` の場合、マッチしていないことを表す [`sub_match`](../sub_match.md) オブジェクト(備考参照)への参照を返す。 diff --git a/reference/regex/match_results/size.md b/reference/regex/match_results/size.md index 98b652e6de..ebd0c81fb7 100644 --- a/reference/regex/match_results/size.md +++ b/reference/regex/match_results/size.md @@ -14,7 +14,7 @@ size_type size() const; ## 戻り値 -`*this` が成功したマッチの結果を保持している場合、マッチした正規表現のキャプチャグループ(括弧で囲まれた部分)の数に 1 を加えた数。 +`*this` が成功したマッチの結果を保持している場合、マッチした正規表現のキャプチャグループ(カッコで囲まれた部分)の数に 1 を加えた数。 そうでなければ 0。 diff --git a/reference/type_traits.md b/reference/type_traits.md index ab74ad28b7..62ae4af352 100644 --- a/reference/type_traits.md +++ b/reference/type_traits.md @@ -123,7 +123,7 @@ | [`is_nothrow_convertible`](type_traits/is_nothrow_convertible.md) | ある型から別の型へ、例外を投げずに変換可能か調べる (class template) | C++20 | | [`is_layout_compatible`](type_traits/is_layout_compatible.md) | 2つの型にレイアウト互換があるかを判定する (class template) | C++20 | | [`is_pointer_interconvertible_base_of`](type_traits/is_pointer_interconvertible_base_of.md) | 基底クラスと派生クラスの間でポインタ相互交換可能かを判定する (class template) | C++20 | -| [`reference_constructs_from_temporary`](type_traits/reference_constructs_from_temporary.md) | 参照が一時オブジェクトを直接初期化(丸括弧による初期化)で束縛した時、一時オブジェクトの寿命が延長されているかを判定する (class template) | C++23 | +| [`reference_constructs_from_temporary`](type_traits/reference_constructs_from_temporary.md) | 参照が一時オブジェクトを直接初期化(丸カッコによる初期化)で束縛した時、一時オブジェクトの寿命が延長されているかを判定する (class template) | C++23 | | [`reference_converts_from_temporary`](type_traits/reference_converts_from_temporary.md) | 参照が一時オブジェクトをコピー初期化(代入形式による初期化)で束縛した時、一時オブジェクトの寿命が延長されているかを判定する (class template) | C++23 | diff --git a/reference/type_traits/reference_constructs_from_temporary.md b/reference/type_traits/reference_constructs_from_temporary.md index 1e50abada8..0d3db3d964 100644 --- a/reference/type_traits/reference_constructs_from_temporary.md +++ b/reference/type_traits/reference_constructs_from_temporary.md @@ -16,7 +16,7 @@ namespace std { ``` ## 概要 -参照`T`が一時オブジェクト`U`を直接初期化(丸括弧による初期化)で束縛した時、その一時オブジェクトの寿命を延長するかを判定する。 +参照`T`が一時オブジェクト`U`を直接初期化(丸カッコによる初期化)で束縛した時、その一時オブジェクトの寿命を延長するかを判定する。 [`tuple`](/reference/tuple/tuple.md)や[`pair`](/reference/utility/pair.md)のコンストラクタなど、`explicit`なコンストラクタ・変換関数におけるダングリング参照の生成を回避するために使用される。 diff --git a/reference/type_traits/reference_converts_from_temporary.md b/reference/type_traits/reference_converts_from_temporary.md index 35cde01c5c..a436ce404e 100644 --- a/reference/type_traits/reference_converts_from_temporary.md +++ b/reference/type_traits/reference_converts_from_temporary.md @@ -16,7 +16,7 @@ namespace std { [*INVOKE*](/reference/concepts/Invoke.md)``など、暗黙的な型変換のみが考慮される文脈におけるダングリング参照の生成を回避するために使用される。 -なお、直接初期化(丸括弧による初期化)における文脈では[`reference_constructs_from_temporary`](reference_constructs_from_temporary.md)が使用される。 +なお、直接初期化(丸カッコによる初期化)における文脈では[`reference_constructs_from_temporary`](reference_constructs_from_temporary.md)が使用される。 ## 要件 From 5855664e5515ecbed9543458ba91bac38bbf8525 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Fri, 19 Jul 2024 09:34:28 +0900 Subject: [PATCH 1075/3948] =?UTF-8?q?linalg=20:=20dot=E3=81=AB=E4=BE=8B?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/dot.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/reference/linalg/dot.md b/reference/linalg/dot.md index 95bf0a5c3d..32add9a655 100644 --- a/reference/linalg/dot.md +++ b/reference/linalg/dot.md @@ -81,9 +81,45 @@ $$ ## 例 +**[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** + +```cpp example +#include +#include +#include +#include +#include +#include +#include + +int main() +{ + constexpr size_t N = 3; + + std::vector a_vec({1, 2, 3}); + std::mdspan a(a_vec.data(), N); + + std::vector b_vec({4, 5, 6}); + std::mdspan b(b_vec.data(), N); + + std::cout << std::linalg::dot(a, b, -18) << '\n' // (1) + << std::linalg::dot(std::execution::par, a, b, -18) << '\n' // (2) + << std::linalg::dot(a, b) << '\n' // (3) + << std::linalg::dot(std::execution::par, a, b) << '\n'; // (4) + + return 0; +} +``` +* std::linalg::dot[color ff0000] ### 出力 +``` +14 +14 +32 +32 +``` ## バージョン From 9f61fd29657aba6978b6641db72bfa75ed9bbc1c Mon Sep 17 00:00:00 2001 From: komori-n Date: Sat, 20 Jul 2024 08:50:28 +0900 Subject: [PATCH 1076/3948] =?UTF-8?q?shared=5Fptr::operator*=20=E3=81=AE?= =?UTF-8?q?=E5=AE=9A=E7=BE=A9=E3=81=95=E3=82=8C=E3=82=8B=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/memory/shared_ptr/op_deref.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/memory/shared_ptr/op_deref.md b/reference/memory/shared_ptr/op_deref.md index 43681bb391..5ab589c854 100644 --- a/reference/memory/shared_ptr/op_deref.md +++ b/reference/memory/shared_ptr/op_deref.md @@ -28,7 +28,7 @@ get() != nullptr ## 備考 - C++11 : 型`T`が (CV修飾された) `void`の場合、この関数が定義されるかどうかは未規定。定義される場合、その戻り値は未規定 -- C++17 : 型`T`が非配列もしくは (CV修飾された) `void`の場合、この関数が定義されるかどうかは未規定。定義される場合、その戻り値は未規定 +- C++17 : 型`T`が配列もしくは (CV修飾された) `void`の場合、この関数が定義されるかどうかは未規定。定義される場合、その戻り値は未規定 ## 例 From f90532b874570b75e1438a8cd4ff0184e3655171 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Sat, 20 Jul 2024 11:43:39 +0900 Subject: [PATCH 1077/3948] =?UTF-8?q?linalg=20:=20copy=E3=81=AB=E4=BE=8B?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/copy.md | 49 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/reference/linalg/copy.md b/reference/linalg/copy.md index 668b6ff2c0..2948da2142 100644 --- a/reference/linalg/copy.md +++ b/reference/linalg/copy.md @@ -57,9 +57,58 @@ namespace std::linalg { ## 例 +**[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** + +```cpp example +#include +#include +#include +#include +#include +#include + + +template +bool IsEqual(Vector a, Vector b) { + if (a.extent(0) != b.extent(0)) { + return false; + } + for (int i = 0; i < a.extent(0); ++i) { + if (a[i] != b[i]) { + return false; + } + } + return true; +} + + +int main() +{ + constexpr size_t N = 3; + + std::vector a_vec({1, 2, 3}); + std::mdspan a(a_vec.data(), N); + + std::vector b_vec(N); + std::mdspan b(b_vec.data(), N); + + // (1) + std::linalg::copy(a, b); + assert(IsEqual(a, b)); + + // (2) + std::linalg::copy(std::execution::par, a, b); + assert(IsEqual(a, b)); + + return 0; +} +``` +* std::linalg::copy[color ff0000] ### 出力 +``` +``` ## バージョン From d035fff53945c2ee8fb4fd006156e74e510f20eb Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Sat, 20 Jul 2024 11:45:00 +0900 Subject: [PATCH 1078/3948] =?UTF-8?q?linalg=20:=20=E4=B8=8D=E8=A6=81?= =?UTF-8?q?=E3=81=AA=E3=83=98=E3=83=83=E3=83=80=E3=83=BC=E3=82=92=E5=89=8A?= =?UTF-8?q?=E9=99=A4=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/dot.md | 1 - 1 file changed, 1 deletion(-) diff --git a/reference/linalg/dot.md b/reference/linalg/dot.md index 32add9a655..7c7ee7e129 100644 --- a/reference/linalg/dot.md +++ b/reference/linalg/dot.md @@ -89,7 +89,6 @@ $$ #include #include #include -#include #include int main() From f0a78be45cd326c086c42f313c2669bbf065bf9a Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Sun, 21 Jul 2024 16:06:19 +0900 Subject: [PATCH 1079/3948] =?UTF-8?q?linalg=20:=20add=E3=81=AB=E4=BE=8B?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/add.md | 47 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/reference/linalg/add.md b/reference/linalg/add.md index d110d039be..d46d89d796 100644 --- a/reference/linalg/add.md +++ b/reference/linalg/add.md @@ -68,9 +68,56 @@ $x + y$ を`z`に代入する。 ## 例 +**[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** + +```cpp example +#include +#include +#include +#include +#include +#include + +template +void print(Vector v) { + for (int i = 0; i < v.extent(0) - 1; ++i) { + std::cout << v[i] << ', '; + } + std::cout << v[v.extent(0) - 1] << std::endl; +} + +int main() +{ + constexpr size_t N = 3; + + std::vector a_vec({1, 2, 3}); + std::mdspan a(a_vec.data(), N); + + std::vector b_vec({4, 5, 6}); + std::mdspan b(b_vec.data(), N); + + std::vector c_vec(N); + std::mdspan c(c_vec.data(), N); + + // (1) + std::linalg::add(a, b, c); + print(c); + + // (2) + std::linalg::add(std::execution::par, a, b, c); + print(c); + + return 0; +} +``` +* std::linalg::add[color ff0000] ### 出力 +``` +5, 7, 9 +5, 7, 9 +``` ## バージョン From 8cc238ce20e5136912f1e70f7e426d6cc8b669de Mon Sep 17 00:00:00 2001 From: I <1091761+wx257osn2@users.noreply.github.com> Date: Mon, 22 Jul 2024 15:31:30 +0900 Subject: [PATCH 1080/3948] fix typo (print -> println) --- reference/print/println.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/print/println.md b/reference/print/println.md index 542fd0bf0f..8fd3580467 100644 --- a/reference/print/println.md +++ b/reference/print/println.md @@ -31,7 +31,7 @@ namespace std { この関数は、末尾に改行コードが付くことに注意。改行コードが不要な場合は、[`std::print()`](print.md)関数を使用すること。 -[`std::ostream`](/reference/ostream/basic_ostream.md)から派生したクラスオブジェクトに対して出力したい場合は、[``](/reference/ostream.md)ヘッダの[`std::print()`](/reference/ostream/println.md)関数を使用すること。 +[`std::ostream`](/reference/ostream/basic_ostream.md)から派生したクラスオブジェクトに対して出力したい場合は、[``](/reference/ostream.md)ヘッダの[`std::println()`](/reference/ostream/println.md)関数を使用すること。 ## 効果 From ab8a6b1eb58e0464d8036fb51396c2a124642157 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Mon, 22 Jul 2024 21:24:13 +0900 Subject: [PATCH 1081/3948] =?UTF-8?q?linalg=20:=20scale=E3=81=AB=E4=BE=8B?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=97=E3=80=81add=E3=81=AE?= =?UTF-8?q?=E4=BE=8B=E3=82=92=E4=BF=AE=E6=AD=A3=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/add.md | 2 +- reference/linalg/scale.md | 45 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/reference/linalg/add.md b/reference/linalg/add.md index d46d89d796..fa172a3850 100644 --- a/reference/linalg/add.md +++ b/reference/linalg/add.md @@ -81,7 +81,7 @@ $x + y$ を`z`に代入する。 template void print(Vector v) { for (int i = 0; i < v.extent(0) - 1; ++i) { - std::cout << v[i] << ', '; + std::cout << v[i] << ", "; } std::cout << v[v.extent(0) - 1] << std::endl; } diff --git a/reference/linalg/scale.md b/reference/linalg/scale.md index 7ce8d8ca2b..345b613d24 100644 --- a/reference/linalg/scale.md +++ b/reference/linalg/scale.md @@ -48,9 +48,54 @@ $$ ## 例 +**[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** + +```cpp example +#include +#include +#include +#include +#include +#include + + +template +void print(Vector v) { + for (int i = 0; i < v.extent(0) - 1; ++i) { + std::cout << v[i] << ", "; + } + std::cout << v[v.extent(0) - 1] << std::endl; +} + + +int main() +{ + constexpr size_t N = 3; + + std::vector a_vec({1, 2, 3}); + std::mdspan a(a_vec.data(), N); + + double alpha = 2.0; + + // (1) + std::linalg::scale(alpha, a); + print(a); + + // (2) + std::linalg::scale(std::execution::par, alpha, a); + print(a); + + return 0; +} +``` +* std::linalg::scale[color ff0000] ### 出力 +``` +2, 4, 6 +4, 8, 12 +``` ## バージョン From cbd3dfc2186ae70039acb93ef78f6df5e90581f3 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Tue, 23 Jul 2024 10:02:56 +0900 Subject: [PATCH 1082/3948] =?UTF-8?q?linalg=20:=20swap=5Felelemts=E3=81=AB?= =?UTF-8?q?=E4=BE=8B=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/swap_elements.md | 62 +++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/reference/linalg/swap_elements.md b/reference/linalg/swap_elements.md index a8be2a4869..553ee70409 100644 --- a/reference/linalg/swap_elements.md +++ b/reference/linalg/swap_elements.md @@ -57,9 +57,71 @@ namespace std::linalg { ## 例 +**[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** + +```cpp example +#include +#include +#include +#include +#include +#include + + +template +void print(Vector v) { + for (int i = 0; i < v.extent(0) - 1; ++i) { + std::cout << v[i] << ", "; + } + std::cout << v[v.extent(0) - 1] << std::endl; +} + + +int main() +{ + constexpr size_t N = 3; + + std::vector a_vec({1, 2, 3}); + std::mdspan a(a_vec.data(), N); + + std::vector b_vec({4, 5, 6}); + std::mdspan b(b_vec.data(), N); + + // (1) + std::linalg::swap_elements(a, b); + std::cout << "(1)\n"; + std::cout << "a\n"; + print(a); + std::cout << "b\n"; + print(b); + + // (2) + std::linalg::swap_elements(std::execution::par, a, b); + std::cout << "(2)\n"; + std::cout << "a\n"; + print(a); + std::cout << "b\n"; + print(b); + + return 0; +} +``` +* std::linalg::copy[color ff0000] ### 出力 +``` +(1) +a +4, 5, 6 +b +1, 2, 3 +(2) +a +1, 2, 3 +b +4, 5, 6 +``` ## バージョン From ed8ddfec6ab72490750bcc2988a1f84649cfb9a3 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Tue, 23 Jul 2024 10:03:43 +0900 Subject: [PATCH 1083/3948] =?UTF-8?q?linalg=20:=20=E8=B5=A4=E6=96=87?= =?UTF-8?q?=E5=AD=97=E3=82=92=E4=BF=AE=E6=AD=A3=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/swap_elements.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/linalg/swap_elements.md b/reference/linalg/swap_elements.md index 553ee70409..932f484790 100644 --- a/reference/linalg/swap_elements.md +++ b/reference/linalg/swap_elements.md @@ -106,7 +106,7 @@ int main() return 0; } ``` -* std::linalg::copy[color ff0000] +* std::linalg::swap_elements[color ff0000] ### 出力 From da93e928b05e188ead8309f5aecb6d2835ffaa1b Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 23 Jul 2024 19:54:09 +0900 Subject: [PATCH 1084/3948] =?UTF-8?q?mdspan:=20layout=5F{left,right}=5Fpad?= =?UTF-8?q?ded=E6=A6=82=E8=A6=81=20P2645R5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/mdspan.md | 3 + reference/mdspan/LayoutMapping.md | 2 + reference/mdspan/LayoutMappingPolicy.md | 2 + reference/mdspan/layout_left_padded.md | 86 +++++++++++++++++++++++++ reference/mdspan/layout_right_padded.md | 84 ++++++++++++++++++++++++ 5 files changed, 177 insertions(+) create mode 100644 reference/mdspan/layout_left_padded.md create mode 100644 reference/mdspan/layout_right_padded.md diff --git a/reference/mdspan.md b/reference/mdspan.md index 852fdef26a..2386624e38 100644 --- a/reference/mdspan.md +++ b/reference/mdspan.md @@ -21,6 +21,8 @@ | [`layout_left`](mdspan/layout_left.md) | 列優先(Fortran/Matlabスタイル)レイアウトマッピングポリシー (class) | C++23 | | [`layout_right`](mdspan/layout_right.md) | 行優先(C/C++スタイル)レイアウトマッピングポリシー (class) | C++23 | | [`layout_stride`](mdspan/layout_stride.md) | ストライド幅指定レイアウトマッピングポリシー (class) | C++23 | +| [`layout_left_padded`](mdspan/layout_left_padded.md) | パディングあり列優先レイアウトマッピングポリシー (class templte) | C++26 | +| [`layout_right_padded`](mdspan/layout_right_padded.md) | パディングあり行優先レイアウトマッピングポリシー (class templte) | C++26 | ## 要素アクセサ @@ -62,3 +64,4 @@ ## 参照 - [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) - [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) +- [P2642R5 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2642r5.html) diff --git a/reference/mdspan/LayoutMapping.md b/reference/mdspan/LayoutMapping.md index 4fde61d7ed..fbc2c425f5 100644 --- a/reference/mdspan/LayoutMapping.md +++ b/reference/mdspan/LayoutMapping.md @@ -93,6 +93,8 @@ LayoutMappingを満たす型`M`は - [`layout_left::mapping`](layout_left/mapping.md) - [`layout_right::mapping`](layout_right/mapping.md) - [`layout_stride::mapping`](layout_stride/mapping.md) +- [`layout_left_padded::mapping`](layout_left_padded/mapping.md.nolink) +- [`layout_right_padded::mapping`](layout_right_padded/mapping.md.nolink) - [`layout_blas_packed::mapping`](/reference/linalg/layout_blas_packed/mapping.md) diff --git a/reference/mdspan/LayoutMappingPolicy.md b/reference/mdspan/LayoutMappingPolicy.md index 08ec23b8bd..52161f2762 100644 --- a/reference/mdspan/LayoutMappingPolicy.md +++ b/reference/mdspan/LayoutMappingPolicy.md @@ -40,6 +40,8 @@ LayoutMappingPolicyを満たす型`MP`は - [`layout_left`](layout_left.md) - [`layout_right`](layout_right.md) - [`layout_stride`](layout_stride.md) +- [`layout_left_padded`](layout_left_padded.md) +- [`layout_right_padded`](layout_right_padded.md) - [`linalg::layout_blas_packed`](/reference/linalg/layout_blas_packed.md) diff --git a/reference/mdspan/layout_left_padded.md b/reference/mdspan/layout_left_padded.md new file mode 100644 index 0000000000..32d916a80d --- /dev/null +++ b/reference/mdspan/layout_left_padded.md @@ -0,0 +1,86 @@ +# layout_left_padded +* mdspan[meta header] +* class template[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std { + template + struct layout_left_padded { + template + class mapping; + }; +} +``` +* dynamic_extent[link /reference/span/dynamic_extent.md] +* Extents[link extents.md] +* mapping[link layout_left_padded/mapping.md.nolink] + +## 概要 +`layout_left_padded`は、多次元配列ビュー[`mdspan`](mdspan.md)に対して、パディングあり列優先(column major)[レイアウトマッピング](LayoutMapping.md)を表現するポリシークラスである。 + +全要素が隣接配置される[`layout_left`](layout_left.md)とは異なり、`layout_left_padded`では最左次元の隣次元(第1次元)ストライド幅`stride(1)`が最左次元の要素数`extent(0)`よりも大きい、つまり第1次元においてパディングが挿入される可能性がある。 + +`layout_left_padded`の特殊化は、[レイアウトマッピングポリシー要件](LayoutMappingPolicy.md)を満たす[トリビアル型](/reference/type_traits/is_trivial.md)である。 + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`mapping`](layout_left_padded/mapping.md.nolink) | レイアウトマッピング | C++26 | + + +## 例 +```cpp example +#include +#include + +int main() +{ + double arr[] = {1, 2, 0, 0, 3, 4, 0, 0, 5, 6, 0, 0}; + // 1 3 5 + // 2 4 6 + // - - - + // - - - + + // 要素数2x3の2次元配列/列優先レイアウト/アライメント4 + using Ext2x3 = std::extents + std::mdspan> mat{arr}; + + for (size_t i = 0; i < mat.extent(0); ++i) { + for (size_t j = 0; j < mat.extent(1); ++j) { + std::print("{}{}", (j ? " " : ""), mat[i, j]); + } + std::println(); + } +} +``` +* std::layout_left_padded[color ff0000] +* extent[link mdspan/extent.md] + +### 出力 +``` +1 3 5 +2 4 6 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`layout_left`](layout_left.md) + + +## 参照 +- [P2642R5 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2642r5.html) diff --git a/reference/mdspan/layout_right_padded.md b/reference/mdspan/layout_right_padded.md new file mode 100644 index 0000000000..9b5af7ef0c --- /dev/null +++ b/reference/mdspan/layout_right_padded.md @@ -0,0 +1,84 @@ +# layout_right_padded +* mdspan[meta header] +* class template[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std { + template + struct layout_right_padded { + template + class mapping; + }; +} +``` +* dynamic_extent[link /reference/span/dynamic_extent.md] +* Extents[link extents.md] +* mapping[link layout_right_padded/mapping.md.nolink] + +## 概要 +`layout_right_padded`は、多次元配列ビュー[`mdspan`](mdspan.md)に対して、パディングあり行優先(row major)[レイアウトマッピング](LayoutMapping.md)を表現するポリシークラスである。 + +全要素が隣接配置される[`layout_right`](layout_right.md)とは異なり、`layout_right_padded`では最右次元の隣次元(第R-2次元)ストライド幅`stride(`[`extents_type​::​rank()`](extents/rank.md) `- 2)`が最右次元の要素数`extent(extents_type​::​rank() - 1)`よりも大きい、つまり第R-2次元においてパディングが挿入される可能性がある。 + +`layout_right_padded`の特殊化は、[レイアウトマッピングポリシー要件](LayoutMappingPolicy.md)を満たす[トリビアル型](/reference/type_traits/is_trivial.md)である。 + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`mapping`](layout_right_padded/mapping.md.nolink) | レイアウトマッピング | C++26 | + + +## 例 +```cpp example +#include +#include + +int main() +{ + double arr[] = {1, 2, 3, 0, 4, 5, 6, 0}; + // 1 2 3 - + // 4 5 6 - + + // 要素数2x3の2次元配列/行優先レイアウト/アライメント4 + using Ext2x3 = std::extents + std::mdspan> mat{arr}; + + for (size_t i = 0; i < mat.extent(0); ++i) { + for (size_t j = 0; j < mat.extent(1); ++j) { + std::print("{}{}", (j ? " " : ""), mat[i, j]); + } + std::println(); + } +} +``` +* std::layout_right_padded[color ff0000] +* extent[link mdspan/extent.md] + +### 出力 +``` +1 2 3 +4 5 6 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`layout_right`](layout_right.md) + + +## 参照 +- [P2642R5 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2642r5.html) From 246e875d357074593e6245bb9e05e8c4b23b3c97 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 23 Jul 2024 19:57:46 +0900 Subject: [PATCH 1085/3948] mdspan/layout_right_padded: remove forbid chars --- reference/mdspan/layout_right_padded.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/mdspan/layout_right_padded.md b/reference/mdspan/layout_right_padded.md index 9b5af7ef0c..d411b07d50 100644 --- a/reference/mdspan/layout_right_padded.md +++ b/reference/mdspan/layout_right_padded.md @@ -20,7 +20,7 @@ namespace std { ## 概要 `layout_right_padded`は、多次元配列ビュー[`mdspan`](mdspan.md)に対して、パディングあり行優先(row major)[レイアウトマッピング](LayoutMapping.md)を表現するポリシークラスである。 -全要素が隣接配置される[`layout_right`](layout_right.md)とは異なり、`layout_right_padded`では最右次元の隣次元(第R-2次元)ストライド幅`stride(`[`extents_type​::​rank()`](extents/rank.md) `- 2)`が最右次元の要素数`extent(extents_type​::​rank() - 1)`よりも大きい、つまり第R-2次元においてパディングが挿入される可能性がある。 +全要素が隣接配置される[`layout_right`](layout_right.md)とは異なり、`layout_right_padded`では最右次元の隣次元(第R-2次元)ストライド幅`stride(`[`extents_type::rank()`](extents/rank.md) `- 2)`が最右次元の要素数`extent(extents_type::rank() - 1)`よりも大きい、つまり第R-2次元においてパディングが挿入される可能性がある。 `layout_right_padded`の特殊化は、[レイアウトマッピングポリシー要件](LayoutMappingPolicy.md)を満たす[トリビアル型](/reference/type_traits/is_trivial.md)である。 From 99f2abbc344b84293e5102a5329c4be01dd0f16f Mon Sep 17 00:00:00 2001 From: KASUYA Rei Date: Tue, 23 Jul 2024 21:25:47 +0900 Subject: [PATCH 1086/3948] =?UTF-8?q?=E8=A6=8B=E5=87=BA=E3=81=97=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=EF=BC=88"=E5=88=97=E6=8C=99=E5=9E=8B"=20->?= =?UTF-8?q?=20"=E5=88=B0=E9=81=94=E3=81=97=E3=81=AA=E3=81=84=E8=A1=A8?= =?UTF-8?q?=E6=98=8E"=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/utility.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/utility.md b/reference/utility.md index 569b94ea63..2c5df14f63 100644 --- a/reference/utility.md +++ b/reference/utility.md @@ -68,7 +68,7 @@ | [`to_underlying`](utility/to_underlying.md) | 列挙値を基底型に変換する (function template) | C++23 | -## 列挙型 +## 到達しない表明 | 名前 | 説明 | 対応バージョン | |------|------|----------------| From e5940e41345204a0f24b8a9663ae1e3ef2ef281a Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Wed, 24 Jul 2024 11:56:08 +0900 Subject: [PATCH 1087/3948] =?UTF-8?q?linalg=20:=20setup=5Fgivens=5Frotatio?= =?UTF-8?q?n=E3=81=AE=E4=BE=8B=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/setup_givens_rotation.md | 42 +++++++++++++++++++ .../linalg/setup_givens_rotation_result.md | 4 +- 2 files changed, 43 insertions(+), 3 deletions(-) diff --git a/reference/linalg/setup_givens_rotation.md b/reference/linalg/setup_givens_rotation.md index f91e115746..5bf8344166 100644 --- a/reference/linalg/setup_givens_rotation.md +++ b/reference/linalg/setup_givens_rotation.md @@ -64,9 +64,51 @@ $$ ## 例 +**[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** + +```cpp example +#include +#include +#include +#include + +template +void print(const std::linalg::setup_givens_rotation_result& result) { + std::cout << "c: " << result.c << '\n' + << "s: " << result.s << '\n' + << "r: " << result.r << '\n'; +} + +int main() +{ + // (1) + std::cout << "(1)\n"; + auto result1 = std::linalg::setup_givens_rotation(1.0, std::sqrt(3.0)); + print(result1); + + // (2) + std::cout << "(2)\n"; + auto result2 = std::linalg::setup_givens_rotation(std::complex(1.0, 0), std::complex(0, std::sqrt(3.0))); + print(result2); + + return 0; +} +``` +* std::linalg::setup_givens_rotation[link /reference/linalg/setup_givens_rotation.md] +* std::linalg::setup_givens_rotation_result[link /reference/linalg/setup_givens_rotation_result.md] ### 出力 +``` +(1) +c: 0.5 +s: -0.866025 +r: 2.0 +(2) +c: 0.5 +s: (0,-0.866025) +r: (2,0) +``` ## バージョン diff --git a/reference/linalg/setup_givens_rotation_result.md b/reference/linalg/setup_givens_rotation_result.md index 5cd7204204..9ed2ff37a8 100644 --- a/reference/linalg/setup_givens_rotation_result.md +++ b/reference/linalg/setup_givens_rotation_result.md @@ -33,9 +33,7 @@ namespace std::linalg { ## 例 - - -### 出力 +[`setup_givens_rotation`](setup_givens_rotation.md)に記載。 ## バージョン From 271535ed9d6e4e0041c66866fa0a3290122ac8f6 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Thu, 25 Jul 2024 21:07:33 +0900 Subject: [PATCH 1088/3948] =?UTF-8?q?linalg=20:=20apply=5Fgivens=5Frotatio?= =?UTF-8?q?n=E3=81=AB=E4=BE=8B=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/linalg/apply_givens_rotation.md | 98 +++++++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/reference/linalg/apply_givens_rotation.md b/reference/linalg/apply_givens_rotation.md index 1e8d4ed205..409f6a5940 100644 --- a/reference/linalg/apply_givens_rotation.md +++ b/reference/linalg/apply_givens_rotation.md @@ -98,9 +98,107 @@ $$ ## 例 +**[注意] 処理系にあるコンパイラで確認していないため、間違っているかもしれません。** + +```cpp example +#include +#include +#include +#include +#include +#include +#include +#include + +template +void print(Vector v) { + for (int i = 0; i < v.extent(0) - 1; ++i) { + std::cout << v[i] << ", "; + } + std::cout << v[v.extent(0) - 1] << std::endl; +} + +int main() +{ + constexpr size_t N = 2; + + using Complex = std::complex; + + { + std::initializer_list a_coeff = {1, std::sqrt(3.0)}; + std::initializer_list b_coeff = {std::sqrt(3.0), -0.5}; + + std::vector a_vec(a_coeff); + std::mdspan a(a_vec.data(), N); + + std::vector b_vec(b_coeff); + std::mdspan b(b_vec.data(), N); + + double c = 0.5; + double s = -std::sqrt(3.0) / 2; + + // (1) + std::linalg::apply_givens_rotation(a, b, c, s); + print(a); + print(b); + + // (2) + // aとbを初期化 + a_vec = a_coeff; + b_vec = b_coeff; + std::linalg::apply_givens_rotation(std::execution::par, a, b, c, s); + print(a); + print(b); + } + + { + std::initializer_list a_coeff = {Complex{1, 0}, Complex{std::sqrt(3.0), 0}}; + std::initializer_list b_coeff = {Complex{0, std::sqrt(3.0)}, Complex{0, -0.5}}; + + std::vector a_vec(a_coeff); + std::mdspan a(a_vec.data(), N); + + std::vector b_vec(b_coeff); + std::mdspan b(b_vec.data(), N); + + double c = 0.5; + Complex s = Complex{0, -std::sqrt(3.0) / 2}; + + // (3) + std::linalg::apply_givens_rotation(a, b, c, s); + print(a); + print(b); + + // (4) + // aとbを初期化 + a_vec = a_coeff; + b_vec = b_coeff; + std::linalg::apply_givens_rotation(std::execution::par, a, b, c, s); + print(a); + print(b); + } + + return 0; +} +``` +* std::linalg::apply_givens_rotation[color ff0000] ### 出力 +``` +(1) +1, 0 +0, -1 +(2) +1, 0 +0, -1 +(3) +(1,0), (0,0) +(0,0), (0,-1) +(4) +(1,0), (0,0) +(0,0), (0,-1) +``` ## バージョン From bf71e354c80718e23c67361e31b83a23d91eb184 Mon Sep 17 00:00:00 2001 From: Kiterai <7496490+Kiterai@users.noreply.github.com> Date: Thu, 25 Jul 2024 21:37:54 +0900 Subject: [PATCH 1089/3948] Update remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lの抜けを修正 --- ...literals_and_multicharacter_wide_character_literals.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md b/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md index d983554ab5..07100b6adf 100644 --- a/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md +++ b/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md @@ -16,9 +16,9 @@ C++23では、ワイド文字リテラルとして、以下を禁止する: - エンコード可能ではない、または複数文字を含む文字 ```cpp -wchar_t a = '🤦'; // C++20:OK, C++23:OK \U0001f926 -wchar_t b = 'ab'; // C++20:OK, C++23:NG マルチキャラクタリテラル -wchar_t c = 'é́'; // C++20:OK, C++23:NG \u0065\u0301 +wchar_t a = L'🤦'; // C++20:OK, C++23:OK \U0001f926 +wchar_t b = L'ab'; // C++20:OK, C++23:NG マルチキャラクタリテラル +wchar_t c = L'é́'; // C++20:OK, C++23:NG \u0065\u0301 ``` `wchar_t`はプラットフォームによって16ビットか32ビットのどちらかとなる。 @@ -31,4 +31,4 @@ wchar_t c = 'é́'; // C++20:OK, C++23:NG \u0065\u0301 ## 参照 -- [P2362R3 Remove non-encodable wide character literals and multicharacter wide character literals](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2362r3.pdf) \ No newline at end of file +- [P2362R3 Remove non-encodable wide character literals and multicharacter wide character literals](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2362r3.pdf) From 8dcfab5371fd8414dbf3bd0e6fe7a1cf316df4b9 Mon Sep 17 00:00:00 2001 From: Kiterai <7496490+Kiterai@users.noreply.github.com> Date: Thu, 25 Jul 2024 21:41:42 +0900 Subject: [PATCH 1090/3948] Update remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit é́(\u0065\u0301\u0301)になっていたのでコメントに揃えた --- ...acter_literals_and_multicharacter_wide_character_literals.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md b/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md index 07100b6adf..dddacb944d 100644 --- a/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md +++ b/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md @@ -18,7 +18,7 @@ C++23では、ワイド文字リテラルとして、以下を禁止する: ```cpp wchar_t a = L'🤦'; // C++20:OK, C++23:OK \U0001f926 wchar_t b = L'ab'; // C++20:OK, C++23:NG マルチキャラクタリテラル -wchar_t c = L'é́'; // C++20:OK, C++23:NG \u0065\u0301 +wchar_t c = L'é'; // C++20:OK, C++23:NG \u0065\u0301 ``` `wchar_t`はプラットフォームによって16ビットか32ビットのどちらかとなる。 From 2285ef5b0ebf6627ea9d280fdf66ac624d7846bf Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 26 Jul 2024 11:55:35 +0900 Subject: [PATCH 1091/3948] =?UTF-8?q?accumulate=E3=81=A8reduce=E3=82=92?= =?UTF-8?q?=E7=9B=B8=E4=BA=92=E3=81=AB=E9=96=A2=E9=80=A3=E9=A0=85=E7=9B=AE?= =?UTF-8?q?=E3=81=A8=E3=81=97=E3=81=A6=E8=A8=98=E8=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/numeric/accumulate.md | 4 ++++ reference/numeric/reduce.md | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/reference/numeric/accumulate.md b/reference/numeric/accumulate.md index 790ed14e5f..77d5e02cc7 100644 --- a/reference/numeric/accumulate.md +++ b/reference/numeric/accumulate.md @@ -161,6 +161,10 @@ T accumulate(InputIterator first, InputIterator last, T init, * std::move[link /reference/utility/move.md] +## 関連項目 +- [`std::reduce()`](reduce.md) + + ## 参照 - [P0616R0 De-pessimize legacy `` algorithms with `std::move`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0616r0.pdf) - [P1645R1 `constexpr` for `` algorithms](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1645r1.html) diff --git a/reference/numeric/reduce.md b/reference/numeric/reduce.md index 05b42ab005..bb573be8d0 100644 --- a/reference/numeric/reduce.md +++ b/reference/numeric/reduce.md @@ -159,6 +159,10 @@ product : 120 - [Visual C++](/implementation.md#visual_cpp): ?? +## 関連項目 +- [`std::accumulate()`](accumulate.md) + + ## 参照 - [P0024R2 The Parallelism TS Should be Standardized](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0024r2.html) - [P0467R2 Iterator Concerns for Parallel Algorithms](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0467r2.html) From 1052eda6535c93d8971ab4e459cefc0043447725 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 26 Jul 2024 11:57:59 +0900 Subject: [PATCH 1092/3948] =?UTF-8?q?partial=5Fsum,=20inclusive=5Fscan,=20?= =?UTF-8?q?exclusive=5Fscan=E3=82=92=E7=9B=B8=E4=BA=92=E3=81=AB=E9=96=A2?= =?UTF-8?q?=E9=80=A3=E9=A0=85=E7=9B=AE=E3=81=A8=E3=81=97=E3=81=A6=E8=A8=98?= =?UTF-8?q?=E8=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/numeric/exclusive_scan.md | 5 +++++ reference/numeric/inclusive_scan.md | 5 +++++ reference/numeric/partial_sum.md | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/reference/numeric/exclusive_scan.md b/reference/numeric/exclusive_scan.md index e7e5c35ceb..fa857c0e96 100644 --- a/reference/numeric/exclusive_scan.md +++ b/reference/numeric/exclusive_scan.md @@ -181,6 +181,11 @@ int main() - [Visual C++](/implementation.md#visual_cpp): ?? +## 関連項目 +- [`std::inclusive_scan()`](inclusive_scan.md) +- [`std::partial_sum()`](partial_sum.md) + + ## 参照 - [P0024R2 The Parallelism TS Should be Standardized](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0024r2.html) - [P0467R2 Iterator Concerns for Parallel Algorithms](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0467r2.html) diff --git a/reference/numeric/inclusive_scan.md b/reference/numeric/inclusive_scan.md index cd8fdfbc56..71d96dfa39 100644 --- a/reference/numeric/inclusive_scan.md +++ b/reference/numeric/inclusive_scan.md @@ -228,6 +228,11 @@ int main() - [Visual C++](/implementation.md#visual_cpp): ?? +## 関連項目 +- [`std::exclusive_scan()`](exclusive_scan.md) +- [`std::partial_sum()`](partial_sum.md) + + ## 参照 - [P0024R2 The Parallelism TS Should be Standardized](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0024r2.html) - [P0467R2 Iterator Concerns for Parallel Algorithms](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0467r2.html) diff --git a/reference/numeric/partial_sum.md b/reference/numeric/partial_sum.md index f6305b3063..ff5c8ce26e 100644 --- a/reference/numeric/partial_sum.md +++ b/reference/numeric/partial_sum.md @@ -154,6 +154,11 @@ int main() ``` +## 関連項目 +- [`std::inclusive_scan()`](inclusive_scan.md) +- [`std::exclusive_scan()`](exclusive_scan.md) + + ## 参照 - [P0616R0 De-pessimize legacy `` algorithms with `std::move`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0616r0.pdf) - [P1645R1 `constexpr` for `` algorithms](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1645r1.html) From 0b7fd16348a738be79185728c1a3bbb4fdedf4ac Mon Sep 17 00:00:00 2001 From: koile Date: Sat, 27 Jul 2024 16:23:15 +0900 Subject: [PATCH 1093/3948] fix typos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ヘッダ名 → --- lang/cpp11/char16_32.md | 4 ++-- .../make_char16t_char32t_string_literals_be_utf16_32.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lang/cpp11/char16_32.md b/lang/cpp11/char16_32.md index b60008aa3d..4364f5d20f 100644 --- a/lang/cpp11/char16_32.md +++ b/lang/cpp11/char16_32.md @@ -48,8 +48,8 @@ char16_t s[] = u"\U00020BB7野家"; // 𠮷野家 - `char32_t`文字リテラルが、基本文字集合とユニバーサルキャラクタ名より多くを含む場合は実装定義となる。 - `char32_t`型の文字列リテラルは、静的ストレージに配置される。 - `char16_t`と`char32_t`はそれぞれ、[``](/reference/cstdint.md)ヘッダで定義される[`uint_least16_t`](/reference/cstdint/uint_least16_t.md)と[`uint_least32_t`](/reference/cstdint/uint_least32_t.md)と、サイズ、符号の有無、アライメントが同じである。 -- ``ヘッダでマクロ`__STDC_UTF_16__`が定義される場合、`char16_t`型の値はUTF-16の妥当なコードポイントを持つ。そうでない場合、`char16_t`型の値は実装定義の文字コードとなる。 -- ``ヘッダでマクロ`__STDC_UTF_32__`が定義される場合、`char32_t`型の値はUTF-32の妥当なコードポイントを持つ。そうでない場合、`char32_t`型の値は実装定義の文字コードとなる。 +- ``ヘッダでマクロ`__STDC_UTF_16__`が定義される場合、`char16_t`型の値はUTF-16の妥当なコードポイントを持つ。そうでない場合、`char16_t`型の値は実装定義の文字コードとなる。 +- ``ヘッダでマクロ`__STDC_UTF_32__`が定義される場合、`char32_t`型の値はUTF-32の妥当なコードポイントを持つ。そうでない場合、`char32_t`型の値は実装定義の文字コードとなる。 ### ユニバーサルキャラクタ名 diff --git a/lang/cpp20/make_char16t_char32t_string_literals_be_utf16_32.md b/lang/cpp20/make_char16t_char32t_string_literals_be_utf16_32.md index 6d28f5e090..80f1e90cb5 100644 --- a/lang/cpp20/make_char16t_char32t_string_literals_be_utf16_32.md +++ b/lang/cpp20/make_char16t_char32t_string_literals_be_utf16_32.md @@ -14,8 +14,8 @@ C++11で追加された文字型[`char16_t`と`char32_t`](/lang/cpp11/char16_32. これまでは、以下のような仕様であった: -- ``ヘッダでマクロ`__STDC_UTF_16__`が定義される場合、`char16_t`型の値はUTF-16の妥当なコードポイントを持つ。そうでない場合、`char16_t`型の値は実装定義の文字コードとなる。 -- ``ヘッダでマクロ`__STDC_UTF_32__`が定義される場合、`char32_t`型の値はUTF-32の妥当なコードポイントを持つ。そうでない場合、`char32_t`型の値は実装定義の文字コードとなる。 +- ``ヘッダでマクロ`__STDC_UTF_16__`が定義される場合、`char16_t`型の値はUTF-16の妥当なコードポイントを持つ。そうでない場合、`char16_t`型の値は実装定義の文字コードとなる。 +- ``ヘッダでマクロ`__STDC_UTF_32__`が定義される場合、`char32_t`型の値はUTF-32の妥当なコードポイントを持つ。そうでない場合、`char32_t`型の値は実装定義の文字コードとなる。 C++20では、無条件にUTF-16とUTF-32であることが規定される。 @@ -23,7 +23,7 @@ C++20では、無条件にUTF-16とUTF-32であることが規定される。 ## この機能が必要になった背景・経緯 -これまで、``ヘッダのマクロ`__STDC_UTF_16__`と`__STDC_UTF_32__`が定義されている場合にのみ、`char16_t`と`char32_t`はUTF-16/UTF-32エンコーディングであると規定されていた。 +これまで、``ヘッダのマクロ`__STDC_UTF_16__`と`__STDC_UTF_32__`が定義されている場合にのみ、`char16_t`と`char32_t`はUTF-16/UTF-32エンコーディングであると規定されていた。 しかし、これらが定義されなかった場合にコンパイラがほかのエンコーディングを選択することが疑わしかった。また、`char16_t`の仕様として「サロゲートペア」が含まれているが、その概念をもつ他のよく知られた文字コードはない。単一の文字を32ビットで表現する他のよく知られた文字コードもない。 From 75e450d08d80a5cdbf2ca0648edd0172436062e9 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sat, 27 Jul 2024 17:57:30 +0900 Subject: [PATCH 1094/3948] fix description about constructor complexity in map and set --- reference/map/map/op_constructor.md | 4 ++-- reference/map/multimap/op_constructor.md | 2 +- reference/set/multiset/op_constructor.md | 2 +- reference/set/set/op_constructor.md | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/reference/map/map/op_constructor.md b/reference/map/map/op_constructor.md index 044525df93..de6950de84 100644 --- a/reference/map/map/op_constructor.md +++ b/reference/map/map/op_constructor.md @@ -67,8 +67,8 @@ map(initializer_list init, - (4)、(5) `N =` [`distance`](../../iterator/distance.md)`(first, last)` とすると、範囲 `[first, last)` が比較オブジェクト `comp` によって既にソート済みである場合は `N` に比例、そうでなければ `N log N` に比例 - (6)、(7) `x.`[`size`](size.md)`()` に対して線形時間 - (8) 定数時間 -- (9) 定数時間。但し、`alloc == y.`[`get_allocator`](/reference/map/map/get_allocator.md)`()` でなければ `y.`[`size`](size.md)`()` に対して線形時間。 -- (10)、(11) `init.`[`size`](size.md)`()` に対して線形時間。 +- (9) 定数時間。但し、`alloc == y.`[`get_allocator`](/reference/map/map/get_allocator.md)`()` でなければ `y.`[`size`](size.md)`()` に対して線形時間 +- (10)、(11) `N = init.`[`size`](../../initializer_list/initializer_list/size.md)`()` とすると、範囲 `[init.`[`begin`](../../initializer_list/initializer_list/begin.md)`(), init.`[`end`](../../initializer_list/initializer_list/end.md)`())` が比較オブジェクト `comp` によって既にソート済みである場合は `N` に比例、そうでなければ `N log N` に比例 ## 備考 diff --git a/reference/map/multimap/op_constructor.md b/reference/map/multimap/op_constructor.md index 399f10e856..ac4fc9f3df 100644 --- a/reference/map/multimap/op_constructor.md +++ b/reference/map/multimap/op_constructor.md @@ -71,7 +71,7 @@ multimap(initializer_list init, - (6)、(7) `x.`[`size`](size.md)`()` に対して線形時間 - (8) 定数時間 - (9) 定数時間。ただし、`alloc == y.`[`get_allocator`](get_allocator.md)`()` でなければ `y.`[`size`](size.md)`()` に対して線形時間 -- (10)、(11) `init.`[`size`](size.md)`()` に対して線形時間 +- (10)、(11) `N = init.`[`size`](../../initializer_list/initializer_list/size.md)`()` とすると、範囲 `[init.`[`begin`](../../initializer_list/initializer_list/begin.md)`(), init.`[`end`](../../initializer_list/initializer_list/end.md)`())` が比較オブジェクト `comp` によって既にソート済みである場合は `N` に比例、そうでなければ `N log N` に比例 ## 備考 diff --git a/reference/set/multiset/op_constructor.md b/reference/set/multiset/op_constructor.md index ff871be246..2d547bfe58 100644 --- a/reference/set/multiset/op_constructor.md +++ b/reference/set/multiset/op_constructor.md @@ -62,7 +62,7 @@ multiset(initializer_list init, - (4), (5) : `comp` によって既にソート済みである場合は、イテレータ間の距離(コピーコンストラクト)。未ソートのシーケンスの場合は、それらの距離について N * logN (ソート、コピーコンストラクト)。 - (6), (8) : `x` の [`size`](size.md) に対して線形時間(全要素をコピー構築する)。 - (7), (9) : 定数時間。ただし、`alloc` が与えられてかつ `alloc != y.`[`get_allocator`](get_allocator.md)`()` の場合は線形時間。 -- (10), (11) : `init` の要素数に対して線形時間。 +- (10), (11) : `comp` によって既にソート済みである場合は、`init` のサイズ(コピーコンストラクト)。未ソートの `init` の場合は、`init` のサイズについて N * logN (ソート、コピーコンストラクト)。 ## 備考 diff --git a/reference/set/set/op_constructor.md b/reference/set/set/op_constructor.md index d87fbf344c..22e8e1e449 100644 --- a/reference/set/set/op_constructor.md +++ b/reference/set/set/op_constructor.md @@ -62,7 +62,7 @@ set(initializer_list init, - (4), (5) : `comp` によって既にソート済みである場合は、イテレータ間の距離(コピーコンストラクト)。未ソートのシーケンスの場合は、それらの距離について N * logN (ソート、コピーコンストラクト)。 - (6), (8) : `x` の [`size`](size.md) に対して線形時間(全要素をコピー構築する)。 - (7), (9) : 定数時間。ただし、`alloc` が与えられてかつ `alloc != y.`[`get_allocator`](get_allocator.md)`()` の場合は線形時間。 -- (10), (11) : `init` の要素数に対して線形時間。 +- (10), (11) : `comp` によって既にソート済みである場合は、`init` のサイズ(コピーコンストラクト)。未ソートの `init` の場合は、`init` のサイズについて N * logN (ソート、コピーコンストラクト)。 ## 備考 From f45447e6da9c7e0f0949b475509b1493f654487e Mon Sep 17 00:00:00 2001 From: suomesta Date: Sat, 27 Jul 2024 18:49:42 +0900 Subject: [PATCH 1095/3948] add range constructor to map and set --- reference/map/map/op_constructor.md | 13 +++++++++++++ reference/map/multimap/op_constructor.md | 13 +++++++++++++ reference/set/multiset/op_constructor.md | 21 +++++++++++++++++---- reference/set/set/op_constructor.md | 13 +++++++++++++ 4 files changed, 56 insertions(+), 4 deletions(-) diff --git a/reference/map/map/op_constructor.md b/reference/map/map/op_constructor.md index de6950de84..a6a69716af 100644 --- a/reference/map/map/op_constructor.md +++ b/reference/map/map/op_constructor.md @@ -40,8 +40,18 @@ map(initializer_list init, map(initializer_list init, const Allocator& alloc); // (11) C++14 から + +template R> +map(from_range_t, R&& rg, + const Compare& comp = Compare(), + const Allocator& alloc = Allocator()); // (12) C++23 から + +template R> +map(from_range_t, R&& rg, + const Allocator& alloc); // (13) C++23 から ``` * initializer_list[link ../../initializer_list.md] +* from_range_t[link ../../ranges/from_range_t.md] ## 概要 `map` オブジェクトの構築 @@ -60,6 +70,8 @@ map(initializer_list init, - (9) アロケータ `alloc` を指定したムーブコンストラクタ。`y` の要素をムーブすることで `map` オブジェクトを構築する。(C++11 から) - (10) 比較オブジェクト `comp`、アロケータ `alloc` 、および初期化リスト `init` の要素で `map` オブジェクトを構築する。`map(init.`[`begin`](../../initializer_list/initializer_list/begin.md)`(), init.`[`end`](../../initializer_list/initializer_list/end.md)`(), comp, alloc)` と等価。(C++11 から) - (11) アロケータ `alloc` 、および初期化リスト `init` の要素で `map` オブジェクトを構築する。`map(init, Compare(), alloc)` と等価。(C++14 から) +- (12) Rangeコンストラクタ。比較オブジェクト `comp`、アロケータ `alloc` 、およびRange `rg` の要素で `map` オブジェクトを構築する。 +- (13) Rangeコンストラクタ。アロケータ `alloc` 、およびRange `rg` の要素で `map` オブジェクトを構築する。 ## 計算量 @@ -69,6 +81,7 @@ map(initializer_list init, - (8) 定数時間 - (9) 定数時間。但し、`alloc == y.`[`get_allocator`](/reference/map/map/get_allocator.md)`()` でなければ `y.`[`size`](size.md)`()` に対して線形時間 - (10)、(11) `N = init.`[`size`](../../initializer_list/initializer_list/size.md)`()` とすると、範囲 `[init.`[`begin`](../../initializer_list/initializer_list/begin.md)`(), init.`[`end`](../../initializer_list/initializer_list/end.md)`())` が比較オブジェクト `comp` によって既にソート済みである場合は `N` に比例、そうでなければ `N log N` に比例 +- (12)、(13) `N =` [`ranges::distance`](../../iterator/ranges_distance.md)`(rg)` とすると、`rg` が比較オブジェクト `comp` によって既にソート済みである場合は `N` に比例、そうでなければ `N log N` に比例 ## 備考 diff --git a/reference/map/multimap/op_constructor.md b/reference/map/multimap/op_constructor.md index ac4fc9f3df..72cfb0496e 100644 --- a/reference/map/multimap/op_constructor.md +++ b/reference/map/multimap/op_constructor.md @@ -42,8 +42,18 @@ multimap(initializer_list init, multimap(initializer_list init, const Allocator& alloc); // (11) C++14 から + +template R> +multimap(from_range_t, R&& rg, + const Compare& comp = Compare(), + const Allocator& alloc = Allocator()); // (12) C++23 から + +template R> +multimap(from_range_t, R&& rg, + const Allocator& alloc); // (13) C++23 から ``` * initializer_list[link ../../initializer_list.md] +* from_range_t[link ../../ranges/from_range_t.md] ## 概要 @@ -63,6 +73,8 @@ multimap(initializer_list init, - (9) アロケータ `alloc` を指定したムーブコンストラクタ。`y` の要素をムーブすることでコンテナを構築する。(C++11 から) - (10) 比較オブジェクト `comp`、アロケータ `alloc`、および初期化リスト `init` の要素で `multimap` オブジェクトを構築する。`multimap(init.`[`begin`](../../initializer_list/initializer_list/begin.md)`, init.`[`end`](../../initializer_list/initializer_list/end.md)`, comp, alloc)` と等価。(C++11 から) - (11) アロケータ `alloc`、および初期化リスト `init` の要素で `multimap` オブジェクトを構築する。`multimap(init, Compare(), alloc)` と等価。(C++14 から) +- (12) Rangeコンストラクタ。比較オブジェクト `comp`、アロケータ `alloc` 、およびRange `rg` の要素で `multimap` オブジェクトを構築する。 +- (13) Rangeコンストラクタ。アロケータ `alloc` 、およびRange `rg` の要素で `multimap` オブジェクトを構築する。 ## 計算量 @@ -72,6 +84,7 @@ multimap(initializer_list init, - (8) 定数時間 - (9) 定数時間。ただし、`alloc == y.`[`get_allocator`](get_allocator.md)`()` でなければ `y.`[`size`](size.md)`()` に対して線形時間 - (10)、(11) `N = init.`[`size`](../../initializer_list/initializer_list/size.md)`()` とすると、範囲 `[init.`[`begin`](../../initializer_list/initializer_list/begin.md)`(), init.`[`end`](../../initializer_list/initializer_list/end.md)`())` が比較オブジェクト `comp` によって既にソート済みである場合は `N` に比例、そうでなければ `N log N` に比例 +- (12)、(13) `N =` [`ranges::distance`](../../iterator/ranges_distance.md)`(rg)` とすると、`rg` が比較オブジェクト `comp` によって既にソート済みである場合は `N` に比例、そうでなければ `N log N` に比例 ## 備考 diff --git a/reference/set/multiset/op_constructor.md b/reference/set/multiset/op_constructor.md index 2d547bfe58..dff5fb8b5f 100644 --- a/reference/set/multiset/op_constructor.md +++ b/reference/set/multiset/op_constructor.md @@ -31,13 +31,23 @@ multiset(const set& x, const Allocator& alloc); // (8) C++11 multiset(set&& y, const Allocator& alloc); // (9) C++11 multiset(initializer_list init, - const Compare& comp = Compare(), - const Allocator& alloc = Allocator()); // (10) C++11 + const Compare& comp = Compare(), + const Allocator& alloc = Allocator()); // (10) C++11 multiset(initializer_list init, - const Allocator& a); // (11) C++14 + const Allocator& a); // (11) C++14 + +template R> +multiset(from_range_t, R&& rg, + const Compare& comp = Compare(), + const Allocator& alloc = Allocator()); // (12) C++23 + +template R> +multiset(from_range_t, R&& rg, + const Allocator& alloc); // (13) C++23 ``` * initializer_list[link ../../initializer_list.md] +* from_range_t[link ../../ranges/from_range_t.md] ## 概要 @@ -54,7 +64,9 @@ multiset(initializer_list init, - (6), (8) : コピーコンストラクタ。`x`のコンテンツのコピーでコンテナを構築する。もし `alloc` が与えられなかった場合、アロケータを `std::`[`allocator_traits`](../../memory/allocator_traits.md)`::`[`select_on_container_copy_construction`](../../memory/allocator_traits/select_on_container_copy_construction.md)`(x.`[`get_allocator`](get_allocator.md)`())` の呼び出しによって取得する。 - (7), (9) : ムーブコンストラクタ。`y` のコンテンツをムーブすることでコンテナを構築する。もし `alloc` が与えられなかった場合、アロケータを `y` に属しているアロケータをムーブして取得する。 - (10) : 初期化リスト `init` のコンテンツでコンテナを構築する。 -- (11) : (10)のコンストラクタを `set(init, Compare(), a)` のように呼び出して、`multiset`オブジェクトを構築する。 +- (11) : (10)のコンストラクタを `multiset(init, Compare(), a)` のように呼び出して、`multiset`オブジェクトを構築する。 +- (12) : Range `rg` の要素で `multiset` オブジェクトを構築する。 +- (13) : (12)のコンストラクタを `multiset(`[`from_range`](../../ranges/from_range_t.md)`, rg, Compare(), alloc)` のように呼び出して、`multiset`オブジェクトを構築する。 ## 計算量 @@ -63,6 +75,7 @@ multiset(initializer_list init, - (6), (8) : `x` の [`size`](size.md) に対して線形時間(全要素をコピー構築する)。 - (7), (9) : 定数時間。ただし、`alloc` が与えられてかつ `alloc != y.`[`get_allocator`](get_allocator.md)`()` の場合は線形時間。 - (10), (11) : `comp` によって既にソート済みである場合は、`init` のサイズ(コピーコンストラクト)。未ソートの `init` の場合は、`init` のサイズについて N * logN (ソート、コピーコンストラクト)。 +- (12), (13) : `comp` によって既にソート済みである場合は、`rg` のサイズ(コピーコンストラクト)。未ソートの `rg` の場合は、`rg` のサイズについて N * logN (ソート、コピーコンストラクト)。 ## 備考 diff --git a/reference/set/set/op_constructor.md b/reference/set/set/op_constructor.md index 22e8e1e449..69d2b48343 100644 --- a/reference/set/set/op_constructor.md +++ b/reference/set/set/op_constructor.md @@ -36,8 +36,18 @@ set(initializer_list init, set(initializer_list init, const Allocator& a); // (11) C++14 + +template R> +set(from_range_t, R&& rg, + const Compare& comp = Compare(), + const Allocator& alloc = Allocator()); // (12) C++23 + +template R> +set(from_range_t, R&& rg, + const Allocator& alloc); // (13) C++23 ``` * initializer_list[link ../../initializer_list.md] +* from_range_t[link ../../ranges/from_range_t.md] ## 概要 @@ -55,6 +65,8 @@ set(initializer_list init, - (7), (9) : ムーブコンストラクタ。`y` のコンテンツをムーブすることでコンテナを構築する。もし `alloc` が与えられなかった場合、アロケータを `y` に属しているアロケータをムーブして取得する。 - (10) : 初期化リスト `init` のコンテンツでコンテナを構築する。 - (11) : (10)のコンストラクタを `set(init, Compare(), a)` のように呼び出して、`set`オブジェクトを構築する。 +- (12) : Range `rg` の要素で `set` オブジェクトを構築する。 +- (13) : (12)のコンストラクタを `set(`[`from_range`](../../ranges/from_range_t.md)`, rg, Compare(), alloc)` のように呼び出して、`set`オブジェクトを構築する。 ## 計算量 @@ -63,6 +75,7 @@ set(initializer_list init, - (6), (8) : `x` の [`size`](size.md) に対して線形時間(全要素をコピー構築する)。 - (7), (9) : 定数時間。ただし、`alloc` が与えられてかつ `alloc != y.`[`get_allocator`](get_allocator.md)`()` の場合は線形時間。 - (10), (11) : `comp` によって既にソート済みである場合は、`init` のサイズ(コピーコンストラクト)。未ソートの `init` の場合は、`init` のサイズについて N * logN (ソート、コピーコンストラクト)。 +- (12), (13) : `comp` によって既にソート済みである場合は、`rg` のサイズ(コピーコンストラクト)。未ソートの `rg` の場合は、`rg` のサイズについて N * logN (ソート、コピーコンストラクト)。 ## 備考 From d0f20fcc442cbdefaf64774e01e0e908de46b3e5 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sat, 27 Jul 2024 23:46:42 +0900 Subject: [PATCH 1096/3948] add range constructor to list, deque, and string --- reference/deque/deque/op_constructor.md | 9 ++++++++- reference/forward_list/forward_list/op_constructor.md | 7 +++++++ reference/list/list/op_constructor.md | 8 ++++++++ reference/string/basic_string/op_constructor.md | 6 ++++++ 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/reference/deque/deque/op_constructor.md b/reference/deque/deque/op_constructor.md index 8841fdf4f7..81bb9d0442 100644 --- a/reference/deque/deque/op_constructor.md +++ b/reference/deque/deque/op_constructor.md @@ -31,8 +31,13 @@ deque(deque&& y, const Allocator& a); // (9) C++11 から deque(initializer_list il, const Allocator& a = Allocator()); // (10) C++11 から + +template R> +deque(from_range_t, R&& rg, + const Allocator& a = Allocator()); // (11) C++23 から ``` * initializer_list[link /reference/initializer_list/initializer_list.md] +* from_range_t[link ../../ranges/from_range_t.md] ## 概要 @@ -55,6 +60,7 @@ deque(initializer_list il, - (8) : コピーコンストラクタ。アロケータに `a` を使用して、`x` と同じ要素を保持した `deque` を構築する。 - (9) : ムーブコンストラクタ。アロケータに `a` を使用して、ムーブセマンティクスを使って `y` の要素でコンテナを構築する。 - (10) : 初期化子リストで要素を構築するコンストラクタ。`deque(il.`[`begin`](../../initializer_list/initializer_list/begin.md)`(), il.`[`end`](../../initializer_list/initializer_list/end.md)`(), a)` と等価。 +- (11) : Rangeコンストラクタ。アロケータに `a` を使用して、`rg` の要素で `deque` を構築する。 ## 計算量 @@ -68,7 +74,8 @@ deque(initializer_list il, - (7) : 定数時間 - (8) : `x` の要素数に対して線形時間 - (9) : `a == y.`[`get_allocator`](get_allocator.md)`()` の場合、定数時間、そうでなければ `y` の要素数に対して線形時間 -- (10) : `il`の要素数に対して線形時間 +- (10) : `il` の要素数に対して線形時間 +- (11) : `rg` の要素数に対して線形時間 ## 備考 diff --git a/reference/forward_list/forward_list/op_constructor.md b/reference/forward_list/forward_list/op_constructor.md index 8429ac4d3e..8c5aea629e 100644 --- a/reference/forward_list/forward_list/op_constructor.md +++ b/reference/forward_list/forward_list/op_constructor.md @@ -32,8 +32,13 @@ forward_list(forward_list&& x, const Allocator& a); // (9) C++11 forward_list(initializer_list il, const Allocator& a = Allocator()); // (10) C++11 + +template R> +forward_list(from_range_t, R&& rg, + const Allocator& a = Allocator()); // (11) C++23 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] +* from_range_t[link ../../ranges/from_range_t.md] ## 概要 `forward_list`オブジェクトを、以下に示す通りの要素で初期化する。 @@ -53,6 +58,7 @@ forward_list(initializer_list il, - (8) : アロケータを指定したコピーコンストラクタ - (9) : アロケータを指定したムーブコンストラクタ - (10) : 初期化子リストを受け取るコンストラクタ。`forward_list(il.`[`begin`](../../initializer_list/initializer_list/begin.md)`(), il.`[`end`](../../initializer_list/initializer_list/end.md)`(), a)` と等価。 +- (11) : Range `rg` の要素をコピーした `forward_list` オブジェクトを構築する。 ## 計算量 @@ -65,6 +71,7 @@ forward_list(initializer_list il, - (8) : `x` の要素数に対して線形時間 - (9) : `x.`[`get_allocator`](get_allocator.md)`() == a` であれば、定数時間。そうでなければ `x` の要素数に対して線形時間 - (10) : `il` の要素数に対して線形時間 +- (11) : `rg` の要素数に対して線形時間 ## 備考 diff --git a/reference/list/list/op_constructor.md b/reference/list/list/op_constructor.md index 2ec356e95e..a881629f41 100644 --- a/reference/list/list/op_constructor.md +++ b/reference/list/list/op_constructor.md @@ -29,8 +29,13 @@ list(list&& x, const Allocator& a); // (9) C++11 から list(initializer_list il, const Allocator& a = Allocator()); // (10) C++11 から + +template R> +list(from_range_t, R&& rg, + const Allocator& a = Allocator()); // (11) C++23 から ``` * initializer_list[link /reference/initializer_list/initializer_list.md] +* from_range_t[link ../../ranges/from_range_t.md] ## 概要 @@ -48,6 +53,7 @@ list オブジェクトの構築 - (8) : アロケータを指定したコピーコンストラクタ。 - (9) : アロケータを指定したムーブコンストラクタ。 - (10) : 初期化子リストを受け取るコンストラクタ。`list(il.`[`begin`](../../initializer_list/initializer_list/begin.md)`(), il.`[`end`](../../initializer_list/initializer_list/end.md)`(), a)` と等価。 +- (11) : Rangeコンストラクタ。Range `rg` の要素で `list` を構築する。 ## 計算量 @@ -57,6 +63,8 @@ list オブジェクトの構築 - (6), (8) : `x.`[`size`](size.md)`()` に対して線形時間 - (7) : 定数時間 - (9) : `a == x.`[`get_allocator`](get_allocator.md)`()` であれば定数時間。そうでなければ `x.`[`size`](size.md)`()` に対して線形時間 +- (10) : `il.`[`size`](../../initializer_list/initializer_list/size.md)`()` に対して線形時間 +- (11) : [`ranges::distance`](../../iterator/ranges_distance.md)`(rg)` に対して線形時間 ## 備考 diff --git a/reference/string/basic_string/op_constructor.md b/reference/string/basic_string/op_constructor.md index a4d4337dab..5bf5008240 100644 --- a/reference/string/basic_string/op_constructor.md +++ b/reference/string/basic_string/op_constructor.md @@ -118,8 +118,13 @@ constexpr basic_string(const T& t, size_type pos, size_type n, const Allocator& a = Allocator()); // (15) C++20 + +template R> +constexpr basic_string(from_range_t, R&& rg, + const Allocator& a = Allocator()); // (19) C++23 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] +* from_range_t[link ../../ranges/from_range_t.md] ## 概要 - (1) : デフォルトコンストラクタ。アロケータをデフォルト構築して空の`basic_string`オブジェクトを構築する。 @@ -139,6 +144,7 @@ constexpr basic_string(const T& t, - (15) : [`basic_string_view`](/reference/string_view/basic_string_view.md)``に変換可能な`t`が参照する範囲の文字列の`pos`番目から`n`文字の部分文字列がコピーされる。`n == npos`の場合、`pos`番目から末尾までの部分文字列がコピーされる。 - (17) : `str`オブジェクトの部分文字列のコピーから`basic_string`オブジェクトを構築する。`str`オブジェクトの`pos`番目から`n`文字の部分文字列がコピーされる。`n == npos`の場合、`pos`番目から末尾までの部分文字列がコピーされる。`str`は未規定の値になる。 - (18) : `str`オブジェクトの部分文字列のコピーから`basic_string`オブジェクトを構築する。`str`オブジェクトの`pos`番目から末尾までの部分文字列がコピーされる。`str`は未規定の値になる。 +- (19) : Range`rg`から`basic_string`オブジェクトを構築する。 ## テンプレートパラメータ制約 From 3cac84021a71976657fcb10d7411ed4642e214b8 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sun, 28 Jul 2024 14:09:26 +0900 Subject: [PATCH 1097/3948] add range constructor to list, deque, and string (#1069) --- .../unordered_map/op_constructor.md | 26 +++++++++++++++++++ .../unordered_multimap/op_constructor.md | 26 +++++++++++++++++++ .../unordered_multiset/op_constructor.md | 26 +++++++++++++++++++ .../unordered_set/op_constructor.md | 26 +++++++++++++++++++ 4 files changed, 104 insertions(+) diff --git a/reference/unordered_map/unordered_map/op_constructor.md b/reference/unordered_map/unordered_map/op_constructor.md index e7bc4911e0..34b0d996e0 100644 --- a/reference/unordered_map/unordered_map/op_constructor.md +++ b/reference/unordered_map/unordered_map/op_constructor.md @@ -67,8 +67,27 @@ unordered_map(initializer_list il, size_type n, const hasher& hf, const allocator_type& a); // (15) C++14 + +template R> +unordered_map(std::from_range_t, R&& rg, + size_type n = 実装依存の既定値, + const hasher& hf = hasher(), + const key_equal& eql = key_equal(), + const allocator_type& a = allocator_type()); // (16) C++23 + +template R> +unordered_map(std::from_range_t, R&& rg, + size_type n, + const allocator_type& a); // (17) C++23 + +template R> +unordered_map(std::from_range_t, R&& rg, + size_type n, + const hasher& hf, + const allocator_type& a); // (18) C++23 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] +* from_range_t[link ../../ranges/from_range_t.md] ## 概要 `unordered_map` オブジェクトを構築する @@ -133,6 +152,12 @@ unordered_map(initializer_list il, - (15) : (5) の形式を `unordered_map(il, n, hf, key_equal(), a)` として呼び出した場合と等価である。 +- (16) : バケット数最低 `n`、ハッシュ関数オブジェクト `hf`、キー比較用関数オブジェクト `eql`、アロケータオブジェクト `a` で `unordered_map` が構築された後、Range `rg` の要素が挿入される。 + +- (17) : (16) の形式を `unordered_map(from_range, std::forward(rg), n, hasher(), key_equal(), a)` として呼び出した場合と等価である。 + +- (18) : (16) の形式を `unordered_map(from_range, std::forward(rg), n, hf, key_equal(), a)` として呼び出した場合と等価である。 + ## 事後条件 以下では構築されたオブジェクトを `u` とする。 @@ -190,6 +215,7 @@ unordered_map(initializer_list il, - (13) : (3) の形式を `unordered_map(f, l, n, hf, key_equal(), a)` として呼び出した場合と等価。 - (14) : (5) の形式を `unordered_map(il, n, hasher(), key_equal(), a)` として呼び出した場合と等価。 - (15) : (5) の形式を `unordered_map(il, n, hf, key_equal(), a)` として呼び出した場合と等価。 +- (16), (17), (18) : 平均的には O(n)、ここで、n は [`ranges::distance`](../../iterator/ranges_distance.md)`(rg)`。最悪のケースでは O(n2) ## 備考 diff --git a/reference/unordered_map/unordered_multimap/op_constructor.md b/reference/unordered_map/unordered_multimap/op_constructor.md index 766900cdfc..0e44aed119 100644 --- a/reference/unordered_map/unordered_multimap/op_constructor.md +++ b/reference/unordered_map/unordered_multimap/op_constructor.md @@ -68,8 +68,27 @@ unordered_multimap(initializer_list il, size_type n, const hasher& hf, const allocator_type& a); // (15) C++14 + +template R> +unordered_multimap(std::from_range_t, R&& rg, + size_type n = 実装依存の既定値, + const hasher& hf = hasher(), + const key_equal& eql = key_equal(), + const allocator_type& a = allocator_type()); // (16) C++23 + +template R> +unordered_multimap(std::from_range_t, R&& rg, + size_type n, + const allocator_type& a); // (17) C++23 + +template R> +unordered_multimap(std::from_range_t, R&& rg, + size_type n, + const hasher& hf, + const allocator_type& a); // (18) C++23 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] +* from_range_t[link ../../ranges/from_range_t.md] ## 概要 `unordered_multimap` オブジェクトを構築する @@ -136,6 +155,12 @@ unordered_multimap(initializer_list il, - (15) : (5) の形式を `unordered_multimap(il, n, hf, key_equal(), a)` として呼び出した場合と等価である。 +- (16) : バケット数最低 `n`、ハッシュ関数オブジェクト `hf`、キー比較用関数オブジェクト `eql`、アロケータオブジェクト `a` で `unordered_multimap` が構築された後、Range `rg` の要素が挿入される。 + +- (17) : (16) の形式を `unordered_multimap(from_range, std::forward(rg), n, hasher(), key_equal(), a)` として呼び出した場合と等価である。 + +- (18) : (16) の形式を `unordered_multimap(from_range, std::forward(rg), n, hf, key_equal(), a)` として呼び出した場合と等価である。 + ## 事後条件 以下では構築されたオブジェクトを `u` とする。 @@ -194,6 +219,7 @@ unordered_multimap(initializer_list il, - (13) : (3) の形式を `unordered_multimap(f, l, n, hf, key_equal(), a)` として呼び出した場合と等価。 - (14) : (5) の形式を `unordered_multimap(il, n, hasher(), key_equal(), a)` として呼び出した場合と等価。 - (15) : (5) の形式を `unordered_multimap(il, n, hf, key_equal(), a)` として呼び出した場合と等価。 +- (16), (17), (18) : 平均的には O(n)、ここで、n は [`ranges::distance`](../../iterator/ranges_distance.md)`(rg)`。最悪のケースでは O(n2) ## 備考 diff --git a/reference/unordered_set/unordered_multiset/op_constructor.md b/reference/unordered_set/unordered_multiset/op_constructor.md index e6fe7d5fb4..3cbeb1ced5 100644 --- a/reference/unordered_set/unordered_multiset/op_constructor.md +++ b/reference/unordered_set/unordered_multiset/op_constructor.md @@ -69,8 +69,27 @@ unordered_multiset(initializer_list il, size_type n, const hasher& hf, const allocator_type& a); // (15) C++14 + +template R> +unordered_multiset(std::from_range_t, R&& rg, + size_type n = 実装依存の既定値, + const hasher& hf = hasher(), + const key_equal& eql = key_equal(), + const allocator_type& a = allocator_type()); // (16) C++23 + +template R> +unordered_multiset(std::from_range_t, R&& rg, + size_type n, + const allocator_type& a); // (17) C++23 + +template R> +unordered_multiset(std::from_range_t, R&& rg, + size_type n, + const hasher& hf, + const allocator_type& a); // (18) C++23 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] +* from_range_t[link ../../ranges/from_range_t.md] ## 概要 `unordered_multiset` オブジェクトを構築する @@ -137,6 +156,12 @@ unordered_multiset(initializer_list il, - (15) : (5) の形式を `unordered_multiset(il, n, hf, key_equal(), a)` として呼び出した場合と等価である。 +- (16) : バケット数最低 `n`、ハッシュ関数オブジェクト `hf`、キー比較用関数オブジェクト `eql`、アロケータオブジェクト `a` で `unordered_multiset` が構築された後、Range `rg` の要素が挿入される。 + +- (17) : (16) の形式を `unordered_multiset(from_range, std::forward(rg), n, hasher(), key_equal(), a)` として呼び出した場合と等価である。 + +- (18) : (16) の形式を `unordered_multiset(from_range, std::forward(rg), n, hf, key_equal(), a)` として呼び出した場合と等価である。 + ## 事後条件 以下では構築されたオブジェクトを `u` とする。 @@ -195,6 +220,7 @@ unordered_multiset(initializer_list il, - (13) : (3) の形式を `unordered_multiset(f, l, n, hf, key_equal(), a)` として呼び出した場合と等価。 - (14) : (5) の形式を `unordered_multiset(il, n, hasher(), key_equal(), a)` として呼び出した場合と等価。 - (15) : (5) の形式を `unordered_multiset(il, n, hf, key_equal(), a)` として呼び出した場合と等価。 +- (16), (17), (18) : 平均的には O(n)、ここで、n は [`ranges::distance`](../../iterator/ranges_distance.md)`(rg)`。最悪のケースでは O(n2) ## 備考 diff --git a/reference/unordered_set/unordered_set/op_constructor.md b/reference/unordered_set/unordered_set/op_constructor.md index 83ceb4e1ed..e55faf15ea 100644 --- a/reference/unordered_set/unordered_set/op_constructor.md +++ b/reference/unordered_set/unordered_set/op_constructor.md @@ -69,8 +69,27 @@ unordered_set(initializer_list il, size_type n, const hasher& hf, const allocator_type& a); // (15) C++14 + +template R> +unordered_set(std::from_range_t, R&& rg, + size_type n = 実装依存の既定値, + const hasher& hf = hasher(), + const key_equal& eql = key_equal(), + const allocator_type& a = allocator_type()); // (16) C++23 + +template R> +unordered_set(std::from_range_t, R&& rg, + size_type n, + const allocator_type& a); // (17) C++23 + +template R> +unordered_set(std::from_range_t, R&& rg, + size_type n, + const hasher& hf, + const allocator_type& a); // (18) C++23 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] +* from_range_t[link ../../ranges/from_range_t.md] ## 概要 `unordered_set` オブジェクトを構築する @@ -137,6 +156,12 @@ unordered_set(initializer_list il, - (15) : (5) の形式を `unordered_set(il, n, hf, key_equal(), a)` として呼び出した場合と等価である。 +- (16) : バケット数最低 `n`、ハッシュ関数オブジェクト `hf`、キー比較用関数オブジェクト `eql`、アロケータオブジェクト `a` で `unordered_set` が構築された後、Range `rg` の要素が挿入される。 + +- (17) : (16) の形式を `unordered_set(from_range, std::forward(rg), n, hasher(), key_equal(), a)` として呼び出した場合と等価である。 + +- (18) : (16) の形式を `unordered_set(from_range, std::forward(rg), n, hf, key_equal(), a)` として呼び出した場合と等価である。 + ## 事後条件 以下では構築されたオブジェクトを `u` とする。 @@ -195,6 +220,7 @@ unordered_set(initializer_list il, - (13) : (3) の形式を `unordered_set(f, l, n, hf, key_equal(), a)` として呼び出した場合と等価。 - (14) : (5) の形式を `unordered_set(il, n, hasher(), key_equal(), a)` として呼び出した場合と等価。 - (15) : (5) の形式を `unordered_set(il, n, hf, key_equal(), a)` として呼び出した場合と等価。 +- (16), (17), (18) : 平均的には O(n)、ここで、n は [`ranges::distance`](../../iterator/ranges_distance.md)`(rg)`。最悪のケースでは O(n2) ## 備考 From 4cf72eb1b866639d4cb3232cb4742af484697727 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sun, 28 Jul 2024 16:13:35 +0900 Subject: [PATCH 1098/3948] add range constructor to vector (#1069) --- reference/vector/vector/op_constructor.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/reference/vector/vector/op_constructor.md b/reference/vector/vector/op_constructor.md index 6c76bec676..0e73477f47 100644 --- a/reference/vector/vector/op_constructor.md +++ b/reference/vector/vector/op_constructor.md @@ -56,8 +56,13 @@ vector(initializer_list il, const Allocator& a = Allocator()); // (10) C++11 constexpr vector(initializer_list il, const Allocator& a = Allocator()); // (10) C++20 + +template R> +constexpr vector(std::from_range_t, R&& rg, + const Allocator& a = Allocator()); // (11) C++23 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] +* from_range_t[link ../../ranges/from_range_t.md] ## 概要 `vector`オブジェクトを次に示す通りの要素で初期化する。 @@ -79,6 +84,7 @@ constexpr vector(initializer_list il, - (8) : アロケータを別で受け取り、`vector` オブジェクトをコピー構築する。 - (9) : アロケータを別で受け取り、`vector` オブジェクトをムーブ構築する。 - (10) : 初期化子リストを受け取るコンストラクタ。`vector(il.`[`begin`](/reference/initializer_list/initializer_list/begin.md)`(), li.`[`end`](/reference/initializer_list/initializer_list/end.md)`(), a)` と等価。 +- (11) : Rangeコンストラクタ。アロケータ `a` を使用して、Range `rg` の要素から `vector` オブジェクトを構築する。 ## 計算量 @@ -90,6 +96,7 @@ constexpr vector(initializer_list il, - (8) : `x.`[`size`](size.md)`()` に対して線形時間 - (9) : 定数時間。ただし、`a == x.`[`get_allocator`](get_allocator.md)`()` でなければ `x.`[`size`](size.md)`()` に対して線形時間。 - (10) : `il.`[`size`](/reference/initializer_list/initializer_list/size.md)`()` に対して線形時間 +- (11) : [`ranges::distance`](../../iterator/ranges_distance.md)`(rg)` に対して線形時間。`R` のモデルが [`ranges::forward_range`](../../ranges/forward_range.md) でも [`ranges::sized_range`](../../ranges/sized_range.md) でもなければ、あらかじめ要素数が分からないため、再確保のコストが(対数オーダで)別途発生する。 ## 備考 From 001b9fe895ef0d4d81555b5e06d76ee1a92d068d Mon Sep 17 00:00:00 2001 From: suomesta Date: Sun, 28 Jul 2024 16:42:13 +0900 Subject: [PATCH 1099/3948] add iterator and allocator constructor to priority_queue --- .../queue/priority_queue/op_constructor.md | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/reference/queue/priority_queue/op_constructor.md b/reference/queue/priority_queue/op_constructor.md index 0623ab810a..1c92229a67 100644 --- a/reference/queue/priority_queue/op_constructor.md +++ b/reference/queue/priority_queue/op_constructor.md @@ -62,6 +62,23 @@ priority_queue(const priority_queue& que, template priority_queue(priority_queue&& que, const Alloc& alloc); // (14) C++11 + +template +priority_queue(InputIterator first, InputIterator last, + const Compare& x, + const Alloc& alloc); // (15) C++23 + +template +priority_queue(InputIterator first, InputIterator last, + const Compare& x, + const Container& other, + const Alloc& alloc); // (16) C++23 + +template +priority_queue(InputIterator first, InputIterator last, + const Compare& x, + Container&& other, + const Alloc& alloc); // (17) C++23 ``` ## 概要 @@ -80,6 +97,7 @@ priority_queue(priority_queue&& que, - (12) : 比較関数、元となるコンテナの一時オブジェクト、アロケータを受け取るコンストラクタ - (13) : アロケータ指定でコピー構築する - (14) : アロケータ指定でムーブ構築する +- (15), (16), (17) : アロケータ指定でイテレータ範囲から優先順位付きキューを構築する ## 要件 @@ -143,6 +161,24 @@ priority_queue(priority_queue&& que, 2. メンバ変数`c`を`que.c`でムーブ構築する。 3. メンバ変数`c`のメモリアロケートに`alloc`を使用する。 4. [`make_heap`](/reference/algorithm/make_heap.md)`(c.begin(), c.end(), comp)`を呼び出す。 +- (15) : + 1. メンバ変数`comp`を`x`でコピー構築する。 + 2. メンバ変数`c`のメモリアロケートに`alloc`を使用する。 + 3. `c.insert(c.end(), first, last)`を呼び出す。 + 4. [`make_heap`](/reference/algorithm/make_heap.md)`(c.begin(), c.end(), comp)`を呼び出す。 + 5. メンバ変数`c`のメモリアロケートに`alloc`を使用する。 +- (16) : + 1. メンバ変数`comp`を`x`でコピー構築する。 + 2. メンバ変数`c`を`other`でコピー構築する。 + 3. メンバ変数`c`のメモリアロケートに`alloc`を使用する。 + 4. `c.insert(c.end(), first, last)`を呼び出す。 + 5. [`make_heap`](/reference/algorithm/make_heap.md)`(c.begin(), c.end(), comp)`を呼び出す。 +- (17) : + 1. メンバ変数`comp`を`x`でコピー構築する。 + 2. メンバ変数`c`を`other`でムーブ構築する。 + 3. メンバ変数`c`のメモリアロケートに`alloc`を使用する。 + 4. `c.insert(c.end(), first, last)`を呼び出す。 + 5. [`make_heap`](/reference/algorithm/make_heap.md)`(c.begin(), c.end(), comp)`を呼び出す。 ## 例 From 14cc1a065c03a11cdaed748034843e3a66e125bd Mon Sep 17 00:00:00 2001 From: suomesta Date: Sun, 28 Jul 2024 17:03:20 +0900 Subject: [PATCH 1100/3948] add range constructor to stack and queue (#1069) --- .../queue/priority_queue/op_constructor.md | 30 ++++++++++++++++++- reference/queue/queue/op_constructor.md | 7 +++++ reference/stack/stack/op_constructor.md | 15 ++++++++-- 3 files changed, 49 insertions(+), 3 deletions(-) diff --git a/reference/queue/priority_queue/op_constructor.md b/reference/queue/priority_queue/op_constructor.md index 1c92229a67..ef3ff162e8 100644 --- a/reference/queue/priority_queue/op_constructor.md +++ b/reference/queue/priority_queue/op_constructor.md @@ -79,7 +79,21 @@ priority_queue(InputIterator first, InputIterator last, const Compare& x, Container&& other, const Alloc& alloc); // (17) C++23 + +template R> +priority_queue(from_range_t, R&& rg, + const Compare& x = Compare()); // (18) C++23 + +template R, class Alloc> +priority_queue(from_range_t, R&& rg, + const Compare& x, + const Alloc& alloc); // (19) C++23 + +template R, class Alloc> +priority_queue(from_range_t, R&& rg, + const Alloc& alloc); // (20) C++23 ``` +* from_range_t[link ../../ranges/from_range_t.md] ## 概要 - (1) : デフォルトコンストラクタ @@ -98,6 +112,7 @@ priority_queue(InputIterator first, InputIterator last, - (13) : アロケータ指定でコピー構築する - (14) : アロケータ指定でムーブ構築する - (15), (16), (17) : アロケータ指定でイテレータ範囲から優先順位付きキューを構築する +- (18), (19), (20) : Rangeから優先順位付きキューを構築する ## 要件 @@ -166,7 +181,6 @@ priority_queue(InputIterator first, InputIterator last, 2. メンバ変数`c`のメモリアロケートに`alloc`を使用する。 3. `c.insert(c.end(), first, last)`を呼び出す。 4. [`make_heap`](/reference/algorithm/make_heap.md)`(c.begin(), c.end(), comp)`を呼び出す。 - 5. メンバ変数`c`のメモリアロケートに`alloc`を使用する。 - (16) : 1. メンバ変数`comp`を`x`でコピー構築する。 2. メンバ変数`c`を`other`でコピー構築する。 @@ -179,6 +193,20 @@ priority_queue(InputIterator first, InputIterator last, 3. メンバ変数`c`のメモリアロケートに`alloc`を使用する。 4. `c.insert(c.end(), first, last)`を呼び出す。 5. [`make_heap`](/reference/algorithm/make_heap.md)`(c.begin(), c.end(), comp)`を呼び出す。 +- (18) : + 1. メンバ変数`comp`を`x`でコピー構築する。 + 2. `c.insert(c.end(), ranges::begin(rg), ranges::end(rg))`を呼び出す。 + 3. [`make_heap`](/reference/algorithm/make_heap.md)`(c.begin(), c.end(), comp)`を呼び出す。 +- (19) : + 1. メンバ変数`comp`を`x`でコピー構築する。 + 2. メンバ変数`c`のメモリアロケートに`alloc`を使用する。 + 3. `c.insert(c.end(), ranges::begin(rg), ranges::end(rg))`を呼び出す。 + 4. [`make_heap`](/reference/algorithm/make_heap.md)`(c.begin(), c.end(), comp)`を呼び出す。 +- (20) : + 1. メンバ変数`comp`を値初期化する。 + 2. メンバ変数`c`のメモリアロケートに`alloc`を使用する。 + 3. `c.insert(c.end(), ranges::begin(rg), ranges::end(rg))`を呼び出す。 + 4. [`make_heap`](/reference/algorithm/make_heap.md)`(c.begin(), c.end(), comp)`を呼び出す。 ## 例 diff --git a/reference/queue/queue/op_constructor.md b/reference/queue/queue/op_constructor.md index a5f74dd5ed..0dfe840c68 100644 --- a/reference/queue/queue/op_constructor.md +++ b/reference/queue/queue/op_constructor.md @@ -33,7 +33,13 @@ queue(queue&& que, const Alloc& alloc); // (9) C++11 template queue(InputIterator first, InputIterator last, const Alloc&); // (10) C++23 + +template R> +queue(from_range_t, R&& rg); // (11) C++23 +template R, class Alloc> +queue(from_range_t, R&& rg, const Alloc& alloc); // (12) C++23 ``` +* from_range_t[link ../../ranges/from_range_t.md] ## 概要 `queue` コンテナアダプタのオブジェクトを構築する。 @@ -46,6 +52,7 @@ queue(InputIterator first, InputIterator last, const Alloc&); // (10) C++23 `alloc`: 内部のコンテナで使用するアロケータオブジェクト `que`: コピー・ムーブ元の`queue`オブジェクト `first`, `last`: 初期化に用いるイテレータのペア +`rg`: 初期化に用いるRange ## 計算量 線形 O(n)。 diff --git a/reference/stack/stack/op_constructor.md b/reference/stack/stack/op_constructor.md index c5da7122ca..14b0c8d2f2 100644 --- a/reference/stack/stack/op_constructor.md +++ b/reference/stack/stack/op_constructor.md @@ -17,7 +17,7 @@ stack() : stack(Container()) {} // (1) explicit stack(const Container&); // (2) explicit stack(Container&&); // (3) -template +template stack(InputIterator first, InputIterator last); // (4) C++23 template @@ -35,9 +35,16 @@ stack(const stack& st, const Allocator& alloc); // (8) C++11 template stack(stack&& st, const Allocator& alloc); // (9) C++11 -template +template stack(InputIterator first, InputIterator last, const Alloc&); // (10) C++23 + +template R> +stack(from_range_t, R&& rg); // (11) C++23 + +template R, class Alloc> +stack(from_range_t, R&& rg, const Alloc& alloc); // (12) C++23 ``` +* from_range_t[link ../../ranges/from_range_t.md] ## 概要 - (1) : デフォルトコンストラクタ。 @@ -50,6 +57,8 @@ stack(InputIterator first, InputIterator last, const Alloc&); // (10) C++23 - (8) : アロケータを受け取るコピーコンストラクタ。 - (9) : アロケータを受け取るムーブコンストラクタ。 - (10) : 元となるコンテナのイテレータペアとアロケータを受け取るコンストラクタ。 +- (11) : 元となるRangeを受け取るコンストラクタ。 +- (12) : 元となるRangeとアロケータを受け取るコンストラクタ。 ## 効果 @@ -62,6 +71,8 @@ stack(InputIterator first, InputIterator last, const Alloc&); // (10) C++23 - (8) : メンバ変数`c`を`Container(st.c, alloc)`で初期化する。 - (9) : メンバ変数`c`を`Container(`[`std::move`](/reference/utility/move.md)`(st.c), alloc)`で初期化する。 - (10) : メンバ変数`c`を3つの引数`first`, `last`, `alloc`で初期化する。 +- (11) : メンバ変数`c`を`Container(from_range, rg)`で初期化する。 +- (12) : メンバ変数`c`を`Container(from_range, rg, alloc)`で初期化する。 ## 例 From 01cb1074891be1c83b96d153521f35666abc548c Mon Sep 17 00:00:00 2001 From: yoh Date: Sun, 28 Jul 2024 22:32:33 +0900 Subject: [PATCH 1101/3948] =?UTF-8?q?mdspan:=20layout=5F{left,right}=5Fpad?= =?UTF-8?q?ded::mapping=E6=A6=82=E8=A6=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit P2645R5 -> P2645R6 --- reference/mdspan.md | 2 +- reference/mdspan/LayoutMapping.md | 4 +- reference/mdspan/LayoutMappingPolicy.md | 4 +- .../is-layout-left-padded-mapping-of.md | 25 ++++ .../is-layout-right-padded-mapping-of.md | 25 ++++ .../layout_left/mapping/op_constructor.md | 25 +++- reference/mdspan/layout_left_padded.md | 6 +- .../mdspan/layout_left_padded/mapping.md | 127 ++++++++++++++++++ reference/mdspan/layout_right_padded.md | 6 +- .../mdspan/layout_right_padded/mapping.md | 127 ++++++++++++++++++ .../layout_stride/mapping/op_constructor.md | 15 ++- 11 files changed, 353 insertions(+), 13 deletions(-) create mode 100644 reference/mdspan/is-layout-left-padded-mapping-of.md create mode 100644 reference/mdspan/is-layout-right-padded-mapping-of.md create mode 100644 reference/mdspan/layout_left_padded/mapping.md create mode 100644 reference/mdspan/layout_right_padded/mapping.md diff --git a/reference/mdspan.md b/reference/mdspan.md index 2386624e38..2ebb35cad6 100644 --- a/reference/mdspan.md +++ b/reference/mdspan.md @@ -64,4 +64,4 @@ ## 参照 - [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) - [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) -- [P2642R5 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2642r5.html) +- [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) diff --git a/reference/mdspan/LayoutMapping.md b/reference/mdspan/LayoutMapping.md index fbc2c425f5..832809d485 100644 --- a/reference/mdspan/LayoutMapping.md +++ b/reference/mdspan/LayoutMapping.md @@ -93,8 +93,8 @@ LayoutMappingを満たす型`M`は - [`layout_left::mapping`](layout_left/mapping.md) - [`layout_right::mapping`](layout_right/mapping.md) - [`layout_stride::mapping`](layout_stride/mapping.md) -- [`layout_left_padded::mapping`](layout_left_padded/mapping.md.nolink) -- [`layout_right_padded::mapping`](layout_right_padded/mapping.md.nolink) +- [`layout_left_padded::mapping`](layout_left_padded/mapping.md) +- [`layout_right_padded::mapping`](layout_right_padded/mapping.md) - [`layout_blas_packed::mapping`](/reference/linalg/layout_blas_packed/mapping.md) diff --git a/reference/mdspan/LayoutMappingPolicy.md b/reference/mdspan/LayoutMappingPolicy.md index 52161f2762..30044509a6 100644 --- a/reference/mdspan/LayoutMappingPolicy.md +++ b/reference/mdspan/LayoutMappingPolicy.md @@ -40,8 +40,8 @@ LayoutMappingPolicyを満たす型`MP`は - [`layout_left`](layout_left.md) - [`layout_right`](layout_right.md) - [`layout_stride`](layout_stride.md) -- [`layout_left_padded`](layout_left_padded.md) -- [`layout_right_padded`](layout_right_padded.md) +- [`layout_left_padded`](layout_left_padded.md) +- [`layout_right_padded`](layout_right_padded.md) - [`linalg::layout_blas_packed`](/reference/linalg/layout_blas_packed.md) diff --git a/reference/mdspan/is-layout-left-padded-mapping-of.md b/reference/mdspan/is-layout-left-padded-mapping-of.md new file mode 100644 index 0000000000..e3b3bca459 --- /dev/null +++ b/reference/mdspan/is-layout-left-padded-mapping-of.md @@ -0,0 +1,25 @@ +# is-layout-left-padded-mapping-of +* mdspan[meta header] +* variable[meta id-type] +* cpp26[meta cpp] + +```cpp +template +constexpr bool is-layout-left-padded-mapping-of = see below; // exposition only +``` +* see below[italic] + + +## 概要 +`is-layout-left-padded-mapping-of`は、[`layout_left_padded::mapping`](layout_left_padded/mapping.md)を判定する説明専用変数テンプレートである。 + +`size_t`型の任意の値`S`として`Mapping`が[`layout_left_padded::mapping`](layout_left_padded/mapping.md)の特殊化であるときに限り、`is-layout-left-padded-mapping-of`は`true`となる。 + + +## バージョン +### 言語 +- C++26 + + +## 参照 +- [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) diff --git a/reference/mdspan/is-layout-right-padded-mapping-of.md b/reference/mdspan/is-layout-right-padded-mapping-of.md new file mode 100644 index 0000000000..587e8d5cfe --- /dev/null +++ b/reference/mdspan/is-layout-right-padded-mapping-of.md @@ -0,0 +1,25 @@ +# is-layout-right-padded-mapping-of +* mdspan[meta header] +* variable[meta id-type] +* cpp26[meta cpp] + +```cpp +template +constexpr bool is-layout-right-padded-mapping-of = see below; // exposition only +``` +* see below[italic] + + +## 概要 +`is-layout-right-padded-mapping-of`は、[`layout_right_padded::mapping`](layout_right_padded/mapping.md)を判定する説明専用変数テンプレートである。 + +`size_t`型の任意の値`S`として`Mapping`が[`layout_right_padded::mapping`](layout_right_padded/mapping.md)の特殊化であるときに限り、`is-layout-right-padded-mapping-of`は`true`となる。 + + +## バージョン +### 言語 +- C++26 + + +## 参照 +- [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) diff --git a/reference/mdspan/layout_left/mapping/op_constructor.md b/reference/mdspan/layout_left/mapping/op_constructor.md index 199c1994f7..e76ad02e4f 100644 --- a/reference/mdspan/layout_left/mapping/op_constructor.md +++ b/reference/mdspan/layout_left/mapping/op_constructor.md @@ -20,6 +20,10 @@ template constexpr explicit(!is_convertible_v) mapping(const layout_right::mapping& other) noexcept; // (5) +template +constexpr explicit(!is_convertible_v) + mapping(const LayoutLeftPaddedMapping& other) noexcept; // (7) C++26 + template constexpr explicit(extents_type::rank() > 0) mapping(const layout_stride::mapping& other) noexcept; // (6) @@ -27,6 +31,7 @@ constexpr explicit(extents_type::rank() > 0) * is_convertible_v[link /reference/type_traits/is_convertible.md] * rank()[link ../../extents/rank.md] * layout_right::mapping[link ../../layout_right/mapping.md] +* LayoutLeftPaddedMapping[link ../../layout_left_padded/mapping.md] * layout_stride::mapping[link ../../layout_stride/mapping.md] ## 概要 @@ -36,6 +41,7 @@ constexpr explicit(extents_type::rank() > 0) - (4) : 他`layout_left::mapping`からの変換コンストラクタ - (5) : [`layout_right::mapping`](../../layout_right/mapping.md)からの変換コンストラクタ - (6) : [`layout_stride::mapping`](../../layout_stride/mapping.md)からの変換コンストラクタ +- (7) : [`layout_left_padded::mapping`](../../layout_left_padded/mapping.md)からの変換コンストラクタ ## テンプレートパラメータ制約 @@ -44,6 +50,17 @@ constexpr explicit(extents_type::rank() > 0) - `extents_type::`[`rank()`](../../extents/rank.md) `<= 1`、かつ - [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true`であること。 - (6) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true`であること。 +- (7) : + - [`is-layout-left-padded-mapping-of`](../../is-layout-left-padded-mapping-of.md)``が`true`、かつ + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true`であること。 + + +## 適格要件 +- (7) : 以下を満たすとき、`extents_type::`[`static_extent`](../../extents/static_extent.md)`(0)`が`LayoutLeftPaddedMapping::padding_stride`の倍数であること。 + - `extents_type::`[`rank()`](../../extents/rank.md) `> 1`、かつ + - `extents_type::`[`static_extent`](../../extents/static_extent.md)`(0)`が[`dynamic_extent`](/reference/span/dynamic_extent.md)と等しくなく、かつ + - `LayoutLeftPaddedMapping::extents_type::`[`static_extent`](../../extents/static_extent.md)`(0)`が[`dynamic_extent`](/reference/span/dynamic_extent.md)と等しくなく、かつ + - `LayoutLeftPaddedMapping::padding_stride`が[`dynamic_extent`](/reference/span/dynamic_extent.md)と等しくないこと。 ## 事前条件 @@ -53,11 +70,14 @@ constexpr explicit(extents_type::rank() > 0) - (6) : - `extents_type::`[`rank()`](../../extents/rank.md) `> 0`のとき、`other`における全次元のストライド幅が[`layout_left::mapping`相当の制約](stride.md)をもつこと。 - `other.`[`required_span_size()`](../../layout_stride/mapping/required_span_size.md)を、`index_type`型で表現できること。 +- (7) : + - `extents_type::`[`rank()`](../../extents/rank.md) `> 1`のとき、`other.stride(1) == other.extents(0)` + - `other.`[`required_span_size()`](../../layout_left_padded/mapping/required_span_size.md.nolink)を、`index_type`型で表現できること。 ## 効果 - (3) : `e`を用いて`extents_`を直接非リスト初期化する。 -- (4), (5), (6) : `other.extents()`を用いて`extents_`を直接非リスト初期化する。 +- (4), (5), (6), (7) : `other.extents()`を用いて`extents_`を直接非リスト初期化する。 ## 例外 @@ -67,6 +87,7 @@ constexpr explicit(extents_type::rank() > 0) ## explicitになる条件 - (4), (5) : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`` - (6) : [`extents_type::rank()`](../../extents/rank.md) `> 0` +- (7) : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`` ## 例 @@ -143,7 +164,9 @@ int main() ## 関連項目 - [`layout_right::mapping`](../../layout_right/mapping.md) - [`layout_stride::mapping`](../../layout_stride/mapping.md) +- [`layout_left_padded::mapping`](../../layout_left_padded/mapping.md) ## 参照 - [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) +- [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) diff --git a/reference/mdspan/layout_left_padded.md b/reference/mdspan/layout_left_padded.md index 32d916a80d..4fc89ce694 100644 --- a/reference/mdspan/layout_left_padded.md +++ b/reference/mdspan/layout_left_padded.md @@ -15,7 +15,7 @@ namespace std { ``` * dynamic_extent[link /reference/span/dynamic_extent.md] * Extents[link extents.md] -* mapping[link layout_left_padded/mapping.md.nolink] +* mapping[link layout_left_padded/mapping.md] ## 概要 `layout_left_padded`は、多次元配列ビュー[`mdspan`](mdspan.md)に対して、パディングあり列優先(column major)[レイアウトマッピング](LayoutMapping.md)を表現するポリシークラスである。 @@ -29,7 +29,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`mapping`](layout_left_padded/mapping.md.nolink) | レイアウトマッピング | C++26 | +| [`mapping`](layout_left_padded/mapping.md) | レイアウトマッピング | C++26 | ## 例 @@ -83,4 +83,4 @@ int main() ## 参照 -- [P2642R5 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2642r5.html) +- [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) diff --git a/reference/mdspan/layout_left_padded/mapping.md b/reference/mdspan/layout_left_padded/mapping.md new file mode 100644 index 0000000000..b561c74a8b --- /dev/null +++ b/reference/mdspan/layout_left_padded/mapping.md @@ -0,0 +1,127 @@ +# mapping +* mdspan[meta header] +* class template[meta id-type] +* std[meta namespace] +* layout_left_padded[meta class] +* cpp26[meta cpp] + +```cpp +namespace std { + template + template + class layout_left_padded::mapping; +} +``` +* layout_left_padded[link ../layout_left_padded.md] +* Extents[link ../extents.md] + +## 概要 +`layout_left_padded::mapping`は、[`extents`](../extents.md)型の多次元配列サイズ`E`をパラメータとして、パディングあり列優先(column major)[レイアウトマッピング](../LayoutMapping.md)を表現するクラスである。 + +`layout_left_padded::mapping`は[トリビアルコピー可能](/reference/type_traits/is_trivially_copyable.md)であり、[`regular`](/reference/concepts/regular.md)のモデルである。 + +### 説明専用メンバ変数 +`layout_left_padded::mapping`クラステンプレートは、下記の説明専用メンバ変数を保持する。 + +- `stride-1` : `index_type`型の値`static-padding-stride` +- `extents_` : `extents_type`型の[多次元配列サイズ情報](../extents.md) + +また下記の説明専用静的メンバ変数を保持する。 + +- `rank_` : `size_t`型の定数`extents_type::`[`rank()`](../extents/rank.md) +- `first-static-extent` : `size_t`型の定数`extents_type::`[`static_extent`](../extents/static_extent.md)`(0)` +- `static-padding-stride` : `size_t`型の下記定数 + - `rank_`が`0`または`1`のとき、値`0` + - `padding_value`または`first-static-extent`が[`dynamic_extent`](/reference/span/dynamic_extent.md)と等しいとき、`dynamic_extent` + - そうでなければ、`LEAST-MULTIPLE-AT-LEAST(padding_value, first-static-extent)` + + +## 適格要件 +- `Extents`は[`extents`](../extents.md)の特殊化であること。 +- `rank_dynamic() == 0`が`true`のとき、多次元インデクス空間`Extents()`のサイズが`index_type`型で表現できること。 +- 値`padding_value`が`index_type`型で表現できること。 +- 以下を満たすとき、`LEAST-MULTIPLE-AT-LEAST(padding_value, first-static-extent)`が、`size_t`型および`index_type`型で表現できること。 + - `rank_ > 1`、かつ + - `padding_value`が[`dynamic_extent`](/reference/span/dynamic_extent.md)と等しくなく、かつ + - `first-static-extent`が`dynamic_extent`と等しくないとき。 +- 以下を満たすとき、半開区間`[1, rank_)`の全ての値`k`に対して`LEAST-MULTIPLE-AT-LEAST(padding_value, ext.static_extent(0))`と全ての`ext.static_extent(k)`値を乗じた結果が、`size_t`型および`index_type`型で表現できること。 + - `rank_ > 1`、かつ + - `padding_value`が[`dynamic_extent`](/reference/span/dynamic_extent.md)と等しくなく、かつ + - 半開区間`[0, extents_type::`[`rank()`](../extents/rank.md)`)`の全ての値`k`に対して`extents_type::`[`static_extent`](../extents/static_extent.md)`(k)`が`dynamic_extent`と等しくないとき。 + + +## メンバ関数 +### 構築・破棄 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`(constructor)`](mapping/op_constructor.md.nolink) | コンストラクタ | C++26 | +| `(destructor)` | デストラクタ | C++26 | +| `operator=` | コピー代入演算子 | C++26 | + +### 観測 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `extents` | 多次元配列のサイズ`extents_`を取得する | C++26 | +| [`strides`](mapping/strides.md.nolink) | ストライド幅配列を取得する | C++26 | +| [`required_span_size`](mapping/required_span_size.md.nolink) | 要素アクセス範囲を取得する | C++26 | +| [`operator()`](mapping/op_call.md.nolink) | 多次元配列インデクスから要素位置へ変換する | C++26 | +| [`is_exhaustive`](mapping/is_exhaustive.md.nolink) | [Exhaustive特性](../LayoutMapping.md)を取得する | C++26 | +| [`stride`](mapping/stride.md.nolink) | 指定次元のストライド幅を取得する | C++26 | + + +## 静的メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `is_always_unique` | `true`を返す | C++26 | +| [`is_always_exhaustive`](mapping/is_always_exhaustive.md.nolink) | 型の[Exhaustive特性](../LayoutMapping.md)を取得する | C++26 | +| `is_always_strided` | `true`を返す | C++26 | +| `is_unique` | `true`を返す | C++26 | +| `is_strided` | `true`を返す | C++26 | + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `extents_type` | [`Extents`](../extents.md) | C++26 | +| `index_type` | [`Extents::index_type`](../extents.md) | C++26 | +| `size_type` | [`Extents::size_type`](../extents.md) | C++26 | +| `rank_type` | [`Extents::rank_type`](../extents.md) | C++26 | +| `layout_type` | [`layout_left_padded`](../layout_left_padded.md)`` | C++26 | + + +## 非メンバ(*Hidden friends*)関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`submdspan_mapping`](mapping/submdspan_mapping.md.nolink) | [`submdspan`](../submdspan.md)サポート | C++26 | + +### 比較演算子 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`operator==`](mapping/op_equal.md.nolink) | 等値比較 | C++26 | +| [`operator!=`](mapping/op_equal.md.nolink) | 非等値比較 (`==`により使用可能) | C++26 | + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`mdspan`](../mdspan.md) +- [`submdspan`](../submdspan.md) + + +## 参照 +- [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) diff --git a/reference/mdspan/layout_right_padded.md b/reference/mdspan/layout_right_padded.md index d411b07d50..18185c070b 100644 --- a/reference/mdspan/layout_right_padded.md +++ b/reference/mdspan/layout_right_padded.md @@ -15,7 +15,7 @@ namespace std { ``` * dynamic_extent[link /reference/span/dynamic_extent.md] * Extents[link extents.md] -* mapping[link layout_right_padded/mapping.md.nolink] +* mapping[link layout_right_padded/mapping.md] ## 概要 `layout_right_padded`は、多次元配列ビュー[`mdspan`](mdspan.md)に対して、パディングあり行優先(row major)[レイアウトマッピング](LayoutMapping.md)を表現するポリシークラスである。 @@ -29,7 +29,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`mapping`](layout_right_padded/mapping.md.nolink) | レイアウトマッピング | C++26 | +| [`mapping`](layout_right_padded/mapping.md) | レイアウトマッピング | C++26 | ## 例 @@ -81,4 +81,4 @@ int main() ## 参照 -- [P2642R5 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2642r5.html) +- [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) diff --git a/reference/mdspan/layout_right_padded/mapping.md b/reference/mdspan/layout_right_padded/mapping.md new file mode 100644 index 0000000000..1e8839d62a --- /dev/null +++ b/reference/mdspan/layout_right_padded/mapping.md @@ -0,0 +1,127 @@ +# mapping +* mdspan[meta header] +* class template[meta id-type] +* std[meta namespace] +* layout_right_padded[meta class] +* cpp26[meta cpp] + +```cpp +namespace std { + template + template + class layout_right_padded::mapping; +} +``` +* layout_right_padded[link ../layout_right_padded.md] +* Extents[link ../extents.md] + +## 概要 +`layout_right_padded::mapping`は、[`extents`](../extents.md)型の多次元配列サイズ`E`をパラメータとして、パディングあり行優先(row major)[レイアウトマッピング](../LayoutMapping.md)を表現するクラスである。 + +`layout_right_padded::mapping`は[トリビアルコピー可能](/reference/type_traits/is_trivially_copyable.md)であり、[`regular`](/reference/concepts/regular.md)のモデルである。 + +### 説明専用メンバ変数 +`layout_right_padded::mapping`クラステンプレートは、下記の説明専用メンバ変数を保持する。 + +- `stride-rm2` : `index_type`型の値`static-padding-stride` +- `extents_` : `extents_type`型の[多次元配列サイズ情報](../extents.md) + +また下記の説明専用静的メンバ変数を保持する。 + +- `rank_` : `size_t`型の定数`extents_type::`[`rank()`](../extents/rank.md) +- `last-static-extent` : `size_t`型の定数`extents_type::`[`static_extent`](../extents/static_extent.md)`(rank_ - 1)` +- `static-padding-stride` : `size_t`型の下記定数 + - `rank_`が`0`または`1`のとき、値`0` + - `padding_value`または`last-static-extent`が[`dynamic_extent`](/reference/span/dynamic_extent.md)と等しいとき、`dynamic_extent` + - そうでなければ、`LEAST-MULTIPLE-AT-LEAST(padding_value, last-static-extent)` + + +## 適格要件 +- `Extents`は[`extents`](../extents.md)の特殊化であること。 +- `rank_dynamic() == 0`が`true`のとき、多次元インデクス空間`Extents()`のサイズが`index_type`型で表現できること。 +- 値`padding_value`が`index_type`型で表現できること。 +- 以下を満たすとき、`LEAST-MULTIPLE-AT-LEAST(padding_value, last-static-extent)`が、`size_t`型および`index_type`型で表現できること。 + - `rank_ > 1`、かつ + - `padding_value`が[`dynamic_extent`](/reference/span/dynamic_extent.md)と等しくなく、かつ + - `last-static-extent`が`dynamic_extent`と等しくないとき。 +- 以下を満たすとき、半開区間`[1, rank_ - 1)`の全ての値`k`に対して`LEAST-MULTIPLE-AT-LEAST(padding_value, ext.static_extent(rank_ - 1))`と全ての`ext.static_extent(k)`値を乗じた結果が、`size_t`型および`index_type`型で表現できること。 + - `rank_ > 1`、かつ + - `padding_value`が[`dynamic_extent`](/reference/span/dynamic_extent.md)と等しくなく、かつ + - 半開区間`[0, rank_)`の全ての値`k`に対して`extents_type::`[`static_extent`](../extents/static_extent.md)`(k)`が`dynamic_extent`と等しくないとき。 + + +## メンバ関数 +### 構築・破棄 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`(constructor)`](mapping/op_constructor.md.nolink) | コンストラクタ | C++26 | +| `(destructor)` | デストラクタ | C++26 | +| `operator=` | コピー代入演算子 | C++26 | + +### 観測 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `extents` | 多次元配列のサイズ`extents_`を取得する | C++26 | +| [`strides`](mapping/strides.md.nolink) | ストライド幅配列を取得する | C++26 | +| [`required_span_size`](mapping/required_span_size.md.nolink) | 要素アクセス範囲を取得する | C++26 | +| [`operator()`](mapping/op_call.md.nolink) | 多次元配列インデクスから要素位置へ変換する | C++26 | +| [`is_exhaustive`](mapping/is_exhaustive.md.nolink) | [Exhaustive特性](../LayoutMapping.md)を取得する | C++26 | +| [`stride`](mapping/stride.md.nolink) | 指定次元のストライド幅を取得する | C++26 | + + +## 静的メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `is_always_unique` | `true`を返す | C++26 | +| [`is_always_exhaustive`](mapping/is_always_exhaustive.md.nolink) | 型の[Exhaustive特性](../LayoutMapping.md)を取得する | C++26 | +| `is_always_strided` | `true`を返す | C++26 | +| `is_unique` | `true`を返す | C++26 | +| `is_strided` | `true`を返す | C++26 | + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `extents_type` | [`Extents`](../extents.md) | C++26 | +| `index_type` | [`Extents::index_type`](../extents.md) | C++26 | +| `size_type` | [`Extents::size_type`](../extents.md) | C++26 | +| `rank_type` | [`Extents::rank_type`](../extents.md) | C++26 | +| `layout_type` | [`layout_right_padded`](../layout_right_padded.md)`` | C++26 | + + +## 非メンバ(*Hidden friends*)関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`submdspan_mapping`](mapping/submdspan_mapping.md.nolink) | [`submdspan`](../submdspan.md)サポート | C++26 | + +### 比較演算子 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`operator==`](mapping/op_equal.md.nolink) | 等値比較 | C++26 | +| [`operator!=`](mapping/op_equal.md.nolink) | 非等値比較 (`==`により使用可能) | C++26 | + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`mdspan`](../mdspan.md) +- [`submdspan`](../submdspan.md) + + +## 参照 +- [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) diff --git a/reference/mdspan/layout_stride/mapping/op_constructor.md b/reference/mdspan/layout_stride/mapping/op_constructor.md index 78c153acb1..0265e92351 100644 --- a/reference/mdspan/layout_stride/mapping/op_constructor.md +++ b/reference/mdspan/layout_stride/mapping/op_constructor.md @@ -78,16 +78,27 @@ constexpr bool is-mapping-of = // exposition only - (5) : `explicit`指定子の式は以下と等価 ```cpp +// C++23 !(is_convertible_v && (is-mapping-of || is-mapping-of || is-mapping-of)) + +// C++26 +!(is_convertible_v && + (is-mapping-of || + is-mapping-of || + is-layout-left-padded-mapping-of || + is-layout-right-padded-mapping-of || + is-mapping-of)) ``` * is_convertible_v[link /reference/type_traits/is_convertible.md] * is-mapping-of[italic] * layout_left[link ../../layout_left.md] * layout_right[link ../../layout_right.md] * layout_stride[link ../../layout_stride.md] +* is-layout-left-padded-mapping-of[link ../../is-layout-left-padded-mapping-of.md] +* is-layout-right-padded-mapping-of[link ../../is-layout-right-padded-mapping-of.md] ## 例 @@ -158,9 +169,11 @@ int main() ## 関連項目 - [`layout_left::mapping`](../../layout_left/mapping.md) -- [`layout_stride::mapping`](../../layout_stride/mapping.md) +- [`layout_right::mapping`](../../layout_right/mapping.md) ## 参照 - [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) - [P2763R1 `layout_stride` static extents default constructor fix](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2763r1.html) +- [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) + - C++26でオーバーロード(5)のexplicit条件に[`layout_left_padded`](../../layout_left_padded.md), [`layout_right_padded`](../../layout_right_padded.md)対応が追加された。 From e88b8d541bd25d302fadf0b1c658521f72731c51 Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 29 Jul 2024 15:21:10 +0900 Subject: [PATCH 1102/3948] =?UTF-8?q?=20mdspan/layout=5F{left,right}=5Fpad?= =?UTF-8?q?ded/mapping:=20=E3=82=B3=E3=83=B3=E3=82=B9=E3=83=88=E3=83=A9?= =?UTF-8?q?=E3=82=AF=E3=82=BF=20P2642R6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../layout_left/mapping/op_constructor.md | 7 +++--- .../layout_right/mapping/op_constructor.md | 24 ++++++++++++++++++- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/reference/mdspan/layout_left/mapping/op_constructor.md b/reference/mdspan/layout_left/mapping/op_constructor.md index e76ad02e4f..d2a2497d27 100644 --- a/reference/mdspan/layout_left/mapping/op_constructor.md +++ b/reference/mdspan/layout_left/mapping/op_constructor.md @@ -56,17 +56,16 @@ constexpr explicit(extents_type::rank() > 0) ## 適格要件 -- (7) : 以下を満たすとき、`extents_type::`[`static_extent`](../../extents/static_extent.md)`(0)`が`LayoutLeftPaddedMapping::padding_stride`の倍数であること。 +- (7) : 以下を満たすとき、`extents_type::`[`static_extent`](../../extents/static_extent.md)`(0)`が[`LayoutLeftPaddedMapping::static-padding-stride`](../../layout_left_padded/mapping.md)に等しいこと。 - `extents_type::`[`rank()`](../../extents/rank.md) `> 1`、かつ - `extents_type::`[`static_extent`](../../extents/static_extent.md)`(0)`が[`dynamic_extent`](/reference/span/dynamic_extent.md)と等しくなく、かつ - - `LayoutLeftPaddedMapping::extents_type::`[`static_extent`](../../extents/static_extent.md)`(0)`が[`dynamic_extent`](/reference/span/dynamic_extent.md)と等しくなく、かつ - - `LayoutLeftPaddedMapping::padding_stride`が[`dynamic_extent`](/reference/span/dynamic_extent.md)と等しくないこと。 + - `LayoutLeftPaddedMapping::static-padding-stride`が[`dynamic_extent`](/reference/span/dynamic_extent.md)と等しくないとき。 ## 事前条件 - (3) : `e`の多次元インデクス空間のサイズを、`index_type`型で表現できること。 - (4) : `other.`[`required_span_size()`](required_span_size.md)を、`index_type`型で表現できること。 -- (5) : `other.`[`required_span_size()`](../../layout_left/mapping/required_span_size.md)を、`index_type`型で表現できること。 +- (5) : `other.`[`required_span_size()`](../../layout_right/mapping/required_span_size.md)を、`index_type`型で表現できること。 - (6) : - `extents_type::`[`rank()`](../../extents/rank.md) `> 0`のとき、`other`における全次元のストライド幅が[`layout_left::mapping`相当の制約](stride.md)をもつこと。 - `other.`[`required_span_size()`](../../layout_stride/mapping/required_span_size.md)を、`index_type`型で表現できること。 diff --git a/reference/mdspan/layout_right/mapping/op_constructor.md b/reference/mdspan/layout_right/mapping/op_constructor.md index abf8a40341..f226bf47fb 100644 --- a/reference/mdspan/layout_right/mapping/op_constructor.md +++ b/reference/mdspan/layout_right/mapping/op_constructor.md @@ -20,6 +20,10 @@ template constexpr explicit(!is_convertible_v) mapping(const layout_left::mapping& other) noexcept; // (5) +template +constexpr explicit(!is_convertible_v) + mapping(const LayoutRightPaddedMapping&) noexcept; // (7) C++26 + template constexpr explicit(extents_type::rank() > 0) mapping(const layout_stride::mapping& other) noexcept; // (6) @@ -27,6 +31,7 @@ constexpr explicit(extents_type::rank() > 0) * is_convertible_v[link /reference/type_traits/is_convertible.md] * rank()[link ../../extents/rank.md] * layout_left::mapping[link ../../layout_left/mapping.md] +* LayoutRightPaddedMapping[link ../../layout_right_padded/mapping.md] * layout_stride::mapping[link ../../layout_stride/mapping.md] ## 概要 @@ -36,6 +41,7 @@ constexpr explicit(extents_type::rank() > 0) - (4) : 他`layout_right::mapping`からの変換コンストラクタ - (5) : [`layout_left::mapping`](../../layout_left/mapping.md)からの変換コンストラクタ - (6) : [`layout_stride::mapping`](../../layout_stride/mapping.md)からの変換コンストラクタ +- (7) : [`layout_right_padded::mapping`](../../layout_right_padded/mapping.md)からの変換コンストラクタ ## テンプレートパラメータ制約 @@ -44,6 +50,16 @@ constexpr explicit(extents_type::rank() > 0) - `extents_type::`[`rank()`](../../extents/rank.md) `<= 1`、かつ - [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true`であること。 - (6) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true`であること。 +- (7) : + - [`is-layout-right-padded-mapping-of`](../../is-layout-right-padded-mapping-of.md)``が`true`、かつ + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true`であること。 + + +## 適格要件 +- (7) : 以下を満たすとき、`extents_type::`[`static_extent`](../../extents/static_extent.md)`(`[`Extents::rank()`](../../extents/rank.md) `- 1)`が[`LayoutRightPaddedMapping::static-padding-stride`](../../layout_right_padded/mapping.md)に等しいこと。 + - `extents_type::`[`rank()`](../../extents/rank.md) `> 1`、かつ + - `extents_type::`[`static_extent`](../../extents/static_extent.md)`(Extents::rank() - 1)`が[`dynamic_extent`](/reference/span/dynamic_extent.md)と等しくなく、かつ + - `LayoutRightPaddedMapping::static-padding-stride`が[`dynamic_extent`](/reference/span/dynamic_extent.md)と等しくないとき。 ## 事前条件 @@ -53,11 +69,14 @@ constexpr explicit(extents_type::rank() > 0) - (6) : - `extents_type::`[`rank()`](../../extents/rank.md) `> 0`のとき、`other`における全次元のストライド幅が[`layout_right::mapping`相当の制約](stride.md)をもつこと。 - `other.`[`required_span_size()`](../../layout_stride/mapping/required_span_size.md)を、`index_type`型で表現できること。 +- (7) : + - `extents_type::`[`rank()`](../../extents/rank.md) `> 1`のとき、`other.stride(extents_type::rank() - 2) == other.extents().extent(extents_type::rank() - 1)` + - `other.`[`required_span_size()`](../../layout_right_padded/mapping/required_span_size.md.nolink)を、`index_type`型で表現できること。 ## 効果 - (3) : `e`を用いて`extents_`を直接非リスト初期化する。 -- (4), (5), (6) : `other.extents()`を用いて`extents_`を直接非リスト初期化する。 +- (4), (5), (6), (7) : `other.extents()`を用いて`extents_`を直接非リスト初期化する。 ## 例外 @@ -67,6 +86,7 @@ constexpr explicit(extents_type::rank() > 0) ## explicitになる条件 - (4), (5) : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`` - (6) : [`extents_type::rank()`](../../extents/rank.md) `> 0` +- (7) : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`` ## 例 @@ -143,7 +163,9 @@ int main() ## 関連項目 - [`layout_left::mapping`](../../layout_left/mapping.md) - [`layout_stride::mapping`](../../layout_stride/mapping.md) +- [`layout_right_padded::mapping`](../../layout_right_padded/mapping.md) ## 参照 - [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) +- [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) From 2276b3aaac29f6f532e7ffafc0d3d80204651158 Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 29 Jul 2024 22:39:29 +0900 Subject: [PATCH 1103/3948] mdspan/layout_*_padded/mapping: submdspan_mapping P2642R6 --- .../layout_left/mapping/submdspan_mapping.md | 14 ++- .../mdspan/layout_left_padded/mapping.md | 2 +- .../mapping/submdspan_mapping.md | 99 +++++++++++++++++++ .../layout_right/mapping/submdspan_mapping.md | 14 ++- .../mdspan/layout_right_padded/mapping.md | 2 +- .../mapping/submdspan_mapping.md | 99 +++++++++++++++++++ .../mapping/submdspan_mapping.md | 4 +- 7 files changed, 226 insertions(+), 8 deletions(-) create mode 100644 reference/mdspan/layout_left_padded/mapping/submdspan_mapping.md create mode 100644 reference/mdspan/layout_right_padded/mapping/submdspan_mapping.md diff --git a/reference/mdspan/layout_left/mapping/submdspan_mapping.md b/reference/mdspan/layout_left/mapping/submdspan_mapping.md index 874fe9b30d..ed45bc3373 100644 --- a/reference/mdspan/layout_left/mapping/submdspan_mapping.md +++ b/reference/mdspan/layout_left/mapping/submdspan_mapping.md @@ -3,7 +3,7 @@ * function template[meta id-type] * std[meta namespace] * layout_left::mapping[meta class] -* cpp23[meta cpp] +* cpp26[meta cpp] ```cpp template @@ -62,15 +62,24 @@ friend constexpr auto submdspan_mapping( 説明専用の`submdspan-mapping-impl`関数テンプレートは下記の値を返す。 - [`Extents::rank()`](../../extents/rank.md) `== 0`のとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{*this, 0}` +- `SubExtents::rank() == 0`のとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_left::mapping`](../../layout_left.md)`(sub_ext), offset}` - 以下を満たすとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_left::mapping`](../../layout_left.md)`(sub_ext), offset}` - 半開区間`[0, SubExtents::rank()-1)`の値`k`に対して、[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true`、かつ - `SubExtents::rank()-1`に等しい値`k`に対して、型`S_k`が[`index-pair-like`](../../index-pair-like.md)``のモデルもしくは[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` +- 以下を満たすとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_left_padded::mapping`](../../layout_left_padded/mapping.md)`(sub_ext, stride(u + 1)), offset}` + - 型`S_p`が[`index-pair-like`](../../index-pair-like.md)``のモデルもしくは[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true`を満たす`0`より大きい最小値`p`に対して、`u+1`が`p`となる値`u`を用いて + - 型`S_0`が[`index-pair-like`](../../index-pair-like.md)``のモデルもしくは[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true`、かつ + - 半開区間`[u+1, u+SubExtents::rank()-1)`の値`k`に対して、[`is_convertible_v`](/reference/type_traits/is_convertible.md)``、かつ + - `u+SubExtents::rank()-1`に等しい値`k`に対して、型`S_k`が[`index-pair-like`](../../index-pair-like.md)``のモデルもしくは[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` + - ここで定数`S_static`は + - 半開区間`[0, u+1)`のいずれかの値`k`に対して`static_extent(k)`が[`dynamic_extent`](/reference/span/dynamic_extent.md)のとき、`dynamic_extent` + - そうでなければ、半開区間`[0, u+1)`の全ての値`k`に対して`static_extent(k)`を乗算した値 - [`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_stride::mapping`](../../layout_stride.md)`(sub_ext, sub_strides), offset}` ## バージョン ### 言語 -- C++23 +- C++26 ### 処理系 - [Clang](/implementation.md#clang): ?? @@ -85,3 +94,4 @@ friend constexpr auto submdspan_mapping( ## 参照 - [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) +- [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) diff --git a/reference/mdspan/layout_left_padded/mapping.md b/reference/mdspan/layout_left_padded/mapping.md index b561c74a8b..02c167755e 100644 --- a/reference/mdspan/layout_left_padded/mapping.md +++ b/reference/mdspan/layout_left_padded/mapping.md @@ -97,7 +97,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`submdspan_mapping`](mapping/submdspan_mapping.md.nolink) | [`submdspan`](../submdspan.md)サポート | C++26 | +| [`submdspan_mapping`](mapping/submdspan_mapping.md) | [`submdspan`](../submdspan.md)サポート | C++26 | ### 比較演算子 diff --git a/reference/mdspan/layout_left_padded/mapping/submdspan_mapping.md b/reference/mdspan/layout_left_padded/mapping/submdspan_mapping.md new file mode 100644 index 0000000000..6eeeb0f2eb --- /dev/null +++ b/reference/mdspan/layout_left_padded/mapping/submdspan_mapping.md @@ -0,0 +1,99 @@ +# submdspan_mapping +* mdspan[meta header] +* function template[meta id-type] +* std[meta namespace] +* layout_left_padded::mapping[meta class] +* cpp26[meta cpp] + +```cpp +template +constexpr auto submdspan-mapping-impl( // exposition only + SliceSpecifiers ... slices) const -> see below; + +template +friend constexpr auto submdspan_mapping( + const mapping& src, SliceSpecifiers... slices) +{ + return src.submdspan-mapping-impl(slices...); +} +``` +* see below[italic] +* submdspan-mapping-impl[italic] + +## 概要 +[`submdspan`](../../submdspan.md)関数をサポートするためのカスタマイゼーションポイント。 + +説明用の型`index_type`を[`Extents::index_type`](../../extents.md)、型`S_k`を`SliceSpecifiers`の`k`番目の型とする。 + + +## テンプレートパラメータ制約 +`sizeof...(slices)`が[`Extents::rank()`](../../extents/rank.md)と等しいこと。 + + +## 適格要件 +`extents()`の各次元インデクス`k`において、下記いずれかのうち1つだけを満たすこと。 + +- 型`S_k`が[`convertible_to`](/reference/concepts/convertible_to.md)``のモデル +- 型`S_k`が[`index-pair-like`](../../index-pair-like.md)``のモデル +- [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` +- 型`S_k`が[`strided_slice`](../../strided_slice.md)の特殊化 + + +## 事前条件 +`extents()`の各次元インデクス`k`において、`s_k`を`slices`の`k`番目の値としたとき、下記を全て満たすこと。 + +- 型`S_k`が[`strided_slice`](../../strided_slice.md)の特殊化のとき + - `s_k.extent == 0`、または + - `s_k.stride > 0` +- `0` ≤ [`first_`](../../first_.md)`(slices...)` ≤ [`last_`](../../last_.md)`(extents(), slices...)` ≤ `extents().`[`extent(k)`](../../extents/extent.md) + + +## 戻り値 +説明用の値や型を次の通り定義する。 + +- 値`sub_ext` : 式[`submdspan_extents`](../../submdspan_extents.md)`(extents(), slices...)`の結果 +- 型`SubExtents` : `decltype(sub_ext)` +- 値`sub_strides` : `extents()`の各次元インデクス`k`において、[`map-rank[k]`](../../submdspan_extents.md)が[`dynamic_extent`](/reference/span/dynamic_extent.md)ではない`k`に対し`sub_strides[map-rank[k]]`が下記を満たす、[`array`](/reference/array/array.md)``型の配列値 + - 型`S_k`が[`strided_slice`](../../strided_slice.md)の特殊化かつ`s_k.stride < s_k.extent`の場合、[`stride(k)`](stride.md.nolink) `*` [`de-ice`](../../de-ice.md)`(s_k.stride)` + - そうでなければ、[`stride(k)`](stride.md.nolink) +- パラメータパック`P` : [`is_same_v`](/reference/type_traits/is_same.md)`<`[`make_index_sequence`](/reference/utility/make_index_sequence.md)`,` [`index_sequence`](/reference/utility/index_sequence.md)`> == true` +- 値`offset` : `size_t`型の値[`(*this)`](op_call.md.nolink)`(`[`first_`](../../first_.md)`(slices...)...)` + +説明専用の`submdspan-mapping-impl`関数テンプレートは下記の値を返す。 + +- [`Extents::rank()`](../../extents/rank.md) `== 0`のとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{*this, 0}` +- 以下を満たすとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_left::mapping`](../../layout_left.md)`(sub_ext), offset}` + - `rank_ == 1`、または + - `SubExtents::rank() == 0` +- 以下を満たすとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_left::mapping`](../../layout_left.md)`(sub_ext), offset}` + - `SubExtents::rank() == 1`、かつ + - 型`S_0`が[`index-pair-like`](../../index-pair-like.md)``のモデルもしくは[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` +- 以下を満たすとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{layout_left_padded::mapping(sub_ext, stride(u + 1)), offset}` + - 型`S_p`が[`index-pair-like`](../../index-pair-like.md)``のモデルもしくは[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true`を満たす`0`より大きい最小値`p`に対して、`u+1`が`p`となる値`u`を用いて + - 型`S_0`が[`index-pair-like`](../../index-pair-like.md)``のモデルもしくは[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true`、かつ + - 半開区間`[u+1, u+SubExtents::rank()-1)`の値`k`に対して、[`is_convertible_v`](/reference/type_traits/is_convertible.md)``、かつ + - `u+SubExtents::rank()-1`に等しい値`k`に対して、型`S_k`が[`index-pair-like`](../../index-pair-like.md)``のモデルもしくは[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` + - ここで定数`S_static`は + - 半開区間`[0, u+1)`のいずれかの値`k`に対して`static_extent(k)`が[`dynamic_extent`](/reference/span/dynamic_extent.md)のとき、`dynamic_extent` + - そうでなければ、半開区間`[0, u+1)`の全ての値`k`に対して`static_extent(k)`を乗算した値 +- [`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_stride::mapping`](../../layout_stride.md)`(sub_ext, sub_strides), offset}` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`submdspan`](../../submdspan.md) + + +## 参照 +- [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) +- [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) diff --git a/reference/mdspan/layout_right/mapping/submdspan_mapping.md b/reference/mdspan/layout_right/mapping/submdspan_mapping.md index e7669a672d..3b7ba7f529 100644 --- a/reference/mdspan/layout_right/mapping/submdspan_mapping.md +++ b/reference/mdspan/layout_right/mapping/submdspan_mapping.md @@ -3,7 +3,7 @@ * function template[meta id-type] * std[meta namespace] * layout_right::mapping[meta class] -* cpp23[meta cpp] +* cpp26[meta cpp] ```cpp template @@ -62,15 +62,24 @@ friend constexpr auto submdspan_mapping( 説明専用の`submdspan-mapping-impl`関数テンプレートは下記の値を返す。 - [`Extents::rank()`](../../extents/rank.md) `== 0`のとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{*this, 0}` +- `SubExtents::rank() == 0`のとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_right::mapping`](../../layout_right.md)`(sub_ext), offset}` - 以下を満たすとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_right::mapping`](../../layout_right.md)`(sub_ext), offset}` - 半開区間`[Extents::rank() - SubExtents::rank()+1, Extents::rank())`の値`k`に対して、[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true`、かつ - `Extents::rank()-SubExtents::rank()`に等しい値`k`に対して、型`S_k`が[`index-pair-like`](../../index-pair-like.md)``のモデルもしくは[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` +- 以下を満たすとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_right_padded::mapping`](../../layout_right_padded/mapping.md)`(sub_ext, stride(rank_-u-2)), offset}` + - 型`S_p`が[`index-pair-like`](../../index-pair-like.md)``のモデルもしくは[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true`を満たす`rank_-1`より小さい最大値`p`に対して、`rank_-u-2`が`p`となる値`u`を用いて + - `rank_-1`に等しい値`k`に対して、型`S_k`が[`index-pair-like`](../../index-pair-like.md)``のモデルもしくは[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true`、かつ + - 半開区間`[rank_-SubExtents::rank()-u+1, rank_-u-1)`の値`k`に対して、[`is_convertible_v`](/reference/type_traits/is_convertible.md)``、かつ + - `rank_-SubExtents::rank()-u`に等しい値`k`に対して、型`S_k`が[`index-pair-like`](../../index-pair-like.md)``のモデルもしくは[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` + - ここで定数`S_static`は + - 半開区間`[rank_-u-1, rank_)`のいずれかの値`k`に対して`static_extent(k)`が[`dynamic_extent`](/reference/span/dynamic_extent.md)のとき、`dynamic_extent` + - そうでなければ、半開区間`[rank_-u-1, rank_)`の全ての値`k`に対して`static_extent(k)`を乗算した値 - [`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_stride::mapping`](../../layout_stride.md)`(sub_ext, sub_strides), offset}` ## バージョン ### 言語 -- C++23 +- C++26 ### 処理系 - [Clang](/implementation.md#clang): ?? @@ -85,3 +94,4 @@ friend constexpr auto submdspan_mapping( ## 参照 - [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) +- [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) diff --git a/reference/mdspan/layout_right_padded/mapping.md b/reference/mdspan/layout_right_padded/mapping.md index 1e8839d62a..f21b132737 100644 --- a/reference/mdspan/layout_right_padded/mapping.md +++ b/reference/mdspan/layout_right_padded/mapping.md @@ -97,7 +97,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`submdspan_mapping`](mapping/submdspan_mapping.md.nolink) | [`submdspan`](../submdspan.md)サポート | C++26 | +| [`submdspan_mapping`](mapping/submdspan_mapping.md) | [`submdspan`](../submdspan.md)サポート | C++26 | ### 比較演算子 diff --git a/reference/mdspan/layout_right_padded/mapping/submdspan_mapping.md b/reference/mdspan/layout_right_padded/mapping/submdspan_mapping.md new file mode 100644 index 0000000000..79c87a52eb --- /dev/null +++ b/reference/mdspan/layout_right_padded/mapping/submdspan_mapping.md @@ -0,0 +1,99 @@ +# submdspan_mapping +* mdspan[meta header] +* function template[meta id-type] +* std[meta namespace] +* layout_right_padded::mapping[meta class] +* cpp26[meta cpp] + +```cpp +template +constexpr auto submdspan-mapping-impl( // exposition only + SliceSpecifiers ... slices) const -> see below; + +template +friend constexpr auto submdspan_mapping( + const mapping& src, SliceSpecifiers... slices) +{ + return src.submdspan-mapping-impl(slices...); +} +``` +* see below[italic] +* submdspan-mapping-impl[italic] + +## 概要 +[`submdspan`](../../submdspan.md)関数をサポートするためのカスタマイゼーションポイント。 + +説明用の型`index_type`を[`Extents::index_type`](../../extents.md)、型`S_k`を`SliceSpecifiers`の`k`番目の型とする。 + + +## テンプレートパラメータ制約 +`sizeof...(slices)`が[`Extents::rank()`](../../extents/rank.md)と等しいこと。 + + +## 適格要件 +`extents()`の各次元インデクス`k`において、下記いずれかのうち1つだけを満たすこと。 + +- 型`S_k`が[`convertible_to`](/reference/concepts/convertible_to.md)``のモデル +- 型`S_k`が[`index-pair-like`](../../index-pair-like.md)``のモデル +- [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` +- 型`S_k`が[`strided_slice`](../../strided_slice.md)の特殊化 + + +## 事前条件 +`extents()`の各次元インデクス`k`において、`s_k`を`slices`の`k`番目の値としたとき、下記を全て満たすこと。 + +- 型`S_k`が[`strided_slice`](../../strided_slice.md)の特殊化のとき + - `s_k.extent == 0`、または + - `s_k.stride > 0` +- `0` ≤ [`first_`](../../first_.md)`(slices...)` ≤ [`last_`](../../last_.md)`(extents(), slices...)` ≤ `extents().`[`extent(k)`](../../extents/extent.md) + + +## 戻り値 +説明用の値や型を次の通り定義する。 + +- 値`sub_ext` : 式[`submdspan_extents`](../../submdspan_extents.md)`(extents(), slices...)`の結果 +- 型`SubExtents` : `decltype(sub_ext)` +- 値`sub_strides` : `extents()`の各次元インデクス`k`において、[`map-rank[k]`](../../submdspan_extents.md)が[`dynamic_extent`](/reference/span/dynamic_extent.md)ではない`k`に対し`sub_strides[map-rank[k]]`が下記を満たす、[`array`](/reference/array/array.md)``型の配列値 + - 型`S_k`が[`strided_slice`](../../strided_slice.md)の特殊化かつ`s_k.stride < s_k.extent`の場合、[`stride(k)`](stride.md.nolink) `*` [`de-ice`](../../de-ice.md)`(s_k.stride)` + - そうでなければ、[`stride(k)`](stride.md.nolink) +- パラメータパック`P` : [`is_same_v`](/reference/type_traits/is_same.md)`<`[`make_index_sequence`](/reference/utility/make_index_sequence.md)`,` [`index_sequence`](/reference/utility/index_sequence.md)`> == true` +- 値`offset` : `size_t`型の値[`(*this)`](op_call.md.nolink)`(`[`first_`](../../first_.md)`(slices...)...)` + +説明専用の`submdspan-mapping-impl`関数テンプレートは下記の値を返す。 + +- [`Extents::rank()`](../../extents/rank.md) `== 0`のとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{*this, 0}` +- 以下を満たすとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_right::mapping`](../../layout_right.md)`(sub_ext), offset}` + - `rank_ == 1`、または + - `SubExtents::rank() == 1` +- 以下を満たすとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_right::mapping`](../../layout_right.md)`(sub_ext), offset}` + - `SubExtents::rank() == 1`、かつ + - `rank_-1`に等しい値`k`に対して、型`S_k`が[`index-pair-like`](../../index-pair-like.md)``のモデルもしくは[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` +- 以下を満たすとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{layout_right_padded::mapping(sub_ext, stride(rank_-u-2)), offset}` + - 型`S_p`が[`index-pair-like`](../../index-pair-like.md)``のモデルもしくは[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true`を満たす`rank_-1`より小さい最大値`p`に対して、`rank_-u-2`が`p`となる値`u`を用いて + - `rank_-1`に等しい値`k`に対して、型`S_k`が[`index-pair-like`](../../index-pair-like.md)``のモデルもしくは[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true`、かつ + - 半開区間`[rank_-SubExtents::rank()-u+1, rank_-u-1)`の値`k`に対して、[`is_convertible_v`](/reference/type_traits/is_convertible.md)``、かつ + - `rank_-SubExtents::rank()-u`に等しい値`k`に対して、型`S_k`が[`index-pair-like`](../../index-pair-like.md)``のモデルもしくは[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` + - ここで定数`S_static`は + - 半開区間`[rank_-u-1, rank_-1)`のいずれかの値`k`に対して`static_extent(k)`が[`dynamic_extent`](/reference/span/dynamic_extent.md)のとき、`dynamic_extent` + - そうでなければ、半開区間`[rank_-u-1, rank_-1)`の全ての値`k`に対して`static_extent(k)`を乗算した値 +- [`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_stride::mapping`](../../layout_stride.md)`(sub_ext, sub_strides), offset}` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`submdspan`](../../submdspan.md) + + +## 参照 +- [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) +- [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) diff --git a/reference/mdspan/layout_stride/mapping/submdspan_mapping.md b/reference/mdspan/layout_stride/mapping/submdspan_mapping.md index d66c72281e..de042c4ed0 100644 --- a/reference/mdspan/layout_stride/mapping/submdspan_mapping.md +++ b/reference/mdspan/layout_stride/mapping/submdspan_mapping.md @@ -3,7 +3,7 @@ * function template[meta id-type] * std[meta namespace] * layout_stride::mapping[meta class] -* cpp23[meta cpp] +* cpp26[meta cpp] ```cpp template @@ -67,7 +67,7 @@ friend constexpr auto submdspan_mapping( ## バージョン ### 言語 -- C++23 +- C++26 ### 処理系 - [Clang](/implementation.md#clang): ?? From b99990944028dbc45a61ff1f2238f17e71538c1b Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 31 Jul 2024 13:45:02 +0900 Subject: [PATCH 1104/3948] =?UTF-8?q?C++26=E3=81=AEWorking=20Draft?= =?UTF-8?q?=E3=82=92=E6=9B=B4=E6=96=B0=20#1300?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- international-standard.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/international-standard.md b/international-standard.md index 25111dfebd..7e0c2d822e 100644 --- a/international-standard.md +++ b/international-standard.md @@ -12,7 +12,7 @@ C++ の標準規格は、他にも各国の規格化団体によって国際標 | 通称†1 | 名称 | 参照する規格案†2 | 規格案・原案 | `__cplusplus` | |:--|:--|:--|:--|:--| -| [C++26](lang/cpp26.md) (C++2c) | ISO/IEC 14882:2026 (予定) | N4981([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/n4981.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/)) | N4981 N4971 N4964 N4958 | -- | +| [C++26](lang/cpp26.md) (C++2c) | ISO/IEC 14882:2026 (予定) | N4986([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/n4986.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/)) | N4986 N4981 N4971 N4964 N4958 | -- | | [C++23](lang/cpp23.md) (C++2b) | ISO/IEC 14882:2023 (予定) | N4950([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4950.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4950/)) | N4950 N4944 N4928 N4917 N4910 N4901 N4892 N4885 N4878
N4868 N4861 | `202302L` | | [C++20](lang/cpp20.md) (C++2a) | ISO/IEC 14882:2020 | N4861†3([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/n4861.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4861/)) | N4860 N4849 N4842 N4835 N4830
N4820 N4810 N4800 N4791 N4788†4
N4778 N4762 N4750 N4741 N4727
N4713 N4700 N4687 | `202002L` | | [C++17](lang/cpp17.md) (C++1z) | ISO/IEC 14882:2017 | N4659([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4659.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4659/)) | N4660 N4659 N4640 N4618 N4606
N4594 N4582 N4567 N4527 N4431
N4296 | `201703L` | From e77f89c3b9f5d3ed9e9e16b202061340c1d88842 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 31 Jul 2024 14:19:00 +0900 Subject: [PATCH 1105/3948] =?UTF-8?q?C++26=20:=202024-07=20mailing?= =?UTF-8?q?=E3=81=A7=E6=8E=A1=E6=8A=9E=E3=81=95=E3=82=8C=E3=81=9F=E8=A8=80?= =?UTF-8?q?=E8=AA=9E=E6=A9=9F=E8=83=BD=E3=82=92=E8=A8=98=E8=BC=89=20#1300?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 5 +++++ lang/cpp26.md | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/implementation-status.md b/implementation-status.md index 186f123efd..e558bb61f2 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -301,6 +301,11 @@ | P2558R2: [基本文字集合に@、$、\`を追加](/lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md.nolink) | C言語との互換性のためにこれらの文字を基本文字集合に追加 | | Yes | | | | P2662R3: [パラメータパックへのインデックスアクセスを許可](/lang/cpp26/pack_indexing.md.nolink) | 可変引数テンプレートのパラメータパックに添字アクセスできるようにする | | | | | | P2864R2: [非推奨となっていた列挙値から算術型への暗黙変換を削除](/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md.nolink) | C++20から非推奨となっていた列挙値への算術演算で算術型に暗黙変換される仕様を削除 | 14 | 18 | | | +| [`constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md.nolink) | 定数式の文脈での配置`new`を許可 | | | | | +| [不完全型へのポインタに対する`delete`を不適格とする](/lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md.nolink) | 未定義動作となる操作をコンパイルエラーとする | 15 | 19 | | | +| [制約式内での畳み込み式の順序付け](/lang/cpp26/ordering_of_constraints_involving_fold_expressions.md.nolink) | 畳み込み式では全体ではなく個別の制約を原子制約式として扱う | | 19 | | | +| [条件式での構造化束縛の使用を許可](/lang/cpp26/structured_binding_declaration_as_a_condition.md.nolink) | 式全体を`bool`値に変換できる場合に条件式で構造化束縛を使用できることとする | 15 | | | | + 各処理系のC++26実装状況ページ: diff --git a/lang/cpp26.md b/lang/cpp26.md index 2f317aa4f5..1665313eb2 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -14,6 +14,8 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | [`std::initializer_list`の配列を静的ストレージに配置する](/lang/cpp26/static_storage_for_braced_initializers.md.nolink) | `std::vector v = {1, 2, 3};`のような初期化で初期化子リストを静的ストレージに配置することで無駄なコピーをなくす | | [宣言のみで使用しない変数の名前として`_`をサポート](/lang/cpp26/nice_placeholder_with_no_name.md.nolink) | 変数名`_`は暗黙で`[[maybe_unused]]`が指定される | | [非推奨となっていた列挙値から算術型への暗黙変換を削除](/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md.nolink) | C++20から非推奨となっていた列挙値への算術演算で算術型に暗黙変換される仕様を削除 | +| [不完全型へのポインタに対する`delete`を不適格とする](/lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md.nolink) | 未定義動作となる操作をコンパイルエラーとする | +| [条件式での構造化束縛の使用を許可](/lang/cpp26/structured_binding_declaration_as_a_condition.md.nolink) | 式全体を`bool`値に変換できる場合に条件式で構造化束縛を使用できることとする | ### 文字列 @@ -36,6 +38,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| | [パラメータパックへのインデックスアクセスを許可](/lang/cpp26/pack_indexing.md.nolink) | 可変引数テンプレートのパラメータパックに添字アクセスできるようにする | +| [制約式内での畳み込み式の順序付け](/lang/cpp26/ordering_of_constraints_involving_fold_expressions.md.nolink) | 畳み込み式では全体ではなく個別の制約を原子制約式として扱う | ### 定数式 @@ -44,6 +47,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 |----------|------| | [定数式での`void*`からポインタ型へのキャストを許可](/lang/cpp26/constexpr_cast_from_voidptr.md.nolink) | 型消去のために`void*`からポインタ型へのキャストを許可する | | [`static_assert`の診断メッセージにユーザーが生成した文字列の指定を許可](/lang/cpp26/user-generated_static_assert_messages.md) | `constexpr`な`S.size()`と`S.data()`メンバ関数をもつオブジェクトをコンパイル時文字列として指定できるようにする | +| [`constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md.nolink) | 定数式の文脈での配置`new`を許可 | ### ソースコード From 8f3061ef54c99eeda02136b4fbea6f3080394e02 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 31 Jul 2024 14:22:32 +0900 Subject: [PATCH 1106/3948] =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=83=91=E3=82=A4?= =?UTF-8?q?=E3=83=A9=E3=81=AE=E5=AE=9F=E8=A3=85=E7=8A=B6=E6=B3=81=20:=20?= =?UTF-8?q?=E6=8F=90=E6=A1=88=E6=9B=B8=E7=95=AA=E5=8F=B7=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=20#1300?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/implementation-status.md b/implementation-status.md index e558bb61f2..b54d347f7d 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -301,10 +301,10 @@ | P2558R2: [基本文字集合に@、$、\`を追加](/lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md.nolink) | C言語との互換性のためにこれらの文字を基本文字集合に追加 | | Yes | | | | P2662R3: [パラメータパックへのインデックスアクセスを許可](/lang/cpp26/pack_indexing.md.nolink) | 可変引数テンプレートのパラメータパックに添字アクセスできるようにする | | | | | | P2864R2: [非推奨となっていた列挙値から算術型への暗黙変換を削除](/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md.nolink) | C++20から非推奨となっていた列挙値への算術演算で算術型に暗黙変換される仕様を削除 | 14 | 18 | | | -| [`constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md.nolink) | 定数式の文脈での配置`new`を許可 | | | | | -| [不完全型へのポインタに対する`delete`を不適格とする](/lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md.nolink) | 未定義動作となる操作をコンパイルエラーとする | 15 | 19 | | | -| [制約式内での畳み込み式の順序付け](/lang/cpp26/ordering_of_constraints_involving_fold_expressions.md.nolink) | 畳み込み式では全体ではなく個別の制約を原子制約式として扱う | | 19 | | | -| [条件式での構造化束縛の使用を許可](/lang/cpp26/structured_binding_declaration_as_a_condition.md.nolink) | 式全体を`bool`値に変換できる場合に条件式で構造化束縛を使用できることとする | 15 | | | | +| P2747R2: [`constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md.nolink) | 定数式の文脈での配置`new`を許可 | | | | | +| P3144R2: [不完全型へのポインタに対する`delete`を不適格とする](/lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md.nolink) | 未定義動作となる操作をコンパイルエラーとする | 15 | 19 | | | +| P2963R3: [制約式内での畳み込み式の順序付け](/lang/cpp26/ordering_of_constraints_involving_fold_expressions.md.nolink) | 畳み込み式では全体ではなく個別の制約を原子制約式として扱う | | 19 | | | +| P0963R3: [条件式での構造化束縛の使用を許可](/lang/cpp26/structured_binding_declaration_as_a_condition.md.nolink) | 式全体を`bool`値に変換できる場合に条件式で構造化束縛を使用できることとする | 15 | | | | 各処理系のC++26実装状況ページ: From 8648954466784094e6536912367ad4d3d2414021 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 31 Jul 2024 15:07:47 +0900 Subject: [PATCH 1107/3948] =?UTF-8?q?C++26:=202024-07=20mailing=E3=81=A7?= =?UTF-8?q?=E6=8E=A1=E6=8A=9E=E3=81=95=E3=82=8C=E3=81=9F=E3=83=A9=E3=82=A4?= =?UTF-8?q?=E3=83=96=E3=83=A9=E3=83=AA=E6=A9=9F=E8=83=BD=E3=82=92=E8=A8=98?= =?UTF-8?q?=E8=BC=89=20#1300?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 26 ++++++++++++++++++++++++-- reference.md | 3 ++- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/lang/cpp26.md b/lang/cpp26.md index 1665313eb2..dac1c342c7 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -64,10 +64,12 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - 並行処理において参照中のデータが更新されないよう保護するハザードポインタのライブラリとして、[``](/reference/hazard_pointer.md.nolink)を追加 - デバッグサポートのライブラリとして[``](/reference/debugging.md.nolink)を追加 - 線形代数ライブラリとして[``](/reference/linalg.md)を追加 +- コンパイル時に容量を固定する可変長配列クラスのライブラリとして[``](/reference/inplace_vector.md.nolink)を追加 ### コンテナ - [`std::mdspan`](/reference/mdspan/mdspan.md)から部分ビューを取り出す[`std::submdspan()`](/reference/mdspan/submdspan.md)を追加 +- [`std::mdspan`](/reference/mdspan/mdspan.md)に対する[`std::dextents`](/reference/mdspan/extents.md)指定の冗長さを解決する[`std::dims`](/reference/mdspan/extents.md)を追加 - [`std::span`](/reference/span/span.md)に、以下を追加 - [`std::initializer_list`](/reference/initializer_list/initializer_list.md)をとるコンストラクタ - インデックスアクセスのための[`at()`](/reference/span/span/at.md)メンバ関数 @@ -100,6 +102,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [`std::stable_partition()`](/reference/algorithm/stable_partition.md) / [`std::ranges::stable_partition()`](/reference/algorithm/ranges_stable_partition.md) - [`std::inplace_merge()`](/reference/algorithm/inplace_merge.md) / [`std::ranges::inplace_merge()`](/reference/algorithm/ranges_inplace_merge.md) - Rangeアルゴリズムが完全型を要求しないようにするため、[`std::projected`](/reference/iterator/projected.md)の制約を緩和 +- [`std::ranges::find_last()`](/reference/algorithm/ranges_find_last.md)に検索対象の値を波カッコ初期化で渡せるよう制約を追加 ### 関数オブジェクト @@ -117,6 +120,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - ポインタ出力のサポートを追加 - 幅と精度を動的に指定した場合でも型の検証がコンパイル時に行われるよう仕様を見直し - コンパイル時の書式文字列だけでなく、実行時の書式文字列を渡せるよう仕様修正 +- 文字列フォーマットをより高速にできる最適化が可能か判定する[`std::enable_nonlocking_formatter_optimization`](/reference/format/enable_nonlocking_formatter_optimization.md.nolink)を追加 ### ファイル @@ -225,6 +229,13 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 ### ユーティリティ - [`std::variant`](/reference/variant/variant.md)クラスに、メンバ関数版の[`visit()`](/reference/variant/variant/visit.md.nolink)を追加 +- [`std::optional`](/reference/optional/optional.md)クラスに、0もしくは1要素のRangeとして扱えるようにするための拡張として、イテレータインタフェースを追加 + - `iterator`型 + - `const_iterator`型 + - [`begin()`](/reference/optional/optional/begin.md.nolink)メンバ関数 + - [`end()`](/reference/optional/optional/end.md.nolink)メンバ関数 +- [`std::ignore`](/reference/tuple/ignore.html)をファーストクラス・オブジェクトとして型を詳細に定義 +- [`std::bitset`](/reference/bitset/bitset.md)に、[`std::basic_string_view`](/reference/string_view/basic_string_view.md)を受け取るコンストラクタを追加 - [``](/reference/ratio.md)に、新たなSI接頭辞として、以下を追加 - [`ronna`](/reference/ratio/si_prefix.md) (1027) - [`ronto`](/reference/ratio/si_prefix.md) (10−27) @@ -237,8 +248,19 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 ### 型特性 -- 共用体のどのメンバがアクティブかを判定するための関数として、[``](/reference/type_traits.md)に[`std::is_within_lifetime()`](/reference/type_traits/is_within_lifetime.md.nolink)を追加 -- [`std::bitset`](/reference/bitset/bitset.md)に、[`std::basic_string_view`](/reference/string_view/basic_string_view.md)を受け取るコンストラクタを追加 +- [``](/reference/type_traits.md)に、共用体のどのメンバがアクティブかを判定するための関数として[`std::is_within_lifetime()`](/reference/type_traits/is_within_lifetime.md.nolink)を追加 +- [``](/reference/type_traits.md)に、仮想継承の関係を判定する[`std::is_virtual_base_of`](/reference/type_traits/is_virtual_base_of.md.nolink)を追加 + + +### 制約 +- 間接実行に関連する制約から、共通参照の要件を削除 + - [`std::indirectly_unary_invocable`](/reference/iterator/indirectly_unary_invocable.md) + - [`std::indirectly_regular_unary_invocable`](/reference/iterator/indirectly_regular_unary_invocable.md) + - [`std::indirect_unary_predicate`](/reference/iterator/indirect_unary_predicate.md) + - [`std::indirect_binary_predicate`](/reference/iterator/indirect_binary_predicate.md) + - [`std::indirect_equivalence_relation`](/reference/iterator/indirect_equivalence_relation.md) + - [`std::indirect_strict_weak_order`](/reference/iterator/indirect_strict_weak_order.md) + ### 機能の削除 - C++20から非推奨となっていた、[`std::basic_string`](/reference/string/basic_string.md)`::`[`reserve()`](/reference/string/basic_string/reserve.md)のパラメータなしのオーバーロードを削除 diff --git a/reference.md b/reference.md index 87e24640a4..7cf8ce99e3 100644 --- a/reference.md +++ b/reference.md @@ -106,7 +106,8 @@ | [``](/reference/list.md) | 双方向リスト | | | [``](/reference/queue.md) | FIFOキュー | | | [``](/reference/stack.md) | LIFOスタック | | -| [``](/reference/vector.md) | ベクタ配列 | | +| [``](/reference/vector.md) | 可変長配列 | | +| [``](/reference/inplace_vector.md.nolink) | 容量固定の可変長配列 | C++26 | | [``](/reference/map.md) | 順序付き連想配列 | | | [``](/reference/set.md) | 順序付き集合 | | | [``](/reference/flat_map.md) | ソート済みキーによる順序付き連想配列 | C++23 | From b9205d21c85fff18a29adb7812f45f9d968d6525 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 31 Jul 2024 15:11:19 +0900 Subject: [PATCH 1108/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=83=9F?= =?UTF-8?q?=E3=82=B9=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/cpp26.md b/lang/cpp26.md index dac1c342c7..c9889c97f3 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -234,7 +234,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - `const_iterator`型 - [`begin()`](/reference/optional/optional/begin.md.nolink)メンバ関数 - [`end()`](/reference/optional/optional/end.md.nolink)メンバ関数 -- [`std::ignore`](/reference/tuple/ignore.html)をファーストクラス・オブジェクトとして型を詳細に定義 +- [`std::ignore`](/reference/tuple/ignore.md)をファーストクラス・オブジェクトとして型を詳細に定義 - [`std::bitset`](/reference/bitset/bitset.md)に、[`std::basic_string_view`](/reference/string_view/basic_string_view.md)を受け取るコンストラクタを追加 - [``](/reference/ratio.md)に、新たなSI接頭辞として、以下を追加 - [`ronna`](/reference/ratio/si_prefix.md) (1027) @@ -255,7 +255,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 ### 制約 - 間接実行に関連する制約から、共通参照の要件を削除 - [`std::indirectly_unary_invocable`](/reference/iterator/indirectly_unary_invocable.md) - - [`std::indirectly_regular_unary_invocable`](/reference/iterator/indirectly_regular_unary_invocable.md) + - [`std::indirectly_regular_unary_invocable`](/reference/iterator/indirectly_unary_invocable.md) - [`std::indirect_unary_predicate`](/reference/iterator/indirect_unary_predicate.md) - [`std::indirect_binary_predicate`](/reference/iterator/indirect_binary_predicate.md) - [`std::indirect_equivalence_relation`](/reference/iterator/indirect_equivalence_relation.md) From f9276169a2dbcbd0140aca851fbed9a1cf01e4fa Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 1 Aug 2024 12:39:47 +0900 Subject: [PATCH 1109/3948] =?UTF-8?q?=E3=82=B9=E3=83=9D=E3=83=B3=E3=82=B5?= =?UTF-8?q?=E3=83=BC=E6=9B=B4=E6=96=B0=20#1316?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.md b/index.md index 3ca223fda7..1a7aaf57a4 100644 --- a/index.md +++ b/index.md @@ -109,6 +109,8 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい [sponsor name:有限会社テクニカルアーツ様, img:https://raw.githubusercontent.com/cpprefjp/image/master/sponsors/technical_arts/TechnicalArtsLogo3.png, link:https://www.techarts.co.jp/, size:400, fee:8, amount:12] +[sponsor name:T.Kishu様, fee:8, amount:12] + ### ブロンズスポンサー From e6c613a30cc405d8158180589095ac194d9cd948 Mon Sep 17 00:00:00 2001 From: Alt Date: Thu, 1 Aug 2024 14:40:12 +0900 Subject: [PATCH 1110/3948] =?UTF-8?q?ranges::contains=E3=81=AE=E5=AE=9F?= =?UTF-8?q?=E8=A3=85=E4=BE=8B=E3=81=8C=E3=82=B3=E3=83=B3=E3=83=91=E3=82=A4?= =?UTF-8?q?=E3=83=AB=E3=82=A8=E3=83=A9=E3=83=BC=E3=81=AA=E3=81=AE=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_contains.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/algorithm/ranges_contains.md b/reference/algorithm/ranges_contains.md index 014789cd91..be782ad089 100644 --- a/reference/algorithm/ranges_contains.md +++ b/reference/algorithm/ranges_contains.md @@ -70,7 +70,7 @@ struct contains_impl { template requires indirect_binary_predicate, Proj>, const T*> constexpr bool operator()(R&& r, const T& value, Proj proj = {}) const { - return ranges::find(std::forward(r), value, proj) != last; + return (*this)(begin(r), end(r), value, ref(proj)); } }; From edf8e82d9da74692041e4c661edd34bf629453b5 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 1 Aug 2024 22:36:38 +0900 Subject: [PATCH 1111/3948] =?UTF-8?q?=E3=82=B9=E3=83=9D=E3=83=B3=E3=82=B5?= =?UTF-8?q?=E3=83=BC=E6=9B=B4=E6=96=B0=20#1317?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.md b/index.md index 1a7aaf57a4..95664eb8e9 100644 --- a/index.md +++ b/index.md @@ -121,6 +121,8 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい [sponsor name:minachun / J.Minami様, img:https://raw.githubusercontent.com/minachun/minachun/main/banner.png, link:https://github.com/minachun/minachun, fee:5, amount:12, note:Junichirou Minami] +[sponsor name:USAMI Kenta, img:https://gravatar.com/userimage/33138763/7af48baae61cde116bd8d28a5158946e.jpeg?size=256, link:https://github.com/zonuexe, size:256, fee:5, amount:12] + [sponsor name:odan様, img:https://odan.dev/icon.jpeg, link:https://opencollective.com/odan, size:320, fee:50, amount:1] [sponsor name:unagi様, img:https://www.unagiworks.net/blog/wp-content/uploads/2019/01/logo.gif, fee:50, amount:1, period:2025-07-02] @@ -131,9 +133,9 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい [sponsor name:yukika2e様, img:https://raw.githubusercontent.com/cpprefjp/image/master/sponsors/yukika2e/yukika2e.png, fee:10, amount:1, period:2024-05-18] -[sponsor name:ugai様, link:https://opencollective.com/ugai, fee:5, amount:1, period:2025-02-06] +[sponsor name:Azaika様, img:https://raw.githubusercontent.com/cpprefjp/image/master/sponsors/Azaika/Azaika.jpg, fee:10, amount:1, size:256, period:2025-08-02] -[sponsor name:USAMI Kenta, img:https://gravatar.com/userimage/33138763/7af48baae61cde116bd8d28a5158946e.jpeg?size=256, link:https://github.com/zonuexe, size:256, fee:5, amount:12] +[sponsor name:ugai様, link:https://opencollective.com/ugai, fee:5, amount:1, period:2025-02-06] スポンサーシップについては、以下のページを参照ください。 From bbfb1bc06886eb8f838778397678028b05ae6795 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 2 Aug 2024 12:51:03 +0900 Subject: [PATCH 1112/3948] =?UTF-8?q?=E3=82=B9=E3=83=9D=E3=83=B3=E3=82=B5?= =?UTF-8?q?=E3=83=BC=E6=9B=B4=E6=96=B0=20#1318?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/index.md b/index.md index 95664eb8e9..6da1a6f478 100644 --- a/index.md +++ b/index.md @@ -115,15 +115,19 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい ### ブロンズスポンサー +[sponsor name:Azaika様, img:https://raw.githubusercontent.com/cpprefjp/image/master/sponsors/Azaika/Azaika.jpg, fee:10, amount:12, size:256] + [sponsor name:イシハラユウヤ様, fee:5, amount:12] [sponsor name:Megumi Nakagami様, link:https://opencollective.com/meg_nakagami, fee:5, amount:12] [sponsor name:minachun / J.Minami様, img:https://raw.githubusercontent.com/minachun/minachun/main/banner.png, link:https://github.com/minachun/minachun, fee:5, amount:12, note:Junichirou Minami] +[sponsor name:星くず彼方に, img:https://raw.githubusercontent.com/cpprefjp/image/master/sponsors/overthestardust/overthestardust.png, link:https://gravatar.com/overthestardust size:256, fee:5, amount:12] + [sponsor name:USAMI Kenta, img:https://gravatar.com/userimage/33138763/7af48baae61cde116bd8d28a5158946e.jpeg?size=256, link:https://github.com/zonuexe, size:256, fee:5, amount:12] -[sponsor name:odan様, img:https://odan.dev/icon.jpeg, link:https://opencollective.com/odan, size:320, fee:50, amount:1] +[sponsor name:odan様, img:https://odan.dev/icon.jpeg, link:https://opencollective.com/odan, size:320, fee:50, amount:1, period:2024-06-05] [sponsor name:unagi様, img:https://www.unagiworks.net/blog/wp-content/uploads/2019/01/logo.gif, fee:50, amount:1, period:2025-07-02] @@ -133,8 +137,6 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい [sponsor name:yukika2e様, img:https://raw.githubusercontent.com/cpprefjp/image/master/sponsors/yukika2e/yukika2e.png, fee:10, amount:1, period:2024-05-18] -[sponsor name:Azaika様, img:https://raw.githubusercontent.com/cpprefjp/image/master/sponsors/Azaika/Azaika.jpg, fee:10, amount:1, size:256, period:2025-08-02] - [sponsor name:ugai様, link:https://opencollective.com/ugai, fee:5, amount:1, period:2025-02-06] From b9076ff2a95411c8db4c198f23d685e2046ef833 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 2 Aug 2024 12:58:44 +0900 Subject: [PATCH 1113/3948] =?UTF-8?q?=E3=82=B9=E3=83=9D=E3=83=B3=E3=82=B5?= =?UTF-8?q?=E3=83=BC=E3=81=AE=E6=8C=87=E5=AE=9A=E3=83=9F=E3=82=B9=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.md b/index.md index 6da1a6f478..3fabb90965 100644 --- a/index.md +++ b/index.md @@ -123,7 +123,7 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい [sponsor name:minachun / J.Minami様, img:https://raw.githubusercontent.com/minachun/minachun/main/banner.png, link:https://github.com/minachun/minachun, fee:5, amount:12, note:Junichirou Minami] -[sponsor name:星くず彼方に, img:https://raw.githubusercontent.com/cpprefjp/image/master/sponsors/overthestardust/overthestardust.png, link:https://gravatar.com/overthestardust size:256, fee:5, amount:12] +[sponsor name:星くず彼方に, img:https://raw.githubusercontent.com/cpprefjp/image/master/sponsors/overthestardust/overthestardust.png, link:https://gravatar.com/overthestardust, size:256, fee:5, amount:12] [sponsor name:USAMI Kenta, img:https://gravatar.com/userimage/33138763/7af48baae61cde116bd8d28a5158946e.jpeg?size=256, link:https://github.com/zonuexe, size:256, fee:5, amount:12] From 3af3684cd64ce885a4345de479936f91afa79ad9 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 2 Aug 2024 13:41:43 +0900 Subject: [PATCH 1114/3948] =?UTF-8?q?stable=20sort=E9=96=A2=E4=BF=82=20:?= =?UTF-8?q?=20C++26=E3=81=A7=E3=81=AEconstexpr=E5=AF=BE=E5=BF=9C=20(close?= =?UTF-8?q?=20#1182)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/inplace_merge.md | 17 ++++++++++-- reference/algorithm/ranges_inplace_merge.md | 26 ++++++++++++++++--- .../algorithm/ranges_stable_partition.md | 20 ++++++++++++++ reference/algorithm/ranges_stable_sort.md | 20 ++++++++++++++ reference/algorithm/stable_partition.md | 7 +++++ reference/algorithm/stable_sort.md | 15 ++++++++++- 6 files changed, 99 insertions(+), 6 deletions(-) diff --git a/reference/algorithm/inplace_merge.md b/reference/algorithm/inplace_merge.md index 72932b0df1..2af32581f8 100644 --- a/reference/algorithm/inplace_merge.md +++ b/reference/algorithm/inplace_merge.md @@ -9,12 +9,23 @@ namespace std { void inplace_merge(BidirectionalIterator first, BidirectionalIterator middle, BidirectionalIterator last); // (1) C++03 + template + constexpr + void inplace_merge(BidirectionalIterator first, + BidirectionalIterator middle, + BidirectionalIterator last); // (1) C++26 template void inplace_merge(BidirectionalIterator first, BidirectionalIterator middle, BidirectionalIterator last, Compare comp); // (2) C++03 + template + constexpr + void inplace_merge(BidirectionalIterator first, + BidirectionalIterator middle, + BidirectionalIterator last, + Compare comp); // (2) C++26 template void inplace_merge(ExecutionPolicy&& exec, @@ -94,7 +105,9 @@ int main() ``` ## 実装例 -- [inplace_merge を読んでみた](http://www.kmonos.net/wlog/115.html#_2300101215) - +- [`inplace_merge` を読んでみた](http://www.kmonos.net/wlog/115.html#_2300101215) +## 参照 +- [P2562R1 `constexpr` Stable Sorting](https://open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2562r1.pdf) + - C++26から`constexpr`に対応した diff --git a/reference/algorithm/ranges_inplace_merge.md b/reference/algorithm/ranges_inplace_merge.md index 3b5b73f0cc..062a0e0a0f 100644 --- a/reference/algorithm/ranges_inplace_merge.md +++ b/reference/algorithm/ranges_inplace_merge.md @@ -17,6 +17,17 @@ namespace std::ranges { S last, Comp comp = {}, Proj proj = {}); // (1) C++20 + template S, + class Comp = ranges::less, + class Proj = identity> + requires sortable + constexpr I + inplace_merge(I first, + I middle, + S last, + Comp comp = {}, + Proj proj = {}); // (1) C++26 template middle, Comp comp = {}, Proj proj = {}); // (2) C++20 + template + requires sortable, Comp, Proj> + constexpr borrowed_iterator_t + inplace_merge(R&& r, + iterator_t middle, + Comp comp = {}, + Proj proj = {}); // (2) C++26 } ``` * bidirectional_iterator[link /reference/iterator/bidirectional_iterator.md] @@ -98,7 +118,7 @@ int main() ``` ## 実装例 -- [inplace_merge を読んでみた](http://www.kmonos.net/wlog/115.html#_2300101215) +- [`inplace_merge` を読んでみた](http://www.kmonos.net/wlog/115.html#_2300101215) ## バージョン ### 言語 @@ -112,5 +132,5 @@ int main() ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) - - +- [P2562R1 `constexpr` Stable Sorting](https://open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2562r1.pdf) + - C++26から`constexpr`に対応した diff --git a/reference/algorithm/ranges_stable_partition.md b/reference/algorithm/ranges_stable_partition.md index a2324e8770..5fd20f2956 100644 --- a/reference/algorithm/ranges_stable_partition.md +++ b/reference/algorithm/ranges_stable_partition.md @@ -16,6 +16,16 @@ namespace std::ranges { S last, Pred pred, Proj proj = {}); // (1) C++20 + template S, + class Proj = identity, + indirect_unary_predicate> Pred> + requires permutable + constexpr subrange + stable_partition(I first, + S last, + Pred pred, + Proj proj = {}); // (1) C++26 template , Proj>> Pred> + requires permutable> + constexpr borrowed_subrange_t + stable_partition(R&& r, + Pred pred, + Proj proj = {}); // (2) C++26 } ``` * bidirectional_iterator[link /reference/iterator/bidirectional_iterator.md] @@ -106,3 +124,5 @@ int main() ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P2562R1 `constexpr` Stable Sorting](https://open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2562r1.pdf) + - C++26から`constexpr`に対応した diff --git a/reference/algorithm/ranges_stable_sort.md b/reference/algorithm/ranges_stable_sort.md index e0c93a7f7e..bde206d5cd 100644 --- a/reference/algorithm/ranges_stable_sort.md +++ b/reference/algorithm/ranges_stable_sort.md @@ -16,6 +16,16 @@ namespace std::ranges { S last, Comp comp = {}, Proj proj = {}); // (1) C++20 + template S, + class Comp = ranges::less, + class Proj = identity> + requires sortable + constexpr I + stable_sort(I first, + S last, + Comp comp = {}, + Proj proj = {}); // (1) C++26 template + requires sortable, Comp, Proj> + constexpr borrowed_iterator_t + stable_sort(R&& r, + Comp comp = {}, + Proj proj = {}); // (2) C++26 } ``` * random_access_iterator[link /reference/iterator/random_access_iterator.md] @@ -96,3 +114,5 @@ int main() ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P2562R1 `constexpr` Stable Sorting](https://open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2562r1.pdf) + - C++26から`constexpr`に対応した diff --git a/reference/algorithm/stable_partition.md b/reference/algorithm/stable_partition.md index 38d2af6d84..1ab0fc7da5 100644 --- a/reference/algorithm/stable_partition.md +++ b/reference/algorithm/stable_partition.md @@ -10,6 +10,11 @@ namespace std { stable_partition(BidirectionalIterator first, BidirectionalIterator last, Predicate pred); // (1) C++03 + template + constexpr BidirectionalIterator + stable_partition(BidirectionalIterator first, + BidirectionalIterator last, + Predicate pred); // (1) C++26 template BidirectionalIterator @@ -81,3 +86,5 @@ int main() ## 参照 - [LWG Issue 2150. Unclear specification of `find_end`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2150) - [P0574R1 Algorithm Complexity Constraints and Parallel Overloads](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0574r1.html) +- [P2562R1 `constexpr` Stable Sorting](https://open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2562r1.pdf) + - C++26から`constexpr`に対応した diff --git a/reference/algorithm/stable_sort.md b/reference/algorithm/stable_sort.md index 0f77c873be..f66fe2166b 100644 --- a/reference/algorithm/stable_sort.md +++ b/reference/algorithm/stable_sort.md @@ -7,12 +7,21 @@ namespace std { template void stable_sort(RandomAccessIterator first, - RandomAccessIterator last); // (1) C++03 + RandomAccessIterator last); // (1) C++03 + template + constexpr + void stable_sort(RandomAccessIterator first, + RandomAccessIterator last); // (1) C++26 template void stable_sort(RandomAccessIterator first, RandomAccessIterator last, Compare comp); // (2) C++03 + template + constexpr + void stable_sort(RandomAccessIterator first, + RandomAccessIterator last, + Compare comp); // (2) C++26 template void stable_sort(ExecutionPolicy&& exec, @@ -82,3 +91,7 @@ int main() 5 ``` + +## 参照 +- [P2562R1 `constexpr` Stable Sorting](https://open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2562r1.pdf) + - C++26から`constexpr`に対応した From 6b4433bdf558b3e95efc803be094eec880e46907 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 2 Aug 2024 14:07:35 +0900 Subject: [PATCH 1115/3948] =?UTF-8?q?chrono:=20C++26=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=E3=81=A8=E3=81=97=E3=81=A6=E3=83=8F=E3=83=83=E3=82=B7=E3=83=A5?= =?UTF-8?q?=E3=82=B5=E3=83=9D=E3=83=BC=E3=83=88=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20(close=20#1180)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 2 +- reference/chrono/day.md | 14 ++++++++++++- reference/chrono/duration.md | 22 ++++++++++++++++++--- reference/chrono/leap_second.md | 11 ++++++++++- reference/chrono/month.md | 15 +++++++++++++- reference/chrono/month_day.md | 15 +++++++++++++- reference/chrono/month_day_last.md | 15 +++++++++++++- reference/chrono/month_weekday.md | 15 +++++++++++++- reference/chrono/month_weekday_last.md | 15 +++++++++++++- reference/chrono/time_point.md | 12 +++++++++-- reference/chrono/weekday.md | 15 +++++++++++++- reference/chrono/weekday_indexed.md | 14 ++++++++++++- reference/chrono/weekday_last.md | 14 ++++++++++++- reference/chrono/year.md | 14 ++++++++++++- reference/chrono/year_month.md | 15 +++++++++++++- reference/chrono/year_month_day.md | 15 +++++++++++++- reference/chrono/year_month_day_last.md | 15 +++++++++++++- reference/chrono/year_month_weekday.md | 15 +++++++++++++- reference/chrono/year_month_weekday_last.md | 15 +++++++++++++- reference/chrono/zoned_time.md | 14 ++++++++++++- 20 files changed, 259 insertions(+), 23 deletions(-) diff --git a/lang/cpp26.md b/lang/cpp26.md index c9889c97f3..b709a54229 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -139,7 +139,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 ### 日付・時間 -- [``](/reference/chrono.md)の以下のクラスに[`std::hash`](/reference/functional/hash.md)のサポートを追加 +- [``](/reference/chrono.md)の以下のクラスに、ハッシュ値サポートとして[`std::hash`](/reference/functional/hash.md)の特殊化を追加 - [`std::chrono::duration`](/reference/chrono/duration.md) - [`std::chrono::time_point`](/reference/chrono/time_point.md) - [`std::chrono::day`](/reference/chrono/day.md) diff --git a/reference/chrono/day.md b/reference/chrono/day.md index 20b3854c6f..75b12fb4d0 100644 --- a/reference/chrono/day.md +++ b/reference/chrono/day.md @@ -102,13 +102,21 @@ namespace std::chrono { | [`d`](day/op_d.md) | 日リテラル | C++20 | -## 文字列フォーマット +## 文字列フォーマットサポート | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`formatter`](day/formatter.md) | [`std::formatter`](/reference/format/formatter.md)クラスの特殊化 | C++20 | +## ハッシュサポート + +| 名前 | 説明 | 対応バージョン | +|-------|--------------------|----------------| +| `template struct hash;` | `hash`クラスの先行宣言 | C++26 | +| `template<> struct hash;` | `hash`クラスの`day`に対する特殊化 | C++26 | + + ## 例 ```cpp example #include @@ -150,3 +158,7 @@ Mar/01 - [GCC](/implementation.md#gcc): 9.2 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] + +## 参照 +- [P2592R3 Hashing support for `std::chrono` value classes](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2592r3.html) + - C++26でハッシュサポートが追加された diff --git a/reference/chrono/duration.md b/reference/chrono/duration.md index a1c3c54be7..eb94954025 100644 --- a/reference/chrono/duration.md +++ b/reference/chrono/duration.md @@ -144,12 +144,26 @@ namespace chrono { | [`h`](duration/op_h.md) | 時リテラル | C++14 | -## 特殊化 +## 共通型サポート | 名前 | 説明 | 対応バージョン | |-------|--------------------|----------------| -| [`common_type`](common_type.md) | 異なる`duration`間の共通の型を求める | C++11 | -| [`formatter`](duration/formatter.md) | [`std::formatter`](/reference/format/formatter.md)クラスの特殊化。文字列フォーマットの許可 | C++20 | +| [`common_type`](common_type.md) | 異なる`duration`間の共通の型を求める[`std::common_type`](/reference/type_traits/common_type.md)の特殊化 | C++11 | + + +## 文字列フォーマットサポート + +| 名前 | 説明 | 対応バージョン | +|-------|--------------------|----------------| +| [`formatter`](duration/formatter.md) | 文字列フォーマットの許可。[`std::formatter`](/reference/format/formatter.md)クラスの特殊化 | C++20 | + + +## ハッシュサポート + +| 名前 | 説明 | 対応バージョン | +|-------|--------------------|----------------| +| `template struct hash;` | `hash`クラスの先行宣言 | C++26 | +| `template`
`struct hash>;` | `hash`クラスの`duration`に対する特殊化。`hash`が有効な場合のみ有効 | C++26 | ## 例 @@ -208,3 +222,5 @@ Tue Oct 16 16:25:11 2012 - [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 +- [P2592R3 Hashing support for `std::chrono` value classes](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2592r3.html) + - C++26でハッシュサポートが追加された diff --git a/reference/chrono/leap_second.md b/reference/chrono/leap_second.md index 4a69431f23..7988c74209 100644 --- a/reference/chrono/leap_second.md +++ b/reference/chrono/leap_second.md @@ -47,6 +47,14 @@ namespace std::chrono { | [`operator>=`](leap_second/op_greater_equal.md) | 左辺が右辺以上を判定する | C++20 | +## ハッシュサポート + +| 名前 | 説明 | 対応バージョン | +|-------|--------------------|----------------| +| `template struct hash;` | `hash`クラスの先行宣言 | C++26 | +| `template<> struct hash;` | `hash`クラスの`leap_second`に対する特殊化 | C++26 | + + ## 例 ```cpp example #include @@ -117,4 +125,5 @@ int main() - [P1981R0 Rename `leap` to `leap_second`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1981r0.html) - C++20の策定中、National Body Commentとして`leap`というクラス名は一般的すぎて説明的ではないと指摘があり、`leap_second`に名称変更された - [LWG Issue 3359. `` leap second support should allow for negative leap seconds](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2117r0.html#3359) - +- [P2592R3 Hashing support for `std::chrono` value classes](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2592r3.html) + - C++26でハッシュサポートが追加された diff --git a/reference/chrono/month.md b/reference/chrono/month.md index b99b56d62a..725662253e 100644 --- a/reference/chrono/month.md +++ b/reference/chrono/month.md @@ -94,13 +94,21 @@ namespace std::chrono { | [`from_stream`](month/from_stream.md) | フォーマット指定して入力ストリームから入力する | C++20 | -## 文字列フォーマット +## 文字列フォーマットサポート | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`formatter`](month/formatter.md) | [`std::formatter`](/reference/format/formatter.md)クラスの特殊化 | C++20 | +## ハッシュサポート + +| 名前 | 説明 | 対応バージョン | +|-------|--------------------|----------------| +| `template struct hash;` | `hash`クラスの先行宣言 | C++26 | +| `template<> struct hash;` | `hash`クラスの`month`に対する特殊化 | C++26 | + + ## 例 ```cpp example #include @@ -140,3 +148,8 @@ Jun ## 関連項目 - [月の定数](month_constants.md) + + +## 参照 +- [P2592R3 Hashing support for `std::chrono` value classes](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2592r3.html) + - C++26でハッシュサポートが追加された diff --git a/reference/chrono/month_day.md b/reference/chrono/month_day.md index 9f127e6e85..3acb6c188e 100644 --- a/reference/chrono/month_day.md +++ b/reference/chrono/month_day.md @@ -71,13 +71,21 @@ namespace std::chrono { | [`from_stream`](month_day/from_stream.md) | フォーマット指定して入力ストリームから入力する | C++20 | -## 文字列フォーマット +## 文字列フォーマットサポート | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`formatter`](month_day/formatter.md) | [`std::formatter`](/reference/format/formatter.md)クラスの特殊化 | C++20 | +## ハッシュサポート + +| 名前 | 説明 | 対応バージョン | +|-------|--------------------|----------------| +| `template struct hash;` | `hash`クラスの先行宣言 | C++26 | +| `template<> struct hash;` | `hash`クラスの`month_day`に対する特殊化 | C++26 | + + ## 例 ```cpp example #include @@ -127,3 +135,8 @@ Mar/01 - [Clang](/implementation.md#clang): 8.0 (入出力ストリームなし) [mark verified] - [GCC](/implementation.md#gcc): 9.2 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] + + +## 参照 +- [P2592R3 Hashing support for `std::chrono` value classes](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2592r3.html) + - C++26でハッシュサポートが追加された diff --git a/reference/chrono/month_day_last.md b/reference/chrono/month_day_last.md index 8a4f44d22f..0e4324f3fb 100644 --- a/reference/chrono/month_day_last.md +++ b/reference/chrono/month_day_last.md @@ -71,13 +71,21 @@ namespace std::chrono { | [`operator<<`](month_day_last/op_ostream.md) | 出力ストリームに出力する | C++20 | -## 文字列フォーマット +## 文字列フォーマットサポート | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`formatter`](month_day_last/formatter.md) | [`std::formatter`](/reference/format/formatter.md)クラスの特殊化 | C++20 | +## ハッシュサポート + +| 名前 | 説明 | 対応バージョン | +|-------|--------------------|----------------| +| `template struct hash;` | `hash`クラスの先行宣言 | C++26 | +| `template<> struct hash;` | `hash`クラスの`month_day_last`に対する特殊化 | C++26 | + + ## 例 ```cpp example #include @@ -121,3 +129,8 @@ Mar/last - [Clang](/implementation.md#clang): 8.0 (出力ストリームなし) [mark verified] - [GCC](/implementation.md#gcc): 11.1 (出力ストリームなし) [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] + + +## 参照 +- [P2592R3 Hashing support for `std::chrono` value classes](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2592r3.html) + - C++26でハッシュサポートが追加された diff --git a/reference/chrono/month_weekday.md b/reference/chrono/month_weekday.md index 94aa822485..0dd2f1c443 100644 --- a/reference/chrono/month_weekday.md +++ b/reference/chrono/month_weekday.md @@ -67,13 +67,21 @@ namespace std::chrono { | [`operator<<`](month_weekday/op_ostream.md) | 出力ストリームに出力する | C++20 | -## 文字列フォーマット +## 文字列フォーマットサポート | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`formatter`](month_weekday/formatter.md) | [`std::formatter`](/reference/format/formatter.md)クラスの特殊化 | C++20 | +## ハッシュサポート + +| 名前 | 説明 | 対応バージョン | +|-------|--------------------|----------------| +| `template struct hash;` | `hash`クラスの先行宣言 | C++26 | +| `template<> struct hash;` | `hash`クラスの`month_weekday`に対する特殊化 | C++26 | + + ## 例 ```cpp example #include @@ -135,3 +143,8 @@ Mar/Sun[1] - [Clang](/implementation.md#clang): 8.0 (出力ストリームなし) [mark verified] - [GCC](/implementation.md#gcc): 11.1 (出力ストリームなし) [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] + + +## 参照 +- [P2592R3 Hashing support for `std::chrono` value classes](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2592r3.html) + - C++26でハッシュサポートが追加された diff --git a/reference/chrono/month_weekday_last.md b/reference/chrono/month_weekday_last.md index 1e2371100e..0714a04445 100644 --- a/reference/chrono/month_weekday_last.md +++ b/reference/chrono/month_weekday_last.md @@ -67,13 +67,21 @@ namespace std::chrono { | [`operator<<`](month_weekday_last/op_ostream.md) | 出力ストリームに出力する | C++20 | -## 文字列フォーマット +## 文字列フォーマットサポート | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`formatter`](month_weekday_last/formatter.md) | [`std::formatter`](/reference/format/formatter.md)クラスの特殊化 | C++20 | +## ハッシュサポート + +| 名前 | 説明 | 対応バージョン | +|-------|--------------------|----------------| +| `template struct hash;` | `hash`クラスの先行宣言 | C++26 | +| `template<> struct hash;` | `hash`クラスの`month_weekday_last`に対する特殊化 | C++26 | + + ## 例 ```cpp example #include @@ -135,3 +143,8 @@ Mar/Sun[last] - [Clang](/implementation.md#clang): 8.0 (出力ストリームなし) [mark verified] - [GCC](/implementation.md#gcc): 11.1 (出力ストリームなし) [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] + + +## 参照 +- [P2592R3 Hashing support for `std::chrono` value classes](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2592r3.html) + - C++26でハッシュサポートが追加された diff --git a/reference/chrono/time_point.md b/reference/chrono/time_point.md index bee37dec8e..13d531a45e 100644 --- a/reference/chrono/time_point.md +++ b/reference/chrono/time_point.md @@ -91,12 +91,19 @@ namespace chrono { | [`operator>`](time_point/op_greater.md) | 左辺が右辺より大きいか比較を行う | C++11 | | [`operator>=`](time_point/op_greater_equal.md) | 左辺が右辺以上かの比較を行う | C++11 | -### common_type特殊化 +## 共通型サポート | 名前 | 説明 | 対応バージョン | |-------|--------------------|----------------| | [`common_type`](common_type.md) | 異なる`time_point`間の共通の型を求める | C++11 | +## ハッシュサポート + +| 名前 | 説明 | 対応バージョン | +|-------|--------------------|----------------| +| `template struct hash;` | `hash`クラスの先行宣言 | C++26 | +| `template`
`struct hash>;` | `hash`クラスの`time_point`に対する特殊化。`hash`が有効な場合のみ有効 | C++26 | + ## 例 ```cpp example @@ -138,4 +145,5 @@ Thu Jul 18 13:46:26 2013 - [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 - +- [P2592R3 Hashing support for `std::chrono` value classes](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2592r3.html) + - C++26でハッシュサポートが追加された diff --git a/reference/chrono/weekday.md b/reference/chrono/weekday.md index fc53e0a91f..af83000551 100644 --- a/reference/chrono/weekday.md +++ b/reference/chrono/weekday.md @@ -86,13 +86,21 @@ namespace std::chrono { | [`from_stream`](weekday/from_stream.md) | フォーマット指定して入力ストリームから入力する | C++20 | -## 文字列フォーマット +## 文字列フォーマットサポート | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`formatter`](weekday/formatter.md) | [`std::formatter`](/reference/format/formatter.md)クラスの特殊化 | C++20 | +## ハッシュサポート + +| 名前 | 説明 | 対応バージョン | +|-------|--------------------|----------------| +| `template struct hash;` | `hash`クラスの先行宣言 | C++26 | +| `template<> struct hash;` | `hash`クラスの`weekday`に対する特殊化 | C++26 | + + ## 例 ```cpp example #include @@ -140,3 +148,8 @@ Sat ## 関連項目 - [曜日の定数](weekday_constants.md) + + +## 参照 +- [P2592R3 Hashing support for `std::chrono` value classes](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2592r3.html) + - C++26でハッシュサポートが追加された diff --git a/reference/chrono/weekday_indexed.md b/reference/chrono/weekday_indexed.md index fce5588ed5..cba7ed2702 100644 --- a/reference/chrono/weekday_indexed.md +++ b/reference/chrono/weekday_indexed.md @@ -54,13 +54,21 @@ Nの妥当な範囲は`[1, 5]`である。0ベースではないことに注意 | [`operator<<`](weekday_indexed/op_ostream.md) | 出力ストリームに出力する | C++20 | -## 文字列フォーマット +## 文字列フォーマットサポート | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`formatter`](weekday_indexed/formatter.md) | [`std::formatter`](/reference/format/formatter.md)クラスの特殊化 | C++20 | +## ハッシュサポート + +| 名前 | 説明 | 対応バージョン | +|-------|--------------------|----------------| +| `template struct hash;` | `hash`クラスの先行宣言 | C++26 | +| `template<> struct hash;` | `hash`クラスの`weekday_indexed`に対する特殊化 | C++26 | + + ## 例 ```cpp example #include @@ -108,3 +116,7 @@ int main() { - [GCC](/implementation.md#gcc): 10.1 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] + +## 参照 +- [P2592R3 Hashing support for `std::chrono` value classes](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2592r3.html) + - C++26でハッシュサポートが追加された diff --git a/reference/chrono/weekday_last.md b/reference/chrono/weekday_last.md index eec8f85f4f..b01e6584ad 100644 --- a/reference/chrono/weekday_last.md +++ b/reference/chrono/weekday_last.md @@ -51,13 +51,21 @@ namespace std::chrono { | [`operator<<`](weekday_last/op_ostream.md) | 出力ストリームに出力する | C++20 | -## 文字列フォーマット +## 文字列フォーマットサポート | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`formatter`](weekday_last/formatter.md) | [`std::formatter`](/reference/format/formatter.md)クラスの特殊化 | C++20 | +## ハッシュサポート + +| 名前 | 説明 | 対応バージョン | +|-------|--------------------|----------------| +| `template struct hash;` | `hash`クラスの先行宣言 | C++26 | +| `template<> struct hash;` | `hash`クラスの`weekday_last`に対する特殊化 | C++26 | + + ## 例 ```cpp example #include @@ -104,3 +112,7 @@ int main() { - [GCC](/implementation.md#gcc): 10.1 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] + +## 参照 +- [P2592R3 Hashing support for `std::chrono` value classes](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2592r3.html) + - C++26でハッシュサポートが追加された diff --git a/reference/chrono/year.md b/reference/chrono/year.md index 823e012628..bbfbeffa84 100644 --- a/reference/chrono/year.md +++ b/reference/chrono/year.md @@ -119,13 +119,21 @@ namespace std::chrono { | [`y`](year/op_y.md) | 年リテラル | C++20 | -## 文字列フォーマット +## 文字列フォーマットサポート | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`formatter`](year/formatter.md) | [`std::formatter`](/reference/format/formatter.md)クラスの特殊化 | C++20 | +## ハッシュサポート + +| 名前 | 説明 | 対応バージョン | +|-------|--------------------|----------------| +| `template struct hash;` | `hash`クラスの先行宣言 | C++26 | +| `template<> struct hash;` | `hash`クラスの`year`に対する特殊化 | C++26 | + + ## 例 ```cpp example #include @@ -164,3 +172,7 @@ int main() - [GCC](/implementation.md#gcc): 9.2 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] + +## 参照 +- [P2592R3 Hashing support for `std::chrono` value classes](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2592r3.html) + - C++26でハッシュサポートが追加された diff --git a/reference/chrono/year_month.md b/reference/chrono/year_month.md index 2801714e1e..fe4de94b2b 100644 --- a/reference/chrono/year_month.md +++ b/reference/chrono/year_month.md @@ -89,13 +89,21 @@ namespace std::chrono { | [`from_stream`](year_month/from_stream.md) | フォーマット指定して入力ストリームから入力する | C++20 | -## 文字列フォーマット +## 文字列フォーマットサポート | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`formatter`](year_month/formatter.md) | [`std::formatter`](/reference/format/formatter.md)クラスの特殊化 | C++20 | +## ハッシュサポート + +| 名前 | 説明 | 対応バージョン | +|-------|--------------------|----------------| +| `template struct hash;` | `hash`クラスの先行宣言 | C++26 | +| `template<> struct hash;` | `hash`クラスの`year_month`に対する特殊化 | C++26 | + + ## 例 ```cpp example #include @@ -143,3 +151,8 @@ int main() - [Clang](/implementation.md#clang): 8.0 (入出力ストリームなし) [mark verified] - [GCC](/implementation.md#gcc): 11.1 (入出力ストリームなし) [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] + + +## 参照 +- [P2592R3 Hashing support for `std::chrono` value classes](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2592r3.html) + - C++26でハッシュサポートが追加された diff --git a/reference/chrono/year_month_day.md b/reference/chrono/year_month_day.md index ad70579efc..13001ffd7b 100644 --- a/reference/chrono/year_month_day.md +++ b/reference/chrono/year_month_day.md @@ -91,13 +91,21 @@ namespace std::chrono { | [`from_stream`](year_month_day/from_stream.md) | フォーマット指定して入力ストリームから入力する | C++20 | -## 文字列フォーマット +## 文字列フォーマットサポート | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`formatter`](year_month_day/formatter.md) | [`std::formatter`](/reference/format/formatter.md)クラスの特殊化 | C++20 | +## ハッシュサポート + +| 名前 | 説明 | 対応バージョン | +|-------|--------------------|----------------| +| `template struct hash;` | `hash`クラスの先行宣言 | C++26 | +| `template<> struct hash;` | `hash`クラスの`year_month_day`に対する特殊化 | C++26 | + + ## 例 ### 基本的な使い方 (C++20) ```cpp example @@ -311,3 +319,8 @@ int main() - [Clang](/implementation.md#clang): 8.0 (入出力ストリームなし) [mark verified] - [GCC](/implementation.md#gcc): 9.2 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] + + +## 参照 +- [P2592R3 Hashing support for `std::chrono` value classes](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2592r3.html) + - C++26でハッシュサポートが追加された diff --git a/reference/chrono/year_month_day_last.md b/reference/chrono/year_month_day_last.md index a6cea173da..d9a62f0332 100644 --- a/reference/chrono/year_month_day_last.md +++ b/reference/chrono/year_month_day_last.md @@ -91,13 +91,21 @@ namespace std::chrono { | [`operator<<`](year_month_day_last/op_ostream.md) | 出力ストリームに出力する | C++20 | -## 文字列フォーマット +## 文字列フォーマットサポート | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`formatter`](year_month_day_last/formatter.md) | [`std::formatter`](/reference/format/formatter.md)クラスの特殊化 | C++20 | +## ハッシュサポート + +| 名前 | 説明 | 対応バージョン | +|-------|--------------------|----------------| +| `template struct hash;` | `hash`クラスの先行宣言 | C++26 | +| `template<> struct hash;` | `hash`クラスの`year_month_day_last`に対する特殊化 | C++26 | + + ## 例 ```cpp example #include @@ -154,3 +162,8 @@ int main() - [Clang](/implementation.md#clang): 8.0 (出力ストリームなし) [mark verified] - [GCC](/implementation.md#gcc): 11.1 (出力ストリームなし) [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] + + +## 参照 +- [P2592R3 Hashing support for `std::chrono` value classes](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2592r3.html) + - C++26でハッシュサポートが追加された diff --git a/reference/chrono/year_month_weekday.md b/reference/chrono/year_month_weekday.md index 0f007f9304..34e52db78f 100644 --- a/reference/chrono/year_month_weekday.md +++ b/reference/chrono/year_month_weekday.md @@ -87,13 +87,21 @@ namespace std::chrono { | [`operator<<`](year_month_weekday/op_ostream.md) | 出力ストリームに出力する | C++20 | -## 文字列フォーマット +## 文字列フォーマットサポート | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`formatter`](year_month_weekday/formatter.md) | [`std::formatter`](/reference/format/formatter.md)クラスの特殊化 | C++20 | +## ハッシュサポート + +| 名前 | 説明 | 対応バージョン | +|-------|--------------------|----------------| +| `template struct hash;` | `hash`クラスの先行宣言 | C++26 | +| `template<> struct hash;` | `hash`クラスの`year_month_weekday`に対する特殊化 | C++26 | + + ## 例 ```cpp example #include @@ -145,3 +153,8 @@ int main() - [Clang](/implementation.md#clang): 8.0 (出力ストリームなし) [mark verified] - [GCC](/implementation.md#gcc): 11.1 (出力ストリームなし) [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] + + +## 参照 +- [P2592R3 Hashing support for `std::chrono` value classes](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2592r3.html) + - C++26でハッシュサポートが追加された diff --git a/reference/chrono/year_month_weekday_last.md b/reference/chrono/year_month_weekday_last.md index b5a0d73214..305e8be960 100644 --- a/reference/chrono/year_month_weekday_last.md +++ b/reference/chrono/year_month_weekday_last.md @@ -86,13 +86,21 @@ namespace std::chrono { | [`operator<<`](year_month_weekday_last/op_ostream.md) | 出力ストリームに出力する | C++20 | -## 文字列フォーマット +## 文字列フォーマットサポート | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`formatter`](year_month_weekday_last/formatter.md) | [`std::formatter`](/reference/format/formatter.md)クラスの特殊化 | C++20 | +## ハッシュサポート + +| 名前 | 説明 | 対応バージョン | +|-------|--------------------|----------------| +| `template struct hash;` | `hash`クラスの先行宣言 | C++26 | +| `template<> struct hash;` | `hash`クラスの`year_month_weekday_last`に対する特殊化 | C++26 | + + ## 例 ```cpp example #include @@ -145,3 +153,8 @@ int main() - [Clang](/implementation.md#clang): 8.0 (出力ストリームなし) [mark verified] - [GCC](/implementation.md#gcc): 11.1 (出力ストリームなし) [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] + + +## 参照 +- [P2592R3 Hashing support for `std::chrono` value classes](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2592r3.html) + - C++26でハッシュサポートが追加された diff --git a/reference/chrono/zoned_time.md b/reference/chrono/zoned_time.md index 388be88afc..1dcdadcff3 100644 --- a/reference/chrono/zoned_time.md +++ b/reference/chrono/zoned_time.md @@ -80,13 +80,21 @@ namespace std::chrono { | [`(deduction_guide)`](zoned_time/op_deduction_guide.md) | クラステンプレートの推論補助 | C++20 | -## 文字列フォーマット +## 文字列フォーマットサポート | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`formatter`](zoned_time/formatter.md) | [`std::formatter`](/reference/format/formatter.md)クラスの特殊化 | C++20 | +## ハッシュサポート + +| 名前 | 説明 | 対応バージョン | +|-------|--------------------|----------------| +| `template struct hash;` | `hash`クラスの先行宣言 | C++26 | +| `template`
`struct hash>;` | `hash`クラスの`zoned_time`に対する特殊化。`hash`と`hash`が有効な場合のみ有効 | C++26 | + + ## 例 ### 基本的な使い方 ```cpp example @@ -210,3 +218,7 @@ int main() - [GCC](/implementation.md#gcc): 9.2 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] + +## 参照 +- [P2592R3 Hashing support for `std::chrono` value classes](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2592r3.html) + - C++26でハッシュサポートが追加された From bdfc49d490d6395aee702a0320af67ed3da85d3f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 2 Aug 2024 14:40:58 +0900 Subject: [PATCH 1116/3948] =?UTF-8?q?Visual=20Studio=20:=202022=20Update?= =?UTF-8?q?=2010=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/implementation.md b/implementation.md index 759f41951e..6dc93f5e04 100644 --- a/implementation.md +++ b/implementation.md @@ -141,9 +141,10 @@ | 表記 | 製品名 [Visual Studio バージョン] †1 | VC++ バージョン †2 | `_MSC_VER` | `_MSC_FULL_VER` | |---------------|----------------------------------------|-----------------|------------|-----------------| -| 2022 | Visual Studio 2022 version 17.9.2 | 14.39 | 1939 | 193933521 | -| 2022 | Visual Studio 2022 version 17.8.3 | 14.38 | 1938 | 193833133 | -| 2022 | Visual Studio 2022 version 17.7.0 | 14.37 | 1937 | 193732822 | +| 2022 Update 10 | Visual Studio 2022 version 17.10.5 | 14.40 | 1939 | 194033811 | +| 2022 Update 9 | Visual Studio 2022 version 17.9.2 | 14.39 | 1939 | 193933521 | +| 2022 Update 8 | Visual Studio 2022 version 17.8.3 | 14.38 | 1938 | 193833133 | +| 2022 Update 7 | Visual Studio 2022 version 17.7.0 | 14.37 | 1937 | 193732822 | | 2022 Update 6 | Visual Studio 2022 version 17.6.2 | 14.36 | 1936 | 193632532 | | 2022 Update 5 | Visual Studio 2022 version 17.5.4 | ?? | 1935 | 193532217 | | 2022 Update 4 | Visual Studio 2022 version 17.4.9 | ?? | 1934 | 193431944 | From cb3e88918d092153329fc63b931d432d99a7fc84 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 2 Aug 2024 15:00:52 +0900 Subject: [PATCH 1117/3948] =?UTF-8?q?complex=20:=20C++26=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=E3=81=A8=E3=81=97=E3=81=A6=E3=82=BF=E3=83=97=E3=83=AB=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=82=BF=E3=83=95=E3=82=A7=E3=83=BC=E3=82=B9=E3=81=AE?= =?UTF-8?q?=E3=82=B5=E3=83=9D=E3=83=BC=E3=83=88=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20(close=20#1238)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/array/array.md | 14 ++-- reference/complex/complex.md | 65 ++++++++++++++++- reference/complex/complex/get.md | 81 ++++++++++++++++++++++ reference/complex/complex/tuple_element.md | 65 +++++++++++++++++ reference/complex/complex/tuple_size.md | 55 +++++++++++++++ reference/tuple/tuple/get.md | 1 + 6 files changed, 273 insertions(+), 8 deletions(-) create mode 100644 reference/complex/complex/get.md create mode 100644 reference/complex/complex/tuple_element.md create mode 100644 reference/complex/complex/tuple_size.md diff --git a/reference/array/array.md b/reference/array/array.md index 5dd350ce1d..e95c837ed5 100644 --- a/reference/array/array.md +++ b/reference/array/array.md @@ -111,20 +111,20 @@ namespace std { | [`to_array`](to_array.md) | 組み込み一次元配列から `array` を作成する | C++20 | -## タプルインタフェース +## 推論補助 | 名前 | 説明 | 対応バージョン | |---------------------------------------------|------------------------------------|-------| -| [`tuple_size`](array/tuple_size.md) | 静的な要素数取得(class template) | C++11 | -| [`tuple_element`](array/tuple_element.md) | 静的な要素の型取得(class template) | C++11 | -| [`get`](array/get.md) | 要素を取得する(function template) | C++11 | +| [`(deduction_guide)`](array/op_deduction_guide.md) | クラステンプレートの推論補助 | C++17 | -## 推論補助 +## タプルインタフェースサポート | 名前 | 説明 | 対応バージョン | -|---------------------------------------------|------------------------------------|-------| -| [`(deduction_guide)`](array/op_deduction_guide.md) | クラステンプレートの推論補助 | C++17 | +|-------------------------------------------|------------------------------------|-------| +| [`tuple_size`](array/tuple_size.md) | 静的な要素数取得(class template) | C++11 | +| [`tuple_element`](array/tuple_element.md) | 静的な要素の型取得(class template) | C++11 | +| [`get`](array/get.md) | 要素を取得する(function template) | C++11 | ## 例 diff --git a/reference/complex/complex.md b/reference/complex/complex.md index 153a5c090e..23e103b014 100644 --- a/reference/complex/complex.md +++ b/reference/complex/complex.md @@ -110,7 +110,17 @@ namespace std { | [`tanh`](complex/tanh.md) | 複素数の双曲線正接を求める | | +## タプルインタフェースサポート + +| 名前 | 説明 | 対応バージョン | +|---------------------------------------------|------------------------------------|-------| +| [`tuple_size`](complex/tuple_size.md) | 静的な要素数取得(class template) | C++26 | +| [`tuple_element`](complex/tuple_element.md) | 静的な要素の型取得(class template) | C++26 | +| [`get`](complex/get.md) | 要素を取得する(function template) | C++26 | + + ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -161,7 +171,7 @@ int main() * std::proj[link complex/proj.md] * std::polar[link complex/polar.md] -### 出力 +#### 出力 ``` output : (1,2) real : 1 @@ -179,6 +189,57 @@ polar : (-1.62921e-07,1) ``` +### タプルインタフェースを使用する (C++26) +```cpp example +#include +#include +#include +#include + +int main() +{ + // 構造化束縛で各要素を取得する + { + std::complex c{1.0f, 2.0f}; + auto [real, imag] = c; + std::println("real:{} imag:{}", real, imag); + } + + // 定数の添字を指定して各要素を取得する + { + std::complex c{1.0f, 2.0f}; + float real = std::get<0>(c); + float imag = std::get<1>(c); + std::println("real:{} imag:{}", real, imag); + } + + // complexの配列から実部のみを抽出する + { + std::vector> v { + {1.0f, 2.0f}, + {3.0f, 4.0f}, + {5.0f, 6.0f} + }; + + for (float real : v | std::views::elements<0>) { + std::println("real:{}", real); + } + } +} +``` +* std::get[link complex/get.md] +* std::views::elements[link /reference/ranges/elements_view.md] + +#### 出力 +``` +real:1 imag:2 +real:1 imag:2 +real:1 +real:3 +real:5 +``` + + ## 参照 - [複素数 - Wikipedia](https://ja.wikipedia.org/wiki/複素数) - [複素数の手ほどき - 日本電気技術者協会](http://www.jeea.or.jp/course/contents/01109/) @@ -188,3 +249,5 @@ polar : (-1.62921e-07,1) - [N1568 Proposed additions to TR-1 to improve compatibility with C99](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1568.htm) - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で拡張浮動小数点数型に対応した +- [P2819R2 Add tuple protocol to complex](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2819r2.pdf) + - C++26から`std::complex`にタプルインタフェースがサポートされた diff --git a/reference/complex/complex/get.md b/reference/complex/complex/get.md new file mode 100644 index 0000000000..5c5a9abe40 --- /dev/null +++ b/reference/complex/complex/get.md @@ -0,0 +1,81 @@ +# get +* complex[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + constexpr T& get(complex& z) noexcept; // (1) C++26 + + template + constexpr T&& get(complex&& z) noexcept; // (2) C++26 + + template + constexpr const T& get(const complex& z) noexcept; // (3) C++26 + + template + constexpr const T&& get(const complex&& z) noexcept; // (4) C++26 +} +``` + +## 概要 +タプルと見なせる型から指定した位置の要素を取得する。 + +``ヘッダでは、`std::complex`クラスに関するオーバーロードを定義する。 + + +## 適格要件 +- `I < 2`であること + + +## 戻り値 +`I == 0`の場合は実部 (real)、そうでない場合は虚部 (imag) を返す。 + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::complex c{1.0f, 2.0f}; + + float real = std::get<0>(c); + float imag = std::get<1>(c); + + std::println("real:{} imag:{}", real, imag); +} +``` +* std::get[color ff0000] + + +### 出力 +``` +real:1 imag:2 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 19.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 14 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 10 [mark noimpl] + + +## 関連項目 +- [`get - std::tuple`](/reference/tuple/tuple/get.md) + + +## 参照 +- [P2819R2 Add tuple protocol to complex](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2819r2.pdf) + - C++26から`std::complex`にタプルインタフェースがサポートされた diff --git a/reference/complex/complex/tuple_element.md b/reference/complex/complex/tuple_element.md new file mode 100644 index 0000000000..023e9e8729 --- /dev/null +++ b/reference/complex/complex/tuple_element.md @@ -0,0 +1,65 @@ +# tuple_element +* complex[meta header] +* std[meta namespace] +* class template[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template class tuple_element; // 先行宣言 + + template + struct tuple_element> { + using type = T; + }; +} +``` + +## 概要 +`tuple_element`は、タプルとして見なせる型から、`I`番目の要素型を取得するためのクラスである。 + +``ヘッダでは、`std::complex`クラスに関する特殊化を定義する。 + + +## 適格要件 +- `I < 2`であること + + +## 例 +```cpp example +#include +#include + +int main() +{ + static_assert(std::is_same< + std::tuple_element<0, std::complex>::type, + float + >::value, ""); + + static_assert(std::is_same< + std::tuple_element<1, std::complex>::type, + float + >::value, ""); +} +``` +* std::tuple_element[color ff0000] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 19.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 14 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 10 [mark noimpl] + + +## 参照 +- [P2819R2 Add tuple protocol to complex](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2819r2.pdf) + - C++26から`std::complex`にタプルインタフェースがサポートされた diff --git a/reference/complex/complex/tuple_size.md b/reference/complex/complex/tuple_size.md new file mode 100644 index 0000000000..12760b908f --- /dev/null +++ b/reference/complex/complex/tuple_size.md @@ -0,0 +1,55 @@ +# tuple_size +* complex[meta header] +* std[meta namespace] +* class template[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template class tuple_size; // 先行宣言 + + template + struct tuple_size> + : integral_constant {}; +} +``` +* integral_constant[link /reference/type_traits/integral_constant.md] + +## 概要 +`tuple_size`は、タプルとして見なせる型の要素数を取得するためのクラスである。 + +要素数は、[`integral_constant`](/reference/type_traits/integral_constant.md)の機能を利用してコンパイル時の定数値として取得できる。 + +``ヘッダでは、[`std::complex`](/reference/complex/complex.md)クラスに関する特殊化を定義する。 + + +## 例 +```cpp example +#include + +int main() +{ + static_assert(std::tuple_size>::value == 2, ""); +} +``` +* std::tuple_size[color ff0000] + + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 19.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 14 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 10 [mark noimpl] + + +## 参照 +- [P2819R2 Add tuple protocol to complex](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2819r2.pdf) + - C++26から`std::complex`にタプルインタフェースがサポートされた diff --git a/reference/tuple/tuple/get.md b/reference/tuple/tuple/get.md index ded2a8e270..a8dd8b86c6 100644 --- a/reference/tuple/tuple/get.md +++ b/reference/tuple/tuple/get.md @@ -179,6 +179,7 @@ int main() { ## 関連項目 - [`get - std::pair`](/reference/utility/pair/get.md) - [`get - std::array`](/reference/array/array/get.md) +- [`get - std::complex`](/reference/complex/complex/get.md) - [C++20 関数テンプレートに明示的に型指定した場合にADLで見つからない問題を修正](/lang/cpp20/adl_and_function_templates_that_are_not_visible.md) From 86c310ce3894a400905a23cfcd0161d7ad9b317d Mon Sep 17 00:00:00 2001 From: yoh Date: Sun, 4 Aug 2024 21:32:09 +0900 Subject: [PATCH 1118/3948] mdspan/layout_*_padded/mapping: small refinement --- reference/mdspan/layout_left_padded/mapping.md | 14 ++++++++++---- .../mapping/submdspan_mapping.md | 4 +--- reference/mdspan/layout_right_padded/mapping.md | 14 ++++++++++---- .../mapping/submdspan_mapping.md | 4 +--- 4 files changed, 22 insertions(+), 14 deletions(-) diff --git a/reference/mdspan/layout_left_padded/mapping.md b/reference/mdspan/layout_left_padded/mapping.md index 02c167755e..7f6c4f2fd9 100644 --- a/reference/mdspan/layout_left_padded/mapping.md +++ b/reference/mdspan/layout_left_padded/mapping.md @@ -20,6 +20,12 @@ namespace std { `layout_left_padded::mapping`は[トリビアルコピー可能](/reference/type_traits/is_trivially_copyable.md)であり、[`regular`](/reference/concepts/regular.md)のモデルである。 +### 説明専用の仮想操作 +動作説明用の仮想操作`LEAST-MULTIPLE-AT-LEAST(x,y)`を、次のように定義する。 + +- `x == 0`のとき、`y` +- そうでなければ、`y`以上で最小となる`x`の倍数 + ### 説明専用メンバ変数 `layout_left_padded::mapping`クラステンプレートは、下記の説明専用メンバ変数を保持する。 @@ -38,16 +44,16 @@ namespace std { ## 適格要件 - `Extents`は[`extents`](../extents.md)の特殊化であること。 -- `rank_dynamic() == 0`が`true`のとき、多次元インデクス空間`Extents()`のサイズが`index_type`型で表現できること。 +- `rank_dynamic() == 0`のとき、多次元インデクス空間`Extents()`のサイズが`index_type`型で表現できること。 - 値`padding_value`が`index_type`型で表現できること。 - 以下を満たすとき、`LEAST-MULTIPLE-AT-LEAST(padding_value, first-static-extent)`が、`size_t`型および`index_type`型で表現できること。 - `rank_ > 1`、かつ - `padding_value`が[`dynamic_extent`](/reference/span/dynamic_extent.md)と等しくなく、かつ - - `first-static-extent`が`dynamic_extent`と等しくないとき。 -- 以下を満たすとき、半開区間`[1, rank_)`の全ての値`k`に対して`LEAST-MULTIPLE-AT-LEAST(padding_value, ext.static_extent(0))`と全ての`ext.static_extent(k)`値を乗じた結果が、`size_t`型および`index_type`型で表現できること。 + - `first-static-extent`が[`dynamic_extent`](/reference/span/dynamic_extent.md)と等しくないとき。 +- 以下を満たすとき、半開区間`[1, rank_)`の全ての値`k`に対して`LEAST-MULTIPLE-AT-LEAST(padding_value, ext.static_extent(0))`と全ての`ext.static_extent(k)`を乗じた結果が、`size_t`型および`index_type`型で表現できること。 - `rank_ > 1`、かつ - `padding_value`が[`dynamic_extent`](/reference/span/dynamic_extent.md)と等しくなく、かつ - - 半開区間`[0, extents_type::`[`rank()`](../extents/rank.md)`)`の全ての値`k`に対して`extents_type::`[`static_extent`](../extents/static_extent.md)`(k)`が`dynamic_extent`と等しくないとき。 + - 半開区間`[0, extents_type::`[`rank()`](../extents/rank.md)`)`の全ての値`k`に対して`extents_type::`[`static_extent`](../extents/static_extent.md)`(k)`が[`dynamic_extent`](/reference/span/dynamic_extent.md)と等しくないとき。 ## メンバ関数 diff --git a/reference/mdspan/layout_left_padded/mapping/submdspan_mapping.md b/reference/mdspan/layout_left_padded/mapping/submdspan_mapping.md index 6eeeb0f2eb..6991234820 100644 --- a/reference/mdspan/layout_left_padded/mapping/submdspan_mapping.md +++ b/reference/mdspan/layout_left_padded/mapping/submdspan_mapping.md @@ -62,9 +62,7 @@ friend constexpr auto submdspan_mapping( 説明専用の`submdspan-mapping-impl`関数テンプレートは下記の値を返す。 - [`Extents::rank()`](../../extents/rank.md) `== 0`のとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{*this, 0}` -- 以下を満たすとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_left::mapping`](../../layout_left.md)`(sub_ext), offset}` - - `rank_ == 1`、または - - `SubExtents::rank() == 0` +- `rank_ == 1`または`SubExtents::rank() == 0`のとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_left::mapping`](../../layout_left.md)`(sub_ext), offset}` - 以下を満たすとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_left::mapping`](../../layout_left.md)`(sub_ext), offset}` - `SubExtents::rank() == 1`、かつ - 型`S_0`が[`index-pair-like`](../../index-pair-like.md)``のモデルもしくは[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` diff --git a/reference/mdspan/layout_right_padded/mapping.md b/reference/mdspan/layout_right_padded/mapping.md index f21b132737..d755227d78 100644 --- a/reference/mdspan/layout_right_padded/mapping.md +++ b/reference/mdspan/layout_right_padded/mapping.md @@ -20,6 +20,12 @@ namespace std { `layout_right_padded::mapping`は[トリビアルコピー可能](/reference/type_traits/is_trivially_copyable.md)であり、[`regular`](/reference/concepts/regular.md)のモデルである。 +### 説明専用の仮想操作 +動作説明用の仮想操作`LEAST-MULTIPLE-AT-LEAST(x,y)`を、次のように定義する。 + +- `x == 0`のとき、`y` +- そうでなければ、`y`以上で最小となる`x`の倍数 + ### 説明専用メンバ変数 `layout_right_padded::mapping`クラステンプレートは、下記の説明専用メンバ変数を保持する。 @@ -38,16 +44,16 @@ namespace std { ## 適格要件 - `Extents`は[`extents`](../extents.md)の特殊化であること。 -- `rank_dynamic() == 0`が`true`のとき、多次元インデクス空間`Extents()`のサイズが`index_type`型で表現できること。 +- `rank_dynamic() == 0`のとき、多次元インデクス空間`Extents()`のサイズが`index_type`型で表現できること。 - 値`padding_value`が`index_type`型で表現できること。 - 以下を満たすとき、`LEAST-MULTIPLE-AT-LEAST(padding_value, last-static-extent)`が、`size_t`型および`index_type`型で表現できること。 - `rank_ > 1`、かつ - `padding_value`が[`dynamic_extent`](/reference/span/dynamic_extent.md)と等しくなく、かつ - - `last-static-extent`が`dynamic_extent`と等しくないとき。 -- 以下を満たすとき、半開区間`[1, rank_ - 1)`の全ての値`k`に対して`LEAST-MULTIPLE-AT-LEAST(padding_value, ext.static_extent(rank_ - 1))`と全ての`ext.static_extent(k)`値を乗じた結果が、`size_t`型および`index_type`型で表現できること。 + - `last-static-extent`が[`dynamic_extent`](/reference/span/dynamic_extent.md)と等しくないとき。 +- 以下を満たすとき、半開区間`[1, rank_ - 1)`の全ての値`k`に対して`LEAST-MULTIPLE-AT-LEAST(padding_value, ext.static_extent(rank_ - 1))`と全ての`ext.static_extent(k)`を乗じた結果が、`size_t`型および`index_type`型で表現できること。 - `rank_ > 1`、かつ - `padding_value`が[`dynamic_extent`](/reference/span/dynamic_extent.md)と等しくなく、かつ - - 半開区間`[0, rank_)`の全ての値`k`に対して`extents_type::`[`static_extent`](../extents/static_extent.md)`(k)`が`dynamic_extent`と等しくないとき。 + - 半開区間`[0, rank_)`の全ての値`k`に対して`extents_type::`[`static_extent`](../extents/static_extent.md)`(k)`が[`dynamic_extent`](/reference/span/dynamic_extent.md)と等しくないとき。 ## メンバ関数 diff --git a/reference/mdspan/layout_right_padded/mapping/submdspan_mapping.md b/reference/mdspan/layout_right_padded/mapping/submdspan_mapping.md index 79c87a52eb..6d5a1beff8 100644 --- a/reference/mdspan/layout_right_padded/mapping/submdspan_mapping.md +++ b/reference/mdspan/layout_right_padded/mapping/submdspan_mapping.md @@ -62,9 +62,7 @@ friend constexpr auto submdspan_mapping( 説明専用の`submdspan-mapping-impl`関数テンプレートは下記の値を返す。 - [`Extents::rank()`](../../extents/rank.md) `== 0`のとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{*this, 0}` -- 以下を満たすとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_right::mapping`](../../layout_right.md)`(sub_ext), offset}` - - `rank_ == 1`、または - - `SubExtents::rank() == 1` +- `rank_ == 1`または`SubExtents::rank() == 0`のとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_right::mapping`](../../layout_right.md)`(sub_ext), offset}` - 以下を満たすとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_right::mapping`](../../layout_right.md)`(sub_ext), offset}` - `SubExtents::rank() == 1`、かつ - `rank_-1`に等しい値`k`に対して、型`S_k`が[`index-pair-like`](../../index-pair-like.md)``のモデルもしくは[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` From b067a8b40d5a26e7370f5894f2be5341abc6e762 Mon Sep 17 00:00:00 2001 From: suomesta Date: Mon, 5 Aug 2024 00:45:03 +0900 Subject: [PATCH 1119/3948] add push_range to std::stack (#1069) --- reference/stack/stack.md | 1 + reference/stack/stack/push_range.md | 66 +++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 reference/stack/stack/push_range.md diff --git a/reference/stack/stack.md b/reference/stack/stack.md index 916b6cc246..8707acab7c 100644 --- a/reference/stack/stack.md +++ b/reference/stack/stack.md @@ -41,6 +41,7 @@ namespace std { | [`empty`](stack/empty.md) | 要素が空であるかを確認する | | | [`size`](stack/size.md) | 要素数を取得する | | | [`push`](stack/push.md) | 要素を追加する | | +| [`push_range`](stack/push_range.md)| Rangeの要素を追加する | C++23 | | [`emplace`](stack/emplace.md) | 直接構築で要素を追加する | C++11 | | [`pop`](stack/pop.md) | 次の要素を削除する | | | [`swap`](stack/swap.md) | 他の `stack` オブジェクトと値を入れ替える | C++11 | diff --git a/reference/stack/stack/push_range.md b/reference/stack/stack/push_range.md new file mode 100644 index 0000000000..033c284071 --- /dev/null +++ b/reference/stack/stack/push_range.md @@ -0,0 +1,66 @@ +# push_range +* stack[meta header] +* std[meta namespace] +* stack[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +template R> +void push_range(R&& rg); // C++23 +``` + +## 概要 +Range`rg` の各要素を `stack` の末尾に追加する。 + + +## 効果 +`c.append_range(forward(rg))` が有効であれば、これと同等。 +そうでなければ、`ranges::copy(rg, back_inserter(c))`。 + + +## 戻り値 +なし + + +## 計算量 +`c.append_range(rg)`(または `ranges::copy(rg, back_inserter(c))`)と同じ。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::stack st; + std::vector vec = {1, 2, 3}; + + st.push_range(vec); + + while (!st.empty()) { + std::cout << st.top() << std::endl; + st.pop(); + } +} +``` +* push_range[color ff0000] +* st.empty()[link empty.md] +* st.top()[link top.md] +* st.pop()[link pop.md] + +### 出力 +``` +3 +2 +1 +``` + + +## 関連項目 + +| 名前 | 説明 | +|-------------------|----------------| +| [`push`](push.md) | 要素を追加する | From 47393272dc15f1d53440632c4f4f68c53d26a356 Mon Sep 17 00:00:00 2001 From: suomesta Date: Mon, 5 Aug 2024 00:46:25 +0900 Subject: [PATCH 1120/3948] add push_range to std::queue and std::priority_queue (#1069) --- reference/queue/priority_queue.md | 1 + reference/queue/priority_queue/push_range.md | 63 +++++++++++++++++++ reference/queue/queue.md | 1 + reference/queue/queue/push_range.md | 65 ++++++++++++++++++++ 4 files changed, 130 insertions(+) create mode 100644 reference/queue/priority_queue/push_range.md create mode 100644 reference/queue/queue/push_range.md diff --git a/reference/queue/priority_queue.md b/reference/queue/priority_queue.md index 5e92093c29..49c7d4e66a 100644 --- a/reference/queue/priority_queue.md +++ b/reference/queue/priority_queue.md @@ -49,6 +49,7 @@ namespace std { | [`size`](priority_queue/size.md) | 要素数を取得する | | | [`top`](priority_queue/top.md) | 次の要素にアクセスする | | | [`push`](priority_queue/push.md) | 要素を追加する | | +| [`push_range`](priority_queue/push_range.md) | Rangeの要素を追加する | C++23 | | [`emplace`](priority_queue/emplace.md) | 直接構築で要素を追加する | C++11 | | [`pop`](priority_queue/pop.md) | 次の要素を削除する | | | [`swap`](priority_queue/swap.md) | 他のpriority_queueオブジェクトと値を入れ替える | C++11 | diff --git a/reference/queue/priority_queue/push_range.md b/reference/queue/priority_queue/push_range.md new file mode 100644 index 0000000000..82e1291b95 --- /dev/null +++ b/reference/queue/priority_queue/push_range.md @@ -0,0 +1,63 @@ +# push_range +* queue[meta header] +* std[meta namespace] +* priority_queue[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +template R> +void push_range(R&& rg); // C++23 +``` + +## 概要 +Range`rg` の各要素を `priority_queue` に追加し、優先順に並べ替えを行う。 + + +## 効果 +まず `c` に `rg` の要素を追加する。`c.append_range(forward(rg))` が有効であれば、これで要素を追加する。そうでなければ、`ranges::copy(rg, back_inserter(c))` で要素を追加する。 + +次に、`make_heap(c.begin(), c.end(), comp)` で優先順に並べ替えを行う。 + + +## 戻り値 +なし + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::priority_queue que; + std::vector vec = {2, 1, 3}; + + que.push_range(vec); + + while (!que.empty()) { + std::cout << que.top() << std::endl; + que.pop(); + } +} +``` +* push_range[color ff0000] +* que.empty()[link empty.md] +* que.top()[link top.md] +* que.pop()[link pop.md] + +### 出力 +``` +3 +2 +1 +``` + + +## 関連項目 + +| 名前 | 説明 | +|-------------------|----------------| +| [`push`](push.md) | 要素を追加する | diff --git a/reference/queue/queue.md b/reference/queue/queue.md index 20e6c5f7d3..d3ae68156b 100644 --- a/reference/queue/queue.md +++ b/reference/queue/queue.md @@ -44,6 +44,7 @@ namespace std { | [`front`](queue/front.md) | 次の要素にアクセスする | | | [`back`](queue/back.md) | 最後の要素にアクセスする | | | [`push`](queue/push.md) | 要素を追加する | | +| [`push_range`](queue/push_range.md) | Rangeの要素を追加する | C++23 | | [`emplace`](queue/emplace.md) | 直接構築で要素を追加する | C++11 | | [`pop`](queue/pop.md) | 次の要素を削除する | | | [`swap`](queue/swap.md) | 他の`queue`オブジェクトと値を入れ替える | C++11 | diff --git a/reference/queue/queue/push_range.md b/reference/queue/queue/push_range.md new file mode 100644 index 0000000000..af2f2c29b2 --- /dev/null +++ b/reference/queue/queue/push_range.md @@ -0,0 +1,65 @@ +# push_range +* queue[meta header] +* std[meta namespace] +* queue[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +template R> +void push_range(R&& rg); // C++23 +``` + +## 概要 +Range`rg` の各要素を `queue` の末尾に追加する。 + + +## 効果 +`c.append_range(forward(rg))` が有効であれば、これと同等。 +そうでなければ、`ranges::copy(rg, back_inserter(c))`。 + + +## 戻り値 +なし + + +## 計算量 +`c.append_range(rg)`(または `ranges::copy(rg, back_inserter(c))`)と同じ。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::queue que; + std::vector vec = {1, 2, 3}; + + que.push_range(vec); + + while (!que.empty()) { + std::cout << que.front() << std::endl; + que.pop(); + } +} +``` +* push_range[color ff0000] +* que.empty()[link empty.md] +* que.front()[link front.md] +* que.pop()[link pop.md] + +### 出力 +``` +1 +2 +3 +``` + +## 関連項目 + +| 名前 | 説明 | +|-------------------|----------------| +| [`push`](push.md) | 要素を追加する | From ec423b713f62b2ed054409632a5cb78e850c8a1b Mon Sep 17 00:00:00 2001 From: suomesta Date: Mon, 5 Aug 2024 00:48:07 +0900 Subject: [PATCH 1121/3948] add insert_range to std::map and std::multimap (#1069) --- reference/map/map.md | 1 + reference/map/map/insert_range.md | 81 ++++++++++++++++++++++++++ reference/map/multimap.md | 1 + reference/map/multimap/insert_range.md | 78 +++++++++++++++++++++++++ 4 files changed, 161 insertions(+) create mode 100644 reference/map/map/insert_range.md create mode 100644 reference/map/multimap/insert_range.md diff --git a/reference/map/map.md b/reference/map/map.md index f87575b987..b0996ee653 100644 --- a/reference/map/map.md +++ b/reference/map/map.md @@ -92,6 +92,7 @@ namespace std { |-----------------------------------------------|--------------------------------------------|----------------| | [`clear`](map/clear.md) | 全ての要素を削除する | | | [`insert`](map/insert.md) | 要素を挿入する | | +| [`insert_range`](map/insert_range.md) | Rangeの要素を挿入する | C++23 | | [`insert_or_assign`](map/insert_or_assign.md) | 要素を挿入、あるいは代入する | C++17 | | [`emplace`](map/emplace.md) | 要素を直接構築する | C++11 | | [`emplace_hint`](map/emplace_hint.md) | ヒントを使って要素を直接構築する | C++11 | diff --git a/reference/map/map/insert_range.md b/reference/map/map/insert_range.md new file mode 100644 index 0000000000..8a04f8c6d6 --- /dev/null +++ b/reference/map/map/insert_range.md @@ -0,0 +1,81 @@ +# insert_range +* map[meta header] +* std[meta namespace] +* map[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +template R> +void insert_range(R&& rg); // C++23 +``` + +## 概要 +Range`rg` の要素を挿入することにより、`map` コンテナを拡張する。 + +これは、挿入された要素の数だけコンテナの [`size()`](size.md) を増やす。 + +`map` コンテナは重複したキーを持つ要素を許さないため、挿入操作はそれぞれの要素が他のコンテナ内の既存要素と同じキーかどうかをチェックする。もし同じであれば要素は挿入されない。 + +重複した値を許す、類似したコンテナについては `multimap` を参照。 + +内部的に `map` コンテナは、コンストラクト時に指定された比較オブジェクトによって要素を下位から上位へとソートして保持する。 + + +## 事前条件 +`*this` の要素の範囲と Range`rg` の要素の範囲が重複していないこと + + +## テンプレートパラメータ制約 +`value_type` は、コンテナに対して `EmplaceConstructible` であること + + +## 戻り値 +なし + + +## 計算量 +`N =` [`ranges::distance`](../../iterator/ranges_distance.md)`(rg)` とすると、`N log (size() + N)` に比例 + + +## 備考 +- 関数が呼ばれた後も、当該コンテナ内の要素を指す参照やイテレータは無効にはならない。 + なお、規格書に明確な記載は無いが、当該コンテナ内の要素を指すポインタも無効にはならない。 + + +## 例 +```cpp example +#include +#include +#include +#include + +int main () +{ + std::map m = {{'A', 10}, {'B', 11}}; + + std::vector> v = {{'B', 11}, {'C', 12}}; + m.insert_range(v); + + for (const auto& kv : m) { + std::cout << kv.first << " " << kv.second << std::endl; + } + + return 0; +} +``` +* insert_range[color ff0000] + +### 出力 +``` +A 10 +B 11 +C 12 +``` + +## 関連項目 + +| 名前 | 説明 | +|------------------------------------------------|--------------------------------------------| +| [`map::insert`](insert.md) | 要素を挿入する | +| [`map::insert_or_assign`](insert_or_assign.md) | 要素を挿入、あるいは代入する | diff --git a/reference/map/multimap.md b/reference/map/multimap.md index f5aa9fd9d1..aece7355cf 100644 --- a/reference/map/multimap.md +++ b/reference/map/multimap.md @@ -91,6 +91,7 @@ namespace std { |-----------------------------------------|----------------------------------|-------| | [`clear`](multimap/clear.md) | 全ての要素を削除する | | | [`insert`](multimap/insert.md) | 要素を挿入する | | +| [`insert_range`](multimap/insert_range.md) | Rangeの要素を挿入する | C++23 | | [`emplace`](multimap/emplace.md) | 要素を直接構築する | C++11 | | [`emplace_hint`](multimap/emplace_hint.md) | ヒントを使って要素を直接構築する | C++11 | | [`erase`](multimap/erase.md) | 要素を削除する | | | diff --git a/reference/map/multimap/insert_range.md b/reference/map/multimap/insert_range.md new file mode 100644 index 0000000000..6e0baca7c6 --- /dev/null +++ b/reference/map/multimap/insert_range.md @@ -0,0 +1,78 @@ +# insert_range +* map[meta header] +* std[meta namespace] +* multimap[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +template R> +void insert_range(R&& rg); // C++23 +``` + +## 概要 +Range`rg` の要素を挿入することにより、`multimap` コンテナを拡張する。 + +これは、挿入された要素の数だけコンテナの [`size()`](size.md) を増やす。 + +内部的に `multimap` コンテナは、コンストラクト時に指定された比較オブジェクトによって要素を下位から上位へとソートして保持する。 + + +## 事前条件 +`*this` の要素の範囲と Range`rg` の要素の範囲が重複していないこと + + +## テンプレートパラメータ制約 +`value_type` は、コンテナに対して `EmplaceConstructible` であること + + +## 戻り値 +なし + + +## 計算量 +`N =` [`ranges::distance`](../../iterator/ranges_distance.md)`(rg)` とすると、`N log (size() + N)` に比例 + + +## 備考 +- 関数が呼ばれた後も、当該コンテナ内の要素を指す参照やイテレータは無効にはならない。 + なお、規格書に明確な記載は無いが、当該コンテナ内の要素を指すポインタも無効にはならない。 + + +## 例 +```cpp example +#include +#include +#include +#include + +int main () +{ + std::multimap m = {{'A', 10}, {'B', 11}}; + + std::vector> v = {{'B', 11}, {'C', 12}}; + m.insert_range(v); + + for (const auto& kv : m) { + std::cout << kv.first << " " << kv.second << std::endl; + } + + return 0; +} +``` +* insert_range[color ff0000] + +### 出力 +``` +A 10 +B 11 +B 11 +C 12 +``` + + +## 関連項目 + +| 名前 | 説明 | +|------------------------------------------------|--------------------------------------------| +| [`multimap::insert`](insert.md) | 要素を挿入する | From 2a0028887e04d4c234e19a32f15387df9e8459a7 Mon Sep 17 00:00:00 2001 From: suomesta Date: Mon, 5 Aug 2024 00:49:54 +0900 Subject: [PATCH 1122/3948] add insert_range to std::set and std::multiset (#1069) --- reference/set/multiset.md | 1 + reference/set/multiset/insert_range.md | 65 ++++++++++++++++++++++++++ reference/set/set.md | 1 + reference/set/set/insert_range.md | 64 +++++++++++++++++++++++++ 4 files changed, 131 insertions(+) create mode 100644 reference/set/multiset/insert_range.md create mode 100644 reference/set/set/insert_range.md diff --git a/reference/set/multiset.md b/reference/set/multiset.md index b00dee1077..595668e353 100644 --- a/reference/set/multiset.md +++ b/reference/set/multiset.md @@ -80,6 +80,7 @@ namespace std { |---------------------------------|------------------------------------------|-------| | [`clear`](multiset/clear.md) | 全ての要素を削除する | | | [`insert`](multiset/insert.md) | 要素を挿入する | | +| [`insert_range`](multiset/insert_range.md) | Rangeの要素を挿入する | C++23 | | [`emplace`](multiset/emplace.md) | 要素を直接構築する | C++11 | | [`emplace_hint`](multiset/emplace_hint.md) | ヒントを使って要素を直接構築する | C++11 | | [`erase`](multiset/erase.md) | 要素を削除する | diff --git a/reference/set/multiset/insert_range.md b/reference/set/multiset/insert_range.md new file mode 100644 index 0000000000..cb78279fc9 --- /dev/null +++ b/reference/set/multiset/insert_range.md @@ -0,0 +1,65 @@ +# insert_range +* set[meta header] +* std[meta namespace] +* multiset[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +template R> +void insert_range(R&& rg); // C++23 +``` + +## 概要 +Range`rg` の要素を挿入することにより、`multiset` コンテナを拡張する。 + + `set` コンテナは重複した値を許さないため、挿入操作はそれぞれの要素が他のコンテナ内の既存要素と同じ値かどうかをチェックし、同じ要素がすでにあれば挿入されない。`multiset`の場合には、同じ値の要素でも挿入される。 + + +## 戻り値 +なし + + +## 計算量 +`N =` [`ranges::distance`](../../iterator/ranges_distance.md)`(rg)` とすると、`N log (size() + N)` に比例 + + +## 備考 +- 関数が呼ばれた後も、当該コンテナ内の要素を指す参照やイテレータは無効にはならない。 + なお、規格書に明確な記載は無いが、当該コンテナ内の要素を指すポインタも無効にはならない。 + + +## 例 +```cpp example +#include +#include +#include + +int main () +{ + std::multiset s = {1, 2, 3}; + + std::vector v = {2, 3, 4}; + s.insert_range(v); + + for (int i : s) { + std::cout << i << " "; + } + std::cout << std::endl; + + return 0; +} +``` +* insert_range[color ff0000] + +### 出力 +``` +1 2 2 3 3 4 +``` + + +## 関連項目 + +| 名前 | 説明 | +|----------------------------|------------------------| +| [`insert`](insert.md) | 要素を挿入する | diff --git a/reference/set/set.md b/reference/set/set.md index eda67be00a..e564e5944f 100644 --- a/reference/set/set.md +++ b/reference/set/set.md @@ -81,6 +81,7 @@ namespace std { |---------------------------------|------------------------------------------|-------| | [`clear`](set/clear.md) | 全ての要素を削除する | | | [`insert`](set/insert.md) | 要素を挿入する | | +| [`insert_range`](set/insert_range.md) | Rangeの要素を挿入する | C++23 | | [`emplace`](set/emplace.md) | 要素を直接構築する | C++11 | | [`emplace_hint`](set/emplace_hint.md) | ヒントを使って要素を直接構築する | C++11 | | [`erase`](set/erase.md) | 要素を削除する | diff --git a/reference/set/set/insert_range.md b/reference/set/set/insert_range.md new file mode 100644 index 0000000000..e5e6becf34 --- /dev/null +++ b/reference/set/set/insert_range.md @@ -0,0 +1,64 @@ +# insert_range +* set[meta header] +* std[meta namespace] +* set[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +template R> +void insert_range(R&& rg); // C++23 +``` + +## 概要 +Range`rg` の要素を挿入することにより、`set` コンテナを拡張する。 + + `set` コンテナは重複した値を許さないため、挿入操作はそれぞれの要素が他のコンテナ内の既存要素と同じ値かどうかをチェックし、同じ要素がすでにあれば挿入されない。`multiset`の場合には、同じ値の要素でも挿入される。 + + +## 戻り値 +なし + + +## 計算量 +`N =` [`ranges::distance`](../../iterator/ranges_distance.md)`(rg)` とすると、`N log (size() + N)` に比例 + + +## 備考 +- 関数が呼ばれた後も、当該コンテナ内の要素を指す参照やイテレータは無効にはならない。 + なお、規格書に明確な記載は無いが、当該コンテナ内の要素を指すポインタも無効にはならない。 + + +## 例 +```cpp example +#include +#include +#include + +int main () +{ + std::set s = {1, 2, 3}; + + std::vector v = {2, 3, 4}; + s.insert_range(v); + + for (int i : s) { + std::cout << i << " "; + } + std::cout << std::endl; + + return 0; +} +``` +* insert_range[color ff0000] + +### 出力 +``` +1 2 3 4 +``` + +## 関連項目 + +| 名前 | 説明 | +|----------------------------|------------------------| +| [`insert`](insert.md) | 要素を挿入する | From 9235ec53337e6b39cf81edf1403ece357365ae49 Mon Sep 17 00:00:00 2001 From: suomesta Date: Mon, 5 Aug 2024 00:51:10 +0900 Subject: [PATCH 1123/3948] add insert_range to std::unordered_map and std::unordered_multimap (#1069) --- reference/unordered_map/unordered_map.md | 1 + .../unordered_map/insert_range.md | 74 +++++++++++++++++++ reference/unordered_map/unordered_multimap.md | 1 + .../unordered_multimap/insert_range.md | 74 +++++++++++++++++++ 4 files changed, 150 insertions(+) create mode 100644 reference/unordered_map/unordered_map/insert_range.md create mode 100644 reference/unordered_map/unordered_multimap/insert_range.md diff --git a/reference/unordered_map/unordered_map.md b/reference/unordered_map/unordered_map.md index ff31634285..cc119df6ba 100644 --- a/reference/unordered_map/unordered_map.md +++ b/reference/unordered_map/unordered_map.md @@ -103,6 +103,7 @@ namespace std { | [`try_emplace`](unordered_map/try_emplace.md) | キーが存在しない場合のみコンテナ内への要素の直接構築 | C++17 | | [`insert`](unordered_map/insert.md) | 要素の追加 | C++11 | | [`insert_or_assign`](unordered_map/insert_or_assign.md) | 要素の追加、あるいは代入 | C++17 | +| [`insert_range`](unordered_map/insert_range.md) | Rangeの要素を挿入する | C++23 | | [`erase`](unordered_map/erase.md) | 要素の削除 | C++11 | | [`clear`](unordered_map/clear.md) | 全要素の削除 | C++11 | | [`swap`](unordered_map/swap.md) | 内容の交換 | C++11 | diff --git a/reference/unordered_map/unordered_map/insert_range.md b/reference/unordered_map/unordered_map/insert_range.md new file mode 100644 index 0000000000..09141d2bc3 --- /dev/null +++ b/reference/unordered_map/unordered_map/insert_range.md @@ -0,0 +1,74 @@ +# insert_range +* unordered_map[meta header] +* std[meta namespace] +* unordered_map[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +template R> +void insert_range(R&& rg); // C++23 +``` + +## 概要 +コンテナにRange`rg` の要素を挿入する。 + + +## 効果 +Range`rg` のすべての要素 `t` に対して、`insert(t)` を呼び出した場合と等価。 + + +## 事前条件 +`*this` の要素の範囲と Range`rg` の要素の範囲が重複していないこと + + +## テンプレートパラメータ制約 +`value_type` は、コンテナに対して `EmplaceConstructible` であること + + +## 戻り値 +なし + + +## 計算量 +`N =` [`ranges::distance`](../../iterator/ranges_distance.md)`(rg)` とすると、平均的なケースでは `O(N)`、最悪のケースでは `O(N size() + 1)`。 + + +## 例 +```cpp example +#include +#include +#include +#include + +int main () +{ + std::unordered_map m = {{'A', 10}, {'B', 11}}; + + std::vector> v = {{'B', 11}, {'C', 12}}; + m.insert_range(v); + + for (const auto& kv : m) { + std::cout << kv.first << " " << kv.second << std::endl; + } + + return 0; +} +``` +* insert_range[color ff0000] + +### 出力 +``` +C 12 +B 11 +A 10 +``` +注:[`unordered_map`](/reference/unordered_map/unordered_map.md) は非順序連想コンテナであるため、出力順序は無意味であることに注意 + + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------------------|----------------------| +| [`insert`](insert.md) | 要素の追加 | +| [`insert_or_assign`](insert_or_assign.md) | 要素の追加、あるいは代入 | diff --git a/reference/unordered_map/unordered_multimap.md b/reference/unordered_map/unordered_multimap.md index 2ea59a1ff9..3bcbf5adbb 100644 --- a/reference/unordered_map/unordered_multimap.md +++ b/reference/unordered_map/unordered_multimap.md @@ -101,6 +101,7 @@ namespace std { | [`emplace`](unordered_multimap/emplace.md) | コンテナ内への要素の直接構築 | C++11 | | [`emplace_hint`](unordered_multimap/emplace_hint.md) | 挿入位置のヒントを使用したコンテナ内への要素の直接構築 | C++11 | | [`insert`](unordered_multimap/insert.md) | 要素の追加 | C++11 | +| [`insert_range`](unordered_multimap/insert_range.md) | Rangeの要素を挿入する | C++23 | | [`erase`](unordered_multimap/erase.md) | 要素の削除 | C++11 | | [`clear`](unordered_multimap/clear.md) | 全要素の削除 | C++11 | | [`swap`](unordered_multimap/swap.md) | 内容の交換 | C++11 | diff --git a/reference/unordered_map/unordered_multimap/insert_range.md b/reference/unordered_map/unordered_multimap/insert_range.md new file mode 100644 index 0000000000..922c6050e1 --- /dev/null +++ b/reference/unordered_map/unordered_multimap/insert_range.md @@ -0,0 +1,74 @@ +# insert_range +* unordered_map[meta header] +* std[meta namespace] +* unordered_multimap[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +template R> +void insert_range(R&& rg); // C++23 +``` + +## 概要 +コンテナにRange`rg` の要素を挿入する。 + + +## 効果 +Range`rg` のすべての要素 `t` に対して、`insert(t)` を呼び出した場合と等価。 + + +## 事前条件 +`*this` の要素の範囲と Range`rg` の要素の範囲が重複していないこと + + +## テンプレートパラメータ制約 +`value_type` は、コンテナに対して `EmplaceConstructible` であること + + +## 戻り値 +なし + + +## 計算量 +`N =` [`ranges::distance`](../../iterator/ranges_distance.md)`(rg)` とすると、平均的なケースでは `O(N)`、最悪のケースでは `O(N size() + 1)`。 + + +## 例 +```cpp example +#include +#include +#include +#include + +int main () +{ + std::unordered_multimap m = {{'A', 10}, {'B', 11}}; + + std::vector> v = {{'B', 11}, {'C', 12}}; + m.insert_range(v); + + for (const auto& kv : m) { + std::cout << kv.first << " " << kv.second << std::endl; + } + + return 0; +} +``` +* insert_range[color ff0000] + +### 出力 +``` +C 12 +B 11 +B 11 +A 10 +``` +注:[`unordered_multimap`](/reference/unordered_map/unordered_multimap.md) は非順序連想コンテナであるため、出力順序は無意味であることに注意 + + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------------------|----------------------| +| [`insert`](insert.md) | 要素の追加 | From 192845fce933cc94a12f315fe27d37badad3a53c Mon Sep 17 00:00:00 2001 From: suomesta Date: Mon, 5 Aug 2024 00:52:15 +0900 Subject: [PATCH 1124/3948] add insert_range to std::unordered_set and std::unordered_multiset (#1069) --- reference/unordered_set/unordered_multiset.md | 1 + .../unordered_multiset/insert_range.md | 71 +++++++++++++++++++ reference/unordered_set/unordered_set.md | 1 + .../unordered_set/insert_range.md | 71 +++++++++++++++++++ 4 files changed, 144 insertions(+) create mode 100644 reference/unordered_set/unordered_multiset/insert_range.md create mode 100644 reference/unordered_set/unordered_set/insert_range.md diff --git a/reference/unordered_set/unordered_multiset.md b/reference/unordered_set/unordered_multiset.md index 8b6ce610f1..5efc49c18b 100644 --- a/reference/unordered_set/unordered_multiset.md +++ b/reference/unordered_set/unordered_multiset.md @@ -99,6 +99,7 @@ namespace std { | [`emplace`](unordered_multiset/emplace.md) | コンテナ内への要素の直接構築 | C++11 | | [`emplace_hint`](unordered_multiset/emplace_hint.md) | 挿入位置のヒントを使用したコンテナ内への要素の直接構築 | C++11 | | [`insert`](unordered_multiset/insert.md) | 要素の追加 | C++11 | +| [`insert_range`](unordered_multiset/insert_range.md) | Rangeの要素を挿入する | C++23 | | [`erase`](unordered_multiset/erase.md) | 要素の削除 | C++11 | | [`clear`](unordered_multiset/clear.md) | 全要素の削除 | C++11 | | [`swap`](unordered_multiset/swap.md) | 内容の交換 | C++11 | diff --git a/reference/unordered_set/unordered_multiset/insert_range.md b/reference/unordered_set/unordered_multiset/insert_range.md new file mode 100644 index 0000000000..f44f7a72f5 --- /dev/null +++ b/reference/unordered_set/unordered_multiset/insert_range.md @@ -0,0 +1,71 @@ +# insert_range +* unordered_set[meta header] +* std[meta namespace] +* unordered_multiset[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +template R> +void insert_range(R&& rg); // C++23 +``` + +## 概要 +コンテナにRange`rg` の要素を挿入する。 + + +## 効果 +Range`rg` のすべての要素 `t` に対して、`insert(t)` を呼び出した場合と等価。 + + +## 事前条件 +`*this` の要素の範囲と Range`rg` の要素の範囲が重複していないこと + + +## テンプレートパラメータ制約 +`value_type` は、コンテナに対して `EmplaceConstructible` であること + + +## 戻り値 +なし + + +## 計算量 +`N =` [`ranges::distance`](../../iterator/ranges_distance.md)`(rg)` とすると、平均的なケースでは `O(N)`、最悪のケースでは `O(N size() + 1)`。 + + +## 例 +```cpp example +#include +#include +#include + +int main () +{ + std::unordered_multiset s = {1, 2, 3}; + + std::vector v = {2, 3, 4}; + s.insert_range(v); + + for (int i : s) { + std::cout << i << " "; + } + std::cout << std::endl; + + return 0; +} +``` +* insert_range[color ff0000] + +### 出力 +``` +4 3 3 2 2 1 +``` +注:[`unordered_multiset`](/reference/unordered_set/unordered_multiset.md) は非順序連想コンテナであるため、出力順序は無意味であることに注意 + + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------------------|----------------------| +| [`insert`](insert.md) | 要素の追加 | diff --git a/reference/unordered_set/unordered_set.md b/reference/unordered_set/unordered_set.md index b5913aff73..f66dc57141 100644 --- a/reference/unordered_set/unordered_set.md +++ b/reference/unordered_set/unordered_set.md @@ -97,6 +97,7 @@ namespace std { | [`emplace`](unordered_set/emplace.md) | コンテナ内への要素の直接構築 | C++11 | | [`emplace_hint`](unordered_set/emplace_hint.md) | 挿入位置のヒントを使用したコンテナ内への要素の直接構築 | C++11 | | [`insert`](unordered_set/insert.md) | 要素の追加 | C++11 | +| [`insert_range`](unordered_set/insert_range.md) | Rangeの要素を挿入する | C++23 | | [`erase`](unordered_set/erase.md) | 要素の削除 | C++11 | | [`clear`](unordered_set/clear.md) | 全要素の削除 | C++11 | | [`swap`](unordered_set/swap.md) | 内容の交換 | C++11 | diff --git a/reference/unordered_set/unordered_set/insert_range.md b/reference/unordered_set/unordered_set/insert_range.md new file mode 100644 index 0000000000..eb1b80ecc4 --- /dev/null +++ b/reference/unordered_set/unordered_set/insert_range.md @@ -0,0 +1,71 @@ +# insert_range +* unordered_set[meta header] +* std[meta namespace] +* unordered_set[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +template R> +void insert_range(R&& rg); // C++23 +``` + +## 概要 +コンテナにRange`rg` の要素を挿入する。 + + +## 効果 +Range`rg` のすべての要素 `t` に対して、`insert(t)` を呼び出した場合と等価。 + + +## 事前条件 +`*this` の要素の範囲と Range`rg` の要素の範囲が重複していないこと + + +## テンプレートパラメータ制約 +`value_type` は、コンテナに対して `EmplaceConstructible` であること + + +## 戻り値 +なし + + +## 計算量 +`N =` [`ranges::distance`](../../iterator/ranges_distance.md)`(rg)` とすると、平均的なケースでは `O(N)`、最悪のケースでは `O(N size() + 1)`。 + + +## 例 +```cpp example +#include +#include +#include + +int main () +{ + std::unordered_set s = {1, 2, 3}; + + std::vector v = {2, 3, 4}; + s.insert_range(v); + + for (int i : s) { + std::cout << i << " "; + } + std::cout << std::endl; + + return 0; +} +``` +* insert_range[color ff0000] + +### 出力 +``` +4 3 2 1 +``` +注:[`unordered_set`](/reference/unordered_set/unordered_set.md) は非順序連想コンテナであるため、出力順序は無意味であることに注意 + + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------------------|----------------------| +| [`insert`](insert.md) | 要素の追加 | From 4c687584f5b2ee2c9130bbb3ef05eea3d92fb94e Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 5 Aug 2024 18:00:59 +0900 Subject: [PATCH 1125/3948] =?UTF-8?q?=20:=20C++23=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C=E3=81=A8=E3=81=97=E3=81=A6allocate=5Fat=5Fleast?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20(close=20#1053)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23.md | 4 +- reference/memory.md | 2 + reference/memory/allocate_at_least.md | 70 +++++++++++++++ reference/memory/allocation_result.md | 42 +++++++++ reference/memory/allocator.md | 1 + reference/memory/allocator/allocate.md | 4 + .../memory/allocator/allocate_at_least.md | 86 +++++++++++++++++++ reference/memory/allocator/deallocate.md | 12 ++- 8 files changed, 218 insertions(+), 3 deletions(-) create mode 100644 reference/memory/allocate_at_least.md create mode 100644 reference/memory/allocation_result.md create mode 100644 reference/memory/allocator/allocate_at_least.md diff --git a/lang/cpp23.md b/lang/cpp23.md index 9da6aea8ef..0db181eb61 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -128,7 +128,9 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 ### コンテナ - [`std::stack`](/reference/stack/stack.md)と[`std::queue`](/reference/queue/queue.md)に、イテレータのペアをとるコンストラクタを追加 - `auto v = std::vector(v, alloc);`のようなアロケータ引数をともなう場合のクラステンプレートのテンプレート引数推論が動作しなかったため、各コンテナクラスのコンストラクタにおけるアロケータパラメータの型を`const Allocator&`から`const` [`std::type_identity_t`](/reference/type_traits/type_identity.md)`&`に修正 -- N要素のメモリアロケート時にアロケータが実際にどれくらいのメモリを確保したかを得られるインタフェースとして、[`std::allocator`](/reference/memory/allocator.md)クラスに、[`allocate_at_least()`](/reference/memory/allocator/allocate_at_least.md.nolink)メンバ関数を追加 +- N要素のメモリアロケート時にアロケータが実際にどれくらいのメモリを確保したかを得られるインタフェースとして、 + - [`std::allocator`](/reference/memory/allocator.md)クラスに、[`allocate_at_least()`](/reference/memory/allocator/allocate_at_least.md)メンバ関数を追加 + - [`std::allocate_at_least()`](/reference/memory/allocate_at_least.md)関数を追加 - [`std::pair`](/reference/utility/pair.md)の転送コンストラクタにデフォルトテンプレート引数を追加することで、`{}`のような型推論ができない引数を渡した場合でも完全転送が行われるよう修正 - 順序付き連想コンテナの要素削除の処理について、一時オブジェクトのコストを抑える拡張が行われた - [`std::map::erase()`](/reference/map/map/erase.md) diff --git a/reference/memory.md b/reference/memory.md index 557152dbd9..e6d02b07b5 100644 --- a/reference/memory.md +++ b/reference/memory.md @@ -14,6 +14,8 @@ |--------------------------------------------------|--------------------------------------------|-------| | [`allocator`](memory/allocator.md) | メモリアロケータの標準実装(class template) | | | [`allocator_traits`](memory/allocator_traits.md) | アロケータクラスへの間接的なアクセス(class template) | C++11 | +| [`allocation_result`](memory/allocation_result.md) | [`allocate_at_least()`](memory/allocate_at_least.md)関数の戻り値型 | C++23 | +| [`allocate_at_least`](memory/allocate_at_least.md) | 指定した要素数以上のメモリを確保する | C++23 | | [`allocator_arg_t`](memory/allocator_arg_t.md) | アロケータを引数として渡す際の、オーバーロード解決のためのタグ(class) | C++11 | | [`allocator_arg`](memory/allocator_arg_t.md) | アロケータを引数として渡す際の、オーバーロード解決のためのタグ(constant value) | C++11 | | [`uses_allocator`](memory/uses_allocator.md) | 型`T`がアロケータを使用するか調べる | C++11 | diff --git a/reference/memory/allocate_at_least.md b/reference/memory/allocate_at_least.md new file mode 100644 index 0000000000..02f48b8ae5 --- /dev/null +++ b/reference/memory/allocate_at_least.md @@ -0,0 +1,70 @@ +# alloacte_at_least +* memory[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template + [[nodiscard] constexpr + allocation_result::pointer> + allocate_at_least(Allocator& a, size_t n); // (1) C++23 +} +``` +* allocation_result[link /reference/memory/allocation_result.md] +* allocator_traits[link /reference/memory/allocator_traits.md] + +## 概要 +指定した要素数以上のメモリを確保する。 + +多くのメモリアロケータはメモリ確保時に指定されたサイズちょうどではなく、少し大きなサイズを確保する。この関数は、確保されたメモリへのポインタに加えて、実際に確保されたメモリサイズを取得できる。 + + +## 戻り値 +式`a.allocate_at_least(n)`が妥当である場合、それを呼び出して返す。そうでなければ、`{a.allocate(n), n}`を返す。 + + +## 例 +```cpp example +#include +#include + +int main() { + std::allocator alloc; + + std::allocation_result r = std::allocate_at_least(alloc, 3); + std::cout << "allocation count:" << r.count + << " bytes:" << sizeof(int) * r.count + << std::endl; + + alloc.deallocate(r.ptr, r.count); +} +``` +* std::allocate_at_least[color ff0000] +* std::allocator[link /reference/memory/allocator.md] +* std::allocation_result[link /reference/memory/allocation_result.md] +* alloc.deallocate[link /reference/memory/allocator/deallocate.md] + +### 出力例 +``` +allocation count:4 bytes:16 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 19 [mark noimpl] +- [GCC](/implementation.md#gcc): 14 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 10 [mark noimpl] + + +## 関連項目 +- [`std::allocation_result`](/reference/memory/allocation_result.md) +- [`std::allocator`](allocator.md)`::`[`allocate_at_least()`](allocator/allocate_at_least.md) + + +## 参照 +- [P0401R6 Providing size feedback in the Allocator interface](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0401r6.html) diff --git a/reference/memory/allocation_result.md b/reference/memory/allocation_result.md new file mode 100644 index 0000000000..4ede4665c6 --- /dev/null +++ b/reference/memory/allocation_result.md @@ -0,0 +1,42 @@ +# allocation_result +* memory[meta header] +* std[meta namespace] +* class[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template + struct allocation_result { + Pointer ptr; + std::size_t count; + }; +} +``` + +## 概要 +`std::allocation_result`は、[`std::allocate_at_least()`](allocate_at_least.md)関数の戻り値型であり、以下の要素をもつ: + +| 変数名 | 説明 | +|---------|------| +| `ptr` | 確保されたメモリの先頭を指すポインタ | +| `count` | 実際に確保された要素数 | + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 19 [mark noimpl] +- [GCC](/implementation.md#gcc): 14 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 10 [mark noimpl] + + +## 関連項目 +- [`std::allocate_at_least()`](allocate_at_least.md) +- [`std::allocator`](allocator.md)`::`[`allocate_at_least()`](allocator/allocate_at_least.md) + + +## 参照 +- [P0401R6 Providing size feedback in the Allocator interface](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0401r6.html) diff --git a/reference/memory/allocator.md b/reference/memory/allocator.md index 2c78db3210..f38eef148c 100644 --- a/reference/memory/allocator.md +++ b/reference/memory/allocator.md @@ -43,6 +43,7 @@ C++11から: | [`(destructor)`](allocator/op_destructor.md) | デストラクタ | | | [`operator=`](allocator/op_assign.md) | 代入演算子 | | | [`allocate`](allocator/allocate.md) | メモリを確保する | | +| [`allocate_at_least`](allocator/allocate_at_least.md) | 指定した要素数以上のメモリを確保する | C++23 | | [`deallocate`](allocator/deallocate.md) | メモリを解放する | | | [`address`](allocator/address.md) | 変数のアドレスを取得する | C++17から非推奨
C++20で削除 | | [`max_size`](allocator/max_size.md) | 一度に確保可能なメモリの最大サイズを取得する | C++17から非推奨
C++20で削除 | diff --git a/reference/memory/allocator/allocate.md b/reference/memory/allocator/allocate.md index 086fec5857..f7043fcaf5 100644 --- a/reference/memory/allocator/allocate.md +++ b/reference/memory/allocator/allocate.md @@ -59,6 +59,10 @@ int main() ``` +## 関連項目 +- [`allocate_at_least()`](allocate_at_least.md) + + ## 参照 - [P0174R2 Deprecating Vestigial Library Parts in C++17](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0174r2.html) - [P0600R1 `[[nodiscard]]` in the Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf) diff --git a/reference/memory/allocator/allocate_at_least.md b/reference/memory/allocator/allocate_at_least.md new file mode 100644 index 0000000000..7bbb019728 --- /dev/null +++ b/reference/memory/allocator/allocate_at_least.md @@ -0,0 +1,86 @@ +# alloacte_at_least +* memory[meta header] +* std[meta namespace] +* allocator[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + [[nodiscard] constexpr allocation_result + allocate_at_least(size_t n); // (1) C++23 +} +``` +* allocation_result[link /reference/memory/allocation_result.md] + +## 概要 +指定した要素数以上のメモリを確保する。 + +多くのメモリアロケータはメモリ確保時に指定されたサイズちょうどではなく、少し大きなサイズを確保する。この関数は、確保されたメモリへのポインタに加えて、実際に確保されたメモリサイズを取得できる。 + + +## 適格要件 +- 型`T`が不完全型ではないこと + + +## 戻り値 +確保された配列の先頭要素へのポインタを`ptr`、`n`以上である実際に確保された要素数を`count`として、 + +```cpp +return allocation_result{ptr, count}; +``` +* allocation_result[link /reference/memory/allocation_result.md] + + +## 例外 +- [`std::numeric_limits`](/reference/limits/numeric_limits.md)`<`[`std::size_t`](/reference/cstddef/size_t.md)`>::`[`max()`](/reference/limits/numeric_limits/max.md) `/ sizeof(T) < n`である場合、[`std::bad_array_new_length`](/reference/new/bad_array_new_length.md)を送出する +- メモリを確保できなかった場合、[`std::bad_alloc`](/reference/new/bad_alloc.md)を送出する + + +## 備考 +- 配列のメモリは`::operator new`を呼び出すことで確保できるが、その関数がいつ・どれくらいの頻度で呼び出されるかは未規定 +- この関数は配列オブジェクトの生存期間を開始するが、配列要素の生存期間は開始しない + + +## 例 +```cpp example +#include +#include + +int main() { + std::allocator alloc; + + std::allocation_result r = alloc.allocate_at_least(3); + std::cout << "allocation count:" << r.count + << " bytes:" << sizeof(int) * r.count + << std::endl; + + alloc.deallocate(r.ptr, r.count); +} +``` +* alloc.allocate_at_least[color ff0000] +* std::allocation_result[link /reference/memory/allocation_result.md] +* alloc.deallocate[link /reference/memory/allocator/deallocate.md] + +### 出力例 +``` +allocation count:4 bytes:16 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 19 [mark noimpl] +- [GCC](/implementation.md#gcc): 14 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 10 [mark noimpl] + + +## 関連項目 +- [`std::allocation_result`](/reference/memory/allocation_result.md) +- [`std::allocate_at_least()`](/reference/memory/allocate_at_least.md) + + +## 参照 +- [P0401R6 Providing size feedback in the Allocator interface](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0401r6.html) diff --git a/reference/memory/allocator/deallocate.md b/reference/memory/allocator/deallocate.md index 393c1cba72..694e5493f4 100644 --- a/reference/memory/allocator/deallocate.md +++ b/reference/memory/allocator/deallocate.md @@ -13,8 +13,14 @@ constexpr void deallocate(pointer p, size_type n); // C++20 から メモリを解放する。 -## 要件 -`p`は、[`allocate()`](allocate.md)によって確保されたポインタ値であること。`n`は、アロケートされた`p`のサイズと同じであること。 +## 事前条件 +- C++20まで + - `p`は、[`allocate()`](allocate.md)によって確保されたポインタ値であること。`n`は、アロケートされた`p`のサイズと同じであること +- C++23以降 + - `p`が[`allocate_at_least()`](allocate_at_least.md)によって確保されたポインタ値である場合、[`allocate_at_least()`](allocate_at_least.md)の戻り値を`ret`、その呼び出しで要求されたサイズを`req`として、 + - `p`は`ret.ptr`と等しいこと + - `n`は`req <= n <= ret.count`となる値であること + - そうでなければ、`p`は、[`allocate()`](allocate.md)によって確保されたポインタ値であること。`n`は、アロケートされた`p`のサイズと同じであること ## 効果 @@ -51,3 +57,5 @@ int main() ## 参照 - [C++14 サイズ付きデアロケーション](/lang/cpp14/sized_deallocation.md) - [P0784R7 More constexpr containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0784r7.html) +- [P0401R6 Providing size feedback in the Allocator interface](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0401r6.html) + - C++23で`allocate_at_least()`関数が導入されたことにより、この関数の事前条件として、渡される値にその関数の戻り値であることも考慮された From dde880f67613f1641b153911ad1d2dfc3003167e Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 5 Aug 2024 19:26:27 +0900 Subject: [PATCH 1126/3948] =?UTF-8?q?=20:=20allocate=5Fat=5Fleast?= =?UTF-8?q?=E3=81=AE=E4=BB=95=E6=A7=98=E3=81=AB=E5=8F=96=E3=82=8A=E8=BE=BC?= =?UTF-8?q?=E3=81=BE=E3=82=8C=E3=81=9F=E6=96=87=E9=9D=A2=E3=81=8C=E6=8F=90?= =?UTF-8?q?=E6=A1=88=E6=96=87=E6=9B=B8=E3=81=A8=E3=81=A1=E3=81=8C=E3=81=A3?= =?UTF-8?q?=E3=81=A6=E3=81=84=E3=81=9F=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=20#1053?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23.md | 2 +- reference/memory.md | 3 +-- reference/memory/allocation_result.md | 8 ++++---- .../memory/allocator/allocate_at_least.md | 2 +- reference/memory/allocator_traits.md | 1 + .../allocate_at_least.md | 18 ++++++++---------- 6 files changed, 16 insertions(+), 18 deletions(-) rename reference/memory/{ => allocator_traits}/allocate_at_least.md (78%) diff --git a/lang/cpp23.md b/lang/cpp23.md index 0db181eb61..29ff521427 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -130,7 +130,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 - `auto v = std::vector(v, alloc);`のようなアロケータ引数をともなう場合のクラステンプレートのテンプレート引数推論が動作しなかったため、各コンテナクラスのコンストラクタにおけるアロケータパラメータの型を`const Allocator&`から`const` [`std::type_identity_t`](/reference/type_traits/type_identity.md)`&`に修正 - N要素のメモリアロケート時にアロケータが実際にどれくらいのメモリを確保したかを得られるインタフェースとして、 - [`std::allocator`](/reference/memory/allocator.md)クラスに、[`allocate_at_least()`](/reference/memory/allocator/allocate_at_least.md)メンバ関数を追加 - - [`std::allocate_at_least()`](/reference/memory/allocate_at_least.md)関数を追加 + - [`std::allocator_traits`](/reference/memory/allocator_traits.md)クラスに、[`allocate_at_least()`](/reference/memory/allocator_traits/allocate_at_least.md)関数を追加 - [`std::pair`](/reference/utility/pair.md)の転送コンストラクタにデフォルトテンプレート引数を追加することで、`{}`のような型推論ができない引数を渡した場合でも完全転送が行われるよう修正 - 順序付き連想コンテナの要素削除の処理について、一時オブジェクトのコストを抑える拡張が行われた - [`std::map::erase()`](/reference/map/map/erase.md) diff --git a/reference/memory.md b/reference/memory.md index e6d02b07b5..dd7ba36e12 100644 --- a/reference/memory.md +++ b/reference/memory.md @@ -14,8 +14,7 @@ |--------------------------------------------------|--------------------------------------------|-------| | [`allocator`](memory/allocator.md) | メモリアロケータの標準実装(class template) | | | [`allocator_traits`](memory/allocator_traits.md) | アロケータクラスへの間接的なアクセス(class template) | C++11 | -| [`allocation_result`](memory/allocation_result.md) | [`allocate_at_least()`](memory/allocate_at_least.md)関数の戻り値型 | C++23 | -| [`allocate_at_least`](memory/allocate_at_least.md) | 指定した要素数以上のメモリを確保する | C++23 | +| [`allocation_result`](memory/allocation_result.md) | [`allocate_at_least()`](memory/allocator/allocate_at_least.md)関数の戻り値型 | C++23 | | [`allocator_arg_t`](memory/allocator_arg_t.md) | アロケータを引数として渡す際の、オーバーロード解決のためのタグ(class) | C++11 | | [`allocator_arg`](memory/allocator_arg_t.md) | アロケータを引数として渡す際の、オーバーロード解決のためのタグ(constant value) | C++11 | | [`uses_allocator`](memory/uses_allocator.md) | 型`T`がアロケータを使用するか調べる | C++11 | diff --git a/reference/memory/allocation_result.md b/reference/memory/allocation_result.md index 4ede4665c6..e4cc727d7a 100644 --- a/reference/memory/allocation_result.md +++ b/reference/memory/allocation_result.md @@ -6,16 +6,16 @@ ```cpp namespace std { - template + template struct allocation_result { Pointer ptr; - std::size_t count; + SizeType count; }; } ``` ## 概要 -`std::allocation_result`は、[`std::allocate_at_least()`](allocate_at_least.md)関数の戻り値型であり、以下の要素をもつ: +`std::allocation_result`は、[`allocate_at_least()`](/reference/memory/allocator/allocate_at_least.md)関数の戻り値型であり、以下の要素をもつ: | 変数名 | 説明 | |---------|------| @@ -34,7 +34,7 @@ namespace std { ## 関連項目 -- [`std::allocate_at_least()`](allocate_at_least.md) +- [`std::allocator_traits`](allocator_traits.md)`::`[`allocate_at_least()`](allocator_traits/allocate_at_least.md) - [`std::allocator`](allocator.md)`::`[`allocate_at_least()`](allocator/allocate_at_least.md) diff --git a/reference/memory/allocator/allocate_at_least.md b/reference/memory/allocator/allocate_at_least.md index 7bbb019728..fd447e41a6 100644 --- a/reference/memory/allocator/allocate_at_least.md +++ b/reference/memory/allocator/allocate_at_least.md @@ -79,7 +79,7 @@ allocation count:4 bytes:16 ## 関連項目 - [`std::allocation_result`](/reference/memory/allocation_result.md) -- [`std::allocate_at_least()`](/reference/memory/allocate_at_least.md) +- [`std::allocator_traits`](/reference/memory/allocator_traits.md)`::`[`allocate_at_least()`](/reference/memory/allocator_traits/allocate_at_least.md) ## 参照 diff --git a/reference/memory/allocator_traits.md b/reference/memory/allocator_traits.md index f54b89d8b5..2eabf8b132 100644 --- a/reference/memory/allocator_traits.md +++ b/reference/memory/allocator_traits.md @@ -26,6 +26,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |--------------------------------------------------|----------------------------------------------|-------| | [`allocate`](allocator_traits/allocate.md) | メモリを確保する | C++11 | +| [`allocate_at_least`](allocator_traits/allocate_at_least.md) | 指定した要素数以上のメモリを確保する | C++23 | | [`deallocate`](allocator_traits/deallocate.md) | メモリを解放する | C++11 | | [`max_size`](allocator_traits/max_size.md) | 一度に確保可能なメモリの最大サイズを取得する | C++11 | | [`construct`](allocator_traits/construct.md) | 引数を元にインスタンスを構築する | C++11 | diff --git a/reference/memory/allocate_at_least.md b/reference/memory/allocator_traits/allocate_at_least.md similarity index 78% rename from reference/memory/allocate_at_least.md rename to reference/memory/allocator_traits/allocate_at_least.md index 02f48b8ae5..2b20c85f78 100644 --- a/reference/memory/allocate_at_least.md +++ b/reference/memory/allocator_traits/allocate_at_least.md @@ -1,19 +1,16 @@ # alloacte_at_least * memory[meta header] * std[meta namespace] +* allocator_traits[meta class] * function template[meta id-type] * cpp23[meta cpp] ```cpp -namespace std { - template - [[nodiscard] constexpr - allocation_result::pointer> - allocate_at_least(Allocator& a, size_t n); // (1) C++23 -} +[[nodiscard] static constexpr +allocation_result + allocate_at_least(Alloc& a, size_type n); // (1) C++23 ``` * allocation_result[link /reference/memory/allocation_result.md] -* allocator_traits[link /reference/memory/allocator_traits.md] ## 概要 指定した要素数以上のメモリを確保する。 @@ -32,8 +29,9 @@ namespace std { int main() { std::allocator alloc; + using traits = std::allocator_traits>; - std::allocation_result r = std::allocate_at_least(alloc, 3); + std::allocation_result r = traits::allocate_at_least(alloc, 3); std::cout << "allocation count:" << r.count << " bytes:" << sizeof(int) * r.count << std::endl; @@ -41,7 +39,7 @@ int main() { alloc.deallocate(r.ptr, r.count); } ``` -* std::allocate_at_least[color ff0000] +* allocate_at_least[color ff0000] * std::allocator[link /reference/memory/allocator.md] * std::allocation_result[link /reference/memory/allocation_result.md] * alloc.deallocate[link /reference/memory/allocator/deallocate.md] @@ -63,7 +61,7 @@ allocation count:4 bytes:16 ## 関連項目 - [`std::allocation_result`](/reference/memory/allocation_result.md) -- [`std::allocator`](allocator.md)`::`[`allocate_at_least()`](allocator/allocate_at_least.md) +- [`std::allocator`](/reference/memory/allocator.md)`::`[`allocate_at_least()`](/reference/memory/allocator/allocate_at_least.md) ## 参照 From 9df544a5b97ad04c307c4178371ca139be79a021 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Tue, 6 Aug 2024 17:39:27 +0900 Subject: [PATCH 1127/3948] =?UTF-8?q?multiset=E3=81=A8multimap=E3=81=AEmer?= =?UTF-8?q?ge=E3=81=AE=E8=AA=AC=E6=98=8E=E3=81=AE=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E3=81=A8ICC=E3=81=AE=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7?= =?UTF-8?q?=E3=83=B3=E3=81=AE=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/map/multimap/merge.md | 3 +-- reference/set/multiset/merge.md | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/reference/map/multimap/merge.md b/reference/map/multimap/merge.md index 4c0468a3aa..922be06c26 100644 --- a/reference/map/multimap/merge.md +++ b/reference/map/multimap/merge.md @@ -18,7 +18,6 @@ template ## 概要 引数 `source` 内の各要素を抽出し、`*this` の比較オブジェクトを使用して `*this` への挿入を試みる。 -`source` の要素のキーと等価なキーの要素がある場合、その要素は `source` から抽出されない。 また、この操作で要素はコピーもムーブもされない。 @@ -93,7 +92,7 @@ m2 : ### 処理系 - [Clang](/implementation.md#clang): 8.0.0 [mark verified] - [GCC](/implementation.md#gcc): 7.1.0 [mark verified] -- [ICC](/implementation.md#icc): ?? +- [ICC](/implementation.md#icc): 2021.10.0 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 [mark verified] diff --git a/reference/set/multiset/merge.md b/reference/set/multiset/merge.md index 8de86225a9..de1853859e 100644 --- a/reference/set/multiset/merge.md +++ b/reference/set/multiset/merge.md @@ -17,8 +17,7 @@ template ``` ## 概要 -引数 `source` 内の各要素を抽出し、`*this` の比較オブジェクトを使用して `*this` への挿入を試みる。 -`source` の要素のキーと等価なキーの要素がある場合、その要素は `source` から抽出されない。 +引数 `source` 内の各要素を抽出し、`*this` の比較オブジェクトを使用して `*this` へ挿入する。 また、この操作で要素はコピーもムーブもされない。 @@ -86,7 +85,7 @@ s2 = { 10, 10, 20, 30 } ### 処理系 - [Clang](/implementation.md#clang): 8.0.0 [mark verified] - [GCC](/implementation.md#gcc): 7.1.0 [mark verified] -- [ICC](/implementation.md#icc): ?? +- [ICC](/implementation.md#icc): 2021.10.0 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2017 Update 5 [mark verified] From 38cc9e4322920277ad6e6375e9e53bab162723e9 Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 7 Aug 2024 17:59:17 +0900 Subject: [PATCH 1128/3948] =?UTF-8?q?linalg:=20=E8=A1=A8=E7=A4=BA=E5=B4=A9?= =?UTF-8?q?=E3=82=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/linalg/imag-if-needed.md | 1 + reference/linalg/multipliable.md | 9 +++++---- reference/linalg/possibly-multipliable.md | 9 +++++---- reference/linalg/real-if-needed.md | 1 + 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/reference/linalg/imag-if-needed.md b/reference/linalg/imag-if-needed.md index 07b134af7c..8be49a2091 100644 --- a/reference/linalg/imag-if-needed.md +++ b/reference/linalg/imag-if-needed.md @@ -15,6 +15,7 @@ template T imag(const T&) = delete; ``` + 2. そうでない場合、`((void)E, T{})` diff --git a/reference/linalg/multipliable.md b/reference/linalg/multipliable.md index 71e7453236..652161673b 100644 --- a/reference/linalg/multipliable.md +++ b/reference/linalg/multipliable.md @@ -1,5 +1,5 @@ # multipliable - +* [mathjax enable] * linalg[meta header] * function template[meta id-type] * std::linalg[meta namespace] @@ -45,9 +45,10 @@ namespace std::linalg { ## 戻り値 `InMat`型の変数を`A`, `InVec`型の変数を`x`, `OutVec`型の変数を`y`とする。 -- (1): $y \leftarrow Ax$が可能なら`true`、そうでないなら`false` -- (2): $y^t \leftarrow x^t A$が可能なら`true`、そうでないなら`false` -- (3): `InMat1`型の変数を`A`, `InMat2`型の変数を`B`, `OutMat`型の変数`C`とすると、$C \leftarrow AB$が可能なら`true`、そうでないなら`false` + +- (1): $y \leftarrow Ax$ が可能なら`true`、そうでないなら`false` +- (2): $y^t \leftarrow x^t A$ が可能なら`true`、そうでないなら`false` +- (3): `InMat1`型の変数を`A`, `InMat2`型の変数を`B`, `OutMat`型の変数`C`とすると、$C \leftarrow AB$ が可能なら`true`、そうでないなら`false` ## バージョン diff --git a/reference/linalg/possibly-multipliable.md b/reference/linalg/possibly-multipliable.md index 296e359549..1d3e83068a 100644 --- a/reference/linalg/possibly-multipliable.md +++ b/reference/linalg/possibly-multipliable.md @@ -1,5 +1,5 @@ # possibly-multipliable - +* [mathjax enable] * linalg[meta header] * function template[meta id-type] * std::linalg[meta namespace] @@ -39,9 +39,10 @@ namespace std::linalg { ## 戻り値 `InMat`型の変数を`A`, `InVec`型の変数を`x`, `OutVec`型の変数を`y`とする。 -- (1): $y \leftarrow Ax$が可能なら`true`、そうでないなら`false` -- (2): $y^t \leftarrow x^t A$が可能なら`true`、そうでないなら`false` -- (3): `InMat1`型の変数を`A`, `InMat2`型の変数を`B`, `OutMat`型の変数`C`とすると、$C \leftarrow AB$が可能なら`true`、そうでないなら`false` + +- (1): $y \leftarrow Ax$ が可能なら`true`、そうでないなら`false` +- (2): $y^t \leftarrow x^t A$ が可能なら`true`、そうでないなら`false` +- (3): `InMat1`型の変数を`A`, `InMat2`型の変数を`B`, `OutMat`型の変数`C`とすると、$C \leftarrow AB$ が可能なら`true`、そうでないなら`false` ## バージョン diff --git a/reference/linalg/real-if-needed.md b/reference/linalg/real-if-needed.md index 179fa62657..864716fc8f 100644 --- a/reference/linalg/real-if-needed.md +++ b/reference/linalg/real-if-needed.md @@ -15,6 +15,7 @@ template T real(const T&) = delete; ``` + 2. そうでない場合、`E` From 9787b1144adac927af42b503cd271c49177013d6 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 8 Aug 2024 15:07:28 +0900 Subject: [PATCH 1129/3948] =?UTF-8?q?C++26:=202024-04=20mailing=E3=81=AB?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C=20#1320?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 8 ++++++++ lang/cpp26.md | 29 ++++++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/implementation-status.md b/implementation-status.md index b54d347f7d..b37e836f48 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -301,6 +301,14 @@ | P2558R2: [基本文字集合に@、$、\`を追加](/lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md.nolink) | C言語との互換性のためにこれらの文字を基本文字集合に追加 | | Yes | | | | P2662R3: [パラメータパックへのインデックスアクセスを許可](/lang/cpp26/pack_indexing.md.nolink) | 可変引数テンプレートのパラメータパックに添字アクセスできるようにする | | | | | | P2864R2: [非推奨となっていた列挙値から算術型への暗黙変換を削除](/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md.nolink) | C++20から非推奨となっていた列挙値への算術演算で算術型に暗黙変換される仕様を削除 | 14 | 18 | | | +| P2748R5: [返却された左辺値から暗黙変換された一時オブジェクトが参照に束縛されることを禁止する](/lang/cpp26/disallow_binding_a_returned_glvalue_to_a_temporary.md.nolink) | 寿命切れの変数によって引き起こされるバグを防止する | 14 | 19 | | | +| P3106R1: [要素数不明の配列を集成体初期化する規則を明確化](/lang/cpp26/clarifying_rules_for_brace_elision_in_aggregate_initialization.md.nolink) | 配列要素の集成体初期化で`{}`が省略された場合の矛盾していた規定を修正 | yes | 17 | | | +| P0609R3: [構造化束縛への属性を許可](/lang/cpp26/attributes_for_structured_bindings.md.nolink) | `auto [a, [[maybe_unused]] b, c] = f();`のように構造化束縛の要素に対して属性を付加できるようにする | 15 | 19 | | | +| P3034R1: [モジュール宣言でのモジュール名のマクロ展開を禁止する](/lang/cpp26/module_declarations_shouldnt_be_macros.md.nolink) | `export module MACRO_NAME;`を禁止 | | | | | +| P2809R3: [自明な無限ループは未定義動作ではないと規定](/lang/cpp26/trivial_infinite_loops_are_not_undefined_behavior.md.nolink) | 並行プログラムの進行保証などを考慮して無限ループを未定義動作ではないものとする | 14 | 19 | | | +| P2795R5: [未初期化変数の読み取りを不正動作 (erroneous behaviour: EB) とする](/lang/cpp26/erroneous_behaviour_for_uninitialized_reads.md.nolink) | 初期化されていない自動変数の読み取りの安全性を規定する | | | | | +| P2573R2: [関数宣言を削除する理由を指定できるようにする](/lang/cpp26/delete_reason.md.nolink) | `f() = delete("reason)";` | 15 | 19 | | | +| P2893R3: [可変引数テンプレートで`friend`宣言をできるようにする](/lang/cpp26/variadic_friends.md.nolink) | クラステンプレートの可変引数テンプレートでまとめて`friend`宣言できるようにする | 15 | | | | | P2747R2: [`constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md.nolink) | 定数式の文脈での配置`new`を許可 | | | | | | P3144R2: [不完全型へのポインタに対する`delete`を不適格とする](/lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md.nolink) | 未定義動作となる操作をコンパイルエラーとする | 15 | 19 | | | | P2963R3: [制約式内での畳み込み式の順序付け](/lang/cpp26/ordering_of_constraints_involving_fold_expressions.md.nolink) | 畳み込み式では全体ではなく個別の制約を原子制約式として扱う | | 19 | | | diff --git a/lang/cpp26.md b/lang/cpp26.md index b709a54229..7626e8200a 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -15,7 +15,9 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | [宣言のみで使用しない変数の名前として`_`をサポート](/lang/cpp26/nice_placeholder_with_no_name.md.nolink) | 変数名`_`は暗黙で`[[maybe_unused]]`が指定される | | [非推奨となっていた列挙値から算術型への暗黙変換を削除](/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md.nolink) | C++20から非推奨となっていた列挙値への算術演算で算術型に暗黙変換される仕様を削除 | | [不完全型へのポインタに対する`delete`を不適格とする](/lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md.nolink) | 未定義動作となる操作をコンパイルエラーとする | -| [条件式での構造化束縛の使用を許可](/lang/cpp26/structured_binding_declaration_as_a_condition.md.nolink) | 式全体を`bool`値に変換できる場合に条件式で構造化束縛を使用できることとする | +| [返却された左辺値から暗黙変換された一時オブジェクトが参照に束縛されることを禁止する](/lang/cpp26/disallow_binding_a_returned_glvalue_to_a_temporary.md.nolink) | 寿命切れの変数によって引き起こされるバグを防止する | +| [要素数不明の配列を集成体初期化する規則を明確化](/lang/cpp26/clarifying_rules_for_brace_elision_in_aggregate_initialization.md.nolink) | 配列要素の集成体初期化で`{}`が省略された場合の矛盾していた規定を修正 | +| [未初期化変数の読み取りを不正動作 (erroneous behaviour: EB) とする](/lang/cpp26/erroneous_behaviour_for_uninitialized_reads.md.nolink) | 初期化されていない自動変数の読み取りの安全性を規定する | ### 文字列 @@ -26,11 +28,28 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | [コンパイル時にのみ使用される文字列の扱いを明確化](/lang/cpp26/unevaluated_strings.md.nolink) | `static_assert`や`[[deprecated]]`などで使用されるコンパイル時の文字列について、文字コードの指定を禁止し、実行時エンコーディングが行われないことを規定 | +### 分岐・ループ + +| 言語機能 | 説明 | +|----------|------| +| [条件式での構造化束縛の使用を許可](/lang/cpp26/structured_binding_declaration_as_a_condition.md.nolink) | 式全体を`bool`値に変換できる場合に条件式で構造化束縛を使用できることとする | +| [自明な無限ループは未定義動作ではないと規定](/lang/cpp26/trivial_infinite_loops_are_not_undefined_behavior.md.nolink) | 並行プログラムの進行保証などを考慮して無限ループを未定義動作ではないものとする | + + +### 関数 + + +| 言語機能 | 説明 | +|----------|------| +| [関数宣言を削除する理由を指定できるようにする](/lang/cpp26/delete_reason.md.nolink) | `f() = delete("reason)";` | + + ### 属性 | 言語機能 | 説明 | |----------|------| | [属性の無視性を見直し](/lang/cpp26/on_the_ignorability_of_standard_attributes.md.nolink) | 構文として適格な属性のみを無視できるようにし、そうでない属性の使用を不適格とする | +| [構造化束縛への属性を許可](/lang/cpp26/attributes_for_structured_bindings.md.nolink) | `auto [a, [[maybe_unused]] b, c] = f();`のように構造化束縛の要素に対して属性を付加できるようにする | ### テンプレート @@ -39,6 +58,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 |----------|------| | [パラメータパックへのインデックスアクセスを許可](/lang/cpp26/pack_indexing.md.nolink) | 可変引数テンプレートのパラメータパックに添字アクセスできるようにする | | [制約式内での畳み込み式の順序付け](/lang/cpp26/ordering_of_constraints_involving_fold_expressions.md.nolink) | 畳み込み式では全体ではなく個別の制約を原子制約式として扱う | +| [可変引数テンプレートで`friend`宣言をできるようにする](/lang/cpp26/variadic_friends.md.nolink) | クラステンプレートの可変引数テンプレートでまとめて`friend`宣言できるようにする | ### 定数式 @@ -57,6 +77,13 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | [基本文字集合に@、$、\`を追加](/lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md.nolink) | C言語との互換性のためにこれらの文字を基本文字集合に追加 | +### モジュール + +| 言語機能 | 説明 | +|----------|------| +| [モジュール宣言でのモジュール名のマクロ展開を禁止する](/lang/cpp26/module_declarations_shouldnt_be_macros.md.nolink) | `export module MACRO_NAME;`を禁止 | + + ## ライブラリ更新の概要 ### 新ライブラリ - 文字列エンコーディングを識別するライブラリとして、[``](/reference/text_encoding.md.nolink)を追加 From 96adf0c22bc75d98f822c120d1b88baaf3c0851d Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 8 Aug 2024 16:23:33 +0900 Subject: [PATCH 1130/3948] =?UTF-8?q?C++26:=202024-04=20mailing=E3=81=AE?= =?UTF-8?q?=E3=83=A9=E3=82=A4=E3=83=96=E3=83=A9=E3=83=AA=E6=A9=9F=E8=83=BD?= =?UTF-8?q?=E3=82=92=E8=A8=98=E8=BC=89=20#1320?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp20.md | 22 +++++++++---------- lang/cpp26.md | 58 +++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 67 insertions(+), 13 deletions(-) diff --git a/lang/cpp20.md b/lang/cpp20.md index 81111018ab..549f3c9185 100644 --- a/lang/cpp20.md +++ b/lang/cpp20.md @@ -325,17 +325,17 @@ C++20とは、2020年中に改訂され、ISO/IEC 14882:2020で標準規格化 - [`ATOMIC_VAR_INIT`](/reference/atomic/atomic_var_init.md)マクロ - [`ATOMIC_FLAG_INIT`](/reference/atomic/atomic_flag_init.md)マクロ - [`std::shared_ptr`](/reference/memory/shared_ptr.md)の[`std::atomic`特殊化](/reference/memory/atomic.md)追加にともない、[`std::shared_ptr`](/reference/memory/shared_ptr.md)に対する以下のアトミック操作を非推奨化: - - [`atomic_is_lock_free`](/reference/memory/shared_ptr/atomic_is_lock_free.md) - - [`atomic_load`](/reference/memory/shared_ptr/atomic_load.md) - - [`atomic_load_explicit`](/reference/memory/shared_ptr/atomic_load_explicit.md) - - [`atomic_store`](/reference/memory/shared_ptr/atomic_store.md) - - [`atomic_store_explicit`](/reference/memory/shared_ptr/atomic_store_explicit.md) - - [`atomic_exchange`](/reference/memory/shared_ptr/atomic_exchange.md) - - [`atomic_exchange_explicit`](/reference/memory/shared_ptr/atomic_exchange_explicit.md) - - [`atomic_compare_exchange_weak`](/reference/memory/shared_ptr/atomic_compare_exchange_weak.md) - - [`atomic_compare_exchange_strong`](/reference/memory/shared_ptr/atomic_compare_exchange_strong.md) - - [`atomic_compare_exchange_weak_explicit`](/reference/memory/shared_ptr/atomic_compare_exchange_weak_explicit.md) - - [`atomic_compare_exchange_strong_explicit`](/reference/memory/shared_ptr/atomic_compare_exchange_strong_explicit.md) + - [`std::atomic_is_lock_free`](/reference/memory/shared_ptr/atomic_is_lock_free.md) + - [`std::atomic_load`](/reference/memory/shared_ptr/atomic_load.md) + - [`std::atomic_load_explicit`](/reference/memory/shared_ptr/atomic_load_explicit.md) + - [`std::atomic_store`](/reference/memory/shared_ptr/atomic_store.md) + - [`std::atomic_store_explicit`](/reference/memory/shared_ptr/atomic_store_explicit.md) + - [`std::atomic_exchange`](/reference/memory/shared_ptr/atomic_exchange.md) + - [`std::atomic_exchange_explicit`](/reference/memory/shared_ptr/atomic_exchange_explicit.md) + - [`std::atomic_compare_exchange_weak`](/reference/memory/shared_ptr/atomic_compare_exchange_weak.md) + - [`std::atomic_compare_exchange_strong`](/reference/memory/shared_ptr/atomic_compare_exchange_strong.md) + - [`std::atomic_compare_exchange_weak_explicit`](/reference/memory/shared_ptr/atomic_compare_exchange_weak_explicit.md) + - [`std::atomic_compare_exchange_strong_explicit`](/reference/memory/shared_ptr/atomic_compare_exchange_strong_explicit.md) ### 機能の削除 diff --git a/lang/cpp26.md b/lang/cpp26.md index 7626e8200a..f157155999 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -97,6 +97,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 ### コンテナ - [`std::mdspan`](/reference/mdspan/mdspan.md)から部分ビューを取り出す[`std::submdspan()`](/reference/mdspan/submdspan.md)を追加 - [`std::mdspan`](/reference/mdspan/mdspan.md)に対する[`std::dextents`](/reference/mdspan/extents.md)指定の冗長さを解決する[`std::dims`](/reference/mdspan/extents.md)を追加 +- [`std::mdspan`](/reference/mdspan/mdspan.md)のレイアウトとして、[`std::layout_left_padded`](/reference/mdspan/layout_left_padded.md)と[`std::layout_right_padded`](/reference/mdspan/layout_right_padded.md)を追加 - [`std::span`](/reference/span/span.md)に、以下を追加 - [`std::initializer_list`](/reference/initializer_list/initializer_list.md)をとるコンストラクタ - インデックスアクセスのための[`at()`](/reference/span/span/at.md)メンバ関数 @@ -121,6 +122,8 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [`bucket()`](/reference/unordered_set/unordered_set/bucket.md) - [`std::unordered_multiset`](/reference/unordered_set/unordered_multiset.md) - [`bucket()`](/reference/unordered_set/unordered_multiset/bucket.md) +- [`std::span`](/reference/span/span.md)と[`std::mdspan`](/reference/mdspan/mdspan.md)の推論補助を改善 +- [`std::views::concat`](/reference/ranges/concat_view.md.nolink)を追加 ### アルゴリズム @@ -129,7 +132,32 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [`std::stable_partition()`](/reference/algorithm/stable_partition.md) / [`std::ranges::stable_partition()`](/reference/algorithm/ranges_stable_partition.md) - [`std::inplace_merge()`](/reference/algorithm/inplace_merge.md) / [`std::ranges::inplace_merge()`](/reference/algorithm/ranges_inplace_merge.md) - Rangeアルゴリズムが完全型を要求しないようにするため、[`std::projected`](/reference/iterator/projected.md)の制約を緩和 -- [`std::ranges::find_last()`](/reference/algorithm/ranges_find_last.md)に検索対象の値を波カッコ初期化で渡せるよう制約を追加 +- 以下のアルゴリズムに、値を波カッコ初期化で渡せるよう制約を追加 + - `std::erase()` + - [`std::basic_string`](/reference/string/basic_string.md)版[`std::erase()`](/reference/string/basic_string/erase_free.md) + - [`std::deque`](/reference/deque/deque.md)版[`std::erase()`](/reference/deque/deque/erase_free.md) + - [`std::forward_list`](/reference/forward_list/forward_list.md)版[`std::erase()`](/reference/forward_list/forward_list/erase_free.md) + - [`std::list`](/reference/list/list.md)版[`std::erase()`](/reference/list/list/erase_free.md) + - [`std::vector`](/reference/vector/vector.md)版[`std::erase()`](/reference/vector/vector/erase_free.md) + - [`std::find()`](/reference/algorithm/find.md)と[`std::ranges::find()`](/reference/algorithm/ranges_find.md) + - [`std::ranges::find_last()`](/reference/algorithm/ranges_find_last.md) + - [`std::count()`](/reference/algorithm/count.md)と[`std::ranges::count()`](/reference/algorithm/ranges_count.md) + - [`std::search_n()`](/reference/algorithm/search_n.md)と[`std::ranges::search_n()`](/reference/algorithm/ranges_search_n.md) + - [`std::replace()`](/reference/algorithm/replace.md)と[`std::ranges::replace()`](/reference/algorithm/replace.md) + - [`std::replace_if()`](/reference/algorithm/replace_if.md)と[`std::ranges::replace_if()`](/reference/algorithm/replace_if.md) + - [`std::ranges::replace_copy()`](/reference/algorithm/replace_copy.md) + - [`std::replace_copy_if()`](/reference/algorithm/replace_copy_if.md)と[`std::ranges::replace_copy_if()`](/reference/algorithm/replace_copy_if.md) + - [`std::fill()`](/reference/algorithm/fill.md)と[`std::ranges::fill()`](/reference/algorithm/ranges_fill.md) + - [`std::fill_n()`](/reference/algorithm/fill_n.md)と[`std::ranges::fill_n()`](/reference/algorithm/ranges_fill_n.md) + - [`std::remove()`](/reference/algorithm/remove.md)と[`std::ranges::remove()`](/reference/algorithm/ranges_remove.md) + - [`std::remove_copy()`](/reference/algorithm/remove_copy.md)と[`std::ranges::remove_copy()`](/reference/algorithm/ranges_remove_copy.md) + - [`std::lower_bound()`](/reference/algorithm/lower_bound.md)と[`std::ranges::lower_bound()`](/reference/algorithm/ranges_lower_bound.md) + - [`std::upper_bound()`](/reference/algorithm/upper_bound.md)と[`std::ranges::upper_bound()`](/reference/algorithm/ranges_upper_bound.md) + - [`std::equal_range()`](/reference/algorithm/equal_range.md)と[`std::ranges::equal_range()`](/reference/algorithm/ranges_equal_range.md) + - [`std::binary_search()`](/reference/algorithm/binary_search.md)と[`std::ranges::binary_search()`](/reference/algorithm/ranges_binary_search.md) + - [`std::ranges::fold_left()`](/reference/algorithm/ranges_fold_left.md) + - [`std::ranges::fold_right()`](/reference/algorithm/ranges_fold_right.md) + - [`std::ranges::contains()`](/reference/algorithm/ranges_contains.md) ### 関数オブジェクト @@ -137,6 +165,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [`std::move_only_function`](/reference/functional/move_only_function.md)のコピー可能版として、[``](/reference/functional.md)に[`std::copyable_function`](/reference/functional/copyable_function.md)クラスを追加 - [`std::bind_front()`](/reference/functional/bind_front.md)と[`std::bind_back()`](/reference/functional/bind_back.md)に、非型テンプレート引数として関数を指定するオーバーロードを追加 - 関連して、非型テンプレート引数の関数オブジェクトを反転させられるよう、[`not_fn()`](/reference/functional/not_fn.md)に非型テンプレート引数版のオーバーロードを追加 +- [`std::reference_wrapper`](/reference/functional/reference_wrapper.md)に、比較演算子[`==`](/reference/functional/reference_wrapper/op_equal.md.nolink)と[`<=>`](/reference/functional/reference_wrapper/op_compare_3way.md.nolink)を追加 ### 文字列 @@ -148,12 +177,19 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - 幅と精度を動的に指定した場合でも型の検証がコンパイル時に行われるよう仕様を見直し - コンパイル時の書式文字列だけでなく、実行時の書式文字列を渡せるよう仕様修正 - 文字列フォーマットをより高速にできる最適化が可能か判定する[`std::enable_nonlocking_formatter_optimization`](/reference/format/enable_nonlocking_formatter_optimization.md.nolink)を追加 +- [`std::basic_string`](/reference/string/basic_string.md)と[`std::basic_string_view`](/reference/string_view/basic_string_view.md)を[`std::basic_string`](/reference/string/basic_string.md)として連結させる`operator+`を追加 ### ファイル - ファイルのネイティブハンドルを取得できるよう、[`std::basic_filebuf`](/reference/fstream/basic_filebuf.md)、[`std::basic_ifstream`](/reference/fstream/basic_ifstream.md)、[`std::basic_ofstream`](/reference/fstream/basic_ofstream.md)、[`std::basic_fstream`](/reference/fstream/basic_fstream.md)クラスに、以下のメンバを追加 - `native_handle_type`型 - `native_handle()` +- [`std::filesystem::path`](/reference/filesystem/path.md)に、文字列フォーマットのサポートを追加 + + +### 入出力 +- [`std::print()`](/reference/print/print.md)と[`std::println()`](/reference/print/println.md)に、ロックを取得せず高速に書き出す最適化を許可 +- [`std::println()`](/reference/print/println.md)に、改行のみを出力するオーバーロードを追加 ### 並行・並列処理 @@ -252,6 +288,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [`std::real()`](/reference/complex/complex/real_free.md) (算術型オーバーロード) - [`std::complex`](/reference/complex/complex.md)を構造化束縛や、将来のパターンマッチで使用できるようタプルインタフェースの特殊化を追加 - [``](/reference/random.md)の範囲`[0, 1)`の乱数を生成する[`std::generate_canonical()`](/reference/random/generate_canonical.md)を、望ましい統計的性質を保証するようアルゴリズムと制約を変更 +- [``](/reference/random.md)に、乱数列を生成する[`std::ranges::generate_random()`](/reference/random/generate_random.md.nolink)関数を追加 ### ユーティリティ @@ -289,8 +326,25 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [`std::indirect_strict_weak_order`](/reference/iterator/indirect_strict_weak_order.md) +### 非推奨の取り消し +- [`std::polymorphic_allocator`](/reference/memory_resource/polymorphic_allocator.md)`::`[`destroy()`](/reference/memory_resource/polymorphic_allocator/destroy.md)の非推奨を取り消し + + ### 機能の削除 +- C++98から非推奨となっていた``ライブラリを削除 +- C++17から非推奨となっていたUnicode変換ライブラリ[``](/reference/codecvt.md)と[`std::wstring_convert`](/reference/locale/wstring_convert.md)を削除 - C++20から非推奨となっていた、[`std::basic_string`](/reference/string/basic_string.md)`::`[`reserve()`](/reference/string/basic_string/reserve.md)のパラメータなしのオーバーロードを削除 +- C++20から非推奨となっていた[`std::shared_ptr`](/reference/memory/shared_ptr.md)に対する、以下の古いアトミック操作関数のオーバーロードを削除 + - [`std::atomic_is_lock_free`](/reference/memory/shared_ptr/atomic_is_lock_free.md) + - [`std::atomic_load`](/reference/memory/shared_ptr/atomic_load.md) + - [`std::atomic_load_explicit`](/reference/memory/shared_ptr/atomic_load_explicit.md) + - [`std::atomic_store`](/reference/memory/shared_ptr/atomic_store.md) + - [`std::atomic_store_explicit`](/reference/memory/shared_ptr/atomic_store_explicit.md) + - [`std::atomic_exchange`](/reference/memory/shared_ptr/atomic_exchange.md) + - [`std::atomic_exchange_explicit`](/reference/memory/shared_ptr/atomic_exchange_explicit.md) + - [`std::atomic_compare_exchange_weak`](/reference/memory/shared_ptr/atomic_compare_exchange_weak.md) + - [`std::atomic_compare_exchange_strong`](/reference/memory/shared_ptr/atomic_compare_exchange_strong.md) + - [`std::atomic_compare_exchange_weak_explicit`](/reference/memory/shared_ptr/atomic_compare_exchange_weak_explicit.md) + - [`std::atomic_compare_exchange_strong_explicit`](/reference/memory/shared_ptr/atomic_compare_exchange_strong_explicit.md) - C++23から非推奨となっていた、[`std::allocator`](/reference/memory/allocator.md)のメンバ型`is_always_equal`を削除 -- C++17から非推奨となっていたUnicode変換ライブラリ[``](/reference/codecvt.md)を削除 From 735b35ed77dbb183d50abe2c58b6bcf3162ac330 Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 8 Aug 2024 17:22:01 +0900 Subject: [PATCH 1131/3948] =?UTF-8?q?linlg:=20=E5=85=A5=E5=87=BA=E5=8A=9B?= =?UTF-8?q?=E5=BC=95=E6=95=B0=E3=82=B3=E3=83=B3=E3=82=BB=E3=83=97=E3=83=88?= =?UTF-8?q?=E3=81=AE=E8=AA=AC=E6=98=8E=E8=BF=BD=E5=8A=A0=20(#1233)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/linalg/add.md | 5 +-- reference/linalg/addable.md | 8 +--- reference/linalg/apply_givens_rotation.md | 24 +++++------ reference/linalg/compatible-static-extents.md | 9 ++-- reference/linalg/copy.md | 9 ++-- reference/linalg/dot.md | 3 +- reference/linalg/dotc.md | 19 ++++----- reference/linalg/hermitian_matrix_product.md | 6 +-- .../linalg/hermitian_matrix_rank_1_update.md | 3 +- .../linalg/hermitian_matrix_rank_2_update.md | 6 +-- .../linalg/hermitian_matrix_rank_2k_update.md | 6 +-- .../linalg/hermitian_matrix_rank_k_update.md | 6 +-- .../linalg/hermitian_matrix_vector_product.md | 3 ++ reference/linalg/inout-matrix.md | 42 +++++++++++++++++++ reference/linalg/inout-object.md | 42 +++++++++++++++++++ reference/linalg/inout-vector.md | 42 +++++++++++++++++++ .../linalg/{is_mdspan.md => is-mdspan.md} | 17 +++----- reference/linalg/matrix_frob_norm.md | 3 +- reference/linalg/matrix_inf_norm.md | 3 +- reference/linalg/matrix_one_norm.md | 3 +- reference/linalg/matrix_product.md | 30 +++++++------ reference/linalg/matrix_rank_1_update.md | 6 +-- reference/linalg/matrix_rank_1_update_c.md | 6 +-- reference/linalg/matrix_vector_product.md | 7 ++-- reference/linalg/multipliable.md | 4 +- reference/linalg/possibly-addable.md | 5 +-- reference/linalg/possibly-multipliable.md | 3 +- .../linalg/possibly-packed-inout-matrix.md | 39 +++++++++++++++++ reference/linalg/scale.md | 4 +- reference/linalg/swap_elements.md | 4 +- reference/linalg/symmetric_matrix_product.md | 6 +-- .../linalg/symmetric_matrix_rank_1_update.md | 6 +-- .../linalg/symmetric_matrix_rank_2_update.md | 6 +-- .../linalg/symmetric_matrix_rank_2k_update.md | 6 +-- .../linalg/symmetric_matrix_rank_k_update.md | 6 +-- .../linalg/symmetric_matrix_vector_product.md | 7 ++-- .../linalg/triangular_matrix_left_product.md | 6 +-- .../triangular_matrix_matrix_left_solve.md | 7 ++-- .../triangular_matrix_matrix_right_solve.md | 7 ++-- reference/linalg/triangular_matrix_product.md | 6 +-- .../linalg/triangular_matrix_right_product.md | 6 +-- .../triangular_matrix_vector_product.md | 7 ++-- .../linalg/triangular_matrix_vector_solve.md | 7 ++-- reference/linalg/vector_abs_sum.md | 3 +- reference/linalg/vector_idx_abs_max.md | 11 ++--- reference/linalg/vector_sum_of_squares.md | 3 +- reference/linalg/vector_two_norm.md | 3 +- 47 files changed, 289 insertions(+), 181 deletions(-) create mode 100644 reference/linalg/inout-matrix.md create mode 100644 reference/linalg/inout-object.md create mode 100644 reference/linalg/inout-vector.md rename reference/linalg/{is_mdspan.md => is-mdspan.md} (51%) create mode 100644 reference/linalg/possibly-packed-inout-matrix.md diff --git a/reference/linalg/add.md b/reference/linalg/add.md index fa172a3850..cd7cf031fa 100644 --- a/reference/linalg/add.md +++ b/reference/linalg/add.md @@ -1,12 +1,10 @@ # add - * [mathjax enable] * linalg[meta header] * function template[meta id-type] * std::linalg[meta namespace] * cpp26[meta cpp] - ```cpp namespace std::linalg { template + inout-vector InOutVec2, + class Real> void apply_givens_rotation( InOutVec1 x, InOutVec2 y, @@ -19,9 +17,9 @@ namespace std::linalg { Real s); // (1) template + inout-vector InOutVec1, + inout-vector InOutVec2, + class Real> void apply_givens_rotation( ExecutionPolicy&& exec, InOutVec1 x, @@ -30,8 +28,8 @@ namespace std::linalg { Real s); // (2) template + inout-vector InOutVec2, + class Real> void apply_givens_rotation( InOutVec1 x, InOutVec2 y, @@ -39,9 +37,9 @@ namespace std::linalg { complex s); // (3) template + inout-vector InOutVec1, + inout-vector InOutVec2, + class Real> void apply_givens_rotation( ExecutionPolicy&& exec, InOutVec1 x, @@ -51,7 +49,7 @@ namespace std::linalg { } ``` * complex[link /reference/complex/complex.md] - +* inout-vector[link inout-vector.md] ## 概要 `c`と`s`で指定された回転行列を2つの**行**ベクトル`x`と`y`に対して、次のように掛けて代入する。 diff --git a/reference/linalg/compatible-static-extents.md b/reference/linalg/compatible-static-extents.md index cec4e87975..229c80665b 100644 --- a/reference/linalg/compatible-static-extents.md +++ b/reference/linalg/compatible-static-extents.md @@ -1,15 +1,13 @@ # compatible-static-extents - * linalg[meta header] * function template[meta id-type] * std::linalg[meta namespace] * cpp26[meta cpp] - ```cpp namespace std::linalg { template - requires(is-mdspan && is-mdspan) + requires(is-mdspan && is-mdspan) constexpr bool compatible-static-extents(size_t r1, size_t r2) { return MDS1::static_extent(r1) == dynamic_extent || @@ -18,8 +16,9 @@ namespace std::linalg { } } ``` -* is-mdspan[link /reference/linalg/is_mdspan.md] - +* is-mdspan[link is-mdspan.md] +* static_extent[link /reference/mdspan/mdspan/static_extent.md] +* dynamic_extent[link /reference/span/dynamic_extent.md] ## 概要 左の`mdspan`の`r1`番目の静的要素数と右の`mdspan`の`r2`番目の静的要素数に互換性があるかどうかを返す、説明専用の関数である。 diff --git a/reference/linalg/copy.md b/reference/linalg/copy.md index 2948da2142..1fd0528804 100644 --- a/reference/linalg/copy.md +++ b/reference/linalg/copy.md @@ -1,18 +1,16 @@ # copy - * [mathjax enable] * linalg[meta header] * function template[meta id-type] * std::linalg[meta namespace] * cpp26[meta cpp] - ```cpp namespace std::linalg { template + out-object OutObj> void copy(InObj x, - OutObj y); // (1) + OutObj y); // (1) template Scalar dotc(InVec1 v1, - InVec2 v2, - Scalar init); // (1) + InVec2 v2, + Scalar init); // (1) template Scalar dotc(ExecutionPolicy&& exec, - InVec1 v1, - InVec2 v2, - Scalar init); // (2) + InVec1 v1, + InVec2 v2, + Scalar init); // (2) template auto dotc(InVec1 v1, - InVec2 v2); // (3) + InVec2 v2); // (3) template auto dotc(ExecutionPolicy&& exec, - InVec1 v1, - InVec2 v2); // (4) + InVec1 v1, + InVec2 v2); // (4) } ``` +* in-vector[link inout-vector.md] ## 概要 2つのベクトル`v1`、`v2`のエルミート内積を計算する。 diff --git a/reference/linalg/hermitian_matrix_product.md b/reference/linalg/hermitian_matrix_product.md index d72c378cf2..1f50e37d41 100644 --- a/reference/linalg/hermitian_matrix_product.md +++ b/reference/linalg/hermitian_matrix_product.md @@ -1,13 +1,10 @@ # hermitian_matrix_product - - * [mathjax enable] * linalg[meta header] * function template[meta id-type] * std::linalg[meta namespace] * cpp26[meta cpp] - ```cpp namespace std::linalg { template +concept in-matrix = + is-mdspan && T::rank() == 2; + +template +concept out-matrix = + is-mdspan && T::rank() == 2 && + is_assignable_v && T::is_always_unique(); + +template +concept inout-matrix = + is-mdspan && T::rank() == 2 && + is_assignable_v && T::is_always_unique(); +``` +* is-mdspan[link is-mdspan.md] +* rank[link /reference/mdspan/mdspan/rank.md] +* is_assignable_v[link /reference/type_traits/is_assignable.md] +* is_always_unique[link /reference/mdspan/mdspan.md] + +## 概要 +型`T`が行列(2次元[`mdspan`](/reference/mdspan/mdspan.md))であることを表す、説明専用のコンセプトである。 + +- `in-matrix` : 入力パラメータを表す。アルゴリズム内で`mdspan`要素が更新されることはない。 +- `out-matrix` : 出力パラメータを表す。演算結果の書き出しが行われる。 +- `inout-matrix` : 入出力パラメータを表す。要素の読み取りと演算結果の書き出しが行われる。 + +関数仕様で明示されない限り、`out-matrix`および`inout-matrix`で制約される`mdspan`型引数は、同関数の他`mdspan`引数のエイリアスであってはならない。 + + +## バージョン +### 言語 +- C++26 + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) diff --git a/reference/linalg/inout-object.md b/reference/linalg/inout-object.md new file mode 100644 index 0000000000..679d7daf70 --- /dev/null +++ b/reference/linalg/inout-object.md @@ -0,0 +1,42 @@ +# in-object, out-object, inout-object +* linalg[meta header] +* concept[meta id-type] +* cpp26[meta cpp] + +```cpp +template +concept in-object = + is-mdspan && (T::rank() == 1 || T::rank() == 2); + +template +concept out-object = + is-mdspan && (T::rank() == 1 || T::rank() == 2) && + is_assignable_v && T::is_always_unique(); + +template +concept inout-object = + is-mdspan && (T::rank() == 1 || T::rank() == 2) && + is_assignable_v && T::is_always_unique(); +``` +* is-mdspan[link is-mdspan.md] +* rank[link /reference/mdspan/mdspan/rank.md] +* is_assignable_v[link /reference/type_traits/is_assignable.md] +* is_always_unique[link /reference/mdspan/mdspan.md] + +## 概要 +型`T`がベクトル(1次元[`mdspan`](/reference/mdspan/mdspan.md))または行列(2次元[`mdspan`](/reference/mdspan/mdspan.md))であることを表す、説明専用のコンセプトである。 + +- `in-object` : 入力パラメータを表す。アルゴリズム内で`mdspan`要素が更新されることはない。 +- `out-object` : 出力パラメータを表す。演算結果の書き出しが行われる。 +- `inout-object` : 入出力パラメータを表す。要素の読み取りと演算結果の書き出しが行われる。 + +関数仕様で明示されない限り、`out-object`および`inout-object`で制約される`mdspan`型引数は、同関数の他`mdspan`引数のエイリアスであってはならない。 + + +## バージョン +### 言語 +- C++26 + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) diff --git a/reference/linalg/inout-vector.md b/reference/linalg/inout-vector.md new file mode 100644 index 0000000000..17837f2170 --- /dev/null +++ b/reference/linalg/inout-vector.md @@ -0,0 +1,42 @@ +# in-vector, out-vector, inout-vector +* linalg[meta header] +* concept[meta id-type] +* cpp26[meta cpp] + +```cpp +template +concept in-vector = + is-mdspan && T::rank() == 1; + +template +concept out-vector = + is-mdspan && T::rank() == 1 && + is_assignable_v && T::is_always_unique(); + +template +concept inout-vector = + is-mdspan && T::rank() == 1 && + is_assignable_v && T::is_always_unique(); +``` +* is-mdspan[link is-mdspan.md] +* rank[link /reference/mdspan/mdspan/rank.md] +* is_assignable_v[link /reference/type_traits/is_assignable.md] +* is_always_unique[link /reference/mdspan/mdspan.md] + +## 概要 +型`T`がベクトル(1次元[`mdspan`](/reference/mdspan/mdspan.md))であることを表す、説明専用のコンセプトである。 + +- `in-vector` : 入力パラメータを表す。アルゴリズム内で`mdspan`要素が更新されることはない。 +- `out-vector` : 出力パラメータを表す。演算結果の書き出しが行われる。 +- `inout-vector` : 入出力パラメータを表す。要素の読み取りと演算結果の書き出しが行われる。 + +関数仕様で明示されない限り、`out-vector`および`inout-vector`で制約される`mdspan`型引数は、同関数の他`mdspan`引数のエイリアスであってはならない。 + + +## バージョン +### 言語 +- C++26 + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) diff --git a/reference/linalg/is_mdspan.md b/reference/linalg/is-mdspan.md similarity index 51% rename from reference/linalg/is_mdspan.md rename to reference/linalg/is-mdspan.md index 7228ca1bf9..1079ccc946 100644 --- a/reference/linalg/is_mdspan.md +++ b/reference/linalg/is-mdspan.md @@ -1,24 +1,19 @@ # is-mdspan - * linalg[meta header] -* function template[meta id-type] -* std::linalg[meta namespace] +* variable[meta id-type] * cpp26[meta cpp] - ```cpp -namespace std::linalg { - template - constexpr bool is-mdspan = false; +template +constexpr bool is-mdspan = false; - template - constexpr bool is-mdspan> = true; +template +constexpr bool is-mdspan> = true; } ``` - ## 概要 -与えられた型が[`mdspan`](/reference/mdspan.md)かどうかを表す、説明専用の定数である。 +与えられた型が[`mdspan`](/reference/mdspan.md)の特殊化かどうかを表す、説明専用の定数である。 ## 戻り値 diff --git a/reference/linalg/matrix_frob_norm.md b/reference/linalg/matrix_frob_norm.md index 44a97bd118..037509c9d5 100644 --- a/reference/linalg/matrix_frob_norm.md +++ b/reference/linalg/matrix_frob_norm.md @@ -1,5 +1,4 @@ # matrix_frob_norm - * [mathjax enable] * linalg[meta header] * function template[meta id-type] @@ -26,7 +25,7 @@ namespace std::linalg { auto matrix_frob_norm(ExecutionPolicy&& exec, InMat A); // (4) } ``` - +* in-matrix[link inout-matrix.md] ## 概要 行列のフロベニウスノルムを計算する。 diff --git a/reference/linalg/matrix_inf_norm.md b/reference/linalg/matrix_inf_norm.md index 93c3390e53..848b3eb5cc 100644 --- a/reference/linalg/matrix_inf_norm.md +++ b/reference/linalg/matrix_inf_norm.md @@ -1,5 +1,4 @@ # matrix_inf_norm - * [mathjax enable] * linalg[meta header] * function template[meta id-type] @@ -26,7 +25,7 @@ namespace std::linalg { auto matrix_inf_norm(ExecutionPolicy&& exec, InMat A); // (4) } ``` - +* in-matrix[link inout-matrix.md] ## 概要 行列の無限大ノルムを計算する。 diff --git a/reference/linalg/matrix_one_norm.md b/reference/linalg/matrix_one_norm.md index e4d7e5c703..84ef626726 100644 --- a/reference/linalg/matrix_one_norm.md +++ b/reference/linalg/matrix_one_norm.md @@ -1,5 +1,4 @@ # matrix_one_norm - * [mathjax enable] * linalg[meta header] * function template[meta id-type] @@ -26,7 +25,7 @@ namespace std::linalg { auto matrix_one_norm(ExecutionPolicy&& exec, InMat A); // (4) } ``` - +* in-matrix[link inout-matrix.md] ## 概要 行列の1ノルムを計算する。 diff --git a/reference/linalg/matrix_product.md b/reference/linalg/matrix_product.md index 204239b40f..c285dd77c5 100644 --- a/reference/linalg/matrix_product.md +++ b/reference/linalg/matrix_product.md @@ -1,45 +1,42 @@ # matrix_product - - * [mathjax enable] * linalg[meta header] * function template[meta id-type] * std::linalg[meta namespace] * cpp26[meta cpp] - ```cpp namespace std::linalg { template + in-matrix InMat2, + out-matrix OutMat> void matrix_product(InMat1 A, InMat2 B, OutMat C); // (1) template + in-matrix InMat1, + in-matrix InMat2, + out-matrix OutMat> void matrix_product(ExecutionPolicy&& exec, InMat1 A, InMat2 B, OutMat C); // (2) template + in-matrix InMat2, + in-matrix InMat3, + out-matrix OutMat> void matrix_product(InMat1 A, InMat2 B, InMat3 E, OutMat C); // (3) template + in-matrix InMat1, + in-matrix InMat2, + in-matrix InMat3, + out-matrix OutMat> void matrix_product(ExecutionPolicy&& exec, InMat1 A, InMat2 B, @@ -47,7 +44,8 @@ namespace std::linalg { OutMat C); // (4) } ``` - +* in-matrix[link inout-matrix.md] +* out-matrix[link inout-matrix.md] ## 概要 行列同士の積を計算する。 diff --git a/reference/linalg/matrix_rank_1_update.md b/reference/linalg/matrix_rank_1_update.md index 891c037284..6b0e3a98fb 100644 --- a/reference/linalg/matrix_rank_1_update.md +++ b/reference/linalg/matrix_rank_1_update.md @@ -1,13 +1,10 @@ # matrix_rank_1_update - - * [mathjax enable] * linalg[meta header] * function template[meta id-type] * std::linalg[meta namespace] * cpp26[meta cpp] - ```cpp namespace std::linalg { template @@ -28,7 +26,8 @@ namespace std::linalg { } // (2) } ``` - +* in-vector[link inout-vector.md] +* in-matrix[link inout-matrix.md] ## 概要 テンプレートパラメータに指定されたベクトルまたは行列の次元が同じかどうかを静的要素数で判定する、説明専用の関数である。 diff --git a/reference/linalg/possibly-multipliable.md b/reference/linalg/possibly-multipliable.md index 1d3e83068a..6ea1a1bc9b 100644 --- a/reference/linalg/possibly-multipliable.md +++ b/reference/linalg/possibly-multipliable.md @@ -5,7 +5,6 @@ * std::linalg[meta namespace] * cpp26[meta cpp] - ```cpp namespace std::linalg { template @@ -31,6 +30,8 @@ namespace std::linalg { } // (3) } ``` +* in-vector[link inout-vector.md] +* in-matrix[link inout-matrix.md] ## 概要 diff --git a/reference/linalg/possibly-packed-inout-matrix.md b/reference/linalg/possibly-packed-inout-matrix.md new file mode 100644 index 0000000000..df39fe9d17 --- /dev/null +++ b/reference/linalg/possibly-packed-inout-matrix.md @@ -0,0 +1,39 @@ +# possibly-packed-inout-matrix +* linalg[meta header] +* concept[meta id-type] +* cpp26[meta cpp] + +```cpp +template +constexpr bool is-layout-blas-packed = false; + +template +constexpr bool is-layout-blas-packed> = true; + +template +concept possibly-packed-inout-matrix = + is-mdspan && T::rank() == 2 && + is_assignable_v && + (T::is_always_unique() || is-layout-blas-packed); +``` +* layout_blas_packed[link layout_blas_packed.md] +* is-mdspan[link is-mdspan.md] +* rank[link /reference/mdspan/mdspan/rank.md] +* is_assignable_v[link /reference/type_traits/is_assignable.md] +* is_always_unique[link /reference/mdspan/mdspan.md] + +## 概要 +型`T`が行列(2次元[`mdspan`](/reference/mdspan/mdspan.md))であり、そのレイアウトが[`layout_blas_packed`](layout_blas_packed.md)である可能性を表す、説明専用のコンセプトである。 + +入出力パラメータを表しており、要素の読み取りと演算結果の書き出しが行われる。 + +関数仕様で明示されない限り、`possibly-packed-inout-matrix`で制約される`mdspan`型引数は、同関数の他`mdspan`引数のエイリアスであってはならない。 + + +## バージョン +### 言語 +- C++26 + + +## 参照 +- [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) diff --git a/reference/linalg/scale.md b/reference/linalg/scale.md index 345b613d24..f1002df593 100644 --- a/reference/linalg/scale.md +++ b/reference/linalg/scale.md @@ -1,12 +1,10 @@ # scale - * [mathjax enable] * linalg[meta header] * function template[meta id-type] * std::linalg[meta namespace] * cpp26[meta cpp] - ```cpp namespace std::linalg { template - typename InVec::size_type vector_idx_abs_max(InVec v); // (1) + typename InVec::size_type + vector_idx_abs_max(InVec v); // (1) template - typename InVec::size_type vector_idx_abs_max(ExecutionPolicy&& exec, - InVec v); // (2) + typename InVec::size_type + vector_idx_abs_max(ExecutionPolicy&& exec, + InVec v); // (2) } ``` - +* in-vector[link inout-vector.md] ## 概要 ベクトルの各成分の絶対値が最大となるインデックスを計算する。 diff --git a/reference/linalg/vector_sum_of_squares.md b/reference/linalg/vector_sum_of_squares.md index 8b546813bf..529812d9fe 100644 --- a/reference/linalg/vector_sum_of_squares.md +++ b/reference/linalg/vector_sum_of_squares.md @@ -1,5 +1,4 @@ # vector_sum_of_squares - * [mathjax enable] * linalg[meta header] * function template[meta id-type] @@ -22,9 +21,9 @@ namespace std::linalg { sum_of_squares_result init); // (2) } ``` +* in-vector[link inout-vector.md] * sum_of_squares_result[link sum_of_squares_result.md] - ## 概要 アンダーフローとオーバーフローが起きないようスケールされた、ベクトルの成分の2乗和を計算する。すなわち、戻り値を`result`とし、説明用の関数 diff --git a/reference/linalg/vector_two_norm.md b/reference/linalg/vector_two_norm.md index 46ce843d5e..09a86d8ac5 100644 --- a/reference/linalg/vector_two_norm.md +++ b/reference/linalg/vector_two_norm.md @@ -1,5 +1,4 @@ # vector_two_norm - * [mathjax enable] * linalg[meta header] * function template[meta id-type] @@ -25,7 +24,7 @@ namespace std::linalg { auto vector_two_norm(ExecutionPolicy&& exec, InVec v); // (4) } ``` - +* in-vector[link inout-vector.md] ## 概要 ベクトルのユークリッドノルムを計算する。 From 2f336cb508b7b35e04fb39caa3490734c9fdeff3 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 9 Aug 2024 12:23:57 +0900 Subject: [PATCH 1132/3948] =?UTF-8?q?reference:=20C++26=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=E3=81=A8=E3=81=97=E3=81=A6=E3=82=92=E5=89=8A?= =?UTF-8?q?=E9=99=A4=20(close=20#1331)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reference.md b/reference.md index 7cf8ce99e3..362795d4e7 100644 --- a/reference.md +++ b/reference.md @@ -172,6 +172,7 @@ | [``](/reference/ostream.md) | 出力ストリーム | | | [``](/reference/iomanip.md) | フォーマットとマニピュレータ | | | [``](/reference/sstream.md) | 文字列ストリーム | | +| `` | 古い文字列ストリーム | C++98から非推奨
C++26で削除 | | [``](/reference/fstream.md) | ファイルストリーム | | | [``](/reference/filesystem.md) | ファイルシステム | C++17 | | [``](/reference/syncstream.md) | 同期化出力ストリームラッパー | C++20 | @@ -247,3 +248,7 @@ | ヘッダ | 説明 | 対応バージョン | |----------------------------------------------------|-----------------------------------------------------------|----------------| | [`exposition-only`](/reference/exposition-only.md) | 説明のためのものを集めたページ (実際のライブラリではない) | | + + +## 参照 +- [P2867R2 Remove Deprecated `strstream`s From C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2867r2.html) From 8ee965b79c861ee94b2e02e1be9daf597a370ea5 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 9 Aug 2024 12:35:01 +0900 Subject: [PATCH 1133/3948] =?UTF-8?q?shared=5Fptr=20:=20C++26=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C=E3=81=A8=E3=81=97=E3=81=A6=E3=80=81=E3=82=A2=E3=83=88?= =?UTF-8?q?=E3=83=9F=E3=83=83=E3=82=AF=E6=93=8D=E4=BD=9C=E3=81=AE=E9=9D=9E?= =?UTF-8?q?=E3=83=A1=E3=83=B3=E3=83=90=E9=96=A2=E6=95=B0=E3=82=92=E5=89=8A?= =?UTF-8?q?=E9=99=A4=20(close=20#1332)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/memory/shared_ptr.md | 22 +++++++++---------- .../atomic_compare_exchange_strong.md | 4 +++- ...atomic_compare_exchange_strong_explicit.md | 4 +++- .../atomic_compare_exchange_weak.md | 4 +++- .../atomic_compare_exchange_weak_explicit.md | 4 +++- .../memory/shared_ptr/atomic_exchange.md | 4 +++- .../shared_ptr/atomic_exchange_explicit.md | 4 +++- .../memory/shared_ptr/atomic_is_lock_free.md | 4 +++- reference/memory/shared_ptr/atomic_load.md | 4 +++- .../memory/shared_ptr/atomic_load_explicit.md | 4 +++- reference/memory/shared_ptr/atomic_store.md | 4 +++- .../shared_ptr/atomic_store_explicit.md | 4 +++- 12 files changed, 44 insertions(+), 22 deletions(-) diff --git a/reference/memory/shared_ptr.md b/reference/memory/shared_ptr.md index 5397305d8d..034716ba61 100644 --- a/reference/memory/shared_ptr.md +++ b/reference/memory/shared_ptr.md @@ -81,17 +81,17 @@ namespace std { | 名前 | 説明 | 対応バージョン | |-------------------------------------------|--------------------------------------------------|-------| -| [`atomic_is_lock_free`][is_lock_free] | 指定されたオブジェクトがロックフリーに振る舞えるかを調べる | C++11
C++20から非推奨 | -| [`atomic_store`][store] | 値を書き込む | C++11
C++20から非推奨 | -| [`atomic_store_explicit`][store_ex] | メモリオーダーを指定して値を書き込む | C++11
C++20から非推奨 | -| [`atomic_load`][load] | 値を読み込む | C++11
C++20から非推奨 | -| [`atomic_load_explicit`][load_ex] | メモリオーダーを指定して値を読み込む | C++11
C++20から非推奨 | -| [`atomic_exchange`][exchange] | 値を入れ替える | C++11
C++20から非推奨 | -| [`atomic_exchange_explicit`][exchange_ex] | メモリオーダーを指定して値を入れ替える | C++11
C++20から非推奨 | -| [`atomic_compare_exchange_weak`][exchange_weak] | 弱い比較で値の入れ替えを行う | C++11
C++20から非推奨 | -| [`atomic_compare_exchange_strong`][exchange_strong] | 強い比較で値の入れ替えを行う | C++11
C++20から非推奨 | -| [`atomic_compare_exchange_weak_explicit`][exchange_weak_ex] | 弱い比較でメモリオーダーを指定して値の入れ替えを行う | C++11
C++20から非推奨 | -| [`atomic_compare_exchange_strong_explicit`][exchange_strong_ex] | 強い比較でメモリオーダーを指定して値の入れ替えを行う | C++11
C++20から非推奨 | +| [`atomic_is_lock_free`][is_lock_free] | 指定されたオブジェクトがロックフリーに振る舞えるかを調べる | C++11
C++20から非推奨
C++26で削除 | +| [`atomic_store`][store] | 値を書き込む | C++11
C++20から非推奨
C++26で削除 | +| [`atomic_store_explicit`][store_ex] | メモリオーダーを指定して値を書き込む | C++11
C++20から非推奨
C++26で削除 | +| [`atomic_load`][load] | 値を読み込む | C++11
C++20から非推奨
C++26で削除 | +| [`atomic_load_explicit`][load_ex] | メモリオーダーを指定して値を読み込む | C++11
C++20から非推奨
C++26で削除 | +| [`atomic_exchange`][exchange] | 値を入れ替える | C++11
C++20から非推奨
C++26で削除 | +| [`atomic_exchange_explicit`][exchange_ex] | メモリオーダーを指定して値を入れ替える | C++11
C++20から非推奨
C++26で削除 | +| [`atomic_compare_exchange_weak`][exchange_weak] | 弱い比較で値の入れ替えを行う | C++11
C++20から非推奨
C++26で削除 | +| [`atomic_compare_exchange_strong`][exchange_strong] | 強い比較で値の入れ替えを行う | C++11
C++20から非推奨
C++26で削除 | +| [`atomic_compare_exchange_weak_explicit`][exchange_weak_ex] | 弱い比較でメモリオーダーを指定して値の入れ替えを行う | C++11
C++20から非推奨
C++26で削除 | +| [`atomic_compare_exchange_strong_explicit`][exchange_strong_ex] | 強い比較でメモリオーダーを指定して値の入れ替えを行う | C++11
C++20から非推奨
C++26で削除 | [is_lock_free]: shared_ptr/atomic_is_lock_free.md [store]: shared_ptr/atomic_store.md diff --git a/reference/memory/shared_ptr/atomic_compare_exchange_strong.md b/reference/memory/shared_ptr/atomic_compare_exchange_strong.md index 978e8cf204..1f5bf4d821 100644 --- a/reference/memory/shared_ptr/atomic_compare_exchange_strong.md +++ b/reference/memory/shared_ptr/atomic_compare_exchange_strong.md @@ -4,6 +4,7 @@ * function template[meta id-type] * cpp11[meta cpp] * cpp20deprecated[meta cpp] +* cpp26removed[meta cpp] ```cpp namespace std { @@ -13,7 +14,7 @@ namespace std { } ``` -この関数は、C++20から非推奨となった。アトミックアクセスの対象としている`shared_ptr`を[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)で置き換えることで同等の機能を使用できる。 +この関数は、C++20から非推奨となり、C++26で削除された。アトミックアクセスの対象としている`shared_ptr`を[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)で置き換えることで同等の機能を使用できる。 ## 概要 強い比較で、アトミックに`shared_ptr`オブジェクトを入れ替える。 @@ -94,3 +95,4 @@ int main() - [C++0x Shared_ptr atomic access - Faith and Brave - C++で遊ぼう](http://faithandbrave.hateblo.jp/entry/20081015/1224066366) - [LWG Issue 2172. Does `atomic_compare_exchange_*` accept `v == nullptr` arguments?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2172) - [P0718R2 Revising `atomic_shared_ptr` for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0718r2.html) +- [P2869R4 Remove Deprecated `shared_ptr` Atomic Access APIs from C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2869r4.pdf) diff --git a/reference/memory/shared_ptr/atomic_compare_exchange_strong_explicit.md b/reference/memory/shared_ptr/atomic_compare_exchange_strong_explicit.md index d8c5f820f6..a8535bbe24 100644 --- a/reference/memory/shared_ptr/atomic_compare_exchange_strong_explicit.md +++ b/reference/memory/shared_ptr/atomic_compare_exchange_strong_explicit.md @@ -4,6 +4,7 @@ * function template[meta id-type] * cpp11[meta cpp] * cpp20deprecated[meta cpp] +* cpp26removed[meta cpp] ```cpp namespace std { @@ -15,7 +16,7 @@ namespace std { ``` * memory_order[link /reference/atomic/memory_order.md] -この関数は、C++20から非推奨となった。アトミックアクセスの対象としている`shared_ptr`を[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)で置き換えることで同等の機能を使用できる。 +この関数は、C++20から非推奨となり、C++26で削除された。アトミックアクセスの対象としている`shared_ptr`を[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)で置き換えることで同等の機能を使用できる。 ## 概要 メモリオーダーを指定して、強い比較で、アトミックに`shared_ptr`オブジェクトを入れ替える。 @@ -106,3 +107,4 @@ int main() - [C++0x Shared_ptr atomic access - Faith and Brave - C++で遊ぼう](http://faithandbrave.hateblo.jp/entry/20081015/1224066366) - [LWG Issue 2172. Does `atomic_compare_exchange_*` accept `v == nullptr` arguments?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2172) - [P0718R2 Revising `atomic_shared_ptr` for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0718r2.html) +- [P2869R4 Remove Deprecated `shared_ptr` Atomic Access APIs from C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2869r4.pdf) diff --git a/reference/memory/shared_ptr/atomic_compare_exchange_weak.md b/reference/memory/shared_ptr/atomic_compare_exchange_weak.md index 36146f0e71..d39fd7ca34 100644 --- a/reference/memory/shared_ptr/atomic_compare_exchange_weak.md +++ b/reference/memory/shared_ptr/atomic_compare_exchange_weak.md @@ -4,6 +4,7 @@ * function template[meta id-type] * cpp11[meta cpp] * cpp20deprecated[meta cpp] +* cpp26removed[meta cpp] ```cpp namespace std { @@ -13,7 +14,7 @@ namespace std { } ``` -この関数は、C++20から非推奨となった。アトミックアクセスの対象としている`shared_ptr`を[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)で置き換えることで同等の機能を使用できる。 +この関数は、C++20から非推奨となり、C++26で削除された。アトミックアクセスの対象としている`shared_ptr`を[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)で置き換えることで同等の機能を使用できる。 ## 概要 弱い比較で、アトミックに`shared_ptr`オブジェクトを入れ替える。 @@ -93,3 +94,4 @@ int main() - [C++0x Shared_ptr atomic access - Faith and Brave - C++で遊ぼう](http://faithandbrave.hateblo.jp/entry/20081015/1224066366) - [LWG Issue 2172. Does `atomic_compare_exchange_*` accept `v == nullptr` arguments?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2172) - [P0718R2 Revising `atomic_shared_ptr` for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0718r2.html) +- [P2869R4 Remove Deprecated `shared_ptr` Atomic Access APIs from C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2869r4.pdf) diff --git a/reference/memory/shared_ptr/atomic_compare_exchange_weak_explicit.md b/reference/memory/shared_ptr/atomic_compare_exchange_weak_explicit.md index 71ca34753a..df835ba007 100644 --- a/reference/memory/shared_ptr/atomic_compare_exchange_weak_explicit.md +++ b/reference/memory/shared_ptr/atomic_compare_exchange_weak_explicit.md @@ -4,6 +4,7 @@ * function template[meta id-type] * cpp11[meta cpp] * cpp20deprecated[meta cpp] +* cpp26removed[meta cpp] ```cpp namespace std { @@ -15,7 +16,7 @@ namespace std { ``` * memory_order[link /reference/atomic/memory_order.md] -この関数は、C++20から非推奨となった。アトミックアクセスの対象としている`shared_ptr`を[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)で置き換えることで同等の機能を使用できる。 +この関数は、C++20から非推奨となり、C++26で削除された。アトミックアクセスの対象としている`shared_ptr`を[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)で置き換えることで同等の機能を使用できる。 ## 概要 メモリオーダーを指定して、弱い比較で、アトミックに`shared_ptr`オブジェクトを入れ替える。 @@ -104,3 +105,4 @@ int main() - [C++0x Shared_ptr atomic access - Faith and Brave - C++で遊ぼう](http://faithandbrave.hateblo.jp/entry/20081015/1224066366) - [LWG Issue 2172. Does `atomic_compare_exchange_*` accept `v == nullptr` arguments?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2172) - [P0718R2 Revising `atomic_shared_ptr` for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0718r2.html) +- [P2869R4 Remove Deprecated `shared_ptr` Atomic Access APIs from C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2869r4.pdf) diff --git a/reference/memory/shared_ptr/atomic_exchange.md b/reference/memory/shared_ptr/atomic_exchange.md index 4aa17f26f2..436814b477 100644 --- a/reference/memory/shared_ptr/atomic_exchange.md +++ b/reference/memory/shared_ptr/atomic_exchange.md @@ -4,6 +4,7 @@ * function template[meta id-type] * cpp11[meta cpp] * cpp20deprecated[meta cpp] +* cpp26removed[meta cpp] ```cpp namespace std { @@ -12,7 +13,7 @@ namespace std { } ``` -この関数は、C++20から非推奨となった。アトミックアクセスの対象としている`shared_ptr`を[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)で置き換えることで同等の機能を使用できる。 +この関数は、C++20から非推奨となり、C++26で削除された。アトミックアクセスの対象としている`shared_ptr`を[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)で置き換えることで同等の機能を使用できる。 ## 概要 `shared_ptr`オブジェクトを、アトミックに入れ替える。 @@ -84,3 +85,4 @@ int main() - [N2674 Shared_ptr atomic access, revision 1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2674.htm) - [C++0x Shared_ptr atomic access - Faith and Brave - C++で遊ぼう](http://faithandbrave.hateblo.jp/entry/20081015/1224066366) - [P0718R2 Revising `atomic_shared_ptr` for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0718r2.html) +- [P2869R4 Remove Deprecated `shared_ptr` Atomic Access APIs from C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2869r4.pdf) diff --git a/reference/memory/shared_ptr/atomic_exchange_explicit.md b/reference/memory/shared_ptr/atomic_exchange_explicit.md index 05b02df40a..d66704f14c 100644 --- a/reference/memory/shared_ptr/atomic_exchange_explicit.md +++ b/reference/memory/shared_ptr/atomic_exchange_explicit.md @@ -4,6 +4,7 @@ * function template[meta id-type] * cpp11[meta cpp] * cpp20deprecated[meta cpp] +* cpp26removed[meta cpp] ```cpp namespace std { @@ -14,7 +15,7 @@ namespace std { ``` * memory_order[link /reference/atomic/memory_order.md] -この関数は、C++20から非推奨となった。アトミックアクセスの対象としている`shared_ptr`を[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)で置き換えることで同等の機能を使用できる。 +この関数は、C++20から非推奨となり、C++26で削除された。アトミックアクセスの対象としている`shared_ptr`を[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)で置き換えることで同等の機能を使用できる。 ## 概要 メモリオーダーを指定して、`shared_ptr`オブジェクトを、アトミックに入れ替える。 @@ -88,3 +89,4 @@ int main() - [N2674 Shared_ptr atomic access, revision 1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2674.htm) - [C++0x Shared_ptr atomic access - Faith and Brave - C++で遊ぼう](http://faithandbrave.hateblo.jp/entry/20081015/1224066366) - [P0718R2 Revising `atomic_shared_ptr` for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0718r2.html) +- [P2869R4 Remove Deprecated `shared_ptr` Atomic Access APIs from C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2869r4.pdf) diff --git a/reference/memory/shared_ptr/atomic_is_lock_free.md b/reference/memory/shared_ptr/atomic_is_lock_free.md index 42d63173c0..696c844ec9 100644 --- a/reference/memory/shared_ptr/atomic_is_lock_free.md +++ b/reference/memory/shared_ptr/atomic_is_lock_free.md @@ -4,6 +4,7 @@ * function template[meta id-type] * cpp11[meta cpp] * cpp20deprecated[meta cpp] +* cpp26removed[meta cpp] ```cpp namespace std { @@ -12,7 +13,7 @@ namespace std { } ``` -この関数は、C++20から非推奨となった。アトミックアクセスの対象としている`shared_ptr`を[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)で置き換えることで同等の機能を使用できる。 +この関数は、C++20から非推奨となり、C++26で削除された。アトミックアクセスの対象としている`shared_ptr`を[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)で置き換えることで同等の機能を使用できる。 ## 概要 `shared_ptr`オブジェクトがロックフリーに振る舞えるかを判定する。 @@ -83,3 +84,4 @@ shared_ptr isn't lock-free - [N2674 Shared_ptr atomic access, revision 1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2674.htm) - [C++0x Shared_ptr atomic access - Faith and Brave - C++で遊ぼう](http://faithandbrave.hateblo.jp/entry/20081015/1224066366) - [P0718R2 Revising `atomic_shared_ptr` for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0718r2.html) +- [P2869R4 Remove Deprecated `shared_ptr` Atomic Access APIs from C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2869r4.pdf) diff --git a/reference/memory/shared_ptr/atomic_load.md b/reference/memory/shared_ptr/atomic_load.md index 1c39621918..8074f84b91 100644 --- a/reference/memory/shared_ptr/atomic_load.md +++ b/reference/memory/shared_ptr/atomic_load.md @@ -4,6 +4,7 @@ * function template[meta id-type] * cpp11[meta cpp] * cpp20deprecated[meta cpp] +* cpp26removed[meta cpp] ```cpp namespace std { @@ -12,7 +13,7 @@ namespace std { } ``` -この関数は、C++20から非推奨となった。アトミックアクセスの対象としている`shared_ptr`を[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)で置き換えることで同等の機能を使用できる。 +この関数は、C++20から非推奨となり、C++26で削除された。アトミックアクセスの対象としている`shared_ptr`を[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)で置き換えることで同等の機能を使用できる。 ## 概要 `shared_ptr`オブジェクトを、アトミックに読み込む。 @@ -86,3 +87,4 @@ int main() - [N2674 Shared_ptr atomic access, revision 1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2674.htm) - [C++0x Shared_ptr atomic access - Faith and Brave - C++で遊ぼう](http://faithandbrave.hateblo.jp/entry/20081015/1224066366) - [P0718R2 Revising `atomic_shared_ptr` for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0718r2.html) +- [P2869R4 Remove Deprecated `shared_ptr` Atomic Access APIs from C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2869r4.pdf) diff --git a/reference/memory/shared_ptr/atomic_load_explicit.md b/reference/memory/shared_ptr/atomic_load_explicit.md index 3b3e89d0d1..e51c7223d4 100644 --- a/reference/memory/shared_ptr/atomic_load_explicit.md +++ b/reference/memory/shared_ptr/atomic_load_explicit.md @@ -4,6 +4,7 @@ * function template[meta id-type] * cpp11[meta cpp] * cpp20deprecated[meta cpp] +* cpp26removed[meta cpp] ```cpp namespace std { @@ -13,7 +14,7 @@ namespace std { ``` * memory_order[link /reference/atomic/memory_order.md] -この関数は、C++20から非推奨となった。アトミックアクセスの対象としている`shared_ptr`を[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)で置き換えることで同等の機能を使用できる。 +この関数は、C++20から非推奨となり、C++26で削除された。アトミックアクセスの対象としている`shared_ptr`を[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)で置き換えることで同等の機能を使用できる。 ## 概要 メモリオーダーを指定して、`shared_ptr`オブジェクトを、アトミックに読み込む。 @@ -90,3 +91,4 @@ int main() - [N2674 Shared_ptr atomic access, revision 1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2674.htm) - [C++0x Shared_ptr atomic access - Faith and Brave - C++で遊ぼう](http://faithandbrave.hateblo.jp/entry/20081015/1224066366) - [P0718R2 Revising `atomic_shared_ptr` for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0718r2.html) +- [P2869R4 Remove Deprecated `shared_ptr` Atomic Access APIs from C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2869r4.pdf) diff --git a/reference/memory/shared_ptr/atomic_store.md b/reference/memory/shared_ptr/atomic_store.md index a6194f0a4e..64014d49e0 100644 --- a/reference/memory/shared_ptr/atomic_store.md +++ b/reference/memory/shared_ptr/atomic_store.md @@ -4,6 +4,7 @@ * function template[meta id-type] * cpp11[meta cpp] * cpp20deprecated[meta cpp] +* cpp26removed[meta cpp] ```cpp namespace std { @@ -12,7 +13,7 @@ namespace std { } ``` -この関数は、C++20から非推奨となった。アトミックアクセスの対象としている`shared_ptr`を[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)で置き換えることで同等の機能を使用できる。 +この関数は、C++20から非推奨となり、C++26で削除された。アトミックアクセスの対象としている`shared_ptr`を[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)で置き換えることで同等の機能を使用できる。 ## 概要 `shared_ptr`オブジェクトに、アトミックに値を書き込む。 @@ -90,3 +91,4 @@ int main() - [N2674 Shared_ptr atomic access, revision 1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2674.htm) - [C++0x Shared_ptr atomic access - Faith and Brave - C++で遊ぼう](http://faithandbrave.hateblo.jp/entry/20081015/1224066366) - [P0718R2 Revising `atomic_shared_ptr` for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0718r2.html) +- [P2869R4 Remove Deprecated `shared_ptr` Atomic Access APIs from C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2869r4.pdf) diff --git a/reference/memory/shared_ptr/atomic_store_explicit.md b/reference/memory/shared_ptr/atomic_store_explicit.md index e51443ce28..30e4fd27d2 100644 --- a/reference/memory/shared_ptr/atomic_store_explicit.md +++ b/reference/memory/shared_ptr/atomic_store_explicit.md @@ -4,6 +4,7 @@ * function template[meta id-type] * cpp11[meta cpp] * cpp20deprecated[meta cpp] +* cpp26removed[meta cpp] ```cpp namespace std { @@ -13,7 +14,7 @@ namespace std { ``` * memory_order[link /reference/atomic/memory_order.md] -この関数は、C++20から非推奨となった。アトミックアクセスの対象としている`shared_ptr`を[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)で置き換えることで同等の機能を使用できる。 +この関数は、C++20から非推奨となり、C++26で削除された。アトミックアクセスの対象としている`shared_ptr`を[`shared_ptr`に対する`atomic`特殊化](/reference/memory/atomic.md)で置き換えることで同等の機能を使用できる。 ## 概要 メモリオーダーを指定して、`shared_ptr`オブジェクトに、アトミックに値を書き込む。 @@ -94,3 +95,4 @@ int main() - [N2674 Shared_ptr atomic access, revision 1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2674.htm) - [C++0x Shared_ptr atomic access - Faith and Brave - C++で遊ぼう](http://faithandbrave.hateblo.jp/entry/20081015/1224066366) - [P0718R2 Revising `atomic_shared_ptr` for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0718r2.html) +- [P2869R4 Remove Deprecated `shared_ptr` Atomic Access APIs from C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2869r4.pdf) From 35f7f21e936582cfcaf2e803db6963d7b1f86fff Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 9 Aug 2024 12:46:09 +0900 Subject: [PATCH 1134/3948] =?UTF-8?q?locale=20:=20C++26=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=E3=81=A8=E3=81=97=E3=81=A6=E3=80=81wstring=5Fconvert=E3=81=A8w?= =?UTF-8?q?buffer=5Fconvert=E3=82=92=E5=89=8A=E9=99=A4=20(close=20#1333)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 2 +- reference/locale.md | 4 ++-- reference/locale/wbuffer_convert.md | 6 ++++-- reference/locale/wstring_convert.md | 6 ++++-- reference/locale/wstring_convert/converted.md | 5 +++-- reference/locale/wstring_convert/from_bytes.md | 5 ++++- reference/locale/wstring_convert/op_assign.md | 5 +++-- reference/locale/wstring_convert/op_constructor.md | 6 ++++-- reference/locale/wstring_convert/op_destructor.md | 6 ++++-- reference/locale/wstring_convert/state.md | 6 ++++-- reference/locale/wstring_convert/to_bytes.md | 6 ++++-- 11 files changed, 37 insertions(+), 20 deletions(-) diff --git a/lang/cpp26.md b/lang/cpp26.md index f157155999..bb5a3f9576 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -332,7 +332,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 ### 機能の削除 - C++98から非推奨となっていた``ライブラリを削除 -- C++17から非推奨となっていたUnicode変換ライブラリ[``](/reference/codecvt.md)と[`std::wstring_convert`](/reference/locale/wstring_convert.md)を削除 +- C++17から非推奨となっていたUnicode変換ライブラリ[``](/reference/codecvt.md)と、[`std::wstring_convert`](/reference/locale/wstring_convert.md)クラス、[`std::wbuffer_convert`](/reference/locale/wbuffer_convert.md)クラスを削除 - C++20から非推奨となっていた、[`std::basic_string`](/reference/string/basic_string.md)`::`[`reserve()`](/reference/string/basic_string/reserve.md)のパラメータなしのオーバーロードを削除 - C++20から非推奨となっていた[`std::shared_ptr`](/reference/memory/shared_ptr.md)に対する、以下の古いアトミック操作関数のオーバーロードを削除 - [`std::atomic_is_lock_free`](/reference/memory/shared_ptr/atomic_is_lock_free.md) diff --git a/reference/locale.md b/reference/locale.md index e583382c95..fba3c964ce 100644 --- a/reference/locale.md +++ b/reference/locale.md @@ -30,8 +30,8 @@ | `isgraph` | 図形文字の判定(function) | | | [`toupper`](locale/toupper.md) | 英大文字への変換(function) | | | [`tolower`](locale/tolower.md) | 英子文字への変換(function) | | -| [`wstring_convert`](locale/wstring_convert.md) | `codecvt`による文字列変換(class template) | C++11
C++17から非推奨 | -| [`wbuffer_convert`](locale/wbuffer_convert.md) | `codecvt`によるストリームバッファ変換(class template) | C++11
C++17から非推奨 | +| [`wstring_convert`](locale/wstring_convert.md) | `codecvt`による文字列変換(class template) | C++11
C++17から非推奨
C++26で削除 | +| [`wbuffer_convert`](locale/wbuffer_convert.md) | `codecvt`によるストリームバッファ変換(class template) | C++11
C++17から非推奨
C++26で削除 | | [`ctype_base`](locale/ctype_base.md) | 文字分類のための基底クラス(class) | | | [`ctype`](locale/ctype.md) | 文字の分類(class template) | | | [`ctype_byname`](locale/ctype_byname.md) | 名前による文字の分類(class template) | | diff --git a/reference/locale/wbuffer_convert.md b/reference/locale/wbuffer_convert.md index fb533769da..91e8ae58e6 100644 --- a/reference/locale/wbuffer_convert.md +++ b/reference/locale/wbuffer_convert.md @@ -4,6 +4,7 @@ * class template[meta id-type] * cpp11[meta cpp] * cpp17deprecated[meta cpp] +* cpp26removed[meta cpp] ```cpp namespace std { @@ -19,12 +20,12 @@ namespace std { (ここに、クラスの概要を記載する) -## 非推奨の詳細 +## 非推奨・削除の詳細 Unicodeの文字コード変換を行うこれらのクラスは、不正なコードポイントに対する安全なエラー処理の方法を提供していなかったため、セキュリティ上の欠陥があった。 仕様もあいまいであったため、不正なコードポイントに対してどのように振る舞うかも不明であった。 -Unicode以外のShift_JISやBig5といった文字コードの利用が急激に減少している。標準ライブラリでの現代的なUnicodeの変換機能は非常に必要とされているが、[``](/reference/codecvt.md)とそれに関連する機能の設計はお粗末なものだった。将来より良いものを作るために、これらの機能は非推奨とする。 +Unicode以外のShift_JISやBig5といった文字コードの利用が急激に減少している。標準ライブラリでの現代的なUnicodeの変換機能は非常に必要とされているが、[``](/reference/codecvt.md)とそれに関連する機能の設計はお粗末なものだった。将来より良いものを作るために、これらの機能は非推奨・削除とする。 標準ライブラリにUnicodeの文字コード変換をする代替機能はないため、他の専門特化した文字コード変換のライブラリを使用すること。 @@ -65,3 +66,4 @@ Unicode以外のShift_JISやBig5といった文字コードの利用が急激に ## 参照 - [N2007 Proposed Library Additions for Code Conversion](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2007.html) - [P0618R0 Deprecating ``](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0618r0.html) +- [P2872R3 Remove `wstring_convert` From C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2872r3.pdf) diff --git a/reference/locale/wstring_convert.md b/reference/locale/wstring_convert.md index 54c1b3783b..c15e88ba2b 100644 --- a/reference/locale/wstring_convert.md +++ b/reference/locale/wstring_convert.md @@ -4,6 +4,7 @@ * class template[meta id-type] * cpp11[meta cpp] * cpp17deprecated[meta cpp] +* cpp26removed[meta cpp] ```cpp namespace std { @@ -44,12 +45,12 @@ namespace std { [utf8]: /reference/codecvt/codecvt_utf8.md -## 非推奨の詳細 +## 非推奨・削除の詳細 Unicodeの文字コード変換を行うこれらのクラスは、不正なコードポイントに対する安全なエラー処理の方法を提供していなかったため、セキュリティ上の欠陥があった。 仕様もあいまいであったため、不正なコードポイントに対してどのように振る舞うかも不明であった。 -Unicode以外のShift_JISやBig5といった文字コードの利用が急激に減少している。標準ライブラリでの現代的なUnicodeの変換機能は非常に必要とされているが、[``](/reference/codecvt.md)とそれに関連する機能の設計はお粗末なものだった。将来より良いものを作るために、これらの機能は非推奨とする。 +Unicode以外のShift_JISやBig5といった文字コードの利用が急激に減少している。標準ライブラリでの現代的なUnicodeの変換機能は非常に必要とされているが、[``](/reference/codecvt.md)とそれに関連する機能の設計はお粗末なものだった。将来より良いものを作るために、これらの機能は非推奨・削除とする。 標準ライブラリにUnicodeの文字コード変換をする代替機能はないため、他の専門特化した文字コード変換のライブラリを使用すること。 @@ -121,3 +122,4 @@ int main() ## 参照 - [N2007 Proposed Library Additions for Code Conversion](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2007.html) - [P0618R0 Deprecating ``](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0618r0.html) +- [P2872R3 Remove `wstring_convert` From C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2872r3.pdf) diff --git a/reference/locale/wstring_convert/converted.md b/reference/locale/wstring_convert/converted.md index a4cf7e1c0c..b3f52e7446 100644 --- a/reference/locale/wstring_convert/converted.md +++ b/reference/locale/wstring_convert/converted.md @@ -5,13 +5,14 @@ * function[meta id-type] * cpp11[meta cpp] * cpp17deprecated[meta cpp] +* cpp26removed[meta cpp] ```cpp std::size_t converted() const; // C++11 std::size_t converted() const noexcept; // C++14 ``` -このクラスはC++17から非推奨となった。 +このクラスはC++17から非推奨となり、C++26で削除された。 ## 概要 変換した要素数を取得する。 @@ -75,4 +76,4 @@ int main() ## 参照 - [LWG Issue 2174. `wstring_convert::converted()` should be `noexcept`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2174) - +- [P2872R3 Remove `wstring_convert` From C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2872r3.pdf) diff --git a/reference/locale/wstring_convert/from_bytes.md b/reference/locale/wstring_convert/from_bytes.md index 0d19374072..1aed23c22d 100644 --- a/reference/locale/wstring_convert/from_bytes.md +++ b/reference/locale/wstring_convert/from_bytes.md @@ -5,6 +5,7 @@ * function[meta id-type] * cpp11[meta cpp] * cpp17deprecated[meta cpp] +* cpp26removed[meta cpp] ```cpp wide_string from_bytes(char byte); // (1) @@ -14,7 +15,7 @@ wide_string from_bytes(const char* first, const char* last); // (4) ``` -このクラスはC++17から非推奨となった。 +このクラスはC++17から非推奨となり、C++26で削除された。 ## 概要 バイト文字列からワイド文字列に変換する。 @@ -107,3 +108,5 @@ int main() - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] +## 参照 +- [P2872R3 Remove `wstring_convert` From C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2872r3.pdf) diff --git a/reference/locale/wstring_convert/op_assign.md b/reference/locale/wstring_convert/op_assign.md index 1e578d5644..aca1466a4f 100644 --- a/reference/locale/wstring_convert/op_assign.md +++ b/reference/locale/wstring_convert/op_assign.md @@ -5,13 +5,14 @@ * function[meta id-type] * cpp11[meta cpp] * cpp17deprecated[meta cpp] +* cpp26removed[meta cpp] ```cpp wstring_convert& operator=(const wstring_convert&) = default; // C++11 wstring_convert& operator=(const wstring_convert&) = delete; // C++14 ``` -このクラスはC++17から非推奨となった。 +このクラスはC++17から非推奨となり、C++26で削除された。 ## 概要 コピー代入演算子。 @@ -21,4 +22,4 @@ wstring_convert& operator=(const wstring_convert&) = delete; // C++14 ## 参照 - [LWG Issue 2176. Special members for `wstring_convert` and `wbuffer_convert`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2176) - +- [P2872R3 Remove `wstring_convert` From C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2872r3.pdf) diff --git a/reference/locale/wstring_convert/op_constructor.md b/reference/locale/wstring_convert/op_constructor.md index 5437345fa2..43b69f596a 100644 --- a/reference/locale/wstring_convert/op_constructor.md +++ b/reference/locale/wstring_convert/op_constructor.md @@ -5,6 +5,7 @@ * function[meta id-type] * cpp11[meta cpp] * cpp17deprecated[meta cpp] +* cpp26removed[meta cpp] ```cpp wstring_convert(Codecvt* pcvt = new Codecvt); // (1) C++11 @@ -25,7 +26,7 @@ explicit wstring_convert( wstring_convert(const wstring_convert&) = delete; // (5) C++14 ``` -このクラスはC++17から非推奨となった。 +このクラスはC++17から非推奨となり、C++26で削除された。 ## 概要 - (1) : デフォルトコンストラクタ。 @@ -101,4 +102,5 @@ int main() ## 参照 - [LWG Issue 2175. `wstring_convert` and `wbuffer_convert` validity](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2175) - [LWG Issue 2176. Special members for `wstring_convert` and `wbuffer_convert`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2176) -- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) \ No newline at end of file +- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) +- [P2872R3 Remove `wstring_convert` From C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2872r3.pdf) diff --git a/reference/locale/wstring_convert/op_destructor.md b/reference/locale/wstring_convert/op_destructor.md index 5470f64448..3b655ba031 100644 --- a/reference/locale/wstring_convert/op_destructor.md +++ b/reference/locale/wstring_convert/op_destructor.md @@ -5,12 +5,13 @@ * function[meta id-type] * cpp11[meta cpp] * cpp17deprecated[meta cpp] +* cpp26removed[meta cpp] ```cpp ~wstring_convert(); ``` -このクラスはC++17から非推奨となった。 +このクラスはC++17から非推奨となり、C++26で削除された。 ## 概要 `Codecvt`型のインスタンスを破棄する。 @@ -26,4 +27,5 @@ - [ICC](/implementation.md#icc): - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] - +## 参照 +- [P2872R3 Remove `wstring_convert` From C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2872r3.pdf) diff --git a/reference/locale/wstring_convert/state.md b/reference/locale/wstring_convert/state.md index be434a5ce8..6bc45f35ea 100644 --- a/reference/locale/wstring_convert/state.md +++ b/reference/locale/wstring_convert/state.md @@ -5,12 +5,13 @@ * function[meta id-type] * cpp11[meta cpp] * cpp17deprecated[meta cpp] +* cpp26removed[meta cpp] ```cpp state_type state() const; ``` -このクラスはC++17から非推奨となった。 +このクラスはC++17から非推奨となり、C++26で削除された。 ## 概要 変換の状態を取得する。 @@ -73,4 +74,5 @@ converted all - [ICC](/implementation.md#icc): - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] - +## 参照 +- [P2872R3 Remove `wstring_convert` From C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2872r3.pdf) diff --git a/reference/locale/wstring_convert/to_bytes.md b/reference/locale/wstring_convert/to_bytes.md index 7e8d568f27..10bfe1be02 100644 --- a/reference/locale/wstring_convert/to_bytes.md +++ b/reference/locale/wstring_convert/to_bytes.md @@ -5,6 +5,7 @@ * function[meta id-type] * cpp11[meta cpp] * cpp17deprecated[meta cpp] +* cpp26removed[meta cpp] ```cpp byte_string to_bytes(Elem wchar); // (1) @@ -14,7 +15,7 @@ byte_string to_bytes(const Elem* first, const Elem* last); // (4) ``` -このクラスはC++17から非推奨となった。 +このクラスはC++17から非推奨となり、C++26で削除された。 ## 概要 ワイド文字列からバイト文字列に変換する。 @@ -106,4 +107,5 @@ int main() - [ICC](/implementation.md#icc): - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] - +## 参照 +- [P2872R3 Remove `wstring_convert` From C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2872r3.pdf) From a485eae4372c5cc76f55f1480fb417b244354c59 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 9 Aug 2024 13:03:48 +0900 Subject: [PATCH 1135/3948] =?UTF-8?q?println=20:=20C++26=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=E3=81=A8=E3=81=97=E3=81=A6=E3=80=81=E6=94=B9=E8=A1=8C=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E3=81=AE=E3=81=BF=E3=82=92=E5=87=BA=E5=8A=9B?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=82=AA=E3=83=BC=E3=83=90=E3=83=BC=E3=83=AD?= =?UTF-8?q?=E3=83=BC=E3=83=89=E3=82=92=E8=BF=BD=E5=8A=A0=20(close=20#1335)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ostream/println.md | 31 +++++++++++++++++++++++++ reference/print/println.md | 44 ++++++++++++++++++++++++++++++++++-- 2 files changed, 73 insertions(+), 2 deletions(-) diff --git a/reference/ostream/println.md b/reference/ostream/println.md index f5fee4e20d..1d1bcbe682 100644 --- a/reference/ostream/println.md +++ b/reference/ostream/println.md @@ -10,6 +10,8 @@ namespace std { void println(ostream& os, format_string fmt, Args&&... args); // (1) C++23 + + void println(ostream& os); // (2) C++26 } ``` * format_string[link /reference/format/basic_format_string.md] @@ -23,6 +25,7 @@ namespace std { この関数は、[`std::printf()`](/reference/cstdio/printf.md.nolink)関数ライクな書式指定で引数を文字列化して出力する。 - (1) : 指定した[`ostream`](basic_ostream.md)に、書式指定で出力する +- (2) : 指定した[`ostream`](basic_ostream.md)に、改行コードを出力する この関数は、末尾に改行コードが付くことに注意。改行コードが不要な場合は、[`std::print()`](print.md)関数を使用すること。 @@ -38,6 +41,12 @@ namespace std { * format[link /reference/format/format.md] * std::forward[link /reference/utility/forward.md] +- (2) : 以下と等価: + ```cpp + print(os, "\n"); + ``` + * print[link print.md] + ## 例 ### 基本的な使い方 @@ -75,6 +84,27 @@ int main() Hello ``` +### 改行コードを出力する (C++26) +```cpp example +#include + +int main() +{ + std::print(std::cout, "abc"); + std::println(std::cout, ); // 改行コードのみを出力する + std::print(std::cout, "{}", 123); + std::println(std::cout, ); +} +``` +* std::print[link print.md] + +#### 出力 +``` +abc +123 +``` + + ## バージョン ### 言語 - C++23 @@ -94,3 +124,4 @@ Hello ## 参照 - [P2093R14 Formatted output](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2093r14.html) +- [P3142R0 Printing Blank Lines with `println`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3142r0.pdf) diff --git a/reference/print/println.md b/reference/print/println.md index 8fd3580467..67830f962c 100644 --- a/reference/print/println.md +++ b/reference/print/println.md @@ -10,10 +10,14 @@ namespace std { void println(format_string fmt, Args&&... args); // (1) C++23 + void println(); // (2) C++26 + template void println(FILE* stream, format_string fmt, - Args&&... args); // (2) C++23 + Args&&... args); // (3) C++23 + + void println(FILE* stream); // (4) C++26 } ``` * format_string[link /reference/format/basic_format_string.md] @@ -27,7 +31,9 @@ namespace std { この関数は、[`std::printf()`](/reference/cstdio/printf.md.nolink)関数ライクな書式指定で引数を文字列化して出力する。 - (1) : 標準出力に、書式指定で出力する -- (2) : 指定された[`FILE`](/reference/cstdio/file.md.nolink)に、書式指定で出力する +- (2) : 標準出力に改行コードを出力する +- (3) : 指定された[`FILE`](/reference/cstdio/file.md.nolink)に、書式指定で出力する +- (4) : 指定された[`FILE`](/reference/cstdio/file.md.nolink)に、改行コードを出力する この関数は、末尾に改行コードが付くことに注意。改行コードが不要な場合は、[`std::print()`](print.md)関数を使用すること。 @@ -43,6 +49,12 @@ namespace std { * std::forward[link /reference/utility/forward.md] - (2) : 以下と等価: + ```cpp + println(stdout); + ``` + * stdout[link /reference/cstdio/stdout.md.nolink] + +- (3) : 以下と等価: ```cpp print(stream, "{}\n", format(fmt, std::forward(args)...)); ``` @@ -50,6 +62,12 @@ namespace std { * format[link /reference/format/format.md] * std::forward[link /reference/utility/forward.md] +- (4) : 以下と等価: + ```cpp + print(stream, "\n"); + ``` + * print[link print.md] + ## 例 ### 基本的な使い方 @@ -113,6 +131,27 @@ int main() Hello ``` + +### 改行コードを出力する (C++26) +```cpp example +#include + +int main() +{ + std::print("abc"); + std::println(); // 改行コードのみを出力する + std::print("{}", 123); + std::println(); +} +``` +* std::print[link print.md] + +#### 出力 +``` +abc +123 +``` + ## バージョン ### 言語 - C++23 @@ -132,3 +171,4 @@ Hello ## 参照 - [P2093R14 Formatted output](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2093r14.html) +- [P3142R0 Printing Blank Lines with `println`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3142r0.pdf) From 0eca2a433b8581d5dfdc389d1c933da3fa973931 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 9 Aug 2024 13:35:29 +0900 Subject: [PATCH 1136/3948] =?UTF-8?q?polymorphic=5Fallocator=20:=20C++26?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C=E3=81=A8=E3=81=97=E3=81=A6destroy=E3=81=AE?= =?UTF-8?q?=E9=9D=9E=E6=8E=A8=E5=A5=A8=E3=82=92=E5=8F=96=E3=82=8A=E6=B6=88?= =?UTF-8?q?=E3=81=97=20(close=20#1330)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../memory_resource/polymorphic_allocator.md | 2 +- .../polymorphic_allocator/destroy.md | 15 ++------------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/reference/memory_resource/polymorphic_allocator.md b/reference/memory_resource/polymorphic_allocator.md index 3ee66e2c6d..3ca17d2c52 100644 --- a/reference/memory_resource/polymorphic_allocator.md +++ b/reference/memory_resource/polymorphic_allocator.md @@ -46,7 +46,7 @@ C++20にてC++プログラミングにおいての基礎部品となる型(*vo | 名前 | 説明 | 対応バージョン | |-----------------|----------------|----------------| | [`construct`](polymorphic_allocator/construct.md) | 指定された領域にオブジェクトを構築する | C++17 | -| [`destroy`](polymorphic_allocator/destroy.md) | 指定された領域のオブジェクトを破棄する | C++17
C++20より非推奨 | +| [`destroy`](polymorphic_allocator/destroy.md) | 指定された領域のオブジェクトを破棄する | C++17 | | [`new_object`](polymorphic_allocator/new_object.md) | メモリを確保し指定した型の構築(`new`式相当の処理)を行う | C++20 | | [`delete_object`](polymorphic_allocator/delete_object.md) | 指定した型の破棄とそのメモリ領域の解放(`delete`式相当の処理)を行う | C++20 | diff --git a/reference/memory_resource/polymorphic_allocator/destroy.md b/reference/memory_resource/polymorphic_allocator/destroy.md index 81cf4cac02..2ed3166a34 100644 --- a/reference/memory_resource/polymorphic_allocator/destroy.md +++ b/reference/memory_resource/polymorphic_allocator/destroy.md @@ -4,16 +4,12 @@ * std::pmr[meta namespace] * polymorphic_allocator[meta class] * cpp17[meta cpp] -* cpp20deprecated[meta cpp] ```cpp template void destroy(T* p); ``` -この関数はC++20で非推奨となった。不要な機能ではあるが、代わりが必要であれば[`allocator_traits::destroy()`](/reference/memory/allocator_traits/destroy.md)もしくは[`destroy_at()`](/reference/memory/destroy_at.md)を使用すること。 - - ## 概要 指定された領域にある`T`のオブジェクトを破棄する。 @@ -25,15 +21,6 @@ void destroy(T* p); メモリ領域の解放は行われないため、別に[`deallocate`](deallocate.md)で行う必要がある。 -## 非推奨の詳細 - -`polymorphic_allocator`も含めたアロケータはコンテナから利用される際に`allocator_traits`を介して利用され、`allocator_traits`の提供するデフォルト実装によってアロケータとしての多くの部分が補われる。 - -本関数は、[`allocator_traits::destroy()`](/reference/memory/allocator_traits/destroy.md)で提供されているデフォルト実装と完全に同一の実装となっており、追加の事を何もしていない。従って有用性は何もなく、非推奨とされた。 - -おそらく、[`construct()`](construct.md)メンバ関数との対称性を意識して追加されていたものと思われる。なお、`construct()`メンバ関数は[uses-allocator 構築](/reference/memory/uses_allocator.md)のために追加の仕事を担っており、こちらの関数には有用であるため非推奨とはされていない。 - -`allocator_traits`を介して`polymorphic_allocator`を使用する場合は本関数の有無を気にする必要はないが、もし本関数が必要となった場合は代わりに[`destroy_at()`](/reference/memory/destroy_at.md)を利用できる。 ## 例 ```cpp example @@ -98,3 +85,5 @@ int main() - [Working Draft, C++ Extensions for Library Fundamentals, Version 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4562.html#memory.resource.synop) - [destroy: Missing member function of std::pmr::polymorphic_allocator - Developer Community](https://developercommunity.visualstudio.com/content/problem/394908/destroy-missing-member-function-of-stdpmrpolymorph.html) - [LWG Issue 3036. `polymorphic_allocator::destroy` is extraneous](https://cplusplus.github.io/LWG/issue3036) +- [P2875R4 Undeprecate `polymorphic_allocator::destroy` for C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2875r4.pdf) + - この関数はC++20で一度非推奨となったが、C++26で非推奨が取り消された。ただし、[`allocator_traits::destroy()`](/reference/memory/allocator_traits/destroy.md)関数や[`destroy_at()`](/reference/memory/destroy_at.md)関数で同等のことができる From d37661302181180d93ede8975f50903bd90ceb2c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 9 Aug 2024 14:27:18 +0900 Subject: [PATCH 1137/3948] =?UTF-8?q?random=20:=20C++26=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=E3=81=A8=E3=81=97=E3=81=A6=E3=80=81generate=5Frandom=E9=96=A2?= =?UTF-8?q?=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0=20(close=20#1339)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 2 +- reference/random.md | 1 + reference/random/generate_random.md | 162 ++++++++++++++++++++++++++++ 3 files changed, 164 insertions(+), 1 deletion(-) create mode 100644 reference/random/generate_random.md diff --git a/lang/cpp26.md b/lang/cpp26.md index bb5a3f9576..69f9811686 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -288,7 +288,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [`std::real()`](/reference/complex/complex/real_free.md) (算術型オーバーロード) - [`std::complex`](/reference/complex/complex.md)を構造化束縛や、将来のパターンマッチで使用できるようタプルインタフェースの特殊化を追加 - [``](/reference/random.md)の範囲`[0, 1)`の乱数を生成する[`std::generate_canonical()`](/reference/random/generate_canonical.md)を、望ましい統計的性質を保証するようアルゴリズムと制約を変更 -- [``](/reference/random.md)に、乱数列を生成する[`std::ranges::generate_random()`](/reference/random/generate_random.md.nolink)関数を追加 +- [``](/reference/random.md)に、乱数列を生成する[`std::ranges::generate_random()`](/reference/random/generate_random.md)関数を追加 ### ユーティリティ diff --git a/reference/random.md b/reference/random.md index 4df6517ac8..a0be2c7451 100644 --- a/reference/random.md +++ b/reference/random.md @@ -143,6 +143,7 @@ | 名前 | 説明 | 対応バージョン | |----------------|------------------------------|-------| | [`generate_canonical`](random/generate_canonical.md) | 実数区間\[0.0,1.0\)に展開(事実上正規化)された一様分布乱数を得る(function template) | C++11 | +| [`generate_random`](random/generate_random.md) | 乱数列を生成する(function template) | C++26 | ## 例 diff --git a/reference/random/generate_random.md b/reference/random/generate_random.md new file mode 100644 index 0000000000..d809d08ef1 --- /dev/null +++ b/reference/random/generate_random.md @@ -0,0 +1,162 @@ +# generate_random +* random[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std::ranges { + template + requires output_range> && + uniform_random_bit_generator> + constexpr borrowed_iterator_t + generate_random(R&& r, G&& g); // (1) C++26 + + template > O, + sentinel_for S> + requires uniform_random_bit_generator> + constexpr O + generate_random(O first, S last, G&& g); // (2) C++26 + + template + requires output_range> && + invocable && + uniform_random_bit_generator> + constexpr borrowed_iterator_t + generate_random(R&& r, G&& g, D&& d); // (3) C++26 + + template > O, + sentinel_for S> + requires invocable && + uniform_random_bit_generator> + constexpr O + generate_random(O first, S last, G&& g, D&& d); // (4) C++26 +} +``` +* output_range[link /reference/ranges/output_range.md] +* uniform_random_bit_generator[link uniform_random_bit_generator.md] +* invoke_result_t[link /reference/type_traits/invoke_result.md] +* remove_cvref_t[link /reference/type_traits/remove_cvref.md] +* borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* output_iterator[link /reference/iterator/output_iterator.md] +* sentinel_for[link /reference/iterator/sentinel_for.md] +* invocable[link /reference/concepts/invocable.md] + +## 概要 +乱数列を生成する。 + +- (1) : 出力範囲`r`の各要素に、乱数生成器`g`で生成した乱数を代入する +- (2) : 出力イテレータ範囲`[first, last)`の各要素に、乱数生成器`g`で生成した乱数を代入する +- (3) : 出力範囲`r`の各要素に、乱数生成器`g`と分布生成器`d`で生成した乱数を代入する +- (4) : 出力イテレータ範囲`[first, last)`の各要素に、乱数生成器`g`と分布生成器`d`で生成した乱数を代入する + +この関数は、`for`文を使用した以下のコードをアルゴリズム関数化したものである。 + +```cpp +std::vector v(10); +std::mt19937 gen {std::random_device{}()}; +std::uniform_int_distribution dist{1, 100}; + +// 以下の3つのコードは等価 +std::ranges::generate_random(v, gen); // (1) +std::ranges::generate_random(v.begin(), v.end(), gen); // (2) +for (auto& x : v) { + x = gen(); +} + +// 以下の3つのコードは等価 +std::ranges::generate_random(v, gen, dist); // (3) +std::ranges::generate_random(v.begin(), v.end(), gen, dist); // (4) +for (auto& x : v) { + x = dist(gen); +} +``` + + +## 効果 +- (1) : + - `g.generate_random(`[`std::forward`](/reference/utility/forward.md)`(r))`が妥当な式であれば、それを呼び出す + - 備考 : 乱数生成器が`generate_random()`メンバ関数をもっていればそれを使用する + - そうでなく、`R`が[`sized_range`](/reference/ranges/sized_range.md)のモデルである場合、値`N`と[`span`](/reference/span/span.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`, N>`型オブジェクト`s`に対して、式`g()`または`g.generate_random(s)`を未規定の回数だけ呼び出して実行し、`r`の各要素に代入する + - 備考 : ここでの`N`は乱数生成の回数と異なってもよい + - そうでなければ、[`ranges::generate`](/reference/algorithm/ranges_generate.md)`(`[`std::forward`](/reference/utility/forward.md)`(r), ref(g))`を呼び出す + - 備考 : [`std::forward_list`](/reference/forward_list/forward_list.md)のような`size()`メンバ関数をもたないコンテナがこちらに該当する + +- (2) : 以下と等価 + ```cpp + return generate_random(subrange(std::move(first), last), g); + ``` + * subrange[link /reference/ranges/subrange.md] + * std::move[link /reference/utility/move.md] + +- (3) : + - `d.generate_random(`[`std::forward`](/reference/utility/forward.md)`(r), g)`が妥当な式であれば、それを呼び出す + - 備考 : 分布生成器が`generate_random()`メンバ関数をもっていればそれを使用する + - そうでなく、`R`が[`sized_range`](/reference/ranges/sized_range.md)のモデルである場合、値`N`と[`span`](/reference/span/span.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`, N>`型オブジェクト`s`に対して、式[`invoke`](/reference/functional/invoke.md)`(d, g)`または`d.generate_random(s, g)`を未規定の回数だけ呼び出して実行し、`r`の各要素に代入する + - 備考 : ここでの`N`は乱数生成の回数と異なってもよい + - そうでなければ、[`ranges::generate`](/reference/algorithm/ranges_generate.md)`(`[`std::forward`](/reference/utility/forward.md)`(r), [&d, &g] { return` [`invoke`](/reference/functional/invoke.md)`(d, g); })`を呼び出す + - 備考 : [`std::forward_list`](/reference/forward_list/forward_list.md)のような`size()`メンバ関数をもたないコンテナがこちらに該当する + +- (4) : 以下と等価 + ```cpp + return generate_random(subrange(std::move(first), last), g, d); + ``` + * subrange[link /reference/ranges/subrange.md] + * std::move[link /reference/utility/move.md] + + +## 戻り値 +- (1), (3) : + ```cpp + return ranges::end(r); + ``` + * ranges::end[link /reference/ranges/end.md] + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::random_device seed_gen; + std::mt19937 engine(seed_gen()); + std::uniform_int_distribution dist{0, 100}; + + std::vector v(10); + + // コンテナの全要素を乱数で埋める + std::ranges::generate_random(v, engine); + std::println("{}", v); + + // コンテナの全要素を、指定した分布の乱数で埋める + std::ranges::generate_random(v, engine, dist); + std::println("{}", v); +} +``` +* std::generate_canonical[color ff0000] +* digits[link /reference/limits/numeric_limits/digits.md] + +### 出力 +``` +[2034091041, 1919373608, 514210727, -1154669807, -315048337, -1224623446, -1986406128, -1034429876, -844125616, 1858136340] +[83, 25, 48, 15, 9, 60, 47, 31, 91, 54] +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 19.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 14 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 10 [mark noimpl] + + +## 参照 +- [P1068R11 Vector API for random number generation](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p1068r11.pdf) From c04dea6711079a1c1c5aeb36f4cdfc5af8993edc Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 9 Aug 2024 14:28:57 +0900 Subject: [PATCH 1138/3948] =?UTF-8?q?generate=5Frandom=20:=20=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E4=BF=AE=E9=A3=BE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/random/generate_random.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/reference/random/generate_random.md b/reference/random/generate_random.md index d809d08ef1..6c9e90b136 100644 --- a/reference/random/generate_random.md +++ b/reference/random/generate_random.md @@ -139,8 +139,7 @@ int main() std::println("{}", v); } ``` -* std::generate_canonical[color ff0000] -* digits[link /reference/limits/numeric_limits/digits.md] +* std::generate_random[color ff0000] ### 出力 ``` From e9329c96e1d8471297937df1ee2e8ddbfff6547f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 9 Aug 2024 14:30:34 +0900 Subject: [PATCH 1139/3948] =?UTF-8?q?generate=5Frandom=20:=20=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E4=BF=AE=E9=A3=BE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/random/generate_random.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/random/generate_random.md b/reference/random/generate_random.md index 6c9e90b136..32765abfd2 100644 --- a/reference/random/generate_random.md +++ b/reference/random/generate_random.md @@ -139,7 +139,7 @@ int main() std::println("{}", v); } ``` -* std::generate_random[color ff0000] +* std::ranges::generate_random[color ff0000] ### 出力 ``` From b4085cfb1d2ea9e4f82a862ac91a05db0cf20195 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 9 Aug 2024 14:35:58 +0900 Subject: [PATCH 1140/3948] =?UTF-8?q?generate=5Frandom=20:=20=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E4=BF=AE=E9=A3=BE=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/random/generate_random.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reference/random/generate_random.md b/reference/random/generate_random.md index 32765abfd2..acec6c269f 100644 --- a/reference/random/generate_random.md +++ b/reference/random/generate_random.md @@ -74,6 +74,7 @@ for (auto& x : v) { x = dist(gen); } ``` +* std::uniform_int_distribution[link uniform_int_distribution.md] ## 効果 @@ -140,6 +141,7 @@ int main() } ``` * std::ranges::generate_random[color ff0000] +* std::uniform_int_distribution[link uniform_int_distribution.md] ### 出力 ``` From c8d18a6d28b575d1a8c80c7d435cf6beafc2b3d7 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 9 Aug 2024 14:36:39 +0900 Subject: [PATCH 1141/3948] =?UTF-8?q?generate=5Frandom=20:=20=E5=87=BA?= =?UTF-8?q?=E5=8A=9B=20=E2=86=92=20=E5=87=BA=E5=8A=9B=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/random/generate_random.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/random/generate_random.md b/reference/random/generate_random.md index acec6c269f..b13fab2c8a 100644 --- a/reference/random/generate_random.md +++ b/reference/random/generate_random.md @@ -143,7 +143,7 @@ int main() * std::ranges::generate_random[color ff0000] * std::uniform_int_distribution[link uniform_int_distribution.md] -### 出力 +### 出力例 ``` [2034091041, 1919373608, 514210727, -1154669807, -315048337, -1224623446, -1986406128, -1034429876, -844125616, 1858136340] [83, 25, 48, 15, 9, 60, 47, 31, 91, 54] From 1276fca74674bb2f54108a79e630d3ec65037855 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sun, 11 Aug 2024 17:03:17 +0900 Subject: [PATCH 1142/3948] add append_range, assign_range and insert_range to std::vector --- reference/vector/vector.md | 3 ++ reference/vector/vector/append_range.md | 65 +++++++++++++++++++++++++ reference/vector/vector/assign_range.md | 64 ++++++++++++++++++++++++ reference/vector/vector/insert_range.md | 62 +++++++++++++++++++++++ 4 files changed, 194 insertions(+) create mode 100644 reference/vector/vector/append_range.md create mode 100644 reference/vector/vector/assign_range.md create mode 100644 reference/vector/vector/insert_range.md diff --git a/reference/vector/vector.md b/reference/vector/vector.md index 725ca5847c..c98058e9b3 100644 --- a/reference/vector/vector.md +++ b/reference/vector/vector.md @@ -100,11 +100,14 @@ namespace std { | 名前 | 説明 | 対応バージョン | |--------------------------------------------|------------------|-------| | [`assign`](vector/assign.md) | コンテナの再代入 | | +| [`assign_range`](vector/assign_range.md) | Rangeの要素を再代入 | C++23 | | [`push_back`](vector/push_back.md) | 末尾へ要素追加 | | | [`emplace_back`](vector/emplace_back.md) | 末尾へ直接構築 | C++11 | +| [`append_range`](vector/append_range.md) | Rangeの要素を末尾へ追加 | C++23 | | [`pop_back`](vector/pop_back.md) | 末尾から要素削除 | | | [`insert`](vector/insert.md) | 要素の挿入 | | | [`emplace`](vector/emplace.md) | 要素の直接構築による挿入 | C++11 | +| [`insert_range`](vector/insert_range.md) | Rangeの要素を挿入 | C++23 | | [`erase`](vector/erase.md) | 要素の削除 | | | [`swap`](vector/swap.md) | コンテナの交換 | | | [`clear`](vector/clear.md) | 全要素削除 | | diff --git a/reference/vector/vector/append_range.md b/reference/vector/vector/append_range.md new file mode 100644 index 0000000000..8e95fa7d25 --- /dev/null +++ b/reference/vector/vector/append_range.md @@ -0,0 +1,65 @@ +# append_range +* vector[meta header] +* std[meta namespace] +* vector[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +template R> +constexpr void append_range(R&& rg); // C++23 +``` + +## 概要 +Rangeの要素を末尾へ追加する。 + + +## テンプレートパラメータ制約 +型`T`が`*ranges::begin(rg)`から`vector`コンテナへの`EmplaceConstructible`かつ`MoveInsertable`であること。 + + +## 効果 +Range`rg`の各要素を、末尾に追加する。 + + +## 戻り値 +なし + + +## 計算量 +要素を追加した後の[`size()`](size.md)が要素を追加する前の[`capacity()`](capacity.md)よりも大きい場合は領域の再確保が生じ、要素を追加した後の[`size()`](size.md)に比例する。領域の再確保が発生しない場合は、[`ranges::distance`](../../iterator/ranges_distance.md)`(rg)`に比例する。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::vector v = {1, 2, 3}; + const int a[3] = {4, 5, 6}; + + // Rangeを末尾に追加 + v.append_range(a); + + for (int i : v) { + std::cout << i << " "; + } + std::cout << std::endl; +} +``` +* append_range[color ff0000] + +### 出力 +``` +1 2 3 4 5 6 +``` + + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------------------|----------------------| +| [`push_back`](push_back.md) | 末尾へ要素追加 | +| [`emplace_back`](emplace_back.md) | 末尾へ直接構築 | diff --git a/reference/vector/vector/assign_range.md b/reference/vector/vector/assign_range.md new file mode 100644 index 0000000000..85f4f4bf15 --- /dev/null +++ b/reference/vector/vector/assign_range.md @@ -0,0 +1,64 @@ +# assign_range +* vector[meta header] +* std[meta namespace] +* vector[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +template R> +constexpr void assign_range(R&& rg); // C++23 +``` + +## 概要 +Rangeの各要素を再代入する。 + + +## 事前条件 +`*this` の要素の範囲と Range`rg` の要素の範囲が重複していないこと + + +## テンプレートパラメータ制約 +型`T`が`*ranges::begin(rg)`から`vector`コンテナへの`EmplaceConstructible`であること。また、`R`が[`ranges::sized_range`](../../ranges/sized_range.md)でも[`ranges::forward_range`](../../ranges/forward_range.md)でもないなら、コンテナへの`MoveInsertable`であること。 + + +## 効果 +Range`rg`の各要素を、再代入する。 + + +## 戻り値 +なし + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::vector v = {1, 2, 3}; + const int a[3] = {4, 5, 6}; + + // Rangeを再代入 + v.assign_range(a); + + for (int i : v) { + std::cout << i << " "; + } + std::cout << std::endl; +} +``` +* assign_range[color ff0000] + +### 出力 +``` +4 5 6 +``` + + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------------------|----------------------| +| [`assign`](assign.md) | コンテナの再代入 | diff --git a/reference/vector/vector/insert_range.md b/reference/vector/vector/insert_range.md new file mode 100644 index 0000000000..3485ba0ef8 --- /dev/null +++ b/reference/vector/vector/insert_range.md @@ -0,0 +1,62 @@ +# insert_range +* vector[meta header] +* std[meta namespace] +* vector[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +template R> +constexpr iterator insert_range(const_iterator pos, R&& rg); // C++23 +``` + +## 概要 +Rangeの各要素を任意の位置に挿入する。 + + +## テンプレートパラメータ制約 +型`T`が`*ranges::begin(rg)`から`vector`コンテナへの`EmplaceConstructible`であり、かつ型`T`が`MoveConstructible`・`MoveAssignable`・`Swappable`であること。 + + +## 効果 +Range`rg`の各要素を、`pos`の直前に挿入する。 + + +## 戻り値 +挿入されたRange`rg`の最初の要素を指すイテレータ。`rg`が空の場合は`pos`。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::vector v = {1, 2, 3}; + const int a[3] = {4, 5, 6}; + + // Rangeを1番目と2番目の要素の間に挿入 + v.insert_range(std::next(v.begin()), a); + + for (int i : v) { + std::cout << i << " "; + } + std::cout << std::endl; +} +``` +* insert_range[color ff0000] + +### 出力 +``` +1 4 5 6 2 3 +``` + + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------------------|----------------------| +| [`insert`](insert.md) | 要素の挿入 | +| [`emplace`](emplace.md) | 要素の直接構築による挿入 | From e2d69e3d688ced5fc4f44851620756eb65fd6f25 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sun, 11 Aug 2024 17:04:47 +0900 Subject: [PATCH 1143/3948] add append_range, assign_range and insert_range to std::string --- reference/string/basic_string.md | 3 ++ reference/string/basic_string/append_range.md | 49 +++++++++++++++++ reference/string/basic_string/assign_range.md | 53 ++++++++++++++++++ reference/string/basic_string/insert_range.md | 54 +++++++++++++++++++ 4 files changed, 159 insertions(+) create mode 100644 reference/string/basic_string/append_range.md create mode 100644 reference/string/basic_string/assign_range.md create mode 100644 reference/string/basic_string/insert_range.md diff --git a/reference/string/basic_string.md b/reference/string/basic_string.md index ef2f425d94..8f4e693d3d 100644 --- a/reference/string/basic_string.md +++ b/reference/string/basic_string.md @@ -117,8 +117,11 @@ namespace std { | [`operator+=`](basic_string/op_plus_assign.md) | 文字/文字列を追加する | | | [`append`](basic_string/append.md) | 文字/文字列を追加する | | | [`push_back`](basic_string/push_back.md) | 末尾に要素を追加する | | +| [`append_range`](basic_string/append_range.md) | Rangeの要素を末尾へ追加する | C++23 | | [`assign`](basic_string/assign.md) | 文字列の再代入 | | +| [`assign_range`](basic_string/assign_range.md) | Rangeの要素を再代入 | C++23 | | [`insert`](basic_string/insert.md) | 文字/文字列を挿入する | | +| [`insert_range`](basic_string/insert_range.md) | Rangeの要素を挿入する | C++23 | | [`erase`](basic_string/erase.md) | 要素を削除する | | | [`pop_back`](basic_string/pop_back.md) | 末尾の1要素を削除する | C++11 | | [`replace`](basic_string/replace.md) | 文字列の一部を置換する | | diff --git a/reference/string/basic_string/append_range.md b/reference/string/basic_string/append_range.md new file mode 100644 index 0000000000..63f3b79794 --- /dev/null +++ b/reference/string/basic_string/append_range.md @@ -0,0 +1,49 @@ +# append_range +* string[meta header] +* std[meta namespace] +* basic_string[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +template R> +constexpr void append_range(R&& rg); // C++23 +``` + +## 概要 +Rangeの要素を末尾へ追加する。 + + +## 効果 +[`append`](append.md)`(basic_string(`[`from_range`](../../ranges/from_range_t.md)`, `[`forward`](../../utility/forward.md)`(rg), `[`get_allocator()`](get_allocator.md)`));` + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::string s = "str"; + const char a[3] = {'i', 'n', 'g'}; + + // Rangeを末尾に追加 + s.append_range(a); + + std::cout << s << std::endl; +} +``` +* append_range[color ff0000] + +### 出力 +``` +string +``` + + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------------------|----------------------| +| [`push_back`](push_back.md) | 末尾へ要素追加 | diff --git a/reference/string/basic_string/assign_range.md b/reference/string/basic_string/assign_range.md new file mode 100644 index 0000000000..216a6f93a1 --- /dev/null +++ b/reference/string/basic_string/assign_range.md @@ -0,0 +1,53 @@ +# assign_range +* string[meta header] +* std[meta namespace] +* basic_string[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +template R> +constexpr basic_string& assign_range(R&& rg); // C++23 +``` + +## 概要 +Rangeの各要素を再代入する。 + + +## 効果 +`return ` [`assign`](assign.md)`(basic_string(`[`from_range`](../../ranges/from_range_t.md)`, `[`forward`](../../utility/forward.md)`(rg), `[`get_allocator()`](get_allocator.md)`));` + + +## 戻り値 +`*this` + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::string s = "str"; + const char a[3] = {'i', 'n', 'g'}; + + // Rangeを再代入 + s.assign_range(a); + + std::cout << s << std::endl; +} +``` +* assign_range[color ff0000] + +### 出力 +``` +ing +``` + + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------------------|----------------------| +| [`assign`](assign.md) | コンテナの再代入 | diff --git a/reference/string/basic_string/insert_range.md b/reference/string/basic_string/insert_range.md new file mode 100644 index 0000000000..6197d501ce --- /dev/null +++ b/reference/string/basic_string/insert_range.md @@ -0,0 +1,54 @@ +# insert_range +* string[meta header] +* std[meta namespace] +* basic_string[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +template R> +constexpr iterator insert_range(const_iterator pos, R&& rg); // C++23 +``` + +## 概要 +Rangeの各要素を任意の位置に挿入する。 + + +## 効果 +`return ` [`insert`](insert.md)`(pos, basic_string(`[`from_range`](../../ranges/from_range_t.md)`, `[`forward`](../../utility/forward.md)`(rg), `[`get_allocator()`](get_allocator.md)`));` + + +## 戻り値 +挿入されたRange`rg`の最初の要素を指すイテレータ。`rg`が空の場合は`pos`。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::string s = "str"; + const char a[3] = {'i', 'n', 'g'}; + + // Rangeを1番目と2番目の要素の間に挿入 + s.insert_range(std::next(s.begin()), a); + + std::cout << s << std::endl; +} +``` +* insert_range[color ff0000] + +### 出力 +``` +singtr +``` + + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------------------|----------------------| +| [`insert`](insert.md) | 要素の挿入 | From 774a74a79b885dc153f93a2be943b4c886907cf9 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sun, 11 Aug 2024 17:07:13 +0900 Subject: [PATCH 1144/3948] add append_range, assign_range, insert_range and prepend_range to std::deque --- reference/deque/deque.md | 4 ++ reference/deque/deque/append_range.md | 65 ++++++++++++++++++++++++++ reference/deque/deque/assign_range.md | 64 +++++++++++++++++++++++++ reference/deque/deque/insert_range.md | 62 ++++++++++++++++++++++++ reference/deque/deque/prepend_range.md | 65 ++++++++++++++++++++++++++ 5 files changed, 260 insertions(+) create mode 100644 reference/deque/deque/append_range.md create mode 100644 reference/deque/deque/assign_range.md create mode 100644 reference/deque/deque/insert_range.md create mode 100644 reference/deque/deque/prepend_range.md diff --git a/reference/deque/deque.md b/reference/deque/deque.md index 466c3e65ba..bda4249d4e 100644 --- a/reference/deque/deque.md +++ b/reference/deque/deque.md @@ -48,6 +48,7 @@ namespace std { | [`(destructor)`](deque/op_destructor.md) | デストラクタ | | | [`operator=`](deque/op_assign.md) | 代入演算子 | | | [`assign`](deque/assign.md) | コンテナに値を代入する | | +| [`assign_range`](deque/assign_range.md) | コンテナにRangeの要素を代入する | C++23 | | [`get_allocator`](deque/get_allocator.md) | アロケータオブジェクトを取得する | | @@ -92,11 +93,14 @@ namespace std { | [`clear`](deque/clear.md) | 全ての要素を削除する | | | [`insert`](deque/insert.md) | 任意の位置に要素を挿入する | | | [`emplace`](deque/emplace.md) | 任意の位置に要素を直接構築で挿入する | C++11 | +| [`insert_range`](deque/insert_range.md) | 任意の位置にRangeの要素を挿入する | C++23 | | [`push_back`](deque/push_back.md) | 末尾に要素を追加する | | | [`emplace_back`](deque/emplace_back.md) | 末尾に要素を直接構築で追加する | C++11 | +| [`append_range`](deque/append_range.md) | 末尾にRangeの要素を追加する | C++23 | | [`pop_back`](deque/pop_back.md) | 末尾要素を削除する | | | [`push_front`](deque/push_front.md) | 先頭に要素を追加する | | | [`emplace_front`](deque/emplace_front.md) | 先頭に要素を直接構築で追加する | C++11 | +| [`prepend_range`](deque/prepend_range.md) | 先頭にRangeの要素を追加する | C++23 | | [`pop_front`](deque/pop_front.md) | 先頭要素を削除する | | | [`resize`](deque/resize.md) | 要素数を変更する | | | [`erase`](deque/erase.md) | 指定した要素を削除する | | diff --git a/reference/deque/deque/append_range.md b/reference/deque/deque/append_range.md new file mode 100644 index 0000000000..55c179eb6a --- /dev/null +++ b/reference/deque/deque/append_range.md @@ -0,0 +1,65 @@ +# append_range +* deque[meta header] +* std[meta namespace] +* deque[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +template R> +void append_range(R&& rg); // C++23 +``` + +## 概要 +Rangeの要素を末尾へ追加する。 + + +## テンプレートパラメータ制約 +型`T`が`*ranges::begin(rg)`から`deque`コンテナへの`EmplaceConstructible`であること。 + + +## 効果 +Range`rg`の各要素を、末尾に追加する。 + + +## 戻り値 +なし + + +## 計算量 +`N =` [`ranges::distance`](../../iterator/ranges_distance.md)`(rg)`とすると、`N`に比例。Tのコンストラクタは`N`回呼ばれる。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::deque d = {1, 2, 3}; + const int a[3] = {4, 5, 6}; + + // Rangeを末尾に追加 + d.append_range(a); + + for (int i : d) { + std::cout << i << " "; + } + std::cout << std::endl; +} +``` +* append_range[color ff0000] + +### 出力 +``` +1 2 3 4 5 6 +``` + + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------------------|----------------------| +| [`push_back`](push_back.md) | 末尾に要素を追加する | +| [`emplace_back`](emplace_back.md) | 末尾に要素を直接構築で追加する | diff --git a/reference/deque/deque/assign_range.md b/reference/deque/deque/assign_range.md new file mode 100644 index 0000000000..195f38acd1 --- /dev/null +++ b/reference/deque/deque/assign_range.md @@ -0,0 +1,64 @@ +# assign_range +* deque[meta header] +* std[meta namespace] +* deque[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +template R> +void assign_range(R&& rg); // C++23 +``` + +## 概要 +Rangeの各要素を再代入する。 + + +## 事前条件 +`*this` の要素の範囲と Range`rg` の要素の範囲が重複していないこと + + +## テンプレートパラメータ制約 +型`T`が`*ranges::begin(rg)`から`deque`コンテナへの`EmplaceConstructible`であること。 + + +## 効果 +Range`rg`の各要素を、再代入する。 + + +## 戻り値 +なし + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::deque d = {1, 2, 3}; + const int a[3] = {4, 5, 6}; + + // Rangeを再代入 + d.assign_range(a); + + for (int i : d) { + std::cout << i << " "; + } + std::cout << std::endl; +} +``` +* assign_range[color ff0000] + +### 出力 +``` +4 5 6 +``` + + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------------------|----------------------| +| [`assign`](assign.md) | コンテナに値を代入する | diff --git a/reference/deque/deque/insert_range.md b/reference/deque/deque/insert_range.md new file mode 100644 index 0000000000..71de3fc2d0 --- /dev/null +++ b/reference/deque/deque/insert_range.md @@ -0,0 +1,62 @@ +# insert_range +* deque[meta header] +* std[meta namespace] +* deque[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +template R> +iterator insert_range(const_iterator pos, R&& rg); // C++23 +``` + +## 概要 +Rangeの各要素を任意の位置に挿入する。 + + +## テンプレートパラメータ制約 +型`T`が`*ranges::begin(rg)`から`deque`コンテナへの`EmplaceConstructible`であり、かつ型`T`が`MoveConstructible`・`MoveAssignable`・`Swappable`であること。 + + +## 効果 +Range`rg`の各要素を、`pos`の直前に挿入する。 + + +## 戻り値 +挿入されたRange`rg`の最初の要素を指すイテレータ。`rg`が空の場合は`pos`。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::deque d = {1, 2, 3}; + const int a[3] = {4, 5, 6}; + + // Rangeを1番目と2番目の要素の間に挿入 + d.insert_range(std::next(d.begin()), a); + + for (int i : d) { + std::cout << i << " "; + } + std::cout << std::endl; +} +``` +* insert_range[color ff0000] + +### 出力 +``` +1 4 5 6 2 3 +``` + + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------------------|----------------------| +| [`insert`](insert.md) | 任意の位置に要素を挿入する | +| [`emplace`](emplace.md) | 任意の位置に要素を直接構築で挿入する | diff --git a/reference/deque/deque/prepend_range.md b/reference/deque/deque/prepend_range.md new file mode 100644 index 0000000000..a5c67622ea --- /dev/null +++ b/reference/deque/deque/prepend_range.md @@ -0,0 +1,65 @@ +# prepend_range +* deque[meta header] +* std[meta namespace] +* deque[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +template R> +void prepend_range(R&& rg); // C++23 +``` + +## 概要 +先頭にRangeの要素を追加する。 + + +## テンプレートパラメータ制約 +型`T`が`*ranges::begin(rg)`から`deque`コンテナへの`EmplaceConstructible`であること。 + + +## 効果 +Range`rg`の各要素を、先頭に追加する。 + + +## 戻り値 +なし + + +## 計算量 +`N =` [`ranges::distance`](../../iterator/ranges_distance.md)`(rg)`とすると、`N`に比例。Tのコンストラクタは`N`回呼ばれる。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::deque d = {1, 2, 3}; + const int a[3] = {4, 5, 6}; + + // Rangeを先頭に追加 + d.prepend_range(a); + + for (int i : d) { + std::cout << i << " "; + } + std::cout << std::endl; +} +``` +* prepend_range[color ff0000] + +### 出力 +``` +4 5 6 1 2 3 +``` + + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------------------|----------------------| +| [`push_front`](push_front.md) | 先頭に要素を追加する | +| [`emplace_front`](emplace_front.md) | 先頭に要素を直接構築で追加する | From 1a35e93266f3576c084fc9b57381139f3820a3cd Mon Sep 17 00:00:00 2001 From: suomesta Date: Sun, 11 Aug 2024 17:08:58 +0900 Subject: [PATCH 1145/3948] add append_range, assign_range, insert_range and prepend_range to std::list --- reference/list/list.md | 4 ++ reference/list/list/append_range.md | 65 ++++++++++++++++++++++++++++ reference/list/list/assign_range.md | 64 +++++++++++++++++++++++++++ reference/list/list/insert_range.md | 62 ++++++++++++++++++++++++++ reference/list/list/prepend_range.md | 65 ++++++++++++++++++++++++++++ 5 files changed, 260 insertions(+) create mode 100644 reference/list/list/append_range.md create mode 100644 reference/list/list/assign_range.md create mode 100644 reference/list/list/insert_range.md create mode 100644 reference/list/list/prepend_range.md diff --git a/reference/list/list.md b/reference/list/list.md index 1dd285426b..947414504e 100644 --- a/reference/list/list.md +++ b/reference/list/list.md @@ -37,6 +37,7 @@ namespace std { | [`(destructor)`](list/op_destructor.md) | デストラクタ | | | [`operator=`](list/op_assign.md) | 代入演算子 | | | [`assign`](list/assign.md) | コンテナの再代入 | | +| [`assign_range`](list/assign_range.md) | Rangeの要素を再代入 | C++23 | ### イテレータ @@ -77,10 +78,13 @@ namespace std { |-----------------|--------------------------------|-------| | [`push_front`](list/push_front.md) | 先頭に要素を追加する | | | [`emplace_front`](list/emplace_front.md) | 先頭への直接構築による要素追加 | C++11 | +| [`prepend_range`](list/prepend_range.md) | 先頭にRangeの要素を追加する | C++23 | | [`push_back`](list/push_back.md) | 末尾に要素を追加する | | | [`emplace_back`](list/emplace_back.md) | 末尾への直接構築による要素追加 | C++11 | +| [`append_range`](list/append_range.md) | 末尾にRangeの要素を追加する | C++23 | | [`insert`](list/insert.md) | 要素の挿入 | | | [`emplace`](list/emplace.md) | 要素の直接構築による挿入 | C++11 | +| [`insert_range`](list/insert_range.md) | 任意の位置にRangeの要素を挿入する | C++23 | | [`pop_front`](list/pop_front.md) | 先頭から要素を削除 | | | [`pop_back`](list/pop_back.md) | 末尾から要素を削除 | | | [`erase`](list/erase.md) | 要素の削除 | | diff --git a/reference/list/list/append_range.md b/reference/list/list/append_range.md new file mode 100644 index 0000000000..9fd2512697 --- /dev/null +++ b/reference/list/list/append_range.md @@ -0,0 +1,65 @@ +# append_range +* list[meta header] +* std[meta namespace] +* list[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +template R> +void append_range(R&& rg); // C++23 +``` + +## 概要 +Rangeの要素を末尾へ追加する。 + + +## テンプレートパラメータ制約 +型`T`が`*ranges::begin(rg)`から`list`コンテナへの`EmplaceConstructible`であること。 + + +## 効果 +Range`rg`の各要素を、末尾に追加する。 + + +## 戻り値 +なし + + +## 計算量 +`N =` [`ranges::distance`](../../iterator/ranges_distance.md)`(rg)`とすると、`N`に比例。Tのコンストラクタは`N`回呼ばれる。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::list lst = {1, 2, 3}; + const int a[3] = {4, 5, 6}; + + // Rangeを末尾に追加 + lst.append_range(a); + + for (int i : lst) { + std::cout << i << " "; + } + std::cout << std::endl; +} +``` +* append_range[color ff0000] + +### 出力 +``` +1 2 3 4 5 6 +``` + + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------------------|----------------------| +| [`push_back`](push_back.md) | 末尾に要素を追加する | +| [`emplace_back`](emplace_back.md) | 末尾に要素を直接構築で追加する | diff --git a/reference/list/list/assign_range.md b/reference/list/list/assign_range.md new file mode 100644 index 0000000000..6a73d61c4d --- /dev/null +++ b/reference/list/list/assign_range.md @@ -0,0 +1,64 @@ +# assign_range +* list[meta header] +* std[meta namespace] +* list[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +template R> +void assign_range(R&& rg); // C++23 +``` + +## 概要 +Rangeの各要素を再代入する。 + + +## 事前条件 +`*this` の要素の範囲と Range`rg` の要素の範囲が重複していないこと + + +## テンプレートパラメータ制約 +型`T`が`*ranges::begin(rg)`から`list`コンテナへの`EmplaceConstructible`であること。 + + +## 効果 +Range`rg`の各要素を、再代入する。 + + +## 戻り値 +なし + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::list lst = {1, 2, 3}; + const int a[3] = {4, 5, 6}; + + // Rangeを再代入 + lst.assign_range(a); + + for (int i : lst) { + std::cout << i << " "; + } + std::cout << std::endl; +} +``` +* assign_range[color ff0000] + +### 出力 +``` +4 5 6 +``` + + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------------------|----------------------| +| [`assign`](assign.md) | コンテナに値を代入する | diff --git a/reference/list/list/insert_range.md b/reference/list/list/insert_range.md new file mode 100644 index 0000000000..9e8f272a6e --- /dev/null +++ b/reference/list/list/insert_range.md @@ -0,0 +1,62 @@ +# insert_range +* list[meta header] +* std[meta namespace] +* list[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +template R> +iterator insert_range(const_iterator pos, R&& rg); // C++23 +``` + +## 概要 +Rangeの各要素を任意の位置に挿入する。 + + +## テンプレートパラメータ制約 +型`T`が`*ranges::begin(rg)`から`list`コンテナへの`EmplaceConstructible`であること。 + + +## 効果 +Range`rg`の各要素を、`pos`の直前に挿入する。 + + +## 戻り値 +挿入されたRange`rg`の最初の要素を指すイテレータ。`rg`が空の場合は`pos`。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::list lst = {1, 2, 3}; + const int a[3] = {4, 5, 6}; + + // Rangeを1番目と2番目の要素の間に挿入 + lst.insert_range(std::next(lst.begin()), a); + + for (int i : lst) { + std::cout << i << " "; + } + std::cout << std::endl; +} +``` +* insert_range[color ff0000] + +### 出力 +``` +1 4 5 6 2 3 +``` + + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------------------|----------------------| +| [`insert`](insert.md) | 任意の位置に要素を挿入する | +| [`emplace`](emplace.md) | 任意の位置に要素を直接構築で挿入する | diff --git a/reference/list/list/prepend_range.md b/reference/list/list/prepend_range.md new file mode 100644 index 0000000000..6dca97b946 --- /dev/null +++ b/reference/list/list/prepend_range.md @@ -0,0 +1,65 @@ +# prepend_range +* list[meta header] +* std[meta namespace] +* list[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +template R> +void prepend_range(R&& rg); // C++23 +``` + +## 概要 +先頭にRangeの要素を追加する。 + + +## テンプレートパラメータ制約 +型`T`が`*ranges::begin(rg)`から`list`コンテナへの`EmplaceConstructible`であること。 + + +## 効果 +Range`rg`の各要素を、先頭に追加する。 + + +## 戻り値 +なし + + +## 計算量 +`N =` [`ranges::distance`](../../iterator/ranges_distance.md)`(rg)`とすると、`N`に比例。Tのコンストラクタは`N`回呼ばれる。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::list lst = {1, 2, 3}; + const int a[3] = {4, 5, 6}; + + // Rangeを先頭に追加 + lst.prepend_range(a); + + for (int i : lst) { + std::cout << i << " "; + } + std::cout << std::endl; +} +``` +* prepend_range[color ff0000] + +### 出力 +``` +4 5 6 1 2 3 +``` + + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------------------|----------------------| +| [`push_front`](push_front.md) | 先頭に要素を追加する | +| [`emplace_front`](emplace_front.md) | 先頭に要素を直接構築で追加する | From d3eeb80c76c6cceb1e5b3ddef1a21e658ba14a3a Mon Sep 17 00:00:00 2001 From: suomesta Date: Sun, 11 Aug 2024 17:10:13 +0900 Subject: [PATCH 1146/3948] add assign_range, insert_range_after and prepend_range to std::forward_list --- reference/forward_list/forward_list.md | 3 + .../forward_list/forward_list/assign_range.md | 64 +++++++++++++++++++ .../forward_list/insert_range_after.md | 61 ++++++++++++++++++ .../forward_list/prepend_range.md | 57 +++++++++++++++++ 4 files changed, 185 insertions(+) create mode 100644 reference/forward_list/forward_list/assign_range.md create mode 100644 reference/forward_list/forward_list/insert_range_after.md create mode 100644 reference/forward_list/forward_list/prepend_range.md diff --git a/reference/forward_list/forward_list.md b/reference/forward_list/forward_list.md index e89a102a91..097248912e 100644 --- a/reference/forward_list/forward_list.md +++ b/reference/forward_list/forward_list.md @@ -48,6 +48,7 @@ namespace std { | [`(destructor)`](forward_list/op_destructor.md) | デストラクタ | C++11 | | [`operator=`](forward_list/op_assign.md) | 代入演算子 | C++11 | | [`assign`](forward_list/assign.md) | コンテナの再代入 | C++11 | +| [`assign_range`](forward_list/assign_range.md) | Rangeの要素を再代入 | C++23 | ### イテレータ @@ -83,9 +84,11 @@ namespace std { |----------------------------------------------------|--------------------------------|-------| | [`emplace_front`](forward_list/emplace_front.md) | 先頭への直接構築による要素追加 | C++11 | | [`push_front`](forward_list/push_front.md) | 先頭に要素を追加する | C++11 | +| [`prepend_range`](forward_list/prepend_range.md) | 先頭にRangeの要素を追加する | C++23 | | [`pop_front`](forward_list/pop_front.md) | 先頭から要素を削除 | C++11 | | [`emplace_after`](forward_list/emplace_after.md) | 任意の位置への直接構築による要素挿入 | C++11 | | [`insert_after`](forward_list/insert_after.md) | 任意の位置への要素挿入 | C++11 | +| [`insert_range_after`](forward_list/insert_range_after.md) | 任意の位置へRangeの要素挿入 | C++23 | | [`erase_after`](forward_list/erase_after.md) | 指定したイテレータの次の要素を削除する | C++11 | | [`swap`](forward_list/swap.md) | コンテナの交換 | C++11 | | [`resize`](forward_list/resize.md) | 要素数を変更する | C++11 | diff --git a/reference/forward_list/forward_list/assign_range.md b/reference/forward_list/forward_list/assign_range.md new file mode 100644 index 0000000000..bebec79a9c --- /dev/null +++ b/reference/forward_list/forward_list/assign_range.md @@ -0,0 +1,64 @@ +# assign_range +* forward_list[meta header] +* std[meta namespace] +* forward_list[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +template R> +void assign_range(R&& rg); // C++23 +``` + +## 概要 +Rangeの各要素を再代入する。 + + +## 事前条件 +`*this` の要素の範囲と Range`rg` の要素の範囲が重複していないこと + + +## テンプレートパラメータ制約 +型`T`が`*ranges::begin(rg)`から`forward_list`コンテナへの`EmplaceConstructible`であること。 + + +## 効果 +Range`rg`の各要素を、再代入する。 + + +## 戻り値 +なし + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::forward_list fl = {1, 2, 3}; + const int a[3] = {4, 5, 6}; + + // Rangeを再代入 + fl.assign_range(a); + + for (int i : fl) { + std::cout << i << " "; + } + std::cout << std::endl; +} +``` +* assign_range[color ff0000] + +### 出力 +``` +4 5 6 +``` + + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------------------|----------------------| +| [`assign`](assign.md) | コンテナに値を代入する | diff --git a/reference/forward_list/forward_list/insert_range_after.md b/reference/forward_list/forward_list/insert_range_after.md new file mode 100644 index 0000000000..150f9b3c16 --- /dev/null +++ b/reference/forward_list/forward_list/insert_range_after.md @@ -0,0 +1,61 @@ +# insert_range_after +* forward_list[meta header] +* std[meta namespace] +* forward_list[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +template R> +iterator insert_range_after(const_iterator pos, R&& rg); // C++23 +``` + +## 概要 +Rangeの各要素を任意の位置に挿入する。 + + +## テンプレートパラメータ制約 +型`T`が`*ranges::begin(rg)`から`forward_list`コンテナへの`EmplaceConstructible`であること。 + + +## 効果 +Range`rg`の各要素を、`pos`の直後に挿入する。 + + +## 戻り値 +挿入されたRange`rg`の最後の要素を指すイテレータ。`rg`が空の場合は`pos`。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::forward_list fl = {1, 2, 3}; + const int a[3] = {4, 5, 6}; + + // Rangeを1番目の直後に挿入 + fl.insert_range_after(fl.begin(), a); + + for (int i : fl) { + std::cout << i << " "; + } + std::cout << std::endl; +} +``` +* insert_range_after[color ff0000] + +### 出力 +``` +1 4 5 6 2 3 +``` + + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------------------|----------------------| +| [`insert_after`](insert_after.md) | 任意の位置への要素挿入 | +| [`emplace_after`](emplace_after.md) | 任意の位置への直接構築による要素挿入 | diff --git a/reference/forward_list/forward_list/prepend_range.md b/reference/forward_list/forward_list/prepend_range.md new file mode 100644 index 0000000000..9f714fb704 --- /dev/null +++ b/reference/forward_list/forward_list/prepend_range.md @@ -0,0 +1,57 @@ +# prepend_range +* forward_list[meta header] +* std[meta namespace] +* forward_list[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +template R> +void prepend_range(R&& rg); // C++23 +``` + +## 概要 +先頭にRangeの要素を追加する。 + + +## テンプレートパラメータ制約 +型`T`が`*ranges::begin(rg)`から`forward_list`コンテナへの`EmplaceConstructible`であること。 + + +## 戻り値 +なし + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::forward_list fl = {1, 2, 3}; + const int a[3] = {4, 5, 6}; + + // Rangeを先頭に追加 + fl.prepend_range(a); + + for (int i : fl) { + std::cout << i << " "; + } + std::cout << std::endl; +} +``` +* prepend_range[color ff0000] + +### 出力 +``` +4 5 6 1 2 3 +``` + + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------------------|----------------------| +| [`push_front`](push_front.md) | 先頭に要素を追加する | +| [`emplace_front`](emplace_front.md) | 先頭に要素を直接構築で追加する | From 0059bf7fa22fbbd9183422c61cbe4d226ecad9bb Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Mon, 12 Aug 2024 00:43:27 +0900 Subject: [PATCH 1147/3948] =?UTF-8?q?maybe-const=E3=81=AE=E8=A7=A3?= =?UTF-8?q?=E8=AA=AC=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 3 +++ reference/exposition-only.md | 1 + reference/ranges/maybe-const.md | 22 ++++++++++++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 reference/ranges/maybe-const.md diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index eef22c8dca..e65f4921da 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -77,6 +77,7 @@ * [link /reference/complex.md] * [link /reference/concepts.md] * common_reference_with[link /reference/concepts/common_reference_with.md] + * common_type_t[link /reference/concepts/common_type.md] * common_with[link /reference/concepts/common_with.md] * copy_constructible[link /reference/concepts/copy_constructible.md] * invocable[link /reference/concepts/invocable.md] @@ -198,6 +199,7 @@ * forward_range[link /reference/ranges/forward_range.md] * input_range[link /reference/ranges/input_range.md] * iterator_t[link /reference/ranges/iterator_t.md] + * maybe-const[link /reference/ranges/maybe-const.md] * output_range[link /reference/ranges/output_range.md] * random_access_range[link /reference/ranges/random_access_range.md] * range_difference_t[link /reference/ranges/range_difference_t.md] @@ -262,6 +264,7 @@ * std::tuple[link /reference/tuple/tuple.md] * std::tie[link /reference/tuple/tie.md] * [link /reference/type_traits.md] + * common_reference_t[link /reference/type_traits/common_reference.md] * invoke_result_t[link /reference/type_traits/invoke_result.md] * is_class_v[link /reference/type_traits/is_class.md] * is_object_v[link /reference/type_traits/is_object.md] diff --git a/reference/exposition-only.md b/reference/exposition-only.md index bfa5938368..5a10618d67 100644 --- a/reference/exposition-only.md +++ b/reference/exposition-only.md @@ -48,6 +48,7 @@ | [`uses-nonqualification-pointer-conversion`](ranges/subrange/uses-nonqualification-pointer-conversion.md) | 直接変換できない型同士のポインタの変換が必要かどうかを表す (concept) | C++20 | | [`convertible-to-non-slicing`](ranges/subrange/convertible-to-non-slicing.md) | スライシングを起こさずに変換できるかどうかを表す (concept) | C++20 | | [`pair-like-convertible-from`](ranges/subrange/pair-like-convertible-from.md) | ある2つの型から構築出来る[`pair-like`](tuple/pair-like.md)な型を表す (concept) | C++20 | +| [`maybe-const`](ranges/maybe-const.md) | bool値に応じて`const`修飾を付加する (alias template) | C++23 | ## `` diff --git a/reference/ranges/maybe-const.md b/reference/ranges/maybe-const.md new file mode 100644 index 0000000000..1acc3a80c5 --- /dev/null +++ b/reference/ranges/maybe-const.md @@ -0,0 +1,22 @@ +# maybe-const +* ranges[meta header] +* type-alias[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template + using maybe-const = conditional_t; +} +``` + +## 概要 + +`maybe-const` は、bool値`Const`が`true`のとき `const T`、`false`のとき`T`となる説明専用の型エイリアスである。 + +## バージョン +### 言語 +- C++23 + +## 参照 +- [N4950 26 Ranges library](https://timsong-cpp.github.io/cppwp/n4950/ranges) From 3602f00bb6d438a2a590bff69182478f75d1ec8c Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Mon, 12 Aug 2024 01:20:31 +0900 Subject: [PATCH 1148/3948] =?UTF-8?q?Range=20adaptor=20helpers=E3=81=AE?= =?UTF-8?q?=E8=AA=AC=E6=98=8E=E5=B0=82=E7=94=A8=E3=83=A9=E3=82=A4=E3=83=96?= =?UTF-8?q?=E3=83=A9=E3=83=AA=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/exposition-only.md | 8 +++++++- reference/ranges/all-bidirectional.md | 22 ++++++++++++++++++++++ reference/ranges/all-forward.md | 22 ++++++++++++++++++++++ reference/ranges/all-random-access.md | 22 ++++++++++++++++++++++ reference/ranges/as-lvalue.md | 24 ++++++++++++++++++++++++ reference/ranges/tuple-for-each.md | 26 ++++++++++++++++++++++++++ reference/ranges/tuple-transform.md | 26 ++++++++++++++++++++++++++ 7 files changed, 149 insertions(+), 1 deletion(-) create mode 100644 reference/ranges/all-bidirectional.md create mode 100644 reference/ranges/all-forward.md create mode 100644 reference/ranges/all-random-access.md create mode 100644 reference/ranges/as-lvalue.md create mode 100644 reference/ranges/tuple-for-each.md create mode 100644 reference/ranges/tuple-transform.md diff --git a/reference/exposition-only.md b/reference/exposition-only.md index 5a10618d67..c1b75593a1 100644 --- a/reference/exposition-only.md +++ b/reference/exposition-only.md @@ -48,7 +48,13 @@ | [`uses-nonqualification-pointer-conversion`](ranges/subrange/uses-nonqualification-pointer-conversion.md) | 直接変換できない型同士のポインタの変換が必要かどうかを表す (concept) | C++20 | | [`convertible-to-non-slicing`](ranges/subrange/convertible-to-non-slicing.md) | スライシングを起こさずに変換できるかどうかを表す (concept) | C++20 | | [`pair-like-convertible-from`](ranges/subrange/pair-like-convertible-from.md) | ある2つの型から構築出来る[`pair-like`](tuple/pair-like.md)な型を表す (concept) | C++20 | -| [`maybe-const`](ranges/maybe-const.md) | bool値に応じて`const`修飾を付加する (alias template) | C++23 | +| [`maybe-const`](ranges/maybe-const.md) | bool値に応じて`const`修飾を付加する (alias template) | C++23 | +| [`tuple-transform`](ranges/tuple-transform.md) | [`tuple`](tuple/tuple.md)の各要素に関数を適用した[`tuple`](tuple/tuple.md)を生成する (function template) | C++23 | +| [`tuple-for-each`](ranges/tuple-for-each.md) | [`tuple`](tuple/tuple.md)の各要素に関数を適用する (function template) | C++23 | +| [`as-lvalue`](ranges/as-lvalue.md) | rvalueをlvalueへキャストする (function template) | C++23 | +| [`all-random-access`](ranges/all-random-access.md) | すべてのビューが[`random_access_range`](ranges/random_access_range.md)であるかを表す (concept) | C++26 | +| [`all-bidirectional`](ranges/all-bidirectional.md) | すべてのビューが[`bidirectional_range`](ranges/bidirectional_range.md)であるかを表す (concept) | C++26 | +| [`all-forward`](ranges/all-forward.md) | すべてのビューが[`forward_range`](ranges/forward_range.md)であるかを表す (concept) | C++26 | ## `` diff --git a/reference/ranges/all-bidirectional.md b/reference/ranges/all-bidirectional.md new file mode 100644 index 0000000000..488437f491 --- /dev/null +++ b/reference/ranges/all-bidirectional.md @@ -0,0 +1,22 @@ +# all-bidirectional +* ranges[meta header] +* concept[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std::ranges { + template + concept all-bidirectional = (bidirectional_range> && ...); +} +``` + +## 概要 + +`all-bidirectional` は、複数のビューに対し、それらすべてが [`bidirectional_range`](bidirectional_range.md) であることを表すコンセプトである。 + +## バージョン +### 言語 +- C++26 + +## 参照 +- [26.7.5 Range adaptor helpers](https://eel.is/c++draft/range.adaptor.helpers) diff --git a/reference/ranges/all-forward.md b/reference/ranges/all-forward.md new file mode 100644 index 0000000000..549ecd75c6 --- /dev/null +++ b/reference/ranges/all-forward.md @@ -0,0 +1,22 @@ +# all-forward +* ranges[meta header] +* concept[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std::ranges { + template + concept all-forward = (forward_range> && ...); +} +``` + +## 概要 + +`all-forward` は、複数のビューに対し、それらすべてが [`forward_range`](forward_range.md) であることを表すコンセプトである。 + +## バージョン +### 言語 +- C++26 + +## 参照 +- [26.7.5 Range adaptor helpers](https://eel.is/c++draft/range.adaptor.helpers) diff --git a/reference/ranges/all-random-access.md b/reference/ranges/all-random-access.md new file mode 100644 index 0000000000..2751fd6d4f --- /dev/null +++ b/reference/ranges/all-random-access.md @@ -0,0 +1,22 @@ +# all-random-access +* ranges[meta header] +* concept[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std::ranges { + template + concept all-random-access = (random_access_range> && ...); +} +``` + +## 概要 + +`all-random-access` は、複数のビューに対し、それらすべてが [`random_access_range`](random_access_range.md) であることを表すコンセプトである。 + +## バージョン +### 言語 +- C++26 + +## 参照 +- [26.7.5 Range adaptor helpers](https://eel.is/c++draft/range.adaptor.helpers) diff --git a/reference/ranges/as-lvalue.md b/reference/ranges/as-lvalue.md new file mode 100644 index 0000000000..380efc8dc0 --- /dev/null +++ b/reference/ranges/as-lvalue.md @@ -0,0 +1,24 @@ +# as-lvalue +* ranges[meta header] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template + constexpr T& as-lvalue(T&& t) { + return static_cast(t); + } +} +``` + +## 概要 + +`as-lvalue` は、rvalueをlvalueへキャストする説明専用の関数である。 + +## バージョン +### 言語 +- C++23 + +## 参照 +- [N4950 26 Ranges library](https://timsong-cpp.github.io/cppwp/n4950/ranges) diff --git a/reference/ranges/tuple-for-each.md b/reference/ranges/tuple-for-each.md new file mode 100644 index 0000000000..f4e570ca4e --- /dev/null +++ b/reference/ranges/tuple-for-each.md @@ -0,0 +1,26 @@ +# tuple-for-each +* ranges[meta header] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template + constexpr void tuple-for-each(F&& f, Tuple&& t) { + apply([&](Ts&&... elements) { + (static_cast(invoke(f, std::forward(elements))), ...); + }, std::forward(t)); + } +} +``` + +## 概要 + +`tuple-for-each` は、[`tuple`](/reference/tuple/tuple.md)の各要素に対して関数を適用する説明専用の関数テンプレートである。 + +## バージョン +### 言語 +- C++23 + +## 参照 +- [N4950 26 Ranges library](https://timsong-cpp.github.io/cppwp/n4950/ranges) diff --git a/reference/ranges/tuple-transform.md b/reference/ranges/tuple-transform.md new file mode 100644 index 0000000000..b8c00a3c27 --- /dev/null +++ b/reference/ranges/tuple-transform.md @@ -0,0 +1,26 @@ +# tuple-transform +* ranges[meta header] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template + constexpr auto tuple-transform(F&& f, Tuple&& t) { + return apply([&](Ts&&... elements) { + return tuple...>(invoke(f, std::forward(elements))...); + }, std::forward(t)); + } +} +``` + +## 概要 + +`tuple-transform` は、[`tuple`](/reference/tuple/tuple.md)の各要素に対して関数を適用し、それらの結果を要素とする[`tuple`](/reference/tuple/tuple.md)を生成する説明専用の関数テンプレートである。 + +## バージョン +### 言語 +- C++23 + +## 参照 +- [N4950 26 Ranges library](https://timsong-cpp.github.io/cppwp/n4950/ranges) From 2f09aa89d5fa16e52432c6f0376c2ae40afb6da1 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Mon, 12 Aug 2024 01:53:40 +0900 Subject: [PATCH 1149/3948] =?UTF-8?q?concat=5Fview=E3=81=AE=E8=A7=A3?= =?UTF-8?q?=E8=AA=AC=E3=82=92=E8=BF=BD=E5=8A=A0=20#1337?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 2 +- reference/ranges.md | 7 ++ reference/ranges/concat_view.md | 165 ++++++++++++++++++++++++++++++++ 3 files changed, 173 insertions(+), 1 deletion(-) create mode 100644 reference/ranges/concat_view.md diff --git a/lang/cpp26.md b/lang/cpp26.md index 69f9811686..e3c38bfd10 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -123,7 +123,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [`std::unordered_multiset`](/reference/unordered_set/unordered_multiset.md) - [`bucket()`](/reference/unordered_set/unordered_multiset/bucket.md) - [`std::span`](/reference/span/span.md)と[`std::mdspan`](/reference/mdspan/mdspan.md)の推論補助を改善 -- [`std::views::concat`](/reference/ranges/concat_view.md.nolink)を追加 +- [`std::views::concat`](/reference/ranges/concat_view.md)を追加 ### アルゴリズム diff --git a/reference/ranges.md b/reference/ranges.md index 7cedda936f..2b5d9e6c77 100644 --- a/reference/ranges.md +++ b/reference/ranges.md @@ -308,6 +308,13 @@ range | adaptor(args...) | [`split_view`](ranges/split_view.md) | 文字列分割に特化した`lazy_split_view` (class template) | C++20 | | [`views::split`](ranges/split_view.md) | `split_view`を生成する (customization point object) | C++20 | +### concat view + +| 名前 | 説明 | 対応バージョン | +|-------------------------------------------------------|--------------------------------------------------------------|----------------| +| [`concat_view`](ranges/concat_view.md) | 複数のRangeを連結するビュー (class template) | C++26 | +| [`views::concat`](ranges/concat_view.md) | `concat_view`を生成する (customization point object) | C++26 | + ### counted view | 名前 | 説明 | 対応バージョン | diff --git a/reference/ranges/concat_view.md b/reference/ranges/concat_view.md new file mode 100644 index 0000000000..769dd0c113 --- /dev/null +++ b/reference/ranges/concat_view.md @@ -0,0 +1,165 @@ +# concat_view +* ranges[meta header] +* std::ranges[meta namespace] +* class template[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std::ranges { + template + requires (view && ...) && (sizeof...(Views) > 0) && concatable + class concat_view : public view_interface> {…… }; // (1) + + namespace views { + inline constexpr /*unspecified*/ concat = /*unspecified*/; // (2) + } +} +``` + +## 概要 + +`concat_view`は複数のRangeを連結し、1つのRangeとする[`view`](view.md)。 + +- (1): `concat_view`のクラス定義 +- (2): `concat_view`を生成するカスタマイゼーションポイントオブジェクト(Rangeアダプタオブジェクトではない) + +### Rangeコンセプト + +| borrowed | sized | output | input | forward | bidirectional | random_access | contiguous | common | viewable | view | +|----------|-------|--------|-------|---------|---------------|---------------|------------|--------|----------|------| +| | (1) | 〇 | 〇 | (2) | (3) | (4) | | (5) | ○ | ○ | + +- (1): 連結するすべてのRangeが[`sized_range`](sized_range.md)のとき +- (2): 連結するすべてのRangeが[`forward_range`](forward_range.md)のとき +- (3): 連結するすべてのRangeが[`bidirectional_range`](bidirectional_range.md)であり、少なくとも最後のRange以外が[`common_range`](common_range.md)のとき +- (4): 連結するすべてのRangeが[`random_access_range`](random_access_range.md)であり、少なくとも最後のRange以外が[`common_range`](common_range.md)のとき +- (5): 最後のRangeが[`common_range`](common_range.md)のとき + +## テンプレートパラメータ制約 + +連結するすべてのビューに対して、 + +- それらの要素に共通の値型`Cv`、参照型`Cr`、右辺値参照型`Crr` が存在し、 +- `Cr&&`と`Cv&`、`Cr&&`と`Crr&&`、`Crr&&`と`Cv const&`にそれぞれ共通の参照型があり、 +- 連結するすべてのビューのイテレーター`it`について、 + - `*it`が`Cr`に変換可能であり、 + - `ranges::iter_move(it)`が`Crr`に変換可能であること。 + +## 効果 + +- (2): 式`views::concat(Es...)`の効果は次の通り + - `Es...`が1要素で、その型が [`input_range`](input_range.md)のモデルであるとき、[`views::all`](all.md)`(Es...)` と等しい + - それ以外のとき、`concat_view(Es...)` と等しい + +## 備考 + +本説明に用いる説明専用要素を以下のように定義する。 + +```cpp +namespace std::ranges { + template + using concat-reference-t = common_reference_t...>; + + template + using concat-value-t = common_type_t...>; + + template + using concat-rvalue-reference-t = common_reference_t...>; + + template + concept concat-indirectly-readable-impl = + requires (const It it) { + { *it } -> convertible_to; + { ranges::iter_move(it) } -> convertible_to; + }; + + template + concept concat-indirectly-readable = + common_reference_with&&, concat-value-t&> && + common_reference_with&&, concat-rvalue-reference-t&&> && + common_reference_with&&, concat-value-t const&> && + (concat-indirectly-readable-impl, concat-rvalue-reference-t, iterator_t> && ...); + + template + concept concatable = requires { + typename concat-reference-t; + typename concat-value-t; + typename concat-rvalue-reference-t; + } && concat-indirectly-readable; + + // Fs を Rs の末尾を除いたパックとする + + template + concept concat-is-random-access = + all-random-access && + (common_range> && ...); + + template + concept concat-is-bidirectional = + all-bidirectional && + (common_range> && ...); +} +``` +* all-random-access[link all-random-access.md] +* all-bidirectional[link all-bidirectional.md] + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|--------------------------------------------------|----------------------------------|----------------| +| [`(constructor)`](concat_view/op_constructor.md.nolink) | コンストラクタ | C++26 | +| [`begin`](concat_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++26 | +| [`end`](concat_view/end.md.nolink) | 番兵を取得する | C++26 | +| [`size`](concat_view/size.md.nolink) | 要素数を取得する | C++26 | + +## 継承しているメンバ関数 + +| 名前 | 説明 | 対応バージョン | +|----------------------------------------------|-----------------------------------|----------------| +| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++20 | +| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++20 | +| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | +| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | +| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | + +## 推論補助 + +| 名前 | 説明 | 対応バージョン | +|-------------------------------------------------------|------------------------------|----------------| +| [`(deduction_guide)`](concat_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | + +## 例 +```cpp example +import std; + +int main() { + std::vector v1{1, 2, 3}, v2{4, 5}, v3{}; + std::array a{6, 7, 8}; + auto s = std::views::single(9); + std::print("{} ", std::views::concat(v1, v2, v3, a, s)); +} +``` +* std::views::concat[color ff0000] +* std::views::single[link single_view.md] + +### 出力 +``` +[1, 2, 3, 4, 5, 6, 7, 8, 9] +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [26.7.18 Concat view](https://timsong-cpp.github.io/cppwp/range.concat) (2024-08-10) +- [P2542R8 views::concat](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2542r8.html) From 40187a0eee96de05962febeee8dc354f4e77449c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B9=85=E6=88=91=E5=B1=B1=E8=8F=9C=E3=80=85?= Date: Mon, 12 Aug 2024 02:56:19 +0900 Subject: [PATCH 1150/3948] fix quote mismatch --- lang/cpp26.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp26.md b/lang/cpp26.md index e3c38bfd10..d16be2c15b 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -41,7 +41,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| -| [関数宣言を削除する理由を指定できるようにする](/lang/cpp26/delete_reason.md.nolink) | `f() = delete("reason)";` | +| [関数宣言を削除する理由を指定できるようにする](/lang/cpp26/delete_reason.md.nolink) | `f() = delete("reason");` | ### 属性 From 80dfda16c7cf7c443ffa053e9ff7af36ea4a6d1f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 12 Aug 2024 05:14:02 +0900 Subject: [PATCH 1151/3948] =?UTF-8?q?#1343=20=E3=81=A8=E5=90=8C=E6=A7=98?= =?UTF-8?q?=E3=81=AB=E3=83=80=E3=83=96=E3=83=AB=E3=82=AF=E3=82=A9=E3=83=BC?= =?UTF-8?q?=E3=83=88=E3=81=AE=E9=96=89=E3=81=98=E4=BD=8D=E7=BD=AE=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/implementation-status.md b/implementation-status.md index b37e836f48..4031a2a4a4 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -307,7 +307,7 @@ | P3034R1: [モジュール宣言でのモジュール名のマクロ展開を禁止する](/lang/cpp26/module_declarations_shouldnt_be_macros.md.nolink) | `export module MACRO_NAME;`を禁止 | | | | | | P2809R3: [自明な無限ループは未定義動作ではないと規定](/lang/cpp26/trivial_infinite_loops_are_not_undefined_behavior.md.nolink) | 並行プログラムの進行保証などを考慮して無限ループを未定義動作ではないものとする | 14 | 19 | | | | P2795R5: [未初期化変数の読み取りを不正動作 (erroneous behaviour: EB) とする](/lang/cpp26/erroneous_behaviour_for_uninitialized_reads.md.nolink) | 初期化されていない自動変数の読み取りの安全性を規定する | | | | | -| P2573R2: [関数宣言を削除する理由を指定できるようにする](/lang/cpp26/delete_reason.md.nolink) | `f() = delete("reason)";` | 15 | 19 | | | +| P2573R2: [関数宣言を削除する理由を指定できるようにする](/lang/cpp26/delete_reason.md.nolink) | `f() = delete("reason");` | 15 | 19 | | | | P2893R3: [可変引数テンプレートで`friend`宣言をできるようにする](/lang/cpp26/variadic_friends.md.nolink) | クラステンプレートの可変引数テンプレートでまとめて`friend`宣言できるようにする | 15 | | | | | P2747R2: [`constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md.nolink) | 定数式の文脈での配置`new`を許可 | | | | | | P3144R2: [不完全型へのポインタに対する`delete`を不適格とする](/lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md.nolink) | 未定義動作となる操作をコンパイルエラーとする | 15 | 19 | | | From 550076558c4c74b2d6a6ff60eeff4130d04071a9 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Wed, 14 Aug 2024 20:55:57 +0900 Subject: [PATCH 1152/3948] Update scoped_enum.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - N2347R3において、 unscoped enum にも `列挙型名::列挙子` が許可された - unscoped enum の先行宣言は、基底型が明示されている場合のみ許可されている --- lang/cpp11/scoped_enum.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lang/cpp11/scoped_enum.md b/lang/cpp11/scoped_enum.md index b404da8389..9ec42f0c8a 100644 --- a/lang/cpp11/scoped_enum.md +++ b/lang/cpp11/scoped_enum.md @@ -50,8 +50,9 @@ int color = static_cast(Color::Red); ### スコープを持つ列挙型に合わせた、enumの拡張 スコープを持つ列挙型の導入に合わせて、スコープを持たない列挙型もC++11で以下の機能拡張が行われた -- 先行宣言ができるようになった - 基底型を指定できるようになった +- 基底型が指定されている場合は、先行宣言ができるようになった +- 列挙型名をスコープとして書けるようになった (`列挙型名::列挙子`が許可された) 詳細は、上述した仕様を参照。 @@ -108,4 +109,4 @@ ECMA規格になっているC++/CLIが、現在のスコープを持つ列挙型 - [N1579 Strongly Typed Enums (revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1719.pdf) - [N2213 Strongly Typed Enums (revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2213.pdf) - [N2347 Strongly Typed Enums (revision 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf) -- [N2499 Forward declaration of enumerations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2499.pdf) \ No newline at end of file +- [N2499 Forward declaration of enumerations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2499.pdf) From c2b01394252e1020fd5338ac9decbe3878e1ede3 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Thu, 15 Aug 2024 02:57:31 +0900 Subject: [PATCH 1153/3948] =?UTF-8?q?enum=20class=E5=91=A8=E3=82=8A?= =?UTF-8?q?=E3=81=AE=E3=83=AA=E3=83=B3=E3=82=AF=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp11/scoped_enum.md | 4 +++- lang/cpp17/construction_enum_class_values.md | 8 ++++---- lang/cpp20/using_enum.md | 4 ++-- reference/new/align_val_t.md | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lang/cpp11/scoped_enum.md b/lang/cpp11/scoped_enum.md index 9ec42f0c8a..c887e9f4d2 100644 --- a/lang/cpp11/scoped_enum.md +++ b/lang/cpp11/scoped_enum.md @@ -101,7 +101,9 @@ ECMA規格になっているC++/CLIが、現在のスコープを持つ列挙型 ## 関連項目 - [`underlying_type`](/reference/type_traits/underlying_type.md) - +- [`to_underlying`](/reference/utility/to_underlying.md) +- [enum class変数の初期値として整数を指定する際の規則を調整](/lang/cpp17/construction_enum_class_values.md) +- [スコープ付き列挙型のusing宣言](/lang/cpp20/using_enum.md) ## 参照 - [N1513 Improving Enumeration Types](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1513.pdf) diff --git a/lang/cpp17/construction_enum_class_values.md b/lang/cpp17/construction_enum_class_values.md index 97f69dffcd..c6da4770b1 100644 --- a/lang/cpp17/construction_enum_class_values.md +++ b/lang/cpp17/construction_enum_class_values.md @@ -10,12 +10,12 @@ ## 概要 -C++11にてスコープを持つ列挙型が導入された。これは基底型を明示することができ、従来の列挙型と異なり整数型への暗黙の型変換を行わない。 +C++11にて[スコープを持つ列挙型](/lang/cpp11/scoped_enum.md)が導入された。これは基底型を明示することができ、従来の列挙型と異なり整数型への暗黙の型変換を行わない。 型変換を禁止する規則が厳格すぎて、初期化の際に不便が生じていたためC++17で規則が緩和された。 ## 仕様 -スコープを持つ列挙型に基底型が指定されていて、初期化リストが単一の要素`v`を持ち、かつリストによる直接の初期化であれば、初期化できる。 +[スコープを持つ列挙型](/lang/cpp11/scoped_enum.md)に基底型が指定されていて、初期化リストが単一の要素`v`を持ち、かつリストによる直接の初期化であれば、初期化できる。 ただし基底型へ変換する際に、精度を失う変換が要求される場合はプログラムは不適格となる。 @@ -91,7 +91,7 @@ construction_enum_class.cpp:22:12: error: constant expression evaluates to 1142 ``` ## この機能が必要になった背景・経緯 -ユーザ定義の整数を定義する際のテクニックとして例で挙げたように、要素を一つも持たないスコープを持つ列挙型を定義する方法がある。 +ユーザ定義の整数を定義する際のテクニックとして例で挙げたように、要素を一つも持たない[スコープを持つ列挙型](/lang/cpp11/scoped_enum.md)を定義する方法がある。 ```cpp enum class byte : unsigned char { }; @@ -101,7 +101,7 @@ enum class byte : unsigned char { }; しかしこのテクニックの欠点は`byte`型を整数で初期化する際にキャストが必要となってしまうことである。キャストを行うとプログラムが見づらいうえに、精度が失われる変換を検出できなくなる問題があった(プログラマが本当に精度を失わせたいのか、間違った値を指定しただけなのか、コンパイラには判断できない)。 -C++17ではスコープを持つ列挙型の初期化ルールを緩和し、簡潔な記述を実現するとともに、意図せず精度を失う変換を行う危険性を排除した。 +C++17では[スコープを持つ列挙型](/lang/cpp11/scoped_enum.md)の初期化ルールを緩和し、簡潔な記述を実現するとともに、意図せず精度を失う変換を行う危険性を排除した。 ## 関連項目 diff --git a/lang/cpp20/using_enum.md b/lang/cpp20/using_enum.md index 7121649931..72557915f1 100644 --- a/lang/cpp20/using_enum.md +++ b/lang/cpp20/using_enum.md @@ -43,7 +43,7 @@ std::string_view to_string(rgba_color_channel channel) { また、using宣言で列挙値を指定できるようになる。このときは、指定した列挙値だけがスコープ指定を省略できるようになる。 -対象とする列挙型はスコープを持つ列挙型でなくても構わない。 +対象とする列挙型は[スコープを持つ列挙型](/lang/cpp11/scoped_enum.md)でなくても構わない。 ```cpp example namespace ns { @@ -116,7 +116,7 @@ C言語形式の列挙型を改善するために[スコープを持つ列挙型 そこで、列挙型のスコープを名前空間と同じようなものと捉えて、using宣言によって省略できるようにした。 -これにより、C言語形式の列挙型をスコープを持つ列挙型へ置き換えるというリファクタリングをする際、(整数との暗黙変換を別とすれば)ソースコードレベルの互換性を保って置き換えることができるようにもなった。 +これにより、C言語形式の列挙型を[スコープを持つ列挙型](/lang/cpp11/scoped_enum.md)へ置き換えるというリファクタリングをする際、(整数との暗黙変換を別とすれば)ソースコードレベルの互換性を保って置き換えることができるようにもなった。 ## 関連項目 diff --git a/reference/new/align_val_t.md b/reference/new/align_val_t.md index 1a6e91c452..cf5ea1c410 100644 --- a/reference/new/align_val_t.md +++ b/reference/new/align_val_t.md @@ -12,7 +12,7 @@ namespace std { ## 概要 C++17において、動的メモリ確保時のアライメント指定がサポートされた。これは、デフォルトよりも大きなアライメントを要求するとき、`new` に渡されるアライメント値の型である。 -スコープを持つ列挙型として定義されているが、意図しない型変換を防ぐためのものなので、列挙値は定義されていない。 +[スコープを持つ列挙型](/lang/cpp11/scoped_enum.md)として定義されているが、意図しない型変換を防ぐためのものなので、列挙値は定義されていない。 ## バージョン ### 言語 From 54b813b2d3d72ab0eba76392341e6de284feb97d Mon Sep 17 00:00:00 2001 From: suomesta Date: Thu, 15 Aug 2024 13:13:14 +0900 Subject: [PATCH 1154/3948] create resize_and_overwrite.md --- lang/cpp23.md | 2 +- reference/string/basic_string.md | 1 + .../basic_string/resize_and_overwrite.md | 112 ++++++++++++++++++ 3 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 reference/string/basic_string/resize_and_overwrite.md diff --git a/lang/cpp23.md b/lang/cpp23.md index 29ff521427..f994af28f9 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -176,7 +176,7 @@ C++23とは、2023年中に改訂される予定の、C++バージョンの通 - [`std::basic_string`](/reference/string/basic_string.md)クラスと[`std::basic_string_view`](/reference/string_view/basic_string_view.md)クラスに、文字列内に指定した文字・文字列が含まれているかを判定するメンバ関数`contains()`を追加 - [`std::basic_string_view`](/reference/string_view/basic_string_view.md)のコンストラクタに、範囲をとるオーバーロードを追加 - `std::string s = nullptr;`のような文字列オブジェクトに`nullptr`を代入するようなコードはバグの元であるため、[`std::basic_string`](/reference/string/basic_string.md)と[`std::basic_string_view`](/reference/string_view/basic_string_view.md)に、[`nullptr_t`](/reference/cstddef/nullptr_t.md)をとるコンストラクタをdelete定義として追加 -- [`std::basic_string`](/reference/string/basic_string.md)クラスに、resize時に任意の初期化を行う[`resize_and_overwrite()`](/reference/string/basic_string/resize_and_overwrite.md.nolink)メンバ関数を追加 +- [`std::basic_string`](/reference/string/basic_string.md)クラスに、resize時に任意の初期化を行う[`resize_and_overwrite()`](/reference/string/basic_string/resize_and_overwrite.md)メンバ関数を追加 - [`std::basic_string`](/reference/string/basic_string.md)クラスのコンストラクタと[`substr()`](/reference/string/basic_string/substr.md)メンバ関数に一時オブジェクトのオーバーロードを追加 - [`std::format()`](/reference/format/format.md)関数でRange・コンテナ、[`std::tuple`](/reference/tuple/tuple.md)、[`std::pair`](/reference/utility/pair.md)を出力できるよう、[`std::formatter`](/reference/format/formatter.md)に特殊化を追加 - Range・シーケンスコンテナは`[1, 2, 3]`、`["hello", "world"]`、`['a', 'b', 'c']`のように出力される diff --git a/reference/string/basic_string.md b/reference/string/basic_string.md index 8f4e693d3d..ba8e94fcc0 100644 --- a/reference/string/basic_string.md +++ b/reference/string/basic_string.md @@ -93,6 +93,7 @@ namespace std { | [`length`](basic_string/length.md) | 文字列の長さを取得する | | | [`max_size`](basic_string/max_size.md) | 格納可能な最大の文字列長を取得する | | | [`resize`](basic_string/resize.md) | 文字列の長さを変更する | | +| [`resize_and_overwrite`](basic_string/resize_and_overwrite.md) | 文字列の長さの変更と併せて任意の初期化を行う | C++23 | | [`capacity`](basic_string/capacity.md) | メモリを再確保せずに格納できる最大の要素数を取得する | | | [`reserve`](basic_string/reserve.md) | `capacity`を変更する | | | [`shrink_to_fit`](basic_string/shrink_to_fit.md) | `capacity`を`size`まで縮小する | C++11 | diff --git a/reference/string/basic_string/resize_and_overwrite.md b/reference/string/basic_string/resize_and_overwrite.md new file mode 100644 index 0000000000..c5bc8f54c0 --- /dev/null +++ b/reference/string/basic_string/resize_and_overwrite.md @@ -0,0 +1,112 @@ +# resize_and_overwrite +* string[meta header] +* std[meta namespace] +* basic_string[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +template +constexpr void resize_and_overwrite(size_type n, Operation op); // C++23 +``` + +## 概要 +任意の初期化を伴って、文字列の長さを変更する。 + +本関数は、`string` にいくつかの文字列をまとめて追加・代入する際に、パフォーマンスを向上させる目的で追加された。 + + +## テンプレートパラメータ制約 +`Operation` は2つの引数と戻り値を持ち、第1引数は `charT*` or `const charT*`、第2引数は `size_type` or `const size_type`、戻り値は `integer-like` であること。 + + +## 要件 +`n <=` [`max_size()`](max_size.md) + + +## 効果 +1. 関数実行前に `[`[`data()`](data.md)`, `[`data()`](data.md)` + n)` が有効範囲でないなら、領域の確保が行われる([`reserve(n)`](reserve.md) 相当)。 +1. `std::move(op)(data(), n)` が呼ばれる。`op` 内では、`[`[`data()`](data.md)`, `[`data()`](data.md)` + n)` の範囲に対して任意の初期化を行う。`op` の戻り値を `m` とすると、`0 <= m && m < n` であること。 +1. サイズを `m` に変更する([`resize(m)`](resize.md) 相当)。 + + +## 戻り値 +なし + + +## 例外 +`n >` [`max_size()`](max_size.md) の時、[`length_error`](/reference/stdexcept.md) 例外を投げる。 + + +## 例 +```cpp example +#include +#include +#include +#include + +constexpr std::string_view sentence[9] = { + "The", "quick", "brown", "fox", "jumps", + "over", "the", "lazy", "dog" +}; +constexpr size_t BUF_SIZE = 256; + +int main() { + // reserve()を用いる例。memcpy()よりも処理の重いappend()がループ内で呼ばれる + { + std::string s; + + s.reserve(BUF_SIZE); // Good: 領域確保のみ + for (auto word : sentence) { + s.append(word); // Not good: ループの回数だけデータサイズ変更処理が行われる + } + + std::cout << s.size() << ": " << s << std::endl; + } + + // resize()を用いる例。resize()呼び出し時に(ここでは不要な)ゼロ初期化が行われる + { + std::string s; + + int pos = s.size(); + s.resize(BUF_SIZE); // Not good: ゼロ初期化が行われる + for (auto word : sentence) { + memcpy(s.data() + pos, word.data(), word.size()); // Good: データコピーのみ + pos += word.size(); + } + s.resize(pos); + + std::cout << s.size() << ": " << s << std::endl; + } + + // resize_and_overwrite()を用いる例。領域確保時のゼロ初期化がなく、ループ内ではmemcpy()呼ぶ + { + std::string s; + + s.resize_and_overwrite(BUF_SIZE, [ini_pos = s.size()](char* buf, size_t buf_size) { // Good: ゼロ初期化は行われない + int pos = ini_pos; + for (auto word : sentence) { + memcpy(buf + pos, word.data(), word.size()); // Good: データコピーのみ + pos += word.size(); + } + return pos; + }); + + std::cout << s.size() << ": " << s << std::endl; + } +} +``` +* resize_and_overwrite[color ff0000] +* resize[link resize.md] +* reserve[link reserve.md] + +### 出力 +``` +35: Thequickbrownfoxjumpsoverthelazydog +35: Thequickbrownfoxjumpsoverthelazydog +35: Thequickbrownfoxjumpsoverthelazydog +``` + +## 参照 + +- [P1072R10 basic_string::resize_and_overwrite](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1072r10.html) From 9952462de9f5f7542f570101b41bd55d10e4a595 Mon Sep 17 00:00:00 2001 From: Yuhki Ogasawara Date: Fri, 16 Aug 2024 13:42:11 +0900 Subject: [PATCH 1155/3948] Update implementation.md --- implementation.md | 1 + 1 file changed, 1 insertion(+) diff --git a/implementation.md b/implementation.md index 6dc93f5e04..d879d31393 100644 --- a/implementation.md +++ b/implementation.md @@ -141,6 +141,7 @@ | 表記 | 製品名 [Visual Studio バージョン] †1 | VC++ バージョン †2 | `_MSC_VER` | `_MSC_FULL_VER` | |---------------|----------------------------------------|-----------------|------------|-----------------| +| 2022 Update 11 | Visual Studio 2022 version 17.11.0 | 14.41 | 1941 | 194134120 | | 2022 Update 10 | Visual Studio 2022 version 17.10.5 | 14.40 | 1939 | 194033811 | | 2022 Update 9 | Visual Studio 2022 version 17.9.2 | 14.39 | 1939 | 193933521 | | 2022 Update 8 | Visual Studio 2022 version 17.8.3 | 14.38 | 1938 | 193833133 | From dc0d6ab0a45acc8ecd2cd2e5efb8e530781c76d8 Mon Sep 17 00:00:00 2001 From: suomesta Date: Tue, 20 Aug 2024 23:06:42 +0900 Subject: [PATCH 1156/3948] update Mandates and Preconditions in resize_and_overwrite() (#1344) --- .../basic_string/resize_and_overwrite.md | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/reference/string/basic_string/resize_and_overwrite.md b/reference/string/basic_string/resize_and_overwrite.md index c5bc8f54c0..333998a01d 100644 --- a/reference/string/basic_string/resize_and_overwrite.md +++ b/reference/string/basic_string/resize_and_overwrite.md @@ -16,8 +16,20 @@ constexpr void resize_and_overwrite(size_type n, Operation op); // C++23 本関数は、`string` にいくつかの文字列をまとめて追加・代入する際に、パフォーマンスを向上させる目的で追加された。 -## テンプレートパラメータ制約 -`Operation` は2つの引数と戻り値を持ち、第1引数は `charT*` or `const charT*`、第2引数は `size_type` or `const size_type`、戻り値は `integer-like` であること。 +## 適格要件 + +`Operation`型の値 `op` は、下記を満たす呼び出し可能な型であること。 + +- 式`std::move(op)(data(), n)` が有効(第1引数 `data()` は `charT*`型、第2引数 `n` は `size_type`型)。 +- 戻り値型は `integer-like` を満たす。 + + +## 事前条件 + +- 呼び出された `op` が例外を投げないこと。 +- `op` の呼び出しで、第1引数・第2引数ともに変更されないこと。 +- `r = std::move(op)(data(), n)` とすると、`0 <= r && r <= n` であること。 +- `[data(), data() + r)` の範囲に未初期化の要素がないこと。 ## 要件 @@ -25,9 +37,9 @@ constexpr void resize_and_overwrite(size_type n, Operation op); // C++23 ## 効果 -1. 関数実行前に `[`[`data()`](data.md)`, `[`data()`](data.md)` + n)` が有効範囲でないなら、領域の確保が行われる([`reserve(n)`](reserve.md) 相当)。 -1. `std::move(op)(data(), n)` が呼ばれる。`op` 内では、`[`[`data()`](data.md)`, `[`data()`](data.md)` + n)` の範囲に対して任意の初期化を行う。`op` の戻り値を `m` とすると、`0 <= m && m < n` であること。 -1. サイズを `m` に変更する([`resize(m)`](resize.md) 相当)。 +1. 関数実行前に `[`[`data()`](data.md)`, `[`data()`](data.md)` + n)` が有効範囲でないなら、領域の確保が行われる([`reserve(n)`](reserve.md) 相当)。新たな領域は初期化されないことに注意。 +1. `std::move(op)(data(), n)` が呼ばれる。`op` 内では、`[`[`data()`](data.md)`, `[`data()`](data.md)` + n)` の範囲に対して任意の初期化を行う。 +1. `op` の戻り値を `r` とすると、サイズを `r` に変更する。 ## 戻り値 @@ -89,7 +101,7 @@ int main() { memcpy(buf + pos, word.data(), word.size()); // Good: データコピーのみ pos += word.size(); } - return pos; + return pos; // サイズを返す }); std::cout << s.size() << ": " << s << std::endl; From d69553672fdc3efd23bafb6da5c6d797292e5009 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Wed, 21 Aug 2024 00:50:53 +0900 Subject: [PATCH 1157/3948] =?UTF-8?q?=E7=94=A8=E8=AA=9E=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_DEFINED_WORDS.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/GLOBAL_DEFINED_WORDS.json b/GLOBAL_DEFINED_WORDS.json index f48ec03683..f9944b32cc 100644 --- a/GLOBAL_DEFINED_WORDS.json +++ b/GLOBAL_DEFINED_WORDS.json @@ -91,5 +91,14 @@ }, "ADL": { "desc": "実引数依存の名前探索 (Argument Dependent Lookup)。引数の型が所属する名前空間の関数を探索する言語機能" + }, + "不完全型": { + "desc": "型のサイズを決定できない、完全には定義されていない型。例えば先行宣言のみのクラス型、要素数不明の配列型、`void`など。クラス定義内部ではそのクラス自身は不完全型" + }, + "完全型": { + "desc": "型のサイズを決定できる型。不完全型ではない型" + }, + "オーバーロード解決": { + "desc": "関数呼び出し時に、同名の関数の中から実際に呼び出す関数を決定する処理。このときの候補になることを、オーバーロード解決に参加するという" } } From e8e7d46ec942100477e7bd6fabbc165f1d01d139 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sun, 25 Aug 2024 12:50:25 +0900 Subject: [PATCH 1158/3948] update again resize_and_overwrite() (#1344) --- reference/string/basic_string/resize_and_overwrite.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/reference/string/basic_string/resize_and_overwrite.md b/reference/string/basic_string/resize_and_overwrite.md index 333998a01d..d7e94a1ff7 100644 --- a/reference/string/basic_string/resize_and_overwrite.md +++ b/reference/string/basic_string/resize_and_overwrite.md @@ -32,10 +32,6 @@ constexpr void resize_and_overwrite(size_type n, Operation op); // C++23 - `[data(), data() + r)` の範囲に未初期化の要素がないこと。 -## 要件 -`n <=` [`max_size()`](max_size.md) - - ## 効果 1. 関数実行前に `[`[`data()`](data.md)`, `[`data()`](data.md)` + n)` が有効範囲でないなら、領域の確保が行われる([`reserve(n)`](reserve.md) 相当)。新たな領域は初期化されないことに注意。 1. `std::move(op)(data(), n)` が呼ばれる。`op` 内では、`[`[`data()`](data.md)`, `[`data()`](data.md)` + n)` の範囲に対して任意の初期化を行う。 @@ -46,10 +42,6 @@ constexpr void resize_and_overwrite(size_type n, Operation op); // C++23 なし -## 例外 -`n >` [`max_size()`](max_size.md) の時、[`length_error`](/reference/stdexcept.md) 例外を投げる。 - - ## 例 ```cpp example #include From 4e4c416a32250b8ee845fde5e82b8159d23688a8 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 26 Aug 2024 07:00:59 +0900 Subject: [PATCH 1159/3948] =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=83=91=E3=82=A4?= =?UTF-8?q?=E3=83=A9=E3=81=AE=E5=AE=9F=E8=A3=85=E7=8A=B6=E6=B3=81=20:=20li?= =?UTF-8?q?bc++=E3=81=AEC++14=E3=82=B9=E3=83=86=E3=83=BC=E3=82=BF=E3=82=B9?= =?UTF-8?q?=E3=83=9A=E3=83=BC=E3=82=B8=E3=81=8C=E5=89=8A=E9=99=A4=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=81=9F=E3=81=AE=E3=81=A7=E3=83=AA=E3=83=B3=E3=82=AF?= =?UTF-8?q?=E5=89=8A=E9=99=A4=20#1346?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 1 - 1 file changed, 1 deletion(-) diff --git a/implementation-status.md b/implementation-status.md index 4031a2a4a4..ca4ca3021f 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -91,7 +91,6 @@ - GCC: [C++14 Support in GCC](https://gcc.gnu.org/projects/cxx-status.html#cxx14) - libstdc++: [C++ 2014](https://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#status.iso.2014) - Clang: [C++98, C++11, and C++14 Support in Clang](http://clang.llvm.org/cxx_status.html) -- libc++: [libc++ C++14 Status](https://libcxx.llvm.org/Status/Cxx14.html) - Visual C++ (MSVC): - [Visual C++ 言語への準拠](https://docs.microsoft.com/ja-jp/cpp/visual-cpp-language-conformance) - [Announcing: MSVC Conforms to the C++ Standard](https://blogs.msdn.microsoft.com/vcblog/2018/05/07/announcing-msvc-conforms-to-the-c-standard/) From 5c9ff3ec896ede1d91fadd3f23023cfe7986693a Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 26 Aug 2024 20:40:12 +0900 Subject: [PATCH 1160/3948] =?UTF-8?q?layout=5Fleft=5Fpadded/mapping:=20?= =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=82=B9=E3=83=88=E3=83=A9=E3=82=AF=E3=82=BF?= =?UTF-8?q?(#1341)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/mdspan/is-mapping-of.md | 29 +++ .../layout_left/mapping/op_constructor.md | 6 +- .../mdspan/layout_left_padded/mapping.md | 6 +- .../mapping/op_constructor.md | 223 ++++++++++++++++++ .../layout_right/mapping/op_constructor.md | 8 +- .../mdspan/layout_right_padded/mapping.md | 4 +- .../layout_stride/mapping/op_constructor.md | 22 +- 7 files changed, 270 insertions(+), 28 deletions(-) create mode 100644 reference/mdspan/is-mapping-of.md create mode 100644 reference/mdspan/layout_left_padded/mapping/op_constructor.md diff --git a/reference/mdspan/is-mapping-of.md b/reference/mdspan/is-mapping-of.md new file mode 100644 index 0000000000..546ed40336 --- /dev/null +++ b/reference/mdspan/is-mapping-of.md @@ -0,0 +1,29 @@ +# is-mapping-of +* mdspan[meta header] +* variable[meta id-type] +* cpp23[meta cpp] + +```cpp +template +constexpr bool is-mapping-of = // exposition only + is_same_v, Mapping>; +``` +* is_same_v[link /reference/type_traits/is_same.md] + + +## 概要 +`is-mapping-of`は、`Mapping`が`Layout`の[レイアウトマッピング](LayoutMapping.md)か否かを判定する説明専用変数テンプレートである。 + + +## バージョン +### 言語 +- C++23 + + +## 関連項目 +- [LayoutMappingPolicy](LayoutMappingPolicy.md) +- [LayoutMapping](LayoutMapping.md) + + +## 参照 +- [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) diff --git a/reference/mdspan/layout_left/mapping/op_constructor.md b/reference/mdspan/layout_left/mapping/op_constructor.md index d2a2497d27..14a9af04a3 100644 --- a/reference/mdspan/layout_left/mapping/op_constructor.md +++ b/reference/mdspan/layout_left/mapping/op_constructor.md @@ -37,7 +37,7 @@ constexpr explicit(extents_type::rank() > 0) ## 概要 - (1) : デフォルトコンストラクタ - (2) : コピーコンストラクタ -- (3) : [`extents`](../../extents.md)からの変換コンストラクタ +- (3) : [`extents`](../../extents.md)から構築 - (4) : 他`layout_left::mapping`からの変換コンストラクタ - (5) : [`layout_right::mapping`](../../layout_right/mapping.md)からの変換コンストラクタ - (6) : [`layout_stride::mapping`](../../layout_stride/mapping.md)からの変換コンストラクタ @@ -58,7 +58,7 @@ constexpr explicit(extents_type::rank() > 0) ## 適格要件 - (7) : 以下を満たすとき、`extents_type::`[`static_extent`](../../extents/static_extent.md)`(0)`が[`LayoutLeftPaddedMapping::static-padding-stride`](../../layout_left_padded/mapping.md)に等しいこと。 - `extents_type::`[`rank()`](../../extents/rank.md) `> 1`、かつ - - `extents_type::`[`static_extent`](../../extents/static_extent.md)`(0)`が[`dynamic_extent`](/reference/span/dynamic_extent.md)と等しくなく、かつ + - `extents_type::`[`static_extent`](../../extents/static_extent.md)`(0) !=` [`dynamic_extent`](/reference/span/dynamic_extent.md)、かつ - `LayoutLeftPaddedMapping::static-padding-stride`が[`dynamic_extent`](/reference/span/dynamic_extent.md)と等しくないとき。 @@ -113,7 +113,7 @@ int main() std::layout_left::mapping map2_b = map2_a; assert(map2_a == map2_b); } - // (3) : extentsからの変換コンストラクタ + // (3) : extentsから構築 { Ext3xN ext{4}; std::layout_left::mapping map3 = ext; diff --git a/reference/mdspan/layout_left_padded/mapping.md b/reference/mdspan/layout_left_padded/mapping.md index 7f6c4f2fd9..7b80516ca8 100644 --- a/reference/mdspan/layout_left_padded/mapping.md +++ b/reference/mdspan/layout_left_padded/mapping.md @@ -48,11 +48,11 @@ namespace std { - 値`padding_value`が`index_type`型で表現できること。 - 以下を満たすとき、`LEAST-MULTIPLE-AT-LEAST(padding_value, first-static-extent)`が、`size_t`型および`index_type`型で表現できること。 - `rank_ > 1`、かつ - - `padding_value`が[`dynamic_extent`](/reference/span/dynamic_extent.md)と等しくなく、かつ + - `padding_value !=` [`dynamic_extent`](/reference/span/dynamic_extent.md)、かつ - `first-static-extent`が[`dynamic_extent`](/reference/span/dynamic_extent.md)と等しくないとき。 - 以下を満たすとき、半開区間`[1, rank_)`の全ての値`k`に対して`LEAST-MULTIPLE-AT-LEAST(padding_value, ext.static_extent(0))`と全ての`ext.static_extent(k)`を乗じた結果が、`size_t`型および`index_type`型で表現できること。 - `rank_ > 1`、かつ - - `padding_value`が[`dynamic_extent`](/reference/span/dynamic_extent.md)と等しくなく、かつ + - `padding_value !=` [`dynamic_extent`](/reference/span/dynamic_extent.md)、かつ - 半開区間`[0, extents_type::`[`rank()`](../extents/rank.md)`)`の全ての値`k`に対して`extents_type::`[`static_extent`](../extents/static_extent.md)`(k)`が[`dynamic_extent`](/reference/span/dynamic_extent.md)と等しくないとき。 @@ -61,7 +61,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`(constructor)`](mapping/op_constructor.md.nolink) | コンストラクタ | C++26 | +| [`(constructor)`](mapping/op_constructor.md) | コンストラクタ | C++26 | | `(destructor)` | デストラクタ | C++26 | | `operator=` | コピー代入演算子 | C++26 | diff --git a/reference/mdspan/layout_left_padded/mapping/op_constructor.md b/reference/mdspan/layout_left_padded/mapping/op_constructor.md new file mode 100644 index 0000000000..4a1356666c --- /dev/null +++ b/reference/mdspan/layout_left_padded/mapping/op_constructor.md @@ -0,0 +1,223 @@ +# コンストラクタ +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* layout_left_padded::mapping[meta class] +* cpp26[meta cpp] + +```cpp +constexpr mapping() noexcept; // (1) + +constexpr mapping(const mapping&) noexcept = default; // (2) + +constexpr mapping(const extents_type& ext); // (3) + +template +constexpr mapping(const extents_type& ext, OtherIndexType pad); // (4) + +template +constexpr explicit(!is_convertible_v) + mapping(const layout_left::mapping& other); // (5) + +template +constexpr explicit(extents_type::rank() > 0) + mapping(const layout_stride::mapping& other); // (6) + +template +constexpr explicit(see below) + mapping(const LayoutLeftPaddedMapping& other); // (7) + +template +constexpr explicit(see below) + mapping(const LayoutRightPaddedMapping& other) noexcept; // (8) +``` +* is_convertible_v[link /reference/type_traits/is_convertible.md] +* rank()[link ../../extents/rank.md] +* layout_left::mapping[link ../../layout_left/mapping.md] +* layout_stride::mapping[link ../../layout_stride/mapping.md] +* LayoutLeftPaddedMapping[link ../../layout_left_padded/mapping.md] +* see below[itaic] + +## 概要 +- (1) : デフォルトコンストラクタ +- (2) : コピーコンストラクタ +- (3) : [`extents`](../../extents.md)から構築 +- (4) : [`extents`](../../extents.md)とパディングから構築 +- (5) : [`layout_left::mapping`](../../layout_left/mapping.md)からの変換コンストラクタ +- (6) : [`layout_stride::mapping`](../../layout_stride/mapping.md)からの変換コンストラクタ +- (7) : 他`layout_left_padded::mapping`からの変換コンストラクタ +- (8) : [`layout_right::mapping`](../../layout_right/mapping.md)または[`layout_right_padded::mapping`](../../layout_right_padded/mapping.md)からの変換コンストラクタ + + +## テンプレートパラメータ制約 +- (4) : + - [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true`であること。 + - [`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)``が`true`であること。 +- (5), (6) : + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true`であること。 +- (7) : + - [`is-layout-left-padded-mapping-of`](../../is-layout-left-padded-mapping-of.md)``が`true`であること。 + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true`であること。 +- (8) : + - [`is-layout-right-padded-mapping-of`](../../is-layout-right-padded-mapping-of.md)``が`true`、または[`is-mapping-of`](../../is-mapping-of.md)`<`[`layout_right`](../../layout_right.md)`, LayoutRightPaddedMapping>`が`true`であること。 + - `rank_`が`0`または`1`であること。 + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true`であること。 + + +## 適格要件 +- (5) : `OhterExtents::`[`rank()`](../../extents/rank.md) `> 1`のとき、`(static-padding-stride ==` [`dynamic_extent`](/reference/span/dynamic_extent.md)`) || (OtherExtents::`[`static_extent`](../../extents/static_extent.md)`(0) == dynamic_extent) || (static-padding-stride == OtherExtents::static_extent(0))`が`true`であること。 +- (7) : `rank_ > 1`のとき、`(padding_value ==` [`dynamic_extent`](/reference/span/dynamic_extent.md)`) || (LayoutLeftPaddedMapping::padding_value == dynamic_extent) || (padding_value == LayoutLeftPaddedMapping::padding_value)`が`true`であること。 + + +## 事前条件 +- (3) : + - `ext`の多次元インデクス空間のサイズを、`index_type`型で表現できること。 + - `rank_ > 1`かつ`padding_value !=` [`dynamic_extent`](/reference/span/dynamic_extent.md)のとき、`LEAST-MULTIPLE-AT-LEAST(padding_value, ext.extent(0))`を`index_type`型で表現できること。 + - `rank_ > 1`かつ`padding_value !=` [`dynamic_extent`](/reference/span/dynamic_extent.md)のとき、半開区間`[1, rank_)`の全ての値`k`に対して`LEAST-MULTIPLE-AT-LEAST(padding_value, ext.extent(0))`と全ての`ext.extent(k)`を乗算した値を`index_type`型で表現できること。 +- (4) : + - `pad`の値を`index_type`型で表現できること。 + - `extetns_type::`[`index-cast`](../../extents/index-cast.md)`(pad) > 0` + - `rank_ > 1`のとき、`LEAST-MULTIPLE-AT-LEAST(pad, ext.extent(0))`を`index_type`型で表現できること。 + - `rank_ > 1`のとき、半開区間`[1, rank_)`の全ての値`k`に対して`LEAST-MULTIPLE-AT-LEAST(pad, ext.extent(0))`と全ての`ext.extent(k)`を乗算した値を`index_type`型で表現できること。 + - `padding_value !=` [`dynamic_extent`](/reference/span/dynamic_extent.md)のとき、`padding_value == extetns_type::`[`index-cast`](../../extents/index-cast.md)`(pad)` +- (5) : + - `extents_type::`[`rank()`](../../extents/rank.md) `> 1`かつ`padding_value !=` [`dynamic_extent`](/reference/span/dynamic_extent.md)のとき、`other.`[`stride`](../../layout_left/mapping/stride.md))`(1) == LEAST-MULTIPLE-AT-LEAST(padding_value, extents_type::`[`index-cast`](../../extents/index-cast.md)`(other.extents().extent(0)))` + - `other.`[`required_span_size()`](../../layout_left/mapping/required_span_size.md)を、`index_type`型で表現できること。 +- (6) : + - `rank_ > 1`かつ`padding_value !=` [`dynamic_extent`](/reference/span/dynamic_extent.md)のとき、`other.`[`stride`](../../layout_left/mapping/stride.md)`(1) == LEAST-MULTIPLE-AT-LEAST(padding_value, extents_type::`[`index-cast`](../../extents/index-cast.md)`(other.extents().extent(0)))` + - `rank_ > 0`のとき、`other.`[`stride`](../../layout_stride/mapping/stride.md)`(0) == 1` + - `rank_ > 2`のとき、半開区間`[2, rank_)`の全ての値`r`に対して`other.stride(r) == (other.extents().fwd-prod-of-extents(r) / other.extents().extent(0)) * other.stride(1)` + - `other.`[`required_span_size()`](../../layout_stride/mapping/required_span_size.md)を、`index_type`型で表現できること。 +- (7) : + - `rank_ > 1`かつ`padding_value !=` [`dynamic_extent`](/reference/span/dynamic_extent.md)のとき、`other.stride(1) == LEAST-MULTIPLE-AT-LEAST(padding_value, extents_type::`[`index-cast`](../../extents/index-cast.md)`(other.extent(0)))` + - `other.required_span_size()`を、`index_type`型で表現できること。 +- (8) : + - `other.required_span_size()`を、`index_type`型で表現できること。 + + +## 効果 +- (1) : + - `mapping(extents_type{})`と等価。 +- (3) : + - `ext`を用いて`extents_`を直接非リスト初期化する。 + - `rank_ > 1`のとき、次の値を用いて`stride-1`を直接非リスト初期化する。 + - `padding_value ==` [`dynamic_extent`](/reference/span/dynamic_extent.md)のとき、`ext.extent(0)` + - そうでなければ、`LEAST-MULTIPLE-AT-LEAST(padding_value, ext.extent(0))` +- (4) : + - `ext`を用いて`extents_`を直接非リスト初期化する。 + - `rank_ > 1`のとき、`LEAST-MULTIPLE-AT-LEAST(pad, ext.extent(0))`を用いて`stride-1`を直接非リスト初期化する。 +- (5) : + - `mapping(other.extents())`と等価。 +- (6), (7) : + - `other.extents()`を用いて`extents_`を直接非リスト初期化する。 + - `rank_ > 1`のとき、`other.stride(1)`を用いて`stride-1`を直接非リスト初期化する。 +- (8) : + - `other.extents()`を用いて`extents_`を直接非リスト初期化する。 + + +## 例外 +- (1), (2), (8) : 投げない + + +## explicitになる条件 +- (5) : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`` +- (6) : [`extents_type::rank()`](../../extents/rank.md) `> 0` +- (7) : `rank_ > 1 && (padding_value !=` [`dynamic_extent`](/reference/span/dynamic_extent.md) `|| LayoutLeftPaddedMapping::padding_value == dynamic_extent)` +- (8) : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`` + + +## 例 +```cpp example +#include +#include +#include + +using Ext3x3 = std::extents; +using Ext2D = std::dims<2>; + +int main() +{ + // (1) : デフォルトコンストラクタ + { + std::layout_left_padded<4>::mapping map1s; + std::layout_left_padded<>::mapping map1d; + assert(map1s.stride(1) == 4); + assert(map1d.stride(1) == 3); + } + // (2) : コピーコンストラクタ + { + std::layout_left_padded<4>::mapping map2_a; + std::layout_left_padded<4>::mapping map2_b = map2_a; + assert(map2_a == map2_b); + } + // (3) : extentsから構築 + { + Ext2D ext{3, 3}; + std::layout_left_padded<>::mapping map3 = ext; + assert(map3.extents() == ext); + } + // (4) : extentsとパディングから構築 + { + Ext2D ext{3, 3}; + std::layout_left_padded<>::mapping map4{ext, 4}; + assert(map4.extents() == ext && map4.stride(1) == 4); + } + // (5) : layout_left::mappingからの変換コンストラクタ + { + std::layout_left::mapping src5{Ext3x3{}}; + std::layout_left_padded<>::mapping dst5 = src5; + assert(dst5.stride(1) == 3); + } + // (6) : layout_stride::mappingからの変換コンストラクタ + { + std::array strides{1, 4}; + std::layout_stride::mapping src6{Ext3x3{}, strides}; + std::layout_left_padded<>::mapping dst6{src6}; + assert(dst6.stride(1) == 4); + } + // (7) : 他layout_left_padded::mappingからの変換コンストラクタ + { + std::layout_left_padded<4>::mapping src7; + std::layout_left_padded<>::mapping dst7{src7}; + assert(dst7.extents() == Ext3x3{} && dst7.stride(1) == 4); + } + // (8) : layout_right(_padded)::mappingからの変換コンストラクタ + { + using Ext1D = std::dims<1>; + std::layout_right::mapping src8{Ext1D{5}}; + std::layout_left_padded<>::mapping dst8{src8}; + assert(dst8.extent(0) == 5); + } +} +``` +* std::layout_left_padded<4>::mapping[color ff0000] +* std::layout_left_padded<>::mapping[color ff0000] +* std::layout_right::mapping[link ../../layout_right/mapping.md] +* std::layout_stride::mapping[link ../../layout_stride/mapping.md] +* std::dims[link ../../extents.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`layout_left::mapping`](../../layout_left/mapping.md) +- [`layout_right::mapping`](../../layout_right/mapping.md) +- [`layout_right_padded::mapping`](../../layout_right_padded/mapping.md) +- [`layout_stride::mapping`](../../layout_stride/mapping.md) + + +## 参照 +- [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) diff --git a/reference/mdspan/layout_right/mapping/op_constructor.md b/reference/mdspan/layout_right/mapping/op_constructor.md index f226bf47fb..a26d29527b 100644 --- a/reference/mdspan/layout_right/mapping/op_constructor.md +++ b/reference/mdspan/layout_right/mapping/op_constructor.md @@ -22,7 +22,7 @@ constexpr explicit(!is_convertible_v) template constexpr explicit(!is_convertible_v) - mapping(const LayoutRightPaddedMapping&) noexcept; // (7) C++26 + mapping(const LayoutRightPaddedMapping& other) noexcept; // (7) C++26 template constexpr explicit(extents_type::rank() > 0) @@ -37,7 +37,7 @@ constexpr explicit(extents_type::rank() > 0) ## 概要 - (1) : デフォルトコンストラクタ - (2) : コピーコンストラクタ -- (3) : [`extents`](../../extents.md)からの変換コンストラクタ +- (3) : [`extents`](../../extents.md)から構築 - (4) : 他`layout_right::mapping`からの変換コンストラクタ - (5) : [`layout_left::mapping`](../../layout_left/mapping.md)からの変換コンストラクタ - (6) : [`layout_stride::mapping`](../../layout_stride/mapping.md)からの変換コンストラクタ @@ -58,7 +58,7 @@ constexpr explicit(extents_type::rank() > 0) ## 適格要件 - (7) : 以下を満たすとき、`extents_type::`[`static_extent`](../../extents/static_extent.md)`(`[`Extents::rank()`](../../extents/rank.md) `- 1)`が[`LayoutRightPaddedMapping::static-padding-stride`](../../layout_right_padded/mapping.md)に等しいこと。 - `extents_type::`[`rank()`](../../extents/rank.md) `> 1`、かつ - - `extents_type::`[`static_extent`](../../extents/static_extent.md)`(Extents::rank() - 1)`が[`dynamic_extent`](/reference/span/dynamic_extent.md)と等しくなく、かつ + - `extents_type::`[`static_extent`](../../extents/static_extent.md)`(Extents::rank() - 1) !=` [`dynamic_extent`](/reference/span/dynamic_extent.md)、かつ - `LayoutRightPaddedMapping::static-padding-stride`が[`dynamic_extent`](/reference/span/dynamic_extent.md)と等しくないとき。 @@ -113,7 +113,7 @@ int main() std::layout_right::mapping map2_b = map2_a; assert(map2_a == map2_b); } - // (3) : extentsからの変換コンストラクタ + // (3) : extentsから構築 { Ext3xN ext{4}; std::layout_right::mapping map3 = ext; diff --git a/reference/mdspan/layout_right_padded/mapping.md b/reference/mdspan/layout_right_padded/mapping.md index d755227d78..55e170826a 100644 --- a/reference/mdspan/layout_right_padded/mapping.md +++ b/reference/mdspan/layout_right_padded/mapping.md @@ -48,11 +48,11 @@ namespace std { - 値`padding_value`が`index_type`型で表現できること。 - 以下を満たすとき、`LEAST-MULTIPLE-AT-LEAST(padding_value, last-static-extent)`が、`size_t`型および`index_type`型で表現できること。 - `rank_ > 1`、かつ - - `padding_value`が[`dynamic_extent`](/reference/span/dynamic_extent.md)と等しくなく、かつ + - `padding_value !=` [`dynamic_extent`](/reference/span/dynamic_extent.md)、かつ - `last-static-extent`が[`dynamic_extent`](/reference/span/dynamic_extent.md)と等しくないとき。 - 以下を満たすとき、半開区間`[1, rank_ - 1)`の全ての値`k`に対して`LEAST-MULTIPLE-AT-LEAST(padding_value, ext.static_extent(rank_ - 1))`と全ての`ext.static_extent(k)`を乗じた結果が、`size_t`型および`index_type`型で表現できること。 - `rank_ > 1`、かつ - - `padding_value`が[`dynamic_extent`](/reference/span/dynamic_extent.md)と等しくなく、かつ + - `padding_value !=` [`dynamic_extent`](/reference/span/dynamic_extent.md)、かつ - 半開区間`[0, rank_)`の全ての値`k`に対して`extents_type::`[`static_extent`](../extents/static_extent.md)`(k)`が[`dynamic_extent`](/reference/span/dynamic_extent.md)と等しくないとき。 diff --git a/reference/mdspan/layout_stride/mapping/op_constructor.md b/reference/mdspan/layout_stride/mapping/op_constructor.md index 0265e92351..df6009e6eb 100644 --- a/reference/mdspan/layout_stride/mapping/op_constructor.md +++ b/reference/mdspan/layout_stride/mapping/op_constructor.md @@ -11,13 +11,13 @@ constexpr mapping() noexcept; // (1) constexpr mapping(const mapping&) noexcept = default; // (2) template - constexpr mapping(const extents_type&, span) noexcept; // (3) + constexpr mapping(const extents_type& e, span s) noexcept; // (3) template - constexpr mapping(const extents_type&, const array&) noexcept; // (4) + constexpr mapping(const extents_type& e, const array& s) noexcept; // (4) template - constexpr explicit(see below) mapping(const StridedLayoutMapping&) noexcept; // (5) + constexpr explicit(see below) mapping(const StridedLayoutMapping& other) noexcept; // (5) ``` * span[link /reference/span/span.md] * array[link /reference/array/array.md] @@ -27,7 +27,7 @@ template ## 概要 - (1) : デフォルトコンストラクタ - (2) : コピーコンストラクタ -- (3), (4) : [`extents`](../../extents.md)とストライド幅からの構築(定数`rank_`は次元数) +- (3), (4) : [`extents`](../../extents.md)とストライド幅から構築(定数`rank_`は次元数) - (5) : [レイアウトマッピング](../../LayoutMapping.md)からの変換コンストラクタ @@ -47,7 +47,7 @@ template - (3), (4) : - 半開区間`[0, rank_)`の全ての`i`に対して、`s[i]`を`index_type`へ変換した結果が`0`より大きいこと。 - [`REQUIRED-SPAN-SIZE`](required_span_size.md)`(e, s)`を`index_type`型で表現できること。 - - `rank_`が`0`より大きいとき、半開区間`[1, rank_)`の全ての`i`に対して`j = i-1`として`s[Pi] >= s[Pj] * e.extents(Pj)`を満たすの整数値の組合せ`P`が存在すること。 + - `rank_ > 0`のとき、半開区間`[1, rank_)`の全ての`i`に対して`j = i-1`として`s[Pi] >= s[Pj] * e.extents(Pj)`を満たすの整数値の組合せ`P`が存在すること。 - (5) : - `StridedLayoutMapping`が[レイアウトマッピングポリシー](../../LayoutMappingPolicy.md)を満たす - `extents()`の全ての次元`r`に対して`other.stride(r) > 0` @@ -66,16 +66,6 @@ template ## explicitになる条件 -説明専用の変数テンプレート`is-mapping-of`を下記の通り定義する: - -```cpp -template -constexpr bool is-mapping-of = // exposition only - is_same_v, Mapping>; -``` -* is-mapping-of[italic] -* is_same_v[link /reference/type_traits/is_same.md] - - (5) : `explicit`指定子の式は以下と等価 ```cpp // C++23 @@ -93,10 +83,10 @@ constexpr bool is-mapping-of = // exposition only is-mapping-of)) ``` * is_convertible_v[link /reference/type_traits/is_convertible.md] -* is-mapping-of[italic] * layout_left[link ../../layout_left.md] * layout_right[link ../../layout_right.md] * layout_stride[link ../../layout_stride.md] +* is-mapping-of[link ../../is-mapping-of.md] * is-layout-left-padded-mapping-of[link ../../is-layout-left-padded-mapping-of.md] * is-layout-right-padded-mapping-of[link ../../is-layout-right-padded-mapping-of.md] From 8c041b3bd1aa46282a0dbb33c7671ec30bb385cb Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 26 Aug 2024 22:25:47 +0900 Subject: [PATCH 1161/3948] =?UTF-8?q?layout=5Fright=5Fpadded/mapping:=20?= =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=82=B9=E3=83=88=E3=83=A9=E3=82=AF=E3=82=BF?= =?UTF-8?q?(#1341)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapping/op_constructor.md | 24 +- .../mdspan/layout_right_padded/mapping.md | 2 +- .../mapping/op_constructor.md | 222 ++++++++++++++++++ 3 files changed, 235 insertions(+), 13 deletions(-) create mode 100644 reference/mdspan/layout_right_padded/mapping/op_constructor.md diff --git a/reference/mdspan/layout_left_padded/mapping/op_constructor.md b/reference/mdspan/layout_left_padded/mapping/op_constructor.md index 4a1356666c..fab88cd476 100644 --- a/reference/mdspan/layout_left_padded/mapping/op_constructor.md +++ b/reference/mdspan/layout_left_padded/mapping/op_constructor.md @@ -35,8 +35,7 @@ constexpr explicit(see below) * rank()[link ../../extents/rank.md] * layout_left::mapping[link ../../layout_left/mapping.md] * layout_stride::mapping[link ../../layout_stride/mapping.md] -* LayoutLeftPaddedMapping[link ../../layout_left_padded/mapping.md] -* see below[itaic] +* see below[italic] ## 概要 - (1) : デフォルトコンストラクタ @@ -72,21 +71,21 @@ constexpr explicit(see below) ## 事前条件 - (3) : - `ext`の多次元インデクス空間のサイズを、`index_type`型で表現できること。 - - `rank_ > 1`かつ`padding_value !=` [`dynamic_extent`](/reference/span/dynamic_extent.md)のとき、`LEAST-MULTIPLE-AT-LEAST(padding_value, ext.extent(0))`を`index_type`型で表現できること。 - - `rank_ > 1`かつ`padding_value !=` [`dynamic_extent`](/reference/span/dynamic_extent.md)のとき、半開区間`[1, rank_)`の全ての値`k`に対して`LEAST-MULTIPLE-AT-LEAST(padding_value, ext.extent(0))`と全ての`ext.extent(k)`を乗算した値を`index_type`型で表現できること。 + - `rank_ > 1`かつ`padding_value !=` [`dynamic_extent`](/reference/span/dynamic_extent.md)のとき、`LEAST-MULTIPLE-AT-LEAST(padding_value, ext.`[`extent`](../../extents/extent.md)`(0))`を`index_type`型で表現できること。 + - `rank_ > 1`かつ`padding_value !=` [`dynamic_extent`](/reference/span/dynamic_extent.md)のとき、半開区間`[1, rank_)`の全ての値`k`に対して`LEAST-MULTIPLE-AT-LEAST(padding_value, ext.`[`extent`](../../extents/extent.md)`(0))`と全ての`ext.extent(k)`を乗算した値を`index_type`型で表現できること。 - (4) : - `pad`の値を`index_type`型で表現できること。 - `extetns_type::`[`index-cast`](../../extents/index-cast.md)`(pad) > 0` - - `rank_ > 1`のとき、`LEAST-MULTIPLE-AT-LEAST(pad, ext.extent(0))`を`index_type`型で表現できること。 - - `rank_ > 1`のとき、半開区間`[1, rank_)`の全ての値`k`に対して`LEAST-MULTIPLE-AT-LEAST(pad, ext.extent(0))`と全ての`ext.extent(k)`を乗算した値を`index_type`型で表現できること。 + - `rank_ > 1`のとき、`LEAST-MULTIPLE-AT-LEAST(pad, ext.`[`extent`](../../extents/extent.md)`(0))`を`index_type`型で表現できること。 + - `rank_ > 1`のとき、半開区間`[1, rank_)`の全ての値`k`に対して`LEAST-MULTIPLE-AT-LEAST(pad, ext.`[`extent`](../../extents/extent.md)`(0))`と全ての`ext.extent(k)`を乗算した値を`index_type`型で表現できること。 - `padding_value !=` [`dynamic_extent`](/reference/span/dynamic_extent.md)のとき、`padding_value == extetns_type::`[`index-cast`](../../extents/index-cast.md)`(pad)` - (5) : - - `extents_type::`[`rank()`](../../extents/rank.md) `> 1`かつ`padding_value !=` [`dynamic_extent`](/reference/span/dynamic_extent.md)のとき、`other.`[`stride`](../../layout_left/mapping/stride.md))`(1) == LEAST-MULTIPLE-AT-LEAST(padding_value, extents_type::`[`index-cast`](../../extents/index-cast.md)`(other.extents().extent(0)))` + - `extents_type::`[`rank()`](../../extents/rank.md) `> 1`かつ`padding_value !=` [`dynamic_extent`](/reference/span/dynamic_extent.md)のとき、`other.`[`stride`](../../layout_left/mapping/stride.md)`(1) == LEAST-MULTIPLE-AT-LEAST(padding_value, extents_type::`[`index-cast`](../../extents/index-cast.md)`(other.extents().`[`extent`](../../extents/extent.md)`(0)))` - `other.`[`required_span_size()`](../../layout_left/mapping/required_span_size.md)を、`index_type`型で表現できること。 - (6) : - - `rank_ > 1`かつ`padding_value !=` [`dynamic_extent`](/reference/span/dynamic_extent.md)のとき、`other.`[`stride`](../../layout_left/mapping/stride.md)`(1) == LEAST-MULTIPLE-AT-LEAST(padding_value, extents_type::`[`index-cast`](../../extents/index-cast.md)`(other.extents().extent(0)))` + - `rank_ > 1`かつ`padding_value !=` [`dynamic_extent`](/reference/span/dynamic_extent.md)のとき、`other.`[`stride`](../../layout_stride/mapping/stride.md)`(1) == LEAST-MULTIPLE-AT-LEAST(padding_value, extents_type::`[`index-cast`](../../extents/index-cast.md)`(other.extents().`[`extent`](../../extents/extent.md)`(0)))` - `rank_ > 0`のとき、`other.`[`stride`](../../layout_stride/mapping/stride.md)`(0) == 1` - - `rank_ > 2`のとき、半開区間`[2, rank_)`の全ての値`r`に対して`other.stride(r) == (other.extents().fwd-prod-of-extents(r) / other.extents().extent(0)) * other.stride(1)` + - `rank_ > 2`のとき、半開区間`[2, rank_)`の全ての値`r`に対して`other.`[`stride`](../../layout_stride/mapping/stride.md)`(r) == (other.extents().fwd-prod-of-extents(r) / other.extents().`[`extent`](../../extents/extent.md)`(0)) * other.stride(1)` - `other.`[`required_span_size()`](../../layout_stride/mapping/required_span_size.md)を、`index_type`型で表現できること。 - (7) : - `rank_ > 1`かつ`padding_value !=` [`dynamic_extent`](/reference/span/dynamic_extent.md)のとき、`other.stride(1) == LEAST-MULTIPLE-AT-LEAST(padding_value, extents_type::`[`index-cast`](../../extents/index-cast.md)`(other.extent(0)))` @@ -101,11 +100,11 @@ constexpr explicit(see below) - (3) : - `ext`を用いて`extents_`を直接非リスト初期化する。 - `rank_ > 1`のとき、次の値を用いて`stride-1`を直接非リスト初期化する。 - - `padding_value ==` [`dynamic_extent`](/reference/span/dynamic_extent.md)のとき、`ext.extent(0)` - - そうでなければ、`LEAST-MULTIPLE-AT-LEAST(padding_value, ext.extent(0))` + - `padding_value ==` [`dynamic_extent`](/reference/span/dynamic_extent.md)のとき、`ext.`[`extent`](../../extents/extent.md)`(0)` + - そうでなければ、`LEAST-MULTIPLE-AT-LEAST(padding_value, ext.`[`extent`](../../extents/extent.md)`(0))` - (4) : - `ext`を用いて`extents_`を直接非リスト初期化する。 - - `rank_ > 1`のとき、`LEAST-MULTIPLE-AT-LEAST(pad, ext.extent(0))`を用いて`stride-1`を直接非リスト初期化する。 + - `rank_ > 1`のとき、`LEAST-MULTIPLE-AT-LEAST(pad, ext.`[`extent`](../../extents/extent.md)`(0))`を用いて`stride-1`を直接非リスト初期化する。 - (5) : - `mapping(other.extents())`と等価。 - (6), (7) : @@ -192,6 +191,7 @@ int main() ``` * std::layout_left_padded<4>::mapping[color ff0000] * std::layout_left_padded<>::mapping[color ff0000] +* std::layout_left::mapping[link ../../layout_left/mapping.md] * std::layout_right::mapping[link ../../layout_right/mapping.md] * std::layout_stride::mapping[link ../../layout_stride/mapping.md] * std::dims[link ../../extents.md] diff --git a/reference/mdspan/layout_right_padded/mapping.md b/reference/mdspan/layout_right_padded/mapping.md index 55e170826a..97528c06a9 100644 --- a/reference/mdspan/layout_right_padded/mapping.md +++ b/reference/mdspan/layout_right_padded/mapping.md @@ -61,7 +61,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`(constructor)`](mapping/op_constructor.md.nolink) | コンストラクタ | C++26 | +| [`(constructor)`](mapping/op_constructor.md) | コンストラクタ | C++26 | | `(destructor)` | デストラクタ | C++26 | | `operator=` | コピー代入演算子 | C++26 | diff --git a/reference/mdspan/layout_right_padded/mapping/op_constructor.md b/reference/mdspan/layout_right_padded/mapping/op_constructor.md new file mode 100644 index 0000000000..5ae9da9d3a --- /dev/null +++ b/reference/mdspan/layout_right_padded/mapping/op_constructor.md @@ -0,0 +1,222 @@ +# コンストラクタ +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* layout_right_padded::mapping[meta class] +* cpp26[meta cpp] + +```cpp +constexpr mapping() noexcept; // (1) + +constexpr mapping(const mapping&) noexcept = default; // (2) + +constexpr mapping(const extents_type& ext); // (3) + +template +constexpr mapping(const extents_type& ext, OtherIndexType pad); // (4) + +template +constexpr explicit(!is_convertible_v) + mapping(const layout_right::mapping& other); // (5) + +template +constexpr explicit(rank_ > 0) + mapping(const layout_stride::mapping& other); // (6) + +template +constexpr explicit(see below) + mapping(const LayoutRightPaddedMapping& other); // (7) + +template +constexpr explicit(see below) + mapping(const LayoutLeftPaddedMapping& other) noexcept; // (8) +``` +* is_convertible_v[link /reference/type_traits/is_convertible.md] +* layout_right::mapping[link ../../layout_right/mapping.md] +* layout_stride::mapping[link ../../layout_stride/mapping.md] +* see below[italic] + +## 概要 +- (1) : デフォルトコンストラクタ +- (2) : コピーコンストラクタ +- (3) : [`extents`](../../extents.md)から構築 +- (4) : [`extents`](../../extents.md)とパディングから構築 +- (5) : [`layout_right::mapping`](../../layout_right/mapping.md)からの変換コンストラクタ +- (6) : [`layout_stride::mapping`](../../layout_stride/mapping.md)からの変換コンストラクタ +- (7) : 他`layout_right_padded::mapping`からの変換コンストラクタ +- (8) : [`layout_left::mapping`](../../layout_left/mapping.md)または[`layout_left_padded::mapping`](../../layout_left_padded/mapping.md)からの変換コンストラクタ + + +## テンプレートパラメータ制約 +- (4) : + - [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true`であること。 + - [`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)``が`true`であること。 +- (5), (6) : + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true`であること。 +- (7) : + - [`is-layout-right-padded-mapping-of`](../../is-layout-right-padded-mapping-of.md)``が`true`であること。 + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true`であること。 +- (8) : + - [`is-layout-left-padded-mapping-of`](../../is-layout-left-padded-mapping-of.md)``が`true`、または[`is-mapping-of`](../../is-mapping-of.md)`<`[`layout_left`](../../layout_left.md)`, LayoutLeftPaddedMapping>`が`true`であること。 + - `rank_`が`0`または`1`であること。 + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true`であること。 + + +## 適格要件 +- (5) : `OhterExtents::`[`rank()`](../../extents/rank.md) `> 1`のとき、`(static-padding-stride ==` [`dynamic_extent`](/reference/span/dynamic_extent.md)`) || (OtherExtents::`[`static_extent`](../../extents/static_extent.md)`(rank_ - 1) == dynamic_extent) || (static-padding-stride == OtherExtents::static_extent(rank_ - 1))`が`true`であること。 +- (7) : `rank_ > 1`のとき、`(padding_value ==` [`dynamic_extent`](/reference/span/dynamic_extent.md)`) || (LayoutRightPaddedMapping::padding_value == dynamic_extent) || (padding_value == LayoutRightPaddedMapping::padding_value)`が`true`であること。 + + +## 事前条件 +- (3) : + - `ext`の多次元インデクス空間のサイズを、`index_type`型で表現できること。 + - `rank_ > 1`かつ`padding_value !=` [`dynamic_extent`](/reference/span/dynamic_extent.md)のとき、`LEAST-MULTIPLE-AT-LEAST(padding_value, ext.`[`extent`](../../extents/extent.md)`(rank_ - 1))`を`index_type`型で表現できること。 + - `rank_ > 1`かつ`padding_value !=` [`dynamic_extent`](/reference/span/dynamic_extent.md)のとき、半開区間`[0, rank_ - 1)`の全ての値`k`に対して`LEAST-MULTIPLE-AT-LEAST(padding_value, ext.`[`extent`](../../extents/extent.md)`(rank_ - 1))`と全ての`ext.extent(k)`を乗算した値を`index_type`型で表現できること。 +- (4) : + - `pad`の値を`index_type`型で表現できること。 + - `extetns_type::`[`index-cast`](../../extents/index-cast.md)`(pad) > 0` + - `rank_ > 1`のとき、`LEAST-MULTIPLE-AT-LEAST(pad, ext.`[`extent`](../../extents/extent.md)`(rank_ - 1))`を`index_type`型で表現できること。 + - `rank_ > 1`のとき、半開区間`[0, rank_ - 1)`の全ての値`k`に対して`LEAST-MULTIPLE-AT-LEAST(pad, ext.`[`extent`](../../extents/extent.md)`(rank_ - 1))`と全ての`ext.extent(k)`を乗算した値を`index_type`型で表現できること。 + - `padding_value !=` [`dynamic_extent`](/reference/span/dynamic_extent.md)のとき、`padding_value == extetns_type::`[`index-cast`](../../extents/index-cast.md)`(pad)` +- (5) : + - `extents_type::`[`rank()`](../../extents/rank.md) `> 1`かつ`padding_value !=` [`dynamic_extent`](/reference/span/dynamic_extent.md)のとき、`other.`[`stride`](../../layout_right/mapping/stride.md)`(rank_ - 2) == LEAST-MULTIPLE-AT-LEAST(padding_value, extents_type::`[`index-cast`](../../extents/index-cast.md)`(other.extents().`[`extent`](../../extents/extent.md)`(rank_ - 1)))` + - `other.`[`required_span_size()`](../../layout_right/mapping/required_span_size.md)を、`index_type`型で表現できること。 +- (6) : + - `rank_ > 1`かつ`padding_value !=` [`dynamic_extent`](/reference/span/dynamic_extent.md)のとき、`other.`[`stride`](../../layout_stride/mapping/stride.md)`(rank_ - 2) == LEAST-MULTIPLE-AT-LEAST(padding_value, extents_type::`[`index-cast`](../../extents/index-cast.md)`(other.extents().`[`extent`](../../extents/extent.md)`(rank_ - 1)))` + - `rank_ > 0`のとき、`other.`[`stride`](../../layout_stride/mapping/stride.md)`(rank_ - 1) == 1` + - `rank_ > 2`のとき、半開区間`[0, rank_ - 2)`の全ての値`r`に対して`other.`[`stride`](../../layout_stride/mapping/stride.md)`(r) == (other.extents().rev-prod-of-extents(r) / other.extents().`[`extent`](../../extents/extent.md)`(rank_ - 1)) * other.stride(rank_ - 2)` + - `other.`[`required_span_size()`](../../layout_stride/mapping/required_span_size.md)を、`index_type`型で表現できること。 +- (7) : + - `rank_ > 1`かつ`padding_value !=` [`dynamic_extent`](/reference/span/dynamic_extent.md)のとき、`other.stride(rank_ - 2) == LEAST-MULTIPLE-AT-LEAST(padding_value, extents_type::`[`index-cast`](../../extents/index-cast.md)`(other.extent(rank_ - 1)))` + - `other.required_span_size()`を、`index_type`型で表現できること。 +- (8) : + - `other.required_span_size()`を、`index_type`型で表現できること。 + + +## 効果 +- (1) : + - `mapping(extents_type{})`と等価。 +- (3) : + - `ext`を用いて`extents_`を直接非リスト初期化する。 + - `rank_ > 1`のとき、次の値を用いて`stride-rm2`を直接非リスト初期化する。 + - `padding_value ==` [`dynamic_extent`](/reference/span/dynamic_extent.md)のとき、`ext.`[`extent`](../../extents/extent.md)`(rank_ - 1)` + - そうでなければ、`LEAST-MULTIPLE-AT-LEAST(padding_value, ext.`[`extent`](../../extents/extent.md)`(rank_ - 1))` +- (4) : + - `ext`を用いて`extents_`を直接非リスト初期化する。 + - `rank_ > 1`のとき、`LEAST-MULTIPLE-AT-LEAST(pad, ext.`[`extent`](../../extents/extent.md)`(rank_ - 1))`を用いて`stride-rm2`を直接非リスト初期化する。 +- (5) : + - `mapping(other.extents())`と等価。 +- (6), (7) : + - `other.extents()`を用いて`extents_`を直接非リスト初期化する。 + - `rank_ > 1`のとき、`other.stride(rank_ - 1)`を用いて`stride-rm2`を直接非リスト初期化する。 +- (8) : + - `other.extents()`を用いて`extents_`を直接非リスト初期化する。 + + +## 例外 +- (1), (2), (8) : 投げない + + +## explicitになる条件 +- (5) : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`` +- (6) : [`extents_type::rank()`](../../extents/rank.md) `> 0` +- (7) : `rank_ > 1 && (padding_value !=` [`dynamic_extent`](/reference/span/dynamic_extent.md) `|| LayoutRightPaddedMapping::padding_value == dynamic_extent)` +- (8) : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`` + + +## 例 +```cpp example +#include +#include +#include + +using Ext3x3 = std::extents; +using Ext2D = std::dims<2>; + +int main() +{ + // (1) : デフォルトコンストラクタ + { + std::layout_right_padded<4>::mapping map1s; + std::layout_right_padded<>::mapping map1d; + assert(map1s.stride(0) == 4); + assert(map1d.stride(0) == 3); + } + // (2) : コピーコンストラクタ + { + std::layout_right_padded<4>::mapping map2_a; + std::layout_right_padded<4>::mapping map2_b = map2_a; + assert(map2_a == map2_b); + } + // (3) : extentsから構築 + { + Ext2D ext{3, 3}; + std::layout_right_padded<>::mapping map3 = ext; + assert(map3.extents() == ext); + } + // (4) : extentsとパディングから構築 + { + Ext2D ext{3, 3}; + std::layout_right_padded<>::mapping map4{ext, 4}; + assert(map4.extents() == ext && map4.stride(0) == 4); + } + // (5) : layout_right::mappingからの変換コンストラクタ + { + std::layout_right::mapping src5{Ext3x3{}}; + std::layout_right_padded<>::mapping dst5 = src5; + assert(dst5.stride(0) == 3); + } + // (6) : layout_stride::mappingからの変換コンストラクタ + { + std::array strides{4, 1}; + std::layout_stride::mapping src6{Ext3x3{}, strides}; + std::layout_right_padded<>::mapping dst6{src6}; + assert(dst6.stride(0) == 4); + } + // (7) : 他layout_right_padded::mappingからの変換コンストラクタ + { + std::layout_right_padded<4>::mapping src7; + std::layout_right_padded<>::mapping dst7{src7}; + assert(dst7.extents() == Ext3x3{} && dst7.stride(0) == 4); + } + // (8) : layout_left(_padded)::mappingからの変換コンストラクタ + { + using Ext1D = std::dims<1>; + std::layout_left::mapping src8{Ext1D{5}}; + std::layout_right_padded<>::mapping dst8{src8}; + assert(dst8.extent(0) == 5); + } +} +``` +* std::layout_right_padded<4>::mapping[color ff0000] +* std::layout_right_padded<>::mapping[color ff0000] +* std::layout_right::mapping[link ../../layout_right/mapping.md] +* std::layout_left::mapping[link ../../layout_left/mapping.md] +* std::layout_stride::mapping[link ../../layout_stride/mapping.md] +* std::dims[link ../../extents.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`layout_left::mapping`](../../layout_left/mapping.md) +- [`layout_left_padded::mapping`](../../layout_left_padded/mapping.md) +- [`layout_right::mapping`](../../layout_right/mapping.md) +- [`layout_stride::mapping`](../../layout_stride/mapping.md) + + +## 参照 +- [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) From 9a02af6f5c3b6718cbfd8adf032e12f8c3140066 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Thu, 29 Aug 2024 05:41:28 +0900 Subject: [PATCH 1162/3948] =?UTF-8?q?filter=5Fview=20=E3=81=AE=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=90=E3=81=AE=E8=A7=A3=E8=AA=AC=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 5 ++ reference/ranges/filter_view.md | 58 ++++++++----- reference/ranges/filter_view/base.md | 70 +++++++++++++++ reference/ranges/filter_view/begin.md | 65 ++++++++++++++ reference/ranges/filter_view/end.md | 64 ++++++++++++++ reference/ranges/filter_view/iterator.md | 80 +++++++++++++++++ reference/ranges/filter_view/iterator/base.md | 68 +++++++++++++++ .../ranges/filter_view/iterator/op_arrow.md | 37 ++++++++ .../filter_view/iterator/op_constructor.md | 66 ++++++++++++++ .../filter_view/iterator/op_decrement.md | 81 +++++++++++++++++ .../ranges/filter_view/iterator/op_deref.md | 62 +++++++++++++ .../ranges/filter_view/iterator/op_equal.md | 48 ++++++++++ .../filter_view/iterator/op_increment.md | 87 +++++++++++++++++++ .../ranges/filter_view/op_constructor.md | 58 +++++++++++++ .../ranges/filter_view/op_deduction_guide.md | 67 ++++++++++++++ reference/ranges/filter_view/pred.md | 62 +++++++++++++ reference/ranges/filter_view/sentinel.md | 59 +++++++++++++ reference/ranges/filter_view/sentinel/base.md | 35 ++++++++ .../filter_view/sentinel/op_constructor.md | 37 ++++++++ .../ranges/filter_view/sentinel/op_equal.md | 49 +++++++++++ 20 files changed, 1134 insertions(+), 24 deletions(-) create mode 100644 reference/ranges/filter_view/base.md create mode 100644 reference/ranges/filter_view/begin.md create mode 100644 reference/ranges/filter_view/end.md create mode 100644 reference/ranges/filter_view/iterator.md create mode 100644 reference/ranges/filter_view/iterator/base.md create mode 100644 reference/ranges/filter_view/iterator/op_arrow.md create mode 100644 reference/ranges/filter_view/iterator/op_constructor.md create mode 100644 reference/ranges/filter_view/iterator/op_decrement.md create mode 100644 reference/ranges/filter_view/iterator/op_deref.md create mode 100644 reference/ranges/filter_view/iterator/op_equal.md create mode 100644 reference/ranges/filter_view/iterator/op_increment.md create mode 100644 reference/ranges/filter_view/op_constructor.md create mode 100644 reference/ranges/filter_view/op_deduction_guide.md create mode 100644 reference/ranges/filter_view/pred.md create mode 100644 reference/ranges/filter_view/sentinel.md create mode 100644 reference/ranges/filter_view/sentinel/base.md create mode 100644 reference/ranges/filter_view/sentinel/op_constructor.md create mode 100644 reference/ranges/filter_view/sentinel/op_equal.md diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index e65f4921da..853f1a1966 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -80,6 +80,8 @@ * common_type_t[link /reference/concepts/common_type.md] * common_with[link /reference/concepts/common_with.md] * copy_constructible[link /reference/concepts/copy_constructible.md] + * default_initializable[link /reference/concepts/default_initializable.md] + * equality_comparable[link /reference/concepts/equality_comparable.md] * invocable[link /reference/concepts/invocable.md] * move_constructible[link /reference/concepts/move_constructible.md] * regular_invocable[link /reference/concepts/invocable.md] @@ -188,6 +190,7 @@ * std::random_device[link /reference/random/random_device.md] * seed_gen()[link /reference/random/random_device/op_call.md] * [link /reference/ranges.md] + * all_t[link /reference/ranges/all.md] * bidirectional_range[link /reference/ranges/bidirectional_range.md] * borrowed_range[link /reference/ranges/borrowed_range.md] * borrowed_subrange_t[link /reference/ranges/borrowed_subrange_t.md] @@ -197,6 +200,7 @@ * constant_range[link /reference/ranges/constant_range.md] * contiguous_range[link /reference/ranges/contiguous_range.md] * forward_range[link /reference/ranges/forward_range.md] + * has-arrow[link /reference/ranges/has-arrow.md] * input_range[link /reference/ranges/input_range.md] * iterator_t[link /reference/ranges/iterator_t.md] * maybe-const[link /reference/ranges/maybe-const.md] @@ -208,6 +212,7 @@ * range_size_t[link /reference/ranges/range_size_t.md] * range_value_t[link /reference/ranges/range_value_t.md] * range[link /reference/ranges/range.md] + * ref_view[link /reference/ranges/ref_view.md] * sentinel_t[link /reference/ranges/sentinel_t.md] * sized_range[link /reference/ranges/sized_range.md] * subrange[link /reference/ranges/subrange.md] diff --git a/reference/ranges/filter_view.md b/reference/ranges/filter_view.md index ff09dcee76..f89fc8ae7b 100644 --- a/reference/ranges/filter_view.md +++ b/reference/ranges/filter_view.md @@ -15,12 +15,6 @@ namespace std::ranges { } } ``` -* input_range[link input_range.md] -* indirect_unary_predicate[link /reference/iterator/indirect_unary_predicate.md] -* iterator_t[link iterator_t.md] -* view[link view.md] -* is_object_v[link /reference/type_traits/is_object.md] -* view_interface[link view_interface.md] ## 概要 - (1): 指定された条件`Pred`を満たす要素だけが要素となる[`view`](view.md) @@ -28,8 +22,9 @@ namespace std::ranges { 元のRangeから条件を満たす要素を探す処理は遅延評価される。 -- 初めてメンバ関数[`begin`](filter_view/begin.md.nolink)が呼び出されたときに先頭の要素を決定し、残りはイテレータが進むときに求める。 -- [`begin`](filter_view/begin.md.nolink)は償却定数時間で実行できなければならないため、[`begin`](filter_view/begin.md.nolink)の値はキャッシュされる。 +- 初めてメンバ関数[`begin`](filter_view/begin.md)が呼び出されたときに先頭の要素を決定し、残りはイテレータが進むときに求める。 + - 探索は [`ranges::find_if`](/reference/algorithm/ranges_find_if.md) と同様に行われる。 +- [`begin`](filter_view/begin.md)は償却定数時間で実行できなければならないため、[`begin`](filter_view/begin.md)の値はキャッシュされる。 `filter_view`の要素を書き換えてもよいが、書き換えた後の要素が`Pred`を満たさない場合は未定義動作となる。 @@ -53,33 +48,48 @@ namespace std::ranges { ## 効果 -- (2): 式`views::filter(E, P)`の効果は`filter_view(E, P)`と等しい +- (2): 式`views::filter(E, P)`の効果は[`filter_view`](filter_view/op_constructor.md)`(E, P)`と等しい + +## メンバ変数 + +| 名前 | 説明 | 対応バージョン | +|-------------------------------------------------|------------------------------------|-----------------------| +| `V base_ = V()` | 元の[`view`](view.md) (説明専用) | C++20 | +| [`copyable-box`](copyable_box.md)` pred_` | 述語 (説明専用) | C++20
C++23で削除 | +| [`movable-box`](movable_box.md)` pred_` | 述語 (説明専用) | C++23 | ## メンバ関数 | 名前 | 説明 | 対応バージョン | |--------------------------------------------------|----------------------------------|----------------| -| [`(constructor)`](filter_view/op_constructor.md.nolink) | コンストラクタ | C++20 | -| [`base`](filter_view/base.md.nolink) | `V`の参照を取得する | C++20 | -| [`pred`](filter_view/pred.md.nolink) | 述語を取得する | C++20 | -| [`begin`](filter_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++20 | -| [`end`](filter_view/end.md.nolink) | 番兵を取得する | C++20 | +| [`(constructor)`](filter_view/op_constructor.md) | コンストラクタ | C++20 | +| [`base`](filter_view/base.md) | `V`の参照を取得する | C++20 | +| [`pred`](filter_view/pred.md) | 述語を取得する | C++20 | +| [`begin`](filter_view/begin.md) | 先頭を指すイテレータを取得する | C++20 | +| [`end`](filter_view/end.md) | 番兵を取得する | C++20 | ## 継承しているメンバ関数 -| 名前 | 説明 | 対応バージョン | -|----------------------------------------------|----------------------------------|----------------| +| 名前 | 説明 | 対応バージョン | +|----------------------------------------------|-----------------------------------|----------------| | [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++20 | -| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | -| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | -| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | -| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | +| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | +| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|-------------------------------------------|------------------------------|----------------| +| [`iterator`](filter_view/iterator.md) | イテレータ型(説明専用) | C++20 | +| [`sentinel`](filter_view/sentinel.md) | 番兵型(説明専用) | C++20 | ## 推論補助 -| 名前 | 説明 | 対応バージョン | -|-------------------------------------------------------|------------------------------|----------------| -| [`(deduction_guide)`](filter_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++20 | +| 名前 | 説明 | 対応バージョン | +|----------------------------------------------------------|------------------------------|----------------| +| [`(deduction_guide)`](filter_view/op_deduction_guide.md) | クラステンプレートの推論補助 | C++20 | ## 例 ```cpp example @@ -119,6 +129,6 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 -- [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) +- [N4861 24.7.4 Filter view](https://timsong-cpp.github.io/cppwp/n4861/range.filter) - [C++20 ranges](https://techbookfest.org/product/5134506308665344) - [P2367R0 Remove misuses of list-initialization from Clause 24](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2367r0.html) (本提案文書はC++20に遡って適用されている) diff --git a/reference/ranges/filter_view/base.md b/reference/ranges/filter_view/base.md new file mode 100644 index 0000000000..d9f3dac03a --- /dev/null +++ b/reference/ranges/filter_view/base.md @@ -0,0 +1,70 @@ +# base +* ranges[meta header] +* std::ranges[meta namespace] +* filter_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr V base() const & requires copy_constructible; // (1) +constexpr V base() &&; // (2) +``` + +## 概要 + +メンバ変数として保持している、元の`view`を取得する。 + +## 効果 + +入力`view`(`V`)のオブジェクトを`base_`というメンバに保持するとして + +- (1) : `return base_;` と等しい +- (2) : `return std::move(base_);` と等しい + +## 例 + +```cpp example +#include +#include +#include + +int main() { + using std::ranges::view; + + std::vector vec = {1, 2, 3, 4, 5}; + + std::ranges::filter_view fv{vec, [](int i) { return i % 2 == 0; }}; + + // (1) コピーして取得 + view auto b1 = fv.base(); + + // (2) ムーブして取得 + view auto b2 = std::move(fv).base(); + + // 得られるのは元のRangeではなく、あくまでview + static_assert(not std::same_as>); + static_assert( std::same_as>>); + static_assert( std::same_as>>); +} +``` +* base[color ff0000] +* filter_view[link ../filter_view.md] + +### 出力 + +``` +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4861 24.7.4 Filter view](https://timsong-cpp.github.io/cppwp/n4861/range.filter) +- [N4950 26.7.8 Filter view](https://timsong-cpp.github.io/cppwp/n4950/range.filter) diff --git a/reference/ranges/filter_view/begin.md b/reference/ranges/filter_view/begin.md new file mode 100644 index 0000000000..b632457e5c --- /dev/null +++ b/reference/ranges/filter_view/begin.md @@ -0,0 +1,65 @@ +# begin +* ranges[meta header] +* std::ranges[meta namespace] +* filter_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr iterator begin(); +``` +* iterator[link iterator.md] + +## 概要 + +`view`の先頭要素を指すイテレータを取得する。 + +## 事前条件 + +`pred_.`[`has_value`](/reference/optional/optional/has_value.md)`()`が`true`であること。 + +## 戻り値 + +`{*this, `[`ranges​::​find_if`](/reference/algorithm/ranges_find_if.md)`(base_, `[`ref`](/reference/functional/ref.md)`(*pred_))}` + +[`range`](../range.md)のモデルとなるためにはこの関数が償却定数時間で実行できなければならないため、値はキャッシュされる。 + +## 例 + +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + std::ranges::filter_view fv{vec, [](int i) { return i % 2 == 0; }}; + + auto it = fv.begin(); + + std::cout << *it << '\n'; +} +``` +* begin[color ff0000] +* filter_view[link ../filter_view.md] + +### 出力 + +``` +2 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4861 24.7.4 Filter view](https://timsong-cpp.github.io/cppwp/n4861/range.filter) +- [N4950 26.7.8 Filter view](https://timsong-cpp.github.io/cppwp/n4950/range.filter) diff --git a/reference/ranges/filter_view/end.md b/reference/ranges/filter_view/end.md new file mode 100644 index 0000000000..bbb68419e3 --- /dev/null +++ b/reference/ranges/filter_view/end.md @@ -0,0 +1,64 @@ +# end +* ranges[meta header] +* std::ranges[meta namespace] +* filter_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr auto end() { + if constexpr (common_range) + return iterator{*this, ranges::end(base_)}; + else + return sentinel{*this}; +} +``` +* ranges::end[link ../end.md] +* iterator[link iterator.md] +* sentinel[link sentinel.md] + +## 概要 + +番兵を取得する。 + +## 例 + +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + std::ranges::filter_view fv{vec, [](int i) { return i % 2 == 0; }}; + + auto e = fv.end(); + + --e; + + std::cout << *e << '\n'; +} +``` +* end[color ff0000] +* filter_view[link ../filter_view.md] + +### 出力 + +``` +4 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4861 24.7.4 Filter view](https://timsong-cpp.github.io/cppwp/n4861/range.filter) +- [N4950 26.7.8 Filter view](https://timsong-cpp.github.io/cppwp/n4950/range.filter) diff --git a/reference/ranges/filter_view/iterator.md b/reference/ranges/filter_view/iterator.md new file mode 100644 index 0000000000..80f79e151e --- /dev/null +++ b/reference/ranges/filter_view/iterator.md @@ -0,0 +1,80 @@ +# iterator +* ranges[meta header] +* std::ranges[meta namespace] +* filter_view[meta class] +* class template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template> Pred> + requires view && is_object_v + class filter_view::iterator { …… }; +} +``` +* filter_view[link ../filter_view.md] + +## 概要 + +[`filter_view`](../filter_view.md)のイテレータ。 + +このクラスの名前は規定されておらず、振る舞いのみが規定されている。 + +このクラスの型を取得したい場合、[`iterator_t`](../iterator_t.md)を使用できる。 + +このイテレータを通じて値を書き換える場合、その結果が述語の条件を満たさない場合は未定義動作となる。 + +## メンバ変数 + +| 名前 | 説明 | 対応バージョン | +|--------------------------------------------------------------------|----------------------------|----------------| +| [`iterator_t`](../iterator_t.md)` current_ = iterator_t();` | 元のイテレータ(説明専用) | C++20 | +| [`filter_view`](../filter_view.md)`* parent_ = nullptr;` | 参照先のRange(説明専用) | C++20 | + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------------------------------------------------|--------------------------------|----------------| +| [`(constructor)`](iterator/op_constructor.md) | コンストラクタ | C++20 | +| [`base`](iterator/base.md) | 元のイテレータを取得する | C++20 | +| [`operator*`](iterator/op_deref.md) | 間接参照演算子 | C++20 | +| [`operator->`](iterator/op_arrow.md) | メンバアクセス演算子 | C++20 | +| [`operator++`](iterator/op_increment.md) | イテレータをインクリメントする | C++20 | +| [`operator--`](iterator/op_decrement.md) | イテレータをデクリメントする | C++20 | + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------------------------------------------------------|----------------------------------------------------------|----------------| +| [`iterator_concept`](iterator/iterator_concept.md.nolink) | イテレータコンセプト | C++20 | +| [`iterator_category`](iterator/iterator_category.md.nolink) | イテレータカテゴリ | C++20 | +| `value_type` | [`range_value_t`](../range_value_t.md) | C++20 | +| `difference_type` | [`range_difference_t`](../range_difference_t.md) | C++20 | + +## 非メンバ(*Hidden friends*)関数 + +| 名前 | 説明 | 対応バージョン | +|------------------------------------------|------------------------|----------------| +| [`iter_move`](iterator/iter_move.md.nolink) | イテレータの要素の移動 | C++20 | +| [`iter_swap`](iterator/iter_swap.md.nolink) | イテレータの要素の交換 | C++20 | + +### 比較演算子 + +| 名前 | 説明 | 対応バージョン | +|--------------------------------------|---------------------------------|----------------| +| [`operator==`](iterator/op_equal.md) | 等値比較 | C++20 | +| `operator!=` | 非等値比較 (`==`により使用可能) | C++20 | + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4861 24.7.4 Filter view](https://timsong-cpp.github.io/cppwp/n4861/range.filter) +- [N4950 26.7.8 Filter view](https://timsong-cpp.github.io/cppwp/n4950/range.filter) diff --git a/reference/ranges/filter_view/iterator/base.md b/reference/ranges/filter_view/iterator/base.md new file mode 100644 index 0000000000..1843f5f451 --- /dev/null +++ b/reference/ranges/filter_view/iterator/base.md @@ -0,0 +1,68 @@ +# base +* ranges[meta header] +* std::ranges[meta namespace] +* filter_view::iterator[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr const iterator_t base() const & noexcept; // (1) +constexpr iterator_t base() &&; // (2) +``` + +## 概要 + +元の`view`のイテレータを取得する。 + +## 効果 + +入力`view`(`V`)のイテレータを`current_`というメンバに保持するとして + +- (1) : `return current_;` と等しい +- (2) : `return std::move(current_);` と等しい + +## 例 + +```cpp example +#include +#include +#include + +int main() { + using std::ranges::view; + + std::vector vec = {1, 2, 3, 4, 5}; + + std::ranges::filter_view fv{vec, [](int i) { return i % 2 == 0; }}; + auto itr = fv.begin(); + + // (1) コピーして取得 + auto b1 = itr.base(); + + // (2) ムーブして取得 + auto b2 = std::move(itr).base(); + + static_assert(std::same_as::iterator>); + static_assert(std::same_as::iterator>); +} +``` +* base[color ff0000] + +### 出力 + +``` +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4861 24.7.4 Filter view](https://timsong-cpp.github.io/cppwp/n4861/range.filter) +- [N4950 26.7.8 Filter view](https://timsong-cpp.github.io/cppwp/n4950/range.filter) diff --git a/reference/ranges/filter_view/iterator/op_arrow.md b/reference/ranges/filter_view/iterator/op_arrow.md new file mode 100644 index 0000000000..9fce302f7e --- /dev/null +++ b/reference/ranges/filter_view/iterator/op_arrow.md @@ -0,0 +1,37 @@ +# operator-> +* ranges[meta header] +* std::ranges[meta namespace] +* filter_view::iterator[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr iterator_t operator->() const requires has-arrow> && copyable>; +``` +* copyable[link /reference/concepts/copyable.md] + +## 概要 + +イテレータを通じてオブジェクトにアクセスする。 + +## テンプレートパラメータ制約 + +元のイテレータがコピー可能であり、アロー演算子を持つこと。 + +## 効果 + +`return current_;` と等しい + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4861 24.7.4 Filter view](https://timsong-cpp.github.io/cppwp/n4861/range.filter) +- [N4950 26.7.8 Filter view](https://timsong-cpp.github.io/cppwp/n4950/range.filter) diff --git a/reference/ranges/filter_view/iterator/op_constructor.md b/reference/ranges/filter_view/iterator/op_constructor.md new file mode 100644 index 0000000000..1a84cc040f --- /dev/null +++ b/reference/ranges/filter_view/iterator/op_constructor.md @@ -0,0 +1,66 @@ +# コンストラクタ +* ranges[meta header] +* std::ranges[meta namespace] +* filter_view::iterator[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +iterator() requires default_initializable> = default; // (1) + +constexpr iterator(filter_view& parent, iterator_t current); // (2) +``` + +## 概要 + +[`filter_view::iterator`](../iterator.md)オブジェクトを構築する。 + +## 効果 + +- (1) : `current_`、`parent_`をデフォルト構築する +- (2) : `current_`を`std::move(current_)`で、`parent_`を[`addressof`](/reference/memory/addressof.md)`(parent_)`で初期化する + +## 例 +```cpp example +#include +#include + +int main() { + using std::ranges::filter_view; + using std::ranges::iterator_t; + + std::vector vec = {0, 1, 2, 3, 4, 5}; + + filter_view fv{vec, [](int x){ return x % 2 == 0; }}; + + iterator_t i(fv, vec.begin()); + + std::cout << *i << `\n`; + i++; + std::cout << *i << `\n`; + i++; + std::cout << *i << `\n`; +} +``` +* iterator_t[color ff0000] + +### 出力 +``` +0 +2 +4 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4861 24.7.4 Filter view](https://timsong-cpp.github.io/cppwp/n4861/range.filter) +- [N4950 26.7.8 Filter view](https://timsong-cpp.github.io/cppwp/n4950/range.filter) diff --git a/reference/ranges/filter_view/iterator/op_decrement.md b/reference/ranges/filter_view/iterator/op_decrement.md new file mode 100644 index 0000000000..c7405e6c77 --- /dev/null +++ b/reference/ranges/filter_view/iterator/op_decrement.md @@ -0,0 +1,81 @@ +# operator-- +* ranges[meta header] +* std::ranges[meta namespace] +* filter_view::iterator[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr iterator& operator++() requires bidirectional_range; // (1) +constexpr iterator operator--(int) requires bidirectional_range; // (2) +``` + +## 概要 + +イテレータを1つ進める。 + +## 効果 + +(1)は、 + +```cpp +do + --current_; +while (!invoke(*parent_->pred_, *current_)); +return *this; +``` +- invoke[link /reference/functional/invoke.md] + +と等しい。 + +(3)は、 +```cpp +auto tmp = *this; +--*this; +return tmp; +``` +と等しい。 + +## 例 +```cpp example +#include +#include + +int main() { + using std::ranges::filter_view; + using std::ranges::iterator_t; + + std::vector vec = {0, 1, 2, 3, 4, 5}; + + filter_view fv{vec, [](int x){ return x % 2 == 0; }}; + + iterator_t i(fv, vec.begin()); + + std::cout << *i << `\n`; + i--; + std::cout << *i << `\n`; + i--; + std::cout << *i << `\n`; +} +``` + +### 出力 +``` +0 +2 +4 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4861 24.7.4 Filter view](https://timsong-cpp.github.io/cppwp/n4861/range.filter) +- [N4950 26.7.8 Filter view](https://timsong-cpp.github.io/cppwp/n4950/range.filter) diff --git a/reference/ranges/filter_view/iterator/op_deref.md b/reference/ranges/filter_view/iterator/op_deref.md new file mode 100644 index 0000000000..22bf342e63 --- /dev/null +++ b/reference/ranges/filter_view/iterator/op_deref.md @@ -0,0 +1,62 @@ +# operator* +* ranges[meta header] +* std::ranges[meta namespace] +* filter_view::iterator[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr range_reference_t operator*() const; +``` + +## 概要 + +イテレータを間接参照する。 + +## 効果 + +`return *current_;` と等しい + +## 例 +```cpp example +#include +#include + +int main() { + using std::ranges::filter_view; + using std::ranges::iterator_t; + + std::vector vec = {0, 1, 2, 3, 4, 5}; + + filter_view fv{vec, [](int x){ return x % 2 == 0; }}; + + iterator_t i(fv, vec.begin()); + + std::cout << *i << `\n`; + i++; + std::cout << *i << `\n`; + i++; + std::cout << *i << `\n`; +} +``` + +### 出力 +``` +0 +2 +4 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4861 24.7.4 Filter view](https://timsong-cpp.github.io/cppwp/n4861/range.filter) +- [N4950 26.7.8 Filter view](https://timsong-cpp.github.io/cppwp/n4950/range.filter) diff --git a/reference/ranges/filter_view/iterator/op_equal.md b/reference/ranges/filter_view/iterator/op_equal.md new file mode 100644 index 0000000000..4aceb41814 --- /dev/null +++ b/reference/ranges/filter_view/iterator/op_equal.md @@ -0,0 +1,48 @@ +# operator== +* iterator[meta header] +* std[meta namespace] +* filter_view::iterator[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +friend constexpr bool operator==(const iterator& x, const iterator& y) requires equality_comparable>; +``` +* iterator[link ../iterator.md] + +## 概要 + +自身と別のイテレータが同じ要素を指しているかを判定する。 + +## 効果 + +ラップしているイテレータを`current_`メンバ変数に保持するとして、以下と等価 + +```cpp +return x.current_ == y.current_; +``` + +## 戻り値 + +元のビューの2つのイテレータが等しい場合に`true`を返す。 + +## 備考 + +- この演算子により `!=` 演算子が使用可能になる。 + +## 例 +(執筆中) + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4861 24.7.4 Filter view](https://timsong-cpp.github.io/cppwp/n4861/range.filter) +- [N4950 26.7.8 Filter view](https://timsong-cpp.github.io/cppwp/n4950/range.filter) diff --git a/reference/ranges/filter_view/iterator/op_increment.md b/reference/ranges/filter_view/iterator/op_increment.md new file mode 100644 index 0000000000..c217c2883a --- /dev/null +++ b/reference/ranges/filter_view/iterator/op_increment.md @@ -0,0 +1,87 @@ +# operator++ +* ranges[meta header] +* std::ranges[meta namespace] +* filter_view::iterator[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr iterator& operator++(); // (1) +constexpr void operator++(int); // (2) +constexpr iterator operator++(int) requires forward_range; // (3) +``` + +## 概要 + +イテレータを1つ進める。 + +## 効果 + +(1)は、 + +```cpp +current_ = ranges::find_if( + std::move(++current_), + ranges::end(parent_->base_), + ref(*parent_->pred_)); +return *this; +``` +- ranges::find_if[link /reference/algorithm/ranges_find_if.md] +- ranges::end[link /reference/ranges/end.md] +- ref[link /reference/functional/ref.md] + +と等しい。 + +(2)は、`++*this` と等しい。 + +(3)は、 +```cpp +auto tmp = *this; +++*this; +return tmp; +``` +と等しい。 + +## 例 +```cpp example +#include +#include + +int main() { + using std::ranges::filter_view; + using std::ranges::iterator_t; + + std::vector vec = {0, 1, 2, 3, 4, 5}; + + filter_view fv{vec, [](int x){ return x % 2 == 0; }}; + + iterator_t i(fv, vec.begin()); + + std::cout << *i << `\n`; + i++; + std::cout << *i << `\n`; + i++; + std::cout << *i << `\n`; +} +``` + +### 出力 +``` +0 +2 +4 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4861 24.7.4 Filter view](https://timsong-cpp.github.io/cppwp/n4861/range.filter) +- [N4950 26.7.8 Filter view](https://timsong-cpp.github.io/cppwp/n4950/range.filter) diff --git a/reference/ranges/filter_view/op_constructor.md b/reference/ranges/filter_view/op_constructor.md new file mode 100644 index 0000000000..f3c4002a54 --- /dev/null +++ b/reference/ranges/filter_view/op_constructor.md @@ -0,0 +1,58 @@ +# コンストラクタ +* ranges[meta header] +* std::ranges[meta namespace] +* filter_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +filter_view() requires default_initializable && default_initializable = default; // (1) + +constexpr explicit filter_view(V base, Pred pred); // (2) +``` + +## 概要 + +[`filter_view`](../filter_view.md)オブジェクトを構築する。 + +## 効果 + +- (1) : `base_`、`pred_`をデフォルト構築する +- (2) : `base_`を`std::move(base)`で、`pred_`を`std::move(pred)`で初期化する + +## 例 +```cpp example +#include +#include + +int main() { + using std::ranges::filter_view; + + std::vector vec = {1, 2, 3, 4, 5}; + + // (1) デフォルト構築 + filter_view>, bool(*)(int)> v1{}; + + // (2) viewを入力して構築 + filter_view v2{vec, [](int x){ return x % 2 == 0; }}; +} +``` +* filter_view[color ff0000] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4861 24.7.4 Filter view](https://timsong-cpp.github.io/cppwp/n4861/range.filter) +- [N4950 26.7.8 Filter view](https://timsong-cpp.github.io/cppwp/n4950/range.filter) diff --git a/reference/ranges/filter_view/op_deduction_guide.md b/reference/ranges/filter_view/op_deduction_guide.md new file mode 100644 index 0000000000..2c8de43f09 --- /dev/null +++ b/reference/ranges/filter_view/op_deduction_guide.md @@ -0,0 +1,67 @@ +# 推論補助 +* ranges[meta header] +* std::ranges[meta namespace] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +namespace std::ranges { + template + filter_view(R&&, Pred) -> filter_view, Pred>; +} +``` +* filter_view[link ../filter_view.md] + +## 概要 + +[`filter_view`](../filter_view.md)クラステンプレートの型推論補助。 + +この推論補助によって、元のRangeが暗黙的に[all view](../all.md)でラップされる。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4}; + + auto pred = [](int i) { return i % 2 == 0; }; + + std::ranges::filter_view v1{vec, pred}; + + static_assert(std::same_as< + decltype(v1), + std::ranges::filter_view>> + >); + + std::ranges::filter_view v2{std::vector{1, 2}, pred}; + + static_assert(std::same_as< + decltype(v2), + std::ranges::filter_view>> + >); +} +``` +* ref_view[link /reference/ranges/ref_view.md] +* owning_view[link /reference/ranges/owning_view.md] +* filter_view[link ../filter_view.md] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4861 24.7.4 Filter view](https://timsong-cpp.github.io/cppwp/n4861/range.filter) +- [N4950 26.7.8 Filter view](https://timsong-cpp.github.io/cppwp/n4950/range.filter) diff --git a/reference/ranges/filter_view/pred.md b/reference/ranges/filter_view/pred.md new file mode 100644 index 0000000000..6d3978c28a --- /dev/null +++ b/reference/ranges/filter_view/pred.md @@ -0,0 +1,62 @@ +# pred +* ranges[meta header] +* std::ranges[meta namespace] +* filter_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr const Pred& pred() const; +``` + +## 概要 + +メンバ変数として保持している述語を取得する。 + +## 戻り値 + +述語`Pred`のオブジェクトを[`movable-box`](../movable_box.md)(C++20は[`copyable-box`](../copyable_box.md))でラップした `pred_`というメンバに保持するとして + +```cpp +return *pred_; +``` + +## 例 + +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + std::ranges::filter_view fv{vec, [](int i) { return i % 2 == 0; }}; + + std::cout << fv.pred()(2) << '\n'; + std::cout << fv.pred()(3) << '\n'; +} +``` +* pred[color ff0000] +* filter_view[link ../filter_view.md] + +### 出力 + +``` +2 +3 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4861 24.7.4 Filter view](https://timsong-cpp.github.io/cppwp/n4861/range.filter) +- [N4950 26.7.8 Filter view](https://timsong-cpp.github.io/cppwp/n4950/range.filter) diff --git a/reference/ranges/filter_view/sentinel.md b/reference/ranges/filter_view/sentinel.md new file mode 100644 index 0000000000..6cbf942928 --- /dev/null +++ b/reference/ranges/filter_view/sentinel.md @@ -0,0 +1,59 @@ +# sentinel +* ranges[meta header] +* std::ranges[meta namespace] +* filter_view[meta class] +* class template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template> Pred> + requires view && is_object_v + class filter_view::sentinel { …… }; +} +``` +* filter_view[link ../filter_view.md] + +## 概要 + +[`filter_view`](../filter_view.md)が[`common_range`](../common_range.md)でない場合のみ使用される番兵。 + +このクラスの名前は規定されておらず、振る舞いのみが規定されている。 + +このクラスの型を取得したい場合、[`sentinel_t`](../sentinel_t.md)を使用できる。 + +## メンバ変数 + +| 名前 | 説明 | 対応バージョン | +|--------------------------------------------------------------------|----------------------------|----------------| +| [`sentinel_t`](../sentinel_t.md)` end_ = sentinel_t();` | 元の番兵(説明専用) | C++20 | + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------------------------------------------------|----------------------|----------------| +| [`(constructor)`](sentinel/op_constructor.md) | コンストラクタ | C++20 | +| [`base`](sentinel/base.md) | 元の番兵を取得する | C++20 | + +## 非メンバ(*Hidden friends*)関数 + +### 比較演算子 + +| 名前 | 説明 | 対応バージョン | +|--------------------------------------|---------------------------------|----------------| +| [`operator==`](sentinel/op_equal.md) | 等値比較 | C++20 | +| `operator!=` | 非等値比較 (`==`により使用可能) | C++20 | + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4861 24.7.4 Filter view](https://timsong-cpp.github.io/cppwp/n4861/range.filter) +- [N4950 26.7.8 Filter view](https://timsong-cpp.github.io/cppwp/n4950/range.filter) diff --git a/reference/ranges/filter_view/sentinel/base.md b/reference/ranges/filter_view/sentinel/base.md new file mode 100644 index 0000000000..10a6aebe86 --- /dev/null +++ b/reference/ranges/filter_view/sentinel/base.md @@ -0,0 +1,35 @@ +# base +* ranges[meta header] +* std::ranges[meta namespace] +* filter_view::sentinel[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr const sentinel_t base() const; +``` + +## 概要 + +元の`view`の番兵を取得する。 + +## 効果 + +入力`view`(`V`)の番兵を`end_`というメンバに保持するとして、`return end_;` と等しい + +## 例 +(執筆中) + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4861 24.7.4 Filter view](https://timsong-cpp.github.io/cppwp/n4861/range.filter) +- [N4950 26.7.8 Filter view](https://timsong-cpp.github.io/cppwp/n4950/range.filter) diff --git a/reference/ranges/filter_view/sentinel/op_constructor.md b/reference/ranges/filter_view/sentinel/op_constructor.md new file mode 100644 index 0000000000..c320f1d1d6 --- /dev/null +++ b/reference/ranges/filter_view/sentinel/op_constructor.md @@ -0,0 +1,37 @@ +# コンストラクタ +* ranges[meta header] +* std::ranges[meta namespace] +* filter_view::sentinel[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +sentinel() = default; // (1) +constexpr explicit sentinel(filter_view& parent); // (2) +``` + +## 概要 + +[`filter_view::sentinel`](../sentinel.md)オブジェクトを構築する。 + +## 効果 + +- (1) : `end_`をデフォルト構築する +- (2) : `end_`を[`std::ranges::end`](../../end.md)`(parent.base_)`で初期化する + +## 例 +(執筆中) + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4861 24.7.4 Filter view](https://timsong-cpp.github.io/cppwp/n4861/range.filter) +- [N4950 26.7.8 Filter view](https://timsong-cpp.github.io/cppwp/n4950/range.filter) diff --git a/reference/ranges/filter_view/sentinel/op_equal.md b/reference/ranges/filter_view/sentinel/op_equal.md new file mode 100644 index 0000000000..a5f8ce27f1 --- /dev/null +++ b/reference/ranges/filter_view/sentinel/op_equal.md @@ -0,0 +1,49 @@ +# operator== +* sentinel[meta header] +* std[meta namespace] +* filter_view::sentinel[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +friend constexpr bool operator==(const iterator& x, const sentinel& y); +``` +* iterator[link ../iterator.md] +* sentinel[link ../sentinel.md] + +## 概要 + +自身と別のイテレータが同じかを判定する。 + +## 効果 + +ラップしている番兵を`end_`メンバ変数に保持するとして、以下と等価 + +```cpp +return x.current_ == y.end_; +``` + +## 戻り値 + +元のビューのイテレータと番兵が等しい場合に`true`を返す。 + +## 備考 + +- この演算子により逆順の `==` 演算子と、それぞれに対応する `!=` 演算子が使用可能になる。 + +## 例 +(執筆中) + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4861 24.7.4 Filter view](https://timsong-cpp.github.io/cppwp/n4861/range.filter) +- [N4950 26.7.8 Filter view](https://timsong-cpp.github.io/cppwp/n4950/range.filter) From 1feb8ee50a9a13b4d4f5db3dfbee8bcc220e6fda Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 29 Aug 2024 12:58:10 +0900 Subject: [PATCH 1163/3948] =?UTF-8?q?=E5=AE=9A=E7=BE=A9=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=81=9F=E7=94=A8=E8=AA=9E=E3=81=AE=E6=84=8F=E5=9B=B3=E3=81=97?= =?UTF-8?q?=E3=81=AA=E3=81=84=E4=BD=BF=E7=94=A8=E6=96=B9=E6=B3=95=E3=82=92?= =?UTF-8?q?=E6=A4=9C=E5=87=BA=E3=81=99=E3=82=8B=E3=82=B9=E3=82=AF=E3=83=AA?= =?UTF-8?q?=E3=83=97=E3=83=88=E3=82=92=E8=BF=BD=E5=8A=A0=20#1347?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/defined_word_check.yml | 19 ++++++ .../workflows/script/defined_word_check.py | 68 +++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 .github/workflows/defined_word_check.yml create mode 100644 .github/workflows/script/defined_word_check.py diff --git a/.github/workflows/defined_word_check.yml b/.github/workflows/defined_word_check.yml new file mode 100644 index 0000000000..0ca06f2ddf --- /dev/null +++ b/.github/workflows/defined_word_check.yml @@ -0,0 +1,19 @@ +name: defined word check + +on: [push, pull_request, workflow_dispatch] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install requests + - uses: actions/checkout@v4 + - name: check + run: python3 .github/workflows/script/defined_word_check.py diff --git a/.github/workflows/script/defined_word_check.py b/.github/workflows/script/defined_word_check.py new file mode 100644 index 0000000000..7183731f45 --- /dev/null +++ b/.github/workflows/script/defined_word_check.py @@ -0,0 +1,68 @@ +# 定義された用語の意図しない使用を検出する + +import glob +import os +import sys +import re + +DEFINED_WORD_LIST = [ + # 先頭はターゲット用語、それ以外はその用語の許可された使用方法 + ["未定義", "未定義動作", "未定義の動作", "動作は未定義", "挙動は未定義", "振る舞いは未定義"], +] + +def check_defined_word(text: str, filename: str) -> bool: + found_error: bool = False + + for words in DEFINED_WORD_LIST: + word = words[0] + allow_list = words[1:] + + match_list = [m.start() for m in re.finditer(word, text)] + if len(match_list) == 0: + continue + + for i in match_list: + ok_count = 0 + for allow_word in allow_list: + index = allow_word.find(word) + n = len(allow_word) + + if i - index < 0: + continue + + j = i - index + sliced = text[j:j+n] + if sliced == allow_word: + ok_count += 1 + + if ok_count == 0: + start = text.rfind('\n', 0, i) + if start < 0: + start = 0 + else: + start = start + 1 + + end = text.find('\n', i) + if end < 0: + end = start + 20 + + around_word = text[start:end] + print("{}: the file includes unintended word use \"{}\". Around the word:\"{}\"".format(filename, word, around_word)) + found_error = True + + return not found_error + +if __name__ == '__main__': + found_error = False + for p in sorted(list(glob.glob("**/*.md", recursive=True))): + if p.startswith("start_editing/"): + continue + + with open(p) as f: + text = f.read() + + if not check_defined_word(text, p): + found_error = True + + if found_error: + sys.exit(1) From a1e09e8e49e998e94271e44927b3e5aafe1c8b8a Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 29 Aug 2024 13:09:29 +0900 Subject: [PATCH 1164/3948] =?UTF-8?q?=E3=80=8C=E5=8A=B9=E6=9E=9C=E3=81=AF?= =?UTF-8?q?=E6=9C=AA=E5=AE=9A=E7=BE=A9=E3=80=8D=E3=82=92=E3=80=8C=E5=8B=95?= =?UTF-8?q?=E4=BD=9C=E3=81=AF=E6=9C=AA=E5=AE=9A=E7=BE=A9=E3=80=8D=E3=81=AB?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20#1348?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/array/array/back.md | 2 +- reference/array/array/front.md | 2 +- reference/list/list/merge.md | 2 +- reference/list/list/splice.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/array/array/back.md b/reference/array/array/back.md index 1e39e0bfb9..270e01cf27 100644 --- a/reference/array/array/back.md +++ b/reference/array/array/back.md @@ -21,7 +21,7 @@ constexpr const_reference back() const; // (2) C++14 `a.back()`は末尾の要素への参照を返す。もし、`a`が`const`だった場合には、末尾の要素への`const`参照を返す。`a.back()` は`{ auto tmp = a.end(); --tmp; return *tmp; }` と同じ結果になる。 ## 備考 -要素数が0の場合(`N == 0`の場合)、この関数呼び出しの効果は未定義である。 +要素数が0の場合(`N == 0`の場合)、動作は未定義である。 ## 例 diff --git a/reference/array/array/front.md b/reference/array/array/front.md index a980a10486..6cc0b68834 100644 --- a/reference/array/array/front.md +++ b/reference/array/array/front.md @@ -23,7 +23,7 @@ constexpr const_reference front() const; // (2) C++14 ## 備考 `a.front()` と `*a.begin()` は同じ結果になる。 -要素数が0の場合(`N == 0`の場合)、この関数呼び出しの効果は未定義である。 +要素数が0の場合(`N == 0`の場合)、動作は未定義である。 ## 例 diff --git a/reference/list/list/merge.md b/reference/list/list/merge.md index e57a5864a9..6f60bb6480 100644 --- a/reference/list/list/merge.md +++ b/reference/list/list/merge.md @@ -38,7 +38,7 @@ template void merge(list&& x, Compare comp); // (4) C++11 ## 備考 - この操作は安定である。 -- 移動先と移動元のアロケータが等値でない場合(`get_allocator() != x.get_allocator()`の場合)、この関数呼び出しの効果は未定義である。 +- 移動先と移動元のアロケータが等値でない場合(`get_allocator() != x.get_allocator()`の場合)、動作は未定義である。 ## 例 diff --git a/reference/list/list/splice.md b/reference/list/list/splice.md index 137fffa8c9..a04fcd5073 100644 --- a/reference/list/list/splice.md +++ b/reference/list/list/splice.md @@ -67,7 +67,7 @@ void splice(const_iterator position, list&& x, - (1), (2) : C++03の場合、移動元の`list`オブジェクト`x`は、全てのイテレータと参照が無効になる。C++11以降は、無効にならない。 - (3), (4) : C++03の場合、移動元の要素を指すイテレータ`i`は、そのイテレータおよび参照が無効になる。C++11以降は、無効にならない。 - (5), (6) : C++03の場合、移動元のイテレータ範囲`[first, last)`は、その範囲のイテレータおよび参照が無効になる。C++11以降は、無効にならない。 -- 移動先と移動元のアロケータが等値でない場合(`get_allocator() != x.get_allocator()`の場合)、この関数呼び出しの効果は未定義である。 +- 移動先と移動元のアロケータが等値でない場合(`get_allocator() != x.get_allocator()`の場合)、動作は未定義である。 ## 例 From 256375f89df7bc449ad8b8750c2ae1aeded803dc Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Thu, 29 Aug 2024 22:14:41 +0900 Subject: [PATCH 1165/3948] =?UTF-8?q?=E7=A6=81=E6=AD=A2=E6=96=87=E5=AD=97?= =?UTF-8?q?=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/filter_view/begin.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/ranges/filter_view/begin.md b/reference/ranges/filter_view/begin.md index b632457e5c..37761a1b9d 100644 --- a/reference/ranges/filter_view/begin.md +++ b/reference/ranges/filter_view/begin.md @@ -20,7 +20,7 @@ constexpr iterator begin(); ## 戻り値 -`{*this, `[`ranges​::​find_if`](/reference/algorithm/ranges_find_if.md)`(base_, `[`ref`](/reference/functional/ref.md)`(*pred_))}` +`{*this, `[`ranges::find_if`](/reference/algorithm/ranges_find_if.md)`(base_, `[`ref`](/reference/functional/ref.md)`(*pred_))}` [`range`](../range.md)のモデルとなるためにはこの関数が償却定数時間で実行できなければならないため、値はキャッシュされる。 From 04b953e1545eb4bc7bf063b5791986edddb9dcb9 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Thu, 29 Aug 2024 22:16:19 +0900 Subject: [PATCH 1166/3948] =?UTF-8?q?meta=20header=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/filter_view/iterator/op_equal.md | 2 +- reference/ranges/filter_view/sentinel/op_equal.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/ranges/filter_view/iterator/op_equal.md b/reference/ranges/filter_view/iterator/op_equal.md index 4aceb41814..25fbc41940 100644 --- a/reference/ranges/filter_view/iterator/op_equal.md +++ b/reference/ranges/filter_view/iterator/op_equal.md @@ -1,5 +1,5 @@ # operator== -* iterator[meta header] +* ranges[meta header] * std[meta namespace] * filter_view::iterator[meta class] * function[meta id-type] diff --git a/reference/ranges/filter_view/sentinel/op_equal.md b/reference/ranges/filter_view/sentinel/op_equal.md index a5f8ce27f1..f62b87ca49 100644 --- a/reference/ranges/filter_view/sentinel/op_equal.md +++ b/reference/ranges/filter_view/sentinel/op_equal.md @@ -1,5 +1,5 @@ # operator== -* sentinel[meta header] +* ranges[meta header] * std[meta namespace] * filter_view::sentinel[meta class] * function[meta id-type] From 075f072caad0fa47ff97c3cc1b7d666a0ccc7b9e Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Thu, 29 Aug 2024 22:31:34 +0900 Subject: [PATCH 1167/3948] =?UTF-8?q?namespace=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/filter_view/iterator/op_equal.md | 2 +- reference/ranges/filter_view/sentinel/op_equal.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/ranges/filter_view/iterator/op_equal.md b/reference/ranges/filter_view/iterator/op_equal.md index 25fbc41940..c5bc092216 100644 --- a/reference/ranges/filter_view/iterator/op_equal.md +++ b/reference/ranges/filter_view/iterator/op_equal.md @@ -1,6 +1,6 @@ # operator== * ranges[meta header] -* std[meta namespace] +* std::ranges[meta namespace] * filter_view::iterator[meta class] * function[meta id-type] * cpp20[meta cpp] diff --git a/reference/ranges/filter_view/sentinel/op_equal.md b/reference/ranges/filter_view/sentinel/op_equal.md index f62b87ca49..0176ae6383 100644 --- a/reference/ranges/filter_view/sentinel/op_equal.md +++ b/reference/ranges/filter_view/sentinel/op_equal.md @@ -1,6 +1,6 @@ # operator== * ranges[meta header] -* std[meta namespace] +* std::ranges[meta namespace] * filter_view::sentinel[meta class] * function[meta id-type] * cpp20[meta cpp] From 37b7a435fd26681ab238b100df00a90daba5361f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 30 Aug 2024 13:13:35 +0900 Subject: [PATCH 1168/3948] =?UTF-8?q?=E7=94=A8=E8=AA=9E=E7=B5=B1=E4=B8=80?= =?UTF-8?q?=20:=20=E3=80=8C=E6=8C=99=E5=8B=95=E3=81=AF=E6=9C=AA=E5=AE=9A?= =?UTF-8?q?=E7=BE=A9=E3=80=8D=20=E2=86=92=20=E3=80=8C=E6=9C=AA=E5=AE=9A?= =?UTF-8?q?=E7=BE=A9=E5=8B=95=E4=BD=9C=E3=81=A8=E3=81=AA=E3=82=8B=E3=80=8D?= =?UTF-8?q?=20#1348?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/script/defined_word_check.py | 2 +- reference/ios/fpos.md | 2 +- reference/valarray/gslice_array/op_and_assign.md | 2 +- reference/valarray/gslice_array/op_assign.md | 2 +- reference/valarray/gslice_array/op_divide_assign.md | 2 +- reference/valarray/gslice_array/op_left_shift_assign.md | 2 +- reference/valarray/gslice_array/op_minus_assign.md | 2 +- reference/valarray/gslice_array/op_modulo_assign.md | 2 +- reference/valarray/gslice_array/op_multiply_assign.md | 2 +- reference/valarray/gslice_array/op_or_assign.md | 2 +- reference/valarray/gslice_array/op_plus_assign.md | 2 +- reference/valarray/gslice_array/op_right_shift_assign.md | 2 +- reference/valarray/gslice_array/op_xor_assign.md | 2 +- reference/valarray/indirect_array/op_and_assign.md | 2 +- reference/valarray/indirect_array/op_assign.md | 2 +- reference/valarray/indirect_array/op_divide_assign.md | 2 +- reference/valarray/indirect_array/op_left_shift_assign.md | 2 +- reference/valarray/indirect_array/op_minus_assign.md | 2 +- reference/valarray/indirect_array/op_modulo_assign.md | 2 +- reference/valarray/indirect_array/op_multiply_assign.md | 2 +- reference/valarray/indirect_array/op_or_assign.md | 2 +- reference/valarray/indirect_array/op_plus_assign.md | 2 +- reference/valarray/indirect_array/op_right_shift_assign.md | 2 +- reference/valarray/indirect_array/op_xor_assign.md | 2 +- reference/valarray/mask_array/op_and_assign.md | 2 +- reference/valarray/mask_array/op_assign.md | 2 +- reference/valarray/mask_array/op_divide_assign.md | 2 +- reference/valarray/mask_array/op_left_shift_assign.md | 2 +- reference/valarray/mask_array/op_minus_assign.md | 2 +- reference/valarray/mask_array/op_modulo_assign.md | 2 +- reference/valarray/mask_array/op_multiply_assign.md | 2 +- reference/valarray/mask_array/op_or_assign.md | 2 +- reference/valarray/mask_array/op_plus_assign.md | 2 +- reference/valarray/mask_array/op_right_shift_assign.md | 2 +- reference/valarray/mask_array/op_xor_assign.md | 2 +- reference/valarray/slice_array/op_and_assign.md | 2 +- reference/valarray/slice_array/op_assign.md | 2 +- reference/valarray/slice_array/op_divide_assign.md | 2 +- reference/valarray/slice_array/op_left_shift_assign.md | 2 +- reference/valarray/slice_array/op_minus_assign.md | 2 +- reference/valarray/slice_array/op_modulo_assign.md | 2 +- reference/valarray/slice_array/op_multiply_assign.md | 2 +- reference/valarray/slice_array/op_or_assign.md | 2 +- reference/valarray/slice_array/op_plus_assign.md | 2 +- reference/valarray/slice_array/op_right_shift_assign.md | 2 +- reference/valarray/slice_array/op_xor_assign.md | 2 +- reference/valarray/valarray/atan2.md | 2 +- reference/valarray/valarray/max.md | 2 +- reference/valarray/valarray/min.md | 2 +- reference/valarray/valarray/op_and.md | 2 +- reference/valarray/valarray/op_and_assign.md | 2 +- reference/valarray/valarray/op_at.md | 4 ++-- reference/valarray/valarray/op_constructor.md | 2 +- reference/valarray/valarray/op_divide.md | 2 +- reference/valarray/valarray/op_divide_assign.md | 2 +- reference/valarray/valarray/op_equal.md | 2 +- reference/valarray/valarray/op_greater.md | 2 +- reference/valarray/valarray/op_greater_equal.md | 2 +- reference/valarray/valarray/op_left_shift.md | 2 +- reference/valarray/valarray/op_left_shift_assign.md | 2 +- reference/valarray/valarray/op_less.md | 2 +- reference/valarray/valarray/op_less_equal.md | 2 +- reference/valarray/valarray/op_logical_and.md | 2 +- reference/valarray/valarray/op_logical_or.md | 2 +- reference/valarray/valarray/op_minus.md | 2 +- reference/valarray/valarray/op_minus_assign.md | 2 +- reference/valarray/valarray/op_modulo.md | 2 +- reference/valarray/valarray/op_modulo_assign.md | 2 +- reference/valarray/valarray/op_multiply.md | 2 +- reference/valarray/valarray/op_multiply_assign.md | 2 +- reference/valarray/valarray/op_not_equal.md | 2 +- reference/valarray/valarray/op_or.md | 2 +- reference/valarray/valarray/op_or_assign.md | 2 +- reference/valarray/valarray/op_plus.md | 2 +- reference/valarray/valarray/op_plus_assign.md | 2 +- reference/valarray/valarray/op_right_shift.md | 2 +- reference/valarray/valarray/op_right_shift_assign.md | 2 +- reference/valarray/valarray/op_xor.md | 2 +- reference/valarray/valarray/op_xor_assign.md | 2 +- reference/valarray/valarray/pow.md | 2 +- reference/valarray/valarray/sum.md | 2 +- 81 files changed, 82 insertions(+), 82 deletions(-) diff --git a/.github/workflows/script/defined_word_check.py b/.github/workflows/script/defined_word_check.py index 7183731f45..3b1125de45 100644 --- a/.github/workflows/script/defined_word_check.py +++ b/.github/workflows/script/defined_word_check.py @@ -7,7 +7,7 @@ DEFINED_WORD_LIST = [ # 先頭はターゲット用語、それ以外はその用語の許可された使用方法 - ["未定義", "未定義動作", "未定義の動作", "動作は未定義", "挙動は未定義", "振る舞いは未定義"], + ["未定義", "未定義動作", "未定義の動作", "動作は未定義", "挙動は未定義", "振る舞いは未定義", "未定義の振る舞い"], ] def check_defined_word(text: str, filename: str) -> bool: diff --git a/reference/ios/fpos.md b/reference/ios/fpos.md index 405b96c83b..59bab0dd7b 100644 --- a/reference/ios/fpos.md +++ b/reference/ios/fpos.md @@ -63,4 +63,4 @@ using u32streampos = fpos::state_type>; なお、`P(O(-1))`はエラー値である。`basic_istream`/`basic_ostream`/`basic_streambuf`では以下のように扱われる。 - 戻り値としてこの値が返されれば、操作の失敗を表す。 -- 引数としてこの値が渡された場合、挙動は未定義となる。 +- 引数としてこの値が渡された場合、未定義動作となる。 diff --git a/reference/valarray/gslice_array/op_and_assign.md b/reference/valarray/gslice_array/op_and_assign.md index c16e0cdc29..712ffeca39 100644 --- a/reference/valarray/gslice_array/op_and_assign.md +++ b/reference/valarray/gslice_array/op_and_assign.md @@ -24,7 +24,7 @@ void operator&=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/gslice_array/op_assign.md b/reference/valarray/gslice_array/op_assign.md index 8956c508d2..e7265bc01a 100644 --- a/reference/valarray/gslice_array/op_assign.md +++ b/reference/valarray/gslice_array/op_assign.md @@ -34,7 +34,7 @@ public: - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 - (1) : C++03まで、このオーバーロードは使用できなかった。 -- [`valarray`](../valarray.md) から抽出した要素数と `ar` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `ar` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/gslice_array/op_divide_assign.md b/reference/valarray/gslice_array/op_divide_assign.md index 25e661c61d..8c1844c8e4 100644 --- a/reference/valarray/gslice_array/op_divide_assign.md +++ b/reference/valarray/gslice_array/op_divide_assign.md @@ -24,7 +24,7 @@ void operator/=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/gslice_array/op_left_shift_assign.md b/reference/valarray/gslice_array/op_left_shift_assign.md index 6f8a6ba807..5238221794 100644 --- a/reference/valarray/gslice_array/op_left_shift_assign.md +++ b/reference/valarray/gslice_array/op_left_shift_assign.md @@ -24,7 +24,7 @@ void operator<<=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/gslice_array/op_minus_assign.md b/reference/valarray/gslice_array/op_minus_assign.md index db6649ed9e..3b8e79b353 100644 --- a/reference/valarray/gslice_array/op_minus_assign.md +++ b/reference/valarray/gslice_array/op_minus_assign.md @@ -24,7 +24,7 @@ void operator-=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 diff --git a/reference/valarray/gslice_array/op_modulo_assign.md b/reference/valarray/gslice_array/op_modulo_assign.md index c651381f10..88378fd162 100644 --- a/reference/valarray/gslice_array/op_modulo_assign.md +++ b/reference/valarray/gslice_array/op_modulo_assign.md @@ -24,7 +24,7 @@ void operator%=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/gslice_array/op_multiply_assign.md b/reference/valarray/gslice_array/op_multiply_assign.md index 0520146af8..8e9a39d77e 100644 --- a/reference/valarray/gslice_array/op_multiply_assign.md +++ b/reference/valarray/gslice_array/op_multiply_assign.md @@ -24,7 +24,7 @@ void operator*=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/gslice_array/op_or_assign.md b/reference/valarray/gslice_array/op_or_assign.md index ebf23be14b..6baab70ddb 100644 --- a/reference/valarray/gslice_array/op_or_assign.md +++ b/reference/valarray/gslice_array/op_or_assign.md @@ -24,7 +24,7 @@ void operator|=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/gslice_array/op_plus_assign.md b/reference/valarray/gslice_array/op_plus_assign.md index 08712a3e57..a2556e35b8 100644 --- a/reference/valarray/gslice_array/op_plus_assign.md +++ b/reference/valarray/gslice_array/op_plus_assign.md @@ -24,7 +24,7 @@ void operator+=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/gslice_array/op_right_shift_assign.md b/reference/valarray/gslice_array/op_right_shift_assign.md index 56e1bb5c01..1a7c5d74d9 100644 --- a/reference/valarray/gslice_array/op_right_shift_assign.md +++ b/reference/valarray/gslice_array/op_right_shift_assign.md @@ -24,7 +24,7 @@ void operator>>=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/gslice_array/op_xor_assign.md b/reference/valarray/gslice_array/op_xor_assign.md index 5073075cf5..75c01743d7 100644 --- a/reference/valarray/gslice_array/op_xor_assign.md +++ b/reference/valarray/gslice_array/op_xor_assign.md @@ -24,7 +24,7 @@ void operator^=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/indirect_array/op_and_assign.md b/reference/valarray/indirect_array/op_and_assign.md index 79d646b825..331231e021 100644 --- a/reference/valarray/indirect_array/op_and_assign.md +++ b/reference/valarray/indirect_array/op_and_assign.md @@ -24,7 +24,7 @@ void operator&=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/indirect_array/op_assign.md b/reference/valarray/indirect_array/op_assign.md index 46d1556cad..dec2d0e97d 100644 --- a/reference/valarray/indirect_array/op_assign.md +++ b/reference/valarray/indirect_array/op_assign.md @@ -33,7 +33,7 @@ public: - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 - (1) : C++03まで、このオーバーロードは使用できなかった。 -- [`valarray`](../valarray.md) から抽出した要素数と `ar` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `ar` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/indirect_array/op_divide_assign.md b/reference/valarray/indirect_array/op_divide_assign.md index 944af8ba77..57f5d33b91 100644 --- a/reference/valarray/indirect_array/op_divide_assign.md +++ b/reference/valarray/indirect_array/op_divide_assign.md @@ -24,7 +24,7 @@ void operator/=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/indirect_array/op_left_shift_assign.md b/reference/valarray/indirect_array/op_left_shift_assign.md index 715312a25a..ca91a3df01 100644 --- a/reference/valarray/indirect_array/op_left_shift_assign.md +++ b/reference/valarray/indirect_array/op_left_shift_assign.md @@ -24,7 +24,7 @@ void operator<<=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/indirect_array/op_minus_assign.md b/reference/valarray/indirect_array/op_minus_assign.md index d026e5706f..f3124ca6c6 100644 --- a/reference/valarray/indirect_array/op_minus_assign.md +++ b/reference/valarray/indirect_array/op_minus_assign.md @@ -24,7 +24,7 @@ void operator-=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/indirect_array/op_modulo_assign.md b/reference/valarray/indirect_array/op_modulo_assign.md index 0fca7c331e..2d20b4b1a0 100644 --- a/reference/valarray/indirect_array/op_modulo_assign.md +++ b/reference/valarray/indirect_array/op_modulo_assign.md @@ -24,7 +24,7 @@ void operator%=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/indirect_array/op_multiply_assign.md b/reference/valarray/indirect_array/op_multiply_assign.md index cd2844a896..bd0147876f 100644 --- a/reference/valarray/indirect_array/op_multiply_assign.md +++ b/reference/valarray/indirect_array/op_multiply_assign.md @@ -24,7 +24,7 @@ void operator*=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/indirect_array/op_or_assign.md b/reference/valarray/indirect_array/op_or_assign.md index 2189c7a811..930703436b 100644 --- a/reference/valarray/indirect_array/op_or_assign.md +++ b/reference/valarray/indirect_array/op_or_assign.md @@ -24,7 +24,7 @@ void operator|=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/indirect_array/op_plus_assign.md b/reference/valarray/indirect_array/op_plus_assign.md index d9d257ed12..5f9cc4ab06 100644 --- a/reference/valarray/indirect_array/op_plus_assign.md +++ b/reference/valarray/indirect_array/op_plus_assign.md @@ -24,7 +24,7 @@ void operator+=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/indirect_array/op_right_shift_assign.md b/reference/valarray/indirect_array/op_right_shift_assign.md index 6f4f7724d9..5b1b23c304 100644 --- a/reference/valarray/indirect_array/op_right_shift_assign.md +++ b/reference/valarray/indirect_array/op_right_shift_assign.md @@ -24,7 +24,7 @@ void operator>>=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/indirect_array/op_xor_assign.md b/reference/valarray/indirect_array/op_xor_assign.md index 102831572a..a35d619432 100644 --- a/reference/valarray/indirect_array/op_xor_assign.md +++ b/reference/valarray/indirect_array/op_xor_assign.md @@ -24,7 +24,7 @@ void operator^=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/mask_array/op_and_assign.md b/reference/valarray/mask_array/op_and_assign.md index c113dc4b83..5a9298d38b 100644 --- a/reference/valarray/mask_array/op_and_assign.md +++ b/reference/valarray/mask_array/op_and_assign.md @@ -24,7 +24,7 @@ void operator&=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/mask_array/op_assign.md b/reference/valarray/mask_array/op_assign.md index 6874cd06c1..402b8cae58 100644 --- a/reference/valarray/mask_array/op_assign.md +++ b/reference/valarray/mask_array/op_assign.md @@ -34,7 +34,7 @@ public: - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 - (1) : C++03まで、このオーバーロードは使用できなかった。 -- [`valarray`](../valarray.md) から抽出した要素数と `ar` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `ar` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/mask_array/op_divide_assign.md b/reference/valarray/mask_array/op_divide_assign.md index 3c67846bda..7195e4a48a 100644 --- a/reference/valarray/mask_array/op_divide_assign.md +++ b/reference/valarray/mask_array/op_divide_assign.md @@ -24,7 +24,7 @@ void operator/=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/mask_array/op_left_shift_assign.md b/reference/valarray/mask_array/op_left_shift_assign.md index 34fea57663..921e82b41c 100644 --- a/reference/valarray/mask_array/op_left_shift_assign.md +++ b/reference/valarray/mask_array/op_left_shift_assign.md @@ -24,7 +24,7 @@ void operator<<=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/mask_array/op_minus_assign.md b/reference/valarray/mask_array/op_minus_assign.md index 4a99535fa8..f10b68fbd1 100644 --- a/reference/valarray/mask_array/op_minus_assign.md +++ b/reference/valarray/mask_array/op_minus_assign.md @@ -24,7 +24,7 @@ void operator-=(const ValOrProxy& xs) const; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 diff --git a/reference/valarray/mask_array/op_modulo_assign.md b/reference/valarray/mask_array/op_modulo_assign.md index 8dc002c99b..8250cb4595 100644 --- a/reference/valarray/mask_array/op_modulo_assign.md +++ b/reference/valarray/mask_array/op_modulo_assign.md @@ -24,7 +24,7 @@ void operator%=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/mask_array/op_multiply_assign.md b/reference/valarray/mask_array/op_multiply_assign.md index 5921024e40..41bc721adb 100644 --- a/reference/valarray/mask_array/op_multiply_assign.md +++ b/reference/valarray/mask_array/op_multiply_assign.md @@ -24,7 +24,7 @@ void operator*=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/mask_array/op_or_assign.md b/reference/valarray/mask_array/op_or_assign.md index 985fb61dc6..caff8df8ee 100644 --- a/reference/valarray/mask_array/op_or_assign.md +++ b/reference/valarray/mask_array/op_or_assign.md @@ -24,7 +24,7 @@ void operator|=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/mask_array/op_plus_assign.md b/reference/valarray/mask_array/op_plus_assign.md index c5ba128c62..fdb87752e3 100644 --- a/reference/valarray/mask_array/op_plus_assign.md +++ b/reference/valarray/mask_array/op_plus_assign.md @@ -24,7 +24,7 @@ void operator+=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/mask_array/op_right_shift_assign.md b/reference/valarray/mask_array/op_right_shift_assign.md index d571bb3e5b..730fe91196 100644 --- a/reference/valarray/mask_array/op_right_shift_assign.md +++ b/reference/valarray/mask_array/op_right_shift_assign.md @@ -24,7 +24,7 @@ void operator>>=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/mask_array/op_xor_assign.md b/reference/valarray/mask_array/op_xor_assign.md index 724deb22f1..3f1ec90683 100644 --- a/reference/valarray/mask_array/op_xor_assign.md +++ b/reference/valarray/mask_array/op_xor_assign.md @@ -24,7 +24,7 @@ void operator^=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/slice_array/op_and_assign.md b/reference/valarray/slice_array/op_and_assign.md index 77b14b2093..1a84110f7e 100644 --- a/reference/valarray/slice_array/op_and_assign.md +++ b/reference/valarray/slice_array/op_and_assign.md @@ -24,7 +24,7 @@ void operator&=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/slice_array/op_assign.md b/reference/valarray/slice_array/op_assign.md index b9e795ef79..40f93247ea 100644 --- a/reference/valarray/slice_array/op_assign.md +++ b/reference/valarray/slice_array/op_assign.md @@ -34,7 +34,7 @@ public: - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 - (1) : C++03まで、このオーバーロードは使用できなかった。 -- [`valarray`](../valarray.md) から抽出した要素数と `ar` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `ar` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/slice_array/op_divide_assign.md b/reference/valarray/slice_array/op_divide_assign.md index e2ee7796dd..8e2fdbba57 100644 --- a/reference/valarray/slice_array/op_divide_assign.md +++ b/reference/valarray/slice_array/op_divide_assign.md @@ -24,7 +24,7 @@ void operator/=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/slice_array/op_left_shift_assign.md b/reference/valarray/slice_array/op_left_shift_assign.md index b827f5bc62..204d821a67 100644 --- a/reference/valarray/slice_array/op_left_shift_assign.md +++ b/reference/valarray/slice_array/op_left_shift_assign.md @@ -24,7 +24,7 @@ void operator<<=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/slice_array/op_minus_assign.md b/reference/valarray/slice_array/op_minus_assign.md index 22bcdcc5da..6378267b71 100644 --- a/reference/valarray/slice_array/op_minus_assign.md +++ b/reference/valarray/slice_array/op_minus_assign.md @@ -24,7 +24,7 @@ void operator-=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 diff --git a/reference/valarray/slice_array/op_modulo_assign.md b/reference/valarray/slice_array/op_modulo_assign.md index 8566a53d78..ce5489a431 100644 --- a/reference/valarray/slice_array/op_modulo_assign.md +++ b/reference/valarray/slice_array/op_modulo_assign.md @@ -24,7 +24,7 @@ void operator%=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/slice_array/op_multiply_assign.md b/reference/valarray/slice_array/op_multiply_assign.md index 63b1eab616..0531c17281 100644 --- a/reference/valarray/slice_array/op_multiply_assign.md +++ b/reference/valarray/slice_array/op_multiply_assign.md @@ -24,7 +24,7 @@ void operator*=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/slice_array/op_or_assign.md b/reference/valarray/slice_array/op_or_assign.md index 26cd27f90e..ff0bceba1d 100644 --- a/reference/valarray/slice_array/op_or_assign.md +++ b/reference/valarray/slice_array/op_or_assign.md @@ -24,7 +24,7 @@ void operator|=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/slice_array/op_plus_assign.md b/reference/valarray/slice_array/op_plus_assign.md index 2b266753ab..6632f5dde6 100644 --- a/reference/valarray/slice_array/op_plus_assign.md +++ b/reference/valarray/slice_array/op_plus_assign.md @@ -24,7 +24,7 @@ void operator+=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/slice_array/op_right_shift_assign.md b/reference/valarray/slice_array/op_right_shift_assign.md index bddb0eea21..bd1adcafcc 100644 --- a/reference/valarray/slice_array/op_right_shift_assign.md +++ b/reference/valarray/slice_array/op_right_shift_assign.md @@ -24,7 +24,7 @@ void operator>>=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/slice_array/op_xor_assign.md b/reference/valarray/slice_array/op_xor_assign.md index cfdd90146a..998434ae81 100644 --- a/reference/valarray/slice_array/op_xor_assign.md +++ b/reference/valarray/slice_array/op_xor_assign.md @@ -24,7 +24,7 @@ void operator^=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、その挙動は未定義。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/valarray/atan2.md b/reference/valarray/valarray/atan2.md index 8ec7456c59..c4e85e1192 100644 --- a/reference/valarray/valarray/atan2.md +++ b/reference/valarray/valarray/atan2.md @@ -73,7 +73,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `ys` と `xs` の要素数が異なる場合、その挙動は未定義。 +- (1) : `ys` と `xs` の要素数が異なる場合、未定義動作となる。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/max.md b/reference/valarray/valarray/max.md index db2c369533..97c99f11ed 100644 --- a/reference/valarray/valarray/max.md +++ b/reference/valarray/valarray/max.md @@ -17,7 +17,7 @@ T max() const; 最大要素の計算には、要素型`T`の`operator<`を使用する。計算の順番は未規定。 -要素数が`0`の場合、この関数の挙動は未定義。要素数が`1`の場合、`0`番目の要素を返す。 +要素数が`0`の場合、未定義動作となる。要素数が`1`の場合、`0`番目の要素を返す。 ## 例 diff --git a/reference/valarray/valarray/min.md b/reference/valarray/valarray/min.md index 41322d7d83..c99612ebef 100644 --- a/reference/valarray/valarray/min.md +++ b/reference/valarray/valarray/min.md @@ -17,7 +17,7 @@ T min() const; 最小要素の計算には、要素型`T`の`operator<`を使用する。計算の順番は未規定。 -要素数が`0`の場合、この関数の挙動は未定義。要素数が`1`の場合、`0`番目の要素を返す。 +要素数が`0`の場合、未定義動作となる。要素数が`1`の場合、`0`番目の要素を返す。 ## 例 diff --git a/reference/valarray/valarray/op_and.md b/reference/valarray/valarray/op_and.md index e32cb214c4..af97fb86e0 100644 --- a/reference/valarray/valarray/op_and.md +++ b/reference/valarray/valarray/op_and.md @@ -68,7 +68,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `xs` と `ys` の要素数が異なる場合、その挙動は未定義。 +- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作となる。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/op_and_assign.md b/reference/valarray/valarray/op_and_assign.md index 6fe449d836..c7baaf988f 100644 --- a/reference/valarray/valarray/op_and_assign.md +++ b/reference/valarray/valarray/op_and_assign.md @@ -42,7 +42,7 @@ for (size_t i = 0; i < size(); ++i) { ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `*this` と `xs` の要素数が異なる場合、その挙動は未定義。 +- (1) : `*this` と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/valarray/op_at.md b/reference/valarray/valarray/op_at.md index 52250d452f..2accabbd2b 100644 --- a/reference/valarray/valarray/op_at.md +++ b/reference/valarray/valarray/op_at.md @@ -45,7 +45,7 @@ indirect_array operator[](const ValOrProxy& mask); // (10) `*this`に含まれる`n`番目の要素への参照を返す。 -`n >=` [`size()`](size.md)の場合、その挙動は未定義。 +`n >=` [`size()`](size.md)の場合、未定義動作となる。 - (3) : `*this`に含まれる要素を、[`slice`](/reference/valarray/slice.md)の条件に基いてスライスする。このオーバーロードでは、条件一致した要素をコピー抽出した`valarray`オブジェクトを返す。 - (4) : `*this`に含まれる要素を、[`slice`](/reference/valarray/slice.md)の条件に基いてスライスする。このオーバーロードでは、条件一致した要素への参照を管理する[`slice_array`](/reference/valarray/slice_array.md)オブジェクトを返す。 @@ -61,7 +61,7 @@ indirect_array operator[](const ValOrProxy& mask); // (10) - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 - (3), (5), (7), (9) : `valarray`型のオブジェクトを返すこの関数を含むあらゆる関数は、`valarray`クラスと同じ`const`メンバ関数をもつほかの型を返すことが実装に許可される。例として複数の`valarray`操作をつなげて記述したときに最適化できるよう、式テンプレートを返す実装もある -- (7), (8) : [`size()`](size.md) `!= mask.`[`size()`](size.md)の場合、その挙動は未定義。 +- (7), (8) : [`size()`](size.md) `!= mask.`[`size()`](size.md)の場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/valarray/op_constructor.md b/reference/valarray/valarray/op_constructor.md index d8270d06b9..7fd8733d94 100644 --- a/reference/valarray/valarray/op_constructor.md +++ b/reference/valarray/valarray/op_constructor.md @@ -42,7 +42,7 @@ valarray(initializer_list init); // (11) C++11 から - (1) : `size() == 0`の要素を持たない空の`valarray`オブジェクトを構築する。 - (2) : `n`個の`T()`初期化された要素を保持した`valarray`オブジェクトを構築する。 - (3) : `value`のコピーを`n`個要素として保持した`valarray`オブジェクトを構築する。 -- (4) : ポインタ`first`が指す要素から`n`個先までをコピーして、`valarray`オブジェクトを構築する。`n`が`first`の要素数より大きい場合、その挙動は未定義。 +- (4) : ポインタ`first`が指す要素から`n`個先までをコピーして、`valarray`オブジェクトを構築する。`n`が`first`の要素数より大きい場合、未定義動作となる。 - (5) : `x`と同じ要素を保持した`valarray`オブジェクトを構築する。 - (6) : `x`と同じ要素を保持した`valarray`オブジェクトを構築する。ムーブ後の`x`の状態は未規定。 - (7), (8), (9), (10) : `x`が参照している要素から、`valarray`オブジェクトを構築する。 diff --git a/reference/valarray/valarray/op_divide.md b/reference/valarray/valarray/op_divide.md index 0337b33f50..357fe83c91 100644 --- a/reference/valarray/valarray/op_divide.md +++ b/reference/valarray/valarray/op_divide.md @@ -69,7 +69,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `xs` と `ys` の要素数が異なる場合、その挙動は未定義。 +- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作となる。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/op_divide_assign.md b/reference/valarray/valarray/op_divide_assign.md index 764fd9371c..974f898f95 100644 --- a/reference/valarray/valarray/op_divide_assign.md +++ b/reference/valarray/valarray/op_divide_assign.md @@ -44,7 +44,7 @@ for (std::size_t i = 0; i < size(); ++i) { ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `*this` と `xs` の要素数が異なる場合、その挙動は未定義。 +- (1) : `*this` と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/valarray/op_equal.md b/reference/valarray/valarray/op_equal.md index 670817d20d..3e6f6daf9f 100644 --- a/reference/valarray/valarray/op_equal.md +++ b/reference/valarray/valarray/op_equal.md @@ -74,7 +74,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `xs` と `ys` の要素数が異なる場合、その挙動は未定義。 +- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作となる。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/op_greater.md b/reference/valarray/valarray/op_greater.md index 60b99455a9..46ea961baf 100644 --- a/reference/valarray/valarray/op_greater.md +++ b/reference/valarray/valarray/op_greater.md @@ -74,7 +74,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `xs` と `ys` の要素数が異なる場合、その挙動は未定義。 +- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作となる。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/op_greater_equal.md b/reference/valarray/valarray/op_greater_equal.md index 970c9d7fd7..03c090f1dd 100644 --- a/reference/valarray/valarray/op_greater_equal.md +++ b/reference/valarray/valarray/op_greater_equal.md @@ -74,7 +74,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `xs` と `ys` の要素数が異なる場合、その挙動は未定義。 +- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作となる。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/op_left_shift.md b/reference/valarray/valarray/op_left_shift.md index 418d366074..e937165499 100644 --- a/reference/valarray/valarray/op_left_shift.md +++ b/reference/valarray/valarray/op_left_shift.md @@ -69,7 +69,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `xs` と `ys` の要素数が異なる場合、その挙動は未定義。 +- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作となる。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/op_left_shift_assign.md b/reference/valarray/valarray/op_left_shift_assign.md index c9e525bcb3..4cee21f665 100644 --- a/reference/valarray/valarray/op_left_shift_assign.md +++ b/reference/valarray/valarray/op_left_shift_assign.md @@ -44,7 +44,7 @@ for (std::size_t i = 0; i < size(); ++i) { ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `*this` と `xs` の要素数が異なる場合、その挙動は未定義。 +- (1) : `*this` と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/valarray/op_less.md b/reference/valarray/valarray/op_less.md index 0721fe38db..c8c1c5b7ba 100644 --- a/reference/valarray/valarray/op_less.md +++ b/reference/valarray/valarray/op_less.md @@ -74,7 +74,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `xs` と `ys` の要素数が異なる場合、その挙動は未定義。 +- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作となる。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/op_less_equal.md b/reference/valarray/valarray/op_less_equal.md index 63fc458fa7..f7fde96a1e 100644 --- a/reference/valarray/valarray/op_less_equal.md +++ b/reference/valarray/valarray/op_less_equal.md @@ -74,7 +74,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `xs` と `ys` の要素数が異なる場合、その挙動は未定義。 +- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作となる。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/op_logical_and.md b/reference/valarray/valarray/op_logical_and.md index c3b0ab235f..f2d61fbb17 100644 --- a/reference/valarray/valarray/op_logical_and.md +++ b/reference/valarray/valarray/op_logical_and.md @@ -79,7 +79,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `xs` と `ys` の要素数が異なる場合、その挙動は未定義。 +- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作となる。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/op_logical_or.md b/reference/valarray/valarray/op_logical_or.md index 2d1b8ec04a..252b8445f4 100644 --- a/reference/valarray/valarray/op_logical_or.md +++ b/reference/valarray/valarray/op_logical_or.md @@ -79,7 +79,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `xs` と `ys` の要素数が異なる場合、その挙動は未定義。 +- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作となる。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/op_minus.md b/reference/valarray/valarray/op_minus.md index 3930428d19..0ade019196 100644 --- a/reference/valarray/valarray/op_minus.md +++ b/reference/valarray/valarray/op_minus.md @@ -69,7 +69,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `xs` と `ys` の要素数が異なる場合、その挙動は未定義。 +- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作となる。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/op_minus_assign.md b/reference/valarray/valarray/op_minus_assign.md index 7dd04b8195..fe45f8c506 100644 --- a/reference/valarray/valarray/op_minus_assign.md +++ b/reference/valarray/valarray/op_minus_assign.md @@ -44,7 +44,7 @@ for (std::size_t i = 0; i < size(); ++i) { ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `*this` と `xs` の要素数が異なる場合、その挙動は未定義。 +- (1) : `*this` と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/valarray/op_modulo.md b/reference/valarray/valarray/op_modulo.md index eb0231bba6..a80234d463 100644 --- a/reference/valarray/valarray/op_modulo.md +++ b/reference/valarray/valarray/op_modulo.md @@ -69,7 +69,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `xs` と `ys` の要素数が異なる場合、その挙動は未定義。 +- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作となる。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/op_modulo_assign.md b/reference/valarray/valarray/op_modulo_assign.md index 7c972089dd..e548593cf4 100644 --- a/reference/valarray/valarray/op_modulo_assign.md +++ b/reference/valarray/valarray/op_modulo_assign.md @@ -44,7 +44,7 @@ for (std::size_t i = 0; i < size(); ++i) { ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `*this` と `xs` の要素数が異なる場合、その挙動は未定義。 +- (1) : `*this` と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/valarray/op_multiply.md b/reference/valarray/valarray/op_multiply.md index 63d78f8147..b7cdf5208e 100644 --- a/reference/valarray/valarray/op_multiply.md +++ b/reference/valarray/valarray/op_multiply.md @@ -68,7 +68,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `xs` と `ys` の要素数が異なる場合、その挙動は未定義。 +- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作となる。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/op_multiply_assign.md b/reference/valarray/valarray/op_multiply_assign.md index 03fdc35057..1e26f00492 100644 --- a/reference/valarray/valarray/op_multiply_assign.md +++ b/reference/valarray/valarray/op_multiply_assign.md @@ -44,7 +44,7 @@ for (std::size_t i = 0; i < size(); ++i) { ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `*this` と `xs` の要素数が異なる場合、その挙動は未定義。 +- (1) : `*this` と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/valarray/op_not_equal.md b/reference/valarray/valarray/op_not_equal.md index 4f2cbb0754..0c067d794e 100644 --- a/reference/valarray/valarray/op_not_equal.md +++ b/reference/valarray/valarray/op_not_equal.md @@ -74,7 +74,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `xs` と `ys` の要素数が異なる場合、その挙動は未定義。 +- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作となる。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/op_or.md b/reference/valarray/valarray/op_or.md index e4341a8c16..994aac3813 100644 --- a/reference/valarray/valarray/op_or.md +++ b/reference/valarray/valarray/op_or.md @@ -68,7 +68,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `xs` と `ys` の要素数が異なる場合、その挙動は未定義。 +- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作となる。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/op_or_assign.md b/reference/valarray/valarray/op_or_assign.md index 5d1d48f6d2..5b4e4416dd 100644 --- a/reference/valarray/valarray/op_or_assign.md +++ b/reference/valarray/valarray/op_or_assign.md @@ -45,7 +45,7 @@ for (std::size_t i = 0; i < size(); ++i) { ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `*this` と `xs` の要素数が異なる場合、その挙動は未定義。 +- (1) : `*this` と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/valarray/op_plus.md b/reference/valarray/valarray/op_plus.md index 037036d8e2..487cfb0261 100644 --- a/reference/valarray/valarray/op_plus.md +++ b/reference/valarray/valarray/op_plus.md @@ -68,7 +68,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `xs` と `ys` の要素数が異なる場合、その挙動は未定義。 +- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作となる。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/op_plus_assign.md b/reference/valarray/valarray/op_plus_assign.md index ff09ea7ff0..902ac464dc 100644 --- a/reference/valarray/valarray/op_plus_assign.md +++ b/reference/valarray/valarray/op_plus_assign.md @@ -45,7 +45,7 @@ for (std::size_t i = 0; i < size(); ++i) { ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `*this` と `xs` の要素数が異なる場合、その挙動は未定義。 +- (1) : `*this` と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/valarray/op_right_shift.md b/reference/valarray/valarray/op_right_shift.md index 217753e8d4..23489a0349 100644 --- a/reference/valarray/valarray/op_right_shift.md +++ b/reference/valarray/valarray/op_right_shift.md @@ -69,7 +69,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `xs` と `ys` の要素数が異なる場合、その挙動は未定義。 +- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作となる。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/op_right_shift_assign.md b/reference/valarray/valarray/op_right_shift_assign.md index 60384737e5..707f27e5f8 100644 --- a/reference/valarray/valarray/op_right_shift_assign.md +++ b/reference/valarray/valarray/op_right_shift_assign.md @@ -44,7 +44,7 @@ for (std::size_t i = 0; i < size(); ++i) { ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `*this` と `xs` の要素数が異なる場合、その挙動は未定義。 +- (1) : `*this` と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/valarray/op_xor.md b/reference/valarray/valarray/op_xor.md index 6e61dc1429..72cbe2e5ad 100644 --- a/reference/valarray/valarray/op_xor.md +++ b/reference/valarray/valarray/op_xor.md @@ -68,7 +68,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `xs` と `ys` の要素数が異なる場合、その挙動は未定義。 +- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作となる。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/op_xor_assign.md b/reference/valarray/valarray/op_xor_assign.md index 756f8fe680..43b19e56c2 100644 --- a/reference/valarray/valarray/op_xor_assign.md +++ b/reference/valarray/valarray/op_xor_assign.md @@ -44,7 +44,7 @@ for (std::size_t i = 0; i < size(); ++i) { ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `*this` と `xs` の要素数が異なる場合、その挙動は未定義。 +- (1) : `*this` と `xs` の要素数が異なる場合、未定義動作となる。 ## 例 diff --git a/reference/valarray/valarray/pow.md b/reference/valarray/valarray/pow.md index c60c36238e..ea29ab12f4 100644 --- a/reference/valarray/valarray/pow.md +++ b/reference/valarray/valarray/pow.md @@ -73,7 +73,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `xs` と `ys` の要素数が異なる場合、その挙動は未定義。 +- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作となる。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/sum.md b/reference/valarray/valarray/sum.md index e7c53f3a4d..ab6215e9a4 100644 --- a/reference/valarray/valarray/sum.md +++ b/reference/valarray/valarray/sum.md @@ -17,7 +17,7 @@ T sum() const; 合計値の計算には、要素型`T`の`operator+=`を使用する。計算の順番は未規定。 -要素数が`0`の場合、この関数の挙動は未定義。要素数が`1`の場合、`0`番目の要素を返す。 +要素数が`0`の場合、未定義動作となる。要素数が`1`の場合、`0`番目の要素を返す。 ## 例 From ff2c41065cf44c6939cd6caf1f2c32b48b97cffc Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 30 Aug 2024 13:16:23 +0900 Subject: [PATCH 1169/3948] =?UTF-8?q?=E7=94=A8=E8=AA=9E=E7=B5=B1=E4=B8=80?= =?UTF-8?q?=20:=20=E3=80=8C=E6=8C=AF=E3=82=8B=E8=88=9E=E3=81=84=E3=81=AF?= =?UTF-8?q?=E6=9C=AA=E5=AE=9A=E7=BE=A9=E3=80=8D=20=E2=86=92=20=E3=80=8C?= =?UTF-8?q?=E6=9C=AA=E5=AE=9A=E7=BE=A9=E5=8B=95=E4=BD=9C=E3=81=A8=E3=81=AA?= =?UTF-8?q?=E3=82=8B=E3=80=8D=20#1348?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/forward_list/forward_list/merge.md | 2 +- reference/unordered_map/unordered_map/swap.md | 2 +- reference/unordered_map/unordered_multimap/swap.md | 2 +- reference/unordered_set/unordered_multiset/swap.md | 2 +- reference/unordered_set/unordered_set/swap.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/reference/forward_list/forward_list/merge.md b/reference/forward_list/forward_list/merge.md index def48c94c6..18fd55212f 100644 --- a/reference/forward_list/forward_list/merge.md +++ b/reference/forward_list/forward_list/merge.md @@ -45,7 +45,7 @@ void merge(forward_list&& x, Compare comp); // (4) ## 備考 - この操作は安定である。 -- `this->`[`get_allocator()`](get_allocator.md) `!= x.`[`get_allocator()`](get_allocator.md)である場合、その振る舞いは未定義。(C++14) +- `this->`[`get_allocator()`](get_allocator.md) `!= x.`[`get_allocator()`](get_allocator.md)である場合、未定義動作となる。(C++14) ## 例 diff --git a/reference/unordered_map/unordered_map/swap.md b/reference/unordered_map/unordered_map/swap.md index 43bf2a01e3..e5ea335a26 100644 --- a/reference/unordered_map/unordered_map/swap.md +++ b/reference/unordered_map/unordered_map/swap.md @@ -28,7 +28,7 @@ void swap(unordered_map& x) また、コンテナの `key_equal` と `hasher` のオブジェクト(それぞれ [`key_eq`](key_eq.md)`()` と [`hash_function`](hash_function.md)`()` が返すオブジェクト)も非メンバ関数 [`swap`](/reference/utility/swap.md) を非修飾で(つまり `std::` を付けずに)呼び出すことで交換される。(したがって、[`swap`](/reference/utility/swap.md) の呼び出しには ADL が働く。) -もし、`std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::propagate_on_container_swap::value` が `true` であれば、アロケータオブジェクト([`get_allocator`](get_allocator.md)`()` が返すオブジェクト)も非メンバ関数 [`swap`](/reference/utility/swap.md) を非修飾で呼び出すことで交換される。そうでなければアロケータオブジェクトは交換されず、その場合、当該コンテナと引数 `v` がそれぞれ [`get_allocator`](get_allocator.md)`()` で返すオブジェクトが等価でない(`operator==` が `true` を返さない)場合、振る舞いは未定義(undefined)である。 +もし、`std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::propagate_on_container_swap::value` が `true` であれば、アロケータオブジェクト([`get_allocator`](get_allocator.md)`()` が返すオブジェクト)も非メンバ関数 [`swap`](/reference/utility/swap.md) を非修飾で呼び出すことで交換される。そうでなければアロケータオブジェクトは交換されず、その場合、当該コンテナと引数 `v` がそれぞれ [`get_allocator`](get_allocator.md)`()` で返すオブジェクトが等価でない(`operator==` が `true` を返さない)場合、未定義動作となる。 ## 戻り値 diff --git a/reference/unordered_map/unordered_multimap/swap.md b/reference/unordered_map/unordered_multimap/swap.md index 46ddbc7216..3268f61c73 100644 --- a/reference/unordered_map/unordered_multimap/swap.md +++ b/reference/unordered_map/unordered_multimap/swap.md @@ -28,7 +28,7 @@ void swap(unordered_multimap& x) また、コンテナの `key_equal` と `hasher` のオブジェクト(それぞれ [`key_eq`](key_eq.md)`()` と [`hash_function`](hash_function.md)`()` が返すオブジェクト)も非メンバ関数 [`swap`](/reference/utility/swap.md) を非修飾で(つまり `std::` を付けずに)呼び出すことで交換される。(したがって、[`swap`](/reference/utility/swap.md) の呼び出しには ADL が働く。) -もし、`std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::propagate_on_container_swap::value` が `true` であれば、アロケータオブジェクト([`get_allocator`](get_allocator.md)`()` が返すオブジェクト)も非メンバ関数 [`swap`](/reference/utility/swap.md) を非修飾で呼び出すことで交換される。そうでなければアロケータオブジェクトは交換されず、その場合、当該コンテナと引数 `v` がそれぞれ [`get_allocator`](get_allocator.md)`()` で返すオブジェクトが等価でない(`operator==` が `true` を返さない)場合、振る舞いは未定義(undefined)である。 +もし、`std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::propagate_on_container_swap::value` が `true` であれば、アロケータオブジェクト([`get_allocator`](get_allocator.md)`()` が返すオブジェクト)も非メンバ関数 [`swap`](/reference/utility/swap.md) を非修飾で呼び出すことで交換される。そうでなければアロケータオブジェクトは交換されず、その場合、当該コンテナと引数 `v` がそれぞれ [`get_allocator`](get_allocator.md)`()` で返すオブジェクトが等価でない(`operator==` が `true` を返さない)場合、未定義動作となる。 ## 戻り値 diff --git a/reference/unordered_set/unordered_multiset/swap.md b/reference/unordered_set/unordered_multiset/swap.md index 0c9207ab90..7f9e448902 100644 --- a/reference/unordered_set/unordered_multiset/swap.md +++ b/reference/unordered_set/unordered_multiset/swap.md @@ -28,7 +28,7 @@ void swap(unordered_multiset& x) また、コンテナの `key_equal` と `hasher` のオブジェクト(それぞれ [`key_eq`](key_eq.md)`()` と [`hash_function`](hash_function.md)`()` が返すオブジェクト)も非メンバ関数 [`swap`](/reference/utility/swap.md) を非修飾で(つまり `std::` を付けずに)呼び出すことで交換される。(したがって、[`swap`](/reference/utility/swap.md) の呼び出しには ADL が働く。) -もし、`std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::propagate_on_container_swap::value` が `true` であれば、アロケータオブジェクト([`get_allocator`](get_allocator.md)`()` が返すオブジェクト)も非メンバ関数 [`swap`](/reference/utility/swap.md) を非修飾で呼び出すことで交換される。そうでなければアロケータオブジェクトは交換されず、その場合、当該コンテナと引数 `v` がそれぞれ [`get_allocator`](get_allocator.md)`()` で返すオブジェクトが等価でない(`operator==` が `true` を返さない)場合、振る舞いは未定義(undefined)である。 +もし、`std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::propagate_on_container_swap::value` が `true` であれば、アロケータオブジェクト([`get_allocator`](get_allocator.md)`()` が返すオブジェクト)も非メンバ関数 [`swap`](/reference/utility/swap.md) を非修飾で呼び出すことで交換される。そうでなければアロケータオブジェクトは交換されず、その場合、当該コンテナと引数 `v` がそれぞれ [`get_allocator`](get_allocator.md)`()` で返すオブジェクトが等価でない(`operator==` が `true` を返さない)場合、未定義動作となる。 ## 戻り値 diff --git a/reference/unordered_set/unordered_set/swap.md b/reference/unordered_set/unordered_set/swap.md index d0923a2c16..d055327201 100644 --- a/reference/unordered_set/unordered_set/swap.md +++ b/reference/unordered_set/unordered_set/swap.md @@ -28,7 +28,7 @@ void swap(unordered_set& x) また、コンテナの `key_equal` と `hasher` のオブジェクト(それぞれ [`key_eq`](key_eq.md)`()` と [`hash_function`](hash_function.md)`()` が返すオブジェクト)も非メンバ関数 [`swap`](/reference/utility/swap.md) を非修飾で(つまり `std::` を付けずに)呼び出すことで交換される。(したがって、[`swap`](/reference/utility/swap.md) の呼び出しには ADL が働く。) -もし、`std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::propagate_on_container_swap::value` が `true` であれば、アロケータオブジェクト([`get_allocator`](get_allocator.md)`()` が返すオブジェクト)も非メンバ関数 [`swap`](/reference/utility/swap.md) を非修飾で呼び出すことで交換される。そうでなければアロケータオブジェクトは交換されず、その場合、当該コンテナと引数 `v` がそれぞれ [`get_allocator`](get_allocator.md)`()` で返すオブジェクトが等価でない(`operator==` が `true` を返さない)場合、振る舞いは未定義(undefined)である。 +もし、`std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::propagate_on_container_swap::value` が `true` であれば、アロケータオブジェクト([`get_allocator`](get_allocator.md)`()` が返すオブジェクト)も非メンバ関数 [`swap`](/reference/utility/swap.md) を非修飾で呼び出すことで交換される。そうでなければアロケータオブジェクトは交換されず、その場合、当該コンテナと引数 `v` がそれぞれ [`get_allocator`](get_allocator.md)`()` で返すオブジェクトが等価でない(`operator==` が `true` を返さない)場合、未定義動作となる。 ## 戻り値 From 8ac3445548edc81e01b794b58f32014385fbd4c2 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 30 Aug 2024 13:18:26 +0900 Subject: [PATCH 1170/3948] =?UTF-8?q?=E7=94=A8=E8=AA=9E=E7=B5=B1=E4=B8=80?= =?UTF-8?q?=20:=20=E3=80=8C=E6=9C=AA=E5=AE=9A=E7=BE=A9=E3=81=AE=E6=8C=AF?= =?UTF-8?q?=E3=82=8B=E8=88=9E=E3=81=84=E3=80=8D=20=E2=86=92=20=E3=80=8C?= =?UTF-8?q?=E6=9C=AA=E5=AE=9A=E7=BE=A9=E5=8B=95=E4=BD=9C=E3=81=A8=E3=81=AA?= =?UTF-8?q?=E3=82=8B=E3=80=8D=20#1348?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/script/defined_word_check.py | 2 +- lang/cpp11/lambda_expressions.md | 6 +++--- reference/future/shared_future/get.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/script/defined_word_check.py b/.github/workflows/script/defined_word_check.py index 3b1125de45..2a49169c4a 100644 --- a/.github/workflows/script/defined_word_check.py +++ b/.github/workflows/script/defined_word_check.py @@ -7,7 +7,7 @@ DEFINED_WORD_LIST = [ # 先頭はターゲット用語、それ以外はその用語の許可された使用方法 - ["未定義", "未定義動作", "未定義の動作", "動作は未定義", "挙動は未定義", "振る舞いは未定義", "未定義の振る舞い"], + ["未定義", "未定義動作", "未定義の動作", "動作は未定義"], ] def check_defined_word(text: str, filename: str) -> bool: diff --git a/lang/cpp11/lambda_expressions.md b/lang/cpp11/lambda_expressions.md index f1d58c96e4..e9da6fe2c6 100644 --- a/lang/cpp11/lambda_expressions.md +++ b/lang/cpp11/lambda_expressions.md @@ -215,7 +215,7 @@ member_value_ : 5 result : 8 ``` -ラムダ式がひとつ以上の変数を参照キャプチャしている場合、参照している変数の寿命が切れたあとの、ラムダ式のコピーと呼び出しの動作は未定義。 +ラムダ式がひとつ以上の変数を参照キャプチャしている場合、参照している変数の寿命が切れたあとの、ラムダ式のコピーと呼び出しは未定義動作となる。 ```cpp example #include @@ -228,7 +228,7 @@ std::function foo() int main() { - foo()(2); // 未定義の振る舞い + foo()(2); // 未定義動作 } ``` * std::function[link /reference/functional/function.md] @@ -561,4 +561,4 @@ for_each(array, array + 4, <&>(double d) ( sum += factor ∗ d )); - [N2957 Reaching Scope of Lambda Expressions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2957.html) - [N3043 Converting Lambdas to Function Pointers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3043.html) - [N3052 Converting Lambdas to Function Pointers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3052.html) -- [CWG Issue 975. Restrictions on return type deduction for lambdas](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#975) \ No newline at end of file +- [CWG Issue 975. Restrictions on return type deduction for lambdas](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#975) diff --git a/reference/future/shared_future/get.md b/reference/future/shared_future/get.md index 0108b936a2..706e187e61 100644 --- a/reference/future/shared_future/get.md +++ b/reference/future/shared_future/get.md @@ -20,7 +20,7 @@ void shared_future::get() const; ## 戻り値 -- `future::get()` : 共有状態に格納されている値への`const`左辺値参照を返す。
備考:共有状態が破壊された後、その参照を介してのアクセスは未定義の振る舞いをする。`shared_future`オブジェクトの寿命よりも長いオブジェクトに参照を保持しないこと。 +- `future::get()` : 共有状態に格納されている値への`const`左辺値参照を返す。
備考:共有状態が破壊された後、その参照を介してのアクセスは未定義動作となる。`shared_future`オブジェクトの寿命よりも長いオブジェクトに参照を保持しないこと。 - `future::get()` : 共有状態に格納されている参照を返す。 - `future::get()` : 何も返さない。 From 3d65416ef7729465f7cc34cf9267d20351ddc370 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 30 Aug 2024 13:21:39 +0900 Subject: [PATCH 1171/3948] =?UTF-8?q?=E7=94=A8=E8=AA=9E=E7=B5=B1=E4=B8=80?= =?UTF-8?q?=20:=20=E3=80=8C=E6=8C=99=E5=8B=95=E3=81=AF=E6=9C=AA=E8=A6=8F?= =?UTF-8?q?=E5=AE=9A=E3=80=8D=20=E2=86=92=20=E3=80=8C=E5=8B=95=E4=BD=9C?= =?UTF-8?q?=E3=81=AF=E6=9C=AA=E8=A6=8F=E5=AE=9A=E3=80=8D=20#1348?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/array/array/data.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/array/array/data.md b/reference/array/array/data.md index 333e071532..1bcaeca797 100644 --- a/reference/array/array/data.md +++ b/reference/array/array/data.md @@ -26,7 +26,7 @@ constexpr const T* data() const noexcept; // (2) C++17 ## 備考 -0要素の場合(`N == 0`)、この関数の呼び出しによる挙動は未規定。 +0要素の場合(`N == 0`)、この関数の呼び出しによる動作は未規定。 ## 例 From 1019af6891c9ab771fcb86d13da69df8f7468a7d Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 30 Aug 2024 13:31:13 +0900 Subject: [PATCH 1172/3948] =?UTF-8?q?=E7=94=A8=E8=AA=9E=20:=20=E6=9A=AB?= =?UTF-8?q?=E5=AE=9A=E5=AF=BE=E5=BF=9C=E3=81=A8=E3=81=97=E3=81=A6=E3=80=8C?= =?UTF-8?q?=E6=9C=AA=E5=AE=9A=E7=BE=A9=E3=82=A2=E3=83=89=E3=83=AC=E3=82=B9?= =?UTF-8?q?=E3=80=8D=E3=82=92=E7=94=A8=E8=AA=9E=E3=81=A8=E3=81=97=E3=81=A6?= =?UTF-8?q?=E7=99=BB=E9=8C=B2=20#1348?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/script/defined_word_check.py | 12 ++++++------ GLOBAL_DEFINED_WORDS.json | 4 ++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/script/defined_word_check.py b/.github/workflows/script/defined_word_check.py index 2a49169c4a..1606c8982a 100644 --- a/.github/workflows/script/defined_word_check.py +++ b/.github/workflows/script/defined_word_check.py @@ -6,17 +6,17 @@ import re DEFINED_WORD_LIST = [ - # 先頭はターゲット用語、それ以外はその用語の許可された使用方法 - ["未定義", "未定義動作", "未定義の動作", "動作は未定義"], + # ターゲット用語, その用語の許可された使用方法リスト + ("未定義", ["未定義動作", "未定義の動作", "動作は未定義", "未定義アドレス"]), + # 「未定義アドレス」は意味が明確に規定されていない。規定されたら「未定義動作」を使用した説明に差し替える + # LWG issue 3906. "Undefined address" is undefined + # https://cplusplus.github.io/LWG/issue3906 ] def check_defined_word(text: str, filename: str) -> bool: found_error: bool = False - for words in DEFINED_WORD_LIST: - word = words[0] - allow_list = words[1:] - + for word, allow_list in DEFINED_WORD_LIST: match_list = [m.start() for m in re.finditer(word, text)] if len(match_list) == 0: continue diff --git a/GLOBAL_DEFINED_WORDS.json b/GLOBAL_DEFINED_WORDS.json index f9944b32cc..1e98a8c4b6 100644 --- a/GLOBAL_DEFINED_WORDS.json +++ b/GLOBAL_DEFINED_WORDS.json @@ -16,6 +16,10 @@ }, "未定義動作": { "redirect": "未定義の動作", "yomi": "みていぎどうさ" }, "未定義": { "redirect": "未定義の動作", "yomi": "みていぎ" }, + "未定義アドレス": { + "yomi": "みていぎあどれす", + "desc": "配列要素へのポインタがアドレス計算の結果として配列の範囲外に到達した場合に、(間接参照しなくても) 未定義動作となる" + }, "未規定の動作": { "link": "/implementation-compliance.md#dfn-unspecified-behavior", "yomi": "みきていのどうさ", From ff558c7e9c4f97344d41eb2cd8523d4a13006406 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 30 Aug 2024 13:32:02 +0900 Subject: [PATCH 1173/3948] =?UTF-8?q?=E7=94=A8=E8=AA=9E=20:=20=E3=80=8C?= =?UTF-8?q?=E5=8B=95=E4=BD=9C=E3=81=AF=E6=9C=AA=E5=AE=9A=E7=BE=A9=E3=80=8D?= =?UTF-8?q?=E3=82=92=E7=99=BB=E9=8C=B2=20#1348?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_DEFINED_WORDS.json | 1 + 1 file changed, 1 insertion(+) diff --git a/GLOBAL_DEFINED_WORDS.json b/GLOBAL_DEFINED_WORDS.json index 1e98a8c4b6..f852a51e04 100644 --- a/GLOBAL_DEFINED_WORDS.json +++ b/GLOBAL_DEFINED_WORDS.json @@ -15,6 +15,7 @@ "desc": "処理系は予期せぬ動作をする可能性がある。要するに動作保証対象外" }, "未定義動作": { "redirect": "未定義の動作", "yomi": "みていぎどうさ" }, + "動作は未定義": { "redirect": "未定義の動作", "yomi": "どうさはみていぎ" }, "未定義": { "redirect": "未定義の動作", "yomi": "みていぎ" }, "未定義アドレス": { "yomi": "みていぎあどれす", From 0b41b4cc0acf08a868a3f54c7116c600835ebff3 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 30 Aug 2024 13:35:08 +0900 Subject: [PATCH 1174/3948] =?UTF-8?q?C++17=20=E5=8F=82=E7=85=A7=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=90=E3=82=92=E3=82=82=E3=81=A4=E3=82=AF=E3=83=A9?= =?UTF-8?q?=E3=82=B9=E3=81=AE=E7=BD=AE=E3=81=8D=E6=8F=9B=E3=81=88=20:=20?= =?UTF-8?q?=E3=80=8C=E7=B5=90=E6=9E=9C=E3=81=AF=E6=9C=AA=E5=AE=9A=E7=BE=A9?= =?UTF-8?q?=E3=80=8D=20=E2=86=92=20=E3=80=8C=E6=9C=AA=E5=AE=9A=E7=BE=A9?= =?UTF-8?q?=E5=8B=95=E4=BD=9C=E3=80=8D=20#1348?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp17.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/implementation-status.md b/implementation-status.md index ca4ca3021f..580603a293 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -136,7 +136,7 @@ | P0386R2: [インライン変数](/lang/cpp17/inline_variables.md) | インライン指定を関数だけでなく変数にも指定できるようにする | 7 | 3.9 | 19.0 | 2017 Update 5 | | P0217R3: [構造化束縛](/lang/cpp17/structured_bindings.md) | タプルやユーザー定義型を分解して受け取れるようにする
`tuple f();`
`const auto [a, b] = f(); // aはintの値、bはstringの値` | 7 | 4 | 18.0 | 2017 Update 3 | | P0305R1: [if文とswitch文の条件式と初期化を分離](/lang/cpp17/selection_statements_with_initializer.md) | `if (init; condition)`のように初期化と条件式を分けて記述できるようにする | 7 | 3.9 | 18.0 | 2017 Update 3 | -| P0137R1: [参照メンバをもつクラスの置き換え](/lang/cpp17/replacement_of_class_objects_containing_reference_members.md) | 参照型メンバや`const`メンバ変数を含むクラスについてこれまで結果は未定義とされていた配置`new`によるオブジェクトの置き換えを条件付きで可能とする | 7 | 6.0 | No | 2017 Update 7 | +| P0137R1: [参照メンバをもつクラスの置き換え](/lang/cpp17/replacement_of_class_objects_containing_reference_members.md) | 参照型メンバや`const`メンバ変数を含むクラスについてこれまで未定義動作とされていた配置`new`によるオブジェクトの置き換えを条件付きで可能とする | 7 | 6.0 | No | 2017 Update 7 | | P0003R5: [非推奨だった例外仕様を削除](/lang/cpp17/remove_deprecated_exception_specifications.md) | `noexcept`が入ったことによって非推奨になった`throw`キーワードによる例外仕様を削除 | 7 | 4 | No | 2017 Update 5 | | P0195R2: [using宣言でのパック展開](/lang/cpp17/pack_expansions_in_using.md) | パラメータパックの型を基底クラスとして指定した場合に、`using`宣言に基底クラスのパラメータパックを指定できるようにする | 7 | 4 | No | 2017 Update 7 | | P0512R0: [クラステンプレート引数の推論仕様を調整][P0512R0] | | 8 | 5.0 | No | 2017 Update 7 | diff --git a/lang/cpp17.md b/lang/cpp17.md index 5f36bfe5a9..d2b6aeeae8 100644 --- a/lang/cpp17.md +++ b/lang/cpp17.md @@ -35,7 +35,7 @@ C++17以降、言語の策定にship train modelというリリース体制が | [`[[nodiscard]]`属性](cpp17/nodiscard.md) | 戻り値を捨ててはならないことを指定する | | [値のコピー省略を保証](cpp17/guaranteed_copy_elision.md) | 右辺値を変数の初期化のために使用する場合、コピーもムーブも省略することを保証 | | [厳密な式の評価順](cpp17/expression_evaluation_order.md) | 式の評価順を規定する | -| [参照メンバをもつクラスの置き換え](cpp17/replacement_of_class_objects_containing_reference_members.md) | 参照型メンバや`const`メンバ変数を含むクラスについてこれまで結果は未定義とされていた配置`new`によるオブジェクトの置き換えを条件付きで可能とする | +| [参照メンバをもつクラスの置き換え](cpp17/replacement_of_class_objects_containing_reference_members.md) | 参照型メンバや`const`メンバ変数を含むクラスについてこれまで未定義動作とされていた配置`new`によるオブジェクトの置き換えを条件付きで可能とする | | [`enum class`変数の初期値として整数を指定する際の規則を調整](cpp17/construction_enum_class_values.md) | キャストを使用することなく整数を初期値として使用し、`E e{0};`のような初期化を許可 | | [アライメント指定されたデータの動的メモリ確保](cpp17/dynamic_memory_allocation_for_over-aligned_data.md) | `operator new`と`operator delete`でアライメント値を取得できるようにする | | [基底クラスのメンバ変数を集成体初期化するための波カッコを省略できるようにする](cpp17/extension_to_aggregate_initialization.md) | 基底クラスのメンバを集成体初期化するために、 `derived d {{42}};` の代わりに `derived d {42};` と書けるようにする | From d0680e421f64a9b2bfd00770294c1ab5d19064ab Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 30 Aug 2024 13:46:27 +0900 Subject: [PATCH 1175/3948] =?UTF-8?q?=E7=94=A8=E8=AA=9E=20:=20=E5=AE=9A?= =?UTF-8?q?=E7=BE=A9=E3=81=95=E3=82=8C=E3=81=AA=E3=81=84=E3=81=A8=E3=81=84?= =?UTF-8?q?=E3=81=86=E6=84=8F=E5=91=B3=E3=81=A7=E3=80=8C=E6=9C=AA=E5=AE=9A?= =?UTF-8?q?=E7=BE=A9=E3=80=8D=E7=94=A8=E8=AA=9E=E3=82=92=E4=BD=BF=E3=81=A3?= =?UTF-8?q?=E3=81=A6=E3=81=84=E3=81=9F=E3=81=A8=E3=81=93=E3=82=8D=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20#1348?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstddef/offsetof.md | 2 +- reference/ios/basic_ios/op_assign.md | 4 +++- reference/ios/basic_ios/op_constructor.md | 4 +++- reference/ios/ios_base/op_assign.md | 4 +++- reference/ios/ios_base/op_constructor.md | 4 +++- reference/node_handle/node_handle.md | 2 +- 6 files changed, 14 insertions(+), 6 deletions(-) diff --git a/reference/cstddef/offsetof.md b/reference/cstddef/offsetof.md index aaacd630d7..54ceff2718 100644 --- a/reference/cstddef/offsetof.md +++ b/reference/cstddef/offsetof.md @@ -14,7 +14,7 @@ C++ での構造体の機能的拡張のため、`offsetof` の利用は、C++11以降は[スタンダードレイアウト](/reference/type_traits/is_standard_layout.md)のクラス型に制限され、C++11より以前はC の構造体のコンセプトに対応する POD のクラス型に制限される(但し、`public` な非仮想メンバ関数のみを持ち、コンストラクタ及びデストラクタを持たない非派生クラスも POD である)。 -スタンダードレイアウトではないクラス型においての`offsetof`の利用は条件付きのサポートとなる(C++17より以前は未定義)。 +スタンダードレイアウトではないクラス型においての`offsetof`の利用は条件付きのサポートとなる(C++17より以前はサポートされない)。 ## パラメータ - `type` : `member` を有効なメンバ指示子とするクラス型 diff --git a/reference/ios/basic_ios/op_assign.md b/reference/ios/basic_ios/op_assign.md index 0cabe78f62..e57004e156 100644 --- a/reference/ios/basic_ios/op_assign.md +++ b/reference/ios/basic_ios/op_assign.md @@ -22,7 +22,9 @@ public: ## 備考 -- コピー代入演算子は `private` で未定義(C++03 まで)、あるいは、`public` で `delete`(C++11 から)である。 +- コピー代入演算子は、 + - C++03 : アクセス指定子`private`で宣言のみされ、定義はされない + - C++11 : アクセス指定子`public`で`delete`定義される (いずれにせよコピーすることはできないが、`public` で `delete` の方が誤ってコピーしようとした際のエラーメッセージが分かりやすいため、変更されている) - コピー代入演算子が宣言されているため、ムーブ代入演算子も自動生成されない。 ただし、派生クラスでムーブ構築、ムーブ代入、交換ができるように、メンバ関数 [`move`](move.md)`()`、および、[`swap`](swap.md)`()` が提供されている。 diff --git a/reference/ios/basic_ios/op_constructor.md b/reference/ios/basic_ios/op_constructor.md index 4905f91106..a7f7481e74 100644 --- a/reference/ios/basic_ios/op_constructor.md +++ b/reference/ios/basic_ios/op_constructor.md @@ -33,7 +33,9 @@ public: ## 備考 -- コピーコンストラクタは `private` で未定義(C++03 まで)、あるいは、`public` で `delete`(C++11 から)である。 +- コピーコンストラクタは、 + - C++03 : アクセス指定子`private`で宣言のみされ、定義はされない + - C++11 : アクセス指定子`public`で`delete`定義される (いずれにせよコピーすることはできないが、`public` で `delete` の方が誤ってコピーしようとした際のエラーメッセージが分かりやすいため、変更されている) - コピーコンストラクタが宣言されているため、ムーブコンストラクタも自動生成されない。 ただし、派生クラスでムーブ構築、ムーブ代入、交換ができるように、メンバ関数 [`move`](move.md)`()`、および、[`swap`](swap.md)`()` が提供されている。 diff --git a/reference/ios/ios_base/op_assign.md b/reference/ios/ios_base/op_assign.md index 55fe54c5c0..e8bd033f70 100644 --- a/reference/ios/ios_base/op_assign.md +++ b/reference/ios/ios_base/op_assign.md @@ -21,7 +21,9 @@ public: ## 備考 -- コピー代入演算子は `private` で未定義(C++03 まで)、あるいは、`public` で `delete`(C++11 から)である。 +- コピー代入演算子は、 + - C++03 : アクセス指定子`private`で宣言のみされ、定義はされない + - C++11 : アクセス指定子`public`で`delete`定義される (いずれにせよコピーすることはできないが、`public` で `delete` の方が誤ってコピーしようとした際のエラーメッセージが分かりやすいため、変更されている) - コピー代入演算子が宣言されているため、ムーブ代入演算子も自動生成されない。 diff --git a/reference/ios/ios_base/op_constructor.md b/reference/ios/ios_base/op_constructor.md index 891ac736b4..79f298540f 100644 --- a/reference/ios/ios_base/op_constructor.md +++ b/reference/ios/ios_base/op_constructor.md @@ -29,7 +29,9 @@ public: ## 備考 - コンストラクタが `protected` であることからも分かるとおり、[`ios_base`](../ios_base.md) は直接使用するのではなく継承されることを想定している。 通常は、[`ios_base`](../ios_base.md)、あるいは、その直接の派生クラスである [`basic_ios`](../basic_ios.md) を直接継承するのではなく、[`basic_istream`](../../istream/basic_istream.md)、[`basic_ostream`](../../ostream/basic_ostream.md)、[`basic_iostream`](../../istream/basic_iostream.md) のいずれかを継承することになるだろう。 -- コピーコンストラクタは `private` で未定義(C++03 まで)、あるいは、`public` で `delete`(C++11 から)である。 +- コピーコンストラクタは、 + - C++03 : アクセス指定子`private`で宣言のみされ、定義はされない + - C++11 : アクセス指定子`public`で`delete`定義される (いずれにせよコピーすることはできないが、`public` で `delete` の方が誤ってコピーしようとした際のエラーメッセージが分かりやすいため、変更されている) - コピーコンストラクタが宣言されているため、ムーブコンストラクタも自動生成されない。 diff --git a/reference/node_handle/node_handle.md b/reference/node_handle/node_handle.md index 0f3ba51b10..4fe61d338a 100644 --- a/reference/node_handle/node_handle.md +++ b/reference/node_handle/node_handle.md @@ -32,7 +32,7 @@ class node_handle; ノードハンドルが空でない場合は、要素が抽出されたときのコンテナのアロケータと等しいアロケータが含まれる。ノードハンドルが空の場合、アロケータは含まれない。 -`key_type` を `K`、 `mapped_type` を `T` としたとき、`std::pair`または`std::pair`に対するユーザー定義の特殊化が存在する場合、ノードハンドルを用いる操作は未定義である。 +`key_type` を `K`、 `mapped_type` を `T` としたとき、`std::pair`または`std::pair`に対するユーザー定義の特殊化が存在する場合、ノードハンドルを用いる操作は定義されない。 また、`node_handle`はムーブオンリーである。 From dfc91f8edde323ada180b0e3fe2122bd6d8ffd6d Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 30 Aug 2024 13:46:57 +0900 Subject: [PATCH 1176/3948] =?UTF-8?q?=E7=94=A8=E8=AA=9E=20:=20=E3=80=8C?= =?UTF-8?q?=E6=9C=AA=E5=AE=9A=E7=BE=A9=E5=8B=95=E4=BD=9C=E3=80=8D=E3=81=AE?= =?UTF-8?q?=E6=84=8F=E5=91=B3=E3=81=A7=E3=80=8C=E6=9C=AA=E5=AE=9A=E7=BE=A9?= =?UTF-8?q?=E3=80=8D=E3=82=92=E4=BD=BF=E3=81=A3=E3=81=A6=E3=81=84=E3=81=9F?= =?UTF-8?q?=E3=81=A8=E3=81=93=E3=82=8D=E3=82=92=E3=80=8C=E6=9C=AA=E5=AE=9A?= =?UTF-8?q?=E7=BE=A9=E5=8B=95=E4=BD=9C=E3=80=8D=E3=81=AB=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=20#1348?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/new/op_new.md | 4 ++-- reference/new/op_new[].md | 4 ++-- reference/ranges/range_adaptor_closure.md | 4 ++-- reference/regex/regex_iterator.md | 4 ++-- reference/regex/regex_token_iterator.md | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/reference/new/op_new.md b/reference/new/op_new.md index c098d8be1e..e161451aa7 100644 --- a/reference/new/op_new.md +++ b/reference/new/op_new.md @@ -73,7 +73,7 @@ void* operator new(std::size_t size, void* ptr) noexcept; // (5) C++11 ## 備考 - (1)と(2)、および、(3)と(4) の形式は、`size` が `0` でも他の確保済みの記憶域と異なるアドレスを返す。 - ただし、記憶域の確保に失敗する可能性もあり、また、成功しても当該ポインタを間接参照した場合の結果は未定義である。 + ただし、記憶域の確保に失敗する可能性もあり、また、成功しても当該ポインタを間接参照した場合は未定義動作となる。 - (1)と(2)、および、(3)と(4) の形式は、利用者がこれらとおなじシグネチャの関数を用意することで、標準ライブラリの提供している関数を置き換えることができる。 なお、(5) の形式については、置き換えることはできない(許可されていない)。 @@ -82,7 +82,7 @@ void* operator new(std::size_t size, void* ptr) noexcept; // (5) C++11 このとき、`align_val_t(alignof(T))` が引数として渡される。この閾値は定義済みマクロ `__STDCPP_DEFAULT_NEW_ALIGNMENT__` で提供される。 既存のコードを利用する観点から、利用者が `operator new` を置き換えていた場合は、その型がデフォルトより大きなアライメントを要求していたとしても、ユーザーが置き換えた関数が使用される。 -- (2)、および、(4) の形式において、`alignment` に無効な値を渡した場合、その動作は未定義である。 +- (2)、および、(4) の形式において、`alignment` に無効な値を渡した場合、未定義動作となる。 - (1)と(2) の形式の `operator new` を呼び出すだけであれば、(`new` 式から間接的に呼ばれる場合も含めて)`new` ヘッダをインクルードする必要はない。 diff --git a/reference/new/op_new[].md b/reference/new/op_new[].md index 8be12c5756..7c66e5c2fd 100644 --- a/reference/new/op_new[].md +++ b/reference/new/op_new[].md @@ -65,7 +65,7 @@ void* operator new[](std::size_t size, void* ptr) noexcept; // (5) ## 備考 - (1)と(2)、および、(3)と(4) の形式は、`size` が `0` でも他の確保済みの記憶域と異なるアドレスを返す。 - ただし、記憶域の確保に失敗する可能性もあり、また、成功しても当該ポインタを間接参照した場合の結果は未定義である。 + ただし、記憶域の確保に失敗する可能性もあり、また、成功しても当該ポインタを間接参照した場合は未定義動作となる。 - (1)と(2)、および、(3)と(4) の形式は、利用者がこれらとおなじシグネチャの関数を用意することで、標準ライブラリの提供している関数を置き換えることができる。 なお、(5) の形式については、置き換えることはできない(許可されていない)。 @@ -74,7 +74,7 @@ void* operator new[](std::size_t size, void* ptr) noexcept; // (5) このとき、`align_val_t(alignof(T))` が引数として渡される。この閾値は定義済みマクロ `__STDCPP_DEFAULT_NEW_ALIGNMENT__` で提供される。 既存のコードを利用する観点から、利用者が `operator new` を置き換えていた場合は、その型がデフォルトより大きなアライメントを要求していたとしても、ユーザーが置き換えた関数が使用される。 -- (2)、および、(4) の形式において、`alignment` に無効な値を渡した場合、その動作は未定義である。 +- (2)、および、(4) の形式において、`alignment` に無効な値を渡した場合、未定義動作となる。 - (1)と(2) の形式の `operator new[]` を呼び出すだけであれば、(`new` 式から間接的に呼ばれる場合も含めて)`new` ヘッダをインクルードする必要はない。 diff --git a/reference/ranges/range_adaptor_closure.md b/reference/ranges/range_adaptor_closure.md index b1ca321d94..8a23ef5142 100644 --- a/reference/ranges/range_adaptor_closure.md +++ b/reference/ranges/range_adaptor_closure.md @@ -25,9 +25,9 @@ namespace std::ranges { テンプレートパラメーター`D`は不完全型であってもよい。 ただし、`D`が`|`演算子のオペランドとなる場合は、`D`は完全型かつ[`derived_from`](/reference/concepts/derived_from.md)`>`のモデルでなければならない。 -CV修飾を含む`D`を引数とする `|` 演算子を含む式の動作は、プログラム定義の`operator|`関数が選択された場合は未定義である。 +CV修飾を含む`D`を引数とする `|` 演算子を含む式の動作は、プログラム定義の`operator|`関数が選択された場合は未定義動作である。 -`range_adaptor_closure`を特殊化するプログラムの動作は未定義である。 +`range_adaptor_closure`を特殊化するプログラムは未定義動作となる。 ## この機能が必要になった背景・経緯 diff --git a/reference/regex/regex_iterator.md b/reference/regex/regex_iterator.md index 6afd97a34a..566cf1306b 100644 --- a/reference/regex/regex_iterator.md +++ b/reference/regex/regex_iterator.md @@ -29,8 +29,8 @@ namespace std { イテレータが終端まで来たとき(つまり、[`regex_search`](regex_search.md) が `false` を返したとき)、当該イテレータはシーケンスの終端を示す特別な値となる。 この、シーケンスの終端を示す特別な値は、`regex_iterator` オブジェクトをデフォルトコンストラクタにより構築した場合にも生成されるため、この値と比較することによってシーケンスの終端であるか否か(つまり、マッチしなかったか否か)が判別できる。 -シーケンス終端のイテレータに対する [`operator*`](regex_iterator/op_deref.md) 演算子適用は未定義である。その他のイテレータに対する [`operator*`](regex_iterator/op_deref.md) 演算子適用の結果は `const` [`match_results`](match_results.md)`&` である。 -同様に、シーケンス終端のイテレータに対する [`operator->`](regex_iterator/op_arrow.md) 演算子適用は未定義である。その他のイテレータに対する [`operator->`](regex_iterator/op_arrow.md) 演算子適用の結果は `const` [`match_results`](match_results.md)`*` である。 +シーケンス終端のイテレータに対する [`operator*`](regex_iterator/op_deref.md) 演算子適用は未定義動作となる。その他のイテレータに対する [`operator*`](regex_iterator/op_deref.md) 演算子適用の結果は `const` [`match_results`](match_results.md)`&` である。 +同様に、シーケンス終端のイテレータに対する [`operator->`](regex_iterator/op_arrow.md) 演算子適用は未定義動作となる。その他のイテレータに対する [`operator->`](regex_iterator/op_arrow.md) 演算子適用の結果は `const` [`match_results`](match_results.md)`*` である。 なお、本サイトの `regex_iterator` の各説明では、規格にならって以下のプライベートなメンバ変数が存在する前提で記載している。 diff --git a/reference/regex/regex_token_iterator.md b/reference/regex/regex_token_iterator.md index b16e4c13f1..2ce630ebf2 100644 --- a/reference/regex/regex_token_iterator.md +++ b/reference/regex/regex_token_iterator.md @@ -37,8 +37,8 @@ namespace std { `position` が終端まで来た時に、`subs` に `-1` が含まれていない、または、`position` が直前にマッチした文字列の後ろに文字列が残っていない場合、および、接尾辞イテレータがインクリメントされた場合、当該オブジェクトは、シーケンスの終端を示す特別な値となる。 この、シーケンスの終端を示す特別な値は、`regex_token_iterator` オブジェクトをデフォルトコンストラクタにより構築した場合にも生成されるため、この値と比較することによってシーケンスの終端であるか否か(つまり、マッチしなかったか否か)が判別できる。 -シーケンス終端のイテレータに対する [`operator*`](regex_token_iterator/op_deref.md) 演算子適用は未定義である。その他のイテレータに対する [`operator*`](regex_token_iterator/op_deref.md) 演算子適用の結果は `const` [`sub_match`](sub_match.md)`&` である。 -同様に、シーケンス終端のイテレータに対する [`operator->`](regex_token_iterator/op_arrow.md) 演算子適用は未定義である。その他のイテレータに対する [`operator->`](regex_token_iterator/op_arrow.md) 演算子適用の結果は `const` [`sub_match`](sub_match.md)`*` である。 +シーケンス終端のイテレータに対する [`operator*`](regex_token_iterator/op_deref.md) 演算子適用は未定義動作となる。その他のイテレータに対する [`operator*`](regex_token_iterator/op_deref.md) 演算子適用の結果は `const` [`sub_match`](sub_match.md)`&` である。 +同様に、シーケンス終端のイテレータに対する [`operator->`](regex_token_iterator/op_arrow.md) 演算子適用は未定義動作となる。その他のイテレータに対する [`operator->`](regex_token_iterator/op_arrow.md) 演算子適用の結果は `const` [`sub_match`](sub_match.md)`*` である。 なお、本サイトの `regex_token_iterator` の各説明(上記も含む)では、規格にならって以下のプライベートなメンバ変数が存在する前提で記載している。 From 362d095d80daf14af6339f7f761c783200ecea47 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sat, 31 Aug 2024 01:37:46 +0900 Subject: [PATCH 1177/3948] =?UTF-8?q?pairwise=20=E3=81=AE=E8=A7=A3?= =?UTF-8?q?=E8=AA=AC=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/adjacent_view.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/reference/ranges/adjacent_view.md b/reference/ranges/adjacent_view.md index b39e3dc454..c43cdb9997 100644 --- a/reference/ranges/adjacent_view.md +++ b/reference/ranges/adjacent_view.md @@ -11,7 +11,10 @@ namespace std::ranges { class adjacent_view : public view_interface> {…… }; // (1) namespace views { + template inline constexpr /*unspecified*/ adjacent = /*unspecified*/; // (2) + + inline constexpr auto pairwise = adjacent<2>; // (3) } } ``` @@ -25,7 +28,8 @@ namespace std::ranges { `N` が元となるRangeの要素数より大きい場合、この[`view`](view.md)は空である。 - (1): `adjacent_view`のクラス定義 -- (2): `adjacent_view`を生成するカスタマイゼーションポイントオブジェクト +- (2): `adjacent_view`を生成するカスタマイゼーションポイントオブジェクト(変数テンプレート) +- (3): `adjacent<2>` の別名 ### Rangeコンセプト From 8509d1127f0e8cdff07987f61488fc4c9b6d170a Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sat, 31 Aug 2024 01:46:54 +0900 Subject: [PATCH 1178/3948] =?UTF-8?q?pairwise=20=E3=81=B8=E3=81=AE?= =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/reference/ranges.md b/reference/ranges.md index 2b5d9e6c77..89f58b449c 100644 --- a/reference/ranges.md +++ b/reference/ranges.md @@ -217,6 +217,8 @@ range | adaptor(args...) このとき、式`adaptor(args...)`の値がRangeアダプタクロージャオブジェクトになっている。 +なお、 + | 名前 | 説明 | 対応バージョン | |--------------------------------------------------------------|---------------------------------------------------------------------|----------------| | [`range_adaptor_closure`](ranges/range_adaptor_closure.md) | Rangeアダプタクロージャオブジェクトの基底クラス (class template) | C++23 | @@ -376,10 +378,11 @@ range | adaptor(args...) ### adjacent view -| 名前 | 説明 | 対応バージョン | -|------------------------------------------------------------------|------------------------------------------------------------------------------------|----------------| -| [`adjacent_view`](ranges/adjacent_view.md) | 各要素とそれに隣接する要素を指定個数ずつ取り出した`tuple`のビュー (class template) | C++23 | -| [`views::adjacent`](ranges/adjacent_view.md) | `adjacent_view`を生成する (customization point object) | C++23 | +| 名前 | 説明 | 対応バージョン | +|--------------------------------------------------------|------------------------------------------------------------------------------------|----------------| +| [`adjacent_view`](ranges/adjacent_view.md) | 各要素とそれに隣接する要素を指定個数ずつ取り出した`tuple`のビュー (class template) | C++23 | +| [`views::adjacent`](ranges/adjacent_view.md) | `adjacent_view`を生成する (variable template) | C++23 | +| [`views::pairwise`](ranges/adjacent_view.md) | `adjacent<2>`の別名 (customization point object) | C++23 | ### adjacent transform view From 863b61ff3a81fd919a83501c5d920a6faa564fe6 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sat, 31 Aug 2024 01:54:04 +0900 Subject: [PATCH 1179/3948] =?UTF-8?q?elements=5Fview=20=E3=81=AE=E8=AA=AC?= =?UTF-8?q?=E6=98=8E=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 1 + reference/ranges.md | 6 +++--- reference/ranges/elements_view.md | 18 +++++------------- 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 853f1a1966..040bd8f9ac 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -275,6 +275,7 @@ * is_object_v[link /reference/type_traits/is_object.md] * remove_cv_t[link /reference/type_traits/remove_cv.md] * remove_cvref_t[link /reference/type_traits/remove_cvref.md] + * remove_reference_t[link /reference/type_traits/remove_reference.md] * std::false_type[link /reference/type_traits/false_type.md] * std::is_same_v[link /reference/type_traits/is_same.md] * std::is_same[link /reference/type_traits/is_same.md] diff --git a/reference/ranges.md b/reference/ranges.md index 89f58b449c..c7e7f92344 100644 --- a/reference/ranges.md +++ b/reference/ranges.md @@ -348,9 +348,9 @@ range | adaptor(args...) | 名前 | 説明 | 対応バージョン | |---------------------------------------------------|--------------------------------------------------------|----------------| -| [`elements_view`](ranges/elements_view.md) | 第n要素を集めたビュー (class template) | C++20 | -| [`keys_view`](ranges/elements_view.md) | 第0要素を集めたビュー (alias template) | C++20 | -| [`values_view`](ranges/elements_view.md) | 第1要素を集めたビュー (alias template) | C++20 | +| [`elements_view`](ranges/elements_view.md) | タプルの第N要素にアクセスするビュー (class template) | C++20 | +| [`keys_view`](ranges/elements_view.md) | タプルの第0要素にアクセスするビュー (alias template) | C++20 | +| [`values_view`](ranges/elements_view.md) | タプルの第1要素にアクセスするビュー (alias template) | C++20 | | [`views::elements`](ranges/elements_view.md) | `elements_view`を生成する (customization point object) | C++20 | | [`views::keys`](ranges/elements_view.md) | `keys_view`を生成する (customization point object) | C++20 | | [`views::values`](ranges/elements_view.md) | `values_view`を生成する (customization point object) | C++20 | diff --git a/reference/ranges/elements_view.md b/reference/ranges/elements_view.md index edbb9e6588..0090fc63fc 100644 --- a/reference/ranges/elements_view.md +++ b/reference/ranges/elements_view.md @@ -27,31 +27,23 @@ namespace std::ranges { } } ``` -* view[link view.md] -* range_value_t[link range_value_t.md] -* remove_reference_t[link /reference/type_traits/remove_reference.md] -* range_reference_t[link range_reference_t.md] -* view_interface[link view_interface.md] -* views::all_t[link all.md] ## 概要 -タプルと見なせる型を要素とするRangeに対して、各要素に[`get`](/reference/tuple/tuple/get.md)を適用する[`view`](view.md)。 +タプルと見なせる型を要素とするRangeに対して、各タプルの第N要素だけにアクセスする[`view`](view.md)。要素へのアクセスは[`get`](/reference/tuple/tuple/get.md)``による。 -- (1): 各要素に[`get`](/reference/tuple/tuple/get.md)``を適用する[`view`](view.md) -- (2): 各要素に[`get`](/reference/tuple/tuple/get.md)`<0>`を適用する[`view`](view.md) -- (3): 各要素に[`get`](/reference/tuple/tuple/get.md)`<1>`を適用する[`view`](view.md) +- (1): 第N要素だけにアクセスする[`view`](view.md) +- (2): 第1要素だけにアクセスする[`view`](view.md) +- (3): 第2要素だけにアクセスする[`view`](view.md) - (4): `elements_view`を生成するRangeアダプタオブジェクト - (5): `keys_view`を生成するRangeアダプタオブジェクト - (6): `values_view`を生成するRangeアダプタオブジェクト -`elements`で得られる[`view`](view.md)の大きさは、指定した個数に関わらず、元のRangeの大きさを超えることは無い。 - ### Rangeコンセプト | borrowed | sized | output | input | forward | bidirectional | random_access | contiguous | common | viewable | view | |----------|-------|--------|-------|---------|---------------|---------------|------------|--------|----------|------| -| (1) | (1) | (1) | (1) | (1) | (1) | (1) | | (1) | ○ | ○ | +| (1) | (1) | (1) | (1) | (1) | (1) | (1) | | (1) | ○ | ○ | - (1): `V`に従う From 4480388968a9520f87470287392f1d31354c179b Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sat, 31 Aug 2024 01:58:39 +0900 Subject: [PATCH 1180/3948] =?UTF-8?q?=E3=83=91=E3=82=A4=E3=83=97=E3=83=A9?= =?UTF-8?q?=E3=82=A4=E3=83=B3=E8=A8=98=E6=B3=95=E3=82=92=E6=8F=90=E4=BE=9B?= =?UTF-8?q?=E3=81=97=E3=81=AA=E3=81=84Range=E3=82=A2=E3=83=80=E3=83=97?= =?UTF-8?q?=E3=82=BF=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6=E3=81=AE=E8=AA=AC?= =?UTF-8?q?=E6=98=8E=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/ranges.md b/reference/ranges.md index c7e7f92344..5a824b4bf6 100644 --- a/reference/ranges.md +++ b/reference/ranges.md @@ -217,7 +217,7 @@ range | adaptor(args...) このとき、式`adaptor(args...)`の値がRangeアダプタクロージャオブジェクトになっている。 -なお、 +なお、元となるRangeを複数とるRangeアダプタは、パイプライン記法を提供しない。 | 名前 | 説明 | 対応バージョン | |--------------------------------------------------------------|---------------------------------------------------------------------|----------------| From 9c0072035c215430fa226e4830bd839015bd4c77 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Sun, 1 Sep 2024 18:49:52 +0900 Subject: [PATCH 1181/3948] =?UTF-8?q?Filter=20view:=20=E8=AA=AC=E6=98=8E?= =?UTF-8?q?=E3=82=92=E5=BE=AE=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/filter_view/iterator/op_decrement.md | 1 + reference/ranges/filter_view/iterator/op_increment.md | 1 + 2 files changed, 2 insertions(+) diff --git a/reference/ranges/filter_view/iterator/op_decrement.md b/reference/ranges/filter_view/iterator/op_decrement.md index c7405e6c77..79450e66d9 100644 --- a/reference/ranges/filter_view/iterator/op_decrement.md +++ b/reference/ranges/filter_view/iterator/op_decrement.md @@ -34,6 +34,7 @@ auto tmp = *this; --*this; return tmp; ``` + と等しい。 ## 例 diff --git a/reference/ranges/filter_view/iterator/op_increment.md b/reference/ranges/filter_view/iterator/op_increment.md index c217c2883a..28de17ad08 100644 --- a/reference/ranges/filter_view/iterator/op_increment.md +++ b/reference/ranges/filter_view/iterator/op_increment.md @@ -40,6 +40,7 @@ auto tmp = *this; ++*this; return tmp; ``` + と等しい。 ## 例 From 5eba34f842063114b8cf939ed565e415e085e51f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 3 Sep 2024 14:39:44 +0900 Subject: [PATCH 1182/3948] =?UTF-8?q?range=5Fadaptor=5Fclosure=20:=20?= =?UTF-8?q?=E3=80=8C=E6=9C=AA=E5=AE=9A=E7=BE=A9=E5=8B=95=E4=BD=9C=E3=81=A8?= =?UTF-8?q?=E3=81=AA=E3=82=8B=E3=80=8D=20=E2=86=92=20=E3=80=8C=E6=9C=AA?= =?UTF-8?q?=E5=AE=9A=E7=BE=A9=E5=8B=95=E4=BD=9C=E3=82=92=E5=BC=95=E3=81=8D?= =?UTF-8?q?=E8=B5=B7=E3=81=93=E3=81=99=E3=80=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Koichi Murase --- reference/ranges/range_adaptor_closure.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/ranges/range_adaptor_closure.md b/reference/ranges/range_adaptor_closure.md index 8a23ef5142..e80465a389 100644 --- a/reference/ranges/range_adaptor_closure.md +++ b/reference/ranges/range_adaptor_closure.md @@ -27,7 +27,7 @@ namespace std::ranges { CV修飾を含む`D`を引数とする `|` 演算子を含む式の動作は、プログラム定義の`operator|`関数が選択された場合は未定義動作である。 -`range_adaptor_closure`を特殊化するプログラムは未定義動作となる。 +`range_adaptor_closure`を特殊化するプログラムは未定義動作を引き起こす。 ## この機能が必要になった背景・経緯 From f3e89a59092f7f8fb4c70f860e222b44df482824 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 3 Sep 2024 15:17:49 +0900 Subject: [PATCH 1183/3948] =?UTF-8?q?=E7=94=A8=E8=AA=9E=20:=20=E3=80=8C?= =?UTF-8?q?=E6=9C=AA=E5=AE=9A=E7=BE=A9=E5=8B=95=E4=BD=9C=E3=81=A8=E3=81=AA?= =?UTF-8?q?=E3=82=8B=E3=80=8D=20=E2=86=92=20=E3=80=8C=E6=9C=AA=E5=AE=9A?= =?UTF-8?q?=E7=BE=A9=E5=8B=95=E4=BD=9C=E3=82=92=E5=BC=95=E3=81=8D=E8=B5=B7?= =?UTF-8?q?=E3=81=93=E3=81=99=E3=80=8D=20#1348?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflows/script/defined_word_check.py | 21 +++++++++++++++---- implementation-status.md | 2 +- lang/cpp11/lambda_expressions.md | 2 +- ...ss_objects_containing_reference_members.md | 4 ++-- lang/cpp20/consistent_comparison.md | 2 +- ...sized_delete_for_variable_sized_classes.md | 6 +++--- ...jects_for_low-level_object_manipulation.md | 18 ++++++++-------- lang/cpp26.md | 2 +- reference/concepts.md | 2 +- reference/cstdlib/div.md | 2 +- reference/forward_list/forward_list/merge.md | 2 +- reference/future/shared_future/get.md | 2 +- reference/ios/basic_ios/op_constructor.md | 2 +- reference/ios/fpos.md | 2 +- reference/ios/ios_base/op_constructor.md | 2 +- reference/iterator/unreachable_sentinel_t.md | 4 ++-- reference/iterator/weakly_incrementable.md | 2 +- .../shared_from_this.md | 2 +- .../atomic_compare_exchange_strong.md | 2 +- ...atomic_compare_exchange_strong_explicit.md | 2 +- .../atomic_compare_exchange_weak.md | 2 +- .../atomic_compare_exchange_weak_explicit.md | 2 +- .../memory/shared_ptr/atomic_exchange.md | 2 +- .../shared_ptr/atomic_exchange_explicit.md | 2 +- .../memory/shared_ptr/atomic_is_lock_free.md | 2 +- reference/memory/shared_ptr/atomic_load.md | 2 +- .../memory/shared_ptr/atomic_load_explicit.md | 2 +- reference/memory/shared_ptr/atomic_store.md | 2 +- .../shared_ptr/atomic_store_explicit.md | 2 +- .../memory/shared_ptr/const_pointer_cast.md | 2 +- .../memory/shared_ptr/dynamic_pointer_cast.md | 2 +- .../shared_ptr/reinterpret_pointer_cast.md | 2 +- .../memory/shared_ptr/static_pointer_cast.md | 2 +- reference/new/op_new.md | 4 ++-- reference/new/op_new[].md | 4 ++-- reference/optional/optional/op_deref.md | 2 +- reference/ranges/filter_view.md | 2 +- reference/regex/regex_iterator.md | 4 ++-- reference/regex/regex_iterator/op_arrow.md | 2 +- reference/regex/regex_iterator/op_deref.md | 2 +- .../regex/regex_iterator/op_increment.md | 2 +- reference/regex/regex_token_iterator.md | 4 ++-- .../regex/regex_token_iterator/op_arrow.md | 2 +- .../regex/regex_token_iterator/op_deref.md | 2 +- .../regex_token_iterator/op_increment.md | 2 +- .../string_view/basic_string_view/op_at.md | 2 +- .../type_traits/basic_common_reference.md | 2 +- reference/type_traits/common_type.md | 2 +- reference/unordered_map/unordered_map/swap.md | 2 +- .../unordered_map/unordered_multimap/swap.md | 2 +- .../unordered_set/unordered_multiset/swap.md | 2 +- reference/unordered_set/unordered_set/swap.md | 2 +- reference/utility/unreachable.md | 2 +- .../valarray/gslice_array/op_and_assign.md | 2 +- reference/valarray/gslice_array/op_assign.md | 2 +- .../valarray/gslice_array/op_divide_assign.md | 2 +- .../gslice_array/op_left_shift_assign.md | 2 +- .../valarray/gslice_array/op_minus_assign.md | 2 +- .../valarray/gslice_array/op_modulo_assign.md | 2 +- .../gslice_array/op_multiply_assign.md | 2 +- .../valarray/gslice_array/op_or_assign.md | 2 +- .../valarray/gslice_array/op_plus_assign.md | 2 +- .../gslice_array/op_right_shift_assign.md | 2 +- .../valarray/gslice_array/op_xor_assign.md | 2 +- .../valarray/indirect_array/op_and_assign.md | 2 +- .../valarray/indirect_array/op_assign.md | 2 +- .../indirect_array/op_divide_assign.md | 2 +- .../indirect_array/op_left_shift_assign.md | 2 +- .../indirect_array/op_minus_assign.md | 2 +- .../indirect_array/op_modulo_assign.md | 2 +- .../indirect_array/op_multiply_assign.md | 2 +- .../valarray/indirect_array/op_or_assign.md | 2 +- .../valarray/indirect_array/op_plus_assign.md | 2 +- .../indirect_array/op_right_shift_assign.md | 2 +- .../valarray/indirect_array/op_xor_assign.md | 2 +- .../valarray/mask_array/op_and_assign.md | 2 +- reference/valarray/mask_array/op_assign.md | 2 +- .../valarray/mask_array/op_divide_assign.md | 2 +- .../mask_array/op_left_shift_assign.md | 2 +- .../valarray/mask_array/op_minus_assign.md | 2 +- .../valarray/mask_array/op_modulo_assign.md | 2 +- .../valarray/mask_array/op_multiply_assign.md | 2 +- reference/valarray/mask_array/op_or_assign.md | 2 +- .../valarray/mask_array/op_plus_assign.md | 2 +- .../mask_array/op_right_shift_assign.md | 2 +- .../valarray/mask_array/op_xor_assign.md | 2 +- .../valarray/slice_array/op_and_assign.md | 2 +- reference/valarray/slice_array/op_assign.md | 2 +- .../valarray/slice_array/op_divide_assign.md | 2 +- .../slice_array/op_left_shift_assign.md | 2 +- .../valarray/slice_array/op_minus_assign.md | 2 +- .../valarray/slice_array/op_modulo_assign.md | 2 +- .../slice_array/op_multiply_assign.md | 2 +- .../valarray/slice_array/op_or_assign.md | 2 +- .../valarray/slice_array/op_plus_assign.md | 2 +- .../slice_array/op_right_shift_assign.md | 2 +- .../valarray/slice_array/op_xor_assign.md | 2 +- reference/valarray/valarray/atan2.md | 2 +- reference/valarray/valarray/max.md | 2 +- reference/valarray/valarray/min.md | 2 +- reference/valarray/valarray/op_and.md | 2 +- reference/valarray/valarray/op_and_assign.md | 2 +- reference/valarray/valarray/op_at.md | 4 ++-- reference/valarray/valarray/op_constructor.md | 2 +- reference/valarray/valarray/op_divide.md | 2 +- .../valarray/valarray/op_divide_assign.md | 2 +- reference/valarray/valarray/op_equal.md | 2 +- reference/valarray/valarray/op_greater.md | 2 +- .../valarray/valarray/op_greater_equal.md | 2 +- reference/valarray/valarray/op_left_shift.md | 2 +- .../valarray/valarray/op_left_shift_assign.md | 2 +- reference/valarray/valarray/op_less.md | 2 +- reference/valarray/valarray/op_less_equal.md | 2 +- reference/valarray/valarray/op_logical_and.md | 2 +- reference/valarray/valarray/op_logical_or.md | 2 +- reference/valarray/valarray/op_minus.md | 2 +- .../valarray/valarray/op_minus_assign.md | 2 +- reference/valarray/valarray/op_modulo.md | 2 +- .../valarray/valarray/op_modulo_assign.md | 2 +- reference/valarray/valarray/op_multiply.md | 2 +- .../valarray/valarray/op_multiply_assign.md | 2 +- reference/valarray/valarray/op_not_equal.md | 2 +- reference/valarray/valarray/op_or.md | 2 +- reference/valarray/valarray/op_or_assign.md | 2 +- reference/valarray/valarray/op_plus.md | 2 +- reference/valarray/valarray/op_plus_assign.md | 2 +- reference/valarray/valarray/op_right_shift.md | 2 +- .../valarray/op_right_shift_assign.md | 2 +- reference/valarray/valarray/op_xor.md | 2 +- reference/valarray/valarray/op_xor_assign.md | 2 +- reference/valarray/valarray/pow.md | 2 +- reference/valarray/valarray/sum.md | 2 +- reference/vector/vector/op_at.md | 2 +- 133 files changed, 166 insertions(+), 153 deletions(-) diff --git a/.github/workflows/script/defined_word_check.py b/.github/workflows/script/defined_word_check.py index 1606c8982a..f44cc81878 100644 --- a/.github/workflows/script/defined_word_check.py +++ b/.github/workflows/script/defined_word_check.py @@ -6,8 +6,8 @@ import re DEFINED_WORD_LIST = [ - # ターゲット用語, その用語の許可された使用方法リスト - ("未定義", ["未定義動作", "未定義の動作", "動作は未定義", "未定義アドレス"]), + # ターゲット用語, その用語の許可された使用方法リスト, 許可しない使用方法リスト + ("未定義", ["未定義動作", "未定義の動作", "動作は未定義", "未定義アドレス"], ["未定義動作となる"]), # 「未定義アドレス」は意味が明確に規定されていない。規定されたら「未定義動作」を使用した説明に差し替える # LWG issue 3906. "Undefined address" is undefined # https://cplusplus.github.io/LWG/issue3906 @@ -16,7 +16,7 @@ def check_defined_word(text: str, filename: str) -> bool: found_error: bool = False - for word, allow_list in DEFINED_WORD_LIST: + for word, allow_list, disallow_list in DEFINED_WORD_LIST: match_list = [m.start() for m in re.finditer(word, text)] if len(match_list) == 0: continue @@ -35,7 +35,20 @@ def check_defined_word(text: str, filename: str) -> bool: if sliced == allow_word: ok_count += 1 - if ok_count == 0: + ng_count = 0 + for disallow_word in disallow_list: + index = disallow_word.find(word) + n = len(disallow_word) + + if i - index < 0: + continue + + j = i - index + sliced = text[j:j+n] + if sliced == disallow_word: + ng_count += 1 + + if ok_count == 0 or ng_count > 0: start = text.rfind('\n', 0, i) if start < 0: start = 0 diff --git a/implementation-status.md b/implementation-status.md index 580603a293..307c5a5f1c 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -309,7 +309,7 @@ | P2573R2: [関数宣言を削除する理由を指定できるようにする](/lang/cpp26/delete_reason.md.nolink) | `f() = delete("reason");` | 15 | 19 | | | | P2893R3: [可変引数テンプレートで`friend`宣言をできるようにする](/lang/cpp26/variadic_friends.md.nolink) | クラステンプレートの可変引数テンプレートでまとめて`friend`宣言できるようにする | 15 | | | | | P2747R2: [`constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md.nolink) | 定数式の文脈での配置`new`を許可 | | | | | -| P3144R2: [不完全型へのポインタに対する`delete`を不適格とする](/lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md.nolink) | 未定義動作となる操作をコンパイルエラーとする | 15 | 19 | | | +| P3144R2: [不完全型へのポインタに対する`delete`を不適格とする](/lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md.nolink) | 未定義動作を引き起こす操作をコンパイルエラーとする | 15 | 19 | | | | P2963R3: [制約式内での畳み込み式の順序付け](/lang/cpp26/ordering_of_constraints_involving_fold_expressions.md.nolink) | 畳み込み式では全体ではなく個別の制約を原子制約式として扱う | | 19 | | | | P0963R3: [条件式での構造化束縛の使用を許可](/lang/cpp26/structured_binding_declaration_as_a_condition.md.nolink) | 式全体を`bool`値に変換できる場合に条件式で構造化束縛を使用できることとする | 15 | | | | diff --git a/lang/cpp11/lambda_expressions.md b/lang/cpp11/lambda_expressions.md index e9da6fe2c6..75d47d4225 100644 --- a/lang/cpp11/lambda_expressions.md +++ b/lang/cpp11/lambda_expressions.md @@ -215,7 +215,7 @@ member_value_ : 5 result : 8 ``` -ラムダ式がひとつ以上の変数を参照キャプチャしている場合、参照している変数の寿命が切れたあとの、ラムダ式のコピーと呼び出しは未定義動作となる。 +ラムダ式がひとつ以上の変数を参照キャプチャしている場合、参照している変数の寿命が切れたあとの、ラムダ式のコピーと呼び出しは未定義動作を引き起こす。 ```cpp example #include diff --git a/lang/cpp17/replacement_of_class_objects_containing_reference_members.md b/lang/cpp17/replacement_of_class_objects_containing_reference_members.md index c005c77677..880ffa01e4 100644 --- a/lang/cpp17/replacement_of_class_objects_containing_reference_members.md +++ b/lang/cpp17/replacement_of_class_objects_containing_reference_members.md @@ -10,7 +10,7 @@ ## 概要 -`placement new`を使用して、参照型や`const`メンバ変数を含む構造体/クラスを置き換える際、オブジェクト生存期間(lifetime)に基づいた最適化の抑止をコンパイラに伝える関数[`std::launder()`](/reference/new/launder.md)を用いることで、未定義動作となるような文脈で参照型や`const`メンバ変数へのアクセスができる。 +`placement new`を使用して、参照型や`const`メンバ変数を含む構造体/クラスを置き換える際、オブジェクト生存期間(lifetime)に基づいた最適化の抑止をコンパイラに伝える関数[`std::launder()`](/reference/new/launder.md)を用いることで、未定義動作を引き起こすような文脈で参照型や`const`メンバ変数へのアクセスができる。 ## 仕様 [n4659](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4659.pdf) [ptr.launder]/5より @@ -99,4 +99,4 @@ public: - [std::launder - cppreference.com](https://en.cppreference.com/w/cpp/utility/launder) - [Pointer safety and placement new](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4303.html) - [Implementability of std::optional (std :: optionalの実装可能性) ](https://groups.google.com/a/isocpp.org/forum/#!msg/std-proposals/93ebFsxCjvQ/Q5LUnO8339wJ) -- [Lifetime - cppreference.com](https://en.cppreference.com/w/cpp/language/lifetime) \ No newline at end of file +- [Lifetime - cppreference.com](https://en.cppreference.com/w/cpp/language/lifetime) diff --git a/lang/cpp20/consistent_comparison.md b/lang/cpp20/consistent_comparison.md index d831455e0c..493117c587 100644 --- a/lang/cpp20/consistent_comparison.md +++ b/lang/cpp20/consistent_comparison.md @@ -107,7 +107,7 @@ bool is_equal = comp == 0.0; 表にあるように3つの比較カテゴリ型はそれぞれ数学的な2項関係(順序関係)の一つと対応している。 三方比較演算子による比較の結果となる値は、これら比較カテゴリ型のいずれかの`prvalue`オブジェクトとなる。 -全てのカテゴリにおいてそのようなオブジェクトの`0`リテラル以外との比較は未定義動作となる。 +全てのカテゴリにおいてそのようなオブジェクトの`0`リテラル以外との比較は未定義動作を引き起こす。 これらの比較カテゴリ型は新しく追加される[``](/reference/compare.md)ヘッダにて定義されるが、`<=>`をコード中で使用したとしても自動でインクルードされないため、`<=>`の使用も含めて比較カテゴリ型を利用する際は``を明示的にインクルードする必要がある。 diff --git a/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md b/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md index 2dc51b7685..39a3118464 100644 --- a/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md +++ b/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md @@ -21,7 +21,7 @@ struct S { // #1 Sのための operator delete オーバーロード void operator delete(void* p) { - // Sのオブジェクトは破棄済みのため、未定義動作となる + // Sのオブジェクトは破棄済みのため、未定義動作を引き起こす const S* self = reinterpret_cast(p); // UB std::cout << self->str; // UB @@ -382,7 +382,7 @@ static void operator delete(void* ptr) { } ``` -しかし、前述のように、この`operator delete`実行の前に`ptr`にあるオブジェクトは破棄されているため、これは未定義動作となる。 +しかし、前述のように、この`operator delete`実行の前に`ptr`にあるオブジェクトは破棄されているため、これは未定義動作を引き起こす。 *destroying operator delete*は、この一番最後の`operator delete`相当のコードを安全にし、このような可変長クラスの`delete`を効率化するために導入された。 @@ -437,4 +437,4 @@ struct S { - [P0722R3 Efficient sized delete for variable sized classes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0722r3.html) - [P0722R1 Efficient sized delete for variable sized classes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0722r1.html) -- [CWG Issue 2248. Problems with sized delete](https://cplusplus.github.io/CWG/issues/2248) \ No newline at end of file +- [CWG Issue 2248. Problems with sized delete](https://cplusplus.github.io/CWG/issues/2248) diff --git a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md index 397f83ecf9..befc5cc1c7 100644 --- a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md +++ b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md @@ -11,7 +11,7 @@ ## 概要 -`new`式ではなく`malloc()`等他の方法で確保されたメモリ領域には、明示的にオブジェクトの構築を行うまで想定する型のオブジェクトは生存期間内になく、そのアクセス(読み書き)は未定義動作となる。 +`new`式ではなく`malloc()`等他の方法で確保されたメモリ領域には、明示的にオブジェクトの構築を行うまで想定する型のオブジェクトは生存期間内になく、そのアクセス(読み書き)は未定義動作を引き起こす。 ```cpp struct X { @@ -47,11 +47,11 @@ X *make_x() { } ``` -一番最初の`malloc()`を用いるコードは主にCのコードと共有する部分で現れることがあり、Cでは問題ないもののC++コードとしてコンパイルした場合にのみ未定義動作となる。C++20からは、この様なコードのC/C++相互運用性向上のために、明示的にオブジェクトを構築する必要がないとみなすことのできる一部の型(*implicit-lifetime types*)に限って、未初期化領域へのアクセス時に暗黙的に(自動的に)オブジェクトが構築される様になり、未定義動作を回避できる様になる。 +一番最初の`malloc()`を用いるコードは主にCのコードと共有する部分で現れることがあり、Cでは問題ないもののC++コードとしてコンパイルした場合にのみ未定義動作を引き起こす。C++20からは、この様なコードのC/C++相互運用性向上のために、明示的にオブジェクトを構築する必要がないとみなすことのできる一部の型(*implicit-lifetime types*)に限って、未初期化領域へのアクセス時に暗黙的に(自動的に)オブジェクトが構築される様になり、未定義動作を回避できる様になる。 ## 問題となる他の例 -以下の例はこの変更によって解決される例であり、C++17以前は未定義動作となるものである。 +以下の例はこの変更によって解決される例であり、C++17以前は未定義動作を引き起こすものである。 ### `operator new` @@ -109,7 +109,7 @@ void process(Stream *stream) { } ``` -1つの領域に複数の型のオブジェクトが同時に生存期間内にあることはないため、`stream->read()`が内部で`Foo, Bar`どちらかのオブジェクトを構築していたとしても、`#1`と`#2`のどちらかのパスは未定義動作となる。そして、この様なコードでは多くの場合、明示的にオブジェクトが構築されることはない。 +1つの領域に複数の型のオブジェクトが同時に生存期間内にあることはないため、`stream->read()`が内部で`Foo, Bar`どちらかのオブジェクトを構築していたとしても、`#1`と`#2`のどちらかのパスは未定義動作を引き起こす。そして、この様なコードでは多くの場合、明示的にオブジェクトが構築されることはない。 ### 動的配列の実装 @@ -154,7 +154,7 @@ int main() { } ``` -C++においては、ポインタに対する演算(`+ -`など)はそのポインタが配列オブジェクトを指している場合にのみ有効となるが、例中の`#a #b #c #d #e #f`で使用されるポインタの指す領域にはいずれも配列オブジェクトが生存期間にない(正確には、非配列オブジェクトのポインタの場合は要素数1の配列として扱われるが、この例の場合はそれを満たすことはほぼなく、満たさないものとする)。そのため、そのポインタをイテレータの様に使用することは未定義動作となる。 +C++においては、ポインタに対する演算(`+ -`など)はそのポインタが配列オブジェクトを指している場合にのみ有効となるが、例中の`#a #b #c #d #e #f`で使用されるポインタの指す領域にはいずれも配列オブジェクトが生存期間にない(正確には、非配列オブジェクトのポインタの場合は要素数1の配列として扱われるが、この例の場合はそれを満たすことはほぼなく、満たさないものとする)。そのため、そのポインタをイテレータの様に使用することは未定義動作を引き起こす。 ## 仕様 @@ -224,13 +224,13 @@ C++においては、ポインタに対する演算(`+ -`など)はそのポ ### 暗黙的なオブジェクト構築 -オブジェクトを暗黙的に構築する操作では、そうすることでプログラムが定義された振る舞いをするようになる(すなわち、未定義動作が回避できる)場合に、*implicit-lifetime types*の0個以上のオブジェクトを暗黙的に構築しその生存期間を開始させる。そのような、暗黙的なオブジェクト構築によってプログラムに定義された振る舞いをもたらすオブジェクトの集合が1つも存在しない場合は未定義動作となる(これは今まで通り)。逆に、そのようなオブジェクトの集合が複数存在している場合は、どのオブジェクトが暗黙的に構築されるかは未規定(これは、都度適切なオブジェクトが選択され構築されることを意図している)。 +オブジェクトを暗黙的に構築する操作では、そうすることでプログラムが定義された振る舞いをするようになる(すなわち、未定義動作が回避できる)場合に、*implicit-lifetime types*の0個以上のオブジェクトを暗黙的に構築しその生存期間を開始させる。そのような、暗黙的なオブジェクト構築によってプログラムに定義された振る舞いをもたらすオブジェクトの集合が1つも存在しない場合は未定義動作を引き起こす(これは今まで通り)。逆に、そのようなオブジェクトの集合が複数存在している場合は、どのオブジェクトが暗黙的に構築されるかは未規定(これは、都度適切なオブジェクトが選択され構築されることを意図している)。 暗黙的なオブジェクト構築が行われる場合、そのサブオブジェクトの*implicit-lifetime types*のオブジェクトも暗黙的に構築され生存期間が開始されるが、*implicit-lifetime types*ではないオブジェクトは暗黙的に構築されないため明示的な初期化が必要となる。 暗黙的なオブジェクト構築を行わなくてもプログラムが定義された振る舞いをする(未定義動作とならない)場合、対象の操作は暗黙的にオブジェクトを構築せず、通常の効果のみをもたらす。 -さらに、オブジェクトを暗黙的に構築する操作の内メモリを確保する関数等一部の操作では、暗黙的なオブジェクト構築によって作成されたオブジェクトを指す適切なポインタを返すことが規定される。これらの操作においては、そのポインタ値を返すことでプログラムが定義された振る舞いをするようになる場合に、指定された領域の先頭アドレスをアドレスとする暗黙的に構築されたオブジェクトの1つを選択し、そのオブジェクトを指すポインタ値を生成しそれを返す。そのような、プログラムに定義された振る舞いをもたらすようなポインタ値が存在しない場合は未定義動作となる。逆に、そのようなポインタ値が複数存在している場合は、どのポインタ値が生成されるかは未規定。 +さらに、オブジェクトを暗黙的に構築する操作の内メモリを確保する関数等一部の操作では、暗黙的なオブジェクト構築によって作成されたオブジェクトを指す適切なポインタを返すことが規定される。これらの操作においては、そのポインタ値を返すことでプログラムが定義された振る舞いをするようになる場合に、指定された領域の先頭アドレスをアドレスとする暗黙的に構築されたオブジェクトの1つを選択し、そのオブジェクトを指すポインタ値を生成しそれを返す。そのような、プログラムに定義された振る舞いをもたらすようなポインタ値が存在しない場合は未定義動作を引き起こす。逆に、そのようなポインタ値が複数存在している場合は、どのポインタ値が生成されるかは未規定。 そのようなポインタ生成を行わなくてもプログラムが定義された振る舞いをする場合、そのようなポインタ値は生成されず、対象の操作は通常のポインタ値を返す。 @@ -381,7 +381,7 @@ unique_ptr Stream::read() { ## この機能が必要になった背景・経緯 -例に上がっているようなコードはC言語では一般的な操作であり、Cでは問題がない。このようなコードはCとC++のコード共有部分でC++コードとして現れる可能性があり、その場合には未定義動作となる。 +例に上がっているようなコードはC言語では一般的な操作であり、Cでは問題がない。このようなコードはCとC++のコード共有部分でC++コードとして現れる可能性があり、その場合には未定義動作を引き起こす。 また、動的配列の例などは、`std::vector`の実装において問題となることで、そこは完全にC++のコードでありながらC++がサポートしてないことを行うことになってしまう。 @@ -413,4 +413,4 @@ unique_ptr Stream::read() { - [P0593R0 What to do with buffers that are not arrays, and undefined behavior thereof?](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0593r0.html) - [CWG Issue 2325. `std::launder` and reuse of character buffers](https://cplusplus.github.io/CWG/issues/2325.html) - [CWG Issue 2605. Implicit-lifetime aggregates](https://cplusplus.github.io/CWG/issues/2605.html) -- [P1839R5 Accessing Object Representations](https://wg21.link/p1839r5) \ No newline at end of file +- [P1839R5 Accessing Object Representations](https://wg21.link/p1839r5) diff --git a/lang/cpp26.md b/lang/cpp26.md index d16be2c15b..5dd202b08d 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -14,7 +14,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | [`std::initializer_list`の配列を静的ストレージに配置する](/lang/cpp26/static_storage_for_braced_initializers.md.nolink) | `std::vector v = {1, 2, 3};`のような初期化で初期化子リストを静的ストレージに配置することで無駄なコピーをなくす | | [宣言のみで使用しない変数の名前として`_`をサポート](/lang/cpp26/nice_placeholder_with_no_name.md.nolink) | 変数名`_`は暗黙で`[[maybe_unused]]`が指定される | | [非推奨となっていた列挙値から算術型への暗黙変換を削除](/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md.nolink) | C++20から非推奨となっていた列挙値への算術演算で算術型に暗黙変換される仕様を削除 | -| [不完全型へのポインタに対する`delete`を不適格とする](/lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md.nolink) | 未定義動作となる操作をコンパイルエラーとする | +| [不完全型へのポインタに対する`delete`を不適格とする](/lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md.nolink) | 未定義動作を引き起こす操作をコンパイルエラーとする | | [返却された左辺値から暗黙変換された一時オブジェクトが参照に束縛されることを禁止する](/lang/cpp26/disallow_binding_a_returned_glvalue_to_a_temporary.md.nolink) | 寿命切れの変数によって引き起こされるバグを防止する | | [要素数不明の配列を集成体初期化する規則を明確化](/lang/cpp26/clarifying_rules_for_brace_elision_in_aggregate_initialization.md.nolink) | 配列要素の集成体初期化で`{}`が省略された場合の矛盾していた規定を修正 | | [未初期化変数の読み取りを不正動作 (erroneous behaviour: EB) とする](/lang/cpp26/erroneous_behaviour_for_uninitialized_reads.md.nolink) | 初期化されていない自動変数の読み取りの安全性を規定する | diff --git a/reference/concepts.md b/reference/concepts.md index 228931d59d..e745f011cd 100644 --- a/reference/concepts.md +++ b/reference/concepts.md @@ -68,7 +68,7 @@ concept C = 型`T`があるコンセプト`C`の構文的な制約(コンセプト定義内の各制約式)を全て満足しそれら制約式の追加の暗黙の意味論的な制約(等しさの保持、安定、入力への副作用の要求および暗黙的な式のバリエーション)についても全て満足していて、`C`に追加で要求されている意味論的な制約(モデルとなる条件)を全て満足するとき、そのような型`T`はコンセプト`C`の __モデル(*model*)__ である。 -モデルとなるための意味論的な制約は文書で指定されているのみであり、通常何らかのチェックは行われない。しかし、標準ライブラリの事前条件などにおいて入力に対してあるコンセプトのモデルである事を要求する場合、モデルとならない型の入力は診断不要の未定義動作となる。 +モデルとなるための意味論的な制約は文書で指定されているのみであり、通常何らかのチェックは行われない。しかし、標準ライブラリの事前条件などにおいて入力に対してあるコンセプトのモデルである事を要求する場合、モデルとならない型の入力は診断不要の未定義動作を引き起こす。 本サイトでは、型がコンセプトのモデルとなるための条件をそのコンセプトの構文的な制約条件とは分けて「モデル」という項に記載する。 diff --git a/reference/cstdlib/div.md b/reference/cstdlib/div.md index afa02c6002..57970c5c82 100644 --- a/reference/cstdlib/div.md +++ b/reference/cstdlib/div.md @@ -58,7 +58,7 @@ namespace std { ## 戻り値 戻り値型となるクラスの`quot`に商、`rem`に剰余を代入して返す。 -結果のどちらかが表現できない場合は未定義動作となる。 +結果のどちらかが表現できない場合は未定義動作を引き起こす。 ## 例 diff --git a/reference/forward_list/forward_list/merge.md b/reference/forward_list/forward_list/merge.md index 18fd55212f..a793007192 100644 --- a/reference/forward_list/forward_list/merge.md +++ b/reference/forward_list/forward_list/merge.md @@ -45,7 +45,7 @@ void merge(forward_list&& x, Compare comp); // (4) ## 備考 - この操作は安定である。 -- `this->`[`get_allocator()`](get_allocator.md) `!= x.`[`get_allocator()`](get_allocator.md)である場合、未定義動作となる。(C++14) +- `this->`[`get_allocator()`](get_allocator.md) `!= x.`[`get_allocator()`](get_allocator.md)である場合、未定義動作を引き起こす。(C++14) ## 例 diff --git a/reference/future/shared_future/get.md b/reference/future/shared_future/get.md index 706e187e61..15b1bec706 100644 --- a/reference/future/shared_future/get.md +++ b/reference/future/shared_future/get.md @@ -20,7 +20,7 @@ void shared_future::get() const; ## 戻り値 -- `future::get()` : 共有状態に格納されている値への`const`左辺値参照を返す。
備考:共有状態が破壊された後、その参照を介してのアクセスは未定義動作となる。`shared_future`オブジェクトの寿命よりも長いオブジェクトに参照を保持しないこと。 +- `future::get()` : 共有状態に格納されている値への`const`左辺値参照を返す。
備考:共有状態が破壊された後、その参照を介してのアクセスは未定義動作を引き起こす。`shared_future`オブジェクトの寿命よりも長いオブジェクトに参照を保持しないこと。 - `future::get()` : 共有状態に格納されている参照を返す。 - `future::get()` : 何も返さない。 diff --git a/reference/ios/basic_ios/op_constructor.md b/reference/ios/basic_ios/op_constructor.md index a7f7481e74..c004554b81 100644 --- a/reference/ios/basic_ios/op_constructor.md +++ b/reference/ios/basic_ios/op_constructor.md @@ -27,7 +27,7 @@ public: - (2) デフォルトコンストラクタ。 構築が完了した時点では、本オブジェクトの各メンバの値は不定である。 本オブジェクトの各メンバは、初めて使用する時かデストラクタが呼ばれる時のいずれか早い方の前までに [`basic_ios`](../basic_ios.md)`::`[`init`](../basic_ios/init.md) を呼び出して初期化しなければならない。 - さもなければ、未定義動作となる。 + さもなければ、未定義動作を引き起こす。 - (3) コピーコンストラクタ。コピー構築不可。 [`basic_ios`](../basic_ios.md) オブジェクトをコピー構築することはできない。 diff --git a/reference/ios/fpos.md b/reference/ios/fpos.md index 59bab0dd7b..0be64354ab 100644 --- a/reference/ios/fpos.md +++ b/reference/ios/fpos.md @@ -63,4 +63,4 @@ using u32streampos = fpos::state_type>; なお、`P(O(-1))`はエラー値である。`basic_istream`/`basic_ostream`/`basic_streambuf`では以下のように扱われる。 - 戻り値としてこの値が返されれば、操作の失敗を表す。 -- 引数としてこの値が渡された場合、未定義動作となる。 +- 引数としてこの値が渡された場合、未定義動作を引き起こす。 diff --git a/reference/ios/ios_base/op_constructor.md b/reference/ios/ios_base/op_constructor.md index 79f298540f..0329f1c962 100644 --- a/reference/ios/ios_base/op_constructor.md +++ b/reference/ios/ios_base/op_constructor.md @@ -21,7 +21,7 @@ public: - (1) デフォルトコンストラクタ。 構築が完了した時点では、本オブジェクトの各メンバの値は不定である。 本オブジェクトの各メンバは、初めて使用する時かデストラクタが呼ばれる時のいずれか早い方の前までに [`basic_ios`](../basic_ios.md)`::`[`init`](../basic_ios/init.md) を呼び出して初期化しなければならない。 - さもなければ、未定義動作となる。 + さもなければ、未定義動作を引き起こす。 - (2) コピーコンストラクタ。コピー構築不可。 [`ios_base`](../ios_base.md) オブジェクトをコピー構築することはできない。 diff --git a/reference/iterator/unreachable_sentinel_t.md b/reference/iterator/unreachable_sentinel_t.md index feab3f163e..4694befc9f 100644 --- a/reference/iterator/unreachable_sentinel_t.md +++ b/reference/iterator/unreachable_sentinel_t.md @@ -44,10 +44,10 @@ int main() { // 探したい値(ここでは'i')が範囲内に含まれていることが予め分かる場合に利用できる // 最適化によって範囲の終端チェックが省略され、効率的に探索できる可能性がある - // もしその仮定が成立しない場合、イテレータによる走査は外側の範囲を飛び出し未定義動作となるため注意が必要である + // もしその仮定が成立しない場合、イテレータによる走査は外側の範囲を飛び出し未定義動作を引き起こすため注意が必要である auto pos = std::ranges::find(str.begin(), std::unreachable_sentinel, 'i'); - // 'j'は元の文字列に含まれないため未定義動作となる + // 'j'は元の文字列に含まれないため未定義動作を引き起こす //auto pos = std::ranges::find(str.begin(), std::unreachable_sentinel, 'j'); std::cout << *pos; diff --git a/reference/iterator/weakly_incrementable.md b/reference/iterator/weakly_incrementable.md index 6e0bc7c2e6..af15089187 100644 --- a/reference/iterator/weakly_incrementable.md +++ b/reference/iterator/weakly_incrementable.md @@ -35,7 +35,7 @@ namespace std { - `i`がインクリメント可能ならば、`++i`と`i++`は`i`を次の要素へ進める - `i`がインクリメント可能ならば、`addressof(++i)`と`addressof(i)`は等値となる -「`i`がインクリメント可能」というのは、`i`が前置/後置両方のインクリメント式(`++`)の[定義域](/reference/concepts.md)にある場合を言う。すなわち、一般的なイテレータ範囲の`end`などインクリメントが出来ない、あるいは未定義動作となるような状態に`i`が無い場合を指定している。 +「`i`がインクリメント可能」というのは、`i`が前置/後置両方のインクリメント式(`++`)の[定義域](/reference/concepts.md)にある場合を言う。すなわち、一般的なイテレータ範囲の`end`などインクリメントが出来ない、あるいは未定義動作を引き起こすような状態に`i`が無い場合を指定している。 ## 備考 diff --git a/reference/memory/enable_shared_from_this/shared_from_this.md b/reference/memory/enable_shared_from_this/shared_from_this.md index d3c806b7b4..cdde92b543 100644 --- a/reference/memory/enable_shared_from_this/shared_from_this.md +++ b/reference/memory/enable_shared_from_this/shared_from_this.md @@ -23,7 +23,7 @@ shared_ptr shared_from_this() const; ### C++14まで `this`ポインタを、`enable_shared_from_this`の派生クラス型`T`の[`shared_ptr`](/reference/memory/shared_ptr.md)オブジェクトとして構築して返す。 -要件を満たしていない場合は未定義動作となる。 +要件を満たしていない場合は未定義動作を引き起こす。 ### C++17から 保持する`this`を指すポインタを`weak_this`(`weak_ptr`)とすると、以下と等価。 diff --git a/reference/memory/shared_ptr/atomic_compare_exchange_strong.md b/reference/memory/shared_ptr/atomic_compare_exchange_strong.md index 1f5bf4d821..d9c5897f18 100644 --- a/reference/memory/shared_ptr/atomic_compare_exchange_strong.md +++ b/reference/memory/shared_ptr/atomic_compare_exchange_strong.md @@ -43,7 +43,7 @@ atomic_compare_exchange_strong_explicit( ## 非推奨・削除の詳細 -この関数はフリー関数であるため、この関数によってアトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものはどこかに配置されている非アトミックオブジェクトである。そのため、アトミックアクセスしたい文脈の外側から通常のアクセスが可能であり、もし別のスレッドからそのようなアクセスが行われているとこの関数を用いていてもデータ競合を引き起こし未定義動作となる。 +この関数はフリー関数であるため、この関数によってアトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものはどこかに配置されている非アトミックオブジェクトである。そのため、アトミックアクセスしたい文脈の外側から通常のアクセスが可能であり、もし別のスレッドからそのようなアクセスが行われているとこの関数を用いていてもデータ競合を引き起こし未定義動作を引き起こす。 すなわち、アトミックにアクセスしたい`shared_ptr`オブジェクトに対する全てのアクセスをプログラマがきちんと管理しなければこの関数の使用は安全ではなく、それはかなり困難であったためこの関数は危険な利用がデフォルトとなっていた。 diff --git a/reference/memory/shared_ptr/atomic_compare_exchange_strong_explicit.md b/reference/memory/shared_ptr/atomic_compare_exchange_strong_explicit.md index a8535bbe24..ce9e638990 100644 --- a/reference/memory/shared_ptr/atomic_compare_exchange_strong_explicit.md +++ b/reference/memory/shared_ptr/atomic_compare_exchange_strong_explicit.md @@ -49,7 +49,7 @@ namespace std { ## 非推奨・削除の詳細 -この関数はフリー関数であるため、この関数によってアトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものはどこかに配置されている非アトミックオブジェクトである。そのため、アトミックアクセスしたい文脈の外側から通常のアクセスが可能であり、もし別のスレッドからそのようなアクセスが行われているとこの関数を用いていてもデータ競合を引き起こし未定義動作となる。 +この関数はフリー関数であるため、この関数によってアトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものはどこかに配置されている非アトミックオブジェクトである。そのため、アトミックアクセスしたい文脈の外側から通常のアクセスが可能であり、もし別のスレッドからそのようなアクセスが行われているとこの関数を用いていてもデータ競合を引き起こし未定義動作を引き起こす。 すなわち、アトミックにアクセスしたい`shared_ptr`オブジェクトに対する全てのアクセスをプログラマがきちんと管理しなければこの関数の使用は安全ではなく、それはかなり困難であったためこの関数は危険な利用がデフォルトとなっていた。 diff --git a/reference/memory/shared_ptr/atomic_compare_exchange_weak.md b/reference/memory/shared_ptr/atomic_compare_exchange_weak.md index d39fd7ca34..8c4bbec4c3 100644 --- a/reference/memory/shared_ptr/atomic_compare_exchange_weak.md +++ b/reference/memory/shared_ptr/atomic_compare_exchange_weak.md @@ -43,7 +43,7 @@ atomic_compare_exchange_weak_explicit( ## 非推奨・削除の詳細 -この関数はフリー関数であるため、この関数によってアトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものはどこかに配置されている非アトミックオブジェクトである。そのため、アトミックアクセスしたい文脈の外側から通常のアクセスが可能であり、もし別のスレッドからそのようなアクセスが行われているとこの関数を用いていてもデータ競合を引き起こし未定義動作となる。 +この関数はフリー関数であるため、この関数によってアトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものはどこかに配置されている非アトミックオブジェクトである。そのため、アトミックアクセスしたい文脈の外側から通常のアクセスが可能であり、もし別のスレッドからそのようなアクセスが行われているとこの関数を用いていてもデータ競合を引き起こし未定義動作を引き起こす。 すなわち、アトミックにアクセスしたい`shared_ptr`オブジェクトに対する全てのアクセスをプログラマがきちんと管理しなければこの関数の使用は安全ではなく、それはかなり困難であったためこの関数は危険な利用がデフォルトとなっていた。 diff --git a/reference/memory/shared_ptr/atomic_compare_exchange_weak_explicit.md b/reference/memory/shared_ptr/atomic_compare_exchange_weak_explicit.md index df835ba007..cab79b510d 100644 --- a/reference/memory/shared_ptr/atomic_compare_exchange_weak_explicit.md +++ b/reference/memory/shared_ptr/atomic_compare_exchange_weak_explicit.md @@ -49,7 +49,7 @@ namespace std { ## 非推奨・削除の詳細 -この関数はフリー関数であるため、この関数によってアトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものはどこかに配置されている非アトミックオブジェクトである。そのため、アトミックアクセスしたい文脈の外側から通常のアクセスが可能であり、もし別のスレッドからそのようなアクセスが行われているとこの関数を用いていてもデータ競合を引き起こし未定義動作となる。 +この関数はフリー関数であるため、この関数によってアトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものはどこかに配置されている非アトミックオブジェクトである。そのため、アトミックアクセスしたい文脈の外側から通常のアクセスが可能であり、もし別のスレッドからそのようなアクセスが行われているとこの関数を用いていてもデータ競合を引き起こし未定義動作を引き起こす。 すなわち、アトミックにアクセスしたい`shared_ptr`オブジェクトに対する全てのアクセスをプログラマがきちんと管理しなければこの関数の使用は安全ではなく、それはかなり困難であったためこの関数は危険な利用がデフォルトとなっていた。 diff --git a/reference/memory/shared_ptr/atomic_exchange.md b/reference/memory/shared_ptr/atomic_exchange.md index 436814b477..68a150dcd4 100644 --- a/reference/memory/shared_ptr/atomic_exchange.md +++ b/reference/memory/shared_ptr/atomic_exchange.md @@ -36,7 +36,7 @@ atomic_exchange_explicit(p, r, memory_order_seq_cst) ## 非推奨・削除の詳細 -この関数はフリー関数であるため、この関数によってアトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものはどこかに配置されている非アトミックオブジェクトである。そのため、アトミックアクセスしたい文脈の外側から通常のアクセスが可能であり、もし別のスレッドからそのようなアクセスが行われているとこの関数を用いていてもデータ競合を引き起こし未定義動作となる。 +この関数はフリー関数であるため、この関数によってアトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものはどこかに配置されている非アトミックオブジェクトである。そのため、アトミックアクセスしたい文脈の外側から通常のアクセスが可能であり、もし別のスレッドからそのようなアクセスが行われているとこの関数を用いていてもデータ競合を引き起こし未定義動作を引き起こす。 すなわち、アトミックにアクセスしたい`shared_ptr`オブジェクトに対する全てのアクセスをプログラマがきちんと管理しなければこの関数の使用は安全ではなく、それはかなり困難であったためこの関数は危険な利用がデフォルトとなっていた。 diff --git a/reference/memory/shared_ptr/atomic_exchange_explicit.md b/reference/memory/shared_ptr/atomic_exchange_explicit.md index d66704f14c..b603f35fbd 100644 --- a/reference/memory/shared_ptr/atomic_exchange_explicit.md +++ b/reference/memory/shared_ptr/atomic_exchange_explicit.md @@ -38,7 +38,7 @@ namespace std { ## 非推奨・削除の詳細 -この関数はフリー関数であるため、この関数によってアトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものはどこかに配置されている非アトミックオブジェクトである。そのため、アトミックアクセスしたい文脈の外側から通常のアクセスが可能であり、もし別のスレッドからそのようなアクセスが行われているとこの関数を用いていてもデータ競合を引き起こし未定義動作となる。 +この関数はフリー関数であるため、この関数によってアトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものはどこかに配置されている非アトミックオブジェクトである。そのため、アトミックアクセスしたい文脈の外側から通常のアクセスが可能であり、もし別のスレッドからそのようなアクセスが行われているとこの関数を用いていてもデータ競合を引き起こし未定義動作を引き起こす。 すなわち、アトミックにアクセスしたい`shared_ptr`オブジェクトに対する全てのアクセスをプログラマがきちんと管理しなければこの関数の使用は安全ではなく、それはかなり困難であったためこの関数は危険な利用がデフォルトとなっていた。 diff --git a/reference/memory/shared_ptr/atomic_is_lock_free.md b/reference/memory/shared_ptr/atomic_is_lock_free.md index 696c844ec9..2fb38b2f5c 100644 --- a/reference/memory/shared_ptr/atomic_is_lock_free.md +++ b/reference/memory/shared_ptr/atomic_is_lock_free.md @@ -34,7 +34,7 @@ namespace std { ## 非推奨・削除の詳細 -この関数はフリー関数であるため、この関数によってアトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものはどこかに配置されている非アトミックオブジェクトである。そのため、アトミックアクセスしたい文脈の外側から通常のアクセスが可能であり、もし別のスレッドからそのようなアクセスが行われているとこの関数を用いていてもデータ競合を引き起こし未定義動作となる。 +この関数はフリー関数であるため、この関数によってアトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものはどこかに配置されている非アトミックオブジェクトである。そのため、アトミックアクセスしたい文脈の外側から通常のアクセスが可能であり、もし別のスレッドからそのようなアクセスが行われているとこの関数を用いていてもデータ競合を引き起こし未定義動作を引き起こす。 すなわち、アトミックにアクセスしたい`shared_ptr`オブジェクトに対する全てのアクセスをプログラマがきちんと管理しなければこの関数の使用は安全ではなく、それはかなり困難であったためこの関数は危険な利用がデフォルトとなっていた。 diff --git a/reference/memory/shared_ptr/atomic_load.md b/reference/memory/shared_ptr/atomic_load.md index 8074f84b91..e42340db30 100644 --- a/reference/memory/shared_ptr/atomic_load.md +++ b/reference/memory/shared_ptr/atomic_load.md @@ -36,7 +36,7 @@ atomic_load_explicit(p, memory_order_seq_cst) ## 非推奨・削除の詳細 -この関数はフリー関数であるため、この関数によってアトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものはどこかに配置されている非アトミックオブジェクトである。そのため、アトミックアクセスしたい文脈の外側から通常のアクセスが可能であり、もし別のスレッドからそのようなアクセスが行われているとこの関数を用いていてもデータ競合を引き起こし未定義動作となる。 +この関数はフリー関数であるため、この関数によってアトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものはどこかに配置されている非アトミックオブジェクトである。そのため、アトミックアクセスしたい文脈の外側から通常のアクセスが可能であり、もし別のスレッドからそのようなアクセスが行われているとこの関数を用いていてもデータ競合を引き起こし未定義動作を引き起こす。 すなわち、アトミックにアクセスしたい`shared_ptr`オブジェクトに対する全てのアクセスをプログラマがきちんと管理しなければこの関数の使用は安全ではなく、それはかなり困難であったためこの関数は危険な利用がデフォルトとなっていた。 diff --git a/reference/memory/shared_ptr/atomic_load_explicit.md b/reference/memory/shared_ptr/atomic_load_explicit.md index e51c7223d4..c53de7f97a 100644 --- a/reference/memory/shared_ptr/atomic_load_explicit.md +++ b/reference/memory/shared_ptr/atomic_load_explicit.md @@ -38,7 +38,7 @@ namespace std { ## 非推奨・削除の詳細 -この関数はフリー関数であるため、この関数によってアトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものはどこかに配置されている非アトミックオブジェクトである。そのため、アトミックアクセスしたい文脈の外側から通常のアクセスが可能であり、もし別のスレッドからそのようなアクセスが行われているとこの関数を用いていてもデータ競合を引き起こし未定義動作となる。 +この関数はフリー関数であるため、この関数によってアトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものはどこかに配置されている非アトミックオブジェクトである。そのため、アトミックアクセスしたい文脈の外側から通常のアクセスが可能であり、もし別のスレッドからそのようなアクセスが行われているとこの関数を用いていてもデータ競合を引き起こし未定義動作を引き起こす。 すなわち、アトミックにアクセスしたい`shared_ptr`オブジェクトに対する全てのアクセスをプログラマがきちんと管理しなければこの関数の使用は安全ではなく、それはかなり困難であったためこの関数は危険な利用がデフォルトとなっていた。 diff --git a/reference/memory/shared_ptr/atomic_store.md b/reference/memory/shared_ptr/atomic_store.md index 64014d49e0..ec898f7de8 100644 --- a/reference/memory/shared_ptr/atomic_store.md +++ b/reference/memory/shared_ptr/atomic_store.md @@ -40,7 +40,7 @@ atomic_store_explicit(p, r, memory_order_seq_cst) ## 非推奨・削除の詳細 -この関数はフリー関数であるため、この関数によってアトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものはどこかに配置されている非アトミックオブジェクトである。そのため、アトミックアクセスしたい文脈の外側から通常のアクセスが可能であり、もし別のスレッドからそのようなアクセスが行われているとこの関数を用いていてもデータ競合を引き起こし未定義動作となる。 +この関数はフリー関数であるため、この関数によってアトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものはどこかに配置されている非アトミックオブジェクトである。そのため、アトミックアクセスしたい文脈の外側から通常のアクセスが可能であり、もし別のスレッドからそのようなアクセスが行われているとこの関数を用いていてもデータ競合を引き起こし未定義動作を引き起こす。 すなわち、アトミックにアクセスしたい`shared_ptr`オブジェクトに対する全てのアクセスをプログラマがきちんと管理しなければこの関数の使用は安全ではなく、それはかなり困難であったためこの関数は危険な利用がデフォルトとなっていた。 diff --git a/reference/memory/shared_ptr/atomic_store_explicit.md b/reference/memory/shared_ptr/atomic_store_explicit.md index 30e4fd27d2..1f3e43a4f6 100644 --- a/reference/memory/shared_ptr/atomic_store_explicit.md +++ b/reference/memory/shared_ptr/atomic_store_explicit.md @@ -42,7 +42,7 @@ namespace std { ## 非推奨・削除の詳細 -この関数はフリー関数であるため、この関数によってアトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものはどこかに配置されている非アトミックオブジェクトである。そのため、アトミックアクセスしたい文脈の外側から通常のアクセスが可能であり、もし別のスレッドからそのようなアクセスが行われているとこの関数を用いていてもデータ競合を引き起こし未定義動作となる。 +この関数はフリー関数であるため、この関数によってアトミックにアクセスする対象となる`shared_ptr`オブジェクトそのものはどこかに配置されている非アトミックオブジェクトである。そのため、アトミックアクセスしたい文脈の外側から通常のアクセスが可能であり、もし別のスレッドからそのようなアクセスが行われているとこの関数を用いていてもデータ競合を引き起こし未定義動作を引き起こす。 すなわち、アトミックにアクセスしたい`shared_ptr`オブジェクトに対する全てのアクセスをプログラマがきちんと管理しなければこの関数の使用は安全ではなく、それはかなり困難であったためこの関数は危険な利用がデフォルトとなっていた。 diff --git a/reference/memory/shared_ptr/const_pointer_cast.md b/reference/memory/shared_ptr/const_pointer_cast.md index 3a1e7247f8..476a1696f9 100644 --- a/reference/memory/shared_ptr/const_pointer_cast.md +++ b/reference/memory/shared_ptr/const_pointer_cast.md @@ -35,7 +35,7 @@ namespace std { ## 備考 -- `shared_ptr(const_cast(r.get()))` という方法は未定義動作となるので使用しないこと。 +- `shared_ptr(const_cast(r.get()))` という方法は未定義動作を引き起こすので使用しないこと。 ## 例外 diff --git a/reference/memory/shared_ptr/dynamic_pointer_cast.md b/reference/memory/shared_ptr/dynamic_pointer_cast.md index d9fc1b6c90..3efeafe347 100644 --- a/reference/memory/shared_ptr/dynamic_pointer_cast.md +++ b/reference/memory/shared_ptr/dynamic_pointer_cast.md @@ -35,7 +35,7 @@ namespace std { ## 備考 -- `shared_ptr(dynamic_cast(r.get()))` という方法は未定義動作となるので使用しないこと。 +- `shared_ptr(dynamic_cast(r.get()))` という方法は未定義動作を引き起こすので使用しないこと。 ## 例外 diff --git a/reference/memory/shared_ptr/reinterpret_pointer_cast.md b/reference/memory/shared_ptr/reinterpret_pointer_cast.md index 91afa8de74..84ec88f312 100644 --- a/reference/memory/shared_ptr/reinterpret_pointer_cast.md +++ b/reference/memory/shared_ptr/reinterpret_pointer_cast.md @@ -35,7 +35,7 @@ namespace std { ## 備考 -- `shared_ptr(reinterpret_cast(r.get()))` という方法は未定義動作となるので使用しないこと。 +- `shared_ptr(reinterpret_cast(r.get()))` という方法は未定義動作を引き起こすので使用しないこと。 ## 例外 diff --git a/reference/memory/shared_ptr/static_pointer_cast.md b/reference/memory/shared_ptr/static_pointer_cast.md index e44b0f7555..453569fcdb 100644 --- a/reference/memory/shared_ptr/static_pointer_cast.md +++ b/reference/memory/shared_ptr/static_pointer_cast.md @@ -35,7 +35,7 @@ namespace std { ## 備考 -- `shared_ptr(static_cast(r.get()))` という方法は未定義動作となるので使用しないこと。 +- `shared_ptr(static_cast(r.get()))` という方法は未定義動作を引き起こすので使用しないこと。 ## 例 diff --git a/reference/new/op_new.md b/reference/new/op_new.md index e161451aa7..ad0845076e 100644 --- a/reference/new/op_new.md +++ b/reference/new/op_new.md @@ -73,7 +73,7 @@ void* operator new(std::size_t size, void* ptr) noexcept; // (5) C++11 ## 備考 - (1)と(2)、および、(3)と(4) の形式は、`size` が `0` でも他の確保済みの記憶域と異なるアドレスを返す。 - ただし、記憶域の確保に失敗する可能性もあり、また、成功しても当該ポインタを間接参照した場合は未定義動作となる。 + ただし、記憶域の確保に失敗する可能性もあり、また、成功しても当該ポインタを間接参照した場合は未定義動作を引き起こす。 - (1)と(2)、および、(3)と(4) の形式は、利用者がこれらとおなじシグネチャの関数を用意することで、標準ライブラリの提供している関数を置き換えることができる。 なお、(5) の形式については、置き換えることはできない(許可されていない)。 @@ -82,7 +82,7 @@ void* operator new(std::size_t size, void* ptr) noexcept; // (5) C++11 このとき、`align_val_t(alignof(T))` が引数として渡される。この閾値は定義済みマクロ `__STDCPP_DEFAULT_NEW_ALIGNMENT__` で提供される。 既存のコードを利用する観点から、利用者が `operator new` を置き換えていた場合は、その型がデフォルトより大きなアライメントを要求していたとしても、ユーザーが置き換えた関数が使用される。 -- (2)、および、(4) の形式において、`alignment` に無効な値を渡した場合、未定義動作となる。 +- (2)、および、(4) の形式において、`alignment` に無効な値を渡した場合、未定義動作を引き起こす。 - (1)と(2) の形式の `operator new` を呼び出すだけであれば、(`new` 式から間接的に呼ばれる場合も含めて)`new` ヘッダをインクルードする必要はない。 diff --git a/reference/new/op_new[].md b/reference/new/op_new[].md index 7c66e5c2fd..1089900dbc 100644 --- a/reference/new/op_new[].md +++ b/reference/new/op_new[].md @@ -65,7 +65,7 @@ void* operator new[](std::size_t size, void* ptr) noexcept; // (5) ## 備考 - (1)と(2)、および、(3)と(4) の形式は、`size` が `0` でも他の確保済みの記憶域と異なるアドレスを返す。 - ただし、記憶域の確保に失敗する可能性もあり、また、成功しても当該ポインタを間接参照した場合は未定義動作となる。 + ただし、記憶域の確保に失敗する可能性もあり、また、成功しても当該ポインタを間接参照した場合は未定義動作を引き起こす。 - (1)と(2)、および、(3)と(4) の形式は、利用者がこれらとおなじシグネチャの関数を用意することで、標準ライブラリの提供している関数を置き換えることができる。 なお、(5) の形式については、置き換えることはできない(許可されていない)。 @@ -74,7 +74,7 @@ void* operator new[](std::size_t size, void* ptr) noexcept; // (5) このとき、`align_val_t(alignof(T))` が引数として渡される。この閾値は定義済みマクロ `__STDCPP_DEFAULT_NEW_ALIGNMENT__` で提供される。 既存のコードを利用する観点から、利用者が `operator new` を置き換えていた場合は、その型がデフォルトより大きなアライメントを要求していたとしても、ユーザーが置き換えた関数が使用される。 -- (2)、および、(4) の形式において、`alignment` に無効な値を渡した場合、未定義動作となる。 +- (2)、および、(4) の形式において、`alignment` に無効な値を渡した場合、未定義動作を引き起こす。 - (1)と(2) の形式の `operator new[]` を呼び出すだけであれば、(`new` 式から間接的に呼ばれる場合も含めて)`new` ヘッダをインクルードする必要はない。 diff --git a/reference/optional/optional/op_deref.md b/reference/optional/optional/op_deref.md index faa7134447..94ca01e7d9 100644 --- a/reference/optional/optional/op_deref.md +++ b/reference/optional/optional/op_deref.md @@ -38,7 +38,7 @@ constexpr const T&& operator*() const&&; // (4) ## 備考 `optional` クラスはスマートポインタとしても見なせるため、この演算子のようなポインタのインタフェースを持つ。 -非ポインタインタフェースである [`value()`](value.md) の方がより明示的な(視覚的に目立つ)アクセス方法ではあるが、本演算子は [`value()`](value.md) とは異なり [`has_value()`](has_value.md) `!= true` の場合に使用すると未定義動作となる。([`value()`](value.md) は [`bad_optional_access`](/reference/optional/bad_optional_access.md) 例外を送出する) +非ポインタインタフェースである [`value()`](value.md) の方がより明示的な(視覚的に目立つ)アクセス方法ではあるが、本演算子は [`value()`](value.md) とは異なり [`has_value()`](has_value.md) `!= true` の場合に使用すると未定義動作を引き起こす。([`value()`](value.md) は [`bad_optional_access`](/reference/optional/bad_optional_access.md) 例外を送出する) 逆に言えば、ライブラリ実装は本演算子の実装時に [`has_value()`](has_value.md) ` == true` であることのチェックを行う必要が無いため、あらかじめ [`has_value()`](has_value.md) `== true` であることが分かっている場合には、おそらく [`value()`](value.md) よりも本演算子の方が速度的には有利だろう。(ただし、規格でチェックを禁止されているわけではない) diff --git a/reference/ranges/filter_view.md b/reference/ranges/filter_view.md index ff09dcee76..8002d1d832 100644 --- a/reference/ranges/filter_view.md +++ b/reference/ranges/filter_view.md @@ -31,7 +31,7 @@ namespace std::ranges { - 初めてメンバ関数[`begin`](filter_view/begin.md.nolink)が呼び出されたときに先頭の要素を決定し、残りはイテレータが進むときに求める。 - [`begin`](filter_view/begin.md.nolink)は償却定数時間で実行できなければならないため、[`begin`](filter_view/begin.md.nolink)の値はキャッシュされる。 -`filter_view`の要素を書き換えてもよいが、書き換えた後の要素が`Pred`を満たさない場合は未定義動作となる。 +`filter_view`の要素を書き換えてもよいが、書き換えた後の要素が`Pred`を満たさない場合は未定義動作を引き起こす。 ### Rangeコンセプト diff --git a/reference/regex/regex_iterator.md b/reference/regex/regex_iterator.md index 566cf1306b..d1d80002a3 100644 --- a/reference/regex/regex_iterator.md +++ b/reference/regex/regex_iterator.md @@ -29,8 +29,8 @@ namespace std { イテレータが終端まで来たとき(つまり、[`regex_search`](regex_search.md) が `false` を返したとき)、当該イテレータはシーケンスの終端を示す特別な値となる。 この、シーケンスの終端を示す特別な値は、`regex_iterator` オブジェクトをデフォルトコンストラクタにより構築した場合にも生成されるため、この値と比較することによってシーケンスの終端であるか否か(つまり、マッチしなかったか否か)が判別できる。 -シーケンス終端のイテレータに対する [`operator*`](regex_iterator/op_deref.md) 演算子適用は未定義動作となる。その他のイテレータに対する [`operator*`](regex_iterator/op_deref.md) 演算子適用の結果は `const` [`match_results`](match_results.md)`&` である。 -同様に、シーケンス終端のイテレータに対する [`operator->`](regex_iterator/op_arrow.md) 演算子適用は未定義動作となる。その他のイテレータに対する [`operator->`](regex_iterator/op_arrow.md) 演算子適用の結果は `const` [`match_results`](match_results.md)`*` である。 +シーケンス終端のイテレータに対する [`operator*`](regex_iterator/op_deref.md) 演算子適用は未定義動作を引き起こす。その他のイテレータに対する [`operator*`](regex_iterator/op_deref.md) 演算子適用の結果は `const` [`match_results`](match_results.md)`&` である。 +同様に、シーケンス終端のイテレータに対する [`operator->`](regex_iterator/op_arrow.md) 演算子適用は未定義動作を引き起こす。その他のイテレータに対する [`operator->`](regex_iterator/op_arrow.md) 演算子適用の結果は `const` [`match_results`](match_results.md)`*` である。 なお、本サイトの `regex_iterator` の各説明では、規格にならって以下のプライベートなメンバ変数が存在する前提で記載している。 diff --git a/reference/regex/regex_iterator/op_arrow.md b/reference/regex/regex_iterator/op_arrow.md index fcbc5761c3..2c0d719f0d 100644 --- a/reference/regex/regex_iterator/op_arrow.md +++ b/reference/regex/regex_iterator/op_arrow.md @@ -14,7 +14,7 @@ const value_type* operator->() const; ## 要件 -シーケンスの終端を示すイテレータではない事。(シーケンス終端イテレータに対して呼び出した場合は未定義動作となる) +シーケンスの終端を示すイテレータではない事。(シーケンス終端イテレータに対して呼び出した場合は未定義動作を引き起こす) ## 戻り値 diff --git a/reference/regex/regex_iterator/op_deref.md b/reference/regex/regex_iterator/op_deref.md index 6366635bce..3629a4ec32 100644 --- a/reference/regex/regex_iterator/op_deref.md +++ b/reference/regex/regex_iterator/op_deref.md @@ -14,7 +14,7 @@ const value_type& operator*() const; ## 要件 -シーケンスの終端を示すイテレータではない事。(シーケンス終端イテレータに対して呼び出した場合は未定義動作となる) +シーケンスの終端を示すイテレータではない事。(シーケンス終端イテレータに対して呼び出した場合は未定義動作を引き起こす) ## 戻り値 diff --git a/reference/regex/regex_iterator/op_increment.md b/reference/regex/regex_iterator/op_increment.md index 91c893e18d..8136a1f58e 100644 --- a/reference/regex/regex_iterator/op_increment.md +++ b/reference/regex/regex_iterator/op_increment.md @@ -16,7 +16,7 @@ regex_iterator operator++(int); // (2) 後置形式 ## 要件 -シーケンスの終端を示すイテレータではない事。(シーケンス終端イテレータに対して呼び出した場合は未定義動作となる) +シーケンスの終端を示すイテレータではない事。(シーケンス終端イテレータに対して呼び出した場合は未定義動作を引き起こす) ## 効果 diff --git a/reference/regex/regex_token_iterator.md b/reference/regex/regex_token_iterator.md index 2ce630ebf2..d623b1d182 100644 --- a/reference/regex/regex_token_iterator.md +++ b/reference/regex/regex_token_iterator.md @@ -37,8 +37,8 @@ namespace std { `position` が終端まで来た時に、`subs` に `-1` が含まれていない、または、`position` が直前にマッチした文字列の後ろに文字列が残っていない場合、および、接尾辞イテレータがインクリメントされた場合、当該オブジェクトは、シーケンスの終端を示す特別な値となる。 この、シーケンスの終端を示す特別な値は、`regex_token_iterator` オブジェクトをデフォルトコンストラクタにより構築した場合にも生成されるため、この値と比較することによってシーケンスの終端であるか否か(つまり、マッチしなかったか否か)が判別できる。 -シーケンス終端のイテレータに対する [`operator*`](regex_token_iterator/op_deref.md) 演算子適用は未定義動作となる。その他のイテレータに対する [`operator*`](regex_token_iterator/op_deref.md) 演算子適用の結果は `const` [`sub_match`](sub_match.md)`&` である。 -同様に、シーケンス終端のイテレータに対する [`operator->`](regex_token_iterator/op_arrow.md) 演算子適用は未定義動作となる。その他のイテレータに対する [`operator->`](regex_token_iterator/op_arrow.md) 演算子適用の結果は `const` [`sub_match`](sub_match.md)`*` である。 +シーケンス終端のイテレータに対する [`operator*`](regex_token_iterator/op_deref.md) 演算子適用は未定義動作を引き起こす。その他のイテレータに対する [`operator*`](regex_token_iterator/op_deref.md) 演算子適用の結果は `const` [`sub_match`](sub_match.md)`&` である。 +同様に、シーケンス終端のイテレータに対する [`operator->`](regex_token_iterator/op_arrow.md) 演算子適用は未定義動作を引き起こす。その他のイテレータに対する [`operator->`](regex_token_iterator/op_arrow.md) 演算子適用の結果は `const` [`sub_match`](sub_match.md)`*` である。 なお、本サイトの `regex_token_iterator` の各説明(上記も含む)では、規格にならって以下のプライベートなメンバ変数が存在する前提で記載している。 diff --git a/reference/regex/regex_token_iterator/op_arrow.md b/reference/regex/regex_token_iterator/op_arrow.md index 0916093f29..72103e53d9 100644 --- a/reference/regex/regex_token_iterator/op_arrow.md +++ b/reference/regex/regex_token_iterator/op_arrow.md @@ -14,7 +14,7 @@ const value_type* operator->() const; ## 要件 -シーケンスの終端を示すイテレータではない事。(シーケンス終端イテレータに対して呼び出した場合は未定義動作となる) +シーケンスの終端を示すイテレータではない事。(シーケンス終端イテレータに対して呼び出した場合は未定義動作を引き起こす) ## 戻り値 diff --git a/reference/regex/regex_token_iterator/op_deref.md b/reference/regex/regex_token_iterator/op_deref.md index c27ceb510e..c13fb85801 100644 --- a/reference/regex/regex_token_iterator/op_deref.md +++ b/reference/regex/regex_token_iterator/op_deref.md @@ -14,7 +14,7 @@ const value_type& operator*() const; ## 要件 -シーケンスの終端を示すイテレータではない事。(シーケンス終端イテレータに対して呼び出した場合は未定義動作となる) +シーケンスの終端を示すイテレータではない事。(シーケンス終端イテレータに対して呼び出した場合は未定義動作を引き起こす) ## 戻り値 diff --git a/reference/regex/regex_token_iterator/op_increment.md b/reference/regex/regex_token_iterator/op_increment.md index 3a70f33363..821d75b235 100644 --- a/reference/regex/regex_token_iterator/op_increment.md +++ b/reference/regex/regex_token_iterator/op_increment.md @@ -16,7 +16,7 @@ regex_token_iterator operator++(int); // (2) 後置形式 ## 要件 -シーケンスの終端を示すイテレータではない事。(シーケンス終端イテレータに対して呼び出した場合は未定義動作となる) +シーケンスの終端を示すイテレータではない事。(シーケンス終端イテレータに対して呼び出した場合は未定義動作を引き起こす) ## 効果 diff --git a/reference/string_view/basic_string_view/op_at.md b/reference/string_view/basic_string_view/op_at.md index b6c89e4e10..636bcc850f 100644 --- a/reference/string_view/basic_string_view/op_at.md +++ b/reference/string_view/basic_string_view/op_at.md @@ -29,7 +29,7 @@ return data()[pos]; ## 備考 -[`std::basic_string`](/reference/string/basic_string.md)`::`[`operator[]`](/reference/string/basic_string/op_at.md)は`s[s.size()]`で`CharT()`を返すが、`std::basic_string_view`クラスのこの演算子では未定義動作となる +[`std::basic_string`](/reference/string/basic_string.md)`::`[`operator[]`](/reference/string/basic_string/op_at.md)は`s[s.size()]`で`CharT()`を返すが、`std::basic_string_view`クラスのこの演算子では未定義動作を引き起こす ## 例 diff --git a/reference/type_traits/basic_common_reference.md b/reference/type_traits/basic_common_reference.md index ab6650e52a..aee4194336 100644 --- a/reference/type_traits/basic_common_reference.md +++ b/reference/type_traits/basic_common_reference.md @@ -32,7 +32,7 @@ namespace std { そして、その特殊化は`T, U`の引数順を入れ替えても同じ結果を返す(対称性を持つ)必要がある。 -上記のいずれかの規則に違反した特殊化を定義したとしてもコンパイルエラーにはならず、未定義動作となる。 +上記のいずれかの規則に違反した特殊化を定義したとしてもコンパイルエラーにはならず、未定義動作を引き起こす。 なお、`common_type, basic_common_reference`以外の[``](/reference/type_traits.md)内テンプレートに対するユーザー定義の特殊化は許可されていない。 diff --git a/reference/type_traits/common_type.md b/reference/type_traits/common_type.md index 650efc9903..1a0d91e091 100644 --- a/reference/type_traits/common_type.md +++ b/reference/type_traits/common_type.md @@ -71,7 +71,7 @@ namespace std { そして、そのような特殊化は必ずしもメンバ型`type`を持たなくても構わない。 もし`type`を定義する場合は`public`にただ一つだけ定義し、その型は`T1, T2`から明示的に変換可能であり、かつCV修飾されておらず参照型でもない型である必要がある。 そして、その特殊化は`T1,T2`の引数順を入れ替えても同じ結果を返す(対称性を持つ)必要がある。 -これらの規則に違反した特殊化を定義したとしてもコンパイルエラーにはならず、未定義動作となる。 +これらの規則に違反した特殊化を定義したとしてもコンパイルエラーにはならず、未定義動作を引き起こす。 このように定義されたユーザー定義の特殊化は、`common_type_t`のように使用された時`T1, T2`がともにCV修飾もなく参照でもない場合は直接利用される。 `T1, T2`のどちらかがCV修飾されているか参照である場合は、プライマリの`common_type`によって`decay`された上で利用される。 diff --git a/reference/unordered_map/unordered_map/swap.md b/reference/unordered_map/unordered_map/swap.md index e5ea335a26..00137baf23 100644 --- a/reference/unordered_map/unordered_map/swap.md +++ b/reference/unordered_map/unordered_map/swap.md @@ -28,7 +28,7 @@ void swap(unordered_map& x) また、コンテナの `key_equal` と `hasher` のオブジェクト(それぞれ [`key_eq`](key_eq.md)`()` と [`hash_function`](hash_function.md)`()` が返すオブジェクト)も非メンバ関数 [`swap`](/reference/utility/swap.md) を非修飾で(つまり `std::` を付けずに)呼び出すことで交換される。(したがって、[`swap`](/reference/utility/swap.md) の呼び出しには ADL が働く。) -もし、`std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::propagate_on_container_swap::value` が `true` であれば、アロケータオブジェクト([`get_allocator`](get_allocator.md)`()` が返すオブジェクト)も非メンバ関数 [`swap`](/reference/utility/swap.md) を非修飾で呼び出すことで交換される。そうでなければアロケータオブジェクトは交換されず、その場合、当該コンテナと引数 `v` がそれぞれ [`get_allocator`](get_allocator.md)`()` で返すオブジェクトが等価でない(`operator==` が `true` を返さない)場合、未定義動作となる。 +もし、`std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::propagate_on_container_swap::value` が `true` であれば、アロケータオブジェクト([`get_allocator`](get_allocator.md)`()` が返すオブジェクト)も非メンバ関数 [`swap`](/reference/utility/swap.md) を非修飾で呼び出すことで交換される。そうでなければアロケータオブジェクトは交換されず、その場合、当該コンテナと引数 `v` がそれぞれ [`get_allocator`](get_allocator.md)`()` で返すオブジェクトが等価でない(`operator==` が `true` を返さない)場合、未定義動作を引き起こす。 ## 戻り値 diff --git a/reference/unordered_map/unordered_multimap/swap.md b/reference/unordered_map/unordered_multimap/swap.md index 3268f61c73..25502c9540 100644 --- a/reference/unordered_map/unordered_multimap/swap.md +++ b/reference/unordered_map/unordered_multimap/swap.md @@ -28,7 +28,7 @@ void swap(unordered_multimap& x) また、コンテナの `key_equal` と `hasher` のオブジェクト(それぞれ [`key_eq`](key_eq.md)`()` と [`hash_function`](hash_function.md)`()` が返すオブジェクト)も非メンバ関数 [`swap`](/reference/utility/swap.md) を非修飾で(つまり `std::` を付けずに)呼び出すことで交換される。(したがって、[`swap`](/reference/utility/swap.md) の呼び出しには ADL が働く。) -もし、`std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::propagate_on_container_swap::value` が `true` であれば、アロケータオブジェクト([`get_allocator`](get_allocator.md)`()` が返すオブジェクト)も非メンバ関数 [`swap`](/reference/utility/swap.md) を非修飾で呼び出すことで交換される。そうでなければアロケータオブジェクトは交換されず、その場合、当該コンテナと引数 `v` がそれぞれ [`get_allocator`](get_allocator.md)`()` で返すオブジェクトが等価でない(`operator==` が `true` を返さない)場合、未定義動作となる。 +もし、`std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::propagate_on_container_swap::value` が `true` であれば、アロケータオブジェクト([`get_allocator`](get_allocator.md)`()` が返すオブジェクト)も非メンバ関数 [`swap`](/reference/utility/swap.md) を非修飾で呼び出すことで交換される。そうでなければアロケータオブジェクトは交換されず、その場合、当該コンテナと引数 `v` がそれぞれ [`get_allocator`](get_allocator.md)`()` で返すオブジェクトが等価でない(`operator==` が `true` を返さない)場合、未定義動作を引き起こす。 ## 戻り値 diff --git a/reference/unordered_set/unordered_multiset/swap.md b/reference/unordered_set/unordered_multiset/swap.md index 7f9e448902..7c0d78c931 100644 --- a/reference/unordered_set/unordered_multiset/swap.md +++ b/reference/unordered_set/unordered_multiset/swap.md @@ -28,7 +28,7 @@ void swap(unordered_multiset& x) また、コンテナの `key_equal` と `hasher` のオブジェクト(それぞれ [`key_eq`](key_eq.md)`()` と [`hash_function`](hash_function.md)`()` が返すオブジェクト)も非メンバ関数 [`swap`](/reference/utility/swap.md) を非修飾で(つまり `std::` を付けずに)呼び出すことで交換される。(したがって、[`swap`](/reference/utility/swap.md) の呼び出しには ADL が働く。) -もし、`std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::propagate_on_container_swap::value` が `true` であれば、アロケータオブジェクト([`get_allocator`](get_allocator.md)`()` が返すオブジェクト)も非メンバ関数 [`swap`](/reference/utility/swap.md) を非修飾で呼び出すことで交換される。そうでなければアロケータオブジェクトは交換されず、その場合、当該コンテナと引数 `v` がそれぞれ [`get_allocator`](get_allocator.md)`()` で返すオブジェクトが等価でない(`operator==` が `true` を返さない)場合、未定義動作となる。 +もし、`std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::propagate_on_container_swap::value` が `true` であれば、アロケータオブジェクト([`get_allocator`](get_allocator.md)`()` が返すオブジェクト)も非メンバ関数 [`swap`](/reference/utility/swap.md) を非修飾で呼び出すことで交換される。そうでなければアロケータオブジェクトは交換されず、その場合、当該コンテナと引数 `v` がそれぞれ [`get_allocator`](get_allocator.md)`()` で返すオブジェクトが等価でない(`operator==` が `true` を返さない)場合、未定義動作を引き起こす。 ## 戻り値 diff --git a/reference/unordered_set/unordered_set/swap.md b/reference/unordered_set/unordered_set/swap.md index d055327201..b1f0a38d3d 100644 --- a/reference/unordered_set/unordered_set/swap.md +++ b/reference/unordered_set/unordered_set/swap.md @@ -28,7 +28,7 @@ void swap(unordered_set& x) また、コンテナの `key_equal` と `hasher` のオブジェクト(それぞれ [`key_eq`](key_eq.md)`()` と [`hash_function`](hash_function.md)`()` が返すオブジェクト)も非メンバ関数 [`swap`](/reference/utility/swap.md) を非修飾で(つまり `std::` を付けずに)呼び出すことで交換される。(したがって、[`swap`](/reference/utility/swap.md) の呼び出しには ADL が働く。) -もし、`std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::propagate_on_container_swap::value` が `true` であれば、アロケータオブジェクト([`get_allocator`](get_allocator.md)`()` が返すオブジェクト)も非メンバ関数 [`swap`](/reference/utility/swap.md) を非修飾で呼び出すことで交換される。そうでなければアロケータオブジェクトは交換されず、その場合、当該コンテナと引数 `v` がそれぞれ [`get_allocator`](get_allocator.md)`()` で返すオブジェクトが等価でない(`operator==` が `true` を返さない)場合、未定義動作となる。 +もし、`std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::propagate_on_container_swap::value` が `true` であれば、アロケータオブジェクト([`get_allocator`](get_allocator.md)`()` が返すオブジェクト)も非メンバ関数 [`swap`](/reference/utility/swap.md) を非修飾で呼び出すことで交換される。そうでなければアロケータオブジェクトは交換されず、その場合、当該コンテナと引数 `v` がそれぞれ [`get_allocator`](get_allocator.md)`()` で返すオブジェクトが等価でない(`operator==` が `true` を返さない)場合、未定義動作を引き起こす。 ## 戻り値 diff --git a/reference/utility/unreachable.md b/reference/utility/unreachable.md index 4ccd0cd6fa..e1e75829b7 100644 --- a/reference/utility/unreachable.md +++ b/reference/utility/unreachable.md @@ -46,7 +46,7 @@ int main() { std::cout << flip(0) << std::endl; std::cout << flip(1) << std::endl; - // 例えば f(2) 呼び出しは未定義動作となる。 + // 例えば f(2) 呼び出しは未定義動作を引き起こす。 } ``` * std::unreachable[color ff0000] diff --git a/reference/valarray/gslice_array/op_and_assign.md b/reference/valarray/gslice_array/op_and_assign.md index 712ffeca39..623d910632 100644 --- a/reference/valarray/gslice_array/op_and_assign.md +++ b/reference/valarray/gslice_array/op_and_assign.md @@ -24,7 +24,7 @@ void operator&=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/gslice_array/op_assign.md b/reference/valarray/gslice_array/op_assign.md index e7265bc01a..1d7fc90bc0 100644 --- a/reference/valarray/gslice_array/op_assign.md +++ b/reference/valarray/gslice_array/op_assign.md @@ -34,7 +34,7 @@ public: - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 - (1) : C++03まで、このオーバーロードは使用できなかった。 -- [`valarray`](../valarray.md) から抽出した要素数と `ar` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `ar` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/gslice_array/op_divide_assign.md b/reference/valarray/gslice_array/op_divide_assign.md index 8c1844c8e4..dcc20574ed 100644 --- a/reference/valarray/gslice_array/op_divide_assign.md +++ b/reference/valarray/gslice_array/op_divide_assign.md @@ -24,7 +24,7 @@ void operator/=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/gslice_array/op_left_shift_assign.md b/reference/valarray/gslice_array/op_left_shift_assign.md index 5238221794..f4b043bb78 100644 --- a/reference/valarray/gslice_array/op_left_shift_assign.md +++ b/reference/valarray/gslice_array/op_left_shift_assign.md @@ -24,7 +24,7 @@ void operator<<=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/gslice_array/op_minus_assign.md b/reference/valarray/gslice_array/op_minus_assign.md index 3b8e79b353..509037519f 100644 --- a/reference/valarray/gslice_array/op_minus_assign.md +++ b/reference/valarray/gslice_array/op_minus_assign.md @@ -24,7 +24,7 @@ void operator-=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 diff --git a/reference/valarray/gslice_array/op_modulo_assign.md b/reference/valarray/gslice_array/op_modulo_assign.md index 88378fd162..f7f6e77259 100644 --- a/reference/valarray/gslice_array/op_modulo_assign.md +++ b/reference/valarray/gslice_array/op_modulo_assign.md @@ -24,7 +24,7 @@ void operator%=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/gslice_array/op_multiply_assign.md b/reference/valarray/gslice_array/op_multiply_assign.md index 8e9a39d77e..8ec9bb85a8 100644 --- a/reference/valarray/gslice_array/op_multiply_assign.md +++ b/reference/valarray/gslice_array/op_multiply_assign.md @@ -24,7 +24,7 @@ void operator*=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/gslice_array/op_or_assign.md b/reference/valarray/gslice_array/op_or_assign.md index 6baab70ddb..ef16ae4ae2 100644 --- a/reference/valarray/gslice_array/op_or_assign.md +++ b/reference/valarray/gslice_array/op_or_assign.md @@ -24,7 +24,7 @@ void operator|=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/gslice_array/op_plus_assign.md b/reference/valarray/gslice_array/op_plus_assign.md index a2556e35b8..97a6d3b048 100644 --- a/reference/valarray/gslice_array/op_plus_assign.md +++ b/reference/valarray/gslice_array/op_plus_assign.md @@ -24,7 +24,7 @@ void operator+=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/gslice_array/op_right_shift_assign.md b/reference/valarray/gslice_array/op_right_shift_assign.md index 1a7c5d74d9..1e9ad2f6be 100644 --- a/reference/valarray/gslice_array/op_right_shift_assign.md +++ b/reference/valarray/gslice_array/op_right_shift_assign.md @@ -24,7 +24,7 @@ void operator>>=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/gslice_array/op_xor_assign.md b/reference/valarray/gslice_array/op_xor_assign.md index 75c01743d7..c0435b5740 100644 --- a/reference/valarray/gslice_array/op_xor_assign.md +++ b/reference/valarray/gslice_array/op_xor_assign.md @@ -24,7 +24,7 @@ void operator^=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/indirect_array/op_and_assign.md b/reference/valarray/indirect_array/op_and_assign.md index 331231e021..3622d53d56 100644 --- a/reference/valarray/indirect_array/op_and_assign.md +++ b/reference/valarray/indirect_array/op_and_assign.md @@ -24,7 +24,7 @@ void operator&=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/indirect_array/op_assign.md b/reference/valarray/indirect_array/op_assign.md index dec2d0e97d..7490b8ed00 100644 --- a/reference/valarray/indirect_array/op_assign.md +++ b/reference/valarray/indirect_array/op_assign.md @@ -33,7 +33,7 @@ public: - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 - (1) : C++03まで、このオーバーロードは使用できなかった。 -- [`valarray`](../valarray.md) から抽出した要素数と `ar` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `ar` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/indirect_array/op_divide_assign.md b/reference/valarray/indirect_array/op_divide_assign.md index 57f5d33b91..95a2759f63 100644 --- a/reference/valarray/indirect_array/op_divide_assign.md +++ b/reference/valarray/indirect_array/op_divide_assign.md @@ -24,7 +24,7 @@ void operator/=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/indirect_array/op_left_shift_assign.md b/reference/valarray/indirect_array/op_left_shift_assign.md index ca91a3df01..a7826ef218 100644 --- a/reference/valarray/indirect_array/op_left_shift_assign.md +++ b/reference/valarray/indirect_array/op_left_shift_assign.md @@ -24,7 +24,7 @@ void operator<<=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/indirect_array/op_minus_assign.md b/reference/valarray/indirect_array/op_minus_assign.md index f3124ca6c6..4bc4418876 100644 --- a/reference/valarray/indirect_array/op_minus_assign.md +++ b/reference/valarray/indirect_array/op_minus_assign.md @@ -24,7 +24,7 @@ void operator-=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/indirect_array/op_modulo_assign.md b/reference/valarray/indirect_array/op_modulo_assign.md index 2d20b4b1a0..4d19c595bc 100644 --- a/reference/valarray/indirect_array/op_modulo_assign.md +++ b/reference/valarray/indirect_array/op_modulo_assign.md @@ -24,7 +24,7 @@ void operator%=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/indirect_array/op_multiply_assign.md b/reference/valarray/indirect_array/op_multiply_assign.md index bd0147876f..23cb93b11b 100644 --- a/reference/valarray/indirect_array/op_multiply_assign.md +++ b/reference/valarray/indirect_array/op_multiply_assign.md @@ -24,7 +24,7 @@ void operator*=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/indirect_array/op_or_assign.md b/reference/valarray/indirect_array/op_or_assign.md index 930703436b..3ca28551b8 100644 --- a/reference/valarray/indirect_array/op_or_assign.md +++ b/reference/valarray/indirect_array/op_or_assign.md @@ -24,7 +24,7 @@ void operator|=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/indirect_array/op_plus_assign.md b/reference/valarray/indirect_array/op_plus_assign.md index 5f9cc4ab06..5159d1e7f2 100644 --- a/reference/valarray/indirect_array/op_plus_assign.md +++ b/reference/valarray/indirect_array/op_plus_assign.md @@ -24,7 +24,7 @@ void operator+=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/indirect_array/op_right_shift_assign.md b/reference/valarray/indirect_array/op_right_shift_assign.md index 5b1b23c304..d993fa1cac 100644 --- a/reference/valarray/indirect_array/op_right_shift_assign.md +++ b/reference/valarray/indirect_array/op_right_shift_assign.md @@ -24,7 +24,7 @@ void operator>>=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/indirect_array/op_xor_assign.md b/reference/valarray/indirect_array/op_xor_assign.md index a35d619432..1c4e651eb0 100644 --- a/reference/valarray/indirect_array/op_xor_assign.md +++ b/reference/valarray/indirect_array/op_xor_assign.md @@ -24,7 +24,7 @@ void operator^=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/mask_array/op_and_assign.md b/reference/valarray/mask_array/op_and_assign.md index 5a9298d38b..3ec6c70ae1 100644 --- a/reference/valarray/mask_array/op_and_assign.md +++ b/reference/valarray/mask_array/op_and_assign.md @@ -24,7 +24,7 @@ void operator&=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/mask_array/op_assign.md b/reference/valarray/mask_array/op_assign.md index 402b8cae58..ffaa2d85b1 100644 --- a/reference/valarray/mask_array/op_assign.md +++ b/reference/valarray/mask_array/op_assign.md @@ -34,7 +34,7 @@ public: - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 - (1) : C++03まで、このオーバーロードは使用できなかった。 -- [`valarray`](../valarray.md) から抽出した要素数と `ar` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `ar` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/mask_array/op_divide_assign.md b/reference/valarray/mask_array/op_divide_assign.md index 7195e4a48a..fe85523bfc 100644 --- a/reference/valarray/mask_array/op_divide_assign.md +++ b/reference/valarray/mask_array/op_divide_assign.md @@ -24,7 +24,7 @@ void operator/=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/mask_array/op_left_shift_assign.md b/reference/valarray/mask_array/op_left_shift_assign.md index 921e82b41c..4779d4dcfa 100644 --- a/reference/valarray/mask_array/op_left_shift_assign.md +++ b/reference/valarray/mask_array/op_left_shift_assign.md @@ -24,7 +24,7 @@ void operator<<=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/mask_array/op_minus_assign.md b/reference/valarray/mask_array/op_minus_assign.md index f10b68fbd1..85be9f0b89 100644 --- a/reference/valarray/mask_array/op_minus_assign.md +++ b/reference/valarray/mask_array/op_minus_assign.md @@ -24,7 +24,7 @@ void operator-=(const ValOrProxy& xs) const; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 diff --git a/reference/valarray/mask_array/op_modulo_assign.md b/reference/valarray/mask_array/op_modulo_assign.md index 8250cb4595..b3d4b1f896 100644 --- a/reference/valarray/mask_array/op_modulo_assign.md +++ b/reference/valarray/mask_array/op_modulo_assign.md @@ -24,7 +24,7 @@ void operator%=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/mask_array/op_multiply_assign.md b/reference/valarray/mask_array/op_multiply_assign.md index 41bc721adb..b1c2692027 100644 --- a/reference/valarray/mask_array/op_multiply_assign.md +++ b/reference/valarray/mask_array/op_multiply_assign.md @@ -24,7 +24,7 @@ void operator*=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/mask_array/op_or_assign.md b/reference/valarray/mask_array/op_or_assign.md index caff8df8ee..25562aabe0 100644 --- a/reference/valarray/mask_array/op_or_assign.md +++ b/reference/valarray/mask_array/op_or_assign.md @@ -24,7 +24,7 @@ void operator|=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/mask_array/op_plus_assign.md b/reference/valarray/mask_array/op_plus_assign.md index fdb87752e3..83a29ac100 100644 --- a/reference/valarray/mask_array/op_plus_assign.md +++ b/reference/valarray/mask_array/op_plus_assign.md @@ -24,7 +24,7 @@ void operator+=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/mask_array/op_right_shift_assign.md b/reference/valarray/mask_array/op_right_shift_assign.md index 730fe91196..d8b6080ab6 100644 --- a/reference/valarray/mask_array/op_right_shift_assign.md +++ b/reference/valarray/mask_array/op_right_shift_assign.md @@ -24,7 +24,7 @@ void operator>>=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/mask_array/op_xor_assign.md b/reference/valarray/mask_array/op_xor_assign.md index 3f1ec90683..a1127e8dc5 100644 --- a/reference/valarray/mask_array/op_xor_assign.md +++ b/reference/valarray/mask_array/op_xor_assign.md @@ -24,7 +24,7 @@ void operator^=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/slice_array/op_and_assign.md b/reference/valarray/slice_array/op_and_assign.md index 1a84110f7e..b6a5cfe88d 100644 --- a/reference/valarray/slice_array/op_and_assign.md +++ b/reference/valarray/slice_array/op_and_assign.md @@ -24,7 +24,7 @@ void operator&=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/slice_array/op_assign.md b/reference/valarray/slice_array/op_assign.md index 40f93247ea..494a2f8b8f 100644 --- a/reference/valarray/slice_array/op_assign.md +++ b/reference/valarray/slice_array/op_assign.md @@ -34,7 +34,7 @@ public: - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 - (1) : C++03まで、このオーバーロードは使用できなかった。 -- [`valarray`](../valarray.md) から抽出した要素数と `ar` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `ar` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/slice_array/op_divide_assign.md b/reference/valarray/slice_array/op_divide_assign.md index 8e2fdbba57..ca49fa0365 100644 --- a/reference/valarray/slice_array/op_divide_assign.md +++ b/reference/valarray/slice_array/op_divide_assign.md @@ -24,7 +24,7 @@ void operator/=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/slice_array/op_left_shift_assign.md b/reference/valarray/slice_array/op_left_shift_assign.md index 204d821a67..21a3638df3 100644 --- a/reference/valarray/slice_array/op_left_shift_assign.md +++ b/reference/valarray/slice_array/op_left_shift_assign.md @@ -24,7 +24,7 @@ void operator<<=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/slice_array/op_minus_assign.md b/reference/valarray/slice_array/op_minus_assign.md index 6378267b71..b412b8aeb5 100644 --- a/reference/valarray/slice_array/op_minus_assign.md +++ b/reference/valarray/slice_array/op_minus_assign.md @@ -24,7 +24,7 @@ void operator-=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 diff --git a/reference/valarray/slice_array/op_modulo_assign.md b/reference/valarray/slice_array/op_modulo_assign.md index ce5489a431..ac207a608b 100644 --- a/reference/valarray/slice_array/op_modulo_assign.md +++ b/reference/valarray/slice_array/op_modulo_assign.md @@ -24,7 +24,7 @@ void operator%=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/slice_array/op_multiply_assign.md b/reference/valarray/slice_array/op_multiply_assign.md index 0531c17281..11bdf58331 100644 --- a/reference/valarray/slice_array/op_multiply_assign.md +++ b/reference/valarray/slice_array/op_multiply_assign.md @@ -24,7 +24,7 @@ void operator*=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/slice_array/op_or_assign.md b/reference/valarray/slice_array/op_or_assign.md index ff0bceba1d..5db8516e28 100644 --- a/reference/valarray/slice_array/op_or_assign.md +++ b/reference/valarray/slice_array/op_or_assign.md @@ -24,7 +24,7 @@ void operator|=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/slice_array/op_plus_assign.md b/reference/valarray/slice_array/op_plus_assign.md index 6632f5dde6..57ca3e1e8a 100644 --- a/reference/valarray/slice_array/op_plus_assign.md +++ b/reference/valarray/slice_array/op_plus_assign.md @@ -24,7 +24,7 @@ void operator+=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/slice_array/op_right_shift_assign.md b/reference/valarray/slice_array/op_right_shift_assign.md index bd1adcafcc..2f5300e6ad 100644 --- a/reference/valarray/slice_array/op_right_shift_assign.md +++ b/reference/valarray/slice_array/op_right_shift_assign.md @@ -24,7 +24,7 @@ void operator>>=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/slice_array/op_xor_assign.md b/reference/valarray/slice_array/op_xor_assign.md index 998434ae81..aa5ea12cf2 100644 --- a/reference/valarray/slice_array/op_xor_assign.md +++ b/reference/valarray/slice_array/op_xor_assign.md @@ -24,7 +24,7 @@ void operator^=(const ValOrProxy& xs) const; ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作となる。 +- [`valarray`](../valarray.md) から抽出した要素数と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/valarray/atan2.md b/reference/valarray/valarray/atan2.md index c4e85e1192..683238d9f9 100644 --- a/reference/valarray/valarray/atan2.md +++ b/reference/valarray/valarray/atan2.md @@ -73,7 +73,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `ys` と `xs` の要素数が異なる場合、未定義動作となる。 +- (1) : `ys` と `xs` の要素数が異なる場合、未定義動作を引き起こす。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/max.md b/reference/valarray/valarray/max.md index 97c99f11ed..e52e18965f 100644 --- a/reference/valarray/valarray/max.md +++ b/reference/valarray/valarray/max.md @@ -17,7 +17,7 @@ T max() const; 最大要素の計算には、要素型`T`の`operator<`を使用する。計算の順番は未規定。 -要素数が`0`の場合、未定義動作となる。要素数が`1`の場合、`0`番目の要素を返す。 +要素数が`0`の場合、未定義動作を引き起こす。要素数が`1`の場合、`0`番目の要素を返す。 ## 例 diff --git a/reference/valarray/valarray/min.md b/reference/valarray/valarray/min.md index c99612ebef..0ead6f4dca 100644 --- a/reference/valarray/valarray/min.md +++ b/reference/valarray/valarray/min.md @@ -17,7 +17,7 @@ T min() const; 最小要素の計算には、要素型`T`の`operator<`を使用する。計算の順番は未規定。 -要素数が`0`の場合、未定義動作となる。要素数が`1`の場合、`0`番目の要素を返す。 +要素数が`0`の場合、未定義動作を引き起こす。要素数が`1`の場合、`0`番目の要素を返す。 ## 例 diff --git a/reference/valarray/valarray/op_and.md b/reference/valarray/valarray/op_and.md index af97fb86e0..00f8dcb346 100644 --- a/reference/valarray/valarray/op_and.md +++ b/reference/valarray/valarray/op_and.md @@ -68,7 +68,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作となる。 +- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作を引き起こす。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/op_and_assign.md b/reference/valarray/valarray/op_and_assign.md index c7baaf988f..825f772404 100644 --- a/reference/valarray/valarray/op_and_assign.md +++ b/reference/valarray/valarray/op_and_assign.md @@ -42,7 +42,7 @@ for (size_t i = 0; i < size(); ++i) { ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `*this` と `xs` の要素数が異なる場合、未定義動作となる。 +- (1) : `*this` と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/valarray/op_at.md b/reference/valarray/valarray/op_at.md index 2accabbd2b..187ce2bd39 100644 --- a/reference/valarray/valarray/op_at.md +++ b/reference/valarray/valarray/op_at.md @@ -45,7 +45,7 @@ indirect_array operator[](const ValOrProxy& mask); // (10) `*this`に含まれる`n`番目の要素への参照を返す。 -`n >=` [`size()`](size.md)の場合、未定義動作となる。 +`n >=` [`size()`](size.md)の場合、未定義動作を引き起こす。 - (3) : `*this`に含まれる要素を、[`slice`](/reference/valarray/slice.md)の条件に基いてスライスする。このオーバーロードでは、条件一致した要素をコピー抽出した`valarray`オブジェクトを返す。 - (4) : `*this`に含まれる要素を、[`slice`](/reference/valarray/slice.md)の条件に基いてスライスする。このオーバーロードでは、条件一致した要素への参照を管理する[`slice_array`](/reference/valarray/slice_array.md)オブジェクトを返す。 @@ -61,7 +61,7 @@ indirect_array operator[](const ValOrProxy& mask); // (10) - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 - (3), (5), (7), (9) : `valarray`型のオブジェクトを返すこの関数を含むあらゆる関数は、`valarray`クラスと同じ`const`メンバ関数をもつほかの型を返すことが実装に許可される。例として複数の`valarray`操作をつなげて記述したときに最適化できるよう、式テンプレートを返す実装もある -- (7), (8) : [`size()`](size.md) `!= mask.`[`size()`](size.md)の場合、未定義動作となる。 +- (7), (8) : [`size()`](size.md) `!= mask.`[`size()`](size.md)の場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/valarray/op_constructor.md b/reference/valarray/valarray/op_constructor.md index 7fd8733d94..a17d58f2d5 100644 --- a/reference/valarray/valarray/op_constructor.md +++ b/reference/valarray/valarray/op_constructor.md @@ -42,7 +42,7 @@ valarray(initializer_list init); // (11) C++11 から - (1) : `size() == 0`の要素を持たない空の`valarray`オブジェクトを構築する。 - (2) : `n`個の`T()`初期化された要素を保持した`valarray`オブジェクトを構築する。 - (3) : `value`のコピーを`n`個要素として保持した`valarray`オブジェクトを構築する。 -- (4) : ポインタ`first`が指す要素から`n`個先までをコピーして、`valarray`オブジェクトを構築する。`n`が`first`の要素数より大きい場合、未定義動作となる。 +- (4) : ポインタ`first`が指す要素から`n`個先までをコピーして、`valarray`オブジェクトを構築する。`n`が`first`の要素数より大きい場合、未定義動作を引き起こす。 - (5) : `x`と同じ要素を保持した`valarray`オブジェクトを構築する。 - (6) : `x`と同じ要素を保持した`valarray`オブジェクトを構築する。ムーブ後の`x`の状態は未規定。 - (7), (8), (9), (10) : `x`が参照している要素から、`valarray`オブジェクトを構築する。 diff --git a/reference/valarray/valarray/op_divide.md b/reference/valarray/valarray/op_divide.md index 357fe83c91..67d31a227f 100644 --- a/reference/valarray/valarray/op_divide.md +++ b/reference/valarray/valarray/op_divide.md @@ -69,7 +69,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作となる。 +- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作を引き起こす。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/op_divide_assign.md b/reference/valarray/valarray/op_divide_assign.md index 974f898f95..f0b44c84f5 100644 --- a/reference/valarray/valarray/op_divide_assign.md +++ b/reference/valarray/valarray/op_divide_assign.md @@ -44,7 +44,7 @@ for (std::size_t i = 0; i < size(); ++i) { ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `*this` と `xs` の要素数が異なる場合、未定義動作となる。 +- (1) : `*this` と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/valarray/op_equal.md b/reference/valarray/valarray/op_equal.md index 3e6f6daf9f..724d004a39 100644 --- a/reference/valarray/valarray/op_equal.md +++ b/reference/valarray/valarray/op_equal.md @@ -74,7 +74,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作となる。 +- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作を引き起こす。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/op_greater.md b/reference/valarray/valarray/op_greater.md index 46ea961baf..e2dd164d29 100644 --- a/reference/valarray/valarray/op_greater.md +++ b/reference/valarray/valarray/op_greater.md @@ -74,7 +74,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作となる。 +- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作を引き起こす。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/op_greater_equal.md b/reference/valarray/valarray/op_greater_equal.md index 03c090f1dd..c86094af40 100644 --- a/reference/valarray/valarray/op_greater_equal.md +++ b/reference/valarray/valarray/op_greater_equal.md @@ -74,7 +74,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作となる。 +- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作を引き起こす。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/op_left_shift.md b/reference/valarray/valarray/op_left_shift.md index e937165499..f9207212ed 100644 --- a/reference/valarray/valarray/op_left_shift.md +++ b/reference/valarray/valarray/op_left_shift.md @@ -69,7 +69,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作となる。 +- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作を引き起こす。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/op_left_shift_assign.md b/reference/valarray/valarray/op_left_shift_assign.md index 4cee21f665..6108417b97 100644 --- a/reference/valarray/valarray/op_left_shift_assign.md +++ b/reference/valarray/valarray/op_left_shift_assign.md @@ -44,7 +44,7 @@ for (std::size_t i = 0; i < size(); ++i) { ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `*this` と `xs` の要素数が異なる場合、未定義動作となる。 +- (1) : `*this` と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/valarray/op_less.md b/reference/valarray/valarray/op_less.md index c8c1c5b7ba..351793f2c6 100644 --- a/reference/valarray/valarray/op_less.md +++ b/reference/valarray/valarray/op_less.md @@ -74,7 +74,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作となる。 +- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作を引き起こす。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/op_less_equal.md b/reference/valarray/valarray/op_less_equal.md index f7fde96a1e..82c82c0263 100644 --- a/reference/valarray/valarray/op_less_equal.md +++ b/reference/valarray/valarray/op_less_equal.md @@ -74,7 +74,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作となる。 +- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作を引き起こす。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/op_logical_and.md b/reference/valarray/valarray/op_logical_and.md index f2d61fbb17..f9cb8c8aae 100644 --- a/reference/valarray/valarray/op_logical_and.md +++ b/reference/valarray/valarray/op_logical_and.md @@ -79,7 +79,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作となる。 +- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作を引き起こす。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/op_logical_or.md b/reference/valarray/valarray/op_logical_or.md index 252b8445f4..47a6f18005 100644 --- a/reference/valarray/valarray/op_logical_or.md +++ b/reference/valarray/valarray/op_logical_or.md @@ -79,7 +79,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作となる。 +- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作を引き起こす。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/op_minus.md b/reference/valarray/valarray/op_minus.md index 0ade019196..d1081a5619 100644 --- a/reference/valarray/valarray/op_minus.md +++ b/reference/valarray/valarray/op_minus.md @@ -69,7 +69,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作となる。 +- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作を引き起こす。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/op_minus_assign.md b/reference/valarray/valarray/op_minus_assign.md index fe45f8c506..a3a470557f 100644 --- a/reference/valarray/valarray/op_minus_assign.md +++ b/reference/valarray/valarray/op_minus_assign.md @@ -44,7 +44,7 @@ for (std::size_t i = 0; i < size(); ++i) { ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `*this` と `xs` の要素数が異なる場合、未定義動作となる。 +- (1) : `*this` と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/valarray/op_modulo.md b/reference/valarray/valarray/op_modulo.md index a80234d463..9f3ff99fa0 100644 --- a/reference/valarray/valarray/op_modulo.md +++ b/reference/valarray/valarray/op_modulo.md @@ -69,7 +69,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作となる。 +- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作を引き起こす。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/op_modulo_assign.md b/reference/valarray/valarray/op_modulo_assign.md index e548593cf4..92aa0eb815 100644 --- a/reference/valarray/valarray/op_modulo_assign.md +++ b/reference/valarray/valarray/op_modulo_assign.md @@ -44,7 +44,7 @@ for (std::size_t i = 0; i < size(); ++i) { ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `*this` と `xs` の要素数が異なる場合、未定義動作となる。 +- (1) : `*this` と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/valarray/op_multiply.md b/reference/valarray/valarray/op_multiply.md index b7cdf5208e..f5068bc7de 100644 --- a/reference/valarray/valarray/op_multiply.md +++ b/reference/valarray/valarray/op_multiply.md @@ -68,7 +68,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作となる。 +- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作を引き起こす。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/op_multiply_assign.md b/reference/valarray/valarray/op_multiply_assign.md index 1e26f00492..327d134678 100644 --- a/reference/valarray/valarray/op_multiply_assign.md +++ b/reference/valarray/valarray/op_multiply_assign.md @@ -44,7 +44,7 @@ for (std::size_t i = 0; i < size(); ++i) { ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `*this` と `xs` の要素数が異なる場合、未定義動作となる。 +- (1) : `*this` と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/valarray/op_not_equal.md b/reference/valarray/valarray/op_not_equal.md index 0c067d794e..8d015d4121 100644 --- a/reference/valarray/valarray/op_not_equal.md +++ b/reference/valarray/valarray/op_not_equal.md @@ -74,7 +74,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作となる。 +- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作を引き起こす。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/op_or.md b/reference/valarray/valarray/op_or.md index 994aac3813..4c96a6c008 100644 --- a/reference/valarray/valarray/op_or.md +++ b/reference/valarray/valarray/op_or.md @@ -68,7 +68,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作となる。 +- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作を引き起こす。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/op_or_assign.md b/reference/valarray/valarray/op_or_assign.md index 5b4e4416dd..7cebefbc0d 100644 --- a/reference/valarray/valarray/op_or_assign.md +++ b/reference/valarray/valarray/op_or_assign.md @@ -45,7 +45,7 @@ for (std::size_t i = 0; i < size(); ++i) { ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `*this` と `xs` の要素数が異なる場合、未定義動作となる。 +- (1) : `*this` と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/valarray/op_plus.md b/reference/valarray/valarray/op_plus.md index 487cfb0261..7370c11f60 100644 --- a/reference/valarray/valarray/op_plus.md +++ b/reference/valarray/valarray/op_plus.md @@ -68,7 +68,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作となる。 +- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作を引き起こす。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/op_plus_assign.md b/reference/valarray/valarray/op_plus_assign.md index 902ac464dc..e5b646d5a0 100644 --- a/reference/valarray/valarray/op_plus_assign.md +++ b/reference/valarray/valarray/op_plus_assign.md @@ -45,7 +45,7 @@ for (std::size_t i = 0; i < size(); ++i) { ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `*this` と `xs` の要素数が異なる場合、未定義動作となる。 +- (1) : `*this` と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/valarray/op_right_shift.md b/reference/valarray/valarray/op_right_shift.md index 23489a0349..16f23a3b45 100644 --- a/reference/valarray/valarray/op_right_shift.md +++ b/reference/valarray/valarray/op_right_shift.md @@ -69,7 +69,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作となる。 +- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作を引き起こす。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/op_right_shift_assign.md b/reference/valarray/valarray/op_right_shift_assign.md index 707f27e5f8..b4972766af 100644 --- a/reference/valarray/valarray/op_right_shift_assign.md +++ b/reference/valarray/valarray/op_right_shift_assign.md @@ -44,7 +44,7 @@ for (std::size_t i = 0; i < size(); ++i) { ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `*this` と `xs` の要素数が異なる場合、未定義動作となる。 +- (1) : `*this` と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/valarray/op_xor.md b/reference/valarray/valarray/op_xor.md index 72cbe2e5ad..70eb111d13 100644 --- a/reference/valarray/valarray/op_xor.md +++ b/reference/valarray/valarray/op_xor.md @@ -68,7 +68,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作となる。 +- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作を引き起こす。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/op_xor_assign.md b/reference/valarray/valarray/op_xor_assign.md index 43b19e56c2..2102a591bb 100644 --- a/reference/valarray/valarray/op_xor_assign.md +++ b/reference/valarray/valarray/op_xor_assign.md @@ -44,7 +44,7 @@ for (std::size_t i = 0; i < size(); ++i) { ## 備考 - 引数の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `*this` と `xs` の要素数が異なる場合、未定義動作となる。 +- (1) : `*this` と `xs` の要素数が異なる場合、未定義動作を引き起こす。 ## 例 diff --git a/reference/valarray/valarray/pow.md b/reference/valarray/valarray/pow.md index ea29ab12f4..34ad57c9fd 100644 --- a/reference/valarray/valarray/pow.md +++ b/reference/valarray/valarray/pow.md @@ -73,7 +73,7 @@ return result; ## 備考 - 引数、および、戻り値の型 *`ValOrProxy`* は、[`valarray`](../valarray.md)、あるいは、その代理となる型である。 [``](../../valarray.md) の概要も参照のこと。 -- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作となる。 +- (1) : `xs` と `ys` の要素数が異なる場合、未定義動作を引き起こす。 - C++20における(2)と(3)に対する変更は、`std::valarray{} * 2` のような式が型推論に失敗しないようにするためである。 なお、この変更は規格の誤り修正とみなされているため、処理系によっては C++17 以前でも使用可能となる。 diff --git a/reference/valarray/valarray/sum.md b/reference/valarray/valarray/sum.md index ab6215e9a4..ce888c43c5 100644 --- a/reference/valarray/valarray/sum.md +++ b/reference/valarray/valarray/sum.md @@ -17,7 +17,7 @@ T sum() const; 合計値の計算には、要素型`T`の`operator+=`を使用する。計算の順番は未規定。 -要素数が`0`の場合、未定義動作となる。要素数が`1`の場合、`0`番目の要素を返す。 +要素数が`0`の場合、未定義動作を引き起こす。要素数が`1`の場合、`0`番目の要素を返す。 ## 例 diff --git a/reference/vector/vector/op_at.md b/reference/vector/vector/op_at.md index 53950b09b0..0906270897 100644 --- a/reference/vector/vector/op_at.md +++ b/reference/vector/vector/op_at.md @@ -26,7 +26,7 @@ constexpr const_reference operator[](size_type n) const; // (2) C++20 ## 備考 - `vector`型のオブジェクト`v`に対して、`v[n]` と `*(v.`[`begin()`](begin.md)` + n)` は同じ結果になる -- `n >=` [`size()`](size.md)の場合、未定義動作となる +- `n >=` [`size()`](size.md)の場合、未定義動作を引き起こす - この関数は、[`at()`](at.md)メンバ関数とちがって境界チェックを行うことが規定されない。標準ライブラリの実装によっては[`assert`](/reference/cassert/assert.md)`(n <` [`size()`](size.md)`)`による境界チェックが行われる場合がある From 2839de79f3be5e61a52945c114194b452634b42a Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 3 Sep 2024 15:20:22 +0900 Subject: [PATCH 1184/3948] =?UTF-8?q?offsetof,=20node=5Fhandle=20:=20?= =?UTF-8?q?=E6=9C=AA=E5=AE=9A=E7=BE=A9=E5=8B=95=E4=BD=9C=E3=81=AB=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20#1348?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstddef/offsetof.md | 2 +- reference/node_handle/node_handle.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/cstddef/offsetof.md b/reference/cstddef/offsetof.md index 54ceff2718..5f4e96ed53 100644 --- a/reference/cstddef/offsetof.md +++ b/reference/cstddef/offsetof.md @@ -14,7 +14,7 @@ C++ での構造体の機能的拡張のため、`offsetof` の利用は、C++11以降は[スタンダードレイアウト](/reference/type_traits/is_standard_layout.md)のクラス型に制限され、C++11より以前はC の構造体のコンセプトに対応する POD のクラス型に制限される(但し、`public` な非仮想メンバ関数のみを持ち、コンストラクタ及びデストラクタを持たない非派生クラスも POD である)。 -スタンダードレイアウトではないクラス型においての`offsetof`の利用は条件付きのサポートとなる(C++17より以前はサポートされない)。 +スタンダードレイアウトではないクラス型においての`offsetof`の利用は条件付きのサポートとなる(C++17より以前は未定義動作)。 ## パラメータ - `type` : `member` を有効なメンバ指示子とするクラス型 diff --git a/reference/node_handle/node_handle.md b/reference/node_handle/node_handle.md index 4fe61d338a..3783fead42 100644 --- a/reference/node_handle/node_handle.md +++ b/reference/node_handle/node_handle.md @@ -32,7 +32,7 @@ class node_handle; ノードハンドルが空でない場合は、要素が抽出されたときのコンテナのアロケータと等しいアロケータが含まれる。ノードハンドルが空の場合、アロケータは含まれない。 -`key_type` を `K`、 `mapped_type` を `T` としたとき、`std::pair`または`std::pair`に対するユーザー定義の特殊化が存在する場合、ノードハンドルを用いる操作は定義されない。 +`key_type` を `K`、 `mapped_type` を `T` としたとき、`std::pair`または`std::pair`に対するユーザー定義の特殊化が存在する場合、ノードハンドルを用いる操作は未定義動作を引き起こす。 また、`node_handle`はムーブオンリーである。 From 99bb6b780efc55152ae039360bdbd51c888bc514 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 3 Sep 2024 15:23:27 +0900 Subject: [PATCH 1185/3948] =?UTF-8?q?filter=5Fview::iterator=20:=20?= =?UTF-8?q?=E3=80=8C=E6=9C=AA=E5=AE=9A=E7=BE=A9=E5=8B=95=E4=BD=9C=E3=81=A8?= =?UTF-8?q?=E3=81=AA=E3=82=8B=E3=80=8D=20=E2=86=92=20=E3=80=8C=E6=9C=AA?= =?UTF-8?q?=E5=AE=9A=E7=BE=A9=E5=8B=95=E4=BD=9C=E3=82=92=E5=BC=95=E3=81=8D?= =?UTF-8?q?=E8=B5=B7=E3=81=93=E3=81=99=E3=80=8D=20#1348?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/filter_view/iterator.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/ranges/filter_view/iterator.md b/reference/ranges/filter_view/iterator.md index 80f79e151e..eee3690cf0 100644 --- a/reference/ranges/filter_view/iterator.md +++ b/reference/ranges/filter_view/iterator.md @@ -22,7 +22,7 @@ namespace std::ranges { このクラスの型を取得したい場合、[`iterator_t`](../iterator_t.md)を使用できる。 -このイテレータを通じて値を書き換える場合、その結果が述語の条件を満たさない場合は未定義動作となる。 +このイテレータを通じて値を書き換える場合、その結果が述語の条件を満たさない場合は未定義動作を引き起こす。 ## メンバ変数 From 53aba6fca3e229130f27f54837b71e2d19cbb2fc Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 3 Sep 2024 15:31:54 +0900 Subject: [PATCH 1186/3948] =?UTF-8?q?array::data=20:=20=E6=9C=AA=E8=A6=8F?= =?UTF-8?q?=E5=AE=9A=E3=81=AA=E3=81=AE=E3=81=AF=E6=88=BB=E3=82=8A=E5=80=A4?= =?UTF-8?q?=20#1348?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/array/array/data.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/array/array/data.md b/reference/array/array/data.md index 1bcaeca797..048e885803 100644 --- a/reference/array/array/data.md +++ b/reference/array/array/data.md @@ -26,7 +26,7 @@ constexpr const T* data() const noexcept; // (2) C++17 ## 備考 -0要素の場合(`N == 0`)、この関数の呼び出しによる動作は未規定。 +0要素の場合(`N == 0`)、この関数の戻り値は未規定。 ## 例 From 00567b320c4021e984609c242307e6ff0e1bcbe7 Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Thu, 5 Sep 2024 19:37:08 +0900 Subject: [PATCH 1187/3948] =?UTF-8?q?=E8=AA=A4=E6=A4=8D=E3=82=92=E8=A8=82?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/memory_resource/monotonic_buffer_resource.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/memory_resource/monotonic_buffer_resource.md b/reference/memory_resource/monotonic_buffer_resource.md index 281daea1de..5b0347624c 100644 --- a/reference/memory_resource/monotonic_buffer_resource.md +++ b/reference/memory_resource/monotonic_buffer_resource.md @@ -13,7 +13,7 @@ namespace std::pmr { ## 概要 `monotonic_buffer_resource`はオブジェクトの破棄時にのみ管理しているメモリを全て開放する特殊な [`memory_resource`](memory_resource.md)実装である。 -少さなオブジェクトを多数構築するために割り当てを行い、最後にまとめて開放するといった状況において高速なメモリ割り当てを行うことを目的としている。 +小さなオブジェクトを多数構築するために割り当てを行い、最後にまとめて開放するといった状況において高速なメモリ割り当てを行うことを目的としている。 このクラスはスレッドセーフではない。 From 110d32855a2c2ee349d4f1b25903182da17ce2af Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 5 Sep 2024 19:41:09 +0900 Subject: [PATCH 1188/3948] =?UTF-8?q?layout=5F*=5Fpadded/mapping:=20?= =?UTF-8?q?=E3=83=A1=E3=83=B3=E3=83=90=E9=96=A2=E6=95=B0(#1341)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../layout_left/mapping/op_constructor.md | 2 +- .../mdspan/layout_left_padded/mapping.md | 16 +++--- .../mapping/is_always_exhaustive.md | 38 ++++++++++++++ .../mapping/is_exhaustive.md | 36 +++++++++++++ .../layout_left_padded/mapping/op_call.md | 50 +++++++++++++++++++ .../layout_left_padded/mapping/op_equal.md | 49 ++++++++++++++++++ .../mapping/required_span_size.md | 37 ++++++++++++++ .../layout_left_padded/mapping/stride.md | 46 +++++++++++++++++ .../layout_left_padded/mapping/strides.md | 41 +++++++++++++++ .../mapping/submdspan_mapping.md | 6 +-- .../layout_right/mapping/op_constructor.md | 2 +- .../mdspan/layout_right_padded/mapping.md | 16 +++--- .../mapping/is_always_exhaustive.md | 38 ++++++++++++++ .../mapping/is_exhaustive.md | 36 +++++++++++++ .../layout_right_padded/mapping/op_call.md | 50 +++++++++++++++++++ .../layout_right_padded/mapping/op_equal.md | 49 ++++++++++++++++++ .../mapping/required_span_size.md | 37 ++++++++++++++ .../layout_right_padded/mapping/stride.md | 46 +++++++++++++++++ .../layout_right_padded/mapping/strides.md | 41 +++++++++++++++ .../mapping/submdspan_mapping.md | 6 +-- 20 files changed, 618 insertions(+), 24 deletions(-) create mode 100644 reference/mdspan/layout_left_padded/mapping/is_always_exhaustive.md create mode 100644 reference/mdspan/layout_left_padded/mapping/is_exhaustive.md create mode 100644 reference/mdspan/layout_left_padded/mapping/op_call.md create mode 100644 reference/mdspan/layout_left_padded/mapping/op_equal.md create mode 100644 reference/mdspan/layout_left_padded/mapping/required_span_size.md create mode 100644 reference/mdspan/layout_left_padded/mapping/stride.md create mode 100644 reference/mdspan/layout_left_padded/mapping/strides.md create mode 100644 reference/mdspan/layout_right_padded/mapping/is_always_exhaustive.md create mode 100644 reference/mdspan/layout_right_padded/mapping/is_exhaustive.md create mode 100644 reference/mdspan/layout_right_padded/mapping/op_call.md create mode 100644 reference/mdspan/layout_right_padded/mapping/op_equal.md create mode 100644 reference/mdspan/layout_right_padded/mapping/required_span_size.md create mode 100644 reference/mdspan/layout_right_padded/mapping/stride.md create mode 100644 reference/mdspan/layout_right_padded/mapping/strides.md diff --git a/reference/mdspan/layout_left/mapping/op_constructor.md b/reference/mdspan/layout_left/mapping/op_constructor.md index 14a9af04a3..84170e7f51 100644 --- a/reference/mdspan/layout_left/mapping/op_constructor.md +++ b/reference/mdspan/layout_left/mapping/op_constructor.md @@ -71,7 +71,7 @@ constexpr explicit(extents_type::rank() > 0) - `other.`[`required_span_size()`](../../layout_stride/mapping/required_span_size.md)を、`index_type`型で表現できること。 - (7) : - `extents_type::`[`rank()`](../../extents/rank.md) `> 1`のとき、`other.stride(1) == other.extents(0)` - - `other.`[`required_span_size()`](../../layout_left_padded/mapping/required_span_size.md.nolink)を、`index_type`型で表現できること。 + - `other.`[`required_span_size()`](../../layout_left_padded/mapping/required_span_size.md)を、`index_type`型で表現できること。 ## 効果 diff --git a/reference/mdspan/layout_left_padded/mapping.md b/reference/mdspan/layout_left_padded/mapping.md index 7b80516ca8..d78a0ac3be 100644 --- a/reference/mdspan/layout_left_padded/mapping.md +++ b/reference/mdspan/layout_left_padded/mapping.md @@ -70,11 +70,11 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| | `extents` | 多次元配列のサイズ`extents_`を取得する | C++26 | -| [`strides`](mapping/strides.md.nolink) | ストライド幅配列を取得する | C++26 | -| [`required_span_size`](mapping/required_span_size.md.nolink) | 要素アクセス範囲を取得する | C++26 | -| [`operator()`](mapping/op_call.md.nolink) | 多次元配列インデクスから要素位置へ変換する | C++26 | -| [`is_exhaustive`](mapping/is_exhaustive.md.nolink) | [Exhaustive特性](../LayoutMapping.md)を取得する | C++26 | -| [`stride`](mapping/stride.md.nolink) | 指定次元のストライド幅を取得する | C++26 | +| [`strides`](mapping/strides.md) | ストライド幅配列を取得する | C++26 | +| [`required_span_size`](mapping/required_span_size.md) | 要素アクセス範囲を取得する | C++26 | +| [`operator()`](mapping/op_call.md) | 多次元配列インデクスから要素位置へ変換する | C++26 | +| [`is_exhaustive`](mapping/is_exhaustive.md) | [Exhaustive特性](../LayoutMapping.md)を取得する | C++26 | +| [`stride`](mapping/stride.md) | 指定次元のストライド幅を取得する | C++26 | ## 静的メンバ関数 @@ -82,7 +82,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| | `is_always_unique` | `true`を返す | C++26 | -| [`is_always_exhaustive`](mapping/is_always_exhaustive.md.nolink) | 型の[Exhaustive特性](../LayoutMapping.md)を取得する | C++26 | +| [`is_always_exhaustive`](mapping/is_always_exhaustive.md) | 型の[Exhaustive特性](../LayoutMapping.md)を取得する | C++26 | | `is_always_strided` | `true`を返す | C++26 | | `is_unique` | `true`を返す | C++26 | | `is_strided` | `true`を返す | C++26 | @@ -109,8 +109,8 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`operator==`](mapping/op_equal.md.nolink) | 等値比較 | C++26 | -| [`operator!=`](mapping/op_equal.md.nolink) | 非等値比較 (`==`により使用可能) | C++26 | +| [`operator==`](mapping/op_equal.md) | 等値比較 | C++26 | +| [`operator!=`](mapping/op_equal.md) | 非等値比較 (`==`により使用可能) | C++26 | ## バージョン diff --git a/reference/mdspan/layout_left_padded/mapping/is_always_exhaustive.md b/reference/mdspan/layout_left_padded/mapping/is_always_exhaustive.md new file mode 100644 index 0000000000..79aeaa5f67 --- /dev/null +++ b/reference/mdspan/layout_left_padded/mapping/is_always_exhaustive.md @@ -0,0 +1,38 @@ +# is_always_exhaustive +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* layout_left_padded::mapping[meta class] +* cpp26[meta cpp] + +```cpp +static constexpr bool is_always_exhaustive() noexcept; +``` + +## 概要 +型の[Exhaustive特性](../../LayoutMapping.md)を取得する。 + + +## 戻り値 +- `rank_`が`0`または`1`のとき、`true`を返す。 +- `static-padding-stride`または`first-static-extent`のいずれも[`dynamic_extent`](/reference/span/dynamic_extent.md)に等しくないとき、`static-padding-stride == first-static-extent`を返す。 +- そうではないとき、`false`を返す。 + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) diff --git a/reference/mdspan/layout_left_padded/mapping/is_exhaustive.md b/reference/mdspan/layout_left_padded/mapping/is_exhaustive.md new file mode 100644 index 0000000000..36ff302310 --- /dev/null +++ b/reference/mdspan/layout_left_padded/mapping/is_exhaustive.md @@ -0,0 +1,36 @@ +# is_exhaustive +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* layout_left_padded::mapping[meta class] +* cpp26[meta cpp] + +```cpp +constexpr bool is_exhaustive() const noexcept; +``` + +## 概要 +レイアウトマッピングの[Exhaustive特性](../../LayoutMapping.md)を取得する。 + +## 戻り値 +- `rank_`が`0`または`1`のとき、`true`を返す。 +- そうではないとき、`extents_.extent(0) == stride(1)`を返す。 + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) diff --git a/reference/mdspan/layout_left_padded/mapping/op_call.md b/reference/mdspan/layout_left_padded/mapping/op_call.md new file mode 100644 index 0000000000..a0561eeb11 --- /dev/null +++ b/reference/mdspan/layout_left_padded/mapping/op_call.md @@ -0,0 +1,50 @@ +# operator() +* mdspan[meta header] +* function template[meta id-type] +* std[meta namespace] +* layout_left_padded::mapping[meta class] +* cpp26[meta cpp] + +```cpp +template +constexpr size_t operator()(Indices... idxs) const noexcept; +``` + +## 概要 +多次元インデクス値`idxs...`に対応する要素位置を求める。 + + +## テンプレートパラメータ制約 +- `sizeof...(Indices) == rank_`が`true`、かつ +- `(`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` && ...)`が`true`、かつ +- `(`[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)` && ...)`が`true`であること。 + + +## 事前条件 +多次元インデクス値[`extents_type::index-cast`](../../extents/index-cast.md)`(idxs)`は、多次元配列サイズ`extents_`における有効なインデクスであること。 + + +## 戻り値 +```cpp +return ((static_cast(idxs) * stride(P_rank)) + ... + 0); +``` +* stride[link stride.md] + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) diff --git a/reference/mdspan/layout_left_padded/mapping/op_equal.md b/reference/mdspan/layout_left_padded/mapping/op_equal.md new file mode 100644 index 0000000000..734a10cd10 --- /dev/null +++ b/reference/mdspan/layout_left_padded/mapping/op_equal.md @@ -0,0 +1,49 @@ +# operator== +* mdspan[meta header] +* function template[meta id-type] +* std[meta namespace] +* layout_left_padded::mapping[meta class] +* cpp26[meta cpp] + +```cpp +template +friend constexpr bool operator==( + const mapping& x, const LayoutLeftPaddedMapping& y) noexcept; + +//operator==により、以下のオーバーロードが使用可能になる +template +friend constexpr bool operator!=( + const mapping& x, const LayoutLeftPaddedMapping& y) noexcept; +``` + +## 概要 +`mapping`の等値比較を行う。 + + +## テンプレートパラメータ制約 +- [`is-layout-left-padded-mapping-of`](../../is-layout-left-padded-mapping-of.md)`` +- `LayoutLeftPaddedMapping::extents_type::`[`rank()`](../../extents/rank.md) `== rank_` + + +## 戻り値 +- [`x.extents() == y.extents()`](../../extents/op_equal.md)かつ`rank_ < 2 || x.`[`stride`](stride.md)`(1) == y.stride(1)`のとき、`true`を返す。 +- そうでなければ、`false`を返す。 + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) diff --git a/reference/mdspan/layout_left_padded/mapping/required_span_size.md b/reference/mdspan/layout_left_padded/mapping/required_span_size.md new file mode 100644 index 0000000000..4499cc0af7 --- /dev/null +++ b/reference/mdspan/layout_left_padded/mapping/required_span_size.md @@ -0,0 +1,37 @@ +# required_span_size +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* layout_left_padded::mapping[meta class] +* cpp26[meta cpp] + +```cpp +constexpr index_type required_span_size() const noexcept; +``` + +## 概要 +メモリブロックに対する要素アクセス範囲を取得する。 + + +## 戻り値 +- 多次元インデクス空間`extents_`のサイズが0のとき、値`0`を返す。 +- そうではないとき、`*this(((extents_(P_rank) - index_type(1))...)) + 1`を返す。 + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) diff --git a/reference/mdspan/layout_left_padded/mapping/stride.md b/reference/mdspan/layout_left_padded/mapping/stride.md new file mode 100644 index 0000000000..b798eaab31 --- /dev/null +++ b/reference/mdspan/layout_left_padded/mapping/stride.md @@ -0,0 +1,46 @@ +# stride +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* layout_left_padded::mapping[meta class] +* cpp26[meta cpp] + +```cpp +constexpr index_type stride(rank_type r) const noexcept; +``` + +## 概要 +`r`番目次元のストライド幅を取得する。 + + +## 事前条件 +`r < rank_` + + +## 戻り値 +- `r == 0`のとき、値`1`を返す。 +- `r == 1`のとき、値`stride-1`を返す。 +- そうでなければ、半開区間`[1, r)`の全ての値`k`に対して値`stride-1`と全ての`extents_.extent(k)`を乗算した値を返す。 + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`strides`](strides.md) + + +## 参照 +- [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) diff --git a/reference/mdspan/layout_left_padded/mapping/strides.md b/reference/mdspan/layout_left_padded/mapping/strides.md new file mode 100644 index 0000000000..0fd7389f9f --- /dev/null +++ b/reference/mdspan/layout_left_padded/mapping/strides.md @@ -0,0 +1,41 @@ +# strides +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* layout_left_padded::mapping[meta class] +* cpp26[meta cpp] + +```cpp +constexpr array strides() const noexcept; +``` +* array[link /reference/array/array.md] + +## 概要 +ストライド幅配列を取得する。 + + +## 戻り値 +[`array`](/reference/array/array.md)`({`[`stride`](stride.md)`(P_rank)...})` + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`stride`](stride.md) + + +## 参照 +- [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) diff --git a/reference/mdspan/layout_left_padded/mapping/submdspan_mapping.md b/reference/mdspan/layout_left_padded/mapping/submdspan_mapping.md index 6991234820..39da81837c 100644 --- a/reference/mdspan/layout_left_padded/mapping/submdspan_mapping.md +++ b/reference/mdspan/layout_left_padded/mapping/submdspan_mapping.md @@ -54,10 +54,10 @@ friend constexpr auto submdspan_mapping( - 値`sub_ext` : 式[`submdspan_extents`](../../submdspan_extents.md)`(extents(), slices...)`の結果 - 型`SubExtents` : `decltype(sub_ext)` - 値`sub_strides` : `extents()`の各次元インデクス`k`において、[`map-rank[k]`](../../submdspan_extents.md)が[`dynamic_extent`](/reference/span/dynamic_extent.md)ではない`k`に対し`sub_strides[map-rank[k]]`が下記を満たす、[`array`](/reference/array/array.md)``型の配列値 - - 型`S_k`が[`strided_slice`](../../strided_slice.md)の特殊化かつ`s_k.stride < s_k.extent`の場合、[`stride(k)`](stride.md.nolink) `*` [`de-ice`](../../de-ice.md)`(s_k.stride)` - - そうでなければ、[`stride(k)`](stride.md.nolink) + - 型`S_k`が[`strided_slice`](../../strided_slice.md)の特殊化かつ`s_k.stride < s_k.extent`の場合、[`stride(k)`](stride.md) `*` [`de-ice`](../../de-ice.md)`(s_k.stride)` + - そうでなければ、[`stride(k)`](stride.md) - パラメータパック`P` : [`is_same_v`](/reference/type_traits/is_same.md)`<`[`make_index_sequence`](/reference/utility/make_index_sequence.md)`,` [`index_sequence`](/reference/utility/index_sequence.md)`> == true` -- 値`offset` : `size_t`型の値[`(*this)`](op_call.md.nolink)`(`[`first_`](../../first_.md)`(slices...)...)` +- 値`offset` : `size_t`型の値[`(*this)`](op_call.md)`(`[`first_`](../../first_.md)`(slices...)...)` 説明専用の`submdspan-mapping-impl`関数テンプレートは下記の値を返す。 diff --git a/reference/mdspan/layout_right/mapping/op_constructor.md b/reference/mdspan/layout_right/mapping/op_constructor.md index a26d29527b..e11c6ff4d9 100644 --- a/reference/mdspan/layout_right/mapping/op_constructor.md +++ b/reference/mdspan/layout_right/mapping/op_constructor.md @@ -71,7 +71,7 @@ constexpr explicit(extents_type::rank() > 0) - `other.`[`required_span_size()`](../../layout_stride/mapping/required_span_size.md)を、`index_type`型で表現できること。 - (7) : - `extents_type::`[`rank()`](../../extents/rank.md) `> 1`のとき、`other.stride(extents_type::rank() - 2) == other.extents().extent(extents_type::rank() - 1)` - - `other.`[`required_span_size()`](../../layout_right_padded/mapping/required_span_size.md.nolink)を、`index_type`型で表現できること。 + - `other.`[`required_span_size()`](../../layout_right_padded/mapping/required_span_size.md)を、`index_type`型で表現できること。 ## 効果 diff --git a/reference/mdspan/layout_right_padded/mapping.md b/reference/mdspan/layout_right_padded/mapping.md index 97528c06a9..d71ae32151 100644 --- a/reference/mdspan/layout_right_padded/mapping.md +++ b/reference/mdspan/layout_right_padded/mapping.md @@ -70,11 +70,11 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| | `extents` | 多次元配列のサイズ`extents_`を取得する | C++26 | -| [`strides`](mapping/strides.md.nolink) | ストライド幅配列を取得する | C++26 | -| [`required_span_size`](mapping/required_span_size.md.nolink) | 要素アクセス範囲を取得する | C++26 | -| [`operator()`](mapping/op_call.md.nolink) | 多次元配列インデクスから要素位置へ変換する | C++26 | -| [`is_exhaustive`](mapping/is_exhaustive.md.nolink) | [Exhaustive特性](../LayoutMapping.md)を取得する | C++26 | -| [`stride`](mapping/stride.md.nolink) | 指定次元のストライド幅を取得する | C++26 | +| [`strides`](mapping/strides.md) | ストライド幅配列を取得する | C++26 | +| [`required_span_size`](mapping/required_span_size.md) | 要素アクセス範囲を取得する | C++26 | +| [`operator()`](mapping/op_call.md) | 多次元配列インデクスから要素位置へ変換する | C++26 | +| [`is_exhaustive`](mapping/is_exhaustive.md) | [Exhaustive特性](../LayoutMapping.md)を取得する | C++26 | +| [`stride`](mapping/stride.md) | 指定次元のストライド幅を取得する | C++26 | ## 静的メンバ関数 @@ -82,7 +82,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| | `is_always_unique` | `true`を返す | C++26 | -| [`is_always_exhaustive`](mapping/is_always_exhaustive.md.nolink) | 型の[Exhaustive特性](../LayoutMapping.md)を取得する | C++26 | +| [`is_always_exhaustive`](mapping/is_always_exhaustive.md) | 型の[Exhaustive特性](../LayoutMapping.md)を取得する | C++26 | | `is_always_strided` | `true`を返す | C++26 | | `is_unique` | `true`を返す | C++26 | | `is_strided` | `true`を返す | C++26 | @@ -109,8 +109,8 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`operator==`](mapping/op_equal.md.nolink) | 等値比較 | C++26 | -| [`operator!=`](mapping/op_equal.md.nolink) | 非等値比較 (`==`により使用可能) | C++26 | +| [`operator==`](mapping/op_equal.md) | 等値比較 | C++26 | +| [`operator!=`](mapping/op_equal.md) | 非等値比較 (`==`により使用可能) | C++26 | ## バージョン diff --git a/reference/mdspan/layout_right_padded/mapping/is_always_exhaustive.md b/reference/mdspan/layout_right_padded/mapping/is_always_exhaustive.md new file mode 100644 index 0000000000..41c5aaebc3 --- /dev/null +++ b/reference/mdspan/layout_right_padded/mapping/is_always_exhaustive.md @@ -0,0 +1,38 @@ +# is_always_exhaustive +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* layout_right_padded::mapping[meta class] +* cpp26[meta cpp] + +```cpp +static constexpr bool is_always_exhaustive() noexcept; +``` + +## 概要 +型の[Exhaustive特性](../../LayoutMapping.md)を取得する。 + + +## 戻り値 +- `rank_`が`0`または`1`のとき、`true`を返す。 +- `static-padding-stride`または`last-static-extent`のいずれも[`dynamic_extent`](/reference/span/dynamic_extent.md)に等しくないとき、`static-padding-stride == last-static-extent`を返す。 +- そうではないとき、`false`を返す。 + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) diff --git a/reference/mdspan/layout_right_padded/mapping/is_exhaustive.md b/reference/mdspan/layout_right_padded/mapping/is_exhaustive.md new file mode 100644 index 0000000000..d507a7ca79 --- /dev/null +++ b/reference/mdspan/layout_right_padded/mapping/is_exhaustive.md @@ -0,0 +1,36 @@ +# is_exhaustive +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* layout_right_padded::mapping[meta class] +* cpp26[meta cpp] + +```cpp +constexpr bool is_exhaustive() const noexcept; +``` + +## 概要 +レイアウトマッピングの[Exhaustive特性](../../LayoutMapping.md)を取得する。 + +## 戻り値 +- `rank_`が`0`または`1`のとき、`true`を返す。 +- そうではないとき、`extents_.extent(rank_ - 1) == stride(rank_ - 2)`を返す。 + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) diff --git a/reference/mdspan/layout_right_padded/mapping/op_call.md b/reference/mdspan/layout_right_padded/mapping/op_call.md new file mode 100644 index 0000000000..04a3416ea3 --- /dev/null +++ b/reference/mdspan/layout_right_padded/mapping/op_call.md @@ -0,0 +1,50 @@ +# operator() +* mdspan[meta header] +* function template[meta id-type] +* std[meta namespace] +* layout_right_padded::mapping[meta class] +* cpp26[meta cpp] + +```cpp +template +constexpr size_t operator()(Indices... idxs) const noexcept; +``` + +## 概要 +多次元インデクス値`idxs...`に対応する要素位置を求める。 + + +## テンプレートパラメータ制約 +- `sizeof...(Indices) == rank_`が`true`、かつ +- `(`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` && ...)`が`true`、かつ +- `(`[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)` && ...)`が`true`であること。 + + +## 事前条件 +多次元インデクス値[`extents_type::index-cast`](../../extents/index-cast.md)`(idxs)`は、多次元配列サイズ`extents_`における有効なインデクスであること。 + + +## 戻り値 +```cpp +return ((static_cast(idxs) * stride(P_rank)) + ... + 0); +``` +* stride[link stride.md] + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) diff --git a/reference/mdspan/layout_right_padded/mapping/op_equal.md b/reference/mdspan/layout_right_padded/mapping/op_equal.md new file mode 100644 index 0000000000..c5e50bf423 --- /dev/null +++ b/reference/mdspan/layout_right_padded/mapping/op_equal.md @@ -0,0 +1,49 @@ +# operator== +* mdspan[meta header] +* function template[meta id-type] +* std[meta namespace] +* layout_right_padded::mapping[meta class] +* cpp26[meta cpp] + +```cpp +template +friend constexpr bool operator==( + const mapping& x, const LayoutRightPaddedMapping& y) noexcept; + +//operator==により、以下のオーバーロードが使用可能になる +template +friend constexpr bool operator!=( + const mapping& x, const LayoutRightPaddedMapping& y) noexcept; +``` + +## 概要 +`mapping`の等値比較を行う。 + + +## テンプレートパラメータ制約 +- [`is-layout-right-padded-mapping-of`](../../is-layout-right-padded-mapping-of.md)`` +- `LayoutRightPaddedMapping::extents_type::`[`rank()`](../../extents/rank.md) `== rank_` + + +## 戻り値 +- [`x.extents() == y.extents()`](../../extents/op_equal.md)かつ`rank_ < 2 || x.`[`stride`](stride.md)`(rank_ - 2) == y.stride(rank_ - 1)`のとき、`true`を返す。 +- そうでなければ、`false`を返す。 + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) diff --git a/reference/mdspan/layout_right_padded/mapping/required_span_size.md b/reference/mdspan/layout_right_padded/mapping/required_span_size.md new file mode 100644 index 0000000000..13de5e5bf6 --- /dev/null +++ b/reference/mdspan/layout_right_padded/mapping/required_span_size.md @@ -0,0 +1,37 @@ +# required_span_size +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* layout_right_padded::mapping[meta class] +* cpp26[meta cpp] + +```cpp +constexpr index_type required_span_size() const noexcept; +``` + +## 概要 +メモリブロックに対する要素アクセス範囲を取得する。 + + +## 戻り値 +- 多次元インデクス空間`extents_`のサイズが0のとき、値`0`を返す。 +- そうではないとき、`*this(((extents_(P_rank) - index_type(1))...)) + 1`を返す。 + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) diff --git a/reference/mdspan/layout_right_padded/mapping/stride.md b/reference/mdspan/layout_right_padded/mapping/stride.md new file mode 100644 index 0000000000..4cb1b8cb4e --- /dev/null +++ b/reference/mdspan/layout_right_padded/mapping/stride.md @@ -0,0 +1,46 @@ +# stride +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* layout_right_padded::mapping[meta class] +* cpp26[meta cpp] + +```cpp +constexpr index_type stride(rank_type r) const noexcept; +``` + +## 概要 +`r`番目次元のストライド幅を取得する。 + + +## 事前条件 +`r < rank_` + + +## 戻り値 +- `r == rank_ - 1`のとき、値`1`を返す。 +- `r == rank_ - 2`のとき、値`stride-rm2`を返す。 +- そうでなければ、半開区間`[r + 1, rank_ - 1)`の全ての値`k`に対して値`stride-rm2`と全ての`extents_.extent(k)`を乗算した値を返す。 + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`strides`](strides.md) + + +## 参照 +- [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) diff --git a/reference/mdspan/layout_right_padded/mapping/strides.md b/reference/mdspan/layout_right_padded/mapping/strides.md new file mode 100644 index 0000000000..d7a4192b54 --- /dev/null +++ b/reference/mdspan/layout_right_padded/mapping/strides.md @@ -0,0 +1,41 @@ +# strides +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* layout_right_padded::mapping[meta class] +* cpp26[meta cpp] + +```cpp +constexpr array strides() const noexcept; +``` +* array[link /reference/array/array.md] + +## 概要 +ストライド幅配列を取得する。 + + +## 戻り値 +[`array`](/reference/array/array.md)`({`[`stride`](stride.md)`(P_rank)...})` + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`stride`](stride.md) + + +## 参照 +- [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) diff --git a/reference/mdspan/layout_right_padded/mapping/submdspan_mapping.md b/reference/mdspan/layout_right_padded/mapping/submdspan_mapping.md index 6d5a1beff8..b53c0d1e4e 100644 --- a/reference/mdspan/layout_right_padded/mapping/submdspan_mapping.md +++ b/reference/mdspan/layout_right_padded/mapping/submdspan_mapping.md @@ -54,10 +54,10 @@ friend constexpr auto submdspan_mapping( - 値`sub_ext` : 式[`submdspan_extents`](../../submdspan_extents.md)`(extents(), slices...)`の結果 - 型`SubExtents` : `decltype(sub_ext)` - 値`sub_strides` : `extents()`の各次元インデクス`k`において、[`map-rank[k]`](../../submdspan_extents.md)が[`dynamic_extent`](/reference/span/dynamic_extent.md)ではない`k`に対し`sub_strides[map-rank[k]]`が下記を満たす、[`array`](/reference/array/array.md)``型の配列値 - - 型`S_k`が[`strided_slice`](../../strided_slice.md)の特殊化かつ`s_k.stride < s_k.extent`の場合、[`stride(k)`](stride.md.nolink) `*` [`de-ice`](../../de-ice.md)`(s_k.stride)` - - そうでなければ、[`stride(k)`](stride.md.nolink) + - 型`S_k`が[`strided_slice`](../../strided_slice.md)の特殊化かつ`s_k.stride < s_k.extent`の場合、[`stride(k)`](stride.md) `*` [`de-ice`](../../de-ice.md)`(s_k.stride)` + - そうでなければ、[`stride(k)`](stride.md) - パラメータパック`P` : [`is_same_v`](/reference/type_traits/is_same.md)`<`[`make_index_sequence`](/reference/utility/make_index_sequence.md)`,` [`index_sequence`](/reference/utility/index_sequence.md)`> == true` -- 値`offset` : `size_t`型の値[`(*this)`](op_call.md.nolink)`(`[`first_`](../../first_.md)`(slices...)...)` +- 値`offset` : `size_t`型の値[`(*this)`](op_call.md)`(`[`first_`](../../first_.md)`(slices...)...)` 説明専用の`submdspan-mapping-impl`関数テンプレートは下記の値を返す。 From 54bc5579a332978cc5f87687f8e68560e070a6be Mon Sep 17 00:00:00 2001 From: Yuya Asano <64895419+sukeya@users.noreply.github.com> Date: Thu, 5 Sep 2024 22:04:13 +0900 Subject: [PATCH 1189/3948] =?UTF-8?q?=E8=AA=A4=E6=A4=8D=E3=82=92=E8=A8=82?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yuya Asano <64895419+sukeya@users.noreply.github.com> --- reference/memory_resource/monotonic_buffer_resource.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/memory_resource/monotonic_buffer_resource.md b/reference/memory_resource/monotonic_buffer_resource.md index 5b0347624c..ad76849480 100644 --- a/reference/memory_resource/monotonic_buffer_resource.md +++ b/reference/memory_resource/monotonic_buffer_resource.md @@ -12,8 +12,8 @@ namespace std::pmr { ## 概要 -`monotonic_buffer_resource`はオブジェクトの破棄時にのみ管理しているメモリを全て開放する特殊な [`memory_resource`](memory_resource.md)実装である。 -小さなオブジェクトを多数構築するために割り当てを行い、最後にまとめて開放するといった状況において高速なメモリ割り当てを行うことを目的としている。 +`monotonic_buffer_resource`はオブジェクトの破棄時にのみ管理しているメモリを全て解放する特殊な [`memory_resource`](memory_resource.md)実装である。 +小さなオブジェクトを多数構築するために割り当てを行い、最後にまとめて解放するといった状況において高速なメモリ割り当てを行うことを目的としている。 このクラスはスレッドセーフではない。 From 9119e06bfc3ec280b28f12b785da0f188c5a6ab7 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 11 Sep 2024 16:03:22 +0900 Subject: [PATCH 1190/3948] =?UTF-8?q?C++26=E5=AF=BE=E5=BF=9C=E3=81=A8?= =?UTF-8?q?=E3=81=97=E3=81=A6=E3=80=81enable=5Fnonlocking=5Fformatter=5Fop?= =?UTF-8?q?timization=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit close #1314 close #1334 --- reference/chrono/duration.md | 1 + ...nable_nonlocking_formatter_optimization.md | 30 ++++++++ reference/chrono/zoned_time.md | 1 + ...nable_nonlocking_formatter_optimization.md | 30 ++++++++ reference/format.md | 1 + ...nable_nonlocking_formatter_optimization.md | 68 +++++++++++++++++++ reference/print.md | 2 + reference/print/print.md | 63 ++++++++++++----- reference/print/vprint_nonunicode.md | 7 +- reference/print/vprint_nonunicode_buffered.md | 52 ++++++++++++++ reference/print/vprint_unicode.md | 37 ++++++---- reference/print/vprint_unicode_buffered.md | 52 ++++++++++++++ 12 files changed, 314 insertions(+), 30 deletions(-) create mode 100644 reference/chrono/duration/enable_nonlocking_formatter_optimization.md create mode 100644 reference/chrono/zoned_time/enable_nonlocking_formatter_optimization.md create mode 100644 reference/format/enable_nonlocking_formatter_optimization.md create mode 100644 reference/print/vprint_nonunicode_buffered.md create mode 100644 reference/print/vprint_unicode_buffered.md diff --git a/reference/chrono/duration.md b/reference/chrono/duration.md index eb94954025..8e109b71d2 100644 --- a/reference/chrono/duration.md +++ b/reference/chrono/duration.md @@ -156,6 +156,7 @@ namespace chrono { | 名前 | 説明 | 対応バージョン | |-------|--------------------|----------------| | [`formatter`](duration/formatter.md) | 文字列フォーマットの許可。[`std::formatter`](/reference/format/formatter.md)クラスの特殊化 | C++20 | +| [`enable_nonlocking_formatter_optimization`](duration/enable_nonlocking_formatter_optimization.md) | [`std::print()`](/reference/print/print.md)と[`std::println()`](/reference/print/println.md)の効率的な実装を有効にする | C++26 | ## ハッシュサポート diff --git a/reference/chrono/duration/enable_nonlocking_formatter_optimization.md b/reference/chrono/duration/enable_nonlocking_formatter_optimization.md new file mode 100644 index 0000000000..748f95ab59 --- /dev/null +++ b/reference/chrono/duration/enable_nonlocking_formatter_optimization.md @@ -0,0 +1,30 @@ +# enable_nonlocking_formatter_optimization +* chrono[meta header] +* std[meta namespace] +* variable[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + inline constexpr bool enable_nonlocking_formatter_optimization< + chrono::duration> = + enable_nonlocking_formatter_optimization; +} +``` + +## 概要 +`duration`クラスに対する[`std::enable_nonlocking_formatter_optimization`](/reference/format/enable_nonlocking_formatter_optimization.md)変数テンプレートの特殊化。 + + +## バージョン +### 言語 +- C++26 + +## 関連項目 +- [`std::enable_nonlocking_formatter_optimization`](/reference/format/enable_nonlocking_formatter_optimization.md) + + +## 参照 +- [P3107R5 Permit an efficient implementation of `std::print`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3107r5.html) +- [P3235R3 `std::print` more types faster with less memory](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3235r3.html) diff --git a/reference/chrono/zoned_time.md b/reference/chrono/zoned_time.md index 1dcdadcff3..6fd7254a28 100644 --- a/reference/chrono/zoned_time.md +++ b/reference/chrono/zoned_time.md @@ -85,6 +85,7 @@ namespace std::chrono { | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`formatter`](zoned_time/formatter.md) | [`std::formatter`](/reference/format/formatter.md)クラスの特殊化 | C++20 | +| [`enable_nonlocking_formatter_optimization`](zoned_time/enable_nonlocking_formatter_optimization.md) | [`std::print()`](/reference/print/print.md)と[`std::println()`](/reference/print/println.md)の効率的な実装を有効にする | C++26 | ## ハッシュサポート diff --git a/reference/chrono/zoned_time/enable_nonlocking_formatter_optimization.md b/reference/chrono/zoned_time/enable_nonlocking_formatter_optimization.md new file mode 100644 index 0000000000..9ecafcccb3 --- /dev/null +++ b/reference/chrono/zoned_time/enable_nonlocking_formatter_optimization.md @@ -0,0 +1,30 @@ +# enable_nonlocking_formatter_optimization +* chrono[meta header] +* std[meta namespace] +* variable[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + inline constexpr bool enable_nonlocking_formatter_optimization< + chrono::zoned_time> = true; +} +``` +* chrono::time_zone[link /reference/chrono/time_zone.md] + +## 概要 +`zoned_time`クラスに対する[`std::enable_nonlocking_formatter_optimization`](/reference/format/enable_nonlocking_formatter_optimization.md)変数テンプレートの特殊化。 + + +## バージョン +### 言語 +- C++26 + +## 関連項目 +- [`std::enable_nonlocking_formatter_optimization`](/reference/format/enable_nonlocking_formatter_optimization.md) + + +## 参照 +- [P3107R5 Permit an efficient implementation of `std::print`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3107r5.html) +- [P3235R3 `std::print` more types faster with less memory](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3235r3.html) diff --git a/reference/format.md b/reference/format.md index 35aac98b1e..4c533bd1ea 100644 --- a/reference/format.md +++ b/reference/format.md @@ -26,6 +26,7 @@ |----------------------------------------------------------------------|-----------------------------------------------------------------------------|----------------| | [`formattable`](format/formattable.md) | 文字列フォーマット可能 (concept) | C++23 | | [`formatter`](format/formatter.md) | 引数の型に対応する書式文字列の解析、値のフォーマットを担う (class template) | C++20 | +| [`enable_nonlocking_formatter_optimization`](format/enable_nonlocking_formatter_optimization.md) | [`std::print()`](/reference/print/print.md)と[`std::println()`](/reference/print/println.md)の効率的な実装を有効にする | C++26 | | [`basic_format_parse_context`](format/basic_format_parse_context.md) | 書式文字列の解析のコンテキスト (class template) | C++20 | | [`format_parse_context`](format/basic_format_parse_context.md) | `basic_format_parse_context`のマルチバイト文字列版 (type-alias) | C++20 | | [`wformat_parse_context`](format/basic_format_parse_context.md) | `basic_format_parse_context`のワイド文字列版 (type-alias) | C++20 | diff --git a/reference/format/enable_nonlocking_formatter_optimization.md b/reference/format/enable_nonlocking_formatter_optimization.md new file mode 100644 index 0000000000..3ac718bf4a --- /dev/null +++ b/reference/format/enable_nonlocking_formatter_optimization.md @@ -0,0 +1,68 @@ +# enable_nonlocking_formatter_optimization +* format[meta header] +* std[meta namespace] +* variable[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + constexpr bool enable_nonlocking_formatter_optimization = false; // (1) C++26 +} +``` + +## 概要 +[`std::print()`](/reference/print/print.md)と[`std::println()`](/reference/print/println.md)の効率的な実装を有効にする。 + +この値が`true`で定義される場合、文字列フォーマットされた文字列のストリームへの書き込み時に、余分な動的メモリ確保を行わない。 + +とくに指定されない限り、標準ライブラリで[`std::formatter`](formatter.md)の特殊化が定義される型に対して、各ヘッダは以下の特殊化を定義する: + +```cpp +template<> +inline constexpr bool enable_nonlocking_formatter_optimization = true; +``` + +Rangeに対しては、以下が定義される: + +```cpp +template + requires (format_kind != range_format::disabled) +inline constexpr bool enable_nonlocking_formatter_optimization = false; +``` +* ranges::input_range[link /reference/ranges/input_range.md] +* format_kind[link format_kind.md] +* range_format[link range_format.md] + +[`std::pair`](/reference/utility/pair.md)および[`std::tuple`](/reference/tuple/tuple.md)に対しては、以下が定義される: + +```cpp +template +inline constexpr bool enable_nonlocking_formatter_optimization> = + (enable_nonlocking_formatter_optimization && ...); +``` + + +## 備考 +- ユーザーは、任意のCV修飾されないユーザー定義型でこの型の特殊化を定義できる + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 18 [mark noimpl] +- [GCC](/implementation.md#gcc): 14 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark noimpl] + + +## 関連項目 +- [`std::print()`](/reference/print/print.md) +- [`std::chrono::duration`に対する`enable_nonlocking_formatter_optimization`](/reference/chrono/duration/enable_nonlocking_formatter_optimization.md) +- [`std::chrono::zoned_time`に対する`enable_nonlocking_formatter_optimization`](/reference/chrono/zoned_time/enable_nonlocking_formatter_optimization.md) + + +## 参照 +- [P3107R5 Permit an efficient implementation of `std::print`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3107r5.html) +- [P3235R3 `std::print` more types faster with less memory](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3235r3.html) diff --git a/reference/print.md b/reference/print.md index 961249f324..b2b96e9e09 100644 --- a/reference/print.md +++ b/reference/print.md @@ -12,7 +12,9 @@ | [`print`](print/print.md) | 書式指定で出力する (function template) | C++23 | | [`println`](print/println.md) | 書式指定で出力する。末尾改行付き (function template) | C++23 | | [`vprint_unicode`](print/vprint_unicode.md) | 書式指定でUnicode出力する (function) | C++23 | +| [`vprint_unicode_buffered`](print/vprint_nonunicode_buffered.md) | 確保した文字列バッファに書式指定の出力を作ってからUnicode出力する (function) | C++26 | | [`vprint_nonunicode`](print/vprint_nonunicode.md) | 書式指定で非Unicode出力する (function) | C++23 | +| [`vprint_nonunicode_buffered`](print/vprint_nonunicode_buffered.md) | 確保した文字列バッファに書式指定の出力を作ってから非Unicode出力する (function) | C++26 | ## バージョン ### 言語 diff --git a/reference/print/print.md b/reference/print/print.md index 359159b75c..87a33baa92 100644 --- a/reference/print/print.md +++ b/reference/print/print.md @@ -42,23 +42,49 @@ namespace std { * stdout[link /reference/cstdio/stdout.md.nolink] * std::forward[link /reference/utility/forward.md] -- (2) : 通常の文字列リテラルがUTF-8エンコーディングされている場合、以下と等価: - ```cpp - vprint_unicode(stream, fmt.get(), make_format_args(std::forward(args)...)); - ``` - * vprint_unicode[link vprint_unicode.md] - * fmt.get()[link /reference/format/format_string/get.md.nolink] - * make_format_args[link /reference/format/make_format_args.md] - * std::forward[link /reference/utility/forward.md] - - - そうでなければ、以下と等価: - ```cpp - vprint_nonunicode(stream, fmt.get(), make_format_args(std::forward(args)...)); - ``` - * vprint_nonunicode[link vprint_nonunicode.md] - * fmt.get()[link /reference/format/format_string/get.md.nolink] - * make_format_args[link /reference/format/make_format_args.md] - * std::forward[link /reference/utility/forward.md] +- (2) : + - C++23 : + - 通常の文字列リテラルがUTF-8エンコーディングされている場合、以下と等価: + ```cpp + vprint_unicode(stream, fmt.get(), make_format_args(std::forward(args)...)); + ``` + * vprint_unicode[link vprint_unicode.md] + * fmt.get()[link /reference/format/format_string/get.md.nolink] + * make_format_args[link /reference/format/make_format_args.md] + * std::forward[link /reference/utility/forward.md] + + - そうでなければ、以下と等価: + ```cpp + vprint_nonunicode(stream, fmt.get(), make_format_args(std::forward(args)...)); + ``` + * vprint_nonunicode[link vprint_nonunicode.md] + * fmt.get()[link /reference/format/format_string/get.md.nolink] + * make_format_args[link /reference/format/make_format_args.md] + * std::forward[link /reference/utility/forward.md] + + - C++26 : + - 値として`(`[`enable_nonlocking_formatter_optimization`](/reference/format/enable_nonlocking_formatter_optimization.md)`<`[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`> && ...)`をもつ変数`locksafe`があるとして、 + - 通常の文字列リテラルがUTF-8エンコーディングされている場合、以下と等価: + ```cpp + locksafe + ? vprint_unicode(stream, fmt.get(), make_format_args(args...)) + : vprint_unicode_buffered(stream, fmt.get(), make_format_args(args...)); + ``` + * vprint_unicode[link vprint_unicode.md] + * vprint_unicode_buffered[link vprint_unicode_buffered.md] + * fmt.get()[link /reference/format/format_string/get.md.nolink] + * make_format_args[link /reference/format/make_format_args.md] + + - そうでなければ、以下と等価: + ```cpp + locksafe + ? vprint_nonunicode(stream, fmt.get(), make_format_args(args...)) + : vprint_nonunicode_buffered(stream, fmt.get(), make_format_args(args...)); + ``` + * vprint_nonunicode[link vprint_nonunicode.md] + * vprint_nonunicode_buffered[link vprint_nonunicode_buffered.md] + * fmt.get()[link /reference/format/format_string/get.md.nolink] + * make_format_args[link /reference/format/make_format_args.md] ## 備考 @@ -164,3 +190,6 @@ Hello ## 参照 - [P2093R14 Formatted output](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2093r14.html) +- [P3107R5 Permit an efficient implementation of `std::print`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3107r5.html) +- [P3235R3 `std::print` more types faster with less memory](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3235r3.html) + - C++26の上記2つの提案文書では、余分な動的メモリ確保をしないよう仕様が見直された diff --git a/reference/print/vprint_nonunicode.md b/reference/print/vprint_nonunicode.md index bdeee9d6ba..8d7e459c3f 100644 --- a/reference/print/vprint_nonunicode.md +++ b/reference/print/vprint_nonunicode.md @@ -37,7 +37,9 @@ namespace std { ``` * stdout[link /reference/cstdio/stdout.md.nolink] -- (2) : [`vformat`](/reference/format/vformat.md)`(fmt, args)`の結果を`stream`に書き出す +- (2) : + - C++23 : [`vformat`](/reference/format/vformat.md)`(fmt, args)`の結果を`stream`に書き出す + - C++26 : ストリームのロックを保持したまま、`fmt`で書式指定に従って書式化された`args`の文字表現を`stream`に書き出す ## 例外 @@ -65,3 +67,6 @@ namespace std { ## 参照 - [P2093R14 Formatted output](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2093r14.html) +- [P3107R5 Permit an efficient implementation of `std::print`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3107r5.html) +- [P3235R3 `std::print` more types faster with less memory](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3235r3.html) + - C++26の上記2つの提案文書では、余分な動的メモリ確保をしないよう仕様が見直された diff --git a/reference/print/vprint_nonunicode_buffered.md b/reference/print/vprint_nonunicode_buffered.md new file mode 100644 index 0000000000..6521cbc1c6 --- /dev/null +++ b/reference/print/vprint_nonunicode_buffered.md @@ -0,0 +1,52 @@ +# vprint_nonunicode_buffered +* print[meta header] +* std[meta namespace] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + void vprint_nonunicode_buffered( + FILE* stream, + string_view fmt, + format_args args); // (1) C++26 +} +``` +* FILE[link /reference/cstdio/file.md.nolink] +* format_args[link /reference/format/basic_format_args.md] + +## 概要 +確保した文字列バッファに書式指定の出力を作ってから非Unicode出力する。 + + +## 効果 +- (1) : 以下と等価: + ```cpp + string out = vformat(fmt, args); + vprint_nonunicode("{}", make_format_args(out)); + ``` + * string[link /reference/string/basic_string.md] + * vformat[link /reference/format/vformat.md] + * vprint_nonunicode[link vprint_nonunicode.md] + * make_format_args[link /reference/format/make_format_args.md] + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 18 [mark noimpl] +- [GCC](/implementation.md#gcc): 14 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark noimpl] + + +## 関連項目 +- [`std::print()`](print.md) +- [`std::println()`](println.md) +- [`std::vprint_nonunicode()`](vprint_nonunicode.md) + + +## 参照 +- [P3107R5 Permit an efficient implementation of `std::print`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3107r5.html) +- [P3235R3 `std::print` more types faster with less memory](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3235r3.html) diff --git a/reference/print/vprint_unicode.md b/reference/print/vprint_unicode.md index 652f0d9c1a..775af92699 100644 --- a/reference/print/vprint_unicode.md +++ b/reference/print/vprint_unicode.md @@ -37,20 +37,30 @@ namespace std { ``` * stdout[link /reference/cstdio/stdout.md.nolink] -- (2) : 以下の方法で自動変数を初期化する: - ```cpp - string out = vformat(fmt, args); - ``` - * string[link /reference/string/basic_string.md] - * vformat[link /reference/format/vformat.md] - - - `stream`がUnicodeを表示できる端末を参照している場合、ネイティブのUnicode APIを使用して端末に書き出す - - `out`に無効なコードユニットが含まれる場合、その動作は未定義であり,実装者はそれを診断することが推奨される。それ以外の場合は、変更せずにストリームに書き出す。そうでなければ、変更せず`stream`に`out`を書き出す。 - - ネイティブのUnicode APIを使用する場合、この関数は`out`を書き出す前にフラッシュする - +- (2) : + - C++23 : + - 以下の方法で自動変数を初期化する: + ```cpp + string out = vformat(fmt, args); + ``` + * string[link /reference/string/basic_string.md] + * vformat[link /reference/format/vformat.md] + + - `stream`がUnicodeを表示できる端末を参照している場合、ネイティブのUnicode APIを使用して端末に書き出す + - `out`に無効なコードユニットが含まれる場合、その動作は未定義であり,実装者はそれを診断することが推奨される。それ以外の場合は、変更せずにストリームに書き出す。そうでなければ、変更せず`stream`に`out`を書き出す。 + - ネイティブのUnicode APIを使用する場合、この関数は`out`を書き出す前にフラッシュする + + - C++26 : + - `stream`のロックを取得する + - `fmt`で書式指定に従って書式化された`args`の文字表現を`out`とする + - `stream`がUnicodeを表示できる端末を参照している場合、ネイティブのUnicode APIを使用して端末に書き出す + - `out`に無効なコードユニットが含まれる場合、その動作は未定義であり,実装者はそれを診断することが推奨される。それ以外の場合は、変更せずにストリームに書き出す。そうでなければ、変更せず`stream`に`out`を書き出す。 + - ネイティブのUnicode APIを使用する場合、この関数は`out`を書き出す前にフラッシュする + - 関数終了時に、無条件にロックを手放す ## 例外 -- [`vformat()`](/reference/format/vformat.md)関数がなんらかの例外を送出する可能性がある +- (2) : + - C++23 : [`vformat()`](/reference/format/vformat.md)関数がなんらかの例外を送出する可能性がある - 端末かストリームへの書き込みに失敗した場合、[`system_error`](/reference/system_error/system_error.md)を送出する - [`bad_alloc`](/reference/new/bad_alloc.md)を送出する可能性がある @@ -81,3 +91,6 @@ namespace std { ## 参照 - [P2093R14 Formatted output](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2093r14.html) - [P2539R4 Should the output of `std::print` to a terminal be synchronized with the underlying stream?](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2539r4.html) +- [P3107R5 Permit an efficient implementation of `std::print`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3107r5.html) +- [P3235R3 `std::print` more types faster with less memory](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3235r3.html) + - C++26の上記2つの提案文書では、余分な動的メモリ確保をしないよう仕様が見直された diff --git a/reference/print/vprint_unicode_buffered.md b/reference/print/vprint_unicode_buffered.md new file mode 100644 index 0000000000..34fcb526ea --- /dev/null +++ b/reference/print/vprint_unicode_buffered.md @@ -0,0 +1,52 @@ +# vprint_unicode_buffered +* print[meta header] +* std[meta namespace] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + void vprint_unicode_buffered( + FILE* stream, + string_view fmt, + format_args args); // (1) C++26 +} +``` +* FILE[link /reference/cstdio/file.md.nolink] +* format_args[link /reference/format/basic_format_args.md] + +## 概要 +確保した文字列バッファに書式指定の出力を作ってからUnicode出力する。 + + +## 効果 +- (1) : 以下と等価: + ```cpp + string out = vformat(fmt, args); + vprint_unicode("{}", make_format_args(out)); + ``` + * string[link /reference/string/basic_string.md] + * vformat[link /reference/format/vformat.md] + * vprint_unicode[link vprint_unicode.md] + * make_format_args[link /reference/format/make_format_args.md] + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 18 [mark noimpl] +- [GCC](/implementation.md#gcc): 14 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark noimpl] + + +## 関連項目 +- [`std::print()`](print.md) +- [`std::println()`](println.md) +- [`std::vprint_unicode()`](vprint_unicode.md) + + +## 参照 +- [P3107R5 Permit an efficient implementation of `std::print`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3107r5.html) +- [P3235R3 `std::print` more types faster with less memory](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3235r3.html) From f4ce5e5f68c35d4af749b86a338b54c572fb5826 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 11 Sep 2024 16:06:58 +0900 Subject: [PATCH 1191/3948] =?UTF-8?q?C++26=20:=20enable=5Fnonlocking=5Ffor?= =?UTF-8?q?matter=5Foptimization=E3=81=B8=E3=81=AE=E3=83=AA=E3=83=B3?= =?UTF-8?q?=E3=82=AF=E3=81=A8=E6=9B=B8=E3=81=8F=E5=A0=B4=E6=89=80=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #1314 #1334 --- lang/cpp26.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp26.md b/lang/cpp26.md index d16be2c15b..06728451ee 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -176,7 +176,6 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - ポインタ出力のサポートを追加 - 幅と精度を動的に指定した場合でも型の検証がコンパイル時に行われるよう仕様を見直し - コンパイル時の書式文字列だけでなく、実行時の書式文字列を渡せるよう仕様修正 -- 文字列フォーマットをより高速にできる最適化が可能か判定する[`std::enable_nonlocking_formatter_optimization`](/reference/format/enable_nonlocking_formatter_optimization.md.nolink)を追加 - [`std::basic_string`](/reference/string/basic_string.md)と[`std::basic_string_view`](/reference/string_view/basic_string_view.md)を[`std::basic_string`](/reference/string/basic_string.md)として連結させる`operator+`を追加 @@ -190,6 +189,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 ### 入出力 - [`std::print()`](/reference/print/print.md)と[`std::println()`](/reference/print/println.md)に、ロックを取得せず高速に書き出す最適化を許可 - [`std::println()`](/reference/print/println.md)に、改行のみを出力するオーバーロードを追加 +- [`std::print()`](/reference/print/print.md)と[`std::println()`](/reference/print/println.md)をより高速にできる最適化が可能か判定する[`std::enable_nonlocking_formatter_optimization`](/reference/format/enable_nonlocking_formatter_optimization.md)を追加 ### 並行・並列処理 From 177ce6f6ea7977764ac89cf42750cea77e4237b9 Mon Sep 17 00:00:00 2001 From: suomesta Date: Thu, 12 Sep 2024 00:05:56 +0900 Subject: [PATCH 1192/3948] update feature test macros of C++23 --- lang/cpp23/feature_test_macros.md | 79 +++++++++++++++++++++++++++++-- 1 file changed, 76 insertions(+), 3 deletions(-) diff --git a/lang/cpp23/feature_test_macros.md b/lang/cpp23/feature_test_macros.md index ced7f4e36f..21f18dbc39 100644 --- a/lang/cpp23/feature_test_macros.md +++ b/lang/cpp23/feature_test_macros.md @@ -15,7 +15,17 @@ | マクロ名 | 値 | 機能 | |----------|----|------| -|||| +|`__cpp_auto_cast`|`202110L`|`auto(x)`および`auto{x}`によるキャスト| +|`__cpp_constexpr`|`202211L`|[constexpr関数内でのstatic constexpr変数を許可](permitting_static_constexpr_variables_in_constexpr_functions.md)| +|`__cpp_explicit_this_parameter`|`202110L`|自身のオブジェクトを明示的にパラメータとして指定する| +|`__cpp_if_consteval`|`202106L`|[if consteval](if_consteval.md)| +|`__cpp_implicit_move`|`202207L`|[暗黙的なムーブを簡略化](simpler_implicit_move.md)| +|`__cpp_multidimensional_subscript`|`202211L`|[添字演算子の多次元サポート](multidimensional_subscript_operator.md)| +|`__cpp_named_character_escapes`|`202207L`|[名前付きユニバーサルキャラクタ名](named_universal_character_escapes.md)| +|`__cpp_range_based_for`|`202211L`|[範囲for文が範囲初期化子内で生じた一時オブジェクトを延命することを規定](lifetime_extension_in_range_based_for_loop.md)| +|`__cpp_size_t_suffix`|`202011L`|[(符号付き)size_tリテラルのためのサフィックス](literal_suffix_for_signed_size_t.md)| +|`__cpp_static_call_operator`|`202207L`|[thisポインタをもつ必要のない演算子をstaticとして宣言できるようにする](static_operator.md)| + ### ライブラリ @@ -23,8 +33,71 @@ | マクロ名 | 値 | 機能 | ヘッダ | |----------|----|------|--------| -|`__cpp_lib_ranges_as_const`|`202207L`|`ranges::cbegin`が常に定数イテレータを返すようにする|[``](/reference/ranges.md)| -|`__cpp_lib_ranges_fold`|`202207L`|`fold`アルゴリズム|[``](/reference/algorithm.md)| +|`__cpp_lib_adaptor_iterator_pair_constructor`|`202106L`|[`std::queue`](/reference/queue.md)と[`std::stack`](/reference/stack.md)にイテレータ2つのコンストラクタを追加|[``](/reference/queue.md)
[``](/reference/stack.md)| +|`__cpp_lib_algorithm_iterator_requirements`|`202207L`|[``](/reference/algorithm.md)のRangeイテレータ対応|[``](/reference/algorithm.md)
[``](/reference/memory.md)
[``](/reference/numeric.md)| +|`__cpp_lib_allocate_at_least`|`202302L`|[`std::allocator::allocate_at_least()`](/reference/memory/allocator/allocate_at_least.md)の追加|[``](/reference/memory.md)| +|`__cpp_lib_associative_heterogeneous_erasure`|`202110L`|テンプレート型を受ける`erase()`の追加|[``](/reference/map.md)
[``](/reference/set.md)
[``](/reference/unordered_map.md)
[``](/reference/unordered_set.md)| +|`__cpp_lib_barrier`|`202302L`|バリアフェーズの完了ステップの仕様変更|[``](/reference/barrier.md)| +|`__cpp_lib_bind_back`|`202202L`|[`std::bind_back()`](/reference/functional/bind_back.md)の追加|[``](/reference/functional.md)| +|`__cpp_lib_byteswap`|`202110L`|[`std::byteswap()`](/reference/bit/byteswap.md)の追加|[``](/reference/bit.md)| +|`__cpp_lib_common_reference`|`202302L`|`T&`と`reference_wrapper`の`common_reference`を`T&`に変換|[``](/reference/type_traits.md)| +|`__cpp_lib_common_reference_wrapper`|`202302L`|`T&`と`reference_wrapper`の`common_reference`を`T&`に変換|[``](/reference/functional.md)| +|`__cpp_lib_concepts`|`202207L`|[`std::equality_comparable_with`](/reference/concepts/equality_comparable.md)などをムーブのみ可能な型に対応|[``](/reference/compare.md)
[``](/reference/concepts.md)| +|`__cpp_lib_constexpr_bitset`|`202207L`|[`std::bitset`](/reference/bitset/bitset.md)の`constexpr`対応|[``](/reference/bitset.md)| +|`__cpp_lib_constexpr_charconv`|`202207L`|[`std::to_chars()`](/reference/charconv/to_chars.md)と[`std::from_chars()`](/reference/charconv/from_chars.md)の`constexpr`対応|[``](/reference/charconv.md)| +|`__cpp_lib_constexpr_cmath`|`202202L`|いくつかの関数を`constexpr`対応|[``](/reference/cmath.md)
[``](/reference/cstdlib.md)| +|`__cpp_lib_constexpr_memory`|`202202L`|[`std::unique_ptr`](/reference/memory/unique_ptr.md)の`constexpr`対応|[``](/reference/memory.md)| +|`__cpp_lib_constexpr_typeinfo`|`202106L`|[`std::type_info::operator==()`](/reference/typeinfo/type_info/op_equal.md)の`constexpr`対応|[``](/reference/typeinfo.md)| +|`__cpp_lib_containers_ranges`|`202202L`|コンテナのコンストラクタのRange対応|[``](/reference/vector.md)
[``](/reference/list.md)
[``](/reference/forward_list.md)
[``](/reference/map.md)
[``](/reference/set.md)
[``](/reference/unordered_map.md)
[``](/reference/unordered_set.md)
[``](/reference/deque.md)
[``](/reference/queue.md)
[``](/reference/stack.md)
[``](/reference/string.md)| +|`__cpp_lib_expected`|`202211L`|[``](/reference/expected.md)の追加|[``](/reference/expected.md)| +|`__cpp_lib_flat_map`|`202207L`|[`std::flat_map`](/reference/flat_map.md)と`std::flat_multimap`の追加|[``](/reference/flat_map.md)| +|`__cpp_lib_flat_set`|`202207L`|`std::flat_set`と`std::flat_multiset`の追加|``| +|`__cpp_lib_format`|`202207L`|`std::format`の時刻型のローカライズ対応|[``](/reference/format.md)| +|`__cpp_lib_format_ranges`|`202207L`|`std::formatter`のRange対応|[``](/reference/format.md)| +|`__cpp_lib_formatters`|`202302L`|`std::formatter`の`std::stacktrace`対応と`std::thread::id`対応|[``](/reference/stacktrace.md)
[``](/reference/thread.md)| +|`__cpp_lib_forward_like`|`202207L`|[`std::forward_like()`](/reference/utility/forward_like.md)の追加|[``](/reference/utility.md)| +|`__cpp_lib_generator`|`202207L`|[`std::generator`](/reference/generator/generator.md)の追加|[``](/reference/generator.md)| +|`__cpp_lib_invoke_r`|`202106L`|[`std::invoke_r()`](/reference/functional/invoke_r.md)の追加|[``](/reference/functional.md)| +|`__cpp_lib_ios_noreplace`|`202207L`|[`std::ios::noreplace`](/reference/ios/ios_base/type-openmode.md)の追加|[``](/reference/ios.md)| +|`__cpp_lib_is_implicit_lifetime`|`202302L`|`std::is_implicit_lifetime`の追加|[``](/reference/type_traits.md)| +|`__cpp_lib_is_scoped_enum`|`202011L`|[`std::is_scoped_enum`](/reference/type_traits/is_scoped_enum.md)の追加|[``](/reference/type_traits.md)| +|`__cpp_lib_mdspan`|`202207L`|[``](/reference/mdspan.md)の追加|[``](/reference/mdspan.md)| +|`__cpp_lib_modules`|`202207L`|モジュール[``](/module/std.md)と[``](/module/std.compat.md)の追加|| +|`__cpp_lib_move_iterator_concept`|`202207L`|[`std::move_iterator`](/reference/iterator/move_iterator.md)をランダムアクセスイテレータにする|[``](/reference/iterator.md)| +|`__cpp_lib_move_only_function`|`202110L`|[`std::move_only_function`](/reference/functional/move_only_function.md)の追加|[``](/reference/functional.md)| +|`__cpp_lib_optional`|`202110L`|[`std::optional`](/reference/optional/optional.md)にモナド操作を追加|[``](/reference/optional.md)| +|`__cpp_lib_out_ptr`|`202106L`|[`std::out_ptr`](/reference/memory/out_ptr.md)と[`std::inout_ptr`](/reference/memory/inout_ptr.md)の追加|[``](/reference/memory.md)| +|`__cpp_lib_ranges`|`202302L`|[`std::ranges::range_adaptor_closure`](/reference/ranges/range_adaptor_closure.md)の追加
[``](/reference/ranges.md)の様々な機能追加|[``](/reference/algorithm.md)
[``](/reference/functional.md)
[``](/reference/iterator.md)
[``](/reference/memory.md)
[``](/reference/ranges.md)| +|`__cpp_lib_ranges_as_const`|`202207L`|`std::ranges::cbegin`が常に定数イテレータを返すようにする。[`std::ranges::as_const_view`](/reference/ranges/as_const_view.md)の追加|[``](/reference/ranges.md)| +|`__cpp_lib_ranges_as_rvalue`|`202207L`|[`std::ranges::as_rvalue_view`](/reference/ranges/as_rvalue_view.md)の追加|[``](/reference/ranges.md)| +|`__cpp_lib_ranges_cartesian_product`|`202207L`|[`std::ranges::cartesian_product_view`](/reference/ranges/cartesian_product_view.md)の追加|[``](/reference/ranges.md)| +|`__cpp_lib_ranges_chunk`|`202202L`|[`std::ranges::chunk_view`](/reference/ranges/chunk_view.md)の追加|[``](/reference/ranges.md)| +|`__cpp_lib_ranges_chunk_by`|`202202L`|[`std::ranges::chunk_by_view`](/reference/ranges/chunk_by_view.md)の追加|[``](/reference/ranges.md)| +|`__cpp_lib_ranges_contains`|`202207L`|[`std::ranges::contains()`](/reference/algorithm/ranges_contains.md)の追加|[``](/reference/algorithm.md)| +|`__cpp_lib_ranges_enumerate`|`202302L`|[`std::ranges::enumerate_view`](/reference/ranges/enumerate_view.md)の追加|[``](/reference/ranges.md)| +|`__cpp_lib_ranges_find_last`|`202207L`|[`std::ranges::find_last()`](/reference/algorithm/ranges_find_last.md)と[`std::ranges::find_last_if()`](/reference/algorithm/ranges_find_last_if.md)と[`std::ranges::find_last_if_not()`](/reference/algorithm/ranges_find_last_if_not.md)の追加|[``](/reference/algorithm.md)| +|`__cpp_lib_ranges_fold`|`202207L`|`std::ranges::`に`fold`アルゴリズムの追加|[``](/reference/algorithm.md)| +|`__cpp_lib_ranges_iota`|`202202L`|[`std::ranges::iota()`](/reference/numeric/ranges_iota.md)の追加|[``](/reference/numeric.md)| +|`__cpp_lib_ranges_join_with`|`202202L`|[`std::ranges::join_with_view`](/reference/ranges/join_with_view.md)の追加|[``](/reference/ranges.md)| +|`__cpp_lib_ranges_repeat`|`202207L`|[`std::ranges::repeat_view`](/reference/ranges/repeat_view.md)の追加|[``](/reference/ranges.md)| +|`__cpp_lib_ranges_slide`|`202202L`|[`std::ranges::slide_view`](/reference/ranges/slide_view.md)の追加|[``](/reference/ranges.md)| +|`__cpp_lib_ranges_starts_ends_with`|`202106L`|[`std::ranges::starts_with()`](/reference/algorithm/ranges_starts_with.md)と[`std::ranges::ends_with()`](/reference/algorithm/ranges_ends_with.md)の追加|[``](/reference/algorithm.md)| +|`__cpp_lib_ranges_stride`|`202207L`|[`std::ranges::stride_view`](/reference/ranges/stride_view.md)の追加|[``](/reference/ranges.md)| +|`__cpp_lib_ranges_to_container`|`202202L`|[`std::ranges::to`](/reference/ranges/to.md)の追加|[``](/reference/ranges.md)| +|`__cpp_lib_ranges_zip`|`202110L`|[`std::ranges::zip_view`](/reference/ranges/zip_view.md)と[`std::ranges::zip_transform_view`](/reference/ranges/zip_transform_view.md)と[`std::ranges::adjacent_view`](/reference/ranges/adjacent_view.md)と[`std::ranges::adjacent_transform_view`](/reference/ranges/adjacent_transform_view.md)の追加|[``](/reference/ranges.md)
[``](/reference/tuple.md)
[``](/reference/utility.md)| +|`__cpp_lib_reference_from_temporary`|`202202L`|[`std::reference_constructs_from_temporary`](/reference/type_traits/reference_constructs_from_temporary.md)と[`std::reference_converts_from_temporary`](/reference/type_traits/reference_converts_from_temporary.md)の追加|[``](/reference/type_traits.md)| +|`__cpp_lib_shift`|`202202L`|[`std::ranges::shift_left()`](/reference/algorithm/ranges_shift_left.md)と[`std::ranges::shift_right()`](/reference/algorithm/ranges_shift_right.md)の追加|[``](/reference/algorithm.md)| +|`__cpp_lib_spanstream`|`202106L`|``の追加|``| +|`__cpp_lib_stacktrace`|`202011L`|[``](/reference/stacktrace.md)の追加|[``](/reference/stacktrace.md)| +|`__cpp_lib_start_lifetime_as`|`202207L`|`std::start_lifetime_as()`の追加|[``](/reference/memory.md)| +|`__cpp_lib_stdatomic_h`|`202011L`|[``](/reference/stdatomic.h.md)の追加|``| +|`__cpp_lib_string_contains`|`202011L`|[`std::basic_string::contains()`](/reference/string/basic_string/contains.md)と[`std::basic_string_view::contains()`](/reference/string_view/basic_string_view/contains.md)の追加|[``](/reference/string.md)
[``](/reference/string_view.md)| +|`__cpp_lib_string_resize_and_overwrite`|`202110L`|[`std::basic_string::resize_and_overwrite()`](/reference/string/basic_string/resize_and_overwrite.md)の追加|[``](/reference/string.md)| +|`__cpp_lib_to_underlying`|`202102L`|[`std::to_underlying()`](/reference/utility/to_underlying.md)の追加|[``](/reference/utility.md)| +|`__cpp_lib_tuple_like`|`202207L`|[`tuple-like`](/reference/tuple/tuple-like.md)コンセプトの追加|[``](/reference/map.md)
[``](/reference/tuple.md)
[``](/reference/unordered_map.md)
[``](/reference/utility.md)| +|`__cpp_lib_unreachable`|`202202L`|[`std::unreachable()`](/reference/utility/unreachable.md)の追加|[``](/reference/utility.md)| +|`__cpp_lib_print`|`202403L`|[``](/reference/print.md)の追加|[``](/reference/ostream.md)
[``](/reference/print.md)| + ## 参照 From ba0267cbe05d474275d51744296658846d4c161c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 12 Sep 2024 12:40:36 +0900 Subject: [PATCH 1193/3948] =?UTF-8?q?C++26=20:=20=E3=80=8C=E6=A7=8B?= =?UTF-8?q?=E9=80=A0=E5=8C=96=E6=9D=9F=E7=B8=9B=E3=81=B8=E3=81=AE=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E3=82=92=E8=A8=B1=E5=8F=AF=E3=80=8D=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=20(close=20#1324)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp11/attributes.md | 3 +- lang/cpp17/structured_bindings.md | 3 +- lang/cpp26.md | 2 +- .../attributes_for_structured_bindings.md | 29 +++++++++++++++++++ 5 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 lang/cpp26/attributes_for_structured_bindings.md diff --git a/implementation-status.md b/implementation-status.md index ca4ca3021f..8d3bb8a314 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -302,7 +302,7 @@ | P2864R2: [非推奨となっていた列挙値から算術型への暗黙変換を削除](/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md.nolink) | C++20から非推奨となっていた列挙値への算術演算で算術型に暗黙変換される仕様を削除 | 14 | 18 | | | | P2748R5: [返却された左辺値から暗黙変換された一時オブジェクトが参照に束縛されることを禁止する](/lang/cpp26/disallow_binding_a_returned_glvalue_to_a_temporary.md.nolink) | 寿命切れの変数によって引き起こされるバグを防止する | 14 | 19 | | | | P3106R1: [要素数不明の配列を集成体初期化する規則を明確化](/lang/cpp26/clarifying_rules_for_brace_elision_in_aggregate_initialization.md.nolink) | 配列要素の集成体初期化で`{}`が省略された場合の矛盾していた規定を修正 | yes | 17 | | | -| P0609R3: [構造化束縛への属性を許可](/lang/cpp26/attributes_for_structured_bindings.md.nolink) | `auto [a, [[maybe_unused]] b, c] = f();`のように構造化束縛の要素に対して属性を付加できるようにする | 15 | 19 | | | +| P0609R3: [構造化束縛への属性を許可](/lang/cpp26/attributes_for_structured_bindings.md) | `auto [a, b [[maybe_unused]], c] = f();`のように構造化束縛の要素に対して属性を付加できるようにする | 15 | 19 | | | | P3034R1: [モジュール宣言でのモジュール名のマクロ展開を禁止する](/lang/cpp26/module_declarations_shouldnt_be_macros.md.nolink) | `export module MACRO_NAME;`を禁止 | | | | | | P2809R3: [自明な無限ループは未定義動作ではないと規定](/lang/cpp26/trivial_infinite_loops_are_not_undefined_behavior.md.nolink) | 並行プログラムの進行保証などを考慮して無限ループを未定義動作ではないものとする | 14 | 19 | | | | P2795R5: [未初期化変数の読み取りを不正動作 (erroneous behaviour: EB) とする](/lang/cpp26/erroneous_behaviour_for_uninitialized_reads.md.nolink) | 初期化されていない自動変数の読み取りの安全性を規定する | | | | | diff --git a/lang/cpp11/attributes.md b/lang/cpp11/attributes.md index 0259f3a4aa..1a15b8ba07 100644 --- a/lang/cpp11/attributes.md +++ b/lang/cpp11/attributes.md @@ -169,6 +169,7 @@ C++11で採用されたもの以外で検討された以下の機能は、属性 - [C++20 `[[likely]]`, `[[unlikely]]`属性](/lang/cpp20/likely_and_unlikely_attributes.md) - [C++20 属性の名前空間を予約](/lang/cpp20/reserving_attribute_namespaces_for_future_use.md) - [C++23 ラムダ式に対する属性](/lang/cpp23/attributes_on_lambda_expressions.md) +- [C++26 構造化束縛への属性を許可](/lang/cpp26/attributes_for_structured_bindings.md) ## 参照 @@ -177,4 +178,4 @@ C++11で採用されたもの以外で検討された以下の機能は、属性 - [N2418 Towards support for attributes in C++ (Revision 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2418.pdf) - [N2643 C++ Data-Dependency Ordering: Function Annotation](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2643.html) - [N2761 Towards support for attributes in C++ (Revision 6) ](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2761.pdf) -- [(抄訳)N4215 `memory_order_consume`の利用と実装に向けて[§5-6のみ]](http://d.hatena.ne.jp/yohhoy/20141115/p1) \ No newline at end of file +- [(抄訳)N4215 `memory_order_consume`の利用と実装に向けて[§5-6のみ]](http://d.hatena.ne.jp/yohhoy/20141115/p1) diff --git a/lang/cpp17/structured_bindings.md b/lang/cpp17/structured_bindings.md index ce661c6932..0a5ea85df8 100644 --- a/lang/cpp17/structured_bindings.md +++ b/lang/cpp17/structured_bindings.md @@ -339,6 +339,7 @@ auto { w, {x, y}, z } = f(); // このような、tuple内にあるpairを同時 - [C++20 構造化束縛がカスタマイゼーションポイントを見つけるルールを緩和](/lang/cpp20/relaxing_the_structured_bindings_customization_point_finding_rules.md) - [C++20 構造化束縛を拡張して通常の変数宣言のように使用できるようにする](/lang/cpp20/extending_structured_bindings_to_be_more_like_variable_declarations.md) - [C++20 構造化束縛した変数の参照キャプチャを許可](/lang/cpp20/reference_capture_of_structured_bindings.md) +- [C++26 構造化束縛への属性を許可](/lang/cpp26/attributes_for_structured_bindings.md) ## 参照 @@ -349,4 +350,4 @@ auto { w, {x, y}, z } = f(); // このような、tuple内にあるpairを同時 - [P0217R2 Proposed wording for structured bindings](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0217r2.html) - [P0217R3 Proposed wording for structured bindings](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0217r3.html) - [P0615R0 Renaming for structured bindings](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0615r0.html) -- [LWG DR2770 `tuple_size` specialization breaks decomposition declarations](http://wg21.cmeerw.net/lwg/issue2770) \ No newline at end of file +- [LWG DR2770 `tuple_size` specialization breaks decomposition declarations](http://wg21.cmeerw.net/lwg/issue2770) diff --git a/lang/cpp26.md b/lang/cpp26.md index 06728451ee..9f87ae891e 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -49,7 +49,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| | [属性の無視性を見直し](/lang/cpp26/on_the_ignorability_of_standard_attributes.md.nolink) | 構文として適格な属性のみを無視できるようにし、そうでない属性の使用を不適格とする | -| [構造化束縛への属性を許可](/lang/cpp26/attributes_for_structured_bindings.md.nolink) | `auto [a, [[maybe_unused]] b, c] = f();`のように構造化束縛の要素に対して属性を付加できるようにする | +| [構造化束縛への属性を許可](/lang/cpp26/attributes_for_structured_bindings.md) | `auto [a, b [[maybe_unused]], c] = f();`のように構造化束縛の要素に対して属性を付加できるようにする | ### テンプレート diff --git a/lang/cpp26/attributes_for_structured_bindings.md b/lang/cpp26/attributes_for_structured_bindings.md new file mode 100644 index 0000000000..6cd26e0951 --- /dev/null +++ b/lang/cpp26/attributes_for_structured_bindings.md @@ -0,0 +1,29 @@ +# 構造化束縛への属性を許可 [P0609R3] +* cpp26[meta cpp] + + + +このページはC++26に採用される見込みの言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 + + + +## 概要 +C++26では、構造化束縛の各要素に対して属性を指定できるようになる。 + +```cpp +// 構造化束縛した変数bは使わない +auto [a, b [[maybe_unused]], c] = f(); +``` + +構文としては、構造化束縛の要素となる変数名の後ろに属性を指定する。 + + +## 関連項目 +- [C++11 属性構文](/lang/cpp11/attributes.md) +- [C++17 構造化束縛](/lang/cpp17/structured_bindings.md) + + +## 参照 +- [P0609R3 Attributes for Structured Bindings](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0609r3.pdf) From e9fb3fd6095fdf9fcdccd133aa564d07d530138e Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 12 Sep 2024 13:12:48 +0900 Subject: [PATCH 1194/3948] =?UTF-8?q?C++26=20:=20=E3=80=8C=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=E5=BC=8F=E3=81=A7=E3=81=AE=E6=A7=8B=E9=80=A0=E5=8C=96?= =?UTF-8?q?=E6=9D=9F=E7=B8=9B=E3=81=AE=E4=BD=BF=E7=94=A8=E3=82=92=E8=A8=B1?= =?UTF-8?q?=E5=8F=AF=E3=80=8D=E3=82=92=E8=BF=BD=E5=8A=A0=20(close=20#1308)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- .../selection_statements_with_initializer.md | 1 + lang/cpp17/structured_bindings.md | 1 + lang/cpp26.md | 2 +- ...ured_binding_declaration_as_a_condition.md | 68 +++++++++++++++++++ reference/charconv/to_chars.md | 46 +++++++------ 6 files changed, 96 insertions(+), 24 deletions(-) create mode 100644 lang/cpp26/structured_binding_declaration_as_a_condition.md diff --git a/implementation-status.md b/implementation-status.md index 8d3bb8a314..6f7b3abca1 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -311,7 +311,7 @@ | P2747R2: [`constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md.nolink) | 定数式の文脈での配置`new`を許可 | | | | | | P3144R2: [不完全型へのポインタに対する`delete`を不適格とする](/lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md.nolink) | 未定義動作となる操作をコンパイルエラーとする | 15 | 19 | | | | P2963R3: [制約式内での畳み込み式の順序付け](/lang/cpp26/ordering_of_constraints_involving_fold_expressions.md.nolink) | 畳み込み式では全体ではなく個別の制約を原子制約式として扱う | | 19 | | | -| P0963R3: [条件式での構造化束縛の使用を許可](/lang/cpp26/structured_binding_declaration_as_a_condition.md.nolink) | 式全体を`bool`値に変換できる場合に条件式で構造化束縛を使用できることとする | 15 | | | | +| P0963R3: [条件式での構造化束縛の使用を許可](/lang/cpp26/structured_binding_declaration_as_a_condition.md) | 式全体を`bool`値に変換できる場合に条件式で構造化束縛を使用できることとする | 15 | | | | 各処理系のC++26実装状況ページ: diff --git a/lang/cpp17/selection_statements_with_initializer.md b/lang/cpp17/selection_statements_with_initializer.md index 9b3b3028c3..5e6a59a6e2 100644 --- a/lang/cpp17/selection_statements_with_initializer.md +++ b/lang/cpp17/selection_statements_with_initializer.md @@ -214,6 +214,7 @@ if (it != m.end()) { return it->size(); } ## 関連項目 - [C++20 初期化式をともなう範囲for文](/lang/cpp20/range-based_for_statements_with_initializer.md) - [C++23 初期化文での型の別名宣言を許可](/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md) +- [C++26 条件式での構造化束縛の使用を許可](/lang/cpp26/structured_binding_declaration_as_a_condition.md) ## 参照 diff --git a/lang/cpp17/structured_bindings.md b/lang/cpp17/structured_bindings.md index 0a5ea85df8..947a835478 100644 --- a/lang/cpp17/structured_bindings.md +++ b/lang/cpp17/structured_bindings.md @@ -340,6 +340,7 @@ auto { w, {x, y}, z } = f(); // このような、tuple内にあるpairを同時 - [C++20 構造化束縛を拡張して通常の変数宣言のように使用できるようにする](/lang/cpp20/extending_structured_bindings_to_be_more_like_variable_declarations.md) - [C++20 構造化束縛した変数の参照キャプチャを許可](/lang/cpp20/reference_capture_of_structured_bindings.md) - [C++26 構造化束縛への属性を許可](/lang/cpp26/attributes_for_structured_bindings.md) +- [C++26 条件式での構造化束縛の使用を許可](/lang/cpp26/structured_binding_declaration_as_a_condition.md) ## 参照 diff --git a/lang/cpp26.md b/lang/cpp26.md index 9f87ae891e..78b43c64de 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -32,7 +32,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| -| [条件式での構造化束縛の使用を許可](/lang/cpp26/structured_binding_declaration_as_a_condition.md.nolink) | 式全体を`bool`値に変換できる場合に条件式で構造化束縛を使用できることとする | +| [条件式での構造化束縛の使用を許可](/lang/cpp26/structured_binding_declaration_as_a_condition.md) | 式全体を`bool`値に変換できる場合に条件式で構造化束縛を使用できることとする | | [自明な無限ループは未定義動作ではないと規定](/lang/cpp26/trivial_infinite_loops_are_not_undefined_behavior.md.nolink) | 並行プログラムの進行保証などを考慮して無限ループを未定義動作ではないものとする | diff --git a/lang/cpp26/structured_binding_declaration_as_a_condition.md b/lang/cpp26/structured_binding_declaration_as_a_condition.md new file mode 100644 index 0000000000..38ccc97cf6 --- /dev/null +++ b/lang/cpp26/structured_binding_declaration_as_a_condition.md @@ -0,0 +1,68 @@ +# 条件式での構造化束縛の使用を許可 [P0963R3] +* cpp26[meta cpp] + + + +このページはC++26に採用される見込みの言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 + + + +## 概要 +C++26では、`if`文、`while`文、`for`文、`switch`文の条件式において構造化束縛を使用できるようになる。 + +C++23までは、条件分岐文の初期化式で構造化束縛は使用できたが、その場合に条件式を別途指定する必要があった。C++26では構造化束縛した全体が`bool`型に変換可能であれば、条件式として構造化束縛を使用できるようになった。 + +``` +// C++23 +if (auto [to, ec] = std::to_chars(p, last, 42); ec == std::errc{}) { + auto s = std::string(p, to); + … +} + +// C++26 +// std::to_charsの戻り値型であるstd::to_chars_resultは、 +// boolへの変換演算子をもつ +if (auto [to, ec] = std::to_chars(p, last, 42)) { + auto s = std::string(p, to); + … +} +``` +* std::to_chars[link /reference/charconv/to_chars.md] +* std::to_chars_result[link /reference/charconv/to_chars_result.md] +* std::errc[link /reference/system_error/errc.md] +* std::to_string[link /reference/string/to_string.md] + +なお、条件分岐文での初期化式と、全体を`bool`変換する条件式は別で指定できる。 + +```cpp +#include +#include +#include + +int f() { return 123; } + +int main() +{ + char out[50]{}; + auto begin = std::begin(out); + auto end = std::end(out); + + if (int value = f(); auto [ptr, ec] = std::to_chars(begin, end, value)) { + std::println("{}", std::string_view(begin, ptr - begin)); + } + else { + std::println("conversion failed."); + } +} +``` +* std::to_chars[link /reference/charconv/to_chars.md] + +## 関連項目 +- [C++17 構造化束縛](/lang/cpp17/structured_bindings.md) +- [C++17 `if`文と`switch`文の条件式と初期化を分離](/lang/cpp17/selection_statements_with_initializer.md) + + +## 参照 +- [P0963R3 Structured binding declaration as a condition](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0963r3.html) diff --git a/reference/charconv/to_chars.md b/reference/charconv/to_chars.md index 9cccf2cbdc..a337df453c 100644 --- a/reference/charconv/to_chars.md +++ b/reference/charconv/to_chars.md @@ -213,7 +213,7 @@ int main() std::cout << "conversion failed." << std::endl; } - //リウヴィル数 + //リウヴィル数 constexpr double l = 0.11000100000000000000000100000000000; //(3) 精度・フォーマット指定なしの浮動小数点数変換 @@ -299,77 +299,77 @@ int main() auto end = std::end(out); //(1) 10進数文字列へ変換 - if (auto result = std::to_chars(begin, end, 10)) { - std::cout << std::string_view(begin, result.ptr - begin) << std::endl; + if (auto [ptr, ec] = std::to_chars(begin, end, 10)) { + std::cout << std::string_view(begin, ptr - begin) << std::endl; } else { std::cout << "conversion failed." << std::endl; } //(1) 2進数文字列へ変換 - if (auto result = std::to_chars(begin, end, 65535, 2)) { - std::cout << std::string_view(begin, result.ptr - begin) << std::endl; + if (auto [ptr, ec] = std::to_chars(begin, end, 65535, 2)) { + std::cout << std::string_view(begin, ptr - begin) << std::endl; } else { std::cout << "conversion failed." << std::endl; } //(1) 36進数文字列へ変換 - if (auto result = std::to_chars(begin, end, 35, 36)) { - std::cout << std::string_view(begin, result.ptr - begin) << std::endl; + if (auto [ptr, ec] = std::to_chars(begin, end, 35, 36)) { + std::cout << std::string_view(begin, ptr - begin) << std::endl; } else { std::cout << "conversion failed." << std::endl; } - //リウヴィル数 + //リウヴィル数 constexpr double l = 0.11000100000000000000000100000000000; //(3) 精度・フォーマット指定なしの浮動小数点数変換 - if (auto result = std::to_chars(begin, end, l)) { - std::cout << std::string_view(begin, result.ptr - begin) << std::endl; + if (auto [ptr, ec] = std::to_chars(begin, end, l)) { + std::cout << std::string_view(begin, ptr - begin) << std::endl; } else { std::cout << "conversion failed." << std::endl; } //(7) 精度指定なしの浮動小数点数変換、指数表記 - if (auto result = std::to_chars(begin, end, l, std::chars_format::scientific)) { - std::cout << std::string_view(begin, result.ptr - begin) << std::endl; + if (auto [ptr, ec] = std::to_chars(begin, end, l, std::chars_format::scientific)) { + std::cout << std::string_view(begin, ptr - begin) << std::endl; } else { std::cout << "conversion failed." << std::endl; } //(7) 精度指定なしの浮動小数点数変換、固定小数表記 - if (auto result = std::to_chars(begin, end, l, std::chars_format::fixed)) { - std::cout << std::string_view(begin, result.ptr - begin) << std::endl; + if (auto [ptr, ec] = std::to_chars(begin, end, l, std::chars_format::fixed)) { + std::cout << std::string_view(begin, ptr - begin) << std::endl; } else { std::cout << "conversion failed." << std::endl; } //(7) 精度指定なしの浮動小数点数変換、16進指数表記 - if (auto result = std::to_chars(begin, end, l, std::chars_format::hex)) { - std::cout << std::string_view(begin, result.ptr - begin) << std::endl; + if (auto [ptr, ec] = std::to_chars(begin, end, l, std::chars_format::hex)) { + std::cout << std::string_view(begin, ptr - begin) << std::endl; } else { std::cout << "conversion failed." << std::endl; } //(11) 精度指定ありの浮動小数点数変換、指数表記 - if (auto result = std::to_chars(begin, end, l, std::chars_format::scientific, 16)) { - std::cout << std::string_view(begin, result.ptr - begin) << std::endl; + if (auto [ptr, ec] = std::to_chars(begin, end, l, std::chars_format::scientific, 16)) { + std::cout << std::string_view(begin, ptr - begin) << std::endl; } else { std::cout << "conversion failed." << std::endl; } //(11) 精度指定ありの浮動小数点数変換、固定小数表記 - if (auto result = std::to_chars(begin, end, l, std::chars_format::fixed, 16)) { - std::cout << std::string_view(begin, result.ptr - begin) << std::endl; + if (auto [ptr, ec] = std::to_chars(begin, end, l, std::chars_format::fixed, 16)) { + std::cout << std::string_view(begin, ptr - begin) << std::endl; } else { std::cout << "conversion failed." << std::endl; } //(11) 精度指定ありの浮動小数点数変換、16進指数表記 - if (auto result = std::to_chars(begin, end, l, std::chars_format::hex, 16)) { - std::cout << std::string_view(begin, result.ptr - begin) << std::endl; + if (auto [ptr, ec] = std::to_chars(begin, end, l, std::chars_format::hex, 16)) { + std::cout << std::string_view(begin, ptr - begin) << std::endl; } else { std::cout << "conversion failed." << std::endl; @@ -404,6 +404,8 @@ z - [`chars_format`](../charconv/chars_format.md) - [`to_chars_result`](../charconv/to_chars_result.md) - [`from_chars`](../charconv/from_chars.md) +- [C++26 条件式での構造化束縛の使用を許可](/lang/cpp26/structured_binding_declaration_as_a_condition.md) + ## 参照 - [P0067R5: Elementary string conversions, revision 5](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0067r5.html) From fd2e8e6195e2743de72371757095abfebcaa4a2e Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 12 Sep 2024 13:14:47 +0900 Subject: [PATCH 1195/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=83=9F?= =?UTF-8?q?=E3=82=B9=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26/structured_binding_declaration_as_a_condition.md | 1 - 1 file changed, 1 deletion(-) diff --git a/lang/cpp26/structured_binding_declaration_as_a_condition.md b/lang/cpp26/structured_binding_declaration_as_a_condition.md index 38ccc97cf6..ca4b5730fd 100644 --- a/lang/cpp26/structured_binding_declaration_as_a_condition.md +++ b/lang/cpp26/structured_binding_declaration_as_a_condition.md @@ -32,7 +32,6 @@ if (auto [to, ec] = std::to_chars(p, last, 42)) { * std::to_chars[link /reference/charconv/to_chars.md] * std::to_chars_result[link /reference/charconv/to_chars_result.md] * std::errc[link /reference/system_error/errc.md] -* std::to_string[link /reference/string/to_string.md] なお、条件分岐文での初期化式と、全体を`bool`変換する条件式は別で指定できる。 From e2ee1dac0d39344e83186573bf570f263074ee09 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 12 Sep 2024 13:50:49 +0900 Subject: [PATCH 1196/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E3=83=96?= =?UTF-8?q?=E3=83=AD=E3=83=83=E3=82=AF=E3=81=AB=E8=A8=80=E8=AA=9E=E6=8C=87?= =?UTF-8?q?=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26/structured_binding_declaration_as_a_condition.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp26/structured_binding_declaration_as_a_condition.md b/lang/cpp26/structured_binding_declaration_as_a_condition.md index ca4b5730fd..a6792786bd 100644 --- a/lang/cpp26/structured_binding_declaration_as_a_condition.md +++ b/lang/cpp26/structured_binding_declaration_as_a_condition.md @@ -14,7 +14,7 @@ C++26では、`if`文、`while`文、`for`文、`switch`文の条件式におい C++23までは、条件分岐文の初期化式で構造化束縛は使用できたが、その場合に条件式を別途指定する必要があった。C++26では構造化束縛した全体が`bool`型に変換可能であれば、条件式として構造化束縛を使用できるようになった。 -``` +```cpp // C++23 if (auto [to, ec] = std::to_chars(p, last, 42); ec == std::errc{}) { auto s = std::string(p, to); From 24903b67b55fae8dd38852530a45abf4089128e1 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 13 Sep 2024 12:00:43 +0900 Subject: [PATCH 1197/3948] =?UTF-8?q?C++26=20:=20=E3=80=8C=E9=96=A2?= =?UTF-8?q?=E6=95=B0=E5=AE=A3=E8=A8=80=E3=82=92=E5=89=8A=E9=99=A4=E3=81=99?= =?UTF-8?q?=E3=82=8B=E7=90=86=E7=94=B1=E3=82=92=E6=8C=87=E5=AE=9A=E3=81=A7?= =?UTF-8?q?=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=80=8D=E3=82=92=E8=BF=BD=E5=8A=A0=20(close=20#1328)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp11/defaulted_and_deleted_functions.md | 6 ++- lang/cpp26.md | 2 +- lang/cpp26/delete_reason.md | 47 +++++++++++++++++++ 4 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 lang/cpp26/delete_reason.md diff --git a/implementation-status.md b/implementation-status.md index 6f7b3abca1..aa8f351fae 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -306,7 +306,7 @@ | P3034R1: [モジュール宣言でのモジュール名のマクロ展開を禁止する](/lang/cpp26/module_declarations_shouldnt_be_macros.md.nolink) | `export module MACRO_NAME;`を禁止 | | | | | | P2809R3: [自明な無限ループは未定義動作ではないと規定](/lang/cpp26/trivial_infinite_loops_are_not_undefined_behavior.md.nolink) | 並行プログラムの進行保証などを考慮して無限ループを未定義動作ではないものとする | 14 | 19 | | | | P2795R5: [未初期化変数の読み取りを不正動作 (erroneous behaviour: EB) とする](/lang/cpp26/erroneous_behaviour_for_uninitialized_reads.md.nolink) | 初期化されていない自動変数の読み取りの安全性を規定する | | | | | -| P2573R2: [関数宣言を削除する理由を指定できるようにする](/lang/cpp26/delete_reason.md.nolink) | `f() = delete("reason");` | 15 | 19 | | | +| P2573R2: [関数宣言を削除する理由を指定できるようにする](/lang/cpp26/delete_reason.md) | `f() = delete("reason");` | 15 | 19 | | | | P2893R3: [可変引数テンプレートで`friend`宣言をできるようにする](/lang/cpp26/variadic_friends.md.nolink) | クラステンプレートの可変引数テンプレートでまとめて`friend`宣言できるようにする | 15 | | | | | P2747R2: [`constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md.nolink) | 定数式の文脈での配置`new`を許可 | | | | | | P3144R2: [不完全型へのポインタに対する`delete`を不適格とする](/lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md.nolink) | 未定義動作となる操作をコンパイルエラーとする | 15 | 19 | | | diff --git a/lang/cpp11/defaulted_and_deleted_functions.md b/lang/cpp11/defaulted_and_deleted_functions.md index bb5bff003c..6253f9b9f2 100644 --- a/lang/cpp11/defaulted_and_deleted_functions.md +++ b/lang/cpp11/defaulted_and_deleted_functions.md @@ -124,6 +124,10 @@ int main() - 非静的メンバ変数の特殊メンバ関数が削除定義されている場合、その変数をメンバとして持つクラスのその特殊メンバ関数は、暗黙的に削除定義される +## 関連項目 +- [関数宣言を削除する理由を指定できるようにする](/lang/cpp26/delete_reason.md) + + ## 参照 - [N1582 Compiler Generated Defaults](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1582.pdf) - [N1702 explicit class and default definitions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1702.pdf) @@ -131,4 +135,4 @@ int main() - [N2210 Defaulted and Deleted Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2210.html) - [N2326 Defaulted and Deleted Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2326.html) - [N3172 To move or not to move](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3174.pdf) -- [N2346 Defaulted and Deleted Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm) \ No newline at end of file +- [N2346 Defaulted and Deleted Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm) diff --git a/lang/cpp26.md b/lang/cpp26.md index 78b43c64de..a352f35065 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -41,7 +41,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| -| [関数宣言を削除する理由を指定できるようにする](/lang/cpp26/delete_reason.md.nolink) | `f() = delete("reason");` | +| [関数宣言を削除する理由を指定できるようにする](/lang/cpp26/delete_reason.md) | `f() = delete("reason");` | ### 属性 diff --git a/lang/cpp26/delete_reason.md b/lang/cpp26/delete_reason.md new file mode 100644 index 0000000000..cb0e8389a8 --- /dev/null +++ b/lang/cpp26/delete_reason.md @@ -0,0 +1,47 @@ +# 関数宣言を削除する理由を指定できるようにする [P2573R2] +* cpp26[meta cpp] + + + +このページはC++26に採用される見込みの言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 + + + +## 概要 +C++26では、関数をdelte宣言する際に、その理由をコンパイル時文字列で指定できるようになる。 + +```cpp +// 別名の新たなAPIを用意する場合に、そちらに誘導する +void newapi(); +void oldapi() = delete("This old API is outdated and already been removed. Please use newapi() instead."); + +template +struct A {/* … */}; + +// 一部のオーバーロードが危険であるために禁止する場合 +template +A factory(const T&) {/* process lvalue */} +template +A factory(const T&&) = delete("Using rvalue to construct A may result in dangling reference"); + +// 一部の自動定義される特殊メンバ関数が +// 低パフォーマンスを引き起こすために禁止する場合 +struct MoveOnly { + // … (with move members defaulted or defined) + MoveOnly(const MoveOnly&) = delete("Copy-construction is expensive; please use move construction instead."); + MoveOnly& operator=(const MoveOnly&) = delete("Copy-assignment is expensive; please use move assignment instead."); +}; +``` + +これまでは削除理由を指定できなかったために、ユーザーが誤って削除済み関数にアクセスした際に「エラー!:削除された関数を呼び出そうとした」という情報しか得られなかった。削除理由が指定できるようになることで、その設計意図をユーザーに伝えられるようになる。 + + + +## 関連項目 +- [C++11 関数のdefault/delete宣言](/lang/cpp11/defaulted_and_deleted_functions.md) + + +## 参照 +- [P2573R2 `= delete("should have a reason");`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2573r2.html) From 2d8079718d12e243ff8e8d867da74170fb169149 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 13 Sep 2024 12:27:08 +0900 Subject: [PATCH 1198/3948] fix typo --- lang/cpp26/delete_reason.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp26/delete_reason.md b/lang/cpp26/delete_reason.md index cb0e8389a8..446cc28e1f 100644 --- a/lang/cpp26/delete_reason.md +++ b/lang/cpp26/delete_reason.md @@ -10,7 +10,7 @@ ## 概要 -C++26では、関数をdelte宣言する際に、その理由をコンパイル時文字列で指定できるようになる。 +C++26では、関数をdelete宣言する際に、その理由をコンパイル時文字列で指定できるようになる。 ```cpp // 別名の新たなAPIを用意する場合に、そちらに誘導する From 90c7ce3789863a8abf9aa9d2850448650cd22f86 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 13 Sep 2024 19:22:42 +0900 Subject: [PATCH 1199/3948] =?UTF-8?q?C++26=20:=20=E3=80=8C=E6=9C=AA?= =?UTF-8?q?=E5=88=9D=E6=9C=9F=E5=8C=96=E5=A4=89=E6=95=B0=E3=81=AE=E8=AA=AD?= =?UTF-8?q?=E3=81=BF=E5=8F=96=E3=82=8A=E3=82=92=E8=AA=A4=E3=82=8A=E8=B5=B7?= =?UTF-8?q?=E5=9B=A0=E5=8B=95=E4=BD=9C=E3=81=A8=E3=81=99=E3=82=8B=E3=80=8D?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_DEFINED_WORDS.json | 4 + implementation-status.md | 2 +- lang/cpp26.md | 2 +- ...oneous_behavior_for_uninitialized_reads.md | 121 ++++++++++++++++++ 4 files changed, 127 insertions(+), 2 deletions(-) create mode 100644 lang/cpp26/erroneous_behavior_for_uninitialized_reads.md diff --git a/GLOBAL_DEFINED_WORDS.json b/GLOBAL_DEFINED_WORDS.json index f9944b32cc..c87f83a9d2 100644 --- a/GLOBAL_DEFINED_WORDS.json +++ b/GLOBAL_DEFINED_WORDS.json @@ -23,6 +23,10 @@ }, "未規定動作": { "redirect": "未規定の動作", "yomi": "みきていどうさ" }, "未規定": { "redirect": "未規定の動作", "yomi": "みきてい" }, + "誤り起因動作": { + "yomi": "あやまりきいんどうさ", + "desc": "誤った操作に対する結果が明確に定義された動作。erroneous behavior (EB)。処理系によって診断や異常終了を実行することが許可されるが、処理が続行する場合もある" + }, "処理系定義の動作": { "link": "/implementation-compliance.md#dfn-implementation-defined-behavior", "yomi": "しょりけいていぎのどうさ", diff --git a/implementation-status.md b/implementation-status.md index aa8f351fae..d26f038dc0 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -305,7 +305,7 @@ | P0609R3: [構造化束縛への属性を許可](/lang/cpp26/attributes_for_structured_bindings.md) | `auto [a, b [[maybe_unused]], c] = f();`のように構造化束縛の要素に対して属性を付加できるようにする | 15 | 19 | | | | P3034R1: [モジュール宣言でのモジュール名のマクロ展開を禁止する](/lang/cpp26/module_declarations_shouldnt_be_macros.md.nolink) | `export module MACRO_NAME;`を禁止 | | | | | | P2809R3: [自明な無限ループは未定義動作ではないと規定](/lang/cpp26/trivial_infinite_loops_are_not_undefined_behavior.md.nolink) | 並行プログラムの進行保証などを考慮して無限ループを未定義動作ではないものとする | 14 | 19 | | | -| P2795R5: [未初期化変数の読み取りを不正動作 (erroneous behaviour: EB) とする](/lang/cpp26/erroneous_behaviour_for_uninitialized_reads.md.nolink) | 初期化されていない自動変数の読み取りの安全性を規定する | | | | | +| P2795R5: [未初期化変数の読み取りを誤り起因動作とする](/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md) | 初期化されていない自動変数の読み取りの安全性を規定する | | | | | | P2573R2: [関数宣言を削除する理由を指定できるようにする](/lang/cpp26/delete_reason.md) | `f() = delete("reason");` | 15 | 19 | | | | P2893R3: [可変引数テンプレートで`friend`宣言をできるようにする](/lang/cpp26/variadic_friends.md.nolink) | クラステンプレートの可変引数テンプレートでまとめて`friend`宣言できるようにする | 15 | | | | | P2747R2: [`constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md.nolink) | 定数式の文脈での配置`new`を許可 | | | | | diff --git a/lang/cpp26.md b/lang/cpp26.md index a352f35065..0171014cf1 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -17,7 +17,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | [不完全型へのポインタに対する`delete`を不適格とする](/lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md.nolink) | 未定義動作となる操作をコンパイルエラーとする | | [返却された左辺値から暗黙変換された一時オブジェクトが参照に束縛されることを禁止する](/lang/cpp26/disallow_binding_a_returned_glvalue_to_a_temporary.md.nolink) | 寿命切れの変数によって引き起こされるバグを防止する | | [要素数不明の配列を集成体初期化する規則を明確化](/lang/cpp26/clarifying_rules_for_brace_elision_in_aggregate_initialization.md.nolink) | 配列要素の集成体初期化で`{}`が省略された場合の矛盾していた規定を修正 | -| [未初期化変数の読み取りを不正動作 (erroneous behaviour: EB) とする](/lang/cpp26/erroneous_behaviour_for_uninitialized_reads.md.nolink) | 初期化されていない自動変数の読み取りの安全性を規定する | +| [未初期化変数の読み取りを誤り起因動作とする](/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md) | 初期化されていない自動変数の読み取りの安全性を規定する | ### 文字列 diff --git a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md new file mode 100644 index 0000000000..75c6935996 --- /dev/null +++ b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md @@ -0,0 +1,121 @@ +# 未初期化変数の読み取りを誤り起因動作とする [P2795R5] +* cpp26[meta cpp] + + + +このページはC++26に採用される見込みの言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 + + + +## 概要 +これまで、未初期化変数 (デフォルト初期化された変数) の読み取りは未定義動作として扱われていた。C++26では、この操作が安全上のリスクをもたらさないものとして、「誤り起因動作 (erroneous behavior; 通称 EB)」を新設してそれに割り当てることとした。 + +この変更の対象は、デフォルト初期化されたスカラ型 (`void`以外の組み込み型) 変数の読み取りであり、以下のようなケースである。 + +```cpp +// C++23 +void f(int); + +int main() { + int x; // デフォルト初期化。xは不定値 (indeterminate value) をもつ + f(x); // 左辺値から右辺値への変換が未定義動作を引き起こす +} +``` + +未初期化の値は、コンパイラやターゲット環境によって定義された固定値である。コンパイラにはこの誤りを診断することが許可され、推奨されているが、誤りを無視して有効な読み取りとして扱うことも許可されている。このコードは誤りではあるが、未定義動作に関連する結果に遭遇するリスクはない。 + +誤り起因動作は未定義動作とはちがって、明確に定義された動作をするがコードとして正しくない、ということを規定するものであり、処理系に対して有用な診断を提供するものである。 + +C++26では、不定値で初期化されることを明確に指示する`[[indeterminate]]`属性も導入され、以下のような動作となる: + +```cpp +// C++26 +void f(int); + +int main() { + int x; // xは誤り起因動作を引き起こす未初期化値をもつ + int y [[indeterminate]]; // 意図して不定値に初期化されることを指示 + + f(x); // 誤り起因動作 (未初期化値の読み取り) + f(y); // 未定義動作 (不定値の読み取り) +} +``` + + +## 仕様 +- 式が評価された結果として不定値が生成された場合、未定義動作を引き起こす +- 式が評価された結果として未初期化値が生成された場合、誤り起因動作を引き起こす + - ただし、`unsigned char`もしくは[`std::byte`](/reference/cstddef/byte.md)型に関しては、未初期化値をもつ変数を同じ型の変数に代入するだけでは誤り起因動作にならず、値の参照や型変換がされることで誤り起因動作を引き起こす +- 誤り起因動作が引き起こされた結果値は、後続の処理では誤り起因動作を引き起こす値とはみなされない + +```cpp +int g(bool b) { + unsigned char c; + unsigned char d = c; // 誤り起因動作ではない。dは誤り起因動作を引き起こす未初期化値をもつ + + assert(c == d); // どちらの変数も整数昇格され誤り起因動作となる + + int e = d; // 誤り起因動作 (型変換) + return b ? d : 0; // bがtrueの場合に誤り起因動作 +} + +void h() { + int d1, d2; + + int e1 = d1; // 誤り起因動作 + int e2 = d1; // 誤り起因動作 + + // 処理が続行した場合… + assert(e1 == e2); // OK。誤り起因動作の結果で生成された値は正常 + assert(e1 == d1); // 誤り起因動作 + assert(e2 == d1); // 誤り起因動作 + + // 誤り起因動作ではないが + // d2は誤り起因動作を引き起こす未初期化値をもつ + std::memcpy(&d2, &d1, sizeof(int)); + + assert(e1 == d2); // 誤り起因動作 + assert(e2 == d2); // 誤り起因動作 +} +``` + +### `[[indeterminate]]`属性 +`[[indeterminate]]`属性は、自動変数が初期状態として意図して不定値をもつことを指示するものであり、自動変数の定義、もしくは関数のパラメータ宣言に適用できる。 + +関数のパラメータが`[[indeterminate]]`属性で宣言される場合、その関数の最初の宣言でそのように宣言されなければならない (注:関数宣言は複数行うことができるが、その最初の宣言で`[[indeterminate]]`属性をつけなければならない)。 + +`[[indeterminate]]`がつけられた変数から読み取りをした場合、未定義動作を引き起こす可能性がある。 + +```cpp +struct T { + T() {} + int x; +}; + +int h(T t [[indeterminate]]) { + f(t.x); // この関数呼び出しは未定義動作を引き起こす + return 0; +} +int _ = h(T()); +``` + +### 今後、誤り起因動作に分類される可能性のある操作 + +現在、未定義動作に分類される以下の操作は、誤り起因動作に分類できる可能性がある。 + +| 操作 | 備考 | +|------|------| +| 符号付き整数のオーバーフロー | 演算結果としてオーバーフローした場合に誤った結果になる可能性がある。これは珍しいバグではない。これは安全上の大きな問題ではない | +| 算術型の変換結果としてその型の表現可能な範囲を超えた | 符号付き整数のオーバーフローと同じ | +| 誤ったビットシフト (負のシフト幅や、上限を超えたシフト幅) | 符号付き整数のオーバーフローと同じ | +| ゼロ割り | いくつかの固定値での誤った結果となる可能性がある。影響が不明確であるため、変更にはコストがかかる | +| 戻り値型が非`void`な関数から返った、もしくは`[[noreturn]]`属性をつけた関数から返った | [`std::terminate()`](/reference/exception/terminate.md)が呼ばれる可能性がある。変更には軽いコストがかかるが、その変更にどの程度の価値があるかは不明 | +| 抽象クラスのコンストラクタ・デストラクタからの純粋仮想関数の呼び出し | 特定の純粋仮想ハンドラが呼ばれる可能性がある。実装によってはすでに誤り起因動作のように扱われている可能性がある | +| 契約違反 | 契約に関する現在の策定作業では、契約違反時になにが起こるべきかという問題に直面している。誤り起因動作という概念は有用な回答を与えてくれる可能性がある | + + + +## 参照 +- [P2795R5 Erroneous behaviour for uninitialized reads](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2795r5.html) From cd6d39bd32c3a28bdbf4645a884f8c2406da16f0 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 17 Sep 2024 16:14:43 +0900 Subject: [PATCH 1200/3948] =?UTF-8?q?C++26=20=E6=9C=AA=E5=88=9D=E6=9C=9F?= =?UTF-8?q?=E5=8C=96=E5=A4=89=E6=95=B0=E3=81=AE=E8=AA=AD=E3=81=BF=E5=8F=96?= =?UTF-8?q?=E3=82=8A=20:=20erroneous=20behavior=E5=BE=8C=E3=81=AE=E7=B5=90?= =?UTF-8?q?=E6=9E=9C=E5=80=A4=E3=81=AB=E9=96=A2=E3=81=99=E3=82=8B=E8=AA=AC?= =?UTF-8?q?=E6=98=8E=E3=82=92=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../erroneous_behavior_for_uninitialized_reads.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md index 75c6935996..6f57d8887c 100644 --- a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md +++ b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md @@ -64,13 +64,14 @@ int g(bool b) { void h() { int d1, d2; - int e1 = d1; // 誤り起因動作 - int e2 = d1; // 誤り起因動作 + int e1 = d1; // 誤り起因動作 + int e2 = d1; // 誤り起因動作 // 処理が続行した場合… - assert(e1 == e2); // OK。誤り起因動作の結果で生成された値は正常 - assert(e1 == d1); // 誤り起因動作 - assert(e2 == d1); // 誤り起因動作 + assert(e1 == e2); // OK。誤り起因動作の結果で生成された値 (e1とe2) は、 + // 誤り起因動作を引き起こす値とはみなされない + assert(e1 == d1); // 誤り起因動作 + assert(e2 == d1); // 誤り起因動作 // 誤り起因動作ではないが // d2は誤り起因動作を引き起こす未初期化値をもつ From 040c50993c98a6e20e9a3156f74ec4a29c50f42b Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 17 Sep 2024 16:16:12 +0900 Subject: [PATCH 1201/3948] =?UTF-8?q?C++26=20=E6=9C=AA=E5=88=9D=E6=9C=9F?= =?UTF-8?q?=E5=8C=96=E5=A4=89=E6=95=B0=E3=81=AE=E8=AA=AD=E3=81=BF=E5=8F=96?= =?UTF-8?q?=E3=82=8A=20:=20=E3=82=B3=E3=83=BC=E3=83=89=E4=BE=8B=E3=81=ABex?= =?UTF-8?q?ample=E3=82=92=E3=81=A4=E3=81=91=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...oneous_behavior_for_uninitialized_reads.md | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md index 6f57d8887c..986d325010 100644 --- a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md +++ b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md @@ -14,9 +14,9 @@ この変更の対象は、デフォルト初期化されたスカラ型 (`void`以外の組み込み型) 変数の読み取りであり、以下のようなケースである。 -```cpp +```cpp example // C++23 -void f(int); +void f(int) {} int main() { int x; // デフォルト初期化。xは不定値 (indeterminate value) をもつ @@ -30,9 +30,9 @@ int main() { C++26では、不定値で初期化されることを明確に指示する`[[indeterminate]]`属性も導入され、以下のような動作となる: -```cpp +```cpp example // C++26 -void f(int); +void f(int) {} int main() { int x; // xは誤り起因動作を引き起こす未初期化値をもつ @@ -50,7 +50,9 @@ int main() { - ただし、`unsigned char`もしくは[`std::byte`](/reference/cstddef/byte.md)型に関しては、未初期化値をもつ変数を同じ型の変数に代入するだけでは誤り起因動作にならず、値の参照や型変換がされることで誤り起因動作を引き起こす - 誤り起因動作が引き起こされた結果値は、後続の処理では誤り起因動作を引き起こす値とはみなされない -```cpp +```cpp example +#include + int g(bool b) { unsigned char c; unsigned char d = c; // 誤り起因動作ではない。dは誤り起因動作を引き起こす未初期化値をもつ @@ -61,7 +63,7 @@ int g(bool b) { return b ? d : 0; // bがtrueの場合に誤り起因動作 } -void h() { +int main() { int d1, d2; int e1 = d1; // 誤り起因動作 @@ -89,7 +91,7 @@ void h() { `[[indeterminate]]`がつけられた変数から読み取りをした場合、未定義動作を引き起こす可能性がある。 -```cpp +```cpp example struct T { T() {} int x; @@ -99,7 +101,10 @@ int h(T t [[indeterminate]]) { f(t.x); // この関数呼び出しは未定義動作を引き起こす return 0; } -int _ = h(T()); + +int main() { + int _ = h(T()); +} ``` ### 今後、誤り起因動作に分類される可能性のある操作 From 9437e4e0d82b9c8249ffc01089209f3f411f6b8c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 17 Sep 2024 18:19:37 +0900 Subject: [PATCH 1202/3948] =?UTF-8?q?C++26=E5=AF=BE=E5=BF=9C=E3=81=A8?= =?UTF-8?q?=E3=81=97=E3=81=A6reference=5Fwrapper=E3=81=AEoperator=3D=3D?= =?UTF-8?q?=E3=81=A8<=3D>=E3=82=92=E8=BF=BD=E5=8A=A0=20#1340?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 2 +- reference/functional/reference_wrapper.md | 14 +++ .../reference_wrapper/op_compare_3way.md | 104 ++++++++++++++++++ .../functional/reference_wrapper/op_equal.md | 99 +++++++++++++++++ 4 files changed, 218 insertions(+), 1 deletion(-) create mode 100644 reference/functional/reference_wrapper/op_compare_3way.md create mode 100644 reference/functional/reference_wrapper/op_equal.md diff --git a/lang/cpp26.md b/lang/cpp26.md index a352f35065..95b1394303 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -165,7 +165,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [`std::move_only_function`](/reference/functional/move_only_function.md)のコピー可能版として、[``](/reference/functional.md)に[`std::copyable_function`](/reference/functional/copyable_function.md)クラスを追加 - [`std::bind_front()`](/reference/functional/bind_front.md)と[`std::bind_back()`](/reference/functional/bind_back.md)に、非型テンプレート引数として関数を指定するオーバーロードを追加 - 関連して、非型テンプレート引数の関数オブジェクトを反転させられるよう、[`not_fn()`](/reference/functional/not_fn.md)に非型テンプレート引数版のオーバーロードを追加 -- [`std::reference_wrapper`](/reference/functional/reference_wrapper.md)に、比較演算子[`==`](/reference/functional/reference_wrapper/op_equal.md.nolink)と[`<=>`](/reference/functional/reference_wrapper/op_compare_3way.md.nolink)を追加 +- [`std::reference_wrapper`](/reference/functional/reference_wrapper.md)に、比較演算子[`==`](/reference/functional/reference_wrapper/op_equal.md)と[`<=>`](/reference/functional/reference_wrapper/op_compare_3way.md)を追加 ### 文字列 diff --git a/reference/functional/reference_wrapper.md b/reference/functional/reference_wrapper.md index 15a729151e..3ee9bfab0c 100644 --- a/reference/functional/reference_wrapper.md +++ b/reference/functional/reference_wrapper.md @@ -40,12 +40,26 @@ C++17からは、このクラスは[トリビアルコピー可能](/reference/t ## 非メンバ関数 +### ヘルパ関数 | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`ref`](ref.md) | `T&`に対応する`reference_wrapper`オブジェクトの生成 | C++11 | | [`cref`](cref.md) | `const T&`に対応する`reference_wrapper`オブジェクトの生成 | C++11 | +### 比較演算子 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`operator==`](reference_wrapper/op_equal.md) | 等値比較 | C++26 | +| `operator!=` | 非等値比較 (`==`により使用可能) | C++26 | +| [`operator<=>`](reference_wrapper/op_compare_3way.md) | 三方比較 | C++26 | +| `operator<` | 左辺が右辺より小さいかを判定する (`<=>`により使用可能) | C++26 | +| `operator<=` | 左辺が右辺以下を判定する (`<=>`により使用可能) | C++26 | +| `operator>` | 左辺が右辺より大きいかを判定する (`<=>`により使用可能) | C++26 | +| `operator>=` | 左辺が右辺以上かを判定する (`<=>`により使用可能) | C++26 | + + ## 推論補助 | 名前 | 説明 | 対応バージョン | diff --git a/reference/functional/reference_wrapper/op_compare_3way.md b/reference/functional/reference_wrapper/op_compare_3way.md new file mode 100644 index 0000000000..4560a7ed60 --- /dev/null +++ b/reference/functional/reference_wrapper/op_compare_3way.md @@ -0,0 +1,104 @@ +# operator<=> +* functional[meta header] +* std[meta namespace] +* reference_wrapper[meta class] +* function template[meta id-type] + +```cpp +friend constexpr synth-three-way-result + operator<=>(reference_wrapper x, + reference_wrapper y); // (1) C++26 + +friend constexpr synth-three-way-result + operator<=>(reference_wrapper x, + const T& y); // (2) C++26 + +friend constexpr synth-three-way-result + operator<=>(reference_wrapper x, + reference_wrapper y); // (3) C++26 +``` + +## 概要 +三方比較を行う。 + +- (1) : 同じ要素型の`reference_wrapper`同士を三方比較する +- (2) : `reference_wrapper`と要素型`T`を三方比較する +- (3) : `reference_wrapper`と`reference_wrapper`を三方比較する + +(2)と(3)はオペランドを左右で逆にしても使用できる。 + + +## テンプレートパラメータ制約 +- (3) : [`is_const_v`](/reference/type_traits/is_const.md)``が`false`であること + + +## 戻り値 +- (1) : + ```cpp + return synth-three-way(x.get(), y.get()); + ``` + * get()[link get.md] + +- (2) : + ```cpp + return synth-three-way(x.get(), y); + ``` + * get()[link get.md] + +- (3) : + ```cpp + return synth-three-way(x.get(), y.get()); + ``` + * get()[link get.md] + + +## 備考 +- この演算子により、以下の演算子が使用可能になる: + - `operator<` + - `operator<=` + - `operator>` + - `operator>=` + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + int x = 3; + int y = 3; + int z = 4; + + assert((std::ref(x) <=> std::ref(y)) == 0); + assert(std::ref(x) < std::ref(z)); + assert(std::ref(x) <= std::ref(z)); + assert(std::ref(z) > std::ref(x)); + assert(std::ref(z) >= std::ref(x)); + + assert((std::ref(x) <=> 3) == 0); + assert((3 <=> std::ref(x)) == 0); + + assert((std::ref(x) <=> std::cref(y)) == 0); + assert((std::cref(x) <=> std::ref(y)) == 0); +} +``` + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 11.0 [mark verified] +- [GCC](/implementation.md#gcc): 10 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 [mark verified] + + +## 参照 +- [P2944R3 Comparisons for `reference_wrapper`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2944r3.html) diff --git a/reference/functional/reference_wrapper/op_equal.md b/reference/functional/reference_wrapper/op_equal.md new file mode 100644 index 0000000000..3828d62071 --- /dev/null +++ b/reference/functional/reference_wrapper/op_equal.md @@ -0,0 +1,99 @@ +# operator== +* functional[meta header] +* std[meta namespace] +* reference_wrapper[meta class] +* function template[meta id-type] + +```cpp +friend constexpr bool + operator==(reference_wrapper x, + reference_wrapper y); // (1) C++26 + +friend constexpr bool + operator==(reference_wrapper x, + const T& y); // (2) C++26 + +friend constexpr bool + operator==(reference_wrapper x, + reference_wrapper y); // (3) C++26 +``` + +## 概要 +等値比較を行う。 + +- (1) : 同じ要素型の`reference_wrapper`同士を等値比較する +- (2) : `reference_wrapper`と要素型`T`を等値比較する +- (3) : `reference_wrapper`と`reference_wrapper`を等値比較する + +(2)と(3)はオペランドを左右で逆にしても使用できる。 + + +## テンプレートパラメータ制約 +- (1) : 式`x.`[`get()`](get.md) `== y.`[`get()`](get.md)が妥当であり、その戻り値型が`bool`に変換可能であること +- (2) : 式`x.`[`get()`](get.md) `== y`が妥当であり、その戻り値型が`bool`に変換可能であること +- (3) : 式`x.`[`get()`](get.md) `== y.`[`get()`](get.md)が妥当であり、その戻り値型が`bool`に変換可能であること + + +## 戻り値 +- (1) : + ```cpp + return x.get() == y.get(); + ``` + * get()[link get.md] + +- (2) : + ```cpp + return x.get() == y; + ``` + * get()[link get.md] + +- (3) : + ```cpp + return x.get() == y.get(); + ``` + * get()[link get.md] + + +## 備考 +- この演算子により、以下の演算子が使用可能になる: + - `operator!=` + + +## 例 +```cpp example +#include +#include + +int main() +{ + int x = 3; + int y = 3; + + assert(std::ref(x) == std::ref(y)); + + assert(std::ref(x) == 3); + assert(3 == std::ref(x)); + + assert(std::ref(x) == std::cref(y)); + assert(std::cref(x) == std::ref(y)); +} +``` +* std::ref[link /reference/functional/ref.md] +* std::cref[link /reference/functional/cref.md] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 4.4 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 [mark verified] + + +## 参照 +- [P2944R3 Comparisons for `reference_wrapper`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2944r3.html) From fe9f6f74664afc8705138728149c0929539552ac Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 17 Sep 2024 18:25:53 +0900 Subject: [PATCH 1203/3948] =?UTF-8?q?optional,=20tuple,=20pair,=20variant?= =?UTF-8?q?=20:=20C++26=E5=AF=BE=E5=BF=9C=E3=81=A8=E3=81=97=E3=81=A6?= =?UTF-8?q?=E3=83=86=E3=83=B3=E3=83=97=E3=83=AC=E3=83=BC=E3=83=88=E3=83=91?= =?UTF-8?q?=E3=83=A9=E3=83=A1=E3=83=BC=E3=82=BF=E5=88=B6=E7=B4=84=E3=82=92?= =?UTF-8?q?=E6=95=B4=E7=90=86=20#1340?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/optional/optional/op_equal.md | 6 ++++-- reference/tuple/tuple/op_equal.md | 4 +++- reference/utility/pair/op_equal.md | 6 ++++++ reference/variant/variant/op_equal.md | 2 ++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/reference/optional/optional/op_equal.md b/reference/optional/optional/op_equal.md index b9079f2e26..c8161b828c 100644 --- a/reference/optional/optional/op_equal.md +++ b/reference/optional/optional/op_equal.md @@ -29,8 +29,8 @@ namespace std { `optional`オブジェクトの等値比較を行う。 -## 要件 -- (1), (3), (4) : 型`T`が`==`で比較可能であること +## テンプレートパラメータ制約 +- (1), (3), (4) : 型`T`が`==`で比較可能であり、その戻り値型が`bool`に変換可能であること ## 戻り値 @@ -114,3 +114,5 @@ int main() - [LWG Issue 2934. `optional` doesn't compare with `T`](https://wg21.cmeerw.net/lwg/issue2934) - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P2944R3 Comparisons for `reference_wrapper`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2944r3.html) + - C++26でテンプレートパラメータ制約が整理された diff --git a/reference/tuple/tuple/op_equal.md b/reference/tuple/tuple/op_equal.md index 0e28dd8dd7..fe541eb2ce 100644 --- a/reference/tuple/tuple/op_equal.md +++ b/reference/tuple/tuple/op_equal.md @@ -26,7 +26,7 @@ namespace std { 2つの[`tuple`](../tuple.md)オブジェクトの等値比較を行う。また、[`tuple-like`](../tuple-like.md)なオブジェクトとの等値比較を行う。(C++23以降) -## 要件 +## テンプレートパラメータ制約 - (1) : - 2つの[`tuple`](../tuple.md)オブジェクトの要素数が同じであること。(具体的には`sizeof...(TTypes) == sizeof...(UTypes)`であること。) - [`tuple`](../tuple.md)の要素`std::`[`get`](get.md)`(t)`と`std::`[`get`](get.md)`(u)`において、すべての要素の比較 `std::`[`get`](get.md)`(t) == std::`[`get`](get.md)`(u)` の比較結果が`bool`に変換可能な型(C++23 以降は[`boolean-testable`](/reference/concepts/boolean-testable.md)を満たせばよい)であること。 @@ -94,3 +94,5 @@ false - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 - [P2165R4 Compatibility between `tuple`, `pair` and *tuple-like* objects](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2165r4.pdf) +- [P2944R3 Comparisons for `reference_wrapper`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2944r3.html) + - C++26でテンプレートパラメータ制約が整理された diff --git a/reference/utility/pair/op_equal.md b/reference/utility/pair/op_equal.md index c131b44a01..f4f02ba302 100644 --- a/reference/utility/pair/op_equal.md +++ b/reference/utility/pair/op_equal.md @@ -26,6 +26,10 @@ namespace std { 2つの`pair`の等値比較を行う +## テンプレートパラメータ制約 +- 式`x.first == y.first`と`x.second == y.second`が妥当であり、型`decltype(x.first == y.first)`と`decltype(x.second == y.second)`が[boolean-testable](/reference/concepts/boolean-testable.md)のモデルであること + + ## 戻り値 ```cpp return x.first == y.first && x.second == y.second; @@ -65,3 +69,5 @@ false - [N3471 Constexpr Library Additions: utilities, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3471.html) - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P2944R3 Comparisons for `reference_wrapper`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2944r3.html) + - C++26でテンプレートパラメータ制約が整理された diff --git a/reference/variant/variant/op_equal.md b/reference/variant/variant/op_equal.md index fb29873a87..de76fd8af0 100644 --- a/reference/variant/variant/op_equal.md +++ b/reference/variant/variant/op_equal.md @@ -59,3 +59,5 @@ int main() ## 参照 - [P0393R3 Making Variant Greater Equal](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0393r3.html) +- [P2944R3 Comparisons for `reference_wrapper`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2944r3.html) + - C++26でテンプレートパラメータ制約が整理された From 806a8c82d9cefa9e298a1ab907a7518d2be1bea7 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 18 Sep 2024 07:26:07 +0900 Subject: [PATCH 1204/3948] =?UTF-8?q?formatter=20:=20=E8=A4=87=E6=95=B0?= =?UTF-8?q?=E3=81=AE=E3=83=A1=E3=83=B3=E3=83=90=E5=A4=89=E6=95=B0=E3=82=92?= =?UTF-8?q?=E3=82=82=E3=81=A4=E3=82=AF=E3=83=A9=E3=82=B9=E3=82=92formatter?= =?UTF-8?q?=E3=81=A7=E6=96=87=E5=AD=97=E5=88=97=E5=8C=96=E3=81=99=E3=82=8B?= =?UTF-8?q?=E4=BE=8B=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/formatter.md | 38 ++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/reference/format/formatter.md b/reference/format/formatter.md index 1c85b3d09f..9db8d6c160 100644 --- a/reference/format/formatter.md +++ b/reference/format/formatter.md @@ -231,15 +231,47 @@ int main() 赤 blue ``` + +### 複数のメンバ変数を含むクラスの場合 +```cpp example +#include +#include + +struct Point { + float x, y; +}; + +template<> +struct std::formatter : std::formatter { + auto format(Point p, std::format_context& ctx) const { + return std::formatter::format( + std::format("[{}, {}]", p.x, p.y), + ctx); + } +}; + +int main() +{ + std::cout << std::format("{}", Point{1.2f, 3.4f}) << std::endl; +} +``` +* std::format_context[link basic_format_context.md] +* std::format[link format.md] + +#### 出力 +``` +[1.2, 3.4] +``` + + ## バージョン ### 言語 - C++20 ### 処理系 -- [Clang](/implementation.md#clang): ?? +- [Clang](/implementation.md#clang): 17 [mark verified] - [GCC](/implementation.md#gcc): 13 [mark verified] -- [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 2 [mark verified] ## 関連項目 - [`vector`](/reference/vector/vector.md) From 07e9e02558d9172af724419b65913209c1510f5f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 18 Sep 2024 12:31:11 +0900 Subject: [PATCH 1205/3948] =?UTF-8?q?C++26=E5=AF=BE=E5=BF=9C=E3=81=A8?= =?UTF-8?q?=E3=81=97=E3=81=A6=E3=83=A9=E3=82=A4=E3=83=96?= =?UTF-8?q?=E3=83=A9=E3=83=AA=E3=82=92=E8=BF=BD=E5=8A=A0=20(close=20#1232)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 1 + lang/cpp26.md | 2 +- reference.md | 2 +- reference/debugging.md | 42 +++++++++ reference/debugging/breakpoint.md | 81 ++++++++++++++++ .../debugging/breakpoint_if_debugging.md | 83 +++++++++++++++++ reference/debugging/is_debugger_present.md | 93 +++++++++++++++++++ 7 files changed, 302 insertions(+), 2 deletions(-) create mode 100644 reference/debugging.md create mode 100644 reference/debugging/breakpoint.md create mode 100644 reference/debugging/breakpoint_if_debugging.md create mode 100644 reference/debugging/is_debugger_present.md diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 040bd8f9ac..71f8fdafad 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -97,6 +97,7 @@ * [link /reference/cstdio.md] * [link /reference/cstdlib.md] * [link /reference/ctime.md] +* [link /reference/debugging.md] * [link /reference/deque/deque.md] * std::deque[link /reference/deque/deque.md] * [link /reference/exception.md] diff --git a/lang/cpp26.md b/lang/cpp26.md index 95b1394303..161bc000a3 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -89,7 +89,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - 文字列エンコーディングを識別するライブラリとして、[``](/reference/text_encoding.md.nolink)を追加 - 並行処理におけるデータの参照・更新を行うRCU (Read Copy Update) のライブラリとして、[``](/reference/rcu.md.nolink)を追加 - 並行処理において参照中のデータが更新されないよう保護するハザードポインタのライブラリとして、[``](/reference/hazard_pointer.md.nolink)を追加 -- デバッグサポートのライブラリとして[``](/reference/debugging.md.nolink)を追加 +- デバッグサポートのライブラリとして[``](/reference/debugging.md)を追加 - 線形代数ライブラリとして[``](/reference/linalg.md)を追加 - コンパイル時に容量を固定する可変長配列クラスのライブラリとして[``](/reference/inplace_vector.md.nolink)を追加 diff --git a/reference.md b/reference.md index 362795d4e7..880ad10aed 100644 --- a/reference.md +++ b/reference.md @@ -157,7 +157,7 @@ | ヘッダ | 説明 | 対応バージョン | |----------------------------------------|------------------|----------------| -| [``](/reference/debugging.md.nolink) | デバッグサポート | C++26 | +| [``](/reference/debugging.md) | デバッグサポート | C++26 | ## 入出力ライブラリ diff --git a/reference/debugging.md b/reference/debugging.md new file mode 100644 index 0000000000..b05a558ccf --- /dev/null +++ b/reference/debugging.md @@ -0,0 +1,42 @@ +# debugging +* debugging[meta header] +* cpp26[meta cpp] + +``ヘッダでは、プログラムのデバッグ実行をサポートする機能を提供する。 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`breakpoint`](debugging/breakpoint.md) | ブレークポイントを設置する (functional) | C++26 | +| [`breakpoint_if_debugging`](debugging/breakpoint_if_debugging.md) | デバッガ実行のみブレークポイントを設置する (functional) | C++26 | +| [`is_debugger_present`](debugging/is_debugger_present.md) | デバッガ実行中か判定する (functional) | C++26 | + + +## この機能が必要になった背景・経緯 +開発プラットフォームによってデバッガやブレークポイントの機能は提供されているが、本ライブラリのようにプログラム中に明示的にブレークポイントを設置し、プログラムとデバッガを対話させることでデバッグ体験が向上することがある。 + +実装経験としては以下のようなものがあり、これらをこのライブラリで標準化した: + +| 開発環境 | 機能 | +|----------|------| +| Microsoft C/C++ Optimizing Compiler | `__debugbreak()`関数 (無条件ブレークポイント) | +| Win32 API | `IsDebuggerPresent()`関数 (デバッガ実行中か判定) | +| LLVM Clang | `__builtin_debugtrap()`組み込み関数 (無条件ブレークポイント) | +| arm Keil, ARM Compiler | `__breakpoint()`関数 (無条件ブレークポイント) | +| Portable Snippetsライブラリ | `psnip_trap()`関数 (無条件ブレークポイント) | +| Debug Breakライブラリ | `debug_break()`関数 (無条件ブレークポイント) | +| Boost.Testライブラリ | `debugger_break()`関数 (無条件ブレークポイント)
`under_debugger()`関数 (出張っg実行中か判定) | +| EASTLライブラリ | `EASTL_DEBUG_BREAK()`マクロ (無条件ブレークポイント)、 | +| Catch2ライブラリ | `CATCH_TRAP`マクロ (無条件ブレークポイント)
`CATCH_BREAK_INTO_DEBUGGER`マクロ (条件付きブレークポイント)
`isDebuggerActive()`関数 (デバッガ実行中か判定) | +| JUCEライブラリ | `JUCE_BREAK_IN_DEBUGGER`マクロ (無条件ブレークポイント)
`juce_isRunningUnderDebugger()`関数、`Process::isRunningUnderDebugger()`関数 (デバッガ実行中か判定) | +| ImGuiライブラリ | `IM_DEBUG_BREAK()`マクロ (無条件ブレークポイント) | +| AWS C SDK | `aws_debug_break()`関数 (条件付きブレークポイント)
`aws_is_debugger_present()`関数 (デバッガ実行中か判定) | +| UnrealEngine | `UE_DEBUG_BREAK`マクロ (条件付きブレークポイント)
`IsDebuggerPresent()`関数 (デバッガ実行中か判定) | + + +## バージョン +### 言語 +- C++26 + + +## 参照 +- [P2546R5 Debugging Support](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2546r5.html) diff --git a/reference/debugging/breakpoint.md b/reference/debugging/breakpoint.md new file mode 100644 index 0000000000..8b0d35282e --- /dev/null +++ b/reference/debugging/breakpoint.md @@ -0,0 +1,81 @@ +# breakpoint +* debugging[meta header] +* std[meta namespace] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + void breakpoint() noexcept; // (1) C++26 +} +``` + +## 概要 +ブレークポイントを設置する。 + +この関数は無条件のブレークポイントであり、デバッガがプログラムを監視しているかに関わらずプログラムの一時停止 (ブレーク) を試みる。 + + + +## 効果 +標準規格としては、この関数の意味論は実装定義である。 + +実際の動作としては、この関数が呼び出されるとプログラムの実行が一時停止され、以下のいずれかの時点までデバッガに制御が渡される: + +- デバッガによってプログラムが終了される、または +- デバッガが、この関数が呼び出されなかったかのようにプログラムの実行を再開する + + +## 例外 +投げない + + +## 備考 +- 実装としては、生成されるコードがプラットフォームに対して可能な限り最小になるように最適化することが期待される。例として、x86ターゲット環境ではINT3命令をひとつだけ生成することが期待される + + +## 例 +```cpp example +#include +#include +#include + +// なんらかの処理 +double g(double a, double b) { + return a / b; +} + +double f(double a, double b) { + double ret = g(a, b); + if (std::isnan(ret)) { + // 演算結果でNaNが発生したらブレークし、 + // デバッガでパラメータ (ローカル変数) などを確認する + std::breakpoint(); + } +} + +int main() { + double ret = f(2.0, 0.0); + std::println("{}", ret); +} +``` +* std::breakpoint[color ff0000] +* std::isnan[link /reference/cmath/isnan.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 19 [mark noimpl] +- [GCC](/implementation.md#gcc): 14 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 10 + + +## 参照 +- [P2546R5 Debugging Support](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2546r5.html) diff --git a/reference/debugging/breakpoint_if_debugging.md b/reference/debugging/breakpoint_if_debugging.md new file mode 100644 index 0000000000..9850e11da9 --- /dev/null +++ b/reference/debugging/breakpoint_if_debugging.md @@ -0,0 +1,83 @@ +# breakpoint_if_debugging +* debugging[meta header] +* std[meta namespace] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + void breakpoint_if_debugging() noexcept; // (1) C++26 +} +``` + +## 概要 +デバッガ実行のみブレークポイントを設置する。 + +この関数は条件付きブレークポイントであり、デバッガがプログラムを監視中であればプログラムを一時停止 (ブレーク) するが、そうでなければ何もしないよう動作する。 + + +## 効果 +以下と等価: + +```cpp +if (is_debugger_present()) { + breakpoint(); +} +``` +* is_debugger_present()[link is_debugger_present.md] +* breakpoint()[link breakpoint.md] + + +## 例外 +投げない + + +## 備考 +- 実装としては、生成されるコードがプラットフォームに対して可能な限り最小になるように最適化することが期待される。例として、x86ターゲット環境ではINT3命令をひとつだけ生成することが期待される + + +## 例 +```cpp example +#include +#include +#include + +// なんらかの処理 +double g(double a, double b) { + return a / b; +} + +double f(double a, double b) { + double ret = g(a, b); + if (std::isnan(ret)) { + // 演算結果でNaNが発生したらブレークし、 + // デバッガでパラメータ (ローカル変数) などを確認する + std::breakpoint_if_debugging(); + } +} + +int main() { + double ret = f(2.0, 0.0); + std::println("{}", ret); +} +``` +* std::breakpoint_if_debugging[color ff0000] +* std::isnan[link /reference/cmath/isnan.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 19 [mark noimpl] +- [GCC](/implementation.md#gcc): 14 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 10 + + +## 参照 +- [P2546R5 Debugging Support](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2546r5.html) diff --git a/reference/debugging/is_debugger_present.md b/reference/debugging/is_debugger_present.md new file mode 100644 index 0000000000..0d4454818a --- /dev/null +++ b/reference/debugging/is_debugger_present.md @@ -0,0 +1,93 @@ +# is_debugger_present +* debugging[meta header] +* std[meta namespace] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + bool is_debugger_present() noexcept; // (1) C++26 +} +``` + +## 概要 +デバッガ実行中か判定する。 + +この関数は、デバッガがプログラムを監視中かどうかを判定する。プラットフォーム固有の結果を決定できない場合、ユーザーがこの関数を定義することで柔軟に動作を制御できる。 + + +## 置き換え可能 +ユーザーのプログラムでこの関数を定義することで、標準ライブラリで定義されるデフォルトの動作を置き換えることができる。 + +## 要求される振る舞い +- この関数は事前条件をもたないこと + + +## デフォルトの振る舞い +- 実装定義 + + +## 効果 +デバッガがプログラムを監視中である場合、実装は`true`を返す。 + + +## 例外 +投げない + + +## 備考 +- 実装は、プログラムがデバッガによって監視されているかどうかを判定するために、必要に応じて即時クエリを実行する +- Windowsまたは同等のシステムでは、この関数の動作はWin32関数の`::IsDebuggerPresent()`を呼び出すことで実現できる +- POSIX環境では、監視親プロセスをチェックすることで実現できる。その際、監視親プロセスがデバッガであるかどうかは最善の努力で判定する +- この関数は、結果のキャッシュを規定しない。既存の実装もデバッガの存在クエリについての結果をキャッシュするようなことはしておらず、そのコストが問題にはなっていなかった。また、結果をキャッシュする場合、[`std::breakpoint_if_debugging()`](breakpoint_if_debugging.md)のインタフェースにも影響してしまう + + +## 例 +```cpp example +#include +#include +#include + +// なんらかの処理 +double g(double a, double b) { + return a / b; +} + +double f(double a, double b) { + double ret = g(a, b); + if (std::isnan(ret)) { + // 演算結果でNaNが発生したらブレークし、 + // デバッガでパラメータ (ローカル変数) などを確認する + if (std::is_debugger_present()) { + std::breakpoint(); + } + } +} + +int main() { + double ret = f(2.0, 0.0); + std::println("{}", ret); +} +``` +* std::is_debugger_present[color ff0000] +* std::breakpoint[link breakpoint.md] +* std::isnan[link /reference/cmath/isnan.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 19 [mark noimpl] +- [GCC](/implementation.md#gcc): 14 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 10 + + +## 参照 +- [P2546R5 Debugging Support](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2546r5.html) +- [P2810R4 `is_debugger_present` `is_replaceable`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2810r4.html) From 6572301df3e91804b2d1ec3fa49071eb3626ec35 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 18 Sep 2024 12:36:29 +0900 Subject: [PATCH 1206/3948] =?UTF-8?q?=20:=20MSVC=E3=81=AE?= =?UTF-8?q?=E5=AE=9F=E8=A3=85=E7=8A=B6=E6=B3=81=E3=82=92=E3=81=BE=E3=81=A1?= =?UTF-8?q?=E3=81=8C=E3=81=88=E3=81=9F=20#1232?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/debugging/breakpoint.md | 2 +- reference/debugging/breakpoint_if_debugging.md | 2 +- reference/debugging/is_debugger_present.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/debugging/breakpoint.md b/reference/debugging/breakpoint.md index 8b0d35282e..eca120ffcb 100644 --- a/reference/debugging/breakpoint.md +++ b/reference/debugging/breakpoint.md @@ -74,7 +74,7 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): 19 [mark noimpl] - [GCC](/implementation.md#gcc): 14 [mark noimpl] -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 10 [mark noimpl] ## 参照 diff --git a/reference/debugging/breakpoint_if_debugging.md b/reference/debugging/breakpoint_if_debugging.md index 9850e11da9..742e93cb99 100644 --- a/reference/debugging/breakpoint_if_debugging.md +++ b/reference/debugging/breakpoint_if_debugging.md @@ -76,7 +76,7 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): 19 [mark noimpl] - [GCC](/implementation.md#gcc): 14 [mark noimpl] -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 10 [mark noimpl] ## 参照 diff --git a/reference/debugging/is_debugger_present.md b/reference/debugging/is_debugger_present.md index 0d4454818a..4cabd44f4c 100644 --- a/reference/debugging/is_debugger_present.md +++ b/reference/debugging/is_debugger_present.md @@ -85,7 +85,7 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): 19 [mark noimpl] - [GCC](/implementation.md#gcc): 14 [mark noimpl] -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 10 +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 10 [mark noimpl] ## 参照 From a4346b7d7da2873721b6dce28c8ce9811a6da22d Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 18 Sep 2024 13:13:25 +0900 Subject: [PATCH 1207/3948] =?UTF-8?q?=20:=20=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=89=E4=BE=8B=E3=81=8C=E9=96=93=E9=81=95=E3=81=A3=E3=81=A6?= =?UTF-8?q?=E3=81=9F=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3=20#1232?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/debugging/breakpoint.md | 9 ++++++--- reference/debugging/breakpoint_if_debugging.md | 9 ++++++--- reference/debugging/is_debugger_present.md | 9 ++++++--- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/reference/debugging/breakpoint.md b/reference/debugging/breakpoint.md index eca120ffcb..62f370aef5 100644 --- a/reference/debugging/breakpoint.md +++ b/reference/debugging/breakpoint.md @@ -47,11 +47,12 @@ double g(double a, double b) { double f(double a, double b) { double ret = g(a, b); - if (std::isnan(ret)) { - // 演算結果でNaNが発生したらブレークし、 + if (std::isnan(ret) || std::isinf(ret)) { + // 演算結果でNaNかinfが発生したらブレークし、 // デバッガでパラメータ (ローカル変数) などを確認する std::breakpoint(); } + return ret; } int main() { @@ -61,9 +62,11 @@ int main() { ``` * std::breakpoint[color ff0000] * std::isnan[link /reference/cmath/isnan.md] +* std::isinf[link /reference/cmath/isinf.md] -### 出力 +### 出力例 ``` +inf ``` diff --git a/reference/debugging/breakpoint_if_debugging.md b/reference/debugging/breakpoint_if_debugging.md index 742e93cb99..482559fa24 100644 --- a/reference/debugging/breakpoint_if_debugging.md +++ b/reference/debugging/breakpoint_if_debugging.md @@ -49,11 +49,12 @@ double g(double a, double b) { double f(double a, double b) { double ret = g(a, b); - if (std::isnan(ret)) { - // 演算結果でNaNが発生したらブレークし、 + if (std::isnan(ret) || std::isinf(ret)) { + // 演算結果でNaNかinfが発生したらブレークし、 // デバッガでパラメータ (ローカル変数) などを確認する std::breakpoint_if_debugging(); } + return ret; } int main() { @@ -63,9 +64,11 @@ int main() { ``` * std::breakpoint_if_debugging[color ff0000] * std::isnan[link /reference/cmath/isnan.md] +* std::isinf[link /reference/cmath/isinf.md] -### 出力 +### 出力例 ``` +inf ``` diff --git a/reference/debugging/is_debugger_present.md b/reference/debugging/is_debugger_present.md index 4cabd44f4c..721f4f41e6 100644 --- a/reference/debugging/is_debugger_present.md +++ b/reference/debugging/is_debugger_present.md @@ -55,13 +55,14 @@ double g(double a, double b) { double f(double a, double b) { double ret = g(a, b); - if (std::isnan(ret)) { - // 演算結果でNaNが発生したらブレークし、 + if (std::isnan(ret) || std::isinf(ret)) { + // 演算結果でNaNかinfが発生したらブレークし、 // デバッガでパラメータ (ローカル変数) などを確認する if (std::is_debugger_present()) { std::breakpoint(); } } + return ret; } int main() { @@ -72,9 +73,11 @@ int main() { * std::is_debugger_present[color ff0000] * std::breakpoint[link breakpoint.md] * std::isnan[link /reference/cmath/isnan.md] +* std::isinf[link /reference/cmath/isinf.md] -### 出力 +### 出力例 ``` +inf ``` From 964d94ab807c5b935fa0581bd3e6b70a61a1a2fc Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 18 Sep 2024 13:33:23 +0900 Subject: [PATCH 1208/3948] fix typo --- reference/debugging.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/debugging.md b/reference/debugging.md index b05a558ccf..81ec7bf421 100644 --- a/reference/debugging.md +++ b/reference/debugging.md @@ -25,7 +25,7 @@ | Portable Snippetsライブラリ | `psnip_trap()`関数 (無条件ブレークポイント) | | Debug Breakライブラリ | `debug_break()`関数 (無条件ブレークポイント) | | Boost.Testライブラリ | `debugger_break()`関数 (無条件ブレークポイント)
`under_debugger()`関数 (出張っg実行中か判定) | -| EASTLライブラリ | `EASTL_DEBUG_BREAK()`マクロ (無条件ブレークポイント)、 | +| EASTLライブラリ | `EASTL_DEBUG_BREAK()`マクロ (無条件ブレークポイント) | | Catch2ライブラリ | `CATCH_TRAP`マクロ (無条件ブレークポイント)
`CATCH_BREAK_INTO_DEBUGGER`マクロ (条件付きブレークポイント)
`isDebuggerActive()`関数 (デバッガ実行中か判定) | | JUCEライブラリ | `JUCE_BREAK_IN_DEBUGGER`マクロ (無条件ブレークポイント)
`juce_isRunningUnderDebugger()`関数、`Process::isRunningUnderDebugger()`関数 (デバッガ実行中か判定) | | ImGuiライブラリ | `IM_DEBUG_BREAK()`マクロ (無条件ブレークポイント) | From cbb1fd4e1b38336a5643daeffa5ea7c88e3009e2 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 18 Sep 2024 14:54:15 +0900 Subject: [PATCH 1209/3948] =?UTF-8?q?hardware=5F=E2=80=A6size=20:=20?= =?UTF-8?q?=E5=8B=95=E4=BD=9C=E7=A2=BA=E8=AA=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/new/hardware_constructive_interference_size.md | 6 +++--- reference/new/hardware_destructive_interference_size.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/reference/new/hardware_constructive_interference_size.md b/reference/new/hardware_constructive_interference_size.md index f75d652bb9..ce9a949c12 100644 --- a/reference/new/hardware_constructive_interference_size.md +++ b/reference/new/hardware_constructive_interference_size.md @@ -22,7 +22,7 @@ namespace std { ## 例 -```cpp +```cpp example #include #include @@ -55,9 +55,9 @@ hardware_constructive_interference_size : 64 - C++17 ### 処理系 -- [Clang](/implementation.md#clang): +- [Clang](/implementation.md#clang): 19 [mark verified] - [GCC](/implementation.md#gcc): 12.1 [mark verified] -- [Visual C++](/implementation.md#visual_cpp): +- [Visual C++](/implementation.md#visual_cpp): 2019 [mark verified] ## 参照 diff --git a/reference/new/hardware_destructive_interference_size.md b/reference/new/hardware_destructive_interference_size.md index 645a59e5cc..fe1c0188b1 100644 --- a/reference/new/hardware_destructive_interference_size.md +++ b/reference/new/hardware_destructive_interference_size.md @@ -39,7 +39,7 @@ struct keep_apart { ## 例 -```cpp +```cpp example #include #include #include @@ -114,9 +114,9 @@ hardware_destructive_interference_size : 64 - C++17 ### 処理系 -- [Clang](/implementation.md#clang): +- [Clang](/implementation.md#clang): 19 [mark verified] - [GCC](/implementation.md#gcc): 12.1 [mark verified] -- [Visual C++](/implementation.md#visual_cpp): +- [Visual C++](/implementation.md#visual_cpp): 2019 [mark verified] ## 参照 From 30fab638cae8da737b5f47495953a63b4ad6de53 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 18 Sep 2024 18:15:54 +0900 Subject: [PATCH 1210/3948] =?UTF-8?q?breakpoint=5Fif=5Fdebugging=20:=20?= =?UTF-8?q?=E8=84=B1=E5=AD=97=E3=82=92=E4=BF=AE=E6=AD=A3=20#1232?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/debugging.md | 2 +- reference/debugging/breakpoint_if_debugging.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/debugging.md b/reference/debugging.md index 81ec7bf421..ea579096e3 100644 --- a/reference/debugging.md +++ b/reference/debugging.md @@ -7,7 +7,7 @@ | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`breakpoint`](debugging/breakpoint.md) | ブレークポイントを設置する (functional) | C++26 | -| [`breakpoint_if_debugging`](debugging/breakpoint_if_debugging.md) | デバッガ実行のみブレークポイントを設置する (functional) | C++26 | +| [`breakpoint_if_debugging`](debugging/breakpoint_if_debugging.md) | デバッガ実行時のみブレークポイントを設置する (functional) | C++26 | | [`is_debugger_present`](debugging/is_debugger_present.md) | デバッガ実行中か判定する (functional) | C++26 | diff --git a/reference/debugging/breakpoint_if_debugging.md b/reference/debugging/breakpoint_if_debugging.md index 482559fa24..6fc9f21d1c 100644 --- a/reference/debugging/breakpoint_if_debugging.md +++ b/reference/debugging/breakpoint_if_debugging.md @@ -11,7 +11,7 @@ namespace std { ``` ## 概要 -デバッガ実行のみブレークポイントを設置する。 +デバッガ実行時のみブレークポイントを設置する。 この関数は条件付きブレークポイントであり、デバッガがプログラムを監視中であればプログラムを一時停止 (ブレーク) するが、そうでなければ何もしないよう動作する。 From dd8477c7aae368c8df41f61c6d65fe9bbfb47a42 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 18 Sep 2024 23:31:22 +0900 Subject: [PATCH 1211/3948] =?UTF-8?q?=20:=20=E3=83=A6=E3=83=BC?= =?UTF-8?q?=E3=82=B9=E3=82=B1=E3=83=BC=E3=82=B9=E3=82=92=E8=A8=98=E8=BC=89?= =?UTF-8?q?=20#1232?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/debugging/breakpoint.md | 3 ++- reference/debugging/is_debugger_present.md | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/reference/debugging/breakpoint.md b/reference/debugging/breakpoint.md index 62f370aef5..eb882cec9e 100644 --- a/reference/debugging/breakpoint.md +++ b/reference/debugging/breakpoint.md @@ -13,8 +13,9 @@ namespace std { ## 概要 ブレークポイントを設置する。 -この関数は無条件のブレークポイントであり、デバッガがプログラムを監視しているかに関わらずプログラムの一時停止 (ブレーク) を試みる。 +この関数は無条件のブレークポイントであり、デバッガの存在を検出できない状況でもプログラムの一時停止 (ブレーク) を試みる。 +プログラムコードでブレークポイントを指定できると、複雑な実行時条件でプログラムを一時停止させることができる。 ## 効果 diff --git a/reference/debugging/is_debugger_present.md b/reference/debugging/is_debugger_present.md index 721f4f41e6..098f6e296c 100644 --- a/reference/debugging/is_debugger_present.md +++ b/reference/debugging/is_debugger_present.md @@ -15,6 +15,8 @@ namespace std { この関数は、デバッガがプログラムを監視中かどうかを判定する。プラットフォーム固有の結果を決定できない場合、ユーザーがこの関数を定義することで柔軟に動作を制御できる。 +プログラムがデバッガ実行中かを判定できることで、デバッガ実行中に問題の診断に役立つ追加の出力やテストができる。 + ## 置き換え可能 ユーザーのプログラムでこの関数を定義することで、標準ライブラリで定義されるデフォルトの動作を置き換えることができる。 From d9d9c67a6159d03bc09fd61e50d4b802a36aae64 Mon Sep 17 00:00:00 2001 From: raclamusi Date: Thu, 19 Sep 2024 22:47:18 +0900 Subject: [PATCH 1212/3948] fix typo --- reference/debugging.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/debugging.md b/reference/debugging.md index ea579096e3..4b10b0bd4f 100644 --- a/reference/debugging.md +++ b/reference/debugging.md @@ -24,7 +24,7 @@ | arm Keil, ARM Compiler | `__breakpoint()`関数 (無条件ブレークポイント) | | Portable Snippetsライブラリ | `psnip_trap()`関数 (無条件ブレークポイント) | | Debug Breakライブラリ | `debug_break()`関数 (無条件ブレークポイント) | -| Boost.Testライブラリ | `debugger_break()`関数 (無条件ブレークポイント)
`under_debugger()`関数 (出張っg実行中か判定) | +| Boost.Testライブラリ | `debugger_break()`関数 (無条件ブレークポイント)
`under_debugger()`関数 (デバッガ実行中か判定) | | EASTLライブラリ | `EASTL_DEBUG_BREAK()`マクロ (無条件ブレークポイント) | | Catch2ライブラリ | `CATCH_TRAP`マクロ (無条件ブレークポイント)
`CATCH_BREAK_INTO_DEBUGGER`マクロ (条件付きブレークポイント)
`isDebuggerActive()`関数 (デバッガ実行中か判定) | | JUCEライブラリ | `JUCE_BREAK_IN_DEBUGGER`マクロ (無条件ブレークポイント)
`juce_isRunningUnderDebugger()`関数、`Process::isRunningUnderDebugger()`関数 (デバッガ実行中か判定) | From 1cb0ea1982be0f8c765149be0aa2d4d832e1245b Mon Sep 17 00:00:00 2001 From: lpha Date: Thu, 1 Feb 2024 01:42:36 +0900 Subject: [PATCH 1213/3948] =?UTF-8?q?uniform=5Freal=5Fdistribution:=20?= =?UTF-8?q?=E7=AF=84=E5=9B=B2=E5=A4=96=E3=81=8C=E5=87=BA=E3=82=8B=E3=81=93?= =?UTF-8?q?=E3=81=A8=E3=81=8C=E3=81=82=E3=82=8B=E4=BB=B6=E3=81=AE=E5=8F=82?= =?UTF-8?q?=E7=85=A7=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/random/uniform_real_distribution/op_constructor.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reference/random/uniform_real_distribution/op_constructor.md b/reference/random/uniform_real_distribution/op_constructor.md index d64649495b..b2dc133096 100644 --- a/reference/random/uniform_real_distribution/op_constructor.md +++ b/reference/random/uniform_real_distribution/op_constructor.md @@ -82,4 +82,6 @@ int main() ## 参照 -- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) \ No newline at end of file +- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) +- [C++ の std::uniform_real_distribution はあまり信用できない。](https://qiita.com/Nabetani/items/b6b5f80c77b92ff8bd9f) + - a ≤ x < b なるx を返すはずであるが、その範囲外の値が返ってくるライブラリ実装が存在することの指摘。 From 51384f5095416ae5a11286ed603d7f69ff145e3c Mon Sep 17 00:00:00 2001 From: lpha Date: Fri, 20 Sep 2024 02:15:47 +0900 Subject: [PATCH 1214/3948] =?UTF-8?q?=E4=B8=8D=E8=87=AA=E7=84=B6=E3=81=AA?= =?UTF-8?q?=E6=97=A5=E6=9C=AC=E8=AA=9E=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/random/gamma_distribution.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/random/gamma_distribution.md b/reference/random/gamma_distribution.md index 89f0e08c1c..cbcf21a88c 100644 --- a/reference/random/gamma_distribution.md +++ b/reference/random/gamma_distribution.md @@ -25,7 +25,7 @@ $$ p(x \mid \alpha, \beta) = \frac{e^{-x/\beta}}{\beta^{\alpha} \cdot \Gamma(\al ガンマ分布は、以下のような用途に使用できる: - 均一に忙しいコールセンターに10回電話をかけ、つながるまでの時間の統計を求める -- 放射性物質の大きなボディが、1000回原子核崩壊するのを観察する +- 放射性物質の大きな塊があるとき、1000回原子核崩壊するまでにかかる時間を観察する テンプレートパラメータは、以下を意味する: From caa8159c251909eb1e20da5620c4acbac1bd1039 Mon Sep 17 00:00:00 2001 From: lpha Date: Fri, 20 Sep 2024 02:16:22 +0900 Subject: [PATCH 1215/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E3=81=AE?= =?UTF-8?q?=E8=AA=A4=E3=82=8A=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp17/selection_statements_with_initializer.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/cpp17/selection_statements_with_initializer.md b/lang/cpp17/selection_statements_with_initializer.md index 5e6a59a6e2..56dc5108b3 100644 --- a/lang/cpp17/selection_statements_with_initializer.md +++ b/lang/cpp17/selection_statements_with_initializer.md @@ -32,7 +32,7 @@ if (status_code c = bar(); c != SUCCESS) { … return c; } else { - //ステータスコード C が成功だったら、何かして、処理を続行する + //ステータスコード c が成功だったら、何かして、処理を続行する … } //この時点で c は無効 @@ -160,7 +160,7 @@ status_code foo() { int n = get_value(); { - status_code C = bar(n); + status_code c = bar(n); if (c != status_code::SUCCESS) { return c; } } { From dee2ab32078f385fb64fecae9cb0b6bcb7f767b7 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 20 Sep 2024 09:10:59 +0900 Subject: [PATCH 1216/3948] =?UTF-8?q?=E7=AE=87=E6=9D=A1=E6=9B=B8=E3=81=8D?= =?UTF-8?q?=E3=81=AE=E8=A1=A8=E7=A4=BA=E5=B4=A9=E3=82=8C=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/random/uniform_real_distribution/op_constructor.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/random/uniform_real_distribution/op_constructor.md b/reference/random/uniform_real_distribution/op_constructor.md index b2dc133096..990146a3db 100644 --- a/reference/random/uniform_real_distribution/op_constructor.md +++ b/reference/random/uniform_real_distribution/op_constructor.md @@ -84,4 +84,4 @@ int main() - [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) - [C++ の std::uniform_real_distribution はあまり信用できない。](https://qiita.com/Nabetani/items/b6b5f80c77b92ff8bd9f) - - a ≤ x < b なるx を返すはずであるが、その範囲外の値が返ってくるライブラリ実装が存在することの指摘。 + - a ≤ x < b なるx を返すはずであるが、その範囲外の値が返ってくるライブラリ実装が存在することの指摘。 From 175916c441664380e59c570bc035641e9c9c03b4 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 24 Sep 2024 13:54:10 +0900 Subject: [PATCH 1217/3948] =?UTF-8?q?multimap::equa=5Frange=20:=20?= =?UTF-8?q?=E3=82=A8=E3=83=A9=E3=83=BC=E5=87=A6=E7=90=86=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/map/multimap/equal_range.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reference/map/multimap/equal_range.md b/reference/map/multimap/equal_range.md index 5c01978a95..e523e87178 100644 --- a/reference/map/multimap/equal_range.md +++ b/reference/map/multimap/equal_range.md @@ -58,6 +58,10 @@ int main() using iterator = decltype(m)::iterator; std::pair ret = m.equal_range("B"); + if (ret.first == m.end()) { + std::cout << "not found" << std::endl; + return 1; + } for (iterator it = ret.first; it != ret.second; ++it) { std::cout << it->first << "," << it->second << std::endl; From 9b64b46833f2c688530df948a370486484bba463 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 24 Sep 2024 14:04:34 +0900 Subject: [PATCH 1218/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE?= =?UTF-8?q?=E9=A3=BE=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/map/multimap/equal_range.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/map/multimap/equal_range.md b/reference/map/multimap/equal_range.md index e523e87178..20825c4ca8 100644 --- a/reference/map/multimap/equal_range.md +++ b/reference/map/multimap/equal_range.md @@ -69,6 +69,7 @@ int main() } ``` * equal_range[color ff0000] +* m.end()[link end.md] ### 出力 ``` From 51c2ae750a38ea11de52b42a90f47b9bf2510a25 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 24 Sep 2024 15:32:54 +0900 Subject: [PATCH 1219/3948] =?UTF-8?q?=20:=20=E5=86=97=E9=95=B7?= =?UTF-8?q?=E3=81=AA=E7=B5=B6=E5=AF=BE=E3=83=AA=E3=83=B3=E3=82=AF=E6=8C=87?= =?UTF-8?q?=E5=AE=9A=E3=82=92=E7=9B=B8=E5=AF=BE=E3=83=AA=E3=83=B3=E3=82=AF?= =?UTF-8?q?=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/map/map/at.md | 4 ++-- reference/map/map/clear.md | 8 ++++---- reference/map/map/count.md | 8 ++++---- reference/map/map/empty.md | 8 ++++---- reference/map/map/erase.md | 6 +++--- reference/map/map/find.md | 12 ++++++------ reference/map/map/insert.md | 2 +- reference/map/map/key_comp.md | 14 +++++++------- reference/map/map/max_size.md | 2 +- reference/map/map/op_assign.md | 4 ++-- reference/map/map/op_at.md | 4 ++-- reference/map/map/op_constructor.md | 6 +++--- reference/map/map/op_destructor.md | 2 +- reference/map/map/op_equal.md | 2 +- reference/map/map/op_greater.md | 2 +- reference/map/map/op_greater_equal.md | 2 +- reference/map/map/op_less_equal.md | 2 +- reference/map/map/op_not_equal.md | 2 +- reference/map/map/size.md | 4 ++-- reference/map/map/value_comp.md | 14 +++++++------- reference/map/multimap/clear.md | 8 ++++---- reference/map/multimap/count.md | 8 ++++---- reference/map/multimap/emplace.md | 4 ++-- reference/map/multimap/emplace_hint.md | 4 ++-- reference/map/multimap/empty.md | 8 ++++---- reference/map/multimap/equal_range.md | 14 +++++++------- reference/map/multimap/erase.md | 6 +++--- reference/map/multimap/find.md | 12 ++++++------ reference/map/multimap/insert.md | 4 ++-- reference/map/multimap/key_comp.md | 10 +++++----- reference/map/multimap/lower_bound.md | 12 ++++++------ reference/map/multimap/max_size.md | 2 +- reference/map/multimap/op_assign.md | 4 ++-- reference/map/multimap/op_constructor.md | 4 ++-- reference/map/multimap/op_destructor.md | 2 +- reference/map/multimap/op_equal.md | 2 +- reference/map/multimap/op_greater.md | 2 +- reference/map/multimap/op_greater_equal.md | 2 +- reference/map/multimap/op_less_equal.md | 2 +- reference/map/multimap/op_not_equal.md | 2 +- reference/map/multimap/size.md | 4 ++-- reference/map/multimap/swap_free.md | 2 +- reference/map/multimap/upper_bound.md | 12 ++++++------ reference/map/multimap/value_comp.md | 10 +++++----- 44 files changed, 124 insertions(+), 124 deletions(-) diff --git a/reference/map/map/at.md b/reference/map/map/at.md index f4816ab8c6..16eccbdf4b 100644 --- a/reference/map/map/at.md +++ b/reference/map/map/at.md @@ -72,8 +72,8 @@ exception std::out_of_range | 名前 | 説明 | |------------------------------------------------|-----------------------| -| [`operator=`](/reference/map/map/op_assign.md) | 代入演算子 | -| [`insert`](/reference/map/map/insert.md) | 要素を挿入する | +| [`operator=`](op_assign.md) | 代入演算子 | +| [`insert`](insert.md) | 要素を挿入する | ## 参照 diff --git a/reference/map/map/clear.md b/reference/map/map/clear.md index 51a5a64362..089a965e11 100644 --- a/reference/map/map/clear.md +++ b/reference/map/map/clear.md @@ -10,7 +10,7 @@ void clear() noexcept; // C++11 ``` ## 概要 -`map` コンテナ内の全ての要素を削除する。それぞれのデストラクタが呼ばれ、コンテナから削除される。[`size()`](/reference/map/map/size.md) は 0 になる。 +`map` コンテナ内の全ての要素を削除する。それぞれのデストラクタが呼ばれ、コンテナから削除される。[`size()`](size.md) は 0 になる。 ## 計算量 @@ -65,9 +65,9 @@ int main() | 名前 | 説明 | |-------------------------------------------------------------------------------------|-----------------------------------------------------| -| [`map::erase`](/reference/map/map/erase.md) | 要素を削除する | -| [`map::size`](/reference/map/map/size.md) | 要素数を取得する | -| [`map::empty`](/reference/map/map/empty.md) | コンテナが空であるかどうかを調べる | +| [`map::erase`](erase.md) | 要素を削除する | +| [`map::size`](size.md) | 要素数を取得する | +| [`map::empty`](empty.md) | コンテナが空であるかどうかを調べる | diff --git a/reference/map/map/count.md b/reference/map/map/count.md index c8664399a9..491e70c984 100644 --- a/reference/map/map/count.md +++ b/reference/map/map/count.md @@ -88,10 +88,10 @@ found | 名前 | 説明 | |-------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------| -| [`map::find`](/reference/map/map/find.md) | 指定したキーで要素を探す | -| [`map::size`](/reference/map/map/size.md) | 要素数を取得する | -| [`map::lower_bound`](/reference/map/map/lower_bound.md) | 与えられた値より小さくない最初の要素へのイテレータを返す | -| [`map::upper_bound`](/reference/map/map/upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | +| [`map::find`](find.md) | 指定したキーで要素を探す | +| [`map::size`](size.md) | 要素数を取得する | +| [`map::lower_bound`](lower_bound.md) | 与えられた値より小さくない最初の要素へのイテレータを返す | +| [`map::upper_bound`](upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | ## 参照 - [N3657 Adding heterogeneous comparison lookup to associative containers (rev 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3657.htm) diff --git a/reference/map/map/empty.md b/reference/map/map/empty.md index e9ec6ba894..20698a29a4 100644 --- a/reference/map/map/empty.md +++ b/reference/map/map/empty.md @@ -12,9 +12,9 @@ bool empty() const noexcept; // C++11 ## 概要 コンテナが空かどうかをテストする。 -`map` コンテナが空([`size()`](/reference/map/map/size.md) が 0)の場合に `true` を返す。 +`map` コンテナが空([`size()`](size.md) が 0)の場合に `true` を返す。 -この関数はコンテナ内のコンテンツを変化させない。コンテンツをクリアするには [`clear()`](/reference/map/map/clear.md) メンバを使う。 +この関数はコンテナ内のコンテンツを変化させない。コンテンツをクリアするには [`clear()`](clear.md) メンバを使う。 ## 戻り値 @@ -56,8 +56,8 @@ int main () | 名前 | 説明| |---------------------------------------------------------------------------------------|-----------------------| -| [`map::insert`](/reference/map/map/insert.md) | 要素を挿入する | -| [`map::(constructor)`](/reference/map/map/op_constructor.md) | コンストラクタ | +| [`map::insert`](insert.md) | 要素を挿入する | +| [`map::(constructor)`](op_constructor.md) | コンストラクタ | ## 参照 diff --git a/reference/map/map/erase.md b/reference/map/map/erase.md index 6ed310bf16..88fd744986 100644 --- a/reference/map/map/erase.md +++ b/reference/map/map/erase.md @@ -175,9 +175,9 @@ int main() | 名前 | 説明| |---------------------------------------------------------------------------------------|--------------------------------------| -| [`map::clear`](/reference/map/map/clear.md) | 全ての要素を削除する | -| [`map::insert`](/reference/map/map/insert.md) | 要素を挿入する | -| [`map::find`](/reference/map/map/find.md) | 指定したキーで要素を探す | +| [`map::clear`](clear.md) | 全ての要素を削除する | +| [`map::insert`](insert.md) | 要素を挿入する | +| [`map::find`](find.md) | 指定したキーで要素を探す | ## 参照 diff --git a/reference/map/map/find.md b/reference/map/map/find.md index 10e96c93a3..fe6b545b2d 100644 --- a/reference/map/map/find.md +++ b/reference/map/map/find.md @@ -28,12 +28,12 @@ const_iterator find(const K& x) const; // (4) C++14 ## 戻り値 -- (1), (3) : `x`と等価なキーの要素が見つかった場合は、見つかった要素へのイテレータを返す。そうでない場合は、 [`end()`](/reference/map/map/end.md) を返す。 -- (2), (4) : `key_compare`型の関数オブジェクトを`c`、コンテナ内の各要素が持つキーを`k`として、キーが等価か判定する式`!c(k, x) && !c(x, k)`が`true`となる要素へのイテレータを返す。そのような要素がない場合は、[`end()`](/reference/map/map/end.md) を返す。 +- (1), (3) : `x`と等価なキーの要素が見つかった場合は、見つかった要素へのイテレータを返す。そうでない場合は、 [`end()`](end.md) を返す。 +- (2), (4) : `key_compare`型の関数オブジェクトを`c`、コンテナ内の各要素が持つキーを`k`として、キーが等価か判定する式`!c(k, x) && !c(x, k)`が`true`となる要素へのイテレータを返す。そのような要素がない場合は、[`end()`](end.md) を返す。 ## 計算量 -[`size`](/reference/map/map/size.md) について対数時間。 +[`size`](size.md) について対数時間。 ## 備考 @@ -95,9 +95,9 @@ int main() | 名前 | 説明| |-------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------| -| [`map::count`](/reference/map/map/count.md) | 指定したキーにマッチする要素の数を返す | -| [`map::lower_bound`](/reference/map/map/lower_bound.md) | 与えられた値より小さくない要素へのイテレータを返す | -| [`map::upper_bound`](/reference/map/map/upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | +| [`map::count`](count.md) | 指定したキーにマッチする要素の数を返す | +| [`map::lower_bound`](lower_bound.md) | 与えられた値より小さくない要素へのイテレータを返す | +| [`map::upper_bound`](upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | ## 参照 diff --git a/reference/map/map/insert.md b/reference/map/map/insert.md index b8c44319b8..ab50a09df4 100644 --- a/reference/map/map/insert.md +++ b/reference/map/map/insert.md @@ -93,7 +93,7 @@ iterator insert(const_iterator hint, node_type&& nh); // (10) C++17 - 挿入された場合には、新しく挿入された要素を指すイテレータを返す。 - 挿入されなかった場合には、`x`のキーと等価のキーを持つ要素へのイテレータを返す。 - (7), (8) : なし -- (9) : 戻り値としては、[`insert_return_type`](/reference/map/map.md)を返す。`insert_return_type`のイテレータ型メンバ変数`position`、`bool`型メンバ変数`inserted`に格納される値は(1), (2)のものと同じ情報である。`nh`が空の場合は、`position`は終端イテレータである。`node_type`型メンバ変数`node`には、 +- (9) : 戻り値としては、[`insert_return_type`](map.md)を返す。`insert_return_type`のイテレータ型メンバ変数`position`、`bool`型メンバ変数`inserted`に格納される値は(1), (2)のものと同じ情報である。`nh`が空の場合は、`position`は終端イテレータである。`node_type`型メンバ変数`node`には、 - 挿入された場合には、空の[ノードハンドル](/reference/node_handle/node_handle.md)。 - 挿入されなかった場合には、`nh`の値である。 - (10) : `nh`が空の場合、`(*this).end()`を返す。そうではない場合、`nh`と等価のキーの要素を指すイテレータを常に返す。 diff --git a/reference/map/map/key_comp.md b/reference/map/map/key_comp.md index cb6a0c063c..d0f784d0da 100644 --- a/reference/map/map/key_comp.md +++ b/reference/map/map/key_comp.md @@ -51,10 +51,10 @@ int main() ## 関連項目 -| 名前 | 説明 | -|----------------------------------------------------|----------------------------------------------------------| -| [`value_comp`](/reference/map/map/value_comp.md) | 要素比較用の関数オブジェクトを返す | -| [`find`](/reference/map/map/find.md) | 指定したキーで要素を探す | -| [`count`](/reference/map/map/count.md) | 指定したキーにマッチする要素の数を返す | -| [`lower_bound`](/reference/map/map/lower_bound.md) | 与えられた値より小さく無い最初の要素へのイテレータを返す | -| [`upper_bound`](/reference/map/map/upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | +| 名前 | 説明 | +|---------------------------------|----------------------------------------------------------| +| [`value_comp`](value_comp.md) | 要素比較用の関数オブジェクトを返す | +| [`find`](map/find.md) | 指定したキーで要素を探す | +| [`count`](count.md) | 指定したキーにマッチする要素の数を返す | +| [`lower_bound`](lower_bound.md) | 与えられた値より小さく無い最初の要素へのイテレータを返す | +| [`upper_bound`](upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | diff --git a/reference/map/map/max_size.md b/reference/map/map/max_size.md index 31969994b8..74aea5418b 100644 --- a/reference/map/map/max_size.md +++ b/reference/map/map/max_size.md @@ -54,6 +54,6 @@ int main () ## 関連項目 | 名前 | 説明 | |-----------------------------------------------------------------------------------|--------------------------| -| [`size`](/reference/map/map/size.md) | 要素数を取得する | +| [`size`](size.md) | 要素数を取得する | diff --git a/reference/map/map/op_assign.md b/reference/map/map/op_assign.md index f7cca0dade..0ba7ea7340 100644 --- a/reference/map/map/op_assign.md +++ b/reference/map/map/op_assign.md @@ -87,8 +87,8 @@ Size of m2: 5 | 名前 | 説明 | |---------------------------------------------------------------------------------------|-----------------------| -| [`insert`](/reference/map/map/insert.md) | 要素を挿入する | -| [`map`](/reference/map/map/op_constructor.md) | コンストラクタ | +| [`insert`](insert.md) | 要素を挿入する | +| [`map::(constructor)`](op_constructor.md) | コンストラクタ | ## 参照 diff --git a/reference/map/map/op_at.md b/reference/map/map/op_at.md index 340d961d12..99d6e53ee8 100644 --- a/reference/map/map/op_at.md +++ b/reference/map/map/op_at.md @@ -52,7 +52,7 @@ a | 名前 | 説明 | |------------------------------------------------|-----------------------| -| [`operator=`](/reference/map/map/op_assign.md) | 代入演算子 | -| [`insert`](/reference/map/map/insert.md) | 要素を挿入する | +| [`operator=`](op_assign.md) | 代入演算子 | +| [`insert`](insert.md) | 要素を挿入する | diff --git a/reference/map/map/op_constructor.md b/reference/map/map/op_constructor.md index a6a69716af..1ff4175f9b 100644 --- a/reference/map/map/op_constructor.md +++ b/reference/map/map/op_constructor.md @@ -79,7 +79,7 @@ map(from_range_t, R&& rg, - (4)、(5) `N =` [`distance`](../../iterator/distance.md)`(first, last)` とすると、範囲 `[first, last)` が比較オブジェクト `comp` によって既にソート済みである場合は `N` に比例、そうでなければ `N log N` に比例 - (6)、(7) `x.`[`size`](size.md)`()` に対して線形時間 - (8) 定数時間 -- (9) 定数時間。但し、`alloc == y.`[`get_allocator`](/reference/map/map/get_allocator.md)`()` でなければ `y.`[`size`](size.md)`()` に対して線形時間 +- (9) 定数時間。但し、`alloc == y.`[`get_allocator`](get_allocator.md)`()` でなければ `y.`[`size`](size.md)`()` に対して線形時間 - (10)、(11) `N = init.`[`size`](../../initializer_list/initializer_list/size.md)`()` とすると、範囲 `[init.`[`begin`](../../initializer_list/initializer_list/begin.md)`(), init.`[`end`](../../initializer_list/initializer_list/end.md)`())` が比較オブジェクト `comp` によって既にソート済みである場合は `N` に比例、そうでなければ `N log N` に比例 - (12)、(13) `N =` [`ranges::distance`](../../iterator/ranges_distance.md)`(rg)` とすると、`rg` が比較オブジェクト `comp` によって既にソート済みである場合は `N` に比例、そうでなければ `N log N` に比例 @@ -156,8 +156,8 @@ Size of c2: 2 | 名前 | 説明 | |---------------------------------------------------------------------------------------------|-----------------------| -| [`operator=`](/reference/map/map/op_assign.md) | 代入演算子 | -| [`insert`](/reference/map/map/insert.md) | 要素を挿入する | +| [`operator=`](op_assign.md) | 代入演算子 | +| [`insert`](insert.md) | 要素を挿入する | ## 参照 diff --git a/reference/map/map/op_destructor.md b/reference/map/map/op_destructor.md index 92e8754eec..2c7e10cda0 100644 --- a/reference/map/map/op_destructor.md +++ b/reference/map/map/op_destructor.md @@ -13,6 +13,6 @@ ## 計算量 -[`size()`](/reference/map/map/size.md) に対して線形時間(デストラクタ呼び出し) +[`size()`](size.md) に対して線形時間(デストラクタ呼び出し) diff --git a/reference/map/map/op_equal.md b/reference/map/map/op_equal.md index b308793eaf..3b1729ec33 100644 --- a/reference/map/map/op_equal.md +++ b/reference/map/map/op_equal.md @@ -22,7 +22,7 @@ namespace std { ## 計算量 -[`size()`](/reference/map/map/size.md) に対して線形時間。ただし、`x`と`y`のサイズが異なる場合は定数時間。 +[`size()`](size.md) に対して線形時間。ただし、`x`と`y`のサイズが異なる場合は定数時間。 ## 備考 diff --git a/reference/map/map/op_greater.md b/reference/map/map/op_greater.md index 99bcbd3f09..e370347afb 100644 --- a/reference/map/map/op_greater.md +++ b/reference/map/map/op_greater.md @@ -27,7 +27,7 @@ namespace std { ## 計算量 -[`size`](/reference/map/map/size.md) に対して線形時間。 +[`size`](size.md) に対して線形時間。 ## 例 diff --git a/reference/map/map/op_greater_equal.md b/reference/map/map/op_greater_equal.md index d266e37719..d5b1df4b9a 100644 --- a/reference/map/map/op_greater_equal.md +++ b/reference/map/map/op_greater_equal.md @@ -27,7 +27,7 @@ namespace std { ## 計算量 -[`size`](/reference/map/map/size.md) に対して線形時間。 +[`size`](size.md) に対して線形時間。 ## 例 diff --git a/reference/map/map/op_less_equal.md b/reference/map/map/op_less_equal.md index d9914a4319..4c21a10abc 100644 --- a/reference/map/map/op_less_equal.md +++ b/reference/map/map/op_less_equal.md @@ -27,7 +27,7 @@ namespace std { ## 計算量 -[`size`](/reference/map/map/size.md) に対して線形時間。 +[`size`](size.md) に対して線形時間。 ## 例 diff --git a/reference/map/map/op_not_equal.md b/reference/map/map/op_not_equal.md index b667658034..b30d6da0a7 100644 --- a/reference/map/map/op_not_equal.md +++ b/reference/map/map/op_not_equal.md @@ -27,7 +27,7 @@ namespace std { ## 計算量 -[`size()`](/reference/map/map/size.md) に対して線形時間。ただし、`x`と`y`のサイズが異なる場合は定数時間。 +[`size()`](size.md) に対して線形時間。ただし、`x`と`y`のサイズが異なる場合は定数時間。 ## 例 diff --git a/reference/map/map/size.md b/reference/map/map/size.md index dbd2e09e3b..9031553d9b 100644 --- a/reference/map/map/size.md +++ b/reference/map/map/size.md @@ -67,7 +67,7 @@ int main () | 名前 | 説明| |-------------------------------------------------------------------------------------------|-----------------------------------------------------| -| [`max_size`](/reference/map/map/max_size.md) | 格納可能な最大の要素数を取得する | -| [`empty`](/reference/map/map/empty.md) | コンテナが空であるかどうかを調べる | +| [`max_size`](max_size.md) | 格納可能な最大の要素数を取得する | +| [`empty`](empty.md) | コンテナが空であるかどうかを調べる | diff --git a/reference/map/map/value_comp.md b/reference/map/map/value_comp.md index 09140fe00c..41311abb3b 100644 --- a/reference/map/map/value_comp.md +++ b/reference/map/map/value_comp.md @@ -58,10 +58,10 @@ int main() ## 関連項目 -| 名前 | 説明 | -|----------------------------------------------------|----------------------------------------------------------| -| [`key_comp`](/reference/map/map/key_comp.md) | キー比較用の関数オブジェクトを返す | -| [`find`](/reference/map/map/find.md) | 指定したキーで要素を探す | -| [`count`](/reference/map/map/count.md) | 指定したキーにマッチする要素の数を返す | -| [`lower_bound`](/reference/map/map/lower_bound.md) | 与えられた値より小さくない最初の要素へのイテレータを返す | -| [`upper_bound`](/reference/map/map/upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | +| 名前 | 説明 | +|---------------------------------|----------------------------------------------------------| +| [`key_comp`](key_comp.md) | キー比較用の関数オブジェクトを返す | +| [`find`](find.md) | 指定したキーで要素を探す | +| [`count`](count.md) | 指定したキーにマッチする要素の数を返す | +| [`lower_bound`](lower_bound.md) | 与えられた値より小さくない最初の要素へのイテレータを返す | +| [`upper_bound`](upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | diff --git a/reference/map/multimap/clear.md b/reference/map/multimap/clear.md index 539894179a..3abc71a00f 100644 --- a/reference/map/multimap/clear.md +++ b/reference/map/multimap/clear.md @@ -10,7 +10,7 @@ void clear() noexcept; // C++11 ``` ## 概要 -`multimap` コンテナ内の全ての要素を削除する。それぞれのデストラクタが呼ばれ、コンテナから削除される。[`size()`](/reference/map/multimap/size.md) は 0 になる。 +`multimap` コンテナ内の全ての要素を削除する。それぞれのデストラクタが呼ばれ、コンテナから削除される。[`size()`](size.md) は 0 になる。 ## 計算量 @@ -66,9 +66,9 @@ int main() | 名前 | 説明 | |-------------------------------------------------------------------------------------|-----------------------------------------------------| -| [`multimap::erase`](/reference/map/multimap/erase.md) | 要素を削除する | -| [`multimap::size`](/reference/map/multimap/size.md) | 要素数を取得する | -| [`multimap::empty`](/reference/map/multimap/empty.md) | コンテナが空であるかどうかを調べる | +| [`multimap::erase`](erase.md) | 要素を削除する | +| [`multimap::size`](size.md) | 要素数を取得する | +| [`multimap::empty`](empty.md) | コンテナが空であるかどうかを調べる | diff --git a/reference/map/multimap/count.md b/reference/map/multimap/count.md index 1a0c1aec0f..25455b7310 100644 --- a/reference/map/multimap/count.md +++ b/reference/map/multimap/count.md @@ -81,10 +81,10 @@ int main() | 名前 | 説明 | |-------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------| -| [`multimap::find`](/reference/map/multimap/find.md) | 指定したキーで要素を探す | -| [`multimap::size`](/reference/map/multimap/size.md) | 要素数を取得する | -| [`multimap::lower_bound`](/reference/map/multimap/lower_bound.md) | 与えられた値より小さくない最初の要素へのイテレータを返す | -| [`multimap::upper_bound`](/reference/map/multimap/upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | +| [`multimap::find`](find.md) | 指定したキーで要素を探す | +| [`multimap::size`](size.md) | 要素数を取得する | +| [`multimap::lower_bound`](lower_bound.md) | 与えられた値より小さくない最初の要素へのイテレータを返す | +| [`multimap::upper_bound`](upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | ## 参照 diff --git a/reference/map/multimap/emplace.md b/reference/map/multimap/emplace.md index 97f1392123..08636a76c3 100644 --- a/reference/map/multimap/emplace.md +++ b/reference/map/multimap/emplace.md @@ -115,8 +115,8 @@ CCC : (1, 2) | 名前 | 説明 | |---------------------------------------------------------------------------------------------------|----------------------------------------------| -| [`multimap::emplace_hint`](/reference/map/multimap/emplace_hint.md) | ヒントを使って要素を直接構築する | -| [`multimap::insert`](/reference/map/multimap/insert.md) | 要素を挿入する | +| [`multimap::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | +| [`multimap::insert`](insert.md) | 要素を挿入する | ## 参照 diff --git a/reference/map/multimap/emplace_hint.md b/reference/map/multimap/emplace_hint.md index 5d23eb921e..159c6949c8 100644 --- a/reference/map/multimap/emplace_hint.md +++ b/reference/map/multimap/emplace_hint.md @@ -81,8 +81,8 @@ int main() | 名前 | 説明 | |-----------------------------------------------------------------------------------------|-----------------------------| -| [`multimap::emplace`](/reference/map/multimap/emplace.md) | 要素を直接構築する | -| [`multimap::insert`](/reference/map/multimap/insert.md) | 要素を挿入する | +| [`multimap::emplace`](emplace.md) | 要素を直接構築する | +| [`multimap::insert`](insert.md) | 要素を挿入する | ## 参照 diff --git a/reference/map/multimap/empty.md b/reference/map/multimap/empty.md index 820c10bf05..489dd5834a 100644 --- a/reference/map/multimap/empty.md +++ b/reference/map/multimap/empty.md @@ -12,9 +12,9 @@ bool empty() const noexcept; // C++11 ## 概要 コンテナが空かどうかをテストする。 -`multimap` コンテナが空([`size()`](/reference/map/multimap/size.md) が 0)の場合に `true` を返す。 +`multimap` コンテナが空([`size()`](size.md) が 0)の場合に `true` を返す。 -この関数はコンテナ内のコンテンツを変化させない。コンテンツをクリアするには [`clear()`](/reference/map/multimap/clear.md) メンバを使う。 +この関数はコンテナ内のコンテンツを変化させない。コンテンツをクリアするには [`clear()`](clear.md) メンバを使う。 ## 戻り値 @@ -56,8 +56,8 @@ int main () | 名前 | 説明| |---------------------------------------------------------------------------------------|-----------------------| -| [`multimap::insert`](/reference/map/multimap/insert.md) | 要素を挿入する | -| [`multimap::(constructor)`](/reference/map/multimap/op_constructor.md) | コンストラクタ | +| [`multimap::insert`](insert.md) | 要素を挿入する | +| [`multimap::(constructor)`](op_constructor.md) | コンストラクタ | ## 参照 diff --git a/reference/map/multimap/equal_range.md b/reference/map/multimap/equal_range.md index 20825c4ca8..28fae09998 100644 --- a/reference/map/multimap/equal_range.md +++ b/reference/map/multimap/equal_range.md @@ -22,18 +22,18 @@ pair ## 概要 コンテナ内の、`x` と等しい全てのキー要素を含む範囲の境界を返す。 -もし `x` がコンテナ内のどのキーともマッチしなかった場合、戻り値の範囲は長さ 0 になり、両方のイテレータは `x` より大きく最も近い値を指す。そうでない場合、`x` がコンテナ内の全ての要素よりも大きい場合は [`end`](/reference/map/multimap/end.md) を指す。 +もし `x` がコンテナ内のどのキーともマッチしなかった場合、戻り値の範囲は長さ 0 になり、両方のイテレータは `x` より大きく最も近い値を指す。そうでない場合、`x` がコンテナ内の全ての要素よりも大きい場合は [`end`](end.md) を指す。 - (1), (3) : `key_type`型のキーを受け取り、そのキーと等価なキー要素を全て含むイテレータ範囲を取得する。 - (2), (4) : `key_type`と比較可能な`K`型のキーを受け取り、そのキーと等価なキー要素を全て含むイテレータ範囲を取得する。 ## 戻り値 -この関数は `pair` を返す。ここで `pair::first` は [`lower_bound`](lower_bound.md)`(x)` が返すであろう値と同じ値で範囲の下境界にあたり、`pair::second` は [`upper_bound`](/reference/map/multimap/upper_bound.md)`(x)` が返すであろう値と同じ値で範囲の上境界にあたる。 +この関数は `pair` を返す。ここで `pair::first` は [`lower_bound`](lower_bound.md)`(x)` が返すであろう値と同じ値で範囲の下境界にあたり、`pair::second` は [`upper_bound`](upper_bound.md)`(x)` が返すであろう値と同じ値で範囲の上境界にあたる。 ## 計算量 -[`size`](/reference/map/multimap/size.md) について対数時間。 +[`size`](size.md) について対数時間。 ## 備考 @@ -82,10 +82,10 @@ B,2 | 名前 | 説明 | |-------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------| -| [`multimap::count`](/reference/map/multimap/count.md) | 指定したキーにマッチする要素の数を返す | -| [`multimap::lower_bound`](/reference/map/multimap/lower_bound.md) | 与えられた値より小さくない最初の要素へのイテレータを返す | -| [`multimap::upper_bound`](/reference/map/multimap/upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | -| [`multimap::find`](/reference/map/multimap/find.md) | 指定したキーで要素を探す | +| [`multimap::count`](count.md) | 指定したキーにマッチする要素の数を返す | +| [`multimap::lower_bound`](lower_bound.md) | 与えられた値より小さくない最初の要素へのイテレータを返す | +| [`multimap::upper_bound`](upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | +| [`multimap::find`](find.md) | 指定したキーで要素を探す | ## 参照 diff --git a/reference/map/multimap/erase.md b/reference/map/multimap/erase.md index ce35b4a174..aea7de4822 100644 --- a/reference/map/multimap/erase.md +++ b/reference/map/multimap/erase.md @@ -164,9 +164,9 @@ int main() | 名前 | 説明| |---------------------------------------------------------------------------------------|--------------------------------------| -| [`multimap::clear`](/reference/map/multimap/clear.md) | 全ての要素を削除する | -| [`multimap::insert`](/reference/map/multimap/insert.md) | 要素を挿入する | -| [`multimap::find`](/reference/map/multimap/find.md) | 指定したキーで要素を探す | +| [`multimap::clear`](clear.md) | 全ての要素を削除する | +| [`multimap::insert`](insert.md) | 要素を挿入する | +| [`multimap::find`](find.md) | 指定したキーで要素を探す | ## 参照 diff --git a/reference/map/multimap/find.md b/reference/map/multimap/find.md index 0a89139615..a5f3ee6c10 100644 --- a/reference/map/multimap/find.md +++ b/reference/map/multimap/find.md @@ -28,14 +28,14 @@ const_iterator find(const K& x) const; // (4) C++14 ## 戻り値 -- (1), (3) : `x`と等価なキーの要素が見つかった場合は、見つかった要素へのイテレータを返す。そうでない場合は、 [`end()`](/reference/map/map/end.md) を返す。 -- (2), (4) : `key_compare`型の関数オブジェクトを`c`、コンテナ内の各要素が持つキーを`k`として、キーが等価か判定する式`!c(k, x) && !c(x, k)`が`true`となる要素へのイテレータを返す。そのような要素がない場合は、[`end()`](/reference/map/map/end.md) を返す。 +- (1), (3) : `x`と等価なキーの要素が見つかった場合は、見つかった要素へのイテレータを返す。そうでない場合は、 [`end()`](end.md) を返す。 +- (2), (4) : `key_compare`型の関数オブジェクトを`c`、コンテナ内の各要素が持つキーを`k`として、キーが等価か判定する式`!c(k, x) && !c(x, k)`が`true`となる要素へのイテレータを返す。そのような要素がない場合は、[`end()`](end.md) を返す。 等価となる要素が複数ある場合、そのうちのいずれかの要素へのイテレータを返す。 ## 計算量 -[`size`](/reference/map/multimap/size.md) について対数時間。 +[`size`](size.md) について対数時間。 ## 備考 @@ -97,9 +97,9 @@ int main() | 名前 | 説明| |-------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------| -| [`multimap::count`](/reference/map/multimap/count.md) | 指定したキーにマッチする要素の数を返す | -| [`multimap::lower_bound`](/reference/map/multimap/lower_bound.md) | 与えられた値より小さくない要素へのイテレータを返す | -| [`multimap::upper_bound`](/reference/map/multimap/upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | +| [`multimap::count`](count.md) | 指定したキーにマッチする要素の数を返す | +| [`multimap::lower_bound`](lower_bound.md) | 与えられた値より小さくない要素へのイテレータを返す | +| [`multimap::upper_bound`](upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | ## 参照 diff --git a/reference/map/multimap/insert.md b/reference/map/multimap/insert.md index 61d6150197..a073847669 100644 --- a/reference/map/multimap/insert.md +++ b/reference/map/multimap/insert.md @@ -125,8 +125,8 @@ int main () | 名前 | 説明 | |-------------------------------------------------------------------------------------|--------------------------------------| -| [`multimap::erase`](/reference/map/multimap/erase.md) | 要素を削除する | -| [`multimap::find`](/reference/map/multimap/find.md) | 指定したキーで要素を探す | +| [`multimap::erase`](erase.md) | 要素を削除する | +| [`multimap::find`](find.md) | 指定したキーで要素を探す | ## 参照 diff --git a/reference/map/multimap/key_comp.md b/reference/map/multimap/key_comp.md index b10bcc46a3..969fc29942 100644 --- a/reference/map/multimap/key_comp.md +++ b/reference/map/multimap/key_comp.md @@ -55,10 +55,10 @@ int main() | 名前 | 説明| |-------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------| -| [`value_comp`](/reference/map/multimap/value_comp.md) | 値を比較した結果を返す | -| [`find`](/reference/map/multimap/find.md) | 指定したキーで要素を探す | -| [`count`](/reference/map/multimap/count.md) | 指定したキーにマッチする要素の数を返す | -| [`lower_bound`](/reference/map/multimap/lower_bound.md) | 与えられた値より小さく無い最初の要素へのイテレータを返す | -| [`upper_bound`](/reference/map/multimap/upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | +| [`value_comp`](value_comp.md) | 値を比較した結果を返す | +| [`find`](find.md) | 指定したキーで要素を探す | +| [`count`](count.md) | 指定したキーにマッチする要素の数を返す | +| [`lower_bound`](lower_bound.md) | 与えられた値より小さく無い最初の要素へのイテレータを返す | +| [`upper_bound`](upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | diff --git a/reference/map/multimap/lower_bound.md b/reference/map/multimap/lower_bound.md index 69e3df992b..b6d64904ac 100644 --- a/reference/map/multimap/lower_bound.md +++ b/reference/map/multimap/lower_bound.md @@ -19,7 +19,7 @@ const_iterator lower_bound(const K& x) const; // (4) C++14 ## 概要 `x` を右辺とする `<` 演算が成り立たない最初の要素を指すイテレータを返す(コンテナの比較オブジェクトが使われる)。すなわちこれは `>=` 演算にあたる。 -[`upper_bound()`](/reference/map/multimap/upper_bound.md) とは異なり、このメンバ関数は `x` より大きいだけでなく、`x` と等しい場合であってもその要素へのイテレータを返す。 +[`upper_bound()`](upper_bound.md) とは異なり、このメンバ関数は `x` より大きいだけでなく、`x` と等しい場合であってもその要素へのイテレータを返す。 内部的には `multimap` コンテナ内の全ての要素は常に比較オブジェクトが定義する基準に沿って並んでいるため、この関数が返すいずれかの後に続く全ての要素が `x` より大きいか等しいことに注意。 @@ -33,7 +33,7 @@ const_iterator lower_bound(const K& x) const; // (4) C++14 ## 計算量 -[`size()`](/reference/map/multimap/size.md) について対数時間。 +[`size()`](size.md) について対数時間。 ## 備考 @@ -113,10 +113,10 @@ D,5 | 名前 | 説明 | |-------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------| -| [`upper_bound`](/reference/map/multimap/upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | -| [`equal_range`](/reference/map/multimap/equal_range.md) | 指定したキーにマッチする要素範囲を返す | -| [`find`](/reference/map/multimap/find.md) | 指定したキーで要素を探す | -| [`count`](/reference/map/multimap/count.md) | 指定したキーにマッチする要素の数を返す | +| [`upper_bound`](upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | +| [`equal_range`](equal_range.md) | 指定したキーにマッチする要素範囲を返す | +| [`find`](find.md) | 指定したキーで要素を探す | +| [`count`](count.md) | 指定したキーにマッチする要素の数を返す | ## 参照 diff --git a/reference/map/multimap/max_size.md b/reference/map/multimap/max_size.md index 092052afdc..3a597c7495 100644 --- a/reference/map/multimap/max_size.md +++ b/reference/map/multimap/max_size.md @@ -54,6 +54,6 @@ int main () ## 関連項目 | 名前 | 説明 | |-----------------------------------------------------------------------------------|--------------------------| -| [`size`](/reference/map/multimap/size.md) | 要素数を取得する | +| [`size`](size.md) | 要素数を取得する | diff --git a/reference/map/multimap/op_assign.md b/reference/map/multimap/op_assign.md index e08cd37013..ef804fa1f9 100644 --- a/reference/map/multimap/op_assign.md +++ b/reference/map/multimap/op_assign.md @@ -87,8 +87,8 @@ Size of m2: 6 | 名前 | 説明 | |---------------------------------------------------------------------------------------|-----------------------| -| [`insert`](/reference/map/multimap/insert.md) | 要素を挿入する | -| [`multimap`](/reference/map/multimap/op_constructor.md) | コンストラクタ | +| [`insert`](insert.md) | 要素を挿入する | +| [`multimap`](op_constructor.md) | コンストラクタ | ## 参照 diff --git a/reference/map/multimap/op_constructor.md b/reference/map/multimap/op_constructor.md index 72cfb0496e..b3d68db064 100644 --- a/reference/map/multimap/op_constructor.md +++ b/reference/map/multimap/op_constructor.md @@ -159,8 +159,8 @@ Size of m2: 3 | 名前 | 説明 | |-----------------------------------------------------|----------------| -| [`operator=`](/reference/map/multimap/op_assign.md) | 代入演算子 | -| [`insert`](/reference/map/multimap/insert.md) | 要素を挿入する | +| [`operator=`](op_assign.md) | 代入演算子 | +| [`insert`](insert.md) | 要素を挿入する | ## 参照 diff --git a/reference/map/multimap/op_destructor.md b/reference/map/multimap/op_destructor.md index aa3e989475..5857db5acf 100644 --- a/reference/map/multimap/op_destructor.md +++ b/reference/map/multimap/op_destructor.md @@ -13,6 +13,6 @@ ## 計算量 -[`size()`](/reference/map/multimap/size.md) に対して線形時間(デストラクタ呼び出し) +[`size()`](size.md) に対して線形時間(デストラクタ呼び出し) diff --git a/reference/map/multimap/op_equal.md b/reference/map/multimap/op_equal.md index fc1baff422..f8f925e41f 100644 --- a/reference/map/multimap/op_equal.md +++ b/reference/map/multimap/op_equal.md @@ -22,7 +22,7 @@ namespace std { ## 計算量 -[`size()`](/reference/map/multimap/size.md) に対して線形時間。ただし、`x`と`y`のサイズが異なる場合は定数時間。 +[`size()`](size.md) に対して線形時間。ただし、`x`と`y`のサイズが異なる場合は定数時間。 ## 備考 diff --git a/reference/map/multimap/op_greater.md b/reference/map/multimap/op_greater.md index e094857f67..2cb7f0affb 100644 --- a/reference/map/multimap/op_greater.md +++ b/reference/map/multimap/op_greater.md @@ -27,7 +27,7 @@ namespace std { ## 計算量 -[`size`](/reference/map/multimap/size.md) に対して線形時間。 +[`size`](size.md) に対して線形時間。 ## 例 diff --git a/reference/map/multimap/op_greater_equal.md b/reference/map/multimap/op_greater_equal.md index b4d48fdd0b..14dfafbe9a 100644 --- a/reference/map/multimap/op_greater_equal.md +++ b/reference/map/multimap/op_greater_equal.md @@ -27,7 +27,7 @@ namespace std { ## 計算量 -[`size`](/reference/map/multimap/size.md) に対して線形時間。 +[`size`](size.md) に対して線形時間。 ## 例 diff --git a/reference/map/multimap/op_less_equal.md b/reference/map/multimap/op_less_equal.md index 68e30da139..c3bfc02055 100644 --- a/reference/map/multimap/op_less_equal.md +++ b/reference/map/multimap/op_less_equal.md @@ -27,7 +27,7 @@ namespace std { ## 計算量 -[`size`](/reference/map/multimap/size.md) に対して線形時間。 +[`size`](size.md) に対して線形時間。 ## 例 diff --git a/reference/map/multimap/op_not_equal.md b/reference/map/multimap/op_not_equal.md index 4d9d0dbe84..06603a51bd 100644 --- a/reference/map/multimap/op_not_equal.md +++ b/reference/map/multimap/op_not_equal.md @@ -27,7 +27,7 @@ namespace std { ## 計算量 -[`size()`](/reference/map/multimap/size.md) に対して線形時間。ただし、`x`と`y`のサイズが異なる場合は定数時間。 +[`size()`](size.md) に対して線形時間。ただし、`x`と`y`のサイズが異なる場合は定数時間。 ## 例 diff --git a/reference/map/multimap/size.md b/reference/map/multimap/size.md index 8a95e295dc..5b97140055 100644 --- a/reference/map/multimap/size.md +++ b/reference/map/multimap/size.md @@ -67,7 +67,7 @@ int main () | 名前 | 説明| |-------------------------------------------------------------------------------------------|-----------------------------------------------------| -| [`max_size`](/reference/map/multimap/max_size.md) | 格納可能な最大の要素数を取得する | -| [`empty`](/reference/map/multimap/empty.md) | コンテナが空であるかどうかを調べる | +| [`max_size`](max_size.md) | 格納可能な最大の要素数を取得する | +| [`empty`](empty.md) | コンテナが空であるかどうかを調べる | diff --git a/reference/map/multimap/swap_free.md b/reference/map/multimap/swap_free.md index df9fad8800..3550b7f042 100644 --- a/reference/map/multimap/swap_free.md +++ b/reference/map/multimap/swap_free.md @@ -22,7 +22,7 @@ namespace std { ## 効果 -`x.`[`swap`](/reference/map/multimap/swap.md)`(y);` +`x.`[`swap`](swap.md)`(y);` ## 戻り値 diff --git a/reference/map/multimap/upper_bound.md b/reference/map/multimap/upper_bound.md index 0badba8ad3..c1457d2ccb 100644 --- a/reference/map/multimap/upper_bound.md +++ b/reference/map/multimap/upper_bound.md @@ -19,7 +19,7 @@ const_iterator upper_bound(const K& x) const; // (4) C++14 ## 概要 `x` より大きいキーを持つコンテナ内の最初の要素を指すイテレータを返す(コンテナの比較オブジェクトを使う)。 -[`lower_bound()`](/reference/map/multimap/lower_bound.md) と異なり、このメンバ関数は `x` と等しいときは要素へのイテレータを返さず、それは大きい場合にのみ要素へのイテレータを返す。 +[`lower_bound()`](lower_bound.md) と異なり、このメンバ関数は `x` と等しいときは要素へのイテレータを返さず、それは大きい場合にのみ要素へのイテレータを返す。 内部的に、`multimap` コンテナ内の全ての要素は常に比較オブジェクトで定義された基準に従って並ぶため、この関数が返す値に続く全ての要素は `x` より大きいことに注意。 @@ -33,7 +33,7 @@ const_iterator upper_bound(const K& x) const; // (4) C++14 ## 計算量 -[`size()`](/reference/map/multimap/size.md) について対数時間。 +[`size()`](size.md) について対数時間。 ## 備考 @@ -113,10 +113,10 @@ D,5 | 名前 | 説明 | |-------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------| -| [`lower_bound`](/reference/map/multimap/lower_bound.md) | 与えられた値よりも小さくない最初の要素へのイテレータを返す | -| [`equal_range`](/reference/map/multimap/equal_range.md) | 指定したキーにマッチする要素範囲を返す | -| [`find`](/reference/map/multimap/find.md) | 指定したキーで要素を探す | -| [`count`](/reference/map/multimap/count.md) | 指定したキーにマッチする要素の数を返す | +| [`lower_bound`](lower_bound.md) | 与えられた値よりも小さくない最初の要素へのイテレータを返す | +| [`equal_range`](equal_range.md) | 指定したキーにマッチする要素範囲を返す | +| [`find`](find.md) | 指定したキーで要素を探す | +| [`count`](count.md) | 指定したキーにマッチする要素の数を返す | ## 参照 diff --git a/reference/map/multimap/value_comp.md b/reference/map/multimap/value_comp.md index d1983175ae..4bc00450a4 100644 --- a/reference/map/multimap/value_comp.md +++ b/reference/map/multimap/value_comp.md @@ -61,10 +61,10 @@ int main() | 名前 | 説明| |-------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------| -| [`key_comp`](/reference/map/multimap/key_comp.md) | キーを比較した結果を返す | -| [`find`](/reference/map/multimap/find.md) | 指定したキーで要素を探す | -| [`count`](/reference/map/multimap/count.md) | 指定したキーにマッチする要素の数を返す | -| [`lower_bound`](/reference/map/multimap/lower_bound.md) | 与えられた値より小さくない最初の要素へのイテレータを返す | -| [`upper_bound`](/reference/map/multimap/upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | +| [`key_comp`](key_comp.md) | キーを比較した結果を返す | +| [`find`](find.md) | 指定したキーで要素を探す | +| [`count`](count.md) | 指定したキーにマッチする要素の数を返す | +| [`lower_bound`](lower_bound.md) | 与えられた値より小さくない最初の要素へのイテレータを返す | +| [`upper_bound`](upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | From 2a58e28728e1be271dde61b672746c67b1672a1c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 24 Sep 2024 15:38:19 +0900 Subject: [PATCH 1220/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/map/map/insert.md | 2 +- reference/map/map/key_comp.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/map/map/insert.md b/reference/map/map/insert.md index ab50a09df4..b8c44319b8 100644 --- a/reference/map/map/insert.md +++ b/reference/map/map/insert.md @@ -93,7 +93,7 @@ iterator insert(const_iterator hint, node_type&& nh); // (10) C++17 - 挿入された場合には、新しく挿入された要素を指すイテレータを返す。 - 挿入されなかった場合には、`x`のキーと等価のキーを持つ要素へのイテレータを返す。 - (7), (8) : なし -- (9) : 戻り値としては、[`insert_return_type`](map.md)を返す。`insert_return_type`のイテレータ型メンバ変数`position`、`bool`型メンバ変数`inserted`に格納される値は(1), (2)のものと同じ情報である。`nh`が空の場合は、`position`は終端イテレータである。`node_type`型メンバ変数`node`には、 +- (9) : 戻り値としては、[`insert_return_type`](/reference/map/map.md)を返す。`insert_return_type`のイテレータ型メンバ変数`position`、`bool`型メンバ変数`inserted`に格納される値は(1), (2)のものと同じ情報である。`nh`が空の場合は、`position`は終端イテレータである。`node_type`型メンバ変数`node`には、 - 挿入された場合には、空の[ノードハンドル](/reference/node_handle/node_handle.md)。 - 挿入されなかった場合には、`nh`の値である。 - (10) : `nh`が空の場合、`(*this).end()`を返す。そうではない場合、`nh`と等価のキーの要素を指すイテレータを常に返す。 diff --git a/reference/map/map/key_comp.md b/reference/map/map/key_comp.md index d0f784d0da..d752ac16d2 100644 --- a/reference/map/map/key_comp.md +++ b/reference/map/map/key_comp.md @@ -54,7 +54,7 @@ int main() | 名前 | 説明 | |---------------------------------|----------------------------------------------------------| | [`value_comp`](value_comp.md) | 要素比較用の関数オブジェクトを返す | -| [`find`](map/find.md) | 指定したキーで要素を探す | +| [`find`](find.md) | 指定したキーで要素を探す | | [`count`](count.md) | 指定したキーにマッチする要素の数を返す | | [`lower_bound`](lower_bound.md) | 与えられた値より小さく無い最初の要素へのイテレータを返す | | [`upper_bound`](upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | From e97eeba76a8bcd059b3445d6f0f845c2fd3a1baa Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 24 Sep 2024 17:38:30 +0900 Subject: [PATCH 1221/3948] =?UTF-8?q?chrono=E3=81=AEformat=20:=20=E4=B8=96?= =?UTF-8?q?=E7=B4=80=E3=81=AE=E3=83=AD=E3=82=B1=E3=83=BC=E3=83=AB=E8=A1=A8?= =?UTF-8?q?=E7=8F=BE=E3=81=A7=E5=85=83=E5=8F=B7=E3=81=AF=E3=81=84=E3=81=BE?= =?UTF-8?q?=E3=81=AE=E3=81=A8=E3=81=93=E3=82=8D=E6=89=B1=E3=82=8F=E3=82=8C?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=81=AE=E3=81=A7=E5=89=8A=E9=99=A4=20#1352?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 世紀の例を21から20に修正 サンプルコードを追加 --- reference/chrono/format.md | 54 +++++++++++++++++++++++++++++--------- 1 file changed, 41 insertions(+), 13 deletions(-) diff --git a/reference/chrono/format.md b/reference/chrono/format.md index 09f1d46ef8..4871d08149 100644 --- a/reference/chrono/format.md +++ b/reference/chrono/format.md @@ -44,8 +44,8 @@ chronoライブラリではこれに加え、たとえばデフォルトでは | `%A` | ロケール依存の曜日の完全名。
値に有効な曜日が含まれていない場合、[`std::format_error`](/reference/format/format_error.md)例外を送出する | `"Friday"`, `"金曜日"` | | `%b` | ロケール依存の月の略称。
値に有効な月が含まれていない場合、[`std::format_error`](/reference/format/format_error.md)例外を送出する | `"Apr"`, `"4月"` | | `%B` | ロケール依存の月の完全名。
値に有効な月が含まれていない場合、[`std::format_error`](/reference/format/format_error.md)例外を送出する | `"April"`, `"4月"` | -| `%c` | ロケール依存の日付・時間の表現。改良コマンド`%Ec`を指定すると、異なる表現を出力する | `"Fri Apr 24 17:14:44 2020"`
`"2020年04月24日 17時14分44秒"`
`%Ec`では`"令和02年04月24日 17時14分44秒"` | -| `%C` | 100で切り下げ除算した年 (世紀)。結果が10進数で1桁の場合、先頭に`0`がつく。改良コマンド`%EC`を指定すると、ロケール依存の世紀の異なる表現を出力する | `"21"`
`%EC`では`"令和"` (元号) | +| `%c` | ロケール依存の日付・時間の表現。改良コマンド`%Ec`を指定すると、異なる表現を出力する | `"Fri Apr 24 17:14:44 2020"`
`"2020年04月24日 17時14分44秒"` | +| `%C` | 100で切り下げ除算した年 (世紀)。結果が10進数で1桁の場合、先頭に`0`がつく。改良コマンド`%EC`を指定すると、ロケール依存の世紀の異なる表現を出力する | 2020年では`"20"`) | | `%d` | 10進数での月の日。結果が10進数で1桁の場合、先頭に`0`がつく。改良コマンド`%Od`を指定すると、ロケール依存の異なる表現を出力する | `"24"` | | `%D` | `%m/%d/%y`と等価 | `"04/24/20"` | | `%e` | 10進数での月の日。結果が10進数で1桁の場合、先頭にスペースがつく。改良コマンド`%Oe`を指定すると、ロケール依存の異なる表現を出力する | `" 1"` | @@ -72,10 +72,10 @@ chronoライブラリではこれに加え、たとえばデフォルトでは | `%V` | 10進数でのISO週ベースの週番号。結果が1桁の場合、先頭に`0`がつく。改良コマンド`%OV`を指定すると、ロケール依存の異なる表現を出力する | `"17"` | | `%w` | 10進数での日曜を0とする曜日番号 (0-6)。改良コマンド`%Ow`を指定すると、ロケール依存の異なる表現を出力する | `"5"` | | `%W` | 10進数での年の週番号。年の最初の月曜日が最初の曜日であるとして`01`、同年のそれより前の日は`00`となる。結果が1桁の場合、先頭に`0`がつく。改良コマンド`%OW`を指定すると、ロケール依存の異なる表現を出力する | `"16"` | -| `%x` | ロケール依存の日付表現。改良コマンド`%Ex`を指定すると、ロケール依存の異なる表現が出力される | `"04/24/20"`
`"2020年04月24日"`
`%Ex`では`"令和02年04月24日"` | +| `%x` | ロケール依存の日付表現。改良コマンド`%Ex`を指定すると、ロケール依存の異なる表現が出力される | `"04/24/20"` | | `%X` | ロケール依存の時間表現。改良コマンド`%EX`を指定すると、ロケール依存の異なる表現が出力される | `"17:14:44"`
`"17時14分44秒"` | | `%y` | 10進数での年のうしろ2桁。結果が1桁の場合、先頭に`0`がつく。改良コマンド`%Oy`を指定すると、ロケール依存の異なる表現を出力する。改良コマンド`%Ey`を指定すると、`%EC`からのオフセットとしてロケール依存の異なる表現を出力する。 | `"20"`
`%Ey`では`"02"` | -| `%Y` | 10進数での年。結果が4桁未満の場合、4桁になるよう左が`0`で埋められる。改良コマンド`%EY`を指定すると、ロケール依存の異なる表現の完全な年を出力する | `"2020"`
`%EY`では`"令和02年"` | +| `%Y` | 10進数での年。結果が4桁未満の場合、4桁になるよう左が`0`で埋められる。改良コマンド`%EY`を指定すると、ロケール依存の異なる表現の完全な年を出力する | `"2020"` | | `%z` | ISO 8601フォーマットでのUTCからのオフセット。例として`-0430`はUTCから4時間30分遅れていることを表す。オフセットがゼロの場合は`+0000`が使用される。改良コマンド`%Ez`と`%Oz`を指定すると、時と分の間にコロン (`:`) が挿入される。オフセット情報が利用可能でない場合、[`std::format_error`](/reference/format/format_error.md)例外を送出する | `"+0900"`
`%Ez`では`"+09:00"` | | `%Z` | タイムゾーンの略称。タイムゾーンの略称が利用可能でない場合、[`std::format_error`](/reference/format/format_error.md)例外を送出する | `"JST"` | | `%%` | 文字`%` | `"%"` | @@ -83,30 +83,58 @@ chronoライブラリではこれに加え、たとえばデフォルトでは - 便宜上のリテラルキャスト`STATICALLY-WIDEN`を導入する。`STATICALLY-WIDEN("...")`は、`charT`が`char`である場合は`"..."`、`charT`が`wchar_t`である場合は`L"..."`を意味する。 - [`hh_mm_ss`](hh_mm_ss.md)オブジェクトの[`is_negative()`](hh_mm_ss/is_negative.md)が`true`である場合、出力される文字列の先頭に`STATICALLY-WIDEN("-")`が挿入される +## 例外 +- 指定されたフォーマットフラグに必要な情報が含まれていない場合、[`format_error`](/reference/format/format_error.md)例外が送出される (例として、[`duration`](duration.md)には曜日をフォーマットするために必要な情報が含まれていない) + - ただし、フラグが時刻に関するもの (`%H`, `%I`, `%p`など) である場合、`duration`の特殊化は深夜0時からの経過した時刻として解釈する + + +## 例 ```cpp example #include #include #include + int main() { - const auto now = std::chrono::system_clock::now(); - std::cout << std::format("{:%Y}", now); // => 2021 + auto now = std::chrono::system_clock::now(); // UTC時間の現在日時 + + // 日付を出力 + std::cout << std::format("1. {:%Y年%m月%d日}", now) << std::endl; + + // 時間を出力。 + // 秒単位のtime_pointに変換しないと、小数点以下の秒も出力される + auto now_sec = std::chrono::time_point_cast(now); + std::cout << std::format("2. {:%H時%M分%S秒}", now) << std::endl; + std::cout << std::format("3. {:%H時%M分%S秒}", now_sec) << std::endl; + std::cout << std::format("4. {:%p %I時%M分%S秒}", now_sec) << std::endl; + std::cout << std::format("4. {:%p %I時%M分%S秒}", now_sec) << std::endl; + + // その他要素 + std::cout << std::format("6. {:%C}", now) << std::endl; // 世紀 (100で割って切り下げた値) + std::cout << std::format("7. {:%a}", now) << std::endl; // 曜日の略称 + std::cout << std::format("8. {:%A}", now) << std::endl; // 曜日の完全名 } ``` -## 例外 -- 指定されたフォーマットフラグに必要な情報が含まれていない場合、[`format_error`](/reference/format/format_error.md)例外が送出される (例として、[`duration`](duration.md)には曜日をフォーマットするために必要な情報が含まれていない) - - ただし、フラグが時刻に関するもの (`%H`, `%I`, `%p`など) である場合、`duration`の特殊化は深夜0時からの経過した時刻として解釈する - +### 出力例 +``` +1. 2024年09月24日 +2. 08時27分28.1822610秒 +3. 08時27分28秒 +4. AM 08時27分28秒 +6. 20 +7. Tue +8. Tuesday +``` ## バージョン ### 言語 - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 9.0 [mark noimpl] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] +- [Clang](/implementation.md#clang): 17 [mark mark verified] +- [GCC](/implementation.md#gcc): 13 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 From 5d13ce90b81a3f49bec9aab0c6284ef829ae5edc Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 24 Sep 2024 17:40:08 +0900 Subject: [PATCH 1222/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE?= =?UTF-8?q?=E9=A3=BE=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/chrono/format.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reference/chrono/format.md b/reference/chrono/format.md index 4871d08149..491b7d90ca 100644 --- a/reference/chrono/format.md +++ b/reference/chrono/format.md @@ -115,6 +115,9 @@ int main() std::cout << std::format("8. {:%A}", now) << std::endl; // 曜日の完全名 } ``` +* std::chrono::system_clock[link /reference/chrono/system_clock.md] +* now()[link /reference/chrono/system_clock/now.md] +* std::chrono::time_point_cast[link /reference/chrono/time_point_cast.md] ### 出力例 ``` From a11497563df78a1a84fb734aaa2dbe77bb29587f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 30 Sep 2024 17:29:42 +0900 Subject: [PATCH 1223/3948] =?UTF-8?q?=E7=94=A8=E8=AA=9E=E5=AE=9A=E7=BE=A9?= =?UTF-8?q?=20:=20erroneous=20behavior=E3=81=AE=E6=A6=82=E8=A6=81=E3=82=92?= =?UTF-8?q?=E5=AE=9F=E6=85=8B=E3=81=AB=E5=90=88=E3=81=86=E3=82=88=E3=81=86?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Kazutoshi SATODA --- GLOBAL_DEFINED_WORDS.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GLOBAL_DEFINED_WORDS.json b/GLOBAL_DEFINED_WORDS.json index c87f83a9d2..2cbc13a804 100644 --- a/GLOBAL_DEFINED_WORDS.json +++ b/GLOBAL_DEFINED_WORDS.json @@ -25,7 +25,7 @@ "未規定": { "redirect": "未規定の動作", "yomi": "みきてい" }, "誤り起因動作": { "yomi": "あやまりきいんどうさ", - "desc": "誤った操作に対する結果が明確に定義された動作。erroneous behavior (EB)。処理系によって診断や異常終了を実行することが許可されるが、処理が続行する場合もある" + "desc": "未定義動作ではないが、誤ったプログラムの結果とされる動作。erroneous behavior (EB)。処理系によって診断や異常終了を実行することが許可されるが、処理が続行する場合もある" }, "処理系定義の動作": { "link": "/implementation-compliance.md#dfn-implementation-defined-behavior", From 7f7759e676d1db0ca5e663937e8e71562a514ecc Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 30 Sep 2024 17:30:34 +0900 Subject: [PATCH 1224/3948] =?UTF-8?q?C++26=20=E6=9C=AA=E5=88=9D=E6=9C=9F?= =?UTF-8?q?=E5=8C=96=E5=A4=89=E6=95=B0=E3=81=AE=E8=AA=AD=E3=81=BF=E5=8F=96?= =?UTF-8?q?=E3=82=8A=20:=20=E6=A6=82=E8=A6=81=E3=82=92=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Kazutoshi SATODA --- lang/cpp26/erroneous_behavior_for_uninitialized_reads.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md index 986d325010..b373cd622c 100644 --- a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md +++ b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md @@ -10,7 +10,7 @@ ## 概要 -これまで、未初期化変数 (デフォルト初期化された変数) の読み取りは未定義動作として扱われていた。C++26では、この操作が安全上のリスクをもたらさないものとして、「誤り起因動作 (erroneous behavior; 通称 EB)」を新設してそれに割り当てることとした。 +C++23までは、未初期化変数 (デフォルト初期化された変数) の読み取りは未定義動作として扱われていた。C++26では、この未定義動作による安全上のリスクを低減するため、「誤り起因動作 (erroneous behavior; 通称 EB)」を新設してその多くに割り当てることとした。 この変更の対象は、デフォルト初期化されたスカラ型 (`void`以外の組み込み型) 変数の読み取りであり、以下のようなケースである。 From 6b0e3d7c690889610c9d07cf855155cc44140091 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 30 Sep 2024 17:39:10 +0900 Subject: [PATCH 1225/3948] =?UTF-8?q?C++26=20=E6=9C=AA=E5=88=9D=E6=9C=9F?= =?UTF-8?q?=E5=8C=96=E5=A4=89=E6=95=B0=E3=81=AE=E8=AA=AD=E3=81=BF=E5=8F=96?= =?UTF-8?q?=E3=82=8A=20:=20assert=E7=B5=90=E6=9E=9C=E3=82=92=E6=98=8E?= =?UTF-8?q?=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26/erroneous_behavior_for_uninitialized_reads.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md index b373cd622c..9f8b11274c 100644 --- a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md +++ b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md @@ -57,7 +57,7 @@ int g(bool b) { unsigned char c; unsigned char d = c; // 誤り起因動作ではない。dは誤り起因動作を引き起こす未初期化値をもつ - assert(c == d); // どちらの変数も整数昇格され誤り起因動作となる + assert(c == d); // 常に真、誤り起因動作 (整数昇格) int e = d; // 誤り起因動作 (型変換) return b ? d : 0; // bがtrueの場合に誤り起因動作 @@ -70,10 +70,11 @@ int main() { int e2 = d1; // 誤り起因動作 // 処理が続行した場合… - assert(e1 == e2); // OK。誤り起因動作の結果で生成された値 (e1とe2) は、 + assert(e1 == e2); // 常に真、誤り起因動作ではない。 + // 誤り起因動作の結果で生成された値 (e1とe2) は、 // 誤り起因動作を引き起こす値とはみなされない - assert(e1 == d1); // 誤り起因動作 - assert(e2 == d1); // 誤り起因動作 + assert(e1 == d1); // 常に真、誤り起因動作 + assert(e2 == d1); // 常に真、誤り起因動作 // 誤り起因動作ではないが // d2は誤り起因動作を引き起こす未初期化値をもつ From 2a4fe0e98448cff506fa43ef922ab2e4e44ec9ba Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 30 Sep 2024 17:50:56 +0900 Subject: [PATCH 1226/3948] =?UTF-8?q?C++26=20=E6=9C=AA=E5=88=9D=E6=9C=9F?= =?UTF-8?q?=E5=8C=96=E5=A4=89=E6=95=B0=E3=81=AE=E8=AA=AD=E3=81=BF=E5=8F=96?= =?UTF-8?q?=E3=82=8A=20:=20=E5=8B=95=E7=9A=84=E7=A2=BA=E4=BF=9D=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=81=9F=E3=82=AA=E3=83=96=E3=82=B8=E3=82=A7=E3=82=AF?= =?UTF-8?q?=E3=83=88=E3=81=8C=E5=AF=BE=E8=B1=A1=E5=A4=96=E3=81=A7=E3=81=82?= =?UTF-8?q?=E3=82=8B=E3=81=93=E3=81=A8=E3=82=92=E8=A8=98=E8=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26/erroneous_behavior_for_uninitialized_reads.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md index 9f8b11274c..76c953600e 100644 --- a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md +++ b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md @@ -12,8 +12,6 @@ ## 概要 C++23までは、未初期化変数 (デフォルト初期化された変数) の読み取りは未定義動作として扱われていた。C++26では、この未定義動作による安全上のリスクを低減するため、「誤り起因動作 (erroneous behavior; 通称 EB)」を新設してその多くに割り当てることとした。 -この変更の対象は、デフォルト初期化されたスカラ型 (`void`以外の組み込み型) 変数の読み取りであり、以下のようなケースである。 - ```cpp example // C++23 void f(int) {} @@ -47,7 +45,10 @@ int main() { ## 仕様 - 式が評価された結果として不定値が生成された場合、未定義動作を引き起こす - 式が評価された結果として未初期化値が生成された場合、誤り起因動作を引き起こす - - ただし、`unsigned char`もしくは[`std::byte`](/reference/cstddef/byte.md)型に関しては、未初期化値をもつ変数を同じ型の変数に代入するだけでは誤り起因動作にならず、値の参照や型変換がされることで誤り起因動作を引き起こす + - 未初期価値が生成されることで誤り起因動作を引き起こす対象は以下: + - 自動記憶域期間をもつオブジェクトのうち、`void`以外のスカラ型 + - 注意 : 動的記憶域期間をもつオブジェクトは対象外 + - ただし、`unsigned char`もしくは[`std::byte`](/reference/cstddef/byte.md)型に関しては、未初期化値をもつ変数を同じ型の変数に代入するだけでは誤り起因動作にならず、値の参照や型変換がされることで誤り起因動作を引き起こす - 誤り起因動作が引き起こされた結果値は、後続の処理では誤り起因動作を引き起こす値とはみなされない ```cpp example From 30cfb4e7851be5968e72953fad20763f8321bd74 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 7 Oct 2024 17:26:20 +0900 Subject: [PATCH 1227/3948] =?UTF-8?q?erroneous=20behavior/value=E3=82=92?= =?UTF-8?q?=E4=B8=80=E6=97=A6=E8=A8=B3=E3=81=95=E3=81=AA=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_DEFINED_WORDS.json | 4 +- implementation-status.md | 2 +- lang/cpp26.md | 2 +- ...oneous_behavior_for_uninitialized_reads.md | 58 +++++++++---------- 4 files changed, 33 insertions(+), 33 deletions(-) diff --git a/GLOBAL_DEFINED_WORDS.json b/GLOBAL_DEFINED_WORDS.json index 2cbc13a804..f78301d146 100644 --- a/GLOBAL_DEFINED_WORDS.json +++ b/GLOBAL_DEFINED_WORDS.json @@ -23,8 +23,8 @@ }, "未規定動作": { "redirect": "未規定の動作", "yomi": "みきていどうさ" }, "未規定": { "redirect": "未規定の動作", "yomi": "みきてい" }, - "誤り起因動作": { - "yomi": "あやまりきいんどうさ", + "「erroneous behavior」": { + "yomi": "えらーなうすべへいびあ", "desc": "未定義動作ではないが、誤ったプログラムの結果とされる動作。erroneous behavior (EB)。処理系によって診断や異常終了を実行することが許可されるが、処理が続行する場合もある" }, "処理系定義の動作": { diff --git a/implementation-status.md b/implementation-status.md index d26f038dc0..7efadc50eb 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -305,7 +305,7 @@ | P0609R3: [構造化束縛への属性を許可](/lang/cpp26/attributes_for_structured_bindings.md) | `auto [a, b [[maybe_unused]], c] = f();`のように構造化束縛の要素に対して属性を付加できるようにする | 15 | 19 | | | | P3034R1: [モジュール宣言でのモジュール名のマクロ展開を禁止する](/lang/cpp26/module_declarations_shouldnt_be_macros.md.nolink) | `export module MACRO_NAME;`を禁止 | | | | | | P2809R3: [自明な無限ループは未定義動作ではないと規定](/lang/cpp26/trivial_infinite_loops_are_not_undefined_behavior.md.nolink) | 並行プログラムの進行保証などを考慮して無限ループを未定義動作ではないものとする | 14 | 19 | | | -| P2795R5: [未初期化変数の読み取りを誤り起因動作とする](/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md) | 初期化されていない自動変数の読み取りの安全性を規定する | | | | | +| P2795R5: [未初期化変数の読み取りを"erroneous behavior"とする](/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md) | 初期化されていない自動変数の読み取りの安全性を規定する | | | | | | P2573R2: [関数宣言を削除する理由を指定できるようにする](/lang/cpp26/delete_reason.md) | `f() = delete("reason");` | 15 | 19 | | | | P2893R3: [可変引数テンプレートで`friend`宣言をできるようにする](/lang/cpp26/variadic_friends.md.nolink) | クラステンプレートの可変引数テンプレートでまとめて`friend`宣言できるようにする | 15 | | | | | P2747R2: [`constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md.nolink) | 定数式の文脈での配置`new`を許可 | | | | | diff --git a/lang/cpp26.md b/lang/cpp26.md index 0171014cf1..fff209b541 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -17,7 +17,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | [不完全型へのポインタに対する`delete`を不適格とする](/lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md.nolink) | 未定義動作となる操作をコンパイルエラーとする | | [返却された左辺値から暗黙変換された一時オブジェクトが参照に束縛されることを禁止する](/lang/cpp26/disallow_binding_a_returned_glvalue_to_a_temporary.md.nolink) | 寿命切れの変数によって引き起こされるバグを防止する | | [要素数不明の配列を集成体初期化する規則を明確化](/lang/cpp26/clarifying_rules_for_brace_elision_in_aggregate_initialization.md.nolink) | 配列要素の集成体初期化で`{}`が省略された場合の矛盾していた規定を修正 | -| [未初期化変数の読み取りを誤り起因動作とする](/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md) | 初期化されていない自動変数の読み取りの安全性を規定する | +| [未初期化変数の読み取りを「erroneous behavior」とする](/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md) | 初期化されていない自動変数の読み取りの安全性を規定する | ### 文字列 diff --git a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md index 76c953600e..70c3141bb2 100644 --- a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md +++ b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md @@ -1,4 +1,4 @@ -# 未初期化変数の読み取りを誤り起因動作とする [P2795R5] +# 未初期化変数の読み取りを「erroneous behavior」とする [P2795R5] * cpp26[meta cpp] @@ -10,7 +10,7 @@ ## 概要 -C++23までは、未初期化変数 (デフォルト初期化された変数) の読み取りは未定義動作として扱われていた。C++26では、この未定義動作による安全上のリスクを低減するため、「誤り起因動作 (erroneous behavior; 通称 EB)」を新設してその多くに割り当てることとした。 +C++23までは、未初期化変数 (デフォルト初期化された変数) の読み取りは未定義動作として扱われていた。C++26では、この未定義動作による安全上のリスクを低減するため、「「erroneous behavior」 (erroneous behavior; 通称 EB)」を新設してその多くに割り当てることとした。 ```cpp example // C++23 @@ -24,7 +24,7 @@ int main() { 未初期化の値は、コンパイラやターゲット環境によって定義された固定値である。コンパイラにはこの誤りを診断することが許可され、推奨されているが、誤りを無視して有効な読み取りとして扱うことも許可されている。このコードは誤りではあるが、未定義動作に関連する結果に遭遇するリスクはない。 -誤り起因動作は未定義動作とはちがって、明確に定義された動作をするがコードとして正しくない、ということを規定するものであり、処理系に対して有用な診断を提供するものである。 +「erroneous behavior」は未定義動作とはちがって、明確に定義された動作をするがコードとして正しくない、ということを規定するものであり、処理系に対して有用な診断を提供するものである。 C++26では、不定値で初期化されることを明確に指示する`[[indeterminate]]`属性も導入され、以下のような動作となる: @@ -33,10 +33,10 @@ C++26では、不定値で初期化されることを明確に指示する`[[ind void f(int) {} int main() { - int x; // xは誤り起因動作を引き起こす未初期化値をもつ + int x; // xは「erroneous value」をもつ int y [[indeterminate]]; // 意図して不定値に初期化されることを指示 - f(x); // 誤り起因動作 (未初期化値の読み取り) + f(x); // erroneous behavior (未初期化値の読み取り) f(y); // 未定義動作 (不定値の読み取り) } ``` @@ -44,45 +44,45 @@ int main() { ## 仕様 - 式が評価された結果として不定値が生成された場合、未定義動作を引き起こす -- 式が評価された結果として未初期化値が生成された場合、誤り起因動作を引き起こす - - 未初期価値が生成されることで誤り起因動作を引き起こす対象は以下: +- 式が評価された結果として未初期化値が生成された場合、「erroneous behavior」を引き起こす + - 未初期価値が生成されることで「erroneous behavior」を引き起こす対象は以下: - 自動記憶域期間をもつオブジェクトのうち、`void`以外のスカラ型 - 注意 : 動的記憶域期間をもつオブジェクトは対象外 - - ただし、`unsigned char`もしくは[`std::byte`](/reference/cstddef/byte.md)型に関しては、未初期化値をもつ変数を同じ型の変数に代入するだけでは誤り起因動作にならず、値の参照や型変換がされることで誤り起因動作を引き起こす -- 誤り起因動作が引き起こされた結果値は、後続の処理では誤り起因動作を引き起こす値とはみなされない + - ただし、`unsigned char`もしくは[`std::byte`](/reference/cstddef/byte.md)型に関しては、未初期化値をもつ変数を同じ型の変数に代入するだけでは「erroneous behavior」にならず、値の参照や型変換がされることで「erroneous behavior」を引き起こす +- 「erroneous behavior」が引き起こされた結果値は、後続の処理では「erroneous value」とはみなされない ```cpp example #include int g(bool b) { unsigned char c; - unsigned char d = c; // 誤り起因動作ではない。dは誤り起因動作を引き起こす未初期化値をもつ + unsigned char d = c; // 「erroneous behavior」ではない。dは「erroneous value」をもつ - assert(c == d); // 常に真、誤り起因動作 (整数昇格) + assert(c == d); // 常に真、「erroneous behavior」 (整数昇格) - int e = d; // 誤り起因動作 (型変換) - return b ? d : 0; // bがtrueの場合に誤り起因動作 + int e = d; // 「erroneous behavior」 (型変換) + return b ? d : 0; // bがtrueの場合に「erroneous behavior」 } int main() { int d1, d2; - int e1 = d1; // 誤り起因動作 - int e2 = d1; // 誤り起因動作 + int e1 = d1; // 「erroneous behavior」 + int e2 = d1; // 「erroneous behavior」 // 処理が続行した場合… - assert(e1 == e2); // 常に真、誤り起因動作ではない。 - // 誤り起因動作の結果で生成された値 (e1とe2) は、 - // 誤り起因動作を引き起こす値とはみなされない - assert(e1 == d1); // 常に真、誤り起因動作 - assert(e2 == d1); // 常に真、誤り起因動作 - - // 誤り起因動作ではないが - // d2は誤り起因動作を引き起こす未初期化値をもつ + assert(e1 == e2); // 常に真、「erroneous behavior」ではない。 + // 「erroneous behavior」の結果で生成された値 (e1とe2) は、 + // 「erroneous value」とはみなされない + assert(e1 == d1); // 常に真、「erroneous behavior」 + assert(e2 == d1); // 常に真、「erroneous behavior」 + + // 「erroneous behavior」ではないが + // d2は「erroneous value」をもつ std::memcpy(&d2, &d1, sizeof(int)); - assert(e1 == d2); // 誤り起因動作 - assert(e2 == d2); // 誤り起因動作 + assert(e1 == d2); // 「erroneous behavior」 + assert(e2 == d2); // 「erroneous behavior」 } ``` @@ -109,9 +109,9 @@ int main() { } ``` -### 今後、誤り起因動作に分類される可能性のある操作 +### 今後、「erroneous behavior」に分類される可能性のある操作 -現在、未定義動作に分類される以下の操作は、誤り起因動作に分類できる可能性がある。 +現在、未定義動作に分類される以下の操作は、「erroneous behavior」に分類できる可能性がある。 | 操作 | 備考 | |------|------| @@ -120,8 +120,8 @@ int main() { | 誤ったビットシフト (負のシフト幅や、上限を超えたシフト幅) | 符号付き整数のオーバーフローと同じ | | ゼロ割り | いくつかの固定値での誤った結果となる可能性がある。影響が不明確であるため、変更にはコストがかかる | | 戻り値型が非`void`な関数から返った、もしくは`[[noreturn]]`属性をつけた関数から返った | [`std::terminate()`](/reference/exception/terminate.md)が呼ばれる可能性がある。変更には軽いコストがかかるが、その変更にどの程度の価値があるかは不明 | -| 抽象クラスのコンストラクタ・デストラクタからの純粋仮想関数の呼び出し | 特定の純粋仮想ハンドラが呼ばれる可能性がある。実装によってはすでに誤り起因動作のように扱われている可能性がある | -| 契約違反 | 契約に関する現在の策定作業では、契約違反時になにが起こるべきかという問題に直面している。誤り起因動作という概念は有用な回答を与えてくれる可能性がある | +| 抽象クラスのコンストラクタ・デストラクタからの純粋仮想関数の呼び出し | 特定の純粋仮想ハンドラが呼ばれる可能性がある。実装によってはすでに「erroneous behavior」のように扱われている可能性がある | +| 契約違反 | 契約に関する現在の策定作業では、契約違反時になにが起こるべきかという問題に直面している。「erroneous behavior」という概念は有用な回答を与えてくれる可能性がある | From 7d2188d349fa4087b9994ebdb29bd58d2b05170f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 7 Oct 2024 17:39:21 +0900 Subject: [PATCH 1228/3948] =?UTF-8?q?C++26=20=E6=9C=AA=E5=88=9D=E6=9C=9F?= =?UTF-8?q?=E5=8C=96=E5=80=A4=E3=81=AE=E8=AA=AD=E3=81=BF=E5=8F=96=E3=82=8A?= =?UTF-8?q?=20:=20=E6=9C=AA=E5=AE=9A=E7=BE=A9=E5=8B=95=E4=BD=9C=E3=81=AB?= =?UTF-8?q?=E3=81=AA=E3=82=8A=E3=81=88=E3=82=8B=E3=82=B1=E3=83=BC=E3=82=B9?= =?UTF-8?q?=E3=82=92=E8=A8=98=E8=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../erroneous_behavior_for_uninitialized_reads.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md index 70c3141bb2..c90685a234 100644 --- a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md +++ b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md @@ -22,7 +22,7 @@ int main() { } ``` -未初期化の値は、コンパイラやターゲット環境によって定義された固定値である。コンパイラにはこの誤りを診断することが許可され、推奨されているが、誤りを無視して有効な読み取りとして扱うことも許可されている。このコードは誤りではあるが、未定義動作に関連する結果に遭遇するリスクはない。 +未初期化の値は、コンパイラやターゲット環境によって定義された固定値である。コンパイラにはこの誤りを診断することが許可され、推奨されているが、誤りを無視して有効な読み取りとして扱うことも許可されている。このコードは誤りではあるが、実行ごとに異なる動作をしたり攻撃者に値を制御されたりといったリスクはなくなる。 「erroneous behavior」は未定義動作とはちがって、明確に定義された動作をするがコードとして正しくない、ということを規定するものであり、処理系に対して有用な診断を提供するものである。 @@ -124,6 +124,17 @@ int main() { | 契約違反 | 契約に関する現在の策定作業では、契約違反時になにが起こるべきかという問題に直面している。「erroneous behavior」という概念は有用な回答を与えてくれる可能性がある | +## 備考 +- 以下のようなケースでは、erroneous behaviorではなく未定義動作を引き起こす可能性がある: + ```cpp + T* p; // 未初期化のポインタ。erroneous value (例としてヌルポインタ) をもつ + bool b; // 未初期化の真理値。erroneous valueとして、 + // 妥当ではないbool値 (trueでもfalseでもない値) をもつ可能性がある + + f(*p); // 間接参照は未定義動作を引き起こす + g(b); // bが妥当な値である場合にerroneous behavior、そうでなければ未定義動作 + ``` + ## 参照 - [P2795R5 Erroneous behaviour for uninitialized reads](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2795r5.html) From f9d46be05c3582e2150173beadd51475358fb1f2 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 7 Oct 2024 18:18:58 +0900 Subject: [PATCH 1229/3948] =?UTF-8?q?=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88?= =?UTF-8?q?=E3=81=AE=E8=AA=A4=E3=82=8A=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23/extend_init_statement_to_allow_alias_declaration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md b/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md index 484797e3e4..fac0741179 100644 --- a/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md +++ b/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md @@ -38,7 +38,7 @@ int main() std::cout << x << std::endl; } - // C++20 : OK + // C++20 : NG // C++23 : OK if (using T = int; T x = f()) { std::cout << x << std::endl; From c965e2646205ce6bb09d44cbcdf4906099d4e4d7 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 8 Oct 2024 13:39:09 +0900 Subject: [PATCH 1230/3948] =?UTF-8?q?=E7=94=A8=E8=AA=9E=20:=20=E8=AA=AD?= =?UTF-8?q?=E3=81=BF=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Kazutoshi SATODA --- GLOBAL_DEFINED_WORDS.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GLOBAL_DEFINED_WORDS.json b/GLOBAL_DEFINED_WORDS.json index f78301d146..8202b750d7 100644 --- a/GLOBAL_DEFINED_WORDS.json +++ b/GLOBAL_DEFINED_WORDS.json @@ -24,7 +24,7 @@ "未規定動作": { "redirect": "未規定の動作", "yomi": "みきていどうさ" }, "未規定": { "redirect": "未規定の動作", "yomi": "みきてい" }, "「erroneous behavior」": { - "yomi": "えらーなうすべへいびあ", + "yomi": "えろーにあすびへいびあ", "desc": "未定義動作ではないが、誤ったプログラムの結果とされる動作。erroneous behavior (EB)。処理系によって診断や異常終了を実行することが許可されるが、処理が続行する場合もある" }, "処理系定義の動作": { From 7e6827164ad394ff8756a9ce1d89410d24cb41c1 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 8 Oct 2024 13:39:44 +0900 Subject: [PATCH 1231/3948] =?UTF-8?q?C++26=20=E6=9C=AA=E5=88=9D=E6=9C=9F?= =?UTF-8?q?=E5=8C=96=E5=A4=89=E6=95=B0=E3=81=AE=E8=AA=AD=E3=81=BF=E5=8F=96?= =?UTF-8?q?=E3=82=8A=20:=20=E8=A8=B3=E3=81=97=E3=81=A6=E3=81=AA=E3=81=84?= =?UTF-8?q?=E7=94=A8=E8=AA=9E=E3=81=AE=E3=83=9E=E3=83=BC=E3=82=AD=E3=83=B3?= =?UTF-8?q?=E3=82=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Kazutoshi SATODA --- lang/cpp26/erroneous_behavior_for_uninitialized_reads.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md index c90685a234..0c394ef7cc 100644 --- a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md +++ b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md @@ -36,7 +36,7 @@ int main() { int x; // xは「erroneous value」をもつ int y [[indeterminate]]; // 意図して不定値に初期化されることを指示 - f(x); // erroneous behavior (未初期化値の読み取り) + f(x); // 「erroneous behavior」 (「erroneous value」の読み取り) f(y); // 未定義動作 (不定値の読み取り) } ``` From aeee953c0c7ae6b10bdcfb2514689af557f20c90 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 8 Oct 2024 13:40:55 +0900 Subject: [PATCH 1232/3948] =?UTF-8?q?C++26=20=E6=9C=AA=E5=88=9D=E6=9C=9F?= =?UTF-8?q?=E5=8C=96=E5=A4=89=E6=95=B0=E3=81=AE=E8=AA=AD=E3=81=BF=E5=8F=96?= =?UTF-8?q?=E3=82=8A=20:=20=E4=BB=95=E6=A7=98=E8=AA=AC=E6=98=8E=E3=82=92?= =?UTF-8?q?=E8=A6=8B=E7=9B=B4=E3=81=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Kazutoshi SATODA --- .../erroneous_behavior_for_uninitialized_reads.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md index 0c394ef7cc..36e00c8832 100644 --- a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md +++ b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md @@ -43,13 +43,13 @@ int main() { ## 仕様 -- 式が評価された結果として不定値が生成された場合、未定義動作を引き起こす -- 式が評価された結果として未初期化値が生成された場合、「erroneous behavior」を引き起こす - - 未初期価値が生成されることで「erroneous behavior」を引き起こす対象は以下: - - 自動記憶域期間をもつオブジェクトのうち、`void`以外のスカラ型 - - 注意 : 動的記憶域期間をもつオブジェクトは対象外 - - ただし、`unsigned char`もしくは[`std::byte`](/reference/cstddef/byte.md)型に関しては、未初期化値をもつ変数を同じ型の変数に代入するだけでは「erroneous behavior」にならず、値の参照や型変換がされることで「erroneous behavior」を引き起こす -- 「erroneous behavior」が引き起こされた結果値は、後続の処理では「erroneous value」とはみなされない +- 自動記憶域期間をもつオブジェクトの記憶域は確保時点で「erroneous value」をもつとされ、処理系がプログラムの状態に依存せず決定する何らかの値で埋められる + - 動的記憶域期間であれば不定値、静的・スレッド記憶域期間であればゼロで埋められる。C++23までは自動記憶域期間も不定値で埋められていた +- 初期化されなかったスカラ型オブジェクトなど、値表現(パディングは含まない)内のいずれかのビットに「erroneous value」をもつオブジェクトは「erroneous value」をもつとされる +- 式が評価された結果として「erroneous value」が生成された場合、「erroneous behavior」を引き起こす + - ただし、`unsigned char`(およびunsignedとなる場合は`char`)もしくは[`std::byte`](/reference/cstddef/byte.md)型の「erroneous value」がこれらの型のオブジェクトの初期化・代入に使用される場合や値が破棄される場合は「erroneous behavior」にならない + - これらのルールは、式が評価された結果として不定値が生成された場合に未定義の動作を引き起こすとする従来のルールと同様である +- 「erroneous behavior」を引き起こしたうえで生成された値は、後続の処理では「erroneous value」とはみなされない ```cpp example #include From 5e8c37d17209037ee5961fc8c96e3569c7853a3b Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 8 Oct 2024 13:41:43 +0900 Subject: [PATCH 1233/3948] =?UTF-8?q?C++26=20=E6=9C=AA=E5=88=9D=E6=9C=9F?= =?UTF-8?q?=E5=8C=96=E5=A4=89=E6=95=B0=E3=81=AE=E8=AA=AD=E3=81=BF=E5=8F=96?= =?UTF-8?q?=E3=82=8A=20:=20indeterminate=E3=81=AE=E3=82=B5=E3=83=B3?= =?UTF-8?q?=E3=83=97=E3=83=AB=E3=82=B3=E3=83=BC=E3=83=89=E3=83=9F=E3=82=B9?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Kazutoshi SATODA --- lang/cpp26/erroneous_behavior_for_uninitialized_reads.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md index 36e00c8832..35d2b6fe84 100644 --- a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md +++ b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md @@ -100,7 +100,7 @@ struct T { }; int h(T t [[indeterminate]]) { - f(t.x); // この関数呼び出しは未定義動作を引き起こす + f(t.x); // 後述の関数呼び出しはここで未定義動作を引き起こす return 0; } From afee38894e0c6f2a597c04fdb4ade49eb878ca2d Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 8 Oct 2024 13:42:55 +0900 Subject: [PATCH 1234/3948] =?UTF-8?q?C++26=20=E6=9C=AA=E5=88=9D=E6=9C=9F?= =?UTF-8?q?=E5=8C=96=E5=A4=89=E6=95=B0=E3=81=AE=E8=AA=AD=E3=81=BF=E5=8F=96?= =?UTF-8?q?=E3=82=8A=20:=20=E6=8A=9C=E3=81=91=E3=81=A6=E3=81=84=E3=81=9F?= =?UTF-8?q?=E3=80=8C=E5=B8=B8=E3=81=AB=E7=9C=9F=E3=80=8D=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26/erroneous_behavior_for_uninitialized_reads.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md index 35d2b6fe84..35ff996457 100644 --- a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md +++ b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md @@ -81,8 +81,8 @@ int main() { // d2は「erroneous value」をもつ std::memcpy(&d2, &d1, sizeof(int)); - assert(e1 == d2); // 「erroneous behavior」 - assert(e2 == d2); // 「erroneous behavior」 + assert(e1 == d2); // 常に真、「erroneous behavior」 + assert(e2 == d2); // 常に真、「erroneous behavior」 } ``` From 94e04bfdf954d388d0cb96fc45b6e6ffd2c27b51 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 8 Oct 2024 13:45:34 +0900 Subject: [PATCH 1235/3948] =?UTF-8?q?C++26=20=E6=9C=AA=E5=88=9D=E6=9C=9F?= =?UTF-8?q?=E5=8C=96=E5=A4=89=E6=95=B0=E3=81=AE=E8=AA=AD=E3=81=BF=E5=8F=96?= =?UTF-8?q?=E3=82=8A=20:=20bool=E3=81=AE=E4=BE=8B=E7=A4=BA=E3=82=92?= =?UTF-8?q?=E8=A6=8B=E7=9B=B4=E3=81=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26/erroneous_behavior_for_uninitialized_reads.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md index 35ff996457..3e15a53f08 100644 --- a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md +++ b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md @@ -128,11 +128,13 @@ int main() { - 以下のようなケースでは、erroneous behaviorではなく未定義動作を引き起こす可能性がある: ```cpp T* p; // 未初期化のポインタ。erroneous value (例としてヌルポインタ) をもつ - bool b; // 未初期化の真理値。erroneous valueとして、 - // 妥当ではないbool値 (trueでもfalseでもない値) をもつ可能性がある + bool b; // 未初期化の真理値。 + // bool値として妥当な値表現をもたない可能性がある + // (例: 値表現が8bitで{0x00(false), 0x01(true)}の + // 2通りのみとする処理系で0xCCをもつなど) f(*p); // 間接参照は未定義動作を引き起こす - g(b); // bが妥当な値である場合にerroneous behavior、そうでなければ未定義動作 + g(b); // bが妥当な値表現をもつ場合にerroneous behavior、そうでなければ未定義動作 ``` From 867bb4aca24d09a55f4c2cc8dd99370224a48b23 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 8 Oct 2024 21:52:57 +0900 Subject: [PATCH 1236/3948] =?UTF-8?q?remove=5Fcvref=20:=20=E5=8B=95?= =?UTF-8?q?=E4=BD=9C=E7=A2=BA=E8=AA=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/type_traits/remove_cvref.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/type_traits/remove_cvref.md b/reference/type_traits/remove_cvref.md index bebdacd05e..f2e95b9e1f 100644 --- a/reference/type_traits/remove_cvref.md +++ b/reference/type_traits/remove_cvref.md @@ -55,8 +55,8 @@ int main() {} ### 処理系 - [Clang](/implementation.md#clang): 6.0 [mark verified] -- [GCC](/implementation.md#gcc): -- [Visual C++](/implementation.md#visual_cpp): ?? +- [GCC](/implementation.md#gcc): 9 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 [mark verified] ## 参照 From e1bfcbb4901e1dd1c3adbf3a5ff1d9f28e8700a0 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 10 Oct 2024 17:35:23 +0900 Subject: [PATCH 1237/3948] =?UTF-8?q?=E3=82=B9=E3=83=9D=E3=83=B3=E3=82=B5?= =?UTF-8?q?=E3=83=BC=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.md b/index.md index 3fabb90965..791b40d735 100644 --- a/index.md +++ b/index.md @@ -90,6 +90,8 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい [sponsor name:cocotone様, img:https://raw.githubusercontent.com/cpprefjp/image/master/sponsors/cocotone/cocotone.png, link:https://www.cocotone.jp, size:560, fee:75, amount:12] +[sponsor name:CubeSoft様, img:https://raw.githubusercontent.com/cube-soft/cube.assets/master/home/banner/large.png, link:https://www.cube-soft.jp/, size:560, fee:8, amount:12] + [sponsor name:shiguredo様, img:https://raw.githubusercontent.com/cpprefjp/image/master/sponsors/shiguredo/shiguredo.png, link:https://shiguredo.jp/, size:560, period:2024-10-27, fee:800, amount:1] @@ -103,8 +105,6 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい [sponsor name:vaporoid様, img:https://raw.githubusercontent.com/cpprefjp/image/master/sponsors/vaporoid/cpprefjp-400x150.png, link:https://vaporoid.com/sys/, size:400, fee:8, amount:12] -[sponsor name:CubeSoft様, img:https://raw.githubusercontent.com/cube-soft/cube.assets/master/home/banner/large.png, link:https://www.cube-soft.jp/, size:400, fee:8, amount:12] - [sponsor name:M.Kohana様, img:https://raw.githubusercontent.com/cpprefjp/image/master/sponsors/m_kohana/m_kohana.jpg, link:https://mkohana.github.io/, size:320, fee:8, amount:12] [sponsor name:有限会社テクニカルアーツ様, img:https://raw.githubusercontent.com/cpprefjp/image/master/sponsors/technical_arts/TechnicalArtsLogo3.png, link:https://www.techarts.co.jp/, size:400, fee:8, amount:12] From a81c832f54e04c8a0007c27565027ea6b53a24a4 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 10 Oct 2024 17:39:50 +0900 Subject: [PATCH 1238/3948] =?UTF-8?q?C++26=20=E6=9C=AA=E5=88=9D=E6=9C=9F?= =?UTF-8?q?=E5=8C=96=E5=A4=89=E6=95=B0=E3=81=AE=E8=AA=AD=E3=81=BF=E5=8F=96?= =?UTF-8?q?=E3=82=8A=20:=20=E3=80=8C=E6=98=8E=E7=A2=BA=E3=81=AB=E5=AE=9A?= =?UTF-8?q?=E7=BE=A9=E3=81=95=E3=82=8C=E3=81=9F=E5=8B=95=E4=BD=9C=E3=80=8D?= =?UTF-8?q?=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Kazutoshi SATODA --- lang/cpp26/erroneous_behavior_for_uninitialized_reads.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md index 3e15a53f08..3a831694cb 100644 --- a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md +++ b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md @@ -24,7 +24,7 @@ int main() { 未初期化の値は、コンパイラやターゲット環境によって定義された固定値である。コンパイラにはこの誤りを診断することが許可され、推奨されているが、誤りを無視して有効な読み取りとして扱うことも許可されている。このコードは誤りではあるが、実行ごとに異なる動作をしたり攻撃者に値を制御されたりといったリスクはなくなる。 -「erroneous behavior」は未定義動作とはちがって、明確に定義された動作をするがコードとして正しくない、ということを規定するものであり、処理系に対して有用な診断を提供するものである。 +「erroneous behavior」は未定義動作(一切の保証が失われる)とはちがって、動作を定めたうえで診断も可能とするものである。 C++26では、不定値で初期化されることを明確に指示する`[[indeterminate]]`属性も導入され、以下のような動作となる: From 616c00bff8d95651754799d85cb8586476fdac14 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 10 Oct 2024 17:41:32 +0900 Subject: [PATCH 1239/3948] =?UTF-8?q?C++26=20=E6=9C=AA=E5=88=9D=E6=9C=9F?= =?UTF-8?q?=E5=8C=96=E5=A4=89=E6=95=B0=E3=81=AE=E8=AA=AD=E3=81=BF=E5=8F=96?= =?UTF-8?q?=E3=82=8A=20:=20=E4=BB=8A=E5=BE=8C=E3=81=AE=E8=A9=B1=E3=82=92?= =?UTF-8?q?=E4=BB=95=E6=A7=98=E3=81=8B=E3=82=89=E5=82=99=E8=80=83=E3=81=AB?= =?UTF-8?q?=E7=A7=BB=E5=8B=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...oneous_behavior_for_uninitialized_reads.md | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md index 3a831694cb..0681c0db68 100644 --- a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md +++ b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md @@ -109,6 +109,19 @@ int main() { } ``` +## 備考 +- 以下のようなケースでは、erroneous behaviorではなく未定義動作を引き起こす可能性がある: + ```cpp + T* p; // 未初期化のポインタ。erroneous value (例としてヌルポインタ) をもつ + bool b; // 未初期化の真理値。 + // bool値として妥当な値表現をもたない可能性がある + // (例: 値表現が8bitで{0x00(false), 0x01(true)}の + // 2通りのみとする処理系で0xCCをもつなど) + + f(*p); // 間接参照は未定義動作を引き起こす + g(b); // bが妥当な値表現をもつ場合にerroneous behavior、そうでなければ未定義動作 + ``` + ### 今後、「erroneous behavior」に分類される可能性のある操作 現在、未定義動作に分類される以下の操作は、「erroneous behavior」に分類できる可能性がある。 @@ -124,19 +137,5 @@ int main() { | 契約違反 | 契約に関する現在の策定作業では、契約違反時になにが起こるべきかという問題に直面している。「erroneous behavior」という概念は有用な回答を与えてくれる可能性がある | -## 備考 -- 以下のようなケースでは、erroneous behaviorではなく未定義動作を引き起こす可能性がある: - ```cpp - T* p; // 未初期化のポインタ。erroneous value (例としてヌルポインタ) をもつ - bool b; // 未初期化の真理値。 - // bool値として妥当な値表現をもたない可能性がある - // (例: 値表現が8bitで{0x00(false), 0x01(true)}の - // 2通りのみとする処理系で0xCCをもつなど) - - f(*p); // 間接参照は未定義動作を引き起こす - g(b); // bが妥当な値表現をもつ場合にerroneous behavior、そうでなければ未定義動作 - ``` - - ## 参照 - [P2795R5 Erroneous behaviour for uninitialized reads](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2795r5.html) From 7d603ab3b028d56b4872804e1ff6d111a7da2ae9 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 10 Oct 2024 17:43:55 +0900 Subject: [PATCH 1240/3948] =?UTF-8?q?=E3=82=B9=E3=83=9D=E3=83=B3=E3=82=B5?= =?UTF-8?q?=E3=83=BC=E7=94=BB=E5=83=8F=E3=82=92=E5=8E=9F=E5=AF=B8=E5=A4=A7?= =?UTF-8?q?=E3=82=88=E3=82=8A=E5=A4=A7=E3=81=8D=E3=81=8F=E3=81=97=E3=81=A6?= =?UTF-8?q?=E3=81=97=E3=81=BE=E3=81=A3=E3=81=A6=E3=81=84=E3=81=9F=E3=81=AE?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.md b/index.md index 791b40d735..612e96482e 100644 --- a/index.md +++ b/index.md @@ -90,7 +90,7 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい [sponsor name:cocotone様, img:https://raw.githubusercontent.com/cpprefjp/image/master/sponsors/cocotone/cocotone.png, link:https://www.cocotone.jp, size:560, fee:75, amount:12] -[sponsor name:CubeSoft様, img:https://raw.githubusercontent.com/cube-soft/cube.assets/master/home/banner/large.png, link:https://www.cube-soft.jp/, size:560, fee:8, amount:12] +[sponsor name:CubeSoft様, img:https://raw.githubusercontent.com/cube-soft/cube.assets/master/home/banner/large.png, link:https://www.cube-soft.jp/, fee:8, amount:12] [sponsor name:shiguredo様, img:https://raw.githubusercontent.com/cpprefjp/image/master/sponsors/shiguredo/shiguredo.png, link:https://shiguredo.jp/, size:560, period:2024-10-27, fee:800, amount:1] From 2eda71691cdba406667c3bee7e0e4834918f381c Mon Sep 17 00:00:00 2001 From: TatsukiKUROSAWA <85093916+TatsukiKUROSAWA@users.noreply.github.com> Date: Thu, 10 Oct 2024 19:18:42 +0900 Subject: [PATCH 1241/3948] =?UTF-8?q?gps=5Fclock=E3=81=AE=E3=82=A8?= =?UTF-8?q?=E3=83=9D=E3=83=83=E3=82=AF=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/chrono/gps_clock.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/chrono/gps_clock.md b/reference/chrono/gps_clock.md index 2db96f1d65..a383403a7c 100644 --- a/reference/chrono/gps_clock.md +++ b/reference/chrono/gps_clock.md @@ -19,7 +19,7 @@ namespace std::chrono { ### エポック クロックごとの初期時間 (内部的にカウンタがあれば値ゼロ) をエポックと呼ぶ。 -`gps_clock`のエポックは、1980年1月16日 (この年の最初の日曜日) 0時0分0秒である。 +`gps_clock`のエポックは、1980年1月6日 (この年の最初の日曜日) 0時0分0秒である。 ### うるう秒の扱い From c809726d6506a611b014ef397799d03a8f7fe26b Mon Sep 17 00:00:00 2001 From: I <1091761+wx257osn2@users.noreply.github.com> Date: Fri, 11 Oct 2024 12:28:28 +0900 Subject: [PATCH 1242/3948] fix typo --- reference/ranges/cartesian_product_view.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/ranges/cartesian_product_view.md b/reference/ranges/cartesian_product_view.md index f4b3219308..47cd666902 100644 --- a/reference/ranges/cartesian_product_view.md +++ b/reference/ranges/cartesian_product_view.md @@ -33,7 +33,7 @@ namespace std::ranges { - (1): すべてのRangeが[`sized_range`](sized_range.md)のとき - (2): すべてのRangeが[`bidirectional_range`](bidirectional_range.md)かつ、先頭以外のRangeが*cartesian-product-common-arg*のとき -- (3): すべてのRangeが[`random_access_range`](random_access_range.md)かつ、先頭のRamgeが[`sized_range`](sized_range.md)のとき +- (3): すべてのRangeが[`random_access_range`](random_access_range.md)かつ、先頭のRangeが[`sized_range`](sized_range.md)のとき - (4): 先頭のRangeが*cartesian-product-common-arg*のとき ## 効果 From e94f5805550f8436fa1ed96087e994342b110914 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sat, 12 Oct 2024 13:47:41 +0900 Subject: [PATCH 1243/3948] =?UTF-8?q?=E3=82=B9=E3=83=9D=E3=83=B3=E3=82=B5?= =?UTF-8?q?=E3=83=BC=E6=9B=B4=E6=96=B0=20#1353?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.md b/index.md index 612e96482e..90eec88a9f 100644 --- a/index.md +++ b/index.md @@ -135,6 +135,8 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい [sponsor name:Hashitaku様, link:https://opencollective.com/hashitaku, fee:20, amount:1, period:2024-05-08] +[sponsor name:Akira Kubo様, link:https://opencollective.com/akira-kubo, fee:20, amount:1, period:2025-10-12] + [sponsor name:yukika2e様, img:https://raw.githubusercontent.com/cpprefjp/image/master/sponsors/yukika2e/yukika2e.png, fee:10, amount:1, period:2024-05-18] [sponsor name:ugai様, link:https://opencollective.com/ugai, fee:5, amount:1, period:2025-02-06] From 24f16493349bb6016494e0f10523c9db5a2d3020 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sun, 13 Oct 2024 01:15:09 +0900 Subject: [PATCH 1244/3948] =?UTF-8?q?llrint()=20=E3=81=AE=E3=83=9A?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=81=AE=20lround()=20=E3=82=92=20llround()?= =?UTF-8?q?=20=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cmath/llrint.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cmath/llrint.md b/reference/cmath/llrint.md index 37e2f87703..aa478ca9ba 100644 --- a/reference/cmath/llrint.md +++ b/reference/cmath/llrint.md @@ -45,7 +45,7 @@ namespace std { - C99 では、丸めモードや浮動小数点例外へのアクセスには `#pragma STDC FENV_ACCESS ON` でなければなければならないと記載されているが、C++ には該当する記載を見つけることができなかった。 なお、C99 でも `FENV_ACCESS` のデフォルトは処理系定義である。 - 丸めモード [`FE_TONEAREST`](../cfenv/fe_tonearest.md) は四捨五入ではなく、最近接偶数への丸めであることに注意。(例を参照) - 四捨五入が必要であれば、[`lround`](lround.md) を使用すること。(ただし、[`lround`](lround.md) は本関数と異なり、ISO IEC 60559 に準拠していても [`FE_INEXACT`](../cfenv/fe_inexact.md) が発生するか否かは処理系定義である) + 四捨五入が必要であれば、[`llround`](llround.md) を使用すること。(ただし、[`llround`](llround.md) は本関数と異なり、ISO IEC 60559 に準拠していても [`FE_INEXACT`](../cfenv/fe_inexact.md) が発生するか否かは処理系定義である) - C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された From 05784efadb4b3a7fd1df00750c83555e44c486a4 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sun, 13 Oct 2024 15:47:36 +0900 Subject: [PATCH 1245/3948] =?UTF-8?q?=E3=82=B9=E3=83=9D=E3=83=B3=E3=82=B5?= =?UTF-8?q?=E3=83=BC=E6=9B=B4=E6=96=B0=20#1353?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.md b/index.md index 90eec88a9f..89d88f0c57 100644 --- a/index.md +++ b/index.md @@ -135,7 +135,7 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい [sponsor name:Hashitaku様, link:https://opencollective.com/hashitaku, fee:20, amount:1, period:2024-05-08] -[sponsor name:Akira Kubo様, link:https://opencollective.com/akira-kubo, fee:20, amount:1, period:2025-10-12] +[sponsor name:Akira Kubo様, img:https://raw.githubusercontent.com/cpprefjp/image/master/sponsors/HappyLuckyAkira/HappyLuckyAkira.png, link:https://x.com/HappyLuckyAkira, size:256, fee:20, amount:1, period:2025-10-12] [sponsor name:yukika2e様, img:https://raw.githubusercontent.com/cpprefjp/image/master/sponsors/yukika2e/yukika2e.png, fee:10, amount:1, period:2024-05-18] From ed3624c311bc4edb302e276004d3566a9a23d7fa Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sun, 13 Oct 2024 15:58:26 +0900 Subject: [PATCH 1246/3948] =?UTF-8?q?=E3=82=B9=E3=83=9D=E3=83=B3=E3=82=B5?= =?UTF-8?q?=E3=83=BC=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.md b/index.md index 89d88f0c57..664b365dfd 100644 --- a/index.md +++ b/index.md @@ -135,7 +135,7 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい [sponsor name:Hashitaku様, link:https://opencollective.com/hashitaku, fee:20, amount:1, period:2024-05-08] -[sponsor name:Akira Kubo様, img:https://raw.githubusercontent.com/cpprefjp/image/master/sponsors/HappyLuckyAkira/HappyLuckyAkira.png, link:https://x.com/HappyLuckyAkira, size:256, fee:20, amount:1, period:2025-10-12] +[sponsor name:Akira Kubo様, img:https://raw.githubusercontent.com/cpprefjp/image/master/sponsors/HappyLuckyAkira/HappyLuckyAkira.jpg, link:https://x.com/HappyLuckyAkira, size:256, fee:20, amount:1, period:2025-10-12] [sponsor name:yukika2e様, img:https://raw.githubusercontent.com/cpprefjp/image/master/sponsors/yukika2e/yukika2e.png, fee:10, amount:1, period:2024-05-18] From c56ea8deab542f2ad743ce4a7639a4b81a06e733 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 16 Oct 2024 12:36:07 +0900 Subject: [PATCH 1247/3948] =?UTF-8?q?=E5=A4=96=E9=83=A8=E3=83=AA=E3=83=B3?= =?UTF-8?q?=E3=82=AF=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF=20:=20web=20archi?= =?UTF-8?q?ve=E3=81=AFhttp=E3=82=82=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF?= =?UTF-8?q?=E9=99=A4=E5=A4=96=E5=AF=BE=E8=B1=A1=E3=81=AB=E3=81=97=E3=81=9F?= =?UTF-8?q?=20#1354?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/script/link_check.py | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/script/link_check.py b/.github/workflows/script/link_check.py index 982bd79613..7cf0115ac4 100644 --- a/.github/workflows/script/link_check.py +++ b/.github/workflows/script/link_check.py @@ -53,6 +53,7 @@ def fix_link(link: str) -> str: return link IGNORE_LIST = [ + "http://web.archive.org", # 確実に存在すると思われる "https://web.archive.org", # 確実に存在すると思われる "http://cse.naro.affrc.go.jp", # 海外 (GitHub Actions) からのアクセスを排除していると思われる "https://www.cryptopp.com", # アクセスチェックでよく失敗するがブラウザ上では問題なくアクセスできる From 7a4c6c55911bbf152021f6a6bcfdd4547179572f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 16 Oct 2024 12:43:33 +0900 Subject: [PATCH 1248/3948] =?UTF-8?q?knuth=5Fb=20:=20=E6=9B=B8=E7=B1=8D?= =?UTF-8?q?=E3=81=A7=E3=81=AE=E7=B4=B9=E4=BB=8B=E3=82=92=E3=80=8C=E8=80=83?= =?UTF-8?q?=E6=A1=88=E3=80=8D=E2=86=92=E3=80=8C=E8=BF=B0=E3=81=B9=E3=82=89?= =?UTF-8?q?=E3=82=8C=E3=81=A6=E3=81=84=E3=82=8B=E3=80=8D=E3=81=AB=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E3=81=97=E3=80=81.NET=E3=81=AE=E5=AE=9F=E8=A3=85?= =?UTF-8?q?=E3=81=AF=E5=88=A5=E3=82=A2=E3=83=AB=E3=82=B4=E3=83=AA=E3=82=BA?= =?UTF-8?q?=E3=83=A0=E3=81=A7=E3=81=82=E3=82=8B=E3=81=9F=E3=82=81=E8=A8=80?= =?UTF-8?q?=E5=8F=8A=E3=82=92=E5=89=8A=E9=99=A4=20#1355?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/random/knuth_b.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/reference/random/knuth_b.md b/reference/random/knuth_b.md index 327897c3fd..1c6d6ea388 100644 --- a/reference/random/knuth_b.md +++ b/reference/random/knuth_b.md @@ -17,9 +17,7 @@ namespace std { `knuth_b`では、[`minstd_rand0`](minstd_rand0.md)によって生成された乱数を`256`個バッファリングしておき、順番を入れ替えて値を選択していく。これにより、線形合同法([`minstd_rand0`](minstd_rand0.md) or [`minstd_rand`](minstd_rand.md))を直接使用するよりも出力間の相関関係が小さくなり、乱雑さが増加する。 -Donald Knuth氏の著書『The Art of Computer Programming, Second Edition, Volume 2, Seminumerical Algorithms』で考案された、リオーダーアルゴリズムBがそれだ。 - -このアルゴリズムは、Microsoft .NET Frameworkの[`System.Random`](https://docs.microsoft.com/ja-jp/dotnet/api/system.random)クラスにも、実装として使用されている。 +Donald Knuth氏の著書『The Art of Computer Programming, Second Edition, Volume 2, Seminumerical Algorithms』で述べられている、リオーダーアルゴリズムBがそれだ。 ## 要件 From ab361724c3a851217581c9daf8eecf009f7527ee Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 16 Oct 2024 13:02:39 +0900 Subject: [PATCH 1249/3948] =?UTF-8?q?bad=5Farray=5Fnew=5Flength=20:=20?= =?UTF-8?q?=E3=82=B5=E3=83=B3=E3=83=97=E3=83=AB=E3=82=B3=E3=83=BC=E3=83=89?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/new/bad_array_new_length.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/reference/new/bad_array_new_length.md b/reference/new/bad_array_new_length.md index 76f189b9b7..6ab8cac677 100644 --- a/reference/new/bad_array_new_length.md +++ b/reference/new/bad_array_new_length.md @@ -18,6 +18,31 @@ namespace std { 動的に記憶域を確保しようとする配列の長さが 0 未満または処理系の最大値以上の場合に送出される例外。 +## 例 +```cpp example +#include + +int main() { + int n = -1; + try { + int* p = new int[n]; + delete[] p; + } + catch (std::bad_array_new_length&) { + std::cout << "bad array new length" << std::endl; + } +} +``` + +### 出力例 +``` +bad array new length +``` + ## バージョン C++11 +### 処理系 +- [Clang](/implementation.md#clang): 7 [mark verified] +- [GCC](/implementation.md#gcc): 4.9 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 [mark verified] From f1d9bfb8913abd89e996f0ad483443921b8aea83 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 16 Oct 2024 14:20:19 +0900 Subject: [PATCH 1250/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=83=81?= =?UTF-8?q?=E3=82=A7=E3=83=83=E3=82=AFCI=20:=20URL=E3=82=92=E3=82=B3?= =?UTF-8?q?=E3=83=9E=E3=83=B3=E3=83=89=E3=83=A9=E3=82=A4=E3=83=B3=E5=BC=95?= =?UTF-8?q?=E6=95=B0=E3=81=A7=E6=8C=87=E5=AE=9A=E3=81=A7=E3=81=8D=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/script/link_check.py | 62 +++++++++++++++----------- 1 file changed, 35 insertions(+), 27 deletions(-) diff --git a/.github/workflows/script/link_check.py b/.github/workflows/script/link_check.py index 7cf0115ac4..fcb0c078f8 100644 --- a/.github/workflows/script/link_check.py +++ b/.github/workflows/script/link_check.py @@ -122,6 +122,10 @@ def add_link(origin_link: str): dest='check_outer_link', action='store_true', default=False) + argparser.add_argument("--url", + dest='url', + type=str, + default='') args = argparser.parse_args() if not args.check_inner_link and not args.check_outer_link: @@ -131,36 +135,40 @@ def add_link(origin_link: str): found_error = False current_dir = os.getcwd() outer_link_dict = dict() - for p in glob.glob("**/*.md", recursive=True): - dirname = os.path.dirname(p) - with open(p) as f: - text = f.read() - - inner_links, outer_links = find_all_links(text) - for link in outer_links: - if link in outer_link_dict: - outer_link_dict[link].append(p) - else: - outer_link_dict[link] = [p] - - if args.check_inner_link: - for link in inner_links: - rel_link = "" - if link.startswith("/"): - rel_link = os.path.join(current_dir, link.lstrip("/")) + if len(args.url) <= 0: + for p in glob.glob("**/*.md", recursive=True): + dirname = os.path.dirname(p) + with open(p) as f: + text = f.read() + + inner_links, outer_links = find_all_links(text) + for link in outer_links: + if link in outer_link_dict: + outer_link_dict[link].append(p) else: - rel_link = os.path.join(dirname, link) - - if link.endswith(".nolink"): - if os.path.exists(rel_link.rstrip(".nolink")): - print("nolinked {} href {} found.".format(p, link.rstrip(".nolink")), file=sys.stderr) - found_error = True - else: - if not os.path.exists(rel_link): - print("{} href {} not found.".format(p, link), file=sys.stderr) - found_error = True + outer_link_dict[link] = [p] + + if args.check_inner_link: + for link in inner_links: + rel_link = "" + if link.startswith("/"): + rel_link = os.path.join(current_dir, link.lstrip("/")) + else: + rel_link = os.path.join(dirname, link) + + if link.endswith(".nolink"): + if os.path.exists(rel_link.rstrip(".nolink")): + print("nolinked {} href {} found.".format(p, link.rstrip(".nolink")), file=sys.stderr) + found_error = True + else: + if not os.path.exists(rel_link): + print("{} href {} not found.".format(p, link), file=sys.stderr) + found_error = True if args.check_outer_link: + if len(args.url) > 0: + outer_link_dict[args.url] = "" + for link, from_list in outer_link_dict.items(): exists, reason = check_url(link) if not exists: From 203d6653c25235be5c53471f2442d3f7f1b4452f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 16 Oct 2024 15:37:44 +0900 Subject: [PATCH 1251/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=83=81?= =?UTF-8?q?=E3=82=A7=E3=83=83=E3=82=AFCI=20:=20=E5=A4=96=E9=83=A8=E3=83=AA?= =?UTF-8?q?=E3=83=B3=E3=82=AF=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF=E3=82=92?= =?UTF-8?q?=E9=AB=98=E9=80=9F=E5=8C=96=E3=80=822=E5=80=8D=E8=BF=91?= =?UTF-8?q?=E3=81=8F=E3=81=AF=E9=80=9F=E3=81=8F=E3=81=AA=E3=81=A3=E3=81=9F?= =?UTF-8?q?=E3=81=AF=E3=81=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/script/link_check.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/script/link_check.py b/.github/workflows/script/link_check.py index fcb0c078f8..30c9286ddd 100644 --- a/.github/workflows/script/link_check.py +++ b/.github/workflows/script/link_check.py @@ -18,7 +18,7 @@ def retry_sleep(): def check_url(url: str, retry: int = 5) -> (bool, str): try: headers = {'User-agent': 'Mozilla/5.0'} - res = requests.get(url, headers=headers, verify=False, timeout=60.0) + res = requests.head(url, headers=headers, verify=False, timeout=60.0) if res.url: if res.url == url: return res.status_code != 404, "404" From 2e1d2fe272b34455486af4a9762cf618b76ce796 Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 17 Oct 2024 21:25:18 +0900 Subject: [PATCH 1252/3948] =?UTF-8?q?chrono:=20leap=5Fsecond=5Finfo?= =?UTF-8?q?=E4=BE=8B=E7=A4=BA=E3=82=B3=E3=83=BC=E3=83=89=E6=94=B9=E5=AE=9A?= =?UTF-8?q?(GCC13.2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/chrono/get_leap_second_info.md | 34 ++++++---------- reference/chrono/leap_second_info.md | 49 +++++++++++++++--------- 2 files changed, 41 insertions(+), 42 deletions(-) diff --git a/reference/chrono/get_leap_second_info.md b/reference/chrono/get_leap_second_info.md index ffedc03a80..b1f93a111a 100644 --- a/reference/chrono/get_leap_second_info.md +++ b/reference/chrono/get_leap_second_info.md @@ -37,28 +37,18 @@ using namespace std::chrono_literals; int main() { std::cout << std::boolalpha; - { - chrono::utc_time now = chrono::utc_clock::now(); - chrono::leap_second_info info = chrono::get_leap_second_info(now); - - std::cout << info.is_leap_second << std::endl; - std::cout << info.elapsed.count() << std::endl; - } - std::cout << std::endl; - { - // 2017年1月1日はうるう秒が挿入された日 - chrono::utc_time date = chrono::clock_cast(chrono::sys_days{2017y/1/1}); - chrono::leap_second_info info = chrono::get_leap_second_info(date); - - std::cout << info.is_leap_second << std::endl; - std::cout << info.elapsed.count() << std::endl; - } + // 日本標準時(JST)2017年1月1日にうるう秒挿入が実施され + // 2016-12-31 23:59:60 UTC + // が存在する + chrono::utc_time tp = chrono::clock_cast(chrono::sys_days{2017y/1/1}) - 1s; + chrono::leap_second_info info = chrono::get_leap_second_info(tp); + std::cout << tp << std::endl; + std::cout << info.is_leap_second << " " << info.elapsed.count() << std::endl; } ``` * chrono::leap_second_info[link leap_second_info.md] * chrono::utc_time[link utc_time.md] * chrono::utc_clock[link utc_clock.md] -* now()[link utc_clock/now.md] * count()[link duration/count.md] * 2017y[link year/op_y.md] * chrono::sys_days[link sys_time.md] @@ -66,16 +56,13 @@ int main() ### 出力例 ``` -false -27 - -true -27 +2016-12-31 23:59:60 +true 27 ``` ### 処理系 - [Clang](/implementation.md#clang): 9.0 [mark noimpl] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 13.2 [mark impl] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] @@ -84,5 +71,6 @@ true ## 参照 +- [日本標準時プロジェクト Information of Leap second](https://jjy.nict.go.jp/QandA/data/leapsec.html) - [P1466R3 Miscellaneous minor fixes for chrono](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1466r3.html) - [LWG Issue 3359. `` leap second support should allow for negative leap seconds](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2117r0.html#3359) diff --git a/reference/chrono/leap_second_info.md b/reference/chrono/leap_second_info.md index 8f2c862f07..6e311e5e50 100644 --- a/reference/chrono/leap_second_info.md +++ b/reference/chrono/leap_second_info.md @@ -35,45 +35,55 @@ using namespace std::chrono_literals; int main() { std::cout << std::boolalpha; - { - chrono::utc_time now = chrono::utc_clock::now(); - chrono::leap_second_info info = chrono::get_leap_second_info(now); - std::cout << info.is_leap_second << std::endl; - std::cout << info.elapsed.count() << std::endl; + // 2016-12-31 23:59:59 UTC + chrono::utc_time tp = chrono::clock_cast(chrono::sys_days{2017y/1/1}); + tp -= 2s; + { + chrono::leap_second_info info = chrono::get_leap_second_info(tp); + std::cout << tp << std::endl; + std::cout << info.is_leap_second << " " << info.elapsed.count() << std::endl; } - std::cout << std::endl; + + // 日本標準時(JST)2017年1月1日にうるう秒挿入が実施された + // 2016-12-31 23:59:60 UTC + tp += 1s; { - // 2017年1月1日はうるう秒が挿入された日 - chrono::utc_time date = chrono::clock_cast(chrono::sys_days{2017y/1/1}); - chrono::leap_second_info info = chrono::get_leap_second_info(date); + chrono::leap_second_info info = chrono::get_leap_second_info(tp); + std::cout << tp << std::endl; + std::cout << info.is_leap_second << " " << info.elapsed.count() << std::endl; + } - std::cout << info.is_leap_second << std::endl; - std::cout << info.elapsed.count() << std::endl; + // 2017-01-01 00:00:00 UTC + tp += 1s; + { + chrono::leap_second_info info = chrono::get_leap_second_info(tp); + std::cout << tp << std::endl; + std::cout << info.is_leap_second << " " << info.elapsed.count() << std::endl; } } ``` * chrono::get_leap_second_info[link get_leap_second_info.md] * chrono::utc_time[link utc_time.md] * chrono::utc_clock[link utc_clock.md] -* now()[link utc_clock/now.md] * count()[link duration/count.md] * 2017y[link year/op_y.md] * chrono::sys_days[link sys_time.md] * chrono::clock_cast[link clock_cast.md] -### 出力例 +### 出力 ``` -false -27 - -true -27 +2016-12-31 23:59:59 +false 26 +2016-12-31 23:59:60 +true 27 +2017-01-01 00:00:00 +false 27 ``` ### 処理系 - [Clang](/implementation.md#clang): 9.0 [mark noimpl] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 13.2 [mark impl] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] @@ -82,4 +92,5 @@ true ## 参照 +- [日本標準時プロジェクト Information of Leap second](https://jjy.nict.go.jp/QandA/data/leapsec.html) - [P1466R3 Miscellaneous minor fixes for chrono](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1466r3.html) From 022d8d832cf0405068cbd032db0fe83d30b0a3f3 Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 17 Oct 2024 21:45:03 +0900 Subject: [PATCH 1253/3948] =?UTF-8?q?chrono/leap=5Fsecond:=20=E4=BE=8B?= =?UTF-8?q?=E7=A4=BA=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE=E6=AD=A3(GCC13.2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/chrono/leap_second.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/chrono/leap_second.md b/reference/chrono/leap_second.md index 7988c74209..9f3df9e4be 100644 --- a/reference/chrono/leap_second.md +++ b/reference/chrono/leap_second.md @@ -67,7 +67,7 @@ int main() { // 2018年3月17日までにうるう秒が挿入された日を列挙する for (const chrono::leap_second& date : chrono::get_tzdb().leap_seconds) { - if (date <= 2018y/3/17) + if (date.date() <= chrono::sys_days{2018y/3/17}) std::cout << date.date() << ": " << date.value() << std::endl; } } @@ -114,7 +114,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): 9.0 [mark noimpl] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 13.2 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] From e3e5eceeb226cf36d92259571e8cee4910c13725 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sat, 19 Oct 2024 11:58:25 +0900 Subject: [PATCH 1254/3948] add some links to feature test pages --- lang/cpp20/feature_test_macros.md | 18 +++++++++--------- lang/cpp23/feature_test_macros.md | 8 ++++---- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lang/cpp20/feature_test_macros.md b/lang/cpp20/feature_test_macros.md index 94415e1724..76dcd41337 100644 --- a/lang/cpp20/feature_test_macros.md +++ b/lang/cpp20/feature_test_macros.md @@ -41,7 +41,7 @@ | マクロ名 | 値 | 機能 | ヘッダ | |----------|----|------|--------| -|`__cpp_lib_array_constexpr`|`201803L`
`201806L`
`201811L`|`std::array`の完全`constexpr`対応|[``](/reference/iterator.md)
[``](/reference/array.md)| +|`__cpp_lib_array_constexpr`|`201803L`
`201806L`
`201811L`|[`std::array`](/reference/array/array.md)の完全`constexpr`対応|[``](/reference/iterator.md)
[``](/reference/array.md)| |`__cpp_lib_assume_aligned`|`201811L`|[`std::assume_aligned()`](/reference/memory/assume_aligned.md)|[``](/reference/memory.md)| |`__cpp_lib_atomic_flag_test`|`201907L`|[`std::atomic_flag::test()`](/reference/atomic/atomic_flag/test.md)|[``](/reference/atomic.md)| |`__cpp_lib_atomic_float`|`201711L`|[`std::atomic`の浮動小数点数型に対する特殊化](/reference/atomic/atomic.md)|[``](/reference/atomic.md)| @@ -61,7 +61,7 @@ |`__cpp_lib_constexpr_algorithms`|`201806L`|多くのアルゴリズムに`constexpr`を追加|[``](/reference/algorithm.md)| |`__cpp_lib_constexpr_complex`|`201711L`|[`std::complex`](/reference/complex/complex.md)の`constexpr`対応|[``](/reference/complex.md)| |`__cpp_lib_constexpr_dynamic_alloc`|`201907L`|[`std::destroy_at`](/reference/memory/destroy_at.md)ファミリと[`std::allocator`](/reference/memory/allocator.md)/[`std::alocator_traits`](/reference/memory/allocator_traits.md)の`constexpr`対応
[`std::construct_at`](/reference/memory/construct_at.md)|[``](/reference/memory.md)| -|`__cpp_lib_constexpr_functional`|`201907L`|`std::invoke`、`std::reference_wrapper`、`std::not_fn`、`std::bind_front`、`std::bind`、`std::mem_fn`の`constexpr`対応|[``](/reference/functional.md)| +|`__cpp_lib_constexpr_functional`|`201907L`|[`std::invoke`](/reference/functional/invoke.md)、[`std::reference_wrapper`](/reference/functional/reference_wrapper.md)、[`std::not_fn`](/reference/functional/not_fn.md)、[`std::bind_front`](/reference/functional/bind_front.md)、[`std::bind`](/reference/functional/bind.md)、[`std::mem_fn`](/reference/functional/mem_fn.md)の`constexpr`対応|[``](/reference/functional.md)| |`__cpp_lib_constexpr_iterator`|`201811L`|[`back_insert_iterator`](/reference/iterator/back_insert_iterator.md)、[`front_insert_iterator`](/reference/iterator/front_insert_iterator.md)、[`insert_iterator`](/reference/iterator/insert_iterator.md)の`constexpr`対応|[``](/reference/iterator.md)| |`__cpp_lib_constexpr_memory`|`201811L`|[`std::pointer_traits`](/reference/memory/pointer_traits.md)の`constexpr`対応|[``](/reference/memory.md)| |`__cpp_lib_constexpr_numeric`|`201911L`|[``](/reference/numeric.md)の数値アルゴリズムの`constexpr`対応|[``](/reference/numeric.md)| @@ -75,9 +75,9 @@ |`__cpp_lib_endian`|`201907L`|[`std::endian`](/reference/bit/endian.md)|[``](/reference/bit.md)| |`__cpp_lib_erase_if`|`202002L`|各コンテナに対する`std::erase`、`std::erase_if`の特殊化|[``](/reference/string.md)
[``](/reference/deque.md)
[``](/reference/forward_list.md)
[``](/reference/list.md)
[``](/reference/vector.md)
[``](/reference/map.md)
[``](/reference/set.md)
[``](/reference/unordered_map.md)
[``](/reference/unordered_set.md)| |`__cpp_lib_execution`|`201902L`|[`std::execution::unsequenced_policy`](/reference/execution/execution/execution_policy.md)|[``](/reference/execution.md)| -|`__cpp_lib_format`|`201907L`
`202106L`
`202110L`|``ヘッダ
コンパイル時フォーマット文字列検査/[`std::vformat`](/reference/format/vformat.md)のコードサイズ削減
`std::chrono`のフォーマットにおけるロケール指定の修正/`const`だとフォーマットできない型に対する対応|[``](/reference/format.md)| +|`__cpp_lib_format`|`201907L`
`202106L`
`202110L`|[``](/reference/format.md)ヘッダ
コンパイル時フォーマット文字列検査/[`std::vformat`](/reference/format/vformat.md)のコードサイズ削減
`std::chrono`のフォーマットにおけるロケール指定の修正/`const`だとフォーマットできない型に対する対応|[``](/reference/format.md)| |`__cpp_lib_generic_unordered_lookup`|`201811L`|非順序連想コンテナの`find(), count(), contains(), equal_range()`に対するHeterogeneous Overload追加|[``](/reference/unordered_map.md)
[``](/reference/unordered_set.md)| -|`__cpp_lib_int_pow2`|`202002L`|``の2の冪乗に関する操作を行う関数の名前変更|[``](/reference/bit.md)| +|`__cpp_lib_int_pow2`|`202002L`|[``](/reference/bit.md)の2の冪乗に関する操作を行う関数の名前変更|[``](/reference/bit.md)| |`__cpp_lib_integer_comparison_functions`|`202002L`|[`std::cmp_equal()`](/reference/utility/cmp_equal.md)等の整数比較関数と[`std::in_range()`](/reference/utility/in_range.md)|[``](/reference/utility.md)| |`__cpp_lib_interpolate`|`201902L`|[`std::lerp()`](/reference/cmath/lerp.md)と[`std::midpoint()`](/reference/numeric/midpoint.md)|[``](/reference/cmath.md)
[``](/reference/numeric.md)| |`__cpp_lib_is_constant_evaluated`|`201811L`|[`std::is_constant_evaluated()`](/reference/type_traits/is_constant_evaluated.md)|[``](/reference/type_traits.md)| @@ -86,7 +86,7 @@ |`__cpp_lib_is_pointer_interconvertible`|`201907L`|[`std::is_corresponding_member`](/reference/type_traits/is_corresponding_member.md)と[`std::is_pointer_interconvertible_base_of`](/reference/type_traits/is_pointer_interconvertible_base_of.md)|[``](/reference/type_traits.md)| |`__cpp_lib_jthread`|`201911L`|[`std::jthread`](/reference/thread/jthread.md)と`stop_token`による協調的キャンセル機構|[``](/reference/stop_token.md)
[``](/reference/thread.md)| |`__cpp_lib_latch`|`201907L`|[`std::latch`](/reference/latch/latch.md)|[``](/reference/latch.md)| -|`__cpp_lib_list_remove_return_type`|`201806L`|`std::list`と`std::forward_list`の`remove(), remove_if(), unique()`の戻り値型変更|[``](/reference/forward_list.md)
[``](/reference/list.md)| +|`__cpp_lib_list_remove_return_type`|`201806L`|[`std::list`](/reference/list/list.md)と[`std::forward_list`](/reference/forward_list/forward_list.md)の`remove(), remove_if(), unique()`の戻り値型変更|[``](/reference/forward_list.md)
[``](/reference/list.md)| |`__cpp_lib_math_constants`|`201907L`|数学定数|[``](/reference/numbers.md)| |`__cpp_lib_polymorphic_allocator`|`201902L`|[`std::pmr::polymorphic_allocator`](/reference/memory_resource/polymorphic_allocator.md)の改修|[``](/reference/memory.md)| |`__cpp_lib_ranges`|`201911L`
`202106L`
`202110L`|RangeライブラリとRangeアルゴリズム
[`view`](/reference/ranges/view.md)コンセプトのデフォルト構築要求を削除
所有権を持つ`view`の許可と[`owning_view`](/reference/ranges/owning_view.md)|[``](/reference/algorithm.md)
[``](/reference/functional.md)
[``](/reference/iterator.md)
[``](/reference/memory.md)
[``](/reference/ranges.md)| @@ -97,10 +97,10 @@ |`__cpp_lib_smart_ptr_for_overwrite`|`202002L`|[`std::make_shared_for_overwrite()`](/reference/memory/make_shared_for_overwrite.md)と[`std::allocate_shared_for_overwrite()`](/reference/memory/allocate_shared_for_overwrite.md)|[``](/reference/memory.md)| |`__cpp_lib_source_location`|`201907L`|[`std::source_location`](/reference/source_location/source_location.md)|[``](/reference/source_location.md)| |`__cpp_lib_span`|`202002L`|[`std::span`](/reference/span/span.md)|[``](/reference/span.md)| -|`__cpp_lib_ssize`|`201902L`|[`std::ssize()`](/reference/iterator/ssize.md)と`std::span`で使用する整数型の符号なし(`size_t`)への変更|[``](/reference/iterator.md)| -|`__cpp_lib_starts_ends_with`|`201711L`|`std::string`と`std::string_view`の`starts_with()`と`ends_with()`|[``](/reference/string.md)
[``](/reference/string_view.md)| -|`__cpp_lib_string_view`|`201803L`|`std::string`と`std::string_view`のイテレータの`constexpr`対応|[``](/reference/string.md)
[``](/reference/string_view.md)| -|`__cpp_lib_syncbuf`|`201803L`|同期化出力ストリーム(`std::osyncstream`)とバッファ(`std::syncbuf`)|[``](/reference/syncstream.md)| +|`__cpp_lib_ssize`|`201902L`|[`std::ssize()`](/reference/iterator/ssize.md)と[`std::span`](/reference/span/span.md)で使用する整数型の符号なし(`size_t`)への変更|[``](/reference/iterator.md)| +|`__cpp_lib_starts_ends_with`|`201711L`|[`std::string`](/reference/string/basic_string.md)と[`std::string_view`](/reference/string_view/basic_string_view.md)の`starts_with()`と`ends_with()`|[``](/reference/string.md)
[``](/reference/string_view.md)| +|`__cpp_lib_string_view`|`201803L`|[`std::string`](/reference/string/basic_string.md)と[`std::string_view`](/reference/string_view/basic_string_view.md)のイテレータの`constexpr`対応|[``](/reference/string.md)
[``](/reference/string_view.md)| +|`__cpp_lib_syncbuf`|`201803L`|同期化出力ストリーム([`std::osyncstream`](/reference/syncstream/basic_osyncstream.md))とバッファ([`std::syncbuf`](/reference/syncstream/basic_syncbuf.md))|[``](/reference/syncstream.md)| |`__cpp_lib_three_way_comparison`|`201907L`|標準ライブラリの三方比較演算子対応|[``](/reference/compare.md)| |`__cpp_lib_to_address`|`201711L`|[`std::to_address()`](/reference/memory/to_address.md)|[``](/reference/memory.md)| |`__cpp_lib_to_array`|`201907L`|[`std::to_array()`](/reference/array/to_array.md)|[``](/reference/array.md)| diff --git a/lang/cpp23/feature_test_macros.md b/lang/cpp23/feature_test_macros.md index 21f18dbc39..ff91490d2e 100644 --- a/lang/cpp23/feature_test_macros.md +++ b/lang/cpp23/feature_test_macros.md @@ -53,8 +53,8 @@ |`__cpp_lib_flat_map`|`202207L`|[`std::flat_map`](/reference/flat_map.md)と`std::flat_multimap`の追加|[``](/reference/flat_map.md)| |`__cpp_lib_flat_set`|`202207L`|`std::flat_set`と`std::flat_multiset`の追加|``| |`__cpp_lib_format`|`202207L`|`std::format`の時刻型のローカライズ対応|[``](/reference/format.md)| -|`__cpp_lib_format_ranges`|`202207L`|`std::formatter`のRange対応|[``](/reference/format.md)| -|`__cpp_lib_formatters`|`202302L`|`std::formatter`の`std::stacktrace`対応と`std::thread::id`対応|[``](/reference/stacktrace.md)
[``](/reference/thread.md)| +|`__cpp_lib_format_ranges`|`202207L`|[`std::formatter`](/reference/format/formatter.md)のRange対応|[``](/reference/format.md)| +|`__cpp_lib_formatters`|`202302L`|[`std::formatter`](/reference/format/formatter.md)の[`std::stacktrace`](/reference/stacktrace/basic_stacktrace.md)対応と[`std::thread::id`](/reference/thread/thread/id.md)対応|[``](/reference/stacktrace.md)
[``](/reference/thread.md)| |`__cpp_lib_forward_like`|`202207L`|[`std::forward_like()`](/reference/utility/forward_like.md)の追加|[``](/reference/utility.md)| |`__cpp_lib_generator`|`202207L`|[`std::generator`](/reference/generator/generator.md)の追加|[``](/reference/generator.md)| |`__cpp_lib_invoke_r`|`202106L`|[`std::invoke_r()`](/reference/functional/invoke_r.md)の追加|[``](/reference/functional.md)| @@ -68,7 +68,7 @@ |`__cpp_lib_optional`|`202110L`|[`std::optional`](/reference/optional/optional.md)にモナド操作を追加|[``](/reference/optional.md)| |`__cpp_lib_out_ptr`|`202106L`|[`std::out_ptr`](/reference/memory/out_ptr.md)と[`std::inout_ptr`](/reference/memory/inout_ptr.md)の追加|[``](/reference/memory.md)| |`__cpp_lib_ranges`|`202302L`|[`std::ranges::range_adaptor_closure`](/reference/ranges/range_adaptor_closure.md)の追加
[``](/reference/ranges.md)の様々な機能追加|[``](/reference/algorithm.md)
[``](/reference/functional.md)
[``](/reference/iterator.md)
[``](/reference/memory.md)
[``](/reference/ranges.md)| -|`__cpp_lib_ranges_as_const`|`202207L`|`std::ranges::cbegin`が常に定数イテレータを返すようにする。[`std::ranges::as_const_view`](/reference/ranges/as_const_view.md)の追加|[``](/reference/ranges.md)| +|`__cpp_lib_ranges_as_const`|`202207L`|[`std::ranges::cbegin`](/reference/ranges/cbegin.md)が常に定数イテレータを返すようにする。[`std::ranges::as_const_view`](/reference/ranges/as_const_view.md)の追加|[``](/reference/ranges.md)| |`__cpp_lib_ranges_as_rvalue`|`202207L`|[`std::ranges::as_rvalue_view`](/reference/ranges/as_rvalue_view.md)の追加|[``](/reference/ranges.md)| |`__cpp_lib_ranges_cartesian_product`|`202207L`|[`std::ranges::cartesian_product_view`](/reference/ranges/cartesian_product_view.md)の追加|[``](/reference/ranges.md)| |`__cpp_lib_ranges_chunk`|`202202L`|[`std::ranges::chunk_view`](/reference/ranges/chunk_view.md)の追加|[``](/reference/ranges.md)| @@ -90,7 +90,7 @@ |`__cpp_lib_spanstream`|`202106L`|``の追加|``| |`__cpp_lib_stacktrace`|`202011L`|[``](/reference/stacktrace.md)の追加|[``](/reference/stacktrace.md)| |`__cpp_lib_start_lifetime_as`|`202207L`|`std::start_lifetime_as()`の追加|[``](/reference/memory.md)| -|`__cpp_lib_stdatomic_h`|`202011L`|[``](/reference/stdatomic.h.md)の追加|``| +|`__cpp_lib_stdatomic_h`|`202011L`|[``](/reference/stdatomic.h.md)の追加|[``](/reference/stdatomic.h.md)| |`__cpp_lib_string_contains`|`202011L`|[`std::basic_string::contains()`](/reference/string/basic_string/contains.md)と[`std::basic_string_view::contains()`](/reference/string_view/basic_string_view/contains.md)の追加|[``](/reference/string.md)
[``](/reference/string_view.md)| |`__cpp_lib_string_resize_and_overwrite`|`202110L`|[`std::basic_string::resize_and_overwrite()`](/reference/string/basic_string/resize_and_overwrite.md)の追加|[``](/reference/string.md)| |`__cpp_lib_to_underlying`|`202102L`|[`std::to_underlying()`](/reference/utility/to_underlying.md)の追加|[``](/reference/utility.md)| From d1f4efbd30eaa3143cfd115aec369a94255e4749 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 21 Oct 2024 18:05:58 +0900 Subject: [PATCH 1255/3948] =?UTF-8?q?C++23=E3=81=8C=E6=AD=A3=E5=BC=8F?= =?UTF-8?q?=E7=99=BA=E8=A1=8C=E3=81=95=E3=82=8C=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- international-standard.md | 3 ++- lang/cpp23.md | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/international-standard.md b/international-standard.md index 7e0c2d822e..2e0d4004d4 100644 --- a/international-standard.md +++ b/international-standard.md @@ -13,7 +13,7 @@ C++ の標準規格は、他にも各国の規格化団体によって国際標 | 通称†1 | 名称 | 参照する規格案†2 | 規格案・原案 | `__cplusplus` | |:--|:--|:--|:--|:--| | [C++26](lang/cpp26.md) (C++2c) | ISO/IEC 14882:2026 (予定) | N4986([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/n4986.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/)) | N4986 N4981 N4971 N4964 N4958 | -- | -| [C++23](lang/cpp23.md) (C++2b) | ISO/IEC 14882:2023 (予定) | N4950([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4950.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4950/)) | N4950 N4944 N4928 N4917 N4910 N4901 N4892 N4885 N4878
N4868 N4861 | `202302L` | +| [C++23](lang/cpp23.md) (C++2b) | ISO/IEC 14882:2024 | N4950([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4950.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4950/)) | N4950 N4944 N4928 N4917 N4910 N4901 N4892 N4885 N4878
N4868 N4861 | `202302L` | | [C++20](lang/cpp20.md) (C++2a) | ISO/IEC 14882:2020 | N4861†3([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/n4861.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4861/)) | N4860 N4849 N4842 N4835 N4830
N4820 N4810 N4800 N4791 N4788†4
N4778 N4762 N4750 N4741 N4727
N4713 N4700 N4687 | `202002L` | | [C++17](lang/cpp17.md) (C++1z) | ISO/IEC 14882:2017 | N4659([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4659.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4659/)) | N4660 N4659 N4640 N4618 N4606
N4594 N4582 N4567 N4527 N4431
N4296 | `201703L` | | [C++14](lang/cpp14.md) (C++1y) | ISO/IEC 14882:2014 | N4140([PDF](https://github.com/cplusplus/draft/blob/master/papers/n4140.pdf?raw=true)/[HTML](https://timsong-cpp.github.io/cppwp/n4140/)) | N4141 N4140 N3937 N3936 N3797
N3691 N3690 N3485 N3376 N3337 | `201402L` | @@ -66,6 +66,7 @@ C++ の標準規格は、他にも各国の規格化団体によって国際標 ## 参照 - 標準規格 + - [ISO/IEC 14882:2024 - Programming languages — C++](https://www.iso.org/standard/83626.html) - [ISO/IEC 14882:2020 - Programming languages — C++](https://www.iso.org/standard/79358.html) - [ISO/IEC 14882:2017 - Programming languages -- C++](https://www.iso.org/standard/68564.html) - [ISO/IEC 14882:2014 - Information technology -- Programming languages -- C++](https://www.iso.org/standard/64029.html) diff --git a/lang/cpp23.md b/lang/cpp23.md index f994af28f9..6119203283 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -1,7 +1,7 @@ # C++23 ## 概要 -C++23とは、2023年中に改訂される予定の、C++バージョンの通称である。 +C++23とは、2020年中に改訂され、ISO/IEC 14882:2024で標準規格化されたC++バージョンの通称である。 このバージョンは、策定中のためC++2bと呼ばれることがある。「(C++20である2020年の次の) 202b年にリリースされる」という伏せ字として「b」が使われているが、3年周期に次のバージョンが策定されることが決まっているため、伏せ字になっている年数がずれることはない。 From 81838cc947e5c5892e34637a35cfca33ed274bd8 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 25 Oct 2024 19:39:14 +0900 Subject: [PATCH 1256/3948] =?UTF-8?q?C++26=20Working=20Draft=E3=82=92?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=20#1357?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- international-standard.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/international-standard.md b/international-standard.md index 2e0d4004d4..0740eda42e 100644 --- a/international-standard.md +++ b/international-standard.md @@ -12,7 +12,7 @@ C++ の標準規格は、他にも各国の規格化団体によって国際標 | 通称†1 | 名称 | 参照する規格案†2 | 規格案・原案 | `__cplusplus` | |:--|:--|:--|:--|:--| -| [C++26](lang/cpp26.md) (C++2c) | ISO/IEC 14882:2026 (予定) | N4986([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/n4986.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/)) | N4986 N4981 N4971 N4964 N4958 | -- | +| [C++26](lang/cpp26.md) (C++2c) | ISO/IEC 14882:2026 (予定) | N4993([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/n4993.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/)) | N4993 N4986 N4981 N4971 N4964 N4958 | -- | | [C++23](lang/cpp23.md) (C++2b) | ISO/IEC 14882:2024 | N4950([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4950.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4950/)) | N4950 N4944 N4928 N4917 N4910 N4901 N4892 N4885 N4878
N4868 N4861 | `202302L` | | [C++20](lang/cpp20.md) (C++2a) | ISO/IEC 14882:2020 | N4861†3([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/n4861.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4861/)) | N4860 N4849 N4842 N4835 N4830
N4820 N4810 N4800 N4791 N4788†4
N4778 N4762 N4750 N4741 N4727
N4713 N4700 N4687 | `202002L` | | [C++17](lang/cpp17.md) (C++1z) | ISO/IEC 14882:2017 | N4659([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4659.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4659/)) | N4660 N4659 N4640 N4618 N4606
N4594 N4582 N4567 N4527 N4431
N4296 | `201703L` | From 7de58d9f34f0503f97ee10ccec8f90ff48d5cf6d Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 28 Oct 2024 14:25:08 +0900 Subject: [PATCH 1257/3948] =?UTF-8?q?string::contains=20:=20=E3=83=90?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3=E8=A1=A8=E8=A8=98=E3=81=AE?= =?UTF-8?q?=E3=83=9F=E3=82=B9=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://x.com/shogo3142/status/1850585368716059021 --- reference/string/basic_string/contains.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/string/basic_string/contains.md b/reference/string/basic_string/contains.md index 52cd09cc0f..ebb7a32871 100644 --- a/reference/string/basic_string/contains.md +++ b/reference/string/basic_string/contains.md @@ -70,12 +70,12 @@ int main() { ## バージョン ### 言語 -- C++20 +- C++23 ### 処理系 - [Clang](/implementation.md#clang): 12.0 [mark verified] -- [GCC](/implementation.md#gcc): -- [Visual C++](/implementation.md#visual_cpp): ?? +- [GCC](/implementation.md#gcc): 11 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 [mark verified] ## 参照 From 19bc6aeae5911beec14833e57b007a067f2b424b Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 1 Nov 2024 11:26:03 +0900 Subject: [PATCH 1258/3948] =?UTF-8?q?unordered=E3=81=AEinsert=20:=20hint?= =?UTF-8?q?=E3=81=AE=E6=B4=BB=E7=94=A8=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6?= =?UTF-8?q?=E3=81=AEMicrosoft=E3=81=AE=E8=A8=98=E4=BA=8B=E3=82=92=E5=8F=82?= =?UTF-8?q?=E7=85=A7=E3=81=AB=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/unordered_map/unordered_map/insert.md | 1 + reference/unordered_map/unordered_multimap/insert.md | 1 + reference/unordered_set/unordered_multiset/insert.md | 1 + reference/unordered_set/unordered_set/insert.md | 1 + 4 files changed, 4 insertions(+) diff --git a/reference/unordered_map/unordered_map/insert.md b/reference/unordered_map/unordered_map/insert.md index 6b0e903f34..4eec85b023 100644 --- a/reference/unordered_map/unordered_map/insert.md +++ b/reference/unordered_map/unordered_map/insert.md @@ -314,3 +314,4 @@ inline void unordered_map::insert(initializer_list::insert(initializer_l - [LWG Issue 2156. Unordered containers' reserve(n) reserves for n-1 elements](https://wg21.cmeerw.net/lwg/issue2156) - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) - (9), (10)経緯となる提案文書 +- [How useful is the hint passed to the std::unordered_... collections? - The Old New Thing](https://devblogs.microsoft.com/oldnewthing/20241028-00/?p=110428) diff --git a/reference/unordered_set/unordered_multiset/insert.md b/reference/unordered_set/unordered_multiset/insert.md index 8731400d77..918f905b2b 100644 --- a/reference/unordered_set/unordered_multiset/insert.md +++ b/reference/unordered_set/unordered_multiset/insert.md @@ -245,3 +245,4 @@ inline void unordered_multiset::insert(std::initiali - 安定性の保証が規定された経緯のレポート - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) - (5), (6)経緯となる提案文書 +- [How useful is the hint passed to the std::unordered_... collections? - The Old New Thing](https://devblogs.microsoft.com/oldnewthing/20241028-00/?p=110428) diff --git a/reference/unordered_set/unordered_set/insert.md b/reference/unordered_set/unordered_set/insert.md index e6779f65ad..c6eb0e16e0 100644 --- a/reference/unordered_set/unordered_set/insert.md +++ b/reference/unordered_set/unordered_set/insert.md @@ -260,3 +260,4 @@ inline void unordered_set::insert(initializer_list Date: Sun, 3 Nov 2024 03:25:04 +0900 Subject: [PATCH 1259/3948] =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=82=B9=E3=83=88?= =?UTF-8?q?=E3=83=A9=E3=82=AF=E3=82=BF=E5=BC=95=E6=95=B0=E3=81=AE=E8=AA=A4?= =?UTF-8?q?=E3=82=8A=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/functional/function/op_constructor.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/functional/function/op_constructor.md b/reference/functional/function/op_constructor.md index f0a1d8bceb..5cddc1bad4 100644 --- a/reference/functional/function/op_constructor.md +++ b/reference/functional/function/op_constructor.md @@ -14,7 +14,7 @@ function(function&& f); // (4) C++17まで function(function&& f) noexcept; // (4) C++20 template -function(F f); // (5) +function(F&& f); // (5) template function(allocator_arg_t, const Alloc& alloc) noexcept; // (6) C++17で削除 From daf75340c859eaf615f19f0b5ce321f42bc801be Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sun, 3 Nov 2024 04:55:08 +0900 Subject: [PATCH 1260/3948] =?UTF-8?q?function=E3=81=AE=E3=82=B3=E3=83=B3?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=83=A9=E3=82=AF=E3=82=BF=20:=20C++23?= =?UTF-8?q?=E3=81=A7=E3=81=AEfunction(F)=E3=81=8B=E3=82=89function(F&&)?= =?UTF-8?q?=E3=81=B8=E3=81=AE=E5=A4=89=E6=9B=B4=E3=82=92=E8=A8=98=E8=BC=89?= =?UTF-8?q?=20#1358?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../functional/function/op_constructor.md | 57 +++++++++++++++---- 1 file changed, 47 insertions(+), 10 deletions(-) diff --git a/reference/functional/function/op_constructor.md b/reference/functional/function/op_constructor.md index 5cddc1bad4..e3d6172f54 100644 --- a/reference/functional/function/op_constructor.md +++ b/reference/functional/function/op_constructor.md @@ -6,15 +6,17 @@ * cpp11[meta cpp] ```cpp -function() noexcept; // (1) -function(nullptr_t) noexcept; // (2) -function(const function& f); // (3) +function() noexcept; // (1) C++11 +function(nullptr_t) noexcept; // (2) C++11 +function(const function& f); // (3) C++11 -function(function&& f); // (4) C++17まで +function(function&& f); // (4) C++11 function(function&& f) noexcept; // (4) C++20 template -function(F&& f); // (5) +function(F f); // (5) C++11 +template +function(F&& f); // (5) C++23 template function(allocator_arg_t, const Alloc& alloc) noexcept; // (6) C++17で削除 @@ -34,11 +36,44 @@ function(allocator_arg_t, const Alloc& alloc, F f); // (10) C++17 * nullptr_t[link /reference/cstddef/nullptr_t.md] * allocator_arg_t[link /reference/memory/allocator_arg_t.md] -## 要件 -- (5), (10) : - - `F`はコピー構築可能であること。 - - `F`のコピーコンストラクタとデストラクタは、例外を投げるべきではない。 - - C++11まで : `F`は、パラメータとして`ArgTypes...`型をとり、戻り値として`R`型を返す関数ポインタ、メンバ関数ポインタ、メンバ変数ポインタ、または関数オブジェクトであること。 +## 概要 +`function`オブジェクトを構築する。 + +- (1) : デフォルト構築。空の`function`オブジェクトを構築する +- (2) : `nullptr`からの構築。空の`function`オブジェクトを構築する +- (3) : コピー構築する +- (4) : ムーブ構築する +- (5) : 任意の型の関数ポインタ、メンバポインタ、関数オブジェクトを受け取って構築する +- (6) : アロケータをとって空の`function`オブジェクトを構築する +- (7) : アロケータと`nullptr`をとって空の`function`オブジェクトを構築する +- (8) : アロケータをとってコピー構築する +- (9) : アロケータをとってムーブ構築する +- (10) : アロケータと、任意の型の関数ポインタ、メンバポインタ、関数オブジェクトを受け取って構築する + + +## テンプレートパラメータ制約 +[`decay_t`](/reference/type_traits/decay.md)``を`FD`として、 + +- (5) : + - C++11 + - `F`は、パラメータとして`ArgTypes...`型をとり、戻り値として`R`型を返す関数ポインタ、メンバ関数ポインタ、メンバ変数ポインタ、または関数オブジェクトであること + - C++23 + - `F`が`function`ではないこと + - `FD`は、パラメータとして`ArgTypes...`型をとり、戻り値として`R`型を返す関数ポインタ、メンバ関数ポインタ、メンバ変数ポインタ、または関数オブジェクトであること +- (10) : + - `F`はコピー構築可能であること + - `F`のコピーコンストラクタとデストラクタは、例外を投げるべきではない + - `F`は、パラメータとして`ArgTypes...`型をとり、戻り値として`R`型を返す関数ポインタ、メンバ関数ポインタ、メンバ変数ポインタ、または関数オブジェクトであること + + +## 適格要件 +- (5) : + - C++11 + - `F`はコピー構築可能であること + - `F`は、パラメータとして`ArgTypes...`型をとり、戻り値として`R`型を返す関数ポインタ、メンバ関数ポインタ、メンバ変数ポインタ、または関数オブジェクトであること。 + - C++23 + - `FD`はコピー構築可能であること + - `FD`は`F`から構築可能であること ## 効果 @@ -242,3 +277,5 @@ int main() - C++14から、(5)と(10)でシグニチャが合わない関数オブジェクトが渡された場合に、SFINAEされるようになった。 - [P0302R1 Removing Allocator Support in `std::function` (rev 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0302r1.html) - [P0771R1 std::function move constructor should be noexcept](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0771r1.pdf) +- [LWG Issue 2774. `std::function` construction vs assignment](https://cplusplus.github.io/LWG/issue2774) + - C++23から、`function(F)`のオーバーロードが`function(F&&)`に変更された From 3f56e5b963a9388f11eb9be51ecc0753b60b8dcf Mon Sep 17 00:00:00 2001 From: biobios Date: Tue, 5 Nov 2024 00:48:02 +0900 Subject: [PATCH 1261/3948] fix typo --- reference/concepts/Invoke.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/concepts/Invoke.md b/reference/concepts/Invoke.md index 02b077b0a6..29653b1dd8 100644 --- a/reference/concepts/Invoke.md +++ b/reference/concepts/Invoke.md @@ -34,10 +34,10 @@ C++における関数呼び出しという性質を抽象化しまとめた、 ## 要件(C++17) 1. 仮想操作 *INVOKE*`(f, t1, t2, ..., tN)` を次のように定義する。 - - `f` が型 `T` のメンバ関数へのポインタであり、[`is_baseof_v`](/reference/type_traits/is_base_of.md)`> == true`(`t1` が `T` または `T` を継承した型のオブジェクト/参照)であるとき、 `(t1.*f)(t2, ..., tN)` と同じ効果を持つ。 + - `f` が型 `T` のメンバ関数へのポインタであり、[`is_base_of_v`](/reference/type_traits/is_base_of.md)`> == true`(`t1` が `T` または `T` を継承した型のオブジェクト/参照)であるとき、 `(t1.*f)(t2, ..., tN)` と同じ効果を持つ。 - `f` が型 `T` のメンバ関数へのポインタであり、[`decay_t`](/reference/type_traits/decay.md)``が[`reference_wrapper`](/reference/functional/reference_wrapper.md)(`t1`が[`reference_wrapper`](/reference/functional/reference_wrapper.md)の特殊化)であるとき、 `(t1.get().*f)(t2, ..., tN)` と同じ効果を持つ。 - `f` が型 `T` のメンバ関数へのポインタであり、 `t1` が上記の条件に当てはまらない場合(例えば、t1が`T`のポインタ)、`((*t1).*f)(t2, ..., tN)` と同じ効果を持つ。 - - `N == 1` で、`f` が型 `T` のメンバオブジェクトへのポインタであり、[`is_baseof_v`](/reference/type_traits/is_base_of.md)`> == true`(`t1` が `T` または `T` を継承した型のオブジェクト/参照)であるとき、 `t1.*f` と同じ効果を持つ。 + - `N == 1` で、`f` が型 `T` のメンバオブジェクトへのポインタであり、[`is_base_of_v`](/reference/type_traits/is_base_of.md)`> == true`(`t1` が `T` または `T` を継承した型のオブジェクト/参照)であるとき、 `t1.*f` と同じ効果を持つ。 - `N == 1` で、`f` が型 `T` のメンバオブジェクトへのポインタであり、[`decay_t`](/reference/type_traits/decay.md)``が[`reference_wrapper`](/reference/functional/reference_wrapper.md)(`t1`が[`reference_wrapper`](/reference/functional/reference_wrapper.md)の特殊化)であるとき、 `t1.get().*f` と同じ効果を持つ。 - `N == 1` で、`f` が型 `T` のメンバオブジェクトへのポインタであり、`t1` が上記の条件に当てはまらない場合(例えば、t1が`T`のポインタ)、 `(*t1).*f` と同じ効果を持つ。 - 上記の条件のどれにも当てはまらない場合、 `f(t1, t2, ..., tN)` と同じ効果を持つ。 @@ -48,10 +48,10 @@ C++における関数呼び出しという性質を抽象化しまとめた、 ## 要件(C++20) 1. 仮想操作 *INVOKE*`(f, t1, t2, ..., tN)` を次のように定義する。 - - `f` が型 `T` のメンバ関数へのポインタであり、[`is_baseof_v`](/reference/type_traits/is_base_of.md)`> == true`(`t1` が `T` または `T` を継承した型のオブジェクト/参照)であるとき、 `(t1.*f)(t2, ..., tN)` と同じ効果を持つ。 + - `f` が型 `T` のメンバ関数へのポインタであり、[`is_base_of_v`](/reference/type_traits/is_base_of.md)`> == true`(`t1` が `T` または `T` を継承した型のオブジェクト/参照)であるとき、 `(t1.*f)(t2, ..., tN)` と同じ効果を持つ。 - `f` が型 `T` のメンバ関数へのポインタであり、[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``が[`reference_wrapper`](/reference/functional/reference_wrapper.md)(`t1`が[`reference_wrapper`](/reference/functional/reference_wrapper.md)の特殊化)であるとき、 `(t1.get().*f)(t2, ..., tN)` と同じ効果を持つ。 - `f` が型 `T` のメンバ関数へのポインタであり、 `t1` が上記の条件に当てはまらない場合(例えば、t1が`T`のポインタ)、`((*t1).*f)(t2, ..., tN)` と同じ効果を持つ。 - - `N == 1` で、`f` が型 `T` のメンバオブジェクトへのポインタであり、[`is_baseof_v`](/reference/type_traits/is_base_of.md)`> == true`(`t1` が `T` または `T` を継承した型のオブジェクト/参照)であるとき、 `t1.*f` と同じ効果を持つ。 + - `N == 1` で、`f` が型 `T` のメンバオブジェクトへのポインタであり、[`is_base_of_v`](/reference/type_traits/is_base_of.md)`> == true`(`t1` が `T` または `T` を継承した型のオブジェクト/参照)であるとき、 `t1.*f` と同じ効果を持つ。 - `N == 1` で、`f` が型 `T` のメンバオブジェクトへのポインタであり、[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``が[`reference_wrapper`](/reference/functional/reference_wrapper.md)(`t1`が[`reference_wrapper`](/reference/functional/reference_wrapper.md)の特殊化)であるとき、 `t1.get().*f` と同じ効果を持つ。 - `N == 1` で、`f` が型 `T` のメンバオブジェクトへのポインタであり、`t1` が上記の条件に当てはまらない場合(例えば、t1が`T`のポインタ)、 `(*t1).*f` と同じ効果を持つ。 - 上記の条件のどれにも当てはまらない場合、 `f(t1, t2, ..., tN)` と同じ効果を持つ。 From 82d636081ab86da01f3f55abd6593763a121e476 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 7 Nov 2024 14:48:15 +0900 Subject: [PATCH 1262/3948] =?UTF-8?q?C++26=20=E6=9C=AA=E5=88=9D=E6=9C=9F?= =?UTF-8?q?=E5=8C=96=E5=A4=89=E6=95=B0=E3=81=AE=E8=AA=AD=E3=81=BF=E5=8F=96?= =?UTF-8?q?=E3=82=8A=20:=20=E6=B1=BA=E5=AE=9A=E3=81=97=E3=81=9F=E8=A8=B3?= =?UTF-8?q?=E8=AA=9E=E3=82=92=E9=81=A9=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_DEFINED_WORDS.json | 5 +- implementation-status.md | 2 +- lang/cpp26.md | 2 +- ...oneous_behavior_for_uninitialized_reads.md | 66 +++++++++---------- 4 files changed, 38 insertions(+), 37 deletions(-) diff --git a/GLOBAL_DEFINED_WORDS.json b/GLOBAL_DEFINED_WORDS.json index 8202b750d7..12ce60ba87 100644 --- a/GLOBAL_DEFINED_WORDS.json +++ b/GLOBAL_DEFINED_WORDS.json @@ -23,10 +23,11 @@ }, "未規定動作": { "redirect": "未規定の動作", "yomi": "みきていどうさ" }, "未規定": { "redirect": "未規定の動作", "yomi": "みきてい" }, - "「erroneous behavior」": { - "yomi": "えろーにあすびへいびあ", + "エラー性の動作": { + "yomi": "えらーせいのどうさ", "desc": "未定義動作ではないが、誤ったプログラムの結果とされる動作。erroneous behavior (EB)。処理系によって診断や異常終了を実行することが許可されるが、処理が続行する場合もある" }, + "エラー性動作": { "redirect": "エラー性の動作", "yomi": "えらーせいどうさ" }, "処理系定義の動作": { "link": "/implementation-compliance.md#dfn-implementation-defined-behavior", "yomi": "しょりけいていぎのどうさ", diff --git a/implementation-status.md b/implementation-status.md index 7efadc50eb..e7129063da 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -305,7 +305,7 @@ | P0609R3: [構造化束縛への属性を許可](/lang/cpp26/attributes_for_structured_bindings.md) | `auto [a, b [[maybe_unused]], c] = f();`のように構造化束縛の要素に対して属性を付加できるようにする | 15 | 19 | | | | P3034R1: [モジュール宣言でのモジュール名のマクロ展開を禁止する](/lang/cpp26/module_declarations_shouldnt_be_macros.md.nolink) | `export module MACRO_NAME;`を禁止 | | | | | | P2809R3: [自明な無限ループは未定義動作ではないと規定](/lang/cpp26/trivial_infinite_loops_are_not_undefined_behavior.md.nolink) | 並行プログラムの進行保証などを考慮して無限ループを未定義動作ではないものとする | 14 | 19 | | | -| P2795R5: [未初期化変数の読み取りを"erroneous behavior"とする](/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md) | 初期化されていない自動変数の読み取りの安全性を規定する | | | | | +| P2795R5: [未初期化変数の読み取りをエラー性動作とする](/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md) | 初期化されていない自動変数の読み取りの安全性を規定する | | | | | | P2573R2: [関数宣言を削除する理由を指定できるようにする](/lang/cpp26/delete_reason.md) | `f() = delete("reason");` | 15 | 19 | | | | P2893R3: [可変引数テンプレートで`friend`宣言をできるようにする](/lang/cpp26/variadic_friends.md.nolink) | クラステンプレートの可変引数テンプレートでまとめて`friend`宣言できるようにする | 15 | | | | | P2747R2: [`constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md.nolink) | 定数式の文脈での配置`new`を許可 | | | | | diff --git a/lang/cpp26.md b/lang/cpp26.md index fff209b541..1a2b6655ef 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -17,7 +17,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | [不完全型へのポインタに対する`delete`を不適格とする](/lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md.nolink) | 未定義動作となる操作をコンパイルエラーとする | | [返却された左辺値から暗黙変換された一時オブジェクトが参照に束縛されることを禁止する](/lang/cpp26/disallow_binding_a_returned_glvalue_to_a_temporary.md.nolink) | 寿命切れの変数によって引き起こされるバグを防止する | | [要素数不明の配列を集成体初期化する規則を明確化](/lang/cpp26/clarifying_rules_for_brace_elision_in_aggregate_initialization.md.nolink) | 配列要素の集成体初期化で`{}`が省略された場合の矛盾していた規定を修正 | -| [未初期化変数の読み取りを「erroneous behavior」とする](/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md) | 初期化されていない自動変数の読み取りの安全性を規定する | +| [未初期化変数の読み取りをエラー性動作とする](/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md) | 初期化されていない自動変数の読み取りの安全性を規定する | ### 文字列 diff --git a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md index 0681c0db68..17797acbc8 100644 --- a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md +++ b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md @@ -1,4 +1,4 @@ -# 未初期化変数の読み取りを「erroneous behavior」とする [P2795R5] +# 未初期化変数の読み取りをエラー性動作とする [P2795R5] * cpp26[meta cpp] @@ -10,7 +10,7 @@ ## 概要 -C++23までは、未初期化変数 (デフォルト初期化された変数) の読み取りは未定義動作として扱われていた。C++26では、この未定義動作による安全上のリスクを低減するため、「「erroneous behavior」 (erroneous behavior; 通称 EB)」を新設してその多くに割り当てることとした。 +C++23までは、未初期化変数 (デフォルト初期化された変数) の読み取りは未定義動作として扱われていた。C++26では、この未定義動作による安全上のリスクを低減するため、「エラー性動作 (erroneous behavior; 通称 EB、別表記としてエラー性の動作)」を新設してその多くに割り当てることとした。 ```cpp example // C++23 @@ -24,7 +24,7 @@ int main() { 未初期化の値は、コンパイラやターゲット環境によって定義された固定値である。コンパイラにはこの誤りを診断することが許可され、推奨されているが、誤りを無視して有効な読み取りとして扱うことも許可されている。このコードは誤りではあるが、実行ごとに異なる動作をしたり攻撃者に値を制御されたりといったリスクはなくなる。 -「erroneous behavior」は未定義動作(一切の保証が失われる)とはちがって、動作を定めたうえで診断も可能とするものである。 +エラー性動作は未定義動作(一切の保証が失われる)とはちがって、動作を定めたうえで診断も可能とするものである。 C++26では、不定値で初期化されることを明確に指示する`[[indeterminate]]`属性も導入され、以下のような動作となる: @@ -33,56 +33,56 @@ C++26では、不定値で初期化されることを明確に指示する`[[ind void f(int) {} int main() { - int x; // xは「erroneous value」をもつ + int x; // xはエラー性の値をもつ int y [[indeterminate]]; // 意図して不定値に初期化されることを指示 - f(x); // 「erroneous behavior」 (「erroneous value」の読み取り) + f(x); // エラー性動作 (エラー性の値の読み取り) f(y); // 未定義動作 (不定値の読み取り) } ``` ## 仕様 -- 自動記憶域期間をもつオブジェクトの記憶域は確保時点で「erroneous value」をもつとされ、処理系がプログラムの状態に依存せず決定する何らかの値で埋められる +- 自動記憶域期間をもつオブジェクトの記憶域は確保時点で「エラー性の値 (erroneous value)」をもつとされ、処理系がプログラムの状態に依存せず決定する何らかの値で埋められる - 動的記憶域期間であれば不定値、静的・スレッド記憶域期間であればゼロで埋められる。C++23までは自動記憶域期間も不定値で埋められていた -- 初期化されなかったスカラ型オブジェクトなど、値表現(パディングは含まない)内のいずれかのビットに「erroneous value」をもつオブジェクトは「erroneous value」をもつとされる -- 式が評価された結果として「erroneous value」が生成された場合、「erroneous behavior」を引き起こす - - ただし、`unsigned char`(およびunsignedとなる場合は`char`)もしくは[`std::byte`](/reference/cstddef/byte.md)型の「erroneous value」がこれらの型のオブジェクトの初期化・代入に使用される場合や値が破棄される場合は「erroneous behavior」にならない +- 初期化されなかったスカラ型オブジェクトなど、値表現(パディングは含まない)内のいずれかのビットにエラー性の値をもつオブジェクトはエラー性の値をもつとされる +- 式が評価された結果としてエラー性の値が生成された場合、エラー性動作を引き起こす + - ただし、`unsigned char`(およびunsignedとなる場合は`char`)もしくは[`std::byte`](/reference/cstddef/byte.md)型のエラー性の値がこれらの型のオブジェクトの初期化・代入に使用される場合や値が破棄される場合はエラー性動作にならない - これらのルールは、式が評価された結果として不定値が生成された場合に未定義の動作を引き起こすとする従来のルールと同様である -- 「erroneous behavior」を引き起こしたうえで生成された値は、後続の処理では「erroneous value」とはみなされない +- エラー性動作を引き起こしたうえで生成された値は、後続の処理ではエラー性の値とはみなされない ```cpp example #include int g(bool b) { unsigned char c; - unsigned char d = c; // 「erroneous behavior」ではない。dは「erroneous value」をもつ + unsigned char d = c; // エラー性動作ではない。dはエラー性の値をもつ - assert(c == d); // 常に真、「erroneous behavior」 (整数昇格) + assert(c == d); // 常に真、エラー性動作 (整数昇格) - int e = d; // 「erroneous behavior」 (型変換) - return b ? d : 0; // bがtrueの場合に「erroneous behavior」 + int e = d; // エラー性動作 (型変換) + return b ? d : 0; // bがtrueの場合にエラー性動作 } int main() { int d1, d2; - int e1 = d1; // 「erroneous behavior」 - int e2 = d1; // 「erroneous behavior」 + int e1 = d1; // エラー性動作 + int e2 = d1; // エラー性動作 // 処理が続行した場合… - assert(e1 == e2); // 常に真、「erroneous behavior」ではない。 - // 「erroneous behavior」の結果で生成された値 (e1とe2) は、 - // 「erroneous value」とはみなされない - assert(e1 == d1); // 常に真、「erroneous behavior」 - assert(e2 == d1); // 常に真、「erroneous behavior」 - - // 「erroneous behavior」ではないが - // d2は「erroneous value」をもつ + assert(e1 == e2); // 常に真、エラー性動作ではない。 + // エラー性動作の結果で生成された値 (e1とe2) は、 + // エラー性の値とはみなされない + assert(e1 == d1); // 常に真、エラー性動作 + assert(e2 == d1); // 常に真、エラー性動作 + + // エラー性動作ではないが + // d2はエラー性動作をもつ std::memcpy(&d2, &d1, sizeof(int)); - assert(e1 == d2); // 常に真、「erroneous behavior」 - assert(e2 == d2); // 常に真、「erroneous behavior」 + assert(e1 == d2); // 常に真、エラー性動作 + assert(e2 == d2); // 常に真、エラー性動作 } ``` @@ -110,21 +110,21 @@ int main() { ``` ## 備考 -- 以下のようなケースでは、erroneous behaviorではなく未定義動作を引き起こす可能性がある: +- 以下のようなケースでは、エラー性動作ではなく未定義動作を引き起こす可能性がある: ```cpp - T* p; // 未初期化のポインタ。erroneous value (例としてヌルポインタ) をもつ + T* p; // 未初期化のポインタ。エラー性の値 (例としてヌルポインタ) をもつ bool b; // 未初期化の真理値。 // bool値として妥当な値表現をもたない可能性がある // (例: 値表現が8bitで{0x00(false), 0x01(true)}の // 2通りのみとする処理系で0xCCをもつなど) f(*p); // 間接参照は未定義動作を引き起こす - g(b); // bが妥当な値表現をもつ場合にerroneous behavior、そうでなければ未定義動作 + g(b); // bが妥当な値表現をもつ場合にエラー性動作、そうでなければ未定義動作 ``` -### 今後、「erroneous behavior」に分類される可能性のある操作 +### 今後、エラー性動作に分類される可能性のある操作 -現在、未定義動作に分類される以下の操作は、「erroneous behavior」に分類できる可能性がある。 +現在、未定義動作に分類される以下の操作は、エラー性動作に分類できる可能性がある。 | 操作 | 備考 | |------|------| @@ -133,8 +133,8 @@ int main() { | 誤ったビットシフト (負のシフト幅や、上限を超えたシフト幅) | 符号付き整数のオーバーフローと同じ | | ゼロ割り | いくつかの固定値での誤った結果となる可能性がある。影響が不明確であるため、変更にはコストがかかる | | 戻り値型が非`void`な関数から返った、もしくは`[[noreturn]]`属性をつけた関数から返った | [`std::terminate()`](/reference/exception/terminate.md)が呼ばれる可能性がある。変更には軽いコストがかかるが、その変更にどの程度の価値があるかは不明 | -| 抽象クラスのコンストラクタ・デストラクタからの純粋仮想関数の呼び出し | 特定の純粋仮想ハンドラが呼ばれる可能性がある。実装によってはすでに「erroneous behavior」のように扱われている可能性がある | -| 契約違反 | 契約に関する現在の策定作業では、契約違反時になにが起こるべきかという問題に直面している。「erroneous behavior」という概念は有用な回答を与えてくれる可能性がある | +| 抽象クラスのコンストラクタ・デストラクタからの純粋仮想関数の呼び出し | 特定の純粋仮想ハンドラが呼ばれる可能性がある。実装によってはすでにエラー性動作のように扱われている可能性がある | +| 契約違反 | 契約に関する現在の策定作業では、契約違反時になにが起こるべきかという問題に直面している。エラー性動作という概念は有用な回答を与えてくれる可能性がある | ## 参照 From 894cbd9b07f4c44dabbd91789a3f7b86173e308f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 7 Nov 2024 14:59:41 +0900 Subject: [PATCH 1263/3948] =?UTF-8?q?=E6=9C=AA=E5=AE=9A=E7=BE=A9=E3=82=A2?= =?UTF-8?q?=E3=83=89=E3=83=AC=E3=82=B9=E3=81=AE=E8=AA=AC=E6=98=8E=E3=82=92?= =?UTF-8?q?=E8=A6=8B=E7=9B=B4=E3=81=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Kazutoshi SATODA --- GLOBAL_DEFINED_WORDS.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/GLOBAL_DEFINED_WORDS.json b/GLOBAL_DEFINED_WORDS.json index f852a51e04..e372d2c480 100644 --- a/GLOBAL_DEFINED_WORDS.json +++ b/GLOBAL_DEFINED_WORDS.json @@ -19,7 +19,8 @@ "未定義": { "redirect": "未定義の動作", "yomi": "みていぎ" }, "未定義アドレス": { "yomi": "みていぎあどれす", - "desc": "配列要素へのポインタがアドレス計算の結果として配列の範囲外に到達した場合に、(間接参照しなくても) 未定義動作となる" + "desc": "通常は未定義動作となるポインタの加減算が atomic 操作として行われた場合の結果を指す規格中の表記 "undefined address" を指す。その意味付けは不明確なので LWG issue 3906. "Undefined address" is undefined が提起されている。", + "link": "https://cplusplus.github.io/LWG/issue3906" }, "未規定の動作": { "link": "/implementation-compliance.md#dfn-unspecified-behavior", From 1ef77298017eef748ed68f86d0b6b4098320a060 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 7 Nov 2024 15:04:39 +0900 Subject: [PATCH 1264/3948] =?UTF-8?q?=E7=94=A8=E8=AA=9E=20:=20=E6=9C=AA?= =?UTF-8?q?=E5=AE=9A=E7=BE=A9=E3=82=A2=E3=83=89=E3=83=AC=E3=82=B9=E3=81=8C?= =?UTF-8?q?=E6=9C=AA=E5=AE=9A=E7=BE=A9=E5=8B=95=E4=BD=9C=E3=81=A7=E3=81=AF?= =?UTF-8?q?=E3=81=AA=E3=81=95=E3=81=9D=E3=81=86=E3=81=A0=E3=81=A8=E3=81=84?= =?UTF-8?q?=E3=81=86=E3=81=93=E3=81=A8=E3=82=92=E8=A8=98=E8=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_DEFINED_WORDS.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GLOBAL_DEFINED_WORDS.json b/GLOBAL_DEFINED_WORDS.json index e372d2c480..9b2ecc885d 100644 --- a/GLOBAL_DEFINED_WORDS.json +++ b/GLOBAL_DEFINED_WORDS.json @@ -19,7 +19,7 @@ "未定義": { "redirect": "未定義の動作", "yomi": "みていぎ" }, "未定義アドレス": { "yomi": "みていぎあどれす", - "desc": "通常は未定義動作となるポインタの加減算が atomic 操作として行われた場合の結果を指す規格中の表記 "undefined address" を指す。その意味付けは不明確なので LWG issue 3906. "Undefined address" is undefined が提起されている。", + "desc": "通常は未定義動作となるポインタの加減算が atomic 操作として行われた場合の結果を指す規格中の表記「undefined address」を指す。その意味付けは不明確なので LWG issue 3906. Undefined address is undefined が提起されている。atomic操作は未定義動作を含まないことを意図して設計されているため未定義アドレスは未定義動作ではないと考えられる", "link": "https://cplusplus.github.io/LWG/issue3906" }, "未規定の動作": { From 6010481f4dbc9e5d44502533efe07b21c271b2a6 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Thu, 7 Nov 2024 17:03:29 +0900 Subject: [PATCH 1265/3948] =?UTF-8?q?GLOBAL=5FDEFINED=5FWORDS:=20EB=20?= =?UTF-8?q?=E3=81=AB=E5=80=A3=E3=81=84=20UB=20=E3=82=82=E8=8B=B1=E5=90=8D?= =?UTF-8?q?=E3=82=92=E8=A1=A8=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_DEFINED_WORDS.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GLOBAL_DEFINED_WORDS.json b/GLOBAL_DEFINED_WORDS.json index 12ce60ba87..a9ebb8b0ad 100644 --- a/GLOBAL_DEFINED_WORDS.json +++ b/GLOBAL_DEFINED_WORDS.json @@ -12,7 +12,7 @@ "未定義の動作": { "link": "/implementation-compliance.md#dfn-undefined-behavior", "yomi": "みていぎのどうさ", - "desc": "処理系は予期せぬ動作をする可能性がある。要するに動作保証対象外" + "desc": "処理系は予期せぬ動作をする可能性がある。要するに動作保証対象外。undefined behavior (UB)。" }, "未定義動作": { "redirect": "未定義の動作", "yomi": "みていぎどうさ" }, "未定義": { "redirect": "未定義の動作", "yomi": "みていぎ" }, From 28eb999e2472a44c289042ca3b28333d3349576e Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Thu, 7 Nov 2024 16:21:03 +0900 Subject: [PATCH 1266/3948] =?UTF-8?q?=E6=A8=99=E6=BA=96=E8=A6=8F=E6=A0=BC?= =?UTF-8?q?=E3=81=A8=E5=87=A6=E7=90=86=E7=B3=BB:=20=E3=82=A8=E3=83=A9?= =?UTF-8?q?=E3=83=BC=E6=80=A7=E3=81=AE=E5=8B=95=E4=BD=9C=E3=82=92=E8=A8=80?= =?UTF-8?q?=E5=8F=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_DEFINED_WORDS.json | 1 + implementation-compliance.md | 1 + 2 files changed, 2 insertions(+) diff --git a/GLOBAL_DEFINED_WORDS.json b/GLOBAL_DEFINED_WORDS.json index a9ebb8b0ad..9ce1c016ba 100644 --- a/GLOBAL_DEFINED_WORDS.json +++ b/GLOBAL_DEFINED_WORDS.json @@ -24,6 +24,7 @@ "未規定動作": { "redirect": "未規定の動作", "yomi": "みきていどうさ" }, "未規定": { "redirect": "未規定の動作", "yomi": "みきてい" }, "エラー性の動作": { + "link": "/implementation-compliance.md#dfn-erroneous-behavior", "yomi": "えらーせいのどうさ", "desc": "未定義動作ではないが、誤ったプログラムの結果とされる動作。erroneous behavior (EB)。処理系によって診断や異常終了を実行することが許可されるが、処理が続行する場合もある" }, diff --git a/implementation-compliance.md b/implementation-compliance.md index 7ba64e97dc..e2e19ed36d 100644 --- a/implementation-compliance.md +++ b/implementation-compliance.md @@ -25,6 +25,7 @@ C++ の処理系は、翻訳を担うコンパイラと実行を担うオペレ - 未規定の動作 (unspecified behavior) とされた動作に対しては、処理系は考えられる動作の内の1つを行って良い。処理系は説明書にその動作を定義しなくて良い。 - 未定義の動作 (undefined behavior; 通称 UB) は、処理系が実際に行う動作について標準規格が如何なる要件もおかないことを表す。 - **文化圏固有動作** (locale-specific behavior) に対しては、処理系は現地の国家・文化・言語の風習に依存した動作を行う。処理系はその動作を説明書に記述する必要がある。 +- エラー性の動作 (erroneous behavior; 通称 EB) は、定義された動作であるが、処理系は診断情報を出力することが推奨される。その後に未規定の時点で、処理系は実行を終了しても良い。 これらの用語は処理系が取りうる動作の範囲を示すものであって、例えば "未定義の動作" という名前の具体的な動作がある訳ではないことに注意する。 From 072cb24172ecc3f07b680de4093b623ac327658c Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 7 Nov 2024 18:34:51 +0900 Subject: [PATCH 1267/3948] =?UTF-8?q?start=5Fediting:=20=E8=87=AA=E5=8B=95?= =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=81=AE=E4=B8=80=E8=A6=A7=E3=82=92?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start_editing.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/start_editing.md b/start_editing.md index 4ac193aa88..c200f29c99 100644 --- a/start_editing.md +++ b/start_editing.md @@ -51,6 +51,12 @@ buildアクションで、MarkdownからHTMLへの変換と、GitHub Pagesへの - コード修飾の誤り検出 (code qualify checkアクション) - コードブロック中のコードを修飾しているのに、その修飾対象がない場合に、エラーが発生する - [GitHub Actionsの実行ログ](https://github.com/cpprefjp/site/actions/workflows/code_qualify_check.yml)で、どのページのどのコード修飾が不正かがわかるので、それを修正すること +- 所属ヘッダメタ情報の誤り検出 (meta header checkアクション) + - `[meta header]`または`[meta module]`指定が誤っている(ディレクトリ階層と一致しない)場合に、エラーが発生する + - 導入経緯は [PR#1204](https://github.com/cpprefjp/site/issues/1204) を参照 +- NGワードの検出 (ngword checkアクション) + - 日本語入力環境における典型的な誤入力・誤変換をエラーとして検知する + - 具体的な対象ワードリストは[ngword_check.py](https://github.com/cpprefjp/site/blob/master/.github/workflows/script/ngword_check.py)を参照 ### 自動反映ツール From ca64b9a9be2739f2c2eace5c9fab3da88f7fe986 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Thu, 7 Nov 2024 20:58:04 +0900 Subject: [PATCH 1268/3948] =?UTF-8?q?GLOBAL=5FDEFINED=5FWORDS:=20=E8=AA=AD?= =?UTF-8?q?=E3=81=BF=E4=BB=AE=E5=90=8D=E3=82=92=E8=A3=9C=E5=AE=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_DEFINED_WORDS.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/GLOBAL_DEFINED_WORDS.json b/GLOBAL_DEFINED_WORDS.json index f9944b32cc..3be471c9ab 100644 --- a/GLOBAL_DEFINED_WORDS.json +++ b/GLOBAL_DEFINED_WORDS.json @@ -47,30 +47,39 @@ }, "CPO": { "redirect": "カスタマイゼーションポイントオブジェクト" }, "デフォルト初期化": { + "yomi": "でふぉるとしょきか", "desc": "`T x;`構文での初期化。トリビアルにデフォルト構築可能な型の場合は初期化されず(オブジェクトのlifetimeは開始される)、そうではないクラス型はデフォルトコンストラクタで初期化する。配列型の場合は各要素が再帰的にデフォルト初期化される" }, "デフォルト構築": { + "yomi": "でふぉるとこうちく", "redirect": "デフォルト初期化" }, "値初期化": { + "yomi": "あたいしょきか", "desc": "`T x{};`構文での初期化。組み込み型の場合はゼロ相当の値で、クラス型の場合はデフォルトコンストラクタで初期化する。配列型の場合は各要素が再帰的に値初期化される" }, "直接非リスト初期化": { + "yomi": "ちょくせつひりすとしょきか", "desc": "direct-non-list-initialization。リスト初期化ではない直接初期化" }, "値構築": { + "yomi": "あたいこうちく", "redirect": "値初期化" }, "プログラム定義型": { + "yomi": "ぷろぐらむていぎがた", "desc": "標準ライブラリの型を除く、ユーザー(プログラマ)によって定義された型のこと" }, "プログラム定義": { + "yomi": "ぷろぐらむていぎ", "desc": "ユーザー(プログラマ)によって定義されること(標準ライブラリで定義されるものを除く)" }, "ユーザー定義型": { + "yomi": "ゆーざーていぎがた", "redirect": "プログラム定義型" }, "ユーザー定義": { + "yomi": "ゆーざーていぎ", "redirect": "プログラム定義" }, "適格要件": { @@ -80,22 +89,27 @@ "desc": "関数であればオーバーロード解決に参加するための条件、それ以外であれば受け付ける型の条件" }, "イテレータ範囲": { + "yomi": "いてれーたはんい", "desc": "2つのイテレータで表現される半開区間を表す。C++20からイテレータと番兵で異なる型であっても指定可能になる" }, "拡張浮動小数点数型": { + "yomi": "かくちょうふどうしょうすうてんすうがた", "desc": "で定義される内部表現の規定された浮動小数点数型", "link": "/reference/stdfloat.md" }, "標準浮動小数点数型": { + "yomi": "ひょうじゅんふどうしょうすうてんすうがた", "desc": "拡張浮動小数点数型の対義語としてfloat / double / long doubleを指す用語" }, "ADL": { "desc": "実引数依存の名前探索 (Argument Dependent Lookup)。引数の型が所属する名前空間の関数を探索する言語機能" }, "不完全型": { + "yomi": "ふかんぜんがた", "desc": "型のサイズを決定できない、完全には定義されていない型。例えば先行宣言のみのクラス型、要素数不明の配列型、`void`など。クラス定義内部ではそのクラス自身は不完全型" }, "完全型": { + "yomi": "かんぜんがた", "desc": "型のサイズを決定できる型。不完全型ではない型" }, "オーバーロード解決": { From 2a47b4b0d58bec502003e9c32b378dae9e510699 Mon Sep 17 00:00:00 2001 From: yoh Date: Sat, 9 Nov 2024 00:10:22 +0900 Subject: [PATCH 1269/3948] =?UTF-8?q?chrono:=20gps=5Fclock,gps=5Ftime?= =?UTF-8?q?=E4=BE=8B=E7=A4=BA=E3=82=B3=E3=83=BC=E3=83=89=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/chrono/gps_clock.md | 4 +-- reference/chrono/gps_clock/from_utc.md | 21 ++++++------- reference/chrono/gps_clock/now.md | 4 +-- reference/chrono/gps_clock/to_utc.md | 8 ++--- reference/chrono/gps_time.md | 42 ++++++++++++++------------ 5 files changed, 41 insertions(+), 38 deletions(-) diff --git a/reference/chrono/gps_clock.md b/reference/chrono/gps_clock.md index a383403a7c..3cdab5a04c 100644 --- a/reference/chrono/gps_clock.md +++ b/reference/chrono/gps_clock.md @@ -72,7 +72,7 @@ int main() ### 出力例 ``` -2019-10-24 11:15:37 GPS +2019-10-24 11:15:37.493236171 ``` ## バージョン @@ -81,7 +81,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): 9.0 [mark noimpl] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 13.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/gps_clock/from_utc.md b/reference/chrono/gps_clock/from_utc.md index 4f33d3ecb2..472cec2792 100644 --- a/reference/chrono/gps_clock/from_utc.md +++ b/reference/chrono/gps_clock/from_utc.md @@ -50,18 +50,17 @@ using namespace std::chrono_literals; int main() { - // ここでは日単位のシステム時間を、utc_clockを経由して、日単位のGPS時間に変換している。 - // 秒単位の時間を渡せば、秒単位のGPS時間が返る - auto st = chrono::sys_days{2019y/10/24}; - auto ut = chrono::utc_clock::from_sys(st); - auto tt = chrono::gps_clock::from_utc(ut); // 日単位のGPS時間が返る + // ここでは日単位のシステム時間を、秒単位のUTC時間とGPS時間に変換している。 + auto st = chrono::sys_days{2019y/10/24}; // システム時間,日単位 + auto ut = chrono::utc_clock::from_sys(st); // UTC時間,秒単位 + auto tt = chrono::gps_clock::from_utc(ut); // GPS時間,秒単位 - // うるう秒 + // UTC時間のうるう秒に関する情報 chrono::leap_second_info info = chrono::get_leap_second_info(ut); std::cout << st << std::endl; - std::cout << ut << std::endl; - std::cout << tt << std::endl; + std::cout << ut << " UTC" << std::endl; + std::cout << tt << " GPS" << std::endl; std::cout << info.elapsed.count() << std::endl; } ``` @@ -76,9 +75,9 @@ int main() ### 出力 ``` -2019-10-24 00:00:00 +2019-10-24 2019-10-24 00:00:00 UTC -2019-10-24 00:00:27 GPS +2019-10-24 00:00:18 GPS 27 ``` @@ -88,5 +87,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): 9.0 [mark noimpl] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 13.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/gps_clock/now.md b/reference/chrono/gps_clock/now.md index 7c99542b13..3d77f6efad 100644 --- a/reference/chrono/gps_clock/now.md +++ b/reference/chrono/gps_clock/now.md @@ -38,7 +38,7 @@ int main() ### 出力例 ``` -2019-10-24 11:15:37 GPS +2019-10-24 11:15:51.428340077 ``` ## バージョン @@ -47,5 +47,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): 9.0 [mark noimpl] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 13.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/gps_clock/to_utc.md b/reference/chrono/gps_clock/to_utc.md index 30b53663ae..1bc92cf475 100644 --- a/reference/chrono/gps_clock/to_utc.md +++ b/reference/chrono/gps_clock/to_utc.md @@ -57,8 +57,8 @@ int main() // うるう秒 chrono::leap_second_info info = chrono::get_leap_second_info(ut); - std::cout << tt << std::endl; - std::cout << ut << std::endl; + std::cout << tt << " GPS" << std::endl; + std::cout << ut << " UTC" << std::endl; std::cout << info.elapsed.count() << std::endl; } ``` @@ -73,7 +73,7 @@ int main() ### 出力 ``` -2019-10-24 00:00:27 GPS +2019-10-24 00:00:18 GPS 2019-10-24 00:00:00 UTC 27 ``` @@ -84,5 +84,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): 9.0 [mark noimpl] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 13.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/gps_time.md b/reference/chrono/gps_time.md index c378e5d4e6..4d765cffeb 100644 --- a/reference/chrono/gps_time.md +++ b/reference/chrono/gps_time.md @@ -105,7 +105,7 @@ int main() #### 出力例 ``` -2019-10-24 11:15:27 GPS +2019-10-24 11:15:27 ``` ### 入力の例 @@ -128,8 +128,7 @@ int main() if (ss) { std::cout << tp << std::endl; - } - else { + } else { std::cout << "解析失敗" << std::endl; } } @@ -137,23 +136,27 @@ int main() // タイムゾーンを含む入力 { std::stringstream ss; - ss << "2019-10-24 20:15:10 GPS"; + ss << "2019-10-24 20:15:27 GPS"; chrono::gps_seconds tp; std::string abbrev; - chrono::from_stream(ss, "%Y-%m-%d %H:%M:%S %Z%z", tp, &abbrev); + chrono::from_stream(ss, "%Y-%m-%d %H:%M:%S %Z", tp, &abbrev); - std::cout << tp << std::endl; - std::cout << abbrev << std::endl; + if (ss) { + std::cout << tp << std::endl; + std::cout << abbrev << std::endl; + } else { + std::cout << "解析失敗" << std::endl; + } } } ``` * chrono::from_stream[color ff0000] -#### 出力例 +#### 出力 ``` -2019-10-24 11:15:27 GPS -2019-10-24 11:15:27 GPS +2019-10-24 20:15:45 +2019-10-24 20:15:45 GPS ``` @@ -168,7 +171,7 @@ namespace chrono = std::chrono; int main() { chrono::gps_clock::time_point now = chrono::gps_clock::now(); - chrono::gps_seconds now_sec = chrono::floor(tp); + chrono::gps_seconds now_sec = chrono::floor(now); // デフォルトフォーマット std::cout << std::format("1 : {}", now_sec) << std::endl; @@ -177,15 +180,15 @@ int main() std::cout << std::format("2 : {:%Y年%m月%d日 %H時%M分%S秒}", now_sec) << std::endl; // 日付を / (スラッシュ) 区切り、時間を : (コロン) 区切り、タイムゾーンの略称付き - std::cout << std::format("3 : {0:%Y/%m/%d %H:%M:%S %Z}", now_sec) << std::endl; + std::cout << std::format("3 : {:%Y/%m/%d %H:%M:%S %Z}", now_sec) << std::endl; // 日付だけ出力 - std::cout << std::format("4 : %Y年%m月%d日", now_sec) << std::endl; - std::cout << std::format("5 : %F", now_sec) << std::endl; + std::cout << std::format("4 : {:%Y年%m月%d日}", now_sec) << std::endl; + std::cout << std::format("5 : {:%F}", now_sec) << std::endl; // 時間だけ出力 - std::cout << std::format("6 : %H時%M分%S秒", now_sec) << std::endl; - std::cout << std::format("7 : %T", now_sec) << std::endl; + std::cout << std::format("6 : {:%H時%M分%S秒}", now_sec) << std::endl; + std::cout << std::format("7 : {:%T}", now_sec) << std::endl; } ``` * chrono::gps_clock[link gps_clock.md] @@ -193,9 +196,9 @@ int main() * chrono::floor[link time_point/floor.md] * std::format[link format.md] -#### 出力例 +#### 出力 ``` -1 : 2019-12-20 10:05:05 GPS +1 : 2019-12-20 10:05:05 2 : 2019年12月20日 10時05分05秒 3 : 2019/12/20 10:05:05 GPS 4 : 2019年12月20日 @@ -204,13 +207,14 @@ int main() 7 : 10:05:05 ``` + ## バージョン ### 言語 - C++20 ### 処理系 - [Clang](/implementation.md#clang): 9.0 [mark noimpl] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 14.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] From 1c11eb89d353692111238981daf65506b80759b0 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 11 Nov 2024 12:57:15 +0900 Subject: [PATCH 1270/3948] fix typo Co-authored-by: Kazutoshi SATODA --- lang/cpp26/erroneous_behavior_for_uninitialized_reads.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md index 17797acbc8..4cf7047e09 100644 --- a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md +++ b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md @@ -78,7 +78,7 @@ int main() { assert(e2 == d1); // 常に真、エラー性動作 // エラー性動作ではないが - // d2はエラー性動作をもつ + // d2はエラー性の値をもつ std::memcpy(&d2, &d1, sizeof(int)); assert(e1 == d2); // 常に真、エラー性動作 From 710972af237d8d0cab53f90317494df675f0a3d0 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 11 Nov 2024 14:17:55 +0900 Subject: [PATCH 1271/3948] =?UTF-8?q?=E7=94=A8=E8=AA=9E=E3=81=AE=E8=AA=A4?= =?UTF-8?q?=E3=81=A3=E3=81=9F=E4=BD=BF=E3=81=84=E6=96=B9=E3=82=92=E6=A4=9C?= =?UTF-8?q?=E5=87=BA=E3=81=99=E3=82=8BCI=E3=81=AE=E8=AA=AC=E6=98=8E?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start_editing.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/start_editing.md b/start_editing.md index c200f29c99..dae4ce787a 100644 --- a/start_editing.md +++ b/start_editing.md @@ -57,6 +57,9 @@ buildアクションで、MarkdownからHTMLへの変換と、GitHub Pagesへの - NGワードの検出 (ngword checkアクション) - 日本語入力環境における典型的な誤入力・誤変換をエラーとして検知する - 具体的な対象ワードリストは[ngword_check.py](https://github.com/cpprefjp/site/blob/master/.github/workflows/script/ngword_check.py)を参照 +- 用語の誤った使い方を検出 (defined word checkアクション) + - 用語の許可した使い方、許可しない使い方を列挙し、許可した使い方以外の使われ方をエラーとして検出する + - 具体的な用語、許可した使い方、許可しない使い方は、[defined_word_check.py](https://github.com/cpprefjp/site/blob/master/.github/workflows/script/defined_word_check.py)を参照 ### 自動反映ツール From be99b9ad2556de3498707cfe71f2712393e9c83b Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 11 Nov 2024 17:15:48 +0900 Subject: [PATCH 1272/3948] =?UTF-8?q?C++26:=20=E3=80=8C=E9=9D=9E=E6=8E=A8?= =?UTF-8?q?=E5=A5=A8=E3=81=A8=E3=81=AA=E3=81=A3=E3=81=A6=E3=81=84=E3=81=9F?= =?UTF-8?q?=E5=88=97=E6=8C=99=E5=9E=8B=E3=81=AE=E7=AE=97=E8=A1=93=E5=A4=89?= =?UTF-8?q?=E6=8F=9B=E3=82=92=E5=89=8A=E9=99=A4=E3=80=8D=E3=81=A8=E9=96=A2?= =?UTF-8?q?=E9=80=A3=E3=81=99=E3=82=8BC++20=E4=BB=95=E6=A7=98=E5=A4=89?= =?UTF-8?q?=E6=9B=B4=E3=82=92=E8=BF=BD=E5=8A=A0=20(close=20#1231)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp20.md | 1 + lang/cpp20/consistent_comparison.md | 3 +- ...e_arithmetic_conversion_on_enumerations.md | 31 +++++++++++++++++++ lang/cpp26.md | 2 +- ...d_arithmetic_conversion_on_enumerations.md | 30 ++++++++++++++++++ 6 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 lang/cpp20/deprecate_arithmetic_conversion_on_enumerations.md create mode 100644 lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md diff --git a/implementation-status.md b/implementation-status.md index f6414a20b1..c3d988d5cb 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -299,7 +299,7 @@ | P2741R3: [`static_assert`の診断メッセージにユーザーが生成した文字列の指定を許可](/lang/cpp26/user-generated_static_assert_messages.md) | `constexpr`な`S.size()`と`S.data()`メンバ関数をもつオブジェクトをコンパイル時文字列として指定できるようにする | 14 | 17 | | | | P2558R2: [基本文字集合に@、$、\`を追加](/lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md.nolink) | C言語との互換性のためにこれらの文字を基本文字集合に追加 | | Yes | | | | P2662R3: [パラメータパックへのインデックスアクセスを許可](/lang/cpp26/pack_indexing.md.nolink) | 可変引数テンプレートのパラメータパックに添字アクセスできるようにする | | | | | -| P2864R2: [非推奨となっていた列挙値から算術型への暗黙変換を削除](/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md.nolink) | C++20から非推奨となっていた列挙値への算術演算で算術型に暗黙変換される仕様を削除 | 14 | 18 | | | +| P2864R2: [非推奨となっていた列挙値から算術型への暗黙変換を削除](/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md) | C++20から非推奨となっていた列挙値への算術演算で算術型に暗黙変換される仕様を削除 | 14 | 18 | | | | P2748R5: [返却された左辺値から暗黙変換された一時オブジェクトが参照に束縛されることを禁止する](/lang/cpp26/disallow_binding_a_returned_glvalue_to_a_temporary.md.nolink) | 寿命切れの変数によって引き起こされるバグを防止する | 14 | 19 | | | | P3106R1: [要素数不明の配列を集成体初期化する規則を明確化](/lang/cpp26/clarifying_rules_for_brace_elision_in_aggregate_initialization.md.nolink) | 配列要素の集成体初期化で`{}`が省略された場合の矛盾していた規定を修正 | yes | 17 | | | | P0609R3: [構造化束縛への属性を許可](/lang/cpp26/attributes_for_structured_bindings.md) | `auto [a, b [[maybe_unused]], c] = f();`のように構造化束縛の要素に対して属性を付加できるようにする | 15 | 19 | | | diff --git a/lang/cpp20.md b/lang/cpp20.md index 549f3c9185..96fdc77aad 100644 --- a/lang/cpp20.md +++ b/lang/cpp20.md @@ -31,6 +31,7 @@ C++20とは、2020年中に改訂され、ISO/IEC 14882:2020で標準規格化 | 言語機能 | 説明 | |----------|------| | [スコープ付き列挙型のusing宣言](cpp20/using_enum.md) | `using enum EnumType;`もしくは`using EnumType::enumerator`とすることで、列挙値のスコープ指定を省略できるようにする | +| [列挙値から算術型への暗黙変換を非推奨化](cpp20/deprecate_arithmetic_conversion_on_enumerations.md) | 列挙値への算術演算で算術型に暗黙変換される仕様を非推奨とする | ### 変数 diff --git a/lang/cpp20/consistent_comparison.md b/lang/cpp20/consistent_comparison.md index 493117c587..068fab2103 100644 --- a/lang/cpp20/consistent_comparison.md +++ b/lang/cpp20/consistent_comparison.md @@ -802,7 +802,8 @@ struct has_vector { - [`compare_three_way`](/reference/compare/compare_three_way.md) - [``](/reference/algorithm.md) - [`lexicographical_compare_three_way`](/reference/algorithm/lexicographical_compare_three_way.md) -- [C++26 非推奨となっていた列挙値から算術型への暗黙変換を削除](/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md.nolink) +- [C++20 列挙値から算術型への暗黙変換を非推奨化](deprecate_arithmetic_conversion_on_enumerations.md) +- [C++26 非推奨となっていた列挙値から算術型への暗黙変換を削除](/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md) ## 参照 diff --git a/lang/cpp20/deprecate_arithmetic_conversion_on_enumerations.md b/lang/cpp20/deprecate_arithmetic_conversion_on_enumerations.md new file mode 100644 index 0000000000..3b4d60e5db --- /dev/null +++ b/lang/cpp20/deprecate_arithmetic_conversion_on_enumerations.md @@ -0,0 +1,31 @@ +# 列挙値から算術型への暗黙変換を非推奨化 [P1120R0] +* cpp20[meta cpp] + + + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 + + + +## 概要 +[三方比較演算子](consistent_comparison.md)の導入にともない、一方のオペランドが列挙型である場合の算術演算での暗黙の算術変換を非推奨とする。 + +```cpp +enum E1 { e }; +enum E2 { f }; + +bool b = e <= 3.7; // C++20から非推奨 +int k = f - e; // C++20から非推奨 +int x = +f - e; // OK +``` + + +## 関連項目 +- [C++20 `<=>`/`==`による比較演算子の自動定義](consistent_comparison.md) +- [C++26 非推奨となっていた列挙型の算術変換を削除](/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md) + + +## 参照 +- [P1120R0 Consistency improvements for `<=>` and other comparison operators](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1120r0.html) diff --git a/lang/cpp26.md b/lang/cpp26.md index 39b9f861c6..3bce2dee54 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -13,7 +13,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 |----------|------| | [`std::initializer_list`の配列を静的ストレージに配置する](/lang/cpp26/static_storage_for_braced_initializers.md.nolink) | `std::vector v = {1, 2, 3};`のような初期化で初期化子リストを静的ストレージに配置することで無駄なコピーをなくす | | [宣言のみで使用しない変数の名前として`_`をサポート](/lang/cpp26/nice_placeholder_with_no_name.md.nolink) | 変数名`_`は暗黙で`[[maybe_unused]]`が指定される | -| [非推奨となっていた列挙値から算術型への暗黙変換を削除](/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md.nolink) | C++20から非推奨となっていた列挙値への算術演算で算術型に暗黙変換される仕様を削除 | +| [非推奨となっていた列挙型の算術変換を削除](/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md) | C++20から非推奨となっていた列挙値への算術演算で算術型に暗黙変換される仕様を削除 | | [不完全型へのポインタに対する`delete`を不適格とする](/lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md.nolink) | 未定義動作を引き起こす操作をコンパイルエラーとする | | [返却された左辺値から暗黙変換された一時オブジェクトが参照に束縛されることを禁止する](/lang/cpp26/disallow_binding_a_returned_glvalue_to_a_temporary.md.nolink) | 寿命切れの変数によって引き起こされるバグを防止する | | [要素数不明の配列を集成体初期化する規則を明確化](/lang/cpp26/clarifying_rules_for_brace_elision_in_aggregate_initialization.md.nolink) | 配列要素の集成体初期化で`{}`が省略された場合の矛盾していた規定を修正 | diff --git a/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md b/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md new file mode 100644 index 0000000000..b512f12d44 --- /dev/null +++ b/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md @@ -0,0 +1,30 @@ +# 列挙値から算術型への暗黙変換を非推奨化 [P2864R2] +* cpp26[meta cpp] + + + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 + + + +## 概要 +C++20で非推奨となっていた、一方のオペランドが列挙型である場合の算術演算での暗黙の算術変換を削除する。 + +```cpp +enum E1 { e }; +enum E2 { f }; + +bool b = e <= 3.7; // C++20から非推奨、C++26で削除 +int k = f - e; // C++20から非推奨、C++26で削除 +int x = +f - e; // OK +``` + + +## 関連項目 +- [C++20 列挙値から算術型への暗黙変換を非推奨化](/lang/cpp20/deprecate_arithmetic_conversion_on_enumerations.md) + + +## 参照 +- [P2864R2 Remove Deprecated Arithmetic Conversion on Enumerations From C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2864r2.pdf) From 52896cace5037904a43d58d9aac90b29317ee77b Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 12 Nov 2024 14:17:20 +0900 Subject: [PATCH 1273/3948] =?UTF-8?q?=E5=A4=96=E9=83=A8=E3=83=AA=E3=83=B3?= =?UTF-8?q?=E3=82=AF=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF=20:=20=E3=82=B3?= =?UTF-8?q?=E3=83=9F=E3=83=83=E3=83=88=E3=81=B8=E3=81=AE=E3=83=AA=E3=83=B3?= =?UTF-8?q?=E3=82=AF=E3=82=92=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF=E5=AF=BE?= =?UTF-8?q?=E8=B1=A1=E5=A4=96=E3=81=AB=E3=81=97=E3=81=9F=20(close=20#1361)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/script/link_check.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/script/link_check.py b/.github/workflows/script/link_check.py index 30c9286ddd..2900cd9bd8 100644 --- a/.github/workflows/script/link_check.py +++ b/.github/workflows/script/link_check.py @@ -60,10 +60,17 @@ def fix_link(link: str) -> str: "https://www.microsoft.com/", # ちょくちょく失敗するが、一時的なものだと思われる ] +IGNORE_REGEX_LIST = [ + re.compile(r"https://github.com/(.*?)/(.*?)/commit/(.*?)") # 貢献ポイントの集計用 (非ユーザー向け) +] + def is_ignore_link(link: str) -> bool: for x in IGNORE_LIST: if link.startswith(x): return True + for x in IGNORE_REGEX_LIST: + if x.fullmatch(link): + return True return False From 165353e4a2df20da05e1208cca403329ea548e63 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 13 Nov 2024 12:55:56 +0900 Subject: [PATCH 1274/3948] =?UTF-8?q?=E8=A8=80=E8=AA=9E=E6=A9=9F=E8=83=BD?= =?UTF-8?q?=E3=81=AE=E6=B3=A8=E6=84=8F=E6=96=87=E7=AB=A0=E3=82=92=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=20#1231?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../deprecate_arithmetic_conversion_on_enumerations.md | 4 ++-- ...move_deprecated_arithmetic_conversion_on_enumerations.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lang/cpp20/deprecate_arithmetic_conversion_on_enumerations.md b/lang/cpp20/deprecate_arithmetic_conversion_on_enumerations.md index 3b4d60e5db..6d327bb60e 100644 --- a/lang/cpp20/deprecate_arithmetic_conversion_on_enumerations.md +++ b/lang/cpp20/deprecate_arithmetic_conversion_on_enumerations.md @@ -22,10 +22,10 @@ int x = +f - e; // OK ``` -## 関連項目 +## 関連項目 - [C++20 `<=>`/`==`による比較演算子の自動定義](consistent_comparison.md) - [C++26 非推奨となっていた列挙型の算術変換を削除](/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md) ## 参照 -- [P1120R0 Consistency improvements for `<=>` and other comparison operators](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1120r0.html) +- [P1120R0 Consistency improvements for `<=>` and other comparison operators](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1120r0.html) \ No newline at end of file diff --git a/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md b/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md index b512f12d44..c44035a458 100644 --- a/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md +++ b/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md @@ -3,7 +3,7 @@ -このページはC++20に採用された言語機能の変更を解説しています。 +このページはC++26に採用される見込みの言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 @@ -22,9 +22,9 @@ int x = +f - e; // OK ``` -## 関連項目 +## 関連項目 - [C++20 列挙値から算術型への暗黙変換を非推奨化](/lang/cpp20/deprecate_arithmetic_conversion_on_enumerations.md) ## 参照 -- [P2864R2 Remove Deprecated Arithmetic Conversion on Enumerations From C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2864r2.pdf) +- [P2864R2 Remove Deprecated Arithmetic Conversion on Enumerations From C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2864r2.pdf) \ No newline at end of file From abe6cbeeec725734bc8632fb0f6b007e2b554198 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Thu, 14 Nov 2024 01:52:58 +0900 Subject: [PATCH 1275/3948] =?UTF-8?q?=E5=90=8D=E5=89=8D=E4=BB=98=E3=81=8D?= =?UTF-8?q?=E3=83=A6=E3=83=8B=E3=83=90=E3=83=BC=E3=82=B5=E3=83=AB=E3=82=AD?= =?UTF-8?q?=E3=83=A3=E3=83=A9=E3=82=AF=E3=82=BF=E5=90=8D:=20=E3=83=9E?= =?UTF-8?q?=E3=83=83=E3=83=81=E3=83=B3=E3=82=B0=E3=81=AB=E3=81=A4=E3=81=84?= =?UTF-8?q?=E3=81=A6=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23/named_universal_character_escapes.md | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/lang/cpp23/named_universal_character_escapes.md b/lang/cpp23/named_universal_character_escapes.md index 2feee22a62..e4f1ee3d61 100644 --- a/lang/cpp23/named_universal_character_escapes.md +++ b/lang/cpp23/named_universal_character_escapes.md @@ -16,15 +16,9 @@ 構文としては`u8"\N{LATIN CAPITAL LETTER A WITH MACRON}"`のように、`\N{…}`の波カッコで囲まれた中に、ユニバーサルキャラクタ名を入力する。 -使用可能な文字はUnicode規格ISO/IEC 10646で定義される。 +使用可能な文字はUnicode規格ISO/IEC 10646で定義され、それと厳密に一致しなければならない(大文字と小文字の違いやスペースの有無・数などが厳密にチェックされる)。 -名前のマッチングは[UAX44-LM2](https://www.unicode.org/reports/tr44/tr44-24.html#UAX44-LM2)を参照しており、これによって - -- 大文字・小文字を区別しない -- ハイフンの省略 -- アンダースコアをハイフンに置換 - -するなど、柔軟な指定ができるようになっている。例として、以下の名前はすべて`U+200B` (ZERO WIDTH SPACE、ゼロ幅スペース) を表すものとして使用できる: +このユニコード名のマッチングを規定する[UAX44-LM2](https://www.unicode.org/reports/tr44/tr44-24.html#UAX44-LM2)では、以下の名前はすべて`U+200B` (ZERO WIDTH SPACE、ゼロ幅スペース) を表すものとしてマッチングされるが、C++の名前付きユニバーサルキャラクタ名では一番最初の`ZERO WIDTH SPACE`のみが正しい名前として受け入れられる。 ``` ZERO WIDTH SPACE @@ -33,7 +27,6 @@ zero-width space ZERO width S P_A_C E ``` - ## 例 ```cpp example #include @@ -61,6 +54,6 @@ int main() - [C++11 `char16_t`と`char32_t`](/lang/cpp11/char16_32.md) ## 参照 -- [P2173R1 Attributes on Lambda-Expressions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2173r1.pdf) +- [P2071R2 Named universal character escapes](https://www.open-std.org/JTC1/SC22/WG21/docs/papers/2022/p2071r2.html) - [Unicode Character “Ā” (U+0100)](https://www.compart.com/en/unicode/U+0100) -- [Unicode Character “◌̀” (U+0300)](https://www.compart.com/en/unicode/U+0300) \ No newline at end of file +- [Unicode Character “◌̀” (U+0300)](https://www.compart.com/en/unicode/U+0300) From 5151c6a0ac0b782e30f8464c11cb72296acc0d21 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Sun, 17 Nov 2024 01:24:19 +0900 Subject: [PATCH 1276/3948] =?UTF-8?q?P2334R1=20:=20elif=E3=81=AF=E3=81=82?= =?UTF-8?q?=E3=81=A3=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ..._preprocessing_directives_elifdef_and_elifndef.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md b/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md index 50f00f7b5d..ac742192c6 100644 --- a/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md +++ b/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md @@ -1,4 +1,4 @@ -# elif/elifdef/elifndefのサポートを追加 [P2334R1] +# elifdef/elifndefのサポートを追加 [P2334R1] * cpp23[meta cpp] @@ -12,11 +12,11 @@ ## 概要 C++23では、以下のプリプロセス時条件式が追加される: -- `#if`に対応する`#elif`を追加。`#if`/`#ifdef`/`#ifndef`が偽だった場合の条件式を記述できる -- `#ifdef`に対応する`#elifdef`を追加。`#if`/`#ifdef`/`#ifndef`が偽だった場合の、特定の識別子が定義されているかの判定を記述できる -- `#ifndef`に対応する`#elifndef`を追加。`#if`/`#ifdef`/`#ifndef`が偽だった場合の、特定の識別子が定義されていないかの判定を記述できる +- `#ifdef`に対応する`#elif`である、`#elifdef`を追加。`#if`/`#ifdef`/`#ifndef`が偽だった場合の、特定の識別子(マクロ名)が定義されているかの判定を記述できる +- `#ifndef`に対応する`#elif`である、`#elifndef`を追加。`#if`/`#ifdef`/`#ifndef`が偽だった場合の、特定の識別子(マクロ名)が定義されていないかの判定を記述できる -これまでは`#if`が偽だった場合のさらなる条件式を記述するためには`#else`にネストして`#if`を記述する必要があったが、そのような条件分岐が書きやすくなる。 + +これまでは`#elif`において特定のマクロが定義されているかを調べるために`#elif defined(macro_name) / #elif !defined(macro_name)`と書く必要があり、`#if`に対する`#ifdef macro_name / #ifndef macro_name`のような短縮ディレクティブが用意されていなかったが、C++23からは`#if`と`#elif`の両方で`def/ndef`付きのディレクティブが利用できるようになる。 ```cpp #define FOO 2 @@ -36,4 +36,4 @@ C++23では、以下のプリプロセス時条件式が追加される: ## 参照 -- [P2334R1 Add support for preprocessing directives elifdef and elifndef](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2334r1.pdf) \ No newline at end of file +- [P2334R1 Add support for preprocessing directives elifdef and elifndef](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2334r1.pdf) From 41226575825b0ca5d115b300af739a3c1afda5cd Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sun, 17 Nov 2024 18:49:50 +0900 Subject: [PATCH 1277/3948] =?UTF-8?q?C++26=20=E6=9C=AA=E5=88=9D=E6=9C=9F?= =?UTF-8?q?=E5=8C=96=E5=A4=89=E6=95=B0=E3=81=AE=E8=AA=AD=E3=81=BF=E5=8F=96?= =?UTF-8?q?=E3=82=8A=E3=82=92=E3=82=A8=E3=83=A9=E3=83=BC=E6=80=A7=E5=8B=95?= =?UTF-8?q?=E4=BD=9C=E3=81=A8=E3=81=99=E3=82=8B=20:=20=E5=85=A5=E3=82=8C?= =?UTF-8?q?=E5=AD=90=E3=83=AA=E3=82=B9=E3=83=88=E3=81=AE=E8=A1=A8=E7=A4=BA?= =?UTF-8?q?=E5=B4=A9=E3=82=8C=E3=82=92=E4=BF=AE=E6=AD=A3=20#1362?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26/erroneous_behavior_for_uninitialized_reads.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md index 4cf7047e09..79b80c7ac9 100644 --- a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md +++ b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md @@ -44,11 +44,11 @@ int main() { ## 仕様 - 自動記憶域期間をもつオブジェクトの記憶域は確保時点で「エラー性の値 (erroneous value)」をもつとされ、処理系がプログラムの状態に依存せず決定する何らかの値で埋められる - - 動的記憶域期間であれば不定値、静的・スレッド記憶域期間であればゼロで埋められる。C++23までは自動記憶域期間も不定値で埋められていた + - 動的記憶域期間であれば不定値、静的・スレッド記憶域期間であればゼロで埋められる。C++23までは自動記憶域期間も不定値で埋められていた - 初期化されなかったスカラ型オブジェクトなど、値表現(パディングは含まない)内のいずれかのビットにエラー性の値をもつオブジェクトはエラー性の値をもつとされる - 式が評価された結果としてエラー性の値が生成された場合、エラー性動作を引き起こす - - ただし、`unsigned char`(およびunsignedとなる場合は`char`)もしくは[`std::byte`](/reference/cstddef/byte.md)型のエラー性の値がこれらの型のオブジェクトの初期化・代入に使用される場合や値が破棄される場合はエラー性動作にならない - - これらのルールは、式が評価された結果として不定値が生成された場合に未定義の動作を引き起こすとする従来のルールと同様である + - ただし、`unsigned char`(およびunsignedとなる場合は`char`)もしくは[`std::byte`](/reference/cstddef/byte.md)型のエラー性の値がこれらの型のオブジェクトの初期化・代入に使用される場合や値が破棄される場合はエラー性動作にならない + - これらのルールは、式が評価された結果として不定値が生成された場合に未定義の動作を引き起こすとする従来のルールと同様である - エラー性動作を引き起こしたうえで生成された値は、後続の処理ではエラー性の値とはみなされない ```cpp example From 1714d229db60c5163137213bf3ee735899fc1883 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sun, 17 Nov 2024 20:09:35 +0900 Subject: [PATCH 1278/3948] =?UTF-8?q?Markdown=E3=81=AE=E8=A8=98=E6=B3=95?= =?UTF-8?q?=E3=81=A8=E3=81=97=E3=81=A6=E7=AE=87=E6=9D=A1=E6=9B=B8=E3=81=8D?= =?UTF-8?q?=E3=81=AE=E3=82=A4=E3=83=B3=E3=83=87=E3=83=B3=E3=83=88=E3=81=AB?= =?UTF-8?q?4=E3=82=B9=E3=83=9A=E3=83=BC=E3=82=B9=E3=81=8C=E5=BF=85?= =?UTF-8?q?=E8=A6=81=E3=81=A7=E3=81=82=E3=82=8B=E3=81=93=E3=81=A8=E3=82=92?= =?UTF-8?q?=E8=A8=98=E8=BC=89=20#1362?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start_editing.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/start_editing.md b/start_editing.md index dae4ce787a..d9e48a739d 100644 --- a/start_editing.md +++ b/start_editing.md @@ -108,7 +108,10 @@ Markdown形式では、HTMLのタグも併用できますが、cpprefjpサイト - 値の大きさを表現するために、上付き文字を表す``タグを利用している - 添字を表現するために、下付き文字を表す``タグを利用している -また、Markdownパーサーの制限を回避し、表内で `|` (縦線、vertical line) を使用するために、文字参照 `&#x7C;` を使用してます。 +その他、Markdown記法の制限として、以下のようなものがあります: + +- 表内で `|` (縦線、vertical line) を使用するために、文字参照 `&#x7C;` を使用している +- 箇条書きのインデントとして4スペースのみを許可している (2スペースでは正しくインデントされない) 新規リファレンスを書くにあたって、雛形ページを用意していますので、そちらをベースにして編集作業を行ってください。 From ea0f0c5c90dabb6eca1418d5ab1e4c37bc839f2b Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sun, 17 Nov 2024 23:59:26 +0900 Subject: [PATCH 1279/3948] =?UTF-8?q?GCC=20Web=E3=82=B5=E3=82=A4=E3=83=88?= =?UTF-8?q?=E3=81=AE=E3=83=AA=E3=83=B3=E3=82=AF=E5=88=87=E3=82=8C=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20#1363?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp11/recursive_template_limit.md | 2 +- lang/cpp20/likely_and_unlikely_attributes.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lang/cpp11/recursive_template_limit.md b/lang/cpp11/recursive_template_limit.md index e32a1a0fe8..84fd2d192f 100644 --- a/lang/cpp11/recursive_template_limit.md +++ b/lang/cpp11/recursive_template_limit.md @@ -67,4 +67,4 @@ int main() - [Variadic Templates for C++0x](https://web.archive.org/web/20230430062038/http://www.jot.fm/issues/issue_2008_02/article2/) - テンプレートの再帰によって、コンパイル時間がどれくらい延びるかのレポートがある記事 - [C++ Language Features/Controlling implementation limits - Clang Compiler User’s Manual](http://clang.llvm.org/docs/UsersManual.html#cmdoption-ftemplate-depth) -- [3.5 Options Controlling C++ Dialect - GCC Command Options](https://gcc.gnu.org/onlinedocs/gcc/gcc-command-options/options-controlling-c%2B%2B-dialect.html) \ No newline at end of file +- [3.5 Options Controlling C++ Dialect - GCC Command Options](https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Dialect-Options.html) diff --git a/lang/cpp20/likely_and_unlikely_attributes.md b/lang/cpp20/likely_and_unlikely_attributes.md index c1b05c11ea..9a818d36ef 100644 --- a/lang/cpp20/likely_and_unlikely_attributes.md +++ b/lang/cpp20/likely_and_unlikely_attributes.md @@ -77,7 +77,7 @@ GCCやClangなど一部C++コンパイラでは独自拡張として同等機能 ## 参照 - [How do the likely/unlikely macros in the Linux kernel work and what is their benefit? - Stack Overflow](https://stackoverflow.com/questions/109710/) -- [GCC __builtin_expect組み込み関数](https://gcc.gnu.org/onlinedocs/gcc/extensions-to-the-c-language-family/other-built-in-functions-provided-by-gcc.html) -- [Clang __builtin_expect組み込み関数](https://llvm.org/docs/BranchWeightMetadata.html) +- [GCC `__builtin_expect`組み込み関数](https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html) +- [Clang `__builtin_expect`組み込み関数](https://llvm.org/docs/BranchWeightMetadata.html) - [P0479R2 Attributes for Likely and Unlikely Statements (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0479r2.html) -- [P0479R5 Proposed wording for likely and unlikely attributes (Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0479r5.html) \ No newline at end of file +- [P0479R5 Proposed wording for likely and unlikely attributes (Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0479r5.html) From 1395fe50164088ad60776f7ac32ba3290ddc4ad4 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 18 Nov 2024 14:55:10 +0900 Subject: [PATCH 1280/3948] =?UTF-8?q?NOTICE.md=E3=81=A7=E3=81=AEMarkdown?= =?UTF-8?q?=E8=A8=98=E6=B3=95=E3=81=AE=E5=88=B6=E9=99=90=E3=82=92=E3=80=81?= =?UTF-8?q?=E6=8B=A1=E5=BC=B5=E3=83=9A=E3=83=BC=E3=82=B8=E3=81=A8=E7=B5=B1?= =?UTF-8?q?=E5=90=88=20#1362?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .start_editing.md.swp | Bin 0 -> 36864 bytes NOTICE.md | 57 --------- start_editing.md | 15 +-- start_editing/.markdown_cpprefjp.md.swp | Bin 0 -> 36864 bytes start_editing/class_template_page.md | 2 +- .../comparison_operator_template_page.md | 2 +- start_editing/concept_template_page.md | 2 +- start_editing/cpo_template_page.md | 2 +- start_editing/function_template_page.md | 2 +- start_editing/header_template_page.md | 2 +- start_editing/lang_template_page.md | 2 +- .../{specialized.md => markdown_cpprefjp.md} | 120 ++++++++++++++---- start_editing/module_template_page.md | 2 +- .../named_requirement_template_page.md | 2 +- start_editing/type-type_template_page.md | 2 +- 15 files changed, 110 insertions(+), 102 deletions(-) create mode 100644 .start_editing.md.swp delete mode 100644 NOTICE.md create mode 100644 start_editing/.markdown_cpprefjp.md.swp rename start_editing/{specialized.md => markdown_cpprefjp.md} (79%) diff --git a/.start_editing.md.swp b/.start_editing.md.swp new file mode 100644 index 0000000000000000000000000000000000000000..0f90a12b5cb4341ea859ba77a1b75766fc3e85db GIT binary patch literal 36864 zcmeI5d2rm zvHSUc-+RAfu^{Ova>i3&_{Fiizju7^>peEFdj5$o#UEPP7~|^$vDk@kJ=}KRqrVvY z?8joU#Ku%6A+O)zOFy@w&m%SOzsLUl8T<1;)V%*s?BAcYKi_Ky zcH{q~eO>by{QgAE`}XanA4?cm!oU&+mN2k{fh7zqVPFXZOBh(fz!C0Dkb(vDgqW2>dAl|DOP-Ner9< zCV|(1r+||r6PkfPCh72f5)(5(9{3ZI0RI~J8
1OJje$-drga{-GJctyOFzfdaN zC=~|hW{dO3Zgf}u{80JCA#cm|__CICYcl?FPoh1w{?&NPhGfgeQvO&eKV8aS zDHSG4g$v7LalTf>%a^WrC-#(b!=?NnqqtAal=9c&%N|cOUoGYHrCeTK$sH->bEV!~DffnsIZ(=NF6B-KpUh2r zy~EzX$x?2rRLGU`tf(NX(`D#-_Q#j4ZBKP>T&Ig)+4bs+%Qj@QUEL2i*j|j4E$NP$ zevIb!baO*TqC1<+G_1588=KOZjqBUfo4OmiTQaGxY(r$wf5LdEP<`Z3Xg+$}kj&@{YLXjhw3E>$AGOzfw8kxJg zwR{HlMe?EPsERSa^GP!TjKJ$V(N+2}k*regb=cHrs!OH(30TG33{x{%Ftm4OpLYn{ zqi;mWbU~;)xNbW1mQzJC<b>N zXEIe!zggb5jdiYVO=goV*>&sFndVe$YqAramdHSaWTty1h`tMo-CncZVSEUQUdLXH ziEts0`JLWqzS2LzUMu6d@|k1hJzKmpV7TZw(To`PR}4S86+1=d+mQ$OidVOs_J((t z3Y$eK76vd~qB}+ph6D&riGqiSqY%-u@Y9L5WcLDHag~*zzT;gz-5XR3oh$EVb^No+ zF21a}C)M6svlN~(f-raW43CxfoK-$S5whzeVqw^OZX_64RgfD~mv#yphlW=jZj4v` ziKe`1n2-gHe>J%x)6*G$Dcvk+wIaWl9eSI$de_Gt7IvyCKt$j}8YH`6>HT2haONA|^ z!rqeTFdUgMzA&G57qJMh1)q<_>X{s6IDabZ#4z;S&DqK>qf*9MieueiIJWCvwETR# z1^K)m8Xy=o5D2jmZ;ttRFiaZdO{J~1x#~tlA5lX-qzYDj1)QziBsNgk2_&Ht`x=c& zTC>U<*j(y8wAxvyQRS&VWpBH;+=L}aVa6NXTHdETDV~5scC0+TO%{FSoOj~TDrHbu z6K`kA>xVC$*XI+~5-lKC@EP8+UX^T7*@jdOT65>dCa?ksxa1&Wud)stMHESI%S8oQjfDTP|AslF$6Z=su4fkC)(I} zT_~a6oZFeB0naYFgSeT?2y~qXMY_$TW~c1&WAU|>T{B)`v{cZwi+RV_k9dW*H+-oM zjKlI+Od0Y>y%j44r^?&TS8t#&g(7vP6fR?L@CtLIU2kfza!p)ghr^m>L6u5z3}4V_ zc$F=mA!K8B3Pf(dFKHcTTXoP_v}lfE$xwT4=H%Q}ye5njo3L8=ts4ha_0<_G#39DW z8flZ55h1>2Q8zJMnFe)+>Bobe;>PvnjEq6oxtmyk=|vXDf+Xg1yc=R$lsOE`gqUB{ zAc|dF1L1k`{{uBacP|2kZ$PkvG_efhuBfjfxOlx(IH>~-#3cUz1LEW3#LE)@yZZUp ziTUpVzCoP78TeJ;G_n1MfwRQ&?+5M$E)&mR0xklRzy#0-Yy^GGcsKA< zz_;1Me*sPavY%tX($|ka23Ew^u3oizjd$(hi_0QML>gMso!LyPxku6|>v${My-q$U z>K?WeH~Rds$_N^tfC+u60+1_W=&F+gzA=r(UW;eb>Gp<1YioPle7zQLT(t^&AAc?G zyS;NWyDOKFvRN^IXSaF%C*$pjOj|Pka9o5@1an%y4_b#nL=E#Inxk^?s(85W6@K?- z4;c?R{#t1M4uAenth&S89h{Tt>4-et?LWQdPEU7tB--0q`Lf4;?boccAi0GJR%|^B z3~?RgmI(c#dhHfbPPb14RQ& zYS6aKJ7JPNMsrC7TFUp9a>SSDW$ZV}Fet_|l9ZD`H^0+Z5bM;~T+xxm)}u(coAp>! zvY-Rr*&R+@h9)KkZ;}NhJxV@6ntRW1#sL5MWt_&1^gA+;+qx@{qT6-`vfuA*7}{x-#jnC51OFk^R+{ zcU|-L^!X(9`6BX&(qZ8vwG3>Z5hfP#o&l2Mkg}e>N`$n z)?S^t>D?mjb=oQ&(Sv~+qBd|>GiQ?R$wYUuJwj@wFuX)^AJ1)@)rXC9Gneg{&Yl>m zOOSk-{2d9VVW%s1tL}CCv$J3YjKC;??l_C(sfT$6&(S%;MFQx`e3ZCAYzv~%uF(%U52{OK_fcN2#a-lsYt_+}YA1beF-$gc?&hJ&vFp{-#Q(-{ z^Bj`FKPny=9jX|bb?_AvDXyL<^C-ylTt4TC<#TKD^c&@jtw@+E?h7h~$3 zh*1Yx>j`e0wjy3_U zW_piG2t>i5W++?*8H&J3TLp4cnx|A37nb)1Od=Pf;3wW{6HICvdUGbfN!TFXF-g6- zo0l{PY&5<;t;sBZe>UYTc_`Sba%yY&t}4o0Z69s7~Wbf0(dyjDUdu=3?|*KM{rXck~a zcs+O@4CdF7B1B}YqMHJvR=&W;ir&EG`Tb<7C(FZQ-i=EOXxL#3H|rd-3>|%s%hzSf zB;a<^CG1Ss2ite`-rQIzKPZ$mo{faZEkzY=wvI!mbEAm?dlF`xK z(DKPoeR9o1zn*+Bv1l+(C`KdLM^>M?pYf}n<&4gOy4s0Qvf)5!7Y7C=r15t&` zN>kDyjjBo8{O}7&>W`Pyt%0*8g`c#G3KcNoor9Yps^7aaWoTvsYj2cw;CbkN zrCO#cLv+WacMS&TL4WUEJ*34l$(MVQ-C3b^KUpWo6{@vt$=4ONZ5NKH2XcJXsV!#J zN_;>4E-Q1hG8n8eS?+~3c-^5#3$6jf1@-XAg6O~)-H!2aEW2P}%H*Sauqf4A7z2t7 z>{M!+?4$;*7U^{m8=_e(g8cFbG9cwJUAWcY2G5a2QUt#VL!fuSaM4Tz?X*a-Sr-FK zqf~^tQ9MNyu-X7kzo7LrK_XiV7T{xaxP~ObgSnz5&s3?Gei`zKzS3iUlr7$PAW5q1 zz-SGdD8Vqe!~Gs*n+OkvPz8I}pwzpySM9N|B5Z8~G}=QB(Ztag##rSHcwicozF8mR zVgd=9KsZEH4I&ITG(Waaksq2^RB1FRb?0hXkibG=hU<)e;!2E!tLB-y>inKz+S6F) zeD8U&QeusK!EjuxDR=E$v9(*52m=8Us?iJ7e}(Fo`Uj`+Dpyr~W8J}*Lx0=qW42?rAhyOhFn7HLamx0VM=(R;&eeTf zok>`}C>zIkG;~GzxqJq z>QxWkSxg&Ldv!O+r@loY9_;nb;e1euD3l7lqF?i~P~zWqK;ERfWhv|@v6Cr#Vh$Yd(^`j+;2YEL@UP~#-73%({+4Fe&4Xk;DvfR#-# zB|@~jqL|eGe~!5MzXB5ff1Drk^#kJn=Yi*dp9g-AJU}<_3E;cr0nP*Mz&{86fPBCX zU^~!2PGBXl0{Cn40B-@ufL{Tw5dU8WE&(qAk{h@m_%``~y}%w|H}Deh19Af22mU)b zfO$ZA{r@Ad6ZjqA{lE!w0LKAY`?qBe?=n3AIezv6_X9J;`#r#4u_xz+?IqMCeF~P; zs~i$Eiu3xqxYklGqZb>+S}YIsR>!QZs-8JpokAB+KP?X8SB-;cJC3CL!uN{;w}e5w zp;PMTpopxA6oalAS8>hW-a>vv+j(cFDZPWkzk@?BO7DM+IqUM+Na>wK?V|f%WG(8j zSsBvsaDL>x3Yn<1auI!oBV^iQM=0T_t@dLw>p5=ko4YO!sI;brA|jMg$lKCxeZ-Y)L!)jVZ_OtVyRIhA^DE=CQ)!qBFIkQIH(X(Whc(}3YMV9aj4F@KcBs4jc?T~*Fmjw=pWTrbTrgNB(b<~rShqga78)kV(@KI3kCtNRl(!v;EzZpl zk?&xz1tUqBY+YxfBiZfR(c(d|EZi>a_g)KAXxw5P1jC$&Fp+j7>u2#Jy(z?nvKA(n zk~)c2aPVro?w>ZKL*J#c0-$(c6pz6+lok+wCBXV0V*}f9Wqf=i!xmu2k-oenP^xJFua40~KZZ8`A6;8vCJt!QdG5f)#T2zo1}x|e&h!j z{r?h*ZBXjs#QzQakS~eu}349UwH1JX22gLN(fG(gN*a$oV3=`w82a-T5 z@NbFrXMw}O8$dU4eg+s~53-K|*~^dJSG2*ZX#5jDMlznC%f1HUqE$k|ok&xWc%`Dx zhupD5V=VZXYt({;L^J!ZAc8ZI!dXG@*Md z5?UG7tzkJfA`mEx%|GuC;G&zBGNYSSRbH`;lI^pLxia*CKf zeZ;gGEWR6TeSXLrJ)v8S&R8=z2mK<=a3IDm)ur5IFZD53GnD4`^bB`hR7HKCg{}`d zt(pOeIL0QKx`uJ|PtiKhr@FbsBCd_Z)8R`GeCA#mZ)y-qez=^dqR6 z#la*%3c6~w#xET??3pfX6LBqcrBz{03+Es2H_HH1s-j`?5W}0?gt*dpYx^sgE}0YF zZq1!(yXx{G98Vcc-R|gTV@*v>;>`vmsOQc;@HM57w2Ul&m=?IkhvLuaAqyH#*D4le zsuyLT#~*vF?g(uyEj;?r$L;6M;$Hl?vE}$HnMl*kw;3s#A%pCc-vS& z(O~tSgLTn0Qgw~4OIX@F0za6T0d3;O5#@q0WqhM$d?yyyIPgEL&F8rzocXPY!^H=S z(Mj%Z^SNoKRg9c5rf~{1X<&||OOnDJ`{hoDtvNZl%q=WqypEh10pcl}YB5K>gM1pQ z6sM3#!yO@65WDH}MZ>us-Ce3(rlK2Sw!7O?K+x!(=tR+@z7bXX!wxASb$r?U!Qx!M9r_%B*BI4 zH42zP2_XSL6UyB_3s!{A!`MMP#Y;XPx*djRc@ZKy2C&Gg9V0L=3lXtg1h{+-1@DUa zt`*0)jUdS+Ud;tSjv=s&l6liRg^;Rg@5U9{;M4)3cy&ceD3jAfa>HKy&^^2 zjfI#)5dHXEMzE-2`Di7i6KbbbKF9kwIU^0y0_*MQBkNQ+g4-nrvi|u1c?nLW3e^(TWuL6DgUJ){=qEj$2H! zWyEC&$h1nwA%@bn2x(Gu{s6)ve8oO*JGHj-$PURkN(t0QpBs(!Kz-PcqYYcdBR04e zi9=`a@Rw1W?NRoSj7tdPwt5dMj&MeCs5-k#d`s6xXq^k=Bap)i)h`?pMOGzkB+8&CQGO zkk*7{U5iowC6;hZ;aV=aQ8h_Z0ufq!ennY7Dog;%x zXVYyixNtho$*Sh+lzXiKhDX31$y|34l34nH5p?LSEJ!sayubufl~Cpyq5nO;a^*_( z4i-G)()hRKz-eO^oCuIDgy)efA4yyrGck9aKNTyS0G8_~K$vk$XHZ%5TO_fh_~Z46 zxK?|iKN`Wx=WSOqdx%eZYHxZ;=al7I+5u3-SSf4r~QRfJcEi@K^Kz z90y(io(H~1p5VK{6`%$9dEhU|73>F|1>O(LkRwO|Yk<{2Bk%hMO-UIwD8)*TWfdud`fD-wE?*N|z9tFze33dZt0JgE`t-wD8bpPNXW{y~z zi)Cs&UWh^OP?*5lOO9xZ+u*#RsZ#EQ+9!;(XffaIC89U|?lu6niFt%bEv0nc#`#(i zf9!?FIhUQzB;zlbq<;MIOuDCwJbJz_{-nJ5WU4un$h^AXeZBZcyN2S+elxkAvIwmT zUFl4gXNA2qT#}-}HFDE_Z=_Y-EJV0PLKqXFyANuf82Luek30V}k`ItzBvJrapyP@! zP!YJx!hv5l4LUAq)%4Y^Gn8(13%7v;S{c1Y%YBB~bJm#T|L?^;`r%?{Gk=|x4h}rX5CRzgH{uttjlhd?2R3Ap~FAyWNz`Zt3 zcHnBSSsC}E5O>5AUK2wSTfH)FPBw#~@Hq`*)162aImIB^&|b1uEZ$rLhkZxX(5QVj z>q1R;Ka!^!U-DseNEXz|gjcm&vT&61P?VqL#IZ4SPFKeoS%*1_Oe7@!T{NF24$X8$ z^4&OA!==Kw%{JuExnJadCI17}@e2~>VVACMGskxwLmE41Ed<)B?riKabY-Srr1uqx ztwrFCT<=vU2QpwO(Eqh{S1o*32dAqSU>cTQZ*Qzp3!;H(&oe4UomGNkC?zIHbU+aC z)g_29gH6aSGLc$jC}wry%Q3kn)ZGX zTScm=N;s~ruM)r=!oW5u{kSS>kX?Ha$BSyJFw38U}OQJY28idMqW5pUf(g~WH7SHOGU zqDE)dw8Jo#yfs2^stn=kveL~_KDW)JTFi@XAicv#ZdR6fg-CK-&s8w3QOm|Pag(oz z*X9GQ<+QOJ+8|mgH5Sgk8%2P)L6HOag_*J*oK)p`ibmh?Ee?VD3OhM|sD?GuSO#Nh zOH^!Mw4AYdr_Y!aoEcJdEe6K4p{sdS^g>|_n{y~JGn8R<2|@DKUZqKvht{EKt0A@N zD|8m8#vnzqzhb;p-S>_(p?kwyY|`KpEzLSM(}Q9Tb~!UY6;3Sb>D6NG;)1;!Lljo> z;fcg+3V9Uqddl5tc6aT==U?e+Cj`laT;X(UbGkjdlFq{hJ;C_`y;9BTSAtJ$GB4Oq z#G(mdL4usBG>PRr0srMt|Foo}7PFqEyrSRcrJ)1<8UOrRrn7UQSW8VDAudTXOspKB z5lP7BL(+z9*9fipQb@5J$RV{LhqQ+da*<6k^FGQO_ETO+j5ARb`JQYUu1GVzi;T_MYb>+Z7#$~FfkEF(wG81aoK-~|38RP zzu(6H?*G?2O6)K9{}qY#FA(EPzyCSl3&37t`#rz_Aouz=0qcOjCC2|7;C}-*fd4G< zJ#ZY5GXP28Uf}9a$70KY31a(J;A6lyiS0AM%fMU2_x}TE0@eW&#P;LBzXE;>_*LKo zz@HJ{9|Z;giTghY{3S8|1TYRf3p@k-C9(b>@F4Jq?6VW-0NR0d!0!N`1_TGc3`D=) z))i9XZn?;qVdH#>MvbZy|2i6s%JwPlKrS_4&b|kvmmbzsPd%uDzq& zXJY(h(tp#z1nN0k)NqMUmR!WZ@Vm`pdXC(5O$& zZw5I;)J+Is=GL4Aix$+^L67MF#nBV1^MrH|$)$s}T^%8n#f=WM`;afBHd&(x9OE?I z@%F=y(GAyx#xR*%i`2U7sh*ytu0q>KsX#a**+2~ghwL+J-6e?>GUd%c$x|`e(9>M= zzeVWPi+=ArjhV|?ggG)ABmS?u0yBf5vLph`eW-EC6xHtFnWvud+gG7t^l-jrS9Xui zkBxB1%-i91@Pz!g5AlXb(=mTW5~;?z3u95(;QN5xy*?|8*nge$i)07f`5&EZG%x?5 z1%9E5BiST|`|ju$D@toB$A(wSJb0vv8ZU{t-h!qCogf3JCRTKhV$b4>v~X zfSOF`MjGRS&coyUD~8K(I%mYsT`jbr{ZbjK-a0(r z+w0G--K{K5PC#o*39Y%5HdRVs>i(_TOm5T-<7hQV6c!{?H_VhdsIAxxzCjJxH@7Rq z`C1YGa#yl5{#d%bogA(H-yp-3U&_0t%Y$rSv(st95u7^E3$4|I9Yj0esZUUls-B;z z>@xQs$Xk|kov~qm^KyJ`#2Y>CU1wd3j{kT%-NrRdg&<1?N+jDRy@xXL-1Pw>kJu+k zEF8X6bNw#|;50+qQs2 zjd(7YSLVlrD&*ER;0bN6e2Dnwb!*%V^&q3(?x2bJ5fFmyP(K=Kh5G5L=Efqw7~0ADVHYzZ~0H9(!;REoL2SXTv#eTi&rxI48O%;kVF2^#cr# zz)U;#D+a5V=n{_F;iswM%Npl<&#`%PL*H^ysuE_1>Jq)BF2(EiT4yrjNE8!ZyT}uD zcFn;=#h##^^xsU;;98XM?MD>Ra2InhLCxNUE6ny;|L_s?yI~;Fp9{GJfiV`q#HbOe zhXLhY4`PI2T2LLOX{S)`#|<`jcl*JhdIK(DtpQ*l2bQ($<#|T*oof-+xWQm`Fvf-k zx%Oa4>c8rBSaXDUDv|{mdetz5T3tSbfQY zB%{M;82}em2gBc#-cnu^&M?JjyZj)G7hP8`IQL5`%OM_z?6-}ThYkk@%VI&e*?Ldt z29uUqP{JgCjAZPlE>OW78#glbv6x?xk>>c)oFbW3+bmp;=V{^I9b zQyk;^Xt%9dikS;vH|g6rLUOhCvR{ir_y6RG2V;DSpb-GpF%sq{48(~mZ=3W^PMXJs zOGOnQHL<^|y8dP+u|5m$EP`%YOOTwMlWU-B xSCJdXyeMoP%6T$s_#n3aA14dx7)iT{8y{)gb2Ivb%hdA+M(IFwca7-y{|`kZ-I)LY literal 0 HcmV?d00001 diff --git a/NOTICE.md b/NOTICE.md deleted file mode 100644 index c036711894..0000000000 --- a/NOTICE.md +++ /dev/null @@ -1,57 +0,0 @@ -# github と andare における Markdown の違い - -github で見た結果と、それを cpprefjp に反映した結果は少し異なることがある。 - -これは、github が使っている Markdown のエンジンと、cpprefjp に反映する時に使っている Markdown のエンジン(andare)が異なっているためである。 - -andare は、github と比べて、少なくとも以下の点が異なっている。 - -## インデントが 4 スペースである -``` -* てすと - * てすと2 -``` - -これは andare ではフラットなリストだと解釈される。 -2 スペースではなく、4 スペースで 1 つのインデントだと解釈されるためである。 - -``` -* てすと - * てすと2 -``` - -これなら正しく表示される。 - - -## HTML エンティティが使えない -``` -® -``` -のような書き方をすると、andare ではエラーになる。 - -これは HTML エンティティを使わず、 -``` -® -``` -と書けば良い。 - - -## リストの前に空行が必要 -``` -適当な文字列 -* リスト -* リスト2 -``` - -このような書き方をすると、andare では以下の様な表示になる。 -``` -適当な文字列 * リスト * リスト2 -``` - -通常の文字列に続いてリストを置く場合、空行を入れる必要がある。 -``` -適当な文字列 - -* リスト -* リスト2 -``` diff --git a/start_editing.md b/start_editing.md index d9e48a739d..7f60aa5113 100644 --- a/start_editing.md +++ b/start_editing.md @@ -93,25 +93,14 @@ Markdownの記述方法をわかりやすく解説してくれているWebサイ ただし、cpprefjp特有の拡張構文もあります。 以下のページにまとめてあるので、そちらを参照して下さい。 -- [cpprefjp特有の拡張構文](/start_editing/specialized.md) +- [cpprefjpでのMarkdown記法の制限と拡張](/start_editing/markdown_cpprefjp.md) -Markdown形式では、HTMLのタグも併用できますが、cpprefjpサイトでは積極的にはHTMLタグを使用しない方針です。できるだけ、Markdown形式でできる範囲内で解決するようにしてください。 +Markdown形式では、HTMLのタグも併用できますが、cpprefjpサイトでは積極的にはHTMLタグを使用しない方針で、許可されたタグのみ使用できます。できるだけ、Markdown形式でできる範囲内で解決するようにしてください。 ただし、注釈・出典を貼るためにHTMLタグを利用します。 - [cpprefjpにおける注釈・出典の貼り方](/start_editing/cite_note_ref.md) -それ以外に本サイト内で使用しているHTMLタグは以下です: - -- アンカーを貼るために、`対象文字列`のようなHTML5に基づく記法を利用している -- 表内での改行のために、`
`タグを利用している -- 値の大きさを表現するために、上付き文字を表す``タグを利用している -- 添字を表現するために、下付き文字を表す``タグを利用している - -その他、Markdown記法の制限として、以下のようなものがあります: - -- 表内で `|` (縦線、vertical line) を使用するために、文字参照 `&#x7C;` を使用している -- 箇条書きのインデントとして4スペースのみを許可している (2スペースでは正しくインデントされない) 新規リファレンスを書くにあたって、雛形ページを用意していますので、そちらをベースにして編集作業を行ってください。 diff --git a/start_editing/.markdown_cpprefjp.md.swp b/start_editing/.markdown_cpprefjp.md.swp new file mode 100644 index 0000000000000000000000000000000000000000..0727062c028229dd03aea1e8b60e501402c4c621 GIT binary patch literal 36864 zcmeI53wT^roxlgGfC{4Px(K>@DaCDTo^1t8LljzGT0pQU-KKOV$)p{cWWr=p+U-^| zGkqjY`k>NxX&UGwZRn&>3T@Meg6w|ls;K)C5oNiVnZ)nIx_-Vs@v*=Ex%b?;GkG++ zg6{4O{E~Ux$GQJ=&i|bM6N-i!78KV9B8zIm4>ru#2Nl)VjBsV|V^0E}1V)uWbF{Ybx=Vahr<9h+aaWDM z(s<8b+%xJa-j|*PJPCLb@Fd_#z>|O{0Z#&+1Uw1+-;zMI@j~Ahc%<{~$GY17dtTn( zx7zRZac|4}{zCh`GA?*skoWyX_WKR?-~8|2Vt@W2`|m^cUtNw1?Dv!GzkPY%kF(#; zw*S7E_r3kr`{PN#lYl1yPXe9|O{0Z#&+1pZ%2AV5fc!`pqn@^|p~ z#Q(MZ|H7p{-#4HSPQY>Kg&)4t=Np6p_&OYgI#>ihy2R&u3g*CtZ~?q>vCsDdxCds# zr{PoZNw@|+3Z+m81@IAg2fQ6NQl^Js14#L%!*y^iyiA$zf_HJ;uX+DEoP}56IruW1 zf|IZXHp4hLAAZSszkr{B2`|7m;8{2do8e&)xwOL?h(in_a39PAx&KVK8m@v5!3W_I zxEK;RNq&su<2tw&rodHjDZCTL!Flik&XcdhKfzbvIhX_Y!d-9!TnxX)3GyrWIs6P> zgzvy-;U4%Dd=hSgYhXNF3GaoAU=Sxx223~(dtoFx*PW7HP69>)2 z5i{OfX86etsSQSg4b{QoP`D`?2?pv(`|ulPENRAD&Dbh4b})77(bUQHu1gNR%))52 zv8=c_xFk^DSQjj+4%ZjghQq~GfyjuLDm2m^t5eDCsr9`BiBsI>p1WspSL7P7ZeMGGqJA*fz5zt_o6U_|Kl)nL4>Cz3K4Tle_$8tcP=)CrhoQ>`A#| ze4}+6Gq%NyogR9H-qQn5bfq`1P955kYTcqQr6t7asguZWP4-;wTo-CsW^A7sTVclAQxBc$@7qI(&Yt|D8RLa6dwPF6H1jMO=z zi?{cmNe(`Cnup39<&^a~&t-oXOJ;gkq;@=M6>)?sCNn#pN}cA$?Pk2qDM#k%?Pd%~ zaI^h9UbdvZ$wpJOW^Q%3E*vpxYfJc<$7kib#Z}A|i5kPV#d$uz-|t&at#ggCvg&Yi z)F>}EmdG#lNwA@&Zn`hj5H;!pp@xZ*jAiQ0661QKv}8IeAk3McD@#+K36sMWZI6?)#wts{p}y<-a2sRu+=Qg7>%^s zuC?LYP_qA6%V2^Qwo$hen&H}Pukc-Um0>2fNUMtEzgM5!9Y!9URgEmD zNkkyM>><<$9kBnj>J8H4>5skX$Ga#?R-Gju8|ZGK-=udOlin)FSRE*7#?GiCGpU^r4&Gd{1KT8-0csbgxJ>TWz< zr>de>Rn>I!hm=z9G2`7z+9#C)JSeJX_fx42XuthtJWel6wH`o24YaIOisBI-j04oS zT34VUMG$M#>vxzjPTV(eV4qSfqA~2Iff`I6Pj97}pk}SlJIy#Ws{XiY8_5~PGd}VW zn#{n#U8;2qQ|!r;m1KJJA2+^nB*{<^=`*%?Ea_xB$~jdX=kjA@lGg9l=|{S(T2v)u zxTlb-)o*H)t}R_*ni)TCCbr8E!3$~ORLRDH?k5<6ty)dBK0UZiLPi5!-Aosdrs4m4 zzcDd$Y+vS??X;%F!ALYj#;JkA4o+fjv9bTu8QPb1`WsgkuB?7|;6IN?mHw#OKSHr* z59{NZmB{PEOo66fwdC3v(;2L@^09Og+Qv~MJdokYnd-2GOb6AqAUdY7u)^nKK2;xN zfRnK=8e9@BDk@@%eq~{yQbRuJ3Xf4+J-RaV&EoBPkPw9-^?p=-OLsz%v|BflKGPC& zrdzt_Fh_JvBBc9u>GssC@8gUCJIweOrMpYBWE>djMCZ|%{5{jhluO!QS2q)>Jgp)H zI@YdK#ac_e){z|MFK=qDs?hpGw_jhOk!nE)B~yE>LNOg1<Of&wdNG;x@q`z_CN$LQl>OM1IgleuI?>;cKVeR;eym?`Hae(W) zhOt{`-#+W3RAs93gc;k5-ep8jA5o93dNi%ZPWDzxQ6`+at6NjmPPu|s%e0vG5o=W{ z)qSw8Mn2Z<%f7j*@eaAW%uC};O82^2Qc_Ptdh#yBptP<_DHh$9t&W3=mzgE~h;fGc zMwWJI)cD3YzD6EYwW-t^Mvjhwrx8B`fJ_XS!K7MO$&{eIi+Q~xF+GRRy%+77Crs~) z5A2Jf6DJ#U>jTk+_Xn03!G=IpU2q=F-N<>&WZqL`%hqk((I@u*#RS=-64=N7*YWdB z*!nlaO>hHz75n}l;CbkTUGO6I{iDzYA-EaD<`?_^%h=hwpb378ExZtl;HTKcC!hsx zhF@d`<{y&%kMT3XVW8 zEQh7A1R5a>*F!m61Q)_@#!(*lCHxFtgO^}C%!XUx6L39z46cI`D1@uwJ@9Sh*a0oD z1e!r)+XNAK074J|KimqpKm}X_-=!|T135niKcaixf0Z7V4~EsneD0Gk^;zdU+EChC zpMsS>g3dH1igM4nw%o%q@Q1lu?ibdfz6le2m66bbh0!8kCDziiKqL}ay4+V;S6dfm ziaoK>C^SkZ8I^V61@o7cmMk}_DkJJEHI`M%h_kH!*c!SEqeN=YX6bWkmbtvL($|uedkuvwAL! z@xx$#K$Wrm?8(-_mhGuye26<~yBfBSsZmmVXl4R~0$Z5F+GH9v%)F^b7hVRFY&p_9 z+fr+ob#uN5A$4XYqe^zn%1#TJcQZ_7wllNEW#w7Zd^I}iHj^_v$sE9uajxifp`96>^0cYxoO6agM#^swXG$@tO5jFQrbdGG z;l;t4x%I&)?Xa;Ce^r@*@ib*BbC6Wqn!#-h+4k%seV`M+U)}|3f~-%&@E_?KgOBV= zuj@|j#o$0V4C#+Cmm2O$B_kH4WNbw#8LcRCjj;{KcGr!;LXsV8>X!vQX8 z8BdN|2HVivh!5L3z){EI<>}4rjAb@q_^2_ZB~I|7xjL$x9ldJgw4H&rhQTLDxI;Oj zaUw5_gd4(^fED{?^bqG^T<7IJ5Y}6&Z7p8$!OdSB@tG34)MMc--8j&a zNUvl75;0oOB>tF|c+Pd0Fm;?rwXRmCOs~JJOuW=~6^CjHqe~luBG`dLTT`ujQ-?Ol zRI3}yXzxfRP<~eJZq02}Y<&M>_fwr;-v|O#&l{mfY4@~IiAW$C-?$3fB~|u0C69 zVQ);HobKM1KC#*DAD=wgNUc7hyaLu7L{E}zTg4p=bxLPD@pf8{1;1Tb^=bO)R(fsf z%+_q=&-T(wSLUMlqWX`uruHyZ(al8c|2weDUj?!Mb^iS!Z2lsc06)Uk-v;Yo7L120 z;R1Lo9Kz;b49)O)Z2#rZ0F`hnOob1@2jSiD8a{zecm%e=R?x9|DaW^94%`bL#z$~9 zG~ycw!(n^^y|5NPKnL6pA<({n?_3V zrZ9ZqTK7a+1KxrCnTI>mt<0=!U86kWn4!AcNo92sc#I94Cd5LPMTe>{8pYb7z0;kQ zW5$#RB6}UI7O`uGwg)S%#TIKKX2zMGs~nGbT*V}q1L!s{u4`A(l0#3zA-XhNACi<3 zQ3t8xNBaAcOgc@PwM0*Gn-ja>`FLK&S7!grn)sZdOa*9@+cT#RSTWIogNLkOqBa0% ziFQG(BpI%+qYKv1tD3VMqasI0?(nMgBYQ2c2MStWxg+%`m*S=zPr*8^)`B>hCUR@l z1Gor1us8D*SxTGS8lNgowQth3rsglw*l^!)wIk^rmXeU5naYKc>e9o59e)GS8A=yHU`u@mD<)1>v|$5{7&=Ud6;{tWFN$94K{glL$;U!%oMPFcui>Nln7j6 z(S+xiz9AfXGfyfrWA11sR>)yeDX4p@1L4rVq~GTZgj)Fc|JuaoG_e0Mu91}u)`XI= zL{r;Zs8YjUUQ^qk0#S|$K?q7$M0qjaR)`qvyBYovNn+S==@#+~@YfwuqpB1{+PZ2W z`r^{K$rnnmBk<#BQDwAQ(^Jut$eZeQ+OE~{xScf2VVYb1r^GRmD$!e*g=Aqs}7vZ30((TZT1@e(Jma{C>DcUT>m}oys&gb4+$35 zt+dNfB?u7*q#fgC=+XH^l3_HkkA~1|%(ZWM*F87Py6xsU^Jm@mnb}3rCDE)8)Y{HU zovfOo!AS84S0Qad+Ew1rEF+~W$*ghd#KlD_FfnlwCT|g86M3QX zGVDCb`D~#TksPIRa?dIzs;?wFt-u)1|C1(3f|L5t%6C#n8H@4YFEdIDj41`iRAYHw z-kLjC&Axbr>$5-|wlW)e)w@4*lIUCqT6fgbC!J*C^QpurwCQ2`yM2tmfY;77)Vu6$ ztS@y*y462p&IFW zs7bN4T)KtI&B^(ZnIoPU^!rBa!eMX7tQOstdWeDhNLCM}R-*10D=-a)$@x)QOJ>n3 z(}n_*^oC+aymsE3ObF~GC2NRq^c#JI(ODAZ^80}mzZ;s}iWYPltWLHt__2>1l0)j} zVMTY4btQ^JCJFtgn3f_NG?p$1XOpc~7pk^gUqf%p;k^TGPjWH;-FM$|%Z)dZb=z8c z&0x!uc>7cg#7WrQuZKg|^+zuu++Wqs!Q5Nd$7x z_To6e#~6RcRPN4{O5~Aj7Ad~`6jE15l_pk6)H{ylB~cd@xr{%nUyYPRE%yIK*!UAc z?0?K%_47OXGn2os!gBa~_%z%Jw_*3+3gvJbyZ;0nhh9iR2^2#SoDb*0@_y2S;f@RjLtLO*Q*FuhDv$|M_bNhS8a*M`xPFEZocdAF`If%l!Y7E>vKa z>X+;WYp2#fm&||hGz{-SVZt$F{;y}+-eLfsw-~@%3?R!S48zKt&RGqB9idHT-DMmb z^Nn5s^~T?jJB&e-4Q_5v?Qc)To)TY7rCl;0wi&vRtjKp~yS;4X&r$ zEIz;Qjj0^DY;KJ>^6t)x9xIPbx)!&Tt<(?Yf9^>iBX*1rT${^wt+HKL+Lka5bkso72oM%>p z#B{~=fIE$5Y_IIV?VRb^ZTT>r+Rz5N_}G-aJj@l;svlf&U6~$S4qVN>V#x8~a|O#? zYr7(x@Qn`6<)1i0X<4m7GVy*L8o(h*?>j7I`(rF=`J=2AQZ8*tt`P5pF>y++L`0N2 z^kyjqTK;O4B1>gBULO(DB=IPy{Qoat<4wn26#IV?f8Dc&Xuo4@71w4<< z{S|l=d%6qiU=f6{fyG9C1v~f$@Den`1JDRQ_#O7|gHQq2gRG4&1+kAWgIBS0Uk0&} z{|ep<8KZ??2$HAUOaBU@z>3PS^snAK+?e0@?qs z7G!;bAkAUoNpyU5u^xxa} z&)fIU+xPEH*!Rzi{`+%Mhpqi7y{!PftpL?#xMbq8zC?By9DOUmyuARu=zqM|i~dW{ zIcE=~5u^WdBuVVJJ0xV=I>r5lseSA~O47d%s?GE`*7Et6Ga=#H*|qm{|G#PN>^jGOL$e4PA2}MRMIgSGGgT zs)}T<*;6$rX)bM&~fs!K&C+x3esOmL;A6TUE;Ye`7bo)8=hJwT2L2UwIB^j{7V}pN5(=r>ww))jkmYgraOvgZg17LruK zx&pgfsl9ExSxz^&+8y6_-*NQ&iT#hsYUONW|8L;6{D}SkTk!J#z5M?_EdSqXN1g}3 z+xg$y`QO|5U;hIQZ_3X9o(F)rhHLS#=K)av6a%v^CW^bW+mYn&j_>_r0QN>LUj9Eb z-{Eq?Jr97GF=O)p{15*<9I=PEm1}L8m;Y}I-pl`IYZ~^Ec@y*h9c7?*oEdC+jKvtP zoO;XVmK8d~E_T3iGGyhUZrf^5VoeG|Q@3~z_;0H literal 0 HcmV?d00001 diff --git a/start_editing/class_template_page.md b/start_editing/class_template_page.md index 9d2676d074..e20675b4a7 100644 --- a/start_editing/class_template_page.md +++ b/start_editing/class_template_page.md @@ -1,6 +1,6 @@ # page_title (1行目の見出し1はページのタイトルです。修飾なしで記載してください) -([cpprefjpを編集するには](/start_editing.md) および [cpprefjp特有の拡張構文](specialized.md) を先に読んで下さい。) +([cpprefjpを編集するには](/start_editing.md) および [cpprefjpでのMarkdown記法の制限と拡張](markdown_cpprefjp.md) を先に読んで下さい。) ( サンプルコードは文章中のどの部分で書いても大丈夫です。閲覧者の理解を助けるために必要だと感じたところで入れてください。 diff --git a/start_editing/comparison_operator_template_page.md b/start_editing/comparison_operator_template_page.md index 65007f5cbd..e8c9406713 100644 --- a/start_editing/comparison_operator_template_page.md +++ b/start_editing/comparison_operator_template_page.md @@ -1,6 +1,6 @@ # page_title ((1行目の見出し1はページのタイトルです。修飾なしで記載してください) -([cpprefjpを編集するには](/start_editing.md) および [cpprefjp特有の拡張構文](specialized.md) を先に読んで下さい。) +([cpprefjpを編集するには](/start_editing.md) および [cpprefjpでのMarkdown記法の制限と拡張](markdown_cpprefjp.md) を先に読んで下さい。) ( サンプルコードは文章中のどの部分で書いても大丈夫です。閲覧者の理解を助けるために必要だと感じたところで入れてください。 diff --git a/start_editing/concept_template_page.md b/start_editing/concept_template_page.md index e295832fe0..23a2ba1bee 100644 --- a/start_editing/concept_template_page.md +++ b/start_editing/concept_template_page.md @@ -1,6 +1,6 @@ # page_title ((1行目の見出し1はページのタイトルです。修飾なしで記載してください) -([cpprefjpを編集するには](/start_editing.md) および [cpprefjp特有の拡張構文](specialized.md) を先に読んで下さい。) +([cpprefjpを編集するには](/start_editing.md) および [cpprefjpでのMarkdown記法の制限と拡張](markdown_cpprefjp.md) を先に読んで下さい。) ( サンプルコードは文章中のどの部分で書いても大丈夫です。閲覧者の理解を助けるために必要だと感じたところで入れてください。 diff --git a/start_editing/cpo_template_page.md b/start_editing/cpo_template_page.md index d6c6a94a46..b440943c25 100644 --- a/start_editing/cpo_template_page.md +++ b/start_editing/cpo_template_page.md @@ -1,6 +1,6 @@ # page_title ((1行目の見出し1はページのタイトルです。修飾なしで記載してください) -([cpprefjpを編集するには](/start_editing.md) および [cpprefjp特有の拡張構文](specialized.md) を先に読んで下さい。) +([cpprefjpを編集するには](/start_editing.md) および [cpprefjpでのMarkdown記法の制限と拡張](markdown_cpprefjp.md) を先に読んで下さい。) ( サンプルコードは文章中のどの部分で書いても大丈夫です。閲覧者の理解を助けるために必要だと感じたところで入れてください。 diff --git a/start_editing/function_template_page.md b/start_editing/function_template_page.md index ed4324687f..b06bb2421f 100644 --- a/start_editing/function_template_page.md +++ b/start_editing/function_template_page.md @@ -1,6 +1,6 @@ # page_title ((1行目の見出し1はページのタイトルです。修飾なしで記載してください) -([cpprefjpを編集するには](/start_editing.md) および [cpprefjp特有の拡張構文](specialized.md) を先に読んで下さい。) +([cpprefjpを編集するには](/start_editing.md) および [cpprefjpでのMarkdown記法の制限と拡張](markdown_cpprefjp.md) を先に読んで下さい。) ( サンプルコードは文章中のどの部分で書いても大丈夫です。閲覧者の理解を助けるために必要だと感じたところで入れてください。 diff --git a/start_editing/header_template_page.md b/start_editing/header_template_page.md index 9a3c743783..1c99026daf 100644 --- a/start_editing/header_template_page.md +++ b/start_editing/header_template_page.md @@ -1,6 +1,6 @@ # page_title ((1行目の見出し1はページのタイトルです。修飾なしで記載してください) -([cpprefjpを編集するには](/start_editing.md) および [cpprefjp特有の拡張構文](specialized.md) を先に読んで下さい。) +([cpprefjpを編集するには](/start_editing.md) および [cpprefjpでのMarkdown記法の制限と拡張](markdown_cpprefjp.md) を先に読んで下さい。) ( サンプルコードは文章中のどの部分で書いても大丈夫です。閲覧者の理解を助けるために必要だと感じたところで入れてください。 diff --git a/start_editing/lang_template_page.md b/start_editing/lang_template_page.md index 212d17556d..b704e2f492 100644 --- a/start_editing/lang_template_page.md +++ b/start_editing/lang_template_page.md @@ -1,6 +1,6 @@ # page_title ((1行目の見出し1はページのタイトルです。修飾なしで記載してください) -([cpprefjpを編集するには](/start_editing.md) および [cpprefjp特有の拡張構文](specialized.md) を先に読んで下さい。) +([cpprefjpを編集するには](/start_editing.md) および [cpprefjpでのMarkdown記法の制限と拡張](markdown_cpprefjp.md) を先に読んで下さい。) ( サンプルコードは文章中のどの部分で書いても大丈夫です。閲覧者の理解を助けるために必要だと感じたところで入れてください。 diff --git a/start_editing/specialized.md b/start_editing/markdown_cpprefjp.md similarity index 79% rename from start_editing/specialized.md rename to start_editing/markdown_cpprefjp.md index 2ba83f2312..1d3e6f582a 100644 --- a/start_editing/specialized.md +++ b/start_editing/markdown_cpprefjp.md @@ -1,10 +1,97 @@ -# cpprefjp特有の拡張構文 +# cpprefjpでのMarkdown記法の制限と拡張 * [mathjax enable] + +## 概要 +cpprefjpでは、ドキュメントの記述にMarkdown記法を採用していますが、いくつかの制限があり、表現力が足りない部分は拡張記法を用意しています。 + + +## Markdown記法の制限 +### HTMLタグの制限 +cpprefjpでは、許可されたHTMLタグしか使用できません。 + +- アンカーを貼るために、`対象文字列`のようなHTML5に基づく記法を許可 +- 表内での改行のために、`
`タグを許可 +- 値の大きさを表現するために、上付き文字を表す``タグを許可 +- 添字を表現するために、下付き文字を表す``タグを許可 + +### ブロックコメントの制限 + +実装に使用しているMarkdownパーサーによる制限で、以下のようなブロックコメントは使用できません。 + +``` + +``` + + +### 表内での縦線の制限 + +表内で `|` (縦線、vertical line) を使用するために、文字参照 `&#x7C;` を使用しています。 + + +### 箇条書きのインデントとして4スペースのみを許可する制限 + +実装に使用しているMarkdownパーサーによる制限で、箇条書きのインデントとして4スペースのみを許可しています (2スペースでは正しくインデントされません)。 + +``` +* てすと + * てすと2 +``` + +これはcpprefjpではフラットなリストだと解釈されます。 + +``` +* てすと + * てすと2 +``` + +これなら正しく表示されます。 + + +### HTMLエンティティを使用できない制限 +``` +® +``` +のような書き方をすると、cpprefjpではエラーになります。HTML エンティティを使わず、以下のように書いてください。 + +``` +® +``` + + +## リストの前に空行が必要な制限 +``` +適当な文字列 +* リスト +* リスト2 +``` + +このような書き方をすると、cpprefjpでは以下の様な表示になります。 + +``` +適当な文字列 * リスト * リスト2 +``` + +通常の文字列に続いてリストを置く場合、空行を入れる必要があります。 + +``` +適当な文字列 + +* リスト +* リスト2 +``` + + +## Markdown記法の拡張 + Markdownだけだと表現力が足りないため、cpprefjpでは構文を拡張しています。 -## 文章中のコード +### 文章中のコードに関する拡張 バッククォートによる文章中のコード指定では、バッククォート内の両端にスペースは使用できません。以下のようにスペースはバッククォートの外で使用すれば、コードとして連結されます。 @@ -17,7 +104,7 @@ Markdownだけだと表現力が足りないため、cpprefjpでは構文を拡 式`f(a,` [`std::make_shared`](/reference/memory/make_shared.md)`(x));`が有効である場合、それを呼び出す。 -## コードブロック +### コードブロックに関する拡張 \`\`\` と \`\`\` で挟むことで、複数行に渡るコードを書けます。 @@ -45,7 +132,7 @@ int main() { } ``` -## シンタックスハイライト +### シンタックスハイライトの拡張 コードブロック開始側の \`\`\` の後ろに言語名を書くことで、その言語に対応したハイライトが行われます。 @@ -73,7 +160,7 @@ int main() { } ``` -## exampleタグ +### exampleタグの拡張 includeとmain関数を含む**原則すべてのC/C++言語のコードブロック**には`example`タグをつけてください。 `example`タグが付いたコードブロックはその場で実際にコンパイル・実行することができるようになります。 @@ -99,7 +186,7 @@ namespace std { } ``` -## プログラムの修飾 +### プログラムの修飾に関する拡張 コードブロックの直後に特定の構文で記述することで、コードブロックの一部を修飾できます。 @@ -151,7 +238,7 @@ int main() { - `<対象文字列>`をイタリック体にします。 - `<引数>`はありません。 -### グローバル修飾 +#### グローバル修飾 全てのコードブロックでは、デフォルトの修飾が実行されます。 これを **グローバル修飾** と呼びます。 @@ -172,7 +259,7 @@ int main() { グローバル修飾の一覧は [GLOBAL_QUALIFY_LIST.txt](https://github.com/cpprefjp/site/blob/master/GLOBAL_QUALIFY_LIST.txt) にあります。 -## 定義語 +### 定義語に関する拡張 `GLOBAL_DEFINED_WORDS.json` に定義語を登録することができます。形式は `GLOBAL_DEFINED_WORDS.json` を参照して下さい。 @@ -184,7 +271,7 @@ int main() { `yomi` には平仮名およびアルファベットでその定義語の読みを指定します。現在は使用されていませんが将来的に定義語が増えてきた時に、用語集または索引ページを自動生成する時の並び替えに使われる予定です。 -## リンクの存在チェック +### リンクの存在チェックに関する拡張 CommonMark形式のリンクや独自拡張のプログラムの修飾`link`などで生成されるHTMLにリンクが埋め込まれるとき、リンク先がサイト内へのリンクだった場合、リンク先の存在チェックも行います。 @@ -221,7 +308,7 @@ Note: You can create /reference/foobar.md for editors_doc/specialized.md. Warning: [nolinked editors_doc/specialized.md] href "/reference/foobar.md.nolink (/reference/foobar.md.nolink)" found. ``` -## メタ情報 +### メタ情報を付加する拡張 ページのどこか(通常はページタイトルの下)に `* <メタ情報>[meta <メタ情報タイプ>]` という構文で書くことで、メタ情報を記述できます。 記述可能なメタ情報は以下の通りです。 @@ -250,7 +337,7 @@ Warning: [nolinked editors_doc/specialized.md] href "/reference/foobar.md.nolink * `* cpp23deprecated[meta cpp]` : C++23で非推奨になった機能 * `* cpp23removed[meta cpp]` : C++23で削除された機能 -## 数式 +### 数式を記述する拡張 cpprefjpでは、数式をLaTeX形式で記述できます。 内部的には[MathJax](https://www.mathjax.org/)を利用しています。 @@ -298,14 +385,3 @@ p \log_{10}b&\text{もし $b$ が $10$ の累乗の場合}\\ \right. $$ - -## 使用できないMarkdown / HTMLの機能 -- ブロックコメント (実装に使用しているMarkdownパーサーによる制限) - ``` - - ``` - diff --git a/start_editing/module_template_page.md b/start_editing/module_template_page.md index 8c502466bd..612326b908 100644 --- a/start_editing/module_template_page.md +++ b/start_editing/module_template_page.md @@ -1,6 +1,6 @@ # page_title ((1行目の見出し1はページのタイトルです。修飾なしで記載してください) -([cpprefjpを編集するには](/start_editing.md) および [cpprefjp特有の拡張構文](specialized.md) を先に読んで下さい。) +([cpprefjpを編集するには](/start_editing.md) および [cpprefjpでのMarkdown記法の制限と拡張](markdown_cpprefjp.md) を先に読んで下さい。) ( サンプルコードは文章中のどの部分で書いても大丈夫です。閲覧者の理解を助けるために必要だと感じたところで入れてください。 diff --git a/start_editing/named_requirement_template_page.md b/start_editing/named_requirement_template_page.md index 46785553d0..60eec0376b 100644 --- a/start_editing/named_requirement_template_page.md +++ b/start_editing/named_requirement_template_page.md @@ -1,6 +1,6 @@ # page_title ((1行目の見出し1はページのタイトルです。修飾なしで記載してください) -([cpprefjpを編集するには](/start_editing.md) および [cpprefjp特有の拡張構文](specialized.md) を先に読んで下さい。) +([cpprefjpを編集するには](/start_editing.md) および [cpprefjpでのMarkdown記法の制限と拡張](markdown_cpprefjp.md) を先に読んで下さい。) ( サンプルコードは文章中のどの部分で書いても大丈夫です。閲覧者の理解を助けるために必要だと感じたところで入れてください。 diff --git a/start_editing/type-type_template_page.md b/start_editing/type-type_template_page.md index 77a2d5fecc..09d721ea63 100644 --- a/start_editing/type-type_template_page.md +++ b/start_editing/type-type_template_page.md @@ -1,6 +1,6 @@ # page_title ((1行目の見出し1はページのタイトルです。修飾なしで記載してください) -([cpprefjpを編集するには](/start_editing.md) および [cpprefjp特有の拡張構文](specialized.md) を先に読んで下さい。) +([cpprefjpを編集するには](/start_editing.md) および [cpprefjpでのMarkdown記法の制限と拡張](markdown_cpprefjp.md) を先に読んで下さい。) ( サンプルコードは文章中のどの部分で書いても大丈夫です。閲覧者の理解を助けるために必要だと感じたところで入れてください。 From 4a8c6fa8ac54ffe5055348a1062608bd9815ea3a Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 18 Nov 2024 14:59:05 +0900 Subject: [PATCH 1281/3948] =?UTF-8?q?.swp=E3=83=95=E3=82=A1=E3=82=A4?= =?UTF-8?q?=E3=83=AB=E3=82=92=E3=82=B3=E3=83=9F=E3=83=83=E3=83=88=E3=81=97?= =?UTF-8?q?=E3=81=A6=E3=81=97=E3=81=BE=E3=81=A3=E3=81=A6=E3=81=84=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .start_editing.md.swp | Bin 36864 -> 0 bytes start_editing/.markdown_cpprefjp.md.swp | Bin 36864 -> 0 bytes 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .start_editing.md.swp delete mode 100644 start_editing/.markdown_cpprefjp.md.swp diff --git a/.start_editing.md.swp b/.start_editing.md.swp deleted file mode 100644 index 0f90a12b5cb4341ea859ba77a1b75766fc3e85db..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 36864 zcmeI5d2rm zvHSUc-+RAfu^{Ova>i3&_{Fiizju7^>peEFdj5$o#UEPP7~|^$vDk@kJ=}KRqrVvY z?8joU#Ku%6A+O)zOFy@w&m%SOzsLUl8T<1;)V%*s?BAcYKi_Ky zcH{q~eO>by{QgAE`}XanA4?cm!oU&+mN2k{fh7zqVPFXZOBh(fz!C0Dkb(vDgqW2>dAl|DOP-Ner9< zCV|(1r+||r6PkfPCh72f5)(5(9{3ZI0RI~J8
1OJje$-drga{-GJctyOFzfdaN zC=~|hW{dO3Zgf}u{80JCA#cm|__CICYcl?FPoh1w{?&NPhGfgeQvO&eKV8aS zDHSG4g$v7LalTf>%a^WrC-#(b!=?NnqqtAal=9c&%N|cOUoGYHrCeTK$sH->bEV!~DffnsIZ(=NF6B-KpUh2r zy~EzX$x?2rRLGU`tf(NX(`D#-_Q#j4ZBKP>T&Ig)+4bs+%Qj@QUEL2i*j|j4E$NP$ zevIb!baO*TqC1<+G_1588=KOZjqBUfo4OmiTQaGxY(r$wf5LdEP<`Z3Xg+$}kj&@{YLXjhw3E>$AGOzfw8kxJg zwR{HlMe?EPsERSa^GP!TjKJ$V(N+2}k*regb=cHrs!OH(30TG33{x{%Ftm4OpLYn{ zqi;mWbU~;)xNbW1mQzJC<b>N zXEIe!zggb5jdiYVO=goV*>&sFndVe$YqAramdHSaWTty1h`tMo-CncZVSEUQUdLXH ziEts0`JLWqzS2LzUMu6d@|k1hJzKmpV7TZw(To`PR}4S86+1=d+mQ$OidVOs_J((t z3Y$eK76vd~qB}+ph6D&riGqiSqY%-u@Y9L5WcLDHag~*zzT;gz-5XR3oh$EVb^No+ zF21a}C)M6svlN~(f-raW43CxfoK-$S5whzeVqw^OZX_64RgfD~mv#yphlW=jZj4v` ziKe`1n2-gHe>J%x)6*G$Dcvk+wIaWl9eSI$de_Gt7IvyCKt$j}8YH`6>HT2haONA|^ z!rqeTFdUgMzA&G57qJMh1)q<_>X{s6IDabZ#4z;S&DqK>qf*9MieueiIJWCvwETR# z1^K)m8Xy=o5D2jmZ;ttRFiaZdO{J~1x#~tlA5lX-qzYDj1)QziBsNgk2_&Ht`x=c& zTC>U<*j(y8wAxvyQRS&VWpBH;+=L}aVa6NXTHdETDV~5scC0+TO%{FSoOj~TDrHbu z6K`kA>xVC$*XI+~5-lKC@EP8+UX^T7*@jdOT65>dCa?ksxa1&Wud)stMHESI%S8oQjfDTP|AslF$6Z=su4fkC)(I} zT_~a6oZFeB0naYFgSeT?2y~qXMY_$TW~c1&WAU|>T{B)`v{cZwi+RV_k9dW*H+-oM zjKlI+Od0Y>y%j44r^?&TS8t#&g(7vP6fR?L@CtLIU2kfza!p)ghr^m>L6u5z3}4V_ zc$F=mA!K8B3Pf(dFKHcTTXoP_v}lfE$xwT4=H%Q}ye5njo3L8=ts4ha_0<_G#39DW z8flZ55h1>2Q8zJMnFe)+>Bobe;>PvnjEq6oxtmyk=|vXDf+Xg1yc=R$lsOE`gqUB{ zAc|dF1L1k`{{uBacP|2kZ$PkvG_efhuBfjfxOlx(IH>~-#3cUz1LEW3#LE)@yZZUp ziTUpVzCoP78TeJ;G_n1MfwRQ&?+5M$E)&mR0xklRzy#0-Yy^GGcsKA< zz_;1Me*sPavY%tX($|ka23Ew^u3oizjd$(hi_0QML>gMso!LyPxku6|>v${My-q$U z>K?WeH~Rds$_N^tfC+u60+1_W=&F+gzA=r(UW;eb>Gp<1YioPle7zQLT(t^&AAc?G zyS;NWyDOKFvRN^IXSaF%C*$pjOj|Pka9o5@1an%y4_b#nL=E#Inxk^?s(85W6@K?- z4;c?R{#t1M4uAenth&S89h{Tt>4-et?LWQdPEU7tB--0q`Lf4;?boccAi0GJR%|^B z3~?RgmI(c#dhHfbPPb14RQ& zYS6aKJ7JPNMsrC7TFUp9a>SSDW$ZV}Fet_|l9ZD`H^0+Z5bM;~T+xxm)}u(coAp>! zvY-Rr*&R+@h9)KkZ;}NhJxV@6ntRW1#sL5MWt_&1^gA+;+qx@{qT6-`vfuA*7}{x-#jnC51OFk^R+{ zcU|-L^!X(9`6BX&(qZ8vwG3>Z5hfP#o&l2Mkg}e>N`$n z)?S^t>D?mjb=oQ&(Sv~+qBd|>GiQ?R$wYUuJwj@wFuX)^AJ1)@)rXC9Gneg{&Yl>m zOOSk-{2d9VVW%s1tL}CCv$J3YjKC;??l_C(sfT$6&(S%;MFQx`e3ZCAYzv~%uF(%U52{OK_fcN2#a-lsYt_+}YA1beF-$gc?&hJ&vFp{-#Q(-{ z^Bj`FKPny=9jX|bb?_AvDXyL<^C-ylTt4TC<#TKD^c&@jtw@+E?h7h~$3 zh*1Yx>j`e0wjy3_U zW_piG2t>i5W++?*8H&J3TLp4cnx|A37nb)1Od=Pf;3wW{6HICvdUGbfN!TFXF-g6- zo0l{PY&5<;t;sBZe>UYTc_`Sba%yY&t}4o0Z69s7~Wbf0(dyjDUdu=3?|*KM{rXck~a zcs+O@4CdF7B1B}YqMHJvR=&W;ir&EG`Tb<7C(FZQ-i=EOXxL#3H|rd-3>|%s%hzSf zB;a<^CG1Ss2ite`-rQIzKPZ$mo{faZEkzY=wvI!mbEAm?dlF`xK z(DKPoeR9o1zn*+Bv1l+(C`KdLM^>M?pYf}n<&4gOy4s0Qvf)5!7Y7C=r15t&` zN>kDyjjBo8{O}7&>W`Pyt%0*8g`c#G3KcNoor9Yps^7aaWoTvsYj2cw;CbkN zrCO#cLv+WacMS&TL4WUEJ*34l$(MVQ-C3b^KUpWo6{@vt$=4ONZ5NKH2XcJXsV!#J zN_;>4E-Q1hG8n8eS?+~3c-^5#3$6jf1@-XAg6O~)-H!2aEW2P}%H*Sauqf4A7z2t7 z>{M!+?4$;*7U^{m8=_e(g8cFbG9cwJUAWcY2G5a2QUt#VL!fuSaM4Tz?X*a-Sr-FK zqf~^tQ9MNyu-X7kzo7LrK_XiV7T{xaxP~ObgSnz5&s3?Gei`zKzS3iUlr7$PAW5q1 zz-SGdD8Vqe!~Gs*n+OkvPz8I}pwzpySM9N|B5Z8~G}=QB(Ztag##rSHcwicozF8mR zVgd=9KsZEH4I&ITG(Waaksq2^RB1FRb?0hXkibG=hU<)e;!2E!tLB-y>inKz+S6F) zeD8U&QeusK!EjuxDR=E$v9(*52m=8Us?iJ7e}(Fo`Uj`+Dpyr~W8J}*Lx0=qW42?rAhyOhFn7HLamx0VM=(R;&eeTf zok>`}C>zIkG;~GzxqJq z>QxWkSxg&Ldv!O+r@loY9_;nb;e1euD3l7lqF?i~P~zWqK;ERfWhv|@v6Cr#Vh$Yd(^`j+;2YEL@UP~#-73%({+4Fe&4Xk;DvfR#-# zB|@~jqL|eGe~!5MzXB5ff1Drk^#kJn=Yi*dp9g-AJU}<_3E;cr0nP*Mz&{86fPBCX zU^~!2PGBXl0{Cn40B-@ufL{Tw5dU8WE&(qAk{h@m_%``~y}%w|H}Deh19Af22mU)b zfO$ZA{r@Ad6ZjqA{lE!w0LKAY`?qBe?=n3AIezv6_X9J;`#r#4u_xz+?IqMCeF~P; zs~i$Eiu3xqxYklGqZb>+S}YIsR>!QZs-8JpokAB+KP?X8SB-;cJC3CL!uN{;w}e5w zp;PMTpopxA6oalAS8>hW-a>vv+j(cFDZPWkzk@?BO7DM+IqUM+Na>wK?V|f%WG(8j zSsBvsaDL>x3Yn<1auI!oBV^iQM=0T_t@dLw>p5=ko4YO!sI;brA|jMg$lKCxeZ-Y)L!)jVZ_OtVyRIhA^DE=CQ)!qBFIkQIH(X(Whc(}3YMV9aj4F@KcBs4jc?T~*Fmjw=pWTrbTrgNB(b<~rShqga78)kV(@KI3kCtNRl(!v;EzZpl zk?&xz1tUqBY+YxfBiZfR(c(d|EZi>a_g)KAXxw5P1jC$&Fp+j7>u2#Jy(z?nvKA(n zk~)c2aPVro?w>ZKL*J#c0-$(c6pz6+lok+wCBXV0V*}f9Wqf=i!xmu2k-oenP^xJFua40~KZZ8`A6;8vCJt!QdG5f)#T2zo1}x|e&h!j z{r?h*ZBXjs#QzQakS~eu}349UwH1JX22gLN(fG(gN*a$oV3=`w82a-T5 z@NbFrXMw}O8$dU4eg+s~53-K|*~^dJSG2*ZX#5jDMlznC%f1HUqE$k|ok&xWc%`Dx zhupD5V=VZXYt({;L^J!ZAc8ZI!dXG@*Md z5?UG7tzkJfA`mEx%|GuC;G&zBGNYSSRbH`;lI^pLxia*CKf zeZ;gGEWR6TeSXLrJ)v8S&R8=z2mK<=a3IDm)ur5IFZD53GnD4`^bB`hR7HKCg{}`d zt(pOeIL0QKx`uJ|PtiKhr@FbsBCd_Z)8R`GeCA#mZ)y-qez=^dqR6 z#la*%3c6~w#xET??3pfX6LBqcrBz{03+Es2H_HH1s-j`?5W}0?gt*dpYx^sgE}0YF zZq1!(yXx{G98Vcc-R|gTV@*v>;>`vmsOQc;@HM57w2Ul&m=?IkhvLuaAqyH#*D4le zsuyLT#~*vF?g(uyEj;?r$L;6M;$Hl?vE}$HnMl*kw;3s#A%pCc-vS& z(O~tSgLTn0Qgw~4OIX@F0za6T0d3;O5#@q0WqhM$d?yyyIPgEL&F8rzocXPY!^H=S z(Mj%Z^SNoKRg9c5rf~{1X<&||OOnDJ`{hoDtvNZl%q=WqypEh10pcl}YB5K>gM1pQ z6sM3#!yO@65WDH}MZ>us-Ce3(rlK2Sw!7O?K+x!(=tR+@z7bXX!wxASb$r?U!Qx!M9r_%B*BI4 zH42zP2_XSL6UyB_3s!{A!`MMP#Y;XPx*djRc@ZKy2C&Gg9V0L=3lXtg1h{+-1@DUa zt`*0)jUdS+Ud;tSjv=s&l6liRg^;Rg@5U9{;M4)3cy&ceD3jAfa>HKy&^^2 zjfI#)5dHXEMzE-2`Di7i6KbbbKF9kwIU^0y0_*MQBkNQ+g4-nrvi|u1c?nLW3e^(TWuL6DgUJ){=qEj$2H! zWyEC&$h1nwA%@bn2x(Gu{s6)ve8oO*JGHj-$PURkN(t0QpBs(!Kz-PcqYYcdBR04e zi9=`a@Rw1W?NRoSj7tdPwt5dMj&MeCs5-k#d`s6xXq^k=Bap)i)h`?pMOGzkB+8&CQGO zkk*7{U5iowC6;hZ;aV=aQ8h_Z0ufq!ennY7Dog;%x zXVYyixNtho$*Sh+lzXiKhDX31$y|34l34nH5p?LSEJ!sayubufl~Cpyq5nO;a^*_( z4i-G)()hRKz-eO^oCuIDgy)efA4yyrGck9aKNTyS0G8_~K$vk$XHZ%5TO_fh_~Z46 zxK?|iKN`Wx=WSOqdx%eZYHxZ;=al7I+5u3-SSf4r~QRfJcEi@K^Kz z90y(io(H~1p5VK{6`%$9dEhU|73>F|1>O(LkRwO|Yk<{2Bk%hMO-UIwD8)*TWfdud`fD-wE?*N|z9tFze33dZt0JgE`t-wD8bpPNXW{y~z zi)Cs&UWh^OP?*5lOO9xZ+u*#RsZ#EQ+9!;(XffaIC89U|?lu6niFt%bEv0nc#`#(i zf9!?FIhUQzB;zlbq<;MIOuDCwJbJz_{-nJ5WU4un$h^AXeZBZcyN2S+elxkAvIwmT zUFl4gXNA2qT#}-}HFDE_Z=_Y-EJV0PLKqXFyANuf82Luek30V}k`ItzBvJrapyP@! zP!YJx!hv5l4LUAq)%4Y^Gn8(13%7v;S{c1Y%YBB~bJm#T|L?^;`r%?{Gk=|x4h}rX5CRzgH{uttjlhd?2R3Ap~FAyWNz`Zt3 zcHnBSSsC}E5O>5AUK2wSTfH)FPBw#~@Hq`*)162aImIB^&|b1uEZ$rLhkZxX(5QVj z>q1R;Ka!^!U-DseNEXz|gjcm&vT&61P?VqL#IZ4SPFKeoS%*1_Oe7@!T{NF24$X8$ z^4&OA!==Kw%{JuExnJadCI17}@e2~>VVACMGskxwLmE41Ed<)B?riKabY-Srr1uqx ztwrFCT<=vU2QpwO(Eqh{S1o*32dAqSU>cTQZ*Qzp3!;H(&oe4UomGNkC?zIHbU+aC z)g_29gH6aSGLc$jC}wry%Q3kn)ZGX zTScm=N;s~ruM)r=!oW5u{kSS>kX?Ha$BSyJFw38U}OQJY28idMqW5pUf(g~WH7SHOGU zqDE)dw8Jo#yfs2^stn=kveL~_KDW)JTFi@XAicv#ZdR6fg-CK-&s8w3QOm|Pag(oz z*X9GQ<+QOJ+8|mgH5Sgk8%2P)L6HOag_*J*oK)p`ibmh?Ee?VD3OhM|sD?GuSO#Nh zOH^!Mw4AYdr_Y!aoEcJdEe6K4p{sdS^g>|_n{y~JGn8R<2|@DKUZqKvht{EKt0A@N zD|8m8#vnzqzhb;p-S>_(p?kwyY|`KpEzLSM(}Q9Tb~!UY6;3Sb>D6NG;)1;!Lljo> z;fcg+3V9Uqddl5tc6aT==U?e+Cj`laT;X(UbGkjdlFq{hJ;C_`y;9BTSAtJ$GB4Oq z#G(mdL4usBG>PRr0srMt|Foo}7PFqEyrSRcrJ)1<8UOrRrn7UQSW8VDAudTXOspKB z5lP7BL(+z9*9fipQb@5J$RV{LhqQ+da*<6k^FGQO_ETO+j5ARb`JQYUu1GVzi;T_MYb>+Z7#$~FfkEF(wG81aoK-~|38RP zzu(6H?*G?2O6)K9{}qY#FA(EPzyCSl3&37t`#rz_Aouz=0qcOjCC2|7;C}-*fd4G< zJ#ZY5GXP28Uf}9a$70KY31a(J;A6lyiS0AM%fMU2_x}TE0@eW&#P;LBzXE;>_*LKo zz@HJ{9|Z;giTghY{3S8|1TYRf3p@k-C9(b>@F4Jq?6VW-0NR0d!0!N`1_TGc3`D=) z))i9XZn?;qVdH#>MvbZy|2i6s%JwPlKrS_4&b|kvmmbzsPd%uDzq& zXJY(h(tp#z1nN0k)NqMUmR!WZ@Vm`pdXC(5O$& zZw5I;)J+Is=GL4Aix$+^L67MF#nBV1^MrH|$)$s}T^%8n#f=WM`;afBHd&(x9OE?I z@%F=y(GAyx#xR*%i`2U7sh*ytu0q>KsX#a**+2~ghwL+J-6e?>GUd%c$x|`e(9>M= zzeVWPi+=ArjhV|?ggG)ABmS?u0yBf5vLph`eW-EC6xHtFnWvud+gG7t^l-jrS9Xui zkBxB1%-i91@Pz!g5AlXb(=mTW5~;?z3u95(;QN5xy*?|8*nge$i)07f`5&EZG%x?5 z1%9E5BiST|`|ju$D@toB$A(wSJb0vv8ZU{t-h!qCogf3JCRTKhV$b4>v~X zfSOF`MjGRS&coyUD~8K(I%mYsT`jbr{ZbjK-a0(r z+w0G--K{K5PC#o*39Y%5HdRVs>i(_TOm5T-<7hQV6c!{?H_VhdsIAxxzCjJxH@7Rq z`C1YGa#yl5{#d%bogA(H-yp-3U&_0t%Y$rSv(st95u7^E3$4|I9Yj0esZUUls-B;z z>@xQs$Xk|kov~qm^KyJ`#2Y>CU1wd3j{kT%-NrRdg&<1?N+jDRy@xXL-1Pw>kJu+k zEF8X6bNw#|;50+qQs2 zjd(7YSLVlrD&*ER;0bN6e2Dnwb!*%V^&q3(?x2bJ5fFmyP(K=Kh5G5L=Efqw7~0ADVHYzZ~0H9(!;REoL2SXTv#eTi&rxI48O%;kVF2^#cr# zz)U;#D+a5V=n{_F;iswM%Npl<&#`%PL*H^ysuE_1>Jq)BF2(EiT4yrjNE8!ZyT}uD zcFn;=#h##^^xsU;;98XM?MD>Ra2InhLCxNUE6ny;|L_s?yI~;Fp9{GJfiV`q#HbOe zhXLhY4`PI2T2LLOX{S)`#|<`jcl*JhdIK(DtpQ*l2bQ($<#|T*oof-+xWQm`Fvf-k zx%Oa4>c8rBSaXDUDv|{mdetz5T3tSbfQY zB%{M;82}em2gBc#-cnu^&M?JjyZj)G7hP8`IQL5`%OM_z?6-}ThYkk@%VI&e*?Ldt z29uUqP{JgCjAZPlE>OW78#glbv6x?xk>>c)oFbW3+bmp;=V{^I9b zQyk;^Xt%9dikS;vH|g6rLUOhCvR{ir_y6RG2V;DSpb-GpF%sq{48(~mZ=3W^PMXJs zOGOnQHL<^|y8dP+u|5m$EP`%YOOTwMlWU-B xSCJdXyeMoP%6T$s_#n3aA14dx7)iT{8y{)gb2Ivb%hdA+M(IFwca7-y{|`kZ-I)LY diff --git a/start_editing/.markdown_cpprefjp.md.swp b/start_editing/.markdown_cpprefjp.md.swp deleted file mode 100644 index 0727062c028229dd03aea1e8b60e501402c4c621..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 36864 zcmeI53wT^roxlgGfC{4Px(K>@DaCDTo^1t8LljzGT0pQU-KKOV$)p{cWWr=p+U-^| zGkqjY`k>NxX&UGwZRn&>3T@Meg6w|ls;K)C5oNiVnZ)nIx_-Vs@v*=Ex%b?;GkG++ zg6{4O{E~Ux$GQJ=&i|bM6N-i!78KV9B8zIm4>ru#2Nl)VjBsV|V^0E}1V)uWbF{Ybx=Vahr<9h+aaWDM z(s<8b+%xJa-j|*PJPCLb@Fd_#z>|O{0Z#&+1Uw1+-;zMI@j~Ahc%<{~$GY17dtTn( zx7zRZac|4}{zCh`GA?*skoWyX_WKR?-~8|2Vt@W2`|m^cUtNw1?Dv!GzkPY%kF(#; zw*S7E_r3kr`{PN#lYl1yPXe9|O{0Z#&+1pZ%2AV5fc!`pqn@^|p~ z#Q(MZ|H7p{-#4HSPQY>Kg&)4t=Np6p_&OYgI#>ihy2R&u3g*CtZ~?q>vCsDdxCds# zr{PoZNw@|+3Z+m81@IAg2fQ6NQl^Js14#L%!*y^iyiA$zf_HJ;uX+DEoP}56IruW1 zf|IZXHp4hLAAZSszkr{B2`|7m;8{2do8e&)xwOL?h(in_a39PAx&KVK8m@v5!3W_I zxEK;RNq&su<2tw&rodHjDZCTL!Flik&XcdhKfzbvIhX_Y!d-9!TnxX)3GyrWIs6P> zgzvy-;U4%Dd=hSgYhXNF3GaoAU=Sxx223~(dtoFx*PW7HP69>)2 z5i{OfX86etsSQSg4b{QoP`D`?2?pv(`|ulPENRAD&Dbh4b})77(bUQHu1gNR%))52 zv8=c_xFk^DSQjj+4%ZjghQq~GfyjuLDm2m^t5eDCsr9`BiBsI>p1WspSL7P7ZeMGGqJA*fz5zt_o6U_|Kl)nL4>Cz3K4Tle_$8tcP=)CrhoQ>`A#| ze4}+6Gq%NyogR9H-qQn5bfq`1P955kYTcqQr6t7asguZWP4-;wTo-CsW^A7sTVclAQxBc$@7qI(&Yt|D8RLa6dwPF6H1jMO=z zi?{cmNe(`Cnup39<&^a~&t-oXOJ;gkq;@=M6>)?sCNn#pN}cA$?Pk2qDM#k%?Pd%~ zaI^h9UbdvZ$wpJOW^Q%3E*vpxYfJc<$7kib#Z}A|i5kPV#d$uz-|t&at#ggCvg&Yi z)F>}EmdG#lNwA@&Zn`hj5H;!pp@xZ*jAiQ0661QKv}8IeAk3McD@#+K36sMWZI6?)#wts{p}y<-a2sRu+=Qg7>%^s zuC?LYP_qA6%V2^Qwo$hen&H}Pukc-Um0>2fNUMtEzgM5!9Y!9URgEmD zNkkyM>><<$9kBnj>J8H4>5skX$Ga#?R-Gju8|ZGK-=udOlin)FSRE*7#?GiCGpU^r4&Gd{1KT8-0csbgxJ>TWz< zr>de>Rn>I!hm=z9G2`7z+9#C)JSeJX_fx42XuthtJWel6wH`o24YaIOisBI-j04oS zT34VUMG$M#>vxzjPTV(eV4qSfqA~2Iff`I6Pj97}pk}SlJIy#Ws{XiY8_5~PGd}VW zn#{n#U8;2qQ|!r;m1KJJA2+^nB*{<^=`*%?Ea_xB$~jdX=kjA@lGg9l=|{S(T2v)u zxTlb-)o*H)t}R_*ni)TCCbr8E!3$~ORLRDH?k5<6ty)dBK0UZiLPi5!-Aosdrs4m4 zzcDd$Y+vS??X;%F!ALYj#;JkA4o+fjv9bTu8QPb1`WsgkuB?7|;6IN?mHw#OKSHr* z59{NZmB{PEOo66fwdC3v(;2L@^09Og+Qv~MJdokYnd-2GOb6AqAUdY7u)^nKK2;xN zfRnK=8e9@BDk@@%eq~{yQbRuJ3Xf4+J-RaV&EoBPkPw9-^?p=-OLsz%v|BflKGPC& zrdzt_Fh_JvBBc9u>GssC@8gUCJIweOrMpYBWE>djMCZ|%{5{jhluO!QS2q)>Jgp)H zI@YdK#ac_e){z|MFK=qDs?hpGw_jhOk!nE)B~yE>LNOg1<Of&wdNG;x@q`z_CN$LQl>OM1IgleuI?>;cKVeR;eym?`Hae(W) zhOt{`-#+W3RAs93gc;k5-ep8jA5o93dNi%ZPWDzxQ6`+at6NjmPPu|s%e0vG5o=W{ z)qSw8Mn2Z<%f7j*@eaAW%uC};O82^2Qc_Ptdh#yBptP<_DHh$9t&W3=mzgE~h;fGc zMwWJI)cD3YzD6EYwW-t^Mvjhwrx8B`fJ_XS!K7MO$&{eIi+Q~xF+GRRy%+77Crs~) z5A2Jf6DJ#U>jTk+_Xn03!G=IpU2q=F-N<>&WZqL`%hqk((I@u*#RS=-64=N7*YWdB z*!nlaO>hHz75n}l;CbkTUGO6I{iDzYA-EaD<`?_^%h=hwpb378ExZtl;HTKcC!hsx zhF@d`<{y&%kMT3XVW8 zEQh7A1R5a>*F!m61Q)_@#!(*lCHxFtgO^}C%!XUx6L39z46cI`D1@uwJ@9Sh*a0oD z1e!r)+XNAK074J|KimqpKm}X_-=!|T135niKcaixf0Z7V4~EsneD0Gk^;zdU+EChC zpMsS>g3dH1igM4nw%o%q@Q1lu?ibdfz6le2m66bbh0!8kCDziiKqL}ay4+V;S6dfm ziaoK>C^SkZ8I^V61@o7cmMk}_DkJJEHI`M%h_kH!*c!SEqeN=YX6bWkmbtvL($|uedkuvwAL! z@xx$#K$Wrm?8(-_mhGuye26<~yBfBSsZmmVXl4R~0$Z5F+GH9v%)F^b7hVRFY&p_9 z+fr+ob#uN5A$4XYqe^zn%1#TJcQZ_7wllNEW#w7Zd^I}iHj^_v$sE9uajxifp`96>^0cYxoO6agM#^swXG$@tO5jFQrbdGG z;l;t4x%I&)?Xa;Ce^r@*@ib*BbC6Wqn!#-h+4k%seV`M+U)}|3f~-%&@E_?KgOBV= zuj@|j#o$0V4C#+Cmm2O$B_kH4WNbw#8LcRCjj;{KcGr!;LXsV8>X!vQX8 z8BdN|2HVivh!5L3z){EI<>}4rjAb@q_^2_ZB~I|7xjL$x9ldJgw4H&rhQTLDxI;Oj zaUw5_gd4(^fED{?^bqG^T<7IJ5Y}6&Z7p8$!OdSB@tG34)MMc--8j&a zNUvl75;0oOB>tF|c+Pd0Fm;?rwXRmCOs~JJOuW=~6^CjHqe~luBG`dLTT`ujQ-?Ol zRI3}yXzxfRP<~eJZq02}Y<&M>_fwr;-v|O#&l{mfY4@~IiAW$C-?$3fB~|u0C69 zVQ);HobKM1KC#*DAD=wgNUc7hyaLu7L{E}zTg4p=bxLPD@pf8{1;1Tb^=bO)R(fsf z%+_q=&-T(wSLUMlqWX`uruHyZ(al8c|2weDUj?!Mb^iS!Z2lsc06)Uk-v;Yo7L120 z;R1Lo9Kz;b49)O)Z2#rZ0F`hnOob1@2jSiD8a{zecm%e=R?x9|DaW^94%`bL#z$~9 zG~ycw!(n^^y|5NPKnL6pA<({n?_3V zrZ9ZqTK7a+1KxrCnTI>mt<0=!U86kWn4!AcNo92sc#I94Cd5LPMTe>{8pYb7z0;kQ zW5$#RB6}UI7O`uGwg)S%#TIKKX2zMGs~nGbT*V}q1L!s{u4`A(l0#3zA-XhNACi<3 zQ3t8xNBaAcOgc@PwM0*Gn-ja>`FLK&S7!grn)sZdOa*9@+cT#RSTWIogNLkOqBa0% ziFQG(BpI%+qYKv1tD3VMqasI0?(nMgBYQ2c2MStWxg+%`m*S=zPr*8^)`B>hCUR@l z1Gor1us8D*SxTGS8lNgowQth3rsglw*l^!)wIk^rmXeU5naYKc>e9o59e)GS8A=yHU`u@mD<)1>v|$5{7&=Ud6;{tWFN$94K{glL$;U!%oMPFcui>Nln7j6 z(S+xiz9AfXGfyfrWA11sR>)yeDX4p@1L4rVq~GTZgj)Fc|JuaoG_e0Mu91}u)`XI= zL{r;Zs8YjUUQ^qk0#S|$K?q7$M0qjaR)`qvyBYovNn+S==@#+~@YfwuqpB1{+PZ2W z`r^{K$rnnmBk<#BQDwAQ(^Jut$eZeQ+OE~{xScf2VVYb1r^GRmD$!e*g=Aqs}7vZ30((TZT1@e(Jma{C>DcUT>m}oys&gb4+$35 zt+dNfB?u7*q#fgC=+XH^l3_HkkA~1|%(ZWM*F87Py6xsU^Jm@mnb}3rCDE)8)Y{HU zovfOo!AS84S0Qad+Ew1rEF+~W$*ghd#KlD_FfnlwCT|g86M3QX zGVDCb`D~#TksPIRa?dIzs;?wFt-u)1|C1(3f|L5t%6C#n8H@4YFEdIDj41`iRAYHw z-kLjC&Axbr>$5-|wlW)e)w@4*lIUCqT6fgbC!J*C^QpurwCQ2`yM2tmfY;77)Vu6$ ztS@y*y462p&IFW zs7bN4T)KtI&B^(ZnIoPU^!rBa!eMX7tQOstdWeDhNLCM}R-*10D=-a)$@x)QOJ>n3 z(}n_*^oC+aymsE3ObF~GC2NRq^c#JI(ODAZ^80}mzZ;s}iWYPltWLHt__2>1l0)j} zVMTY4btQ^JCJFtgn3f_NG?p$1XOpc~7pk^gUqf%p;k^TGPjWH;-FM$|%Z)dZb=z8c z&0x!uc>7cg#7WrQuZKg|^+zuu++Wqs!Q5Nd$7x z_To6e#~6RcRPN4{O5~Aj7Ad~`6jE15l_pk6)H{ylB~cd@xr{%nUyYPRE%yIK*!UAc z?0?K%_47OXGn2os!gBa~_%z%Jw_*3+3gvJbyZ;0nhh9iR2^2#SoDb*0@_y2S;f@RjLtLO*Q*FuhDv$|M_bNhS8a*M`xPFEZocdAF`If%l!Y7E>vKa z>X+;WYp2#fm&||hGz{-SVZt$F{;y}+-eLfsw-~@%3?R!S48zKt&RGqB9idHT-DMmb z^Nn5s^~T?jJB&e-4Q_5v?Qc)To)TY7rCl;0wi&vRtjKp~yS;4X&r$ zEIz;Qjj0^DY;KJ>^6t)x9xIPbx)!&Tt<(?Yf9^>iBX*1rT${^wt+HKL+Lka5bkso72oM%>p z#B{~=fIE$5Y_IIV?VRb^ZTT>r+Rz5N_}G-aJj@l;svlf&U6~$S4qVN>V#x8~a|O#? zYr7(x@Qn`6<)1i0X<4m7GVy*L8o(h*?>j7I`(rF=`J=2AQZ8*tt`P5pF>y++L`0N2 z^kyjqTK;O4B1>gBULO(DB=IPy{Qoat<4wn26#IV?f8Dc&Xuo4@71w4<< z{S|l=d%6qiU=f6{fyG9C1v~f$@Den`1JDRQ_#O7|gHQq2gRG4&1+kAWgIBS0Uk0&} z{|ep<8KZ??2$HAUOaBU@z>3PS^snAK+?e0@?qs z7G!;bAkAUoNpyU5u^xxa} z&)fIU+xPEH*!Rzi{`+%Mhpqi7y{!PftpL?#xMbq8zC?By9DOUmyuARu=zqM|i~dW{ zIcE=~5u^WdBuVVJJ0xV=I>r5lseSA~O47d%s?GE`*7Et6Ga=#H*|qm{|G#PN>^jGOL$e4PA2}MRMIgSGGgT zs)}T<*;6$rX)bM&~fs!K&C+x3esOmL;A6TUE;Ye`7bo)8=hJwT2L2UwIB^j{7V}pN5(=r>ww))jkmYgraOvgZg17LruK zx&pgfsl9ExSxz^&+8y6_-*NQ&iT#hsYUONW|8L;6{D}SkTk!J#z5M?_EdSqXN1g}3 z+xg$y`QO|5U;hIQZ_3X9o(F)rhHLS#=K)av6a%v^CW^bW+mYn&j_>_r0QN>LUj9Eb z-{Eq?Jr97GF=O)p{15*<9I=PEm1}L8m;Y}I-pl`IYZ~^Ec@y*h9c7?*oEdC+jKvtP zoO;XVmK8d~E_T3iGGyhUZrf^5VoeG|Q@3~z_;0H From a9aca4080b9491e260fc817a34f013dbfedfa82c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 18 Nov 2024 15:09:27 +0900 Subject: [PATCH 1282/3948] =?UTF-8?q?=E8=A6=8B=E5=87=BA=E3=81=97=E3=83=AC?= =?UTF-8?q?=E3=83=99=E3=83=AB=E3=81=AE=E3=83=9F=E3=82=B9=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start_editing/markdown_cpprefjp.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/start_editing/markdown_cpprefjp.md b/start_editing/markdown_cpprefjp.md index 1d3e6f582a..5018916277 100644 --- a/start_editing/markdown_cpprefjp.md +++ b/start_editing/markdown_cpprefjp.md @@ -64,7 +64,7 @@ comment out text... ``` -## リストの前に空行が必要な制限 +### リストの前に空行が必要な制限 ``` 適当な文字列 * リスト From c747f4a71f9ab8a4dfaf1a21424e58bd5ed73f55 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 18 Nov 2024 18:08:56 +0900 Subject: [PATCH 1283/3948] =?UTF-8?q?HTML=E3=82=A8=E3=83=B3=E3=83=86?= =?UTF-8?q?=E3=82=A3=E3=83=86=E3=82=A3=E3=81=AE=E8=A1=A8=E7=A4=BA=E5=B4=A9?= =?UTF-8?q?=E3=82=8C=E3=82=92=E4=BF=AE=E6=AD=A3=20#1362?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start_editing/markdown_cpprefjp.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/start_editing/markdown_cpprefjp.md b/start_editing/markdown_cpprefjp.md index 5018916277..c15f6e5630 100644 --- a/start_editing/markdown_cpprefjp.md +++ b/start_editing/markdown_cpprefjp.md @@ -57,7 +57,8 @@ comment out text... ``` ® ``` -のような書き方をすると、cpprefjpではエラーになります。HTML エンティティを使わず、以下のように書いてください。 + +上記のような書き方をすると、cpprefjpではエラーになります。HTML エンティティを使わず、以下のように書いてください。 ``` ® From aacc4df55989bc9337150909a9bd8ab429312730 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 18 Nov 2024 19:07:23 +0900 Subject: [PATCH 1284/3948] =?UTF-8?q?Markdown=E3=81=AE=E5=88=B6=E9=99=90?= =?UTF-8?q?=20:=20=E3=80=8C=E3=82=B3=E3=83=BC=E3=83=89=E3=83=96=E3=83=AD?= =?UTF-8?q?=E3=83=83=E3=82=AF=E3=81=AE=E3=81=82=E3=81=A8=E3=81=AB=E7=A9=BA?= =?UTF-8?q?=E8=A1=8C=E3=81=8C=E5=BF=85=E8=A6=81=E3=81=AA=E5=88=B6=E9=99=90?= =?UTF-8?q?=E3=80=8D=E3=82=92=E8=BF=BD=E5=8A=A0=20#1362?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start_editing/markdown_cpprefjp.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/start_editing/markdown_cpprefjp.md b/start_editing/markdown_cpprefjp.md index c15f6e5630..9c5543c1a8 100644 --- a/start_editing/markdown_cpprefjp.md +++ b/start_editing/markdown_cpprefjp.md @@ -87,6 +87,9 @@ comment out text... * リスト2 ``` +### コードブロックのあとに空行が必要な制限 +後述する「プログラムの修飾に関する拡張」に関連して、コードブロックのあとに説明文章を書く際には空行をあけなければなりません。 + ## Markdown記法の拡張 From 5259ff6bc67ca8b95d5b9450555a4ca2de97a3ee Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 18 Nov 2024 19:25:35 +0900 Subject: [PATCH 1285/3948] =?UTF-8?q?unordered=5F{map,set}/*/insert=5Frang?= =?UTF-8?q?e:=20=E3=80=8C=E3=82=B3=E3=83=BC=E3=83=89=E3=83=96=E3=83=AD?= =?UTF-8?q?=E3=83=83=E3=82=AF=E3=81=AE=E3=81=82=E3=81=A8=E3=81=AB=E7=A9=BA?= =?UTF-8?q?=E8=A1=8C=E3=81=8C=E5=BF=85=E8=A6=81=E3=81=AA=E5=88=B6=E9=99=90?= =?UTF-8?q?=E3=80=8D=E3=81=AB=E7=BA=8F=E3=82=8F=E3=82=8B=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Related commits: c747f4a71f, aacc4df559 Reference: https://github.com/cpprefjp/site/issues/1362#issuecomment-2482124298 --- reference/unordered_map/unordered_map/insert_range.md | 1 + reference/unordered_map/unordered_multimap/insert_range.md | 1 + reference/unordered_set/unordered_multiset/insert_range.md | 1 + reference/unordered_set/unordered_set/insert_range.md | 1 + 4 files changed, 4 insertions(+) diff --git a/reference/unordered_map/unordered_map/insert_range.md b/reference/unordered_map/unordered_map/insert_range.md index 09141d2bc3..955631bfe9 100644 --- a/reference/unordered_map/unordered_map/insert_range.md +++ b/reference/unordered_map/unordered_map/insert_range.md @@ -63,6 +63,7 @@ C 12 B 11 A 10 ``` + 注:[`unordered_map`](/reference/unordered_map/unordered_map.md) は非順序連想コンテナであるため、出力順序は無意味であることに注意 diff --git a/reference/unordered_map/unordered_multimap/insert_range.md b/reference/unordered_map/unordered_multimap/insert_range.md index 922c6050e1..b63190f407 100644 --- a/reference/unordered_map/unordered_multimap/insert_range.md +++ b/reference/unordered_map/unordered_multimap/insert_range.md @@ -64,6 +64,7 @@ B 11 B 11 A 10 ``` + 注:[`unordered_multimap`](/reference/unordered_map/unordered_multimap.md) は非順序連想コンテナであるため、出力順序は無意味であることに注意 diff --git a/reference/unordered_set/unordered_multiset/insert_range.md b/reference/unordered_set/unordered_multiset/insert_range.md index f44f7a72f5..4a194ac8ba 100644 --- a/reference/unordered_set/unordered_multiset/insert_range.md +++ b/reference/unordered_set/unordered_multiset/insert_range.md @@ -61,6 +61,7 @@ int main () ``` 4 3 3 2 2 1 ``` + 注:[`unordered_multiset`](/reference/unordered_set/unordered_multiset.md) は非順序連想コンテナであるため、出力順序は無意味であることに注意 diff --git a/reference/unordered_set/unordered_set/insert_range.md b/reference/unordered_set/unordered_set/insert_range.md index eb1b80ecc4..a91d5a9e03 100644 --- a/reference/unordered_set/unordered_set/insert_range.md +++ b/reference/unordered_set/unordered_set/insert_range.md @@ -61,6 +61,7 @@ int main () ``` 4 3 2 1 ``` + 注:[`unordered_set`](/reference/unordered_set/unordered_set.md) は非順序連想コンテナであるため、出力順序は無意味であることに注意 From 4212149bfed3cf3d7fbe0e5431515aeac069712f Mon Sep 17 00:00:00 2001 From: suomesta Date: Wed, 20 Nov 2024 20:48:00 +0900 Subject: [PATCH 1286/3948] fix typo in samples --- reference/flat_map/flat_map/emplace.md | 2 +- reference/flat_map/flat_map/empty.md | 2 +- reference/flat_map/flat_map/op_compare_3way.md | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/flat_map/flat_map/emplace.md b/reference/flat_map/flat_map/emplace.md index 22f1df248d..155d95fdca 100644 --- a/reference/flat_map/flat_map/emplace.md +++ b/reference/flat_map/flat_map/emplace.md @@ -88,7 +88,7 @@ struct Point { int main() { - stdx::flat_map fm; + std::flat_map fm; fm.emplace(std::piecewise_construct, std::forward_as_tuple(3, 'C'), // キーの型std::stringのコンストラクタ引数を渡す diff --git a/reference/flat_map/flat_map/empty.md b/reference/flat_map/flat_map/empty.md index 74651c9352..3e1f3fe6db 100644 --- a/reference/flat_map/flat_map/empty.md +++ b/reference/flat_map/flat_map/empty.md @@ -31,7 +31,7 @@ int main () { - stdx::flat_map fm; + std::flat_map fm; std::cout << fm.empty() << std::endl; diff --git a/reference/flat_map/flat_map/op_compare_3way.md b/reference/flat_map/flat_map/op_compare_3way.md index 40c926b924..7223f7e551 100644 --- a/reference/flat_map/flat_map/op_compare_3way.md +++ b/reference/flat_map/flat_map/op_compare_3way.md @@ -50,13 +50,13 @@ return lexicographical_compare_three_way( int main() { - stdx::flat_map fm1 = { + std::flat_map fm1 = { {3, 'a'}, {1, 'b'}, {4, 'c'} }; - stdx::flat_map fm2 = { + std::flat_map fm2 = { {3, 'a'}, {1, 'b'}, }; From a3aa49f5a4693dd31b60de0f6744afd553928b80 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 27 Nov 2024 18:37:40 +0900 Subject: [PATCH 1287/3948] fix typo --- lang/cpp23.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp23.md b/lang/cpp23.md index 6119203283..904bb7b2b0 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -1,7 +1,7 @@ # C++23 ## 概要 -C++23とは、2020年中に改訂され、ISO/IEC 14882:2024で標準規格化されたC++バージョンの通称である。 +C++23とは、2023年中に改訂され、ISO/IEC 14882:2024で標準規格化されたC++バージョンの通称である。 このバージョンは、策定中のためC++2bと呼ばれることがある。「(C++20である2020年の次の) 202b年にリリースされる」という伏せ字として「b」が使われているが、3年周期に次のバージョンが策定されることが決まっているため、伏せ字になっている年数がずれることはない。 From a56fca8f11104ba4758d455184fa44884e43962d Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sun, 1 Dec 2024 15:05:42 +0900 Subject: [PATCH 1288/3948] =?UTF-8?q?2024=E5=B9=B4=E5=88=86=E3=81=AE?= =?UTF-8?q?=E8=B2=A2=E7=8C=AE=E3=83=9D=E3=82=A4=E3=83=B3=E3=83=88=E3=82=92?= =?UTF-8?q?=E9=9B=86=E8=A8=88=20(#1365)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start_editing.md | 36 +- start_editing/contribution_stats_2023.md | 754 +++++++++++------------ start_editing/contribution_stats_2024.md | 691 +++++++++++++++++++++ 3 files changed, 1094 insertions(+), 387 deletions(-) create mode 100644 start_editing/contribution_stats_2024.md diff --git a/start_editing.md b/start_editing.md index 7f60aa5113..94bbf58919 100644 --- a/start_editing.md +++ b/start_editing.md @@ -301,6 +301,10 @@ cpprefjpおよびboostjpでの作業は、以下のように貢献ポイント - [集計ツール](https://github.com/cpprefjp/stats_contribution)の開発 - 貢献ポイントの調整・ルール作り - `start_editing/contribution_stats_*.md`の編集 +4. スポンサーの追加・削除・修正 +5. 画像の追加・削除・修正 +6. 巻き戻した変更 (revert) +7. package-lock.jsonの更新 貢献ポイントの集計方法として、以下の注意事項があります @@ -309,6 +313,17 @@ cpprefjpおよびboostjpでの作業は、以下のように貢献ポイント - 複数の仕様変更による複数の修正の場合などはまとめない - 同ページ内に対する複数の修正は、大きい貢献ポイントにまとめる場合がある - リンク追加・修正を含む説明修正は、fixmやfixlなどにまとめる +- 共同コミット (Co-author) は全員に貢献ポイントがつくものとする + +貢献ポイントの集計対象となるリポジトリは以下です + +- +- +- +- +- +- +- ### cpprefjp @@ -320,10 +335,10 @@ cpprefjpおよびboostjpでの作業は、以下のように貢献ポイント | cpprefjp/addref | 20 | リファレンスを1ページ追加 | | cpprefjp/addlang | 20 | 言語機能を1ページ追加 | | cpprefjp/addpage | 20 | その他ページ追加 (articleや編集者向けページなど) | -| cpprefjp/fixs | 2 | 既存ページへの修正 : small 軽微な修正、コード修飾追加 (ページ単位) | -| cpprefjp/fixm | 5 | 既存ページへの修正 : medium 追加説明、サンプルコード追加、訳語追加 (ページ単位) | -| cpprefjp/fixl | 10 | 既存ページへの修正 : large 仕様変更への対応 (ページ単位) | -| cpprefjp/compiler | 2 | 動作確認できたコンパイラバージョンの記載。ライブラリ機能はページ単位、言語機能は件数単位 | +| cpprefjp/fixs | 2 | 既存ページへの修正 : small 軽微な修正、コード修飾追加 (ページ単位)、スクリプトによる一括修正 (スクリプトはtool系で別途評価) | +| cpprefjp/fixm | 5 | 既存ページへの修正 : medium 追加説明、サンプルコード追加、訳語追加 (訳語単位)、用語追加 (用語単位)。誤字・説明の言い換えの範囲を超える間違い修正。サンプルコードや仕様での変数名の間違い修正 (ページ単位) | +| cpprefjp/fixl | 10 | 既存ページへの修正 : large 仕様変更への対応。仕様記述のバグ修正。関連項目ではない関数一覧の表に関数を足すことも対象。実装例の追加 (ページ単位) | +| cpprefjp/compiler | 2 | 動作確認できたコンパイラバージョンの記載、および処理系のバージョン情報。ライブラリ機能はページ単位、言語機能は件数単位、処理系のバージョン情報は件数単位 | 機能追加での機能表への列の追加は、linkではなくfixlにあたる。 @@ -335,7 +350,7 @@ cpprefjpおよびboostjpでの作業は、以下のように貢献ポイント | boostjp/typo | 1 | 誤字・脱字の修正 (ページ単位) | | boostjp/link | 2 | 関連項目・参照リンクなどの追加・修正、nolinkの解除 (ページ単位) | | boostjp/releases | 5 | Boostリリースノート1件追加 small : maintenance workなどの軽微で小さなリリースノート | -| boostjp/releasem | 10 | Boostリリースノート 1件追加 medium : 10行以下の中程度の大きさ | +| boostjp/releasem | 10 | Boostリリースノート 1件追加 medium : タイトル含めず10行以下の中程度の大きさ。新ライブラリ。既知の問題 (ライブラリ単位) | | boostjp/releasel | 20 | Boostリリースノート 1件追加 large : mediumを超える大きさ | | boostjp/fixs | 2 | 既存ページへの修正 : small 軽微な修正、コード修飾追加 (ページ単位) | | boostjp/fixm | 5 | 既存ページへの修正 : medium 追加説明、訳語追加 (ページ単位) | @@ -349,18 +364,19 @@ CIスクリプト、site_generator、kunaiなど。 | タグ | ポイント | 説明 | |-----|---------|------| | tool/fixbug | 30 | バグ修正 | -| tool/improves | 10 | コード改善 : small | -| tool/improvem | 30 | コード改善 : medium | -| tool/improvem | 50 | コード改善 : large | -| tool/updatelib | 20 | 依存ライブラリのアップデート (直接使用のライブラリ単位) | +| tool/improves | 10 | コード改善 : small。typo検出テーブルへの追加 | +| tool/improvem | 30 | コード改善 : medium。git submodule / npm moduleのリリース作業 (package.jsonの更新) | +| tool/improvel | 50 | コード改善 : large | +| tool/updatelib | 20 | 外部依存ライブラリのアップデート (直接使用のライブラリ単位) | | tool/updatelang | 10 | 使用言語のアップデート : small (とくにコード変更なく更新できた) | | tool/updatelang | 30 | 使用言語のアップデート : medium (多少のコード修正で更新できた) | | tool/updatelang | 50 | 使用言語のアップデート : large (大きいまたはむずかしいコード修正をして更新できた) | | tool/adds | 30 | 新たな仕組みの導入 small : (C++バージョン追加、カテゴリ追加など) | | tool/addm | 50 | 新たな仕組みの導入 medium | -| tool/addl | 100〜 | 新たな仕組みの導入 large : キーワード自動リンク、相対リンク対応など | +| tool/addl | 100 | 新たな仕組みの導入 large : キーワード自動リンク、相対リンク対応など | ### 貢献ポイントの集計ページ - [2023年](start_editing/contribution_stats_2023.md) +- [2024年](start_editing/contribution_stats_2024.md) diff --git a/start_editing/contribution_stats_2023.md b/start_editing/contribution_stats_2023.md index d3986d7e32..beccbc0935 100644 --- a/start_editing/contribution_stats_2023.md +++ b/start_editing/contribution_stats_2023.md @@ -5,573 +5,573 @@ | コミット | タグ | 説明 | |----------|------|------| -| [41bca76](https://github.com/cpprefjp/site/commit/41bca76b22c72220203c7d2e369e6a76e9b645b2) | cpprefjp/typo:1 | `generator/begin`: fix typo | -| [bd48ead](https://github.com/cpprefjp/site/commit/bd48ead94b7324c18006cdcfe08aa8560cf1f303), [27f5df0](https://github.com/cpprefjp/site/commit/27f5df0eebfc593d6875f978aaab727648943559), [ab69dd](https://github.com/cpprefjp/site/commit/ab69dd554d5ea642a4ec6a2350760a6faf069039), [c6bde83](https://github.com/cpprefjp/site/commit/c6bde8363fb78d19713ad3e9b4cd2e4ceb0d48df), [5e25d82](https://github.com/cpprefjp/site/commit/5e25d82045a410286548f4cfb14542e78bec876d) | cpprefjp/addref:9, cpprefjp/fixs:1, cpprefjp/fixm:1, cpprefjp/link:1 | `generator/promise_type`のリファレンス作成 | -| [384970](https://github.com/cpprefjp/site/commit/384970b9c298f2b5ad0cf76502fbee6635386fc5) | cpprefjp/fixs:1 | cpp20/coroutines: 微調整 | -| [09c61f9](https://github.com/cpprefjp/site/commit/09c61f94ef2e5795801b131449073c34e47f4995) | cpprefjp/fixm:1 | `generator`: 例示コード拡充 | -| [66d4dc6](https://github.com/cpprefjp/site/commit/66d4dc66d3f2259e546b1f7bc5591cf53bb8cc2c) | cpprefjp/fixm:1, cpprefjp/fixs:1 | generator: クラスユーザ観点での説明追加 | -| [1f03563](https://github.com/cpprefjp/site/commit/1f03563fee051b3135a3dd7ea79f14bd01b37ad3) | cpprefjp/fixl:4 | `coroutine`: LWG3460を反映 | -| [f03abf8](https://github.com/cpprefjp/site/commit/f03abf873882732606460f6f65aaed739389d8d0) | cpprefjp/fixl:1 | `tuple/apply`: P2517R1対応 | -| [58e407c](https://github.com/cpprefjp/site/commit/58e407c377e144d14665e1825e9b208767c443cc) | cpprefjp/fixm:1 | `generator`: 概要説明を修正 | -| [a01dfab](https://github.com/cpprefjp/site/commit/a01dfab45ae2c0c89c3462ab6ebbccfaa25e2fdd), [b40b1a8](https://github.com/cpprefjp/site/commit/b40b1a83eab6a27b8ed6b09af38212277074c214) | cpprefjp/fixl:1 | utility/exchange: P2401R0対応 | -| [df3cf15](https://github.com/cpprefjp/site/commit/df3cf1576616ea59ff5b6f2e46c42aad9b88d734) | cpprefjp/fixl:3, cpprefjp/link:1 | C++20 : P0777R1対応 | -| [58fba8b](https://github.com/cpprefjp/site/commit/58fba8bb7d3df10b7d1e4052109ae27c22a472ed) | cpprefjp/fixl:2 | `basic_string/substr`: P2438R2対応 | -| [53c9bf6](https://github.com/cpprefjp/site/commit/53c9bf6cffc98cc92fb84cff4f378285cd8bd320) | cpprefjp/fixl:28 | `bitset`: P2417R2 `constexpr`化 | -| [4c86ef0](https://github.com/cpprefjp/site/commit/4c86ef0198c0d52a49f7716a658d20ab273c4d41) | cpprefjp/fixl:23 | `unique_ptr`: P2273R3 `constexpr`化 | -| [7435b8b](https://github.com/cpprefjp/site/commit/7435b8b5b5c5b7b909bbdecc643632204f3697c8) | cpprefjp/link:2 | ヘッダ一覧から``を削除し、将来のC++検討ページへ移動 | -| [1b669b1](https://github.com/cpprefjp/site/commit/1b669b142f7641f9d1239543ab39082ccb21dc26), [aa403df](https://github.com/cpprefjp/site/commit/aa403df17d9a20ce6fa2836861a09e45c43a466c), [da9f2c7](https://github.com/cpprefjp/site/commit/da9f2c769593d5d8b94ad15ed3291ab538c5f83f), [da68085](https://github.com/cpprefjp/site/commit/da6808523e7c9835d8383ecb2480e4368a26fccb) | cpprefjp/addref:1, cpprefjp/fixl:1, cpprefjp/link:1 | `utility/unreachable`: P0627R6対応 | -| [e8da7c3](https://github.com/cpprefjp/site/commit/e8da7c362f22a2d6def5f717d3315e4fd63e1ab1), [31f15af](https://github.com/cpprefjp/site/commit/31f15af518188c1ae9aefe351f3e9bb8ddfebf02) | cpprefjp/addlang:1, cpprefjp/link:4 | C++23 : P1774R8 `assume`属性 | -| [5823043](https://github.com/cpprefjp/site/commit/58230430ce1071207574b91002781b526ec6422b) | cpprefjp/fixl:8, cpprefjp/link:1 | C++23 : P2186R2 GCサポート削除 | -| [5a087a0](https://github.com/cpprefjp/site/commit/5a087a079fd97e1ea53e341313cb593e53b1db22), [30918b2](https://github.com/cpprefjp/site/commit/30918b2308ad1932317002a995220d96cd0038d5), [1f6c97c](https://github.com/cpprefjp/site/commit/1f6c97ce954e86960f296aa7d95ef14b33d587b4) | cpprefjp/addref:1, cpprefjp/fixl:1, cpprefjp/link:2 | `functional/invoke_r`: P2136R3対応 | -| [98315ac](https://github.com/cpprefjp/site/commit/98315ac5cd9d4b828401de81dc4d2c205bd9c37a), [bc4c31b](https://github.com/cpprefjp/site/commit/bc4c31bdfdeb6460a9043885d82911b660104194) | cpprefjp/addref:3, cpprefjp/fixl:1, cpprefjp/link:1 | `optional`: P0798R8 `and_then/transform/or_else`追加 | -| [ccc68e9](https://github.com/cpprefjp/site/commit/ccc68e9e6e5c615c4801914c5e7110b53ba4d80e) | cpprefjp/fixl:1 | `exception/rethrow_exception`: P1675P2対応 | -| [333f723](https://github.com/cpprefjp/site/commit/333f7233dc3a0e3aaa10ecce0fa8b2cbd1f46392) | cpprefjp/fixl:2 | `charconv`: P2291R3 `to_chars/from_chars` `constexpr`指定 | -| [382c5a5](https://github.com/cpprefjp/site/commit/382c5a58f43a993659b3fe8bb6816fc28f2bcddc) | cpprefjp/addref:6, cpprefjp/fixl:1, cpprefjp/fixm:1 | `memory`: P1132R8 `out_ptr_t`,`out_ptr`追加 | -| [bc11699](https://github.com/cpprefjp/site/commit/bc11699bac740b8042fd13a697e6a038deb8f881) | cpprefjp/link:1 | international-standard: fix N4928 link | -| [a7b1a5e](https://github.com/cpprefjp/site/commit/a7b1a5ea1f52af47efb9e60956446b86688271e5), [731e1ea](https://github.com/cpprefjp/site/commit/731e1ea31aaf0eb0022d342263e3d4b8c359e55a) | cpprefjp/addref:6, cpprefjp/link:2 | `memory`: P1132R8 `inout_ptr_t`,`inout_ptr`追加 | -| [7389f02](https://github.com/cpprefjp/site/commit/7389f02b53b3f36cb3a47e4caeb7da71239dd22d), [96e93fc](https://github.com/cpprefjp/site/commit/96e93fc28af2cb6f312a531638731b8bebdbcb90), [f853910](https://github.com/cpprefjp/site/commit/f85391077c46ea79afc2a1a5792bf3d7ac44b4e6), [01eb348](https://github.com/cpprefjp/site/commit/01eb3487685c392456dcec2c6bc85b06fcc5b8bf), [684d1f0](https://github.com/cpprefjp/site/commit/684d1f03ad7dfc7059d79909f078182c3bc58266), [63e429d](https://github.com/cpprefjp/site/commit/63e429d33d1a3e2f10ecbfe657d31a3c5b0eb41e), [1146719](https://github.com/cpprefjp/site/commit/114671911d63eb03ec0284ba4a1992d3b35e1a7a) | cpprefjp/addref:10, cpprefjp/fixl:1, cpprefjp/fixm:1, cpprefjp/link:1 | `functional`: P0288R9 `move_only_function`追加 | -| [7208b79](https://github.com/cpprefjp/site/commit/7208b792c3223ad04b126825da87d020f65e3861) | cpprefjp/fixm:1 | `generator`: 微調整 | -| [04e52ed](https://github.com/cpprefjp/site/commit/04e52ed81dd8ee331331170a6f67a548fc195e6b) | cpprefjp/fixm:1, cpprefjp/fixs:1 | 訳語表: "program-defiend type"を追加 | -| [0201450](https://github.com/cpprefjp/site/commit/020145072fe3f0b3552760fd3de229fc084fe5dc) | cpprefjp/fixm:2 | `span`,`basic_string_view`: P2251対応 | -| [e400d17](https://github.com/cpprefjp/site/commit/e400d17b65d9279c6b636cf00f8ac98964e3e5ce), [fd14d85](https://github.com/cpprefjp/site/commit/fd14d851b9dfadb7c82e398b0172f2c5ac379290), [f34854c](https://github.com/cpprefjp/site/commit/f34854cf613a91f73823e1270b3eee6bca9dac9b), [7e9e00d](https://github.com/cpprefjp/site/commit/7e9e00dcdfb90c4507302201a4b8a69b8dbab683), [724b29c](https://github.com/cpprefjp/site/commit/724b29c83cfdd8bddf4cdc1bb3c657b6c9e17d4c), [05643dc](https://github.com/cpprefjp/site/commit/05643dc9ac4efe0b623696764045ced26d6010b0), [68f67f8](https://github.com/cpprefjp/site/commit/68f67f8140eab1bc2c2e1c9af564314b587c8bce), [44e5111](https://github.com/cpprefjp/site/commit/44e51113a40fd217b00231ee404f8e42649a0666), [bc23c73](https://github.com/cpprefjp/site/commit/bc23c7365769749001533e451b3b02d8b53c3ee8), [b36c4ca](https://github.com/cpprefjp/site/commit/b36c4caa5ecd2acad1c374ef5553814b943de8b6), [c10f83d](https://github.com/cpprefjp/site/commit/c10f83df34e60c270db8b53c3699ce6348a7700e), [195bd06](https://github.com/cpprefjp/site/commit/195bd060727c2a7b967255fa8afb06d2d37c57d7), [b79bb56](https://github.com/cpprefjp/site/commit/b79bb56d63ecdfa3568ca85fa5568d1ecb355d53), [74c922f](https://github.com/cpprefjp/site/commit/74c922fff6904c42e88adb04f497dff5fa3088dc), [7a5214d](https://github.com/cpprefjp/site/commit/7a5214d449873dbd48f51bb2a022775430b6aa89), [c7fe7e2](https://github.com/cpprefjp/site/commit/c7fe7e269cffd85cbe741ba50482628f0840c716), [4d92044](https://github.com/cpprefjp/site/commit/4d920448512f40a8a9d1363b91491ab6b7dca3df), [996f8d3](https://github.com/cpprefjp/site/commit/996f8d3679187e3abf7240299e2609f33975c35d), [a97b34f](https://github.com/cpprefjp/site/commit/a97b34fc918f85ea6c1705856c12e04491d1b978), [dbb5c92](https://github.com/cpprefjp/site/commit/dbb5c926307857ac6baca67048ee5407893d7531), [7c00cbc](https://github.com/cpprefjp/site/commit/7c00cbcb2ff088824321a079167205680fb812b6), [d55ed2f](https://github.com/cpprefjp/site/commit/d55ed2f5f2abc2de1e69da1ed1f94cea6167738a), [31bdb1a](https://github.com/cpprefjp/site/commit/31bdb1a09601084f8113969e64a899383cc8e142), [a69e754](https://github.com/cpprefjp/site/commit/a69e754d6d013d030e477d95ed5bdc1432ea46e6), [da6efe1](https://github.com/cpprefjp/site/commit/da6efe1a08463c917c6d8dfa6fb453612c98d055), [1bcaedc](https://github.com/cpprefjp/site/commit/1bcaedc52902daf98f55025838c8ea628714af70) | cpprefjp/addref:53, cpprefjp/link:3 | `expected` | -| [8094e16](https://github.com/cpprefjp/site/commit/8094e1678b049e67ca0cc2d670aeac109dae4507) | cpprefjp/fixs:3 | 説明用のEXPLICITをitalic表記 | -| [915fa72](https://github.com/cpprefjp/site/commit/915fa727b6a2153ffa8550c38785a9a4d38b7cfb) | cpprefjp/fixs:57 | "see below"をitalic表記 | -| [8203fdd](https://github.com/cpprefjp/site/commit/8203fdd4e47fe92368e78d40c7821cb1d6bae2b9) | cpprefjp/link:1 | fix external link | -| [d60c9f1](https://github.com/cpprefjp/site/commit/d60c9f129df80b94cff1668f159c5eaf6c9f0420) | cpprefjp/fixm:1 | algorithm: ヘッダ冒頭説明を区分整理 | -| [5415e29](https://github.com/cpprefjp/site/commit/5415e29dfd912b953b8249e2d1b51dd18f57c4b5), [16cab03](https://github.com/cpprefjp/site/commit/16cab03355668b5b677440ac2a954a3d72817aa2), [bc842ec](https://github.com/cpprefjp/site/commit/bc842eccb3ea7ec2195a7d339994b4d9af21d4ea) | cpprefjp/fixm:1 | functional/hash: 透過的ハッシュ/等値比較の例示コードを改善 | -| [910ec8f](https://github.com/cpprefjp/site/commit/910ec8ffb3fc83359cb2515e37f3230fd992090b) | cpprefjp/fixm:1 | ディレクトリ構造: クラス階層expected/expected.void特例を明記 | -| [9fc8d74](https://github.com/cpprefjp/site/commit/9fc8d7418c4c64c443038637e34578e7a9428c4c), [58d9a1f](https://github.com/cpprefjp/site/commit/58d9a1f1730cb69791cd6e5262f424123a867941) | cpprefjp/fixm:1 | cmath/remquo: 関数の利用目的を追記 | -| [d68f5d6](https://github.com/cpprefjp/site/commit/d68f5d6cfdd62eb332354aa14196e11fd4097c54) | cpprefjp/fixl:1 | `string_view`: LWG2791 `hash`特殊化ハッシュ計算は`string`と等価 | -| [496bf9c](https://github.com/cpprefjp/site/commit/496bf9cbdced56bf08284bc1b984977a18136cee) | cpprefjp/fixm:1 | functional/hash: 説明増補 | -| [54c7748](https://github.com/cpprefjp/site/commit/54c77480d6285273fddf16893c874817017ce004) | cpprefjp/fixl:1 | barrier: P2588R3対応 | -| [f594598](https://github.com/cpprefjp/site/commit/f5945989373e78031eef9ece3dc5ccdf13dfb41d) | cpprefjp/fixm:1 | `is_layout_compatible`: fix typo, update example | -| [4476acb](https://github.com/cpprefjp/site/commit/4476acb905f114be0c9850595fc37a7fa486617a) | cpprefjp/fixl:6 | P2614R2対応 | -| [f016e5b](https://github.com/cpprefjp/site/commit/f016e5bd22ff018f840da9de5698acce5d6e993e) | cpprefjp/fixl:1 | generator: P2787R1対応 | -| [05d6b67](https://github.com/cpprefjp/site/commit/05d6b67e43a136c1b3146e1d6560d50870270188) | cpprefjp/fixl:3 | P1413R2 -> P1413R3 | -| [066971a](https://github.com/cpprefjp/site/commit/066971a8538f6c7d522967cb1c65cad8d1b355e3) | cpprefjp/fixl:1 | `span`/`dynamic_extent`: P2116R0対応 | -| [03ff589](https://github.com/cpprefjp/site/commit/03ff5892fe0aa4fb8b8bdcdbba77fec13360c9de) | cpprefjp/typo:1 | `type_traits`/`is_pod`: fix typo | -| [38b9677](https://github.com/cpprefjp/site/commit/38b9677ca78a674160acc8f3c1d792c25b530c9f) | cpprefjp/fixl:2 | C++26 P2734R0対応 | -| [6e62fb1](https://github.com/cpprefjp/site/commit/6e62fb11896097dd937e50dadfbb80b72e5522ff) | cpprefjp/addref:1, cpprefjp/fixl:1, cpprefjp/link:1 | `ranges`: `from_range`タグ | -| [2873c6f](https://github.com/cpprefjp/site/commit/2873c6f3ce31b51a2c42f50a932ee09a005cc7c5) | cpprefjp/fixl:4 | LWG2510対応 | -| [6df7cab](https://github.com/cpprefjp/site/commit/6df7cab6190236bae3307f74ca259ff29892eea4) | cpprefjp/addref:10, cpprefjp/fixl:2, cpprefjp/link:1 | P2548R6 `copyable_function` | +| [commit cpprefjp/site, 41bca76] | cpprefjp/typo:1 | `generator/begin`: fix typo | +| [commit cpprefjp/site, bd48ead, 27f5df0, ab69dd5, c6bde83, 5e25d82] | cpprefjp/addref:9, cpprefjp/fixs:1, cpprefjp/fixm:1, cpprefjp/link:1 | `generator/promise_type`のリファレンス作成 | +| [commit cpprefjp/site, 384970b] | cpprefjp/fixs:1 | cpp20/coroutines: 微調整 | +| [commit cpprefjp/site, 09c61f9] | cpprefjp/fixm:1 | `generator`: 例示コード拡充 | +| [commit cpprefjp/site, 66d4dc6] | cpprefjp/fixm:1, cpprefjp/fixs:1 | generator: クラスユーザ観点での説明追加 | +| [commit cpprefjp/site, 1f03563] | cpprefjp/fixl:4 | `coroutine`: LWG3460を反映 | +| [commit cpprefjp/site, f03abf8] | cpprefjp/fixl:1 | `tuple/apply`: P2517R1対応 | +| [commit cpprefjp/site, 58e407c] | cpprefjp/fixm:1 | `generator`: 概要説明を修正 | +| [commit cpprefjp/site, a01dfab, b40b1a8] | cpprefjp/fixl:1 | utility/exchange: P2401R0対応 | +| [commit cpprefjp/site, df3cf15] | cpprefjp/fixl:3, cpprefjp/link:1 | C++20 : P0777R1対応 | +| [commit cpprefjp/site, 58fba8b] | cpprefjp/fixl:2 | `basic_string/substr`: P2438R2対応 | +| [commit cpprefjp/site, 53c9bf6] | cpprefjp/fixl:28 | `bitset`: P2417R2 `constexpr`化 | +| [commit cpprefjp/site, 4c86ef0] | cpprefjp/fixl:23 | `unique_ptr`: P2273R3 `constexpr`化 | +| [commit cpprefjp/site, 7435b8b] | cpprefjp/link:2 | ヘッダ一覧から``を削除し、将来のC++検討ページへ移動 | +| [commit cpprefjp/site, 1b669b1, aa403df, da9f2c7, da68085] | cpprefjp/addref:1, cpprefjp/fixl:1, cpprefjp/link:1 | `utility/unreachable`: P0627R6対応 | +| [commit cpprefjp/site, e8da7c3, 31f15af] | cpprefjp/addlang:1, cpprefjp/link:4 | C++23 : P1774R8 `assume`属性 | +| [commit cpprefjp/site, 5823043] | cpprefjp/fixl:8, cpprefjp/link:1 | C++23 : P2186R2 GCサポート削除 | +| [commit cpprefjp/site, 5a087a0, 30918b2, 1f6c97c] | cpprefjp/addref:1, cpprefjp/fixl:1, cpprefjp/link:2 | `functional/invoke_r`: P2136R3対応 | +| [commit cpprefjp/site, 98315ac, bc4c31b] | cpprefjp/addref:3, cpprefjp/fixl:1, cpprefjp/link:1 | `optional`: P0798R8 `and_then/transform/or_else`追加 | +| [commit cpprefjp/site, ccc68e9] | cpprefjp/fixl:1 | `exception/rethrow_exception`: P1675P2対応 | +| [commit cpprefjp/site, 333f723] | cpprefjp/fixl:2 | `charconv`: P2291R3 `to_chars/from_chars` `constexpr`指定 | +| [commit cpprefjp/site, 382c5a5] | cpprefjp/addref:6, cpprefjp/fixl:1, cpprefjp/fixm:1 | `memory`: P1132R8 `out_ptr_t`,`out_ptr`追加 | +| [commit cpprefjp/site, bc11699] | cpprefjp/link:1 | international-standard: fix N4928 link | +| [commit cpprefjp/site, a7b1a5e, 731e1ea] | cpprefjp/addref:6, cpprefjp/link:2 | `memory`: P1132R8 `inout_ptr_t`,`inout_ptr`追加 | +| [commit cpprefjp/site, 7389f02, 96e93fc, f853910, 01eb348, 684d1f0, 63e429d, 1146719] | cpprefjp/addref:10, cpprefjp/fixl:1, cpprefjp/fixm:1, cpprefjp/link:1 | `functional`: P0288R9 `move_only_function`追加 | +| [commit cpprefjp/site, 7208b79] | cpprefjp/fixm:1 | `generator`: 微調整 | +| [commit cpprefjp/site, 04e52ed] | cpprefjp/fixm:1, cpprefjp/fixs:1 | 訳語表: "program-defiend type"を追加 | +| [commit cpprefjp/site, 0201450] | cpprefjp/fixm:2 | `span`,`basic_string_view`: P2251対応 | +| [commit cpprefjp/site, e400d17, fd14d85, f34854c, 7e9e00d, 724b29c, 05643dc, 68f67f8, 44e5111, bc23c73, b36c4ca, c10f83d, 195bd06, b79bb56, 74c922f, 7a5214d, c7fe7e2, 4d92044, 996f8d3, a97b34f, dbb5c92, 7c00cbc, d55ed2f, 31bdb1a, a69e754, da6efe1, 1bcaedc] | cpprefjp/addref:53, cpprefjp/link:3 | `expected` | +| [commit cpprefjp/site, 8094e16] | cpprefjp/fixs:3 | 説明用のEXPLICITをitalic表記 | +| [commit cpprefjp/site, 915fa72] | cpprefjp/fixs:57 | "see below"をitalic表記 | +| [commit cpprefjp/site, 8203fdd] | cpprefjp/link:1 | fix external link | +| [commit cpprefjp/site, d60c9f1] | cpprefjp/fixm:1 | algorithm: ヘッダ冒頭説明を区分整理 | +| [commit cpprefjp/site, 5415e29, 16cab03, bc842ec] | cpprefjp/fixm:1 | functional/hash: 透過的ハッシュ/等値比較の例示コードを改善 | +| [commit cpprefjp/site, 910ec8f] | cpprefjp/fixm:1 | ディレクトリ構造: クラス階層expected/expected.void特例を明記 | +| [commit cpprefjp/site, 9fc8d74, 58d9a1f] | cpprefjp/fixm:1 | cmath/remquo: 関数の利用目的を追記 | +| [commit cpprefjp/site, d68f5d6] | cpprefjp/fixl:1 | `string_view`: LWG2791 `hash`特殊化ハッシュ計算は`string`と等価 | +| [commit cpprefjp/site, 496bf9c] | cpprefjp/fixm:1 | functional/hash: 説明増補 | +| [commit cpprefjp/site, 54c7748] | cpprefjp/fixl:1 | barrier: P2588R3対応 | +| [commit cpprefjp/site, f594598] | cpprefjp/fixm:1 | `is_layout_compatible`: fix typo, update example | +| [commit cpprefjp/site, 4476acb] | cpprefjp/fixl:6 | P2614R2対応 | +| [commit cpprefjp/site, f016e5b] | cpprefjp/fixl:1 | generator: P2787R1対応 | +| [commit cpprefjp/site, 05d6b67] | cpprefjp/fixl:3 | P1413R2 -> P1413R3 | +| [commit cpprefjp/site, 066971a] | cpprefjp/fixl:1 | `span`/`dynamic_extent`: P2116R0対応 | +| [commit cpprefjp/site, 03ff589] | cpprefjp/typo:1 | `type_traits`/`is_pod`: fix typo | +| [commit cpprefjp/site, 38b9677] | cpprefjp/fixl:2 | C++26 P2734R0対応 | +| [commit cpprefjp/site, 6e62fb1] | cpprefjp/addref:1, cpprefjp/fixl:1, cpprefjp/link:1 | `ranges`: `from_range`タグ | +| [commit cpprefjp/site, 2873c6f] | cpprefjp/fixl:4 | LWG2510対応 | +| [commit cpprefjp/site, 6df7cab] | cpprefjp/addref:10, cpprefjp/fixl:2, cpprefjp/link:1 | P2548R6 `copyable_function` | ## [faithandbrave](https://github.com/faithandbrave) | コミット | タグ | 説明 | |----------|------|------| -| [994ee06](https://github.com/cpprefjp/site/commit/994ee06cd34292af65978d9bda7a228b3c4ed340) | cpprefjp/fixm:1 | C++23 : `byteswap`への言及を追加 | -| [651153b](https://github.com/cpprefjp/site/commit/651153bde66e9de6f15ba010d25884d5788eb96e) | cpprefjp/fixm:1 | C++17 インライン変数 : 異なる型でインライン指定してはならないことはすでに仕様として書いてあったので、例示という形で無名クラスオブジェクトの解説をするよう修正 | -| [2f771c9](https://github.com/cpprefjp/site/commit/2f771c9f5e2d693949cf280f03e7001203f86488) | cpprefjp/fixl:1 | コンパイラの実装状況 : C++23の機能を一通り記載 | -| [27f6bb3](https://github.com/cpprefjp/site/commit/27f6bb3a7462e02e3f090d9991404439cf888230) | cpprefjp/addlang:1, cpprefjp/link:1 | C++14 : 「宣言時のメンバ初期化を持つ型の集成体初期化を許可」を追加 | -| [bd3ccc8](https://github.com/cpprefjp/site/commit/bd3ccc893f5ab8270ec7f91462c626ef7a791474) | cpprefjp/link:1 | C++11 非静的メンバ変数の初期化 : 「C++14 宣言時のメンバ初期化を持つ型の集成体初期化を許可」へのリンクを追加 | -| [602ea13](https://github.com/cpprefjp/site/commit/602ea13f1e58408a6dbc9f7fd73e1bd281dc9ef2), [198a5b0](https://github.com/cpprefjp/site/commit/198a5b061b43c5599cc0ccec8b25c8c9789cedd9) | cpprefjp/addlang:1, cpprefjp/link:4 | C++20 : 「暗黙のラムダキャプチャを簡略化」を追加 | -| [b66903a](https://github.com/cpprefjp/site/commit/b66903af7aae0c27ac7f4bf5ea730cb11c731609) | cpprefjp/typo:1 | apply : fix typo | -| [a73f34d](https://github.com/cpprefjp/site/commit/a73f34d4e7f371a8d311d7c539471422fbeebc90) | cpprefjp/fixm:1 | apply : オーバーロードに番号をつけた | -| [85bebb5](https://github.com/cpprefjp/site/commit/85bebb584efb6141b4026ff231e7630aba3f4f27) | cpprefjp/fixs:18 | 編集者向け資料をリネームし、「cpprefjpを編集するには」をサイドバーに表示 | -| [eb4b7dd](https://github.com/cpprefjp/site/commit/eb4b7dd0cd8950815bd93ecb18fb56478d3c3879) | cpprefjp/fixs:1 | リンク修正 | -| [654c879](https://github.com/cpprefjp/site/commit/654c8795c2b0930f0f841f1fa227acd0b922733f) | cpprefjp/addlang:1, cpprefjp/link:2 | C++20 : 「デフォルトのコピーコンストラクタと非constなコンストラクタが衝突する問題を修正」を追加 | -| [2114ad7](https://github.com/cpprefjp/site/commit/2114ad7ea10a62fe8f32acaf49af047fe6996a1f), [d7ebdf4](https://github.com/cpprefjp/site/commit/d7ebdf4d7158da1a8b24fb289bfdf1256a86e654) | cpprefjp/addlang:1, cpprefjp/link:2 | C++20 : 「抽象型のチェック」を追加 | -| [3918a50](https://github.com/cpprefjp/site/commit/3918a5059050dd68afaf130f76fb2f345105f576), [172d284](https://github.com/cpprefjp/site/commit/172d284725939b57df8a53fc1c6d6927cc546bf7) | cpprefjp/fixm:2 | CONTRIBUTINGとstart_editingが重複していたので整理 | -| [03178a7](https://github.com/cpprefjp/site/commit/03178a714b1bb037194554a0ce91395cd3536e16) | cpprefjp/fixm:1 | C++23 : `std::format`のRange、タプルの出力を例示 | -| [a0a65d9](https://github.com/cpprefjp/site/commit/a0a65d950381e8c5c246de5f9dead685aba7db4e) | tool/fixbug:1, cpprefjp/fixm:3 | 拡張子ミスのような不正な内部リンクが検出されていなかったのを修正 | -| [9769a26](https://github.com/cpprefjp/site/commit/9769a2621a0cc735b6a3eacbc0ca487bbbaf361d), [6110d2a](https://github.com/cpprefjp/site/commit/6110d2acd09265649b59d92bce37988f9bb6c491) | cpprefjp/addref:1, cpprefjp/link:1 | `` : `formattable`を追加 | -| [8ba4402](https://github.com/cpprefjp/site/commit/8ba4402df9b92a45ccca16558fc3e504d97cff28) | cpprefjp/fixl:1 | 国際標準規格 : C++23のWorking Draftを更新 | -| [0818b72](https://github.com/cpprefjp/site/commit/0818b7295acfa3a6ddad86c8331655f9cc8c2d25) | cpprefjp/fixl:2 | C++23 : 言語機能としてN4929のEditor's Reportで採択されたものを記載 | -| [1e4b73b](https://github.com/cpprefjp/site/commit/1e4b73b5da23e978ded1e96d3e12dfa8cb2746ff) | cpprefjp/fixl:1 | `format` : デバッグ指定と、C++23向けサンプルコードを追加 | -| [30fc8df](https://github.com/cpprefjp/site/commit/30fc8dfa3b393e0d82cb47e01f87483cdc6abe38) | cpprefjp/fixl:1 | `format` : Rangeとtuple-typeの書式仕様を追加 | -| [07a5186](https://github.com/cpprefjp/site/commit/07a5186b1aa5dd5a0862eb8d36f0dca5b51d8cf8) | cpprefjp/fixs:1 | `format` : 見出しとして別な用途で「例」があると混乱するので、リネーム | -| [44c43e1](https://github.com/cpprefjp/site/commit/44c43e183739ddba0b62ede3da2f5e5d4d9a38fe) | cpprefjp/fixm:1, cpprefjp/fixs:3 | `hexfloat` : GCCで入力での使用にバグがあることを記載 | -| [2497046](https://github.com/cpprefjp/site/commit/2497046e4f89beeaffa4c0f7f3a014c4b6560e0e) | cpprefjp/fixm:1 | `format` : Rangeの要素に対する書式指定の例を記載 | -| [1a3edd0](https://github.com/cpprefjp/site/commit/1a3edd0c8bebb22b99068fcdd45d4f2efb52c312) | cpprefjp/link:16 | `std::tuple`をグローバル修飾リストに追加 | -| [dd2fa16](https://github.com/cpprefjp/site/commit/dd2fa16c526d237459f87e1b6b2511545779968d) | cpprefjp/fixm:1 | `format` : Rangeのデバッグ出力を解除する例を記載 | -| [c73a954](https://github.com/cpprefjp/site/commit/c73a9543b5fc9445921fd23c14b862129e8d21d3) | cpprefjp/fixm:1 | `format` : `vector>`の書式指定の例を追加 | -| [dc3a27e](https://github.com/cpprefjp/site/commit/dc3a27eda45160ff1b3cd68f5ad67915805fd0c5), [7f6f300](https://github.com/cpprefjp/site/commit/7f6f300c6b989362ef158ca6852f3feb7577e901), [61cbf01](https://github.com/cpprefjp/site/commit/61cbf011ad1acf7aecc4eab5853ea65edb6a4e80) | cpprefjp/addref:2, cpprefjp/fixl:1, cpprefjp/link:39 | `` : `range_format`と`format_kind`を追加 | -| [5388006](https://github.com/cpprefjp/site/commit/53880060961c5a4400ef61ee610bd6077224c070) | cpprefjp/fixl:1 | `formatter` : C++23仕様に対応し、サンプルコードのコンパイルエラーを修正 (`const`が抜けてた) | -| [c5c2b70](https://github.com/cpprefjp/site/commit/c5c2b70b56b6b6f805049ca80c7772d432bfc408) | cpprefjp/fixm:1 | 編集タスクを、start_editing.mdの下の方に記載した | -| [c7b073e](https://github.com/cpprefjp/site/commit/c7b073edbaacae8d096596221e3f4b25f6c98362), [ccd76f6](https://github.com/cpprefjp/site/commit/ccd76f630e9cb46d570698a709ff442b58f98c78) | cpprefjp/addref:1, cpprefjp/link:2 | `formatter` : `parse`を追加 | -| [a7b952b](https://github.com/cpprefjp/site/commit/a7b952b5dd1ab45c869dc554cdfa89b9eabfd1ae), [e13f4b9](https://github.com/cpprefjp/site/commit/e13f4b9b603c641a2612512aa5b414bbd873dd44), [4b80aa7](https://github.com/cpprefjp/site/commit/4b80aa7366b63eb7ae96c0be2d2c355a056437ec) | cpprefjp/addpage:1, cpprefjp/link:1 | ディレクトリ構造のドキュメントを追加 | -| [6d599ab](https://github.com/cpprefjp/site/commit/6d599abc0f83e6e4fbbda70230a5604e4887d17d) | cpprefjp/fixm:1 | `formatter` : `format`メンバ関数は`const`でなければならない | -| [410c572](https://github.com/cpprefjp/site/commit/410c5724eb943491f7efda14612ede8075ef839d) | cpprefjp/addref:3, cpprefjp/fixm:2 | `basic_format_context` : `out`, `advance_to`, `locale`を追加 | -| [322f877](https://github.com/cpprefjp/site/commit/322f877cba64aafc0fe6e828f93455ddfaa8ecb8) | cpprefjp/fixm:1, cpprefjp/fixs:1 | `formatter` : `parse`を実装する例を記載 | -| [ad99718](https://github.com/cpprefjp/site/commit/ad997184e5177e545acd5a3b7410cc48451fc5cb), [d1ac632](https://github.com/cpprefjp/site/commit/d1ac632cff8ca15c520099a205d3039e6b7111c1) | cpprefjp/addref:3, cpprefjp/link:4 | `basic_format_parse_context`: `begin`, `end`, `advance_to`を追加 | -| [3269f7f](https://github.com/cpprefjp/site/commit/3269f7f3c99ee899ad037629c023ff4edb7577a0) | cpprefjp/addref:4, cpprefjp/link:3 | `formatter` : `format`, `set_brackets`, `set_separator`, `set_debug_format`を追加 | -| [93bd53e](https://github.com/cpprefjp/site/commit/93bd53edf4fda360fdc78d36d80cbbe94036c3b5) | cpprefjp/fixs:1 | `formatter` : コード修飾を追加 | -| [f3d46e1](https://github.com/cpprefjp/site/commit/f3d46e161ef521b57aeb7cc2b254859daedae89f), [1b70d49](https://github.com/cpprefjp/site/commit/1b70d4969c37657769dcef952082534252dba460), [258f393](https://github.com/cpprefjp/site/commit/258f393aeb27077ec21225cc177df1722c7529e5), [373f49d](https://github.com/cpprefjp/site/commit/373f49da92fb9c34115279a210f29067b6259e35), [74662b4](https://github.com/cpprefjp/site/commit/74662b472ba0ca06ab99ac08ed74a3d2e8669584) | cpprefjp/addref:6, cpprefjp/link:1 | `` : `range_formatter`を追加 | -| [1971c4d](https://github.com/cpprefjp/site/commit/1971c4d9bd39ce1da8ac77597daca3298cb2e3d4) | cpprefjp/addref:2, cpprefjp/fixl:5 | `` : コンテナアダプタの文字列フォーマットに対応 | -| [2513346](https://github.com/cpprefjp/site/commit/2513346aaefb6f93d4740367084d9f30d30a05aa) | cpprefjp/addref:1, cpprefjp/fixm:1, cpprefjp/link:2 | `` : `range-default-formatter`を追加 | -| [f216f9f](https://github.com/cpprefjp/site/commit/f216f9febdb4ded06f2ad999933927d694b52765), [b2de7ca](https://github.com/cpprefjp/site/commit/b2de7cae247187b6cacc107f68aa0afec3c7ef0c) | cpprefjp/fixl:1, cpprefjp/fixm:1, cpprefjp/link:1 | `vector::reference`に対する`formatter`の特殊化を追加 | -| [4f16a60](https://github.com/cpprefjp/site/commit/4f16a60c92c925396a78baf6e08f22a3450ff652), [469297f](https://github.com/cpprefjp/site/commit/469297fa7a5b27cdd4c4eca4b637a576ee496734), [a235d11](https://github.com/cpprefjp/site/commit/a235d11124e9da535c0af2a90407538d283fb260), [dfae477](https://github.com/cpprefjp/site/commit/dfae47736e42e6bf4603692f494e00540d05e3de), [e388ca6](https://github.com/cpprefjp/site/commit/e388ca69c6b456116a9cda79e221a8df66454bd2), [0bd721d](https://github.com/cpprefjp/site/commit/0bd721d4509759a70a2f56a2e6f7b77f99df7eaf), [88c0244](https://github.com/cpprefjp/site/commit/88c024464a199aa995fdfc422f9d4c4da216c048), [bc47b38](https://github.com/cpprefjp/site/commit/bc47b38c8e7d7a4e56a6783240de300d0d5cac84), [a689c6b](https://github.com/cpprefjp/site/commit/a689c6b126c827101cda6035cb83100609953f65) | cpprefjp/addref:9, cpprefjp/fixl:1, cpprefjp/fixm:1, cpprefjp/link:3 | ``ヘッダ | -| [83d5357](https://github.com/cpprefjp/site/commit/83d53575d897b0bcdc6c5963ea22fd18ec855755) | cpprefjp/fixs:3 | `optional::and_then`, `or_else` : コード修飾を追加 | -| [6d029cb](https://github.com/cpprefjp/site/commit/6d029cb18ead0f2abc706638978bc258ef4e5ea1) | cpprefjp/fixs:1 | `expected` : コード修飾を追加 | -| [33fb996](https://github.com/cpprefjp/site/commit/33fb9968149fffc0fd360aeee22c1bce32238a55) | cpprefjp/fixs:1 | detect forbidden characters CIの説明を記載 | -| [524b256](https://github.com/cpprefjp/site/commit/524b25681551c84589da6a080fda499b38a859aa) | cpprefjp/fixm:1 | start_editing : GitHub Actionsの各タスクについての説明を記載 | -| [f770ec5](https://github.com/cpprefjp/site/commit/f770ec54101b867e1347bbe1c0352c3056c649a4), [6a2ea7c](https://github.com/cpprefjp/site/commit/6a2ea7cae4b614ea47552d81e31eeae5b35c9b03) | cpprefjp/addref:3, cpprefjp/fixl:2, cpprefjp/link:7 | `` : `basic_format_string`クラスを追加 | -| [9ad08e0](https://github.com/cpprefjp/site/commit/9ad08e064c4e949c87fbd7ec33534903de1f4d76) | cpprefjp/fixm:1 | `format` : ログ出力の例を追加 | -| [9140852](https://github.com/cpprefjp/site/commit/9140852ca87b0d97fe82e630ad5fe65f876f0f0c) | cpprefjp/fixs:1 | `format` : 段落ミスを修正 | -| [6b38026](https://github.com/cpprefjp/site/commit/6b380267a5dc836d9adf22c2e2fb983f02ca2ce4), [6048252](https://github.com/cpprefjp/site/commit/604825206be7c23d8379e547c24893fa88319f1c) | tool/addm:2, cpprefjp/fixs:199, cpprefjp/link:1 | コード修飾の誤り検出CIを追加 | -| [0709184](https://github.com/cpprefjp/site/commit/0709184c1cbe9f034e42efc9ec3cd272972b2192) | tool/improves:1 | 外部リンクチェック : microsoft.com を無視リストに登録 | -| [a26647a](https://github.com/cpprefjp/site/commit/a26647ae2a5f030130be55e76162716598002d6c), [d3cb083](https://github.com/cpprefjp/site/commit/d3cb0839fde2f6b6534b5ba13db0c0c045804d9d), [eaf722b](https://github.com/cpprefjp/site/commit/eaf722b020984fde1abdb2b50c1f39d8863ecb1b), [182e098](https://github.com/cpprefjp/site/commit/182e098dccc8482b0d0965ebd32f76dd01406bdb), [019f15e](https://github.com/cpprefjp/site/commit/019f15edfc2908d7d6678f7199696635dc2a7e92), [be98598](https://github.com/cpprefjp/site/commit/be98598467b9fc65906070c8edfd69ea1f243601), [5419582](https://github.com/cpprefjp/site/commit/5419582e559fd5c88d719564587a9ca714844e5d) | cpprefjp/fixl:37 | ``の`constexpr`対応 | -| [ba05560](https://github.com/cpprefjp/site/commit/ba05560fb997bdded15d10da0863ffb56166bee0) | cpprefjp/fixs:11 | 返り値、返値 : 訳語表に基づいて「戻り値」に修正 | -| [ace1860](https://github.com/cpprefjp/site/commit/ace1860c41772f23dc20e50b11b68c5890c2d430), [0567ba8](https://github.com/cpprefjp/site/commit/0567ba866215221944f3f808e33f23700c92f9cf) | cpprefjp/fixl:53 | `` : 拡張浮動小数点数型への対応 | -| [2d01c56](https://github.com/cpprefjp/site/commit/2d01c561c9be61f02c5bac8113902099b2289481) | cpprefjp/addref:1, cpprefjp/fixs:1, cpprefjp/link:2 | `` : `abs`を追加 | -| [72d23cc](https://github.com/cpprefjp/site/commit/72d23cc651cdd53f0277d10e15bb9b26f0f66155) | cpprefjp/addref:4, cpprefjp/link:1 | `` : `div`を追加 | -| [afa0dc5](https://github.com/cpprefjp/site/commit/afa0dc58b54968ec198a87a995138eefa3c092c1), [dcbf835](https://github.com/cpprefjp/site/commit/dcbf835672a941482bd4eab44a9cdb713eabba2b), [b137272](https://github.com/cpprefjp/site/commit/b137272314df5cdd51f680abdcd931840dc9fee1), [f39c3c3](https://github.com/cpprefjp/site/commit/f39c3c31a7de0c74a6ad80fc8776d2022ac064e3), [85010fb](https://github.com/cpprefjp/site/commit/85010fbf2610dd0ecf5616502c609d70839d02b3), [b986d8c](https://github.com/cpprefjp/site/commit/b986d8c2578971123909748683f72e599ac081ac), [24071c4](https://github.com/cpprefjp/site/commit/24071c41d16fb31699da953fada78eadf9769d12), [828ff58](https://github.com/cpprefjp/site/commit/828ff5889a64f24eec0a5c14efcdb4b4abe0cdc7) | cpprefjp/addref:6, cpprefjp/link:3, cpprefjp/fixl:4, cpprefjp/fixm:2 | `` | -| [3607e5a](https://github.com/cpprefjp/site/commit/3607e5ab6eb5bf25b32929dc2426d78672ab5e9f) | cpprefjp/fixl:1, cpprefjp/link:4 | `numeric_limits::is_iec559` : C++23対応 |a -| [f5a4bdc](https://github.com/cpprefjp/site/commit/f5a4bdcc87ea89099b2112d27cb67ca68af26546) | cpprefjp/fixl:9 | `complex` : C++23の拡張浮動小数点数型に対応 | -| [d00a2e8](https://github.com/cpprefjp/site/commit/d00a2e8f0da78ce5910d58817306a2a05e2f97ba) | cpprefjp/fixs:1 | 不要なコード修飾を削除 | -| [bd6e8a6](https://github.com/cpprefjp/site/commit/bd6e8a6d96268e8405ad83cb1d8c61fd9e0c3e68) | tool/addm:1 | buildジョブを最新以外キャンセルするよう修正 | -| [f447758](https://github.com/cpprefjp/site/commit/f447758159921653e9e3346942620c9c7bf074b8) | cpprefjp/fixl:1 | `from_chars` : 拡張浮動小数点数型に対応 | -| [985d49c](https://github.com/cpprefjp/site/commit/985d49c758e7d255f694e0357e289c7484c47cf8) | cpprefjp/fixl:1 | `to_chars` : 拡張浮動小数点数型に対応 | -| [d9d21a6](https://github.com/cpprefjp/site/commit/d9d21a6ae8197fd8f3b2f068b597574fc67bf450), [a49ab65](https://github.com/cpprefjp/site/commit/a49ab655988d97d3a3f88babe5c609af7a3588d0), [9fe59f7](https://github.com/cpprefjp/site/commit/9fe59f7c3a1b97adef5bc273c0ab9f81f8b085a7), [3ecf9ca](https://github.com/cpprefjp/site/commit/3ecf9caed67da356223be078b0707556c9226e2c), [82cec00](https://github.com/cpprefjp/site/commit/82cec00a8113857dd68414dc45d1b4803cf83a74), [0ce85f3](https://github.com/cpprefjp/site/commit/0ce85f3d6aa5f19188d506288f7f3101ee3313c3), [9d64bb3](https://github.com/cpprefjp/site/commit/9d64bb3992e4f626b57dc749cb4fc05e36dad532), [566457e](https://github.com/cpprefjp/site/commit/566457ebc95a9e0329610ff0e31f8e4a5d445323), [5e04103](https://github.com/cpprefjp/site/commit/5e0410386479b6cbb938010164128996c2f18876), [e87272b](https://github.com/cpprefjp/site/commit/e87272b9c0f629393dfa20826eca548e99628237), [1fe5eb3](https://github.com/cpprefjp/site/commit/1fe5eb30dfd9a30854f2c1a13ddfaeb7fe5f9eed), [c84d47b](https://github.com/cpprefjp/site/commit/c84d47b429f528700f37e1ba4d22f8b7e5bfdd61), [a43bd16](https://github.com/cpprefjp/site/commit/a43bd165f7c77b915000e79e11396d825ec7b0bd), [c5c7b5a](https://github.com/cpprefjp/site/commit/c5c7b5ad8893c03a788f1f80a0ecd5e1480d12d0), [fb3b50d](https://github.com/cpprefjp/site/commit/fb3b50d2c8403fb9fa47e9941441f8fe686094a2), [9430b41](https://github.com/cpprefjp/site/commit/9430b41593e773a191064eff80815532a0629be0), [d6e40dd](https://github.com/cpprefjp/site/commit/d6e40dd1f3f328b9f1e2d3ba3fd06a068eee1d2d), [d91c1da](https://github.com/cpprefjp/site/commit/d91c1da0f13281d896a93c82e69da2b0f8eb611b), [19decb2](https://github.com/cpprefjp/site/commit/19decb254a0a081db7d7047d2405ac1ae5b8a066), [95fb484](https://github.com/cpprefjp/site/commit/95fb484cfa67d9ff9c25e7fb3b53876e24abc206), [9403580](https://github.com/cpprefjp/site/commit/94035802f33d93439e33cd6b437f097d11ff402f), [ff098b7](https://github.com/cpprefjp/site/commit/ff098b7d447c0a2f43b975706bdbdfd457da3c9e), [31bf54b](https://github.com/cpprefjp/site/commit/31bf54bd4fb47c87772bc62b636047089f5176d9), [83dd89c](https://github.com/cpprefjp/site/commit/83dd89cb38bbc23df68cf8b6372ea0a7010a2385), [fb295e5](https://github.com/cpprefjp/site/commit/fb295e5dead94487ffcc86042b541ab62e3cb068), [0376f47](https://github.com/cpprefjp/site/commit/0376f471268c8f124984b4911a40bf6dec84eefc), [2ba5e13](https://github.com/cpprefjp/site/commit/2ba5e134badc55935bde36761d61ced7bc9dcd68), [2c9f635](https://github.com/cpprefjp/site/commit/2c9f635eff6128691a72fb7312df6fe1f69deb8e), [c9cf59d](https://github.com/cpprefjp/site/commit/c9cf59db4c0ab7b178340eef2d8f9c5799e5220c), [5674bf7](https://github.com/cpprefjp/site/commit/5674bf7cffb19f6e4c99d61e786dabb7ccfb5106), [0b73645](https://github.com/cpprefjp/site/commit/0b736455a3af08ad8f820288134a5935e0cb513d), [0c072b9](https://github.com/cpprefjp/site/commit/0c072b9d3b702aad4920422e2fbb042c2e291019), [1e33730](https://github.com/cpprefjp/site/commit/1e3373055cb45f236e09607348f156090c597335), [f3f7503](https://github.com/cpprefjp/site/commit/f3f750307c2fa2056d04f01ad79cc0e75236a054), [292f841](https://github.com/cpprefjp/site/commit/292f841f9c90af75b5804ce5481dc23e6f93580a), [3547182](https://github.com/cpprefjp/site/commit/3547182922866d554e5e9e681ffdc2bb81c6503f), [db7801c](https://github.com/cpprefjp/site/commit/db7801c0f24a2e644d58d77981fb7767bfc88d38), [cd883d1](https://github.com/cpprefjp/site/commit/cd883d1560a5608d4f3d2df4dec093706a84c305), [d210ea7](https://github.com/cpprefjp/site/commit/d210ea7ae2005bc551bb475f8f29e3d2eb36458d), [7f2cc9c](https://github.com/cpprefjp/site/commit/7f2cc9c03b4d65c0b81a0e9106ce065c74a017ea), [430fad2](https://github.com/cpprefjp/site/commit/430fad23a6692db0c8d608f465732ec3ac1db083), [842cacb](https://github.com/cpprefjp/site/commit/842cacbb7d3c6d5da2c4f25ab7c829b50571c8a7) | cpprefjp/addref:37, cpprefjp/fixl:1, cpprefjp/fixm:8, cpprefjp/link:7 | `` | -| [b30e6fd](https://github.com/cpprefjp/site/commit/b30e6fd541461db3e42e8e62566af794628077fa) | cpprefjp/fixm:1 | Clang 16でC++17がデフォルトになった | -| [5ae96e7](https://github.com/cpprefjp/site/commit/5ae96e7b57f2e93aafb913a4c658faa229325091), [163df86](https://github.com/cpprefjp/site/commit/163df869ce0e8c97cb11c2c13363578a0801dc78) | cpprefjp/fixm:1 | トップページに、スポンサーシップについて掲載 | -| [ec2e4d0](https://github.com/cpprefjp/site/commit/ec2e4d073819ab587b8697b938e3935a06ba00e7), [f578c30](https://github.com/cpprefjp/site/commit/f578c301efb8a61c8315cba9d085440e6847028b), [ee14b2a](https://github.com/cpprefjp/site/commit/ee14b2abd0629a65e1a1c7439e153d882bd4dda0), [b42afef](https://github.com/cpprefjp/site/commit/b42afef66438a15b6676484c6ec372f2a3d67482), [6c6acb8](https://github.com/cpprefjp/site/commit/6c6acb89e820b695525a06025bb4b2f028604482) | cpprefjp/fixm:1 | トップページ : Acerola Software社様のロゴを表示 | -| [51b9443](https://github.com/cpprefjp/site/commit/51b9443a4f04cbe929cd6d839db6bbc8c08d5097) | cpprefjp/fixm:1 | トップページ : Fixstars社様のロゴを表示 | -| [15e87df](https://github.com/cpprefjp/site/commit/15e87dfd566db42845f47158e941032b9e0a2de0) | cpprefjp/typo:1 | (multi)map, (multi)set : s/const pointer/const_pointer/ | -| [5f8fea3](https://github.com/cpprefjp/site/commit/5f8fea3398580638ca88fe270ac92b789e6e48bc) | cpprefjp/fixm:1 | クラスの雛形ページ : Hidden Friendsの記載例を追加 | -| [8627239](https://github.com/cpprefjp/site/commit/8627239dd8cf584e55541ecf4754bcaa8f746780) | cpprefjp/fixm:1 | 国際標準規格 : C++23の規格案を更新 | -| [0f55a96](https://github.com/cpprefjp/site/commit/0f55a9625276f145d0ea372275df2e829a978782) | cpprefjp/link:1 | テンプレート再帰回数の記事がリンク切れしていたのでアーカイブに差し替え | -| [e852199](https://github.com/cpprefjp/site/commit/e85219905c26037593496a3fe1622160c27f5620), [6566493](https://github.com/cpprefjp/site/commit/656649355ce2bda2f629f12880e239fed254e520), [138872a](https://github.com/cpprefjp/site/commit/138872afcc7aaedb1d76a21314c5a49a5b915967) | cpprefjp/fixl:1 | C++23 : N4945での主要な変更を反映 | -| [058df35](https://github.com/cpprefjp/site/commit/058df357fc5857506ee46f8fc179485c0ee759ec), [4f1dfeb](https://github.com/cpprefjp/site/commit/4f1dfeb02c7ba96c0fb0f83fb56afbd02290369a), [8916ccb](https://github.com/cpprefjp/site/commit/8916ccbfcfaa9500e668b826335fa483e77d1151) | tool/addm:2, cpprefjp/typo:4, cpprefjp/link:1 | NGワードのチェックCIを追加 | -| [8a3b779](https://github.com/cpprefjp/site/commit/8a3b7791e2aa4768757706b8294ff698bbc3233f) | tool/improves:1, cpprefjp/typo:1 | 移譲->委譲 を追加 | -| [b7b6270](https://github.com/cpprefjp/site/commit/b7b62702f56341a53ba6f218fbb01661e966a284) | cpprefjp/fixs:1 | `map::operator[ ]` : オーバーロードに言語バージョンの書き忘れ | -| [1702da3](https://github.com/cpprefjp/site/commit/1702da3257cf6123abd2378255bd48554eb4a1bf) | cpprefjp/fixm:4 | (multi)set|mapのfind : 透過的な検索の仕様をひな形に合わせた | -| [131af88](https://github.com/cpprefjp/site/commit/131af885ebb460f4f285099152718fafd5e31fbd), [555a222](https://github.com/cpprefjp/site/commit/555a222083f8300ca63b94d0f019c7f8e0415df1) | cpprefjp/fixm:1 | vaporoid様のスポンサーロゴを追加 | -| [a6f4987](https://github.com/cpprefjp/site/commit/a6f4987bf6e5fc792246606aa37c263b065b25ab), [db4695b](https://github.com/cpprefjp/site/commit/db4695bbdc990ec369d8ca97b7ddeb40431e58d4), [e5f31cd](https://github.com/cpprefjp/site/commit/e5f31cd4413e1e2156289e5d5ad28c4c8f703735), [76502a5](https://github.com/cpprefjp/site/commit/76502a5485982eeb21315b415a8a3bec5da8a929), [0bbeedb](https://github.com/cpprefjp/site/commit/0bbeedbb56fd825f21ead503b0edf8f47875d4f3) | cpprefjp/fixm:1 | 新たなスポンサーを追加 | -| [8d47b62](https://github.com/cpprefjp/site/commit/8d47b625a8d21ac5de2c8b5feeb04ff2b8470793) | cpprefjp/fixm:1 | スポンサーを追加 | -| [ca45417](https://github.com/cpprefjp/site/commit/ca4541705729e6b4d06cc8cf660a39dc70dc7a79), [1e49d46](https://github.com/cpprefjp/site/commit/1e49d46de2000efe530efba043c9daa973786916) | cpprefjp/fixm:1 | スポンサー追加 | -| [50fa390](https://github.com/cpprefjp/site/commit/50fa3907fce6fc13f715b89d4e0ad79c55e91dc6), [394355b](https://github.com/cpprefjp/site/commit/394355bbef55ac255bb459691f4ccfb8c671ecfb) | cpprefjp/fixm:1 | スポンサー追加 | -| [c019c0e](https://github.com/cpprefjp/site/commit/c019c0e36bbd4830536eeb9cb79fc6f039c9e9b9) | cpprefjp/typo:1 | `borrowed_range` : `span`の要素は文字列ではなく`int` | -| [aaff7b5](https://github.com/cpprefjp/site/commit/aaff7b5d32b068cc6cd74ea24f9fb1b25f437a5c) | cpprefjp/fixm:2 | (multi)map : emptyの言語バージョンがC++11になっていたのを修正 | -| [309d0ed](https://github.com/cpprefjp/site/commit/309d0ed04619e888f7d063ef314f6852c8575a41) | cpprefjp/fixm:1 | 規格草案を更新 | -| [dc8afeb](https://github.com/cpprefjp/site/commit/dc8afeb80e6ddd381b69bc2183821e7147e07465), [86be6a9](https://github.com/cpprefjp/site/commit/86be6a9acac38fb842a093948e9ee02679a267eb) | cpprefjp/fixm:1 | スポンサー更新 | -| [8794a91](https://github.com/cpprefjp/site/commit/8794a91852bd41ca1ca6aec28e304d2279c366cf) | cpprefjp/typo:1 | generator : クラス定義のセミコロン忘れを修正 | -| [1007613](https://github.com/cpprefjp/site/commit/1007613676069369e0090ad3305b504e2e83815c) | cpprefjp/fixm:1 | 関数の雛形ページ : 非推奨・削除の書き方が記載されていなかった | -| [6b1443d](https://github.com/cpprefjp/site/commit/6b1443d2ddd576603a80d4c6b321941d86ab42ed) | cpprefjp/fixm:3 | `has_denorm(_loss)` : 非推奨の詳細を記載 | -| [5ae2c39](https://github.com/cpprefjp/site/commit/5ae2c39abd2fa04018b5ee8add2a054c25079f4c) | tool/improves:1, cpprefjp/typo:3 | NGワードとしてpvalue (prvalueのtypo) を追加 | -| [0f3743e](https://github.com/cpprefjp/site/commit/0f3743e212c0c612150466f8fec1babd509c7a6f) | cpprefjp/fixl:1 | C++20 : `shared_ptr`のアトミック操作が非推奨になったことを記載 | -| [8f3626e](https://github.com/cpprefjp/site/commit/8f3626e2afa6c227bc9170774fd7b72e87d3c7c8) | cpprefjp/fixm:36 | `set`/`map`の`begin`/`end`系 : ほかのコンテナに合わせて文章を整理 | -| [5af768a](https://github.com/cpprefjp/site/commit/5af768ad072b6415b1ed2d271af3f11270eaf5da) | cpprefjp/link:3 | C++20 `constinit` : `mutex`/`unique_ptr`のコンストラクタと相互リンク | -| [587bd5b](https://github.com/cpprefjp/site/commit/587bd5b265057b6b9f69895cf8c98d6c37bdd483), [ae7c515](https://github.com/cpprefjp/site/commit/ae7c515da20425de6c80b7b4336ec49ba8d7f0c6), [6251e4a](https://github.com/cpprefjp/site/commit/6251e4abe9d90fab42621ba97fea3a0b4a3c94aa), [a6c9e22](https://github.com/cpprefjp/site/commit/a6c9e227b387d2aa8631acc1df6f78468d690702), [717658d](https://github.com/cpprefjp/site/commit/717658da25868f54091bc273aaff7f7c5e46e02b), [e7ee1d9](https://github.com/cpprefjp/site/commit/e7ee1d999620147a6423c73b2992803bf7185a50), [c170374](https://github.com/cpprefjp/site/commit/c170374a913b9dbd4dceb07dbfa4eeba5489ed24) | cpprefjp/fixm:4 | `map`/`set`の`erase`に存在しないキーを指定した場合の動作 | -| [6eaa82d](https://github.com/cpprefjp/site/commit/6eaa82d487e3c732fa17de04e4bf624125036174) | cpprefjp/fixl:4 | `map` / `set`の`extract` : C++23でのheterogeneousなオーバーロードを追加 | -| [a5c1257](https://github.com/cpprefjp/site/commit/a5c12573bef144e8af06888137c3e8401abcca49) | cpprefjp/link:1 | ワイブル分布の参考文献をWeb Archiveに差し替え | -| [2dd6e26](https://github.com/cpprefjp/site/commit/2dd6e26bcbdb1a1faebd702ca4e0be505acb9668) | cpprefjp/fixm:1 | `map::insert` : `P&&`と`value_type&&`は両方存在するのでオーバーロード番号を分け、概要文章を追加 | -| [21d60b4](https://github.com/cpprefjp/site/commit/21d60b4cf25bad0eeb02c8fc48169f6aca8a8b08) | cpprefjp/fixm:1 | `map::insert_or_assign` : オーバーロードの概要文章を追加 | -| [176e5a6](https://github.com/cpprefjp/site/commit/176e5a6c507f0297020a9ce423ff3fe6f78827f3) | cpprefjp/fixm:3 | `map::lower_bound`, `upper_bound`, `equal_range` : オーバーロード概要とリンクを整理 | -| [209d36b](https://github.com/cpprefjp/site/commit/209d36b8491f92ecfde0a8ef69fbed90c840e937) | cpprefjp/fixm:1 | スポンサー更新 | -| [a2837c4](https://github.com/cpprefjp/site/commit/a2837c4112998a57257d08838c7e4412876c5826) | cpprefjp/link:1 | `is_constant_evaluated` : C++23 `if consteval`へのリンクを追加 | -| [42414ad](https://github.com/cpprefjp/site/commit/42414ad076addfa1b2a17d0e398a0351564de153) | tool/improves:1 | NGワードにgreator (greaterのtypo) を追加 | -| [1cededd](https://github.com/cpprefjp/site/commit/1cededd37b7dd98fca189186a275eefa2a985e50) | cpprefjp/link:1 | `error_condition` : `HRESULT`の解説ページをarchiveに差し替え | -| [92b8e34](https://github.com/cpprefjp/site/commit/92b8e34df0b16f484f679c267a2557de0b55b85c) | cpprefjp/fixm:1 | Clang : C++26のオプションを記載 | -| [ef3c242](https://github.com/cpprefjp/site/commit/ef3c242bd0a2f3794e8903dd6e7d40c953f9e492) | cpprefjp/fixm:1 | Clang : c++23オプションを追加 | -| [8e71d07](https://github.com/cpprefjp/site/commit/8e71d07c591b70c86e2687b1e6522c4d6965773d) | tool/improves:1 | NGワードチェック : `std::range::` → `std::ranges::` を追加 | -| [7e78a7d](https://github.com/cpprefjp/site/commit/7e78a7d13f1c32def0d08a23db6404a8d19b48e1) | cpprefjp/fixl:1 | 国際標準規格 : C++26を追加 | -| [13b0cf9](https://github.com/cpprefjp/site/commit/13b0cf9df87de6e5f426f9f689d72aace5046a38), [7ae71bb](https://github.com/cpprefjp/site/commit/7ae71bb8a7e87f2373c9950a66d727a5675d841f), [db656f4](https://github.com/cpprefjp/site/commit/db656f46efdf12f6877e27170eadc50e18be3c31) | cpprefjp/fixl:1 | C++26 : 言語機能を追加 | -| [bd9f4a4](https://github.com/cpprefjp/site/commit/bd9f4a42d0497ec4d0348017e7740b5daecae870) | cpprefjp/fixm:1 | トップページ : 問い合わせ窓口のGoogle Groupと銀行振込について記載 | -| [5ad48c7](https://github.com/cpprefjp/site/commit/5ad48c7f23557d030b8b9e88439b74c41611bd80) | cpprefjp/fixl:1 | コンパイラの実装状況 : C++26を追加 | -| [bf03828](https://github.com/cpprefjp/site/commit/bf038286f8ff72920a7765766c3cc74740d86588) | cpprefjp/fixm:1 | `any` : クラスページに型の要件を記載 | -| [1300401](https://github.com/cpprefjp/site/commit/13004010008e80b9e91f3584b0e14614096036c1) | cpprefjp/fixm:2 | `multiset`, `multimap`の`erase` : 同じキーを持つ要素数を計算量に入れた | -| [4f5d507](https://github.com/cpprefjp/site/commit/4f5d507d4e9830fee411f6f621b25ba1fc70cdb3) | cpprefjp/fixm:1 | `from_range_t` : 所属ヘッダが間違っていた | -| [d73d6be](https://github.com/cpprefjp/site/commit/d73d6be0b8b2381f19ce1ae66b0ae531fd77edca), [1b2e850](https://github.com/cpprefjp/site/commit/1b2e850c3d3eab21e2aeb35bc54f7708a7ef3ffe) | tool/addm:2, cpprefjp/fixm:1 | 所属ヘッダの指定ミスを検出するCIタスクを追加 | -| [f5119ae](https://github.com/cpprefjp/site/commit/f5119aed607afe31d105286502ccfce060a13e4a) | cpprefjp/fixl:1 | 国際標準規格 : Working Draftを更新 | -| [8d43599](https://github.com/cpprefjp/site/commit/8d4359938373b6a481ddeb171825ec0127682158) | | 貢献ポイントと分配方法についてまとめた | -| [3b8a415](https://github.com/cpprefjp/site/commit/3b8a4156369a6cb647a2c3fe17fee4d7a2e06332) | | 貢献ポイント : Open Collectiveでの経費申請の仕方を記載 | -| [da9fc6a](https://github.com/cpprefjp/site/commit/da9fc6ae8541971d8adc926c20f51b9e1b0b284b) | | 貢献ポイント : マージされずクローズされたPR、マージされずオープンなままのPRについて記載 | -| [4dfdb3a](https://github.com/cpprefjp/site/commit/4dfdb3a577c6cfa2c9b7c43839366712329bb910), [3104eb3](https://github.com/cpprefjp/site/commit/3104eb39826b9c90875dc20d2cef6c7b740c6dc5), [7326dd7](https://github.com/cpprefjp/site/commit/7326dd761e713c932f0305362d68613be3340927), [2ef44e2](https://github.com/cpprefjp/site/commit/2ef44e29a79b6c542a3b6754448f6402ae4c7cd4), [8cb09b8](https://github.com/cpprefjp/site/commit/8cb09b84f248a585697f837c9b5ff0609b785f20), [11b8c7e](https://github.com/cpprefjp/site/commit/11b8c7e10869d33b4464e73bdd5804ab70fcc9e8) | cpprefjp/fixm:1 | index : 時雨堂さまのロゴとリンクを掲載 | -| [cefc9fa](https://github.com/cpprefjp/site/commit/cefc9fa40e2d3fdd850fb2feffbf02cdb53b890f), [2c6589b](https://github.com/boostjp/site/commit/2c6589b1ff15d330b6027f4b3ea686002c97ba7b) | tool/fixbug:2 | buildアクション : Pythonを3.11に固定 (3.12でエラーがでた) | -| [6345a65](https://github.com/cpprefjp/site_generator/commit/6345a65aa1f15af1da6442509953a204b781125c) | tool/improvem:1 | Google Analytics GA4を設定 | -| [9b8dc0d](https://github.com/cpprefjp/kunai_config/commit/9b8dc0d6cc1a42edd7a819bd9f7af4ab5e006014), [91b3abb](https://github.com/cpprefjp/kunai_config/commit/91b3abb7cd35b79c140f1c3202ce150a6d56fcbc), [b375504](https://github.com/cpprefjp/kunai/commit/b375504f32f02eab6b14908435446f988f680055) | tool/improvem:1 | 編集者向け資料をリネーム | -| [9b1cdc2](https://github.com/cpprefjp/kunai_config/commit/9b1cdc2b2e7828e5e0bf46f6092917f1955e7315), [863b2d6](https://github.com/cpprefjp/kunai/commit/863b2d65fad1e754aff403bdb5e6b2701d807eeb), [bdccb2d](https://github.com/cpprefjp/kunai/commit/bdccb2d78751e71d97260f0d63a7d506bb85375f) | tool/adds:1 | 編集方針を追加 | -| [b7b8513](https://github.com/cpprefjp/kunai/commit/b7b85133a519e0f595701fa32e07f34155270b86) | tool/improves:1 | 画像の最大幅を設定 | -| [b206bad](https://github.com/cpprefjp/kunai/commit/b206badf8c9324ad381bf7809870a39a3052fbe5) | tool/improves:1 | codeタグ中の末尾スペースが消えてしまっていた問題を修正 | -| [368ecfc](https://github.com/boostjp/site/commit/368ecfc3cdbfea89419afc4349eb2632c78959f6), [075dd40](https://github.com/boostjp/site/commit/075dd4033e19289d15efa1fd8443247bcb910df7), [aa9e52b](https://github.com/boostjp/site/commit/aa9e52b68b1ff53cdaef9f1af0313874db953d6e), [c8d6259](https://github.com/boostjp/site/commit/c8d6259622539c4d8f662cfd15ee06b3abc2cdfb), [5d2c514](https://github.com/boostjp/site/commit/5d2c51488b95dc9e9752d85cd92c9912ef06e29c), [d813d6a](https://github.com/boostjp/site/commit/d813d6a315f149d2887ea842bb53604460fe8809) | boostjp/releasel:8, boostjp/releasem:19, boostjp/releases:1, boostjp/link:1 | 1.82.0リリースノート | -| [0bb4c21](https://github.com/boostjp/site/commit/0bb4c21338d28e2128d31aceca8b72597796d3c8), [34205bb](https://github.com/boostjp/site/commit/34205bb35cb0dc5c7e102c2aabfcaf8ef74ec92b), [403bc7b](https://github.com/boostjp/site/commit/403bc7b71df825a1fe8dff8795af3fd8d8876939), [cd1c5f8](https://github.com/boostjp/site/commit/cd1c5f8af25a2930ad82a1f083edbc072d4a26d9) | boostjp/releasel:4, boostjp/releasem:25, boostjp/releases:1, boostjp/link:1 | 1.83.0リリースノート | -| [bf70875](https://github.com/cpprefjp/site/commit/bf7087596d7f1334739ba264246d1b48baa184ae) | | 貢献ポイント : 集計中に必要となった貢献ポイントの項目を追加 | -| [f67a9f4](https://github.com/cpprefjp/site/commit/f67a9f4eb93b58343def06bba1dea17fd92a88cd) | | 2023年1月分の貢献ポイントをまとめた | -| [d9fb324](https://github.com/cpprefjp/site/commit/d9fb324b3d8c92c892f455b3901476c0d12a6de0) | | 貢献ポイント: Boostへの貢献は追跡しきれないのでやめた | -| [cc884d3](https://github.com/cpprefjp/site/commit/cc884d396da7dbcbc3da81e5eb72d5aa07319702) | | 貢献ポイント2023: 不正なタグを修正 | -| [4e048eb](https://github.com/cpprefjp/site/commit/4e048eb4e84314b1bbf25dc24834ded95bbe0e1c) | | 貢献ポイント : 2023/02のコントリビュートをまとめた | -| [0ceca8e](https://github.com/cpprefjp/site/commit/0ceca8ec9cd6c4f940efdc1da5899e65ae1769e2) | | 貢献ポイント : コンパイラ動作確認を言語機能とライブラリ機能で集計方法を分けた | -| [3faf5c1](https://github.com/cpprefjp/site/commit/3faf5c1a5046050bbdb3d981aadf1973afb4d4c1) | | 貢献ポイント : 2023/03のコントリビュートをまとめた | -| [7215f9e](https://github.com/cpprefjp/site/commit/7215f9ead299ef527fbb0c46da0adac3ecd8c71a) | | 貢献ポイント : 2023/04のコントリビュートを追加 | -| [e5991d8](https://github.com/cpprefjp/site/commit/e5991d81a6559beeaae08b186eb53342b68da699) | | NGワードチェック : 編集者向けドキュメントは対象外にした | -| [192494c](https://github.com/cpprefjp/site/commit/192494cb43d76c61eb31c84f0dec6b8d44e7f134) | | 貢献ポイント : 2023/05のコントリビュートを追加 | -| [cbed1c0](https://github.com/cpprefjp/site/commit/cbed1c090d88c47a37c504acfe0586ecfa0a57fb) | | 貢献ポイント : 2023/06のコントリビュートを追加 | -| [e3bd67b](https://github.com/cpprefjp/site/commit/e3bd67b0ecfa59e386f273eb5864025ec3270d76) | | 貢献ポイント: 2023/07のコントリビュートを追加 | -| [065f221](https://github.com/cpprefjp/site/commit/065f221b742620cdcb6db011deb401004c2896f9) | | 貢献ポイント : 集計作業を除外 | -| [94f157b](https://github.com/cpprefjp/site/commit/94f157bb931d012571810d9131ae086d4019301a) | | 貢献ポイント : 2023/08のコントリビュートを追加 | -| [142e7b6](https://github.com/cpprefjp/site/commit/142e7b6c519d541d0a028d68a09b691872aa7725) | | 貢献ポイント : 2023/09のコントリビュートを追加 | -| [d7ebe95](https://github.com/cpprefjp/site/commit/d7ebe95214a3ad01c4911770f970b4099cc25c4c) | | 貢献ポイント : 2023/10のコントリビュートを追加 | -| [217669c](https://github.com/cpprefjp/site/commit/217669cf06e0ac6b4e4bc3058cf3871da48d7630) | cpprefjp/fixl:4 | `unordered_map` / `set`の`erase` : `erase(iterator)`のオーバーロードを追加 | -| [bfc992c](https://github.com/cpprefjp/site/commit/bfc992c17fd341827ea3a1842c2ee193ad60f608) | | 貢献ポイント : cpprefjp/site以外のコミットを追加 | -| [f9a0fdd](https://github.com/cpprefjp/site/commit/f9a0fdd70a42ec9b262b93cc8796d9e5f1b802b0) | tool/improves:1, cpprefjp/typo:2 | NGワードチェック : "型](link)型"をNGワードに登録 | -| [118d5b9](https://github.com/cpprefjp/site/commit/118d5b9ebee27d1a04c52bf9c0bfdadd7f940b37) | tool/improves:1, cpprefjp/typo:1 | tuple/apply : Gitのコンフリクトコメントを削除 | -| [cc748a6](https://github.com/cpprefjp/site/commit/cc748a66a57065cd020e019f780845390e3026f8) | cpprefjp/fixm:1 | スポンサー更新 | -| [2c21229](https://github.com/cpprefjp/site/commit/2c212294315aec84f90a1540a7a39ae621c5c073) | cpprefjp/fixs:1 | `ios_base` : コード修飾を追加 | -| [e30c3ae](https://github.com/cpprefjp/site/commit/e30c3ae988aed71a6df562fd71062079949a1d4e) | cpprefjp/fixl:1 | `ios_base::openmode` : C++23対応として`noreplace`フラグを追加 | -| [d408c51](https://github.com/cpprefjp/site/commit/d408c51c96e78e8af3ab4accc880fee05791d87d) | cpprefjp/fixm:1 | トップページ : シルバースポンサー以上はissueに採用情報を投稿できる特典を追加 | -| [b17670d](https://github.com/cpprefjp/site/commit/b17670dea79e6d26f1caa2f5c0252f9a8621439f) | cpprefjp/fixm:2 | `ostream`の`print`と`println` : `cerr`とかは`iostream`で定義される | -| [e6d487c](https://github.com/cpprefjp/site/commit/e6d487c105ddd04d243c2932832bede7fe66d1cc) | cpprefjp/typo:1 | `print`/`vprint_unicode` : ですます調になっていたところを修正 | -| [519f8a7](https://github.com/cpprefjp/site/commit/519f8a74927665b47e085f2cda66522126058cb7) | cpprefjp/link:2 | `to_chars` / `from_chars` : コード修飾を追加 | -| [d7ec01f](https://github.com/boostjp/site/commit/d7ec01ffb8f080b9143f16c06a4ee437d4e91a46), [5153ad7](https://github.com/boostjp/site/commit/5153ad74e84dc6ddd921fd13fcef5acdb731fce6), [e9ebe52](https://github.com/boostjp/site/commit/e9ebe52d33bb0a8fca76ec53cb62950d4b7ef21c) | boostjp/releases:13, boostjp/releasem:24, boostjp/releasel:2, boostjp/link:1 | 1.84.0 : リリースノートを追加 | -| [4df3220](https://github.com/cpprefjp/site/commit/4df32209e7f4396c02262c96a7ab94d9c8246c18) | | 貢献ポイント : ユーザー名をリンクにした | +| [commit cpprefjp/site, 994ee06] | cpprefjp/fixm:1 | C++23 : `byteswap`への言及を追加 | +| [commit cpprefjp/site, 651153b] | cpprefjp/fixm:1 | C++17 インライン変数 : 異なる型でインライン指定してはならないことはすでに仕様として書いてあったので、例示という形で無名クラスオブジェクトの解説をするよう修正 | +| [commit cpprefjp/site, 2f771c9] | cpprefjp/fixl:1 | コンパイラの実装状況 : C++23の機能を一通り記載 | +| [commit cpprefjp/site, 27f6bb3] | cpprefjp/addlang:1, cpprefjp/link:1 | C++14 : 「宣言時のメンバ初期化を持つ型の集成体初期化を許可」を追加 | +| [commit cpprefjp/site, bd3ccc8] | cpprefjp/link:1 | C++11 非静的メンバ変数の初期化 : 「C++14 宣言時のメンバ初期化を持つ型の集成体初期化を許可」へのリンクを追加 | +| [commit cpprefjp/site, 602ea13, 198a5b0] | cpprefjp/addlang:1, cpprefjp/link:4 | C++20 : 「暗黙のラムダキャプチャを簡略化」を追加 | +| [commit cpprefjp/site, b66903a] | cpprefjp/typo:1 | apply : fix typo | +| [commit cpprefjp/site, a73f34d] | cpprefjp/fixm:1 | apply : オーバーロードに番号をつけた | +| [commit cpprefjp/site, 85bebb5] | cpprefjp/fixs:18 | 編集者向け資料をリネームし、「cpprefjpを編集するには」をサイドバーに表示 | +| [commit cpprefjp/site, eb4b7dd] | cpprefjp/fixs:1 | リンク修正 | +| [commit cpprefjp/site, 654c879] | cpprefjp/addlang:1, cpprefjp/link:2 | C++20 : 「デフォルトのコピーコンストラクタと非constなコンストラクタが衝突する問題を修正」を追加 | +| [commit cpprefjp/site, 2114ad7, d7ebdf4] | cpprefjp/addlang:1, cpprefjp/link:2 | C++20 : 「抽象型のチェック」を追加 | +| [commit cpprefjp/site, 3918a50, 172d284] | cpprefjp/fixm:2 | CONTRIBUTINGとstart_editingが重複していたので整理 | +| [commit cpprefjp/site, 03178a7] | cpprefjp/fixm:1 | C++23 : `std::format`のRange、タプルの出力を例示 | +| [commit cpprefjp/site, a0a65d9] | tool/fixbug:1, cpprefjp/fixm:3 | 拡張子ミスのような不正な内部リンクが検出されていなかったのを修正 | +| [commit cpprefjp/site, 9769a26, 6110d2a] | cpprefjp/addref:1, cpprefjp/link:1 | `` : `formattable`を追加 | +| [commit cpprefjp/site, 8ba4402] | cpprefjp/fixl:1 | 国際標準規格 : C++23のWorking Draftを更新 | +| [commit cpprefjp/site, 0818b72] | cpprefjp/fixl:2 | C++23 : 言語機能としてN4929のEditor's Reportで採択されたものを記載 | +| [commit cpprefjp/site, 1e4b73b] | cpprefjp/fixl:1 | `format` : デバッグ指定と、C++23向けサンプルコードを追加 | +| [commit cpprefjp/site, 30fc8df] | cpprefjp/fixl:1 | `format` : Rangeとtuple-typeの書式仕様を追加 | +| [commit cpprefjp/site, 07a5186] | cpprefjp/fixs:1 | `format` : 見出しとして別な用途で「例」があると混乱するので、リネーム | +| [commit cpprefjp/site, 44c43e1] | cpprefjp/fixm:1, cpprefjp/fixs:3 | `hexfloat` : GCCで入力での使用にバグがあることを記載 | +| [commit cpprefjp/site, 2497046] | cpprefjp/fixm:1 | `format` : Rangeの要素に対する書式指定の例を記載 | +| [commit cpprefjp/site, 1a3edd0] | cpprefjp/link:16 | `std::tuple`をグローバル修飾リストに追加 | +| [commit cpprefjp/site, dd2fa16] | cpprefjp/fixm:1 | `format` : Rangeのデバッグ出力を解除する例を記載 | +| [commit cpprefjp/site, c73a954] | cpprefjp/fixm:1 | `format` : `vector>`の書式指定の例を追加 | +| [commit cpprefjp/site, dc3a27e, 7f6f300, 61cbf01] | cpprefjp/addref:2, cpprefjp/fixl:1, cpprefjp/link:39 | `` : `range_format`と`format_kind`を追加 | +| [commit cpprefjp/site, 5388006] | cpprefjp/fixl:1 | `formatter` : C++23仕様に対応し、サンプルコードのコンパイルエラーを修正 (`const`が抜けてた) | +| [commit cpprefjp/site, c5c2b70] | cpprefjp/fixm:1 | 編集タスクを、start_editing.mdの下の方に記載した | +| [commit cpprefjp/site, c7b073e, ccd76f6] | cpprefjp/addref:1, cpprefjp/link:2 | `formatter` : `parse`を追加 | +| [commit cpprefjp/site, a7b952b, e13f4b9, 4b80aa7] | cpprefjp/addpage:1, cpprefjp/link:1 | ディレクトリ構造のドキュメントを追加 | +| [commit cpprefjp/site, 6d599ab] | cpprefjp/fixm:1 | `formatter` : `format`メンバ関数は`const`でなければならない | +| [commit cpprefjp/site, 410c572] | cpprefjp/addref:3, cpprefjp/fixm:2 | `basic_format_context` : `out`, `advance_to`, `locale`を追加 | +| [commit cpprefjp/site, 322f877] | cpprefjp/fixm:1, cpprefjp/fixs:1 | `formatter` : `parse`を実装する例を記載 | +| [commit cpprefjp/site, ad99718, d1ac632] | cpprefjp/addref:3, cpprefjp/link:4 | `basic_format_parse_context`: `begin`, `end`, `advance_to`を追加 | +| [commit cpprefjp/site, 3269f7f] | cpprefjp/addref:4, cpprefjp/link:3 | `formatter` : `format`, `set_brackets`, `set_separator`, `set_debug_format`を追加 | +| [commit cpprefjp/site, 93bd53e] | cpprefjp/fixs:1 | `formatter` : コード修飾を追加 | +| [commit cpprefjp/site, f3d46e1, 1b70d49, 258f393, 373f49d, 74662b4] | cpprefjp/addref:6, cpprefjp/link:1 | `` : `range_formatter`を追加 | +| [commit cpprefjp/site, 1971c4d] | cpprefjp/addref:2, cpprefjp/fixl:5 | `` : コンテナアダプタの文字列フォーマットに対応 | +| [commit cpprefjp/site, 2513346] | cpprefjp/addref:1, cpprefjp/fixm:1, cpprefjp/link:2 | `` : `range-default-formatter`を追加 | +| [commit cpprefjp/site, f216f9f, b2de7ca] | cpprefjp/fixl:1, cpprefjp/fixm:1, cpprefjp/link:1 | `vector::reference`に対する`formatter`の特殊化を追加 | +| [commit cpprefjp/site, 4f16a60, 469297f, a235d11, dfae477, e388ca6, 0bd721d, 88c0244, bc47b38, a689c6b] | cpprefjp/addref:9, cpprefjp/fixl:1, cpprefjp/fixm:1, cpprefjp/link:3 | ``ヘッダ | +| [commit cpprefjp/site, 83d5357] | cpprefjp/fixs:3 | `optional::and_then`, `or_else` : コード修飾を追加 | +| [commit cpprefjp/site, 6d029cb] | cpprefjp/fixs:1 | `expected` : コード修飾を追加 | +| [commit cpprefjp/site, 33fb996] | cpprefjp/fixs:1 | detect forbidden characters CIの説明を記載 | +| [commit cpprefjp/site, 524b256] | cpprefjp/fixm:1 | start_editing : GitHub Actionsの各タスクについての説明を記載 | +| [commit cpprefjp/site, f770ec5, 6a2ea7c] | cpprefjp/addref:3, cpprefjp/fixl:2, cpprefjp/link:7 | `` : `basic_format_string`クラスを追加 | +| [commit cpprefjp/site, 9ad08e0] | cpprefjp/fixm:1 | `format` : ログ出力の例を追加 | +| [commit cpprefjp/site, 9140852] | cpprefjp/fixs:1 | `format` : 段落ミスを修正 | +| [commit cpprefjp/site, 6b38026, 6048252] | tool/addm:2, cpprefjp/fixs:199, cpprefjp/link:1 | コード修飾の誤り検出CIを追加 | +| [commit cpprefjp/site, 0709184] | tool/improves:1 | 外部リンクチェック : microsoft.com を無視リストに登録 | +| [commit cpprefjp/site, a26647a, d3cb083, eaf722b, 182e098, 019f15e, be98598, 5419582] | cpprefjp/fixl:37 | ``の`constexpr`対応 | +| [commit cpprefjp/site, ba05560] | cpprefjp/fixs:11 | 返り値、返値 : 訳語表に基づいて「戻り値」に修正 | +| [commit cpprefjp/site, ace1860, 0567ba8] | cpprefjp/fixl:53 | `` : 拡張浮動小数点数型への対応 | +| [commit cpprefjp/site, 2d01c56] | cpprefjp/addref:1, cpprefjp/fixs:1, cpprefjp/link:2 | `` : `abs`を追加 | +| [commit cpprefjp/site, 72d23cc] | cpprefjp/addref:4, cpprefjp/link:1 | `` : `div`を追加 | +| [commit cpprefjp/site, afa0dc5, dcbf835, b137272, f39c3c3, 85010fb, b986d8c, 24071c4, 828ff58] | cpprefjp/addref:6, cpprefjp/link:3, cpprefjp/fixl:4, cpprefjp/fixm:2 | `` | +| [commit cpprefjp/site, 3607e5a] | cpprefjp/fixl:1, cpprefjp/link:4 | `numeric_limits::is_iec559` : C++23対応 |a +| [commit cpprefjp/site, f5a4bdc] | cpprefjp/fixl:9 | `complex` : C++23の拡張浮動小数点数型に対応 | +| [commit cpprefjp/site, d00a2e8] | cpprefjp/fixs:1 | 不要なコード修飾を削除 | +| [commit cpprefjp/site, bd6e8a6] | tool/addm:1 | buildジョブを最新以外キャンセルするよう修正 | +| [commit cpprefjp/site, f447758] | cpprefjp/fixl:1 | `from_chars` : 拡張浮動小数点数型に対応 | +| [commit cpprefjp/site, 985d49c] | cpprefjp/fixl:1 | `to_chars` : 拡張浮動小数点数型に対応 | +| [commit cpprefjp/site, d9d21a6, a49ab65, 9fe59f7, 3ecf9ca, 82cec00, 0ce85f3, 9d64bb3, 566457e, 5e04103, e87272b, 1fe5eb3, c84d47b, a43bd16, c5c7b5a, fb3b50d, 9430b41, d6e40dd, d91c1da, 19decb2, 95fb484, 9403580, ff098b7, 31bf54b, 83dd89c, fb295e5, 0376f47, 2ba5e13, 2c9f635, c9cf59d, 5674bf7, 0b73645, 0c072b9, 1e33730, f3f7503, 292f841, 3547182, db7801c, cd883d1, d210ea7, 7f2cc9c, 430fad2, 842cacb] | cpprefjp/addref:37, cpprefjp/fixl:1, cpprefjp/fixm:8, cpprefjp/link:7 | `` | +| [commit cpprefjp/site, b30e6fd] | cpprefjp/fixm:1 | Clang 16でC++17がデフォルトになった | +| [commit cpprefjp/site, 5ae96e7, 163df86] | cpprefjp/fixm:1 | トップページに、スポンサーシップについて掲載 | +| [commit cpprefjp/site, ec2e4d0, f578c30, ee14b2a, b42afef, 6c6acb8] | cpprefjp/fixm:1 | トップページ : Acerola Software社様のロゴを表示 | +| [commit cpprefjp/site, 51b9443] | cpprefjp/fixm:1 | トップページ : Fixstars社様のロゴを表示 | +| [commit cpprefjp/site, 15e87df] | cpprefjp/typo:1 | (multi)map, (multi)set : s/const pointer/const_pointer/ | +| [commit cpprefjp/site, 5f8fea3] | cpprefjp/fixm:1 | クラスの雛形ページ : Hidden Friendsの記載例を追加 | +| [commit cpprefjp/site, 8627239] | cpprefjp/fixm:1 | 国際標準規格 : C++23の規格案を更新 | +| [commit cpprefjp/site, 0f55a96] | cpprefjp/link:1 | テンプレート再帰回数の記事がリンク切れしていたのでアーカイブに差し替え | +| [commit cpprefjp/site, e852199, 6566493, 138872a] | cpprefjp/fixl:1 | C++23 : N4945での主要な変更を反映 | +| [commit cpprefjp/site, 058df35, 4f1dfeb, 8916ccb] | tool/addm:2, cpprefjp/typo:4, cpprefjp/link:1 | NGワードのチェックCIを追加 | +| [commit cpprefjp/site, 8a3b779] | tool/improves:1, cpprefjp/typo:1 | 移譲->委譲 を追加 | +| [commit cpprefjp/site, b7b6270] | cpprefjp/fixs:1 | `map::operator[ ]` : オーバーロードに言語バージョンの書き忘れ | +| [commit cpprefjp/site, 1702da3] | cpprefjp/fixm:4 | (multi)set|mapのfind : 透過的な検索の仕様をひな形に合わせた | +| [commit cpprefjp/site, 131af88, 555a222] | cpprefjp/fixm:1 | vaporoid様のスポンサーロゴを追加 | +| [commit cpprefjp/site, a6f4987, db4695b, e5f31cd, 76502a5, 0bbeedb] | cpprefjp/fixm:1 | 新たなスポンサーを追加 | +| [commit cpprefjp/site, 8d47b62] | cpprefjp/fixm:1 | スポンサーを追加 | +| [commit cpprefjp/site, ca45417, 1e49d46] | cpprefjp/fixm:1 | スポンサー追加 | +| [commit cpprefjp/site, 50fa390, 394355b] | cpprefjp/fixm:1 | スポンサー追加 | +| [commit cpprefjp/site, c019c0e] | cpprefjp/typo:1 | `borrowed_range` : `span`の要素は文字列ではなく`int` | +| [commit cpprefjp/site, aaff7b5] | cpprefjp/fixm:2 | (multi)map : emptyの言語バージョンがC++11になっていたのを修正 | +| [commit cpprefjp/site, 309d0ed] | cpprefjp/fixm:1 | 規格草案を更新 | +| [commit cpprefjp/site, dc8afeb, 86be6a9] | cpprefjp/fixm:1 | スポンサー更新 | +| [commit cpprefjp/site, 8794a91] | cpprefjp/typo:1 | generator : クラス定義のセミコロン忘れを修正 | +| [commit cpprefjp/site, 1007613] | cpprefjp/fixm:1 | 関数の雛形ページ : 非推奨・削除の書き方が記載されていなかった | +| [commit cpprefjp/site, 6b1443d] | cpprefjp/fixm:3 | `has_denorm(_loss)` : 非推奨の詳細を記載 | +| [commit cpprefjp/site, 5ae2c39] | tool/improves:1, cpprefjp/typo:3 | NGワードとしてpvalue (prvalueのtypo) を追加 | +| [commit cpprefjp/site, 0f3743e] | cpprefjp/fixl:1 | C++20 : `shared_ptr`のアトミック操作が非推奨になったことを記載 | +| [commit cpprefjp/site, 8f3626e] | cpprefjp/fixm:36 | `set`/`map`の`begin`/`end`系 : ほかのコンテナに合わせて文章を整理 | +| [commit cpprefjp/site, 5af768a] | cpprefjp/link:3 | C++20 `constinit` : `mutex`/`unique_ptr`のコンストラクタと相互リンク | +| [commit cpprefjp/site, 587bd5b, ae7c515, 6251e4a, a6c9e22, 717658d, e7ee1d9, c170374] | cpprefjp/fixm:4 | `map`/`set`の`erase`に存在しないキーを指定した場合の動作 | +| [commit cpprefjp/site, 6eaa82d] | cpprefjp/fixl:4 | `map` / `set`の`extract` : C++23でのheterogeneousなオーバーロードを追加 | +| [commit cpprefjp/site, a5c1257] | cpprefjp/link:1 | ワイブル分布の参考文献をWeb Archiveに差し替え | +| [commit cpprefjp/site, 2dd6e26] | cpprefjp/fixm:1 | `map::insert` : `P&&`と`value_type&&`は両方存在するのでオーバーロード番号を分け、概要文章を追加 | +| [commit cpprefjp/site, 21d60b4] | cpprefjp/fixm:1 | `map::insert_or_assign` : オーバーロードの概要文章を追加 | +| [commit cpprefjp/site, 176e5a6] | cpprefjp/fixm:3 | `map::lower_bound`, `upper_bound`, `equal_range` : オーバーロード概要とリンクを整理 | +| [commit cpprefjp/site, 209d36b] | cpprefjp/fixm:1 | スポンサー更新 | +| [commit cpprefjp/site, a2837c4] | cpprefjp/link:1 | `is_constant_evaluated` : C++23 `if consteval`へのリンクを追加 | +| [commit cpprefjp/site, 42414ad] | tool/improves:1 | NGワードにgreator (greaterのtypo) を追加 | +| [commit cpprefjp/site, 1cededd] | cpprefjp/link:1 | `error_condition` : `HRESULT`の解説ページをarchiveに差し替え | +| [commit cpprefjp/site, 92b8e34] | cpprefjp/fixm:1 | Clang : C++26のオプションを記載 | +| [commit cpprefjp/site, ef3c242] | cpprefjp/fixm:1 | Clang : c++23オプションを追加 | +| [commit cpprefjp/site, 8e71d07] | tool/improves:1 | NGワードチェック : `std::range::` → `std::ranges::` を追加 | +| [commit cpprefjp/site, 7e78a7d] | cpprefjp/fixl:1 | 国際標準規格 : C++26を追加 | +| [commit cpprefjp/site, 13b0cf9, 7ae71bb, db656f4] | cpprefjp/fixl:1 | C++26 : 言語機能を追加 | +| [commit cpprefjp/site, bd9f4a4] | cpprefjp/fixm:1 | トップページ : 問い合わせ窓口のGoogle Groupと銀行振込について記載 | +| [commit cpprefjp/site, 5ad48c7] | cpprefjp/fixl:1 | コンパイラの実装状況 : C++26を追加 | +| [commit cpprefjp/site, bf03828] | cpprefjp/fixm:1 | `any` : クラスページに型の要件を記載 | +| [commit cpprefjp/site, 1300401] | cpprefjp/fixm:2 | `multiset`, `multimap`の`erase` : 同じキーを持つ要素数を計算量に入れた | +| [commit cpprefjp/site, 4f5d507] | cpprefjp/fixm:1 | `from_range_t` : 所属ヘッダが間違っていた | +| [commit cpprefjp/site, d73d6be, 1b2e850] | tool/addm:2, cpprefjp/fixm:1 | 所属ヘッダの指定ミスを検出するCIタスクを追加 | +| [commit cpprefjp/site, f5119ae] | cpprefjp/fixl:1 | 国際標準規格 : Working Draftを更新 | +| [commit cpprefjp/site, 8d43599] | | 貢献ポイントと分配方法についてまとめた | +| [commit cpprefjp/site, 3b8a415] | | 貢献ポイント : Open Collectiveでの経費申請の仕方を記載 | +| [commit cpprefjp/site, da9fc6a] | | 貢献ポイント : マージされずクローズされたPR、マージされずオープンなままのPRについて記載 | +| [commit cpprefjp/site, 4dfdb3a, 3104eb3, 7326dd7, 2ef44e2, 8cb09b8, 11b8c7e] | cpprefjp/fixm:1 | index : 時雨堂さまのロゴとリンクを掲載 | +| [commit cpprefjp/site, cefc9fa], [commit boostjp/site, 2c6589b] | tool/fixbug:2 | buildアクション : Pythonを3.11に固定 (3.12でエラーがでた) | +| [commit cpprefjp/site_generator, 6345a65] | tool/improvem:1 | Google Analytics GA4を設定 | +| [commit cpprefjp/kunai_config, 9b8dc0d, 91b3abb], [commit cpprefjp/kunai, b375504] | tool/improvem:1 | 編集者向け資料をリネーム | +| [commit cpprefjp/site, 9b1cdc2, 863b2d6, bdccb2d] | tool/adds:1 | 編集方針を追加 | +| [commit cpprefjp/kunai, b7b8513] | tool/improves:1 | 画像の最大幅を設定 | +| [commit cpprefjp/kunai, b206bad] | tool/improves:1 | codeタグ中の末尾スペースが消えてしまっていた問題を修正 | +| [commit boostjp/site, 368ecfc, 075dd40, aa9e52b, c8d6259, 5d2c514, d813d6a] | boostjp/releasel:8, boostjp/releasem:19, boostjp/releases:1, boostjp/link:1 | 1.82.0リリースノート | +| [commit boostjp/site, 0bb4c21, 34205bb, 403bc7b, cd1c5f8] | boostjp/releasel:4, boostjp/releasem:25, boostjp/releases:1, boostjp/link:1 | 1.83.0リリースノート | +| [commit cpprefjp/site, bf70875] | | 貢献ポイント : 集計中に必要となった貢献ポイントの項目を追加 | +| [commit cpprefjp/site, f67a9f4] | | 2023年1月分の貢献ポイントをまとめた | +| [commit cpprefjp/site, d9fb324] | | 貢献ポイント: Boostへの貢献は追跡しきれないのでやめた | +| [commit cpprefjp/site, cc884d3] | | 貢献ポイント2023: 不正なタグを修正 | +| [commit cpprefjp/site, 4e048eb] | | 貢献ポイント : 2023/02のコントリビュートをまとめた | +| [commit cpprefjp/site, 0ceca8e] | | 貢献ポイント : コンパイラ動作確認を言語機能とライブラリ機能で集計方法を分けた | +| [commit cpprefjp/site, 3faf5c1] | | 貢献ポイント : 2023/03のコントリビュートをまとめた | +| [commit cpprefjp/site, 7215f9e] | | 貢献ポイント : 2023/04のコントリビュートを追加 | +| [commit cpprefjp/site, e5991d8] | | NGワードチェック : 編集者向けドキュメントは対象外にした | +| [commit cpprefjp/site, 192494c] | | 貢献ポイント : 2023/05のコントリビュートを追加 | +| [commit cpprefjp/site, cbed1c0] | | 貢献ポイント : 2023/06のコントリビュートを追加 | +| [commit cpprefjp/site, e3bd67b] | | 貢献ポイント: 2023/07のコントリビュートを追加 | +| [commit cpprefjp/site, 065f221] | | 貢献ポイント : 集計作業を除外 | +| [commit cpprefjp/site, 94f157b] | | 貢献ポイント : 2023/08のコントリビュートを追加 | +| [commit cpprefjp/site, 142e7b6] | | 貢献ポイント : 2023/09のコントリビュートを追加 | +| [commit cpprefjp/site, d7ebe95] | | 貢献ポイント : 2023/10のコントリビュートを追加 | +| [commit cpprefjp/site, 217669c] | cpprefjp/fixl:4 | `unordered_map` / `set`の`erase` : `erase(iterator)`のオーバーロードを追加 | +| [commit cpprefjp/site, bfc992c] | | 貢献ポイント : cpprefjp/site以外のコミットを追加 | +| [commit cpprefjp/site, f9a0fdd] | tool/improves:1, cpprefjp/typo:2 | NGワードチェック : "\[型\]\(link\)型"をNGワードに登録 | +| [commit cpprefjp/site, 118d5b9] | tool/improves:1, cpprefjp/typo:1 | tuple/apply : Gitのコンフリクトコメントを削除 | +| [commit cpprefjp/site, cc748a6] | cpprefjp/fixm:1 | スポンサー更新 | +| [commit cpprefjp/site, 2c21229] | cpprefjp/fixs:1 | `ios_base` : コード修飾を追加 | +| [commit cpprefjp/site, e30c3ae] | cpprefjp/fixl:1 | `ios_base::openmode` : C++23対応として`noreplace`フラグを追加 | +| [commit cpprefjp/site, d408c51] | cpprefjp/fixm:1 | トップページ : シルバースポンサー以上はissueに採用情報を投稿できる特典を追加 | +| [commit cpprefjp/site, b17670d] | cpprefjp/fixm:2 | `ostream`の`print`と`println` : `cerr`とかは`iostream`で定義される | +| [commit cpprefjp/site, e6d487c] | cpprefjp/typo:1 | `print`/`vprint_unicode` : ですます調になっていたところを修正 | +| [commit cpprefjp/site, 519f8a7] | cpprefjp/link:2 | `to_chars` / `from_chars` : コード修飾を追加 | +| [commit boostjp/site, d7ec01f, 5153ad7, e9ebe52] | boostjp/releases:13, boostjp/releasem:24, boostjp/releasel:2, boostjp/link:1 | 1.84.0 : リリースノートを追加 | +| [commit cpprefjp/site, 4df3220] | | 貢献ポイント : ユーザー名をリンクにした | ## [wx257osn2](https://github.com/wx257osn2) | コミット | タグ | 説明 | |----------|------|------| -| [79d9ed9](https://github.com/cpprefjp/site/commit/79d9ed994302be52e299f635374106d1c5264c5c), [bbf5105](https://github.com/cpprefjp/site/commit/bbf5105d7652cc174b8c8c83f036189edbc5d49e) | cpprefjp/fixl:1 | 関数引数や戻り値型として非const参照が使えるようになったことを明示 | -| [31cfbe3](https://github.com/cpprefjp/site/commit/31cfbe34477f3b76e31ee79d312f2808f6dbdee6) | cpprefjp/fixl:1 | Defect report LWG 2901 removed allocator support of variant | -| [6061559](https://github.com/cpprefjp/site/commit/6061559e89e9315c95a53f90cf0cea0fe891e7ae) | cpprefjp/fixl:5 | P2231R1: some functions will be constexpr in C++23 | -| [e9732e7](https://github.com/cpprefjp/site/commit/e9732e7665c761ffe36e50e41982d79677b72376), [c398ce7](https://github.com/cpprefjp/site/commit/c398ce768a935757dceefcc478d0816baa59cab4) | cpprefjp/fixm:1 | 表現をよりわかりやすく | -| [e3233e7](https://github.com/cpprefjp/site/commit/e3233e7dbb6729db10d737119c4a480238d0ae5f) | cpprefjp/fixm:1 | fix invalid name hiding | -| [1d666c6](https://github.com/cpprefjp/site/commit/1d666c610ffc9418a8f2b397b11e613ccfa6ca84) | cpprefjp/fixm:1 | fix missing variable name | -| [e92dbda](https://github.com/cpprefjp/site/commit/e92dbda8d6943d59800e65802678279cbec5ee7d), [c0e6060](https://github.com/cpprefjp/site/commit/c0e60600cf7f49f89512999e5cf3aa13dcff1747) | cpprefjp/fixs:3 | add link | -| [663009e](https://github.com/cpprefjp/site/commit/663009edf7ef89aacce6d49fdbe7f71cd9705ab1) | cpprefjp/typo:1 | remove # | -| [5281313](https://github.com/cpprefjp/site/commit/528131302fef3ee398244e5900cca0498df28064) | cpprefjp/typo:1 | fix title(prev -> next) | -| [1117ef2](https://github.com/cpprefjp/site/commit/1117ef22bd6ecdc03a66d7831f77ac7f551ea580) | cpprefjp/typo:1 | fix typo | -| [8a693a4](https://github.com/cpprefjp/kunai/commit/8a693a4dafa4ade9ea143d56bb9d83daa7696c74) | tool/improves:1 | Fix font size of `` on headers | -| [e4d608c](https://github.com/cpprefjp/kunai/commit/e4d608c11981d724a9456323d2dabd1c153ae253) | tool/improves:1 | make padding 90% | +| [commit cpprefjp/site, 79d9ed9, bbf5105] | cpprefjp/fixl:1 | 関数引数や戻り値型として非const参照が使えるようになったことを明示 | +| [commit cpprefjp/site, 31cfbe3] | cpprefjp/fixl:1 | Defect report LWG 2901 removed allocator support of variant | +| [commit cpprefjp/site, 6061559] | cpprefjp/fixl:5 | P2231R1: some functions will be constexpr in C++23 | +| [commit cpprefjp/site, e9732e7, c398ce7] | cpprefjp/fixm:1 | 表現をよりわかりやすく | +| [commit cpprefjp/site, e3233e7] | cpprefjp/fixm:1 | fix invalid name hiding | +| [commit cpprefjp/site, 1d666c6] | cpprefjp/fixm:1 | fix missing variable name | +| [commit cpprefjp/site, e92dbda, c0e6060] | cpprefjp/fixs:3 | add link | +| [commit cpprefjp/site, 663009e] | cpprefjp/typo:1 | remove # | +| [commit cpprefjp/site, 5281313] | cpprefjp/typo:1 | fix title(prev -> next) | +| [commit cpprefjp/site, 1117ef2] | cpprefjp/typo:1 | fix typo | +| [commit cpprefjp/kunai, 8a693a4] | tool/improves:1 | Fix font size of `` on headers | +| [commit cpprefjp/kunai, e4d608c] | tool/improves:1 | make padding 90% | ## [suomesta](https://github.com/suomesta) | コミット | タグ | 説明 | |----------|------|------| -| [5df0bc4](https://github.com/cpprefjp/site/commit/5df0bc418e92e87d9450b1137168865a0c4c2589) | cpprefjp/fixm:1 | add result of sample | -| [59b8773](https://github.com/cpprefjp/site/commit/59b877334be838338599f1faf067686365e5e643) | cpprefjp/fixm:2 | fix that notes on correct place | -| [6f00655](https://github.com/cpprefjp/site/commit/6f006553cc2a92f9293a75abe9bd887b175acf0c) | cpprefjp/compiler:2, cpprefjp/link:1 | fix some typo in ranges sample | -| [b852507](https://github.com/cpprefjp/site/commit/b8525072e38f2979a23b1ba259719a937b0e7e0d) | cpprefjp/fixs:1 | remove unnecessaly characters | -| [3e88af5](https://github.com/cpprefjp/site/commit/3e88af561b8b1f5803fbf49d43ea6e188fd1eb4c) | cpprefjp/compiler:3 | fix again samples of `std::set` | -| [283ec8d](https://github.com/cpprefjp/site/commit/283ec8d963da7202ba54e1f14abdb66b1a0a34f3) | cpprefjp/fixm:6 | fix some versioning | -| [e4e068d](https://github.com/cpprefjp/site/commit/e4e068d317be054bde4480e0dafa521104707c14) | cpprefjp/fixm:1 | fix noexcept description in `std::string` | -| [f9f1c46](https://github.com/cpprefjp/site/commit/f9f1c46d5b971891ef2779d943543493e7d49b4a) | cpprefjp/link:4 | fix some typo | -| [9019107](https://github.com/cpprefjp/site/commit/901910765b0e8046402e73880aeb25a1d0755a5b) | cpprefjp/link:3 | remove relation item linking to own page | -| [9365d56](https://github.com/cpprefjp/site/commit/9365d56a456376b0f98c7d54af3391da78412617) | cpprefjp/link:11 | remove link to own page | -| [f09cd87](https://github.com/cpprefjp/site/commit/f09cd879a500c63e43eb84f00f7f4704652c9efa) | cpprefjp/link:16 | fix to correct link | -| [5e61ff5](https://github.com/cpprefjp/site/commit/5e61ff5c823cc319809c329792c646f2744e85e1) | cpprefjp/link:1 | set link and remove link to own page | -| [ab42c56](https://github.com/cpprefjp/site/commit/ab42c56c60f7caf7c809277e1b204427eb790376) | cpprefjp/link:3 | arrange relations in ranges::next/prev/advance | -| [a980ba7](https://github.com/cpprefjp/site/commit/a980ba7040481aaedeb09ba2086e2be7e421d58f) | cpprefjp/fixm:12 | change meta-id function to template function | -| [87ffbf8](https://github.com/cpprefjp/site/commit/87ffbf8063ce4c4e9204ca50530112ac0a939b19) | cpprefjp/fixm:17 | remove unnecessary include in samples | -| [24061d7](https://github.com/cpprefjp/site/commit/24061d75bba42c3b7e2f7175db090c7e1ec31e6b) | cpprefjp/fixm:1 | fix wrong type in a sample | -| [0dee2f1](https://github.com/cpprefjp/site/commit/0dee2f1c26e7ffcdac6217e51c420d3b1b45bbb2) | cpprefjp/typo:19 | fix typo | -| [d83c6a4](https://github.com/cpprefjp/site/commit/d83c6a4dbf2faf6b49a7de4a6b24e77b68cf4edb) | cpprefjp/link:1 | fix link error | -| [7341bb7](https://github.com/cpprefjp/site/commit/7341bb7e271c2e73f7a428f3371122cfacf11caf) | cpprefjp/link:1 | add link | -| [2311413](https://github.com/cpprefjp/site/commit/2311413d25e3c2224c996bfb59f5f656d1762abd) | cpprefjp/typo:3 | fix typo | -| [4c95521](https://github.com/cpprefjp/site/commit/4c95521670ac88129ccb470c6180a2dec4508d53) | cpprefjp/fixm:3 | fix some minor faults | -| [ba5a5a9](https://github.com/cpprefjp/site/commit/ba5a5a9392ad379ac413fc0336991838cdf89a3a) | cpprefjp/fixm:11 | some small improvements in samples | -| [d2d48f0](https://github.com/cpprefjp/site/commit/d2d48f0a58488d30bfb62833363b35821459adfc) | cpprefjp/fixm:7 | fix meta-id from function to function template | -| [d172c77](https://github.com/cpprefjp/site/commit/d172c772fb408750a5d91b48693e602df6cbf579) | cpprefjp/fixm:13 | fix std version numbers | -| [46a08ba](https://github.com/cpprefjp/site/commit/46a08baefd09238f70612716fbb23e1197d8fdf4) | cpprefjp/fixl:35 | add C++03 version | -| [1174ad4](https://github.com/cpprefjp/site/commit/1174ad40b2b765d3d2c1d8e76f6b1dee624ce2be) | cpprefjp/fixs:3 | small improvemenmts in samples | -| [0ee0833](https://github.com/cpprefjp/site/commit/0ee0833cda17c6b8510840c3f41cc0691cf6212b) | cpprefjp/fixs:5 | fix some typo regarding `std::string` | -| [3f57b63](https://github.com/cpprefjp/site/commit/3f57b6362da6d563cc732cc0155939599ba43bab) | cpprefjp/fixm:3 | improve some examples | -| [de4b233](https://github.com/cpprefjp/site/commit/de4b233c1adaaabaa2a35c4e3005828b50cef34b) | cpprefjp/fixm:1, cpprefjp/fixs:2 | fix some typo | -| [11b32f7](https://github.com/cpprefjp/site/commit/11b32f7cbe871fe4970b66171344d19c831f1b7b) | cpprefjp/fixm:2, cpprefjp/typo:1 | fix some typo | -| [0622e39](https://github.com/cpprefjp/site/commit/0622e399e01a52b5e8524319d5a1c457e3e0e5f9) | cpprefjp/fixm:6 | fix some expression | -| [1bf71dc](https://github.com/cpprefjp/site/commit/1bf71dc803d140329e3690f6abaa004bb21b9c97) | cpprefjp/compiler:2, cpprefjp/fixs:1 | update information about `charconv` | -| [407947b](https://github.com/cpprefjp/site/commit/407947b424bc1f4f868a938453cb8c2eee2c0ab4) | cpprefjp/fixm:6, cpprefjp/typo:5 | fix some typo | -| [8a944b1](https://github.com/cpprefjp/site/commit/8a944b14616ef124fb61c5793c581789b2d58768) | cpprefjp/fixm:4, cpprefjp/fixs:2, cpprefjp/typo:1 | fix a sample of atomic. | +| [commit cpprefjp/site, 5df0bc4] | cpprefjp/fixm:1 | add result of sample | +| [commit cpprefjp/site, 59b8773] | cpprefjp/fixm:2 | fix that notes on correct place | +| [commit cpprefjp/site, 6f00655] | cpprefjp/compiler:2, cpprefjp/link:1 | fix some typo in ranges sample | +| [commit cpprefjp/site, b852507] | cpprefjp/fixs:1 | remove unnecessaly characters | +| [commit cpprefjp/site, 3e88af5] | cpprefjp/compiler:3 | fix again samples of `std::set` | +| [commit cpprefjp/site, 283ec8d] | cpprefjp/fixm:6 | fix some versioning | +| [commit cpprefjp/site, e4e068d] | cpprefjp/fixm:1 | fix noexcept description in `std::string` | +| [commit cpprefjp/site, f9f1c46] | cpprefjp/link:4 | fix some typo | +| [commit cpprefjp/site, 9019107] | cpprefjp/link:3 | remove relation item linking to own page | +| [commit cpprefjp/site, 9365d56] | cpprefjp/link:11 | remove link to own page | +| [commit cpprefjp/site, f09cd87] | cpprefjp/link:16 | fix to correct link | +| [commit cpprefjp/site, 5e61ff5] | cpprefjp/link:1 | set link and remove link to own page | +| [commit cpprefjp/site, ab42c56] | cpprefjp/link:3 | arrange relations in ranges::next/prev/advance | +| [commit cpprefjp/site, a980ba7] | cpprefjp/fixm:12 | change meta-id function to template function | +| [commit cpprefjp/site, 87ffbf8] | cpprefjp/fixm:17 | remove unnecessary include in samples | +| [commit cpprefjp/site, 24061d7] | cpprefjp/fixm:1 | fix wrong type in a sample | +| [commit cpprefjp/site, 0dee2f1] | cpprefjp/typo:19 | fix typo | +| [commit cpprefjp/site, d83c6a4] | cpprefjp/link:1 | fix link error | +| [commit cpprefjp/site, 7341bb7] | cpprefjp/link:1 | add link | +| [commit cpprefjp/site, 2311413] | cpprefjp/typo:3 | fix typo | +| [commit cpprefjp/site, 4c95521] | cpprefjp/fixm:3 | fix some minor faults | +| [commit cpprefjp/site, ba5a5a9] | cpprefjp/fixm:11 | some small improvements in samples | +| [commit cpprefjp/site, d2d48f0] | cpprefjp/fixm:7 | fix meta-id from function to function template | +| [commit cpprefjp/site, d172c77] | cpprefjp/fixm:13 | fix std version numbers | +| [commit cpprefjp/site, 46a08ba] | cpprefjp/fixl:35 | add C++03 version | +| [commit cpprefjp/site, 1174ad4] | cpprefjp/fixs:3 | small improvemenmts in samples | +| [commit cpprefjp/site, 0ee0833] | cpprefjp/fixs:5 | fix some typo regarding `std::string` | +| [commit cpprefjp/site, 3f57b63] | cpprefjp/fixm:3 | improve some examples | +| [commit cpprefjp/site, de4b233] | cpprefjp/fixm:1, cpprefjp/fixs:2 | fix some typo | +| [commit cpprefjp/site, 11b32f7] | cpprefjp/fixm:2, cpprefjp/typo:1 | fix some typo | +| [commit cpprefjp/site, 0622e39] | cpprefjp/fixm:6 | fix some expression | +| [commit cpprefjp/site, 1bf71dc] | cpprefjp/compiler:2, cpprefjp/fixs:1 | update information about `charconv` | +| [commit cpprefjp/site, 407947b] | cpprefjp/fixm:6, cpprefjp/typo:5 | fix some typo | +| [commit cpprefjp/site, 8a944b1] | cpprefjp/fixm:4, cpprefjp/fixs:2, cpprefjp/typo:1 | fix a sample of atomic. | ## [k-satoda](https://github.com/k-satoda) | コミット | タグ | 説明 | |----------|------|------| -| [533c542](https://github.com/cpprefjp/site/commit/533c54260230bc66ece67eda846b3412bdd38ee7) | cpprefjp/fixm:1 | `NULL`: C++03 の規定について実際の規格と合致しない記述を修正 | +| [commit cpprefjp/site, 533c542] | cpprefjp/fixm:1 | `NULL`: C++03 の規定について実際の規格と合致しない記述を修正 | ## [onihusube](https://github.com/onihusube) | コミット | タグ | 説明 | |----------|------|------| -| [df12b1d](https://github.com/cpprefjp/site/commit/df12b1d5f5725ef7c6ee40a770de935c3450af1c) | cpprefjp/fixs:1 | リンク修正 | -| [fb89d60](https://github.com/cpprefjp/site/commit/fb89d60dad2209edb09d59b161cd7e56b4f8e2a9), [bc12e24](https://github.com/cpprefjp/site/commit/bc12e242a85559d837c3e115ad7d74f16589f530), [f86e382](https://github.com/cpprefjp/site/commit/f86e3825c89e743aedfdd3d66a1850cbd74d63f2), [5e7e22e](https://github.com/cpprefjp/site/commit/5e7e22e36add8468caa85af0a3c18a7a443a5e1b), [84f996b](https://github.com/cpprefjp/site/commit/84f996ba10e58682f9cb49fa77382f745e3b71a9) | cpprefjp/addlang:1, cpprefjp/addref:1, cpprefjp/link:4 | 可変長データを扱うクラスの効率的な`delete` | -| [3a5b2dc](https://github.com/cpprefjp/site/commit/3a5b2dc12d79e256423a3b90bb35533e103ec671) | cpprefjp/fixm:1 | `operator delete[]` : 番号の調整 | -| [0f9f475](https://github.com/cpprefjp/site/commit/0f9f47544b06f157c39972ad9e2f7d28e274a304) | cpprefjp/fixs:2 | `operator delete` : 一覧の整理 | -| [14f1a2e](https://github.com/cpprefjp/site/commit/14f1a2ea622be0674ca9d977cb02d08d951ee03d) | cpprefjp/fixm:1 | `` : 説明を修正 | -| [549b24e](https://github.com/cpprefjp/site/commit/549b24e254087fe066ec04c189647a895df995f0) | cpprefjp/fixm:1 | `format` : 表の修正 | -| [3fd8e81](https://github.com/cpprefjp/site/commit/3fd8e81e2945ef1acf4bb9b0cd348214e4ffff61) | cpprefjp/fixm:1 | `format` : デバッグ出力例を修正 | -| [6e6d1c5](https://github.com/cpprefjp/site/commit/6e6d1c530a1e90c052394a44d9e1e4a64a6c419b) | cpprefjp/fixm:1 | `move_only_funciton` : `std::function`との違いについて追記 | -| [991f1ac](https://github.com/cpprefjp/site/commit/991f1aca8f13b5d922ae94a2c51cdf043591c870) | cpprefjp/fixm:6 | 整数型比較関数の説明と例の改善 | -| [44ce242](https://github.com/cpprefjp/site/commit/44ce2423fe44bad90a3937cc11b6be83e14fcfac) | cpprefjp/fixm:1 | `to_address` : イテレータからポインタへの変換例の追加 | -| [318a70e](https://github.com/cpprefjp/site/commit/318a70e4d2307d898ab08bd12c9f40258aa0a004), [ebf409b](https://github.com/cpprefjp/site/commit/ebf409bfcb1665f5256addfed394b0b3221817e4) | cpprefjp/fixm:1 | `from_chars` : `to_address`を使用する例を追加 | -| [6a05dbb](https://github.com/cpprefjp/site/commit/6a05dbbaea2d5e7472bd2ff832b2d36fcf520780), [d6efda1](https://github.com/cpprefjp/site/commit/d6efda15a80acb4f8c394c4ea3d970d80a4d2192) | cpprefjp/fixm:1 | `take_view` : bidirectional以下の入力に対する注意を追記 | -| [88c08cc](https://github.com/cpprefjp/site/commit/88c08cc878fdca30b520859de47d8367e91b0e35), [79d7e85](https://github.com/cpprefjp/site/commit/79d7e8577c8b851c97bb295ff6270a8b8f491970), [cf2f9ac](https://github.com/cpprefjp/site/commit/cf2f9aca8e91c46b6f5c05b6152d5533279b356a), [9755c4c](https://github.com/cpprefjp/site/commit/9755c4c685f21f8cfb47980a23f619306afdcbff), [04deaac](https://github.com/cpprefjp/site/commit/04deaac7dfd476246698e5046dffb52e63625c51), [4818ff7](https://github.com/cpprefjp/site/commit/4818ff7a040a83267ebc5ee506299e44ea6195a3), [16e1d97](https://github.com/cpprefjp/site/commit/16e1d9768ef71370827c7cdb4a2a6c7d338d4914), [1c743fb](https://github.com/cpprefjp/site/commit/1c743fb17397e72155bcdc8c3f60f431add22fce), [f81c873](https://github.com/cpprefjp/site/commit/f81c873437dd6933e6a0668ba1b3959051b865b1), [629ccda](https://github.com/cpprefjp/site/commit/629ccda92610146d4e330c73f6cc44cb1977330c) | cpprefjp/addlang:1, cpprefjp/link:1 | 未初期化領域への暗黙的なオブジェクト構築 | -| [7137aae](https://github.com/cpprefjp/site/commit/7137aae806b98ff357fea841b251e65c653255c5) | cpprefjp/fixl:1 | `errc` : LWG Issue 3869対応 | -| [cde470d](https://github.com/cpprefjp/site/commit/cde470d65c8f4cf33adf6a28b5d621b851d42ed0), [0216351](https://github.com/cpprefjp/site/commit/0216351917fda4cb7f2cf6ddec4ad04e9a962c77) | cpprefjp/fixl:1 | `string_view`コンストラクタ : P2499R0対応 | -| [ceb8175](https://github.com/cpprefjp/site/commit/ceb817552e5037e8511165cd17271d2a86b468ca) | cpprefjp/fixl:1 | `string_view` コンストラクタ : LWG Issue 3857対応 | -| [fd8b500](https://github.com/cpprefjp/site/commit/fd8b500a0632722667b1db10070fea4ab2771ec2) | cpprefjp/fixs:1 | `unordered_map::insert_or_assign()` : 微修正 | -| [363b738](https://github.com/cpprefjp/site/commit/363b7385c4de72f884beb642a6bf79279a8a7a04) | cpprefjp/fixm:1 | `split_view` : 説明の改善 | -| [ef831a1](https://github.com/cpprefjp/site/commit/ef831a1bc7916fef42e7d21cc5ecc7a90249d9db) | cpprefjp/fixm:1 | `pair` : piecewise constructionの説明を改善 | -| [bbf0c78](https://github.com/cpprefjp/site/commit/bbf0c78e4950b3cec5fba5986840fcd0064a38da), [abc2598](https://github.com/cpprefjp/site/commit/abc25987eceb7bfea7f0dee74dd39a6239e074b3) | cpprefjp/fixl:1 | `pair`コンストラクタ : `explicit`/`delete`条件の整理 | -| [b240dfd](https://github.com/cpprefjp/site/commit/b240dfdc804d6675c712e38bad9e666d79964225) | cpprefjp/typo:1 | `type_info::operator!=` : `=`が変だったのを修正 | -| [5eaa8ee](https://github.com/cpprefjp/site/commit/5eaa8eebe4f6275b47229ed76bfb655ae73896a6) | cpprefjp/typo:1 | `basic_string::append` : コメントアウトが外れていたのを修正 | -| [3744030](https://github.com/cpprefjp/site/commit/37440305b5e204f34741e3edb9719a7b852bf4f9) | cpprefjp/fixm:1 | `noexcept` : 指定可能な位置について追記 | -| [45cd04b](https://github.com/cpprefjp/site/commit/45cd04b0f7f0abbdb7cfbc314a9354f0bf85b154) | cpprefjp/fixm:1 | `launder()`が必要になる場合の解決コードを削除 | -| [2e52939](https://github.com/cpprefjp/site/commit/2e52939f7e606be73a4e5fdb0fb5689eef9f2c68), [13db5df](https://github.com/cpprefjp/site/commit/13db5df18b405032ace43e3738009cda0f18bfe0), [afc7241](https://github.com/cpprefjp/site/commit/afc7241e8a6dd56adef175e6b1174aa743c93f87) | cpprefjp/fixl:1 | P23227R0とCWG2654について追記 | -| [5e2017d](https://github.com/cpprefjp/site/commit/5e2017d1eb229b78d1ae16d99c4afef381682a58) | cpprefjp/typo:1 | コルーチン : pvalue -> prvalue | -| [90927bc](https://github.com/cpprefjp/site/commit/90927bc3454740d33a8e2933e23ebbc8f3d96ea5) | cpprefjp/fixl:12 | P0718R2の`shared_ptr`のアトミックフリー関数非推奨を適用 | -| [c46ebf4](https://github.com/cpprefjp/site/commit/c46ebf4afd42816c9a9f10d04d668e336cfea25e) | cpprefjp/fixm:1 | `offsetof` : メタ情報の修正 | -| [adf4a90](https://github.com/cpprefjp/site/commit/adf4a90966818e7f3130e2dab70cd63b00d78fd8), [04340ca](https://github.com/cpprefjp/site/commit/04340ca0d5503fcdb9c5c1ec03ac636445f03153) | cpprefjp/addref:4, cpprefjp/fixl:1 | `span` : P2278R4対応 | -| [7d3e69f](https://github.com/cpprefjp/site/commit/7d3e69fd917cb09749aea3855289913420ca5011) | cpprefjp/fixm:1 | 処理型 : VC++バージョン表記リストのアップデート | -| [79605e8](https://github.com/cpprefjp/site/commit/79605e8277108c0de0d0ecf223945a518ad32127), [069e857](https://github.com/cpprefjp/site/commit/069e8574e5043f53c1c8e64faa7d54969e5e7c5f), [ec63307](https://github.com/cpprefjp/site/commit/ec6330712a56da138e4b977ca03476a72fa80801), [fb63802](https://github.com/cpprefjp/site/commit/fb63802526c3daea90356da72e0ed67a8dd05f22), [e19c878](https://github.com/cpprefjp/site/commit/e19c878e156ca64ea7a5b4a4c703f8c79c494bde), [4a6b82e](https://github.com/cpprefjp/site/commit/4a6b82e1fbbf4c8e10b8fe5ed613585ed09ec201), [92d8962](https://github.com/cpprefjp/site/commit/92d89626f7c03750772c8d97b61a28e19a0a73d9), [ea6381e](https://github.com/cpprefjp/site/commit/ea6381e681e5e706f23d38d721cfbfc361003d24), [4e2bdcd](https://github.com/cpprefjp/site/commit/4e2bdcd9d523a6f4c59fd4bdb762e19da36c8cc0), [b2a86cc](https://github.com/cpprefjp/site/commit/b2a86ccbe173e1fbd007d9d0ea07652815f60961), [09c1ad7](https://github.com/cpprefjp/site/commit/09c1ad78bd5be675d94afdc1e49adcaa6ff7ca4d), [c925d35](https://github.com/cpprefjp/site/commit/c925d357c6d192dd1edca8e41f620f33c4a336aa), [3f6f9ce](https://github.com/cpprefjp/site/commit/3f6f9ce56b42ae4ea17dca2ad62f354b38fda974), [02ed11e](https://github.com/cpprefjp/site/commit/02ed11ec6d51486dd32ddc338107c5e383d474ee), [396b2b6](https://github.com/cpprefjp/site/commit/396b2b645a53a32c47038621eb6a4b3042374c45), [e9f6f76](https://github.com/cpprefjp/site/commit/e9f6f76c141d8763627e59d0d59702b45619e55c), [ebae6b7](https://github.com/cpprefjp/site/commit/ebae6b70f005143b4edd3d6003270bf4c2f2328a), [a16938b](https://github.com/cpprefjp/site/commit/a16938b2890659af7e9b366593229419685da7bb), [f2f8993](https://github.com/cpprefjp/site/commit/f2f8993721e5d0bba28ed266f52008a72fe6c862), [00bb047](https://github.com/cpprefjp/site/commit/00bb047d8c8ba716b8df149d4d48e9d8c5719c87), [dbc5cfe](https://github.com/cpprefjp/site/commit/dbc5cfe81d457f717ed99511f72b79d01058a533), [cd41744](https://github.com/cpprefjp/site/commit/cd417442096e21404c93b495684928e7c723f387), [7fc8707](https://github.com/cpprefjp/site/commit/7fc8707529d50ce7434a3e2c012fb8835619360c), [d66df9c](https://github.com/cpprefjp/site/commit/d66df9c2b327ff15e7692c432cdd3f61fb02bed8), [21a2be5](https://github.com/cpprefjp/site/commit/21a2be5d6f6cb36c66283404efb5cd27bd370573) | cpprefjp/addref:24, cpprefjp/fixl:2, cpprefjp/link:5 | `` : P2278R4の機能を追加 | -| [cde8479](https://github.com/cpprefjp/site/commit/cde8479f21e88562f1dc764fa15b1875de5a0232), [4739795](https://github.com/cpprefjp/site/commit/47397958eb92ad9e374f3e5386eca6102d387b45) | cpprefjp/addref:1, cpprefjp/link:1 | `iter_const_reference_t`追加 | -| [e0d67ff](https://github.com/cpprefjp/site/commit/e0d67ff886c95bf2444c6a33d4556735b2ab2faf) | cpprefjp/fixm:2 | `ostringstream`の`str()` 修飾の修正 | -| [5539a02](https://github.com/cpprefjp/site/commit/5539a0217b51ce272b48b1514c7631256927cac0) | cpprefjp/fixl:5 | P2418R2対応 : 関数のインターフェースと事前条件の部分の変更のみ適用 | -| [5ba1413](https://github.com/cpprefjp/site/commit/5ba1413f2dd58d720c5e02db52e4bfd7f2e452b4) | cpprefjp/fixm:1 | `join_view` : `common_range`となる条件の追記 | -| [f2eb447](https://github.com/cpprefjp/site/commit/f2eb44725d784a0b8cb1d2f343178ffe04c392d8), [a3c830c](https://github.com/cpprefjp/site/commit/a3c830c711a9f273eb85e397f730bc40063289c8), [bf5c611](https://github.com/cpprefjp/site/commit/bf5c611427dcc7915ec8a49a6d6cdd962eadcd55), [99a88c1](https://github.com/cpprefjp/site/commit/99a88c1134be17442149de2b693a93f654af17c9), [4e3f803](https://github.com/cpprefjp/site/commit/4e3f803c205c62d5f0d09e3684e12536eaa58704), [e37ef9b](https://github.com/cpprefjp/site/commit/e37ef9b695f6bb5e02f5153a9fa4281980f60e22), [c5d0375](https://github.com/cpprefjp/site/commit/c5d0375ce0f048faf59ce7c6df22e9590de92e45), [953efe6](https://github.com/cpprefjp/site/commit/953efe6f14e067f5c4d51fa0f30e6ff175859d02), [f1b46a1](https://github.com/cpprefjp/site/commit/f1b46a11655c1b1b27faa245f5732a4fd5dd5c81), [fa4faf6](https://github.com/cpprefjp/site/commit/fa4faf6048ec000b7c7fc003ea7b810badea9fae), [0185d03](https://github.com/cpprefjp/site/commit/0185d032cb062bec39b469070735d250cacff810), [dbc7c10](https://github.com/cpprefjp/site/commit/dbc7c10006eeae7a56fd011cdb1ee476a9a4cc17), [1fff32a](https://github.com/cpprefjp/site/commit/1fff32a5344aa196ff9aee04d3115af96d5b2701), [f3e3dbf](https://github.com/cpprefjp/site/commit/f3e3dbf0e4150686401ef06fbb2ad122ac77e561), [afa4259](https://github.com/cpprefjp/site/commit/afa42590107fe0eef866c42ec23624f37ae41f21), [a14d042](https://github.com/cpprefjp/site/commit/a14d042b837ef68612abe6e74371882ba4f9e287), [595b9bb](https://github.com/cpprefjp/site/commit/595b9bb33fe0907ced03e0d5201cdce1c4da87c4), [82ef331](https://github.com/cpprefjp/site/commit/82ef3319985de924be1f0198d05ccaf0d2eb0500), [b950e12](https://github.com/cpprefjp/site/commit/b950e124456e4d4abfc26c91e53ec5c13895dc9e), [01117d7](https://github.com/cpprefjp/site/commit/01117d7bbb901725da0d53a89102f6f37df5dd3e) | cpprefjp/addref:14, cpprefjp/fixl:22 | `` : P2278R4関連を追加 | -| [d8142c9](https://github.com/cpprefjp/site/commit/d8142c96f48d70c18df8b6138b6fbc0dcb5ea867) | cpprefjp/addlang:1, cpprefjp/fixl:1 | 機能テストマクロ追加 | -| [331a036](https://github.com/cpprefjp/site/commit/331a036a791df9df02b66a054ad7f70448fb205d), [46f89bc](https://github.com/cpprefjp/site/commit/46f89bc560d8c35c13641cf89f9dd5eba2774b8a), [8974dd3](https://github.com/cpprefjp/site/commit/8974dd3325a7283cf340c5bc31c7d1e84f0f3fd2) | cpprefjp/addref:1, cpprefjp/fixl:1 | `counted_iterator` : P2259R1対応 | -| [02832a7](https://github.com/cpprefjp/site/commit/02832a7dda2b2f7dc9e56fc5cf306e8bed17e298) | cpprefjp/fixl:3, cpprefjp/link:3 | P2017R1対応 | -| [93bc41b](https://github.com/cpprefjp/site/commit/93bc41bc9ade112bd57283929091f24746bc82c1) | cpprefjp/fixl:1 | P2328R1対応 | -| [10539d4](https://github.com/cpprefjp/site/commit/10539d462cf7325212c96e5620110fdb8a79b115) | cpprefjp/fixm:1 | view : 意味論要件の微修正 | -| [33d6e9a](https://github.com/cpprefjp/site/commit/33d6e9aa95e4f6d02fb700b1d3afa8769b70876c) | cpprefjp/fixm:1 | `generator` : デフォルトアロケータ型の修正 | -| [9a64346](https://github.com/cpprefjp/site/commit/9a64346a2a1d30ebefdbc5136b08e9a8eaa8b5c9) | cpprefjp/fixl:4 | 未初期化メモリに対するアルゴリズム、事前条件追記 | -| [2f67b2a](https://github.com/cpprefjp/site/commit/2f67b2a41bf0aaac87dd465530ed1e7f299ec156) | cpprefjp/fixl:20 | 未初期化メモリに対するアルゴリズム、例外発生時の振る舞いについて追記 | -| [19d47d8](https://github.com/cpprefjp/site/commit/19d47d886e3fad701966c229996b5a6d2dc40a71), [fbfaaeb](https://github.com/cpprefjp/site/commit/fbfaaeb3b76abd124b0afaad2c689ed5e32d159c) | cpprefjp/fixm:2 | `adjacent_find`の動作イメージを付加 | -| [7a0af00](https://github.com/cpprefjp/site/commit/7a0af0077b1553719db531bfbe12275dc5cd60a6) | cpprefjp/fixm:1 | 畳み込み式 : 式種類の参照方法を微調整 | -| [7b90cfd](https://github.com/cpprefjp/site/commit/7b90cfd29f6257e949730a1ba70ca02b0e9d2dd6), [7405b3c](https://github.com/cpprefjp/site/commit/7405b3c3c4c498b3518d52486702eec36bf6e866) | cpprefjp/fixl:1 | `offsetof` : バージョン間の差異などについて追記 | -| [4d5c0ed](https://github.com/cpprefjp/site/commit/4d5c0edfcd79661472afc00a695d017297e4d1d9), [56dc9fa](https://github.com/cpprefjp/site/commit/56dc9faa8b2d540bdbb01f0e4b51f9749922ec45) | cpprefjp/link:32 | osdn.jpのリンクをwebarchiveに差し替え | +| [commit cpprefjp/site, df12b1d] | cpprefjp/fixs:1 | リンク修正 | +| [commit cpprefjp/site, fb89d60, bc12e24, f86e382, 5e7e22e, 84f996b] | cpprefjp/addlang:1, cpprefjp/addref:1, cpprefjp/link:4 | 可変長データを扱うクラスの効率的な`delete` | +| [commit cpprefjp/site, 3a5b2dc] | cpprefjp/fixm:1 | `operator delete[]` : 番号の調整 | +| [commit cpprefjp/site, 0f9f475] | cpprefjp/fixs:2 | `operator delete` : 一覧の整理 | +| [commit cpprefjp/site, 14f1a2e] | cpprefjp/fixm:1 | `` : 説明を修正 | +| [commit cpprefjp/site, 549b24e] | cpprefjp/fixm:1 | `format` : 表の修正 | +| [commit cpprefjp/site, 3fd8e81] | cpprefjp/fixm:1 | `format` : デバッグ出力例を修正 | +| [commit cpprefjp/site, 6e6d1c5] | cpprefjp/fixm:1 | `move_only_funciton` : `std::function`との違いについて追記 | +| [commit cpprefjp/site, 991f1ac] | cpprefjp/fixm:6 | 整数型比較関数の説明と例の改善 | +| [commit cpprefjp/site, 44ce242] | cpprefjp/fixm:1 | `to_address` : イテレータからポインタへの変換例の追加 | +| [commit cpprefjp/site, 318a70e, ebf409b] | cpprefjp/fixm:1 | `from_chars` : `to_address`を使用する例を追加 | +| [commit cpprefjp/site, 6a05dbb, d6efda1] | cpprefjp/fixm:1 | `take_view` : bidirectional以下の入力に対する注意を追記 | +| [commit cpprefjp/site, 88c08cc, 79d7e85, cf2f9ac, 9755c4c, 04deaac, 4818ff7, 16e1d97, 1c743fb, f81c873, 629ccda] | cpprefjp/addlang:1, cpprefjp/link:1 | 未初期化領域への暗黙的なオブジェクト構築 | +| [commit cpprefjp/site, 7137aae] | cpprefjp/fixl:1 | `errc` : LWG Issue 3869対応 | +| [commit cpprefjp/site, cde470d, 0216351] | cpprefjp/fixl:1 | `string_view`コンストラクタ : P2499R0対応 | +| [commit cpprefjp/site, ceb8175] | cpprefjp/fixl:1 | `string_view` コンストラクタ : LWG Issue 3857対応 | +| [commit cpprefjp/site, fd8b500] | cpprefjp/fixs:1 | `unordered_map::insert_or_assign()` : 微修正 | +| [commit cpprefjp/site, 363b738] | cpprefjp/fixm:1 | `split_view` : 説明の改善 | +| [commit cpprefjp/site, ef831a1] | cpprefjp/fixm:1 | `pair` : piecewise constructionの説明を改善 | +| [commit cpprefjp/site, bbf0c78, abc2598] | cpprefjp/fixl:1 | `pair`コンストラクタ : `explicit`/`delete`条件の整理 | +| [commit cpprefjp/site, b240dfd] | cpprefjp/typo:1 | `type_info::operator!=` : `=`が変だったのを修正 | +| [commit cpprefjp/site, 5eaa8ee] | cpprefjp/typo:1 | `basic_string::append` : コメントアウトが外れていたのを修正 | +| [commit cpprefjp/site, 3744030] | cpprefjp/fixm:1 | `noexcept` : 指定可能な位置について追記 | +| [commit cpprefjp/site, 45cd04b] | cpprefjp/fixm:1 | `launder()`が必要になる場合の解決コードを削除 | +| [commit cpprefjp/site, 2e52939, 13db5df, afc7241] | cpprefjp/fixl:1 | P23227R0とCWG2654について追記 | +| [commit cpprefjp/site, 5e2017d] | cpprefjp/typo:1 | コルーチン : pvalue -> prvalue | +| [commit cpprefjp/site, 90927bc] | cpprefjp/fixl:12 | P0718R2の`shared_ptr`のアトミックフリー関数非推奨を適用 | +| [commit cpprefjp/site, c46ebf4] | cpprefjp/fixm:1 | `offsetof` : メタ情報の修正 | +| [commit cpprefjp/site, adf4a90, 04340ca] | cpprefjp/addref:4, cpprefjp/fixl:1 | `span` : P2278R4対応 | +| [commit cpprefjp/site, 7d3e69f] | cpprefjp/fixm:1 | 処理型 : VC++バージョン表記リストのアップデート | +| [commit cpprefjp/site, 79605e8, 069e857, ec63307, fb63802, e19c878, 4a6b82e, 92d8962, ea6381e, 4e2bdcd, b2a86cc, 09c1ad7, c925d35, 3f6f9ce, 02ed11e, 396b2b6, e9f6f76, ebae6b7, a16938b, f2f8993, 00bb047, dbc5cfe, cd41744, 7fc8707, d66df9c, 21a2be5] | cpprefjp/addref:24, cpprefjp/fixl:2, cpprefjp/link:5 | `` : P2278R4の機能を追加 | +| [commit cpprefjp/site, cde8479, 4739795] | cpprefjp/addref:1, cpprefjp/link:1 | `iter_const_reference_t`追加 | +| [commit cpprefjp/site, e0d67ff] | cpprefjp/fixm:2 | `ostringstream`の`str()` 修飾の修正 | +| [commit cpprefjp/site, 5539a02] | cpprefjp/fixl:5 | P2418R2対応 : 関数のインターフェースと事前条件の部分の変更のみ適用 | +| [commit cpprefjp/site, 5ba1413] | cpprefjp/fixm:1 | `join_view` : `common_range`となる条件の追記 | +| [commit cpprefjp/site, f2eb447, a3c830c, bf5c611, 99a88c1, 4e3f803, e37ef9b, c5d0375, 953efe6, f1b46a1, fa4faf6, 0185d03, dbc7c10, 1fff32a, f3e3dbf, afa4259, a14d042, 595b9bb, 82ef331, b950e12, 01117d7] | cpprefjp/addref:14, cpprefjp/fixl:22 | `` : P2278R4関連を追加 | +| [commit cpprefjp/site, d8142c9] | cpprefjp/addlang:1, cpprefjp/fixl:1 | 機能テストマクロ追加 | +| [commit cpprefjp/site, 331a036, 46f89bc, 8974dd3] | cpprefjp/addref:1, cpprefjp/fixl:1 | `counted_iterator` : P2259R1対応 | +| [commit cpprefjp/site, 02832a7] | cpprefjp/fixl:3, cpprefjp/link:3 | P2017R1対応 | +| [commit cpprefjp/site, 93bc41b] | cpprefjp/fixl:1 | P2328R1対応 | +| [commit cpprefjp/site, 10539d4] | cpprefjp/fixm:1 | view : 意味論要件の微修正 | +| [commit cpprefjp/site, 33d6e9a] | cpprefjp/fixm:1 | `generator` : デフォルトアロケータ型の修正 | +| [commit cpprefjp/site, 9a64346] | cpprefjp/fixl:4 | 未初期化メモリに対するアルゴリズム、事前条件追記 | +| [commit cpprefjp/site, 2f67b2a] | cpprefjp/fixl:20 | 未初期化メモリに対するアルゴリズム、例外発生時の振る舞いについて追記 | +| [commit cpprefjp/site, 19d47d8, fbfaaeb] | cpprefjp/fixm:2 | `adjacent_find`の動作イメージを付加 | +| [commit cpprefjp/site, 7a0af00] | cpprefjp/fixm:1 | 畳み込み式 : 式種類の参照方法を微調整 | +| [commit cpprefjp/site, 7b90cfd, 7405b3c] | cpprefjp/fixl:1 | `offsetof` : バージョン間の差異などについて追記 | +| [commit cpprefjp/site, 4d5c0ed, 56dc9fa] | cpprefjp/link:32 | osdn.jpのリンクをwebarchiveに差し替え | ## [tetsurom](https://github.com/tetsurom) | コミット | タグ | 説明 | |----------|------|------| -| [5b0dfcb](https://github.com/cpprefjp/site/commit/5b0dfcbb75706d0b4219676187e0851178825d0d) | cpprefjp/fixl:1 | `` C++23対応(ヘッダーページのみ) | -| [6634d85](https://github.com/cpprefjp/site/commit/6634d8587f5b9dbb4dc46f1c792f5d3246fd3fea), [8b51996](https://github.com/cpprefjp/site/commit/8b51996ff3b9a4b68106d943313e89569da65069), [8d68f98](https://github.com/cpprefjp/site/commit/8d68f98f82d54011721eac4667dd508b81c457ac) | cpprefjp/addref:2, cpprefjp/fixl:1 | `repeat_view`の説明を追加 | +| [commit cpprefjp/site, 5b0dfcb] | cpprefjp/fixl:1 | `` C++23対応(ヘッダーページのみ) | +| [commit cpprefjp/site, 6634d85, 8b51996, 8d68f98] | cpprefjp/addref:2, cpprefjp/fixl:1 | `repeat_view`の説明を追加 | ## [tshino](https://github.com/tshino) | コミット | タグ | 説明 | |----------|------|------| -| [c77af98](https://github.com/cpprefjp/site/commit/c77af98f9553e4515f55edd53f96e65f1c58dc22) | cpprefjp/typo:1 | Fix typo | -| [58c137d](https://github.com/cpprefjp/site/commit/58c137d95c790b4afa37945a0b9cec9236cc2dc3), [68eb5ba](https://github.com/cpprefjp/site/commit/68eb5baa77245d37dd583d936ec89998e7f7a6a5), [ceb813e](https://github.com/cpprefjp/site/commit/ceb813ec5fdcfcbf3ef5205d2e0bf4f52e83337d) | cpprefjp/fixm:4, cpprefjp/link:2 | `shift_left`/`shift_right`で負数を指定可能と読める記述の修正 | -| [05ee2e6](https://github.com/cpprefjp/site/commit/05ee2e647ca2e59498eb1743056925969eeb6e7f) | cpprefjp/fixm:1 | `std::exchange`が常にムーブ代入するような記述の修正 | +| [commit cpprefjp/site, c77af98] | cpprefjp/typo:1 | Fix typo | +| [commit cpprefjp/site, 58c137d, 68eb5ba, ceb813e] | cpprefjp/fixm:4, cpprefjp/link:2 | `shift_left`/`shift_right`で負数を指定可能と読める記述の修正 | +| [commit cpprefjp/site, 05ee2e6] | cpprefjp/fixm:1 | `std::exchange`が常にムーブ代入するような記述の修正 | ## [acd1034](https://github.com/acd1034) | コミット | タグ | 説明 | |----------|------|------| -| [fb27730](https://github.com/cpprefjp/site/commit/fb277307e6e97f3406fcdfcc957b6c77cb11fb45), [3e0c51d](https://github.com/cpprefjp/site/commit/3e0c51d0d2f8c8607a57857902cd902236d01912) | cpprefjp/fixm:1 | `optional.or_else`: メソッドチェインとしての使い方を追加 | -| [dc598a2](https://github.com/cpprefjp/site/commit/dc598a2bf6edb642f7fce7599b01aa9b29550568) | cpprefjp/fixm:1 | オリジナル書式を定義する例の参照修飾を修正 | -| [313f64e](https://github.com/cpprefjp/site/commit/313f64e6b708f264cb2d24e2ead385d5c6e65555) | cpprefjp/fixl:1 | fmt-iter-forが未規定の型であることを明示化 | +| [commit cpprefjp/site, fb27730, 3e0c51d] | cpprefjp/fixm:1 | `optional.or_else`: メソッドチェインとしての使い方を追加 | +| [commit cpprefjp/site, dc598a2] | cpprefjp/fixm:1 | オリジナル書式を定義する例の参照修飾を修正 | +| [commit cpprefjp/site, 313f64e] | cpprefjp/fixl:1 | fmt-iter-forが未規定の型であることを明示化 | ## [tomolatoon](https://github.com/tomolatoon) | コミット | タグ | 説明 | |----------|------|------| -| [b2f6285](https://github.com/cpprefjp/site/commit/b2f6285e94de2248a57d9dedff0fb64677e15227), [d9d912a](https://github.com/cpprefjp/site/commit/d9d912ab5e77403cbdf5d93d51b2b66e887d4b8f), [8cc4361](https://github.com/cpprefjp/site/commit/8cc4361ae1ba943d065a624d866ae3f526a48894), [653081e](https://github.com/cpprefjp/site/commit/653081e759e041f845ec7efa22dad18ab81635ca) | cpprefjp/fixs:2, cpprefjp/link:2, cpprefjp/fixl:23, cpprefjp/addref:14 | P2165R4, P2255R2, P2321R2 | +| [commit cpprefjp/site, b2f6285, d9d912a, 8cc4361, 653081e] | cpprefjp/fixs:2, cpprefjp/link:2, cpprefjp/fixl:23, cpprefjp/addref:14 | P2165R4, P2255R2, P2321R2 | ## [akinomyoga](https://github.com/akinomyoga) | コミット | タグ | 説明 | |----------|------|------| -| [05c1f4f](https://github.com/cpprefjp/site/commit/05c1f4f83c8d0036ead5237667fb68c2c8217b4d) | cpprefjp/fixm:1 | `time_t`: 多くの実装で符号付き | +| [commit cpprefjp/site, 05c1f4f] | cpprefjp/fixm:1 | `time_t`: 多くの実装で符号付き | ## [yumetodo](https://github.com/yumetodo) | コミット | タグ | 説明 | |----------|------|------| -| [4136995](https://github.com/cpprefjp/site/commit/41369956550951a19b948397109d022c383e7f3d) | cpprefjp/fixm:1 | feat: `std::bind`でメンバー関数を呼び出す方法を例に追加 | -| [141e98e](https://github.com/cpprefjp/site/commit/141e98ef7802194cbe801d5c38a0653545de0e7a) | cpprefjp/link:1 | chore: `std:::size` -> `std::rages::size`にリンクする | +| [commit cpprefjp/site, 4136995] | cpprefjp/fixm:1 | feat: `std::bind`でメンバー関数を呼び出す方法を例に追加 | +| [commit cpprefjp/site, 141e98e] | cpprefjp/link:1 | chore: `std:::size` -> `std::rages::size`にリンクする | ## [HansRobo](https://github.com/HansRobo) | コミット | タグ | 説明 | |----------|------|------| -| [40638a6](https://github.com/cpprefjp/site/commit/40638a63cdf1948f5f77277d07f504a34e7f7974) | cpprefjp/typo:1 | fix typo in constexpr_lambda.md | +| [40638a6 | cpprefjp/typo:1 | fix typo in constexpr_lambda.md | ## [h-sao](https://github.com/h-sao) | コミット | タグ | 説明 | |----------|------|------| -| [44a8e47](https://github.com/cpprefjp/site/commit/44a8e478d43dcbbc5711c05570cf15be16a451f1) | cpprefjp/compiler:1 | Updated ICC ver for C++20 | -| [f91a124](https://github.com/cpprefjp/site/commit/f91a124e156859b310f53ef062117ae93c9c2ec2), [5684a8d](https://github.com/cpprefjp/site/commit/5684a8d9526d13ddee84d6a2468b973081e2b041) | cpprefjp/fixm:1 | Updated ICX title for C++23 | -| [d63dd85](https://github.com/cpprefjp/site/commit/d63dd85d2a3389d8b9f95829778f041b49eba2e1) | cpprefjp/link:1 | VCのC++23機能がMS公式サイトに載ったのでリンクを修正した | -| [e9d068b](https://github.com/cpprefjp/site/commit/e9d068b7c23c0d32bdd8ce872aac2b35a40d806a) | cpprefjp/compiler:3 | Updated Implimentation status for VC++ C++23 | -| [1e3d056](https://github.com/cpprefjp/site/commit/1e3d056d8a587c92a2ce8f4e6c95c5bbad667fbe) | cpprefjp/compiler:5 | Updated supported c++23 by ICX (~ R2201R1) | -| [876f77c](https://github.com/cpprefjp/site/commit/876f77c7c909f2972ecdc95333a1f86896ea091f) | cpprefjp/compiler:1 | Update implementation-status.md for C++20 of ICC | -| [67a300d](https://github.com/cpprefjp/site/commit/67a300dab35d0679a014d96c6e2669903a5012e2) | cpprefjp/compiler:5 | Updated implimentation status of Clang about c++23 | -| [f0d163c](https://github.com/cpprefjp/site/commit/f0d163cc2a32541706d85087b60957b133e87288) | cpprefjp/compiler:8 | Updated implimentation status of ICC about c++20 | -| [1326e68](https://github.com/cpprefjp/site/commit/1326e68a7dc70b04e698f1ce35580342c0c544e2) | cpprefjp/compiler:1 | Updated GCC support version for C++23 | -| [beb148e](https://github.com/cpprefjp/site/commit/beb148edbf96be6eb9a31ee14b58a886db3e4e99) | cpprefjp/compiler:17 | Updated implimentation status of ICX about c++23 | +| [commit cpprefjp/site, 44a8e47] | cpprefjp/compiler:1 | Updated ICC ver for C++20 | +| [commit cpprefjp/site, f91a124, 5684a8d] | cpprefjp/fixm:1 | Updated ICX title for C++23 | +| [commit cpprefjp/site, d63dd85] | cpprefjp/link:1 | VCのC++23機能がMS公式サイトに載ったのでリンクを修正した | +| [commit cpprefjp/site, e9d068b] | cpprefjp/compiler:3 | Updated Implimentation status for VC++ C++23 | +| [commit cpprefjp/site, 1e3d056] | cpprefjp/compiler:5 | Updated supported c++23 by ICX (~ R2201R1) | +| [commit cpprefjp/site, 876f77c] | cpprefjp/compiler:1 | Update implementation-status.md for C++20 of ICC | +| [commit cpprefjp/site, 67a300d] | cpprefjp/compiler:5 | Updated implimentation status of Clang about c++23 | +| [commit cpprefjp/site, f0d163c] | cpprefjp/compiler:8 | Updated implimentation status of ICC about c++20 | +| [commit cpprefjp/site, 1326e68] | cpprefjp/compiler:1 | Updated GCC support version for C++23 | +| [commit cpprefjp/site, beb148e] | cpprefjp/compiler:17 | Updated implimentation status of ICX about c++23 | ## [yutopp](https://github.com/yutopp) | コミット | タグ | 説明 | |----------|------|------| -| [20ed53d](https://github.com/cpprefjp/site/commit/20ed53df537f4456bc971969411f1277bbeb22f0) | cpprefjp/typo:1 | typo/コンパイルエラーの修正: `shared_mutex`→`shared_timed_mutex` | +| [commit cpprefjp/site, 20ed53d] | cpprefjp/typo:1 | typo/コンパイルエラーの修正: `shared_mutex`→`shared_timed_mutex` | ## [sakujiro-inagaki](https://github.com/sakujiro-inagaki) | コミット | タグ | 説明 | |----------|------|------| -| [9116a93](https://github.com/cpprefjp/site/commit/9116a9393d60707981347afccd127578fd47f374) | cpprefjp/fixm:1 | variantが追加の動的メモリ確保を行わないことを説明する文を修正 | +| [commit cpprefjp/site, 9116a93] | cpprefjp/fixm:1 | variantが追加の動的メモリ確保を行わないことを説明する文を修正 | ## [norisio](https://github.com/norisio) | コミット | タグ | 説明 | |----------|------|------| -| [0af0c3c](https://github.com/cpprefjp/site/commit/0af0c3caadb5b187475d04a5ecb886a970376506) | cpprefjp/typo:1 | allocator.md backquoteのtypoを修正 | +| [commit cpprefjp/site, 0af0c3c] | cpprefjp/typo:1 | allocator.md backquoteのtypoを修正 | ## [kamitani08](https://github.com/kamitani08) | コミット | タグ | 説明 | |----------|------|------| -| [833f22b](https://github.com/cpprefjp/site/commit/833f22bde02b45e122bd746d52c58f223ef4f81f) | cpprefjp/typo:1 | Update guaranteed_copy_elision.md | +| [commit cpprefjp/site, 833f22b] | cpprefjp/typo:1 | Update guaranteed_copy_elision.md | ## [cupro29](https://github.com/cupro29) | コミット | タグ | 説明 | |----------|------|------| -| [38aa278](https://github.com/cpprefjp/site/commit/38aa278067c5ee2a63926bd41401b57d0ab27eb5) | cpprefjp/typo:1 | fix typo | +| [commit cpprefjp/site, 38aa278] | cpprefjp/typo:1 | fix typo | ## [nu4nu](https://github.com/nu4nu) | コミット | タグ | 説明 | |----------|------|------| -| [a13c86a](https://github.com/cpprefjp/site/commit/a13c86a40039bef44b954d1f33455a41fc1eaab9) | cpprefjp/link:3 | `numeric_limits`: Add and fix links to `cfloat` | -| [4816cf7](https://github.com/cpprefjp/site/commit/4816cf7b669210665378bf3cdf43dd1b6b2cfa70) | cpprefjp/fixm:2 | `numeric_limits`: Fix description of max/min_exponent | +| [commit cpprefjp/site, a13c86a] | cpprefjp/link:3 | `numeric_limits`: Add and fix links to `cfloat` | +| [commit cpprefjp/site, 4816cf7] | cpprefjp/fixm:2 | `numeric_limits`: Fix description of max/min_exponent | ## [ToruNiina](https://github.com/ToruNiina) | コミット | タグ | 説明 | |----------|------|------| -| [7606d8f](https://github.com/cpprefjp/site/commit/7606d8fa6cf0fe57dc94718210b69cfd269a7f40) | cpprefjp/typo:1 | fix typo in cpp20/coroutines | -| [08a97ea](https://github.com/cpprefjp/site/commit/08a97ea65ad85cbb646cd58753e5860600ff337f) | cpprefjp/fixs:1 | typo: `make_reverse_iterator`の言語バージョン | +| [commit cpprefjp/site, 7606d8f] | cpprefjp/typo:1 | fix typo in cpp20/coroutines | +| [commit cpprefjp/site, 08a97ea] | cpprefjp/fixs:1 | typo: `make_reverse_iterator`の言語バージョン | ## [sutatoruta](https://github.com/sutatoruta) | コミット | タグ | 説明 | |----------|------|------| -| [7580c17](https://github.com/cpprefjp/site/commit/7580c17863c0ba80bef67d6a2b39119587905da7) | cpprefjp/typo:9 | typo修正 | -| [ae6ac7c](https://github.com/cpprefjp/site/commit/ae6ac7c9b792b8e3fb6fb2ba9bbeab01648740cb) | cpprefjp/fixm:1 | random.mdの説明文とコードの不整合を修正 | +| [commit cpprefjp/site, 7580c17] | cpprefjp/typo:9 | typo修正 | +| [commit cpprefjp/site, ae6ac7c] | cpprefjp/fixm:1 | random.mdの説明文とコードの不整合を修正 | ## [toru-fukaya](https://github.com/toru-fukaya) | コミット | タグ | 説明 | |----------|------|------| -| [dd8a50d](https://github.com/cpprefjp/site/commit/dd8a50d89d7eaa04ca9511109342e11ff990e1fb) | cpprefjp/fixm:1 | クラステンプレートの型推論を回避する例を修正 | +| [commit cpprefjp/site, dd8a50d] | cpprefjp/fixm:1 | クラステンプレートの型推論を回避する例を修正 | ## [kenichiice](https://github.com/kenichiice) | コミット | タグ | 説明 | |----------|------|------| -| [da669da](https://github.com/cpprefjp/site/commit/da669daebd77e3551c2bd9f68bcd745c0205981a) | cpprefjp/fixm:1 | `filesystem_error`の名前空間を修正 | -| [86bab47](https://github.com/cpprefjp/site/commit/86bab47aa01fce293636c43725a8d0d017f47c06) | cpprefjp/fixs:1 | コメントの誤りを修正 | -| [6366c71](https://github.com/cpprefjp/site/commit/6366c71c487dcdf10bbf224db35a5b3bbc4d3c3f) | cpprefjp/fixs:1 | `chrono`/`time_point`/`op_minus`のコメントを修正 | -| [592119b](https://github.com/cpprefjp/site/commit/592119b916a6fd6c2559f8f2f35b896bc4abdd4a) | cpprefjp/fixl:2 | `allocator`: C++20での`size_type`と`difference_type`の扱いを修正 | +| [commit cpprefjp/site, da669da] | cpprefjp/fixm:1 | `filesystem_error`の名前空間を修正 | +| [commit cpprefjp/site, 86bab47] | cpprefjp/fixs:1 | コメントの誤りを修正 | +| [commit cpprefjp/site, 6366c71] | cpprefjp/fixs:1 | `chrono`/`time_point`/`op_minus`のコメントを修正 | +| [commit cpprefjp/site, 592119b] | cpprefjp/fixl:2 | `allocator`: C++20での`size_type`と`difference_type`の扱いを修正 | ## [grafi-tt](https://github.com/grafi-tt) | コミット | タグ | 説明 | |----------|------|------| -| [3c6b49c](https://github.com/cpprefjp/site/commit/3c6b49c2e77dbe6621c285238164fda96fef1c1f) | cpprefjp/link:1 | `basic_filebuf`に`fstream`ヘッダへのリンクを追加 | -| [fb9bf3a](https://github.com/cpprefjp/site/commit/fb9bf3a994183126c8e0bde4f49c4738dacb1daa), [a3cf8a4](https://github.com/cpprefjp/site/commit/a3cf8a41e6d89778b12af4a438e40d1b1f52b673) | cpprefjp/addref:7, cpprefjp/fixl:1, cpprefjp/link:57 | `stringstream`関連のページ作成および、C++20での効率化について参照追加 | -| [c1346e3](https://github.com/cpprefjp/site/commit/c1346e39c869eddfdd51c5154b6c8dea1da75cc8) | cpprefjp/typo:1 | `fetch_sub` の typo 修正 | +| [commit cpprefjp/site, 3c6b49c] | cpprefjp/link:1 | `basic_filebuf`に`fstream`ヘッダへのリンクを追加 | +| [commit cpprefjp/site, fb9bf3a, a3cf8a4] | cpprefjp/addref:7, cpprefjp/fixl:1, cpprefjp/link:57 | `stringstream`関連のページ作成および、C++20での効率化について参照追加 | +| [commit cpprefjp/site, c1346e3] | cpprefjp/typo:1 | `fetch_sub` の typo 修正 | ## [g-suizu](https://github.com/g-suizu) | コミット | タグ | 説明 | |----------|------|------| -| [94b0c91](https://github.com/cpprefjp/site/commit/94b0c912176e85c536b6a3d306995ee9da3c4590) | cpprefjp/fixl:1 | 古い表記を修正 | +| [commit cpprefjp/site, 94b0c91] | cpprefjp/fixl:1 | 古い表記を修正 | ## [komori-n](https://github.com/komori-n) | コミット | タグ | 説明 | |----------|------|------| -| [c3f3f2c](https://github.com/cpprefjp/site/commit/c3f3f2cf06824af6c4548e63bd2155ce9328fc07) | cpprefjp/typo:1 | `remove` の typo 修正 | -| [97b792b](https://github.com/cpprefjp/site/commit/97b792b514201c2ad5a52a7e29c0220ec0b53110) | cpprefjp/fixm:1 | `ranges::swap_ranges` の `swap` 回数が正しくない問題を修正 | -| [0778710](https://github.com/cpprefjp/site/commit/0778710e5a3cbbead54b7a77e962b86061e37c69) | cpprefjp/fixm:1 | `swap_ranges` のループ回数が正しくない問題を修正 | +| [commit cpprefjp/site, c3f3f2c] | cpprefjp/typo:1 | `remove` の typo 修正 | +| [commit cpprefjp/site, 97b792b] | cpprefjp/fixm:1 | `ranges::swap_ranges` の `swap` 回数が正しくない問題を修正 | +| [commit cpprefjp/site, 0778710] | cpprefjp/fixm:1 | `swap_ranges` のループ回数が正しくない問題を修正 | ## [sf624](https://github.com/sf624) | コミット | タグ | 説明 | |----------|------|------| -| [1ac7d12](https://github.com/cpprefjp/site/commit/1ac7d1265a38e8965fdb0c05d250aa50787c71ea) | cpprefjp/fixm:2 | `std::map`の`operator[]`の記述を修正 | -| [206dcff](https://github.com/cpprefjp/site/commit/206dcffbd83c1b4e070233ee321bbe16b8bad024) | cpprefjp/fixm:1 | fix: `unordered_map`の`operator[]`の例外仕様を修正 | +| [commit cpprefjp/site, 1ac7d12] | cpprefjp/fixm:2 | `std::map`の`operator[]`の記述を修正 | +| [commit cpprefjp/site, 206dcff] | cpprefjp/fixm:1 | fix: `unordered_map`の`operator[]`の例外仕様を修正 | ## [yknishidate](https://github.com/yknishidate) | コミット | タグ | 説明 | |----------|------|------| -| [e279f87](https://github.com/cpprefjp/site/commit/e279f872bff98b0808beec6ee224d5c7ea009811) | cpprefjp/fixm:1 | 生成した乱数のimplicit conversionを削除 | -| [194a6b7](https://github.com/cpprefjp/site/commit/194a6b77fcf421e024c1838300c6522302775323), [20a027a](https://github.com/cpprefjp/site/commit/20a027aad1db4757d4cbed18de465c1af86c3403) | cpprefjp/typo:2 | fix typo | -| [e3a4106](https://github.com/cpprefjp/site/commit/e3a410686a00c48fe624311ba1d358694868550d) | cpprefjp/typo:1 | fix spell "generetor" | -| [852dd81](https://github.com/cpprefjp/site/commit/852dd814b1c207fbd7d786862ad1f7647b7e7f47) | tool/improves:1 | add "generetor" to NG words | -| [4838b94](https://github.com/cpprefjp/site/commit/4838b94398173fdae766f945fbcf2b2a2c42b088) | cpprefjp/typo:1 | fix closing parenthesis | -| [113c185](https://github.com/cpprefjp/site/commit/113c185a8acc00babf4598c577096b54658c1f0b) | cpprefjp/typo:1 | fix spell "voaltile" | -| [47177bf](https://github.com/cpprefjp/site/commit/47177bf7988941985c80deeaba8bcd4b039af148) | tool/improves:1 | add "voaltile" to NG words | -| [0a11f21](https://github.com/cpprefjp/site/commit/0a11f21c6c0606967a6211c296348eb9db0d96f5) | cpprefjp/typo:1 | fix spell "opreator" | -| [fb23442](https://github.com/cpprefjp/site/commit/fb234424f7a04f94227408b335b855e9a1b6a427) | tool/improves:1 | add "opreator" to NG words | -| [6845c65](https://github.com/cpprefjp/site/commit/6845c65b8cea233da6b0a42f4fd37750b81459f6) | cpprefjp/typo:1 | fix spell "swtich" | -| [dc16deb](https://github.com/cpprefjp/site/commit/dc16deb55142f824ce896fb30e495ce73536a83e) | tool/improves:1 | add "swtich" to NG words | -| [d6ce50d](https://github.com/cpprefjp/site/commit/d6ce50de34c3e648c4e75d0343149d02b6ef4398) | cpprefjp/fixs:1 | fix spell "namespase" | -| [499d430](https://github.com/cpprefjp/site/commit/499d43030eeffe6193d3a4b90f723477cf98b3e3) | tool/improves:1 | add "namespase" to NG words | -| [082b914](https://github.com/cpprefjp/site/commit/082b914d32b5d5baf063d4c1419979063ed1dd6c) | cpprefjp/typo:1 | fix spell "concpet" | -| [2e6e172](https://github.com/cpprefjp/site/commit/2e6e1720de6ffcb5116835bf6c73060b98580fb4) | tool/improves:1 | add "concpet" to NG words | +| [commit cpprefjp/site, e279f87] | cpprefjp/fixm:1 | 生成した乱数のimplicit conversionを削除 | +| [commit cpprefjp/site, 194a6b7, 20a027a] | cpprefjp/typo:2 | fix typo | +| [commit cpprefjp/site, e3a4106] | cpprefjp/typo:1 | fix spell "generetor" | +| [commit cpprefjp/site, 852dd81] | tool/improves:1 | add "generetor" to NG words | +| [commit cpprefjp/site, 4838b94] | cpprefjp/typo:1 | fix closing parenthesis | +| [commit cpprefjp/site, 113c185] | cpprefjp/typo:1 | fix spell "voaltile" | +| [commit cpprefjp/site, 47177bf] | tool/improves:1 | add "voaltile" to NG words | +| [commit cpprefjp/site, 0a11f21] | cpprefjp/typo:1 | fix spell "opreator" | +| [commit cpprefjp/site, fb23442] | tool/improves:1 | add "opreator" to NG words | +| [commit cpprefjp/site, 6845c65] | cpprefjp/typo:1 | fix spell "swtich" | +| [commit cpprefjp/site, dc16deb] | tool/improves:1 | add "swtich" to NG words | +| [commit cpprefjp/site, d6ce50d] | cpprefjp/fixs:1 | fix spell "namespase" | +| [commit cpprefjp/site, 499d430] | tool/improves:1 | add "namespase" to NG words | +| [commit cpprefjp/site, 082b914] | cpprefjp/typo:1 | fix spell "concpet" | +| [commit cpprefjp/site, 2e6e172] | tool/improves:1 | add "concpet" to NG words | ## [ROCKTAKEY](https://github.com/ROCKTAKEY) | コミット | タグ | 説明 | |----------|------|------| -| [4d8a7ea](https://github.com/cpprefjp/site/commit/4d8a7ea19cc2b3942b7f81e8ff3bb000a9e894bb) | cpprefjp/fixs:1 | start_editing: 特殊文字へ変換される前の文字列を表示するよう修正 | -| [2c7cf5e](https://github.com/cpprefjp/site/commit/2c7cf5e6f86de685aca92bd133c4be459df95ec7) | cpprefjp/fixs:1 | working_style: 型修飾のスタイルの一覧を等幅フォントで表示するよう修正 | -| [5b7be4d](https://github.com/boostjp/site/commit/5b7be4df3346979f242b50973fa621fe8780048b) | boostjp/link:1 | boostjpのメンバーへのリンクのミスを修正 | -| [dd67365](https://github.com/boostjp/site/commit/dd6736568d8619240d2362262a35f5787000040c) | boostjp/fixm:1 | 「編集に際してのその他の方針、ガイドライン」の項を追加 | -| [eddaf80](https://github.com/boostjp/site/commit/eddaf8047692547c58a205089b8c0756c4b1c5d8) | boostjp/typo:1 | 誤字を修正 | -| [0bb41b2](https://github.com/boostjp/site/commit/0bb41b2f7b6ffb6d2b5019a1271615297b477340) | boostjp/link:1 | `std::optional`と`std::expected`へのリンクを追加 | -| [3b69175](https://github.com/boostjp/site/commit/3b69175def18230615ea6c19bf63ac2427baae60) | boostjp/link:1 | `std::for_each`などへのリンクを追加 | -| [4f2591d](https://github.com/boostjp/site/commit/4f2591d40d878627430db880d9bdedaf6e6c82e2) | boostjp/link:1 | コンパイル時アサートへのリンクを追加 | -| [a9934e8](https://github.com/boostjp/site/commit/a9934e8743c022b00a5ddcaa026d22b2bd385f0a) | boostjp/link:1 | `std::unordered_map`、`std::unordered_set`へのリンクを追加 | -| [5607df1](https://github.com/boostjp/site/commit/5607df1b4672b0a573980043313e3fb693996dd5) | boostjp/link:1 | `std::variant`へのリンクを追加 | +| [commit cpprefjp/site, 4d8a7ea] | cpprefjp/fixs:1 | start_editing: 特殊文字へ変換される前の文字列を表示するよう修正 | +| [commit cpprefjp/site, 2c7cf5e] | cpprefjp/fixs:1 | working_style: 型修飾のスタイルの一覧を等幅フォントで表示するよう修正 | +| [commit boostjp/site, 5b7be4d] | boostjp/link:1 | boostjpのメンバーへのリンクのミスを修正 | +| [commit boostjp/site, dd67365] | boostjp/fixm:1 | 「編集に際してのその他の方針、ガイドライン」の項を追加 | +| [commit boostjp/site, eddaf80] | boostjp/typo:1 | 誤字を修正 | +| [commit boostjp/site, 0bb41b2] | boostjp/link:1 | `std::optional`と`std::expected`へのリンクを追加 | +| [commit boostjp/site, 3b69175] | boostjp/link:1 | `std::for_each`などへのリンクを追加 | +| [commit boostjp/site, 4f2591d] | boostjp/link:1 | コンパイル時アサートへのリンクを追加 | +| [commit boostjp/site, a9934e8] | boostjp/link:1 | `std::unordered_map`、`std::unordered_set`へのリンクを追加 | +| [commit boostjp/site, 5607df1] | boostjp/link:1 | `std::variant`へのリンクを追加 | ## [Reputeless](https://github.com/Reputeless) | コミット | タグ | 説明 | |----------|------|------| -| [c9a543d](https://github.com/cpprefjp/site/commit/c9a543d972fa76272af7350fe9a3af9e571ab42c) | cpprefjp/fixm:6 | `ranges::less` 等のサンプルコードのコンパイルエラーを修正 | +| [commit cpprefjp/site, c9a543d] | cpprefjp/fixm:6 | `ranges::less` 等のサンプルコードのコンパイルエラーを修正 | ## [KisaragiEffective](https://github.com/KisaragiEffective) | コミット | タグ | 説明 | |----------|------|------| -| [3021561](https://github.com/cpprefjp/site/commit/3021561ee5b45ef4b53eed34d4207d0ae946888d) | cpprefjp/typo:1 | ICXのリンクラベルを修正しました | +| [commit cpprefjp/site, 3021561] | cpprefjp/typo:1 | ICXのリンクラベルを修正しました | -## [suzuki-kei](https://github.com/cpprefjp/site/commits?author=suzuki-kei) +## [suzuki-kei](https://github.com/suzuki-kei) | コミット | タグ | 説明 | |----------|------|------| -| [7e37ab2](https://github.com/cpprefjp/site/commit/7e37ab27d5f03221181f8282d1385efe68658864) | cpprefjp/typo:1 | typo を修正: "スタンダードレイアウト型型" -> "スタンダードレイアウト型" | +| [commit cpprefjp/site, 7e37ab2] | cpprefjp/typo:1 | typo を修正: "スタンダードレイアウト型型" -> "スタンダードレイアウト型" | diff --git a/start_editing/contribution_stats_2024.md b/start_editing/contribution_stats_2024.md new file mode 100644 index 0000000000..26b3754481 --- /dev/null +++ b/start_editing/contribution_stats_2024.md @@ -0,0 +1,691 @@ +# 2024年 貢献ポイント +2023年12月から2024年11月を対象期間として、貢献ポイントを集計する。 + + +## [yumetodo](https://github.com/yumetodo) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, 56eaf74] | tool/updatelib:1 | fix(ci): ripgrep 14.0.3 | +| [commit cpprefjp/site, 2da58ef] | cpprefjp/fixl:1 | fix: P2718R0 の作用にC++11の範囲forの解説から言及する | +| [commit cpprefjp/site, 55d6e13] | tool/updatelib:3 | fix: update checkout,setup-python,cache | +| [commit cpprefjp/site, f49fe99, ba8fae4] | | fix(ci): 結果をartifactに保存してみる (revert) | +| [commit cpprefjp/site, deea684] | tool/improvel:1 | fix(ci): github issue作成をpythonで行う | +| [commit cpprefjp/site, 2b7c282] | tool/improvem:1 | chore(ci): github issue作成時のrequest headerにapi versionを追加 | +| [commit cpprefjp/site, 426105d] | cpprefjp/fixl:1 | fix: C++23のDISはN4950で決まりと見て良さそうだった | +| [commit cpprefjp/site, 79fc60a, 49f9140] | cpprefjp/fixl:2 | fix: CWG 2518/P2593R1 を反映 | +| [commit cpprefjp/site, 5ae4982] | cpprefjp/fixm:1 | chore: s/破棄文/廃棄文/ | +| [commit cpprefjp/site, 668c8d5] | cpprefjp/compiler:5 | fix(msvc_ver): add 17.7,17.8,17.9 info | +| [commit cpprefjp/site, 9ae7f5e] | cpprefjp/fixm:1 | chore: VC++ versionの確認方法を明記 | +| [commit cpprefjp/site, b498cde] | cpprefjp/compiler:1 | fix: 17.6の情報をdev.toのコメントの情報に差し替え | +| [commit cpprefjp/site, 3b1b618] | tool/updatelib:1 | fix(ci): ripgrep 14.1.0 | + + +## [tetsurom](https://github.com/tetsurom) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, 1736ad6, d590681, 46c569d] | cpprefjp/addref:1, cpprefjp/link:1 | `as_rvalue_view`の解説を追加 | +| [commit cpprefjp/site, fe170bc, dd46a05] | cpprefjp/link:2, cpprefjp/addlang:1 | 解説を追加: 範囲for文が範囲初期化子内で生じた一時オブジェクトを延命することを規定 | +| [commit cpprefjp/site, a199a49, 6c5bf9b] | cpprefjp/fixm:1 | Update lifetime_extension_in_range_based_for_loop.md | +| [commit cpprefjp/site, 613f556] | cpprefjp/link:1 | 基礎的なRange関連キーワードを追加 | +| [commit cpprefjp/site, 3983f02, 2f19f57, 674da11, 24fe7f1, ff47b79, d7a2efb, 7de1886, f001592] | cpprefjp/addref:1, cpprefjp/link:5 | `ranges::to`の説明を追加 | +| [commit cpprefjp/site, 089593d] | cpprefjp/link:1 | C++23目次のリンク修正 | +| [commit cpprefjp/site, 8fa793b, 8dec62d, e6fcf74, a5a2bc7] | cpprefjp/addref:1, cpprefjp/link:3, cpprefjp/fixm:1 | `views::join_with` の説明を追加 | +| [commit cpprefjp/site, badecd6] | cpprefjp/fixm:1 | `transform_view`: 例を追加 | +| [commit cpprefjp/site, 95a8299] | cpprefjp/link:8 | 一部リンクをN4950へのリンクに修正 | +| [commit cpprefjp/site, 19cfa92] | cpprefjp/link:1 | リンク追加 | +| [commit cpprefjp/site, 8306cf4, 78b8da4, 6dbea00, df36c82, d43097b, 1e44b92, 51b638c, 07b0005, 2f02684] | cpprefjp/addref:1, cpprefjp/link:8 | `zip_view`の説明を追加 | +| [commit cpprefjp/site, d02a7ee, 5722730, de6c390, 00300d6] | cpprefjp/addref:1, cpprefjp/link:5 | `zip_tramsform_view` | +| [commit cpprefjp/site, 51f6075, 362d095, 8509d11] | cpprefjp/addref:1, cpprefjp/link:1 | `adjacent_view` | +| [commit cpprefjp/site, 5695a7a] | cpprefjp/addref:1, cpprefjp/link:3 | `adjacent_transform_view` | +| [commit cpprefjp/site, 9eeee30] | cpprefjp/link:1 | Add println to GLOBAL_QUALIFY_LIST | +| [commit cpprefjp/site, 4bf3b2a] | cpprefjp/addref:1, cpprefjp/link:2 | `chunk_view` | +| [commit cpprefjp/site, 80918ec] | cpprefjp/addref:1, cpprefjp/link:4 | `slide_view` | +| [commit cpprefjp/site, 9af2af3, 3c62036] | cpprefjp/addref:1, cpprefjp/link:3 | `chunk_by_view` | +| [commit cpprefjp/site, 7110998] | cpprefjp/addref:1, cpprefjp/link:2 | `stride_view` | +| [commit cpprefjp/site, 5a1743d, 57215c9] | cpprefjp/addref:1, cpprefjp/link:2 | `certesian_product_view` | +| [commit cpprefjp/site, c906787, ea628fa] | cpprefjp/addref:1, cpprefjp/link:2 | `enumerate_view` | +| [commit cpprefjp/site, 032f80a] | cpprefjp/addref:1, cpprefjp/fixl:1, cpprefjp/link:1 | `range-with-movable-references` | +| [commit cpprefjp/site, af4c8ae, ac7bc04, bef7f7f] | cpprefjp/addref:1, cpprefjp/fixl:4 | Rangeアダプタでムーブのみ可能な型を使用できるよう要件を緩和 | +| [commit cpprefjp/site, c5f8bd4, 018bcd8] | cpprefjp/addref:2, cpprefjp/fixl:1, cpprefjp/link:2 | `std::ranges::contains` | +| [commit cpprefjp/site, 4290e9d] | cpprefjp/fixm:1 | Update reverse_view.md | +| [commit cpprefjp/site, 91b9997, a4fff7c, 7d8342f, 94f1ad5, e9de462, 8ec80d9, 76cc74b] | cpprefjp/addref:2, cpprefjp/fixl:3, cpprefjp/link:3 | ユーザー定義Rangeアダプタのパイプライン演算子対応 | +| [commit cpprefjp/site, c48319e] | cpprefjp/fixl:1 | オプション書式におけるロケールのオプションを修正 | +| [commit cpprefjp/site, 89d821a] | cpprefjp/fixl:1 | フォーマット書式の表を整理 | +| [commit cpprefjp/site, 98c71c6] | cpprefjp/fixl:1 | アライメントの詳細を記載 | +| [commit cpprefjp/site, 49f50b7, 018f507] | cpprefjp/addref:1, cpprefjp/fixl:2 | `basic_format_arg`/`op_constructor`の説明を追加 | +| [commit cpprefjp/site, cf1a231] | cpprefjp/fixl:1 | Rangeのフォーマットの細かい点を追記 | +| [commit cpprefjp/site, fef3ffc] | cpprefjp/fixl:1 | std.compat.md "この機能が必要になった背景・経緯"を追加 | +| [commit cpprefjp/site, afd10bb] | cpprefjp/fixl:1 | std.md "この機能が必要になった背景・経緯"を追加 | +| [commit cpprefjp/site, 4f5156f] | cpprefjp/fixl:1 | Update begin.md | +| [commit cpprefjp/site, a659a6b, 33fdff4] | cpprefjp/fixl:1 | formatter: 説明を追加 | +| [commit cpprefjp/site, f71ba40] | cpprefjp/fixl:1 | 書式文字列の取得のしかたを修正 | +| [commit cpprefjp/site, d548d89] | cpprefjp/fixl:1 | 補足説明を追加 | +| [commit cpprefjp/site, 5398590, 963ad2b, 8ca314b] | cpprefjp/fixl:1 | 実装例を追加 | +| [commit cpprefjp/site, 8e148d1] | cpprefjp/fixl:3 | 実装例を追加 | +| [commit cpprefjp/site, c27bce6] | cpprefjp/fixl:1 | Update format.md `bool`の`s`オプションを追加 | +| [commit cpprefjp/site, 9e5c647] | cpprefjp/fixm:1 | Update contract-based_programming.md 経緯を補足 | +| [commit cpprefjp/site, 5b55938, 2d2a3c7] | cpprefjp/fixl:2 | format: 説明を微調整 & リンク追加 | +| [commit cpprefjp/site, 0059bf7] | cpprefjp/addref:1, cpprefjp/fixl:1, cpprefjp/link:1 | maybe-constの解説を追加 | +| [commit cpprefjp/site, 3602f00] | cpprefjp/fixl:1, cpprefjp/addref:6 | Range adaptor helpersの説明専用ライブラリを追加 | +| [commit cpprefjp/site, 2f09aa8] | cpprefjp/addref:1, cpprefjp/link:1, cpprefjp/fixl:1 | `concat_view`の解説を追加 | +| [commit cpprefjp/site, 5500765] | cpprefjp/fixl:1 | Update scoped_enum.md | +| [commit cpprefjp/site, c2b0139] | cpprefjp/link:4 | enum class周りのリンクを追加 | +| [commit cpprefjp/site, d695536] | cpprefjp/fixm:1 | 用語を追加 | +| [commit cpprefjp/site, 9a02af6, 256375f, 04b953e, 075f072, 9c00720] | cpprefjp/fixl:1, cpprefjp/addref:19 | `filter_view` のメンバの解説を追加 | +| [commit cpprefjp/site, 863b61f] | cpprefjp/link:1, cpprefjp/fixl:2 | elements_view の説明を修正 | +| [commit cpprefjp/site, 4480388] | cpprefjp/fixl:1 | パイプライン記法を提供しないRangeアダプタについての説明を追加 | + + +## [onihusube](https://github.com/onihusube) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, 5fcf829] | cpprefjp/fixm:3 | `mdspan`の名前付き要件のメタ指定修正 | +| [commit cpprefjp/site, c44afe1] | cpprefjp/fixl:1 | LWG Issue 3305適用(P3040R0) | +| [commit cpprefjp/site, 2ed0e77] | cpprefjp/fixl:1 | LWG Issue 3749対応(P3040R0) | +| [commit cpprefjp/site, ce48adc] | cpprefjp/fixl:1 | LWG Issue 3897対応(P3040R0) | +| [commit cpprefjp/site, cfedf6d] | cpprefjp/fixl:2 | LWG Issue 3946対応(P3040R0) | +| [commit cpprefjp/site, fdb5ec5] | cpprefjp/fixl:3 | LWG Issue 3809対応(P3040R0) | +| [commit cpprefjp/site, 06c0c00] | cpprefjp/fixl:2 | LWG Issue 3948対応(P3040R0) | +| [commit cpprefjp/site, 013028f] | cpprefjp/fixl:2 | LWG Issue 3953対応(P3040R0) | +| [commit cpprefjp/site, 16e6dd7] | cpprefjp/addref:1, cpprefjp/fixl:1 | LWG Issue 4001対応(P3040R0) | +| [commit cpprefjp/site, 39555de] | cpprefjp/fixm:1 | `from_chars` : C++26の例で結果を受ける変数をインライン化 | +| [commit cpprefjp/site, 6b57515, d631e4f, 2673b91, 868aa38, 0c64616, 81b8f37, 9799590, 3003547, ac864c9, 6b609be, 8384e0b, c4b15ea, dd9230e] | cpprefjp/addlang:1, cpprefjp/link:2 | 暗黙的なムーブを簡略化 | +| [commit cpprefjp/site, 8fc3e56] | cpprefjp/fixl:1 | `string::substr()` : 右辺値オーバーロードの動作について追記と例を追加 | +| [commit cpprefjp/site, ee8e4dc] | cpprefjp/fixm:1 | `parent_path()` : パス名末尾/の挙動について追記 | +| [commit cpprefjp/site, 16ab0b8] | cpprefjp/fixl:1 | `view_interface::empty` : LWG Issue 3715対応 | +| [commit cpprefjp/site, 1522cff] | cpprefjp/fixl:1 | Update user-generated_static_assert_messages.md `std::format()`の`constexpr`対応はまだ | +| [commit cpprefjp/site, 7e81584] | cpprefjp/fixm:1 | `nexttoward` : typo修正 | +| [commit cpprefjp/site, 0a2aa08] | cpprefjp/fixl:1 | `split_view`の外側rangeは常に`.back()`を持たない | +| [commit cpprefjp/site, abe6cbe] | cpprefjp/fixl:1 | 名前付きユニバーサルキャラクタ名: マッチングについて修正 | +| [commit cpprefjp/site, 5151c6a] | cpprefjp/fixl:1 | P2334R1 : elifはあった | +| [commit cpprefjp/site, f222955, c4adceb, 8aea300, 54a9faf, 3283bd0, 339d311, fd536f9, c7c70e6, 3888639, 964e2a0, ac9e77e, 505a007, 43c113a, 5b1d104, 4879042, b9c8967, 005ac4a, 379e1b0, 622ede1, bb6a439, e49fbcd, eff2b0b] | cpprefjp/addref:2 | fold | +| [commit cpprefjp/site, e75774c] | cpprefjp/fixm:1 | 未初期化領域への暗黙的なオブジェクト構築 : 箇条書きのインデント修正 | + + +## [ToruNiina](https://github.com/ToruNiina) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, ea41b5d] | cpprefjp/fixm:1 | 委譲コンストラクタの実行順序を明記 | +| [commit cpprefjp/site, 18b3289, b460e7d, 836d3a7, ccf8ee7, 477414c, a38076e, d2f5783, bdfe351, 46c5224, f96627b, 0637fa2, 779fab6, d9744ca] | cpprefjp/addlang:1, cpprefjp/link:2 | feat: C++23 relaxing some constexpr restrictions | +| [commit cpprefjp/site, 8b71c43, 67f5bf3, 3be882a, b104895, a581545, 14014b8, 38df131, 62ade03] | cpprefjp/addlang:1, cpprefjp/link:2 | feat: C++23 non-literal vars in constexpr funcs | +| [commit cpprefjp/site, 08b2c51] | cpprefjp/fixs:1 | refactor: remove needless whitespaces | +| [commit cpprefjp/site, 2a0706c, 2284db9] | cpprefjp/fixl:7 | feat: mark `std::optional` member methods constexpr | +| [commit cpprefjp/site, fc76618] | cpprefjp/typo:4 | typo: 動作未定義 -> 未定義動作 | +| [commit cpprefjp/site, 8ed33cb] | cpprefjp/fixm:1 | fix: typo in an example code | + + +## [faithandbrave](https://github.com/faithandbrave) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, 1b09fb1, b66dc23] | | 2023年分の貢献ポイントまとめ | +| [commit cpprefjp/site, a38076e, d2f5783, bdfe351] | cpprefjp/fixs:3 | fix: use markdown link, not a url | +| [commit cpprefjp/site, 50d9d18, d436315] | | スポンサー更新 | +| [commit cpprefjp/site, 719017d] | tool/improvem:1 | reference / module以下の階層で、meta headerが指定されなかったらエラーにする | +| [commit cpprefjp/site, 4b9c2df, a877468, 6af4176] | cpprefjp/fixl:5, cpprefjp/link:2 | C++26 : 2023-12 Mailingに対応 | +| [commit cpprefjp/site, 7df12cd] | cpprefjp/fixm:1 | `basic_string::reserve` : 非推奨・削除の詳細用の見出しを設定 | +| [commit cpprefjp/site, c422171] | cpprefjp/link:2, cpprefjp/fixl:1, cpprefjp/addref:1 | C++26対応として、`span::at`を追加 | +| [commit cpprefjp/site, 3bcf3e6] | cpprefjp/fixl:1 | C++26対応として`span`のコンストラクタに`initializer_list`をとるオーバーロードを追加 | +| [commit cpprefjp/site, 617a941] | cpprefjp/fixl:53 | ``と``の`constexpr`対応 | +| [commit cpprefjp/site, 52a8ab1] | cpprefjp/fixl:5 | C++26対応として``ライブラリを削除 | +| [commit cpprefjp/site, aa9d684] | cpprefjp/compiler:5 | コンパイラのC++26対応状況を更新 | +| [commit cpprefjp/site, 25162a1] | cpprefjp/fixl:2 | `to_string` / `to_wstring` : C++26対応としてformatベースの仕様に変更 | +| [commit cpprefjp/site, e189708] | cpprefjp/fixl:1 | `basic_ostream::operator<<` : C++23対応として`const volatile void*`のオーバーロードを追加 | +| [commit cpprefjp/site, 8bedbe3] | cpprefjp/addlang:1, cpprefjp/link:2 | C++23 : `#warning` を追加 | +| [commit cpprefjp/site, 33a231f] | cpprefjp/addlang:1, cpprefjp/link:3 | C++23: 「ラムダ式で`()`を省略できる条件を緩和」を追加 | +| [commit cpprefjp/site, 8ba9fba] | cpprefjp/addlang:1, cpprefjp/link:6 | C++23 : 「ラムダ式に対する属性」を追加 | +| [commit cpprefjp/site, 7e3cbd4, 86e7cee] | cpprefjp/addlang:1, cpprefjp/addref:1, cpprefjp/link:5, cpprefjp/fixl:1 | C++23 : 「thisポインタをもつ必要のない演算子をstaticとして宣言できるようにする」を追加し関連ページを修正 | +| [commit cpprefjp/site, 923f152, cb8f141] | cpprefjp/addref:2, cpprefjp/fixl:2, cpprefjp/fixm:2 | charconv : C++26対応として`from_chars_result` / `to_chars_result`に`operator bool`を追加 | +| [commit cpprefjp/site, 4029cd2] | cpprefjp/addlang:1, cpprefjp/link:3 | C++23 : 「名前付きユニバーサルキャラクタ名」を追加 | +| [commit cpprefjp/site, 1f961de] | cpprefjp/addlang:1, cpprefjp/link:4 | C++23 : 「初期化文での型の別名宣言を許可」を追加 | +| [commit cpprefjp/site, 688d25f, d90163c] | cpprefjp/addlang:1, cpprefjp/link:3 | C++23 : 「エスケープシーケンスの区切り」を追加 | +| [commit cpprefjp/site, 1666a75] | cpprefjp/addlang:1, cpprefjp/link:2 | C++23 : 「複合文の末尾へのラベルを許可」を追加 | +| [commit cpprefjp/site, cdd2548] | | スポンサー更新 | +| [commit cpprefjp/site, 8e2ed62] | cpprefjp/addlang:1, cpprefjp/link:2 | C++23 : 「1ワイド文字に収まらないワイド文字リテラルを禁止する」を追加 | +| [commit cpprefjp/site, 547e205] | cpprefjp/link:11 | nolinkを解除 | +| [commit cpprefjp/site, b073a03, 8d5b3bf] | cpprefjp/addlang:1, cpprefjp/link:2 | C++23 : 「異なる文字エンコーディングをもつ文字列リテラルの連結を不適格とする」を追加 | +| [commit cpprefjp/site, 8f7faa7] | cpprefjp/addlang:1, cpprefjp/link:2 | C++23 : 「静的な診断メッセージの文字エンコーディング」を追加 | +| [commit cpprefjp/site, f606137] | cpprefjp/fixm:4 | ライブラリのひな形に、「この機能が必要になった背景・経緯」を追加 | +| [commit cpprefjp/site, 197de33] | cpprefjp/addlang:1, cpprefjp/link:2 | C++23 : 「アクセス制御の異なるメンバ変数のレイアウトを宣言順に規定」を追加 | +| [commit cpprefjp/site, 6dbd0b7] | cpprefjp/addlang:1, cpprefjp/link:2 | C++23 : 「文字リテラルエンコーディングを一貫させる」を追加 | +| [commit cpprefjp/site, 256984f] | | スポンサー更新 | +| [commit cpprefjp/site, 893d77e] | cpprefjp/addlang:1, cpprefjp/link:3 | C++23 : 「継承コンストラクタからのクラステンプレート引数の推論」を追加 | +| [commit cpprefjp/site, ab80c52] | cpprefjp/addlang:1, cpprefjp/link:2 | C++23 : 「elif/elifdef/elifndefのサポートを追加」 | +| [commit cpprefjp/site, 296296a] | cpprefjp/addlang:1, cpprefjp/link:2 | C++23 : 「行末スペースを無視するよう規定」を追加 | +| [commit cpprefjp/site, 45cad45] | cpprefjp/addlang:1, cpprefjp/link:4 | C++23 : 「定数式の文脈でのboolへの縮小変換を許可」を追加 | +| [commit cpprefjp/site, 8250474] | cpprefjp/addlang:1, cpprefjp/link:4 | C++23 : 「constexpr関数内でのstatic constexpr変数を許可」を追加 | +| [commit cpprefjp/site, bb18d67, 5df0bf4] | cpprefjp/addlang:1, cpprefjp/link:4 | C++23 : if constevalを追加 | +| [commit cpprefjp/site, 00f9995] | cpprefjp/link:1 | std::merge : 関連項目を追加 | +| [commit cpprefjp/site, 0f1d4b4] | cpprefjp/addlang:1, cpprefjp/link:4 | C++23 : 「constexpr関数内でconsteval関数を呼び出せない問題を軽減」を追加 | +| [commit cpprefjp/site, 1203319] | cpprefjp/addlang:1, cpprefjp/link:2 | C++23 : 「汎用的なソースコードのエンコーディングとしてUTF-8をサポート」を追加 | +| [commit cpprefjp/site, 38888cf] | cpprefjp/addlang:1, cpprefjp/link:4 | C++23 : 「添字演算子の多次元サポート」を追加 | +| [commit cpprefjp/site, 070dd0d] | cpprefjp/addlang:1, cpprefjp/link:3 | C++23 : 「無意味なexport宣言を禁止する」を追加 | +| [commit cpprefjp/site, d936b97] | cpprefjp/addlang:1, cpprefjp/link:3 | C++23 : 「変数テンプレートの部分特殊化を許可」を追加 | +| [commit cpprefjp/site, 227e7c3] | cpprefjp/link:1 | MPIRへの言及を削除 | +| [commit cpprefjp/site, 907d3e1] | cpprefjp/link:1 | リンク切れを修正 | +| [commit cpprefjp/site, 6d3e95b] | tool/improvem:1 | GitHub Issue発行スクリプト : 外部リンクチェック成功時にissueを作ってしまっていたのを修正 | +| [commit cpprefjp/site, 1495bf6] | cpprefjp/link:1 | C++11 右辺値参照 : 関連項目を追加 | +| [commit cpprefjp/site, 6224e96] | cpprefjp/link:1 | `poisson_distribution` : リンク差し替え | +| [commit cpprefjp/site, 194f60c] | cpprefjp/fixm:1 | `map::emplace` : 戻り値の例を追加 | +| [commit cpprefjp/site, d12d621] | cpprefjp/fixm:1 | `(recursive_)directory_iterator` : ディレクトリも列挙されることを明記 | +| [commit cpprefjp/site, bec6a53] | cpprefjp/fixl:1 | bitset : C++26対応として`string_view`をとるコンストラクタを追加 | +| [commit cpprefjp/site, eb49644] | cpprefjp/addlang:1, cpprefjp/link:3 | C++26 : 「`static_assert`の診断メッセージにユーザーが生成した文字列の指定を許可」を追加 | +| [commit cpprefjp/site, ba9a494] | cpprefjp/fixl:1 | assert : C++26対応として、カンマを含む式を条件式として指定できるようにした | +| [commit cpprefjp/site, 142f303] | cpprefjp/fixm:24 | `basic_stacktrace` : GCCで動作確認 | +| [commit cpprefjp/site, e349d0e] | cpprefjp/fixm:2 | ``のbegin / end : メンバ関数版とのちがいを記載 | +| [commit cpprefjp/site, 56e4f9b, b22d84d, 53ab5e9, bdc9e06, 2908152, 43fb601, 6563c29] | cpprefjp/addref:5, cpprefjp/fixl:1, cpprefjp/link:1 | `stacktrace_entry` | +| [commit cpprefjp/site, d6df9bd] | cpprefjp/compiler:8 | `print`関係の動作確認 | +| [commit cpprefjp/site, 92d7ba8] | cpprefjp/fixm:2 | `print`/`println` : `stdout`の例を改善 | +| [commit cpprefjp/site, 8eb6a1e] | cpprefjp/link:1 | C++26対応状況 : libc++の文字列フォーマット関係の状況ページを参照として追加 | +| [commit cpprefjp/site, 8f62ba9] | cpprefjp/fixm:1 | `basic_stacktrace` : libstdc++は実装としてシグナル安全であることを記載 | +| [commit cpprefjp/site, 0b3b945] | cpprefjp/fixl:1 | format : C++26対応としてポインタ値を大文字で出力するPオプションを追加 | +| [commit cpprefjp/site, e6a1afa] | cpprefjp/addref:1, cpprefjp/fixl:2 | `stacktrace` : `formatter`の特殊化を追加 | +| [commit cpprefjp/site, 39c8d43] | cpprefjp/addref:1, cpprefjp/fixl:1 | `thread::id` : `formatter`を追加 | +| [commit cpprefjp/site, 210af73] | cpprefjp/fixl:1 | `basic_stacktrace` : `pmr`を追加 | +| [commit cpprefjp/site, cd7aed4] | cpprefjp/addref:2, cpprefjp/fixl:2, cpprefjp/fixm:5 | C++26対応として、実行時の書式文字列サポートを記載 | +| [commit cpprefjp/site, c8928e4] | tool/improves:1, cpprefjp/typo:7 | fix typo: 誤字wstingをCIに追加 | +| [commit cpprefjp/site, 0eeefc0] | cpprefjp/fixm:1 | `error_code`のコンストラクタ : `ErrorCodeEnum`をとるオーバーロードの使用例を記載 | +| [commit cpprefjp/site, 1815c86] | cpprefjp/fixm:1 | 用語定義 : ADLを追加 | +| [commit cpprefjp/site, 9e71889] | cpprefjp/fixm:1 | トップページ : HTMLのダウンロードリンクを記載 | +| [commit cpprefjp/site, 0ba9eff] | | 絵文字の表示テスト | +| [commit cpprefjp/site, aaa7f3a] | cpprefjp/link:1 | reference : ページ内リンクのミスを修正 | +| [commit cpprefjp/site, 4774e39] | cpprefjp/fixs:3369 | 全体 : 動作確認した処理系に「検証済み」「未実装」の絵文字を入れた | +| [commit cpprefjp/site, 5a982c6] | cpprefjp/fixl:2 | 編集者向けドキュメント : 動作検証バージョンに併記する絵文字について記載 | +| [commit cpprefjp/site, 71cff38] | cpprefjp/compiler:1 | `basic_stacktrace` : Clangの未実装バージョンとVisual C++の実装バージョンを記載 | +| [commit cpprefjp/site, 5ac4180] | cpprefjp/fixm:1, cpprefjp/fixs:177 | 言語機能 : ページタイトルの末尾に提案文書の番号を記載 | +| [commit cpprefjp/site, d71da86] | cpprefjp/fixs:1 | linalg add : 表示崩れを修正 | +| [commit cpprefjp/site, 17a5018, 4e4963e] | cpprefjp/fixl:2, cpprefjp/addlang:1 | C++23 : `__cplusplus`の値を記載 | +| [commit cpprefjp/site, 2838b38, cba02fb, 641d6a7] | tool/addm:1, cpprefjp/fixs:216 | 言語機能 : 関連項目に誘導する注意事項を記載。注意事項を更新するスクリプトを追加 | +| [commit cpprefjp/site, 164e997] | cpprefjp/fixm:20, cpprefjp/link:43 | 言語機能 : ページ名をわかりやすくするよう見直し | +| [commit cpprefjp/site, 810f928, 94d1ece] | | スポンサー追加: テクニカルアーツ社 | +| [commit cpprefjp/site, 2819232] | cpprefjp/fixm:1 | `poisson_distribution` : 例を追加 | +| [commit cpprefjp/site, c7e4c78] | cpprefjp/fixm:1 | `exponential_distribution` : 例を追加 | +| [commit cpprefjp/site, 9dae3cf] | cpprefjp/fixm:1 | `matrix_inf_norm` / `matrix_one_norm` : 番号付きリストが通常のリストになってしまう問題を修正 | +| [commit cpprefjp/site, 4baab1d] | | スポンサー更新 | +| [commit cpprefjp/site, 7e2cd22, 53c02d0, ba894d0], [commit cpprefjp/site_generator, 3e0a55f, a5b0e83], [commit cpprefjp/markdown_to_html, f95588d, 2ce6b71] | | スポンサーの掲載期限をチェックするために新規構文を導入 | +| [commit cpprefjp/site, 21b92fb] | tool/improves:1, cpprefjp/fixs:18 | 用語統一 : 括弧 → カッコ | +| [commit cpprefjp/site, 2285ef5] | cpprefjp/link:2 | accumulateとreduceを相互に関連項目として記載 | +| [commit cpprefjp/site, 1052eda] | cpprefjp/link:3 | partial_sum, inclusive_scan, exclusive_scanを相互に関連項目として記載 | +| [commit cpprefjp/site, b999909] | cpprefjp/fixl:1 | C++26のWorking Draftを更新 | +| [commit cpprefjp/site, e77f89c, 8f3061e, 8648954, b9205d2] | cpprefjp/fixl:3 | C++26 : 2024-07 mailingで採択された言語機能・ライブラリを記載 | +| [commit cpprefjp/site, f927616, edf8e82, bbfb1bc, b9076ff] | | スポンサー更新 | +| [commit cpprefjp/site, 3af3684] | cpprefjp/fixl:6 | stable sort関係 : C++26でのconstexpr対応 | +| [commit cpprefjp/site, 6b4433b] | cpprefjp/fixl:19 | chrono: C++26対応としてハッシュサポートを追加 | +| [commit cpprefjp/site, bdfc49d] | cpprefjp/compiler:4 | Visual Studio : 2022 Update 10を追加 | +| [commit cpprefjp/site, cb3e889] | cpprefjp/addref:3, cpprefjp/fixl:1, cpprefjp/fixm:1, cpprefjp/link:1 | complex : C++26対応としてタプルインタフェースのサポートを追加 | +| [commit cpprefjp/site, 4c68758, dde880f] | cpprefjp/addref:3, cpprefjp/fixl:3, cpprefjp/link:1 | `` : C++23対応として`allocate_at_least`を追加 | +| [commit cpprefjp/site, 9787b11, 96adf0c] | cpprefjp/fixl:2, cpprefjp/fixm:1 | C++26: 2024-04 mailingに対応 | +| [commit cpprefjp/site, 2f336cb] | cpprefjp/fixl:1 | reference: C++26対応として``を削除 | +| [commit cpprefjp/site, 8ee965b] | cpprefjp/fixl:12 | `shared_ptr` : C++26対応として、アトミック操作の非メンバ関数を削除 | +| [commit cpprefjp/site, 35f7f21] | cpprefjp/fixl:10 | locale : C++26対応として、`wstring_convert`と`wbuffer_convert`を削除 | +| [commit cpprefjp/site, a485eae] | cpprefjp/fixl:2 | println : C++26対応として、改行コードのみを出力するオーバーロードを追加 | +| [commit cpprefjp/site, 0eca2a4] | cpprefjp/fixl:2 | `polymorphic_allocator` : C++26対応としてdestroyの非推奨を取り消し | +| [commit cpprefjp/site, d376613, c04dea6, e9329c9, b4085cf, c8d18a6] | cpprefjp/addref:1, cpprefjp/fixl:1, cpprefjp/link:1 | random : C++26対応として、`generate_random`関数を追加 | +| [commit cpprefjp/site, 80dfda1] | cpprefjp/typo:1 | #1343 と同様にダブルクォートの閉じ位置を修正 | +| [commit cpprefjp/site, 4e4c416] | cpprefjp/link:1 | コンパイラの実装状況 : libc++のC++14ステータスページが削除されたのでリンク削除 | +| [commit cpprefjp/site, 1feb8ee, a1e09e8, 37b7a43, ff2c410, 8ac3445, 3d65416, 1019af6, ff558c7, 0b41b4c, d0680e4, dfc91f8, 5eba34f, f3e89a5, 2839de7, 99bb6b7, 53aba6f] | tool/addm:2, cpprefjp/fixs:144, cpprefjp/fixm:1 | 定義された用語の意図しない使用方法を検出するスクリプトを追加 | +| [commit cpprefjp/site, 9119e06, f4ce5e5] | cpprefjp/addref:5, cpprefjp/fixl:7 | C++26対応として、`enable_nonlocking_formatter_optimization`を追加 | +| [commit cpprefjp/site, ba0267c] | cpprefjp/addlang:1, cpprefjp/link:4 | C++26 : 「構造化束縛への属性を許可」を追加 | +| [commit cpprefjp/site, e9fb3fd, fd2e8e6, e2ee1da] | cpprefjp/addlang:1, cpprefjp/link:4, cpprefjp/fixm:1 | C++26 : 「条件式での構造化束縛の使用を許可」を追加 | +| [commit cpprefjp/site, 24903b6, 2d80797] | cpprefjp/addlang:1, cpprefjp/link:3 | C++26 : 「関数宣言を削除する理由を指定できるようにする」を追加 | +| [commit cpprefjp/site, 90c7ce3, cd6d39b, 040c509, a114975, 7f7759e, 6b0e3d7, 2a4fe0e, 30cfb4e, 7d2188d, c965e26, 7e68271, aeee953, 5e8c37d, afee388, 94e04bf, a81c832, 616c00b, 82d6360, 894cbd9, 1ef7729, 1c11eb8, 4122657] | cpprefjp/addlang:1, cpprefjp/fixm:1, cpprefjp/link:2 | C++26 : 「未初期化変数の読み取りをエラー性動作とする」を追加 | +| [commit cpprefjp/site, 9437e4e] | cpprefjp/addref:2, cpprefjp/fixl:1, cpprefjp/link:1 | C++26対応として`reference_wrapper`の`operator==`と`<=>`を追加 | +| [commit cpprefjp/site, fe9f6f7] | cpprefjp/fixl:4 | optional, tuple, pair, variant : C++26対応としてテンプレートパラメータ制約を整理 | +| [commit cpprefjp/site, 806a8c8] | cpprefjp/fixm:1 | formatter : 複数のメンバ変数をもつクラスをformatterで文字列化する例を追加 | +| [commit cpprefjp/site, 07e9e02, 6572301, a4346b7, 964d94a, 30fab63, dd8477c] | cpprefjp/addref:4, cpprefjp/fixl:1, cpprefjp/link:2 | C++26対応として``ライブラリを追加 | +| [commit cpprefjp/site, cbb1fd4] | cpprefjp/compiler:2 | hardware_…size : 動作確認 | +| [commit cpprefjp/site, dee2ab3] | cpprefjp/fixs:1 | 箇条書きの表示崩れを修正 | +| [commit cpprefjp/site, 175916c, 9b64b46] | cpprefjp/fixm:1 | `multimap::equa_range` : エラー処理を追加 | +| [commit cpprefjp/site, 51c2ae7, 2a58e28] | cpprefjp/link:44 | `` : 冗長な絶対リンク指定を相対リンクに修正 | +| [commit cpprefjp/site, e97eeba, 5d13ce9] | cpprefjp/fixl:1 | chronoのformat : 世紀のロケール表現で元号はいまのところ扱われないので削除 | +| [commit cpprefjp/site, 867bb4a] | cpprefjp/compiler:1 | `remove_cvref` : 動作確認 | +| [commit cpprefjp/site, e1bfcbb] | | スポンサー更新 | +| [commit cpprefjp/site, 7d603ab] | | スポンサー画像を原寸大より大きくしてしまっていたのを修正 | +| [commit cpprefjp/site, e94f580, 05784ef, ed3624c] | | スポンサー更新 | +| [commit cpprefjp/site, c56ea8d] | tool/improves:1 | 外部リンクチェック : web archiveはhttpもチェック除外対象にした | +| [commit cpprefjp/site, 7a4c6c5] | cpprefjp/fixl:1 | `knuth_b` : 書籍での紹介を「考案」→「述べられている」に修正し、.NETの実装は別アルゴリズムであるため言及を削除 | +| [commit cpprefjp/site, ab36172] | cpprefjp/fixm:1 | `bad_array_new_length` : サンプルコードを追加 | +| [commit cpprefjp/site, f1d9bfb] | tool/improvem:1 | リンクチェックCI : URLをコマンドライン引数で指定できるようにした | +| [commit cpprefjp/site, 203d665] | tool/improvem:1 | リンクチェックCI : 外部リンクチェックを高速化。2倍近くは速くなったはず | +| [commit cpprefjp/site, d1f4efb, a3aa49f] | cpprefjp/fixl:2 | C++23が正式発行された | +| [commit cpprefjp/site, 81838cc] | cpprefjp/fixl:1 | C++26 Working Draftを更新 | +| [commit cpprefjp/site, 7de58d9] | cpprefjp/fixm:1 | string::contains : バージョン表記のミスを修正 | +| [commit cpprefjp/site, 19bc6ae] | cpprefjp/link:4 | unorderedのinsert : hintの活用についてのMicrosoftの記事を参照に追加 | +| [commit cpprefjp/site, daf7534] | cpprefjp/fixl:1 | functionのコンストラクタ : C++23での`function(F)`から`function(F&&)`への変更を記載 | +| [commit cpprefjp/site, 710972a] | cpprefjp/fixm:1 | 用語の誤った使い方を検出するCIの説明を追加 | +| [commit cpprefjp/site, be99b9a] | cpprefjp/addlang:2, cpprefjp/fixl:1, cpprefjp/link:3 | C++26: 「非推奨となっていた列挙型の算術変換を削除」と関連するC++20仕様変更を追加 | +| [commit cpprefjp/site, 52896ca] | tool/improvem:1 | 外部リンクチェック : コミットへのリンクをチェック対象外にした | +| [commit cpprefjp/site, 165353e] | cpprefjp/fixs:2 | 言語機能の注意文章を更新 | +| [commit cpprefjp/site, 1714d22, 1395fe5, 4a8c6fa, a9aca40, c747f4a, aacc4df] | cpprefjp/fixl:2, cpprefjp/link:10 | NOTICE.mdでのMarkdown記法の制限を、拡張ページと統合 | +| [commit cpprefjp/site, ea0f0c5] | cpprefjp/link:2 | GCC Webサイトのリンク切れを修正 | +| [commit cpprefjp/site_generator, bfe1e6e, f78cf68, c4b7544, 9113e41], [commit cpprefjp/kunai, 3579e19, ba7dd4e] | | アイコンをv2.0に更新 | +| [commit cpprefjp/site_generator, 6dd1cca] | | update markdown_to_html | +| [commit cpprefjp/site_generator, 11109cf, 078285c] | tool/improvem:2 | MathJaxのブロック数式 : 左に詰まっていたのでインデントをつけた | +| [commit cpprefjp/site_generator, 6f4a520, 227aa44, 2e710d5], [commit cpprefjp/markdown_to_html, 160e85e, f4185da] | tool/improvel:1, tool/addl:1 | コンパイラの動作確認用に絵文字を表示する機能を追加 | +| [commit cpprefjp/markdown_to_html, 533bf5f] | tool/improvem:1 | ページタイトルをキーワードリンクの対象から外す | +| [commit cpprefjp/kunai, 4cfc0eb] | tool/improvem:2 | v3.0.9 | +| [commit cpprefjp/kunai, 0e47639] | tool/improvem:1 | crsearchを更新 | +| [commit cpprefjp/kunai, 42b7fc2] | tool/improvem:4 | 1ページ目しか印刷されない問題を修正 | +| [commit cpprefjp/kunai, bdccb2d, 863b2d6], [commit cpprefjp/kunai_config, 9b1cdc2] | tool/improvem:3 | 編集方針ページを追加 | +| [commit boostjp/site, 402cf12, d2b17ae] | boostjp/releasem:2, boostjp/releasel:1 | 1.84.0: Geometry, JSON, Asio | +| [commit boostjp/site, cf9bb0d, 558fa8a, dcea9c7, 66b1a90, e5ca43b, 2f70ad3] | boostjp/link:1, boostjp/releases:4, boostjp/releasem:23, boostjp/releasel:7 | 1.85.0 | +| [commit boostjp/site, 1884532] | boostjp/fixm:1 | トップページ : HTMLのダウンロードリンクを記載 | +| [commit boostjp/site, e8bdc89, c6799f6, 1cfaf2d] | boostjp/link:1, boostjp/releases:1, boostjp/releasem:25, boostjp/releasel:7 | 1.86.0 | +| [commit cpprefjp/site, 81b7ad4, 38415a8, 5e6d491, 6585622] | | 2024年度の貢献ポイントまとめ (TODO: Squash Mergeするのであとで消す) | + + +## [suomesta](https://github.com/suomesta) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, eb5bc29] | cpprefjp/fixm:2 | fix samples. `unique_ptr` with void is ill-formed | +| [commit cpprefjp/site, 04ff4ad] | cpprefjp/fixm:1 | fix expression of `extract()` of `multimap` and `multiset` | +| [commit cpprefjp/site, 6b3f0cb] | cpprefjp/fixm:33 | fix some minor typo | +| [commit cpprefjp/site, a2f9fa0, c576264] | cpprefjp/fixl:1, cpprefjp/addref:37 | update `basic_streambuf` class files | +| [commit cpprefjp/site, 3d75aee] | cpprefjp/link:6, cpprefjp/fixl:1, cpprefjp/fixm:2 | add link to streambuf. | +| [commit cpprefjp/site, 57afeb8] | cpprefjp/link:20, cpprefjp/fixm:2 | fix some wrong link | +| [commit cpprefjp/site, f70ffbb] | cpprefjp/fixm:1 | fix typo in sample | +| [commit cpprefjp/site, 428490d] | cpprefjp/fixm:8 | fix some typo | +| [commit cpprefjp/site, 44ce3c2] | cpprefjp/typo:1, cpprefjp/fixs:3, cpprefjp/fixm:3, cpprefjp/fixl:2, cpprefjp/link:2 | fix some typo | +| [commit cpprefjp/site, eee7895] | cpprefjp/link:1, cpprefjp/addref:15 | add reference of `` | +| [commit cpprefjp/site, 4d8ffbe] | cpprefjp/fixm:3, cpprefjp/link:1 | fix some typo | +| [commit cpprefjp/site, 729c591] | cpprefjp/fixm:5, cpprefjp/typo:1 | fix some typo | +| [commit cpprefjp/site, 978a520] | cpprefjp/fixl:3, cpprefjp/fixm:2 | fix some typo | +| [commit cpprefjp/site, d9fb8cf] | cpprefjp/fixl:1 | update link to C++26 working draft | +| [commit cpprefjp/site, 8583508, 3f17545] | cpprefjp/addref:3, cpprefjp/link:1, cpprefjp/fixl:1 | add pages `ranges_find_last(s)` to algorithm | +| [commit cpprefjp/site, 6df30cb] | cpprefjp/fixm:1 | fix sample to run | +| [commit cpprefjp/site, 75e450d] | cpprefjp/fixl:4 | fix description about constructor complexity in map and set | +| [commit cpprefjp/site, f45447e] | cpprefjp/fixl:4 | add range constructor to map and set | +| [commit cpprefjp/site, d0f20fc] | cpprefjp/fixl:4 | add range constructor to list, deque, and string | +| [commit cpprefjp/site, 3cac840] | cpprefjp/fixl:4 | add range constructor to unordered | +| [commit cpprefjp/site, 4cf72eb] | cpprefjp/fixl:1 | add range constructor to vector | +| [commit cpprefjp/site, 001b9fe] | cpprefjp/fixl:1 | add iterator and allocator constructor to priority_queue | +| [commit cpprefjp/site, 14cc1a0] | cpprefjp/fixl:3 | add range constructor to stack and queue | +| [commit cpprefjp/site, b067a8b] | cpprefjp/addref:1, cpprefjp/fixl:1 | add push_range to std::stack | +| [commit cpprefjp/site, 4739327] | cpprefjp/addref:2, cpprefjp/fixl:2 | add push_range to std::queue and std::priority_queue | +| [commit cpprefjp/site, ec423b7] | cpprefjp/addref:2, cpprefjp/fixl:2 | add insert_range to std::map and std::multimap | +| [commit cpprefjp/site, 2a00288] | cpprefjp/addref:2, cpprefjp/fixl:2 | add insert_range to std::set and std::multiset | +| [commit cpprefjp/site, 9235ec5] | cpprefjp/addref:2, cpprefjp/fixl:2 | add insert_range to std::unordered_map and std::unordered_multimap | +| [commit cpprefjp/site, 192845f] | cpprefjp/addref:2, cpprefjp/fixl:2 | add insert_range to std::unordered_set and std::unordered_multiset | +| [commit cpprefjp/site, 1276fca] | cpprefjp/addref:3, cpprefjp/fixl:1 | add append_range, assign_range and insert_range to std::vector | +| [commit cpprefjp/site, e2d69e3] | cpprefjp/addref:3, cpprefjp/fixl:1 | add append_range, assign_range and insert_range to std::string | +| [commit cpprefjp/site, 774a74a] | cpprefjp/addref:4, cpprefjp/fixl:1 | add append_range, assign_range, insert_range and prepend_range to std::deque | +| [commit cpprefjp/site, 1a35e93] | cpprefjp/addref:4, cpprefjp/fixl:1 | add append_range, assign_range, insert_range and prepend_range to std::list | +| [commit cpprefjp/site, d3eeb80] | cpprefjp/addref:3, cpprefjp/fixl:1 | add assign_range, insert_range_after and prepend_range to std::forward_list | +| [commit cpprefjp/site, 54b813b, dc0d6ab, e8e7d46] | cpprefjp/addref:1, cpprefjp/fixl:1, cpprefjp/link:1 | create resize_and_overwrite.md | +| [commit cpprefjp/site, 177ce6f] | cpprefjp/fixl:1 | update feature test macros of C++23 | +| [commit cpprefjp/site, e3e5ece] | cpprefjp/link:2 | add some links to feature test pages | +| [commit cpprefjp/site, 4212149] | cpprefjp/fixm:3 | fix typo in samples | + + +## [KisaragiEffective](https://github.com/KisaragiEffective) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, c284a82] | cpprefjp/compiler:2 | impl(C++11,ICC): アライメント指定がサポートされたバージョンを追加 | + + +## [range3](https://github.com/range3) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, a2f2ca3] | cpprefjp/fixm:1 | fix `forward_list::erase_after` sample code | + + +## [Joseph0304](https://github.com/Joseph0304) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, 28dc440, 10bce87] | tool/improves:1, cpprefjp/typo:1 | add "constepx" to NG words | +| [commit cpprefjp/site, c206a4c, 3fc04aa] | cpprefjp/typo:8 | typo修正 | + + +## [yohhoy](https://github.com/yohhoy) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, 4cbbdae, 9b4c3b8, 0a6aa59, 22a02d4] | cpprefjp/link:5, cpprefjp/addref:6, cpprefjp/fixl:1 | `functional/function_ref` | +| [commit cpprefjp/site, f1173da] | cpprefjp/link:1 | GLOBAL_QUALIFY_LIST: ``ヘッダへのリンク追加 | +| [commit cpprefjp/site, a0280b5, e440100, c7ab072, 3fa6638, 40ff587, 6342d39, dc7da61, 1ddfc8d, d862f0a, c473fc9, f736446, deacb47, c38cacd, 5f397d4, 609bb74, 14b6cb2, 75d3ea3, 8de03aa, b705d4a, 125994a, d2963f0, 4936e04, 5d73471, 7c5eb19, 979afd4, e24da03, 300f467] | cpprefjp/link:5, cpprefjp/addref:80 | `mdspan` | +| [commit cpprefjp/site, 967d060] | cpprefjp/fixl:1 | `basic_string/reserve`: C++26 P2870R3対応 | +| [commit cpprefjp/site, 754290d] | cpprefjp/fixm:7 | 用語統一: 直接非リスト初期化(direct-non-list-initialization) | +| [commit cpprefjp/site, 743eef7] | cpprefjp/fixm:1 | generator: 例示追加 第2テンプレートパラメータV利用 | +| [commit cpprefjp/site, 02d3eac] | cpprefjp/addref:5, cpprefjp/link:2 | numeric: 飽和演算 | +| [commit cpprefjp/site, 284b03c] | cpprefjp/addref:5, cpprefjp/fixl:9 | generator: 説明増補 | +| [commit cpprefjp/site, d3354b9, ea5cfe4, 9f57615, ad3c244, c27c81f, 422aeb5, 2eb18f4, 2079dde, 89ae27b, 0ee79ff] | cpprefjp/addref:18, cpprefjp/link:6 | linalg | +| [commit cpprefjp/site, 5be9a45] | cpprefjp/fixs:1 | cpp11/range_based_for: markup code | +| [commit cpprefjp/site, b6148ac] | cpprefjp/fixl:2 | chrono/last_spec: 説明の表現調整 | +| [commit cpprefjp/site, 5d0c100] | cpprefjp/fixm:1 | layout_blas_packed/mapping: fix markup | +| [commit cpprefjp/site, 17c594a, 417ea30] | cpprefjp/link:3, cpprefjp/fixl:3, cpprefjp/addref:1 | span,mdspan: C++26 P3029R1対応 | +| [commit cpprefjp/site, 2a6ccb4] | cpprefjp/link:2 | fix links to `swappable_with` concept | +| [commit cpprefjp/site, d73c2fc] | cpprefjp/fixm:14 | linalg: refine BLAS1 functions | +| [commit cpprefjp/site, 0ed791c] | cpprefjp/fixl:2 | mdspan/dims: C++26 P2389R2対応 | +| [commit cpprefjp/site, 86cd612] | cpprefjp/fixl:1 | functional/reference_wrapper: LWG3041へ言及 | +| [commit cpprefjp/site, da93e92, 246e875, 01cb107, e88b8d5, 2276b3a, 86c310c, 5c9ff3e, 8c041b3, 110d328] | cpprefjp/addref:25, cpprefjp/fixl:9, cpprefjp/fixm:1 | mdspan: layout_{left,right}_padded概要 P2642R6 | +| [commit cpprefjp/site, 38cc9e4] | cpprefjp/fixm:4 | linalg: 表示崩れを修正 | +| [commit cpprefjp/site, 735b35e] | cpprefjp/addref:4, cpprefjp/link:42, cpprefjp/fixm:1 | linalg: 入出力引数コンセプトの説明追加 | +| [commit cpprefjp/site, 2e1d2fe] | cpprefjp/fixm:2 | chrono: `leap_second_info`例示コード改定(GCC13.2) | +| [commit cpprefjp/site, 022d8d8] | cpprefjp/fixm:1 | chrono/`leap_second`: 例示コード修正(GCC13.2) | +| [commit cpprefjp/site, 072cb24] | cpprefjp/fixm:1 | start_editing: 自動テストの一覧を最新化 | +| [commit cpprefjp/site, 2a47b4b] | cpprefjp/fixm:5 | chrono: `gps_clock`,`gps_time`例示コード調整 | + + +## [hi-hori](https://github.com/hi-hori) +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, 323fd20] | cpprefjp/fixm:1 | `std::ranges::views::all` ページ上部の名前空間表示を `std::ranges` から `std::ranges::views` に修正 | + + +## [kamitani08](https://github.com/kamitani08) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, 83974c1] | cpprefjp/fixm:1 | 「スコープ付き列挙型のusing宣言」のサンプルコードを修正 | + + +## [wx257osn2](https://github.com/wx257osn2) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, 5dd1e3f, 1d65e5e] | cpprefjp/fixl:1 | change description about deprecation of `std::allocator` | +| [commit cpprefjp/site, ce9c6a0] | cpprefjp/typo:1 | fix typo | +| [commit cpprefjp/site, 8cc238c] | cpprefjp/fixs:1 | fix typo (print -> println) | +| [commit cpprefjp/site, c809726] | cpprefjp/typo:1 | fix typo | + + +## [reika727](https://github.com/reika727) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, a110a7d] | cpprefjp/typo:1 | Fix typo | +| [commit cpprefjp/site, 99f2abb] | cpprefjp/fixm:1 | 見出しを修正("列挙型" -> "到達しない表明") | + + +## [komori-n](https://github.com/komori-n) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, a474b05] | cpprefjp/link:1 | `microseconds`と`weeks`のグローバル修飾を追加 | +| [commit cpprefjp/site, a897609] | cpprefjp/fixl:1 | fix: fix argument order for `scoped_lock` | +| [commit cpprefjp/site, 9f61fd2] | cpprefjp/fixl:1 | `shared_ptr::operator*` の定義される条件を修正 | + + +## [tshino](https://github.com/tshino) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, 082924e, 170b0f3] | cpprefjp/fixm:2 | `expected::error_or()` の戻り値型を `T` から `E` に修正 | +| [commit cpprefjp/site, 4796c01, eddd595, 8e854b8, b9d4a50, 599f09f, 2486f06] | cpprefjp/fixl:5 | `promise`デストラクタの効果に例外を格納する動作を追記 | +| [commit cpprefjp/site, 1774c35] | cpprefjp/fixl:1 | `tuple_cat`の要件の修正 | +| [commit cpprefjp/site, 94669bf] | cpprefjp/fixm:1 | コードコメント内の提案文書番号の修正 | + + +## [h-sao](https://github.com/h-sao) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, 6b1921e, 6d8a2a3] | cpprefjp/compiler:5 | Update implementation-status.md for ICX C++20 | +| [commit cpprefjp/site, ddce954, b064d83] | | Fixed [implementation-status]MSVCの対応間違い修正 (revert) | + + + +## [fktn-k](https://github.com/fktn-k) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, f99e99b] | cpprefjp/typo:1 | fixed typo: `find_last_nof_of` -> `find_last_not_of` | + + +## [grafi-tt](https://github.com/grafi-tt) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, aff8e92] | cpprefjp/link:1 | Add links to `ranges::swap` and `iter_swap` | +| [commit cpprefjp/site, 0265481] | cpprefjp/link:1 | Add links to basic_istream/read.md | + + +## [nakashima-hikaru](https://github.com/nakashima-hikaru) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, 2bb90e8] | cpprefjp/fixm:1 | fix typo | + + +## [yknishidate](https://github.com/yknishidate) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, 329b44c] | cpprefjp/fixs:1 | `nextafter`の説明を修正 | +| [commit cpprefjp/site, f1c050d] | cpprefjp/fixm:1 | Fix typo | + + +## [akinomyoga](https://github.com/akinomyoga) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, 1e87ee5] | cpprefjp/fixs:13 | fix(cmath): 特殊関数名において「第一種 → 第1種」のように表記修正 | +| [commit cpprefjp/site, 2f454c1] | cpprefjp/fixm:1 | style(cmath): Markdown 表組みの横幅揃え | +| [commit cpprefjp/site, b4d914d] | cpprefjp/link:10 | fix(cmath): 第n種特殊関数間を相互リンク | +| [commit cpprefjp/site, 120f1f6] | cpprefjp/fixm:2 | reference/string/sto{d,ld}: 出力例を修正 | +| [commit cpprefjp/site, 3d8a0ae] | tool/improvem:1 | github: check out the "image" repository | +| [commit cpprefjp/site, 8161c93] | cpprefjp/link:23 | imageリポジトリの画像URLを標準化 | +| [commit cpprefjp/site, 2b623ec] | cpprefjp/fixs:8 | ``: Synopsisスタイル修正 `"namespace std {"` | +| [commit cpprefjp/site, d8a5fc4] | tool/improvem:1 | ローカル閲覧用設定をCIのbuild.shに追加 | +| [commit cpprefjp/site, 6010481] | cpprefjp/fixm:1 | GLOBAL_DEFINED_WORDS: EB に倣い UB も英名を表記 | +| [commit cpprefjp/site, 28eb999] | cpprefjp/fixl:1, cpprefjp/link:1 | 標準規格と処理系: エラー性の動作を言及 | +| [commit cpprefjp/site, ca64b9a] | cpprefjp/fixm:1 | GLOBAL_DEFINED_WORDS: 読み仮名を補完 | +| [commit cpprefjp/site, 5259ff6] | cpprefjp/fixm:4 | `unordered_{map,set}/*/insert_range`: 「コードブロックのあとに空行が必要な制限」に纏わる修正 | +| [commit cpprefjp/site_generator, 7bb8a95, 340f778, 69881c0, 3d0aa6b], [commit cpprefjp/markdown_to_html, 09e3f63, 3d0aa6b], [commit cpprefjp/kunai, f2a4162, 93678a3, 8e1dbf1, ef44d54, b66c4d7, 9c16b08], [commit cpprefjp/crsearch, 7ef2d8d, c8a7a35, 6f1b714, 0fab6a0], [commit boostjp/site, 4aae24a, d155fa1] | boostjp/link:6, tool/improves:3, tool/improvem:3, tool/improvel:21 | 内部リンクを相対リンクで生成する機能 | + + +## [Nagarei](https://github.com/Nagarei) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, 4bfd491] | cpprefjp/fixm:1 | fix typo in algorithm's sample code | +| [commit cpprefjp/site, fabe7cb] | cpprefjp/fixm:1 | fix typo in sample code | +| [commit cpprefjp/site, 0a7bbed] | cpprefjp/fixl:1 | `std::async` throw `std::system_error` | +| [commit cpprefjp/site, 6e08bd6] | cpprefjp/fixm:1 | fix typo: `zoned_time` のサンプルコード修正 | +| [commit cpprefjp/site, 7da4216] | cpprefjp/fixl:1 | Add missing `noexcept` in `shared_ptr::shared_ptr(nullptr_t)` | + + +## [Kiterai](https://github.com/Kiterai) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, bcfaf97] | cpprefjp/fixm:1 | Update pragma_operator.md | +| [commit cpprefjp/site, bf71e35] | cpprefjp/fixm:1 | Update remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md Lの抜けを修正 | +| [commit cpprefjp/site, 8dcfab5] | cpprefjp/fixm:1 | Update remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md é́(\u0065\u0301\u0301)になっていたのでコメントに揃えた | + + +## [HansRobo](https://github.com/HansRobo) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, 5871133] | cpprefjp/typo:1 | `std::piecewise_linear_distribution::min` の `min` が `mix` になっていたのを修正しました | +| [commit cpprefjp/site, 40638a6] | cpprefjp/typo:1 | fix typo in constexpr_lambda.md | + + +## [kusunosetoru](https://github.com/kusunosetoru) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, dd7c42c] | cpprefjp/fixl:1 | Update labels_at_the_end_of_compound_statements.md 参照するCバージョンの修正とその他文言変更 | + + +## [sukeya](https://github.com/sukeya) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, 00d8910, 0bf7edf, 3ae8098, 0f8f840, 1a60840, def14f7, 252ccdb, 70edaac, 6c6e404, f44efba, 0cebcd7, 93c8059, b2241cc, 6d90730, 90fce64, 6b11b92, 3382e49, 2ec4f19, 439aede, ee14b21, 2db36f3, fec7d6a, d8117d8, d741acc, c47e021, 53a8393, eed3fa0, c5cacdf, d9a7c78, 1e07392, e02d8af, 9a7ce19, d09b68e, 5e3a1e9, 2b134c3, d565808, 1b89c3c, 083e86c, 7cad829, 0512389, ac5303a, c8d55fb, 1a80743, 7f99ece, 902bbca, 4f45356, ef67876, e80f97d, b283728, ba49e5a, 279afa6, 2dc1e5a, dcd9949, d00e1cd, 8585636, e7325de, e1b7ee3, e71dc91, dbb77b6, 5125497, 5726d37, 257b66d, 8efd3c9, ac2ed4c, d837379, eefba0f, 048b96e, a6e4d8d, c9baae0, 2d887fe, b6e197f, 77b5520, 7282dc3, 0909134, eac2703, 54b9c75, a65c8e5, 5e743f5, 4b1055b, 3ea7333, 45af15c, 96e31dd, 357e1db, 42e737a, 7d2dee7, ad3c81f, 049395f, dae7d3d, fe869d5, c84c788, bb6a33f, ad1f2ed, 5855664, f90532b, d035fff, f0a78be, ab8a6b1, cbd3dfc, ed8ddfe, e5940e4, 271535e] | cpprefjp/fixl:3, cpprefjp/addref:53 | linalg | +| [commit cpprefjp/site, ea903c0] | cpprefjp/link:3 | `borrowed_iterator_t`へのリンクを削除 | +| [commit cpprefjp/site, 37f60c5] | cpprefjp/fixm:1 | `std::unique_ptr`に自作デリータの使用例を追加 | +| [commit cpprefjp/site, 9df544a] | cpprefjp/fixm:2 | multisetとmultimapのmergeの説明の修正とICCのバージョンの追加 | +| [commit cpprefjp/site, 00567b3, 54bc557] | cpprefjp/fixs:1 | 誤植を訂正 | + +memo: + +conj-if-needed.md (fixl) +layout_blas_packed (fixl) +abs-if-needed.md +add.md +addable.md +apply_givens_rotation.md +compatible-static-extents.md +copy +dot +dotc +explicit_diagonal_t.md +hermitian_martix_product +hermitian_matrix_rank_1_update +hermitian_matrix_rank_2_update +hermitian_matrix_rank_k_update +hermitian_matrix_rank_2k_update +hermitian_matrix_vector_product +imag-if-needed.md +implicit_unit_diagonal_t.md +is_mdspan.md +lower_triangle_t.md +matrix_frob_norm +matrix_inf_norm +matrix_one_norm +matrix_product +matrix_rank_1_update +matrix_rank_1_update_c +matrix_vector_product.md +multipliable.md +possibly-addable.md +possibly-multipliable.md +real-if-needed.md +scale +setup_givens_rotation.md +setup_givens_rotation_result.md +sum_of_squares_result.md +swap_elements +symmetric_matrix_product +symmetric_matrix_rank_1_update +symmetric_matrix_rank_2_update +symmetric_matrix_rank_k_update +symmetric_matrix_rank_2k_update +symmetric_matrix_vector_product +triangular_matrix_product +triangular_matrix_vector_product +triangular_matrix_vector_solve +triangular_matrix_left_product +triangular_matrix_right_product +triangular_matrix_matrix_left_solve +triangular_matrix_matrix_right_solve +upper_triangle_t.md +vector_abs_sum.md +vector_idx_abs_max +vector_sum_of_squares.md +vector_two_norm.md + +## [yuina-blend](https://github.com/yuina-blend) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, b18e998] | cpprefjp/compiler:1 | [Update] GCCの動作確認バージョンを追記 | +| [commit cpprefjp/site, 60b7734] | cpprefjp/fixm:1 | [Fix] 出力例を修正 | +| [commit cpprefjp/site, 1308e37] | cpprefjp/fixm:1 | [Fix] typo | +| [commit cpprefjp/site, b28fd07] | cpprefjp/fixm:1 | [Update] gccの動作確認バージョンを追記 | +| [commit cpprefjp/site, 8aa06cd, 643030c] | cpprefjp/typo:2 | [Fix] srtingとなっていたので修正 | + + + +## [Raclamusi](https://github.com/Raclamusi) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, 005f130] | | Revert "Merge branch 'master' | +| [commit cpprefjp/site, 0b27920] | cpprefjp/fixm:12 | インラインコードブロックの範囲を修正 | +| [commit cpprefjp/site, ddd8063] | cpprefjp/fixm:10 | インラインコードブロックの全角文字の typo を修正 | +| [commit cpprefjp/site, d9d9c67] | cpprefjp/typo:1 | fix typo | +| [commit cpprefjp/site, f9d46be] | cpprefjp/fixm:1 | コメントの誤りを修正 | +| [commit cpprefjp/site, 24f1649] | cpprefjp/fixl:1 | `llrint()` のページの `lround()` を `llround()` に変更 | +| [commit cpprefjp/kunai, d0c3aed] | tool/improvem:1 | メンバ関数のそれぞれの項目の左隣に余計な下線が出る問題を修正 | +| [commit cpprefjp/kunai, cc5601f] | tool/improvem:1 | インラインコードブロックがはみ出さないように修正 | + + +## [zbdk](https://github.com/zbdk) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, 0b7fd16] | cpprefjp/fixm:2 | fix typos | + + +## [altzweel](https://github.com/altzweel) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, e6c613a] | cpprefjp/fixm:1 | ranges::containsの実装例がコンパイルエラーなのを修正 | + + +## [nna774](https://github.com/nna774) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, 40187a0] | cpprefjp/typo:1 | fix quote mismatch | + + + +## [y121516](https://github.com/y121516) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, 9952462] | cpprefjp/compiler:1 | Update implementation.md | + + +## [lpha-z](https://github.com/lpha-z) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, 1cb0ea1] | cpprefjp/link:1 | `uniform_real_distribution`: 範囲外が出ることがある件の参照追加 | +| [commit cpprefjp/site, 51384f5] | cpprefjp/fixm:1 | 不自然な日本語を修正 | +| [commit cpprefjp/site, caa8159] | cpprefjp/fixm:1 | コードの誤りを修正 | + + +## [k-satoda](https://github.com/k-satoda) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, a114975, 7f7759e, c965e26, 7e68271, aeee953, 5e8c37d, a81c832, 894cbd9, 1c11eb8] | cpprefjp/fixl:1, cpprefjp/fixm:1 | C++26 : 「未初期化変数の読み取りをエラー性動作とする」を追加 | + + + +## [TatsukiKUROSAWA](https://github.com/TatsukiKUROSAWA) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, 2eda716] | cpprefjp/fixl:1 | `gps_clock`のエポックを修正 | + + +## [biobios](https://github.com/biobios) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, eee0ae9] | cpprefjp/fixl:1 | コンストラクタ引数の誤りを修正 | +| [commit cpprefjp/site, 3f56e5b] | cpprefjp/typo:1 | fix typo | + + +## [ROCKTAKEY](https://github.com/ROCKTAKEY) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit boostjp/site, cde7074] | boostjp/fixm:1 | `std::tuple`へのリンクを追加 | +| [commit boostjp/site, aad03ea] | boostjp/fixm:1 | `std::array`へのリンクを追加 | +| [commit boostjp/site, 37e7f74] | boostjp/fixm:1 | `std::function`へのリンクを追加 | +| [commit boostjp/site, b264472] | boostjp/fixm:1 | ``へのリンクを追加 | +| [commit boostjp/site, c7cf8fb] | boostjp/fixm:1 | `std::format`へのリンクを追加 | +| [commit boostjp/site, e14da03] | boostjp/fixm:1 | `std::move`へのリンクを追加 | +| [commit boostjp/site, 022a200] | boostjp/fixm:1 | C++11のラムダ式へのリンクを追加 | +| [commit boostjp/site, b6e1437] | boostjp/fixm:1 | `std::bind`へのリンクを追加 | +| [commit boostjp/site, eab43a6] | boostjp/fixm:1 | C++11で追加された乱数ライブラリへのリンクを追加 | +| [commit boostjp/site, cb4363b] | boostjp/fixm:1 | C++11で追加されたスマートポインタへのリンクを追加 | +| [commit boostjp/site, f75e7b5] | boostjp/fixm:1 | `std::thread`へのリンクを追加 | +| [commit boostjp/site, cd17af6] | boostjp/fixm:1 | ``へのリンクを追加 | + From 3d0a0ffd1ff50301ba46885d49a683a1f47315c2 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sun, 1 Dec 2024 15:10:51 +0900 Subject: [PATCH 1289/3948] =?UTF-8?q?memo=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start_editing/contribution_stats_2024.md | 57 ------------------------ 1 file changed, 57 deletions(-) diff --git a/start_editing/contribution_stats_2024.md b/start_editing/contribution_stats_2024.md index 26b3754481..36de1bd9f5 100644 --- a/start_editing/contribution_stats_2024.md +++ b/start_editing/contribution_stats_2024.md @@ -527,63 +527,6 @@ | [commit cpprefjp/site, 9df544a] | cpprefjp/fixm:2 | multisetとmultimapのmergeの説明の修正とICCのバージョンの追加 | | [commit cpprefjp/site, 00567b3, 54bc557] | cpprefjp/fixs:1 | 誤植を訂正 | -memo: - -conj-if-needed.md (fixl) -layout_blas_packed (fixl) -abs-if-needed.md -add.md -addable.md -apply_givens_rotation.md -compatible-static-extents.md -copy -dot -dotc -explicit_diagonal_t.md -hermitian_martix_product -hermitian_matrix_rank_1_update -hermitian_matrix_rank_2_update -hermitian_matrix_rank_k_update -hermitian_matrix_rank_2k_update -hermitian_matrix_vector_product -imag-if-needed.md -implicit_unit_diagonal_t.md -is_mdspan.md -lower_triangle_t.md -matrix_frob_norm -matrix_inf_norm -matrix_one_norm -matrix_product -matrix_rank_1_update -matrix_rank_1_update_c -matrix_vector_product.md -multipliable.md -possibly-addable.md -possibly-multipliable.md -real-if-needed.md -scale -setup_givens_rotation.md -setup_givens_rotation_result.md -sum_of_squares_result.md -swap_elements -symmetric_matrix_product -symmetric_matrix_rank_1_update -symmetric_matrix_rank_2_update -symmetric_matrix_rank_k_update -symmetric_matrix_rank_2k_update -symmetric_matrix_vector_product -triangular_matrix_product -triangular_matrix_vector_product -triangular_matrix_vector_solve -triangular_matrix_left_product -triangular_matrix_right_product -triangular_matrix_matrix_left_solve -triangular_matrix_matrix_right_solve -upper_triangle_t.md -vector_abs_sum.md -vector_idx_abs_max -vector_sum_of_squares.md -vector_two_norm.md ## [yuina-blend](https://github.com/yuina-blend) From 8d7953c5bd768d3ee88ab1b222fdbe59dd24335f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 4 Dec 2024 14:04:19 +0900 Subject: [PATCH 1290/3948] =?UTF-8?q?=E7=94=A8=E8=AA=9E:=20=E8=BF=B0?= =?UTF-8?q?=E8=AA=9E=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_DEFINED_WORDS.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/GLOBAL_DEFINED_WORDS.json b/GLOBAL_DEFINED_WORDS.json index a80003570e..0ad0e16ce8 100644 --- a/GLOBAL_DEFINED_WORDS.json +++ b/GLOBAL_DEFINED_WORDS.json @@ -126,5 +126,9 @@ }, "オーバーロード解決": { "desc": "関数呼び出し時に、同名の関数の中から実際に呼び出す関数を決定する処理。このときの候補になることを、オーバーロード解決に参加するという" + }, + "述語": { + "yomi": "じゅつご", + "desc": "boolを返す関数・関数オブジェクト。predicate" } } From d609dd117b52b3e844666f2697222ce06c0d469a Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 4 Dec 2024 14:32:39 +0900 Subject: [PATCH 1291/3948] =?UTF-8?q?=E6=8B=A1=E5=BC=B5=E6=B5=AE=E5=8B=95?= =?UTF-8?q?=E5=B0=8F=E6=95=B0=E7=82=B9=E6=95=B0=E5=9E=8B=E3=81=AE=E5=A4=89?= =?UTF-8?q?=E6=8F=9B=E9=A0=86=E4=BD=8D=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E3=81=A8=E8=BF=BD=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/stdfloat/bfloat16_t.md | 6 +++--- reference/stdfloat/float128_t.md | 6 +++--- reference/stdfloat/float16_t.md | 6 +++--- reference/stdfloat/float32_t.md | 6 +++--- reference/stdfloat/float64_t.md | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/reference/stdfloat/bfloat16_t.md b/reference/stdfloat/bfloat16_t.md index d4b04444ad..a95b671e0e 100644 --- a/reference/stdfloat/bfloat16_t.md +++ b/reference/stdfloat/bfloat16_t.md @@ -45,10 +45,10 @@ std::bfloat16_t b = 2.0BF16; - `long double` > `double` > `float`のように、`long double`が最も高い順位をもつ - 同じ値集合をもつ2つの拡張浮動小数点数型は、同じ順位をもつ -- 標準浮動小数点数型と同じ値集合をもつ拡張浮動小数点数型は、同じ順位をもつ -- 標準浮動小数点数型より多くの値集合をもつ拡張浮動小数点数型は、`double`と同じ順位をもつ +- 1つの標準浮動小数点数型だけと同じ値集合をもつ拡張浮動小数点数型は、その型と同じ順位をもつ +- 2つ以上の標準浮動小数点数型と同じ値集合をもつ拡張浮動小数点数型は、`double`と同じ順位をもつ -注意として、浮動小数点数型`T1`の値集合が浮動小数点数型`T2`の値集合の部分集合でも上位集合でもない場合、浮動小数点数型`T1`と`T2`の変換順位は順位通りではない。これは、一方の型が他方より大きな範囲と低い精度の両方を持つ場合に起こり得る。 +注意として、浮動小数点数型`T1`の値集合が浮動小数点数型`T2`の値集合の部分集合でも上位集合でもない場合、浮動小数点数型`T1`と`T2`の変換順位は定義されない。これは、一方の型が他方より大きな範囲と低い精度の両方を持つ場合に起こり得る。例えば、`std::float16_t`と`std::bfloat16_t`の間には変換順位が付かず、相互に暗黙変換できない。 順位が同じ浮動小数点数型は、サブ順位 (subrank) で順序付けられる。拡張浮動小数点数は、標準浮動小数点数型よりも大きなサブ順位をもつ。 diff --git a/reference/stdfloat/float128_t.md b/reference/stdfloat/float128_t.md index 0472946b48..6ff96cea27 100644 --- a/reference/stdfloat/float128_t.md +++ b/reference/stdfloat/float128_t.md @@ -41,10 +41,10 @@ std::float128_t b = 2.0F128; - `long double` > `double` > `float`のように、`long double`が最も高い順位をもつ - 同じ値集合をもつ2つの拡張浮動小数点数型は、同じ順位をもつ -- 標準浮動小数点数型と同じ値集合をもつ拡張浮動小数点数型は、同じ順位をもつ -- 標準浮動小数点数型より多くの値集合をもつ拡張浮動小数点数型は、`double`と同じ順位をもつ +- 1つの標準浮動小数点数型だけと同じ値集合をもつ拡張浮動小数点数型は、その型と同じ順位をもつ +- 2つ以上の標準浮動小数点数型と同じ値集合をもつ拡張浮動小数点数型は、`double`と同じ順位をもつ -注意として、浮動小数点数型`T1`の値集合が浮動小数点数型`T2`の値集合の部分集合でも上位集合でもない場合、浮動小数点数型`T1`と`T2`の変換順位は順位通りではない。これは、一方の型が他方より大きな範囲と低い精度の両方を持つ場合に起こり得る。 +注意として、浮動小数点数型`T1`の値集合が浮動小数点数型`T2`の値集合の部分集合でも上位集合でもない場合、浮動小数点数型`T1`と`T2`の変換順位は定義されない。これは、一方の型が他方より大きな範囲と低い精度の両方を持つ場合に起こり得る。例えば、`std::float16_t`と`std::bfloat16_t`の間には変換順位が付かず、相互に暗黙変換できない。 順位が同じ浮動小数点数型は、サブ順位 (subrank) で順序付けられる。拡張浮動小数点数は、標準浮動小数点数型よりも大きなサブ順位をもつ。 diff --git a/reference/stdfloat/float16_t.md b/reference/stdfloat/float16_t.md index 6834622594..c5aa48420e 100644 --- a/reference/stdfloat/float16_t.md +++ b/reference/stdfloat/float16_t.md @@ -41,10 +41,10 @@ std::float16_t b = 2.0F16; - `long double` > `double` > `float`のように、`long double`が最も高い順位をもつ - 同じ値集合をもつ2つの拡張浮動小数点数型は、同じ順位をもつ -- 標準浮動小数点数型と同じ値集合をもつ拡張浮動小数点数型は、同じ順位をもつ -- 標準浮動小数点数型より多くの値集合をもつ拡張浮動小数点数型は、`double`と同じ順位をもつ +- 1つの標準浮動小数点数型だけと同じ値集合をもつ拡張浮動小数点数型は、その型と同じ順位をもつ +- 2つ以上の標準浮動小数点数型と同じ値集合をもつ拡張浮動小数点数型は、`double`と同じ順位をもつ -注意として、浮動小数点数型`T1`の値集合が浮動小数点数型`T2`の値集合の部分集合でも上位集合でもない場合、浮動小数点数型`T1`と`T2`の変換順位は順位通りではない。これは、一方の型が他方より大きな範囲と低い精度の両方を持つ場合に起こり得る。 +注意として、浮動小数点数型`T1`の値集合が浮動小数点数型`T2`の値集合の部分集合でも上位集合でもない場合、浮動小数点数型`T1`と`T2`の変換順位は定義されない。これは、一方の型が他方より大きな範囲と低い精度の両方を持つ場合に起こり得る。例えば、`std::float16_t`と`std::bfloat16_t`の間には変換順位が付かず、相互に暗黙変換できない。 順位が同じ浮動小数点数型は、サブ順位 (subrank) で順序付けられる。拡張浮動小数点数は、標準浮動小数点数型よりも大きなサブ順位をもつ。 diff --git a/reference/stdfloat/float32_t.md b/reference/stdfloat/float32_t.md index 3ffb0ed3c9..7cafe5f138 100644 --- a/reference/stdfloat/float32_t.md +++ b/reference/stdfloat/float32_t.md @@ -41,10 +41,10 @@ std::float32_t b = 2.0F32; - `long double` > `double` > `float`のように、`long double`が最も高い順位をもつ - 同じ値集合をもつ2つの拡張浮動小数点数型は、同じ順位をもつ -- 標準浮動小数点数型と同じ値集合をもつ拡張浮動小数点数型は、同じ順位をもつ -- 標準浮動小数点数型より多くの値集合をもつ拡張浮動小数点数型は、`double`と同じ順位をもつ +- 1つの標準浮動小数点数型だけと同じ値集合をもつ拡張浮動小数点数型は、その型と同じ順位をもつ +- 2つ以上の標準浮動小数点数型と同じ値集合をもつ拡張浮動小数点数型は、`double`と同じ順位をもつ -注意として、浮動小数点数型`T1`の値集合が浮動小数点数型`T2`の値集合の部分集合でも上位集合でもない場合、浮動小数点数型`T1`と`T2`の変換順位は順位通りではない。これは、一方の型が他方より大きな範囲と低い精度の両方を持つ場合に起こり得る。 +注意として、浮動小数点数型`T1`の値集合が浮動小数点数型`T2`の値集合の部分集合でも上位集合でもない場合、浮動小数点数型`T1`と`T2`の変換順位は定義されない。これは、一方の型が他方より大きな範囲と低い精度の両方を持つ場合に起こり得る。例えば、`std::float16_t`と`std::bfloat16_t`の間には変換順位が付かず、相互に暗黙変換できない。 順位が同じ浮動小数点数型は、サブ順位 (subrank) で順序付けられる。拡張浮動小数点数は、標準浮動小数点数型よりも大きなサブ順位をもつ。 diff --git a/reference/stdfloat/float64_t.md b/reference/stdfloat/float64_t.md index b1e89ed2a9..4c33f3b61c 100644 --- a/reference/stdfloat/float64_t.md +++ b/reference/stdfloat/float64_t.md @@ -41,10 +41,10 @@ std::float64_t b = 2.0F64; - `long double` > `double` > `float`のように、`long double`が最も高い順位をもつ - 同じ値集合をもつ2つの拡張浮動小数点数型は、同じ順位をもつ -- 標準浮動小数点数型と同じ値集合をもつ拡張浮動小数点数型は、同じ順位をもつ -- 標準浮動小数点数型より多くの値集合をもつ拡張浮動小数点数型は、`double`と同じ順位をもつ +- 1つの標準浮動小数点数型だけと同じ値集合をもつ拡張浮動小数点数型は、その型と同じ順位をもつ +- 2つ以上の標準浮動小数点数型と同じ値集合をもつ拡張浮動小数点数型は、`double`と同じ順位をもつ -注意として、浮動小数点数型`T1`の値集合が浮動小数点数型`T2`の値集合の部分集合でも上位集合でもない場合、浮動小数点数型`T1`と`T2`の変換順位は順位通りではない。これは、一方の型が他方より大きな範囲と低い精度の両方を持つ場合に起こり得る。 +注意として、浮動小数点数型`T1`の値集合が浮動小数点数型`T2`の値集合の部分集合でも上位集合でもない場合、浮動小数点数型`T1`と`T2`の変換順位は定義されない。これは、一方の型が他方より大きな範囲と低い精度の両方を持つ場合に起こり得る。例えば、`std::float16_t`と`std::bfloat16_t`の間には変換順位が付かず、相互に暗黙変換できない。 順位が同じ浮動小数点数型は、サブ順位 (subrank) で順序付けられる。拡張浮動小数点数は、標準浮動小数点数型よりも大きなサブ順位をもつ。 From 2273c7261b1c4dd66d2e6de80cda52903da563a4 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 5 Dec 2024 11:54:34 +0900 Subject: [PATCH 1292/3948] =?UTF-8?q?=E8=A1=A8=E7=A4=BA=E5=B4=A9=E3=82=8C?= =?UTF-8?q?=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF=E3=81=AECI=E3=81=A8?= =?UTF-8?q?=E3=81=97=E3=81=A6=E3=80=81=E7=AE=87=E6=9D=A1=E6=9B=B8=E3=81=8D?= =?UTF-8?q?=E3=81=AE=E3=82=A4=E3=83=B3=E3=83=87=E3=83=B3=E3=83=88=E3=82=92?= =?UTF-8?q?=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF=20#1362?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/display_error_check.yml | 19 +++++++ .../workflows/script/display_error_check.py | 57 +++++++++++++++++++ lang/cpp11/static_assert.md | 4 +- lang/cpp17/guaranteed_copy_elision.md | 18 +++--- ...etime_extension_in_range_based_for_loop.md | 4 +- reference/algorithm.md | 8 +-- .../compare/partial_ordering/op_equal.md | 6 +- reference/compare/strong_ordering/op_equal.md | 6 +- reference/compare/weak_ordering/op_equal.md | 6 +- reference/concepts/swap.md | 8 +-- .../copyable_function/op_constructor.md | 4 +- reference/iterator/data.md | 24 ++++---- reference/iterator/empty.md | 24 ++++---- reference/iterator/move_iterator/op_assign.md | 10 ++-- .../iterator/move_iterator/op_constructor.md | 8 +-- .../iterator/reverse_iterator/op_assign.md | 10 ++-- .../reverse_iterator/op_constructor.md | 8 +-- reference/iterator/size.md | 24 ++++---- reference/linalg/hermitian_matrix_product.md | 4 +- .../linalg/hermitian_matrix_rank_1_update.md | 8 +-- .../linalg/hermitian_matrix_rank_2_update.md | 6 +- .../linalg/hermitian_matrix_vector_product.md | 12 ++-- reference/linalg/symmetric_matrix_product.md | 6 +- .../linalg/symmetric_matrix_rank_1_update.md | 8 +-- .../linalg/symmetric_matrix_rank_2_update.md | 6 +- .../linalg/symmetric_matrix_vector_product.md | 8 +-- reference/linalg/triangular_matrix_product.md | 6 +- .../triangular_matrix_vector_product.md | 14 ++--- .../linalg/triangular_matrix_vector_solve.md | 14 ++--- .../ranges_uninitialized_default_construct.md | 2 +- .../memory/uninitialized_default_construct.md | 2 +- .../uninitialized_default_construct_n.md | 2 +- .../node_handle/node_handle/op_assign.md | 9 ++- reference/random/generate_random.md | 2 +- .../op_constructor.md | 2 +- .../basic_streambuf/op_constructor.md | 28 ++++----- reference/type_traits/common_type.md | 4 +- .../unordered_set/unordered_set/insert.md | 2 +- start_editing.md | 2 + 39 files changed, 236 insertions(+), 159 deletions(-) create mode 100644 .github/workflows/display_error_check.yml create mode 100644 .github/workflows/script/display_error_check.py diff --git a/.github/workflows/display_error_check.yml b/.github/workflows/display_error_check.yml new file mode 100644 index 0000000000..54768c9d50 --- /dev/null +++ b/.github/workflows/display_error_check.yml @@ -0,0 +1,19 @@ +name: display error check + +on: [push, pull_request, workflow_dispatch] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install requests + - uses: actions/checkout@v4 + - name: check + run: python3 .github/workflows/script/display_error_check.py diff --git a/.github/workflows/script/display_error_check.py b/.github/workflows/script/display_error_check.py new file mode 100644 index 0000000000..c446b805e4 --- /dev/null +++ b/.github/workflows/script/display_error_check.py @@ -0,0 +1,57 @@ +import glob +import os +import sys +import re + +# consider tab +def indent_length(s: str) -> int: + length = 0 + for x in s: + length += 1 if x == " " else 4 + return length + +def check_item_indent(line: str, line_no: int, filename: str) -> bool: + m = re.match(r'^(\s*?)([0-9] \.\s)', line) + if m: + indent: int = indent_length(m[1]) + if indent > 0 and indent % 4 != 0: + print("{}:{}: number item indent {} shoule be 4. line:{}".format(filename, line_no, indent, line)) + return False + return True + + m = re.match(r'^(\s*?)([+-]\s)', line) + if m: + indent: int = indent_length(m[1]) + if indent > 0 and indent % 4 != 0: + print("{}:{}: item indent {} shoule be 4. line:{}".format(filename, line_no, indent, line)) + return False + return True + +def check_display_error(text: str, filename: str) -> bool: + found_error: bool = False + in_code_block: bool = False + + for i, line in enumerate(text.split("\n")): + is_code_block = line.strip().startswith("```") + if is_code_block: + in_code_block = not in_code_block + continue + if in_code_block: + continue + + if not check_item_indent(line, i + 1, filename): + found_error = True + + return not found_error + +if __name__ == '__main__': + found_error = False + for p in sorted(list(glob.glob("**/*.md", recursive=True))): + with open(p) as f: + text = f.read() + + if not check_display_error(text, p): + found_error = True + + if found_error: + sys.exit(1) diff --git a/lang/cpp11/static_assert.md b/lang/cpp11/static_assert.md index 0d76aaab1b..c0d9d15ae5 100644 --- a/lang/cpp11/static_assert.md +++ b/lang/cpp11/static_assert.md @@ -37,7 +37,7 @@ static_assert(定数式, 文字列リテラル); - 定数式が真であると評価された場合は何も効果がない。定数式が偽であると評価された場合は、指定された文字列リテラルを含む診断メッセージがコンパイラによって問題報告される。ただし、基本ソース文字集合に含まれない文字集合は、診断メッセージに表示することはコンパイラに要求されない - `static_assert`宣言では、新たな型やオブジェクトは宣言しない。また、実行時にサイズや時間コストは発生しない - (CWG 2518が適用された環境): template文(もしくは適切な特殊化や[C++17 constexpr if 文](/lang/cpp17/if_constexpr.md)の中の文)が実際にインスタンス化されるまで、`static_assert`文の宣言は遅延される。 - - [C++17 constexpr if 文](/lang/cpp17/if_constexpr.md)の解説を参照 + - [C++17 constexpr if 文](/lang/cpp17/if_constexpr.md)の解説を参照 ## 例 ```cpp example @@ -99,4 +99,4 @@ Boost Static Assertion Libraryが開発されたときに、コンパイル時 - [N1617 Proposal to Add Static Assertions to the Core Language (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1617.html) - [N1720 Proposal to Add Static Assertions to the Core Language (Revision 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1720.html) - [P2593R1: Allowing static_assert(false)](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2593r1.html) -- [Issue 2518: Conformance requirements and #error/#warning - WG21 CWG Issues](https://wg21.cmeerw.net/cwg/issue2518) \ No newline at end of file +- [Issue 2518: Conformance requirements and #error/#warning - WG21 CWG Issues](https://wg21.cmeerw.net/cwg/issue2518) diff --git a/lang/cpp17/guaranteed_copy_elision.md b/lang/cpp17/guaranteed_copy_elision.md index 4cf9aeef98..c11f847d88 100644 --- a/lang/cpp17/guaranteed_copy_elision.md +++ b/lang/cpp17/guaranteed_copy_elision.md @@ -35,20 +35,20 @@ int k = X().n; // ok, X() prvalue は xvalue に変換される 不必要な一時オブジェクトの作成を避けるために、一時オブジェクトの実体化は一般に可能な限り遅らせる。 注:一時オブジェクトは次のとき実体化されている。 - - - 参照を`prvalue`にバインドするとき - - クラス`prvalue`でメンバアクセスを実行するとき - - 配列からポインタへの変換を実行するとき、または配列`prvalue`をサブスクライブするとき - - `braced-init-list`から`std::initializer_list`型のオブジェクトを初期化するとき - - 特定の未評価のオペランド、および`prvalue`が廃棄値式(`discarded-value expression`)として現れる場合 + +- 参照を`prvalue`にバインドするとき +- クラス`prvalue`でメンバアクセスを実行するとき +- 配列からポインタへの変換を実行するとき、または配列`prvalue`をサブスクライブするとき +- `braced-init-list`から`std::initializer_list`型のオブジェクトを初期化するとき +- 特定の未評価のオペランド、および`prvalue`が廃棄値式(`discarded-value expression`)として現れる場合 これより、上の例は「クラス`prvalue`でメンバアクセスを実行するとき」にあたり、`xvalue`として一時オブジェクトを生成している。 また、`prvalue`から`prvalue`への変換は、上記の「一時オブジェクトの実体化は一般に可能な限り遅らせられる」ことより、一時オブジェクトを実体化しない。よって、次の例における`prvalue`の`T`型の戻り値は、呼び出し元の`t`を直接初期化する。 ```cpp - T Func() {return T();} - T t = Func(); // 直接初期化 +T Func() {return T();} +T t = Func(); // 直接初期化 ``` ## 例 @@ -178,4 +178,4 @@ Foo x = foo(); // error Foo型のコピーコンストラクタが必要 - [Guaranteed Copy Elision](https://jonasdevlieghere.com/guaranteed-copy-elision/) ## 注釈 -1. **^** [右辺値、左辺値などの細かい定義 - Qiita](https://qiita.com/rinse_/items/cffa87016b7de49391ae)を参照 \ No newline at end of file +1. **^** [右辺値、左辺値などの細かい定義 - Qiita](https://qiita.com/rinse_/items/cffa87016b7de49391ae)を参照 diff --git a/lang/cpp23/lifetime_extension_in_range_based_for_loop.md b/lang/cpp23/lifetime_extension_in_range_based_for_loop.md index 7e3e11524f..18a74d5d05 100644 --- a/lang/cpp23/lifetime_extension_in_range_based_for_loop.md +++ b/lang/cpp23/lifetime_extension_in_range_based_for_loop.md @@ -134,7 +134,7 @@ void foo() { - この `t` は "一時オブジェクトの寿命が `for-range-initializer` 完全式の終わりではない場合" にも該当すると考えられる - この `t` は、構文的に見ると `for-range-initializer` の中で生じたとは言えないという意見もある - "`for-range-initializer` の中" を実行時のことだと解釈すると、そこから呼び出された関数の中なども含むことになるが、それを排除する規定が "一時オブジェクトの寿命が `for-range-initializer` 完全式の終わりではない場合" ではないか - - インライン展開されたときなどに効いてくるのかもしれない + - インライン展開されたときなどに効いてくるのかもしれない ## 検討されたほかの選択肢 @@ -149,4 +149,4 @@ void foo() { - [地に足のついた範囲for文 - 地面を見下ろす少年の足蹴にされる私](https://onihusube.hatenablog.com/entry/2022/12/05/000923) - [範囲for文範囲初期化子内の一時オブジェクト延命の説明見直し #1246](https://github.com/cpprefjp/site/issues/1246) -- [Are function parameter objects temporary objects?](https://stackoverflow.com/questions/77676199/are-function-parameter-objects-temporary-objects/77676480) \ No newline at end of file +- [Are function parameter objects temporary objects?](https://stackoverflow.com/questions/77676199/are-function-parameter-objects-temporary-objects/77676480) diff --git a/reference/algorithm.md b/reference/algorithm.md index 34fe94c3f4..0795f49b82 100644 --- a/reference/algorithm.md +++ b/reference/algorithm.md @@ -273,11 +273,11 @@ ranges::sort(pv, {}, &Person::name); - `comp(a, b) && comp(b, c)` は `comp(a, c)` を意味する - `equiv(a, b) && equiv(b, c)` は `equiv(a, c)` を意味する - これらの前提のもと、以下を示すことができる。 +これらの前提のもと、以下を示すことができる。 - - `equiv` は同値関係 (equivalence relation) である - - `comp` は `equiv` によって決まる同値類 (equivalence class) の間での明確な関係を示す - - その示される関係は狭義の全順序 (strict total ordering) である +- `equiv` は同値関係 (equivalence relation) である +- `comp` は `equiv` によって決まる同値類 (equivalence class) の間での明確な関係を示す +- その示される関係は狭義の全順序 (strict total ordering) である 数学用語の日本語訳として "equivalence relation" には「同値関係」 "equivalence class" には「同値類」が定着しており、同じく数学的な文脈では上記 `equiv` を満たす2つの値を「同値」 (equivalent) であると言う。しかし特に数学的でない文脈で「同値」と言った場合は `operator==` による "equal" の関係と誤解される可能性が高いと考えられるため、本サイトでは上記 `equiv` による "equivalent" の関係を「等価」 `operator==` による "equal" の関係を「等値」として区別する。 diff --git a/reference/compare/partial_ordering/op_equal.md b/reference/compare/partial_ordering/op_equal.md index d7627d73a0..e961cf9916 100644 --- a/reference/compare/partial_ordering/op_equal.md +++ b/reference/compare/partial_ordering/op_equal.md @@ -34,9 +34,9 @@ friend constexpr bool operator==(/*unspecified*/, partial_ordering v) noexcept; ## 備考 この演算子により、以下の演算子が使用可能になる: - - `bool operator!=(partial_ordering v, partial_ordering w) noexcept;` - - `bool operator!=(partial_ordering v, /*unspecified*/) noexcept;` - - `bool operator!=(/*unspecified*/, partial_ordering w) noexcept;` +- `bool operator!=(partial_ordering v, partial_ordering w) noexcept;` +- `bool operator!=(partial_ordering v, /*unspecified*/) noexcept;` +- `bool operator!=(/*unspecified*/, partial_ordering w) noexcept;` *unspecified*となっている片側の引数には`0`リテラルのみが使用できる。それ以外の物を渡した場合、動作は未定義。 diff --git a/reference/compare/strong_ordering/op_equal.md b/reference/compare/strong_ordering/op_equal.md index 9f05e31d79..421860f86a 100644 --- a/reference/compare/strong_ordering/op_equal.md +++ b/reference/compare/strong_ordering/op_equal.md @@ -34,9 +34,9 @@ friend constexpr bool operator==(/*unspecified*/, strong_ordering v) noexcept; ## 備考 この演算子により、以下の演算子が使用可能になる: - - `bool operator!=(strong_ordering v, strong_ordering w) noexcept;` - - `bool operator!=(strong_ordering v, /*unspecified*/) noexcept;` - - `bool operator!=(/*unspecified*/, strong_ordering w) noexcept;` +- `bool operator!=(strong_ordering v, strong_ordering w) noexcept;` +- `bool operator!=(strong_ordering v, /*unspecified*/) noexcept;` +- `bool operator!=(/*unspecified*/, strong_ordering w) noexcept;` *unspecified*となっている片側の引数には`0`リテラルのみが使用できる。それ以外の物を渡した場合、動作は未定義。 diff --git a/reference/compare/weak_ordering/op_equal.md b/reference/compare/weak_ordering/op_equal.md index f7f8ec4a22..c6eba5fdb9 100644 --- a/reference/compare/weak_ordering/op_equal.md +++ b/reference/compare/weak_ordering/op_equal.md @@ -34,9 +34,9 @@ friend constexpr bool operator==(/*unspecified*/, weak_ordering v) noexcept; / ## 備考 この演算子により、以下の演算子が使用可能になる: - - `bool operator!=(weak_ordering v, weak_ordering w) noexcept;` - - `bool operator!=(weak_ordering v, /*unspecified*/) noexcept;` - - `bool operator!=(/*unspecified*/, weak_ordering w) noexcept;` +- `bool operator!=(weak_ordering v, weak_ordering w) noexcept;` +- `bool operator!=(weak_ordering v, /*unspecified*/) noexcept;` +- `bool operator!=(/*unspecified*/, weak_ordering w) noexcept;` *unspecified*となっている片側の引数には`0`リテラルのみが使用できる。それ以外の物を渡した場合、動作は未定義。 diff --git a/reference/concepts/swap.md b/reference/concepts/swap.md index 726018ae08..f04d019269 100644 --- a/reference/concepts/swap.md +++ b/reference/concepts/swap.md @@ -29,7 +29,7 @@ namespace std::ranges { ``` 2. `a, b`が共に同じ長さの配列型の左辺値であり、`ranges::swap(*a, *b)`が呼び出し可能ならば`ranges::swap_ranges(a, b)` - - 1か3に委譲して要素毎に`swap`される + - 1か3に委譲して要素毎に`swap`される 3. `a, b`が共に同じ型`T`の左辺値であり、`T`と`T&`は[`move_constructible`](move_constructible.md)及び[`assignable_from`](assignable_from.md)のモデルとなる場合、[`std::swap()`](/reference/utility/swap.md)相当の操作によって`a, b`の値を交換する。 @@ -56,9 +56,9 @@ namespace std::ranges { 1. 呼び出される`swap(a, b)`(及び、もし返されるのならば戻り値のデストラクタ)が定数評価可能であるかに従う。 2. `a, b`の要素型によって、1か3に従う 3. 以下の条件を全て満たす場合に定数評価可能 - - `T`はリテラル型である - - `a = std::move(b), b = std::move(a)`は共に定数評価可能 - - 次のような初期化式が定数評価可能 + - `T`はリテラル型である + - `a = std::move(b), b = std::move(a)`は共に定数評価可能 + - 次のような初期化式が定数評価可能 ```cpp T t1(std::move(a)); T t2(std::move(b)); diff --git a/reference/functional/copyable_function/op_constructor.md b/reference/functional/copyable_function/op_constructor.md index 3db59be242..50abbe1828 100644 --- a/reference/functional/copyable_function/op_constructor.md +++ b/reference/functional/copyable_function/op_constructor.md @@ -66,8 +66,8 @@ explicit copyable_function(in_place_type_t, initializer_list, Args&&...); ## 効果 - (1), (2) : 関数を持たない空の`copyable_function`オブジェクトを構築する。この方法で構築した後、[`operator bool`](op_bool.md)は`false`を返す。 - (3) : `*this`の格納オブジェクトを - - `f`が値を保持していない場合、値を保持しない。 - - そうでなければ、`f`が保持する値をコピーして保持する。 + - `f`が値を保持していない場合、値を保持しない。 + - そうでなければ、`f`が保持する値をコピーして保持する。 - (4) : `f`が保持する状態を`*this`に移動する。移動された後の`f`は、未規定な値を持つ有効な状態となる。 - (5) : `*this`の格納オブジェクトを - `f`が関数ポインタ型、メンバ関数ポインタ型、メンバ変数ポインタ型いずれかのヌルポインタ値の場合、値を保持しない。 diff --git a/reference/iterator/data.md b/reference/iterator/data.md index ed7f419c8c..f4a8964c5e 100644 --- a/reference/iterator/data.md +++ b/reference/iterator/data.md @@ -34,18 +34,18 @@ namespace std { ## 備考 - [機能テストマクロ](../../lang/cpp17/feature_test_macros.md)は`__cpp_lib_nonmember_container_access`で値は`201411` - ``ヘッダを読み込む以外では、以下のヘッダが読み込まれている場合に、この関数を使用できる: - - [``](../array.md) - - [``](../deque.md) - - [``](../forward_list.md) - - [``](../list.md) - - [``](../map.md) - - [``](../regex.md) - - [``](../set.md) - - [``](../string.md) - - [``](../string_view.md) (C++20) - - [``](../unordered_map.md) - - [``](../unordered_set.md) - - [``](../vector.md) + - [``](../array.md) + - [``](../deque.md) + - [``](../forward_list.md) + - [``](../list.md) + - [``](../map.md) + - [``](../regex.md) + - [``](../set.md) + - [``](../string.md) + - [``](../string_view.md) (C++20) + - [``](../unordered_map.md) + - [``](../unordered_set.md) + - [``](../vector.md) ## 例 diff --git a/reference/iterator/empty.md b/reference/iterator/empty.md index d0f3c93735..63e62f390b 100644 --- a/reference/iterator/empty.md +++ b/reference/iterator/empty.md @@ -40,18 +40,18 @@ namespace std { ## 備考 - [機能テストマクロ](../../lang/cpp17/feature_test_macros.md)は`__cpp_lib_nonmember_container_access`で値は`201411` - ``ヘッダを読み込む以外では、以下のヘッダが読み込まれている場合に、この関数を使用できる: - - [``](../array.md) - - [``](../deque.md) - - [``](../forward_list.md) - - [``](../list.md) - - [``](../map.md) - - [``](../regex.md) - - [``](../set.md) - - [``](../string.md) - - [``](../string_view.md) (C++20) - - [``](../unordered_map.md) - - [``](../unordered_set.md) - - [``](../vector.md) + - [``](../array.md) + - [``](../deque.md) + - [``](../forward_list.md) + - [``](../list.md) + - [``](../map.md) + - [``](../regex.md) + - [``](../set.md) + - [``](../string.md) + - [``](../string_view.md) (C++20) + - [``](../unordered_map.md) + - [``](../unordered_set.md) + - [``](../vector.md) ## 例 diff --git a/reference/iterator/move_iterator/op_assign.md b/reference/iterator/move_iterator/op_assign.md index 42def6003d..90291eae8c 100644 --- a/reference/iterator/move_iterator/op_assign.md +++ b/reference/iterator/move_iterator/op_assign.md @@ -24,12 +24,12 @@ constexpr move_iterator& operator=(move_iterator&&) = default; // (3) C++17 ## テンプレートパラメータ制約 - C++17まで - - (1) : `U`が`Iterator`に変換可能であること + - (1) : `U`が`Iterator`に変換可能であること - C++20 - - (1) : 次の両方を満たす - - `is_same_v == false`であること。 - - `const U&`が[`convertible_to`](/reference/concepts/convertible_to.md)のモデルとなること。 - - `Iterator&, const U&`が[`assignable_from`](/reference/concepts/assignable_from.md)のモデルとなること。 + - (1) : 次の両方を満たす + - `is_same_v == false`であること。 + - `const U&`が[`convertible_to`](/reference/concepts/convertible_to.md)のモデルとなること。 + - `Iterator&, const U&`が[`assignable_from`](/reference/concepts/assignable_from.md)のモデルとなること。 ## 例 diff --git a/reference/iterator/move_iterator/op_constructor.md b/reference/iterator/move_iterator/op_constructor.md index 5c9df17b9e..b617d135bc 100644 --- a/reference/iterator/move_iterator/op_constructor.md +++ b/reference/iterator/move_iterator/op_constructor.md @@ -31,11 +31,11 @@ constexpr move_iterator(move_iterator&&) noexcept = default; // (4) C++17 ## テンプレートパラメータ制約 - C++17まで - - (3) : `U`が`Iterator`に変換可能であること + - (3) : `U`が`Iterator`に変換可能であること - C++20 - - (3) : 次の全てを満たす - - `is_same_v == false`であること。 - - `const U&, Iterator`が[`convertible_to`](/reference/concepts/convertible_to.md)のモデルとなること。 + - (3) : 次の全てを満たす + - `is_same_v == false`であること。 + - `const U&, Iterator`が[`convertible_to`](/reference/concepts/convertible_to.md)のモデルとなること。 ## 例 ```cpp example diff --git a/reference/iterator/reverse_iterator/op_assign.md b/reference/iterator/reverse_iterator/op_assign.md index 2f35f6909d..fb4db494ad 100644 --- a/reference/iterator/reverse_iterator/op_assign.md +++ b/reference/iterator/reverse_iterator/op_assign.md @@ -20,12 +20,12 @@ constexpr reverse_iterator& operator=(const reverse_iterator& u); // ( ## テンプレートパラメータ制約 - C++17まで - - (2) : `U`が`Iterator`に変換可能であること + - (2) : `U`が`Iterator`に変換可能であること - C++20 - - (2) : 次の両方を満たす - - `is_same_v == false`であること。 - - `const U&, Iterator`が[`convertible_to`](/reference/concepts/convertible_to.md)のモデルとなること。 - - `Iterator&, const U&`が[`assignable_from`](/reference/concepts/assignable_from.md)のモデルとなること。 + - (2) : 次の両方を満たす + - `is_same_v == false`であること。 + - `const U&, Iterator`が[`convertible_to`](/reference/concepts/convertible_to.md)のモデルとなること。 + - `Iterator&, const U&`が[`assignable_from`](/reference/concepts/assignable_from.md)のモデルとなること。 ## 戻り値 diff --git a/reference/iterator/reverse_iterator/op_constructor.md b/reference/iterator/reverse_iterator/op_constructor.md index 6f1dcadc67..35c326ceab 100644 --- a/reference/iterator/reverse_iterator/op_constructor.md +++ b/reference/iterator/reverse_iterator/op_constructor.md @@ -28,11 +28,11 @@ constexpr reverse_iterator(const reverse_iterator& u); // (3) C++17 ## テンプレートパラメータ制約 - C++17まで - - (3) : `U`が`Iterator`に変換可能であること + - (3) : `U`が`Iterator`に変換可能であること - C++20 - - (3) : 次の両方を満たす - - `is_same_v == false`であること。 - - `const U&, Iterator`が[`convertible_to`](/reference/concepts/convertible_to.md)のモデルとなること。 + - (3) : 次の両方を満たす + - `is_same_v == false`であること。 + - `const U&, Iterator`が[`convertible_to`](/reference/concepts/convertible_to.md)のモデルとなること。 ## 要件 - (3) : `U`が`Iterator`に変換可能であること diff --git a/reference/iterator/size.md b/reference/iterator/size.md index cba14eef4b..21906c4d58 100644 --- a/reference/iterator/size.md +++ b/reference/iterator/size.md @@ -26,18 +26,18 @@ namespace std { ## 備考 - [機能テストマクロ](../../lang/cpp17/feature_test_macros.md)は`__cpp_lib_nonmember_container_access`で値は`201411` - ``ヘッダを読み込む以外では、以下のヘッダが読み込まれている場合に、この関数を使用できる: - - [``](../array.md) - - [``](../deque.md) - - [``](../forward_list.md) - - [``](../list.md) - - [``](../map.md) - - [``](../regex.md) - - [``](../set.md) - - [``](../string.md) - - [``](../string_view.md) (C++20) - - [``](../unordered_map.md) - - [``](../unordered_set.md) - - [``](../vector.md) + - [``](../array.md) + - [``](../deque.md) + - [``](../forward_list.md) + - [``](../list.md) + - [``](../map.md) + - [``](../regex.md) + - [``](../set.md) + - [``](../string.md) + - [``](../string_view.md) (C++20) + - [``](../unordered_map.md) + - [``](../unordered_set.md) + - [``](../vector.md) ## 例 diff --git a/reference/linalg/hermitian_matrix_product.md b/reference/linalg/hermitian_matrix_product.md index 1f50e37d41..ab9ab2f33e 100644 --- a/reference/linalg/hermitian_matrix_product.md +++ b/reference/linalg/hermitian_matrix_product.md @@ -124,10 +124,10 @@ namespace std::linalg { - 共通 + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) + [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` - - (1), (2), (5), (6): +- (1), (2), (5), (6): + `InMat1`(`A`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) - - (3), (4), (7), (8): +- (3), (4), (7), (8): + `InMat2`(`B`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`B`が正方行列であること) - (5), (6), (7), (8): [`possibly-addable`](possibly-addable.md)`()`が`true` diff --git a/reference/linalg/hermitian_matrix_rank_1_update.md b/reference/linalg/hermitian_matrix_rank_1_update.md index 0aaf1dd6dd..2211afe13e 100644 --- a/reference/linalg/hermitian_matrix_rank_1_update.md +++ b/reference/linalg/hermitian_matrix_rank_1_update.md @@ -66,10 +66,10 @@ namespace std::linalg { ## 適格要件 - 共通: - + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) - + `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 - + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) - + [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (つまり`A`の次元と`x`の次元が同じであること) + + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) + + `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (つまり`A`の次元と`x`の次元が同じであること) - (2), (4): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` diff --git a/reference/linalg/hermitian_matrix_rank_2_update.md b/reference/linalg/hermitian_matrix_rank_2_update.md index f42c7b9f85..514255df12 100644 --- a/reference/linalg/hermitian_matrix_rank_2_update.md +++ b/reference/linalg/hermitian_matrix_rank_2_update.md @@ -43,9 +43,9 @@ namespace std::linalg { ## 適格要件 - 共通: - + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) - + `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 - + [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` + + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) + + `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + + [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` - (2): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` diff --git a/reference/linalg/hermitian_matrix_vector_product.md b/reference/linalg/hermitian_matrix_vector_product.md index c56c46d0d1..8b0f40f3c3 100644 --- a/reference/linalg/hermitian_matrix_vector_product.md +++ b/reference/linalg/hermitian_matrix_vector_product.md @@ -74,18 +74,18 @@ namespace std::linalg { ## 適格要件 - 共通: - + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) - + `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 - + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) - + [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` + + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) + + `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) + + [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` - (3), (4): [`possibly-addable`](possibly-addable.md)`()`が`true` - (2), (4): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` ## 事前条件 - 共通: - + `A.extent(0) == A.extent(1)` - + [`multipliable`](multipliable.md)`(A, x, y) == true` + + `A.extent(0) == A.extent(1)` + + [`multipliable`](multipliable.md)`(A, x, y) == true` - (3), (4): [`addable`](addable.md)`(x, y, z) == true` diff --git a/reference/linalg/symmetric_matrix_product.md b/reference/linalg/symmetric_matrix_product.md index 3c3b35acfa..e71eb1d41d 100644 --- a/reference/linalg/symmetric_matrix_product.md +++ b/reference/linalg/symmetric_matrix_product.md @@ -124,10 +124,10 @@ namespace std::linalg { - 共通 + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) + [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` - - (1), (2), (5), (6): +- (1), (2), (5), (6): + `InMat1`(`A`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) - - (3), (4), (7), (8): +- (3), (4), (7), (8): + `InMat2`(`B`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`B`が正方行列であること) - (5), (6), (7), (8): [`possibly-addable`](possibly-addable.md)`()`が`true` @@ -136,7 +136,7 @@ namespace std::linalg { ## 事前条件 - 共通 - + [`multipliable`](multipliable.md)`(A, B, C) == true` + + [`multipliable`](multipliable.md)`(A, B, C) == true` - (1), (2), (5), (6): `A.extent(0) == A.extent(1)` - (3), (4), (7), (8): `B.extent(0) == B.extent(1)` - (5), (6), (7), (8): [`addable`](addable.md)`(E, E, C) == true` diff --git a/reference/linalg/symmetric_matrix_rank_1_update.md b/reference/linalg/symmetric_matrix_rank_1_update.md index 1c3c08789a..a4d66f1fb3 100644 --- a/reference/linalg/symmetric_matrix_rank_1_update.md +++ b/reference/linalg/symmetric_matrix_rank_1_update.md @@ -63,10 +63,10 @@ namespace std::linalg { ## 適格要件 - 共通: - + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) - + `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 - + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) - + [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (つまり`A`の次元と`x`の次元が同じであること) + + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) + + `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (つまり`A`の次元と`x`の次元が同じであること) - (2), (4): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` diff --git a/reference/linalg/symmetric_matrix_rank_2_update.md b/reference/linalg/symmetric_matrix_rank_2_update.md index 92c8b7da46..a00862056e 100644 --- a/reference/linalg/symmetric_matrix_rank_2_update.md +++ b/reference/linalg/symmetric_matrix_rank_2_update.md @@ -43,9 +43,9 @@ namespace std::linalg { ## 適格要件 - 共通: - + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) - + `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 - + [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` + + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) + + `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + + [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` - (2): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` ## 事前条件 diff --git a/reference/linalg/symmetric_matrix_vector_product.md b/reference/linalg/symmetric_matrix_vector_product.md index 1dc63373a6..193260dfa8 100644 --- a/reference/linalg/symmetric_matrix_vector_product.md +++ b/reference/linalg/symmetric_matrix_vector_product.md @@ -70,10 +70,10 @@ namespace std::linalg { ## 適格要件 - 共通: - + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) - + `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 - + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) - + [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` + + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) + + `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) + + [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` - (3), (4): [`possibly-addable`](possibly-addable.md)`()`が`true` - (2), (4): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` diff --git a/reference/linalg/triangular_matrix_product.md b/reference/linalg/triangular_matrix_product.md index 5d20663ff2..ef75266e07 100644 --- a/reference/linalg/triangular_matrix_product.md +++ b/reference/linalg/triangular_matrix_product.md @@ -141,10 +141,10 @@ namespace std::linalg { + `DiagonalStorage`が[`implicit_unit_diagonal_t`](implicit_unit_diagonal_t.md)または[`explicit_diagonal_t`](explicit_diagonal_t.md) + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) + [`possibly-multipliable`](possibly-multipliable.md)`()`が`true` - - (1), (2), (5), (6): +- (1), (2), (5), (6): + `InMat1`(`A`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) - - (3), (4), (7), (8): +- (3), (4), (7), (8): + `InMat2`(`B`の型)が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`B`が正方行列であること) - (5), (6), (7), (8): [`possibly-addable`](possibly-addable.md)`()`が`true` @@ -153,7 +153,7 @@ namespace std::linalg { ## 事前条件 - 共通 - + [`multipliable`](multipliable.md)`(A, B, C) == true` + + [`multipliable`](multipliable.md)`(A, B, C) == true` - (1), (2), (5), (6): `A.extent(0) == A.extent(1)` - (3), (4), (7), (8): `B.extent(0) == B.extent(1)` - (5), (6), (7), (8): [`addable`](addable.md)`(E, E, C) == true` diff --git a/reference/linalg/triangular_matrix_vector_product.md b/reference/linalg/triangular_matrix_vector_product.md index 8e835bebc0..28df94dbec 100644 --- a/reference/linalg/triangular_matrix_vector_product.md +++ b/reference/linalg/triangular_matrix_vector_product.md @@ -103,11 +103,11 @@ namespace std::linalg { ## 適格要件 - 共通: - + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) - + `DiagonalStorage`は[`implicit_unit_diagonal_t`](implicit_unit_diagonal_t.md)または[`explicit_diagonal_t`](explicit_diagonal_t.md) - + `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 - + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) - + [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (つまり`A`の次元と`y`の次元が同じであること) + + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) + + `DiagonalStorage`は[`implicit_unit_diagonal_t`](implicit_unit_diagonal_t.md)または[`explicit_diagonal_t`](explicit_diagonal_t.md) + + `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (つまり`A`の次元と`y`の次元が同じであること) - (1), (2), (5), (6): [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (つまり`A`の次元と`x`の次元が同じであること) - (5), (6): [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (つまり`A`の次元と`x`の次元が同じであること) - (2), (4), (6): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` @@ -115,8 +115,8 @@ namespace std::linalg { ## 事前条件 - 共通: - + `A.extent(0) == A.extent(1)` (つまり`A`が正方行列であること) - + `A.extent(0) == y.extent(0)` (つまり`y`に結果を代入できること) + + `A.extent(0) == A.extent(1)` (つまり`A`が正方行列であること) + + `A.extent(0) == y.extent(0)` (つまり`y`に結果を代入できること) - (1), (2), (5), (6): `A.extent(0) == x.extent(0)` (つまり$Ax$を計算できること) - (5), (6): `A.extent(0) == z.extent(0)` (つまり`z`に結果を代入できること) diff --git a/reference/linalg/triangular_matrix_vector_solve.md b/reference/linalg/triangular_matrix_vector_solve.md index d680f94655..94b17c28bf 100644 --- a/reference/linalg/triangular_matrix_vector_solve.md +++ b/reference/linalg/triangular_matrix_vector_solve.md @@ -134,19 +134,19 @@ namespace std::linalg { ## 適格要件 - 共通: - + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) - + `DiagonalStorage`は[`implicit_unit_diagonal_t`](implicit_unit_diagonal_t.md)または[`explicit_diagonal_t`](explicit_diagonal_t.md) - + `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 - + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) - + [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (つまり`A`の次元と`b`の次元が同じであること) + + `Triangle`は[`upper_triangle_t`](upper_triangle_t.md)または[`lower_triangle_t`](lower_triangle_t.md) + + `DiagonalStorage`は[`implicit_unit_diagonal_t`](implicit_unit_diagonal_t.md)または[`explicit_diagonal_t`](explicit_diagonal_t.md) + + `InMat`が[`layout_blas_packed`](layout_blas_packed.md)を持つなら、レイアウトの`Triangle`テンプレート引数とこの関数の`Triangle`テンプレート引数が同じ型 + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 1)`が`true` (つまり`A`が正方行列であること) + + [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (つまり`A`の次元と`b`の次元が同じであること) - (1), (2), (3), (4): [`compatible-static-extents`](compatible-static-extents.md)`(0, 0)`が`true` (つまり`A`の次元と`b`の次元が同じであること) - (2), (4), (6), (8): [`is_execution_policy`](/reference/execution/is_execution_policy.md)`::value`が`true` ## 事前条件 - 共通: - + `A.extent(0) == A.extent(1)` (つまり`A`が正方行列であること) - + `A.extent(0) == b.extent(0)` (つまり`A`の次元と`b`の次元が同じであること) + + `A.extent(0) == A.extent(1)` (つまり`A`が正方行列であること) + + `A.extent(0) == b.extent(0)` (つまり`A`の次元と`b`の次元が同じであること) - (1), (2), (3), (4): `A.extent(0) == x.extent(0)` (つまり`A`の次元と`x`の次元が同じであること) diff --git a/reference/memory/ranges_uninitialized_default_construct.md b/reference/memory/ranges_uninitialized_default_construct.md index ee6fac6fab..732025acc1 100644 --- a/reference/memory/ranges_uninitialized_default_construct.md +++ b/reference/memory/ranges_uninitialized_default_construct.md @@ -68,7 +68,7 @@ return first; ## 備考 - [`std::vector`](/reference/vector/vector.md)クラスの要素数を変更する操作は、要素を値構築するためゼロ初期化が行われる。その値初期化のコストが気になるような場合に、デフォルト構築することでプログラマの責任で必要な分だけ任意に初期化でき、パフォーマンス向上が期待できるようになる。 - - 例としてBoost Container Libraryの`vector`クラスには、要素数を変更するメンバ関数にデフォルト構築のオプションとして[`default_init`](https://www.boost.org/doc/libs/release/doc/html/container/extended_functionality.html#container.extended_functionality.default_initialialization)がある + - 例としてBoost Container Libraryの`vector`クラスには、要素数を変更するメンバ関数にデフォルト構築のオプションとして[`default_init`](https://www.boost.org/doc/libs/release/doc/html/container/extended_functionality.html#container.extended_functionality.default_initialialization)がある ## 例 diff --git a/reference/memory/uninitialized_default_construct.md b/reference/memory/uninitialized_default_construct.md index 64df4a7ddd..bd9133eb88 100644 --- a/reference/memory/uninitialized_default_construct.md +++ b/reference/memory/uninitialized_default_construct.md @@ -44,7 +44,7 @@ for (; first != last; ++first) ## 備考 - [`std::vector`](/reference/vector/vector.md)クラスの要素数を変更する操作は、要素を値構築するためゼロ初期化が行われる。その値初期化のコストが気になるような場合に、デフォルト構築することでプログラマの責任で必要な分だけ任意に初期化でき、パフォーマンス向上が期待できるようになる。 - - 例としてBoost Container Libraryの`vector`クラスには、要素数を変更するメンバ関数にデフォルト構築のオプションとして[`default_init`](https://www.boost.org/doc/libs/release/doc/html/container/extended_functionality.html#container.extended_functionality.default_initialialization)がある + - 例としてBoost Container Libraryの`vector`クラスには、要素数を変更するメンバ関数にデフォルト構築のオプションとして[`default_init`](https://www.boost.org/doc/libs/release/doc/html/container/extended_functionality.html#container.extended_functionality.default_initialialization)がある ### 例 diff --git a/reference/memory/uninitialized_default_construct_n.md b/reference/memory/uninitialized_default_construct_n.md index 104b396f2c..c489c0e845 100644 --- a/reference/memory/uninitialized_default_construct_n.md +++ b/reference/memory/uninitialized_default_construct_n.md @@ -43,7 +43,7 @@ return first; ## 備考 - [`std::vector`](/reference/vector/vector.md)クラスの要素数を変更する操作は、要素を値構築するためゼロ初期化が行われる。その値初期化のコストが気になるような場合に、デフォルト構築することでプログラマの責任で必要な分だけ任意に初期化でき、パフォーマンス向上が期待できるようになる。 - - 例としてBoost Container Libraryの`vector`クラスには、要素数を変更するメンバ関数にデフォルト構築のオプションとして[`default_init`](https://www.boost.org/doc/libs/release/doc/html/container/extended_functionality.html#container.extended_functionality.default_initialialization)がある + - 例としてBoost Container Libraryの`vector`クラスには、要素数を変更するメンバ関数にデフォルト構築のオプションとして[`default_init`](https://www.boost.org/doc/libs/release/doc/html/container/extended_functionality.html#container.extended_functionality.default_initialialization)がある ### 例 diff --git a/reference/node_handle/node_handle/op_assign.md b/reference/node_handle/node_handle/op_assign.md index f72652e477..efa67a46f9 100644 --- a/reference/node_handle/node_handle/op_assign.md +++ b/reference/node_handle/node_handle/op_assign.md @@ -19,11 +19,10 @@ node_handle& operator=(node_handle&& nh); ## 効果 - `ptr_ != nullptr` の場合、 - - `std::allocator_traits::destroy` を呼び出して `ptr_` が指す `container_node_type` オブジェクト内の `value_type` サブオブジェクトを破棄し、 - - 次に `std::allocator_traits::template rebind_traits::deallocate` を呼び出して `ptr_` の割り当てを解除する。 - -- `ptr_` に `nh.ptr_` を代入する。 -- `!alloc_` または `std::allocator_traits::propagate_on_container_move_assignment::value` が `true` の場合、`nh.alloc_` を `alloc_` にムーブ代入する。 + - `std::allocator_traits::destroy` を呼び出して `ptr_` が指す `container_node_type` オブジェクト内の `value_type` サブオブジェクトを破棄し、 + - 次に `std::allocator_traits::template rebind_traits::deallocate` を呼び出して `ptr_` の割り当てを解除する。 +- `ptr_` に `nh.ptr_` を代入する。 +- `!alloc_` または `std::allocator_traits::propagate_on_container_move_assignment::value` が `true` の場合、`nh.alloc_` を `alloc_` にムーブ代入する。 - `nh.ptr_` に `nullptr` を代入し、`nh.alloc_` に `nullopt` を代入する。 diff --git a/reference/random/generate_random.md b/reference/random/generate_random.md index b13fab2c8a..254bb192a8 100644 --- a/reference/random/generate_random.md +++ b/reference/random/generate_random.md @@ -94,7 +94,7 @@ for (auto& x : v) { * std::move[link /reference/utility/move.md] - (3) : - - `d.generate_random(`[`std::forward`](/reference/utility/forward.md)`(r), g)`が妥当な式であれば、それを呼び出す + - `d.generate_random(`[`std::forward`](/reference/utility/forward.md)`(r), g)`が妥当な式であれば、それを呼び出す - 備考 : 分布生成器が`generate_random()`メンバ関数をもっていればそれを使用する - そうでなく、`R`が[`sized_range`](/reference/ranges/sized_range.md)のモデルである場合、値`N`と[`span`](/reference/span/span.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`, N>`型オブジェクト`s`に対して、式[`invoke`](/reference/functional/invoke.md)`(d, g)`または`d.generate_random(s, g)`を未規定の回数だけ呼び出して実行し、`r`の各要素に代入する - 備考 : ここでの`N`は乱数生成の回数と異なってもよい diff --git a/reference/random/subtract_with_carry_engine/op_constructor.md b/reference/random/subtract_with_carry_engine/op_constructor.md index 7ac7e3709d..a954e310da 100644 --- a/reference/random/subtract_with_carry_engine/op_constructor.md +++ b/reference/random/subtract_with_carry_engine/op_constructor.md @@ -23,7 +23,7 @@ subtract_with_carry_engine(subtract_with_carry_engine&& e) = default; // (5 ## 概要 - (1) : デフォルトコンストラクタ - C++17まで:シード値が指定されない場合はデフォルトのシード値 (`subtract_with_carry_engine::default_seed`) で構築される - - [`linear_congruential_engine`](../linear_congruential_engine.md) を $n = \lceil 32 / \mathtt{w} \rceil$ 回 (`w` は `subtract_with_carry_engine::word_size`) 呼び出して内部状態を初期化する + - [`linear_congruential_engine`](../linear_congruential_engine.md) を $n = \lceil 32 / \mathtt{w} \rceil$ 回 (`w` は `subtract_with_carry_engine::word_size`) 呼び出して内部状態を初期化する - C++20から : デフォルトのシード値 (`subtract_with_carry_engine::default_seed`) で(2)に委譲 - C++26から : シード値を`0u`として(2)に委譲 - (2) : シード値を受け取って状態シーケンスを構築する diff --git a/reference/streambuf/basic_streambuf/op_constructor.md b/reference/streambuf/basic_streambuf/op_constructor.md index 3aed4eb9a8..c764eb4d4c 100644 --- a/reference/streambuf/basic_streambuf/op_constructor.md +++ b/reference/streambuf/basic_streambuf/op_constructor.md @@ -30,21 +30,21 @@ namespace std { ## 事後条件 - (1) : - - `eback()` == `nullptr` - - `gptr()` == `nullptr` - - `egptr()` == `nullptr` - - `pbase()` == `nullptr` - - `pptr()` == `nullptr` - - `epptr()` == `nullptr` - - `getloc()` == `locale()` + - `eback()` == `nullptr` + - `gptr()` == `nullptr` + - `egptr()` == `nullptr` + - `pbase()` == `nullptr` + - `pptr()` == `nullptr` + - `epptr()` == `nullptr` + - `getloc()` == `locale()` - (2) : - - `eback()` == `rhs.eback()` - - `gptr()` == `rhs.gptr()` - - `egptr()` == `rhs.egptr()` - - `pbase()` == `rhs.pbase()` - - `pptr()` == `rhs.pptr()` - - `epptr()` == `rhs.epptr()` - - `getloc()` == `rhs.getloc()` + - `eback()` == `rhs.eback()` + - `gptr()` == `rhs.gptr()` + - `egptr()` == `rhs.egptr()` + - `pbase()` == `rhs.pbase()` + - `pptr()` == `rhs.pptr()` + - `epptr()` == `rhs.epptr()` + - `getloc()` == `rhs.getloc()` ## 実装例 diff --git a/reference/type_traits/common_type.md b/reference/type_traits/common_type.md index 1a0d91e091..6ef83f500b 100644 --- a/reference/type_traits/common_type.md +++ b/reference/type_traits/common_type.md @@ -64,8 +64,8 @@ namespace std { `common_type`は以下の条件を満たす場合に、2引数のもの(`common_type`)に限ってユーザー定義の特殊化が許可されている。 - `T1, T2`の少なくとも片方はプログラム定義型に依存している - - プログラム定義型とは、標準ライブラリの型を除いた、ユーザーによって定義された型のこと - - 「プログラム定義型に依存している」とは例えば、プログラム定義型に対する`vector`等の特殊化のこと + - プログラム定義型とは、標準ライブラリの型を除いた、ユーザーによって定義された型のこと + - 「プログラム定義型に依存している」とは例えば、プログラム定義型に対する`vector`等の特殊化のこと - `T1, T2`に対する[`decay`](/reference/type_traits/decay.md)の適用はともに恒等写像となる(上記参照) そして、そのような特殊化は必ずしもメンバ型`type`を持たなくても構わない。 diff --git a/reference/unordered_set/unordered_set/insert.md b/reference/unordered_set/unordered_set/insert.md index c6eb0e16e0..ffa4344d83 100644 --- a/reference/unordered_set/unordered_set/insert.md +++ b/reference/unordered_set/unordered_set/insert.md @@ -106,7 +106,7 @@ iterator insert(const_iterator hint, node_type&& nh); // (6) C++17 のいずれかである。 なお、後者の条件は「よりも小さい」となっているが、最大負荷率の定義からすると「以下」の方が適切と思われる。[`reserve`](reserve.md) も参照。 - - (5), (6) の場合、要素はコピーもムーブもされない。 +- (5), (6) の場合、要素はコピーもムーブもされない。 ## 例 diff --git a/start_editing.md b/start_editing.md index 94bbf58919..f531cda398 100644 --- a/start_editing.md +++ b/start_editing.md @@ -60,6 +60,8 @@ buildアクションで、MarkdownからHTMLへの変換と、GitHub Pagesへの - 用語の誤った使い方を検出 (defined word checkアクション) - 用語の許可した使い方、許可しない使い方を列挙し、許可した使い方以外の使われ方をエラーとして検出する - 具体的な用語、許可した使い方、許可しない使い方は、[defined_word_check.py](https://github.com/cpprefjp/site/blob/master/.github/workflows/script/defined_word_check.py)を参照 +- 表示崩れする書き方を検出 (display error checkアクション) + - 箇条書きのインデントが4の倍数でない行をエラーとして検出する ### 自動反映ツール From be4af49ba39430b51a8ef979d7f0b2a4a931094f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 5 Dec 2024 13:27:16 +0900 Subject: [PATCH 1293/3948] =?UTF-8?q?=E7=AE=87=E6=9D=A1=E6=9B=B8=E3=81=8D?= =?UTF-8?q?=E3=81=AE=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF=20:=20=E7=95=AA?= =?UTF-8?q?=E5=8F=B7=E4=BB=98=E3=81=8D=E7=AE=87=E6=9D=A1=E6=9B=B8=E3=81=8D?= =?UTF-8?q?=E3=81=AE=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF=E3=81=8C=E9=96=93?= =?UTF-8?q?=E9=81=95=E3=81=A3=E3=81=A6=E3=81=84=E3=81=9F=E3=81=AE=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20#1367?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/script/display_error_check.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/script/display_error_check.py b/.github/workflows/script/display_error_check.py index c446b805e4..25d57e7511 100644 --- a/.github/workflows/script/display_error_check.py +++ b/.github/workflows/script/display_error_check.py @@ -11,7 +11,7 @@ def indent_length(s: str) -> int: return length def check_item_indent(line: str, line_no: int, filename: str) -> bool: - m = re.match(r'^(\s*?)([0-9] \.\s)', line) + m = re.match(r'^(\s*?)([0-9]+\.\s)', line) if m: indent: int = indent_length(m[1]) if indent > 0 and indent % 4 != 0: From 952bb0403879014c483aaf1b93773af4336e190a Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 5 Dec 2024 13:43:09 +0900 Subject: [PATCH 1294/3948] =?UTF-8?q?=E8=A1=A8=E7=A4=BA=E5=B4=A9=E3=82=8C?= =?UTF-8?q?=E3=83=81=E3=82=A7=E3=83=83=E3=82=AFCI=20:=20`*`=E3=81=A7?= =?UTF-8?q?=E3=81=AF=E3=81=98=E3=81=BE=E3=82=8B=E7=AE=87=E6=9D=A1=E6=9B=B8?= =?UTF-8?q?=E3=81=8D=E3=82=92=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF=20#1367?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflows/script/display_error_check.py | 2 +- .../lexicographical_compare_three_way.md | 10 +- reference/iterator/iterator_traits.md | 56 +++++----- .../iterator/reverse_iterator/op_arrow.md | 16 +-- reference/string/basic_string/append.md | 22 ++-- reference/string/basic_string/assign.md | 22 ++-- reference/string/basic_string/compare.md | 14 +-- reference/string/basic_string/insert.md | 22 ++-- reference/string/basic_string/op_assign.md | 12 +-- reference/string/basic_string/op_plus.md | 102 +++++++++--------- .../string/basic_string/op_plus_assign.md | 12 +-- reference/string/basic_string/replace.md | 32 +++--- 12 files changed, 161 insertions(+), 161 deletions(-) diff --git a/.github/workflows/script/display_error_check.py b/.github/workflows/script/display_error_check.py index 25d57e7511..9a93e3b539 100644 --- a/.github/workflows/script/display_error_check.py +++ b/.github/workflows/script/display_error_check.py @@ -19,7 +19,7 @@ def check_item_indent(line: str, line_no: int, filename: str) -> bool: return False return True - m = re.match(r'^(\s*?)([+-]\s)', line) + m = re.match(r'^(\s*?)([*+-]\s)', line) if m: indent: int = indent_length(m[1]) if indent > 0 and indent % 4 != 0: diff --git a/reference/algorithm/lexicographical_compare_three_way.md b/reference/algorithm/lexicographical_compare_three_way.md index c60f0ad445..caf3b5a090 100644 --- a/reference/algorithm/lexicographical_compare_three_way.md +++ b/reference/algorithm/lexicographical_compare_three_way.md @@ -57,10 +57,10 @@ namespace std { - 全ての要素が等しいならば、長さを比較する - (2) : 以下と等価、すなわち(1)に委譲 - ```cpp - return lexicographical_compare_three_way(first1, last1, first2, last2, compare_three_way()); - ``` - * compare_three_way[link /reference/compare/compare_three_way.md] + ```cpp + return lexicographical_compare_three_way(first1, last1, first2, last2, compare_three_way()); + ``` + * compare_three_way[link /reference/compare/compare_three_way.md] ## 戻り値 @@ -114,7 +114,7 @@ int main() { } } ``` - * weak_ordering[link /reference/compare/weak_ordering.md] +* weak_ordering[link /reference/compare/weak_ordering.md] ### 出力例 ``` diff --git a/reference/iterator/iterator_traits.md b/reference/iterator/iterator_traits.md index 7fdad8e587..c5c314468b 100644 --- a/reference/iterator/iterator_traits.md +++ b/reference/iterator/iterator_traits.md @@ -95,46 +95,46 @@ namespace std { - この時、`I::pointer`も定義されているならば、`pointer`はそれを用いて定義される。 - いずれかのメンバ型が定義されておらず、`I`が`cpp17-input-iterator`コンセプトを満たす場合、それぞれのメンバ型は次のように定義される - ```cpp - using difference_type = typename incrementable_traits::difference_type; - using value_type = typename indirectly_readable_traits::value_type; - using pointer = /*see below*/; - using reference = /*see below*/; - using iterator_category = /*see below*/; - ``` - * see below[italic] - * indirectly_readable_traits[link /reference/iterator/indirectly_readable_traits.md] - * incrementable_traits[link /reference/iterator/incrementable_traits.md] - * iter_reference_t[link /reference/iterator/iter_reference_t.md] + ```cpp + using difference_type = typename incrementable_traits::difference_type; + using value_type = typename indirectly_readable_traits::value_type; + using pointer = /*see below*/; + using reference = /*see below*/; + using iterator_category = /*see below*/; + ``` + * see below[italic] + * indirectly_readable_traits[link /reference/iterator/indirectly_readable_traits.md] + * incrementable_traits[link /reference/iterator/incrementable_traits.md] + * iter_reference_t[link /reference/iterator/iter_reference_t.md] - `pointer`は、上から順に次のいずれか - ```cpp - using pointer = I::pointer; - using pointer = decltype(declval().operator->()); - using pointer = void; - ``` + ```cpp + using pointer = I::pointer; + using pointer = decltype(declval().operator->()); + using pointer = void; + ``` - `reference`は、上から順に次のいずれか - ```cpp - using reference = typename I::reference; - using reference = iter_reference_t; - ``` + ```cpp + using reference = typename I::reference; + using reference = iter_reference_t; + ``` - `iterator_category`は、上から順に次のいずれか - `I`が`cpp17-random-access-iterator`コンセプトを満たす場合、`random_access_iterator_tag` - `I`が`cpp17-bidirectional-iterator`コンセプトを満たす場合、`bidirectional_iterator_tag` - `I`が`cpp17-forward-iterator`コンセプトを満たす場合、`forward_iterator_tag` - それ以外の場合、`input_iterator_tag` - + - そうではなく、`I`が`cpp17-iterator`コンセプトを満たす場合、それぞれのメンバ型は次のように定義される - ```cpp - using difference_type = typename incrementable_traits::difference_type; - using value_type = void; - using pointer = void; - using reference = void; - using iterator_category = output_iterator_tag; - ``` + ```cpp + using difference_type = typename incrementable_traits::difference_type; + using value_type = void; + using pointer = void; + using reference = void; + using iterator_category = output_iterator_tag; + ``` - この時、`incrementable_traits::difference_type`が定義されない場合、`difference_type = void` diff --git a/reference/iterator/reverse_iterator/op_arrow.md b/reference/iterator/reverse_iterator/op_arrow.md index cc2109b2c2..0728dbaa4d 100644 --- a/reference/iterator/reverse_iterator/op_arrow.md +++ b/reference/iterator/reverse_iterator/op_arrow.md @@ -22,16 +22,16 @@ constexpr pointer operator->() const // C++20 - C++14 : [`addressof`](/reference/memory/addressof.md)`(operator*())` - C++20 : 次のいずれか - `Iterator`がポインタ型である場合 - ```cpp - return prev(current); - ``` - * prev[link /reference/iterator/prev.md] + ```cpp + return prev(current); + ``` + * prev[link /reference/iterator/prev.md] - それ以外の場合 - ```cpp - return prev(current).operator->(); - ``` - * prev[link /reference/iterator/prev.md] + ```cpp + return prev(current).operator->(); + ``` + * prev[link /reference/iterator/prev.md] ## 例 ```cpp example diff --git a/reference/string/basic_string/append.md b/reference/string/basic_string/append.md index aec3364381..8115e47037 100644 --- a/reference/string/basic_string/append.md +++ b/reference/string/basic_string/append.md @@ -107,21 +107,21 @@ constexpr basic_string& * `append(il.begin(), il.end())` と等価。 - (8) 対象オブジェクトの末尾に、[`basic_string_view`](/reference/string_view/basic_string_view.md)``に変換可能な`t`が参照する範囲の文字列が追加される。 以下と等価。 - ```cpp - basic_string_view sv = t; - return append(sv.data(), sv.size()); - ``` - * basic_string_view[link /reference/string_view/basic_string_view.md] + ```cpp + basic_string_view sv = t; + return append(sv.data(), sv.size()); + ``` + * basic_string_view[link /reference/string_view/basic_string_view.md] - (9) 対象オブジェクトの末尾に、[`basic_string_view`](/reference/string_view/basic_string_view.md)``に変換可能な`t`の指定された範囲の文字列が追加される。 * 文字列の長さ `rlen` は、`n` と [`sv.size()`](/reference/string_view/basic_string_view/size.md)` - pos` の小さい方である。 以下と等価。 - ```cpp - basic_string_view sv = t; - return append(sv.substr(pos, n)); - ``` - * basic_string_view[link /reference/string_view/basic_string_view.md] - * substr[link /reference/string_view/basic_string_view/substr.md] + ```cpp + basic_string_view sv = t; + return append(sv.substr(pos, n)); + ``` + * basic_string_view[link /reference/string_view/basic_string_view.md] + * substr[link /reference/string_view/basic_string_view/substr.md] ## 戻り値 diff --git a/reference/string/basic_string/assign.md b/reference/string/basic_string/assign.md index fc55fcb488..8cdbf74ac2 100644 --- a/reference/string/basic_string/assign.md +++ b/reference/string/basic_string/assign.md @@ -99,20 +99,20 @@ constexpr basic_string& - `assign(il.begin(), il.end())`を呼び出す。 - (9) : [`basic_string_view`](/reference/string_view/basic_string_view.md)``に変換可能な`t`が参照する範囲をコピーして、`basic_string`オブジェクトを構築する。 以下と等価。 - ```cpp - basic_string_view sv = t; - return assign(sv.data(), sv.size()); - ``` - * basic_string_view[link /reference/string_view/basic_string_view.md] + ```cpp + basic_string_view sv = t; + return assign(sv.data(), sv.size()); + ``` + * basic_string_view[link /reference/string_view/basic_string_view.md] - (10) : [`basic_string_view`](/reference/string_view/basic_string_view.md)``に変換可能な`t`が参照する文字列を範囲指定でコピーして、`basic_string`オブジェクトを構築する。 以下と等価。 - ```cpp - basic_string_view sv = t; - return assign(sv.substr(pos, n)); - ``` - * basic_string_view[link /reference/string_view/basic_string_view.md] - * substr[link /reference/string_view/basic_string_view/substr.md] + ```cpp + basic_string_view sv = t; + return assign(sv.substr(pos, n)); + ``` + * basic_string_view[link /reference/string_view/basic_string_view.md] + * substr[link /reference/string_view/basic_string_view/substr.md] ## 戻り値 diff --git a/reference/string/basic_string/compare.md b/reference/string/basic_string/compare.md index 6797746a7b..dc9ef61c3b 100644 --- a/reference/string/basic_string/compare.md +++ b/reference/string/basic_string/compare.md @@ -127,13 +127,13 @@ constexpr int - (7) (1)と同様の結果を返す。`return basic_string_view(*this).`[`compare`](/reference/string_view/basic_string_view/compare.md)`(t);`と等価。 - (8) `basic_string_view(*this).`[`substr`](/reference/string_view/basic_string_view/substr.md)`(pos1, n1).`[`compare`](/reference/string_view/basic_string_view/compare.md)`(t)` と等価 - (9) 以下と等価。 - ```cpp - basic_string_view s = *this, sv = t; - return s.substr(pos1, n1).compare(sv.substr(pos2, n2)); - ``` - * basic_string_view[link /reference/string_view/basic_string_view.md] - * substr[link /reference/string_view/basic_string_view/substr.md] - * compare[link /reference/string_view/basic_string_view/compare.md] + ```cpp + basic_string_view s = *this, sv = t; + return s.substr(pos1, n1).compare(sv.substr(pos2, n2)); + ``` + * basic_string_view[link /reference/string_view/basic_string_view.md] + * substr[link /reference/string_view/basic_string_view/substr.md] + * compare[link /reference/string_view/basic_string_view/compare.md] ## 例外 diff --git a/reference/string/basic_string/insert.md b/reference/string/basic_string/insert.md index 7d8c6927db..452956796d 100644 --- a/reference/string/basic_string/insert.md +++ b/reference/string/basic_string/insert.md @@ -118,19 +118,19 @@ constexpr basic_string& - (8) : `insert(p -` [`begin()`](begin.md)`, basic_string(first, last))`と等価の効果を持つ。 - (9) : `insert(p, il.`[`begin()`](/reference/initializer_list/initializer_list/begin.md)`, il.`[`end()`](/reference/initializer_list/initializer_list/end.md)`)` - (10) : 以下と等価。 - ```cpp - basic_string_view sv = t; - return insert(pos1, sv.data(), sv.size()); - ``` - * basic_string_view[link /reference/string_view/basic_string_view.md] + ```cpp + basic_string_view sv = t; + return insert(pos1, sv.data(), sv.size()); + ``` + * basic_string_view[link /reference/string_view/basic_string_view.md] - (11) : 以下と等価。 - ```cpp - basic_string_view sv = t; - return insert(pos1, sv.substr(pos2, n)); - ``` - * basic_string_view[link /reference/string_view/basic_string_view.md] - * substr[link /reference/string_view/basic_string_view/substr.md] + ```cpp + basic_string_view sv = t; + return insert(pos1, sv.substr(pos2, n)); + ``` + * basic_string_view[link /reference/string_view/basic_string_view.md] + * substr[link /reference/string_view/basic_string_view/substr.md] ## 戻り値 diff --git a/reference/string/basic_string/op_assign.md b/reference/string/basic_string/op_assign.md index bae7dba46e..103089ce15 100644 --- a/reference/string/basic_string/op_assign.md +++ b/reference/string/basic_string/op_assign.md @@ -42,12 +42,12 @@ basic_string& operator=(nullptr_t) = delete; // (7) C++23 - (4) : `*this = basic_string(1, c);` と等価。 - (5) : `*this = basic_string(il);` と等価。 - (6) : [`std::basic_string_view`](/reference/string_view/basic_string_view.md)オブジェクトからの変換。以下と等価。 - ```cpp - basic_string_view sv = t; - return assign(sv); - ``` - * basic_string_view[link /reference/string_view/basic_string_view.md] - * assign[link assign.md] + ```cpp + basic_string_view sv = t; + return assign(sv); + ``` + * basic_string_view[link /reference/string_view/basic_string_view.md] + * assign[link assign.md] ## テンプレートパラメータ制約 diff --git a/reference/string/basic_string/op_plus.md b/reference/string/basic_string/op_plus.md index 7e45e540f4..d44c7578ec 100644 --- a/reference/string/basic_string/op_plus.md +++ b/reference/string/basic_string/op_plus.md @@ -152,73 +152,73 @@ namespace std { ### C++20から - (1)(9) : 以下と等価 - ```cpp - basic_string r = lhs; - r.append(rhs); - return r; - ``` - * append[link append.md] + ```cpp + basic_string r = lhs; + r.append(rhs); + return r; + ``` + * append[link append.md] - (2)(10) : 以下と等価 - ```cpp - lhs.append(rhs); - return std::move(lhs); - ``` - * append[link append.md] + ```cpp + lhs.append(rhs); + return std::move(lhs); + ``` + * append[link append.md] - (3)(6) : 以下と等価 - ```cpp - rhs.insert(0, lhs); - return std::move(rhs); - ``` - * insert[link insert.md] + ```cpp + rhs.insert(0, lhs); + return std::move(rhs); + ``` + * insert[link insert.md] - (4) : 呼び出しの後でも`lhs`と`rhs`は有効だが未規定な状態のままであることを除いて、以下と等価 - ```cpp - lhs.append(rhs); - return std::move(lhs); - ``` - * append[link append.md] + ```cpp + lhs.append(rhs); + return std::move(lhs); + ``` + * append[link append.md] - (5) : 以下と等価 - ```cpp - basic_string r = rhs; - r.insert(0, lhs); - return r; - ``` - * insert[link insert.md] + ```cpp + basic_string r = rhs; + r.insert(0, lhs); + return r; + ``` + * insert[link insert.md] - (7) : 以下と等価 - ```cpp - basic_string r = rhs; - r.insert(r.begin(), lhs); - return r; - ``` - * insert[link insert.md] - * begin[link begin.md] + ```cpp + basic_string r = rhs; + r.insert(r.begin(), lhs); + return r; + ``` + * insert[link insert.md] + * begin[link begin.md] - (8) : 以下と等価 - ```cpp - rhs.insert(rhs.begin(), lhs); - return std::move(rhs); - ``` - * insert[link insert.md] - * begin[link begin.md] + ```cpp + rhs.insert(rhs.begin(), lhs); + return std::move(rhs); + ``` + * insert[link insert.md] + * begin[link begin.md] - (11) : 以下と等価 - ```cpp - basic_string r = lhs; - r.push_back(rhs); - return r; - ``` - * push_back[link push_back.md] + ```cpp + basic_string r = lhs; + r.push_back(rhs); + return r; + ``` + * push_back[link push_back.md] - (12) : 以下と等価 - ```cpp - lhs.push_back(rhs); - return std::move(lhs); - ``` - * push_back[link push_back.md] + ```cpp + lhs.push_back(rhs); + return std::move(lhs); + ``` + * push_back[link push_back.md] ## 備考 diff --git a/reference/string/basic_string/op_plus_assign.md b/reference/string/basic_string/op_plus_assign.md index 7f5dbb1ff5..970ee09efb 100644 --- a/reference/string/basic_string/op_plus_assign.md +++ b/reference/string/basic_string/op_plus_assign.md @@ -55,12 +55,12 @@ constexpr basic_string& operator+=(const T& t); // (5) C++20 - (5) 対象オブジェクトの末尾に[`basic_string_view`](/reference/string_view/basic_string_view.md)``に変換可能な`t`の参照する文字列が追加される。 以下と等価。 - ```cpp - basic_string_view sv = t; - return append(sv); - ``` - * basic_string_view[link /reference/string_view/basic_string_view.md] - * append[link append.md] + ```cpp + basic_string_view sv = t; + return append(sv); + ``` + * basic_string_view[link /reference/string_view/basic_string_view.md] + * append[link append.md] ## 戻り値 diff --git a/reference/string/basic_string/replace.md b/reference/string/basic_string/replace.md index 1ffedb7c86..623eebd07a 100644 --- a/reference/string/basic_string/replace.md +++ b/reference/string/basic_string/replace.md @@ -225,26 +225,26 @@ constexpr basic_string& - (10) : `replace(i1 -` [`begin()`](begin.md)`, i2 - i1, basic_string(j1, j2))`を呼び出す。 - (11) : `replace(i1 -` [`begin()`](begin.md)`, i2 - i1, il.`[`begin()`](/reference/initializer_list/initializer_list/begin.md)`, il.`[`size()`](/reference/initializer_list/initializer_list/size.md)`)`を呼び出す。 - (12) : 以下と等価。 - ```cpp - basic_string_view sv = t; - return replace(pos1, n1, sv.data(), sv.size()); - ``` - * basic_string_view[link /reference/string_view/basic_string_view.md] + ```cpp + basic_string_view sv = t; + return replace(pos1, n1, sv.data(), sv.size()); + ``` + * basic_string_view[link /reference/string_view/basic_string_view.md] - (13) : 以下と等価。 - ```cpp - basic_string_view sv = t; - return replace(pos1, n1, sv.substr(pos2, n2)); - ``` - * basic_string_view[link /reference/string_view/basic_string_view.md] - * substr[link /reference/string_view/basic_string_view/substr.md] + ```cpp + basic_string_view sv = t; + return replace(pos1, n1, sv.substr(pos2, n2)); + ``` + * basic_string_view[link /reference/string_view/basic_string_view.md] + * substr[link /reference/string_view/basic_string_view/substr.md] - (14) : 以下と等価。 - ```cpp - basic_string_view sv = t; - return replace(i1 - begin(), i2 - i1, sv.data(), sv.size()); - ``` - * basic_string_view[link /reference/string_view/basic_string_view.md] + ```cpp + basic_string_view sv = t; + return replace(i1 - begin(), i2 - i1, sv.data(), sv.size()); + ``` + * basic_string_view[link /reference/string_view/basic_string_view.md] ## 戻り値 From ae69e815d066d9e655008da074abf27b02e25b41 Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 9 Dec 2024 16:44:41 +0900 Subject: [PATCH 1295/3948] mdspan/AccessorPolicy: fix typo --- reference/mdspan/AccessorPolicy.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/mdspan/AccessorPolicy.md b/reference/mdspan/AccessorPolicy.md index ab4ab00be1..9cd8cb4274 100644 --- a/reference/mdspan/AccessorPolicy.md +++ b/reference/mdspan/AccessorPolicy.md @@ -1,4 +1,4 @@ -# AccsessorPolicy +# AccessorPolicy * cpp23[meta cpp] * mdspan[meta header] * named requirement[meta id-type] @@ -6,11 +6,11 @@ ## 概要 -AccsessorPolicyは、多次元配列ビュー[`mdspan`](mdspan.md)を介した要素アクセス動作を定義するクラスが満たすべき要件である。 +AccessorPolicyは、多次元配列ビュー[`mdspan`](mdspan.md)を介した要素アクセス動作を定義するクラスが満たすべき要件である。 ## 要件 -AccsessorPolicyを満たす型`A`は +AccessorPolicyを満たす型`A`は - `A`は[`copyable`](/reference/concepts/copyable.md)のモデルであり、かつ - [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)``は`true`であり、かつ From 1956c49740bc18530991c27a64e1a8de0e731cfc Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Wed, 20 Nov 2024 21:15:43 +0900 Subject: [PATCH 1296/3948] =?UTF-8?q?markdown=5Fto=5Fhtml.html=5Fattribute?= =?UTF-8?q?=20=E5=A4=89=E6=9B=B4=E3=81=AB=E4=BC=B4=E3=81=86=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/cpprefjp/markdown_to_html/pull/7 --- reference/cfloat.md | 10 +++++----- reference/cfloat/dbl_decimal_dig.md | 4 ++-- reference/cfloat/dbl_dig.md | 4 ++-- reference/cfloat/decimal_dig.md | 4 ++-- reference/cfloat/flt_decimal_dig.md | 4 ++-- reference/cfloat/flt_dig.md | 4 ++-- reference/cfloat/ldbl_decimal_dig.md | 4 ++-- reference/cfloat/ldbl_dig.md | 4 ++-- reference/cmath/acos.md | 4 ++-- reference/cmath/acosh.md | 2 +- reference/cmath/asin.md | 4 ++-- reference/cmath/asinh.md | 2 +- reference/cmath/atan.md | 6 +++--- reference/cmath/atan2.md | 6 +++--- reference/cmath/atanh.md | 4 ++-- reference/cmath/log.md | 2 +- reference/cmath/riemann_zeta.md | 6 +++--- reference/cmath/tan.md | 2 +- reference/cmath/tanh.md | 2 +- reference/numeric/gcd.md | 4 ++-- start_editing/markdown_cpprefjp.md | 10 +++++----- 21 files changed, 46 insertions(+), 46 deletions(-) diff --git a/reference/cfloat.md b/reference/cfloat.md index ad10d92f3e..7a93ec5767 100644 --- a/reference/cfloat.md +++ b/reference/cfloat.md @@ -14,11 +14,11 @@ $$x = sb^e\sum^p_{k=1}f_kb^{-k},\qquad e_{\rm min} \le e \le e_{\rm max}$$ $$ \begin{array}{ll} -s&\text{符号($\pm 1$)}\\ -b&\text{指数表現の基数(1 より大きい整数)}\\ -e&\text{指数(最小 $e_{\rm min}$ 最大 $e_{\rm max}$ の整数)}\\ -p&\text{精度(基数 $b$ での仮数部の桁数)}\\ -f_k&\text{$b$ より小さい非負整数(仮数部の有効数字)}\\ +s&\text{符号($\pm 1$)}\\ +b&\text{指数表現の基数(1 より大きい整数)}\\ +e&\text{指数(最小 $e_{\rm min}$ 最大 $e_{\rm max}$ の整数)}\\ +p&\text{精度(基数 $b$ での仮数部の桁数)}\\ +f_k&\text{$b$ より小さい非負整数(仮数部の有効数字)}\\ \end{array} $$ diff --git a/reference/cfloat/dbl_decimal_dig.md b/reference/cfloat/dbl_decimal_dig.md index 6e8ebca1a8..deea711523 100644 --- a/reference/cfloat/dbl_decimal_dig.md +++ b/reference/cfloat/dbl_decimal_dig.md @@ -16,8 +16,8 @@ $$ \left\{ \begin{array}{ll} -p \log_{10} b&\text{$b$ が $10$ の累乗の場合}\\ -\lceil 1 + p \log_{10} b\rceil&\text{上記以外の場合}\\ +p \log_{10} b&\text{$b$ が $10$ の累乗の場合}\\ +\lceil 1 + p \log_{10} b\rceil&\text{上記以外の場合}\\ \end{array} \right. $$ diff --git a/reference/cfloat/dbl_dig.md b/reference/cfloat/dbl_dig.md index 945489d50b..3bf9d9261c 100644 --- a/reference/cfloat/dbl_dig.md +++ b/reference/cfloat/dbl_dig.md @@ -15,8 +15,8 @@ $$ \left\{ \begin{array}{ll} -p \log_{10}b&\text{もし $b$ が $10$ の累乗の場合}\\ -\lfloor (p - 1) \log_{10} b\rfloor&\text{上記以外の場合}\\ +p \log_{10}b&\text{もし $b$ が $10$ の累乗の場合}\\ +\lfloor (p - 1) \log_{10} b\rfloor&\text{上記以外の場合}\\ \end{array} \right. $$ diff --git a/reference/cfloat/decimal_dig.md b/reference/cfloat/decimal_dig.md index c19fb885b8..5adf80d54f 100644 --- a/reference/cfloat/decimal_dig.md +++ b/reference/cfloat/decimal_dig.md @@ -16,8 +16,8 @@ $$ \left\{ \begin{array}{ll} -p_{\rm max} \log_{10} b&\text{$b$ が $10$ の累乗の場合}\\ -\lceil 1 + p_{\rm max}\log_{10} b\rceil&\text{上記以外の場合}\\ +p_{\rm max} \log_{10} b&\text{$b$ が $10$ の累乗の場合}\\ +\lceil 1 + p_{\rm max}\log_{10} b\rceil&\text{上記以外の場合}\\ \end{array} \right. $$ diff --git a/reference/cfloat/flt_decimal_dig.md b/reference/cfloat/flt_decimal_dig.md index c2771dc771..e02e9e2d8b 100644 --- a/reference/cfloat/flt_decimal_dig.md +++ b/reference/cfloat/flt_decimal_dig.md @@ -16,8 +16,8 @@ $$ \left\{ \begin{array}{ll} -p \log_{10} b&\text{$b$ が $10$ の累乗の場合}\\ -\lceil 1 + p \log_{10} b\rceil&\text{上記以外の場合}\\ +p \log_{10} b&\text{$b$ が $10$ の累乗の場合}\\ +\lceil 1 + p \log_{10} b\rceil&\text{上記以外の場合}\\ \end{array} \right. $$ diff --git a/reference/cfloat/flt_dig.md b/reference/cfloat/flt_dig.md index fa16ccad45..cabd5e0810 100644 --- a/reference/cfloat/flt_dig.md +++ b/reference/cfloat/flt_dig.md @@ -15,8 +15,8 @@ $$ \left\{ \begin{array}{ll} -p \log_{10}b&\text{もし $b$ が $10$ の累乗の場合}\\ -\lfloor (p - 1) \log_{10} b\rfloor&\text{上記以外の場合}\\ +p \log_{10}b&\text{もし $b$ が $10$ の累乗の場合}\\ +\lfloor (p - 1) \log_{10} b\rfloor&\text{上記以外の場合}\\ \end{array} \right. $$ diff --git a/reference/cfloat/ldbl_decimal_dig.md b/reference/cfloat/ldbl_decimal_dig.md index 6788bdd03a..8064f1c0e0 100644 --- a/reference/cfloat/ldbl_decimal_dig.md +++ b/reference/cfloat/ldbl_decimal_dig.md @@ -16,8 +16,8 @@ $$ \left\{ \begin{array}{ll} -p \log_{10} b&\text{$b$ が $10$ の累乗の場合}\\ -\lceil 1 + p \log_{10} b\rceil&\text{上記以外の場合}\\ +p \log_{10} b&\text{$b$ が $10$ の累乗の場合}\\ +\lceil 1 + p \log_{10} b\rceil&\text{上記以外の場合}\\ \end{array} \right. $$ diff --git a/reference/cfloat/ldbl_dig.md b/reference/cfloat/ldbl_dig.md index e1a2c5c4d3..654bec2991 100644 --- a/reference/cfloat/ldbl_dig.md +++ b/reference/cfloat/ldbl_dig.md @@ -15,8 +15,8 @@ $$ \left\{ \begin{array}{ll} -p \log_{10}b&\text{もし $b$ が $10$ の累乗の場合}\\ -\lfloor (p - 1) \log_{10} b\rfloor&\text{上記以外の場合}\\ +p \log_{10}b&\text{もし $b$ が $10$ の累乗の場合}\\ +\lfloor (p - 1) \log_{10} b\rfloor&\text{上記以外の場合}\\ \end{array} \right. $$ diff --git a/reference/cmath/acos.md b/reference/cmath/acos.md index 75be823d9d..ec8954c95f 100644 --- a/reference/cmath/acos.md +++ b/reference/cmath/acos.md @@ -112,12 +112,12 @@ acos(-1.0) = 3.141593 ## 実装例 以下のマクローリン級数を適当な次数で打ち切ることで近似的に求めることができる。 -$$ \mathrm{Arccos}~x = \frac{\pi}{2} - \sum_{n = 0}^{\infty}\frac{\left(2n\right)!}{4^n\left(n!\right)^2\left(2n + 1\right)}x^{2n+1} \quad \mathrm{for} \; |x| < 1 $$ +$$ \mathrm{Arccos}~x = \frac{\pi}{2} - \sum_{n = 0}^{\infty}\frac{\left(2n\right)!}{4^n\left(n!\right)^2\left(2n + 1\right)}x^{2n+1} \quad \mathrm{for} \; |x| < 1 $$ また、逆正接関数と逆余接関数の和は π / 2 なので [`asin`](asin.md) から求めることができる。 -$$ \mathrm{Arccos}~x = \frac{\pi}{2} - \mathrm{Arcsin}~x \quad \mathrm{for} \; |x| < 1 $$ +$$ \mathrm{Arccos}~x = \frac{\pi}{2} - \mathrm{Arcsin}~x \quad \mathrm{for} \; |x| < 1 $$ ## 参照 diff --git a/reference/cmath/acosh.md b/reference/cmath/acosh.md index fa00c8a384..37351dd1a6 100644 --- a/reference/cmath/acosh.md +++ b/reference/cmath/acosh.md @@ -102,7 +102,7 @@ acosh(∞) = inf ## 実装例 対数に変換して求めることができる。 -$$ \mathrm{arcosh}~x = \log_e \left(x + \sqrt{x^2-1}\right) \quad \mathrm{for} \; 1 < x $$ +$$ \mathrm{arcosh}~x = \log_e \left(x + \sqrt{x^2-1}\right) \quad \mathrm{for} \; 1 < x $$ ## 参照 diff --git a/reference/cmath/asin.md b/reference/cmath/asin.md index c95a03bc73..aed3a97b75 100644 --- a/reference/cmath/asin.md +++ b/reference/cmath/asin.md @@ -108,10 +108,10 @@ asin(1.0) = 1.570796 ## 実装例 以下のマクローリン級数を適当な次数で打ち切ることで近似的に求めることができる。 -$$ \mathrm{Arcsin}~x = \sum_{n = 0}^{\infty} \frac{(2n)!}{4^n (n!)^2 (2n+1)} x^{2n + 1} \quad \mathrm{for} \; |x| < 1 $$ +$$ \mathrm{Arcsin}~x = \sum_{n = 0}^{\infty} \frac{(2n)!}{4^n (n!)^2 (2n+1)} x^{2n + 1} \quad \mathrm{for} \; |x| < 1 $$ -$|x| = 1$ 近傍の精度低下する領域(特に $1 / \sqrt{2} < |x| \le 1$)においては、以下の公式による変換で精度向上を図れる。 +$|x| = 1$ 近傍の精度低下する領域(特に $1 / \sqrt{2} < |x| \le 1$)においては、以下の公式による変換で精度向上を図れる。 $$ \mathrm{Arcsin}~x = \frac{\pi}{2} - \mathrm{Arccos}~x = \frac{\pi}{2} - \mathrm{Arcsin}~\sqrt{1 - x^2} \quad \mathrm{for} \; 0 \le x \le 1 $$ diff --git a/reference/cmath/asinh.md b/reference/cmath/asinh.md index f64c9b7025..744ff3e8fc 100644 --- a/reference/cmath/asinh.md +++ b/reference/cmath/asinh.md @@ -98,7 +98,7 @@ asinh(1.0) = 0.881374 ## 実装例 以下のマクローリン級数を適当な次数で打ち切ることで近似的に求めることができる。 -$$ \mathrm{arsinh}~x = \sum_{n = 0}^{\infty} \frac{(-1)^n (2n)!}{4^n (n!)^2 (2n + 1)} x^{2n + 1} \quad \mathrm{for} \; |x| < 1 $$ +$$ \mathrm{arsinh}~x = \sum_{n = 0}^{\infty} \frac{(-1)^n (2n)!}{4^n (n!)^2 (2n + 1)} x^{2n + 1} \quad \mathrm{for} \; |x| < 1 $$ または対数に変換して求めることができる。 diff --git a/reference/cmath/atan.md b/reference/cmath/atan.md index f795bc0b04..2fa1667e7d 100644 --- a/reference/cmath/atan.md +++ b/reference/cmath/atan.md @@ -99,17 +99,17 @@ atan(∞) = 1.570796 ## 実装例 以下のマクローリン級数を適当な次数で打ち切ることで近似的に求めることができる。 -$$ \mathrm{Arctan}~x = \sum_{n = 0}^{\infty} \frac{(-1)^n}{2n + 1} x^{2n + 1} \quad \mathrm{for} \; |x| < 1 $$ +$$ \mathrm{Arctan}~x = \sum_{n = 0}^{\infty} \frac{(-1)^n}{2n + 1} x^{2n + 1} \quad \mathrm{for} \; |x| < 1 $$ $ |x| \ge 1 $ の範囲、および $ |x| \rightarrow 1 $ 近傍の精度低下する領域においては、以下の公式による変換で求めることができる。 -(特に $ \sqrt{2} + 1 < |x| $ の場合) +(特に $ \sqrt{2} + 1 < |x| $ の場合) $$ \mathrm{Arctan}~x = \frac{\pi}{2} - \mathrm{Arctan}~\frac{1}{x} \quad \mathrm{for} \; x > 0 $$ -(特に $ \sqrt{2} - 1 < |x| \le \sqrt{2} + 1 $ の場合) +(特に $ \sqrt{2} - 1 < |x| \le \sqrt{2} + 1 $ の場合) $$ \mathrm{Arctan}~x = \frac{\pi}{4} + \mathrm{Arctan}~\frac{x - 1}{x + 1} \quad \mathrm{for} \; x \ne -1 $$ diff --git a/reference/cmath/atan2.md b/reference/cmath/atan2.md index 809a3b3672..2cb6bf45bc 100644 --- a/reference/cmath/atan2.md +++ b/reference/cmath/atan2.md @@ -138,9 +138,9 @@ atan2(-1.0, 1.0) = -0.785398 $$ \mathrm{Arctan}~\frac{y}{x} = \begin{cases} -\displaystyle \mathrm{Arctan}~\frac{y}{x} & \quad \mathrm{for} \; 0 \le x \\[2ex] -\displaystyle \mathrm{Arctan}~\frac{y}{x} + \pi & \quad \mathrm{for} \; x < 0, \; 0 \le y \\[2ex] -\displaystyle \mathrm{Arctan}~\frac{y}{x} - \pi & \quad \mathrm{for} \; x < 0, \; y < 0 +\displaystyle \mathrm{Arctan}~\frac{y}{x} & \quad \mathrm{for} \; 0 \le x \\[2ex] +\displaystyle \mathrm{Arctan}~\frac{y}{x} + \pi & \quad \mathrm{for} \; x < 0, \; 0 \le y \\[2ex] +\displaystyle \mathrm{Arctan}~\frac{y}{x} - \pi & \quad \mathrm{for} \; x < 0, \; y < 0 \end{cases} $$ diff --git a/reference/cmath/atanh.md b/reference/cmath/atanh.md index 0a8febb2d9..0233b76ca3 100644 --- a/reference/cmath/atanh.md +++ b/reference/cmath/atanh.md @@ -105,12 +105,12 @@ atanh(1.0) = inf ## 実装例 以下のマクローリン級数を適当な次数で打ち切ることで近似的に求めることができる。 -$$ \mathrm{artanh}~x = \sum_{n = 0}^{\infty} \frac{1}{2n + 1} x^{2n + 1} \quad \mathrm{for} \; |x| < 1 $$ +$$ \mathrm{artanh}~x = \sum_{n = 0}^{\infty} \frac{1}{2n + 1} x^{2n + 1} \quad \mathrm{for} \; |x| < 1 $$ または対数に変換して求めることができる。 -$$ \mathrm{artanh}~x = \frac{1}{2} \log_e \frac{1 + x}{1 - x} \quad \mathrm{for} \; |x| < 1 $$ +$$ \mathrm{artanh}~x = \frac{1}{2} \log_e \frac{1 + x}{1 - x} \quad \mathrm{for} \; |x| < 1 $$ ## 参照 diff --git a/reference/cmath/log.md b/reference/cmath/log.md index e750a577d9..9faf891717 100644 --- a/reference/cmath/log.md +++ b/reference/cmath/log.md @@ -108,7 +108,7 @@ log(-1.0) = nan ## 実装例 以下のマクローリン級数を適当な次数で打ち切ることで近似的に求めることができる。 -$$ \log_e (1 + x) = \sum_{n = 1}^{\infty} \frac{(-1)^{n + 1}}{n} x^n \quad \mathrm{for} \; -1 < x \le 1 $$ +$$ \log_e (1 + x) = \sum_{n = 1}^{\infty} \frac{(-1)^{n + 1}}{n} x^n \quad \mathrm{for} \; -1 < x \le 1 $$ ## 参照 diff --git a/reference/cmath/riemann_zeta.md b/reference/cmath/riemann_zeta.md index 65d1f4dfd3..06d06fef16 100644 --- a/reference/cmath/riemann_zeta.md +++ b/reference/cmath/riemann_zeta.md @@ -41,11 +41,11 @@ namespace std { $$ \zeta (x) = \begin{cases} \displaystyle - \sum_{k=1}^\infty k^{-x} & \text{for } x > 1 \\ + \sum_{k=1}^\infty k^{-x} & \text{for } x > 1 \\ \displaystyle - \frac{1}{1 - 2^{1-x}} \sum_{k=1}^\infty (-1)^{k-1} k^{-x} & \text{for } 0 \le x \le 1 \\ + \frac{1}{1 - 2^{1-x}} \sum_{k=1}^\infty (-1)^{k-1} k^{-x} & \text{for } 0 \le x \le 1 \\ \displaystyle - 2^x \pi^{x-1} \sin \frac{\pi x}{2} \Gamma (1 - x) \zeta(1 - x) & \text{for } x < 0 + 2^x \pi^{x-1} \sin \frac{\pi x}{2} \Gamma (1 - x) \zeta(1 - x) & \text{for } x < 0 \end{cases} $$ を返す。 diff --git a/reference/cmath/tan.md b/reference/cmath/tan.md index d72996df4e..2eecf915b8 100644 --- a/reference/cmath/tan.md +++ b/reference/cmath/tan.md @@ -103,7 +103,7 @@ tan(pi/2) = 16331239353195370.000000 ## 実装例 `tan` のマクローリン展開はベルヌーイ数が登場するため計算には向かない。 -$$ \tan x = \sum_{n = 1}^{\infty} \frac{B_{2n}(-4)^n(1-4^n)}{(2n)!} x^{2n - 1} \quad \mathrm{for} \; |x| < \frac{\pi}{2} $$ +$$ \tan x = \sum_{n = 1}^{\infty} \frac{B_{2n}(-4)^n(1-4^n)}{(2n)!} x^{2n - 1} \quad \mathrm{for} \; |x| < \frac{\pi}{2} $$ 以下の公式から求めることができる。 diff --git a/reference/cmath/tanh.md b/reference/cmath/tanh.md index 4e05c79e8b..bfae3387eb 100644 --- a/reference/cmath/tanh.md +++ b/reference/cmath/tanh.md @@ -97,7 +97,7 @@ tanh(1.0) = 0.761594 ## 実装例 `tanh` のマクローリン展開はベルヌーイ数が登場するため計算には向かない。 -$$ \tanh x = \sum_{n = 1}^{\infty} \frac{B_{2n}4^n(4^n - 1)}{(2n)!} x^{2n - 1} \quad \mathrm{for} \; |x| < \frac{\pi}{2} $$ +$$ \tanh x = \sum_{n = 1}^{\infty} \frac{B_{2n}4^n(4^n - 1)}{(2n)!} x^{2n - 1} \quad \mathrm{for} \; |x| < \frac{\pi}{2} $$ 以下の公式から求めることができる。 diff --git a/reference/numeric/gcd.md b/reference/numeric/gcd.md index 68ef4a17db..1e2049b6db 100644 --- a/reference/numeric/gcd.md +++ b/reference/numeric/gcd.md @@ -164,6 +164,6 @@ int main() { ## 実装例 $$ \mathrm{gcd}(m, n) = \begin{cases} - |m| & \text{if } n = 0 \\ - \mathrm{gcd}(n, m \bmod n) & \text{otherwise} + |m| & \text{if } n = 0 \\ + \mathrm{gcd}(n, m \bmod n) & \text{otherwise} \end{cases} $$ diff --git a/start_editing/markdown_cpprefjp.md b/start_editing/markdown_cpprefjp.md index 9c5543c1a8..ea8d3cb62b 100644 --- a/start_editing/markdown_cpprefjp.md +++ b/start_editing/markdown_cpprefjp.md @@ -31,7 +31,7 @@ comment out text... ### 表内での縦線の制限 -表内で `|` (縦線、vertical line) を使用するために、文字参照 `&#x7C;` を使用しています。 +表内で `|` (縦線、vertical line) を使用するために、文字参照 `|` を使用しています。 ### 箇条書きのインデントとして4スペースのみを許可する制限 @@ -372,8 +372,8 @@ Markdown: $$ \left\{ \begin{array}{ll} -p \log_{10}b&\text{もし $b$ が $10$ の累乗の場合}\\ -\lfloor (p - 1) \log_{10} b\rfloor&\text{上記以外の場合}\\ +p \log_{10}b&\text{もし $b$ が $10$ の累乗の場合}\\ +\lfloor (p - 1) \log_{10} b\rfloor&\text{上記以外の場合}\\ \end{array} \right. $$ @@ -383,8 +383,8 @@ $$ $$ \left\{ \begin{array}{ll} -p \log_{10}b&\text{もし $b$ が $10$ の累乗の場合}\\ -\lfloor (p - 1) \log_{10} b\rfloor&\text{上記以外の場合}\\ +p \log_{10}b&\text{もし $b$ が $10$ の累乗の場合}\\ +\lfloor (p - 1) \log_{10} b\rfloor&\text{上記以外の場合}\\ \end{array} \right. $$ From 17433f40f69bd9debd8b19f1257063fb589dd73b Mon Sep 17 00:00:00 2001 From: suomesta Date: Mon, 9 Dec 2024 22:04:29 +0900 Subject: [PATCH 1297/3948] add meta cpp tag --- reference/compare/strong_ordering/op_partial_ordering.md | 1 + reference/compare/strong_ordering/op_weak_ordering.md | 1 + reference/compare/weak_ordering/op_partial_ordering.md | 1 + 3 files changed, 3 insertions(+) diff --git a/reference/compare/strong_ordering/op_partial_ordering.md b/reference/compare/strong_ordering/op_partial_ordering.md index 058a267974..b4ebedfe1b 100644 --- a/reference/compare/strong_ordering/op_partial_ordering.md +++ b/reference/compare/strong_ordering/op_partial_ordering.md @@ -3,6 +3,7 @@ * std[meta namespace] * strong_ordering[meta class] * function[meta id-type] +* cpp20[meta cpp] ```cpp constexpr operator partial_ordering() const noexcept; diff --git a/reference/compare/strong_ordering/op_weak_ordering.md b/reference/compare/strong_ordering/op_weak_ordering.md index ab9d56fee4..aa1eda64bf 100644 --- a/reference/compare/strong_ordering/op_weak_ordering.md +++ b/reference/compare/strong_ordering/op_weak_ordering.md @@ -3,6 +3,7 @@ * std[meta namespace] * strong_ordering[meta class] * function[meta id-type] +* cpp20[meta cpp] ```cpp constexpr operator weak_ordering() const noexcept; diff --git a/reference/compare/weak_ordering/op_partial_ordering.md b/reference/compare/weak_ordering/op_partial_ordering.md index 8807cea4ad..ad6221133a 100644 --- a/reference/compare/weak_ordering/op_partial_ordering.md +++ b/reference/compare/weak_ordering/op_partial_ordering.md @@ -3,6 +3,7 @@ * std[meta namespace] * weak_ordering[meta class] * function[meta id-type] +* cpp20[meta cpp] ```cpp constexpr operator partial_ordering() const noexcept; From 7675064dcb97135b059322e9be4dbf90b2fc2d7d Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 10 Dec 2024 00:06:18 +0900 Subject: [PATCH 1298/3948] =?UTF-8?q?mdspan/layout=5F{left,right}(=5Fpadde?= =?UTF-8?q?d):=20P3355R1=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../layout_left/mapping/submdspan_mapping.md | 15 +++++++++++---- .../mapping/submdspan_mapping.md | 15 +++++++++++---- .../layout_right/mapping/submdspan_mapping.md | 15 +++++++++++---- .../mapping/submdspan_mapping.md | 15 +++++++++++---- working_style.md | 1 + 5 files changed, 45 insertions(+), 16 deletions(-) diff --git a/reference/mdspan/layout_left/mapping/submdspan_mapping.md b/reference/mdspan/layout_left/mapping/submdspan_mapping.md index ed45bc3373..e831b2de2a 100644 --- a/reference/mdspan/layout_left/mapping/submdspan_mapping.md +++ b/reference/mdspan/layout_left/mapping/submdspan_mapping.md @@ -59,18 +59,24 @@ friend constexpr auto submdspan_mapping( - パラメータパック`P` : [`is_same_v`](/reference/type_traits/is_same.md)`<`[`make_index_sequence`](/reference/utility/make_index_sequence.md)`,` [`index_sequence`](/reference/utility/index_sequence.md)`> == true` - 値`offset` : `size_t`型の値[`(*this)`](op_call.md)`(`[`first_`](../../first_.md)`(slices...)...)` +下記を満たす型`S`を、単位ストライド幅スライス(unit-stride slice)と定義する。 + +- 型`S`が[`strided_slice`](../../strided_slice.md)の特殊化であり型`S::stride_type`が[`integral-constant-like`](/reference/span/integral-constant-like.md)のモデルかつ`S::stride_type::value`が`1`に等しい、もしくは +- 型`S`が[`index-pair-like`](../../index-pair-like.md)``のモデル、もしくは +- [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` + 説明専用の`submdspan-mapping-impl`関数テンプレートは下記の値を返す。 - [`Extents::rank()`](../../extents/rank.md) `== 0`のとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{*this, 0}` - `SubExtents::rank() == 0`のとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_left::mapping`](../../layout_left.md)`(sub_ext), offset}` - 以下を満たすとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_left::mapping`](../../layout_left.md)`(sub_ext), offset}` - 半開区間`[0, SubExtents::rank()-1)`の値`k`に対して、[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true`、かつ - - `SubExtents::rank()-1`に等しい値`k`に対して、型`S_k`が[`index-pair-like`](../../index-pair-like.md)``のモデルもしくは[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` + - `SubExtents::rank()-1`に等しい値`k`に対して、型`S_k`が単位ストライド幅スライスである - 以下を満たすとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_left_padded::mapping`](../../layout_left_padded/mapping.md)`(sub_ext, stride(u + 1)), offset}` - - 型`S_p`が[`index-pair-like`](../../index-pair-like.md)``のモデルもしくは[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true`を満たす`0`より大きい最小値`p`に対して、`u+1`が`p`となる値`u`を用いて - - 型`S_0`が[`index-pair-like`](../../index-pair-like.md)``のモデルもしくは[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true`、かつ + - 型`S_p`が単位ストライド幅スライスを満たす`0`より大きい最小値`p`に対して、`u+1`が`p`となる値`u`を用いて + - 型`S_0`が単位ストライド幅スライスであり、かつ - 半開区間`[u+1, u+SubExtents::rank()-1)`の値`k`に対して、[`is_convertible_v`](/reference/type_traits/is_convertible.md)``、かつ - - `u+SubExtents::rank()-1`に等しい値`k`に対して、型`S_k`が[`index-pair-like`](../../index-pair-like.md)``のモデルもしくは[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` + - `u+SubExtents::rank()-1`に等しい値`k`に対して、型`S_k`が単位ストライド幅スライスである - ここで定数`S_static`は - 半開区間`[0, u+1)`のいずれかの値`k`に対して`static_extent(k)`が[`dynamic_extent`](/reference/span/dynamic_extent.md)のとき、`dynamic_extent` - そうでなければ、半開区間`[0, u+1)`の全ての値`k`に対して`static_extent(k)`を乗算した値 @@ -95,3 +101,4 @@ friend constexpr auto submdspan_mapping( ## 参照 - [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) - [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) +- [P3355R1 Fix submdspan for C++26](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3355r1.html) diff --git a/reference/mdspan/layout_left_padded/mapping/submdspan_mapping.md b/reference/mdspan/layout_left_padded/mapping/submdspan_mapping.md index 39da81837c..6b6cdb3b08 100644 --- a/reference/mdspan/layout_left_padded/mapping/submdspan_mapping.md +++ b/reference/mdspan/layout_left_padded/mapping/submdspan_mapping.md @@ -59,18 +59,24 @@ friend constexpr auto submdspan_mapping( - パラメータパック`P` : [`is_same_v`](/reference/type_traits/is_same.md)`<`[`make_index_sequence`](/reference/utility/make_index_sequence.md)`,` [`index_sequence`](/reference/utility/index_sequence.md)`> == true` - 値`offset` : `size_t`型の値[`(*this)`](op_call.md)`(`[`first_`](../../first_.md)`(slices...)...)` +下記を満たす型`S`を、単位ストライド幅スライス(unit-stride slice)と定義する。 + +- 型`S`が[`strided_slice`](../../strided_slice.md)の特殊化であり型`S::stride_type`が[`integral-constant-like`](/reference/span/integral-constant-like.md)のモデルかつ`S::stride_type::value`が`1`に等しい、もしくは +- 型`S`が[`index-pair-like`](../../index-pair-like.md)``のモデル、もしくは +- [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` + 説明専用の`submdspan-mapping-impl`関数テンプレートは下記の値を返す。 - [`Extents::rank()`](../../extents/rank.md) `== 0`のとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{*this, 0}` - `rank_ == 1`または`SubExtents::rank() == 0`のとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_left::mapping`](../../layout_left.md)`(sub_ext), offset}` - 以下を満たすとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_left::mapping`](../../layout_left.md)`(sub_ext), offset}` - `SubExtents::rank() == 1`、かつ - - 型`S_0`が[`index-pair-like`](../../index-pair-like.md)``のモデルもしくは[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` + - 型`S_0`が単位ストライド幅スライスである - 以下を満たすとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{layout_left_padded::mapping(sub_ext, stride(u + 1)), offset}` - - 型`S_p`が[`index-pair-like`](../../index-pair-like.md)``のモデルもしくは[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true`を満たす`0`より大きい最小値`p`に対して、`u+1`が`p`となる値`u`を用いて - - 型`S_0`が[`index-pair-like`](../../index-pair-like.md)``のモデルもしくは[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true`、かつ + - 型`S_p`が単位ストライド幅スライスを満たす`0`より大きい最小値`p`に対して、`u+1`が`p`となる値`u`を用いて + - 型`S_0`が単位ストライド幅スライスであり、かつ - 半開区間`[u+1, u+SubExtents::rank()-1)`の値`k`に対して、[`is_convertible_v`](/reference/type_traits/is_convertible.md)``、かつ - - `u+SubExtents::rank()-1`に等しい値`k`に対して、型`S_k`が[`index-pair-like`](../../index-pair-like.md)``のモデルもしくは[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` + - `u+SubExtents::rank()-1`に等しい値`k`に対して、型`S_k`が単位ストライド幅スライスである - ここで定数`S_static`は - 半開区間`[0, u+1)`のいずれかの値`k`に対して`static_extent(k)`が[`dynamic_extent`](/reference/span/dynamic_extent.md)のとき、`dynamic_extent` - そうでなければ、半開区間`[0, u+1)`の全ての値`k`に対して`static_extent(k)`を乗算した値 @@ -95,3 +101,4 @@ friend constexpr auto submdspan_mapping( ## 参照 - [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) - [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) +- [P3355R1 Fix submdspan for C++26](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3355r1.html) diff --git a/reference/mdspan/layout_right/mapping/submdspan_mapping.md b/reference/mdspan/layout_right/mapping/submdspan_mapping.md index 3b7ba7f529..627f6a57e2 100644 --- a/reference/mdspan/layout_right/mapping/submdspan_mapping.md +++ b/reference/mdspan/layout_right/mapping/submdspan_mapping.md @@ -59,18 +59,24 @@ friend constexpr auto submdspan_mapping( - パラメータパック`P` : [`is_same_v`](/reference/type_traits/is_same.md)`<`[`make_index_sequence`](/reference/utility/make_index_sequence.md)`,` [`index_sequence`](/reference/utility/index_sequence.md)`> == true` - 値`offset` : `size_t`型の値[`(*this)`](op_call.md)`(`[`first_`](../../first_.md)`(slices...)...)` +下記を満たす型`S`を、単位ストライド幅スライス(unit-stride slice)と定義する。 + +- 型`S`が[`strided_slice`](../../strided_slice.md)の特殊化であり型`S::stride_type`が[`integral-constant-like`](/reference/span/integral-constant-like.md)のモデルかつ`S::stride_type::value`が`1`に等しい、もしくは +- 型`S`が[`index-pair-like`](../../index-pair-like.md)``のモデル、もしくは +- [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` + 説明専用の`submdspan-mapping-impl`関数テンプレートは下記の値を返す。 - [`Extents::rank()`](../../extents/rank.md) `== 0`のとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{*this, 0}` - `SubExtents::rank() == 0`のとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_right::mapping`](../../layout_right.md)`(sub_ext), offset}` - 以下を満たすとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_right::mapping`](../../layout_right.md)`(sub_ext), offset}` - 半開区間`[Extents::rank() - SubExtents::rank()+1, Extents::rank())`の値`k`に対して、[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true`、かつ - - `Extents::rank()-SubExtents::rank()`に等しい値`k`に対して、型`S_k`が[`index-pair-like`](../../index-pair-like.md)``のモデルもしくは[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` + - `Extents::rank()-SubExtents::rank()`に等しい値`k`に対して、型`S_k`が単位ストライド幅スライスである - 以下を満たすとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_right_padded::mapping`](../../layout_right_padded/mapping.md)`(sub_ext, stride(rank_-u-2)), offset}` - - 型`S_p`が[`index-pair-like`](../../index-pair-like.md)``のモデルもしくは[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true`を満たす`rank_-1`より小さい最大値`p`に対して、`rank_-u-2`が`p`となる値`u`を用いて - - `rank_-1`に等しい値`k`に対して、型`S_k`が[`index-pair-like`](../../index-pair-like.md)``のモデルもしくは[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true`、かつ + - 型`S_p`が単位ストライド幅スライスを満たす`rank_-1`より小さい最大値`p`に対して、`rank_-u-2`が`p`となる値`u`を用いて + - `rank_-1`に等しい値`k`に対して、型`S_k`が単位ストライド幅スライスであり、かつ - 半開区間`[rank_-SubExtents::rank()-u+1, rank_-u-1)`の値`k`に対して、[`is_convertible_v`](/reference/type_traits/is_convertible.md)``、かつ - - `rank_-SubExtents::rank()-u`に等しい値`k`に対して、型`S_k`が[`index-pair-like`](../../index-pair-like.md)``のモデルもしくは[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` + - `rank_-SubExtents::rank()-u`に等しい値`k`に対して、型`S_k`が単位ストライド幅スライスである - ここで定数`S_static`は - 半開区間`[rank_-u-1, rank_)`のいずれかの値`k`に対して`static_extent(k)`が[`dynamic_extent`](/reference/span/dynamic_extent.md)のとき、`dynamic_extent` - そうでなければ、半開区間`[rank_-u-1, rank_)`の全ての値`k`に対して`static_extent(k)`を乗算した値 @@ -95,3 +101,4 @@ friend constexpr auto submdspan_mapping( ## 参照 - [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) - [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) +- [P3355R1 Fix submdspan for C++26](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3355r1.html) diff --git a/reference/mdspan/layout_right_padded/mapping/submdspan_mapping.md b/reference/mdspan/layout_right_padded/mapping/submdspan_mapping.md index b53c0d1e4e..afb947788d 100644 --- a/reference/mdspan/layout_right_padded/mapping/submdspan_mapping.md +++ b/reference/mdspan/layout_right_padded/mapping/submdspan_mapping.md @@ -59,18 +59,24 @@ friend constexpr auto submdspan_mapping( - パラメータパック`P` : [`is_same_v`](/reference/type_traits/is_same.md)`<`[`make_index_sequence`](/reference/utility/make_index_sequence.md)`,` [`index_sequence`](/reference/utility/index_sequence.md)`> == true` - 値`offset` : `size_t`型の値[`(*this)`](op_call.md)`(`[`first_`](../../first_.md)`(slices...)...)` +下記を満たす型`S`を、単位ストライド幅スライス(unit-stride slice)と定義する。 + +- 型`S`が[`strided_slice`](../../strided_slice.md)の特殊化であり型`S::stride_type`が[`integral-constant-like`](/reference/span/integral-constant-like.md)のモデルかつ`S::stride_type::value`が`1`に等しい、もしくは +- 型`S`が[`index-pair-like`](../../index-pair-like.md)``のモデル、もしくは +- [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` + 説明専用の`submdspan-mapping-impl`関数テンプレートは下記の値を返す。 - [`Extents::rank()`](../../extents/rank.md) `== 0`のとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{*this, 0}` - `rank_ == 1`または`SubExtents::rank() == 0`のとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_right::mapping`](../../layout_right.md)`(sub_ext), offset}` - 以下を満たすとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_right::mapping`](../../layout_right.md)`(sub_ext), offset}` - `SubExtents::rank() == 1`、かつ - - `rank_-1`に等しい値`k`に対して、型`S_k`が[`index-pair-like`](../../index-pair-like.md)``のモデルもしくは[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` + - `rank_-1`に等しい値`k`に対して、型`S_k`が単位ストライド幅スライスである - 以下を満たすとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{layout_right_padded::mapping(sub_ext, stride(rank_-u-2)), offset}` - - 型`S_p`が[`index-pair-like`](../../index-pair-like.md)``のモデルもしくは[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true`を満たす`rank_-1`より小さい最大値`p`に対して、`rank_-u-2`が`p`となる値`u`を用いて - - `rank_-1`に等しい値`k`に対して、型`S_k`が[`index-pair-like`](../../index-pair-like.md)``のモデルもしくは[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true`、かつ + - 型`S_p`が単位ストライド幅スライスを満たす`rank_-1`より小さい最大値`p`に対して、`rank_-u-2`が`p`となる値`u`を用いて + - `rank_-1`に等しい値`k`に対して、型`S_k`が単位ストライド幅スライスであり、かつ - 半開区間`[rank_-SubExtents::rank()-u+1, rank_-u-1)`の値`k`に対して、[`is_convertible_v`](/reference/type_traits/is_convertible.md)``、かつ - - `rank_-SubExtents::rank()-u`に等しい値`k`に対して、型`S_k`が[`index-pair-like`](../../index-pair-like.md)``のモデルもしくは[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` + - `rank_-SubExtents::rank()-u`に等しい値`k`に対して、型`S_k`が単位ストライド幅スライスである - ここで定数`S_static`は - 半開区間`[rank_-u-1, rank_-1)`のいずれかの値`k`に対して`static_extent(k)`が[`dynamic_extent`](/reference/span/dynamic_extent.md)のとき、`dynamic_extent` - そうでなければ、半開区間`[rank_-u-1, rank_-1)`の全ての値`k`に対して`static_extent(k)`を乗算した値 @@ -95,3 +101,4 @@ friend constexpr auto submdspan_mapping( ## 参照 - [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) - [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) +- [P3355R1 Fix submdspan for C++26](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3355r1.html) diff --git a/working_style.md b/working_style.md index f7668d1664..980f180209 100644 --- a/working_style.md +++ b/working_style.md @@ -144,6 +144,7 @@ C++11以降対応については対応バージョンを明記します。バー | trait | トレイト | | trivial | トリビアル (逆は非トリビアル) | | underlying type | 基底型 | +| unit-stride slice | 単位ストライド幅スライス | | unordered associative container(s) | 非順序連想コンテナ | | unspecified | 未規定 | | program-defined type | プログラム定義型 | From ebf8c8fd705a194adb7b3f83786dad9c843d143b Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Tue, 10 Dec 2024 21:27:26 +0900 Subject: [PATCH 1299/3948] =?UTF-8?q?=E8=AA=A4=E3=81=A3=E3=81=9F=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E3=83=96=E3=83=AD=E3=83=83=E3=82=AF=E5=BE=8C?= =?UTF-8?q?=E3=81=AE=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE=E9=A3=BE=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp11/variadic_templates.md | 2 +- reference/chrono/reload_tzdb.md | 2 +- reference/format/formattable.md | 1 - reference/iterator/is_integer_like.md | 6 +++--- reference/iterator/move_iterator/op_equal.md | 2 +- reference/iterator/move_iterator/op_minus.md | 2 +- reference/mdspan/mdspan/op_assign.md | 4 ++-- reference/ranges/basic_istream_view.md | 4 ++-- 8 files changed, 11 insertions(+), 12 deletions(-) diff --git a/lang/cpp11/variadic_templates.md b/lang/cpp11/variadic_templates.md index 045a6d03d1..6162618635 100644 --- a/lang/cpp11/variadic_templates.md +++ b/lang/cpp11/variadic_templates.md @@ -401,4 +401,4 @@ void f(const T1& t1, const T2& t2, const T3& t3); - [N2191 Proposed Wording for Variadic Templates (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2191.pdf) - [N2242 Proposed Wording for Variadic Templates (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2242.pdf) - [N2488 Extending Variadic Template Template Parameters](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2488.pdf) -- [N2555 Extending Variadic Template Template Parameters (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2555.pdf) \ No newline at end of file +- [N2555 Extending Variadic Template Template Parameters (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2555.pdf) diff --git a/reference/chrono/reload_tzdb.md b/reference/chrono/reload_tzdb.md index 378a2e23ad..73892be896 100644 --- a/reference/chrono/reload_tzdb.md +++ b/reference/chrono/reload_tzdb.md @@ -37,7 +37,7 @@ if (get_tzdb().version != remote_version()) { ```cpp return get_tzdb_list().front(); ``` -* get_tzdb_list()[ink get_tzdb_list.md] +* get_tzdb_list()[link get_tzdb_list.md] * front()[link tzdb_list/front.md] diff --git a/reference/format/formattable.md b/reference/format/formattable.md index 7e9906010f..41989cc60c 100644 --- a/reference/format/formattable.md +++ b/reference/format/formattable.md @@ -55,7 +55,6 @@ int main() { } ``` * std::format[link format.md] -* ### 出力 ``` diff --git a/reference/iterator/is_integer_like.md b/reference/iterator/is_integer_like.md index d4b4118b67..ba4d9b2dde 100644 --- a/reference/iterator/is_integer_like.md +++ b/reference/iterator/is_integer_like.md @@ -71,9 +71,9 @@ concept _Integer_like = _Is_nonbool_integral> || _Integer_class template concept _Signed_integer_like = _Integer_like<_Ty> && static_cast<_Ty>(-1) < static_cast<_Ty>(0); ``` -* is_integral_v[like /reference/type_traits/is_integral.md] -* is_same_v[like /reference/type_traits/is_same.md] -* remove_cv_t[like /reference/type_traits/remove_cv.md] +* is_integral_v[link /reference/type_traits/is_integral.md] +* is_same_v[link /reference/type_traits/is_same.md] +* remove_cv_t[link /reference/type_traits/remove_cv.md] 上記の説明のうち構文的な要件を素直に実装している。MSVCでは、128ビット整数が*integer-class*型である。 diff --git a/reference/iterator/move_iterator/op_equal.md b/reference/iterator/move_iterator/op_equal.md index 34ea75dce8..9447104c08 100644 --- a/reference/iterator/move_iterator/op_equal.md +++ b/reference/iterator/move_iterator/op_equal.md @@ -29,7 +29,7 @@ namespace std { const move_iterator& y); // (3) C++17 } ``` -* sentinel_for[link /reference/iterator/sentinel_for.md) +* sentinel_for[link /reference/iterator/sentinel_for.md] * move_sentinel[link /reference/iterator/move_sentinel.md] ## 概要 diff --git a/reference/iterator/move_iterator/op_minus.md b/reference/iterator/move_iterator/op_minus.md index cf039059b6..c8430f9f48 100644 --- a/reference/iterator/move_iterator/op_minus.md +++ b/reference/iterator/move_iterator/op_minus.md @@ -30,7 +30,7 @@ namespace std { } ``` * base[link /reference/iterator/move_iterator/base.md] -* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md) +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] * iter_difference_t[link /reference/iterator/iter_difference_t.md] * move_sentinel[link /reference/iterator/move_sentinel.md] diff --git a/reference/mdspan/mdspan/op_assign.md b/reference/mdspan/mdspan/op_assign.md index cc6946809a..cccccef346 100644 --- a/reference/mdspan/mdspan/op_assign.md +++ b/reference/mdspan/mdspan/op_assign.md @@ -34,8 +34,8 @@ int main() assert(mat2.mapping() == mat1.mapping()); } ``` -* [data_handle()](data_handle.md) -* [mapping()](mapping.md) +* data_handle()[link data_handle.md] +* mapping()[link mapping.md] ### 出力 ``` diff --git a/reference/ranges/basic_istream_view.md b/reference/ranges/basic_istream_view.md index 4015db8e4d..9008e803c5 100644 --- a/reference/ranges/basic_istream_view.md +++ b/reference/ranges/basic_istream_view.md @@ -173,8 +173,8 @@ namespace std::ranges { * input_iterator_tag[link /reference/iterator/iterator_tag.md] * addressof[link /reference/memory/addressof.md] * default_sentinel_t[link /reference/iterator/default_sentinel_t.md] -* basic_istream[likn /reference/istream/basic_istream.md] -* char_traits[likn /reference/string/char_traits.md] +* basic_istream[link /reference/istream/basic_istream.md] +* char_traits[link /reference/string/char_traits.md] ## バージョン ### 言語 From 587d612b99f621e8cb0777e689ee0247d055d750 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Wed, 11 Dec 2024 11:53:37 +0900 Subject: [PATCH 1300/3948] =?UTF-8?q?=E8=AA=A4=E3=81=A3=E3=81=9F=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E3=83=96=E3=83=AD=E3=83=83=E3=82=AF=E5=BE=8C?= =?UTF-8?q?=E3=81=AE=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE=E9=A3=BE=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20(v2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp20/down_with_typename.md | 2 +- reference/chrono/day/formatter.md | 2 +- reference/chrono/duration/formatter.md | 2 +- reference/chrono/year/formatter.md | 2 +- reference/ranges/filter_view/iterator/op_decrement.md | 2 +- reference/ranges/filter_view/iterator/op_increment.md | 6 +++--- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lang/cpp20/down_with_typename.md b/lang/cpp20/down_with_typename.md index 90eb921e4c..edb703848f 100644 --- a/lang/cpp20/down_with_typename.md +++ b/lang/cpp20/down_with_typename.md @@ -52,7 +52,7 @@ template void f() { void g(T::X); // エラー: void型の変数宣言 } ``` -- P0634R3[link http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0634r3.html] +* P0634R3[link http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0634r3.html] ## 例 ```cpp example diff --git a/reference/chrono/day/formatter.md b/reference/chrono/day/formatter.md index 7dfaba5d45..9e5852b68c 100644 --- a/reference/chrono/day/formatter.md +++ b/reference/chrono/day/formatter.md @@ -32,7 +32,7 @@ int main() std::cout << std::format("{:%e}", chrono::day{3}) << std::endl; } ``` -- std::format[link /reference/chrono/format.md] +* std::format[link /reference/chrono/format.md] ### 出力 ``` diff --git a/reference/chrono/duration/formatter.md b/reference/chrono/duration/formatter.md index 5c5fcf1f27..4e2fd8c0a7 100644 --- a/reference/chrono/duration/formatter.md +++ b/reference/chrono/duration/formatter.md @@ -59,7 +59,7 @@ int main() std::cout << std::format("AM/PM : {:%p %I:00}", chrono::hours{15}) << std::endl; } ``` -- std::format[link /reference/chrono/format.md] +* std::format[link /reference/chrono/format.md] ### 出力 ``` diff --git a/reference/chrono/year/formatter.md b/reference/chrono/year/formatter.md index 56a21bc95c..8ef3af181e 100644 --- a/reference/chrono/year/formatter.md +++ b/reference/chrono/year/formatter.md @@ -50,7 +50,7 @@ int main() std::cout << std::format(std::locale("ja_JP.UTF-8"), "{:%EY}", chrono::year{2020}) << std::endl; } ``` -- std::format[link /reference/chrono/format.md] +* std::format[link /reference/chrono/format.md] ### 出力 ``` diff --git a/reference/ranges/filter_view/iterator/op_decrement.md b/reference/ranges/filter_view/iterator/op_decrement.md index 79450e66d9..6d8d255359 100644 --- a/reference/ranges/filter_view/iterator/op_decrement.md +++ b/reference/ranges/filter_view/iterator/op_decrement.md @@ -24,7 +24,7 @@ do while (!invoke(*parent_->pred_, *current_)); return *this; ``` -- invoke[link /reference/functional/invoke.md] +* invoke[link /reference/functional/invoke.md] と等しい。 diff --git a/reference/ranges/filter_view/iterator/op_increment.md b/reference/ranges/filter_view/iterator/op_increment.md index 28de17ad08..f7985e01dd 100644 --- a/reference/ranges/filter_view/iterator/op_increment.md +++ b/reference/ranges/filter_view/iterator/op_increment.md @@ -26,9 +26,9 @@ current_ = ranges::find_if( ref(*parent_->pred_)); return *this; ``` -- ranges::find_if[link /reference/algorithm/ranges_find_if.md] -- ranges::end[link /reference/ranges/end.md] -- ref[link /reference/functional/ref.md] +* ranges::find_if[link /reference/algorithm/ranges_find_if.md] +* ranges::end[link /reference/ranges/end.md] +* ref[link /reference/functional/ref.md] と等しい。 From bb2acdfa1cdf275f8d6f3e5c9c4bc8f446aec2ce Mon Sep 17 00:00:00 2001 From: biobios Date: Sun, 15 Dec 2024 04:22:43 +0900 Subject: [PATCH 1301/3948] fix type --- reference/iterator/indirectly_readable_traits.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/iterator/indirectly_readable_traits.md b/reference/iterator/indirectly_readable_traits.md index c8b9ef2e2b..f57b71e1c7 100644 --- a/reference/iterator/indirectly_readable_traits.md +++ b/reference/iterator/indirectly_readable_traits.md @@ -59,7 +59,7 @@ namespace std { template requires has-member-element-type && same_as, - remove_cv_t>; } + remove_cv_t> struct indirectly_readable_traits : cond-value-type { }; } From a983f3dd3b01a4f60aec4d82bf3cb37222b492ea Mon Sep 17 00:00:00 2001 From: biobios Date: Sun, 15 Dec 2024 04:47:14 +0900 Subject: [PATCH 1302/3948] =?UTF-8?q?=E8=A1=A8=E8=A8=98=E3=81=AE=E7=B5=B1?= =?UTF-8?q?=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/compare/common_comparison_category.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/compare/common_comparison_category.md b/reference/compare/common_comparison_category.md index ba9a1c749a..e14632dabf 100644 --- a/reference/compare/common_comparison_category.md +++ b/reference/compare/common_comparison_category.md @@ -30,7 +30,7 @@ namespace std { `Ts...`内のそれぞれの型を`Ti (0 <= i < N)`として、共通比較カテゴリ型`U`は以下のように決定される。 -1. `Ti`の中に一つでも比較カテゴリ型でない型がある場合、`U = void` +1. `Ti`の中に1つでも比較カテゴリ型でない型がある場合、`U = void` 2. `Ti`の中に1つでも`partial_ordering`がある場合、`U = partial_ordering` 3. `Ti`の中に1つでも`weak_ordering`がある場合、`U = weak_ordering` 4. それ以外の場合、`U = strong_ordering`(`N == 0`の場合) From 45569a7e59814e9353063a3c5699d64a25992534 Mon Sep 17 00:00:00 2001 From: biobios Date: Mon, 16 Dec 2024 02:43:57 +0900 Subject: [PATCH 1303/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF:=20?= =?UTF-8?q?=E5=AE=9A=E7=BE=A9=E3=81=AE=E8=AA=AC=E6=98=8E=E3=81=AB=E7=94=A8?= =?UTF-8?q?=E3=81=84=E3=82=89=E3=82=8C=E3=81=A6=E3=81=84=E3=82=8B=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E3=81=AB=E3=83=AA=E3=83=B3=E3=82=AF=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/iterator_traits.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/reference/iterator/iterator_traits.md b/reference/iterator/iterator_traits.md index c5c314468b..393499fff6 100644 --- a/reference/iterator/iterator_traits.md +++ b/reference/iterator/iterator_traits.md @@ -119,6 +119,7 @@ namespace std { using reference = typename I::reference; using reference = iter_reference_t; ``` + * iter_reference_t[link /reference/iterator/iter_reference_t.md] - `iterator_category`は、上から順に次のいずれか - `I`が`cpp17-random-access-iterator`コンセプトを満たす場合、`random_access_iterator_tag` @@ -135,6 +136,7 @@ namespace std { using reference = void; using iterator_category = output_iterator_tag; ``` + * incrementable_traits[link /reference/iterator/incrementable_traits.md] - この時、`incrementable_traits::difference_type`が定義されない場合、`difference_type = void` @@ -195,7 +197,16 @@ concept cpp17-random-access-iterator = { i[n] } -> convertible_to>; }; ``` - +* copyable[link /reference/concepts/copyable.md] +* can-reference[link /reference/iterator/dereferenceable.md] +* incrementable_traits[link /reference/iterator/incrementable_traits.md] +* indirectly_readable_traits[link /reference/iterator/indirectly_readable_traits.md] +* iter_reference_t[link /reference/iterator/iter_reference_t.md] +* signed_integral[link /reference/concepts/signed_integral.md] +* constructible_from[link /reference/concepts/constructible_from.md] +* is_lvalue_reference_v[link /reference/type_traits/is_lvalue_reference.md] +* convertible_to[link /reference/concepts/convertible_to.md] +* totally_ordered[link /reference/concepts/totally_ordered.md] ## 例 ```cpp example From 46badd13c71e5da942317b3d1a14baf3ba843f0c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 16 Dec 2024 10:47:58 +0900 Subject: [PATCH 1304/3948] =?UTF-8?q?Markdown=E6=8B=A1=E5=BC=B5:=20?= =?UTF-8?q?=E3=80=8C=E7=AE=87=E6=9D=A1=E6=9B=B8=E3=81=8D=E3=81=AE=E5=89=8D?= =?UTF-8?q?=E3=81=AB=E7=A9=BA=E8=A1=8C=E3=81=8C=E5=BF=85=E8=A6=81=E3=80=8D?= =?UTF-8?q?=E3=80=8C=E3=82=B3=E3=83=BC=E3=83=89=E3=83=96=E3=83=AD=E3=83=83?= =?UTF-8?q?=E3=82=AF=E3=81=AE=E3=81=82=E3=81=A8=E3=81=AB=E7=A9=BA=E8=A1=8C?= =?UTF-8?q?=E3=81=8C=E5=BF=85=E8=A6=81=E3=80=8D=E3=81=AE=E5=88=B6=E9=99=90?= =?UTF-8?q?=E3=81=8C=E3=81=AA=E3=81=8F=E3=81=AA=E3=81=A3=E3=81=9F=E3=81=AE?= =?UTF-8?q?=E3=81=A7=E5=89=8A=E9=99=A4=20#1362?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start_editing/markdown_cpprefjp.md | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/start_editing/markdown_cpprefjp.md b/start_editing/markdown_cpprefjp.md index ea8d3cb62b..469aa5c78a 100644 --- a/start_editing/markdown_cpprefjp.md +++ b/start_editing/markdown_cpprefjp.md @@ -65,32 +65,6 @@ comment out text... ``` -### リストの前に空行が必要な制限 -``` -適当な文字列 -* リスト -* リスト2 -``` - -このような書き方をすると、cpprefjpでは以下の様な表示になります。 - -``` -適当な文字列 * リスト * リスト2 -``` - -通常の文字列に続いてリストを置く場合、空行を入れる必要があります。 - -``` -適当な文字列 - -* リスト -* リスト2 -``` - -### コードブロックのあとに空行が必要な制限 -後述する「プログラムの修飾に関する拡張」に関連して、コードブロックのあとに説明文章を書く際には空行をあけなければなりません。 - - ## Markdown記法の拡張 Markdownだけだと表現力が足りないため、cpprefjpでは構文を拡張しています。 From 8cf3afda9d84d4b11909769986c644ae3095976c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 16 Dec 2024 10:51:53 +0900 Subject: [PATCH 1305/3948] =?UTF-8?q?jthread::=E3=82=B3=E3=83=B3=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=83=A9=E3=82=AF=E3=82=BF=20:=20=E8=A1=A8=E7=A4=BA?= =?UTF-8?q?=E5=B4=A9=E3=82=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/cpprefjp/markdown_to_html/pull/8 --- reference/thread/jthread/op_constructor.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/reference/thread/jthread/op_constructor.md b/reference/thread/jthread/op_constructor.md index e56789e7a0..d6d6cee7ae 100644 --- a/reference/thread/jthread/op_constructor.md +++ b/reference/thread/jthread/op_constructor.md @@ -60,14 +60,11 @@ jthread(jthread&&) noexcept; // (4) C++20 * std::forward[link /reference/utility/forward.md] - この呼び出しでの戻り値は無視される。この関数呼び出しが例外を送出する場合、呼び出し元スレッドで[`std::terminate`](/reference/exception/terminate.md)が呼び出される -- (3) : ## 同期 - (2) : コンストラクタ呼び出しの完了は、`f`のコピーの呼び出し開始と同期する - - -新しいスレッドを生成し、[`INVOKE`](/reference/concepts/Invoke.md)`(DECAY_COPY(`[`std::forward`](/reference/utility/forward.md)`(f)), DECAY_COPY(`[`std::forward`](/reference/utility/forward.md)`(args))...)`を実行する。ただし`DECAY_COPY`は同コンストラクタを呼び出したスレッド上にて評価される。また`f`のコピーの戻り値は無視される。 + 新しいスレッドを生成し、[`INVOKE`](/reference/concepts/Invoke.md)`(DECAY_COPY(`[`std::forward`](/reference/utility/forward.md)`(f)), DECAY_COPY(`[`std::forward`](/reference/utility/forward.md)`(args))...)`を実行する。ただし`DECAY_COPY`は同コンストラクタを呼び出したスレッド上にて評価される。また`f`のコピーの戻り値は無視される。 - `DECAY_COPY(x)`は `template typename std::decay::type decay_copy(T&& v) { return` [`std::forward`](/reference/utility/forward.md)`(v); }` と定義される。おおよそ、`x`が配列型なら先頭要素へのポインタ、`x`が関数型ならその関数ポインタ、`x`がコピーコンストラクト可能な型なら`x`からコピーされたオブジェクト、`x`がムーブコンストラクト可能な型なら`x`からムーブされたオブジェクトとなる。 From 073c4bc6ac4734a56d512f81872f87fa12538db3 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 16 Dec 2024 10:59:12 +0900 Subject: [PATCH 1306/3948] =?UTF-8?q?jthread:=20=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=89=E4=BF=AE=E9=A3=BE=E3=83=9F=E3=82=B9=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/thread/jthread.md | 2 +- reference/thread/jthread/op_constructor.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/thread/jthread.md b/reference/thread/jthread.md index 9ba75dc41e..bd9afa0050 100644 --- a/reference/thread/jthread.md +++ b/reference/thread/jthread.md @@ -114,7 +114,7 @@ int main() ``` * std::uint64_t[link /reference/cstdint/uint64_t.md] * std::stop_token[link /reference/stop_token/stop_token.md] -* token.stop_requested()[link /reference/stop_token/stop_token/stop_requested.md] +* stoken.stop_requested()[link /reference/stop_token/stop_token/stop_requested.md] * std::this_thread::sleep_for[link /reference/thread/this_thread/sleep_for.md] * t1.request_stop()[link jthread/request_stop.md] diff --git a/reference/thread/jthread/op_constructor.md b/reference/thread/jthread/op_constructor.md index d6d6cee7ae..f8f6b19ef1 100644 --- a/reference/thread/jthread/op_constructor.md +++ b/reference/thread/jthread/op_constructor.md @@ -145,7 +145,7 @@ int main() ``` * std::uint64_t[link /reference/cstdint/uint64_t.md] * std::stop_token[link /reference/stop_token/stop_token.md] -* token.stop_requested()[link /reference/stop_token/stop_token/stop_requested.md] +* stoken.stop_requested()[link /reference/stop_token/stop_token/stop_requested.md] * std::this_thread::sleep_for[link /reference/thread/this_thread/sleep_for.md] * t1.request_stop()[link request_stop.md] From b956b7708095b80da1c364a4d68cc66d65bde231 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 16 Dec 2024 16:36:37 +0900 Subject: [PATCH 1307/3948] =?UTF-8?q?C++11=20=E5=B1=9E=E6=80=A7=E6=A7=8B?= =?UTF-8?q?=E6=96=87=20:=20indeterminate=E5=B1=9E=E6=80=A7=E3=81=AE?= =?UTF-8?q?=E8=A7=A3=E8=AA=AC=E3=83=9A=E3=83=BC=E3=82=B8=E3=81=AB=E3=83=AA?= =?UTF-8?q?=E3=83=B3=E3=82=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp11/attributes.md | 1 + lang/cpp26/erroneous_behavior_for_uninitialized_reads.md | 3 +++ 2 files changed, 4 insertions(+) diff --git a/lang/cpp11/attributes.md b/lang/cpp11/attributes.md index 1a15b8ba07..b48a937941 100644 --- a/lang/cpp11/attributes.md +++ b/lang/cpp11/attributes.md @@ -170,6 +170,7 @@ C++11で採用されたもの以外で検討された以下の機能は、属性 - [C++20 属性の名前空間を予約](/lang/cpp20/reserving_attribute_namespaces_for_future_use.md) - [C++23 ラムダ式に対する属性](/lang/cpp23/attributes_on_lambda_expressions.md) - [C++26 構造化束縛への属性を許可](/lang/cpp26/attributes_for_structured_bindings.md) +- [C++26 未初期化変数の読み取りをエラー性動作とする (`[[indeterminate]]`属性)](/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md) ## 参照 diff --git a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md index 79b80c7ac9..4f118a77dd 100644 --- a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md +++ b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md @@ -137,5 +137,8 @@ int main() { | 契約違反 | 契約に関する現在の策定作業では、契約違反時になにが起こるべきかという問題に直面している。エラー性動作という概念は有用な回答を与えてくれる可能性がある | +## 関連項目 +- [C++11 属性構文](/lang/cpp11/attributes.md) + ## 参照 - [P2795R5 Erroneous behaviour for uninitialized reads](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2795r5.html) From 86f0c41afc9742a6aca155df7cdcce3f5ddb08ff Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 16 Dec 2024 17:44:52 +0900 Subject: [PATCH 1308/3948] =?UTF-8?q?chrono/{tai,gps}=5Fclock:=20=E3=82=AF?= =?UTF-8?q?=E3=83=A9=E3=82=B9=E8=AA=AC=E6=98=8E=E3=82=92=E5=A2=97=E8=A3=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 概要: TAI時計,GPS時計ではうるう秒補正が行われないことを明記 - うるう秒の扱い: "負のうるう秒"を考慮した表記に調整 - 例示: うるう秒の影響を追加 - gps_clockのうるう秒説明において"1970年"の意味を補足 --- reference/chrono/gps_clock.md | 42 ++++++++++++++++++++++++++++++---- reference/chrono/tai_clock.md | 43 ++++++++++++++++++++++++++++++----- 2 files changed, 74 insertions(+), 11 deletions(-) diff --git a/reference/chrono/gps_clock.md b/reference/chrono/gps_clock.md index 3cdab5a04c..5a1dac30e2 100644 --- a/reference/chrono/gps_clock.md +++ b/reference/chrono/gps_clock.md @@ -13,19 +13,23 @@ namespace std::chrono { ## 概要 `gps_clock`は、GPS時間 (GPST) を表現するためのクロックである。この時刻系は、カーナビや携帯端末などで使用される。 +GPS時間ではうるう秒 (leap second) 補正が行われないため、2017年1月1日以降~2024年現在ではUTC (世界協定時) よりも18秒進んだ時間をとる。 +つまり 2024-01-01 00:00:18 GPS と 2024-01-01 00:00:00 UTC は等価である。 + このクラスの[`now()`](gps_clock/now.md)静的メンバ関数は、標準では`noexcept(false)`である。実装が`noexcept(true)`である保証をしない限り、このクラスはTrivialClock要件を満たさない。 ### エポック クロックごとの初期時間 (内部的にカウンタがあれば値ゼロ) をエポックと呼ぶ。 -`gps_clock`のエポックは、1980年1月6日 (この年の最初の日曜日) 0時0分0秒である。 +`gps_clock`のエポックは、1980年1月6日 (同年の最初の日曜日) 0時0分0秒である。 ### うるう秒の扱い -このクロックではうるう秒は挿入されず、うるう秒の数だけ時間が進む。そのため、UTCにうるう秒が挿入されるたびに、UTCはGPSよりも1秒ずつずれていく。 +`gps_clock`ではうるう秒は考慮されず、UTCに対してうるう秒分だけ時間がシフトする。そのため、UTCに正のうるう秒が挿入されるたびに、UTC時間はGPS時間よりも1秒ずつ遅れていく。 -GPS時間とTAI時間は19秒ずれていて、このずれは時間が経過しても変わらない。GPS時間のエポックが[`1958y`](year/op_y.md)`/`[`January`](month_constants.md)`/1`、TAI時間のエポックが[`1980y`](year/op_y.md)`/`[`January`](month_constants.md)`/`[`Sunday`](weekday_constants.md)`[1]`であるが、1958年から1970年までのオフセットが10秒と、1970年から1980年までに挿入されたうるう秒が9秒あるためだ。 +同じくうるう秒を考慮しない[TAI時間](tai_clock.md)に対してGPS時間は19秒遅れており、このずれは時間が経過しても変わらない。これはTAI時間のエポックが[`1958y`](year/op_y.md)`/`[`January`](month_constants.md)`/1`、GPS時間のエポックが[`1980y`](year/op_y.md)`/`[`January`](month_constants.md)`/`[`Sunday`](weekday_constants.md)`[1]`であるが、1958年から1970年までのオフセットが10秒と、1970年から1980年までに挿入されたうるう秒が9秒あるためだ。 +(1970年はTAI時間が定められた年である。) ## メンバ関数 @@ -56,6 +60,7 @@ GPS時間とTAI時間は19秒ずれていて、このずれは時間が経過し ## 例 +### 例1: 現在GPS時間 ```cpp example #include #include @@ -68,20 +73,47 @@ int main() std::cout << tp << std::endl; } ``` +* chrono::gps_clock[color ff0000] * now()[link gps_clock/now.md] -### 出力例 +#### 出力例 ``` 2019-10-24 11:15:37.493236171 ``` +### 例2: うるう秒の影響 +```cpp example +#include +#include + +namespace chrono = std::chrono; +using namespace std::literals::chrono_literals; + +int main() { + auto utc_tp = chrono::utc_clock::from_sys(chrono::sys_days{2024y/1/1}); + auto gps_tp = chrono::gps_clock::from_utc(utc_tp); + std::cout << utc_tp << " UTC" << std::endl; + std::cout << gps_tp << " GPS" << std::endl; +} +``` +* chrono::gps_clock[color ff0000] +* from_sys[link utc_clock/from_sys.md] +* from_utc[link gps_clock/from_utc.md] + +#### 出力 +``` +2024-01-01 00:00:00 UTC +2024-01-01 00:00:18 GPS +``` + + ## バージョン ### 言語 - C++20 ### 処理系 - [Clang](/implementation.md#clang): 9.0 [mark noimpl] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 13.1 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 13.2 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/tai_clock.md b/reference/chrono/tai_clock.md index 5d281f66ea..30d8cfa41f 100644 --- a/reference/chrono/tai_clock.md +++ b/reference/chrono/tai_clock.md @@ -13,7 +13,8 @@ namespace std::chrono { ## 概要 `tai_clock`は、TAI時間 (国際原子時、International Atomic Time) を表現するためのクロックである。 -このクロックは、UTCよりも10秒進んでいる。そのため、1958-01-01 00:00:00 TAIと1957-12-31 23:59:50 UTCは等価である。 +TAIではうるう秒 (leap second) 補正が行われないため、2017年1月1日以降~2024年現在ではUTC (世界協定時) よりも37秒進んだ時間をとる。 +つまり 2024-01-01 00:00:37 TAI と 2024-01-01 00:00:00 UTC は等価である。 このクラスの[`now()`](tai_clock/now.md)静的メンバ関数は、標準では`noexcept(false)`である。実装が`noexcept(true)`である保証をしない限り、このクラスはTrivialClock要件を満たさない。 @@ -23,12 +24,13 @@ namespace std::chrono { クロックごとの初期時間 (内部的にカウンタがあれば値ゼロ) をエポックと呼ぶ。 `tai_clock`のエポックは、1958年1月1日0時0分0秒である。 +これはUTC時間1957年12月31日23時59分50秒に対応する。 ### うるう秒の扱い -このクロックではうるう秒は挿入されず、うるう秒の数だけ時間が進む。そのため、UTCにうるう秒が挿入されるたびに、UTCはTAIよりも1秒ずつずれていく。 +`tai_clock`ではうるう秒は考慮されず、UTCに対してうるう秒数分だけ時間がシフトする。そのため、UTCに正のうるう秒が挿入されるたびに、UTC時間はTAI時間よりも1秒ずつ遅れていく。 -例として、2000年01月01日までに正のうるう秒が22回、負のうるう秒が0回挿入されたため、TAIがUTCより10秒進んでいることも含めて、2000-01-01 00:00:00 UTCと2000-01-01 00:00:32 TAIは等価となる。 +例として、`tai_clock`エポック日 (1958年1月1日) 時点ではUTCには正のうるう秒が10回挿入されており、さらに2000年01月01日までに正のうるう秒が22回、負のうるう秒が0回挿入されたため、2000-01-01 00:00:00 UTCと2000-01-01 00:00:32 TAIは等価となる。 ## メンバ関数 @@ -59,6 +61,7 @@ namespace std::chrono { ## 例 +### 例1: 現在TAI時間 ```cpp example #include #include @@ -71,23 +74,51 @@ int main() std::cout << tp << std::endl; } ``` +* chrono::tai_clock[color ff0000] * now()[link tai_clock/now.md] -### 出力例 +#### 出力例 ``` -2019-10-24 11:15:47 TAI +2019-10-24 11:15:47.519957239 ``` +### 例2: うるう秒の影響 +```cpp example +#include +#include + +namespace chrono = std::chrono; +using namespace std::literals::chrono_literals; + +int main() { + auto utc_tp = chrono::utc_clock::from_sys(chrono::sys_days{2024y/1/1}); + auto tai_tp = chrono::tai_clock::from_utc(utc_tp); + std::cout << utc_tp << " UTC" << std::endl; + std::cout << tai_tp << " TAI" << std::endl; +} +``` +* chrono::tai_clock[color ff0000] +* from_sys[link utc_clock/from_sys.md] +* from_utc[link tai_clock/from_utc.md] + +#### 出力 +``` +2024-01-01 00:00:00 UTC +2024-01-01 00:00:37 TAI +``` + + ## バージョン ### 言語 - C++20 ### 処理系 - [Clang](/implementation.md#clang): 9.0 [mark noimpl] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 13.2 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] ## 参照 - [国際原子時 - Wikipedia](https://ja.wikipedia.org/wiki/国際原子時) +- [国立天文台 水沢, うるう秒について](https://www.miz.nao.ac.jp/vlbi/leapsec.html) - [LWG Issue 3359. `` leap second support should allow for negative leap seconds](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2117r0.html#3359) From dbd4b9d90511bfe6df1bf0cdda1798338fc044d1 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Wed, 18 Dec 2024 13:33:04 +0900 Subject: [PATCH 1309/3948] new sample code for istringstream --- reference/sstream/basic_istringstream.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/reference/sstream/basic_istringstream.md b/reference/sstream/basic_istringstream.md index 82c8acc692..4b8565091e 100644 --- a/reference/sstream/basic_istringstream.md +++ b/reference/sstream/basic_istringstream.md @@ -53,11 +53,24 @@ namespace std { | `allocator_type` | テンプレート仮引数`Allocator` | | ## 例 -```cpp +```cpp example +#include +#include +int main() { + std::string text = "ABCDEFG"; + std::istringstream stream(text); + char c; + while (stream >> c) { + std::cout< Date: Wed, 18 Dec 2024 16:39:06 +0900 Subject: [PATCH 1310/3948] added a sample implementation for gcd and lcm function --- reference/numeric/gcd.md | 20 ++++++++++++++++++++ reference/numeric/lcm.md | 23 +++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/reference/numeric/gcd.md b/reference/numeric/gcd.md index 1e2049b6db..5bf7c51aad 100644 --- a/reference/numeric/gcd.md +++ b/reference/numeric/gcd.md @@ -129,6 +129,7 @@ int main() { ``` ``` + ## バージョン ### 言語 - C++17 @@ -167,3 +168,22 @@ $$ \mathrm{gcd}(m, n) = \begin{cases} |m| & \text{if } n = 0 \\ \mathrm{gcd}(n, m \bmod n) & \text{otherwise} \end{cases} $$ + + +```cpp +template +constexpr std::common_type_t gcd(M m, N n) { + if (m == 0 && n == 0) { + return 0; + } + while (m != 0 && n != 0) { + if (m > n) { + m %= n; + } + else { + n %= m; + } + } + return m < n ? n : m; +} +``` diff --git a/reference/numeric/lcm.md b/reference/numeric/lcm.md index fb9a9f5c13..cdea968769 100644 --- a/reference/numeric/lcm.md +++ b/reference/numeric/lcm.md @@ -171,3 +171,26 @@ int main() { ## 実装例 $$ \mathrm{lcm}(m, n) = \frac{|mn|}{\mathrm{gcd}(m, n)} $$ + +```cpp +template +constexpr std::common_type_t gcd(M m, N n) { + if (m == 0 && n == 0) { + return 0; + } + while (m != 0 && n != 0) { + if (m > n) { + m %= n; + } + else { + n %= m; + } + } + return m < n ? n : m; +} + +template +constexpr std::common_type_t lcm(M m, N n) { + return m / gcd(m, n) * n; +} +``` \ No newline at end of file From 5cc3b9e41da3334156c0090b216b916c8804af7c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 18 Dec 2024 22:28:05 +0900 Subject: [PATCH 1311/3948] =?UTF-8?q?gcd,=20lcm=E3=81=AE=E5=AE=9F=E8=A3=85?= =?UTF-8?q?=E4=BE=8B=20:=20=E4=BB=95=E6=A7=98=E3=81=AB=E5=90=88=E3=82=8F?= =?UTF-8?q?=E3=81=9B=E3=81=A6=E7=B5=B6=E5=AF=BE=E5=80=A4=E3=82=92=E3=81=A8?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 1 + reference/numeric/gcd.md | 15 ++++++++++----- reference/numeric/lcm.md | 19 ++++++++++++------- 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 71f8fdafad..ef979f7411 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -78,6 +78,7 @@ * [link /reference/concepts.md] * common_reference_with[link /reference/concepts/common_reference_with.md] * common_type_t[link /reference/concepts/common_type.md] + * std::common_type_t[link /reference/concepts/common_type.md] * common_with[link /reference/concepts/common_with.md] * copy_constructible[link /reference/concepts/copy_constructible.md] * default_initializable[link /reference/concepts/default_initializable.md] diff --git a/reference/numeric/gcd.md b/reference/numeric/gcd.md index 5bf7c51aad..3a57542323 100644 --- a/reference/numeric/gcd.md +++ b/reference/numeric/gcd.md @@ -176,14 +176,19 @@ constexpr std::common_type_t gcd(M m, N n) { if (m == 0 && n == 0) { return 0; } - while (m != 0 && n != 0) { - if (m > n) { - m %= n; + + auto mm = abs(m); + auto nn = abs(n); + while (mm != 0 && nn != 0) { + if (mm > nn) { + mm %= nn; } else { - n %= m; + nn %= mm; } } - return m < n ? n : m; + return mm < nn ? nn : mm; } ``` +* abs[link /reference/cstdlib/abs.md] + diff --git a/reference/numeric/lcm.md b/reference/numeric/lcm.md index cdea968769..fbab46a02b 100644 --- a/reference/numeric/lcm.md +++ b/reference/numeric/lcm.md @@ -178,19 +178,24 @@ constexpr std::common_type_t gcd(M m, N n) { if (m == 0 && n == 0) { return 0; } - while (m != 0 && n != 0) { - if (m > n) { - m %= n; + + auto mm = abs(m); + auto nn = abs(n); + while (mm != 0 && nn != 0) { + if (mm > nn) { + mm %= nn; } else { - n %= m; + nn %= mm; } } - return m < n ? n : m; + return mm < nn ? nn : mm; } template constexpr std::common_type_t lcm(M m, N n) { - return m / gcd(m, n) * n; + return abs(m) / gcd(m, n) * abs(n); } -``` \ No newline at end of file +``` +* abs[link /reference/cstdlib/abs.md] + From 8918e77b6324232bd252419410b618eee6e4580a Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 18 Dec 2024 22:37:37 +0900 Subject: [PATCH 1312/3948] =?UTF-8?q?common=5Ftype=5Ft=E3=81=B8=E3=81=AE?= =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=83=9F=E3=82=B9=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index ef979f7411..02b10942f5 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -77,8 +77,6 @@ * [link /reference/complex.md] * [link /reference/concepts.md] * common_reference_with[link /reference/concepts/common_reference_with.md] - * common_type_t[link /reference/concepts/common_type.md] - * std::common_type_t[link /reference/concepts/common_type.md] * common_with[link /reference/concepts/common_with.md] * copy_constructible[link /reference/concepts/copy_constructible.md] * default_initializable[link /reference/concepts/default_initializable.md] @@ -271,6 +269,8 @@ * std::tuple[link /reference/tuple/tuple.md] * std::tie[link /reference/tuple/tie.md] * [link /reference/type_traits.md] + * common_type_t[link /reference/type_traits/common_type.md] + * std::common_type_t[link /reference/type_traits/common_type.md] * common_reference_t[link /reference/type_traits/common_reference.md] * invoke_result_t[link /reference/type_traits/invoke_result.md] * is_class_v[link /reference/type_traits/is_class.md] From af91af864b691faaf9e5fde322accc0522e94f78 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 19 Dec 2024 10:55:41 +0900 Subject: [PATCH 1313/3948] =?UTF-8?q?C++26=20Working=20Draft=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=20#1371?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- international-standard.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/international-standard.md b/international-standard.md index 0740eda42e..f478d38273 100644 --- a/international-standard.md +++ b/international-standard.md @@ -12,7 +12,7 @@ C++ の標準規格は、他にも各国の規格化団体によって国際標 | 通称†1 | 名称 | 参照する規格案†2 | 規格案・原案 | `__cplusplus` | |:--|:--|:--|:--|:--| -| [C++26](lang/cpp26.md) (C++2c) | ISO/IEC 14882:2026 (予定) | N4993([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/n4993.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/)) | N4993 N4986 N4981 N4971 N4964 N4958 | -- | +| [C++26](lang/cpp26.md) (C++2c) | ISO/IEC 14882:2026 (予定) | N5001([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/n5001.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/)) | N5001 N4993 N4986 N4981 N4971 N4964 N4958 | -- | | [C++23](lang/cpp23.md) (C++2b) | ISO/IEC 14882:2024 | N4950([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4950.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4950/)) | N4950 N4944 N4928 N4917 N4910 N4901 N4892 N4885 N4878
N4868 N4861 | `202302L` | | [C++20](lang/cpp20.md) (C++2a) | ISO/IEC 14882:2020 | N4861†3([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/n4861.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4861/)) | N4860 N4849 N4842 N4835 N4830
N4820 N4810 N4800 N4791 N4788†4
N4778 N4762 N4750 N4741 N4727
N4713 N4700 N4687 | `202002L` | | [C++17](lang/cpp17.md) (C++1z) | ISO/IEC 14882:2017 | N4659([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4659.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4659/)) | N4660 N4659 N4640 N4618 N4606
N4594 N4582 N4567 N4527 N4431
N4296 | `201703L` | From 44635eb4eb28b06af83120cdf74c231cf0038391 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 19 Dec 2024 13:14:06 +0900 Subject: [PATCH 1314/3948] =?UTF-8?q?=E7=94=A8=E8=AA=9E:=20CV=E4=BF=AE?= =?UTF-8?q?=E9=A3=BE=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_DEFINED_WORDS.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/GLOBAL_DEFINED_WORDS.json b/GLOBAL_DEFINED_WORDS.json index 0ad0e16ce8..b4b6ec7094 100644 --- a/GLOBAL_DEFINED_WORDS.json +++ b/GLOBAL_DEFINED_WORDS.json @@ -130,5 +130,9 @@ "述語": { "yomi": "じゅつご", "desc": "boolを返す関数・関数オブジェクト。predicate" + }, + "CV修飾": { + "yomi": "しーぶいしゅうしょく", + "desc": "型をconstおよび・もしくはvolatileで修飾すること" } } From 17ed8726a3ecffc977307ce7b2b51c189dc50f8e Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 19 Dec 2024 13:49:01 +0900 Subject: [PATCH 1315/3948] =?UTF-8?q?C++26:=202024-12=20mailing=E3=81=AE?= =?UTF-8?q?=E5=A4=89=E6=9B=B4=E3=82=92=E8=A8=98=E8=BC=89=20#1371?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 5 ++++ lang/cpp26.md | 60 ++++++++++++++++++++++++++++++++++++++-- reference.md | 3 ++ 3 files changed, 66 insertions(+), 2 deletions(-) diff --git a/implementation-status.md b/implementation-status.md index c3d988d5cb..506dd0382a 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -312,6 +312,11 @@ | P3144R2: [不完全型へのポインタに対する`delete`を不適格とする](/lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md.nolink) | 未定義動作を引き起こす操作をコンパイルエラーとする | 15 | 19 | | | | P2963R3: [制約式内での畳み込み式の順序付け](/lang/cpp26/ordering_of_constraints_involving_fold_expressions.md.nolink) | 畳み込み式では全体ではなく個別の制約を原子制約式として扱う | | 19 | | | | P0963R3: [条件式での構造化束縛の使用を許可](/lang/cpp26/structured_binding_declaration_as_a_condition.md) | 式全体を`bool`値に変換できる場合に条件式で構造化束縛を使用できることとする | 15 | | | | +| P2686R5: [`constexpr`構造化束縛の許可と、定数式への参照を定数式とする](/lang/cpp26/constexpr_structured_bindings_and_references_to_constexpr_variables.md.nolink) | 定数式に対する構造化束縛を許可し、関連する定数式への参照が定数式になるようにする | | | | | +| P3068R6: [定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md.nolink) | 定数式の文脈での例外の送出と捕捉を許可 | | | | | +| P2865R6: [非推奨だった配列の比較を削除](/lang/cpp26/remove_deprecated_array_comparisons.md.nolink) | C++20で非推奨となっていた配列比較を削除 | 15 | 20 | | | +| P1061R10: [構造化束縛でパックを導入できるようにする](/lang/cpp26/structured_bindings_can_introduce_a_pack.md.nolink) | タプルを分解する際に複数の変数をパックとして宣言できるようにする。`auto [a, ...xs] = f();` | | | | | +| P3176R0: [先行するカンマのない省略記号を非推奨化](/lang/cpp26/the_oxford_variadic_comma.md.nolink) | `void f(int, ...);`はOK。`void f(int...);`は非推奨 | 15 | 20 | | | 各処理系のC++26実装状況ページ: diff --git a/lang/cpp26.md b/lang/cpp26.md index 3bce2dee54..8fa3d18dbc 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -18,6 +18,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | [返却された左辺値から暗黙変換された一時オブジェクトが参照に束縛されることを禁止する](/lang/cpp26/disallow_binding_a_returned_glvalue_to_a_temporary.md.nolink) | 寿命切れの変数によって引き起こされるバグを防止する | | [要素数不明の配列を集成体初期化する規則を明確化](/lang/cpp26/clarifying_rules_for_brace_elision_in_aggregate_initialization.md.nolink) | 配列要素の集成体初期化で`{}`が省略された場合の矛盾していた規定を修正 | | [未初期化変数の読み取りをエラー性動作とする](/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md) | 初期化されていない自動変数の読み取りの安全性を規定する | +| [構造化束縛でパックを導入できるようにする](/lang/cpp26/structured_bindings_can_introduce_a_pack.md.nolink) | タプルを分解する際に複数の変数をパックとして宣言できるようにする。`auto [a, ...xs] = f();` | ### 文字列 @@ -68,6 +69,8 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | [定数式での`void*`からポインタ型へのキャストを許可](/lang/cpp26/constexpr_cast_from_voidptr.md.nolink) | 型消去のために`void*`からポインタ型へのキャストを許可する | | [`static_assert`の診断メッセージにユーザーが生成した文字列の指定を許可](/lang/cpp26/user-generated_static_assert_messages.md) | `constexpr`な`S.size()`と`S.data()`メンバ関数をもつオブジェクトをコンパイル時文字列として指定できるようにする | | [`constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md.nolink) | 定数式の文脈での配置`new`を許可 | +| [`constexpr`構造化束縛の許可と、定数式への参照を定数式とする](/lang/cpp26/constexpr_structured_bindings_and_references_to_constexpr_variables.md.nolink) | 定数式に対する構造化束縛を許可し、関連する定数式への参照が定数式になるようにする | +| [定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md.nolink) | 定数式の文脈での例外の送出と捕捉を許可 | ### ソースコード @@ -84,20 +87,35 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | [モジュール宣言でのモジュール名のマクロ展開を禁止する](/lang/cpp26/module_declarations_shouldnt_be_macros.md.nolink) | `export module MACRO_NAME;`を禁止 | +### 機能の非推奨化 + +| 言語機能 | 説明 | +|----------|------| +| [非推奨だった配列の比較を削除](/lang/cpp26/remove_deprecated_array_comparisons.md.nolink) | C++20で非推奨となっていた配列比較を削除 | +| [先行するカンマのない省略記号を非推奨化](/lang/cpp26/the_oxford_variadic_comma.md.nolink) | `void f(int, ...);`はOK。`void f(int...);`は非推奨 | + + ## ライブラリ更新の概要 ### 新ライブラリ - 文字列エンコーディングを識別するライブラリとして、[``](/reference/text_encoding.md.nolink)を追加 - 並行処理におけるデータの参照・更新を行うRCU (Read Copy Update) のライブラリとして、[``](/reference/rcu.md.nolink)を追加 - 並行処理において参照中のデータが更新されないよう保護するハザードポインタのライブラリとして、[``](/reference/hazard_pointer.md.nolink)を追加 +- データ並列ライブラリとして、[``](/reference/simd.md.nolink)を追加 - デバッグサポートのライブラリとして[``](/reference/debugging.md)を追加 - 線形代数ライブラリとして[``](/reference/linalg.md)を追加 - コンパイル時に容量を固定する可変長配列クラスのライブラリとして[``](/reference/inplace_vector.md.nolink)を追加 +- C23の互換ライブラリとして、ビット操作ライブラリ[``](/reference/stdbit.h.md.nolink)と、検査付き整数演算ライブラリ[``](/reference/stdckdint.h.md.nolink)を追加。``形式のライブラリは追加されない + + +### 全体 +- 標準ライブラリに付加された、戻り値を無視した際に警告を出力する[`[[nodiscard]]`属性](/lang/cpp17/nodiscard.md)を削除 ### コンテナ - [`std::mdspan`](/reference/mdspan/mdspan.md)から部分ビューを取り出す[`std::submdspan()`](/reference/mdspan/submdspan.md)を追加 - [`std::mdspan`](/reference/mdspan/mdspan.md)に対する[`std::dextents`](/reference/mdspan/extents.md)指定の冗長さを解決する[`std::dims`](/reference/mdspan/extents.md)を追加 - [`std::mdspan`](/reference/mdspan/mdspan.md)のレイアウトとして、[`std::layout_left_padded`](/reference/mdspan/layout_left_padded.md)と[`std::layout_right_padded`](/reference/mdspan/layout_right_padded.md)を追加 +- [``](/reference/mdspan.md)に、ポインタのアライメントをしながらアクセスする[`std::aligned_accessor`](/reference/mdspan/aligned_accessor.md.nolink)を追加 - [`std::span`](/reference/span/span.md)に、以下を追加 - [`std::initializer_list`](/reference/initializer_list/initializer_list.md)をとるコンストラクタ - インデックスアクセスのための[`at()`](/reference/span/span/at.md)メンバ関数 @@ -124,13 +142,25 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [`bucket()`](/reference/unordered_set/unordered_multiset/bucket.md) - [`std::span`](/reference/span/span.md)と[`std::mdspan`](/reference/mdspan/mdspan.md)の推論補助を改善 - [`std::views::concat`](/reference/ranges/concat_view.md)を追加 +- [`std::views::cache_latest`](/reference/ranges/cache_latest.md.nolink)を追加 ### アルゴリズム -- 以下のアルゴリズムを`constexpr`に対応 +- [``](/reference/algorithm.md)の以下のアルゴリズムを`constexpr`に対応 - [`std::stable_sort()`](/reference/algorithm/stable_sort.md) / [`std::ranges::stable_sort()`](/reference/algorithm/ranges_stable_sort.md) - [`std::stable_partition()`](/reference/algorithm/stable_partition.md) / [`std::ranges::stable_partition()`](/reference/algorithm/ranges_stable_partition.md) - [`std::inplace_merge()`](/reference/algorithm/inplace_merge.md) / [`std::ranges::inplace_merge()`](/reference/algorithm/ranges_inplace_merge.md) +- [``](/reference/memory.md)の以下のアルゴリズムを`constexpr`に対応 + - [`std::uninitialized_default_construct()`](/reference/memory/uninitialized_default_construct.md) / [`std::ranges::uninitialized_default_construct()`](/reference/memory/ranges_uninitialized_default_construct.md) + - [`std::uninitialized_default_construct_n()`](/reference/memory/uninitialized_default_construct_n.md) / [`std::ranges::uninitialized_default_construct_n()`](/reference/memory/ranges_uninitialized_default_construct_n.md) + - [`std::uninitialized_value_construct()`](/reference/memory/uninitialized_value_construct.md) / [`std::ranges::uninitialized_value_construct()`](/reference/memory/ranges_uninitialized_value_construct.md) + - [`std::uninitialized_value_construct_n()`](/reference/memory/uninitialized_value_construct_n.md) / [`std::ranges::uninitialized_value_construct_n()`](/reference/memory/ranges_uninitialized_value_construct_n.md) + - [`std::uninitialized_copy()`](/reference/memory/uninitialized_copy.md) / [`std::ranges::uninitialized_copy()`](/reference/memory/ranges_uninitialized_copy.md) + - [`std::uninitialized_copy_n()`](/reference/memory/uninitialized_copy_n.md) / [`std::ranges::uninitialized_copy_n()`](/reference/memory/ranges_uninitialized_copy_n.md) + - [`std::uninitialized_move()`](/reference/memory/uninitialized_move.md) / [`std::ranges::uninitialized_move()`](/reference/memory/ranges_uninitialized_move.md) + - [`std::uninitialized_move_n()`](/reference/memory/uninitialized_move_n.md) / [`std::ranges::uninitialized_move_n()`](/reference/memory/ranges_uninitialized_move_n.md) + - [`std::uninitialized_fill()`](/reference/memory/uninitialized_fill.md) / [`std::ranges::uninitialized_fill()`](/reference/memory/ranges_uninitialized_fill.md) + - [`std::uninitialized_fill_n()`](/reference/memory/uninitialized_fill_n.md) / [`std::ranges::uninitialized_fill_n()`](/reference/memory/ranges_uninitialized_fill_n.md) - Rangeアルゴリズムが完全型を要求しないようにするため、[`std::projected`](/reference/iterator/projected.md)の制約を緩和 - 以下のアルゴリズムに、値を波カッコ初期化で渡せるよう制約を追加 - `std::erase()` @@ -192,8 +222,12 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [`std::print()`](/reference/print/print.md)と[`std::println()`](/reference/print/println.md)をより高速にできる最適化が可能か判定する[`std::enable_nonlocking_formatter_optimization`](/reference/format/enable_nonlocking_formatter_optimization.md)を追加 -### 並行・並列処理 +### 並行・並列・非同期処理 +- [``](/reference/execution.md)に汎用的な非同期実行を管理するフレームワークを追加 - [`std::atomic`](/reference/atomic/atomic.md)オブジェクトに対する2つの値の最大値・最小値を取得する関数として、メンバ関数[`fetch_max()`](/reference/atomic/atomic/fetch_max.md.nolink)と[`fetch_min()`](/reference/atomic/atomic/fetch_min.md.nolink)、非メンバ関数として[`std::atomic_fetch_max`](/reference/atomic/atomic_fetch_max.md.nolink)、[`std::atomic_fetch_max_explicit`](/reference/atomic/atomic_fetch_max_explicit.md.nolink)、[`std::atomic_fetch_min`](/reference/atomic/atomic_fetch_min.md.nolink)、[`std::atomic_fetch_min_explicit`](/reference/atomic/atomic_fetch_min_explicit.md.nolink)を追加 +- [`std::atomic_ref`](/reference/atomic/atomic_ref.md)クラスに、参照するオブジェクトのアドレスを取得する[`address()`](/reference/atomic/atomic_ref/address.md.nolink)メンバ関数を追加 +- [`std::atomic`](/reference/atomic/atomic.md)クラスと[`std::atomic_ref`](/reference/atomic/atomic_ref.md)クラスのテンプレートパラメータとして、CV修飾された型を受け取れるようにした (内部でCV修飾が外される) +- [``](/reference/atomic.md)ライブラリのアトミック操作を`constexpr`対応 ### スマートポインタ @@ -289,6 +323,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [`std::complex`](/reference/complex/complex.md)を構造化束縛や、将来のパターンマッチで使用できるようタプルインタフェースの特殊化を追加 - [``](/reference/random.md)の範囲`[0, 1)`の乱数を生成する[`std::generate_canonical()`](/reference/random/generate_canonical.md)を、望ましい統計的性質を保証するようアルゴリズムと制約を変更 - [``](/reference/random.md)に、乱数列を生成する[`std::ranges::generate_random()`](/reference/random/generate_random.md)関数を追加 +- [``](/reference/random.md)に、乱数生成器は並列シミュレーションに効果的なカウンターベースのPhilox乱数生成器として、[`std::philox_engine`](/reference/random/philox_engine.md.nolink)クラス、およびその別名である[`std::philox4x32`](/reference/random/philox4x32.md.nolink)と[`std::philox4x64`](/reference/random/philox4x64.md.nolink)を追加 ### ユーティリティ @@ -305,6 +340,23 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [`ronto`](/reference/ratio/si_prefix.md) (10−27) - [`quetta`](/reference/ratio/si_prefix.md) (1030) - [`quecto`](/reference/ratio/si_prefix.md) (10−30) +- 定数式での例外送出が許可されることにともない、以下を`constexpr`化 + - [``](/reference/exception.md)ヘッダの以下の機能 + - [`std::exception`](/reference/exception/exception.md)クラスの全メンバ関数 + - [`std::nested_exception`](/reference/exception/nested_exception.md)クラスの全面場関数 + - [`std::bad_exception`](/reference/exception/bad_exception.md)クラスの`what()`メンバ関数 + - [`std::uncaught_exceptions()`](/reference/exception/uncaught_exceptions.md)関数 + - [`std::current_exception()`](/reference/exception/current_exception.md)関数 + - [`std::rethrow_exception()`](/reference/exception/rethrow_exception.md)関数 + - [`std::make_exception_ptr()`](/reference/exception/make_exception_ptr.md)関数 + - [`std::throw_with_nested()`](/reference/exception/throw_with_nested.md)関数 + - [`std::rethrow_if_nested()`](/reference/exception/rethrow_if_nested.md)関数 + - [``](/reference/new.md)ヘッダの以下の機能 + - [`std::bad_alloc`](/reference/new/bad_alloc.md)クラスの`what()`メンバ関数 + - [`std::bad_array_new_length`](/reference/new/bad_array_new_length.md)クラスの`what()`メンバ関数 + - [``](/reference/typeinfo.md)ヘッダの以下の機能 + - [`std::bad_cast`](/reference/typeinfo/bad_cast.md)クラスの`what()`メンバ関数 + - [`std::bad_typeid`](/reference/typeinfo/bad_typeid.md)クラスの`what()`メンバ関数 ### デバッグ @@ -326,6 +378,10 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [`std::indirect_strict_weak_order`](/reference/iterator/indirect_strict_weak_order.md) +### 機能の非推奨化 +- [``](/reference/type_traits.md)の[`std::is_trivial`](/reference/type_traits/is_trivial.md)を非推奨化 + - これは[`std::is_trivially_copyable`](/reference/type_traits/is_trivially_copyable.md)と[`std::is_trivially_default_constructible`](/reference/type_traits/is_trivially_default_constructible.md)の2つが合わさったものであるが、それらは異なる状況で必要になるものであった + ### 非推奨の取り消し - [`std::polymorphic_allocator`](/reference/memory_resource/polymorphic_allocator.md)`::`[`destroy()`](/reference/memory_resource/polymorphic_allocator/destroy.md)の非推奨を取り消し diff --git a/reference.md b/reference.md index 880ad10aed..86d40cd973 100644 --- a/reference.md +++ b/reference.md @@ -210,6 +210,7 @@ | [``](/reference/future.md) | Future | C++11 | | [``](/reference/rcu.md.nolink) | データの参照・更新 | C++26 | | [``](/reference/hazard_pointer.md.nolink) | ハザードポインタ | C++26 | +| [``](/reference/simd.md.nolink) | データ並列 | C++26 | ## C言語互換ライブラリ @@ -231,6 +232,8 @@ | `` | シグナル | | | `` | アライメント操作のマクロ | C++17で非推奨
C++20で削除 | | `` | 可変引数操作 | | +| [``](/reference/stdbit.h.md.nolink) | ビット操作 | C++26 | +| [``](/reference/stdckdint.h.md.nolink) | 検査付き整数演算 | C++26 | | `` | 真理値型の定義 | C++11 (C99)
C++17で非推奨
C++20で削除 | | [``](/reference/cstddef.md) | 基本的な型、値、マクロの定義 | | | [``](/reference/cstdint.md) | 大きさが規定されている整数型 | C++11 (C99) | From abcc16f33101ad97d56f80892f7496f956f3c43b Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 19 Dec 2024 16:56:49 +0900 Subject: [PATCH 1316/3948] =?UTF-8?q?linalg/tranposed:=20P3222R0=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C(#1382)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/linalg/transposed.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/reference/linalg/transposed.md b/reference/linalg/transposed.md index dec56c1af9..f03034f6c2 100644 --- a/reference/linalg/transposed.md +++ b/reference/linalg/transposed.md @@ -30,6 +30,8 @@ namespace std::linalg { - `Layout`が[`layout_left`](/reference/mdspan/layout_left.md)のとき、[`layout_right`](/reference/mdspan/layout_right.md) - `Layout`が[`layout_right`](/reference/mdspan/layout_right.md)のとき、[`layout_left`](/reference/mdspan/layout_left.md) +- `Layout`が[`layout_left_padded`](/reference/mdspan/layout_left_padded.md)のとき、[`layout_right_padded`](/reference/mdspan/layout_right_padded.md) +- `Layout`が[`layout_right_padded`](/reference/mdspan/layout_right_padded.md)のとき、[`layout_left_padded`](/reference/mdspan/layout_left_padded.md) - `Layout`が[`layout_stride`](/reference/mdspan/layout_stride.md)のとき、`layout_stride` - `Layout`が[`layout_blas_packed`](layout_blas_packed.md)``のとき、`layout_blas_packed` - `OppositeTriangle`は[`conditional_t`](/reference/type_traits/conditional.md)`<`[`is_same_v`](/reference/type_traits/is_same.md)`, lower_triangle_t, upper_triangle_t>` @@ -48,7 +50,25 @@ namespace std::linalg { ``` * transpose-extents[link layout_transpose/transpose-extents.md] -- `Layout`が[`layout_stride`](/reference/mdspan/layout_stride.md)の特殊化であるとき、 +- `Layout`が[`layout_left_padded`](/reference/mdspan/layout_left_padded.md)であるとき、 + + ```cpp + R(a.data_handle(), + ReturnMapping(transpose-extents(a.mapping().extents()), a.mapping().stride(1)), + a.accessor()) + ``` + * transpose-extents[link layout_transpose/transpose-extents.md] + +- `Layout`が[`layout_right_padded`](/reference/mdspan/layout_right_padded.md)であるとき、 + + ```cpp + R(a.data_handle(), + ReturnMapping(transpose-extents(a.mapping().extents()), a.mapping().stride(0)), + a.accessor()) + ``` + * transpose-extents[link layout_transpose/transpose-extents.md] + +- `Layout`が[`layout_stride`](/reference/mdspan/layout_stride.md)であるとき、 ```cpp R(a.data_handle(), @@ -122,3 +142,4 @@ int main() ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - [P1674R2: Evolving a Standard C++ Linear Algebra Library from the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1674r2.html) +- [P3222R0 Fix C++26 by adding transposed special cases for P2642 layouts](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3222r0.html) From 9e722372ffed0504820c5a04ac689a7f8dc76b0a Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 19 Dec 2024 17:26:10 +0900 Subject: [PATCH 1317/3948] =?UTF-8?q?linalg/conjugated:=20R3050R2=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C(#1383)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/linalg/conjugated.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/reference/linalg/conjugated.md b/reference/linalg/conjugated.md index 78fb8b04a9..7104eb4a9e 100644 --- a/reference/linalg/conjugated.md +++ b/reference/linalg/conjugated.md @@ -22,8 +22,16 @@ namespace std::linalg { ## 戻り値 -- `Accessor`が[`conjugated_accessor`](conjugated_accessor.md)の特殊化のとき、説明用の型`A`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``として、 +説明用の型`A`を下記の通りとする。 +- `Accessor`が[`conjugated_accessor`](conjugated_accessor.md)の特殊化のとき、[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`` +- [`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``が算術型のとき、`Accessor` +- [`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``と等価な型`T`となる任意の部分式`E`に対して、宣言`template conj(const T&) = delete;`を含むコンテキストでオーバーロード解決が行わた結果`conj(E)`が有効な式ではないとき、`Accessor` +- そうでなければ、[`conjugated_accessor`](conjugated_accessor.md) + +戻り値は下記の通り。 + +- `Accessor`が[`conjugated_accessor`](conjugated_accessor.md)の特殊化のとき、 ```cpp mdspan( a.data_handle(), a.mapping(), a.accessor().nested_accessor()) @@ -32,8 +40,9 @@ namespace std::linalg { * Extents[link /reference/mdspan/extents.md] * Layout[link /reference/mdspan/LayoutMappingPolicy.md] -- そうではないとき、説明用の型`A`を[`conjugated_accessor`](conjugated_accessor.md)``として、 - +- [`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``が算術型のとき、`a` +- [`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``と等価な型`T`となる任意の部分式`E`に対して、宣言`template conj(const T&) = delete;`を含むコンテキストでオーバーロード解決が行わた結果`conj(E)`が有効な式ではないとき、`a` +- そうではないとき、 ```cpp mdspan( a.data_handle(), a.mapping(), conjugated_accessor(a.accessor())) @@ -89,3 +98,4 @@ int main() ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - [P1674R2: Evolving a Standard C++ Linear Algebra Library from the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1674r2.html) +- [P3050R2 Fix C++26 by optimizing linalg::conjugated for noncomplex value types](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3050r2.html) From 44b240914ee4f33abc124e1f674a6e7b3ccd9cdd Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 19 Dec 2024 21:50:11 +0900 Subject: [PATCH 1318/3948] =?UTF-8?q?C++26=E5=AF=BE=E5=BF=9C=E3=81=A8?= =?UTF-8?q?=E3=81=97=E3=81=A6philox=5Fengine=E3=81=AE=E8=AA=AC=E6=98=8E?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1392)=20#1385?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 2 +- reference/random.md | 3 + reference/random/philox4x32.md | 83 ++++++ reference/random/philox4x64.md | 83 ++++++ reference/random/philox_engine.md | 267 ++++++++++++++++++ reference/random/philox_engine/discard.md | 77 +++++ reference/random/philox_engine/max.md | 51 ++++ reference/random/philox_engine/min.md | 51 ++++ reference/random/philox_engine/op_call.md | 70 +++++ .../random/philox_engine/op_constructor.md | 115 ++++++++ reference/random/philox_engine/op_equal.md | 52 ++++ reference/random/philox_engine/op_istream.md | 82 ++++++ reference/random/philox_engine/op_ostream.md | 55 ++++ reference/random/philox_engine/seed.md | 108 +++++++ reference/random/philox_engine/set_counter.md | 124 ++++++++ 15 files changed, 1222 insertions(+), 1 deletion(-) create mode 100644 reference/random/philox4x32.md create mode 100644 reference/random/philox4x64.md create mode 100644 reference/random/philox_engine.md create mode 100644 reference/random/philox_engine/discard.md create mode 100644 reference/random/philox_engine/max.md create mode 100644 reference/random/philox_engine/min.md create mode 100644 reference/random/philox_engine/op_call.md create mode 100644 reference/random/philox_engine/op_constructor.md create mode 100644 reference/random/philox_engine/op_equal.md create mode 100644 reference/random/philox_engine/op_istream.md create mode 100644 reference/random/philox_engine/op_ostream.md create mode 100644 reference/random/philox_engine/seed.md create mode 100644 reference/random/philox_engine/set_counter.md diff --git a/lang/cpp26.md b/lang/cpp26.md index 8fa3d18dbc..0d30d57a6c 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -323,7 +323,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [`std::complex`](/reference/complex/complex.md)を構造化束縛や、将来のパターンマッチで使用できるようタプルインタフェースの特殊化を追加 - [``](/reference/random.md)の範囲`[0, 1)`の乱数を生成する[`std::generate_canonical()`](/reference/random/generate_canonical.md)を、望ましい統計的性質を保証するようアルゴリズムと制約を変更 - [``](/reference/random.md)に、乱数列を生成する[`std::ranges::generate_random()`](/reference/random/generate_random.md)関数を追加 -- [``](/reference/random.md)に、乱数生成器は並列シミュレーションに効果的なカウンターベースのPhilox乱数生成器として、[`std::philox_engine`](/reference/random/philox_engine.md.nolink)クラス、およびその別名である[`std::philox4x32`](/reference/random/philox4x32.md.nolink)と[`std::philox4x64`](/reference/random/philox4x64.md.nolink)を追加 +- [``](/reference/random.md)に、乱数生成器は並列シミュレーションに効果的なカウンターベースのPhilox乱数生成器として、[`std::philox_engine`](/reference/random/philox_engine.md)クラス、およびその別名である[`std::philox4x32`](/reference/random/philox4x32.md)と[`std::philox4x64`](/reference/random/philox4x64.md)を追加 ### ユーティリティ diff --git a/reference/random.md b/reference/random.md index a0be2c7451..4aa2ee9b2a 100644 --- a/reference/random.md +++ b/reference/random.md @@ -28,6 +28,7 @@ | [`linear_congruential_engine`](random/linear_congruential_engine.md) | 線形合同法(class template) | C++11 | | [`mersenne_twister_engine`](random/mersenne_twister_engine.md) | メルセンヌツイスター法(class template) | C++11 | | [`subtract_with_carry_engine`](random/subtract_with_carry_engine.md) | キャリー付き減算法(class template) | C++11 | +| [`philox_engine`](random/philox_engine.md) | カウンタベース乱数生成器のPhilox法(class template) | C++26 | ## 生成器アダプタ @@ -62,6 +63,8 @@ | [`ranlux24`](random/ranlux24.md) | RANLUX法のレベル3(type-alias) | C++11 | | [`ranlux48`](random/ranlux48.md) | RANLUX法のレベル4(type-alias) | C++11 | | [`knuth_b`](random/knuth_b.md) | KnuthのリオーダーアルゴリズムB(type-alias) | C++11 | +| [`philox4x32`](random/philox4x32.md) | Philoxの32ビット版(type-alias) | C++26 | +| [`philox4x64`](random/philox4x64.md) | Philoxの64ビット版(type-alias) | C++26 | | [`default_random_engine`](random/default_random_engine.md) | 非専門用途でデフォルト使用する擬似乱数生成器(type-alias) | C++11 | diff --git a/reference/random/philox4x32.md b/reference/random/philox4x32.md new file mode 100644 index 0000000000..541bdb51ec --- /dev/null +++ b/reference/random/philox4x32.md @@ -0,0 +1,83 @@ +# philox4x32 +* random[meta header] +* std[meta namespace] +* type-alias[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + using philox4x32 = philox_engine; +} +``` +* philox_engine[link philox_engine.md] +* uint_fast32_t[link /reference/cstdint/uint_fast32_t.md] + +## 概要 +パラメータ設定済みの[`philox_engine`](philox_engine.md)。 +32ビット版のPhilox。64ビット版は[`philox4x64`](philox4x64.md)。 + + +## 要件 +`philox4x32`型オブジェクトをデフォルト構築した場合、10000番目に生成される擬似乱数の値は`1955073260`であること。 + + +## 乱数列の周期 +4 * 24 * 32 = 2130 + + +## サイズ +32ビット * 10個 + + +## シード、および生成される値の型 +[`uint_fast32_t`](/reference/cstdint/uint_fast32_t.md) + + +## 備考 +- ここではラウンド数として`r = 10`を設定している。この値を大きくすれば乱数の品質は向上し、統計的により良い分布になっていく。`10`という値は既知の統計検定の合格する最小値よりやや大きめであり、広く使用されている値である。言い換えれば、適度な性能コストで統計的な安全マージンを提供している + - `r = 7`でも統計的な欠陥は見つかっていないが、実際には`r = 10`だけが広く使われている + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::random_device seed_gen; + std::philox4x32 engine{seed_gen()}; + + for (int i = 0; i < 10; ++i) { + std::uint32_t result = engine(); + std::cout << result << std::endl; + } +} +``` +* std::philox4x32[color ff0000] +* std::random_device[link random_device.md] +* seed_gen()[link random_device/op_call.md] +* engine()[link philox_engine/op_call.md] + +### 出力例 +``` +717409690 +3816001420 +2063273750 +279442752 +2836561695 +431684143 +3973522490 +2090827657 +748889484 +859307553 +``` + +## バージョン +### 言語 +- C++26 + +- [Clang](/implementation.md#clang): 19 [mark noimpl] +- [GCC](/implementation.md#gcc): 14 [mark noimpl] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/philox4x64.md b/reference/random/philox4x64.md new file mode 100644 index 0000000000..94e62dcf2d --- /dev/null +++ b/reference/random/philox4x64.md @@ -0,0 +1,83 @@ +# philox4x64 +* random[meta header] +* std[meta namespace] +* type-alias[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + using philox4x64 = philox_engine; +} +``` +* philox_engine[link philox_engine.md] +* uint_fast64_t[link /reference/cstdint/uint_fast64_t.md] + +## 概要 +パラメータ設定済みの[`philox_engine`](philox_engine.md)。 +64ビット版のPhilox。32ビット版は[`philox4x64`](philox4x32.md)。 + + +## 要件 +`philox4x64`型オブジェクトをデフォルト構築した場合、10000番目に生成される擬似乱数の値は`3409172418970261260`であること。 + + +## 乱数列の周期 +4 * 24 * 64 = 2258 + + +## サイズ +64ビット * 10個 + + +## シード、および生成される値の型 +[`uint_fast64_t`](/reference/cstdint/uint_fast64_t.md) + + +## 備考 +- ここではラウンド数として`r = 10`を設定している。この値を大きくすれば乱数の品質は向上し、統計的により良い分布になっていく。`10`という値は既知の統計検定の合格する最小値よりやや大きめであり、広く使用されている値である。言い換えれば、適度な性能コストで統計的な安全マージンを提供している + - `r = 7`でも統計的な欠陥は見つかっていないが、実際には`r = 10`だけが広く使われている + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::random_device seed_gen; + std::philox4x64 engine{seed_gen()}; + + for (int i = 0; i < 10; ++i) { + std::uint64_t result = engine(); + std::cout << result << std::endl; + } +} +``` +* std::philox4x64[color ff0000] +* std::random_device[link random_device.md] +* seed_gen()[link random_device/op_call.md] +* engine()[link philox_engine/op_call.md] + +### 出力例 +``` +72062055105063631 +539956941501865535 +5904818425294243952 +8001500457562741315 +13252054522302466664 +18049527239021749472 +5492258834844344098 +5802814489282269200 +3731762092097568778 +13599432073888768711 +``` + +## バージョン +### 言語 +- C++26 + +- [Clang](/implementation.md#clang): 19 [mark noimpl] +- [GCC](/implementation.md#gcc): 14 [mark noimpl] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/philox_engine.md b/reference/random/philox_engine.md new file mode 100644 index 0000000000..4a6738e390 --- /dev/null +++ b/reference/random/philox_engine.md @@ -0,0 +1,267 @@ +# philox_engine +* random[meta header] +* std[meta namespace] +* class template[meta id-type] +* cpp26[meta cpp] +* [mathjax enable] + +```cpp +namespace std { + template + class philox_engine; + + using philox4x32 = …; + using philox4x64 = …; +} +``` +* philox4x32[link philox4x32.md] +* philox4x64[link philox4x64.md] + +## 概要 +`philox_engine`クラスは、カウンターベースの乱数アルゴリズム (Counter-based random number generator, CBRNG) のPhilox法による擬似乱数生成エンジンである。 + +Philox法は、以下のような特徴を持つ: + +1. 小さい容量の状態をもつ (Philox4x32の状態は32ビットの値 * 10個の要素) +2. 長い周期をもつ (Philox4x32の周期は2130) +3. ベクトル化・並列化がしやすい + +`philox_engine`は、 $ m = 2^{w}−1 $ であるとして、区間`[0, m]`の符号なし整数の乱数を生成する。 + +- オブジェクトの状態としては、以下をもつ: + - n個のwビットの符号なし整数からなるシーケンス $X$ + - n/2個の`result_type`値からなるシーケンス $K$ + - n個の`result_type`値からなるシーケンス $Y$ + - スカラー値i + + ここでそれぞれの値は以下の意味をもつ: + - $X$ は $ n \cdot w $ ビットの符号なし整数のカウンター値 $ Z=\sum_{j=0}^{n-1}X_{j} \cdot 2^{wj} $ の解釈である + - $K$ はキー + - $Y$ は生成された値のバッファ + - $i$ は $Y$ バッファのインデックス値 + +- 乱数生成アルゴリズムは、遷移アルゴリズムを適用したあと、Yのi番目に格納された値を返す +- 状態遷移は、以下のアルゴリズムで実行される: + ``` + i=i+1 + if (i == n){ + Y = Philox(K, X) // 下記参照 + Z = (Z+1) + i = 0 + } + ``` + +- Philox関数は、長さn/2のシーケンスKと、長さnのシーケンスXを、長さnのシーケンスYにマッピングする。Philox関数はX内の値にrラウンドのSPN構造 (substitution-permutation network) を適用する。生成アルゴリズムのひとつのラウンドは以下のステップを実行する: + - 1. 前のラウンドの出力シーケンスX'(第1ラウンドの場合はX)を並べ替えて中間状態Vを得る: + $$ V_{j} = X'_{f(j)} $$ + ここでj = 0, …, n-1であり、`f(j)`は以下のテーブルで定義される (n=2のシーケンスは順列ではない): + + | | j=0 | j=1 | j=2 | j=3 | j=4 | j=5 | j=6 | j=7 | j=8 | j=9 | j=10 | j=11 | j=12 | j=13 | j=14 | j=15 | + |------|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|------|------|------|------|------|------| + | n=2 | 0 | 1 | | | | | | | | | | | | | | | + | n=4 | 0 | 3 | 2 | 1 | | | | | | | | | | | | | + | n=8 | 2 | 1 | 4 | 7 | 6 | 5 | 0 | 3 | | | | | | | | | + | n=16 | 0 | 9 | 2 | 13 | 16 | 11 | 4 | 15 | 10 | 7 | 12 | 13 | 14 | 5 | 8 | 1 | + + - 2. シーケンス $V$ の要素には以下の計算が適用される: + $$ X'_{2 \cdot k} = mullo(V_{2 \cdot k + 1},\ M_{k},\ w) $$ + $$ X'_{2 \cdot k + 1} = mulhi(V_{2 \cdot k + 1},\ M_{k}, w)\ xor\ key_k^q\ xor\ V_{2 \cdot k} $$ + + - ここで以下のように定義する: + - `mullo(a, b, w)`関数は、`a`と`b`を掛けた剰余の下半分を返す: $ a \cdot b\ mod \ 2^{w} $ + - `mulhi(a, b, w)`関数は、`a`と`b`を掛けた上半分を返す: $ \left( \lfloor (a \cdot b) / 2^{w} \rfloor \right) $ 。`k`は0, …, n/2-1のインデックスシーケンスである + - `q`は0, …, r - 1のラウンドのインデックスである + - $ key_k^q $ はラウンド`q`の`k`番目のラウンドキーであり、 $ key_k^q = \left( K_{k}\ +\ q \cdot C_{k} \right)\ mod\ 2^{w} $ + - $ K_{k} $ はシードで一度生成されたキーであり、[`seed()`](philox_engine/seed.md)関数が呼ばれない限り固定である + - $ M_{k} $ は`multipliers`である + - $ C_{k} $ は`round_consts`である + +- 一回のラウンド関数が`r`回適用されたあと、Philoxはシーケンス`Y=X'`を返す +- このクラスオブジェクトのテキスト表現は、 $ K_{0}, …, K_{n/2-1}, X_{0}, …, X_{n-1}, i $ の順で対応する + - 備考: ストリーム演算子は、必要に応じて $K$ と $X$ から $Y$ を再構築できる + + +### テンプレートパラメータ +- `UIntType` : 生成する符号なし整数の型。 +- `w` : ワードサイズ。状態シーケンス内での各ワードのビット数 +- `n` : ワード数 +- `r` : ラウンド数 +- `consts` : 内部で使用する`n`個の定数値 + - $ M_{k} $ と $ C_{k} $ の値を表し、以下のようにグループ化される: $ \left[ M_{0}, C_{0}, M_{1}, C_{1}, M_{2}, C_{2}, …, M_{n/2-1}, C_{n/2-1} \right] $ + + +### 適格要件 +- `sizeof...(consts) == n`が`true`であること +- `0 < r`が`true`であること +- `0 < w && w <=` [`numeric_limits`](/reference/limits/numeric_limits.md)`::`[`digits`](/reference/limits/numeric_limits/digits.md)が`true`であること + + +### 周期 +$ n \cdot 2^{w \cdot n} $ + + +### サイズ +$ r \cdot w $ ビット + + +## メンバ関数 +### 構築・シード + +| 名前 | 説明 | 対応バージョン | +|-----------------------------------------------------|------------------|-------| +| [`(constructor)`](philox_engine/op_constructor.md) | コンストラクタ | C++26 | +| `~philox_engine() = default;` | デストラクタ | C++26 | +| [`seed`](philox_engine/seed.md) | シードを設定する | C++26 | +| [`set_counter`](philox_engine/set_counter.md) | カウンターを設定する | C++26 | + + +### 生成 + +| 名前 | 説明 | 対応バージョン | +|------------------------------------------|--------------------|-------| +| [`operator()`](philox_engine/op_call.md) | 擬似乱数を生成する | C++26 | +| [`discard`](philox_engine/discard.md) | 指定した回数だけ擬似乱数を生成し、内部状態を進める | C++26 | + + +## 静的メンバ関数 +### エンジンの特性 + +| 名前 | 説明 | 対応バージョン | +|-------------------------------|--------------------------------|-------| +| [`min`](philox_engine/min.md) | 生成し得る値の最小値を取得する | C++26 | +| [`max`](philox_engine/max.md) | 生成し得る値の最大値を取得する | C++26 | + + +## メンバ型 + +| 型 | 説明 | 対応バージョン | +|---------------|-------------------|-------| +| `result_type` | 擬似乱数生成結果の符号なし整数型 `UIntType`。 | C++26 | + + +## メンバ定数 + +| 定数 | 説明 | 対応バージョン | +|---------------|-------------------|-------| +| `static constexpr size_t word_size` | ワードサイズ。状態シーケンス内での各ワードのビット数。テンプレートパラメータ`w`。 | C++26 | +| `static constexpr size_t word_count` | 状態のサイズ。状態シーケンスの要素数。生成される値が再発する程度を調整するための値。テンプレートパラメータ`n`。 | C++26 | +| `static constexpr size_t round_count` | ラウンド数。大きいほど乱数の質が高くなり、分布が改善する。テンプレートパラメータ`r`。 | C++26 | +| `static constexpr array multipliers` | カウンター値に対する乗数。 | C++26 | +| `static constexpr array` | ラウンドごとのキー値 | C++26 | +| `static constexpr result_type default_seed` | デフォルトのシード値。`20111115u` | C++26 | + + +## 非メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|-----------------------------------------------|----------------------|-------| +| [`operator==`](philox_engine/op_equal.md) | 等値比較 | C++26 | +| `operator!=` | 非等値比較 (`==`により使用可能) | C++26 | +| [`operator<<`](philox_engine/op_ostream.md) | ストリームへの出力 | C++26 | +| [`operator>>`](philox_engine/op_istream.md) | ストリームからの入力 | C++26 | + + +## 例 +### 基本的な使い方 +```cpp example +#include +#include + +int main() +{ + std::random_device seed_gen; + + // philox_engineのパラメータ設定済み別名であるphilox4x32を使用する。 + // ランダムなシードを使用して初期化 + std::philox4x32 engine{seed_gen()}; + + for (int i = 0; i < 10; ++i) { + // 乱数を生成 + std::uint32_t result = engine(); + std::cout << result << std::endl; + } +} +``` +* std::uint32_t[link /reference/cstdint/uint32_t.md] +* engine()[link philox_engine/op_call.md] + +#### 出力例 +``` +717409690 +3816001420 +2063273750 +279442752 +2836561695 +431684143 +3973522490 +2090827657 +748889484 +859307553 +``` + + +### 多次元の乱数を生成する例 +```cpp example +#include +#include + +struct Vector { + float x, y, z; +}; + +int main() +{ + std::uint32_t seed = 12345; + std::philox4x32 engine; + + // 4x4x4個のランダムなベクトルを生成する + for (std::uint32_t x = 0; x < 2; ++x) { + for (std::uint32_t y = 0; y < 2; ++y) { + for (std::uint32_t z = 0; z < 2; ++z) { + engine.seed(seed); + engine.set_counter({x, y, z, 0}); + + std::uniform_real_distribution dist{0, 1.0}; + + Vector vec { + dist(engine), + dist(engine), + dist(engine) + }; + std::println("{},{},{}", vec.x, vec.y, vec.z); + } + } + } +} +``` +* set_counter[link philox_engine/set_counter.md] +* uniform_real_distribution[link /reference/random/uniform_real_distribution.md] +* std::uint32_t[link /reference/cstdint/uint32_t.md] + +#### 出力例 +``` +0.8202247,0.18554558,0.8234037 +0.4850654,0.9281539,0.43299365 +0.26559144,0.98589313,0.31661463 +0.88831127,0.4234704,0.9224362 +0.0027833676,0.14429614,0.8929877 +0.6186795,0.6290597,0.46478647 +0.17204352,0.54567194,0.1469554 +0.7067667,0.48607737,0.6880201 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 19 [mark noimpl] +- [GCC](/implementation.md#gcc): 14 [mark noimpl] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P1932R0 Extension of the C++ random number generators](http://open-std.org/JTC1/SC22/WG21/docs/papers/2019/p1932r0.pdf) + - C++にPhilox乱数生成器が最初に提案された文書 +- [Parallel Random Numbers: As Easy as 1, 2, 3](https://www.thesalmons.org/john/random123/papers/random123sc11.pdf) + - 2011年に発表されたこの論文でPhilox乱数生成器が考案された diff --git a/reference/random/philox_engine/discard.md b/reference/random/philox_engine/discard.md new file mode 100644 index 0000000000..6a7efd962a --- /dev/null +++ b/reference/random/philox_engine/discard.md @@ -0,0 +1,77 @@ +# discard +* random[meta header] +* std[meta namespace] +* philox_engine[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +void discard(unsigned long long z); +``` + +## 概要 +指定した回数だけ擬似乱数を生成し、内部状態を進める。 + + +## 効果 +`*this`を`e`とした場合、 + +```cpp +for (unsigned long long i = 0; i < z; ++i) { + e(); +} +``` +* e()[link op_call.md] + +と同じ効果を持つ。 + +指定された回数だけ乱数生成を行い、結果を破棄する。 + + +## 戻り値 +なし + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::philox4x32 engine; + + for (int i = 0; i < 5; ++i) { + engine(); + } + + std::cout << engine() << std::endl; + + // エンジンを再初期化し、内部状態を5回進める + // 上のコードで生成した乱数と同じ結果が得られる + engine.seed(); + engine.discard(5); + + std::cout << engine() << std::endl; +} +``` +* discard[color ff0000] +* engine()[link op_call.md] +* seed()[link seed.md] + +### 出力 +``` +3200855668 +3200855668 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 19 [mark noimpl] +- [GCC](/implementation.md#gcc): 14 [mark noimpl] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + diff --git a/reference/random/philox_engine/max.md b/reference/random/philox_engine/max.md new file mode 100644 index 0000000000..c3140111b6 --- /dev/null +++ b/reference/random/philox_engine/max.md @@ -0,0 +1,51 @@ +# max +* random[meta header] +* std[meta namespace] +* philox_engine[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +static constexpr result_type max(); +``` + +## 概要 +生成し得る値の最大値を取得する。 + + +## 戻り値 +`2^w - 1`を返す。 + + +## 計算量 +定数時間 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::uint32_t max_value = std::philox4x32::max(); + std::cout << max_value << std::endl; +} +``` +* max()[color ff0000] +* std::uint32_t[link /reference/cstdint/uint32_t.md] + +### 出力 +``` +4294967295 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 19 [mark noimpl] +- [GCC](/implementation.md#gcc): 14 [mark noimpl] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/philox_engine/min.md b/reference/random/philox_engine/min.md new file mode 100644 index 0000000000..5521bda44b --- /dev/null +++ b/reference/random/philox_engine/min.md @@ -0,0 +1,51 @@ +# min +* random[meta header] +* std[meta namespace] +* philox_engine[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +static constexpr result_type min(); +``` + +## 概要 +生成し得る値の最小値を取得する。 + + +## 戻り値 +最小値である`0`を返す。 + + +## 計算量 +定数時間 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::uint32_t min_value = std::philox4x32::min(); + std::cout << min_value << std::endl; +} +``` +* min()[color ff0000] +* std::uint32_t[link /reference/cstdint/uint32_t.md] + +### 出力 +``` +0 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 19 [mark noimpl] +- [GCC](/implementation.md#gcc): 14 [mark noimpl] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/philox_engine/op_call.md b/reference/random/philox_engine/op_call.md new file mode 100644 index 0000000000..06682dfd20 --- /dev/null +++ b/reference/random/philox_engine/op_call.md @@ -0,0 +1,70 @@ +# operator() +* random[meta header] +* std[meta namespace] +* philox_engine[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +result_type operator()(); +``` + +## 概要 +乱数生成を行う。 + + +## 効果 +ランダムな値を生成し、内部状態を進める。 + + +## 戻り値 +ランダムな値を生成して返す。 +値の範囲は`[`[`min()`](min.md), [`max()`](max.md)`]`である。つまり、最小値と最大値両方を含む。 + + +## 計算量 +償却定数時間 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::philox4x32 engine; + + for (int i = 0; i < 10; ++i) { + // 乱数生成 + std::uint32_t result = engine(); + std::cout << result << std::endl; + } +} +``` +* engine()[color ff0000] +* std::uint32_t[link /reference/cstdint/uint32_t.md] + +### 出力例 +``` +3587538684 +1324224816 +3068087177 +2030706281 +1694797232 +3200855668 +284762628 +612470539 +492986243 +2306264815 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 19 [mark noimpl] +- [GCC](/implementation.md#gcc): 14 [mark noimpl] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/philox_engine/op_constructor.md b/reference/random/philox_engine/op_constructor.md new file mode 100644 index 0000000000..8f5d50f50a --- /dev/null +++ b/reference/random/philox_engine/op_constructor.md @@ -0,0 +1,115 @@ +# コンストラクタ +* random[meta header] +* std[meta namespace] +* philox_engine[meta class] +* function[meta id-type] +* cpp26[meta cpp] +* [mathjax enable] + +```cpp +philox_engine(); // (1) C++26 + +explicit philox_engine(result_type value); // (2) C++26 + +template +explicit philox_engine(Sseq& q); // (3) C++26 + +philox_engine(const philox_engine& e) = default; // (4) C++26 +philox_engine(philox_engine&& e) = default; // (5) C++26 +``` +* Sseq[link /reference/random/seed_seq.md] + +## 概要 +- (1) : デフォルトコンストラクタ +- (2) : シード値を受け取って状態シーケンスを構築する +- (3) : シードのシーケンスを受け取って状態を構築する +- (4) : コピーコンストラクタ。状態をコピーする +- (5) : ムーブコンストラクタ + + +## 効果 +- (1) : デフォルトのシード値 (`default_seed`) で(2)に委譲 +- (2) : + - $K_{0}$ に $ value\ mod\ 2^{w} $ を設定する + - $K_{0}$ 以外の $X$ と $K$ のすべての要素に値0を設定する + - $i$ に値としてn-1を設定する +- (3) : + - `p = ceil(w / 32)`、長さ`n / 2 * p`の配列`a`があるとして、[`q.generate`](/reference/random/seed_seq/generate.md)`(a + 0, a + n / 2 * p)`を呼び出す + - $K$ の各要素k=0, …, n/2-1に、 $ \left(\sum_{j=0}^{p-1}a_{k \cdot p+j} \cdot 2^{32j}\right)\ mod\ 2^{w} $ を設定する + - $X$ のすべての要素に値0を設定する + - $i$ に値としてn-1を設定する + + +## 計算量 +- (1), (2), (3) : 状態のサイズ `n` に対し O(n) +- (5) : 状態シーケンスの要素数はコンパイル時に決定されるため、多くの場合状態シーケンスはスタック上(配列)に作られる。そのため、ムーブが効果的に動作することは期待できない + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + // (1) デフォルト構築 + // デフォルトのシード値(default_seed静的メンバ変数)から構築する + { + std::philox4x32 engine; + + std::uint32_t result = engine(); + std::cout << result << std::endl; + } + + // (2) シード値を指定して構築 + { + std::uint32_t seed = std::random_device{}(); + std::philox4x32 engine{seed}; + + std::uint32_t result = engine(); + std::cout << result << std::endl; + } + + // (3) シードのシーケンスを指定して構築 + { + // シードのシーケンスを作る + std::random_device seed_gen; + std::array seeds; + + for (std::uint32_t& x : seeds) { + x = seed_gen(); + } + + std::seed_seq seq(seeds.begin(), seeds.end()); + + // シードのシーケンスを指定してエンジンを初期化 + std::philox4x32 engine{seq}; + + std::uint32_t result = engine(); + std::cout << result << std::endl; + } +} +``` +* engine()[link op_call.md] +* std::uint32_t[link /reference/cstdint/uint32_t.md] +* std::seed_seq[link /reference/random/seed_seq.md] +* seeds.begin()[link /reference/array/array/begin.md] +* seeds.end()[link /reference/array/array/end.md] + +### 出力例 +``` +349899751 +1721219710 +1841229489 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 19 [mark noimpl] +- [GCC](/implementation.md#gcc): 14 [mark noimpl] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/philox_engine/op_equal.md b/reference/random/philox_engine/op_equal.md new file mode 100644 index 0000000000..3816b881dd --- /dev/null +++ b/reference/random/philox_engine/op_equal.md @@ -0,0 +1,52 @@ +# operator== +* random[meta header] +* std[meta namespace] +* philox_engine[meta class] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +friend bool operator==(const philox_engine& x, const philox_engine& y); +``` + +## 概要 +等値比較を行う。 + + +## 戻り値 +`a`と`b`の状態シーケンスの、全ての値を等値比較し、等しければ`true`、そうでなければ`false`を返す。 + + +## 計算量 +O(状態シーケンスのサイズ) + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::philox4x32 e1; + std::philox4x32 e2; + + assert(e1 == e2); + assert(!(e1 != e2)); +} +``` + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 19 [mark noimpl] +- [GCC](/implementation.md#gcc): 14 [mark noimpl] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + diff --git a/reference/random/philox_engine/op_istream.md b/reference/random/philox_engine/op_istream.md new file mode 100644 index 0000000000..23384edd0e --- /dev/null +++ b/reference/random/philox_engine/op_istream.md @@ -0,0 +1,82 @@ +# operator>> +* random[meta header] +* std[meta namespace] +* philox_engine[meta class] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + friend basic_istream& + operator>>(basic_istream& is, philox_engine& x); +} +``` + +## 概要 +ストリームからの入力を行う。 + + +## 効果 +`is`に対してフォーマットフラグ`ios_base::dec`を設定する。 +フォーマットを設定した`is`から、乱数生成器の状態を読み取り、オブジェクト`x`に格納する。 +不正な入力だった場合、`is.setstate(ios::failbit)`を呼び出し、ストリームを失敗状態にする。 + + +## 事後条件 +`is`のフォーマットフラグが、この関数を呼び出す前の状態に戻ること。 + + +## 戻り値 +`is` + + +## 例 +```cpp example +#include +#include +#include +#include + +int main() +{ + std::stringstream ss; + + // ストリームへ出力 + { + std::philox4x32 engine; + ss << engine; + } + + // 出力結果を確認 + std::cout << ss.str() << std::endl; + + // 出力したストリームから読み込む + { + std::philox4x32 engine; + ss >> engine; + + assert(ss); + } +} +``` +* std::stringstream[link /reference/sstream/basic_stringstream.md] +* ss.str()[link /reference/sstream/basic_stringstream/str.md] + +### 出力 +(未検証) + +## バージョン +### 言語 +- C++11 + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 19 [mark noimpl] +- [GCC](/implementation.md#gcc): 14 [mark noimpl] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + diff --git a/reference/random/philox_engine/op_ostream.md b/reference/random/philox_engine/op_ostream.md new file mode 100644 index 0000000000..3707bc9ef4 --- /dev/null +++ b/reference/random/philox_engine/op_ostream.md @@ -0,0 +1,55 @@ +# operator<< +* random[meta header] +* std[meta namespace] +* philox_engine[meta class] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +friend basic_ostream& + operator<<(basic_ostream& os, const philox_engine& x); +``` + +## 概要 +ストリームへの出力を行う。 + + +## 効果 +`os`に対してフォーマットフラグ`ios_base::dec | ios_base::left`を設定する。 +フォーマットを設定した`os`に対して、エンジン`x`の現在状態を出力する。 + + +## 事後条件 +`os`のフォーマットフラグが、この関数を呼び出す前の状態に戻ること。 + + +## 戻り値 +`os` + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::philox4x32 engine; + std::cout << engine << std::endl; +} +``` + +### 出力 +(未検証) + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 19 [mark noimpl] +- [GCC](/implementation.md#gcc): 14 [mark noimpl] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + diff --git a/reference/random/philox_engine/seed.md b/reference/random/philox_engine/seed.md new file mode 100644 index 0000000000..5c3fef7b81 --- /dev/null +++ b/reference/random/philox_engine/seed.md @@ -0,0 +1,108 @@ +# seed +* random[meta header] +* std[meta namespace] +* philox_engine[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +void seed(result_type value = default_seed); // (1) C++26 +template void seed(Sseq& q); // (2) C++26 +``` + +## 概要 +- (1) : シード値を指定して再初期化する +- (2) : シードのシーケンスを指定して再初期化する + + +## 効果 +パラメータ`value`および`q`を`arg`とした場合、 + +```cpp +*this = philox_engine(arg); +``` +* philox_engine[link op_constructor.md] + +と同じ効果を持つ。 + + +## 戻り値 +なし + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + // (1) デフォルトのシード値から再初期化 + { + std::philox4x32 engine; + + engine.seed(); + + std::uint32_t result = engine(); + std::cout << result << std::endl; + } + + // (1) シード値を指定して再初期化 + { + std::philox4x32 engine; + + std::uint32_t seed = std::random_device{}(); + engine.seed(seed); + + std::uint32_t result = engine(); + std::cout << result << std::endl; + } + + // (2) シードのシーケンスを指定して再初期化 + { + std::philox4x32 engine; + + // シードのシーケンスを作る + std::random_device seed_gen; + std::array seeds; + + for (std::uint32_t& x : seeds) { + x = seed_gen(); + } + + std::seed_seq seq(seeds.begin(), seeds.end()); + + // シードのシーケンスを指定してエンジンを再初期化 + engine.seed(seq); + + std::uint32_t result = engine(); + std::cout << result << std::endl; + } +} +``` +* seed()[color ff0000] +* seed(seed)[color ff0000] +* seed(seq)[color ff0000] +* engine()[link op_call.md] +* std::uint32_t[link /reference/cstdint/uint32_t.md] +* std::seed_seq[link /reference/random/seed_seq.md] +* seeds.begin()[link /reference/array/array/begin.md] +* seeds.end()[link /reference/array/array/end.md] + +### 出力例 +``` +349899751 +2326824539 +3175387423 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 19 [mark noimpl] +- [GCC](/implementation.md#gcc): 14 [mark noimpl] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/random/philox_engine/set_counter.md b/reference/random/philox_engine/set_counter.md new file mode 100644 index 0000000000..755e8ebb0f --- /dev/null +++ b/reference/random/philox_engine/set_counter.md @@ -0,0 +1,124 @@ +# set_counter +* random[meta header] +* std[meta namespace] +* philox_engine[meta class] +* function[meta id-type] +* cpp26[meta cpp] +* [mathjax enable] + +```cpp +void set_counter(const array& c); // (1) C++26 +``` +* array[link /reference/array/array.md] + +## 概要 +- (1) : カウンターを設定する + +この関数は、カウンターベースの乱数生成器において、カウンター値を直接設定することで乱数生成器を指定位置に進める (ジャンプさせる) ことができる。カウンターベースでない乱数生成器においては、乱数生成器の状態を進めるには一つひとつ乱数生成の結果を捨てなければならない場合があるが、カウンターベース乱数生成器のこの機能を使えば状態を一気に進めることができる。 + +この機能は、シード設定と合わせて使用する。同じシード値と同じカウンター値を設定すれば、同じ乱数列を再現させることができる。 + +この関数のパラメータは、標準ライブラリで定義される[`philox4x32`](/reference/random/philox4x32.md)および[`philox4x64`](/reference/random/philox4x64.md)を使っている限りは、要素数4の符号なし32 or 64ビット整数をもつ配列である。 + + +### この関数のユースケース +この関数のユースケースとして、多数のアトムの多数のステップでモンテカルロ・シミュレーションをする際の典型的なフローは以下のようになる: + +```cpp +uint32_t global_seed = 999; +for (uint32_t time_step = 0; time_step < time_steps_num; ++time_step) { + for (uint32_t atom_id = 0; atom_id < atoms_num; ++atom_id) { + philox4x32 eng(global_seed); + eng.set_counter({atom_id, time_step, 0, 0}); + normal_distribution<> nd; + auto n1 = nd(eng); + auto n2 = nd(eng); + // … + } +} +``` +* uint32_t[link /reference/cstdint/uint32_t.md] +* normal_distribution[link /reference/random/normal_distribution.md] + +この関数を使用することで、`atoms_num`の状態を保存することなく、その場で乱数生成器を作成することができる。また、どちらのループも並列化を妨げない。マイナス面としては、アトムごと・タイムステップごとに消費される乱数の数をコントロールする必要がある。消費される乱数の数が4*232*2を超えると、異なるアトムの配列が重なり、望ましくない相互相関が生じる可能性がある。それを回避するには以下のようにする必要がある: + + +### discardとの違い +ある制限のもとでは、この関数は[`discard()`](discard.md)メンバ関数を使っても同様の効果を得ることができるが、以下の点で異なる: + +- [`discard()`](discard.md)する回数は`unsigned long long`に制限されており (多くのシステムで64ビット)、`philox4x64`は`4*2^(64*4)`の周期をもつために、このシーケンスを2つに分割するには (タイムステップとアトム)、[`discard()`](discard.md)を`4*2^(64*3 - 64)`回呼び出さなければならない。`set_counter()`では1回の呼び出しで済む +- また、[`discard()`](discard.md)はカウンターを現在の位置から相対的に進める。[`discard()`](discard.md) APIが存在するのは状態を進める効率的なアルゴリズムをもっているからである。`set_counter()`はカウンターの絶対値を設定する。これはカウンターベースの乱数生成器のユニークな特性である + + +## 効果 +- $X$ の各要素j=0, …, n-1に $ C_{n-1-j}\ mod\ 2^{w} $ を設定する +- $i$ に値としてn-1を設定する + + +## 戻り値 +なし + + +## 備考 +- カウンターは $n \cdot w$ ビットの符号なし整数値 $ \sum_{j=0}^{n-1}X_{j} \cdot 2^{wj} $ である + + +## 例 +```cpp example +#include +#include + +struct Vector { + float x, y, z; +}; + +int main() +{ + std::uint32_t seed = 12345; + std::philox4x32 engine; + + // 2x2x2個のランダムなベクトルを生成する + for (std::uint32_t x = 0; x < 2; ++x) { + for (std::uint32_t y = 0; y < 2; ++y) { + for (std::uint32_t z = 0; z < 2; ++z) { + engine.seed(seed); + engine.set_counter({x, y, z, 0}); + + std::uniform_real_distribution dist{0, 1.0}; + + Vector vec { + dist(engine), + dist(engine), + dist(engine) + }; + std::println("{},{},{}", vec.x, vec.y, vec.z); + } + } + } +} +``` +* set_counter[color ff0000] +* uniform_real_distribution[link /reference/random/uniform_real_distribution.md] +* std::uint32_t[link /reference/cstdint/uint32_t.md] + +### 出力例 +``` +0.8202247,0.18554558,0.8234037 +0.4850654,0.9281539,0.43299365 +0.26559144,0.98589313,0.31661463 +0.88831127,0.4234704,0.9224362 +0.0027833676,0.14429614,0.8929877 +0.6186795,0.6290597,0.46478647 +0.17204352,0.54567194,0.1469554 +0.7067667,0.48607737,0.6880201 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 19 [mark noimpl] +- [GCC](/implementation.md#gcc): 14 [mark noimpl] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? From 59ca5842501d7d135426e4ac6558ba49188168e5 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 19 Dec 2024 21:58:06 +0900 Subject: [PATCH 1319/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE?= =?UTF-8?q?=E9=A3=BE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/random/philox_engine.md | 4 +++- reference/random/philox_engine/set_counter.md | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/reference/random/philox_engine.md b/reference/random/philox_engine.md index 4a6738e390..fa5d388a1f 100644 --- a/reference/random/philox_engine.md +++ b/reference/random/philox_engine.md @@ -234,9 +234,11 @@ int main() } } ``` -* set_counter[link philox_engine/set_counter.md] +* engine.seed[link philox_engine/seed.md] +* engine.set_counter[link philox_engine/set_counter.md] * uniform_real_distribution[link /reference/random/uniform_real_distribution.md] * std::uint32_t[link /reference/cstdint/uint32_t.md] +* dist(engine)[link /reference/random/uniform_real_distribution/op_call.md] #### 出力例 ``` diff --git a/reference/random/philox_engine/set_counter.md b/reference/random/philox_engine/set_counter.md index 755e8ebb0f..e26cde0324 100644 --- a/reference/random/philox_engine/set_counter.md +++ b/reference/random/philox_engine/set_counter.md @@ -98,6 +98,7 @@ int main() } ``` * set_counter[color ff0000] +* engine.seed[link seed.md] * uniform_real_distribution[link /reference/random/uniform_real_distribution.md] * std::uint32_t[link /reference/cstdint/uint32_t.md] From 1648169753ea413400a0824602d5da651d2e6917 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 19 Dec 2024 22:00:33 +0900 Subject: [PATCH 1320/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE?= =?UTF-8?q?=E9=A3=BE=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/random/philox_engine.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reference/random/philox_engine.md b/reference/random/philox_engine.md index fa5d388a1f..902f2cc4ca 100644 --- a/reference/random/philox_engine.md +++ b/reference/random/philox_engine.md @@ -182,6 +182,7 @@ int main() } } ``` +* std::philox4x32[link philox4x32.md] * std::uint32_t[link /reference/cstdint/uint32_t.md] * engine()[link philox_engine/op_call.md] @@ -234,6 +235,7 @@ int main() } } ``` +* std::philox4x32[link philox4x32.md] * engine.seed[link philox_engine/seed.md] * engine.set_counter[link philox_engine/set_counter.md] * uniform_real_distribution[link /reference/random/uniform_real_distribution.md] From 7b0c554ae195c2b40a7680451443ecdd83ec4825 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 19 Dec 2024 22:00:57 +0900 Subject: [PATCH 1321/3948] =?UTF-8?q?=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=BF=98=E3=82=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/random/philox_engine.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/random/philox_engine.md b/reference/random/philox_engine.md index 902f2cc4ca..4a60b07dc1 100644 --- a/reference/random/philox_engine.md +++ b/reference/random/philox_engine.md @@ -215,7 +215,7 @@ int main() std::uint32_t seed = 12345; std::philox4x32 engine; - // 4x4x4個のランダムなベクトルを生成する + // 2x2x2個のランダムなベクトルを生成する for (std::uint32_t x = 0; x < 2; ++x) { for (std::uint32_t y = 0; y < 2; ++y) { for (std::uint32_t z = 0; z < 2; ++z) { From 5fcfad6da90fdbf72da468775bc1c0a4f9b0261f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 19 Dec 2024 22:03:51 +0900 Subject: [PATCH 1322/3948] fix typo --- reference/random/philox4x64.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/random/philox4x64.md b/reference/random/philox4x64.md index 94e62dcf2d..62a8fa34ea 100644 --- a/reference/random/philox4x64.md +++ b/reference/random/philox4x64.md @@ -14,7 +14,7 @@ namespace std { ## 概要 パラメータ設定済みの[`philox_engine`](philox_engine.md)。 -64ビット版のPhilox。32ビット版は[`philox4x64`](philox4x32.md)。 +64ビット版のPhilox。32ビット版は[`philox4x32`](philox4x32.md)。 ## 要件 From b3291717f938ec4580220aec64fe4fee6a87ef28 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 19 Dec 2024 22:04:59 +0900 Subject: [PATCH 1323/3948] =?UTF-8?q?fix=20=E6=97=A5=E6=9C=AC=E8=AA=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/random/philox4x32.md | 2 +- reference/random/philox4x64.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/random/philox4x32.md b/reference/random/philox4x32.md index 541bdb51ec..1447c69d3a 100644 --- a/reference/random/philox4x32.md +++ b/reference/random/philox4x32.md @@ -34,7 +34,7 @@ namespace std { ## 備考 -- ここではラウンド数として`r = 10`を設定している。この値を大きくすれば乱数の品質は向上し、統計的により良い分布になっていく。`10`という値は既知の統計検定の合格する最小値よりやや大きめであり、広く使用されている値である。言い換えれば、適度な性能コストで統計的な安全マージンを提供している +- ここではラウンド数として`r = 10`を設定している。この値を大きくすれば乱数の品質は向上し、統計的により良い分布になっていく。`10`という値は既知の統計検定に合格する最小値よりやや大きめであり、広く使用されている値である。言い換えれば、適度な性能コストで統計的な安全マージンを提供している - `r = 7`でも統計的な欠陥は見つかっていないが、実際には`r = 10`だけが広く使われている diff --git a/reference/random/philox4x64.md b/reference/random/philox4x64.md index 62a8fa34ea..dc97128420 100644 --- a/reference/random/philox4x64.md +++ b/reference/random/philox4x64.md @@ -34,7 +34,7 @@ namespace std { ## 備考 -- ここではラウンド数として`r = 10`を設定している。この値を大きくすれば乱数の品質は向上し、統計的により良い分布になっていく。`10`という値は既知の統計検定の合格する最小値よりやや大きめであり、広く使用されている値である。言い換えれば、適度な性能コストで統計的な安全マージンを提供している +- ここではラウンド数として`r = 10`を設定している。この値を大きくすれば乱数の品質は向上し、統計的により良い分布になっていく。`10`という値は既知の統計検定に合格する最小値よりやや大きめであり、広く使用されている値である。言い換えれば、適度な性能コストで統計的な安全マージンを提供している - `r = 7`でも統計的な欠陥は見つかっていないが、実際には`r = 10`だけが広く使われている From 552254b6123a3fee218174e4472819ef125e97d5 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 19 Dec 2024 22:05:57 +0900 Subject: [PATCH 1324/3948] =?UTF-8?q?=E5=87=A6=E7=90=86=E7=B3=BB=E3=81=AE?= =?UTF-8?q?=E8=A6=8B=E5=87=BA=E3=81=97=E3=81=8C=E6=B6=88=E3=81=88=E3=81=A6?= =?UTF-8?q?=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/random/philox4x32.md | 1 + reference/random/philox4x64.md | 1 + 2 files changed, 2 insertions(+) diff --git a/reference/random/philox4x32.md b/reference/random/philox4x32.md index 1447c69d3a..b0df428ac4 100644 --- a/reference/random/philox4x32.md +++ b/reference/random/philox4x32.md @@ -77,6 +77,7 @@ int main() ### 言語 - C++26 +### 処理系 - [Clang](/implementation.md#clang): 19 [mark noimpl] - [GCC](/implementation.md#gcc): 14 [mark noimpl] - [ICC](/implementation.md#icc): ?? diff --git a/reference/random/philox4x64.md b/reference/random/philox4x64.md index dc97128420..5ca75d3076 100644 --- a/reference/random/philox4x64.md +++ b/reference/random/philox4x64.md @@ -77,6 +77,7 @@ int main() ### 言語 - C++26 +### 処理系 - [Clang](/implementation.md#clang): 19 [mark noimpl] - [GCC](/implementation.md#gcc): 14 [mark noimpl] - [ICC](/implementation.md#icc): ?? From da031c58424518a87ddc1d52e61b2ecb779940f7 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 19 Dec 2024 22:13:25 +0900 Subject: [PATCH 1325/3948] =?UTF-8?q?philox=5Fengine::set=5Fcounter=20:=20?= =?UTF-8?q?=E3=82=B7=E3=83=BC=E3=83=89=E5=80=A4=E3=82=92=E7=8A=B6=E6=85=8B?= =?UTF-8?q?=E3=81=A8=E3=81=97=E3=81=A6=E4=BF=9D=E6=8C=81=E3=81=97=E3=81=A6?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=81=93=E3=81=A8=E3=82=92=E8=A8=98=E8=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/random/philox_engine/set_counter.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/random/philox_engine/set_counter.md b/reference/random/philox_engine/set_counter.md index e26cde0324..ab3a5d9767 100644 --- a/reference/random/philox_engine/set_counter.md +++ b/reference/random/philox_engine/set_counter.md @@ -16,7 +16,7 @@ void set_counter(const array& c); // (1) C++26 この関数は、カウンターベースの乱数生成器において、カウンター値を直接設定することで乱数生成器を指定位置に進める (ジャンプさせる) ことができる。カウンターベースでない乱数生成器においては、乱数生成器の状態を進めるには一つひとつ乱数生成の結果を捨てなければならない場合があるが、カウンターベース乱数生成器のこの機能を使えば状態を一気に進めることができる。 -この機能は、シード設定と合わせて使用する。同じシード値と同じカウンター値を設定すれば、同じ乱数列を再現させることができる。 +この機能は、シード設定と合わせて使用する。同じシード値と同じカウンター値を設定すれば、同じ乱数列を再現させることができる。このクラスはシード値を状態として保持していないため、再現のためにカウンター値を設定する場合は、シード値も設定する必要がある。 この関数のパラメータは、標準ライブラリで定義される[`philox4x32`](/reference/random/philox4x32.md)および[`philox4x64`](/reference/random/philox4x64.md)を使っている限りは、要素数4の符号なし32 or 64ビット整数をもつ配列である。 From 000cd8fb45da8eb4f823102d56ae6fa10b67f2ab Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 19 Dec 2024 22:18:14 +0900 Subject: [PATCH 1326/3948] =?UTF-8?q?philox=5Fengine=E3=81=AE=E3=82=B5?= =?UTF-8?q?=E3=83=B3=E3=83=97=E3=83=AB=20:=20=E3=83=AB=E3=83=BC=E3=83=97?= =?UTF-8?q?=E5=86=85=E3=81=A7=E3=82=AA=E3=83=96=E3=82=B8=E3=82=A7=E3=82=AF?= =?UTF-8?q?=E3=83=88=E3=82=92=E4=BD=9C=E3=82=8B=E3=82=88=E3=81=86=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/random/philox_engine.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/reference/random/philox_engine.md b/reference/random/philox_engine.md index 4a60b07dc1..4fa2ae4b5c 100644 --- a/reference/random/philox_engine.md +++ b/reference/random/philox_engine.md @@ -213,13 +213,12 @@ struct Vector { int main() { std::uint32_t seed = 12345; - std::philox4x32 engine; // 2x2x2個のランダムなベクトルを生成する for (std::uint32_t x = 0; x < 2; ++x) { for (std::uint32_t y = 0; y < 2; ++y) { for (std::uint32_t z = 0; z < 2; ++z) { - engine.seed(seed); + std::philox4x32 engine{seed}; engine.set_counter({x, y, z, 0}); std::uniform_real_distribution dist{0, 1.0}; @@ -236,7 +235,6 @@ int main() } ``` * std::philox4x32[link philox4x32.md] -* engine.seed[link philox_engine/seed.md] * engine.set_counter[link philox_engine/set_counter.md] * uniform_real_distribution[link /reference/random/uniform_real_distribution.md] * std::uint32_t[link /reference/cstdint/uint32_t.md] From b5dd43fc76697bf7c1a321b7e84abf3f2f805a27 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 20 Dec 2024 10:21:34 +0900 Subject: [PATCH 1327/3948] memory: is_sufficiently_aligned P2897R7(#1380) --- reference/memory/assume_aligned.md | 1 + reference/memory/is_sufficiently_aligned.md | 82 +++++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 reference/memory/is_sufficiently_aligned.md diff --git a/reference/memory/assume_aligned.md b/reference/memory/assume_aligned.md index 7dbb19567b..0ff53eb652 100644 --- a/reference/memory/assume_aligned.md +++ b/reference/memory/assume_aligned.md @@ -345,6 +345,7 @@ C++20 から標準で使用可能となる本機能だが、実装例からも - [`alignas`](../../lang/cpp11/alignas.md) - [`alignof`](../../lang/cpp11/alignof.md) +- [`is_sufficiently_aligned`](is_sufficiently_aligned.md) ## 参照 diff --git a/reference/memory/is_sufficiently_aligned.md b/reference/memory/is_sufficiently_aligned.md new file mode 100644 index 0000000000..2b96750498 --- /dev/null +++ b/reference/memory/is_sufficiently_aligned.md @@ -0,0 +1,82 @@ +# is_sufficiently_aligned +* memory[meta header] +* function template[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +template + bool is_sufficiently_aligned(T* ptr); +``` + +## 概要 +ポインタ値が指定したアライメントを満たすか否かを返す。 + + +## 事前条件 +ポインタ`p`が、`T`に類似(similar)した型のオブジェクト`X`を指すこと。 + + +## 戻り値 +`X`が少なくとも`Alignment`でアライメントされるならば`true`。そうでなければ`false`。 + + +## 例外 +投げない + + +## この機能が必要になった背景・経緯 +この関数テンプレートは[``](/reference/mdspan.md)ヘッダへの[`aligned_accessor`](/reference/mdspan/aligned_accessor.md.nolink)導入に伴って必要とされた機能である。 +一方で、ポインタ値のアライメント要件を検査するユースケースは一般的と考えられたため、汎用ユーティリティとして``ヘッダに対して機能追加された。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + int *ptr = new(std::align_val_t{32}) int; + assert( std::is_sufficiently_aligned<32>(ptr) ); + delete ptr; +} +``` +* std::is_sufficiently_aligned[color ff0000] +* std::align_val_t[link /reference/new/align_val_t.md] + +### 出力 +``` +``` + + +## 実装例 +```cpp +// 提案文書P2897R7より引用 +template +bool is_sufficiently_aligned(ElementType* p) +{ + return bit_cast(p) % ByteAlignment == 0; +} +``` +* bit_cast[link /reference/bit/bit_cast.md] + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`assume_aligned`](assume_aligned.md) +- [アライメント指定されたデータの動的メモリ確保](/lang/cpp17/dynamic_memory_allocation_for_over-aligned_data.md) + + +## 参照 +- [P2897R7 `aligned_accessor`: An mdspan accessor expressing pointer over-alignment](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2897r7.html) From a4ffe7c1a97163831b803c9fddd0dcaea7060a12 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 20 Dec 2024 11:45:08 +0900 Subject: [PATCH 1328/3948] =?UTF-8?q?memory:=20=E3=83=98=E3=83=83=E3=83=80?= =?UTF-8?q?=E8=AA=AC=E6=98=8E=E3=81=AE=E5=BE=AE=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ヘッダ概要説明からGC関連を削除(C++23削除済み) - エンティティ列挙順序を調整(削除済み項目を下へ) - C++26 is_sufficiently_alignedリンク追加 --- reference/memory.md | 27 +++++++++++---------- reference/memory/is_sufficiently_aligned.md | 8 +++--- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/reference/memory.md b/reference/memory.md index dd7ba36e12..056f8f36a7 100644 --- a/reference/memory.md +++ b/reference/memory.md @@ -1,7 +1,7 @@ # memory * memory[meta header] -``ヘッダでは、メモリアロケータ、未初期化領域に関する関数群、スマートポインタ、ガベージコレクションを作るためのユーティリティ関数といった、メモリを扱うための機能を定義する。 +``ヘッダでは、メモリアロケータ、未初期化領域に関する関数群、スマートポインタ、アライメントに関するユーティリティ関数といった、メモリを扱うための機能を定義する。 このヘッダでは、以下の標準ヘッダをインクルードする: @@ -121,10 +121,22 @@ | `atomic_compare_exchange_strong_explicit` | 強い比較でメモリオーダーを指定して、`shared_ptr`の値の入れ替えをアトミックに行う (function template) | C++11
C++20で非推奨 | +## ポインタのユーティリティ + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`pointer_traits`](memory/pointer_traits.md) | ポインタの型特性(class template) | C++11 | +| [`to_address`](memory/to_address.md) | ポインタと見なせるオブジェクトからアドレスを取得する (function template) | C++20 | +| [`addressof`](memory/addressof.md) | 変数のアドレスを必ず取得する(function template) | C++11 | +| [`align`](memory/align.md) | アライメント調整された領域を得る(function) | C++11 | +| [`assume_aligned`](memory/assume_aligned.md) | コンパイラへアライメントのヒントを与える(function template) | C++20 | +| [`is_sufficiently_aligned`](memory/is_sufficiently_aligned.md) | ポインタのアライメントを判定する(function template) | C++26 | + + ## ガベージコレクション支援(C++23で削除) | 名前 | 説明 | 対応バージョン | -|--------------------------------------------------|--------------------------------------------|-------| +|------|------|----------------| | [`pointer_safety`](memory/pointer_safety.md) | ポインタ安全性について実装/挙動を示す列挙型(enum class) | C++11
C++23で削除 | | [`get_pointer_safety`](memory/get_pointer_safety.md) | 処理系の、ポインタ安全性についての実装/挙動を取得する(function) | C++11
C++23で削除 | | [`declare_reachable`](memory/declare_reachable.md) | ポインタが到達可能であることを宣言する(function) | C++11
C++23で削除 | @@ -133,17 +145,6 @@ | [`undeclare_no_pointers`](memory/undeclare_no_pointers.md) | `declare_no_pointers`で宣言された範囲を無効化する(function) | C++11
C++23で削除 | -## ポインタのユーティリティ - -| 名前 | 説明 | 対応バージョン | -|----------------------------------------------|-------------------------------------------------|-------| -| [`pointer_traits`](memory/pointer_traits.md) | ポインタの型特性(class template) | C++11 | -| [`to_address`](memory/to_address.md) | ポインタと見なせるオブジェクトからアドレスを取得する (function template) | C++20 | -| [`addressof`](memory/addressof.md) | 変数のアドレスを必ず取得する(function template) | C++11 | -| [`align`](memory/align.md) | アライメント調整された領域を得る(function) | C++11 | -| [`assume_aligned`](memory/assume_aligned.md) | コンパイラへアライメントのヒントを与える(function template) | C++20 | - - ## 参照 - [N4190 Removing `auto_ptr`, `random_shuffle()`, And Old `` Stuff](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4190.htm) - [P0718R2 Revising `atomic_shared_ptr` for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0718r2.html) diff --git a/reference/memory/is_sufficiently_aligned.md b/reference/memory/is_sufficiently_aligned.md index 2b96750498..9d65240d28 100644 --- a/reference/memory/is_sufficiently_aligned.md +++ b/reference/memory/is_sufficiently_aligned.md @@ -5,8 +5,10 @@ * cpp26[meta cpp] ```cpp -template - bool is_sufficiently_aligned(T* ptr); +namespace std { + template + bool is_sufficiently_aligned(T* ptr); +} ``` ## 概要 @@ -34,7 +36,7 @@ template ```cpp example #include #include -#include +#include int main() { From 78017b2b69ec86276388b52fb7bf086940ce941f Mon Sep 17 00:00:00 2001 From: K10-K10 <157354212+K10-K10@users.noreply.github.com> Date: Fri, 20 Dec 2024 05:17:08 +0000 Subject: [PATCH 1329/3948] =?UTF-8?q?reference=5Fiostream=5Fcin:=E5=87=BA?= =?UTF-8?q?=E5=8A=9B=E4=BE=8B=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit An example of the output of the "CIN" sample code has been created. --- reference/iostream/cin.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reference/iostream/cin.md b/reference/iostream/cin.md index 2c1a69f882..c4f755b890 100644 --- a/reference/iostream/cin.md +++ b/reference/iostream/cin.md @@ -40,6 +40,12 @@ int main() ``` * std::cin[color ff0000] +### 出力例 +``` +名前を入力してください:cpprefjp +あなたの名前は「cpprefjp」ですね +``` + ## バージョン ### 言語 - C++98 From cafe5303b8bff55772ea0cec664ef4f3ec2a7de8 Mon Sep 17 00:00:00 2001 From: Yuhki Ogasawara Date: Fri, 20 Dec 2024 16:14:41 +0900 Subject: [PATCH 1330/3948] =?UTF-8?q?implementation.md=E3=81=ABVisual=20St?= =?UTF-8?q?udio=202022=20version=2017.12.3=E3=81=AE=E6=83=85=E5=A0=B1?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation.md | 1 + 1 file changed, 1 insertion(+) diff --git a/implementation.md b/implementation.md index d879d31393..7c6ff8b8eb 100644 --- a/implementation.md +++ b/implementation.md @@ -141,6 +141,7 @@ | 表記 | 製品名 [Visual Studio バージョン] †1 | VC++ バージョン †2 | `_MSC_VER` | `_MSC_FULL_VER` | |---------------|----------------------------------------|-----------------|------------|-----------------| +| 2022 Update 12 | Visual Studio 2022 version 17.12.3 | 14.42 | 1942 | 194234435 | | 2022 Update 11 | Visual Studio 2022 version 17.11.0 | 14.41 | 1941 | 194134120 | | 2022 Update 10 | Visual Studio 2022 version 17.10.5 | 14.40 | 1939 | 194033811 | | 2022 Update 9 | Visual Studio 2022 version 17.9.2 | 14.39 | 1939 | 193933521 | From a628ac49c4338523b830934d5d40d21dc591b139 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 20 Dec 2024 16:35:29 +0900 Subject: [PATCH 1331/3948] =?UTF-8?q?philox=5Fengine=20:=20=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=83=87=E3=83=B3=E3=83=88=E3=82=924=20=E2=86=92=202?= =?UTF-8?q?=E3=82=B9=E3=83=9A=E3=83=BC=E3=82=B9=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/random/philox_engine.md | 6 ++--- reference/random/philox_engine/set_counter.md | 22 +++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/reference/random/philox_engine.md b/reference/random/philox_engine.md index 4fa2ae4b5c..e664d1dc17 100644 --- a/reference/random/philox_engine.md +++ b/reference/random/philox_engine.md @@ -224,9 +224,9 @@ int main() std::uniform_real_distribution dist{0, 1.0}; Vector vec { - dist(engine), - dist(engine), - dist(engine) + dist(engine), + dist(engine), + dist(engine) }; std::println("{},{},{}", vec.x, vec.y, vec.z); } diff --git a/reference/random/philox_engine/set_counter.md b/reference/random/philox_engine/set_counter.md index ab3a5d9767..ac662971a5 100644 --- a/reference/random/philox_engine/set_counter.md +++ b/reference/random/philox_engine/set_counter.md @@ -27,14 +27,14 @@ void set_counter(const array& c); // (1) C++26 ```cpp uint32_t global_seed = 999; for (uint32_t time_step = 0; time_step < time_steps_num; ++time_step) { - for (uint32_t atom_id = 0; atom_id < atoms_num; ++atom_id) { - philox4x32 eng(global_seed); - eng.set_counter({atom_id, time_step, 0, 0}); - normal_distribution<> nd; - auto n1 = nd(eng); - auto n2 = nd(eng); - // … - } + for (uint32_t atom_id = 0; atom_id < atoms_num; ++atom_id) { + philox4x32 eng(global_seed); + eng.set_counter({atom_id, time_step, 0, 0}); + normal_distribution<> nd; + auto n1 = nd(eng); + auto n2 = nd(eng); + // … + } } ``` * uint32_t[link /reference/cstdint/uint32_t.md] @@ -87,9 +87,9 @@ int main() std::uniform_real_distribution dist{0, 1.0}; Vector vec { - dist(engine), - dist(engine), - dist(engine) + dist(engine), + dist(engine), + dist(engine) }; std::println("{},{},{}", vec.x, vec.y, vec.z); } From 08aed17b92e8107cd495fd46bb06f08ff84b69ff Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 20 Dec 2024 16:36:49 +0900 Subject: [PATCH 1332/3948] =?UTF-8?q?=E3=82=B0=E3=83=AD=E3=83=BC=E3=83=90?= =?UTF-8?q?=E3=83=AB=E4=BF=AE=E9=A3=BE:=20=E5=9B=BA=E5=AE=9A=E5=B9=85?= =?UTF-8?q?=E3=81=AE=E6=95=B4=E6=95=B0=E5=9E=8B=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 02b10942f5..a9f177999b 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -93,6 +93,13 @@ * std::size_t[link /reference/cstddef/size_t.md] * [link /reference/cstdint.md] * std::uint8_t[link /reference/cstdint/uint8_t.md] + * std::uint16_t[link /reference/cstdint/uint16_t.md] + * std::uint32_t[link /reference/cstdint/uint32_t.md] + * std::uint64_t[link /reference/cstdint/uint64_t.md] + * std::int8_t[link /reference/cstdint/int8_t.md] + * std::int16_t[link /reference/cstdint/int16_t.md] + * std::int32_t[link /reference/cstdint/int32_t.md] + * std::int64_t[link /reference/cstdint/int64_t.md] * [link /reference/cstdio.md] * [link /reference/cstdlib.md] * [link /reference/ctime.md] From 5142d437111c81e1e47dcee7ce1572515f1b3cd4 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 20 Dec 2024 16:53:47 +0900 Subject: [PATCH 1333/3948] =?UTF-8?q?=E3=82=B0=E3=83=AD=E3=83=BC=E3=83=90?= =?UTF-8?q?=E3=83=AB=E4=BF=AE=E9=A3=BE:=20pair=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index a9f177999b..e0d329a40d 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -300,6 +300,7 @@ * std::forward[link /reference/utility/forward.md] * std::make_pair[link /reference/utility/make_pair.md] * std::pair[link /reference/utility/pair.md] + * pair[link /reference/utility/pair.md] * [link /reference/valarray.md] * std::valarray[link /reference/valarray/valarray.md] * [link /reference/variant.md] From 6f2372b6ebad86b8688436b1f0d39a213f0430d5 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 20 Dec 2024 17:06:37 +0900 Subject: [PATCH 1334/3948] =?UTF-8?q?C++26=E5=AF=BE=E5=BF=9C=E3=81=A8?= =?UTF-8?q?=E3=81=97=E3=81=A6=E3=80=81=E6=9C=AA=E5=88=9D=E6=9C=9F=E5=8C=96?= =?UTF-8?q?=E9=A0=98=E5=9F=9F=E3=82=A2=E3=83=AB=E3=82=B4=E3=83=AA=E3=82=BA?= =?UTF-8?q?=E3=83=A0=E3=82=92constexpr=E5=AF=BE=E5=BF=9C=20(close=20#1389)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/memory/ranges_uninitialized_copy.md | 31 +++++++++++++++++-- .../memory/ranges_uninitialized_copy_n.md | 13 ++++++++ .../ranges_uninitialized_default_construct.md | 17 ++++++++-- ...anges_uninitialized_default_construct_n.md | 12 ++++++- reference/memory/ranges_uninitialized_fill.md | 17 ++++++++-- .../memory/ranges_uninitialized_fill_n.md | 13 +++++++- reference/memory/ranges_uninitialized_move.md | 19 +++++++++++- .../memory/ranges_uninitialized_move_n.md | 13 ++++++++ .../ranges_uninitialized_value_construct.md | 16 ++++++++-- .../ranges_uninitialized_value_construct_n.md | 11 ++++++- reference/memory/uninitialized_copy.md | 7 +++++ reference/memory/uninitialized_copy_n.md | 18 +++++++++-- .../memory/uninitialized_default_construct.md | 19 +++++++++--- .../uninitialized_default_construct_n.md | 11 +++++-- reference/memory/uninitialized_fill.md | 23 +++++++++----- reference/memory/uninitialized_fill_n.md | 7 +++++ reference/memory/uninitialized_move.md | 11 +++++-- reference/memory/uninitialized_move_n.md | 11 +++++-- .../memory/uninitialized_value_construct.md | 18 ++++++++--- .../memory/uninitialized_value_construct_n.md | 10 ++++-- 20 files changed, 257 insertions(+), 40 deletions(-) diff --git a/reference/memory/ranges_uninitialized_copy.md b/reference/memory/ranges_uninitialized_copy.md index 34796e6d2f..6c7e948290 100644 --- a/reference/memory/ranges_uninitialized_copy.md +++ b/reference/memory/ranges_uninitialized_copy.md @@ -13,12 +13,35 @@ namespace std::ranges { no-throw-forward-iterator O, no-throw-sentinel S2> requires constructible_from, iter_reference_t> uninitialized_copy_result - uninitialized_copy(I ifirst, S1 ilast, O ofirst, S2 olast); // (1) C++20 + uninitialized_copy(I ifirst, + S1 ilast, + O ofirst, + S2 olast); // (1) C++20 + template S1, + no-throw-forward-iterator O, no-throw-sentinel S2> + requires constructible_from, iter_reference_t> + constexpr uninitialized_copy_result + uninitialized_copy(I ifirst, + S1 ilast, + O ofirst, + S2 olast); // (1) C++26 template requires constructible_from, range_reference_t> - uninitialized_copy_result, borrowed_iterator_t> - uninitialized_copy(IR&& in_range, OR&& out_range); // (2) C++20 + uninitialized_copy_result< + borrowed_iterator_t, + borrowed_iterator_t + > + uninitialized_copy(IR&& in_range, + OR&& out_range); // (2) C++20 + template + requires constructible_from, range_reference_t> + constexpr uninitialized_copy_result< + borrowed_iterator_t, + borrowed_iterator_t + > + uninitialized_copy(IR&& in_range, + OR&& out_range); // (2) C++26 } ``` * in_out_result[link /reference/algorithm/ranges_in_out_result.md] @@ -152,3 +175,5 @@ int main() ## 参照 - [P9896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) + - C++26から`constexpr`がついた diff --git a/reference/memory/ranges_uninitialized_copy_n.md b/reference/memory/ranges_uninitialized_copy_n.md index a6ab82f5d6..aabbeee860 100644 --- a/reference/memory/ranges_uninitialized_copy_n.md +++ b/reference/memory/ranges_uninitialized_copy_n.md @@ -20,6 +20,17 @@ namespace std::ranges { O ofirst, S olast ); // (1) C++20 + template S> + requires constructible_from, iter_reference_t> + constexpr uninitialized_copy_n_result + uninitialized_copy_n( + I ifirst, + iter_difference_t n, + O ofirst, + S olast + ); // (1) C++26 } ``` * in_out_result[link /reference/algorithm/ranges_in_out_result.md] @@ -131,3 +142,5 @@ int main() ## 参照 - [P9896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) + - C++26から`constexpr`がついた diff --git a/reference/memory/ranges_uninitialized_default_construct.md b/reference/memory/ranges_uninitialized_default_construct.md index 732025acc1..ba4a0f8525 100644 --- a/reference/memory/ranges_uninitialized_default_construct.md +++ b/reference/memory/ranges_uninitialized_default_construct.md @@ -8,11 +8,21 @@ namespace std::ranges { template S> requires default_initializable> - I uninitialized_default_construct(I first, S last); // (1) C++20 + I + uninitialized_default_construct(I first, S last); // (1) C++20 + template S> + requires default_initializable> + constexpr I + uninitialized_default_construct(I first, S last); // (1) C++26 template requires default_initializable> - borrowed_iterator_t uninitialized_default_construct(R&& r); // (2) C++20 + borrowed_iterator_t + uninitialized_default_construct(R&& r); // (2) C++20 + template + requires default_initializable> + constexpr borrowed_iterator_t + uninitialized_default_construct(R&& r); // (2) C++26 } ``` * no-throw-forward-iterator[link no-throw-forward-iterator.md] @@ -135,3 +145,6 @@ int main() ## 参照 - [P9896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) +- [P3369R0 `constexpr` for `uninitialized_default_construct`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3369r0.html) + - 上記2文書で、C++26から`constexpr`がついた diff --git a/reference/memory/ranges_uninitialized_default_construct_n.md b/reference/memory/ranges_uninitialized_default_construct_n.md index 92c66aaa2a..fbc01f39e7 100644 --- a/reference/memory/ranges_uninitialized_default_construct_n.md +++ b/reference/memory/ranges_uninitialized_default_construct_n.md @@ -8,7 +8,14 @@ namespace std::ranges { template requires default_initializable> - I uninitialized_default_construct_n(I first, iter_difference_t n); // (1) C++20 + I + uninitialized_default_construct_n(I first, + iter_difference_t n); // (1) C++20 + template + requires default_initializable> + constexpr I + uninitialized_default_construct_n(I first, + iter_difference_t n); // (1) C++26 } ``` * no-throw-forward-iterator[link no-throw-forward-iterator.md] @@ -105,3 +112,6 @@ int main() ## 参照 - [P9896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) +- [P3369R0 `constexpr` for `uninitialized_default_construct`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3369r0.html) + - 上記2文書で、C++26から`constexpr`がついた diff --git a/reference/memory/ranges_uninitialized_fill.md b/reference/memory/ranges_uninitialized_fill.md index c75b8ac4aa..024335ecdb 100644 --- a/reference/memory/ranges_uninitialized_fill.md +++ b/reference/memory/ranges_uninitialized_fill.md @@ -10,12 +10,23 @@ namespace std::ranges { no-throw-sentinel S, class T> requires constructible_from, const T&> - I uninitialized_fill(I first, S last, const T& x); // (1) C++20 + I uninitialized_fill(I first, S last, const T& x); // (1) C++20 + template S, + class T> + requires constructible_from, const T&> + I uninitialized_fill(I first, S last, const T& x); // (1) C++26 template requires constructible_from, const T&> - borrowed_iterator_t uninitialized_fill(R&& r, const T& x); // (2) C++20 + borrowed_iterator_t + uninitialized_fill(R&& r, const T& x); // (2) C++20 + template + requires constructible_from, const T&> + constexpr borrowed_iterator_t + uninitialized_fill(R&& r, const T& x); // (2) C++26 } ``` * no-throw-forward-iterator[link no-throw-forward-iterator.md] @@ -130,3 +141,5 @@ int main() ## 参照 - [P9896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) + - C++26から`constexpr`がついた diff --git a/reference/memory/ranges_uninitialized_fill_n.md b/reference/memory/ranges_uninitialized_fill_n.md index 77209759b9..ec97fd1818 100644 --- a/reference/memory/ranges_uninitialized_fill_n.md +++ b/reference/memory/ranges_uninitialized_fill_n.md @@ -8,7 +8,16 @@ namespace std::ranges { template requires constructible_from, const T&> - I uninitialized_fill_n(I first, iter_difference_t n, const T& x); // (1) C++20 + I + uninitialized_fill_n(I first, + iter_difference_t n, + const T& x); // (1) C++20 + template + requires constructible_from, const T&> + constexpr I + uninitialized_fill_n(I first, + iter_difference_t n, + const T& x); // (1) C++26 } ``` * no-throw-forward-iterator[link no-throw-forward-iterator.md] @@ -100,3 +109,5 @@ int main() ## 参照 - [P9896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) + - C++26から`constexpr`がついた diff --git a/reference/memory/ranges_uninitialized_move.md b/reference/memory/ranges_uninitialized_move.md index 36604fd06b..1e0e7f4f3e 100644 --- a/reference/memory/ranges_uninitialized_move.md +++ b/reference/memory/ranges_uninitialized_move.md @@ -14,11 +14,26 @@ namespace std::ranges { requires constructible_from, iter_rvalue_reference_t> uninitialized_move_result uninitialized_move(I ifirst, S1 ilast, O ofirst, S2 olast); // (1) C++20 + template S1, + no-throw-forward-iterator O, no-throw-sentinel S2> + requires constructible_from, iter_rvalue_reference_t> + constexpr uninitialized_move_result + uninitialized_move(I ifirst, S1 ilast, O ofirst, S2 olast); // (1) C++26 template requires constructible_from, range_rvalue_reference_t> - uninitialized_move_result, borrowed_iterator_t> + uninitialized_move_result< + borrowed_iterator_t, + borrowed_iterator_t + > uninitialized_move(IR&& in_range, OR&& out_range); // (2) C++20 + template + requires constructible_from, range_rvalue_reference_t> + constexpr uninitialized_move_result< + borrowed_iterator_t, + borrowed_iterator_t + > + uninitialized_move(IR&& in_range, OR&& out_range); // (2) C++26 } ``` * in_out_result[link /reference/algorithm/ranges_in_out_result.md] @@ -154,3 +169,5 @@ int main() ## 参照 - [P9896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) + - C++26から`constexpr`がついた diff --git a/reference/memory/ranges_uninitialized_move_n.md b/reference/memory/ranges_uninitialized_move_n.md index 1107df6b11..72b98746f1 100644 --- a/reference/memory/ranges_uninitialized_move_n.md +++ b/reference/memory/ranges_uninitialized_move_n.md @@ -20,6 +20,17 @@ namespace std::ranges { O ofirst, S olast ); // (1) C++20 + template S> + requires constructible_from, iter_rvalue_reference_t> + constexpr uninitialized_move_n_result + uninitialized_move_n( + I ifirst, + iter_difference_t n, + O ofirst, + S olast + ); // (1) C++26 } ``` * in_out_result[link /reference/algorithm/ranges_in_out_result.md] @@ -132,3 +143,5 @@ int main() ## 参照 - [P9896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) + - C++26から`constexpr`がついた diff --git a/reference/memory/ranges_uninitialized_value_construct.md b/reference/memory/ranges_uninitialized_value_construct.md index 6be80bdb48..f33cd17f76 100644 --- a/reference/memory/ranges_uninitialized_value_construct.md +++ b/reference/memory/ranges_uninitialized_value_construct.md @@ -8,11 +8,21 @@ namespace std::ranges { template S> requires default_initializable> - I uninitialized_value_construct(I first, S last); // (1) C++20 + I + uninitialized_value_construct(I first, S last); // (1) C++20 + template S> + requires default_initializable> + constexpr I + uninitialized_value_construct(I first, S last); // (1) C++26 template requires default_initializable> - borrowed_iterator_t uninitialized_value_construct(R&& r); // (2) C++20 + borrowed_iterator_t + uninitialized_value_construct(R&& r); // (2) C++20 + template + requires default_initializable> + constexpr borrowed_iterator_t + uninitialized_value_construct(R&& r); // (2) C++26 } ``` * no-throw-forward-iterator[link no-throw-forward-iterator.md] @@ -131,3 +141,5 @@ int main() ## 参照 - [P9896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) + - C++26から`constexpr`がついた diff --git a/reference/memory/ranges_uninitialized_value_construct_n.md b/reference/memory/ranges_uninitialized_value_construct_n.md index b550410aec..caac190e3b 100644 --- a/reference/memory/ranges_uninitialized_value_construct_n.md +++ b/reference/memory/ranges_uninitialized_value_construct_n.md @@ -8,7 +8,14 @@ namespace std::ranges { template requires default_initializable> - I uninitialized_value_construct_n(I first, iter_difference_t n); // (1) C++20 + I + uninitialized_value_construct_n(I first, + iter_difference_t n); // (1) C++20 + template + requires default_initializable> + constexpr I + uninitialized_value_construct_n(I first, + iter_difference_t n); // (1) C++26 } ``` * no-throw-forward-iterator[link no-throw-forward-iterator.md] @@ -106,3 +113,5 @@ int main() ## 参照 - [P9896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) + - C++26から`constexpr`がついた diff --git a/reference/memory/uninitialized_copy.md b/reference/memory/uninitialized_copy.md index 0f985d8729..5f3863130f 100644 --- a/reference/memory/uninitialized_copy.md +++ b/reference/memory/uninitialized_copy.md @@ -10,6 +10,11 @@ namespace std { uninitialized_copy(InputIterator first, InputIterator last, ForwardIterator result); // (1) C++03 + template + constexpr ForwardIterator + uninitialized_copy(InputIterator first, + InputIterator last, + ForwardIterator result); // (1) C++26 template ForwardIterator @@ -112,3 +117,5 @@ int main() ## 参照 - [LWG Issue 2433 `uninitialized_copy()`/etc. should tolerate overloaded `operator&`](https://wg21.cmeerw.net/lwg/issue2433) +- [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) + - C++26から`constexpr`がついた diff --git a/reference/memory/uninitialized_copy_n.md b/reference/memory/uninitialized_copy_n.md index 3e5b4fba24..54f76dcd34 100644 --- a/reference/memory/uninitialized_copy_n.md +++ b/reference/memory/uninitialized_copy_n.md @@ -6,13 +6,25 @@ ```cpp namespace std { - template + template ForwardIterator uninitialized_copy_n(InputIterator first, Size n, ForwardIterator result); // (1) C++11 + template + constexpr ForwardIterator + uninitialized_copy_n(InputIterator first, + Size n, + ForwardIterator result); // (1) C++26 - template + template ForwardIterator uninitialized_copy_n(ExecutionPolicy&& exec, InputIterator first, @@ -123,3 +135,5 @@ int main() - [N2569 More STL algorithms](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2569.pdf) - [N2666 More STL algorithms (revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2666.pdf) - [LWG Issue 2433 `uninitialized_copy()`/etc. should tolerate overloaded `operator&`](https://wg21.cmeerw.net/lwg/issue2433) +- [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) + - C++26から`constexpr`がついた diff --git a/reference/memory/uninitialized_default_construct.md b/reference/memory/uninitialized_default_construct.md index bd9133eb88..af0a5a9e2f 100644 --- a/reference/memory/uninitialized_default_construct.md +++ b/reference/memory/uninitialized_default_construct.md @@ -7,13 +7,19 @@ ```cpp namespace std { template - void uninitialized_default_construct(ForwardIterator first, - ForwardIterator last); // (1) + void + uninitialized_default_construct(ForwardIterator first, + ForwardIterator last); // (1) C++17 + template + constexpr void + uninitialized_default_construct(ForwardIterator first, + ForwardIterator last); // (1) C++26 template - void uninitialized_default_construct(ExecutionPolicy&& exec, - ForwardIterator first, - ForwardIterator last); // (2) + void + uninitialized_default_construct(ExecutionPolicy&& exec, + ForwardIterator first, + ForwardIterator last); // (2) C++17 } ``` @@ -110,3 +116,6 @@ int main() ## 参照 - [P0040R3 Extending memory management tools](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0040r3.html) +- [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) +- [P3369R0 `constexpr` for `uninitialized_default_construct`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3369r0.html) + - 上記2文書で、C++26から`constexpr`がついた diff --git a/reference/memory/uninitialized_default_construct_n.md b/reference/memory/uninitialized_default_construct_n.md index c489c0e845..6797859c17 100644 --- a/reference/memory/uninitialized_default_construct_n.md +++ b/reference/memory/uninitialized_default_construct_n.md @@ -9,13 +9,17 @@ namespace std { template ForwardIterator uninitialized_default_construct_n(ForwardIterator first, - Size n); // (1) + Size n); // (1) C++17 + template + constexpr ForwardIterator + uninitialized_default_construct_n(ForwardIterator first, + Size n); // (1) C++26 template ForwardIterator uninitialized_default_construct_n(ExecutionPolicy&& exec, ForwardIterator first, - Size n); // (2) + Size n); // (2) C++17 } ``` @@ -110,3 +114,6 @@ int main() ## 参照 - [P0040R3 Extending memory management tools](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0040r3.html) +- [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) +- [P3369R0 `constexpr` for `uninitialized_default_construct`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3369r0.html) + - 上記2文書で、C++26から`constexpr`がついた diff --git a/reference/memory/uninitialized_fill.md b/reference/memory/uninitialized_fill.md index ec93f3fb3f..2d0d42871a 100644 --- a/reference/memory/uninitialized_fill.md +++ b/reference/memory/uninitialized_fill.md @@ -6,15 +6,22 @@ ```cpp namespace std { template - void uninitialized_fill(ForwardIterator first, - ForwardIterator last, - const T& x); // (1) C++03 + void + uninitialized_fill(ForwardIterator first, + ForwardIterator last, + const T& x); // (1) C++03 + template + constexpr void + uninitialized_fill(ForwardIterator first, + ForwardIterator last, + const T& x); // (1) C++26 template - void uninitialized_fill(ExecutionPolicy&& exec, - ForwardIterator first, - ForwardIterator last, - const T& x); // (2) C++17 + void + uninitialized_fill(ExecutionPolicy&& exec, + ForwardIterator first, + ForwardIterator last, + const T& x); // (2) C++17 } ``` @@ -102,3 +109,5 @@ int main() ## 参照 - [LWG Issue 2433 `uninitialized_copy()`/etc. should tolerate overloaded `operator&`](https://wg21.cmeerw.net/lwg/issue2433) +- [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) + - C++26から`constexpr`がついた diff --git a/reference/memory/uninitialized_fill_n.md b/reference/memory/uninitialized_fill_n.md index 03dd5c8488..4ca220cd2d 100644 --- a/reference/memory/uninitialized_fill_n.md +++ b/reference/memory/uninitialized_fill_n.md @@ -10,6 +10,11 @@ namespace std { uninitialized_fill_n(ForwardIterator first, Size n, const T& x); // (1) C++03 + template + constexpr ForwardIterator + uninitialized_fill_n(ForwardIterator first, + Size n, + const T& x); // (1) C++26 template ForwardIterator @@ -104,3 +109,5 @@ int main() ## 参照 - [LWG Issue 2433 `uninitialized_copy()`/etc. should tolerate overloaded `operator&`](https://wg21.cmeerw.net/lwg/issue2433) +- [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) + - C++26から`constexpr`がついた diff --git a/reference/memory/uninitialized_move.md b/reference/memory/uninitialized_move.md index ac90325b3b..c227b5f967 100644 --- a/reference/memory/uninitialized_move.md +++ b/reference/memory/uninitialized_move.md @@ -10,14 +10,19 @@ namespace std { ForwardIterator uninitialized_move(InputIterator first, InputIterator last, - ForwardIterator result); // (1) + ForwardIterator result); // (1) C++17 + template + constexpr ForwardIterator + uninitialized_move(InputIterator first, + InputIterator last, + ForwardIterator result); // (1) C++26 template ForwardIterator uninitialized_move(ExecutionPolicy&& exec, InputIterator first, InputIterator last, - ForwardIterator result); // (2) + ForwardIterator result); // (2) C++17 } ``` @@ -114,3 +119,5 @@ int main() ## 参照 - [P0040R3 Extending memory management tools](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0040r3.html) +- [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) + - C++26から`constexpr`がついた diff --git a/reference/memory/uninitialized_move_n.md b/reference/memory/uninitialized_move_n.md index 174645b7dd..5f24b9ac81 100644 --- a/reference/memory/uninitialized_move_n.md +++ b/reference/memory/uninitialized_move_n.md @@ -10,14 +10,19 @@ namespace std { pair uninitialized_move_n(InputIterator first, Size n, - ForwardIterator result); // (1) + ForwardIterator result); // (1) C++17 + template + constexpr pair + uninitialized_move_n(InputIterator first, + Size n, + ForwardIterator result); // (1) C++26 template pair uninitialized_move_n(ExecutionPolicy&& exec, InputIterator first, Size n, - ForwardIterator result); // (2) + ForwardIterator result); // (2) C++17 } ``` @@ -115,3 +120,5 @@ int main() ## 参照 - [P0040R3 Extending memory management tools](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0040r3.html) +- [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) + - C++26から`constexpr`がついた diff --git a/reference/memory/uninitialized_value_construct.md b/reference/memory/uninitialized_value_construct.md index e0d530b553..828ae8cb9d 100644 --- a/reference/memory/uninitialized_value_construct.md +++ b/reference/memory/uninitialized_value_construct.md @@ -7,13 +7,19 @@ ```cpp namespace std { template - void uninitialized_value_construct(ForwardIterator first, - ForwardIterator last); // (1) + void + uninitialized_value_construct(ForwardIterator first, + ForwardIterator last); // (1) C++17 + template + constexpr void + uninitialized_value_construct(ForwardIterator first, + ForwardIterator last); // (1) C++26 template - void uninitialized_value_construct(ExecutionPolicy&& exec, - ForwardIterator first, - ForwardIterator last); // (2) + void + uninitialized_value_construct(ExecutionPolicy&& exec, + ForwardIterator first, + ForwardIterator last); // (2) C++17 } ``` @@ -105,3 +111,5 @@ int main() ## 参照 - [P0040R3 Extending memory management tools](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0040r3.html) +- [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) + - C++26から`constexpr`がついた diff --git a/reference/memory/uninitialized_value_construct_n.md b/reference/memory/uninitialized_value_construct_n.md index 2dc93acf2a..3c0dd5590e 100644 --- a/reference/memory/uninitialized_value_construct_n.md +++ b/reference/memory/uninitialized_value_construct_n.md @@ -9,13 +9,17 @@ namespace std { template ForwardIterator uninitialized_value_construct_n(ForwardIterator first, - Size n); // (1) + Size n); // (1) C++17 + template + constexpr ForwardIterator + uninitialized_value_construct_n(ForwardIterator first, + Size n); // (1) C++26 template ForwardIterator uninitialized_value_construct_n(ExecutionPolicy&& exec, ForwardIterator first, - Size n); // (2) + Size n); // (2) C++17 } ``` @@ -105,3 +109,5 @@ int main() ## 参照 - [P0040R3 Extending memory management tools](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0040r3.html) +- [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) + - C++26から`constexpr`がついた From 7d79a5d4c33b37bc78158bb5bd1cb19cc1d4ef47 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 20 Dec 2024 17:46:04 +0900 Subject: [PATCH 1335/3948] =?UTF-8?q?mdspan:=20aligned=5Faccessor=E6=A6=82?= =?UTF-8?q?=E8=A6=81=20P2897R7(#1380)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 3 +- reference/mdspan.md | 2 + reference/mdspan/AccessorPolicy.md | 7 +- reference/mdspan/LayoutMapping.md | 14 ++-- reference/mdspan/LayoutMappingPolicy.md | 14 ++-- reference/mdspan/aligned_accessor.md | 74 +++++++++++++++++++++ reference/memory/is_sufficiently_aligned.md | 2 +- 7 files changed, 101 insertions(+), 15 deletions(-) create mode 100644 reference/mdspan/aligned_accessor.md diff --git a/lang/cpp26.md b/lang/cpp26.md index 0d30d57a6c..c64789f106 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -115,7 +115,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [`std::mdspan`](/reference/mdspan/mdspan.md)から部分ビューを取り出す[`std::submdspan()`](/reference/mdspan/submdspan.md)を追加 - [`std::mdspan`](/reference/mdspan/mdspan.md)に対する[`std::dextents`](/reference/mdspan/extents.md)指定の冗長さを解決する[`std::dims`](/reference/mdspan/extents.md)を追加 - [`std::mdspan`](/reference/mdspan/mdspan.md)のレイアウトとして、[`std::layout_left_padded`](/reference/mdspan/layout_left_padded.md)と[`std::layout_right_padded`](/reference/mdspan/layout_right_padded.md)を追加 -- [``](/reference/mdspan.md)に、ポインタのアライメントをしながらアクセスする[`std::aligned_accessor`](/reference/mdspan/aligned_accessor.md.nolink)を追加 +- [``](/reference/mdspan.md)に、要素アクセスにアライメント保証を与える[`std::aligned_accessor`](/reference/mdspan/aligned_accessor.md)を追加 - [`std::span`](/reference/span/span.md)に、以下を追加 - [`std::initializer_list`](/reference/initializer_list/initializer_list.md)をとるコンストラクタ - インデックスアクセスのための[`at()`](/reference/span/span/at.md)メンバ関数 @@ -357,6 +357,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [``](/reference/typeinfo.md)ヘッダの以下の機能 - [`std::bad_cast`](/reference/typeinfo/bad_cast.md)クラスの`what()`メンバ関数 - [`std::bad_typeid`](/reference/typeinfo/bad_typeid.md)クラスの`what()`メンバ関数 +- [](/reference/memory.md)に、ポインタのアライメントを判定する[`std::is_sufficiently_aligned()`](/reference/memory/is_sufficiently_aligned.md)関数を追加。 ### デバッグ diff --git a/reference/mdspan.md b/reference/mdspan.md index 2ebb35cad6..e0a9728192 100644 --- a/reference/mdspan.md +++ b/reference/mdspan.md @@ -30,6 +30,7 @@ | 名前 | 説明 | 対応バージョン | |------|------|-------| | [`default_accessor`](mdspan/default_accessor.md) | デフォルト要素アクセサ (class template) | C++23 | +| [`aligned_accessor`](mdspan/aligned_accessor.md) | アライメント保証付き要素アクセサ (class template) | C++26 | ## 多次元配列ビュー @@ -65,3 +66,4 @@ - [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) - [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) - [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) +- [P2897R7 `aligned_accessor`: An mdspan accessor expressing pointer over-alignment](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2897r7.html) diff --git a/reference/mdspan/AccessorPolicy.md b/reference/mdspan/AccessorPolicy.md index 9cd8cb4274..d80e24e10b 100644 --- a/reference/mdspan/AccessorPolicy.md +++ b/reference/mdspan/AccessorPolicy.md @@ -32,7 +32,12 @@ AccessorPolicyを満たす型`A`は ## `AccessorPolicy`に該当する型 -- [`default_accessor`](default_accessor.md) +- [``](/reference/mdspan.md)ヘッダ + - C++23 [`default_accessor`](default_accessor.md) + - C++26 [`aligned_accessor`](aligned_accessor.md) +- [``](/reference/linalg.md)ヘッダ + - C++26 [`scaled_accessor`](/reference/linalg/scaled_accessor.md) + - C++26 [`conjugated_accessor`](/reference/linalg/conjugated_accessor.md) ## バージョン diff --git a/reference/mdspan/LayoutMapping.md b/reference/mdspan/LayoutMapping.md index 832809d485..2b4266579b 100644 --- a/reference/mdspan/LayoutMapping.md +++ b/reference/mdspan/LayoutMapping.md @@ -90,12 +90,14 @@ LayoutMappingを満たす型`M`は ## `LayoutMapping`に該当する型 -- [`layout_left::mapping`](layout_left/mapping.md) -- [`layout_right::mapping`](layout_right/mapping.md) -- [`layout_stride::mapping`](layout_stride/mapping.md) -- [`layout_left_padded::mapping`](layout_left_padded/mapping.md) -- [`layout_right_padded::mapping`](layout_right_padded/mapping.md) -- [`layout_blas_packed::mapping`](/reference/linalg/layout_blas_packed/mapping.md) +- [``](/reference/mdspan.md)ヘッダ + - C++23 [`layout_left::mapping`](layout_left/mapping.md) + - C++23 [`layout_right::mapping`](layout_right/mapping.md) + - C++23 [`layout_stride::mapping`](layout_stride/mapping.md) + - C++26 [`layout_left_padded::mapping`](layout_left_padded/mapping.md) + - C++26 [`layout_right_padded::mapping`](layout_right_padded/mapping.md) +- [``](/reference/linalg.md)ヘッダ + - C++26 [`layout_blas_packed::mapping`](/reference/linalg/layout_blas_packed/mapping.md) ## バージョン diff --git a/reference/mdspan/LayoutMappingPolicy.md b/reference/mdspan/LayoutMappingPolicy.md index 30044509a6..b80c40c822 100644 --- a/reference/mdspan/LayoutMappingPolicy.md +++ b/reference/mdspan/LayoutMappingPolicy.md @@ -37,12 +37,14 @@ LayoutMappingPolicyを満たす型`MP`は ## `LayoutMappingPolicy`に該当する型 -- [`layout_left`](layout_left.md) -- [`layout_right`](layout_right.md) -- [`layout_stride`](layout_stride.md) -- [`layout_left_padded`](layout_left_padded.md) -- [`layout_right_padded`](layout_right_padded.md) -- [`linalg::layout_blas_packed`](/reference/linalg/layout_blas_packed.md) +- [``](/reference/mdspan.md)ヘッダ + - C++23 [`layout_left`](layout_left.md) + - C++23 [`layout_right`](layout_right.md) + - C++23 [`layout_stride`](layout_stride.md) + - C++26 [`layout_left_padded`](layout_left_padded.md) + - C++26 [`layout_right_padded`](layout_right_padded.md) +- [``](/reference/linalg.md)ヘッダ + - C++26 [`layout_blas_packed`](/reference/linalg/layout_blas_packed.md) ## バージョン diff --git a/reference/mdspan/aligned_accessor.md b/reference/mdspan/aligned_accessor.md new file mode 100644 index 0000000000..36215f2aa3 --- /dev/null +++ b/reference/mdspan/aligned_accessor.md @@ -0,0 +1,74 @@ +# aligned_accessor +* mdspan[meta header] +* class template[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std { + template + class aligned_accessor; +} +``` + +## 概要 +`aligned_accessor`は、多次元配列ビュー[`mdspan`](mdspan.md)を介した要素アクセスにおいて、メモリアドレスに対するアライメント保証を与える。それ以外の動作は[`default_accessor`](default_accessor.md)と等価である。 + +`ElementType`は抽象クラス型もしくは配列型のいずれでもない完全型であること。 + +`aligned_accessor`は[トリビアルコピー可能](/reference/type_traits/is_trivially_copyable.md)であり、[`semiregular`](/reference/concepts/semiregular.md)のモデルである。 + +`aligned_accessor`は[アクセサポリシー要件](AccessorPolicy.md)を満たす。 + + +## 適格要件 +- `ByteAlignment`は2のべき乗であること +- `ByteAlignment >=` [`alignof`](/lang/cpp11/alignof.md)`(ElementType)` + + +## メンバ変数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `static constexpr size_t byte_alignment` | `ByteAlignment` | C++26 | + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`(constructor)`](aligned_accessor/op_constructor.md.nolink) | コンストラクタ | C++26 | +| `(destructor)` | デストラクタ | C++26 | +| [`operator default_accessor`](aligned_accessor/op_default_accessor.md.nolink) | [`default_accessor`](default_accessor.md)型への変換演算子 | C++26 | +| [`access`](aligned_accessor/access.md.nolink) | 指定オフセット位置にある要素へアクセスする | C++26 | +| [`offset`](aligned_accessor/offset.md.nolink) | 指定オフセット位置のハンドルを取得する | C++26 | + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `offset_policy` | [`default_accessor`](default_accessor.md) | C++26 | +| `element_type` | `ElementType` | C++26 | +| `reference` | `ElementType&` | C++26 | +| `data_handle_type` | `ElementType*` | C++26 | + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`mdspan`](mdspan.md) +- [`default_accessor`](default_accessor.md) + + +## 参照 +- [P2897R7 `aligned_accessor`: An mdspan accessor expressing pointer over-alignment](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2897r7.html) diff --git a/reference/memory/is_sufficiently_aligned.md b/reference/memory/is_sufficiently_aligned.md index 9d65240d28..1aea794fb6 100644 --- a/reference/memory/is_sufficiently_aligned.md +++ b/reference/memory/is_sufficiently_aligned.md @@ -28,7 +28,7 @@ namespace std { ## この機能が必要になった背景・経緯 -この関数テンプレートは[``](/reference/mdspan.md)ヘッダへの[`aligned_accessor`](/reference/mdspan/aligned_accessor.md.nolink)導入に伴って必要とされた機能である。 +この関数テンプレートは[``](/reference/mdspan.md)ヘッダへの[`aligned_accessor`](/reference/mdspan/aligned_accessor.md)導入に伴って必要とされた機能である。 一方で、ポインタ値のアライメント要件を検査するユースケースは一般的と考えられたため、汎用ユーティリティとして``ヘッダに対して機能追加された。 From 91551a0315babe842306e355e2bc7bd5d593fed8 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Thu, 7 Nov 2024 19:45:48 +0900 Subject: [PATCH 1336/3948] =?UTF-8?q?function=5Ftemplate=5Fpage:=20?= =?UTF-8?q?=E6=97=A5=E6=9C=AC=E8=AA=9E=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 規格原文は "The actions performed by the function" だが、action を効果 と訳す場合、perform を行うと訳すと日本語として違和感がある。ここでは " 効果" に合わせて "発生する" と訳すことにする。 --- start_editing/function_template_page.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/start_editing/function_template_page.md b/start_editing/function_template_page.md index b06bb2421f..8b7df686d3 100644 --- a/start_editing/function_template_page.md +++ b/start_editing/function_template_page.md @@ -69,7 +69,7 @@ void definition(); // 関数・変数・定数の宣言を記述します。 ## 効果 -(ここには、関数の内部で行われる効果:effect を記述します。戻り値しかないような関数の場合には、項目を削除してください。) +(ここには、関数の内部で発生する効果:effect を記述します。戻り値しかないような関数の場合には、項目を削除してください。) ## 戻り値 From eaa387530da78dd251ef5a61255e8d917f62204d Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Thu, 7 Nov 2024 19:47:19 +0900 Subject: [PATCH 1337/3948] function_template_page: fix typo --- start_editing/function_template_page.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/start_editing/function_template_page.md b/start_editing/function_template_page.md index 8b7df686d3..075d2dabb9 100644 --- a/start_editing/function_template_page.md +++ b/start_editing/function_template_page.md @@ -85,7 +85,7 @@ void definition(); // 関数・変数・定数の宣言を記述します。 ## 例外 -(ここには、例外送出の有無、例外送出の条件と送出される例外、例外を抄出しない条件、例外送出後の変数・オブジェクトの状態 (例外安全性) などを記述します。`noexcept`なら「投げない」を記述します。規格上とくに明記がなければ、項目を削除してください。) +(ここには、例外送出の有無、例外送出の条件と送出される例外、例外を送出しない条件、例外送出後の変数・オブジェクトの状態 (例外安全性) などを記述します。`noexcept`なら「投げない」を記述します。規格上とくに明記がなければ、項目を削除してください。) ## トリビアルに定義される条件 From 501d680a7ce88e95b02aa80a7c2fd6d9b06c430b Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Thu, 7 Nov 2024 20:40:28 +0900 Subject: [PATCH 1338/3948] =?UTF-8?q?function=5Ftemplate=5Fpage:=20?= =?UTF-8?q?=E8=A1=8D=E5=AD=97=E9=99=A4=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start_editing/function_template_page.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/start_editing/function_template_page.md b/start_editing/function_template_page.md index 075d2dabb9..6f783544a7 100644 --- a/start_editing/function_template_page.md +++ b/start_editing/function_template_page.md @@ -69,7 +69,7 @@ void definition(); // 関数・変数・定数の宣言を記述します。 ## 効果 -(ここには、関数の内部で発生する効果:effect を記述します。戻り値しかないような関数の場合には、項目を削除してください。) +(ここには、関数の内部で発生する効果を記述します。戻り値しかないような関数の場合には、項目を削除してください。) ## 戻り値 From 50ed13154cb3bf09bd0597c59a3e1e0f39935d3f Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Thu, 7 Nov 2024 21:21:16 +0900 Subject: [PATCH 1339/3948] =?UTF-8?q?cpp23/relaxing=5Fsome=5Fconstexpr=5Fr?= =?UTF-8?q?estrictions:=20=E8=A8=B3=E8=AA=9E=E8=A1=A8=E3=81=AB=E5=9F=BA?= =?UTF-8?q?=E3=81=8D=20"=E8=BF=94=E3=82=8A=E5=80=A4"=20=E2=86=92=20"?= =?UTF-8?q?=E6=88=BB=E3=82=8A=E5=80=A4"=20=E3=81=AB=E7=B5=B1=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23/relaxing_some_constexpr_restrictions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/cpp23/relaxing_some_constexpr_restrictions.md b/lang/cpp23/relaxing_some_constexpr_restrictions.md index 0dc0ed1524..cb4d14ba4d 100644 --- a/lang/cpp23/relaxing_some_constexpr_restrictions.md +++ b/lang/cpp23/relaxing_some_constexpr_restrictions.md @@ -96,7 +96,7 @@ void f(std::optional& opt) `constexpr`指定された関数が満たすべき条件を緩和する。 -- 関数の返り値は`literal`型でなくともよい。 +- 関数の戻り値は`literal`型でなくともよい。 - 関数の実引数はどれも`literal`型でなくともよい。 - いかなる実引数が与えられても定数式実行不可能でもよい - いかなる`template`実引数が与えられても定数式実行不可能でもよい @@ -120,4 +120,4 @@ void f(std::optional& opt) ## 参照 -- [P2448R2 - Relaxing some constexpr restrictions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2448r2.html) \ No newline at end of file +- [P2448R2 - Relaxing some constexpr restrictions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2448r2.html) From d779088d7f04f39e22a875e0d7cea3644f51f132 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 7 Nov 2024 19:19:31 +0900 Subject: [PATCH 1340/3948] =?UTF-8?q?GLOBAL=5FDEFINED=5FWORDS:=20=E9=81=A9?= =?UTF-8?q?=E6=A0=BC=E8=A6=81=E4=BB=B6=E3=81=AE=E8=AA=AC=E6=98=8E=E3=82=92?= =?UTF-8?q?=E6=94=B9=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/cpprefjp/site/issues/1273#issuecomment-2461730490 --- GLOBAL_DEFINED_WORDS.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GLOBAL_DEFINED_WORDS.json b/GLOBAL_DEFINED_WORDS.json index b4b6ec7094..f5ae93b8c4 100644 --- a/GLOBAL_DEFINED_WORDS.json +++ b/GLOBAL_DEFINED_WORDS.json @@ -95,7 +95,7 @@ "redirect": "プログラム定義" }, "適格要件": { - "desc": "満たさなければプログラムが不適格となる要件。`static_assert`や関数のdelete宣言などに相当する" + "desc": "満たさなければプログラムが不適格となる要件。この要件は、オーバーロード解決によって選択された関数内での`static_assert`の定数条件式や、関数に対するdelete宣言などで表現できる" }, "テンプレートパラメータ制約": { "desc": "関数であればオーバーロード解決に参加するための条件、それ以外であれば受け付ける型の条件" From be5f53f7869fe2fe3848796d9e9d57431fed54be Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Thu, 7 Nov 2024 19:56:20 +0900 Subject: [PATCH 1341/3948] =?UTF-8?q?GLOBAL=5FDEFINED=5FWORDS:=20=E9=96=A2?= =?UTF-8?q?=E6=95=B0=E3=81=AA=E3=81=A9=E3=81=AE=E6=84=8F=E5=91=B3=E8=AB=96?= =?UTF-8?q?=E8=A6=81=E7=B4=A0=E3=82=92=E9=81=A9=E6=A0=BC=E8=A6=81=E4=BB=B6?= =?UTF-8?q?=E3=81=AE=E4=BB=96=E3=81=AB=E3=82=82=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 効果・同期・結果・戻り値・例外・備考などの一般的な語と同じになるものは、 誤って着色されると混乱の元なので除外している。 --- GLOBAL_DEFINED_WORDS.json | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/GLOBAL_DEFINED_WORDS.json b/GLOBAL_DEFINED_WORDS.json index f5ae93b8c4..a388115d36 100644 --- a/GLOBAL_DEFINED_WORDS.json +++ b/GLOBAL_DEFINED_WORDS.json @@ -94,11 +94,29 @@ "yomi": "ゆーざーていぎ", "redirect": "プログラム定義" }, + "テンプレートパラメータ制約": { + "yomi": "てんぷれーとぱらめーたせいやく", + "desc": "関数等の意味論を構成する要素の1つ。Constraints。関数であればオーバーロード解決に参加するための条件、それ以外であれば受け付ける型の条件" + }, "適格要件": { - "desc": "満たさなければプログラムが不適格となる要件。この要件は、オーバーロード解決によって選択された関数内での`static_assert`の定数条件式や、関数に対するdelete宣言などで表現できる" + "yomi": "てきかくようけん", + "desc": "関数等の意味論を構成する要素の1つ。Mandates。満たさなければプログラムが不適格となる要件。この要件は、オーバーロード解決によって選択された関数内での`static_assert`の定数条件式や、関数に対するdelete宣言などで表現できる" }, - "テンプレートパラメータ制約": { - "desc": "関数であればオーバーロード解決に参加するための条件、それ以外であれば受け付ける型の条件" + "事前条件": { + "yomi": "じぜんじょうけん", + "desc": "関数等の意味論を構成する要素の1つ。Preconditions。関数呼び出し時に満たされていると関数が想定する条件。満たさなければ未定義の動作。契約属性の`[[expects]]`に相当" + }, + "事後条件": { + "yomi": "じごじょうけん", + "desc": "関数等の意味論を構成する要素の1つ。Postconditions。関数を実行後に満たされている条件。契約属性の`[[ensures]]`に相当" + }, + "計算量": { + "yomi": "けいさんりょう", + "desc": "関数等の意味論を構成する要素の1つ。Complexity。関数が使うアルゴリズムの空間計算量・時間計算量" + }, + "エラー条件": { + "yomi": "えらーじょうけん", + "desc": "関数等の意味論を構成する要素の1つ。Error conditions。関数が各エラーコードを返す条件" }, "イテレータ範囲": { "yomi": "いてれーたはんい", @@ -124,9 +142,21 @@ "yomi": "かんぜんがた", "desc": "型のサイズを決定できる型。不完全型ではない型" }, + "オーバーロード": { + "desc": "同名の関数を異なる引数・テンプレート・制約などで複数定義すること。または同名の関数の集合" + }, + "多重定義": { + "yomi": "たじゅうていぎ", + "redirect": "オーバーロード" + }, "オーバーロード解決": { + "yomi": "おーばーろーどかいけつ", "desc": "関数呼び出し時に、同名の関数の中から実際に呼び出す関数を決定する処理。このときの候補になることを、オーバーロード解決に参加するという" }, + "多重定義解決": { + "yomi": "たじゅうていぎかいけつ", + "redirect": "オーバーロード解決" + }, "述語": { "yomi": "じゅつご", "desc": "boolを返す関数・関数オブジェクト。predicate" From 600e91380e5b0badd1b7e05bd75aeba76620fa99 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Thu, 7 Nov 2024 21:18:04 +0900 Subject: [PATCH 1342/3948] =?UTF-8?q?GLOBAL=5FDEFINED=5FWORDS:=20=E3=82=88?= =?UTF-8?q?=E3=82=8A=E4=B8=80=E8=88=AC=E7=9A=84=E3=81=AA=E8=AA=9E=E3=81=A8?= =?UTF-8?q?=E3=81=97=E3=81=A6=E3=80=8C=E6=88=BB=E3=82=8A=E5=80=A4=E3=80=8D?= =?UTF-8?q?=E3=80=8C=E4=BE=8B=E5=A4=96=E3=80=8D=E3=82=82=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_DEFINED_WORDS.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/GLOBAL_DEFINED_WORDS.json b/GLOBAL_DEFINED_WORDS.json index a388115d36..1775e91ef9 100644 --- a/GLOBAL_DEFINED_WORDS.json +++ b/GLOBAL_DEFINED_WORDS.json @@ -164,5 +164,13 @@ "CV修飾": { "yomi": "しーぶいしゅうしょく", "desc": "型をconstおよび・もしくはvolatileで修飾すること" + }, + "戻り値": { + "yomi": "もどりち", + "desc": "関数呼び出し式の評価結果となるオブジェクト・値" + }, + "例外": { + "yomi": "れいがい", + "desc": "問題が発生したときに、現在実行位置を過去に通過・記録した位置に戻し、文脈情報を添えて紐づけられた処理(例外ハンドラー)を呼び出す仕組み。またはその事態" } } From 8e59cd61d2bc8eb01244116be688651d98d47c27 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Fri, 8 Nov 2024 19:41:31 +0900 Subject: [PATCH 1343/3948] =?UTF-8?q?GLOBAL=5FDEFINED=5FWORDS:=20=E3=80=8C?= =?UTF-8?q?=E5=90=8C=E6=9C=9F=E6=93=8D=E4=BD=9C=E3=80=8D=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=E3=83=BB=E8=A6=8B=E5=87=BA=E3=81=97=E3=80=8C=E5=90=8C?= =?UTF-8?q?=E6=9C=9F=E3=80=8D=E3=82=92=E3=80=8C=E5=90=8C=E6=9C=9F=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E3=80=8D=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_DEFINED_WORDS.json | 4 ++++ reference/future/packaged_task/get_future.md | 2 +- reference/future/promise/get_future.md | 2 +- reference/memory/shared_ptr/use_count.md | 2 +- reference/syncstream/basic_syncbuf/emit.md | 2 +- reference/thread/jthread/join.md | 2 +- reference/thread/jthread/op_constructor.md | 4 ++-- reference/thread/this_thread/sleep_for.md | 2 +- reference/thread/this_thread/sleep_until.md | 2 +- reference/thread/this_thread/yield.md | 2 +- reference/thread/thread/join.md | 2 +- reference/thread/thread/op_constructor.md | 2 +- start_editing/function_template_page.md | 4 ++++ 13 files changed, 20 insertions(+), 12 deletions(-) diff --git a/GLOBAL_DEFINED_WORDS.json b/GLOBAL_DEFINED_WORDS.json index 1775e91ef9..e3e754d6c1 100644 --- a/GLOBAL_DEFINED_WORDS.json +++ b/GLOBAL_DEFINED_WORDS.json @@ -165,6 +165,10 @@ "yomi": "しーぶいしゅうしょく", "desc": "型をconstおよび・もしくはvolatileで修飾すること" }, + "同期操作": { + "yomi": "どうきそうさ", + "desc": "マルチスレッド実行時にリソースの所有権に基づいて実行順序を制御する操作" + }, "戻り値": { "yomi": "もどりち", "desc": "関数呼び出し式の評価結果となるオブジェクト・値" diff --git a/reference/future/packaged_task/get_future.md b/reference/future/packaged_task/get_future.md index 3861b43ce1..d5d45da8a0 100644 --- a/reference/future/packaged_task/get_future.md +++ b/reference/future/packaged_task/get_future.md @@ -18,7 +18,7 @@ future get_future(); `*this`と同じ共有状態を持つ[`future`](../future.md)``オブジェクトを返す -## 同期 +## 同期操作 この関数の呼び出しでは、以下の呼び出しとのデータ競合は発生しない (C++20): - [`operator()`](op_call.md) diff --git a/reference/future/promise/get_future.md b/reference/future/promise/get_future.md index dcfd6f9a9d..4eee4e297a 100644 --- a/reference/future/promise/get_future.md +++ b/reference/future/promise/get_future.md @@ -18,7 +18,7 @@ future get_future(); `*this`と同じ共有状態を持つ[`future`](../future.md)``オブジェクトを返す -## 同期 +## 同期操作 この関数の呼び出しでは、以下の呼び出しとのデータ競合は発生しない (C++20): - [`set_value()`](set_value.md) diff --git a/reference/memory/shared_ptr/use_count.md b/reference/memory/shared_ptr/use_count.md index 2d038fc499..7da71ec8ec 100644 --- a/reference/memory/shared_ptr/use_count.md +++ b/reference/memory/shared_ptr/use_count.md @@ -19,7 +19,7 @@ long use_count() const noexcept; `0`が返る場合、`*this`は空の状態となる。 -## 同期 +## 同期操作 しない diff --git a/reference/syncstream/basic_syncbuf/emit.md b/reference/syncstream/basic_syncbuf/emit.md index 602a83711d..9e828bd675 100644 --- a/reference/syncstream/basic_syncbuf/emit.md +++ b/reference/syncstream/basic_syncbuf/emit.md @@ -31,7 +31,7 @@ bool emit(); 成功すると、書き込まれた文字データは空になる。 -## 同期 +## 同期操作 同じストリームバッファオブジェクトに文字を転送するすべての`emit()`呼び出しは、「happens before」関係と一致する全順序で実行されるように見える。各`emit()`呼び出しは、その全順序で後続の`emit()`呼び出しと同期する。実際には、これは下記の備考にあることを意味する。 注:ここでは、happens before 関係は全順序関係になっていると考えられる。また、modification order と矛盾しないとも考えられる。下記の参照を参照のこと。 diff --git a/reference/thread/jthread/join.md b/reference/thread/jthread/join.md index c27b500a36..5602712251 100644 --- a/reference/thread/jthread/join.md +++ b/reference/thread/jthread/join.md @@ -21,7 +21,7 @@ void join(); `this`に関連付けれられたスレッドが完了するまで、この関数を呼び出したスレッドをブロックする。 -## 同期 +## 同期操作 関連付けられたスレッドの完了は、`join()`メンバ関数の正常リターンと **同期する** 。 つまり、「`this`に関連付けられたスレッドT1上で行われる全処理の完了」は、 diff --git a/reference/thread/jthread/op_constructor.md b/reference/thread/jthread/op_constructor.md index f8f6b19ef1..1c7dc5aff0 100644 --- a/reference/thread/jthread/op_constructor.md +++ b/reference/thread/jthread/op_constructor.md @@ -62,13 +62,13 @@ jthread(jthread&&) noexcept; // (4) C++20 - この呼び出しでの戻り値は無視される。この関数呼び出しが例外を送出する場合、呼び出し元スレッドで[`std::terminate`](/reference/exception/terminate.md)が呼び出される -## 同期 +## 同期操作 - (2) : コンストラクタ呼び出しの完了は、`f`のコピーの呼び出し開始と同期する 新しいスレッドを生成し、[`INVOKE`](/reference/concepts/Invoke.md)`(DECAY_COPY(`[`std::forward`](/reference/utility/forward.md)`(f)), DECAY_COPY(`[`std::forward`](/reference/utility/forward.md)`(args))...)`を実行する。ただし`DECAY_COPY`は同コンストラクタを呼び出したスレッド上にて評価される。また`f`のコピーの戻り値は無視される。 - `DECAY_COPY(x)`は `template typename std::decay::type decay_copy(T&& v) { return` [`std::forward`](/reference/utility/forward.md)`(v); }` と定義される。おおよそ、`x`が配列型なら先頭要素へのポインタ、`x`が関数型ならその関数ポインタ、`x`がコピーコンストラクト可能な型なら`x`からコピーされたオブジェクト、`x`がムーブコンストラクト可能な型なら`x`からムーブされたオブジェクトとなる。 -## 同期 +## 同期操作 - (2) : 同コンストラクタの呼び出し完了は、fのコピーの呼び出し開始と**同期する**。つまり、「コンストラクタ呼び出し側スレッドT0でのコンストラクタ呼び出し完了」は、「新しいスレッド`T1`上での`f`のコピーの呼び出し開始」よりも**前に発生する**。 diff --git a/reference/thread/this_thread/sleep_for.md b/reference/thread/this_thread/sleep_for.md index efa54dac7f..b6df0ab1fc 100644 --- a/reference/thread/this_thread/sleep_for.md +++ b/reference/thread/this_thread/sleep_for.md @@ -23,7 +23,7 @@ namespace this_thread { 指定した相対時間 **以上** の時間が経過すると、現スレッドのブロックが解除されて後続処理の実行が開始される。なお、タイマーの精度は処理系依存。 -## 同期 +## 同期操作 特に他操作と同期しない。 diff --git a/reference/thread/this_thread/sleep_until.md b/reference/thread/this_thread/sleep_until.md index e5164a7d41..a68bba0722 100644 --- a/reference/thread/this_thread/sleep_until.md +++ b/reference/thread/this_thread/sleep_until.md @@ -26,7 +26,7 @@ namespace this_thread { 引数 `abs_time`で指定した絶対時間を経過するまで現在のスレッド、すなわちこの関数を呼び出したスレッド自身をブロックする。指定した絶対時間 **以上** の時刻になると、現スレッドのブロックが解除されて後続処理の実行が開始される。なお、タイマーの精度は処理系依存。 -## 同期 +## 同期操作 特に他操作と同期しない。 diff --git a/reference/thread/this_thread/yield.md b/reference/thread/this_thread/yield.md index 5411308db8..76c7e836b2 100644 --- a/reference/thread/this_thread/yield.md +++ b/reference/thread/this_thread/yield.md @@ -19,7 +19,7 @@ namespace this_thread { 処理系に対して、再スケジューリングを行う機会を与える。たとえばオペレーティングシステムのスケジューラに対して、現スレッドに割り当てられたタイムスライスの破棄を指示し、他に実行可能なスレッドがあればそのスレッドに実行機会を与える。 -## 同期 +## 同期操作 特に他操作と同期しない。 diff --git a/reference/thread/thread/join.md b/reference/thread/thread/join.md index a04a16e414..9f8497d18a 100644 --- a/reference/thread/thread/join.md +++ b/reference/thread/thread/join.md @@ -21,7 +21,7 @@ void join(); `this`に関連付けれられたスレッドが完了するまで、この関数を呼び出したスレッドをブロックする。 -## 同期 +## 同期操作 関連付けられたスレッドの完了は、`join()`メンバ関数の正常リターンと **同期する** 。 つまり、「`this`に関連付けられたスレッドT1上で行われる全処理の完了」は、 diff --git a/reference/thread/thread/op_constructor.md b/reference/thread/thread/op_constructor.md index d4ca422012..56b8645108 100644 --- a/reference/thread/thread/op_constructor.md +++ b/reference/thread/thread/op_constructor.md @@ -35,7 +35,7 @@ thread(thread&&) noexcept; // (4) もし[`INVOKE`](/reference/concepts/Invoke.md)`(DECAY_COPY(`[`std::forward`](/reference/utility/forward.md)`(f)), DECAY_COPY(`[`std::forward`](/reference/utility/forward.md)`(args))...)`呼び出しからcatchされない例外が送出された場合、[`std::terminate()`](/reference/exception/terminate.md)が呼び出されてプログラムは異常終了する。 -## 同期 +## 同期操作 - (2) : 同コンストラクタの呼び出し完了は、fのコピーの呼び出し開始と**同期する**。つまり、「コンストラクタ呼び出し側スレッドT0でのコンストラクタ呼び出し完了」は、「新しいスレッド`T1`上での`f`のコピーの呼び出し開始」よりも**前に発生する**。 diff --git a/start_editing/function_template_page.md b/start_editing/function_template_page.md index 6f783544a7..8f9836f900 100644 --- a/start_editing/function_template_page.md +++ b/start_editing/function_template_page.md @@ -72,6 +72,10 @@ void definition(); // 関数・変数・定数の宣言を記述します。 (ここには、関数の内部で発生する効果を記述します。戻り値しかないような関数の場合には、項目を削除してください。) +## 同期操作 +(ここには、関数の同期操作について記述します。規格の *Synchronization* 要素に対応します。対応要素がない場合は、項目を削除してください。) + + ## 戻り値 (ここには、関数の戻り値を記述します。戻り値の型が`void`の場合は、「なし」と記述してください。) From 10ebad2df2fb64cb688845ef3092827c82227cf4 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 20 Dec 2024 18:07:05 +0900 Subject: [PATCH 1344/3948] lang/cpp26: fix markup --- lang/cpp26.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp26.md b/lang/cpp26.md index c64789f106..b68667b533 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -357,7 +357,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [``](/reference/typeinfo.md)ヘッダの以下の機能 - [`std::bad_cast`](/reference/typeinfo/bad_cast.md)クラスの`what()`メンバ関数 - [`std::bad_typeid`](/reference/typeinfo/bad_typeid.md)クラスの`what()`メンバ関数 -- [](/reference/memory.md)に、ポインタのアライメントを判定する[`std::is_sufficiently_aligned()`](/reference/memory/is_sufficiently_aligned.md)関数を追加。 +- [``](/reference/memory.md)に、ポインタのアライメントを判定する[`std::is_sufficiently_aligned()`](/reference/memory/is_sufficiently_aligned.md)関数を追加。 ### デバッグ From f579e2f40a142eaac665da4ac2eb6a8886751df9 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 20 Dec 2024 22:39:30 +0900 Subject: [PATCH 1345/3948] Added new documentation for P2169R4 --- lang/cpp26.md | 2 +- lang/cpp26/nice_placeholder_with_no_name.md | 31 +++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 lang/cpp26/nice_placeholder_with_no_name.md diff --git a/lang/cpp26.md b/lang/cpp26.md index b68667b533..cf47bb2c93 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -12,7 +12,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| | [`std::initializer_list`の配列を静的ストレージに配置する](/lang/cpp26/static_storage_for_braced_initializers.md.nolink) | `std::vector v = {1, 2, 3};`のような初期化で初期化子リストを静的ストレージに配置することで無駄なコピーをなくす | -| [宣言のみで使用しない変数の名前として`_`をサポート](/lang/cpp26/nice_placeholder_with_no_name.md.nolink) | 変数名`_`は暗黙で`[[maybe_unused]]`が指定される | +| [宣言のみで使用しない変数の名前として`_`をサポート](/lang/cpp26/nice_placeholder_with_no_name.md) | 変数名`_`は暗黙で`[[maybe_unused]]`が指定される | | [非推奨となっていた列挙型の算術変換を削除](/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md) | C++20から非推奨となっていた列挙値への算術演算で算術型に暗黙変換される仕様を削除 | | [不完全型へのポインタに対する`delete`を不適格とする](/lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md.nolink) | 未定義動作を引き起こす操作をコンパイルエラーとする | | [返却された左辺値から暗黙変換された一時オブジェクトが参照に束縛されることを禁止する](/lang/cpp26/disallow_binding_a_returned_glvalue_to_a_temporary.md.nolink) | 寿命切れの変数によって引き起こされるバグを防止する | diff --git a/lang/cpp26/nice_placeholder_with_no_name.md b/lang/cpp26/nice_placeholder_with_no_name.md new file mode 100644 index 0000000000..ae927c59bc --- /dev/null +++ b/lang/cpp26/nice_placeholder_with_no_name.md @@ -0,0 +1,31 @@ +# 宣言のみで使用しない変数の名前として_をサポート [P2169R4] +* cpp26[meta cpp] + + + +このページはC++26に採用される見込みの言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 + + + +## 概要 +C++17で採用された、`[[maybe_unused]]`属性を変数名`_`の場合、自動的につける。 + +```cpp +int main() { + [[maybe_unused]]int hardNamingVariable; + // gccやclangの場合、-Wallオプションをつけると、 + // 変数が未使用だった場合、警告が出力される。 + // [[maybe_unused]]属性によって、これを抑制することができた。 + // しかし、今後は、変数名が_であれば、自動的にその属性が適用されるようになる。 + int _; + // このコードを-Wallでコンパイルしても、警告は表示されない。 +} +``` + +## 関連項目 +- [\[\[maybe_unused\]\]属性 \[P0212R1\]](/lang/cpp17/maybe_unused.html) + +## 参照 +- [P2169R4 A nice placeholder with no name](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2169r4.pdf) \ No newline at end of file From 11b63ee0a37a019e0ecb4b8a59ea87442cd1f32b Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 20 Dec 2024 22:43:52 +0900 Subject: [PATCH 1346/3948] fixed nolink --- implementation-status.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/implementation-status.md b/implementation-status.md index 506dd0382a..f963d5675d 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -291,7 +291,7 @@ | 言語機能 | 説明 | [GCC][gcc] | [Clang][clang] | [ICX][icx] | [MSVC][msvc] | |----------|------|------------|----------------|------------|--------------| | P2752R3: [`std::initializer_list`の配列を静的ストレージに配置する](/lang/cpp26/static_storage_for_braced_initializers.md.nolink) | `std::vector v = {1, 2, 3};`のような初期化で初期化子リストを静的ストレージに配置することで無駄なコピーをなくす | 14 | | | | -| P2169R4: [宣言のみで使用しない変数の名前として`_`をサポート](/lang/cpp26/nice_placeholder_with_no_name.md.nolink) | 変数名`_`は暗黙で`[[maybe_unused]]`が指定される | 14 | 18 | | | +| P2169R4: [宣言のみで使用しない変数の名前として`_`をサポート](/lang/cpp26/nice_placeholder_with_no_name.md) | 変数名`_`は暗黙で`[[maybe_unused]]`が指定される | 14 | 18 | | | | P1854R4: [文字列リテラルの文字エンコーディング失敗を不適格とする](/lang/cpp26/making_non-encodable_string_literals_ill-formed.md.nolink) | 文字列リテラルのエンコーディング時に文字表現が失われる場合にコンパイルエラーにする | 14 | 14 | | | | P2361R6: [コンパイル時にのみ使用される文字列の扱いを明確化](/lang/cpp26/unevaluated_strings.md.nolink) | `static_assert`や`[[deprecated]]`などで使用されるコンパイル時の文字列について、文字コードの指定を禁止し、実行時エンコーディングが行われないことを規定 | 14 | 18 | | | | P2552R3: [属性の無視性を見直し](/lang/cpp26/on_the_ignorability_of_standard_attributes.md.nolink) | 構文として適格な属性のみを無視できるようにし、そうでない属性の使用を不適格とする | | | | | From 5090f497c16cf452bf573fa154a08118815d0618 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 20 Dec 2024 22:46:53 +0900 Subject: [PATCH 1347/3948] fixed wrong inner links --- lang/cpp26/nice_placeholder_with_no_name.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp26/nice_placeholder_with_no_name.md b/lang/cpp26/nice_placeholder_with_no_name.md index ae927c59bc..58c78f94b3 100644 --- a/lang/cpp26/nice_placeholder_with_no_name.md +++ b/lang/cpp26/nice_placeholder_with_no_name.md @@ -25,7 +25,7 @@ int main() { ``` ## 関連項目 -- [\[\[maybe_unused\]\]属性 \[P0212R1\]](/lang/cpp17/maybe_unused.html) +- [\[\[maybe_unused\]\]属性 \[P0212R1\]](/lang/cpp17/maybe_unused.md) ## 参照 - [P2169R4 A nice placeholder with no name](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2169r4.pdf) \ No newline at end of file From ca8e5abf9231f5998c771b8bc023a1618afad864 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Fri, 20 Dec 2024 16:09:11 +0000 Subject: [PATCH 1348/3948] create page P2558R2 --- implementation-status.md | 2 +- lang/cpp26.md | 2 +- ..._graveaccent_to_the_basic_character_set.md | 24 +++++++++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md diff --git a/implementation-status.md b/implementation-status.md index f963d5675d..0a12e1736b 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -297,7 +297,7 @@ | P2552R3: [属性の無視性を見直し](/lang/cpp26/on_the_ignorability_of_standard_attributes.md.nolink) | 構文として適格な属性のみを無視できるようにし、そうでない属性の使用を不適格とする | | | | | | P2738R1: [定数式での`void*`からポインタ型へのキャストを許可](/lang/cpp26/constexpr_cast_from_voidptr.md.nolink) | 型消去のために`void*`からポインタ型へのキャストを許可する | 14 | 17 | | | | P2741R3: [`static_assert`の診断メッセージにユーザーが生成した文字列の指定を許可](/lang/cpp26/user-generated_static_assert_messages.md) | `constexpr`な`S.size()`と`S.data()`メンバ関数をもつオブジェクトをコンパイル時文字列として指定できるようにする | 14 | 17 | | | -| P2558R2: [基本文字集合に@、$、\`を追加](/lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md.nolink) | C言語との互換性のためにこれらの文字を基本文字集合に追加 | | Yes | | | +| P2558R2: [基本文字集合に@、$、\`を追加](/lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md) | C言語との互換性のためにこれらの文字を基本文字集合に追加 | | Yes | | | | P2662R3: [パラメータパックへのインデックスアクセスを許可](/lang/cpp26/pack_indexing.md.nolink) | 可変引数テンプレートのパラメータパックに添字アクセスできるようにする | | | | | | P2864R2: [非推奨となっていた列挙値から算術型への暗黙変換を削除](/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md) | C++20から非推奨となっていた列挙値への算術演算で算術型に暗黙変換される仕様を削除 | 14 | 18 | | | | P2748R5: [返却された左辺値から暗黙変換された一時オブジェクトが参照に束縛されることを禁止する](/lang/cpp26/disallow_binding_a_returned_glvalue_to_a_temporary.md.nolink) | 寿命切れの変数によって引き起こされるバグを防止する | 14 | 19 | | | diff --git a/lang/cpp26.md b/lang/cpp26.md index cf47bb2c93..1a883ed421 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -77,7 +77,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| -| [基本文字集合に@、$、\`を追加](/lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md.nolink) | C言語との互換性のためにこれらの文字を基本文字集合に追加 | +| [基本文字集合に@、$、\`を追加](/lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md) | C言語との互換性のためにこれらの文字を基本文字集合に追加 | ### モジュール diff --git a/lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md b/lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md new file mode 100644 index 0000000000..68620668a1 --- /dev/null +++ b/lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md @@ -0,0 +1,24 @@ +# 基本文字集合に@、$、\`を追加[P2558R2] +* cpp26[meta cpp] + +このページはC++26に採用される見込みの言語機能の変更を解説しています。 +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 + +## 概要 +基本文字集合に +$ (U+0024) +@ (U+0040) +` (U+0060) +の3文字を加える。 +CではC23で追加され、それに合わせるようにC++でも同様の変更を提案している。 +これにより、これらの文字を構文として使用でき、コードの可読性や他言語絵の移植性が向上する。 +```cpp +#include +#define STR(x) #x +int main() +{ + printf("%s", STR(\u0060)); // U+0060 は ` GRAVE ACCENT +} +``` +## 参照 +- [P2558R2 Add @, $, and ` to the basic character set](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2558r2.html) \ No newline at end of file From a56ee8c394cf4cab93c6d6374516e96425491200 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Fri, 20 Dec 2024 22:39:50 +0000 Subject: [PATCH 1349/3948] Fixed P2558R2 --- ...n_dollar_graveaccent_to_the_basic_character_set.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md b/lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md index 68620668a1..ab03ca3a90 100644 --- a/lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md +++ b/lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md @@ -5,14 +5,15 @@ のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 ## 概要 -基本文字集合に -$ (U+0024) -@ (U+0040) -` (U+0060) +基本文字集合に +$ (U+0024) +@ (U+0040) +` (U+0060) の3文字を加える。 CではC23で追加され、それに合わせるようにC++でも同様の変更を提案している。 これにより、これらの文字を構文として使用でき、コードの可読性や他言語絵の移植性が向上する。 -```cpp + +```cpp example #include #define STR(x) #x int main() From e2a8fddece1a43ddb712256bb0d9a375fe76fd7b Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Fri, 20 Dec 2024 22:52:11 +0000 Subject: [PATCH 1350/3948] Fixed typo --- ...d_atsign_dollar_graveaccent_to_the_basic_character_set.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md b/lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md index ab03ca3a90..b82dd2b91c 100644 --- a/lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md +++ b/lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md @@ -1,9 +1,11 @@ # 基本文字集合に@、$、\`を追加[P2558R2] * cpp26[meta cpp] + このページはC++26に採用される見込みの言語機能の変更を解説しています。 のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 + ## 概要 基本文字集合に $ (U+0024) @@ -11,7 +13,7 @@ $ (U+0024) ` (U+0060) の3文字を加える。 CではC23で追加され、それに合わせるようにC++でも同様の変更を提案している。 -これにより、これらの文字を構文として使用でき、コードの可読性や他言語絵の移植性が向上する。 +これにより、これらの文字を構文として使用でき、コードの可読性や他言語への移植性が向上する。 ```cpp example #include @@ -21,5 +23,6 @@ int main() printf("%s", STR(\u0060)); // U+0060 は ` GRAVE ACCENT } ``` + ## 参照 - [P2558R2 Add @, $, and ` to the basic character set](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2558r2.html) \ No newline at end of file From c4eb917353ab79d71e0f5baaef9c26818cf00079 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sat, 21 Dec 2024 08:03:09 +0900 Subject: [PATCH 1351/3948] Updata cpp26/add MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 内容の修正 --- ...d_atsign_dollar_graveaccent_to_the_basic_character_set.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md b/lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md index b82dd2b91c..774867ea94 100644 --- a/lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md +++ b/lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md @@ -13,7 +13,8 @@ $ (U+0024) ` (U+0060) の3文字を加える。 CではC23で追加され、それに合わせるようにC++でも同様の変更を提案している。 -これにより、これらの文字を構文として使用でき、コードの可読性や他言語への移植性が向上する。 +これにより、これらの文字を構文として使用でき、コードの可読性や他言語への移植性が向上する。 +なお、変更が加えられた場合、この3文字は下記のようなUnicode形式での表示が不可能になる可能性がある。 ```cpp example #include @@ -25,4 +26,4 @@ int main() ``` ## 参照 -- [P2558R2 Add @, $, and ` to the basic character set](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2558r2.html) \ No newline at end of file +- [P2558R2 Add @, $, and ` to the basic character set](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2558r2.html) From fbc96a22b493f091760f6d09565f6fff1f34effd Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sat, 21 Dec 2024 09:39:21 +0900 Subject: [PATCH 1352/3948] =?UTF-8?q?C++26=E5=AF=BE=E5=BF=9C=E3=81=A8?= =?UTF-8?q?=E3=81=97=E3=81=A6=E3=80=81atomic=E3=81=AFCV=E4=BF=AE=E9=A3=BE?= =?UTF-8?q?=E3=81=95=E3=82=8C=E3=81=9F=E5=9E=8B=E3=82=92=E7=A6=81=E6=AD=A2?= =?UTF-8?q?=E3=80=81atomic=5Fref=E3=81=AFCV=E4=BF=AE=E9=A3=BE=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=81=9F=E5=9E=8B=E3=82=92=E5=8F=97=E3=81=91=E5=8F=96?= =?UTF-8?q?=E3=82=8C=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=97=E3=81=9F?= =?UTF-8?q?=20(close=20#1388)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 3 +- reference/atomic/atomic.md | 13 +++- reference/atomic/atomic_ref.md | 14 +++-- .../atomic_ref/compare_exchange_strong.md | 43 +++++++++---- .../atomic_ref/compare_exchange_weak.md | 43 +++++++++---- reference/atomic/atomic_ref/exchange.md | 15 ++++- reference/atomic/atomic_ref/fetch_add.md | 16 ++++- reference/atomic/atomic_ref/fetch_and.md | 16 ++++- reference/atomic/atomic_ref/fetch_or.md | 16 ++++- reference/atomic/atomic_ref/fetch_sub.md | 16 ++++- reference/atomic/atomic_ref/fetch_xor.md | 16 ++++- reference/atomic/atomic_ref/load.md | 10 ++- reference/atomic/atomic_ref/notify_all.md | 6 ++ reference/atomic/atomic_ref/notify_one.md | 6 ++ reference/atomic/atomic_ref/op_and_assign.md | 11 +++- reference/atomic/atomic_ref/op_assign.md | 11 +++- reference/atomic/atomic_ref/op_decrement.md | 7 +++ reference/atomic/atomic_ref/op_increment.md | 7 +++ .../atomic/atomic_ref/op_minus_assign.md | 11 +++- reference/atomic/atomic_ref/op_or_assign.md | 11 +++- reference/atomic/atomic_ref/op_plus_assign.md | 11 +++- reference/atomic/atomic_ref/op_t.md | 7 +++ reference/atomic/atomic_ref/op_value_type.md | 61 +++++++++++++++++++ reference/atomic/atomic_ref/op_xor_assign.md | 7 ++- reference/atomic/atomic_ref/store.md | 17 +++++- reference/atomic/atomic_ref/wait.md | 17 +++++- 26 files changed, 354 insertions(+), 57 deletions(-) create mode 100644 reference/atomic/atomic_ref/op_value_type.md diff --git a/lang/cpp26.md b/lang/cpp26.md index 1a883ed421..a6d7388a4b 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -226,7 +226,8 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [``](/reference/execution.md)に汎用的な非同期実行を管理するフレームワークを追加 - [`std::atomic`](/reference/atomic/atomic.md)オブジェクトに対する2つの値の最大値・最小値を取得する関数として、メンバ関数[`fetch_max()`](/reference/atomic/atomic/fetch_max.md.nolink)と[`fetch_min()`](/reference/atomic/atomic/fetch_min.md.nolink)、非メンバ関数として[`std::atomic_fetch_max`](/reference/atomic/atomic_fetch_max.md.nolink)、[`std::atomic_fetch_max_explicit`](/reference/atomic/atomic_fetch_max_explicit.md.nolink)、[`std::atomic_fetch_min`](/reference/atomic/atomic_fetch_min.md.nolink)、[`std::atomic_fetch_min_explicit`](/reference/atomic/atomic_fetch_min_explicit.md.nolink)を追加 - [`std::atomic_ref`](/reference/atomic/atomic_ref.md)クラスに、参照するオブジェクトのアドレスを取得する[`address()`](/reference/atomic/atomic_ref/address.md.nolink)メンバ関数を追加 -- [`std::atomic`](/reference/atomic/atomic.md)クラスと[`std::atomic_ref`](/reference/atomic/atomic_ref.md)クラスのテンプレートパラメータとして、CV修飾された型を受け取れるようにした (内部でCV修飾が外される) +- [`std::atomic`](/reference/atomic/atomic.md)クラスのテンプレートパラメータとしてCV修飾された型を禁止 +- [`std::atomic_ref`](/reference/atomic/atomic_ref.md)クラスのテンプレートパラメータとして、CV修飾された型を受け取れるようにした (内部でCV修飾が外される) - [``](/reference/atomic.md)ライブラリのアトミック操作を`constexpr`対応 diff --git a/reference/atomic/atomic.md b/reference/atomic/atomic.md index 2e403736be..d9c2b8b10a 100644 --- a/reference/atomic/atomic.md +++ b/reference/atomic/atomic.md @@ -30,8 +30,15 @@ namespace std { ## テンプレートパラメータ制約 - 型`T`は[コピー構築可能](/reference/concepts/copy_constructible.md)かつ[コピー代入可能](/reference/type_traits/is_copy_assignable.md)であること -- [`is_trivially_copyable_v`](/reference/type_traits/is_trivially_copyable.md)` &&` [`is_copy_constructible_v`](/reference/type_traits/is_copy_constructible.md)` &&` [`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)` &&` [`is_copy_assignable_v`](/reference/type_traits/is_copy_assignable.md)` &&` [`is_move_assignable_v`](/reference/type_traits/is_move_assignable.md)``が`false`である場合、プログラムは不適格となる - - 簡潔に言うと、`memcpy()`可能な型であること +- 以下のいずれかが`false`である場合、プログラムは不適格となる: + - [`is_trivially_copyable_v`](/reference/type_traits/is_trivially_copyable.md)`` + - 簡潔に言うと、`memcpy()`可能な型であること + - [`is_copy_constructible_v`](/reference/type_traits/is_copy_constructible.md)`` + - [`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)`` + - [`is_copy_assignable_v`](/reference/type_traits/is_copy_assignable.md)`` + - [`is_move_assignable_v`](/reference/type_traits/is_move_assignable.md)`` + - C++26: [`same_as`](/reference/concepts/same_as.md)`>` + - CV修飾された`T`は許可しない ## 別名型 @@ -314,3 +321,5 @@ int main() - C++20での`atomic_signed_lock_free`と`atomic_unsigned_lock_free`の追加 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で拡張浮動小数点数型もテンプレート引数として指定することが許可された +- [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) + - C++26でCV修飾されたテンプレートパラメータが明確に禁止された diff --git a/reference/atomic/atomic_ref.md b/reference/atomic/atomic_ref.md index 0d53ab2c1e..156f23ca79 100644 --- a/reference/atomic/atomic_ref.md +++ b/reference/atomic/atomic_ref.md @@ -28,14 +28,17 @@ namespace std { `atomic_ref`クラステンプレートは型`T`の値をコピーではなく参照で保持するため、`atomic_ref`オブジェクトより先に参照先の変数の寿命が尽きてはならない。 - (1) : プライマリテンプレート。宣言のみ -- (2) : 整数型に対する特殊化 -- (3) : (CV修飾されていない) 浮動小数点数型に対する特殊化 +- (2) : 整数型に対する特殊化 (`bool`以外) +- (3) : 浮動小数点数型に対する特殊化 - (C++23) : 拡張浮動小数点数型を含む - (4) : 任意の型のポインタに対する特殊化 +C++26から、これらの特殊化はCV修飾された型に対しても行われるようになった。 + ## テンプレートパラメータ制約 - 型`T`は[`is_trivially_copyable_v`](/reference/type_traits/is_trivially_copyable.md)` == true`であること +- C++26: `is_always_lock_free`が`false`かつ[`is_volatile_v`](/reference/type_traits/is_volatile.md)が`true`である場合、プログラムは不適格となる ## メンバ関数 @@ -48,7 +51,8 @@ namespace std { | [`is_lock_free`](atomic_ref/is_lock_free.md) | オブジェクトがロックフリーに振る舞えるかを判定する | C++20 | | [`store`](atomic_ref/store.md) | 値を書き込む | C++20 | | [`load`](atomic_ref/load.md) | 値を読み込む | C++20 | -| [`operator T`](atomic_ref/op_t.md) | 型Tへの変換演算子 | C++20 | +| [`operator T`](atomic_ref/op_t.md) | 型`T`への変換演算子 | C++20 (C++26で`value_type`に変更) | +| [`operator value_type`](atomic_ref/op_value_type.md) | 型`value_type`への変換演算子 | C++26 | | [`exchange`](atomic_ref/exchange.md) | 値を入れ替える | C++20 | | [`compare_exchange_weak`](atomic_ref/compare_exchange_weak.md) | 弱い比較で値を入れ替える | C++20 | | [`compare_exchange_strong`](atomic_ref/compare_exchange_strong.md) | 強い比較で値を入れ替える | C++20 | @@ -60,7 +64,7 @@ namespace std { ### 共通メンバ型 | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| `value_type` | 要素型となるテンプレートパラメータの型`T` | C++20 | +| `value_type` | 要素型となるテンプレートパラメータの型。
C++20: `T`
C++26: [`remove_cv_t`](/reference/type_traits/remove_cv.md)`` | C++20 | ### 共通メンバ定数 @@ -193,3 +197,5 @@ int main() - [P0019R8 Atomic Ref](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0019r8.html) - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で拡張浮動小数点数型もテンプレート引数として指定することが許可された +- [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) + - C++26でCV修飾されたテンプレート引数を受け取れるようになった diff --git a/reference/atomic/atomic_ref/compare_exchange_strong.md b/reference/atomic/atomic_ref/compare_exchange_strong.md index 1b43fc541d..e128bf2a8d 100644 --- a/reference/atomic/atomic_ref/compare_exchange_strong.md +++ b/reference/atomic/atomic_ref/compare_exchange_strong.md @@ -6,16 +6,29 @@ * cpp20[meta cpp] ```cpp -bool compare_exchange_strong(T& expected, - T desired, - memory_order success, - memory_order failure - ) const noexcept; // (1) - -bool compare_exchange_strong(T& expected, - T desired, - memory_order order = memory_order_seq_cst - ) const noexcept; // (2) +bool + compare_exchange_strong(T& expected, + T desired, + memory_order success, + memory_order failure + ) const noexcept; // (1) C++20 +bool + compare_exchange_strong(value_type& expected, + value_type desired, + memory_order success, + memory_order failure + ) const noexcept; // (1) C++26 + +bool + compare_exchange_strong(T& expected, + T desired, + memory_order order = memory_order_seq_cst + ) const noexcept; // (2) C++20 +bool + compare_exchange_strong(value_type& expected, + value_type desired, + memory_order order = memory_order_seq_cst + ) const noexcept; // (2) C++26 ``` * memory_order[link /reference/atomic/memory_order.md] * memory_order_seq_cst[link /reference/atomic/memory_order.md] @@ -27,7 +40,11 @@ bool compare_exchange_strong(T& expected, - (2) : 現在の値と`expected`が等値である場合に、現在の値を`desired`で置き換え、そうでなければ`expected`を現在の値で置き換える。どちらの値置き換えの場合でも`order`メモリオーダーが使用される -## 要件 +## テンプレートパラメータ制約 +- C++26 : [`is_const_v`](/reference/type_traits/is_const.md)``が`false`であること + + +## 事前条件 - `failure`が[`memory_order_release`](/reference/atomic/memory_order.md), [`memory_order_acq_rel`](/reference/atomic/memory_order.md)ではないこと @@ -153,3 +170,7 @@ true - [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) + - C++26でCV修飾されたテンプレート引数を受け取れるようになった diff --git a/reference/atomic/atomic_ref/compare_exchange_weak.md b/reference/atomic/atomic_ref/compare_exchange_weak.md index 27498f6a64..51c6f84ad7 100644 --- a/reference/atomic/atomic_ref/compare_exchange_weak.md +++ b/reference/atomic/atomic_ref/compare_exchange_weak.md @@ -6,16 +6,29 @@ * cpp20[meta cpp] ```cpp -bool compare_exchange_weak(T& expected, - T desired, - memory_order success, - memory_order failure - ) const noexcept; // (1) C++20 - -bool compare_exchange_weak(T& expected, - T desired, - memory_order order = memory_order_seq_cst - ) const noexcept; // (2) C++20 +bool + compare_exchange_weak(T& expected, + T desired, + memory_order success, + memory_order failure + ) const noexcept; // (1) C++20 +bool + compare_exchange_weak(value_type& expected, + value_type desired, + memory_order success, + memory_order failure + ) const noexcept; // (1) C++26 + +bool + compare_exchange_weak(T& expected, + T desired, + memory_order order = memory_order_seq_cst + ) const noexcept; // (2) C++20 +bool + compare_exchange_weak(value_type& expected, + value_type desired, + memory_order order = memory_order_seq_cst + ) const noexcept; // (2) C++26 ``` * memory_order[link /reference/atomic/memory_order.md] * memory_order_seq_cst[link /reference/atomic/memory_order.md] @@ -27,7 +40,11 @@ bool compare_exchange_weak(T& expected, - (2) : 現在の値と`expected`が等値である場合に、現在の値を`desired`で置き換え、そうでなければ`expected`を現在の値で置き換える。どちらの値置き換えの場合でも`order`メモリオーダーが使用される -## 要件 +## テンプレートパラメータ制約 +- C++26 : [`is_const_v`](/reference/type_traits/is_const.md)``が`false`であること + + +## 事前条件 - (1) : `failure`が[`memory_order_release`](/reference/atomic/memory_order.md), [`memory_order_acq_rel`](/reference/atomic/memory_order.md)ではないこと @@ -183,3 +200,7 @@ int main() - [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) + - C++26でCV修飾されたテンプレート引数を受け取れるようになった diff --git a/reference/atomic/atomic_ref/exchange.md b/reference/atomic/atomic_ref/exchange.md index f2df38029d..c604462cb5 100644 --- a/reference/atomic/atomic_ref/exchange.md +++ b/reference/atomic/atomic_ref/exchange.md @@ -6,7 +6,12 @@ * cpp20[meta cpp] ```cpp -T exchange(T desired, memory_order order = memory_order_seq_cst) const noexcept; +T + exchange(T desired, + memory_order order = memory_order_seq_cst) const noexcept; // (1) C++20 +value_type + exchange(value_type desired, + memory_order order = memory_order_seq_cst) const noexcept; // (1) C++26 ``` * memory_order[link /reference/atomic/memory_order.md] * memory_order_seq_cst[link /reference/atomic/memory_order.md] @@ -15,6 +20,10 @@ T exchange(T desired, memory_order order = memory_order_seq_cst) const noexcept; 値を入れ替える +## テンプレートパラメータ制約 +- C++26 : [`is_const_v`](/reference/type_traits/is_const.md)``が`false`であること + + ## 効果 `order`で指定されたメモリオーダーにしたがって、`*this`が参照する値を`desired`でアトミックに置き換える @@ -60,3 +69,7 @@ replaced 1 by 2 - [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) + - C++26でCV修飾されたテンプレート引数を受け取れるようになった diff --git a/reference/atomic/atomic_ref/fetch_add.md b/reference/atomic/atomic_ref/fetch_add.md index 96d219f99d..34baa1f68b 100644 --- a/reference/atomic/atomic_ref/fetch_add.md +++ b/reference/atomic/atomic_ref/fetch_add.md @@ -6,7 +6,12 @@ * cpp20[meta cpp] ```cpp -T fetch_add(difference_type operand, memory_order order = memory_order_seq_cst) const noexcept; +T + fetch_add(difference_type operand, + memory_order order = memory_order_seq_cst) const noexcept; // (1) C++20 +value_type + fetch_add(difference_type operand, + memory_order order = memory_order_seq_cst) const noexcept; // (1) C++26 ``` * memory_order[link /reference/atomic/memory_order.md] * memory_order_seq_cst[link /reference/atomic/memory_order.md] @@ -15,8 +20,9 @@ T fetch_add(difference_type operand, memory_order order = memory_order_seq_cst) 加算を行う -## 要件 -- `std::atomic_ref`の場合、型`T`がオブジェクト型であること。型`T`が`void*`や関数ポインタであってはならない (C++17) +## テンプレートパラメータ制約 +- `std::atomic_ref`の場合、型`T`がオブジェクト型であること。型`T`が`void*`や関数ポインタであってはならない +- C++26 : [`is_const_v`](/reference/type_traits/is_const.md)``が`false`であること ## 効果 @@ -134,3 +140,7 @@ int main() - [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) + - C++26でCV修飾されたテンプレート引数を受け取れるようになった diff --git a/reference/atomic/atomic_ref/fetch_and.md b/reference/atomic/atomic_ref/fetch_and.md index a3da5c1be8..18abb329b2 100644 --- a/reference/atomic/atomic_ref/fetch_and.md +++ b/reference/atomic/atomic_ref/fetch_and.md @@ -6,7 +6,12 @@ * cpp20[meta cpp] ```cpp -T fetch_and(T operand, memory_order order = memory_order_seq_cst) const noexcept; +T + fetch_and(T operand, + memory_order order = memory_order_seq_cst) const noexcept; // (1) C++20 +value_type + fetch_and(value_type operand, + memory_order order = memory_order_seq_cst) const noexcept; // (1) C++26 ``` * memory_order[link /reference/atomic/memory_order.md] * memory_order_seq_cst[link /reference/atomic/memory_order.md] @@ -15,8 +20,9 @@ T fetch_and(T operand, memory_order order = memory_order_seq_cst) const noexcept AND演算を行う -## 要件 -- `std::atomic_ref`の場合、型`T`がオブジェクト型であること。型`T`が`void*`や関数ポインタであってはならない (C++17) +## テンプレートパラメータ制約 +- `std::atomic_ref`の場合、型`T`がオブジェクト型であること。型`T`が`void*`や関数ポインタであってはならない +- C++26 : [`is_const_v`](/reference/type_traits/is_const.md)``が`false`であること ## 効果 @@ -104,3 +110,7 @@ int main() - [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) + - C++26でCV修飾されたテンプレート引数を受け取れるようになった diff --git a/reference/atomic/atomic_ref/fetch_or.md b/reference/atomic/atomic_ref/fetch_or.md index 389e3c6edb..95c27b4e80 100644 --- a/reference/atomic/atomic_ref/fetch_or.md +++ b/reference/atomic/atomic_ref/fetch_or.md @@ -6,7 +6,12 @@ * cpp20[meta cpp] ```cpp -T fetch_or(T operand, memory_order order = memory_order_seq_cst) const noexcept; +T + fetch_or(T operand, + memory_order order = memory_order_seq_cst) const noexcept; // (1) C++20 +value_type + fetch_or(value_type operand, + memory_order order = memory_order_seq_cst) const noexcept; // (1) C++26 ``` * memory_order[link /reference/atomic/memory_order.md] * memory_order_seq_cst[link /reference/atomic/memory_order.md] @@ -15,8 +20,9 @@ T fetch_or(T operand, memory_order order = memory_order_seq_cst) const noexcept; OR演算を行う -## 要件 -- `std::atomic_ref`の場合、型`T`がオブジェクト型であること。型`T`が`void*`や関数ポインタであってはならない (C++17) +## テンプレートパラメータ制約 +- `std::atomic_ref`の場合、型`T`がオブジェクト型であること。型`T`が`void*`や関数ポインタであってはならない +- C++26 : [`is_const_v`](/reference/type_traits/is_const.md)``が`false`であること ## 効果 @@ -104,3 +110,7 @@ int main() - [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) + - C++26でCV修飾されたテンプレート引数を受け取れるようになった diff --git a/reference/atomic/atomic_ref/fetch_sub.md b/reference/atomic/atomic_ref/fetch_sub.md index dda6cbccec..2c26bd65b2 100644 --- a/reference/atomic/atomic_ref/fetch_sub.md +++ b/reference/atomic/atomic_ref/fetch_sub.md @@ -6,7 +6,12 @@ * cpp20[meta cpp] ```cpp -T fetch_sub(difference_type operand, memory_order order = memory_order_seq_cst) const noexcept; +T + fetch_sub(difference_type operand, + memory_order order = memory_order_seq_cst) const noexcept; // (1) C++20 +value_type + fetch_sub(difference_type operand, + memory_order order = memory_order_seq_cst) const noexcept; // (1) C++26 ``` * memory_order[link /reference/atomic/memory_order.md] * memory_order_seq_cst[link /reference/atomic/memory_order.md] @@ -15,8 +20,9 @@ T fetch_sub(difference_type operand, memory_order order = memory_order_seq_cst) 減算を行う -## 要件 -- `std::atomic_ref`の場合、型`T`がオブジェクト型であること。型`T`が`void*`や関数ポインタであってはならない (C++17) +## テンプレートパラメータ制約 +- `std::atomic_ref`の場合、型`T`がオブジェクト型であること。型`T`が`void*`や関数ポインタであってはならない +- C++26 : [`is_const_v`](/reference/type_traits/is_const.md)``が`false`であること ## 効果 @@ -129,3 +135,7 @@ int main() - [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) + - C++26でCV修飾されたテンプレート引数を受け取れるようになった diff --git a/reference/atomic/atomic_ref/fetch_xor.md b/reference/atomic/atomic_ref/fetch_xor.md index c2e1acf6a5..4b1a3ad019 100644 --- a/reference/atomic/atomic_ref/fetch_xor.md +++ b/reference/atomic/atomic_ref/fetch_xor.md @@ -6,7 +6,12 @@ * cpp20[meta cpp] ```cpp -T fetch_xor(T operand, memory_order order = memory_order_seq_cst) const noexcept; +T + fetch_xor(T operand, + memory_order order = memory_order_seq_cst) const noexcept; // (1) C++20 +value_type + fetch_xor(value_type operand, + memory_order order = memory_order_seq_cst) const noexcept; // (1) C++26 ``` * memory_order[link /reference/atomic/memory_order.md] * memory_order_seq_cst[link /reference/atomic/memory_order.md] @@ -15,8 +20,9 @@ T fetch_xor(T operand, memory_order order = memory_order_seq_cst) const noexcept XOR演算を行う -## 要件 -- `std::atomic_ref`の場合、型`T`がオブジェクト型であること。型`T`が`void*`や関数ポインタであってはならない (C++17) +## テンプレートパラメータ制約 +- `std::atomic_ref`の場合、型`T`がオブジェクト型であること。型`T`が`void*`や関数ポインタであってはならない +- C++26 : [`is_const_v`](/reference/type_traits/is_const.md)``が`false`であること ## 効果 @@ -106,3 +112,7 @@ int main() - [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) + - C++26でCV修飾されたテンプレート引数を受け取れるようになった diff --git a/reference/atomic/atomic_ref/load.md b/reference/atomic/atomic_ref/load.md index 3342a19d2d..908c730943 100644 --- a/reference/atomic/atomic_ref/load.md +++ b/reference/atomic/atomic_ref/load.md @@ -6,7 +6,8 @@ * cpp20[meta cpp] ```cpp -T load(memory_order order = memory_order_seq_cst) const noexcept; +T load(memory_order order = memory_order_seq_cst) const noexcept; // (1) C++20 +value_type load(memory_order order = memory_order_seq_cst) const noexcept; // (1) C++26 ``` * memory_order[link /reference/atomic/memory_order.md] * memory_order_seq_cst[link /reference/atomic/memory_order.md] @@ -15,7 +16,7 @@ T load(memory_order order = memory_order_seq_cst) const noexcept; 値を読み込む -## 要件 +## 事前条件 `order`が以下のメモリオーダーではないこと: - [`memory_order_release`](/reference/atomic/memory_order.md) @@ -70,3 +71,8 @@ int main() - [Clang](/implementation.md#clang): 9.0 [mark noimpl] - [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) + - C++26でCV修飾されたテンプレート引数を受け取れるようになった diff --git a/reference/atomic/atomic_ref/notify_all.md b/reference/atomic/atomic_ref/notify_all.md index bf7fdf66fd..d4d439e449 100644 --- a/reference/atomic/atomic_ref/notify_all.md +++ b/reference/atomic/atomic_ref/notify_all.md @@ -15,6 +15,10 @@ void notify_all() const noexcept; この関数は、[`wait()`](wait.md)関数によるブロッキング待機を解除する。 +## テンプレートパラメータ制約 +- C++26 : [`is_const_v`](/reference/type_traits/is_const.md)``が`false`であること + + ## 効果 起床待機している全てのアトミックオブジェクトの待機を解除する @@ -83,3 +87,5 @@ int main() - [P1643R1 Add wait/notify to `atomic_ref`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1643r1.html) - [P1960R0 NB Comment Changes Reviewed by SG1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1960r0.html) - 宣言に`const`を追加 +- [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) + - C++26でCV修飾されたテンプレート引数を受け取れるようになった diff --git a/reference/atomic/atomic_ref/notify_one.md b/reference/atomic/atomic_ref/notify_one.md index a6ffed6069..2737886ee6 100644 --- a/reference/atomic/atomic_ref/notify_one.md +++ b/reference/atomic/atomic_ref/notify_one.md @@ -15,6 +15,10 @@ void notify_one() const noexcept; この関数は、[`wait()`](wait.md)関数によるブロッキング待機を解除する。 +## テンプレートパラメータ制約 +- C++26 : [`is_const_v`](/reference/type_traits/is_const.md)``が`false`であること + + ## 効果 起床待機している少なくともひとつのアトミックオブジェクトの待機を解除する @@ -110,3 +114,5 @@ int main() - [P1643R1 Add wait/notify to `atomic_ref`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1643r1.html) - [P1960R0 NB Comment Changes Reviewed by SG1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1960r0.html) - 宣言に`const`を追加 +- [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) + - C++26でCV修飾されたテンプレート引数を受け取れるようになった diff --git a/reference/atomic/atomic_ref/op_and_assign.md b/reference/atomic/atomic_ref/op_and_assign.md index fc1dd2f4cc..3da3120144 100644 --- a/reference/atomic/atomic_ref/op_and_assign.md +++ b/reference/atomic/atomic_ref/op_and_assign.md @@ -6,13 +6,18 @@ * cpp20[meta cpp] ```cpp -T operator&=(T operand) const noexcept; +T operator&=(T operand) const noexcept; // (1) C++20 +value_type operator&=(value_type operand) const noexcept; // (1) C++26 ``` ## 概要 AND演算を行う +## テンプレートパラメータ制約 +- C++26 : [`is_const_v`](/reference/type_traits/is_const.md)``が`false`であること + + ## 戻り値 以下と等価の式により、演算結果の値が返る: @@ -97,3 +102,7 @@ int main() - [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) + - C++26でCV修飾されたテンプレート引数を受け取れるようになった diff --git a/reference/atomic/atomic_ref/op_assign.md b/reference/atomic/atomic_ref/op_assign.md index 9c9dab5d98..dbe5d5c105 100644 --- a/reference/atomic/atomic_ref/op_assign.md +++ b/reference/atomic/atomic_ref/op_assign.md @@ -6,17 +6,22 @@ * cpp20[meta cpp] ```cpp -T operator=(T desired) const noexcept; +T operator=(T desired) const noexcept; // (1) C++20 +value_type operator=(value_type desired) const noexcept; // (1) C++26 ``` ## 概要 値を書き込む +## テンプレートパラメータ制約 +- C++26 : [`is_const_v`](/reference/type_traits/is_const.md)``が`false`であること + + ## 効果 以下と等価: -``` +```cpp store(desired); return desired; ``` @@ -68,3 +73,5 @@ int main() ## 参照 - [P1960R0 NB Comment Changes Reviewed by SG1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1960r0.html) - 宣言に`const`を追加 +- [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) + - C++26でCV修飾されたテンプレート引数を受け取れるようになった diff --git a/reference/atomic/atomic_ref/op_decrement.md b/reference/atomic/atomic_ref/op_decrement.md index d10929d182..6554c4771c 100644 --- a/reference/atomic/atomic_ref/op_decrement.md +++ b/reference/atomic/atomic_ref/op_decrement.md @@ -17,6 +17,11 @@ value_type operator--(int) const noexcept; - (2) : 後置デクリメント +## テンプレートパラメータ制約 +- ポインタに対する特殊化 + - C++26 : [`is_const_v`](/reference/type_traits/is_const.md)``が`false`であること + + ## 戻り値 以下と等価: @@ -99,3 +104,5 @@ int main() ## 参照 - [P1960R0 NB Comment Changes Reviewed by SG1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1960r0.html) - 戻り値の型を`T`から`value_type`に変更 +- [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) + - C++26でCV修飾されたテンプレート引数を受け取れるようになった diff --git a/reference/atomic/atomic_ref/op_increment.md b/reference/atomic/atomic_ref/op_increment.md index a89ae165c1..d870ebb252 100644 --- a/reference/atomic/atomic_ref/op_increment.md +++ b/reference/atomic/atomic_ref/op_increment.md @@ -17,6 +17,11 @@ value_type operator++(int) const noexcept; // (2) C++20 - (2) : 後置インクリメント +## テンプレートパラメータ制約 +- ポインタに対する特殊化 + - C++26 : [`is_const_v`](/reference/type_traits/is_const.md)``が`false`であること + + ## 戻り値 以下と等価: @@ -101,3 +106,5 @@ int main() ## 参照 - [P1960R0 NB Comment Changes Reviewed by SG1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1960r0.html) - 戻り値の型を`T`から`value_type`に変更 +- [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) + - C++26でCV修飾されたテンプレート引数を受け取れるようになった diff --git a/reference/atomic/atomic_ref/op_minus_assign.md b/reference/atomic/atomic_ref/op_minus_assign.md index 7b5db25e7f..3811861b89 100644 --- a/reference/atomic/atomic_ref/op_minus_assign.md +++ b/reference/atomic/atomic_ref/op_minus_assign.md @@ -6,13 +6,18 @@ * cpp20[meta cpp] ```cpp -T operator-=(T operand) const noexcept; +T operator-=(T operand) const noexcept; // (1) C++20 +value_type operator-=(value_type operand) const noexcept; // (1) C++26 ``` ## 概要 減算を行う +## テンプレートパラメータ制約 +- C++26 : [`is_const_v`](/reference/type_traits/is_const.md)``が`false`であること + + ## 戻り値 以下と等価の式により、演算結果の値が返る: @@ -124,3 +129,7 @@ int main() - [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) + - C++26でCV修飾されたテンプレート引数を受け取れるようになった diff --git a/reference/atomic/atomic_ref/op_or_assign.md b/reference/atomic/atomic_ref/op_or_assign.md index a25af24d46..20f5be116a 100644 --- a/reference/atomic/atomic_ref/op_or_assign.md +++ b/reference/atomic/atomic_ref/op_or_assign.md @@ -6,13 +6,18 @@ * cpp20[meta cpp] ```cpp -T operator|=(T operand) const noexcept; +T operator|=(T operand) const noexcept; // (1) C++20 +value_type operator|=(value_type operand) const noexcept; // (1) C++26 ``` ## 概要 OR演算を行う +## テンプレートパラメータ制約 +- C++26 : [`is_const_v`](/reference/type_traits/is_const.md)``が`false`であること + + ## 戻り値 以下と等価の式により、演算結果の値が返る: @@ -98,3 +103,7 @@ int main() - [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) + - C++26でCV修飾されたテンプレート引数を受け取れるようになった diff --git a/reference/atomic/atomic_ref/op_plus_assign.md b/reference/atomic/atomic_ref/op_plus_assign.md index a0ce8474e9..44a48256e3 100644 --- a/reference/atomic/atomic_ref/op_plus_assign.md +++ b/reference/atomic/atomic_ref/op_plus_assign.md @@ -6,13 +6,18 @@ * cpp20[meta cpp] ```cpp -T operator+=(T operand) const noexcept; +T operator+=(T operand) const noexcept; // (1) C++20 +value_type operator+=(value_type operand) const noexcept; // (1) C++26 ``` ## 概要 加算を行う +## テンプレートパラメータ制約 +- C++26 : [`is_const_v`](/reference/type_traits/is_const.md)``が`false`であること + + ## 戻り値 以下と等価の式により、演算結果の値が返る: @@ -123,3 +128,7 @@ int main() - [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) + - C++26でCV修飾されたテンプレート引数を受け取れるようになった diff --git a/reference/atomic/atomic_ref/op_t.md b/reference/atomic/atomic_ref/op_t.md index 67b200fa17..e644d4f20b 100644 --- a/reference/atomic/atomic_ref/op_t.md +++ b/reference/atomic/atomic_ref/op_t.md @@ -4,6 +4,9 @@ * atomic_ref[meta class] * function[meta id-type] * cpp20[meta cpp] +* cpp26removed[meta cpp] + +この関数はC++26で、CV修飾された型を受け取れるようにするため、型`T`への変換演算子から[型`value_type`への変換演算子](op_value_type.md)に変更された。 ```cpp operator T() const noexcept; @@ -51,3 +54,7 @@ int main() - [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) + - C++26でCV修飾されたテンプレート引数を受け取れるようになった diff --git a/reference/atomic/atomic_ref/op_value_type.md b/reference/atomic/atomic_ref/op_value_type.md new file mode 100644 index 0000000000..f2fa124bed --- /dev/null +++ b/reference/atomic/atomic_ref/op_value_type.md @@ -0,0 +1,61 @@ +# operator value_type +* atomic[meta header] +* std[meta namespace] +* atomic_ref[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +operator value_type() const noexcept; +``` + +## 概要 +型`value_type`への暗黙の型変換 + + +## 戻り値 +[`load()`](load.md) + + +## 例外 +投げない + + +## 備考 +- C++26で、CV修飾された型を受け取れるようにするため、型`T`への変換演算子から、型`value_type`への変換演算子に変更された + + +## 例 +```cpp example +#include +#include + +int main() +{ + int value = 1; + std::atomic_ref x{value}; + + int n = x; + std::cout << n << std::endl; +} +``` +* int n = x;[color ff0000] + +### 出力 +``` +1 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) + - C++26でCV修飾されたテンプレート引数を受け取れるようになった diff --git a/reference/atomic/atomic_ref/op_xor_assign.md b/reference/atomic/atomic_ref/op_xor_assign.md index daf5a5a2b7..4e0e2f47d4 100644 --- a/reference/atomic/atomic_ref/op_xor_assign.md +++ b/reference/atomic/atomic_ref/op_xor_assign.md @@ -6,7 +6,8 @@ * cpp20[meta cpp] ```cpp -T operator^=(T operand) const noexcept; +T operator^=(T operand) const noexcept; // (1) C++20 +value_type operator^=(value_type operand) const noexcept; // (1) C++26 ``` ## 概要 @@ -98,3 +99,7 @@ int main() - [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) + - C++26でCV修飾されたテンプレート引数を受け取れるようになった diff --git a/reference/atomic/atomic_ref/store.md b/reference/atomic/atomic_ref/store.md index 9d993cf4d2..696c7eaa2f 100644 --- a/reference/atomic/atomic_ref/store.md +++ b/reference/atomic/atomic_ref/store.md @@ -6,7 +6,10 @@ * cpp20[meta cpp] ```cpp -void store(T desired, memory_order order = memory_order_seq_cst) const noexcept; +void store(T desired, + memory_order order = memory_order_seq_cst) const noexcept; // (1) C++20 +void store(value_type desired, + memory_order order = memory_order_seq_cst) const noexcept; // (1) C++26 ``` * memory_order[link /reference/atomic/memory_order.md] * memory_order_seq_cst[link /reference/atomic/memory_order.md] @@ -15,7 +18,11 @@ void store(T desired, memory_order order = memory_order_seq_cst) const noexcept; 値を書き込む -## 要件 +## テンプレートパラメータ制約 +- C++26 : [`is_const_v`](/reference/type_traits/is_const.md)``が`false`であること + + +## 事前条件 `order`が以下のメモリオーダーではないこと: - [`memory_order_consume`](/reference/atomic/memory_order.md) @@ -24,6 +31,7 @@ void store(T desired, memory_order order = memory_order_seq_cst) const noexcept; ## 効果 `order`で指定されたメモリオーダーにしたがって、現在の値を`desired`でアトミックに置き換える。 + この関数は、戻り値のない[`exchange()`](exchange.md)と見なせる。 @@ -71,3 +79,8 @@ int main() - [Clang](/implementation.md#clang): 9.0 [mark noimpl] - [GCC](/implementation.md#gcc): 10.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) + - C++26でCV修飾されたテンプレート引数を受け取れるようになった diff --git a/reference/atomic/atomic_ref/wait.md b/reference/atomic/atomic_ref/wait.md index a546c61b64..13e7203b65 100644 --- a/reference/atomic/atomic_ref/wait.md +++ b/reference/atomic/atomic_ref/wait.md @@ -6,7 +6,12 @@ * cpp20[meta cpp] ```cpp -void wait(T old, memory_order order = memory_order::seq_cst) const noexcept; +void + wait(T old, + memory_order order = memory_order::seq_cst) const noexcept; // (1) C++20 +void + wait(value_type old, + memory_order order = memory_order::seq_cst) const noexcept; // (1) C++26 ``` * memory_order[link /reference/atomic/memory_order.md] @@ -18,6 +23,14 @@ void wait(T old, memory_order order = memory_order::seq_cst) const noexcept; この関数によってブロッキング待機をしたら、対応する起床関数である[`notify_one()`](notify_one.md)、[`notify_all()`](notify_all.md)によってブロッキング待機を解除できる。 +## 事前条件 +- `order`が以下のいずれかであること: + - [`memory_order::relaxed`](/reference/atomic/memory_order.md) + - [`memory_order::consume`](/reference/atomic/memory_order.md) + - [`memory_order::acquire`](/reference/atomic/memory_order.md) + - [`memory_order::seq_cst`](/reference/atomic/memory_order.md) + + ## 効果 - 以下のステップを順に繰り返し実行する: - [`load`](load.md)`(order)`によって現在の値を読み込み、`old`と値を比較する @@ -119,3 +132,5 @@ int main() - [P0514R4 Efficient concurrent waiting for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0514r4.pdf) - [ogiroux/atomic_wait - Sample implementation of C++20 atomic_wait/notify](https://github.com/ogiroux/atomic_wait) - [P1643R1 Add wait/notify to `atomic_ref`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1643r1.html) +- [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) + - C++26でCV修飾されたテンプレート引数を受け取れるようになった From d67d018e6b43cbd65b4292f7facb135135e26a67 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sat, 21 Dec 2024 10:43:29 +0900 Subject: [PATCH 1353/3948] =?UTF-8?q?C++26=20=E5=AE=A3=E8=A8=80=E3=81=AE?= =?UTF-8?q?=E3=81=BF=E3=81=A7=E4=BD=BF=E7=94=A8=E3=81=97=E3=81=AA=E3=81=84?= =?UTF-8?q?=E5=A4=89=E6=95=B0=E3=81=AE=E5=90=8D=E5=89=8D=E3=81=A8=E3=81=97?= =?UTF-8?q?=E3=81=A6=5F=E3=82=92=E3=82=B5=E3=83=9D=E3=83=BC=E3=83=88=20:?= =?UTF-8?q?=20=E3=83=A6=E3=83=BC=E3=82=B9=E3=82=B1=E3=83=BC=E3=82=B9?= =?UTF-8?q?=E3=81=A8=E4=BB=95=E6=A7=98=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26/nice_placeholder_with_no_name.md | 70 +++++++++++++++++++-- 1 file changed, 65 insertions(+), 5 deletions(-) diff --git a/lang/cpp26/nice_placeholder_with_no_name.md b/lang/cpp26/nice_placeholder_with_no_name.md index 58c78f94b3..cb813a6b45 100644 --- a/lang/cpp26/nice_placeholder_with_no_name.md +++ b/lang/cpp26/nice_placeholder_with_no_name.md @@ -10,22 +10,82 @@ ## 概要 -C++17で採用された、`[[maybe_unused]]`属性を変数名`_`の場合、自動的につける。 +C++26では、宣言だけして使用しない変数として、変数名`_`を特別扱いする。 + +宣言だけして使用しない変数が必要な状況としては、以下のようなミューテックスのロック取得や、構造化束縛などがある: + +```cpp +// C++23まで +std::mutex mux; +std::tuple f(); + +void f() { + std::lock_gaurd guard{mux}; // デストラクタでの自動解放だけしたいのでguard変数はとくに使わない + auto [a, b, no_use] = f(); // 構造化束縛した一部の変数は使わない +} +``` + +C++26では、変数名として`_`は[`[[maybe_unused]]`属性](/lang/cpp17/maybe_unused.md)が付加される、と規定される。 + +```cpp +// C++26 +std::mutex mux; +std::tuple f(); + +void f() { + std::lock_gaurd _{mux}; // OK + auto [a, b, _] = f(); // OK +} +``` + + +## 仕様 +- 変数名`_`は、「名前非依存 (name independent) の宣言」という名称で扱われ、実装への推奨としては `[[maybe_unused]]`属性が自動的に付加され、使用されなくても警告は出力されない: + ```cpp + auto _ = foo(); // [[maybe_unused]] auto _ = f(); と等価 + ``` + +- 変数名`_`は、以下の状況では再宣言できる: + - 自動変数 + - 非静的メンバ変数 + - 構造化束縛 + - ラムダ式のキャプチャでの導入子 +- 再宣言された変数`_`を使用した場合、プログラムは不適格となる ```cpp +namespace a { + auto _ = f(); // OK: "_"変数の宣言 + auto _ = f(); // エラー! "_"はこの名前空間ですでに定義されている +} + +void f() { + auto _ = 42; // OK: "_"変数の宣言 + auto _ = 0; // OK: "_"変数の再宣言 + { + auto _ = 1; // OK: シャドウイング + assert(_ == 1); // OK + } + assert( _ == 42 ); // 不適格: 再宣言されたプレースホルダー変数の使用 +} +``` + + +## 例 +```cpp example int main() { - [[maybe_unused]]int hardNamingVariable; // gccやclangの場合、-Wallオプションをつけると、 // 変数が未使用だった場合、警告が出力される。 // [[maybe_unused]]属性によって、これを抑制することができた。 + [[maybe_unused]] int hardNamingVariable; + // しかし、今後は、変数名が_であれば、自動的にその属性が適用されるようになる。 + // 以下のコードを-Wallでコンパイルしても、警告は表示されない。 int _; - // このコードを-Wallでコンパイルしても、警告は表示されない。 } ``` ## 関連項目 -- [\[\[maybe_unused\]\]属性 \[P0212R1\]](/lang/cpp17/maybe_unused.md) +- [C++17 `[[maybe_unused]]`属性](/lang/cpp17/maybe_unused.md) ## 参照 -- [P2169R4 A nice placeholder with no name](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2169r4.pdf) \ No newline at end of file +- [P2169R4 A nice placeholder with no name](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2169r4.pdf) From 8def0da300f3370cce7815ec3476c5980576426d Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sat, 21 Dec 2024 10:54:48 +0900 Subject: [PATCH 1354/3948] fix typo --- lang/cpp26/nice_placeholder_with_no_name.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/cpp26/nice_placeholder_with_no_name.md b/lang/cpp26/nice_placeholder_with_no_name.md index cb813a6b45..8e36638dca 100644 --- a/lang/cpp26/nice_placeholder_with_no_name.md +++ b/lang/cpp26/nice_placeholder_with_no_name.md @@ -20,7 +20,7 @@ std::mutex mux; std::tuple f(); void f() { - std::lock_gaurd guard{mux}; // デストラクタでの自動解放だけしたいのでguard変数はとくに使わない + std::lock_guard guard{mux}; // デストラクタでの自動解放だけしたいのでguard変数はとくに使わない auto [a, b, no_use] = f(); // 構造化束縛した一部の変数は使わない } ``` @@ -33,7 +33,7 @@ std::mutex mux; std::tuple f(); void f() { - std::lock_gaurd _{mux}; // OK + std::lock_guard _{mux}; // OK auto [a, b, _] = f(); // OK } ``` From 27a5b4133e36413c6b4e952d4f51c066fc3b1bef Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sat, 21 Dec 2024 11:13:39 +0900 Subject: [PATCH 1355/3948] =?UTF-8?q?=E6=A7=8B=E9=80=A0=E5=8C=96=E6=9D=9F?= =?UTF-8?q?=E7=B8=9B=E3=81=A8lock=5Fguard=E7=B3=BB=E3=82=AF=E3=83=A9?= =?UTF-8?q?=E3=82=B9=E3=81=AE=E3=83=9A=E3=83=BC=E3=82=B8=E3=81=8B=E3=82=89?= =?UTF-8?q?=E3=80=81C++26=E5=A4=89=E6=95=B0=E5=90=8D=5F=E3=81=AE=E3=83=9A?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=81=AB=E3=83=AA=E3=83=B3=E3=82=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp17/structured_bindings.md | 1 + reference/mutex/lock_guard.md | 2 +- reference/mutex/scoped_lock.md | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lang/cpp17/structured_bindings.md b/lang/cpp17/structured_bindings.md index 947a835478..87d0a45a9c 100644 --- a/lang/cpp17/structured_bindings.md +++ b/lang/cpp17/structured_bindings.md @@ -341,6 +341,7 @@ auto { w, {x, y}, z } = f(); // このような、tuple内にあるpairを同時 - [C++20 構造化束縛した変数の参照キャプチャを許可](/lang/cpp20/reference_capture_of_structured_bindings.md) - [C++26 構造化束縛への属性を許可](/lang/cpp26/attributes_for_structured_bindings.md) - [C++26 条件式での構造化束縛の使用を許可](/lang/cpp26/structured_binding_declaration_as_a_condition.md) +- [C++26 宣言のみで使用しない変数の名前として_をサポート](/lang/cpp26/nice_placeholder_with_no_name.md) ## 参照 diff --git a/reference/mutex/lock_guard.md b/reference/mutex/lock_guard.md index 6a1d08a748..eda6c1897a 100644 --- a/reference/mutex/lock_guard.md +++ b/reference/mutex/lock_guard.md @@ -104,5 +104,5 @@ int main() - [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 関連項目 - - [`scoped_lock`](/reference/mutex/scoped_lock.md) +- [C++26 宣言のみで使用しない変数の名前として_をサポート](/lang/cpp26/nice_placeholder_with_no_name.md) diff --git a/reference/mutex/scoped_lock.md b/reference/mutex/scoped_lock.md index e8a75a55a6..6a2d9e0d69 100644 --- a/reference/mutex/scoped_lock.md +++ b/reference/mutex/scoped_lock.md @@ -88,9 +88,11 @@ int main() - [GCC](/implementation.md#gcc): 7.3 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? -## 関連項目 +## 関連項目 - [`lock_guard`](/reference/mutex/lock_guard.md) +- [C++26 宣言のみで使用しない変数の名前として_をサポート](/lang/cpp26/nice_placeholder_with_no_name.md) + ## 参照 - [P0156R2 Variadic `lock_guard` (Rev. 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0156r2.html) From a0fc868029ef09a5e4011531105a5f4863f69d03 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sat, 21 Dec 2024 11:13:56 +0900 Subject: [PATCH 1356/3948] =?UTF-8?q?lock=5Fguard=20:=20=E3=82=B5=E3=83=B3?= =?UTF-8?q?=E3=83=97=E3=83=AB=E3=82=B3=E3=83=BC=E3=83=89=E3=82=92=E5=B0=8F?= =?UTF-8?q?=E3=81=95=E3=81=8F=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/mutex/lock_guard.md | 59 +++++++++++++++-------------------- 1 file changed, 25 insertions(+), 34 deletions(-) diff --git a/reference/mutex/lock_guard.md b/reference/mutex/lock_guard.md index eda6c1897a..799173ab2c 100644 --- a/reference/mutex/lock_guard.md +++ b/reference/mutex/lock_guard.md @@ -37,60 +37,51 @@ namespace std { ## 例 +### 基本的な使い方 ```cpp example #include #include #include -#include // std::coutへのアクセスを排他的にする std::mutex print_mtx_; void safe_print(int x) { - std::lock_guard lock(print_mtx_); - std::cout << x << std::endl; + std::lock_guard lock{print_mtx_}; + std::cout << "value:" << x << std::endl; } -class X { - std::mutex mtx_; - std::vector data_; -public: - // vectorオブジェクトへのアクセスを排他的にする - void add_value(int value) - { - std::lock_guard lock(mtx_); // ロックを取得する(lock_guardのコンストラクタ) - data_.push_back(value); - } // ロックを手放す(lock_guardのデストラクタ) - - void print() - { - std::lock_guard lock(mtx_); - for (int x : data_) { - safe_print(x); - } - } -}; - int main() { - X x; - - std::thread t1([&x]{ x.add_value(1); }); - std::thread t2([&x]{ x.add_value(2); }); + std::thread t1([]{ + for (int i = 0; i < 5; i++) { + safe_print(i); + } + }); + std::thread t2([]{ + for (int i = 0; i < 5; i++) { + safe_print(5 + i); + } + }); t1.join(); t2.join(); - - x.print(); } ``` * std::lock_guard[color ff0000] -* data_.push_back[link /reference/vector/vector/push_back.md] -### 出力 +#### 出力例 ``` -1 -2 +value:5 +value:6 +value:7 +value:8 +value:9 +value:0 +value:1 +value:2 +value:3 +value:4 ``` ## バージョン @@ -98,7 +89,7 @@ int main() - C++11 ### 処理系 -- [Clang](/implementation.md#clang): ?? +- [Clang](/implementation.md#clang): 14 [mark verified] - [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] From 258038b57db199ef2f5cd5f9998086cb55b59e82 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sat, 21 Dec 2024 11:23:16 +0900 Subject: [PATCH 1357/3948] =?UTF-8?q?lock=5Fguard:=20=E5=87=BA=E5=8A=9B?= =?UTF-8?q?=E3=81=8C=E3=81=86=E3=81=BE=E3=81=8F=E6=B7=B7=E3=81=96=E3=82=89?= =?UTF-8?q?=E3=81=AA=E3=81=8B=E3=81=A3=E3=81=9F=E3=81=AE=E3=81=A7=E3=83=A9?= =?UTF-8?q?=E3=83=B3=E3=83=80=E3=83=A0=E6=99=82=E9=96=93=E3=81=AEsleep?= =?UTF-8?q?=E3=82=92=E5=85=A5=E3=82=8C=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 1 + reference/mutex/lock_guard.md | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index e0d329a40d..53ed73ca6c 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -194,6 +194,7 @@ * [link /reference/random.md] * std::default_random_engine[link /reference/random/default_random_engine.md] * std::mt19937[link /reference/random/mt19937.md] + * std::uniform_int_distribution[link /reference/random/uniform_int_distribution.md] * std::random_device[link /reference/random/random_device.md] * seed_gen()[link /reference/random/random_device/op_call.md] * [link /reference/ranges.md] diff --git a/reference/mutex/lock_guard.md b/reference/mutex/lock_guard.md index 799173ab2c..dab1029c92 100644 --- a/reference/mutex/lock_guard.md +++ b/reference/mutex/lock_guard.md @@ -51,16 +51,29 @@ void safe_print(int x) std::cout << "value:" << x << std::endl; } +#include +void sleep_random() +{ + std::random_device seed_gen; + std::mt19937 engine{seed_gen()}; + std::uniform_int_distribution dist{1, 10}; + + int sleep_ms = dist(engine); + std::this_thread::sleep_for(std::chrono::milliseconds{sleep_ms}); +} + int main() { std::thread t1([]{ for (int i = 0; i < 5; i++) { safe_print(i); + sleep_random(); } }); std::thread t2([]{ for (int i = 0; i < 5; i++) { safe_print(5 + i); + sleep_random(); } }); From 815f9db290edf40da0e3c4415fdda0cebce66e05 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sat, 21 Dec 2024 13:04:29 +0900 Subject: [PATCH 1358/3948] =?UTF-8?q?lock=5Fguard:=20=E5=87=BA=E5=8A=9B?= =?UTF-8?q?=E3=82=92=E6=9B=B4=E6=96=B0=E3=81=97=E3=81=A6=E3=81=AA=E3=81=8B?= =?UTF-8?q?=E3=81=A3=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/mutex/lock_guard.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/mutex/lock_guard.md b/reference/mutex/lock_guard.md index dab1029c92..781ade9c0c 100644 --- a/reference/mutex/lock_guard.md +++ b/reference/mutex/lock_guard.md @@ -86,15 +86,15 @@ int main() #### 出力例 ``` value:5 -value:6 -value:7 -value:8 -value:9 value:0 +value:6 value:1 value:2 value:3 +value:7 value:4 +value:8 +value:9 ``` ## バージョン From 5dbb07c24d5ae42ccdb2af7537c311c63b4073bf Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sat, 21 Dec 2024 13:34:03 +0900 Subject: [PATCH 1359/3948] =?UTF-8?q?=E3=82=B0=E3=83=AD=E3=83=BC=E3=83=90?= =?UTF-8?q?=E3=83=AB=E4=BF=AE=E9=A3=BE=20:=20sleep=5Ffor=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 53ed73ca6c..0b25cda200 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -273,6 +273,7 @@ * t1.join()[link /reference/thread/thread/join.md] * t2.join()[link /reference/thread/thread/join.md] * t3.join()[link /reference/thread/thread/join.md] + * std::this_thread::sleep_for[link /reference/thread/this_thread/sleep_for.md] * [link /reference/tuple.md] * std::tuple[link /reference/tuple/tuple.md] * std::tie[link /reference/tuple/tie.md] From 2f1a9df6abc0d028904598409a53837ec667e73f Mon Sep 17 00:00:00 2001 From: Yuhki Ogasawara Date: Sat, 21 Dec 2024 14:11:47 +0900 Subject: [PATCH 1360/3948] =?UTF-8?q?Visual=20Studio=202022=20version=2017?= =?UTF-8?q?.0.2=E3=81=AE=E8=A1=A8=E8=A8=98=E3=81=8B=E3=82=89Update=201?= =?UTF-8?q?=E3=82=92=E5=89=8A=E9=99=A4=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/implementation.md b/implementation.md index 7c6ff8b8eb..21b9b217bc 100644 --- a/implementation.md +++ b/implementation.md @@ -152,7 +152,7 @@ | 2022 Update 4 | Visual Studio 2022 version 17.4.9 | ?? | 1934 | 193431944 | | 2022 Update 3 | Visual Studio 2022 version 17.3.6 | 14.33 | 1933 | 193331630 | | 2022 Update 2 | Visual Studio 2022 version 17.2.2 | 14.32 | 1932 | 193231329 | -| 2022 Update 1 | Visual Studio 2022 version 17.0.2 | 14.30 | 1930 | 193030706 | +| 2022 | Visual Studio 2022 version 17.0.2 | 14.30 | 1930 | 193030706 | | 2022 | Visual Studio 2022 version 17.0.1 | 14.30 | 1930 | 193030705 | | 2019 Update 11 | Visual Studio 2019 バージョン 16.11.2 | 14.28 | 1929 | 192930133 | | 2019 Update 9 | Visual Studio 2019 バージョン 16.9.2 | 14.28 | 1928 | 192829913 | From c763f1465ad4134e48499a9ec51abeeb2bfe92ad Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sun, 22 Dec 2024 15:27:29 +0900 Subject: [PATCH 1361/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=83=86?= =?UTF-8?q?=E3=82=AD=E3=82=B9=E3=83=88=E3=81=A8=E3=83=AA=E3=83=B3=E3=82=AF?= =?UTF-8?q?=E3=82=A2=E3=83=89=E3=83=AC=E3=82=B9=E3=81=AE=E6=96=87=E6=9B=B8?= =?UTF-8?q?=E7=95=AA=E5=8F=B7=E3=81=AE=E4=B8=8D=E4=B8=80=E8=87=B4=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 以下の正規表現で検出しました。 \[(n\d+|p\d+r\d+)[^\]]*\]\(https?://www\.open-std\.org/jtc1/sc22/wg21/docs/papers/\d{4}/(?!\1)[np] \[[CL]WG Issue (\d+)[^\]]*\]\(https?://www\.open-std\.org/jtc1/sc22/wg21/docs/[cl]wg[_-]defects.html#(?!\1) --- lang/cpp11/auto.md | 2 +- lang/cpp11/defaulted_and_deleted_functions.md | 4 ++-- lang/cpp11/initializer_lists.md | 2 +- lang/cpp11/rvalue_ref_and_move_semantics.md | 2 +- lang/cpp11/scoped_enum.md | 2 +- lang/cpp11/trailing_return_types.md | 2 +- .../changing_the_active_member_of_a_union_inside_constexpr.md | 2 +- lang/cpp20/deprecating_volatile.md | 4 ++-- ...t_creation_of_objects_for_low-level_object_manipulation.md | 2 +- reference/cmath.md | 2 +- reference/memory/ranges_construct_at.md | 2 +- reference/memory/ranges_destroy.md | 2 +- reference/memory/ranges_destroy_at.md | 2 +- reference/memory/ranges_destroy_n.md | 2 +- reference/memory/ranges_uninitialized_copy.md | 2 +- reference/memory/ranges_uninitialized_copy_n.md | 2 +- reference/memory/ranges_uninitialized_default_construct.md | 2 +- reference/memory/ranges_uninitialized_default_construct_n.md | 2 +- reference/memory/ranges_uninitialized_fill.md | 2 +- reference/memory/ranges_uninitialized_fill_n.md | 2 +- reference/memory/ranges_uninitialized_move.md | 2 +- reference/memory/ranges_uninitialized_move_n.md | 2 +- reference/memory/ranges_uninitialized_value_construct.md | 2 +- reference/memory/ranges_uninitialized_value_construct_n.md | 2 +- reference/type_traits/basic_common_reference.md | 2 +- reference/type_traits/common_type.md | 2 +- reference/type_traits/reference_constructs_from_temporary.md | 2 +- reference/type_traits/reference_converts_from_temporary.md | 2 +- reference/unordered_map/unordered_map/at.md | 2 +- reference/utility/pair/get.md | 2 +- 30 files changed, 32 insertions(+), 32 deletions(-) diff --git a/lang/cpp11/auto.md b/lang/cpp11/auto.md index 5c5e23a363..bf7a66bb43 100644 --- a/lang/cpp11/auto.md +++ b/lang/cpp11/auto.md @@ -266,7 +266,7 @@ int foo(const std::unordered_map>& m) { ### 記憶クラス指定子としての `auto` 自動変数である事を意味する記憶クラス指定子としての `auto` を残す案も考えられた。 -- [N1706 Decltype and auto (revision 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1705.pdf)(「1.1 Changes from N1607」の 5 番目の項目) +- [N1705 Decltype and auto (revision 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1705.pdf)(「1.1 Changes from N1607」の 5 番目の項目) しかし、その場合に発生する新たな曖昧性や混乱を回避するため、および、記憶クラス指定子としての `auto` の使用が非常に少ないとの調査結果などから、当該用途は直ちに廃止となった。 diff --git a/lang/cpp11/defaulted_and_deleted_functions.md b/lang/cpp11/defaulted_and_deleted_functions.md index 6253f9b9f2..2d2455d3e8 100644 --- a/lang/cpp11/defaulted_and_deleted_functions.md +++ b/lang/cpp11/defaulted_and_deleted_functions.md @@ -131,8 +131,8 @@ int main() ## 参照 - [N1582 Compiler Generated Defaults](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1582.pdf) - [N1702 explicit class and default definitions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1702.pdf) -- [N1707 explicit class and default definitions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1717.pdf) +- [N1717 explicit class and default definitions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1717.pdf) - [N2210 Defaulted and Deleted Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2210.html) - [N2326 Defaulted and Deleted Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2326.html) -- [N3172 To move or not to move](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3174.pdf) +- [N3174 To move or not to move](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3174.pdf) - [N2346 Defaulted and Deleted Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm) diff --git a/lang/cpp11/initializer_lists.md b/lang/cpp11/initializer_lists.md index fd0dffab9c..be80ad5195 100644 --- a/lang/cpp11/initializer_lists.md +++ b/lang/cpp11/initializer_lists.md @@ -351,7 +351,7 @@ std::vector v(ar, ar + N); - [N1824 Extending Aggregate Initialization](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1824.htm) - [N1890 Initialization and initializers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1890.pdf) - [N1919 Initializer lists](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1919.pdf) -- [N2210 Initializer lists (Rev. 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2100.pdf) +- [N2100 Initializer lists (Rev. 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2100.pdf) - [N2215 Initializer lists (Rev. 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2215.pdf) - [N2531 Initializer lists WP wording (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2531.pdf) - [N2575 Initializer Lists - Alternative Mechanism and Rationale](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2575.pdf) diff --git a/lang/cpp11/rvalue_ref_and_move_semantics.md b/lang/cpp11/rvalue_ref_and_move_semantics.md index 6d27237e89..4ab7b484cc 100644 --- a/lang/cpp11/rvalue_ref_and_move_semantics.md +++ b/lang/cpp11/rvalue_ref_and_move_semantics.md @@ -409,5 +409,5 @@ C++11で非推奨となった`std::auto_ptr`で実現されていた。 - [N2118 A Proposal to Add an Rvalue Reference to the C++ Language - Revision 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2118.html) - [N2983 Allowing Move Constructors to Throw](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2983.html) - ムーブコンストラクタから例外を送出することを許可した経緯 -- [P0135R0 Wording for guaranteed copy elision through simplified value categories](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0135r1.html) +- [P0135R1 Wording for guaranteed copy elision through simplified value categories](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0135r1.html) - C++17 値カテゴリの定義 \ No newline at end of file diff --git a/lang/cpp11/scoped_enum.md b/lang/cpp11/scoped_enum.md index c887e9f4d2..7b712f5e3e 100644 --- a/lang/cpp11/scoped_enum.md +++ b/lang/cpp11/scoped_enum.md @@ -108,7 +108,7 @@ ECMA規格になっているC++/CLIが、現在のスコープを持つ列挙型 ## 参照 - [N1513 Improving Enumeration Types](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1513.pdf) - [N1579 Strongly Typed Enums](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1579.pdf) -- [N1579 Strongly Typed Enums (revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1719.pdf) +- [N1719 Strongly Typed Enums (revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1719.pdf) - [N2213 Strongly Typed Enums (revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2213.pdf) - [N2347 Strongly Typed Enums (revision 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf) - [N2499 Forward declaration of enumerations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2499.pdf) diff --git a/lang/cpp11/trailing_return_types.md b/lang/cpp11/trailing_return_types.md index 3ccc8ea022..cb84e79bc6 100644 --- a/lang/cpp11/trailing_return_types.md +++ b/lang/cpp11/trailing_return_types.md @@ -116,7 +116,7 @@ auto f = [](int a, int b) -> int { return a + b; } - [N2445 New Function Declarator Syntax Wording](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2445.html) - [N2541 New Function Declarator Syntax Wording](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2541.htm) - [N2763 Unified Function Syntax](http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2008/n2763.htm) -- [N2835 Unified Function Syntax](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2825.html) +- [N2825 Unified Function Syntax](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2825.html) - [N2927 New wording for C++0x Lambdas (rev. 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2927.pdf) - ラムダ式の仕様と合わせて「trailing-return-type」という言葉が使われるようになった - [N2931 Unified Function Syntax](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2931.html) diff --git a/lang/cpp20/changing_the_active_member_of_a_union_inside_constexpr.md b/lang/cpp20/changing_the_active_member_of_a_union_inside_constexpr.md index e1a81ed042..a3834055b8 100644 --- a/lang/cpp20/changing_the_active_member_of_a_union_inside_constexpr.md +++ b/lang/cpp20/changing_the_active_member_of_a_union_inside_constexpr.md @@ -49,5 +49,5 @@ int main() { ## 参照 - [P1330R0 Changing the active member of a union inside constexpr](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1330r0.pdf) -- [P0980R0 Making std::string constexpr](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0980r1.pdf) +- [P0980R1 Making std::string constexpr](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0980r1.pdf) - [std::stringのSSO(Small-string optimization)がどうなっているか調べた - melpon/qiita](https://github.com/melpon/qiita/tree/master/items/stdstringのSSO(Small-string%20optimization)がどうなっているか調べた) \ No newline at end of file diff --git a/lang/cpp20/deprecating_volatile.md b/lang/cpp20/deprecating_volatile.md index 6efb68a5ae..30082b6f76 100644 --- a/lang/cpp20/deprecating_volatile.md +++ b/lang/cpp20/deprecating_volatile.md @@ -387,6 +387,6 @@ volatile device dev; - [P1152R2 Deprecating `volatile`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1152r2) - [P1152R4 Deprecating `volatile`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1152r4.html) - [P1831R0 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1831r0.html) -- [P1831R0 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) -- [P2327R0 De-deprecating volatile compound assignment](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2327r1.pdf) +- [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) +- [P2327R1 De-deprecating volatile compound operations](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2327r1.pdf) - [CWG Issue 2654. Un-deprecation of compound volatile assignments](https://cplusplus.github.io/CWG/issues/2654.html) \ No newline at end of file diff --git a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md index befc5cc1c7..37bd5f5bf8 100644 --- a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md +++ b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md @@ -410,7 +410,7 @@ unique_ptr Stream::read() { ## 参照 - [P0593R6 Implicit creation of objects for low-level object manipulation](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p0593r6.html) -- [P0593R0 What to do with buffers that are not arrays, and undefined behavior thereof?](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0593r0.html) +- [P0593R0 What to do with buffers that are not arrays, and undefined behavior thereof?](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0593r0.html) - [CWG Issue 2325. `std::launder` and reuse of character buffers](https://cplusplus.github.io/CWG/issues/2325.html) - [CWG Issue 2605. Implicit-lifetime aggregates](https://cplusplus.github.io/CWG/issues/2605.html) - [P1839R5 Accessing Object Representations](https://wg21.link/p1839r5) diff --git a/reference/cmath.md b/reference/cmath.md index 879e256fa2..7088115a94 100644 --- a/reference/cmath.md +++ b/reference/cmath.md @@ -460,7 +460,7 @@ NaN を返さなければならないが定義域エラーを報告してはな ## 参照 - [N1568 Proposed additions to TR-1 to improve compatibility with C99](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1568.htm) -- [P00175R0 Synopses for the C library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0175r0.html) +- [P0175R0 Synopses for the C library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0175r0.html) - C++17 から`f`、`l`サフィックス付きのC関数を導入 - [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) - C++23での、一部関数の`constexpr`対応 diff --git a/reference/memory/ranges_construct_at.md b/reference/memory/ranges_construct_at.md index cc1c09bfb8..6313908e72 100644 --- a/reference/memory/ranges_construct_at.md +++ b/reference/memory/ranges_construct_at.md @@ -87,5 +87,5 @@ int main() - [`construct_at`](construct_at.md) ## 参照 -- [P9896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P0896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) - [LWG Issue 3436. `std::construct_at` should support arrays](https://wg21.cmeerw.net/lwg/issue3436) diff --git a/reference/memory/ranges_destroy.md b/reference/memory/ranges_destroy.md index b013d80bd0..d059054a45 100644 --- a/reference/memory/ranges_destroy.md +++ b/reference/memory/ranges_destroy.md @@ -111,4 +111,4 @@ int main() - [`destroy`](destroy.md) ## 参照 -- [P9896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P0896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/memory/ranges_destroy_at.md b/reference/memory/ranges_destroy_at.md index 0bdaa25e8c..1245cc6cad 100644 --- a/reference/memory/ranges_destroy_at.md +++ b/reference/memory/ranges_destroy_at.md @@ -77,4 +77,4 @@ int main() - [`destroy_at`](destroy_at.md) ## 参照 -- [P9896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P0896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/memory/ranges_destroy_n.md b/reference/memory/ranges_destroy_n.md index 32645d979d..95bcda180c 100644 --- a/reference/memory/ranges_destroy_n.md +++ b/reference/memory/ranges_destroy_n.md @@ -98,4 +98,4 @@ int main() - [`destroy_n`](destroy_n.md) ## 参照 -- [P9896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P0896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/memory/ranges_uninitialized_copy.md b/reference/memory/ranges_uninitialized_copy.md index 6c7e948290..82bae40b89 100644 --- a/reference/memory/ranges_uninitialized_copy.md +++ b/reference/memory/ranges_uninitialized_copy.md @@ -174,6 +174,6 @@ int main() - [`uninitialized_copy`](uninitialized_copy.md) ## 参照 -- [P9896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P0896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) - [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) - C++26から`constexpr`がついた diff --git a/reference/memory/ranges_uninitialized_copy_n.md b/reference/memory/ranges_uninitialized_copy_n.md index aabbeee860..d66a32e2fd 100644 --- a/reference/memory/ranges_uninitialized_copy_n.md +++ b/reference/memory/ranges_uninitialized_copy_n.md @@ -141,6 +141,6 @@ int main() - [`uninitialized_copy_n`](uninitialized_copy_n.md) ## 参照 -- [P9896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P0896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) - [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) - C++26から`constexpr`がついた diff --git a/reference/memory/ranges_uninitialized_default_construct.md b/reference/memory/ranges_uninitialized_default_construct.md index ba4a0f8525..c9dc71e40b 100644 --- a/reference/memory/ranges_uninitialized_default_construct.md +++ b/reference/memory/ranges_uninitialized_default_construct.md @@ -144,7 +144,7 @@ int main() - [`uninitialized_default_construct`](uninitialized_default_construct.md) ## 参照 -- [P9896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P0896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) - [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) - [P3369R0 `constexpr` for `uninitialized_default_construct`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3369r0.html) - 上記2文書で、C++26から`constexpr`がついた diff --git a/reference/memory/ranges_uninitialized_default_construct_n.md b/reference/memory/ranges_uninitialized_default_construct_n.md index fbc01f39e7..c9222a237a 100644 --- a/reference/memory/ranges_uninitialized_default_construct_n.md +++ b/reference/memory/ranges_uninitialized_default_construct_n.md @@ -111,7 +111,7 @@ int main() - [`uninitialized_default_construct_n`](uninitialized_default_construct_n.md) ## 参照 -- [P9896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P0896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) - [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) - [P3369R0 `constexpr` for `uninitialized_default_construct`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3369r0.html) - 上記2文書で、C++26から`constexpr`がついた diff --git a/reference/memory/ranges_uninitialized_fill.md b/reference/memory/ranges_uninitialized_fill.md index 024335ecdb..295ffe1ccd 100644 --- a/reference/memory/ranges_uninitialized_fill.md +++ b/reference/memory/ranges_uninitialized_fill.md @@ -140,6 +140,6 @@ int main() - [`uninitialized_fill`](uninitialized_fill.md) ## 参照 -- [P9896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P0896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) - [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) - C++26から`constexpr`がついた diff --git a/reference/memory/ranges_uninitialized_fill_n.md b/reference/memory/ranges_uninitialized_fill_n.md index ec97fd1818..6b4c3b3cbf 100644 --- a/reference/memory/ranges_uninitialized_fill_n.md +++ b/reference/memory/ranges_uninitialized_fill_n.md @@ -108,6 +108,6 @@ int main() - [`uninitialized_fill_n`](uninitialized_fill_n.md) ## 参照 -- [P9896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P0896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) - [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) - C++26から`constexpr`がついた diff --git a/reference/memory/ranges_uninitialized_move.md b/reference/memory/ranges_uninitialized_move.md index 1e0e7f4f3e..500454ac28 100644 --- a/reference/memory/ranges_uninitialized_move.md +++ b/reference/memory/ranges_uninitialized_move.md @@ -168,6 +168,6 @@ int main() - [`uninitialized_move`](uninitialized_move.md) ## 参照 -- [P9896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P0896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) - [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) - C++26から`constexpr`がついた diff --git a/reference/memory/ranges_uninitialized_move_n.md b/reference/memory/ranges_uninitialized_move_n.md index 72b98746f1..7d856577da 100644 --- a/reference/memory/ranges_uninitialized_move_n.md +++ b/reference/memory/ranges_uninitialized_move_n.md @@ -142,6 +142,6 @@ int main() - [`uninitialized_move_n`](uninitialized_move_n.md) ## 参照 -- [P9896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P0896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) - [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) - C++26から`constexpr`がついた diff --git a/reference/memory/ranges_uninitialized_value_construct.md b/reference/memory/ranges_uninitialized_value_construct.md index f33cd17f76..8a751e7712 100644 --- a/reference/memory/ranges_uninitialized_value_construct.md +++ b/reference/memory/ranges_uninitialized_value_construct.md @@ -140,6 +140,6 @@ int main() - [`uninitialized_value_construct`](uninitialized_value_construct.md) ## 参照 -- [P9896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P0896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) - [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) - C++26から`constexpr`がついた diff --git a/reference/memory/ranges_uninitialized_value_construct_n.md b/reference/memory/ranges_uninitialized_value_construct_n.md index caac190e3b..8002e5e01f 100644 --- a/reference/memory/ranges_uninitialized_value_construct_n.md +++ b/reference/memory/ranges_uninitialized_value_construct_n.md @@ -112,6 +112,6 @@ int main() - [`uninitialized_value_construct_n`](uninitialized_value_construct_n.md) ## 参照 -- [P9896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P0896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) - [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) - C++26から`constexpr`がついた diff --git a/reference/type_traits/basic_common_reference.md b/reference/type_traits/basic_common_reference.md index aee4194336..052c3ce5ae 100644 --- a/reference/type_traits/basic_common_reference.md +++ b/reference/type_traits/basic_common_reference.md @@ -95,5 +95,5 @@ int main() ## 参照 - [P0898R3 Standard Library Concepts](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0898r3.pdf) -- [P2665R0 `common_reference_t`` of reference_wrapper` Should Be a Reference Type](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2655r0.html) +- [P2655R0 `common_reference_t` of `reference_wrapper` Should Be a Reference Type](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2655r0.html) - `T&`と`reference_wrapper`の`common_reference`を`T&`にするための`basic_common_reference`特殊化の例 diff --git a/reference/type_traits/common_type.md b/reference/type_traits/common_type.md index 6ef83f500b..64cc114d00 100644 --- a/reference/type_traits/common_type.md +++ b/reference/type_traits/common_type.md @@ -177,6 +177,6 @@ struct common_type { - [N3655 TransformationTraits Redux, v2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3655.pdf) - [LWG Issue 2141. `common_type` trait produces reference types](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2141) - C++11では、`common_type`の結果が参照型になる場合があった。C++14で`decay_t`を通すことにしたことにより、参照型が返されることがなくなった。 -- [P0453R1 Resolving LWG Issues re common_type](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0435r1.pdf) +- [P0435R1 Resolving LWG Issues re common_type](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0435r1.pdf) - [P0898R3 Standard Library Concepts](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0898r3.pdf) - C++20で`COND-RES`, `CREF`操作を利用するステップが追加された。 diff --git a/reference/type_traits/reference_constructs_from_temporary.md b/reference/type_traits/reference_constructs_from_temporary.md index 0d3db3d964..c554fe12ac 100644 --- a/reference/type_traits/reference_constructs_from_temporary.md +++ b/reference/type_traits/reference_constructs_from_temporary.md @@ -153,4 +153,4 @@ int main() ## 参照 -- [P2252R2 A type trait to detect reference binding to temporary](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2255r2.html) +- [P2255R2 A type trait to detect reference binding to temporary](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2255r2.html) diff --git a/reference/type_traits/reference_converts_from_temporary.md b/reference/type_traits/reference_converts_from_temporary.md index a436ce404e..619b7afa45 100644 --- a/reference/type_traits/reference_converts_from_temporary.md +++ b/reference/type_traits/reference_converts_from_temporary.md @@ -149,4 +149,4 @@ int main() ## 参照 -- [P2252R2 A type trait to detect reference binding to temporary](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2255r2.html) +- [P2255R2 A type trait to detect reference binding to temporary](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2255r2.html) diff --git a/reference/unordered_map/unordered_map/at.md b/reference/unordered_map/unordered_map/at.md index 53bee16ce4..a6e81bd1f7 100644 --- a/reference/unordered_map/unordered_map/at.md +++ b/reference/unordered_map/unordered_map/at.md @@ -80,4 +80,4 @@ exception std::out_of_range ## 参照 -- [LWG Issue 761. `unordered_map` needs an `at()` member function](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#759) +- [LWG Issue 761. `unordered_map` needs an `at()` member function](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#761) diff --git a/reference/utility/pair/get.md b/reference/utility/pair/get.md index 370594d113..bbf59b17ae 100644 --- a/reference/utility/pair/get.md +++ b/reference/utility/pair/get.md @@ -151,6 +151,6 @@ a ## 参照 - [N3471 Constexpr Library Additions: utilities, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3471.html) -- [N3584 Wording for Addressing Tuples by Type: Revision 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3670.html) +- [N3670 Wording for Addressing Tuples by Type: Revision 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3670.html) - [N3887 Consistent Metafunction Aliases](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3887.pdf) - [LWG Issue 2485. `get()` should be overloaded for `const tuple&&`](https://wg21.cmeerw.net/lwg/issue2485) From 0353f387740ad119437623114ae25963a7ff08ef Mon Sep 17 00:00:00 2001 From: yoh Date: Sun, 22 Dec 2024 16:03:05 +0900 Subject: [PATCH 1362/3948] =?UTF-8?q?mdspan/aligned=5Faccessor:=20?= =?UTF-8?q?=E5=85=A8=E3=83=A1=E3=83=B3=E3=83=90=20P2897R7(#1380)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/mdspan/aligned_accessor.md | 8 +-- reference/mdspan/aligned_accessor/access.md | 41 +++++++++++++++ reference/mdspan/aligned_accessor/offset.md | 42 ++++++++++++++++ .../mdspan/aligned_accessor/op_constructor.md | 50 +++++++++++++++++++ .../aligned_accessor/op_default_accessor.md | 42 ++++++++++++++++ 5 files changed, 179 insertions(+), 4 deletions(-) create mode 100644 reference/mdspan/aligned_accessor/access.md create mode 100644 reference/mdspan/aligned_accessor/offset.md create mode 100644 reference/mdspan/aligned_accessor/op_constructor.md create mode 100644 reference/mdspan/aligned_accessor/op_default_accessor.md diff --git a/reference/mdspan/aligned_accessor.md b/reference/mdspan/aligned_accessor.md index 36215f2aa3..40bcb2e3ea 100644 --- a/reference/mdspan/aligned_accessor.md +++ b/reference/mdspan/aligned_accessor.md @@ -37,11 +37,11 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`(constructor)`](aligned_accessor/op_constructor.md.nolink) | コンストラクタ | C++26 | +| [`(constructor)`](aligned_accessor/op_constructor.md) | コンストラクタ | C++26 | | `(destructor)` | デストラクタ | C++26 | -| [`operator default_accessor`](aligned_accessor/op_default_accessor.md.nolink) | [`default_accessor`](default_accessor.md)型への変換演算子 | C++26 | -| [`access`](aligned_accessor/access.md.nolink) | 指定オフセット位置にある要素へアクセスする | C++26 | -| [`offset`](aligned_accessor/offset.md.nolink) | 指定オフセット位置のハンドルを取得する | C++26 | +| [`operator default_accessor`](aligned_accessor/op_default_accessor.md) | [`default_accessor`](default_accessor.md)型への変換演算子 | C++26 | +| [`access`](aligned_accessor/access.md) | 指定オフセット位置にある要素へアクセスする | C++26 | +| [`offset`](aligned_accessor/offset.md) | 指定オフセット位置のハンドルを取得する | C++26 | ## メンバ型 diff --git a/reference/mdspan/aligned_accessor/access.md b/reference/mdspan/aligned_accessor/access.md new file mode 100644 index 0000000000..e05dbcc020 --- /dev/null +++ b/reference/mdspan/aligned_accessor/access.md @@ -0,0 +1,41 @@ +# access +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* aligned_accessor[meta class] +* cpp26[meta cpp] + +```cpp +constexpr reference access(data_handle_type p, size_t i) const noexcept; +``` + +## 概要 +指定オフセット位置にある要素へアクセスする。 + + +## 事前条件 +- 半開区間`[0, i+1)`が有効な範囲であり、かつ +- [`is_sufficiently_aligned`](/reference/memory/is_sufficiently_aligned.md)`(p)`が`true`であること。 + + +## 効果 +`return` [`assume_aligned`](/reference/memory/assume_aligned.md)`(p)[i];`と等価 + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2897R7 `aligned_accessor`: An mdspan accessor expressing pointer over-alignment](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2897r7.html) diff --git a/reference/mdspan/aligned_accessor/offset.md b/reference/mdspan/aligned_accessor/offset.md new file mode 100644 index 0000000000..443c023308 --- /dev/null +++ b/reference/mdspan/aligned_accessor/offset.md @@ -0,0 +1,42 @@ +# offset +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* aligned_accessor[meta class] +* cpp26[meta cpp] + +```cpp +constexpr typename offset_policy::data_handle_type + offset(data_handle_type p, size_t i) const noexcept; +``` + +## 概要 +指定オフセット位置のハンドルを取得する。 + + +## 事前条件 +- 半開区間`[0, i+1)`が有効な範囲であり、かつ +- [`is_sufficiently_aligned`](/reference/memory/is_sufficiently_aligned.md)`(p)`が`true`であること。 + + +## 効果 +`return` [`assume_aligned`](/reference/memory/assume_aligned.md)`(p) + i;`と等価 + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2897R7 `aligned_accessor`: An mdspan accessor expressing pointer over-alignment](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2897r7.html) diff --git a/reference/mdspan/aligned_accessor/op_constructor.md b/reference/mdspan/aligned_accessor/op_constructor.md new file mode 100644 index 0000000000..5b99ed2972 --- /dev/null +++ b/reference/mdspan/aligned_accessor/op_constructor.md @@ -0,0 +1,50 @@ +# コンストラクタ +* mdspan[meta header] +* function[meta id-type] +* std[meta namespace] +* aligned_accessor[meta class] +* cpp26[meta cpp] + +```cpp +constexpr aligned_accessor() noexcept = default; // (1) + +template +constexpr aligned_accessor( + aligned_accessor) noexcept; // (2) + +template +explicit constexpr aligned_accessor( + default_accessor) noexcept; // (3) +``` +* default_accessor[link ../default_accessor.md] + +## 概要 +- (1) : デフォルトコンストラクタ +- (2) : 他`aligned_accessor`からの変換コンストラクタ +- (3) : [`default_accessor`](../default_accessor.md)からの変換コンストラクタ + + +## テンプレートパラメータ制約 +- (2) : + - [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true`であること + - `OtherByteAlignment > byte_alignment` +- (3) : [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true`であること + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2897R7 `aligned_accessor`: An mdspan accessor expressing pointer over-alignment](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2897r7.html) diff --git a/reference/mdspan/aligned_accessor/op_default_accessor.md b/reference/mdspan/aligned_accessor/op_default_accessor.md new file mode 100644 index 0000000000..5c7752cf6e --- /dev/null +++ b/reference/mdspan/aligned_accessor/op_default_accessor.md @@ -0,0 +1,42 @@ +# operator default_accessor +* mdspan[meta header] +* function template[meta id-type] +* std[meta namespace] +* aligned_accessor[meta class] +* cpp26[meta cpp] + +```cpp +template + constexpr operator default_accessor() const noexcept; +``` +* default_accessor[link ../default_accessor.md] + +## 概要 +[`default_accessor`](../default_accessor.md)型への変換演算子 + + +## テンプレートパラメータ制約 +[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true`であること + + +## 効果 +`return {};`と等価 + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2897R7 `aligned_accessor`: An mdspan accessor expressing pointer over-alignment](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2897r7.html) From 2ad32d5e90ffa2c29f37afce6dd835529fbb3c18 Mon Sep 17 00:00:00 2001 From: Akiko Kawai Date: Mon, 23 Dec 2024 11:50:08 +0900 Subject: [PATCH 1363/3948] Update implementation-status for ICX --- implementation-status.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/implementation-status.md b/implementation-status.md index 0a12e1736b..4c0476f3f4 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -262,10 +262,10 @@ | P1938R3: [`if consteval`](/lang/cpp23/if_consteval.md) | コンパイル時の文脈かどうかで分岐させる | 12 | 14 | - | - | | P1401R5: [定数式の文脈での`bool`への縮小変換を許可](/lang/cpp23/narrowing_contextual_conversions_to_bool.md) | `if constexpr(flags & Flags::Exec)`や`static_assert(N);`を許可 | 9 | 13 | 2022.2 | - | | P2242R3: [定数式内での非リテラル変数、静的変数・スレッドローカル変数およびgotoとラベルの存在を許可する](/lang/cpp23/non_literal_variables_in_constexpr_functions.md) | コンパイル時に評価されない限り、定数式内に静的変数・スレッドローカル変数およびgoto文とラベルを含むことを許可する | 12 | 15 | 2022.2 | - | -| P2246R1: [静的な診断メッセージの文字エンコーディング](/lang/cpp23/character_encoding_of_diagnostic_text.md) | `static_assert`や`[[deprecated]]`などの診断メッセージの文字集合に関する要件をなくす | - | yes | - | 2022 | +| P2246R1: [静的な診断メッセージの文字エンコーディング](/lang/cpp23/character_encoding_of_diagnostic_text.md) | `static_assert`や`[[deprecated]]`などの診断メッセージの文字集合に関する要件をなくす | - | yes | 2022.2 | 2022 | | P2448R2: [`constexpr`関数が定数実行できない場合でも適格とする](/lang/cpp23/relaxing_some_constexpr_restrictions.md) | | 13 | 17 (partial) | 2024.0 (partial) | - | | P2647R1: [`constexpr`関数内での`static constexpr`変数を許可](/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md) | `constexpr`関数のローカルで定数を定義できるようにする | 13 | 16 | 2023.2 | - | -| P2564R3: [`constexpr`関数内で`consteval`関数を呼び出せない問題を緩和](/lang/cpp23/consteval_needs_to_propagate_up.md) | `consteval`呼び出しを含む`constexpr`関数を条件付きで`consteval`関数とみなすようにする | - | 17 | - | 2024.0 | +| P2564R3: [`constexpr`関数内で`consteval`関数を呼び出せない問題を緩和](/lang/cpp23/consteval_needs_to_propagate_up.md) | `consteval`呼び出しを含む`constexpr`関数を条件付きで`consteval`関数とみなすようにする | - | 17 | 2024.0 | 2024.0 | | P1102R2: [ラムダ式で`()`を省略できる条件を緩和](/lang/cpp23/down_with_lambda_parens.md) | 修飾や戻り値型をともなってもパラメータリストが空であれば`()`を省略できる | 11 | 13 | 2022.2 | - | | P2173R1: [ラムダ式に対する属性](/lang/cpp23/attributes_on_lambda_expressions.md) | ラムダ式のいくつかの箇所に属性を記述できるようにする | 9 | 13 | 2022.2 | - | | P1774R8: [コード内容の仮定をコンパイラに伝えるassume属性](/lang/cpp23/portable_assumptions.md) | 最適化のために、コードの仮定をコンパイラに伝える属性を標準化する | 13 | - | - | - | From eef0639011e770371d6c76f9bb686bfcd1358b25 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 23 Dec 2024 15:19:33 +0900 Subject: [PATCH 1364/3948] =?UTF-8?q?C++26=E5=AF=BE=E5=BF=9C=E3=81=A8?= =?UTF-8?q?=E3=81=97=E3=81=A6atomic(=5Fref)=E3=81=ABfetch=5Fmax/min?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20(close=20#1188)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 2 +- reference/atomic.md | 4 + reference/atomic/atomic.md | 4 + reference/atomic/atomic/fetch_max.md | 72 ++++++++++++++++++ reference/atomic/atomic/fetch_min.md | 72 ++++++++++++++++++ reference/atomic/atomic_fetch_max.md | 71 ++++++++++++++++++ reference/atomic/atomic_fetch_max_explicit.md | 73 +++++++++++++++++++ reference/atomic/atomic_fetch_min.md | 71 ++++++++++++++++++ reference/atomic/atomic_fetch_min_explicit.md | 73 +++++++++++++++++++ reference/atomic/atomic_ref.md | 4 + reference/atomic/atomic_ref/fetch_max.md | 71 ++++++++++++++++++ reference/atomic/atomic_ref/fetch_min.md | 71 ++++++++++++++++++ 12 files changed, 587 insertions(+), 1 deletion(-) create mode 100644 reference/atomic/atomic/fetch_max.md create mode 100644 reference/atomic/atomic/fetch_min.md create mode 100644 reference/atomic/atomic_fetch_max.md create mode 100644 reference/atomic/atomic_fetch_max_explicit.md create mode 100644 reference/atomic/atomic_fetch_min.md create mode 100644 reference/atomic/atomic_fetch_min_explicit.md create mode 100644 reference/atomic/atomic_ref/fetch_max.md create mode 100644 reference/atomic/atomic_ref/fetch_min.md diff --git a/lang/cpp26.md b/lang/cpp26.md index a6d7388a4b..56ddce47de 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -224,7 +224,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 ### 並行・並列・非同期処理 - [``](/reference/execution.md)に汎用的な非同期実行を管理するフレームワークを追加 -- [`std::atomic`](/reference/atomic/atomic.md)オブジェクトに対する2つの値の最大値・最小値を取得する関数として、メンバ関数[`fetch_max()`](/reference/atomic/atomic/fetch_max.md.nolink)と[`fetch_min()`](/reference/atomic/atomic/fetch_min.md.nolink)、非メンバ関数として[`std::atomic_fetch_max`](/reference/atomic/atomic_fetch_max.md.nolink)、[`std::atomic_fetch_max_explicit`](/reference/atomic/atomic_fetch_max_explicit.md.nolink)、[`std::atomic_fetch_min`](/reference/atomic/atomic_fetch_min.md.nolink)、[`std::atomic_fetch_min_explicit`](/reference/atomic/atomic_fetch_min_explicit.md.nolink)を追加 +- [`std::atomic`](/reference/atomic/atomic.md)オブジェクトに対する2つの値の最大値・最小値を取得する関数として、メンバ関数[`fetch_max()`](/reference/atomic/atomic/fetch_max.md)と[`fetch_min()`](/reference/atomic/atomic/fetch_min.md)、非メンバ関数として[`std::atomic_fetch_max`](/reference/atomic/atomic_fetch_max.md)、[`std::atomic_fetch_max_explicit`](/reference/atomic/atomic_fetch_max_explicit.md)、[`std::atomic_fetch_min`](/reference/atomic/atomic_fetch_min.md)、[`std::atomic_fetch_min_explicit`](/reference/atomic/atomic_fetch_min_explicit.md)を追加 - [`std::atomic_ref`](/reference/atomic/atomic_ref.md)クラスに、参照するオブジェクトのアドレスを取得する[`address()`](/reference/atomic/atomic_ref/address.md.nolink)メンバ関数を追加 - [`std::atomic`](/reference/atomic/atomic.md)クラスのテンプレートパラメータとしてCV修飾された型を禁止 - [`std::atomic_ref`](/reference/atomic/atomic_ref.md)クラスのテンプレートパラメータとして、CV修飾された型を受け取れるようにした (内部でCV修飾が外される) diff --git a/reference/atomic.md b/reference/atomic.md index 16a356fc89..a03bc8f60d 100644 --- a/reference/atomic.md +++ b/reference/atomic.md @@ -75,6 +75,10 @@ | [`atomic_fetch_or_explicit`](atomic/atomic_fetch_or_explicit.md) | メモリオーダーを指定してOR演算(function template) | C++11 | | [`atomic_fetch_xor`](atomic/atomic_fetch_xor.md) | XOR演算(function template) | C++11 | | [`atomic_fetch_xor_explicit`](atomic/atomic_fetch_xor_explicit.md) | メモリオーダーを指定してXOR演算(function template) | C++11 | +| [`atomic_fetch_max`](atomic/atomic_fetch_max.md) | 最大値取得(function template) | C++26 | +| [`atomic_fetch_max_explicit`](atomic/atomic_fetch_max_explicit.md) | メモリオーダーを指定して最大値取得(function template) | C++26 | +| [`atomic_fetch_min`](atomic/atomic_fetch_min.md) | 最小値取得(function template) | C++26 | +| [`atomic_fetch_min_explicit`](atomic/atomic_fetch_min_explicit.md) | メモリオーダーを指定して最小値取得(function template) | C++26 | ## アトミック型に対するブロッキング同期操作 diff --git a/reference/atomic/atomic.md b/reference/atomic/atomic.md index d9c2b8b10a..3b03104d2a 100644 --- a/reference/atomic/atomic.md +++ b/reference/atomic/atomic.md @@ -162,6 +162,8 @@ namespace std { | [`fetch_and`](atomic/fetch_and.md) | AND演算 | C++11 | | [`fetch_or`](atomic/fetch_or.md) | OR演算 | C++11 | | [`fetch_xor`](atomic/fetch_xor.md) | XOR演算 | C++11 | +| [`fetch_max`](atomic/fetch_max.md) | 最大値取得 | C++26 | +| [`fetch_min`](atomic/fetch_min.md) | 最小値取得 | C++26 | | [`operator++`](atomic/op_increment.md) | インクリメント | C++11 | | [`operator--`](atomic/op_decrement.md) | デクリメント | C++11 | | [`operator+=`](atomic/op_plus_assign.md) | 加算 | C++11 | @@ -201,6 +203,8 @@ namespace std { |------|------|----------------| | [`fetch_add`](atomic/fetch_add.md) | 加算 | C++11 | | [`fetch_sub`](atomic/fetch_sub.md) | 減算 | C++11 | +| [`fetch_max`](atomic/fetch_max.md) | 最大値取得 | C++26 | +| [`fetch_min`](atomic/fetch_min.md) | 最小値取得 | C++26 | | [`operator++`](atomic/op_increment.md) | インクリメント | C++11 | | [`operator--`](atomic/op_decrement.md) | デクリメント | C++11 | | [`operator+=`](atomic/op_plus_assign.md) | 加算 | C++11 | diff --git a/reference/atomic/atomic/fetch_max.md b/reference/atomic/atomic/fetch_max.md new file mode 100644 index 0000000000..f4da609a65 --- /dev/null +++ b/reference/atomic/atomic/fetch_max.md @@ -0,0 +1,72 @@ +# fetch_max +* atomic[meta header] +* std[meta namespace] +* atomic[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +T fetch_max(difference_type operand, + memory_order order = memory_order_seq_cst + ) const noexcept; // (1) C++26 +``` +* memory_order[link /reference/atomic/memory_order.md] +* memory_order_seq_cst[link /reference/atomic/memory_order.md] + +## 概要 +最大値を取得する。 + +この関数は、`*this`が保持する値と`operand`の大きい方を返す。 + + +## テンプレートパラメータ制約 +- (1) : `std::atomic`の場合、型`T`がオブジェクト型であること。型`T`が`void*`や関数ポインタであってはならない + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、[`std::max()`](/reference/algorithm/max.md)アルゴリズムのように`*this`が保持する値と`operand`の最大値を求めて返す + + +## 例外 +投げない + + +## 備考 +- この関数は、`atomic`クラスの整数型、ポインタに対する特殊化で定義される (浮動小数点数型に対しては定義されない) +- ポインタ型 + - ポインタが異なる完全型オブジェクトを指している場合、`<`演算子による比較は狭義の弱順序を確立しない + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::atomic x(3); + + int ret = x.fetch_max(2); + + std::cout << ret << std::endl; +} +``` +* fetch_max[color ff0000] + + +### 出力 +``` +3 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 19 [mark noimpl] +- [GCC](/implementation.md#gcc): 14 [mark noimpl] + + +## 参照 +- [P0493R5 Atomic minimum/maximum](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0493r5.pdf) diff --git a/reference/atomic/atomic/fetch_min.md b/reference/atomic/atomic/fetch_min.md new file mode 100644 index 0000000000..576ab3fcf1 --- /dev/null +++ b/reference/atomic/atomic/fetch_min.md @@ -0,0 +1,72 @@ +# fetch_min +* atomic[meta header] +* std[meta namespace] +* atomic[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +T fetch_min(difference_type operand, + memory_order order = memory_order_seq_cst + ) const noexcept; // (1) C++26 +``` +* memory_order[link /reference/atomic/memory_order.md] +* memory_order_seq_cst[link /reference/atomic/memory_order.md] + +## 概要 +最小値を取得する。 + +この関数は、`*this`が保持する値と`operand`の大きい方を返す。 + + +## テンプレートパラメータ制約 +- (1) : `std::atomic`の場合、型`T`がオブジェクト型であること。型`T`が`void*`や関数ポインタであってはならない + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、[`std::min()`](/reference/algorithm/min.md)アルゴリズムのように`*this`が保持する値と`operand`の最小値を求めて返す + + +## 例外 +投げない + + +## 備考 +- この関数は、`atomic`クラスの整数型、ポインタに対する特殊化で定義される (浮動小数点数型に対しては定義されない) +- ポインタ型 + - ポインタが異なる完全型オブジェクトを指している場合、`<`演算子による比較は狭義の弱順序を確立しない + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::atomic x(3); + + int ret = x.fetch_min(2); + + std::cout << ret << std::endl; +} +``` +* fetch_min[color ff0000] + + +### 出力 +``` +2 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 19 [mark noimpl] +- [GCC](/implementation.md#gcc): 14 [mark noimpl] + + +## 参照 +- [P0493R5 Atomic minimum/maximum](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0493r5.pdf) diff --git a/reference/atomic/atomic_fetch_max.md b/reference/atomic/atomic_fetch_max.md new file mode 100644 index 0000000000..72fcef80de --- /dev/null +++ b/reference/atomic/atomic_fetch_max.md @@ -0,0 +1,71 @@ +# atomic_fetch_max +* atomic[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + T atomic_fetch_max(volatile atomic* object, + typename atomic::value_type operand) noexcept; // (1) C++26 + + template + T atomic_fetch_max(atomic* object, + typename atomic::value_type operand) noexcept; // (2) C++26 +} +``` +* atomic[link /reference/atomic/atomic.md] + + +## 概要 +アトミックに最大値を取得する + + +## テンプレートパラメータ制約 +- (1), (2) : 型`T`がオブジェクト型であること。型`T`が`void*`や関数ポインタであってはならない +- (1) : `atomic::is_always_lock_free`が`true`であること + + +## 効果 +[`memory_order_seq_cst`](memory_order.md)のメモリオーダーにしたがって、[`std::max()`](/reference/algorithm/max.md)アルゴリズムのように`*object`が保持する値と`operand`の最大値を求めて返す + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::atomic x(3); + + int ret = std::atomic_fetch_max(&x, 2); + + std::cout << ret << std::endl; +} +``` +* std::atomic_fetch_max[color ff0000] + +### 出力 +``` +3 +``` + + +## バージョン +### 言語 +- C++26 + + +### 処理系 +- [Clang](/implementation.md#clang): 19 [mark noimpl] +- [GCC](/implementation.md#gcc): 14 [mark noimpl] + + +## 参照 +- [P0493R5 Atomic minimum/maximum](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0493r5.pdf) diff --git a/reference/atomic/atomic_fetch_max_explicit.md b/reference/atomic/atomic_fetch_max_explicit.md new file mode 100644 index 0000000000..926a49f8ec --- /dev/null +++ b/reference/atomic/atomic_fetch_max_explicit.md @@ -0,0 +1,73 @@ +# atomic_fetch_max_explicit +* atomic[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + T atomic_fetch_max_explicit( + volatile atomic* object, + typename atomic::value_type operand, + memory_order order) noexcept; // (1) C++26 + + template + T atomic_fetch_max_explicit( + atomic* object, + typename atomic::value_type operand, + memory_order order) noexcept; // (2) C++26 +} +``` +* atomic[link atomic.md] +* memory_order[link memory_order.md] + +## 概要 +アトミックに最大値を取得する + + +## テンプレートパラメータ制約 +- (1), (2) : 型`T`がオブジェクト型であること。型`T`が`void*`や関数ポインタであってはならない +- (1) : `atomic::is_always_lock_free`が`true`であること + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、[`std::max()`](/reference/algorithm/max.md)アルゴリズムのように`*object`が保持する値と`operand`の最大値を求めて返す + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::atomic x(3); + + int ret = std::atomic_fetch_max_explicit(&x, 2, std::memory_order_seq_cst); + std::cout << ret << std::endl; +} +``` +* std::atomic_fetch_add_maxlicit[color ff0000] + + +### 出力 +``` +3 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 19 [mark noimpl] +- [GCC](/implementation.md#gcc): 14 [mark noimpl] + + +## 参照 +- [P0493R5 Atomic minimum/maximum](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0493r5.pdf) diff --git a/reference/atomic/atomic_fetch_min.md b/reference/atomic/atomic_fetch_min.md new file mode 100644 index 0000000000..69e4a164a8 --- /dev/null +++ b/reference/atomic/atomic_fetch_min.md @@ -0,0 +1,71 @@ +# atomic_fetch_min +* atomic[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + T atomic_fetch_min(volatile atomic* object, + typename atomic::value_type operand) noexcept; // (1) C++26 + + template + T atomic_fetch_min(atomic* object, + typename atomic::value_type operand) noexcept; // (2) C++26 +} +``` +* atomic[link /reference/atomic/atomic.md] + + +## 概要 +アトミックに最小値を取得する + + +## テンプレートパラメータ制約 +- (1), (2) : 型`T`がオブジェクト型であること。型`T`が`void*`や関数ポインタであってはならない +- (1) : `atomic::is_always_lock_free`が`true`であること + + +## 効果 +[`memory_order_seq_cst`](memory_order.md)のメモリオーダーにしたがって、[`std::min()`](/reference/algorithm/min.md)アルゴリズムのように`*object`が保持する値と`operand`の最小値を求めて返す + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::atomic x(3); + + int ret = std::atomic_fetch_min(&x, 2); + + std::cout << ret << std::endl; +} +``` +* std::atomic_fetch_min[color ff0000] + +### 出力 +``` +2 +``` + + +## バージョン +### 言語 +- C++26 + + +### 処理系 +- [Clang](/implementation.md#clang): 19 [mark noimpl] +- [GCC](/implementation.md#gcc): 14 [mark noimpl] + + +## 参照 +- [P0493R5 Atomic maximum/minimum](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0493r5.pdf) diff --git a/reference/atomic/atomic_fetch_min_explicit.md b/reference/atomic/atomic_fetch_min_explicit.md new file mode 100644 index 0000000000..003fcbf404 --- /dev/null +++ b/reference/atomic/atomic_fetch_min_explicit.md @@ -0,0 +1,73 @@ +# atomic_fetch_min_explicit +* atomic[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + T atomic_fetch_min_explicit( + volatile atomic* object, + typename atomic::value_type operand, + memory_order order) noexcept; // (1) C++26 + + template + T atomic_fetch_min_explicit( + atomic* object, + typename atomic::value_type operand, + memory_order order) noexcept; // (2) C++26 +} +``` +* atomic[link atomic.md] +* memory_order[link memory_order.md] + +## 概要 +アトミックに最小値を取得する + + +## テンプレートパラメータ制約 +- (1), (2) : 型`T`がオブジェクト型であること。型`T`が`void*`や関数ポインタであってはならない +- (1) : `atomic::is_always_lock_free`が`true`であること + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、[`std::min()`](/reference/algorithm/min.md)アルゴリズムのように`*object`が保持する値と`operand`の最小値を求めて返す + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::atomic x(3); + + int ret = std::atomic_fetch_min_explicit(&x, 2, std::memory_order_seq_cst); + std::cout << ret << std::endl; +} +``` +* std::atomic_fetch_add_maxlicit[color ff0000] + + +### 出力 +``` +2 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 19 [mark noimpl] +- [GCC](/implementation.md#gcc): 14 [mark noimpl] + + +## 参照 +- [P0493R5 Atomic minimum/maximum](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0493r5.pdf) diff --git a/reference/atomic/atomic_ref.md b/reference/atomic/atomic_ref.md index 156f23ca79..d9f77af792 100644 --- a/reference/atomic/atomic_ref.md +++ b/reference/atomic/atomic_ref.md @@ -89,6 +89,8 @@ C++26から、これらの特殊化はCV修飾された型に対しても行わ | [`fetch_and`](atomic_ref/fetch_and.md) | AND演算 | C++20 | | [`fetch_or`](atomic_ref/fetch_or.md) | OR演算 | C++20 | | [`fetch_xor`](atomic_ref/fetch_xor.md) | XOR演算 | C++20 | +| [`fetch_max`](atomic_ref/fetch_max.md) | 最大値取得 | C++26 | +| [`fetch_min`](atomic_ref/fetch_min.md) | 最小値取得 | C++26 | | [`operator++`](atomic_ref/op_increment.md) | インクリメント | C++20 | | [`operator--`](atomic_ref/op_decrement.md) | デクリメント | C++20 | | [`operator+=`](atomic_ref/op_plus_assign.md) | 加算 | C++20 | @@ -128,6 +130,8 @@ C++26から、これらの特殊化はCV修飾された型に対しても行わ |------|------|----------------| | [`fetch_add`](atomic_ref/fetch_add.md) | 加算 | C++20 | | [`fetch_sub`](atomic_ref/fetch_sub.md) | 減算 | C++20 | +| [`fetch_max`](atomic_ref/fetch_max.md) | 最大値取得 | C++26 | +| [`fetch_min`](atomic_ref/fetch_min.md) | 最小値取得 | C++26 | | [`operator++`](atomic_ref/op_increment.md) | インクリメント | C++20 | | [`operator--`](atomic_ref/op_decrement.md) | デクリメント | C++20 | | [`operator+=`](atomic_ref/op_plus_assign.md) | 加算 | C++20 | diff --git a/reference/atomic/atomic_ref/fetch_max.md b/reference/atomic/atomic_ref/fetch_max.md new file mode 100644 index 0000000000..eac81830ba --- /dev/null +++ b/reference/atomic/atomic_ref/fetch_max.md @@ -0,0 +1,71 @@ +# fetch_max +* atomic[meta header] +* std[meta namespace] +* atomic_ref[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +T fetch_max(difference_type operand, + memory_order order = memory_order_seq_cst + ) const noexcept; // (1) C++26 +``` +* memory_order[link /reference/atomic/memory_order.md] +* memory_order_seq_cst[link /reference/atomic/memory_order.md] + +## 概要 +最大値を取得する。 + +この関数は、`*this`が保持する値と`operand`の大きい方を返す。 + + +## テンプレートパラメータ制約 +- (1) : `std::atomic`の場合、型`T`がオブジェクト型であること。型`T`が`void*`や関数ポインタであってはならない + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、[`std::max()`](/reference/algorithm/max.md)アルゴリズムのように`*this`が保持する値と`operand`の最大値を求めて返す + + +## 例外 +投げない + + +## 備考 +- この関数は、`atomic`クラスの整数型、ポインタに対する特殊化で定義される (浮動小数点数型に対しては定義されない) +- ポインタ型 + - ポインタが異なる完全型オブジェクトを指している場合、`<`演算子による比較は狭義の弱順序を確立しない + + +## 例 +```cpp example +#include +#include + +int main() +{ + int x = 3; + int ret = std::atomic_ref{x}.fetch_max(2); + + std::cout << ret << std::endl; +} +``` +* fetch_max[color ff0000] + + +### 出力 +``` +3 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 19 [mark noimpl] +- [GCC](/implementation.md#gcc): 14 [mark noimpl] + + +## 参照 +- [P0493R5 Atomic minimum/maximum](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0493r5.pdf) diff --git a/reference/atomic/atomic_ref/fetch_min.md b/reference/atomic/atomic_ref/fetch_min.md new file mode 100644 index 0000000000..4beac43818 --- /dev/null +++ b/reference/atomic/atomic_ref/fetch_min.md @@ -0,0 +1,71 @@ +# fetch_min +* atomic[meta header] +* std[meta namespace] +* atomic_ref[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +T fetch_min(difference_type operand, + memory_order order = memory_order_seq_cst + ) const noexcept; // (1) C++26 +``` +* memory_order[link /reference/atomic/memory_order.md] +* memory_order_seq_cst[link /reference/atomic/memory_order.md] + +## 概要 +最小値を取得する。 + +この関数は、`*this`が保持する値と`operand`の大きい方を返す。 + + +## テンプレートパラメータ制約 +- (1) : `std::atomic`の場合、型`T`がオブジェクト型であること。型`T`が`void*`や関数ポインタであってはならない + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、[`std::min()`](/reference/algorithm/min.md)アルゴリズムのように`*this`が保持する値と`operand`の最小値を求めて返す + + +## 例外 +投げない + + +## 備考 +- この関数は、`atomic`クラスの整数型、ポインタに対する特殊化で定義される (浮動小数点数型に対しては定義されない) +- ポインタ型 + - ポインタが異なる完全型オブジェクトを指している場合、`<`演算子による比較は狭義の弱順序を確立しない + + +## 例 +```cpp example +#include +#include + +int main() +{ + int x = 3; + int ret = std::atomic_ref{x}.fetch_min(2); + + std::cout << ret << std::endl; +} +``` +* fetch_min[color ff0000] + + +### 出力 +``` +2 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 19 [mark noimpl] +- [GCC](/implementation.md#gcc): 14 [mark noimpl] + + +## 参照 +- [P0493R5 Atomic minimum/maximum](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0493r5.pdf) From d440b084cf68297223b7ebae85f363ee9cb16862 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 23 Dec 2024 15:38:09 +0900 Subject: [PATCH 1365/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE?= =?UTF-8?q?=E9=A3=BE=E3=83=9F=E3=82=B9=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/atomic/atomic_fetch_max_explicit.md | 2 +- reference/atomic/atomic_fetch_min_explicit.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/atomic/atomic_fetch_max_explicit.md b/reference/atomic/atomic_fetch_max_explicit.md index 926a49f8ec..17c2259b8b 100644 --- a/reference/atomic/atomic_fetch_max_explicit.md +++ b/reference/atomic/atomic_fetch_max_explicit.md @@ -52,7 +52,7 @@ int main() std::cout << ret << std::endl; } ``` -* std::atomic_fetch_add_maxlicit[color ff0000] +* std::atomic_fetch_max_explicit[color ff0000] ### 出力 diff --git a/reference/atomic/atomic_fetch_min_explicit.md b/reference/atomic/atomic_fetch_min_explicit.md index 003fcbf404..cac364da71 100644 --- a/reference/atomic/atomic_fetch_min_explicit.md +++ b/reference/atomic/atomic_fetch_min_explicit.md @@ -52,7 +52,7 @@ int main() std::cout << ret << std::endl; } ``` -* std::atomic_fetch_add_maxlicit[color ff0000] +* std::atomic_fetch_min_explicit[color ff0000] ### 出力 From 4324757146279c9a5be4816d920449928e2801fe Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 23 Dec 2024 16:58:47 +0900 Subject: [PATCH 1366/3948] =?UTF-8?q?atomic=20:=20C++26=E3=81=AEconstexpr?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C=20(close=20#1391)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../atomic/atomic/compare_exchange_strong.md | 57 ++++++++++++------- .../atomic/atomic/compare_exchange_weak.md | 57 ++++++++++++------- reference/atomic/atomic/exchange.md | 13 ++++- reference/atomic/atomic/fetch_add.md | 13 ++++- reference/atomic/atomic/fetch_and.md | 13 ++++- reference/atomic/atomic/fetch_max.md | 4 +- reference/atomic/atomic/fetch_min.md | 4 +- reference/atomic/atomic/fetch_or.md | 13 ++++- reference/atomic/atomic/fetch_sub.md | 13 ++++- reference/atomic/atomic/fetch_xor.md | 13 ++++- reference/atomic/atomic/load.md | 12 +++- reference/atomic/atomic/notify_all.md | 8 ++- reference/atomic/atomic/notify_one.md | 8 ++- reference/atomic/atomic/op_and_assign.md | 8 ++- reference/atomic/atomic/op_assign.md | 4 ++ reference/atomic/atomic/op_decrement.md | 20 ++++--- reference/atomic/atomic/op_increment.md | 20 ++++--- reference/atomic/atomic/op_minus_assign.md | 8 ++- reference/atomic/atomic/op_or_assign.md | 8 ++- reference/atomic/atomic/op_plus_assign.md | 8 ++- reference/atomic/atomic/op_t.md | 8 ++- reference/atomic/atomic/op_xor_assign.md | 8 ++- reference/atomic/atomic/store.md | 21 +++++-- reference/atomic/atomic/wait.md | 21 +++++-- .../atomic/atomic_compare_exchange_strong.md | 22 +++++-- ...atomic_compare_exchange_strong_explicit.md | 24 ++++++-- .../atomic/atomic_compare_exchange_weak.md | 22 +++++-- .../atomic_compare_exchange_weak_explicit.md | 24 ++++++-- reference/atomic/atomic_exchange.md | 21 +++++-- reference/atomic/atomic_exchange_explicit.md | 22 +++++-- reference/atomic/atomic_fetch_add.md | 21 +++++-- reference/atomic/atomic_fetch_add_explicit.md | 22 +++++-- reference/atomic/atomic_fetch_and.md | 21 +++++-- reference/atomic/atomic_fetch_and_explicit.md | 22 +++++-- reference/atomic/atomic_fetch_max.md | 7 ++- reference/atomic/atomic_fetch_max_explicit.md | 7 ++- reference/atomic/atomic_fetch_min.md | 7 ++- reference/atomic/atomic_fetch_min_explicit.md | 7 ++- reference/atomic/atomic_fetch_or.md | 21 +++++-- reference/atomic/atomic_fetch_or_explicit.md | 22 +++++-- reference/atomic/atomic_fetch_sub.md | 21 +++++-- reference/atomic/atomic_fetch_sub_explicit.md | 22 +++++-- reference/atomic/atomic_fetch_xor.md | 21 +++++-- reference/atomic/atomic_fetch_xor_explicit.md | 22 +++++-- reference/atomic/atomic_flag/clear.md | 16 ++++-- reference/atomic/atomic_flag/notify_all.md | 8 ++- reference/atomic/atomic_flag/notify_one.md | 8 ++- reference/atomic/atomic_flag/test.md | 14 ++++- reference/atomic/atomic_flag/test_and_set.md | 16 ++++-- reference/atomic/atomic_flag/wait.md | 17 +++++- reference/atomic/atomic_flag_clear.md | 13 +++-- .../atomic/atomic_flag_clear_explicit.md | 18 +++++- reference/atomic/atomic_flag_notify_all.md | 14 ++++- reference/atomic/atomic_flag_notify_one.md | 14 ++++- reference/atomic/atomic_flag_test.md | 11 +++- reference/atomic/atomic_flag_test_and_set.md | 13 +++-- .../atomic_flag_test_and_set_explicit.md | 19 +++++-- reference/atomic/atomic_flag_test_explicit.md | 16 ++++-- reference/atomic/atomic_flag_wait.md | 17 +++++- reference/atomic/atomic_flag_wait_explicit.md | 24 ++++++-- reference/atomic/atomic_load.md | 11 +++- reference/atomic/atomic_load_explicit.md | 13 ++++- reference/atomic/atomic_notify_all.md | 11 +++- reference/atomic/atomic_notify_one.md | 11 +++- .../atomic_ref/compare_exchange_strong.md | 6 +- .../atomic_ref/compare_exchange_weak.md | 6 +- reference/atomic/atomic_ref/exchange.md | 4 +- reference/atomic/atomic_ref/fetch_add.md | 4 +- reference/atomic/atomic_ref/fetch_and.md | 4 +- reference/atomic/atomic_ref/fetch_max.md | 4 +- reference/atomic/atomic_ref/fetch_min.md | 5 +- reference/atomic/atomic_ref/fetch_or.md | 4 +- reference/atomic/atomic_ref/fetch_sub.md | 4 +- reference/atomic/atomic_ref/fetch_xor.md | 4 +- reference/atomic/atomic_ref/load.md | 8 ++- reference/atomic/atomic_ref/notify_all.md | 5 +- reference/atomic/atomic_ref/notify_one.md | 5 +- reference/atomic/atomic_ref/op_and_assign.md | 8 ++- reference/atomic/atomic_ref/op_assign.md | 8 ++- reference/atomic/atomic_ref/op_constructor.md | 9 ++- reference/atomic/atomic_ref/op_decrement.md | 13 ++++- reference/atomic/atomic_ref/op_increment.md | 13 ++++- .../atomic/atomic_ref/op_minus_assign.md | 8 ++- reference/atomic/atomic_ref/op_or_assign.md | 8 ++- reference/atomic/atomic_ref/op_plus_assign.md | 8 ++- reference/atomic/atomic_ref/op_value_type.md | 4 +- reference/atomic/atomic_ref/op_xor_assign.md | 8 ++- reference/atomic/atomic_ref/store.md | 12 ++-- reference/atomic/atomic_ref/wait.md | 4 +- reference/atomic/atomic_signal_fence.md | 12 +++- reference/atomic/atomic_store.md | 28 +++++---- reference/atomic/atomic_store_explicit.md | 21 +++++-- reference/atomic/atomic_thread_fence.md | 10 +++- reference/atomic/atomic_wait.md | 16 ++++-- reference/atomic/atomic_wait_explicit.md | 21 +++++-- reference/atomic/kill_dependency.md | 7 ++- 96 files changed, 974 insertions(+), 331 deletions(-) diff --git a/reference/atomic/atomic/compare_exchange_strong.md b/reference/atomic/atomic/compare_exchange_strong.md index efc248a09a..f1beed8cb2 100644 --- a/reference/atomic/atomic/compare_exchange_strong.md +++ b/reference/atomic/atomic/compare_exchange_strong.md @@ -6,25 +6,42 @@ * cpp11[meta cpp] ```cpp -bool compare_exchange_strong(T& expected, - T desired, - memory_order success, - memory_order failure - ) volatile noexcept; // (1) C++11 -bool compare_exchange_strong(T& expected, - T desired, - memory_order success, - memory_order failure - ) noexcept; // (2) C++11 - -bool compare_exchange_strong(T& expected, - T desired, - memory_order order = memory_order_seq_cst - ) volatile noexcept; // (3) C++11 -bool compare_exchange_strong(T& expected, - T desired, - memory_order order = memory_order_seq_cst - ) noexcept; // (4) C++11 +bool + compare_exchange_strong(T& expected, + T desired, + memory_order success, + memory_order failure + ) volatile noexcept; // (1) C++11 + +bool + compare_exchange_strong(T& expected, + T desired, + memory_order success, + memory_order failure + ) noexcept; // (2) C++11 +constexpr bool + compare_exchange_strong(T& expected, + T desired, + memory_order success, + memory_order failure + ) noexcept; // (2) C++26 + +bool + compare_exchange_strong(T& expected, + T desired, + memory_order order = memory_order_seq_cst + ) volatile noexcept; // (3) C++11 + +bool + compare_exchange_strong(T& expected, + T desired, + memory_order order = memory_order_seq_cst + ) noexcept; // (4) C++11 +constexpr bool + compare_exchange_strong(T& expected, + T desired, + memory_order order = memory_order_seq_cst + ) noexcept; // (4) C++26 ``` * memory_order[link /reference/atomic/memory_order.md] * memory_order_seq_cst[link /reference/atomic/memory_order.md] @@ -180,3 +197,5 @@ true - [Understand `std::atomic::compare_exchange_weak()` in C++11 - Eric Z's blog](https://tonywearme.wordpress.com/2014/08/15/understand-stdatomiccompare_exchange_weak-in-c11/) - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic/compare_exchange_weak.md b/reference/atomic/atomic/compare_exchange_weak.md index 68c4f23bb4..6ae981e4d9 100644 --- a/reference/atomic/atomic/compare_exchange_weak.md +++ b/reference/atomic/atomic/compare_exchange_weak.md @@ -6,25 +6,42 @@ * cpp11[meta cpp] ```cpp -bool compare_exchange_weak(T& expected, - T desired, - memory_order success, - memory_order failure - ) volatile noexcept; // (1) C++11 -bool compare_exchange_weak(T& expected, - T desired, - memory_order success, - memory_order failure - ) noexcept; // (2) C++11 - -bool compare_exchange_weak(T& expected, - T desired, - memory_order order = memory_order_seq_cst - ) volatile noexcept; // (3) C++11 -bool compare_exchange_weak(T& expected, - T desired, - memory_order order = memory_order_seq_cst - ) noexcept; // (4) C++11 +bool + compare_exchange_weak(T& expected, + T desired, + memory_order success, + memory_order failure + ) volatile noexcept; // (1) C++11 + +bool + compare_exchange_weak(T& expected, + T desired, + memory_order success, + memory_order failure + ) noexcept; // (2) C++11 +constexpr bool + compare_exchange_weak(T& expected, + T desired, + memory_order success, + memory_order failure + ) noexcept; // (2) C++26 + +bool + compare_exchange_weak(T& expected, + T desired, + memory_order order = memory_order_seq_cst + ) volatile noexcept; // (3) C++11 + +bool + compare_exchange_weak(T& expected, + T desired, + memory_order order = memory_order_seq_cst + ) noexcept; // (4) C++11 +constexpr bool + compare_exchange_weak(T& expected, + T desired, + memory_order order = memory_order_seq_cst + ) noexcept; // (4) C++26 ``` * memory_order[link /reference/atomic/memory_order.md] * memory_order_seq_cst[link /reference/atomic/memory_order.md] @@ -205,3 +222,5 @@ int main() - [Understand `std::atomic::compare_exchange_weak()` in C++11 - Eric Z's blog](https://tonywearme.wordpress.com/2014/08/15/understand-stdatomiccompare_exchange_weak-in-c11/) - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic/exchange.md b/reference/atomic/atomic/exchange.md index ecad452c20..a0eb2da879 100644 --- a/reference/atomic/atomic/exchange.md +++ b/reference/atomic/atomic/exchange.md @@ -6,12 +6,19 @@ * cpp11[meta cpp] ```cpp -T exchange(T desired, +T + exchange(T desired, memory_order order = memory_order_seq_cst ) volatile noexcept; // (1) C++11 -T exchange(T desired, + +T + exchange(T desired, memory_order order = memory_order_seq_cst ) noexcept; // (2) C++11 +constexpr T + exchange(T desired, + memory_order order = memory_order_seq_cst + ) noexcept; // (2) C++26 ``` * memory_order[link /reference/atomic/memory_order.md] * memory_order_seq_cst[link /reference/atomic/memory_order.md] @@ -81,3 +88,5 @@ replaced 1 by 2 ## 参照 - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic/fetch_add.md b/reference/atomic/atomic/fetch_add.md index 950f569c97..b62930bbd0 100644 --- a/reference/atomic/atomic/fetch_add.md +++ b/reference/atomic/atomic/fetch_add.md @@ -6,12 +6,19 @@ * cpp11[meta cpp] ```cpp -T fetch_add(difference_type operand, +T + fetch_add(difference_type operand, memory_order order = memory_order_seq_cst ) volatile noexcept; // (1) C++11 -T fetch_add(difference_type operand, + +T + fetch_add(difference_type operand, memory_order order = memory_order_seq_cst ) noexcept; // (2) C++11 +constexpr T + fetch_add(difference_type operand, + memory_order order = memory_order_seq_cst + ) noexcept; // (2) C++26 ``` * memory_order[link /reference/atomic/memory_order.md] * memory_order_seq_cst[link /reference/atomic/memory_order.md] @@ -154,3 +161,5 @@ int main() - C++20での、浮動小数点数版の追加 - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic/fetch_and.md b/reference/atomic/atomic/fetch_and.md index 673aef1e40..8209763f8e 100644 --- a/reference/atomic/atomic/fetch_and.md +++ b/reference/atomic/atomic/fetch_and.md @@ -6,12 +6,19 @@ * cpp11[meta cpp] ```cpp -T fetch_and(T operand, +T + fetch_and(T operand, memory_order order = memory_order_seq_cst ) volatile noexcept; // (1) C++11 -T fetch_and(T operand, + +T + fetch_and(T operand, memory_order order = memory_order_seq_cst ) noexcept; // (2) C++11 +constexpr T + fetch_and(T operand, + memory_order order = memory_order_seq_cst + ) noexcept; // (2) C++26 ``` * memory_order[link /reference/atomic/memory_order.md] * memory_order_seq_cst[link /reference/atomic/memory_order.md] @@ -131,3 +138,5 @@ int main() - C++17での、オブジェクト型であることの制約追加 - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic/fetch_max.md b/reference/atomic/atomic/fetch_max.md index f4da609a65..117fb1640e 100644 --- a/reference/atomic/atomic/fetch_max.md +++ b/reference/atomic/atomic/fetch_max.md @@ -6,7 +6,8 @@ * cpp26[meta cpp] ```cpp -T fetch_max(difference_type operand, +constexpr T + fetch_max(difference_type operand, memory_order order = memory_order_seq_cst ) const noexcept; // (1) C++26 ``` @@ -70,3 +71,4 @@ int main() ## 参照 - [P0493R5 Atomic minimum/maximum](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0493r5.pdf) +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) diff --git a/reference/atomic/atomic/fetch_min.md b/reference/atomic/atomic/fetch_min.md index 576ab3fcf1..e813120f4b 100644 --- a/reference/atomic/atomic/fetch_min.md +++ b/reference/atomic/atomic/fetch_min.md @@ -6,7 +6,8 @@ * cpp26[meta cpp] ```cpp -T fetch_min(difference_type operand, +constexpr T + fetch_min(difference_type operand, memory_order order = memory_order_seq_cst ) const noexcept; // (1) C++26 ``` @@ -70,3 +71,4 @@ int main() ## 参照 - [P0493R5 Atomic minimum/maximum](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0493r5.pdf) +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) diff --git a/reference/atomic/atomic/fetch_or.md b/reference/atomic/atomic/fetch_or.md index 988ba029e9..9135670e25 100644 --- a/reference/atomic/atomic/fetch_or.md +++ b/reference/atomic/atomic/fetch_or.md @@ -6,12 +6,19 @@ * cpp11[meta cpp] ```cpp -T fetch_or(T operand, +T + fetch_or(T operand, memory_order order = memory_order_seq_cst ) volatile noexcept; // (1) C++11 -T fetch_or(T operand, + +T + fetch_or(T operand, memory_order order = memory_order_seq_cst ) noexcept; // (2) C++11 +constexpr T + fetch_or(T operand, + memory_order order = memory_order_seq_cst + ) noexcept; // (2) C++26 ``` * memory_order[link /reference/atomic/memory_order.md] * memory_order_seq_cst[link /reference/atomic/memory_order.md] @@ -131,3 +138,5 @@ int main() - C++17での、オブジェクト型であることの制約追加 - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic/fetch_sub.md b/reference/atomic/atomic/fetch_sub.md index 16f9bfc1ae..e81ec5c8d1 100644 --- a/reference/atomic/atomic/fetch_sub.md +++ b/reference/atomic/atomic/fetch_sub.md @@ -6,12 +6,19 @@ * cpp11[meta cpp] ```cpp -T fetch_sub(difference_type operand, +T + fetch_sub(difference_type operand, memory_order order = memory_order_seq_cst ) volatile noexcept; // (1) C++11 -T fetch_sub(difference_type operand, + +T + fetch_sub(difference_type operand, memory_order order = memory_order_seq_cst ) noexcept; // (2) C++11 +constexpr T + fetch_sub(difference_type operand, + memory_order order = memory_order_seq_cst + ) noexcept; // (2) C++26 ``` * memory_order[link /reference/atomic/memory_order.md] * memory_order_seq_cst[link /reference/atomic/memory_order.md] @@ -151,3 +158,5 @@ int main() - C++20での、浮動小数点数版の追加 - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic/fetch_xor.md b/reference/atomic/atomic/fetch_xor.md index f00b996bf8..40e99fff16 100644 --- a/reference/atomic/atomic/fetch_xor.md +++ b/reference/atomic/atomic/fetch_xor.md @@ -6,12 +6,19 @@ * cpp11[meta cpp] ```cpp -T fetch_xor(T operand, +T + fetch_xor(T operand, memory_order order = memory_order_seq_cst ) volatile noexcept; // (1) C++11 -T fetch_xor(T operand, + +T + fetch_xor(T operand, memory_order order = memory_order_seq_cst ) noexcept; // (2) C++11 +constexpr T + fetch_xor(T operand, + memory_order order = memory_order_seq_cst + ) noexcept; // (2) C++26 ``` * memory_order[link /reference/atomic/memory_order.md] * memory_order_seq_cst[link /reference/atomic/memory_order.md] @@ -133,3 +140,5 @@ int main() - C++17での、オブジェクト型であることの制約追加 - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic/load.md b/reference/atomic/atomic/load.md index 122d12e8a9..6d9c3db9f0 100644 --- a/reference/atomic/atomic/load.md +++ b/reference/atomic/atomic/load.md @@ -6,10 +6,16 @@ * cpp11[meta cpp] ```cpp -T load(memory_order order = memory_order_seq_cst +T + load(memory_order order = memory_order_seq_cst ) const volatile noexcept; // (1) C++11 -T load(memory_order order = memory_order_seq_cst + +T + load(memory_order order = memory_order_seq_cst ) const noexcept; // (2) C++11 +constexpr T + load(memory_order order = memory_order_seq_cst + ) const noexcept; // (2) C++26 ``` * memory_order[link /reference/atomic/memory_order.md] * memory_order_seq_cst[link /reference/atomic/memory_order.md] @@ -82,3 +88,5 @@ int main() ## 参照 - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic/notify_all.md b/reference/atomic/atomic/notify_all.md index d861d0a2d3..53841c4106 100644 --- a/reference/atomic/atomic/notify_all.md +++ b/reference/atomic/atomic/notify_all.md @@ -6,8 +6,10 @@ * cpp20[meta cpp] ```cpp -void notify_all() volatile noexcept; // (1) C++20 -void notify_all() noexcept; // (2) C++20 +void notify_all() volatile noexcept; // (1) C++20 + +void notify_all() noexcept; // (2) C++20 +constexpr void notify_all() noexcept; // (2) C++26 ``` ## 概要 @@ -91,3 +93,5 @@ int main() - [ogiroux/atomic_wait - Sample implementation of C++20 atomic_wait/notify](https://github.com/ogiroux/atomic_wait) - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic/notify_one.md b/reference/atomic/atomic/notify_one.md index 9cad212caa..70f306111f 100644 --- a/reference/atomic/atomic/notify_one.md +++ b/reference/atomic/atomic/notify_one.md @@ -6,8 +6,10 @@ * cpp20[meta cpp] ```cpp -void notify_one() volatile noexcept; // (1) C++20 -void notify_one() noexcept; // (2) C++20 +void notify_one() volatile noexcept; // (1) C++20 + +void notify_one() noexcept; // (2) C++20 +constexpr void notify_one() noexcept; // (2) C++26 ``` ## 概要 @@ -117,3 +119,5 @@ int main() - [ogiroux/atomic_wait - Sample implementation of C++20 atomic_wait/notify](https://github.com/ogiroux/atomic_wait) - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic/op_and_assign.md b/reference/atomic/atomic/op_and_assign.md index 23312eab7c..530fdeb711 100644 --- a/reference/atomic/atomic/op_and_assign.md +++ b/reference/atomic/atomic/op_and_assign.md @@ -6,8 +6,10 @@ * cpp11[meta cpp] ```cpp -T operator&=(T operand) volatile noexcept; // (1) C++11 -T operator&=(T operand) noexcept; // (2) C++11 +T operator&=(T operand) volatile noexcept; // (1) C++11 + +T operator&=(T operand) noexcept; // (2) C++11 +constexpr T operator&=(T operand) noexcept; // (2) C++26 ``` ## 概要 @@ -123,3 +125,5 @@ int main() ## 参照 - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic/op_assign.md b/reference/atomic/atomic/op_assign.md index c5e2b19e9b..2d09579213 100644 --- a/reference/atomic/atomic/op_assign.md +++ b/reference/atomic/atomic/op_assign.md @@ -10,7 +10,9 @@ atomic& operator=(const atomic&) = delete; // (1) C++11 atomic& operator=(const atomic&) volatile = delete; // (2) C++11 T operator=(T desired) volatile noexcept; // (3) C++11 + T operator=(T desired) noexcept; // (4) C++11 +constexpr T operator=(T desired) noexcept; // (4) C++26 ``` ## 概要 @@ -77,3 +79,5 @@ int main() ## 参照 - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic/op_decrement.md b/reference/atomic/atomic/op_decrement.md index 9073ba75f3..3db4228cf6 100644 --- a/reference/atomic/atomic/op_decrement.md +++ b/reference/atomic/atomic/op_decrement.md @@ -6,17 +6,19 @@ * cpp11[meta cpp] ```cpp -T operator--() volatile noexcept; // (1) C++11 -value_type operator--() volatile noexcept; // (1) C++20 +T operator--() volatile noexcept; // (1) C++11 +value_type operator--() volatile noexcept; // (1) C++20 -T operator--() noexcept; // (2) C++11 -value_type operator--() noexcept; // (2) C++20 +T operator--() noexcept; // (2) C++11 +value_type operator--() noexcept; // (2) C++20 +constexpr value_type operator--() noexcept; // (2) C++26 -T operator--(int) volatile noexcept; // (3) C++11 -value_type operator--(int) volatile noexcept; // (3) C++20 +T operator--(int) volatile noexcept; // (3) C++11 +value_type operator--(int) volatile noexcept; // (3) C++20 -T operator--(int) noexcept; // (4) C++11 -value_type operator--(int) noexcept; // (4) C++20 +T operator--(int) noexcept; // (4) C++11 +value_type operator--(int) noexcept; // (4) C++20 +constexpr value_type operator--(int) noexcept; // (4) C++26 ``` ## 概要 @@ -123,3 +125,5 @@ int main() - C++20での、`volatile`版への制約追加 - [P1960R0 NB Comment Changes Reviewed by SG1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1960r0.html) - 戻り値の型を`T`から`value_type`に変更 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic/op_increment.md b/reference/atomic/atomic/op_increment.md index 683ee6e013..cb75999fc7 100644 --- a/reference/atomic/atomic/op_increment.md +++ b/reference/atomic/atomic/op_increment.md @@ -6,17 +6,19 @@ * cpp11[meta cpp] ```cpp -T operator++() volatile noexcept; // (1) C++11 -value_type operator++() volatile noexcept; // (1) C++20 +T operator++() volatile noexcept; // (1) C++11 +value_type operator++() volatile noexcept; // (1) C++20 -T operator++() noexcept; // (2) C++11 -value_type operator++() noexcept; // (2) C++20 +T operator++() noexcept; // (2) C++11 +value_type operator++() noexcept; // (2) C++20 +constexpr value_type operator++() noexcept; // (2) C++26 -T operator++(int) volatile noexcept; // (3) C++11 -value_type operator++(int) volatile noexcept; // (3) C++20 +T operator++(int) volatile noexcept; // (3) C++11 +value_type operator++(int) volatile noexcept; // (3) C++20 -T operator++(int) noexcept; // (4) C++11 -value_type operator++(int) noexcept; // (4) C++20 +T operator++(int) noexcept; // (4) C++11 +value_type operator++(int) noexcept; // (4) C++20 +constexpr value_type operator++(int) noexcept; // (4) C++26 ``` ## 概要 @@ -126,3 +128,5 @@ int main() - C++20での、`volatile`版への制約追加 - [P1960R0 NB Comment Changes Reviewed by SG1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1960r0.html) - 戻り値の型を`T`から`value_type`に変更 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic/op_minus_assign.md b/reference/atomic/atomic/op_minus_assign.md index 097d5d2c93..837f70a1eb 100644 --- a/reference/atomic/atomic/op_minus_assign.md +++ b/reference/atomic/atomic/op_minus_assign.md @@ -6,8 +6,10 @@ * cpp11[meta cpp] ```cpp -T operator-=(T operand) volatile noexcept; // (1) C++11 -T operator-=(T operand) noexcept; // (2) C++11 +T operator-=(T operand) volatile noexcept; // (1) C++11 + +T operator-=(T operand) noexcept; // (2) C++11 +constexpr T operator-=(T operand) noexcept; // (2) C++26 ``` ## 概要 @@ -144,3 +146,5 @@ int main() - C++20での、浮動小数点数版の追加 - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic/op_or_assign.md b/reference/atomic/atomic/op_or_assign.md index 4f63f0972c..d06db19227 100644 --- a/reference/atomic/atomic/op_or_assign.md +++ b/reference/atomic/atomic/op_or_assign.md @@ -6,8 +6,10 @@ * cpp11[meta cpp] ```cpp -T operator|=(T operand) volatile noexcept; // (1) C++11 -T operator|=(T operand) noexcept; // (2) C++11 +T operator|=(T operand) volatile noexcept; // (1) C++11 + +T operator|=(T operand) noexcept; // (2) C++11 +constexpr T operator|=(T operand) noexcept; // (2) C++26 ``` ## 概要 @@ -124,3 +126,5 @@ int main() ## 参照 - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic/op_plus_assign.md b/reference/atomic/atomic/op_plus_assign.md index b8f5b235d7..e397edc549 100644 --- a/reference/atomic/atomic/op_plus_assign.md +++ b/reference/atomic/atomic/op_plus_assign.md @@ -6,8 +6,10 @@ * cpp11[meta cpp] ```cpp -T operator+=(T operand) volatile noexcept; // (1) C++11 -T operator+=(T operand) noexcept; // (2) C++11 +T operator+=(T operand) volatile noexcept; // (1) C++11 + +T operator+=(T operand) noexcept; // (2) C++11 +constexpr T operator+=(T operand) noexcept; // (2) C++26 ``` ## 概要 @@ -142,3 +144,5 @@ int main() - C++20での、浮動小数点数版の追加 - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic/op_t.md b/reference/atomic/atomic/op_t.md index d642b30d47..cf76ea75a9 100644 --- a/reference/atomic/atomic/op_t.md +++ b/reference/atomic/atomic/op_t.md @@ -6,8 +6,10 @@ * cpp11[meta cpp] ```cpp -operator T() const volatile noexcept; // (1) C++11 -operator T() const noexcept; // (2) C++11 +operator T() const volatile noexcept; // (1) C++11 + +operator T() const noexcept; // (2) C++11 +constexpr operator T() const noexcept; // (2) C++26 ``` ## 概要 @@ -66,3 +68,5 @@ int main() - [N2514 Implicit Conversion Operators for Atomics](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2514.html) - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic/op_xor_assign.md b/reference/atomic/atomic/op_xor_assign.md index c27ab068f5..bb350f8986 100644 --- a/reference/atomic/atomic/op_xor_assign.md +++ b/reference/atomic/atomic/op_xor_assign.md @@ -6,8 +6,10 @@ * cpp11[meta cpp] ```cpp -T operator^=(T operand) volatile noexcept; // (1) C++11 -T operator^=(T operand) noexcept; // (2) C++11 +T operator^=(T operand) volatile noexcept; // (1) C++11 + +T operator^=(T operand) noexcept; // (2) C++11 +constexpr T operator^=(T operand) noexcept; // (2) C++26 ``` ## 概要 @@ -126,3 +128,5 @@ int main() ## 参照 - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic/store.md b/reference/atomic/atomic/store.md index 43fb105efb..da13dfc8d9 100644 --- a/reference/atomic/atomic/store.md +++ b/reference/atomic/atomic/store.md @@ -6,12 +6,19 @@ * cpp11[meta cpp] ```cpp -void store(T desired, - memory_order order = memory_order_seq_cst - ) volatile noexcept; // (1) C++11 -void store(T desired, - memory_order order = memory_order_seq_cst - ) noexcept; // (2) C++11 +void + store(T desired, + memory_order order = memory_order_seq_cst + ) volatile noexcept; // (1) C++11 + +void + store(T desired, + memory_order order = memory_order_seq_cst + ) noexcept; // (2) C++11 +constexpr void + store(T desired, + memory_order order = memory_order_seq_cst + ) noexcept; // (2) C++26 ``` * memory_order[link /reference/atomic/memory_order.md] * memory_order_seq_cst[link /reference/atomic/memory_order.md] @@ -87,3 +94,5 @@ int main() ## 参照 - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic/wait.md b/reference/atomic/atomic/wait.md index d940060c39..226c45d3b4 100644 --- a/reference/atomic/atomic/wait.md +++ b/reference/atomic/atomic/wait.md @@ -6,12 +6,19 @@ * cpp20[meta cpp] ```cpp -void wait(T old, - memory_order order = memory_order::seq_cst - ) const volatile noexcept; // (1) C++20 -void wait(T old, - memory_order order = memory_order::seq_cst - ) const noexcept; // (2) C++20 +void + wait(T old, + memory_order order = memory_order::seq_cst + ) const volatile noexcept; // (1) C++20 + +void + wait(T old, + memory_order order = memory_order::seq_cst + ) const noexcept; // (2) C++20 +constexpr void + wait(T old, + memory_order order = memory_order::seq_cst + ) const noexcept; // (2) C++26 ``` * memory_order[link /reference/atomic/memory_order.md] @@ -132,3 +139,5 @@ int main() - [ogiroux/atomic_wait - Sample implementation of C++20 atomic_wait/notify](https://github.com/ogiroux/atomic_wait) - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_compare_exchange_strong.md b/reference/atomic/atomic_compare_exchange_strong.md index 7cecd9045b..bb1a04ab0c 100644 --- a/reference/atomic/atomic_compare_exchange_strong.md +++ b/reference/atomic/atomic_compare_exchange_strong.md @@ -7,28 +7,36 @@ ```cpp namespace std { template - bool atomic_compare_exchange_strong( + bool + atomic_compare_exchange_strong( volatile atomic* object, T* expected, T desired) noexcept; // (1) C++11 - template - bool atomic_compare_exchange_strong( + bool + atomic_compare_exchange_strong( volatile atomic* object, typename atomic::value_type* expected, typename atomic::value_type desired) noexcept; // (1) C++17 template - bool atomic_compare_exchange_strong( + bool + atomic_compare_exchange_strong( atomic* object, T* expected, T desired) noexcept; // (2) C++11 - template - bool atomic_compare_exchange_strong( + bool + atomic_compare_exchange_strong( atomic* object, typename atomic::value_type* expected, typename atomic::value_type desired) noexcept; // (2) C++17 + template + constexpr bool + atomic_compare_exchange_strong( + atomic* object, + typename atomic::value_type* expected, + typename atomic::value_type desired) noexcept; // (2) C++26 } ``` * atomic[link atomic.md] @@ -129,3 +137,5 @@ false 3 3 - [P0558R1 Resolving `atomic` named base class inconsistencies](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0558r1.pdf) - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_compare_exchange_strong_explicit.md b/reference/atomic/atomic_compare_exchange_strong_explicit.md index f1f4885f36..cd22b992a4 100644 --- a/reference/atomic/atomic_compare_exchange_strong_explicit.md +++ b/reference/atomic/atomic_compare_exchange_strong_explicit.md @@ -7,15 +7,16 @@ ```cpp namespace std { template - bool atomic_compare_exchange_strong_explicit( + bool + atomic_compare_exchange_strong_explicit( volatile atomic* object, T* expected, T desired, memory_order success, memory_order failure) noexcept; // (1) C++11 - template - bool atomic_compare_exchange_strong_explicit( + bool + atomic_compare_exchange_strong_explicit( volatile atomic* object, typename atomic::value_type* expected, typename atomic::value_type desired, @@ -23,15 +24,24 @@ namespace std { memory_order failure) noexcept; // (1) C++17 template - bool atomic_compare_exchange_strong_explicit( + bool + atomic_compare_exchange_strong_explicit( atomic* object, T* expected, T desired, memory_order success, memory_order failure) noexcept; // (2) C++11 - template - bool atomic_compare_exchange_strong_explicit( + bool + atomic_compare_exchange_strong_explicit( + atomic* object, + typename atomic::value_type* expected, + typename atomic::value_type desired, + memory_order success, + memory_order failure) noexcept; // (2) C++17 + template + constexpr bool + atomic_compare_exchange_strong_explicit( atomic* object, typename atomic::value_type* expected, typename atomic::value_type desired, @@ -149,3 +159,5 @@ false 3 3 - [P0558R1 Resolving `atomic` named base class inconsistencies](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0558r1.pdf) - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_compare_exchange_weak.md b/reference/atomic/atomic_compare_exchange_weak.md index 87e0629a95..2e55ec151e 100644 --- a/reference/atomic/atomic_compare_exchange_weak.md +++ b/reference/atomic/atomic_compare_exchange_weak.md @@ -7,28 +7,36 @@ ```cpp namespace std { template - bool atomic_compare_exchange_weak( + bool + atomic_compare_exchange_weak( volatile atomic* object, T* expected, T desired) noexcept; // (1) C++11 - template - bool atomic_compare_exchange_weak( + bool + atomic_compare_exchange_weak( volatile atomic* object, typename atomic::value_type* expected, typename atomic::value_type desired) noexcept; // (1) C++17 template - bool atomic_compare_exchange_weak( + bool + atomic_compare_exchange_weak( atomic* object, T* expected, T desired) noexcept; // (2) C++11 - template - bool atomic_compare_exchange_weak( + bool + atomic_compare_exchange_weak( atomic* object, typename atomic::value_type* expected, typename atomic::value_type desired) noexcept; // (2) C++17 + template + constexpr bool + atomic_compare_exchange_weak( + atomic* object, + typename atomic::value_type* expected, + typename atomic::value_type desired) noexcept; // (2) C++26 } ``` * atomic[link atomic.md] @@ -133,3 +141,5 @@ false 3 3 - [P0558R1 Resolving `atomic` named base class inconsistencies](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0558r1.pdf) - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_compare_exchange_weak_explicit.md b/reference/atomic/atomic_compare_exchange_weak_explicit.md index 397bb63923..6c2274c3bd 100644 --- a/reference/atomic/atomic_compare_exchange_weak_explicit.md +++ b/reference/atomic/atomic_compare_exchange_weak_explicit.md @@ -7,15 +7,16 @@ ```cpp namespace std { template - bool atomic_compare_exchange_weak_explicit( + bool + atomic_compare_exchange_weak_explicit( volatile atomic* object, T* expected, T desired, memory_order success, memory_order failure) noexcept; // (1) C++11 - template - bool atomic_compare_exchange_weak_explicit( + bool + atomic_compare_exchange_weak_explicit( volatile atomic* object, typename atomic::value_type* expected, typename atomic::value_type desired, @@ -23,20 +24,29 @@ namespace std { memory_order failure) noexcept; // (1) C++17 template - bool atomic_compare_exchange_weak_explicit( + bool + atomic_compare_exchange_weak_explicit( atomic* object, T* expected, T desired, memory_order success, memory_order failure) noexcept; // (2) C++11 - template - bool atomic_compare_exchange_weak_explicit( + bool + atomic_compare_exchange_weak_explicit( atomic* object, typename atomic::value_type* expected, typename atomic::value_type desired, memory_order success, memory_order failure) noexcept; // (2) C++17 + template + constexpr bool + atomic_compare_exchange_weak_explicit( + atomic* object, + typename atomic::value_type* expected, + typename atomic::value_type desired, + memory_order success, + memory_order failure) noexcept; // (2) C++26 } ``` * atomic[link atomic.md] @@ -151,3 +161,5 @@ false 3 3 - [P0558R1 Resolving `atomic` named base class inconsistencies](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0558r1.pdf) - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_exchange.md b/reference/atomic/atomic_exchange.md index 7fa78f8f43..7c303880ba 100644 --- a/reference/atomic/atomic_exchange.md +++ b/reference/atomic/atomic_exchange.md @@ -7,24 +7,31 @@ ```cpp namespace std { template - T atomic_exchange( + T + atomic_exchange( volatile atomic* object, T desired) noexcept; // (1) C++11 - template - T atomic_exchange( + T + atomic_exchange( volatile atomic* object, typename atomic::value_type desired) noexcept; // (1) C++17 template - T atomic_exchange( + T + atomic_exchange( atomic* object, T desired) noexcept; // (2) C++11 - template - T atomic_exchange( + T + atomic_exchange( atomic* object, typename atomic::value_type desired) noexcept; // (2) C++17 + template + constexpr T + atomic_exchange( + atomic* object, + typename atomic::value_type desired) noexcept; // (2) C++26 } ``` * atomic[link atomic.md] @@ -99,3 +106,5 @@ replaced 1 by 2 - [P0558R1 Resolving `atomic` named base class inconsistencies](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0558r1.pdf) - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_exchange_explicit.md b/reference/atomic/atomic_exchange_explicit.md index 42ce1048bf..eecc353831 100644 --- a/reference/atomic/atomic_exchange_explicit.md +++ b/reference/atomic/atomic_exchange_explicit.md @@ -7,28 +7,36 @@ ```cpp namespace std { template - T atomic_exchange_explicit( + T + atomic_exchange_explicit( volatile atomic* object, T desired, memory_order order) noexcept; // (1) C++11 - template - T atomic_exchange_explicit( + T + atomic_exchange_explicit( volatile atomic* object, typename atomic::value_type desired, memory_order order) noexcept; // (1) C++17 template - T atomic_exchange_explicit( + T + atomic_exchange_explicit( atomic* object, T desired, memory_order order) noexcept; // (2) C++11 - template - T atomic_exchange_explicit( + T + atomic_exchange_explicit( atomic* object, typename atomic::value_type desired, memory_order order) noexcept; // (2) C++17 + template + constexpr T + atomic_exchange_explicit( + atomic* object, + typename atomic::value_type desired, + memory_order order) noexcept; // (2) C++26 ] ``` * atomic[link atomic.md] @@ -105,3 +113,5 @@ replaced 1 by 2 - [P0558R1 Resolving `atomic` named base class inconsistencies](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0558r1.pdf) - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_fetch_add.md b/reference/atomic/atomic_fetch_add.md index 54d691e9f9..87b5a3547d 100644 --- a/reference/atomic/atomic_fetch_add.md +++ b/reference/atomic/atomic_fetch_add.md @@ -7,22 +7,29 @@ ```cpp namespace std { template - T atomic_fetch_add( + T + atomic_fetch_add( volatile atomic* object, T operand) noexcept; // (1) C++11 - template - T atomic_fetch_add( + T + atomic_fetch_add( volatile atomic* object, typename atomic::difference_type operand) noexcept; // (1) C++17 template - T atomic_fetch_add( + T + atomic_fetch_add( atomic* object, T operand) noexcept; // (2) C++11 - template - T atomic_fetch_add( + T + atomic_fetch_add( + atomic* object, + typename atomic::difference_type operand) noexcept; // (2) C++17 + template + constexpr T + atomic_fetch_add( atomic* object, typename atomic::difference_type operand) noexcept; // (2) C++17 } @@ -102,3 +109,5 @@ int main() - [P0558R1 Resolving `atomic` named base class inconsistencies](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0558r1.pdf) - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_fetch_add_explicit.md b/reference/atomic/atomic_fetch_add_explicit.md index 6559e86cc5..086b4c99bd 100644 --- a/reference/atomic/atomic_fetch_add_explicit.md +++ b/reference/atomic/atomic_fetch_add_explicit.md @@ -7,28 +7,36 @@ ```cpp namespace std { template - T atomic_fetch_add_explicit( + T + atomic_fetch_add_explicit( volatile atomic* object, T operand, memory_order order) noexcept; // (1) C++11 - template - T atomic_fetch_add_explicit( + T + atomic_fetch_add_explicit( volatile atomic* object, typename atomic::difference_type operand, memory_order order) noexcept; // (1) C++17 template - T atomic_fetch_add_explicit( + T + atomic_fetch_add_explicit( atomic* object, T operand, memory_order order) noexcept; // (2) C++11 - template - T atomic_fetch_add_explicit( + T + atomic_fetch_add_explicit( atomic* object, typename atomic::difference_type operand, memory_order order) noexcept; // (2) C++17 + template + constexpr T + atomic_fetch_add_explicit( + atomic* object, + typename atomic::difference_type operand, + memory_order order) noexcept; // (2) C++26 } ``` * atomic[link atomic.md] @@ -105,3 +113,5 @@ int main() - [P0558R1 Resolving `atomic` named base class inconsistencies](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0558r1.pdf) - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_fetch_and.md b/reference/atomic/atomic_fetch_and.md index a1464a21f8..154262e798 100644 --- a/reference/atomic/atomic_fetch_and.md +++ b/reference/atomic/atomic_fetch_and.md @@ -7,24 +7,31 @@ ```cpp namespace std { template - T atomic_fetch_and( + T + atomic_fetch_and( volatile atomic* object, T operand) noexcept; // (1) C++11 - template - T atomic_fetch_and( + T + atomic_fetch_and( volatile atomic* object, typename atomic::value_type operand) noexcept; // (1) C++17 template - T atomic_fetch_and( + T + atomic_fetch_and( atomic* object, T operand) noexcept; // (2) C++11 - template - T atomic_fetch_and( + T + atomic_fetch_and( atomic* object, typename atomic::value_type operand) noexcept; // (2) C++17 + template + constexpr T + atomic_fetch_and( + atomic* object, + typename atomic::value_type operand) noexcept; // (2) C++26 } ``` * atomic[link atomic.md] @@ -108,3 +115,5 @@ int main() - [P0558R1 Resolving `atomic` named base class inconsistencies](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0558r1.pdf) - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_fetch_and_explicit.md b/reference/atomic/atomic_fetch_and_explicit.md index 1cf4be6d1d..f989b07c2c 100644 --- a/reference/atomic/atomic_fetch_and_explicit.md +++ b/reference/atomic/atomic_fetch_and_explicit.md @@ -7,28 +7,36 @@ ```cpp namespace std { template - T atomic_fetch_and_explicit( + T + atomic_fetch_and_explicit( volatile atomic* object, T operand, memory_order order) noexcept; // (1) C++11 - template - T atomic_fetch_and_explicit( + T + atomic_fetch_and_explicit( volatile atomic* object, typename atomic::value_type operand, memory_order order) noexcept; // (1) C++17 template - T atomic_fetch_and_explicit( + T + atomic_fetch_and_explicit( atomic* object, T operand, memory_order order) noexcept; // (2) C++11 - template - T atomic_fetch_and_explicit( + T + atomic_fetch_and_explicit( atomic* object, typename atomic::value_type operand, memory_order order) noexcept; // (2) C++17 + template + constexpr T + atomic_fetch_and_explicit( + atomic* object, + typename atomic::value_type operand, + memory_order order) noexcept; // (2) C++26 } ``` * atomic[link atomic.md] @@ -113,3 +121,5 @@ int main() - [P0558R1 Resolving `atomic` named base class inconsistencies](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0558r1.pdf) - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_fetch_max.md b/reference/atomic/atomic_fetch_max.md index 72fcef80de..b8cb690835 100644 --- a/reference/atomic/atomic_fetch_max.md +++ b/reference/atomic/atomic_fetch_max.md @@ -7,11 +7,13 @@ ```cpp namespace std { template - T atomic_fetch_max(volatile atomic* object, + T + atomic_fetch_max(volatile atomic* object, typename atomic::value_type operand) noexcept; // (1) C++26 template - T atomic_fetch_max(atomic* object, + constexpr T + atomic_fetch_max(atomic* object, typename atomic::value_type operand) noexcept; // (2) C++26 } ``` @@ -69,3 +71,4 @@ int main() ## 参照 - [P0493R5 Atomic minimum/maximum](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0493r5.pdf) +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) diff --git a/reference/atomic/atomic_fetch_max_explicit.md b/reference/atomic/atomic_fetch_max_explicit.md index 17c2259b8b..0e088ba8aa 100644 --- a/reference/atomic/atomic_fetch_max_explicit.md +++ b/reference/atomic/atomic_fetch_max_explicit.md @@ -7,13 +7,15 @@ ```cpp namespace std { template - T atomic_fetch_max_explicit( + T + atomic_fetch_max_explicit( volatile atomic* object, typename atomic::value_type operand, memory_order order) noexcept; // (1) C++26 template - T atomic_fetch_max_explicit( + constexpr T + atomic_fetch_max_explicit( atomic* object, typename atomic::value_type operand, memory_order order) noexcept; // (2) C++26 @@ -71,3 +73,4 @@ int main() ## 参照 - [P0493R5 Atomic minimum/maximum](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0493r5.pdf) +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) diff --git a/reference/atomic/atomic_fetch_min.md b/reference/atomic/atomic_fetch_min.md index 69e4a164a8..26763e2a6c 100644 --- a/reference/atomic/atomic_fetch_min.md +++ b/reference/atomic/atomic_fetch_min.md @@ -7,11 +7,13 @@ ```cpp namespace std { template - T atomic_fetch_min(volatile atomic* object, + T + atomic_fetch_min(volatile atomic* object, typename atomic::value_type operand) noexcept; // (1) C++26 template - T atomic_fetch_min(atomic* object, + constexpr T + atomic_fetch_min(atomic* object, typename atomic::value_type operand) noexcept; // (2) C++26 } ``` @@ -69,3 +71,4 @@ int main() ## 参照 - [P0493R5 Atomic maximum/minimum](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0493r5.pdf) +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) diff --git a/reference/atomic/atomic_fetch_min_explicit.md b/reference/atomic/atomic_fetch_min_explicit.md index cac364da71..dd46f1a0c1 100644 --- a/reference/atomic/atomic_fetch_min_explicit.md +++ b/reference/atomic/atomic_fetch_min_explicit.md @@ -7,13 +7,15 @@ ```cpp namespace std { template - T atomic_fetch_min_explicit( + T + atomic_fetch_min_explicit( volatile atomic* object, typename atomic::value_type operand, memory_order order) noexcept; // (1) C++26 template - T atomic_fetch_min_explicit( + constexpr T + atomic_fetch_min_explicit( atomic* object, typename atomic::value_type operand, memory_order order) noexcept; // (2) C++26 @@ -71,3 +73,4 @@ int main() ## 参照 - [P0493R5 Atomic minimum/maximum](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0493r5.pdf) +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) diff --git a/reference/atomic/atomic_fetch_or.md b/reference/atomic/atomic_fetch_or.md index 90a49db9f5..09e06a976a 100644 --- a/reference/atomic/atomic_fetch_or.md +++ b/reference/atomic/atomic_fetch_or.md @@ -7,24 +7,31 @@ ```cpp namespace std { template - T atomic_fetch_or( + T + atomic_fetch_or( volatile atomic* object, T operand) noexcept; // (1) C++11 - template - T atomic_fetch_or( + T + atomic_fetch_or( volatile atomic* object, typename atomic::value_type operand) noexcept; // (1) C++17 template - T atomic_fetch_or( + T + atomic_fetch_or( atomic* object, T operand) noexcept; // (2) C++11 - template - T atomic_fetch_or( + T + atomic_fetch_or( atomic* object, typename atomic::value_type operand) noexcept; // (2) C++17 + template + constexpr T + atomic_fetch_or( + atomic* object, + typename atomic::value_type operand) noexcept; // (2) C++26 } ``` * atomic[link atomic.md] @@ -108,3 +115,5 @@ int main() - [P0558R1 Resolving `atomic` named base class inconsistencies](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0558r1.pdf) - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_fetch_or_explicit.md b/reference/atomic/atomic_fetch_or_explicit.md index 1cb3276243..65b5e52a56 100644 --- a/reference/atomic/atomic_fetch_or_explicit.md +++ b/reference/atomic/atomic_fetch_or_explicit.md @@ -7,28 +7,36 @@ ```cpp namespace std { template - T atomic_fetch_or_explicit( + T + atomic_fetch_or_explicit( volatile atomic* object, T operand, memory_order order) noexcept; // (1) C++11 - template - T atomic_fetch_or_explicit( + T + atomic_fetch_or_explicit( volatile atomic* object, typename atomic::value_type operand, memory_order order) noexcept; // (1) C++17 template - T atomic_fetch_or_explicit( + T + atomic_fetch_or_explicit( atomic* object, T operand, memory_order order) noexcept; // (2) C++11 - template - T atomic_fetch_or_explicit( + T + atomic_fetch_or_explicit( atomic* object, typename atomic::value_type operand, memory_order order) noexcept; // (2) C++17 + template + constexpr T + atomic_fetch_or_explicit( + atomic* object, + typename atomic::value_type operand, + memory_order order) noexcept; // (2) C++26 } ``` * atomic[link atomic.md] @@ -112,3 +120,5 @@ int main() - [P0558R1 Resolving `atomic` named base class inconsistencies](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0558r1.pdf) - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_fetch_sub.md b/reference/atomic/atomic_fetch_sub.md index 79b2a6cd39..8e3989fa48 100644 --- a/reference/atomic/atomic_fetch_sub.md +++ b/reference/atomic/atomic_fetch_sub.md @@ -7,24 +7,31 @@ ```cpp namespace std { template - T atomic_fetch_sub( + T + atomic_fetch_sub( volatile atomic* object, T operand) noexcept; // (1) C++11 - template - T atomic_fetch_sub( + T + atomic_fetch_sub( volatile atomic* object, typename atomic::difference_type operand) noexcept; // (1) C++17 template - T atomic_fetch_sub( + T + atomic_fetch_sub( atomic* object, T operand) noexcept; // (2) C++11 - template - T atomic_fetch_sub( + T + atomic_fetch_sub( atomic* object, typename atomic::difference_type operand) noexcept; // (2) C++17 + template + constexpr T + atomic_fetch_sub( + atomic* object, + typename atomic::difference_type operand) noexcept; // (2) C++26 } ``` * atomic[link /reference/atomic/atomic.md] @@ -101,3 +108,5 @@ int main() - [P0558R1 Resolving `atomic` named base class inconsistencies](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0558r1.pdf) - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_fetch_sub_explicit.md b/reference/atomic/atomic_fetch_sub_explicit.md index 12227f39b9..5e29e2ebf6 100644 --- a/reference/atomic/atomic_fetch_sub_explicit.md +++ b/reference/atomic/atomic_fetch_sub_explicit.md @@ -7,28 +7,36 @@ ```cpp namespace std { template - T atomic_fetch_sub_explicit( + T + atomic_fetch_sub_explicit( volatile atomic* object, T operand, memory_order order) noexcept; // (1) C++11 - template - T atomic_fetch_sub_explicit( + T + atomic_fetch_sub_explicit( volatile atomic* object, typename atomic::difference_type operand, memory_order order) noexcept; // (1) C++17 template - T atomic_fetch_sub_explicit( + T + atomic_fetch_sub_explicit( atomic* object, T operand, memory_order order) noexcept; // (2) C++11 - template - T atomic_fetch_sub_explicit( + T + atomic_fetch_sub_explicit( atomic* object, typename atomic::difference_type operand, memory_order order) noexcept; // (2) C++17 + template + constexpr T + atomic_fetch_sub_explicit( + atomic* object, + typename atomic::difference_type operand, + memory_order order) noexcept; // (2) C++26 } ``` * atomic[link atomic.md] @@ -106,3 +114,5 @@ int main() - [P0558R1 Resolving `atomic` named base class inconsistencies](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0558r1.pdf) - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_fetch_xor.md b/reference/atomic/atomic_fetch_xor.md index 21e2fdbaa0..c4558983a5 100644 --- a/reference/atomic/atomic_fetch_xor.md +++ b/reference/atomic/atomic_fetch_xor.md @@ -7,24 +7,31 @@ ```cpp namespace std { template - T atomic_fetch_xor( + T + atomic_fetch_xor( volatile atomic* object, T operand) noexcept; // (1) C++11 - template - T atomic_fetch_xor( + T + atomic_fetch_xor( volatile atomic* object, typename atomic::value_type operand) noexcept; // (1) C++17 template - T atomic_fetch_xor( + T + atomic_fetch_xor( atomic* object, T operand) noexcept; // (2) C++11 - template - T atomic_fetch_xor( + T + atomic_fetch_xor( atomic* object, typename atomic::value_type operand) noexcept; // (2) C++17 + template + constexpr T + atomic_fetch_xor( + atomic* object, + typename atomic::value_type operand) noexcept; // (2) C++26 } ``` * atomic[link atomic.md] @@ -108,3 +115,5 @@ int main() - [P0558R1 Resolving `atomic` named base class inconsistencies](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0558r1.pdf) - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_fetch_xor_explicit.md b/reference/atomic/atomic_fetch_xor_explicit.md index a92960f978..a7f98893ba 100644 --- a/reference/atomic/atomic_fetch_xor_explicit.md +++ b/reference/atomic/atomic_fetch_xor_explicit.md @@ -7,28 +7,36 @@ ```cpp namespace std { template - T atomic_fetch_xor_explicit( + T + atomic_fetch_xor_explicit( volatile atomic* object, T operand, memory_order order) noexcept; // (1) C++11 - template - T atomic_fetch_xor_explicit( + T + atomic_fetch_xor_explicit( volatile atomic* object, typename atomic::value_type operand, memory_order order) noexcept; // (1) C++17 template - T atomic_fetch_xor_explicit( + T + atomic_fetch_xor_explicit( atomic* object, T operand, memory_order order) noexcept; // (2) C++11 - template - T atomic_fetch_xor_explicit( + T + atomic_fetch_xor_explicit( atomic* object, typename atomic::value_type operand, memory_order order) noexcept; // (2) C++17 + template + constexpr T + atomic_fetch_xor_explicit( + atomic* object, + typename atomic::value_type operand, + memory_order order) noexcept; // (2) C++26 } ``` * atomic[link atomic.md] @@ -114,3 +122,5 @@ int main() - [P0558R1 Resolving `atomic` named base class inconsistencies](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0558r1.pdf) - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_flag/clear.md b/reference/atomic/atomic_flag/clear.md index cfed6ae7ad..e8294272e8 100644 --- a/reference/atomic/atomic_flag/clear.md +++ b/reference/atomic/atomic_flag/clear.md @@ -6,8 +6,16 @@ * cpp11[meta cpp] ```cpp -void clear(memory_order order = memory_order_seq_cst) volatile noexcept; -void clear(memory_order order = memory_order_seq_cst) noexcept; +void + clear(memory_order order = memory_order_seq_cst + ) volatile noexcept; // (1) C++11 + +void + clear(memory_order order = memory_order_seq_cst + ) noexcept; // (2) C++11 +constexpr void + clear(memory_order order = memory_order_seq_cst + ) noexcept; // (2) C++26 ``` * memory_order[link /reference/atomic/memory_order.md] * memory_order_seq_cst[link /reference/atomic/memory_order.md] @@ -87,5 +95,5 @@ false ## 参照 - [LWG Issue 2138. `atomic_flag::clear` should not accept `memory_order_consume`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2138) - - +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_flag/notify_all.md b/reference/atomic/atomic_flag/notify_all.md index 051d0604a8..bdab9021d0 100644 --- a/reference/atomic/atomic_flag/notify_all.md +++ b/reference/atomic/atomic_flag/notify_all.md @@ -6,8 +6,10 @@ * cpp20[meta cpp] ```cpp -void notify_all() volatile noexcept; -void notify_all() noexcept; +void notify_all() volatile noexcept; // (1) C++20 + +void notify_all() noexcept; // (2) C++20 +constexpr void notify_all() noexcept; // (2) C++26 ``` ## 概要 @@ -82,3 +84,5 @@ int main() - [P0514R4 Efficient concurrent waiting for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0514r4.pdf) - [ogiroux/atomic_wait - Sample implementation of C++20 atomic_wait/notify](https://github.com/ogiroux/atomic_wait) - [P1135R6 The C++20 Synchronization Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1135r6.html) +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_flag/notify_one.md b/reference/atomic/atomic_flag/notify_one.md index aaa9458e4c..cfee53fec9 100644 --- a/reference/atomic/atomic_flag/notify_one.md +++ b/reference/atomic/atomic_flag/notify_one.md @@ -6,8 +6,10 @@ * cpp20[meta cpp] ```cpp -void notify_one() volatile noexcept; -void notify_one() noexcept; +void notify_one() volatile noexcept; // (1) C++20 + +void notify_one() noexcept; // (2) C++20 +constexpr void notify_one() noexcept; // (2) C++26 ``` ## 概要 @@ -108,3 +110,5 @@ int main() - [P0514R4 Efficient concurrent waiting for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0514r4.pdf) - [ogiroux/atomic_wait - Sample implementation of C++20 atomic_wait/notify](https://github.com/ogiroux/atomic_wait) - [P1135R6 The C++20 Synchronization Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1135r6.html) +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_flag/test.md b/reference/atomic/atomic_flag/test.md index 0004703d70..aef6fdd598 100644 --- a/reference/atomic/atomic_flag/test.md +++ b/reference/atomic/atomic_flag/test.md @@ -6,8 +6,16 @@ * cpp20[meta cpp] ```cpp -bool test(memory_order order = memory_order::seq_cst) const volatile noexcept; -bool test(memory_order order = memory_order::seq_cst) const noexcept; +bool + test(memory_order order = memory_order::seq_cst + ) const volatile noexcept; // (1) C++20 + +bool + test(memory_order order = memory_order::seq_cst + ) const noexcept; // (2) C++20 +constexpr bool + test(memory_order order = memory_order::seq_cst + ) const noexcept; // (2) C++26 ``` * memory_order[link /reference/atomic/memory_order.md] @@ -77,3 +85,5 @@ true - [P0995R1 Improving atomic_flag](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0995r1.html) - [ogiroux/atomic_wait - Sample implementation of C++20 atomic_wait/notify](https://github.com/ogiroux/atomic_wait) - [P1135R6 The C++20 Synchronization Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1135r6.html) +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_flag/test_and_set.md b/reference/atomic/atomic_flag/test_and_set.md index 7ac2cdd48d..681042e679 100644 --- a/reference/atomic/atomic_flag/test_and_set.md +++ b/reference/atomic/atomic_flag/test_and_set.md @@ -6,8 +6,16 @@ * cpp11[meta cpp] ```cpp -bool test_and_set(memory_order order = memory_order_seq_cst) volatile noexcept; -bool test_and_set(memory_order order = memory_order_seq_cst) noexcept; +bool + test_and_set(memory_order order = memory_order_seq_cst + ) volatile noexcept; // (1) C++11 + +bool + test_and_set(memory_order order = memory_order_seq_cst + ) noexcept; // (2) C++11 +constexpr bool + test_and_set(memory_order order = memory_order_seq_cst + ) noexcept; // (2) C++26 ``` * memory_order[link /reference/atomic/memory_order.md] * memory_order_seq_cst[link /reference/atomic/memory_order.md] @@ -73,5 +81,5 @@ true ## 参照 - - +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_flag/wait.md b/reference/atomic/atomic_flag/wait.md index 4f8c1e35aa..6a28dc057e 100644 --- a/reference/atomic/atomic_flag/wait.md +++ b/reference/atomic/atomic_flag/wait.md @@ -6,8 +6,19 @@ * cpp20[meta cpp] ```cpp -void wait(bool old, memory_order order = memory_order::seq_cst) const volatile noexcept; -void wait(bool old, memory_order order = memory_order::seq_cst) const noexcept; +void + wait(bool old, + memory_order order = memory_order::seq_cst + ) const volatile noexcept; // (1) C++20 + +void + wait(bool old, + memory_order order = memory_order::seq_cst + ) const noexcept; // (2) C++20 +constexpr void + wait(bool old, + memory_order order = memory_order::seq_cst + ) const noexcept; // (2) C++26 ``` * memory_order[link /reference/atomic/memory_order.md] @@ -119,3 +130,5 @@ int main() - [P0514R4 Efficient concurrent waiting for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0514r4.pdf) - [ogiroux/atomic_wait - Sample implementation of C++20 atomic_wait/notify](https://github.com/ogiroux/atomic_wait) - [P1135R6 The C++20 Synchronization Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1135r6.html) +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_flag_clear.md b/reference/atomic/atomic_flag_clear.md index 344ca7669d..bede0b52a8 100644 --- a/reference/atomic/atomic_flag_clear.md +++ b/reference/atomic/atomic_flag_clear.md @@ -6,8 +6,13 @@ ```cpp namespace std { - void atomic_flag_clear(volatile atomic_flag* object) noexcept; - void atomic_flag_clear(atomic_flag* object) noexcept; + void + atomic_flag_clear(volatile atomic_flag* object) noexcept; // (1) C++11 + + void + atomic_flag_clear(atomic_flag* object) noexcept; // (2) C++26 + constexpr void + atomic_flag_clear(atomic_flag* object) noexcept; // (2) C++26 } ``` * atomic_flag[link atomic_flag.md] @@ -79,5 +84,5 @@ false ## 参照 - - +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_flag_clear_explicit.md b/reference/atomic/atomic_flag_clear_explicit.md index cdc49ca536..380201c650 100644 --- a/reference/atomic/atomic_flag_clear_explicit.md +++ b/reference/atomic/atomic_flag_clear_explicit.md @@ -6,8 +6,19 @@ ```cpp namespace std { - void atomic_flag_clear_explicit(volatile atomic_flag* object, memory_order order) noexcept; - void atomic_flag_clear_explicit(atomic_flag* object, memory_order order) noexcept; + void + atomic_flag_clear_explicit( + volatile atomic_flag* object, + memory_order order) noexcept; // (1) C++11 + + void + atomic_flag_clear_explicit( + atomic_flag* object, + memory_order order) noexcept; // (2) C++11 + constexpr void + atomic_flag_clear_explicit( + atomic_flag* object, + memory_order order) noexcept; // (2) C++26 } ``` * atomic_flag[link atomic_flag.md] @@ -89,4 +100,5 @@ false ## 参照 - [LWG Issue 2138. `atomic_flag::clear` should not accept `memory_order_consume`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2138) - +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_flag_notify_all.md b/reference/atomic/atomic_flag_notify_all.md index 6b9a2b65b2..fd4ef52fa7 100644 --- a/reference/atomic/atomic_flag_notify_all.md +++ b/reference/atomic/atomic_flag_notify_all.md @@ -6,8 +6,16 @@ ```cpp namespace std { - void atomic_flag_notify_all(volatile atomic_flag* object) const noexcept; // (1) C++20 - void atomic_flag_notify_all(atomic_flag* object) const noexcept; // (2) C++20 + void + atomic_flag_notify_all( + volatile atomic_flag* object) const noexcept; // (1) C++20 + + void + atomic_flag_notify_all( + atomic_flag* object) const noexcept; // (2) C++20 + constexpr void + atomic_flag_notify_all( + atomic_flag* object) const noexcept; // (2) C++26 } ``` @@ -83,3 +91,5 @@ int main() - [P0514R4 Efficient concurrent waiting for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0514r4.pdf) - [ogiroux/atomic_wait - Sample implementation of C++20 atomic_wait/notify](https://github.com/ogiroux/atomic_wait) - [P1135R6 The C++20 Synchronization Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1135r6.html) +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_flag_notify_one.md b/reference/atomic/atomic_flag_notify_one.md index cb5fe17f72..ce15d28537 100644 --- a/reference/atomic/atomic_flag_notify_one.md +++ b/reference/atomic/atomic_flag_notify_one.md @@ -6,8 +6,16 @@ ```cpp namespace std { - void atomic_flag_notify_one(volatile atomic_flag* object) noexcept; // (1) C++20 - void atomic_flag_notify_one(atomic_flag* object) noexcept; // (2) C++20 + void + atomic_flag_notify_one( + volatile atomic_flag* object) noexcept; // (1) C++20 + + void + atomic_flag_notify_one( + atomic_flag* object) noexcept; // (2) C++20 + constexpr void + atomic_flag_notify_one( + atomic_flag* object) noexcept; // (2) C++26 } ``` @@ -109,3 +117,5 @@ int main() - [P0514R4 Efficient concurrent waiting for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0514r4.pdf) - [ogiroux/atomic_wait - Sample implementation of C++20 atomic_wait/notify](https://github.com/ogiroux/atomic_wait) - [P1135R6 The C++20 Synchronization Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1135r6.html) +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_flag_test.md b/reference/atomic/atomic_flag_test.md index 3973f5927e..fad333b8fc 100644 --- a/reference/atomic/atomic_flag_test.md +++ b/reference/atomic/atomic_flag_test.md @@ -6,8 +6,13 @@ ```cpp namespace std { - bool atomic_flag_test(const volatile atomic_flag* object) noexcept; // (1) C++20 - bool atomic_flag_test(const atomic_flag* object) noexcept; // (2) C++20 + bool + atomic_flag_test(const volatile atomic_flag* object) noexcept; // (1) C++20 + + bool + atomic_flag_test(const atomic_flag* object) noexcept; // (2) C++20 + constexpr bool + atomic_flag_test(const atomic_flag* object) noexcept; // (2) C++26 } ``` @@ -73,3 +78,5 @@ true - [P0995R1 Improving atomic_flag](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0995r1.html) - [ogiroux/atomic_wait - Sample implementation of C++20 atomic_wait/notify](https://github.com/ogiroux/atomic_wait) - [P1135R6 The C++20 Synchronization Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1135r6.html) +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_flag_test_and_set.md b/reference/atomic/atomic_flag_test_and_set.md index 20cf956371..fa23298c13 100644 --- a/reference/atomic/atomic_flag_test_and_set.md +++ b/reference/atomic/atomic_flag_test_and_set.md @@ -6,8 +6,13 @@ ```cpp namespace std { - bool atomic_flag_test_and_set(volatile atomic_flag* object) noexcept; - bool atomic_flag_test_and_set(atomic_flag* object) noexcept; + bool + atomic_flag_test_and_set(volatile atomic_flag* object) noexcept; // (1) C++11 + + bool + atomic_flag_test_and_set(atomic_flag* object) noexcept; // (2) C++11 + constexpr bool + atomic_flag_test_and_set(atomic_flag* object) noexcept; // (2) C++26 } ``` * atomic_flag[link atomic_flag.md] @@ -75,5 +80,5 @@ true ## 参照 - - +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_flag_test_and_set_explicit.md b/reference/atomic/atomic_flag_test_and_set_explicit.md index 2dcc48633b..bc919a1f2c 100644 --- a/reference/atomic/atomic_flag_test_and_set_explicit.md +++ b/reference/atomic/atomic_flag_test_and_set_explicit.md @@ -6,8 +6,19 @@ ```cpp namespace std { - bool atomic_flag_test_and_set_explicit(volatile atomic_flag* object, memory_order order) noexcept; - bool atomic_flag_test_and_set_explicit(atomic_flag* object, memory_order order) noexcept; + bool + atomic_flag_test_and_set_explicit( + volatile atomic_flag* object, + memory_order order) noexcept; // (1) C++11 + + bool + atomic_flag_test_and_set_explicit( + atomic_flag* object, + memory_order order) noexcept; // (2) C++11 + constexpr bool + atomic_flag_test_and_set_explicit( + atomic_flag* object, + memory_order order) noexcept; // (2) C++26 } ``` * atomic_flag[link atomic_flag.md] @@ -74,5 +85,5 @@ true ## 参照 - - +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_flag_test_explicit.md b/reference/atomic/atomic_flag_test_explicit.md index 3b260b077a..a03168008b 100644 --- a/reference/atomic/atomic_flag_test_explicit.md +++ b/reference/atomic/atomic_flag_test_explicit.md @@ -6,10 +6,16 @@ ```cpp namespace std { - bool atomic_flag_test_explicit(const volatile atomic_flag* object, - memory_order order) noexcept; // (1) C++20 - bool atomic_flag_test_explicit(const atomic_flag* object, - memory_order order) noexcept; // (2) C++20 + bool + atomic_flag_test_explicit(const volatile atomic_flag* object, + memory_order order) noexcept; // (1) C++20 + + bool + atomic_flag_test_explicit(const atomic_flag* object, + memory_order order) noexcept; // (2) C++20 + constexpr bool + atomic_flag_test_explicit(const atomic_flag* object, + memory_order order) noexcept; // (2) C++26 } ``` * memory_order[link /reference/atomic/memory_order.md] @@ -81,3 +87,5 @@ true - [P0995R1 Improving atomic_flag](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0995r1.html) - [ogiroux/atomic_wait - Sample implementation of C++20 atomic_wait/notify](https://github.com/ogiroux/atomic_wait) - [P1135R6 The C++20 Synchronization Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1135r6.html) +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_flag_wait.md b/reference/atomic/atomic_flag_wait.md index 2452edf275..2a360fc000 100644 --- a/reference/atomic/atomic_flag_wait.md +++ b/reference/atomic/atomic_flag_wait.md @@ -6,8 +6,19 @@ ```cpp namespace std { - void atomic_flag_wait(const volatile atomic_flag* object, bool old) noexcept; // (1) C++20 - void atomic_flag_wait(const atomic_flag* object, bool old) noexcept; // (2) C++20 + void + atomic_flag_wait( + const volatile atomic_flag* object, + bool old) noexcept; // (1) C++20 + + void + atomic_flag_wait( + const atomic_flag* object, + bool old) noexcept; // (2) C++20 + constexpr void + atomic_flag_wait( + const atomic_flag* object, + bool old) noexcept; // (2) C++26 } ``` @@ -119,3 +130,5 @@ int main() - [P0514R4 Efficient concurrent waiting for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0514r4.pdf) - [ogiroux/atomic_wait - Sample implementation of C++20 atomic_wait/notify](https://github.com/ogiroux/atomic_wait) - [P1135R6 The C++20 Synchronization Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1135r6.html) +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_flag_wait_explicit.md b/reference/atomic/atomic_flag_wait_explicit.md index 5908cb6505..4a27b046de 100644 --- a/reference/atomic/atomic_flag_wait_explicit.md +++ b/reference/atomic/atomic_flag_wait_explicit.md @@ -6,12 +6,22 @@ ```cpp namespace std { - void atomic_flag_wait_explicit(const volatile atomic_flag* object, - bool old, - memory_order order) noexcept; // (1) C++20 - void atomic_flag_wait_explicit(const atomic_flag* object, - bool old, - memory_order order) noexcept; // (2) C++20 + void + atomic_flag_wait_explicit( + const volatile atomic_flag* object, + bool old, + memory_order order) noexcept; // (1) C++20 + + void + atomic_flag_wait_explicit( + const atomic_flag* object, + bool old, + memory_order order) noexcept; // (2) C++20 + constexpr void + atomic_flag_wait_explicit( + const atomic_flag* object, + bool old, + memory_order order) noexcept; // (2) C++26 } ``` @@ -124,3 +134,5 @@ int main() - [P0514R4 Efficient concurrent waiting for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0514r4.pdf) - [ogiroux/atomic_wait - Sample implementation of C++20 atomic_wait/notify](https://github.com/ogiroux/atomic_wait) - [P1135R6 The C++20 Synchronization Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1135r6.html) +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_load.md b/reference/atomic/atomic_load.md index 3bb4becc2c..a0390c3a27 100644 --- a/reference/atomic/atomic_load.md +++ b/reference/atomic/atomic_load.md @@ -7,10 +7,15 @@ ```cpp namespace std { template - T atomic_load(const volatile atomic* object) noexcept; // (1) C++11 + T + atomic_load(const volatile atomic* object) noexcept; // (1) C++11 template - T atomic_load(const atomic* object) noexcept; // (2) C++11 + T + atomic_load(const atomic* object) noexcept; // (2) C++11 + template + constexpr T + atomic_load(const atomic* object) noexcept; // (2) C++26 } ``` * atomic[link /reference/atomic/atomic.md] @@ -84,3 +89,5 @@ int main() - [P0558R1 Resolving `atomic` named base class inconsistencies](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0558r1.pdf) - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_load_explicit.md b/reference/atomic/atomic_load_explicit.md index 45a0d084c2..135852abc0 100644 --- a/reference/atomic/atomic_load_explicit.md +++ b/reference/atomic/atomic_load_explicit.md @@ -7,14 +7,21 @@ ```cpp namespace std { template - T atomic_load_explicit( + T + atomic_load_explicit( const volatile atomic* object, memory_order order) noexcept; // (1) C++11 template - T atomic_load_explicit( + T + atomic_load_explicit( const atomic* object, memory_order order) noexcept; // (2) C++11 + template + constexpr T + atomic_load_explicit( + const atomic* object, + memory_order order) noexcept; // (2) C++26 } ``` * atomic[link atomic.md] @@ -90,3 +97,5 @@ int main() - [P0558R1 Resolving `atomic` named base class inconsistencies](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0558r1.pdf) - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_notify_all.md b/reference/atomic/atomic_notify_all.md index d06922820c..0215d5421b 100644 --- a/reference/atomic/atomic_notify_all.md +++ b/reference/atomic/atomic_notify_all.md @@ -7,10 +7,15 @@ ```cpp namespace std { template - void atomic_notify_all(volatile atomic* object); // (1) C++20 + void + atomic_notify_all(volatile atomic* object); // (1) C++20 template - void atomic_notify_all(atomic* object); // (2) C++20 + void + atomic_notify_all(atomic* object); // (2) C++20 + template + constexpr void + atomic_notify_all(atomic* object); // (2) C++26 } ``` @@ -95,3 +100,5 @@ int main() - [P1135R6 The C++20 Synchronization Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1135r6.html) - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_notify_one.md b/reference/atomic/atomic_notify_one.md index 49fee229ef..cbfd876d1b 100644 --- a/reference/atomic/atomic_notify_one.md +++ b/reference/atomic/atomic_notify_one.md @@ -7,10 +7,15 @@ ```cpp namespace std { template - void atomic_notify_one(volatile atomic* object); // (1) C++20 + void + atomic_notify_one(volatile atomic* object); // (1) C++20 template - void atomic_notify_one(atomic* object); // (2) C++20 + void + atomic_notify_one(atomic* object); // (2) C++20 + template + constexpr void + atomic_notify_one(atomic* object); // (2) C++26 } ``` @@ -121,3 +126,5 @@ int main() - [P1135R6 The C++20 Synchronization Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1135r6.html) - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_ref/compare_exchange_strong.md b/reference/atomic/atomic_ref/compare_exchange_strong.md index e128bf2a8d..572dbd12b9 100644 --- a/reference/atomic/atomic_ref/compare_exchange_strong.md +++ b/reference/atomic/atomic_ref/compare_exchange_strong.md @@ -12,7 +12,7 @@ bool memory_order success, memory_order failure ) const noexcept; // (1) C++20 -bool +constexpr bool compare_exchange_strong(value_type& expected, value_type desired, memory_order success, @@ -24,7 +24,7 @@ bool T desired, memory_order order = memory_order_seq_cst ) const noexcept; // (2) C++20 -bool +constexpr bool compare_exchange_strong(value_type& expected, value_type desired, memory_order order = memory_order_seq_cst @@ -174,3 +174,5 @@ true ## 参照 - [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) - C++26でCV修飾されたテンプレート引数を受け取れるようになった +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_ref/compare_exchange_weak.md b/reference/atomic/atomic_ref/compare_exchange_weak.md index 51c6f84ad7..3b92958ab4 100644 --- a/reference/atomic/atomic_ref/compare_exchange_weak.md +++ b/reference/atomic/atomic_ref/compare_exchange_weak.md @@ -12,7 +12,7 @@ bool memory_order success, memory_order failure ) const noexcept; // (1) C++20 -bool +constexpr bool compare_exchange_weak(value_type& expected, value_type desired, memory_order success, @@ -24,7 +24,7 @@ bool T desired, memory_order order = memory_order_seq_cst ) const noexcept; // (2) C++20 -bool +constexpr bool compare_exchange_weak(value_type& expected, value_type desired, memory_order order = memory_order_seq_cst @@ -204,3 +204,5 @@ int main() ## 参照 - [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) - C++26でCV修飾されたテンプレート引数を受け取れるようになった +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_ref/exchange.md b/reference/atomic/atomic_ref/exchange.md index c604462cb5..4c3bc9a7d7 100644 --- a/reference/atomic/atomic_ref/exchange.md +++ b/reference/atomic/atomic_ref/exchange.md @@ -9,7 +9,7 @@ T exchange(T desired, memory_order order = memory_order_seq_cst) const noexcept; // (1) C++20 -value_type +constexpr value_type exchange(value_type desired, memory_order order = memory_order_seq_cst) const noexcept; // (1) C++26 ``` @@ -73,3 +73,5 @@ replaced 1 by 2 ## 参照 - [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) - C++26でCV修飾されたテンプレート引数を受け取れるようになった +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_ref/fetch_add.md b/reference/atomic/atomic_ref/fetch_add.md index 34baa1f68b..f1cbbe7981 100644 --- a/reference/atomic/atomic_ref/fetch_add.md +++ b/reference/atomic/atomic_ref/fetch_add.md @@ -9,7 +9,7 @@ T fetch_add(difference_type operand, memory_order order = memory_order_seq_cst) const noexcept; // (1) C++20 -value_type +constexpr value_type fetch_add(difference_type operand, memory_order order = memory_order_seq_cst) const noexcept; // (1) C++26 ``` @@ -144,3 +144,5 @@ int main() ## 参照 - [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) - C++26でCV修飾されたテンプレート引数を受け取れるようになった +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_ref/fetch_and.md b/reference/atomic/atomic_ref/fetch_and.md index 18abb329b2..2264df9271 100644 --- a/reference/atomic/atomic_ref/fetch_and.md +++ b/reference/atomic/atomic_ref/fetch_and.md @@ -9,7 +9,7 @@ T fetch_and(T operand, memory_order order = memory_order_seq_cst) const noexcept; // (1) C++20 -value_type +constexpr value_type fetch_and(value_type operand, memory_order order = memory_order_seq_cst) const noexcept; // (1) C++26 ``` @@ -114,3 +114,5 @@ int main() ## 参照 - [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) - C++26でCV修飾されたテンプレート引数を受け取れるようになった +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_ref/fetch_max.md b/reference/atomic/atomic_ref/fetch_max.md index eac81830ba..ab4bc9350e 100644 --- a/reference/atomic/atomic_ref/fetch_max.md +++ b/reference/atomic/atomic_ref/fetch_max.md @@ -6,7 +6,8 @@ * cpp26[meta cpp] ```cpp -T fetch_max(difference_type operand, +constexpr T + fetch_max(difference_type operand, memory_order order = memory_order_seq_cst ) const noexcept; // (1) C++26 ``` @@ -69,3 +70,4 @@ int main() ## 参照 - [P0493R5 Atomic minimum/maximum](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0493r5.pdf) +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) diff --git a/reference/atomic/atomic_ref/fetch_min.md b/reference/atomic/atomic_ref/fetch_min.md index 4beac43818..b4fd996f92 100644 --- a/reference/atomic/atomic_ref/fetch_min.md +++ b/reference/atomic/atomic_ref/fetch_min.md @@ -6,7 +6,8 @@ * cpp26[meta cpp] ```cpp -T fetch_min(difference_type operand, +constexpr T + fetch_min(difference_type operand, memory_order order = memory_order_seq_cst ) const noexcept; // (1) C++26 ``` @@ -69,3 +70,5 @@ int main() ## 参照 - [P0493R5 Atomic minimum/maximum](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0493r5.pdf) +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + diff --git a/reference/atomic/atomic_ref/fetch_or.md b/reference/atomic/atomic_ref/fetch_or.md index 95c27b4e80..195aa94ed4 100644 --- a/reference/atomic/atomic_ref/fetch_or.md +++ b/reference/atomic/atomic_ref/fetch_or.md @@ -9,7 +9,7 @@ T fetch_or(T operand, memory_order order = memory_order_seq_cst) const noexcept; // (1) C++20 -value_type +constexpr value_type fetch_or(value_type operand, memory_order order = memory_order_seq_cst) const noexcept; // (1) C++26 ``` @@ -114,3 +114,5 @@ int main() ## 参照 - [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) - C++26でCV修飾されたテンプレート引数を受け取れるようになった +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_ref/fetch_sub.md b/reference/atomic/atomic_ref/fetch_sub.md index 2c26bd65b2..35a0c59bc7 100644 --- a/reference/atomic/atomic_ref/fetch_sub.md +++ b/reference/atomic/atomic_ref/fetch_sub.md @@ -9,7 +9,7 @@ T fetch_sub(difference_type operand, memory_order order = memory_order_seq_cst) const noexcept; // (1) C++20 -value_type +constexpr value_type fetch_sub(difference_type operand, memory_order order = memory_order_seq_cst) const noexcept; // (1) C++26 ``` @@ -139,3 +139,5 @@ int main() ## 参照 - [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) - C++26でCV修飾されたテンプレート引数を受け取れるようになった +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_ref/fetch_xor.md b/reference/atomic/atomic_ref/fetch_xor.md index 4b1a3ad019..13e2b16002 100644 --- a/reference/atomic/atomic_ref/fetch_xor.md +++ b/reference/atomic/atomic_ref/fetch_xor.md @@ -9,7 +9,7 @@ T fetch_xor(T operand, memory_order order = memory_order_seq_cst) const noexcept; // (1) C++20 -value_type +constexpr value_type fetch_xor(value_type operand, memory_order order = memory_order_seq_cst) const noexcept; // (1) C++26 ``` @@ -116,3 +116,5 @@ int main() ## 参照 - [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) - C++26でCV修飾されたテンプレート引数を受け取れるようになった +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_ref/load.md b/reference/atomic/atomic_ref/load.md index 908c730943..f41bf7d6aa 100644 --- a/reference/atomic/atomic_ref/load.md +++ b/reference/atomic/atomic_ref/load.md @@ -6,8 +6,10 @@ * cpp20[meta cpp] ```cpp -T load(memory_order order = memory_order_seq_cst) const noexcept; // (1) C++20 -value_type load(memory_order order = memory_order_seq_cst) const noexcept; // (1) C++26 +T + load(memory_order order = memory_order_seq_cst) const noexcept; // (1) C++20 +constexpr value_type + load(memory_order order = memory_order_seq_cst) const noexcept; // (1) C++26 ``` * memory_order[link /reference/atomic/memory_order.md] * memory_order_seq_cst[link /reference/atomic/memory_order.md] @@ -76,3 +78,5 @@ int main() ## 参照 - [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) - C++26でCV修飾されたテンプレート引数を受け取れるようになった +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_ref/notify_all.md b/reference/atomic/atomic_ref/notify_all.md index d4d439e449..64feab6415 100644 --- a/reference/atomic/atomic_ref/notify_all.md +++ b/reference/atomic/atomic_ref/notify_all.md @@ -6,7 +6,8 @@ * cpp20[meta cpp] ```cpp -void notify_all() const noexcept; +void notify_all() const noexcept; // (1) C++20 +constexpr void notify_all() const noexcept; // (1) C++20 ``` ## 概要 @@ -89,3 +90,5 @@ int main() - 宣言に`const`を追加 - [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) - C++26でCV修飾されたテンプレート引数を受け取れるようになった +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_ref/notify_one.md b/reference/atomic/atomic_ref/notify_one.md index 2737886ee6..c12935ea1f 100644 --- a/reference/atomic/atomic_ref/notify_one.md +++ b/reference/atomic/atomic_ref/notify_one.md @@ -6,7 +6,8 @@ * cpp20[meta cpp] ```cpp -void notify_one() const noexcept; +void notify_one() const noexcept; // (1) C++20 +constexpr void notify_one() const noexcept; // (1) C++26 ``` ## 概要 @@ -116,3 +117,5 @@ int main() - 宣言に`const`を追加 - [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) - C++26でCV修飾されたテンプレート引数を受け取れるようになった +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_ref/op_and_assign.md b/reference/atomic/atomic_ref/op_and_assign.md index 3da3120144..8a2537050c 100644 --- a/reference/atomic/atomic_ref/op_and_assign.md +++ b/reference/atomic/atomic_ref/op_and_assign.md @@ -6,8 +6,10 @@ * cpp20[meta cpp] ```cpp -T operator&=(T operand) const noexcept; // (1) C++20 -value_type operator&=(value_type operand) const noexcept; // (1) C++26 +T + operator&=(T operand) const noexcept; // (1) C++20 +constexpr value_type + operator&=(value_type operand) const noexcept; // (1) C++26 ``` ## 概要 @@ -106,3 +108,5 @@ int main() ## 参照 - [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) - C++26でCV修飾されたテンプレート引数を受け取れるようになった +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_ref/op_assign.md b/reference/atomic/atomic_ref/op_assign.md index dbe5d5c105..d91ff0ac5b 100644 --- a/reference/atomic/atomic_ref/op_assign.md +++ b/reference/atomic/atomic_ref/op_assign.md @@ -6,8 +6,10 @@ * cpp20[meta cpp] ```cpp -T operator=(T desired) const noexcept; // (1) C++20 -value_type operator=(value_type desired) const noexcept; // (1) C++26 +T + operator=(T desired) const noexcept; // (1) C++20 +constexpr value_type + operator=(value_type desired) const noexcept; // (1) C++26 ``` ## 概要 @@ -75,3 +77,5 @@ int main() - 宣言に`const`を追加 - [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) - C++26でCV修飾されたテンプレート引数を受け取れるようになった +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_ref/op_constructor.md b/reference/atomic/atomic_ref/op_constructor.md index 7f3d704424..3821a7ac23 100644 --- a/reference/atomic/atomic_ref/op_constructor.md +++ b/reference/atomic/atomic_ref/op_constructor.md @@ -6,8 +6,11 @@ * cpp20[meta cpp] ```cpp -explicit atomic_ref(T& obj); // (1) C++20 -atomic_ref(const atomic_ref& other) noexcept; // (2) C++20 +explicit atomic_ref(T& obj); // (1) C++20 +constexpr explicit atomic_ref(T& obj); // (1) C++26 + +atomic_ref(const atomic_ref& other) noexcept; // (2) C++20 +constexpr atomic_ref(const atomic_ref& other) noexcept; // (2) C++26 ``` ## 概要 @@ -64,3 +67,5 @@ int main() ## 参照 - [LWG issue 3160. `atomic_ref() = delete;` should be deleted](https://wg21.cmeerw.net/lwg/issue3160) +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_ref/op_decrement.md b/reference/atomic/atomic_ref/op_decrement.md index 6554c4771c..4c1e6a80d6 100644 --- a/reference/atomic/atomic_ref/op_decrement.md +++ b/reference/atomic/atomic_ref/op_decrement.md @@ -6,8 +6,15 @@ * cpp20[meta cpp] ```cpp -value_type operator--() const noexcept; -value_type operator--(int) const noexcept; +value_type + operator--() const noexcept; // (1) C++20 +constexpr value_type + operator--() const noexcept; // (1) C++26 + +value_type + operator--(int) const noexcept; // (2) C++20 +constexpr value_type + operator--(int) const noexcept; // (2) C++26 ``` ## 概要 @@ -106,3 +113,5 @@ int main() - 戻り値の型を`T`から`value_type`に変更 - [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) - C++26でCV修飾されたテンプレート引数を受け取れるようになった +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_ref/op_increment.md b/reference/atomic/atomic_ref/op_increment.md index d870ebb252..ba657a4283 100644 --- a/reference/atomic/atomic_ref/op_increment.md +++ b/reference/atomic/atomic_ref/op_increment.md @@ -6,8 +6,15 @@ * cpp20[meta cpp] ```cpp -value_type operator++() const noexcept; // (1) C++20 -value_type operator++(int) const noexcept; // (2) C++20 +value_type + operator++() const noexcept; // (1) C++20 +constexpr value_type + operator++() const noexcept; // (1) C++26 + +value_type + operator++(int) const noexcept; // (2) C++20 +constexpr value_type + operator++(int) const noexcept; // (2) C++26 ``` ## 概要 @@ -108,3 +115,5 @@ int main() - 戻り値の型を`T`から`value_type`に変更 - [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) - C++26でCV修飾されたテンプレート引数を受け取れるようになった +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_ref/op_minus_assign.md b/reference/atomic/atomic_ref/op_minus_assign.md index 3811861b89..eb05e3b4b1 100644 --- a/reference/atomic/atomic_ref/op_minus_assign.md +++ b/reference/atomic/atomic_ref/op_minus_assign.md @@ -6,8 +6,10 @@ * cpp20[meta cpp] ```cpp -T operator-=(T operand) const noexcept; // (1) C++20 -value_type operator-=(value_type operand) const noexcept; // (1) C++26 +T + operator-=(T operand) const noexcept; // (1) C++20 +constexpr value_type + operator-=(value_type operand) const noexcept; // (1) C++26 ``` ## 概要 @@ -133,3 +135,5 @@ int main() ## 参照 - [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) - C++26でCV修飾されたテンプレート引数を受け取れるようになった +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_ref/op_or_assign.md b/reference/atomic/atomic_ref/op_or_assign.md index 20f5be116a..18ca0d1286 100644 --- a/reference/atomic/atomic_ref/op_or_assign.md +++ b/reference/atomic/atomic_ref/op_or_assign.md @@ -6,8 +6,10 @@ * cpp20[meta cpp] ```cpp -T operator|=(T operand) const noexcept; // (1) C++20 -value_type operator|=(value_type operand) const noexcept; // (1) C++26 +T + operator|=(T operand) const noexcept; // (1) C++20 +constexpr value_type + operator|=(value_type operand) const noexcept; // (1) C++26 ``` ## 概要 @@ -107,3 +109,5 @@ int main() ## 参照 - [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) - C++26でCV修飾されたテンプレート引数を受け取れるようになった +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_ref/op_plus_assign.md b/reference/atomic/atomic_ref/op_plus_assign.md index 44a48256e3..2b4cb59e24 100644 --- a/reference/atomic/atomic_ref/op_plus_assign.md +++ b/reference/atomic/atomic_ref/op_plus_assign.md @@ -6,8 +6,10 @@ * cpp20[meta cpp] ```cpp -T operator+=(T operand) const noexcept; // (1) C++20 -value_type operator+=(value_type operand) const noexcept; // (1) C++26 +T + operator+=(T operand) const noexcept; // (1) C++20 +constexpr value_type + operator+=(value_type operand) const noexcept; // (1) C++26 ``` ## 概要 @@ -132,3 +134,5 @@ int main() ## 参照 - [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) - C++26でCV修飾されたテンプレート引数を受け取れるようになった +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_ref/op_value_type.md b/reference/atomic/atomic_ref/op_value_type.md index f2fa124bed..37845899db 100644 --- a/reference/atomic/atomic_ref/op_value_type.md +++ b/reference/atomic/atomic_ref/op_value_type.md @@ -6,7 +6,7 @@ * cpp26[meta cpp] ```cpp -operator value_type() const noexcept; +constexpr operator value_type() const noexcept; // (1) C++26 ``` ## 概要 @@ -59,3 +59,5 @@ int main() ## 参照 - [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) - C++26でCV修飾されたテンプレート引数を受け取れるようになった +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_ref/op_xor_assign.md b/reference/atomic/atomic_ref/op_xor_assign.md index 4e0e2f47d4..b8cf139476 100644 --- a/reference/atomic/atomic_ref/op_xor_assign.md +++ b/reference/atomic/atomic_ref/op_xor_assign.md @@ -6,8 +6,10 @@ * cpp20[meta cpp] ```cpp -T operator^=(T operand) const noexcept; // (1) C++20 -value_type operator^=(value_type operand) const noexcept; // (1) C++26 +T + operator^=(T operand) const noexcept; // (1) C++20 +constexpr value_type + operator^=(value_type operand) const noexcept; // (1) C++26 ``` ## 概要 @@ -103,3 +105,5 @@ int main() ## 参照 - [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) - C++26でCV修飾されたテンプレート引数を受け取れるようになった +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_ref/store.md b/reference/atomic/atomic_ref/store.md index 696c7eaa2f..1e73ac4a7c 100644 --- a/reference/atomic/atomic_ref/store.md +++ b/reference/atomic/atomic_ref/store.md @@ -6,10 +6,12 @@ * cpp20[meta cpp] ```cpp -void store(T desired, - memory_order order = memory_order_seq_cst) const noexcept; // (1) C++20 -void store(value_type desired, - memory_order order = memory_order_seq_cst) const noexcept; // (1) C++26 +void + store(T desired, + memory_order order = memory_order_seq_cst) const noexcept; // (1) C++20 +constexpr void + store(value_type desired, + memory_order order = memory_order_seq_cst) const noexcept; // (1) C++26 ``` * memory_order[link /reference/atomic/memory_order.md] * memory_order_seq_cst[link /reference/atomic/memory_order.md] @@ -84,3 +86,5 @@ int main() ## 参照 - [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) - C++26でCV修飾されたテンプレート引数を受け取れるようになった +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_ref/wait.md b/reference/atomic/atomic_ref/wait.md index 13e7203b65..58f146c89b 100644 --- a/reference/atomic/atomic_ref/wait.md +++ b/reference/atomic/atomic_ref/wait.md @@ -9,7 +9,7 @@ void wait(T old, memory_order order = memory_order::seq_cst) const noexcept; // (1) C++20 -void +constexpr void wait(value_type old, memory_order order = memory_order::seq_cst) const noexcept; // (1) C++26 ``` @@ -134,3 +134,5 @@ int main() - [P1643R1 Add wait/notify to `atomic_ref`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1643r1.html) - [P3323R1 cv-qualified types in `atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3323r1.html) - C++26でCV修飾されたテンプレート引数を受け取れるようになった +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_signal_fence.md b/reference/atomic/atomic_signal_fence.md index 70e79afc81..00974d700c 100644 --- a/reference/atomic/atomic_signal_fence.md +++ b/reference/atomic/atomic_signal_fence.md @@ -6,7 +6,12 @@ ```cpp namespace std { - extern "C" void atomic_signal_fence(memory_order order) noexcept; + extern "C" + void + atomic_signal_fence(memory_order order) noexcept; // (1) C++11 + extern "C" + constexpr void + atomic_signal_fence(memory_order order) noexcept; // (1) C++26 } ``` * memory_order[link memory_order.md] @@ -50,5 +55,6 @@ namespace std { ## 参照 -[How to correctly use std::atomic_signal_fence()?](http://stackoverflow.com/questions/14581090/how-to-correctly-use-stdatomic-signal-fence) - +- [How to correctly use std::atomic_signal_fence()?](http://stackoverflow.com/questions/14581090/how-to-correctly-use-stdatomic-signal-fence) +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_store.md b/reference/atomic/atomic_store.md index ce97d33c72..7793a8b4f6 100644 --- a/reference/atomic/atomic_store.md +++ b/reference/atomic/atomic_store.md @@ -7,20 +7,26 @@ ```cpp namespace std { template - void atomic_store(volatile atomic* object, - T desired) noexcept; // (1) C++11 - + void + atomic_store(volatile atomic* object, + T desired) noexcept; // (1) C++11 template - void atomic_store(volatile atomic* object, - typename atomic::value_type desired) noexcept; // (1) C++17 + void + atomic_store(volatile atomic* object, + typename atomic::value_type desired) noexcept; // (1) C++17 template - void atomic_store(atomic* object, - T desired) noexcept; // (2) C++11 - + void + atomic_store(atomic* object, + T desired) noexcept; // (2) C++11 + template + void + atomic_store(atomic* object, + typename atomic::value_type desired) noexcept; // (2) C++17 template - void atomic_store(atomic* object, - typename atomic::value_type desired) noexcept; // (2) C++17 + constexpr void + atomic_store(atomic* object, + typename atomic::value_type desired) noexcept; // (2) C++26 } ``` * atomic[link /reference/atomic/atomic.md] @@ -96,3 +102,5 @@ int main() - [P0558R1 Resolving `atomic` named base class inconsistencies](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0558r1.pdf) - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_store_explicit.md b/reference/atomic/atomic_store_explicit.md index 742052570b..c97de61c17 100644 --- a/reference/atomic/atomic_store_explicit.md +++ b/reference/atomic/atomic_store_explicit.md @@ -7,28 +7,37 @@ ```cpp namespace std { template - void atomic_store_explicit( + void + atomic_store_explicit( volatile atomic* object, T desired, memory_order order) noexcept; // (1) C++11 - template - void atomic_store_explicit( + void + atomic_store_explicit( volatile atomic* object, typename atomic::value_type desired, memory_order order) noexcept; // (1) C++17 template - void atomic_store_explicit( + void + atomic_store_explicit( atomic* object, T desired, memory_order order) noexcept; // (2) C++11 template - void atomic_store_explicit( + void + atomic_store_explicit( atomic* object, typename atomic::value_type desired, memory_order order) noexcept; // (2) C++17 + template + constexpr void + atomic_store_explicit( + atomic* object, + typename atomic::value_type desired, + memory_order order) noexcept; // (2) C++26 } ``` * atomic[link atomic.md] @@ -105,3 +114,5 @@ int main() - [P0558R1 Resolving `atomic` named base class inconsistencies](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0558r1.pdf) - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_thread_fence.md b/reference/atomic/atomic_thread_fence.md index a47bf3fab9..4ed4a0d775 100644 --- a/reference/atomic/atomic_thread_fence.md +++ b/reference/atomic/atomic_thread_fence.md @@ -6,7 +6,12 @@ ```cpp namespace std { - extern "C" void atomic_thread_fence(memory_order order) noexcept; + extern "C" + void + atomic_thread_fence(memory_order order) noexcept; // (1) C++11 + extern "C" + constexpr void + atomic_thread_fence(memory_order order) noexcept; // (1) C++26 } ``` * memory_order[link memory_order.md] @@ -142,4 +147,5 @@ int main() ## 参照 - [Implementing Dekker's algorithm with Fences](https://www.justsoftwaresolutions.co.uk/threading/implementing_dekkers_algorithm_with_fences.html) - +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_wait.md b/reference/atomic/atomic_wait.md index 75f0080cb0..5a8f5996cd 100644 --- a/reference/atomic/atomic_wait.md +++ b/reference/atomic/atomic_wait.md @@ -7,12 +7,18 @@ ```cpp namespace std { template - void atomic_wait(const volatile atomic* object, - typename atomic::value_type old); // (1) C++20 + void + atomic_wait(const volatile atomic* object, + typename atomic::value_type old); // (1) C++20 template - void atomic_wait(const atomic* object, - typename atomic::value_type old); // (2) C++20 + void + atomic_wait(const atomic* object, + typename atomic::value_type old); // (2) C++20 + template + constexpr void + atomic_wait(const atomic* object, + typename atomic::value_type old); // (2) C++26 } ``` @@ -132,3 +138,5 @@ int main() - [ogiroux/atomic_wait - Sample implementation of C++20 atomic_wait/notify](https://github.com/ogiroux/atomic_wait) - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/atomic_wait_explicit.md b/reference/atomic/atomic_wait_explicit.md index 07a84ebbff..1f273afa61 100644 --- a/reference/atomic/atomic_wait_explicit.md +++ b/reference/atomic/atomic_wait_explicit.md @@ -7,14 +7,21 @@ ```cpp namespace std { template - void atomic_wait(const volatile atomic* object, - typename atomic::value_type old, - memory_order order); // (1) C++20 + void + atomic_wait(const volatile atomic* object, + typename atomic::value_type old, + memory_order order); // (1) C++20 template - void atomic_wait(const atomic* object, - typename atomic::value_type old, - memory_order order); // (2) C++20 + void + atomic_wait(const atomic* object, + typename atomic::value_type old, + memory_order order); // (2) C++20 + template + constexpr void + atomic_wait(const atomic* object, + typename atomic::value_type old, + memory_order order); // (2) C++26 } ``` @@ -135,3 +142,5 @@ int main() - [ogiroux/atomic_wait - Sample implementation of C++20 atomic_wait/notify](https://github.com/ogiroux/atomic_wait) - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - C++20での、`volatile`版への制約追加 +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した diff --git a/reference/atomic/kill_dependency.md b/reference/atomic/kill_dependency.md index 75347c82a5..461a6a91d3 100644 --- a/reference/atomic/kill_dependency.md +++ b/reference/atomic/kill_dependency.md @@ -7,7 +7,9 @@ ```cpp namespace std { template - T kill_dependency(T y) noexcept; + T kill_dependency(T y) noexcept; // (1) C++11 + template + constexpr T kill_dependency(T y) noexcept; // (1) C++26 } ``` @@ -122,4 +124,5 @@ T kill_dependency(T y) noexcept - [What does `std::kill_dependency` do, and why would I want to use it? - StackOverflow](http://stackoverflow.com/q/7150395/463412) - [C++0xのメモリバリアをより深く解説してみる - yamasaのネタ帳](http://d.hatena.ne.jp/bsdhouse/20090929/1254237835) - [(抄訳)N4215 `memory_order_consume`の利用と実装に向けて[§5-6のみ]](http://d.hatena.ne.jp/yohhoy/20141115/p1) - +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) + - C++26で`constexpr`に対応した From 08bb4ea25f7b80e3098f1864174c87d2aa893a39 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Wed, 25 Dec 2024 16:32:04 +0900 Subject: [PATCH 1367/3948] =?UTF-8?q?=E3=83=98=E3=83=83=E3=83=80=E3=81=AE?= =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=81=AE=E3=83=86=E3=82=AD=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=81=A8=E3=82=A2=E3=83=89=E3=83=AC=E3=82=B9=E3=81=AE?= =?UTF-8?q?=E4=B8=8D=E4=B8=80=E8=87=B4=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 以下の正規表現で検出しました。 \[`<(\w+)>`\]\(/reference/(?!\1) --- lang/cpp14/feature_test_macros.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp14/feature_test_macros.md b/lang/cpp14/feature_test_macros.md index 93018d3bdc..dea42835af 100644 --- a/lang/cpp14/feature_test_macros.md +++ b/lang/cpp14/feature_test_macros.md @@ -31,7 +31,7 @@ SD-6 は C++14 の機能について以下のテストマクロを定義する | `__cpp_lib_is_null_pointer` | `201309` | [`std::is_null_pointer`](/reference/type_traits/is_null_pointer.md) | [``](/reference/type_traits.md) | | `__cpp_lib_make_reverse_iterator` | `201402` | [`std::make_reverse_iterator`](/reference/iterator/make_reverse_iterator.md) | [``](/reference/iterator.md) | | `__cpp_lib_make_unique` | `201304` | [`std::make_unique`](/reference/memory/make_unique.md) | [``](/reference/memory/make_unique.md) -| `__cpp_lib_null_iterators` | `201304` | ヌル前方向イテレータ | [``](/reference/algorithm.md) | +| `__cpp_lib_null_iterators` | `201304` | ヌル前方向イテレータ | [``](/reference/iterator.md) | | `__cpp_lib_quoted_string_io` | `201304` | [`std::quoted`](/reference/iomanip/quoted.md) | [``](/reference/iomanip.md) | `__cpp_lib_result_of_sfinae` | `201210` | [`std::result_of`](/reference/type_traits/result_of.md) と SFINAE | [``](/reference/type_traits.md) | | `__cpp_lib_robust_nonmodifying_seq_ops` | `201304` | シーケンスを変更しない操作をよりロバストに | [``](/reference/algorithm.md) | From 21abedcfe2c88d697684e421604e1e9601e8e15e Mon Sep 17 00:00:00 2001 From: rotarymars Date: Thu, 26 Dec 2024 12:31:04 +0900 Subject: [PATCH 1368/3948] added sample program and explanation for fstream --- reference/fstream/basic_fstream.md | 37 +++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/reference/fstream/basic_fstream.md b/reference/fstream/basic_fstream.md index d0c1c530df..e98b27570c 100644 --- a/reference/fstream/basic_fstream.md +++ b/reference/fstream/basic_fstream.md @@ -16,7 +16,7 @@ namespace std { * basic_iostream[link /reference/istream/basic_iostream.md] ## 概要 - +ファイルに対する入出力を提供する高水準な機構 ## メンバ関数 @@ -49,3 +49,38 @@ namespace std { | `off_type` | `Traits::off_type` | | | `traits_type` | テンプレート仮引数`Traits` | | +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::fstream fs; + fs.exceptions(std::ios::failbit | std::ios::badbit); // 例外を有効化する + try { + fs.open("./temp.txt", std::ios_base::out | std::ios_base::in | std::ios_base::trunc); + if (!fs.is_open()) { + throw std::runtime_error("Failed to open file"); // ファイルが開けなかった場合 + } + int a = 1; + long double b = 3.141592; + std::string c = "hello"; + fs << a << " " << b << " " << c << std::endl; + fs.seekg(0); + int d; + long double e; + std::string f; + fs >> d >> e >> f; + if (!fs) { + throw std::runtime_error("Failed to read from file"); // ファイルから読み取れなかった場合 + } + std::cout << d << " " << e << " " << f << std::endl; + } catch (const std::exception& e) { + std::cerr << "Error: " << e.what() << std::endl; + return 1; + } + return 0; +} +``` \ No newline at end of file From 64776782f03c81be11835f473399041f47cf6cf5 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 26 Dec 2024 14:13:03 +0900 Subject: [PATCH 1369/3948] =?UTF-8?q?atomic=5Fref=20:=20C++26=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C=E3=81=A8=E3=81=97=E3=81=A6address=E3=83=A1=E3=83=B3?= =?UTF-8?q?=E3=83=90=E9=96=A2=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0=20(close?= =?UTF-8?q?=20#1387)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 2 +- reference/atomic/atomic_ref.md | 1 + reference/atomic/atomic_ref/address.md | 111 +++++++++++++++++++++++++ 3 files changed, 113 insertions(+), 1 deletion(-) create mode 100644 reference/atomic/atomic_ref/address.md diff --git a/lang/cpp26.md b/lang/cpp26.md index 56ddce47de..076b5c095b 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -225,7 +225,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 ### 並行・並列・非同期処理 - [``](/reference/execution.md)に汎用的な非同期実行を管理するフレームワークを追加 - [`std::atomic`](/reference/atomic/atomic.md)オブジェクトに対する2つの値の最大値・最小値を取得する関数として、メンバ関数[`fetch_max()`](/reference/atomic/atomic/fetch_max.md)と[`fetch_min()`](/reference/atomic/atomic/fetch_min.md)、非メンバ関数として[`std::atomic_fetch_max`](/reference/atomic/atomic_fetch_max.md)、[`std::atomic_fetch_max_explicit`](/reference/atomic/atomic_fetch_max_explicit.md)、[`std::atomic_fetch_min`](/reference/atomic/atomic_fetch_min.md)、[`std::atomic_fetch_min_explicit`](/reference/atomic/atomic_fetch_min_explicit.md)を追加 -- [`std::atomic_ref`](/reference/atomic/atomic_ref.md)クラスに、参照するオブジェクトのアドレスを取得する[`address()`](/reference/atomic/atomic_ref/address.md.nolink)メンバ関数を追加 +- [`std::atomic_ref`](/reference/atomic/atomic_ref.md)クラスに、参照するオブジェクトのアドレスを取得する[`address()`](/reference/atomic/atomic_ref/address.md)メンバ関数を追加 - [`std::atomic`](/reference/atomic/atomic.md)クラスのテンプレートパラメータとしてCV修飾された型を禁止 - [`std::atomic_ref`](/reference/atomic/atomic_ref.md)クラスのテンプレートパラメータとして、CV修飾された型を受け取れるようにした (内部でCV修飾が外される) - [``](/reference/atomic.md)ライブラリのアトミック操作を`constexpr`対応 diff --git a/reference/atomic/atomic_ref.md b/reference/atomic/atomic_ref.md index d9f77af792..2323676da9 100644 --- a/reference/atomic/atomic_ref.md +++ b/reference/atomic/atomic_ref.md @@ -59,6 +59,7 @@ C++26から、これらの特殊化はCV修飾された型に対しても行わ | [`wait`](atomic_ref/wait.md) | 起床されるまで待機する | C++20 | | [`notify_one`](atomic_ref/notify_one.md) | 待機しているスレッドをひとつ起床させる | C++20 | | [`notify_all`](atomic_ref/notify_all.md) | 待機している全てのスレッドを起床させる | C++20 | +| [`address`](atomic_ref/address.md) | 参照しているオブジェクトのアドレスを取得する | C++26 | ### 共通メンバ型 diff --git a/reference/atomic/atomic_ref/address.md b/reference/atomic/atomic_ref/address.md new file mode 100644 index 0000000000..11afa684b0 --- /dev/null +++ b/reference/atomic/atomic_ref/address.md @@ -0,0 +1,111 @@ +# address +* atomic[meta header] +* std[meta namespace] +* atomic_ref[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr T* address() const noexcept; +``` + +## 概要 +参照しているオブジェクトのアドレスを取得する。 + +### この関数を必要とする状況 +#### データ構造の要素へのアトミックアクセス +配列の各要素にアトミックアクセスする際、[`std::atomic`](/reference/atomic/atomic.md)オブジェクトでは以下のように記述する。 + +```cpp +std::array, N> array; + +int fetch_add_idx(std::atomic* base, size_t i, int value) { + return base[i].fetch_add(value); +} +``` +* fetch_add[link fetch_add.md] + +これを`std::atomic_ref`で記述する場合、アトミック性をもたせてアクセスするには、この関数を使用して以下のようにする。 + +```cpp +int fetch_add_idx(std::atomic_ref base, size_t i, int value) { + int* p = base.address(); + return std::atomic_ref{*(p+i)}.fetch_add(value); +} +``` +* fetch_add[link fetch_add.md + +#### 必要なときにのみアトミックアクセスする +以下の例では、複数のスレッドが並行にメモリにアクセスし、カウンタをインクリメントすることでアクセス終了を知らせている。最後のスレッドはメモリにアクセスする余分な処理を実行する必要があるが、並行にメモリにアクセスするほかのスレッドがないため、これらのアクセスはアトミックである必要がない: + +```cpp +void thread(atomic_ref* data, atomic_ref counter, int nthreads) { + data->fetch_add(42, memory_order_relaxed); + int* d = data->address(); // dataへの生ポインタを取得 + data->~atomic_ref(); // このスレッドのデータへのatomic_refを破棄する + int pos = counter.fetch_add(1); // データの破棄が完了したことを伝える + if (pos != (nthreads - 1)) + return; + + // 最後のスレッド: アトミックアクセスする必要がない + int last_data = *d; // 非アトミックアクセス + // … +} +``` + + +## 戻り値 +`*this`が参照するオブジェクトをアドレス値を返す + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include +#include + +void f(std::atomic_ref ar, int i) { + int* p = ar.address(); + std::atomic_ref{p + i}.fetch_add(1); +} + +int main() +{ + int ar[3] = {}; + + std::thread t1{[&ar]{ f(std::atomic_ref{ar[0]}, 1); }}; + std::thread t2{[&ar]{ f(std::atomic_ref{ar[0]}, 1); }}; + + t1.join(); + t2.join(); + + std::cout << ar[1] << std::endl; +} +``` +* address()[color ff0000] +* fetch_add[link fetch_add.md] + + +### 出力 +``` +2 +``` + + +## バージョン +### 言語 +- C++26 + + +### 処理系 +- [Clang](/implementation.md#clang): 19.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 14 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2835R7 Expose `std::atomic_ref` 's object address](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2835r7.html) From 911478d0e46c4add061dac67470119f35f16740d Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Thu, 26 Dec 2024 22:54:31 +0900 Subject: [PATCH 1370/3948] =?UTF-8?q?GLOBAL=5FDEFINED=5FWORDS:=20=E3=83=8C?= =?UTF-8?q?=E3=83=AB=E7=B5=82=E7=AB=AF=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/cpprefjp/site/issues/1398#issuecomment-2562691795 --- GLOBAL_DEFINED_WORDS.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/GLOBAL_DEFINED_WORDS.json b/GLOBAL_DEFINED_WORDS.json index e3e754d6c1..991c2c4011 100644 --- a/GLOBAL_DEFINED_WORDS.json +++ b/GLOBAL_DEFINED_WORDS.json @@ -176,5 +176,9 @@ "例外": { "yomi": "れいがい", "desc": "問題が発生したときに、現在実行位置を過去に通過・記録した位置に戻し、文脈情報を添えて紐づけられた処理(例外ハンドラー)を呼び出す仕組み。またはその事態" + }, + "ヌル終端": { + "yomi": "ぬるしゅうたん", + "desc": "null-terminated。文字列においてヌル文字 '\0' を用いてその終端を表すこと。ヌル文字自体は文字列に含まない。広義には線形データ構造においてヌルまたは値 0 を番兵としてその終わりを示すこと。" } } From 2d8efa3b7d714b099710d747f4a0532a7f999480 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Thu, 26 Dec 2024 23:04:34 +0900 Subject: [PATCH 1371/3948] =?UTF-8?q?GLOBAL=5FDEFINED=5FWORDS:=20=E3=80=8C?= =?UTF-8?q?=E3=83=8C=E3=83=AB=E7=B5=82=E7=AB=AF=E3=80=8D=E3=81=AE=E8=A7=A3?= =?UTF-8?q?=E8=AA=AC=E3=81=AE=E6=96=87=E5=AD=97=E5=88=97=E3=83=AA=E3=83=86?= =?UTF-8?q?=E3=83=A9=E3=83=AB=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_DEFINED_WORDS.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GLOBAL_DEFINED_WORDS.json b/GLOBAL_DEFINED_WORDS.json index 991c2c4011..4add216e18 100644 --- a/GLOBAL_DEFINED_WORDS.json +++ b/GLOBAL_DEFINED_WORDS.json @@ -179,6 +179,6 @@ }, "ヌル終端": { "yomi": "ぬるしゅうたん", - "desc": "null-terminated。文字列においてヌル文字 '\0' を用いてその終端を表すこと。ヌル文字自体は文字列に含まない。広義には線形データ構造においてヌルまたは値 0 を番兵としてその終わりを示すこと。" + "desc": "null-terminated。文字列においてヌル文字 '\\0' を用いてその終端を表すこと。ヌル文字自体は文字列に含まない。広義には線形データ構造においてヌルまたは値 0 を番兵としてその終わりを示すこと" } } From b4ff92e9e24dc437c196091eafd940a9245d3112 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sun, 29 Dec 2024 15:06:55 +0900 Subject: [PATCH 1372/3948] Added verified version --- reference/chrono/duration.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/chrono/duration.md b/reference/chrono/duration.md index 8e109b71d2..386f75d835 100644 --- a/reference/chrono/duration.md +++ b/reference/chrono/duration.md @@ -221,6 +221,7 @@ Tue Oct 16 16:25:11 2012 ### 処理系 - [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] +- [Clang](/implementation.md#clang): 14.0.6 [mark verified] ## 参照 - [P2592R3 Hashing support for `std::chrono` value classes](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2592r3.html) From d1539913fd1314fae96720a1f80e966c7c51d387 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sun, 29 Dec 2024 15:16:10 +0900 Subject: [PATCH 1373/3948] Added verified version --- reference/unordered_set/unordered_set/contains.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/unordered_set/unordered_set/contains.md b/reference/unordered_set/unordered_set/contains.md index 27b783ab89..b58d453134 100644 --- a/reference/unordered_set/unordered_set/contains.md +++ b/reference/unordered_set/unordered_set/contains.md @@ -70,7 +70,7 @@ contain - C++20 ### 処理系 -- [Clang](/implementation.md#clang): +- [Clang](/implementation.md#clang): 14.0.6 [mark verified] - [GCC](/implementation.md#gcc): 9.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 1 [mark verified] From 7bd2d3d161d370449e7a779b0c6888b561768489 Mon Sep 17 00:00:00 2001 From: KASUYA Rei Date: Sat, 4 Jan 2025 07:38:54 +0900 Subject: [PATCH 1374/3948] =?UTF-8?q?fix=20typo=EF=BC=88=E9=9D=A2=E5=A0=B4?= =?UTF-8?q?=20->=20=E3=83=A1=E3=83=B3=E3=83=90=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp26.md b/lang/cpp26.md index 076b5c095b..87e5aaf0f4 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -344,7 +344,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - 定数式での例外送出が許可されることにともない、以下を`constexpr`化 - [``](/reference/exception.md)ヘッダの以下の機能 - [`std::exception`](/reference/exception/exception.md)クラスの全メンバ関数 - - [`std::nested_exception`](/reference/exception/nested_exception.md)クラスの全面場関数 + - [`std::nested_exception`](/reference/exception/nested_exception.md)クラスの全メンバ関数 - [`std::bad_exception`](/reference/exception/bad_exception.md)クラスの`what()`メンバ関数 - [`std::uncaught_exceptions()`](/reference/exception/uncaught_exceptions.md)関数 - [`std::current_exception()`](/reference/exception/current_exception.md)関数 From 3bd8c4faa34592ddac30df1594f3fe4f6c20ec8f Mon Sep 17 00:00:00 2001 From: I <1091761+wx257osn2@users.noreply.github.com> Date: Sat, 4 Jan 2025 09:09:03 +0900 Subject: [PATCH 1375/3948] add comment to clarify the state more --- reference/future/future/valid.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reference/future/future/valid.md b/reference/future/future/valid.md index bcd9024598..9626f2b194 100644 --- a/reference/future/future/valid.md +++ b/reference/future/future/valid.md @@ -31,11 +31,13 @@ int main() std::promise p; std::future f = p.get_future(); - p.set_value(1); - // 共有状態を持っている std::cout << std::boolalpha << f.valid() << std::endl; + p.set_value(1); + + // この時点でもまだ共有状態を持っている + f.get(); // 一度値を取り出すと共有状態が破棄される std::cout << std::boolalpha << f.valid() << std::endl; From 2a7c46fa2a18a023bf05a8ed95830bd85a4b46da Mon Sep 17 00:00:00 2001 From: I <1091761+wx257osn2@users.noreply.github.com> Date: Sat, 4 Jan 2025 09:11:44 +0900 Subject: [PATCH 1376/3948] add example to see difference between `wait_for(0s) == ready` and `valid()` --- reference/future/future/wait_for.md | 51 ++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/reference/future/future/wait_for.md b/reference/future/future/wait_for.md index fd77159de7..2f079ffd86 100644 --- a/reference/future/future/wait_for.md +++ b/reference/future/future/wait_for.md @@ -30,6 +30,7 @@ future_status wait_for(const chrono::duration& rel_time) const; ## 例 +### 例1 ```cpp example #include #include @@ -70,11 +71,59 @@ int main() * std::future_status[link /reference/future/future_status.md] * f.get()[link /reference/future/shared_future/get.md] -### 出力例 +#### 出力例 ``` 3 ``` +### 例2 +```cpp example +#include +#include +#include + +int main() +{ + std::promise p; + std::future f = p.get_future(); + const auto ready = [&f] { + return f.wait_for(std::chrono::seconds{0}) == std::future_status::ready; + }; + + // まだ値はセットされていない + std::cout << std::boolalpha << ready() << std::endl; + + p.set_value(1); + + // 値がセットされた + std::cout << std::boolalpha << ready() << std::endl; + + f.get(); // 一度値を取り出すと共有状態が破棄される + + // 共有状態を持たない(valid() == falseな)futureでwaitをするとstd::future_error例外 + try { + ready(); + } + catch(const std::future_error& e) { + std::cout << e.what() << std::endl; + } +} +``` +* wait_for[color ff0000] +* std::promise[link /reference/future/promise.md] +* p.set_value[link /reference/future/promise/set_value.md] +* std::future_status[link /reference/future/future_status.md] +* f.get()[link /reference/future/shared_future/get.md] +* valid()[link /reference/future/future/valid.md] +* std::future_error[link /reference/future/future_error.md] + +#### 出力例 +``` +false +true +std::future_error: No associated state +``` + ## バージョン ### 言語 - C++11 From f1ae4bcfabb3cef121a1d4f6d1fc102c74c3b11f Mon Sep 17 00:00:00 2001 From: I <1091761+wx257osn2@users.noreply.github.com> Date: Sat, 4 Jan 2025 09:32:32 +0900 Subject: [PATCH 1377/3948] add comment about SEGV on libc++ --- reference/future/future/wait_for.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/future/future/wait_for.md b/reference/future/future/wait_for.md index 2f079ffd86..a2cc2921f5 100644 --- a/reference/future/future/wait_for.md +++ b/reference/future/future/wait_for.md @@ -101,6 +101,7 @@ int main() f.get(); // 一度値を取り出すと共有状態が破棄される // 共有状態を持たない(valid() == falseな)futureでwaitをするとstd::future_error例外 + // ただし、libc++では(少なくとも19.1.0までは)SEGVするので注意 try { ready(); } From eba553f04a34c46b2d494ef772d45465de39b137 Mon Sep 17 00:00:00 2001 From: I <1091761+wx257osn2@users.noreply.github.com> Date: Sat, 4 Jan 2025 13:22:52 +0900 Subject: [PATCH 1378/3948] add preconditions to member functions of std::future / remove UB from example --- reference/future/future/get.md | 5 +++++ reference/future/future/wait.md | 5 +++++ reference/future/future/wait_for.md | 17 +++++++---------- reference/future/future/wait_until.md | 5 +++++ 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/reference/future/future/get.md b/reference/future/future/get.md index 5c2343a5c4..137c1f4033 100644 --- a/reference/future/future/get.md +++ b/reference/future/future/get.md @@ -29,6 +29,11 @@ void future::get(); 共有状態に例外が格納されていた場合、格納されている例外を送出する。 +## 事前条件 +- [`valid()`](valid.md) `== true` + - この条件を満たさなかった場合、処理系によっては[`future_error`](../future_error.md)例外を投げることがある。 + + ## 事後条件 この関数呼び出し後は共有状態が破棄され、[`valid()`](valid.md) `== false`となること。 diff --git a/reference/future/future/wait.md b/reference/future/future/wait.md index 43bf1d5ce3..397bb84366 100644 --- a/reference/future/future/wait.md +++ b/reference/future/future/wait.md @@ -21,6 +21,11 @@ void wait() const; なし +## 事前条件 +- [`valid()`](valid.md) `== true` + - この条件を満たさなかった場合、処理系によっては[`future_error`](../future_error.md)例外を投げることがある。 + + ## 例 ```cpp example #include diff --git a/reference/future/future/wait_for.md b/reference/future/future/wait_for.md index a2cc2921f5..f2dca8bbcd 100644 --- a/reference/future/future/wait_for.md +++ b/reference/future/future/wait_for.md @@ -29,6 +29,11 @@ future_status wait_for(const chrono::duration& rel_time) const; - C++14 : 時計クラス、[`time_point`](/reference/chrono/time_point.md)クラス、[`duration`](/reference/chrono/duration.md)クラスの構築が例外を送出する場合、この関数はそれらの例外を送出する。 +## 事前条件 +- [`valid()`](valid.md) `== true` + - この条件を満たさなかった場合、処理系によっては[`future_error`](../future_error.md)例外を投げることがある。 + + ## 例 ### 例1 ```cpp example @@ -100,14 +105,8 @@ int main() f.get(); // 一度値を取り出すと共有状態が破棄される - // 共有状態を持たない(valid() == falseな)futureでwaitをするとstd::future_error例外 - // ただし、libc++では(少なくとも19.1.0までは)SEGVするので注意 - try { - ready(); - } - catch(const std::future_error& e) { - std::cout << e.what() << std::endl; - } + // 共有状態を持たない(valid() == falseな)futureでwaitをするとUB + // ready(); } ``` * wait_for[color ff0000] @@ -116,13 +115,11 @@ int main() * std::future_status[link /reference/future/future_status.md] * f.get()[link /reference/future/shared_future/get.md] * valid()[link /reference/future/future/valid.md] -* std::future_error[link /reference/future/future_error.md] #### 出力例 ``` false true -std::future_error: No associated state ``` ## バージョン diff --git a/reference/future/future/wait_until.md b/reference/future/future/wait_until.md index 6a84f1213b..2d61fe9f28 100644 --- a/reference/future/future/wait_until.md +++ b/reference/future/future/wait_until.md @@ -34,6 +34,11 @@ future_status wait_until(const chrono::time_point& abs_time) co - C++14 : 時計クラス、[`time_point`](/reference/chrono/time_point.md)クラス、[`duration`](/reference/chrono/duration.md)クラスの構築が例外を送出する場合、この関数はそれらの例外を送出する。 +## 事前条件 +- [`valid()`](valid.md) `== true` + - この条件を満たさなかった場合、処理系によっては[`future_error`](../future_error.md)例外を投げることがある。 + + ## 例 ```cpp example #include From c2e5e06a8ffd07ad5d42d077f39e964ecd5af143 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 8 Jan 2025 16:42:08 +0900 Subject: [PATCH 1379/3948] =?UTF-8?q?string=5Fview::op=5Fsv=20:=20?= =?UTF-8?q?=E3=83=8C=E3=83=AB=E7=B5=82=E7=AB=AF=E3=81=AB=E9=96=A2=E3=81=99?= =?UTF-8?q?=E3=82=8B=E8=AA=AC=E6=98=8E=E3=81=8C=E3=82=8F=E3=81=8B=E3=82=8A?= =?UTF-8?q?=E3=81=AB=E3=81=8F=E3=81=8B=E3=81=A3=E3=81=9F=E3=81=AE=E3=81=A7?= =?UTF-8?q?=E8=BF=BD=E8=A8=98=20#1398?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: yoh --- reference/string_view/basic_string_view/op_sv.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/reference/string_view/basic_string_view/op_sv.md b/reference/string_view/basic_string_view/op_sv.md index 73aa146043..09fff219f8 100644 --- a/reference/string_view/basic_string_view/op_sv.md +++ b/reference/string_view/basic_string_view/op_sv.md @@ -45,8 +45,18 @@ inline namespace string_view_literals { ## 備考 - 中間にヌル文字を含む文字列リテラルから`basic_string_view`オブジェクトを構築する場合、コンストラクタを使用するよりもこちらの関数を使用したほうがよい。 - - `const char*`をとるコンストラクタは[`std::char_traits`](/reference/string/char_traits.md)`::`[`length()`](/reference/string/char_traits/length.md)関数を使用して文字列長を計算するため、ヌル終端となってしまう + - `const char*`をとるコンストラクタは[`std::char_traits`](/reference/string/char_traits.md)`::`[`length()`](/reference/string/char_traits/length.md)関数を使用して文字列長を計算するため、ヌル終端までの長さとなる。そのコンストラクタでは文字列の途中にヌル文字がある場合、文字列の終端まで扱われないので注意が必要となる - こちらの関数は文字列リテラルの長さを直接扱うため、文字列全体を参照する`basic_string_view`オブジェクトを構築できる + ```cpp + // コンストラクタは、ヌル文字までの長さ + const char* s = "123\0abc"; + auto sv0 = std::string_view{s}; + assert(sv0.length() == 3); // "123" + + // svリテラルは全体の長さ + auto sv1 = "123\0abc"sv; + assert(sv1.length() == 7); // "123\0abc" + ``` ## 例 From b84a2272d7ee6558d4555cc247434dff541bd4a4 Mon Sep 17 00:00:00 2001 From: Yuhki Ogasawara Date: Thu, 9 Jan 2025 20:51:24 +0900 Subject: [PATCH 1380/3948] =?UTF-8?q?=E3=82=BF=E3=82=A4=E3=83=9D=E3=81=AE?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp20/more_constexpr_containers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/cpp20/more_constexpr_containers.md b/lang/cpp20/more_constexpr_containers.md index d6eb1a19e2..a693e3c5b0 100644 --- a/lang/cpp20/more_constexpr_containers.md +++ b/lang/cpp20/more_constexpr_containers.md @@ -260,7 +260,7 @@ constexpr int g() { ## この機能が必要になった背景・経緯 -`std::vector`をはじめとする可変サイズのコンテナは実行時に非常に有用であるため、同様に定数式においても有用である可能性があり、その必要性がC++コミュニティからも示されいていた([C++Now 2017: Ben Deane & Jason Turner "constexpr ALL the things!"](https://youtu.be/HMB9oXFobJc)、[P0810R0 constexpr in Practice](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0810r0.pdf)など)。 +`std::vector`をはじめとする可変サイズのコンテナは実行時に非常に有用であるため、同様に定数式においても有用である可能性があり、その必要性がC++コミュニティからも示されていた([C++Now 2017: Ben Deane & Jason Turner "constexpr ALL the things!"](https://youtu.be/HMB9oXFobJc)、[P0810R0 constexpr in Practice](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0810r0.pdf)など)。 また、静的リフレクション機能の導入にあたっては、コンパイル時に使用可能な可変サイズコンテナおよび可変サイズの文字列型が必要となっていた。例えば、ある型のテンプレート引数をクエリするコードは次のようなものになる @@ -356,4 +356,4 @@ int main() { - [P0784R7 More constexpr containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0784r7.html) - [動的メモリー確保 - 江添亮の入門C++](https://ezoeryou.github.io/cpp-intro/#動的メモリー確保) - [N3664 Clarifying Memory Allocation](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3664.html) -- [P1974R0 Non-transient constexpr allocation using propconst](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1974r0.pdf) \ No newline at end of file +- [P1974R0 Non-transient constexpr allocation using propconst](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1974r0.pdf) From 0739bc98a5ac466534a0cd7db15675032c41a8a0 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 10 Jan 2025 17:54:05 +0900 Subject: [PATCH 1381/3948] =?UTF-8?q?is=5Ftrivial=20:=20C++26=E3=81=A7?= =?UTF-8?q?=E9=9D=9E=E6=8E=A8=E5=A5=A8=E5=8C=96=20(close=20#1374)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/type_traits.md | 2 +- reference/type_traits/is_trivial.md | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/reference/type_traits.md b/reference/type_traits.md index 62ae4af352..2e202f5216 100644 --- a/reference/type_traits.md +++ b/reference/type_traits.md @@ -58,7 +58,7 @@ |-----------------------------------------------|--------------------------------------------|-------| | [`is_const`](type_traits/is_const.md) | 型が`const`修飾型か調べる (class template) | C++11 | | [`is_volatile`](type_traits/is_volatile.md) | 型が`volatile`修飾型か調べる (class template) | C++11 | -| [`is_trivial`](type_traits/is_trivial.md) | 型がトリビアル型か調べる (class template) | C++11 | +| [`is_trivial`](type_traits/is_trivial.md) | 型がトリビアル型か調べる (class template) | C++11
C++26から非推奨 | | [`is_trivially_copyable`](type_traits/is_trivially_copyable.md) | 型がトリビアルコピー可能か調べる (class template) | C++11 | | [`is_standard_layout`](type_traits/is_standard_layout.md) | 型がスタンダードレイアウト型か調べる (class template) | C++11 | | [`is_pod`](type_traits/is_pod.md) | 型がPOD型か調べる (class template) | C++11
C++20から非推奨 | diff --git a/reference/type_traits/is_trivial.md b/reference/type_traits/is_trivial.md index 81656bf6ba..a0c02fef27 100644 --- a/reference/type_traits/is_trivial.md +++ b/reference/type_traits/is_trivial.md @@ -3,6 +3,7 @@ * std[meta namespace] * class template[meta id-type] * cpp11[meta cpp] +* cpp26deprecated[meta cpp] ```cpp namespace std { @@ -14,6 +15,14 @@ namespace std { } ``` +この型は、C++26で非推奨となった。 + +代わりの機能として、以下を使用すること: + +- [`std::is_trivially_default_constructible`](is_trivially_default_constructible.md) +- [`std::is_trivially_copyable`](is_trivially_copyable.md) +- [`std::is_trivially_copy_assignable`](is_trivially_copy_assignable.md) + ## 概要 型`T`がトリビアル型か調べる。トリビアル型は、トリビアルコピー可能、かつトリビアルなデフォルトコンストラクタを持つ型、およびそのcv修飾を含む。 @@ -30,6 +39,16 @@ namespace std { スカラ型は、トリビアル型の要件を満たす。トリビアル型の配列は、トリビアル型の要件を満たす。 +## 非推奨の詳細 +この機能は、トリビアルにコピー可能かと、トリビアルにデフォルト構築可能かの2つをチェックする。しかし、これら2つのチェックは異なる場面で必要となるため、この機能が必要となる状況がほとんどなかった。 + +そのため、以下の個別要件をチェックする型を使用することを推奨し、本機能は非推奨とした。 + +- [`std::is_trivially_default_constructible`](is_trivially_default_constructible.md) +- [`std::is_trivially_copyable`](is_trivially_copyable.md) +- [`std::is_trivially_copy_assignable`](is_trivially_copy_assignable.md) + + ## 例 ```cpp example #include @@ -80,3 +99,5 @@ int main(){} - [LWG Issue 2015. Incorrect pre-conditions for some type traits](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2015) - C++11では要件が「型`T`は完全型であるか、`const`/`volatile`修飾された(あるいはされていない)`void`か、要素数不明の配列型でなければならない。」だったが、これは間違いであるため、C++14で「型[`remove_all_extents`](remove_all_extents.md)`::type`は、完全型か、`const`/`volatile`修飾された(あるいはされていない)`void`でなければならない。」に変更された。 - [P0006R0 Adopt Type Traits Variable Templates from Library Fundamentals TS for C++17](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0006r0.html) +- [P3247R2: Deprecate the notion of trivial types](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3247r2.html) + - C++26で非推奨化 From 5b1731b3d538da63b849cd4eb7ba50c4ed940042 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Sat, 11 Jan 2025 14:19:54 +0900 Subject: [PATCH 1382/3948] =?UTF-8?q?chore(workflows/check):=20=E5=90=84?= =?UTF-8?q?=E7=A8=AE=20CI=20check=20=E3=81=AE=E7=B5=B1=E5=90=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/cpprefjp/site/issues/1273#issuecomment-2562832911 --- .github/workflows/check.yml | 62 +++++++++++++++++++ .github/workflows/code_qualify_check.yml | 19 ------ .github/workflows/defined_word_check.yml | 19 ------ .../workflows/detect_forbidden_characters.yml | 38 ------------ .github/workflows/display_error_check.yml | 19 ------ .github/workflows/inner_link_check.yml | 19 ------ .github/workflows/meta_header_check.yml | 19 ------ .github/workflows/ngword_check.yml | 19 ------ 8 files changed, 62 insertions(+), 152 deletions(-) create mode 100644 .github/workflows/check.yml delete mode 100644 .github/workflows/code_qualify_check.yml delete mode 100644 .github/workflows/defined_word_check.yml delete mode 100644 .github/workflows/detect_forbidden_characters.yml delete mode 100644 .github/workflows/display_error_check.yml delete mode 100644 .github/workflows/inner_link_check.yml delete mode 100644 .github/workflows/meta_header_check.yml delete mode 100644 .github/workflows/ngword_check.yml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000000..9b6b3c041e --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,62 @@ +name: check + +on: [push, pull_request, workflow_dispatch] + +jobs: + check: + runs-on: ubuntu-latest + strategy: + matrix: + item: + - {name: code_qualify} + - {name: defined_word} + - {name: display_error} + - {name: meta_header} + - {name: ngword} + - {name: inner_link, script: link_check.py --check-inner-link} + name: check (${{ matrix.item.name }}) + steps: + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install requests + - uses: actions/checkout@v4 + - name: check + run: python3 .github/workflows/script/${{ matrix.item.script || format('{0}_check.py', matrix.item.name) }} + + detect_forbidden_characters: + # 本リポジトリでは、以下に挙げる文字の使用を禁止している: + # U+00AD SOFT HYPHEN (ソフトハイフン) + # U+200B ZERO WIDTH SPACE (ゼロ幅スペース) + # + # 経緯は以下を参照: + # #735 SOFT HYPHENを削除する? + # https://github.com/cpprefjp/site/issues/735 + runs-on: ubuntu-latest + env: + RIPGREP_VERSION: 14.1.0 + BIN_DIR: ${{ github.workspace }}/bin + REPO_DIR: repo + cache-version: v1 + steps: + - id: cache-ripgrep + uses: actions/cache@v3 + with: + path: ${{ env.BIN_DIR }} + key: ${{ env.cache-version }}-ripgrep-${{ env.RIPGREP_VERSION }} + - name: install ripgrep + if: steps.cache-ripgrep.outputs.cache-hit != 'true' + run: | + curl -fsSLO https://github.com/BurntSushi/ripgrep/releases/download/$RIPGREP_VERSION/ripgrep-$RIPGREP_VERSION-x86_64-unknown-linux-musl.tar.gz + mkdir -p $BIN_DIR + tar xvf ripgrep-$RIPGREP_VERSION-x86_64-unknown-linux-musl.tar.gz --strip=1 --no-anchor -C $BIN_DIR rg + working-directory: ${{ runner.temp }} + - uses: actions/checkout@v4 + with: + path: ${{ env.REPO_DIR }} + - name: check + run: "! $BIN_DIR/rg -t md --vimgrep '[\u00ad\u200b]' $REPO_DIR" diff --git a/.github/workflows/code_qualify_check.yml b/.github/workflows/code_qualify_check.yml deleted file mode 100644 index 4260abe065..0000000000 --- a/.github/workflows/code_qualify_check.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: code qualify check - -on: [push, pull_request, workflow_dispatch] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install requests - - uses: actions/checkout@v4 - - name: check - run: python3 .github/workflows/script/code_qualify_check.py diff --git a/.github/workflows/defined_word_check.yml b/.github/workflows/defined_word_check.yml deleted file mode 100644 index 0ca06f2ddf..0000000000 --- a/.github/workflows/defined_word_check.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: defined word check - -on: [push, pull_request, workflow_dispatch] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install requests - - uses: actions/checkout@v4 - - name: check - run: python3 .github/workflows/script/defined_word_check.py diff --git a/.github/workflows/detect_forbidden_characters.yml b/.github/workflows/detect_forbidden_characters.yml deleted file mode 100644 index 3db4dd2eeb..0000000000 --- a/.github/workflows/detect_forbidden_characters.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: detect forbidden characters - -# 本リポジトリでは、以下に挙げる文字の使用を禁止している: -# U+00AD SOFT HYPHEN (ソフトハイフン) -# U+200B ZERO WIDTH SPACE (ゼロ幅スペース) -# -# 経緯は以下を参照: -# #735 SOFT HYPHENを削除する? -# https://github.com/cpprefjp/site/issues/735 - -on: [push, pull_request, workflow_dispatch] - -jobs: - build: - runs-on: ubuntu-latest - env: - RIPGREP_VERSION: 14.1.0 - BIN_DIR: ${{ github.workspace }}/bin - REPO_DIR: repo - cache-version: v1 - steps: - - id: cache-ripgrep - uses: actions/cache@v3 - with: - path: ${{ env.BIN_DIR }} - key: ${{ env.cache-version }}-ripgrep-${{ env.RIPGREP_VERSION }} - - name: install ripgrep - if: steps.cache-ripgrep.outputs.cache-hit != 'true' - run: | - curl -fsSLO https://github.com/BurntSushi/ripgrep/releases/download/$RIPGREP_VERSION/ripgrep-$RIPGREP_VERSION-x86_64-unknown-linux-musl.tar.gz - mkdir -p $BIN_DIR - tar xvf ripgrep-$RIPGREP_VERSION-x86_64-unknown-linux-musl.tar.gz --strip=1 --no-anchor -C $BIN_DIR rg - working-directory: ${{ runner.temp }} - - uses: actions/checkout@v4 - with: - path: ${{ env.REPO_DIR }} - - name: check - run: "! $BIN_DIR/rg -t md --vimgrep '[\u00ad\u200b]' $REPO_DIR" diff --git a/.github/workflows/display_error_check.yml b/.github/workflows/display_error_check.yml deleted file mode 100644 index 54768c9d50..0000000000 --- a/.github/workflows/display_error_check.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: display error check - -on: [push, pull_request, workflow_dispatch] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install requests - - uses: actions/checkout@v4 - - name: check - run: python3 .github/workflows/script/display_error_check.py diff --git a/.github/workflows/inner_link_check.yml b/.github/workflows/inner_link_check.yml deleted file mode 100644 index 84ae4e0aa0..0000000000 --- a/.github/workflows/inner_link_check.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: inner link check - -on: [push, pull_request, workflow_dispatch] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install requests - - uses: actions/checkout@v4 - - name: check - run: python3 .github/workflows/script/link_check.py --check-inner-link diff --git a/.github/workflows/meta_header_check.yml b/.github/workflows/meta_header_check.yml deleted file mode 100644 index 9da3e3f520..0000000000 --- a/.github/workflows/meta_header_check.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: meta header check - -on: [push, pull_request, workflow_dispatch] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install requests - - uses: actions/checkout@v4 - - name: check - run: python3 .github/workflows/script/meta_header_check.py diff --git a/.github/workflows/ngword_check.yml b/.github/workflows/ngword_check.yml deleted file mode 100644 index 03a71c6cb3..0000000000 --- a/.github/workflows/ngword_check.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: ngword check - -on: [push, pull_request, workflow_dispatch] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install requests - - uses: actions/checkout@v4 - - name: check - run: python3 .github/workflows/script/ngword_check.py From dca7653047ec0227c60b1f69d741081237749ca5 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Sat, 11 Jan 2025 20:32:01 +0900 Subject: [PATCH 1383/3948] =?UTF-8?q?chore(workflows/preview=5Fbuild):=20P?= =?UTF-8?q?R=20=E3=81=AE=E6=9B=B4=E6=96=B0=E6=AF=8E=E3=81=AB=20gh-pages=20?= =?UTF-8?q?/gen/pull/<=E7=95=AA=E5=8F=B7>/=20=E3=81=AB=E3=83=97=E3=83=AC?= =?UTF-8?q?=E3=83=93=E3=83=A5=E3=83=BC=E3=82=92=E3=82=A2=E3=83=83=E3=83=97?= =?UTF-8?q?=E3=83=AD=E3=83=BC=E3=83=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/cpprefjp/site/issues/1273#issuecomment-2582070591 PR 内容の変換結果を https://cpprefjp.github.io/site/gen/pull/<番号> か ら閲覧することができるようにする。 --- .github/workflows/build.yml | 81 +++++++++++++++++++++++++------ .github/workflows/check.yml | 22 ++++++++- .github/workflows/script/build.sh | 40 ++++++++++----- 3 files changed, 115 insertions(+), 28 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2d412292c9..64bc100348 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,6 +2,13 @@ name: build on: workflow_dispatch: + workflow_call: + inputs: + arguments: + description: "build.sh に渡すコマンドライン引数" + default: '' + required: false + type: string push: branches: - master @@ -14,13 +21,11 @@ jobs: build: runs-on: ubuntu-latest steps: - - name: Register SSH key - env: - CPPREFJP_GITHUB_IO_SECRETS: ${{ secrets.CPPREFJP_GITHUB_IO_SECRETS }} + - id: vars run: | - mkdir -p $HOME/.ssh - echo "$CPPREFJP_GITHUB_IO_SECRETS" > $HOME/.ssh/id_ed25519 - chmod 600 $HOME/.ssh/id_ed25519 + echo "base_repo=${{ startsWith(inputs.arguments, '--pull ') && github.event.pull_request.base.repo.full_name || github.event.repository.full_name }}" >> "$GITHUB_OUTPUT" + echo "head_repo=${{ startsWith(inputs.arguments, '--pull ') && github.event.pull_request.head.repo.full_name || github.event.repository.full_name }}" >> "$GITHUB_OUTPUT" + echo "head_ref=${{ startsWith(inputs.arguments, '--pull ') && github.event.pull_request.head.ref || github.ref }}" >> "$GITHUB_OUTPUT" # site_generator - uses: actions/checkout@v4 @@ -38,19 +43,14 @@ jobs: - run: git submodule update -i working-directory: site_generator/kunai - # cpprefjp.github.io - - uses: actions/checkout@v4 - with: - repository: cpprefjp/cpprefjp.github.io - path: site_generator/cpprefjp/cpprefjp.github.io - # site - uses: actions/checkout@v4 with: - repository: cpprefjp/site - path: site_generator/cpprefjp/site + repository: ${{ steps.vars.outputs.head_repo }} # atom 生成のために全履歴が必要 fetch-depth: 0 + ref: ${{ steps.vars.outputs.head_ref }} + path: site_generator/cpprefjp/site - run: git submodule update -i working-directory: site_generator/cpprefjp/site @@ -66,10 +66,61 @@ jobs: python-version: 3.11 # 3.12でUndefined symbolエラーがでた + # build.sh - base の build.sh を使う必要がある。もし PR head の + # build.sh を使うと、pull_request_target で呼び出された時に PR + # head の build.sh に悪意のあるコードが埋め込まれていると秘密鍵な + # ど盗まれてしまう。 + - name: Check out build.sh + uses: actions/checkout@v4 + with: + repository: ${{ steps.vars.outputs.base_repo }} + ref: master + sparse-checkout: .github + path: .trusted + + # Deploy 用 + - name: "(Deploy) Register SSH key" + if: inputs.arguments == '' + env: + CPPREFJP_GITHUB_IO_SECRETS: ${{ secrets.CPPREFJP_GITHUB_IO_SECRETS }} + run: | + mkdir -p $HOME/.ssh + echo "$CPPREFJP_GITHUB_IO_SECRETS" > $HOME/.ssh/id_ed25519 + chmod 600 $HOME/.ssh/id_ed25519 + + # Deploy 用 + - name: "(Deploy) Check out cpprefjp.github.io" + if: inputs.arguments == '' + uses: actions/checkout@v4 + with: + repository: cpprefjp/cpprefjp.github.io + path: site_generator/cpprefjp/cpprefjp.github.io + + # Preview 用 + - name: "(Preview build) Check out gh-pages" + if: startsWith(inputs.arguments, '--pull ') + continue-on-error: true + uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.base.repo.full_name }} + ref: gh-pages + path: site_generator/cpprefjp/gh-pages + # あとはスクリプトで頑張る - - run: ./cpprefjp/site/.github/workflows/script/build.sh + - name: Run script build.sh + run: ../.trusted/.github/workflows/script/build.sh ${{ inputs.arguments }} working-directory: site_generator + # Preview 用 + - name: "(Preview build) Publish result in gh-pages" + if: startsWith(inputs.arguments, '--pull ') + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./site_generator/cpprefjp/gh-pages + commit_message: | + Preview PR ${{ github.event.number }}: ${{ github.event.pull_request.head.sha }} <= + concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 9b6b3c041e..e3c6b6172d 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -1,6 +1,6 @@ name: check -on: [push, pull_request, workflow_dispatch] +on: [push, pull_request_target, workflow_dispatch] jobs: check: @@ -25,8 +25,17 @@ jobs: python -m pip install --upgrade pip pip install requests - uses: actions/checkout@v4 + with: + repository: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name || github.event.repository.full_name }} + ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.ref || github.ref }} + - uses: actions/checkout@v4 + with: + repository: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.base.repo.full_name || github.event.repository.full_name }} + ref: ${{ github.event_name == 'pull_request_target' && 'master' || github.ref }} + sparse-checkout: .github + path: .trusted - name: check - run: python3 .github/workflows/script/${{ matrix.item.script || format('{0}_check.py', matrix.item.name) }} + run: python3 .trusted/.github/workflows/script/${{ matrix.item.script || format('{0}_check.py', matrix.item.name) }} detect_forbidden_characters: # 本リポジトリでは、以下に挙げる文字の使用を禁止している: @@ -60,3 +69,12 @@ jobs: path: ${{ env.REPO_DIR }} - name: check run: "! $BIN_DIR/rg -t md --vimgrep '[\u00ad\u200b]' $REPO_DIR" + + preview_build: + if: github.event_name == 'pull_request_target' + needs: [check, detect_forbidden_characters] + uses: ./.github/workflows/build.yml + with: + arguments: --pull ${{ github.event.number }} + concurrency: + group: cpprefjp.gh-pages.lock diff --git a/.github/workflows/script/build.sh b/.github/workflows/script/build.sh index 519efd5723..a092f7da98 100755 --- a/.github/workflows/script/build.sh +++ b/.github/workflows/script/build.sh @@ -33,14 +33,32 @@ popd pip3 install -r docker/requirements.txt python3 run.py settings.cpprefjp --concurrency=`nproc` -# 生成されたサイトの中身を push -pushd cpprefjp/cpprefjp.github.io - # push するために ssh のリモートを追加する - git remote add origin2 git@github.com:cpprefjp/cpprefjp.github.io.git - - git add ./ --all - git config --global user.email "shigemasa7watanabe+cpprefjp@gmail.com" - git config --global user.name "cpprefjp-autoupdate" - git commit -a -m "update automatically" - git push origin2 master -popd +if (($# == 0)); then + # 生成されたサイトの中身を push + pushd cpprefjp/cpprefjp.github.io + # push するために ssh のリモートを追加する + git remote add origin2 git@github.com:cpprefjp/cpprefjp.github.io.git + + git add ./ --all + git config --global user.email "shigemasa7watanabe+cpprefjp@gmail.com" + git config --global user.name "cpprefjp-autoupdate" + git commit -a -m "update automatically" + git push origin2 master + popd + +elif [[ $1 == --pull ]]; then + if [[ ! $2 ]]; then + printf '%s\n' "build.sh: プルリクエスト番号が指定されていません" >&2 + exit 2 + fi + + target_directory=cpprefjp/gh-pages/gen/pull/$2 + rm -rf "$target_directory" + mkdir -p "$target_directory" + cp -r cpprefjp/cpprefjp.github.io/* "$target_directory"/ + +else + printf '%s\n' "build.sh: コマンドライン引数が認識できません: $1" >&2 + exit 2 + +fi From cb5159b2a39e6b5581779dcebd1bd7034c2d90aa Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Sat, 11 Jan 2025 21:10:06 +0900 Subject: [PATCH 1384/3948] =?UTF-8?q?chore(workflows/preview=5Flink):=20PR?= =?UTF-8?q?=20=E3=81=AB=E3=83=97=E3=83=AC=E3=83=93=E3=83=A5=E3=83=BC?= =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=82=92=E3=82=B3=E3=83=A1=E3=83=B3?= =?UTF-8?q?=E3=83=88=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 2 +- .github/workflows/check.yml | 74 +++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 64bc100348..8c184ab2e2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -119,7 +119,7 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./site_generator/cpprefjp/gh-pages commit_message: | - Preview PR ${{ github.event.number }}: ${{ github.event.pull_request.head.sha }} <= + Preview PR ${{ github.event.number }}: ${{ github.event.pull_request.head.sha }} ← concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index e3c6b6172d..ff7f96ea6f 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -78,3 +78,77 @@ jobs: arguments: --pull ${{ github.event.number }} concurrency: group: cpprefjp.gh-pages.lock + + preview_link: + needs: preview_build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - id: vars + uses: actions/github-script@v7 + with: + script: | + const sha0 = context.payload.pull_request.base.sha; + const sha = context.payload.pull_request.head.sha; + const base_url = (() => { + const owner = context.payload.pull_request.head.repo.owner.login; + const repo = context.payload.pull_request.head.repo.name; + const pull = context.payload.number; + return `https://${owner}.github.io/${repo}/gen/pull/${pull}`; + })(); + const repo_full = context.payload.pull_request.head.repo.full_name; + const branch = context.payload.pull_request.head.ref; + + // https://qiita.com/akko_merry/items/dda3c6b7ae01ac143a8b#comment-e0ecb4abe4d3d6d76054 + const now = new Date(); + now.setMinutes(now.getMinutes() + 9 * 60); // JST is +0900 + const time = now.toJSON()?.replace('T', ' ').slice(0, 19) + ' JST'; + + core.setOutput('sha0', sha0); + core.setOutput('sha', sha); + core.setOutput('base_url', base_url); + core.setOutput('repo_full', repo_full); + core.setOutput('ubranch', encodeURIComponent(branch)); + core.setOutput('time', time); + + - id: file_list + shell: bash + run: | + content=$( + git diff --name-status --diff-filter=dr ${{ steps.vars.outputs.sha0 }} ${{ steps.vars.outputs.sha }} | + sed -n ' + # normalize the line format + s/^[[:space:]]*\([^[:space:]]\{1,\}\)[[:space:]]\{1,\}/\1 / + + # exclude filenames containing special characters that may break Markdown + /[][`()]/d + + # exclude README.md + /^[^[:space:]]* README\.md$/d + + # generate list items + s|^A \(.*\)\.md$|- :memo: [`\1`](${{ steps.vars.outputs.base_url }}/\1.html) :sparkles:|p + s|^[^[:space:]]* \(.*\)\.md$|- :memo: [`\1`](${{ steps.vars.outputs.base_url }}/\1.html)|p + ' + ) + [[ $content ]] || content='- (内容変更された `.md` ファイルはありません)' + echo 'content<> "$GITHUB_OUTPUT" + echo "$content" >> "$GITHUB_OUTPUT" + echo 'EOF' >> "$GITHUB_OUTPUT" + - uses: thollander/actions-comment-pull-request@v3 + with: + message: | + :zap: [**プレビュー (HTML)**](${{ steps.vars.outputs.base_url }}) (更新時刻: ${{ steps.vars.outputs.time }}) + + - **⫯** Commit: ${{ steps.vars.outputs.sha }} + - プレビューの生成には時間がかかります (3~5分)。進捗状況は[こちら](https://github.com/${{ steps.vars.outputs.repo_full }}/actions?query=event%3Apull_request_target+branch%3A${{ steps.vars.outputs.ubranch }})をご確認ください。 + + #### 変更記事一覧 + + ${{ steps.file_list.outputs.content }} + + ※ソース (.md) に直接変更のあった記事を列挙しています。グローバル修飾や変換規則の変更による変化は考慮していません。 + comment-tag: cpprefjp-preview_link + github-token: ${{ secrets.GITHUB_TOKEN }} From 6fcc5a2fad69c6edfc1c7165c51ea589d02552fc Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Sat, 11 Jan 2025 19:48:46 +0900 Subject: [PATCH 1385/3948] =?UTF-8?q?chore(workflows/{build,outer=5Flink?= =?UTF-8?q?=5Fcheck}):=20Fork=20=E3=83=AA=E3=83=9D=E3=82=B8=E3=83=88?= =?UTF-8?q?=E3=83=AA=E3=81=A7=E3=81=AF=E5=AE=9A=E6=9C=9F=E5=AE=9F=E8=A1=8C?= =?UTF-8?q?=E3=81=97=E3=81=AA=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 1 + .github/workflows/outer_link_check.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8c184ab2e2..1f3e6b3560 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,6 +19,7 @@ on: jobs: build: + if: github.repository_owner == 'cpprefjp' || startsWith(inputs.arguments, '--pull ') runs-on: ubuntu-latest steps: - id: vars diff --git a/.github/workflows/outer_link_check.yml b/.github/workflows/outer_link_check.yml index 309b0152bd..2ae2262183 100644 --- a/.github/workflows/outer_link_check.yml +++ b/.github/workflows/outer_link_check.yml @@ -9,6 +9,7 @@ on: jobs: build: + if: github.repository_owner == 'cpprefjp' runs-on: ubuntu-latest steps: - name: Set up Python From da059d7594ea038bef6acb51abdc9bdbc1fecec3 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Sat, 11 Jan 2025 19:53:23 +0900 Subject: [PATCH 1386/3948] =?UTF-8?q?chore(workflows/build):=20=E5=8C=BA?= =?UTF-8?q?=E5=88=A5=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= =?UTF-8?q?=E5=90=84=20checkout=20step=20=E3=81=AB=E5=90=8D=E5=89=8D?= =?UTF-8?q?=E3=82=92=E3=81=A4=E3=81=91=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1f3e6b3560..200b80a328 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,7 +29,8 @@ jobs: echo "head_ref=${{ startsWith(inputs.arguments, '--pull ') && github.event.pull_request.head.ref || github.ref }}" >> "$GITHUB_OUTPUT" # site_generator - - uses: actions/checkout@v4 + - name: Check out cpprefjp/site_generator + uses: actions/checkout@v4 with: repository: cpprefjp/site_generator path: site_generator @@ -37,15 +38,17 @@ jobs: working-directory: site_generator # kunai - - uses: actions/checkout@v4 + - name: Check out cpprefjp/kunai + uses: actions/checkout@v4 with: repository: cpprefjp/kunai path: site_generator/kunai - run: git submodule update -i working-directory: site_generator/kunai - # site - - uses: actions/checkout@v4 + # site (typically cpprefjp/site) + - name: Check out ${{ steps.vars.outputs.head_repo }} + uses: actions/checkout@v4 with: repository: ${{ steps.vars.outputs.head_repo }} # atom 生成のために全履歴が必要 @@ -55,8 +58,9 @@ jobs: - run: git submodule update -i working-directory: site_generator/cpprefjp/site - # site - - uses: actions/checkout@v2 + # image + - name: Check out cpprefjp/image + uses: actions/checkout@v2 with: repository: cpprefjp/image path: site_generator/cpprefjp/image From 82dd7b36f791a9cb0a6025fe91c7b0427e7061a3 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Sat, 11 Jan 2025 20:23:00 +0900 Subject: [PATCH 1387/3948] =?UTF-8?q?chore(workflows/build):=20image=20?= =?UTF-8?q?=E3=81=AE=20actions/checkout=20=E3=81=AE=E3=83=90=E3=83=BC?= =?UTF-8?q?=E3=82=B8=E3=83=A7=E3=83=B3=E3=82=92=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 200b80a328..d8e03761e0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,7 +60,7 @@ jobs: # image - name: Check out cpprefjp/image - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: cpprefjp/image path: site_generator/cpprefjp/image From 534d2e59c8143b8ea6545c427991d01c62c09957 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 13 Jan 2025 18:34:16 +0900 Subject: [PATCH 1388/3948] =?UTF-8?q?chore(workflows/preview=5Fclear):=20?= =?UTF-8?q?=E5=8F=A4=E3=81=84=E3=83=97=E3=83=AC=E3=83=93=E3=83=A5=E3=83=BC?= =?UTF-8?q?=E3=82=92=E5=89=8A=E9=99=A4=E3=81=99=E3=82=8B=E3=83=AF=E3=83=BC?= =?UTF-8?q?=E3=82=AF=E3=83=95=E3=83=AD=E3=83=BC=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gh-pages に対して filter-branch を実行して force push します。 --- .github/workflows/build.yml | 4 +++ .github/workflows/preview_clear.yml | 39 +++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 .github/workflows/preview_clear.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d8e03761e0..5dd575bd05 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -123,6 +123,10 @@ jobs: with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./site_generator/cpprefjp/gh-pages + + # Note: 以下のコミットメッセージは .github/workflows/preview_clear.yml + # で削除対象のコミットの特定に用いるので、変更する場合は preview_clear + # も一緒に更新すること。 commit_message: | Preview PR ${{ github.event.number }}: ${{ github.event.pull_request.head.sha }} ← diff --git a/.github/workflows/preview_clear.yml b/.github/workflows/preview_clear.yml new file mode 100644 index 0000000000..2272532ade --- /dev/null +++ b/.github/workflows/preview_clear.yml @@ -0,0 +1,39 @@ +name: preview_clear + +on: workflow_dispatch + +jobs: + preview_clear: + concurrency: + group: cpprefjp.gh-pages.lock + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: gh-pages + fetch-depth: 0 + - name: filter-branch gh-pages + env: + GH_TOKEN: ${{ github.token }} + run: | + set -ex + + # Note: 以下の 999 という数は適当な大きな数。もし open PR の数が 999 + # を超えるようならば、この数はもっと大きくする必要がある。 + PREVIEW_CLEAR_PR_LIST=$(gh pr list --limit=999 --json number -q '.[].number' | tr '\n' ' ') + PREVIEW_CLEAR_PR_LIST=${PREVIEW_CLEAR_PR_LIST% } + export PREVIEW_CLEAR_PR_LIST + + git config --global user.name 'github-actions[bot]' + git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' + git filter-branch --commit-filter ' + pr=$(git log -n 1 --pretty=format:%s "$GIT_COMMIT" | sed -n '\''s/^Preview PR \([0-9]\{1,\}\).*/\1/p'\'') + case " $PREVIEW_CLEAR_PR_LIST | " in + (*" $pr "*) + git commit-tree "$@" ;; + (*) + skip_commit "$@" ;; + esac + ' HEAD + + git push -f origin gh-pages From 81806fca9c9eabc389b72555040f105ebf810dd2 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Sun, 12 Jan 2025 03:50:43 +0900 Subject: [PATCH 1389/3948] =?UTF-8?q?README,start=5Fediting:=20=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 +----- start_editing.md | 6 ++++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index b9534c0fcf..e9ac5309dd 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,7 @@ site ==== -[![detect forbidden characters](https://github.com/cpprefjp/site/workflows/detect%20forbidden%20characters/badge.svg)](https://github.com/cpprefjp/site/actions/workflows/detect_forbidden_characters.yml) -[![inner link check](https://github.com/cpprefjp/site/workflows/inner%20link%20check/badge.svg)](https://github.com/cpprefjp/site/actions/workflows/inner_link_check.yml) -[![code qualify check](https://github.com/cpprefjp/site/workflows/code%20qualify%20check/badge.svg)](https://github.com/cpprefjp/site/actions/workflows/code_qualify_check.yml) -[![ngword check](https://github.com/cpprefjp/site/workflows/ngword%20check/badge.svg)](https://github.com/cpprefjp/site/actions/workflows/ngword_check.yml) -[![meta header check](https://github.com/cpprefjp/site/workflows/meta%20header%20check/badge.svg)](https://github.com/cpprefjp/site/actions/workflows/meta_header_check.yml) +[![check](https://github.com/cpprefjp/site/workflows/check/badge.svg)](https://github.com/cpprefjp/site/actions/workflows/check.yml) [![outer link check](https://github.com/cpprefjp/site/workflows/outer%20link%20check/badge.svg)](https://github.com/cpprefjp/site/actions/workflows/outer_link_check.yml) [![build](https://github.com/cpprefjp/site/workflows/build/badge.svg)](https://github.com/cpprefjp/site/actions/workflows/build.yml) diff --git a/start_editing.md b/start_editing.md index f531cda398..4d74e62b02 100644 --- a/start_editing.md +++ b/start_editing.md @@ -27,6 +27,8 @@ cpprefjp/site へ push すると、すぐに反映されます。 ### 自動デプロイ、自動テスト 本リポジトリでは、GitHub Actionsを使用して、自動デプロイと自動テストを行っています。 +Pull Request 時にも自動テストと自動プレビュー生成を行います。 + #### 自動デプロイ buildアクションで、MarkdownからHTMLへの変換と、GitHub Pagesへのデプロイを行っています。 @@ -40,7 +42,7 @@ buildアクションで、MarkdownからHTMLへの変換と、GitHub Pagesへの - 説明は[detect_forbidden_characters.yml](https://github.com/cpprefjp/site/blob/master/.github/workflows/detect_forbidden_characters.yml)のコメントを参照 - 内部リンクの誤り検出 (inner link checkアクション) - サイト内のリンクが存在しない、または存在しているのに.nolinkを指定している場合にエラーが発生する - - [GitHub Actionsの実行ログ](https://github.com/cpprefjp/site/actions/workflows/inner_link_check.yml)で、どのページのどのリンクが不正かがわかるので、それを修正すること + - [GitHub Actionsの実行ログ](https://github.com/cpprefjp/site/actions/workflows/check.yml)で、どのページのどのリンクが不正かがわかるので、それを修正すること - 外部リンク切れを検出 (outer link checkアクション) - 日本時間で日曜日の23:30に実行される - 外部リンクのページにアクセスできない (ページが消滅したか、一時的にアクセスできない、などの理由) 場合にエラーとなる @@ -50,7 +52,7 @@ buildアクションで、MarkdownからHTMLへの変換と、GitHub Pagesへの - 海外からのアクセス (GitHub Actions) を拒否しているページもあるため、そのようなページは個別にチェックから外す ([link_check.py](https://github.com/cpprefjp/site/blob/master/.github/workflows/script/link_check.py)の`IGNORE_LIST`に追加する) - コード修飾の誤り検出 (code qualify checkアクション) - コードブロック中のコードを修飾しているのに、その修飾対象がない場合に、エラーが発生する - - [GitHub Actionsの実行ログ](https://github.com/cpprefjp/site/actions/workflows/code_qualify_check.yml)で、どのページのどのコード修飾が不正かがわかるので、それを修正すること + - [GitHub Actionsの実行ログ](https://github.com/cpprefjp/site/actions/workflows/check.yml)で、どのページのどのコード修飾が不正かがわかるので、それを修正すること - 所属ヘッダメタ情報の誤り検出 (meta header checkアクション) - `[meta header]`または`[meta module]`指定が誤っている(ディレクトリ階層と一致しない)場合に、エラーが発生する - 導入経緯は [PR#1204](https://github.com/cpprefjp/site/issues/1204) を参照 From 437ae62eed4cf5385c5140c7dc4ede37e8f48f1d Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 13 Jan 2025 20:40:04 +0900 Subject: [PATCH 1390/3948] =?UTF-8?q?chore(workflows/preview=5Flink):=20?= =?UTF-8?q?=E5=B7=AE=E5=88=86=E3=82=92=E5=8F=96=E3=82=8B=E3=81=9F=E3=82=81?= =?UTF-8?q?=E3=81=AB=E4=B8=A1=E3=83=AA=E3=83=9D=E3=82=B8=E3=83=88=E3=83=AA?= =?UTF-8?q?=E3=82=92=20fetch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/check.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index ff7f96ea6f..f3fce305af 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -85,7 +85,10 @@ jobs: steps: - uses: actions/checkout@v4 with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.event.pull_request.head.ref }} fetch-depth: 0 + - id: vars uses: actions/github-script@v7 with: @@ -116,6 +119,10 @@ jobs: - id: file_list shell: bash run: | + set -ex + + git remote add base '${{ github.event.pull_request.base.repo.clone_url }}' + git fetch base '${{ github.event.pull_request.head.ref }}' content=$( git diff --name-status --diff-filter=dr ${{ steps.vars.outputs.sha0 }} ${{ steps.vars.outputs.sha }} | sed -n ' From baeb128b7db69d22ad42cfc52a26be6369486cb7 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 13 Jan 2025 20:50:03 +0900 Subject: [PATCH 1391/3948] =?UTF-8?q?chore(workflows/preview=5Flink):=20?= =?UTF-8?q?=E3=82=B1=E3=82=A2=E3=83=AC=E3=82=B9=E3=83=9F=E3=82=B9=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index f3fce305af..4bc63a84cf 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -122,7 +122,7 @@ jobs: set -ex git remote add base '${{ github.event.pull_request.base.repo.clone_url }}' - git fetch base '${{ github.event.pull_request.head.ref }}' + git fetch base '${{ github.event.pull_request.base.ref }}' content=$( git diff --name-status --diff-filter=dr ${{ steps.vars.outputs.sha0 }} ${{ steps.vars.outputs.sha }} | sed -n ' From 7aba20a498da3e741ae7c11548bd9bdaf05993fb Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 13 Jan 2025 21:01:30 +0900 Subject: [PATCH 1392/3948] =?UTF-8?q?chore(workflows/preview=5Flink):=20UR?= =?UTF-8?q?L=E3=83=9F=E3=82=B9=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 4bc63a84cf..699eb43fc6 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -96,8 +96,8 @@ jobs: const sha0 = context.payload.pull_request.base.sha; const sha = context.payload.pull_request.head.sha; const base_url = (() => { - const owner = context.payload.pull_request.head.repo.owner.login; - const repo = context.payload.pull_request.head.repo.name; + const owner = context.payload.pull_request.base.repo.owner.login; + const repo = context.payload.pull_request.base.repo.name; const pull = context.payload.number; return `https://${owner}.github.io/${repo}/gen/pull/${pull}`; })(); From 401c70d534665748abbc4fcfcd12b8ad3a90a921 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 13 Jan 2025 21:04:01 +0900 Subject: [PATCH 1393/3948] =?UTF-8?q?chore(workflows/preview=5Fbuild):=20G?= =?UTF-8?q?itHub=20Pages=20=E3=83=87=E3=83=97=E3=83=AD=E3=82=A4=E3=82=92?= =?UTF-8?q?=E6=9C=89=E5=8A=B9=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5dd575bd05..0903141bd3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -130,6 +130,8 @@ jobs: commit_message: | Preview PR ${{ github.event.number }}: ${{ github.event.pull_request.head.sha }} ← + enable_jekyll: true + concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true From 181e0339a2b0489ea884443fde76da9f9138736e Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 13 Jan 2025 22:20:21 +0900 Subject: [PATCH 1394/3948] =?UTF-8?q?chore(workflows/preview=5Flink):=20UR?= =?UTF-8?q?L=E3=83=9F=E3=82=B9=E4=BF=AE=E6=AD=A3=E3=81=AE=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E5=BF=98=E3=82=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 699eb43fc6..7f77520fc3 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -101,7 +101,7 @@ jobs: const pull = context.payload.number; return `https://${owner}.github.io/${repo}/gen/pull/${pull}`; })(); - const repo_full = context.payload.pull_request.head.repo.full_name; + const repo_full = context.payload.pull_request.base.repo.full_name; const branch = context.payload.pull_request.head.ref; // https://qiita.com/akko_merry/items/dda3c6b7ae01ac143a8b#comment-e0ecb4abe4d3d6d76054 From d960d161be544c202cede47c795757d0133daf25 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Fri, 8 Nov 2024 00:59:52 +0900 Subject: [PATCH 1395/3948] =?UTF-8?q?GLOBAL=5FDEFINED=5FWORDS:=20=E3=82=88?= =?UTF-8?q?=E3=82=8A=E3=82=82=E5=89=8D=E3=81=AB=E7=99=BA=E7=94=9F=E3=81=99?= =?UTF-8?q?=E3=82=8B=20(happens=20before)=20/=20=E3=81=A8=E5=90=8C?= =?UTF-8?q?=E6=9C=9F=E3=81=99=E3=82=8B=20(synchronizes=20with)=20=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_DEFINED_WORDS.json | 12 ++++++++++++ reference/atomic/memory_order.md | 6 +++--- reference/barrier/barrier.md | 2 +- reference/syncstream/basic_syncbuf/emit.md | 4 ++-- reference/thread/jthread/join.md | 4 ++-- reference/thread/jthread/op_constructor.md | 4 ++-- reference/thread/thread/join.md | 4 ++-- reference/thread/thread/op_constructor.md | 2 +- 8 files changed, 25 insertions(+), 13 deletions(-) diff --git a/GLOBAL_DEFINED_WORDS.json b/GLOBAL_DEFINED_WORDS.json index 4add216e18..46194a3679 100644 --- a/GLOBAL_DEFINED_WORDS.json +++ b/GLOBAL_DEFINED_WORDS.json @@ -180,5 +180,17 @@ "ヌル終端": { "yomi": "ぬるしゅうたん", "desc": "null-terminated。文字列においてヌル文字 '\\0' を用いてその終端を表すこと。ヌル文字自体は文字列に含まない。広義には線形データ構造においてヌルまたは値 0 を番兵としてその終わりを示すこと" + }, + "と同期する": { + "yomi": "とどうきする", + "desc": "synchronizes with。「A は B と同期する」という記述は「A が B よりも前に発生する」関係を保証する" + }, + "よりも前に発生する": { + "yomi": "よりもまえにはっせいする", + "desc": "happens before。(異なるスレッド間の) 2つの操作の実行順序を規定する関係" + }, + "よりも確実に前に発生する": { + "yomi": "よりもかくじつにまえにはっせいする", + "desc": "strongly happens before。(異なるスレッド間の) 2つの操作の実行順序を規定する強い関係" } } diff --git a/reference/atomic/memory_order.md b/reference/atomic/memory_order.md index 9657dfa026..3d9b32f907 100644 --- a/reference/atomic/memory_order.md +++ b/reference/atomic/memory_order.md @@ -27,7 +27,7 @@ namespace std { ## 概要 コンパイラに許可されている最適化の一つに、「プログラムの意味を変えない限りにおいて、メモリアクセスの順番を変えたり、省略したりしてもよい」というものがある。また、マルチコアCPUにおいては、あるCPUコアによるメモリアクセスの順序が他のコアからも同じように見えるとは限らない。このような挙動はマルチスレッドプログラミングにおいて問題になることがある。 -この問題への対処として、C++11では各スレッドの実行に順序付けをするための"happens before"(先行発生)という関係を定義し、それによってあるスレッドでの操作が他スレッドから可視になるか否かを定めている。 +この問題への対処として、C++11では各スレッドの実行に順序付けをするための「よりも前に発生する」という関係を定義し、それによってあるスレッドでの操作が他スレッドから可視になるか否かを定めている。 atomic変数においては、"release"操作によって書き込まれた値を"acquire"操作によって別のスレッドが読み出した場合に、そのrelease操作とacquire操作の間に順序付けが行われる。以下に例を挙げる。 ```cpp example @@ -65,8 +65,8 @@ int main() 3 ``` -[`atomic`](atomic.md)型の変数`ready`への読み書きに注目すると、`main()`では変数`ready`に `true` を"release"操作として書き込み、`f()`では"acquire"操作としての読み込みを `true` が返されるまで繰り返している。よって、`f()`の`while`ループを抜けた時点で、`main()`の`ready.store()`と`f()`の`ready.load()`の間に順序付け(happens before関係)が成立している。 -ここでさらに変数`data`への読み書き(1), (2)に注目すると、(1)は`ready.store()`より前、(2)は`ready.load()`より後にあるので、以下のようなスレッド間の順序付け(happens before関係)が成立することになる。 +[`atomic`](atomic.md)型の変数`ready`への読み書きに注目すると、`main()`では変数`ready`に `true` を"release"操作として書き込み、`f()`では"acquire"操作としての読み込みを `true` が返されるまで繰り返している。よって、`f()`の`while`ループを抜けた時点で、`main()`の`ready.store()`と`f()`の`ready.load()`の間に順序付け(「よりも前に発生する」関係)が成立している。 +ここでさらに変数`data`への読み書き(1), (2)に注目すると、(1)は`ready.store()`より前、(2)は`ready.load()`より後にあるので、以下のようなスレッド間の順序付け(「よりも前に発生する」関係)が成立することになる。 (1) → `ready.store()` → `ready.load()` → (2) よって、(1)における書き込みが(2)の時点で可視であることが保証される。 このようにしてC++のマルチスレッドプログラムにおける実行順序および可視性を理解することができる。 diff --git a/reference/barrier/barrier.md b/reference/barrier/barrier.md index 9440878df2..82302258b6 100644 --- a/reference/barrier/barrier.md +++ b/reference/barrier/barrier.md @@ -43,7 +43,7 @@ namespace std { - 完了関数を呼び出す。`completion()`と等価。 - フェーズ同期ポイント上でブロックされている全スレッドのブロックを解除する。 -完了ステップの終了は、完了ステップによりブロック解除される全ての関数呼び出しからの復帰よりも、確実に前に発生(strongly happens before)する。 +完了ステップの終了は、完了ステップによりブロック解除される全ての関数呼び出しからの復帰**よりも確実に前に発生する**。 テンプレートパラメータ`CompletionFunction`のデフォルト値以外の特殊化においては、完了ステップの進行中にバリアオブジェクトの[`wait()`](barrier/wait.md)を除くメンバ関数が呼び出されると、その動作は未定義となる。 テンプレートパラメータ`CompletionFunction`のデフォルト値は、追加で Cpp17DefaultConstructible 要件を満たす未規定の型であり、式`completion()`は何の副作用も生じない。 diff --git a/reference/syncstream/basic_syncbuf/emit.md b/reference/syncstream/basic_syncbuf/emit.md index 9e828bd675..574786fffb 100644 --- a/reference/syncstream/basic_syncbuf/emit.md +++ b/reference/syncstream/basic_syncbuf/emit.md @@ -32,9 +32,9 @@ bool emit(); ## 同期操作 -同じストリームバッファオブジェクトに文字を転送するすべての`emit()`呼び出しは、「happens before」関係と一致する全順序で実行されるように見える。各`emit()`呼び出しは、その全順序で後続の`emit()`呼び出しと同期する。実際には、これは下記の備考にあることを意味する。 +同じストリームバッファオブジェクトに文字を転送するすべての`emit()`呼び出しは、「よりも前に発生する」関係と一致する全順序で実行されるように見える。各`emit()`呼び出しは、その全順序で後続の`emit()`呼び出し**と同期する**。実際には、これは下記の備考にあることを意味する。 -注:ここでは、happens before 関係は全順序関係になっていると考えられる。また、modification order と矛盾しないとも考えられる。下記の参照を参照のこと。 +注:ここでは、「よりも前に発生する」関係は全順序関係になっていると考えられる。また、modification order と矛盾しないとも考えられる。下記の参照を参照のこと。 ## 備考 ラップされたストリームに一意に関連付けられたロックを保持しながら、ラップされたストリームのメンバ関数を呼び出すことができる。つまり、同じストリームを持つ他の`basic_syncbuf`オブジェクトに対してアトミックに転送することができる。 diff --git a/reference/thread/jthread/join.md b/reference/thread/jthread/join.md index 5602712251..f49b4c7e91 100644 --- a/reference/thread/jthread/join.md +++ b/reference/thread/jthread/join.md @@ -22,10 +22,10 @@ void join(); ## 同期操作 -関連付けられたスレッドの完了は、`join()`メンバ関数の正常リターンと **同期する** 。 +関連付けられたスレッドの完了は、`join()`メンバ関数の正常リターン**と同期する** 。 つまり、「`this`に関連付けられたスレッドT1上で行われる全処理の完了」は、 -「`join()`メンバ関数を呼び出したスレッドT0上での同メンバ関数からの正常リターン」よりも **前に発生する** 。 +「`join()`メンバ関数を呼び出したスレッドT0上での同メンバ関数からの正常リターン」**よりも前に発生する** 。 ## 事後条件 diff --git a/reference/thread/jthread/op_constructor.md b/reference/thread/jthread/op_constructor.md index 1c7dc5aff0..7bdfb603e0 100644 --- a/reference/thread/jthread/op_constructor.md +++ b/reference/thread/jthread/op_constructor.md @@ -63,13 +63,13 @@ jthread(jthread&&) noexcept; // (4) C++20 ## 同期操作 -- (2) : コンストラクタ呼び出しの完了は、`f`のコピーの呼び出し開始と同期する +- (2) : コンストラクタ呼び出しの完了は、`f`のコピーの呼び出し開始**と同期する** 新しいスレッドを生成し、[`INVOKE`](/reference/concepts/Invoke.md)`(DECAY_COPY(`[`std::forward`](/reference/utility/forward.md)`(f)), DECAY_COPY(`[`std::forward`](/reference/utility/forward.md)`(args))...)`を実行する。ただし`DECAY_COPY`は同コンストラクタを呼び出したスレッド上にて評価される。また`f`のコピーの戻り値は無視される。 - `DECAY_COPY(x)`は `template typename std::decay::type decay_copy(T&& v) { return` [`std::forward`](/reference/utility/forward.md)`(v); }` と定義される。おおよそ、`x`が配列型なら先頭要素へのポインタ、`x`が関数型ならその関数ポインタ、`x`がコピーコンストラクト可能な型なら`x`からコピーされたオブジェクト、`x`がムーブコンストラクト可能な型なら`x`からムーブされたオブジェクトとなる。 ## 同期操作 -- (2) : 同コンストラクタの呼び出し完了は、fのコピーの呼び出し開始と**同期する**。つまり、「コンストラクタ呼び出し側スレッドT0でのコンストラクタ呼び出し完了」は、「新しいスレッド`T1`上での`f`のコピーの呼び出し開始」よりも**前に発生する**。 +- (2) : 同コンストラクタの呼び出し完了は、fのコピーの呼び出し開始**と同期する**。つまり、「コンストラクタ呼び出し側スレッドT0でのコンストラクタ呼び出し完了」は、「新しいスレッド`T1`上での`f`のコピーの呼び出し開始」**よりも前に発生する**。 ## 事後条件 diff --git a/reference/thread/thread/join.md b/reference/thread/thread/join.md index 9f8497d18a..db9f496bc3 100644 --- a/reference/thread/thread/join.md +++ b/reference/thread/thread/join.md @@ -22,10 +22,10 @@ void join(); ## 同期操作 -関連付けられたスレッドの完了は、`join()`メンバ関数の正常リターンと **同期する** 。 +関連付けられたスレッドの完了は、`join()`メンバ関数の正常リターン**と同期する** 。 つまり、「`this`に関連付けられたスレッドT1上で行われる全処理の完了」は、 -「`join()`メンバ関数を呼び出したスレッドT0上での同メンバ関数からの正常リターン」よりも **前に発生する** 。 +「`join()`メンバ関数を呼び出したスレッドT0上での同メンバ関数からの正常リターン」**よりも前に発生する** 。 ## 事後条件 diff --git a/reference/thread/thread/op_constructor.md b/reference/thread/thread/op_constructor.md index 56b8645108..49758380c0 100644 --- a/reference/thread/thread/op_constructor.md +++ b/reference/thread/thread/op_constructor.md @@ -36,7 +36,7 @@ thread(thread&&) noexcept; // (4) ## 同期操作 -- (2) : 同コンストラクタの呼び出し完了は、fのコピーの呼び出し開始と**同期する**。つまり、「コンストラクタ呼び出し側スレッドT0でのコンストラクタ呼び出し完了」は、「新しいスレッド`T1`上での`f`のコピーの呼び出し開始」よりも**前に発生する**。 +- (2) : 同コンストラクタの呼び出し完了は、fのコピーの呼び出し開始**と同期する**。つまり、「コンストラクタ呼び出し側スレッドT0でのコンストラクタ呼び出し完了」は、「新しいスレッド`T1`上での`f`のコピーの呼び出し開始」**よりも前に発生する**。 ## 事後条件 From 116fbe8198e03fed1ca994759011854e119f304b Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Fri, 8 Nov 2024 21:31:43 +0900 Subject: [PATCH 1396/3948] =?UTF-8?q?thread/this=5Fthread:=20=E3=80=8C?= =?UTF-8?q?=E3=81=A8=E5=90=8C=E6=9C=9F=E3=81=97=E3=81=AA=E3=81=84=E3=80=8D?= =?UTF-8?q?=E3=82=92=E5=AE=9A=E7=BE=A9=E8=AA=9E=E3=81=AB=E4=B8=80=E8=87=B4?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E6=9B=B8=E6=8F=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/thread/this_thread/sleep_for.md | 2 +- reference/thread/this_thread/sleep_until.md | 2 +- reference/thread/this_thread/yield.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/thread/this_thread/sleep_for.md b/reference/thread/this_thread/sleep_for.md index b6df0ab1fc..467143e5be 100644 --- a/reference/thread/this_thread/sleep_for.md +++ b/reference/thread/this_thread/sleep_for.md @@ -24,7 +24,7 @@ namespace this_thread { ## 同期操作 -特に他操作と同期しない。 +特に他操作と同期する規定はない。 ## 例外 diff --git a/reference/thread/this_thread/sleep_until.md b/reference/thread/this_thread/sleep_until.md index a68bba0722..ed6c398427 100644 --- a/reference/thread/this_thread/sleep_until.md +++ b/reference/thread/this_thread/sleep_until.md @@ -27,7 +27,7 @@ namespace this_thread { ## 同期操作 -特に他操作と同期しない。 +特に他操作と同期する規定はない。 ## 例外 diff --git a/reference/thread/this_thread/yield.md b/reference/thread/this_thread/yield.md index 76c7e836b2..84df7bbbd1 100644 --- a/reference/thread/this_thread/yield.md +++ b/reference/thread/this_thread/yield.md @@ -20,7 +20,7 @@ namespace this_thread { ## 同期操作 -特に他操作と同期しない。 +特に他操作と同期する規定はない。 ## 例外 From b609e21faa487c33a8ccc918e8d1213d877e83ae Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 18 Nov 2024 14:36:09 +0900 Subject: [PATCH 1397/3948] =?UTF-8?q?GLOBAL=5FDEFINED=5FWORDS:=20=E8=A1=A8?= =?UTF-8?q?=E7=8F=BE=E3=82=92=E5=A4=89=E6=9B=B4=20"{=E3=81=A8=20=3D>=20?= =?UTF-8?q?=E3=81=AB=E5=AF=BE=E3=81=97=E3=81=A6}=E5=90=8C=E6=9C=9F?= =?UTF-8?q?=E3=81=99=E3=82=8B"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_DEFINED_WORDS.json | 6 +++--- reference/syncstream/basic_syncbuf/emit.md | 2 +- reference/thread/jthread/join.md | 2 +- reference/thread/jthread/op_constructor.md | 4 ++-- reference/thread/this_thread/sleep_for.md | 2 +- reference/thread/this_thread/sleep_until.md | 2 +- reference/thread/this_thread/yield.md | 2 +- reference/thread/thread/join.md | 2 +- reference/thread/thread/op_constructor.md | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/GLOBAL_DEFINED_WORDS.json b/GLOBAL_DEFINED_WORDS.json index 46194a3679..35068574c3 100644 --- a/GLOBAL_DEFINED_WORDS.json +++ b/GLOBAL_DEFINED_WORDS.json @@ -181,9 +181,9 @@ "yomi": "ぬるしゅうたん", "desc": "null-terminated。文字列においてヌル文字 '\\0' を用いてその終端を表すこと。ヌル文字自体は文字列に含まない。広義には線形データ構造においてヌルまたは値 0 を番兵としてその終わりを示すこと" }, - "と同期する": { - "yomi": "とどうきする", - "desc": "synchronizes with。「A は B と同期する」という記述は「A が B よりも前に発生する」関係を保証する" + "に対して同期する": { + "yomi": "にたいしてどうきする", + "desc": "synchronizes with。「A は B に対して同期する」という記述は「A が B よりも前に発生する」関係を保証する" }, "よりも前に発生する": { "yomi": "よりもまえにはっせいする", diff --git a/reference/syncstream/basic_syncbuf/emit.md b/reference/syncstream/basic_syncbuf/emit.md index 574786fffb..0c8ddb62de 100644 --- a/reference/syncstream/basic_syncbuf/emit.md +++ b/reference/syncstream/basic_syncbuf/emit.md @@ -32,7 +32,7 @@ bool emit(); ## 同期操作 -同じストリームバッファオブジェクトに文字を転送するすべての`emit()`呼び出しは、「よりも前に発生する」関係と一致する全順序で実行されるように見える。各`emit()`呼び出しは、その全順序で後続の`emit()`呼び出し**と同期する**。実際には、これは下記の備考にあることを意味する。 +同じストリームバッファオブジェクトに文字を転送するすべての`emit()`呼び出しは、「よりも前に発生する」関係と一致する全順序で実行されるように見える。各`emit()`呼び出しは、その全順序で後続の`emit()`呼び出し**に対して同期する**。実際には、これは下記の備考にあることを意味する。 注:ここでは、「よりも前に発生する」関係は全順序関係になっていると考えられる。また、modification order と矛盾しないとも考えられる。下記の参照を参照のこと。 diff --git a/reference/thread/jthread/join.md b/reference/thread/jthread/join.md index f49b4c7e91..7ee8ae32eb 100644 --- a/reference/thread/jthread/join.md +++ b/reference/thread/jthread/join.md @@ -22,7 +22,7 @@ void join(); ## 同期操作 -関連付けられたスレッドの完了は、`join()`メンバ関数の正常リターン**と同期する** 。 +関連付けられたスレッドの完了は、`join()`メンバ関数の正常リターン**に対して同期する** 。 つまり、「`this`に関連付けられたスレッドT1上で行われる全処理の完了」は、 「`join()`メンバ関数を呼び出したスレッドT0上での同メンバ関数からの正常リターン」**よりも前に発生する** 。 diff --git a/reference/thread/jthread/op_constructor.md b/reference/thread/jthread/op_constructor.md index 7bdfb603e0..0ec9fa89f0 100644 --- a/reference/thread/jthread/op_constructor.md +++ b/reference/thread/jthread/op_constructor.md @@ -63,13 +63,13 @@ jthread(jthread&&) noexcept; // (4) C++20 ## 同期操作 -- (2) : コンストラクタ呼び出しの完了は、`f`のコピーの呼び出し開始**と同期する** +- (2) : コンストラクタ呼び出しの完了は、`f`のコピーの呼び出し開始**に対して同期する** 新しいスレッドを生成し、[`INVOKE`](/reference/concepts/Invoke.md)`(DECAY_COPY(`[`std::forward`](/reference/utility/forward.md)`(f)), DECAY_COPY(`[`std::forward`](/reference/utility/forward.md)`(args))...)`を実行する。ただし`DECAY_COPY`は同コンストラクタを呼び出したスレッド上にて評価される。また`f`のコピーの戻り値は無視される。 - `DECAY_COPY(x)`は `template typename std::decay::type decay_copy(T&& v) { return` [`std::forward`](/reference/utility/forward.md)`(v); }` と定義される。おおよそ、`x`が配列型なら先頭要素へのポインタ、`x`が関数型ならその関数ポインタ、`x`がコピーコンストラクト可能な型なら`x`からコピーされたオブジェクト、`x`がムーブコンストラクト可能な型なら`x`からムーブされたオブジェクトとなる。 ## 同期操作 -- (2) : 同コンストラクタの呼び出し完了は、fのコピーの呼び出し開始**と同期する**。つまり、「コンストラクタ呼び出し側スレッドT0でのコンストラクタ呼び出し完了」は、「新しいスレッド`T1`上での`f`のコピーの呼び出し開始」**よりも前に発生する**。 +- (2) : 同コンストラクタの呼び出し完了は、fのコピーの呼び出し開始**に対して同期する**。つまり、「コンストラクタ呼び出し側スレッドT0でのコンストラクタ呼び出し完了」は、「新しいスレッド`T1`上での`f`のコピーの呼び出し開始」**よりも前に発生する**。 ## 事後条件 diff --git a/reference/thread/this_thread/sleep_for.md b/reference/thread/this_thread/sleep_for.md index 467143e5be..0177d5b20c 100644 --- a/reference/thread/this_thread/sleep_for.md +++ b/reference/thread/this_thread/sleep_for.md @@ -24,7 +24,7 @@ namespace this_thread { ## 同期操作 -特に他操作と同期する規定はない。 +特に他操作に対して同期する規定はない。 ## 例外 diff --git a/reference/thread/this_thread/sleep_until.md b/reference/thread/this_thread/sleep_until.md index ed6c398427..7a0dde9856 100644 --- a/reference/thread/this_thread/sleep_until.md +++ b/reference/thread/this_thread/sleep_until.md @@ -27,7 +27,7 @@ namespace this_thread { ## 同期操作 -特に他操作と同期する規定はない。 +特に他操作に対して同期する規定はない。 ## 例外 diff --git a/reference/thread/this_thread/yield.md b/reference/thread/this_thread/yield.md index 84df7bbbd1..edc07ef7f6 100644 --- a/reference/thread/this_thread/yield.md +++ b/reference/thread/this_thread/yield.md @@ -20,7 +20,7 @@ namespace this_thread { ## 同期操作 -特に他操作と同期する規定はない。 +特に他操作に対して同期する規定はない。 ## 例外 diff --git a/reference/thread/thread/join.md b/reference/thread/thread/join.md index db9f496bc3..51a42ba067 100644 --- a/reference/thread/thread/join.md +++ b/reference/thread/thread/join.md @@ -22,7 +22,7 @@ void join(); ## 同期操作 -関連付けられたスレッドの完了は、`join()`メンバ関数の正常リターン**と同期する** 。 +関連付けられたスレッドの完了は、`join()`メンバ関数の正常リターン**に対して同期する** 。 つまり、「`this`に関連付けられたスレッドT1上で行われる全処理の完了」は、 「`join()`メンバ関数を呼び出したスレッドT0上での同メンバ関数からの正常リターン」**よりも前に発生する** 。 diff --git a/reference/thread/thread/op_constructor.md b/reference/thread/thread/op_constructor.md index 49758380c0..5caff43ef7 100644 --- a/reference/thread/thread/op_constructor.md +++ b/reference/thread/thread/op_constructor.md @@ -36,7 +36,7 @@ thread(thread&&) noexcept; // (4) ## 同期操作 -- (2) : 同コンストラクタの呼び出し完了は、fのコピーの呼び出し開始**と同期する**。つまり、「コンストラクタ呼び出し側スレッドT0でのコンストラクタ呼び出し完了」は、「新しいスレッド`T1`上での`f`のコピーの呼び出し開始」**よりも前に発生する**。 +- (2) : 同コンストラクタの呼び出し完了は、fのコピーの呼び出し開始**に対して同期する**。つまり、「コンストラクタ呼び出し側スレッドT0でのコンストラクタ呼び出し完了」は、「新しいスレッド`T1`上での`f`のコピーの呼び出し開始」**よりも前に発生する**。 ## 事後条件 From 176b16e22b4115087dbbf9ea5337a11e0f5610bb Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 18 Nov 2024 14:37:41 +0900 Subject: [PATCH 1398/3948] =?UTF-8?q?working=5Fstyle:=20=E5=90=8C=E6=9C=9F?= =?UTF-8?q?=E3=83=BB=E8=A9=95=E4=BE=A1=E9=A0=86=E5=BA=8F=E3=81=AB=E9=96=A2?= =?UTF-8?q?=E9=80=A3=E3=81=99=E3=82=8B=E8=A8=B3=E8=AA=9E=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- working_style.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/working_style.md b/working_style.md index 980f180209..0c28b90af8 100644 --- a/working_style.md +++ b/working_style.md @@ -152,3 +152,8 @@ C++11以降対応については対応バージョンを明記します。バー | weak ordering | 弱順序 | | well-formed | 適格 | | eligible | 資格のある | +| synchronizes with | に対して同期する ("と同期する" だと対称関係に見えるため) | +| happens before | よりも前に発生する | +| strongly happens before | よりも確実に前に発生する | +| sequenced before | よりも前に順序付けられる | +| indeterminately sequenced | 不定順で順序付けられる | From f8a10e31eb0096ecaa6b4304b24a5e5ceb96f8b6 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Tue, 14 Jan 2025 18:39:45 +0900 Subject: [PATCH 1399/3948] =?UTF-8?q?chore(preview=5Fclear):=20=E5=85=A8?= =?UTF-8?q?=E3=81=A6=E3=81=AE=E3=83=97=E3=83=AC=E3=83=93=E3=83=A5=E3=83=BC?= =?UTF-8?q?=E3=81=8C=E3=81=AA=E3=81=8F=E3=81=AA=E3=82=8B=E6=99=82=20gh-pag?= =?UTF-8?q?es=20=E3=83=96=E3=83=A9=E3=83=B3=E3=83=81=E3=82=92=E5=89=8A?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/preview_clear.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/preview_clear.yml b/.github/workflows/preview_clear.yml index 2272532ade..612a023ab9 100644 --- a/.github/workflows/preview_clear.yml +++ b/.github/workflows/preview_clear.yml @@ -36,4 +36,10 @@ jobs: esac ' HEAD - git push -f origin gh-pages + commit_count=$(git rev-list HEAD --count || true) + if [ -z "$commit_count" ] || [ "$commit_count" = 0 ]; then + # When no commits are left, we remove the branch + git push -f origin :gh-pages + else + git push -f origin gh-pages + fi From a64d2ec1f180ef1bf55b32276f94f70ba80dbf84 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Tue, 14 Jan 2025 18:43:07 +0900 Subject: [PATCH 1400/3948] =?UTF-8?q?chore(preview=5Fbuild):=20"Author:=20?= =?UTF-8?q?github-actions[bot]"=20=E3=81=A7=20gh-pages=20=E3=81=AB?= =?UTF-8?q?=E3=82=B3=E3=83=9F=E3=83=83=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 既定では peaceiris/actions-gh-pages は Action のトリガーになったユーザー を用いてコミットを作成して gh-pages に push する。しかしこれだと PR の 中で試行錯誤をした分だけユーザーの GitHub Contributions のカウントが増 えてしまって不本意なことになる。ユーザー "github-actions[bot]" で gh-pages にコミットするべし。 --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0903141bd3..bea9eb6190 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -123,6 +123,8 @@ jobs: with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./site_generator/cpprefjp/gh-pages + user_name: 'github-actions[bot]' + user_email: '41898282+github-actions[bot]@users.noreply.github.com' # Note: 以下のコミットメッセージは .github/workflows/preview_clear.yml # で削除対象のコミットの特定に用いるので、変更する場合は preview_clear From 034c3678c310c91e851cea8a9383cf32af87ef4d Mon Sep 17 00:00:00 2001 From: Yuhki Ogasawara Date: Wed, 15 Jan 2025 11:36:20 +0900 Subject: [PATCH 1401/3948] =?UTF-8?q?Visual=20Studio=202022=20Version=2017?= =?UTF-8?q?.12.4=20=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation.md | 1 + 1 file changed, 1 insertion(+) diff --git a/implementation.md b/implementation.md index 21b9b217bc..2069fbf591 100644 --- a/implementation.md +++ b/implementation.md @@ -141,6 +141,7 @@ | 表記 | 製品名 [Visual Studio バージョン] †1 | VC++ バージョン †2 | `_MSC_VER` | `_MSC_FULL_VER` | |---------------|----------------------------------------|-----------------|------------|-----------------| +| 2022 Update 12 | Visual Studio 2022 Version 17.12.4 | 14.42 | 1942 | 194234436 | | 2022 Update 12 | Visual Studio 2022 version 17.12.3 | 14.42 | 1942 | 194234435 | | 2022 Update 11 | Visual Studio 2022 version 17.11.0 | 14.41 | 1941 | 194134120 | | 2022 Update 10 | Visual Studio 2022 version 17.10.5 | 14.40 | 1939 | 194033811 | From deadc77b3f69ffa39f584eab776139d729bdfa0c Mon Sep 17 00:00:00 2001 From: Mugen2411 Date: Sat, 18 Jan 2025 17:11:39 +0900 Subject: [PATCH 1402/3948] =?UTF-8?q?typo:=20constrexpr=E2=86=92constexpr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/vector/vector/insert.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/vector/vector/insert.md b/reference/vector/vector/insert.md index 5440514e54..7fffa97d11 100644 --- a/reference/vector/vector/insert.md +++ b/reference/vector/vector/insert.md @@ -7,7 +7,7 @@ ```cpp iterator insert(iterator position, const T& x); // (1) C++03 iterator insert(const_iterator position, const T& x); // (1) C++11 -consrexpr iterator insert(const_iterator position, const T& x); // (1) C++20 +constexpr iterator insert(const_iterator position, const T& x); // (1) C++20 iterator insert(const_iterator position, T&& x); // (2) C++11 constexpr iterator insert(const_iterator position, T&& x); // (2) C++20 From a4a704d69dd914e6180a1d43fd27bee0f80f37a8 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Sat, 18 Jan 2025 21:57:43 +0900 Subject: [PATCH 1403/3948] =?UTF-8?q?:=20=E3=83=8F=E3=83=9F?= =?UTF-8?q?=E3=83=AB=E3=83=88=E3=83=8B=E3=82=A2=E3=83=B3=20->=20=E3=82=A8?= =?UTF-8?q?=E3=83=AB=E3=83=9F=E3=83=BC=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/linalg.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/reference/linalg.md b/reference/linalg.md index e2e2e3bbfe..ddcbb013fd 100644 --- a/reference/linalg.md +++ b/reference/linalg.md @@ -83,15 +83,15 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に |------|------|----------------| | [`matrix_vector_product`](linalg/matrix_vector_product.md) | xGEMV: 一般行列とベクトルの積を求める (function template) | C++26 | | [`symmetric_matrix_vector_product`](linalg/symmetric_matrix_vector_product.md) | xSYMV: 対称行列とベクトルの積を求める (function template) | C++26 | -| [`hermitian_matrix_vector_product`](linalg/hermitian_matrix_vector_product.md) | xHEMV: ハミルトニアン行列とベクトルの積を求める (function template) | C++26 | +| [`hermitian_matrix_vector_product`](linalg/hermitian_matrix_vector_product.md) | xHEMV: エルミート行列とベクトルの積を求める (function template) | C++26 | | [`triangular_matrix_vector_product`](linalg/triangular_matrix_vector_product.md) | xTRMV: 三角行列とベクトルの積を求める (function template) | C++26 | | [`triangular_matrix_vector_solve`](linalg/triangular_matrix_vector_solve.md) | xTRSV: 三角行列を係数とする行列方程式を解く (function template) | C++26 | | [`matrix_rank_1_update`](linalg/matrix_rank_1_update.md) | xGER, xGERU: 行列のRank-1更新 (function template) | C++26 | | [`matrix_rank_1_update_c`](linalg/matrix_rank_1_update_c.md) | xGERC: 複素行列のRank-1更新 (function template) | C++26 | | [`symmetric_matrix_rank_1_update`](linalg/symmetric_matrix_rank_1_update.md) | xSYR: 対称行列のRank-1更新 (function template) | C++26 | -| [`hermitian_matrix_rank_1_update`](linalg/hermitian_matrix_rank_1_update.md) | xHER: ハミルトニアン行列のRank-1更新 (function template) | C++26 | +| [`hermitian_matrix_rank_1_update`](linalg/hermitian_matrix_rank_1_update.md) | xHER: エルミート行列のRank-1更新 (function template) | C++26 | | [`symmetric_matrix_rank_2_update`](linalg/symmetric_matrix_rank_2_update.md) | xSYR2: 対称行列のRank-2更新 (function template) | C++26 | -| [`hermitian_matrix_rank_2_update`](linalg/hermitian_matrix_rank_2_update.md) | xHER2: ハミルトニアン行列のRank-2更新 (function template) | C++26 | +| [`hermitian_matrix_rank_2_update`](linalg/hermitian_matrix_rank_2_update.md) | xHER2: エルミート行列のRank-2更新 (function template) | C++26 | ## BLAS 3アルゴリズム @@ -100,14 +100,14 @@ BLAS 1, 2, 3のアルゴリズムでテンプレートパラメータが特に |------|------|----------------| | [`matrix_product`](linalg/matrix_product.md) | xGEMM: 2つの一般行列の積を求める (function template) | C++26 | | [`symmetric_matrix_product`](linalg/symmetric_matrix_product.md) | xSYMM: 対称行列と行列の積を求める (function template) | C++26 | -| [`hermitian_matrix_product`](linalg/hermitian_matrix_product.md) | xHEMM: ハミルトニアン行列と行列の積を求める (function template) | C++26 | +| [`hermitian_matrix_product`](linalg/hermitian_matrix_product.md) | xHEMM: エルミート行列と行列の積を求める (function template) | C++26 | | [`triangular_matrix_product`](linalg/triangular_matrix_product.md) | xTRMM: 三角行列と行列の積を求める (function template) | C++26 | | [`triangular_matrix_left_product`](linalg/triangular_matrix_left_product.md) | xTRMM: In-placeに三角行列と行列の積を求める (function template) | C++26 | | [`triangular_matrix_right_product`](linalg/triangular_matrix_right_product.md) | xTRMM: In-placeに三角行列と行列の積を求める (function template) | C++26 | | [`symmetric_matrix_rank_k_update`](linalg/symmetric_matrix_rank_k_update.md) | xSYRK: 対称行列のRank-k更新 (function template) | C++26 | -| [`hermitian_matrix_rank_k_update`](linalg/hermitian_matrix_rank_k_update.md) | xHERK: ハミルトニアン行列のRank-k更新 (function template) | C++26 | +| [`hermitian_matrix_rank_k_update`](linalg/hermitian_matrix_rank_k_update.md) | xHERK: エルミート行列のRank-k更新 (function template) | C++26 | | [`symmetric_matrix_rank_2k_update`](linalg/symmetric_matrix_rank_2k_update.md) | xSYR2K: 対称行列のRank-2k更新 (function template) | C++26 | -| [`hermitian_matrix_rank_2k_update`](linalg/hermitian_matrix_rank_2k_update.md) | xHER2K: ハミルトニアン行列のRank-2k更新 (function template) | C++26 | +| [`hermitian_matrix_rank_2k_update`](linalg/hermitian_matrix_rank_2k_update.md) | xHER2K: エルミート行列のRank-2k更新 (function template) | C++26 | | [`triangular_matrix_matrix_left_solve`](linalg/triangular_matrix_matrix_left_solve.md) | xTRSM: 三角行列の連立一次方程式を解く (function template) | C++26 | | [`triangular_matrix_matrix_right_solve`](linalg/triangular_matrix_matrix_right_solve.md) | xTRSM: 三角行列の連立一次方程式を解く (function template) | C++26 | From dc4de9cad82361ef787298cc2d415244b0fdc092 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Sun, 19 Jan 2025 20:43:50 +0900 Subject: [PATCH 1404/3948] =?UTF-8?q?chore(preview=5Fclear):=20filter-bran?= =?UTF-8?q?ch=20=E7=B5=82=E4=BA=86=E3=82=B9=E3=83=86=E3=83=BC=E3=82=BF?= =?UTF-8?q?=E3=82=B9=E3=81=AE=E5=AF=BE=E5=87=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git filter-branch --commit-filter の結果としてすべての commit が削除さ れた場合は、結果として期待通り orphan の状態になるが、fitler-branch の 終了ステータスは失敗になる。set -e を設定しているのでこれによって処理 が中断されてしまうので、失敗を無視することにする。 --- .github/workflows/preview_clear.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preview_clear.yml b/.github/workflows/preview_clear.yml index 612a023ab9..d0dfab2ef3 100644 --- a/.github/workflows/preview_clear.yml +++ b/.github/workflows/preview_clear.yml @@ -34,7 +34,7 @@ jobs: (*) skip_commit "$@" ;; esac - ' HEAD + ' HEAD || true commit_count=$(git rev-list HEAD --count || true) if [ -z "$commit_count" ] || [ "$commit_count" = 0 ]; then From abe921f8a45fd1cbe40bcfe0eab9c8120fbb082a Mon Sep 17 00:00:00 2001 From: suomesta Date: Sun, 19 Jan 2025 21:28:30 +0900 Subject: [PATCH 1405/3948] add cstring top page --- reference.md | 2 +- reference/cstring.md | 74 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 reference/cstring.md diff --git a/reference.md b/reference.md index 86d40cd973..1d4c25d60d 100644 --- a/reference.md +++ b/reference.md @@ -239,7 +239,7 @@ | [``](/reference/cstdint.md) | 大きさが規定されている整数型 | C++11 (C99) | | [``](/reference/cstdio.md) | 入出力 | | | [``](/reference/cstdlib.md) | ユーティリティ関数 | | -| `` | 文字列操作 | | +| [``](/reference/cstring.md) | 文字列操作 | | | `` | ジェネリックな数学関数 | C++11 (C99)
C++17で非推奨
C++20で削除 | | [``](/reference/ctime.md) | 日付・時間 | | | `` | ユニコード文字型 | C++11 (C11) | diff --git a/reference/cstring.md b/reference/cstring.md new file mode 100644 index 0000000000..c7facdb99d --- /dev/null +++ b/reference/cstring.md @@ -0,0 +1,74 @@ +# cstring +* cstring[meta header] + +``ヘッダでは、文字列操作関数を定義する。これらの機能は、`std`名前空間に属することを除いてC言語の標準ライブラリ``ヘッダと同じである。 + + +## 型 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`size_t`](/reference/cstddef/size_t.md) | 符号なし整数型 | | + + +## マクロ + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`NULL`](/reference/cstddef/null.md) | ヌルポインタ定数に展開されるマクロ | | + + +## コピー関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `memcpy` | メモリデータをコピーする | | +| `memmove` | メモリデータをコピーする(領域重複可) | | +| `strcpy` | 文字列をコピーする | | +| `strncpy` | 文字列をコピーする(上限サイズ指定) | | + + +## 結合関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `strcat` | 文字列を結合する | | +| `strncat` | 文字列を結合する(上限サイズ指定) | | + + +## 比較関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `memcmp` | メモリデータを比較する | | +| `strcmp` | 文字列を比較する | | +| `strcoll` | 文字列を比較する(ロケール依存) | | +| `strncmp` | 文字列を比較する(上限サイズ指定) | | +| `strxfrm` | ロケールに基づいて文字列を変換する | | + + +## 検索関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `memchr` | メモリデータを検索する | | +| `strchr` | 文字を検索する | | +| `strcspn` | 指定した文字現れるまでの長さを求める | | +| `strpbrk` | 指定した文字以外が現れる位置を求める | | +| `strrchr` | 文字を後ろから検索する | | +| `strspn` | 指定した文字以外が現れるまでの長さを求める | | +| `strstr` | 文字列を検索する | | +| `strtok` | 文字列をトークンに分割する | | + + +## その他の関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `memset` | メモリデータを指定した値で埋める | | +| `strerror` | エラーの内容を文字列で取得する | | +| `strlen` | 文字列の長さを取得する | | + + +## 参照 +- [P0175R1 Synopses for the C library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0175r1.html) From 63e8626784e6fb81a6862fcc628d8bcdac774cab Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 20 Jan 2025 12:53:08 +0900 Subject: [PATCH 1406/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E5=88=87?= =?UTF-8?q?=E3=82=8C=E3=82=92=E8=A7=A3=E6=B6=88=20#1403?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start_editing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/start_editing.md b/start_editing.md index 4d74e62b02..2e632953f3 100644 --- a/start_editing.md +++ b/start_editing.md @@ -39,7 +39,7 @@ buildアクションで、MarkdownからHTMLへの変換と、GitHub Pagesへの #### 自動テスト - 禁止文字の検出 (detect forbidden charactersアクション) - - 説明は[detect_forbidden_characters.yml](https://github.com/cpprefjp/site/blob/master/.github/workflows/detect_forbidden_characters.yml)のコメントを参照 + - ソフトハイフンやゼロ幅スペースなどの禁止された文字が使用されている場合に、エラーが発生する - 内部リンクの誤り検出 (inner link checkアクション) - サイト内のリンクが存在しない、または存在しているのに.nolinkを指定している場合にエラーが発生する - [GitHub Actionsの実行ログ](https://github.com/cpprefjp/site/actions/workflows/check.yml)で、どのページのどのリンクが不正かがわかるので、それを修正すること From edf7962b602ce9a349eb74f0881da4b10202c4ee Mon Sep 17 00:00:00 2001 From: suomesta Date: Mon, 20 Jan 2025 21:47:26 +0900 Subject: [PATCH 1407/3948] add extract() and replace() to flat_map (#1078) --- reference/flat_map/flat_map.md | 4 +- reference/flat_map/flat_map/containers.md | 15 ++-- reference/flat_map/flat_map/extract.md | 90 ++++++++++++++++++++++ reference/flat_map/flat_map/replace.md | 94 +++++++++++++++++++++++ 4 files changed, 196 insertions(+), 7 deletions(-) create mode 100644 reference/flat_map/flat_map/extract.md create mode 100644 reference/flat_map/flat_map/replace.md diff --git a/reference/flat_map/flat_map.md b/reference/flat_map/flat_map.md index c2887c226e..3ed7bc59b6 100644 --- a/reference/flat_map/flat_map.md +++ b/reference/flat_map/flat_map.md @@ -66,8 +66,8 @@ namespace std { | [`try_emplace`](flat_map/try_emplace.md) | キーが存在しない場合のみ要素を直接構築する | C++23 | | [`erase`](flat_map/erase.md) | 要素を削除する | C++23 | | [`swap`](flat_map/swap.md) | コンテンツを交換する | C++23 | -| [`extract`](flat_map/extract.md.nolink) | キーのコンテナ、値のコンテナを取得する | C++23 | -| [`replace`](flat_map/replace.md.nolink) | キーのコンテナ、値のコンテナを置き換える | C++23 | +| [`extract`](flat_map/extract.md) | キーのコンテナ、値のコンテナを取得する | C++23 | +| [`replace`](flat_map/replace.md) | キーのコンテナ、値のコンテナを置き換える | C++23 | ### 要素アクセス diff --git a/reference/flat_map/flat_map/containers.md b/reference/flat_map/flat_map/containers.md index 16e454e485..4f589ec16c 100644 --- a/reference/flat_map/flat_map/containers.md +++ b/reference/flat_map/flat_map/containers.md @@ -29,7 +29,7 @@ namespace std { ## 概要 `flat_map`クラス内部のデータ保持方法として、キーのコンテナと値のコンテナをもつ。 -この形式の内部表現は[`extract()`](extract.md.nolink)メンバ関数で取得でき、シリアライズなどの用途に使用できる。 +この形式の内部表現は [`extract()`](extract.md) メンバ関数で取得でき、シリアライズなどの用途に使用できる。 ## 例 @@ -38,6 +38,7 @@ namespace std { #include #include #include +#include int main() { @@ -47,21 +48,21 @@ int main() {"Carol", 4} }; - decltype(fm)::containers c = fm.extract(); + decltype(fm)::containers c = std::move(fm).extract(); - std::cout << "keys:" + std::cout << "keys:" << std::endl; for (const auto& key : c.keys) { std::cout << " " << key << std::endl; } - std::cout << "values:" + std::cout << "values:" << std::endl; for (const auto& value : c.values) { std::cout << " " << value << std::endl; } } ``` * containers[color ff0000] -* fm.extract()[link extract.md.nolink] +* fm.extract()[link extract.md] #### 出力 ``` @@ -84,3 +85,7 @@ values: - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`extract`](extract.md) diff --git a/reference/flat_map/flat_map/extract.md b/reference/flat_map/flat_map/extract.md new file mode 100644 index 0000000000..0aa1cbb9ee --- /dev/null +++ b/reference/flat_map/flat_map/extract.md @@ -0,0 +1,90 @@ +# extract +* flat_map[meta header] +* std[meta namespace] +* flat_map[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +containers extract() &&; // C++23 +``` + +## 概要 +キーのコンテナ、値のコンテナを戻り値として返す。 + + +## 戻り値 +クラス内部のデータ保持形式である [`containers`](containers.md) オブジェクト。 + + +## 事後条件 +呼び出し側の `flat_map` は空になる(たとえ例外で関数が中断されたとしても)。 + + +## 計算量 +定数時間。 + + +## 備考 +本関数は右辺値修飾されているので、右辺値からのみ読み出し可能である。 + + +## 例 +```cpp example +#include +#include +#include +#include + +int main() +{ + std::flat_map fm = { + {"Alice", 3}, + {"Bob", 1}, + {"Carol", 4} + }; + + std::cout << fm.size() << std::endl; + + decltype(fm)::containers c = std::move(fm).extract(); + + std::cout << fm.size() << std::endl; + std::cout << std::endl; + + auto k = c.keys.cbegin(); + auto v = c.values.cbegin(); + std::cout << "{" << std::endl; + for (; k != c.keys.cend() && v != c.values.cend(); ++k, ++v) { + std::cout << " " << *k << ": " << *v << "," << std::endl; + } + std::cout << "}" << std::endl; +} +``` +* extract()[color ff0000] +* fm.size()[link size.md] + +### 出力 +``` +3 +0 + +{ + Alice: 3, + Bob: 1, + Carol: 4, +} +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`containers`](containers.md) diff --git a/reference/flat_map/flat_map/replace.md b/reference/flat_map/flat_map/replace.md new file mode 100644 index 0000000000..07ff97fd70 --- /dev/null +++ b/reference/flat_map/flat_map/replace.md @@ -0,0 +1,94 @@ +# replace +* flat_map[meta header] +* std[meta namespace] +* flat_map[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +void replace(key_container_type&& key_cont, mapped_container_type&& mapped_cont); // C++23 +``` + +## 概要 +キーのコンテナ、値のコンテナをそれぞれ置き換える。 + + +## 効果 +`flat_map` クラスが内部で保持している [`containers`](containers.md) を `c` とすると、以下と等価。 + ```cpp + c.keys = std::move(key_cont); + c.values = std::move(mapped_cont) + ``` + + +## 事前条件 +- `key_cont.size() == mapped_cont.size()` が真であること。 +- `key_cont` が `key_compare` に基づいてソートされていること。 +- `key_cont` に重複する要素がないこと。 + + +## 計算量 +`key_cont` および `mapped_cont` をムーブした計算量と同じ。 + + +## 例 +```cpp example +#include +#include +#include +#include +#include +#include + +int main() +{ + std::vector keys = {"Alice", "Bob", "Carol"}; + std::vector values = {3, 1, 4}; + + // 事前条件の確認 + assert(keys.size() == values.size()); + assert(std::is_sorted(keys.begin(), keys.end())); + assert(std::adjacent_find(keys.begin(), keys.end()) == keys.end()); + + std::flat_map fm; + + std::cout << fm.size() << std::endl; + + fm.replace(std::move(keys), std::move(values)); + + std::cout << fm.size() << std::endl; + std::cout << std::endl; + + std::cout << "{" << std::endl; + for (const auto& kv: fm) { + std::cout << " " << kv.first << ": " << kv.second << "," << std::endl; + } + std::cout << "}" << std::endl; +} +``` +* replace[color ff0000] +* fm.size()[link size.md] +* std::is_sorted[link /reference/algorithm/is_sorted.md] +* std::adjacent_find[link /reference/algorithm/adjacent_find.md] + +### 出力 +``` +0 +3 + +{ + Alice: 3, + Bob: 1, + Carol: 4, +} +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? From 7e182d71dbd7818a1a0115d8744b0711ac77de69 Mon Sep 17 00:00:00 2001 From: 0xbadfca11 <0xbadfca11@gmail.com> Date: Mon, 20 Jan 2025 22:33:57 +0900 Subject: [PATCH 1408/3948] =?UTF-8?q?P2564R3=E3=81=AEMSVC=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/implementation-status.md b/implementation-status.md index 4c0476f3f4..67250d0739 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -265,7 +265,7 @@ | P2246R1: [静的な診断メッセージの文字エンコーディング](/lang/cpp23/character_encoding_of_diagnostic_text.md) | `static_assert`や`[[deprecated]]`などの診断メッセージの文字集合に関する要件をなくす | - | yes | 2022.2 | 2022 | | P2448R2: [`constexpr`関数が定数実行できない場合でも適格とする](/lang/cpp23/relaxing_some_constexpr_restrictions.md) | | 13 | 17 (partial) | 2024.0 (partial) | - | | P2647R1: [`constexpr`関数内での`static constexpr`変数を許可](/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md) | `constexpr`関数のローカルで定数を定義できるようにする | 13 | 16 | 2023.2 | - | -| P2564R3: [`constexpr`関数内で`consteval`関数を呼び出せない問題を緩和](/lang/cpp23/consteval_needs_to_propagate_up.md) | `consteval`呼び出しを含む`constexpr`関数を条件付きで`consteval`関数とみなすようにする | - | 17 | 2024.0 | 2024.0 | +| P2564R3: [`constexpr`関数内で`consteval`関数を呼び出せない問題を緩和](/lang/cpp23/consteval_needs_to_propagate_up.md) | `consteval`呼び出しを含む`constexpr`関数を条件付きで`consteval`関数とみなすようにする | - | 17 | 2024.0 | - | | P1102R2: [ラムダ式で`()`を省略できる条件を緩和](/lang/cpp23/down_with_lambda_parens.md) | 修飾や戻り値型をともなってもパラメータリストが空であれば`()`を省略できる | 11 | 13 | 2022.2 | - | | P2173R1: [ラムダ式に対する属性](/lang/cpp23/attributes_on_lambda_expressions.md) | ラムダ式のいくつかの箇所に属性を記述できるようにする | 9 | 13 | 2022.2 | - | | P1774R8: [コード内容の仮定をコンパイラに伝えるassume属性](/lang/cpp23/portable_assumptions.md) | 最適化のために、コードの仮定をコンパイラに伝える属性を標準化する | 13 | - | - | - | From 04d3ab4eca30af4253dc57ea6bfeda403e96711c Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Tue, 21 Jan 2025 10:05:13 +0900 Subject: [PATCH 1409/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE?= =?UTF-8?q?=E9=A3=BE=E3=81=AE=E4=BF=AE=E6=AD=A3=20(fixup=20edf7962b6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map/containers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/flat_map/flat_map/containers.md b/reference/flat_map/flat_map/containers.md index 4f589ec16c..c5c2d09958 100644 --- a/reference/flat_map/flat_map/containers.md +++ b/reference/flat_map/flat_map/containers.md @@ -62,7 +62,7 @@ int main() } ``` * containers[color ff0000] -* fm.extract()[link extract.md] +* extract()[link extract.md] #### 出力 ``` From b394b14811a52179cdf0cfbd26948978170ab73e Mon Sep 17 00:00:00 2001 From: 0xbadfca11 <0xbadfca11@gmail.com> Date: Tue, 21 Jan 2025 11:42:00 +0900 Subject: [PATCH 1410/3948] =?UTF-8?q?P2223R2=E3=81=AE=E8=A7=A3=E8=AA=AC?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3=20(#1405)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23/trimming_whitespaces_before_line_splicing.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/cpp23/trimming_whitespaces_before_line_splicing.md b/lang/cpp23/trimming_whitespaces_before_line_splicing.md index 5f97c4768a..7aaba26e66 100644 --- a/lang/cpp23/trimming_whitespaces_before_line_splicing.md +++ b/lang/cpp23/trimming_whitespaces_before_line_splicing.md @@ -34,7 +34,7 @@ int main() { } ``` -このコードにおいて「`// \`」のあとにはスペースがあり、EDG (ICCのフロントエンド)、GCC、Clangは行末スペースをトリミング (削除) して関数`f()`は`43`を返すが、MSVCはトリミングせず`1`を返していた。プラットフォーム間の動作差異をなくすために、実装は行末スペースをトリミングしなければならないよう提案することとした。 +このコードにおいて「`// \`」のあとにはスペースがあり、EDG (ICCのフロントエンド)、GCC、Clangは行末スペースをトリミング (削除) して関数`f()`は`1`を返すが、MSVCはトリミングせず`43`を返していた。プラットフォーム間の動作差異をなくすために、実装は行末スペースをトリミングしなければならないよう提案することとした。 例として、IDEやツール (コードフォーマッタ) はそのような行末スペースを削除する可能性があり、Googleのコーディングスタイルでは行末スペースを禁止している。 @@ -66,4 +66,4 @@ int main() { ## 参照 -- [P2223R2 Trimming whitespaces before line splicing](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2223r2.pdf) \ No newline at end of file +- [P2223R2 Trimming whitespaces before line splicing](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2223r2.pdf) From 70e3b76331044f7b7dd830c26b6d3ddd860c1057 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Tue, 21 Jan 2025 11:30:16 +0900 Subject: [PATCH 1411/3948] =?UTF-8?q?chore(preview=5Fclear):=20gh-pages=20?= =?UTF-8?q?=E3=81=AB=E3=83=80=E3=83=9F=E3=83=BC=E3=81=AE=E3=82=B3=E3=83=9F?= =?UTF-8?q?=E3=83=83=E3=83=88=E3=82=92=E6=AE=8B=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/cpprefjp/site/pull/1401#issuecomment-2603455279 gh-pages からコミットがなくなると GitHub Pages の設定が消滅してしまう ようなので、代わりにダミーの空コミット "preview_clear" を残すことにす る。このダミーのコミットは次の preview_clear 実行時に必要であれば作り 直す。 * 追加変更: git config でユーザー・Eメールアドレスを設定する時に "--global" は指定しないことにする。ローカルのリポジトリで指定すれば 十分のため。 * 追加変更: ロジックを分かりやすいように整理 & コメントで説明。 --- .github/workflows/preview_clear.yml | 48 +++++++++++++++++++---------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/.github/workflows/preview_clear.yml b/.github/workflows/preview_clear.yml index d0dfab2ef3..392ef93d84 100644 --- a/.github/workflows/preview_clear.yml +++ b/.github/workflows/preview_clear.yml @@ -20,26 +20,42 @@ jobs: # Note: 以下の 999 という数は適当な大きな数。もし open PR の数が 999 # を超えるようならば、この数はもっと大きくする必要がある。 - PREVIEW_CLEAR_PR_LIST=$(gh pr list --limit=999 --json number -q '.[].number' | tr '\n' ' ') - PREVIEW_CLEAR_PR_LIST=${PREVIEW_CLEAR_PR_LIST% } - export PREVIEW_CLEAR_PR_LIST + CPPREFJP_OPEN_PR_LIST=$(gh pr list --limit=999 --json number -q '.[].number' | tr '\n' ' ') + CPPREFJP_OPEN_PR_LIST=${CPPREFJP_OPEN_PR_LIST% } + export CPPREFJP_OPEN_PR_LIST - git config --global user.name 'github-actions[bot]' - git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' + git config user.name 'github-actions[bot]' + git config user.email '41898282+github-actions[bot]@users.noreply.github.com' git filter-branch --commit-filter ' - pr=$(git log -n 1 --pretty=format:%s "$GIT_COMMIT" | sed -n '\''s/^Preview PR \([0-9]\{1,\}\).*/\1/p'\'') - case " $PREVIEW_CLEAR_PR_LIST | " in - (*" $pr "*) - git commit-tree "$@" ;; - (*) - skip_commit "$@" ;; - esac + commit_message=$(git log -n 1 --pretty=format:%s "$GIT_COMMIT") + if [ "$commit_message" = preview_clear ]; then + # drop a dummy commit by previous preview_clear + skip_commit "$@" + exit + fi + + pr=$(echo "$commit_message" | sed -n '\''s/^Preview PR \([0-9]\{1,\}\).*/\1/p'\'') + if [ -n "$pr" ]; then + case " $CPPREFJP_OPEN_PR_LIST " in + (*" $pr "*) + # preserve a commit for an open PR + git commit-tree "$@" ;; + (*) + # drop a commit for a closed PR + skip_commit "$@" ;; + esac + exit + fi + + # we preserve all the other commits + git commit-tree "$@" ' HEAD || true commit_count=$(git rev-list HEAD --count || true) if [ -z "$commit_count" ] || [ "$commit_count" = 0 ]; then - # When no commits are left, we remove the branch - git push -f origin :gh-pages - else - git push -f origin gh-pages + # When no commits are left, we create a dummy commit + git reset + git commit --allow-empty -m 'preview_clear' fi + + git push -f origin gh-pages From afdc0310222165306826831590ed0616c12367ab Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 22 Jan 2025 13:39:19 +0900 Subject: [PATCH 1412/3948] =?UTF-8?q?atomic:=20wait=E7=B3=BB=E9=96=A2?= =?UTF-8?q?=E6=95=B0=E3=81=AE=E4=BA=8B=E5=89=8D=E6=9D=A1=E4=BB=B6=E3=82=92?= =?UTF-8?q?=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/atomic/atomic/wait.md | 7 +++++++ reference/atomic/atomic_flag/wait.md | 7 +++++++ reference/atomic/atomic_flag_test.md | 7 ------- reference/atomic/atomic_flag_test_explicit.md | 2 +- reference/atomic/atomic_flag_wait_explicit.md | 7 +++++++ reference/atomic/atomic_ref/wait.md | 9 ++++----- reference/atomic/atomic_wait_explicit.md | 7 +++++++ 7 files changed, 33 insertions(+), 13 deletions(-) diff --git a/reference/atomic/atomic/wait.md b/reference/atomic/atomic/wait.md index 226c45d3b4..32b7f4d0dc 100644 --- a/reference/atomic/atomic/wait.md +++ b/reference/atomic/atomic/wait.md @@ -35,6 +35,13 @@ constexpr void - C++20 : `atomic::is_always_lock_free`が`true`であること +## 事前条件 +`order`が以下のメモリオーダーではないこと: + +- [`memory_order_release`](/reference/atomic/memory_order.md) +- [`memory_order_acq_rel`](/reference/atomic/memory_order.md) + + ## 効果 - 以下のステップを順に繰り返し実行する: - [`load`](load.md)`(order)`によって現在の値を読み込み、`old`と値を比較する diff --git a/reference/atomic/atomic_flag/wait.md b/reference/atomic/atomic_flag/wait.md index 6a28dc057e..ad10948556 100644 --- a/reference/atomic/atomic_flag/wait.md +++ b/reference/atomic/atomic_flag/wait.md @@ -30,6 +30,13 @@ constexpr void この関数によってブロッキング待機をしたら、対応する起床関数である[`notify_one()`](notify_one.md)、[`notify_all()`](notify_all.md)によってブロッキング待機を解除できる。 +## 事前条件 +`order`が以下のメモリオーダーではないこと: + +- [`memory_order_release`](/reference/atomic/memory_order.md) +- [`memory_order_acq_rel`](/reference/atomic/memory_order.md) + + ## 効果 - 以下のステップを順に繰り返し実行する: - 式[`test`](test.md)`(order) != old`を評価する diff --git a/reference/atomic/atomic_flag_test.md b/reference/atomic/atomic_flag_test.md index fad333b8fc..5e2ee461df 100644 --- a/reference/atomic/atomic_flag_test.md +++ b/reference/atomic/atomic_flag_test.md @@ -20,13 +20,6 @@ namespace std { 現在の値を`bool`値として取得する。 -## 要件 -`order`が以下のメモリオーダーではないこと: - -- [`memory_order_release`](/reference/atomic/memory_order.md) -- [`memory_order_acq_rel`](/reference/atomic/memory_order.md) - - ## 戻り値 アトミックに読み込まれた`*this`が指している値を返す diff --git a/reference/atomic/atomic_flag_test_explicit.md b/reference/atomic/atomic_flag_test_explicit.md index a03168008b..d6e8d0b731 100644 --- a/reference/atomic/atomic_flag_test_explicit.md +++ b/reference/atomic/atomic_flag_test_explicit.md @@ -24,7 +24,7 @@ namespace std { 現在の値を`bool`値として取得する。 -## 要件 +## 事前条件 `order`が以下のメモリオーダーではないこと: - [`memory_order_release`](/reference/atomic/memory_order.md) diff --git a/reference/atomic/atomic_flag_wait_explicit.md b/reference/atomic/atomic_flag_wait_explicit.md index 4a27b046de..7baa5cd5ff 100644 --- a/reference/atomic/atomic_flag_wait_explicit.md +++ b/reference/atomic/atomic_flag_wait_explicit.md @@ -33,6 +33,13 @@ namespace std { この関数によってブロッキング待機をしたら、対応する起床関数である[`atomic_flag_notify_one()`](atomic_flag_notify_one.md)、[`atomic_flag_notify_all()`](atomic_flag_notify_all.md)によってブロッキング待機を解除できる。 +## 事前条件 +`order`が以下のメモリオーダーではないこと: + +- [`memory_order_release`](/reference/atomic/memory_order.md) +- [`memory_order_acq_rel`](/reference/atomic/memory_order.md) + + ## 効果 - 以下のステップを順に繰り返し実行する: - 式[`atomic_flag_test_explicit`](atomic_flag_test_explicit.md)`(object, order) != old`を評価する diff --git a/reference/atomic/atomic_ref/wait.md b/reference/atomic/atomic_ref/wait.md index 58f146c89b..fd66c0b82a 100644 --- a/reference/atomic/atomic_ref/wait.md +++ b/reference/atomic/atomic_ref/wait.md @@ -24,11 +24,10 @@ constexpr void ## 事前条件 -- `order`が以下のいずれかであること: - - [`memory_order::relaxed`](/reference/atomic/memory_order.md) - - [`memory_order::consume`](/reference/atomic/memory_order.md) - - [`memory_order::acquire`](/reference/atomic/memory_order.md) - - [`memory_order::seq_cst`](/reference/atomic/memory_order.md) +`order`が以下のメモリオーダーではないこと: + +- [`memory_order_release`](/reference/atomic/memory_order.md) +- [`memory_order_acq_rel`](/reference/atomic/memory_order.md) ## 効果 diff --git a/reference/atomic/atomic_wait_explicit.md b/reference/atomic/atomic_wait_explicit.md index 1f273afa61..1c5f02754e 100644 --- a/reference/atomic/atomic_wait_explicit.md +++ b/reference/atomic/atomic_wait_explicit.md @@ -37,6 +37,13 @@ namespace std { - (1) : `atomic::is_always_lock_free`が`true`であること +## 事前条件 +`order`が以下のメモリオーダーではないこと: + +- [`memory_order_release`](/reference/atomic/memory_order.md) +- [`memory_order_acq_rel`](/reference/atomic/memory_order.md) + + ## 効果 - 以下のステップを順に繰り返し実行する: - [`atomic_load_explicit`](atomic_load_explicit.md)`(object, order)`によって現在の値を読み込み、`old`と値を比較する From 9f13e4fa8982b01023db70eadb3cb1255e951d70 Mon Sep 17 00:00:00 2001 From: suomesta Date: Thu, 23 Jan 2025 22:40:31 +0900 Subject: [PATCH 1413/3948] flat_map : add uses_allocator (#1078) --- reference/flat_map/flat_map.md | 8 +++ reference/flat_map/flat_map/uses_allocator.md | 55 +++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 reference/flat_map/flat_map/uses_allocator.md diff --git a/reference/flat_map/flat_map.md b/reference/flat_map/flat_map.md index 3ed7bc59b6..b914da5401 100644 --- a/reference/flat_map/flat_map.md +++ b/reference/flat_map/flat_map.md @@ -152,6 +152,14 @@ namespace std { | [`(deduction_guide)`](flat_map/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | +## その他 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`uses_allocator`](flat_map/uses_allocator.md) | `flat_map`による特殊化 | C++23 | + + + ## 例 ### 基本的な使い方 ```cpp example diff --git a/reference/flat_map/flat_map/uses_allocator.md b/reference/flat_map/flat_map/uses_allocator.md new file mode 100644 index 0000000000..e362db03f2 --- /dev/null +++ b/reference/flat_map/flat_map/uses_allocator.md @@ -0,0 +1,55 @@ +# uses_allocator +* flat_map[meta header] +* std[meta namespace] +* class template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template + struct uses_allocator, + Alloc> + : bool_constant && + uses_allocator_v> { }; +} +``` +* bool_constant[link /reference/type_traits/bool_constant.md] + +## 概要 +`uses_allocator`の、`flat_map`に対する特殊化。 + +アロケータを指定する`flat_map`のコンストラクタにおいて、指定されたアロケータと、`KeyContainer`および`MappedContainer`が合致するかをチェックするのに使われる。 + + +## 例 +```cpp +#include +#include + +int main() +{ + using fm_t = std::flat_map; + + std::cout << std::uses_allocator>::value << std::endl; +} +``` +* std::uses_allocator[color ff0000] +* std::allocator[link /reference/memory/allocator.md] + +### 出力 +```cpp +1 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 From ca2c47c1987f3601195b4009a43f04546eef236c Mon Sep 17 00:00:00 2001 From: suomesta Date: Fri, 24 Jan 2025 01:20:49 +0900 Subject: [PATCH 1414/3948] flat_map : add constructor (#1078) --- reference/flat_map/flat_map.md | 2 +- reference/flat_map/flat_map/op_constructor.md | 257 ++++++++++++++++++ reference/flat_map/flat_map/uses_allocator.md | 2 +- 3 files changed, 259 insertions(+), 2 deletions(-) create mode 100644 reference/flat_map/flat_map/op_constructor.md diff --git a/reference/flat_map/flat_map.md b/reference/flat_map/flat_map.md index b914da5401..bf06506b31 100644 --- a/reference/flat_map/flat_map.md +++ b/reference/flat_map/flat_map.md @@ -25,7 +25,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |---------------------------------|----------------|-------| -| [`(constructor)`](flat_map/op_constructor.md.nolink) | コンストラクタ | C++23 | +| [`(constructor)`](flat_map/op_constructor.md) | コンストラクタ | C++23 | | [`(destructor)`](flat_map/op_destructor.md.nolink) | デストラクタ | C++23 | | [`operator=`](flat_map/op_assign.md.nolink) | 代入演算子 | C++23 | diff --git a/reference/flat_map/flat_map/op_constructor.md b/reference/flat_map/flat_map/op_constructor.md new file mode 100644 index 0000000000..fa67760be1 --- /dev/null +++ b/reference/flat_map/flat_map/op_constructor.md @@ -0,0 +1,257 @@ +# コンストラクタ +* flat_map[meta header] +* std[meta namespace] +* flat_map[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +// ____要素数ゼロのflat_mapを構築____ + +flat_map() : flat_map(key_compare()) { } // (1) C++23 + +explicit flat_map(const key_compare& comp) // (2) C++23 + : c(), compare(comp) { } + +template +explicit flat_map(const Allocator& a); // (3) C++23 + +template +flat_map(const key_compare& comp, const Allocator& a); // (4) C++23 + +// ____アロケータを伴うコピー&ムーブコンストラクタ____ + + template + flat_map(const flat_map& x, const Allocator& a); // (5) C++26 + + template + flat_map(flat_map&& x, const Allocator& a); // (6) C++26 + +// ____key_container_typeとmapped_container_typeから構築____ + +flat_map(key_container_type key_cont, mapped_container_type mapped_cont, + const key_compare& comp = key_compare()); // (7) C++23 + +template +flat_map(const key_container_type& key_cont, const mapped_container_type& mapped_cont, + const Allocator& a); // (8) C++23 + +template +flat_map(const key_container_type& key_cont, const mapped_container_type& mapped_cont, + const key_compare& comp, const Allocator& a); // (9) C++23 + +// ____key_container_typeとmapped_container_type(共にソート済み)から構築____ + +flat_map(sorted_unique_t, key_container_type key_cont, mapped_container_type mapped_cont, + const key_compare& comp = key_compare()); // (10) C++23 + +template +flat_map(sorted_unique_t, const key_container_type& key_cont, + const mapped_container_type& mapped_cont, const Allocator& a); // (11) C++23 + +template +flat_map(sorted_unique_t, const key_container_type& key_cont, + const mapped_container_type& mapped_cont, + const key_compare& comp, const Allocator& a); // (12) C++23 + +// ____イテレータから構築____ + +template +flat_map(InputIterator first, InputIterator last, const key_compare& comp = key_compare()) // (13) C++23 + : c(), compare(comp) { insert(first, last); } + +template +flat_map(InputIterator first, InputIterator last, const Allocator& a); // (14) C++23 + +template +flat_map(InputIterator first, InputIterator last, + const key_compare& comp, const Allocator& a); // (15) C++23 + +// ____イテレータ(ソート済み)から構築____ + +template +flat_map(sorted_unique_t s, InputIterator first, InputIterator last, + const key_compare& comp = key_compare()) // (16) C++23 + : c(), compare(comp) { insert(s, first, last); } + +template +flat_map(sorted_unique_t, InputIterator first, InputIterator last, const Allocator& a); // (17) C++23 + +template +flat_map(sorted_unique_t, InputIterator first, InputIterator last, + const key_compare& comp, const Allocator& a); // (18) C++23 + +// ____Rangeから構築____ + +template R> +flat_map(from_range_t fr, R&& rg) // (19) C++23 + : flat_map(fr, forward(rg), key_compare()) { } + +template R> +flat_map(from_range_t, R&& rg, const key_compare& comp) // (20) C++23 + : flat_map(comp) { insert_range(forward(rg)); } + +template R, class Allocator> +flat_map(from_range_t, R&& rg, const Allocator& a); // (21) C++23 + +template R, class Allocator> +flat_map(from_range_t, R&& rg, const key_compare& comp, const Allocator& a); // (22) C++23 + +// ____initializer_listから構築____ + +flat_map(initializer_list il, const key_compare& comp = key_compare()) // (23) C++23 + : flat_map(il.begin(), il.end(), comp) { } + +template +flat_map(initializer_list il, const Allocator& a); // (24) C++23 + +template +flat_map(initializer_list il, const key_compare& comp, const Allocator& a); // (25) C++23 + +// ____initializer_list(ソート済み)から構築____ + +flat_map(sorted_unique_t s, initializer_list il, +const key_compare& comp = key_compare()) // (26) C++23 + : flat_map(s, il.begin(), il.end(), comp) { } + +template +flat_map(sorted_unique_t, initializer_list il, const Allocator& a); // (27) C++23 + +template +flat_map(sorted_unique_t, initializer_list il, + const key_compare& comp, const Allocator& a); // (28) C++23 +``` +* initializer_list[link /reference/initializer_list/initializer_list.md] +* from_range_t[link ../../ranges/from_range_t.md] +* sorted_unique_t[link ../sorted_unique_t.md] +* forward[link ../../utility/forward.md] +* insert[link insert.md] +* insert_range[link insert_range.md] + + +## 概要 +`flat_map`オブジェクトを次に示す通りの要素で初期化する。 + + +## 効果 +- (1) : デフォルトコンストラクタ。デフォルトの `key_compare` を作成し、要素を持たない空の `flat_map` オブジェクトを構築する。 +- (2) : `key_compare` を受け取り、要素を持たない空の `flat_map` オブジェクトを構築する。 +- (3) : アロケータを受け取り、要素を持たない空の `flat_map` オブジェクトを構築する。 +- (4) : `key_compare` とアロケータを受け取り、`flat_map` 要素を持たない空の `flat_map` オブジェクトを構築する。 +- (5) : アロケータを受け取り、`flat_map` オブジェクトをコピー構築する。 +- (6) : アロケータを受け取り、`flat_map` オブジェクトをムーブ構築する。 +- (7) : `key_container_type` と `mapped_container_type` から `flat_map` オブジェクトを構築する。構築に際し、`value_compare` に基づきソートされ、また、Key が重複している要素は削除される。 +- (8) : アロケータを受け取り、`key_container_type` と `mapped_container_type` から `flat_map` オブジェクトを構築する。構築に際し、`value_compare` に基づきソートされ、また、Key が重複している要素は削除される。 +- (9) : `key_compare` とアロケータを受け取り、`key_container_type` と `mapped_container_type` から `flat_map` オブジェクトを構築する。構築に際し、`value_compare` に基づきソートされ、また、Key が重複している要素は削除される。 +- (10) : `key_container_type` と `mapped_container_type`(共にソート済み)から `flat_map` オブジェクトを構築する。 +- (11) : アロケータを受け取り、`key_container_type` と `mapped_container_type`(共にソート済み)から `flat_map` オブジェクトを構築する。 +- (12) : `key_compare` とアロケータを受け取り、`key_container_type` と `mapped_container_type`(共にソート済み)から `flat_map` オブジェクトを構築する。 +- (13) : イテレータから `flat_map` オブジェクトを構築する。構築には [`insert()`](insert.md) が用いられる。 +- (14) : アロケータを受け取り、イテレータから `flat_map` オブジェクトを構築する。構築には [`insert()`](insert.md) が用いられる。 +- (15) : `key_compare` とアロケータを受け取り、イテレータから `flat_map` オブジェクトを構築する。構築には [`insert()`](insert.md) が用いられる。 +- (16) : イテレータ(ソート済み)から `flat_map` オブジェクトを構築する。 +- (17) : アロケータを受け取り、イテレータ(ソート済み)から `flat_map` オブジェクトを構築する。 +- (18) : `key_compare` とアロケータを受け取り、イテレータ(ソート済み)から `flat_map` オブジェクトを構築する。 +- (19) : Rangeから `flat_map` オブジェクトを構築する。構築には [`insert_range()`](insert_range.md) が用いられる。 +- (20) : `key_compare` を受け取り、Rangeから `flat_map` オブジェクトを構築する。。構築には [`insert_range()`](insert_range.md) が用いられる。 +- (21) : アロケータを受け取り、Rangeから `flat_map` オブジェクトを構築する。。構築には [`insert_range()`](insert_range.md) が用いられる。 +- (22) : `key_compare` とアロケータを受け取り、Rangeから `flat_map` オブジェクトを構築する。。構築には [`insert_range()`](insert_range.md) が用いられる。 +- (23) : initializer_listから `flat_map` オブジェクトを構築する。構築には [`insert()`](insert.md) が用いられる。 +- (24) : アロケータを受け取り、initializer_listから `flat_map` オブジェクトを構築する。構築には [`insert()`](insert.md) が用いられる。 +- (25) : `key_compare` とアロケータを受け取り、initializer_listから `flat_map` オブジェクトを構築する。構築には [`insert()`](insert.md) が用いられる。 +- (26) : initializer_list(ソート済み)から `flat_map` オブジェクトを構築する。 +- (27) : アロケータを受け取り、initializer_list(ソート済み)から `flat_map` オブジェクトを構築する。 +- (28) : `key_compare` とアロケータを受け取り、initializer_list(ソート済み)から `flat_map` オブジェクトを構築する。 + + +## 計算量 +- (1)-(4) : 定数時間。 +- (5) : 引数 `x` のサイズに対して線形時間。 +- (6) : 引数 `x` の `containers` をムーブした計算量と同じ。 +- (7)-(9) : 引数 `key_cont` のサイズを `N` とすると、`key_cont` がソート済みなら `N` に対して線形時間。そうでなければ `N log(N)`。 +- (10)-(12) : 引数 `key_cont` および `mapped_cont` をムーブした計算量と同じ。 +- (13)-(15) : 引数 `first` と `last` の距離を `N` とすると、イテレータの値が `value_compare` に基づきソート済みなら `N` に対して線形時間。そうでなければ `N log(N)`。 +- (16)-(18) : 引数 `first` と `last` の距離を `N` とすると、`N` に対して線形時間。 +- (19)-(22) : [`ranges::distance`](../../iterator/ranges_distance.md)`(rg)` を `N` とすると、要素の値が `value_compare` に基づきソート済みなら `N` に対して線形時間。そうでなければ `N log(N)`。 +- (23)-(25) : 引数 `il` のサイズを `N` とすると、イテレータの値が `value_compare` に基づきソート済みなら `N` に対して線形時間。そうでなければ `N log(N)`。 +- (26)-(28) : 引数 `il` のサイズを `N` とすると、`N` に対して線形時間。 + + +## 備考 +- (7)-(12) において、引数の `key_cont` と `mapped_cont` のサイズが異なる場合の動作は定められていない。 +- (7)-(9), (13)-(15), (23)-(25) において、Key が重複している要素は削除されるが、どの要素が削除されるかは定められていない。 +- (3)-(6), (8), (9), (11), (12), (14), (15), (17), (18), (21), (22), (24), (25), (27), (28) は引数としてアロケータを受け取るが、引数のアロケータに対して [`uses_allocator`](uses_allocator.md) が `false` であれば、この引数は無視される。 + + +## 例 +```cpp example +#include +#include +#include +#include + +void print(const std::flat_map& fm) +{ + std::cout << "{" << std::endl; + for (const auto& kv: fm) { + std::cout << " " << kv.first << ": " << kv.second << "," << std::endl; + } + std::cout << "}" << std::endl; +} + +int main() +{ + std::cout << "(1)" << std::endl; + { + std::flat_map fm; + print(fm); + } + std::cout << std::endl; + + std::cout << "(5)" << std::endl; + { + std::vector keys = {"Alice", "Bob", "Carol"}; + std::vector values = {3, 1, 4}; + + std::flat_map fm(keys, values); + print(fm); + } + std::cout << std::endl; + + std::cout << "(23)" << std::endl; + { + std::initializer_list> elems = {{"Alice", 3}, {"Bob", 1}, {"Carol", 4}}; + + std::flat_map fm(elems); + print(fm); + } + std::cout << std::endl; +} +``` + +### 出力 +``` +(1) +{ +} + +(5) +{ + Alice: 3, + Bob: 1, + Carol: 4, +} + +(23) +{ + Alice: 3, + Bob: 1, + Carol: 4, +} +``` + +## 関連項目 + +| 名前 | 説明 | +|---------------------------------------|--------------------------------------------| +| [`uses_allocator`](uses_allocator.md) | 指定されたアロケータと合致するかをチェックする | diff --git a/reference/flat_map/flat_map/uses_allocator.md b/reference/flat_map/flat_map/uses_allocator.md index e362db03f2..c318a4d0f8 100644 --- a/reference/flat_map/flat_map/uses_allocator.md +++ b/reference/flat_map/flat_map/uses_allocator.md @@ -19,7 +19,7 @@ namespace std { ## 概要 `uses_allocator`の、`flat_map`に対する特殊化。 -アロケータを指定する`flat_map`のコンストラクタにおいて、指定されたアロケータと、`KeyContainer`および`MappedContainer`が合致するかをチェックするのに使われる。 +アロケータを指定する`flat_map`の[`コンストラクタ`](op_constructor.md)において、指定されたアロケータと、`KeyContainer`および`MappedContainer`のアロケータが合致するかをチェックするのに使われる。 ## 例 From 2f8d201e089296abeb64ee1878105f1b8e9255cb Mon Sep 17 00:00:00 2001 From: onihusube Date: Fri, 24 Jan 2025 01:56:13 +0900 Subject: [PATCH 1415/3948] =?UTF-8?q?P0848R3:=20=E6=A6=82=E8=A6=81?= =?UTF-8?q?=E3=81=BE=E3=81=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp20.md | 2 +- ...onally_trivial_special_member_functions.md | 75 +++++++++++++++++++ 2 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 lang/cpp20/conditionally_trivial_special_member_functions.md diff --git a/lang/cpp20.md b/lang/cpp20.md index 96fdc77aad..9ef1fdbc4a 100644 --- a/lang/cpp20.md +++ b/lang/cpp20.md @@ -22,7 +22,7 @@ C++20とは、2020年中に改訂され、ISO/IEC 14882:2020で標準規格化 | [構造化束縛がカスタマイゼーションポイントを見つけるルールを緩和](cpp20/relaxing_the_structured_bindings_customization_point_finding_rules.md) | 非テンプレートの`get()`メンバ関数が見つかった場合は、非メンバ関数の`get()`を探しにいく | | [抽象型のチェック](cpp20/checking_for_abstract_class_types.md) | 関数の宣言段階では、パラメータおよび戻り値型が抽象型かどうかをチェックしないようにする | | [可変長データを扱うクラスの効率的な`delete`](cpp20/efficient_sized_delete_for_variable_sized_classes.md) | クラスの`delete`演算子が呼び出される前にデストラクタが呼ばれないようにするオプションを追加 | -| [条件付きで特殊メンバ関数をトリビアルに定義するように](cpp20/conditionally_trivial_special_member_functions.md.nolink) | 制約によってトリビアルな特殊メンバ関数と非トリビアルな特殊メンバ関数をオーバーロードできるようにする | +| [条件付きで特殊メンバ関数をトリビアルに定義するように](cpp20/conditionally_trivial_special_member_functions.md) | 制約によってトリビアルな特殊メンバ関数と非トリビアルな特殊メンバ関数をオーバーロードできるようにする | | [未初期化領域への暗黙的なオブジェクト構築](cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md) | 未初期化領域の利用時に自動的にトリビアルな型のオブジェクトを構築する | diff --git a/lang/cpp20/conditionally_trivial_special_member_functions.md b/lang/cpp20/conditionally_trivial_special_member_functions.md new file mode 100644 index 0000000000..79ba772c0d --- /dev/null +++ b/lang/cpp20/conditionally_trivial_special_member_functions.md @@ -0,0 +1,75 @@ +# 条件付きで特殊メンバ関数をトリビアルに定義するように +* cpp20[meta cpp] + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 + +## 概要 + +クラスの特殊メンバ関数(コンストラクタ・代入演算子・デストラクタ)の`default`宣言をコンセプトによって制約することで、テンプレートパラメータの性質に応じて優先的に選択させることができる様になる。 + +```cpp +template +struct wrap { + + // 1. 制約されたdefaultなコピーコンストラクタ + wrap(const wrap&) requires std::is_trivially_copy_constructible_v = default; + + // 2. ユーザー定義コピーコンストラクタ + wrap(const wrap&) { + ... + } +}; +``` + +`T`が`std::is_trivially_copy_constructible`を満たす場合、1の宣言が選択され`wrap`のコピーコンストラクタは`default`実装される(2のコンストラクタが選択されることは無い)。`T`が`std::is_trivially_copy_constructible`を満たさない場合、2の宣言が選択され`wrap`のコピーコンストラクタはユーザー定義される。 + +特に、`T`がトリビアルコピー可能である場合にこの仕組みによって1のコンストラクタが選択されれば、(他の条件を満たしているものとして)`wrap`もまたトリビアルコピー可能となる。 + +## 仕様 + +(執筆中) + + +## 例 + +(執筆中) + +```cpp example +// (ここには、言語機能の使い方を解説するための、サンプルコードを記述します。) +// (インクルードとmain()関数を含む、実行可能なサンプルコードを記述してください。そのようなコードブロックにはexampleタグを付けます。) + +#include + +int main() +{ + int variable = 0; + std::cout << variable << std::endl; +} +``` +* variable[color ff0000] + +### 出力 +``` +0 +``` + +## この機能が必要になった背景・経緯 + +(執筆中) + + +## 検討されたほかの選択肢 + +(執筆中) + + +## ## 関連項目 + +- [コンセプト](./concepts.md) + +## 参照 + +- [P0848R0 Conditionally Trivial Special Member Functions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0848r0.html) +- [P0848R3 Conditionally Trivial Special Member Functions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0848r3.html) From 81d50fd6e29af9044684a78cc018cd5954e12009 Mon Sep 17 00:00:00 2001 From: onihusube Date: Fri, 24 Jan 2025 01:59:22 +0900 Subject: [PATCH 1416/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20#1106?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/implementation-status.md b/implementation-status.md index 67250d0739..617e1fd663 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -212,7 +212,7 @@ | P0912R5: [コルーチン](/lang/cpp20/coroutines.md) | 関数実行を中断・再開する仕組みとしてコルーチンを導入する | 10 (`-fcoroutines`が必要) | 8.0 (partial) | 2021.4| 2019 Update 8 | | P1161R3: [添字演算子内でのカンマ演算子の使用を非推奨化](/lang/cpp20/deprecate_uses_of_the_comma_operator_in_subscripting_expressions.md) | `ar[i, j]`を非推奨化。`ar[(i, j)]`はOK | 10 | 9.0 | 2021.6 | 2019 Update 5 | | P1331R2: [constexpr関数内でのトリビアルなデフォルト初期化を許可](/lang/cpp20/permitting_trivial_default_initialization_in_constexpr_contexts.md) | constexpr関数内でのデフォルト初期化を許可し、未初期化値を読むことのみ禁止する | 10 | 10.0 | 2022.3 | 2019 Update 7 | -| P0848R3: [条件付きで特殊メンバ関数をトリビアルに定義するように](/lang/cpp20/conditionally_trivial_special_member_functions.md.nolink) | 制約によってトリビアルな特殊メンバ関数と非トリビアルな特殊メンバ関数をオーバーロードできるようにする | 10 | 16 Partial (consepts 未実装部あり) | 2022.3 | 2019 Update 8 | +| P0848R3: [条件付きで特殊メンバ関数をトリビアルに定義するように](/lang/cpp20/conditionally_trivial_special_member_functions.md) | 制約によってトリビアルな特殊メンバ関数と非トリビアルな特殊メンバ関数をオーバーロードできるようにする | 10 | 16 Partial (consepts 未実装部あり) | 2022.3 | 2019 Update 8 | | P1301R4: [`[[nodiscard]]`属性に理由となる文字列を付加できるようにする](/lang/cpp20/nodiscard_should_have_a_reason.md) | 関数の戻り値を無視してはならない理由を関数宣言に持たせ、警告メッセージに役立てる | 10 | 9.0 | 2021.6 | 2019 Update 5 | | P1099R5: [スコープ付き列挙型のusing宣言](/lang/cpp20/using_enum.md) | `using enum EnumType;`もしくは`using EnumType::enumerator`とすることで、列挙値のスコープ指定を省略できるようにする | 11 | 13 | 2023.0 | 2019 Update 4 | | P1816R0: [集成体クラステンプレートのテンプレート引数推論](/lang/cpp20/class_template_argument_deduction_for_aggregates.md) | クラステンプレートのテンプレート引数推論はコンストラクタ引数から推論されるが、集成体初期化からも推論できるようにする | 10 | No | 2024.0 | 2019 Update 7 | From c00bf8966eb4a869552d481e6c04cacea7ead2e7 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sun, 26 Jan 2025 16:25:02 +0900 Subject: [PATCH 1417/3948] flat_map : add op_assign and improve op_constructor (#1078) --- reference/flat_map/flat_map.md | 2 +- reference/flat_map/flat_map/op_assign.md | 75 +++++++++++++++++++ reference/flat_map/flat_map/op_constructor.md | 13 ++++ 3 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 reference/flat_map/flat_map/op_assign.md diff --git a/reference/flat_map/flat_map.md b/reference/flat_map/flat_map.md index bf06506b31..3abbebbc4a 100644 --- a/reference/flat_map/flat_map.md +++ b/reference/flat_map/flat_map.md @@ -27,7 +27,7 @@ namespace std { |---------------------------------|----------------|-------| | [`(constructor)`](flat_map/op_constructor.md) | コンストラクタ | C++23 | | [`(destructor)`](flat_map/op_destructor.md.nolink) | デストラクタ | C++23 | -| [`operator=`](flat_map/op_assign.md.nolink) | 代入演算子 | C++23 | +| [`operator=`](flat_map/op_assign.md) | 代入演算子 | C++23 | ### イテレータ diff --git a/reference/flat_map/flat_map/op_assign.md b/reference/flat_map/flat_map/op_assign.md new file mode 100644 index 0000000000..bf845db8b2 --- /dev/null +++ b/reference/flat_map/flat_map/op_assign.md @@ -0,0 +1,75 @@ +# operator= +* flat_map[meta header] +* std[meta namespace] +* flat_map[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +flat_map& operator=(initializer_list il); // C++23 +``` +* initializer_list[link /reference/initializer_list/initializer_list.md] + + +## 概要 +初期化子リストの値を代入する。 + + +## 効果 +`*this`の全ての要素が解放され、`il`の全ての要素が`*this`にコピー代入される。 + + +## 戻り値 +`*this` + + +## 備考 +- 引数の型が `const flat_map&` であるコピー代入演算子と、引数の型が `flat_map&&` であるムーブ代入演算子は、それぞれ自動生成される。 + + +## 例 +```cpp example +#include +#include +#include +#include + +void print(const std::flat_map& fm) +{ + std::cout << "{" << std::endl; + for (const auto& kv: fm) { + std::cout << " " << kv.first << ": " << kv.second << "," << std::endl; + } + std::cout << "}" << std::endl; +} + +int main() +{ + std::initializer_list> elems = {{"Alice", 3}, {"Bob", 1}, {"Carol", 4}}; + + std::flat_map fm; + fm = elems; + + print(fm); +} +``` + +### 出力 +``` +{ + Alice: 3, + Bob: 1, + Carol: 4, +} +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/flat_map/flat_map/op_constructor.md b/reference/flat_map/flat_map/op_constructor.md index fa67760be1..c94fb5ed71 100644 --- a/reference/flat_map/flat_map/op_constructor.md +++ b/reference/flat_map/flat_map/op_constructor.md @@ -178,6 +178,7 @@ flat_map(sorted_unique_t, initializer_list il, ## 備考 +- 通常の(アロケータを指定しない)コピーコンストラクタとムーブコンストラクタは自動生成される。 - (7)-(12) において、引数の `key_cont` と `mapped_cont` のサイズが異なる場合の動作は定められていない。 - (7)-(9), (13)-(15), (23)-(25) において、Key が重複している要素は削除されるが、どの要素が削除されるかは定められていない。 - (3)-(6), (8), (9), (11), (12), (14), (15), (17), (18), (21), (22), (24), (25), (27), (28) は引数としてアロケータを受け取るが、引数のアロケータに対して [`uses_allocator`](uses_allocator.md) が `false` であれば、この引数は無視される。 @@ -250,6 +251,18 @@ int main() } ``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + ## 関連項目 | 名前 | 説明 | From 18545553d16cb5b4788e72f43a6b06c28eb84781 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sun, 26 Jan 2025 17:31:30 +0900 Subject: [PATCH 1418/3948] flat_map : add value_compare, key_comp() and value_comp() (#1078) --- reference/flat_map/flat_map.md | 6 +- reference/flat_map/flat_map/key_comp.md | 65 ++++++++++++++++++ reference/flat_map/flat_map/value_comp.md | 72 ++++++++++++++++++++ reference/flat_map/flat_map/value_compare.md | 53 ++++++++++++++ 4 files changed, 193 insertions(+), 3 deletions(-) create mode 100644 reference/flat_map/flat_map/key_comp.md create mode 100644 reference/flat_map/flat_map/value_comp.md create mode 100644 reference/flat_map/flat_map/value_compare.md diff --git a/reference/flat_map/flat_map.md b/reference/flat_map/flat_map.md index 3abbebbc4a..17217c4681 100644 --- a/reference/flat_map/flat_map.md +++ b/reference/flat_map/flat_map.md @@ -87,8 +87,8 @@ namespace std { | 名前 | 説明 | 対応バージョン | |-------------------------------------|----------------------------------------|----------------| -| [`key_comp`](flat_map/key_comp.md.nolink) | キー比較用の関数オブジェクトを取得する | C++23 | -| [`value_comp`](flat_map/value_comp.md.nolink) | 要素比較用の関数オブジェクトを取得する | C++23 | +| [`key_comp`](flat_map/key_comp.md) | キー比較用の関数オブジェクトを取得する | C++23 | +| [`value_comp`](flat_map/value_comp.md) | 要素比較用の関数オブジェクトを取得する | C++23 | | [`keys`](flat_map/keys.md.nolink) | キーのコンテナを取得する | C++23 | | [`values`](flat_map/values.md.nolink) | 値のコンテナを取得する | C++23 | @@ -101,7 +101,7 @@ namespace std { | `mapped_type` | 値の型。テンプレートパラメータ `T` | C++23 | | `value_type` | 要素の型。[`std::pair`](/reference/utility/pair.md)`` | C++23 | | `key_compare` | キー値の大小関係を判定する二項述語の型。テンプレートパラメータ `Compare` | C++23 | -| [`value_compare`](flat_map/value_compare.md.nolink) | 要素値のキー部分で大小関係を判定する二項述語の型。入れ子クラス | C++23 | +| [`value_compare`](flat_map/value_compare.md) | 要素値のキー部分で大小関係を判定する二項述語の型。入れ子クラス | C++23 | | `reference` | 要素への参照型。[`std::pair`](/reference/utility/pair.md)`` | C++23 | | `const_reference` | 要素への`const`参照型。[`std::pair`](/reference/utility/pair.md)`` | C++23 | | `size_type` | 要素数を表す符号なし整数型 [`size_t`](/reference/cstddef/size_t.md) | C++23 | diff --git a/reference/flat_map/flat_map/key_comp.md b/reference/flat_map/flat_map/key_comp.md new file mode 100644 index 0000000000..67578cf116 --- /dev/null +++ b/reference/flat_map/flat_map/key_comp.md @@ -0,0 +1,65 @@ +# key_comp +* flat_map[meta header] +* std[meta namespace] +* flat_map[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +key_compare key_comp() const; // C++23 +``` + + +## 概要 +コンテナに関連づけられたキー比較用の関数オブジェクトを返す。このオブジェクトはコンテナ内の二つの要素のキー値を比較するために利用できる。 +この比較オブジェクトはオブジェクトの構築時に与えられ、関数へのポインタでも関数オブジェクトでも良い。いずれの場合でも、これは同じ型の 2 つの引数をとり、[狭義の弱順序](/reference/algorithm.md#strict-weak-ordering)に従って一つ目の引数が二つ目の引数より前のときに `true` を返し、そうでないときに `false` を返す。 + + +## 戻り値 +比較オブジェクト。`key_compare` はメンバ型であり、テンプレートパラメータ `Compare` の別名として定義される。 + + +## 計算量 +定数時間。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_map m; + std::flat_map::key_compare comp = m.key_comp(); + + std::cout << comp(1, 2) << std::endl; + std::cout << comp(3, 2) << std::endl; +} +``` +* key_comp()[color ff0000] + +### 出力 +``` +1 +0 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------------|----------------------------------------------------------| +| [`value_comp`](value_comp.md) | 要素比較用の関数オブジェクトを返す | +| [`value_compare`](value_compare.md) | 要素値のキー部分で大小関係を判定する二項述語の型 | diff --git a/reference/flat_map/flat_map/value_comp.md b/reference/flat_map/flat_map/value_comp.md new file mode 100644 index 0000000000..9142b87da3 --- /dev/null +++ b/reference/flat_map/flat_map/value_comp.md @@ -0,0 +1,72 @@ +# value_comp +* flat_map[meta header] +* std[meta namespace] +* flat_map[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +value_compare value_comp() const; // C++23 +``` + + +## 概要 +コンテナに関連づけられた要素比較用の関数オブジェクトを返す。これはコンテナ内の二つの要素のキー部分を比較するために利用できる。 +これは同じ型の 2 つの引数をとり、[狭義の弱順序](/reference/algorithm.md#strict-weak-ordering)に従って一つ目の引数が二つ目の引数の前になる場合に `true`、そうでない場合に `false` を返す。 + + +## 戻り値 +要素比較用の関数オブジェクト。 +[`value_compare`](value_compare.md) はメンバ型である。`key_compare` とは異なり、単なる型の別名ではなく入れ子クラスである。 + + +## 計算量 +定数時間。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::flat_map m; + std::flat_map::value_compare comp = m.value_comp(); + + auto p1 = std::make_pair(1, 'a'); + auto p2 = std::make_pair(2, 'b'); + auto p3 = std::make_pair(3, 'c'); + + std::cout << comp(p1, p2) << std::endl; + std::cout << comp(p3, p2) << std::endl; +} +``` +* value_comp()[color ff0000] +* value_compare[link value_compare.md] + +### 出力 +``` +1 +0 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------------|----------------------------------------------------------| +| [`key_comp`](key_comp.md) | キー比較用の関数オブジェクトを取得する | +| [`value_compare`](value_compare.md) | 要素値のキー部分で大小関係を判定する二項述語の型 | diff --git a/reference/flat_map/flat_map/value_compare.md b/reference/flat_map/flat_map/value_compare.md new file mode 100644 index 0000000000..8f9ac152b9 --- /dev/null +++ b/reference/flat_map/flat_map/value_compare.md @@ -0,0 +1,53 @@ +# value_compare +* flat_map[meta header] +* std[meta namespace] +* flat_map[meta class] +* class[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + class flat_map::value_compare; +} +``` + +## 概要 +`value_compare` は `flat_map` の入れ子クラスで、`flat_map::value_type` 型のオブジェクトを比較する関数オブジェクト型である。 +比較の基準は `flat_map::key_compare` と同様であるが、`flat_map::key_compare` の関数呼び出し演算子の引数型が `flat_map::key_type` であるのに対して、本クラスの関数呼び出し演算子の比較型は `flat_map::value_type` である点が異なっている。 +なお、引数のうち [`flat_map`](../../flat_map.md)`::mapped_type` にあたる [`pair`](../../utility/pair.md) の `second` 部については、比較時には無視される。 + + +## メンバ関数 +| 名前 | 説明 | 対応バージョン | +|-----------------------------------------------------------|--------------------|----------------| +| [`operator()`](value_compare/op_call.md.nolink) | 関数呼び出し演算子 | | + +一般的な実装では、`key_compare` 型をメンバ変数で保持しており、その変数名を `comp` とすると、以下の動作となる。 + ```cpp + bool operator()(const_reference x, const_reference y) const { + return comp(x.first, y.first); + } + ``` + + +## 例 +[`value_comp()`](value_comp.md) の例を参照。 + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------------|----------------------------------------------------------| +| [`key_comp`](key_comp.md) | キー比較用の関数オブジェクトを取得する | +| [`value_comp`](value_comp.md) | 要素比較用の関数オブジェクトを返す | From 4fd95574db7eabb85608abd36222558b576558fa Mon Sep 17 00:00:00 2001 From: suomesta Date: Mon, 27 Jan 2025 23:35:27 +0900 Subject: [PATCH 1419/3948] flat_map : add keys() and values() (#1078) --- reference/flat_map/flat_map.md | 4 +- reference/flat_map/flat_map/keys.md | 68 +++++++++++++++++++++++++++ reference/flat_map/flat_map/values.md | 68 +++++++++++++++++++++++++++ 3 files changed, 138 insertions(+), 2 deletions(-) create mode 100644 reference/flat_map/flat_map/keys.md create mode 100644 reference/flat_map/flat_map/values.md diff --git a/reference/flat_map/flat_map.md b/reference/flat_map/flat_map.md index 17217c4681..49b7998c64 100644 --- a/reference/flat_map/flat_map.md +++ b/reference/flat_map/flat_map.md @@ -89,8 +89,8 @@ namespace std { |-------------------------------------|----------------------------------------|----------------| | [`key_comp`](flat_map/key_comp.md) | キー比較用の関数オブジェクトを取得する | C++23 | | [`value_comp`](flat_map/value_comp.md) | 要素比較用の関数オブジェクトを取得する | C++23 | -| [`keys`](flat_map/keys.md.nolink) | キーのコンテナを取得する | C++23 | -| [`values`](flat_map/values.md.nolink) | 値のコンテナを取得する | C++23 | +| [`keys`](flat_map/keys.md) | キーのコンテナを取得する | C++23 | +| [`values`](flat_map/values.md) | 値のコンテナを取得する | C++23 | ## メンバ型 diff --git a/reference/flat_map/flat_map/keys.md b/reference/flat_map/flat_map/keys.md new file mode 100644 index 0000000000..fd3403c82e --- /dev/null +++ b/reference/flat_map/flat_map/keys.md @@ -0,0 +1,68 @@ +# keys +* flat_map[meta header] +* std[meta namespace] +* flat_map[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +const key_container_type& keys() const noexcept; // C++23 +``` + +## 概要 +キーのコンテナを取得する。 + + +## 戻り値 +`flat_map` クラス内部で保持しているキーのコンテナ。 + + +## 計算量 +定数時間 + + +## 例 +```cpp example +#include +#include +#include +#include + +int main() +{ + std::flat_map fm; + fm[3] = 'C'; + fm[1] = 'A'; + fm[2] = 'B'; + + static_assert(std::is_same_v&>); + + for (auto i : fm.keys()) { + std::cout << i << std::endl; + } +} +``` +* keys()[color ff0000] + +### 出力 +``` +1 +2 +3 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|-----------------------------------|-------------------------------------------| +| [`flat_map::values`](values.md) | 値のコンテナを取得する | diff --git a/reference/flat_map/flat_map/values.md b/reference/flat_map/flat_map/values.md new file mode 100644 index 0000000000..1db318e3c7 --- /dev/null +++ b/reference/flat_map/flat_map/values.md @@ -0,0 +1,68 @@ +# values +* flat_map[meta header] +* std[meta namespace] +* flat_map[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +const mapped_container_type& values() const noexcept; // C++23 +``` + +## 概要 +値のコンテナを取得する。 + + +## 戻り値 +`flat_map` クラス内部で保持している値のコンテナ。 + + +## 計算量 +定数時間 + + +## 例 +```cpp example +#include +#include +#include +#include + +int main() +{ + std::flat_map fm; + fm[3] = 'C'; + fm[1] = 'A'; + fm[2] = 'B'; + + static_assert(std::is_same_v&>); + + for (auto i : fm.values()) { + std::cout << i << std::endl; + } +} +``` +* values()[color ff0000] + +### 出力 +``` +A +B +C +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------|-------------------------------------------| +| [`flat_map::keys`](keys.md) | キーのコンテナを取得する | From a4f10675824cc83330148588aa997a8bb1a8795c Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 28 Jan 2025 15:46:42 +0900 Subject: [PATCH 1420/3948] =?UTF-8?q?cpp14/digit=5Fseparators:=20=E8=A8=80?= =?UTF-8?q?=E8=AA=9E=E4=BB=95=E6=A7=98=E3=82=92=E8=A3=9C=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp14/digit_separators.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lang/cpp14/digit_separators.md b/lang/cpp14/digit_separators.md index c677b1915a..d5c489e596 100644 --- a/lang/cpp14/digit_separators.md +++ b/lang/cpp14/digit_separators.md @@ -33,8 +33,8 @@ int binary_value = 0b1000'1111; - 桁区切り文字(digit separators)は、数値リテラルの読みやすさを向上させるため導入された、数値リテラルの間に挿入することを許可された特殊な文字である - 桁区切り文字には、シングルクォーテーション(`'`)を使用する - 桁区切り文字は、整数リテラルと浮動小数点数リテラルに対して使用できる -- 桁区切り文字は、リテラルの先頭に入力することはできない -- 浮動小数点数リテラルでは、小数部にも桁区切り文字を入力できる +- 桁区切り文字は、数字並びの先頭や末尾に配置したり、2個以上を連続して配置することはできない +- 浮動小数点数リテラルでは、小数部や指数部にも桁区切り文字を配置できる ## 例 @@ -50,7 +50,7 @@ int main() int octal_value = 0123'456; std::cout << octal_value << std::endl; - int hex_value = 0x123'456; + int hex_value = 0x12'34'56; std::cout << hex_value << std::endl; int binary_value = 0b1010'1010; From 1e87d12d9bd2285f4c978a496272baf0c022496b Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 28 Jan 2025 18:11:31 +0900 Subject: [PATCH 1421/3948] =?UTF-8?q?rcu:=20C++26=20RCU=E3=83=98=E3=83=83?= =?UTF-8?q?=E3=83=80=E6=A6=82=E8=A6=81(#1183)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 2 +- reference.md | 2 +- reference/rcu.md | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 reference/rcu.md diff --git a/lang/cpp26.md b/lang/cpp26.md index 87e5aaf0f4..242762a85e 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -98,7 +98,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 ## ライブラリ更新の概要 ### 新ライブラリ - 文字列エンコーディングを識別するライブラリとして、[``](/reference/text_encoding.md.nolink)を追加 -- 並行処理におけるデータの参照・更新を行うRCU (Read Copy Update) のライブラリとして、[``](/reference/rcu.md.nolink)を追加 +- 並行処理におけるデータの参照・更新を行うRCU (Read Copy Update) のライブラリとして、[``](/reference/rcu.md)を追加 - 並行処理において参照中のデータが更新されないよう保護するハザードポインタのライブラリとして、[``](/reference/hazard_pointer.md.nolink)を追加 - データ並列ライブラリとして、[``](/reference/simd.md.nolink)を追加 - デバッグサポートのライブラリとして[``](/reference/debugging.md)を追加 diff --git a/reference.md b/reference.md index 1d4c25d60d..27970a2e3a 100644 --- a/reference.md +++ b/reference.md @@ -208,7 +208,7 @@ | [``](/reference/latch.md) | ラッチ同期 | C++20 | | [``](/reference/barrier.md) | バリア同期 | C++20 | | [``](/reference/future.md) | Future | C++11 | -| [``](/reference/rcu.md.nolink) | データの参照・更新 | C++26 | +| [``](/reference/rcu.md) | データの参照・更新 | C++26 | | [``](/reference/hazard_pointer.md.nolink) | ハザードポインタ | C++26 | | [``](/reference/simd.md.nolink) | データ並列 | C++26 | diff --git a/reference/rcu.md b/reference/rcu.md new file mode 100644 index 0000000000..df3358695b --- /dev/null +++ b/reference/rcu.md @@ -0,0 +1,36 @@ +# rcu +* rcu[meta header] +* cpp26[meta cpp] + +``ヘッダでは、並行なデータの参照・更新を実現する[Read-Copy Update(RCU)機構](https://ja.wikipedia.org/wiki/%E3%83%AA%E3%83%BC%E3%83%89%E3%83%BB%E3%82%B3%E3%83%94%E3%83%BC%E3%83%BB%E3%82%A2%E3%83%83%E3%83%97%E3%83%87%E3%83%BC%E3%83%88)のための部品を定義する。 + +RCU同期メカニズムは、複数スレッド間で共有されるデータが高頻度で参照され、稀に更新されるようなユースケースに適している。RCU機構はスレッド間の排他制御を行わず、更新操作により不要となった古いデータを安全に解放するタイミング制御を行う。 + + +| 名前 | 説明 | 対応バージョン | +|-----------------|----------------|----------------| +| [`rcu_obj_base`](rcu/rcu_obj_base.md.nolink) | RCU対象オブジェクトの基底クラス(class template) | C++26 | +| [`rcu_domain`](rcu/rcu_domain.md.nolink) | RCUドメイン(class) | C++26 | +| [`rcu_default_domain`](rcu/rcu_default_domain.md.nolink) | デフォルトのRCUドメイン取得(function) | C++26 | +| [`rcu_synchronize`](rcu/rcu_synchronize.md.nolink) | RCUドメインのアンロック完了を待機(function) | C++26 | +| [`rcu_barrier`](rcu/rcu_barrier.md.nolink) | メモリ解放操作完了を待機(function) | C++26 | +| [`rcu_retire`](rcu/rcu_barrier.md.nolink) | メモリ解放操作をスケジュル(function template) | C++26 | + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [``](hazard_pointer.md.nolink) + + +## 参照 +- [P2545R4 Read-Copy Update(RCU)](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2545r4.pdf) From 9730e9ea0217f81a7cbc13d48cd9b900c85fb15c Mon Sep 17 00:00:00 2001 From: suomesta Date: Thu, 30 Jan 2025 00:18:36 +0900 Subject: [PATCH 1422/3948] small improvements in flat_map --- reference/flat_map/flat_map/containers.md | 3 +- reference/flat_map/flat_map/contains.md | 2 +- reference/flat_map/flat_map/op_constructor.md | 34 +++++++++---------- reference/flat_map/flat_map/value_compare.md | 2 +- 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/reference/flat_map/flat_map/containers.md b/reference/flat_map/flat_map/containers.md index c5c2d09958..8fd46ec701 100644 --- a/reference/flat_map/flat_map/containers.md +++ b/reference/flat_map/flat_map/containers.md @@ -1,6 +1,7 @@ -# flat_map::containers +# containers * flat_map[meta header] * std[meta namespace] +* flat_map[meta class] * class[meta id-type] * cpp23[meta cpp] diff --git a/reference/flat_map/flat_map/contains.md b/reference/flat_map/flat_map/contains.md index 93009ba932..219733333c 100644 --- a/reference/flat_map/flat_map/contains.md +++ b/reference/flat_map/flat_map/contains.md @@ -39,7 +39,7 @@ return find(x) != end(); ## 備考 -- (3) : +- (2) : - `is_transparent`は、標準ライブラリの[`std::less`](/reference/functional/less.md)、[`std::greater`](/reference/functional/greater.md)といった関数オブジェクトの、`void`に対する特殊化で定義される。それ以外のテンプレートパラメータで`is_transparent`が定義されないのは、互換性のためである。 - これらのオーバーロードは、`flat_map`のようなコンテナに対し、検索操作で文字列リテラルを渡した際に、キー型の一時オブジェクトが生成されるコストを減らすためにある。 diff --git a/reference/flat_map/flat_map/op_constructor.md b/reference/flat_map/flat_map/op_constructor.md index c94fb5ed71..102ea61d55 100644 --- a/reference/flat_map/flat_map/op_constructor.md +++ b/reference/flat_map/flat_map/op_constructor.md @@ -40,7 +40,7 @@ template flat_map(const key_container_type& key_cont, const mapped_container_type& mapped_cont, const key_compare& comp, const Allocator& a); // (9) C++23 -// ____key_container_typeとmapped_container_type(共にソート済み)から構築____ +// ____key_container_typeとmapped_container_type(共にソート済み且つ重複なし)から構築____ flat_map(sorted_unique_t, key_container_type key_cont, mapped_container_type mapped_cont, const key_compare& comp = key_compare()); // (10) C++23 @@ -67,7 +67,7 @@ template flat_map(InputIterator first, InputIterator last, const key_compare& comp, const Allocator& a); // (15) C++23 -// ____イテレータ(ソート済み)から構築____ +// ____イテレータ(ソート済み且つ重複なし)から構築____ template flat_map(sorted_unique_t s, InputIterator first, InputIterator last, @@ -108,10 +108,10 @@ flat_map(initializer_list il, const Allocator& a); // (24) C++23 template flat_map(initializer_list il, const key_compare& comp, const Allocator& a); // (25) C++23 -// ____initializer_list(ソート済み)から構築____ +// ____initializer_list(ソート済み且つ重複なし)から構築____ flat_map(sorted_unique_t s, initializer_list il, -const key_compare& comp = key_compare()) // (26) C++23 + const key_compare& comp = key_compare()) // (26) C++23 : flat_map(s, il.begin(), il.end(), comp) { } template @@ -137,31 +137,31 @@ flat_map(sorted_unique_t, initializer_list il, - (1) : デフォルトコンストラクタ。デフォルトの `key_compare` を作成し、要素を持たない空の `flat_map` オブジェクトを構築する。 - (2) : `key_compare` を受け取り、要素を持たない空の `flat_map` オブジェクトを構築する。 - (3) : アロケータを受け取り、要素を持たない空の `flat_map` オブジェクトを構築する。 -- (4) : `key_compare` とアロケータを受け取り、`flat_map` 要素を持たない空の `flat_map` オブジェクトを構築する。 +- (4) : `key_compare` とアロケータを受け取り、要素を持たない空の `flat_map` オブジェクトを構築する。 - (5) : アロケータを受け取り、`flat_map` オブジェクトをコピー構築する。 - (6) : アロケータを受け取り、`flat_map` オブジェクトをムーブ構築する。 - (7) : `key_container_type` と `mapped_container_type` から `flat_map` オブジェクトを構築する。構築に際し、`value_compare` に基づきソートされ、また、Key が重複している要素は削除される。 - (8) : アロケータを受け取り、`key_container_type` と `mapped_container_type` から `flat_map` オブジェクトを構築する。構築に際し、`value_compare` に基づきソートされ、また、Key が重複している要素は削除される。 - (9) : `key_compare` とアロケータを受け取り、`key_container_type` と `mapped_container_type` から `flat_map` オブジェクトを構築する。構築に際し、`value_compare` に基づきソートされ、また、Key が重複している要素は削除される。 -- (10) : `key_container_type` と `mapped_container_type`(共にソート済み)から `flat_map` オブジェクトを構築する。 -- (11) : アロケータを受け取り、`key_container_type` と `mapped_container_type`(共にソート済み)から `flat_map` オブジェクトを構築する。 -- (12) : `key_compare` とアロケータを受け取り、`key_container_type` と `mapped_container_type`(共にソート済み)から `flat_map` オブジェクトを構築する。 +- (10) : `key_container_type` と `mapped_container_type`(共にソート済み且つ重複なし)から `flat_map` オブジェクトを構築する。 +- (11) : アロケータを受け取り、`key_container_type` と `mapped_container_type`(共にソート済み且つ重複なし)から `flat_map` オブジェクトを構築する。 +- (12) : `key_compare` とアロケータを受け取り、`key_container_type` と `mapped_container_type`(共にソート済み且つ重複なし)から `flat_map` オブジェクトを構築する。 - (13) : イテレータから `flat_map` オブジェクトを構築する。構築には [`insert()`](insert.md) が用いられる。 - (14) : アロケータを受け取り、イテレータから `flat_map` オブジェクトを構築する。構築には [`insert()`](insert.md) が用いられる。 - (15) : `key_compare` とアロケータを受け取り、イテレータから `flat_map` オブジェクトを構築する。構築には [`insert()`](insert.md) が用いられる。 -- (16) : イテレータ(ソート済み)から `flat_map` オブジェクトを構築する。 -- (17) : アロケータを受け取り、イテレータ(ソート済み)から `flat_map` オブジェクトを構築する。 -- (18) : `key_compare` とアロケータを受け取り、イテレータ(ソート済み)から `flat_map` オブジェクトを構築する。 +- (16) : イテレータ(ソート済み且つ重複なし)から `flat_map` オブジェクトを構築する。 +- (17) : アロケータを受け取り、イテレータ(ソート済み且つ重複なし)から `flat_map` オブジェクトを構築する。 +- (18) : `key_compare` とアロケータを受け取り、イテレータ(ソート済み且つ重複なし)から `flat_map` オブジェクトを構築する。 - (19) : Rangeから `flat_map` オブジェクトを構築する。構築には [`insert_range()`](insert_range.md) が用いられる。 -- (20) : `key_compare` を受け取り、Rangeから `flat_map` オブジェクトを構築する。。構築には [`insert_range()`](insert_range.md) が用いられる。 -- (21) : アロケータを受け取り、Rangeから `flat_map` オブジェクトを構築する。。構築には [`insert_range()`](insert_range.md) が用いられる。 -- (22) : `key_compare` とアロケータを受け取り、Rangeから `flat_map` オブジェクトを構築する。。構築には [`insert_range()`](insert_range.md) が用いられる。 +- (20) : `key_compare` を受け取り、Rangeから `flat_map` オブジェクトを構築する。構築には [`insert_range()`](insert_range.md) が用いられる。 +- (21) : アロケータを受け取り、Rangeから `flat_map` オブジェクトを構築する。構築には [`insert_range()`](insert_range.md) が用いられる。 +- (22) : `key_compare` とアロケータを受け取り、Rangeから `flat_map` オブジェクトを構築する。構築には [`insert_range()`](insert_range.md) が用いられる。 - (23) : initializer_listから `flat_map` オブジェクトを構築する。構築には [`insert()`](insert.md) が用いられる。 - (24) : アロケータを受け取り、initializer_listから `flat_map` オブジェクトを構築する。構築には [`insert()`](insert.md) が用いられる。 - (25) : `key_compare` とアロケータを受け取り、initializer_listから `flat_map` オブジェクトを構築する。構築には [`insert()`](insert.md) が用いられる。 -- (26) : initializer_list(ソート済み)から `flat_map` オブジェクトを構築する。 -- (27) : アロケータを受け取り、initializer_list(ソート済み)から `flat_map` オブジェクトを構築する。 -- (28) : `key_compare` とアロケータを受け取り、initializer_list(ソート済み)から `flat_map` オブジェクトを構築する。 +- (26) : initializer_list(ソート済み且つ重複なし)から `flat_map` オブジェクトを構築する。 +- (27) : アロケータを受け取り、initializer_list(ソート済み且つ重複なし)から `flat_map` オブジェクトを構築する。 +- (28) : `key_compare` とアロケータを受け取り、initializer_list(ソート済み且つ重複なし)から `flat_map` オブジェクトを構築する。 ## 計算量 diff --git a/reference/flat_map/flat_map/value_compare.md b/reference/flat_map/flat_map/value_compare.md index 8f9ac152b9..8b1bc4960f 100644 --- a/reference/flat_map/flat_map/value_compare.md +++ b/reference/flat_map/flat_map/value_compare.md @@ -14,7 +14,7 @@ namespace std { ## 概要 `value_compare` は `flat_map` の入れ子クラスで、`flat_map::value_type` 型のオブジェクトを比較する関数オブジェクト型である。 比較の基準は `flat_map::key_compare` と同様であるが、`flat_map::key_compare` の関数呼び出し演算子の引数型が `flat_map::key_type` であるのに対して、本クラスの関数呼び出し演算子の比較型は `flat_map::value_type` である点が異なっている。 -なお、引数のうち [`flat_map`](../../flat_map.md)`::mapped_type` にあたる [`pair`](../../utility/pair.md) の `second` 部については、比較時には無視される。 +なお、引数のうち [`flat_map`](../flat_map.md)`::mapped_type` にあたる [`pair`](../../utility/pair.md) の `second` 部については、比較時には無視される。 ## メンバ関数 From 3025ea8f6eab24d2580f95c3a6cd196c6c088145 Mon Sep 17 00:00:00 2001 From: onihusube Date: Thu, 30 Jan 2025 02:01:42 +0900 Subject: [PATCH 1423/3948] =?UTF-8?q?P0848R3:=20=E4=BB=95=E6=A7=98?= =?UTF-8?q?=E3=81=A8=E8=83=8C=E6=99=AF=E8=BF=BD=E5=8A=A0=20#1106?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...onally_trivial_special_member_functions.md | 45 ++++++++++++++++--- 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/lang/cpp20/conditionally_trivial_special_member_functions.md b/lang/cpp20/conditionally_trivial_special_member_functions.md index 79ba772c0d..6820cc28be 100644 --- a/lang/cpp20/conditionally_trivial_special_member_functions.md +++ b/lang/cpp20/conditionally_trivial_special_member_functions.md @@ -12,6 +12,7 @@ ```cpp template struct wrap { + T t; // 1. 制約されたdefaultなコピーコンストラクタ wrap(const wrap&) requires std::is_trivially_copy_constructible_v = default; @@ -23,14 +24,43 @@ struct wrap { }; ``` -`T`が`std::is_trivially_copy_constructible`を満たす場合、1の宣言が選択され`wrap`のコピーコンストラクタは`default`実装される(2のコンストラクタが選択されることは無い)。`T`が`std::is_trivially_copy_constructible`を満たさない場合、2の宣言が選択され`wrap`のコピーコンストラクタはユーザー定義される。 +`T`が`std::is_trivially_copy_constructible`を満たす場合、1の宣言が選択され`wrap`のコピーコンストラクタは`default`実装される(2のコンストラクタが選択されることは無い)。`T`が`std::is_trivially_copy_constructible`を満たさない場合、2の宣言が選択され`wrap`のコピーコンストラクタはユーザー定義される(1のコンストラクタが選択されることは無い)。 -特に、`T`がトリビアルコピー可能である場合にこの仕組みによって1のコンストラクタが選択されれば、(他の条件を満たしているものとして)`wrap`もまたトリビアルコピー可能となる。 +特に、`T`がトリビアルコピー可能である場合にこの仕組みによって1のコンストラクタが選択されれば、(他の条件を満たしているものとして)`wrap`もまたトリビアルコピー可能となる。トリビアル性に関する他の性質も同様に伝播することが可能となる。 ## 仕様 -(執筆中) +次のいずれかの場合、2つの特殊メンバ関数は同種となる + +1. 両方ともデフォルトコンストラクタ +2. 両方ともコピー/ムーブコンストラクタであり、最初の引数型が同じ +3. 両方ともコピー/ムーブ代入演算子であり、最初の引数型と参照・CV修飾が同じ + +ある特殊メンバ関数が次の全てを満たす場合、それは資格のある(*eligible*)特殊メンバ関数となる + +1. `delete`されていない +2. 関連制約がある場合(コンセプト機能により制約がなされている場合)、それが満たされている +3. 同種の特殊メンバ関数で、より制約されているものがない + +次に、宣言されている全てのデストラクタはデストラクタ候補(*prospective destructor*)として扱われるようになる。そして、クラスの定義の最後(`};`が出現した場所と思って差し支えない)において、全てのデストラクタ候補の間で空の引数リストで呼び出す形でオーバーロード解決を実行し、そのクラスのデストラクタを選択する。 + +こうして選ばれたデストラクタの事を選択されたデストラクタ(*selected destructor*)とも呼ぶが、この選択されたデストラクタだけがそのクラスのデストラクタとなる(規格書中の他のすべての箇所で単にデストラクタ(*destructor*)と呼ばれるものは、この選択されたデストラクタの事を指す)。なお、何らかの理由でオーバーロード解決が失敗した場合、プログラムは不適格となる。 + +そして、あるクラスは次の条件を全て満たす場合にトリビアルコピー可能である +1. 少なくとも1つの、資格のあるコピーコンストラクタ、ムーブコンストラクタ、コピー代入演算子、またはムーブ代入演算子を持つ +2. それら資格のあるコピーコンストラクタ、ムーブコンストラクタ、コピー代入演算子、ムーブ代入演算子、はそれぞれすべてトリビアルである +3. トリビアルで削除されていないデストラクタ(選択されたデストラクタ)を持つ + +また、あるクラスは次の条件をすべて満たす場合にトリビアルである + +1. トリビアルコピー可能である +2. 1つ以上の資格のあるデフォルトコンストラクタを持つ +3. それらのデフォルトコンストラクタは全てトリビアルである + +`default`宣言の扱いについては、選択されたデストラクタ以外の`default`指定されたデストラクタ候補は`delete`定義され、デストラクタ候補でも資格があるわけでもない`default`指定された特殊メンバ関数は`delete`定義される。 + +コンセプトによって制約された特殊メンバ関数があるとき、どれが使用されるか(オーバーロード解決)については通常の制約された関数と同じルールに従って選択される。そして、そのような特殊メンバ関数を持つ型のトリビアル性に関する性質については、特殊メンバ関数のオーバーロードのうち資格があるもの(デストラクタの場合は選択されたもの)によって決定される。 ## 例 @@ -57,13 +87,13 @@ int main() ## この機能が必要になった背景・経緯 -(執筆中) - +例にあるように、C++17まで、`std::optional`のようにテンプレートパラメータで指定された型の値を保持するラッパクラス型において、その指定された型のトリビアル性を伝播するためには非常に複雑な実装を必要としていた。 -## 検討されたほかの選択肢 +C++20のコンセプトの導入によって、コンセプトによって特殊メンバ関数の宣言を選択することができるようになっていたものの、トリビアル性(特にトリビアルコピー可能性)の規格上の定義がそれを考慮したものになっておらず、コンセプトによる特殊メンバ関数の選択は仕様として完全なものではなかった。 -(執筆中) +この機能はそれを補うための仕組みであり、特殊メンバ関数に対するコンセプト制約自体は最初のコンセプト導入時から可能になっていたため、この機能は厳密にいえば仕様の調整のみである。 +この機能は、C++23の`std::expceted`の実装で活用されるだろう。 ## ## 関連項目 @@ -73,3 +103,4 @@ int main() - [P0848R0 Conditionally Trivial Special Member Functions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0848r0.html) - [P0848R3 Conditionally Trivial Special Member Functions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0848r3.html) +- [What is a "prospective destructor" in C++20? - stackoverflow](https://stackoverflow.com/questions/66055641/what-is-a-prospective-destructor-in-c20) From 9ee90cb63f54d718f3347a3066a5d00d2a2ec84c Mon Sep 17 00:00:00 2001 From: suomesta Date: Thu, 30 Jan 2025 20:22:25 +0900 Subject: [PATCH 1424/3948] flat_map : add flat_multimap (#1078) --- reference/flat_map.md | 14 +- reference/flat_map/flat_map/count.md | 6 +- reference/flat_map/flat_map/insert.md | 4 +- reference/flat_map/flat_map/insert_range.md | 2 +- reference/flat_map/flat_multimap.md | 243 ++++++++++++++++ reference/flat_map/flat_multimap/begin.md | 79 +++++ reference/flat_map/flat_multimap/cbegin.md | 76 +++++ reference/flat_map/flat_multimap/cend.md | 79 +++++ reference/flat_map/flat_multimap/clear.md | 60 ++++ .../flat_map/flat_multimap/containers.md | 98 +++++++ reference/flat_map/flat_multimap/contains.md | 84 ++++++ reference/flat_map/flat_multimap/count.md | 98 +++++++ reference/flat_map/flat_multimap/crbegin.md | 76 +++++ reference/flat_map/flat_multimap/crend.md | 74 +++++ reference/flat_map/flat_multimap/emplace.md | 75 +++++ .../flat_map/flat_multimap/emplace_hint.md | 75 +++++ reference/flat_map/flat_multimap/empty.md | 60 ++++ reference/flat_map/flat_multimap/end.md | 82 ++++++ .../flat_map/flat_multimap/equal_range.md | 85 ++++++ reference/flat_map/flat_multimap/erase.md | 146 ++++++++++ .../flat_map/flat_multimap/erase_if_free.md | 87 ++++++ reference/flat_map/flat_multimap/extract.md | 90 ++++++ reference/flat_map/flat_multimap/find.md | 108 +++++++ reference/flat_map/flat_multimap/insert.md | 226 +++++++++++++++ .../flat_map/flat_multimap/insert_range.md | 99 +++++++ reference/flat_map/flat_multimap/key_comp.md | 65 +++++ reference/flat_map/flat_multimap/key_equiv.md | 32 +++ reference/flat_map/flat_multimap/keys.md | 70 +++++ .../flat_map/flat_multimap/lower_bound.md | 119 ++++++++ reference/flat_map/flat_multimap/max_size.md | 57 ++++ reference/flat_map/flat_multimap/op_assign.md | 76 +++++ .../flat_map/flat_multimap/op_compare_3way.md | 90 ++++++ .../flat_map/flat_multimap/op_constructor.md | 271 ++++++++++++++++++ reference/flat_map/flat_multimap/op_equal.md | 73 +++++ reference/flat_map/flat_multimap/rbegin.md | 80 ++++++ reference/flat_map/flat_multimap/rend.md | 73 +++++ reference/flat_map/flat_multimap/replace.md | 93 ++++++ reference/flat_map/flat_multimap/size.md | 69 +++++ reference/flat_map/flat_multimap/swap.md | 81 ++++++ .../flat_map/flat_multimap/upper_bound.md | 119 ++++++++ .../flat_map/flat_multimap/uses_allocator.md | 55 ++++ .../flat_map/flat_multimap/value_comp.md | 72 +++++ .../flat_map/flat_multimap/value_compare.md | 53 ++++ reference/flat_map/flat_multimap/values.md | 70 +++++ reference/flat_map/sorted_equivalent_t.md | 66 +++++ reference/map/map/count.md | 4 +- reference/map/map/insert.md | 2 +- reference/map/multimap/count.md | 4 +- reference/set/multiset/count.md | 4 +- reference/set/set/count.md | 4 +- 50 files changed, 3807 insertions(+), 21 deletions(-) create mode 100644 reference/flat_map/flat_multimap.md create mode 100644 reference/flat_map/flat_multimap/begin.md create mode 100644 reference/flat_map/flat_multimap/cbegin.md create mode 100644 reference/flat_map/flat_multimap/cend.md create mode 100644 reference/flat_map/flat_multimap/clear.md create mode 100644 reference/flat_map/flat_multimap/containers.md create mode 100644 reference/flat_map/flat_multimap/contains.md create mode 100644 reference/flat_map/flat_multimap/count.md create mode 100644 reference/flat_map/flat_multimap/crbegin.md create mode 100644 reference/flat_map/flat_multimap/crend.md create mode 100644 reference/flat_map/flat_multimap/emplace.md create mode 100644 reference/flat_map/flat_multimap/emplace_hint.md create mode 100644 reference/flat_map/flat_multimap/empty.md create mode 100644 reference/flat_map/flat_multimap/end.md create mode 100644 reference/flat_map/flat_multimap/equal_range.md create mode 100644 reference/flat_map/flat_multimap/erase.md create mode 100644 reference/flat_map/flat_multimap/erase_if_free.md create mode 100644 reference/flat_map/flat_multimap/extract.md create mode 100644 reference/flat_map/flat_multimap/find.md create mode 100644 reference/flat_map/flat_multimap/insert.md create mode 100644 reference/flat_map/flat_multimap/insert_range.md create mode 100644 reference/flat_map/flat_multimap/key_comp.md create mode 100644 reference/flat_map/flat_multimap/key_equiv.md create mode 100644 reference/flat_map/flat_multimap/keys.md create mode 100644 reference/flat_map/flat_multimap/lower_bound.md create mode 100644 reference/flat_map/flat_multimap/max_size.md create mode 100644 reference/flat_map/flat_multimap/op_assign.md create mode 100644 reference/flat_map/flat_multimap/op_compare_3way.md create mode 100644 reference/flat_map/flat_multimap/op_constructor.md create mode 100644 reference/flat_map/flat_multimap/op_equal.md create mode 100644 reference/flat_map/flat_multimap/rbegin.md create mode 100644 reference/flat_map/flat_multimap/rend.md create mode 100644 reference/flat_map/flat_multimap/replace.md create mode 100644 reference/flat_map/flat_multimap/size.md create mode 100644 reference/flat_map/flat_multimap/swap.md create mode 100644 reference/flat_map/flat_multimap/upper_bound.md create mode 100644 reference/flat_map/flat_multimap/uses_allocator.md create mode 100644 reference/flat_map/flat_multimap/value_comp.md create mode 100644 reference/flat_map/flat_multimap/value_compare.md create mode 100644 reference/flat_map/flat_multimap/values.md create mode 100644 reference/flat_map/sorted_equivalent_t.md diff --git a/reference/flat_map.md b/reference/flat_map.md index 1442c31cf1..6070de8f25 100644 --- a/reference/flat_map.md +++ b/reference/flat_map.md @@ -6,7 +6,7 @@ [`std::map`](/reference/map/map.md)と違ってノードベースの実装ではなく、メモリ連続性のある平坦 (flat) な配列で扱われる。 -`` ヘッダでは、キーの重複を許さない `std::`[`flat_map`](flat_map/flat_map.md) クラステンプレート、およびキーの重複を許す `std::`[`flat_multimap`](flat_map/flat_multimap.md.nolink) クラステンプレートを提供する。 +`` ヘッダでは、キーの重複を許さない `std::`[`flat_map`](flat_map/flat_map.md) クラステンプレート、およびキーの重複を許す `std::`[`flat_multimap`](flat_map/flat_multimap.md) クラステンプレートを提供する。 このヘッダでは、以下の標準ヘッダをインクルードする: @@ -15,11 +15,13 @@ | 名前 | 説明 | 対応バージョン | -|----------------------------------------------|--------------------------------------------------------|-------| -| [`flat_map`](flat_map/flat_map.md) | キーの重複を許さない平坦な順序付き連想コンテナ(class template) | C++23 | -| [`flat_multimap`](flat_map/flat_multimap.md.nolink) | キーの重複を許す平坦な順序付き連想コンテナ(class template) | C++23 | -| [`sorted_unique_t`](flat_map/sorted_unique_t.md) | ソート済みかつ重複要素がないことを示すためのタグ型(class) | C++23 | -| [`sorted_unique`](flat_map/sorted_unique_t.md) | ソート済みかつ重複要素がないことを示すためのタグ値(variable) | C++23 | +|----------------------------------------------------------|----------------------------------------------------------------------|-------| +| [`flat_map`](flat_map/flat_map.md) | キーの重複を許さない平坦な順序付き連想コンテナ(class template) | C++23 | +| [`flat_multimap`](flat_map/flat_multimap.md) | キーの重複を許す平坦な順序付き連想コンテナ(class template) | C++23 | +| [`sorted_unique_t`](flat_map/sorted_unique_t.md) | ソート済みかつ重複要素がないことを示すためのタグ型(class) | C++23 | +| [`sorted_unique`](flat_map/sorted_unique_t.md) | ソート済みかつ重複要素がないことを示すためのタグ値(variable) | C++23 | +| [`sorted_equivalent_t`](flat_map/sorted_equivalent_t.md) | ソート済みであること(重複はしてもよい)を示すためのタグ型(class) | C++23 | +| [`sorted_equivalent`](flat_map/sorted_equivalent_t.md) | ソート済みであること(重複はしてもよい)を示すためのタグ値(variable) | C++23 | ## バージョン diff --git a/reference/flat_map/flat_map/count.md b/reference/flat_map/flat_map/count.md index 78d869efb8..139090da55 100644 --- a/reference/flat_map/flat_map/count.md +++ b/reference/flat_map/flat_map/count.md @@ -30,16 +30,16 @@ size_type count(const K& x) const; // (2) C++23 ## 計算量 ``` -log(b.size()) + b.count(k) +log(size()) + count(x) ``` -* b.size()[link size.md] +* size()[link size.md] ## 備考 - (2) : - `is_transparent`は、標準ライブラリの[`std::less`](/reference/functional/less.md)、[`std::greater`](/reference/functional/greater.md)といった関数オブジェクトの、`void`に対する特殊化で定義される。それ以外のテンプレートパラメータで`is_transparent`が定義されないのは、互換性のためである。 - これらのオーバーロードは、`flat_map`のようなコンテナに対し、検索操作で文字列リテラルを渡した際に、キー型の一時オブジェクトが生成されるコストを減らすためにある。 -- [`std::flat_multimap`](/reference/flat_map/flat_multimap.md.nolink)クラスとの共通インタフェースを使用する必要がなければ、この関数の代わりに[`contains()`](contains.md)メンバ関数を使用することを推奨する +- [`std::flat_multimap`](/reference/flat_map/flat_multimap.md)クラスとの共通インタフェースを使用する必要がなければ、この関数の代わりに[`contains()`](contains.md)メンバ関数を使用することを推奨する ## 例 diff --git a/reference/flat_map/flat_map/insert.md b/reference/flat_map/flat_map/insert.md index ad5258b082..a4ce80b3fd 100644 --- a/reference/flat_map/flat_map/insert.md +++ b/reference/flat_map/flat_map/insert.md @@ -40,13 +40,13 @@ void insert(sorted_unique_t s, * sorted_unique_t[link /reference/flat_map/sorted_unique_t.md] ## 概要 -新しく一つの要素(引数 `x`, `y`を使う)または要素のシーケンス(入力イテレータまたは `initializer_list` を使う)を挿入し、コンテナを拡張する。 +新しく一つの要素(引数 `x` を使う)または要素のシーケンス(入力イテレータまたは `initializer_list` を使う)を挿入し、コンテナを拡張する。 これは、挿入された要素の数だけコンテナの [`size()`](size.md) を増やす。 `flat_map` コンテナは重複したキーを持つ要素を許さないため、挿入操作はそれぞれの要素が他のコンテナ内の既存要素と同じキーかどうかをチェックする。もし同じであれば要素は挿入されず、戻り値を持つ関数の場合はそれへのイテレータなどを返す。 -重複した値を許す、類似したコンテナについては `flat_multimap` を参照。 +重複した値を許す、類似したコンテナについては [`flat_multimap`](/reference/flat_map/flat_multimap.md) を参照。 内部的に `flat_map` コンテナは、コンストラクト時に指定された比較オブジェクトによって要素を下位から上位へとソートして保持する。 diff --git a/reference/flat_map/flat_map/insert_range.md b/reference/flat_map/flat_map/insert_range.md index 5ad23d7f2b..0f2bde9476 100644 --- a/reference/flat_map/flat_map/insert_range.md +++ b/reference/flat_map/flat_map/insert_range.md @@ -18,7 +18,7 @@ Rangeを挿入し、コンテナを拡張する。 `flat_map` コンテナは重複したキーを持つ要素を許さないため、挿入操作はそれぞれの要素が他のコンテナ内の既存要素と同じキーかどうかをチェックする。もし同じであれば要素は挿入されない。 -重複した値を許す、類似したコンテナについては `flat_multimap` を参照。 +重複した値を許す、類似したコンテナについては [`flat_multimap`](/reference/flat_map/flat_multimap.md) を参照。 内部的に `flat_map` コンテナは、コンストラクト時に指定された比較オブジェクトによって要素を下位から上位へとソートして保持する。 diff --git a/reference/flat_map/flat_multimap.md b/reference/flat_map/flat_multimap.md new file mode 100644 index 0000000000..8a17b79732 --- /dev/null +++ b/reference/flat_map/flat_multimap.md @@ -0,0 +1,243 @@ +# flat_multimap +* flat_map[meta header] +* std[meta namespace] +* class template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template , + class KeyContainer = vector, + class MappedContainer = vector> + class flat_multimap; +} +``` +* less[link ../functional/less.md] +* vector[link /reference/vector/vector.md] + +## 概要 + + +## メンバ関数 +### 構築・破棄 + +| 名前 | 説明 | 対応バージョン | +|---------------------------------|----------------|-------| +| [`(constructor)`](flat_multimap/op_constructor.md) | コンストラクタ | C++23 | +| [`(destructor)`](flat_multimap/op_destructor.md.nolink) | デストラクタ | C++23 | +| [`operator=`](flat_multimap/op_assign.md) | 代入演算子 | C++23 | + + +### イテレータ + +| 名前 | 説明 | 対応バージョン | +|---------------------------------------|--------------------------------------------------|-------| +| [`begin`](flat_multimap/begin.md) | 先頭を指すイテレータを取得する | C++23 | +| [`cbegin`](flat_multimap/cbegin.md) | 先頭を指す読み取り専用イテレータを取得する | C++23 | +| [`end`](flat_multimap/end.md) | 末尾の次を指すイテレータを取得する | C++23 | +| [`cend`](flat_multimap/cend.md) | 末尾の次を指す読み取り専用イテレータを取得する | C++23 | +| [`rbegin`](flat_multimap/rbegin.md) | 末尾を指す逆イテレータを取得する | C++23 | +| [`crbegin`](flat_multimap/crbegin.md) | 末尾を指す読み取り専用逆イテレータを取得する | C++23 | +| [`rend`](flat_multimap/rend.md) | 先頭の前を指す逆イテレータを取得する | C++23 | +| [`crend`](flat_multimap/crend.md) | 先頭の前を指す読み取り専用逆イテレータを取得する | C++23 | + + +### 領域 + +| 名前 | 説明 | 対応バージョン | +|-----------------------------------------|------------------------------------|-------| +| [`empty`](flat_multimap/empty.md) | コンテナが空であるかどうかを調べる | C++23 | +| [`size`](flat_multimap/size.md) | 要素数を取得する | C++23 | +| [`max_size`](flat_multimap/max_size.md) | 格納可能な最大の要素数を取得する | C++23 | + + +### コンテナの変更 + +| 名前 | 説明 | 対応バージョン | +|-------------------------------------------------|------------------------------------------|----------------| +| [`clear`](flat_multimap/clear.md) | 全ての要素を削除する | C++23 | +| [`insert`](flat_multimap/insert.md) | 要素を挿入する | C++23 | +| [`insert_range`](flat_multimap/insert_range.md) | Rangeを挿入する | C++23 | +| [`emplace`](flat_multimap/emplace.md) | 要素を直接構築する | C++23 | +| [`emplace_hint`](flat_multimap/emplace_hint.md) | ヒントを使って要素を直接構築する | C++23 | +| [`erase`](flat_multimap/erase.md) | 要素を削除する | C++23 | +| [`swap`](flat_multimap/swap.md) | コンテンツを交換する | C++23 | +| [`extract`](flat_multimap/extract.md) | キーのコンテナ、値のコンテナを取得する | C++23 | +| [`replace`](flat_multimap/replace.md) | キーのコンテナ、値のコンテナを置き換える | C++23 | + + +### 要素アクセス + +| 名前 | 説明 | 対応バージョン | +|-----------------------------------------------|--------------------------------------------------------------|-------| +| [`count`](flat_multimap/count.md) | 指定したキーにマッチする要素の数を取得する | C++23 | +| [`find`](flat_multimap/find.md) | 指定したキーで要素を探す | C++23 | +| [`contains`](flat_multimap/contains.md) | 指定したキーの要素が含まれているかを判定する | C++23 | +| [`equal_range`](flat_multimap/equal_range.md) | 指定したキーにマッチする要素範囲を取得する | C++23 | +| [`lower_bound`](flat_multimap/lower_bound.md) | 与えられた値より小さくない最初の要素へのイテレータを取得する | C++23 | +| [`upper_bound`](flat_multimap/upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを取得する | C++23 | + +### オブザーバー + +| 名前 | 説明 | 対応バージョン | +|---------------------------------------------|----------------------------------------|----------------| +| [`key_comp`](flat_multimap/key_comp.md) | キー比較用の関数オブジェクトを取得する | C++23 | +| [`value_comp`](flat_multimap/value_comp.md) | 要素比較用の関数オブジェクトを取得する | C++23 | +| [`keys`](flat_multimap/keys.md) | キーのコンテナを取得する | C++23 | +| [`values`](flat_multimap/values.md) | 値のコンテナを取得する | C++23 | + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `key_type` | キーの型。テンプレートパラメータ `Key` | C++23 | +| `mapped_type` | 値の型。テンプレートパラメータ `T` | C++23 | +| `value_type` | 要素の型。[`std::pair`](/reference/utility/pair.md)`` | C++23 | +| `key_compare` | キー値の大小関係を判定する二項述語の型。テンプレートパラメータ `Compare` | C++23 | +| [`value_compare`](flat_multimap/value_compare.md) | 要素値のキー部分で大小関係を判定する二項述語の型。入れ子クラス | C++23 | +| `reference` | 要素への参照型。[`std::pair`](/reference/utility/pair.md)`` | C++23 | +| `const_reference` | 要素への`const`参照型。[`std::pair`](/reference/utility/pair.md)`` | C++23 | +| `size_type` | 要素数を表す符号なし整数型 [`size_t`](/reference/cstddef/size_t.md) | C++23 | +| `difference_type` | 同一のコンテナを指す `iterator` の差を表す符号付き整数型 [`ptrdiff_t`](/reference/cstddef/ptrdiff_t.md) | C++23 | +| `iterator` | ランダムアクセスイテレータ | C++23 | +| `const_iterator` | 読み取り専用ランダムアクセスイテレータ | C++23 | +| `reverse_iterator` | 逆順ランダムアクセスイテレータ。[`std::reverse_iterator`](/reference/iterator/reverse_iterator.md)`` | C++23 | +| `const_reverse_iterator` | 読み取り専用逆順ランダムアクセスイテレータ。[`std::reverse_iterator`](/reference/iterator/reverse_iterator.md)`` | C++23 | +| `key_container_type` | キーを格納するコンテナ型 `KeyContainer` | C++23 | +| `mapped_container_type` | 値を格納するコンテナ型 `MappedContainer` | C++23 | +| [`containers`](flat_multimap/containers.md) | キーのコンテナと値のコンテナを保持する型 | C++23 | +| [`key_equiv`](flat_multimap/key_equiv.md) | 要素をとってキーの等価比較を行う説明専用の関数オブジェクト | C++23 | + + +## 非メンバ関数 +### 要素削除 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`erase_if`](flat_multimap/erase_if_free.md) | 指定した条件に合致する要素とその分の領域を、コンテナから削除する | C++23 | + + +## 非メンバ(*Hidden friends*)関数 +### 比較演算子 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`operator==`](flat_multimap/op_equal.md) | 左辺と右辺が等しいかの判定を行う | C++23 | +| `bool operator!=(const flat_multimap& x, const flat_multimap& y);` | 左辺と右辺が等しくないかの判定を行う (`==`により使用可能) | C++23 | +| [`operator<=>`](flat_multimap/op_compare_3way.md) | 三方比較を行う | C++23 | +| `bool operator<(const flat_multimap& x, const flat_multimap& y);` | 左辺が右辺より小さいかの判定を行う (`<=>`により使用可能) | C++23 | +| `bool operator<=(const flat_multimap& x, const flat_multimap& y);` | 左辺が右辺より小さいか等しいかの判定を行う (`<=>`により使用可能) | C++23 | +| `bool operator>(const flat_multimap& x, const flat_multimap& y);` | 左辺が右辺より大きいかの判定を行う (`<=>`により使用可能) | C++23 | +| `bool operator>=(const flat_multimap& x, const flat_multimap& y);` | 左辺が右辺より大きいか等しいかの判定を行う (`<=>`により使用可能) | C++23 | + + +### 入れ替え + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`swap`](flat_multimap/swap_free.md.nolink) | 2つの`flat_multimap`オブジェクトを入れ替える | C++23 | + + +## 推論補助 + +| 名前 | 説明 | 対応バージョン | +|---------------------------------------------|------------------------------------|-------| +| [`(deduction_guide)`](flat_multimap/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | + + +## その他 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`uses_allocator`](flat_multimap/uses_allocator.md) | `flat_multimap`による特殊化 | C++23 | + + + +## 例 +### 基本的な使い方 +```cpp example +#include +#include + +int main() +{ + // intをキー、charを値、として扱う連想配列 + // flat_mapとは異なり、キーが重複してもよい + std::flat_multimap fm = { + {10, 'A'}, {11, 'B'}, {12, 'C'}, + {10, 'a'}, {11, 'b'}, {12, 'c'}, + }; + + // 全体を出力する + for (const auto& [key, value] : fm) { + std::cout << key << " : " << value << std::endl; + } +} +``` + +#### 出力 +``` +10 : A +10 : a +11 : B +11 : b +12 : C +12 : c +``` + + + +### キーと要素以外のテンプレートを指定 +```cpp example +#include +#include +#include + +int main() +{ + std::deque keys = {10, 10, 11, 11, 12, 12}; + std::deque values = {'A', 'a', 'B', 'b', 'C', 'c'}; + + // intをキー、charを値として扱う連想配列 + // キーの順序はgreater、キーと値のコンテナはdequeで保持 + std::flat_multimap, + std::deque, + std::deque> fm(keys, values); + + // 全体を出力する + for (const auto& [key, value] : fm) { + std::cout << key << " : " << value << std::endl; + } +} +``` + +#### 出力 +``` +12 : C +12 : c +11 : B +11 : b +10 : A +10 : a +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0429R3 A Standard `flat_map`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0429r3.pdf) + - C++23で`flat_map`が導入された経緯・動機・設計について記載されている +- [P0429R9 A Standard `flat_map`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0429r9.pdf) + - C++23で導入された`flat_map`の仕様 diff --git a/reference/flat_map/flat_multimap/begin.md b/reference/flat_map/flat_multimap/begin.md new file mode 100644 index 0000000000..5efeb7caf1 --- /dev/null +++ b/reference/flat_map/flat_multimap/begin.md @@ -0,0 +1,79 @@ +# begin +* flat_map[meta header] +* std[meta namespace] +* flat_multimap[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +iterator begin() noexcept; +const_iterator begin() const noexcept; +``` + + +## 概要 +コンテナの先頭のキーと要素のpairを参照するイテレータを取得する。 + +内部的に、コンテナは要素を下位から上位へと並べており、従って`begin()`はコンテナ内の最下位のキーにあたるpairへのイテレータを返す。 + + +## 戻り値 +コンテナの先頭要素へのイテレータ。 +`iterator` と `const_iterator` はともにメンバ型である。このクラステンプレートにおいて、これらはランダムアクセスイテレータである。 + + +## 計算量 +定数時間。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_multimap fm = { + {10, 'A'}, {11, 'B'}, {12, 'C'}, + {10, 'a'}, {11, 'b'}, {12, 'c'}, + }; + + for (auto i = fm.begin(); i != fm.end(); ++i) { + std::cout << i->first << " " << i->second << "\n"; + } +} +``` +* begin()[color ff0000] +* fm.end()[link end.md] + +### 出力 +``` +10 A +10 a +11 B +11 b +12 C +12 c +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|----------------------------------------|--------------------------------| +| [`flat_multimap::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`flat_multimap::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`flat_multimap::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`flat_multimap::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | +| [`flat_multimap::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`flat_multimap::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | +| [`flat_multimap::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | diff --git a/reference/flat_map/flat_multimap/cbegin.md b/reference/flat_map/flat_multimap/cbegin.md new file mode 100644 index 0000000000..b30069266a --- /dev/null +++ b/reference/flat_map/flat_multimap/cbegin.md @@ -0,0 +1,76 @@ +# cbegin +* flat_map[meta header] +* std[meta namespace] +* flat_multimap[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +const_iterator cbegin() const noexcept; +``` + + +## 概要 +コンテナの先頭のキーと要素のpairを参照するイテレータを取得する。 + +内部的に、このコンテナは要素を下位から上位へと並べており、従って `cbegin()` はコンテナ内の最下位のキーにあたるpairへのイテレータを返す。 + + +## 戻り値 +コンテナの先頭要素へのイテレータ。 +`const_iterator` はメンバ型である。このクラステンプレートにおいて、これらはランダムアクセスイテレータである。 + + +## 計算量 +定数時間。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_multimap fm = { + {10, 'A'}, {11, 'B'}, {12, 'C'}, + {10, 'a'}, {11, 'b'}, {12, 'c'}, + }; + + for (auto i = fm.cbegin(); i != fm.cend(); ++i) { + std::cout << i->first << " " << i->second << "\n"; + } +} +``` +* cbegin()[color ff0000] +* fm.cend()[link cend.md] + +### 出力 +``` +10 A +10 a +11 B +11 b +12 C +12 c +``` + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|----------------------------------------|--------------------------------| +| [`flat_multimap::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`flat_multimap::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`flat_multimap::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`flat_multimap::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | +| [`flat_multimap::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`flat_multimap::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | +| [`flat_multimap::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + diff --git a/reference/flat_map/flat_multimap/cend.md b/reference/flat_map/flat_multimap/cend.md new file mode 100644 index 0000000000..0936acea6f --- /dev/null +++ b/reference/flat_map/flat_multimap/cend.md @@ -0,0 +1,79 @@ +# cend +* flat_map[meta header] +* std[meta namespace] +* flat_multimap[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +const_iterator cend() const noexcept; +``` + +## 概要 +コンテナの末尾の次を参照するイテレータを取得する。 + + +## 戻り値 +コンテナの末尾の次を参照するイテレータ。 +`const_iterator` はいずれもメンバ型である。このクラステンプレートにおいて、これらはランダムアクセスイテレータである。 + + +## 計算量 +定数時間 + + +## 備考 +- この関数によって返されるイテレータは、`*this`が保持するいずれの要素も参照しない。その指す先は、不正な範囲となるだろう + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_multimap fm = { + {10, 'A'}, {11, 'B'}, {12, 'C'}, + {10, 'a'}, {11, 'b'}, {12, 'c'}, + }; + + for (auto i = fm.cbegin(); i != fm.cend(); ++i) { + std::cout << i->first << " " << i->second << "\n"; + } +} +``` +* cend()[color ff0000] +* fm.cbegin()[link cbegin.md] + +### 出力 +``` +10 A +10 a +11 B +11 b +12 C +12 c +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 関連項目 + +| 名前 | 説明 | +|----------------------------------------|-------------------------------------------| +| [`flat_multimap::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`flat_multimap::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`flat_multimap::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`flat_multimap::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | +| [`flat_multimap::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`flat_multimap::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | +| [`flat_multimap::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + diff --git a/reference/flat_map/flat_multimap/clear.md b/reference/flat_map/flat_multimap/clear.md new file mode 100644 index 0000000000..9eabc66325 --- /dev/null +++ b/reference/flat_map/flat_multimap/clear.md @@ -0,0 +1,60 @@ +# clear +* flat_map[meta header] +* std[meta namespace] +* flat_multimap[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +void clear() noexcept; // (1) C++23 +``` + +## 概要 +コンテナ内の全ての要素を削除する。それぞれのデストラクタが呼ばれ、コンテナから削除される。[`size()`](size.md) は 0 になる。 + + +## 計算量 +線形時間 + + +## 例外 +投げない + +## 例 +```cpp example +#include +#include + +int main () +{ + std::flat_multimap fm = { + {3, 'C'}, + {4, 'D'}, + {1, 'A'}, + {2, 'B'}, + }; + + std::cout << fm.size() << std::endl; + + fm.clear(); + + std::cout << fm.size() << std::endl; +} +``` +* clear()[color ff0000] +* fm.size()[link size.md] + +### 出力 +``` +4 +0 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/flat_map/flat_multimap/containers.md b/reference/flat_map/flat_multimap/containers.md new file mode 100644 index 0000000000..947dbe9d2e --- /dev/null +++ b/reference/flat_map/flat_multimap/containers.md @@ -0,0 +1,98 @@ +# containers +* flat_map[meta header] +* std[meta namespace] +* flat_multimap[meta class] +* class[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template , + class KeyContainer = vector, + class MappedContainer = vector> + class flat_multimap { + public: + using key_container_type = KeyContainer; + using mapped_container_type = MappedContainer; + + struct containers { + key_container_type keys; + mapped_container_type values; + }; + }; +} +``` +* less[link /reference/functional/less.md] +* vector[link /reference/vector/vector.md] + +## 概要 +`flat_multimap`クラス内部のデータ保持方法として、キーのコンテナと値のコンテナをもつ。 + +この形式の内部表現は [`extract()`](extract.md) メンバ関数で取得でき、シリアライズなどの用途に使用できる。 + + +## 例 +### 基本的な使い方 +```cpp example +#include +#include +#include +#include + +int main() +{ + std::flat_multimap fm = { + {'s', "static"}, + {'s', "signed"}, + {'s', "struct"}, + {'c', "const"}, + {'c', "class"} + }; + + decltype(fm)::containers c = std::move(fm).extract(); + + std::cout << "keys:" << std::endl; + for (const auto& key : c.keys) { + std::cout << " '" << key << "'" << std::endl; + } + + std::cout << "values:" << std::endl; + for (const auto& value : c.values) { + std::cout << " \"" << value << "\"" << std::endl; + } +} +``` +* containers[color ff0000] +* extract()[link extract.md] + +#### 出力 +``` +keys: + 'c' + 'c' + 's' + 's' + 's' +values: + "const" + "class" + "static" + "signed" + "struct" +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`extract`](extract.md) diff --git a/reference/flat_map/flat_multimap/contains.md b/reference/flat_map/flat_multimap/contains.md new file mode 100644 index 0000000000..3f58809c47 --- /dev/null +++ b/reference/flat_map/flat_multimap/contains.md @@ -0,0 +1,84 @@ +# contains +* flat_map[meta header] +* std[meta namespace] +* flat_multimap[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +bool contains(const key_type& x) const; // (1) C++23 + +template +bool contains(const K& x) const; // (2) C++23 +``` + + +## 概要 +指定されたキー`x`に一致する要素がコンテナに含まれているかを判定する。 + +- (1) : クラスのテンプレートパラメータ`key_type`型のキーを受け取る +- (2) : `key_type`と比較可能な`K`型のキーを受け取る + + +## テンプレートパラメータ制約 +- (2) : `key_compare::is_transparent`が妥当な式であること + + +## 戻り値 +以下と等価: + +```cpp +return find(x) != end(); +``` +* find[link find.md] +* end()[link end.md] + + +## 計算量 +対数時間 + + +## 備考 +- (2) : + - `is_transparent`は、標準ライブラリの[`std::less`](/reference/functional/less.md)、[`std::greater`](/reference/functional/greater.md)といった関数オブジェクトの、`void`に対する特殊化で定義される。それ以外のテンプレートパラメータで`is_transparent`が定義されないのは、互換性のためである。 + - これらのオーバーロードは、`flat_multimap`のようなコンテナに対し、検索操作で文字列リテラルを渡した際に、キー型の一時オブジェクトが生成されるコストを減らすためにある。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_multimap fm = { + {'a', 3}, + {'b', 1}, + {'c', 4} + }; + + // キー'b'の要素が含まれているか + if (fm.contains('b')) { + std::cout << "contain" << std::endl; + } + else { + std::cout << "doesn't contain" << std::endl; + } +} +``` +* contains[color ff0000] + +### 出力 +``` +contain +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/flat_map/flat_multimap/count.md b/reference/flat_map/flat_multimap/count.md new file mode 100644 index 0000000000..1e59465e3b --- /dev/null +++ b/reference/flat_map/flat_multimap/count.md @@ -0,0 +1,98 @@ +# count +* flat_map[meta header] +* std[meta namespace] +* flat_multimap[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +size_type count(const key_type& x) const; // (1) C++23 + +template +size_type count(const K& x) const; // (2) C++23 +``` + +## 概要 +キー `x` を検索し、コンテナ内に見つかった要素の数を返す。 + +- (1) : クラスのテンプレートパラメータ`key_type`型のキー `x` を受け取って、`x` と等価なキーを持つ要素の数を取得する。 +- (2) : `key_type`と比較可能な`K`型のキー `x` を受け取って、`x`と等価なキーを持つ要素の数を取得する。 + + +## テンプレートパラメータ制約 +- (2) : `key_compare::is_transparent`が妥当な式であること + + +## 戻り値 +- (1) : `x`と等価なキーの要素数を返す。 +- (2) : `key_compare`型の関数オブジェクトを`c`、コンテナ内の各要素が持つキーを`k`として、キーが等価か判定する式`!c(k, x) && !c(x, k)`が`true`となる要素の数を返す。 + + +## 計算量 +``` +log(size()) + count(x) +``` +* size()[link size.md] + + +## 備考 +- (2) : + - `is_transparent`は、標準ライブラリの[`std::less`](/reference/functional/less.md)、[`std::greater`](/reference/functional/greater.md)といった関数オブジェクトの、`void`に対する特殊化で定義される。それ以外のテンプレートパラメータで`is_transparent`が定義されないのは、互換性のためである。 + - これらのオーバーロードは、`flat_multimap`のようなコンテナに対し、検索操作で文字列リテラルを渡した際に、キー型の一時オブジェクトが生成されるコストを減らすためにある。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + // (1) + { + std::flat_multimap fm = { + {"Alice", 3}, + {"Bob", 1}, + {"Carol", 4} + }; + + std::cout << fm.count("Bob") << std::endl; + } + + // (2) + { + std::flat_multimap> fm = { + {"Alice", 3}, + {"Bob", 1}, + {"Carol", 4} + }; + + // std::lessのvoidに対する特殊化を使用することで、 + // 文字列リテラルをcount()関数の引数として渡した際に、 + // std::string型の一時オブジェクトが生成されない。 + std::cout << fm.count("Bob") << std::endl; + } +} +``` +* fm.count[color ff0000] +* std::less[link /reference/functional/less.md] + +### 出力 +``` +1 +1 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`contains()`](contains.md) diff --git a/reference/flat_map/flat_multimap/crbegin.md b/reference/flat_map/flat_multimap/crbegin.md new file mode 100644 index 0000000000..f8d67ddb08 --- /dev/null +++ b/reference/flat_map/flat_multimap/crbegin.md @@ -0,0 +1,76 @@ +# crbegin +* flat_map[meta header] +* std[meta namespace] +* flat_multimap[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +const_reverse_iterator crbegin() const noexcept; +``` + +## 概要 +コンテナ内の末尾を指す逆イテレータを取得する。 +内部的に、このコンテナは各要素をキーの値に従って下位から上位へと並べており、従って `crbegin()` は最上位のキーにあたる値へのイテレータを返す。 +`crbegin()` は [`end()`](end.md) と同じ要素を指すわけではなく、その前の要素を指すことに注意。 + + +## 戻り値 +反転したシーケンスの先頭を指す逆イテレータ。 +`const_reverse_iterator` はメンバ型である。このクラステンプレートにおいて、これらは逆ランダムアクセスイテレータであり、`reverse_iterator` と定義される。 + + +## 計算量 +定数時間。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_multimap fm = { + {10, 'A'}, {11, 'B'}, {12, 'C'}, + {10, 'a'}, {11, 'b'}, {12, 'c'}, + }; + + for (auto i = fm.crbegin(); i != fm.crend(); ++i) { + std::cout << i->first << " " << i->second << "\n"; + } +} +``` +* crbegin()[color ff0000] +* fm.crend()[link crend.md] + +### 出力 +``` +12 c +12 C +11 b +11 B +10 a +10 A +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +| 名前 | 説明 | +|--------------------------------------|-------------------------------------------| +| [`flat_multimap::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`flat_multimap::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`flat_multimap::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`flat_multimap::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`flat_multimap::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | +| [`flat_multimap::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`flat_multimap::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | diff --git a/reference/flat_map/flat_multimap/crend.md b/reference/flat_map/flat_multimap/crend.md new file mode 100644 index 0000000000..2a42c358c7 --- /dev/null +++ b/reference/flat_map/flat_multimap/crend.md @@ -0,0 +1,74 @@ +# crend +* flat_map[meta header] +* std[meta namespace] +* flat_multimap[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +const_reverse_iterator crend() const noexcept; +``` + + +## 概要 +コンテナの先頭要素の前(これは反転シーケンスの末尾にあたる)を指す逆イテレータを取得する。 +`crend()` は [`begin()`](begin.md) と同じ要素を指すわけではなく、その前の要素を指すことに注意。 + + +## 戻り値 +反転シーケンスの終端を指す逆イテレータ。 +`const_reverse_iterator` はメンバ型である。`flat_multimap` クラステンプレートにおいて、これらは逆ランダムアクセスイテレータであり、`reverse_iterator` と定義される。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_multimap fm = { + {10, 'A'}, {11, 'B'}, {12, 'C'}, + {10, 'a'}, {11, 'b'}, {12, 'c'}, + }; + + for (auto i = fm.crbegin(); i != fm.crend(); ++i) { + std::cout << i->first << " " << i->second << "\n"; + } +} +``` +* crend()[color ff0000] +* fm.crbegin()[link crbegin.md] + +### 出力 +``` +12 c +12 C +11 b +11 B +10 a +10 A +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + + +## 関連項目 + +| 名前 | 説明 | +|----------------------------------------|-----------------------------------------| +| [`flat_multimap::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`flat_multimap::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`flat_multimap::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`flat_multimap::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`flat_multimap::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | +| [`flat_multimap::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`flat_multimap::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | diff --git a/reference/flat_map/flat_multimap/emplace.md b/reference/flat_map/flat_multimap/emplace.md new file mode 100644 index 0000000000..b82cd98d58 --- /dev/null +++ b/reference/flat_map/flat_multimap/emplace.md @@ -0,0 +1,75 @@ +# emplace +* flat_map[meta header] +* std[meta namespace] +* flat_multimap[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +template +iterator emplace(Args&&... args); +``` + +## 概要 +コンテナに新しい要素を挿入する。要素は直接構築される(コピーもムーブもされない)。要素のコンストラクタはこの関数に渡された引数を与えることによって呼ばれる。 + + +## パラメータ +- `args...` : 要素のコンストラクタへ転送される引数パック。 + + +## テンプレートパラメータ制約 +- [`is_constructible_v`](/reference/type_traits/is_constructible.md)`<`[`pair`](/reference/utility/pair.md)`, Arg...>`が`true`であること + + +## 戻り値 +挿入された要素へのイテレータを返す。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_multimap fm; + + // キーと値のpairを作ることなく挿入できる + fm.emplace(3, 'A'); + fm.emplace(1, 'B'); + fm.emplace(4, 'C'); + fm.emplace(3, 'D'); + + for (const auto& [key, value] : fm) { + std::cout << key << " : " << value << std::endl; + } +} +``` +* emplace[color ff0000] + +#### 出力 +``` +1 : B +3 : A +3 : D +4 : C +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +| 名前 | 説明 | +|--------------------------------------------------|----------------------------------| +| [`flat_multimap::insert`](insert.md) | 要素を挿入する | +| [`flat_multimap::insert_range`](insert_range.md) | Rangeを挿入する | +| [`flat_multimap::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | diff --git a/reference/flat_map/flat_multimap/emplace_hint.md b/reference/flat_map/flat_multimap/emplace_hint.md new file mode 100644 index 0000000000..8bc40631b9 --- /dev/null +++ b/reference/flat_map/flat_multimap/emplace_hint.md @@ -0,0 +1,75 @@ +# emplace_hint +* flat_map[meta header] +* std[meta namespace] +* flat_multimap[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +template +iterator emplace_hint(const_iterator hint, Args&&... args); +``` + +## 概要 +要素が配置されるべき場所を示唆するパラメータ `hint` を使って、コンテナに新しい要素を挿入する。要素は直接構築される(コピーもムーブもされない)。要素のコンストラクタはこの関数に渡された引数と同じ引数で呼ばれる。 + + +## パラメータ +- `hint` : 新しい要素をどこへ挿入するかを示唆するために使われるイテレータ +- `args...` : 要素のコンストラクタへ転送される引数パック + + +## 戻り値 +追加された要素を指すイテレータ。 + + +## 計算量 +一般にコンテナのサイズについて対数時間だが、新しい要素が `hint` の前に挿入された場合は償却定数時間。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_multimap fm; + + fm.emplace(1, 'A'); + + // キー2の要素が最後尾に追加されることが事前にわかっているので、fm.end()をヒントとして与える + fm.emplace_hint(fm.end(), 2, 'B'); + + for (const auto& [key, value] : fm) { + std::cout << key << " : " << value << std::endl; + } +} +``` +* emplace_hint[color ff0000] +* fm.emplace[link emplace.md] +* fm.end()[link end.md] + +### 出力 +``` +1 : A +2 : B +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +| 名前 | 説明 | +|--------------------------------------------------|--------------------| +| [`flat_multimap::insert`](insert.md) | 要素を挿入する | +| [`flat_multimap::insert_range`](insert_range.md) | Rangeを挿入する | +| [`flat_multimap::emplace`](emplace.md) | 要素を直接構築する | diff --git a/reference/flat_map/flat_multimap/empty.md b/reference/flat_map/flat_multimap/empty.md new file mode 100644 index 0000000000..8c8ca362a3 --- /dev/null +++ b/reference/flat_map/flat_multimap/empty.md @@ -0,0 +1,60 @@ +# empty +* flat_map[meta header] +* std[meta namespace] +* flat_multimap[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +[[nodiscard]] bool empty() const noexcept; // (1) C++23 +``` + +## 概要 +コンテナが空かどうかをテストする。 +コンテナが空([`size()`](size.md) が 0)の場合に `true` を返す。 + +この関数はコンテナ内のコンテンツを変化させない。コンテンツをクリアするには [`clear()`](clear.md) メンバ関数を使用する。 + + +## 戻り値 +コンテナサイズが 0 のときに `true`, そうでないときに `false` を返す。 + + +## 計算量 +定数時間。 + + +## 例 +```cpp example +#include +#include + +int main () +{ + std::flat_multimap fm; + + std::cout << fm.empty() << std::endl; + + fm.insert({42, 'a'}); + + std::cout << fm.empty() << std::endl; +} +``` +* empty()[color ff0000] +* fm.insert[link insert.md] + +### 出力 +``` +1 +0 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + diff --git a/reference/flat_map/flat_multimap/end.md b/reference/flat_map/flat_multimap/end.md new file mode 100644 index 0000000000..b3df377d97 --- /dev/null +++ b/reference/flat_map/flat_multimap/end.md @@ -0,0 +1,82 @@ +# end +* flat_map[meta header] +* std[meta namespace] +* flat_multimap[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +iterator end() noexcept; +const_iterator end() const noexcept; +``` + +## 概要 +コンテナの末尾の次を参照するイテレータを取得する。 + + +## 戻り値 +コンテナの最後の要素の次を参照するイテレータ。 +`iterator` と `const_iterator` はいずれもメンバ型である。`flat_multimap` クラステンプレートにおいて、これらはランダムアクセスイテレータである。 + + +## 計算量 +定数時間 + + +## 備考 +- この関数によって返されるイテレータは、`*this`が保持するいずれの要素も参照しない。その指す先は、不正な範囲となるだろう + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_multimap fm = { + {10, 'A'}, {11, 'B'}, {12, 'C'}, + {10, 'a'}, {11, 'b'}, {12, 'c'}, + }; + + for (auto i = fm.begin(); i != fm.end(); ++i) { + std::cout << i->first << " " << i->second << "\n"; + } +} +``` +* end()[color ff0000] +* fm.begin()[link begin.md] + +### 出力 +``` +1 A +2 B +3 C +4 D +5 E +6 F +7 G +8 H +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|----------------------------------------|-------------------------------------------| +| [`flat_multimap::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`flat_multimap::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`flat_multimap::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`flat_multimap::rbegin`](rbegin.md) | 末尾の次を指す逆イテレータを取得する | +| [`flat_multimap::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`flat_multimap::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | +| [`flat_multimap::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | diff --git a/reference/flat_map/flat_multimap/equal_range.md b/reference/flat_map/flat_multimap/equal_range.md new file mode 100644 index 0000000000..4d0d883f2f --- /dev/null +++ b/reference/flat_map/flat_multimap/equal_range.md @@ -0,0 +1,85 @@ +# equal_range +* flat_map[meta header] +* std[meta namespace] +* flat_multimap[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +pair equal_range(const key_type& x); // (1) C++23 + +template +pair equal_range(const K& x); // (2) C++23 + +pair + equal_range(const key_type& x) const; // (3) C++23 + +template +pair + equal_range(const K& x) const; // (4) C++23 +``` +* pair[link /reference/utility/pair.md] + +## 概要 +コンテナ内の、`x` と等しいキー要素を全て含む範囲の境界を返す。 + +もし `x` がコンテナ内のどのキーともマッチしなかった場合、戻り値の範囲は長さ 0 になり、両方のイテレータは `x` より大きく最も近い値を指す。そうでない場合、`x` がコンテナ内の全ての要素よりも大きい場合は [`end()`](end.md) を指す。 + +- (1) : `key_type`型のキーを受け取り、そのキーと等価なキー要素を全て含むイテレータ範囲を取得する。 +- (2) : `key_type`と比較可能な`K`型のキーを受け取り、そのキーと等価なキー要素を全て含むイテレータ範囲を取得する。 +- (3) : `const`な`*this`オブジェクトにおいて、`key_type`型のキーを受け取り、そのキーと等価なキー要素を全て含むイテレータ範囲を取得する。 +- (4) : `const`な`*this`オブジェクトにおいて、`key_type`と比較可能な`K`型のキーを受け取り、そのキーと等価なキー要素を全て含むイテレータ範囲を取得する。 + + +## 戻り値 +この関数は `pair` を返す。ここで `pair::first` は [`lower_bound()`](lower_bound.md)`(x)` が返すであろう値と同じ値で範囲の下境界にあたり、`pair::second` は [`upper_bound()`](upper_bound.md)`(x)` が返すであろう値と同じ値で範囲の上境界にあたる。 + + +## 計算量 +[`size()`](size.md) について対数時間。 + + +## 備考 +- (2), (4) : この関数がオーバーロード解決に参加する条件は、[`find()`](find.md)メンバ関数の備考欄を参照。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::flat_multimap fm = { + {"A", 3}, + {"B", 1}, + {"B", 4}, + {"C", 5} + }; + + using iterator = decltype(fm)::iterator; + std::pair ret = fm.equal_range("B"); + + for (iterator it = ret.first; it != ret.second; ++it) { + std::cout << it->first << ", " << it->second << std::endl; + } +} +``` +* equal_range[color ff0000] + +### 出力 +``` +B, 1 +B, 4 +``` + + +## 関連項目 +| 名前 | 説明 | +|------------------------------------------------|----------------------------------------------------------| +| [`flat_multimap::count`](count.md) | 指定したキーにマッチする要素の数を返す | +| [`flat_multimap::lower_bound`](lower_bound.md) | 与えられた値より小さくない最初の要素へのイテレータを返す | +| [`flat_multimap::upper_bound`](upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | +| [`flat_multimap::find`](find.md) | 指定したキーで要素を探す | + diff --git a/reference/flat_map/flat_multimap/erase.md b/reference/flat_map/flat_multimap/erase.md new file mode 100644 index 0000000000..b40d206152 --- /dev/null +++ b/reference/flat_map/flat_multimap/erase.md @@ -0,0 +1,146 @@ +# erase +* flat_map[meta header] +* std[meta namespace] +* flat_multimap[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +iterator erase(iterator position); // (1) C++23 + +iterator erase(const_iterator position); // (2) C++23 + +size_type erase(const key_type& x); // (3) C++23 + +template +size_type erase(K&& x); // (4) C++23 + +iterator erase(const_iterator first, const_iterator last); // (5) C++23 +``` + +## 概要 +単一要素またはイテレータ範囲`[first, last)`を コンテナから削除する。 + +これは削除された要素の数だけコンテナの `size` を減らし、それぞれの要素のデストラクタを呼び出す。 + +- (1) : 指定されたイテレータが指す要素を削除する +- (2) : 指定された読み取り専用イテレータが指す要素を削除する +- (3) : 指定されたキーをもつ要素を削除する +- (4) : `key_type`と比較可能な`K`型のキーを受け取って要素を削除する +- (5) : 指定されたイテレータ範囲の要素をすべて削除する + + +## パラメータ +- `position` : 削除する単一要素を指すイテレータ。`iterator` はメンバ型であり、双方向イテレータとして定義される。 +- `x` : 削除する値のキー。`key_type` はメンバ型であり、コンテナの中で `Key` の別名として定義される。ここで `Key` は 1 番目のテンプレートパラメータであり、コンテナに格納される要素のキーの型である。 +- `first, last` : 削除するイテレータ範囲 `[first, last)` を指定するイテレータ。ここでいう範囲は `first` と `last` の間の全ての要素を含み、`first` が指す要素を含むが `last` が指す要素は含まない。 + + +## 戻り値 +- (1), (2), (5) : 削除された要素の次を指すイテレータを返す。そのような要素がない場合、[`end()`](end.md)を返す (要素を削除した結果としてコンテナが空になった場合) +- (3), (4) : 削除された要素の数を返す。 + + +## 計算量 +- (1), (2) : 定数時間 +- (3), (4) : コンテナの [`size()`](size.md) について対数時間に加えて、`count(x)` について線形時間 +- (5) : コンテナの [`size()`](size.md) について対数時間、それに加えて `first` と `last` の間の距離に対する線形時間 + + +## 備考 +- (1), (2) : この関数に、範囲外のイテレータ (終端イテレータを含む) を指定した場合の動作は未定義 + + +## 例 +### 基本的な使い方 (C++23) +```cpp example +#include +#include + +int main() +{ + std::flat_multimap fm = { + {1, 'A'}, + {2, 'B'}, + {3, 'C'} + }; + + std::cout << fm.size() << std::endl; + + fm.erase(1); + std::cout << fm.size() << std::endl; + + fm.erase(fm.begin(), fm.end()); + std::cout << fm.size() << std::endl; +} +``` +* erase[color ff0000] +* fm.size()[link size.md] +* fm.begin()[link begin.md] +* fm.end()[link end.md] + +#### 出力 +``` +3 +2 +0 +``` + +### イテレート中に要素を削除する (C++23) +```cpp example +#include +#include + +int main() +{ + std::flat_multimap fm = { + {3, 'a'}, + {1, 'b'}, + {4, 'c'} + }; + + // イテレート中に要素削除をするような場合には、 + // 範囲for文は使用できない + for (auto it = fm.begin(); it != fm.end();) { + // 条件一致した要素を削除する + if (it->first == 1) { + // 削除された要素の次を指すイテレータが返される。 + it = fm.erase(it); + } + // 要素削除をしない場合に、イテレータを進める + else { + ++it; + } + } + + for (const auto& [key, value] : fm) { + std::cout << key << ':' << value << std::endl; + } +} +``` + +#### 出力 +``` +3:a +4:c +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|--------------------------------------|----------------------| +| [`flat_multimap::clear`](clear.md) | 全ての要素を削除する | +| [`flat_multimap::insert`](insert.md) | 要素を挿入する | +| [`flat_multimap::find`](find.md) | 指定したキーで要素を探す | + diff --git a/reference/flat_map/flat_multimap/erase_if_free.md b/reference/flat_map/flat_multimap/erase_if_free.md new file mode 100644 index 0000000000..4cc6051de1 --- /dev/null +++ b/reference/flat_map/flat_multimap/erase_if_free.md @@ -0,0 +1,87 @@ +# erase_if +* flat_map[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template + typename flat_multimap::size_type + erase_if(flat_multimap& c, + Predicate pred); +} +``` + +## 概要 +指定した条件に合致する要素とその分の領域を、コンテナから削除する。 + +述語関数オブジェクトには、キーではなく、要素全体 (キーと値の[`pair`](/reference/utility/pair.md)) が渡されるので注意。 + + +## 事前条件 +- `Key`と`T`がムーブ代入可能であること + + +## 効果 +メンバ変数として保持しているコンテナ`c`の各要素`e`について、`bool(pred(pair(e)))`を`E`として、`E`が`true`であるすべての要素を削除する。 + + +## 戻り値 +削除した要素数を返す。 + + +## 計算量 +正確に[`size()`](size.md)回だけ述語適用する。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::flat_multimap fm = { + {"A", 3}, + {"B", 1}, + {"B", 4}, + {"C", 5} + }; + + // コンテナfmから、キーが"B"の要素をすべて削除する + auto num = std::erase_if(fm, [](const auto& x) { return x.first == "B"; }); + + std::cout << num << std::endl + << std::endl; + + for (const auto& [key, value] : fm) { + std::cout << key << " : " << value << std::endl; + } +} +``` +* std::erase_if[color ff0000] + +### 出力 +``` +2 + +A : 3 +C : 5 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + diff --git a/reference/flat_map/flat_multimap/extract.md b/reference/flat_map/flat_multimap/extract.md new file mode 100644 index 0000000000..2ca6df2a4e --- /dev/null +++ b/reference/flat_map/flat_multimap/extract.md @@ -0,0 +1,90 @@ +# extract +* flat_map[meta header] +* std[meta namespace] +* flat_multimap[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +containers extract() &&; // C++23 +``` + +## 概要 +キーのコンテナ、値のコンテナを戻り値として返す。 + + +## 戻り値 +クラス内部のデータ保持形式である [`containers`](containers.md) オブジェクト。 + + +## 事後条件 +呼び出し側の `flat_multimap` は空になる(たとえ例外で関数が中断されたとしても)。 + + +## 計算量 +定数時間。 + + +## 備考 +本関数は右辺値修飾されているので、右辺値からのみ読み出し可能である。 + + +## 例 +```cpp example +#include +#include +#include +#include + +int main() +{ + std::flat_multimap fm = { + {"Alice", 3}, + {"Bob", 1}, + {"Carol", 4} + }; + + std::cout << fm.size() << std::endl; + + decltype(fm)::containers c = std::move(fm).extract(); + + std::cout << fm.size() << std::endl; + std::cout << std::endl; + + auto k = c.keys.cbegin(); + auto v = c.values.cbegin(); + std::cout << "{" << std::endl; + for (; k != c.keys.cend() && v != c.values.cend(); ++k, ++v) { + std::cout << " " << *k << ": " << *v << "," << std::endl; + } + std::cout << "}" << std::endl; +} +``` +* extract()[color ff0000] +* fm.size()[link size.md] + +### 出力 +``` +3 +0 + +{ + Alice: 3, + Bob: 1, + Carol: 4, +} +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`containers`](containers.md) diff --git a/reference/flat_map/flat_multimap/find.md b/reference/flat_map/flat_multimap/find.md new file mode 100644 index 0000000000..c5e14d6c59 --- /dev/null +++ b/reference/flat_map/flat_multimap/find.md @@ -0,0 +1,108 @@ +# find +* flat_map[meta header] +* std[meta namespace] +* flat_multimap[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +iterator find(const key_type& x); // (1) C++23 + +template +iterator find(const K& x); // (2) C++23 + +const_iterator find(const key_type& x) const; // (3) C++23 + +template +const_iterator find(const K& x) const; // (4) C++23 +``` + +## 概要 +`x`と等価なキーの要素を検索する。 + +- (1), (3) : クラスのテンプレートパラメータ`key_type`型のキーを受け取って検索する。 +- (2), (4) : `key_type`と比較可能な`K`型のキーを受け取って検索する。 + + +## テンプレートパラメータ制約 +- (2), (4) : `key_compare::is_transparent`が妥当な式であること + + +## 戻り値 +- (1), (3) : `x`と等価なキーの要素が見つかった場合は、見つかった要素へのイテレータを返す。そうでない場合は、 [`end()`](end.md) を返す。 +- (2), (4) : `key_compare`型の関数オブジェクトを`c`、コンテナ内の各要素が持つキーを`k`として、キーが等価か判定する式`!c(k, x) && !c(x, k)`が`true`となる要素へのイテレータを返す。そのような要素がない場合は、[`end()`](end.md) を返す。 +等価となる要素が複数ある場合、そのうちのいずれかの要素へのイテレータを返す。 + + +## 計算量 +[`size()`](size.md) について対数時間。 + + +## 備考 +- (2), (4) : + - `is_transparent`は、標準ライブラリの[`std::less`](/reference/functional/less.md)、[`std::greater`](/reference/functional/greater.md)といった関数オブジェクトの、`void`に対する特殊化で定義される。それ以外のテンプレートパラメータで`is_transparent`が定義されないのは、互換性のためである。 + - これらのオーバーロードは、`flat_multimap`のようなコンテナに対し、検索操作で文字列リテラルを渡した際に、キー型の一時オブジェクトが生成されるコストを減らすためにある。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + // (1) + { + std::flat_multimap fm = { + {"Alice", 3}, + {"Bob", 1}, + {"Carol", 4} + }; + + decltype(fm)::iterator it = fm.find("Bob"); + if (it != fm.end()) { // 見つかった + std::cout << it->second << std::endl; + } + } + + // (2) + { + std::flat_multimap> fm = { + {"Alice", 3}, + {"Bob", 1}, + {"Carol", 4} + }; + + // std::lessのvoidに対する特殊化を使用することで、 + // 文字列リテラルをfind()関数の引数として渡した際に、 + // std::string型の一時オブジェクトが生成されない。 + decltype(fm)::iterator it = fm.find("Bob"); + if (it != fm.end()) { // 見つかった + std::cout << it->second << std::endl; + } + } +} +``` +* find[color ff0000] +* std::less[link /reference/functional/less.md] + +### 出力 +``` +1 +1 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`contains()`](contains.md) diff --git a/reference/flat_map/flat_multimap/insert.md b/reference/flat_map/flat_multimap/insert.md new file mode 100644 index 0000000000..08e944b5fc --- /dev/null +++ b/reference/flat_map/flat_multimap/insert.md @@ -0,0 +1,226 @@ +# insert +* flat_map[meta header] +* std[meta namespace] +* flat_multimap[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +iterator insert(const value_type& x); // (1) C++23 +iterator insert(value_type&& x); // (2) C++23 + +iterator insert(const_iterator position, + const value_type& x); // (3) C++23 +iterator insert(const_iterator position, + value_type&& x); // (4) C++23 + +template +iterator insert(P&& x); // (5) C++23 + +template +iterator insert(const_iterator position, + P&&); // (6) C++23 + +template +void insert(InputIterator first, + InputIterator last); // (7) C++23 + +template +void insert(sorted_equivalent_t, + InputIterator first, + InputIterator last); // (8) C++23 + +void insert(initializer_list il); // (9) C++23 + +void insert(sorted_equivalent_t, + initializer_list il); // (10) C++23 +``` +* initializer_list[link /reference/initializer_list/initializer_list.md] +* sorted_equivalent_t[link /reference/flat_map/sorted_equivalent_t.md] + +## 概要 +新しく一つの要素(引数 `x` を使う)または要素のシーケンス(入力イテレータまたは `initializer_list` を使う)を挿入し、コンテナを拡張する。 + +これは、挿入された要素の数だけコンテナの [`size()`](size.md) を増やす。 + +内部的に `flat_multimap` コンテナは、コンストラクト時に指定された比較オブジェクトによって要素を下位から上位へとソートして保持する。 + +この操作は、適切な引数 `position` を提供することで効率を飛躍的に改善することができる。 + +- (1) : 単一要素を挿入する +- (2) : 単一要素の一時オブジェクトを挿入する +- (3) : 指定された位置に、単一要素を挿入する +- (4) : 指定された位置に、単一要素の一時オブジェクトを挿入する +- (5) : 単一要素として要素型`value_type`のコンストラクタ引数を受け取って挿入する +- (6) : 指定された位置に、要素型`value_type`のコンストラクタ引数を受け取って挿入する +- (7) : イテレータ範囲`[first, last)`を挿入する +- (8) : ソート済みのイテレータ範囲`[first, last)`を挿入する +- (9) : 初期化子リストを挿入する +- (10) : ソート済みの初期化子リストを挿入する + + +## 要件 +- (5), (6) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)`<`[`pair`](/reference/utility/pair.md)`, P>`が`true`であること + + +## 効果 +- (1) : + ```cpp + return emplace(x); + ``` + * emplace[link emplace.md] + +- (2) : + ```cpp + return emplace(std::move(x)); + ``` + * emplace[link emplace.md] + * move[link /reference/utility/move.md] + +- (3) : + ```cpp + return emplace_hint(position, x); + ``` + * emplace_hint[link emplace_hint.md] + +- (4) : + ```cpp + return emplace_hint(position, std::move(x)); + ``` + * emplace_hint[link emplace_hint.md] + * move[link /reference/utility/move.md] + +- (5) : 以下と等価: + ```cpp + return emplace(std::forward

(x)); + ``` + * emplace[link emplace.md] + * forward[link /reference/utility/forward.md] + +- (6) : 以下と等価: + ```cpp + return emplace_hint(position, std::forward

(x));. + ``` + * emplace_hint[link emplace_hint.md] + * forward[link /reference/utility/forward.md] + +- (7) : メンバ変数として保持しているコンテナ`c`に、以下のように挿入する: + ```cpp + for (; first != last; ++first) { + value_type value = *first; + c.keys.insert(c.keys.end(), std::move(value.first)); + c.values.insert(c.values.end(), std::move(value.second)); + } + ``` + * c.keys[link containers.md] + * c.values[link containers.md] + * end()[link /reference/vector/vector/end.md] + * insert[link /reference/vector/vector/insert.md] + * std::move[link /reference/utility/move.md] + * first[link /reference/utility/pair.md] + * second[link /reference/utility/pair.md] + + - 次に、新しく挿入された要素の範囲を`value_comp()`を基準にソートする + - 次に、ソートされた結果の範囲と、既存の要素のソートされた範囲をひとつのソートされた範囲にマージする + +- (8) : メンバ変数として保持しているコンテナ`c`に、以下のように挿入する: + ```cpp + for (; first != last; ++first) { + value_type value = *first; + c.keys.insert(c.keys.end(), std::move(value.first)); + c.values.insert(c.values.end(), std::move(value.second)); + } + ``` + * c.keys[link containers.md] + * c.values[link containers.md] + * end()[link /reference/vector/vector/end.md] + * insert[link /reference/vector/vector/insert.md] + * std::move[link /reference/utility/move.md] + * first[link /reference/utility/pair.md] + * second[link /reference/utility/pair.md] + + - 次に、ソートされた結果の範囲と、既存の要素のソートされた範囲をひとつのソートされた範囲にマージする + +- (9) : + ```cpp + insert(il.begin(), il.end()); + ``` + +- (10) : + ```cpp + insert(s, il.begin(), il.end()); + ``` + + +## 戻り値 +- (1)-(6) : 挿入された要素へのイテレータ +- (7)-(10) : なし + + +## 計算量 +- (7) : Nをこの操作の前の[`size()`](size.md)、Mを[`distance`](/reference/iterator/distance.md)`(first, last)`として、N + MlogM +- (8) : Nをこの操作のあとの[`size()`](size.md)として、Nに対して線形 + + +## 備考 +- (7), (8) : この操作はインプレース・マージを行うため、追加のメモリ確保を行う可能性がある + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_multimap fm; + + // 単一要素を挿入する + fm.insert(std::pair{3, 'a'}); + fm.insert({3, 'a'}); + + std::flat_multimap fm2 = { + {5, 'd'}, + {15, 'e'} + }; + + // シーケンスを挿入する + fm.insert(fm2.begin(), fm2.end()); + + // 挿入するシーケンスがソート済みであることがわかっている場合、 + // 以下のように指定した方が高速になる + fm.insert(std::sorted_equivalent, fm2.begin(), fm2.end()); + + for (const auto& [key, value] : fm) { + std::cout << key << " : " << value << std::endl; + } +} +``` +* insert[color ff0000] +* begin()[link begin.md] +* end()[link end.md] +* std::sorted_equivalent[link /reference/flat_map/sorted_equivalent_t.md] + +### 出力 +``` +3 : a +3 : a +5 : d +5 : d +15 : e +15 : e +``` + +## バージョン +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +| 名前 | 説明 | +|--------------------------------------------------|----------------------------------| +| [`flat_multimap::insert_range`](insert_range.md) | Rangeを挿入する | +| [`flat_multimap::emplace`](emplace.md) | 要素を直接構築する | +| [`flat_multimap::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | diff --git a/reference/flat_map/flat_multimap/insert_range.md b/reference/flat_map/flat_multimap/insert_range.md new file mode 100644 index 0000000000..154da00c08 --- /dev/null +++ b/reference/flat_map/flat_multimap/insert_range.md @@ -0,0 +1,99 @@ +# insert_range +* flat_map[meta header] +* std[meta namespace] +* flat_multimap[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +template R> +void insert_range(R&& rg); // (1) C++23 +``` +* container-compatible-range[link /reference/exposition-only/container-compatible-range.md] + +## 概要 +Rangeを挿入し、コンテナを拡張する。 + +これは、挿入された要素の数だけコンテナの [`size()`](size.md) を増やす。 + +内部的に `flat_multimap` コンテナは、コンストラクト時に指定された比較オブジェクトによって要素を下位から上位へとソートして保持する。 + + +## 効果 +- メンバ変数として保持しているコンテナ`c`に、以下のように挿入する: + ```cpp + for (const auto& e : rg) { + c.keys.insert(c.keys.end(), e.first); + c.values.insert(c.values.end(), e.second); + } + ``` + * c.keys[link containers.md] + * c.values[link containers.md] + * end()[link /reference/vector/vector/end.md] + * insert[link /reference/vector/vector/insert.md] + * first[link /reference/utility/pair.md] + * second[link /reference/utility/pair.md] + + - 次に、新しく挿入された要素の範囲を`value_comp()`を基準にソートする + - 次に、ソートされた結果の範囲と、既存の要素のソートされた範囲をひとつのソートされた範囲にマージする + + +## 戻り値 +なし + + +## 計算量 +- Nをこの操作の前の[`size()`](size.md)、Mを[`ranges::distance`](/reference/iterator/ranges_distance.md)`(rg)`として、N + MlogM + + +## 備考 +- この操作はインプレース・マージを行うため、追加のメモリ確保を行う可能性がある + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_multimap fm = { + {3, 'a'} + }; + + std::flat_multimap fm2 = { + {5, 'd'}, + {15, 'e'}, + {3, 'h'} + }; + + fm.insert_range(fm2); + + for (const auto& [key, value] : fm) { + std::cout << key << " : " << value << std::endl; + } +} +``` +* insert_range[color ff0000] + +### 出力 +``` +3 : a +3 : h +5 : d +15 : e +``` + +## バージョン +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +| 名前 | 説明 | +|--------------------------------------------------|----------------------------------| +| [`flat_multimap::insert`](insert.md) | 要素を挿入する | +| [`flat_multimap::emplace`](emplace.md) | 要素を直接構築する | +| [`flat_multimap::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | diff --git a/reference/flat_map/flat_multimap/key_comp.md b/reference/flat_map/flat_multimap/key_comp.md new file mode 100644 index 0000000000..a2d1dec6a0 --- /dev/null +++ b/reference/flat_map/flat_multimap/key_comp.md @@ -0,0 +1,65 @@ +# key_comp +* flat_map[meta header] +* std[meta namespace] +* flat_multimap[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +key_compare key_comp() const; // C++23 +``` + + +## 概要 +コンテナに関連づけられたキー比較用の関数オブジェクトを返す。このオブジェクトはコンテナ内の二つの要素のキー値を比較するために利用できる。 +この比較オブジェクトはオブジェクトの構築時に与えられ、関数へのポインタでも関数オブジェクトでも良い。いずれの場合でも、これは同じ型の 2 つの引数をとり、[狭義の弱順序](/reference/algorithm.md#strict-weak-ordering)に従って一つ目の引数が二つ目の引数より前のときに `true` を返し、そうでないときに `false` を返す。 + + +## 戻り値 +比較オブジェクト。`key_compare` はメンバ型であり、テンプレートパラメータ `Compare` の別名として定義される。 + + +## 計算量 +定数時間。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_multimap m; + std::flat_multimap::key_compare comp = m.key_comp(); + + std::cout << comp(1, 2) << std::endl; + std::cout << comp(3, 2) << std::endl; +} +``` +* key_comp()[color ff0000] + +### 出力 +``` +1 +0 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------------|----------------------------------------------------------| +| [`value_comp`](value_comp.md) | 要素比較用の関数オブジェクトを返す | +| [`value_compare`](value_compare.md) | 要素値のキー部分で大小関係を判定する二項述語の型 | diff --git a/reference/flat_map/flat_multimap/key_equiv.md b/reference/flat_map/flat_multimap/key_equiv.md new file mode 100644 index 0000000000..19e621bb0b --- /dev/null +++ b/reference/flat_map/flat_multimap/key_equiv.md @@ -0,0 +1,32 @@ +# key_equiv +* flat_map[meta header] +* std[meta namespace] +* flat_multimap[meta class] +* class[meta id-type] +* cpp23[meta cpp] + +```cpp +struct key_equiv { + key_equiv(key_compare c) : comp(c) { } + + bool operator()(const_reference x, const_reference y) const { + return !comp(x.first, y.first) && !comp(y.first, x.first); + } + + key_compare comp; +}; +``` + +## 概要 +要素をとってキーの等価比較を行う説明専用の関数オブジェクト。 + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + diff --git a/reference/flat_map/flat_multimap/keys.md b/reference/flat_map/flat_multimap/keys.md new file mode 100644 index 0000000000..5855b4c3d3 --- /dev/null +++ b/reference/flat_map/flat_multimap/keys.md @@ -0,0 +1,70 @@ +# keys +* flat_map[meta header] +* std[meta namespace] +* flat_multimap[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +const key_container_type& keys() const noexcept; // C++23 +``` + +## 概要 +キーのコンテナを取得する。 + + +## 戻り値 +`flat_multimap` クラス内部で保持しているキーのコンテナ。 + + +## 計算量 +定数時間 + + +## 例 +```cpp example +#include +#include +#include +#include + +int main() +{ + std::flat_multimap fm; + fm.insert({3, 'C'}); + fm.insert({1, 'A'}); + fm.insert({2, 'B'}); + fm.insert({1, 'a'}); + + static_assert(std::is_same_v&>); + + for (auto i : fm.keys()) { + std::cout << i << std::endl; + } +} +``` +* keys()[color ff0000] + +### 出力 +``` +1 +1 +2 +3 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|----------------------------------------|-------------------------------------------| +| [`flat_multimap::values`](values.md) | 値のコンテナを取得する | diff --git a/reference/flat_map/flat_multimap/lower_bound.md b/reference/flat_map/flat_multimap/lower_bound.md new file mode 100644 index 0000000000..949d284199 --- /dev/null +++ b/reference/flat_map/flat_multimap/lower_bound.md @@ -0,0 +1,119 @@ +# lower_bound +* flat_map[meta header] +* std[meta namespace] +* flat_multimap[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +iterator lower_bound(const key_type& x); // (1) C++23 + +template +iterator lower_bound(const K& x); // (2) C++23 + +const_iterator lower_bound(const key_type& x) const; // (3) C++23 + +template +const_iterator lower_bound(const K& x) const; // (4) C++23 +``` + +## 概要 +`x` を右辺とする `<` 演算が成り立たない最初の要素を指すイテレータを返す(コンテナの比較オブジェクトが使われる)。すなわちこれは `>=` 演算にあたる。 + +[`upper_bound()`](upper_bound.md) とは異なり、このメンバ関数は `x` より大きいだけでなく、`x` と等しい場合であってもその要素へのイテレータを返す。 + +内部的には `flat_multimap` コンテナ内の全ての要素は常に比較オブジェクトが定義する基準に沿って並んでいるため、この関数が返すいずれかの後に続く全ての要素が `x` より大きいか等しいことに注意。 + +- (1) : `key_type`型のキーを受け取り、そのキーより小さくない最初の要素へのイテレータを取得する。 +- (2) : `key_type`と比較可能な`K`型のキーを受け取り、そのキーより小さくない最初の要素へのイテレータを取得する。 +- (3) : `const`な`*this`オブジェクトにおいて、`key_type`型のキーを受け取り、そのキーより小さくない最初の要素へのイテレータを取得する。 +- (4) : `const`な`*this`オブジェクトにおいて、`key_type`と比較可能な`K`型のキーを受け取り、そのキーより小さくない最初の要素へのイテレータを取得する。 + + +## 戻り値 +- (1), (3) : コンテナ内で `x` を右辺とする `<` 演算が成り立たない最初の要素へのイテレータを返す。そのような要素がない場合は、[`end()`](end.md)を返す。 +- (2), (4) : `key_compare`型の関数オブジェクトを`c`、コンテナ内の各要素が持つキーを`k`として、キーが小さくないか判定する式`!c(k, x)`が`true`となる要素へのイテレータを返す。そのような要素がない場合は、[`end()`](end.md) を返す。 + + +## 計算量 +[`size()`](size.md) について対数時間。 + + +## 備考 +- (2), (4) : この関数がオーバーロード解決に参加する条件は、[`find()`](find.md)メンバ関数の備考欄を参照。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + // (1) + { + std::flat_multimap fm = { + {"A", 3}, + {"B", 1}, + {"C", 4}, + {"D", 5} + }; + + // B以上D以下の範囲を取得 + decltype(fm)::iterator it = fm.lower_bound("B"); + decltype(fm)::iterator last = fm.upper_bound("D"); + + while (it != last) { + std::cout << it->first << ',' << it->second << std::endl; + ++it; + } + std::cout << std::endl; + } + + // (2) + { + std::flat_multimap> fm = { + {"A", 3}, + {"B", 1}, + {"C", 4}, + {"D", 5} + }; + + // std::lessのvoidに対する特殊化を使用することで、 + // 文字列リテラルをlower_bound()関数の引数として渡した際に、 + // std::string型の一時オブジェクトが生成されない。 + decltype(fm)::iterator it = fm.lower_bound("B"); + decltype(fm)::iterator last = fm.upper_bound("D"); + + while (it != last) { + std::cout << it->first << "," << it->second << std::endl; + ++it; + } + } +} +``` +* lower_bound[color ff0000] +* fm.upper_bound[link upper_bound.md] +* std::less[link /reference/functional/less.md] + +### 出力 +``` +B,1 +C,4 +D,5 + +B,1 +C,4 +D,5 +``` + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------| +| [`upper_bound`](upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | +| [`equal_range`](equal_range.md) | 指定したキーにマッチする要素範囲を返す | +| [`find`](find.md) | 指定したキーで要素を探す | +| [`count`](count.md) | 指定したキーにマッチする要素の数を返す | + diff --git a/reference/flat_map/flat_multimap/max_size.md b/reference/flat_map/flat_multimap/max_size.md new file mode 100644 index 0000000000..28e28d83a5 --- /dev/null +++ b/reference/flat_map/flat_multimap/max_size.md @@ -0,0 +1,57 @@ +# max_size +* flat_map[meta header] +* std[meta namespace] +* flat_multimap[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +size_type max_size() const noexcept; // (1) C++23 +``` + +## 概要 +コンテナが格納できる要素の最大数を返す。 +これは、システムやライブラリ実装の制限のもとでコンテナが格納できる潜在的な最大サイズである。 + + +## 戻り値 +[`containers`](containers.md)型メンバ変数`c`があるとして、以下を返す。 + +```cpp +return min(c.keys.max_size(), c.values.max_size()); +``` +* min[link /reference/algorithm/min.md] +* max_size()[link /reference/vector/vector/max_size.md] + + +## 計算量 +定数時間。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_multimap fm; + + std::cout << fm.max_size() << std::endl; +} +``` +* max_size()[color ff0000] + +### 出力例 +``` +178956970 +``` + +## 言語バージョン +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + diff --git a/reference/flat_map/flat_multimap/op_assign.md b/reference/flat_map/flat_multimap/op_assign.md new file mode 100644 index 0000000000..6d2075467d --- /dev/null +++ b/reference/flat_map/flat_multimap/op_assign.md @@ -0,0 +1,76 @@ +# operator= +* flat_map[meta header] +* std[meta namespace] +* flat_multimap[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +flat_multimap& operator=(initializer_list il); // C++23 +``` +* initializer_list[link /reference/initializer_list/initializer_list.md] + + +## 概要 +初期化子リストの値を代入する。 + + +## 効果 +`*this`の全ての要素が解放され、`il`の全ての要素が`*this`にコピー代入される。 + + +## 戻り値 +`*this` + + +## 備考 +- 引数の型が `const flat_multimap&` であるコピー代入演算子と、引数の型が `flat_multimap&&` であるムーブ代入演算子は、それぞれ自動生成される。 + + +## 例 +```cpp example +#include +#include +#include +#include + +void print(const std::flat_multimap& fm) +{ + std::cout << "{" << std::endl; + for (const auto& kv: fm) { + std::cout << " " << kv.first << ": " << kv.second << "," << std::endl; + } + std::cout << "}" << std::endl; +} + +int main() +{ + std::initializer_list> elems = {{"Alice", 3}, {"Bob", 1}, {"Carol", 4}, {"Alice", 1}}; + + std::flat_multimap fm; + fm = elems; + + print(fm); +} +``` + +### 出力 +``` +{ + Alice: 3, + Alice: 1, + Bob: 1, + Carol: 4, +} +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/flat_map/flat_multimap/op_compare_3way.md b/reference/flat_map/flat_multimap/op_compare_3way.md new file mode 100644 index 0000000000..bc01674f6e --- /dev/null +++ b/reference/flat_map/flat_multimap/op_compare_3way.md @@ -0,0 +1,90 @@ +# operator<=> +* flat_map[meta header] +* std[meta namespace] +* function template[meta id-type] +* flat_multimap[meta class] +* cpp23[meta cpp] + +```cpp +synth-three-way-result + operator<=>(const flat_multimap& x, + const flat_multimap& y); // (1) C++23 +``` + +## 概要 +`flat_multimap`オブジェクトの三方比較を行う。 + + +## テンプレートパラメータ制約 +- 型 (`const`) `value_type` の値に対して`operator<=>`が定義されるか、型 (`const`) `value_type` の値に対して`operator<`が定義され全順序をもつこと + + +## 効果 +```cpp +return lexicographical_compare_three_way( + x.begin(), x.end(), + y.begin(), y.end(), + synth-three-way); +``` +* lexicographical_compare_three_way[link /reference/algorithm/lexicographical_compare_three_way.md] +* begin()[link begin.md] +* end()[link end.md] + + +## 計算量 +線形時間 + + +## 備考 +- この演算子により、以下の演算子が使用可能になる: + - `operator<` + - `operator<=` + - `operator>` + - `operator>=` + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_multimap fm1 = { + {3, 'a'}, + {1, 'b'}, + {4, 'c'} + }; + + std::flat_multimap fm2 = { + {3, 'a'}, + {1, 'b'}, + }; + + std::cout << std::boolalpha; + std::cout << ((fm1 <=> fm1) == 0) << std::endl; + std::cout << (fm1 < fm2) << std::endl; + std::cout << (fm1 <= fm1) << std::endl; + std::cout << (fm1 > fm2) << std::endl; + std::cout << (fm2 >= fm1) << std::endl; +} +``` + +### 出力 +``` +true +false +true +true +false +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + diff --git a/reference/flat_map/flat_multimap/op_constructor.md b/reference/flat_map/flat_multimap/op_constructor.md new file mode 100644 index 0000000000..dce58a13d1 --- /dev/null +++ b/reference/flat_map/flat_multimap/op_constructor.md @@ -0,0 +1,271 @@ +# コンストラクタ +* flat_map[meta header] +* std[meta namespace] +* flat_multimap[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +// ____要素数ゼロのflat_multimapを構築____ + +flat_multimap() : flat_multimap(key_compare()) { } // (1) C++23 + +explicit flat_multimap(const key_compare& comp) // (2) C++23 + : c(), compare(comp) { } + +template +explicit flat_multimap(const Allocator& a); // (3) C++23 + +template +flat_multimap(const key_compare& comp, const Allocator& a); // (4) C++23 + +// ____アロケータを伴うコピー&ムーブコンストラクタ____ + + template + flat_multimap(const flat_multimap& x, const Allocator& a); // (5) C++26 + + template + flat_multimap(flat_multimap&& x, const Allocator& a); // (6) C++26 + +// ____key_container_typeとmapped_container_typeから構築____ + +flat_multimap(key_container_type key_cont, mapped_container_type mapped_cont, + const key_compare& comp = key_compare()); // (7) C++23 + +template +flat_multimap(const key_container_type& key_cont, const mapped_container_type& mapped_cont, + const Allocator& a); // (8) C++23 + +template +flat_multimap(const key_container_type& key_cont, const mapped_container_type& mapped_cont, + const key_compare& comp, const Allocator& a); // (9) C++23 + +// ____key_container_typeとmapped_container_type(共にソート済み)から構築____ + +flat_multimap(sorted_equivalent_t, key_container_type key_cont, mapped_container_type mapped_cont, + const key_compare& comp = key_compare()); // (10) C++23 + +template +flat_multimap(sorted_equivalent_t, const key_container_type& key_cont, + const mapped_container_type& mapped_cont, const Allocator& a); // (11) C++23 + +template +flat_multimap(sorted_equivalent_t, const key_container_type& key_cont, + const mapped_container_type& mapped_cont, + const key_compare& comp, const Allocator& a); // (12) C++23 + +// ____イテレータから構築____ + +template +flat_multimap(InputIterator first, InputIterator last, const key_compare& comp = key_compare()) // (13) C++23 + : c(), compare(comp) { insert(first, last); } + +template +flat_multimap(InputIterator first, InputIterator last, const Allocator& a); // (14) C++23 + +template +flat_multimap(InputIterator first, InputIterator last, + const key_compare& comp, const Allocator& a); // (15) C++23 + +// ____イテレータ(ソート済み)から構築____ + +template +flat_multimap(sorted_equivalent_t s, InputIterator first, InputIterator last, + const key_compare& comp = key_compare()) // (16) C++23 + : c(), compare(comp) { insert(s, first, last); } + +template +flat_multimap(sorted_equivalent_t, InputIterator first, InputIterator last, const Allocator& a); // (17) C++23 + +template +flat_multimap(sorted_equivalent_t, InputIterator first, InputIterator last, + const key_compare& comp, const Allocator& a); // (18) C++23 + +// ____Rangeから構築____ + +template R> +flat_multimap(from_range_t fr, R&& rg) // (19) C++23 + : flat_multimap(fr, forward(rg), key_compare()) { } + +template R> +flat_multimap(from_range_t, R&& rg, const key_compare& comp) // (20) C++23 + : flat_multimap(comp) { insert_range(forward(rg)); } + +template R, class Allocator> +flat_multimap(from_range_t, R&& rg, const Allocator& a); // (21) C++23 + +template R, class Allocator> +flat_multimap(from_range_t, R&& rg, const key_compare& comp, const Allocator& a); // (22) C++23 + +// ____initializer_listから構築____ + +flat_multimap(initializer_list il, const key_compare& comp = key_compare()) // (23) C++23 + : flat_multimap(il.begin(), il.end(), comp) { } + +template +flat_multimap(initializer_list il, const Allocator& a); // (24) C++23 + +template +flat_multimap(initializer_list il, const key_compare& comp, const Allocator& a); // (25) C++23 + +// ____initializer_list(ソート済み)から構築____ + +flat_multimap(sorted_equivalent_t s, initializer_list il, + const key_compare& comp = key_compare()) // (26) C++23 + : flat_multimap(s, il.begin(), il.end(), comp) { } + +template +flat_multimap(sorted_equivalent_t, initializer_list il, const Allocator& a); // (27) C++23 + +template +flat_multimap(sorted_equivalent_t, initializer_list il, + const key_compare& comp, const Allocator& a); // (28) C++23 +``` +* initializer_list[link /reference/initializer_list/initializer_list.md] +* from_range_t[link ../../ranges/from_range_t.md] +* sorted_equivalent_t[link ../sorted_equivalent_t.md] +* forward[link ../../utility/forward.md] +* insert[link insert.md] +* insert_range[link insert_range.md] + + +## 概要 +`flat_multimap`オブジェクトを次に示す通りの要素で初期化する。 + + +## 効果 +- (1) : デフォルトコンストラクタ。デフォルトの `key_compare` を作成し、要素を持たない空の `flat_multimap` オブジェクトを構築する。 +- (2) : `key_compare` を受け取り、要素を持たない空の `flat_multimap` オブジェクトを構築する。 +- (3) : アロケータを受け取り、要素を持たない空の `flat_multimap` オブジェクトを構築する。 +- (4) : `key_compare` とアロケータを受け取り、要素を持たない空の `flat_multimap` オブジェクトを構築する。 +- (5) : アロケータを受け取り、`flat_multimap` オブジェクトをコピー構築する。 +- (6) : アロケータを受け取り、`flat_multimap` オブジェクトをムーブ構築する。 +- (7) : `key_container_type` と `mapped_container_type` から `flat_multimap` オブジェクトを構築する。構築に際し、`value_compare` に基づきソートされる。 +- (8) : アロケータを受け取り、`key_container_type` と `mapped_container_type` から `flat_multimap` オブジェクトを構築する。構築に際し、`value_compare` に基づきソートされる。 +- (9) : `key_compare` とアロケータを受け取り、`key_container_type` と `mapped_container_type` から `flat_multimap` オブジェクトを構築する。構築に際し、`value_compare` に基づきソートされる。 +- (10) : `key_container_type` と `mapped_container_type`(共にソート済み)から `flat_multimap` オブジェクトを構築する。 +- (11) : アロケータを受け取り、`key_container_type` と `mapped_container_type`(共にソート済み)から `flat_multimap` オブジェクトを構築する。 +- (12) : `key_compare` とアロケータを受け取り、`key_container_type` と `mapped_container_type`(共にソート済み)から `flat_multimap` オブジェクトを構築する。 +- (13) : イテレータから `flat_multimap` オブジェクトを構築する。構築には [`insert()`](insert.md) が用いられる。 +- (14) : アロケータを受け取り、イテレータから `flat_multimap` オブジェクトを構築する。構築には [`insert()`](insert.md) が用いられる。 +- (15) : `key_compare` とアロケータを受け取り、イテレータから `flat_multimap` オブジェクトを構築する。構築には [`insert()`](insert.md) が用いられる。 +- (16) : イテレータ(ソート済み)から `flat_multimap` オブジェクトを構築する。 +- (17) : アロケータを受け取り、イテレータ(ソート済み)から `flat_multimap` オブジェクトを構築する。 +- (18) : `key_compare` とアロケータを受け取り、イテレータ(ソート済み)から `flat_multimap` オブジェクトを構築する。 +- (19) : Rangeから `flat_multimap` オブジェクトを構築する。構築には [`insert_range()`](insert_range.md) が用いられる。 +- (20) : `key_compare` を受け取り、Rangeから `flat_multimap` オブジェクトを構築する。構築には [`insert_range()`](insert_range.md) が用いられる。 +- (21) : アロケータを受け取り、Rangeから `flat_multimap` オブジェクトを構築する。構築には [`insert_range()`](insert_range.md) が用いられる。 +- (22) : `key_compare` とアロケータを受け取り、Rangeから `flat_multimap` オブジェクトを構築する。構築には [`insert_range()`](insert_range.md) が用いられる。 +- (23) : initializer_listから `flat_multimap` オブジェクトを構築する。構築には [`insert()`](insert.md) が用いられる。 +- (24) : アロケータを受け取り、initializer_listから `flat_multimap` オブジェクトを構築する。構築には [`insert()`](insert.md) が用いられる。 +- (25) : `key_compare` とアロケータを受け取り、initializer_listから `flat_multimap` オブジェクトを構築する。構築には [`insert()`](insert.md) が用いられる。 +- (26) : initializer_list(ソート済み)から `flat_multimap` オブジェクトを構築する。 +- (27) : アロケータを受け取り、initializer_list(ソート済み)から `flat_multimap` オブジェクトを構築する。 +- (28) : `key_compare` とアロケータを受け取り、initializer_list(ソート済み)から `flat_multimap` オブジェクトを構築する。 + + +## 計算量 +- (1)-(4) : 定数時間。 +- (5) : 引数 `x` のサイズに対して線形時間。 +- (6) : 引数 `x` の `containers` をムーブした計算量と同じ。 +- (7)-(9) : 引数 `key_cont` のサイズを `N` とすると、`key_cont` がソート済みなら `N` に対して線形時間。そうでなければ `N log(N)`。 +- (10)-(12) : 引数 `key_cont` および `mapped_cont` をムーブした計算量と同じ。 +- (13)-(15) : 引数 `first` と `last` の距離を `N` とすると、イテレータの値が `value_compare` に基づきソート済みなら `N` に対して線形時間。そうでなければ `N log(N)`。 +- (16)-(18) : 引数 `first` と `last` の距離を `N` とすると、`N` に対して線形時間。 +- (19)-(22) : [`ranges::distance`](../../iterator/ranges_distance.md)`(rg)` を `N` とすると、要素の値が `value_compare` に基づきソート済みなら `N` に対して線形時間。そうでなければ `N log(N)`。 +- (23)-(25) : 引数 `il` のサイズを `N` とすると、イテレータの値が `value_compare` に基づきソート済みなら `N` に対して線形時間。そうでなければ `N log(N)`。 +- (26)-(28) : 引数 `il` のサイズを `N` とすると、`N` に対して線形時間。 + + +## 備考 +- 通常の(アロケータを指定しない)コピーコンストラクタとムーブコンストラクタは自動生成される。 +- (7)-(12) において、引数の `key_cont` と `mapped_cont` のサイズが異なる場合の動作は定められていない。 +- (3)-(6), (8), (9), (11), (12), (14), (15), (17), (18), (21), (22), (24), (25), (27), (28) は引数としてアロケータを受け取るが、引数のアロケータに対して [`uses_allocator`](uses_allocator.md) が `false` であれば、この引数は無視される。 + + +## 例 +```cpp example +#include +#include +#include +#include + +void print(const std::flat_multimap& fm) +{ + std::cout << "{" << std::endl; + for (const auto& kv: fm) { + std::cout << " " << kv.first << ": " << kv.second << "," << std::endl; + } + std::cout << "}" << std::endl; +} + +int main() +{ + std::cout << "(1)" << std::endl; + { + std::flat_multimap fm; + print(fm); + } + std::cout << std::endl; + + std::cout << "(5)" << std::endl; + { + std::vector keys = {"Alice", "Bob", "Carol", "Alice"}; + std::vector values = {3, 1, 4, 1}; + + std::flat_multimap fm(keys, values); + print(fm); + } + std::cout << std::endl; + + std::cout << "(23)" << std::endl; + { + std::initializer_list> elems = {{"Alice", 3}, {"Bob", 1}, {"Carol", 4}, {"Alice", 1}}; + + std::flat_multimap fm(elems); + print(fm); + } + std::cout << std::endl; +} +``` + +### 出力 +``` +(1) +{ +} + +(5) +{ + Alice: 3, + Alice: 1, + Bob: 1, + Carol: 4, +} + +(23) +{ + Alice: 3, + Alice: 1, + Bob: 1, + Carol: 4, +} +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|---------------------------------------|--------------------------------------------| +| [`uses_allocator`](uses_allocator.md) | 指定されたアロケータと合致するかをチェックする | diff --git a/reference/flat_map/flat_multimap/op_equal.md b/reference/flat_map/flat_multimap/op_equal.md new file mode 100644 index 0000000000..41266b52ff --- /dev/null +++ b/reference/flat_map/flat_multimap/op_equal.md @@ -0,0 +1,73 @@ +# operator== +* flat_map[meta header] +* std[meta namespace] +* function template[meta id-type] +* flat_multimap[meta class] + +```cpp +friend bool operator==(const flat_multimap& x, const flat_multimap& y); +``` + +## 概要 +`x` が `y` と等しいかどうかの判定を行う。 + + +## 戻り値 +以下と等価: + +```cpp +return equal(x.begin(), x.end(), y.begin(), y.end()); +``` +* equal[link /reference/algorithm/equal.md] +* begin()[link begin.md] +* end()[link end.md] + + +## 計算量 +[`size()`](size.md) に対して線形時間。ただし、`x`と`y`のサイズが異なる場合は定数時間。 + + +## 備考 +- この演算子により、以下の演算子が使用可能になる: + - `operator!=` + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_multimap fm1 = { + {3, 'a'}, + {1, 'b'}, + {4, 'c'} + }; + + std::flat_multimap fm2 = { + {3, 'a'}, + {1, 'b'}, + }; + + std::cout << std::boolalpha; + std::cout << (fm1 == fm1) << std::endl; + std::cout << (fm1 == fm2) << std::endl; + std::cout << (fm1 != fm1) << std::endl; + std::cout << (fm1 != fm2) << std::endl; +} +``` + +### 出力 +``` +true +false +false +true +``` + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + diff --git a/reference/flat_map/flat_multimap/rbegin.md b/reference/flat_map/flat_multimap/rbegin.md new file mode 100644 index 0000000000..64d5f893b6 --- /dev/null +++ b/reference/flat_map/flat_multimap/rbegin.md @@ -0,0 +1,80 @@ +# rbegin +* flat_map[meta header] +* std[meta namespace] +* flat_multimap[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +reverse_iterator rbegin() noexcept; +const_reverse_iterator rbegin() const noexcept; +``` + +## 概要 +コンテナ内の末尾を指す逆イテレータを取得する。 + +内部的に、このコンテナは各要素をキーの値に従って下位から上位へと並べており、従って `rbegin()` は最上位のキーにあたる値を指すイテレータを返す。 +`rbegin()` は [`end()`](end.md) と同じ要素を指すわけではなく、その前の要素を指すことに注意。 + + +## 戻り値 +反転したシーケンスの先頭を指す逆イテレータ。 +`reverse_iterator` と `const_reverse_iterator` はともにメンバ型である。このクラステンプレートにおいて、これらは逆ランダムアクセスイテレータであり、それぞれ `reverse_iterator`, `reverse_iterator` と定義される。 + + +## 計算量 +定数時間。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_multimap fm = { + {10, 'A'}, {11, 'B'}, {12, 'C'}, + {10, 'a'}, {11, 'b'}, {12, 'c'}, + }; + + for (auto i = fm.rbegin(); i != fm.rend(); ++i) { + std::cout << i->first << " " << i->second << "\n"; + } +} +``` +* rbegin()[color ff0000] +* fm.rend()[link rend.md] + +### 出力 +``` +12 c +12 C +11 b +11 B +10 a +10 A +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|----------------------------------------|-----------------------------------------| +| [`flat_multimap::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`flat_multimap::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`flat_multimap::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`flat_multimap::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`flat_multimap::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`flat_multimap::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | +| [`flat_multimap::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + diff --git a/reference/flat_map/flat_multimap/rend.md b/reference/flat_map/flat_multimap/rend.md new file mode 100644 index 0000000000..7a5034691e --- /dev/null +++ b/reference/flat_map/flat_multimap/rend.md @@ -0,0 +1,73 @@ +# rend +* flat_map[meta header] +* std[meta namespace] +* flat_multimap[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +reverse_iterator rend() noexcept; +const_reverse_iterator rend() const noexcept; +``` + +## 概要 +コンテナの先頭要素の前(これは反転シーケンスの末尾にあたる)を指す逆イテレータを取得する。 +`rend()` は [`begin()`](begin.md) と同じ要素を指すわけではなく、その前の要素を指すことに注意。 + +## 戻り値 +反転シーケンスの終端を指す逆イテレータ。 +`reverse_iterator` と `const_reverse_iterator` はメンバ型である。このクラステンプレートにおいて、これらは逆ランダムアクセスイテレータであり、それぞれ `reverse_iterator`, `reverse_iterator` と定義される。 + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_multimap fm = { + {10, 'A'}, {11, 'B'}, {12, 'C'}, + {10, 'a'}, {11, 'b'}, {12, 'c'}, + }; + + for (auto i = fm.rbegin(); i != fm.rend(); ++i) { + std::cout << i->first << " " << i->second << "\n"; + } +} +``` +* rend()[color ff0000] +* fm.rbegin()[link rbegin.md] + +### 出力 +``` +12 c +12 C +11 b +11 B +10 a +10 A +``` + +## バージョン +### 言語 +- C++23 + + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|----------------------------------------|--------------------------------------------| +| [`flat_multimap::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`flat_multimap::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`flat_multimap::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`flat_multimap::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`flat_multimap::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | +| [`flat_multimap::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | +| [`flat_multimap::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + diff --git a/reference/flat_map/flat_multimap/replace.md b/reference/flat_map/flat_multimap/replace.md new file mode 100644 index 0000000000..8f08b3f028 --- /dev/null +++ b/reference/flat_map/flat_multimap/replace.md @@ -0,0 +1,93 @@ +# replace +* flat_map[meta header] +* std[meta namespace] +* flat_multimap[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +void replace(key_container_type&& key_cont, mapped_container_type&& mapped_cont); // C++23 +``` + +## 概要 +キーのコンテナ、値のコンテナをそれぞれ置き換える。 + + +## 効果 +`flat_multimap` クラスが内部で保持している [`containers`](containers.md) を `c` とすると、以下と等価。 + ```cpp + c.keys = std::move(key_cont); + c.values = std::move(mapped_cont) + ``` + + +## 事前条件 +- `key_cont.size() == mapped_cont.size()` が真であること。 +- `key_cont` が `key_compare` に基づいてソートされていること。 + + +## 計算量 +`key_cont` および `mapped_cont` をムーブした計算量と同じ。 + + +## 例 +```cpp example +#include +#include +#include +#include +#include +#include + +int main() +{ + std::vector keys = {"Alice", "Bob", "Carol"}; + std::vector values = {3, 1, 4}; + + // 事前条件の確認 + assert(keys.size() == values.size()); + assert(std::is_sorted(keys.begin(), keys.end())); + assert(std::adjacent_find(keys.begin(), keys.end()) == keys.end()); + + std::flat_multimap fm; + + std::cout << fm.size() << std::endl; + + fm.replace(std::move(keys), std::move(values)); + + std::cout << fm.size() << std::endl; + std::cout << std::endl; + + std::cout << "{" << std::endl; + for (const auto& kv: fm) { + std::cout << " " << kv.first << ": " << kv.second << "," << std::endl; + } + std::cout << "}" << std::endl; +} +``` +* replace[color ff0000] +* fm.size()[link size.md] +* std::is_sorted[link /reference/algorithm/is_sorted.md] +* std::adjacent_find[link /reference/algorithm/adjacent_find.md] + +### 出力 +``` +0 +3 + +{ + Alice: 3, + Bob: 1, + Carol: 4, +} +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/flat_map/flat_multimap/size.md b/reference/flat_map/flat_multimap/size.md new file mode 100644 index 0000000000..4c3e67b877 --- /dev/null +++ b/reference/flat_map/flat_multimap/size.md @@ -0,0 +1,69 @@ +# size +* flat_map[meta header] +* std[meta namespace] +* flat_multimap[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +size_type size() const noexcept; +``` + +## 概要 +コンテナ内の要素の数を返す。 + + +## 戻り値 +[`containers`](containers.md)型メンバ変数`c`があるとして、以下を返す。 + +```cpp +return c.keys.size(); +``` +* size()[link /reference/vector/vector/size.md] + + +## 計算量 +定数時間 + + +## 例 +```cpp example +#include +#include + +int main () +{ + std::flat_multimap fm; + + std::cout << fm.size() << std::endl; + + fm.insert({1, 'a'}); + fm.insert({2, 'b'}); + fm.insert({3, 'c'}); + fm.insert({1, 'a'}); + + std::cout << fm.size() << std::endl; +} +``` +* size()[color ff0000] +* fm.insert[link insert.md] + +### 出力 +``` +0 +4 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`empty()`](empty.md) diff --git a/reference/flat_map/flat_multimap/swap.md b/reference/flat_map/flat_multimap/swap.md new file mode 100644 index 0000000000..f985066b39 --- /dev/null +++ b/reference/flat_map/flat_multimap/swap.md @@ -0,0 +1,81 @@ +# swap +* flat_map[meta header] +* std[meta namespace] +* flat_multimap[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +void swap(flat_multimap& y) noexcept; // (1) C++23 +``` + +## 概要 +コンテナ内のコンテンツを、同じ型の要素を保持する他の `flat_multimap` オブジェクトである `y` 内のコンテンツと交換する。 + +このメンバ関数の呼び出しの後、呼び出し前にコンテナ内にあった要素は `y` へ、`y` 内にあった要素は `*this` へ移る。 + + +## 計算量 +定数時間 + + +## 例 +```cpp example +#include +#include + +template +void print(const char* name, const Map& m) +{ + std::cout << name << " : {"; + + bool first = true; + + for (const auto& x : m) { + if (first) { + first = false; + } + else { + std::cout << ", "; + } + std::cout << "[" << x.first << "," << x.second << "]"; + } + std::cout << "}" << std::endl; +} + +int main() +{ + std::flat_multimap fm1 = { + {10, 'a'}, + {20, 'b'}, + {30, 'c'} + }; + + std::flat_multimap fm2 = { + {5, 'd'}, + {15, 'e'} + }; + + // fm1とfm2を入れ替える + fm1.swap(fm2); + + print("fm1", fm1); + print("fm2", fm2); +} +``` + +### 出力 +``` +fm1 : {[5,d], [15,e]} +fm2 : {[10,a], [20,b], [30,c]} +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + diff --git a/reference/flat_map/flat_multimap/upper_bound.md b/reference/flat_map/flat_multimap/upper_bound.md new file mode 100644 index 0000000000..025c1e0bbc --- /dev/null +++ b/reference/flat_map/flat_multimap/upper_bound.md @@ -0,0 +1,119 @@ +# upper_bound +* flat_map[meta header] +* std[meta namespace] +* flat_multimap[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +iterator upper_bound(const key_type& x); // (1) C++23 + +template +iterator upper_bound(const K& x); // (2) C++23 + +const_iterator upper_bound(const key_type& x) const; // (3) C++23 + +template +const_iterator upper_bound(const K& x) const; // (4) C++23 +``` + +## 概要 +`x` より大きいキーを持つコンテナ内の最初の要素を指すイテレータを返す(コンテナの比較オブジェクトを使う)。 + +[`lower_bound()`](lower_bound.md) と異なり、このメンバ関数は `x` と等しいときは要素へのイテレータを返さず、それは大きい場合にのみ要素へのイテレータを返す。 + +内部的に、`flat_multimap` コンテナ内の全ての要素は常に比較オブジェクトで定義された基準に従って並ぶため、この関数が返す値に続く全ての要素は `x` より大きいことに注意。 + +- (1) : `key_type`型のキーを受け取り、そのキーより大きい最初の要素へのイテレータを取得する。 +- (2) : `key_type`と比較可能な`K`型のキーを受け取り、そのキーより大きい最初の要素へのイテレータを取得する。 +- (3) : `const`な`*this`オブジェクトにおいて、`key_type`型のキーを受け取り、そのキーより大きい最初の要素へのイテレータを取得する。 +- (4) : `const`な`*this`オブジェクトにおいて、`key_type`と比較可能な`K`型のキーを受け取り、そのキーより大きい最初の要素へのイテレータを取得する。 + + +## 戻り値 +- (1), (3) : キー`x`より大きい最初の要素へのイテレータを返す。そのような要素がない場合は、[`end()`](end.md)を返す。 +- (2), (4) : `key_compare`型の関数オブジェクトを`c`、コンテナ内の各要素が持つキーを`k`として、キーが小さくないか判定する式`c(x, k)`が`true`となる要素へのイテレータを返す。そのような要素がない場合は、[`end()`](end.md) を返す。 + + +## 計算量 +[`size()`](size.md) について対数時間。 + + +## 備考 +- (2), (4) : この関数がオーバーロード解決に参加する条件は、[`find()`](find.md)メンバ関数の備考欄を参照。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + // (1) + { + std::flat_multimap fm = { + {"A", 3}, + {"B", 1}, + {"C", 4}, + {"D", 5} + }; + + // B以上D以下の範囲を取得 + decltype(fm)::iterator it = fm.lower_bound("B"); + decltype(fm)::iterator last = fm.upper_bound("D"); + + while (it != last) { + std::cout << it->first << ',' << it->second << std::endl; + ++it; + } + std::cout << std::endl; + } + + // (2) + { + std::flat_multimap> fm = { + {"A", 3}, + {"B", 1}, + {"C", 4}, + {"D", 5} + }; + + // std::lessのvoidに対する特殊化を使用することで、 + // 文字列リテラルをlower_bound()関数の引数として渡した際に、 + // std::string型の一時オブジェクトが生成されない。 + decltype(fm)::iterator it = fm.lower_bound("B"); + decltype(fm)::iterator last = fm.upper_bound("D"); + + while (it != last) { + std::cout << it->first << "," << it->second << std::endl; + ++it; + } + } +} +``` +* upper_bound[color ff0000] +* fm.lower_bound[link lower_bound.md] +* std::less[link /reference/functional/less.md] + +### 出力 +``` +B,1 +C,4 +D,5 + +B,1 +C,4 +D,5 +``` + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------| +| [`lower_bound`](lower_bound.md) | 与えられた値よりも小さくない最初の要素へのイテレータを返す | +| [`equal_range`](equal_range.md) | 指定したキーにマッチする要素範囲を返す | +| [`find`](find.md) | 指定したキーで要素を探す | +| [`count`](count.md) | 指定したキーにマッチする要素の数を返す | + diff --git a/reference/flat_map/flat_multimap/uses_allocator.md b/reference/flat_map/flat_multimap/uses_allocator.md new file mode 100644 index 0000000000..c67c80f8d6 --- /dev/null +++ b/reference/flat_map/flat_multimap/uses_allocator.md @@ -0,0 +1,55 @@ +# uses_allocator +* flat_map[meta header] +* std[meta namespace] +* class template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template + struct uses_allocator, + Alloc> + : bool_constant && + uses_allocator_v> { }; +} +``` +* bool_constant[link /reference/type_traits/bool_constant.md] + +## 概要 +`uses_allocator`の、`flat_multimap`に対する特殊化。 + +アロケータを指定する`flat_multimap`の[`コンストラクタ`](op_constructor.md)において、指定されたアロケータと、`KeyContainer`および`MappedContainer`のアロケータが合致するかをチェックするのに使われる。 + + +## 例 +```cpp +#include +#include + +int main() +{ + using fm_t = std::flat_multimap; + + std::cout << std::uses_allocator>::value << std::endl; +} +``` +* std::uses_allocator[color ff0000] +* std::allocator[link /reference/memory/allocator.md] + +### 出力 +```cpp +1 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 diff --git a/reference/flat_map/flat_multimap/value_comp.md b/reference/flat_map/flat_multimap/value_comp.md new file mode 100644 index 0000000000..7894907123 --- /dev/null +++ b/reference/flat_map/flat_multimap/value_comp.md @@ -0,0 +1,72 @@ +# value_comp +* flat_map[meta header] +* std[meta namespace] +* flat_multimap[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +value_compare value_comp() const; // C++23 +``` + + +## 概要 +コンテナに関連づけられた要素比較用の関数オブジェクトを返す。これはコンテナ内の二つの要素のキー部分を比較するために利用できる。 +これは同じ型の 2 つの引数をとり、[狭義の弱順序](/reference/algorithm.md#strict-weak-ordering)に従って一つ目の引数が二つ目の引数の前になる場合に `true`、そうでない場合に `false` を返す。 + + +## 戻り値 +要素比較用の関数オブジェクト。 +[`value_compare`](value_compare.md) はメンバ型である。`key_compare` とは異なり、単なる型の別名ではなく入れ子クラスである。 + + +## 計算量 +定数時間。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::flat_multimap m; + std::flat_multimap::value_compare comp = m.value_comp(); + + auto p1 = std::make_pair(1, 'a'); + auto p2 = std::make_pair(2, 'b'); + auto p3 = std::make_pair(3, 'c'); + + std::cout << comp(p1, p2) << std::endl; + std::cout << comp(p3, p2) << std::endl; +} +``` +* value_comp()[color ff0000] +* value_compare[link value_compare.md] + +### 出力 +``` +1 +0 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------------|----------------------------------------------------------| +| [`key_comp`](key_comp.md) | キー比較用の関数オブジェクトを取得する | +| [`value_compare`](value_compare.md) | 要素値のキー部分で大小関係を判定する二項述語の型 | diff --git a/reference/flat_map/flat_multimap/value_compare.md b/reference/flat_map/flat_multimap/value_compare.md new file mode 100644 index 0000000000..abf5667bfc --- /dev/null +++ b/reference/flat_map/flat_multimap/value_compare.md @@ -0,0 +1,53 @@ +# value_compare +* flat_map[meta header] +* std[meta namespace] +* flat_multimap[meta class] +* class[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + class flat_multimap::value_compare; +} +``` + +## 概要 +`value_compare` は `flat_multimap` の入れ子クラスで、`flat_multimap::value_type` 型のオブジェクトを比較する関数オブジェクト型である。 +比較の基準は `flat_multimap::key_compare` と同様であるが、`flat_multimap::key_compare` の関数呼び出し演算子の引数型が `flat_multimap::key_type` であるのに対して、本クラスの関数呼び出し演算子の比較型は `flat_multimap::value_type` である点が異なっている。 +なお、引数のうち [`flat_multimap`](../flat_multimap.md)`::mapped_type` にあたる [`pair`](../../utility/pair.md) の `second` 部については、比較時には無視される。 + + +## メンバ関数 +| 名前 | 説明 | 対応バージョン | +|-----------------------------------------------------------|--------------------|----------------| +| [`operator()`](value_compare/op_call.md.nolink) | 関数呼び出し演算子 | | + +一般的な実装では、`key_compare` 型をメンバ変数で保持しており、その変数名を `comp` とすると、以下の動作となる。 + ```cpp + bool operator()(const_reference x, const_reference y) const { + return comp(x.first, y.first); + } + ``` + + +## 例 +[`value_comp()`](value_comp.md) の例を参照。 + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------------|----------------------------------------------------------| +| [`key_comp`](key_comp.md) | キー比較用の関数オブジェクトを取得する | +| [`value_comp`](value_comp.md) | 要素比較用の関数オブジェクトを返す | diff --git a/reference/flat_map/flat_multimap/values.md b/reference/flat_map/flat_multimap/values.md new file mode 100644 index 0000000000..bb7ee26695 --- /dev/null +++ b/reference/flat_map/flat_multimap/values.md @@ -0,0 +1,70 @@ +# values +* flat_map[meta header] +* std[meta namespace] +* flat_multimap[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +const mapped_container_type& values() const noexcept; // C++23 +``` + +## 概要 +値のコンテナを取得する。 + + +## 戻り値 +`flat_multimap` クラス内部で保持している値のコンテナ。 + + +## 計算量 +定数時間 + + +## 例 +```cpp example +#include +#include +#include +#include + +int main() +{ + std::flat_multimap fm; + fm.insert({3, 'C'}); + fm.insert({1, 'A'}); + fm.insert({2, 'B'}); + fm.insert({1, 'a'}); + + static_assert(std::is_same_v&>); + + for (auto i : fm.values()) { + std::cout << i << std::endl; + } +} +``` +* values()[color ff0000] + +### 出力 +``` +A +a +B +C +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------|-------------------------------------------| +| [`flat_multimap::keys`](keys.md) | キーのコンテナを取得する | diff --git a/reference/flat_map/sorted_equivalent_t.md b/reference/flat_map/sorted_equivalent_t.md new file mode 100644 index 0000000000..33ff9b30bb --- /dev/null +++ b/reference/flat_map/sorted_equivalent_t.md @@ -0,0 +1,66 @@ +# sorted_equivalent_t +* flat_map[meta header] +* std[meta namespace] +* class[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + struct sorted_equivalent_t { explicit sorted_equivalent_t() = default; }; + inline constexpr sorted_equivalent_t sorted_equivalent{}; +} +``` + +## 概要 +`sorted_equivalent_t`は、[`flat_multimap`](flat_multimap.md)コンテナに挿入するシーケンスがソート済みであること(重複は許可される)を示すためのタグ型および値である。 + +このクラス自体は空であり、オーバーロード解決のためにのみ使用される。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_multimap fm = { + {3, 'a'} + }; + + std::flat_multimap fm2 = { + {5, 'd'}, + {15, 'e'} + }; + + // 挿入するシーケンスがソート済みであることがわかっている場合、 + // sorted_equivalentを指定した方が高速になる + fm.insert(std::sorted_equivalent, fm2.begin(), fm2.end()); + + for (const auto& [key, value] : fm) { + std::cout << key << " : " << value << std::endl; + } +} +``` +* std::sorted_equivalent[color ff0000] +* insert[link flat_multimap/insert.md] +* begin()[link flat_multimap/begin.md] +* end()[link flat_multimap/end.md] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`std::flat_multimap`](flat_multimap.md) + diff --git a/reference/map/map/count.md b/reference/map/map/count.md index 491e70c984..5f58cc5152 100644 --- a/reference/map/map/count.md +++ b/reference/map/map/count.md @@ -25,9 +25,9 @@ size_type count(const K& x) const; // (2) C++14 ## 計算量 ``` -log(b.size()) + b.count(k) +log(size()) + count(x) ``` -* b.size()[link size.md] +* size()[link size.md] ## 備考 diff --git a/reference/map/map/insert.md b/reference/map/map/insert.md index b8c44319b8..79c3619155 100644 --- a/reference/map/map/insert.md +++ b/reference/map/map/insert.md @@ -32,7 +32,7 @@ iterator insert(const_iterator hint, node_type&& nh); // (10) C++17 * initializer_list[link /reference/initializer_list/initializer_list.md] ## 概要 -新しく一つの要素(引数 `x`, `y`を使う)または要素のシーケンス(入力イテレータまたは `initializer_list` を使う)または[ノードハンドル](/reference/node_handle/node_handle.md)を挿入することにより、 `map` コンテナを拡張する。 +新しく一つの要素(引数 `x` を使う)または要素のシーケンス(入力イテレータまたは `initializer_list` を使う)または[ノードハンドル](/reference/node_handle/node_handle.md)を挿入することにより、 `map` コンテナを拡張する。 これは、挿入された要素の数だけコンテナの [`size()`](size.md) を増やす。 diff --git a/reference/map/multimap/count.md b/reference/map/multimap/count.md index 25455b7310..89861b3fe9 100644 --- a/reference/map/multimap/count.md +++ b/reference/map/multimap/count.md @@ -25,9 +25,9 @@ size_type count(const K& x) const; // (2) C++14 ## 計算量 ``` -log(b.size()) + b.count(k) +log(size()) + count(x) ``` -* b.size()[link size.md] +* size()[link size.md] ## 例 diff --git a/reference/set/multiset/count.md b/reference/set/multiset/count.md index 8f801ed4b4..7490ba2743 100644 --- a/reference/set/multiset/count.md +++ b/reference/set/multiset/count.md @@ -25,9 +25,9 @@ size_type count(const K& x) const; // (2) C++14 ## 計算量 ``` -log(b.size()) + b.count(k) +log(size()) + count(x) ``` -* b.size()[link size.md] +* size()[link size.md] ## 備考 diff --git a/reference/set/set/count.md b/reference/set/set/count.md index 69e0cc7001..f503075148 100644 --- a/reference/set/set/count.md +++ b/reference/set/set/count.md @@ -25,9 +25,9 @@ size_type count(const K& x) const; // (2) C++14 ## 計算量 ``` -log(b.size()) + b.count(k) +log(size()) + count(x) ``` -* b.size()[link size.md] +* size()[link size.md] ## 備考 From eda1e0cb5ff92058b61b14f52c3704846ce008ee Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 31 Jan 2025 15:33:48 +0900 Subject: [PATCH 1425/3948] rcu: rcu_domain, rcu_obj_base (#1183) --- reference/rcu.md | 6 +- reference/rcu/rcu_default_domain.md | 47 ++++++++ reference/rcu/rcu_domain.md | 75 ++++++++++++ reference/rcu/rcu_domain/lock.md | 44 +++++++ reference/rcu/rcu_domain/try_lock.md | 44 +++++++ reference/rcu/rcu_domain/unlock.md | 51 ++++++++ reference/rcu/rcu_obj_base.md | 115 +++++++++++++++++++ reference/rcu/rcu_obj_base/op_assign.md | 31 +++++ reference/rcu/rcu_obj_base/op_constructor.md | 33 ++++++ reference/rcu/rcu_obj_base/retire.md | 56 +++++++++ working_style.md | 1 + 11 files changed, 500 insertions(+), 3 deletions(-) create mode 100644 reference/rcu/rcu_default_domain.md create mode 100644 reference/rcu/rcu_domain.md create mode 100644 reference/rcu/rcu_domain/lock.md create mode 100644 reference/rcu/rcu_domain/try_lock.md create mode 100644 reference/rcu/rcu_domain/unlock.md create mode 100644 reference/rcu/rcu_obj_base.md create mode 100644 reference/rcu/rcu_obj_base/op_assign.md create mode 100644 reference/rcu/rcu_obj_base/op_constructor.md create mode 100644 reference/rcu/rcu_obj_base/retire.md diff --git a/reference/rcu.md b/reference/rcu.md index df3358695b..a318cc4087 100644 --- a/reference/rcu.md +++ b/reference/rcu.md @@ -9,9 +9,9 @@ RCU同期メカニズムは、複数スレッド間で共有されるデータ | 名前 | 説明 | 対応バージョン | |-----------------|----------------|----------------| -| [`rcu_obj_base`](rcu/rcu_obj_base.md.nolink) | RCU対象オブジェクトの基底クラス(class template) | C++26 | -| [`rcu_domain`](rcu/rcu_domain.md.nolink) | RCUドメイン(class) | C++26 | -| [`rcu_default_domain`](rcu/rcu_default_domain.md.nolink) | デフォルトのRCUドメイン取得(function) | C++26 | +| [`rcu_obj_base`](rcu/rcu_obj_base.md) | RCU対象オブジェクトの基底クラス(class template) | C++26 | +| [`rcu_domain`](rcu/rcu_domain.md) | RCUドメイン(class) | C++26 | +| [`rcu_default_domain`](rcu/rcu_default_domain.md) | デフォルトのRCUドメイン取得(function) | C++26 | | [`rcu_synchronize`](rcu/rcu_synchronize.md.nolink) | RCUドメインのアンロック完了を待機(function) | C++26 | | [`rcu_barrier`](rcu/rcu_barrier.md.nolink) | メモリ解放操作完了を待機(function) | C++26 | | [`rcu_retire`](rcu/rcu_barrier.md.nolink) | メモリ解放操作をスケジュル(function template) | C++26 | diff --git a/reference/rcu/rcu_default_domain.md b/reference/rcu/rcu_default_domain.md new file mode 100644 index 0000000000..8fc46425f7 --- /dev/null +++ b/reference/rcu/rcu_default_domain.md @@ -0,0 +1,47 @@ +# rcu_default_domain +* rcu[meta header] +* function[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std { + rcu_domain& rcu_default_domain() noexcept; +} +``` +* rcu_domain[link rcu_domain.md] + +## 概要 +デフォルトのRCUドメインを取得する。 + + +## 戻り値 +静的記憶域期間をもつ[`rcu_domain`](rcu_domain.md)オブジェクトへの参照を返す。 +この関数は常に同一オブジェクトへの参照を返す。 + + +## 例外 +投げない + + +## 備考 +C++26時点では、この関数が[`rcu_domain`](rcu_domain.md)オブジェクトを作成する唯一の手段となっている。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`rcu_domain`](rcu_domain.md) + + +## 参照 +- [P2545R4 Read-Copy Update(RCU)](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2545r4.pdf) diff --git a/reference/rcu/rcu_domain.md b/reference/rcu/rcu_domain.md new file mode 100644 index 0000000000..b3a6b53694 --- /dev/null +++ b/reference/rcu/rcu_domain.md @@ -0,0 +1,75 @@ +# rcu_domain +* rcu[meta header] +* class[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std { + class rcu_domain; +} +``` + +## 概要 +RCU同期メカニズムで保護する共有データに対応付ける、RCUドメインを表現する。 + +`rcu_domain`クラスは Cpp17Lockable 要件を満たし、共有データの読み取りをおこなうRCU保護区間を表現する。 +RCU保護区間は`lock`呼び出しから`unlock()`呼び出しのまでの区間であり、RCUドメインに対して同一スレッド上でのRCU保護区間は入れ子になってもよい。 + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|-----------------|----------------|-------| +| `(constructor)` | コンストラクタ | C++26 | +| `operator=` | 代入演算子 | C++26 | +| [`lock`](rcu_domain/lock.md) | 共有データの読み取り開始を宣言 | C++26 | +| [`try_lock`](rcu_domain/try_lock.md) | 共有データの読み取り開始を宣言 | C++26 | +| [`unlock`](rcu_domain/unlock.md) | 共有データの読み取り終了を宣言 | C++26 | + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::rcu_domain& dom = std::rcu_default_domain(); + + { + std::scoped_lock rlock(dom); + // dom.lock()が呼ばれる + + } // dom.unlock()が呼ばれる +} +``` +* std::rcu_domain[color ff0000] +* std::rcu_default_domain[link rcu_default_domain.md] +* std::scoped_lock[link /reference/mutex/scoped_lock.md] + + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`rcu_default_domain`](rcu_default_domain.md) +- [`rcu_retire`](rcu_retire.md.nolink) +- [`rcu_obj_base::retire`](rcu_obj_base/retire.md) + + +## 参照 +- [P2545R4 Read-Copy Update(RCU)](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2545r4.pdf) diff --git a/reference/rcu/rcu_domain/lock.md b/reference/rcu/rcu_domain/lock.md new file mode 100644 index 0000000000..cf7096b334 --- /dev/null +++ b/reference/rcu/rcu_domain/lock.md @@ -0,0 +1,44 @@ +# lock +* rcu[meta header] +* function[meta id-type] +* std[meta namespace] +* rcu_domain[meta class] +* cpp26[meta cpp] + +```cpp +void lock() noexcept; +``` + +## 概要 +RCU機構により保護される共有データの読み取り開始を宣言する。 + + +## 効果 +RCU保護区間を開く。 + + +## 戻り値 +なし + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`unlock`](unlock.md) + + +## 参照 +- [P2545R4 Read-Copy Update(RCU)](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2545r4.pdf) diff --git a/reference/rcu/rcu_domain/try_lock.md b/reference/rcu/rcu_domain/try_lock.md new file mode 100644 index 0000000000..686a7d9d05 --- /dev/null +++ b/reference/rcu/rcu_domain/try_lock.md @@ -0,0 +1,44 @@ +# try_lock +* rcu[meta header] +* function[meta id-type] +* std[meta namespace] +* rcu_domain[meta class] +* cpp26[meta cpp] + +```cpp +bool try_lock() noexcept; +``` + +## 概要 +RCU機構により保護される共有データの読み取り開始を宣言する。 + + +## 効果 +[`lock()`](lock.md)と等価。 + + +## 戻り値 +`true` + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`unlock`](unlock.md) + + +## 参照 +- [P2545R4 Read-Copy Update(RCU)](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2545r4.pdf) diff --git a/reference/rcu/rcu_domain/unlock.md b/reference/rcu/rcu_domain/unlock.md new file mode 100644 index 0000000000..bd315492ba --- /dev/null +++ b/reference/rcu/rcu_domain/unlock.md @@ -0,0 +1,51 @@ +# unlock +* rcu[meta header] +* function[meta id-type] +* std[meta namespace] +* rcu_domain[meta class] +* cpp26[meta cpp] + +```cpp +void unlock() noexcept; +``` + +## 概要 +RCU機構により保護される共有データの読み取り終了を宣言する。 + + +## 事前条件 +まだ閉じられていないRCU保護区間を開いた[`lock`](lock.md)呼び出しが、`unlock`呼び出しよりも前に順序付けられること。 + + +## 効果 +直近に開かれたRCU保護区間を閉じる。 +`*this`上でスケジュールされた再利用操作を呼び出す可能性がある。 + + +## 戻り値 +なし + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`lock`](lock.md) +- [`rcu_retire`](../rcu_retire.md.nolink) +- [`rcu_obj_base::retire`](../rcu_rcu_obj_base/retire.md.nolink) + + +## 参照 +- [P2545R4 Read-Copy Update(RCU)](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2545r4.pdf) diff --git a/reference/rcu/rcu_obj_base.md b/reference/rcu/rcu_obj_base.md new file mode 100644 index 0000000000..0e2bc9bce5 --- /dev/null +++ b/reference/rcu/rcu_obj_base.md @@ -0,0 +1,115 @@ +# rcu_obj_base +* rcu[meta header] +* class template[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std { + template> + class rcu_obj_base; +} +``` +* default_delete[link /reference/memory/default_delete.md] + +## 概要 +RCU機構の保護対象とする型の基底クラス。 + +使用するときは、`T`で`rcu_obj_base`を公開継承した上で派生クラス`T`を`rcu_obj_base`のテンプレート引数にする(CRTP)。 + + +## 適格要件 +- `T`は不完全型でもよいが、特殊化された`rcu_obj_base`のメンバが参照されるまでに完全型とすること。 +- `D`は関数オブジェクト型であり、`D`型の値`d`と`T*`型の値`ptr`に対して式`d(ptr)`が有効であること。 +- `D`型は要件 Cpp17DefaultConstructible およ Cpp17MoveAssignable を満たすこと。 + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|-----------------|----------------|-------| +| [`(constructor)`](rcu_obj_base/op_constructor.md) | コンストラクタ | C++26 | +| `(destructor)` | デストラクタ | C++26 | +| [`operator=`](rcu_obj_base/op_assign.md) | 代入演算子 | C++26 | +| [`retire`](rcu_obj_base/retire.md) | オブジェクト再利用をスケジュールする | C++26 | + + +## 例 +```cpp example +#include +#include +#include +#include + +struct Data : std::rcu_obj_base { + int m1, m2; +}; + +// 共有データを指すポインタ +std::atomic data; + +void reader() +{ + std::scoped_lock slk{std::rcu_default_domain()}; + // 共有データを読み取り(Read) + Data *p = data; + + std::println("{} {}", p->m1, p->m2); +} + +void updater() +{ + Data *newdata = new Data{1, 2}; + // 新しいデータで共有データを更新(Update) + Data *old_data = data.exchange(newdata); + + // 古いデータを読み取り中のスレッドがなくなったタイミングで + // データ領域の再利用(メモリ解放)を行うようスケジューリングする + old_data->retire(); +} + +int main() +{ + // 共有データ初期化 + Data *newdata = new Data{0, 0}; + data.store(newdata); + + // 共有データへ並行アクセス + std::jthread th{[] { + for (int i = 0; i < 3; i++) { + reader(); + } + }}; + updater(); +} +``` +* std::rcu_obj_base[color ff0000] +* std::rcu_default_domain[link rcu_default_domain.md] +* std::scoped_lock[link /reference/mutex/scoped_lock.md] + + +### 出力例 +``` +0 0 +1 2 +1 2 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`rcu_domain`](rcu_domain.md) + + +## 参照 +- [P2545R4 Read-Copy Update(RCU)](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2545r4.pdf) diff --git a/reference/rcu/rcu_obj_base/op_assign.md b/reference/rcu/rcu_obj_base/op_assign.md new file mode 100644 index 0000000000..e97ced3837 --- /dev/null +++ b/reference/rcu/rcu_obj_base/op_assign.md @@ -0,0 +1,31 @@ +# operator= +* rcu[meta header] +* function[meta id-type] +* std[meta namespace] +* rcu_obj_base[meta class] +* cpp26[meta cpp] + +```cpp +protected: + rcu_obj_base& operator=(const rcu_obj_base&) = default; // (1) + rcu_obj_base& operator=(rcu_obj_base&&) = default; // (2) +``` + +## 概要 +- (1): コピー代入演算子 +- (2): ムーブ代入演算子 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2545R4 Read-Copy Update(RCU)](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2545r4.pdf) diff --git a/reference/rcu/rcu_obj_base/op_constructor.md b/reference/rcu/rcu_obj_base/op_constructor.md new file mode 100644 index 0000000000..d190c13663 --- /dev/null +++ b/reference/rcu/rcu_obj_base/op_constructor.md @@ -0,0 +1,33 @@ +# コンストラクタ +* rcu[meta header] +* function[meta id-type] +* std[meta namespace] +* rcu_obj_base[meta class] +* cpp26[meta cpp] + +```cpp +protected: + rcu_obj_base() = default; // (1) + rcu_obj_base(const rcu_obj_base&) = default; // (2) + rcu_obj_base(rcu_obj_base&&) = default; // (3) +``` + +## 概要 +- (1): デフォルトコンストラクタ +- (2): コピーコンストラクタ +- (3): ムーブコンストラクタ + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2545R4 Read-Copy Update(RCU)](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2545r4.pdf) diff --git a/reference/rcu/rcu_obj_base/retire.md b/reference/rcu/rcu_obj_base/retire.md new file mode 100644 index 0000000000..deadc7b28f --- /dev/null +++ b/reference/rcu/rcu_obj_base/retire.md @@ -0,0 +1,56 @@ +# retire +* rcu[meta header] +* function[meta id-type] +* std[meta namespace] +* rcu_obj_base[meta class] +* cpp26[meta cpp] + +```cpp +void retire(D d = D(), + rcu_domain& dom = rcu_default_domain()) noexcept; +``` +* rcu_domain[link ../rcu_domain.md] +* rcu_default_domain[link ../rcu_default_domain.md] + +## 概要 +RCU機構により保護されるオブジェクト再利用をスケジュールする。 + + +## 適格要件 +クラステンプレートパラメータ`T`がRCU保護可能(rcu-protectable)な型であること。 + + +## 事前条件 +- `*this`が型`T`のオブジェクト`x`の基底クラスサブオブジェクトであること。 +- `x`に対して`rcu_obj_base::retire`が呼び出されていないこと。 +- `D`型の説明専用メンバ変数`deleter`への代入が例外で終了しないこと。 + + +## 効果 +- `deleter = std::move(d)`を評価し、 +- RCUドメイン`dom`に対して式`deleter(addressof(x))`の評価をスケジュールする。 + - 評価が例外で終了した場合は未定義の動作を引き起こす。 +- `dom`に対してスケジュールされた評価を呼び出す可能性がある。 + + +## 戻り値 +なし + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`rcu_domain::unlock`](../rcu_domain/unlock.md) + + +## 参照 +- [P2545R4 Read-Copy Update(RCU)](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2545r4.pdf) diff --git a/working_style.md b/working_style.md index 0c28b90af8..c102272fd7 100644 --- a/working_style.md +++ b/working_style.md @@ -123,6 +123,7 @@ C++11以降対応については対応バージョンを明記します。バー | pure virtual function | 純粋仮想関数 | | random access iterator | ランダムアクセスイテレータ | | range | 一般用途の場合:範囲
Rangeアルゴリズム・Rangeアダプタ・Rangeオブジェクトの場合:Range
range-based for:範囲for文
2つのイテレータによる範囲:イテレータ範囲 | +| region of RCU protection | RCU保護区間 | | remarks | 備考 | | requires | 要件 | | returns | 戻り値 | From 9a152c20b0cb59dc18745b2f1afe8ec8e73e0afc Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 5 Feb 2025 19:01:51 +0900 Subject: [PATCH 1426/3948] =?UTF-8?q?rcu:=20=E9=9D=9E=E3=83=A1=E3=83=B3?= =?UTF-8?q?=E3=83=90=E9=96=A2=E6=95=B0=E7=BE=A4=20(#1183)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/rcu.md | 6 +- reference/rcu/rcu_barrier.md | 57 ++++++++++++ reference/rcu/rcu_domain.md | 4 +- reference/rcu/rcu_domain/unlock.md | 6 +- reference/rcu/rcu_obj_base.md | 4 +- reference/rcu/rcu_obj_base/retire.md | 3 +- reference/rcu/rcu_retire.md | 125 +++++++++++++++++++++++++++ reference/rcu/rcu_synchronize.md | 116 +++++++++++++++++++++++++ 8 files changed, 310 insertions(+), 11 deletions(-) create mode 100644 reference/rcu/rcu_barrier.md create mode 100644 reference/rcu/rcu_retire.md create mode 100644 reference/rcu/rcu_synchronize.md diff --git a/reference/rcu.md b/reference/rcu.md index a318cc4087..1268415d35 100644 --- a/reference/rcu.md +++ b/reference/rcu.md @@ -12,9 +12,9 @@ RCU同期メカニズムは、複数スレッド間で共有されるデータ | [`rcu_obj_base`](rcu/rcu_obj_base.md) | RCU対象オブジェクトの基底クラス(class template) | C++26 | | [`rcu_domain`](rcu/rcu_domain.md) | RCUドメイン(class) | C++26 | | [`rcu_default_domain`](rcu/rcu_default_domain.md) | デフォルトのRCUドメイン取得(function) | C++26 | -| [`rcu_synchronize`](rcu/rcu_synchronize.md.nolink) | RCUドメインのアンロック完了を待機(function) | C++26 | -| [`rcu_barrier`](rcu/rcu_barrier.md.nolink) | メモリ解放操作完了を待機(function) | C++26 | -| [`rcu_retire`](rcu/rcu_barrier.md.nolink) | メモリ解放操作をスケジュル(function template) | C++26 | +| [`rcu_synchronize`](rcu/rcu_synchronize.md) | RCUドメインのアンロック完了を待機(function) | C++26 | +| [`rcu_barrier`](rcu/rcu_barrier.md) | メモリ回収操作完了を待機(function) | C++26 | +| [`rcu_retire`](rcu/rcu_retire.md) | メモリ回収操作をスケジュール(function template) | C++26 | ## バージョン diff --git a/reference/rcu/rcu_barrier.md b/reference/rcu/rcu_barrier.md new file mode 100644 index 0000000000..0d23366ded --- /dev/null +++ b/reference/rcu/rcu_barrier.md @@ -0,0 +1,57 @@ +# rcu_barrier +* rcu[meta header] +* function[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std { + void rcu_barrier(rcu_domain& dom = rcu_default_domain()) noexcept; +} +``` +* rcu_domain[link rcu_domain.md] +* rcu_default_domain[link rcu_default_domain.md] + +## 概要 +スケジュールされたメモリ回収操作の完了を待機する。 + + +## 効果 +RCUドメイン`dom`上でスケジュールされた回収操作を評価する可能性がある。 +`rcu_barrier`呼び出しよりも前に発生する評価で、かつ`dom`上での操作`E`をスケジュールする評価については、`E`が評価されるまでブロックする。 + + +## 同期操作 +`E`のあらゆる評価は、`rcu_barrier`からの戻りよりも確実に前に発生する。 + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 備考 +`rcu_barrier`呼び出しは、暗黙に[`rcu_synchronize`](rcu_synchronize.md)を呼ばない。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`rcu_retire`](rcu_retire.md) +- [`rcu_obj_base::retire`](rcu_obj_base/retire.md) + + +## 参照 +- [P2545R4 Read-Copy Update(RCU)](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2545r4.pdf) diff --git a/reference/rcu/rcu_domain.md b/reference/rcu/rcu_domain.md index b3a6b53694..07e0549188 100644 --- a/reference/rcu/rcu_domain.md +++ b/reference/rcu/rcu_domain.md @@ -14,7 +14,7 @@ namespace std { RCU同期メカニズムで保護する共有データに対応付ける、RCUドメインを表現する。 `rcu_domain`クラスは Cpp17Lockable 要件を満たし、共有データの読み取りをおこなうRCU保護区間を表現する。 -RCU保護区間は`lock`呼び出しから`unlock()`呼び出しのまでの区間であり、RCUドメインに対して同一スレッド上でのRCU保護区間は入れ子になってもよい。 +RCU保護区間は[`lock`](rcu_domain/lock.md)呼び出しから[`unlock`](rcu_domain/unlock.md)呼び出しのまでの区間であり、RCUドメインに対して同一スレッド上でのRCU保護区間は入れ子になってもよい。 ## メンバ関数 @@ -67,7 +67,7 @@ int main() ## 関連項目 - [`rcu_default_domain`](rcu_default_domain.md) -- [`rcu_retire`](rcu_retire.md.nolink) +- [`rcu_retire`](rcu_retire.md) - [`rcu_obj_base::retire`](rcu_obj_base/retire.md) diff --git a/reference/rcu/rcu_domain/unlock.md b/reference/rcu/rcu_domain/unlock.md index bd315492ba..acbfa07a1a 100644 --- a/reference/rcu/rcu_domain/unlock.md +++ b/reference/rcu/rcu_domain/unlock.md @@ -19,7 +19,7 @@ RCU機構により保護される共有データの読み取り終了を宣言 ## 効果 直近に開かれたRCU保護区間を閉じる。 -`*this`上でスケジュールされた再利用操作を呼び出す可能性がある。 +`*this`上でスケジュールされた回収操作を呼び出す可能性がある。 ## 戻り値 @@ -43,8 +43,8 @@ RCU機構により保護される共有データの読み取り終了を宣言 ## 関連項目 - [`lock`](lock.md) -- [`rcu_retire`](../rcu_retire.md.nolink) -- [`rcu_obj_base::retire`](../rcu_rcu_obj_base/retire.md.nolink) +- [`rcu_retire`](../rcu_retire.md) +- [`rcu_obj_base::retire`](../rcu_obj_base/retire.md) ## 参照 diff --git a/reference/rcu/rcu_obj_base.md b/reference/rcu/rcu_obj_base.md index 0e2bc9bce5..c5b30d33c9 100644 --- a/reference/rcu/rcu_obj_base.md +++ b/reference/rcu/rcu_obj_base.md @@ -31,7 +31,7 @@ RCU機構の保護対象とする型の基底クラス。 | [`(constructor)`](rcu_obj_base/op_constructor.md) | コンストラクタ | C++26 | | `(destructor)` | デストラクタ | C++26 | | [`operator=`](rcu_obj_base/op_assign.md) | 代入演算子 | C++26 | -| [`retire`](rcu_obj_base/retire.md) | オブジェクト再利用をスケジュールする | C++26 | +| [`retire`](rcu_obj_base/retire.md) | オブジェクト回収をスケジュールする | C++26 | ## 例 @@ -64,7 +64,7 @@ void updater() Data *old_data = data.exchange(newdata); // 古いデータを読み取り中のスレッドがなくなったタイミングで - // データ領域の再利用(メモリ解放)を行うようスケジューリングする + // データ領域の回収(メモリ解放)を行うようスケジューリングする old_data->retire(); } diff --git a/reference/rcu/rcu_obj_base/retire.md b/reference/rcu/rcu_obj_base/retire.md index deadc7b28f..8c04fcde77 100644 --- a/reference/rcu/rcu_obj_base/retire.md +++ b/reference/rcu/rcu_obj_base/retire.md @@ -13,7 +13,7 @@ void retire(D d = D(), * rcu_default_domain[link ../rcu_default_domain.md] ## 概要 -RCU機構により保護されるオブジェクト再利用をスケジュールする。 +RCU機構により保護されるオブジェクト回収をスケジュールする。 ## 適格要件 @@ -50,6 +50,7 @@ RCU機構により保護されるオブジェクト再利用をスケジュー ## 関連項目 - [`rcu_domain::unlock`](../rcu_domain/unlock.md) +- [`rcu_retire`](../rcu_retire.md) ## 参照 diff --git a/reference/rcu/rcu_retire.md b/reference/rcu/rcu_retire.md new file mode 100644 index 0000000000..469ac230f4 --- /dev/null +++ b/reference/rcu/rcu_retire.md @@ -0,0 +1,125 @@ +# rcu_retire +* rcu[meta header] +* function template[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std{ + template> + void rcu_retire(T* p, + D d = D(), + rcu_domain& dom = rcu_default_domain()); +} +``` +* default_delete[link /reference/memory/default_delete.md] +* rcu_domain[link rcu_domain.md] +* rcu_default_domain[link rcu_default_domain.md] + +## 概要 +RCU機構により保護されるオブジェクト回収をスケジュールする。 + + +## 適格要件 +[`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)` == true`、かつ式`d(p)`が妥当であること。 + + +## 事前条件 +`D`はCpp17MoveCosntructible要件およびCpp17Destructible要件をみたすこと。 + + +## 効果 +- メモリを確保する可能性がある。 + - メモリ確保が`operator new`を呼び出すか否かは未規定である。 +- `D`型のオブジェクト`d1`を`std::move(d)`で初期化する。 +- RCUドメイン`dom`に対して式`d1(p)`の評価をスケジュールする。 + - 評価が例外で終了した場合は未定義の動作を引き起こす。 +- `dom`に対してスケジュールされた評価を呼び出す可能性がある。 + + +## 戻り値 +なし + + +## 例外 +[`bad_alloc`](/reference/new/bad_alloc.md)、または`d1`初期化中に送出された例外。 + + +## 例 +```cpp example +#include +#include +#include +#include + +struct Data { + int m1, m2; +}; + +// 共有データを指すポインタ +std::atomic data; + +void reader() +{ + std::scoped_lock slk{std::rcu_default_domain()}; + // 共有データを読み取り(Read) + Data *p = data; + + std::println("{} {}", p->m1, p->m2); +} + +void updater() +{ + Data *newdata = new Data{1, 2}; + // 新しいデータで共有データを更新(Update) + Data *old_data = data.exchange(newdata); + + // 古いデータを読み取り中のスレッドがなくなったタイミングで + // データ領域の回収(メモリ解放)を行うようスケジューリングする + std::rcu_retire(old_data); +} + +int main() +{ + // 共有データ初期化 + Data *newdata = new Data{0, 0}; + data.store(newdata); + + // 共有データへ並行アクセス + std::jthread th{[] { + for (int i = 0; i < 3; i++) { + reader(); + } + }}; + updater(); +} +``` +* std::rcu_retire[color ff0000] +* std::rcu_default_domain[link rcu_default_domain.md] +* std::scoped_lock[link /reference/mutex/scoped_lock.md] + +### 出力例 +``` +0 0 +1 2 +1 2 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`rcu_domain::unlock`](rcu_domain/unlock.md) +- [`rcu_obj_base::retire`](rcu_obj_base/retire.md) + + +## 参照 +- [P2545R4 Read-Copy Update(RCU)](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2545r4.pdf) diff --git a/reference/rcu/rcu_synchronize.md b/reference/rcu/rcu_synchronize.md new file mode 100644 index 0000000000..b86626adac --- /dev/null +++ b/reference/rcu/rcu_synchronize.md @@ -0,0 +1,116 @@ +# rcu_synchronize +* rcu[meta header] +* function[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std { + void rcu_synchronize(rcu_domain& dom = rcu_default_domain()) noexcept; +} +``` +* rcu_domain[link rcu_domain.md] +* rcu_default_domain[link rcu_default_domain.md] + +## 概要 +RCUドメインのアンロック完了を待機する。 + + +## 効果 +もし`rcu_synchronize`呼び出しが`dom`上のRCU保護区間`R`のロックを開く操作よりも確実に前に発生するのでなければ、`R`を閉じる[`unlock`](rcu_domain/unlock.md)まで現スレッドをブロックする。 + + +## 同期操作 +`R`を閉じる[`unlock`](rcu_domain/unlock.md)は、`rcu_synchronize`からの戻りよりも確実に前に発生する。 + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 備考 +`rcu_synchronize`呼び出しは、暗黙に[`rcu_barrier`](rcu_barrier.md)を呼ばない。 + + +## 例 +```cpp example +#include +#include +#include +#include + +struct Data { + int m1, m2; +}; + +// 共有データを指すポインタ +std::atomic data; + +void reader() +{ + std::scoped_lock slk{std::rcu_default_domain()}; + // 共有データを読み取り(Read) + Data *p = data; + + std::println("{} {}", p->m1, p->m2); +} + +void updater() +{ + Data *newdata = new Data{1, 2}; + // 新しいデータで共有データを更新(Update) + Data *old_data = data.exchange(newdata); + + // 古いデータを読み取り中のスレッドがなくるまで待機する + std::rcu_synchronize(); + delete old_data; +} + +int main() +{ + // 共有データ初期化 + Data *newdata = new Data{0, 0}; + data.store(newdata); + + // 共有データへ並行アクセス + std::jthread th{[] { + for (int i = 0; i < 3; i++) { + reader(); + } + }}; + updater(); +} +``` +* std::rcu_synchronize[color ff0000] +* std::rcu_default_domain[link rcu_default_domain.md] +* std::scoped_lock[link /reference/mutex/scoped_lock.md] + +### 出力例 +``` +0 0 +1 2 +1 2 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`rcu_domain`](rcu_domain.md) + + +## 参照 +- [P2545R4 Read-Copy Update(RCU)](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2545r4.pdf) From c7a7c9dcbeaf0bc60ea3c752269d693323a7db97 Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 6 Feb 2025 10:48:43 +0900 Subject: [PATCH 1427/3948] =?UTF-8?q?rcu:=20=E5=BE=AE=E8=AA=BF=E6=95=B4=20?= =?UTF-8?q?(#1183)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 1 + reference/rcu.md | 2 +- reference/rcu/rcu_obj_base.md | 5 ++++- reference/rcu/rcu_obj_base/retire.md | 10 +++++++--- reference/rcu/rcu_retire.md | 5 ++++- reference/rcu/rcu_synchronize.md | 3 +++ 6 files changed, 20 insertions(+), 6 deletions(-) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 0b25cda200..19e1e5d88a 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -228,6 +228,7 @@ * view[link /reference/ranges/view.md] * viewable_range[link /reference/ranges/viewable_range.md] * [link /reference/ratio.md] +* [link /reference/rcu.md] * [link /reference/regex.md] * [link /reference/scoped_allocator.md] * [link /reference/semaphore.md] diff --git a/reference/rcu.md b/reference/rcu.md index 1268415d35..6801cb76ab 100644 --- a/reference/rcu.md +++ b/reference/rcu.md @@ -4,7 +4,7 @@ ``ヘッダでは、並行なデータの参照・更新を実現する[Read-Copy Update(RCU)機構](https://ja.wikipedia.org/wiki/%E3%83%AA%E3%83%BC%E3%83%89%E3%83%BB%E3%82%B3%E3%83%94%E3%83%BC%E3%83%BB%E3%82%A2%E3%83%83%E3%83%97%E3%83%87%E3%83%BC%E3%83%88)のための部品を定義する。 -RCU同期メカニズムは、複数スレッド間で共有されるデータが高頻度で参照され、稀に更新されるようなユースケースに適している。RCU機構はスレッド間の排他制御を行わず、更新操作により不要となった古いデータを安全に解放するタイミング制御を行う。 +RCU同期メカニズムは、複数スレッド間で共有されるリンク方式データ構造が高頻度で参照され、稀に更新されるようなユースケースに適している。RCU機構のデータ読み取りではスレッド間の排他制御を行わず、更新操作により不要となった古いデータを安全に回収(メモリ解放)するタイミングを制御する。 | 名前 | 説明 | 対応バージョン | diff --git a/reference/rcu/rcu_obj_base.md b/reference/rcu/rcu_obj_base.md index c5b30d33c9..3a36d3ebc9 100644 --- a/reference/rcu/rcu_obj_base.md +++ b/reference/rcu/rcu_obj_base.md @@ -85,8 +85,11 @@ int main() ``` * std::rcu_obj_base[color ff0000] * std::rcu_default_domain[link rcu_default_domain.md] +* retire()[link rcu_obj_base/retire.md] * std::scoped_lock[link /reference/mutex/scoped_lock.md] - +* std::jthread[link /reference/thread/jthread.md] +* exchange[link /reference/atomic/atomic/exchange.md] +* store[link /reference/atomic/atomic/store.md] ### 出力例 ``` diff --git a/reference/rcu/rcu_obj_base/retire.md b/reference/rcu/rcu_obj_base/retire.md index 8c04fcde77..2a8e7edc39 100644 --- a/reference/rcu/rcu_obj_base/retire.md +++ b/reference/rcu/rcu_obj_base/retire.md @@ -17,7 +17,11 @@ RCU機構により保護されるオブジェクト回収をスケジュール ## 適格要件 -クラステンプレートパラメータ`T`がRCU保護可能(rcu-protectable)な型であること。 +クラステンプレートパラメータ`T`が、下記条件を満たすRCU保護可能(rcu-protectable)な型であること。 + +- `rcu_obj_base`型を唯一の基底クラスとして持つクラス型であり、かつ +- その基底は公開(public)かつ非仮想基底クラスであり、かつ +- 型`X`, `Y`の他の組合せに対して`rcu_obj_base`型を基底クラスとして持たない。 ## 事前条件 @@ -27,8 +31,8 @@ RCU機構により保護されるオブジェクト回収をスケジュール ## 効果 -- `deleter = std::move(d)`を評価し、 -- RCUドメイン`dom`に対して式`deleter(addressof(x))`の評価をスケジュールする。 +- `deleter =` [`std::move`](/reference/utility/move.md)`(d)`を評価し、 +- RCUドメイン`dom`に対して式`deleter(`[`addressof`](/reference/memory/addressof.md)`(x))`の評価をスケジュールする。 - 評価が例外で終了した場合は未定義の動作を引き起こす。 - `dom`に対してスケジュールされた評価を呼び出す可能性がある。 diff --git a/reference/rcu/rcu_retire.md b/reference/rcu/rcu_retire.md index 469ac230f4..d4d63c3743 100644 --- a/reference/rcu/rcu_retire.md +++ b/reference/rcu/rcu_retire.md @@ -31,7 +31,7 @@ RCU機構により保護されるオブジェクト回収をスケジュール ## 効果 - メモリを確保する可能性がある。 - メモリ確保が`operator new`を呼び出すか否かは未規定である。 -- `D`型のオブジェクト`d1`を`std::move(d)`で初期化する。 +- `D`型のオブジェクト`d1`を[`std::move`](/reference/utility/move.md)`(d)`で初期化する。 - RCUドメイン`dom`に対して式`d1(p)`の評価をスケジュールする。 - 評価が例外で終了した場合は未定義の動作を引き起こす。 - `dom`に対してスケジュールされた評価を呼び出す可能性がある。 @@ -97,6 +97,9 @@ int main() * std::rcu_retire[color ff0000] * std::rcu_default_domain[link rcu_default_domain.md] * std::scoped_lock[link /reference/mutex/scoped_lock.md] +* std::jthread[link /reference/thread/jthread.md] +* exchange[link /reference/atomic/atomic/exchange.md] +* store[link /reference/atomic/atomic/store.md] ### 出力例 ``` diff --git a/reference/rcu/rcu_synchronize.md b/reference/rcu/rcu_synchronize.md index b86626adac..713b6ab02d 100644 --- a/reference/rcu/rcu_synchronize.md +++ b/reference/rcu/rcu_synchronize.md @@ -88,6 +88,9 @@ int main() * std::rcu_synchronize[color ff0000] * std::rcu_default_domain[link rcu_default_domain.md] * std::scoped_lock[link /reference/mutex/scoped_lock.md] +* std::jthread[link /reference/thread/jthread.md] +* exchange[link /reference/atomic/atomic/exchange.md] +* store[link /reference/atomic/atomic/store.md] ### 出力例 ``` From c135b44e4972135dd7bcfc0bd0434d10f0da5bbb Mon Sep 17 00:00:00 2001 From: suomesta Date: Fri, 7 Feb 2025 02:10:03 +0900 Subject: [PATCH 1428/3948] create flat_set folder and files (#1079) --- GLOBAL_QUALIFY_LIST.txt | 1 + lang/cpp23.md | 2 +- lang/cpp23/feature_test_macros.md | 4 +- reference.md | 2 +- reference/flat_set.md | 36 +++ reference/flat_set/flat_multiset.md | 230 +++++++++++++++ reference/flat_set/flat_multiset/begin.md | 74 +++++ reference/flat_set/flat_multiset/cbegin.md | 70 +++++ reference/flat_set/flat_multiset/cend.md | 74 +++++ reference/flat_set/flat_multiset/clear.md | 56 ++++ reference/flat_set/flat_multiset/contains.md | 80 ++++++ reference/flat_set/flat_multiset/count.md | 90 ++++++ reference/flat_set/flat_multiset/crbegin.md | 71 +++++ reference/flat_set/flat_multiset/crend.md | 69 +++++ reference/flat_set/flat_multiset/emplace.md | 109 +++++++ .../flat_set/flat_multiset/emplace_hint.md | 74 +++++ reference/flat_set/flat_multiset/empty.md | 59 ++++ reference/flat_set/flat_multiset/end.md | 75 +++++ .../flat_set/flat_multiset/equal_range.md | 86 ++++++ reference/flat_set/flat_multiset/erase.md | 140 +++++++++ .../flat_set/flat_multiset/erase_if_free.md | 77 +++++ reference/flat_set/flat_multiset/extract.md | 78 +++++ reference/flat_set/flat_multiset/find.md | 102 +++++++ reference/flat_set/flat_multiset/insert.md | 214 ++++++++++++++ .../flat_set/flat_multiset/insert_range.md | 73 +++++ reference/flat_set/flat_multiset/key_comp.md | 64 +++++ .../flat_set/flat_multiset/lower_bound.md | 121 ++++++++ reference/flat_set/flat_multiset/max_size.md | 51 ++++ reference/flat_set/flat_multiset/op_assign.md | 66 +++++ .../flat_set/flat_multiset/op_compare_3way.md | 83 ++++++ .../flat_set/flat_multiset/op_constructor.md | 266 +++++++++++++++++ reference/flat_set/flat_multiset/op_equal.md | 70 +++++ reference/flat_set/flat_multiset/rbegin.md | 75 +++++ reference/flat_set/flat_multiset/rend.md | 67 +++++ reference/flat_set/flat_multiset/replace.md | 92 ++++++ reference/flat_set/flat_multiset/size.md | 69 +++++ reference/flat_set/flat_multiset/swap.md | 75 +++++ .../flat_set/flat_multiset/upper_bound.md | 121 ++++++++ .../flat_set/flat_multiset/uses_allocator.md | 55 ++++ .../flat_set/flat_multiset/value_comp.md | 65 +++++ reference/flat_set/flat_set.md | 229 +++++++++++++++ reference/flat_set/flat_set/begin.md | 73 +++++ reference/flat_set/flat_set/cbegin.md | 69 +++++ reference/flat_set/flat_set/cend.md | 73 +++++ reference/flat_set/flat_set/clear.md | 56 ++++ reference/flat_set/flat_set/contains.md | 80 ++++++ reference/flat_set/flat_set/count.md | 97 +++++++ reference/flat_set/flat_set/crbegin.md | 70 +++++ reference/flat_set/flat_set/crend.md | 68 +++++ reference/flat_set/flat_set/emplace.md | 119 ++++++++ reference/flat_set/flat_set/emplace_hint.md | 75 +++++ reference/flat_set/flat_set/empty.md | 60 ++++ reference/flat_set/flat_set/end.md | 74 +++++ reference/flat_set/flat_set/equal_range.md | 85 ++++++ reference/flat_set/flat_set/erase.md | 140 +++++++++ reference/flat_set/flat_set/erase_if_free.md | 71 +++++ reference/flat_set/flat_set/extract.md | 77 +++++ reference/flat_set/flat_set/find.md | 101 +++++++ reference/flat_set/flat_set/insert.md | 225 +++++++++++++++ reference/flat_set/flat_set/insert_range.md | 79 ++++++ reference/flat_set/flat_set/key_comp.md | 64 +++++ reference/flat_set/flat_set/lower_bound.md | 121 ++++++++ reference/flat_set/flat_set/max_size.md | 51 ++++ reference/flat_set/flat_set/op_assign.md | 65 +++++ .../flat_set/flat_set/op_compare_3way.md | 82 ++++++ reference/flat_set/flat_set/op_constructor.md | 267 ++++++++++++++++++ reference/flat_set/flat_set/op_equal.md | 70 +++++ reference/flat_set/flat_set/rbegin.md | 74 +++++ reference/flat_set/flat_set/rend.md | 66 +++++ reference/flat_set/flat_set/replace.md | 93 ++++++ reference/flat_set/flat_set/size.md | 69 +++++ reference/flat_set/flat_set/swap.md | 75 +++++ reference/flat_set/flat_set/upper_bound.md | 121 ++++++++ reference/flat_set/flat_set/uses_allocator.md | 55 ++++ reference/flat_set/flat_set/value_comp.md | 65 +++++ reference/flat_set/sorted_equivalent_t.md | 64 +++++ reference/flat_set/sorted_unique_t.md | 64 +++++ reference/format/format.md | 2 +- reference/format/range-default-formatter.md | 2 +- reference/format/range_format.md | 2 +- 80 files changed, 6672 insertions(+), 7 deletions(-) create mode 100644 reference/flat_set.md create mode 100644 reference/flat_set/flat_multiset.md create mode 100644 reference/flat_set/flat_multiset/begin.md create mode 100644 reference/flat_set/flat_multiset/cbegin.md create mode 100644 reference/flat_set/flat_multiset/cend.md create mode 100644 reference/flat_set/flat_multiset/clear.md create mode 100644 reference/flat_set/flat_multiset/contains.md create mode 100644 reference/flat_set/flat_multiset/count.md create mode 100644 reference/flat_set/flat_multiset/crbegin.md create mode 100644 reference/flat_set/flat_multiset/crend.md create mode 100644 reference/flat_set/flat_multiset/emplace.md create mode 100644 reference/flat_set/flat_multiset/emplace_hint.md create mode 100644 reference/flat_set/flat_multiset/empty.md create mode 100644 reference/flat_set/flat_multiset/end.md create mode 100644 reference/flat_set/flat_multiset/equal_range.md create mode 100644 reference/flat_set/flat_multiset/erase.md create mode 100644 reference/flat_set/flat_multiset/erase_if_free.md create mode 100644 reference/flat_set/flat_multiset/extract.md create mode 100644 reference/flat_set/flat_multiset/find.md create mode 100644 reference/flat_set/flat_multiset/insert.md create mode 100644 reference/flat_set/flat_multiset/insert_range.md create mode 100644 reference/flat_set/flat_multiset/key_comp.md create mode 100644 reference/flat_set/flat_multiset/lower_bound.md create mode 100644 reference/flat_set/flat_multiset/max_size.md create mode 100644 reference/flat_set/flat_multiset/op_assign.md create mode 100644 reference/flat_set/flat_multiset/op_compare_3way.md create mode 100644 reference/flat_set/flat_multiset/op_constructor.md create mode 100644 reference/flat_set/flat_multiset/op_equal.md create mode 100644 reference/flat_set/flat_multiset/rbegin.md create mode 100644 reference/flat_set/flat_multiset/rend.md create mode 100644 reference/flat_set/flat_multiset/replace.md create mode 100644 reference/flat_set/flat_multiset/size.md create mode 100644 reference/flat_set/flat_multiset/swap.md create mode 100644 reference/flat_set/flat_multiset/upper_bound.md create mode 100644 reference/flat_set/flat_multiset/uses_allocator.md create mode 100644 reference/flat_set/flat_multiset/value_comp.md create mode 100644 reference/flat_set/flat_set.md create mode 100644 reference/flat_set/flat_set/begin.md create mode 100644 reference/flat_set/flat_set/cbegin.md create mode 100644 reference/flat_set/flat_set/cend.md create mode 100644 reference/flat_set/flat_set/clear.md create mode 100644 reference/flat_set/flat_set/contains.md create mode 100644 reference/flat_set/flat_set/count.md create mode 100644 reference/flat_set/flat_set/crbegin.md create mode 100644 reference/flat_set/flat_set/crend.md create mode 100644 reference/flat_set/flat_set/emplace.md create mode 100644 reference/flat_set/flat_set/emplace_hint.md create mode 100644 reference/flat_set/flat_set/empty.md create mode 100644 reference/flat_set/flat_set/end.md create mode 100644 reference/flat_set/flat_set/equal_range.md create mode 100644 reference/flat_set/flat_set/erase.md create mode 100644 reference/flat_set/flat_set/erase_if_free.md create mode 100644 reference/flat_set/flat_set/extract.md create mode 100644 reference/flat_set/flat_set/find.md create mode 100644 reference/flat_set/flat_set/insert.md create mode 100644 reference/flat_set/flat_set/insert_range.md create mode 100644 reference/flat_set/flat_set/key_comp.md create mode 100644 reference/flat_set/flat_set/lower_bound.md create mode 100644 reference/flat_set/flat_set/max_size.md create mode 100644 reference/flat_set/flat_set/op_assign.md create mode 100644 reference/flat_set/flat_set/op_compare_3way.md create mode 100644 reference/flat_set/flat_set/op_constructor.md create mode 100644 reference/flat_set/flat_set/op_equal.md create mode 100644 reference/flat_set/flat_set/rbegin.md create mode 100644 reference/flat_set/flat_set/rend.md create mode 100644 reference/flat_set/flat_set/replace.md create mode 100644 reference/flat_set/flat_set/size.md create mode 100644 reference/flat_set/flat_set/swap.md create mode 100644 reference/flat_set/flat_set/upper_bound.md create mode 100644 reference/flat_set/flat_set/uses_allocator.md create mode 100644 reference/flat_set/flat_set/value_comp.md create mode 100644 reference/flat_set/sorted_equivalent_t.md create mode 100644 reference/flat_set/sorted_unique_t.md diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 19e1e5d88a..b7cd39e05f 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -118,6 +118,7 @@ * fs::filesystem_error[link /reference/filesystem/filesystem_error.md] * fs::path[link /reference/filesystem/path.md] * [link /reference/flat_map.md] +* [link /reference/flat_set.md] * [link /reference/format.md] * [link /reference/forward_list.md] * std::forward_list[link /reference/forward_list/forward_list.md] diff --git a/lang/cpp23.md b/lang/cpp23.md index 904bb7b2b0..707a28225a 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -119,7 +119,7 @@ C++23とは、2023年中に改訂され、ISO/IEC 14882:2024で標準規格化 - 外部から提供されるメモリバッファでストリーム処理を行うライブラリとして[``](/reference/spanstream.md.nolink)を追加 - 正常値とエラー値のどちらかを持つクラスおよびライブラリとして[``](/reference/expected.md)を追加 - 多次元配列ビューのライブラリとして[``](/reference/mdspan.md)を追加 -- ノードベースではないソート済みキーによる順序付き連想コンテナのライブラリとして、[``](/reference/flat_map.md)と[``](/reference/flat_set.md.nolink)を追加 +- ノードベースではないソート済みキーによる順序付き連想コンテナのライブラリとして、[``](/reference/flat_map.md)と[``](/reference/flat_set.md)を追加 - 書式指定で出力するライブラリとして[``](/reference/print.md)を追加 - コルーチンによるRangeの生成をサポートする[``](/reference/generator.md)を追加 - 拡張浮動小数点数のライブラリとして[``](/reference/stdfloat.md)を追加 diff --git a/lang/cpp23/feature_test_macros.md b/lang/cpp23/feature_test_macros.md index ff91490d2e..a065a03100 100644 --- a/lang/cpp23/feature_test_macros.md +++ b/lang/cpp23/feature_test_macros.md @@ -50,8 +50,8 @@ |`__cpp_lib_constexpr_typeinfo`|`202106L`|[`std::type_info::operator==()`](/reference/typeinfo/type_info/op_equal.md)の`constexpr`対応|[``](/reference/typeinfo.md)| |`__cpp_lib_containers_ranges`|`202202L`|コンテナのコンストラクタのRange対応|[``](/reference/vector.md)
[``](/reference/list.md)
[``](/reference/forward_list.md)
[``](/reference/map.md)
[``](/reference/set.md)
[``](/reference/unordered_map.md)
[``](/reference/unordered_set.md)
[``](/reference/deque.md)
[``](/reference/queue.md)
[``](/reference/stack.md)
[``](/reference/string.md)| |`__cpp_lib_expected`|`202211L`|[``](/reference/expected.md)の追加|[``](/reference/expected.md)| -|`__cpp_lib_flat_map`|`202207L`|[`std::flat_map`](/reference/flat_map.md)と`std::flat_multimap`の追加|[``](/reference/flat_map.md)| -|`__cpp_lib_flat_set`|`202207L`|`std::flat_set`と`std::flat_multiset`の追加|``| +|`__cpp_lib_flat_map`|`202207L`|[`std::flat_map`](/reference/flat_map/flat_map.md)と[`std::flat_multimap`](/reference/flat_map/flat_multimap.md)の追加|[``](/reference/flat_map.md)| +|`__cpp_lib_flat_set`|`202207L`|[`std::flat_set`](/reference/flat_set/flat_set.md)と[`std::flat_multiset`](/reference/flat_set/flat_multiset.md)の追加|[``](/reference/flat_set.md)| |`__cpp_lib_format`|`202207L`|`std::format`の時刻型のローカライズ対応|[``](/reference/format.md)| |`__cpp_lib_format_ranges`|`202207L`|[`std::formatter`](/reference/format/formatter.md)のRange対応|[``](/reference/format.md)| |`__cpp_lib_formatters`|`202302L`|[`std::formatter`](/reference/format/formatter.md)の[`std::stacktrace`](/reference/stacktrace/basic_stacktrace.md)対応と[`std::thread::id`](/reference/thread/thread/id.md)対応|[``](/reference/stacktrace.md)
[``](/reference/thread.md)| diff --git a/reference.md b/reference.md index 27970a2e3a..fb07b625d3 100644 --- a/reference.md +++ b/reference.md @@ -111,7 +111,7 @@ | [``](/reference/map.md) | 順序付き連想配列 | | | [``](/reference/set.md) | 順序付き集合 | | | [``](/reference/flat_map.md) | ソート済みキーによる順序付き連想配列 | C++23 | -| [``](/reference/flat_set.md.nolink) | ソート済みキーによる順序付き集合 | C++23 | +| [``](/reference/flat_set.md) | ソート済みキーによる順序付き集合 | C++23 | | [``](/reference/unordered_map.md) | 非順序連想配列 | C++11 | | [``](/reference/unordered_set.md) | 非順序集合 | C++11 | | [``](/reference/span.md) | 部分シーケンスの参照 | C++20 | diff --git a/reference/flat_set.md b/reference/flat_set.md new file mode 100644 index 0000000000..75baddd3a6 --- /dev/null +++ b/reference/flat_set.md @@ -0,0 +1,36 @@ +# flat_set +* flat_set[meta header] +* cpp23[meta cpp] + +`` ヘッダは、ソート済みキーによる連想コンテナを定義する。 + +[`std::set`](/reference/set/set.md)と違ってノードベースの実装ではなく、メモリ連続性のある平坦 (flat) な配列で扱われる。 + +`` ヘッダでは、キーの重複を許さない `std::`[`flat_set`](flat_set/flat_set.md) クラステンプレート、およびキーの重複を許す `std::`[`flat_multiset`](flat_set/flat_multiset.md) クラステンプレートを提供する。 + +このヘッダでは、以下の標準ヘッダをインクルードする: + +- [``](initializer_list.md) +- [``](compare.md) + + +| 名前 | 説明 | 対応バージョン | +|----------------------------------------------------------|----------------------------------------------------------------------|-------| +| [`flat_set`](flat_set/flat_set.md) | キーの重複を許さない平坦な順序付き連想コンテナ(class template) | C++23 | +| [`flat_multiset`](flat_set/flat_multiset.md) | キーの重複を許す平坦な順序付き連想コンテナ(class template) | C++23 | +| [`sorted_unique_t`](flat_set/sorted_unique_t.md) | ソート済みかつ重複要素がないことを示すためのタグ型(class) | C++23 | +| [`sorted_unique`](flat_set/sorted_unique_t.md) | ソート済みかつ重複要素がないことを示すためのタグ値(variable) | C++23 | +| [`sorted_equivalent_t`](flat_set/sorted_equivalent_t.md) | ソート済みであること(重複はしてもよい)を示すためのタグ型(class) | C++23 | +| [`sorted_equivalent`](flat_set/sorted_equivalent_t.md) | ソート済みであること(重複はしてもよい)を示すためのタグ値(variable) | C++23 | + + +## バージョン +### 言語 +- C++23 + + +## 参照 +- [P1222R0 A Standard `flat_set`](hhttps://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1222r0.pdf) + - C++23で`flat_set`が導入された経緯・動機・設計について記載されている +- [P1222R4 A Standard `flat_set`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1222r4.pdf) + - C++23で導入された`flat_set`の仕様 diff --git a/reference/flat_set/flat_multiset.md b/reference/flat_set/flat_multiset.md new file mode 100644 index 0000000000..c46cd944ea --- /dev/null +++ b/reference/flat_set/flat_multiset.md @@ -0,0 +1,230 @@ +# flat_multiset +* flat_multiset[meta header] +* std[meta namespace] +* class template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template , + class KeyContainer = vector> + class flat_multiset; +} +``` +* less[link ../functional/less.md] +* vector[link /reference/vector/vector.md] + +## 概要 + + +## メンバ関数 +### 構築・破棄 + +| 名前 | 説明 | 対応バージョン | +|---------------------------------|----------------|-------| +| [`(constructor)`](flat_multiset/op_constructor.md) | コンストラクタ | C++23 | +| [`(destructor)`](flat_multiset/op_destructor.md.nolink) | デストラクタ | C++23 | +| [`operator=`](flat_multiset/op_assign.md) | 代入演算子 | C++23 | + + +### イテレータ + +| 名前 | 説明 | 対応バージョン | +|---------------------------------------|--------------------------------------------------|-------| +| [`begin`](flat_multiset/begin.md) | 先頭を指すイテレータを取得する | C++23 | +| [`cbegin`](flat_multiset/cbegin.md) | 先頭を指す読み取り専用イテレータを取得する | C++23 | +| [`end`](flat_multiset/end.md) | 末尾の次を指すイテレータを取得する | C++23 | +| [`cend`](flat_multiset/cend.md) | 末尾の次を指す読み取り専用イテレータを取得する | C++23 | +| [`rbegin`](flat_multiset/rbegin.md) | 末尾を指す逆イテレータを取得する | C++23 | +| [`crbegin`](flat_multiset/crbegin.md) | 末尾を指す読み取り専用逆イテレータを取得する | C++23 | +| [`rend`](flat_multiset/rend.md) | 先頭の前を指す逆イテレータを取得する | C++23 | +| [`crend`](flat_multiset/crend.md) | 先頭の前を指す読み取り専用逆イテレータを取得する | C++23 | + + +### 領域 + +| 名前 | 説明 | 対応バージョン | +|-----------------------------------------|------------------------------------|-------| +| [`empty`](flat_multiset/empty.md) | コンテナが空であるかどうかを調べる | C++23 | +| [`size`](flat_multiset/size.md) | 要素数を取得する | C++23 | +| [`max_size`](flat_multiset/max_size.md) | 格納可能な最大の要素数を取得する | C++23 | + + +### コンテナの変更 + +| 名前 | 説明 | 対応バージョン | +|-------------------------------------------------|--------------------------------------------|----------------| +| [`clear`](flat_multiset/clear.md) | 全ての要素を削除する | C++23 | +| [`insert`](flat_multiset/insert.md) | 要素を挿入する | C++23 | +| [`insert_range`](flat_multiset/insert_range.md) | Rangeを挿入する | C++23 | +| [`emplace`](flat_multiset/emplace.md) | 要素を直接構築する | C++23 | +| [`emplace_hint`](flat_multiset/emplace_hint.md) | ヒントを使って要素を直接構築する | C++23 | +| [`erase`](flat_multiset/erase.md) | 要素を削除する | C++23 | +| [`swap`](flat_multiset/swap.md) | コンテンツを交換する | C++23 | +| [`extract`](flat_multiset/extract.md) | キーのコンテナを取得する | C++23 | +| [`replace`](flat_multiset/replace.md) | キーのコンテナを置き換える | C++23 | + +### 要素アクセス + +| 名前 | 説明 | 対応バージョン | +|-----------------------------------------------|--------------------------------------------|-------| +| [`count`](flat_multiset/count.md) | 指定したキーにマッチする要素の数を取得する | C++23 | +| [`find`](flat_multiset/find.md) | 指定したキーで要素を探す | C++23 | +| [`contains`](flat_multiset/contains.md) | 指定したキーの要素が含まれているかを判定する | C++23 | +| [`equal_range`](flat_multiset/equal_range.md) | 指定したキーにマッチする要素範囲を取得する | C++23 | +| [`lower_bound`](flat_multiset/lower_bound.md) | 与えられた値より小さくない最初の要素へのイテレータを取得する | C++23 | +| [`upper_bound`](flat_multiset/upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを取得する | C++23 | + +### オブザーバー + +| 名前 | 説明 | 対応バージョン | +|---------------------------------------------|----------------------------------------|----------------| +| [`key_comp`](flat_multiset/key_comp.md) | キー比較用の関数オブジェクトを取得する | C++23 | +| [`value_comp`](flat_multiset/value_comp.md) | 要素比較用の関数オブジェクトを取得する | C++23 | + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|--------------------------|---------------------------|----------------| +| `key_type` | キーの型。テンプレートパラメータ `Key` | C++23 | +| `value_type` | 要素の型。テンプレートパラメータ `Key` | C++23 | +| `key_compare` | キーの大小関係を判定する二項述語の型。テンプレートパラメータ `Compare` | C++23 | +| `value_compare` | 要素の大小関係を判定する二項述語の型。テンプレートパラメータ `Compare` | C++23 | +| `reference` | 要素への参照型。`value_type&` | C++23 | +| `const_reference` | 要素への`const`参照型。`const value_type&` | C++23 | +| `size_type` | 要素数を表す符号なし整数型 [`size_t`](/reference/cstddef/size_t.md) | C++23 | +| `difference_type` | 同一のコンテナを指す `iterator` の差を表す符号付き整数型 [`ptrdiff_t`](/reference/cstddef/ptrdiff_t.md) | C++23 | +| `iterator` | ランダムアクセスイテレータ | C++23 | +| `const_iterator` | 読み取り専用ランダムアクセスイテレータ | C++23 | +| `reverse_iterator` | 逆順ランダムアクセスイテレータ。[`std::reverse_iterator`](/reference/iterator/reverse_iterator.md)`` | C++23 | +| `const_reverse_iterator` | 読み取り専用逆順ランダムアクセスイテレータ。[`std::reverse_iterator`](/reference/iterator/reverse_iterator.md)`` | C++23 | +| `container_type` | キーを格納するコンテナ型 `KeyContainer` | C++23 | + + +## 非メンバ関数 +### 要素削除 + +| 名前 | 説明 | 対応バージョン | +|----------------------------------------------|-------------------------------------|----------------| +| [`erase_if`](flat_multiset/erase_if_free.md) | 指定した条件に合致する要素とその分の領域を、コンテナから削除する | C++23 | + + +## 非メンバ(*Hidden friends*)関数 +### 比較演算子 + +| 名前 | 説明 | 対応バージョン | +|--------------------------------------------------------------------|----------------------------|-------| +| [`operator==`](flat_multiset/op_equal.md) | 左辺と右辺が等しいかの判定を行う | C++23 | +| `bool operator!=(const flat_multiset& x, const flat_multiset& y);` | 左辺と右辺が等しくないかの判定を行う (`==`により使用可能) | C++23 | +| [`operator<=>`](flat_multiset/op_compare_3way.md) | 三方比較を行う | C++23 | +| `bool operator<(const flat_multiset& x, const flat_multiset& y);` | 左辺が右辺より小さいかの判定を行う (`<=>`により使用可能) | C++23 | +| `bool operator<=(const flat_multiset& x, const flat_multiset& y);` | 左辺が右辺より小さいか等しいかの判定を行う (`<=>`により使用可能) | C++23 | +| `bool operator>(const flat_multiset& x, const flat_multiset& y);` | 左辺が右辺より大きいかの判定を行う (`<=>`により使用可能) | C++23 | +| `bool operator>=(const flat_multiset& x, const flat_multiset& y);` | 左辺が右辺より大きいか等しいかの判定を行う (`<=>`により使用可能) | C++23 | + + +### 入れ替え + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`swap`](flat_multiset/swap_free.md.nolink) | 2つの`flat_multiset`オブジェクトを入れ替える | C++23 | + + +## 推論補助 + +| 名前 | 説明 | 対応バージョン | +|---------------------------------------------|------------------------------------|-------| +| [`(deduction_guide)`](flat_multiset/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | + + +## その他 + +| 名前 | 説明 | 対応バージョン | +|------------------------------------------------|----------------------|-------| +| [`uses_allocator`](flat_multiset/uses_allocator.md) | `flat_multiset`による特殊化 | C++23 | + + + +## 例 +### 基本的な使い方 +```cpp example +#include +#include +#include + +int main() +{ + // stringをキーとして扱う連想配列 + std::flat_multiset fs = {"Carol", "Alice", "Bob", "Carol"}; + + // 検索 : キーを指定し、イテレータを得る + auto it = fs.find("Alice"); + std::cout << *it << std::endl + << std::endl; + + // 全体を出力する + for (const auto& str : fs) { + std::cout << str << std::endl; + } +} +``` +* fs.find[link flat_multiset/find.md] + +#### 出力 +``` +Alice + +Alice +Bob +Carol +Carol +``` + +### キー以外のテンプレートを指定 +```cpp example +#include +#include +#include + +int main() +{ + std::deque keys = {1, 4, 2, 8, 5, 7}; + + // intをキーとして扱う連想配列 + // キーの順序はgreater、キーのコンテナはdequeで保持 + std::flat_multiset, + std::deque> fs(keys); + + // 全体を出力する + for (int i : fs) { + std::cout << i << " "; + } + std::cout << std::endl; +} +``` +* std::greater[link ../functional/greater.md] + +#### 出力 +``` +8 7 5 4 2 1 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P1222R0 A Standard `flat_set`](hhttps://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1222r0.pdf) + - C++23で`flat_set`が導入された経緯・動機・設計について記載されている +- [P1222R4 A Standard `flat_set`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1222r4.pdf) + - C++23で導入された`flat_set`の仕様 diff --git a/reference/flat_set/flat_multiset/begin.md b/reference/flat_set/flat_multiset/begin.md new file mode 100644 index 0000000000..1db00e406d --- /dev/null +++ b/reference/flat_set/flat_multiset/begin.md @@ -0,0 +1,74 @@ +# begin +* flat_set[meta header] +* std[meta namespace] +* flat_multiset[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +iterator begin() noexcept; +const_iterator begin() const noexcept; +``` + + +## 概要 +コンテナの先頭要素を参照するイテレータを取得する。 + +内部的に、コンテナは要素を下位から上位へと並べており、従って`begin()`はコンテナ内の最下位のキーにあたる値へのイテレータを返す。 + + +## 戻り値 +コンテナの先頭要素へのイテレータ。 +`iterator` と `const_iterator` はともにメンバ型である。このクラステンプレートにおいて、これらはランダムアクセスイテレータである。 + + +## 計算量 +定数時間。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_multiset fs = {3, 1, 4, 1}; + + for (auto i = fs.begin(); i != fs.end(); ++i) { + std::cout << *i << std::endl; + } +} +``` +* begin()[color ff0000] +* fs.end()[link end.md] + +### 出力 +``` +1 +1 +3 +4 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|-----------------------------------|--------------------------------| +| [`flat_multiset::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`flat_multiset::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`flat_multiset::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`flat_multiset::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | +| [`flat_multiset::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`flat_multiset::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | +| [`flat_multiset::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | diff --git a/reference/flat_set/flat_multiset/cbegin.md b/reference/flat_set/flat_multiset/cbegin.md new file mode 100644 index 0000000000..31da02d40f --- /dev/null +++ b/reference/flat_set/flat_multiset/cbegin.md @@ -0,0 +1,70 @@ +# cbegin +* flat_set[meta header] +* std[meta namespace] +* flat_multiset[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +const_iterator cbegin() const noexcept; +``` + + +## 概要 +コンテナの先頭要素を参照するイテレータを取得する。 + +内部的に、コンテナは要素を下位から上位へと並べており、従って`cbegin()`はコンテナ内の最下位のキーにあたる値へのイテレータを返す。 + + +## 戻り値 +コンテナの先頭要素へのイテレータ。 +`const_iterator` はメンバ型である。このクラステンプレートにおいて、この型はランダムアクセスイテレータである。 + + +## 計算量 +定数時間。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_multiset fs = {3, 1, 4, 1}; + + for (auto i = fs.cbegin(); i != fs.cend(); ++i) { + std::cout << *i << std::endl; + } +} +``` +* cbegin()[color ff0000] +* fs.cend()[link cend.md] + +### 出力 +``` +1 +1 +3 +4 +``` + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|-----------------------------------|--------------------------------| +| [`flat_multiset::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`flat_multiset::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`flat_multiset::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`flat_multiset::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | +| [`flat_multiset::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`flat_multiset::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | +| [`flat_multiset::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | diff --git a/reference/flat_set/flat_multiset/cend.md b/reference/flat_set/flat_multiset/cend.md new file mode 100644 index 0000000000..cf1cf81a0b --- /dev/null +++ b/reference/flat_set/flat_multiset/cend.md @@ -0,0 +1,74 @@ +# cend +* flat_set[meta header] +* std[meta namespace] +* flat_multiset[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +const_iterator cend() const noexcept; +``` + +## 概要 +コンテナの末尾の次を参照するイテレータを取得する。 + + +## 戻り値 +コンテナの末尾の次を参照するイテレータ。 +`const_iterator` はメンバ型である。このクラステンプレートにおいて、この型はランダムアクセスイテレータである。 + + +## 計算量 +定数時間。 + + +## 備考 +- この関数によって返されるイテレータは、`*this`が保持するいずれの要素も参照しない。その指す先は、不正な範囲となるだろう + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_multiset fs = {3, 1, 4, 1}; + + for (auto i = fs.cbegin(); i != fs.cend(); ++i) { + std::cout << *i << std::endl; + } +} +``` +* cend()[color ff0000] +* fs.cbegin()[link cbegin.md] + +### 出力 +``` +1 +1 +3 +4 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 関連項目 + +| 名前 | 説明 | +|-----------------------------------|-----------------------------| +| [`flat_multiset::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`flat_multiset::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`flat_multiset::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`flat_multiset::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | +| [`flat_multiset::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`flat_multiset::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | +| [`flat_multiset::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + diff --git a/reference/flat_set/flat_multiset/clear.md b/reference/flat_set/flat_multiset/clear.md new file mode 100644 index 0000000000..d935fd497e --- /dev/null +++ b/reference/flat_set/flat_multiset/clear.md @@ -0,0 +1,56 @@ +# clear +* flat_set[meta header] +* std[meta namespace] +* flat_multiset[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +void clear() noexcept; // (1) C++23 +``` + +## 概要 +コンテナ内の全ての要素を削除する。各要素のデストラクタが呼ばれ、コンテナから削除される。[`size()`](size.md) は 0 になる。 + + +## 計算量 +線形時間。 + + +## 例外 +投げない。 + + +## 例 +```cpp example +#include +#include + +int main () +{ + std::flat_multiset fs = {3, 1, 4, 1}; + + std::cout << fs.size() << std::endl; + + fs.clear(); + + std::cout << fs.size() << std::endl; +} +``` +* clear()[color ff0000] +* fs.size()[link size.md] + +### 出力 +``` +4 +0 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/flat_set/flat_multiset/contains.md b/reference/flat_set/flat_multiset/contains.md new file mode 100644 index 0000000000..48e2daa1ac --- /dev/null +++ b/reference/flat_set/flat_multiset/contains.md @@ -0,0 +1,80 @@ +# contains +* flat_set[meta header] +* std[meta namespace] +* flat_multiset[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +bool contains(const key_type& x) const; // (1) C++23 + +template +bool contains(const K& x) const; // (2) C++23 +``` + + +## 概要 +指定されたキー`x`に一致する要素がコンテナに含まれているかを判定する。 + +- (1) : クラスのテンプレートパラメータ`key_type`型のキーを受け取る +- (2) : `key_type`と比較可能な`K`型のキーを受け取る + + +## テンプレートパラメータ制約 +- (2) : `key_compare::is_transparent`が妥当な式であること + + +## 戻り値 +以下と等価: + +```cpp +return find(x) != end(); +``` +* find[link find.md] +* end()[link end.md] + + +## 計算量 +対数時間 + + +## 備考 +- (2) : + - `is_transparent`は、標準ライブラリの[`std::less`](/reference/functional/less.md)、[`std::greater`](/reference/functional/greater.md)といった関数オブジェクトの、`void`に対する特殊化で定義される。それ以外のテンプレートパラメータで`is_transparent`が定義されないのは、互換性のためである。 + - これらのオーバーロードは、`flat_multiset`のようなコンテナに対し、検索操作で文字列リテラルを渡した際に、キー型の一時オブジェクトが生成されるコストを減らすためにある。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_set fs = {3, 1, 4, 1}; + + // キー3の要素が含まれているか + if (fs.contains(3)) { + std::cout << "contain" << std::endl; + } + else { + std::cout << "doesn't contain" << std::endl; + } +} +``` +* contains[color ff0000] + +### 出力 +``` +contain +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/flat_set/flat_multiset/count.md b/reference/flat_set/flat_multiset/count.md new file mode 100644 index 0000000000..c605ea333d --- /dev/null +++ b/reference/flat_set/flat_multiset/count.md @@ -0,0 +1,90 @@ +# count +* flat_set[meta header] +* std[meta namespace] +* flat_multiset[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +size_type count(const key_type& x) const; // (1) C++23 + +template +size_type count(const K& x) const; // (2) C++23 +``` + +## 概要 +キー `x` を検索し、コンテナ内に見つかった要素の数を返す。 + +- (1) : クラスのテンプレートパラメータ`key_type`型のキー `x` を受け取って、`x` と等価なキーを持つ要素の数を取得する。 +- (2) : `key_type`と比較可能な`K`型のキー `x` を受け取って、`x`と等価なキーを持つ要素の数を取得する。 + + +## テンプレートパラメータ制約 +- (2) : `key_compare::is_transparent`が妥当な式であること + + +## 戻り値 +- (1) : `x`と等価なキーの要素数を返す。 +- (2) : `key_compare`型の関数オブジェクトを`c`、コンテナ内の各要素が持つキーを`k`として、キーが等価か判定する式`!c(k, x) && !c(x, k)`が`true`となる要素の数を返す。 + + +## 計算量 +``` +log(size()) + count(x) +``` +* size()[link size.md] + + +## 備考 +- (2) : + - `is_transparent`は、標準ライブラリの[`std::less`](/reference/functional/less.md)、[`std::greater`](/reference/functional/greater.md)といった関数オブジェクトの、`void`に対する特殊化で定義される。それ以外のテンプレートパラメータで`is_transparent`が定義されないのは、互換性のためである。 + - これらのオーバーロードは、`flat_multiset`のようなコンテナに対し、検索操作で文字列リテラルを渡した際に、キー型の一時オブジェクトが生成されるコストを減らすためにある。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + // (1) + { + std::flat_multiset fs = {"Alice", "Bob", "Carol"}; + + std::cout << fs.count("Bob") << std::endl; + } + + // (2) + { + std::flat_multiset> fs = {"Alice", "Bob", "Carol"}; + + // std::lessのvoidに対する特殊化を使用することで、 + // 文字列リテラルをcount()関数の引数として渡した際に、 + // std::string型の一時オブジェクトが生成されない。 + std::cout << fs.count("Bob") << std::endl; + } +} +``` +* fs.count[color ff0000] +* std::less[link /reference/functional/less.md] + +### 出力 +``` +1 +1 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`contains()`](contains.md) diff --git a/reference/flat_set/flat_multiset/crbegin.md b/reference/flat_set/flat_multiset/crbegin.md new file mode 100644 index 0000000000..769fb3b2d4 --- /dev/null +++ b/reference/flat_set/flat_multiset/crbegin.md @@ -0,0 +1,71 @@ +# crbegin +* flat_set[meta header] +* std[meta namespace] +* flat_multiset[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +const_reverse_iterator crbegin() const noexcept; +``` + +## 概要 +コンテナ内の末尾を指す逆イテレータを取得する。 +内部的に、このコンテナは各要素をキーの値に従って下位から上位へと並べており、従って `crbegin()` は最上位のキーにあたる値へのイテレータを返す。 +`crbegin()` は [`end()`](end.md) と同じ要素を指すわけではなく、その前の要素を指すことに注意。 + + +## 戻り値 +反転したシーケンスの先頭を指す逆イテレータ。 +`const_reverse_iterator` はメンバ型である。このクラステンプレートにおいて、この型は逆ランダムアクセスイテレータであり、`reverse_iterator` と定義される。 + + +## 計算量 +定数時間。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_multiset fs = {3, 1, 4, 1}; + + for (auto i = fs.crbegin(); i != fs.crend(); ++i) { + std::cout << *i << std::endl; + } +} +``` +* crbegin()[color ff0000] +* fs.crend()[link crend.md] + +### 出力 +``` +4 +3 +1 +1 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +| 名前 | 説明 | +|---------------------------------|-----------------------------| +| [`flat_multiset::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`flat_multiset::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`flat_multiset::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`flat_multiset::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`flat_multiset::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | +| [`flat_multiset::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`flat_multiset::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | diff --git a/reference/flat_set/flat_multiset/crend.md b/reference/flat_set/flat_multiset/crend.md new file mode 100644 index 0000000000..01cd3265be --- /dev/null +++ b/reference/flat_set/flat_multiset/crend.md @@ -0,0 +1,69 @@ +# crend +* flat_set[meta header] +* std[meta namespace] +* flat_multiset[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +const_reverse_iterator crend() const noexcept; +``` + + +## 概要 +コンテナの先頭要素の前(これは反転シーケンスの末尾にあたる)を指す逆イテレータを取得する。 +`crend()` は [`begin()`](begin.md) と同じ要素を指すわけではなく、その前の要素を指すことに注意。 + + +## 戻り値 +反転シーケンスの終端を指す逆イテレータ。 +`const_reverse_iterator` はメンバ型である。`flat_multiset` クラステンプレートにおいて、これらは逆ランダムアクセスイテレータであり、`reverse_iterator` と定義される。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_multiset fs = {3, 1, 4, 1}; + + for (auto i = fs.crbegin(); i != fs.crend(); ++i) { + std::cout << *i << std::endl; + } +} +``` +* crend()[color ff0000] +* fs.crbegin()[link crbegin.md] + +### 出力 +``` +4 +3 +1 +1 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + + +## 関連項目 + +| 名前 | 説明 | +|------------------------------|-----------------------------------------| +| [`flat_multiset::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`flat_multiset::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`flat_multiset::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`flat_multiset::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`flat_multiset::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | +| [`flat_multiset::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`flat_multiset::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | diff --git a/reference/flat_set/flat_multiset/emplace.md b/reference/flat_set/flat_multiset/emplace.md new file mode 100644 index 0000000000..02e7feb99d --- /dev/null +++ b/reference/flat_set/flat_multiset/emplace.md @@ -0,0 +1,109 @@ +# emplace +* flat_set[meta header] +* std[meta namespace] +* flat_multiset[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +template +iterator emplace(Args&&... args); +``` + +## 概要 +コンテナに新しい要素を挿入する。要素は直接構築される(コピーもムーブもされない)。要素のコンストラクタはこの関数に渡された引数を与えることによって呼ばれる。 + + +## パラメータ +- `args...` : 要素のコンストラクタへ転送される引数パック。 + + +## テンプレートパラメータ制約 +- [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true`であること。 + + +## 戻り値 +挿入された要素へのイテレータを返す。 + + +## 例 +### 単純な挿入の例 +```cpp example +#include +#include + +int main() +{ + std::flat_multiset fs; + + fs.emplace(3); + fs.emplace(1); + fs.emplace(4); + fs.emplace(1); + + for (int i : fs) { + std::cout << i << std::endl; + } +} +``` +* emplace[color ff0000] + +#### 出力 +``` +1 +1 +3 +4 +``` + +### コンストラクタ引数を渡す例 +```cpp example +#include +#include +#include +#include + +int main() +{ + std::flat_multiset fs; + const char aaa[3] = {'A', 'A', 'A'}; + + fs.emplace(5, 'C'); + fs.emplace(aaa, 3); + fs.emplace("BBBB"); + fs.emplace(std::begin(aaa), std::end(aaa)); + + for (const std::string& i : fs) { + std::cout << i << std::endl; + } +} +``` +* emplace[color ff0000] +* std::begin[link /reference/iterator/begin.md] +* std::end[link /reference/iterator/end.md] + +#### 出力 +``` +AAA +AAA +BBBB +CCCCC +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +| 名前 | 説明 | +|--------------------------------------------------|----------------------------------| +| [`flat_multiset::insert`](insert.md) | 要素を挿入する | +| [`flat_multiset::insert_range`](insert_range.md) | Rangeを挿入する | +| [`flat_multiset::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | diff --git a/reference/flat_set/flat_multiset/emplace_hint.md b/reference/flat_set/flat_multiset/emplace_hint.md new file mode 100644 index 0000000000..acaa292836 --- /dev/null +++ b/reference/flat_set/flat_multiset/emplace_hint.md @@ -0,0 +1,74 @@ +# emplace_hint +* flat_set[meta header] +* std[meta namespace] +* flat_multiset[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +template +iterator emplace_hint(const_iterator hint, Args&&... args); +``` + +## 概要 +要素が配置されるべき場所を示唆するパラメータ `hint` を使って、コンテナに新しい要素を挿入する。要素は直接構築される(コピーもムーブもされない)。要素のコンストラクタはこの関数に渡された引数と同じ引数で呼ばれる。 + + +## パラメータ +- `hint` : 新しい要素をどこへ挿入するかを示唆するために使われるイテレータ +- `args...` : 要素のコンストラクタへ転送される引数パック + + +## 戻り値 +追加された要素を指すイテレータ。 + + +## 計算量 +一般にコンテナのサイズについて対数時間だが、新しい要素が `hint` の前に挿入された場合は償却定数時間。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_multiset fs = {3, 1, 4}; + + // キー5の要素が最後尾に追加されることが事前にわかっているので、fs.end()をヒントとして与える + fs.emplace_hint(fs.end(), 5); + + for (int i : fs) { + std::cout << i << std::endl; + } +} +``` +* emplace_hint[color ff0000] +* fs.end()[link end.md] + +### 出力 +``` +1 +3 +4 +5 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +| 名前 | 説明 | +|--------------------------------------------------|--------------------| +| [`flat_multiset::insert`](insert.md) | 要素を挿入する | +| [`flat_multiset::insert_range`](insert_range.md) | Rangeを挿入する | +| [`flat_multiset::emplace`](emplace.md) | 要素を直接構築する | diff --git a/reference/flat_set/flat_multiset/empty.md b/reference/flat_set/flat_multiset/empty.md new file mode 100644 index 0000000000..df552ef67a --- /dev/null +++ b/reference/flat_set/flat_multiset/empty.md @@ -0,0 +1,59 @@ +# empty +* flat_set[meta header] +* std[meta namespace] +* flat_multiset[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +[[nodiscard]] bool empty() const noexcept; // (1) C++23 +``` + +## 概要 +コンテナが空かどうかをテストする。 +コンテナが空([`size()`](size.md) が 0)の場合に `true` を返す。 + +この関数はコンテナ内のコンテンツを変化させない。コンテンツをクリアするには [`clear()`](clear.md) メンバ関数を使用する。 + + +## 戻り値 +コンテナサイズが 0 のときに `true`, そうでないときに `false` を返す。 + + +## 計算量 +定数時間。 + + +## 例 +```cpp example +#include +#include + +int main () +{ + std::flat_multiset fs; + + std::cout << fs.empty() << std::endl; + + fs.insert(42); + + std::cout << fs.empty() << std::endl; +} +``` +* empty()[color ff0000] +* fs.insert[link insert.md] + +### 出力 +``` +1 +0 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/flat_set/flat_multiset/end.md b/reference/flat_set/flat_multiset/end.md new file mode 100644 index 0000000000..48ab910d61 --- /dev/null +++ b/reference/flat_set/flat_multiset/end.md @@ -0,0 +1,75 @@ +# end +* flat_set[meta header] +* std[meta namespace] +* flat_multiset[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +iterator end() noexcept; +const_iterator end() const noexcept; +``` + +## 概要 +コンテナの末尾の次を参照するイテレータを取得する。 + + +## 戻り値 +コンテナの最後の要素の次を参照するイテレータ。 +`iterator` と `const_iterator` はいずれもメンバ型である。このクラステンプレートにおいて、これらはランダムアクセスイテレータである。 + + +## 計算量 +定数時間。 + + +## 備考 +- この関数によって返されるイテレータは、`*this`が保持するいずれの要素も参照しない。その指す先は、不正な範囲となるだろう + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_multiset fs = {3, 1, 4, 1}; + + for (auto i = fs.begin(); i != fs.end(); ++i) { + std::cout << *i << std::endl; + } +} +``` +* end()[color ff0000] +* fs.begin()[link begin.md] + +### 出力 +``` +1 +1 +3 +4 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|-----------------------------------|-----------------------------| +| [`flat_multiset::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`flat_multiset::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`flat_multiset::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`flat_multiset::rbegin`](rbegin.md) | 末尾の次を指す逆イテレータを取得する | +| [`flat_multiset::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`flat_multiset::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | +| [`flat_multiset::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | diff --git a/reference/flat_set/flat_multiset/equal_range.md b/reference/flat_set/flat_multiset/equal_range.md new file mode 100644 index 0000000000..6ead8e62e3 --- /dev/null +++ b/reference/flat_set/flat_multiset/equal_range.md @@ -0,0 +1,86 @@ +# equal_range +* flat_set[meta header] +* std[meta namespace] +* flat_multiset[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +pair equal_range(const key_type& x); // (1) C++23 + +template +pair equal_range(const K& x); // (2) C++23 + +pair + equal_range(const key_type& x) const; // (3) C++23 + +template +pair + equal_range(const K& x) const; // (4) C++23 +``` +* pair[link /reference/utility/pair.md] + +## 概要 +コンテナ内の、`x` と等しいキー要素を全て含む範囲の境界を返す。 + +もし `x` がコンテナ内のどのキーともマッチしなかった場合、戻り値の範囲は長さ 0 になり、両方のイテレータは `x` より大きく最も近い値を指す。そうでない場合、`x` がコンテナ内の全ての要素よりも大きい場合は [`end()`](end.md) を指す。 + +- (1) : `key_type`型のキーを受け取り、そのキーと等価なキー要素を全て含むイテレータ範囲を取得する。 +- (2) : `key_type`と比較可能な`K`型のキーを受け取り、そのキーと等価なキー要素を全て含むイテレータ範囲を取得する。 +- (3) : `const`な`*this`オブジェクトにおいて、`key_type`型のキーを受け取り、そのキーと等価なキー要素を全て含むイテレータ範囲を取得する。 +- (4) : `const`な`*this`オブジェクトにおいて、`key_type`と比較可能な`K`型のキーを受け取り、そのキーと等価なキー要素を全て含むイテレータ範囲を取得する。 + + +## 戻り値 +この関数は `pair` を返す。ここで `pair::first` は [`lower_bound()`](lower_bound.md)`(x)` が返すであろう値と同じ値で範囲の下境界にあたり、`pair::second` は [`upper_bound()`](upper_bound.md)`(x)` が返すであろう値と同じ値で範囲の上境界にあたる。 + + +## 計算量 +[`size()`](size.md) について対数時間。 + + +## 備考 +- (2), (4) : この関数がオーバーロード解決に参加する条件は、[`find()`](find.md)メンバ関数の備考欄を参照。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::flat_multiset fs = {3, 1, 4, 1, 3}; + + using iterator = decltype(fs)::iterator; + std::pair ret = fs.equal_range(3); + + for (iterator it = ret.first; it != ret.second; ++it) { + std::cout << *it << std::endl; + } +} +``` +* equal_range[color ff0000] + +### 出力 +``` +3 +3 +``` + + +## バージョン +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +| 名前 | 説明 | +|------------------------------------------------|----------------------------------------------------------| +| [`flat_multiset::count`](count.md) | 指定したキーにマッチする要素の数を返す | +| [`flat_multiset::lower_bound`](lower_bound.md) | 与えられた値より小さくない最初の要素へのイテレータを返す | +| [`flat_multiset::upper_bound`](upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | +| [`flat_multiset::find`](find.md) | 指定したキーで要素を探す | diff --git a/reference/flat_set/flat_multiset/erase.md b/reference/flat_set/flat_multiset/erase.md new file mode 100644 index 0000000000..725f6a5a65 --- /dev/null +++ b/reference/flat_set/flat_multiset/erase.md @@ -0,0 +1,140 @@ +# erase +* flat_set[meta header] +* std[meta namespace] +* flat_multiset[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +iterator erase(iterator position); // (1) C++23 + +iterator erase(const_iterator position); // (2) C++23 + +size_type erase(const key_type& x); // (3) C++23 + +template +size_type erase(K&& x); // (4) C++23 + +iterator erase(const_iterator first, const_iterator last); // (5) C++23 +``` + +## 概要 +単一要素またはイテレータ範囲`[first, last)`を コンテナから削除する。 + +これは削除された要素の数だけコンテナの `size` を減らし、それぞれの要素のデストラクタを呼び出す。 + +- (1) : 指定されたイテレータが指す要素を削除する +- (2) : 指定された読み取り専用イテレータが指す要素を削除する +- (3) : 指定されたキーをもつ要素を削除する +- (4) : `key_type`と比較可能な`K`型のキーを受け取って要素を削除する +- (5) : 指定されたイテレータ範囲の要素をすべて削除する + + +## パラメータ +- `position` : 削除する単一要素を指すイテレータ。`iterator` はメンバ型であり、双方向イテレータとして定義される。 +- `x` : 削除する値のキー。`key_type` はメンバ型であり、コンテナの中で `Key` の別名として定義される。 +- `first, last` : 削除するイテレータ範囲 `[first, last)` を指定するイテレータ。ここでいう範囲は `first` と `last` の間の全ての要素を含み、`first` が指す要素を含むが `last` が指す要素は含まない。 + + +## 戻り値 +- (1), (2), (5) : 削除された要素の次を指すイテレータを返す。そのような要素がない場合、[`end()`](end.md)を返す (要素を削除した結果としてコンテナが空になった場合) +- (3), (4) : 削除された要素の数を返す。 + + +## 計算量 +- (1), (2) : 定数時間 +- (3), (4) : コンテナの [`size()`](size.md) について対数時間に加えて、`count(x)` について線形時間 +- (5) : コンテナの [`size()`](size.md) について対数時間、それに加えて `first` と `last` の間の距離に対する線形時間 + + +## 備考 +- (1), (2) : この関数に、範囲外のイテレータ (終端イテレータを含む) を指定した場合の動作は未定義 + + +## 例 +### 基本的な使い方 (C++23) +```cpp example +#include +#include + +int main() +{ + std::flat_multiset fs = {3, 1, 4, 1}; + + std::cout << fs.size() << std::endl; + + fs.erase(1); + std::cout << fs.size() << std::endl; + + fs.erase(fs.begin(), fs.end()); + std::cout << fs.size() << std::endl; +} +``` +* erase[color ff0000] +* fs.size()[link size.md] +* fs.begin()[link begin.md] +* fs.end()[link end.md] + +#### 出力 +``` +4 +2 +0 +``` + +### イテレート中に要素を削除する (C++23) +```cpp example +#include +#include + +int main() +{ + std::flat_multiset fs = {3, 1, 4, 1}; + + // イテレート中に要素削除をするような場合には、 + // 範囲for文は使用できない + for (auto it = fs.begin(); it != fs.end();) { + // 条件一致した要素を削除する + if (*it == 1) { + // 削除された要素の次を指すイテレータが返される。 + it = fs.erase(it); + } + // 要素削除をしない場合に、イテレータを進める + else { + ++it; + } + } + + for (int i : fs) { + std::cout << i << std::endl; + } +} +``` +* erase[color ff0000] +* fs.begin()[link begin.md] +* fs.end()[link end.md] + +#### 出力 +``` +3 +4 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|--------------------------------------|--------------------------| +| [`flat_multiset::clear`](clear.md) | 全ての要素を削除する | +| [`flat_multiset::insert`](insert.md) | 要素を挿入する | +| [`flat_multiset::find`](find.md) | 指定したキーで要素を探す | diff --git a/reference/flat_set/flat_multiset/erase_if_free.md b/reference/flat_set/flat_multiset/erase_if_free.md new file mode 100644 index 0000000000..a35c1ddf0e --- /dev/null +++ b/reference/flat_set/flat_multiset/erase_if_free.md @@ -0,0 +1,77 @@ +# erase_if +* flat_set[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template + typename flat_multiset::size_type + erase_if(flat_multiset& c, + Predicate pred); +} +``` + +## 概要 +指定した条件に合致する要素とその分の領域を、コンテナから削除する。 + + +## 事前条件 +- `Key`と`T`がムーブ代入可能であること + + +## 効果 +メンバ変数として保持しているコンテナ`c`の各要素`e`について、`bool(pred(e))`を`E`として、`E`が`true`であるすべての要素を削除する。 + + +## 戻り値 +削除した要素数を返す。 + + +## 計算量 +正確に[`size()`](size.md)回だけ述語適用する。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::flat_multiset fs = {3, 1, 4, 1}; + + // コンテナfsから、キーが1の要素をすべて削除する + auto num = std::erase_if(fs, [](const auto& x) { return x == 1; }); + + std::cout << num << std::endl + << std::endl; + + for (int i : fs) { + std::cout << i << std::endl; + } +} +``` +* std::erase_if[color ff0000] + +### 出力 +``` +2 + +3 +4 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/flat_set/flat_multiset/extract.md b/reference/flat_set/flat_multiset/extract.md new file mode 100644 index 0000000000..43508c5fa9 --- /dev/null +++ b/reference/flat_set/flat_multiset/extract.md @@ -0,0 +1,78 @@ +# extract +* flat_set[meta header] +* std[meta namespace] +* flat_multiset[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +container_type extract() &&; // C++23 +``` + +## 概要 +値のコンテナを戻り値として返す。 + + +## 戻り値 +クラス内部のデータ保持形式である `container_type` オブジェクト。 + + +## 事後条件 +呼び出し側の `flat_multiset` は空になる(たとえ例外で関数が中断されたとしても)。 + + +## 計算量 +定数時間。 + + +## 備考 +本関数は右辺値修飾されているので、右辺値からのみ読み出し可能である。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::flat_multiset fs = {3, 1, 4, 1}; + + std::cout << fs.size() << std::endl; + + decltype(fs)::container_type c = std::move(fs).extract(); + + std::cout << fs.size() << std::endl; + std::cout << std::endl; + + for (int i : c) { + std::cout << i << std::endl; + } +} +``` +* extract()[color ff0000] +* fs.size()[link size.md] +* std::move[link /reference/utility/move.md] + +### 出力 +``` +4 +0 + +1 +1 +3 +4 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/flat_set/flat_multiset/find.md b/reference/flat_set/flat_multiset/find.md new file mode 100644 index 0000000000..3d8b1ea920 --- /dev/null +++ b/reference/flat_set/flat_multiset/find.md @@ -0,0 +1,102 @@ +# find +* flat_set[meta header] +* std[meta namespace] +* flat_multiset[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +iterator find(const key_type& x); // (1) C++23 + +template +iterator find(const K& x); // (2) C++23 + +const_iterator find(const key_type& x) const; // (3) C++23 + +template +const_iterator find(const K& x) const; // (4) C++23 +``` + +## 概要 +`x`と等価なキーの要素を検索する。 + +- (1), (3) : クラスのテンプレートパラメータ`key_type`型のキーを受け取って検索する。 +- (2), (4) : `key_type`と比較可能な`K`型のキーを受け取って検索する。 + + +## テンプレートパラメータ制約 +- (2), (4) : `key_compare::is_transparent`が妥当な式であること + + +## 戻り値 +- (1), (3) : `x`と等価なキーの要素が見つかった場合は、見つかった要素へのイテレータを返す。そうでない場合は、 [`end()`](end.md) を返す。 +- (2), (4) : `key_compare`型の関数オブジェクトを`c`、コンテナ内の各要素が持つキーを`k`として、キーが等価か判定する式`!c(k, x) && !c(x, k)`が`true`となる要素へのイテレータを返す。そのような要素がない場合は、[`end()`](end.md) を返す。 +等価となる要素が複数ある場合、そのうちのいずれかの要素へのイテレータを返す。 + + +## 計算量 +[`size()`](size.md) について対数時間。 + + +## 備考 +- (2), (4) : + - `is_transparent`は、標準ライブラリの[`std::less`](/reference/functional/less.md)、[`std::greater`](/reference/functional/greater.md)といった関数オブジェクトの、`void`に対する特殊化で定義される。それ以外のテンプレートパラメータで`is_transparent`が定義されないのは、互換性のためである。 + - これらのオーバーロードは、`flat_multiset`のようなコンテナに対し、検索操作で文字列リテラルを渡した際に、キー型の一時オブジェクトが生成されるコストを減らすためにある。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + // (1) + { + std::flat_multiset fs = {"Alice", "Bob", "Carol"}; + + decltype(fs)::iterator it = fs.find("Bob"); + if (it != fs.end()) { // 見つかった + std::cout << *it << std::endl; + } + } + + // (2) + { + std::flat_multiset> fs = {"Alice", "Bob", "Carol"}; + + // std::lessのvoidに対する特殊化を使用することで、 + // 文字列リテラルをfind()関数の引数として渡した際に、 + // std::string型の一時オブジェクトが生成されない。 + decltype(fs)::iterator it = fs.find("Bob"); + if (it != fs.end()) { // 見つかった + std::cout << *it << std::endl; + } + } +} +``` +* find[color ff0000] +* fs.end()[link end.md] +* std::less[link /reference/functional/less.md] + +### 出力 +``` +Bob +Bob +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`contains()`](contains.md) diff --git a/reference/flat_set/flat_multiset/insert.md b/reference/flat_set/flat_multiset/insert.md new file mode 100644 index 0000000000..58985f98d4 --- /dev/null +++ b/reference/flat_set/flat_multiset/insert.md @@ -0,0 +1,214 @@ +# insert +* flat_set[meta header] +* std[meta namespace] +* flat_multiset[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +iterator insert(const value_type& x); // (1) C++23 +iterator insert(value_type&& x); // (2) C++23 + +iterator insert(const_iterator position, + const value_type& x); // (3) C++23 +iterator insert(const_iterator position, + value_type&& x); // (4) C++23 + +template +iterator insert(P&& x); // (5) C++23 + +template +iterator insert(const_iterator position, + P&&); // (6) C++23 + +template +void insert(InputIterator first, + InputIterator last); // (7) C++23 + +template +void insert(sorted_equivalent_t, + InputIterator first, + InputIterator last); // (8) C++23 + +void insert(initializer_list il); // (9) C++23 + +void insert(sorted_equivalent_t, + initializer_list il); // (10) C++23 +``` +* initializer_list[link /reference/initializer_list/initializer_list.md] +* sorted_equivalent_t[link /reference/flat_set/sorted_equivalent_t.md] + +## 概要 +新しく一つの要素(引数 `x` を使う)または要素のシーケンス(入力イテレータまたは `initializer_list` を使う)を挿入し、コンテナを拡張する。 + +これは、挿入された要素の数だけコンテナの [`size()`](size.md) を増やす。 + +内部的に `flat_multiset` コンテナは、コンストラクト時に指定された比較オブジェクトによって要素を下位から上位へとソートして保持する。 + +この操作は、適切な引数 `position` を提供することで効率を飛躍的に改善することができる。 + +- (1) : 単一要素を挿入する +- (2) : 単一要素の一時オブジェクトを挿入する +- (3) : 指定された位置に、単一要素を挿入する +- (4) : 指定された位置に、単一要素の一時オブジェクトを挿入する +- (5) : 単一要素として要素型`value_type`のコンストラクタ引数を受け取って挿入する +- (6) : 指定された位置に、要素型`value_type`のコンストラクタ引数を受け取って挿入する +- (7) : イテレータ範囲`[first, last)`を挿入する +- (8) : ソート済みのイテレータ範囲`[first, last)`を挿入する +- (9) : 初期化子リストを挿入する +- (10) : ソート済みの初期化子リストを挿入する + + +## 要件 +- (5), (6) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true`であること + + +## 効果 +- (1) : + ```cpp + return emplace(x); + ``` + * emplace[link emplace.md] + +- (2) : + ```cpp + return emplace(std::move(x)); + ``` + * emplace[link emplace.md] + * move[link /reference/utility/move.md] + +- (3) : + ```cpp + return emplace_hint(position, x); + ``` + * emplace_hint[link emplace_hint.md] + +- (4) : + ```cpp + return emplace_hint(position, std::move(x)); + ``` + * emplace_hint[link emplace_hint.md] + * move[link /reference/utility/move.md] + +- (5) : 以下と等価: + ```cpp + return emplace(std::forward

(x)); + ``` + * emplace[link emplace.md] + * forward[link /reference/utility/forward.md] + +- (6) : 以下と等価: + ```cpp + return emplace_hint(position, std::forward

(x));. + ``` + * emplace_hint[link emplace_hint.md] + * forward[link /reference/utility/forward.md] + +- (7) : メンバ変数として保持しているコンテナ`c`に、以下のように挿入する: + ```cpp + for (; first != last; ++first) { + value_type value = *first; + c.insert(c.end(), std::move(value)); + } + ``` + * end()[link /reference/vector/vector/end.md] + * insert[link /reference/vector/vector/insert.md] + * std::move[link /reference/utility/move.md] + + - 次に、新しく挿入された要素の範囲を`value_comp()`を基準にソートする + - 次に、ソートされた結果の範囲と、既存の要素のソートされた範囲をひとつのソートされた範囲にマージする + +- (8) : メンバ変数として保持しているコンテナ`c`に、以下のように挿入する: + ```cpp + for (; first != last; ++first) { + value_type value = *first; + c.insert(c.end(), std::move(value)); + } + ``` + * end()[link /reference/vector/vector/end.md] + * insert[link /reference/vector/vector/insert.md] + * std::move[link /reference/utility/move.md] + + - 次に、ソートされた結果の範囲と、既存の要素のソートされた範囲をひとつのソートされた範囲にマージする + +- (9) : + ```cpp + insert(il.begin(), il.end()); + ``` + +- (10) : + ```cpp + insert(s, il.begin(), il.end()); + ``` + + +## 戻り値 +- (1)-(6) : 挿入された要素へのイテレータ +- (7)-(10) : なし + + +## 計算量 +- (7) : Nをこの操作の前の[`size()`](size.md)、Mを[`distance`](/reference/iterator/distance.md)`(first, last)`として、N + MlogM +- (8) : Nをこの操作のあとの[`size()`](size.md)として、Nに対して線形 + + +## 備考 +- (7), (8) : この操作はインプレース・マージを行うため、追加のメモリ確保を行う可能性がある + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::flat_multiset fs; + + // 単一要素を挿入する + fs.insert(1); + + // シーケンスを挿入する + std::vector v = {2, 3, 4}; + fs.insert(v.begin(), v.end()); + + // 挿入するシーケンスがソート済みであることがわかっている場合、 + // 以下のように指定した方が高速になる + fs.insert(std::sorted_equivalent, {5, 6, 7}); + + for (int i : fs) { + std::cout << i << std::endl; + } +} +``` +* insert[color ff0000] +* begin()[link /reference/vector/vector/begin.md] +* end()[link /reference/vector/vector/end.md] +* std::sorted_equivalent[link /reference/flat_set/sorted_equivalent_t.md] + +### 出力 +``` +1 +2 +3 +4 +5 +6 +7 +``` + + +## バージョン +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +| 名前 | 説明 | +|--------------------------------------------------|----------------------------------| +| [`flat_multiset::insert_range`](insert_range.md) | Rangeを挿入する | +| [`flat_multiset::emplace`](emplace.md) | 要素を直接構築する | +| [`flat_multiset::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | diff --git a/reference/flat_set/flat_multiset/insert_range.md b/reference/flat_set/flat_multiset/insert_range.md new file mode 100644 index 0000000000..596ed6105f --- /dev/null +++ b/reference/flat_set/flat_multiset/insert_range.md @@ -0,0 +1,73 @@ +# insert_range +* flat_set[meta header] +* std[meta namespace] +* flat_multiset[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +template R> +void insert_range(R&& rg); // (1) C++23 +``` +* container-compatible-range[link /reference/exposition-only/container-compatible-range.md] + +## 概要 +Rangeを挿入し、コンテナを拡張する。 + +これは、挿入された要素の数だけコンテナの [`size()`](size.md) を増やす。 + +内部的に `flat_multiset` コンテナは、コンストラクト時に指定された比較オブジェクトによって要素を下位から上位へとソートして保持する。 + + +## 戻り値 +なし + + +## 計算量 +- Nをこの操作の前の[`size()`](size.md)、Mを[`ranges::distance`](/reference/iterator/ranges_distance.md)`(rg)`として、N + MlogM + + +## 備考 +- この操作はインプレース・マージを行うため、追加のメモリ確保を行う可能性がある + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_multiset fs = {3}; + + std::flat_multiset fs2 = {5, 15}; + + fs.insert_range(fs2); + + for (int i : fs) { + std::cout << i << std::endl; + } +} +``` +* insert_range[color ff0000] + +### 出力 +``` +3 +5 +15 +``` + +## バージョン +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +| 名前 | 説明 | +|--------------------------------------------------|----------------------------------| +| [`flat_multiset::insert`](insert.md) | 要素を挿入する | +| [`flat_multiset::emplace`](emplace.md) | 要素を直接構築する | +| [`flat_multiset::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | diff --git a/reference/flat_set/flat_multiset/key_comp.md b/reference/flat_set/flat_multiset/key_comp.md new file mode 100644 index 0000000000..01d8f6ebc4 --- /dev/null +++ b/reference/flat_set/flat_multiset/key_comp.md @@ -0,0 +1,64 @@ +# key_comp +* flat_set[meta header] +* std[meta namespace] +* flat_multiset[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +key_compare key_comp() const; // C++23 +``` + + +## 概要 +コンテナに関連づけられたキー比較用の関数オブジェクトを返す。このオブジェクトはコンテナ内の二つのキーを比較するために利用できる。 +この比較オブジェクトはオブジェクトの構築時に与えられ、関数へのポインタでも関数オブジェクトでも良い。いずれの場合でも、これは同じ型の 2 つの引数をとり、[狭義の弱順序](/reference/algorithm.md#strict-weak-ordering)に従って一つ目の引数が二つ目の引数より前のときに `true` を返し、そうでないときに `false` を返す。 + + +## 戻り値 +比較オブジェクト。`key_compare` はメンバ型であり、テンプレートパラメータ `Compare` の別名として定義される。 + + +## 計算量 +定数時間。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_multiset s; + std::flat_multiset::key_compare comp = s.key_comp(); + + std::cout << comp(1, 2) << std::endl; + std::cout << comp(3, 2) << std::endl; +} +``` +* key_comp()[color ff0000] + +### 出力 +``` +1 +0 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------------|----------------------------------------------------------| +| [`value_comp`](value_comp.md) | 要素比較用の関数オブジェクトを返す | diff --git a/reference/flat_set/flat_multiset/lower_bound.md b/reference/flat_set/flat_multiset/lower_bound.md new file mode 100644 index 0000000000..6931de6d70 --- /dev/null +++ b/reference/flat_set/flat_multiset/lower_bound.md @@ -0,0 +1,121 @@ +# lower_bound +* flat_set[meta header] +* std[meta namespace] +* flat_multiset[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +iterator lower_bound(const key_type& x); // (1) C++23 + +template +iterator lower_bound(const K& x); // (2) C++23 + +const_iterator lower_bound(const key_type& x) const; // (3) C++23 + +template +const_iterator lower_bound(const K& x) const; // (4) C++23 +``` + +## 概要 +`x` を右辺とする `<` 演算が成り立たない最初の要素を指すイテレータを返す(コンテナの比較オブジェクトが使われる)。すなわちこれは `>=` 演算にあたる。 + +[`upper_bound()`](upper_bound.md) とは異なり、このメンバ関数は `x` より大きいだけでなく、`x` と等しい場合であってもその要素へのイテレータを返す。 + +内部的には `flat_multiset` コンテナ内の全ての要素は常に比較オブジェクトが定義する基準に沿って並んでいるため、この関数が返すいずれかの後に続く全ての要素が `x` より大きいか等しいことに注意。 + +- (1) : `key_type`型のキーを受け取り、そのキーより小さくない最初の要素へのイテレータを取得する。 +- (2) : `key_type`と比較可能な`K`型のキーを受け取り、そのキーより小さくない最初の要素へのイテレータを取得する。 +- (3) : `const`な`*this`オブジェクトにおいて、`key_type`型のキーを受け取り、そのキーより小さくない最初の要素へのイテレータを取得する。 +- (4) : `const`な`*this`オブジェクトにおいて、`key_type`と比較可能な`K`型のキーを受け取り、そのキーより小さくない最初の要素へのイテレータを取得する。 + + +## 戻り値 +- (1), (3) : コンテナ内で `x` を右辺とする `<` 演算が成り立たない最初の要素へのイテレータを返す。そのような要素がない場合は、[`end()`](end.md)を返す。 +- (2), (4) : `key_compare`型の関数オブジェクトを`c`、コンテナ内の各要素が持つキーを`k`として、キーが小さくないか判定する式`!c(k, x)`が`true`となる要素へのイテレータを返す。そのような要素がない場合は、[`end()`](end.md) を返す。 + + +## 計算量 +[`size()`](size.md) について対数時間。 + + +## 備考 +- (2), (4) : この関数がオーバーロード解決に参加する条件は、[`find()`](find.md)メンバ関数の備考欄を参照。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + // (1) + { + std::flat_multiset fs = { + "Alice", "Bob", "Carol", "David" + }; + + // Bob以上David以下の範囲を取得 + decltype(fs)::iterator it = fs.lower_bound("Bob"); + decltype(fs)::iterator last = fs.upper_bound("David"); + + while (it != last) { + std::cout << *it << std::endl; + ++it; + } + } + + std::cout << std::endl; + + // (2) + { + std::flat_multiset> fs = { + "Alice", "Bob", "Carol", "David" + }; + + // std::lessのvoidに対する特殊化を使用することで、 + // 文字列リテラルをlower_bound()関数の引数として渡した際に、 + // std::string型の一時オブジェクトが生成されない。 + decltype(fs)::iterator it = fs.lower_bound("Bob"); + decltype(fs)::iterator last = fs.upper_bound("David"); + + while (it != last) { + std::cout << *it << std::endl; + ++it; + } + } +} +``` +* lower_bound[color ff0000] +* fs.upper_bound[link upper_bound.md] +* std::less[link /reference/functional/less.md] + +### 出力 +``` +Bob +Carol +David + +Bob +Carol +David +``` + + +## バージョン +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|------------------------------------------------|------------------------------------------------------| +| [`flat_multiset::upper_bound`](upper_bound.md) | 指定した値よりも大きい最初の要素へのイテレータを返す | +| [`flat_multiset::equal_range`](equal_range.md) | 指定したキーにマッチする要素範囲を返す | +| [`flat_multiset::find`](find.md) | 指定したキーで要素を探す | +| [`flat_multiset::count`](count.md) | 指定したキーにマッチする要素の数を返す | diff --git a/reference/flat_set/flat_multiset/max_size.md b/reference/flat_set/flat_multiset/max_size.md new file mode 100644 index 0000000000..2e73e75070 --- /dev/null +++ b/reference/flat_set/flat_multiset/max_size.md @@ -0,0 +1,51 @@ +# max_size +* flat_set[meta header] +* std[meta namespace] +* flat_multiset[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +size_type max_size() const noexcept; // (1) C++23 +``` + +## 概要 +コンテナが格納できる要素の最大数を返す。 +これは、システムやライブラリ実装の制限のもとでコンテナが格納できる潜在的な最大サイズである。 + + +## 戻り値 +`container_type` 型メンバ変数 `c` があるとして、`c.`[`max_size()`](/reference/vector/vector/max_size.md)。 + + +## 計算量 +定数時間。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_multiset fs; + + std::cout << fs.max_size() << std::endl; +} +``` +* max_size()[color ff0000] + +### 出力例 +``` +178956970 +``` + + +## 言語バージョン +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/flat_set/flat_multiset/op_assign.md b/reference/flat_set/flat_multiset/op_assign.md new file mode 100644 index 0000000000..d83fee63ab --- /dev/null +++ b/reference/flat_set/flat_multiset/op_assign.md @@ -0,0 +1,66 @@ +# operator= +* flat_set[meta header] +* std[meta namespace] +* flat_multiset[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +flat_multiset& operator=(initializer_list il); // C++23 +``` +* initializer_list[link /reference/initializer_list/initializer_list.md] + + +## 概要 +初期化子リストの値を代入する。 + + +## 効果 +`*this`の全ての要素が解放され、`il`の全ての要素が`*this`にコピー代入される。 + + +## 戻り値 +`*this` + + +## 備考 +- 引数の型が `const flat_multiset&` であるコピー代入演算子と、引数の型が `flat_multiset&&` であるムーブ代入演算子は、それぞれ自動生成される。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::initializer_list elems = {"Alice", "Bob", "Carol", "Alice"}; + + std::flat_multiset fs; + fs = elems; + + for (const std::string& i : fs) { + std::cout << i << std::endl; + } +} +``` + +### 出力 +``` +Alice +Alice +Bob +Carol +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/flat_set/flat_multiset/op_compare_3way.md b/reference/flat_set/flat_multiset/op_compare_3way.md new file mode 100644 index 0000000000..2a7ca417df --- /dev/null +++ b/reference/flat_set/flat_multiset/op_compare_3way.md @@ -0,0 +1,83 @@ +# operator<=> +* flat_set[meta header] +* std[meta namespace] +* function template[meta id-type] +* flat_multiset[meta class] +* cpp23[meta cpp] + +```cpp +synth-three-way-result + operator<=>(const flat_multiset& x, + const flat_multiset& y); // (1) C++23 +``` + +## 概要 +`flat_multiset`オブジェクトの三方比較を行う。 + + +## テンプレートパラメータ制約 +- 型 (`const`) `value_type` の値に対して`operator<=>`が定義されるか、型 (`const`) `value_type` の値に対して`operator<`が定義され全順序をもつこと + + +## 効果 +```cpp +return lexicographical_compare_three_way( + x.begin(), x.end(), + y.begin(), y.end(), + synth-three-way); +``` +* lexicographical_compare_three_way[link /reference/algorithm/lexicographical_compare_three_way.md] +* begin()[link begin.md] +* end()[link end.md] + + +## 計算量 +線形時間。 + + +## 備考 +- この演算子により、以下の演算子が使用可能になる: + - `operator<` + - `operator<=` + - `operator>` + - `operator>=` + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_multiset fs1 = {3, 1, 4}; + + std::flat_multiset fs2 = {3, 1}; + + std::cout << std::boolalpha; + std::cout << ((fs1 <=> fs1) == 0) << std::endl; + std::cout << (fs1 < fs2) << std::endl; + std::cout << (fs1 <= fs1) << std::endl; + std::cout << (fs1 > fs2) << std::endl; + std::cout << (fs2 >= fs1) << std::endl; +} +``` + +### 出力 +``` +true +false +true +true +false +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/flat_set/flat_multiset/op_constructor.md b/reference/flat_set/flat_multiset/op_constructor.md new file mode 100644 index 0000000000..ad03d33063 --- /dev/null +++ b/reference/flat_set/flat_multiset/op_constructor.md @@ -0,0 +1,266 @@ +# コンストラクタ +* flat_set[meta header] +* std[meta namespace] +* flat_multiset[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +// ____要素数ゼロのflat_multisetを構築____ + +flat_multiset() : flat_multiset(key_compare()) { } // (1) C++23 + +explicit flat_multiset(const key_compare& comp) // (2) C++23 + : c(), compare(comp) { } + +template +explicit flat_multiset(const Allocator& a); // (3) C++23 + +template +flat_multiset(const key_compare& comp, const Allocator& a); // (4) C++23 + +// ____アロケータを伴うコピー&ムーブコンストラクタ____ + + template + flat_multiset(const flat_multiset& x, const Allocator& a); // (5) C++26 + + template + flat_multiset(flat_multiset&& x, const Allocator& a); // (6) C++26 + +// ____container_typeから構築____ + +flat_multiset(container_type cont, + const key_compare& comp = key_compare()); // (7) C++23 + +template +flat_multiset(const container_type& cont, + const Allocator& a); // (8) C++23 + +template +flat_multiset(const container_type& cont, + const key_compare& comp, const Allocator& a); // (9) C++23 + +// ____container_type(ソート済み)から構築____ + +flat_multiset(sorted_equivalent_t, container_type cont, + const key_compare& comp = key_compare()); // (10) C++23 + +template +flat_multiset(sorted_equivalent_t, const container_type& cont, + const Allocator& a); // (11) C++23 + +template +flat_multiset(sorted_equivalent_t, const container_type& cont, + const key_compare& comp, const Allocator& a); // (12) C++23 + +// ____イテレータから構築____ + +template +flat_multiset(InputIterator first, InputIterator last, const key_compare& comp = key_compare()) // (13) C++23 + : c(), compare(comp) { insert(first, last); } + +template +flat_multiset(InputIterator first, InputIterator last, const Allocator& a); // (14) C++23 + +template +flat_multiset(InputIterator first, InputIterator last, + const key_compare& comp, const Allocator& a); // (15) C++23 + +// ____イテレータ(ソート済み)から構築____ + +template +flat_multiset(sorted_equivalent_t s, InputIterator first, InputIterator last, + const key_compare& comp = key_compare()) // (16) C++23 + : c(), compare(comp) { insert(s, first, last); } + +template +flat_multiset(sorted_equivalent_t, InputIterator first, InputIterator last, const Allocator& a); // (17) C++23 + +template +flat_multiset(sorted_equivalent_t, InputIterator first, InputIterator last, + const key_compare& comp, const Allocator& a); // (18) C++23 + +// ____Rangeから構築____ + +template R> +flat_multiset(from_range_t fr, R&& rg) // (19) C++23 + : flat_multiset(fr, forward(rg), key_compare()) { } + +template R> +flat_multiset(from_range_t, R&& rg, const key_compare& comp) // (20) C++23 + : flat_multiset(comp) { insert_range(forward(rg)); } + +template R, class Allocator> +flat_multiset(from_range_t, R&& rg, const Allocator& a); // (21) C++23 + +template R, class Allocator> +flat_multiset(from_range_t, R&& rg, const key_compare& comp, const Allocator& a); // (22) C++23 + +// ____initializer_listから構築____ + +flat_multiset(initializer_list il, const key_compare& comp = key_compare()) // (23) C++23 + : flat_multiset(il.begin(), il.end(), comp) { } + +template +flat_multiset(initializer_list il, const Allocator& a); // (24) C++23 + +template +flat_multiset(initializer_list il, const key_compare& comp, const Allocator& a); // (25) C++23 + +// ____initializer_list(ソート済み)から構築____ + +flat_multiset(sorted_equivalent_t s, initializer_list il, + const key_compare& comp = key_compare()) // (26) C++23 + : flat_multiset(s, il.begin(), il.end(), comp) { } + +template +flat_multiset(sorted_equivalent_t, initializer_list il, const Allocator& a); // (27) C++23 + +template +flat_multiset(sorted_equivalent_t, initializer_list il, + const key_compare& comp, const Allocator& a); // (28) C++23 +``` +* initializer_list[link /reference/initializer_list/initializer_list.md] +* from_range_t[link ../../ranges/from_range_t.md] +* sorted_equivalent_t[link ../sorted_equivalent_t.md] +* forward[link ../../utility/forward.md] +* insert[link insert.md] +* insert_range[link insert_range.md] + + +## 概要 +`flat_multiset`オブジェクトを次に示す通りの要素で初期化する。 + + +## 効果 +- (1) : デフォルトコンストラクタ。デフォルトの `key_compare` を作成し、要素を持たない空の `flat_multiset` オブジェクトを構築する。 +- (2) : `key_compare` を受け取り、要素を持たない空の `flat_multiset` オブジェクトを構築する。 +- (3) : アロケータを受け取り、要素を持たない空の `flat_multiset` オブジェクトを構築する。 +- (4) : `key_compare` とアロケータを受け取り、要素を持たない空の `flat_multiset` オブジェクトを構築する。 +- (5) : アロケータを受け取り、`flat_multiset` オブジェクトをコピー構築する。 +- (6) : アロケータを受け取り、`flat_multiset` オブジェクトをムーブ構築する。 +- (7) : `container_type` から `flat_multiset` オブジェクトを構築する。構築に際し、`value_compare` に基づきソートされる。 +- (8) : アロケータを受け取り、`container_type` から `flat_multiset` オブジェクトを構築する。構築に際し、`value_compare` に基づきソートされる。 +- (9) : `key_compare` とアロケータを受け取り、`container_type` から `flat_multiset` オブジェクトを構築する。構築に際し、`value_compare` に基づきソートされる。 +- (10) : `container_type`(ソート済み)から `flat_multiset` オブジェクトを構築する。 +- (11) : アロケータを受け取り、`container_type`(ソート済み)から `flat_multiset` オブジェクトを構築する。 +- (12) : `key_compare` とアロケータを受け取り、`container_type`(ソート済み)から `flat_multiset` オブジェクトを構築する。 +- (13) : イテレータから `flat_multiset` オブジェクトを構築する。構築には [`insert()`](insert.md) が用いられる。 +- (14) : アロケータを受け取り、イテレータから `flat_multiset` オブジェクトを構築する。構築には [`insert()`](insert.md) が用いられる。 +- (15) : `key_compare` とアロケータを受け取り、イテレータから `flat_multiset` オブジェクトを構築する。構築には [`insert()`](insert.md) が用いられる。 +- (16) : イテレータ(ソート済み)から `flat_multiset` オブジェクトを構築する。 +- (17) : アロケータを受け取り、イテレータ(ソート済み)から `flat_multiset` オブジェクトを構築する。 +- (18) : `key_compare` とアロケータを受け取り、イテレータ(ソート済み)から `flat_multiset` オブジェクトを構築する。 +- (19) : Rangeから `flat_multiset` オブジェクトを構築する。構築には [`insert_range()`](insert_range.md) が用いられる。 +- (20) : `key_compare` を受け取り、Rangeから `flat_multiset` オブジェクトを構築する。構築には [`insert_range()`](insert_range.md) が用いられる。 +- (21) : アロケータを受け取り、Rangeから `flat_multiset` オブジェクトを構築する。構築には [`insert_range()`](insert_range.md) が用いられる。 +- (22) : `key_compare` とアロケータを受け取り、Rangeから `flat_multiset` オブジェクトを構築する。構築には [`insert_range()`](insert_range.md) が用いられる。 +- (23) : initializer_listから `flat_multiset` オブジェクトを構築する。構築には [`insert()`](insert.md) が用いられる。 +- (24) : アロケータを受け取り、initializer_listから `flat_multiset` オブジェクトを構築する。構築には [`insert()`](insert.md) が用いられる。 +- (25) : `key_compare` とアロケータを受け取り、initializer_listから `flat_multiset` オブジェクトを構築する。構築には [`insert()`](insert.md) が用いられる。 +- (26) : initializer_list(ソート済み)から `flat_multiset` オブジェクトを構築する。 +- (27) : アロケータを受け取り、initializer_list(ソート済み)から `flat_multiset` オブジェクトを構築する。 +- (28) : `key_compare` とアロケータを受け取り、initializer_list(ソート済み)から `flat_multiset` オブジェクトを構築する。 + + +## 計算量 +- (1)-(4) : 定数時間。 +- (5) : 引数 `x` のサイズに対して線形時間。 +- (6) : 引数 `x` の `container_type` をムーブした計算量と同じ。 +- (7)-(9) : 引数 `cont` のサイズを `N` とすると、`cont` がソート済みなら `N` に対して線形時間。そうでなければ `N log(N)`。 +- (10)-(12) : 引数 `cont` をムーブした計算量と同じ。 +- (13)-(15) : 引数 `first` と `last` の距離を `N` とすると、イテレータの値が `value_compare` に基づきソート済みなら `N` に対して線形時間。そうでなければ `N log(N)`。 +- (16)-(18) : 引数 `first` と `last` の距離を `N` とすると、`N` に対して線形時間。 +- (19)-(22) : [`ranges::distance`](../../iterator/ranges_distance.md)`(rg)` を `N` とすると、要素の値が `value_compare` に基づきソート済みなら `N` に対して線形時間。そうでなければ `N log(N)`。 +- (23)-(25) : 引数 `il` のサイズを `N` とすると、イテレータの値が `value_compare` に基づきソート済みなら `N` に対して線形時間。そうでなければ `N log(N)`。 +- (26)-(28) : 引数 `il` のサイズを `N` とすると、`N` に対して線形時間。 + + +## 備考 +- 通常の(アロケータを指定しない)コピーコンストラクタとムーブコンストラクタは自動生成される。 +- (3)-(6), (8), (9), (11), (12), (14), (15), (17), (18), (21), (22), (24), (25), (27), (28) は引数としてアロケータを受け取るが、引数のアロケータに対して [`uses_allocator`](uses_allocator.md) が `false` であれば、この引数は無視される。 + + +## 例 +```cpp example +#include +#include +#include +#include + +void print(const std::flat_multiset& fs) +{ + std::cout << "{" << std::endl; + for (const auto& k: fs) { + std::cout << " " << k << "," << std::endl; + } + std::cout << "}" << std::endl; +} + +int main() +{ + std::cout << "(1)" << std::endl; + { + std::flat_multiset fs; + print(fs); + } + std::cout << std::endl; + + std::cout << "(5)" << std::endl; + { + std::vector strs = {"Alice", "Bob", "Carol"}; + + std::flat_multiset fs(strs); + print(fs); + } + std::cout << std::endl; + + std::cout << "(23)" << std::endl; + { + std::initializer_list elems = {"Alice", "Bob", "Carol"}; + + std::flat_multiset fs(elems); + print(fs); + } + std::cout << std::endl; +} +``` + +### 出力 +``` +(1) +{ +} + +(5) +{ + Alice, + Bob, + Carol, +} + +(23) +{ + Alice, + Bob, + Carol, +} +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|---------------------------------------|--------------------------------------------| +| [`uses_allocator`](uses_allocator.md) | 指定されたアロケータと合致するかをチェックする | diff --git a/reference/flat_set/flat_multiset/op_equal.md b/reference/flat_set/flat_multiset/op_equal.md new file mode 100644 index 0000000000..68b3975567 --- /dev/null +++ b/reference/flat_set/flat_multiset/op_equal.md @@ -0,0 +1,70 @@ +# operator== +* flat_set[meta header] +* std[meta namespace] +* function template[meta id-type] +* flat_multiset[meta class] + +```cpp +friend bool operator==(const flat_multiset& x, const flat_multiset& y); +``` + +## 概要 +`x` が `y` と等しいかどうかの判定を行う。 + + +## 戻り値 +以下と等価: + +```cpp +return equal(x.begin(), x.end(), y.begin(), y.end()); +``` +* equal[link /reference/algorithm/equal.md] +* begin()[link begin.md] +* end()[link end.md] + + +## 計算量 +[`size()`](size.md) に対して線形時間。ただし、`x`と`y`のサイズが異なる場合は定数時間。 + + +## 備考 +- この演算子により、以下の演算子が使用可能になる: + - `operator!=` + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_multiset fs1 = {3, 1, 4}; + + std::flat_multiset fs2 = {3, 1}; + + std::cout << std::boolalpha; + std::cout << (fs1 == fs1) << std::endl; + std::cout << (fs1 == fs2) << std::endl; + std::cout << (fs1 != fs1) << std::endl; + std::cout << (fs1 != fs2) << std::endl; +} +``` + +### 出力 +``` +true +false +false +true +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/flat_set/flat_multiset/rbegin.md b/reference/flat_set/flat_multiset/rbegin.md new file mode 100644 index 0000000000..cead413c23 --- /dev/null +++ b/reference/flat_set/flat_multiset/rbegin.md @@ -0,0 +1,75 @@ +# rbegin +* flat_set[meta header] +* std[meta namespace] +* flat_multiset[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +reverse_iterator rbegin() noexcept; +const_reverse_iterator rbegin() const noexcept; +``` + +## 概要 +コンテナ内の末尾を指す逆イテレータを取得する。 + +内部的に、このコンテナは各要素をキーの値に従って下位から上位へと並べており、従って `rbegin()` は最上位のキーにあたる値を指すイテレータを返す。 +`rbegin()` は [`end()`](end.md) と同じ要素を指すわけではなく、その前の要素を指すことに注意。 + + +## 戻り値 +反転したシーケンスの先頭を指す逆イテレータ。 +`reverse_iterator` と `const_reverse_iterator` はともにメンバ型である。このクラステンプレートにおいて、これらは逆ランダムアクセスイテレータであり、それぞれ `reverse_iterator`, `reverse_iterator` と定義される。 + + +## 計算量 +定数時間。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_multiset fs = {3, 1, 4, 1}; + + for (auto i = fs.rbegin(); i != fs.rend(); ++i) { + std::cout << *i << std::endl; + } +} +``` +* rbegin()[color ff0000] +* fs.rend()[link rend.md] + +### 出力 +``` +4 +3 +1 +1 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|-----------------------------------|-----------------------------| +| [`flat_multiset::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`flat_multiset::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`flat_multiset::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`flat_multiset::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`flat_multiset::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`flat_multiset::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | +| [`flat_multiset::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + diff --git a/reference/flat_set/flat_multiset/rend.md b/reference/flat_set/flat_multiset/rend.md new file mode 100644 index 0000000000..d558a8e819 --- /dev/null +++ b/reference/flat_set/flat_multiset/rend.md @@ -0,0 +1,67 @@ +# rend +* flat_set[meta header] +* std[meta namespace] +* flat_multiset[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +reverse_iterator rend() noexcept; +const_reverse_iterator rend() const noexcept; +``` + +## 概要 +コンテナの先頭要素の前(これは反転シーケンスの末尾にあたる)を指す逆イテレータを取得する。 +`rend()` は [`begin()`](begin.md) と同じ要素を指すわけではなく、その前の要素を指すことに注意。 + +## 戻り値 +反転シーケンスの終端を指す逆イテレータ。 +`reverse_iterator` と `const_reverse_iterator` はメンバ型である。このクラステンプレートにおいて、これらは逆ランダムアクセスイテレータであり、それぞれ `reverse_iterator`, `reverse_iterator` と定義される。 + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_multiset fs = {3, 1, 4, 1}; + + for (auto i = fs.rbegin(); i != fs.rend(); ++i) { + std::cout << *i << std::endl; + } +} +``` +* rend()[color ff0000] +* fs.rbegin()[link rbegin.md] + +### 出力 +``` +4 +3 +1 +1 +``` + +## バージョン +### 言語 +- C++23 + + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|-----------------------------------|-----------------------------| +| [`flat_multiset::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`flat_multiset::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`flat_multiset::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`flat_multiset::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`flat_multiset::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | +| [`flat_multiset::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | +| [`flat_multiset::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | diff --git a/reference/flat_set/flat_multiset/replace.md b/reference/flat_set/flat_multiset/replace.md new file mode 100644 index 0000000000..656397a640 --- /dev/null +++ b/reference/flat_set/flat_multiset/replace.md @@ -0,0 +1,92 @@ +# replace +* flat_set[meta header] +* std[meta namespace] +* flat_multiset[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +void replace(container_type&& cont); // C++23 +``` + +## 概要 +値のコンテナを置き換える。 + + +## 効果 +`flat_multiset` クラスが内部で保持している `container_type` を `c` とすると、以下と等価。 + ```cpp + c = std::move(cont); + ``` + * std::move[link /reference/utility/move.md] + + +## 事前条件 +- `cont` が `key_compare` に基づいてソートされていること。 + + +## 計算量 +`cont` をムーブした計算量と同じ。 + + +## 例 +```cpp example +#include +#include +#include +#include +#include +#include + +int main() +{ + std::vector keys = {"Alice", "Bob", "Carol"}; + + // 事前条件の確認 + assert(std::is_sorted(keys.begin(), keys.end())); + assert(std::adjacent_find(keys.begin(), keys.end()) == keys.end()); + + std::flat_multiset fs; + + std::cout << fs.size() << std::endl; + + fs.replace(std::move(keys)); + + std::cout << fs.size() << std::endl; + std::cout << std::endl; + + std::cout << "{" << std::endl; + for (const std::string& i: fs) { + std::cout << " " << i << "," << std::endl; + } + std::cout << "}" << std::endl; +} +``` +* replace[color ff0000] +* fs.size()[link size.md] +* std::is_sorted[link /reference/algorithm/is_sorted.md] +* std::adjacent_find[link /reference/algorithm/adjacent_find.md] +* std::move[link /reference/utility/move.md] + +### 出力 +``` +0 +3 + +{ + Alice, + Bob, + Carol, +} +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/flat_set/flat_multiset/size.md b/reference/flat_set/flat_multiset/size.md new file mode 100644 index 0000000000..96cd7d9027 --- /dev/null +++ b/reference/flat_set/flat_multiset/size.md @@ -0,0 +1,69 @@ +# size +* flat_set[meta header] +* std[meta namespace] +* flat_multiset[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +size_type size() const noexcept; +``` + +## 概要 +コンテナ内の要素の数を返す。 + + +## 戻り値 +`flat_multiset` クラスが内部で保持している `container_type` を `c` とすると、以下を返す。 + +```cpp +return c.size(); +``` +* size()[link /reference/vector/vector/size.md] + + +## 計算量 +定数時間。 + + +## 例 +```cpp example +#include +#include + +int main () +{ + std::flat_multiset fs; + + std::cout << fs.size() << std::endl; + + fs.insert(1); + fs.insert(2); + fs.insert(3); + fs.insert(1); + + std::cout << fs.size() << std::endl; +} +``` +* size()[color ff0000] +* fs.insert[link insert.md] + +### 出力 +``` +0 +4 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`empty()`](empty.md) diff --git a/reference/flat_set/flat_multiset/swap.md b/reference/flat_set/flat_multiset/swap.md new file mode 100644 index 0000000000..9b8a369d6d --- /dev/null +++ b/reference/flat_set/flat_multiset/swap.md @@ -0,0 +1,75 @@ +# swap +* flat_set[meta header] +* std[meta namespace] +* flat_multiset[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +void swap(flat_multiset& y) noexcept; // (1) C++23 +``` + +## 概要 +コンテナ内のコンテンツを、同じ型の要素を保持する他の `flat_multiset` オブジェクトである `y` 内のコンテンツと交換する。 + +このメンバ関数の呼び出しの後、呼び出し前にコンテナ内にあった要素は `y` へ、`y` 内にあった要素は `*this` へ移る。 + + +## 計算量 +定数時間。 + + +## 例 +```cpp example +#include +#include + +template +void print(const char* name, const Set& s) +{ + std::cout << name << " : {"; + + bool first = true; + + for (const auto& x : s) { + if (first) { + first = false; + } + else { + std::cout << ", "; + } + std::cout << x; + } + std::cout << "}" << std::endl; +} + +int main() +{ + std::flat_multiset fs1 = {10, 20, 30}; + + std::flat_multiset fs2 = {5, 15}; + + // fs1とfs2を入れ替える + fs1.swap(fs2); + + print("fs1", fs1); + print("fs2", fs2); +} +``` +* swap[color ff0000] + +### 出力 +``` +fs1 : {5, 15} +fs2 : {10, 20, 30} +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/flat_set/flat_multiset/upper_bound.md b/reference/flat_set/flat_multiset/upper_bound.md new file mode 100644 index 0000000000..880a11f82c --- /dev/null +++ b/reference/flat_set/flat_multiset/upper_bound.md @@ -0,0 +1,121 @@ +# upper_bound +* flat_set[meta header] +* std[meta namespace] +* flat_multiset[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +iterator upper_bound(const key_type& x); // (1) C++23 + +template +iterator upper_bound(const K& x); // (2) C++23 + +const_iterator upper_bound(const key_type& x) const; // (3) C++23 + +template +const_iterator upper_bound(const K& x) const; // (4) C++23 +``` + +## 概要 +`x` より大きいキーを持つコンテナ内の最初の要素を指すイテレータを返す(コンテナの比較オブジェクトを使う)。 + +[`lower_bound()`](lower_bound.md) と異なり、このメンバ関数は `x` と等しいときは要素へのイテレータを返さず、それは大きい場合にのみ要素へのイテレータを返す。 + +内部的に、`flat_multiset` コンテナ内の全ての要素は常に比較オブジェクトで定義された基準に従って並ぶため、この関数が返す値に続く全ての要素は `x` より大きいことに注意。 + +- (1) : `key_type`型のキーを受け取り、そのキーより大きい最初の要素へのイテレータを取得する。 +- (2) : `key_type`と比較可能な`K`型のキーを受け取り、そのキーより大きい最初の要素へのイテレータを取得する。 +- (3) : `const`な`*this`オブジェクトにおいて、`key_type`型のキーを受け取り、そのキーより大きい最初の要素へのイテレータを取得する。 +- (4) : `const`な`*this`オブジェクトにおいて、`key_type`と比較可能な`K`型のキーを受け取り、そのキーより大きい最初の要素へのイテレータを取得する。 + + +## 戻り値 +- (1), (3) : キー`x`より大きい最初の要素へのイテレータを返す。そのような要素がない場合は、[`end()`](end.md)を返す。 +- (2), (4) : `key_compare`型の関数オブジェクトを`c`、コンテナ内の各要素が持つキーを`k`として、キーが小さくないか判定する式`c(x, k)`が`true`となる要素へのイテレータを返す。そのような要素がない場合は、[`end()`](end.md) を返す。 + + +## 計算量 +[`size()`](size.md) について対数時間。 + + +## 備考 +- (2), (4) : この関数がオーバーロード解決に参加する条件は、[`find()`](find.md)メンバ関数の備考欄を参照。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + // (1) + { + std::flat_multiset fs = { + "Alice", "Bob", "Carol", "David" + }; + + // Bob以上David以下の範囲を取得 + decltype(fs)::iterator it = fs.lower_bound("Bob"); + decltype(fs)::iterator last = fs.upper_bound("David"); + + while (it != last) { + std::cout << *it << std::endl; + ++it; + } + } + + std::cout << std::endl; + + // (2) + { + std::flat_multiset> fs = { + "Alice", "Bob", "Carol", "David" + }; + + // std::lessのvoidに対する特殊化を使用することで、 + // 文字列リテラルをlower_bound()関数の引数として渡した際に、 + // std::string型の一時オブジェクトが生成されない。 + decltype(fs)::iterator it = fs.lower_bound("Bob"); + decltype(fs)::iterator last = fs.upper_bound("David"); + + while (it != last) { + std::cout << *it << std::endl; + ++it; + } + } +} +``` +* upper_bound[color ff0000] +* fs.lower_bound[link lower_bound.md] +* std::less[link /reference/functional/less.md] + +### 出力 +``` +Bob +Carol +David + +Bob +Carol +David +``` + + +## バージョン +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|------------------------------------------------|----------------------------------------------------------| +| [`flat_multiset::lower_bound`](lower_bound.md) | 指定した値よりも小さくない最初の要素へのイテレータを返す | +| [`flat_multiset::equal_range`](equal_range.md) | 指定したキーにマッチする要素範囲を返す | +| [`flat_multiset::find`](find.md) | 指定したキーで要素を探す | +| [`flat_multiset::count`](count.md) | 指定したキーにマッチする要素の数を返す | diff --git a/reference/flat_set/flat_multiset/uses_allocator.md b/reference/flat_set/flat_multiset/uses_allocator.md new file mode 100644 index 0000000000..a107e6c1f9 --- /dev/null +++ b/reference/flat_set/flat_multiset/uses_allocator.md @@ -0,0 +1,55 @@ +# uses_allocator +* flat_set[meta header] +* std[meta namespace] +* class template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template + struct uses_allocator, + Alloc> + : bool_constant> { }; +} +``` +* bool_constant[link /reference/type_traits/bool_constant.md] + +## 概要 +`uses_allocator`の、`flat_multiset`に対する特殊化。 + +アロケータを指定する`flat_multiset`の[`コンストラクタ`](op_constructor.md)において、指定されたアロケータと、`KeyContainer`のアロケータが合致するかをチェックするのに使われる。 + + +## 例 +```cpp +#include +#include + +int main() +{ + using fs_t = std::flat_multiset; + + std::cout << std::uses_allocator>::value << std::endl; +} +``` +* std::uses_allocator[color ff0000] +* std::allocator[link /reference/memory/allocator.md] + +### 出力 +```cpp +1 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 diff --git a/reference/flat_set/flat_multiset/value_comp.md b/reference/flat_set/flat_multiset/value_comp.md new file mode 100644 index 0000000000..f823b1c755 --- /dev/null +++ b/reference/flat_set/flat_multiset/value_comp.md @@ -0,0 +1,65 @@ +# value_comp +* flat_set[meta header] +* std[meta namespace] +* flat_multiset[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +value_compare value_comp() const; // C++23 +``` + + +## 概要 +コンテナに関連づけられた要素比較用の関数オブジェクトを返す。これはコンテナ内の二つの要素を比較するために利用できる。 +これは同じ型の 2 つの引数をとり、[狭義の弱順序](/reference/algorithm.md#strict-weak-ordering)に従って一つ目の引数が二つ目の引数の前になる場合に `true`、そうでない場合に `false` を返す。 + + +## 戻り値 +要素比較用の関数オブジェクト。 +`value_compare` はメンバ型であり、`key_compare` と同じく、テンプレートパラメータ `Compare` の別名である。 + + +## 計算量 +定数時間。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_multiset s; + std::flat_multiset::value_compare comp = s.value_comp(); + + std::cout << comp(1, 2) << std::endl; + std::cout << comp(3, 2) << std::endl; +} +``` +* value_comp()[color ff0000] + +### 出力 +``` +1 +0 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------------|----------------------------------------------------------| +| [`key_comp`](key_comp.md) | キー比較用の関数オブジェクトを取得する | diff --git a/reference/flat_set/flat_set.md b/reference/flat_set/flat_set.md new file mode 100644 index 0000000000..b2421c9e30 --- /dev/null +++ b/reference/flat_set/flat_set.md @@ -0,0 +1,229 @@ +# flat_set +* flat_set[meta header] +* std[meta namespace] +* class template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template , + class KeyContainer = vector> + class flat_set; +} +``` +* less[link ../functional/less.md] +* vector[link /reference/vector/vector.md] + +## 概要 + + +## メンバ関数 +### 構築・破棄 + +| 名前 | 説明 | 対応バージョン | +|---------------------------------|----------------|-------| +| [`(constructor)`](flat_set/op_constructor.md) | コンストラクタ | C++23 | +| [`(destructor)`](flat_set/op_destructor.md.nolink) | デストラクタ | C++23 | +| [`operator=`](flat_set/op_assign.md) | 代入演算子 | C++23 | + + +### イテレータ + +| 名前 | 説明 | 対応バージョン | +|----------------------------------|--------------------------------------------------|-------| +| [`begin`](flat_set/begin.md) | 先頭を指すイテレータを取得する | C++23 | +| [`cbegin`](flat_set/cbegin.md) | 先頭を指す読み取り専用イテレータを取得する | C++23 | +| [`end`](flat_set/end.md) | 末尾の次を指すイテレータを取得する | C++23 | +| [`cend`](flat_set/cend.md) | 末尾の次を指す読み取り専用イテレータを取得する | C++23 | +| [`rbegin`](flat_set/rbegin.md) | 末尾を指す逆イテレータを取得する | C++23 | +| [`crbegin`](flat_set/crbegin.md) | 末尾を指す読み取り専用逆イテレータを取得する | C++23 | +| [`rend`](flat_set/rend.md) | 先頭の前を指す逆イテレータを取得する | C++23 | +| [`crend`](flat_set/crend.md) | 先頭の前を指す読み取り専用逆イテレータを取得する | C++23 | + + +### 領域 + +| 名前 | 説明 | 対応バージョン | +|------------------------------------|------------------------------------|-------| +| [`empty`](flat_set/empty.md) | コンテナが空であるかどうかを調べる | C++23 | +| [`size`](flat_set/size.md) | 要素数を取得する | C++23 | +| [`max_size`](flat_set/max_size.md) | 格納可能な最大の要素数を取得する | C++23 | + + +### コンテナの変更 + +| 名前 | 説明 | 対応バージョン | +|--------------------------------------------|--------------------------------------------|----------------| +| [`clear`](flat_set/clear.md) | 全ての要素を削除する | C++23 | +| [`insert`](flat_set/insert.md) | 要素を挿入する | C++23 | +| [`insert_range`](flat_set/insert_range.md) | Rangeを挿入する | C++23 | +| [`emplace`](flat_set/emplace.md) | 要素を直接構築する | C++23 | +| [`emplace_hint`](flat_set/emplace_hint.md) | ヒントを使って要素を直接構築する | C++23 | +| [`erase`](flat_set/erase.md) | 要素を削除する | C++23 | +| [`swap`](flat_set/swap.md) | コンテンツを交換する | C++23 | +| [`extract`](flat_set/extract.md) | キーのコンテナを取得する | C++23 | +| [`replace`](flat_set/replace.md) | キーのコンテナを置き換える | C++23 | + +### 要素アクセス + +| 名前 | 説明 | 対応バージョン | +|------------------------------------------|--------------------------------------------|-------| +| [`count`](flat_set/count.md) | 指定したキーにマッチする要素の数を取得する | C++23 | +| [`find`](flat_set/find.md) | 指定したキーで要素を探す | C++23 | +| [`contains`](flat_set/contains.md) | 指定したキーの要素が含まれているかを判定する | C++23 | +| [`equal_range`](flat_set/equal_range.md) | 指定したキーにマッチする要素範囲を取得する | C++23 | +| [`lower_bound`](flat_set/lower_bound.md) | 与えられた値より小さくない最初の要素へのイテレータを取得する | C++23 | +| [`upper_bound`](flat_set/upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを取得する | C++23 | + +### オブザーバー + +| 名前 | 説明 | 対応バージョン | +|----------------------------------------|----------------------------------------|----------------| +| [`key_comp`](flat_set/key_comp.md) | キー比較用の関数オブジェクトを取得する | C++23 | +| [`value_comp`](flat_set/value_comp.md) | 要素比較用の関数オブジェクトを取得する | C++23 | + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|--------------------------|---------------------------|----------------| +| `key_type` | キーの型。テンプレートパラメータ `Key` | C++23 | +| `value_type` | 要素の型。テンプレートパラメータ `Key` | C++23 | +| `key_compare` | キーの大小関係を判定する二項述語の型。テンプレートパラメータ `Compare` | C++23 | +| `value_compare` | 要素の大小関係を判定する二項述語の型。テンプレートパラメータ `Compare` | C++23 | +| `reference` | 要素への参照型。`value_type&` | C++23 | +| `const_reference` | 要素への`const`参照型。`const value_type&` | C++23 | +| `size_type` | 要素数を表す符号なし整数型 [`size_t`](/reference/cstddef/size_t.md) | C++23 | +| `difference_type` | 同一のコンテナを指す `iterator` の差を表す符号付き整数型 [`ptrdiff_t`](/reference/cstddef/ptrdiff_t.md) | C++23 | +| `iterator` | ランダムアクセスイテレータ | C++23 | +| `const_iterator` | 読み取り専用ランダムアクセスイテレータ | C++23 | +| `reverse_iterator` | 逆順ランダムアクセスイテレータ。[`std::reverse_iterator`](/reference/iterator/reverse_iterator.md)`` | C++23 | +| `const_reverse_iterator` | 読み取り専用逆順ランダムアクセスイテレータ。[`std::reverse_iterator`](/reference/iterator/reverse_iterator.md)`` | C++23 | +| `container_type` | キーを格納するコンテナ型 `KeyContainer` | C++23 | + + +## 非メンバ関数 +### 要素削除 + +| 名前 | 説明 | 対応バージョン | +|-----------------------------------------|-------------------------------------|----------------| +| [`erase_if`](flat_set/erase_if_free.md) | 指定した条件に合致する要素とその分の領域を、コンテナから削除する | C++23 | + + +## 非メンバ(*Hidden friends*)関数 +### 比較演算子 + +| 名前 | 説明 | 対応バージョン | +|----------------------------------------------------------|----------------------------|-------| +| [`operator==`](flat_set/op_equal.md) | 左辺と右辺が等しいかの判定を行う | C++23 | +| `bool operator!=(const flat_set& x, const flat_set& y);` | 左辺と右辺が等しくないかの判定を行う (`==`により使用可能) | C++23 | +| [`operator<=>`](flat_set/op_compare_3way.md) | 三方比較を行う | C++23 | +| `bool operator<(const flat_set& x, const flat_set& y);` | 左辺が右辺より小さいかの判定を行う (`<=>`により使用可能) | C++23 | +| `bool operator<=(const flat_set& x, const flat_set& y);` | 左辺が右辺より小さいか等しいかの判定を行う (`<=>`により使用可能) | C++23 | +| `bool operator>(const flat_set& x, const flat_set& y);` | 左辺が右辺より大きいかの判定を行う (`<=>`により使用可能) | C++23 | +| `bool operator>=(const flat_set& x, const flat_set& y);` | 左辺が右辺より大きいか等しいかの判定を行う (`<=>`により使用可能) | C++23 | + + +### 入れ替え + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`swap`](flat_set/swap_free.md.nolink) | 2つの`flat_set`オブジェクトを入れ替える | C++23 | + + +## 推論補助 + +| 名前 | 説明 | 対応バージョン | +|---------------------------------------------|------------------------------------|-------| +| [`(deduction_guide)`](flat_set/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | + + +## その他 + +| 名前 | 説明 | 対応バージョン | +|------------------------------------------------|----------------------|-------| +| [`uses_allocator`](flat_set/uses_allocator.md) | `flat_set`による特殊化 | C++23 | + + + +## 例 +### 基本的な使い方 +```cpp example +#include +#include +#include + +int main() +{ + // stringをキーとして扱う連想配列 + std::flat_set fs = {"Carol", "Alice", "Bob"}; + + // 検索 : キーを指定し、イテレータを得る + auto it = fs.find("Alice"); + std::cout << *it << std::endl + << std::endl; + + // 全体を出力する + for (const auto& str : fs) { + std::cout << str << std::endl; + } +} +``` +* fs.find[link flat_set/find.md] + +#### 出力 +``` +Alice + +Alice +Bob +Carol +``` + +### キー以外のテンプレートを指定 +```cpp example +#include +#include +#include + +int main() +{ + std::deque keys = {1, 4, 2, 8, 5, 7}; + + // intをキーとして扱う連想配列 + // キーの順序はgreater、キーのコンテナはdequeで保持 + std::flat_set, + std::deque> fs(keys); + + // 全体を出力する + for (int i : fs) { + std::cout << i << " "; + } + std::cout << std::endl; +} +``` +* std::greater[link ../functional/greater.md] + +#### 出力 +``` +8 7 5 4 2 1 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P1222R0 A Standard `flat_set`](hhttps://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1222r0.pdf) + - C++23で`flat_set`が導入された経緯・動機・設計について記載されている +- [P1222R4 A Standard `flat_set`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1222r4.pdf) + - C++23で導入された`flat_set`の仕様 diff --git a/reference/flat_set/flat_set/begin.md b/reference/flat_set/flat_set/begin.md new file mode 100644 index 0000000000..76cd50864d --- /dev/null +++ b/reference/flat_set/flat_set/begin.md @@ -0,0 +1,73 @@ +# begin +* flat_set[meta header] +* std[meta namespace] +* flat_set[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +iterator begin() noexcept; +const_iterator begin() const noexcept; +``` + + +## 概要 +コンテナの先頭要素を参照するイテレータを取得する。 + +内部的に、コンテナは要素を下位から上位へと並べており、従って`begin()`はコンテナ内の最下位のキーにあたる値へのイテレータを返す。 + + +## 戻り値 +コンテナの先頭要素へのイテレータ。 +`iterator` と `const_iterator` はともにメンバ型である。このクラステンプレートにおいて、これらはランダムアクセスイテレータである。 + + +## 計算量 +定数時間。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_set fs = {3, 1, 4}; + + for (auto i = fs.begin(); i != fs.end(); ++i) { + std::cout << *i << std::endl; + } +} +``` +* begin()[color ff0000] +* fs.end()[link end.md] + +### 出力 +``` +1 +3 +4 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|-----------------------------------|--------------------------------| +| [`flat_set::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`flat_set::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`flat_set::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`flat_set::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | +| [`flat_set::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`flat_set::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | +| [`flat_set::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | diff --git a/reference/flat_set/flat_set/cbegin.md b/reference/flat_set/flat_set/cbegin.md new file mode 100644 index 0000000000..6be52785bb --- /dev/null +++ b/reference/flat_set/flat_set/cbegin.md @@ -0,0 +1,69 @@ +# cbegin +* flat_set[meta header] +* std[meta namespace] +* flat_set[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +const_iterator cbegin() const noexcept; +``` + + +## 概要 +コンテナの先頭要素を参照するイテレータを取得する。 + +内部的に、コンテナは要素を下位から上位へと並べており、従って`cbegin()`はコンテナ内の最下位のキーにあたる値へのイテレータを返す。 + + +## 戻り値 +コンテナの先頭要素へのイテレータ。 +`const_iterator` はメンバ型である。このクラステンプレートにおいて、この型はランダムアクセスイテレータである。 + + +## 計算量 +定数時間。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_set fs = {3, 1, 4}; + + for (auto i = fs.cbegin(); i != fs.cend(); ++i) { + std::cout << *i << std::endl; + } +} +``` +* cbegin()[color ff0000] +* fs.cend()[link cend.md] + +### 出力 +``` +1 +3 +4 +``` + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|-----------------------------------|--------------------------------| +| [`flat_set::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`flat_set::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`flat_set::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`flat_set::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | +| [`flat_set::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`flat_set::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | +| [`flat_set::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | diff --git a/reference/flat_set/flat_set/cend.md b/reference/flat_set/flat_set/cend.md new file mode 100644 index 0000000000..e78572c3f9 --- /dev/null +++ b/reference/flat_set/flat_set/cend.md @@ -0,0 +1,73 @@ +# cend +* flat_set[meta header] +* std[meta namespace] +* flat_set[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +const_iterator cend() const noexcept; +``` + +## 概要 +コンテナの末尾の次を参照するイテレータを取得する。 + + +## 戻り値 +コンテナの末尾の次を参照するイテレータ。 +`const_iterator` はメンバ型である。このクラステンプレートにおいて、この型はランダムアクセスイテレータである。 + + +## 計算量 +定数時間。 + + +## 備考 +- この関数によって返されるイテレータは、`*this`が保持するいずれの要素も参照しない。その指す先は、不正な範囲となるだろう + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_set fs = {3, 1, 4}; + + for (auto i = fs.cbegin(); i != fs.cend(); ++i) { + std::cout << *i << std::endl; + } +} +``` +* cend()[color ff0000] +* fs.cbegin()[link cbegin.md] + +### 出力 +``` +1 +3 +4 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 関連項目 + +| 名前 | 説明 | +|-----------------------------------|-----------------------------| +| [`flat_set::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`flat_set::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`flat_set::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`flat_set::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | +| [`flat_set::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`flat_set::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | +| [`flat_set::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + diff --git a/reference/flat_set/flat_set/clear.md b/reference/flat_set/flat_set/clear.md new file mode 100644 index 0000000000..29bc4b37f1 --- /dev/null +++ b/reference/flat_set/flat_set/clear.md @@ -0,0 +1,56 @@ +# clear +* flat_set[meta header] +* std[meta namespace] +* flat_set[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +void clear() noexcept; // (1) C++23 +``` + +## 概要 +コンテナ内の全ての要素を削除する。各要素のデストラクタが呼ばれ、コンテナから削除される。[`size()`](size.md) は 0 になる。 + + +## 計算量 +線形時間。 + + +## 例外 +投げない。 + + +## 例 +```cpp example +#include +#include + +int main () +{ + std::flat_set fs = {3, 1, 4}; + + std::cout << fs.size() << std::endl; + + fs.clear(); + + std::cout << fs.size() << std::endl; +} +``` +* clear()[color ff0000] +* fs.size()[link size.md] + +### 出力 +``` +3 +0 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/flat_set/flat_set/contains.md b/reference/flat_set/flat_set/contains.md new file mode 100644 index 0000000000..9d9e01d6cc --- /dev/null +++ b/reference/flat_set/flat_set/contains.md @@ -0,0 +1,80 @@ +# contains +* flat_set[meta header] +* std[meta namespace] +* flat_set[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +bool contains(const key_type& x) const; // (1) C++23 + +template +bool contains(const K& x) const; // (2) C++23 +``` + + +## 概要 +指定されたキー`x`に一致する要素がコンテナに含まれているかを判定する。 + +- (1) : クラスのテンプレートパラメータ`key_type`型のキーを受け取る +- (2) : `key_type`と比較可能な`K`型のキーを受け取る + + +## テンプレートパラメータ制約 +- (2) : `key_compare::is_transparent`が妥当な式であること + + +## 戻り値 +以下と等価: + +```cpp +return find(x) != end(); +``` +* find[link find.md] +* end()[link end.md] + + +## 計算量 +対数時間。 + + +## 備考 +- (2) : + - `is_transparent`は、標準ライブラリの[`std::less`](/reference/functional/less.md)、[`std::greater`](/reference/functional/greater.md)といった関数オブジェクトの、`void`に対する特殊化で定義される。それ以外のテンプレートパラメータで`is_transparent`が定義されないのは、互換性のためである。 + - これらのオーバーロードは、`flat_set`のようなコンテナに対し、検索操作で文字列リテラルを渡した際に、キー型の一時オブジェクトが生成されるコストを減らすためにある。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_set fs = {3, 1, 4}; + + // キー3の要素が含まれているか + if (fs.contains(3)) { + std::cout << "contain" << std::endl; + } + else { + std::cout << "doesn't contain" << std::endl; + } +} +``` +* contains[color ff0000] + +### 出力 +``` +contain +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/flat_set/flat_set/count.md b/reference/flat_set/flat_set/count.md new file mode 100644 index 0000000000..4d6f18f86f --- /dev/null +++ b/reference/flat_set/flat_set/count.md @@ -0,0 +1,97 @@ +# count +* flat_set[meta header] +* std[meta namespace] +* flat_set[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +size_type count(const key_type& x) const; // (1) C++23 + +template +size_type count(const K& x) const; // (2) C++23 +``` + +## 概要 +キー `x` を検索し、コンテナ内に見つかった要素の数を返す。`flat_set` コンテナはキーの重複を許さないため、この関数は実際には要素が見つかったときに 1 を、そうでないときに 0 を返す。 + +- (1) : クラスのテンプレートパラメータ`key_type`型のキーを受け取る +- (2) : `key_type`と比較可能な`K`型のキーを受け取る + + +## テンプレートパラメータ制約 +- (2) : `key_compare::is_transparent`が妥当な式であること + + +## 戻り値 +- (1) : `x`と等価なキーの要素が見つかった場合は1、そうでない場合は0を返す。 +- (2) : `key_compare`型の関数オブジェクトを`c`、コンテナ内の各要素が持つキーを`k`として、キーが等価か判定する式`!c(k, x) && !c(x, k)`が`true`となる要素が見つかった場合は1、そうでない場合は0を返す。 + + +## 計算量 +``` +log(size()) + count(x) +``` +* size()[link size.md] + + +## 備考 +- (2) : + - `is_transparent`は、標準ライブラリの[`std::less`](/reference/functional/less.md)、[`std::greater`](/reference/functional/greater.md)といった関数オブジェクトの、`void`に対する特殊化で定義される。それ以外のテンプレートパラメータで`is_transparent`が定義されないのは、互換性のためである。 + - これらのオーバーロードは、`flat_set`のようなコンテナに対し、検索操作で文字列リテラルを渡した際に、キー型の一時オブジェクトが生成されるコストを減らすためにある。 +- [`std::flat_multiset`](/reference/flat_set/flat_multiset.md)クラスとの共通インタフェースを使用する必要がなければ、この関数の代わりに[`contains()`](contains.md)メンバ関数を使用することを推奨する + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + // (1) + { + std::flat_set fs = {"Alice", "Bob", "Carol"}; + + std::size_t n = fs.count("Bob"); + if (n > 0) { // 見つかった + std::cout << "found" << std::endl; + } + } + + // (2) + { + std::flat_set> fs = {"Alice", "Bob", "Carol"}; + + // std::lessのvoidに対する特殊化を使用することで、 + // 文字列リテラルをcount()関数の引数として渡した際に、 + // std::string型の一時オブジェクトが生成されない。 + std::size_t n = fs.count("Bob"); + if (n > 0) { // 見つかった + std::cout << "found" << std::endl; + } + } +} +``` +* fs.count[color ff0000] +* std::less[link /reference/functional/less.md] + +### 出力 +``` +found +found +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`contains()`](contains.md) diff --git a/reference/flat_set/flat_set/crbegin.md b/reference/flat_set/flat_set/crbegin.md new file mode 100644 index 0000000000..966106f5b8 --- /dev/null +++ b/reference/flat_set/flat_set/crbegin.md @@ -0,0 +1,70 @@ +# crbegin +* flat_set[meta header] +* std[meta namespace] +* flat_set[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +const_reverse_iterator crbegin() const noexcept; +``` + +## 概要 +コンテナ内の末尾を指す逆イテレータを取得する。 +内部的に、このコンテナは各要素をキーの値に従って下位から上位へと並べており、従って `crbegin()` は最上位のキーにあたる値へのイテレータを返す。 +`crbegin()` は [`end()`](end.md) と同じ要素を指すわけではなく、その前の要素を指すことに注意。 + + +## 戻り値 +反転したシーケンスの先頭を指す逆イテレータ。 +`const_reverse_iterator` はメンバ型である。このクラステンプレートにおいて、この型は逆ランダムアクセスイテレータであり、`reverse_iterator` と定義される。 + + +## 計算量 +定数時間。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_set fs = {3, 1, 4}; + + for (auto i = fs.crbegin(); i != fs.crend(); ++i) { + std::cout << *i << std::endl; + } +} +``` +* crbegin()[color ff0000] +* fs.crend()[link crend.md] + +### 出力 +``` +4 +3 +1 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +| 名前 | 説明 | +|---------------------------------|-----------------------------| +| [`flat_set::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`flat_set::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`flat_set::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`flat_set::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`flat_set::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | +| [`flat_set::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`flat_set::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | diff --git a/reference/flat_set/flat_set/crend.md b/reference/flat_set/flat_set/crend.md new file mode 100644 index 0000000000..01a8136abe --- /dev/null +++ b/reference/flat_set/flat_set/crend.md @@ -0,0 +1,68 @@ +# crend +* flat_set[meta header] +* std[meta namespace] +* flat_set[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +const_reverse_iterator crend() const noexcept; +``` + + +## 概要 +コンテナの先頭要素の前(これは反転シーケンスの末尾にあたる)を指す逆イテレータを取得する。 +`crend()` は [`begin()`](begin.md) と同じ要素を指すわけではなく、その前の要素を指すことに注意。 + + +## 戻り値 +反転シーケンスの終端を指す逆イテレータ。 +`const_reverse_iterator` はメンバ型である。`flat_set` クラステンプレートにおいて、この型は逆ランダムアクセスイテレータであり、`reverse_iterator` と定義される。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_set fs = {3, 1, 4}; + + for (auto i = fs.crbegin(); i != fs.crend(); ++i) { + std::cout << *i << std::endl; + } +} +``` +* crend()[color ff0000] +* fs.crbegin()[link crbegin.md] + +### 出力 +``` +4 +3 +1 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + + +## 関連項目 + +| 名前 | 説明 | +|------------------------------|-----------------------------------------| +| [`flat_set::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`flat_set::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`flat_set::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`flat_set::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`flat_set::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | +| [`flat_set::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`flat_set::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | diff --git a/reference/flat_set/flat_set/emplace.md b/reference/flat_set/flat_set/emplace.md new file mode 100644 index 0000000000..7378406a27 --- /dev/null +++ b/reference/flat_set/flat_set/emplace.md @@ -0,0 +1,119 @@ +# emplace +* flat_set[meta header] +* std[meta namespace] +* flat_set[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +template +pair emplace(Args&&... args); +``` +* pair[link /reference/utility/pair.md] + +## 概要 +コンテナに新しい要素を挿入する。要素は直接構築される(コピーもムーブもされない)。要素のコンストラクタはこの関数に渡された引数を与えることによって呼ばれる。 + + +## パラメータ +- `args...` : 要素のコンストラクタへ転送される引数パック。 + + +## テンプレートパラメータ制約 +- [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true`であること。 + + +## 効果 +`value_type`型の変数`t`を[`forward`](/reference/utility/forward.md)`(args)...`で初期化する。このコンテナが`t`と等価なキーをすでにもっている場合、`*this`を変更しない。そうでない場合、キーを格納しているコンテナを`c`、とすると、以下と等価: + +```cpp +auto it = ranges::upper_bound(c, t, value_comp()); +c.insert(it, std::move(t)); +``` +* ranges::upper_bound[link /reference/algorithm/ranges_upper_bound.md] +* value_comp()[link value_comp.md] +* insert[link /reference/vector/vector/insert.md] +* std::move[link /reference/utility/move.md] + + +## 戻り値 +挿入されたかどうかを示す `bool` と、挿入された要素へのイテレータからなる [`pair`](/reference/utility/pair.md) を返す。挿入されなかったときは、既存要素へのイテレータを返す。 + + +## 例 +### 単純な挿入の例 +```cpp example +#include +#include + +int main() +{ + std::flat_set fs; + + fs.emplace(3); + fs.emplace(1); + fs.emplace(4); + + for (int i : fs) { + std::cout << i << std::endl; + } +} +``` +* emplace[color ff0000] + +#### 出力 +``` +1 +3 +4 +``` + +### コンストラクタ引数を渡す例 +```cpp example +#include +#include +#include +#include + +int main() +{ + std::flat_set fs; + const char aaa[3] = {'A', 'A', 'A'}; + + fs.emplace(5, 'C'); + fs.emplace("BBBB"); + fs.emplace(std::begin(aaa), std::end(aaa)); + + for (const std::string& i : fs) { + std::cout << i << std::endl; + } +} +``` +* emplace[color ff0000] +* std::begin[link /reference/iterator/begin.md] +* std::end[link /reference/iterator/end.md] + +#### 出力 +``` +AAA +BBBB +CCCCC +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|---------------------------------------------|--------------------------------------------| +| [`flat_set::insert`](insert.md) | 要素を挿入する | +| [`flat_set::insert_range`](insert_range.md) | Rangeを挿入する | +| [`flat_set::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | diff --git a/reference/flat_set/flat_set/emplace_hint.md b/reference/flat_set/flat_set/emplace_hint.md new file mode 100644 index 0000000000..8fd7b5a7cc --- /dev/null +++ b/reference/flat_set/flat_set/emplace_hint.md @@ -0,0 +1,75 @@ +# emplace_hint +* flat_set[meta header] +* std[meta namespace] +* flat_set[meta class] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +template +iterator emplace_hint(const_iterator hint, Args&&... args); +``` + +## 概要 +要素が配置されるべき場所を示唆するパラメータ `hint` を使って、コンテナに新しい要素を挿入する。要素は直接構築される(コピーもムーブもされない)。要素のコンストラクタはこの関数に渡された引数と同じ引数で呼ばれる。 + + +## パラメータ +- `hint` : 新しい要素をどこへ挿入するかを示唆するために使われるイテレータ +- `args...` : 要素のコンストラクタへ転送される引数パック + + +## 戻り値 +新たな要素が追加された場合、その追加された要素を指すイテレータ。新たな要素が追加されなかった場合、既にあった要素を指すイテレータ。 + + +## 計算量 +一般にコンテナのサイズについて対数時間だが、新しい要素が `hint` の前に挿入された場合は償却定数時間。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_set fs = {3, 1, 4}; + + // キー5の要素が最後尾に追加されることが事前にわかっているので、fs.end()をヒントとして与える + fs.emplace_hint(fs.end(), 5); + + for (int i : fs) { + std::cout << i << std::endl; + } +} +``` +* emplace_hint[color ff0000] +* fs.end()[link end.md] + +### 出力 +``` +1 +3 +4 +5 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|---------------------------------------------|--------------------------------------------| +| [`flat_set::insert`](insert.md) | 要素を挿入する | +| [`flat_set::insert_range`](insert_range.md) | Rangeを挿入する | +| [`flat_set::emplace`](emplace.md) | 要素を直接構築する | diff --git a/reference/flat_set/flat_set/empty.md b/reference/flat_set/flat_set/empty.md new file mode 100644 index 0000000000..4b5a168160 --- /dev/null +++ b/reference/flat_set/flat_set/empty.md @@ -0,0 +1,60 @@ +# empty +* flat_set[meta header] +* std[meta namespace] +* flat_set[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +[[nodiscard]] bool empty() const noexcept; // (1) C++23 +``` + +## 概要 +コンテナが空かどうかをテストする。 +コンテナが空([`size()`](size.md) が 0)の場合に `true` を返す。 + +この関数はコンテナ内のコンテンツを変化させない。コンテンツをクリアするには [`clear()`](clear.md) メンバ関数を使用する。 + + +## 戻り値 +コンテナサイズが 0 のときに `true`, そうでないときに `false` を返す。 + + +## 計算量 +定数時間。 + + +## 例 +```cpp example +#include +#include + +int main () +{ + std::flat_set fs; + + std::cout << fs.empty() << std::endl; + + fs.insert(42); + + std::cout << fs.empty() << std::endl; +} +``` +* empty()[color ff0000] +* fs.insert[link insert.md] + +### 出力 +``` +1 +0 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/flat_set/flat_set/end.md b/reference/flat_set/flat_set/end.md new file mode 100644 index 0000000000..0da6177328 --- /dev/null +++ b/reference/flat_set/flat_set/end.md @@ -0,0 +1,74 @@ +# end +* flat_set[meta header] +* std[meta namespace] +* flat_set[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +iterator end() noexcept; +const_iterator end() const noexcept; +``` + +## 概要 +コンテナの末尾の次を参照するイテレータを取得する。 + + +## 戻り値 +コンテナの最後の要素の次を参照するイテレータ。 +`iterator` と `const_iterator` はいずれもメンバ型である。このクラステンプレートにおいて、これらはランダムアクセスイテレータである。 + + +## 計算量 +定数時間。 + + +## 備考 +- この関数によって返されるイテレータは、`*this`が保持するいずれの要素も参照しない。その指す先は、不正な範囲となるだろう + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_set fs = {3, 1, 4}; + + for (auto i = fs.begin(); i != fs.end(); ++i) { + std::cout << *i << std::endl; + } +} +``` +* end()[color ff0000] +* fs.begin()[link begin.md] + +### 出力 +``` +1 +3 +4 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|-----------------------------------|-----------------------------| +| [`flat_set::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`flat_set::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`flat_set::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`flat_set::rbegin`](rbegin.md) | 末尾の次を指す逆イテレータを取得する | +| [`flat_set::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`flat_set::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | +| [`flat_set::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | diff --git a/reference/flat_set/flat_set/equal_range.md b/reference/flat_set/flat_set/equal_range.md new file mode 100644 index 0000000000..c03c414317 --- /dev/null +++ b/reference/flat_set/flat_set/equal_range.md @@ -0,0 +1,85 @@ +# equal_range +* flat_set[meta header] +* std[meta namespace] +* flat_set[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +pair equal_range(const key_type& x); // (1) C++23 + +template +pair equal_range(const K& x); // (2) C++23 + +pair + equal_range(const key_type& x) const; // (3) C++23 + +template +pair + equal_range(const K& x) const; // (4) C++23 +``` +* pair[link /reference/utility/pair.md] + +## 概要 +コンテナ内の、`x` と等しいキー要素を全て含む範囲の境界を返す。`flat_set` コンテナではキーの重複は無いため、この範囲は最大一つの要素を含む。 + +もし `x` がコンテナ内のどのキーともマッチしなかった場合、戻り値の範囲は長さ 0 になり、両方のイテレータは `x` より大きく最も近い値を指す。そうでない場合、`x` がコンテナ内の全ての要素よりも大きい場合は [`end`](end.md) を指す。 + +- (1) : `key_type`型のキーを受け取り、そのキーと等価なキー要素を全て含むイテレータ範囲を取得する。 +- (2) : `key_type`と比較可能な`K`型のキーを受け取り、そのキーと等価なキー要素を全て含むイテレータ範囲を取得する。 +- (3) : `const`な`*this`オブジェクトにおいて、`key_type`型のキーを受け取り、そのキーと等価なキー要素を全て含むイテレータ範囲を取得する。 +- (4) : `const`な`*this`オブジェクトにおいて、`key_type`と比較可能な`K`型のキーを受け取り、そのキーと等価なキー要素を全て含むイテレータ範囲を取得する。 + + +## 戻り値 +この関数は `pair` を返す。ここで `pair::first` は [`lower_bound`](lower_bound.md)`(x)` が返すであろう値と同じ値で範囲の下境界にあたり、`pair::second` は [`upper_bound`](upper_bound.md)`(x)` が返すであろう値と同じ値で範囲の上境界にあたる。 + + +## 計算量 +[`size`](size.md) について対数時間。 + + +## 備考 +- (2), (4) : この関数がオーバーロード解決に参加する条件は、[`find()`](find.md)メンバ関数の備考欄を参照。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_set fs = {3, 1, 4}; + + using iterator = decltype(fs)::iterator; + std::pair ret = fs.equal_range(3); + + for (iterator it = ret.first; it != ret.second; ++it) { + std::cout << *it << std::endl; + } +} +``` +* equal_range[color ff0000] + +### 出力 +``` +3 +``` + + +## バージョン +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------------------|----------------------------------------------------------| +| [`flat_set::count`](count.md) | 指定したキーにマッチする要素の数を返す | +| [`flat_set::lower_bound`](lower_bound.md) | 与えられた値より小さくない最初の要素へのイテレータを返す | +| [`flat_set::upper_bound`](upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | +| [`flat_set::find`](find.md) | 指定したキーで要素を探す | diff --git a/reference/flat_set/flat_set/erase.md b/reference/flat_set/flat_set/erase.md new file mode 100644 index 0000000000..dd2274cfea --- /dev/null +++ b/reference/flat_set/flat_set/erase.md @@ -0,0 +1,140 @@ +# erase +* flat_set[meta header] +* std[meta namespace] +* flat_set[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +iterator erase(iterator position); // (1) C++23 + +iterator erase(const_iterator position); // (2) C++23 + +size_type erase(const key_type& x); // (3) C++23 + +template +size_type erase(K&& x); // (4) C++23 + +iterator erase(const_iterator first, const_iterator last); // (5) C++23 +``` + +## 概要 +単一要素またはイテレータ範囲`[first, last)`を コンテナから削除する。 + +これは削除された要素の数だけコンテナの `size` を減らし、それぞれの要素のデストラクタを呼び出す。 + +- (1) : 指定されたイテレータが指す要素を削除する +- (2) : 指定された読み取り専用イテレータが指す要素を削除する +- (3) : 指定されたキーをもつ要素を削除する +- (4) : `key_type`と比較可能な`K`型のキーを受け取って要素を削除する +- (5) : 指定されたイテレータ範囲の要素をすべて削除する + + +## パラメータ +- `position` : 削除する単一要素を指すイテレータ。`iterator` はメンバ型であり、双方向イテレータとして定義される。 +- `x` : 削除する値のキー。`key_type` はメンバ型であり、コンテナの中で `Key` の別名として定義される。 +- `first, last` : 削除するイテレータ範囲 `[first, last)` を指定するイテレータ。ここでいう範囲は `first` と `last` の間の全ての要素を含み、`first` が指す要素を含むが `last` が指す要素は含まない。 + + +## 戻り値 +- (1), (2), (5) : 削除された要素の次を指すイテレータを返す。そのような要素がない場合、[`end()`](end.md)を返す (要素を削除した結果としてコンテナが空になった場合) +- (3), (4) : 削除された要素の数を返す。 + + +## 計算量 +- (1), (2) : 定数時間 +- (3), (4) : コンテナの [`size()`](size.md) について対数時間 +- (5) : コンテナの [`size()`](size.md) について対数時間、それに加えて `first` と `last` の間の距離に対する線形時間 + + +## 備考 +- (1), (2) : この関数に、範囲外のイテレータ (終端イテレータを含む) を指定した場合の動作は未定義 + + +## 例 +### 基本的な使い方 (C++23) +```cpp example +#include +#include + +int main() +{ + std::flat_set fs = {3, 1, 4}; + + std::cout << fs.size() << std::endl; + + fs.erase(1); + std::cout << fs.size() << std::endl; + + fs.erase(fs.begin(), fs.end()); + std::cout << fs.size() << std::endl; +} +``` +* erase[color ff0000] +* fs.size()[link size.md] +* fs.begin()[link begin.md] +* fs.end()[link end.md] + +#### 出力 +``` +3 +2 +0 +``` + +### イテレート中に要素を削除する (C++23) +```cpp example +#include +#include + +int main() +{ + std::flat_set fs = {3, 1, 4}; + + // イテレート中に要素削除をするような場合には、 + // 範囲for文は使用できない + for (auto it = fs.begin(); it != fs.end();) { + // 条件一致した要素を削除する + if (*it == 1) { + // 削除された要素の次を指すイテレータが返される。 + it = fs.erase(it); + } + // 要素削除をしない場合に、イテレータを進める + else { + ++it; + } + } + + for (int i : fs) { + std::cout << i << std::endl; + } +} +``` +* erase[color ff0000] +* fs.begin()[link begin.md] +* fs.end()[link end.md] + +#### 出力 +``` +3 +4 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|---------------------------------|--------------------------| +| [`flat_set::clear`](clear.md) | 全ての要素を削除する | +| [`flat_set::insert`](insert.md) | 要素を挿入する | +| [`flat_set::find`](find.md) | 指定したキーで要素を探す | diff --git a/reference/flat_set/flat_set/erase_if_free.md b/reference/flat_set/flat_set/erase_if_free.md new file mode 100644 index 0000000000..58646f1c29 --- /dev/null +++ b/reference/flat_set/flat_set/erase_if_free.md @@ -0,0 +1,71 @@ +# erase_if +* flat_set[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template + typename flat_set::size_type + erase_if(flat_set& c, + Predicate pred); +} +``` + +## 概要 +指定した条件に合致する要素とその分の領域を、コンテナから削除する。 + + +## 事前条件 +- `Key`がムーブ代入可能であること + + +## 効果 +メンバ変数として保持しているコンテナ`c`の各要素`e`について、`bool(pred(e))`を`E`として、`E`が`true`であるすべての要素を削除する。 + + +## 戻り値 +削除した要素数を返す。 + + +## 計算量 +正確に[`size()`](size.md)回だけ述語適用する。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_set fs = {3, 1, 4}; + + // コンテナfsから、キー1をもつ要素をすべて削除する + std::erase_if(fs, [](const auto& x) { return x == 1; }); + + for (int i : fs) { + std::cout << i << std::endl; + } +} +``` +* std::erase_if[color ff0000] + +### 出力 +``` +3 +4 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/flat_set/flat_set/extract.md b/reference/flat_set/flat_set/extract.md new file mode 100644 index 0000000000..dc2bbe200a --- /dev/null +++ b/reference/flat_set/flat_set/extract.md @@ -0,0 +1,77 @@ +# extract +* flat_set[meta header] +* std[meta namespace] +* flat_set[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +container_type extract() &&; // C++23 +``` + +## 概要 +値のコンテナを戻り値として返す。 + + +## 戻り値 +クラス内部のデータ保持形式である `container_type` オブジェクト。 + + +## 事後条件 +呼び出し側の `flat_set` は空になる(たとえ例外で関数が中断されたとしても)。 + + +## 計算量 +定数時間。 + + +## 備考 +本関数は右辺値修飾されているので、右辺値からのみ読み出し可能である。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::flat_set fs = {3, 1, 4}; + + std::cout << fs.size() << std::endl; + + decltype(fs)::container_type c = std::move(fs).extract(); + + std::cout << fs.size() << std::endl; + std::cout << std::endl; + + for (int i : c) { + std::cout << i << std::endl; + } +} +``` +* extract()[color ff0000] +* fs.size()[link size.md] +* std::move[link /reference/utility/move.md] + +### 出力 +``` +3 +0 + +1 +3 +4 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/flat_set/flat_set/find.md b/reference/flat_set/flat_set/find.md new file mode 100644 index 0000000000..b4fba9c70c --- /dev/null +++ b/reference/flat_set/flat_set/find.md @@ -0,0 +1,101 @@ +# find +* flat_set[meta header] +* std[meta namespace] +* flat_set[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +iterator find(const key_type& x); // (1) C++23 + +template +iterator find(const K& x); // (2) C++23 + +const_iterator find(const key_type& x) const; // (3) C++23 + +template +const_iterator find(const K& x) const; // (4) C++23 +``` + +## 概要 +`x`と等価なキーの要素を検索する。 + +- (1), (3) : クラスのテンプレートパラメータ`key_type`型のキーを受け取って検索する。 +- (2), (4) : `key_type`と比較可能な`K`型のキーを受け取って検索する。 + + +## テンプレートパラメータ制約 +- (2), (4) : `key_compare::is_transparent`が妥当な式であること + + +## 戻り値 +- (1), (3) : `x`と等価なキーの要素が見つかった場合は、見つかった要素へのイテレータを返す。そうでない場合は、 [`end()`](end.md) を返す。 +- (2), (4) : `key_compare`型の関数オブジェクトを`c`、コンテナ内の各要素が持つキーを`k`として、キーが等価か判定する式`!c(k, x) && !c(x, k)`が`true`となる要素へのイテレータを返す。そのような要素がない場合は、[`end()`](end.md) を返す。 + + +## 計算量 +[`size`](size.md) について対数時間。 + + +## 備考 +- (2), (4) : + - `is_transparent`は、標準ライブラリの[`std::less`](/reference/functional/less.md)、[`std::greater`](/reference/functional/greater.md)といった関数オブジェクトの、`void`に対する特殊化で定義される。それ以外のテンプレートパラメータで`is_transparent`が定義されないのは、互換性のためである。 + - これらのオーバーロードは、`flat_set`のようなコンテナに対し、検索操作で文字列リテラルを渡した際に、キー型の一時オブジェクトが生成されるコストを減らすためにある。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + // (1) + { + std::flat_set fs = {"Alice", "Bob", "Carol"}; + + decltype(fs)::iterator it = fs.find("Bob"); + if (it != fs.end()) { // 見つかった + std::cout << *it << std::endl; + } + } + + // (2) + { + std::flat_set> fs = {"Alice", "Bob", "Carol"}; + + // std::lessのvoidに対する特殊化を使用することで、 + // 文字列リテラルをfind()関数の引数として渡した際に、 + // std::string型の一時オブジェクトが生成されない。 + decltype(fs)::iterator it = fs.find("Bob"); + if (it != fs.end()) { // 見つかった + std::cout << *it << std::endl; + } + } +} +``` +* find[color ff0000] +* fs.end()[link end.md] +* std::less[link /reference/functional/less.md] + +### 出力 +``` +Bob +Bob +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`contains()`](contains.md) diff --git a/reference/flat_set/flat_set/insert.md b/reference/flat_set/flat_set/insert.md new file mode 100644 index 0000000000..ef79a30b33 --- /dev/null +++ b/reference/flat_set/flat_set/insert.md @@ -0,0 +1,225 @@ +# insert +* flat_set[meta header] +* std[meta namespace] +* flat_set[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +pair insert(const value_type& x); // (1) C++23 +pair insert(value_type&& x); // (2) C++23 + +iterator insert(const_iterator position, + const value_type& x); // (3) C++23 +iterator insert(const_iterator position, + value_type&& x); // (4) C++23 + +template +pair insert(P&& x); // (5) C++23 + +template +iterator insert(const_iterator position, + P&&); // (6) C++23 + +template +void insert(InputIterator first, + InputIterator last); // (7) C++23 + +template +void insert(sorted_unique_t, + InputIterator first, + InputIterator last); // (8) C++23 + +void insert(initializer_list il); // (9) C++23 + +void insert(sorted_unique_t s, + initializer_list il); // (10) C++23 +``` +* pair[link /reference/utility/pair.md] +* initializer_list[link /reference/initializer_list/initializer_list.md] +* sorted_unique_t[link /reference/flat_set_/sorted_unique_t.md] + +## 概要 +新しく一つの要素(引数 `x` を使う)または要素のシーケンス(入力イテレータまたは `initializer_list` を使う)を挿入し、コンテナを拡張する。 + +これは、挿入された要素の数だけコンテナの [`size()`](size.md) を増やす。 + +`flat_set` コンテナは重複したキーを持つ要素を許さないため、挿入操作はそれぞれの要素が他のコンテナ内の既存要素と同じキーかどうかをチェックする。もし同じであれば要素は挿入されず、戻り値を持つ関数の場合はそれへのイテレータなどを返す。 + +重複した値を許す、類似したコンテナについては [`flat_multiset`](/reference/flat_set/flat_multiset.md) を参照。 + +内部的に `flat_set_` コンテナは、コンストラクト時に指定された比較オブジェクトによって要素を下位から上位へとソートして保持する。 + +この操作は、適切な引数 `position` を提供することで効率を飛躍的に改善することができる。 + +- (1) : 単一要素を挿入する +- (2) : 単一要素の一時オブジェクトを挿入する +- (3) : 指定された位置に、単一要素を挿入する +- (4) : 指定された位置に、単一要素の一時オブジェクトを挿入する +- (5) : 単一要素として要素型`value_type`のコンストラクタ引数を受け取って挿入する +- (6) : 指定された位置に、要素型`value_type`のコンストラクタ引数を受け取って挿入する +- (7) : イテレータ範囲`[first, last)`を挿入する +- (8) : ソート済みかつ重複要素のないイテレータ範囲`[first, last)`を挿入する +- (9) : 初期化子リストを挿入する +- (10) : ソート済みかつ重複要素のない初期化子リストを挿入する + + +## 要件 +- (5), (6) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true`であること + + +## 効果 +- (1) : + ```cpp + return emplace(x); + ``` + * emplace[link emplace.md] + +- (2) : + ```cpp + return emplace(std::move(x)); + ``` + * emplace[link emplace.md] + * move[link /reference/utility/move.md] + +- (3) : + ```cpp + return emplace_hint(position, x); + ``` + * emplace_hint[link emplace_hint.md] + +- (4) : + ```cpp + return emplace_hint(position, std::move(x)); + ``` + * emplace_hint[link emplace_hint.md] + * move[link /reference/utility/move.md] + +- (5) : 以下と等価: + ```cpp + return emplace(std::forward

(x)); + ``` + * emplace[link emplace.md] + * forward[link /reference/utility/forward.md] + +- (6) : 以下と等価: + ```cpp + return emplace_hint(position, std::forward

(x));. + ``` + * emplace_hint[link emplace_hint.md] + * forward[link /reference/utility/forward.md] + +- (7) : メンバ変数として保持しているコンテナ`c`に、以下のように挿入する: + ```cpp + for (; first != last; ++first) { + value_type value = *first; + c.insert(c.end(), std::move(value)); + } + ``` + * end()[link /reference/vector/vector/end.md] + * insert[link /reference/vector/vector/insert.md] + * std::move[link /reference/utility/move.md] + + - 次に、新しく挿入された要素の範囲を`value_comp()`を基準にソートする + - 次に、ソートされた結果の範囲と、既存の要素のソートされた範囲をひとつのソートされた範囲にマージする + - 最後に、重複する要素を削除する + +- (8) : メンバ変数として保持しているコンテナ`c`に、以下のように挿入する: + ```cpp + for (; first != last; ++first) { + value_type value = *first; + c.insert(c.end(), std::move(value)); + } + ``` + * end()[link /reference/vector/vector/end.md] + * insert[link /reference/vector/vector/insert.md] + * std::move[link /reference/utility/move.md] + + - 次に、ソートされた結果の範囲と、既存の要素のソートされた範囲をひとつのソートされた範囲にマージする + - 最後に、重複する要素を削除する + +- (9) : + ```cpp + insert(il.begin(), il.end()); + ``` + +- (10) : + ```cpp + insert(s, il.begin(), il.end()); + ``` + + +## 戻り値 +- (1), (2), (5) : 戻り値としては、イテレータと`bool`値の組を返す。 + - 挿入された場合には、`first` に挿入された要素へのイテレータ、 `second` に `true` が設定される。 + - 挿入されなかった場合には、 `first` に `x` と等価のキーを持つ要素へのイテレータ、 `second` に `false` が設定される。 +- (3), (4), (6) : + - 挿入された場合には、新しく挿入された要素を指すイテレータを返す。 + - 挿入されなかった場合には、`x`のキーと等価のキーを持つ要素へのイテレータを返す。 +- (7), (8), (9), (10) : なし + + +## 計算量 +- (7) : Nをこの操作の前の[`size()`](size.md)、Mを[`distance`](/reference/iterator/distance.md)`(first, last)`として、N + MlogM +- (8) : Nをこの操作のあとの[`size()`](size.md)として、Nに対して線形 + + +## 備考 +- (7), (8) : この操作はインプレース・マージを行うため、追加のメモリ確保を行う可能性がある + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::flat_set fs; + + // 単一要素を挿入する + fs.insert(1); + + // シーケンスを挿入する + std::vector v = {2, 3, 4}; + fs.insert(v.begin(), v.end()); + + // 挿入するシーケンスがソート済みかつ重複要素がないことがわかっている場合、 + // 以下のように指定した方が高速になる + fs.insert(std::sorted_unique, {5, 6, 7}); + + for (int i : fs) { + std::cout << i << std::endl; + } +} +``` +* insert[color ff0000] +* begin()[link /reference/vector/vector/begin.md] +* end()[link /reference/vector/vector/end.md] +* std::sorted_unique[link /reference/flat_set/sorted_unique_t.md] + +### 出力 +``` +1 +2 +3 +4 +5 +6 +7 +``` + +## バージョン +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +| 名前 | 説明 | +|---------------------------------------------|----------------------------------| +| [`flat_set::insert_range`](insert_range.md) | Rangeを挿入する | +| [`flat_set::emplace`](emplace.md) | 要素を直接構築する | +| [`flat_set::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | diff --git a/reference/flat_set/flat_set/insert_range.md b/reference/flat_set/flat_set/insert_range.md new file mode 100644 index 0000000000..1e67de38f1 --- /dev/null +++ b/reference/flat_set/flat_set/insert_range.md @@ -0,0 +1,79 @@ +# insert_range +* flat_set[meta header] +* std[meta namespace] +* flat_set[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +template R> +void insert_range(R&& rg); // (1) C++23 +``` +* container-compatible-range[link /reference/exposition-only/container-compatible-range.md] + +## 概要 +Rangeを挿入し、コンテナを拡張する。 + +これは、挿入された要素の数だけコンテナの [`size()`](size.md) を増やす。 + +`flat_set` コンテナは重複したキーを持つ要素を許さないため、挿入操作はそれぞれの要素が他のコンテナ内の既存要素と同じキーかどうかをチェックする。もし同じであれば要素は挿入されない。 + +重複した値を許す、類似したコンテナについては [`flat_multiset`](/reference/flat_set/flat_multiset.md) を参照。 + +内部的に `flat_set` コンテナは、コンストラクト時に指定された比較オブジェクトによって要素を下位から上位へとソートして保持する。 + + +## 戻り値 +なし + + +## 計算量 +- Nをこの操作の前の[`size()`](size.md)、Mを[`ranges::distance`](/reference/iterator/ranges_distance.md)`(rg)`として、N + MlogM + + +## 備考 +- この操作はインプレース・マージを行うため、追加のメモリ確保を行う可能性がある + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_set fs = {3}; + + std::flat_set fs2 = {5, 15}; + + fs.insert_range(fs2); + + for (int i : fs) { + std::cout << i << std::endl; + } +} +``` +* insert_range[color ff0000] + +### 出力 +``` +3 +5 +15 +``` + + +## バージョン +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|---------------------------------------------|----------------------------------| +| [`flat_set::insert`](insert.md) | 要素を挿入する | +| [`flat_set::emplace`](emplace.md) | 要素を直接構築する | +| [`flat_set::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | diff --git a/reference/flat_set/flat_set/key_comp.md b/reference/flat_set/flat_set/key_comp.md new file mode 100644 index 0000000000..af9fc68623 --- /dev/null +++ b/reference/flat_set/flat_set/key_comp.md @@ -0,0 +1,64 @@ +# key_comp +* flat_set[meta header] +* std[meta namespace] +* flat_set[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +key_compare key_comp() const; // C++23 +``` + + +## 概要 +コンテナに関連づけられたキー比較用の関数オブジェクトを返す。このオブジェクトはコンテナ内の二つのキーを比較するために利用できる。 +この比較オブジェクトはオブジェクトの構築時に与えられ、関数へのポインタでも関数オブジェクトでも良い。いずれの場合でも、これは同じ型の 2 つの引数をとり、[狭義の弱順序](/reference/algorithm.md#strict-weak-ordering)に従って一つ目の引数が二つ目の引数より前のときに `true` を返し、そうでないときに `false` を返す。 + + +## 戻り値 +比較オブジェクト。`key_compare` はメンバ型であり、テンプレートパラメータ `Compare` の別名として定義される。 + + +## 計算量 +定数時間。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_set s; + std::flat_set::key_compare comp = s.key_comp(); + + std::cout << comp(1, 2) << std::endl; + std::cout << comp(3, 2) << std::endl; +} +``` +* key_comp()[color ff0000] + +### 出力 +``` +1 +0 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------------|----------------------------------------------------------| +| [`value_comp`](value_comp.md) | 要素比較用の関数オブジェクトを返す | diff --git a/reference/flat_set/flat_set/lower_bound.md b/reference/flat_set/flat_set/lower_bound.md new file mode 100644 index 0000000000..fe99048550 --- /dev/null +++ b/reference/flat_set/flat_set/lower_bound.md @@ -0,0 +1,121 @@ +# lower_bound +* flat_set[meta header] +* std[meta namespace] +* flat_set[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +iterator lower_bound(const key_type& x); // (1) C++23 + +template +iterator lower_bound(const K& x); // (2) C++23 + +const_iterator lower_bound(const key_type& x) const; // (3) C++23 + +template +const_iterator lower_bound(const K& x) const; // (4) C++23 +``` + +## 概要 +`x` を右辺とする `<` 演算が成り立たない最初の要素を指すイテレータを返す(コンテナの比較オブジェクトが使われる)。すなわちこれは `>=` 演算にあたる。 + +[`upper_bound()`](upper_bound.md) とは異なり、このメンバ関数は `x` より大きいだけでなく、`x` と等しい場合であってもその要素へのイテレータを返す。 + +内部的には `flat_set` コンテナ内の全ての要素は常に比較オブジェクトが定義する基準に沿って並んでいるため、この関数が返すいずれかの後に続く全ての要素が `x` より大きいか等しいことに注意。 + +- (1) : `key_type`型のキーを受け取り、そのキーより小さくない最初の要素へのイテレータを取得する。 +- (2) : `key_type`と比較可能な`K`型のキーを受け取り、そのキーより小さくない最初の要素へのイテレータを取得する。 +- (3) : `const`な`*this`オブジェクトにおいて、`key_type`型のキーを受け取り、そのキーより小さくない最初の要素へのイテレータを取得する。 +- (4) : `const`な`*this`オブジェクトにおいて、`key_type`と比較可能な`K`型のキーを受け取り、そのキーより小さくない最初の要素へのイテレータを取得する。 + + +## 戻り値 +- (1), (3) : コンテナ内で `x` を右辺とする `<` 演算が成り立たない最初の要素へのイテレータを返す。そのような要素がない場合は、[`end()`](end.md)を返す。 +- (2), (4) : `key_compare`型の関数オブジェクトを`c`、コンテナ内の各要素が持つキーを`k`として、キーが小さくないか判定する式`!c(k, x)`が`true`となる要素へのイテレータを返す。そのような要素がない場合は、[`end()`](end.md) を返す。 + + +## 計算量 +[`size()`](size.md) について対数時間。 + + +## 備考 +- (2), (4) : この関数がオーバーロード解決に参加する条件は、[`find()`](find.md)メンバ関数の備考欄を参照。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + // (1) + { + std::flat_set fs = { + "Alice", "Bob", "Carol", "David" + }; + + // Bob以上David以下の範囲を取得 + decltype(fs)::iterator it = fs.lower_bound("Bob"); + decltype(fs)::iterator last = fs.upper_bound("David"); + + while (it != last) { + std::cout << *it << std::endl; + ++it; + } + } + + std::cout << std::endl; + + // (2) + { + std::flat_set> fs = { + "Alice", "Bob", "Carol", "David" + }; + + // std::lessのvoidに対する特殊化を使用することで、 + // 文字列リテラルをlower_bound()関数の引数として渡した際に、 + // std::string型の一時オブジェクトが生成されない。 + decltype(fs)::iterator it = fs.lower_bound("Bob"); + decltype(fs)::iterator last = fs.upper_bound("David"); + + while (it != last) { + std::cout << *it << std::endl; + ++it; + } + } +} +``` +* lower_bound[color ff0000] +* fs.upper_bound[link upper_bound.md] +* std::less[link /reference/functional/less.md] + +### 出力 +``` +Bob +Carol +David + +Bob +Carol +David +``` + + +## バージョン +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------------------|------------------------------------------------------| +| [`flat_set::upper_bound`](upper_bound.md) | 指定した値よりも大きい最初の要素へのイテレータを返す | +| [`flat_set::equal_range`](equal_range.md) | 指定したキーにマッチする要素範囲を返す | +| [`flat_set::find`](find.md) | 指定したキーで要素を探す | +| [`flat_set::count`](count.md) | 指定したキーにマッチする要素の数を返す | diff --git a/reference/flat_set/flat_set/max_size.md b/reference/flat_set/flat_set/max_size.md new file mode 100644 index 0000000000..4702090439 --- /dev/null +++ b/reference/flat_set/flat_set/max_size.md @@ -0,0 +1,51 @@ +# max_size +* flat_set[meta header] +* std[meta namespace] +* flat_set[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +size_type max_size() const noexcept; // (1) C++23 +``` + +## 概要 +コンテナが格納できる要素の最大数を返す。 +これは、システムやライブラリ実装の制限のもとでコンテナが格納できる潜在的な最大サイズである。 + + +## 戻り値 +`container_type` 型メンバ変数 `c` があるとして、`c.`[`max_size()`](/reference/vector/vector/max_size.md)。 + + +## 計算量 +定数時間。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_set fs; + + std::cout << fs.max_size() << std::endl; +} +``` +* max_size()[color ff0000] + +### 出力例 +``` +178956970 +``` + + +## 言語バージョン +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/flat_set/flat_set/op_assign.md b/reference/flat_set/flat_set/op_assign.md new file mode 100644 index 0000000000..4999cee1e2 --- /dev/null +++ b/reference/flat_set/flat_set/op_assign.md @@ -0,0 +1,65 @@ +# operator= +* flat_set[meta header] +* std[meta namespace] +* flat_set[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +flat_set& operator=(initializer_list il); // C++23 +``` +* initializer_list[link /reference/initializer_list/initializer_list.md] + + +## 概要 +初期化子リストの値を代入する。 + + +## 効果 +`*this`の全ての要素が解放され、`il`の全ての要素が`*this`にコピー代入される。 + + +## 戻り値 +`*this` + + +## 備考 +- 引数の型が `const flat_set&` であるコピー代入演算子と、引数の型が `flat_set&&` であるムーブ代入演算子は、それぞれ自動生成される。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::initializer_list elems = {"Alice", "Bob", "Carol"}; + + std::flat_set fs; + fs = elems; + + for (const std::string& i : fs) { + std::cout << i << std::endl; + } +} +``` + +### 出力 +``` +Alice +Bob +Carol +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/flat_set/flat_set/op_compare_3way.md b/reference/flat_set/flat_set/op_compare_3way.md new file mode 100644 index 0000000000..a9c38f5a9d --- /dev/null +++ b/reference/flat_set/flat_set/op_compare_3way.md @@ -0,0 +1,82 @@ +# operator<=> +* flat_set[meta header] +* std[meta namespace] +* function template[meta id-type] +* flat_set[meta class] +* cpp23[meta cpp] + +```cpp +synth-three-way-result + operator<=>(const flat_set& x, + const flat_set& y); // (1) C++23 +``` + +## 概要 +`flat_set`オブジェクトの三方比較を行う。 + + +## テンプレートパラメータ制約 +- 型 (`const`) `value_type` の値に対して`operator<=>`が定義されるか、型 (`const`) `value_type` の値に対して`operator<`が定義され全順序をもつこと + + +## 効果 +```cpp +return lexicographical_compare_three_way( + x.begin(), x.end(), + y.begin(), y.end(), + synth-three-way); +``` +* lexicographical_compare_three_way[link /reference/algorithm/lexicographical_compare_three_way.md] +* begin()[link begin.md] +* end()[link end.md] + + +## 計算量 +線形時間。 + + +## 備考 +- この演算子により、以下の演算子が使用可能になる: + - `operator<` + - `operator<=` + - `operator>` + - `operator>=` + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_set fs1 = {3, 1, 4}; + + std::flat_set fs2 = {3, 1}; + + std::cout << std::boolalpha; + std::cout << ((fs1 <=> fs1) == 0) << std::endl; + std::cout << (fs1 < fs2) << std::endl; + std::cout << (fs1 <= fs1) << std::endl; + std::cout << (fs1 > fs2) << std::endl; + std::cout << (fs2 >= fs1) << std::endl; +} +``` + +### 出力 +``` +true +false +true +true +false +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/flat_set/flat_set/op_constructor.md b/reference/flat_set/flat_set/op_constructor.md new file mode 100644 index 0000000000..7a6fa5aafd --- /dev/null +++ b/reference/flat_set/flat_set/op_constructor.md @@ -0,0 +1,267 @@ +# コンストラクタ +* flat_set[meta header] +* std[meta namespace] +* flat_set[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +// ____要素数ゼロのflat_setを構築____ + +flat_set() : flat_set(key_compare()) { } // (1) C++23 + +explicit flat_set(const key_compare& comp) // (2) C++23 + : c(), compare(comp) { } + +template +explicit flat_set(const Allocator& a); // (3) C++23 + +template +flat_set(const key_compare& comp, const Allocator& a); // (4) C++23 + +// ____アロケータを伴うコピー&ムーブコンストラクタ____ + + template + flat_set(const flat_set& x, const Allocator& a); // (5) C++26 + + template + flat_set(flat_set&& x, const Allocator& a); // (6) C++26 + +// ____container_typeから構築____ + +flat_set(container_type cont, + const key_compare& comp = key_compare()); // (7) C++23 + +template +flat_set(const container_type cont&, + const Allocator& a); // (8) C++23 + +template +flat_set(const container_type& cont, + const key_compare& comp, const Allocator& a); // (9) C++23 + +// ____container_type(ソート済み且つ重複なし)から構築____ + +flat_set(sorted_unique_t, container_type cont, + const key_compare& comp = key_compare()); // (10) C++23 + +template +flat_set(sorted_unique_t, const container_type& cont, + const Allocator& a); // (11) C++23 + +template +flat_set(sorted_unique_t, const container_type& cont, + const key_compare& comp, const Allocator& a); // (12) C++23 + +// ____イテレータから構築____ + +template +flat_set(InputIterator first, InputIterator last, const key_compare& comp = key_compare()) // (13) C++23 + : c(), compare(comp) { insert(first, last); } + +template +flat_set(InputIterator first, InputIterator last, const Allocator& a); // (14) C++23 + +template +flat_set(InputIterator first, InputIterator last, + const key_compare& comp, const Allocator& a); // (15) C++23 + +// ____イテレータ(ソート済み且つ重複なし)から構築____ + +template +flat_set(sorted_unique_t s, InputIterator first, InputIterator last, + const key_compare& comp = key_compare()) // (16) C++23 + : c(), compare(comp) { insert(s, first, last); } + +template +flat_set(sorted_unique_t, InputIterator first, InputIterator last, const Allocator& a); // (17) C++23 + +template +flat_set(sorted_unique_t, InputIterator first, InputIterator last, + const key_compare& comp, const Allocator& a); // (18) C++23 + +// ____Rangeから構築____ + +template R> +flat_set(from_range_t fr, R&& rg) // (19) C++23 + : flat_set(fr, forward(rg), key_compare()) { } + +template R> +flat_set(from_range_t, R&& rg, const key_compare& comp) // (20) C++23 + : flat_set(comp) { insert_range(forward(rg)); } + +template R, class Allocator> +flat_set(from_range_t, R&& rg, const Allocator& a); // (21) C++23 + +template R, class Allocator> +flat_set(from_range_t, R&& rg, const key_compare& comp, const Allocator& a); // (22) C++23 + +// ____initializer_listから構築____ + +flat_set(initializer_list il, const key_compare& comp = key_compare()) // (23) C++23 + : flat_set(il.begin(), il.end(), comp) { } + +template +flat_set(initializer_list il, const Allocator& a); // (24) C++23 + +template +flat_set(initializer_list il, const key_compare& comp, const Allocator& a); // (25) C++23 + +// ____initializer_list(ソート済み且つ重複なし)から構築____ + +flat_set(sorted_unique_t s, initializer_list il, + const key_compare& comp = key_compare()) // (26) C++23 + : flat_set(s, il.begin(), il.end(), comp) { } + +template +flat_set(sorted_unique_t, initializer_list il, const Allocator& a); // (27) C++23 + +template +flat_set(sorted_unique_t, initializer_list il, + const key_compare& comp, const Allocator& a); // (28) C++23 +``` +* initializer_list[link /reference/initializer_list/initializer_list.md] +* from_range_t[link ../../ranges/from_range_t.md] +* sorted_unique_t[link ../sorted_unique_t.md] +* forward[link ../../utility/forward.md] +* insert[link insert.md] +* insert_range[link insert_range.md] + + +## 概要 +`flat_set`オブジェクトを次に示す通りの要素で初期化する。 + + +## 効果 +- (1) : デフォルトコンストラクタ。デフォルトの `key_compare` を作成し、要素を持たない空の `flat_set` オブジェクトを構築する。 +- (2) : `key_compare` を受け取り、要素を持たない空の `flat_set` オブジェクトを構築する。 +- (3) : アロケータを受け取り、要素を持たない空の `flat_set` オブジェクトを構築する。 +- (4) : `key_compare` とアロケータを受け取り、要素を持たない空の `flat_set` オブジェクトを構築する。 +- (5) : アロケータを受け取り、`flat_set` オブジェクトをコピー構築する。 +- (6) : アロケータを受け取り、`flat_set` オブジェクトをムーブ構築する。 +- (7) : `container_type` から `flat_set` オブジェクトを構築する。構築に際し、`value_compare` に基づきソートされ、また、Key が重複している要素は削除される。 +- (8) : アロケータを受け取り、`container_type` から `flat_set` オブジェクトを構築する。構築に際し、`value_compare` に基づきソートされ、また、Key が重複している要素は削除される。 +- (9) : `key_compare` とアロケータを受け取り、`container_type` から `flat_set` オブジェクトを構築する。構築に際し、`value_compare` に基づきソートされ、また、Key が重複している要素は削除される。 +- (10) : `container_type`(ソート済み且つ重複なし)から `flat_set` オブジェクトを構築する。 +- (11) : アロケータを受け取り、`container_type`(ソート済み且つ重複なし)から `flat_set` オブジェクトを構築する。 +- (12) : `key_compare` とアロケータを受け取り、`container_type`(ソート済み且つ重複なし)から `flat_set` オブジェクトを構築する。 +- (13) : イテレータから `flat_set` オブジェクトを構築する。構築には [`insert()`](insert.md) が用いられる。 +- (14) : アロケータを受け取り、イテレータから `flat_set` オブジェクトを構築する。構築には [`insert()`](insert.md) が用いられる。 +- (15) : `key_compare` とアロケータを受け取り、イテレータから `flat_set` オブジェクトを構築する。構築には [`insert()`](insert.md) が用いられる。 +- (16) : イテレータ(ソート済み且つ重複なし)から `flat_set` オブジェクトを構築する。 +- (17) : アロケータを受け取り、イテレータ(ソート済み且つ重複なし)から `flat_set` オブジェクトを構築する。 +- (18) : `key_compare` とアロケータを受け取り、イテレータ(ソート済み且つ重複なし)から `flat_set` オブジェクトを構築する。 +- (19) : Rangeから `flat_set` オブジェクトを構築する。構築には [`insert_range()`](insert_range.md) が用いられる。 +- (20) : `key_compare` を受け取り、Rangeから `flat_set` オブジェクトを構築する。構築には [`insert_range()`](insert_range.md) が用いられる。 +- (21) : アロケータを受け取り、Rangeから `flat_set` オブジェクトを構築する。構築には [`insert_range()`](insert_range.md) が用いられる。 +- (22) : `key_compare` とアロケータを受け取り、Rangeから `flat_set` オブジェクトを構築する。構築には [`insert_range()`](insert_range.md) が用いられる。 +- (23) : initializer_listから `flat_set` オブジェクトを構築する。構築には [`insert()`](insert.md) が用いられる。 +- (24) : アロケータを受け取り、initializer_listから `flat_set` オブジェクトを構築する。構築には [`insert()`](insert.md) が用いられる。 +- (25) : `key_compare` とアロケータを受け取り、initializer_listから `flat_set` オブジェクトを構築する。構築には [`insert()`](insert.md) が用いられる。 +- (26) : initializer_list(ソート済み且つ重複なし)から `flat_set` オブジェクトを構築する。 +- (27) : アロケータを受け取り、initializer_list(ソート済み且つ重複なし)から `flat_set` オブジェクトを構築する。 +- (28) : `key_compare` とアロケータを受け取り、initializer_list(ソート済み且つ重複なし)から `flat_set` オブジェクトを構築する。 + + +## 計算量 +- (1)-(4) : 定数時間。 +- (5) : 引数 `x` のサイズに対して線形時間。 +- (6) : 引数 `x` の `container_type` をムーブした計算量と同じ。 +- (7)-(9) : 引数 `cont` のサイズを `N` とすると、`cont` がソート済みなら `N` に対して線形時間。そうでなければ `N log(N)`。 +- (10)-(12) : 引数 `cont` をムーブした計算量と同じ。 +- (13)-(15) : 引数 `first` と `last` の距離を `N` とすると、イテレータの値が `value_compare` に基づきソート済みなら `N` に対して線形時間。そうでなければ `N log(N)`。 +- (16)-(18) : 引数 `first` と `last` の距離を `N` とすると、`N` に対して線形時間。 +- (19)-(22) : [`ranges::distance`](../../iterator/ranges_distance.md)`(rg)` を `N` とすると、要素の値が `value_compare` に基づきソート済みなら `N` に対して線形時間。そうでなければ `N log(N)`。 +- (23)-(25) : 引数 `il` のサイズを `N` とすると、イテレータの値が `value_compare` に基づきソート済みなら `N` に対して線形時間。そうでなければ `N log(N)`。 +- (26)-(28) : 引数 `il` のサイズを `N` とすると、`N` に対して線形時間。 + + +## 備考 +- 通常の(アロケータを指定しない)コピーコンストラクタとムーブコンストラクタは自動生成される。 +- (7)-(9), (13)-(15), (23)-(25) において、Key が重複している要素は削除されるが、どの要素が削除されるかは定められていない。 +- (3)-(6), (8), (9), (11), (12), (14), (15), (17), (18), (21), (22), (24), (25), (27), (28) は引数としてアロケータを受け取るが、引数のアロケータに対して [`uses_allocator`](uses_allocator.md) が `false` であれば、この引数は無視される。 + + +## 例 +```cpp example +#include +#include +#include +#include + +void print(const std::flat_set& fs) +{ + std::cout << "{" << std::endl; + for (const auto& k: fs) { + std::cout << " " << k << "," << std::endl; + } + std::cout << "}" << std::endl; +} + +int main() +{ + std::cout << "(1)" << std::endl; + { + std::flat_set fs; + print(fs); + } + std::cout << std::endl; + + std::cout << "(5)" << std::endl; + { + std::vector strs = {"Alice", "Bob", "Carol"}; + + std::flat_set fs(strs); + print(fs); + } + std::cout << std::endl; + + std::cout << "(23)" << std::endl; + { + std::initializer_list elems = {"Alice", "Bob", "Carol"}; + + std::flat_set fs(elems); + print(fs); + } + std::cout << std::endl; +} +``` + +### 出力 +``` +(1) +{ +} + +(5) +{ + Alice, + Bob, + Carol, +} + +(23) +{ + Alice, + Bob, + Carol, +} +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|---------------------------------------|--------------------------------------------| +| [`uses_allocator`](uses_allocator.md) | 指定されたアロケータと合致するかをチェックする | diff --git a/reference/flat_set/flat_set/op_equal.md b/reference/flat_set/flat_set/op_equal.md new file mode 100644 index 0000000000..4f7786a38e --- /dev/null +++ b/reference/flat_set/flat_set/op_equal.md @@ -0,0 +1,70 @@ +# operator== +* flat_set[meta header] +* std[meta namespace] +* function template[meta id-type] +* flat_set[meta class] + +```cpp +friend bool operator==(const flat_set& x, const flat_set& y); +``` + +## 概要 +`x` が `y` と等しいかどうかの判定を行う。 + + +## 戻り値 +以下と等価: + +```cpp +return equal(x.begin(), x.end(), y.begin(), y.end()); +``` +* equal[link /reference/algorithm/equal.md] +* begin()[link begin.md] +* end()[link end.md] + + +## 計算量 +[`size()`](size.md) に対して線形時間。ただし、`x`と`y`のサイズが異なる場合は定数時間。 + + +## 備考 +- この演算子により、以下の演算子が使用可能になる: + - `operator!=` + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_set fs1 = {3, 1, 4}; + + std::flat_set fs2 = {3, 1}; + + std::cout << std::boolalpha; + std::cout << (fs1 == fs1) << std::endl; + std::cout << (fs1 == fs2) << std::endl; + std::cout << (fs1 != fs1) << std::endl; + std::cout << (fs1 != fs2) << std::endl; +} +``` + +### 出力 +``` +true +false +false +true +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/flat_set/flat_set/rbegin.md b/reference/flat_set/flat_set/rbegin.md new file mode 100644 index 0000000000..7be2403e2f --- /dev/null +++ b/reference/flat_set/flat_set/rbegin.md @@ -0,0 +1,74 @@ +# rbegin +* flat_set[meta header] +* std[meta namespace] +* flat_set[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +reverse_iterator rbegin() noexcept; +const_reverse_iterator rbegin() const noexcept; +``` + +## 概要 +コンテナ内の末尾を指す逆イテレータを取得する。 + +内部的に、このコンテナは各要素をキーの値に従って下位から上位へと並べており、従って `rbegin()` は最上位のキーにあたる値を指すイテレータを返す。 +`rbegin()` は [`end()`](end.md) と同じ要素を指すわけではなく、その前の要素を指すことに注意。 + + +## 戻り値 +反転したシーケンスの先頭を指す逆イテレータ。 +`reverse_iterator` と `const_reverse_iterator` はともにメンバ型である。このクラステンプレートにおいて、これらは逆ランダムアクセスイテレータであり、それぞれ `reverse_iterator`, `reverse_iterator` と定義される。 + + +## 計算量 +定数時間。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_set fs = {3, 1, 4}; + + for (auto i = fs.rbegin(); i != fs.rend(); ++i) { + std::cout << *i << std::endl; + } +} +``` +* rbegin()[color ff0000] +* fs.rend()[link rend.md] + +### 出力 +``` +4 +3 +1 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|-----------------------------------|-----------------------------| +| [`flat_set::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`flat_set::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`flat_set::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`flat_set::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`flat_set::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | +| [`flat_set::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | +| [`flat_set::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + diff --git a/reference/flat_set/flat_set/rend.md b/reference/flat_set/flat_set/rend.md new file mode 100644 index 0000000000..5980906ec8 --- /dev/null +++ b/reference/flat_set/flat_set/rend.md @@ -0,0 +1,66 @@ +# rend +* flat_set[meta header] +* std[meta namespace] +* flat_set[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +reverse_iterator rend() noexcept; +const_reverse_iterator rend() const noexcept; +``` + +## 概要 +コンテナの先頭要素の前(これは反転シーケンスの末尾にあたる)を指す逆イテレータを取得する。 +`rend()` は [`begin()`](begin.md) と同じ要素を指すわけではなく、その前の要素を指すことに注意。 + +## 戻り値 +反転シーケンスの終端を指す逆イテレータ。 +`reverse_iterator` と `const_reverse_iterator` はメンバ型である。このクラステンプレートにおいて、これらは逆ランダムアクセスイテレータであり、それぞれ `reverse_iterator`, `reverse_iterator` と定義される。 + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_set fs = {3, 1, 4}; + + for (auto i = fs.rbegin(); i != fs.rend(); ++i) { + std::cout << *i << std::endl; + } +} +``` +* rend()[color ff0000] +* fs.rbegin()[link rbegin.md] + +### 出力 +``` +4 +3 +1 +``` + +## バージョン +### 言語 +- C++23 + + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|-----------------------------------|-----------------------------| +| [`flat_set::begin`](begin.md) | 先頭を指すイテレータを取得する | +| [`flat_set::end`](end.md) | 末尾の次を指すイテレータを取得する | +| [`flat_set::cbegin`](cbegin.md) | 先頭を指すconstイテレータを取得する | +| [`flat_set::cend`](cend.md) | 末尾の次を指すconstイテレータを取得する | +| [`flat_set::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | +| [`flat_set::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | +| [`flat_set::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | diff --git a/reference/flat_set/flat_set/replace.md b/reference/flat_set/flat_set/replace.md new file mode 100644 index 0000000000..6f992f9135 --- /dev/null +++ b/reference/flat_set/flat_set/replace.md @@ -0,0 +1,93 @@ +# replace +* flat_set[meta header] +* std[meta namespace] +* flat_set[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +void replace(container_type&& cont); // C++23 +``` + +## 概要 +値のコンテナを置き換える。 + + +## 効果 +`flat_set` クラスが内部で保持している `container_type` を `c` とすると、以下と等価。 + ```cpp + c = std::move(cont); + ``` + * std::move[link /reference/utility/move.md] + + +## 事前条件 +- `cont` が `key_compare` に基づいてソートされていること。 +- `cont` に重複する要素がないこと。 + + +## 計算量 +`cont` をムーブした計算量と同じ。 + + +## 例 +```cpp example +#include +#include +#include +#include +#include +#include + +int main() +{ + std::vector keys = {"Alice", "Bob", "Carol"}; + + // 事前条件の確認 + assert(std::is_sorted(keys.begin(), keys.end())); + assert(std::adjacent_find(keys.begin(), keys.end()) == keys.end()); + + std::flat_set fs; + + std::cout << fs.size() << std::endl; + + fs.replace(std::move(keys)); + + std::cout << fs.size() << std::endl; + std::cout << std::endl; + + std::cout << "{" << std::endl; + for (const std::string& i: fs) { + std::cout << " " << i << "," << std::endl; + } + std::cout << "}" << std::endl; +} +``` +* replace[color ff0000] +* fs.size()[link size.md] +* std::is_sorted[link /reference/algorithm/is_sorted.md] +* std::adjacent_find[link /reference/algorithm/adjacent_find.md] +* std::move[link /reference/utility/move.md] + +### 出力 +``` +0 +3 + +{ + Alice, + Bob, + Carol, +} +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/flat_set/flat_set/size.md b/reference/flat_set/flat_set/size.md new file mode 100644 index 0000000000..43cd684b59 --- /dev/null +++ b/reference/flat_set/flat_set/size.md @@ -0,0 +1,69 @@ +# size +* flat_set[meta header] +* std[meta namespace] +* flat_set[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +size_type size() const noexcept; +``` + +## 概要 +コンテナ内の要素の数を返す。 + + +## 戻り値 +`flat_set` クラスが内部で保持している `container_type` を `c` とすると、以下を返す。 + +```cpp +return c.size(); +``` +* size()[link /reference/vector/vector/size.md] + + +## 計算量 +定数時間。 + + +## 例 +```cpp example +#include +#include + +int main () +{ + std::flat_set fs; + + std::cout << fs.size() << std::endl; + + fs.insert(1); + fs.insert(2); + fs.insert(3); + fs.insert(1); + + std::cout << fs.size() << std::endl; +} +``` +* size()[color ff0000] +* fs.insert[link insert.md] + +### 出力 +``` +0 +3 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`empty()`](empty.md) diff --git a/reference/flat_set/flat_set/swap.md b/reference/flat_set/flat_set/swap.md new file mode 100644 index 0000000000..c0971d90f6 --- /dev/null +++ b/reference/flat_set/flat_set/swap.md @@ -0,0 +1,75 @@ +# swap +* flat_set[meta header] +* std[meta namespace] +* flat_set[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +void swap(flat_set& y) noexcept; // (1) C++23 +``` + +## 概要 +コンテナ内のコンテンツを、同じ型の要素を保持する他の `flat_sest` オブジェクトである `y` 内のコンテンツと交換する。 + +このメンバ関数の呼び出しの後、呼び出し前にコンテナ内にあった要素は `y` へ、`y` 内にあった要素は `*this` へ移る。 + + +## 計算量 +定数時間。 + + +## 例 +```cpp example +#include +#include + +template +void print(const char* name, const Set& s) +{ + std::cout << name << " : {"; + + bool first = true; + + for (const auto& x : s) { + if (first) { + first = false; + } + else { + std::cout << ", "; + } + std::cout << x; + } + std::cout << "}" << std::endl; +} + +int main() +{ + std::flat_set fs1 = {10, 20, 30}; + + std::flat_set fs2 = {5, 15}; + + // fs1とfs2を入れ替える + fs1.swap(fs2); + + print("fs1", fs1); + print("fs2", fs2); +} +``` +* swap[color ff0000] + +### 出力 +``` +fs1 : {5, 15} +fs2 : {10, 20, 30} +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/flat_set/flat_set/upper_bound.md b/reference/flat_set/flat_set/upper_bound.md new file mode 100644 index 0000000000..aaac5c6f4e --- /dev/null +++ b/reference/flat_set/flat_set/upper_bound.md @@ -0,0 +1,121 @@ +# upper_bound +* flat_set[meta header] +* std[meta namespace] +* flat_set[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +iterator upper_bound(const key_type& x); // (1) C++23 + +template +iterator upper_bound(const K& x); // (2) C++23 + +const_iterator upper_bound(const key_type& x) const; // (3) C++23 + +template +const_iterator upper_bound(const K& x) const; // (4) C++23 +``` + +## 概要 +`x` より大きいキーを持つコンテナ内の最初の要素を指すイテレータを返す(コンテナの比較オブジェクトを使う)。 + +[`lower_bound()`](lower_bound.md) と異なり、このメンバ関数は `x` と等しいときは要素へのイテレータを返さず、それは大きい場合にのみ要素へのイテレータを返す。 + +内部的に、`flat_set` コンテナ内の全ての要素は常に比較オブジェクトで定義された基準に従って並ぶため、この関数が返す値に続く全ての要素は `x` より大きいことに注意。 + +- (1) : `key_type`型のキーを受け取り、そのキーより大きい最初の要素へのイテレータを取得する。 +- (2) : `key_type`と比較可能な`K`型のキーを受け取り、そのキーより大きい最初の要素へのイテレータを取得する。 +- (3) : `const`な`*this`オブジェクトにおいて、`key_type`型のキーを受け取り、そのキーより大きい最初の要素へのイテレータを取得する。 +- (4) : `const`な`*this`オブジェクトにおいて、`key_type`と比較可能な`K`型のキーを受け取り、そのキーより大きい最初の要素へのイテレータを取得する。 + + +## 戻り値 +- (1), (3) : キー`x`より大きい最初の要素へのイテレータを返す。そのような要素がない場合は、[`end()`](end.md)を返す。 +- (2), (4) : `key_compare`型の関数オブジェクトを`c`、コンテナ内の各要素が持つキーを`k`として、キーが小さくないか判定する式`c(x, k)`が`true`となる要素へのイテレータを返す。そのような要素がない場合は、[`end()`](end.md) を返す。 + + +## 計算量 +[`size()`](size.md) について対数時間。 + + +## 備考 +- (2), (4) : この関数がオーバーロード解決に参加する条件は、[`find()`](find.md)メンバ関数の備考欄を参照。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + // (1) + { + std::flat_set fs = { + "Alice", "Bob", "Carol", "David" + }; + + // Bob以上David以下の範囲を取得 + decltype(fs)::iterator it = fs.lower_bound("Bob"); + decltype(fs)::iterator last = fs.upper_bound("David"); + + while (it != last) { + std::cout << *it << std::endl; + ++it; + } + } + + std::cout << std::endl; + + // (2) + { + std::flat_set> fs = { + "Alice", "Bob", "Carol", "David" + }; + + // std::lessのvoidに対する特殊化を使用することで、 + // 文字列リテラルをlower_bound()関数の引数として渡した際に、 + // std::string型の一時オブジェクトが生成されない。 + decltype(fs)::iterator it = fs.lower_bound("Bob"); + decltype(fs)::iterator last = fs.upper_bound("David"); + + while (it != last) { + std::cout << *it << std::endl; + ++it; + } + } +} +``` +* upper_bound[color ff0000] +* fs.lower_bound[link lower_bound.md] +* std::less[link /reference/functional/less.md] + +### 出力 +``` +Bob +Carol +David + +Bob +Carol +David +``` + + +## バージョン +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------------------|----------------------------------------------------------| +| [`flat_set::lower_bound`](lower_bound.md) | 指定した値よりも小さくない最初の要素へのイテレータを返す | +| [`flat_set::equal_range`](equal_range.md) | 指定したキーにマッチする要素範囲を返す | +| [`flat_set::find`](find.md) | 指定したキーで要素を探す | +| [`flat_set::count`](count.md) | 指定したキーにマッチする要素の数を返す | diff --git a/reference/flat_set/flat_set/uses_allocator.md b/reference/flat_set/flat_set/uses_allocator.md new file mode 100644 index 0000000000..582575ff3f --- /dev/null +++ b/reference/flat_set/flat_set/uses_allocator.md @@ -0,0 +1,55 @@ +# uses_allocator +* flat_set[meta header] +* std[meta namespace] +* class template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template + struct uses_allocator, + Alloc> + : bool_constant> { }; +} +``` +* bool_constant[link /reference/type_traits/bool_constant.md] + +## 概要 +`uses_allocator`の、`flat_set`に対する特殊化。 + +アロケータを指定する`flat_set`の[`コンストラクタ`](op_constructor.md)において、指定されたアロケータと、`KeyContainer`のアロケータが合致するかをチェックするのに使われる。 + + +## 例 +```cpp +#include +#include + +int main() +{ + using fs_t = std::flat_set; + + std::cout << std::uses_allocator>::value << std::endl; +} +``` +* std::uses_allocator[color ff0000] +* std::allocator[link /reference/memory/allocator.md] + +### 出力 +```cpp +1 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 diff --git a/reference/flat_set/flat_set/value_comp.md b/reference/flat_set/flat_set/value_comp.md new file mode 100644 index 0000000000..5105617921 --- /dev/null +++ b/reference/flat_set/flat_set/value_comp.md @@ -0,0 +1,65 @@ +# value_comp +* flat_set[meta header] +* std[meta namespace] +* flat_set[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +value_compare value_comp() const; // C++23 +``` + + +## 概要 +コンテナに関連づけられた要素比較用の関数オブジェクトを返す。これはコンテナ内の二つの要素を比較するために利用できる。 +これは同じ型の 2 つの引数をとり、[狭義の弱順序](/reference/algorithm.md#strict-weak-ordering)に従って一つ目の引数が二つ目の引数の前になる場合に `true`、そうでない場合に `false` を返す。 + + +## 戻り値 +要素比較用の関数オブジェクト。 +`value_compare` はメンバ型であり、`key_compare` と同じく、テンプレートパラメータ `Compare` の別名である。 + + +## 計算量 +定数時間。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_set s; + std::flat_set::value_compare comp = s.value_comp(); + + std::cout << comp(1, 2) << std::endl; + std::cout << comp(3, 2) << std::endl; +} +``` +* value_comp()[color ff0000] + +### 出力 +``` +1 +0 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------------|----------------------------------------------------------| +| [`key_comp`](key_comp.md) | キー比較用の関数オブジェクトを取得する | diff --git a/reference/flat_set/sorted_equivalent_t.md b/reference/flat_set/sorted_equivalent_t.md new file mode 100644 index 0000000000..17b8ff068c --- /dev/null +++ b/reference/flat_set/sorted_equivalent_t.md @@ -0,0 +1,64 @@ +# sorted_equivalent_t +* flat_set[meta header] +* std[meta namespace] +* class[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + struct sorted_equivalent_t { explicit sorted_equivalent_t() = default; }; + inline constexpr sorted_equivalent_t sorted_equivalent{}; +} +``` + +## 概要 +`sorted_equivalent_t`は、[`flat_multiset`](flat_multiset.md)コンテナに挿入するシーケンスがソート済みであること(重複は許可される)を示すためのタグ型および値である。 + +このクラス自体は空であり、オーバーロード解決のためにのみ使用される。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_multiset fs = {3}; + + std::flat_multiset fs2 = {5, 15}; + + // 挿入するシーケンスがソート済みであることがわかっている場合、 + // sorted_equivalentを指定した方が高速になる + fs.insert(std::sorted_equivalent, fs2.begin(), fs2.end()); + + for (int i : fs) { + std::cout << i << std::endl; + } +} +``` +* std::sorted_equivalent[color ff0000] +* insert[link flat_multiset/insert.md] +* begin()[link flat_multiset/begin.md] +* end()[link flat_multiset/end.md] + +### 出力 +``` +3 +5 +15 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`std::flat_multiset`](flat_multiset.md) + diff --git a/reference/flat_set/sorted_unique_t.md b/reference/flat_set/sorted_unique_t.md new file mode 100644 index 0000000000..70cea5a3a9 --- /dev/null +++ b/reference/flat_set/sorted_unique_t.md @@ -0,0 +1,64 @@ +# sorted_unique_t +* flat_set[meta header] +* std[meta namespace] +* class[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + struct sorted_unique_t { explicit sorted_unique_t() = default; }; + inline constexpr sorted_unique_t sorted_unique{}; +} +``` + +## 概要 +`sorted_unique_t`は、[`flat_set`](flat_set.md)コンテナに挿入するシーケンスがソート済みかつ重複要素がないことを示すためのタグ型および値である。 + +このクラス自体は空であり、オーバーロード解決のためにのみ使用される。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::flat_set fs = {3}; + + std::flat_set fs2 = {5, 15}; + + // 挿入するシーケンスがソート済みかつ重複要素がないことがわかっている場合、 + // sorted_uniqueを指定した方が高速になる + fs.insert(std::sorted_unique, fs2.begin(), fs2.end()); + + for (int i : fs) { + std::cout << i << std::endl; + } +} +``` +* std::sorted_unique[color ff0000] +* insert[link flat_set/insert.md] +* begin()[link flat_set/begin.md] +* end()[link flat_set/end.md] + +### 出力 +``` +3 +5 +15 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`std::flat_set`](flat_set.md) + diff --git a/reference/format/format.md b/reference/format/format.md index a26f023b66..45fbbdb7ed 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -559,7 +559,7 @@ int main() * std::stack[link /reference/stack/stack.md] * st.push[link /reference/stack/stack/push.md] * std::flat_map[link /reference/flat_map/flat_map.md] -* std::flat_set[link /reference/flat_map/flat_set.md.nolink] +* std::flat_set[link /reference/flat_map/flat_set.md] #### 出力 ``` diff --git a/reference/format/range-default-formatter.md b/reference/format/range-default-formatter.md index 45f154b179..5b6a59c4f2 100644 --- a/reference/format/range-default-formatter.md +++ b/reference/format/range-default-formatter.md @@ -41,7 +41,7 @@ namespace std { - (1) : プライマリテンプレート。宣言のみ - (2) : Range・シーケンスコンテナに対する特殊化。デバッグ出力の有効化と、`[a, b, c]`形式の出力を行う - (3) : [`std::map`](/reference/map/map.md)や[`std::flat_map`](/reference/flat_map/flat_map.md)などの連想コンテナに対する特殊化。デバッグ出力の有効化と、`{1: a, 2: b}`形式での出力を行う -- (4) : [`std::set`](/reference/set/set.md)や[`std::flat_set`](/reference/flat_set/flat_set.md.nolink)などの集合コンテナに対する特殊化。デバッグ出力の有効化と、`{a, b, c}`形式の出力を行う +- (4) : [`std::set`](/reference/set/set.md)や[`std::flat_set`](/reference/flat_set/flat_set.md)などの集合コンテナに対する特殊化。デバッグ出力の有効化と、`{a, b, c}`形式の出力を行う - (5) : 文字列形式の出力を行うRangeに対する特殊化。Rangeを文字列として出力し、[`range_format::debug_string`](range_format.md)指定であればデバッグ文字列として出力する diff --git a/reference/format/range_format.md b/reference/format/range_format.md index 799c4d1f09..3342d6f78d 100644 --- a/reference/format/range_format.md +++ b/reference/format/range_format.md @@ -25,7 +25,7 @@ Rangeの書式種別を表す列挙型。 |----------------|------| | `disabled` | 書式化ができないRangeであることを表す値 | | `map` | [`std::map`](/reference/map/map.md)や[`std::flat_map`](/reference/flat_map/flat_map.md)向けの書式。`{k1: v1, k2: v2}` | -| `set` | [`std::set`](/reference/set/set.md)や[`std::flat_set`](/reference/flat_set/flat_set.md.nolink)向けの書式。`{v1, v2}` | +| `set` | [`std::set`](/reference/set/set.md)や[`std::flat_set`](/reference/flat_set/flat_set.md)向けの書式。`{v1, v2}` | | `sequence` | [`std::vector`](/reference/vector/vector.md)や[`std::array`](/reference/array/array.md)向けの書式。`[v1, v2]`| | `string` | 文字列向けの書式。`abc` | | `debug_string` | デバッグ文字列向けの書式。`\nabc` | From 8f81c3172231df1f3969650e403249663742925b Mon Sep 17 00:00:00 2001 From: suomesta Date: Fri, 7 Feb 2025 02:21:51 +0900 Subject: [PATCH 1429/3948] fix wrong header tag (#1079) --- reference/flat_set/flat_multiset.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/flat_set/flat_multiset.md b/reference/flat_set/flat_multiset.md index c46cd944ea..37f2ee4766 100644 --- a/reference/flat_set/flat_multiset.md +++ b/reference/flat_set/flat_multiset.md @@ -1,5 +1,5 @@ # flat_multiset -* flat_multiset[meta header] +* flat_set[meta header] * std[meta namespace] * class template[meta id-type] * cpp23[meta cpp] From 871cb81f4ebed45968025168f0a1eec058c12d57 Mon Sep 17 00:00:00 2001 From: suomesta Date: Fri, 7 Feb 2025 02:43:01 +0900 Subject: [PATCH 1430/3948] fix wrong inner links (#1079) --- reference/flat_set/flat_set/insert.md | 4 ++-- reference/format/format.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/flat_set/flat_set/insert.md b/reference/flat_set/flat_set/insert.md index ef79a30b33..02134d89c0 100644 --- a/reference/flat_set/flat_set/insert.md +++ b/reference/flat_set/flat_set/insert.md @@ -37,7 +37,7 @@ void insert(sorted_unique_t s, ``` * pair[link /reference/utility/pair.md] * initializer_list[link /reference/initializer_list/initializer_list.md] -* sorted_unique_t[link /reference/flat_set_/sorted_unique_t.md] +* sorted_unique_t[link /reference/flat_set/sorted_unique_t.md] ## 概要 新しく一つの要素(引数 `x` を使う)または要素のシーケンス(入力イテレータまたは `initializer_list` を使う)を挿入し、コンテナを拡張する。 @@ -48,7 +48,7 @@ void insert(sorted_unique_t s, 重複した値を許す、類似したコンテナについては [`flat_multiset`](/reference/flat_set/flat_multiset.md) を参照。 -内部的に `flat_set_` コンテナは、コンストラクト時に指定された比較オブジェクトによって要素を下位から上位へとソートして保持する。 +内部的に `flat_set` コンテナは、コンストラクト時に指定された比較オブジェクトによって要素を下位から上位へとソートして保持する。 この操作は、適切な引数 `position` を提供することで効率を飛躍的に改善することができる。 diff --git a/reference/format/format.md b/reference/format/format.md index 45fbbdb7ed..9616f8b790 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -559,7 +559,7 @@ int main() * std::stack[link /reference/stack/stack.md] * st.push[link /reference/stack/stack/push.md] * std::flat_map[link /reference/flat_map/flat_map.md] -* std::flat_set[link /reference/flat_map/flat_set.md] +* std::flat_set[link /reference/flat_set/flat_set.md] #### 出力 ``` From 0b23a699f2e5124b87fed4149a57a704b56c7a65 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sat, 8 Feb 2025 13:19:34 +0900 Subject: [PATCH 1431/3948] fix namespace std::get for std::tuple --- reference/tuple/tuple/get.md | 1 - 1 file changed, 1 deletion(-) diff --git a/reference/tuple/tuple/get.md b/reference/tuple/tuple/get.md index a8dd8b86c6..1b47353823 100644 --- a/reference/tuple/tuple/get.md +++ b/reference/tuple/tuple/get.md @@ -1,7 +1,6 @@ # get * tuple[meta header] * std[meta namespace] -* tuple[meta class] * function template[meta id-type] * cpp11[meta cpp] From a7d155c2f7159e38a76b57d3efca55f83fe41323 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sat, 8 Feb 2025 13:22:12 +0900 Subject: [PATCH 1432/3948] fix return value type in sample --- reference/complex/complex/arg.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/complex/complex/arg.md b/reference/complex/complex/arg.md index 7a52d63920..2118ca5e71 100644 --- a/reference/complex/complex/arg.md +++ b/reference/complex/complex/arg.md @@ -56,7 +56,7 @@ int main() { std::complex c(1.0, 2.0); - std::complex result = std::arg(c); + double result = std::arg(c); std::cout << "arg( " << c << " ) = " << result << std::endl; } ``` From 85e901d81bcd0b414638458b654d72a0f3137238 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sat, 8 Feb 2025 13:27:03 +0900 Subject: [PATCH 1433/3948] add to GLOBAL_QUALIFY_LIST --- GLOBAL_QUALIFY_LIST.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index b7cd39e05f..e86ce2b441 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -102,6 +102,7 @@ * std::int64_t[link /reference/cstdint/int64_t.md] * [link /reference/cstdio.md] * [link /reference/cstdlib.md] +* [link /reference/cstring.md] * [link /reference/ctime.md] * [link /reference/debugging.md] * [link /reference/deque/deque.md] From 6972631ca28717ad2359d6da1ddfbe1697423866 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sat, 8 Feb 2025 13:49:58 +0900 Subject: [PATCH 1434/3948] some small improvements in flat_map and flat_set --- reference/flat_map/flat_map/cbegin.md | 2 +- reference/flat_map/flat_map/cend.md | 2 +- reference/flat_map/flat_map/erase.md | 3 +++ reference/flat_map/flat_map/swap.md | 1 + reference/flat_map/flat_multimap/cbegin.md | 2 +- reference/flat_map/flat_multimap/cend.md | 2 +- reference/flat_map/flat_multimap/erase.md | 3 +++ reference/flat_map/flat_multimap/replace.md | 2 -- reference/flat_map/flat_multimap/swap.md | 1 + reference/flat_map/sorted_equivalent_t.md | 3 +++ reference/flat_map/sorted_unique_t.md | 3 +++ reference/flat_set/flat_multiset/replace.md | 2 -- 12 files changed, 18 insertions(+), 8 deletions(-) diff --git a/reference/flat_map/flat_map/cbegin.md b/reference/flat_map/flat_map/cbegin.md index 62057823d9..a463d234ba 100644 --- a/reference/flat_map/flat_map/cbegin.md +++ b/reference/flat_map/flat_map/cbegin.md @@ -18,7 +18,7 @@ const_iterator cbegin() const noexcept; ## 戻り値 コンテナの先頭要素へのイテレータ。 -`const_iterator` はメンバ型である。このクラステンプレートにおいて、これらはランダムアクセスイテレータである。 +`const_iterator` はメンバ型である。このクラステンプレートにおいて、この型はランダムアクセスイテレータである。 ## 計算量 diff --git a/reference/flat_map/flat_map/cend.md b/reference/flat_map/flat_map/cend.md index ff0377cb5e..7488d4b33d 100644 --- a/reference/flat_map/flat_map/cend.md +++ b/reference/flat_map/flat_map/cend.md @@ -15,7 +15,7 @@ const_iterator cend() const noexcept; ## 戻り値 コンテナの末尾の次を参照するイテレータ。 -`const_iterator` はいずれもメンバ型である。このクラステンプレートにおいて、これらはランダムアクセスイテレータである。 +`const_iterator` はメンバ型である。このクラステンプレートにおいて、この型はランダムアクセスイテレータである。 ## 計算量 diff --git a/reference/flat_map/flat_map/erase.md b/reference/flat_map/flat_map/erase.md index 263666493b..021cd76687 100644 --- a/reference/flat_map/flat_map/erase.md +++ b/reference/flat_map/flat_map/erase.md @@ -118,6 +118,9 @@ int main() } } ``` +* erase[color ff0000] +* fm.begin()[link begin.md] +* fm.end()[link end.md] #### 出力 ``` diff --git a/reference/flat_map/flat_map/swap.md b/reference/flat_map/flat_map/swap.md index 8f483eb1e9..0abf4f15c5 100644 --- a/reference/flat_map/flat_map/swap.md +++ b/reference/flat_map/flat_map/swap.md @@ -63,6 +63,7 @@ int main() print("fm2", fm2); } ``` +* swap[color ff0000] ### 出力 ``` diff --git a/reference/flat_map/flat_multimap/cbegin.md b/reference/flat_map/flat_multimap/cbegin.md index b30069266a..2737ef889a 100644 --- a/reference/flat_map/flat_multimap/cbegin.md +++ b/reference/flat_map/flat_multimap/cbegin.md @@ -18,7 +18,7 @@ const_iterator cbegin() const noexcept; ## 戻り値 コンテナの先頭要素へのイテレータ。 -`const_iterator` はメンバ型である。このクラステンプレートにおいて、これらはランダムアクセスイテレータである。 +`const_iterator` はメンバ型である。このクラステンプレートにおいて、この型はランダムアクセスイテレータである。 ## 計算量 diff --git a/reference/flat_map/flat_multimap/cend.md b/reference/flat_map/flat_multimap/cend.md index 0936acea6f..d3ec1c40ae 100644 --- a/reference/flat_map/flat_multimap/cend.md +++ b/reference/flat_map/flat_multimap/cend.md @@ -15,7 +15,7 @@ const_iterator cend() const noexcept; ## 戻り値 コンテナの末尾の次を参照するイテレータ。 -`const_iterator` はいずれもメンバ型である。このクラステンプレートにおいて、これらはランダムアクセスイテレータである。 +`const_iterator` はメンバ型である。このクラステンプレートにおいて、この型はランダムアクセスイテレータである。 ## 計算量 diff --git a/reference/flat_map/flat_multimap/erase.md b/reference/flat_map/flat_multimap/erase.md index b40d206152..0ca562866e 100644 --- a/reference/flat_map/flat_multimap/erase.md +++ b/reference/flat_map/flat_multimap/erase.md @@ -118,6 +118,9 @@ int main() } } ``` +* erase[color ff0000] +* fm.begin()[link begin.md] +* fm.end()[link end.md] #### 出力 ``` diff --git a/reference/flat_map/flat_multimap/replace.md b/reference/flat_map/flat_multimap/replace.md index 8f08b3f028..48b5889d81 100644 --- a/reference/flat_map/flat_multimap/replace.md +++ b/reference/flat_map/flat_multimap/replace.md @@ -47,7 +47,6 @@ int main() // 事前条件の確認 assert(keys.size() == values.size()); assert(std::is_sorted(keys.begin(), keys.end())); - assert(std::adjacent_find(keys.begin(), keys.end()) == keys.end()); std::flat_multimap fm; @@ -68,7 +67,6 @@ int main() * replace[color ff0000] * fm.size()[link size.md] * std::is_sorted[link /reference/algorithm/is_sorted.md] -* std::adjacent_find[link /reference/algorithm/adjacent_find.md] ### 出力 ``` diff --git a/reference/flat_map/flat_multimap/swap.md b/reference/flat_map/flat_multimap/swap.md index f985066b39..319cdb9eca 100644 --- a/reference/flat_map/flat_multimap/swap.md +++ b/reference/flat_map/flat_multimap/swap.md @@ -63,6 +63,7 @@ int main() print("fm2", fm2); } ``` +* swap[color ff0000] ### 出力 ``` diff --git a/reference/flat_map/sorted_equivalent_t.md b/reference/flat_map/sorted_equivalent_t.md index 33ff9b30bb..7fe82d1d8f 100644 --- a/reference/flat_map/sorted_equivalent_t.md +++ b/reference/flat_map/sorted_equivalent_t.md @@ -49,6 +49,9 @@ int main() ### 出力 ``` +3 : a +5 : d +15 : e ``` ## バージョン diff --git a/reference/flat_map/sorted_unique_t.md b/reference/flat_map/sorted_unique_t.md index 67d6e68962..0c89b5cccc 100644 --- a/reference/flat_map/sorted_unique_t.md +++ b/reference/flat_map/sorted_unique_t.md @@ -49,6 +49,9 @@ int main() ### 出力 ``` +3 : a +5 : d +15 : e ``` ## バージョン diff --git a/reference/flat_set/flat_multiset/replace.md b/reference/flat_set/flat_multiset/replace.md index 656397a640..99a8f02e2b 100644 --- a/reference/flat_set/flat_multiset/replace.md +++ b/reference/flat_set/flat_multiset/replace.md @@ -44,7 +44,6 @@ int main() // 事前条件の確認 assert(std::is_sorted(keys.begin(), keys.end())); - assert(std::adjacent_find(keys.begin(), keys.end()) == keys.end()); std::flat_multiset fs; @@ -65,7 +64,6 @@ int main() * replace[color ff0000] * fs.size()[link size.md] * std::is_sorted[link /reference/algorithm/is_sorted.md] -* std::adjacent_find[link /reference/algorithm/adjacent_find.md] * std::move[link /reference/utility/move.md] ### 出力 From 51bc70d80dbb167021f00932881b96340097b29a Mon Sep 17 00:00:00 2001 From: suomesta Date: Sat, 8 Feb 2025 13:50:32 +0900 Subject: [PATCH 1435/3948] small improvements in map --- reference/map/map/cend.md | 2 +- reference/map/multimap/cend.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/map/map/cend.md b/reference/map/map/cend.md index 585cbf7329..ed267a6c03 100644 --- a/reference/map/map/cend.md +++ b/reference/map/map/cend.md @@ -15,7 +15,7 @@ const_iterator cend() const noexcept; ## 戻り値 コンテナの末尾の次を参照するイテレータ。 -`const_iterator` はいずれもメンバ型である。`map` クラステンプレートにおいて、これらは双方向イテレータである。 +`const_iterator` はメンバ型である。`map` クラステンプレートにおいて、この型は双方向イテレータである。 ## 計算量 diff --git a/reference/map/multimap/cend.md b/reference/map/multimap/cend.md index bdec05eab5..5d5447bf75 100644 --- a/reference/map/multimap/cend.md +++ b/reference/map/multimap/cend.md @@ -15,7 +15,7 @@ const_iterator cend() const noexcept; ## 戻り値 コンテナの末尾の次を参照するイテレータ。 -`const_iterator` はいずれもメンバ型である。`multimap` クラステンプレートにおいて、これらは双方向イテレータである。 +`const_iterator` はメンバ型である。`multimap` クラステンプレートにおいて、この型は双方向イテレータである。 ## 計算量 From 2a1427f3b7eb1b34faa7009063dac4dda34a2f17 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sat, 8 Feb 2025 15:26:51 +0900 Subject: [PATCH 1436/3948] fix wrong URL --- reference/flat_set.md | 2 +- reference/flat_set/flat_multiset.md | 2 +- reference/flat_set/flat_set.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/flat_set.md b/reference/flat_set.md index 75baddd3a6..d143478966 100644 --- a/reference/flat_set.md +++ b/reference/flat_set.md @@ -30,7 +30,7 @@ ## 参照 -- [P1222R0 A Standard `flat_set`](hhttps://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1222r0.pdf) +- [P1222R0 A Standard `flat_set`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1222r0.pdf) - C++23で`flat_set`が導入された経緯・動機・設計について記載されている - [P1222R4 A Standard `flat_set`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1222r4.pdf) - C++23で導入された`flat_set`の仕様 diff --git a/reference/flat_set/flat_multiset.md b/reference/flat_set/flat_multiset.md index 37f2ee4766..db2cbe7ee9 100644 --- a/reference/flat_set/flat_multiset.md +++ b/reference/flat_set/flat_multiset.md @@ -224,7 +224,7 @@ int main() ## 参照 -- [P1222R0 A Standard `flat_set`](hhttps://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1222r0.pdf) +- [P1222R0 A Standard `flat_set`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1222r0.pdf) - C++23で`flat_set`が導入された経緯・動機・設計について記載されている - [P1222R4 A Standard `flat_set`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1222r4.pdf) - C++23で導入された`flat_set`の仕様 diff --git a/reference/flat_set/flat_set.md b/reference/flat_set/flat_set.md index b2421c9e30..3ba236cfbb 100644 --- a/reference/flat_set/flat_set.md +++ b/reference/flat_set/flat_set.md @@ -223,7 +223,7 @@ int main() ## 参照 -- [P1222R0 A Standard `flat_set`](hhttps://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1222r0.pdf) +- [P1222R0 A Standard `flat_set`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1222r0.pdf) - C++23で`flat_set`が導入された経緯・動機・設計について記載されている - [P1222R4 A Standard `flat_set`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1222r4.pdf) - C++23で導入された`flat_set`の仕様 From f28cc8b96c52276347fd3fdbc58d1d1b60bdac1b Mon Sep 17 00:00:00 2001 From: suomesta Date: Sun, 9 Feb 2025 09:02:20 +0900 Subject: [PATCH 1437/3948] add swap_free.md to flat_map (#1078) --- reference/flat_map/flat_map.md | 2 +- reference/flat_map/flat_map/swap_free.md | 83 +++++++++++++++++++ reference/flat_map/flat_multimap.md | 2 +- reference/flat_map/flat_multimap/swap_free.md | 83 +++++++++++++++++++ 4 files changed, 168 insertions(+), 2 deletions(-) create mode 100644 reference/flat_map/flat_map/swap_free.md create mode 100644 reference/flat_map/flat_multimap/swap_free.md diff --git a/reference/flat_map/flat_map.md b/reference/flat_map/flat_map.md index 49b7998c64..47eb5dfba2 100644 --- a/reference/flat_map/flat_map.md +++ b/reference/flat_map/flat_map.md @@ -142,7 +142,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`swap`](flat_map/swap_free.md.nolink) | 2つの`flat_map`オブジェクトを入れ替える | C++23 | +| [`swap`](flat_map/swap_free.md) | 2つの`flat_map`オブジェクトを入れ替える | C++23 | ## 推論補助 diff --git a/reference/flat_map/flat_map/swap_free.md b/reference/flat_map/flat_map/swap_free.md new file mode 100644 index 0000000000..8ac0a80c6c --- /dev/null +++ b/reference/flat_map/flat_map/swap_free.md @@ -0,0 +1,83 @@ +# swap (非メンバ関数) +* flat_map[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template + void swap(flat_map& x, + flat_map& y); // (1) C++23 +} +``` + +## 概要 +2つの `flat_map` オブジェクトを入れ替える。 + + +## 効果 +`x.`[`swap`](swap.md)`(y)` + + +## 例 +```cpp example +#include +#include + +template +void print(const char* name, const Map& m) +{ + std::cout << name << " : {"; + + bool first = true; + + for (const auto& x : m) { + if (first) { + first = false; + } + else { + std::cout << ", "; + } + std::cout << "[" << x.first << "," << x.second << "]"; + } + std::cout << "}" << std::endl; +} + +int main() +{ + std::flat_map fm1 = { + {10, 'a'}, + {20, 'b'}, + {30, 'c'} + }; + + std::flat_map fm2 = { + {5, 'd'}, + {15, 'e'} + }; + + // fm1とfm2を入れ替える + std::swap(fm1, fm2); + + print("fm1", fm1); + print("fm2", fm2); +} +``` +* std::swap[color ff0000] + +### 出力 +``` +fm1 : {[5,d], [15,e]} +fm2 : {[10,a], [20,b], [30,c]} +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/flat_map/flat_multimap.md b/reference/flat_map/flat_multimap.md index 8a17b79732..414944d1aa 100644 --- a/reference/flat_map/flat_multimap.md +++ b/reference/flat_map/flat_multimap.md @@ -138,7 +138,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`swap`](flat_multimap/swap_free.md.nolink) | 2つの`flat_multimap`オブジェクトを入れ替える | C++23 | +| [`swap`](flat_multimap/swap_free.md) | 2つの`flat_multimap`オブジェクトを入れ替える | C++23 | ## 推論補助 diff --git a/reference/flat_map/flat_multimap/swap_free.md b/reference/flat_map/flat_multimap/swap_free.md new file mode 100644 index 0000000000..84e6fba2d6 --- /dev/null +++ b/reference/flat_map/flat_multimap/swap_free.md @@ -0,0 +1,83 @@ +# swap (非メンバ関数) +* flat_map[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template + void swap(flat_multimap& x, + flat_multimap& y); // (1) C++23 +} +``` + +## 概要 +2つの `flat_multimap` オブジェクトを入れ替える。 + + +## 効果 +`x.`[`swap`](swap.md)`(y)` + + +## 例 +```cpp example +#include +#include + +template +void print(const char* name, const Map& m) +{ + std::cout << name << " : {"; + + bool first = true; + + for (const auto& x : m) { + if (first) { + first = false; + } + else { + std::cout << ", "; + } + std::cout << "[" << x.first << "," << x.second << "]"; + } + std::cout << "}" << std::endl; +} + +int main() +{ + std::flat_multimap fm1 = { + {10, 'a'}, + {20, 'b'}, + {30, 'c'} + }; + + std::flat_multimap fm2 = { + {5, 'd'}, + {15, 'e'} + }; + + // fm1とfm2を入れ替える + std::swap(fm1, fm2); + + print("fm1", fm1); + print("fm2", fm2); +} +``` +* std::swap[color ff0000] + +### 出力 +``` +fm1 : {[5,d], [15,e]} +fm2 : {[10,a], [20,b], [30,c]} +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? From 304f099f24e1aa8d5d8116d9cc34c930570d44fd Mon Sep 17 00:00:00 2001 From: suomesta Date: Sun, 9 Feb 2025 09:02:52 +0900 Subject: [PATCH 1438/3948] add swap_free.md to flat_set (#1079) --- reference/flat_set/flat_multiset.md | 2 +- reference/flat_set/flat_multiset/swap_free.md | 76 +++++++++++++++++++ reference/flat_set/flat_set.md | 2 +- reference/flat_set/flat_set/swap_free.md | 76 +++++++++++++++++++ 4 files changed, 154 insertions(+), 2 deletions(-) create mode 100644 reference/flat_set/flat_multiset/swap_free.md create mode 100644 reference/flat_set/flat_set/swap_free.md diff --git a/reference/flat_set/flat_multiset.md b/reference/flat_set/flat_multiset.md index db2cbe7ee9..e6e3bd6ad5 100644 --- a/reference/flat_set/flat_multiset.md +++ b/reference/flat_set/flat_multiset.md @@ -129,7 +129,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`swap`](flat_multiset/swap_free.md.nolink) | 2つの`flat_multiset`オブジェクトを入れ替える | C++23 | +| [`swap`](flat_multiset/swap_free.md) | 2つの`flat_multiset`オブジェクトを入れ替える | C++23 | ## 推論補助 diff --git a/reference/flat_set/flat_multiset/swap_free.md b/reference/flat_set/flat_multiset/swap_free.md new file mode 100644 index 0000000000..f1e0c04ea3 --- /dev/null +++ b/reference/flat_set/flat_multiset/swap_free.md @@ -0,0 +1,76 @@ +# swap (非メンバ関数) +* flat_set[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template + void swap(flat_multiset& x, + flat_multiset& y); // (1) C++23 +} +``` + +## 概要 +2つの `flat_multiset` オブジェクトを入れ替える。 + + +## 効果 +`x.`[`swap`](swap.md)`(y)` + + +## 例 +```cpp example +#include +#include + +template +void print(const char* name, const Set& s) +{ + std::cout << name << " : {"; + + bool first = true; + + for (const auto& x : s) { + if (first) { + first = false; + } + else { + std::cout << ", "; + } + std::cout << x; + } + std::cout << "}" << std::endl; +} + +int main() +{ + std::flat_multiset fs1 = {10, 20, 30}; + + std::flat_multiset fs2 = {5, 15}; + + // fs1とfs2を入れ替える + std::swap(fs1, fs2); + + print("fs1", fs1); + print("fs2", fs2); +} +``` +* std::swap[color ff0000] + +### 出力 +``` +fs1 : {5, 15} +fs2 : {10, 20, 30} +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/flat_set/flat_set.md b/reference/flat_set/flat_set.md index 3ba236cfbb..c4715fbc25 100644 --- a/reference/flat_set/flat_set.md +++ b/reference/flat_set/flat_set.md @@ -129,7 +129,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`swap`](flat_set/swap_free.md.nolink) | 2つの`flat_set`オブジェクトを入れ替える | C++23 | +| [`swap`](flat_set/swap_free.md) | 2つの`flat_set`オブジェクトを入れ替える | C++23 | ## 推論補助 diff --git a/reference/flat_set/flat_set/swap_free.md b/reference/flat_set/flat_set/swap_free.md new file mode 100644 index 0000000000..a9efa2d0e5 --- /dev/null +++ b/reference/flat_set/flat_set/swap_free.md @@ -0,0 +1,76 @@ +# swap (非メンバ関数) +* flat_set[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template + void swap(flat_set& x, + flat_set& y); // (1) C++23 +} +``` + +## 概要 +2つの `flat_set` オブジェクトを入れ替える。 + + +## 効果 +`x.`[`swap`](swap.md)`(y)` + + +## 例 +```cpp example +#include +#include + +template +void print(const char* name, const Set& s) +{ + std::cout << name << " : {"; + + bool first = true; + + for (const auto& x : s) { + if (first) { + first = false; + } + else { + std::cout << ", "; + } + std::cout << x; + } + std::cout << "}" << std::endl; +} + +int main() +{ + std::flat_set fs1 = {10, 20, 30}; + + std::flat_set fs2 = {5, 15}; + + // fs1とfs2を入れ替える + std::swap(fs1, fs2); + + print("fs1", fs1); + print("fs2", fs2); +} +``` +* std::swap[color ff0000] + +### 出力 +``` +fs1 : {5, 15} +fs2 : {10, 20, 30} +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? From 5800b64f9a56782d4792e2268afdf36f251cc68f Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Sun, 9 Feb 2025 15:25:05 +0900 Subject: [PATCH 1439/3948] =?UTF-8?q?cmath=20(std::sph=5Flegendre):=20?= =?UTF-8?q?=E7=90=83=E9=9D=A2=E8=AA=BF=E5=92=8C=E9=96=A2=E6=95=B0=E3=81=A8?= =?UTF-8?q?=E4=BD=BF=E3=81=84=E6=96=B9=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6?= =?UTF-8?q?=E8=A8=98=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cmath/sph_legendre.md | 71 +++++++++++++++++++++++++++++++-- 1 file changed, 67 insertions(+), 4 deletions(-) diff --git a/reference/cmath/sph_legendre.md b/reference/cmath/sph_legendre.md index 1f32cba3dd..d6d9e81f46 100644 --- a/reference/cmath/sph_legendre.md +++ b/reference/cmath/sph_legendre.md @@ -47,7 +47,7 @@ namespace std { ## 戻り値 -引数 `l`, `m`, `theta` について $Y_l^m(\theta, 0)$ を返す。 +引数 `l`, `m`, `theta` について $Y_l^m(\theta, 0)$ (ただし $0 \le m \le l$) を返す。 $Y_l^m(\theta, \phi)$ は球面調和関数 $$ Y_l^m(\theta, \phi) = (-1)^m \sqrt{\frac{2l + 1}{4\pi} \frac{(l - m)!}{(l + m)!}} P_l^m(\cos \theta) \exp(i m \phi) @@ -56,11 +56,71 @@ $$ である。 $P_l^m$ はルジャンドル陪関数 ([`assoc_legendre`](assoc_legendre.md)) である。 - ## 備考 - `l >= 128` の場合、この関数の呼び出しの効果は実装定義である - (1) : C++23では、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +### 球面調和関数 +球面調和関数として使う場合には $\phi$ 依存性は自分で与える必要がある。 +また、この標準関数は $m\ge0$ にしか対応していないので、$m < 0$ の時の球面調和関数を計算したければ自分で $Y_l^{|m|}(\theta,0)$ の値を調節して使う必要がある。 +ルジャンドル陪関数の性質 $P_l^{-m}(x) = (-1)^m [(l - m)!/(l + m)!] P_l^m(x)$ より、一般の $m$ の球面調和関数は +$$ +\begin{align*} +Y_l^m(\theta, \phi) + &= (-1)^{(m+|m|)/2} \sqrt{\frac{2l + 1}{4\pi} \frac{(l - |m|)!}{(l + |m|)!}} P_l^{|m|}(\cos \theta) e^{i m \phi} \\ + &= \begin{cases} + Y_l^{m}(\theta, 0) e^{im\phi}, & (0 \le m \le l), \\ + (-1)^{|m|} Y_l^{|m|}(\theta, 0) e^{im\phi}, & (-l \le m < 0). + \end{cases} +\end{align*} +$$ +で与えられる。 + +```cpp +#include +#include +#include + +// 球面調和関数の実装例 +std::complex sph_harmonics(unsigned l, int m, double theta, double phi) { + if (m >= 0) + return std::sph_legendre(l, (unsigned) m, theta) * std::polar(1.0, m * phi); + else + return std::sph_legendre(l, (unsigned) -m, theta) * std::polar(1.0, m * (phi - std::numbers::pi)); +} +``` +* std::sph_legendre[color ff0000] +* std::polar[link /reference/complex/complex/polar.md] +* std::numbers::pi[link /reference/numbers/pi.md] + +また線形結合を取り直して実数にした、実数球面調和関数 $Y_{lm}(\theta,\phi)$ を計算することもできる。 + +$$ +Y_{lm}(\theta,\phi) += \begin{cases} + \frac{(-1)^m Y_l^{|m|}(\theta,\phi) - Y_l^{-|m|}(\theta,\phi)}{\sqrt{2} i} = \sqrt{2} (-1)^{|m|} Y_l^{|m|}(\theta, 0) \sin(|m|\phi), & (-l \le m < 0), \\ + Y_l^0 = Y_l^0(\theta, 0), & (m = 0), \\ + \frac{(-1)^m Y_l^{|m|}(\theta,\phi) + Y_l^{-|m|}(\theta,\phi)}{\sqrt{2}} = \sqrt{2} (-1)^{|m|} Y_l^{|m|}(\theta, 0) \cos(|m|\phi), & (0 < m \le l). +\end{cases} +$$ + +```cpp +#include +#include + +// 実数球面調和関数の実装例 +double real_sph_harmonics(unsigned l, int m, double theta, double phi) { + if (m == 0) + return std::sph_legendre(l, 0u, theta); + else if (m > 0) + return std::numbers::sqrt2 * std::sph_legendre(l, (unsigned) m, theta) * std::cos(m * (phi - std::numbers::pi)); + else + return std::numbers::sqrt2 * std::sph_legendre(l, (unsigned) -m, theta) * std::sin(-m * (phi - std::numbers::pi)); +} +``` +* std::sph_legendre[color ff0000] +* std::numbers::pi[link /reference/numbers/pi.md] +* std::numbers::sqrt2[link /reference/numbers/sqrt2.md] ## 例 ```cpp example @@ -71,8 +131,11 @@ $P_l^m$ はルジャンドル陪関数 ([`assoc_legendre`](assoc_legendre.md)) constexpr double pi = 3.141592653589793; // 球面調和関数 -std::complex sph_harmonics(unsigned l, unsigned m, double theta, double phi) { - return std::sph_legendre(l, m, theta) * std::polar(1.0, m * phi); +std::complex sph_harmonics(unsigned l, int m, double theta, double phi) { + if (m >= 0) + return std::sph_legendre(l, (unsigned) m, theta) * std::polar(1.0, m * phi); + else + return std::sph_legendre(l, (unsigned) -m, theta) * std::polar(1.0, m * (phi - std::numbers::pi)); } int main() { From 7d498ef578ea05c646ee827a67f8ada66c3a03eb Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Sun, 9 Feb 2025 15:26:35 +0900 Subject: [PATCH 1440/3948] =?UTF-8?q?cmath=20(std::sph=5Flegendre):=20C++2?= =?UTF-8?q?0=20=E5=86=86=E5=91=A8=E7=8E=87=20std::numbers::pi=20=E3=82=92?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= =?UTF-8?q?=E4=BE=8B=E3=82=92=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cmath/sph_legendre.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/cmath/sph_legendre.md b/reference/cmath/sph_legendre.md index d6d9e81f46..daa2b669b5 100644 --- a/reference/cmath/sph_legendre.md +++ b/reference/cmath/sph_legendre.md @@ -126,10 +126,9 @@ double real_sph_harmonics(unsigned l, int m, double theta, double phi) { ```cpp example #include #include +#include #include -constexpr double pi = 3.141592653589793; - // 球面調和関数 std::complex sph_harmonics(unsigned l, int m, double theta, double phi) { if (m >= 0) @@ -145,9 +144,9 @@ int main() { std::cout << "#θ / π\tφ / π\tY_" << l << "^" << m << "(θ, φ)\n"; for (double t : {0., 0.25, 0.5, 0.75, 1.}) { - double theta = t * pi; + double theta = t * std::numbers::pi; for (double p : {0., 0.25, 0.5, 0.75, 1., 1.25, 1.5, 1.75, 2.}) { - double phi = p * pi / 4; + double phi = p * std::numbers::pi / 4; std::cout << t << "\t" << p << "\t" << sph_harmonics(l, m, theta, phi) << "\n"; if (t == 0 || t == 1) break; } @@ -156,6 +155,7 @@ int main() { ``` * std::sph_legendre[color ff0000] * std::polar[link /reference/complex/complex/polar.md] +* std::numbers::pi[link /reference/numbers/pi.md] ### 出力例 ``` From f4e42f3dde7d5fd136393364f9e1c1a990e6a543 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Sun, 9 Feb 2025 15:38:35 +0900 Subject: [PATCH 1441/3948] =?UTF-8?q?cmath=20(std::assoc=5Flegendre):=20?= =?UTF-8?q?=E8=B2=A0=E3=81=AE=20m=20=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6?= =?UTF-8?q?=E8=A8=88=E7=AE=97=E3=81=99=E3=82=8B=E6=96=B9=E6=B3=95=E3=81=AE?= =?UTF-8?q?=E8=A8=98=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cmath/assoc_legendre.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/reference/cmath/assoc_legendre.md b/reference/cmath/assoc_legendre.md index dc96d1b09c..41ec51eb76 100644 --- a/reference/cmath/assoc_legendre.md +++ b/reference/cmath/assoc_legendre.md @@ -59,6 +59,30 @@ $$ - `l >= 128` の場合、この関数の呼び出しの効果は実装定義である - (1) : C++23では、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +### 負の m の対応 +この標準関数は $m$ が正の場合にしか対応していない。 +一方でルジャンドル陪関数はロドリゲスの公式を用いて負の $m$ に対して自然に拡張され、 +このことは球面調和関数を定義する上でも使われる。 +負の $m$ に対してもルジャンドル陪関数を計算する必要がある場合は、関係式 +$$ P_l^{-m}(x) = (-1)^m \frac{(l-m)!}{(l+m)!} P_l^m(x) $$ +を用いる必要がある。 + +```cpp +#include + +// 負の m にも対応した実装例 +double assoc_legendre(unsigned l, int m, double x) { + if (m >= 0) + return std::assoc_legendre(l, (unsigned) m, x); + else + return std::pow(-1.0, m) * (std::tgamma(1.0 + l + m) / std::tgamma(1.0 + l - m)) * std::assoc_legendre(l, (unsigned) -m, x); +} +``` +* std::assoc_legendre[color ff0000] +* std::tgamma[link tgamma.md] + +上記の例では簡単のために階乗をガンマ関数 $n! = \Gamma(n + 1)$ ([`tgamma`](tgamma.md)) で計算しているが、 +計算効率やオーバーフローなどを考えると、直接 $(l + |m|)\cdots(l - |m| + 1)$ で割り算したり、係数を事前計算しておくなど工夫すると良い。 ## 例 ```cpp example From 8f99cf038f4dcb509843abe4ed4f5a35a182ffd2 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Sun, 9 Feb 2025 15:51:08 +0900 Subject: [PATCH 1442/3948] =?UTF-8?q?cmath=20(std::legendre):=20=E3=83=AB?= =?UTF-8?q?=E3=82=B8=E3=83=A3=E3=83=B3=E3=83=89=E3=83=AB=E5=A4=9A=E9=A0=85?= =?UTF-8?q?=E5=BC=8F=E3=81=AE=E7=AF=84=E5=9B=B2=E5=A4=96=E3=82=A8=E3=83=A9?= =?UTF-8?q?=E3=83=BC=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6=E8=A8=98=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cmath/legendre.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reference/cmath/legendre.md b/reference/cmath/legendre.md index 5e35b3d88c..9c9e54241c 100644 --- a/reference/cmath/legendre.md +++ b/reference/cmath/legendre.md @@ -103,6 +103,9 @@ legendre(3, 1) = 1 - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? +### 備考 +- GCC 7, 8 には $x$ として [-1.0, 1.0] の範囲外の値を渡した時に、[`std::domain_error`](/reference/stdexcept.md) を投げるバグがあった (GCC 7.5, 8.2, 8.4 [mark verified])。 + GCC 9 以降では直っている (GCC 9.3, 10.5, 11.4, 12.3, 13.2, 15.0 [mark verified])。 ## 実装例 ### 閉形式 From 99172800fe1624962262e674c55efe2a39dd7b2c Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Sun, 9 Feb 2025 16:12:26 +0900 Subject: [PATCH 1443/3948] =?UTF-8?q?cmath=20(std::tgamma):=20=E3=82=AC?= =?UTF-8?q?=E3=83=B3=E3=83=9E=E9=96=A2=E6=95=B0=E3=81=AE=E5=AE=9A=E7=BE=A9?= =?UTF-8?q?=E5=BC=8F=E3=82=92=E8=BF=BD=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cmath/tgamma.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/cmath/tgamma.md b/reference/cmath/tgamma.md index 4f3e397eb7..7fff0221b8 100644 --- a/reference/cmath/tgamma.md +++ b/reference/cmath/tgamma.md @@ -47,11 +47,11 @@ namespace std { ## 戻り値 -引数 `x` のガンマ関数を返す。 +引数 `x` のガンマ関数 $\Gamma(x)$ を返す。 +$$ \Gamma (x) = \int_0^\infty t^{x-1} e^{-t} dt $$ ## 備考 -- $$ f(x) = \Gamma (x) $$ - ガンマ関数は階乗の一般化である。 - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 - `x = ±0` の場合、戻り値は `±∞` となり、 From 52a3f1074f775faeaffd3f2e499e21b1cf095509 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Sun, 9 Feb 2025 16:18:18 +0900 Subject: [PATCH 1444/3948] =?UTF-8?q?cmath=20(std::{tgamma,lgamma}):=20?= =?UTF-8?q?=E7=9B=B8=E4=BA=92=E3=83=AA=E3=83=B3=E3=82=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cmath/lgamma.md | 4 +++- reference/cmath/tgamma.md | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/reference/cmath/lgamma.md b/reference/cmath/lgamma.md index bcb8dd5521..60de4faba0 100644 --- a/reference/cmath/lgamma.md +++ b/reference/cmath/lgamma.md @@ -35,7 +35,7 @@ namespace std { * Integral[italic] ## 概要 -ガンマ関数の絶対値の自然対数を求める。 +ガンマ関数 $\Gamma(x)$ ([`tgamma`](tgamma.md)) の絶対値の自然対数を求める。 - (1) : `float`に対するオーバーロード - (2) : `double`に対するオーバーロード @@ -107,6 +107,8 @@ lgamma(+∞) = inf - GCC 4.6.1 以上 +## 関連項目 +- ガンマ関数 [`tgamma`](tgamma.md) ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) diff --git a/reference/cmath/tgamma.md b/reference/cmath/tgamma.md index 7fff0221b8..1a77226d87 100644 --- a/reference/cmath/tgamma.md +++ b/reference/cmath/tgamma.md @@ -110,6 +110,8 @@ tgamma(+∞) = inf - GCC 4.6.1 以上 +## 関連項目 +- ガンマ関数の絶対値の自然対数 [`lgamma`](lgamma.md) ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) From 7f763a43bee58a71fe22578c894c2074ee42af2d Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Sun, 9 Feb 2025 16:19:46 +0900 Subject: [PATCH 1445/3948] =?UTF-8?q?cmath=20(tgamma):=20=E9=9A=8E?= =?UTF-8?q?=E4=B9=97=E3=81=A8=E3=82=AC=E3=83=B3=E3=83=9E=E9=96=A2=E6=95=B0?= =?UTF-8?q?=E3=81=AE=E9=96=A2=E4=BF=82=E3=82=92=E5=BC=8F=E3=81=A7=E6=98=8E?= =?UTF-8?q?=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cmath/tgamma.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cmath/tgamma.md b/reference/cmath/tgamma.md index 1a77226d87..4dcbd333ab 100644 --- a/reference/cmath/tgamma.md +++ b/reference/cmath/tgamma.md @@ -52,7 +52,7 @@ namespace std { $$ \Gamma (x) = \int_0^\infty t^{x-1} e^{-t} dt $$ ## 備考 -- ガンマ関数は階乗の一般化である。 +- ガンマ関数は階乗の一般化である。階乗はガンマ関数を用いて $n! = \Gamma(n + 1)$ で計算できる。 - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 - `x = ±0` の場合、戻り値は `±∞` となり、 [`FE_DIVBYZERO`](../cfenv/fe_divbyzero.md)(ゼロ除算浮動小数点例外)が発生する。 From 932634a1150d4190d7060f9810f699e98061f462 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Sun, 9 Feb 2025 16:31:26 +0900 Subject: [PATCH 1446/3948] =?UTF-8?q?cmath=20(tgamma):=20lgamma=20?= =?UTF-8?q?=E3=82=92=E4=BD=BF=E3=81=86=E3=81=B9=E3=81=8D=E5=A0=B4=E5=90=88?= =?UTF-8?q?=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6=E8=A8=98=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cmath/lgamma.md | 3 ++- reference/cmath/tgamma.md | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/reference/cmath/lgamma.md b/reference/cmath/lgamma.md index 60de4faba0..03027e27d0 100644 --- a/reference/cmath/lgamma.md +++ b/reference/cmath/lgamma.md @@ -60,7 +60,8 @@ namespace std { - `x = -∞` の場合、戻り値は `+∞` となる。 - `x = +∞` の場合、戻り値は `+∞` となる。 - C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された - +- この関数はガンマ関数 ([`tgamma`](tgamma.md)) がオーバーフローするような場合に使う。 + 具体例については[ガンマ関数の備考](tgamma.md#remarks-lgamma)を参照のこと。 ## 例 ```cpp example diff --git a/reference/cmath/tgamma.md b/reference/cmath/tgamma.md index 4dcbd333ab..615ff77179 100644 --- a/reference/cmath/tgamma.md +++ b/reference/cmath/tgamma.md @@ -64,6 +64,32 @@ $$ \Gamma (x) = \int_0^\infty t^{x-1} e^{-t} dt $$ - `gamma` という関数は既にあったが処理系によって定義が違ったため、本当の (true) ガンマ関数 `tgamma` と名付けられた。 - C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +### lgamma との使い分け +ガンマ関数は急激に増加し容易にオーバーフローするので、代わりにガンマ関数の結果を自然対数で返す関数 [`lgamma`](lgamma.md) を用いた方が良いことが多くある。 +例えばガンマ関数の比を計算する場合には、 ガンマ関数の対数の差を取ってから指数関数 [`std::exp`](exp.md) を適用するのが賢明である。 + +$$ \frac{\Gamma(2026)}{\Gamma(2025)} = \exp[\ln\Gamma(2026) - \ln\Gamma(2025)] $$ + +```cpp example +#include +#include +int main() { + std::cout << std::tgamma(2026.0) / std::tgamma(2025.0) << std::endl; + std::cout << std::exp(std::lgamma(2026.0) - std::lgamma(2025.0)) << std::endl; +} +``` +* std::tgamma[color ff0000] +* std::lgamma[color 0000ff][link lgamma.md] + +出力例 +``` +-nan +2025 +``` + +上の結果では、直接ガンマ関数を計算した場合はオーバーフローによって inf / inf となり最終結果が -nan になっているが、`lgamma` を使った場合には正しい値が計算できている。 +ただし、`lgamma` は飽くまでガンマ関数の「絶対値」の対数であることに注意する。 +ガンマ関数の引数が負になる場合はガンマ関数が負の値を取りうるので符号は別に求める必要がある。 ## 例 ```cpp example From c55d9f2489cf0f0a96a65a511e8862953667746d Mon Sep 17 00:00:00 2001 From: suomesta Date: Tue, 11 Feb 2025 09:56:25 +0900 Subject: [PATCH 1447/3948] add op_deduction_guide to flat_map. (#1078) --- reference/flat_map/flat_map.md | 2 +- .../flat_map/flat_map/op_deduction_guide.md | 132 ++++++++++++++++++ reference/flat_map/flat_multimap.md | 2 +- .../flat_multimap/op_deduction_guide.md | 132 ++++++++++++++++++ 4 files changed, 266 insertions(+), 2 deletions(-) create mode 100644 reference/flat_map/flat_map/op_deduction_guide.md create mode 100644 reference/flat_map/flat_multimap/op_deduction_guide.md diff --git a/reference/flat_map/flat_map.md b/reference/flat_map/flat_map.md index 47eb5dfba2..584048a911 100644 --- a/reference/flat_map/flat_map.md +++ b/reference/flat_map/flat_map.md @@ -149,7 +149,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |---------------------------------------------|------------------------------------|-------| -| [`(deduction_guide)`](flat_map/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | +| [`(deduction_guide)`](flat_map/op_deduction_guide.md) | クラステンプレートの推論補助 | C++23 | ## その他 diff --git a/reference/flat_map/flat_map/op_deduction_guide.md b/reference/flat_map/flat_map/op_deduction_guide.md new file mode 100644 index 0000000000..3bb63d4d85 --- /dev/null +++ b/reference/flat_map/flat_map/op_deduction_guide.md @@ -0,0 +1,132 @@ +# 推論補助 +* flat_map[meta header] +* std[meta namespace] +* flat_map[meta class] +* cpp23[meta cpp] + +```cpp +namespace std { + // 説明用の型 + template + using iter_key_t = remove_const_t::value_type::first_type>; + template + using iter_val_t = typename iterator_traits::value_type::second_type; + template + using range_key_t = remove_const_t::first_type>; + template + using range_val_t = typename ranges::range_value_t::second_type; + template + using alloc_rebind = typename allocator_traits::template rebind_alloc; + + template> + flat_map(KeyContainer, MappedContainer, Compare = Compare()) + -> flat_map; // (1) + + template + flat_map(KeyContainer, MappedContainer, Allocator) + -> flat_map, KeyContainer, MappedContainer>; // (2) + + template + flat_map(KeyContainer, MappedContainer, Compare, Allocator) + -> flat_map; // (3) + + template> + flat_map(sorted_unique_t, KeyContainer, MappedContainer, Compare = Compare()) + -> flat_map; // (4) + + template + flat_map(sorted_unique_t, KeyContainer, MappedContainer, Allocator) + -> flat_map, KeyContainer, MappedContainer>; // (5) + + template + flat_map(sorted_unique_t, KeyContainer, MappedContainer, Compare, Allocator) + -> flat_map; // (6) + + template>> + flat_map(InputIterator, InputIterator, Compare = Compare()) + -> flat_map, iter_val_t, Compare>; // (7) + + template>> + flat_map(sorted_unique_t, InputIterator, InputIterator, Compare = Compare()) + -> flat_map, iter_val_t, Compare>; // (8) + + template>, + class Allocator = allocator> + flat_map(from_range_t, R&&, Compare = Compare(), Allocator = Allocator()) + -> flat_map, range_val_t, Compare, + vector, alloc_rebind>>, + vector, alloc_rebind>>>; // (9) + + template + flat_map(from_range_t, R&&, Allocator) + -> flat_map, range_val_t, less>, + vector, alloc_rebind>>, + vector, alloc_rebind>>>; // (10) + + template> + flat_map(initializer_list>, Compare = Compare()) + -> flat_map; // (11) + + template> + flat_map(sorted_unique_t, initializer_list>, Compare = Compare()) + -> flat_map; // (12) +``` +* vector[link /reference/vector/vector.md] +* from_range_t[link ../../ranges/from_range_t.md] +* sorted_unique_t[link ../sorted_unique_t.md] +* remove_const_t[link /reference/type_traits/remove_const.md] +* pair[link /reference/utility/pair.md] +* iterator_traits[link /reference/iterator/iterator_traits.md] +* less[link /reference/functional/less.md] +* allocator[link /reference/memory/allocator.md] +* initializer_list[link /reference/initializer_list/initializer_list.md] +* ranges::input_range[link /reference/ranges/input_range.md] +* allocator_traits[link /reference/memory/allocator_traits.md] +* byte[link /reference/cstddef/byte.md] + + +## 概要 +`std::flat_map`クラステンプレートの型推論補助。 + +- (1) : キーのコンテナ、値のコンテナ、比較関数からの推論 +- (2) : キーのコンテナ、値のコンテナ、アロケータからの推論 +- (3) : キーのコンテナ、値のコンテナ、比較関数、アロケータからの推論 +- (4) : キーのコンテナ、値のコンテナ、比較関数からの推論 +- (5) : キーのコンテナ、値のコンテナ、アロケータからの推論 +- (6) : キーのコンテナ、値のコンテナ、比較関数、アロケータからの推論 +- (7) : イテレータ範囲、比較関数からの推論 +- (8) : イテレータ範囲、比較関数からの推論 +- (9) : Range、比較関数、アロケータからの推論 +- (10) : Range、アロケータからの推論 +- (11) : 初期化子リスト、比較関数からの推論 +- (12) : 初期化子リスト、比較関数からの推論 + + +## 備考 +- C++23時点において、`flat_map`の推論補助は使いにくい。これはイテレータ範囲や組でのキーの型が`const Key`となっているためだ。この使いにくさは、将来の言語拡張で改良される可能性がある。 + ```cpp + flat_map m = {{1, 1}, {2, 2}, {3, 3}}; // コンパイルエラー! 初期化子リストからconst Keyを導出できない + flat_map m2 = initializer_list>({{1, 1}, {2, 2}, {3, 3}}); // OK + ``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [LWG Issue 3025. Map-like container deduction guides should use `pair`, not `pair`](https://wg21.cmeerw.net/lwg/issue3025) diff --git a/reference/flat_map/flat_multimap.md b/reference/flat_map/flat_multimap.md index 414944d1aa..cc49593b5f 100644 --- a/reference/flat_map/flat_multimap.md +++ b/reference/flat_map/flat_multimap.md @@ -145,7 +145,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |---------------------------------------------|------------------------------------|-------| -| [`(deduction_guide)`](flat_multimap/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | +| [`(deduction_guide)`](flat_multimap/op_deduction_guide.md) | クラステンプレートの推論補助 | C++23 | ## その他 diff --git a/reference/flat_map/flat_multimap/op_deduction_guide.md b/reference/flat_map/flat_multimap/op_deduction_guide.md new file mode 100644 index 0000000000..811665f2a7 --- /dev/null +++ b/reference/flat_map/flat_multimap/op_deduction_guide.md @@ -0,0 +1,132 @@ +# 推論補助 +* flat_map[meta header] +* std[meta namespace] +* flat_multimap[meta class] +* cpp23[meta cpp] + +```cpp +namespace std { + // 説明用の型 + template + using iter_key_t = remove_const_t::value_type::first_type>; + template + using iter_val_t = typename iterator_traits::value_type::second_type; + template + using range_key_t = remove_const_t::first_type>; + template + using range_val_t = typename ranges::range_value_t::second_type; + template + using alloc_rebind = typename allocator_traits::template rebind_alloc; + + template> + flat_multimap(KeyContainer, MappedContainer, Compare = Compare()) + -> flat_multimap; // (1) + + template + flat_multimap(KeyContainer, MappedContainer, Allocator) + -> flat_multimap, KeyContainer, MappedContainer>; // (2) + + template + flat_multimap(KeyContainer, MappedContainer, Compare, Allocator) + -> flat_multimap; // (3) + + template> + flat_multimap(sorted_equivalent_t, KeyContainer, MappedContainer, Compare = Compare()) + -> flat_multimap; // (4) + + template + flat_multimap(sorted_equivalent_t, KeyContainer, MappedContainer, Allocator) + -> flat_multimap, KeyContainer, MappedContainer>; // (5) + + template + flat_multimap(sorted_equivalent_t, KeyContainer, MappedContainer, Compare, Allocator) + -> flat_multimap; // (6) + + template>> + flat_multimap(InputIterator, InputIterator, Compare = Compare()) + -> flat_multimap, iter_val_t, Compare>; // (7) + + template>> + flat_multimap(sorted_equivalent_t, InputIterator, InputIterator, Compare = Compare()) + -> flat_multimap, iter_val_t, Compare>; // (8) + + template>, + class Allocator = allocator> + flat_multimap(from_range_t, R&&, Compare = Compare(), Allocator = Allocator()) + -> flat_multimap, range_val_t, Compare, + vector, alloc_rebind>>, + vector, alloc_rebind>>>; // (9) + + template + flat_multimap(from_range_t, R&&, Allocator) + -> flat_multimap, range_val_t, less>, + vector, alloc_rebind>>, + vector, alloc_rebind>>>; // (10) + + template> + flat_multimap(initializer_list>, Compare = Compare()) + -> flat_multimap; // (11) + + template> + flat_multimap(sorted_equivalent_t, initializer_list>, Compare = Compare()) + -> flat_multimap; // (12) +``` +* vector[link /reference/vector/vector.md] +* from_range_t[link ../../ranges/from_range_t.md] +* sorted_equivalent_t[link ../sorted_equivalent_t.md] +* remove_const_t[link /reference/type_traits/remove_const.md] +* pair[link /reference/utility/pair.md] +* iterator_traits[link /reference/iterator/iterator_traits.md] +* less[link /reference/functional/less.md] +* allocator[link /reference/memory/allocator.md] +* initializer_list[link /reference/initializer_list/initializer_list.md] +* ranges::input_range[link /reference/ranges/input_range.md] +* allocator_traits[link /reference/memory/allocator_traits.md] +* byte[link /reference/cstddef/byte.md] + + +## 概要 +`std::flat_multimap`クラステンプレートの型推論補助。 + +- (1) : キーのコンテナ、値のコンテナ、比較関数からの推論 +- (2) : キーのコンテナ、値のコンテナ、アロケータからの推論 +- (3) : キーのコンテナ、値のコンテナ、比較関数、アロケータからの推論 +- (4) : キーのコンテナ、値のコンテナ、比較関数からの推論 +- (5) : キーのコンテナ、値のコンテナ、アロケータからの推論 +- (6) : キーのコンテナ、値のコンテナ、比較関数、アロケータからの推論 +- (7) : イテレータ範囲、比較関数からの推論 +- (8) : イテレータ範囲、比較関数からの推論 +- (9) : Range、比較関数、アロケータからの推論 +- (10) : Range、アロケータからの推論 +- (11) : 初期化子リスト、比較関数からの推論 +- (12) : 初期化子リスト、比較関数からの推論 + + +## 備考 +- C++23時点において、`flat_multimap`の推論補助は使いにくい。これはイテレータ範囲や組でのキーの型が`const Key`となっているためだ。この使いにくさは、将来の言語拡張で改良される可能性がある。 + ```cpp + flat_multimap m = {{1, 1}, {2, 2}, {3, 3}}; // コンパイルエラー! 初期化子リストからconst Keyを導出できない + flat_multimap m2 = initializer_list>({{1, 1}, {2, 2}, {3, 3}}); // OK + ``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [LWG Issue 3025. Map-like container deduction guides should use `pair`, not `pair`](https://wg21.cmeerw.net/lwg/issue3025) From f7e7a97f12518a9c88ecb00272734282b6c09772 Mon Sep 17 00:00:00 2001 From: suomesta Date: Tue, 11 Feb 2025 09:56:48 +0900 Subject: [PATCH 1448/3948] add op_deduction_guide to flat_set. (#1079) --- reference/flat_set/flat_multiset.md | 2 +- .../flat_multiset/op_deduction_guide.md | 106 ++++++++++++++++++ reference/flat_set/flat_set.md | 2 +- .../flat_set/flat_set/op_deduction_guide.md | 106 ++++++++++++++++++ 4 files changed, 214 insertions(+), 2 deletions(-) create mode 100644 reference/flat_set/flat_multiset/op_deduction_guide.md create mode 100644 reference/flat_set/flat_set/op_deduction_guide.md diff --git a/reference/flat_set/flat_multiset.md b/reference/flat_set/flat_multiset.md index e6e3bd6ad5..60d49067e1 100644 --- a/reference/flat_set/flat_multiset.md +++ b/reference/flat_set/flat_multiset.md @@ -136,7 +136,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |---------------------------------------------|------------------------------------|-------| -| [`(deduction_guide)`](flat_multiset/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | +| [`(deduction_guide)`](flat_multiset/op_deduction_guide.md) | クラステンプレートの推論補助 | C++23 | ## その他 diff --git a/reference/flat_set/flat_multiset/op_deduction_guide.md b/reference/flat_set/flat_multiset/op_deduction_guide.md new file mode 100644 index 0000000000..2b1a907c97 --- /dev/null +++ b/reference/flat_set/flat_multiset/op_deduction_guide.md @@ -0,0 +1,106 @@ +# 推論補助 +* flat_set[meta header] +* std[meta namespace] +* flat_multiset[meta class] +* cpp23[meta cpp] + +```cpp +namespace std { + // 説明用の型 + template + using iter_val_t = typename iterator_traits::value_type; + template + using alloc_rebind = typename allocator_traits::template rebind_alloc; + + template> + flat_multiset(KeyContainer, Compare = Compare()) + -> flat_multiset; // (1) + + template + flat_multiset(KeyContainer, Allocator) + -> flat_multiset, KeyContainer>; // (2) + + template + flat_multiset(KeyContainer, Compare, Allocator) + -> flat_multiset; // (3) + + template> + flat_multiset(sorted_equivalent_t, KeyContainer, Compare = Compare()) + -> flat_multiset; // (4) + + template + flat_multiset(sorted_equivalent_t, KeyContainer, Allocator) + -> flat_multiset, KeyContainer>; // (5) + + template + flat_multiset(sorted_equivalent_t, KeyContainer, Compare, Allocator) + -> flat_multiset; // (6) + + template>> + flat_multiset(InputIterator, InputIterator, Compare = Compare()) + -> flat_multiset, Compare>; // (7) + + template>> + flat_multiset(sorted_equivalent_t, InputIterator, InputIterator, Compare = Compare()) + -> flat_multiset, Compare>; // (8) + + template>, + class Allocator = allocator>> + flat_multiset(from_range_t, R&&, Compare = Compare(), Allocator = Allocator()) + -> flat_multiset, Compare, + vector, + alloc_rebind>>>; // (9) + + template + flat_multiset(from_range_t, R&&, Allocator) + -> flat_multiset, less>, + vector, + alloc_rebind>>>; // (10) + + template> + flat_multiset(initializer_list, Compare = Compare()) + -> flat_multiset; // (11) + + template> + flat_multiset(sorted_equivalent_t, initializer_list, Compare = Compare()) + -> flat_multiset; // (12) +``` +* vector[link /reference/vector/vector.md] +* from_range_t[link ../../ranges/from_range_t.md] +* sorted_equivalent_t[link ../sorted_equivalent_t.md] +* iterator_traits[link /reference/iterator/iterator_traits.md] +* less[link /reference/functional/less.md] +* allocator[link /reference/memory/allocator.md] +* initializer_list[link /reference/initializer_list/initializer_list.md] +* ranges::input_range[link /reference/ranges/input_range.md] +* ranges::range_value_t[link /reference/ranges/range_value_t.md] +* allocator_traits[link /reference/memory/allocator_traits.md] + + +## 概要 +`std::flat_multiset`クラステンプレートの型推論補助。 + +- (1) : キーのコンテナ、比較関数からの推論 +- (2) : キーのコンテナ、アロケータからの推論 +- (3) : キーのコンテナ、比較関数、アロケータからの推論 +- (4) : キーのコンテナ、比較関数からの推論 +- (5) : キーのコンテナ、アロケータからの推論 +- (6) : キーのコンテナ、比較関数、アロケータからの推論 +- (7) : イテレータ範囲、比較関数からの推論 +- (8) : イテレータ範囲、比較関数からの推論 +- (9) : Range、比較関数、アロケータからの推論 +- (10) : Range、アロケータからの推論 +- (11) : 初期化子リスト、比較関数からの推論 +- (12) : 初期化子リスト、比較関数からの推論 + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/flat_set/flat_set.md b/reference/flat_set/flat_set.md index c4715fbc25..ece18174ac 100644 --- a/reference/flat_set/flat_set.md +++ b/reference/flat_set/flat_set.md @@ -136,7 +136,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |---------------------------------------------|------------------------------------|-------| -| [`(deduction_guide)`](flat_set/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | +| [`(deduction_guide)`](flat_set/op_deduction_guide.md) | クラステンプレートの推論補助 | C++23 | ## その他 diff --git a/reference/flat_set/flat_set/op_deduction_guide.md b/reference/flat_set/flat_set/op_deduction_guide.md new file mode 100644 index 0000000000..cadaca6b29 --- /dev/null +++ b/reference/flat_set/flat_set/op_deduction_guide.md @@ -0,0 +1,106 @@ +# 推論補助 +* flat_set[meta header] +* std[meta namespace] +* flat_set[meta class] +* cpp23[meta cpp] + +```cpp +namespace std { + // 説明用の型 + template + using iter_val_t = typename iterator_traits::value_type; + template + using alloc_rebind = typename allocator_traits::template rebind_alloc; + + template> + flat_set(KeyContainer, Compare = Compare()) + -> flat_set; // (1) + + template + flat_set(KeyContainer, Allocator) + -> flat_set, KeyContainer>; // (2) + + template + flat_set(KeyContainer, Compare, Allocator) + -> flat_set; // (3) + + template> + flat_set(sorted_unique_t, KeyContainer, Compare = Compare()) + -> flat_set; // (4) + + template + flat_set(sorted_unique_t, KeyContainer, Allocator) + -> flat_set, KeyContainer>; // (5) + + template + flat_set(sorted_unique_t, KeyContainer, Compare, Allocator) + -> flat_set; // (6) + + template>> + flat_set(InputIterator, InputIterator, Compare = Compare()) + -> flat_set, Compare>; // (7) + + template>> + flat_set(sorted_unique_t, InputIterator, InputIterator, Compare = Compare()) + -> flat_set, Compare>; // (8) + + template>, + class Allocator = allocator>> + flat_set(from_range_t, R&&, Compare = Compare(), Allocator = Allocator()) + -> flat_set, Compare, + vector, + alloc_rebind>>>; // (9) + + template + flat_set(from_range_t, R&&, Allocator) + -> flat_set, less>, + vector, + alloc_rebind>>>; // (10) + + template> + flat_set(initializer_list, Compare = Compare()) + -> flat_set; // (11) + + template> + flat_set(sorted_unique_t, initializer_list, Compare = Compare()) + -> flat_set; // (12) +``` +* vector[link /reference/vector/vector.md] +* from_range_t[link ../../ranges/from_range_t.md] +* sorted_unique_t[link ../sorted_unique_t.md] +* iterator_traits[link /reference/iterator/iterator_traits.md] +* less[link /reference/functional/less.md] +* allocator[link /reference/memory/allocator.md] +* initializer_list[link /reference/initializer_list/initializer_list.md] +* ranges::input_range[link /reference/ranges/input_range.md] +* ranges::range_value_t[link /reference/ranges/range_value_t.md] +* allocator_traits[link /reference/memory/allocator_traits.md] + + +## 概要 +`std::flat_set`クラステンプレートの型推論補助。 + +- (1) : キーのコンテナ、比較関数からの推論 +- (2) : キーのコンテナ、アロケータからの推論 +- (3) : キーのコンテナ、比較関数、アロケータからの推論 +- (4) : キーのコンテナ、比較関数からの推論 +- (5) : キーのコンテナ、アロケータからの推論 +- (6) : キーのコンテナ、比較関数、アロケータからの推論 +- (7) : イテレータ範囲、比較関数からの推論 +- (8) : イテレータ範囲、比較関数からの推論 +- (9) : Range、比較関数、アロケータからの推論 +- (10) : Range、アロケータからの推論 +- (11) : 初期化子リスト、比較関数からの推論 +- (12) : 初期化子リスト、比較関数からの推論 + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? From 336d8aabbfb28ac189be48b3ae1fb85469d59b97 Mon Sep 17 00:00:00 2001 From: Yuhki Ogasawara Date: Thu, 13 Feb 2025 16:09:29 +0900 Subject: [PATCH 1449/3948] =?UTF-8?q?version=E3=82=92Version=E3=81=AB?= =?UTF-8?q?=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 以前(遅くとも19.9.2)からVersion表記であるという情報に基づく https://github.com/cpprefjp/site/commit/034c3678c310c91e851cea8a9383cf32af87ef4d#commitcomment-151512232 --- implementation.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/implementation.md b/implementation.md index 2069fbf591..a72146a94c 100644 --- a/implementation.md +++ b/implementation.md @@ -142,10 +142,10 @@ | 表記 | 製品名 [Visual Studio バージョン] †1 | VC++ バージョン †2 | `_MSC_VER` | `_MSC_FULL_VER` | |---------------|----------------------------------------|-----------------|------------|-----------------| | 2022 Update 12 | Visual Studio 2022 Version 17.12.4 | 14.42 | 1942 | 194234436 | -| 2022 Update 12 | Visual Studio 2022 version 17.12.3 | 14.42 | 1942 | 194234435 | -| 2022 Update 11 | Visual Studio 2022 version 17.11.0 | 14.41 | 1941 | 194134120 | -| 2022 Update 10 | Visual Studio 2022 version 17.10.5 | 14.40 | 1939 | 194033811 | -| 2022 Update 9 | Visual Studio 2022 version 17.9.2 | 14.39 | 1939 | 193933521 | +| 2022 Update 12 | Visual Studio 2022 Version 17.12.3 | 14.42 | 1942 | 194234435 | +| 2022 Update 11 | Visual Studio 2022 Version 17.11.0 | 14.41 | 1941 | 194134120 | +| 2022 Update 10 | Visual Studio 2022 Version 17.10.5 | 14.40 | 1939 | 194033811 | +| 2022 Update 9 | Visual Studio 2022 Version 17.9.2 | 14.39 | 1939 | 193933521 | | 2022 Update 8 | Visual Studio 2022 version 17.8.3 | 14.38 | 1938 | 193833133 | | 2022 Update 7 | Visual Studio 2022 version 17.7.0 | 14.37 | 1937 | 193732822 | | 2022 Update 6 | Visual Studio 2022 version 17.6.2 | 14.36 | 1936 | 193632532 | From 8699511af7af91be5b76a24a3a2988e2f96deae6 Mon Sep 17 00:00:00 2001 From: Yuhki Ogasawara Date: Thu, 13 Feb 2025 16:32:07 +0900 Subject: [PATCH 1450/3948] =?UTF-8?q?Visual=20Studio=202022=20Version=2017?= =?UTF-8?q?.13.0=20=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation.md | 1 + 1 file changed, 1 insertion(+) diff --git a/implementation.md b/implementation.md index a72146a94c..fde1d9d39c 100644 --- a/implementation.md +++ b/implementation.md @@ -141,6 +141,7 @@ | 表記 | 製品名 [Visual Studio バージョン] †1 | VC++ バージョン †2 | `_MSC_VER` | `_MSC_FULL_VER` | |---------------|----------------------------------------|-----------------|------------|-----------------| +| 2022 Update 13 | Visual Studio 2022 Version 17.13.0 | 14.43 | 1943 | 194334808 | | 2022 Update 12 | Visual Studio 2022 Version 17.12.4 | 14.42 | 1942 | 194234436 | | 2022 Update 12 | Visual Studio 2022 Version 17.12.3 | 14.42 | 1942 | 194234435 | | 2022 Update 11 | Visual Studio 2022 Version 17.11.0 | 14.41 | 1941 | 194134120 | From 0c3fe2fd16e818ae3db5a5457f91ec788b059ec3 Mon Sep 17 00:00:00 2001 From: Yuhki Ogasawara Date: Fri, 14 Feb 2025 10:32:25 +0900 Subject: [PATCH 1451/3948] =?UTF-8?q?=20Visual=20Studio=202022=E3=81=AB?= =?UTF-8?q?=E3=81=A4=E3=81=84=E3=81=A6version=E3=82=92Version=E3=81=AB?= =?UTF-8?q?=E7=BD=AE=E3=81=8D=E6=8F=9B=E3=81=88=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/implementation.md b/implementation.md index fde1d9d39c..9c63e580f3 100644 --- a/implementation.md +++ b/implementation.md @@ -147,15 +147,15 @@ | 2022 Update 11 | Visual Studio 2022 Version 17.11.0 | 14.41 | 1941 | 194134120 | | 2022 Update 10 | Visual Studio 2022 Version 17.10.5 | 14.40 | 1939 | 194033811 | | 2022 Update 9 | Visual Studio 2022 Version 17.9.2 | 14.39 | 1939 | 193933521 | -| 2022 Update 8 | Visual Studio 2022 version 17.8.3 | 14.38 | 1938 | 193833133 | -| 2022 Update 7 | Visual Studio 2022 version 17.7.0 | 14.37 | 1937 | 193732822 | -| 2022 Update 6 | Visual Studio 2022 version 17.6.2 | 14.36 | 1936 | 193632532 | -| 2022 Update 5 | Visual Studio 2022 version 17.5.4 | ?? | 1935 | 193532217 | -| 2022 Update 4 | Visual Studio 2022 version 17.4.9 | ?? | 1934 | 193431944 | -| 2022 Update 3 | Visual Studio 2022 version 17.3.6 | 14.33 | 1933 | 193331630 | -| 2022 Update 2 | Visual Studio 2022 version 17.2.2 | 14.32 | 1932 | 193231329 | -| 2022 | Visual Studio 2022 version 17.0.2 | 14.30 | 1930 | 193030706 | -| 2022 | Visual Studio 2022 version 17.0.1 | 14.30 | 1930 | 193030705 | +| 2022 Update 8 | Visual Studio 2022 Version 17.8.3 | 14.38 | 1938 | 193833133 | +| 2022 Update 7 | Visual Studio 2022 Version 17.7.0 | 14.37 | 1937 | 193732822 | +| 2022 Update 6 | Visual Studio 2022 Version 17.6.2 | 14.36 | 1936 | 193632532 | +| 2022 Update 5 | Visual Studio 2022 Version 17.5.4 | ?? | 1935 | 193532217 | +| 2022 Update 4 | Visual Studio 2022 Version 17.4.9 | ?? | 1934 | 193431944 | +| 2022 Update 3 | Visual Studio 2022 Version 17.3.6 | 14.33 | 1933 | 193331630 | +| 2022 Update 2 | Visual Studio 2022 Version 17.2.2 | 14.32 | 1932 | 193231329 | +| 2022 | Visual Studio 2022 Version 17.0.2 | 14.30 | 1930 | 193030706 | +| 2022 | Visual Studio 2022 Version 17.0.1 | 14.30 | 1930 | 193030705 | | 2019 Update 11 | Visual Studio 2019 バージョン 16.11.2 | 14.28 | 1929 | 192930133 | | 2019 Update 9 | Visual Studio 2019 バージョン 16.9.2 | 14.28 | 1928 | 192829913 | | 2019 Update 8 | Visual Studio 2019 バージョン 16.8.2 | 14.28 | 1928 | 192829334 | From e25e0cdc98c39398b391c59c8dfd3368f5ee436c Mon Sep 17 00:00:00 2001 From: onihusube Date: Sat, 15 Feb 2025 18:40:43 +0900 Subject: [PATCH 1452/3948] =?UTF-8?q?=E4=BE=8B=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20#1106?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...onally_trivial_special_member_functions.md | 212 +++++++++++++++++- 1 file changed, 202 insertions(+), 10 deletions(-) diff --git a/lang/cpp20/conditionally_trivial_special_member_functions.md b/lang/cpp20/conditionally_trivial_special_member_functions.md index 6820cc28be..7a305b64c4 100644 --- a/lang/cpp20/conditionally_trivial_special_member_functions.md +++ b/lang/cpp20/conditionally_trivial_special_member_functions.md @@ -64,25 +64,217 @@ struct wrap { ## 例 -(執筆中) +`std::optional`の簡易実装を考える。デストラクタについて、要素型`T`が[`trivially_destructible`](/reference/type_traits/is_trivially_destructible.md)であるかどうかに応じて`optional`のデストラクタのトリビアル性も切り替えたい場合、次のような実装になる + +```cpp +// デストラクタがトリビアルでない場合のストレージ型 +template> +struct optional_storage { + union { + char dummy; + T data; + }; + bool has_value = false; + + // デストラクタは常に非トリビアルでdeleteされているので定義する + ~optional_storage() { + if (has_value) { + this->data.~T(); + } + } +}; + +// デストラクタがトリビアルである場合のストレージ型 +template +struct optional_storage { + union { + char dummy; + T data; + }; + bool has_value = false; + + // デストラクタはトリビアルであり常にdeleteされないので、宣言も不要 +}; + +template +class my_optional : private optional_storage { +public: + + // 略 + ... + + // デストラクタ、この宣言も実はいらない + ~my_optional() = default; +}; +``` + +無効値と有効値でストレージを共有し、なおかつ遅延初期化等を行いながら動的確保や追加のストレージ消費を抑えるためには共用体を使用する。共用体の特殊メンバ関数はそのメンバ型のもつ特殊メンバ関数が1つでも非トリビアルであるならば対応する特殊メンバ関数が`delete`されるため、その場合はユーザーが定義しなければならない。しかしそれを一つの型の中で行うことができなかったため、このようにデストラクタの実装を行うレイヤにおいて型を分割する必要があった。 + +これをこの機能を用いて書き直すと、次のような実装になる + +```cpp +template +class my_optional { + bool has_value = false; + union { + char dummy; + T data; + }; + +public: + + // 略 + ... + + // Tのデストラクタがトリビアルならばこちらが有効化 + ~my_optional() requires std::is_trivially_destructible_v = default; + + // そうでないならばこちらが有効化 + ~my_optional() { + this->reset(); + } + + // reset()の定義も同様の記法で分岐できる + + void reset() requires std::is_trivially_destructible_v { + this->has_value = false; + } + + void reset() { + if (this->has_value) { + this->data.~T(); + } + this->has_value = false; + } +}; +``` + +コンセプトによって`T`の(デストラクタの)トリビアル性に応じてデストラクタを選択できるようになるため、先ほどのような定義を分けるためのレイヤが不要になり、コード量を大きく削減することができる。 + +元の(この機能を使わない)実装に戻って、さらにコピーコンストラクタとムーブコンストラクタ、そしてコピー/ムーブ代入演算子についても同様に`T`のトリビアル性に応じて`default`とするかを切り替えることを考える。実装としてはデストラクタの時と同様に基底クラスにその判定と分岐を行うレイヤを追加して、そこで`T`の性質に応じた宣言(ユーザー定義/`default`定義)を記述していくことになるが、その総数はデストラクタのためのレイヤも含めて全5層に達し、実装はかなり複雑になる(このためここでは省略するが、この実装に興味がある場合、MSVC STLの[`xsmf_control.h`](https://github.com/microsoft/STL/blob/main/stl/inc/xsmf_control.h)およびこれを利用した`std::optional`/`std::variant`の実装が参考になると思われる)。 + +しかし、この機能を使用すると先ほどのデストラクタの場合と同様にそのような不要なレイヤを必要とすることなくシンプルに記述できる ```cpp example -// (ここには、言語機能の使い方を解説するための、サンプルコードを記述します。) -// (インクルードとmain()関数を含む、実行可能なサンプルコードを記述してください。そのようなコードブロックにはexampleタグを付けます。) +#include +#include + +template +class my_optional { + bool has_value = false; + union { + char dummy; + T data; + }; + +public: + + // デフォルトコンストラクタ + constexpr my_optional() + : has_value(false) + , dummy{} + {} + + // 値を受け取るコンストラクタ + template + constexpr my_optional(U&& v) + : has_value(true) + , data(std::forward(v)) + {} + + // トリビアルに定義できるならそうする + my_optional(const my_optional& that) requires std::is_trivially_copy_constructible_v = default; + my_optional(my_optional&& that) requires std::is_trivially_move_constructible_v = default; + my_optional& operator=(const my_optional& that) requires std::is_trivially_copy_assignable_v = default; + my_optional& operator=(my_optional&& that) requires std::is_trivially_move_assignable_v = default; + ~my_optional() requires std::is_trivially_destructible_v = default; + + + // そうでない場合はユーザー定義する + + my_optional(const my_optional& that) + : has_value(that.has_value) + , dummy{} + { + if (that.has_value) { + new (&this->data) T(that.data); + } + } -#include + my_optional(my_optional&& that) + : has_value(that.has_value) + , dummy{} + { + if (that.has_value) { + new (&this->data) T(std::move(that.data)); + } + } -int main() -{ - int variable = 0; - std::cout << variable << std::endl; + my_optional& operator=(const my_optional& that) { + auto copy = that; + *this = std::move(copy); + + return *this; + } + + my_optional& operator=(my_optional&& that) { + if (that.has_value) { + if (this->has_value) { + this->data = std::move(that.data); + } else { + new (&this->data) T(std::move(that.data)); + } + } else { + this->reset(); + } + + return *this; + } + + ~my_optional() { + this->reset(); + } + + // reset()の定義も同様の記法で分岐できる + + void reset() requires std::is_trivially_destructible_v { + this->has_value = false; + } + + void reset() { + if (this->has_value) { + this->data.~T(); + } + this->has_value = false; + } +}; + +int main() { + // int(全てのメンバ関数はトリビアル)の場合、my_optionalも同様になる + static_assert(std::is_trivially_destructible_v>); + static_assert(std::is_trivially_copy_constructible_v>); + static_assert(std::is_trivially_move_constructible_v>); + static_assert(std::is_trivially_copy_assignable_v>); + static_assert(std::is_trivially_move_assignable_v>); + + // std::string(全てのメンバ関数は非トリビアル)の場合、my_optionalも同様になる + static_assert(std::is_trivially_destructible_v> == false); + static_assert(std::is_trivially_copy_constructible_v> == false); + static_assert(std::is_trivially_move_constructible_v> == false); + static_assert(std::is_trivially_copy_assignable_v> == false); + static_assert(std::is_trivially_move_assignable_v> == false); + + // しかし、全ての特殊メンバ関数は利用可能(トリビアルでないだけ) + static_assert(std::is_destructible_v>); + static_assert(std::is_copy_constructible_v>); + static_assert(std::is_move_constructible_v>); + static_assert(std::is_copy_assignable_v>); + static_assert(std::is_move_assignable_v>); } ``` -* variable[color ff0000] ### 出力 ``` -0 ``` ## この機能が必要になった背景・経緯 From e44911377d9340e5f31ed3d125486bc1305c5a9c Mon Sep 17 00:00:00 2001 From: suomesta Date: Mon, 17 Feb 2025 21:01:10 +0900 Subject: [PATCH 1453/3948] add deduction guide with range to some containers. --- reference/deque/deque/op_deduction_guide.md | 16 ++++- .../forward_list/op_deduction_guide.md | 16 ++++- reference/list/list/op_constructor.md | 2 +- reference/list/list/op_deduction_guide.md | 16 ++++- reference/map/map/op_deduction_guide.md | 12 ++++ reference/map/multimap/op_deduction_guide.md | 12 ++++ .../priority_queue/op_deduction_guide.md | 60 ++++++++++++++++--- reference/queue/queue/op_deduction_guide.md | 35 ++++++++--- reference/set/multiset/op_deduction_guide.md | 12 +++- reference/set/set/op_deduction_guide.md | 8 +++ reference/stack/stack/op_deduction_guide.md | 45 ++++++++++---- .../string/basic_string/op_deduction_guide.md | 17 +++++- .../unordered_map/op_deduction_guide.md | 33 ++++++++++ .../unordered_multimap/op_deduction_guide.md | 33 ++++++++++ .../unordered_multiset/op_deduction_guide.md | 33 +++++++++- .../unordered_set/op_deduction_guide.md | 35 ++++++++++- reference/vector/vector/op_deduction_guide.md | 15 ++++- 17 files changed, 359 insertions(+), 41 deletions(-) diff --git a/reference/deque/deque/op_deduction_guide.md b/reference/deque/deque/op_deduction_guide.md index 3564d08ab8..2f223cdf39 100644 --- a/reference/deque/deque/op_deduction_guide.md +++ b/reference/deque/deque/op_deduction_guide.md @@ -9,13 +9,25 @@ namespace std { template ::value_type>> deque(InputIterator, InputIterator, Allocator = Allocator()) - -> deque::value_type, Allocator>; + -> deque::value_type, Allocator>; // (1) + + template >> + deque(from_range_t, R&&, Allocator = Allocator()) + -> deque, Allocator>; // (2) C++23から } ``` * iterator_traits[link /reference/iterator/iterator_traits.md] +* ranges::input_range[link /reference/ranges/input_range.md] +* allocator[link /reference/memory/allocator.md] +* ranges::range_value_t[link /reference/ranges/range_value_t.md] +* from_range_t[link /reference/ranges/from_range_t.md] ## 概要 -`std::deque`クラステンプレートの型推論補助。イテレータ範囲から推論する。 +`std::deque`クラステンプレートの型推論補助。 + +- (1) : イテレータ範囲から推論する。 +- (2) : Rangeから推論する。 ## 例 diff --git a/reference/forward_list/forward_list/op_deduction_guide.md b/reference/forward_list/forward_list/op_deduction_guide.md index 27df64fa37..b882d76664 100644 --- a/reference/forward_list/forward_list/op_deduction_guide.md +++ b/reference/forward_list/forward_list/op_deduction_guide.md @@ -9,13 +9,25 @@ namespace std { template ::value_type>> forward_list(InputIterator, InputIterator, Allocator = Allocator()) - -> forward_list::value_type, Allocator>; + -> forward_list::value_type, Allocator>; // (1) + + template >> + forward_list(from_range_t, R&&, Allocator = Allocator()) + -> forward_list, Allocator>; // (2) C++23から } ``` * iterator_traits[link /reference/iterator/iterator_traits.md] +* ranges::input_range[link /reference/ranges/input_range.md] +* allocator[link /reference/memory/allocator.md] +* ranges::range_value_t[link /reference/ranges/range_value_t.md] +* from_range_t[link /reference/ranges/from_range_t.md] ## 概要 -`std::forward_list`クラステンプレートの型推論補助。イテレータ範囲から推論する。 +`std::forward_list`クラステンプレートの型推論補助。 + +- (1) : イテレータ範囲から推論する。 +- (2) : Rangeから推論する。 ## 例 diff --git a/reference/list/list/op_constructor.md b/reference/list/list/op_constructor.md index a881629f41..4a50e7dca4 100644 --- a/reference/list/list/op_constructor.md +++ b/reference/list/list/op_constructor.md @@ -35,7 +35,7 @@ list(from_range_t, R&& rg, const Allocator& a = Allocator()); // (11) C++23 から ``` * initializer_list[link /reference/initializer_list/initializer_list.md] -* from_range_t[link ../../ranges/from_range_t.md] +* from_range_t[link /reference/ranges/from_range_t.md] ## 概要 diff --git a/reference/list/list/op_deduction_guide.md b/reference/list/list/op_deduction_guide.md index fe63d096d4..0a82481b30 100644 --- a/reference/list/list/op_deduction_guide.md +++ b/reference/list/list/op_deduction_guide.md @@ -9,13 +9,25 @@ namespace std { template ::value_type>> list(InputIterator, InputIterator, Allocator = Allocator()) - -> list::value_type, Allocator>; + -> list::value_type, Allocator>; // (1) + + template >> + list(from_range_t, R&&, Allocator = Allocator()) + -> list, Allocator>; // (2) C++23から } ``` * iterator_traits[link /reference/iterator/iterator_traits.md] +* ranges::input_range[link /reference/ranges/input_range.md] +* allocator[link /reference/memory/allocator.md] +* ranges::range_value_t[link /reference/ranges/range_value_t.md] +* from_range_t[link /reference/ranges/from_range_t.md] ## 概要 -`std::list`クラステンプレートの型推論補助。イテレータ範囲から推論する。 +`std::list`クラステンプレートの型推論補助。 + +- (1) : イテレータ範囲から推論する。 +- (2) : Rangeから推論する。 ## 例 diff --git a/reference/map/map/op_deduction_guide.md b/reference/map/map/op_deduction_guide.md index 8f7fefcef9..68c7d66b6f 100644 --- a/reference/map/map/op_deduction_guide.md +++ b/reference/map/map/op_deduction_guide.md @@ -14,6 +14,10 @@ namespace std { template using iter_to_alloc_t = pair::value_type::first_type>, typename iterator_traits::value_type::second_type>; + template + using range_key_t = remove_const_t::first_type>; + template + using range_val_t = typename ranges::range_value_t::second_type; template >, @@ -36,6 +40,10 @@ namespace std { template map(initializer_list>, Allocator) -> map, Allocator>; // (4) + + template + map(from_range_t, R&&, Allocator) + -> map, range_val_t, less>, Allocator>; // (5) C++23から } ``` * remove_const_t[link /reference/type_traits/remove_const.md] @@ -45,6 +53,9 @@ namespace std { * less[link /reference/functional/less.md] * allocator[link /reference/memory/allocator.md] * initializer_list[link /reference/initializer_list/initializer_list.md] +* ranges::input_range[link /reference/ranges/input_range.md] +* ranges::range_value_t[link /reference/ranges/range_value_t.md] +* from_range_t[link /reference/ranges/from_range_t.md] ## 概要 `std::map`クラステンプレートの型推論補助。 @@ -53,6 +64,7 @@ namespace std { - (2) : 初期化子リストからの推論 - (3) : イテレータ範囲とアロケータからの推論 - (4) : 初期化子リストとアロケータからの推論 +- (5) : Rangeからの推論 ## 備考 diff --git a/reference/map/multimap/op_deduction_guide.md b/reference/map/multimap/op_deduction_guide.md index f797ca0a05..03cb0ea04b 100644 --- a/reference/map/multimap/op_deduction_guide.md +++ b/reference/map/multimap/op_deduction_guide.md @@ -14,6 +14,10 @@ namespace std { template using iter_to_alloc_t = pair::value_type::first_type>, typename iterator_traits::value_type::second_type>; + template + using range_key_t = remove_const_t::first_type>; + template + using range_val_t = typename ranges::range_value_t::second_type; template >, @@ -36,6 +40,10 @@ namespace std { template multimap(initializer_list>, Allocator) -> multimap, Allocator>; // (4) + + template + multimap(from_range_t, R&&, Allocator) + -> multimap, range_val_t, less>, Allocator>; // (5) C++23から } ``` * remove_const_t[link /reference/type_traits/remove_const.md] @@ -45,6 +53,9 @@ namespace std { * less[link /reference/functional/less.md] * allocator[link /reference/memory/allocator.md] * initializer_list[link /reference/initializer_list/initializer_list.md] +* ranges::input_range[link /reference/ranges/input_range.md] +* ranges::range_value_t[link /reference/ranges/range_value_t.md] +* from_range_t[link /reference/ranges/from_range_t.md] ## 概要 `std::multimap`クラステンプレートの型推論補助。 @@ -53,6 +64,7 @@ namespace std { - (2) : 初期化子リストからの推論 - (3) : イテレータ範囲とアロケータからの推論 - (4) : 初期化子リストとアロケータからの推論 +- (5) : Rangeからの推論 ## 備考 diff --git a/reference/queue/priority_queue/op_deduction_guide.md b/reference/queue/priority_queue/op_deduction_guide.md index b9670980d3..90952debcf 100644 --- a/reference/queue/priority_queue/op_deduction_guide.md +++ b/reference/queue/priority_queue/op_deduction_guide.md @@ -6,32 +6,76 @@ ```cpp namespace std { - template + // 説明用の型 + template + using iter_val_t = typename iterator_traits::value_type; + +template priority_queue(Compare, Container) -> priority_queue; // (1) template ::value_type>, - class Container = std::vector::value_type>> + class Compare = less>, + class Container = std::vector>> priority_queue(InputIterator, InputIterator, Compare = Compare(), Container = Container()) - -> priority_queue< - typename iterator_traits::value_type, - Container, Compare>; // (2) + -> priority_queue, Container, Compare>; // (2) + + template >> + priority_queue(from_range_t, R&&, Compare = Compare()) + -> priority_queue, + vector>, Compare>; // (3) C++23から template priority_queue(Compare, Container, Allocator) - -> priority_queue; // (3) + -> priority_queue; // (4) + + template + priority_queue(InputIterator, InputIterator, Allocator) + -> priority_queue, + vector, Allocator>, + less>>; // (5) C++23から + + template + priority_queue(InputIterator, InputIterator, Compare, Allocator) + -> priority_queue, + vector, Allocator>, + Compare>; // (6) C++23から + + template + priority_queue(InputIterator, InputIterator, Compare, Container, Allocator) + -> priority_queue; // (7) C++23から + + template + priority_queue(from_range_t, R&&, Compare, Allocator) + -> priority_queue, + vector, Allocator>, + Compare>; // (8) C++23から + + template + priority_queue(from_range_t, R&&, Allocator) + -> priority_queue, + vector, Allocator>>; // (9) C++23から } ``` * iterator_traits[link /reference/iterator/iterator_traits.md] * less[link /reference/functional/less.md] +* vector[link /reference/vector/vector.md] +* ranges::input_range[link /reference/ranges/input_range.md] +* ranges::range_value_t[link /reference/ranges/range_value_t.md] +* from_range_t[link /reference/ranges/from_range_t.md] ## 概要 `std::priority_queue`クラステンプレートの型推論補助。 - (1) : 比較関数オブジェクトと、元となるコンテナから推論する - (2) : イテレータ範囲、比較関数オブジェクト、元となるコンテナから推論する -- (3) : 比較関数オブジェクトと、元となるコンテナ、アロケータから推論する +- (3) : Rangeと比較関数オブジェクトから推論する +- (4) : 比較関数オブジェクトと、元となるコンテナ、アロケータから推論する +- (5) : イテレータ範囲とアロケータから推論する +- (6) : イテレータ範囲、比較関数オブジェクト、アロケータから推論する +- (7) : イテレータ範囲、比較関数オブジェクト、元となるコンテナ、アロケータから推論する +- (8) : Range、比較関数オブジェクト、元となるコンテナから推論する +- (9) : Rangeとアロケータから推論する ## 例 diff --git a/reference/queue/queue/op_deduction_guide.md b/reference/queue/queue/op_deduction_guide.md index 0d2a04eb52..fc38ce5143 100644 --- a/reference/queue/queue/op_deduction_guide.md +++ b/reference/queue/queue/op_deduction_guide.md @@ -8,26 +8,47 @@ namespace std { template queue(Container) - -> queue; // (1) + -> queue; // (1) - template + template queue(InputIterator, InputIterator) - -> queue<>; // (2) C++23 + -> queue<>; // (2) C++23 + + template + queue(from_range_t, R&&) -> queue>; // (3) C++23 + template queue(Container, Allocator) - -> queue; // (3) + -> queue; // (4) - template + template queue(InputIterator, InputIterator, Allocator) -> queue, deque, - Allocator>>; // (4) C++23 + Allocator>>; // (5) C++23 + + template + queue(from_range_t, R&&, Allocator) + -> queue, deque, + Allocator>>; // (6) C++23 + } ``` * iter-value-type[italic] +* deque[link /reference/deque/deque.md] +* ranges::input_range[link /reference/ranges/input_range.md] +* ranges::range_value_t[link /reference/ranges/range_value_t.md] +* from_range_t[link /reference/ranges/from_range_t.md] ## 概要 -`std::queue`クラステンプレートの型推論補助。元となるコンテナから推論する。 +`std::queue`クラステンプレートの型推論補助。 + +- (1) : 元となるコンテナから推論する。 +- (2) : イテレータ範囲から推論する。 +- (3) : Rangeからの推論する。 +- (4) : 元となるコンテナとアロケータから推論する。 +- (5) : イテレータ範囲とアロケータから推論する。 +- (6) : Rangeとアロケータからの推論する。 ## 例 diff --git a/reference/set/multiset/op_deduction_guide.md b/reference/set/multiset/op_deduction_guide.md index 4d8206c7d6..5b27246005 100644 --- a/reference/set/multiset/op_deduction_guide.md +++ b/reference/set/multiset/op_deduction_guide.md @@ -20,16 +20,23 @@ namespace std { template multiset(InputIterator, InputIterator, Allocator) -> multiset::value_type, - less::value_type>, Allocator>; // (3) + less::value_type>, Allocator>; // (3) template - multiset(initializer_list, Allocator) -> multiset, Allocator>; // (4) + multiset(initializer_list, Allocator) -> multiset, Allocator>; // (4) + + template + multiset(from_range_t, R&&, Allocator) + -> multiset, less>, Allocator>; // (5) C++23から } ``` * less[link /reference/functional/less.md] * iterator_traits[link /reference/iterator/iterator_traits.md] * allocator[link /reference/memory/allocator.md] * initializer_list[link /reference/initializer_list/initializer_list.md] +* ranges::input_range[link /reference/ranges/input_range.md] +* ranges::range_value_t[link /reference/ranges/range_value_t.md] +* from_range_t[link /reference/ranges/from_range_t.md] ## 概要 `std::multiset`クラステンプレートの型推論補助。 @@ -38,6 +45,7 @@ namespace std { - (2) : 初期化子リストと比較関数オブジェクトからの推論 - (3) : イテレータ範囲とアロケータからの推論 - (4) : 初期化子リストとアロケータからの推論 +- (5) : Rangeからの推論 ## 例 diff --git a/reference/set/set/op_deduction_guide.md b/reference/set/set/op_deduction_guide.md index 4c65d0e3d0..7a13e38008 100644 --- a/reference/set/set/op_deduction_guide.md +++ b/reference/set/set/op_deduction_guide.md @@ -24,12 +24,19 @@ namespace std { template set(initializer_list, Allocator) -> set, Allocator>; // (4) + + template + set(from_range_t, R&&, Allocator) + -> set, less>, Allocator>; // (5) C++23から } ``` * less[link /reference/functional/less.md] * iterator_traits[link /reference/iterator/iterator_traits.md] * allocator[link /reference/memory/allocator.md] * initializer_list[link /reference/initializer_list/initializer_list.md] +* ranges::input_range[link /reference/ranges/input_range.md] +* ranges::range_value_t[link /reference/ranges/range_value_t.md] +* from_range_t[link /reference/ranges/from_range_t.md] ## 概要 `std::set`クラステンプレートの型推論補助。 @@ -38,6 +45,7 @@ namespace std { - (2) : 初期化子リストと比較関数オブジェクトからの推論 - (3) : イテレータ範囲とアロケータからの推論 - (4) : 初期化子リストとアロケータからの推論 +- (5) : Rangeからの推論 ## 例 diff --git a/reference/stack/stack/op_deduction_guide.md b/reference/stack/stack/op_deduction_guide.md index 53fd601ae2..62c8ae8753 100644 --- a/reference/stack/stack/op_deduction_guide.md +++ b/reference/stack/stack/op_deduction_guide.md @@ -6,28 +6,51 @@ ```cpp namespace std { - template + // 説明用の型 + template + using iter_val_t = typename iterator_traits::value_type; + + template stack(Container) - -> stack; // (1) + -> stack; // (1) - template + template stack(InputIterator, InputIterator) - -> stack>; // (2) C++23 + -> stack>; // (2) C++23から + + template + stack(from_range_t, R&&)-> stack>; // (3) C++23から - template + template stack(Container, Allocator) - -> stack; // (3) + -> stack; // (4) - template + template stack(InputIterator, InputIterator, Allocator) - -> stack, deque, - Allocator>>; // (4) C++23 + -> stack, deque, + Allocator>>; // (5) C++23から + + template + stack(from_range_t, R&&, Allocator) + -> stack, deque, + Allocator>>; // (6) C++23から } ``` -* iter-value-type[italic] +* iterator_traits[link /reference/iterator/iterator_traits.md] +* deque[link /reference/deque/deque.md] +* ranges::input_range[link /reference/ranges/input_range.md] +* ranges::range_value_t[link /reference/ranges/range_value_t.md] +* from_range_t[link /reference/ranges/from_range_t.md] ## 概要 -`std::stack`クラステンプレートの型推論補助。元となるコンテナから推論する。 +`std::stack`クラステンプレートの型推論補助。 + +- (1) : 元となるコンテナから推論する。 +- (2) : イテレータ範囲から推論する。 +- (3) : Rangeからの推論する。 +- (4) : 元となるコンテナとアロケータから推論する。 +- (5) : イテレータ範囲とアロケータから推論する。 +- (6) : Rangeとアロケータからの推論する。 ## 例 diff --git a/reference/string/basic_string/op_deduction_guide.md b/reference/string/basic_string/op_deduction_guide.md index cda97ea537..5e23053fd0 100644 --- a/reference/string/basic_string/op_deduction_guide.md +++ b/reference/string/basic_string/op_deduction_guide.md @@ -27,6 +27,13 @@ namespace std { typename see below::size_type, const Allocator& = Allocator()) -> basic_string; // (3) C++20 + + template >> + basic_string(from_range_t, R&&, Allocator = Allocator()) + -> basic_string, + char_traits>, + Allocator>; // (4) C++23 } ``` * see below[italic] @@ -34,9 +41,17 @@ namespace std { * iterator_traits[link /reference/iterator/iterator_traits.md] * char_traits[link /reference/string/char_traits.md] * basic_string_view[link /reference/string_view/basic_string_view.md] +* ranges::input_range[link /reference/ranges/input_range.md] +* ranges::range_value_t[link /reference/ranges/range_value_t.md] +* from_range_t[link /reference/ranges/from_range_t.md] ## 概要 -`std::basic_string`クラステンプレートの型推論補助。イテレータ範囲から推論する。 +`std::basic_string`クラステンプレートの型推論補助。 + +- (1) : イテレータ範囲からの推論 +- (2) : string_viewからの推論 +- (3) : string_viewとpos, countからの推論 +- (4) : Rangeからの推論 ## 備考 diff --git a/reference/unordered_map/unordered_map/op_deduction_guide.md b/reference/unordered_map/unordered_map/op_deduction_guide.md index 5378eadbab..f31caaceeb 100644 --- a/reference/unordered_map/unordered_map/op_deduction_guide.md +++ b/reference/unordered_map/unordered_map/op_deduction_guide.md @@ -14,6 +14,10 @@ namespace std { template using iter_to_alloc_t = pair::value_type::first_type>, typename iterator_traits::value_type::second_type>; + template + using range_key_t = remove_const_t::first_type>; + template + using range_val_t = typename ranges::range_value_t::second_type; template >, @@ -75,6 +79,28 @@ namespace std { unordered_map(initializer_list>, typename see below::size_type, Hash, Allocator) -> unordered_map, Allocator>; // (8) + + template >, + class Pred = equal_to>, + class Allocator = allocator>> + unordered_map(from_range_t, R&&, typename see below::size_type = see below, + Hash = Hash(), Pred = Pred(), Allocator = Allocator()) + -> unordered_map, range_val_t, Hash, Pred, Allocator>; // (9) C++23から + + template + unordered_map(from_range_t, R&&, typename see below::size_type, Allocator) + -> unordered_map, range_val_t, hash>, + equal_to>, Allocator>; // (10) C++23から + + template + unordered_map(from_range_t, R&&, Allocator) + -> unordered_map, range_val_t, hash>, + equal_to>, Allocator>; // (11) C++23から + + template + unordered_map(from_range_t, R&&, typename see below::size_type, Hash, Allocator) + -> unordered_map, range_val_t, Hash, + equal_to>, Allocator>; // (12) C++23から } ``` * see below[italic] @@ -86,6 +112,9 @@ namespace std { * equal_to[link /reference/functional/equal_to.md] * allocator[link /reference/memory/allocator.md] * initializer_list[link /reference/initializer_list/initializer_list.md] +* ranges::input_range[link /reference/ranges/input_range.md] +* ranges::range_value_t[link /reference/ranges/range_value_t.md] +* from_range_t[link /reference/ranges/from_range_t.md] ## 概要 `std::unordered_map`クラステンプレートの型推論補助。 @@ -98,6 +127,10 @@ namespace std { - (6) : 初期化子リストとバケット数、アロケータからの推論 - (7) : 初期化子リストとアロケータからの推論 - (8) : 初期化子リストとバケット数、ハッシュ関数、アロケータからの推論 +- (9) : Rangeからの推論 +- (10) : Rangeとバケット数、アロケータからの推論 +- (11) : Rangeとアロケータからの推論 +- (12) : Rangeとバケット数、ハッシュ関数、アロケータからの推論 ## 備考 diff --git a/reference/unordered_map/unordered_multimap/op_deduction_guide.md b/reference/unordered_map/unordered_multimap/op_deduction_guide.md index 3091f49eb2..78ec0c7e68 100644 --- a/reference/unordered_map/unordered_multimap/op_deduction_guide.md +++ b/reference/unordered_map/unordered_multimap/op_deduction_guide.md @@ -14,6 +14,10 @@ namespace std { template using iter_to_alloc_t = pair::value_type::first_type>, typename iterator_traits::value_type::second_type>; + template + using range_key_t = remove_const_t::first_type>; + template + using range_val_t = typename ranges::range_value_t::second_type; template >, @@ -75,6 +79,28 @@ namespace std { unordered_multimap(initializer_list>, typename see below::size_type, Hash, Allocator) -> unordered_multimap, Allocator>; // (8) + + template >, + class Pred = equal_to>, + class Allocator = allocator>> + unordered_multimap(from_range_t, R&&, typename see below::size_type = see below, + Hash = Hash(), Pred = Pred(), Allocator = Allocator()) + -> unordered_multimap, range_val_t, Hash, Pred, Allocator>; // (9) C++23から + + template + unordered_multimap(from_range_t, R&&, typename see below::size_type, Allocator) + -> unordered_multimap, range_val_t, hash>, + equal_to>, Allocator>; // (10) C++23から + + template + unordered_multimap(from_range_t, R&&, Allocator) + -> unordered_multimap, range_val_t, hash>, + equal_to>, Allocator>; // (11) C++23から + + template + unordered_multimap(from_range_t, R&&, typename see below::size_type, Hash, Allocator) + -> unordered_multimap, range_val_t, Hash, + equal_to>, Allocator>; // (12) C++23から } ``` * see below[italic] @@ -86,6 +112,9 @@ namespace std { * equal_to[link /reference/functional/equal_to.md] * allocator[link /reference/memory/allocator.md] * initializer_list[link /reference/initializer_list/initializer_list.md] +* ranges::input_range[link /reference/ranges/input_range.md] +* ranges::range_value_t[link /reference/ranges/range_value_t.md] +* from_range_t[link /reference/ranges/from_range_t.md] ## 概要 `std::unordered_multimap`クラステンプレートの型推論補助。 @@ -98,6 +127,10 @@ namespace std { - (6) : 初期化子リストとバケット数、アロケータからの推論 - (7) : 初期化子リストとアロケータからの推論 - (8) : 初期化子リストとバケット数、ハッシュ関数、アロケータからの推論 +- (9) : Rangeからの推論 +- (10) : Rangeとバケット数、アロケータからの推論 +- (11) : Rangeとアロケータからの推論 +- (12) : Rangeとバケット数、ハッシュ関数、アロケータからの推論 ## 備考 diff --git a/reference/unordered_set/unordered_multiset/op_deduction_guide.md b/reference/unordered_set/unordered_multiset/op_deduction_guide.md index d572ad8573..3e31c623aa 100644 --- a/reference/unordered_set/unordered_multiset/op_deduction_guide.md +++ b/reference/unordered_set/unordered_multiset/op_deduction_guide.md @@ -46,6 +46,29 @@ namespace std { unordered_multiset(initializer_list, typename see below::size_type, Hash, Allocator) -> unordered_multiset, Allocator>; // (6) + + template >, + class Pred = equal_to>, + class Allocator = allocator>> + unordered_multiset(from_range_t, R&&, typename see below::size_type = see below, + Hash = Hash(), Pred = Pred(), Allocator = Allocator()) + -> unordered_multiset, Hash, Pred, Allocator>; // (7) C++23から + + template + unordered_multiset(from_range_t, R&&, typename see below::size_type, Allocator) + -> unordered_multiset, hash>, + equal_to>, Allocator>; // (8) C++23から + + template + unordered_multiset(from_range_t, R&&, Allocator) + -> unordered_multiset, hash>, + equal_to>, Allocator>; // (9) C++23から + + template + unordered_multiset(from_range_t, R&&, typename see below::size_type, Hash, Allocator) + -> unordered_multiset, Hash, + equal_to>, Allocator>; // (10) C++23から } ``` * see below[italic] @@ -54,15 +77,23 @@ namespace std { * iterator_traits[link /reference/iterator/iterator_traits.md] * allocator[link /reference/memory/allocator.md] * initializer_list[link /reference/initializer_list/initializer_list.md] +* ranges::input_range[link /reference/ranges/input_range.md] +* ranges::range_value_t[link /reference/ranges/range_value_t.md] +* from_range_t[link /reference/ranges/from_range_t.md] ## 概要 `std::unordered_multiset`クラステンプレートの型推論補助。 - (1) : イテレータ範囲からの推論 -- (2) : 初期化子リスト、ハッシュ関数、比較関数オブジェクトからの推論 +- (2) : 初期化子リストからの推論 - (3) : イテレータ範囲とアロケータからの推論 - (4) : イテレータ範囲、ハッシュ関数、アロケータからの推論 - (5) : 初期化子リストとアロケータからの推論 +- (6) : 初期化子リスト、ハッシュ関数、アロケータからの推論 +- (7) : Rangeからの推論 +- (8) : Rangeとアロケータからの推論 +- (9) : Rangeとハッシュ関数からの推論 +- (10) : Range、ハッシュ関数、アロケータからの推論 ## 備考 diff --git a/reference/unordered_set/unordered_set/op_deduction_guide.md b/reference/unordered_set/unordered_set/op_deduction_guide.md index d945823248..e5689e2033 100644 --- a/reference/unordered_set/unordered_set/op_deduction_guide.md +++ b/reference/unordered_set/unordered_set/op_deduction_guide.md @@ -39,9 +39,32 @@ namespace std { unordered_set(initializer_list, typename see below::size_type, Allocator) -> unordered_set, equal_to, Allocator>; // (5) - template + template unordered_set(initializer_list, typename see below::size_type, Hash, Allocator) -> unordered_set, Allocator>; // (6) + + template >, + class Pred = equal_to>, + class Allocator = allocator>> + unordered_set(from_range_t, R&&, typename see below::size_type = see below, + Hash = Hash(), Pred = Pred(), Allocator = Allocator()) + -> unordered_set, Hash, Pred, Allocator>; // (7) C++23から + + template + unordered_set(from_range_t, R&&, typename see below::size_type, Allocator) + -> unordered_set, hash>, + equal_to>, Allocator>; // (8) C++23から + + template + unordered_set(from_range_t, R&&, Allocator) + -> unordered_set, hash>, + equal_to>, Allocator>; // (9) C++23から + + template + unordered_set(from_range_t, R&&, typename see below::size_type, Hash, Allocator) + -> unordered_set, Hash, + equal_to>, Allocator>; // (10) C++23から } ``` * see below[italic] @@ -50,15 +73,23 @@ namespace std { * iterator_traits[link /reference/iterator/iterator_traits.md] * allocator[link /reference/memory/allocator.md] * initializer_list[link /reference/initializer_list/initializer_list.md] +* ranges::input_range[link /reference/ranges/input_range.md] +* ranges::range_value_t[link /reference/ranges/range_value_t.md] +* from_range_t[link /reference/ranges/from_range_t.md] ## 概要 `std::unordered_set`クラステンプレートの型推論補助。 - (1) : イテレータ範囲からの推論 -- (2) : 初期化子リスト、ハッシュ関数、比較関数オブジェクトからの推論 +- (2) : 初期化子リストからの推論 - (3) : イテレータ範囲とアロケータからの推論 - (4) : イテレータ範囲、ハッシュ関数、アロケータからの推論 - (5) : 初期化子リストとアロケータからの推論 +- (6) : 初期化子リスト、ハッシュ関数、アロケータからの推論 +- (7) : Rangeからの推論 +- (8) : Rangeとアロケータからの推論 +- (9) : Rangeとハッシュ関数からの推論 +- (10) : Range、ハッシュ関数、アロケータからの推論 ## 備考 diff --git a/reference/vector/vector/op_deduction_guide.md b/reference/vector/vector/op_deduction_guide.md index f935a13e9c..1276d700c0 100644 --- a/reference/vector/vector/op_deduction_guide.md +++ b/reference/vector/vector/op_deduction_guide.md @@ -9,13 +9,24 @@ namespace std { template ::value_type>> vector(InputIterator, InputIterator, Allocator = Allocator()) - -> vector::value_type, Allocator>; + -> vector::value_type, Allocator>; // (1) } + + template >> + vector(from_range_t, R&&, Allocator = Allocator()) + -> vector, Allocator>; // (2) C++23から ``` * iterator_traits[link /reference/iterator/iterator_traits.md] +* ranges::input_range[link /reference/ranges/input_range.md] +* allocator[link /reference/memory/allocator.md] +* ranges::range_value_t[link /reference/ranges/range_value_t.md] +* from_range_t[link /reference/ranges/from_range_t.md] ## 概要 -`std::vector`クラステンプレートの型推論補助。イテレータ範囲から推論する。 +`std::vector`クラステンプレートの型推論補助。 + +- (1) : イテレータ範囲から推論する。 +- (2) : Rangeから推論する。 ## 例 From 50250aec626a8d887e6730af931cf2e46512d67d Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 18 Feb 2025 15:42:56 +0900 Subject: [PATCH 1454/3948] =?UTF-8?q?C++20:=20=E6=8F=90=E6=A1=88=E6=96=87?= =?UTF-8?q?=E6=9B=B8=E3=81=AE=E7=95=AA=E5=8F=B7=E3=82=92=E3=82=BF=E3=82=A4?= =?UTF-8?q?=E3=83=88=E3=83=AB=E3=81=AB=E8=A8=98=E8=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp20/conditionally_trivial_special_member_functions.md | 2 +- ...cit_creation_of_objects_for_low-level_object_manipulation.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/cpp20/conditionally_trivial_special_member_functions.md b/lang/cpp20/conditionally_trivial_special_member_functions.md index 7a305b64c4..6a4cd44e50 100644 --- a/lang/cpp20/conditionally_trivial_special_member_functions.md +++ b/lang/cpp20/conditionally_trivial_special_member_functions.md @@ -1,4 +1,4 @@ -# 条件付きで特殊メンバ関数をトリビアルに定義するように +# 条件付きで特殊メンバ関数をトリビアルに定義するように [P0848R3] * cpp20[meta cpp] このページはC++20に採用された言語機能の変更を解説しています。 diff --git a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md index 37bd5f5bf8..4f19a53d9e 100644 --- a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md +++ b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md @@ -1,4 +1,4 @@ -# 未初期化領域への暗黙的なオブジェクト構築 +# 未初期化領域への暗黙的なオブジェクト構築 [P0593R6] * cpp20[meta cpp] From cce034a5cd5372fb36a549fc6b134a340b1482f3 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 18 Feb 2025 15:43:46 +0900 Subject: [PATCH 1455/3948] =?UTF-8?q?=E8=A6=8B=E5=87=BA=E3=81=97=E3=81=AE?= =?UTF-8?q?=E8=A1=A8=E7=A4=BA=E5=B4=A9=E3=82=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp20/conditionally_trivial_special_member_functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp20/conditionally_trivial_special_member_functions.md b/lang/cpp20/conditionally_trivial_special_member_functions.md index 6a4cd44e50..e33bd76fa4 100644 --- a/lang/cpp20/conditionally_trivial_special_member_functions.md +++ b/lang/cpp20/conditionally_trivial_special_member_functions.md @@ -287,7 +287,7 @@ C++20のコンセプトの導入によって、コンセプトによって特殊 この機能は、C++23の`std::expceted`の実装で活用されるだろう。 -## ## 関連項目 +## 関連項目 - [コンセプト](./concepts.md) From 7a572ea68617b61516b1e1820b42c813d103ca73 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 18 Feb 2025 15:53:36 +0900 Subject: [PATCH 1456/3948] =?UTF-8?q?C++20=20/=20C++23=20:=20=E3=83=9A?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=82=BF=E3=82=A4=E3=83=88=E3=83=AB=E3=81=AB?= =?UTF-8?q?=E6=8F=90=E6=A1=88=E6=96=87=E6=9B=B8=E3=81=AE=E7=95=AA=E5=8F=B7?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp20/nodiscard_for_constructors.md | 4 ++-- .../remove_deprecated_nothrow_exception_specification.md | 4 ++-- lang/cpp20/reserving_attribute_namespaces_for_future_use.md | 4 ++-- lang/cpp20/update_the_reference_to_the_unicode_standard.md | 4 ++-- lang/cpp23/update_normative_reference_to_posix.md | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lang/cpp20/nodiscard_for_constructors.md b/lang/cpp20/nodiscard_for_constructors.md index bd3a0a9799..4fe7d31837 100644 --- a/lang/cpp20/nodiscard_for_constructors.md +++ b/lang/cpp20/nodiscard_for_constructors.md @@ -1,4 +1,4 @@ -# [[nodiscard]]をコンストラクタのオーバーロードごとに付加できるようにする +# [[nodiscard]]をコンストラクタのオーバーロードごとに付加できるようにする [P1771R1] * cpp20[meta cpp] @@ -64,4 +64,4 @@ prog.cc:11:12: note: declared here ## 参照 -- [P1771R1 `[[nodiscard]]` for constructors](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1771r1.pdf) \ No newline at end of file +- [P1771R1 `[[nodiscard]]` for constructors](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1771r1.pdf) diff --git a/lang/cpp20/remove_deprecated_nothrow_exception_specification.md b/lang/cpp20/remove_deprecated_nothrow_exception_specification.md index 088f25b9a6..bd7edaa94c 100644 --- a/lang/cpp20/remove_deprecated_nothrow_exception_specification.md +++ b/lang/cpp20/remove_deprecated_nothrow_exception_specification.md @@ -1,4 +1,4 @@ -# throw()による例外送出しない指定を削除 +# throw()による例外送出しない指定を削除 [P0619R4] * cpp20[meta cpp] @@ -27,4 +27,4 @@ C++20では、非推奨とされていた`throw()`指定の機能を削除する ## 参照 -- [P0619R4 Reviewing Deprecated Facilities of C++17 for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0619r4.html) \ No newline at end of file +- [P0619R4 Reviewing Deprecated Facilities of C++17 for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0619r4.html) diff --git a/lang/cpp20/reserving_attribute_namespaces_for_future_use.md b/lang/cpp20/reserving_attribute_namespaces_for_future_use.md index fdaead292c..b72b51933e 100644 --- a/lang/cpp20/reserving_attribute_namespaces_for_future_use.md +++ b/lang/cpp20/reserving_attribute_namespaces_for_future_use.md @@ -1,4 +1,4 @@ -# 属性の名前空間を予約 +# 属性の名前空間を予約 [P1908R1] * cpp20[meta cpp] @@ -20,4 +20,4 @@ - [C++11 属性構文](/lang/cpp11/attributes.md) ## 参照 -- [P1908R1 Reserving Attribute Namespaces for Future Use](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1908r1.pdf) \ No newline at end of file +- [P1908R1 Reserving Attribute Namespaces for Future Use](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1908r1.pdf) diff --git a/lang/cpp20/update_the_reference_to_the_unicode_standard.md b/lang/cpp20/update_the_reference_to_the_unicode_standard.md index c4368c534c..9d42abec87 100644 --- a/lang/cpp20/update_the_reference_to_the_unicode_standard.md +++ b/lang/cpp20/update_the_reference_to_the_unicode_standard.md @@ -1,4 +1,4 @@ -# Unicode標準への参照を更新 +# Unicode標準への参照を更新 [P1025R1] * cpp20[meta cpp] @@ -31,4 +31,4 @@ Unicode標準での用語定義が変更されたことにも影響がある。U ## 参照 -- [P1025R1 Update The Reference To The Unicode Standard](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1025r1.html) \ No newline at end of file +- [P1025R1 Update The Reference To The Unicode Standard](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1025r1.html) diff --git a/lang/cpp23/update_normative_reference_to_posix.md b/lang/cpp23/update_normative_reference_to_posix.md index 605bdfc9d1..fba43b1f19 100644 --- a/lang/cpp23/update_normative_reference_to_posix.md +++ b/lang/cpp23/update_normative_reference_to_posix.md @@ -1,4 +1,4 @@ -# 参照するPOSIX規格を更新 +# 参照するPOSIX規格を更新 [P2227R0] * cpp23[meta cpp] @@ -47,4 +47,4 @@ POSIX.1-2001のスレッドセーフ関数 (Thread-Safe Functions : TSF) オプ ## 参照 -- [P2227R0 Update normative reference to POSIX](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2227r0.html) \ No newline at end of file +- [P2227R0 Update normative reference to POSIX](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2227r0.html) From 816853121ff41b05699b3edb3ec38c95cce82db5 Mon Sep 17 00:00:00 2001 From: suomesta Date: Tue, 18 Feb 2025 20:11:13 +0900 Subject: [PATCH 1457/3948] fix sample in flat_multiset --- reference/flat_set/flat_multiset/contains.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/flat_set/flat_multiset/contains.md b/reference/flat_set/flat_multiset/contains.md index 48e2daa1ac..3bc4296001 100644 --- a/reference/flat_set/flat_multiset/contains.md +++ b/reference/flat_set/flat_multiset/contains.md @@ -51,7 +51,7 @@ return find(x) != end(); int main() { - std::flat_set fs = {3, 1, 4, 1}; + std::flat_multiset fs = {3, 1, 4, 1}; // キー3の要素が含まれているか if (fs.contains(3)) { From 15399cae51a375371e61af1eae0426b72ada8a84 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 26 Feb 2025 17:06:54 +0900 Subject: [PATCH 1458/3948] =?UTF-8?q?C++20=20=E9=9D=9E=E5=9E=8B=E3=83=86?= =?UTF-8?q?=E3=83=B3=E3=83=97=E3=83=AC=E3=83=BC=E3=83=88=E3=83=91=E3=83=A9?= =?UTF-8?q?=E3=83=A1=E3=83=BC=E3=82=BF=E3=81=A8=E3=81=97=E3=81=A6=E3=82=AF?= =?UTF-8?q?=E3=83=A9=E3=82=B9=E5=9E=8B=E3=82=92=E8=A8=B1=E5=8F=AF=E3=81=99?= =?UTF-8?q?=E3=82=8B=20:=20=E3=83=97=E3=83=AC=E3=83=BC=E3=82=B9=E3=83=9B?= =?UTF-8?q?=E3=83=AB=E3=83=80=E3=83=BC=E5=9E=8B=E3=81=A8=E3=83=AA=E3=83=86?= =?UTF-8?q?=E3=83=A9=E3=83=AB=E6=BC=94=E7=AE=97=E5=AD=90=E3=81=AE=E4=BE=8B?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/cpprefjp/site/issues/1273#issuecomment-2646378059 --- GLOBAL_QUALIFY_LIST.txt | 1 + ...s_types_in_non-type_template_parameters.md | 74 ++++++++++++++++++- 2 files changed, 73 insertions(+), 2 deletions(-) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index e86ce2b441..d199d94e0f 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -9,6 +9,7 @@ * [link /reference/algorithm.md] * ExecutionPolicy[link /reference/execution/execution/execution_policy.md] * std::copy[link /reference/algorithm/copy.md] + * std::copy_n[link /reference/algorithm/copy_n.md] * std::for_each[link /reference/algorithm/for_each.md] * std::sort[link /reference/algorithm/sort.md] * [link /reference/any.md] diff --git a/lang/cpp20/class_types_in_non-type_template_parameters.md b/lang/cpp20/class_types_in_non-type_template_parameters.md index 743d86a476..0758e8aaef 100644 --- a/lang/cpp20/class_types_in_non-type_template_parameters.md +++ b/lang/cpp20/class_types_in_non-type_template_parameters.md @@ -44,6 +44,7 @@ C++11以降での[汎用的な定数式`constexpr`](/lang/cpp11/constexpr.md)の ## 例 +### floatやクラス型を非型テンプレートパラメータにする例 ```cpp example #include @@ -105,10 +106,79 @@ int main() { } ``` -### 出力 +#### 出力 ``` ``` +### プレースホルダーを含む型を非型テンプレートパラメータにする例 +```cpp example +#include + +template +struct X { + constexpr X(T x) : value(x) {} + T value; +}; + +template +struct Y { + void print() { + std::cout << x.value << std::endl; + } +}; + +int main() { + // Xクラステンプレートのテンプレートパラメータが + // コンストラクタ引数`3`から推論される + Y<3>{}.print(); +} +``` + +#### 出力 +``` +3 +``` + + +### 文字列クラスオブジェクトを非型テンプレートパラメータにしてリテラル演算子を定義する例 +```cpp example +#include +#include + +template +struct basic_fixed_string { + constexpr basic_fixed_string(const CharT (&str)[N+1]) + { std::copy_n(str, N+1, data); } + + friend auto operator<=>(const basic_fixed_string&, const basic_fixed_string&) = default; + CharT data[N+1]; +}; + +template +basic_fixed_string(const CharT (&str)[N]) -> basic_fixed_string; + +template +using fixed_string = basic_fixed_string; + +namespace my_literals { +template +auto operator""_udl() { + return str; +} +} + +int main() { + using namespace my_literals; + auto s = "hello"_udl; + std::cout << s.data << std::endl; +} +``` + +#### 出力 +``` +hello +``` + ## 備考 - [Bug 97930 - `pair` is not a structural type](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97930) @@ -121,4 +191,4 @@ int main() { ## 参照 - [P0732R2 Class Types in Non-Type Template Parameters](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0732r2.pdf) -- [P1907R1 Inconsistencies with non-type template parameters](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1907r1.html) \ No newline at end of file +- [P1907R1 Inconsistencies with non-type template parameters](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1907r1.html) From debf1bdfac8b42c2c830e2900ab882489c98d9ee Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 27 Feb 2025 15:55:09 +0900 Subject: [PATCH 1459/3948] =?UTF-8?q?C++26=E5=AF=BE=E5=BF=9C=E3=81=A8?= =?UTF-8?q?=E3=81=97=E3=81=A6=E3=80=81=E6=A8=99=E6=BA=96=E3=83=A9=E3=82=A4?= =?UTF-8?q?=E3=83=96=E3=83=A9=E3=83=AA=E3=81=AEnodiscard=E6=8C=87=E5=AE=9A?= =?UTF-8?q?=E3=82=92=E5=89=8A=E9=99=A4=20(close=20#1386)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/array/array/empty.md | 4 +++ reference/barrier/barrier/arrive.md | 9 +++++- reference/bit/rotl.md | 7 ++++- reference/bit/rotr.md | 7 ++++- reference/deque/deque/empty.md | 4 +++ reference/filesystem/path/empty.md | 4 +++ reference/forward_list/forward_list/empty.md | 4 +++ reference/future/async.md | 19 +++++++----- reference/iterator/empty.md | 12 ++++++-- reference/list/list/empty.md | 4 +++ reference/map/map/empty.md | 4 +++ reference/map/multimap/empty.md | 4 +++ reference/memory/allocator/allocate.md | 9 ++++-- reference/memory/allocator_traits/allocate.md | 29 ++++++++++++++----- .../allocator_traits/allocate_at_least.md | 8 ++++- reference/memory/assume_aligned.md | 10 +++++-- .../memory_resource/allocate.md | 5 +++- .../polymorphic_allocator/allocate.md | 4 +++ .../polymorphic_allocator/allocate_bytes.md | 10 +++++-- .../polymorphic_allocator/allocate_object.md | 8 +++-- .../polymorphic_allocator/new_object.md | 7 ++++- reference/new/launder.md | 13 ++++++--- reference/new/op_new.md | 19 ++++++++++-- reference/new/op_new[].md | 12 ++++++++ reference/node_handle/node_handle/empty.md | 6 +++- reference/queue/priority_queue/empty.md | 4 +++ reference/queue/queue/empty.md | 4 +++ reference/ranges/subrange/begin.md | 7 +++-- reference/ranges/subrange/next.md | 21 ++++++++++---- reference/ranges/subrange/prev.md | 11 +++++-- reference/regex/match_results/empty.md | 8 +++-- .../scoped_allocator_adaptor/allocate.md | 21 ++++++++++---- reference/set/multiset/empty.md | 4 +++ reference/set/set/empty.md | 4 +++ reference/span/span/empty.md | 8 ++++- reference/stack/stack/empty.md | 4 +++ .../stacktrace/basic_stacktrace/empty.md | 6 ++++ reference/stop_token/stop_source/get_token.md | 8 ++++- reference/stop_token/stop_source/op_equal.md | 12 +++++++- .../stop_token/stop_source/stop_possible.md | 8 ++++- .../stop_token/stop_source/stop_requested.md | 8 +++-- reference/stop_token/stop_token/op_equal.md | 12 +++++++- .../stop_token/stop_token/stop_possible.md | 8 ++++- .../stop_token/stop_token/stop_requested.md | 8 ++++- reference/string/basic_string/empty.md | 5 ++++ .../string_view/basic_string_view/empty.md | 4 +++ reference/thread/jthread/get_id.md | 8 ++++- reference/thread/jthread/get_stop_source.md | 9 +++++- reference/thread/jthread/get_stop_token.md | 9 +++++- .../thread/jthread/hardware_concurrency.md | 9 +++++- reference/thread/jthread/joinable.md | 8 ++++- reference/thread/jthread/native_handle.md | 9 +++++- .../unordered_map/unordered_map/empty.md | 4 +++ .../unordered_map/unordered_multimap/empty.md | 4 +++ .../unordered_set/unordered_multiset/empty.md | 4 +++ .../unordered_set/unordered_set/empty.md | 4 +++ reference/utility/forward_like.md | 11 +++++-- reference/vector/vector/empty.md | 5 ++++ 58 files changed, 405 insertions(+), 76 deletions(-) diff --git a/reference/array/array/empty.md b/reference/array/array/empty.md index 243f0ffb0a..78e17b412b 100644 --- a/reference/array/array/empty.md +++ b/reference/array/array/empty.md @@ -9,6 +9,7 @@ constexpr bool empty() noexcept; // C++11 constexpr bool empty() const noexcept; // C++14 [[nodiscard]] constexpr bool empty() const noexcept; // C++20 +constexpr bool empty() const noexcept; // C++26 ``` ## 概要 @@ -68,3 +69,6 @@ empty_array : true ## 参照 - [N3669 Fixing constexpr member functions without const](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3669.pdf) - [P0600R1 `[[nodiscard]]` in the Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf) + - C++20で`[[nodiscard]]`が付加された +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/barrier/barrier/arrive.md b/reference/barrier/barrier/arrive.md index 3a79b6bf40..6af0b912ce 100644 --- a/reference/barrier/barrier/arrive.md +++ b/reference/barrier/barrier/arrive.md @@ -6,7 +6,9 @@ * cpp20[meta cpp] ```cpp -[[nodiscard]] arrival_token arrive(ptrdiff_t update = 1); +[[nodiscard]] +arrival_token arrive(ptrdiff_t update = 1); // (1) C++20 +arrival_token arrive(ptrdiff_t update = 1); // (1) C++26 ``` * ptrdiff_t[link /reference/cstddef/ptrdiff_t.md] @@ -121,3 +123,8 @@ main: phase-2 - [`wait()`](wait.md) - [`arrive_and_wait()`](arrive_and_wait.md) - [`arrive_and_drop()`](arrive_and_drop.md) + + +## 参照 +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/bit/rotl.md b/reference/bit/rotl.md index 44ae11f43d..058f16faef 100644 --- a/reference/bit/rotl.md +++ b/reference/bit/rotl.md @@ -7,7 +7,10 @@ ```cpp namespace std { template - [[nodiscard]] constexpr T rotl(T x, int s) noexcept; + [[nodiscard]] + constexpr T rotl(T x, int s) noexcept; // (1) C++20 + template + constexpr T rotl(T x, int s) noexcept; // (1) C++26 } ``` @@ -73,3 +76,5 @@ int main() ## 参照 - [P0553R4 Bit operations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0553r4.html) +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/bit/rotr.md b/reference/bit/rotr.md index d584d3da5c..64df7741bd 100644 --- a/reference/bit/rotr.md +++ b/reference/bit/rotr.md @@ -7,7 +7,10 @@ ```cpp namespace std { template - [[nodiscard]] constexpr T rotr(T x, int s) noexcept; + [[nodiscard]] + constexpr T rotr(T x, int s) noexcept; // (1) C++20 + template + constexpr T rotr(T x, int s) noexcept; // (1) C++26 } ``` @@ -73,3 +76,5 @@ int main() ## 参照 - [P0553R4 Bit operations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0553r4.html) +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/deque/deque/empty.md b/reference/deque/deque/empty.md index 44c1ef21b7..7babfe8ab3 100644 --- a/reference/deque/deque/empty.md +++ b/reference/deque/deque/empty.md @@ -8,6 +8,7 @@ bool empty() const; // C++03 bool empty() const noexcept; // C++11 [[nodiscard]] bool empty() const noexcept; // C++20 +bool empty() const noexcept; // C++26 ``` ## 概要 @@ -66,3 +67,6 @@ false ## 参照 - [P0600R1 `[[nodiscard]]` in the Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf) + - C++20で`[[nodiscard]]`が付加された +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/filesystem/path/empty.md b/reference/filesystem/path/empty.md index 1de60dc181..ce9b40c722 100644 --- a/reference/filesystem/path/empty.md +++ b/reference/filesystem/path/empty.md @@ -8,6 +8,7 @@ ```cpp bool empty() const noexcept; // C++17 [[nodiscard]] bool empty() const noexcept; // C++20 +bool empty() const noexcept; // C++26 ``` ## 概要 @@ -58,3 +59,6 @@ p2 : not empty ## 参照 - [P0600R1 `[[nodiscard]]` in the Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf) + - C++20で`[[nodiscard]]`が付加された +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/forward_list/forward_list/empty.md b/reference/forward_list/forward_list/empty.md index 8fecaa0c77..ec0f36196a 100644 --- a/reference/forward_list/forward_list/empty.md +++ b/reference/forward_list/forward_list/empty.md @@ -8,6 +8,7 @@ ```cpp bool empty() const noexcept; // C++11 [[nodiscard]] bool empty() const noexcept; // C++20 +bool empty() const noexcept; // C++26 ``` ## 概要 @@ -68,3 +69,6 @@ false ## 参照 - [P0600R1 `[[nodiscard]]` in the Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf) + - C++20で`[[nodiscard]]`が付加された +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/future/async.md b/reference/future/async.md index 875ee46ded..e9c5fd0d7c 100644 --- a/reference/future/async.md +++ b/reference/future/async.md @@ -9,41 +9,41 @@ namespace std { template future::type> async(F&& f, Args&&... args); // (1) C++11 - template future< typename result_of< typename decay::type(typename decay::type...) >::type > async(F&& f, Args&&... args); // (1) C++14 - template future, decay_t...>> async(F&& f, Args&&... args); // (1) C++17 - template - [[nodiscard]] future, decay_t...>> + [[nodiscard]] + future, decay_t...>> async(F&& f, Args&&... args); // (1) C++20 + future, decay_t...>> + async(F&& f, Args&&... args); // (1) C++26 template future::type> async(launch policy, F&& f, Args&&... args); // (2) C++11 - template future< typename result_of< typename decay::type(typename decay::type...) >::type > async(launch policy, F&& f, Args&&... args); // (2) C++14 - template future, decay_t...>> async(launch policy, F&& f, Args&&... args); // (2) C++17 - template - [[nodiscard]] future, decay_t...>> + [[nodiscard]] + future, decay_t...>> async(launch policy, F&& f, Args&&... args); // (2) C++20 + future, decay_t...>> + async(launch policy, F&& f, Args&&... args); // (2) C++26 } ``` * future[link future.md] @@ -203,5 +203,8 @@ foo() = 3 - [async関数launch::asyncポリシーとfutureのちょっと特殊な動作 - yohhoyの日記](https://yohhoy.hatenadiary.jp/entry/20120317/p1) - [P0604R0 Resolving GB 55, US 84, US 85, US 86](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0604r0.html) - [P0600R1 `[[nodiscard]]` in the Library, Rev1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf) + - C++20で`[[nodiscard]]`が付加された - [In Visual Studio, `thread_local` variables' destructor not called when used with `std::async`, is this a bug? - stackoverflow](https://stackoverflow.com/questions/50897768/in-visual-studio-thread-local-variables-destructor-not-called-when-used-with) - [<future> functions - Microsoft Docs](https://docs.microsoft.com/en-us/cpp/standard-library/future-functions?view=vs-2019#remarks) +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/iterator/empty.md b/reference/iterator/empty.md index 63e62f390b..f7d983b584 100644 --- a/reference/iterator/empty.md +++ b/reference/iterator/empty.md @@ -8,21 +8,24 @@ namespace std { template constexpr auto empty(const C& c) -> decltype(c.empty()); // (1) C++17 - template [[nodiscard]] constexpr auto empty(const C& c) -> decltype(c.empty()); // (1) C++20 + template + constexpr auto empty(const C& c) -> decltype(c.empty()); // (1) C++26 template constexpr bool empty(const T (&array)[N]) noexcept; // (2) C++17 - template [[nodiscard]] constexpr bool empty(const T (&array)[N]) noexcept; // (2) C++20 + template + constexpr bool empty(const T (&array)[N]) noexcept; // (2) C++26 template constexpr bool empty(initializer_list il) noexcept; // (3) C++17 - template [[nodiscard]] constexpr bool empty(initializer_list il) noexcept; // (3) C++20 + template + constexpr bool empty(initializer_list il) noexcept; // (3) C++26 } ``` * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -102,4 +105,7 @@ false - [`boost::empty()` - Boost Range Library](http://www.boost.org/doc/libs/release/libs/range/doc/html/range/reference/concept_implementation/semantics/functions.html) - [N4280: Non-member `empty()` and more (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4280.pdf) - [P0600R1: `[[nodiscard]]` in the library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf) + - C++20で`[[nodiscard]]`が付加された - [LWG Issue 3009. Including `` doesn't provide `std::size/empty/data`](https://wg21.cmeerw.net/lwg/issue3009) +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/list/list/empty.md b/reference/list/list/empty.md index 8d7f7610e7..bb873c82d9 100644 --- a/reference/list/list/empty.md +++ b/reference/list/list/empty.md @@ -8,6 +8,7 @@ bool empty() const; // C++03 bool empty() const noexcept; // C++11 [[nodiscard]] bool empty() const noexcept; // C++20 +bool empty() const noexcept; // C++26 ``` ## 概要 @@ -57,3 +58,6 @@ false ## 参照 - [P0600R1 `[[nodiscard]]` in the Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf) + - C++20で`[[nodiscard]]`が付加された +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/map/map/empty.md b/reference/map/map/empty.md index 20698a29a4..3783b07107 100644 --- a/reference/map/map/empty.md +++ b/reference/map/map/empty.md @@ -8,6 +8,7 @@ bool empty() const; // C++03 bool empty() const noexcept; // C++11 [[nodiscard]] bool empty() const noexcept; // C++20 +bool empty() const noexcept; // C++26 ``` ## 概要 @@ -62,3 +63,6 @@ int main () ## 参照 - [P0600R1 `[[nodiscard]]` in the Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf) + - C++20で`[[nodiscard]]`が付加された +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/map/multimap/empty.md b/reference/map/multimap/empty.md index 489dd5834a..529615da1f 100644 --- a/reference/map/multimap/empty.md +++ b/reference/map/multimap/empty.md @@ -8,6 +8,7 @@ bool empty() const; // C++03 bool empty() const noexcept; // C++11 [[nodiscard]] bool empty() const noexcept; // C++20 +bool empty() const noexcept; // C++26 ``` ## 概要 @@ -62,3 +63,6 @@ int main () ## 参照 - [P0600R1 `[[nodiscard]]` in the Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf) + - C++20で`[[nodiscard]]`が付加された +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/memory/allocator/allocate.md b/reference/memory/allocator/allocate.md index f7043fcaf5..846b90a3c0 100644 --- a/reference/memory/allocator/allocate.md +++ b/reference/memory/allocator/allocate.md @@ -5,8 +5,9 @@ * function[meta id-type] ```cpp -pointer allocate(size_type n); // (1) C++17 まで -[[nodiscard]] constexpr pointer allocate(size_type n); // (1) C++20 から +pointer allocate(size_type n); // (1) C++03 +[[nodiscard]] constexpr pointer allocate(size_type n); // (1) C++20 +constexpr pointer allocate(size_type n); // (1) C++26 pointer allocate(size_type n, allocator::const_pointer hint); // (2) C++17 から非推奨、C++20 から削除 @@ -66,5 +67,9 @@ int main() ## 参照 - [P0174R2 Deprecating Vestigial Library Parts in C++17](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0174r2.html) - [P0600R1 `[[nodiscard]]` in the Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf) + - C++20で`[[nodiscard]]`が付加された - [P0619R4 Reviewing deprecated facilities of C++17 for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0619r4.html) - [P0784R7 More constexpr containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0784r7.html) + - C++20で`constexpr`が付加された +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/memory/allocator_traits/allocate.md b/reference/memory/allocator_traits/allocate.md index 6f49d7947c..a005b580ff 100644 --- a/reference/memory/allocator_traits/allocate.md +++ b/reference/memory/allocator_traits/allocate.md @@ -6,13 +6,24 @@ * cpp11[meta cpp] ```cpp -static pointer allocate(Alloc& a, size_type n); // (1) C++17 まで -[[nodiscard]] static constexpr pointer allocate(Alloc& a, size_type n); // (1) C++20 から - -static pointer allocate(Alloc& a, size_type n, - const_void_pointer hint); // (2) C++17 まで -[[nodiscard]] static constexpr pointer allocate(Alloc& a, size_type n, - const_void_pointer hint); // (2) C++20 から +static pointer + allocate(Alloc& a, size_type n); // (1) C++11 +[[nodiscard]] +static constexpr pointer + allocate(Alloc& a, size_type n); // (1) C++20 +static constexpr pointer + allocate(Alloc& a, size_type n); // (1) C++26 + +static pointer + allocate(Alloc& a, size_type n, + const_void_pointer hint); // (2) C++11 +[[nodiscard]] +static constexpr pointer + allocate(Alloc& a, size_type n, + const_void_pointer hint); // (2) C++20 +static constexpr pointer + allocate(Alloc& a, size_type n, + const_void_pointer hint); // (2) C++26 ``` ## 概要 @@ -62,4 +73,8 @@ int main() ## 参照 - [P0600R1 `[[nodiscard]]` in the Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf) + - C++20で`[[nodiscard]]`が付加された - [P0784R7 More constexpr containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0784r7.html) + - C++20で`constexpr`が付加された +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/memory/allocator_traits/allocate_at_least.md b/reference/memory/allocator_traits/allocate_at_least.md index 2b20c85f78..4728c68c9e 100644 --- a/reference/memory/allocator_traits/allocate_at_least.md +++ b/reference/memory/allocator_traits/allocate_at_least.md @@ -6,9 +6,13 @@ * cpp23[meta cpp] ```cpp -[[nodiscard] static constexpr +[[nodiscard] +static constexpr allocation_result allocate_at_least(Alloc& a, size_type n); // (1) C++23 +static constexpr +allocation_result + allocate_at_least(Alloc& a, size_type n); // (1) C++26 ``` * allocation_result[link /reference/memory/allocation_result.md] @@ -66,3 +70,5 @@ allocation count:4 bytes:16 ## 参照 - [P0401R6 Providing size feedback in the Allocator interface](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0401r6.html) +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/memory/assume_aligned.md b/reference/memory/assume_aligned.md index 0ff53eb652..a26985f03b 100644 --- a/reference/memory/assume_aligned.md +++ b/reference/memory/assume_aligned.md @@ -7,7 +7,9 @@ ```cpp namespace std { template - [[nodiscard]] constexpr T* assume_aligned(T* ptr); + [[nodiscard]] constexpr T* assume_aligned(T* ptr); // (1) C++20 + template + constexpr T* assume_aligned(T* ptr); // (1) C++26 } ``` @@ -349,5 +351,7 @@ C++20 から標準で使用可能となる本機能だが、実装例からも ## 参照 -- [P1007R3 std::assume_aligned](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1007r3.pdf) -- [cppmap - C++20 の新機能 - ポインタのアライメントを最適化ヒントとしてコンパイラに伝える assume_aligned() 関数 (P1007R3)](https://cppmap.github.io/standardization/cpp20/#assume_aligned-p1007r3) +- [P1007R3 `std::assume_aligned`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1007r3.pdf) +- [cppmap - C++20 の新機能 - ポインタのアライメントを最適化ヒントとしてコンパイラに伝える `assume_aligned()` 関数 (P1007R3)](https://cppmap.github.io/standardization/cpp20/#assume_aligned-p1007r3) +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/memory_resource/memory_resource/allocate.md b/reference/memory_resource/memory_resource/allocate.md index 6b3f3b9f0e..4cfe5f5243 100644 --- a/reference/memory_resource/memory_resource/allocate.md +++ b/reference/memory_resource/memory_resource/allocate.md @@ -7,9 +7,9 @@ ```cpp void* allocate(size_t bytes, size_t alignment = alignof(max_align_t)); // (1) C++17 - [[nodiscard]] void* allocate(size_t bytes, size_t alignment = alignof(max_align_t)); // (1) C++20 +void* allocate(size_t bytes, size_t alignment = alignof(max_align_t)); // (1) C++26 ``` * size_t[link /reference/cstddef/size_t.md] * max_align_t[link /reference/cstddef/max_align_t.md] @@ -86,4 +86,7 @@ int main(){ - [P0337r0 | Delete operator= for polymorphic_allocator](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0337r0.html) - [Working Draft, C++ Extensions for Library Fundamentals, Version 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4562.html#memory.resource.synop) - [P0600R1 `[[nodiscard]]` in the Library, Rev1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf) + - C++20で`[[nodiscard]]`が付加された - [LWG Issue 2843. Unclear behavior of `std::pmr::memory_resource::do_allocate()`](https://wg21.cmeerw.net/lwg/issue2843) +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/memory_resource/polymorphic_allocator/allocate.md b/reference/memory_resource/polymorphic_allocator/allocate.md index e3358f1975..5c3726b0e0 100644 --- a/reference/memory_resource/polymorphic_allocator/allocate.md +++ b/reference/memory_resource/polymorphic_allocator/allocate.md @@ -8,6 +8,7 @@ ```cpp Tp* allocate(std::size_t n); // (1) C++17 [[nodiscard]] Tp* allocate(std::size_t n); // (1) C++20 +Tp* allocate(std::size_t n); // (1) C++26 ``` ## 概要 @@ -91,4 +92,7 @@ int main() - [P0337r0 | Delete operator= for polymorphic_allocator](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0337r0.html) - [Working Draft, C++ Extensions for Library Fundamentals, Version 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4562.html#memory.resource.synop) - [P0600R1 `[[nodiscard]]` in the Library, Rev1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf) + - C++20で`constexpr`が付加された - [LWG Issue 3038. `polymorphic_allocator::allocate` should not allow integer overflow to create vulnerabilities](https://wg21.cmeerw.net/lwg/issue3038) +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/memory_resource/polymorphic_allocator/allocate_bytes.md b/reference/memory_resource/polymorphic_allocator/allocate_bytes.md index 6586eaa467..beaf3100b6 100644 --- a/reference/memory_resource/polymorphic_allocator/allocate_bytes.md +++ b/reference/memory_resource/polymorphic_allocator/allocate_bytes.md @@ -6,7 +6,11 @@ * cpp20[meta cpp] ```cpp -[[nodiscard]] void* allocate_bytes(size_t nbytes, size_t alignment = alignof(max_align_t)); +[[nodiscard]] +void* allocate_bytes(size_t nbytes, + size_t alignment = alignof(max_align_t)); // (1) C++20 +void* allocate_bytes(size_t nbytes, + size_t alignment = alignof(max_align_t)); // (1) C++26 ``` * max_align_t[link /reference/cstddef/max_align_t.md] @@ -113,4 +117,6 @@ address : 0x1c38150 ## 参照 - [P0339R6 polymorphic_allocator<> as a vocabulary type](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0339r6.pdf) -- [LWG Issue 3304. Allocate functions of `std::polymorphic_allocator` should require `[[nodiscard]]`](https://wg21.cmeerw.net/lwg/issue3304) \ No newline at end of file +- [LWG Issue 3304. Allocate functions of `std::polymorphic_allocator` should require `[[nodiscard]]`](https://wg21.cmeerw.net/lwg/issue3304) +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/memory_resource/polymorphic_allocator/allocate_object.md b/reference/memory_resource/polymorphic_allocator/allocate_object.md index 8ce6a8c278..884330d3cc 100644 --- a/reference/memory_resource/polymorphic_allocator/allocate_object.md +++ b/reference/memory_resource/polymorphic_allocator/allocate_object.md @@ -7,7 +7,9 @@ ```cpp template -[[nodiscard]] T* allocate_object(size_t n = 1); +[[nodiscard]] T* allocate_object(size_t n = 1); // (1) C++20 +template +T* allocate_object(size_t n = 1); // (1) C++26 ``` ## 概要 @@ -104,5 +106,7 @@ int main() { - [`allocate_bytes`](/reference/memory_resource/polymorphic_allocator/allocate_bytes.md) ## 参照 -- [P0339R6 polymorphic_allocator<> as a vocabulary type](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0339r6.pdf) +- [P0339R6 `polymorphic_allocator<>` as a vocabulary type](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0339r6.pdf) - [LWG Issue 3304. Allocate functions of `std::polymorphic_allocator` should require `[[nodiscard]]`](https://wg21.cmeerw.net/lwg/issue3304) +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/memory_resource/polymorphic_allocator/new_object.md b/reference/memory_resource/polymorphic_allocator/new_object.md index 6cff189acf..a0686c67fd 100644 --- a/reference/memory_resource/polymorphic_allocator/new_object.md +++ b/reference/memory_resource/polymorphic_allocator/new_object.md @@ -7,7 +7,10 @@ ```cpp template -[[nodiscard]] T* new_object(CtorArgs&&... ctor_args); +[[nodiscard]] +T* new_object(CtorArgs&&... ctor_args); // (1) C++20 +template +T* new_object(CtorArgs&&... ctor_args); // (1) C++26 ``` ## 概要 @@ -98,3 +101,5 @@ address : 0x1a2b960 ## 参照 - [P0339R6 polymorphic_allocator<> as a vocabulary type](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0339r6.pdf) - [LWG Issue 3304. Allocate functions of `std::polymorphic_allocator` should require `[[nodiscard]]`](https://wg21.cmeerw.net/lwg/issue3304) +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/new/launder.md b/reference/new/launder.md index de85dcdfc4..8751be521a 100644 --- a/reference/new/launder.md +++ b/reference/new/launder.md @@ -7,10 +7,11 @@ ```cpp namespace std { template - constexpr T* launder(T* p) noexcept; // C++17 - - template - [[nodiscard]] constexpr T* launder(T* p) noexcept; // C++20 + constexpr T* launder(T* p) noexcept; // (1) C++17 + template + [[nodiscard]] constexpr T* launder(T* p) noexcept; // (2) C++20 + template + constexpr T* launder(T* p) noexcept; // (2) C++26 } ``` @@ -151,3 +152,7 @@ void tong() { - [std::launder関数 - yohhoyの日記](http://d.hatena.ne.jp/yohhoy/20170817/p1) - [std::launder - cppreference.com](https://ja.cppreference.com/w/cpp/utility/launder) - [Lifetime - cppreference.com](https://en.cppreference.com/w/cpp/language/lifetime) +- [P0600R1 `[[nodiscard]]` in the Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf) + - C++20で`[[nodiscard]]`が付加された +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/new/op_new.md b/reference/new/op_new.md index ad0845076e..c215162aa9 100644 --- a/reference/new/op_new.md +++ b/reference/new/op_new.md @@ -7,11 +7,14 @@ void* operator new(std::size_t size) throw(std::bad_alloc); // (1) C++03 void* operator new(std::size_t size); // (1) C++11 [[nodiscard]] void* operator new(std::size_t size); // (1) C++20 +void* operator new(std::size_t size); // (1) C++26 void* operator new(std::size_t size, std::align_val_t alignment); // (2) C++17 [[nodiscard]] void* operator new(std::size_t size, std::align_val_t alignment); // (2) C++20 +void* operator new(std::size_t size, + std::align_val_t alignment); // (2) C++26 void* operator new(std::size_t size, const std::nothrow_t&) throw(); // (3) C++03 @@ -19,18 +22,25 @@ void* operator new(std::size_t size, const std::nothrow_t&) noexcept; // (3) C++11 [[nodiscard]] void* operator new(std::size_t size, const std::nothrow_t&) noexcept; // (3) C++20 +void* operator new(std::size_t size, + const std::nothrow_t&) noexcept; // (3) C++26 void* operator new(std::size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept; // (4) C++17 -[[nodiscard]]void* operator new(std::size_t size, - std::align_val_t alignment, - const std::nothrow_t&) noexcept; // (4) C++20 +[[nodiscard]] void* operator new(std::size_t size, + std::align_val_t alignment, + const std::nothrow_t&) noexcept; // (4) C++20 +void* operator new(std::size_t size, + std::align_val_t alignment, + const std::nothrow_t&) noexcept; // (4) C++26 void* operator new(std::size_t size, void* ptr) throw(); // (5) C++03 void* operator new(std::size_t size, void* ptr) noexcept; // (5) C++11 [[nodiscard]] void* operator new(std::size_t size, void* ptr) noexcept; // (5) C++20 +void* operator new(std::size_t size, + void* ptr) noexcept; // (5) C++26 ``` * std::bad_alloc[link bad_alloc.md] * std::nothrow_t[link nothrow_t.md] @@ -162,3 +172,6 @@ int main() ## 参照 - [P0600R1 `[[nodiscard]]` in the Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf) + - C++20で`[[nodiscard]]`が付加された +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/new/op_new[].md b/reference/new/op_new[].md index 1089900dbc..1802e38477 100644 --- a/reference/new/op_new[].md +++ b/reference/new/op_new[].md @@ -7,12 +7,15 @@ void* operator new[](std::size_t size) throw(std::bad_alloc); // (1) C++03 void* operator new[](std::size_t size); // (1) C++11 [[nodiscard]] void* operator new[](std::size_t size); // (1) C++20 +void* operator new[](std::size_t size); // (1) C++26 void* operator new[](std::size_t size, std::align_val_t alignment); // (2) C++17 [[nodiscard]] void* operator new[](std::size_t size, std::align_val_t alignment); // (2) C++20 +void* operator new[](std::size_t size, + std::align_val_t alignment); // (2) C++26 void* operator new[](std::size_t size, const std::nothrow_t&) throw(); // (3) C++03 @@ -20,6 +23,8 @@ void* operator new[](std::size_t size, const std::nothrow_t&) noexcept; // (3) C++11 [[nodiscard]] void* operator new[](std::size_t size, const std::nothrow_t&) noexcept; // (3) C++20 +void* operator new[](std::size_t size, + const std::nothrow_t&) noexcept; // (3) C++26 void* operator new[](std::size_t size, std::align_val_t alignment, @@ -27,10 +32,14 @@ void* operator new[](std::size_t size, [[nodiscard]] void* operator new[](std::size_t size, std::align_val_t alignment, const std::nothrow_t&) noexcept; // (4) C++20 +void* operator new[](std::size_t size, + std::align_val_t alignment, + const std::nothrow_t&) noexcept; // (4) C++26 void* operator new[](std::size_t size, void* ptr) throw(); // (5) C++03 void* operator new[](std::size_t size, void* ptr) noexcept; // (5) C++11 [[nodiscard]] void* operator new[](std::size_t size, void* ptr) noexcept; // (5) C++20 +void* operator new[](std::size_t size, void* ptr) noexcept; // (5) C++26 ``` * std::bad_alloc[link bad_alloc.md] * std::nothrow_t[link nothrow_t.md] @@ -163,3 +172,6 @@ int main() ## 参照 - [P0600R1 `[[nodiscard]]` in the Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf) + - C++20で`[[nodiscard]]`が付加された +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/node_handle/node_handle/empty.md b/reference/node_handle/node_handle/empty.md index a197c009ae..e544cb4dcb 100644 --- a/reference/node_handle/node_handle/empty.md +++ b/reference/node_handle/node_handle/empty.md @@ -8,6 +8,7 @@ ```cpp bool empty() const noexcept; [[nodiscard]] bool empty() const noexcept; // C++20 +bool empty() const noexcept; // C++26 ``` ## 概要 @@ -45,4 +46,7 @@ true ## 参照 - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) -- [P0600R1 `[[nodiscard]]` in the Library, Rev1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf) +- [P0600R1 `[[nodiscard]]` in the Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf) + - C++20で`[[nodiscard]]`が付加された +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/queue/priority_queue/empty.md b/reference/queue/priority_queue/empty.md index 6874201e4e..267d9a5a5c 100644 --- a/reference/queue/priority_queue/empty.md +++ b/reference/queue/priority_queue/empty.md @@ -7,6 +7,7 @@ ```cpp bool empty() const; // C++03 [[nodiscard]] bool empty() const; // C++20 +bool empty() const; // C++26 ``` ## 概要 @@ -67,3 +68,6 @@ non_empty_que is not empty ## 参照 - [P0600R1 `[[nodiscard]]` in the Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf) + - C++20で`[[nodiscard]]`が付加された +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/queue/queue/empty.md b/reference/queue/queue/empty.md index 48cbb55624..90681fd848 100644 --- a/reference/queue/queue/empty.md +++ b/reference/queue/queue/empty.md @@ -7,6 +7,7 @@ ```cpp bool empty() const; // C++03 [[nodiscard]] bool empty() const; // C++20 +bool empty() const; // C++26 ``` ## 概要 @@ -53,3 +54,6 @@ empty ## 参照 - [P0600R1 `[[nodiscard]]` in the Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf) + - C++20で`[[nodiscard]]`が付加された +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/ranges/subrange/begin.md b/reference/ranges/subrange/begin.md index c243775f13..373fb15071 100644 --- a/reference/ranges/subrange/begin.md +++ b/reference/ranges/subrange/begin.md @@ -6,9 +6,10 @@ * cpp20[meta cpp] ```cpp -constexpr I begin() const requires copyable; // (1) +constexpr I begin() const requires copyable; // (1) C++20 -[[nodiscard]] constexpr I begin() requires (!copyable); // (2) +[[nodiscard]] constexpr I begin() requires (!copyable); // (2) C++20 +constexpr I begin() requires (!copyable); // (2) C++26 ``` * copyable[link /reference/concepts/copyable.md] * nodiscard[link /lang/cpp17/nodiscard.md] @@ -58,3 +59,5 @@ int main() ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) - [C++20 ranges](https://techbookfest.org/product/5134506308665344) +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/ranges/subrange/next.md b/reference/ranges/subrange/next.md index 413c85af1c..9d9118a7af 100644 --- a/reference/ranges/subrange/next.md +++ b/reference/ranges/subrange/next.md @@ -6,12 +6,19 @@ * cpp20[meta cpp] ```cpp -// (1) -[[nodiscard]] constexpr subrange next(iter_difference_t n = 1) const & - requires forward_iterator; - -// (2) -[[nodiscard]] constexpr subrange next(iter_difference_t n = 1) &&; +[[nodiscard]] +constexpr subrange + next(iter_difference_t n = 1) const & + requires forward_iterator; // (1) C++20 +constexpr subrange + next(iter_difference_t n = 1) const & + requires forward_iterator; // (1) C++26 + +[[nodiscard]] +constexpr subrange + next(iter_difference_t n = 1) &&; // (2) C++20 +constexpr subrange + next(iter_difference_t n = 1) &&; // (2) C++26 ``` * nodiscard[link /lang/cpp17/nodiscard.md] * iter_difference_t[link /reference/iterator/iter_difference_t.md] @@ -84,3 +91,5 @@ int main() ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) - [C++20 ranges](https://techbookfest.org/product/5134506308665344) +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/ranges/subrange/prev.md b/reference/ranges/subrange/prev.md index a07ae84bfd..18274abc07 100644 --- a/reference/ranges/subrange/prev.md +++ b/reference/ranges/subrange/prev.md @@ -6,8 +6,13 @@ * cpp20[meta cpp] ```cpp -[[nodiscard]] constexpr subrange prev(iter_difference_t n = 1) const - requires bidirectional_iterator; +[[nodiscard]] +constexpr subrange + prev(iter_difference_t n = 1) const + requires bidirectional_iterator; // (1) C++20 +constexpr subrange + prev(iter_difference_t n = 1) const + requires bidirectional_iterator; // (1) C++26 ``` * nodiscard[link /lang/cpp17/nodiscard.md] * iter_difference_t[link /reference/iterator/iter_difference_t.md] @@ -70,3 +75,5 @@ int main() ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) - [C++20 ranges](https://techbookfest.org/product/5134506308665344) +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/regex/match_results/empty.md b/reference/regex/match_results/empty.md index b3e0b22f6f..68c2a19a4b 100644 --- a/reference/regex/match_results/empty.md +++ b/reference/regex/match_results/empty.md @@ -6,8 +6,9 @@ * cpp11[meta cpp] ```cpp -bool empty() const; // C++11 -[[nodiscard]] bool empty() const; // C++20 +bool empty() const; // (1) C++11 +[[nodiscard]] bool empty() const; // (1) C++20 +bool empty() const; // (1) C++26 ``` ## 概要 @@ -83,3 +84,6 @@ match:ready = true, empty = false ## 参照 - [P0600R1 `[[nodiscard]]` in the Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf) + - C++20で`[[nodiscard]]`が付加された +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/scoped_allocator/scoped_allocator_adaptor/allocate.md b/reference/scoped_allocator/scoped_allocator_adaptor/allocate.md index 68433f1db9..cbe8f7f846 100644 --- a/reference/scoped_allocator/scoped_allocator_adaptor/allocate.md +++ b/reference/scoped_allocator/scoped_allocator_adaptor/allocate.md @@ -6,11 +6,19 @@ * cpp11[meta cpp] ```cpp -pointer allocate(size_type n); // (1) C++11 -[[nodiscard]] pointer allocate(size_type n); // (1) C++20 - -pointer allocate(size_type n, const_void_pointer hint); // (2) C++11 -[[nodiscard]] pointer allocate(size_type n, const_void_pointer hint); // (2) C++20 +pointer allocate(size_type n); // (1) C++11 +[[nodiscard]] pointer allocate(size_type n); // (1) C++20 +pointer allocate(size_type n); // (1) C++26 + +pointer + allocate(size_type n, + const_void_pointer hint); // (2) C++11 +[[nodiscard]] pointer + allocate(size_type n, + const_void_pointer hint); // (2) C++20 +pointer + allocate(size_type n, + const_void_pointer hint); // (2) C++26 ``` ## 概要 @@ -81,3 +89,6 @@ int main() ## 参照 - [P0600R1 `[[nodiscard]]` in the Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf) + - C++20で`[[nodiscard]]`が付加された +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/set/multiset/empty.md b/reference/set/multiset/empty.md index 745c578302..6460abf3a4 100644 --- a/reference/set/multiset/empty.md +++ b/reference/set/multiset/empty.md @@ -8,6 +8,7 @@ bool empty() const; // C++03 bool empty() const noexcept; // C++11 [[nodiscard]] bool empty() const noexcept; // C++20 +bool empty() const noexcept; // C++26 ``` ## 概要 @@ -60,3 +61,6 @@ int main () ## 参照 - [P0600R1 `[[nodiscard]]` in the Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf) + - C++20で`[[nodiscard]]`が付加された +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/set/set/empty.md b/reference/set/set/empty.md index 937198914f..988be85c91 100644 --- a/reference/set/set/empty.md +++ b/reference/set/set/empty.md @@ -8,6 +8,7 @@ bool empty() const; // C++03 bool empty() const noexcept; // C++11 [[nodiscard]] bool empty() const noexcept; // C++20 +bool empty() const noexcept; // C++26 ``` ## 概要 @@ -60,3 +61,6 @@ int main () ## 参照 - [P0600R1 `[[nodiscard]]` in the Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf) + - C++20で`[[nodiscard]]`が付加された +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/span/span/empty.md b/reference/span/span/empty.md index b6d8c6a44e..0b439e735e 100644 --- a/reference/span/span/empty.md +++ b/reference/span/span/empty.md @@ -6,7 +6,8 @@ * cpp20[meta cpp] ```cpp -[[nodiscard]] constexpr bool empty() const noexcept; +[[nodiscard]] constexpr bool empty() const noexcept; // (1) C++20 +constexpr bool empty() const noexcept; // (1) C++26 ``` ## 概要 @@ -64,3 +65,8 @@ int main() - [Clang](/implementation.md#clang): 9.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/stack/stack/empty.md b/reference/stack/stack/empty.md index 94e9b85c1d..1d58dc05eb 100644 --- a/reference/stack/stack/empty.md +++ b/reference/stack/stack/empty.md @@ -7,6 +7,7 @@ ```cpp bool empty() const; // C++03 [[nodiscard]] bool empty() const; // C++20 +bool empty() const; // C++26 ``` ## 概要 @@ -74,3 +75,6 @@ bool empty() const { return c.empty(); } ## 参照 - [P0600R1 `[[nodiscard]]` in the Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf) + - C++20で`[[nodiscard]]`が付加された +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/stacktrace/basic_stacktrace/empty.md b/reference/stacktrace/basic_stacktrace/empty.md index aaeb8e5677..1c529dd5dd 100644 --- a/reference/stacktrace/basic_stacktrace/empty.md +++ b/reference/stacktrace/basic_stacktrace/empty.md @@ -7,6 +7,7 @@ ```cpp [[nodiscard]] bool empty() const noexcept; // (1) C++23 +bool empty() const noexcept; // (1) C++26 ``` ## 概要 @@ -54,3 +55,8 @@ int main() { - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): 12 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/stop_token/stop_source/get_token.md b/reference/stop_token/stop_source/get_token.md index 3c9852d2f0..bfd0c76f19 100644 --- a/reference/stop_token/stop_source/get_token.md +++ b/reference/stop_token/stop_source/get_token.md @@ -6,7 +6,9 @@ * cpp20[meta cpp] ```cpp -[[nodiscard]] stop_token get_token() const noexcept; +[[nodiscard]] +stop_token get_token() const noexcept; // (1) C++20 +stop_token get_token() const noexcept; // (1) C++26 ``` ## 概要 @@ -55,3 +57,7 @@ int main() - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/stop_token/stop_source/op_equal.md b/reference/stop_token/stop_source/op_equal.md index e0639fddb3..950be7daa9 100644 --- a/reference/stop_token/stop_source/op_equal.md +++ b/reference/stop_token/stop_source/op_equal.md @@ -6,7 +6,13 @@ ```cpp namespace std { - [[nodiscard]] friend bool operator==(const stop_source& x, const stop_source& y) noexcept; + [[nodiscard]] + friend bool + operator==(const stop_source& x, + const stop_source& y) noexcept; // (1) C++20 + friend bool + operator==(const stop_source& x, + const stop_source& y) noexcept; // (1) C++26 } ``` @@ -55,3 +61,7 @@ int main() - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/stop_token/stop_source/stop_possible.md b/reference/stop_token/stop_source/stop_possible.md index e538eecfdf..88d1b38159 100644 --- a/reference/stop_token/stop_source/stop_possible.md +++ b/reference/stop_token/stop_source/stop_possible.md @@ -6,7 +6,9 @@ * cpp20[meta cpp] ```cpp -[[nodiscard]] bool stop_possible() const noexcept; +[[nodiscard]] +bool stop_possible() const noexcept; // (1) C++20 +bool stop_possible() const noexcept; // (1) C++26 ``` ## 概要 @@ -50,3 +52,7 @@ int main() - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/stop_token/stop_source/stop_requested.md b/reference/stop_token/stop_source/stop_requested.md index 8f58652155..2ad2a9f74d 100644 --- a/reference/stop_token/stop_source/stop_requested.md +++ b/reference/stop_token/stop_source/stop_requested.md @@ -6,7 +6,9 @@ * cpp20[meta cpp] ```cpp -[[nodiscard]] bool stop_requested() const noexcept; +[[nodiscard]] +bool stop_requested() const noexcept; // (1) C++20 +bool stop_requested() const noexcept; // (1) C++26 ``` ## 概要 @@ -58,4 +60,6 @@ int main() - [Visual C++](/implementation.md#visual_cpp): ?? - +## 参照 +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/stop_token/stop_token/op_equal.md b/reference/stop_token/stop_token/op_equal.md index 19b2f963d7..10b7b80dca 100644 --- a/reference/stop_token/stop_token/op_equal.md +++ b/reference/stop_token/stop_token/op_equal.md @@ -6,7 +6,13 @@ ```cpp namespace std { - [[nodiscard]] friend bool operator==(const stop_token& lhs, const stop_token& rhs) noexcept; + [[nodiscard]] + friend bool + operator==(const stop_token& lhs, + const stop_token& rhs) noexcept; // (1) C++20 + friend bool + operator==(const stop_token& lhs, + const stop_token& rhs) noexcept; // (1) C++26 } ``` @@ -59,3 +65,7 @@ int main() - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/stop_token/stop_token/stop_possible.md b/reference/stop_token/stop_token/stop_possible.md index bc6ed3e434..a9dcedc21d 100644 --- a/reference/stop_token/stop_token/stop_possible.md +++ b/reference/stop_token/stop_token/stop_possible.md @@ -6,7 +6,9 @@ * cpp20[meta cpp] ```cpp -[[nodiscard]] bool stop_possible() const noexcept; +[[nodiscard]] +bool stop_possible() const noexcept; // (1) C++20 +bool stop_possible() const noexcept; // (1) C++26 ``` ## 概要 @@ -84,3 +86,7 @@ int main() - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/stop_token/stop_token/stop_requested.md b/reference/stop_token/stop_token/stop_requested.md index ff1167c250..fb29d4b9ba 100644 --- a/reference/stop_token/stop_token/stop_requested.md +++ b/reference/stop_token/stop_token/stop_requested.md @@ -6,7 +6,9 @@ * cpp20[meta cpp] ```cpp -[[nodiscard]] bool stop_requested() const noexcept; +[[nodiscard]] +bool stop_requested() const noexcept; // (1) C++20 +bool stop_requested() const noexcept; // (1) C++26 ``` ## 概要 @@ -73,3 +75,7 @@ int main() - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/string/basic_string/empty.md b/reference/string/basic_string/empty.md index 0ead8e0bf1..a68f8bd748 100644 --- a/reference/string/basic_string/empty.md +++ b/reference/string/basic_string/empty.md @@ -8,6 +8,7 @@ bool empty() const; // C++03 bool empty() const noexcept; // C++11 [[nodiscard]] constexpr bool empty() const noexcept; // C++20 +constexpr bool empty() const noexcept; // C++26 ``` ## 概要 @@ -48,4 +49,8 @@ int main() ## 参照 - [P0600R1 `[[nodiscard]]` in the Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf) + - C++20で`[[nodiscard]]`が付加された - [P0980R1 Making `std::string` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0980r1.pdf) + - C++20で`constexpr`が付加された +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/string_view/basic_string_view/empty.md b/reference/string_view/basic_string_view/empty.md index 509f39c4e4..6759b97836 100644 --- a/reference/string_view/basic_string_view/empty.md +++ b/reference/string_view/basic_string_view/empty.md @@ -8,6 +8,7 @@ ```cpp constexpr bool empty() const noexcept; // C++17 [[nodiscard]] constexpr bool empty() const noexcept; // C++20 +constexpr bool empty() const noexcept; // C++26 ``` ## 概要 @@ -58,3 +59,6 @@ int main() ## 参照 - [P0600R1 `[[nodiscard]]` in the Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf) + - C++20で`[[nodiscard]]`が付加された +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/thread/jthread/get_id.md b/reference/thread/jthread/get_id.md index f0488976ac..4b4856e262 100644 --- a/reference/thread/jthread/get_id.md +++ b/reference/thread/jthread/get_id.md @@ -6,7 +6,8 @@ * cpp20[meta cpp] ```cpp -id get_id() const noexcept; +[[nodiscard]] id get_id() const noexcept; // (1) C++20 +id get_id() const noexcept; // (1) C++26 ``` * id[link /reference/thread/thread/id.md] @@ -58,3 +59,8 @@ thread::id of a non-executing thread - [Clang](/implementation.md#clang): - [GCC](/implementation.md#gcc): 10.2.0 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/thread/jthread/get_stop_source.md b/reference/thread/jthread/get_stop_source.md index ea0ced847c..db6c4080b8 100644 --- a/reference/thread/jthread/get_stop_source.md +++ b/reference/thread/jthread/get_stop_source.md @@ -6,7 +6,9 @@ * cpp20[meta cpp] ```cpp -[[nodiscard]] stop_source get_stop_source() noexcept; +[[nodiscard]] +stop_source get_stop_source() noexcept; // (1) C++20 +stop_source get_stop_source() noexcept; // (1) C++26 ``` * stop_source[link /reference/stop_token/stop_source.md] @@ -62,3 +64,8 @@ exit t1 thread - [Clang](/implementation.md#clang): - [GCC](/implementation.md#gcc): 10.2.0 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/thread/jthread/get_stop_token.md b/reference/thread/jthread/get_stop_token.md index c0b7b2efc1..6c8cbe0bab 100644 --- a/reference/thread/jthread/get_stop_token.md +++ b/reference/thread/jthread/get_stop_token.md @@ -6,7 +6,9 @@ * cpp20[meta cpp] ```cpp -[[nodiscard]] stop_token get_stop_token() const noexcept; +[[nodiscard]] +stop_token get_stop_token() const noexcept; // (1) C++20 +stop_token get_stop_token() const noexcept; // (1) C++26 ``` * stop_token[link /reference/stop_token/stop_token.md] @@ -67,3 +69,8 @@ exit t thread - [Clang](/implementation.md#clang): - [GCC](/implementation.md#gcc): 10.2.0 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/thread/jthread/hardware_concurrency.md b/reference/thread/jthread/hardware_concurrency.md index 72f24553e8..c6d82360fa 100644 --- a/reference/thread/jthread/hardware_concurrency.md +++ b/reference/thread/jthread/hardware_concurrency.md @@ -6,7 +6,9 @@ * cpp20[meta cpp] ```cpp -[[nodiscard]] static unsigned int hardware_concurrency() noexcept; // (1) C++20 +[[nodiscard]] +static unsigned int hardware_concurrency() noexcept; // (1) C++20 +static unsigned int hardware_concurrency() noexcept; // (1) C++26 ``` ## 概要 @@ -50,3 +52,8 @@ concurrency=12 - [Clang](/implementation.md#clang): - [GCC](/implementation.md#gcc): 10.2.0 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/thread/jthread/joinable.md b/reference/thread/jthread/joinable.md index c35bb51d74..3c269e0bfa 100644 --- a/reference/thread/jthread/joinable.md +++ b/reference/thread/jthread/joinable.md @@ -6,7 +6,8 @@ * cpp20[meta cpp] ```cpp -bool joinable() const noexcept; +[[nodiscard]] bool joinable() const noexcept; // (1) C++20 +bool joinable() const noexcept; // (1) C++26 ``` ## 概要 @@ -53,3 +54,8 @@ int main() - [Clang](/implementation.md#clang): - [GCC](/implementation.md#gcc): 10.2.0 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/thread/jthread/native_handle.md b/reference/thread/jthread/native_handle.md index 57c34e53b2..42dd99c96f 100644 --- a/reference/thread/jthread/native_handle.md +++ b/reference/thread/jthread/native_handle.md @@ -6,7 +6,9 @@ * cpp20[meta cpp] ```cpp -[[nodiscard]] native_handle_type native_handle(); // (1) C++20 +[[nodiscard]] +native_handle_type native_handle(); // (1) C++20 +native_handle_type native_handle(); // (1) C++26 ``` ## 概要 @@ -57,3 +59,8 @@ func - [Clang](/implementation.md#clang): - [GCC](/implementation.md#gcc): 10.2.0 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/unordered_map/unordered_map/empty.md b/reference/unordered_map/unordered_map/empty.md index 50c3005b90..fca5f7ee30 100644 --- a/reference/unordered_map/unordered_map/empty.md +++ b/reference/unordered_map/unordered_map/empty.md @@ -8,6 +8,7 @@ ```cpp bool empty() const noexcept; // C++11 [[nodiscard]] bool empty() const noexcept; // C++20 +bool empty() const noexcept; // C++26 ``` ## 概要 @@ -93,3 +94,6 @@ inline bool unordered_map::empty() const noexcept { ## 参照 - [P0600R1 `[[nodiscard]]` in the Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf) + - C++20で`[[nodiscard]]`が付加された +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/unordered_map/unordered_multimap/empty.md b/reference/unordered_map/unordered_multimap/empty.md index 0b4775a358..248fea3638 100644 --- a/reference/unordered_map/unordered_multimap/empty.md +++ b/reference/unordered_map/unordered_multimap/empty.md @@ -8,6 +8,7 @@ ```cpp bool empty() const noexcept; // C++11 [[nodiscard]] bool empty() const noexcept; // C++20 +bool empty() const noexcept; // C++26 ``` ## 概要 @@ -93,3 +94,6 @@ inline bool unordered_multimap::empty() const noexce ## 参照 - [P0600R1 `[[nodiscard]]` in the Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf) + - C++20で`[[nodiscard]]`が付加された +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/unordered_set/unordered_multiset/empty.md b/reference/unordered_set/unordered_multiset/empty.md index 55556a578d..dbb0d9028d 100644 --- a/reference/unordered_set/unordered_multiset/empty.md +++ b/reference/unordered_set/unordered_multiset/empty.md @@ -8,6 +8,7 @@ ```cpp bool empty() const noexcept; // C++11 [[nodiscard]] bool empty() const noexcept; // C++20 +bool empty() const noexcept; // C++26 ``` ## 概要 @@ -93,3 +94,6 @@ inline bool unordered_multiset::empty() const noexce ## 参照 - [P0600R1 `[[nodiscard]]` in the Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf) + - C++20で`[[nodiscard]]`が付加された +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/unordered_set/unordered_set/empty.md b/reference/unordered_set/unordered_set/empty.md index a3281777d1..0dd50e231c 100644 --- a/reference/unordered_set/unordered_set/empty.md +++ b/reference/unordered_set/unordered_set/empty.md @@ -8,6 +8,7 @@ ```cpp bool empty() const noexcept; // C++11 [[nodiscard]] bool empty() const noexcept; // C++20 +bool empty() const noexcept; // C++26 ``` ## 概要 @@ -93,3 +94,6 @@ inline bool unordered_set::empty() const noexcept { ## 参照 - [P0600R1 `[[nodiscard]]` in the Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf) + - C++20で`[[nodiscard]]`が付加された +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/utility/forward_like.md b/reference/utility/forward_like.md index 0566ae3edd..dc1d9f25d2 100644 --- a/reference/utility/forward_like.md +++ b/reference/utility/forward_like.md @@ -6,8 +6,11 @@ ```cpp namespace std { - template - [[nodiscard]] constexpr auto forward_like(U&& x) noexcept -> see-below; +template +[[nodiscard]] +constexpr auto forward_like(U&& x) noexcept -> see-below; // (1) C++23 +template +constexpr auto forward_like(U&& x) noexcept -> see-below; // (1) C++26 } ``` * see-below[italic] @@ -134,4 +137,6 @@ template ## 参照 -- [P2445R1 std::forward_like](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2445r1.pdf) +- [P2445R1 `std::forward_like`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2445r1.pdf) +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された diff --git a/reference/vector/vector/empty.md b/reference/vector/vector/empty.md index 2c205374b2..247bf51ae1 100644 --- a/reference/vector/vector/empty.md +++ b/reference/vector/vector/empty.md @@ -8,6 +8,7 @@ bool empty() const; // (1) C++03 bool empty() const noexcept; // (1) C++11 [[nodiscard]] constexpr bool empty() const noexcept; // (1) C++20 +constexpr bool empty() const noexcept; // (1) C++26 ``` ## 概要 @@ -66,4 +67,8 @@ false ## 参照 - [P0600R1 `[[nodiscard]]` in the Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0600r1.pdf) + - C++20で`[[nodiscard]]`が付加された - [P1004R2 Making `std::vector` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1004r2.pdf) + - C++20で`constexpr`が付加された +- [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) + - C++26で`[[nodiscard]]`指定が削除された From 94b8b36e62a3cd0246fbf1c4e336fff4a300c877 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 28 Feb 2025 10:18:32 +0900 Subject: [PATCH 1460/3948] =?UTF-8?q?expected=20:=20C++26=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C=E3=81=A8=E3=81=97=E3=81=A6=E6=AF=94=E8=BC=83=E6=BC=94?= =?UTF-8?q?=E7=AE=97=E5=AD=90=E3=81=AE=E9=81=A9=E6=A0=BC=E8=A6=81=E4=BB=B6?= =?UTF-8?q?=E3=82=92=E3=83=86=E3=83=B3=E3=83=97=E3=83=AC=E3=83=BC=E3=83=88?= =?UTF-8?q?=E3=83=91=E3=83=A9=E3=83=A1=E3=83=BC=E3=82=BF=E5=88=B6=E7=B4=84?= =?UTF-8?q?=E3=81=AB=E5=A4=89=E6=9B=B4=20(close=20#1379)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/expected/expected.void/op_equal.md | 4 +++- reference/expected/expected.void/op_not_equal.md | 4 +++- reference/expected/expected/op_equal.md | 4 +++- reference/expected/expected/op_not_equal.md | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/reference/expected/expected.void/op_equal.md b/reference/expected/expected.void/op_equal.md index d61ff5eda7..f72459f704 100644 --- a/reference/expected/expected.void/op_equal.md +++ b/reference/expected/expected.void/op_equal.md @@ -24,7 +24,7 @@ friend constexpr bool operator==(const unexpected& 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`へ変換可能であること。 @@ -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で「適格要件」を「テンプレートパラメータ制約」に変更 diff --git a/reference/expected/expected.void/op_not_equal.md b/reference/expected/expected.void/op_not_equal.md index 9c203450b1..b256e992f5 100644 --- a/reference/expected/expected.void/op_not_equal.md +++ b/reference/expected/expected.void/op_not_equal.md @@ -25,7 +25,7 @@ friend constexpr bool operator!=(const unexpected& 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`へ変換可能であること。 @@ -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で「適格要件」を「テンプレートパラメータ制約」に変更 diff --git a/reference/expected/expected/op_equal.md b/reference/expected/expected/op_equal.md index 25e4668a72..d491fff228 100644 --- a/reference/expected/expected/op_equal.md +++ b/reference/expected/expected/op_equal.md @@ -30,7 +30,7 @@ friend constexpr bool operator==(const unexpected& 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`へ変換可能であること。 @@ -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で「適格要件」を「テンプレートパラメータ制約」に変更 diff --git a/reference/expected/expected/op_not_equal.md b/reference/expected/expected/op_not_equal.md index bce953cf52..14cb8532e6 100644 --- a/reference/expected/expected/op_not_equal.md +++ b/reference/expected/expected/op_not_equal.md @@ -30,7 +30,7 @@ friend constexpr bool operator!=(const unexpected& 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`へ変換可能であること。 @@ -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で「適格要件」を「テンプレートパラメータ制約」に変更 From 1980594dbb94275a0d8526692c3c8bbdabcfccac Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sat, 1 Mar 2025 00:59:28 +0900 Subject: [PATCH 1461/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/chrono/year_month_day/op_constructor.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/chrono/year_month_day/op_constructor.md b/reference/chrono/year_month_day/op_constructor.md index 56c8af48cf..b7cbe5ccf2 100644 --- a/reference/chrono/year_month_day/op_constructor.md +++ b/reference/chrono/year_month_day/op_constructor.md @@ -44,7 +44,7 @@ year_month_day(year_month_day&&) = default; // (7) C++20 - (2) : - `y`、`m`、`d`をメンバ変数として保持する - (3) : - - 年のメンバ変数として`ymdl.`[`year()`](/reference/chrono/year_month_day_last/year.md)の値、月のメンバ変数として`ymdl.`[`month()`](/reference/chrono/year_month_day_last/month.md)の値、日のメンバ変数として`ymdl.`[`day()`](/reference/chrono/year_month_day_last/day.md)の値を保持する + - 年のメンバ変数として`ymdl.`[`year()`](year.md)の値、月のメンバ変数として`ymdl.`[`month()`](month.md)の値、日のメンバ変数として`ymdl.`[`day()`](day.md)の値を保持する - (4) : `dp`が指すシステム時間に対応する年、月、日の値を求めて構築する - (5) : `dp`が指すローカル時間に対応する年、月、日の値を求めて構築する From c312d2fd51e6cc719dd305ada29e704f66a40647 Mon Sep 17 00:00:00 2001 From: komori-n Date: Sun, 2 Mar 2025 15:55:40 +0900 Subject: [PATCH 1462/3948] =?UTF-8?q?try=5Flock=E3=81=AE=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=89=E4=BE=8B=E3=81=AE=E3=82=B3=E3=83=B3=E3=83=91=E3=82=A4?= =?UTF-8?q?=E3=83=AB=E3=81=8C=E9=80=9A=E3=82=89=E3=81=AA=E3=81=84=E5=95=8F?= =?UTF-8?q?=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/mutex/try_lock.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/mutex/try_lock.md b/reference/mutex/try_lock.md index 09155577fd..35801efd95 100644 --- a/reference/mutex/try_lock.md +++ b/reference/mutex/try_lock.md @@ -34,6 +34,7 @@ namespace std { ## 例 ```cpp example #include +#include #include int main() From 8c2de7c9b0fd3243579dab5285be79adfde8ad3b Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 3 Mar 2025 12:14:50 +0900 Subject: [PATCH 1463/3948] =?UTF-8?q?=E3=82=B9=E3=83=9D=E3=83=B3=E3=82=B5?= =?UTF-8?q?=E3=83=BC=E6=9B=B4=E6=96=B0=20#1411?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.md b/index.md index 664b365dfd..d437c5af46 100644 --- a/index.md +++ b/index.md @@ -127,6 +127,8 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい [sponsor name:USAMI Kenta, img:https://gravatar.com/userimage/33138763/7af48baae61cde116bd8d28a5158946e.jpeg?size=256, link:https://github.com/zonuexe, size:256, fee:5, amount:12] +[sponsor name:soramimi, img:https://www.soramimi.jp/avater.jpg, link:https://t.co/bGT72HXBgR, size:256, fee:5, amount:12] + [sponsor name:odan様, img:https://odan.dev/icon.jpeg, link:https://opencollective.com/odan, size:320, fee:50, amount:1, period:2024-06-05] [sponsor name:unagi様, img:https://www.unagiworks.net/blog/wp-content/uploads/2019/01/logo.gif, fee:50, amount:1, period:2025-07-02] From 1bd673d8c3d790bcb2accc74ebe43b41714e19e5 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 3 Mar 2025 12:20:14 +0900 Subject: [PATCH 1464/3948] =?UTF-8?q?=E3=82=B9=E3=83=9D=E3=83=B3=E3=82=B5?= =?UTF-8?q?=E3=83=BC=E6=9B=B4=E6=96=B0=20#1411?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.md b/index.md index d437c5af46..84ccd85697 100644 --- a/index.md +++ b/index.md @@ -127,7 +127,7 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい [sponsor name:USAMI Kenta, img:https://gravatar.com/userimage/33138763/7af48baae61cde116bd8d28a5158946e.jpeg?size=256, link:https://github.com/zonuexe, size:256, fee:5, amount:12] -[sponsor name:soramimi, img:https://www.soramimi.jp/avater.jpg, link:https://t.co/bGT72HXBgR, size:256, fee:5, amount:12] +[sponsor name:soramimi, img:https://www.soramimi.jp/avater.jpg, link:https://github.com/soramimi, size:256, fee:5, amount:12] [sponsor name:odan様, img:https://odan.dev/icon.jpeg, link:https://opencollective.com/odan, size:320, fee:50, amount:1, period:2024-06-05] From 78f2291fb56835b01dc66a155e7c319b533c7c3b Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 3 Mar 2025 13:59:58 +0900 Subject: [PATCH 1465/3948] =?UTF-8?q?path:=20C++26=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=E3=81=A8=E3=81=97=E3=81=A6formatter=E3=81=AE=E7=89=B9=E6=AE=8A?= =?UTF-8?q?=E5=8C=96=E3=82=92=E8=BF=BD=E5=8A=A0=20(close=20#1336)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/filesystem/path.md | 6 ++ reference/filesystem/path/formatter.md | 87 ++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 reference/filesystem/path/formatter.md diff --git a/reference/filesystem/path.md b/reference/filesystem/path.md index 2ee24d21ea..a938b10cb7 100644 --- a/reference/filesystem/path.md +++ b/reference/filesystem/path.md @@ -187,6 +187,12 @@ namespace std::filesystem { |------|------|----------------| | [`u8path`](u8path.md) | UTF-8エンコードされた文字列からパスオブジェクトを構築する | C++17
C++20で非推奨 | +## 文字列フォーマットサポート + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`formatter`](path/formatter.md) | [`std::formatter`](/reference/format/formatter.md)クラスの特殊化 | C++26 | + ## 例 ### POSIXベースシステムの例 diff --git a/reference/filesystem/path/formatter.md b/reference/filesystem/path/formatter.md new file mode 100644 index 0000000000..2ef4207527 --- /dev/null +++ b/reference/filesystem/path/formatter.md @@ -0,0 +1,87 @@ +# formatter +* filesystem[meta header] +* std[meta namespace] +* class[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + struct formatter; +} +``` + +## 概要 +`filesystem::path`クラスに対する[`std::formatter`](/reference/format/formatter.md)クラステンプレートの特殊化。 + +書式としては、以下を使用できる: + +``` +[[fill] align] [width] [?] [g] +``` + +* `fill` : アライメントに使う文字 (デフォルト: スペース) +* `align` : アライメント(デフォルトは型による) + * `>` : 右寄せ + * `<` : 左寄せ + * `^` : 中央寄せ +* `width` : 幅 (アライメントもしくは0埋めの幅) + * 置換フィールドを使って変数で指定できる +* `?` : デバッグ出力 + * 文字・文字列を引用符で囲み、エスケープシーケンスをエスケープして出力 +* `g` : 環境非依存のパスフォーマット ([`generic_string()`](generic_string.md)) を使用する + * これが指定されない場合は、プラットフォームごとのパスフォーマット ([`native()`](native.md)) を使用する + + +## 例 +```cpp example +#include +#include + +namespace fs = std::filesystem; + +int main() { + fs::path a = "/a/b/c.txt"; + fs::path b = "multi\nline"; + fs::path c = "a\\b\\c.txt"; + + // デフォルトフォーマットは、operator<<とちがって + // 引用符で囲まずに出力する + std::println("1 : {}", a); + + // デバッグ出力。 + // 引用符で囲み、エスケープシーケンスをエスケープして出力する + std::println("2 : {:?}", a); + std::println("3 : {:?}", b); + + // 環境非依存のパスフォーマット + std::println("4 : {:g}", c); + std::println("5 : {}", c); +} +``` + +### 出力例 +``` +1. /a/b/c.txt +2. "/a/b/c.txt" +3. "multi\nline" +4. a/b/c.txt +5. a\b\c.txt +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 20.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 14 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 10 [mark noimpl] + + +## 関連項目 +- [`std::format()`](/reference/format/format.md) (フォーマットの詳細) + + +## 参照 +- [P2845R8 Formatting of `std::filesystem::path`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2845r8.html) From af4077325f0e871ef767ae0cec6358fa9344bec5 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 10 Mar 2025 14:57:26 +0900 Subject: [PATCH 1466/3948] =?UTF-8?q?numeric=5Flimits:=20=E3=83=AA?= =?UTF-8?q?=E3=83=B3=E3=82=AF=E5=88=87=E3=82=8C=E3=81=97=E3=81=9F=E3=83=9A?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=81=B8=E3=81=AE=E5=8F=82=E7=85=A7=E3=82=92?= =?UTF-8?q?=E5=89=8A=E9=99=A4=20#1412?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/limits/numeric_limits/max_exponent.md | 1 - reference/limits/numeric_limits/max_exponent10.md | 1 - reference/limits/numeric_limits/min_exponent.md | 1 - reference/limits/numeric_limits/min_exponent10.md | 1 - 4 files changed, 4 deletions(-) diff --git a/reference/limits/numeric_limits/max_exponent.md b/reference/limits/numeric_limits/max_exponent.md index 95f84a9c53..1661ac4c85 100644 --- a/reference/limits/numeric_limits/max_exponent.md +++ b/reference/limits/numeric_limits/max_exponent.md @@ -49,7 +49,6 @@ double : 1024 ``` ## 参照 -* [takagi.in - 標準C++辞典 - ``ヘッダ](http://takagi.in/modules/bwiki/index.php?%A1%E3cfloat%A1%E4%A5%D8%A5%C3%A5%C0) * [`numeric_limits::min_exponent`](min_exponent.md) * [`numeric_limits::min_exponent10`](min_exponent10.md) * [`numeric_limits::max_exponent10`](max_exponent10.md) diff --git a/reference/limits/numeric_limits/max_exponent10.md b/reference/limits/numeric_limits/max_exponent10.md index f0cb82875f..4e32f8b2e2 100644 --- a/reference/limits/numeric_limits/max_exponent10.md +++ b/reference/limits/numeric_limits/max_exponent10.md @@ -49,7 +49,6 @@ double : 308 ``` ## 参照 -* [takagi.in - 標準C++辞典 - ``ヘッダ](http://takagi.in/modules/bwiki/index.php?%A1%E3cfloat%A1%E4%A5%D8%A5%C3%A5%C0) * [`numeric_limits::min_exponent`](min_exponent.md) * [`numeric_limits::min_exponent10`](min_exponent10.md) * [`numeric_limits::max_exponent`](max_exponent.md) diff --git a/reference/limits/numeric_limits/min_exponent.md b/reference/limits/numeric_limits/min_exponent.md index 253e15063f..abf4e2fcff 100644 --- a/reference/limits/numeric_limits/min_exponent.md +++ b/reference/limits/numeric_limits/min_exponent.md @@ -49,7 +49,6 @@ double : -1021 ``` ## 参照 -* [takagi.in - 標準C++辞典 - ``ヘッダ](http://takagi.in/modules/bwiki/index.php?%A1%E3cfloat%A1%E4%A5%D8%A5%C3%A5%C0) * [`numeric_limits::min_exponent10`](min_exponent10.md) * [`numeric_limits::max_exponent`](max_exponent.md) * [`numeric_limits::max_exponent10`](max_exponent10.md) diff --git a/reference/limits/numeric_limits/min_exponent10.md b/reference/limits/numeric_limits/min_exponent10.md index 9f157d115a..2e6fab6efe 100644 --- a/reference/limits/numeric_limits/min_exponent10.md +++ b/reference/limits/numeric_limits/min_exponent10.md @@ -49,7 +49,6 @@ double : -307 ``` ## 参照 -* [takagi.in - 標準C++辞典 - ``ヘッダ](http://takagi.in/modules/bwiki/index.php?%A1%E3cfloat%A1%E4%A5%D8%A5%C3%A5%C0) * [`numeric_limits::min_exponent`](min_exponent.md) * [`numeric_limits::max_exponent`](max_exponent.md) * [`numeric_limits::max_exponent10`](max_exponent10.md) From dbfde231cf8de921b410d545a1258f180ca32413 Mon Sep 17 00:00:00 2001 From: Akiko Kawai Date: Mon, 10 Mar 2025 15:43:52 +0900 Subject: [PATCH 1467/3948] Update implementation-status.md for ICC --- implementation-status.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/implementation-status.md b/implementation-status.md index 617e1fd663..5f25a76573 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -126,7 +126,7 @@ | P0138R2: [`enum class`変数の初期値として整数を指定する際の規則を調整](/lang/cpp17/construction_enum_class_values.md) | キャストを使用することなく整数を初期値として使用し、`E e{0};`のような初期化を許可 | 7 | 3.9 | 19.0 | 2017 Update 3 | | P0245R1: [16進浮動小数点数リテラル](/lang/cpp17/hexadecimal_floating_literals.md) | `hexfloat`マニピュレータや`printf()`の16進数出力に合わせて、浮動小数点数のリテラルも16進数表記できるようにする | 3.0 | 3.0 | 18.0 | 2017 Update 5 | | P0028R4: [属性の名前空間指定に繰り返しをなくす](/lang/cpp17/using_attribute_namespaces.md) | `[[using CC: opt(1), debug]]`のように属性の名前空間宣言をまとめて行う | 7 | 3.9 | 18.0 | 2017 Update 3 | -| P0035R4: [アライメント指定されたデータの動的メモリ確保](/lang/cpp17/dynamic_memory_allocation_for_over-aligned_data.md) | `operator new`と`operator delete`でアライメント値を取得できるようにする | 7 | 4 | No | 2017 Update 5 | +| P0035R4: [アライメント指定されたデータの動的メモリ確保](/lang/cpp17/dynamic_memory_allocation_for_over-aligned_data.md) | `operator new`と`operator delete`でアライメント値を取得できるようにする | 7 | 4 | 19.0 | 2017 Update 5 | | P0091R3: [クラステンプレートのテンプレート引数推論](/lang/cpp17/type_deduction_for_class_templates.md) | コンストラクタの引数からクラスのテンプレート引数を推論できるようにする | 7 | 5 | 19.1 | 2017 Update 7 | | P0127R2: [非型テンプレート引数の`auto`宣言](/lang/cpp17/declaring_non-type_template_arguments_with_auto.md) | `template `という冗長なコードを`template `のようにして受けられるようにし、
`X<3>; X; X<'a'>`のように定数を簡潔に渡せるようにする | 7 | 4 | 19.1 | 2017 Update 7 | | P0135R1: [値のコピー省略を保証](/lang/cpp17/guaranteed_copy_elision.md) | 一時オブジェクトをコピーする際に、単純な値を持つクラスであればコピーが省略されることを保証する | 7 | 4 | 19.1 | 2017 Update 6 | From 763ff88b681a359c8bc365b2eb1428ecc5bcfea0 Mon Sep 17 00:00:00 2001 From: Akiko Kawai Date: Tue, 11 Mar 2025 00:40:42 +0900 Subject: [PATCH 1468/3948] Update implementation-status for ICC --- implementation-status.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/implementation-status.md b/implementation-status.md index 5f25a76573..52a4c82d66 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -137,8 +137,8 @@ | P0217R3: [構造化束縛](/lang/cpp17/structured_bindings.md) | タプルやユーザー定義型を分解して受け取れるようにする
`tuple f();`
`const auto [a, b] = f(); // aはintの値、bはstringの値` | 7 | 4 | 18.0 | 2017 Update 3 | | P0305R1: [if文とswitch文の条件式と初期化を分離](/lang/cpp17/selection_statements_with_initializer.md) | `if (init; condition)`のように初期化と条件式を分けて記述できるようにする | 7 | 3.9 | 18.0 | 2017 Update 3 | | P0137R1: [参照メンバをもつクラスの置き換え](/lang/cpp17/replacement_of_class_objects_containing_reference_members.md) | 参照型メンバや`const`メンバ変数を含むクラスについてこれまで未定義動作とされていた配置`new`によるオブジェクトの置き換えを条件付きで可能とする | 7 | 6.0 | No | 2017 Update 7 | -| P0003R5: [非推奨だった例外仕様を削除](/lang/cpp17/remove_deprecated_exception_specifications.md) | `noexcept`が入ったことによって非推奨になった`throw`キーワードによる例外仕様を削除 | 7 | 4 | No | 2017 Update 5 | -| P0195R2: [using宣言でのパック展開](/lang/cpp17/pack_expansions_in_using.md) | パラメータパックの型を基底クラスとして指定した場合に、`using`宣言に基底クラスのパラメータパックを指定できるようにする | 7 | 4 | No | 2017 Update 7 | +| P0003R5: [非推奨だった例外仕様を削除](/lang/cpp17/remove_deprecated_exception_specifications.md) | `noexcept`が入ったことによって非推奨になった`throw`キーワードによる例外仕様を削除 | 7 | 4 | 19.0 | 2017 Update 5 | +| P0195R2: [using宣言でのパック展開](/lang/cpp17/pack_expansions_in_using.md) | パラメータパックの型を基底クラスとして指定した場合に、`using`宣言に基底クラスのパラメータパックを指定できるようにする | 7 | 4 | 19.0 | 2017 Update 7 | | P0512R0: [クラステンプレート引数の推論仕様を調整][P0512R0] | | 8 | 5.0 | No | 2017 Update 7 | | P0490R0: [Committee Draftに対するNational Body Commentへの対応][P0490R0] | | - | - | - | - | | P0522R0: [テンプレートテンプレート引数のマッチングにおいて、互換性のあるテンプレートを除外][P0522R0] | | 7 | 4 (partial) | 19.1 | 2017 Update 5 | From 883eeeff4f2dd4b9b3c68672231e61c4bb914c8e Mon Sep 17 00:00:00 2001 From: Akiko Kawai Date: Tue, 11 Mar 2025 01:04:55 +0900 Subject: [PATCH 1469/3948] Update implementation-status for MSVC ref link of C++23 --- implementation-status.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/implementation-status.md b/implementation-status.md index 52a4c82d66..0ae5fc195e 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -233,8 +233,8 @@ - libstdc++: [C++ 2020 Implementation Status](https://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#status.iso.2020) - libc++: [libc++ C++20 Status](https://libcxx.llvm.org/Status/Cxx20.html) - Visual C++ (MSVC): - - [Visual C++ 言語への準拠](https://docs.microsoft.com/ja-jp/cpp/visual-cpp-language-conformance) - - [次リリース情報(VS2019,2022) - Change log](https://github.com/microsoft/STL/wiki/Changelog) + - [C++ Language Updates in MSVC in Visual Studio 2022 17.13](https://devblogs.microsoft.com/cppblog/msvc-compiler-updates-in-visual-studio-2022-version-17-13/) + - [MSVC Compiler Language Updates in Visual Studio 2022 version 17.12](https://devblogs.microsoft.com/cppblog/msvc-compiler-language-updates-in-visual-studio-2022-version-17-12/) - ICC: [C++20 Features Supported by Intel® C++ Compiler](https://www.intel.com/content/www/us/en/developer/articles/technical/c20-features-supported-by-intel-cpp-compiler.html) ## C++23言語機能の実装状況 From 1af6cd4fd440941af6621dc44889a02c13794976 Mon Sep 17 00:00:00 2001 From: Akiko Kawai Date: Tue, 11 Mar 2025 01:16:28 +0900 Subject: [PATCH 1470/3948] Update implementation-status for MSVC ver17.12 and 17.13 --- implementation-status.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/implementation-status.md b/implementation-status.md index 0ae5fc195e..8d015d6960 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -233,15 +233,15 @@ - libstdc++: [C++ 2020 Implementation Status](https://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#status.iso.2020) - libc++: [libc++ C++20 Status](https://libcxx.llvm.org/Status/Cxx20.html) - Visual C++ (MSVC): - - [C++ Language Updates in MSVC in Visual Studio 2022 17.13](https://devblogs.microsoft.com/cppblog/msvc-compiler-updates-in-visual-studio-2022-version-17-13/) - - [MSVC Compiler Language Updates in Visual Studio 2022 version 17.12](https://devblogs.microsoft.com/cppblog/msvc-compiler-language-updates-in-visual-studio-2022-version-17-12/) + - [Visual C++ 言語への準拠](https://docs.microsoft.com/ja-jp/cpp/visual-cpp-language-conformance) + - [次リリース情報(VS2019,2022) - Change log](https://github.com/microsoft/STL/wiki/Changelog) - ICC: [C++20 Features Supported by Intel® C++ Compiler](https://www.intel.com/content/www/us/en/developer/articles/technical/c20-features-supported-by-intel-cpp-compiler.html) ## C++23言語機能の実装状況 | 言語機能 | 説明 | [GCC][gcc] | [Clang][clang] | [ICX][icx] | [MSVC][msvc] | |----------|------|------------|----------------|------------|--------------| -| P0330R8: [(符号付き)`size_t`リテラルのためのサフィックス](/lang/cpp23/literal_suffix_for_signed_size_t.md) | `42z`/`42Z`とすることで`size_t`に対応する符号付き整数型のリテラルとする | 11 | 13 | 2022.2 | - | +| P0330R8: [(符号付き)`size_t`リテラルのためのサフィックス](/lang/cpp23/literal_suffix_for_signed_size_t.md) | `42z`/`42Z`とすることで`size_t`に対応する符号付き整数型のリテラルとする | 11 | 13 | 2022.2 | 2022 Update 13 | | P2290R3: [エスケープシーケンスの区切り](/lang/cpp23/delimited_escape_sequences.md) | エスケープシーケンスの範囲を明確にする構文を追加する | 13 | 15 | 2023.2 | - | | P2266R3: [暗黙的なムーブを簡略化](/lang/cpp23/simpler_implicit_move.md) | 参照を返す関数の`return`文で暗黙的にムーブされない問題を修正 | 13 | 13 | 2022.2 | - | | P1787R6: [スコープと名前ルックアップの仕様整理](/lang/cpp23/declarations_and_where_to_find_them.md.nolink) | 複雑で不完全になっているスコープと名前ルックアップの仕様を整理し、一部の問題を解決する | - | - | - | - | @@ -251,7 +251,7 @@ | P2324R2: [複合文の末尾へのラベルを許可](/lang/cpp23/labels_at_the_end_of_compound_statements.md) | C互換のため、複合文の末尾でのgoto文のラベルを許可する | 13 | 16 | 2023.2 | - | | P0847R7: [自身のオブジェクトを明示的にパラメータとして指定する](/lang/cpp23/deducing_this.md.nolink) | メンバ関数が`*this`の型・オブジェクトをパラメータとしてとり、`*this`オブジェクトがconst/非const、左辺値/右辺値であるかをメンバ関数内で識別できるようにする | - | 18 | - | 2022 Update 2 (partial) | | P1847R4: [アクセス制御の異なるメンバ変数のレイアウトを宣言順に規定](/lang/cpp23/make_declaration_order_layout_mandated.md) | アクセス制御の異なるメンバ変数のレイアウトは並び替えを許可されていたが宣言順に規定する | Yes | Yes | - | 2022 | -| P2128R6: [添字演算子の多次元サポート](/lang/cpp23/multidimensional_subscript_operator.md) | `operator[](int x, int y, int z)`のように添字演算子のオーバーロードで複数のパラメータをとることを許可 | 12 | 15 | 2022.2 | - | +| P2128R6: [添字演算子の多次元サポート](/lang/cpp23/multidimensional_subscript_operator.md) | `operator[](int x, int y, int z)`のように添字演算子のオーバーロードで複数のパラメータをとることを許可 | 12 | 15 | 2022.2 | 2022 Update 12 | | P1169R4: [`this`ポインタをもつ必要のない演算子を`static`として宣言できるようにする](/lang/cpp23/static_operator.md) | 状態をもたないいくつかの演算子を`static`として宣言できるようにする | 13 | 16 | 2023.2 | - | | P2201R1: [異なる文字エンコーディングをもつ文字列リテラルの連結を不適格とする](/lang/cpp23/mixed_string_literal_concatenation.md) | `auto a = u8"" L"";`のような異なる文字エンコーディング同士での文字列リテラルを連結を禁止する | Yes | Yes | 2022.2 | Yes | | P2029R4: [文字・文字列リテラル中の数値・ユニバーサルキャラクタのエスケープに関する問題解決](/lang/cpp23/numeric_and_universal_character_escapes_in_character_and_string_literals.md.nolink) | | - | - | - | - | @@ -261,7 +261,7 @@ | P2582R1: [継承コンストラクタからのクラステンプレート引数の推論](/lang/cpp23/class_template_argument_deduction_from_inherited.md) | 継承コンストラクタからもクラステンプレート引数を推論できるようにする | - | - | - | - | | P1938R3: [`if consteval`](/lang/cpp23/if_consteval.md) | コンパイル時の文脈かどうかで分岐させる | 12 | 14 | - | - | | P1401R5: [定数式の文脈での`bool`への縮小変換を許可](/lang/cpp23/narrowing_contextual_conversions_to_bool.md) | `if constexpr(flags & Flags::Exec)`や`static_assert(N);`を許可 | 9 | 13 | 2022.2 | - | -| P2242R3: [定数式内での非リテラル変数、静的変数・スレッドローカル変数およびgotoとラベルの存在を許可する](/lang/cpp23/non_literal_variables_in_constexpr_functions.md) | コンパイル時に評価されない限り、定数式内に静的変数・スレッドローカル変数およびgoto文とラベルを含むことを許可する | 12 | 15 | 2022.2 | - | +| P2242R3: [定数式内での非リテラル変数、静的変数・スレッドローカル変数およびgotoとラベルの存在を許可する](/lang/cpp23/non_literal_variables_in_constexpr_functions.md) | コンパイル時に評価されない限り、定数式内に静的変数・スレッドローカル変数およびgoto文とラベルを含むことを許可する | 12 | 15 | 2022.2 | 2022 Update 13 | | P2246R1: [静的な診断メッセージの文字エンコーディング](/lang/cpp23/character_encoding_of_diagnostic_text.md) | `static_assert`や`[[deprecated]]`などの診断メッセージの文字集合に関する要件をなくす | - | yes | 2022.2 | 2022 | | P2448R2: [`constexpr`関数が定数実行できない場合でも適格とする](/lang/cpp23/relaxing_some_constexpr_restrictions.md) | | 13 | 17 (partial) | 2024.0 (partial) | - | | P2647R1: [`constexpr`関数内での`static constexpr`変数を許可](/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md) | `constexpr`関数のローカルで定数を定義できるようにする | 13 | 16 | 2023.2 | - | @@ -281,8 +281,9 @@ - GCC: [C++23 Support in GCC](https://gcc.gnu.org/projects/cxx-status.html#cxx23) - Clang: [C++2b implementation status](https://clang.llvm.org/cxx_status.html#cxx23) - Visual C++ (MSVC): + - [C++ Language Updates in MSVC in Visual Studio 2022 17.13](https://devblogs.microsoft.com/cppblog/msvc-compiler-updates-in-visual-studio-2022-version-17-13/) + - [MSVC Compiler Language Updates in Visual Studio 2022 version 17.12](https://devblogs.microsoft.com/cppblog/msvc-compiler-language-updates-in-visual-studio-2022-version-17-12/) - [Visual C++ 言語への準拠](https://docs.microsoft.com/ja-jp/cpp/visual-cpp-language-conformance) - - [次リリース情報(VS2019,2022) - Change log](https://github.com/microsoft/STL/wiki/Changelog) - ICX: [C++23 Features Supported by Intel® C++ Compiler](https://www.intel.com/content/www/us/en/developer/articles/technical/c23-features-supported-by-intel-c-compiler.html) From 3e6fab601ba3a1487eb76f8b526c92dfe64f3258 Mon Sep 17 00:00:00 2001 From: Akiko Kawai Date: Tue, 11 Mar 2025 02:19:12 +0900 Subject: [PATCH 1471/3948] Update implementation.md for checking of MSVC 17.13.2 --- implementation.md | 1 + 1 file changed, 1 insertion(+) diff --git a/implementation.md b/implementation.md index 9c63e580f3..cd906e1a15 100644 --- a/implementation.md +++ b/implementation.md @@ -141,6 +141,7 @@ | 表記 | 製品名 [Visual Studio バージョン] †1 | VC++ バージョン †2 | `_MSC_VER` | `_MSC_FULL_VER` | |---------------|----------------------------------------|-----------------|------------|-----------------| +| 2022 Update 13 | Visual Studio 2022 Version 17.13.2 | 14.43 | 1943 | 194334808 | | 2022 Update 13 | Visual Studio 2022 Version 17.13.0 | 14.43 | 1943 | 194334808 | | 2022 Update 12 | Visual Studio 2022 Version 17.12.4 | 14.42 | 1942 | 194234436 | | 2022 Update 12 | Visual Studio 2022 Version 17.12.3 | 14.42 | 1942 | 194234435 | From 679bbe5a4b24425398ee3e4db83a8e1e12fb885b Mon Sep 17 00:00:00 2001 From: Akiko Kawai Date: Tue, 11 Mar 2025 02:43:30 +0900 Subject: [PATCH 1472/3948] Update implementation-status.md for MSVC supporting C++23/ Added ref link --- implementation-status.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/implementation-status.md b/implementation-status.md index 8d015d6960..afaf889eb0 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -270,7 +270,7 @@ | P2173R1: [ラムダ式に対する属性](/lang/cpp23/attributes_on_lambda_expressions.md) | ラムダ式のいくつかの箇所に属性を記述できるようにする | 9 | 13 | 2022.2 | - | | P1774R8: [コード内容の仮定をコンパイラに伝えるassume属性](/lang/cpp23/portable_assumptions.md) | 最適化のために、コードの仮定をコンパイラに伝える属性を標準化する | 13 | - | - | - | | P2316R2: [文字リテラルエンコーディングを一貫させる](/lang/cpp23/consistent_character_literal_encoding.md) | プリプロセッサの条件式での文字リテラルの扱いをC++式と同様にする | yes | yes | 2022.2 | 2022 | -| P2334R1: [`elif`/`elifdef`/`elifndef`のサポートを追加](/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md) | `#if`/`#ifdef`/`#ifndef`に対応する複数条件命令のサポートを追加する | 12 | 13 | 2022.2 | - | +| P2334R1: [`elif`/`elifdef`/`elifndef`のサポートを追加](/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md) | `#if`/`#ifdef`/`#ifndef`に対応する複数条件命令のサポートを追加する | 12 | 13 | 2022.2 | 2022 Update 10 | | P2437R1: [`#warning`のサポートを追加](/lang/cpp23/warning.md) | 多くのC++コンパイラが実装していたプリプロセス時の警告`#warning message`を正式サポート | yes | yes | 2023.2 | yes | | P2295R6: [汎用的なソースコードのエンコーディングとしてUTF-8をサポート](/lang/cpp23/support_for_utf8_as_a_portable_source_file_encoding.md) | すべてのコンパイラはUTF-8文字コードのソースコードをサポートしなければならない | 13 | 15 | 2023.2 | 2019 Update 2 | | P2223R2: [行末スペースを無視するよう規定](/lang/cpp23/trimming_whitespaces_before_line_splicing.md) | 行末が「\ 」でおわっていた場合にMSVCは行の継続をしない実装になっていたため動作を共通化するため仕様を規定 | Yes | Yes | 2022.2 | - | @@ -281,6 +281,7 @@ - GCC: [C++23 Support in GCC](https://gcc.gnu.org/projects/cxx-status.html#cxx23) - Clang: [C++2b implementation status](https://clang.llvm.org/cxx_status.html#cxx23) - Visual C++ (MSVC): + - [C++ Conformance improvements, behavior changes, and bug fixes in Visual Studio 2022](https://learn.microsoft.com/en-us/cpp/overview/cpp-conformance-improvements?view=msvc-170) - [C++ Language Updates in MSVC in Visual Studio 2022 17.13](https://devblogs.microsoft.com/cppblog/msvc-compiler-updates-in-visual-studio-2022-version-17-13/) - [MSVC Compiler Language Updates in Visual Studio 2022 version 17.12](https://devblogs.microsoft.com/cppblog/msvc-compiler-language-updates-in-visual-studio-2022-version-17-12/) - [Visual C++ 言語への準拠](https://docs.microsoft.com/ja-jp/cpp/visual-cpp-language-conformance) @@ -327,7 +328,7 @@ - [C++2c implementation status](https://clang.llvm.org/cxx_status.html#cxx26) - [libc++ Format Status](https://libcxx.llvm.org/Status/Format.html) - Visual C++ (MSVC): - - [Change log](https://github.com/microsoft/STL/wiki/Changelog) + - [C++ Conformance improvements, behavior changes, and bug fixes in Visual Studio 2022](https://learn.microsoft.com/en-us/cpp/overview/cpp-conformance-improvements?view=msvc-170) [gcc]: ./implementation.md#gcc From 77cc07193dd046556f7824b4d260cd4f694380f3 Mon Sep 17 00:00:00 2001 From: Akiko Kawai Date: Tue, 11 Mar 2025 02:46:59 +0900 Subject: [PATCH 1473/3948] Deleted unnecessary link for MSVC C++23 on implementation-status.md --- implementation-status.md | 1 - 1 file changed, 1 deletion(-) diff --git a/implementation-status.md b/implementation-status.md index afaf889eb0..66bbb52e81 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -284,7 +284,6 @@ - [C++ Conformance improvements, behavior changes, and bug fixes in Visual Studio 2022](https://learn.microsoft.com/en-us/cpp/overview/cpp-conformance-improvements?view=msvc-170) - [C++ Language Updates in MSVC in Visual Studio 2022 17.13](https://devblogs.microsoft.com/cppblog/msvc-compiler-updates-in-visual-studio-2022-version-17-13/) - [MSVC Compiler Language Updates in Visual Studio 2022 version 17.12](https://devblogs.microsoft.com/cppblog/msvc-compiler-language-updates-in-visual-studio-2022-version-17-12/) - - [Visual C++ 言語への準拠](https://docs.microsoft.com/ja-jp/cpp/visual-cpp-language-conformance) - ICX: [C++23 Features Supported by Intel® C++ Compiler](https://www.intel.com/content/www/us/en/developer/articles/technical/c23-features-supported-by-intel-c-compiler.html) From ec441a2f97ebd12dece4909a3a4e103236b280b6 Mon Sep 17 00:00:00 2001 From: Akiko Kawai Date: Tue, 11 Mar 2025 14:38:54 +0900 Subject: [PATCH 1474/3948] Update implementation-status.md for C++26 of GCC --- implementation-status.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/implementation-status.md b/implementation-status.md index 66bbb52e81..c4c86b576b 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -299,7 +299,7 @@ | P2738R1: [定数式での`void*`からポインタ型へのキャストを許可](/lang/cpp26/constexpr_cast_from_voidptr.md.nolink) | 型消去のために`void*`からポインタ型へのキャストを許可する | 14 | 17 | | | | P2741R3: [`static_assert`の診断メッセージにユーザーが生成した文字列の指定を許可](/lang/cpp26/user-generated_static_assert_messages.md) | `constexpr`な`S.size()`と`S.data()`メンバ関数をもつオブジェクトをコンパイル時文字列として指定できるようにする | 14 | 17 | | | | P2558R2: [基本文字集合に@、$、\`を追加](/lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md) | C言語との互換性のためにこれらの文字を基本文字集合に追加 | | Yes | | | -| P2662R3: [パラメータパックへのインデックスアクセスを許可](/lang/cpp26/pack_indexing.md.nolink) | 可変引数テンプレートのパラメータパックに添字アクセスできるようにする | | | | | +| P2662R3: [パラメータパックへのインデックスアクセスを許可](/lang/cpp26/pack_indexing.md.nolink) | 可変引数テンプレートのパラメータパックに添字アクセスできるようにする | 15 | | | | | P2864R2: [非推奨となっていた列挙値から算術型への暗黙変換を削除](/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md) | C++20から非推奨となっていた列挙値への算術演算で算術型に暗黙変換される仕様を削除 | 14 | 18 | | | | P2748R5: [返却された左辺値から暗黙変換された一時オブジェクトが参照に束縛されることを禁止する](/lang/cpp26/disallow_binding_a_returned_glvalue_to_a_temporary.md.nolink) | 寿命切れの変数によって引き起こされるバグを防止する | 14 | 19 | | | | P3106R1: [要素数不明の配列を集成体初期化する規則を明確化](/lang/cpp26/clarifying_rules_for_brace_elision_in_aggregate_initialization.md.nolink) | 配列要素の集成体初期化で`{}`が省略された場合の矛盾していた規定を修正 | yes | 17 | | | @@ -309,11 +309,11 @@ | P2795R5: [未初期化変数の読み取りをエラー性動作とする](/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md) | 初期化されていない自動変数の読み取りの安全性を規定する | | | | | | P2573R2: [関数宣言を削除する理由を指定できるようにする](/lang/cpp26/delete_reason.md) | `f() = delete("reason");` | 15 | 19 | | | | P2893R3: [可変引数テンプレートで`friend`宣言をできるようにする](/lang/cpp26/variadic_friends.md.nolink) | クラステンプレートの可変引数テンプレートでまとめて`friend`宣言できるようにする | 15 | | | | -| P2747R2: [`constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md.nolink) | 定数式の文脈での配置`new`を許可 | | | | | +| P2747R2: [`constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md.nolink) | 定数式の文脈での配置`new`を許可 | 15 | | | | | P3144R2: [不完全型へのポインタに対する`delete`を不適格とする](/lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md.nolink) | 未定義動作を引き起こす操作をコンパイルエラーとする | 15 | 19 | | | | P2963R3: [制約式内での畳み込み式の順序付け](/lang/cpp26/ordering_of_constraints_involving_fold_expressions.md.nolink) | 畳み込み式では全体ではなく個別の制約を原子制約式として扱う | | 19 | | | | P0963R3: [条件式での構造化束縛の使用を許可](/lang/cpp26/structured_binding_declaration_as_a_condition.md) | 式全体を`bool`値に変換できる場合に条件式で構造化束縛を使用できることとする | 15 | | | | -| P2686R5: [`constexpr`構造化束縛の許可と、定数式への参照を定数式とする](/lang/cpp26/constexpr_structured_bindings_and_references_to_constexpr_variables.md.nolink) | 定数式に対する構造化束縛を許可し、関連する定数式への参照が定数式になるようにする | | | | | +| P2686R5: [`constexpr`構造化束縛の許可と、定数式への参照を定数式とする](/lang/cpp26/constexpr_structured_bindings_and_references_to_constexpr_variables.md.nolink) | 定数式に対する構造化束縛を許可し、関連する定数式への参照が定数式になるようにする | 15 | | | | | P3068R6: [定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md.nolink) | 定数式の文脈での例外の送出と捕捉を許可 | | | | | | P2865R6: [非推奨だった配列の比較を削除](/lang/cpp26/remove_deprecated_array_comparisons.md.nolink) | C++20で非推奨となっていた配列比較を削除 | 15 | 20 | | | | P1061R10: [構造化束縛でパックを導入できるようにする](/lang/cpp26/structured_bindings_can_introduce_a_pack.md.nolink) | タプルを分解する際に複数の変数をパックとして宣言できるようにする。`auto [a, ...xs] = f();` | | | | | From eb770b5b6cf5bcd10abac570b811873395711741 Mon Sep 17 00:00:00 2001 From: Akiko Kawai Date: Tue, 11 Mar 2025 14:51:27 +0900 Subject: [PATCH 1475/3948] Update implementation-status.md for c++23 of Clang --- implementation-status.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/implementation-status.md b/implementation-status.md index c4c86b576b..db952e0255 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -247,7 +247,7 @@ | P1787R6: [スコープと名前ルックアップの仕様整理](/lang/cpp23/declarations_and_where_to_find_them.md.nolink) | 複雑で不完全になっているスコープと名前ルックアップの仕様を整理し、一部の問題を解決する | - | - | - | - | | P2615R1: [無意味なexport宣言を禁止する](/lang/cpp23/meaningful_exports.md) | いくつかの不必要な宣言に対するモジュールexportを禁止する | - | - | - | - | | P2360R0: [初期化文での型の別名宣言を許可](/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md) | `for (using T = int; T e : v) {}`を許可 | 12 | 14 | 2022.2 | - | -| P2718R0: [範囲for文が範囲初期化子内で生じた一時オブジェクトを延命することを規定](lang/cpp23/lifetime_extension_in_range_based_for_loop.md) | 範囲初期化子内で生じた一時オブジェクトは範囲for文の終わりまで延命される | - | - | - | - | +| P2718R0: [範囲for文が範囲初期化子内で生じた一時オブジェクトを延命することを規定](lang/cpp23/lifetime_extension_in_range_based_for_loop.md) | 範囲初期化子内で生じた一時オブジェクトは範囲for文の終わりまで延命される | - | 20 | - | - | | P2324R2: [複合文の末尾へのラベルを許可](/lang/cpp23/labels_at_the_end_of_compound_statements.md) | C互換のため、複合文の末尾でのgoto文のラベルを許可する | 13 | 16 | 2023.2 | - | | P0847R7: [自身のオブジェクトを明示的にパラメータとして指定する](/lang/cpp23/deducing_this.md.nolink) | メンバ関数が`*this`の型・オブジェクトをパラメータとしてとり、`*this`オブジェクトがconst/非const、左辺値/右辺値であるかをメンバ関数内で識別できるようにする | - | 18 | - | 2022 Update 2 (partial) | | P1847R4: [アクセス制御の異なるメンバ変数のレイアウトを宣言順に規定](/lang/cpp23/make_declaration_order_layout_mandated.md) | アクセス制御の異なるメンバ変数のレイアウトは並び替えを許可されていたが宣言順に規定する | Yes | Yes | - | 2022 | @@ -268,7 +268,7 @@ | P2564R3: [`constexpr`関数内で`consteval`関数を呼び出せない問題を緩和](/lang/cpp23/consteval_needs_to_propagate_up.md) | `consteval`呼び出しを含む`constexpr`関数を条件付きで`consteval`関数とみなすようにする | - | 17 | 2024.0 | - | | P1102R2: [ラムダ式で`()`を省略できる条件を緩和](/lang/cpp23/down_with_lambda_parens.md) | 修飾や戻り値型をともなってもパラメータリストが空であれば`()`を省略できる | 11 | 13 | 2022.2 | - | | P2173R1: [ラムダ式に対する属性](/lang/cpp23/attributes_on_lambda_expressions.md) | ラムダ式のいくつかの箇所に属性を記述できるようにする | 9 | 13 | 2022.2 | - | -| P1774R8: [コード内容の仮定をコンパイラに伝えるassume属性](/lang/cpp23/portable_assumptions.md) | 最適化のために、コードの仮定をコンパイラに伝える属性を標準化する | 13 | - | - | - | +| P1774R8: [コード内容の仮定をコンパイラに伝えるassume属性](/lang/cpp23/portable_assumptions.md) | 最適化のために、コードの仮定をコンパイラに伝える属性を標準化する | 13 | 19 | - | - | | P2316R2: [文字リテラルエンコーディングを一貫させる](/lang/cpp23/consistent_character_literal_encoding.md) | プリプロセッサの条件式での文字リテラルの扱いをC++式と同様にする | yes | yes | 2022.2 | 2022 | | P2334R1: [`elif`/`elifdef`/`elifndef`のサポートを追加](/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md) | `#if`/`#ifdef`/`#ifndef`に対応する複数条件命令のサポートを追加する | 12 | 13 | 2022.2 | 2022 Update 10 | | P2437R1: [`#warning`のサポートを追加](/lang/cpp23/warning.md) | 多くのC++コンパイラが実装していたプリプロセス時の警告`#warning message`を正式サポート | yes | yes | 2023.2 | yes | @@ -279,7 +279,7 @@ 各処理系のC++23実装状況ページ: - GCC: [C++23 Support in GCC](https://gcc.gnu.org/projects/cxx-status.html#cxx23) -- Clang: [C++2b implementation status](https://clang.llvm.org/cxx_status.html#cxx23) +- Clang: [C++23 implementation status](https://clang.llvm.org/cxx_status.html#cxx23) - Visual C++ (MSVC): - [C++ Conformance improvements, behavior changes, and bug fixes in Visual Studio 2022](https://learn.microsoft.com/en-us/cpp/overview/cpp-conformance-improvements?view=msvc-170) - [C++ Language Updates in MSVC in Visual Studio 2022 17.13](https://devblogs.microsoft.com/cppblog/msvc-compiler-updates-in-visual-studio-2022-version-17-13/) From c14bf1e4eeb9fa6a1de59a24e00c407fc57b1204 Mon Sep 17 00:00:00 2001 From: Daisuke Sugiyama <5922503+dsugiyama@users.noreply.github.com> Date: Thu, 13 Mar 2025 20:07:04 +0900 Subject: [PATCH 1476/3948] =?UTF-8?q?std::format=20=E3=81=AE=E3=83=9D?= =?UTF-8?q?=E3=82=A4=E3=83=B3=E3=82=BF=E3=81=AB=E5=AF=BE=E3=81=99=E3=82=8B?= =?UTF-8?q?=E6=9B=B8=E5=BC=8F=20"P"=20=E3=81=AE=E8=AA=AC=E6=98=8E=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/format.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/format/format.md b/reference/format/format.md index 9616f8b790..de569ac665 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -162,7 +162,7 @@ string s3 = format("{} {1}", "a", "b"); // コンパイルエラー | type | 意味 | 効果 | 対応バージョン | |:-----|:-------------------|:--------------------------------------------------------------------------------------------------|----------------| | p | アドレスを出力する | `0x` につづいて、`to_chars(first, last, reinterpret_cast(value), 16)` の結果を出力する | C++20 | -| P | アドレスを出力する | pと基本的に同じだが、9桁を超える場合に大文字にし、先頭に`0X`をつける | C++26 | +| P | アドレスを出力する | pと基本的に同じだが、9を超える桁を大文字(A~F)にし、先頭に`0X`をつける | C++26 | デフォルトは `p`。 From 586e0ffc00b0cdeb92f0b25bf592077d6e138112 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 21 Mar 2025 16:51:28 +0900 Subject: [PATCH 1477/3948] =?UTF-8?q?=E5=9B=BD=E9=9A=9B=E6=A8=99=E6=BA=96?= =?UTF-8?q?=E8=A6=8F=E6=A0=BC=20:=20C++26=20Working=20Draft=E3=82=92?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=20#1415?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- international-standard.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/international-standard.md b/international-standard.md index f478d38273..0d0c42fe6d 100644 --- a/international-standard.md +++ b/international-standard.md @@ -12,7 +12,7 @@ C++ の標準規格は、他にも各国の規格化団体によって国際標 | 通称†1 | 名称 | 参照する規格案†2 | 規格案・原案 | `__cplusplus` | |:--|:--|:--|:--|:--| -| [C++26](lang/cpp26.md) (C++2c) | ISO/IEC 14882:2026 (予定) | N5001([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/n5001.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/)) | N5001 N4993 N4986 N4981 N4971 N4964 N4958 | -- | +| [C++26](lang/cpp26.md) (C++2c) | ISO/IEC 14882:2026 (予定) | N5008([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/n5008.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/)) | N5008 N5001 N4993 N4986 N4981 N4971 N4964 N4958 | -- | | [C++23](lang/cpp23.md) (C++2b) | ISO/IEC 14882:2024 | N4950([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4950.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4950/)) | N4950 N4944 N4928 N4917 N4910 N4901 N4892 N4885 N4878
N4868 N4861 | `202302L` | | [C++20](lang/cpp20.md) (C++2a) | ISO/IEC 14882:2020 | N4861†3([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/n4861.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4861/)) | N4860 N4849 N4842 N4835 N4830
N4820 N4810 N4800 N4791 N4788†4
N4778 N4762 N4750 N4741 N4727
N4713 N4700 N4687 | `202002L` | | [C++17](lang/cpp17.md) (C++1z) | ISO/IEC 14882:2017 | N4659([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4659.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4659/)) | N4660 N4659 N4640 N4618 N4606
N4594 N4582 N4567 N4527 N4431
N4296 | `201703L` | From 9b210609a8863011cbfb5cb9455f46a0e789735c Mon Sep 17 00:00:00 2001 From: suomesta Date: Sun, 23 Mar 2025 15:44:34 +0900 Subject: [PATCH 1478/3948] update istream_iterator constructor --- .../istream_iterator/op_constructor.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/reference/iterator/istream_iterator/op_constructor.md b/reference/iterator/istream_iterator/op_constructor.md index 65b84578ed..dee0ee8573 100644 --- a/reference/iterator/istream_iterator/op_constructor.md +++ b/reference/iterator/istream_iterator/op_constructor.md @@ -5,15 +5,23 @@ * function[meta id-type] ```cpp -istream_iterator(); // (1) -istream_iterator(istream_type& s); // (2) -istream_iterator(const istream_iterator& x) = default; // (3) +istream_iterator(); // (1) C++03 +constexpr istream_iterator(); // (1) C++11 + +constexpr istream_iterator(default_sentinel_t); // (2) C++20 + +istream_iterator(istream_type& s); // (3) + +istream_iterator(const istream_iterator& x); // (4) C++03 +istream_iterator(const istream_iterator& x) = default; // (4) C++11 ``` +* default_sentinel_t[link /reference/iterator/default_sentinel_t.md] ## 概要 - (1) : デフォルトコンストラクタ。メンバ変数として保持する入力ストリームへのポインタをヌル初期化する。デフォルトコンストラクタで構築された`istream_iterator`オブジェクトは、イテレータの終端値として使用できる。 -- (2) : 入力ストリームオブジェクトへの参照を受け取り、メンバ変数にそのオブジェクトへのポインタを保持する。`operator*()`で現在参照している値を返すために、この段階で入力ストリームから値を読み取り、メンバ変数に値を保持する。 -- (3) : コピーコンストラクタ +- (2) : [`default_sentinel`](/reference/iterator/default_sentinel_t.md)を受け取り、(1)と同等の構築をより明示的に行う。 +- (3) : 入力ストリームオブジェクトへの参照を受け取り、メンバ変数にそのオブジェクトへのポインタを保持する。`operator*()`で現在参照している値を返すために、この段階で入力ストリームから値を読み取り、メンバ変数に値を保持する。 +- (4) : コピーコンストラクタ ## 例 From 518b6e20eee5a3076248a6e5a228ba7e85053162 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 26 Mar 2025 18:37:24 +0900 Subject: [PATCH 1479/3948] =?UTF-8?q?C++26:=202025-03=20mailing=E3=81=AE?= =?UTF-8?q?=E8=A8=80=E8=AA=9E=E6=A9=9F=E8=83=BD=E3=82=92=E8=A8=98=E8=BC=89?= =?UTF-8?q?=20#1415?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 5 +++++ lang/cpp26.md | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/implementation-status.md b/implementation-status.md index db952e0255..01d7679041 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -318,6 +318,11 @@ | P2865R6: [非推奨だった配列の比較を削除](/lang/cpp26/remove_deprecated_array_comparisons.md.nolink) | C++20で非推奨となっていた配列比較を削除 | 15 | 20 | | | | P1061R10: [構造化束縛でパックを導入できるようにする](/lang/cpp26/structured_bindings_can_introduce_a_pack.md.nolink) | タプルを分解する際に複数の変数をパックとして宣言できるようにする。`auto [a, ...xs] = f();` | | | | | | P3176R0: [先行するカンマのない省略記号を非推奨化](/lang/cpp26/the_oxford_variadic_comma.md.nolink) | `void f(int, ...);`はOK。`void f(int...);`は非推奨 | 15 | 20 | | | +| P3074R7: [共用体をトリビアルに未初期化できるようにする](/lang/cpp26/trivial_unions.md.nolink) | `constexpr`での`union U { T storage[N]; };`を許可し、未初期化にできるようにする | | | | | +| P2900R14: [契約プログラミングをサポートする](/lang/cpp26/contracts.md.nolink) | 関数の事前条件、事後条件、不変条件を記述できるようにする | | | | | +| P2841R7: [コンセプトと変数テンプレートにテンプレートテンプレートパラメータのサポートを追加](/lang/cpp26/concept_and_variable-template_template-parameters.md.nolink) | テンプレート引数をあとで指定するテンプレートテンプレートパラメータを、コンセプトと変数テンプレートでも使用できるようにする | | | | | +| P2786R13: [トリビアルな再配置](/lang/cpp26/trivial_relocatability.md.nolink) | ムーブ構築と破棄のためにビット単位のコピーとデストラクタ評価が必要になる型のオブジェクトを再配置するメカニズムを導入する | | | | | +| P1967R14: [ファイルを読み込む`#embed`命令を追加](/lang/cpp26/embed.md) | バイナリファイルをインクルードするメカニズム。`#include`とちがって読み出しサイズなどの柔軟な指定ができる | 15 | | | | 各処理系のC++26実装状況ページ: diff --git a/lang/cpp26.md b/lang/cpp26.md index 242762a85e..ae070e10bf 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -43,6 +43,16 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| | [関数宣言を削除する理由を指定できるようにする](/lang/cpp26/delete_reason.md) | `f() = delete("reason");` | +| [契約プログラミングをサポートする](/lang/cpp26/contracts.md.nolink) | 関数の事前条件、事後条件、不変条件を記述できるようにする | + + +### クラス + +| 言語機能 | 説明 | +|----------|------| +| [変換コンストラクタという用語を廃止する](/lang/cpp26/abolish_the_term_converting_constructor.md.nolink) | 規格上で「`explicit`ではないコンストラクタ」という意味で定義されていたあまり使われない用語「変換コンストラクタ」を削除する | +| [共用体をトリビアルに未初期化できるようにする](/lang/cpp26/trivial_unions.md.nolink) | `constexpr`での`union U { T storage[N]; };`を許可し、未初期化にできるようにする | +| [トリビアルな再配置](/lang/cpp26/trivial_relocatability.md.nolink) | ムーブ構築と破棄のためにビット単位のコピーとデストラクタ評価が必要になる型のオブジェクトを再配置するメカニズムを導入する | ### 属性 @@ -60,6 +70,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | [パラメータパックへのインデックスアクセスを許可](/lang/cpp26/pack_indexing.md.nolink) | 可変引数テンプレートのパラメータパックに添字アクセスできるようにする | | [制約式内での畳み込み式の順序付け](/lang/cpp26/ordering_of_constraints_involving_fold_expressions.md.nolink) | 畳み込み式では全体ではなく個別の制約を原子制約式として扱う | | [可変引数テンプレートで`friend`宣言をできるようにする](/lang/cpp26/variadic_friends.md.nolink) | クラステンプレートの可変引数テンプレートでまとめて`friend`宣言できるようにする | +| [コンセプトと変数テンプレートにテンプレートテンプレートパラメータのサポートを追加](/lang/cpp26/concept_and_variable-template_template-parameters.md.nolink) | テンプレート引数をあとで指定するテンプレートテンプレートパラメータを、コンセプトと変数テンプレートでも使用できるようにする | ### 定数式 @@ -73,6 +84,13 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | [定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md.nolink) | 定数式の文脈での例外の送出と捕捉を許可 | +### プリプロセッサ + +| 言語機能 | 説明 | +|----------|------| +| [ファイルを読み込む`#embed`命令を追加](/lang/cpp26/embed.md) | バイナリファイルをインクルードするメカニズム。`#include`とちがって読み出しサイズなどの柔軟な指定ができる | + + ### ソースコード | 言語機能 | 説明 | @@ -359,6 +377,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [`std::bad_cast`](/reference/typeinfo/bad_cast.md)クラスの`what()`メンバ関数 - [`std::bad_typeid`](/reference/typeinfo/bad_typeid.md)クラスの`what()`メンバ関数 - [``](/reference/memory.md)に、ポインタのアライメントを判定する[`std::is_sufficiently_aligned()`](/reference/memory/is_sufficiently_aligned.md)関数を追加。 +- [``](/reference/utility.md)に、タイムトラベル最適化を抑止するための観測可能ポイントとして[`std::observable()`](/reference/utility/observable.md.nolink)を追加 ### デバッグ @@ -383,6 +402,8 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 ### 機能の非推奨化 - [``](/reference/type_traits.md)の[`std::is_trivial`](/reference/type_traits/is_trivial.md)を非推奨化 - これは[`std::is_trivially_copyable`](/reference/type_traits/is_trivially_copyable.md)と[`std::is_trivially_default_constructible`](/reference/type_traits/is_trivially_default_constructible.md)の2つが合わさったものであるが、それらは異なる状況で必要になるものであった +- [`std::memory_order::consume`](/reference/atomic/memory_order.md)と[`std::kill_dependency()`](/reference/atomic/kill_dependency.md)を非推奨化 + ### 非推奨の取り消し - [`std::polymorphic_allocator`](/reference/memory_resource/polymorphic_allocator.md)`::`[`destroy()`](/reference/memory_resource/polymorphic_allocator/destroy.md)の非推奨を取り消し From 0bbb13cc979d475fc871ffb3e77e944b5dbbd80b Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 26 Mar 2025 18:39:56 +0900 Subject: [PATCH 1480/3948] =?UTF-8?q?nolink=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp26.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/implementation-status.md b/implementation-status.md index 01d7679041..e09959f481 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -322,7 +322,7 @@ | P2900R14: [契約プログラミングをサポートする](/lang/cpp26/contracts.md.nolink) | 関数の事前条件、事後条件、不変条件を記述できるようにする | | | | | | P2841R7: [コンセプトと変数テンプレートにテンプレートテンプレートパラメータのサポートを追加](/lang/cpp26/concept_and_variable-template_template-parameters.md.nolink) | テンプレート引数をあとで指定するテンプレートテンプレートパラメータを、コンセプトと変数テンプレートでも使用できるようにする | | | | | | P2786R13: [トリビアルな再配置](/lang/cpp26/trivial_relocatability.md.nolink) | ムーブ構築と破棄のためにビット単位のコピーとデストラクタ評価が必要になる型のオブジェクトを再配置するメカニズムを導入する | | | | | -| P1967R14: [ファイルを読み込む`#embed`命令を追加](/lang/cpp26/embed.md) | バイナリファイルをインクルードするメカニズム。`#include`とちがって読み出しサイズなどの柔軟な指定ができる | 15 | | | | +| P1967R14: [ファイルを読み込む`#embed`命令を追加](/lang/cpp26/embed.md.nolink) | バイナリファイルをインクルードするメカニズム。`#include`とちがって読み出しサイズなどの柔軟な指定ができる | 15 | | | | 各処理系のC++26実装状況ページ: diff --git a/lang/cpp26.md b/lang/cpp26.md index ae070e10bf..31cdbf12b4 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -88,7 +88,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| -| [ファイルを読み込む`#embed`命令を追加](/lang/cpp26/embed.md) | バイナリファイルをインクルードするメカニズム。`#include`とちがって読み出しサイズなどの柔軟な指定ができる | +| [ファイルを読み込む`#embed`命令を追加](/lang/cpp26/embed.md.nolink) | バイナリファイルをインクルードするメカニズム。`#include`とちがって読み出しサイズなどの柔軟な指定ができる | ### ソースコード From 5b5528052dc7510d897b7c34fbfdd672dac5f997 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 26 Mar 2025 20:31:18 +0900 Subject: [PATCH 1481/3948] =?UTF-8?q?C++26:=202025-03=20mailing=E3=81=AE?= =?UTF-8?q?=E3=83=A9=E3=82=A4=E3=83=96=E3=83=A9=E3=83=AA=E6=A9=9F=E8=83=BD?= =?UTF-8?q?=E3=82=92=E8=A8=98=E8=BC=89=20#1415?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/lang/cpp26.md b/lang/cpp26.md index 31cdbf12b4..0fc7f7dbfb 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -116,6 +116,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 ## ライブラリ更新の概要 ### 新ライブラリ - 文字列エンコーディングを識別するライブラリとして、[``](/reference/text_encoding.md.nolink)を追加 +- 要素のメモリ位置が安定するシーケンスコンテナのライブラリとして[``](/reference/hive.md.nolink)を追加 - 並行処理におけるデータの参照・更新を行うRCU (Read Copy Update) のライブラリとして、[``](/reference/rcu.md)を追加 - 並行処理において参照中のデータが更新されないよう保護するハザードポインタのライブラリとして、[``](/reference/hazard_pointer.md.nolink)を追加 - データ並列ライブラリとして、[``](/reference/simd.md.nolink)を追加 @@ -161,6 +162,31 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [`std::span`](/reference/span/span.md)と[`std::mdspan`](/reference/mdspan/mdspan.md)の推論補助を改善 - [`std::views::concat`](/reference/ranges/concat_view.md)を追加 - [`std::views::cache_latest`](/reference/ranges/cache_latest.md.nolink)を追加 +- [`std::views::to_input`](/reference/ranges/to_input_view.md.nolink)を追加。書き換えできない入力専用の値に変換する +- Range関係の、償却定数時間での要素追加を行う機能を追加 + - 各viewクラスに`reserve_hint()`メンバ関数を追加 + - [`std::ranges::reserve_hint()`](/reference/ranges/reserve_hint.md.nolink)関数を追加 + - [`std::ranges::approximately_sized_range`](/reference/ranges/approximately_sized_range.md.nolink)コンセプトを追加 +- 連続イテレータのコンセプト[`contiguous_iterator`](/reference/iterator/contiguous_iterator.md)に、ポインタに変換できることを要件として追加 +- 以下のコンテナを`constexpr`に対応 + - [`std::deque`](/reference/deque/deque.md) + - [`std::forward_list`](/reference/forward_list/forward_list.md) + - [`std::list`](/reference/list/list.md) + - [`std::map`](/reference/map/map.md) (ただし[`node_handle`](/reference/node_handle/node_handle.md)`::`[`key()`](/reference/node_handle/node_handle/key.md)を使用すると未定義動作) + - [`std::multimap`](/reference/map/multimap.md) (ただし[`node_handle`](/reference/node_handle/node_handle.md)`::`[`key()`](/reference/node_handle/node_handle/key.md)を使用すると未定義動作) + - [`std::set`](/reference/set/set.md) + - [`std::multiset`](/reference/set/multiset.md) + - [`std::unordered_map`](/reference/unordered_map/unordered_map.md) (ハッシュ関数のカスタム化が必要) (ただし[`node_handle`](/reference/node_handle/node_handle.md)`::`[`key()`](/reference/node_handle/node_handle/key.md)を使用すると未定義動作) + - [`std::unordered_multimap`](/reference/unordered_map/unordered_multimap.md) (ハッシュ関数のカスタム化が必要) (ただし[`node_handle`](/reference/node_handle/node_handle.md)`::`[`key()`](/reference/node_handle/node_handle/key.md)を使用すると未定義動作) + - [`std::unordered_set`](/reference/unordered_set/unordered_set.md) (ハッシュ関数のカスタム化が必要) + - [`std::unordered_multiset`](/reference/unordered_set/unordered_multiset.md) (ハッシュ関数のカスタム化が必要) + - [`std::flat_map`](/reference/flat_map/flat_map.md) + - [`std::flat_multimap`](/reference/flat_map/flat_multimap.md) + - [`std::flat_set`](/reference/flat_set/flat_set.md) + - [`std::flat_multiset`](/reference/flat_set/flat_multiset.md) + - [`std::queue`](/reference/queue/queue.md) + - [`std::priority_queue`](/reference/queue/priority_queue.md) + - [`std::stack`](/reference/stack/stack.md) ### アルゴリズム @@ -249,7 +275,8 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [``](/reference/atomic.md)ライブラリのアトミック操作を`constexpr`対応 -### スマートポインタ +### スマートポインタ・メモリ関連 +- 動的確保したオブジェクトに値の意味論をもたせてディープコピーさせるユーティリティクラスとして、[``](/reference/memory.md)に[`std::indirect`](/reference/memory/indirect.md.nolink)クラスと[`std::polymorphic`](/reference/memory/polymorphic.md.nolink)クラスを追加 - [`std::weak_ptr`](/reference/memory/weak_ptr.md)を非順序連想コンテナのキーとして使用できるよう、[``](/reference/memory.md)に所有権ベースのハッシュ値を取得する関数オブジェクト[`std::owner_hash`](/reference/memory/owner_hash.md.nolink)、および所有権ベースの等値比較を行う関数オブジェクト[`std::owner_equal`](/reference/memory/owner_equal.md.nolink)を追加 - 関連して、[`std::shared_ptr`](/reference/memory/shared_ptr.md)クラスと[`std::weak_ptr`](/reference/memory/weak_ptr.md)クラスのメンバ関数として、`owner_hash()`と`owner_equal()`を追加 @@ -347,6 +374,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 ### ユーティリティ - [`std::variant`](/reference/variant/variant.md)クラスに、メンバ関数版の[`visit()`](/reference/variant/variant/visit.md.nolink)を追加 +- `std::monostate`を[``](/reference/variant.md)から[``](/reference/utility.md)に移動 - [`std::optional`](/reference/optional/optional.md)クラスに、0もしくは1要素のRangeとして扱えるようにするための拡張として、イテレータインタフェースを追加 - `iterator`型 - `const_iterator`型 @@ -378,6 +406,20 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [`std::bad_typeid`](/reference/typeinfo/bad_typeid.md)クラスの`what()`メンバ関数 - [``](/reference/memory.md)に、ポインタのアライメントを判定する[`std::is_sufficiently_aligned()`](/reference/memory/is_sufficiently_aligned.md)関数を追加。 - [``](/reference/utility.md)に、タイムトラベル最適化を抑止するための観測可能ポイントとして[`std::observable()`](/reference/utility/observable.md.nolink)を追加 +- 以下の例外型を`constexpr`対応 + - [`std::domain_error`](/reference/stdexcept.md) + - [`std::invalid_argument`](/reference/stdexcept.md) + - [`std::length_error`](/reference/stdexcept.md) + - [`std::logic_error`](/reference/stdexcept.md) + - [`std::out_of_range`](/reference/stdexcept.md) + - [`std::runtime_error`](/reference/stdexcept.md) + - [`std::range_error`](/reference/stdexcept.md) + - [`std::overflow_error`](/reference/stdexcept.md) + - [`std::underflow_error`](/reference/stdexcept.md) + - [`std::bad_expected_access`](/reference/expected/bad_expected_access.md) + - [`std::bad_optional_access`](/reference/optional/bad_optional_access.md) + - [`std::bad_variant_access`](/reference/variant/bad_variant_access.md) + - [`std::format_error`](/reference/format/format_error.md) ### デバッグ From f6f1289f6481a5ab9bf8edba03fe9021f36127f2 Mon Sep 17 00:00:00 2001 From: Tetsuro Matsumura Date: Thu, 27 Mar 2025 21:46:35 +0900 Subject: [PATCH 1482/3948] Update introduction of future.md --- lang/future.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lang/future.md b/lang/future.md index f20b39a43e..75e9154e63 100644 --- a/lang/future.md +++ b/lang/future.md @@ -1,8 +1,13 @@ # C++ (将来) ## 概要 -ここでは、将来のC++で検討されている機能を紹介する。 +ここでは、将来のC++で検討されているが、C++のバージョンが定まっていない機能を紹介する。 +cpprefjpでは基本的に[Working Draftに採択された機能のみを解説している](/start_editing.md)ため、このページに項目が積極的に追加されることはない。 + +しかし、稀ではあるが、ある提案が一度は採択されたにもかかわらず後に取り下げられることがある。例えば、C++11で一度採択されたあと取り下げられ、最終的にC++20で採択された[コンセプト](/lang/cpp20/concepts.md)がそうである。 + +そのような提案がすでにcpprefjpで解説されている場合、その記事をここへ移動する。そして、将来のC++において再び採択されれば、そのバージョンへ記事を移動する。 ## 言語機能 From a19e427282da0c7d15f7f691ccd5102b7caa3c2b Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 31 Mar 2025 17:56:49 +0900 Subject: [PATCH 1483/3948] =?UTF-8?q?build=E3=82=A2=E3=82=AF=E3=82=B7?= =?UTF-8?q?=E3=83=A7=E3=83=B3:=20git=20sumodule=E3=81=AE=E3=83=91=E3=83=A9?= =?UTF-8?q?=E3=83=A1=E3=83=BC=E3=82=BF=E9=96=93=E9=81=95=E3=81=84=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bea9eb6190..53df02f0ec 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,7 +34,7 @@ jobs: with: repository: cpprefjp/site_generator path: site_generator - - run: git submodule update -i + - run: git submodule update --init working-directory: site_generator # kunai @@ -43,7 +43,7 @@ jobs: with: repository: cpprefjp/kunai path: site_generator/kunai - - run: git submodule update -i + - run: git submodule update --init working-directory: site_generator/kunai # site (typically cpprefjp/site) @@ -55,7 +55,7 @@ jobs: fetch-depth: 0 ref: ${{ steps.vars.outputs.head_ref }} path: site_generator/cpprefjp/site - - run: git submodule update -i + - run: git submodule update --init working-directory: site_generator/cpprefjp/site # image From 1dd1b045fbbf312e5a9cd213fd542e789788699b Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 3 Apr 2025 13:51:18 +0900 Subject: [PATCH 1484/3948] =?UTF-8?q?C++26=20P3475R2=20consume=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E3=81=AE=E9=9D=9E=E6=8E=A8=E5=A5=A8=E5=8C=96(#1420)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - memory_order::consume列挙子 非推奨 - kill_dependency関数 非推奨 - carries_dependency属性 削除 --- lang/cpp11/attributes.md | 8 +++++- reference/atomic/atomic/store.md | 3 ++- reference/atomic/atomic_flag/clear.md | 3 ++- .../atomic/atomic_flag_clear_explicit.md | 3 ++- reference/atomic/atomic_ref/store.md | 3 ++- reference/atomic/atomic_thread_fence.md | 4 ++- reference/atomic/kill_dependency.md | 10 +++++++- reference/atomic/memory_order.md | 25 +++++++++++++++++-- 8 files changed, 50 insertions(+), 9 deletions(-) diff --git a/lang/cpp11/attributes.md b/lang/cpp11/attributes.md index b48a937941..ac564a646b 100644 --- a/lang/cpp11/attributes.md +++ b/lang/cpp11/attributes.md @@ -15,7 +15,7 @@ 属性は`[[attr]]`のように、属性のリストを二重角カッコで囲んで指定する。C++11時点の標準では、以下の2つの属性を定義する: 1. `[[noreturn]]` : 関数が決して返らないことをコンパイラに伝える -2. `[[carries_dependency]]` : データの依存性を持たせる or 維持する +2. `[[carries_dependency]]` : データの依存性を持たせる or 維持する (C++26で削除) ## 仕様 @@ -60,6 +60,10 @@ int main() ### `[[carries_dependency]]`属性 +この属性はC++26で削除された。 + +[`memory_order_consume`](/reference/atomic/memory_order.md)順序付けを実装したC++処理系は存在せず、本属性の代替機能も提供されない。 + `[[carries_dependency]]`は、並行プログラミングのアトミック操作において、値に依存した順序付け [`memory_order`](/reference/atomic/memory_order.md)を、関数をまたいで伝播することを明示するための属性である。 以下は、[`memory_order_consume`](/reference/atomic/memory_order.md)を使用した順序付けの例である: @@ -179,4 +183,6 @@ C++11で採用されたもの以外で検討された以下の機能は、属性 - [N2418 Towards support for attributes in C++ (Revision 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2418.pdf) - [N2643 C++ Data-Dependency Ordering: Function Annotation](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2643.html) - [N2761 Towards support for attributes in C++ (Revision 6) ](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2761.pdf) +- [P3475R2 Defang and deprecate memory_order::consume](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3475r2.pdf) + - C++26で`memory_order::consume`非推奨化に伴い`carries_dependency`属性を削除。 - [(抄訳)N4215 `memory_order_consume`の利用と実装に向けて[§5-6のみ]](http://d.hatena.ne.jp/yohhoy/20141115/p1) diff --git a/reference/atomic/atomic/store.md b/reference/atomic/atomic/store.md index da13dfc8d9..37e3c54e2e 100644 --- a/reference/atomic/atomic/store.md +++ b/reference/atomic/atomic/store.md @@ -35,7 +35,7 @@ constexpr void ## 事前条件 `order`が以下のメモリオーダーではないこと: -- [`memory_order_consume`](/reference/atomic/memory_order.md) +- [`memory_order_consume`](/reference/atomic/memory_order.md) (C++26で非推奨) - [`memory_order_acquire`](/reference/atomic/memory_order.md) - [`memory_order_acq_rel`](/reference/atomic/memory_order.md) @@ -96,3 +96,4 @@ int main() - C++20での、`volatile`版への制約追加 - [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) - C++26で`constexpr`に対応した +- [P3475R2 Defang and deprecate memory_order::consume](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3475r2.pdf) diff --git a/reference/atomic/atomic_flag/clear.md b/reference/atomic/atomic_flag/clear.md index e8294272e8..cae02407f2 100644 --- a/reference/atomic/atomic_flag/clear.md +++ b/reference/atomic/atomic_flag/clear.md @@ -27,7 +27,7 @@ constexpr void ## 要件 `order`が以下のメモリオーダーではないこと: -- [`memory_order_consume`](/reference/atomic/memory_order.md) (C++14) +- [`memory_order_consume`](/reference/atomic/memory_order.md) (C++26で非推奨) - [`memory_order_acquire`](/reference/atomic/memory_order.md) - [`memory_order_acq_rel`](/reference/atomic/memory_order.md) @@ -97,3 +97,4 @@ false - [LWG Issue 2138. `atomic_flag::clear` should not accept `memory_order_consume`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2138) - [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) - C++26で`constexpr`に対応した +- [P3475R2 Defang and deprecate memory_order::consume](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3475r2.pdf) diff --git a/reference/atomic/atomic_flag_clear_explicit.md b/reference/atomic/atomic_flag_clear_explicit.md index 380201c650..a9279fa81b 100644 --- a/reference/atomic/atomic_flag_clear_explicit.md +++ b/reference/atomic/atomic_flag_clear_explicit.md @@ -31,7 +31,7 @@ namespace std { ## 要件 `order`が以下のメモリオーダーではないこと: -- [`memory_order_consume`](memory_order.md) (C++14) +- [`memory_order_consume`](memory_order.md) (C++26で非推奨) - [`memory_order_acquire`](memory_order.md) - [`memory_order_acq_rel`](memory_order.md) @@ -102,3 +102,4 @@ false - [LWG Issue 2138. `atomic_flag::clear` should not accept `memory_order_consume`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2138) - [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) - C++26で`constexpr`に対応した +- [P3475R2 Defang and deprecate memory_order::consume](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3475r2.pdf) diff --git a/reference/atomic/atomic_ref/store.md b/reference/atomic/atomic_ref/store.md index 1e73ac4a7c..0e747a4fc6 100644 --- a/reference/atomic/atomic_ref/store.md +++ b/reference/atomic/atomic_ref/store.md @@ -27,7 +27,7 @@ constexpr void ## 事前条件 `order`が以下のメモリオーダーではないこと: -- [`memory_order_consume`](/reference/atomic/memory_order.md) +- [`memory_order_consume`](/reference/atomic/memory_order.md) (C++26で非推奨) - [`memory_order_acquire`](/reference/atomic/memory_order.md) - [`memory_order_acq_rel`](/reference/atomic/memory_order.md) @@ -88,3 +88,4 @@ int main() - C++26でCV修飾されたテンプレート引数を受け取れるようになった - [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) - C++26で`constexpr`に対応した +- [P3475R2 Defang and deprecate memory_order::consume](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3475r2.pdf) diff --git a/reference/atomic/atomic_thread_fence.md b/reference/atomic/atomic_thread_fence.md index 4ed4a0d775..517da4ea67 100644 --- a/reference/atomic/atomic_thread_fence.md +++ b/reference/atomic/atomic_thread_fence.md @@ -81,7 +81,8 @@ assert(i == 1 || j == 1); // すなわち、i と j が共に0となることは | メモリオーダー | フェンス | |---------------------------------------------|------------------------------------------------------------------| | [`memory_order_relaxed`](memory_order.md) | 何も行わない | -| [`memory_order_acquire`](memory_order.md)
[`memory_order_consume`](/reference/atomic/memory_order.md) | acquireフェンス | +| [`memory_order_acquire`](memory_order.md) | acquireフェンス | +| [`memory_order_consume`](memory_order.md) | acquireフェンス(C++26で非推奨) | | [`memory_order_release`](memory_order.md) | releaseフェンス | | [`memory_order_acq_rel`](memory_order.md) | acquireフェンスとreleaseフェンスの両方 | | [`memory_order_seq_cst`](memory_order.md) | acquireフェンスとreleaseフェンスの両方に加え、順序一貫性も与える | @@ -149,3 +150,4 @@ int main() - [Implementing Dekker's algorithm with Fences](https://www.justsoftwaresolutions.co.uk/threading/implementing_dekkers_algorithm_with_fences.html) - [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) - C++26で`constexpr`に対応した +- [P3475R2 Defang and deprecate memory_order::consume](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3475r2.pdf) diff --git a/reference/atomic/kill_dependency.md b/reference/atomic/kill_dependency.md index 461a6a91d3..f7ff021e39 100644 --- a/reference/atomic/kill_dependency.md +++ b/reference/atomic/kill_dependency.md @@ -3,16 +3,22 @@ * std[meta namespace] * function template[meta id-type] * cpp11[meta cpp] +* cpp26deprecated[meta cpp] ```cpp namespace std { template T kill_dependency(T y) noexcept; // (1) C++11 template - constexpr T kill_dependency(T y) noexcept; // (1) C++26 + constexpr T kill_dependency(T y) noexcept; // (1) C++26(非推奨) } ``` +この関数は、C++26で非推奨となった。 + +[`memory_order_consume`](memory_order.md)順序付けを実装したC++処理系は存在せず、本関数の代替機能も提供されない。 + + ## 概要 データ依存性を切る。 @@ -126,3 +132,5 @@ T kill_dependency(T y) noexcept - [(抄訳)N4215 `memory_order_consume`の利用と実装に向けて[§5-6のみ]](http://d.hatena.ne.jp/yohhoy/20141115/p1) - [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) - C++26で`constexpr`に対応した +- [P3475R2 Defang and deprecate memory_order::consume](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3475r2.pdf) + - C++26で`memory_order::consume`とあわせて`kill_dependency`関数を非推奨化。 diff --git a/reference/atomic/memory_order.md b/reference/atomic/memory_order.md index 3d9b32f907..8d8730bf6d 100644 --- a/reference/atomic/memory_order.md +++ b/reference/atomic/memory_order.md @@ -22,8 +22,21 @@ namespace std { inline constexpr memory_order memory_order_release = memory_order::release; inline constexpr memory_order memory_order_acq_rel = memory_order::acq_rel; inline constexpr memory_order memory_order_seq_cst = memory_order::seq_cst; + + // C++26 + enum class memory_order : unspecified { + relaxed = 0, acquire = 2, + release = 3, acq_rel = 4, seq_cst = 5 + }; + inline constexpr memory_order memory_order_relaxed = memory_order::relaxed; + inline constexpr memory_order memory_order_acquire = memory_order::acquire; + inline constexpr memory_order memory_order_release = memory_order::release; + inline constexpr memory_order memory_order_acq_rel = memory_order::acq_rel; + inline constexpr memory_order memory_order_seq_cst = memory_order::seq_cst; } ``` +* unspecified[italic] + ## 概要 コンパイラに許可されている最適化の一つに、「プログラムの意味を変えない限りにおいて、メモリアクセスの順番を変えたり、省略したりしてもよい」というものがある。また、マルチコアCPUにおいては、あるCPUコアによるメモリアクセスの順序が他のコアからも同じように見えるとは限らない。このような挙動はマルチスレッドプログラミングにおいて問題になることがある。 @@ -76,13 +89,18 @@ int main() | 列挙値 | 説明 | |--------|------| | `relaxed` | スレッド間の順序付けの効果は一切持たない。 | -| `consume` | acquire操作と似ているが、それより弱い順序付けでの読み込みを行うことを指示する。acquire操作は後続の全ての操作に対して順序付けを行うのに対し、consume操作は読み込まれた値に依存(ただし条件分岐による依存は除く)する操作のみに順序付けを保証する点が異なる。[store()](atomic/store.md)など、書き込みのみを行う操作に対しては指定できない。(仕様検討中のため、一時的に非推奨) | +| `consume` | C++26で非推奨 | | `acquire` | acquire操作としての読み込みを行うことを指示する。[store()](atomic/store.md)など、書き込みのみを行う操作に対しては指定できない。 | | `release` | release操作としての書き込みを行うことを指示する。[load()](atomic/load.md)など、読み込みのみを行う操作に対しては指定できない。 | | `acq_rel` | 読み込みと書き込みを同時に行う操作(Read-Modify-Write操作)に対してのみ指定することができ、acquireとreleaseを合わせた効果を持つ。 | | `seq_cst` | acquire(読み込み操作の場合)、release(書き込み操作の場合)、acq_rel(Read-Modify-Write操作の場合)としての効果を持つ。さらに、同じseq_cstが指定されている他のatomic操作との間での順序一貫性も保証する。これは最も強い保証であり、標準のatomic操作におけるデフォルトのメモリオーダーとして使用される。「seq_cst」は「sequential consistency(順序一貫性)」を意味する。 | +## 備考 +非推奨化された`consume`列挙値の挙動はacquire操作と似ているが、それより弱い順序付けでの読み込みを行うことを指示する。acquire操作は後続の全ての操作に対して順序付けを行うのに対し、consume操作は読み込まれた値に依存(ただし条件分岐による依存は除く)する操作のみに順序付けを保証する点が異なる。 +複雑なconsume操作を正しく実装するC++コンパイラは登場せず、より単純なacquire操作として扱われていた。C++20では仕様再検討に伴う一時的な利用回避が宣言され、最終的には役に立たないとの判断からC++26で非推奨となった。 + + ## バージョン ### 言語 - C++11 @@ -102,5 +120,8 @@ int main() - [N1525: Memory-Order Rationale](http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1525.htm) - [The Purpose of memory_order_consume in C++11](http://preshing.com/20140709/the-purpose-of-memory_order_consume-in-cpp11/) - [(抄訳)N4215 `memory_order_consume`の利用と実装に向けて[§5-6のみ]](http://d.hatena.ne.jp/yohhoy/20141115/p1) -- [P0371R1 Temporarily discourage `memory_order_consume`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0371r1.html) - [P0439R0 Make `std::memory_order` a scoped enumeration](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0439r0.html) + - C++20で`memory_order`をスコープ付き列挙型に変更。 +- [P0371R1 Temporarily discourage `memory_order_consume`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0371r1.html) +- [P3475R2 Defang and deprecate memory_order::consume](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3475r2.pdf) + - C++26で`memory_order::consume`列挙子を非推奨化。 From 7ae4be41deffb9a61cf29638cbe9a69cf427d4c6 Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 3 Apr 2025 15:49:54 +0900 Subject: [PATCH 1485/3948] functional: C++26 P2714R1 (#1200) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - bind_{back,front}: 事前条件,適格要件を仕様通りに書換 - not_fn: C++20以降の戻り値定義を追記(C++17定義も維持) --- reference/functional/bind_back.md | 33 +++++++++++++++++++------- reference/functional/bind_front.md | 30 +++++++++++++++++------- reference/functional/not_fn.md | 37 +++++++++++++++++++----------- 3 files changed, 71 insertions(+), 29 deletions(-) diff --git a/reference/functional/bind_back.md b/reference/functional/bind_back.md index 7688b21193..40a09549a3 100644 --- a/reference/functional/bind_back.md +++ b/reference/functional/bind_back.md @@ -7,7 +7,10 @@ ```cpp namespace std { template - constexpr unspecified bind_back(F&&, Args&&...); + constexpr unspecified bind_back(F&& f, Args&&... args); // (1) C++23 + + template + constexpr unspecified bind_back(Args&&... args); // (2) C++26 } ``` * unspecified[italic] @@ -17,16 +20,24 @@ namespace std { 先頭から適用する場合は[`bind_front`](bind_front.md)を用いる。 -## テンプレートパラメータ制約 -[`decay_t`](/reference/type_traits/decay.md)``を適用した型を`FD`、 -[`std::decay_t`](/reference/type_traits/decay.md)`...`を適用した型パラメータパックを`BoundArgs`であるとして、 -- `FD`が[`std::move_constructible`](/reference/concepts/move_constructible.md)要件を満たすこと -- `BoundArgs`のそれぞれの型`Ti`が[オブジェクト型](/reference/type_traits/is_object.md)である場合、[`std::move_constructible`](/reference/concepts/move_constructible.md)要件を満たすこと +## 事前条件 +[`decay_t`](/reference/type_traits/decay.md)``を適用した型を`FD`、[`decay_t`](/reference/type_traits/decay.md)`...`を適用した型パラメータパックを`BoundArgs`として + +- (1) : + - `FD`がCpp17MoveConstructible要件を満たすこと + - `BoundArgs`のそれぞれの型`Ti`が[オブジェクト型](/reference/type_traits/is_object.md)である場合、Cpp17MoveConstructible要件を満たすこと +- (2) : + - `BoundArgs`のそれぞれの型`Ti`がCpp17MoveConstructible要件を満たすこと ## 適格要件 -- [`conjunction_v`](/reference/type_traits/conjunction.md)`<`[`is_constructible`](/reference/type_traits/is_constructible.md)`,` [`is_move_constructible`](/reference/type_traits/is_move_constructible.md)`,` [`is_constructible`](/reference/type_traits/is_constructible.md)`...,` [`is_move_constructible`](/reference/type_traits/is_move_constructible.md)`...>`が`true`であること +- (1) : + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)` &&` [`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)` &&` `(`[`is_constructible_v`](/reference/type_traits/is_constructible.md)` && ...) &&` `(`[`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)` && ...)`が`true`であること +- (2) : `F`を`f`の型として + - `(`[`is_constructible_v`](/reference/type_traits/is_constructible.md)` && ...)`が`true`、かつ + - `(`[`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)` && ...)`が`true`、かつ + - もし[`is_poinetr_v`](/reference/type_traits/is_pointer.md)` ||` [`is_member_poinetr_v`](/reference/type_traits/is_member_pointer.md)``が`true`ならば、`f != nullptr`であること ## 戻り値 @@ -35,8 +46,11 @@ namespace std { 返される関数オブジェクトは渡された引数(`f, args...`)を参照として保持せず、適切にコピー/ムーブして保持する。 + ## 例外 -- 関数オブジェクト`f`のムーブによって任意の例外が送出される可能性がある +- (1) : 関数オブジェクト`f`のムーブによって任意の例外が送出される可能性がある +- (2) : `bound_args`の初期化による任意の例外が送出される可能性がある + ## この機能が必要になった背景・経緯 @@ -132,6 +146,9 @@ int main() { - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + ## 参照 - [P2387R3 Pipe support for user-defined range adaptors](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2387r3.html#nanorange) - [rangesのパイプにアダプトするには](https://onihusube.hatenablog.com/entry/2022/04/24/010041) +- [P2714R1 Bind front and back to NTTP callables](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2714r1.html) + - C++26でオーバーロード(2)を追加 \ No newline at end of file diff --git a/reference/functional/bind_front.md b/reference/functional/bind_front.md index 90cde94e35..b0f53e5feb 100644 --- a/reference/functional/bind_front.md +++ b/reference/functional/bind_front.md @@ -7,7 +7,10 @@ ```cpp namespace std { template - constexpr unspecified bind_front(F&&, Args&&...); + constexpr unspecified bind_front(F&& f, Args&&... args); // (1) C++20 + + template + constexpr unspecified bind_front(Args&&... args); // (2) C++26 } ``` * unspecified[italic] @@ -49,16 +52,23 @@ auto f3 = bind_front(&Strategy::process, Strategy{}); ただし、この関数はメンバ関数とレシーバーを受け取る専用にはなっておらず、「引数を先頭から順に束縛する」という汎用的な機能になっているため、「メンバ関数ポインタのみを束縛」「関数と引数の一部を束縛」といった利用もできる。 -## テンプレートパラメータ制約 -[`decay_t`](/reference/type_traits/decay.md)``を適用した型を`FD`、 -[`std::decay_t`](/reference/type_traits/decay.md)`...`を適用した型パラメータパックを`BoundArgs`であるとして、 +## 事前条件 +[`decay_t`](/reference/type_traits/decay.md)``を適用した型を`FD`、[`decay_t`](/reference/type_traits/decay.md)`...`を適用した型パラメータパックを`BoundArgs`として -- `FD`が[`std::move_constructible`](/reference/concepts/move_constructible.md)要件を満たすこと -- `BoundArgs`のそれぞれの型`Ti`が[オブジェクト型](/reference/type_traits/is_object.md)である場合、[`std::move_constructible`](/reference/concepts/move_constructible.md)要件を満たすこと +- (1) : + - `FD`がCpp17MoveConstructible要件を満たすこと + - `BoundArgs`のそれぞれの型`Ti`が[オブジェクト型](/reference/type_traits/is_object.md)である場合、Cpp17MoveConstructible要件を満たすこと +- (2) : + - `BoundArgs`のそれぞれの型`Ti`がCpp17MoveConstructible要件を満たすこと ## 適格要件 -- [`conjunction_v`](/reference/type_traits/conjunction.md)`<`[`is_constructible`](/reference/type_traits/is_constructible.md)`,` [`is_move_constructible`](/reference/type_traits/is_move_constructible.md)`,` [`is_constructible`](/reference/type_traits/is_constructible.md)`...,` [`is_move_constructible`](/reference/type_traits/is_move_constructible.md)`...>`が`true`であること +- (1) : + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)` &&` [`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)` &&` `(`[`is_constructible_v`](/reference/type_traits/is_constructible.md)` && ...) &&` `(`[`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)` && ...)`が`true`であること +- (2) : `F`を`f`の型として + - `(`[`is_constructible_v`](/reference/type_traits/is_constructible.md)` && ...)`が`true`、かつ + - `(`[`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)` && ...)`が`true`、かつ + - もし[`is_poinetr_v`](/reference/type_traits/is_pointer.md)` ||` [`is_member_poinetr_v`](/reference/type_traits/is_member_pointer.md)``が`true`ならば、`f != nullptr`であること ## 戻り値 @@ -67,8 +77,10 @@ auto f3 = bind_front(&Strategy::process, Strategy{}); 返される関数オブジェクトは渡された引数(`f, args...`)を参照として保持せず、適切にコピー/ムーブして保持する。 + ## 例外 -- 関数オブジェクト`f`のムーブによって任意の例外が送出される可能性がある +- (1) : 関数オブジェクト`f`のムーブによって任意の例外が送出される可能性がある +- (2) : `bound_args`の初期化による任意の例外が送出される可能性がある ## 例 @@ -132,3 +144,5 @@ int main() { ## 参照 - [P0356R5 Simplified partial function application](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0356r5.html) - [P1651R0 `bind_front` should not unwrap `reference_wrapper`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1651r0.html) +- [P2714R1 Bind front and back to NTTP callables](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2714r1.html) + - C++26でオーバーロード(2)を追加 \ No newline at end of file diff --git a/reference/functional/not_fn.md b/reference/functional/not_fn.md index a7f76664ac..f63fe22bb1 100644 --- a/reference/functional/not_fn.md +++ b/reference/functional/not_fn.md @@ -7,10 +7,12 @@ ```cpp namespace std { template - unspecified not_fn(F&& f); //C++17 - + unspecified not_fn(F&& f); // (1) C++17 template - constexpr unspecified not_fn(F&& f); //C++20 + constexpr unspecified not_fn(F&& f); // (1) C++20 + + template + constexpr unspecified not_fn(); // (2) C++26 } ``` * unspecified[italic] @@ -19,20 +21,18 @@ namespace std { 任意個数の引数をとって`bool`型を返す関数オブジェクトを受け取り、戻り値を論理反転する関数オブジェクトに変換する。 -## テンプレートパラメータ制約 -[`decay_t`](/reference/type_traits/decay.md)``を適用した型を`FD`として、 - -- `FD`が[`std::move_constructible`](/reference/concepts/move_constructible.md)要件を満たすこと +## 事前条件 +- (1) : [`decay_t`](/reference/type_traits/decay.md)``を適用した型を`FD`として、`FD`がCpp17MoveConstructible要件を満たすこと ## 適格要件 -[`decay_t`](/reference/type_traits/decay.md)``を適用した型を`FD`として、 - -- [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true`であること -- [`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)``が`true`であること +- (1) : [`decay_t`](/reference/type_traits/decay.md)``を適用した型を`FD`として、 + - [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true`、かつ + - [`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)``が`true`であること +- (2) : `F`を`f`の型として、もし[`is_poinetr_v`](/reference/type_traits/is_pointer.md)` ||` [`is_member_poinetr_v`](/reference/type_traits/is_member_pointer.md)``が`true`ならば、`f != nullptr`であること -## 効果 +## 効果(C++17) 説明用の関数オブジェクト`call_wrapper`があるものとして、`call_wrapper(`[`std::forward`](/reference/utility/forward.md)`(f))`を返す。 説明用の関数オブジェクト`call_wrapper`は、以下のようなクラスである: @@ -75,8 +75,17 @@ private: - 右辺値参照版 : `return !`[`INVOKE`](/reference/concepts/Invoke.md)`(`[`std::move`](/reference/utility/move.md)`(fd),` [`std::forward`](/reference/utility/forward.md)`(args)...)` +## 戻り値(C++20) +結果オブジェクト`g`に対する関数呼び出し式の引数パック`call_args`としたとき + +- (1) : `fd`を[`std::forward`](/reference/utility/forward.md)`(f))`で直接非リスト初期化した`FD`型のオブジェクトに対して + - 関数呼び出し式の結果が`!`[`invoke`](invoke.md)`(fd, call_args...)`に等しい、完全転送呼び出しラッパー(perfect forwarding call wrapper)オブジェクトを返す。 +- (2) : + - 関数呼び出し式の結果が`!`[`invoke`](invoke.md)`(f, call_args...)`に等しい、状態を持たない完全転送呼び出しラッパー(perfect forwarding call wrapper)オブジェクトを返す。 + + ## 例外 -- 関数オブジェクト`f`のムーブによって任意の例外が送出される可能性がある +- (1) : 関数オブジェクト`f`のムーブによって任意の例外が送出される可能性がある ## 例 @@ -131,3 +140,5 @@ true - [LWG Issue 2767. `not_fn` `call_wrapper` can form invalid types](https://wg21.cmeerw.net/lwg/issue2767) - [P0356R5 Simplified partial function application](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0356r5.html) - [P1065R2 constexpr INVOKE](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1065r2.html) +- [P2714R1 Bind front and back to NTTP callables](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2714r1.html) + - C++26でオーバーロード(2)を追加 \ No newline at end of file From 90e27bd6909a170c95cb4922d4e3a4aa5566d1fc Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 3 Apr 2025 16:03:23 +0900 Subject: [PATCH 1486/3948] =?UTF-8?q?C++26=E5=AF=BE=E5=BF=9C=E3=81=A8?= =?UTF-8?q?=E3=81=97=E3=81=A6=E5=AE=9A=E6=95=B0=E5=BC=8F=E3=81=A7=E3=81=AE?= =?UTF-8?q?=E4=BE=8B=E5=A4=96=E9=80=81=E5=87=BA=E3=82=92=E8=A8=B1=E5=8F=AF?= =?UTF-8?q?=20(#1432)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp11/constexpr.md | 1 + lang/cpp26.md | 34 ++++++----- ...ception_throwing_in_constant-evaluation.md | 60 +++++++++++++++++++ reference/exception/bad_exception.md | 10 ++-- .../exception/bad_exception/op_assign.md | 25 ++++++++ .../exception/bad_exception/op_constructor.md | 30 ++++++++++ .../exception/bad_exception/op_destructor.md | 22 +++++++ reference/exception/bad_exception/what.md | 24 ++++++++ reference/exception/current_exception.md | 7 ++- reference/exception/exception.md | 10 ++-- reference/exception/exception/op_assign.md | 25 ++++++++ .../exception/exception/op_constructor.md | 30 ++++++++++ .../exception/exception/op_destructor.md | 22 +++++++ reference/exception/exception/what.md | 24 ++++++++ reference/exception/make_exception_ptr.md | 9 +-- reference/exception/nested_exception.md | 4 +- .../exception/nested_exception/nested_ptr.md | 7 ++- .../exception/nested_exception/op_assign.md | 25 ++++++++ .../nested_exception/op_constructor.md | 11 ++-- .../nested_exception/op_destructor.md | 23 +++++++ .../nested_exception/rethrow_nested.md | 7 ++- reference/exception/rethrow_exception.md | 7 ++- reference/exception/rethrow_if_nested.md | 9 +-- reference/exception/throw_with_nested.md | 11 ++-- reference/exception/uncaught_exceptions.md | 16 +++-- reference/new/bad_alloc.md | 18 +++--- reference/new/bad_alloc/op_assign.md | 25 ++++++++ reference/new/bad_alloc/op_constructor.md | 30 ++++++++++ reference/new/bad_alloc/op_destructor.md | 22 +++++++ reference/new/bad_alloc/what.md | 24 ++++++++ reference/new/bad_array_new_length.md | 15 +++-- .../new/bad_array_new_length/op_assign.md | 25 ++++++++ .../bad_array_new_length/op_constructor.md | 29 +++++++++ .../new/bad_array_new_length/op_destructor.md | 23 +++++++ reference/new/bad_array_new_length/what.md | 24 ++++++++ reference/typeinfo/bad_cast.md | 10 ++-- reference/typeinfo/bad_cast/op_assign.md | 25 ++++++++ reference/typeinfo/bad_cast/op_constructor.md | 30 ++++++++++ reference/typeinfo/bad_cast/op_destructor.md | 22 +++++++ reference/typeinfo/bad_cast/what.md | 24 ++++++++ reference/typeinfo/bad_typeid.md | 10 ++-- reference/typeinfo/bad_typeid/op_assign.md | 25 ++++++++ .../typeinfo/bad_typeid/op_constructor.md | 30 ++++++++++ .../typeinfo/bad_typeid/op_destructor.md | 22 +++++++ reference/typeinfo/bad_typeid/what.md | 24 ++++++++ 46 files changed, 833 insertions(+), 79 deletions(-) create mode 100644 lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md create mode 100644 reference/exception/bad_exception/op_assign.md create mode 100644 reference/exception/bad_exception/op_constructor.md create mode 100644 reference/exception/bad_exception/op_destructor.md create mode 100644 reference/exception/bad_exception/what.md create mode 100644 reference/exception/exception/op_assign.md create mode 100644 reference/exception/exception/op_constructor.md create mode 100644 reference/exception/exception/op_destructor.md create mode 100644 reference/exception/exception/what.md create mode 100644 reference/exception/nested_exception/op_assign.md create mode 100644 reference/exception/nested_exception/op_destructor.md create mode 100644 reference/new/bad_alloc/op_assign.md create mode 100644 reference/new/bad_alloc/op_constructor.md create mode 100644 reference/new/bad_alloc/op_destructor.md create mode 100644 reference/new/bad_alloc/what.md create mode 100644 reference/new/bad_array_new_length/op_assign.md create mode 100644 reference/new/bad_array_new_length/op_constructor.md create mode 100644 reference/new/bad_array_new_length/op_destructor.md create mode 100644 reference/new/bad_array_new_length/what.md create mode 100644 reference/typeinfo/bad_cast/op_assign.md create mode 100644 reference/typeinfo/bad_cast/op_constructor.md create mode 100644 reference/typeinfo/bad_cast/op_destructor.md create mode 100644 reference/typeinfo/bad_cast/what.md create mode 100644 reference/typeinfo/bad_typeid/op_assign.md create mode 100644 reference/typeinfo/bad_typeid/op_constructor.md create mode 100644 reference/typeinfo/bad_typeid/op_destructor.md create mode 100644 reference/typeinfo/bad_typeid/what.md diff --git a/implementation-status.md b/implementation-status.md index e09959f481..6fc9da6daf 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -314,7 +314,7 @@ | P2963R3: [制約式内での畳み込み式の順序付け](/lang/cpp26/ordering_of_constraints_involving_fold_expressions.md.nolink) | 畳み込み式では全体ではなく個別の制約を原子制約式として扱う | | 19 | | | | P0963R3: [条件式での構造化束縛の使用を許可](/lang/cpp26/structured_binding_declaration_as_a_condition.md) | 式全体を`bool`値に変換できる場合に条件式で構造化束縛を使用できることとする | 15 | | | | | P2686R5: [`constexpr`構造化束縛の許可と、定数式への参照を定数式とする](/lang/cpp26/constexpr_structured_bindings_and_references_to_constexpr_variables.md.nolink) | 定数式に対する構造化束縛を許可し、関連する定数式への参照が定数式になるようにする | 15 | | | | -| P3068R6: [定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md.nolink) | 定数式の文脈での例外の送出と捕捉を許可 | | | | | +| P3068R6: [定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) | 定数式の文脈での例外の送出と捕捉を許可 | | | | | | P2865R6: [非推奨だった配列の比較を削除](/lang/cpp26/remove_deprecated_array_comparisons.md.nolink) | C++20で非推奨となっていた配列比較を削除 | 15 | 20 | | | | P1061R10: [構造化束縛でパックを導入できるようにする](/lang/cpp26/structured_bindings_can_introduce_a_pack.md.nolink) | タプルを分解する際に複数の変数をパックとして宣言できるようにする。`auto [a, ...xs] = f();` | | | | | | P3176R0: [先行するカンマのない省略記号を非推奨化](/lang/cpp26/the_oxford_variadic_comma.md.nolink) | `void f(int, ...);`はOK。`void f(int...);`は非推奨 | 15 | 20 | | | diff --git a/lang/cpp11/constexpr.md b/lang/cpp11/constexpr.md index 1fafdaab03..1a84ebe2b6 100644 --- a/lang/cpp11/constexpr.md +++ b/lang/cpp11/constexpr.md @@ -215,6 +215,7 @@ GCC 5.2、Clang 3.7、Visual C++ 2015時点で、3つともデフォルトは512 - [C++23 `constexpr`関数が定数実行できない場合でも適格とする](/lang/cpp23/relaxing_some_constexpr_restrictions.md) - [C++23 `constexpr`関数内での`static constexpr`変数を許可](/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md) - [C++23 `constexpr`関数内で`consteval`関数を呼び出せない問題を軽減](/lang/cpp23/consteval_needs_to_propagate_up.md) +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) ## 参照 diff --git a/lang/cpp26.md b/lang/cpp26.md index 0fc7f7dbfb..6e7ad802f6 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -81,7 +81,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | [`static_assert`の診断メッセージにユーザーが生成した文字列の指定を許可](/lang/cpp26/user-generated_static_assert_messages.md) | `constexpr`な`S.size()`と`S.data()`メンバ関数をもつオブジェクトをコンパイル時文字列として指定できるようにする | | [`constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md.nolink) | 定数式の文脈での配置`new`を許可 | | [`constexpr`構造化束縛の許可と、定数式への参照を定数式とする](/lang/cpp26/constexpr_structured_bindings_and_references_to_constexpr_variables.md.nolink) | 定数式に対する構造化束縛を許可し、関連する定数式への参照が定数式になるようにする | -| [定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md.nolink) | 定数式の文脈での例外の送出と捕捉を許可 | +| [定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) | 定数式の文脈での例外の送出と捕捉を許可 | ### プリプロセッサ @@ -404,22 +404,26 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [``](/reference/typeinfo.md)ヘッダの以下の機能 - [`std::bad_cast`](/reference/typeinfo/bad_cast.md)クラスの`what()`メンバ関数 - [`std::bad_typeid`](/reference/typeinfo/bad_typeid.md)クラスの`what()`メンバ関数 + - [``](/reference/stdexcept.md)ヘッダの以下の機能 + - [`std::domain_error`](/reference/stdexcept.md) + - [`std::invalid_argument`](/reference/stdexcept.md) + - [`std::length_error`](/reference/stdexcept.md) + - [`std::logic_error`](/reference/stdexcept.md) + - [`std::out_of_range`](/reference/stdexcept.md) + - [`std::runtime_error`](/reference/stdexcept.md) + - [`std::range_error`](/reference/stdexcept.md) + - [`std::overflow_error`](/reference/stdexcept.md) + - [`std::underflow_error`](/reference/stdexcept.md) + - [``](/reference/expected.md)ヘッダの以下の機能 + - [`std::bad_expected_access`](/reference/expected/bad_expected_access.md) + - [``](/reference/optional.md)ヘッダの以下の機能 + - [`std::bad_optional_access`](/reference/optional/bad_optional_access.md) + - [``](/reference/variant.md)ヘッダの以下の機能 + - [`std::bad_variant_access`](/reference/variant/bad_variant_access.md) + - [``](/reference/format.md)ヘッダの以下の機能 + - [`std::format_error`](/reference/format/format_error.md) - [``](/reference/memory.md)に、ポインタのアライメントを判定する[`std::is_sufficiently_aligned()`](/reference/memory/is_sufficiently_aligned.md)関数を追加。 - [``](/reference/utility.md)に、タイムトラベル最適化を抑止するための観測可能ポイントとして[`std::observable()`](/reference/utility/observable.md.nolink)を追加 -- 以下の例外型を`constexpr`対応 - - [`std::domain_error`](/reference/stdexcept.md) - - [`std::invalid_argument`](/reference/stdexcept.md) - - [`std::length_error`](/reference/stdexcept.md) - - [`std::logic_error`](/reference/stdexcept.md) - - [`std::out_of_range`](/reference/stdexcept.md) - - [`std::runtime_error`](/reference/stdexcept.md) - - [`std::range_error`](/reference/stdexcept.md) - - [`std::overflow_error`](/reference/stdexcept.md) - - [`std::underflow_error`](/reference/stdexcept.md) - - [`std::bad_expected_access`](/reference/expected/bad_expected_access.md) - - [`std::bad_optional_access`](/reference/optional/bad_optional_access.md) - - [`std::bad_variant_access`](/reference/variant/bad_variant_access.md) - - [`std::format_error`](/reference/format/format_error.md) ### デバッグ diff --git a/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md b/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md new file mode 100644 index 0000000000..efbaa6b2eb --- /dev/null +++ b/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md @@ -0,0 +1,60 @@ +# 定数評価での例外送出を許可 [P3068R6] +* cpp26[meta cpp] + + + +このページはC++26に採用される見込みの言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 + + + +## 概要 +C++23まで、定数式内での例外送出、そのコードに到達した時点でコンパイルエラーとなっていた。 + +C++26からは定数式内での例外送出ができるようになり、ユーザーはその例外を捕捉できるようになる。 + +```cpp +consteval auto hello(std::string_view input) { + if (input.empty()) { + throw invalid_argument{"empty name provided"}; // C++23: このコードに到達した時点でthrow式側でコンパイルエラー + } + + return concat_into_a_fixed_string("hello ",input); +} + +const auto a = hello(""); // C++26: 呼び出し側でコンパイルエラー +const auto b = hello("Hana"); + +try { + const auto c = hello(""); // C++26: 例外を捕捉 +} catch (const validation_error &) { + // everything is fine +} + +// C++23: concat関数の深い場所にあるthrow式側でコンパイルエラー +// C++26: 呼び出し側で「文字列が長すぎる」のようなコンパイルエラーになる +const auto d = hello("Adolph Blaine Charles David Earl Frederick Gerald Hubert Irvin John Kenneth Lloyd Martin Nero Oliver Paul Quincy Randolph Sherman Thomas Uncas Victor William Xerxes Yancy Zeus"); +``` + + + +## 関連項目 +- [C++11 constexpr](/lang/cpp11/constexpr.md) +- [`std::exception`](/reference/exception/exception.md) +- [`std::nested_exception`](/reference/exception/nested_exception.md) +- [`std::bad_exception`](/reference/exception/bad_exception.md) +- [`std::uncaught_exceptions()`](/reference/exception/uncaught_exceptions.md) +- [`std::current_exception()`](/reference/exception/current_exception.md) +- [`std::rethrow_exception()`](/reference/exception/rethrow_exception.md) +- [`std::make_exception_ptr()`](/reference/exception/make_exception_ptr.md) +- [`std::throw_with_nested()`](/reference/exception/throw_with_nested.md) +- [`std::rethrow_if_nested()`](/reference/exception/rethrow_if_nested.md) +- [`std::bad_alloc`](/reference/new/bad_alloc.md) +- [`std::bad_array_new_length`](/reference/new/bad_array_new_length.md) +- [`std::bad_cast`](/reference/typeinfo/bad_cast.md) +- [`std::bad_typeid`](/reference/typeinfo/bad_typeid.md) + + +## 参照 +- [P3068R6 Allowing exception throwing in constant-evaluation](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3068r6.html) diff --git a/reference/exception/bad_exception.md b/reference/exception/bad_exception.md index a2ce7399a5..6d805b13d8 100644 --- a/reference/exception/bad_exception.md +++ b/reference/exception/bad_exception.md @@ -31,11 +31,11 @@ namespace std { ## メンバ関数 | 名前 | 説明 | 対応バージョン | -|----------------------------------------------|-----------------------------------------------|-------| -| `bad_exception() noexcept;` `bad_exception(const bad_exception&) noexcept;` | コンストラクタ | | -| `virtual ~bad_exception() = default;` | デストラクタ | | -| `bad_exception& operator=(const bad_exception&) noexcept;` | 代入演算子 | | -| `virtual const char* what() const noexcept;` | 実装定義のエラー内容を取得する | | +|------|------|----------------| +| [(constructor)](bad_exception/op_constructor.md) | コンストラクタ | | +| [(destructor)](bad_exception/op_destructor.md) | デストラクタ | | +| [`operator=`](bad_exception/op_assign.md) | 代入演算子 | | +| [`what`](bad_exception/what.md) | エラー理由を取得する | | ## 例 diff --git a/reference/exception/bad_exception/op_assign.md b/reference/exception/bad_exception/op_assign.md new file mode 100644 index 0000000000..6ae172dd4d --- /dev/null +++ b/reference/exception/bad_exception/op_assign.md @@ -0,0 +1,25 @@ +# operator= +* exception[meta header] +* std[meta namespace] +* bad_exception[meta class] +* function[meta id-type] + +```cpp +bad_exception& operator=(const bad_exception&); // (1) C++03 +bad_exception& operator=(const bad_exception&) noexcept; // (1) C++11 +constexpr bad_exception& operator=(const bad_exception&) noexcept; // (1) C++26 +``` + +## 概要 +`bad_exception`オブジェクトを代入する + +- (1) : コピー代入 + + +## 例外 +投げない + + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + diff --git a/reference/exception/bad_exception/op_constructor.md b/reference/exception/bad_exception/op_constructor.md new file mode 100644 index 0000000000..648480bfa6 --- /dev/null +++ b/reference/exception/bad_exception/op_constructor.md @@ -0,0 +1,30 @@ +# コンストラクタ +* exception[meta header] +* std[meta namespace] +* bad_exception[meta class] +* function[meta id-type] + +```cpp +bad_exception(); // (1) C++03 +bad_exception() noexcept; // (1) C++11 +constexpr bad_exception() noexcept; // (1) C++26 + +bad_exception(const bad_exception&); // (2) C++03 +bad_exception(const bad_exception&) noexcept; // (2) C++11 +constexpr bad_exception(const bad_exception&) noexcept; // (2) C++26 +``` + +## 概要 +`bad_exception`オブジェクトを構築する。 + +- (1) : デフォルトコンストラクタ +- (2) : コピーコンストラクタ + + +## 例外 +投げない + + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + diff --git a/reference/exception/bad_exception/op_destructor.md b/reference/exception/bad_exception/op_destructor.md new file mode 100644 index 0000000000..725619f7f4 --- /dev/null +++ b/reference/exception/bad_exception/op_destructor.md @@ -0,0 +1,22 @@ +# デストラクタ +* exception[meta header] +* std[meta namespace] +* bad_exception[meta class] +* function[meta id-type] + +```cpp +virtual ~bad_exception(); // (1) C++03 +constexpr virtual ~bad_exception(); // (1) C++26 +``` + +## 概要 +`bad_exception`オブジェクトを破棄する。 + + +## 例外 +投げない + + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + diff --git a/reference/exception/bad_exception/what.md b/reference/exception/bad_exception/what.md new file mode 100644 index 0000000000..51fcaf3ea2 --- /dev/null +++ b/reference/exception/bad_exception/what.md @@ -0,0 +1,24 @@ +# what +* exception[meta header] +* std[meta namespace] +* bad_exception[meta class] +* function[meta id-type] + +```cpp +virtual const char* what() const; // (1) C++03 +virtual const char* what() const noexcept; // (1) C++11 +const char* what() const noexcept override; // (1) C++17 +constexpr const char* what() const noexcept override; // (1) C++26 +``` + +## 概要 +エラー理由となる実装依存文字列を取得する。 + + +## 例外 +投げない + + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + diff --git a/reference/exception/current_exception.md b/reference/exception/current_exception.md index 50054389ef..5f1b3a222c 100644 --- a/reference/exception/current_exception.md +++ b/reference/exception/current_exception.md @@ -6,7 +6,8 @@ ```cpp namespace std { - exception_ptr current_exception() noexcept; + exception_ptr current_exception() noexcept; // (1) C++11 + constexpr exception_ptr current_exception() noexcept; // (1) C++26 } ``` * exception_ptr[link exception_ptr.md] @@ -85,6 +86,10 @@ terminate called after throwing an instance of 'std::runtime_error' - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + + ## 参照 - [N2179 Language Support for Transporting Exceptions between Threads](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html) - [Can I use `std::current_exception` during stack unwinding? - StackOverflow](http://stackoverflow.com/questions/28267484/can-i-use-stdcurrent-exception-during-stack-unwinding) diff --git a/reference/exception/exception.md b/reference/exception/exception.md index 23e1eda371..408d9ab1c7 100644 --- a/reference/exception/exception.md +++ b/reference/exception/exception.md @@ -18,11 +18,11 @@ namespace std { ## メンバ関数 | 名前 | 説明 | 対応バージョン | -|----------------------------------------|---------------------------------------------|-------| -| `exception() noexcept;`
`exception(const exception&) noexcept;` | コンストラクタ | | -| `virtual ~exception();` | デストラクタ | | -| `exception& operator=(const exception&) noexcept;` | 代入演算子 | | -| `virtual const char* what() const noexcept;` | 実装定義のエラー内容を取得する | | +|------|------|----------------| +| [(constructor)](exception/op_constructor.md) | コンストラクタ | | +| [(destructor)](exception/op_destructor.md) | デストラクタ | | +| [`operator=`](exception/op_assign.md) | 代入演算子 | | +| [`what`](exception/what.md) | エラー理由を取得する | | ## 例 diff --git a/reference/exception/exception/op_assign.md b/reference/exception/exception/op_assign.md new file mode 100644 index 0000000000..08cb854c05 --- /dev/null +++ b/reference/exception/exception/op_assign.md @@ -0,0 +1,25 @@ +# operator= +* exception[meta header] +* std[meta namespace] +* exception[meta class] +* function[meta id-type] + +```cpp +exception& operator=(const exception&); // (1) C++03 +exception& operator=(const exception&) noexcept; // (1) C++11 +constexpr exception& operator=(const exception&) noexcept; // (1) C++26 +``` + +## 概要 +`exception`オブジェクトを代入する + +- (1) : コピー代入 + + +## 例外 +投げない + + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + diff --git a/reference/exception/exception/op_constructor.md b/reference/exception/exception/op_constructor.md new file mode 100644 index 0000000000..b8a5fcecac --- /dev/null +++ b/reference/exception/exception/op_constructor.md @@ -0,0 +1,30 @@ +# コンストラクタ +* exception[meta header] +* std[meta namespace] +* exception[meta class] +* function[meta id-type] + +```cpp +exception(); // (1) C++03 +exception() noexcept; // (1) C++11 +constexpr exception() noexcept; // (1) C++26 + +exception(const exception&); // (2) C++03 +exception(const exception&) noexcept; // (2) C++11 +constexpr exception(const exception&) noexcept; // (2) C++26 +``` + +## 概要 +`exception`オブジェクトを構築する。 + +- (1) : デフォルトコンストラクタ +- (2) : コピーコンストラクタ + + +## 例外 +投げない + + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + diff --git a/reference/exception/exception/op_destructor.md b/reference/exception/exception/op_destructor.md new file mode 100644 index 0000000000..09fde29cd4 --- /dev/null +++ b/reference/exception/exception/op_destructor.md @@ -0,0 +1,22 @@ +# デストラクタ +* exception[meta header] +* std[meta namespace] +* exception[meta class] +* function[meta id-type] + +```cpp +virtual ~exception(); // (1) C++03 +constexpr virtual ~exception(); // (1) C++26 +``` + +## 概要 +`exception`オブジェクトを破棄する。 + + +## 例外 +投げない + + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + diff --git a/reference/exception/exception/what.md b/reference/exception/exception/what.md new file mode 100644 index 0000000000..d8656be8b7 --- /dev/null +++ b/reference/exception/exception/what.md @@ -0,0 +1,24 @@ +# what +* exception[meta header] +* std[meta namespace] +* exception[meta class] +* function[meta id-type] + +```cpp +virtual const char* what() const; // (1) C++03 +virtual const char* what() const noexcept; // (1) C++11 +const char* what() const noexcept override; // (1) C++17 +constexpr const char* what() const noexcept override; // (1) C++26 +``` + +## 概要 +エラー理由となる実装依存文字列を取得する。 + + +## 例外 +投げない + + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + diff --git a/reference/exception/make_exception_ptr.md b/reference/exception/make_exception_ptr.md index bcbb73433c..37d8b8c303 100644 --- a/reference/exception/make_exception_ptr.md +++ b/reference/exception/make_exception_ptr.md @@ -7,7 +7,9 @@ ```cpp namespace std { template - exception_ptr make_exception_ptr(E e) noexcept; + exception_ptr make_exception_ptr(E e) noexcept; // (1) C++11 + template + constexpr exception_ptr make_exception_ptr(E e) noexcept; // (1) C++26 } ``` * exception_ptr[link exception_ptr.md] @@ -87,6 +89,5 @@ exception_ptr make_exception_ptr(E e) noexcept } ``` -## 参照 - - +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) diff --git a/reference/exception/nested_exception.md b/reference/exception/nested_exception.md index be8d09af7a..3710cbea32 100644 --- a/reference/exception/nested_exception.md +++ b/reference/exception/nested_exception.md @@ -21,8 +21,8 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`(constructor)`](nested_exception/op_constructor.md) | コンストラクタ | C++11 | -| `~virtual nested_exception() = default;` | デストラクタ | C++11 | -| `nested_exception& operator=(const nested_exception&) = default;` | 代入演算子 | C++11 | +| [`(destructor)`](nested_exception/op_destructor.md) | デストラクタ | C++11 | +| [`operator=`](nested_exception/op_assign.md) | 代入演算子 | C++11 | | [`rethrow_nested`](nested_exception/rethrow_nested.md) | 入れ子になった例外を送出する | C++11 | | [`nested_ptr`](nested_exception/nested_ptr.md) | 入れ子になった例外へのポインタを取得する | C++11 | diff --git a/reference/exception/nested_exception/nested_ptr.md b/reference/exception/nested_exception/nested_ptr.md index 5cf1622772..6808bc832c 100644 --- a/reference/exception/nested_exception/nested_ptr.md +++ b/reference/exception/nested_exception/nested_ptr.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -exception_ptr nested_ptr() const noexcept; +exception_ptr nested_ptr() const noexcept; // (1) C++11 +constexpr exception_ptr nested_ptr() const noexcept; // (1) C++26 ``` * exception_ptr[link /reference/exception/exception_ptr.md] @@ -73,6 +74,6 @@ int main() - [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] -## 参照 - +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) diff --git a/reference/exception/nested_exception/op_assign.md b/reference/exception/nested_exception/op_assign.md new file mode 100644 index 0000000000..a90f11e312 --- /dev/null +++ b/reference/exception/nested_exception/op_assign.md @@ -0,0 +1,25 @@ +# operator= +* exception[meta header] +* std[meta namespace] +* nested_exception[meta class] +* function[meta id-type] +* cpp11[meta cpp] + +```cpp +nested_exception& operator=(const nested_exception&) noexcept = default; // (1) C++11 +constexpr nested_exception& operator=(const nested_exception&) noexcept = default; // (1) C++26 +``` + +## 概要 +`nested_exception`オブジェクトを代入する + +- (1) : コピー代入 + + +## 例外 +投げない + + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + diff --git a/reference/exception/nested_exception/op_constructor.md b/reference/exception/nested_exception/op_constructor.md index f8c2c37450..5c3f90464e 100644 --- a/reference/exception/nested_exception/op_constructor.md +++ b/reference/exception/nested_exception/op_constructor.md @@ -6,8 +6,11 @@ * cpp11[meta cpp] ```cpp -nested_exception() noexcept; // (1) -nested_exception(const nested_exception&) noexcept = default; // (2) +nested_exception() noexcept; // (1) C++11 +constexpr nested_exception() noexcept; // (1) C++26 + +nested_exception(const nested_exception&) noexcept = default; // (2) C++11 +constexpr nested_exception(const nested_exception&) noexcept = default; // (2) C++26 ``` ## nested_exceptionオブジェクトの構築 @@ -63,6 +66,6 @@ int main() - [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] -## 参照 - +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) diff --git a/reference/exception/nested_exception/op_destructor.md b/reference/exception/nested_exception/op_destructor.md new file mode 100644 index 0000000000..709fadec4d --- /dev/null +++ b/reference/exception/nested_exception/op_destructor.md @@ -0,0 +1,23 @@ +# デストラクタ +* exception[meta header] +* std[meta namespace] +* nested_exception[meta class] +* function[meta id-type] +* cpp11[meta cpp] + +```cpp +virtual ~nested_exception() = default; // (1) C++11 +constexpr virtual ~nested_exception() = default; // (1) C++26 +``` + +## 概要 +`nested_exception`オブジェクトを破棄する。 + + +## 例外 +投げない + + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + diff --git a/reference/exception/nested_exception/rethrow_nested.md b/reference/exception/nested_exception/rethrow_nested.md index 82e66f2808..e001a9b338 100644 --- a/reference/exception/nested_exception/rethrow_nested.md +++ b/reference/exception/nested_exception/rethrow_nested.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -[[noreturn]] void rethrow_nested() const; +[[noreturn]] void rethrow_nested() const; // (1) C++11 +[[noreturn]] constexpr void rethrow_nested() const; // (1) C++26 ``` ## 概要 @@ -75,6 +76,6 @@ int main() - [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] -## 参照 - +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) diff --git a/reference/exception/rethrow_exception.md b/reference/exception/rethrow_exception.md index d7a72f1130..b6baa3a13d 100644 --- a/reference/exception/rethrow_exception.md +++ b/reference/exception/rethrow_exception.md @@ -5,7 +5,8 @@ * cpp11[meta cpp] ```cpp -[[noreturn]] void rethrow_exception(exception_ptr p); +[[noreturn]] void rethrow_exception(exception_ptr p); // (1) C++11 +[[noreturn]] constexpr void rethrow_exception(exception_ptr p); // (1) C++26 ``` * exception_ptr[link exception_ptr.md] @@ -81,6 +82,10 @@ terminate called after throwing an instance of 'std::runtime_error' - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + + ## 参照 - [N2179 Language Support for Transporting Exceptions between Threads](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html) - [P1675R2 `rethrow_exception` must be allowed to copy](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1675r2.pdf) diff --git a/reference/exception/rethrow_if_nested.md b/reference/exception/rethrow_if_nested.md index 44a36adcd3..844b39ba37 100644 --- a/reference/exception/rethrow_if_nested.md +++ b/reference/exception/rethrow_if_nested.md @@ -7,7 +7,9 @@ ```cpp namespace std { template - void rethrow_if_nested(const E& e); + void rethrow_if_nested(const E& e); // (1) C++11 + template + constexpr void rethrow_if_nested(const E& e); // (1) C++26 } ``` @@ -117,6 +119,5 @@ inner - [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] -## 参照 - - +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) diff --git a/reference/exception/throw_with_nested.md b/reference/exception/throw_with_nested.md index 6e54f5aa29..91f029850a 100644 --- a/reference/exception/throw_with_nested.md +++ b/reference/exception/throw_with_nested.md @@ -6,8 +6,10 @@ ```cpp namespace std { - [[noreturn]] template - void throw_with_nested(T&& t); + template + [[noreturn]] void throw_with_nested(T&& t); // (1) C++11 + template + [[noreturn]] constexpr void throw_with_nested(T&& t); // (1) C++26 } ``` @@ -109,6 +111,5 @@ inner - [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified] -## 参照 - - +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) diff --git a/reference/exception/uncaught_exceptions.md b/reference/exception/uncaught_exceptions.md index af07952d1b..5e00ac035d 100644 --- a/reference/exception/uncaught_exceptions.md +++ b/reference/exception/uncaught_exceptions.md @@ -6,7 +6,8 @@ ```cpp namespace std { - int uncaught_exceptions() noexcept; // C++17 + int uncaught_exceptions() noexcept; // (1) C++17 + constexpr int uncaught_exceptions() noexcept; // (1) C++26 } ``` @@ -85,8 +86,13 @@ catch exception 2 - [GCC](/implementation.md#gcc): 3.7 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2015 [mark verified], 2017 [mark verified] + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + + ## 参照 -- [C++1z 現在発生している例外の数を取得するuncaught_exceptions()関数 - Faith and Brave - C++で遊ぼう](https://faithandbrave.hateblo.jp/entry/2016/06/22/171639) -- [N4152 uncaught_exceptions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4152.pdf) -- [N4259 Wording for std::uncaught_exceptions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4259.pdf) -- [CWG 2098 Is uncaught_exceptions() per-thread?](https://wg21.cmeerw.net/cwg/issue2098) +- [C++1z 現在発生している例外の数を取得する`uncaught_exceptions()`関数 - Faith and Brave - C++で遊ぼう](https://faithandbrave.hateblo.jp/entry/2016/06/22/171639) +- [N4152 `uncaught_exceptions`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4152.pdf) +- [N4259 Wording for `std::uncaught_exceptions`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4259.pdf) +- [CWG 2098 Is `uncaught_exceptions()` per-thread?](https://wg21.cmeerw.net/cwg/issue2098) diff --git a/reference/new/bad_alloc.md b/reference/new/bad_alloc.md index 41abf039b2..2a9afcf122 100644 --- a/reference/new/bad_alloc.md +++ b/reference/new/bad_alloc.md @@ -5,13 +5,7 @@ ```cpp namespace std { - class bad_alloc : public exception { - public: - bad_alloc() noexcept; - bad_alloc(const bad_alloc&) noexcept; - bad_alloc& operator=(const bad_alloc&) noexcept; - virtual const char* what() const noexcept; - }; + class bad_alloc : public exception; } ``` * exception[link /reference/exception/exception.md] @@ -20,6 +14,16 @@ namespace std { 何らかの理由で記憶域の動的確保に失敗するなど、[`get_new_handler()`](get_new_handler.md)が`nullptr`を返した場合に投げられる例外。 +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [(constructor)](bad_alloc/op_constructor.md) | コンストラクタ | | +| [(destructor)](bad_alloc/op_destructor.md) | デストラクタ | | +| [`operator=`](bad_alloc/op_assign.md) | 代入演算子 | | +| [`what`](bad_alloc/what.md) | エラー理由を取得する | | + + ```cpp example #include #include diff --git a/reference/new/bad_alloc/op_assign.md b/reference/new/bad_alloc/op_assign.md new file mode 100644 index 0000000000..ed8ebd632d --- /dev/null +++ b/reference/new/bad_alloc/op_assign.md @@ -0,0 +1,25 @@ +# operator= +* new[meta header] +* std[meta namespace] +* bad_alloc[meta class] +* function[meta id-type] + +```cpp +bad_alloc& operator=(const bad_alloc&); // (1) C++03 +bad_alloc& operator=(const bad_alloc&) noexcept; // (1) C++11 +constexpr bad_alloc& operator=(const bad_alloc&) noexcept; // (1) C++26 +``` + +## 概要 +`bad_alloc`オブジェクトを代入する + +- (1) : コピー代入 + + +## 例外 +投げない + + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + diff --git a/reference/new/bad_alloc/op_constructor.md b/reference/new/bad_alloc/op_constructor.md new file mode 100644 index 0000000000..165cbfb845 --- /dev/null +++ b/reference/new/bad_alloc/op_constructor.md @@ -0,0 +1,30 @@ +# コンストラクタ +* new[meta header] +* std[meta namespace] +* bad_alloc[meta class] +* function[meta id-type] + +```cpp +bad_alloc(); // (1) C++03 +bad_alloc() noexcept; // (1) C++11 +constexpr bad_alloc() noexcept; // (1) C++26 + +bad_alloc(const bad_alloc&); // (2) C++03 +bad_alloc(const bad_alloc&) noexcept; // (2) C++11 +constexpr bad_alloc(const bad_alloc&) noexcept; // (2) C++26 +``` + +## 概要 +`bad_alloc`オブジェクトを構築する。 + +- (1) : デフォルトコンストラクタ +- (2) : コピーコンストラクタ + + +## 例外 +投げない + + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + diff --git a/reference/new/bad_alloc/op_destructor.md b/reference/new/bad_alloc/op_destructor.md new file mode 100644 index 0000000000..8dd32cc266 --- /dev/null +++ b/reference/new/bad_alloc/op_destructor.md @@ -0,0 +1,22 @@ +# デストラクタ +* new[meta header] +* std[meta namespace] +* bad_alloc[meta class] +* function[meta id-type] + +```cpp +virtual ~bad_alloc(); // (1) C++03 +constexpr virtual ~bad_alloc(); // (1) C++26 +``` + +## 概要 +`bad_alloc`オブジェクトを破棄する。 + + +## 例外 +投げない + + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + diff --git a/reference/new/bad_alloc/what.md b/reference/new/bad_alloc/what.md new file mode 100644 index 0000000000..c52e17f7df --- /dev/null +++ b/reference/new/bad_alloc/what.md @@ -0,0 +1,24 @@ +# what +* new[meta header] +* std[meta namespace] +* bad_alloc[meta class] +* function[meta id-type] + +```cpp +virtual const char* what() const; // (1) C++03 +virtual const char* what() const noexcept; // (1) C++11 +const char* what() const noexcept override; // (1) C++17 +constexpr const char* what() const noexcept override; // (1) C++26 +``` + +## 概要 +エラー理由となる実装依存文字列を取得する。 + + +## 例外 +投げない + + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + diff --git a/reference/new/bad_array_new_length.md b/reference/new/bad_array_new_length.md index 6ab8cac677..d7ec1d3259 100644 --- a/reference/new/bad_array_new_length.md +++ b/reference/new/bad_array_new_length.md @@ -6,10 +6,7 @@ ```cpp namespace std { - class bad_array_new_length : public bad_alloc { - public: - bad_array_new_length() noexcept; - }; + class bad_array_new_length : public bad_alloc; } ``` * bad_alloc[link /reference/new/bad_alloc.md] @@ -18,6 +15,16 @@ namespace std { 動的に記憶域を確保しようとする配列の長さが 0 未満または処理系の最大値以上の場合に送出される例外。 +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [(constructor)](bad_array_new_length/op_constructor.md) | コンストラクタ | C++11 | +| [(destructor)](bad_array_new_length/op_destructor.md) | デストラクタ | C++11 | +| [`operator=`](bad_array_new_length/op_assign.md) | 代入演算子 | C++11 | +| [`what`](bad_array_new_length/what.md) | エラー理由を取得する | C++11 | + + ## 例 ```cpp example #include diff --git a/reference/new/bad_array_new_length/op_assign.md b/reference/new/bad_array_new_length/op_assign.md new file mode 100644 index 0000000000..844e728afa --- /dev/null +++ b/reference/new/bad_array_new_length/op_assign.md @@ -0,0 +1,25 @@ +# operator= +* new[meta header] +* std[meta namespace] +* bad_array_new_length[meta class] +* function[meta id-type] +* cpp11[meta cpp] + +```cpp +bad_array_new_length& operator=(const bad_array_new_length&) noexcept; // (1) C++11 +constexpr bad_array_new_length& operator=(const bad_array_new_length&) noexcept; // (1) C++26 +``` + +## 概要 +`bad_array_new_length`オブジェクトを代入する + +- (1) : コピー代入 + + +## 例外 +投げない + + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + diff --git a/reference/new/bad_array_new_length/op_constructor.md b/reference/new/bad_array_new_length/op_constructor.md new file mode 100644 index 0000000000..580c58b0dc --- /dev/null +++ b/reference/new/bad_array_new_length/op_constructor.md @@ -0,0 +1,29 @@ +# コンストラクタ +* new[meta header] +* std[meta namespace] +* bad_array_new_length[meta class] +* function[meta id-type] +* cpp11[meta cpp] + +```cpp +bad_array_new_length() noexcept; // (1) C++11 +constexpr bad_array_new_length() noexcept; // (1) C++26 + +bad_array_new_length(const bad_array_new_length&) noexcept; // (2) C++11 +constexpr bad_array_new_length(const bad_array_new_length&) noexcept; // (2) C++26 +``` + +## 概要 +`bad_array_new_length`オブジェクトを構築する。 + +- (1) : デフォルトコンストラクタ +- (2) : コピーコンストラクタ + + +## 例外 +投げない + + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + diff --git a/reference/new/bad_array_new_length/op_destructor.md b/reference/new/bad_array_new_length/op_destructor.md new file mode 100644 index 0000000000..de39a03222 --- /dev/null +++ b/reference/new/bad_array_new_length/op_destructor.md @@ -0,0 +1,23 @@ +# デストラクタ +* new[meta header] +* std[meta namespace] +* bad_array_new_length[meta class] +* function[meta id-type] +* cpp11[meta cpp] + +```cpp +virtual ~bad_array_new_length(); // (1) C++03 +constexpr virtual ~bad_array_new_length(); // (1) C++26 +``` + +## 概要 +`bad_array_new_length`オブジェクトを破棄する。 + + +## 例外 +投げない + + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + diff --git a/reference/new/bad_array_new_length/what.md b/reference/new/bad_array_new_length/what.md new file mode 100644 index 0000000000..49eca9ee58 --- /dev/null +++ b/reference/new/bad_array_new_length/what.md @@ -0,0 +1,24 @@ +# what +* new[meta header] +* std[meta namespace] +* bad_array_new_length[meta class] +* function[meta id-type] +* cpp11[meta cpp] + +```cpp +virtual const char* what() const noexcept; // (1) C++11 +const char* what() const noexcept override; // (1) C++17 +constexpr const char* what() const noexcept override; // (1) C++26 +``` + +## 概要 +エラー理由となる実装依存文字列を取得する。 + + +## 例外 +投げない + + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + diff --git a/reference/typeinfo/bad_cast.md b/reference/typeinfo/bad_cast.md index 423286fa0b..d539fc7df2 100644 --- a/reference/typeinfo/bad_cast.md +++ b/reference/typeinfo/bad_cast.md @@ -17,11 +17,11 @@ namespace std { ## メンバ関数 | 名前 | 説明 | 対応バージョン | -|------------------------------------------------------------------|--------------------------------|---| -| `bad_cast() noexcept;`
`bad_cast(const bad_cast&) noexcept;` | コンストラクタ | | -| `virtual ~bad_cast() = default;` | デストラクタ | | -| `bad_cast& operator=(const bad_cast&) noexcept;` | 代入演算子 | | -| `virtual const char* what() const noexcept;` | 実装定義のエラー内容を取得する | | +|------|------|----------------| +| [(constructor)](bad_cast/op_constructor.md) | コンストラクタ | | +| [(destructor)](bad_cast/op_destructor.md) | デストラクタ | | +| [`operator=`](bad_cast/op_assign.md) | 代入演算子 | | +| [`what`](bad_cast/what.md) | エラー理由を取得する | | ### 例 diff --git a/reference/typeinfo/bad_cast/op_assign.md b/reference/typeinfo/bad_cast/op_assign.md new file mode 100644 index 0000000000..cdb4ed975d --- /dev/null +++ b/reference/typeinfo/bad_cast/op_assign.md @@ -0,0 +1,25 @@ +# operator= +* typeinfo[meta header] +* std[meta namespace] +* bad_cast[meta class] +* function[meta id-type] + +```cpp +bad_cast& operator=(const bad_cast&); // (1) C++03 +bad_cast& operator=(const bad_cast&) noexcept; // (1) C++11 +constexpr bad_cast& operator=(const bad_cast&) noexcept; // (1) C++26 +``` + +## 概要 +`bad_cast`オブジェクトを代入する + +- (1) : コピー代入 + + +## 例外 +投げない + + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + diff --git a/reference/typeinfo/bad_cast/op_constructor.md b/reference/typeinfo/bad_cast/op_constructor.md new file mode 100644 index 0000000000..ee712b85ad --- /dev/null +++ b/reference/typeinfo/bad_cast/op_constructor.md @@ -0,0 +1,30 @@ +# コンストラクタ +* typeinfo[meta header] +* std[meta namespace] +* bad_cast[meta class] +* function[meta id-type] + +```cpp +bad_cast(); // (1) C++03 +bad_cast() noexcept; // (1) C++11 +constexpr bad_cast() noexcept; // (1) C++26 + +bad_cast(const bad_cast&); // (2) C++03 +bad_cast(const bad_cast&) noexcept; // (2) C++11 +constexpr bad_cast(const bad_cast&) noexcept; // (2) C++26 +``` + +## 概要 +`bad_cast`オブジェクトを構築する。 + +- (1) : デフォルトコンストラクタ +- (2) : コピーコンストラクタ + + +## 例外 +投げない + + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + diff --git a/reference/typeinfo/bad_cast/op_destructor.md b/reference/typeinfo/bad_cast/op_destructor.md new file mode 100644 index 0000000000..a3bcd2c397 --- /dev/null +++ b/reference/typeinfo/bad_cast/op_destructor.md @@ -0,0 +1,22 @@ +# デストラクタ +* typeinfo[meta header] +* std[meta namespace] +* bad_cast[meta class] +* function[meta id-type] + +```cpp +virtual ~bad_cast(); // (1) C++03 +constexpr virtual ~bad_cast(); // (1) C++26 +``` + +## 概要 +`bad_cast`オブジェクトを破棄する。 + + +## 例外 +投げない + + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + diff --git a/reference/typeinfo/bad_cast/what.md b/reference/typeinfo/bad_cast/what.md new file mode 100644 index 0000000000..05cbfa24f8 --- /dev/null +++ b/reference/typeinfo/bad_cast/what.md @@ -0,0 +1,24 @@ +# what +* typeinfo[meta header] +* std[meta namespace] +* bad_cast[meta class] +* function[meta id-type] + +```cpp +virtual const char* what() const; // (1) C++03 +virtual const char* what() const noexcept; // (1) C++11 +const char* what() const noexcept override; // (1) C++17 +constexpr const char* what() const noexcept override; // (1) C++26 +``` + +## 概要 +エラー理由となる実装依存文字列を取得する。 + + +## 例外 +投げない + + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + diff --git a/reference/typeinfo/bad_typeid.md b/reference/typeinfo/bad_typeid.md index 0846896c03..4d6857dcb2 100644 --- a/reference/typeinfo/bad_typeid.md +++ b/reference/typeinfo/bad_typeid.md @@ -17,11 +17,11 @@ namespace std { ## メンバ関数 | 名前 | 説明 | 対応バージョン | -|-------------------------------------------------------------------------|--------------------|---| -| `bad_typeid() noexcept;`
`bad_typeid(const bad_typeid&) noexcept;` | コンストラクタ | | -| `virtual ~bad_typeid() = default;` | デストラクタ | | -| `bad_typeid& operator=(const bad_typeid&) noexcept;` | 代入演算子 | | -| `virtual const char* what() const noexcept;` | 実装定義のエラー内容を取得する | | +|------|------|----------------| +| [(constructor)](bad_typeid/op_constructor.md) | コンストラクタ | | +| [(destructor)](bad_typeid/op_destructor.md) | デストラクタ | | +| [`operator=`](bad_typeid/op_assign.md) | 代入演算子 | | +| [`what`](bad_typeid/what.md) | エラー理由を取得する | | ## 例 diff --git a/reference/typeinfo/bad_typeid/op_assign.md b/reference/typeinfo/bad_typeid/op_assign.md new file mode 100644 index 0000000000..7b079b9cfc --- /dev/null +++ b/reference/typeinfo/bad_typeid/op_assign.md @@ -0,0 +1,25 @@ +# operator= +* typeinfo[meta header] +* std[meta namespace] +* bad_typeid[meta class] +* function[meta id-type] + +```cpp +bad_typeid& operator=(const bad_typeid&); // (1) C++03 +bad_typeid& operator=(const bad_typeid&) noexcept; // (1) C++11 +constexpr bad_typeid& operator=(const bad_typeid&) noexcept; // (1) C++26 +``` + +## 概要 +`bad_typeid`オブジェクトを代入する + +- (1) : コピー代入 + + +## 例外 +投げない + + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + diff --git a/reference/typeinfo/bad_typeid/op_constructor.md b/reference/typeinfo/bad_typeid/op_constructor.md new file mode 100644 index 0000000000..57f93675b0 --- /dev/null +++ b/reference/typeinfo/bad_typeid/op_constructor.md @@ -0,0 +1,30 @@ +# コンストラクタ +* typeinfo[meta header] +* std[meta namespace] +* bad_typeid[meta class] +* function[meta id-type] + +```cpp +bad_typeid(); // (1) C++03 +bad_typeid() noexcept; // (1) C++11 +constexpr bad_typeid() noexcept; // (1) C++26 + +bad_typeid(const bad_typeid&); // (2) C++03 +bad_typeid(const bad_typeid&) noexcept; // (2) C++11 +constexpr bad_typeid(const bad_typeid&) noexcept; // (2) C++26 +``` + +## 概要 +`bad_typeid`オブジェクトを構築する。 + +- (1) : デフォルトコンストラクタ +- (2) : コピーコンストラクタ + + +## 例外 +投げない + + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + diff --git a/reference/typeinfo/bad_typeid/op_destructor.md b/reference/typeinfo/bad_typeid/op_destructor.md new file mode 100644 index 0000000000..caa71a8933 --- /dev/null +++ b/reference/typeinfo/bad_typeid/op_destructor.md @@ -0,0 +1,22 @@ +# デストラクタ +* typeinfo[meta header] +* std[meta namespace] +* bad_typeid[meta class] +* function[meta id-type] + +```cpp +virtual ~bad_typeid(); // (1) C++03 +constexpr virtual ~bad_typeid(); // (1) C++26 +``` + +## 概要 +`bad_typeid`オブジェクトを破棄する。 + + +## 例外 +投げない + + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + diff --git a/reference/typeinfo/bad_typeid/what.md b/reference/typeinfo/bad_typeid/what.md new file mode 100644 index 0000000000..d19231428d --- /dev/null +++ b/reference/typeinfo/bad_typeid/what.md @@ -0,0 +1,24 @@ +# what +* typeinfo[meta header] +* std[meta namespace] +* bad_typeid[meta class] +* function[meta id-type] + +```cpp +virtual const char* what() const; // (1) C++03 +virtual const char* what() const noexcept; // (1) C++11 +const char* what() const noexcept override; // (1) C++17 +constexpr const char* what() const noexcept override; // (1) C++26 +``` + +## 概要 +エラー理由となる実装依存文字列を取得する。 + + +## 例外 +投げない + + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + From cd443eadd11df7eac6f9769013571dc29a2c31a6 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 3 Apr 2025 16:38:08 +0900 Subject: [PATCH 1487/3948] =?UTF-8?q?stdexcept=E9=96=A2=E4=BF=82=E3=81=AEc?= =?UTF-8?q?onstexpr=E5=AF=BE=E5=BF=9C=20(#1433)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ception_throwing_in_constant-evaluation.md | 2 ++ .../expected/bad_expected_access/error.md | 21 ++++++++--- .../bad_expected_access/op_constructor.md | 17 +++++++-- .../expected/bad_expected_access/what.md | 9 ++++- reference/format/format_error.md | 17 +++++---- reference/format/format_error/op_assign.md | 29 +++++++++++++++ .../format/format_error/op_constructor.md | 35 +++++++++++++++++++ .../format/format_error/op_destructor.md | 23 ++++++++++++ reference/format/format_error/what.md | 27 ++++++++++++++ .../new/bad_array_new_length/op_destructor.md | 2 +- reference/optional/bad_optional_access.md | 6 ++-- .../optional/bad_optional_access/op_assign.md | 29 +++++++++++++++ .../bad_optional_access/op_constructor.md | 33 +++++++++++++++++ .../bad_optional_access/op_destructor.md | 23 ++++++++++++ .../optional/bad_optional_access/what.md | 27 ++++++++++++++ reference/stdexcept.md | 14 +++++--- reference/variant/bad_variant_access.md | 6 ++-- .../variant/bad_variant_access/op_assign.md | 29 +++++++++++++++ .../bad_variant_access/op_constructor.md | 33 +++++++++++++++++ .../bad_variant_access/op_destructor.md | 23 ++++++++++++ reference/variant/bad_variant_access/what.md | 27 ++++++++++++++ 21 files changed, 406 insertions(+), 26 deletions(-) create mode 100644 reference/format/format_error/op_assign.md create mode 100644 reference/format/format_error/op_constructor.md create mode 100644 reference/format/format_error/op_destructor.md create mode 100644 reference/format/format_error/what.md create mode 100644 reference/optional/bad_optional_access/op_assign.md create mode 100644 reference/optional/bad_optional_access/op_constructor.md create mode 100644 reference/optional/bad_optional_access/op_destructor.md create mode 100644 reference/optional/bad_optional_access/what.md create mode 100644 reference/variant/bad_variant_access/op_assign.md create mode 100644 reference/variant/bad_variant_access/op_constructor.md create mode 100644 reference/variant/bad_variant_access/op_destructor.md create mode 100644 reference/variant/bad_variant_access/what.md diff --git a/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md b/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md index efbaa6b2eb..bf8b7f3c7c 100644 --- a/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md +++ b/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md @@ -54,6 +54,8 @@ const auto d = hello("Adolph Blaine Charles David Earl Frederick Gerald Hubert I - [`std::bad_array_new_length`](/reference/new/bad_array_new_length.md) - [`std::bad_cast`](/reference/typeinfo/bad_cast.md) - [`std::bad_typeid`](/reference/typeinfo/bad_typeid.md) +- [``](/reference/stdexcept.md) +- [`std::bad_expected_access`](/reference/expected/bad_expected_access.md) ## 参照 diff --git a/reference/expected/bad_expected_access/error.md b/reference/expected/bad_expected_access/error.md index 5b90d7a957..498003fbcd 100644 --- a/reference/expected/bad_expected_access/error.md +++ b/reference/expected/bad_expected_access/error.md @@ -6,10 +6,17 @@ * cpp23[meta cpp] ```cpp -constexpr const E& error() const & noexcept; // (1) -constexpr E& error() & noexcept; // (2) -constexpr const E&& error() const && noexcept; // (3) -constexpr E&& error() && noexcept; // (4) +const E& error() const & noexcept; // (1) C++23 +constexpr const E& error() const & noexcept; // (1) C++26 + +E& error() & noexcept; // (2) C++23 +constexpr E& error() & noexcept; // (2) C++26 + +const E&& error() const && noexcept; // (3) C++23 +constexpr const E&& error() const && noexcept; // (3) C++26 + +E&& error() && noexcept; // (4) C++23 +constexpr E&& error() && noexcept; // (4) C++26 ``` ## 概要 @@ -66,6 +73,12 @@ throw:ERR - [Visual C++](/implementation.md#visual_cpp): ?? +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + + ## 参照 - [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) - [P2549R1 `std::unexpected` should have `error()` as member accessor](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2549r1.html) +- [P3378R2 `constexpr` exception types](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3378r2.html) + - C++26で`constexpr`対応した diff --git a/reference/expected/bad_expected_access/op_constructor.md b/reference/expected/bad_expected_access/op_constructor.md index 98fd1304c1..de5175bb6f 100644 --- a/reference/expected/bad_expected_access/op_constructor.md +++ b/reference/expected/bad_expected_access/op_constructor.md @@ -6,9 +6,14 @@ * cpp23[meta cpp] ```cpp -explicit bad_expected_access(E e); // (1) -bad_expected_access(const bad_expected_access&); // (2) -bad_expected_access(bad_expected_access&&); // (3) +explicit bad_expected_access(E e); // (1) C++23 +constexpr explicit bad_expected_access(E e); // (1) C++26 + +bad_expected_access(const bad_expected_access&); // (2) C++23 +constexpr bad_expected_access(const bad_expected_access&); // (2) C++26 + +bad_expected_access(bad_expected_access&&); // (3) C++23 +constexpr bad_expected_access(bad_expected_access&&); // (3) C++26 ``` * bad_expected_access[link ../bad_expected_access.md] @@ -48,5 +53,11 @@ int main() - [Visual C++](/implementation.md#visual_cpp): ?? +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + + ## 参照 - [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) +- [P3378R2 `constexpr` exception types](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3378r2.html) + - C++26で`constexpr`対応した diff --git a/reference/expected/bad_expected_access/what.md b/reference/expected/bad_expected_access/what.md index 6a2b70f308..dfc030aabf 100644 --- a/reference/expected/bad_expected_access/what.md +++ b/reference/expected/bad_expected_access/what.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -const char* what() const noexcept override; +const char* what() const noexcept override; // (1) C++23 +constexpr const char* what() const noexcept override; // (1) C++26 ``` ## 概要 @@ -60,5 +61,11 @@ bad access to std::expected without expected value - [Visual C++](/implementation.md#visual_cpp): ?? +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + + ## 参照 - [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) +- [P3378R2 `constexpr` exception types](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3378r2.html) + - C++26で`constexpr`対応した diff --git a/reference/format/format_error.md b/reference/format/format_error.md index c33ab64d54..5f5ee6e22b 100644 --- a/reference/format/format_error.md +++ b/reference/format/format_error.md @@ -6,14 +6,9 @@ ```cpp namespace std { - class format_error : public runtime_error { - public: - explicit format_error(const string& what_arg); - explicit format_error(const char* what_arg); - }; + class format_error : public runtime_error; } ``` -* string[link /reference/string/basic_string.md] ## 概要 ``の各機能の失敗を表す例外クラス。ユーザー定義フォーマッターもこの例外を投げることができる。 @@ -21,9 +16,13 @@ namespace std { ## メンバ関数 ### 構築・破棄 -| 名前 | 説明 | 対応バージョン | -|-----------------|----------------|----------------| -| `(constructor)` | コンストラクタ | C++20 | +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [(constructor)](format_error/op_constructor.md) | コンストラクタ | C++20 | +| [(destructor)](format_error/op_destructor.md) | デストラクタ | C++20 | +| [`operator=`](format_error/op_assign.md) | 代入演算子 | C++20 | +| [`what`](format_error/what.md) | エラー理由を取得する | C++20 | + ## バージョン ### 言語 diff --git a/reference/format/format_error/op_assign.md b/reference/format/format_error/op_assign.md new file mode 100644 index 0000000000..23ffce6a3d --- /dev/null +++ b/reference/format/format_error/op_assign.md @@ -0,0 +1,29 @@ +# operator= +* format[meta header] +* std[meta namespace] +* format_error[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +format_error& operator=(const format_error&) noexcept; // (1) C++20 +constexpr format_error& operator=(const format_error&) noexcept; // (1) C++26 +``` + +## 概要 +`format_error`オブジェクトを代入する + +- (1) : コピー代入 + + +## 例外 +投げない + + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + + +## 参照 +- [P3378R2 `constexpr` exception types](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3378r2.html) + - C++26で`constexpr`対応した diff --git a/reference/format/format_error/op_constructor.md b/reference/format/format_error/op_constructor.md new file mode 100644 index 0000000000..17a66dff8a --- /dev/null +++ b/reference/format/format_error/op_constructor.md @@ -0,0 +1,35 @@ +# コンストラクタ +* format[meta header] +* std[meta namespace] +* format_error[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +explicit format_error(const string& what_arg); // (1) C++20 +constexpr explicit format_error(const string& what_arg); // (1) C++26 + +explicit format_error(const char* what_arg); // (2) C++20 +constexpr explicit format_error(const char* what_arg); // (2) C++26 +``` + +## 概要 +`format_error`オブジェクトを構築する。 + +- (1) : `std::string`オブジェクトでエラー理由を受け取る +- (2) : `const char*`でエラー理由を受け取る + + +## 事後条件 + +- (1) : `strcmp(what(), what_arg.c_str()) == 0` +- (2) : `strcmp(what(), what_arg) == 0` + + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + + +## 参照 +- [P3378R2 `constexpr` exception types](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3378r2.html) + - C++26で`constexpr`対応した diff --git a/reference/format/format_error/op_destructor.md b/reference/format/format_error/op_destructor.md new file mode 100644 index 0000000000..92f0837f85 --- /dev/null +++ b/reference/format/format_error/op_destructor.md @@ -0,0 +1,23 @@ +# デストラクタ +* format[meta header] +* std[meta namespace] +* format_error[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +virtual ~format_error(); // (1) C++20 +constexpr virtual ~format_error(); // (1) C++26 +``` + +## 概要 +`format_error`オブジェクトを破棄する。 + + +## 例外 +投げない + + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + diff --git a/reference/format/format_error/what.md b/reference/format/format_error/what.md new file mode 100644 index 0000000000..9ceba514b6 --- /dev/null +++ b/reference/format/format_error/what.md @@ -0,0 +1,27 @@ +# what +* format[meta header] +* std[meta namespace] +* format_error[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +const char* what() const noexcept override; // (1) C++20 +constexpr const char* what() const noexcept override; // (1) C++26 +``` + +## 概要 +エラー理由となる実装依存文字列を取得する。 + + +## 例外 +投げない + + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + + +## 参照 +- [P3378R2 `constexpr` exception types](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3378r2.html) + - C++26で`constexpr`対応した diff --git a/reference/new/bad_array_new_length/op_destructor.md b/reference/new/bad_array_new_length/op_destructor.md index de39a03222..cdbd5e299a 100644 --- a/reference/new/bad_array_new_length/op_destructor.md +++ b/reference/new/bad_array_new_length/op_destructor.md @@ -6,7 +6,7 @@ * cpp11[meta cpp] ```cpp -virtual ~bad_array_new_length(); // (1) C++03 +virtual ~bad_array_new_length(); // (1) C++11 constexpr virtual ~bad_array_new_length(); // (1) C++26 ``` diff --git a/reference/optional/bad_optional_access.md b/reference/optional/bad_optional_access.md index d58b0bd25c..3950c409f7 100644 --- a/reference/optional/bad_optional_access.md +++ b/reference/optional/bad_optional_access.md @@ -19,8 +19,10 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| `bad_optional_access();` | デフォルトコンストラクタ | C++17 | -| `virtual const char* what() const noexcept;` | エラー理由となる実装依存文字列 | C++17 | +| [(constructor)](bad_optional_access/op_constructor.md) | コンストラクタ | C++17 | +| [(destructor)](bad_optional_access/op_destructor.md) | デストラクタ | C++17 | +| [`operator=`](bad_optional_access/op_assign.md) | 代入演算子 | C++17 | +| [`what`](bad_optional_access/what.md) | エラー理由を取得する | C++17 | ## 例 diff --git a/reference/optional/bad_optional_access/op_assign.md b/reference/optional/bad_optional_access/op_assign.md new file mode 100644 index 0000000000..543e7a7c3a --- /dev/null +++ b/reference/optional/bad_optional_access/op_assign.md @@ -0,0 +1,29 @@ +# operator= +* optional[meta header] +* std[meta namespace] +* bad_optional_access[meta class] +* function[meta id-type] +* cpp17[meta cpp] + +```cpp +bad_optional_access& operator=(const bad_optional_access&) noexcept; // (1) C++17 +constexpr bad_optional_access& operator=(const bad_optional_access&) noexcept; // (1) C++26 +``` + +## 概要 +`bad_optional_access`オブジェクトを代入する + +- (1) : コピー代入 + + +## 例外 +投げない + + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + + +## 参照 +- [P3378R2 `constexpr` exception types](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3378r2.html) + - C++26で`constexpr`対応した diff --git a/reference/optional/bad_optional_access/op_constructor.md b/reference/optional/bad_optional_access/op_constructor.md new file mode 100644 index 0000000000..611f9b86de --- /dev/null +++ b/reference/optional/bad_optional_access/op_constructor.md @@ -0,0 +1,33 @@ +# コンストラクタ +* optional[meta header] +* std[meta namespace] +* bad_optional_access[meta class] +* function[meta id-type] +* cpp17[meta cpp] + +```cpp +bad_optional_access() noexcept; // (1) C++17 +constexpr bad_optional_access() noexcept; // (1) C++26 + +bad_optional_access(const bad_optional_access&) noexcept; // (2) C++17 +constexpr bad_optional_access(const bad_optional_access&) noexcept; // (2) C++26 +``` + +## 概要 +`bad_optional_access`オブジェクトを構築する。 + +- (1) : デフォルトコンストラクタ +- (2) : コピーコンストラクタ + + +## 例外 +投げない + + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + + +## 参照 +- [P3378R2 `constexpr` exception types](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3378r2.html) + - C++26で`constexpr`対応した diff --git a/reference/optional/bad_optional_access/op_destructor.md b/reference/optional/bad_optional_access/op_destructor.md new file mode 100644 index 0000000000..fc7d1c6561 --- /dev/null +++ b/reference/optional/bad_optional_access/op_destructor.md @@ -0,0 +1,23 @@ +# デストラクタ +* optional[meta header] +* std[meta namespace] +* bad_optional_access[meta class] +* function[meta id-type] +* cpp17[meta cpp] + +```cpp +virtual ~bad_optional_access(); // (1) C++17 +constexpr virtual ~bad_optional_access(); // (1) C++26 +``` + +## 概要 +`bad_array_new_length`オブジェクトを破棄する。 + + +## 例外 +投げない + + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + diff --git a/reference/optional/bad_optional_access/what.md b/reference/optional/bad_optional_access/what.md new file mode 100644 index 0000000000..ac1fd98264 --- /dev/null +++ b/reference/optional/bad_optional_access/what.md @@ -0,0 +1,27 @@ +# what +* optional[meta header] +* std[meta namespace] +* bad_optional_access[meta class] +* function[meta id-type] +* cpp17[meta cpp] + +```cpp +const char* what() const noexcept override; // (1) C++17 +constexpr const char* what() const noexcept override; // (1) C++26 +``` + +## 概要 +エラー理由となる実装依存文字列を取得する。 + + +## 例外 +投げない + + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + + +## 参照 +- [P3378R2 `constexpr` exception types](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3378r2.html) + - C++26で`constexpr`対応した diff --git a/reference/stdexcept.md b/reference/stdexcept.md index cd4c452505..5c95958c80 100644 --- a/reference/stdexcept.md +++ b/reference/stdexcept.md @@ -44,9 +44,9 @@ | 名前 | 説明 | 対応バージョン | |--------------------|--------------------------------------------|-------| -| `explicit T(const` [`string`](/reference/string/basic_string.md)`& what_arg);` | 指定したメッセージを持つ例外オブジェクトを生成する | | -| `explicit T(const char* what_arg);` | 指定したメッセージを持つ例外オブジェクトを生成する | C++11 | -| `virtual const char* what() const noexcept;` | メッセージを取得する | | +| `explicit T(const` [`string`](/reference/string/basic_string.md)`& what_arg); // C++03`
`constexpr explicit T(const` [`string`](/reference/string/basic_string.md)`& what_arg); // C++26 | 指定したメッセージを持つ例外オブジェクトを生成する | | +| `explicit T(const char* what_arg); // C++11`
`constexpr explicit T(const char* what_arg); // C++26` | 指定したメッセージを持つ例外オブジェクトを生成する | C++11 | +| `virtual const char* what() const noexcept; // C++03`
`constexpr virtual const char* what() const noexcept; // C++26` | メッセージを取得する | | ## 例 @@ -78,7 +78,13 @@ int main() * std::logic_error[color ff0000] * std::exit[link /reference/cstdlib/exit.md] + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + + ## 参照 - [LWG Issue 254. Exception types in clause 19 are constructed from `std::string`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#254) - C++11から例外送出の理由として、文字配列を受け取ることを許可した経緯のレポート - +- [P3378R2 `constexpr` exception types](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3378r2.html) + - C++26で`constexpr`対応した diff --git a/reference/variant/bad_variant_access.md b/reference/variant/bad_variant_access.md index a406e44207..7108604fcf 100644 --- a/reference/variant/bad_variant_access.md +++ b/reference/variant/bad_variant_access.md @@ -19,8 +19,10 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| `bad_variant_access() noexcept;` | デフォルトコンストラクタ | C++17 | -| `const char* what() const noexcept override;` | エラー理由となる実装依存文字列 | C++17 | +| [(constructor)](bad_variant_access/op_constructor.md) | コンストラクタ | C++17 | +| [(destructor)](bad_variant_access/op_destructor.md) | デストラクタ | C++17 | +| [`operator=`](bad_variant_access/op_assign.md) | 代入演算子 | C++17 | +| [`what`](bad_variant_access/what.md) | エラー理由を取得する | C++17 | ## 例 diff --git a/reference/variant/bad_variant_access/op_assign.md b/reference/variant/bad_variant_access/op_assign.md new file mode 100644 index 0000000000..5bf368ffb7 --- /dev/null +++ b/reference/variant/bad_variant_access/op_assign.md @@ -0,0 +1,29 @@ +# operator= +* variant[meta header] +* std[meta namespace] +* bad_variant_access[meta class] +* function[meta id-type] +* cpp17[meta cpp] + +```cpp +bad_variant_access& operator=(const bad_variant_access&) noexcept; // (1) C++17 +constexpr bad_variant_access& operator=(const bad_variant_access&) noexcept; // (1) C++26 +``` + +## 概要 +`bad_variant_access`オブジェクトを代入する + +- (1) : コピー代入 + + +## 例外 +投げない + + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + + +## 参照 +- [P3378R2 `constexpr` exception types](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3378r2.html) + - C++26で`constexpr`対応した diff --git a/reference/variant/bad_variant_access/op_constructor.md b/reference/variant/bad_variant_access/op_constructor.md new file mode 100644 index 0000000000..06d0d13ba4 --- /dev/null +++ b/reference/variant/bad_variant_access/op_constructor.md @@ -0,0 +1,33 @@ +# コンストラクタ +* variant[meta header] +* std[meta namespace] +* bad_variant_access[meta class] +* function[meta id-type] +* cpp17[meta cpp] + +```cpp +bad_variant_access() noexcept; // (1) C++17 +constexpr bad_variant_access() noexcept; // (1) C++26 + +bad_variant_access(const bad_variant_access&) noexcept; // (2) C++17 +constexpr bad_variant_access(const bad_variant_access&) noexcept; // (2) C++26 +``` + +## 概要 +`bad_variant_access`オブジェクトを構築する。 + +- (1) : デフォルトコンストラクタ +- (2) : コピーコンストラクタ + + +## 例外 +投げない + + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + + +## 参照 +- [P3378R2 `constexpr` exception types](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3378r2.html) + - C++26で`constexpr`対応した diff --git a/reference/variant/bad_variant_access/op_destructor.md b/reference/variant/bad_variant_access/op_destructor.md new file mode 100644 index 0000000000..67b6da7d30 --- /dev/null +++ b/reference/variant/bad_variant_access/op_destructor.md @@ -0,0 +1,23 @@ +# デストラクタ +* variant[meta header] +* std[meta namespace] +* bad_variant_access[meta class] +* function[meta id-type] +* cpp17[meta cpp] + +```cpp +virtual ~bad_variant_access(); // (1) C++17 +constexpr virtual ~bad_variant_access(); // (1) C++26 +``` + +## 概要 +`bad_variant_access`オブジェクトを破棄する。 + + +## 例外 +投げない + + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + diff --git a/reference/variant/bad_variant_access/what.md b/reference/variant/bad_variant_access/what.md new file mode 100644 index 0000000000..8ae331063b --- /dev/null +++ b/reference/variant/bad_variant_access/what.md @@ -0,0 +1,27 @@ +# what +* variant[meta header] +* std[meta namespace] +* bad_variant_access[meta class] +* function[meta id-type] +* cpp17[meta cpp] + +```cpp +const char* what() const noexcept override; // (1) C++17 +constexpr const char* what() const noexcept override; // (1) C++26 +``` + +## 概要 +エラー理由となる実装依存文字列を取得する。 + + +## 例外 +投げない + + +## 関連項目 +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + + +## 参照 +- [P3378R2 `constexpr` exception types](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3378r2.html) + - C++26で`constexpr`対応した From 7b99f1c83dd542e57a99f91f1032af8781d407b6 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 3 Apr 2025 17:20:34 +0900 Subject: [PATCH 1488/3948] =?UTF-8?q?type=5Ftraits:=20C++26=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C=E3=81=A8=E3=81=97=E3=81=A6is=5Fvirtual=5Fbase=5Fof?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20(close=20#1312)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 2 +- reference/type_traits.md | 1 + reference/type_traits/is_virtual_base_of.md | 71 +++++++++++++++++++++ 3 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 reference/type_traits/is_virtual_base_of.md diff --git a/lang/cpp26.md b/lang/cpp26.md index 6e7ad802f6..394ba6fc15 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -432,7 +432,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 ### 型特性 - [``](/reference/type_traits.md)に、共用体のどのメンバがアクティブかを判定するための関数として[`std::is_within_lifetime()`](/reference/type_traits/is_within_lifetime.md.nolink)を追加 -- [``](/reference/type_traits.md)に、仮想継承の関係を判定する[`std::is_virtual_base_of`](/reference/type_traits/is_virtual_base_of.md.nolink)を追加 +- [``](/reference/type_traits.md)に、仮想継承の関係を判定する[`std::is_virtual_base_of`](/reference/type_traits/is_virtual_base_of.md)を追加 ### 制約 diff --git a/reference/type_traits.md b/reference/type_traits.md index 2e202f5216..fecc116656 100644 --- a/reference/type_traits.md +++ b/reference/type_traits.md @@ -119,6 +119,7 @@ |---------------------------------------------|-------------------------------------------|-------| | [`is_same`](type_traits/is_same.md) | 二つの型が同じ型か調べる (class template) | C++11 | | [`is_base_of`](type_traits/is_base_of.md) | ある型が別の型の基底クラスか調べる (class template) | C++11 | +| [`is_virtual_base_of`](type_traits/is_virtual_base_of.md) | ある型が別の型の仮想基底クラスか調べる (class template) | C++26 | | [`is_convertible`](type_traits/is_convertible.md) | ある型から別の型へ変換可能か調べる (class template) | C++11 | | [`is_nothrow_convertible`](type_traits/is_nothrow_convertible.md) | ある型から別の型へ、例外を投げずに変換可能か調べる (class template) | C++20 | | [`is_layout_compatible`](type_traits/is_layout_compatible.md) | 2つの型にレイアウト互換があるかを判定する (class template) | C++20 | diff --git a/reference/type_traits/is_virtual_base_of.md b/reference/type_traits/is_virtual_base_of.md new file mode 100644 index 0000000000..9f6fab2276 --- /dev/null +++ b/reference/type_traits/is_virtual_base_of.md @@ -0,0 +1,71 @@ +# is_virtualbase_of +* type_traits[meta header] +* std[meta namespace] +* class template[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + struct is_virtual_base_of; + + template + inline constexpr bool is_virtual_base_of_v = is_virtual_base_of::value; +} +``` + +## 概要 +型`Base`が型`Derived`の仮想基底クラスか調べる。 + + +## 要件 +`Base`と`Derived`が非共用体のクラスであり、異なる型である場合(cv修飾は無視される)、`Derived`は完全型でなければならない。 + + +## 効果 +`is_virtual_base_of`は、型`Base`が型`Derived`の仮想基底クラス (cv修飾は無視される) であるならば[`true_type`](true_type.md)から派生し、そうでなければ[`false_type`](false_type.md)から派生する。 + + +## 備考 +派生時の`private`、`protected`指定は、派生関係の判定に影響しない。 + + +## 例 +```cpp example +#include + +struct B {}; +struct B1 : virtual public B {}; +struct B2 : virtual public B {}; +struct D : public B1, public B2 {}; + +static_assert(std::is_virtual_base_of_v == true); +static_assert(std::is_virtual_base_of_v == true); +static_assert(std::is_virtual_base_of_v == true); + +// cv修飾は無視される +static_assert(std::is_virtual_base_of_v == true); + +// クラス型ではない +static_assert(std::is_virtual_base_of_v == false); + +int main() {} +``` +* std::is_virtual_base_of[color ff0000] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21.0 [mark verified] +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 10 [mark noimpl] + + +## 参照 +- [P2985R0 A type trait for detecting virtual base classes](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2985r0.html) From 1813cc79333c70064ce2e8c937a2197337d0e3a1 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 3 Apr 2025 17:40:35 +0900 Subject: [PATCH 1489/3948] =?UTF-8?q?type=5Ftraits:=20C++26=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C=E3=81=A8=E3=81=97=E3=81=A6is=5Fwithin=5Flifetime?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20(close=20#1195)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 2 +- reference/type_traits.md | 1 + reference/type_traits/is_within_lifetime.md | 94 +++++++++++++++++++++ 3 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 reference/type_traits/is_within_lifetime.md diff --git a/lang/cpp26.md b/lang/cpp26.md index 394ba6fc15..a02724939f 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -431,7 +431,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 ### 型特性 -- [``](/reference/type_traits.md)に、共用体のどのメンバがアクティブかを判定するための関数として[`std::is_within_lifetime()`](/reference/type_traits/is_within_lifetime.md.nolink)を追加 +- [``](/reference/type_traits.md)に、共用体の指定されたメンバがアクティブかを定数式で判定するための関数として[`std::is_within_lifetime()`](/reference/type_traits/is_within_lifetime.md)を追加 - [``](/reference/type_traits.md)に、仮想継承の関係を判定する[`std::is_virtual_base_of`](/reference/type_traits/is_virtual_base_of.md)を追加 diff --git a/reference/type_traits.md b/reference/type_traits.md index fecc116656..55dcffd4f8 100644 --- a/reference/type_traits.md +++ b/reference/type_traits.md @@ -226,6 +226,7 @@ | 名前 | 説明 | 対応バージョン | |------|------|----------------| +| [`is_within_lifetime`](type_traits/is_within_lifetime.md) | 共用体の指定されたメンバがアクティブかを定数式で判定する | C++26 | | [`is_constant_evaluated`](type_traits/is_constant_evaluated.md) | 呼び出された時、その呼び出しがコンパイル時に行われているかを判定する | C++20 | diff --git a/reference/type_traits/is_within_lifetime.md b/reference/type_traits/is_within_lifetime.md new file mode 100644 index 0000000000..5707bb2cf8 --- /dev/null +++ b/reference/type_traits/is_within_lifetime.md @@ -0,0 +1,94 @@ +# is_within_lifetime +* type_traits[meta header] +* function[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std { + template + consteval bool is_within_lifetime(const T* p) noexcept; // (1) C++26 +} +``` + +## 概要 +共用体の指定されたメンバがアクティブかを定数式で判定する。 + +定数式では非アクティブな共用体メンバへのアクセスができないため、以下のような非アクティブなメンバの値を使用してアクティブメンバを判定する方法が使用できない。 + +```cpp +struct OptBool { + union { bool b; char c; }; + + OptBool() : c(2) { } + OptBool(bool b) : b(b) { } + + auto has_value() const -> bool { + return c != 2; + } + + auto operator*() -> bool& { + return b; + } +}; +``` + +この関数を使用することで、コンパイル時に指定メンバがアクティブかを判定することができる。 + + +## 戻り値 +`p`が有効期間内にあるオブジェクトへのポインタであれば`true`、そうでなければ`false`を返す。 + + +## 備考 +- 式`E`を定数式として評価する際、`p`が定数式で使用可能なオブジェクトを指しているか、そのオブジェクトの完全な有効期間が`E`内で始まっていない限り、この関数の呼び出しは不適格となる + + +## 例 +```cpp example +#include + +struct OptBool { + union { bool b; char c; }; + + constexpr OptBool() : c(2) { } + constexpr OptBool(bool b) : b(b) { } + + constexpr auto has_value() const -> bool { + if consteval { + return std::is_within_lifetime(&b); // 定数式評価中は、cを読み取ることはできない + } else { + return c != 2; // 実行時評価中は、cを読み取らないといけない + } + } + + constexpr auto operator*() -> bool& { + return b; + } +}; + +int main() { + constexpr OptBool disengaged; + constexpr OptBool engaged(true); + static_assert(!disengaged.has_value()); + static_assert(engaged.has_value()); + static_assert(*engaged); +} +``` +* is_within_lifetime[color ff0000] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 20 [mark noimpl] +- [GCC](/implementation.md#gcc): 14 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 10 [mark noimpl] + +## 参照 +- [P2641R4 Checking if a `union` alternative is active](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2641r4.html) From d65e6a9925b4d1677f9d4f4d3595c5f0deddcbf4 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Thu, 3 Apr 2025 17:54:01 +0900 Subject: [PATCH 1490/3948] new page for embed #1422 --- implementation-status.md | 2 +- lang/cpp26.md | 2 +- lang/cpp26/embed.md | 70 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 lang/cpp26/embed.md diff --git a/implementation-status.md b/implementation-status.md index 6fc9da6daf..52f8bf6cea 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -322,7 +322,7 @@ | P2900R14: [契約プログラミングをサポートする](/lang/cpp26/contracts.md.nolink) | 関数の事前条件、事後条件、不変条件を記述できるようにする | | | | | | P2841R7: [コンセプトと変数テンプレートにテンプレートテンプレートパラメータのサポートを追加](/lang/cpp26/concept_and_variable-template_template-parameters.md.nolink) | テンプレート引数をあとで指定するテンプレートテンプレートパラメータを、コンセプトと変数テンプレートでも使用できるようにする | | | | | | P2786R13: [トリビアルな再配置](/lang/cpp26/trivial_relocatability.md.nolink) | ムーブ構築と破棄のためにビット単位のコピーとデストラクタ評価が必要になる型のオブジェクトを再配置するメカニズムを導入する | | | | | -| P1967R14: [ファイルを読み込む`#embed`命令を追加](/lang/cpp26/embed.md.nolink) | バイナリファイルをインクルードするメカニズム。`#include`とちがって読み出しサイズなどの柔軟な指定ができる | 15 | | | | +| P1967R14: [ファイルを読み込む`#embed`命令を追加](/lang/cpp26/embed.md) | バイナリファイルをインクルードするメカニズム。`#include`とちがって読み出しサイズなどの柔軟な指定ができる | 15 | | | | 各処理系のC++26実装状況ページ: diff --git a/lang/cpp26.md b/lang/cpp26.md index 6e7ad802f6..18be6c240a 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -88,7 +88,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| -| [ファイルを読み込む`#embed`命令を追加](/lang/cpp26/embed.md.nolink) | バイナリファイルをインクルードするメカニズム。`#include`とちがって読み出しサイズなどの柔軟な指定ができる | +| [ファイルを読み込む`#embed`命令を追加](/lang/cpp26/embed.md) | バイナリファイルをインクルードするメカニズム。`#include`とちがって読み出しサイズなどの柔軟な指定ができる | ### ソースコード diff --git a/lang/cpp26/embed.md b/lang/cpp26/embed.md new file mode 100644 index 0000000000..7daebc9e77 --- /dev/null +++ b/lang/cpp26/embed.md @@ -0,0 +1,70 @@ +# ファイルを読み込む#embed命令を追加 [P1967R14] +* cpp26[meta cpp] + + + +このページはC++26に採用される見込みの言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 + + + +## 概要 +C++26では、`#embed`ディレクティブが追加される。 + +これは、バイナリリソースを直接コード内に埋め込む機能を提供する。 + +これにより、今までは実行時に読み込んでいたファイルなどがコンパイル時点で読み込まれ、実行ファイル内に埋め込むことができるようになる。 + +## 仕様 +`#embed`ディレクティブによって読み込まれたバイナリは、`constexpr unsigned char`配列として扱われる。 +```cpp example +#include + +int main() { + constexpr unsigned char image_binary[] = { + #embed "image.bin" + }; + std::cout << std::hex; + for (unsigned char c : image_binary) { + std::cout << static_cast(c) << ' '; + } + std::cout << std::endl; +} +``` +このプログラムは、`image.bin`をバイナリデータとして扱い、バイト列を出力している。 + +つまり、下のプログラムのように`#embed`を使用するとテキストファイルの中身をそのままchar配列に格納していることと同じになる。 +```cpp example +int main() { + constexpr char text[] = { + #embed "test.txt" + }; +} +``` +`#embed`ディレクティブは、他にもパラメータを受け付ける。 +```cpp example +int main() { + constexpr unsigned char limited_data[] = { + #embed "data.bin" limit(1024); + }; + constexpr unsigned char prefixed_data[] = { + #embed "data.bin" prefix(0x01, 0x02, 0x03) + }; + constexpr unsigned char suffixed_data[] = { + #embed "data.bin" suffix(0xFE, 0xFF) + }; + constexpr unsigned char safe_data[] = { + #embed "data.bin" if_empty(0x00) + }; +} +``` +それぞれの変数では、以下のようになっている。 +- `limit(1024)`では、読み込むバイトサイズを1024byteに制限する。もしファイルサイズが1024byteよりも大きければ、最初の1024バイトのみが読み込まれる。 +- `prefix(0x01, 0x02, 0x03)`では、`data.bin`の内容の前に`0x01 0x02 0x03`のバイト列を追加している。 +- `suffix(0xFE, 0xFF)`では、`data.bin`の内容のあとに`0xFE 0xFF`のバイト列を追加している。 +- `if_empty(0x00)`では、`data.bin`がからであった場合、`0x00`のバイト列を格納している。 + + +## 参照 +- [P1967R14 #embed - a scannable, tooling-friendly binary resource inclusion mechanism](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p1967r14.html) \ No newline at end of file From 97d288b5a18ad654b402d797e58c85e179841991 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 4 Apr 2025 16:20:26 +0900 Subject: [PATCH 1491/3948] =?UTF-8?q?C++26:=20=E3=80=8C=E6=96=87=E5=AD=97?= =?UTF-8?q?=E5=88=97=E3=83=AA=E3=83=86=E3=83=A9=E3=83=AB=E3=81=AE=E6=96=87?= =?UTF-8?q?=E5=AD=97=E3=82=A8=E3=83=B3=E3=82=B3=E3=83=BC=E3=83=87=E3=82=A3?= =?UTF-8?q?=E3=83=B3=E3=82=B0=E5=A4=B1=E6=95=97=E3=82=92=E4=B8=8D=E9=81=A9?= =?UTF-8?q?=E6=A0=BC=E3=81=A8=E3=81=99=E3=82=8B=E3=80=8D=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=20(close=20#1173)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- ..._multicharacter_wide_character_literals.md | 4 +++ lang/cpp26.md | 2 +- ...on-encodable_string_literals_ill-formed.md | 36 +++++++++++++++++++ 4 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 lang/cpp26/making_non-encodable_string_literals_ill-formed.md diff --git a/implementation-status.md b/implementation-status.md index 52f8bf6cea..db8dbd6814 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -293,7 +293,7 @@ |----------|------|------------|----------------|------------|--------------| | P2752R3: [`std::initializer_list`の配列を静的ストレージに配置する](/lang/cpp26/static_storage_for_braced_initializers.md.nolink) | `std::vector v = {1, 2, 3};`のような初期化で初期化子リストを静的ストレージに配置することで無駄なコピーをなくす | 14 | | | | | P2169R4: [宣言のみで使用しない変数の名前として`_`をサポート](/lang/cpp26/nice_placeholder_with_no_name.md) | 変数名`_`は暗黙で`[[maybe_unused]]`が指定される | 14 | 18 | | | -| P1854R4: [文字列リテラルの文字エンコーディング失敗を不適格とする](/lang/cpp26/making_non-encodable_string_literals_ill-formed.md.nolink) | 文字列リテラルのエンコーディング時に文字表現が失われる場合にコンパイルエラーにする | 14 | 14 | | | +| P1854R4: [文字列リテラルの文字エンコーディング失敗を不適格とする](/lang/cpp26/making_non-encodable_string_literals_ill-formed.md) | 文字列リテラルのエンコーディング時に文字表現が失われる場合にコンパイルエラーにする | 14 | 14 | | | | P2361R6: [コンパイル時にのみ使用される文字列の扱いを明確化](/lang/cpp26/unevaluated_strings.md.nolink) | `static_assert`や`[[deprecated]]`などで使用されるコンパイル時の文字列について、文字コードの指定を禁止し、実行時エンコーディングが行われないことを規定 | 14 | 18 | | | | P2552R3: [属性の無視性を見直し](/lang/cpp26/on_the_ignorability_of_standard_attributes.md.nolink) | 構文として適格な属性のみを無視できるようにし、そうでない属性の使用を不適格とする | | | | | | P2738R1: [定数式での`void*`からポインタ型へのキャストを許可](/lang/cpp26/constexpr_cast_from_voidptr.md.nolink) | 型消去のために`void*`からポインタ型へのキャストを許可する | 14 | 17 | | | diff --git a/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md b/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md index dddacb944d..440c3dce71 100644 --- a/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md +++ b/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md @@ -30,5 +30,9 @@ wchar_t c = L'é'; // C++20:OK, C++23:NG \u0065\u0301 変数`c`のケースは1文字のように見えても複数のコードポイントで構成されており、マルチキャラクタリテラルの一種であるため禁止とする。 +## 関連項目 +- [C++26 文字列リテラルの文字エンコーディング失敗を不適格とする](/lang/cpp26/making_non-encodable_string_literals_ill-formed.md) + + ## 参照 - [P2362R3 Remove non-encodable wide character literals and multicharacter wide character literals](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2362r3.pdf) diff --git a/lang/cpp26.md b/lang/cpp26.md index 4b07983138..1544b4ec2d 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -25,7 +25,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| -| [文字列リテラルの文字エンコーディング失敗を不適格とする](/lang/cpp26/making_non-encodable_string_literals_ill-formed.md.nolink) | 文字列リテラルのエンコーディング時に文字表現が失われる場合にコンパイルエラーにする | +| [文字列リテラルの文字エンコーディング失敗を不適格とする](/lang/cpp26/making_non-encodable_string_literals_ill-formed.md) | 文字列リテラルのエンコーディング時に文字表現が失われる場合にコンパイルエラーにする | | [コンパイル時にのみ使用される文字列の扱いを明確化](/lang/cpp26/unevaluated_strings.md.nolink) | `static_assert`や`[[deprecated]]`などで使用されるコンパイル時の文字列について、文字コードの指定を禁止し、実行時エンコーディングが行われないことを規定 | diff --git a/lang/cpp26/making_non-encodable_string_literals_ill-formed.md b/lang/cpp26/making_non-encodable_string_literals_ill-formed.md new file mode 100644 index 0000000000..10bf6463f1 --- /dev/null +++ b/lang/cpp26/making_non-encodable_string_literals_ill-formed.md @@ -0,0 +1,36 @@ +# 文字列リテラルの文字エンコーディング失敗を不適格とする [P1854R4] +* cpp26[meta cpp] + + + +このページはC++26に採用される見込みの言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 + + + +## 概要 +C++23では、以下のような1ワイド文字に収まらないリテラルが不適格 (コンパイルエラー) になるよう仕様変更された。 + +```cpp +wchar_t a = L'🤦'; // C++20:OK, C++23:OK \U0001f926 +wchar_t b = L'ab'; // C++20:OK, C++23:NG マルチキャラクタリテラル +wchar_t c = L'é'; // C++20:OK, C++23:NG \u0065\u0301 +``` + +C++26ではさらに、文字列リテラルとしてエンコーディングできない文字の扱いが実装定義でコンパイラーに任されていたものを、不適格になるよう仕様変更する。 + +```cpp +wchar_t ao = L'\x123456789abcdef0'; // C++23:実装定義, C++26:NG (範囲外) +char16_t ap = u'\x12345678'; // C++23:実装定義, C++26:NG (範囲外) +``` + +また、マルチ文字リテラル (ひとつの文字リテラルに4文字まで入れられて値が実装定義なもの。例として`'intl'`) については、単一のコードユニットにエンコードされるもののみ許可される。 + + +## 関連項目 +- [C++23 1ワイド文字に収まらないワイド文字リテラルを禁止する](/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md) + + +## 参照 +- [P1854R4 Making non-encodable string literals ill-formed](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1854r4.pdf) From 494c6d25f86f1b140e52e1bbf89f87dad6071e98 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 4 Apr 2025 16:45:27 +0900 Subject: [PATCH 1492/3948] =?UTF-8?q?C++26=20std::execution=E3=82=A8?= =?UTF-8?q?=E3=83=B3=E3=83=86=E3=82=A3=E3=83=86=E3=82=A3=E4=B8=80=E8=A6=A7?= =?UTF-8?q?(#1384)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ヘッダ - ヘッダ --- reference.md | 2 +- reference/execution.md | 18 +++- reference/execution/execution.md | 137 ++++++++++++++++++++++++++++++- reference/stop_token.md | 18 +++- working_style.md | 3 + 5 files changed, 170 insertions(+), 8 deletions(-) diff --git a/reference.md b/reference.md index fb07b625d3..19dcd1dff8 100644 --- a/reference.md +++ b/reference.md @@ -73,7 +73,7 @@ | [``](/reference/memory_resource.md) | 多相アロケータ | C++17 | | [``](/reference/chrono.md) | 時間ユーティリティ | C++11 | | [``](/reference/typeindex.md) | 型のインデックス | C++11 | -| [``](/reference/execution.md) | 実行ポリシー | C++17 | +| [``](/reference/execution.md) | 実行ポリシー、実行制御ライブラリ(C++26) | C++17 | | [``](/reference/charconv.md) | 高速な文字列 ⇔ 数値変換 | C++17 | | [``](/reference/format.md) | 文字列フォーマット | C++20 | | [``](/reference/stacktrace.md) | スタックトレース | C++23 | diff --git a/reference/execution.md b/reference/execution.md index a0228310e3..c4fe506ba3 100644 --- a/reference/execution.md +++ b/reference/execution.md @@ -2,18 +2,30 @@ * execution[meta header] * cpp17[meta cpp] -``ヘッダでは、アルゴリズムの並列実行を許可するための実行ポリシー型を定義する。 +``ヘッダでは、アルゴリズムの並列実行を許可するための実行ポリシー、汎用的な非同期実行フレームワークとしての実行制御ライブラリを定義する。 +## 実行ポリシー(C++17) + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`execution`](execution/execution.md) | 実行ポリシー用の名前空間 (namespace) | C++17 | +| [`is_execution_policy`](execution/is_execution_policy.md) | 型が実行ポリシーかを判定する (class template) | C++17 | + + +## 実行制御ライブラリ(C++26) + | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`is_execution_policy`](execution/is_execution_policy.md) | 型が実行ポリシーかを判定する | C++17 | -| [`execution`](execution/execution.md) | 実行ポリシー用の名前空間 | C++17 | +| [`execution`](execution/execution.md) | 実行制御ライブラリの名前空間 (namespace) | C++26 | +| [`this_thread`](execution/execution.md) | 実行制御ライブラリ/Senderコンシューマの名前空間 (namespace) | C++26 | ## バージョン ### 言語 - C++17 +- C++26 実行制御ライブラリ ## 参照 - [P0024R2 The Parallelism TS Should be Standardized](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0024r2.html) +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution.md b/reference/execution/execution.md index e917122447..3d788b3195 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -4,7 +4,8 @@ * namespace[meta id-type] * cpp17[meta cpp] -名前空間 `std::execution` では、アルゴリズムの並列実行を許可するための実行ポリシーに関する機能の定義を行う。 +名前空間 `std::execution` では、アルゴリズムの並列実行を許可するための実行ポリシー、汎用的な非同期実行フレームワークとしての実行制御ライブラリを定義する。 +(実行制御ライブラリの一部は名前空間 `std` および `std::this_thread` で定義されるが、本ページでまとめて取り扱う。) ```cpp namespace std::execution { @@ -12,6 +13,7 @@ namespace std::execution { } ``` +## 実行ポリシー(C++17) | 名前 | 説明 | 対応バージョン | |------|------|----------------| @@ -24,7 +26,140 @@ namespace std::execution { | [`par_unseq`](execution/execution_policy.md) | マルチスレッド化/ベクトル化の実行ポリシー値 (variable) | C++17 | | [`unseq`](execution/execution_policy.md) | ベクトル化の実行ポリシー値 (variable) | C++20 | +実行ポリシーは全て名前空間 `std::execution` で定義される。 + + +## 実行制御ライブラリ(C++26) + +### Queries + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`forwarding_query`](forwarding_query.md.nolink) | 進行保証の問い合わせオブジェクト (customization point object) | C++26 | +| [`get_allocator`](get_allocator.md.nolink) | アロケータ取得の問い合わせオブジェクト (customization point object) | C++26 | +| [`get_stop_token`](get_stop_token.md.nolink) | 停止トークン取得の問い合わせオブジェクト (customization point object) | C++26 | +| [`stop_token_of_t`](get_stop_token.md.nolink) | 指定型から停止トークン型を取得 (alias template) | C++26 | +| [`execution::get_domain`](execution/get_domain.md.nolink) | 実行ドメイン取得の問い合わせオブジェクト (customization point object) | C++26 | +| [`execution::get_scheduler`](execution/get_scheduler.md.nolink) | Scheduler取得の問い合わせオブジェクト (customization point object) | C++26 | +| [`execution::get_delegation_scheduler`](execution/get_delegation_scheduler.md.nolink) | 委譲Scheduler取得の問い合わせオブジェクト (customization point object) | C++26 | +| [`execution::forward_progress_guarantee`](execution/forward_progress_guarantee.md.nolink) | 前進保証 (enum) | C++26 | +| [`execution::get_forward_progress_guarantee`](execution/get_forward_progress_guarantee.md.nolink) | 前進保証取得の問い合わせオブジェクト (customization point object) | C++26 | +| [`execution::get_completion_scheduler`](execution/get_completion_scheduler.md.nolink) | 完了Scheduler取得の問い合わせオブジェクト (customization point object) | C++26 | +| [`execution::get_env`](execution/get_env.md.nolink) | 環境取得の問い合わせオブジェクト (customization point object) | C++26 | +| [`execution::env_of_t`](execution/env_of_t.md.nolink) | 指定型から環境型を取得 (alias template) | C++26 | +| [`execution::prop`](execution/prop.md.nolink) | プロパティ(class template) | C++26 | +| [`execution::env`](execution/env.md.nolink) | 環境 (class template) | C++26 | + +問い合わせオブジェクトは名前空間 `std` および名前空間 `std::execution` で定義される。 + +### Scheduler + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`execution::scheduler`](execution/scheduler.md.nolink) | Scheduler (concept) | C++26 | + +### Reciever + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`execution::receiver`](execution/receiver.md.nolink) | Reciever (concept) | C++26 | +| [`execution::receiver_of`](execution/receiver_of.md.nolink) | 完了ハンドラ指定Reciever (concept) | C++26 | +| [`execution::set_value`](execution/set_value.md.nolink) | 値による完了関数 (customization point object) | C++26 | +| [`execution::set_error`](execution/set_error.md.nolink) | エラーによる完了関数 (customization point object) | C++26 | +| [`execution::set_stopped`](execution/set_stopped.md.nolink) | 停止による完了関数 (customization point object) | C++26 | + +### Operation State + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`execution::operation_state`](execution/operation_state.md.nolink) | Operation State (concept) | C++26 | +| [`execution::start`](execution/start.md.nolink) | 非同期操作の開始 (customization point object) | C++26 | + +### Sender + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`execution::default_domain`](execution/default_domain.md.nolink) | デフォルト実行ドメイン (class) | C++26 | +| [`execution::sender`](execution/sender.md.nolink) | Sender (concept) | C++26 | +| [`execution::sender_in`](execution/sender_in.md.nolink) | 環境に対応するSender (concept) | C++26 | +| [`execution::sender_to`](execution/sender_to.md.nolink) | Recieverに対応するSender (concept) | C++26 | +| [`execution::get_completion_signatures`](execution/get_completion_signatures.md.nolink) | 完了シグネチャ取得の問い合わせオブジェクト (customization point object) | C++26 | +| [`execution::completion_signatures_of_t`](execution/get_completion_signatures.md.nolink) | Senderから完了シグネチャを取得 (alias template) | C++26 | +| [`execution::value_types_of_t`](execution/value_types_of_t.md.nolink) | Senderの値完了型を取得 (alias template) | C++26 | +| [`execution::error_types_of_t`](execution/error_types_of_t.md.nolink) | Senderのエラー完了型を取得 (alias template) | C++26 | +| [`execution::sends_stopped`](execution/value_types_of_t.md.nolink) | Senderが停止完了に対応するか否か (variable template) | C++26 | +| [`execution::tag_of_t`](execution/tag_of_t.md.nolink) | Senderのタグ型を取得 (alias template) | C++26 | +| [`execution::transform_sender`](execution/transform_sender.md.nolink) | Senderを変換 (function template) | C++26 | +| [`execution::transform_env`](execution/transform_env.md.nolink) | 問い合わせオブジェクトを変換 (function template) | C++26 | +| [`execution::apply_sender`](execution/apply_sender.md.nolink) | Senderにタグ型と引数を適用 (function template) | C++26 | +| [`execution::connect`](execution/connect.md.nolink) | SenderとRecieverを接続 (customization point object) | C++26 | +| [`execution::connect_result_t`](execution/connect_result_t.md.nolink) | `connect`結果型を取得 (alias template) | C++26 | + +### Senderファクトリ + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`execution::just`](execution/just.md.nolink) | 値を送信するSender (customization point object) | C++26 | +| [`execution::just_error`](execution/just_error.md.nolink) | エラーを送信するSender (customization point object) | C++26 | +| [`execution::just_stopped`](execution/just_stopped.md.nolink) | 停止を送信するSender (customization point object) | C++26 | +| [`execution::read_env`](execution/read_env.md.nolink) | Reciever環境から構築されるSender (customization point object) | C++26 | +| [`execution::schedule`](execution/schedule.md.nolink) | Scheduler上で実行されるSender (customization point object) | C++26 | +| [`execution::schedule_result_t`](execution/schedule_result_t.md.nolink) | `schedule`結果型を取得 (alias template) | C++26 | + +### Senderアダプタ + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`execution::sender_adaptor_closure`](execution/sender_adaptor_closure.md.nolink) | Senderアダプタ実装用クロージャ型(class template) | C++26 | +| [`execution::starts_on`](execution/starts_on.md.nolink) | 指定Scheduler上で開始する (customization point object) | C++26 | +| [`execution::continues_on`](execution/continues_on.md.nolink) | 指定Scheduler上で継続する (customization point object) | C++26 | +| [`execution::on`](execution/on.md.nolink) | 指定Scheduler上で実行する (customization point object) | C++26 | +| [`execution::schedule_from`](execution/schedule_from.md.nolink) | Sender完了に依存する作業をスケジュール (customization point object) | C++26 | +| [`execution::then`](execution/then.md.nolink) | 値完了時の継続処理をアタッチ (customization point object) | C++26 | +| [`execution::upon_error`](execution/upon_error.md.nolink) | エラー完了時の継続処理をアタッチ (customization point object) | C++26 | +| [`execution::upon_stopped`](execution/upon_stopped.md.nolink) | 停止完了時の継続処理をアタッチ (customization point object) | C++26 | +| [`execution::let_value`](execution/let_value.md.nolink) | 値完了の継続にユーザ定義処理を連結 (customization point object) | C++26 | +| [`execution::let_error`](execution/let_error.md.nolink) | エラー完了の継続にユーザ定義処理を連結 (customization point object) | C++26 | +| [`execution::let_stopped`](execution/let_stopped.md.nolink) | 停止完了の継続にユーザ定義処理を連結 (customization point object) | C++26 | +| [`execution::bulk`](execution/bulk.md.nolink) | インデクス空間上で指定関数を連続実行 (customization point object) | C++26 | +| [`execution::split`](execution/split.md.nolink) | 入力Senderの値を複製送信 (customization point object) | C++26 | +| [`execution::when_all`](execution/when_all.md.nolink) | 全ての入力Sender完了を待機 (customization point object) | C++26 | +| [`execution::when_all_with_variant`](execution/when_all_with_variant.md.nolink) | 複数の値完了シグネチャをもつ全ての入力Sender完了を待機 (customization point object) | C++26 | +| [`execution::into_variant`](execution/into_variant.md.nolink) | 複数の値完了シグネチャを単一[`variant`](/reference/variant/variant.md)型の値完了シグネチャに変換 (customization point object) | C++26 | +| [`execution::stopped_as_optional`](execution/stopped_as_optional.md.nolink) | 入力Senderの停止完了を[`optional`](/reference/optional/optional.md)型の値完了に変換 (customization point object) | C++26 | +| [`execution::stopped_as_error`](execution/stopped_as_error.md.nolink) | 入力Senderの停止完了をエラー完了に変換 (customization point object) | C++26 | + +### Senderコンシューマ + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`this_thread::sync_wait`](this_thread/sync_wait.md.nolink) | 現在のスレッド上でSender完了を待機 (customization point object) | C++26 | +| [`this_thread::sync_wait_with_variant`](this_thread/sync_wait_with_variant.md.nolink) | 現在のスレッド上でSender完了を待機 (customization point object) | C++26 | + +Senderコンシューマは名前空間 `std::this_thread` で定義される。 + +### Sender/Recieverユーティリティ + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`execution::completion_signatures`](execution/completion_signatures.md.nolink) | 完了シグネチャ (class template) | C++26 | +| [`execution::transform_completion_signatures`](execution/transform_completion_signatures.md.nolink) | 完了シグネチャを変換 (alias template) | C++26 | +| [`execution::transform_completion_signatures_of`](execution/transform_completion_signatures_of.md.nolink) | 完了シグネチャを変換 (alias template) | C++26 | +| [`execution::run_loop`](execution/run_loop.md.nolink) | 実行ループ (class) | C++26 | + +### コルーチンユーティリティ + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`execution::as_awaitable`](execution/as_awaitable.md.nolink) | Senderを[Awaitable型](/lang/cpp20/coroutines.md)へ変換 (customization point object) | C++26 | +| [`execution::with_awaitable_senders`](execution/with_awaitable_senders.md.nolink) | [Promise型](/lang/cpp20/coroutines.md)の基底クラス (class template) | C++26 | + ## バージョン ### 言語 - C++17 +- C++26 実行制御ライブラリ + +## 参照 +- [P0024R2 The Parallelism TS Should be Standardized](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0024r2.html) +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/stop_token.md b/reference/stop_token.md index c669a23ca0..619363b77c 100644 --- a/reference/stop_token.md +++ b/reference/stop_token.md @@ -2,14 +2,25 @@ * stop_token[meta header] * cpp20[meta cpp] -``ヘッダはマルチスレッド処理に対する停止要求の状態 `停止状態` を扱うクラスを定義する。 +``ヘッダは、マルチスレッド処理や非同期処理おける停止要求の状態 `停止状態` を扱うクラスを定義する。 + +- [`stop_token`](stop_token/stop_token.md), [`stop_source`](stop_token/stop_source.md), [`stop_callback`](stop_token/stop_callback.md)は停止状態を共有所有する。最後に破棄されたオブジェクトが停止状態を自動的に解放する。 +- [`inplace_stop_source`](stop_token/inplace_stop_source.md.nolink)は停止状態をメンバとして直接所有する。[`inplace_stop_token`](stop_token/inplace_stop_token.md.nolink)と[`inplace_stop_callback`](stop_token/inplace_stop_callback.md.nolink)は停止状態の所有には関与しない。 | 名前 | 説明 | 対応バージョン | |-----------------------------------------------|------------------------------|-------| -| [`stop_token`](stop_token/stop_token.md) | 停止状態を表すクラス(class) | C++20 | +| [`stoppable_token`](stop_token/stoppable_token.md.nolink) | 停止可能な停止トークン(concept) | C++26 | +| [`unstoppable_token`](stop_token/unstoppable_token.md.nolink) | 停止不可能な停止トークン(concept) | C++26 | +| [`stop_token`](stop_token/stop_token.md) | 停止トークン(class) | C++20 | | [`stop_source`](stop_token/stop_source.md) | 停止要求を発生させるクラス(class) | C++20 | -| [`stop_callback`](stop_token/stop_callback.md)| 停止要求に応じて呼び出されるコールバックを表すクラステンプレート (class template) | C++20 | +| [`stop_callback`](stop_token/stop_callback.md)| 停止要求に応じて呼び出されるコールバック (class template) | C++20 | | [`nostopstate`](stop_token/nostopstate.md) | 停止状態を扱わない[`stop_source`](stop_token/stop_source.md)を構築するためのタグ (class) | C++20 | +| [`never_stop_token`](stop_token/never_stop_token.md.nolink) | 停止不可能な停止トークン(class) | C++26 | +| [`inplace_stop_token`](stop_token/inplace_stop_token.md.nolink) | インプレース停止トークン(class) | C++26 | +| [`inplace_stop_source`](stop_token/inplace_stop_source.md.nolink) | インプレース停止要求を発生させるクラス(class) | C++26 | +| [`inplace_stop_callback`](stop_token/inplace_stop_callback.md.nolink) | インプレース停止要求に応じて呼び出されるコールバック(class template) | C++26 | +| [`stop_callback_for_t`](stop_token/stop_callback_for_t.md.nolink) | 停止トークンに対応するコールバック型を取得(alias template) | C++26 | + ## バージョン ### 言語 @@ -24,3 +35,4 @@ ## 参照 - [P0660R10 Stop token and joining thread](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0660r10.pdf) +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/working_style.md b/working_style.md index c102272fd7..771c89b918 100644 --- a/working_style.md +++ b/working_style.md @@ -70,6 +70,7 @@ C++11以降対応については対応バージョンを明記します。バー | base class | 基底クラス | | bidirectional iterator | 双方向イテレータ | | bucket | バケット | +| completion signature | 完了シグネチャ | | complexity | 計算量 | | compound type | 複合型 | | const iterator | 読み取り専用イテレータ | @@ -121,6 +122,7 @@ C++11以降対応については対応バージョンを明記します。バー | predicate | 述語 | | propagation, propagate | 伝播
(伝搬は誤用が広まったものなので使わない) | | pure virtual function | 純粋仮想関数 | +| query object | 問い合わせオブジェクト | | random access iterator | ランダムアクセスイテレータ | | range | 一般用途の場合:範囲
Rangeアルゴリズム・Rangeアダプタ・Rangeオブジェクトの場合:Range
range-based for:範囲for文
2つのイテレータによる範囲:イテレータ範囲 | | region of RCU protection | RCU保護区間 | @@ -134,6 +136,7 @@ C++11以降対応については対応バージョンを明記します。バー | static extent | (std::mdspanの) 静的要素数 | | stop request | 停止要求 | | stop state | 停止状態 | +| stop token | 停止トークン | | Spurious Failure | 見かけ上の失敗
[https://togetter.com/li/430770](https://togetter.com/li/430770) | | strict weak ordering | 狭義の弱順序 | | stride | (std::mdspanの) ストライド幅 | From 7bf378e8d9b811e182fb8a7d804c73e1a2706605 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 4 Apr 2025 18:27:26 +0900 Subject: [PATCH 1493/3948] stop_token: (un)stoppable_token (#1384) --- reference/stop_token.md | 26 +++-- reference/stop_token/stoppable_token.md | 117 ++++++++++++++++++++++ reference/stop_token/unstoppable_token.md | 41 ++++++++ 3 files changed, 173 insertions(+), 11 deletions(-) create mode 100644 reference/stop_token/stoppable_token.md create mode 100644 reference/stop_token/unstoppable_token.md diff --git a/reference/stop_token.md b/reference/stop_token.md index 619363b77c..136cb02755 100644 --- a/reference/stop_token.md +++ b/reference/stop_token.md @@ -7,19 +7,24 @@ - [`stop_token`](stop_token/stop_token.md), [`stop_source`](stop_token/stop_source.md), [`stop_callback`](stop_token/stop_callback.md)は停止状態を共有所有する。最後に破棄されたオブジェクトが停止状態を自動的に解放する。 - [`inplace_stop_source`](stop_token/inplace_stop_source.md.nolink)は停止状態をメンバとして直接所有する。[`inplace_stop_token`](stop_token/inplace_stop_token.md.nolink)と[`inplace_stop_callback`](stop_token/inplace_stop_callback.md.nolink)は停止状態の所有には関与しない。 +## コンセプト | 名前 | 説明 | 対応バージョン | -|-----------------------------------------------|------------------------------|-------| -| [`stoppable_token`](stop_token/stoppable_token.md.nolink) | 停止可能な停止トークン(concept) | C++26 | -| [`unstoppable_token`](stop_token/unstoppable_token.md.nolink) | 停止不可能な停止トークン(concept) | C++26 | -| [`stop_token`](stop_token/stop_token.md) | 停止トークン(class) | C++20 | -| [`stop_source`](stop_token/stop_source.md) | 停止要求を発生させるクラス(class) | C++20 | +|------|------|-------| +| [`stoppable_token`](stop_token/stoppable_token.md) | 停止トークン型であることを表す (concept) | C++26 | +| [`unstoppable_token`](stop_token/unstoppable_token.md) | 停止不可能な停止トークン型であることを表す (concept) | C++26 | + +## 停止トークン +| 名前 | 説明 | 対応バージョン | +|------|------|-------| +| [`stop_token`](stop_token/stop_token.md) | 停止トークン (class) | C++20 | +| [`stop_source`](stop_token/stop_source.md) | 停止要求を発生させるクラス (class) | C++20 | | [`stop_callback`](stop_token/stop_callback.md)| 停止要求に応じて呼び出されるコールバック (class template) | C++20 | | [`nostopstate`](stop_token/nostopstate.md) | 停止状態を扱わない[`stop_source`](stop_token/stop_source.md)を構築するためのタグ (class) | C++20 | -| [`never_stop_token`](stop_token/never_stop_token.md.nolink) | 停止不可能な停止トークン(class) | C++26 | -| [`inplace_stop_token`](stop_token/inplace_stop_token.md.nolink) | インプレース停止トークン(class) | C++26 | -| [`inplace_stop_source`](stop_token/inplace_stop_source.md.nolink) | インプレース停止要求を発生させるクラス(class) | C++26 | -| [`inplace_stop_callback`](stop_token/inplace_stop_callback.md.nolink) | インプレース停止要求に応じて呼び出されるコールバック(class template) | C++26 | -| [`stop_callback_for_t`](stop_token/stop_callback_for_t.md.nolink) | 停止トークンに対応するコールバック型を取得(alias template) | C++26 | +| [`never_stop_token`](stop_token/never_stop_token.md.nolink) | 停止不可能な停止トークン (class) | C++26 | +| [`inplace_stop_token`](stop_token/inplace_stop_token.md.nolink) | インプレース停止トークン (class) | C++26 | +| [`inplace_stop_source`](stop_token/inplace_stop_source.md.nolink) | インプレース停止要求を発生させるクラス (class) | C++26 | +| [`inplace_stop_callback`](stop_token/inplace_stop_callback.md.nolink) | インプレース停止要求に応じて呼び出されるコールバック (class template) | C++26 | +| [`stop_callback_for_t`](stop_token/stop_callback_for_t.md.nolink) | 停止トークンに対応するコールバック型を取得 (alias template) | C++26 | ## バージョン @@ -27,7 +32,6 @@ - C++20 ### 処理系 - - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? diff --git a/reference/stop_token/stoppable_token.md b/reference/stop_token/stoppable_token.md new file mode 100644 index 0000000000..8f5615a837 --- /dev/null +++ b/reference/stop_token/stoppable_token.md @@ -0,0 +1,117 @@ +# stoppable_token +* stop_token[meta header] +* concept[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std { + template + concept stoppable_token; +} +``` + +## 概要 +`stoppable_token`は、型`Token`が停止トークンとしての基本的なインタフェースを提供することを表すコンセプトである。 + + +## 要件 +まず、説明専用クラステンプレート`check-type-alias-exists`を以下のように定義する。 + +```cpp +template class> +struct check-type-alias-exists; +``` + +`stoppable_token`コンセプトは、以下のように定義される。 + +```cpp +template +concept stoppable_token = + requires (const Token tok) { + typename check-type-alias-exists; + { tok.stop_requested() } noexcept -> same_as; + { tok.stop_possible() } noexcept -> same_as; + { Token(tok) } noexcept; + } && + copyable && + equality_comparable && + swappable; +``` +* same_as[link /reference/concepts/same_as.md] +* copyable[link /reference/concepts/copyable.md] +* equality_comparable[link /reference/concepts/equality_comparable.md] +* swappable[link /reference/concepts/swappable.md] + + +## モデル + +説明用の変数`t`, `u`を、同一の停止状態を参照する別々な`Token`型ブジェクトとする。 +型`Token`が以下を満たす場合に限って、型`Token`は`stoppable_token`のモデルである。 + +- `SP`を`t.stop_possible()`が`false`となる評価としたとき、`SP`より後に発生する`u.stop_possible()`や`u.stop_requested()`の評価は`false`であること。 +- `SR`を`t.stop_requested()`が`true`となる評価としたとき、`SR`より後に発生する`u.stop_possible()`や`u.stop_requested()`の評価は`true`であること。 +- `stoppable-callback-for`を満たす任意の型`CallbackFn`および型`Initialize`が、`stoppable-callback-for`のモデルであること。 +- `t`が停止状態を持たない(disengaged)とき、`t.stop_possible()`や`t.stop_requested()`の評価が`false`であること。 +- `t`と`u`が同一の停止状態を参照するか共に停止状態を持たない(disengaged)とき`t == u`が`true`であり、それ以外のときは`false`であること。 + + +ここで、説明専用コンセプト`stoppable-callback-for`を以下のように定義する。 + +```cpp +template +concept stoppable-callback-for = + invocable && + constructible_from && + requires { typename stop_callback_for_t; } && + constructible_from, const Token&, Initializer>; +``` +* invocable[link /reference/concepts/invocable.md] +* constructible_from[link /reference/concepts/constructible_from.md] +* stop_callback_for_t[link stop_callback_for_t.md.nolink] + +説明用の`init`を[`same_as`](/reference/concepts/same_as.md)``を満たす式、型`SCB`を[`stop_callback_for_t`](stop_callback_for_t.md.nolink)``とする。 + +`stoppable-callback-for`のモデルとなるには、下記を満たすこと。 + +- 次のコンセプトのモデルであること。 + - [`constructible_from`](/reference/concepts/constructible_from.md)`` + - [`constructible_from`](/reference/concepts/constructible_from.md)`` + - [`constructible_from`](/reference/concepts/constructible_from.md)`` +- 説明用の`scb`を`SCB`型オブジェクト、`callback_fn`を`scb`に関連付けられた`CallbackFn`型のコールバック関数とする。引数`t`と`init`からの直接非リスト初期化`scb`は、次のように停止可能コールバック登録(stoppable callback registration)を実行すること。 + - `t.stop_possible() == true`のとき、 + - `callback_fn`が`init`で直接初期化される。 + - `scb`構築が送出する例外は、`init`からの`callback_fn`構築で送出された例外のみ。 + - コールバック呼び出し[`std::forward`](/reference/utility/forward.md)`(callback_fn)()`は、次のように`t`に関連する停止状態に登録されること。 + - 登録時点で`t.stop_requested()`が`false`に評価されるとき、コールバック呼び出しは停止状態のコールバックリストに追加され、停止状態に停止要求が行われたたときに[`std::forward`](/reference/utility/forward.md)`(callback_fn)()`が評価される。 + - そうでなければ、`scb`コンストラクタを実行したスレッド上で[`std::forward`](/reference/utility/forward.md)`(callback_fn)()`が即時実行され、コールバック呼び出しはリストに追加されない。 + - `t.stop_possible() == false`のとき、`callback_fn`の初期化による`scb`初期化には要求が課されない。 +- `scb`の破棄は、次のように停止可能コールバック登録解除(stoppable callback deregistration)を実行すること。 + - `scb`コンストラクタが`t`の停止状態にコールバック呼び出しを登録していなければ、停止可能コールバック登録解除は`callback_fn`破棄以外の効果を持たない。 + - そうでなければ、関連する停止状態から`callback_fn`の呼び出しが除外されること。 + - `callback_fn`が別スレッド上で並行実行中の場合、当該`callback_fn`呼び出しから戻るまで停止可能コールバック登録解除はブロックされる。この`callback_fn`呼び出しからの戻りは`callback_fn`の破棄よりも確実に前に発生する。 + - `callback_fn`が現在のスレッド上で実行中の場合、デストラクタは`callback_fn`からの戻りを待機してブロックしてはいけない。 + - 停止可能コールバック登録解除は、同じ停止状態に登録された他のコールバック呼び出しの完了をブロックしてはいけない。 + - 停止可能コールバック登録解除は`callback_fn`を破棄すること。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`unstoppable_token`](unstoppable_token.md) +- [`stop_token`](stop_token.md) +- [`inplace_stop_token`](inplace_stop_token.md.nolink) +- [`never_stop_token`](never_stop_token.md.nolink) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/stop_token/unstoppable_token.md b/reference/stop_token/unstoppable_token.md new file mode 100644 index 0000000000..24a9165f0f --- /dev/null +++ b/reference/stop_token/unstoppable_token.md @@ -0,0 +1,41 @@ +# unstoppable_token +* stop_token[meta header] +* concept[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std { + template + concept unstoppable_token = + stoppable_token && + requires (const Token tok) { + requires bool_constant<(!tok.stop_possible())>::value; + }; +} +``` +* stoppable_token[link stoppable_token.md] +* bool_constant[link /reference/type_traits/bool_constant.md] + + +## 概要 +`unstoppable_token`は、型`Token`が停止不可能な停止トークンであることを表すコンセプトである。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`stoppable_token`](stoppable_token.md) +- [`never_stop_token`](never_stop_token.md.nolink) + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) From e822b00bbd33419db9a4907b45d052da44001fc1 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 4 Apr 2025 18:52:54 +0900 Subject: [PATCH 1494/3948] Rewrote lang/cpp26/embed.md Commit for Issue #1422 --- lang/cpp26/embed.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lang/cpp26/embed.md b/lang/cpp26/embed.md index 7daebc9e77..ef5fc9ee64 100644 --- a/lang/cpp26/embed.md +++ b/lang/cpp26/embed.md @@ -65,6 +65,18 @@ int main() { - `suffix(0xFE, 0xFF)`では、`data.bin`の内容のあとに`0xFE 0xFF`のバイト列を追加している。 - `if_empty(0x00)`では、`data.bin`がからであった場合、`0x00`のバイト列を格納している。 +また、`#embed`ディレクティブは、複数のパラメータを**順不同**で組み合わせて指定することもできる。 + +```cpp example +int main() { + constexpr unsigned char combined_data[] = { + #embed "data.bin" limit(1024) prefix(0x01, 0x02) suffix(0xFF) if_empty(0x00) + }; +} +``` +これは、`limit(1024)`でファイルサイズを1024バイトに制限し、`prefix(0x01, 0x02)`で先頭バイト列`0x01 0x02`を追加し、 +`suffix(0xFF)`で末尾`0xFF`を追加し、`if_empty(0x00)`で空の場合は`0x00`を格納することになる。 + ## 参照 - [P1967R14 #embed - a scannable, tooling-friendly binary resource inclusion mechanism](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p1967r14.html) \ No newline at end of file From fa3f23c2a1177ff515f4b19d2dea734e5733f3a7 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 4 Apr 2025 18:58:25 +0900 Subject: [PATCH 1495/3948] stop_token: stop_callback_for_t (#1384) - stop_token: callback_type - stop_callback: Callback -> CallbackFn --- reference/stop_token.md | 2 +- reference/stop_token/stop_callback.md | 16 +++++----- .../stop_callback/op_constructor.md | 16 +++++----- .../stop_callback/op_deduction_guide.md | 4 +-- reference/stop_token/stop_callback_for_t.md | 31 +++++++++++++++++++ reference/stop_token/stop_token.md | 19 ++++++++---- .../stop_token/stop_token/callback_type.md | 30 ++++++++++++++++++ reference/stop_token/stoppable_token.md | 4 +-- 8 files changed, 95 insertions(+), 27 deletions(-) create mode 100644 reference/stop_token/stop_callback_for_t.md create mode 100644 reference/stop_token/stop_token/callback_type.md diff --git a/reference/stop_token.md b/reference/stop_token.md index 136cb02755..c93b4a0a80 100644 --- a/reference/stop_token.md +++ b/reference/stop_token.md @@ -24,7 +24,7 @@ | [`inplace_stop_token`](stop_token/inplace_stop_token.md.nolink) | インプレース停止トークン (class) | C++26 | | [`inplace_stop_source`](stop_token/inplace_stop_source.md.nolink) | インプレース停止要求を発生させるクラス (class) | C++26 | | [`inplace_stop_callback`](stop_token/inplace_stop_callback.md.nolink) | インプレース停止要求に応じて呼び出されるコールバック (class template) | C++26 | -| [`stop_callback_for_t`](stop_token/stop_callback_for_t.md.nolink) | 停止トークンに対応するコールバック型を取得 (alias template) | C++26 | +| [`stop_callback_for_t`](stop_token/stop_callback_for_t.md) | 対応するコールバック型を取得 (alias template) | C++26 | ## バージョン diff --git a/reference/stop_token/stop_callback.md b/reference/stop_token/stop_callback.md index 1886e40624..f71392b3e9 100644 --- a/reference/stop_token/stop_callback.md +++ b/reference/stop_token/stop_callback.md @@ -6,7 +6,7 @@ ```cpp namespace std { - template + template class stop_callback; } ``` @@ -17,7 +17,7 @@ namespace std { ## メンバ関数 | 名前 | 説明 | 対応バージョン | -|---------------------------------------------------|--------------------------------------------------------------------|-------| +|------|------|-------| | [`(constructor)`](stop_callback/op_constructor.md)| コンストラクタ | C++20 | | [`(destructor)`](stop_callback/op_destructor.md) | デストラクタ | C++20 | | `operator=(const stop_callback&) = delete;` | 代入演算子 | C++20 | @@ -25,21 +25,21 @@ namespace std { ## メンバ型 -| 名前 | 説明 | 対応バージョン | -|-----------------|----------------|----------------| -| `callback_type` | テンプレート引数`Callback`に指定した型| C++20 | +| 名前 | 説明 | 対応バージョン | +|------|------|-------| +| `callback_type` | `CallbackFn` | C++20 | ## 推論補助 | 名前 | 説明 | 対応バージョン | -|---------------------------------------------|------------------------------------|-------| +|------|------|-------| | [`(deduction_guide)`](stop_callback/op_deduction_guide.md) | クラステンプレートの推論補助 | C++20 | ## 適格要件 -テンプレート引数の`Callback`は[`invocable`](/reference/concepts/invokable.md.nolink)と[`destructible`](/reference/concepts/destructible.md)制約を満たさなければならい。 +テンプレート引数の`CallbackFn`は[`invocable`](/reference/concepts/invokable.md.nolink)と[`destructible`](/reference/concepts/destructible.md)制約を満たさなければならい。 ## 事前条件 -テンプレート引数の`Callback`は[`invocable`](/reference/concepts/invokable.md.nolink)と[`destructible`](/reference/concepts/destructible.md)制約を満たさなければならい。 +テンプレート引数の`CallbackFn`は[`invocable`](/reference/concepts/invokable.md.nolink)と[`destructible`](/reference/concepts/destructible.md)制約を満たさなければならい。 ## 例 ```cpp example diff --git a/reference/stop_token/stop_callback/op_constructor.md b/reference/stop_token/stop_callback/op_constructor.md index 6cda6aecf6..fb334ad162 100644 --- a/reference/stop_token/stop_callback/op_constructor.md +++ b/reference/stop_token/stop_callback/op_constructor.md @@ -8,10 +8,10 @@ ```cpp template explicit stop_callback(const stop_token& st, C&& cb) - noexcept(is_nothrow_constructible_v); // (1) + noexcept(is_nothrow_constructible_v); // (1) template explicit stop_callback(stop_token&& st, C&& cb) - noexcept(is_nothrow_constructible_v); // (2) + noexcept(is_nothrow_constructible_v); // (2) stop_callback(const stop_callback&) = delete; // (3) stop_callback(stop_callback&&) = delete; // (4) @@ -25,22 +25,22 @@ stop_callback(stop_callback&&) = delete; // (4) ## 適格要件 -クラステンプレートのテンプレート引数`Callback`とコンストラクタのテンプレート引数`C`は[`constructible_from`](/reference/concepts/constructible_from.md)``制約を満たさなければならない。 +クラステンプレートのテンプレート引数`CallbackFn`とコンストラクタのテンプレート引数`C`は[`constructible_from`](/reference/concepts/constructible_from.md)``制約を満たさなければならない。 ## 事前条件 -クラステンプレートのテンプレート引数`Callback`とコンストラクタのテンプレート引数`C`は[`constructible_from`](/reference/concepts/constructible_from.md)``制約を満たさなければならない。 +クラステンプレートのテンプレート引数`CallbackFn`とコンストラクタのテンプレート引数`C`は[`constructible_from`](/reference/concepts/constructible_from.md)``制約を満たさなければならない。 ## 効果 -コンストラクタの引数に渡した`cb`を`std::forward(cb)`で転送して、メンバ変数(仮に`callback`とする)を初期化する。 +コンストラクタの引数に渡した`cb`を`std::forward(cb)`で転送して、メンバ変数(仮に`callback`とする)を初期化する。 -もし`st.`[`stop_requested()`](../stop_token/stop_requested.md) `==` `true` の場合は、コンストラクタを呼び出したスレッドの中で`std::forward(callback)()`を評価し、コールバックを呼び出す。したがってこのコールバックの呼び出しはコンストラクタから処理が戻るより前に完了する。 +もし`st.`[`stop_requested()`](../stop_token/stop_requested.md) `==` `true` の場合は、コンストラクタを呼び出したスレッドの中で`std::forward(callback)()`を評価し、コールバックを呼び出す。したがってこのコールバックの呼び出しはコンストラクタから処理が戻るより前に完了する。 -そうでない場合は、`st`が所有している停止状態への所有権を取得して停止状態を共有し、その停止状態に対する最初の[`request_stop()`](../stop_source/request_stop.md)の呼び出しで`std::forward(callback)()`を評価するようなコールバックを登録する。 +そうでない場合は、`st`が所有している停止状態への所有権を取得して停止状態を共有し、その停止状態に対する最初の[`request_stop()`](../stop_source/request_stop.md)の呼び出しで`std::forward(callback)()`を評価するようなコールバックを登録する。 `st`が停止状態を所有していない場合は何もしない。 -もし`std::forward(callback)()`の呼び出しが例外によって終了した場合は、[`std::terminate()`](/reference/exception/terminate.md)関数が呼び出され、プログラムが異常終了する。 +もし`std::forward(callback)()`の呼び出しが例外によって終了した場合は、[`std::terminate()`](/reference/exception/terminate.md)関数が呼び出され、プログラムが異常終了する。 ## 例外 diff --git a/reference/stop_token/stop_callback/op_deduction_guide.md b/reference/stop_token/stop_callback/op_deduction_guide.md index 09d091fbc7..c06304e1e2 100644 --- a/reference/stop_token/stop_callback/op_deduction_guide.md +++ b/reference/stop_token/stop_callback/op_deduction_guide.md @@ -6,8 +6,8 @@ ```cpp namespace std { - template - stop_callback(stop_token, Callback) -> stop_callback; + template + stop_callback(stop_token, CallbackFn) -> stop_callback; } ``` diff --git a/reference/stop_token/stop_callback_for_t.md b/reference/stop_token/stop_callback_for_t.md new file mode 100644 index 0000000000..bc70045676 --- /dev/null +++ b/reference/stop_token/stop_callback_for_t.md @@ -0,0 +1,31 @@ +# stop_callback_for_t +* stop_token[meta header] +* std[meta namespace] +* type-alias[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + using stop_callback_for_t = T::template callback_type; +} +``` + +## 概要 + +型`T`に対応する`CallbackFn`型のコールバック型を取得する。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/stop_token/stop_token.md b/reference/stop_token/stop_token.md index d8998fbe8e..4062060849 100644 --- a/reference/stop_token/stop_token.md +++ b/reference/stop_token/stop_token.md @@ -13,7 +13,7 @@ namespace std { ## 概要 `stop_token`クラスは、停止要求が作成されたかどうか、あるいは停止要求が作成されうるかどうかなど、停止状態を問い合わせるためのインターフェースを提供する。 -[`stop_source`](stop_source.md)クラスの[`get_token()`](./stop_source/get_token.md)メンバ関数を呼び出すと、その`stop_source`クラスのオブジェクトと停止状態を共有する`stop_token`クラスのオブジェクトを構築できる。これによって、`stop_source`側から停止要求を作成したときに、この`stop_token`を通じて停止状態を問い合わせられるようになる。 +[`stop_source`](stop_source.md)クラスの[`get_token()`](stop_source/get_token.md)メンバ関数を呼び出すと、その`stop_source`クラスのオブジェクトと停止状態を共有する`stop_token`クラスのオブジェクトを構築できる。これによって、`stop_source`側から停止要求を作成したときに、この`stop_token`を通じて停止状態を問い合わせられるようになる。 また、`stop_token`クラスは以下のクラスでも利用される: @@ -26,7 +26,7 @@ namespace std { ## メンバ関数 | 名前 | 説明 | 対応バージョン | -|-------------------------------------------------|--------------------------------------------------------------------|-------| +|------|------|-------| | [`(constructor)`](stop_token/op_constructor.md) | コンストラクタ | C++20 | | [`(destructor)`](stop_token/op_destructor.md) | デストラクタ | C++20 | | [`operator=`](stop_token/op_assign.md) | 代入演算子 | C++20 | @@ -34,12 +34,19 @@ namespace std { | [`stop_requested`](stop_token/stop_requested.md)| 停止要求が作成されたかどうかを取得する | C++20 | | [`stop_possible`](stop_token/stop_possible.md) | 停止要求が作成されうるかどうかを取得する | C++20 | +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------|------|-------| +| [`callback_type`](stop_token/callback_type.md) | 対応するコールバック型 (alias template) | C++26 | + ## 非メンバ関数 + | 名前 | 説明 | 対応バージョン | -|------------------------------------------------|---------------------------------------|-------| -| [`operator==`](stop_token/op_equal.md) | 等値演算子 | C++20 | -| [`operator!=`](stop_token/op_not_equal.md) | 非等値演算子 | C++20 | -| [`swap`](stop_token/swap_free.md) | 2つの`stop_token`オブジェクトを入れ替える | C++20 | +|------|------|-------| +| [`operator==`](stop_token/op_equal.md) | 等値演算子 | C++20 | +| [`operator!=`](stop_token/op_not_equal.md) | 非等値演算子 | C++20 | +| [`swap`](stop_token/swap_free.md) | 2つの`stop_token`オブジェクトを入れ替える | C++20 | ## 例 diff --git a/reference/stop_token/stop_token/callback_type.md b/reference/stop_token/stop_token/callback_type.md new file mode 100644 index 0000000000..8c5f6a54c9 --- /dev/null +++ b/reference/stop_token/stop_token/callback_type.md @@ -0,0 +1,30 @@ +# callback_type +* stop_token[meta header] +* std[meta namespace] +* stop_token[meta class] +* type-alias[meta id-type] +* cpp26[meta cpp] + +```cpp +template +using callback_type = stop_callback; +``` +* stop_callback[link ../stop_callback.md] + +## 概要 +`stop_token`に対応するコールバック型。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [GCC](/implementation.md#gcc): ?? +- [Clang](/implementation.md#clang): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/stop_token/stoppable_token.md b/reference/stop_token/stoppable_token.md index 8f5615a837..271dedfa8e 100644 --- a/reference/stop_token/stoppable_token.md +++ b/reference/stop_token/stoppable_token.md @@ -68,9 +68,9 @@ concept stoppable-callback-for = ``` * invocable[link /reference/concepts/invocable.md] * constructible_from[link /reference/concepts/constructible_from.md] -* stop_callback_for_t[link stop_callback_for_t.md.nolink] +* stop_callback_for_t[link stop_callback_for_t.md] -説明用の`init`を[`same_as`](/reference/concepts/same_as.md)``を満たす式、型`SCB`を[`stop_callback_for_t`](stop_callback_for_t.md.nolink)``とする。 +説明用の`init`を[`same_as`](/reference/concepts/same_as.md)``を満たす式、型`SCB`を[`stop_callback_for_t`](stop_callback_for_t.md)``とする。 `stoppable-callback-for`のモデルとなるには、下記を満たすこと。 From 4f805fa67c4e0672645eb48faf5e1891013d2904 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 4 Apr 2025 19:13:17 +0900 Subject: [PATCH 1496/3948] stop_token: never_stop_token (#1384) --- reference/stop_token.md | 2 +- reference/stop_token/never_stop_token.md | 63 +++++++++++++++++++++++ reference/stop_token/stoppable_token.md | 2 +- reference/stop_token/unstoppable_token.md | 2 +- 4 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 reference/stop_token/never_stop_token.md diff --git a/reference/stop_token.md b/reference/stop_token.md index c93b4a0a80..6912ccdb88 100644 --- a/reference/stop_token.md +++ b/reference/stop_token.md @@ -20,7 +20,7 @@ | [`stop_source`](stop_token/stop_source.md) | 停止要求を発生させるクラス (class) | C++20 | | [`stop_callback`](stop_token/stop_callback.md)| 停止要求に応じて呼び出されるコールバック (class template) | C++20 | | [`nostopstate`](stop_token/nostopstate.md) | 停止状態を扱わない[`stop_source`](stop_token/stop_source.md)を構築するためのタグ (class) | C++20 | -| [`never_stop_token`](stop_token/never_stop_token.md.nolink) | 停止不可能な停止トークン (class) | C++26 | +| [`never_stop_token`](stop_token/never_stop_token.md) | 停止不可能な停止トークン (class) | C++26 | | [`inplace_stop_token`](stop_token/inplace_stop_token.md.nolink) | インプレース停止トークン (class) | C++26 | | [`inplace_stop_source`](stop_token/inplace_stop_source.md.nolink) | インプレース停止要求を発生させるクラス (class) | C++26 | | [`inplace_stop_callback`](stop_token/inplace_stop_callback.md.nolink) | インプレース停止要求に応じて呼び出されるコールバック (class template) | C++26 | diff --git a/reference/stop_token/never_stop_token.md b/reference/stop_token/never_stop_token.md new file mode 100644 index 0000000000..a78d5a66a3 --- /dev/null +++ b/reference/stop_token/never_stop_token.md @@ -0,0 +1,63 @@ +# never_stop_token +* stop_token[meta header] +* class[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std { + class never_stop_token; +} +``` + +## 概要 + +停止不可能な停止トークン。[`unstoppable_token`](unstoppable_token.md)コンセプトのモデル。 + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|-----------------|----------------|----------------| +| `(constructor)` | コンストラクタ | C++26 | +| `(destructor)` | デストラクタ | C++26 | +| `bool operator==(const never_stop_token&) const = default;` | 等値比較 | C++26 | +| `bool operator!=(const never_stop_token&) const;` | 非等値比較 (`==`により使用可能) | C++26 | + +## 静的メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|-----------------|----------------|----------------| +| `stop_requested` | `false`を返す | C++26 | +| `stop_possible` | `false`を返す | C++26 | + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|-----------------|----------------|----------------| +| `callback_type` | 説明専用の`callback-type`型 | C++26 | + +```cpp +struct callback-type { + explicit callback-type(never_stop_token, auto&&) noexcept {} +}; +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`unstoppable_token`](unstoppable_token.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/stop_token/stoppable_token.md b/reference/stop_token/stoppable_token.md index 271dedfa8e..1ff936a638 100644 --- a/reference/stop_token/stoppable_token.md +++ b/reference/stop_token/stoppable_token.md @@ -110,7 +110,7 @@ concept stoppable-callback-for = - [`unstoppable_token`](unstoppable_token.md) - [`stop_token`](stop_token.md) - [`inplace_stop_token`](inplace_stop_token.md.nolink) -- [`never_stop_token`](never_stop_token.md.nolink) +- [`never_stop_token`](never_stop_token.md) ## 参照 diff --git a/reference/stop_token/unstoppable_token.md b/reference/stop_token/unstoppable_token.md index 24a9165f0f..ff88b2fc71 100644 --- a/reference/stop_token/unstoppable_token.md +++ b/reference/stop_token/unstoppable_token.md @@ -35,7 +35,7 @@ namespace std { ## 関連項目 - [`stoppable_token`](stoppable_token.md) -- [`never_stop_token`](never_stop_token.md.nolink) +- [`never_stop_token`](never_stop_token.md) ## 参照 - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) From bf61d03da7ca726407bd9a24c7cd8d8f0799ac57 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 4 Apr 2025 22:20:44 +0900 Subject: [PATCH 1497/3948] new clang version for reference/algorithm/ranges_all_of --- reference/algorithm/ranges_all_of.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/algorithm/ranges_all_of.md b/reference/algorithm/ranges_all_of.md index 28dbf31ca9..d5e6dc2469 100644 --- a/reference/algorithm/ranges_all_of.md +++ b/reference/algorithm/ranges_all_of.md @@ -111,7 +111,7 @@ inline constexpr all_of_impl all_of; - C++20 ### 処理系 -- [Clang](/implementation.md#clang): ?? +- [Clang](/implementation.md#clang): 16.0.6 [mark verified] - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] From 5df1ae75c607ece5de0a12eb6ac66a6e45c59388 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 4 Apr 2025 22:32:42 +0900 Subject: [PATCH 1498/3948] created version column for reference/algorithm/adjacent_find.md --- reference/algorithm/adjacent_find.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/reference/algorithm/adjacent_find.md b/reference/algorithm/adjacent_find.md index bb764ae8fd..fe20630d87 100644 --- a/reference/algorithm/adjacent_find.md +++ b/reference/algorithm/adjacent_find.md @@ -147,6 +147,15 @@ ForwardIterator adjacent_find(ForwardIterator first, ForwardIterator last, Binar } ``` +## バージョン +### 言語 +- C++98 + +### 処理系 +- [Clang](/implementation.md#clang): 14.0.6 [mark verified] +- [GCC](/implementation.md#gcc): 9.5.0 [mark verified] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 - [P0202R3 Add Constexpr Modifiers to Functions in `` and `` Headers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0202r3.html) From 1c1a876c59100a851f95aaee62d21850628b6e19 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 4 Apr 2025 22:37:58 +0900 Subject: [PATCH 1499/3948] created version column for reference/algorithm/binary_search.md --- reference/algorithm/binary_search.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/reference/algorithm/binary_search.md b/reference/algorithm/binary_search.md index 2eeb4495d8..342f67c3df 100644 --- a/reference/algorithm/binary_search.md +++ b/reference/algorithm/binary_search.md @@ -100,6 +100,15 @@ bool binary_search(ForwardIterator first, ForwardIterator last, ``` * std::lower_bound[link lower_bound.md] +## バージョン +### 言語 +- C++98 + +### 処理系 +- [Clang](/implementation.md#clang): 14.0.6 [mark verified] +- [GCC](/implementation.md#gcc): 9.5.0 [mark verified] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 - [LWG Issue 787. complexity of `binary_search`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#787) From 112bd2998b93300b9466ad4e43d237a52d8e2901 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 4 Apr 2025 22:43:37 +0900 Subject: [PATCH 1500/3948] Created version column for reference/algorithm/copy_backward.md --- reference/algorithm/copy_backward.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/reference/algorithm/copy_backward.md b/reference/algorithm/copy_backward.md index e28d07b413..81610824bd 100644 --- a/reference/algorithm/copy_backward.md +++ b/reference/algorithm/copy_backward.md @@ -86,6 +86,15 @@ BidirectionalIterator2 copy_backward(BidirectionalIterator1 first, } ``` +## バージョン +### 言語 + +### 処理系 +- [Clang](/implementation.md#clang): 14.0.6 [mark verified] +- [GCC](/implementation.md#gcc): 9.5.0 [mark verified] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + ## 参照 - [P0202R3 Add Constexpr Modifiers to Functions in `` and `` Headers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0202r3.html) From ac45cea65e85e95dbaa2195e9bc4a555d48be1be Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 4 Apr 2025 22:52:45 +0900 Subject: [PATCH 1501/3948] Created version column for reference/algorithm/copy.md --- reference/algorithm/copy.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/reference/algorithm/copy.md b/reference/algorithm/copy.md index 8ba431a178..0a5b33447e 100644 --- a/reference/algorithm/copy.md +++ b/reference/algorithm/copy.md @@ -91,6 +91,15 @@ OutputIterator copy(InputIterator first, InputIterator last, OutputIterator resu } ``` +## バージョン +### 言語 +- C++98 + +### 処理系 +- [Clang](/implementation.md#clang): 14.0.6 [mark verified] +- [GCC](/implementation.md#gcc): 9.5.0 [mark verified] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 - [P0202R3 Add Constexpr Modifiers to Functions in `` and `` Headers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0202r3.html) From 0b980b4649a61958f5cc9156ed85f76e99efd0ba Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 4 Apr 2025 22:58:40 +0900 Subject: [PATCH 1502/3948] Created version column for reference/algorithm/count_if.md --- reference/algorithm/count_if.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/reference/algorithm/count_if.md b/reference/algorithm/count_if.md index a8bc4938a5..c17a48ee2b 100644 --- a/reference/algorithm/count_if.md +++ b/reference/algorithm/count_if.md @@ -73,6 +73,16 @@ typename iterator_traits::difference_type } ``` +## バージョン +### 言語 +- C++98 + +### 処理系 +- [Clang](/implementation.md#clang): 14.0.6 [mark verified] +- [GCC](/implementation.md#gcc): 9.5.0 [mark verified] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + ## 参照 - [P0202R3 Add Constexpr Modifiers to Functions in `` and `` Headers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0202r3.html) From 2402f98c65f4075b8216eca984ad0f1a9d5a22d9 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 4 Apr 2025 23:01:39 +0900 Subject: [PATCH 1503/3948] Created version column for reference/algorithm/count.md --- reference/algorithm/count.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/reference/algorithm/count.md b/reference/algorithm/count.md index afedd7ede9..d8ae4e993b 100644 --- a/reference/algorithm/count.md +++ b/reference/algorithm/count.md @@ -72,6 +72,15 @@ typename iterator_traits::difference_type } ``` +## バージョン +### 言語 +- C++98 + +### 処理系 +- [Clang](/implementation.md#clang): 14.0.6 [mark verified] +- [GCC](/implementation.md#gcc): 9.5.0 [mark verified] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 - [P0202R3 Add Constexpr Modifiers to Functions in `` and `` Headers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0202r3.html) From e897a1649efc952baf4e9f66508e25ea37cca81a Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sat, 5 Apr 2025 13:07:32 +0900 Subject: [PATCH 1504/3948] =?UTF-8?q?C++26=20=E3=80=8C=E6=96=87=E5=AD=97?= =?UTF-8?q?=E5=88=97=E3=83=AA=E3=83=86=E3=83=A9=E3=83=AB=E3=81=AE=E6=96=87?= =?UTF-8?q?=E5=AD=97=E3=82=A8=E3=83=B3=E3=82=B3=E3=83=BC=E3=83=87=E3=82=A3?= =?UTF-8?q?=E3=83=B3=E3=82=B0=E5=A4=B1=E6=95=97=E3=82=92=E4=B8=8D=E9=81=A9?= =?UTF-8?q?=E6=A0=BC=E3=81=A8=E3=81=99=E3=82=8B=E3=80=8D=20:=20=E4=BE=8B?= =?UTF-8?q?=E3=82=92=E8=A6=8B=E7=9B=B4=E3=81=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../making_non-encodable_string_literals_ill-formed.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lang/cpp26/making_non-encodable_string_literals_ill-formed.md b/lang/cpp26/making_non-encodable_string_literals_ill-formed.md index 10bf6463f1..629db80db0 100644 --- a/lang/cpp26/making_non-encodable_string_literals_ill-formed.md +++ b/lang/cpp26/making_non-encodable_string_literals_ill-formed.md @@ -20,13 +20,12 @@ wchar_t c = L'é'; // C++20:OK, C++23:NG \u0065\u0301 C++26ではさらに、文字列リテラルとしてエンコーディングできない文字の扱いが実装定義でコンパイラーに任されていたものを、不適格になるよう仕様変更する。 +また、マルチ文字リテラル (ひとつの文字リテラルに4文字まで入れられて値が実装定義なもの。例として`'intl'`) については、単一のコードユニットにエンコードされるもののみ許可される。 + ```cpp -wchar_t ao = L'\x123456789abcdef0'; // C++23:実装定義, C++26:NG (範囲外) -char16_t ap = u'\x12345678'; // C++23:実装定義, C++26:NG (範囲外) +char c = 'é'; // C++23:実装定義, C++26:NG グレイブアクセントをつけると複数のコードユニットになる ``` -また、マルチ文字リテラル (ひとつの文字リテラルに4文字まで入れられて値が実装定義なもの。例として`'intl'`) については、単一のコードユニットにエンコードされるもののみ許可される。 - ## 関連項目 - [C++23 1ワイド文字に収まらないワイド文字リテラルを禁止する](/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md) From ba2b7c94d13ed76e045f28c4a6c8d87373ba7923 Mon Sep 17 00:00:00 2001 From: I <1091761+wx257osn2@users.noreply.github.com> Date: Sat, 5 Apr 2025 17:55:42 +0900 Subject: [PATCH 1505/3948] fix statement position MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit p進大好きbot had pointed out: https://x.com/non_archimedean/status/1884124487693812037 The standard also described about assignment operator in Complexity field: https://timsong-cpp.github.io/cppwp/n4950/vector#modifiers-5 --- reference/vector/vector/erase.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/vector/vector/erase.md b/reference/vector/vector/erase.md index 30b9ce33d3..6d4fe195cd 100644 --- a/reference/vector/vector/erase.md +++ b/reference/vector/vector/erase.md @@ -32,11 +32,11 @@ constexpr iterator erase(const_iterator first, ## 戻り値 -削除された要素の次の要素を指すイテレータを返す。そのような要素が存在しない場合は、[`end()`](end.md)を返す。さらに、削除された要素以降の要素の数と同じ回数の`T`のムーブ代入演算子が呼ばれる。 +削除された要素の次の要素を指すイテレータを返す。そのような要素が存在しない場合は、[`end()`](end.md)を返す。 ## 計算量 -削除される要素の数と同じ回数の`T`のデストラクタが実行される。 +削除される要素の数と同じ回数の`T`のデストラクタが実行される。さらに、削除された要素以降の要素の数と同じ回数の`T`のムーブ代入演算子が呼ばれる。 ## 備考 From 3fb56b866798869aa88bf8b556f86df3d628ae5d Mon Sep 17 00:00:00 2001 From: Keita Nonaka Date: Sat, 5 Apr 2025 07:35:03 -0700 Subject: [PATCH 1506/3948] fix: remove unnecessary `std::move` in splice of `std::list` Signed-off-by: Keita Nonaka --- reference/list/list/splice.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/reference/list/list/splice.md b/reference/list/list/splice.md index a04fcd5073..1ef73e11bc 100644 --- a/reference/list/list/splice.md +++ b/reference/list/list/splice.md @@ -74,7 +74,6 @@ void splice(const_iterator position, list&& x, ```cpp example #include #include -#include // move template void print(const std::list& ls) @@ -90,7 +89,7 @@ int main() std::list xs = {4, 5, 6}; std::list ys = {1, 2, 3}; - xs.splice(xs.begin(), std::move(ys)); + xs.splice(xs.begin(), ys); print(xs); } @@ -99,7 +98,7 @@ int main() std::list xs = {4, 5, 6}; std::list ys = {1, 2, 3}; - xs.splice(xs.begin(), std::move(ys), ys.begin()); + xs.splice(xs.begin(), ys, ys.begin()); print(xs); } @@ -108,7 +107,7 @@ int main() std::list xs = {4, 5, 6}; std::list ys = {1, 2, 3}; - xs.splice(xs.begin(), std::move(ys), ys.begin(), std::next(ys.begin(), 2)); + xs.splice(xs.begin(), ys, ys.begin(), std::next(ys.begin(), 2)); print(xs); } @@ -117,7 +116,7 @@ int main() std::list xs = {1, 2, 3}; std::list ys = {4, 5, 6}; - xs.splice(xs.end(), std::move(ys)); + xs.splice(xs.end(), ys); print(xs); } @@ -125,7 +124,6 @@ int main() ``` * splice[color ff0000] * begin()[link begin.md] -* std::move[link /reference/utility/move.md] ### 出力 ``` From aa6976390f6b99836bccb8df2a5db12a510fe8b1 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sun, 6 Apr 2025 13:27:47 +0900 Subject: [PATCH 1507/3948] update istreambuf_iterator constructor --- .../istreambuf_iterator/op_constructor.md | 31 +++++++++++++------ 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/reference/iterator/istreambuf_iterator/op_constructor.md b/reference/iterator/istreambuf_iterator/op_constructor.md index 2bbdf5059a..9c481c9cff 100644 --- a/reference/iterator/istreambuf_iterator/op_constructor.md +++ b/reference/iterator/istreambuf_iterator/op_constructor.md @@ -5,18 +5,31 @@ * function[meta id-type] ```cpp -constexpr istreambuf_iterator() noexcept; -istreambuf_iterator(const istreambuf_iterator&) noexcept = default; -istreambuf_iterator(istream_type& s) noexcept; -istreambuf_iterator(streambuf_type* s) noexcept; -istreambuf_iterator(const proxy& p) noexcept; +istreambuf_iterator() throw(); // (1) C++03 +constexpr istreambuf_iterator() noexcept; // (1) C++11 + +constexpr istreambuf_iterator(default_sentinel_t) noexcept; // (2) C++11 + +istreambuf_iterator(const istreambuf_iterator&) noexcept = default; // (3) C++11 + +istreambuf_iterator(istream_type& s) throw(); // (4) C++03 +istreambuf_iterator(istream_type& s) noexcept; // (4) C++11 + +istreambuf_iterator(streambuf_type* s) throw(); // (5) C++03 +istreambuf_iterator(streambuf_type* s) noexcept; // (5) C++11 + +istreambuf_iterator(const proxy& p) throw(); // (6) C++03 +istreambuf_iterator(const proxy& p) noexcept; // (6) C++11 ``` +* default_sentinel_t[link /reference/iterator/default_sentinel_t.md] ## istreambuf_iteratorオブジェクトの構築 -- `istreambuf_iterator()`
デフォルトコンストラクタメンバ変数として保持する`streambuf`オブジェクトへのポインタをヌル初期化する。 -- `istreambuf_iterator(istreamtype& s) noexcept`
`s.rdbuf()`をメンバ変数として保持する。 -- `istreambuf_iterator(streambuf_type* s) noexcept`
`s`をメンバ変数として保持する -- `istreambuf_iterator(const proxy& p) noexcept`
後置`operator++()`が返すであろうproxyオブジェクトを受け取り、そのオブジェクトが指す`streambuf`オブジェクトへのポインタをメンバ変数として保持する。 +- (1) : デフォルトコンストラクタ。メンバ変数として保持する`streambuf`オブジェクトへのポインタをヌル初期化する。 +- (2) : [`default_sentinel`](/reference/iterator/default_sentinel_t.md)を受け取り、(1)と同等の構築をより明示的に行う。 +- (3) : コピーコンストラクタ。 +- (4) : `s.rdbuf()`をメンバ変数として保持する。 +- (5) : `s`をメンバ変数として保持する。 +- (6) : 後置`operator++()`が返すであろうproxyオブジェクトを受け取り、そのオブジェクトが指す`streambuf`オブジェクトへのポインタをメンバ変数として保持する。 ## 例 From 7c7167bda624129a8db51d8c8bc458684031262b Mon Sep 17 00:00:00 2001 From: yoh Date: Sun, 6 Apr 2025 22:18:59 +0900 Subject: [PATCH 1508/3948] stop_token: inplace_stop_source (#1384) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - stoppable-source 説明専用concept - stop_token 概要をP2300R10に追従 --- reference/stop_token.md | 17 ++-- reference/stop_token/inplace_stop_source.md | 88 +++++++++++++++++++++ reference/stop_token/stop_source.md | 30 ++++--- reference/stop_token/stoppable-source.md | 62 +++++++++++++++ reference/stop_token/stoppable_token.md | 5 +- 5 files changed, 180 insertions(+), 22 deletions(-) create mode 100644 reference/stop_token/inplace_stop_source.md create mode 100644 reference/stop_token/stoppable-source.md diff --git a/reference/stop_token.md b/reference/stop_token.md index 6912ccdb88..0e1181ab6b 100644 --- a/reference/stop_token.md +++ b/reference/stop_token.md @@ -5,7 +5,8 @@ ``ヘッダは、マルチスレッド処理や非同期処理おける停止要求の状態 `停止状態` を扱うクラスを定義する。 - [`stop_token`](stop_token/stop_token.md), [`stop_source`](stop_token/stop_source.md), [`stop_callback`](stop_token/stop_callback.md)は停止状態を共有所有する。最後に破棄されたオブジェクトが停止状態を自動的に解放する。 -- [`inplace_stop_source`](stop_token/inplace_stop_source.md.nolink)は停止状態をメンバとして直接所有する。[`inplace_stop_token`](stop_token/inplace_stop_token.md.nolink)と[`inplace_stop_callback`](stop_token/inplace_stop_callback.md.nolink)は停止状態の所有には関与しない。 +- [`inplace_stop_source`](stop_token/inplace_stop_source.md)は停止状態をメンバとして直接所有する。[`inplace_stop_token`](stop_token/inplace_stop_token.md.nolink)と[`inplace_stop_callback`](stop_token/inplace_stop_callback.md.nolink)は停止状態の所有には関与しない。 + ## コンセプト | 名前 | 説明 | 対応バージョン | @@ -16,14 +17,14 @@ ## 停止トークン | 名前 | 説明 | 対応バージョン | |------|------|-------| -| [`stop_token`](stop_token/stop_token.md) | 停止トークン (class) | C++20 | -| [`stop_source`](stop_token/stop_source.md) | 停止要求を発生させるクラス (class) | C++20 | -| [`stop_callback`](stop_token/stop_callback.md)| 停止要求に応じて呼び出されるコールバック (class template) | C++20 | -| [`nostopstate`](stop_token/nostopstate.md) | 停止状態を扱わない[`stop_source`](stop_token/stop_source.md)を構築するためのタグ (class) | C++20 | +| [`stop_token`](stop_token/stop_token.md) | [`stop_source`](stop_token/stop_source.md)の停止トークン (class) | C++20 | +| [`stop_source`](stop_token/stop_source.md) | 停止状態を共有所有する停止要求インタフェース (class) | C++20 | +| [`stop_callback`](stop_token/stop_callback.md)| [`stop_source`](stop_token/stop_source.md)停止要求に応じて呼び出されるコールバック (class template) | C++20 | +| [`nostopstate`](stop_token/nostopstate.md) | 停止状態を扱わない[`stop_source`](stop_token/stop_source.md)構築用タグ (class) | C++20 | | [`never_stop_token`](stop_token/never_stop_token.md) | 停止不可能な停止トークン (class) | C++26 | -| [`inplace_stop_token`](stop_token/inplace_stop_token.md.nolink) | インプレース停止トークン (class) | C++26 | -| [`inplace_stop_source`](stop_token/inplace_stop_source.md.nolink) | インプレース停止要求を発生させるクラス (class) | C++26 | -| [`inplace_stop_callback`](stop_token/inplace_stop_callback.md.nolink) | インプレース停止要求に応じて呼び出されるコールバック (class template) | C++26 | +| [`inplace_stop_token`](stop_token/inplace_stop_token.md.nolink) | [`inplace_stop_source`](stop_token/inplace_stop_source.md)の停止トークン (class) | C++26 | +| [`inplace_stop_source`](stop_token/inplace_stop_source.md) | 停止状態を直接所有する停止要求インタフェース (class) | C++26 | +| [`inplace_stop_callback`](stop_token/inplace_stop_callback.md.nolink) | [`inplace_stop_source`](stop_token/inplace_stop_source.md)停止要求に応じて呼び出されるコールバック (class template) | C++26 | | [`stop_callback_for_t`](stop_token/stop_callback_for_t.md) | 対応するコールバック型を取得 (alias template) | C++26 | diff --git a/reference/stop_token/inplace_stop_source.md b/reference/stop_token/inplace_stop_source.md new file mode 100644 index 0000000000..c42b383176 --- /dev/null +++ b/reference/stop_token/inplace_stop_source.md @@ -0,0 +1,88 @@ +# inplace_stop_source +* stop_token[meta header] +* class[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std { + class inplace_stop_source; +} +``` + +## 概要 +クラス`inplace_stop_source`は、停止状態をメンバとして直接所有し、停止要求を作成するためのインターフェースを提供する。 + +`inplace_stop_source`は[`stoppable-source`](stoppable-source.md)のモデルである。 + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|-------| +| [`(constructor)`](inplace_stop_source/op_constructor.md.nolink) | コンストラクタ | C++26 | +| `(destructor)` | デストラクタ | C++26 | +| `operator=` | 代入演算子 | C++26 | +| [`get_token`](inplace_stop_source/get_token.md.nolink) | 自身の停止状態を参照する[`inplace_stop_token`](inplace_stop_token.md.nolink)を返す | C++26 | +| [`stop_requested`](inplace_stop_source/stop_requested.md.nolink) | 停止要求を作成したかどうかを取得する | C++26 | +| [`request_stop`](inplace_stop_source/request_stop.md.nolink) | 停止要求を作成する | C++26 | + +## 静的メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|-------| +| [`stop_possible`](inplace_stop_source/stop_possible.md.nolink) | 停止要求を作成可能どうかを取得する | C++26 | + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::inplace_stop_source ss; + std::inplace_stop_token st = ss.get_token(); + + bool invoked = false; + std::inplace_stop_callback cb {st, [&] { invoked = true; }}; + + assert(st.stop_requested() == false); + assert(invoked == false); + + ss.request_stop(); + + assert(st.stop_requested() == true); + assert(invoked == true); +} +``` +* std::inplace_stop_source[color ff0000] +* std::inplace_stop_token[link inplace_stop_token.md.nolink] +* std::inplace_stop_callback[link inplace_stop_callback.md.nolink] +* stop_requested()[link inplace_stop_token/stop_requested.md.nolink] +* request_stop()[link inplace_stop_source/request_stop.md.nolink] +* get_token()[link inplace_stop_source/get_token.md.nolink] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`inplace_stop_token`](inplace_stop_token.md.nolink) +- [`inplace_stop_callback`](inplace_stop_callback.md.nolink) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/stop_token/stop_source.md b/reference/stop_token/stop_source.md index d9cedc0641..d460639a52 100644 --- a/reference/stop_token/stop_source.md +++ b/reference/stop_token/stop_source.md @@ -11,33 +11,30 @@ namespace std { ``` ## 概要 -クラス`stop_source`は、停止要求を作成するためのインターフェースを提供する。 -また、自身と停止状態を共有する[`stop_token`](stop_token.md)クラスのオブジェクトを構築できる。 +クラス`stop_source`は、停止状態を[`stop_token`](stop_token.md)と共有所有し、停止要求を作成するためのインターフェースを提供する。 -## 備考 -ある`stop_source`に対して作成した停止要求は、同じ停止状態を共有するほかの`stop_source`や`stop_token`から可視になる。 +`stop_source`は[`stoppable-source`](stoppable-source.md)、[`copyable`](/reference/concepts/copyable.md)、[`equality_comparable`](/reference/concepts/equality_comparable.md)、[`swappable`](/reference/concepts/swappable.md)のモデルである。 -一度停止要求を作成すると、それをあとで取り下げることはできない。また、それ以降に作成した停止要求は効果を持たない。 ## メンバ関数 | 名前 | 説明 | 対応バージョン | -|-------------------------------------------------|--------------------------------------------------------------------|-------| +|------|------|-------| | [`(constructor)`](stop_source/op_constructor.md) | コンストラクタ | C++20 | | [`(destructor)`](stop_source/op_destructor.md) | デストラクタ | C++20 | | [`operator=`](stop_source/op_assign.md) | 代入演算子 | C++20 | | [`swap`](stop_source/swap.md) | 別の`stop_source`と交換する | C++20 | -| [`get_token`](stop_source/get_token.md) | 自身と停止状態を共有する[`stop_token`](stop_token.md)を構築して返す | C++20 | +| [`get_token`](stop_source/get_token.md) | 自身と停止状態を共有する[`stop_token`](stop_token.md)を返す | C++20 | | [`stop_possible`](stop_source/stop_possible.md) | 停止要求を作成可能どうかを取得する | C++20 | | [`stop_requested`](stop_source/stop_requested.md)| 停止要求を作成したかどうかを取得する | C++20 | | [`request_stop`](stop_source/request_stop.md) | 停止要求を作成する | C++20 | ## 非メンバ関数 | 名前 | 説明 | 対応バージョン | -|---------------------------------|---------------------------------------|-------| -| [`operator==`](stop_source/op_equal.md) | 等値演算子 | C++20 | -| [`operator!=`](stop_source/op_not_equal.md) | 非等値演算子 | C++20 | -| [`swap`](stop_source/swap_free.md) | 2つの`stop_source`オブジェクトを入れ替える | C++11 | +|------|------|-------| +| [`operator==`](stop_source/op_equal.md) | 等値演算子 | C++20 | +| [`operator!=`](stop_source/op_not_equal.md) | 非等値演算子 | C++20 | +| [`swap`](stop_source/swap_free.md) | 2つの`stop_source`オブジェクトを入れ替える | C++20 | ## 例 @@ -73,14 +70,23 @@ int main() ``` ``` + ## バージョン ### 言語 - C++20 - ### 処理系 - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + +## 関連項目 +- [`stop_token`](stop_token.md) +- [`stop_callback`](stop_callback.md) + + +## 参照 +- [P0660R10 Stop token and joining thread](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0660r10.pdf) +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/stop_token/stoppable-source.md b/reference/stop_token/stoppable-source.md new file mode 100644 index 0000000000..be53731f04 --- /dev/null +++ b/reference/stop_token/stoppable-source.md @@ -0,0 +1,62 @@ +# stoppable-source +* stop_token[meta header] +* concept[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +mplate +concept stoppable-source = + requires (Source& src, const Source csrc) { + { csrc.get_token() } -> stoppable_token; + { csrc.stop_possible() } noexcept -> same_as; + { csrc.stop_requested() } noexcept -> same_as; + { src.request_stop() } -> same_as; + }; +``` +* stoppable_token[link stoppable_token.md] + +## 概要 +`stoppable-source`は、型`Source`が次のインタフェースを持つことを表す説明専用のコンセプトである。 + +- [停止トークン](stoppable_token.md)を取得する(`get_token`) +- 停止可能か否かを問い合わせる(`stop_possible`) +- 停止要求が行われたか否かを問い合わせる(`stop_requested`) +- 停止要求を行う(`request_stop`) + +`stoppable-source`のモデルとなる型は、最初に停止要求が行われた時に呼び出される停止コールバックの登録リストを管理する。 + + +## モデル +`stoppable-source`のモデルである型のオブジェクトは次を満たすこと。 + +- 最大で1つの関連付けられた停止状態を持つ。 +- オブジェクト`s`が停止状態を持たない(disengaged)とき、`s.stop_possible()`と`s.stop_requested()`は`false`となる。 +- オブジェクト`t`が停止状態を持たないとき、`t.get_token()`は停止状態を持たない[停止トークン](stoppable_token.md)を返す。そうでなければ、`t`の停止状態に関連付けられた停止トークンを返す。 +- `request_stop`, `stop_requested`, `stop_possible`メンバ関数の呼び出しはデータ競合を引き起こさない。 +- `true`を返す`request_stop`呼び出しは、`stopppable_token`または`stoppable-source`オブジェクトにおける`true`を返す`stop_requested`呼び出しに対して同期する。 +- コールバックの登録は、そのコールバック呼び出しに対して同期する。 +- `stoppable-source`が停止状態を持たないとき、`request_stop`は効果をもたず`false`を返す。そうでなければ、関連づけられた停止状態に対して停止要求操作を実行する。 +- 停止要求操作は停止状態が停止要求を受信済みか否かを判定し、未受信であれば停止要求を行う。この判定はアトミックに行われる。 +- 停止要求が行われたとき、停止状態に登録されているコールバックが同期的に実行される。コールバック呼び出しが例外で終了した場合、[`terminate`](/reference/exception/terminate.md)が呼び出される。 +- 停止要求が行われたとき`request_stop`は`true`を返す。そうでなければ`false`を返す。 +- `request_stop`呼び出し後は、`stop_possible`が`false`を返すか、`stop_requested`が`true`を返す。 + + +## 備考 +- 停止状態に登録されたコールバック呼び出しの実行順序に制約は課されない。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/stop_token/stoppable_token.md b/reference/stop_token/stoppable_token.md index 1ff936a638..60ff81652d 100644 --- a/reference/stop_token/stoppable_token.md +++ b/reference/stop_token/stoppable_token.md @@ -46,14 +46,15 @@ concept stoppable_token = ## モデル -説明用の変数`t`, `u`を、同一の停止状態を参照する別々な`Token`型ブジェクトとする。 +説明用の変数`t`, `u`を、同一の停止状態を参照する別々な`Token`型オブジェクトとする。 型`Token`が以下を満たす場合に限って、型`Token`は`stoppable_token`のモデルである。 - `SP`を`t.stop_possible()`が`false`となる評価としたとき、`SP`より後に発生する`u.stop_possible()`や`u.stop_requested()`の評価は`false`であること。 - `SR`を`t.stop_requested()`が`true`となる評価としたとき、`SR`より後に発生する`u.stop_possible()`や`u.stop_requested()`の評価は`true`であること。 - `stoppable-callback-for`を満たす任意の型`CallbackFn`および型`Initialize`が、`stoppable-callback-for`のモデルであること。 - `t`が停止状態を持たない(disengaged)とき、`t.stop_possible()`や`t.stop_requested()`の評価が`false`であること。 -- `t`と`u`が同一の停止状態を参照するか共に停止状態を持たない(disengaged)とき`t == u`が`true`であり、それ以外のときは`false`であること。 +- `t`と`u`が同一の停止状態を参照するか共に停止状態を持たないとき`t == u`が`true`であり、それ以外のときは`false`であること。 +- `request_stop`, `stop_requested`, `stop_possible`メンバ関数の呼び出しはデータ競合を引き起こさない。 ここで、説明専用コンセプト`stoppable-callback-for`を以下のように定義する。 From 349b492e5f813169c770fb3d2dd27a89fa8bad4a Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 7 Apr 2025 13:55:31 +0900 Subject: [PATCH 1509/3948] =?UTF-8?q?C++26:=20=E3=80=8C=E7=A9=BA=E3=81=AE?= =?UTF-8?q?=E7=84=A1=E9=99=90=E3=83=AB=E3=83=BC=E3=83=97=E3=81=AF=E6=9C=AA?= =?UTF-8?q?=E5=AE=9A=E7=BE=A9=E5=8B=95=E4=BD=9C=E3=81=A7=E3=81=AF=E3=81=AA?= =?UTF-8?q?=E3=81=84=E3=81=A8=E8=A6=8F=E5=AE=9A=E3=80=8D=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=20(close=20#1326)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp26.md | 2 +- ...finite_loops_are_not_undefined_behavior.md | 47 +++++++++++++++++++ 3 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 lang/cpp26/trivial_infinite_loops_are_not_undefined_behavior.md diff --git a/implementation-status.md b/implementation-status.md index db8dbd6814..88df9fdbc4 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -305,7 +305,7 @@ | P3106R1: [要素数不明の配列を集成体初期化する規則を明確化](/lang/cpp26/clarifying_rules_for_brace_elision_in_aggregate_initialization.md.nolink) | 配列要素の集成体初期化で`{}`が省略された場合の矛盾していた規定を修正 | yes | 17 | | | | P0609R3: [構造化束縛への属性を許可](/lang/cpp26/attributes_for_structured_bindings.md) | `auto [a, b [[maybe_unused]], c] = f();`のように構造化束縛の要素に対して属性を付加できるようにする | 15 | 19 | | | | P3034R1: [モジュール宣言でのモジュール名のマクロ展開を禁止する](/lang/cpp26/module_declarations_shouldnt_be_macros.md.nolink) | `export module MACRO_NAME;`を禁止 | | | | | -| P2809R3: [自明な無限ループは未定義動作ではないと規定](/lang/cpp26/trivial_infinite_loops_are_not_undefined_behavior.md.nolink) | 並行プログラムの進行保証などを考慮して無限ループを未定義動作ではないものとする | 14 | 19 | | | +| P2809R3: [空の無限ループは未定義動作ではないと規定](/lang/cpp26/trivial_infinite_loops_are_not_undefined_behavior.md) | 並行プログラムの進行保証などを考慮して空の無限ループを未定義動作ではないものとする | 14 | 19 | | | | P2795R5: [未初期化変数の読み取りをエラー性動作とする](/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md) | 初期化されていない自動変数の読み取りの安全性を規定する | | | | | | P2573R2: [関数宣言を削除する理由を指定できるようにする](/lang/cpp26/delete_reason.md) | `f() = delete("reason");` | 15 | 19 | | | | P2893R3: [可変引数テンプレートで`friend`宣言をできるようにする](/lang/cpp26/variadic_friends.md.nolink) | クラステンプレートの可変引数テンプレートでまとめて`friend`宣言できるようにする | 15 | | | | diff --git a/lang/cpp26.md b/lang/cpp26.md index 1544b4ec2d..0a74262b25 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -34,7 +34,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| | [条件式での構造化束縛の使用を許可](/lang/cpp26/structured_binding_declaration_as_a_condition.md) | 式全体を`bool`値に変換できる場合に条件式で構造化束縛を使用できることとする | -| [自明な無限ループは未定義動作ではないと規定](/lang/cpp26/trivial_infinite_loops_are_not_undefined_behavior.md.nolink) | 並行プログラムの進行保証などを考慮して無限ループを未定義動作ではないものとする | +| [空の無限ループは未定義動作ではないと規定](/lang/cpp26/trivial_infinite_loops_are_not_undefined_behavior.md) | 並行プログラムの進行保証などを考慮して空の無限ループを未定義動作ではないものとする | ### 関数 diff --git a/lang/cpp26/trivial_infinite_loops_are_not_undefined_behavior.md b/lang/cpp26/trivial_infinite_loops_are_not_undefined_behavior.md new file mode 100644 index 0000000000..9475edbc85 --- /dev/null +++ b/lang/cpp26/trivial_infinite_loops_are_not_undefined_behavior.md @@ -0,0 +1,47 @@ +# 空の無限ループは未定義動作ではないと規定 [P2809R3] +* cpp26[meta cpp] + + + +このページはC++26に採用される見込みの言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + + + +## 概要 +C++23までは、以下のような「条件式が定数式で`true`となる空の無限ループ」が未定義動作と規定されていた。 + +```cpp +while (true) + ; +``` + +C++26ではこのような無限ループは以下のように展開され、並行プログラムの進行保証をした上で未定義動作ではないと規定される。 + +```cpp +while (true) + std::this_thread::yield(); +``` +* std::this_thread[link /reference/thread/this_thread.md] +* yield()[link /reference/thread/this_thread/yield.md] + + +## 仕様 +以下の形式になっている文を、「トリビアルで空のイテレーション文」であると定義する。 + +- `while (条件式) ;` +- `while (条件式) { }` +- `do ; while (条件式) ;` +- `do { } while (条件式) ;` +- `for ( 初期化式 ; 条件式(省略可) ; ) ;` +- `for ( 初期化式 ; 条件式(省略可) ; ) { }` + +また、「トリビアルで空のイテレーション文」のうち、条件式が定数式として`true`に展開される文を「トリビアルな無限ループ」であると定義する。トリビアルな無限ループ内の文は、[`std::this_thread`](/reference/thread/this_thread.md)`::`[`yield()`](/reference/thread/this_thread/yield.md)の呼び出しに置き換えられる。 + +注:フリースタンディング環境においては、並行進行保証はされない。そのようなシステムにおいては明示的な協調操作が必要となる。 + + +## 参照 +- [P2809R3 Trivial infinite loops are not Undefined Behavior](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2809r3.html) + From 3d75bda2d92744484cac4f11cf332696b80f978b Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 7 Apr 2025 15:40:56 +0900 Subject: [PATCH 1510/3948] =?UTF-8?q?stop=5Ftoken:=20inplace=5Fstop=5Fsour?= =?UTF-8?q?ce=E5=85=A8=E3=83=A1=E3=83=B3=E3=83=90=20(#1384)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - stoppable-source 停止要求操作(stop request operation)を明確化 - stop_source/request_stop 効果をP2300R10に追従 --- reference/stop_token/inplace_stop_source.md | 14 +++---- .../inplace_stop_source/get_token.md | 37 +++++++++++++++++ .../inplace_stop_source/op_constructor.md | 40 +++++++++++++++++++ .../inplace_stop_source/request_stop.md | 36 +++++++++++++++++ .../inplace_stop_source/stop_possible.md | 36 +++++++++++++++++ .../inplace_stop_source/stop_requested.md | 36 +++++++++++++++++ .../stop_token/stop_source/request_stop.md | 25 +++++++----- reference/stop_token/stoppable-source.md | 6 +-- 8 files changed, 211 insertions(+), 19 deletions(-) create mode 100644 reference/stop_token/inplace_stop_source/get_token.md create mode 100644 reference/stop_token/inplace_stop_source/op_constructor.md create mode 100644 reference/stop_token/inplace_stop_source/request_stop.md create mode 100644 reference/stop_token/inplace_stop_source/stop_possible.md create mode 100644 reference/stop_token/inplace_stop_source/stop_requested.md diff --git a/reference/stop_token/inplace_stop_source.md b/reference/stop_token/inplace_stop_source.md index c42b383176..a993459a5e 100644 --- a/reference/stop_token/inplace_stop_source.md +++ b/reference/stop_token/inplace_stop_source.md @@ -20,18 +20,18 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|-------| -| [`(constructor)`](inplace_stop_source/op_constructor.md.nolink) | コンストラクタ | C++26 | +| [`(constructor)`](inplace_stop_source/op_constructor.md) | コンストラクタ | C++26 | | `(destructor)` | デストラクタ | C++26 | | `operator=` | 代入演算子 | C++26 | -| [`get_token`](inplace_stop_source/get_token.md.nolink) | 自身の停止状態を参照する[`inplace_stop_token`](inplace_stop_token.md.nolink)を返す | C++26 | -| [`stop_requested`](inplace_stop_source/stop_requested.md.nolink) | 停止要求を作成したかどうかを取得する | C++26 | -| [`request_stop`](inplace_stop_source/request_stop.md.nolink) | 停止要求を作成する | C++26 | +| [`get_token`](inplace_stop_source/get_token.md) | 自身の停止状態を参照する[`inplace_stop_token`](inplace_stop_token.md.nolink)を返す | C++26 | +| [`stop_requested`](inplace_stop_source/stop_requested.md) | 停止要求を作成したかどうかを取得する | C++26 | +| [`request_stop`](inplace_stop_source/request_stop.md) | 停止要求を作成する | C++26 | ## 静的メンバ関数 | 名前 | 説明 | 対応バージョン | |------|------|-------| -| [`stop_possible`](inplace_stop_source/stop_possible.md.nolink) | 停止要求を作成可能どうかを取得する | C++26 | +| [`stop_possible`](inplace_stop_source/stop_possible.md) | 停止要求を作成可能どうかを取得する | C++26 | ## 例 @@ -60,8 +60,8 @@ int main() * std::inplace_stop_token[link inplace_stop_token.md.nolink] * std::inplace_stop_callback[link inplace_stop_callback.md.nolink] * stop_requested()[link inplace_stop_token/stop_requested.md.nolink] -* request_stop()[link inplace_stop_source/request_stop.md.nolink] -* get_token()[link inplace_stop_source/get_token.md.nolink] +* request_stop()[link inplace_stop_source/request_stop.md] +* get_token()[link inplace_stop_source/get_token.md] ### 出力 ``` diff --git a/reference/stop_token/inplace_stop_source/get_token.md b/reference/stop_token/inplace_stop_source/get_token.md new file mode 100644 index 0000000000..d896ab5f42 --- /dev/null +++ b/reference/stop_token/inplace_stop_source/get_token.md @@ -0,0 +1,37 @@ +# get_token +* stop_token[meta header] +* function[meta id-type] +* std[meta namespace] +* inplace_stop_source[meta class] +* cpp26[meta cpp] + +```cpp +constexpr inplace_stop_token get_token() const noexcept; +``` +* inplace_stop_token[link ../inplace_stop_token.md.nolink] + +## 概要 +自身と停止状態を共有する[`inplace_stop_token`](../inplace_stop_token.md.nolink)を返す。 + + +## 戻り値 +自身が所有する停止状態に関連付けられた[`inplace_stop_token`](../inplace_stop_token.md.nolink)を返す。 + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/stop_token/inplace_stop_source/op_constructor.md b/reference/stop_token/inplace_stop_source/op_constructor.md new file mode 100644 index 0000000000..c6fea7c788 --- /dev/null +++ b/reference/stop_token/inplace_stop_source/op_constructor.md @@ -0,0 +1,40 @@ +# コンストラクタ +* stop_token[meta header] +* function[meta id-type] +* std[meta namespace] +* inplace_stop_source[meta class] +* cpp26[meta cpp] + +```cpp +constexpr inplace_stop_source() noexcept; +``` + +## 概要 +デフォルトコンストラクタ。停止状態を表すリソースを新たに確保して所有する。 + + +## 効果 +`*this`内部に新しい停止状態を初期化する。 + + +## 事後条件 +[`stop_requested()`](stop_requested.md) `== false` + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/stop_token/inplace_stop_source/request_stop.md b/reference/stop_token/inplace_stop_source/request_stop.md new file mode 100644 index 0000000000..5082824699 --- /dev/null +++ b/reference/stop_token/inplace_stop_source/request_stop.md @@ -0,0 +1,36 @@ +# request_stop +* stop_token[meta header] +* function[meta id-type] +* std[meta namespace] +* inplace_stop_source[meta class] +* cpp26[meta cpp] + +```cpp +bool request_stop() noexcept; +``` + +## 概要 +自身が所有している停止状態に対して停止要求を作成する。 + + +## 効果 +[停止要求操作](../stoppable-source.md)を実行する。 + + +## 事後条件 +[`stop_requested()`](stop_requested.md) `== true` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/stop_token/inplace_stop_source/stop_possible.md b/reference/stop_token/inplace_stop_source/stop_possible.md new file mode 100644 index 0000000000..32272e22c1 --- /dev/null +++ b/reference/stop_token/inplace_stop_source/stop_possible.md @@ -0,0 +1,36 @@ +# stop_possible +* stop_token[meta header] +* function[meta id-type] +* std[meta namespace] +* inplace_stop_source[meta class] +* cpp26[meta cpp] + +```cpp +static constexpr bool stop_possible() noexcept; +``` + +## 概要 +停止要求を作成できるかどうかを返す。 + + +## 戻り値 +`true` + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/stop_token/inplace_stop_source/stop_requested.md b/reference/stop_token/inplace_stop_source/stop_requested.md new file mode 100644 index 0000000000..0a4fdaacc4 --- /dev/null +++ b/reference/stop_token/inplace_stop_source/stop_requested.md @@ -0,0 +1,36 @@ +# stop_requested +* stop_token[meta header] +* function[meta id-type] +* std[meta namespace] +* inplace_stop_source[meta class] +* cpp26[meta cpp] + +```cpp +bool stop_requested() const noexcept; +``` + +## 概要 +停止要求が作成されたかどうかを返す。 + + +## 戻り値 +自身が所有する停止状態が停止要求を受け取っている場合は`true`を返す。それ以外の場合は`false`を返す。 + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/stop_token/stop_source/request_stop.md b/reference/stop_token/stop_source/request_stop.md index 831701b671..676f723a75 100644 --- a/reference/stop_token/stop_source/request_stop.md +++ b/reference/stop_token/stop_source/request_stop.md @@ -13,15 +13,8 @@ bool request_stop() noexcept; 自身が所有している停止状態に対して停止要求を作成する。 ## 効果 -自身が停止状態を所有していない場合は何もせず`false`を返す。 - -それ以外の場合は、自身の所有している停止状態が停止要求を受け取っているかどうかをアトミックに判定し、まだ停止要求を受け取っていない場合は停止要求を作成する。 -この判定処理と停止要求の作成処理は、`read-modify-write`操作によってアトミックに行われる。 -停止要求を受け取っていると判定した場合は何もせず`false`を返す。 - -停止要求が作成されたときは、この停止状態に対して登録されている[`stop_callback`](../stop_callback.md)のコールバックが同期的に呼び出される。このコールバックの呼び出しが例外によって終了した場合は、[`std::terminate()`](/reference/exception/terminate.md)関数が呼び出され、プログラムが異常終了する。 - -もし停止要求が作成されたときに、割り込み可能な待機関数([`wait()`](/reference/condition_variable/condition_variable_any/wait.md)/[`wait_for()`](/reference/condition_variable/condition_variable_any/wait_for.md)/[`wait_until()`](/reference/condition_variable/condition_variable_any/wait_until.md))で待機中の[`condition_variable_any`](/reference/condition_variable/condition_variable_any.md)が存在している場合は、そのような`condition_variable_any`全てに対して起床通知が送られ、待機関数から処理が戻る。 +停止状態を所有している場合は、[停止要求操作](../stoppable-source.md)を実行する(備考欄を参照)。 +そうでなければ、何もせず`false`を返す。 ## 戻り値 この関数の呼び出しによって停止要求が作成された場合は`true`を返す。 @@ -31,6 +24,16 @@ bool request_stop() noexcept; ## 例外 投げない。 +## 備考 +停止要求操作では、停止状態が停止要求を受け取っているかどうかをアトミックに判定し、まだ停止要求を受け取っていない場合は停止要求を作成する。 +この判定処理と停止要求の作成処理は、`read-modify-write`操作と同様にアトミックに行われる。 +停止要求を受け取っていると判定した場合は何もせず`false`を返す。 + +停止要求が作成されたときは、この停止状態に対して登録されている[`stop_callback`](../stop_callback.md)のコールバックが同期的に呼び出される。このコールバックの呼び出しが例外によって終了した場合は、[`std::terminate()`](/reference/exception/terminate.md)関数が呼び出され、プログラムが異常終了する。 + +もし停止要求が作成されたときに、割り込み可能な待機関数([`wait()`](/reference/condition_variable/condition_variable_any/wait.md)/[`wait_for()`](/reference/condition_variable/condition_variable_any/wait_for.md)/[`wait_until()`](/reference/condition_variable/condition_variable_any/wait_until.md))で待機中の[`condition_variable_any`](/reference/condition_variable/condition_variable_any.md)が存在している場合は、そのような`condition_variable_any`全てに対して起床通知が送られ、待機関数から処理が戻る。 + + ## 例 ```cpp example #include @@ -130,3 +133,7 @@ int main() - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P0660R10 Stop token and joining thread](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0660r10.pdf) +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/stop_token/stoppable-source.md b/reference/stop_token/stoppable-source.md index be53731f04..4c0d61a011 100644 --- a/reference/stop_token/stoppable-source.md +++ b/reference/stop_token/stoppable-source.md @@ -36,9 +36,9 @@ concept stoppable-source = - `request_stop`, `stop_requested`, `stop_possible`メンバ関数の呼び出しはデータ競合を引き起こさない。 - `true`を返す`request_stop`呼び出しは、`stopppable_token`または`stoppable-source`オブジェクトにおける`true`を返す`stop_requested`呼び出しに対して同期する。 - コールバックの登録は、そのコールバック呼び出しに対して同期する。 -- `stoppable-source`が停止状態を持たないとき、`request_stop`は効果をもたず`false`を返す。そうでなければ、関連づけられた停止状態に対して停止要求操作を実行する。 -- 停止要求操作は停止状態が停止要求を受信済みか否かを判定し、未受信であれば停止要求を行う。この判定はアトミックに行われる。 -- 停止要求が行われたとき、停止状態に登録されているコールバックが同期的に実行される。コールバック呼び出しが例外で終了した場合、[`terminate`](/reference/exception/terminate.md)が呼び出される。 +- `stoppable-source`が停止状態を持たないとき、`request_stop`は効果をもたず`false`を返す。そうでなければ、関連づけられた停止状態に対して次の停止要求操作を実行する。 + - 停止要求操作は停止状態が停止要求を受信済みか否かを判定し、未受信であれば停止要求を行う。この判定はアトミックに行われる。 + - 停止要求が行われたとき、停止状態に登録されているコールバックが同期的に実行される。コールバック呼び出しが例外で終了した場合、[`terminate`](/reference/exception/terminate.md)が呼び出される。 - 停止要求が行われたとき`request_stop`は`true`を返す。そうでなければ`false`を返す。 - `request_stop`呼び出し後は、`stop_possible`が`false`を返すか、`stop_requested`が`true`を返す。 From 3c666099f0bd0e784a87f2b3d11a7064278a97e1 Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 7 Apr 2025 17:11:27 +0900 Subject: [PATCH 1511/3948] =?UTF-8?q?stop=5Ftoken:=20inplace=5Fstop=5Ftoke?= =?UTF-8?q?n=E5=85=A8=E3=83=A1=E3=83=B3=E3=83=90=20(#1384)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - stop_token/op_equal P2300R10追従して定義変更 - stop_token/swap_free 備考を追記(定義削除も影響なし) --- reference/stop_token.md | 4 +- reference/stop_token/inplace_stop_source.md | 8 +- .../inplace_stop_source/get_token.md | 6 +- reference/stop_token/inplace_stop_token.md | 81 +++++++++++++++++++ .../inplace_stop_token/callback_type.md | 30 +++++++ .../inplace_stop_token/op_constructor.md | 32 ++++++++ .../inplace_stop_token/stop_possible.md | 37 +++++++++ .../inplace_stop_token/stop_requested.md | 37 +++++++++ .../stop_token/inplace_stop_token/swap.md | 62 ++++++++++++++ reference/stop_token/stop_token.md | 14 +++- reference/stop_token/stop_token/op_equal.md | 15 +++- reference/stop_token/stop_token/swap_free.md | 9 +++ reference/stop_token/stoppable_token.md | 2 +- 13 files changed, 321 insertions(+), 16 deletions(-) create mode 100644 reference/stop_token/inplace_stop_token.md create mode 100644 reference/stop_token/inplace_stop_token/callback_type.md create mode 100644 reference/stop_token/inplace_stop_token/op_constructor.md create mode 100644 reference/stop_token/inplace_stop_token/stop_possible.md create mode 100644 reference/stop_token/inplace_stop_token/stop_requested.md create mode 100644 reference/stop_token/inplace_stop_token/swap.md diff --git a/reference/stop_token.md b/reference/stop_token.md index 0e1181ab6b..39b9f12682 100644 --- a/reference/stop_token.md +++ b/reference/stop_token.md @@ -5,7 +5,7 @@ ``ヘッダは、マルチスレッド処理や非同期処理おける停止要求の状態 `停止状態` を扱うクラスを定義する。 - [`stop_token`](stop_token/stop_token.md), [`stop_source`](stop_token/stop_source.md), [`stop_callback`](stop_token/stop_callback.md)は停止状態を共有所有する。最後に破棄されたオブジェクトが停止状態を自動的に解放する。 -- [`inplace_stop_source`](stop_token/inplace_stop_source.md)は停止状態をメンバとして直接所有する。[`inplace_stop_token`](stop_token/inplace_stop_token.md.nolink)と[`inplace_stop_callback`](stop_token/inplace_stop_callback.md.nolink)は停止状態の所有には関与しない。 +- [`inplace_stop_source`](stop_token/inplace_stop_source.md)は停止状態をメンバとして直接所有する。[`inplace_stop_token`](stop_token/inplace_stop_token.md)と[`inplace_stop_callback`](stop_token/inplace_stop_callback.md.nolink)は停止状態の所有には関与しない。 ## コンセプト @@ -22,7 +22,7 @@ | [`stop_callback`](stop_token/stop_callback.md)| [`stop_source`](stop_token/stop_source.md)停止要求に応じて呼び出されるコールバック (class template) | C++20 | | [`nostopstate`](stop_token/nostopstate.md) | 停止状態を扱わない[`stop_source`](stop_token/stop_source.md)構築用タグ (class) | C++20 | | [`never_stop_token`](stop_token/never_stop_token.md) | 停止不可能な停止トークン (class) | C++26 | -| [`inplace_stop_token`](stop_token/inplace_stop_token.md.nolink) | [`inplace_stop_source`](stop_token/inplace_stop_source.md)の停止トークン (class) | C++26 | +| [`inplace_stop_token`](stop_token/inplace_stop_token.md) | [`inplace_stop_source`](stop_token/inplace_stop_source.md)の停止トークン (class) | C++26 | | [`inplace_stop_source`](stop_token/inplace_stop_source.md) | 停止状態を直接所有する停止要求インタフェース (class) | C++26 | | [`inplace_stop_callback`](stop_token/inplace_stop_callback.md.nolink) | [`inplace_stop_source`](stop_token/inplace_stop_source.md)停止要求に応じて呼び出されるコールバック (class template) | C++26 | | [`stop_callback_for_t`](stop_token/stop_callback_for_t.md) | 対応するコールバック型を取得 (alias template) | C++26 | diff --git a/reference/stop_token/inplace_stop_source.md b/reference/stop_token/inplace_stop_source.md index a993459a5e..f8947eb59d 100644 --- a/reference/stop_token/inplace_stop_source.md +++ b/reference/stop_token/inplace_stop_source.md @@ -23,7 +23,7 @@ namespace std { | [`(constructor)`](inplace_stop_source/op_constructor.md) | コンストラクタ | C++26 | | `(destructor)` | デストラクタ | C++26 | | `operator=` | 代入演算子 | C++26 | -| [`get_token`](inplace_stop_source/get_token.md) | 自身の停止状態を参照する[`inplace_stop_token`](inplace_stop_token.md.nolink)を返す | C++26 | +| [`get_token`](inplace_stop_source/get_token.md) | 自身の停止状態を参照する[`inplace_stop_token`](inplace_stop_token.md)を返す | C++26 | | [`stop_requested`](inplace_stop_source/stop_requested.md) | 停止要求を作成したかどうかを取得する | C++26 | | [`request_stop`](inplace_stop_source/request_stop.md) | 停止要求を作成する | C++26 | @@ -57,9 +57,9 @@ int main() } ``` * std::inplace_stop_source[color ff0000] -* std::inplace_stop_token[link inplace_stop_token.md.nolink] +* std::inplace_stop_token[link inplace_stop_token.md] * std::inplace_stop_callback[link inplace_stop_callback.md.nolink] -* stop_requested()[link inplace_stop_token/stop_requested.md.nolink] +* stop_requested()[link inplace_stop_token/stop_requested.md] * request_stop()[link inplace_stop_source/request_stop.md] * get_token()[link inplace_stop_source/get_token.md] @@ -80,7 +80,7 @@ int main() ## 関連項目 -- [`inplace_stop_token`](inplace_stop_token.md.nolink) +- [`inplace_stop_token`](inplace_stop_token.md) - [`inplace_stop_callback`](inplace_stop_callback.md.nolink) diff --git a/reference/stop_token/inplace_stop_source/get_token.md b/reference/stop_token/inplace_stop_source/get_token.md index d896ab5f42..5b6f6aa4db 100644 --- a/reference/stop_token/inplace_stop_source/get_token.md +++ b/reference/stop_token/inplace_stop_source/get_token.md @@ -8,14 +8,14 @@ ```cpp constexpr inplace_stop_token get_token() const noexcept; ``` -* inplace_stop_token[link ../inplace_stop_token.md.nolink] +* inplace_stop_token[link ../inplace_stop_token.md] ## 概要 -自身と停止状態を共有する[`inplace_stop_token`](../inplace_stop_token.md.nolink)を返す。 +自身の停止状態を参照する[`inplace_stop_token`](../inplace_stop_token.md)を返す。 ## 戻り値 -自身が所有する停止状態に関連付けられた[`inplace_stop_token`](../inplace_stop_token.md.nolink)を返す。 +自身が所有する停止状態に関連付けられた[`inplace_stop_token`](../inplace_stop_token.md)を返す。 ## 例外 diff --git a/reference/stop_token/inplace_stop_token.md b/reference/stop_token/inplace_stop_token.md new file mode 100644 index 0000000000..a5bb4b8e38 --- /dev/null +++ b/reference/stop_token/inplace_stop_token.md @@ -0,0 +1,81 @@ +# inplace_stop_token +* stop_token[meta header] +* class[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std { + class inplace_stop_token; +} +``` + +## 概要 +`inplace_stop_token`クラスは、停止要求が作成されたかどうか、あるいは停止要求が作成されうるかどうかなど、停止状態を問い合わせるためのインターフェースを提供する。 + +`inplace_stop_token`は[`stoppable_token`](stoppable_token.md)のモデルである。 + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|-------| +| [`(constructor)`](inplace_stop_token/op_constructor.md) | コンストラクタ | C++26 | +| `(destructor)` | デストラクタ | C++26 | +| `operator==` | 等値演算子 | C++26 | +| [`stop_requested`](inplace_stop_token/stop_requested.md)| 停止要求が作成されたかどうかを取得する | C++20 | +| [`stop_possible`](inplace_stop_token/stop_possible.md) | 停止要求が作成されうるかどうかを取得する | C++20 | +| [`swap`](inplace_stop_token/swap.md) | 別の`inplace_stop_token`と交換する | C++20 | + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------|------|-------| +| [`callback_type`](inplace_stop_token/callback_type.md) | 対応するコールバック型 | C++26 | + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::inplace_stop_source ss; + std::inplace_stop_token st = ss.get_token(); + assert(st.stop_requested() == false); + + ss.request_stop(); + + assert(st.stop_requested() == true); +} +``` +* std::inplace_stop_token[color ff0000] +* std::inplace_stop_source[link inplace_stop_source.md] +* stop_requested()[link inplace_stop_token/stop_requested.md] +* request_stop()[link inplace_stop_source/request_stop.md] +* get_token()[link inplace_stop_source/get_token.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`inplace_stop_source`](inplace_stop_source.md) +- [`inplace_stop_callback`](inplace_stop_callback.md.nolink) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/stop_token/inplace_stop_token/callback_type.md b/reference/stop_token/inplace_stop_token/callback_type.md new file mode 100644 index 0000000000..b06afc0316 --- /dev/null +++ b/reference/stop_token/inplace_stop_token/callback_type.md @@ -0,0 +1,30 @@ +# callback_type +* stop_token[meta header] +* std[meta namespace] +* inplace_stop_token[meta class] +* type-alias[meta id-type] +* cpp26[meta cpp] + +```cpp +template +using callback_type = inplace_stop_callback; +``` +* inplace_stop_callback[link ../inplace_stop_callback.md.nolink] + +## 概要 +`inplace_stop_token`に対応するコールバック型。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [GCC](/implementation.md#gcc): ?? +- [Clang](/implementation.md#clang): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/stop_token/inplace_stop_token/op_constructor.md b/reference/stop_token/inplace_stop_token/op_constructor.md new file mode 100644 index 0000000000..e956051975 --- /dev/null +++ b/reference/stop_token/inplace_stop_token/op_constructor.md @@ -0,0 +1,32 @@ +# コンストラクタ +* stop_token[meta header] +* function[meta id-type] +* std[meta namespace] +* inplace_stop_token[meta class] +* cpp26[meta cpp] + +```cpp +inplace_stop_token() = default; +``` + +## 概要 +デフォルトコンストラクタ。 + + +## 効果 +[`inplace_stop_source`](../inplace_stop_source.md)を参照しない停止トークンとして構築する。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/stop_token/inplace_stop_token/stop_possible.md b/reference/stop_token/inplace_stop_token/stop_possible.md new file mode 100644 index 0000000000..f63b647315 --- /dev/null +++ b/reference/stop_token/inplace_stop_token/stop_possible.md @@ -0,0 +1,37 @@ +# stop_possible +* stop_token[meta header] +* function[meta id-type] +* std[meta namespace] +* inplace_stop_token[meta class] +* cpp26[meta cpp] + +```cpp +bool stop_possible() const noexcept; +``` + +## 概要 +停止要求が作成されうるかどうかを返す。 + + +## 効果 +自身が[`inplace_stop_source`](../inplace_stop_source.md)を参照する場合に、`true`を返す。 +そうでなければ、`false`を返す。 + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/stop_token/inplace_stop_token/stop_requested.md b/reference/stop_token/inplace_stop_token/stop_requested.md new file mode 100644 index 0000000000..7f13f34015 --- /dev/null +++ b/reference/stop_token/inplace_stop_token/stop_requested.md @@ -0,0 +1,37 @@ +# stop_requested +* stop_token[meta header] +* function[meta id-type] +* std[meta namespace] +* inplace_stop_token[meta class] +* cpp26[meta cpp] + +```cpp +bool stop_requested() const noexcept; +``` + +## 概要 +停止要求が作成されたかどうかを返す。 + + +## 効果 +自身が[`inplace_stop_source`](../inplace_stop_source.md)を参照し、かつ[`stop_requested`](../inplace_stop_source/stop_requested.md)が`true`の場合に限って、`true`を返す。 +そうでなければ、`false`を返す。 + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/stop_token/inplace_stop_token/swap.md b/reference/stop_token/inplace_stop_token/swap.md new file mode 100644 index 0000000000..11cf90e9c8 --- /dev/null +++ b/reference/stop_token/inplace_stop_token/swap.md @@ -0,0 +1,62 @@ +# swap +* stop_token[meta header] +* std[meta namespace] +* inplace_stop_token[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +void swap(inplace_stop_token&) noexcept; +``` + +## 概要 +他の`inplace_stop_token`オブジェクトと値を入れ替える。 + +## 戻り値 +なし + +## 例外 +投げない + +## 例 +```cpp example +#include +#include + +int main() +{ + std::inplace_stop_source ss; + std::inplace_stop_token st1 = ss.get_token(); + std::inplace_stop_token st2; + + assert(st1.stop_possible() == true); + assert(st2.stop_possible() == false); + + st1.swap(st2); + + assert(st1.stop_possible() == false); + assert(st2.stop_possible() == true); +} +``` +* swap[color ff0000] +* std::inplace_stop_token[link ../inplace_stop_token.md] +* std::inplace_stop_source[link ../inplace_stop_source.md] +* stop_possible()[link stop_possible.md] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/stop_token/stop_token.md b/reference/stop_token/stop_token.md index 4062060849..d5676888f8 100644 --- a/reference/stop_token/stop_token.md +++ b/reference/stop_token/stop_token.md @@ -13,6 +13,8 @@ namespace std { ## 概要 `stop_token`クラスは、停止要求が作成されたかどうか、あるいは停止要求が作成されうるかどうかなど、停止状態を問い合わせるためのインターフェースを提供する。 +`stop_token`は[`stoppable_token`](stoppable_token.md)のモデルである。 + [`stop_source`](stop_source.md)クラスの[`get_token()`](stop_source/get_token.md)メンバ関数を呼び出すと、その`stop_source`クラスのオブジェクトと停止状態を共有する`stop_token`クラスのオブジェクトを構築できる。これによって、`stop_source`側から停止要求を作成したときに、この`stop_token`を通じて停止状態を問い合わせられるようになる。 また、`stop_token`クラスは以下のクラスでも利用される: @@ -38,7 +40,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|-------| -| [`callback_type`](stop_token/callback_type.md) | 対応するコールバック型 (alias template) | C++26 | +| [`callback_type`](stop_token/callback_type.md) | 対応するコールバック型 | C++26 | ## 非メンバ関数 @@ -80,10 +82,18 @@ int main() ### 言語 - C++20 - ### 処理系 - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + +## 関連項目 +- [`stop_source`](stop_source.md) +- [`stop_callback`](stop_callback.md) + + +## 参照 +- [P0660R10 Stop token and joining thread](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0660r10.pdf) +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/stop_token/stop_token/op_equal.md b/reference/stop_token/stop_token/op_equal.md index 10b7b80dca..2c8310c542 100644 --- a/reference/stop_token/stop_token/op_equal.md +++ b/reference/stop_token/stop_token/op_equal.md @@ -9,12 +9,12 @@ namespace std { [[nodiscard]] friend bool operator==(const stop_token& lhs, - const stop_token& rhs) noexcept; // (1) C++20 - friend bool - operator==(const stop_token& lhs, - const stop_token& rhs) noexcept; // (1) C++26 + const stop_token& rhs) noexcept; // (1) C++20 非メンバ関数 } ``` +```cpp +bool operator==(const stop_token& rhs) const noexcept = default; // (1) C++26 メンバ関数 +``` ## 概要 `stop_token`オブジェクトの等値比較を行う。 @@ -25,6 +25,10 @@ namespace std { ## 例外 投げない。 +## 備考 +C++26で`[[nodiscard]]`指定が削除され、非メンバ関数からメンバ関数に定義変更される。動作仕様に変更はない。 + + ## 例 ```cpp example #include @@ -67,5 +71,8 @@ int main() ## 参照 +- [P0660R10 Stop token and joining thread](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0660r10.pdf) - [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) - C++26で`[[nodiscard]]`指定が削除された +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) + - C++26で非メンバ関数からメンバ関数に定義変更 diff --git a/reference/stop_token/stop_token/swap_free.md b/reference/stop_token/stop_token/swap_free.md index d0f7e8f376..043d5e39a6 100644 --- a/reference/stop_token/stop_token/swap_free.md +++ b/reference/stop_token/stop_token/swap_free.md @@ -30,6 +30,10 @@ x.swap(y); なし +## 備考 +C++26で`swap`非メンバ関数は`stop_token`クラス定義から削除されるが、[`std::swap`](/reference/utility/swap.md)の値版により従来動作は維持される。 + + ## 例 ```cpp example #include @@ -69,3 +73,8 @@ int main() - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P0660R10 Stop token and joining thread](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0660r10.pdf) +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) + - C++26で非メンバ関数`swap`定義を削除 diff --git a/reference/stop_token/stoppable_token.md b/reference/stop_token/stoppable_token.md index 60ff81652d..9cbe407fc3 100644 --- a/reference/stop_token/stoppable_token.md +++ b/reference/stop_token/stoppable_token.md @@ -110,7 +110,7 @@ concept stoppable-callback-for = ## 関連項目 - [`unstoppable_token`](unstoppable_token.md) - [`stop_token`](stop_token.md) -- [`inplace_stop_token`](inplace_stop_token.md.nolink) +- [`inplace_stop_token`](inplace_stop_token.md) - [`never_stop_token`](never_stop_token.md) From 57d9fcecd46ffbfe9c82520c03b74bf347d1510b Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 7 Apr 2025 17:21:00 +0900 Subject: [PATCH 1512/3948] =?UTF-8?q?C++26:=20=E3=80=8C=E3=83=A2=E3=82=B8?= =?UTF-8?q?=E3=83=A5=E3=83=BC=E3=83=AB=E5=AE=A3=E8=A8=80=E3=81=A7=E3=81=AE?= =?UTF-8?q?=E3=83=A2=E3=82=B8=E3=83=A5=E3=83=BC=E3=83=AB=E5=90=8D=E3=81=AE?= =?UTF-8?q?=E3=83=9E=E3=82=AF=E3=83=AD=E5=B1=95=E9=96=8B=E3=82=92=E7=A6=81?= =?UTF-8?q?=E6=AD=A2=E3=81=99=E3=82=8B=E3=80=8D=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20(close=20#1325)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp20/modules.md | 3 +- lang/cpp26.md | 2 +- .../module_declarations_shouldnt_be_macros.md | 40 +++++++++++++++++++ 4 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 lang/cpp26/module_declarations_shouldnt_be_macros.md diff --git a/implementation-status.md b/implementation-status.md index 88df9fdbc4..c36b9e6530 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -304,7 +304,7 @@ | P2748R5: [返却された左辺値から暗黙変換された一時オブジェクトが参照に束縛されることを禁止する](/lang/cpp26/disallow_binding_a_returned_glvalue_to_a_temporary.md.nolink) | 寿命切れの変数によって引き起こされるバグを防止する | 14 | 19 | | | | P3106R1: [要素数不明の配列を集成体初期化する規則を明確化](/lang/cpp26/clarifying_rules_for_brace_elision_in_aggregate_initialization.md.nolink) | 配列要素の集成体初期化で`{}`が省略された場合の矛盾していた規定を修正 | yes | 17 | | | | P0609R3: [構造化束縛への属性を許可](/lang/cpp26/attributes_for_structured_bindings.md) | `auto [a, b [[maybe_unused]], c] = f();`のように構造化束縛の要素に対して属性を付加できるようにする | 15 | 19 | | | -| P3034R1: [モジュール宣言でのモジュール名のマクロ展開を禁止する](/lang/cpp26/module_declarations_shouldnt_be_macros.md.nolink) | `export module MACRO_NAME;`を禁止 | | | | | +| P3034R1: [モジュール宣言でのモジュール名のマクロ展開を禁止する](/lang/cpp26/module_declarations_shouldnt_be_macros.md) | `export module MACRO_NAME;`を禁止 | | | | | | P2809R3: [空の無限ループは未定義動作ではないと規定](/lang/cpp26/trivial_infinite_loops_are_not_undefined_behavior.md) | 並行プログラムの進行保証などを考慮して空の無限ループを未定義動作ではないものとする | 14 | 19 | | | | P2795R5: [未初期化変数の読み取りをエラー性動作とする](/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md) | 初期化されていない自動変数の読み取りの安全性を規定する | | | | | | P2573R2: [関数宣言を削除する理由を指定できるようにする](/lang/cpp26/delete_reason.md) | `f() = delete("reason");` | 15 | 19 | | | diff --git a/lang/cpp20/modules.md b/lang/cpp20/modules.md index d1eade1b5a..cf7fafa84c 100644 --- a/lang/cpp20/modules.md +++ b/lang/cpp20/modules.md @@ -490,6 +490,7 @@ int main() { ## 関連項目 - [C++23 無意味なexport宣言を禁止する](/lang/cpp23/meaningful_exports.md) +- [C++26 モジュール宣言でのモジュール名のマクロ展開を禁止する](/lang/cpp26/module_declarations_shouldnt_be_macros.md) ## 参照 @@ -504,4 +505,4 @@ Standard library header units for C++20](http://www.open-std.org/jtc1/sc22/wg21/ Mitigating minor modules maladies](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1766r1.html) - [P1811R0 Relaxing redefinition restrictions for re-exportation robustness](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1811r0.html#problem) - 同時に到達可能とならなければODR違反にならないという仕様が削除された。また、インポータブルヘッダーの`#include`を`import`に置き換えるかは処理系定義となった。 \ No newline at end of file + 同時に到達可能とならなければODR違反にならないという仕様が削除された。また、インポータブルヘッダーの`#include`を`import`に置き換えるかは処理系定義となった。 diff --git a/lang/cpp26.md b/lang/cpp26.md index 0a74262b25..78e08ae95c 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -102,7 +102,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| -| [モジュール宣言でのモジュール名のマクロ展開を禁止する](/lang/cpp26/module_declarations_shouldnt_be_macros.md.nolink) | `export module MACRO_NAME;`を禁止 | +| [モジュール宣言でのモジュール名のマクロ展開を禁止する](/lang/cpp26/module_declarations_shouldnt_be_macros.md) | `export module MACRO_NAME;`を禁止 | ### 機能の非推奨化 diff --git a/lang/cpp26/module_declarations_shouldnt_be_macros.md b/lang/cpp26/module_declarations_shouldnt_be_macros.md new file mode 100644 index 0000000000..b1979119b1 --- /dev/null +++ b/lang/cpp26/module_declarations_shouldnt_be_macros.md @@ -0,0 +1,40 @@ +# モジュール宣言でのモジュール名のマクロ展開を禁止する [P3034R1] +* cpp26[meta cpp] + + + +このページはC++26に採用される見込みの言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 + + + +## 概要 +C++26では、以下のようにモジュール名をマクロ (プリプロセッサ・トークン) にすることが禁止される。 + +```cpp +// version.h: +#ifndef VERSION_H +#define VERSION_H + +#define VERSION libv5 + +#endif + + +// lib.cppm: +module; +#include "version.h" +export module VERSION; // C++23: OK, C++26: NG +``` + +この仕様は、C++20の欠陥として扱われる。そのため、C++20やC++23に対応したコンパイラですでに実装されている可能性がある。 + + +## 関連項目 +- [C++20 モジュール](/lang/cpp20/modules.md) + + +## 参照 +- [P3034R1 Module Declarations Shouldn’t be Macros](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3034r1.html) + From 43651f21a2c3dceffa2cb1fee42537a1441dc514 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 7 Apr 2025 17:31:40 +0900 Subject: [PATCH 1513/3948] =?UTF-8?q?C++26=20=E3=83=A2=E3=82=B8=E3=83=A5?= =?UTF-8?q?=E3=83=BC=E3=83=AB=E5=AE=A3=E8=A8=80=E3=81=A7=E3=81=AE=E3=83=A2?= =?UTF-8?q?=E3=82=B8=E3=83=A5=E3=83=BC=E3=83=AB=E5=90=8D=E3=81=AE=E3=83=9E?= =?UTF-8?q?=E3=82=AF=E3=83=AD=E5=B1=95=E9=96=8B=E3=82=92=E7=A6=81=E6=AD=A2?= =?UTF-8?q?=E3=81=99=E3=82=8B=20:=20C++23=E3=81=A7OK=E3=81=98=E3=82=83?= =?UTF-8?q?=E3=81=AA=E3=81=8B=E3=81=A3=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26/module_declarations_shouldnt_be_macros.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp26/module_declarations_shouldnt_be_macros.md b/lang/cpp26/module_declarations_shouldnt_be_macros.md index b1979119b1..b0f2cbcd69 100644 --- a/lang/cpp26/module_declarations_shouldnt_be_macros.md +++ b/lang/cpp26/module_declarations_shouldnt_be_macros.md @@ -25,7 +25,7 @@ C++26では、以下のようにモジュール名をマクロ (プリプロセ // lib.cppm: module; #include "version.h" -export module VERSION; // C++23: OK, C++26: NG +export module VERSION; // コンパイルエラー! ``` この仕様は、C++20の欠陥として扱われる。そのため、C++20やC++23に対応したコンパイラですでに実装されている可能性がある。 From c75607bc6745991762600bfab0738c62a474760c Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 7 Apr 2025 18:24:46 +0900 Subject: [PATCH 1514/3948] =?UTF-8?q?stop=5Ftoken:=20inplace=5Fstop=5Fcall?= =?UTF-8?q?back=E5=85=A8=E3=83=A1=E3=83=B3=E3=83=90=20(#1384)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - stop_callback/op_constructor P2300R10追従 - stop_callback/op_destructor P2300R10追従 --- reference/stop_token.md | 8 +- reference/stop_token/inplace_stop_callback.md | 101 ++++++++++++++++++ .../inplace_stop_callback/op_constructor.md | 49 +++++++++ .../op_deduction_guide.md | 58 ++++++++++ .../inplace_stop_callback/op_destructor.md | 28 +++++ reference/stop_token/inplace_stop_source.md | 4 +- reference/stop_token/inplace_stop_token.md | 2 +- .../inplace_stop_token/callback_type.md | 2 +- reference/stop_token/stop_callback.md | 18 +++- .../stop_callback/op_constructor.md | 52 +++++---- .../stop_callback/op_deduction_guide.md | 1 + .../stop_token/stop_callback/op_destructor.md | 14 ++- reference/stop_token/stoppable-source.md | 2 +- 13 files changed, 301 insertions(+), 38 deletions(-) create mode 100644 reference/stop_token/inplace_stop_callback.md create mode 100644 reference/stop_token/inplace_stop_callback/op_constructor.md create mode 100644 reference/stop_token/inplace_stop_callback/op_deduction_guide.md create mode 100644 reference/stop_token/inplace_stop_callback/op_destructor.md diff --git a/reference/stop_token.md b/reference/stop_token.md index 39b9f12682..4ed1d2f197 100644 --- a/reference/stop_token.md +++ b/reference/stop_token.md @@ -5,7 +5,7 @@ ``ヘッダは、マルチスレッド処理や非同期処理おける停止要求の状態 `停止状態` を扱うクラスを定義する。 - [`stop_token`](stop_token/stop_token.md), [`stop_source`](stop_token/stop_source.md), [`stop_callback`](stop_token/stop_callback.md)は停止状態を共有所有する。最後に破棄されたオブジェクトが停止状態を自動的に解放する。 -- [`inplace_stop_source`](stop_token/inplace_stop_source.md)は停止状態をメンバとして直接所有する。[`inplace_stop_token`](stop_token/inplace_stop_token.md)と[`inplace_stop_callback`](stop_token/inplace_stop_callback.md.nolink)は停止状態の所有には関与しない。 +- [`inplace_stop_source`](stop_token/inplace_stop_source.md)は停止状態をメンバとして直接所有する。[`inplace_stop_token`](stop_token/inplace_stop_token.md)と[`inplace_stop_callback`](stop_token/inplace_stop_callback.md)は停止状態の所有には関与しない。 ## コンセプト @@ -22,9 +22,9 @@ | [`stop_callback`](stop_token/stop_callback.md)| [`stop_source`](stop_token/stop_source.md)停止要求に応じて呼び出されるコールバック (class template) | C++20 | | [`nostopstate`](stop_token/nostopstate.md) | 停止状態を扱わない[`stop_source`](stop_token/stop_source.md)構築用タグ (class) | C++20 | | [`never_stop_token`](stop_token/never_stop_token.md) | 停止不可能な停止トークン (class) | C++26 | -| [`inplace_stop_token`](stop_token/inplace_stop_token.md) | [`inplace_stop_source`](stop_token/inplace_stop_source.md)の停止トークン (class) | C++26 | -| [`inplace_stop_source`](stop_token/inplace_stop_source.md) | 停止状態を直接所有する停止要求インタフェース (class) | C++26 | -| [`inplace_stop_callback`](stop_token/inplace_stop_callback.md.nolink) | [`inplace_stop_source`](stop_token/inplace_stop_source.md)停止要求に応じて呼び出されるコールバック (class template) | C++26 | +| [`inplace_stop_token`](stop_token/inplace_stop_token.md) | [`inplace_stop_source`](stop_token/inplace_stop_source.md)の停止トークン (class) | C++26 | +| [`inplace_stop_source`](stop_token/inplace_stop_source.md) | 停止状態を直接所有する停止要求インタフェース (class) | C++26 | +| [`inplace_stop_callback`](stop_token/inplace_stop_callback.md) | [`inplace_stop_source`](stop_token/inplace_stop_source.md)停止要求に応じて呼び出されるコールバック (class template) | C++26 | | [`stop_callback_for_t`](stop_token/stop_callback_for_t.md) | 対応するコールバック型を取得 (alias template) | C++26 | diff --git a/reference/stop_token/inplace_stop_callback.md b/reference/stop_token/inplace_stop_callback.md new file mode 100644 index 0000000000..b66c5b516c --- /dev/null +++ b/reference/stop_token/inplace_stop_callback.md @@ -0,0 +1,101 @@ +# inplace_stop_callback +* stop_token[meta header] +* std[meta namespace] +* class template[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + class inplace_stop_callback; +} +``` + +## 概要 +`inplace_stop_callback`クラステンプレートは、停止要求が作成された際に呼び出されるコールバックを表す。 + + +## 適格要件 +テンプレート引数`CallbackFn`が[`invocable`](/reference/concepts/invokable.md.nolink)および[`destructible`](/reference/concepts/destructible.md)を満たすこと。 + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|-------| +| [`(constructor)`](inplace_stop_callback/op_constructor.md)| コンストラクタ | C++26 | +| [`(destructor)`](inplace_stop_callback/op_destructor.md) | デストラクタ | C++26 | +| `operator=(const inplace_stop_callback&) = delete;` | 代入演算子 | C++26 | +| `operator=(inplace_stop_callback&&) = delete;` | 代入演算子 | C++26 | + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------|------|-------| +| `callback_type` | `CallbackFn` | C++26 | + +## 推論補助 + +| 名前 | 説明 | 対応バージョン | +|------|------|-------| +| [`(deduction_guide)`](inplace_stop_callback/op_deduction_guide.md) | クラステンプレートの推論補助 | C++26 | + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::string msg; + + std::inplace_stop_source ss; + std::inplace_stop_token st = ss.get_token(); + std::inplace_stop_callback cb1(st, [&] { msg += "hello"; }); + + assert(msg == ""); + + ss.request_stop(); + + // 停止要求が作成される前に登録されていたコールバック関数は、 + // 停止要求が作成された際にその中で呼び出される + assert(msg == "hello"); + + std::inplace_stop_callback cb2(st, [&] { msg += " world"; }); + + // 停止要求が作成されたあとに登録されたコールバック関数は、 + // std::inplace_stop_callback クラスのコンストラクタの中で即座に呼び出される + assert(msg == "hello world"); +} +``` +* std::inplace_stop_callback[color ff0000] +* std::inplace_stop_token[link inplace_stop_token.md] +* std::inplace_stop_source[link inplace_stop_source.md] +* request_stop()[link inplace_stop_source/request_stop.md] +* get_token()[link inplace_stop_source/get_token.md] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++26 + + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`inplace_stop_token`](inplace_stop_token.md) +- [`inplace_stop_source`](inplace_stop_source.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/stop_token/inplace_stop_callback/op_constructor.md b/reference/stop_token/inplace_stop_callback/op_constructor.md new file mode 100644 index 0000000000..2c537aabd4 --- /dev/null +++ b/reference/stop_token/inplace_stop_callback/op_constructor.md @@ -0,0 +1,49 @@ +# コンストラクタ +* stop_token[meta header] +* std[meta namespace] +* inplace_stop_callback[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +template +explicit inplace_stop_callback(inplace_stop_token st, Initializer&& init) + noexcept(is_nothrow_constructible_v); // (1) + +inplace_stop_callback(const inplace_stop_callback&) = delete; // (2) +inplace_stop_callback(inplace_stop_callback&&) = delete; // (3) +``` +* inplace_stop_token[link ../inplace_stop_token.md] +* is_nothrow_constructible_v[link /reference/type_traits/is_nothrow_constructible.md] + +## 概要 +- (1) : [`inplace_stop_token`](../inplace_stop_token.md)を受け取り、その`inplace_stop_token`が参照する停止状態への停止要求に応じて呼び出されるコールバックを登録する。 +- (2) : コピーコンストラクタ。コピー不可。 +- (3) : ムーブコンストラクタ。ムーブ不可。 + + +## テンプレートパラメータ制約 +クラステンプレートのテンプレート引数`CallbackFn`とコンストラクタのテンプレート引数`Initializer`は[`constructible_from`](/reference/concepts/constructible_from.md)``制約を満たすこと。 + + +## 効果 +説明専用のメンバ変数`callback-fn`を[`std::forward`](/reference/utility/forward.md)`(init)`で初期化し、[停止可能コールバック登録](../stoppable_token.md)を実行する。 + + +## 例外 +説明専用のメンバ変数`callback-fn`を`init`で初期化する際に例外が発生する場合は、その例外を送出する。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/stop_token/inplace_stop_callback/op_deduction_guide.md b/reference/stop_token/inplace_stop_callback/op_deduction_guide.md new file mode 100644 index 0000000000..2168e2953b --- /dev/null +++ b/reference/stop_token/inplace_stop_callback/op_deduction_guide.md @@ -0,0 +1,58 @@ +# 推論補助 +* stop_token[meta header] +* std[meta namespace] +* inplace_stop_callback[meta class] +* cpp26[meta cpp] + +```cpp +namespace std { + template + inplace_stop_callback(inplace_stop_token, CallbackFn) -> inplace_stop_callback; +} +``` +* inplace_stop_token[link ../inplace_stop_token.md] + +## 概要 +[`inplace_stop_callback`](../inplace_stop_callback.md)クラステンプレートの型推論補助。 + +## 例 +```cpp example +#include +#include + +struct X { + void operator()() {} +}; + +int main() +{ + X x; + std::inplace_stop_token st; + std::inplace_stop_callback cb { st, x }; + + static_assert(std::is_same_v); +} +``` +* std::inplace_stop_token[link ../inplace_stop_token.md] +* std::inplace_stop_callback[link ../inplace_stop_callback.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 関連項目 +- [C++17 クラステンプレートのテンプレート引数推論](/lang/cpp17/type_deduction_for_class_templates.md) + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/stop_token/inplace_stop_callback/op_destructor.md b/reference/stop_token/inplace_stop_callback/op_destructor.md new file mode 100644 index 0000000000..6fccd2322f --- /dev/null +++ b/reference/stop_token/inplace_stop_callback/op_destructor.md @@ -0,0 +1,28 @@ +# デストラクタ +* stop_token[meta header] +* std[meta namespace] +* inplace_stop_callback[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +~inplace_stop_callback(); +``` + +## 効果 +[停止可能コールバック登録解除](../stoppable_token.md)を実行する。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/stop_token/inplace_stop_source.md b/reference/stop_token/inplace_stop_source.md index f8947eb59d..ff8deab59d 100644 --- a/reference/stop_token/inplace_stop_source.md +++ b/reference/stop_token/inplace_stop_source.md @@ -58,7 +58,7 @@ int main() ``` * std::inplace_stop_source[color ff0000] * std::inplace_stop_token[link inplace_stop_token.md] -* std::inplace_stop_callback[link inplace_stop_callback.md.nolink] +* std::inplace_stop_callback[link inplace_stop_callback.md] * stop_requested()[link inplace_stop_token/stop_requested.md] * request_stop()[link inplace_stop_source/request_stop.md] * get_token()[link inplace_stop_source/get_token.md] @@ -81,7 +81,7 @@ int main() ## 関連項目 - [`inplace_stop_token`](inplace_stop_token.md) -- [`inplace_stop_callback`](inplace_stop_callback.md.nolink) +- [`inplace_stop_callback`](inplace_stop_callback.md) ## 参照 diff --git a/reference/stop_token/inplace_stop_token.md b/reference/stop_token/inplace_stop_token.md index a5bb4b8e38..8729e25880 100644 --- a/reference/stop_token/inplace_stop_token.md +++ b/reference/stop_token/inplace_stop_token.md @@ -74,7 +74,7 @@ int main() ## 関連項目 - [`inplace_stop_source`](inplace_stop_source.md) -- [`inplace_stop_callback`](inplace_stop_callback.md.nolink) +- [`inplace_stop_callback`](inplace_stop_callback.md) ## 参照 diff --git a/reference/stop_token/inplace_stop_token/callback_type.md b/reference/stop_token/inplace_stop_token/callback_type.md index b06afc0316..361dcb41ca 100644 --- a/reference/stop_token/inplace_stop_token/callback_type.md +++ b/reference/stop_token/inplace_stop_token/callback_type.md @@ -9,7 +9,7 @@ template using callback_type = inplace_stop_callback; ``` -* inplace_stop_callback[link ../inplace_stop_callback.md.nolink] +* inplace_stop_callback[link ../inplace_stop_callback.md] ## 概要 `inplace_stop_token`に対応するコールバック型。 diff --git a/reference/stop_token/stop_callback.md b/reference/stop_token/stop_callback.md index f71392b3e9..bea16a99e9 100644 --- a/reference/stop_token/stop_callback.md +++ b/reference/stop_token/stop_callback.md @@ -14,6 +14,11 @@ namespace std { ## 概要 `stop_callback`クラステンプレートは、停止要求が作成された際に呼び出されるコールバックを表す。 + +## 適格要件 +テンプレート引数`CallbackFn`が[`invocable`](/reference/concepts/invokable.md.nolink)および[`destructible`](/reference/concepts/destructible.md)を満たすこと。 + + ## メンバ関数 | 名前 | 説明 | 対応バージョン | @@ -35,11 +40,6 @@ namespace std { |------|------|-------| | [`(deduction_guide)`](stop_callback/op_deduction_guide.md) | クラステンプレートの推論補助 | C++20 | -## 適格要件 -テンプレート引数の`CallbackFn`は[`invocable`](/reference/concepts/invokable.md.nolink)と[`destructible`](/reference/concepts/destructible.md)制約を満たさなければならい。 - -## 事前条件 -テンプレート引数の`CallbackFn`は[`invocable`](/reference/concepts/invokable.md.nolink)と[`destructible`](/reference/concepts/destructible.md)制約を満たさなければならい。 ## 例 ```cpp example @@ -91,3 +91,11 @@ int main() - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + +## 関連項目 +- [`stop_token`](stop_token.md) +- [`stop_source`](stop_source.md) + + +## 参照 +- [P0660R10 Stop token and joining thread](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0660r10.pdf) diff --git a/reference/stop_token/stop_callback/op_constructor.md b/reference/stop_token/stop_callback/op_constructor.md index fb334ad162..8a4ee57e4b 100644 --- a/reference/stop_token/stop_callback/op_constructor.md +++ b/reference/stop_token/stop_callback/op_constructor.md @@ -6,16 +6,19 @@ * cpp20[meta cpp] ```cpp -template -explicit stop_callback(const stop_token& st, C&& cb) - noexcept(is_nothrow_constructible_v); // (1) -template -explicit stop_callback(stop_token&& st, C&& cb) - noexcept(is_nothrow_constructible_v); // (2) - -stop_callback(const stop_callback&) = delete; // (3) -stop_callback(stop_callback&&) = delete; // (4) +template +explicit stop_callback(const stop_token& st, Initializer&& init) + noexcept(is_nothrow_constructible_v); // (1) + +template +explicit stop_callback(stop_token&& st, Initializer&& init) + noexcept(is_nothrow_constructible_v); // (2) + +stop_callback(const stop_callback&) = delete; // (3) +stop_callback(stop_callback&&) = delete; // (4) ``` +* stop_token[link ../stop_token.md] +* is_nothrow_constructible_v[link /reference/type_traits/is_nothrow_constructible.md] ## 概要 - (1) : [`stop_token`](../stop_token.md)の左辺値参照を受け取り、その`stop_token`が所有する停止状態への停止要求に応じて呼び出されるコールバックを登録する。 @@ -24,27 +27,30 @@ stop_callback(stop_callback&&) = delete; // (4) - (4) : ムーブコンストラクタ。ムーブ不可。 -## 適格要件 -クラステンプレートのテンプレート引数`CallbackFn`とコンストラクタのテンプレート引数`C`は[`constructible_from`](/reference/concepts/constructible_from.md)``制約を満たさなければならない。 +## テンプレートパラメータ制約 +クラステンプレートのテンプレート引数`CallbackFn`とコンストラクタのテンプレート引数`Initializer`は[`constructible_from`](/reference/concepts/constructible_from.md)``制約を満たすこと。 -## 事前条件 -クラステンプレートのテンプレート引数`CallbackFn`とコンストラクタのテンプレート引数`C`は[`constructible_from`](/reference/concepts/constructible_from.md)``制約を満たさなければならない。 +## 効果 +説明専用のメンバ変数`callback-fn`を[`std::forward`](/reference/utility/forward.md)`(init)`で初期化し、[停止可能コールバック登録](../stoppable_token.md)を実行する(備考欄を参照)。 +コールバックが`st`の停止状態に登録されたた場合、`*this`が停止状態の所有権を共有する。 -## 効果 -コンストラクタの引数に渡した`cb`を`std::forward(cb)`で転送して、メンバ変数(仮に`callback`とする)を初期化する。 -もし`st.`[`stop_requested()`](../stop_token/stop_requested.md) `==` `true` の場合は、コンストラクタを呼び出したスレッドの中で`std::forward(callback)()`を評価し、コールバックを呼び出す。したがってこのコールバックの呼び出しはコンストラクタから処理が戻るより前に完了する。 +## 例外 +説明専用のメンバ変数`callback-fn`を`init`で初期化する際に例外が発生する場合は、その例外を送出する。 -そうでない場合は、`st`が所有している停止状態への所有権を取得して停止状態を共有し、その停止状態に対する最初の[`request_stop()`](../stop_source/request_stop.md)の呼び出しで`std::forward(callback)()`を評価するようなコールバックを登録する。 -`st`が停止状態を所有していない場合は何もしない。 -もし`std::forward(callback)()`の呼び出しが例外によって終了した場合は、[`std::terminate()`](/reference/exception/terminate.md)関数が呼び出され、プログラムが異常終了する。 +## 備考 +停止可能コールバック登録は次のように行われる。 +もし`st.`[`stop_requested()`](../stop_token/stop_requested.md) `==` `true` の場合は、コンストラクタを呼び出したスレッドの中で`std::forward(callback-fn)()`を評価し、コールバックを呼び出す。したがってこのコールバックの呼び出しはコンストラクタから処理が戻るより前に完了する。 + +そうでない場合は、`st`が所有している停止状態への所有権を取得して停止状態を共有し、その停止状態に対する最初の[`request_stop()`](../stop_source/request_stop.md)の呼び出しで`std::forward(callback-fn)()`を評価するようなコールバックを登録する。 +`st`が停止状態を所有していない場合は何もしない。 + +もし`std::forward(callback-fn)()`の呼び出しが例外によって終了した場合は、[`std::terminate()`](/reference/exception/terminate.md)関数が呼び出され、プログラムが異常終了する。 -## 例外 -メンバ変数`callback`を`cb`で初期化する際に例外が発生する場合は、その例外を送出する。 ## 例 ```cpp example @@ -95,3 +101,7 @@ int main() - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P0660R10 Stop token and joining thread](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0660r10.pdf) +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/stop_token/stop_callback/op_deduction_guide.md b/reference/stop_token/stop_callback/op_deduction_guide.md index c06304e1e2..e708b172bf 100644 --- a/reference/stop_token/stop_callback/op_deduction_guide.md +++ b/reference/stop_token/stop_callback/op_deduction_guide.md @@ -10,6 +10,7 @@ namespace std { stop_callback(stop_token, CallbackFn) -> stop_callback; } ``` +* stop_token[link ../stop_token.md] ## 概要 [`stop_callback`](../stop_callback.md)クラステンプレートの型推論補助。 diff --git a/reference/stop_token/stop_callback/op_destructor.md b/reference/stop_token/stop_callback/op_destructor.md index 6ac8ded7e3..b366366edd 100644 --- a/reference/stop_token/stop_callback/op_destructor.md +++ b/reference/stop_token/stop_callback/op_destructor.md @@ -10,14 +10,19 @@ ``` ## 効果 -もし所有している停止状態があれば、それに対して登録しているコールバックを解除する。 +[停止可能コールバック登録解除](../stoppable_token.md)を実行する(備考欄を参照)。 + +ほかに停止状態を共有しているオブジェクトがいない場合は、停止状態を扱うために確保したリソースを解放する。 + + +## 備考 +停止可能コールバック登録解除は次のように行われる。 もし自身と同じ停止状態を共有しているほかの[`stop_callback`](../stop_callback.md)が存在してそのコールバックが実行中だったとしても、自身のデストラクタの実行はブロックされない。 もしデストラクタの呼び出し中に自身のコールバックが別のスレッドで実行中だった場合は、そのコールバックの呼び出しから処理が戻るまでは、`stop_callback`のコンストラクタで受け取った関数オブジェクトが破棄されないようにデストラクタの実行がブロックされる。 もしデストラクタの呼び出し中に自身のコールバックが同じスレッドで実行中だった場合は、デストラクタの実行はブロックされない。 -ほかに停止状態を共有しているオブジェクトがいない場合は、停止状態を扱うために確保したリソースを解放する。 ## 例 ```cpp example @@ -129,10 +134,13 @@ int main() ### 言語 - C++20 - ### 処理系 - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P0660R10 Stop token and joining thread](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0660r10.pdf) +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/stop_token/stoppable-source.md b/reference/stop_token/stoppable-source.md index 4c0d61a011..c258860e01 100644 --- a/reference/stop_token/stoppable-source.md +++ b/reference/stop_token/stoppable-source.md @@ -36,7 +36,7 @@ concept stoppable-source = - `request_stop`, `stop_requested`, `stop_possible`メンバ関数の呼び出しはデータ競合を引き起こさない。 - `true`を返す`request_stop`呼び出しは、`stopppable_token`または`stoppable-source`オブジェクトにおける`true`を返す`stop_requested`呼び出しに対して同期する。 - コールバックの登録は、そのコールバック呼び出しに対して同期する。 -- `stoppable-source`が停止状態を持たないとき、`request_stop`は効果をもたず`false`を返す。そうでなければ、関連づけられた停止状態に対して次の停止要求操作を実行する。 +- `stoppable-source`が停止状態を持たないとき、`request_stop`は効果をもたず`false`を返す。そうでなければ、関連づけられた停止状態に対して次の停止要求操作(stop request operation)を実行する。 - 停止要求操作は停止状態が停止要求を受信済みか否かを判定し、未受信であれば停止要求を行う。この判定はアトミックに行われる。 - 停止要求が行われたとき、停止状態に登録されているコールバックが同期的に実行される。コールバック呼び出しが例外で終了した場合、[`terminate`](/reference/exception/terminate.md)が呼び出される。 - 停止要求が行われたとき`request_stop`は`true`を返す。そうでなければ`false`を返す。 From cd9dbc2b3878a99fef580e9008880f6a26ed994a Mon Sep 17 00:00:00 2001 From: suomesta Date: Mon, 7 Apr 2025 20:14:04 +0900 Subject: [PATCH 1515/3948] fix version number. C++11 -> C++20 --- reference/iterator/istreambuf_iterator/op_constructor.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/iterator/istreambuf_iterator/op_constructor.md b/reference/iterator/istreambuf_iterator/op_constructor.md index 9c481c9cff..ca28d5b1e0 100644 --- a/reference/iterator/istreambuf_iterator/op_constructor.md +++ b/reference/iterator/istreambuf_iterator/op_constructor.md @@ -8,7 +8,7 @@ istreambuf_iterator() throw(); // (1) C++03 constexpr istreambuf_iterator() noexcept; // (1) C++11 -constexpr istreambuf_iterator(default_sentinel_t) noexcept; // (2) C++11 +constexpr istreambuf_iterator(default_sentinel_t) noexcept; // (2) C++20 istreambuf_iterator(const istreambuf_iterator&) noexcept = default; // (3) C++11 From d7c766e848e732ca2d2ca2b9ae88b60d26f8f99e Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 10 Apr 2025 16:21:54 +0900 Subject: [PATCH 1516/3948] =?UTF-8?q?C++26:=20=E3=80=8C=E6=A7=8B=E9=80=A0?= =?UTF-8?q?=E5=8C=96=E6=9D=9F=E7=B8=9B=E3=81=A7=E3=83=91=E3=83=83=E3=82=AF?= =?UTF-8?q?=E3=82=92=E5=B0=8E=E5=85=A5=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E3=81=99=E3=82=8B=E3=80=8D=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=20(close=20#1376)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 2 + implementation-status.md | 2 +- lang/cpp17/structured_bindings.md | 3 +- lang/cpp26.md | 2 +- ...tructured_bindings_can_introduce_a_pack.md | 101 ++++++++++++++++++ 5 files changed, 107 insertions(+), 3 deletions(-) create mode 100644 lang/cpp26/structured_bindings_can_introduce_a_pack.md diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index d199d94e0f..fe43d87782 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -295,6 +295,7 @@ * std::is_same_v[link /reference/type_traits/is_same.md] * std::is_same[link /reference/type_traits/is_same.md] * std::true_type[link /reference/type_traits/true_type.md] + * std::decay_t[link /reference/type_traits/decay.md] * [link /reference/typeindex.md] * [link /reference/typeinfo.md] * [link /reference/unordered_map.md] @@ -303,6 +304,7 @@ * std::unordered_set[link /reference/unordered_set/unordered_set.md] * [link /reference/utility.md] * declval[link /reference/utility/declval.md] + * std::forward_like[link /reference/utility/forward_like.md] * std::forward[link /reference/utility/forward.md] * std::make_pair[link /reference/utility/make_pair.md] * std::pair[link /reference/utility/pair.md] diff --git a/implementation-status.md b/implementation-status.md index c36b9e6530..4d1e8e7117 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -316,7 +316,7 @@ | P2686R5: [`constexpr`構造化束縛の許可と、定数式への参照を定数式とする](/lang/cpp26/constexpr_structured_bindings_and_references_to_constexpr_variables.md.nolink) | 定数式に対する構造化束縛を許可し、関連する定数式への参照が定数式になるようにする | 15 | | | | | P3068R6: [定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) | 定数式の文脈での例外の送出と捕捉を許可 | | | | | | P2865R6: [非推奨だった配列の比較を削除](/lang/cpp26/remove_deprecated_array_comparisons.md.nolink) | C++20で非推奨となっていた配列比較を削除 | 15 | 20 | | | -| P1061R10: [構造化束縛でパックを導入できるようにする](/lang/cpp26/structured_bindings_can_introduce_a_pack.md.nolink) | タプルを分解する際に複数の変数をパックとして宣言できるようにする。`auto [a, ...xs] = f();` | | | | | +| P1061R10: [構造化束縛でパックを導入できるようにする](/lang/cpp26/structured_bindings_can_introduce_a_pack.md) | タプルを分解する際に複数の変数をパックとして宣言できるようにする。`auto [a, ...xs] = f();` | | | | | | P3176R0: [先行するカンマのない省略記号を非推奨化](/lang/cpp26/the_oxford_variadic_comma.md.nolink) | `void f(int, ...);`はOK。`void f(int...);`は非推奨 | 15 | 20 | | | | P3074R7: [共用体をトリビアルに未初期化できるようにする](/lang/cpp26/trivial_unions.md.nolink) | `constexpr`での`union U { T storage[N]; };`を許可し、未初期化にできるようにする | | | | | | P2900R14: [契約プログラミングをサポートする](/lang/cpp26/contracts.md.nolink) | 関数の事前条件、事後条件、不変条件を記述できるようにする | | | | | diff --git a/lang/cpp17/structured_bindings.md b/lang/cpp17/structured_bindings.md index 87d0a45a9c..424d317770 100644 --- a/lang/cpp17/structured_bindings.md +++ b/lang/cpp17/structured_bindings.md @@ -341,7 +341,8 @@ auto { w, {x, y}, z } = f(); // このような、tuple内にあるpairを同時 - [C++20 構造化束縛した変数の参照キャプチャを許可](/lang/cpp20/reference_capture_of_structured_bindings.md) - [C++26 構造化束縛への属性を許可](/lang/cpp26/attributes_for_structured_bindings.md) - [C++26 条件式での構造化束縛の使用を許可](/lang/cpp26/structured_binding_declaration_as_a_condition.md) -- [C++26 宣言のみで使用しない変数の名前として_をサポート](/lang/cpp26/nice_placeholder_with_no_name.md) +- [C++26 宣言のみで使用しない変数の名前として`_`をサポート](/lang/cpp26/nice_placeholder_with_no_name.md) +- [C++26 構造化束縛でパックを導入できるようにする](/lang/cpp26/structured_bindings_can_introduce_a_pack.md) ## 参照 diff --git a/lang/cpp26.md b/lang/cpp26.md index 78e08ae95c..66c5dfbd6a 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -18,7 +18,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | [返却された左辺値から暗黙変換された一時オブジェクトが参照に束縛されることを禁止する](/lang/cpp26/disallow_binding_a_returned_glvalue_to_a_temporary.md.nolink) | 寿命切れの変数によって引き起こされるバグを防止する | | [要素数不明の配列を集成体初期化する規則を明確化](/lang/cpp26/clarifying_rules_for_brace_elision_in_aggregate_initialization.md.nolink) | 配列要素の集成体初期化で`{}`が省略された場合の矛盾していた規定を修正 | | [未初期化変数の読み取りをエラー性動作とする](/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md) | 初期化されていない自動変数の読み取りの安全性を規定する | -| [構造化束縛でパックを導入できるようにする](/lang/cpp26/structured_bindings_can_introduce_a_pack.md.nolink) | タプルを分解する際に複数の変数をパックとして宣言できるようにする。`auto [a, ...xs] = f();` | +| [構造化束縛でパックを導入できるようにする](/lang/cpp26/structured_bindings_can_introduce_a_pack.md) | タプルを分解する際に複数の変数をパックとして宣言できるようにする。`auto [a, ...xs] = f();` | ### 文字列 diff --git a/lang/cpp26/structured_bindings_can_introduce_a_pack.md b/lang/cpp26/structured_bindings_can_introduce_a_pack.md new file mode 100644 index 0000000000..a3c27fc986 --- /dev/null +++ b/lang/cpp26/structured_bindings_can_introduce_a_pack.md @@ -0,0 +1,101 @@ +# 構造化束縛でパックを導入できるようにする [P1061R10] +* cpp26[meta cpp] + + + +このページはC++26に採用される見込みの言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 + + + +## 概要 +C++26では、構造化束縛でタプルを分解する際に、パックで受け取れるようになる。 + +```cpp +std::tuple f(); + +auto [x, y, z] = f(); // C++23: OK, C++26: OK +auto [...xs] = f(); // C++26: OK. パックxsは長さ3でX, Y, Zが含まれる +auto [x, ...rest] = f(); // C++26: OK. xはX、パックrestは長さ2でYとZが含まれる +auto [x, y, z, ...rest] = f(); // C++26: OK. restは空のパック +auto [x, ...rest, z] = f(); // C++26: OK. xはX、パックrestは長さ1でYに対応、zはZ +auto [...a, ...b] = f(); // NG: 複数のパックは指定できない +``` + +### std::apply()の実装改善 +タプルを展開して指定した関数の引数として転送して実行する[`std::apply()`](/reference/tuple/apply.md)関数のC++23での実装: + +```cpp +namespace detail { + template + constexpr decltype(auto) apply_impl(F &&f, Tuple &&t, std::index_sequence) + { + return std::invoke(std::forward(f), + std::get(std::forward(t))...); + } +} + +template +constexpr decltype(auto) apply(F &&f, Tuple &&t) +{ + return detail::apply_impl( + std::forward(f), std::forward(t), + std::make_index_sequence>>{}); +} +``` +* std::invoke[link /reference/functional/invoke.md] +* std::get[link /reference/tuple/tuple/get.md] +* std::make_index_sequence[link /reference/utility/make_index_sequence.md] +* std::tuple_size_v[link /reference/tuple/tuple_size.md] + +C++26での実装: + +```cpp +template +constexpr decltype(auto) apply(F &&f, Tuple &&t) +{ + auto&& [...elems] = t; + return std::invoke(std::forward(f), + std::forward_like(elems)...); +} +``` +* std::invoke[link /reference/functional/invoke.md] + + +### 複数のタプルに対して畳み込み式を実行する +C++23の場合: + +```cpp +template +auto dot_product(P p, Q q) { + return std::apply([&](auto... p_elems){ + return std::apply([&](auto... q_elems){ + return (... + (p_elems * q_elems)); + }, q) + }, p); +} +``` +* std::apply[link /reference/tuple/apply.md] + +C++26の場合: + +``` +template +auto dot_product(P p, Q q) { + // applyが必要なくなる + auto&& [...p_elems] = p; + auto&& [...q_elems] = q; + return (... + (p_elems * q_elems)); +} +``` + + +## 関連項目 +- [C++11 可変引数テンプレート](/lang/cpp11/variadic_templates.md) +- [C++17 構造化束縛](/lang/cpp17/structured_bindings.md) + + +## 参照 +- [P1061R10 Structured Bindings can introduce a Pack](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p1061r10.html) \ No newline at end of file From ef98bb04a21a45f4a209da5de3d0866ac5ea227e Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 10 Apr 2025 16:27:01 +0900 Subject: [PATCH 1517/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E3=83=96?= =?UTF-8?q?=E3=83=AD=E3=83=83=E3=82=AF=E3=81=AB=E8=A8=80=E8=AA=9E=E6=8C=87?= =?UTF-8?q?=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26/structured_bindings_can_introduce_a_pack.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp26/structured_bindings_can_introduce_a_pack.md b/lang/cpp26/structured_bindings_can_introduce_a_pack.md index a3c27fc986..5b9018db0a 100644 --- a/lang/cpp26/structured_bindings_can_introduce_a_pack.md +++ b/lang/cpp26/structured_bindings_can_introduce_a_pack.md @@ -81,7 +81,7 @@ auto dot_product(P p, Q q) { C++26の場合: -``` +```cpp template auto dot_product(P p, Q q) { // applyが必要なくなる From c1903808c21645d39a634845685e5f5bf0e84678 Mon Sep 17 00:00:00 2001 From: yoh Date: Sun, 13 Apr 2025 01:08:34 +0900 Subject: [PATCH 1518/3948] execution: sender,sender_in,sender_to (#1384) --- reference/execution/execution.md | 18 ++-- reference/execution/execution/sender.md | 116 +++++++++++++++++++++ reference/execution/execution/sender_in.md | 75 +++++++++++++ reference/execution/execution/sender_to.md | 86 +++++++++++++++ 4 files changed, 286 insertions(+), 9 deletions(-) create mode 100644 reference/execution/execution/sender.md create mode 100644 reference/execution/execution/sender_in.md create mode 100644 reference/execution/execution/sender_to.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 3d788b3195..9decab8778 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -58,12 +58,12 @@ namespace std::execution { |------|------|----------------| | [`execution::scheduler`](execution/scheduler.md.nolink) | Scheduler (concept) | C++26 | -### Reciever +### Receiver | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`execution::receiver`](execution/receiver.md.nolink) | Reciever (concept) | C++26 | -| [`execution::receiver_of`](execution/receiver_of.md.nolink) | 完了ハンドラ指定Reciever (concept) | C++26 | +| [`execution::receiver`](execution/receiver.md.nolink) | Receiver (concept) | C++26 | +| [`execution::receiver_of`](execution/receiver_of.md.nolink) | 完了ハンドラ指定Receiver (concept) | C++26 | | [`execution::set_value`](execution/set_value.md.nolink) | 値による完了関数 (customization point object) | C++26 | | [`execution::set_error`](execution/set_error.md.nolink) | エラーによる完了関数 (customization point object) | C++26 | | [`execution::set_stopped`](execution/set_stopped.md.nolink) | 停止による完了関数 (customization point object) | C++26 | @@ -80,9 +80,9 @@ namespace std::execution { | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`execution::default_domain`](execution/default_domain.md.nolink) | デフォルト実行ドメイン (class) | C++26 | -| [`execution::sender`](execution/sender.md.nolink) | Sender (concept) | C++26 | -| [`execution::sender_in`](execution/sender_in.md.nolink) | 環境に対応するSender (concept) | C++26 | -| [`execution::sender_to`](execution/sender_to.md.nolink) | Recieverに対応するSender (concept) | C++26 | +| [`execution::sender`](execution/sender.md) | Sender型 (concept) | C++26 | +| [`execution::sender_in`](execution/sender_in.md) | 指定環境で有効なSender (concept) | C++26 | +| [`execution::sender_to`](execution/sender_to.md) | 指定Receiverに接続可能なSender (concept) | C++26 | | [`execution::get_completion_signatures`](execution/get_completion_signatures.md.nolink) | 完了シグネチャ取得の問い合わせオブジェクト (customization point object) | C++26 | | [`execution::completion_signatures_of_t`](execution/get_completion_signatures.md.nolink) | Senderから完了シグネチャを取得 (alias template) | C++26 | | [`execution::value_types_of_t`](execution/value_types_of_t.md.nolink) | Senderの値完了型を取得 (alias template) | C++26 | @@ -92,7 +92,7 @@ namespace std::execution { | [`execution::transform_sender`](execution/transform_sender.md.nolink) | Senderを変換 (function template) | C++26 | | [`execution::transform_env`](execution/transform_env.md.nolink) | 問い合わせオブジェクトを変換 (function template) | C++26 | | [`execution::apply_sender`](execution/apply_sender.md.nolink) | Senderにタグ型と引数を適用 (function template) | C++26 | -| [`execution::connect`](execution/connect.md.nolink) | SenderとRecieverを接続 (customization point object) | C++26 | +| [`execution::connect`](execution/connect.md.nolink) | SenderとReceiverを接続 (customization point object) | C++26 | | [`execution::connect_result_t`](execution/connect_result_t.md.nolink) | `connect`結果型を取得 (alias template) | C++26 | ### Senderファクトリ @@ -102,7 +102,7 @@ namespace std::execution { | [`execution::just`](execution/just.md.nolink) | 値を送信するSender (customization point object) | C++26 | | [`execution::just_error`](execution/just_error.md.nolink) | エラーを送信するSender (customization point object) | C++26 | | [`execution::just_stopped`](execution/just_stopped.md.nolink) | 停止を送信するSender (customization point object) | C++26 | -| [`execution::read_env`](execution/read_env.md.nolink) | Reciever環境から構築されるSender (customization point object) | C++26 | +| [`execution::read_env`](execution/read_env.md.nolink) | Receiver環境から構築されるSender (customization point object) | C++26 | | [`execution::schedule`](execution/schedule.md.nolink) | Scheduler上で実行されるSender (customization point object) | C++26 | | [`execution::schedule_result_t`](execution/schedule_result_t.md.nolink) | `schedule`結果型を取得 (alias template) | C++26 | @@ -138,7 +138,7 @@ namespace std::execution { Senderコンシューマは名前空間 `std::this_thread` で定義される。 -### Sender/Recieverユーティリティ +### Sender/Receiverユーティリティ | 名前 | 説明 | 対応バージョン | |------|------|----------------| diff --git a/reference/execution/execution/sender.md b/reference/execution/execution/sender.md new file mode 100644 index 0000000000..1b702b27d8 --- /dev/null +++ b/reference/execution/execution/sender.md @@ -0,0 +1,116 @@ +# sender +* execution[meta header] +* concept[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template + concept sender; + + struct sender_t {}; // タグ型 +} +``` + +## 概要 +`sender`は、型`Sndr`がSender型の要件を満たすことを表すコンセプトである。 + +次のいずれかのクラス型はSenderとみなせる。 + +- `sender_t`をメンバ型`Sndr::sender_concept`として定義するクラス型 +- [コルーチンのAwaitable型](/lang/cpp20/coroutines.md)クラス型 + + +## 要件 +説明専用コンセプト`is-sender`, `enable-sender`、説明用クラステンプレート`env-promise`を以下のように定義する。 + +```cpp +template +concept is-sender = + derived_from; + +template +concept enable-sender = + is-sender || + is-awaitable>>; + +template +struct env-promise : with-await-transform> { + unspecified get_return_object() noexcept; + unspecified initial_suspend() noexcept; + unspecified final_suspend() noexcept; + void unhandled_exception() noexcept; + void return_void() noexcept; + coroutine_handle<> unhandled_stopped() noexcept; + + const Env& get_env() const noexcept; +}; +``` +* is-awaitable[link is-awaitable.md.nolink] +* env[link env.md.nolink] +* derived_from[link /reference/concepts/derived_from.md] +* coroutine_handle[link /reference/coroutine/coroutine_handle.md] +* unspecified[italic] + +`sender`コンセプトは、以下のように定義される。 + +```cpp +template +concept sender = + bool(enable-sender>) && + requires (const remove_cvref_t& sndr) { + { get_env(sndr) } -> queryable; + } && + move_constructible> && + constructible_from, Sndr>; +``` +* get_env[link get_env.md.nolink] +* queryable[link queryable.md.nolink] +* move_constructible[link /reference/concepts/move_constructible.md] +* constructible_from[link /reference/concepts/constructible_from.md] + + +## 備考 +`sender`コンセプトの制約式に現れる第1項`bool(enable-sender<...>)`は[原子制約(atomic contraint)](/lang/cpp20/concepts.md)を構成する。 +これによりオーバーロード解決時の優先順比較のためのにおいて`enable-sender`コンセプトの`||`を単純なOR条件とみなせ、コンパイル時の複雑な包摂関係計算コストを抑制できる。 + + +## 例 +```cpp example +#include +namespace ex = std::execution; + +int main() +{ + // 値42を送信するSender + ex::sender auto sndr = ex::just(42); +} +``` +* ex::sender[color ff0000] +* ex::just[link just.md.nolink] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`sender_in`](sender_in.md) +- [`sender_to`](sender_to.md) +- [コルーチン](/lang/cpp20/coroutines.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/sender_in.md b/reference/execution/execution/sender_in.md new file mode 100644 index 0000000000..43c09e6c45 --- /dev/null +++ b/reference/execution/execution/sender_in.md @@ -0,0 +1,75 @@ +# sender_in +* execution[meta header] +* concept[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template> + concept sender_in = + sender && + queryable && + requires (Sndr&& sndr, Env&& env) { + { get_completion_signatures(std::forward(sndr), std::forward(env)) } + -> valid-completion-signatures; + }; +} +``` +* env<>[link env.md.nolink] +* sender[link sender.md] +* queryable[link queryable.md.nolink] +* get_completion_signatures[link get_completion_signatures.md.nolink] +* valid-completion-signatures[link valid-completion-signatures.md.nolink] + +## 概要 +`sender_in`は、[Sender型](sender.md)`Sndr`が[環境](env.md.nolink)`Env`において非同期操作を作成できること表すコンセプトである。 + + +## モデル +説明用に`sndr`を`decltype((sndr))`が`Sndr`型となる式、`rcvr`を環境`Env`に関連付けられたReceiverと定義する。 + +また、ある完了操作の完了シグネチャが[`completion_signatures_of_t`](completion_signatures_of_t.md.nolink)``で取得される[`completion_signatures`](completion_signatures.md.nolink)リストに含まれるとき、`Sndr`と`Env`における許容可能完了操作(permissible completion)となる。 + +`sndr`と`rcvr`の接続後に操作状態を開始することで評価されうる完了操作が、全て許容可能完了操作(permissible completion)である場合、`Sndr`と`Env`は`sender_in`のモデルとなる。 + + +## 例 +```cpp example +#include +namespace ex = std::execution; + +int main() +{ + ex::sender auto sndr = ex::just(42); + static_assert(ex::sender_in>); +} +``` +* ex::sender_in[color ff0000] +* ex::sender[link sender.md] +* ex::just[link just.md.nolink] +* ex::env<>[link env.md.nolink] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`sender`](sender.md) +- [`env`](env.md.nolink) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/sender_to.md b/reference/execution/execution/sender_to.md new file mode 100644 index 0000000000..c6d31bc3b5 --- /dev/null +++ b/reference/execution/execution/sender_to.md @@ -0,0 +1,86 @@ +# sender_to +* execution[meta header] +* concept[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template + concept sender_to = + sender_in> && + receiver_of>> && + requires (Sndr&& sndr, Rcvr&& rcvr) { + connect(std::forward(sndr), std::forward(rcvr)); + }; +} +``` +* sender_in[link sender_in.md] +* env_of_t[link env_of_t.md.nolink] +* receiver_of[link receiver_of.md.nolink] +* completion_signatures_of_t[link completion_signatures_of_t.md.nolink] +* connect[link connect.md.nolink] + +## 概要 +`sender_to`は、[Sender型](sender.md)`Sndr`が[Receiver型](receiver.md.nolink)`Rcvr`と接続可能であること表すコンセプトである。 + + +## 例 +```cpp example +#include +#include +namespace ex = stdexec; + +struct ValueReceiver { + using receiver_concept = ex::receiver_t; + + void set_value(int v) noexcept + { + std::println("{}", v); + } +}; + +int main() +{ + // 値42を送信するSender + ex::sender auto sndr = ex::just(42); + static_assert(ex::sender_to); + + // int値を受信して表示するReceiver + ValueReceiver rcvr; + + // SenderとReceiver接続後にOperationStateを開始 + ex::operation_state auto op = ex::connect(sndr, rcvr); + ex::start(op); +} +``` +* ex::sender_to[color ff0000] +* ex::just[link just.md.nolink] +* ex::operation_state[link operation_state.md.nolink] +* ex::connect[link connect.md.nolink] +* ex::start[link start.md.nolink] + +### 出力 +``` +42 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`sender`](sender.md) +- [`receiver`](receiver.md.nolink) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) From efc107008c743b1a01d9eae08fb4788c8117bd1f Mon Sep 17 00:00:00 2001 From: yoh Date: Sun, 13 Apr 2025 01:25:01 +0900 Subject: [PATCH 1519/3948] =?UTF-8?q?execution/sender=5F*:=20=E5=BE=AE?= =?UTF-8?q?=E8=AA=BF=E6=95=B4=20(#1384)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/execution/execution/sender.md | 10 +++++----- reference/execution/execution/sender_in.md | 10 +++++----- reference/execution/execution/sender_to.md | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/reference/execution/execution/sender.md b/reference/execution/execution/sender.md index 1b702b27d8..671e7c6ccc 100644 --- a/reference/execution/execution/sender.md +++ b/reference/execution/execution/sender.md @@ -48,9 +48,9 @@ struct env-promise : with-await-transform> { }; ``` * is-awaitable[link is-awaitable.md.nolink] -* env[link env.md.nolink] +* env<>[link env.md.nolink] * derived_from[link /reference/concepts/derived_from.md] -* coroutine_handle[link /reference/coroutine/coroutine_handle.md] +* coroutine_handle<>[link /reference/coroutine/coroutine_handle.md] * unspecified[italic] `sender`コンセプトは、以下のように定義される。 @@ -73,7 +73,7 @@ concept sender = ## 備考 `sender`コンセプトの制約式に現れる第1項`bool(enable-sender<...>)`は[原子制約(atomic contraint)](/lang/cpp20/concepts.md)を構成する。 -これによりオーバーロード解決時の優先順比較のためのにおいて`enable-sender`コンセプトの`||`を単純なOR条件とみなせ、コンパイル時の複雑な包摂関係計算コストを抑制できる。 +これによりオーバーロード解決時の優先順比較において`enable-sender`コンセプトの`||`を単純なOR条件とみなせ、コンパイル時の複雑な包摂関係計算コストを抑制できる。 ## 例 @@ -107,8 +107,8 @@ int main() ## 関連項目 -- [`sender_in`](sender_in.md) -- [`sender_to`](sender_to.md) +- [`execution::sender_in`](sender_in.md) +- [`execution::sender_to`](sender_to.md) - [コルーチン](/lang/cpp20/coroutines.md) diff --git a/reference/execution/execution/sender_in.md b/reference/execution/execution/sender_in.md index 43c09e6c45..9bc2fbbab8 100644 --- a/reference/execution/execution/sender_in.md +++ b/reference/execution/execution/sender_in.md @@ -27,11 +27,11 @@ namespace std::execution { ## モデル -説明用に`sndr`を`decltype((sndr))`が`Sndr`型となる式、`rcvr`を環境`Env`に関連付けられたReceiverと定義する。 +説明用に`sndr`を`decltype((sndr))`が`Sndr`型となる式、`rcvr`を環境`Env`に関連付けられた[Receiver](receiver.md.nolink)とする。 -また、ある完了操作の完了シグネチャが[`completion_signatures_of_t`](completion_signatures_of_t.md.nolink)``で取得される[`completion_signatures`](completion_signatures.md.nolink)リストに含まれるとき、`Sndr`と`Env`における許容可能完了操作(permissible completion)となる。 +また、ある完了操作の完了シグネチャが[`completion_signatures_of_t`](completion_signatures_of_t.md.nolink)``で取得される[`completion_signatures`](completion_signatures.md.nolink)リストに含まれるとき、`Sndr`と`Env`における許容可能完了(permissible completion)となる。 -`sndr`と`rcvr`の接続後に操作状態を開始することで評価されうる完了操作が、全て許容可能完了操作(permissible completion)である場合、`Sndr`と`Env`は`sender_in`のモデルとなる。 +`sndr`と`rcvr`の接続後に[Operation State](operation_state.md.nolink)を開始することで評価されうる完了操作が、全て許容可能完了(permissible completion)である場合、`Sndr`と`Env`は`sender_in`のモデルとなる。 ## 例 @@ -67,8 +67,8 @@ int main() ## 関連項目 -- [`sender`](sender.md) -- [`env`](env.md.nolink) +- [`execution::sender`](sender.md) +- [`execution::env`](env.md.nolink) ## 参照 diff --git a/reference/execution/execution/sender_to.md b/reference/execution/execution/sender_to.md index c6d31bc3b5..4bbde047b7 100644 --- a/reference/execution/execution/sender_to.md +++ b/reference/execution/execution/sender_to.md @@ -49,7 +49,7 @@ int main() // int値を受信して表示するReceiver ValueReceiver rcvr; - // SenderとReceiver接続後にOperationStateを開始 + // SenderとReceiver接続後にOperation Stateを開始 ex::operation_state auto op = ex::connect(sndr, rcvr); ex::start(op); } @@ -78,8 +78,8 @@ int main() ## 関連項目 -- [`sender`](sender.md) -- [`receiver`](receiver.md.nolink) +- [`execution::sender`](sender.md) +- [`execution::receiver`](receiver.md.nolink) ## 参照 From 3e8c7c755f38a9dfdd76adb535addd85b51f369a Mon Sep 17 00:00:00 2001 From: yoh Date: Sun, 13 Apr 2025 14:48:15 +0900 Subject: [PATCH 1520/3948] execution: receiver,receiver_of (#1384) --- reference/execution/execution.md | 4 +- reference/execution/execution/receiver.md | 78 ++++++++++++++++ reference/execution/execution/receiver_of.md | 96 ++++++++++++++++++++ reference/execution/execution/sender_in.md | 4 +- reference/execution/execution/sender_to.md | 9 +- working_style.md | 1 + 6 files changed, 184 insertions(+), 8 deletions(-) create mode 100644 reference/execution/execution/receiver.md create mode 100644 reference/execution/execution/receiver_of.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 9decab8778..27f6d74f6a 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -62,8 +62,8 @@ namespace std::execution { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`execution::receiver`](execution/receiver.md.nolink) | Receiver (concept) | C++26 | -| [`execution::receiver_of`](execution/receiver_of.md.nolink) | 完了ハンドラ指定Receiver (concept) | C++26 | +| [`execution::receiver`](execution/receiver.md) | Receiver型 (concept) | C++26 | +| [`execution::receiver_of`](execution/receiver_of.md) | 完了シグネチャ集合を持つReceiver (concept) | C++26 | | [`execution::set_value`](execution/set_value.md.nolink) | 値による完了関数 (customization point object) | C++26 | | [`execution::set_error`](execution/set_error.md.nolink) | エラーによる完了関数 (customization point object) | C++26 | | [`execution::set_stopped`](execution/set_stopped.md.nolink) | 停止による完了関数 (customization point object) | C++26 | diff --git a/reference/execution/execution/receiver.md b/reference/execution/execution/receiver.md new file mode 100644 index 0000000000..b611d9882c --- /dev/null +++ b/reference/execution/execution/receiver.md @@ -0,0 +1,78 @@ +# receiver +* execution[meta header] +* concept[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template + concept receiver = + derived_from::receiver_concept, receiver_t> && + requires(const remove_cvref_t& rcvr) { + { get_env(rcvr) } -> queryable; + } && + move_constructible> && + constructible_from, Rcvr>; + + struct receiver_t {}; // タグ型 +} +``` +* get_env[link get_env.md.nolink] +* queryable[link queryable.md.nolink] +* derived_from[link /reference/concepts/derived_from.md] +* move_constructible[link /reference/concepts/move_constructible.md] +* constructible_from[link /reference/concepts/constructible_from.md] + +## 概要 +`receiver`は、型`Rcvr`がReceiver型の要件を満たすことを表すコンセプトである。 + +`receiver_t`をメンバ型`Rcvr::receiver_concept`として定義するクラス型はReceiverとみなせる。 + + +## モデル +`final`指定されたクラス型は`receiver`のモデルではない。 + + +## 例 +```cpp example +#include +namespace ex = std::execution; + +struct SinkReceiver { + using receiver_concept = ex::receiver_t; + + void set_value(auto&&...) noexcept {} + void set_error(auto&&) noexcept {} + void set_stopped() noexcept {} +}; + +int main() +{ + static_assert(ex::receiver); +} +``` +* ex::receiver[color ff0000] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::receiver_of`](receiver_of.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/receiver_of.md b/reference/execution/execution/receiver_of.md new file mode 100644 index 0000000000..d2093b3dd3 --- /dev/null +++ b/reference/execution/execution/receiver_of.md @@ -0,0 +1,96 @@ +# receiver_of +* execution[meta header] +* concept[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template + concept receiver_of; +} +``` + +## 概要 +`receiver_of`は、[Receiver型](receiver.md)`Rcvr`が完了シグネチャの集合`Completions`に適合することを表すコンセプトである。 + + +## 要件 +説明専用コンセプト`valid-completion-for`, `has-completions`を以下のように定義する。 + +```cpp +template +concept valid-completion-for = + requires (Signature* sig) { + [](Tag(*)(Args...)) + requires callable, Args...> + {}(sig); + }; + +template +concept has-completions = + requires (Completions* completions) { + []...Sigs>(completion_signatures*) + {}(completions); + }; +``` +* callable[link /reference/functional/callable.md.nolink] +* completion_signatures[link completion_signatures.md.nolink] + +`receiver_of`コンセプトは、以下のように定義される。 + +```cpp +template +concept receiver_of = + receiver && has-completions; +``` +* receiver[link receiver.md] + + +## 例 +```cpp example +#include +namespace ex = std::execution; + +struct ValueReceiver { + using receiver_concept = ex::receiver_t; + + void set_value(int) noexcept; +}; + +int main() +{ + // 完了操作ex::set_value(int)に対応 + static_assert(ex::receiver_of>); + + // 完了操作ex::set_value(int, int)には非対応 + static_assert(not ex::receiver_of>); +} +``` +* ex::receiver_of[color ff0000] +* ex::completion_signatures[link completion_signatures.md.nolink] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::receiver`](receiver.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/sender_in.md b/reference/execution/execution/sender_in.md index 9bc2fbbab8..6ec847e709 100644 --- a/reference/execution/execution/sender_in.md +++ b/reference/execution/execution/sender_in.md @@ -23,11 +23,11 @@ namespace std::execution { * valid-completion-signatures[link valid-completion-signatures.md.nolink] ## 概要 -`sender_in`は、[Sender型](sender.md)`Sndr`が[環境](env.md.nolink)`Env`において非同期操作を作成できること表すコンセプトである。 +`sender_in`は、[Sender型](sender.md)`Sndr`が[環境](env.md.nolink)`Env`において非同期操作を作成できることを表すコンセプトである。 ## モデル -説明用に`sndr`を`decltype((sndr))`が`Sndr`型となる式、`rcvr`を環境`Env`に関連付けられた[Receiver](receiver.md.nolink)とする。 +説明用に`sndr`を`decltype((sndr))`が`Sndr`型となる式、`rcvr`を環境`Env`に関連付けられた[Receiver](receiver.md)とする。 また、ある完了操作の完了シグネチャが[`completion_signatures_of_t`](completion_signatures_of_t.md.nolink)``で取得される[`completion_signatures`](completion_signatures.md.nolink)リストに含まれるとき、`Sndr`と`Env`における許容可能完了(permissible completion)となる。 diff --git a/reference/execution/execution/sender_to.md b/reference/execution/execution/sender_to.md index 4bbde047b7..ae91b656a0 100644 --- a/reference/execution/execution/sender_to.md +++ b/reference/execution/execution/sender_to.md @@ -17,19 +17,19 @@ namespace std::execution { ``` * sender_in[link sender_in.md] * env_of_t[link env_of_t.md.nolink] -* receiver_of[link receiver_of.md.nolink] +* receiver_of[link receiver_of.md] * completion_signatures_of_t[link completion_signatures_of_t.md.nolink] * connect[link connect.md.nolink] ## 概要 -`sender_to`は、[Sender型](sender.md)`Sndr`が[Receiver型](receiver.md.nolink)`Rcvr`と接続可能であること表すコンセプトである。 +`sender_to`は、[Sender型](sender.md)`Sndr`が[Receiver型](receiver.md)`Rcvr`と接続可能であることを表すコンセプトである。 ## 例 ```cpp example #include #include -namespace ex = stdexec; +namespace ex = std::execution; struct ValueReceiver { using receiver_concept = ex::receiver_t; @@ -55,6 +55,7 @@ int main() } ``` * ex::sender_to[color ff0000] +* ex::sender[link sender.md] * ex::just[link just.md.nolink] * ex::operation_state[link operation_state.md.nolink] * ex::connect[link connect.md.nolink] @@ -79,7 +80,7 @@ int main() ## 関連項目 - [`execution::sender`](sender.md) -- [`execution::receiver`](receiver.md.nolink) +- [`execution::receiver`](receiver.md) ## 参照 diff --git a/working_style.md b/working_style.md index 771c89b918..e1b6820e7f 100644 --- a/working_style.md +++ b/working_style.md @@ -70,6 +70,7 @@ C++11以降対応については対応バージョンを明記します。バー | base class | 基底クラス | | bidirectional iterator | 双方向イテレータ | | bucket | バケット | +| completion operation | 完了操作 | | completion signature | 完了シグネチャ | | complexity | 計算量 | | compound type | 複合型 | From 2b4f515d6dfc34bc27456f9cd7545cc12be25ccb Mon Sep 17 00:00:00 2001 From: yoh Date: Sun, 13 Apr 2025 16:06:09 +0900 Subject: [PATCH 1521/3948] execution: completion_signatures(_of_t) (#1384) --- reference/execution/execution.md | 8 +- .../execution/completion_signatures.md | 76 +++++++++++++++++++ .../execution/completion_signatures_of_t.md | 36 +++++++++ reference/execution/execution/receiver_of.md | 6 +- reference/execution/execution/sender_in.md | 2 +- reference/execution/execution/sender_to.md | 2 +- 6 files changed, 121 insertions(+), 9 deletions(-) create mode 100644 reference/execution/execution/completion_signatures.md create mode 100644 reference/execution/execution/completion_signatures_of_t.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 27f6d74f6a..bb710c76c3 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -63,7 +63,7 @@ namespace std::execution { | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`execution::receiver`](execution/receiver.md) | Receiver型 (concept) | C++26 | -| [`execution::receiver_of`](execution/receiver_of.md) | 完了シグネチャ集合を持つReceiver (concept) | C++26 | +| [`execution::receiver_of`](execution/receiver_of.md) | 指定完了シグネチャ集合に適合するReceiver (concept) | C++26 | | [`execution::set_value`](execution/set_value.md.nolink) | 値による完了関数 (customization point object) | C++26 | | [`execution::set_error`](execution/set_error.md.nolink) | エラーによる完了関数 (customization point object) | C++26 | | [`execution::set_stopped`](execution/set_stopped.md.nolink) | 停止による完了関数 (customization point object) | C++26 | @@ -83,8 +83,8 @@ namespace std::execution { | [`execution::sender`](execution/sender.md) | Sender型 (concept) | C++26 | | [`execution::sender_in`](execution/sender_in.md) | 指定環境で有効なSender (concept) | C++26 | | [`execution::sender_to`](execution/sender_to.md) | 指定Receiverに接続可能なSender (concept) | C++26 | -| [`execution::get_completion_signatures`](execution/get_completion_signatures.md.nolink) | 完了シグネチャ取得の問い合わせオブジェクト (customization point object) | C++26 | -| [`execution::completion_signatures_of_t`](execution/get_completion_signatures.md.nolink) | Senderから完了シグネチャを取得 (alias template) | C++26 | +| [`execution::get_completion_signatures`](execution/get_completion_signatures.md.nolink) | 完了シグネチャ集合取得の問い合わせオブジェクト (customization point object) | C++26 | +| [`execution::completion_signatures_of_t`](execution/completion_signatures_of_t.md) | Senderから完了シグネチャ集合を取得 (alias template) | C++26 | | [`execution::value_types_of_t`](execution/value_types_of_t.md.nolink) | Senderの値完了型を取得 (alias template) | C++26 | | [`execution::error_types_of_t`](execution/error_types_of_t.md.nolink) | Senderのエラー完了型を取得 (alias template) | C++26 | | [`execution::sends_stopped`](execution/value_types_of_t.md.nolink) | Senderが停止完了に対応するか否か (variable template) | C++26 | @@ -142,7 +142,7 @@ Senderコンシューマは名前空間 `std::this_thread` で定義される。 | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`execution::completion_signatures`](execution/completion_signatures.md.nolink) | 完了シグネチャ (class template) | C++26 | +| [`execution::completion_signatures`](execution/completion_signatures.md) | 完了シグネチャ集合を表現する型 (class template) | C++26 | | [`execution::transform_completion_signatures`](execution/transform_completion_signatures.md.nolink) | 完了シグネチャを変換 (alias template) | C++26 | | [`execution::transform_completion_signatures_of`](execution/transform_completion_signatures_of.md.nolink) | 完了シグネチャを変換 (alias template) | C++26 | | [`execution::run_loop`](execution/run_loop.md.nolink) | 実行ループ (class) | C++26 | diff --git a/reference/execution/execution/completion_signatures.md b/reference/execution/execution/completion_signatures.md new file mode 100644 index 0000000000..1db91919a5 --- /dev/null +++ b/reference/execution/execution/completion_signatures.md @@ -0,0 +1,76 @@ +# completion_signatures +* execution[meta header] +* class template[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template + struct completion_signatures {}; +} +``` + +## 概要 +`completion_signatures`クラステンプレートは、完了シグネチャの集合をテンプレートパラメータとして表現する。 + + +## テンプレートパラメータ制約 +`Fns`の各要素`Fn`が、下記の説明専用コンセプト`completion-signature`を満たすこと。 + +```cpp +template +concept completion-signature = see below; +``` +* see below[italic] + +型`Fn`が下記いずれかを満たす関数型であるとき、`Fn`はコンセプト`completion-signature`を満たす。 +- `set_value_t(Vs...)`(`Vs`はオブジェクト型または参照型のパック) +- `set_error_t(Err)`(`Err`はオブジェクト型または参照型) +- `set_stopped_t()` + + +## 例 +```cpp example +#include +namespace ex = std::execution; + +int main() +{ + // 下記の完了操作をサポートする + // 値完了 ex::set_value(int), ex::set_value(int, int) + // エラー完了 ex::set_error(std::exception_ptr) + // 停止完了 ex::set_stopped() + using Sigs = ex::completion_signatures< + ex::set_value_t(int), + ex::set_value_t(int, int), + ex::set_error_t(std::exception_ptr), + ex::set_stopped_t() + >; +} +``` +* ex::completion_signatures[color ff0000] +* std::exception_ptr[link /reference/exception/exception_ptr.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::receiver`](receiver.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/completion_signatures_of_t.md b/reference/execution/execution/completion_signatures_of_t.md new file mode 100644 index 0000000000..6a4fc20090 --- /dev/null +++ b/reference/execution/execution/completion_signatures_of_t.md @@ -0,0 +1,36 @@ +# completion_signatures_of_t +* execution[meta header] +* std::execution[meta namespace] +* type-alias[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template> + requires sender_in + using completion_signatures_of_t = call-result-t; +} +``` +* env<>[link env.md.nolink] +* sender_in[link sender_in.md] +* call-result-t[link call-result-t.md.nolink] +* sender_in[link sender_in.md] + +## 概要 + +[Sender型](sender.md)`Sndr`から[環境](env.md.nolink)`Env`における[完了シグネチャ集合](completion_signatures.md)を取得する。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/receiver_of.md b/reference/execution/execution/receiver_of.md index d2093b3dd3..e030a93fb3 100644 --- a/reference/execution/execution/receiver_of.md +++ b/reference/execution/execution/receiver_of.md @@ -12,7 +12,7 @@ namespace std::execution { ``` ## 概要 -`receiver_of`は、[Receiver型](receiver.md)`Rcvr`が完了シグネチャの集合`Completions`に適合することを表すコンセプトである。 +`receiver_of`は、[Receiver型](receiver.md)`Rcvr`が[完了シグネチャ集合](completion_signatures.md)`Completions`に適合することを表すコンセプトである。 ## 要件 @@ -35,7 +35,7 @@ concept has-completions = }; ``` * callable[link /reference/functional/callable.md.nolink] -* completion_signatures[link completion_signatures.md.nolink] +* completion_signatures[link completion_signatures.md] `receiver_of`コンセプトは、以下のように定義される。 @@ -70,7 +70,7 @@ int main() } ``` * ex::receiver_of[color ff0000] -* ex::completion_signatures[link completion_signatures.md.nolink] +* ex::completion_signatures[link completion_signatures.md] ### 出力 ``` diff --git a/reference/execution/execution/sender_in.md b/reference/execution/execution/sender_in.md index 6ec847e709..00c8523b10 100644 --- a/reference/execution/execution/sender_in.md +++ b/reference/execution/execution/sender_in.md @@ -29,7 +29,7 @@ namespace std::execution { ## モデル 説明用に`sndr`を`decltype((sndr))`が`Sndr`型となる式、`rcvr`を環境`Env`に関連付けられた[Receiver](receiver.md)とする。 -また、ある完了操作の完了シグネチャが[`completion_signatures_of_t`](completion_signatures_of_t.md.nolink)``で取得される[`completion_signatures`](completion_signatures.md.nolink)リストに含まれるとき、`Sndr`と`Env`における許容可能完了(permissible completion)となる。 +また、ある完了操作の完了シグネチャが[`completion_signatures_of_t`](completion_signatures_of_t.md)``で取得される[`completion_signatures`](completion_signatures.md)リストに含まれるとき、`Sndr`と`Env`における許容可能完了(permissible completion)となる。 `sndr`と`rcvr`の接続後に[Operation State](operation_state.md.nolink)を開始することで評価されうる完了操作が、全て許容可能完了(permissible completion)である場合、`Sndr`と`Env`は`sender_in`のモデルとなる。 diff --git a/reference/execution/execution/sender_to.md b/reference/execution/execution/sender_to.md index ae91b656a0..1fe7b90556 100644 --- a/reference/execution/execution/sender_to.md +++ b/reference/execution/execution/sender_to.md @@ -18,7 +18,7 @@ namespace std::execution { * sender_in[link sender_in.md] * env_of_t[link env_of_t.md.nolink] * receiver_of[link receiver_of.md] -* completion_signatures_of_t[link completion_signatures_of_t.md.nolink] +* completion_signatures_of_t[link completion_signatures_of_t.md] * connect[link connect.md.nolink] ## 概要 From 23cf8aa3b6c28c7bbe7d08ddaec5bd077cf3b0e4 Mon Sep 17 00:00:00 2001 From: yoh Date: Sun, 13 Apr 2025 17:07:04 +0900 Subject: [PATCH 1522/3948] execution: operation_state (#1384) --- reference/execution/execution.md | 2 +- .../execution/execution/operation_state.md | 91 +++++++++++++++++++ reference/execution/execution/sender_in.md | 2 +- reference/execution/execution/sender_to.md | 5 +- working_style.md | 1 + 5 files changed, 97 insertions(+), 4 deletions(-) create mode 100644 reference/execution/execution/operation_state.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index bb710c76c3..2e8c817707 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -72,7 +72,7 @@ namespace std::execution { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`execution::operation_state`](execution/operation_state.md.nolink) | Operation State (concept) | C++26 | +| [`execution::operation_state`](execution/operation_state.md) | Operation State型 (concept) | C++26 | | [`execution::start`](execution/start.md.nolink) | 非同期操作の開始 (customization point object) | C++26 | ### Sender diff --git a/reference/execution/execution/operation_state.md b/reference/execution/execution/operation_state.md new file mode 100644 index 0000000000..c5c20037bf --- /dev/null +++ b/reference/execution/execution/operation_state.md @@ -0,0 +1,91 @@ +# operation_state +* execution[meta header] +* concept[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template + concept operation_state = + derived_from && + is_object_v && + requires (O& o) { + { start(o) } noexcept; + }; + + struct operation_state_t {}; // タグ型 +} +``` +* derived_from[link /reference/concepts/derived_from.md] +* is_object_v[link /reference/type_traits/is_object.md] +* start[link start.md.nolink] + +## 概要 +`operation_state`は、型`O`がOperation State型の要件を満たすことを表すコンセプトである。 + +下記をみたすクラス型はOperation Stateとみなせる。 + +- `operation_state_t`をメンバ型`O::operation_state_concept`として定義するクラス型 +- `O`型の左辺値`o`に対して`execution::start(o)`が有効な式かつ例外送出されないこと + +非同期操作の生存期間中に`operation_state`オブジェクトが破棄されると、未定義の動作を引き起こす。 + + +## 例 +```cpp +#include +#include +namespace ex = std::execution; + +struct ValueReceiver { + using receiver_concept = ex::receiver_t; + + void set_value(int v) noexcept + { + std::println("{}", v); + } +}; + +int main() +{ + // 値42を送信するSender + ex::sender auto sndr = ex::just(42); + // int値を受信して表示するReceiver + ValueReceiver rcvr; + + // SenderとReceiverを接続 + ex::operation_state auto op = ex::connect(sndr, rcvr); + // Operation Stateを開始 + ex::start(op); +} +``` +* ex::operation_state[color ff0000] +* ex::sender[link sender.md] +* ex::just[link just.md.nolink] +* ex::connect[link connect.md.nolink] +* ex::start[link start.md.nolink] + +### 出力 +``` +42 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::connect`](connect.md.nolink) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/sender_in.md b/reference/execution/execution/sender_in.md index 00c8523b10..c5d35fd1bf 100644 --- a/reference/execution/execution/sender_in.md +++ b/reference/execution/execution/sender_in.md @@ -31,7 +31,7 @@ namespace std::execution { また、ある完了操作の完了シグネチャが[`completion_signatures_of_t`](completion_signatures_of_t.md)``で取得される[`completion_signatures`](completion_signatures.md)リストに含まれるとき、`Sndr`と`Env`における許容可能完了(permissible completion)となる。 -`sndr`と`rcvr`の接続後に[Operation State](operation_state.md.nolink)を開始することで評価されうる完了操作が、全て許容可能完了(permissible completion)である場合、`Sndr`と`Env`は`sender_in`のモデルとなる。 +`sndr`と`rcvr`の接続後に[Operation State](operation_state.md)を開始することで評価されうる完了操作が、全て許容可能完了(permissible completion)である場合、`Sndr`と`Env`は`sender_in`のモデルとなる。 ## 例 diff --git a/reference/execution/execution/sender_to.md b/reference/execution/execution/sender_to.md index 1fe7b90556..84fc45ba8e 100644 --- a/reference/execution/execution/sender_to.md +++ b/reference/execution/execution/sender_to.md @@ -49,15 +49,16 @@ int main() // int値を受信して表示するReceiver ValueReceiver rcvr; - // SenderとReceiver接続後にOperation Stateを開始 + // SenderとReceiverを接続 ex::operation_state auto op = ex::connect(sndr, rcvr); + // Operation Stateを開始 ex::start(op); } ``` * ex::sender_to[color ff0000] * ex::sender[link sender.md] * ex::just[link just.md.nolink] -* ex::operation_state[link operation_state.md.nolink] +* ex::operation_state[link operation_state.md] * ex::connect[link connect.md.nolink] * ex::start[link start.md.nolink] diff --git a/working_style.md b/working_style.md index e1b6820e7f..88d0da3a79 100644 --- a/working_style.md +++ b/working_style.md @@ -67,6 +67,7 @@ C++11以降対応については対応バージョンを明記します。バー | apply, application | 適用 | | arithmetic type | 算術型 | | associative container(s) | 連想コンテナ | +| asynchronous operation | 非同期操作 | | base class | 基底クラス | | bidirectional iterator | 双方向イテレータ | | bucket | バケット | From a7e53aef7e9ce247a1032acc329f68bce4f14ba0 Mon Sep 17 00:00:00 2001 From: yoh Date: Sun, 13 Apr 2025 17:47:15 +0900 Subject: [PATCH 1523/3948] execution: scheduler (#1384) --- reference/execution/execution.md | 2 +- .../execution/execution/operation_state.md | 2 +- reference/execution/execution/scheduler.md | 80 +++++++++++++++++++ 3 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 reference/execution/execution/scheduler.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 2e8c817707..1814d74cdc 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -56,7 +56,7 @@ namespace std::execution { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`execution::scheduler`](execution/scheduler.md.nolink) | Scheduler (concept) | C++26 | +| [`execution::scheduler`](execution/scheduler.md) | Scheduler型 (concept) | C++26 | ### Receiver diff --git a/reference/execution/execution/operation_state.md b/reference/execution/execution/operation_state.md index c5c20037bf..09d93bb901 100644 --- a/reference/execution/execution/operation_state.md +++ b/reference/execution/execution/operation_state.md @@ -27,7 +27,7 @@ namespace std::execution { 下記をみたすクラス型はOperation Stateとみなせる。 - `operation_state_t`をメンバ型`O::operation_state_concept`として定義するクラス型 -- `O`型の左辺値`o`に対して`execution::start(o)`が有効な式かつ例外送出されないこと +- `O`型の左辺値`o`に対して[`execution::start`](start.md.nolink)`(o)`が有効な式かつ例外送出されないこと 非同期操作の生存期間中に`operation_state`オブジェクトが破棄されると、未定義の動作を引き起こす。 diff --git a/reference/execution/execution/scheduler.md b/reference/execution/execution/scheduler.md new file mode 100644 index 0000000000..3641577706 --- /dev/null +++ b/reference/execution/execution/scheduler.md @@ -0,0 +1,80 @@ +# scheduler +* execution[meta header] +* concept[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template + concept scheduler = + derived_from::scheduler_concept, scheduler_t> && + queryable && + requires(Sch&& sch) { + { schedule(std::forward(sch)) } -> sender; + { auto(get_completion_scheduler( + get_env(schedule(std::forward(sch))))) } + -> same_as>; + } && + equality_comparable> && + copyable>; + + struct scheduler_t {}; // タグ型 +} +``` +* derived_from[link /reference/concepts/derived_from.md] +* queryable[link queryable.md.nolink] +* get_completion_scheduler[link get_completion_scheduler.md.nolink] +* get_env[link get_env.md.nolink] +* equality_comparable[link /reference/concepts/equality_comparable.md] +* copyable[link /reference/concepts/copyable.md] + +## 概要 +`scheduler`は、型`Sch`がScheduler型の要件を満たすことを表すコンセプトである。 + +下記をみたすクラス型はSchedulerとみなせる。 + +- `scheduler_t`をメンバ型`Sch::scheduler_concept`として定義するクラス型 +- [問い合わせ可能](queryable.md.nolink)であること +- `Sch`型の値`sch`に対して下記が有効な式であること + - [`execution::schedule`](schedule.md.nolink)`(sch)`が[Sender](sender.md)を返すこと + - [`execution::get_completion_scheduler`](get_completion_scheduler.md.nolink)`(`[`execution::get_env`](get_env.md.nolink)`(`[`execution::schedule`](schedule.md.nolink)`(sch)))`の結果が`Sch`型に等しいこと + + +## 例 +```cpp example +#include +namespace ex = std::execution; + +int main() +{ + ex::run_loop loop; + ex::scheduler auto sch = loop.get_scheduler(); +} +``` +* ex::scheduler[color ff0000] +* ex::run_loop[link run_loop.md.nolink] +* get_scheduler()[link run_loop/get_scheduler.md.nolink] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::schedule`](schedule.md.nolink) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) From 4220eb12586f2a76d36d7fa6533bb4f78944eaa7 Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 14 Apr 2025 16:37:11 +0900 Subject: [PATCH 1524/3948] execution: set_value,set_error,set_stopped (#1384) --- reference/execution/execution.md | 6 +- .../execution/completion_signatures.md | 12 ++- .../execution/execution/operation_state.md | 1 + reference/execution/execution/receiver_of.md | 30 +++++-- reference/execution/execution/scheduler.md | 4 +- reference/execution/execution/sender_in.md | 9 +- reference/execution/execution/sender_to.md | 3 +- reference/execution/execution/set_error.md | 84 +++++++++++++++++++ reference/execution/execution/set_stopped.md | 84 +++++++++++++++++++ reference/execution/execution/set_value.md | 84 +++++++++++++++++++ working_style.md | 2 + 11 files changed, 303 insertions(+), 16 deletions(-) create mode 100644 reference/execution/execution/set_error.md create mode 100644 reference/execution/execution/set_stopped.md create mode 100644 reference/execution/execution/set_value.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 1814d74cdc..920223549d 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -64,9 +64,9 @@ namespace std::execution { |------|------|----------------| | [`execution::receiver`](execution/receiver.md) | Receiver型 (concept) | C++26 | | [`execution::receiver_of`](execution/receiver_of.md) | 指定完了シグネチャ集合に適合するReceiver (concept) | C++26 | -| [`execution::set_value`](execution/set_value.md.nolink) | 値による完了関数 (customization point object) | C++26 | -| [`execution::set_error`](execution/set_error.md.nolink) | エラーによる完了関数 (customization point object) | C++26 | -| [`execution::set_stopped`](execution/set_stopped.md.nolink) | 停止による完了関数 (customization point object) | C++26 | +| [`execution::set_value`](execution/set_value.md) | 値完了関数 (customization point object) | C++26 | +| [`execution::set_error`](execution/set_error.md) | エラー完了関数 (customization point object) | C++26 | +| [`execution::set_stopped`](execution/set_stopped.md) | 停止完了関数 (customization point object) | C++26 | ### Operation State diff --git a/reference/execution/execution/completion_signatures.md b/reference/execution/execution/completion_signatures.md index 1db91919a5..b45088cbbc 100644 --- a/reference/execution/execution/completion_signatures.md +++ b/reference/execution/execution/completion_signatures.md @@ -25,9 +25,9 @@ concept completion-signature = see below; * see below[italic] 型`Fn`が下記いずれかを満たす関数型であるとき、`Fn`はコンセプト`completion-signature`を満たす。 -- `set_value_t(Vs...)`(`Vs`はオブジェクト型または参照型のパック) -- `set_error_t(Err)`(`Err`はオブジェクト型または参照型) -- `set_stopped_t()` +- [`set_value_t`](set_value.md)`(Vs...)`(`Vs`はオブジェクト型または参照型のパック) +- [`set_error_t`](set_error.md)`(Err)`(`Err`はオブジェクト型または参照型) +- [`set_stopped_t`](set_stopped.md)`()` ## 例 @@ -50,6 +50,9 @@ int main() } ``` * ex::completion_signatures[color ff0000] +* ex::set_value_t[link set_value.md] +* ex::set_error_t[link set_error.md] +* ex::set_stopped_t[link set_stopped.md] * std::exception_ptr[link /reference/exception/exception_ptr.md] ### 出力 @@ -70,6 +73,9 @@ int main() ## 関連項目 - [`execution::receiver`](receiver.md) +- [`execution::set_value_t`](set_value.md) +- [`execution::set_error_t`](set_error.md) +- [`execution::set_stopped_t`](set_stopped.md) ## 参照 diff --git a/reference/execution/execution/operation_state.md b/reference/execution/execution/operation_state.md index 09d93bb901..d221a8332e 100644 --- a/reference/execution/execution/operation_state.md +++ b/reference/execution/execution/operation_state.md @@ -61,6 +61,7 @@ int main() } ``` * ex::operation_state[color ff0000] +* ex::receiver_t[link receiver.md] * ex::sender[link sender.md] * ex::just[link just.md.nolink] * ex::connect[link connect.md.nolink] diff --git a/reference/execution/execution/receiver_of.md b/reference/execution/execution/receiver_of.md index e030a93fb3..5c16cab79c 100644 --- a/reference/execution/execution/receiver_of.md +++ b/reference/execution/execution/receiver_of.md @@ -52,25 +52,38 @@ concept receiver_of = #include namespace ex = std::execution; -struct ValueReceiver { +struct MyReceiver { using receiver_concept = ex::receiver_t; - void set_value(int) noexcept; + void set_value(int, int) && noexcept; + void set_error(int) && noexcept; }; int main() { - // 完了操作ex::set_value(int)に対応 - static_assert(ex::receiver_of>); + + // 完了操作ex::set_value(int)には非対応 + static_assert(not ex::receiver_of>); - // 完了操作ex::set_value(int, int)には非対応 - static_assert(not ex::receiver_of>); + // 完了操作ex::set_error(int)に対応 + static_assert(ex::receiver_of>); + + // 完了操作ex::set_stopped()には非対応 + static_assert(not ex::receiver_of>); } ``` * ex::receiver_of[color ff0000] +* ex::receiver_t[link receiver.md] * ex::completion_signatures[link completion_signatures.md] +* ex::set_value_t[link set_value.md] +* ex::set_error_t[link set_error.md] +* ex::set_stopped_t[link set_stopped.md] ### 出力 ``` @@ -90,6 +103,9 @@ int main() ## 関連項目 - [`execution::receiver`](receiver.md) +- [`execution::set_value_t`](set_value.md) +- [`execution::set_error_t`](set_error.md) +- [`execution::set_stopped_t`](set_stopped.md) ## 参照 diff --git a/reference/execution/execution/scheduler.md b/reference/execution/execution/scheduler.md index 3641577706..7c1ea09319 100644 --- a/reference/execution/execution/scheduler.md +++ b/reference/execution/execution/scheduler.md @@ -23,8 +23,10 @@ namespace std::execution { } ``` * derived_from[link /reference/concepts/derived_from.md] +* sender[link sender.md] * queryable[link queryable.md.nolink] * get_completion_scheduler[link get_completion_scheduler.md.nolink] +* set_value_t[link set_value.md] * get_env[link get_env.md.nolink] * equality_comparable[link /reference/concepts/equality_comparable.md] * copyable[link /reference/concepts/copyable.md] @@ -38,7 +40,7 @@ namespace std::execution { - [問い合わせ可能](queryable.md.nolink)であること - `Sch`型の値`sch`に対して下記が有効な式であること - [`execution::schedule`](schedule.md.nolink)`(sch)`が[Sender](sender.md)を返すこと - - [`execution::get_completion_scheduler`](get_completion_scheduler.md.nolink)`(`[`execution::get_env`](get_env.md.nolink)`(`[`execution::schedule`](schedule.md.nolink)`(sch)))`の結果が`Sch`型に等しいこと + - [`execution::get_completion_scheduler`](get_completion_scheduler.md.nolink)`<`[`set_value_t`](set_value.md)`>(`[`execution::get_env`](get_env.md.nolink)`(`[`execution::schedule`](schedule.md.nolink)`(sch)))`の結果が`Sch`型に等しいこと ## 例 diff --git a/reference/execution/execution/sender_in.md b/reference/execution/execution/sender_in.md index c5d35fd1bf..f068b68829 100644 --- a/reference/execution/execution/sender_in.md +++ b/reference/execution/execution/sender_in.md @@ -20,7 +20,6 @@ namespace std::execution { * sender[link sender.md] * queryable[link queryable.md.nolink] * get_completion_signatures[link get_completion_signatures.md.nolink] -* valid-completion-signatures[link valid-completion-signatures.md.nolink] ## 概要 `sender_in`は、[Sender型](sender.md)`Sndr`が[環境](env.md.nolink)`Env`において非同期操作を作成できることを表すコンセプトである。 @@ -29,6 +28,14 @@ namespace std::execution { ## モデル 説明用に`sndr`を`decltype((sndr))`が`Sndr`型となる式、`rcvr`を環境`Env`に関連付けられた[Receiver](receiver.md)とする。 +```cpp +template +concept valid-completion-signatures = see below; +``` +* see below[italic] + +[`completion_signatures`](completion_signatures.md)クラステンプレートの特殊化であるとき、`Sigs`は説明専用コンセプト`valid-completion-signatures`のモデルである。 + また、ある完了操作の完了シグネチャが[`completion_signatures_of_t`](completion_signatures_of_t.md)``で取得される[`completion_signatures`](completion_signatures.md)リストに含まれるとき、`Sndr`と`Env`における許容可能完了(permissible completion)となる。 `sndr`と`rcvr`の接続後に[Operation State](operation_state.md)を開始することで評価されうる完了操作が、全て許容可能完了(permissible completion)である場合、`Sndr`と`Env`は`sender_in`のモデルとなる。 diff --git a/reference/execution/execution/sender_to.md b/reference/execution/execution/sender_to.md index 84fc45ba8e..45082ae5eb 100644 --- a/reference/execution/execution/sender_to.md +++ b/reference/execution/execution/sender_to.md @@ -34,7 +34,7 @@ namespace ex = std::execution; struct ValueReceiver { using receiver_concept = ex::receiver_t; - void set_value(int v) noexcept + void set_value(int v) && noexcept { std::println("{}", v); } @@ -56,6 +56,7 @@ int main() } ``` * ex::sender_to[color ff0000] +* ex::receiver_t[link receiver.md] * ex::sender[link sender.md] * ex::just[link just.md.nolink] * ex::operation_state[link operation_state.md] diff --git a/reference/execution/execution/set_error.md b/reference/execution/execution/set_error.md new file mode 100644 index 0000000000..f98c2cb99a --- /dev/null +++ b/reference/execution/execution/set_error.md @@ -0,0 +1,84 @@ +# set_error +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct set_error_t { unspecified }; // タグ型 + + inline constexpr set_error_t set_error{}; +} +``` +* unspecified[italic] + +## 概要 +`set_error`は、非同期操作の失敗完了を表現するエラー(error)完了関数である。完了関数の呼び出しは完了操作と呼ばれる。 + +エラー完了関数には完了タグ`set_error_t`が関連付けられ、完了操作のエラー完了シグネチャは戻り値型`set_error_t`と1個の引数を持つ関数型として表現される。 + + +## 効果 +- 引数`rcvr`が左辺値またはconst右辺値の場合、式`set_error(rcvr, err)`は不適格となる。 +- そうでなければ、`rcvr.set_error(err)`と等価である。 + + +## 例外 +投げない + + +## カスタマイゼーションポイント +[Receiver型](receiver.md)の非const右辺値`rcvr`に対して式`rcvr.set_error(err)`が呼び出される。 +このとき、`noexcept(rcvr.set_error(err)) == true`であること。 + + +## 備考 +完了関数`set_error`は[Sender](sender.md)内部実装から呼び出される想定であり、実行制御ライブラリ利用者が直接利用する必要はない。 + + +## 例 +```cpp example +#include +namespace ex = std::execution; + +struct ErrorReceiver { + using receiver_concept = ex::receiver_t; + + // エラー完了シグネチャ set_error_t(int) + void set_error(int) && noexcept {} +}; + +int main() +{ + ErrorReceiver rcvr; + ex::set_error(std::move(rcvr), 42); +} +``` +* ex::set_error[color ff0000] +* ex::receiver_t[link receiver.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::receiver`](receiver.md) +- [`execution::set_value_t`](set_value.md) +- [`execution::set_stopped_t`](set_stopped.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/set_stopped.md b/reference/execution/execution/set_stopped.md new file mode 100644 index 0000000000..d3963f57bb --- /dev/null +++ b/reference/execution/execution/set_stopped.md @@ -0,0 +1,84 @@ +# set_stopped +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct set_stopped_t { unspecified }; // タグ型 + + inline constexpr set_stopped_t set_stopped{}; +} +``` +* unspecified[italic] + +## 概要 +`set_stopped`は、非同期操作のキャンセル完了を表現する停止(stopped)完了関数である。完了関数の呼び出しは完了操作と呼ばれる。 + +停止完了関数には完了タグ`set_stopped_t`が関連付けられ、完了操作の停止完了シグネチャは戻り値型`set_stopped_t`と0個の引数を持つ関数型として表現される。 + + +## 効果 +- 引数`rcvr`が左辺値またはconst右辺値の場合、式`set_stopped(rcvr)`は不適格となる。 +- そうでなければ、`rcvr.set_stopped()`と等価である。 + + +## 例外 +投げない + + +## カスタマイゼーションポイント +[Receiver型](receiver.md)の非const右辺値`rcvr`に対して式`rcvr.set_stopped()`が呼び出される。 +このとき、`noexcept(rcvr.set_stopped()) == true`であること。 + + +## 備考 +完了関数`set_stopped`は[Sender](sender.md)内部実装から呼び出される想定であり、実行制御ライブラリ利用者が直接利用する必要はない。 + + +## 例 +```cpp example +#include +namespace ex = std::execution; + +struct StoppedReceiver { + using receiver_concept = ex::receiver_t; + + // 停止完了シグネチャ set_stopped_t() + void set_stopped() && noexcept {} +}; + +int main() +{ + StoppedReceiver rcvr; + ex::set_stopped(std::move(rcvr)); +} +``` +* ex::set_stopped[color ff0000] +* ex::receiver_t[link receiver.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::receiver`](receiver.md) +- [`execution::set_value_t`](set_value.md) +- [`execution::set_error_t`](set_error.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/set_value.md b/reference/execution/execution/set_value.md new file mode 100644 index 0000000000..65984ab5b1 --- /dev/null +++ b/reference/execution/execution/set_value.md @@ -0,0 +1,84 @@ +# set_value +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct set_value_t { unspecified }; // タグ型 + + inline constexpr set_value_t set_value{}; +} +``` +* unspecified[italic] + +## 概要 +`set_value`は、非同期操作の正常完了を表現する値(value)完了関数である。完了関数の呼び出しは完了操作と呼ばれる。 + +値完了関数には完了タグ`set_value_t`が関連付けられ、完了操作の値完了シグネチャは戻り値型`set_value_t`と任意個の引数を持つ関数型として表現される。 + + +## 効果 +- 引数`rcvr`が左辺値またはconst右辺値の場合、式`set_value(rcvr, vs...)`は不適格となる。 +- そうでなければ、`rcvr.set_value(vs...)`と等価である。 + + +## 例外 +投げない + + +## カスタマイゼーションポイント +[Receiver型](receiver.md)の非const右辺値`rcvr`に対して式`rcvr.set_value(vs...)`が呼び出される。 +このとき、`noexcept(rcvr.set_value(vs...)) == true`であること。 + + +## 備考 +完了関数`set_value`は[Sender](sender.md)内部実装から呼び出される想定であり、実行制御ライブラリ利用者が直接利用する必要はない。 + + +## 例 +```cpp example +#include +namespace ex = std::execution; + +struct ValueReceiver { + using receiver_concept = ex::receiver_t; + + // 値完了シグネチャ set_value_t(int, int) + void set_value(int, int) && noexcept {} +}; + +int main() +{ + ValueReceiver rcvr; + ex::set_value(std::move(rcvr), 1, 2); +} +``` +* ex::set_value[color ff0000] +* ex::receiver_t[link receiver.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::receiver`](receiver.md) +- [`execution::set_error_t`](set_error.md) +- [`execution::set_stopped_t`](set_stopped.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/working_style.md b/working_style.md index 88d0da3a79..ed10d259bb 100644 --- a/working_style.md +++ b/working_style.md @@ -71,8 +71,10 @@ C++11以降対応については対応バージョンを明記します。バー | base class | 基底クラス | | bidirectional iterator | 双方向イテレータ | | bucket | バケット | +| completion function | 完了関数 | | completion operation | 完了操作 | | completion signature | 完了シグネチャ | +| completion tag | 完了タグ | | complexity | 計算量 | | compound type | 複合型 | | const iterator | 読み取り専用イテレータ | From c22f5566bef585080db7bde797aa85e25ba1e413 Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 14 Apr 2025 22:11:13 +0900 Subject: [PATCH 1525/3948] execution: is-awaitable (#1384) --- reference/execution/execution/sender.md | 2 +- reference/execution/is-awaitable.md | 66 +++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 reference/execution/is-awaitable.md diff --git a/reference/execution/execution/sender.md b/reference/execution/execution/sender.md index 671e7c6ccc..19c77f6099 100644 --- a/reference/execution/execution/sender.md +++ b/reference/execution/execution/sender.md @@ -47,7 +47,7 @@ struct env-promise : with-await-transform> { const Env& get_env() const noexcept; }; ``` -* is-awaitable[link is-awaitable.md.nolink] +* is-awaitable[link ../is-awaitable.md] * env<>[link env.md.nolink] * derived_from[link /reference/concepts/derived_from.md] * coroutine_handle<>[link /reference/coroutine/coroutine_handle.md] diff --git a/reference/execution/is-awaitable.md b/reference/execution/is-awaitable.md new file mode 100644 index 0000000000..c5cd3bec2f --- /dev/null +++ b/reference/execution/is-awaitable.md @@ -0,0 +1,66 @@ +# is-awaitable +* execution[meta header] +* concept[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +template +concept is-awaitable; +``` + +## 概要 +`is-awaitable`は、Promise型をもつ[コルーチンのco_await演算子](/lang/cpp20/coroutines.md)オペランドにおいて`C`型オブジェクトが妥当であることを表す説明専用コンセプトである。 + + +## 要件 +説明用の式`GET-AWAITER(c, p)`を、Promise型`p`をもつコルーチン内の`co_await`演算子オペランドに適用される一連変換後の左辺値とする。 + +- (有効ならば)Promise型の`await_transform`メンバ関数を適用 +- (有効ならば)`co_await`演算子オーバーロードを適用 + +また、説明用のコンセプト`await-suspend-result`, `is-awaiter`を以下のように定義する。 + +```cpp +template +concept await-suspend-result = /*see below*/; + +template +concept is-awaiter = + requires (A& a, coroutine_handle h) { + a.await_ready() ? 1 : 0; + { a.await_suspend(h) } -> await-suspend-result; + a.await_resume(); + }; +``` +* coroutine_handle[link /reference/coroutine/coroutine_handle.md] + +下記いずれかのうち1つが`true`のとき、`await-suspend-result`は`true`となる。 + +- `T`が`void`、もしくは +- `T`が`bool`、もしくは +- `T`が[`coroutine_handle`](/reference/coroutine/coroutine_handle.md)の特殊化 + +`is-awaitable`コンセプトは、以下のように定義される。 + +```cpp +template +concept is-awaitable = + requires (C (*fc)() noexcept, Promise& p) { + { GET-AWAITER(fc(), p) } -> is-awaiter; + }; +``` +* GET-AWAITER[italic] + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [コルーチン](/lang/cpp20/coroutines.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) From 2d92c9fd2901685e95c87206c2754827357594fb Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 15 Apr 2025 01:16:19 +0900 Subject: [PATCH 1526/3948] execution: env,prop,queryable (#1384) --- reference/execution/execution.md | 28 +++---- .../execution/completion_signatures_of_t.md | 4 +- reference/execution/execution/env.md | 83 +++++++++++++++++++ reference/execution/execution/env/query.md | 80 ++++++++++++++++++ reference/execution/execution/prop.md | 75 +++++++++++++++++ reference/execution/execution/receiver.md | 2 +- reference/execution/execution/scheduler.md | 6 +- reference/execution/execution/sender.md | 4 +- reference/execution/execution/sender_in.md | 10 +-- reference/execution/queryable.md | 33 ++++++++ working_style.md | 3 +- 11 files changed, 300 insertions(+), 28 deletions(-) create mode 100644 reference/execution/execution/env.md create mode 100644 reference/execution/execution/env/query.md create mode 100644 reference/execution/execution/prop.md create mode 100644 reference/execution/queryable.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 920223549d..15206c6579 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -35,22 +35,22 @@ namespace std::execution { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`forwarding_query`](forwarding_query.md.nolink) | 進行保証の問い合わせオブジェクト (customization point object) | C++26 | -| [`get_allocator`](get_allocator.md.nolink) | アロケータ取得の問い合わせオブジェクト (customization point object) | C++26 | -| [`get_stop_token`](get_stop_token.md.nolink) | 停止トークン取得の問い合わせオブジェクト (customization point object) | C++26 | +| [`forwarding_query`](forwarding_query.md.nolink) | クエリオブジェクトに転送問い合わせ可能か否かを返す (customization point object) | C++26 | +| [`get_allocator`](get_allocator.md.nolink) | アロケータ取得のクエリオブジェクト (customization point object) | C++26 | +| [`get_stop_token`](get_stop_token.md.nolink) | 停止トークン取得のクエリオブジェクト (customization point object) | C++26 | | [`stop_token_of_t`](get_stop_token.md.nolink) | 指定型から停止トークン型を取得 (alias template) | C++26 | -| [`execution::get_domain`](execution/get_domain.md.nolink) | 実行ドメイン取得の問い合わせオブジェクト (customization point object) | C++26 | -| [`execution::get_scheduler`](execution/get_scheduler.md.nolink) | Scheduler取得の問い合わせオブジェクト (customization point object) | C++26 | -| [`execution::get_delegation_scheduler`](execution/get_delegation_scheduler.md.nolink) | 委譲Scheduler取得の問い合わせオブジェクト (customization point object) | C++26 | +| [`execution::get_domain`](execution/get_domain.md.nolink) | 実行ドメイン取得のクエリオブジェクト (customization point object) | C++26 | +| [`execution::get_scheduler`](execution/get_scheduler.md.nolink) | Scheduler取得のクエリオブジェクト (customization point object) | C++26 | +| [`execution::get_delegation_scheduler`](execution/get_delegation_scheduler.md.nolink) | 委譲Scheduler取得のクエリオブジェクト (customization point object) | C++26 | | [`execution::forward_progress_guarantee`](execution/forward_progress_guarantee.md.nolink) | 前進保証 (enum) | C++26 | -| [`execution::get_forward_progress_guarantee`](execution/get_forward_progress_guarantee.md.nolink) | 前進保証取得の問い合わせオブジェクト (customization point object) | C++26 | -| [`execution::get_completion_scheduler`](execution/get_completion_scheduler.md.nolink) | 完了Scheduler取得の問い合わせオブジェクト (customization point object) | C++26 | -| [`execution::get_env`](execution/get_env.md.nolink) | 環境取得の問い合わせオブジェクト (customization point object) | C++26 | +| [`execution::get_forward_progress_guarantee`](execution/get_forward_progress_guarantee.md.nolink) | 前進保証取得のクエリオブジェクト (customization point object) | C++26 | +| [`execution::get_completion_scheduler`](execution/get_completion_scheduler.md.nolink) | 完了Scheduler取得のクエリオブジェクト (customization point object) | C++26 | +| [`execution::get_env`](execution/get_env.md.nolink) | 環境取得のクエリオブジェクト (customization point object) | C++26 | | [`execution::env_of_t`](execution/env_of_t.md.nolink) | 指定型から環境型を取得 (alias template) | C++26 | -| [`execution::prop`](execution/prop.md.nolink) | プロパティ(class template) | C++26 | -| [`execution::env`](execution/env.md.nolink) | 環境 (class template) | C++26 | +| [`execution::prop`](execution/prop.md) | 環境構築用のヘルパクラス (class template) | C++26 | +| [`execution::env`](execution/env.md) | 環境 (class template) | C++26 | -問い合わせオブジェクトは名前空間 `std` および名前空間 `std::execution` で定義される。 +クエリオブジェクトは名前空間 `std` および名前空間 `std::execution` で定義される。 ### Scheduler @@ -83,14 +83,14 @@ namespace std::execution { | [`execution::sender`](execution/sender.md) | Sender型 (concept) | C++26 | | [`execution::sender_in`](execution/sender_in.md) | 指定環境で有効なSender (concept) | C++26 | | [`execution::sender_to`](execution/sender_to.md) | 指定Receiverに接続可能なSender (concept) | C++26 | -| [`execution::get_completion_signatures`](execution/get_completion_signatures.md.nolink) | 完了シグネチャ集合取得の問い合わせオブジェクト (customization point object) | C++26 | +| [`execution::get_completion_signatures`](execution/get_completion_signatures.md.nolink) | 完了シグネチャ集合取得のクエリオブジェクト (customization point object) | C++26 | | [`execution::completion_signatures_of_t`](execution/completion_signatures_of_t.md) | Senderから完了シグネチャ集合を取得 (alias template) | C++26 | | [`execution::value_types_of_t`](execution/value_types_of_t.md.nolink) | Senderの値完了型を取得 (alias template) | C++26 | | [`execution::error_types_of_t`](execution/error_types_of_t.md.nolink) | Senderのエラー完了型を取得 (alias template) | C++26 | | [`execution::sends_stopped`](execution/value_types_of_t.md.nolink) | Senderが停止完了に対応するか否か (variable template) | C++26 | | [`execution::tag_of_t`](execution/tag_of_t.md.nolink) | Senderのタグ型を取得 (alias template) | C++26 | | [`execution::transform_sender`](execution/transform_sender.md.nolink) | Senderを変換 (function template) | C++26 | -| [`execution::transform_env`](execution/transform_env.md.nolink) | 問い合わせオブジェクトを変換 (function template) | C++26 | +| [`execution::transform_env`](execution/transform_env.md.nolink) | クエリオブジェクトを変換 (function template) | C++26 | | [`execution::apply_sender`](execution/apply_sender.md.nolink) | Senderにタグ型と引数を適用 (function template) | C++26 | | [`execution::connect`](execution/connect.md.nolink) | SenderとReceiverを接続 (customization point object) | C++26 | | [`execution::connect_result_t`](execution/connect_result_t.md.nolink) | `connect`結果型を取得 (alias template) | C++26 | diff --git a/reference/execution/execution/completion_signatures_of_t.md b/reference/execution/execution/completion_signatures_of_t.md index 6a4fc20090..6429a27147 100644 --- a/reference/execution/execution/completion_signatures_of_t.md +++ b/reference/execution/execution/completion_signatures_of_t.md @@ -11,14 +11,14 @@ namespace std::execution { using completion_signatures_of_t = call-result-t; } ``` -* env<>[link env.md.nolink] +* env<>[link env.md] * sender_in[link sender_in.md] * call-result-t[link call-result-t.md.nolink] * sender_in[link sender_in.md] ## 概要 -[Sender型](sender.md)`Sndr`から[環境](env.md.nolink)`Env`における[完了シグネチャ集合](completion_signatures.md)を取得する。 +[Sender型](sender.md)`Sndr`から[環境](env.md)`Env`における[完了シグネチャ集合](completion_signatures.md)を取得する。 ## バージョン diff --git a/reference/execution/execution/env.md b/reference/execution/execution/env.md new file mode 100644 index 0000000000..df547da64d --- /dev/null +++ b/reference/execution/execution/env.md @@ -0,0 +1,83 @@ +# env +* execution[meta header] +* class template[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template + struct env { + Envs0 envs0_; // exposition only + Envs1 envs1_; // exposition only + // ... + EnvsN envsN_; // exposition only + + template + constexpr decltype(auto) query(QueryTag q) const noexcept; + }; + + template + env(Envs...) -> env...>; +} +``` +* queryable[link ../queryable.md] +* unwrap_reference_t[link /reference/type_traits/unwrap_reference.md] + +## 概要 +クラステンプレート`env`は、複数の[クエリ可能オブジェクト](../queryable.md)からクエリ可能オブジェクトを作成する。 +結果オブジェクト上に対する問い合わせは、各サブオブジェクトに対して宣言順に問い合わせを行うことで解決される。 + +`env`の特殊化は代入可能ではない。 + +式リストが単一要素で構成される場合を除いて、`env`が括弧を用いた式リストによる初期化をサポートするか否かは未規定。 + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|-----------------|----------------|-------| +| `(constructor)` | コンストラクタ | C++26 | +| `(destructor)` | デストラクタ | C++26 | +| [`query`](env/query.md) | 問い合わせ | C++26 | + + +## 例 +```cpp example +#include +#include +namespace ex = std::execution; + +int main() +{ + auto env = ex::env{ + ex::prop(std::get_stop_token, std::never_stop_token{}) + }; +} +``` +* ex::env[color ff0000] +* ex::prop[link prop.md] +* std::never_stop_token[link /reference/stop_token/never_stop_token.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::prop`](prop.md) + + +## 参照 +- [P3325R5 A Utility for Creating Execution Environments](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3325r5.html) diff --git a/reference/execution/execution/env/query.md b/reference/execution/execution/env/query.md new file mode 100644 index 0000000000..171fa25daa --- /dev/null +++ b/reference/execution/execution/env/query.md @@ -0,0 +1,80 @@ +# query +* execution[meta header] +* std::execution[meta namespace] +* env[meta class] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +constexpr decltype(auto) query(QueryTag q) const noexcept(see below); +``` +* see below[italic] + +## 概要 +クエリオブジェクト`q`に対して問い合わせを行う。 + + +## テンプレートパラメータ制約 +説明専用のコンセプト`has-query`を次のように定義したとき、`(has-query || ...)`が`true`であること。 + +```cpp +template +concept has-query = + requires (const Env& env) { + env.query(QueryTag()); + }; +``` + +## 効果 +説明用の`fe`を、`env`クラステンプレートの説明専用メンバ変数`envs0_`, ..., `envsN_`のうち最初に式`fe.query(q)`が適格となる要素としたとき、下記と等価。 + +```cpp +return fe.query(q); +``` + +## 例外 +式`fe.query(q)`が`true`のとき、例外送出しない。 + + +## 例 +```cpp example +#include +#include +#include +using ex = std::execution; + +int main() +{ + auto env = ex::env{ + ex::prop(std::get_stop_token, std::stop_token{}), + ex::prop(std::get_allocator, std::allocator{}), + ex::prop(std::get_stop_token, std::never_stop_token{}), + }; + + auto token = env.query(std::get_stop_token); + static_assert(std::same_as); +} +``` +* query[color ff0000] +* ex::env[link ../env.md] +* ex::prop[link ../prop.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3325R5 A Utility for Creating Execution Environments](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3325r5.html) diff --git a/reference/execution/execution/prop.md b/reference/execution/execution/prop.md new file mode 100644 index 0000000000..064085cf1b --- /dev/null +++ b/reference/execution/execution/prop.md @@ -0,0 +1,75 @@ +# prop +* execution[meta header] +* class template[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template + struct prop { + QueryTag query_; // exposition only + ValueType value_; // exposition only + + constexpr const ValueType& query(QueryTag) const noexcept { + return value_; + } + }; + + template + prop(QueryTag, ValueType) -> prop>; +} +``` +* unwrap_reference_t[link /reference/type_traits/unwrap_reference.md] + +## 概要 +`QueryTag`型クエリオブジェクトのキーと`ValueType`型の値から、読み取り専用の[クエリ可能オブジェクト](../queryable.md)を構築する。 + + +## 適格要件 +説明用の`prop-like`テンプレートクラスを用いて、`QueryTag`と`ValueType`が`callable>`のモデルであること。 + +```cpp +template +struct prop-like { + const ValueType& query(auto) const noexcept; +}; +``` + + +## 例 +```cpp example +#include +#include +namespace ex = std::execution; + +int main() +{ + auto env0 = ex::prop(std::get_stop_token, std::never_stop_token{}); +} +``` +* ex::prop[color ff0000] +* std::never_stop_token[link /reference/stop_token/never_stop_token.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::env`](env.md) + + +## 参照 +- [P3325R5 A Utility for Creating Execution Environments](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3325r5.html) diff --git a/reference/execution/execution/receiver.md b/reference/execution/execution/receiver.md index b611d9882c..bb7c461983 100644 --- a/reference/execution/execution/receiver.md +++ b/reference/execution/execution/receiver.md @@ -19,7 +19,7 @@ namespace std::execution { } ``` * get_env[link get_env.md.nolink] -* queryable[link queryable.md.nolink] +* queryable[link ../queryable.md] * derived_from[link /reference/concepts/derived_from.md] * move_constructible[link /reference/concepts/move_constructible.md] * constructible_from[link /reference/concepts/constructible_from.md] diff --git a/reference/execution/execution/scheduler.md b/reference/execution/execution/scheduler.md index 7c1ea09319..a89bb8d477 100644 --- a/reference/execution/execution/scheduler.md +++ b/reference/execution/execution/scheduler.md @@ -24,7 +24,7 @@ namespace std::execution { ``` * derived_from[link /reference/concepts/derived_from.md] * sender[link sender.md] -* queryable[link queryable.md.nolink] +* queryable[link ../queryable.md] * get_completion_scheduler[link get_completion_scheduler.md.nolink] * set_value_t[link set_value.md] * get_env[link get_env.md.nolink] @@ -36,8 +36,8 @@ namespace std::execution { 下記をみたすクラス型はSchedulerとみなせる。 -- `scheduler_t`をメンバ型`Sch::scheduler_concept`として定義するクラス型 -- [問い合わせ可能](queryable.md.nolink)であること +- `scheduler_t`をメンバ型`Sch::scheduler_concept`として定義するクラス +- [クエリ可能オブジェクト](../queryable.md)であること - `Sch`型の値`sch`に対して下記が有効な式であること - [`execution::schedule`](schedule.md.nolink)`(sch)`が[Sender](sender.md)を返すこと - [`execution::get_completion_scheduler`](get_completion_scheduler.md.nolink)`<`[`set_value_t`](set_value.md)`>(`[`execution::get_env`](get_env.md.nolink)`(`[`execution::schedule`](schedule.md.nolink)`(sch)))`の結果が`Sch`型に等しいこと diff --git a/reference/execution/execution/sender.md b/reference/execution/execution/sender.md index 19c77f6099..7d065640ce 100644 --- a/reference/execution/execution/sender.md +++ b/reference/execution/execution/sender.md @@ -48,7 +48,7 @@ struct env-promise : with-await-transform> { }; ``` * is-awaitable[link ../is-awaitable.md] -* env<>[link env.md.nolink] +* env<>[link env.md] * derived_from[link /reference/concepts/derived_from.md] * coroutine_handle<>[link /reference/coroutine/coroutine_handle.md] * unspecified[italic] @@ -66,7 +66,7 @@ concept sender = constructible_from, Sndr>; ``` * get_env[link get_env.md.nolink] -* queryable[link queryable.md.nolink] +* queryable[link ../queryable.md] * move_constructible[link /reference/concepts/move_constructible.md] * constructible_from[link /reference/concepts/constructible_from.md] diff --git a/reference/execution/execution/sender_in.md b/reference/execution/execution/sender_in.md index f068b68829..1ef582f4d7 100644 --- a/reference/execution/execution/sender_in.md +++ b/reference/execution/execution/sender_in.md @@ -16,13 +16,13 @@ namespace std::execution { }; } ``` -* env<>[link env.md.nolink] +* env<>[link env.md] * sender[link sender.md] -* queryable[link queryable.md.nolink] +* queryable[link ../queryable.md] * get_completion_signatures[link get_completion_signatures.md.nolink] ## 概要 -`sender_in`は、[Sender型](sender.md)`Sndr`が[環境](env.md.nolink)`Env`において非同期操作を作成できることを表すコンセプトである。 +`sender_in`は、[Sender型](sender.md)`Sndr`が[環境](env.md)`Env`において非同期操作を作成できることを表すコンセプトである。 ## モデル @@ -55,7 +55,7 @@ int main() * ex::sender_in[color ff0000] * ex::sender[link sender.md] * ex::just[link just.md.nolink] -* ex::env<>[link env.md.nolink] +* ex::env<>[link env.md] ### 出力 ``` @@ -75,7 +75,7 @@ int main() ## 関連項目 - [`execution::sender`](sender.md) -- [`execution::env`](env.md.nolink) +- [`execution::env`](env.md) ## 参照 diff --git a/reference/execution/queryable.md b/reference/execution/queryable.md new file mode 100644 index 0000000000..346b7d0385 --- /dev/null +++ b/reference/execution/queryable.md @@ -0,0 +1,33 @@ +# queryable +* execution[meta header] +* concept[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +template +concept queryable = destructible; +``` +* destructible[link /reference/concepts/destructible.md] + +## 概要 +`queryable`は、型`T`がクエリ可能オブジェクトの制約を満たすことを表す説明専用のコンセプトである。 + + +## モデル +説明用の`env`を`Env`型のオブジェクトとする。 +呼び出し可能オブジェクト`q`と部分式パック`args`に対して、`requires { q(env, args...) }`が`true`であれば、`q(env, args...)`が`q`に課されるセマンティック要件を満たす場合に、`Env`は`queryable`のモデルである。 + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`execution::prop`](execution/prop.md) +- [`execution::env`](execution/env.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/working_style.md b/working_style.md index ed10d259bb..86ed8088d6 100644 --- a/working_style.md +++ b/working_style.md @@ -126,7 +126,8 @@ C++11以降対応については対応バージョンを明記します。バー | predicate | 述語 | | propagation, propagate | 伝播
(伝搬は誤用が広まったものなので使わない) | | pure virtual function | 純粋仮想関数 | -| query object | 問い合わせオブジェクト | +| query object | クエリオブジェクト | +| queryable object | クエリ可能オブジェクト | | random access iterator | ランダムアクセスイテレータ | | range | 一般用途の場合:範囲
Rangeアルゴリズム・Rangeアダプタ・Rangeオブジェクトの場合:Range
range-based for:範囲for文
2つのイテレータによる範囲:イテレータ範囲 | | region of RCU protection | RCU保護区間 | From 92a7237ce2698f7bc6fcaed781f171f579040706 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 15 Apr 2025 01:19:47 +0900 Subject: [PATCH 1527/3948] execution/env: fix ngword --- reference/execution/execution/env.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/execution/execution/env.md b/reference/execution/execution/env.md index df547da64d..4ebb6362c5 100644 --- a/reference/execution/execution/env.md +++ b/reference/execution/execution/env.md @@ -30,7 +30,7 @@ namespace std::execution { `env`の特殊化は代入可能ではない。 -式リストが単一要素で構成される場合を除いて、`env`が括弧を用いた式リストによる初期化をサポートするか否かは未規定。 +式リストが単一要素で構成される場合を除いて、`env`が丸カッコを用いた式リストによる初期化をサポートするか否かは未規定。 ## メンバ関数 From b4cf7e4d32e038907bf489e4850829990043ca57 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 15 Apr 2025 13:06:50 +0900 Subject: [PATCH 1528/3948] =?UTF-8?q?Markdown=E3=81=AE=E5=A4=96=E9=83=A8?= =?UTF-8?q?=E8=A7=A3=E8=AA=AC=E3=82=B5=E3=82=A4=E3=83=88=E3=81=B8=E3=81=AE?= =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 外部リンクチェックが通らないため #1438 --- start_editing.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/start_editing.md b/start_editing.md index 2e632953f3..2bd0b2352d 100644 --- a/start_editing.md +++ b/start_editing.md @@ -91,9 +91,6 @@ Markdownは、GitHubサービス上でドキュメントを記述するフォー Markdownの記述方法をわかりやすく解説してくれているWebサイトは、すでに数多く存在しますので、詳細はそちらを参照してください。 -- [Markdown記法 チートシート](http://qiita.com/Qiita/items/c686397e4a0f4f11683d) -- [文章作成やメモ書きにも便利、Markdown記法](http://kojika17.com/2013/01/starting-markdown.html) - ただし、cpprefjp特有の拡張構文もあります。 以下のページにまとめてあるので、そちらを参照して下さい。 From 2107107379cde39744084d400cea41c89185e56b Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Tue, 15 Apr 2025 13:10:30 +0900 Subject: [PATCH 1529/3948] =?UTF-8?q?=E3=81=84=E3=81=8F=E3=81=A4=E3=81=8B?= =?UTF-8?q?=E3=81=AEtypo=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp20/conditionally_trivial_special_member_functions.md | 2 +- lang/cpp23/portable_assumptions.md | 2 +- reference/compare/strong_ordering.md | 4 ++-- reference/compare/weak_ordering.md | 2 +- reference/cstdlib.md | 2 +- reference/filesystem/copy_file.md | 2 +- reference/functional/function_ref/op_constructor.md | 4 ++-- reference/iterator/iter_const_reference_t.md | 4 ++-- reference/linalg/conjugated_accessor/access.md | 2 +- reference/linalg/scaled_accessor/access.md | 2 +- reference/linalg/transposed.md | 2 +- reference/mdspan/layout_left_padded/mapping/op_constructor.md | 2 +- .../mdspan/layout_right_padded/mapping/op_constructor.md | 2 +- reference/mdspan/mdspan.md | 2 +- reference/memory/allocator/allocate_at_least.md | 2 +- reference/memory/allocator_traits/allocate_at_least.md | 2 +- reference/memory/assume_aligned.md | 2 +- 17 files changed, 20 insertions(+), 20 deletions(-) diff --git a/lang/cpp20/conditionally_trivial_special_member_functions.md b/lang/cpp20/conditionally_trivial_special_member_functions.md index e33bd76fa4..07a2acce13 100644 --- a/lang/cpp20/conditionally_trivial_special_member_functions.md +++ b/lang/cpp20/conditionally_trivial_special_member_functions.md @@ -285,7 +285,7 @@ C++20のコンセプトの導入によって、コンセプトによって特殊 この機能はそれを補うための仕組みであり、特殊メンバ関数に対するコンセプト制約自体は最初のコンセプト導入時から可能になっていたため、この機能は厳密にいえば仕様の調整のみである。 -この機能は、C++23の`std::expceted`の実装で活用されるだろう。 +この機能は、C++23の`std::expected`の実装で活用されるだろう。 ## 関連項目 diff --git a/lang/cpp23/portable_assumptions.md b/lang/cpp23/portable_assumptions.md index e80c8e4ed9..7433e8ddc2 100644 --- a/lang/cpp23/portable_assumptions.md +++ b/lang/cpp23/portable_assumptions.md @@ -43,7 +43,7 @@ int divide_by_32(int x) // 非正値を考慮しない最適コードを生成できる可能性がある。 return x / 32; } -// asssume属性による仮定がfalseとなる関数呼び出し、 +// assume属性による仮定がfalseとなる関数呼び出し、 // 例えば divide_by_32(-100) は未定義動作を引き起こす。 ``` * assume[color ff0000] diff --git a/reference/compare/strong_ordering.md b/reference/compare/strong_ordering.md index 8b10e1c74e..f0a37196d6 100644 --- a/reference/compare/strong_ordering.md +++ b/reference/compare/strong_ordering.md @@ -55,8 +55,8 @@ namespace std { | 名前 | 説明 | 対応バージョン | | ---------------------------------------------------------------------------- | --------------------------------------------------------- | -------------- | -| [`oeprator partial_ordering`](strong_ordering/op_partial_ordering.md) | [`partial_ordering`](partial_ordering.md)への型変換演算子 | C++20 | -| [`oeprator weak_ordering`](strong_ordering/op_weak_ordering.md) | [`weak_ordering`](weak_ordering.md)への型変換演算子 | C++20 | +| [`operator partial_ordering`](strong_ordering/op_partial_ordering.md) | [`partial_ordering`](partial_ordering.md)への型変換演算子 | C++20 | +| [`operator weak_ordering`](strong_ordering/op_weak_ordering.md) | [`weak_ordering`](weak_ordering.md)への型変換演算子 | C++20 | ### 比較演算子 diff --git a/reference/compare/weak_ordering.md b/reference/compare/weak_ordering.md index 0f20437fee..3057dca83f 100644 --- a/reference/compare/weak_ordering.md +++ b/reference/compare/weak_ordering.md @@ -47,7 +47,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | | ---------------------------------------------------------------------------- | --------------------------------------------------------- | -------------- | -| [`oeprator partial_ordering`](weak_ordering/op_partial_ordering.md) | [`partial_ordering`](partial_ordering.md)への型変換演算子 | C++20 | +| [`operator partial_ordering`](weak_ordering/op_partial_ordering.md) | [`partial_ordering`](partial_ordering.md)への型変換演算子 | C++20 | ### 比較演算子 diff --git a/reference/cstdlib.md b/reference/cstdlib.md index cf12093f59..3aa4bd7ba0 100644 --- a/reference/cstdlib.md +++ b/reference/cstdlib.md @@ -86,7 +86,7 @@ | [`div_t`](cstdlib/div_t.md) | `div`関数の戻り値型 (class) | | | [`div`](cstdlib/div.md) | `int`の除算と剰余算を行う (function) | | | [`ldiv_t`](cstdlib/ldiv_t.md) | `ldiv`関数の戻り値型 (class) | | -| [`ldiv`](cstdlib/div.md) | `long`の除算と剰余算を行う (functon) | | +| [`ldiv`](cstdlib/div.md) | `long`の除算と剰余算を行う (function) | | | [`lldiv_t`](cstdlib/lldiv_t.md) | `lldiv`関数の戻り値型 (class) | C++11 | | [`lldiv`](cstdlib/div.md) | `long long`の除算と剰余算を行う (function) | C++11 | diff --git a/reference/filesystem/copy_file.md b/reference/filesystem/copy_file.md index 4cbe89bbf9..cb2f4e74e8 100644 --- a/reference/filesystem/copy_file.md +++ b/reference/filesystem/copy_file.md @@ -33,7 +33,7 @@ namespace std::filesystem { - `!`[`is_regular_file`](is_regular_file.md)`(from)` (コピー元のファイルが存在しない) - [`exists`](exists.md)`(to) && !`[`is_regular_file`](is_regular_file.md)`(to)` (コピー先に、通常ファイルではないファイルが存在している) - [`exists`](exists.md)`(to) &&` [`equivalent`](equivalent.md)`(from, to)` (コピー先にファイルが存在しており、それがコピー元と等価) - - [`exists`](exists.md)`(to) && (options & (`[`copy_optons::skip_existing`](copy_options.md) `|` [`copy_optons::overwrite_existing`](copy_options.md) `|` [`copy_optons::update_existing`](copy_options.md)`)) ==` [`copy_optons::none`](copy_options.md) (コピー先にファイルが存在しており、その場合にエラーにならないオプションが指定されていない) + - [`exists`](exists.md)`(to) && (options & (`[`copy_options::skip_existing`](copy_options.md) `|` [`copy_options::overwrite_existing`](copy_options.md) `|` [`copy_options::update_existing`](copy_options.md)`)) ==` [`copy_options::none`](copy_options.md) (コピー先にファイルが存在しており、その場合にエラーにならないオプションが指定されていない) - 以下の条件のいずれかに合致する場合、パス`from`が解決したファイルを、パス`to`が解決した先にコピーする - `!`[`exists`](exists.md)`(to)` - `(options &` [`copy_options::overwrite_existing`](copy_options.md)`) !=` [`copy_options::none`](copy_options.md) diff --git a/reference/functional/function_ref/op_constructor.md b/reference/functional/function_ref/op_constructor.md index 83be90fc2a..297237e90d 100644 --- a/reference/functional/function_ref/op_constructor.md +++ b/reference/functional/function_ref/op_constructor.md @@ -37,13 +37,13 @@ constexpr function_ref(const function_ref&) noexcept = default; // (6) `function_ref`クラステンプレートパラメータのCV修飾子 *cv* に応じて - (1) : [`is_function`](/reference/type_traits/is_function.md)``が`true`、かつ`is-invocable-using`が`true`であること -- (2) : `T`を[`remove_refernce_t`](/reference/type_traits/remove_reference.md)``としたとき +- (2) : `T`を[`remove_reference_t`](/reference/type_traits/remove_reference.md)``としたとき - [`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``が`function_ref`と同一型ではなく、かつ - [`is_member_pointer_v`](/reference/type_traits/is_member_pointer.md)``が`false`であり、かつ - `is-invocable-using`が`true`であること - (3) : `F`を`decltype(f)`としたとき - `is-invocable-using`が`true`であること -- (4) : `T`を[`remove_refernce_t`](/reference/type_traits/remove_reference.md)``、`F`を`decltype(f)`としたとき +- (4) : `T`を[`remove_reference_t`](/reference/type_traits/remove_reference.md)``、`F`を`decltype(f)`としたとき - [`is_rvalue_reference_v`](/reference/type_traits/is_rvalue_reference.md)``が`false`であり、かつ - `is-invocable-using`が`true`であること - (5) : `F`を`decltype(f)`としたとき diff --git a/reference/iterator/iter_const_reference_t.md b/reference/iterator/iter_const_reference_t.md index aefaf7a21c..7429fd03ce 100644 --- a/reference/iterator/iter_const_reference_t.md +++ b/reference/iterator/iter_const_reference_t.md @@ -39,9 +39,9 @@ namespace std { |[`std::vector`](/reference/vector/vector.md)|`bool`|`std::vector::reference`|`bool`| |`const std::vector`|`bool`|`bool`|`bool`| |[`views::zip`](/reference/ranges/zip_view.md)|`std::tuple`|`std::tuple`|`std::tuple`| -|[`views::enumrate`](/reference/ranges/enumrate_view.md.nolink)|`std::tuple`|`std::tuple`|`std::tuple`| +|[`views::enumerate`](/reference/ranges/enumerate_view.md)|`std::tuple`|`std::tuple`|`std::tuple`| -表中の`T, U`はそれそれの`view`に入力された範囲の値型、`D`は`views::enumrate`の入力範囲の`iter_difference_t`とする。 +表中の`T, U`はそれそれの`view`に入力された範囲の値型、`D`は`views::enumerate`の入力範囲の`iter_difference_t`とする。 ## 例 ```cpp example diff --git a/reference/linalg/conjugated_accessor/access.md b/reference/linalg/conjugated_accessor/access.md index 2e37604237..b5c55b6e2a 100644 --- a/reference/linalg/conjugated_accessor/access.md +++ b/reference/linalg/conjugated_accessor/access.md @@ -1,4 +1,4 @@ -# acccess +# access * linalg[meta header] * function[meta id-type] * std::linalg[meta namespace] diff --git a/reference/linalg/scaled_accessor/access.md b/reference/linalg/scaled_accessor/access.md index 57fa1055bb..1676f1c46e 100644 --- a/reference/linalg/scaled_accessor/access.md +++ b/reference/linalg/scaled_accessor/access.md @@ -1,4 +1,4 @@ -# acccess +# access * linalg[meta header] * function[meta id-type] * std::linalg[meta namespace] diff --git a/reference/linalg/transposed.md b/reference/linalg/transposed.md index f03034f6c2..d2e87da98a 100644 --- a/reference/linalg/transposed.md +++ b/reference/linalg/transposed.md @@ -114,7 +114,7 @@ int main() // transposed戻り値は書き換え可能なmdspan mat0[1, 2] = 42; // 6 -> 42 - asssert((mat1[2, 1] == 42)); + assert((mat1[2, 1] == 42)); } ``` * std::linalg::transposed[color ff0000] diff --git a/reference/mdspan/layout_left_padded/mapping/op_constructor.md b/reference/mdspan/layout_left_padded/mapping/op_constructor.md index fab88cd476..dad0d9a788 100644 --- a/reference/mdspan/layout_left_padded/mapping/op_constructor.md +++ b/reference/mdspan/layout_left_padded/mapping/op_constructor.md @@ -64,7 +64,7 @@ constexpr explicit(see below) ## 適格要件 -- (5) : `OhterExtents::`[`rank()`](../../extents/rank.md) `> 1`のとき、`(static-padding-stride ==` [`dynamic_extent`](/reference/span/dynamic_extent.md)`) || (OtherExtents::`[`static_extent`](../../extents/static_extent.md)`(0) == dynamic_extent) || (static-padding-stride == OtherExtents::static_extent(0))`が`true`であること。 +- (5) : `OtherExtents::`[`rank()`](../../extents/rank.md) `> 1`のとき、`(static-padding-stride ==` [`dynamic_extent`](/reference/span/dynamic_extent.md)`) || (OtherExtents::`[`static_extent`](../../extents/static_extent.md)`(0) == dynamic_extent) || (static-padding-stride == OtherExtents::static_extent(0))`が`true`であること。 - (7) : `rank_ > 1`のとき、`(padding_value ==` [`dynamic_extent`](/reference/span/dynamic_extent.md)`) || (LayoutLeftPaddedMapping::padding_value == dynamic_extent) || (padding_value == LayoutLeftPaddedMapping::padding_value)`が`true`であること。 diff --git a/reference/mdspan/layout_right_padded/mapping/op_constructor.md b/reference/mdspan/layout_right_padded/mapping/op_constructor.md index 5ae9da9d3a..cebd642716 100644 --- a/reference/mdspan/layout_right_padded/mapping/op_constructor.md +++ b/reference/mdspan/layout_right_padded/mapping/op_constructor.md @@ -63,7 +63,7 @@ constexpr explicit(see below) ## 適格要件 -- (5) : `OhterExtents::`[`rank()`](../../extents/rank.md) `> 1`のとき、`(static-padding-stride ==` [`dynamic_extent`](/reference/span/dynamic_extent.md)`) || (OtherExtents::`[`static_extent`](../../extents/static_extent.md)`(rank_ - 1) == dynamic_extent) || (static-padding-stride == OtherExtents::static_extent(rank_ - 1))`が`true`であること。 +- (5) : `OtherExtents::`[`rank()`](../../extents/rank.md) `> 1`のとき、`(static-padding-stride ==` [`dynamic_extent`](/reference/span/dynamic_extent.md)`) || (OtherExtents::`[`static_extent`](../../extents/static_extent.md)`(rank_ - 1) == dynamic_extent) || (static-padding-stride == OtherExtents::static_extent(rank_ - 1))`が`true`であること。 - (7) : `rank_ > 1`のとき、`(padding_value ==` [`dynamic_extent`](/reference/span/dynamic_extent.md)`) || (LayoutRightPaddedMapping::padding_value == dynamic_extent) || (padding_value == LayoutRightPaddedMapping::padding_value)`が`true`であること。 diff --git a/reference/mdspan/mdspan.md b/reference/mdspan/mdspan.md index 3d82ef40dd..410c68a77b 100644 --- a/reference/mdspan/mdspan.md +++ b/reference/mdspan/mdspan.md @@ -24,7 +24,7 @@ namespace std { `mdspan`は、任意のメモリブロックに対して多次元配列のようにアクセスする機能を提供するクラスである。 `mdspan`それ自体は参照先メモリブロックを所有せず、[`[]`演算子](mdspan/op_at.md)を介して多次元配列のように見せかけるビュー(view)にすぎない。 -クラスの名称`mdspan`は、1次元の範囲[`std::span`](../span/span.md)に対する多次元(MultiDimentional)拡張に由来する。 +クラスの名称`mdspan`は、1次元の範囲[`std::span`](../span/span.md)に対する多次元(MultiDimensional)拡張に由来する。 `mdspan`の特殊化`MDS`は[`copyable`](/reference/concepts/copyable.md)のモデルであり、かつ diff --git a/reference/memory/allocator/allocate_at_least.md b/reference/memory/allocator/allocate_at_least.md index fd447e41a6..750ed9c3d4 100644 --- a/reference/memory/allocator/allocate_at_least.md +++ b/reference/memory/allocator/allocate_at_least.md @@ -1,4 +1,4 @@ -# alloacte_at_least +# allocate_at_least * memory[meta header] * std[meta namespace] * allocator[meta class] diff --git a/reference/memory/allocator_traits/allocate_at_least.md b/reference/memory/allocator_traits/allocate_at_least.md index 4728c68c9e..ecb35b1e11 100644 --- a/reference/memory/allocator_traits/allocate_at_least.md +++ b/reference/memory/allocator_traits/allocate_at_least.md @@ -1,4 +1,4 @@ -# alloacte_at_least +# allocate_at_least * memory[meta header] * std[meta namespace] * allocator_traits[meta class] diff --git a/reference/memory/assume_aligned.md b/reference/memory/assume_aligned.md index a26985f03b..01bd575d0c 100644 --- a/reference/memory/assume_aligned.md +++ b/reference/memory/assume_aligned.md @@ -168,7 +168,7 @@ int main() { auto& pack = packs[ n ]; auto xmm = -#ifdef ASSUME_ALING_CPP20 +#ifdef ASSUME_ALIGN_CPP20 _mm_load_ps( std::assume_aligned< SSE_ALIGNMENT >( pack.data ) ); #elif defined( ASSUME_ALIGN_GCC_OR_CLANG ) _mm_load_ps( (float*)__builtin_assume_aligned( pack.data, SSE_ALIGNMENT ) ); From 8b03a33f6f98a154e1258934cf17d9d3110a02ed Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 15 Apr 2025 14:12:42 +0900 Subject: [PATCH 1530/3948] =?UTF-8?q?NG=E3=83=AF=E3=83=BC=E3=83=89?= =?UTF-8?q?=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF:=20=E4=BB=A5=E4=B8=8B?= =?UTF-8?q?=E3=81=AE=E3=82=B3=E3=83=9F=E3=83=83=E3=83=88=E3=81=AEtypo?= =?UTF-8?q?=E3=82=92=E7=99=BB=E9=8C=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/cpprefjp/site/commit/2107107379cde39744084d400cea41c89185e56b --- .github/workflows/script/ngword_check.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/script/ngword_check.py b/.github/workflows/script/ngword_check.py index 44103c0c6b..b55124e2aa 100644 --- a/.github/workflows/script/ngword_check.py +++ b/.github/workflows/script/ngword_check.py @@ -6,18 +6,31 @@ NGWORD_LIST = [ ("", "
", "
"), ("", "
", "
"), + ("", "acccess", "access"), + ("", "ALING", "ALIGN"), + ("", "alloacte", "allocate"), + ("", "asssert", "assert"), + ("", "asssume", "assume"), ("", "algined", "aligned"), ("", "concpet", "concept"), ("", "condtion", "condition"), + ("", "Dimentional", "Dimensional"), ("", "eror", "error"), + ("", "enumrate", "enumerate"), + ("", "expceted", "expected"), ("", "exposion", "exposition"), + ("", "functon", "function"), ("", "generetor", "generator"), ("", "greator", "greater"), ("", "namespase", "namespace"), ("", "noexpcet", "noexcept"), + ("", "oeprator", "operator"), ("", "opreator", "operator"), + ("", "opton", "option"), + ("", "Ohter", "Other"), ("", "protmise_type", "promise_type"), ("", "pvalue", "prvalue"), + ("", "refernce", "reference"), ("", "repear", "repeat"), ("", "std::range::", "std::ranges::"), ("", "swtich", "switch"), From d5b2bb2496ceec4c907632e19dd1f5c0baa35862 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 15 Apr 2025 16:37:36 +0900 Subject: [PATCH 1531/3948] =?UTF-8?q?C++26:=20=E3=80=8C=E5=8F=AF=E5=A4=89?= =?UTF-8?q?=E5=BC=95=E6=95=B0=E3=83=86=E3=83=B3=E3=83=97=E3=83=AC=E3=83=BC?= =?UTF-8?q?=E3=83=88=E3=81=A7friend=E5=AE=A3=E8=A8=80=E3=82=92=E3=81=A7?= =?UTF-8?q?=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=80=8D=E3=82=92=E8=BF=BD=E5=8A=A0=20(close=20#1329)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp11/variadic_templates.md | 1 + lang/cpp26.md | 2 +- lang/cpp26/variadic_friends.md | 113 +++++++++++++++++++++++++++++++ 4 files changed, 116 insertions(+), 2 deletions(-) create mode 100644 lang/cpp26/variadic_friends.md diff --git a/implementation-status.md b/implementation-status.md index 4d1e8e7117..87bad647fa 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -308,7 +308,7 @@ | P2809R3: [空の無限ループは未定義動作ではないと規定](/lang/cpp26/trivial_infinite_loops_are_not_undefined_behavior.md) | 並行プログラムの進行保証などを考慮して空の無限ループを未定義動作ではないものとする | 14 | 19 | | | | P2795R5: [未初期化変数の読み取りをエラー性動作とする](/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md) | 初期化されていない自動変数の読み取りの安全性を規定する | | | | | | P2573R2: [関数宣言を削除する理由を指定できるようにする](/lang/cpp26/delete_reason.md) | `f() = delete("reason");` | 15 | 19 | | | -| P2893R3: [可変引数テンプレートで`friend`宣言をできるようにする](/lang/cpp26/variadic_friends.md.nolink) | クラステンプレートの可変引数テンプレートでまとめて`friend`宣言できるようにする | 15 | | | | +| P2893R3: [可変引数テンプレートで`friend`宣言をできるようにする](/lang/cpp26/variadic_friends.md) | クラステンプレートの可変引数テンプレートでまとめて`friend`宣言できるようにする | 15 | | | | | P2747R2: [`constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md.nolink) | 定数式の文脈での配置`new`を許可 | 15 | | | | | P3144R2: [不完全型へのポインタに対する`delete`を不適格とする](/lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md.nolink) | 未定義動作を引き起こす操作をコンパイルエラーとする | 15 | 19 | | | | P2963R3: [制約式内での畳み込み式の順序付け](/lang/cpp26/ordering_of_constraints_involving_fold_expressions.md.nolink) | 畳み込み式では全体ではなく個別の制約を原子制約式として扱う | | 19 | | | diff --git a/lang/cpp11/variadic_templates.md b/lang/cpp11/variadic_templates.md index 6162618635..fc9e460dde 100644 --- a/lang/cpp11/variadic_templates.md +++ b/lang/cpp11/variadic_templates.md @@ -390,6 +390,7 @@ void f(const T1& t1, const T2& t2, const T3& t3); - [C++11 可変引数マクロ](variadic_macros.md) - [C++17 畳み込み式](/lang/cpp17/folding_expressions.md) - [C++26 パラメータパックへのインデックスアクセスを許可](/lang/cpp26/pack_indexing.md.nolink) +- [C++26 可変引数テンプレートで`friend`宣言をできるようにする](/lang/cpp26/variadic_friends.md) ## 参照 diff --git a/lang/cpp26.md b/lang/cpp26.md index 66c5dfbd6a..37759e1e65 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -69,7 +69,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 |----------|------| | [パラメータパックへのインデックスアクセスを許可](/lang/cpp26/pack_indexing.md.nolink) | 可変引数テンプレートのパラメータパックに添字アクセスできるようにする | | [制約式内での畳み込み式の順序付け](/lang/cpp26/ordering_of_constraints_involving_fold_expressions.md.nolink) | 畳み込み式では全体ではなく個別の制約を原子制約式として扱う | -| [可変引数テンプレートで`friend`宣言をできるようにする](/lang/cpp26/variadic_friends.md.nolink) | クラステンプレートの可変引数テンプレートでまとめて`friend`宣言できるようにする | +| [可変引数テンプレートで`friend`宣言をできるようにする](/lang/cpp26/variadic_friends.md) | クラステンプレートの可変引数テンプレートでまとめて`friend`宣言できるようにする | | [コンセプトと変数テンプレートにテンプレートテンプレートパラメータのサポートを追加](/lang/cpp26/concept_and_variable-template_template-parameters.md.nolink) | テンプレート引数をあとで指定するテンプレートテンプレートパラメータを、コンセプトと変数テンプレートでも使用できるようにする | diff --git a/lang/cpp26/variadic_friends.md b/lang/cpp26/variadic_friends.md new file mode 100644 index 0000000000..c98af4f3e2 --- /dev/null +++ b/lang/cpp26/variadic_friends.md @@ -0,0 +1,113 @@ +# 可変引数テンプレートでfriend宣言をできるようにする [P2893R3] +* cpp26[meta cpp] + + + +このページはC++26に採用される見込みの言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 + + + +## 概要 +C++26では、可変引数テンプレートのパラメータパックを、friend宣言に指定できるようになる。 + +```cpp +template +class Foo { + friend Ts...; // C++26: OK +}; +``` + +この指定により、パラメータパック`Ts`内のすべての型をfriend指定したことになる。 + + +### Passkeyイディオム +Passkeyイディオムを使用すると、メンバ関数ごとにアクセス許可をだすことができる。以下のプログラムでは、クラス`C`はクラス`A`にfriend関係を付与している。そのため、`A::m()`は`C`の内部構造すべてにアクセスできる。 + +しかし、`C`はPasskeyイディオムを使用して、`intentionalA()`と`intentionalB()`へのアクセスも許可している。`Passkey`クラスには、フレンド関係の`B`のみがアクセスできるプライベートコンストラクタがあるため、`B`のみが`Passkey`のインスタンスを作成できる。最初の引数として`Passkey`のインスタンスを指定せずに`intentionalB()`を呼び出すことはできない。そのため、`intentionalB()`は公開メンバ関数ではあるが、`B`からのみ呼び出すことができる。 + +```cpp +template +class Passkey { + friend T; + Passkey() {} +}; + +class A; +class B; + +class C { + friend A; +private: + void internal(); +public: + void intentionalA(Passkey); + void intentionalB(Passkey); +}; + +class A { + void m(C& c) { + c.internal(); // OK + c.intentionalA({}); // OK + c.intentionalB({}); // エラー!Passkeyのコンストラクタにアクセスできない + } +}; + +class B { + void m(C& c) { + c.intentionalB({}); // OK + } +}; +``` + +C++26ではこのイディオムを拡張し、複数のクラスに同時にアクセス許可を付与できるようになる。 + +```cpp +template +class Passkey { + friend Ts...; + Passkey() {} +}; + +class C { +public: + // Blarg, Blip, Bazクラスからのみ呼び出せる + void intentional(Passkey); +}; +``` + + +### 派生クラスへのCRTPアクセス +クラステンプレートから継承する際、派生クラスの型を基底クラスのテンプレート引数として指定するイディオムが「CRTP (Curiously Recurring Template Pattern、奇妙に再帰したテンプレートパターン)」と呼ばれている。このイディオムでも、可変引数テンプレートでfriend宣言できるようになることが有用である。 + +派生クラスの一部APIが基底クラスで必要となる場合があり、基底クラスでのみ必要であるためそのAPIはprivateにして、基底クラスにのみアクセスを許可したいことがある。そういった状況で、C++26での可変引数テンプレートでのfriend宣言が必要になる。 + +```cpp +template +class Receiver { + void receive(MsgT) { + static_cast(this)->private_ += 1; + } +}; + +template +struct Dispatcher : + public Receiver, MsgTs>... // OK。可変引数テンプレートでの継承 +{ + using Receiver::Receiver...; // OK。可変引数テンプレートでのusing宣言 + friend Receiver...; // C++26: OK + +private: + int private_; +}; +``` + + +## 関連項目 +- [C++11 可変引数テンプレート](/lang/cpp11/variadic_templates.md) + + +## 参照 +- [P2893R3 Variadic friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2893r3.html) + From 6137b03cdbc9079845bbf6dd8e20b7e010fb5cad Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 16 Apr 2025 00:33:52 +0900 Subject: [PATCH 1532/3948] execution/env/query: refinement (#1384) --- reference/execution/execution/env/query.md | 24 ++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/reference/execution/execution/env/query.md b/reference/execution/execution/env/query.md index 171fa25daa..bf238c6d9f 100644 --- a/reference/execution/execution/env/query.md +++ b/reference/execution/execution/env/query.md @@ -26,6 +26,7 @@ concept has-query = }; ``` + ## 効果 説明用の`fe`を、`env`クラステンプレートの説明専用メンバ変数`envs0_`, ..., `envsN_`のうち最初に式`fe.query(q)`が適格となる要素としたとき、下記と等価。 @@ -33,8 +34,10 @@ concept has-query = return fe.query(q); ``` + ## 例外 -式`fe.query(q)`が`true`のとき、例外送出しない。 +式`noexcept(fe.query(q))`が`true`のとき、例外送出しない。 +それ以外の場合、式`fe.query(q)`から送出される例外。 ## 例 @@ -46,19 +49,28 @@ using ex = std::execution; int main() { - auto env = ex::env{ - ex::prop(std::get_stop_token, std::stop_token{}), + // get_stop_token,get_stop_tokenをサポートするクエリ可能オブジェクト + auto env0 = ex::env{ ex::prop(std::get_allocator, std::allocator{}), - ex::prop(std::get_stop_token, std::never_stop_token{}), + ex::prop(std::get_stop_token, std::never_stop_token{}) }; + auto token0 = env0.query(std::get_stop_token); + static_assert(std::same_as); - auto token = env.query(std::get_stop_token); - static_assert(std::same_as); + // env0のget_stop_tokenクエリオブジェクト動作を上書き + auto env1 = ex::env{ + ex::prop(std::get_stop_token, std::stop_token{}), + env0 + }; + auto token1 = env1.query(std::get_stop_token); + static_assert(std::same_as); } ``` * query[color ff0000] * ex::env[link ../env.md] * ex::prop[link ../prop.md] +* ex::never_stop_token[link /reference/stop_token/never_stop_token.md] +* ex::stop_token[link /reference/stop_token/stop_token.md] ### 出力 ``` From 659e33c441fb95040c5a0995a5f930ef3f9c8753 Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 16 Apr 2025 21:34:18 +0900 Subject: [PATCH 1533/3948] =?UTF-8?q?execution/queryable:=20=E3=82=AF?= =?UTF-8?q?=E3=82=A8=E3=83=AA=E5=8F=AF=E8=83=BD=E3=82=AA=E3=83=96=E3=82=B8?= =?UTF-8?q?=E3=82=A7=E3=82=AF=E3=83=88=E8=AA=AC=E6=98=8E=20(#1384)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/execution/execution.md | 4 ++-- .../execution/completion_signatures_of_t.md | 2 +- reference/execution/execution/env.md | 12 ++++++++--- reference/execution/execution/env/query.md | 10 +++++---- reference/execution/execution/prop.md | 3 ++- reference/execution/execution/sender_in.md | 2 +- reference/execution/queryable.md | 21 ++++++++++++++++++- 7 files changed, 41 insertions(+), 13 deletions(-) diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 15206c6579..f8ab73ba50 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -47,8 +47,8 @@ namespace std::execution { | [`execution::get_completion_scheduler`](execution/get_completion_scheduler.md.nolink) | 完了Scheduler取得のクエリオブジェクト (customization point object) | C++26 | | [`execution::get_env`](execution/get_env.md.nolink) | 環境取得のクエリオブジェクト (customization point object) | C++26 | | [`execution::env_of_t`](execution/env_of_t.md.nolink) | 指定型から環境型を取得 (alias template) | C++26 | -| [`execution::prop`](execution/prop.md) | 環境構築用のヘルパクラス (class template) | C++26 | -| [`execution::env`](execution/env.md) | 環境 (class template) | C++26 | +| [`execution::prop`](execution/prop.md) | Key/Valueペアによる[クエリ可能オブジェクト](queryable.md) (class template) | C++26 | +| [`execution::env`](execution/env.md) | 複数Key/Valueからなる[クエリ可能オブジェクト](queryable.md) (class template) | C++26 | クエリオブジェクトは名前空間 `std` および名前空間 `std::execution` で定義される。 diff --git a/reference/execution/execution/completion_signatures_of_t.md b/reference/execution/execution/completion_signatures_of_t.md index 6429a27147..51bf731bd2 100644 --- a/reference/execution/execution/completion_signatures_of_t.md +++ b/reference/execution/execution/completion_signatures_of_t.md @@ -18,7 +18,7 @@ namespace std::execution { ## 概要 -[Sender型](sender.md)`Sndr`から[環境](env.md)`Env`における[完了シグネチャ集合](completion_signatures.md)を取得する。 +[Sender型](sender.md)`Sndr`から[環境](../queryable.md)`Env`における[完了シグネチャ集合](completion_signatures.md)を取得する。 ## バージョン diff --git a/reference/execution/execution/env.md b/reference/execution/execution/env.md index 4ebb6362c5..947d376b42 100644 --- a/reference/execution/execution/env.md +++ b/reference/execution/execution/env.md @@ -12,9 +12,6 @@ namespace std::execution { Envs1 envs1_; // exposition only // ... EnvsN envsN_; // exposition only - - template - constexpr decltype(auto) query(QueryTag q) const noexcept; }; template @@ -50,13 +47,22 @@ namespace ex = std::execution; int main() { + // get_allocatorとget_stop_tokenをサポートするクエリ可能オブジェクト auto env = ex::env{ + ex::prop(std::get_allocator, std::allocator{}), ex::prop(std::get_stop_token, std::never_stop_token{}) }; + + // メモリアロケータを問い合わせ + auto alloc = std::get_allocator(env); + // 停止トークンを問い合わせ + auto token = std::get_stop_token(env); } ``` * ex::env[color ff0000] * ex::prop[link prop.md] +* std::get_allocator[link get_allocator.md.nolink] +* std::get_stop_token[link get_stop_token.md.nolink] * std::never_stop_token[link /reference/stop_token/never_stop_token.md] ### 出力 diff --git a/reference/execution/execution/env/query.md b/reference/execution/execution/env/query.md index bf238c6d9f..dbd030f8f4 100644 --- a/reference/execution/execution/env/query.md +++ b/reference/execution/execution/env/query.md @@ -12,7 +12,7 @@ constexpr decltype(auto) query(QueryTag q) const noexcept(see below); * see below[italic] ## 概要 -クエリオブジェクト`q`に対して問い合わせを行う。 +クエリオブジェクト`q`をキーとして、対応する値を問い合わせる。 ## テンプレートパラメータ制約 @@ -49,7 +49,7 @@ using ex = std::execution; int main() { - // get_stop_token,get_stop_tokenをサポートするクエリ可能オブジェクト + // get_allocatorとget_stop_tokenをサポートするクエリ可能オブジェクト auto env0 = ex::env{ ex::prop(std::get_allocator, std::allocator{}), ex::prop(std::get_stop_token, std::never_stop_token{}) @@ -69,8 +69,10 @@ int main() * query[color ff0000] * ex::env[link ../env.md] * ex::prop[link ../prop.md] -* ex::never_stop_token[link /reference/stop_token/never_stop_token.md] -* ex::stop_token[link /reference/stop_token/stop_token.md] +* std::get_allocator[link get_allocator.md.nolink] +* std::get_stop_token[link get_stop_token.md.nolink] +* std::never_stop_token[link /reference/stop_token/never_stop_token.md] +* std::stop_token[link /reference/stop_token/stop_token.md] ### 出力 ``` diff --git a/reference/execution/execution/prop.md b/reference/execution/execution/prop.md index 064085cf1b..893422d1fb 100644 --- a/reference/execution/execution/prop.md +++ b/reference/execution/execution/prop.md @@ -23,7 +23,7 @@ namespace std::execution { * unwrap_reference_t[link /reference/type_traits/unwrap_reference.md] ## 概要 -`QueryTag`型クエリオブジェクトのキーと`ValueType`型の値から、読み取り専用の[クエリ可能オブジェクト](../queryable.md)を構築する。 +`QueryTag`型クエリオブジェクトのキーと`ValueType`型の値から、[クエリ可能オブジェクト](../queryable.md)を構築する。 ## 適格要件 @@ -49,6 +49,7 @@ int main() } ``` * ex::prop[color ff0000] +* std::get_stop_token[link get_stop_token.md.nolink] * std::never_stop_token[link /reference/stop_token/never_stop_token.md] ### 出力 diff --git a/reference/execution/execution/sender_in.md b/reference/execution/execution/sender_in.md index 1ef582f4d7..ef3469e1b7 100644 --- a/reference/execution/execution/sender_in.md +++ b/reference/execution/execution/sender_in.md @@ -22,7 +22,7 @@ namespace std::execution { * get_completion_signatures[link get_completion_signatures.md.nolink] ## 概要 -`sender_in`は、[Sender型](sender.md)`Sndr`が[環境](env.md)`Env`において非同期操作を作成できることを表すコンセプトである。 +`sender_in`は、[Sender型](sender.md)`Sndr`が[環境](../queryable.md)`Env`において非同期操作を作成できることを表すコンセプトである。 ## モデル diff --git a/reference/execution/queryable.md b/reference/execution/queryable.md index 346b7d0385..721edfd1dc 100644 --- a/reference/execution/queryable.md +++ b/reference/execution/queryable.md @@ -11,7 +11,22 @@ concept queryable = destructible; * destructible[link /reference/concepts/destructible.md] ## 概要 -`queryable`は、型`T`がクエリ可能オブジェクトの制約を満たすことを表す説明専用のコンセプトである。 +`queryable`は、型`T`がクエリ可能オブジェクト(queryable object)の制約を満たすことを表す説明専用のコンセプトである。 + + +### クエリ可能オブジェクト +クエリ可能オブジェクトは、クエリオブジェクト(query object)をキーとして対応する値を保持する、読み取り専用のKey/Valueデータ構造とみなせる。 + +- [`execution::env<>{}`](execution/env.md) : 空(empty)のクエリ可能オブジェクト +- [`execution::prop(q, v)`](execution/prop.md) : キー`q`と対応値`v`を保持する最小のクエリ可能オブジェクト +- [`execution::env<>{...}`](execution/env.md) : 複数のKey/Valueを保持するクエリ可能オブジェクト +- `queryable`コンセプトを満たすユーザ定義クラスのオブジェクト + +実行制御ライブラリでは、下記のオブジェクトがクエリ可能オブジェクトとされる。 + +- [Sender](execution/sender.md)に関連付けられた属性(attributes)オブジェクト +- [Receiver](execution/receiver.md)に関連付けられた環境(environment)オブジェクト +- [Scheduler](execution/scheduler.md)オブジェクト自身 ## モデル @@ -19,6 +34,10 @@ concept queryable = destructible; 呼び出し可能オブジェクト`q`と部分式パック`args`に対して、`requires { q(env, args...) }`が`true`であれば、`q(env, args...)`が`q`に課されるセマンティック要件を満たす場合に、`Env`は`queryable`のモデルである。 +## 備考 +[Sender](execution/sender.md)に関連付けられたクエリ可能オブジェクトは、C++ライブラリ仕様では「属性(attributes)」と呼ばれる。 + + ## バージョン ### 言語 - C++26 From 38bbbb9cfa8cd584d3099b5d19578f2df58fa38c Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 16 Apr 2025 22:16:40 +0900 Subject: [PATCH 1534/3948] execution: get_env,env_of_t (#1384) --- reference/execution/execution.md | 4 +- reference/execution/execution/env_of_t.md | 38 +++++++++++ reference/execution/execution/get_env.md | 79 ++++++++++++++++++++++ reference/execution/execution/receiver.md | 2 +- reference/execution/execution/scheduler.md | 4 +- reference/execution/execution/sender.md | 2 +- reference/execution/execution/sender_to.md | 2 +- reference/execution/queryable.md | 2 +- 8 files changed, 125 insertions(+), 8 deletions(-) create mode 100644 reference/execution/execution/env_of_t.md create mode 100644 reference/execution/execution/get_env.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index f8ab73ba50..9d6627c0aa 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -45,8 +45,8 @@ namespace std::execution { | [`execution::forward_progress_guarantee`](execution/forward_progress_guarantee.md.nolink) | 前進保証 (enum) | C++26 | | [`execution::get_forward_progress_guarantee`](execution/get_forward_progress_guarantee.md.nolink) | 前進保証取得のクエリオブジェクト (customization point object) | C++26 | | [`execution::get_completion_scheduler`](execution/get_completion_scheduler.md.nolink) | 完了Scheduler取得のクエリオブジェクト (customization point object) | C++26 | -| [`execution::get_env`](execution/get_env.md.nolink) | 環境取得のクエリオブジェクト (customization point object) | C++26 | -| [`execution::env_of_t`](execution/env_of_t.md.nolink) | 指定型から環境型を取得 (alias template) | C++26 | +| [`execution::get_env`](execution/get_env.md) | 環境取得のクエリオブジェクト (customization point object) | C++26 | +| [`execution::env_of_t`](execution/env_of_t.md) | 指定型から環境型を取得 (alias template) | C++26 | | [`execution::prop`](execution/prop.md) | Key/Valueペアによる[クエリ可能オブジェクト](queryable.md) (class template) | C++26 | | [`execution::env`](execution/env.md) | 複数Key/Valueからなる[クエリ可能オブジェクト](queryable.md) (class template) | C++26 | diff --git a/reference/execution/execution/env_of_t.md b/reference/execution/execution/env_of_t.md new file mode 100644 index 0000000000..c3e2f6149b --- /dev/null +++ b/reference/execution/execution/env_of_t.md @@ -0,0 +1,38 @@ +# env_of_t +* execution[meta header] +* std::execution[meta namespace] +* type-alias[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template + using env_of_t = decltype(get_env(declval())); +} +``` +* get_env[link get_env.md] + +## 概要 +型`T`に関連付けられた[クエリ可能オブジェクト](../queryable.md)の型を取得する。 + +- [Sender](sender.md)に関連付けられた属性 +- [Receiver](receiver.md)に関連付けられた環境 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::get_env`](get_env.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/get_env.md b/reference/execution/execution/get_env.md new file mode 100644 index 0000000000..a6afad75c0 --- /dev/null +++ b/reference/execution/execution/get_env.md @@ -0,0 +1,79 @@ +# get_env +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct get_env_t { unspecified }; + inline constexpr get_env_t get_env{}; +} +``` +* unspecified[italic] + +## 概要 +`get_env`は、対象オブジェクトに関連付けられた[クエリ可能オブジェクト](../queryable.md)を取得するカスタマイゼーションポイントオブジェクトである。 + +- [Sender](sender.md)に関連付けられた属性 +- [Receiver](receiver.md)に関連付けられた環境 + + +## 効果 +式`get_env(o)`は下記と等価であり、[`queryable`](../queryable.md)を満たす型の値となる。 + +- 引数`o`がconst修飾された`co`を用いて、式`co.get_env()`が有効であればその値。 +- そうでなければ、空(empty)のクエリ可能オブジェクト[`env<>{}`](env.md) + + +## 例外 +投げない + + +## カスタマイゼーションポイント +const修飾された対象オブジェクト`co`に対して式`co.get_env()`が呼び出される。 +このとき、`noexcept(co.get_env()) == true`であること。 + + +## 備考 +[Sender](sender.md)に関連付けられたクエリ可能オブジェクトは「属性(attributes)」と呼ばれるが、本`get_env`を用いてクエリ可能オブジェクトを取得する。実行制御ライブラリ仕様検討中には専用の`get_attrs`として存在していたが、同じ動作セマンティクスを持つ`get_env`に統合された経緯がある。 + + +## 例 +```cpp example +#include +namespace ex = std::execution; + +int main() +{ + ex::sender auto sndr = ex::just(42); + auto env = ex::get_env(sndr); +} +``` +* ex::get_env[color ff0000] +* ex::sender[link sender.md] +* ex::just[link just.md.nolink] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::sender`](sender.md) +- [`execution::receiver`](receiver.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/receiver.md b/reference/execution/execution/receiver.md index bb7c461983..8cd67b2e6d 100644 --- a/reference/execution/execution/receiver.md +++ b/reference/execution/execution/receiver.md @@ -18,7 +18,7 @@ namespace std::execution { struct receiver_t {}; // タグ型 } ``` -* get_env[link get_env.md.nolink] +* get_env[link get_env.md] * queryable[link ../queryable.md] * derived_from[link /reference/concepts/derived_from.md] * move_constructible[link /reference/concepts/move_constructible.md] diff --git a/reference/execution/execution/scheduler.md b/reference/execution/execution/scheduler.md index a89bb8d477..2ffa3efc00 100644 --- a/reference/execution/execution/scheduler.md +++ b/reference/execution/execution/scheduler.md @@ -27,7 +27,7 @@ namespace std::execution { * queryable[link ../queryable.md] * get_completion_scheduler[link get_completion_scheduler.md.nolink] * set_value_t[link set_value.md] -* get_env[link get_env.md.nolink] +* get_env[link get_env.md] * equality_comparable[link /reference/concepts/equality_comparable.md] * copyable[link /reference/concepts/copyable.md] @@ -40,7 +40,7 @@ namespace std::execution { - [クエリ可能オブジェクト](../queryable.md)であること - `Sch`型の値`sch`に対して下記が有効な式であること - [`execution::schedule`](schedule.md.nolink)`(sch)`が[Sender](sender.md)を返すこと - - [`execution::get_completion_scheduler`](get_completion_scheduler.md.nolink)`<`[`set_value_t`](set_value.md)`>(`[`execution::get_env`](get_env.md.nolink)`(`[`execution::schedule`](schedule.md.nolink)`(sch)))`の結果が`Sch`型に等しいこと + - [`execution::get_completion_scheduler`](get_completion_scheduler.md.nolink)`<`[`set_value_t`](set_value.md)`>(`[`execution::get_env`](get_env.md)`(`[`execution::schedule`](schedule.md.nolink)`(sch)))`の結果が`Sch`型に等しいこと ## 例 diff --git a/reference/execution/execution/sender.md b/reference/execution/execution/sender.md index 7d065640ce..ad481ee9f8 100644 --- a/reference/execution/execution/sender.md +++ b/reference/execution/execution/sender.md @@ -65,7 +65,7 @@ concept sender = move_constructible> && constructible_from, Sndr>; ``` -* get_env[link get_env.md.nolink] +* get_env[link get_env.md] * queryable[link ../queryable.md] * move_constructible[link /reference/concepts/move_constructible.md] * constructible_from[link /reference/concepts/constructible_from.md] diff --git a/reference/execution/execution/sender_to.md b/reference/execution/execution/sender_to.md index 45082ae5eb..e11295a746 100644 --- a/reference/execution/execution/sender_to.md +++ b/reference/execution/execution/sender_to.md @@ -16,7 +16,7 @@ namespace std::execution { } ``` * sender_in[link sender_in.md] -* env_of_t[link env_of_t.md.nolink] +* env_of_t[link env_of_t.md] * receiver_of[link receiver_of.md] * completion_signatures_of_t[link completion_signatures_of_t.md] * connect[link connect.md.nolink] diff --git a/reference/execution/queryable.md b/reference/execution/queryable.md index 721edfd1dc..b294e0e10a 100644 --- a/reference/execution/queryable.md +++ b/reference/execution/queryable.md @@ -19,7 +19,7 @@ concept queryable = destructible; - [`execution::env<>{}`](execution/env.md) : 空(empty)のクエリ可能オブジェクト - [`execution::prop(q, v)`](execution/prop.md) : キー`q`と対応値`v`を保持する最小のクエリ可能オブジェクト -- [`execution::env<>{...}`](execution/env.md) : 複数のKey/Valueを保持するクエリ可能オブジェクト +- [`execution::env{...}`](execution/env.md) : 複数のKey/Valueを保持するクエリ可能オブジェクト - `queryable`コンセプトを満たすユーザ定義クラスのオブジェクト 実行制御ライブラリでは、下記のオブジェクトがクエリ可能オブジェクトとされる。 From f156adb9d5e2ce38c574a5cdf2e0dddd74d5a604 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 18 Apr 2025 14:03:42 +0900 Subject: [PATCH 1535/3948] execution: default_domain (#1384) --- reference/execution/execution.md | 6 +- .../execution/execution/default_domain.md | 56 +++++++++++++++++++ .../execution/default_domain/apply_sender.md | 53 ++++++++++++++++++ .../execution/default_domain/transform_env.md | 55 ++++++++++++++++++ .../default_domain/transform_sender.md | 55 ++++++++++++++++++ reference/execution/queryable.md | 7 ++- 6 files changed, 226 insertions(+), 6 deletions(-) create mode 100644 reference/execution/execution/default_domain.md create mode 100644 reference/execution/execution/default_domain/apply_sender.md create mode 100644 reference/execution/execution/default_domain/transform_env.md create mode 100644 reference/execution/execution/default_domain/transform_sender.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 9d6627c0aa..3dabb2457e 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -79,7 +79,7 @@ namespace std::execution { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`execution::default_domain`](execution/default_domain.md.nolink) | デフォルト実行ドメイン (class) | C++26 | +| [`execution::default_domain`](execution/default_domain.md) | デフォルト実行ドメイン (class) | C++26 | | [`execution::sender`](execution/sender.md) | Sender型 (concept) | C++26 | | [`execution::sender_in`](execution/sender_in.md) | 指定環境で有効なSender (concept) | C++26 | | [`execution::sender_to`](execution/sender_to.md) | 指定Receiverに接続可能なSender (concept) | C++26 | @@ -90,8 +90,8 @@ namespace std::execution { | [`execution::sends_stopped`](execution/value_types_of_t.md.nolink) | Senderが停止完了に対応するか否か (variable template) | C++26 | | [`execution::tag_of_t`](execution/tag_of_t.md.nolink) | Senderのタグ型を取得 (alias template) | C++26 | | [`execution::transform_sender`](execution/transform_sender.md.nolink) | Senderを変換 (function template) | C++26 | -| [`execution::transform_env`](execution/transform_env.md.nolink) | クエリオブジェクトを変換 (function template) | C++26 | -| [`execution::apply_sender`](execution/apply_sender.md.nolink) | Senderにタグ型と引数を適用 (function template) | C++26 | +| [`execution::transform_env`](execution/transform_env.md.nolink) | 環境を変換 (function template) | C++26 | +| [`execution::apply_sender`](execution/apply_sender.md.nolink) | Senderアルゴリズムを適用 (function template) | C++26 | | [`execution::connect`](execution/connect.md.nolink) | SenderとReceiverを接続 (customization point object) | C++26 | | [`execution::connect_result_t`](execution/connect_result_t.md.nolink) | `connect`結果型を取得 (alias template) | C++26 | diff --git a/reference/execution/execution/default_domain.md b/reference/execution/execution/default_domain.md new file mode 100644 index 0000000000..acd7dfed7e --- /dev/null +++ b/reference/execution/execution/default_domain.md @@ -0,0 +1,56 @@ +# default_domain +* execution[meta header] +* class[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + class default_domain; +} +``` + +## 概要 +実行制御ライブラリのデフォルト実行ドメイン。 + +### 実行ドメイン +実行ドメイン(domain)は、[Sender](sender.md)や[環境](../queryable.md)の変換動作、Senderアルゴリズム適用動作をカスタマイズするためのタグ型である。 + +実行ドメインは下記関数に対するカスタマイゼーションポイントとして機能する。 + +- [`execution​::​transform_sender`](​transform_sender.md.nolink) : Senderの変換 +- [`execution​::transform_env`](transform_env.md.nolink) : 環境の変換 +- [`execution​::apply_sender`](apply_sender.md.nolink) : Senderアルゴリズム適用 + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|-----------------|----------------|----------------| +| `(constructor)` | コンストラクタ | C++26 | +| `(destructor)` | デストラクタ | C++26 | +| [`transform_sender`](default_domain/transform_sender.md) | Sender変換のデフォルト動作 | C++26 | +| [`transform_env`](default_domain/transform_env.md) | 環境変換のデフォルト動作 | C++26 | +| [`apply_sender`](default_domain/apply_sender.md) | Senderアルゴリズム適用のデフォルト動作 | C++26 | + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution​::​transform_sender`](​transform_sender.md.nolink) +- [`execution​::transform_env`](transform_env.md.nolink) +- [`execution​::apply_sender`](apply_sender.md.nolink) + + +## 参照 +- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/default_domain/apply_sender.md b/reference/execution/execution/default_domain/apply_sender.md new file mode 100644 index 0000000000..3b56dafa42 --- /dev/null +++ b/reference/execution/execution/default_domain/apply_sender.md @@ -0,0 +1,53 @@ +# apply_sender +* execution[meta header] +* function template[meta id-type] +* std::execution[meta namespace] +* default_domain[meta class] +* cpp26[meta cpp] + +```cpp +template +constexpr decltype(auto) apply_sender(Tag, Sndr&& sndr, Args&&... args) + noexcept(see below); +``` +* sender[link ../sender.md] +* see below[italic] + +## 概要 +Senderアルゴリズム適用のデフォルト動作。 +[`execution​::apply_sender`](../apply_sender.md.nolink)に対するスタマイゼーションポイントとして機能する。 + +[Senderのタグ型](../tag_of_t.md.nolink)`Tag`に対して、`apply_sender`メンバ関数を呼び出す。 + + +## テンプレートパラメータ制約 +説明用の式`e`を`Tag().apply_sender(`[`std::forward`](/reference/utility/forward.md)`(sndr), `[`std::forward`](/reference/utility/forward.md)`(args)...)`としたとき、が適格であること。 + + +## 戻り値 +`e`を返す。 + + +## 例外 +`noexcept(e)`が`true`であれば、例外を投げない。 +そうでなければ、式`e`から送出される例外。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution​::apply_sender`](../apply_sender.md.nolink) + + +## 参照 +- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/default_domain/transform_env.md b/reference/execution/execution/default_domain/transform_env.md new file mode 100644 index 0000000000..bdf425c46d --- /dev/null +++ b/reference/execution/execution/default_domain/transform_env.md @@ -0,0 +1,55 @@ +# transform_env +* execution[meta header] +* function template[meta id-type] +* std::execution[meta namespace] +* default_domain[meta class] +* cpp26[meta cpp] + +```cpp +template + constexpr queryable decltype(auto) transform_env(Sndr&& sndr, Env&& env) noexcept; +``` +* sender[link ../sender.md] +* queryable[link ../../queryable.md] + +## 概要 +環境変換のデフォルト動作。 +[`execution​::​transform_env`](../​transform_env.md.nolink)に対するスタマイゼーションポイントとして機能する。 + +- 定義されていれば、[Senderのタグ型](../tag_of_t.md.nolink)の`transform_env`メンバ関数に変換動作を委譲する。 +- そうでなければ、無変換。 + + +## 適格要件 +後述する式`e`に対して、`noexcept(e) == true` + + +## 効果 +説明用の式`e`を次の通りとしたとき、`e`を返す。 + +- 適格ならば、式[`tag_of_t`](tag_of_t.md.nolink)`().transform_env(`[`std::forward`](/reference/utility/forward.md)`(sndr),` [`std::forward`](/reference/utility/forward.md)`(env))` +- そうでなければ、`static_cast(`[`std​::​forward`](/reference/utility/forward.md)`(env))` + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution​::transform_env`](../transform_env.md.nolink) + + +## 参照 +- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/default_domain/transform_sender.md b/reference/execution/execution/default_domain/transform_sender.md new file mode 100644 index 0000000000..caf2f33241 --- /dev/null +++ b/reference/execution/execution/default_domain/transform_sender.md @@ -0,0 +1,55 @@ +# transform_sender +* execution[meta header] +* function template[meta id-type] +* std::execution[meta namespace] +* default_domain[meta class] +* cpp26[meta cpp] + +```cpp +template + requires (sizeof...(Env) <= 1) +constexpr sender decltype(auto) transform_sender(Sndr&& sndr, const Env&... env) + noexcept(see below); +``` +* sender[link ../sender.md] +* queryable[link ../../queryable.md] +* see below[italic] + +## 概要 +Sender変換のデフォルト動作。 +[`execution​::​transform_sender`](../​transform_sender.md.nolink)に対するスタマイゼーションポイントとして機能する。 + +- 定義されていれば、[Senderのタグ型](../tag_of_t.md.nolink)の`transform_sender`メンバ関数に変換動作を委譲する。 +- そうでなければ、無変換。 + + +## 効果 +説明用の式`e`を次の通りとしたとき、`e`を返す。 + +- 適格ならば、式[`tag_of_t`](tag_of_t.md.nolink)`().transform_sender(`[`std::forward(sndr)`](/reference/utility/forward.md)`, env...)` +- そうでなければ、[`std​::​forward`](/reference/utility/forward.md)`(sndr)` + + +## 例外 +`noexcept(e)`が`true`であれば、例外を投げない。 +そうでなければ、式`e`から送出される例外。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution​::​transform_sender`](../​transform_sender.md.nolink) + + +## 参照 +- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/queryable.md b/reference/execution/queryable.md index b294e0e10a..f5f95c9b91 100644 --- a/reference/execution/queryable.md +++ b/reference/execution/queryable.md @@ -24,8 +24,8 @@ concept queryable = destructible; 実行制御ライブラリでは、下記のオブジェクトがクエリ可能オブジェクトとされる。 -- [Sender](execution/sender.md)に関連付けられた属性(attributes)オブジェクト -- [Receiver](execution/receiver.md)に関連付けられた環境(environment)オブジェクト +- [Sender](execution/sender.md)に関連付けられた属性(attributes)オブジェクト([`execution::get_env`](execution/get_env.md)で取得) +- [Receiver](execution/receiver.md)に関連付けられた環境(environment)オブジェクト([`execution::get_env`](execution/get_env.md)で取得) - [Scheduler](execution/scheduler.md)オブジェクト自身 @@ -35,7 +35,7 @@ concept queryable = destructible; ## 備考 -[Sender](execution/sender.md)に関連付けられたクエリ可能オブジェクトは、C++ライブラリ仕様では「属性(attributes)」と呼ばれる。 +[Sender](execution/sender.md)に関連付けられたクエリ可能オブジェクトは「属性(attributes)」と呼ばれるが、実行制御ライブラリの仕様記述では[Receiver](execution/receiver.md)の「環境(environment)」と合わせて`Env`型や識別子名`env`として包括的に言及される。 ## バージョン @@ -46,6 +46,7 @@ concept queryable = destructible; ## 関連項目 - [`execution::prop`](execution/prop.md) - [`execution::env`](execution/env.md) +- [`execution::get_env`](execution/get_env.md) ## 参照 From 0ff48a6037b53dcf2c96b8f7df318d5447fa22dc Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 18 Apr 2025 14:09:13 +0900 Subject: [PATCH 1536/3948] execution/default: remove forbid chars --- reference/execution/execution/default_domain.md | 12 ++++++------ .../execution/default_domain/apply_sender.md | 4 ++-- .../execution/default_domain/transform_env.md | 6 +++--- .../execution/default_domain/transform_sender.md | 7 ++++--- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/reference/execution/execution/default_domain.md b/reference/execution/execution/default_domain.md index acd7dfed7e..88a37370ea 100644 --- a/reference/execution/execution/default_domain.md +++ b/reference/execution/execution/default_domain.md @@ -18,9 +18,9 @@ namespace std::execution { 実行ドメインは下記関数に対するカスタマイゼーションポイントとして機能する。 -- [`execution​::​transform_sender`](​transform_sender.md.nolink) : Senderの変換 -- [`execution​::transform_env`](transform_env.md.nolink) : 環境の変換 -- [`execution​::apply_sender`](apply_sender.md.nolink) : Senderアルゴリズム適用 +- [`execution::transform_sender`](transform_sender.md.nolink) : Senderの変換 +- [`execution::transform_env`](transform_env.md.nolink) : 環境の変換 +- [`execution::apply_sender`](apply_sender.md.nolink) : Senderアルゴリズム適用 ## メンバ関数 @@ -46,9 +46,9 @@ namespace std::execution { ## 関連項目 -- [`execution​::​transform_sender`](​transform_sender.md.nolink) -- [`execution​::transform_env`](transform_env.md.nolink) -- [`execution​::apply_sender`](apply_sender.md.nolink) +- [`execution::transform_sender`](transform_sender.md.nolink) +- [`execution::transform_env`](transform_env.md.nolink) +- [`execution::apply_sender`](apply_sender.md.nolink) ## 参照 diff --git a/reference/execution/execution/default_domain/apply_sender.md b/reference/execution/execution/default_domain/apply_sender.md index 3b56dafa42..927bdb9064 100644 --- a/reference/execution/execution/default_domain/apply_sender.md +++ b/reference/execution/execution/default_domain/apply_sender.md @@ -15,7 +15,7 @@ constexpr decltype(auto) apply_sender(Tag, Sndr&& sndr, Args&&... args) ## 概要 Senderアルゴリズム適用のデフォルト動作。 -[`execution​::apply_sender`](../apply_sender.md.nolink)に対するスタマイゼーションポイントとして機能する。 +[`execution::apply_sender`](../apply_sender.md.nolink)に対するスタマイゼーションポイントとして機能する。 [Senderのタグ型](../tag_of_t.md.nolink)`Tag`に対して、`apply_sender`メンバ関数を呼び出す。 @@ -45,7 +45,7 @@ Senderアルゴリズム適用のデフォルト動作。 ## 関連項目 -- [`execution​::apply_sender`](../apply_sender.md.nolink) +- [`execution::apply_sender`](../apply_sender.md.nolink) ## 参照 diff --git a/reference/execution/execution/default_domain/transform_env.md b/reference/execution/execution/default_domain/transform_env.md index bdf425c46d..82b436b90c 100644 --- a/reference/execution/execution/default_domain/transform_env.md +++ b/reference/execution/execution/default_domain/transform_env.md @@ -14,7 +14,7 @@ template ## 概要 環境変換のデフォルト動作。 -[`execution​::​transform_env`](../​transform_env.md.nolink)に対するスタマイゼーションポイントとして機能する。 +[`execution::transform_env`](../transform_env.md.nolink)に対するスタマイゼーションポイントとして機能する。 - 定義されていれば、[Senderのタグ型](../tag_of_t.md.nolink)の`transform_env`メンバ関数に変換動作を委譲する。 - そうでなければ、無変換。 @@ -28,7 +28,7 @@ template 説明用の式`e`を次の通りとしたとき、`e`を返す。 - 適格ならば、式[`tag_of_t`](tag_of_t.md.nolink)`().transform_env(`[`std::forward`](/reference/utility/forward.md)`(sndr),` [`std::forward`](/reference/utility/forward.md)`(env))` -- そうでなければ、`static_cast(`[`std​::​forward`](/reference/utility/forward.md)`(env))` +- そうでなければ、`static_cast(`[`std::forward`](/reference/utility/forward.md)`(env))` ## 例外 @@ -47,7 +47,7 @@ template ## 関連項目 -- [`execution​::transform_env`](../transform_env.md.nolink) +- [`execution::transform_env`](../transform_env.md.nolink) ## 参照 diff --git a/reference/execution/execution/default_domain/transform_sender.md b/reference/execution/execution/default_domain/transform_sender.md index caf2f33241..3d9b94d6d5 100644 --- a/reference/execution/execution/default_domain/transform_sender.md +++ b/reference/execution/execution/default_domain/transform_sender.md @@ -17,7 +17,7 @@ constexpr sender decltype(auto) transform_sender(Sndr&& sndr, const Env&... env) ## 概要 Sender変換のデフォルト動作。 -[`execution​::​transform_sender`](../​transform_sender.md.nolink)に対するスタマイゼーションポイントとして機能する。 +[`execution::transform_sender`](../transform_sender.md.nolink)に対するスタマイゼーションポイントとして機能する。 - 定義されていれば、[Senderのタグ型](../tag_of_t.md.nolink)の`transform_sender`メンバ関数に変換動作を委譲する。 - そうでなければ、無変換。 @@ -27,7 +27,7 @@ Sender変換のデフォルト動作。 説明用の式`e`を次の通りとしたとき、`e`を返す。 - 適格ならば、式[`tag_of_t`](tag_of_t.md.nolink)`().transform_sender(`[`std::forward(sndr)`](/reference/utility/forward.md)`, env...)` -- そうでなければ、[`std​::​forward`](/reference/utility/forward.md)`(sndr)` +- そうでなければ、[`std::forward`](/reference/utility/forward.md)`(sndr)` ## 例外 @@ -35,6 +35,7 @@ Sender変換のデフォルト動作。 そうでなければ、式`e`から送出される例外。 + ## バージョン ### 言語 - C++26 @@ -47,7 +48,7 @@ Sender変換のデフォルト動作。 ## 関連項目 -- [`execution​::​transform_sender`](../​transform_sender.md.nolink) +- [`execution::transform_sender`](../transform_sender.md.nolink) ## 参照 From d516cba28eba6b7a596fb312b05ba44a388272ec Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 18 Apr 2025 15:17:05 +0900 Subject: [PATCH 1537/3948] execution: transform_{sender,env},apply_sender (#1384) --- reference/execution/execution.md | 6 +- reference/execution/execution/apply_sender.md | 58 +++++++++++++++++ .../execution/execution/default_domain.md | 12 ++-- .../execution/default_domain/apply_sender.md | 10 +-- .../execution/default_domain/transform_env.md | 6 +- .../default_domain/transform_sender.md | 11 ++-- .../execution/execution/transform_env.md | 56 ++++++++++++++++ .../execution/execution/transform_sender.md | 65 +++++++++++++++++++ 8 files changed, 201 insertions(+), 23 deletions(-) create mode 100644 reference/execution/execution/apply_sender.md create mode 100644 reference/execution/execution/transform_env.md create mode 100644 reference/execution/execution/transform_sender.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 3dabb2457e..85a741a114 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -89,9 +89,9 @@ namespace std::execution { | [`execution::error_types_of_t`](execution/error_types_of_t.md.nolink) | Senderのエラー完了型を取得 (alias template) | C++26 | | [`execution::sends_stopped`](execution/value_types_of_t.md.nolink) | Senderが停止完了に対応するか否か (variable template) | C++26 | | [`execution::tag_of_t`](execution/tag_of_t.md.nolink) | Senderのタグ型を取得 (alias template) | C++26 | -| [`execution::transform_sender`](execution/transform_sender.md.nolink) | Senderを変換 (function template) | C++26 | -| [`execution::transform_env`](execution/transform_env.md.nolink) | 環境を変換 (function template) | C++26 | -| [`execution::apply_sender`](execution/apply_sender.md.nolink) | Senderアルゴリズムを適用 (function template) | C++26 | +| [`execution::transform_sender`](execution/transform_sender.md) | Senderを変換 (function template) | C++26 | +| [`execution::transform_env`](execution/transform_env.md) | 環境を変換 (function template) | C++26 | +| [`execution::apply_sender`](execution/apply_sender.md) | Senderアルゴリズムを適用 (function template) | C++26 | | [`execution::connect`](execution/connect.md.nolink) | SenderとReceiverを接続 (customization point object) | C++26 | | [`execution::connect_result_t`](execution/connect_result_t.md.nolink) | `connect`結果型を取得 (alias template) | C++26 | diff --git a/reference/execution/execution/apply_sender.md b/reference/execution/execution/apply_sender.md new file mode 100644 index 0000000000..9a8aec2afb --- /dev/null +++ b/reference/execution/execution/apply_sender.md @@ -0,0 +1,58 @@ +# apply_sender +* execution[meta header] +* function template[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template + constexpr decltype(auto) apply_sender(Domain dom, Tag, Sndr&& sndr, Args&&... args) + noexcept(see below); +} +``` +* sender[link sender.md] +* see below[italic] + +## 概要 +[実行ドメイン](default_domain.md)に応じてSenderアルゴリズムを適用する。 +Senderアルゴリズム動作のカスタマイゼーションポイントとして機能する。 + +- 定義されていれば、`dom.apply_sender`メンバ関数に適用動作を委譲する。 +- そうでなければ、デフォルト実行ドメイン[`apply_sender`](default_domain/apply_sender.md)に適用動作を委譲する。 + + +## テンプレートパラメータ制約 +説明用の式`e`を次の通りとしたとき、式`e`が適格であること。 + +- 適格ならば、式`dom.apply_sender(Tag(),` [`std::forward`](/reference/utility/forward.md)`(sndr),` [`std::forward`](/reference/utility/forward.md)`(args)...)` +- そうでなければ、[`default_domain()`](default_domain.md)`.`[`apply_sender`](default_domain/apply_sender.md)`(Tag(),` [`std::forward`](/reference/utility/forward.md)`(sndr),` [`std::forward`](/reference/utility/forward.md)`(args)...)` + + +## 戻り値 +`e`を返す。 + + +## 例外 +`noexcept(e) == true`ならば、例外を投げない。 +そうでなければ、式`e`から送出される例外。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`default_domain::apply_sender`](default_domain/apply_sender.md) + + +## 参照 +- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/default_domain.md b/reference/execution/execution/default_domain.md index 88a37370ea..1d154a7cfd 100644 --- a/reference/execution/execution/default_domain.md +++ b/reference/execution/execution/default_domain.md @@ -18,9 +18,9 @@ namespace std::execution { 実行ドメインは下記関数に対するカスタマイゼーションポイントとして機能する。 -- [`execution::transform_sender`](transform_sender.md.nolink) : Senderの変換 -- [`execution::transform_env`](transform_env.md.nolink) : 環境の変換 -- [`execution::apply_sender`](apply_sender.md.nolink) : Senderアルゴリズム適用 +- [`execution::transform_sender`](transform_sender.md) : Senderの変換 +- [`execution::transform_env`](transform_env.md) : 環境の変換 +- [`execution::apply_sender`](apply_sender.md) : Senderアルゴリズム適用 ## メンバ関数 @@ -46,9 +46,9 @@ namespace std::execution { ## 関連項目 -- [`execution::transform_sender`](transform_sender.md.nolink) -- [`execution::transform_env`](transform_env.md.nolink) -- [`execution::apply_sender`](apply_sender.md.nolink) +- [`execution::transform_sender`](transform_sender.md) +- [`execution::transform_env`](transform_env.md) +- [`execution::apply_sender`](apply_sender.md) ## 参照 diff --git a/reference/execution/execution/default_domain/apply_sender.md b/reference/execution/execution/default_domain/apply_sender.md index 927bdb9064..0cfb8669cd 100644 --- a/reference/execution/execution/default_domain/apply_sender.md +++ b/reference/execution/execution/default_domain/apply_sender.md @@ -15,13 +15,13 @@ constexpr decltype(auto) apply_sender(Tag, Sndr&& sndr, Args&&... args) ## 概要 Senderアルゴリズム適用のデフォルト動作。 -[`execution::apply_sender`](../apply_sender.md.nolink)に対するスタマイゼーションポイントとして機能する。 +[`execution::apply_sender`](../apply_sender.md)に対するスタマイゼーションポイントとして機能する。 -[Senderのタグ型](../tag_of_t.md.nolink)`Tag`に対して、`apply_sender`メンバ関数を呼び出す。 +[Senderタグ型](../tag_of_t.md.nolink)`Tag`に対して、`apply_sender`メンバ関数を呼び出す。 ## テンプレートパラメータ制約 -説明用の式`e`を`Tag().apply_sender(`[`std::forward`](/reference/utility/forward.md)`(sndr), `[`std::forward`](/reference/utility/forward.md)`(args)...)`としたとき、が適格であること。 +説明用の式`e`を`Tag().apply_sender(`[`std::forward`](/reference/utility/forward.md)`(sndr), `[`std::forward`](/reference/utility/forward.md)`(args)...)`としたとき、式`e`が適格であること。 ## 戻り値 @@ -29,7 +29,7 @@ Senderアルゴリズム適用のデフォルト動作。 ## 例外 -`noexcept(e)`が`true`であれば、例外を投げない。 +`noexcept(e) == true`ならば、例外を投げない。 そうでなければ、式`e`から送出される例外。 @@ -45,7 +45,7 @@ Senderアルゴリズム適用のデフォルト動作。 ## 関連項目 -- [`execution::apply_sender`](../apply_sender.md.nolink) +- [`execution::apply_sender`](../apply_sender.md) ## 参照 diff --git a/reference/execution/execution/default_domain/transform_env.md b/reference/execution/execution/default_domain/transform_env.md index 82b436b90c..84446c7ce7 100644 --- a/reference/execution/execution/default_domain/transform_env.md +++ b/reference/execution/execution/default_domain/transform_env.md @@ -14,9 +14,9 @@ template ## 概要 環境変換のデフォルト動作。 -[`execution::transform_env`](../transform_env.md.nolink)に対するスタマイゼーションポイントとして機能する。 +[`execution::transform_env`](../transform_env.md)に対するスタマイゼーションポイントとして機能する。 -- 定義されていれば、[Senderのタグ型](../tag_of_t.md.nolink)の`transform_env`メンバ関数に変換動作を委譲する。 +- 定義されていれば、[Senderタグ型](../tag_of_t.md.nolink)の`transform_env`メンバ関数に変換動作を委譲する。 - そうでなければ、無変換。 @@ -47,7 +47,7 @@ template ## 関連項目 -- [`execution::transform_env`](../transform_env.md.nolink) +- [`execution::transform_env`](../transform_env.md) ## 参照 diff --git a/reference/execution/execution/default_domain/transform_sender.md b/reference/execution/execution/default_domain/transform_sender.md index 3d9b94d6d5..9e4f863518 100644 --- a/reference/execution/execution/default_domain/transform_sender.md +++ b/reference/execution/execution/default_domain/transform_sender.md @@ -17,25 +17,24 @@ constexpr sender decltype(auto) transform_sender(Sndr&& sndr, const Env&... env) ## 概要 Sender変換のデフォルト動作。 -[`execution::transform_sender`](../transform_sender.md.nolink)に対するスタマイゼーションポイントとして機能する。 +[`execution::transform_sender`](../transform_sender.md)に対するスタマイゼーションポイントとして機能する。 -- 定義されていれば、[Senderのタグ型](../tag_of_t.md.nolink)の`transform_sender`メンバ関数に変換動作を委譲する。 +- 定義されていれば、[Senderタグ型](../tag_of_t.md.nolink)の`transform_sender`メンバ関数に変換動作を委譲する。 - そうでなければ、無変換。 ## 効果 説明用の式`e`を次の通りとしたとき、`e`を返す。 -- 適格ならば、式[`tag_of_t`](tag_of_t.md.nolink)`().transform_sender(`[`std::forward(sndr)`](/reference/utility/forward.md)`, env...)` +- 適格ならば、式[`tag_of_t`](tag_of_t.md.nolink)`().transform_sender(`[`std::forward`](/reference/utility/forward.md)`(sndr)`, env...)` - そうでなければ、[`std::forward`](/reference/utility/forward.md)`(sndr)` ## 例外 -`noexcept(e)`が`true`であれば、例外を投げない。 +`noexcept(e) == true`ならば、例外を投げない。 そうでなければ、式`e`から送出される例外。 - ## バージョン ### 言語 - C++26 @@ -48,7 +47,7 @@ Sender変換のデフォルト動作。 ## 関連項目 -- [`execution::transform_sender`](../transform_sender.md.nolink) +- [`execution::transform_sender`](../transform_sender.md) ## 参照 diff --git a/reference/execution/execution/transform_env.md b/reference/execution/execution/transform_env.md new file mode 100644 index 0000000000..991deaa90e --- /dev/null +++ b/reference/execution/execution/transform_env.md @@ -0,0 +1,56 @@ +# transform_env +* execution[meta header] +* function template[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template + constexpr queryable decltype(auto) transform_env(Domain dom, Sndr&& sndr, Env&& env) noexcept; +} +``` +* sender[link sender.md] +* queryable[link ../queryable.md] + +## 概要 +[実行ドメイン](default_domain.md)に応じて[環境](../queryable.md)を変換する。 +ユーザ定義実行ドメインにおいて、再帰的Sender変換における補助的なカスタマイゼーションポイントとして機能する。 + +- 定義されていれば、`dom.transform_env`メンバ関数に変換動作を委譲する。 +- そうでなければ、デフォルト実行ドメイン[`transform_env`](default_domain/transform_env.md)に変換動作を委譲する。 + + +## 適格要件 +後述する式`e`に対して、`noexcept(e) == true` + + +## 戻り値 +説明用の式`e`を次の通りとし、`e`を返す。 + +- 適格ならば、式`dom.transform_env(`[`std::forward`](/reference/utility/forward.md)`(sndr),` [`std::forward`](/reference/utility/forward.md)`(env))` +- そうでなければ、[`default_domain()`](default_domain.md)`.`[`transform_env`](default_domain/transform_env.md)`(`[`std::forward`](/reference/utility/forward.md)`(sndr),` [`std::forward`](/reference/utility/forward.md)`(env))` + + +## 例外 +投げない。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`default_domain::transform_env`](default_domain/transform_env.md) + + +## 参照 +- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/transform_sender.md b/reference/execution/execution/transform_sender.md new file mode 100644 index 0000000000..d534a65452 --- /dev/null +++ b/reference/execution/execution/transform_sender.md @@ -0,0 +1,65 @@ +# transform_sender +* execution[meta header] +* function template[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template + requires (sizeof...(Env) <= 1) + constexpr sender decltype(auto) transform_sender(Domain dom, Sndr&& sndr, const Env&... env) + noexcept(see below); +} +``` +* sender[link sender.md] +* queryable[link ../queryable.md] +* see below[italic] + +## 概要 +[実行ドメイン](default_domain.md)に応じて[Sender](sender.md)を変換する。 +Senderオブジェクトの構築時、Senderと[Receiver](receiver.md)間[接続(connect)](../connect.md.nolink)のカスタマイゼーションポイントとして機能する。 + +型変換ではSender型の変換が行われなくなる(恒等変換となる)まで、下記のカスタマイゼーションポイントを再帰的に呼び出す。 + +- 定義されていれば、`dom.transform_sender`メンバ関数に変換動作を委譲する。 +- そうでなければ、デフォルト実行ドメイン[`transform_sender`](default_domain/transform_sender.md)に変換動作を委譲する。 + + +## 戻り値 +説明用の式`transformed-sndr`を次の通りとする。 + +- 適格ならば、式`dom.transform_sender(`[`std::forward`](/reference/utility/forward.md)`(sndr), env...)` +- そうでなければ、[`default_domain()`](default_domain.md)`.`[`transform_sender`](default_domain/transform_sender.md)`(`[`std::forward`](/reference/utility/forward.md)`(sndr), env...)` + +説明用の式`final-sndr`を次の通りとする。 + +- `sndr`と`transformed-sndr`の型がCV修飾を無視して同一ならば、`transformed-sndr` +- そうでなければ、式`transform_sender(dom, transformed-sndr, env...)`(再帰適用) + +`final-sndr`を返す。 + + +## 例外 +`noexcept(final-sndr) == true`ならば、例外を投げない。 +そうでなければ、Sender変換過程で送出される例外。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`default_domain::transform_sender`](default_domain/transform_sender.md) + + +## 参照 +- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) From 252f02621f5ee2ecfd53586c82e530c0872ab7f5 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 18 Apr 2025 16:44:08 +0900 Subject: [PATCH 1538/3948] execution: connect,connect_result_t (#1384) --- reference/execution/execution.md | 4 +- reference/execution/execution/apply_sender.md | 2 +- reference/execution/execution/connect.md | 231 ++++++++++++++++++ .../execution/execution/connect_result_t.md | 36 +++ .../execution/default_domain/transform_env.md | 2 +- .../default_domain/transform_sender.md | 2 +- .../execution/execution/operation_state.md | 6 +- reference/execution/execution/sender_to.md | 4 +- .../execution/execution/transform_env.md | 2 +- .../execution/execution/transform_sender.md | 2 +- 10 files changed, 279 insertions(+), 12 deletions(-) create mode 100644 reference/execution/execution/connect.md create mode 100644 reference/execution/execution/connect_result_t.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 85a741a114..fbc0cf8ce7 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -92,8 +92,8 @@ namespace std::execution { | [`execution::transform_sender`](execution/transform_sender.md) | Senderを変換 (function template) | C++26 | | [`execution::transform_env`](execution/transform_env.md) | 環境を変換 (function template) | C++26 | | [`execution::apply_sender`](execution/apply_sender.md) | Senderアルゴリズムを適用 (function template) | C++26 | -| [`execution::connect`](execution/connect.md.nolink) | SenderとReceiverを接続 (customization point object) | C++26 | -| [`execution::connect_result_t`](execution/connect_result_t.md.nolink) | `connect`結果型を取得 (alias template) | C++26 | +| [`execution::connect`](execution/connect.md) | SenderとReceiverを接続 (customization point object) | C++26 | +| [`execution::connect_result_t`](execution/connect_result_t.md) | [`connect`](execution/connect.md)結果型を取得 (alias template) | C++26 | ### Senderファクトリ diff --git a/reference/execution/execution/apply_sender.md b/reference/execution/execution/apply_sender.md index 9a8aec2afb..6fcd234204 100644 --- a/reference/execution/execution/apply_sender.md +++ b/reference/execution/execution/apply_sender.md @@ -25,7 +25,7 @@ Senderアルゴリズム動作のカスタマイゼーションポイントと ## テンプレートパラメータ制約 説明用の式`e`を次の通りとしたとき、式`e`が適格であること。 -- 適格ならば、式`dom.apply_sender(Tag(),` [`std::forward`](/reference/utility/forward.md)`(sndr),` [`std::forward`](/reference/utility/forward.md)`(args)...)` +- 適格であるならば、式`dom.apply_sender(Tag(),` [`std::forward`](/reference/utility/forward.md)`(sndr),` [`std::forward`](/reference/utility/forward.md)`(args)...)` - そうでなければ、[`default_domain()`](default_domain.md)`.`[`apply_sender`](default_domain/apply_sender.md)`(Tag(),` [`std::forward`](/reference/utility/forward.md)`(sndr),` [`std::forward`](/reference/utility/forward.md)`(args)...)` diff --git a/reference/execution/execution/connect.md b/reference/execution/execution/connect.md new file mode 100644 index 0000000000..6674d0d49e --- /dev/null +++ b/reference/execution/execution/connect.md @@ -0,0 +1,231 @@ +# connect +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std { + struct connect_t; + inline constexpr connect_t connect{}; +} +``` + +## 概要 +`connect`は、[Sender](sender.md)と[Receiver](receiver.md)を接続した結果[Operation State](operation_state.md)を返すカスタマイゼーションポイントオブジェクトである。 + +カスタマイゼーションポイントオブジェクトの呼び出し式`connect(sndr, rcvr)`は、下記の動作となる。 + +- [`transform_sender`](transform_sender.md)を呼び出して、`sndr`を新しいSender`new_sndr`に変換する。大半のケースでは無変換。 +- 呼び出し式が適格であるならば、`return new_sndr.connect(rcvr)`相当。 +- そうでなければ、`new_sndr`を[コルーチンのAwaitable型](/lang/cpp20/coroutines.md)とみなして`rcvr`と接続した結果を返す。 + + +## 効果 +説明用の型`Sndr`を`decltype((sndr))`、型`Rcvr`を`decltype((rcvr))`とし、式`new_sndr`を次の通りとする。 +このとき[`sender`](sender.md)` &&` [`receiver`](receiver.md)` == true`であること。 + +```cpp +transform_sender(decltype(get-domain-late(sndr, get_env(rcvr))){}, sndr, get_env(rcvr)) +``` +* transform_sender[link transform_sender.md] +* get-domain-late[link get-domain-late.md.nolink] +* get_env[link get_env.md] + +式`connect(sndr, rcvr)`は下記と等価であり、[`operation_state`](operation_state.md)を満たす型の値となる。 + +- 適格であるならば、式`new_sndr.connect(rcvr)` +- そうでなければ、式`connect-awaitable(new_sndr, rcvr)` + + +### Awaitable接続用へルパ +説明用のクラス`connect-awaitable-promise`, `operation-state-task`をそれぞれ下記の通り定義する。 + +型`DS`を[`decay_t`](/reference/type_traits/decay.md)``、型`DR`を[`decay_t`](/reference/type_traits/decay.md)``とする。 + +```cpp +namespace std::execution { + struct connect-awaitable-promise : with-await-transform { + connect-awaitable-promise(DS&, DR& rcvr) noexcept : rcvr(rcvr) {} + + suspend_always initial_suspend() noexcept { return {}; } + [[noreturn]] suspend_always final_suspend() noexcept { terminate(); } + [[noreturn]] void unhandled_exception() noexcept { terminate(); } + [[noreturn]] void return_void() noexcept { terminate(); } + + coroutine_handle<> unhandled_stopped() noexcept { + set_stopped(std::move(rcvr)); + return noop_coroutine(); + } + + operation-state-task get_return_object() noexcept { + return operation-state-task{ + coroutine_handle::from_promise(*this)}; + } + + env_of_t get_env() const noexcept { + return execution::get_env(rcvr); + } + + private: + DR& rcvr; // exposition only + }; +} +``` +* suspend_always[link /reference/coroutine/suspend_always.md] +* coroutine_handle[link /reference/coroutine/coroutine_handle.md] +* set_stopped[link set_stopped.md] +* noop_coroutine()[link /reference/coroutine/noop_coroutine.md] +* from_promise[link /reference/coroutine/coroutine_handle/from_promise.md] +* env_of_t[link env_of_t.md] +* execution::get_env[link get_env.md] + +```cpp +namespace std::execution { + struct operation-state-task { // exposition only + using operation_state_concept = operation_state_t; + using promise_type = connect-awaitable-promise; + + explicit operation-state-task(coroutine_handle<> h) noexcept : coro(h) {} + operation-state-task(operation-state-task&&) = delete; + ~operation-state-task() { coro.destroy(); } + + void start() & noexcept { + coro.resume(); + } + + private: + coroutine_handle<> coro; // exposition only + }; +} +``` +* operation_state_t[link operation_state.md] +* coroutine_handle<>[link /reference/coroutine/coroutine_handle.md] +* destroy()[link /reference/coroutine/coroutine_handle/destroy.md] +* resume()[link /reference/coroutine/coroutine_handle/resume.md] + +`C`型の`c`と[コルーチンPromise型](/lang/cpp20/coroutines.md)の左辺値`p`に対して、`await-result-type`を`decltype(`[`GET-AWAITER`](../is-awaitable.md)`(c, p).`[`await_resume()`](/lang/cpp20/coroutines.md)`)`型とする。 +型`V`を`await-result-type`とする。 + +`SET-VALUE-SIG(T)`を、`T`がCV修飾された`void`ならば[`set_value_t`](set_value.md)`()`型、そうでなければ[`set_value_t`](set_value.md)`(T)`型とする。 +型`Sigs`を次の通り定義する。 + +```cpp +completion_signatures< + SET-VALUE-SIG(V), + set_error_t(exception_ptr), + set_stopped_t()> +``` +* set_error_t[link set_error.md] +* set_stopped[link set_stopped.md] +* exception_ptr[link /reference/exception/exception_ptr.md] +* SET-VALUE-SIG[italic] + +説明用のコールーチン`suspend-complete`を下記の通り定義する。 + +```cpp +namespace std::execution { + template + auto suspend-complete(Fun fun, Ts&&... as) noexcept { // exposition only + auto fn = [&, fun]() noexcept { fun(std::forward(as)...); }; + + struct awaiter { + decltype(fn) fn; // exposition only + + static constexpr bool await_ready() noexcept { return false; } + void await_suspend(coroutine_handle<>) noexcept { fn(); } + [[noreturn]] void await_resume() noexcept { unreachable(); } + }; + return awaiter{fn}; + } + + operation-state-task connect-awaitable(DS sndr, DR rcvr) requires receiver_of { + exception_ptr ep; + try { + if constexpr (same_as) { + co_await std::move(sndr); + co_await suspend-complete(set_value, std::move(rcvr)); + } else { + co_await suspend-complete(set_value, std::move(rcvr), co_await std::move(sndr)); + } + } catch(...) { + ep = current_exception(); + } + co_await suspend-complete(set_error, std::move(rcvr), std::move(ep)); + } +} +``` +* coroutine_handle<>[link /reference/coroutine/coroutine_handle.md] +* unreachable()[link /reference/utility/unreachable.md] +* receiver_of[link receiver_of.md] +* exception_ptr[link /reference/exception/exception_ptr.md] +* current_exception()[link /reference/exception/current_exception.md] + +## カスタマイゼーションポイント +Sender`sndr`[変換後](transform_sender.md)の`new_sndr`に対して、式`new_sndr.connect(rcvr)`が呼び出される。 + + +## 備考 +`connect`は[Sender](sender.md)内部実装から呼び出される想定であり、実行制御ライブラリ利用者が直接利用する必要はない。 + + +## 例 +```cpp +#include +#include +namespace ex = std::execution; + +struct ValueReceiver { + using receiver_concept = ex::receiver_t; + + void set_value(int v) && noexcept + { + std::println("{}", v); + } +}; + +int main() +{ + // 値42を送信するSender + ex::sender auto sndr = ex::just(42); + // int値を受信して表示するReceiver + ValueReceiver rcvr; + + // SenderとReceiverを接続 + ex::operation_state auto op = ex::connect(sndr, rcvr); + // Operation Stateを開始 + ex::start(op); +} +``` +* ex::connect[color ff0000] +* ex::receiver_t[link receiver.md] +* ex::sender[link sender.md] +* ex::just[link just.md.nolink] +* ex::operation_state[link operation_state.md] +* ex::start[link start.md.nolink] + +### 出力 +``` +42 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::sender`](sender.md) +- [`execution::receiver`](receiver.md) +- [`execution::operation_state`](operation_state.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/connect_result_t.md b/reference/execution/execution/connect_result_t.md new file mode 100644 index 0000000000..d3e3fd1598 --- /dev/null +++ b/reference/execution/execution/connect_result_t.md @@ -0,0 +1,36 @@ +# connect_result_t +* execution[meta header] +* std::execution[meta namespace] +* type-alias[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template + using connect_result_t = + decltype(connect(declval(), declval())); +} +``` +* connect[link connect.md] + +## 概要 +[Sender型](sender.md)`Sndr`と[Receiver型]`Rcvr`を[接続](connect.md)した結果の[Operation State型](operation_state.md)を取得する。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::connect`](connect.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/default_domain/transform_env.md b/reference/execution/execution/default_domain/transform_env.md index 84446c7ce7..f1afcc21bf 100644 --- a/reference/execution/execution/default_domain/transform_env.md +++ b/reference/execution/execution/default_domain/transform_env.md @@ -27,7 +27,7 @@ template ## 効果 説明用の式`e`を次の通りとしたとき、`e`を返す。 -- 適格ならば、式[`tag_of_t`](tag_of_t.md.nolink)`().transform_env(`[`std::forward`](/reference/utility/forward.md)`(sndr),` [`std::forward`](/reference/utility/forward.md)`(env))` +- 適格であるならば、式[`tag_of_t`](tag_of_t.md.nolink)`().transform_env(`[`std::forward`](/reference/utility/forward.md)`(sndr),` [`std::forward`](/reference/utility/forward.md)`(env))` - そうでなければ、`static_cast(`[`std::forward`](/reference/utility/forward.md)`(env))` diff --git a/reference/execution/execution/default_domain/transform_sender.md b/reference/execution/execution/default_domain/transform_sender.md index 9e4f863518..06f856bb70 100644 --- a/reference/execution/execution/default_domain/transform_sender.md +++ b/reference/execution/execution/default_domain/transform_sender.md @@ -26,7 +26,7 @@ Sender変換のデフォルト動作。 ## 効果 説明用の式`e`を次の通りとしたとき、`e`を返す。 -- 適格ならば、式[`tag_of_t`](tag_of_t.md.nolink)`().transform_sender(`[`std::forward`](/reference/utility/forward.md)`(sndr)`, env...)` +- 適格であるならば、式[`tag_of_t`](tag_of_t.md.nolink)`().transform_sender(`[`std::forward`](/reference/utility/forward.md)`(sndr), env...)` - そうでなければ、[`std::forward`](/reference/utility/forward.md)`(sndr)` diff --git a/reference/execution/execution/operation_state.md b/reference/execution/execution/operation_state.md index d221a8332e..f7e1a8626e 100644 --- a/reference/execution/execution/operation_state.md +++ b/reference/execution/execution/operation_state.md @@ -41,7 +41,7 @@ namespace ex = std::execution; struct ValueReceiver { using receiver_concept = ex::receiver_t; - void set_value(int v) noexcept + void set_value(int v) && noexcept { std::println("{}", v); } @@ -64,7 +64,7 @@ int main() * ex::receiver_t[link receiver.md] * ex::sender[link sender.md] * ex::just[link just.md.nolink] -* ex::connect[link connect.md.nolink] +* ex::connect[link connect.md] * ex::start[link start.md.nolink] ### 出力 @@ -85,7 +85,7 @@ int main() ## 関連項目 -- [`execution::connect`](connect.md.nolink) +- [`execution::connect`](connect.md) ## 参照 diff --git a/reference/execution/execution/sender_to.md b/reference/execution/execution/sender_to.md index e11295a746..72ed577e66 100644 --- a/reference/execution/execution/sender_to.md +++ b/reference/execution/execution/sender_to.md @@ -19,7 +19,7 @@ namespace std::execution { * env_of_t[link env_of_t.md] * receiver_of[link receiver_of.md] * completion_signatures_of_t[link completion_signatures_of_t.md] -* connect[link connect.md.nolink] +* connect[link connect.md] ## 概要 `sender_to`は、[Sender型](sender.md)`Sndr`が[Receiver型](receiver.md)`Rcvr`と接続可能であることを表すコンセプトである。 @@ -60,7 +60,7 @@ int main() * ex::sender[link sender.md] * ex::just[link just.md.nolink] * ex::operation_state[link operation_state.md] -* ex::connect[link connect.md.nolink] +* ex::connect[link connect.md] * ex::start[link start.md.nolink] ### 出力 diff --git a/reference/execution/execution/transform_env.md b/reference/execution/execution/transform_env.md index 991deaa90e..9d9d0c963b 100644 --- a/reference/execution/execution/transform_env.md +++ b/reference/execution/execution/transform_env.md @@ -28,7 +28,7 @@ namespace std::execution { ## 戻り値 説明用の式`e`を次の通りとし、`e`を返す。 -- 適格ならば、式`dom.transform_env(`[`std::forward`](/reference/utility/forward.md)`(sndr),` [`std::forward`](/reference/utility/forward.md)`(env))` +- 適格であるならば、式`dom.transform_env(`[`std::forward`](/reference/utility/forward.md)`(sndr),` [`std::forward`](/reference/utility/forward.md)`(env))` - そうでなければ、[`default_domain()`](default_domain.md)`.`[`transform_env`](default_domain/transform_env.md)`(`[`std::forward`](/reference/utility/forward.md)`(sndr),` [`std::forward`](/reference/utility/forward.md)`(env))` diff --git a/reference/execution/execution/transform_sender.md b/reference/execution/execution/transform_sender.md index d534a65452..a674393090 100644 --- a/reference/execution/execution/transform_sender.md +++ b/reference/execution/execution/transform_sender.md @@ -29,7 +29,7 @@ Senderオブジェクトの構築時、Senderと[Receiver](receiver.md)間[接 ## 戻り値 説明用の式`transformed-sndr`を次の通りとする。 -- 適格ならば、式`dom.transform_sender(`[`std::forward`](/reference/utility/forward.md)`(sndr), env...)` +- 適格であるならば、式`dom.transform_sender(`[`std::forward`](/reference/utility/forward.md)`(sndr), env...)` - そうでなければ、[`default_domain()`](default_domain.md)`.`[`transform_sender`](default_domain/transform_sender.md)`(`[`std::forward`](/reference/utility/forward.md)`(sndr), env...)` 説明用の式`final-sndr`を次の通りとする。 From 9bdfb06b23ad982838ea34914ec288a205f339f4 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 18 Apr 2025 17:15:49 +0900 Subject: [PATCH 1539/3948] execution: with-await-transform (#1384) --- reference/execution/execution/connect.md | 12 +++-- .../execution/execution/connect_result_t.md | 2 +- reference/execution/execution/sender.md | 1 + reference/execution/execution/sender_in.md | 2 +- .../execution/execution/transform_sender.md | 2 +- .../execution/with-await-transform.md | 47 +++++++++++++++++++ 6 files changed, 60 insertions(+), 6 deletions(-) create mode 100644 reference/execution/execution/with-await-transform.md diff --git a/reference/execution/execution/connect.md b/reference/execution/execution/connect.md index 6674d0d49e..31cecdaed5 100644 --- a/reference/execution/execution/connect.md +++ b/reference/execution/execution/connect.md @@ -16,8 +16,8 @@ namespace std { カスタマイゼーションポイントオブジェクトの呼び出し式`connect(sndr, rcvr)`は、下記の動作となる。 -- [`transform_sender`](transform_sender.md)を呼び出して、`sndr`を新しいSender`new_sndr`に変換する。大半のケースでは無変換。 -- 呼び出し式が適格であるならば、`return new_sndr.connect(rcvr)`相当。 +- [`transform_sender`](transform_sender.md)により`sndr`から新しいSender`new_sndr`へ変換する。(多くのケースで無変換) +- 呼び出し式が適格であるならば、`new_sndr.connect(rcvr)`を返す。 - そうでなければ、`new_sndr`を[コルーチンのAwaitable型](/lang/cpp20/coroutines.md)とみなして`rcvr`と接続した結果を返す。 @@ -72,9 +72,12 @@ namespace std::execution { }; } ``` +* with-await-transform[link with-await-transform.md] * suspend_always[link /reference/coroutine/suspend_always.md] +* terminate()[link /reference/exception/terminate.md] * coroutine_handle[link /reference/coroutine/coroutine_handle.md] * set_stopped[link set_stopped.md] +* std::move[link /reference/utility/move.md] * noop_coroutine()[link /reference/coroutine/noop_coroutine.md] * from_promise[link /reference/coroutine/coroutine_handle/from_promise.md] * env_of_t[link env_of_t.md] @@ -100,6 +103,7 @@ namespace std::execution { } ``` * operation_state_t[link operation_state.md] +* promise_type[link /lang/cpp20/coroutines.md] * coroutine_handle<>[link /reference/coroutine/coroutine_handle.md] * destroy()[link /reference/coroutine/coroutine_handle/destroy.md] * resume()[link /reference/coroutine/coroutine_handle/resume.md] @@ -117,7 +121,7 @@ completion_signatures< set_stopped_t()> ``` * set_error_t[link set_error.md] -* set_stopped[link set_stopped.md] +* set_stopped_t[link set_stopped.md] * exception_ptr[link /reference/exception/exception_ptr.md] * SET-VALUE-SIG[italic] @@ -159,8 +163,10 @@ namespace std::execution { * unreachable()[link /reference/utility/unreachable.md] * receiver_of[link receiver_of.md] * exception_ptr[link /reference/exception/exception_ptr.md] +* std::move[link /reference/utility/move.md] * current_exception()[link /reference/exception/current_exception.md] + ## カスタマイゼーションポイント Sender`sndr`[変換後](transform_sender.md)の`new_sndr`に対して、式`new_sndr.connect(rcvr)`が呼び出される。 diff --git a/reference/execution/execution/connect_result_t.md b/reference/execution/execution/connect_result_t.md index d3e3fd1598..5bc8f7de81 100644 --- a/reference/execution/execution/connect_result_t.md +++ b/reference/execution/execution/connect_result_t.md @@ -14,7 +14,7 @@ namespace std::execution { * connect[link connect.md] ## 概要 -[Sender型](sender.md)`Sndr`と[Receiver型]`Rcvr`を[接続](connect.md)した結果の[Operation State型](operation_state.md)を取得する。 +[Sender型](sender.md)`Sndr`と[Receiver型](receiver.md)`Rcvr`を[接続(connect)](connect.md)した結果の[Operation State型](operation_state.md)を取得する。 ## バージョン diff --git a/reference/execution/execution/sender.md b/reference/execution/execution/sender.md index ad481ee9f8..edee77eb3e 100644 --- a/reference/execution/execution/sender.md +++ b/reference/execution/execution/sender.md @@ -50,6 +50,7 @@ struct env-promise : with-await-transform> { * is-awaitable[link ../is-awaitable.md] * env<>[link env.md] * derived_from[link /reference/concepts/derived_from.md] +* with-await-transform[link with-await-transform.md] * coroutine_handle<>[link /reference/coroutine/coroutine_handle.md] * unspecified[italic] diff --git a/reference/execution/execution/sender_in.md b/reference/execution/execution/sender_in.md index ef3469e1b7..1689068924 100644 --- a/reference/execution/execution/sender_in.md +++ b/reference/execution/execution/sender_in.md @@ -38,7 +38,7 @@ concept valid-completion-signatures = see below; また、ある完了操作の完了シグネチャが[`completion_signatures_of_t`](completion_signatures_of_t.md)``で取得される[`completion_signatures`](completion_signatures.md)リストに含まれるとき、`Sndr`と`Env`における許容可能完了(permissible completion)となる。 -`sndr`と`rcvr`の接続後に[Operation State](operation_state.md)を開始することで評価されうる完了操作が、全て許容可能完了(permissible completion)である場合、`Sndr`と`Env`は`sender_in`のモデルとなる。 +`sndr`と`rcvr`の[接続](connect.md)後に[Operation State](operation_state.md)を開始することで評価されうる完了操作が、全て許容可能完了(permissible completion)である場合、`Sndr`と`Env`は`sender_in`のモデルとなる。 ## 例 diff --git a/reference/execution/execution/transform_sender.md b/reference/execution/execution/transform_sender.md index a674393090..11065a82e1 100644 --- a/reference/execution/execution/transform_sender.md +++ b/reference/execution/execution/transform_sender.md @@ -18,7 +18,7 @@ namespace std::execution { ## 概要 [実行ドメイン](default_domain.md)に応じて[Sender](sender.md)を変換する。 -Senderオブジェクトの構築時、Senderと[Receiver](receiver.md)間[接続(connect)](../connect.md.nolink)のカスタマイゼーションポイントとして機能する。 +Senderオブジェクトの構築時、Senderと[Receiver](receiver.md)間[接続(connect)](connect.md)時のカスタマイゼーションポイントとして機能する。 型変換ではSender型の変換が行われなくなる(恒等変換となる)まで、下記のカスタマイゼーションポイントを再帰的に呼び出す。 diff --git a/reference/execution/execution/with-await-transform.md b/reference/execution/execution/with-await-transform.md new file mode 100644 index 0000000000..6f8973a14e --- /dev/null +++ b/reference/execution/execution/with-await-transform.md @@ -0,0 +1,47 @@ +# with-await-transform +* execution[meta header] +* class template[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template + concept has-as-awaitable = // exposition only + requires (T&& t, Promise& p) { + { std::forward(t).as_awaitable(p) } -> is-awaitable; + }; + + template + struct with-await-transform { // exposition only + template + T&& await_transform(T&& value) noexcept { + return std::forward(value); + } + + template T> + decltype(auto) await_transform(T&& value) + noexcept(noexcept(std::forward(value).as_awaitable(declval()))) + { + return std::forward(value).as_awaitable(static_cast(*this)); + } + }; +} +``` +* is-awaitable[link ../is-awaitable.md] + +## 概要 +`with-await-transform`は、実行制御ライブラリの仕様定義で用いられる説明専用のクラステンプレートである。 + + +## バージョン +### 言語 +- C++26 + +## 関連項目 +- [`execution::sender`](sender.md) +- [`execution::connect`](connect.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) From 9cd16e01c774fa89524136ac5ed3b6f9f24e8d78 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 18 Apr 2025 18:09:46 +0900 Subject: [PATCH 1540/3948] execution: get-domain-late,sender-for (#1384) --- reference/execution/execution/connect.md | 4 +- .../execution/execution/get-domain-late.md | 58 +++++++++++++++++++ reference/execution/execution/sender-for.md | 32 ++++++++++ 3 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 reference/execution/execution/get-domain-late.md create mode 100644 reference/execution/execution/sender-for.md diff --git a/reference/execution/execution/connect.md b/reference/execution/execution/connect.md index 31cecdaed5..efcb2e0284 100644 --- a/reference/execution/execution/connect.md +++ b/reference/execution/execution/connect.md @@ -29,7 +29,7 @@ namespace std { transform_sender(decltype(get-domain-late(sndr, get_env(rcvr))){}, sndr, get_env(rcvr)) ``` * transform_sender[link transform_sender.md] -* get-domain-late[link get-domain-late.md.nolink] +* get-domain-late[link get-domain-late.md] * get_env[link get_env.md] 式`connect(sndr, rcvr)`は下記と等価であり、[`operation_state`](operation_state.md)を満たす型の値となる。 @@ -163,6 +163,8 @@ namespace std::execution { * unreachable()[link /reference/utility/unreachable.md] * receiver_of[link receiver_of.md] * exception_ptr[link /reference/exception/exception_ptr.md] +* set_value[link set_value.md] +* set_error[link set_error.md] * std::move[link /reference/utility/move.md] * current_exception()[link /reference/exception/current_exception.md] diff --git a/reference/execution/execution/get-domain-late.md b/reference/execution/execution/get-domain-late.md new file mode 100644 index 0000000000..7650a7dac0 --- /dev/null +++ b/reference/execution/execution/get-domain-late.md @@ -0,0 +1,58 @@ +# get-domain-late +* execution[meta header] +* function template[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +template +constexpr auto get-domain-late(const Sndr& sndr, const Env& env) noexcept; +``` + +## 概要 +[Sender](sender.md)と[Receiver](receiver.md)間[接続(connect)](connect.md)時のカスタマイゼーションポイントとして、[実行ドメイン](default_domain.md)を取得する説明専用の関数テンプレート。 + + +## 効果 +説明用の型`Domain`を下記の通り定義したとき、`return Doamin();`と等価。 + +- [`sender-for`](sender-for.md)` == true`のとき、次のラムダ式呼び出し結果の型とする。 + + ```cpp + [] { + auto [_, sch, _] = sndr; + return query-or-default(get_domain, sch, default_domain()); + }(); + ``` + * query-or-default[link query-or-default.md.nolink] + * get_domain[link get_domain.md.nolink] + * default_domain()[link default_domain.md] + +- それ以外のとき、下記リストのうち最初に妥当となる式の型、かつ`void`ではない型とする。 + - [`get_domain`](get_domain.md.nolink)`(`[`get_env`](get_env.md)`(sndr))` + - [`completion-domain`](completion-domain.md.nolink)`(sndr)` + - `get_domain(env)` + - `get_domain(`[`get_scheduler`](get_scheduler.md.nolink)`(env))` + - [`default_domain()`](default_domain.md) + + +## 例外 +投げない + + +## 備考 +Senderアダプタ[`continue_on`](continue_on.md.nolink)は[`schedule_from`](schedule_from.md.nolink)と連動して、実行コンテキスト遷移制御のカスタマイゼーションポイントをSchedulerに提供する。 + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`execution::connect`](connect.md) + + +## 参照 +- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/sender-for.md b/reference/execution/execution/sender-for.md new file mode 100644 index 0000000000..0c9d597971 --- /dev/null +++ b/reference/execution/execution/sender-for.md @@ -0,0 +1,32 @@ +# sender-for +* execution[meta header] +* concept[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template + concept sender-for = + sender && + same_as, Tag>; +} +``` +* sender[link sender.md] +* tag_of_t[link tag_of_t.md.nolink] + +## 概要 +`sender-for`は、[Sender型](sender.md)`Sndr`が[Senderタグ型](tag_of_t.md.nolink)`Tag`を持つことを表す説明専用のコンセプトである。 + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`execution::sender`](sender.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) From 6f4510e6199a3d86bec9eeb6becf11f395984de1 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 18 Apr 2025 18:23:56 +0900 Subject: [PATCH 1541/3948] execuion/connect: small fixes --- reference/execution/execution/connect.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/reference/execution/execution/connect.md b/reference/execution/execution/connect.md index efcb2e0284..926ca91fbd 100644 --- a/reference/execution/execution/connect.md +++ b/reference/execution/execution/connect.md @@ -5,7 +5,7 @@ * cpp26[meta cpp] ```cpp -namespace std { +namespace std::execution { struct connect_t; inline constexpr connect_t connect{}; } @@ -120,12 +120,13 @@ completion_signatures< set_error_t(exception_ptr), set_stopped_t()> ``` +* completion_signatures[link completion_signatures.md] * set_error_t[link set_error.md] * set_stopped_t[link set_stopped.md] * exception_ptr[link /reference/exception/exception_ptr.md] * SET-VALUE-SIG[italic] -説明用のコールーチン`suspend-complete`を下記の通り定義する。 +説明用の関数テンプレート`suspend-complete`とコルーチン`suspend-awaitable`を下記の通り定義する。 ```cpp namespace std::execution { From 60b29589147050de5bab98d1aa5c2b32f4c8f3e4 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 18 Apr 2025 23:58:28 +0900 Subject: [PATCH 1542/3948] execution: get_completion_signatures (#1384) --- reference/execution/execution.md | 4 +- .../execution/completion_signatures_of_t.md | 7 +- reference/execution/execution/env-promise.md | 45 +++++++++ .../execution/get_completion_signatures.md | 97 +++++++++++++++++++ reference/execution/execution/sender.md | 20 +--- reference/execution/execution/sender_in.md | 2 +- 6 files changed, 153 insertions(+), 22 deletions(-) create mode 100644 reference/execution/execution/env-promise.md create mode 100644 reference/execution/execution/get_completion_signatures.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index fbc0cf8ce7..26ea09f958 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -83,8 +83,8 @@ namespace std::execution { | [`execution::sender`](execution/sender.md) | Sender型 (concept) | C++26 | | [`execution::sender_in`](execution/sender_in.md) | 指定環境で有効なSender (concept) | C++26 | | [`execution::sender_to`](execution/sender_to.md) | 指定Receiverに接続可能なSender (concept) | C++26 | -| [`execution::get_completion_signatures`](execution/get_completion_signatures.md.nolink) | 完了シグネチャ集合取得のクエリオブジェクト (customization point object) | C++26 | -| [`execution::completion_signatures_of_t`](execution/completion_signatures_of_t.md) | Senderから完了シグネチャ集合を取得 (alias template) | C++26 | +| [`execution::get_completion_signatures`](execution/get_completion_signatures.md) | Senderの完了シグネチャ集合を取得 (customization point object) | C++26 | +| [`execution::completion_signatures_of_t`](execution/completion_signatures_of_t.md) | Senderの完了シグネチャ集合を取得 (alias template) | C++26 | | [`execution::value_types_of_t`](execution/value_types_of_t.md.nolink) | Senderの値完了型を取得 (alias template) | C++26 | | [`execution::error_types_of_t`](execution/error_types_of_t.md.nolink) | Senderのエラー完了型を取得 (alias template) | C++26 | | [`execution::sends_stopped`](execution/value_types_of_t.md.nolink) | Senderが停止完了に対応するか否か (variable template) | C++26 | diff --git a/reference/execution/execution/completion_signatures_of_t.md b/reference/execution/execution/completion_signatures_of_t.md index 51bf731bd2..3c2a386c88 100644 --- a/reference/execution/execution/completion_signatures_of_t.md +++ b/reference/execution/execution/completion_signatures_of_t.md @@ -14,10 +14,9 @@ namespace std::execution { * env<>[link env.md] * sender_in[link sender_in.md] * call-result-t[link call-result-t.md.nolink] -* sender_in[link sender_in.md] +* get_completion_signatures_t[link get_completion_signatures.md] ## 概要 - [Sender型](sender.md)`Sndr`から[環境](../queryable.md)`Env`における[完了シグネチャ集合](completion_signatures.md)を取得する。 @@ -32,5 +31,9 @@ namespace std::execution { - [Visual C++](/implementation.md#visual_cpp): ?? +## 関連項目 +- [`execution::get_completion_signatures`](get_completion_signatures.md) + + ## 参照 - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/env-promise.md b/reference/execution/execution/env-promise.md new file mode 100644 index 0000000000..dd745db64a --- /dev/null +++ b/reference/execution/execution/env-promise.md @@ -0,0 +1,45 @@ +# env-promise +* execution[meta header] +* class template[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template + struct env-promise : with-await-transform> { // exposition only + unspecified get_return_object() noexcept; + unspecified initial_suspend() noexcept; + unspecified final_suspend() noexcept; + void unhandled_exception() noexcept; + void return_void() noexcept; + coroutine_handle<> unhandled_stopped() noexcept; + + const Env& get_env() const noexcept; + }; +} +``` +* with-await-transform[link with-await-transform.md] +* coroutine_handle<>[link /reference/coroutine/coroutine_handle.md] +* unspecified[italic] + +## 概要 +`env-promise`は、実行制御ライブラリの仕様定義で用いられる説明専用のクラステンプレートである。 + + +## 備考 +`env-promise`の特殊化は型導出のみで利用されるため、各メンバ関数の定義は必要ない。 + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`execution::sender`](sender.md) +- [`execution::get_completion_signatures`](get_completion_signatures.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/get_completion_signatures.md b/reference/execution/execution/get_completion_signatures.md new file mode 100644 index 0000000000..4aee05a22b --- /dev/null +++ b/reference/execution/execution/get_completion_signatures.md @@ -0,0 +1,97 @@ +# get_completion_signatures +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct get_completion_signatures_t; + inline constexpr get_completion_signatures_t get_completion_signatures{}; +} +``` + +## 概要 +`get_completion_signatures`は、[Sender](sender.md)の[完了シグネチャ集合](completion_signatures.md)を取得するカスタマイゼーションポイントオブジェクトである。 + + +## 効果 +説明用の`sndr`を`decltype((sndr))`が`Sndr`型となる式、`env`を`decltype((env))`が`Env`型となる式とする。 +式`new_sndr`を[`transform_sender`](transform_sender.md)`(decltype(`[`get-domain-late`](get-domain-late.md)`(sndr, env)){}, sndr, env)`とし、型`NewSndr`を`decltype((new_sndr))`とする。 + +式`get_completion_signatures(sndr, env)`は、`void(sndr)`と`void(env)`が不定順で序列化(indeterminately sequenced)されることを除いて`(void(sndr), void(env), CS())`と等価である。 + +ここで、説明用の型`CS`は下記の通り定義される。 + +- 型が適格であるならば、`decltype(new_sndr.get_completion_signatures(env))` +- そうではなく、型が適格であるならば[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`::completion_signatures` +- そうではなく、[`is-awaitable`](../is-awaitable.md)`> == true`ならば + + ```cpp + completion_signatures< + SET-VALUE-SIG(await-result-type>), + set_error_t(exception_ptr), + set_stopped_t()> + ``` + * completion_signatures[link completion_signatures.md] + * SET-VALUE-SIG[link connect.md] + * await-result-type[link connect.md] + * env-promise[link env-promise.md] + * set_error_t[link set_error.md] + * exception_ptr[link /reference/exception/exception_ptr.md] + * set_stopped_t[link set_stopped.md] + +- そうでなければ、`CS`は不適格となる。 + + +## カスタマイゼーションポイント +- Sender`sndr`[変換後](transform_sender.md)の`new_sndr`に対して、`new_sndr.get_completion_signatures(env)`が返す型。 +- 変換後Senderの型`NewSndr`に対して、メンバ型`completion_signatures`。 + + +## 例 +```cpp +#include +#include +namespace ex = std::execution; + +int main() +{ + // 値42を送信するSender + ex::sender auto sndr = ex::just(42); + + // 値完了シグネチャ set_value_t(int) + auto sigs = ex::get_completion_signatures(sndr, ex::env<>{}); + static_assert(std::same_as>); +} +``` +* ex::get_completion_signatures[color ff0000] +* ex::sender[link sender.md] +* ex::just[link just.md.nolink] +* ex::completion_signatures[link completion_signatures.md] +* ex::env<>[link env.md] +* ex::set_value_t[link set_value.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::sender`](sender.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/sender.md b/reference/execution/execution/sender.md index edee77eb3e..4a6f91360e 100644 --- a/reference/execution/execution/sender.md +++ b/reference/execution/execution/sender.md @@ -23,7 +23,7 @@ namespace std::execution { ## 要件 -説明専用コンセプト`is-sender`, `enable-sender`、説明用クラステンプレート`env-promise`を以下のように定義する。 +説明専用コンセプト`is-sender`, `enable-sender`を以下のように定義する。 ```cpp template @@ -34,25 +34,11 @@ template concept enable-sender = is-sender || is-awaitable>>; - -template -struct env-promise : with-await-transform> { - unspecified get_return_object() noexcept; - unspecified initial_suspend() noexcept; - unspecified final_suspend() noexcept; - void unhandled_exception() noexcept; - void return_void() noexcept; - coroutine_handle<> unhandled_stopped() noexcept; - - const Env& get_env() const noexcept; -}; ``` +* derived_from[link /reference/concepts/derived_from.md] * is-awaitable[link ../is-awaitable.md] +* env-promise[link env-promise.md] * env<>[link env.md] -* derived_from[link /reference/concepts/derived_from.md] -* with-await-transform[link with-await-transform.md] -* coroutine_handle<>[link /reference/coroutine/coroutine_handle.md] -* unspecified[italic] `sender`コンセプトは、以下のように定義される。 diff --git a/reference/execution/execution/sender_in.md b/reference/execution/execution/sender_in.md index 1689068924..76dfa7530a 100644 --- a/reference/execution/execution/sender_in.md +++ b/reference/execution/execution/sender_in.md @@ -19,7 +19,7 @@ namespace std::execution { * env<>[link env.md] * sender[link sender.md] * queryable[link ../queryable.md] -* get_completion_signatures[link get_completion_signatures.md.nolink] +* get_completion_signatures[link get_completion_signatures.md] ## 概要 `sender_in`は、[Sender型](sender.md)`Sndr`が[環境](../queryable.md)`Env`において非同期操作を作成できることを表すコンセプトである。 From e4ffb85a412cf893c7f7123b16cff63ddb97576c Mon Sep 17 00:00:00 2001 From: yoh Date: Sat, 19 Apr 2025 00:26:17 +0900 Subject: [PATCH 1543/3948] execution: start (#1384) --- reference/execution/execution.md | 2 +- reference/execution/execution/connect.md | 2 +- .../execution/execution/operation_state.md | 6 +- reference/execution/execution/sender_to.md | 2 +- reference/execution/execution/start.md | 87 +++++++++++++++++++ 5 files changed, 93 insertions(+), 6 deletions(-) create mode 100644 reference/execution/execution/start.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 26ea09f958..cb5b97bb88 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -73,7 +73,7 @@ namespace std::execution { | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`execution::operation_state`](execution/operation_state.md) | Operation State型 (concept) | C++26 | -| [`execution::start`](execution/start.md.nolink) | 非同期操作の開始 (customization point object) | C++26 | +| [`execution::start`](execution/start.md) | 非同期操作の開始 (customization point object) | C++26 | ### Sender diff --git a/reference/execution/execution/connect.md b/reference/execution/execution/connect.md index 926ca91fbd..867baf9aba 100644 --- a/reference/execution/execution/connect.md +++ b/reference/execution/execution/connect.md @@ -211,7 +211,7 @@ int main() * ex::sender[link sender.md] * ex::just[link just.md.nolink] * ex::operation_state[link operation_state.md] -* ex::start[link start.md.nolink] +* ex::start[link start.md] ### 出力 ``` diff --git a/reference/execution/execution/operation_state.md b/reference/execution/execution/operation_state.md index f7e1a8626e..dc64053006 100644 --- a/reference/execution/execution/operation_state.md +++ b/reference/execution/execution/operation_state.md @@ -19,7 +19,7 @@ namespace std::execution { ``` * derived_from[link /reference/concepts/derived_from.md] * is_object_v[link /reference/type_traits/is_object.md] -* start[link start.md.nolink] +* start[link start.md] ## 概要 `operation_state`は、型`O`がOperation State型の要件を満たすことを表すコンセプトである。 @@ -27,7 +27,7 @@ namespace std::execution { 下記をみたすクラス型はOperation Stateとみなせる。 - `operation_state_t`をメンバ型`O::operation_state_concept`として定義するクラス型 -- `O`型の左辺値`o`に対して[`execution::start`](start.md.nolink)`(o)`が有効な式かつ例外送出されないこと +- `O`型の左辺値`o`に対して[`execution::start`](start.md)`(o)`が有効な式かつ例外送出されないこと 非同期操作の生存期間中に`operation_state`オブジェクトが破棄されると、未定義の動作を引き起こす。 @@ -65,7 +65,7 @@ int main() * ex::sender[link sender.md] * ex::just[link just.md.nolink] * ex::connect[link connect.md] -* ex::start[link start.md.nolink] +* ex::start[link start.md] ### 出力 ``` diff --git a/reference/execution/execution/sender_to.md b/reference/execution/execution/sender_to.md index 72ed577e66..edd3efacc7 100644 --- a/reference/execution/execution/sender_to.md +++ b/reference/execution/execution/sender_to.md @@ -61,7 +61,7 @@ int main() * ex::just[link just.md.nolink] * ex::operation_state[link operation_state.md] * ex::connect[link connect.md] -* ex::start[link start.md.nolink] +* ex::start[link start.md] ### 出力 ``` diff --git a/reference/execution/execution/start.md b/reference/execution/execution/start.md new file mode 100644 index 0000000000..9154ea7b16 --- /dev/null +++ b/reference/execution/execution/start.md @@ -0,0 +1,87 @@ +# start +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct start_t; + inline constexpr start_t start{}; +} +``` + +## 概要 +`start`は、[Operation State](operation_state.md)を開始するカスタマイゼーションポイントオブジェクトである。 + + +## 効果 +式`start(op)`は、`op`が右辺値の場合は不適格となる。 +そうでなければ、`op.start()`と等価。 + +`op.start()`が[Operation State](operation_state.md)に関連付けさられた非同期操作を開始しない場合、式`start(op)`は未定義動作となる。 + + +## カスタマイゼーションポイント +[Operation State](operation_state.md)`op`に対して式`op.start()`が呼び出される。 +このとき`noexcept(op.start()) == true`であること。 + + +## 例 +```cpp +#include +#include +namespace ex = std::execution; + +struct ValueReceiver { + using receiver_concept = ex::receiver_t; + + void set_value(int v) && noexcept + { + std::println("{}", v); + } +}; + +int main() +{ + // 値42を送信するSender + ex::sender auto sndr = ex::just(42); + // int値を受信して表示するReceiver + ValueReceiver rcvr; + + // SenderとReceiverを接続 + ex::operation_state auto op = ex::connect(sndr, rcvr); + // Operation Stateを開始 + ex::start(op); +} +``` +* ex::start[color ff0000] +* ex::receiver_t[link receiver.md] +* ex::sender[link sender.md] +* ex::just[link just.md.nolink] +* ex::operation_state[link operation_state.md] +* ex::connect[link connect.md] + +### 出力 +``` +42 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::operation_state`](operation_state.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) From 20a8d5e9258e4355235398d9a82e00cfeb7aad50 Mon Sep 17 00:00:00 2001 From: yoh Date: Sat, 19 Apr 2025 00:30:32 +0900 Subject: [PATCH 1544/3948] execution/start: fix defined word --- reference/execution/execution/start.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/execution/execution/start.md b/reference/execution/execution/start.md index 9154ea7b16..9c6e4c6689 100644 --- a/reference/execution/execution/start.md +++ b/reference/execution/execution/start.md @@ -19,7 +19,7 @@ namespace std::execution { 式`start(op)`は、`op`が右辺値の場合は不適格となる。 そうでなければ、`op.start()`と等価。 -`op.start()`が[Operation State](operation_state.md)に関連付けさられた非同期操作を開始しない場合、式`start(op)`は未定義動作となる。 +`op.start()`が[Operation State](operation_state.md)に関連付けさられた非同期操作を開始しない場合、式`start(op)`の動作は未定義となる。 ## カスタマイゼーションポイント From 614432a561a0ef141364a1a8809b25a708dd7083 Mon Sep 17 00:00:00 2001 From: Keita Nonaka Date: Fri, 18 Apr 2025 13:24:39 -0700 Subject: [PATCH 1545/3948] fix: remove unnecessary `std::move` in splice of `std::forward_list` Signed-off-by: Keita Nonaka --- reference/forward_list/forward_list/splice_after.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/reference/forward_list/forward_list/splice_after.md b/reference/forward_list/forward_list/splice_after.md index d5404cf6ea..ecb33dfab2 100644 --- a/reference/forward_list/forward_list/splice_after.md +++ b/reference/forward_list/forward_list/splice_after.md @@ -67,7 +67,6 @@ void splice_after(const_iterator position, forward_list&& x, ```cpp example #include #include -#include #include template @@ -84,7 +83,7 @@ int main() std::forward_list xs = {1, 5, 6}; std::forward_list ys = {2, 3, 4}; - xs.splice_after(xs.begin(), std::move(ys)); + xs.splice_after(xs.begin(), ys); print(xs); } @@ -93,7 +92,7 @@ int main() std::forward_list xs = {1, 5, 6}; std::forward_list ys = {2, 3, 4}; - xs.splice_after(xs.begin(), std::move(ys), ys.begin()); + xs.splice_after(xs.begin(), ys, ys.begin()); print(xs); } @@ -102,7 +101,7 @@ int main() std::forward_list xs = {1, 5, 6}; std::forward_list ys = {2, 3, 4}; - xs.splice_after(xs.begin(), std::move(ys), ys.before_begin(), std::next(ys.begin(), 2)); + xs.splice_after(xs.begin(), ys, ys.before_begin(), std::next(ys.begin(), 2)); print(xs); } @@ -110,7 +109,6 @@ int main() ``` * splice_after[color ff0000] * begin()[link begin.md] -* std::move[link /reference/utility/move.md] * std::next[link /reference/iterator/next.md] ### 出力 From ac9fa1d4237d0b4afacde0c24b5b884195b79dcf Mon Sep 17 00:00:00 2001 From: yoh Date: Sat, 19 Apr 2025 21:41:34 +0900 Subject: [PATCH 1546/3948] execution/scheduler: refinement (#1384) --- reference/execution/execution/receiver.md | 6 ++- reference/execution/execution/scheduler.md | 47 +++++++++++++++++++--- reference/execution/execution/sender.md | 9 +++-- reference/execution/execution/start.md | 8 +++- 4 files changed, 59 insertions(+), 11 deletions(-) diff --git a/reference/execution/execution/receiver.md b/reference/execution/execution/receiver.md index 8cd67b2e6d..05a15160f4 100644 --- a/reference/execution/execution/receiver.md +++ b/reference/execution/execution/receiver.md @@ -27,7 +27,11 @@ namespace std::execution { ## 概要 `receiver`は、型`Rcvr`がReceiver型の要件を満たすことを表すコンセプトである。 -`receiver_t`をメンバ型`Rcvr::receiver_concept`として定義するクラス型はReceiverとみなせる。 +下記をみたすクラス型はReceiverとみなせる。 + +- `receiver_t`をメンバ型`Rcvr::receiver_concept`として定義する +- [`get_env`](get_env.md)で[環境](../queryable.md)を取得できる +- ムーブ可能 ## モデル diff --git a/reference/execution/execution/scheduler.md b/reference/execution/execution/scheduler.md index 2ffa3efc00..0e2fd7e19a 100644 --- a/reference/execution/execution/scheduler.md +++ b/reference/execution/execution/scheduler.md @@ -25,6 +25,7 @@ namespace std::execution { * derived_from[link /reference/concepts/derived_from.md] * sender[link sender.md] * queryable[link ../queryable.md] +* schedule[link schedule.md.nolink] * get_completion_scheduler[link get_completion_scheduler.md.nolink] * set_value_t[link set_value.md] * get_env[link get_env.md] @@ -36,11 +37,47 @@ namespace std::execution { 下記をみたすクラス型はSchedulerとみなせる。 -- `scheduler_t`をメンバ型`Sch::scheduler_concept`として定義するクラス -- [クエリ可能オブジェクト](../queryable.md)であること -- `Sch`型の値`sch`に対して下記が有効な式であること - - [`execution::schedule`](schedule.md.nolink)`(sch)`が[Sender](sender.md)を返すこと - - [`execution::get_completion_scheduler`](get_completion_scheduler.md.nolink)`<`[`set_value_t`](set_value.md)`>(`[`execution::get_env`](get_env.md)`(`[`execution::schedule`](schedule.md.nolink)`(sch)))`の結果が`Sch`型に等しいこと +- `scheduler_t`をメンバ型`Sch::scheduler_concept`として定義する +- [クエリ可能オブジェクト](../queryable.md)である +- `Sch`型の値`sch`に対して下記を満たすこと + - [`execution::schedule`](schedule.md.nolink)`(sch)`が[Sender](sender.md)を返す + - 上記Senderの[値完了関数](set_value.md)の[完了Scheduler](get_completion_scheduler.md.nolink)が`Sch`に等しいこと +- コピー可能かつ同値比較可能 + + +## モデル +説明専用のエイリアステンプレート`value-signature`, コンセプト`sender-in-of`を下記の通り定義する。 + +```cpp +namespace std::execution { + template + using value-signature = set_value_t(As...); + + template + concept sender-in-of = + sender_in && + MATCHING-SIG( + set_value_t(Values...), + value_types_of_t); +} +``` +* set_value_t[link set_value.md] +* sender_in[link sender_in.md] +* value_types_of_t[link value_types_of_t.md.nolink] +* type_identity_t[link /reference/type_traits/true_type.md] + +型`Sch`を`scheduler`の型、型`Env`を[`sender_in`](sender_in.md)`, Env>`を満たす実行環境の型としたとき、`sender-in-of, Env>`のモデルとなること。 + +[`copyable`](/reference/concepts/copyable.md)`>`および[`equality_comparable`](/reference/concepts/equality_comparable.md)`>`により要求される操作は、例外で終了してはならない。 +これらの操作やScheduler型の[`schedule`](schedule.md.nolink)関数は、異なるスレッドから同時に操作を呼び出す可能性がある場合でも、データ競合を引き起こしてはならない。 + +あるScheduler型`Sch`の2つの値`sch1`と`sch2`に対して、`sch1`と`sch2`が同じ実行リソースを共有する場合に限って、`sch1 == sch2`は`true`となる。 + +あるScheduler`sch`に対して、式[`get_completion_scheduler`](get_completion_scheduler.md.nolink)`<`[`set_value_t`](set_value.md)`>(`[`get_env`](get_env.md)`(`[`schedule`](schedule.md.nolink)`(sch)))`が`sch`と等しいこと。 + +あるScheduler`sch`に対して式[`get_domain`](get_domain.md)`(sch)`が適格であるとき、式`get_domain(`[`get_env`](get_env.md)`(schedule(sch)))`も適格であり、かつ同じ型を持つ。 + +Scheduler型のデストラクタは、`schedule`が返すSenderオブジェクトに接続されたReceiverの完了を待機してブロックしてはならない。 ## 例 diff --git a/reference/execution/execution/sender.md b/reference/execution/execution/sender.md index 4a6f91360e..a7aa146f56 100644 --- a/reference/execution/execution/sender.md +++ b/reference/execution/execution/sender.md @@ -16,10 +16,13 @@ namespace std::execution { ## 概要 `sender`は、型`Sndr`がSender型の要件を満たすことを表すコンセプトである。 -次のいずれかのクラス型はSenderとみなせる。 +下記をみたすクラス型はSenderとみなせる。 -- `sender_t`をメンバ型`Sndr::sender_concept`として定義するクラス型 -- [コルーチンのAwaitable型](/lang/cpp20/coroutines.md)クラス型 +- 下記いずれかを満たす + - `sender_t`をメンバ型`Sndr::sender_concept`として定義する + - [コルーチンのAwaitable型](/lang/cpp20/coroutines.md) +- [`get_env`](get_env.md)で[属性](../queryable.md)を取得できる +- ムーブ可能 ## 要件 diff --git a/reference/execution/execution/start.md b/reference/execution/execution/start.md index 9c6e4c6689..90fc7ed10b 100644 --- a/reference/execution/execution/start.md +++ b/reference/execution/execution/start.md @@ -12,14 +12,14 @@ namespace std::execution { ``` ## 概要 -`start`は、[Operation State](operation_state.md)を開始するカスタマイゼーションポイントオブジェクトである。 +`start`は、[Operation State](operation_state.md)関連付けられた非同期操作(asynchronous operation)を開始するカスタマイゼーションポイントオブジェクトである。 ## 効果 式`start(op)`は、`op`が右辺値の場合は不適格となる。 そうでなければ、`op.start()`と等価。 -`op.start()`が[Operation State](operation_state.md)に関連付けさられた非同期操作を開始しない場合、式`start(op)`の動作は未定義となる。 +`op.start()`が[Operation State](operation_state.md)に関連付けられた非同期操作を開始しない場合、式`start(op)`の動作は未定義となる。 ## カスタマイゼーションポイント @@ -27,6 +27,10 @@ namespace std::execution { このとき`noexcept(op.start()) == true`であること。 +## 備考 +`start`は[Sender](sender.md)内部実装から呼び出される想定であり、実行制御ライブラリ利用者が直接利用する必要はない。 + + ## 例 ```cpp #include From 7a43329c3d646a98daf79ab7f29c9df6d7488bc1 Mon Sep 17 00:00:00 2001 From: yoh Date: Sat, 19 Apr 2025 21:44:25 +0900 Subject: [PATCH 1547/3948] execution/scheduler: fix inner link --- reference/execution/execution/scheduler.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/execution/execution/scheduler.md b/reference/execution/execution/scheduler.md index 0e2fd7e19a..27ef5307cc 100644 --- a/reference/execution/execution/scheduler.md +++ b/reference/execution/execution/scheduler.md @@ -75,7 +75,7 @@ namespace std::execution { あるScheduler`sch`に対して、式[`get_completion_scheduler`](get_completion_scheduler.md.nolink)`<`[`set_value_t`](set_value.md)`>(`[`get_env`](get_env.md)`(`[`schedule`](schedule.md.nolink)`(sch)))`が`sch`と等しいこと。 -あるScheduler`sch`に対して式[`get_domain`](get_domain.md)`(sch)`が適格であるとき、式`get_domain(`[`get_env`](get_env.md)`(schedule(sch)))`も適格であり、かつ同じ型を持つ。 +あるScheduler`sch`に対して式[`get_domain`](get_domain.md.nolink)`(sch)`が適格であるとき、式`get_domain(`[`get_env`](get_env.md)`(schedule(sch)))`も適格であり、かつ同じ型を持つ。 Scheduler型のデストラクタは、`schedule`が返すSenderオブジェクトに接続されたReceiverの完了を待機してブロックしてはならない。 From 08365debe249bdbd6a7347ad462ea1c22e7cc2a8 Mon Sep 17 00:00:00 2001 From: yoh Date: Sat, 19 Apr 2025 23:04:09 +0900 Subject: [PATCH 1548/3948] execution: schedule (#1384) --- reference/execution/execution.md | 2 +- reference/execution/execution/schedule.md | 97 ++++++++++++++++++++++ reference/execution/execution/scheduler.md | 14 ++-- 3 files changed, 105 insertions(+), 8 deletions(-) create mode 100644 reference/execution/execution/schedule.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index cb5b97bb88..f4b35abe58 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -103,7 +103,7 @@ namespace std::execution { | [`execution::just_error`](execution/just_error.md.nolink) | エラーを送信するSender (customization point object) | C++26 | | [`execution::just_stopped`](execution/just_stopped.md.nolink) | 停止を送信するSender (customization point object) | C++26 | | [`execution::read_env`](execution/read_env.md.nolink) | Receiver環境から構築されるSender (customization point object) | C++26 | -| [`execution::schedule`](execution/schedule.md.nolink) | Scheduler上で実行されるSender (customization point object) | C++26 | +| [`execution::schedule`](execution/schedule.md) | Scheduler上で実行されるSender (customization point object) | C++26 | | [`execution::schedule_result_t`](execution/schedule_result_t.md.nolink) | `schedule`結果型を取得 (alias template) | C++26 | ### Senderアダプタ diff --git a/reference/execution/execution/schedule.md b/reference/execution/execution/schedule.md new file mode 100644 index 0000000000..f7571c0e2e --- /dev/null +++ b/reference/execution/execution/schedule.md @@ -0,0 +1,97 @@ +# schedule +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct schedule_t { unspecified }; + inline constexpr schedule_t schedule{}; +} +``` +* unspecified[italic] + +## 概要 +`schedule`は、[Scheduler](scheduler.md)から[スケジュールSender](sender.md)を取得するSenderファクトリである。 + +スケジュールSenderより生成される[非同期操作](operation_state.md)を開始すると、Schedulerに関連付けられた実行リソース上で空の[値完了関数](set_value.md)を呼び出す。 + + +## 効果 +呼び出し式`schedule(sch)`は式`sch.schedule()`と等価であり、式の型は[`sender`](sender.md)を満たすこと。 + +式[`get_completion_scheduler`](get_completion_scheduler.md.nolink)`<`[`set_value_t`](set_value.md)`>(`[`get_env`](get_env.md)`(sch.schedule())) == sch`が不適格もしくは`false`となる場合、呼び出し式`schedule(sch)`の動作は未定義となる。 + + +## カスタマイゼーションポイント +[Scheduler](scheduler.md)`sch`に対して、式`sch.schedule()`が呼び出される。 + + +## 例 +```cpp example +#include +#include +#include +namespace ex = std::execution; + +int main() +{ + ex::run_loop loop; + std::jthread worker{[&]{ + std::println("start worker#{}", std::this_thread::get_id()); + loop.run(); + }}; + + ex::scheduler auto sch = loop.get_scheduler(); + ex::sender auto sndr = + ex::schedule(sch) + | ex::then([]{ + std::println("on worker#{}", std::this_thread::get_id()); + return 42; + }); + + std::println("main#{}", std::this_thread::get_id()); + + auto [val] = std::this_thread::sync_wait(std::move(sndr)).value(); + std::println("val={}", val); + + loop.finish(); +} +``` +* ex::schedule[color ff0000] +* ex::scheduler[link scheduler.md] +* ex::sender[link sender.md] +* ex::then[link then.md.nolink] +* ex::run_loop[link run_loop.md.nolink] +* get_scheduler()[link run_loop/get_scheduler.md.nolink] +* run()[link run_loop/run.md.nolink] +* finish()[link run_loop/finish.md.nolink] +* std::this_thread::get_id()[link /reference/thread/this_thread/get_id.md] + +### 出力例 +``` +main#134276695947072 +start worker#134276691527232 +on worker#134276691527232 +val=42 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::scheduler`](scheduler.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/scheduler.md b/reference/execution/execution/scheduler.md index 27ef5307cc..427727a053 100644 --- a/reference/execution/execution/scheduler.md +++ b/reference/execution/execution/scheduler.md @@ -25,7 +25,7 @@ namespace std::execution { * derived_from[link /reference/concepts/derived_from.md] * sender[link sender.md] * queryable[link ../queryable.md] -* schedule[link schedule.md.nolink] +* schedule[link schedule.md] * get_completion_scheduler[link get_completion_scheduler.md.nolink] * set_value_t[link set_value.md] * get_env[link get_env.md] @@ -40,7 +40,7 @@ namespace std::execution { - `scheduler_t`をメンバ型`Sch::scheduler_concept`として定義する - [クエリ可能オブジェクト](../queryable.md)である - `Sch`型の値`sch`に対して下記を満たすこと - - [`execution::schedule`](schedule.md.nolink)`(sch)`が[Sender](sender.md)を返す + - [`execution::schedule`](schedule.md)`(sch)`が[Sender](sender.md)を返す - 上記Senderの[値完了関数](set_value.md)の[完了Scheduler](get_completion_scheduler.md.nolink)が`Sch`に等しいこと - コピー可能かつ同値比較可能 @@ -69,15 +69,15 @@ namespace std::execution { 型`Sch`を`scheduler`の型、型`Env`を[`sender_in`](sender_in.md)`, Env>`を満たす実行環境の型としたとき、`sender-in-of, Env>`のモデルとなること。 [`copyable`](/reference/concepts/copyable.md)`>`および[`equality_comparable`](/reference/concepts/equality_comparable.md)`>`により要求される操作は、例外で終了してはならない。 -これらの操作やScheduler型の[`schedule`](schedule.md.nolink)関数は、異なるスレッドから同時に操作を呼び出す可能性がある場合でも、データ競合を引き起こしてはならない。 +これらの操作やScheduler型の[`schedule`](schedule.md)関数は、異なるスレッドから同時に操作を呼び出す可能性がある場合でも、データ競合を引き起こしてはならない。 あるScheduler型`Sch`の2つの値`sch1`と`sch2`に対して、`sch1`と`sch2`が同じ実行リソースを共有する場合に限って、`sch1 == sch2`は`true`となる。 -あるScheduler`sch`に対して、式[`get_completion_scheduler`](get_completion_scheduler.md.nolink)`<`[`set_value_t`](set_value.md)`>(`[`get_env`](get_env.md)`(`[`schedule`](schedule.md.nolink)`(sch)))`が`sch`と等しいこと。 +あるScheduler`sch`に対して、式[`get_completion_scheduler`](get_completion_scheduler.md.nolink)`<`[`set_value_t`](set_value.md)`>(`[`get_env`](get_env.md)`(`[`schedule`](schedule.md)`(sch)))`が`sch`と等しいこと。 -あるScheduler`sch`に対して式[`get_domain`](get_domain.md.nolink)`(sch)`が適格であるとき、式`get_domain(`[`get_env`](get_env.md)`(schedule(sch)))`も適格であり、かつ同じ型を持つ。 +あるScheduler`sch`に対して式[`get_domain`](get_domain.md.nolink)`(sch)`が適格であるとき、式`get_domain(`[`get_env`](get_env.md)`(`[`schedule`](schedule.md)`(sch)))`も適格であり、かつ同じ型を持つ。 -Scheduler型のデストラクタは、`schedule`が返すSenderオブジェクトに接続されたReceiverの完了を待機してブロックしてはならない。 +Scheduler型のデストラクタは、[`schedule`](schedule.md)が返すSenderオブジェクトに接続されたReceiverの完了を待機してブロックしてはならない。 ## 例 @@ -112,7 +112,7 @@ int main() ## 関連項目 -- [`execution::schedule`](schedule.md.nolink) +- [`execution::schedule`](schedule.md) ## 参照 From a4fbd160cb9e78a14ada6491c54dd1d9c55dfed6 Mon Sep 17 00:00:00 2001 From: yoh Date: Sat, 19 Apr 2025 23:32:22 +0900 Subject: [PATCH 1549/3948] execution: schedule_result_t (#1384) --- reference/execution/execution.md | 2 +- reference/execution/execution/schedule.md | 2 ++ .../execution/execution/schedule_result_t.md | 36 +++++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 reference/execution/execution/schedule_result_t.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index f4b35abe58..9487a17888 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -104,7 +104,7 @@ namespace std::execution { | [`execution::just_stopped`](execution/just_stopped.md.nolink) | 停止を送信するSender (customization point object) | C++26 | | [`execution::read_env`](execution/read_env.md.nolink) | Receiver環境から構築されるSender (customization point object) | C++26 | | [`execution::schedule`](execution/schedule.md) | Scheduler上で実行されるSender (customization point object) | C++26 | -| [`execution::schedule_result_t`](execution/schedule_result_t.md.nolink) | `schedule`結果型を取得 (alias template) | C++26 | +| [`execution::schedule_result_t`](execution/schedule_result_t.md) | [`schedule`](execution/schedule.md)結果型を取得 (alias template) | C++26 | ### Senderアダプタ diff --git a/reference/execution/execution/schedule.md b/reference/execution/execution/schedule.md index f7571c0e2e..8bd90c80c1 100644 --- a/reference/execution/execution/schedule.md +++ b/reference/execution/execution/schedule.md @@ -67,6 +67,8 @@ int main() * get_scheduler()[link run_loop/get_scheduler.md.nolink] * run()[link run_loop/run.md.nolink] * finish()[link run_loop/finish.md.nolink] +* std::move[link /reference/utility/move.md] +* std::jthread[link /reference/thread/jthread.md] * std::this_thread::get_id()[link /reference/thread/this_thread/get_id.md] ### 出力例 diff --git a/reference/execution/execution/schedule_result_t.md b/reference/execution/execution/schedule_result_t.md new file mode 100644 index 0000000000..663de9f6e7 --- /dev/null +++ b/reference/execution/execution/schedule_result_t.md @@ -0,0 +1,36 @@ +# schedule_result_t +* execution[meta header] +* std::execution[meta namespace] +* type-alias[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template + using schedule_result_t = decltype(schedule(declval())); +} +``` +* scheduler[link scheduler.md] +* schedule[link schedule.md] + +## 概要 +[Scheduler型](scheduler.md)`Sndr`の[`schedule`](schedule.md)結果型を取得する。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::schedule`](schedule.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) From 9bd96532716d3a0abf4b3f8793229ac61a4c082e Mon Sep 17 00:00:00 2001 From: tshino Date: Sun, 20 Apr 2025 14:50:30 +0900 Subject: [PATCH 1550/3948] =?UTF-8?q?=E3=80=8C=E5=AE=9A=E6=95=B0=E3=81=A8?= =?UTF-8?q?=E3=81=8D=E3=80=8D=E2=86=92=E3=80=8C=E5=AE=9A=E6=95=B0=E3=81=AE?= =?UTF-8?q?=E3=81=A8=E3=81=8D=E3=80=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp17/constexpr_lambda.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lang/cpp17/constexpr_lambda.md b/lang/cpp17/constexpr_lambda.md index 5a118885dc..e4d3a09e3f 100644 --- a/lang/cpp17/constexpr_lambda.md +++ b/lang/cpp17/constexpr_lambda.md @@ -18,7 +18,7 @@ C++17から、ラムダ式をconstexpr関数として使えるようになった ## 仕様 -ラムダ式のキャプチャが全てコンパイル時定数とき、そのラムダ式をconstexprの文脈で使うことができる。 +ラムダ式のキャプチャが全てコンパイル時定数のとき、そのラムダ式をconstexprの文脈で使うことができる。 ```cpp example constexpr int add_one(int n){ @@ -68,7 +68,7 @@ int main(){ constexpr修飾されていないラムダ式のoperator()はラムダ式がconstexpr関数としての条件を満たす場合 -(つまりラムダ式のキャプチャが全てコンパイル時定数とき) +(つまりラムダ式のキャプチャが全てコンパイル時定数のとき) 自動的にconstexpr指定される。 @@ -201,4 +201,4 @@ C++14まではラムダ式がコンパイル時に呼び出せないため、 ## 参照 (執筆中) -- [P0170R1 Wording for Constexpr Lambda](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0170r1.pdf) \ No newline at end of file +- [P0170R1 Wording for Constexpr Lambda](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0170r1.pdf) From 28659acd4e63cb13d247b9bb147b7539c043f0a6 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sun, 20 Apr 2025 22:01:25 +0900 Subject: [PATCH 1551/3948] reference/iterator/contiguous_iterator.md: Added information for contiguous_iterator This is added to match C++26. Commit for issue #1424 --- reference/iterator/contiguous_iterator.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reference/iterator/contiguous_iterator.md b/reference/iterator/contiguous_iterator.md index 712c3e7a7d..5a16cc318d 100644 --- a/reference/iterator/contiguous_iterator.md +++ b/reference/iterator/contiguous_iterator.md @@ -33,6 +33,11 @@ namespace std { `contiguous_iterator`となるイテレータは、[ランダムアクセスイテレータ](random_access_iterator.md)であり、参照する要素列がメモリ上で連続していることが保証される。 +C++20で導入された`contiguous_iterator`は、要素がメモリー上で連続していることを保証しているが、C++23の標準ライブラリ実装では +得られたポインタに対してさらなるポインタ演算を行う演算は許可されていなかった。 + +しかし、C++26からは、この制限が緩和され、`std::to_address`関数を使用して得られたポインタに対してさらなるポインタ演算を行うことができるようになった。 + ## モデル `a, b`を間接参照可能なイテレータ、`c`を間接参照不可能なイテレータとし、`b`は`a`から、`c`は`b`からそれぞれ到達可能であるとする。そのような型`I`のイテレータ`a, b, c`と[`iter_difference_t`](/reference/iterator/iter_difference_t.md)の示す型`D`について次の条件を満たす場合に限って、型`I`は`contiguous_iterator`のモデルである。 @@ -109,3 +114,4 @@ std::ostream_iterator is not contiguous_iterator - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) - [P1474R1 Helpful pointers for `ContiguousIterator`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1474r1.pdf) +- [P3349R1 Converting contiguous iterators to pointers](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3349r1.html) \ No newline at end of file From 9d5321d599787ef24a3f452ebb2bfd111bfef2b6 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sun, 20 Apr 2025 22:53:57 +0900 Subject: [PATCH 1552/3948] lang/cpp26.md,lang/cpp26/contracts.md,implementation-status.md: Created article This commit creates lang/cpp26/contracts.md. This is for issue #1419 --- implementation-status.md | 2 +- lang/cpp26.md | 2 +- lang/cpp26/contracts.md | 111 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 113 insertions(+), 2 deletions(-) create mode 100644 lang/cpp26/contracts.md diff --git a/implementation-status.md b/implementation-status.md index 87bad647fa..db46c0746d 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -319,7 +319,7 @@ | P1061R10: [構造化束縛でパックを導入できるようにする](/lang/cpp26/structured_bindings_can_introduce_a_pack.md) | タプルを分解する際に複数の変数をパックとして宣言できるようにする。`auto [a, ...xs] = f();` | | | | | | P3176R0: [先行するカンマのない省略記号を非推奨化](/lang/cpp26/the_oxford_variadic_comma.md.nolink) | `void f(int, ...);`はOK。`void f(int...);`は非推奨 | 15 | 20 | | | | P3074R7: [共用体をトリビアルに未初期化できるようにする](/lang/cpp26/trivial_unions.md.nolink) | `constexpr`での`union U { T storage[N]; };`を許可し、未初期化にできるようにする | | | | | -| P2900R14: [契約プログラミングをサポートする](/lang/cpp26/contracts.md.nolink) | 関数の事前条件、事後条件、不変条件を記述できるようにする | | | | | +| P2900R14: [契約プログラミングをサポートする](/lang/cpp26/contracts.md) | 関数の事前条件、事後条件、不変条件を記述できるようにする | | | | | | P2841R7: [コンセプトと変数テンプレートにテンプレートテンプレートパラメータのサポートを追加](/lang/cpp26/concept_and_variable-template_template-parameters.md.nolink) | テンプレート引数をあとで指定するテンプレートテンプレートパラメータを、コンセプトと変数テンプレートでも使用できるようにする | | | | | | P2786R13: [トリビアルな再配置](/lang/cpp26/trivial_relocatability.md.nolink) | ムーブ構築と破棄のためにビット単位のコピーとデストラクタ評価が必要になる型のオブジェクトを再配置するメカニズムを導入する | | | | | | P1967R14: [ファイルを読み込む`#embed`命令を追加](/lang/cpp26/embed.md) | バイナリファイルをインクルードするメカニズム。`#include`とちがって読み出しサイズなどの柔軟な指定ができる | 15 | | | | diff --git a/lang/cpp26.md b/lang/cpp26.md index 37759e1e65..e47939c88b 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -43,7 +43,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| | [関数宣言を削除する理由を指定できるようにする](/lang/cpp26/delete_reason.md) | `f() = delete("reason");` | -| [契約プログラミングをサポートする](/lang/cpp26/contracts.md.nolink) | 関数の事前条件、事後条件、不変条件を記述できるようにする | +| [契約プログラミングをサポートする](/lang/cpp26/contracts.md) | 関数の事前条件、事後条件、不変条件を記述できるようにする | ### クラス diff --git a/lang/cpp26/contracts.md b/lang/cpp26/contracts.md new file mode 100644 index 0000000000..22948f8037 --- /dev/null +++ b/lang/cpp26/contracts.md @@ -0,0 +1,111 @@ +# 契約プログラミング [P2900R14] +* cpp26[meta cpp] + + + +このページはC++26に採用される見込みの言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 + + + +## 概要 +C++26では、関数の正確な動作を明示的に指定でき、プログラムの正当性を高めるために「契約プログラミング」機能が導入される。 + +これにより、事前条件(preconditions)、事後条件(postconditions)、及びアサーション(assertions)をコード内で明示的に記述できるようになる。 + +この機能は、関数のインターフェースに対する期待値を明確にする役割があり、バグの早期発見、コードの可読性向上に寄与することが期待されている。 + +## 仕様 +### 契約の種類 +契約には以下の3種類が定められている。 + +- 事前条件(preconditions) +- 事後条件(postconditions) +- アサーション(assertions) + +#### 事前条件(pre) +関数が呼び出される前に満たされているべき条件を指定する。 +```cpp +int safe_division(int numerator, int denominator) + pre(denominator != 0) +{ + return numerator / denominator; +} +``` +ここでは、`denominator`が0でないことを事前条件として指定している。 + +#### 事後条件(post) +関数の実行後に満たされているべき条件を指定する。 +```cpp +int increment(int x) + post(r: r == x + 1) +{ + return x + 1; +} +``` +ここでは、`increment`関数の戻り値が`x + 1`であることを事後条件として指定している。 + +`post`では、返り値を`r`としてバインドし、条件式内で利用している。ここには、任意の変数名が使用できる。変数は定数(`const`)な左辺値参照である。 + +#### アサーション(assert) +関数の実行中に満たされているべき条件を指定する。 +```cpp +void return_negative(int value) +{ + contract_assert(value >= 0); + return -value; +} +``` +ここでは、`return_negative`関数のが引数として受け取っている`value`が0以上であることをアサーションとして指定している。 + +`contract_assert`は、関数の本体内で使用される。 + +また、これらの全ては、`[[ likely ]]`や`[[ unlikely ]]`、 `[[ maybe_unused ]]`属性を使用することができる。 +```cpp +void return_negative(int value) + pre [[likely]] (value >= 0) + post (r [[maybe_unused]] : r <= 0) + { + return -value; + } +``` +### 評価の順番 +契約式の評価順序に注意が必要である。 + +事前条件は関数の引数が初期化された後に評価され、事後条件は関数の戻り値が初期化された後、ローカル変数の破棄前に評価される。この順序により、契約式は必要な変数や状態にアクセスできるようになっている。 + +### 契約の評価モード +契約の評価には、次の4つのモードが存在する。 + +- ignore: 契約のチェックを無視(ignore)する。 + +- observe: 契約違反時にハンドラを呼び出し、プログラムの実行を続行します。 + +- enforce: 契約違反時にハンドラを呼び出し、プログラムを終了します。 + +- quick_enforce: 契約違反時にハンドラを呼び出さず、即座にプログラムを終了します。 + +評価モードは、コンパイル時、もしくは実行時に指定できる。 + +GCCでは、 +```bash +g++ -std=c++26 -fcontracts -fcontract-semantic=observe main.cpp +``` +のように指定できる。 + +### 契約違反ハンドラ +契約違反が発生した場合、`std::contracts::contract_violation`型の情報(<contracts>ヘッダー)がハンドラに渡されます。​この情報には、違反の種類、発生場所、違反した条件式などが含まれます。 + +### 使用上の注意 +以下の操作は、気をつけなければならない。 +- 契約式内において副作用を要する式を記述した場合(グローバル変数の変更、`volatile`変数への参照、`constexpr`でない関数の呼び出しなど) +- 契約式内で例外を送出すると、std::terminate()が呼び出され、プログラムが終了する。 +- 通常の関数やメンバ関数には契約を適用できるが、特殊な関数(例えば`default`によって定義されたコピーコンストラクタやデストラクタ)には適用できない。適用すると、プログラムは不正(ill-formed)となる。 + +## 関連項目 +- [C++ 将来 契約に基づくプログラミング](lang/future/contract-based_programming.md) + + +## 参照 +- [P2900R14 `Contracts for C++`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2900r14.pdf) From 7b55ccc71108755a6a71c3d35782df45e82d548f Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sun, 20 Apr 2025 22:57:27 +0900 Subject: [PATCH 1553/3948] lang/cpp26/contracts.md: Fixed link --- lang/cpp26/contracts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp26/contracts.md b/lang/cpp26/contracts.md index 22948f8037..2681cba7d9 100644 --- a/lang/cpp26/contracts.md +++ b/lang/cpp26/contracts.md @@ -104,7 +104,7 @@ g++ -std=c++26 -fcontracts -fcontract-semantic=observe main.cpp - 通常の関数やメンバ関数には契約を適用できるが、特殊な関数(例えば`default`によって定義されたコピーコンストラクタやデストラクタ)には適用できない。適用すると、プログラムは不正(ill-formed)となる。 ## 関連項目 -- [C++ 将来 契約に基づくプログラミング](lang/future/contract-based_programming.md) +- [C++ 将来 契約に基づくプログラミング](/lang/future/contract-based_programming.md) ## 参照 From 148bb8c64c8f9f14e08b00ec1be607102c9d40d1 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sun, 20 Apr 2025 23:00:30 +0900 Subject: [PATCH 1554/3948] lang/cpp26/contracts.md: Removed zero-width space For issue #1419 --- lang/cpp26/contracts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp26/contracts.md b/lang/cpp26/contracts.md index 2681cba7d9..f8af8f946b 100644 --- a/lang/cpp26/contracts.md +++ b/lang/cpp26/contracts.md @@ -95,7 +95,7 @@ g++ -std=c++26 -fcontracts -fcontract-semantic=observe main.cpp のように指定できる。 ### 契約違反ハンドラ -契約違反が発生した場合、`std::contracts::contract_violation`型の情報(<contracts>ヘッダー)がハンドラに渡されます。​この情報には、違反の種類、発生場所、違反した条件式などが含まれます。 +契約違反が発生した場合、`std::contracts::contract_violation`型の情報(<contracts>ヘッダー)がハンドラに渡されます。この情報には、違反の種類、発生場所、違反した条件式などが含まれます。 ### 使用上の注意 以下の操作は、気をつけなければならない。 From 3785ecf0824360bb18848fe0f4ee5c14a4deb770 Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 21 Apr 2025 18:00:57 +0900 Subject: [PATCH 1555/3948] execution: get_completion_scheduler (#1384) --- reference/execution/execution.md | 2 +- .../execution/get_completion_scheduler.md | 112 ++++++++++++++++++ reference/execution/execution/get_env.md | 2 +- reference/execution/execution/schedule.md | 4 +- reference/execution/execution/scheduler.md | 9 +- reference/execution/queryable.md | 18 ++- 6 files changed, 136 insertions(+), 11 deletions(-) create mode 100644 reference/execution/execution/get_completion_scheduler.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 9487a17888..835352c5b9 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -44,7 +44,7 @@ namespace std::execution { | [`execution::get_delegation_scheduler`](execution/get_delegation_scheduler.md.nolink) | 委譲Scheduler取得のクエリオブジェクト (customization point object) | C++26 | | [`execution::forward_progress_guarantee`](execution/forward_progress_guarantee.md.nolink) | 前進保証 (enum) | C++26 | | [`execution::get_forward_progress_guarantee`](execution/get_forward_progress_guarantee.md.nolink) | 前進保証取得のクエリオブジェクト (customization point object) | C++26 | -| [`execution::get_completion_scheduler`](execution/get_completion_scheduler.md.nolink) | 完了Scheduler取得のクエリオブジェクト (customization point object) | C++26 | +| [`execution::get_completion_scheduler`](execution/get_completion_scheduler.md) | 完了Scheduler取得のクエリオブジェクト (customization point object) | C++26 | | [`execution::get_env`](execution/get_env.md) | 環境取得のクエリオブジェクト (customization point object) | C++26 | | [`execution::env_of_t`](execution/env_of_t.md) | 指定型から環境型を取得 (alias template) | C++26 | | [`execution::prop`](execution/prop.md) | Key/Valueペアによる[クエリ可能オブジェクト](queryable.md) (class template) | C++26 | diff --git a/reference/execution/execution/get_completion_scheduler.md b/reference/execution/execution/get_completion_scheduler.md new file mode 100644 index 0000000000..91fbdf5c1b --- /dev/null +++ b/reference/execution/execution/get_completion_scheduler.md @@ -0,0 +1,112 @@ +# get_completion_scheduler +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template + struct get_completion_scheduler_t { unspecified }; + + template + constexpr get_completion_scheduler_t get_completion_scheduler{}; + } +``` +* unspecified[italic] + +## 概要 +`get_completion_scheduler`は、[Sender](sender.md)の[属性](get_env.md)から指定完了タグに関連付けられた完了Schedulerを取得する[クエリオブジェクト](../queryable.md)である。 +完了タグ`completion-tag`には、[`set_value_t`](set_value.md), [`set_error_t`](set_error.md), [`set_stopped_t`](set_stopped.md)のいずれかを指定する。 + +コア定数式[`forwarding_query`](forwarding_query.md.nolink)`(get_completion_scheduler)`は`true`値を返す。 + + +### 完了Scheduler +完了Scheduler(completion scheduler)は、非同期操作の完了操作を実行するための実行リソース(例:CPUスレッド)と関連付けられた[Scheduler](scheduler.md)である。 + +非同期操作の完了操作は、下記いずれかの完了関数呼び出しが該当する。 + +- 値完了関数 [`execution::set_value`](set_value.md) +- エラー完了関数 [`execution::set_error`](set_error.md) +- 停止完了関数 [`execution::set_stopped`](set_stopped.md) + + +## 効果 +呼び出し式`get_completion_scheduler(q)`は下記と等価であり、式が適格ならば[`scheduler`](scheduler.md)を満たす型の値となる。 + +- 引数`q`がconst修飾された`cq`を用いて、式`cq.query(get_completion_scheduler)`が適格であればその値。 +- そうでなければ、呼び出し式は不適格となる。 + + +## 例外 +投げない + + +## カスタマイゼーションポイント +const修飾[クエリ可能オブジェクト](../queryable.md)`cq`に対して式`cq.query(get_completion_scheduler)`が呼び出される。 +このとき、`noexcept(cq.query(get_completion_scheduler)) == true`であること。 + + +## 例 +```cpp +#include +namespace ex = std::execution; + +int main() +{ + ex::run_loop loop; + ex::scheduler auto loop_sch = loop.get_scheduler(); + + // schedule(loop_sch)の完了Schedulerはloop_schに等しい + ex::sender auto snd0 = ex::schedule(loop_sch); + auto sch0 = ex::get_completion_scheduler(ex::get_env(snd0)); + assert(sch0 == loop_sch); + + // 完了Schedulerは接続されたSenderへと引き継がれる + ex::sender auto snd1 = snd0 | ex::then([]{ return 42; }); + auto sch1 = ex::get_completion_scheduler(ex::get_env(snd1)); + assert(sch1 == loop_sch); + +#if 0 + // just Senderは完了Schedulerを持たない + ex::sender auto snd2 = ex::just(42); + auto sch2 = ex::get_completion_scheduler(ex::get_env(snd2)); +#endif +} +``` +* ex::get_completion_scheduler[color ff0000] +* ex::run_loop[link run_loop.md.nolink] +* ex::scheduler[link scheduler.md] +* ex::sender[link sender.md] +* ex::schedule[link schedule.md] +* ex::set_value_t[link set_value.md] +* ex::get_env[link get_env.md] +* ex::then[link then.md.nolink] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::scheduler`](scheduler.md) +- [`execution::schedule`](schedule.md) +- [`execution::set_value`](set_value.md) +- [`execution::set_error`](set_error.md) +- [`execution::set_stopped`](set_stopped.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/get_env.md b/reference/execution/execution/get_env.md index a6afad75c0..91f10c1341 100644 --- a/reference/execution/execution/get_env.md +++ b/reference/execution/execution/get_env.md @@ -23,7 +23,7 @@ namespace std::execution { 式`get_env(o)`は下記と等価であり、[`queryable`](../queryable.md)を満たす型の値となる。 - 引数`o`がconst修飾された`co`を用いて、式`co.get_env()`が有効であればその値。 -- そうでなければ、空(empty)のクエリ可能オブジェクト[`env<>{}`](env.md) +- そうでなければ、空のクエリ可能オブジェクト[`env<>{}`](env.md) ## 例外 diff --git a/reference/execution/execution/schedule.md b/reference/execution/execution/schedule.md index 8bd90c80c1..519e98b5f6 100644 --- a/reference/execution/execution/schedule.md +++ b/reference/execution/execution/schedule.md @@ -16,12 +16,13 @@ namespace std::execution { `schedule`は、[Scheduler](scheduler.md)から[スケジュールSender](sender.md)を取得するSenderファクトリである。 スケジュールSenderより生成される[非同期操作](operation_state.md)を開始すると、Schedulerに関連付けられた実行リソース上で空の[値完了関数](set_value.md)を呼び出す。 +スケジュールSenderの[値完了Scheduler](get_completion_scheduler.md)は、引数に指定したScheduler`sch`に等しい。 ## 効果 呼び出し式`schedule(sch)`は式`sch.schedule()`と等価であり、式の型は[`sender`](sender.md)を満たすこと。 -式[`get_completion_scheduler`](get_completion_scheduler.md.nolink)`<`[`set_value_t`](set_value.md)`>(`[`get_env`](get_env.md)`(sch.schedule())) == sch`が不適格もしくは`false`となる場合、呼び出し式`schedule(sch)`の動作は未定義となる。 +式[`get_completion_scheduler`](get_completion_scheduler.md)`<`[`set_value_t`](set_value.md)`>(`[`get_env`](get_env.md)`(sch.schedule())) == sch`が不適格もしくは`false`となる場合、呼び出し式`schedule(sch)`の動作は未定義となる。 ## カスタマイゼーションポイント @@ -93,6 +94,7 @@ val=42 ## 関連項目 - [`execution::scheduler`](scheduler.md) +- [`execution::get_completion_scheduler`](get_completion_scheduler.md) ## 参照 diff --git a/reference/execution/execution/scheduler.md b/reference/execution/execution/scheduler.md index 427727a053..1cbe9d0abd 100644 --- a/reference/execution/execution/scheduler.md +++ b/reference/execution/execution/scheduler.md @@ -26,7 +26,7 @@ namespace std::execution { * sender[link sender.md] * queryable[link ../queryable.md] * schedule[link schedule.md] -* get_completion_scheduler[link get_completion_scheduler.md.nolink] +* get_completion_scheduler[link get_completion_scheduler.md] * set_value_t[link set_value.md] * get_env[link get_env.md] * equality_comparable[link /reference/concepts/equality_comparable.md] @@ -41,7 +41,7 @@ namespace std::execution { - [クエリ可能オブジェクト](../queryable.md)である - `Sch`型の値`sch`に対して下記を満たすこと - [`execution::schedule`](schedule.md)`(sch)`が[Sender](sender.md)を返す - - 上記Senderの[値完了関数](set_value.md)の[完了Scheduler](get_completion_scheduler.md.nolink)が`Sch`に等しいこと + - 上記Senderの[値完了関数](set_value.md)の[完了Scheduler](get_completion_scheduler.md)が`Sch`に等しいこと - コピー可能かつ同値比較可能 @@ -66,14 +66,14 @@ namespace std::execution { * value_types_of_t[link value_types_of_t.md.nolink] * type_identity_t[link /reference/type_traits/true_type.md] -型`Sch`を`scheduler`の型、型`Env`を[`sender_in`](sender_in.md)`, Env>`を満たす実行環境の型としたとき、`sender-in-of, Env>`のモデルとなること。 +型`Sch`を`scheduler`の型、型`Env`を[`sender_in`](sender_in.md)`<`[`schedule_result_t`](schedule_result_t.md)`, Env>`を満たす実行環境の型としたとき、`sender-in-of<`[`schedule_result_t`](schedule_result_t.md)`, Env>`のモデルとなること。 [`copyable`](/reference/concepts/copyable.md)`>`および[`equality_comparable`](/reference/concepts/equality_comparable.md)`>`により要求される操作は、例外で終了してはならない。 これらの操作やScheduler型の[`schedule`](schedule.md)関数は、異なるスレッドから同時に操作を呼び出す可能性がある場合でも、データ競合を引き起こしてはならない。 あるScheduler型`Sch`の2つの値`sch1`と`sch2`に対して、`sch1`と`sch2`が同じ実行リソースを共有する場合に限って、`sch1 == sch2`は`true`となる。 -あるScheduler`sch`に対して、式[`get_completion_scheduler`](get_completion_scheduler.md.nolink)`<`[`set_value_t`](set_value.md)`>(`[`get_env`](get_env.md)`(`[`schedule`](schedule.md)`(sch)))`が`sch`と等しいこと。 +あるScheduler`sch`に対して、式[`get_completion_scheduler`](get_completion_scheduler.md)`<`[`set_value_t`](set_value.md)`>(`[`get_env`](get_env.md)`(`[`schedule`](schedule.md)`(sch)))`が`sch`と等しいこと。 あるScheduler`sch`に対して式[`get_domain`](get_domain.md.nolink)`(sch)`が適格であるとき、式`get_domain(`[`get_env`](get_env.md)`(`[`schedule`](schedule.md)`(sch)))`も適格であり、かつ同じ型を持つ。 @@ -113,6 +113,7 @@ int main() ## 関連項目 - [`execution::schedule`](schedule.md) +- [`execution::get_completion_scheduler`](get_completion_scheduler.md) ## 参照 diff --git a/reference/execution/queryable.md b/reference/execution/queryable.md index f5f95c9b91..b6caabdc0f 100644 --- a/reference/execution/queryable.md +++ b/reference/execution/queryable.md @@ -11,13 +11,13 @@ concept queryable = destructible; * destructible[link /reference/concepts/destructible.md] ## 概要 -`queryable`は、型`T`がクエリ可能オブジェクト(queryable object)の制約を満たすことを表す説明専用のコンセプトである。 +`queryable`は、型`T`がクエリ可能オブジェクトの制約を満たすことを表す説明専用のコンセプトである。 -### クエリ可能オブジェクト -クエリ可能オブジェクトは、クエリオブジェクト(query object)をキーとして対応する値を保持する、読み取り専用のKey/Valueデータ構造とみなせる。 +### クエリ可能オブジェクト(queryable object) +クエリ可能オブジェクトは、クエリオブジェクトをキーとして対応する値を保持する、読み取り専用のKey/Valueデータ構造とみなせる。 -- [`execution::env<>{}`](execution/env.md) : 空(empty)のクエリ可能オブジェクト +- [`execution::env<>{}`](execution/env.md) : 空のクエリ可能オブジェクト - [`execution::prop(q, v)`](execution/prop.md) : キー`q`と対応値`v`を保持する最小のクエリ可能オブジェクト - [`execution::env{...}`](execution/env.md) : 複数のKey/Valueを保持するクエリ可能オブジェクト - `queryable`コンセプトを満たすユーザ定義クラスのオブジェクト @@ -29,6 +29,16 @@ concept queryable = destructible; - [Scheduler](execution/scheduler.md)オブジェクト自身 +### クエリオブジェクト(query object) +クエリオブジェクトは、クエリ可能オブジェクトに対する問い合わせ(query)を行うカスタマイゼーションポイントオブジェクトである。 + +説明用のクエリオブジェクト`q`、クエリ可能オブジェクト`env`、引数パック`args`としたとき + +- 問い合わせ式`q(env, args...)`は、`void`型であってはならない。 +- 問い合わせ式`q(env, args...)`は、クエリオブジェクトや引数を変更せず、等しさを保持(equality-preserving)する。 +- 式`env.query(q, args...)`が適格であれば、問い合わせ式`q(env, args...)`と等価である。 + + ## モデル 説明用の`env`を`Env`型のオブジェクトとする。 呼び出し可能オブジェクト`q`と部分式パック`args`に対して、`requires { q(env, args...) }`が`true`であれば、`q(env, args...)`が`q`に課されるセマンティック要件を満たす場合に、`Env`は`queryable`のモデルである。 From d512f5b175382335a2becad9da0311a9de99dc42 Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 21 Apr 2025 18:43:28 +0900 Subject: [PATCH 1556/3948] execution: get_stop_token,stop_token_of_t (#1384) --- reference/execution/execution.md | 4 +- reference/execution/execution/env.md | 2 +- reference/execution/execution/env/query.md | 2 +- .../execution/get_completion_scheduler.md | 2 +- reference/execution/execution/prop.md | 2 +- reference/execution/get_stop_token.md | 79 +++++++++++++++++++ reference/execution/stop_token_of_t.md | 35 ++++++++ 7 files changed, 120 insertions(+), 6 deletions(-) create mode 100644 reference/execution/get_stop_token.md create mode 100644 reference/execution/stop_token_of_t.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 835352c5b9..e614367a59 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -37,8 +37,8 @@ namespace std::execution { |------|------|----------------| | [`forwarding_query`](forwarding_query.md.nolink) | クエリオブジェクトに転送問い合わせ可能か否かを返す (customization point object) | C++26 | | [`get_allocator`](get_allocator.md.nolink) | アロケータ取得のクエリオブジェクト (customization point object) | C++26 | -| [`get_stop_token`](get_stop_token.md.nolink) | 停止トークン取得のクエリオブジェクト (customization point object) | C++26 | -| [`stop_token_of_t`](get_stop_token.md.nolink) | 指定型から停止トークン型を取得 (alias template) | C++26 | +| [`get_stop_token`](get_stop_token.md) | 停止トークン取得のクエリオブジェクト (customization point object) | C++26 | +| [`stop_token_of_t`](stop_token_of_t.md) | 指定型から停止トークン型を取得 (alias template) | C++26 | | [`execution::get_domain`](execution/get_domain.md.nolink) | 実行ドメイン取得のクエリオブジェクト (customization point object) | C++26 | | [`execution::get_scheduler`](execution/get_scheduler.md.nolink) | Scheduler取得のクエリオブジェクト (customization point object) | C++26 | | [`execution::get_delegation_scheduler`](execution/get_delegation_scheduler.md.nolink) | 委譲Scheduler取得のクエリオブジェクト (customization point object) | C++26 | diff --git a/reference/execution/execution/env.md b/reference/execution/execution/env.md index 947d376b42..769d43c018 100644 --- a/reference/execution/execution/env.md +++ b/reference/execution/execution/env.md @@ -62,7 +62,7 @@ int main() * ex::env[color ff0000] * ex::prop[link prop.md] * std::get_allocator[link get_allocator.md.nolink] -* std::get_stop_token[link get_stop_token.md.nolink] +* std::get_stop_token[link ../get_stop_token.md] * std::never_stop_token[link /reference/stop_token/never_stop_token.md] ### 出力 diff --git a/reference/execution/execution/env/query.md b/reference/execution/execution/env/query.md index dbd030f8f4..da8641029b 100644 --- a/reference/execution/execution/env/query.md +++ b/reference/execution/execution/env/query.md @@ -70,7 +70,7 @@ int main() * ex::env[link ../env.md] * ex::prop[link ../prop.md] * std::get_allocator[link get_allocator.md.nolink] -* std::get_stop_token[link get_stop_token.md.nolink] +* std::get_stop_token[link ../../get_stop_token.md] * std::never_stop_token[link /reference/stop_token/never_stop_token.md] * std::stop_token[link /reference/stop_token/stop_token.md] diff --git a/reference/execution/execution/get_completion_scheduler.md b/reference/execution/execution/get_completion_scheduler.md index 91fbdf5c1b..6dc7385982 100644 --- a/reference/execution/execution/get_completion_scheduler.md +++ b/reference/execution/execution/get_completion_scheduler.md @@ -11,7 +11,7 @@ namespace std::execution { template constexpr get_completion_scheduler_t get_completion_scheduler{}; - } +} ``` * unspecified[italic] diff --git a/reference/execution/execution/prop.md b/reference/execution/execution/prop.md index 893422d1fb..e3790653f1 100644 --- a/reference/execution/execution/prop.md +++ b/reference/execution/execution/prop.md @@ -49,7 +49,7 @@ int main() } ``` * ex::prop[color ff0000] -* std::get_stop_token[link get_stop_token.md.nolink] +* std::get_stop_token[link ../get_stop_token.md] * std::never_stop_token[link /reference/stop_token/never_stop_token.md] ### 出力 diff --git a/reference/execution/get_stop_token.md b/reference/execution/get_stop_token.md new file mode 100644 index 0000000000..53e7d91fcd --- /dev/null +++ b/reference/execution/get_stop_token.md @@ -0,0 +1,79 @@ +# get_stop_token +* execution[meta header] +* cpo[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std { + struct get_stop_token_t { unspecified }; + constexpr get_stop_token_t get_stop_token{}; +} +``` +* unspecified[italic] + +## 概要 +`get_stop_token`は、[クエリ可能オブジェクト](queryable.md)から[停止トークン](/reference/stop_token/stoppable_token.md)を取得する[クエリオブジェクト](queryable.md)である。 + +コア定数式[`forwarding_query`](forwarding_query.md.nolink)`(get_stop_token)`は`true`値を返す。 + + +## 効果 +式`get_stop_token(env)`は下記と等価であり、[`stoppable_token`](/reference/stop_token/stoppable_token.md)を満たす型の値となる。 + +- 引数`env`がconst修飾された`cenv`を用いて、式`cenv.query(get_stop_token)`が有効であればその値。 +- そうでなければ、[`never_stop_token{}`](/reference/stop_token/never_stop_token.md) + + +## 例外 +投げない + + +## カスタマイゼーションポイント +const修飾[クエリ可能オブジェクト](queryable.md)`env`に対して式`env.query(get_stop_token)`が呼び出される。 +このとき、`noexcept(cenv.query(get_stop_token)) == true`であること。 + + +## 例 +```cpp +#include +#include +#include +namespace ex = std::execution; + +int main() +{ + // just Senderは停止トークンを持たない + ex::sender auto sndr = ex::just(42); + auto token = std::get_stop_token(ex::get_env(sndr)); + static_assert(std::same_as); +} +``` +* std::get_stop_token[color ff0000] +* ex::sender[link execution/sender.md] +* ex::just[link execution/just.md.nolink] +* ex::get_env[link execution/get_env.md] +* std::never_stop_token[link /reference/stop_token/never_stop_token.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`stoppable_token`](/reference/stop_token/stoppable_token.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/stop_token_of_t.md b/reference/execution/stop_token_of_t.md new file mode 100644 index 0000000000..4598709017 --- /dev/null +++ b/reference/execution/stop_token_of_t.md @@ -0,0 +1,35 @@ +# stop_token_of_t +* execution[meta header] +* std[meta namespace] +* type-alias[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + using stop_token_of_t = remove_cvref_t()))>; +} +``` +* get_stop_token[link get_stop_token.md] + +## 概要 +[クエリ可能オブジェクト型](queryable.md)`T`から[停止トークン型](/reference/stop_token/stoppable_token.md)を取得する。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`get_stop_token`](get_stop_token.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) From b74d3e8a3c43de280c7f4ba960abc400f190e818 Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 21 Apr 2025 19:17:59 +0900 Subject: [PATCH 1557/3948] execution: get_allocator (#1384) --- reference/execution/execution.md | 2 +- reference/execution/execution/env.md | 2 +- reference/execution/execution/env/query.md | 4 +- reference/execution/execution/get_env.md | 2 +- reference/execution/execution/prop.md | 2 +- reference/execution/get_allocator.md | 82 ++++++++++++++++++++++ reference/execution/get_stop_token.md | 2 +- 7 files changed, 89 insertions(+), 7 deletions(-) create mode 100644 reference/execution/get_allocator.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index e614367a59..72368c2674 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -36,7 +36,7 @@ namespace std::execution { | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`forwarding_query`](forwarding_query.md.nolink) | クエリオブジェクトに転送問い合わせ可能か否かを返す (customization point object) | C++26 | -| [`get_allocator`](get_allocator.md.nolink) | アロケータ取得のクエリオブジェクト (customization point object) | C++26 | +| [`get_allocator`](get_allocator.md) | アロケータ取得のクエリオブジェクト (customization point object) | C++26 | | [`get_stop_token`](get_stop_token.md) | 停止トークン取得のクエリオブジェクト (customization point object) | C++26 | | [`stop_token_of_t`](stop_token_of_t.md) | 指定型から停止トークン型を取得 (alias template) | C++26 | | [`execution::get_domain`](execution/get_domain.md.nolink) | 実行ドメイン取得のクエリオブジェクト (customization point object) | C++26 | diff --git a/reference/execution/execution/env.md b/reference/execution/execution/env.md index 769d43c018..c44e65d765 100644 --- a/reference/execution/execution/env.md +++ b/reference/execution/execution/env.md @@ -61,7 +61,7 @@ int main() ``` * ex::env[color ff0000] * ex::prop[link prop.md] -* std::get_allocator[link get_allocator.md.nolink] +* std::get_allocator[link ../get_allocator.md] * std::get_stop_token[link ../get_stop_token.md] * std::never_stop_token[link /reference/stop_token/never_stop_token.md] diff --git a/reference/execution/execution/env/query.md b/reference/execution/execution/env/query.md index da8641029b..3a4620af3d 100644 --- a/reference/execution/execution/env/query.md +++ b/reference/execution/execution/env/query.md @@ -12,7 +12,7 @@ constexpr decltype(auto) query(QueryTag q) const noexcept(see below); * see below[italic] ## 概要 -クエリオブジェクト`q`をキーとして、対応する値を問い合わせる。 +[クエリオブジェクト](../../queryable.md)`q`をキーとして、対応する値を問い合わせる。 ## テンプレートパラメータ制約 @@ -69,7 +69,7 @@ int main() * query[color ff0000] * ex::env[link ../env.md] * ex::prop[link ../prop.md] -* std::get_allocator[link get_allocator.md.nolink] +* std::get_allocator[link ../../get_allocator.md] * std::get_stop_token[link ../../get_stop_token.md] * std::never_stop_token[link /reference/stop_token/never_stop_token.md] * std::stop_token[link /reference/stop_token/stop_token.md] diff --git a/reference/execution/execution/get_env.md b/reference/execution/execution/get_env.md index 91f10c1341..91f76cd4fd 100644 --- a/reference/execution/execution/get_env.md +++ b/reference/execution/execution/get_env.md @@ -22,7 +22,7 @@ namespace std::execution { ## 効果 式`get_env(o)`は下記と等価であり、[`queryable`](../queryable.md)を満たす型の値となる。 -- 引数`o`がconst修飾された`co`を用いて、式`co.get_env()`が有効であればその値。 +- 引数`o`がconst修飾された`co`を用いて、式`co.get_env()`が適格であればその値。 - そうでなければ、空のクエリ可能オブジェクト[`env<>{}`](env.md) diff --git a/reference/execution/execution/prop.md b/reference/execution/execution/prop.md index e3790653f1..05055d8db2 100644 --- a/reference/execution/execution/prop.md +++ b/reference/execution/execution/prop.md @@ -23,7 +23,7 @@ namespace std::execution { * unwrap_reference_t[link /reference/type_traits/unwrap_reference.md] ## 概要 -`QueryTag`型クエリオブジェクトのキーと`ValueType`型の値から、[クエリ可能オブジェクト](../queryable.md)を構築する。 +`QueryTag`型[クエリオブジェクト](../queryable.md)のキーと`ValueType`型の値から、[クエリ可能オブジェクト](../queryable.md)を構築する。 ## 適格要件 diff --git a/reference/execution/get_allocator.md b/reference/execution/get_allocator.md new file mode 100644 index 0000000000..6747421d62 --- /dev/null +++ b/reference/execution/get_allocator.md @@ -0,0 +1,82 @@ +# get_allocator +* execution[meta header] +* cpo[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std { + struct get_allocator_t { unspecified }; + constexpr get_allocator_t get_allocator{}; +} +``` +* unspecified[italic] + +## 概要 +`get_allocator`は、[クエリ可能オブジェクト](queryable.md)からアロケータを取得する[クエリオブジェクト](queryable.md)である。 + +コア定数式[`forwarding_query`](forwarding_query.md.nolink)`(get_allocator)`は`true`値を返す。 + + +## 効果 +式`get_allocator(env)`は下記と等価であり、説明専用コンセプト`simple-allocator`を満たす型の値となる。 + +- 引数`env`がconst修飾された`cenv`を用いて、式`cenv.query(get_allocator)`が適格であること。 + +```cpp +template +concept simple-allocator = + requires(Alloc alloc, size_t n) { + { *alloc.allocate(n) } -> same_as; + { alloc.deallocate(alloc.allocate(n), n) }; + } && + copy_constructible && + equality_comparable; +``` + + +## 例外 +投げない + + +## カスタマイゼーションポイント +const修飾[クエリ可能オブジェクト](queryable.md)`env`に対して式`env.query(get_allocator)`が呼び出される。 +このとき、`noexcept(cenv.query(get_allocator)) == true`であること。 + + +## 例 +```cpp +#include +#include +#include +namespace ex = std::execution; + +int main() +{ + auto env = ex::prop(std::get_allocator, std::allocator{}); + + auto alloc = std::get_allocator(env); + static_assert(std::same_as>); +} +``` +* std::get_allocator[color ff0000] +* ex::prop[link execution/prop.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/get_stop_token.md b/reference/execution/get_stop_token.md index 53e7d91fcd..9bd1ad082f 100644 --- a/reference/execution/get_stop_token.md +++ b/reference/execution/get_stop_token.md @@ -21,7 +21,7 @@ namespace std { ## 効果 式`get_stop_token(env)`は下記と等価であり、[`stoppable_token`](/reference/stop_token/stoppable_token.md)を満たす型の値となる。 -- 引数`env`がconst修飾された`cenv`を用いて、式`cenv.query(get_stop_token)`が有効であればその値。 +- 引数`env`がconst修飾された`cenv`を用いて、式`cenv.query(get_stop_token)`が適格であればその値。 - そうでなければ、[`never_stop_token{}`](/reference/stop_token/never_stop_token.md) From e57a099f313bf449e43178496d7ca45d7d6bb454 Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 21 Apr 2025 19:44:45 +0900 Subject: [PATCH 1558/3948] =?UTF-8?q?execution:=20vaild-completion-signatu?= =?UTF-8?q?res=E8=AA=AC=E6=98=8E=E3=82=92=E7=A7=BB=E5=8B=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../execution/execution/completion_signatures.md | 10 ++++++++++ reference/execution/execution/sender_in.md | 11 ++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/reference/execution/execution/completion_signatures.md b/reference/execution/execution/completion_signatures.md index b45088cbbc..26bb518789 100644 --- a/reference/execution/execution/completion_signatures.md +++ b/reference/execution/execution/completion_signatures.md @@ -14,6 +14,16 @@ namespace std::execution { ## 概要 `completion_signatures`クラステンプレートは、完了シグネチャの集合をテンプレートパラメータとして表現する。 +実行制御ライブラリ仕様定義では、説明専用のコンセプト`valid-completion-signatures`を利用する。 + +```cpp +template +concept valid-completion-signatures = see below; +``` +* see below[italic] + +`Sigs`が[`completion_signatures`](completion_signatures.md)クラステンプレートの特殊化であるとき、`Sigs`は説明専用コンセプト`valid-completion-signatures`のモデルである。 + ## テンプレートパラメータ制約 `Fns`の各要素`Fn`が、下記の説明専用コンセプト`completion-signature`を満たすこと。 diff --git a/reference/execution/execution/sender_in.md b/reference/execution/execution/sender_in.md index 76dfa7530a..52a2293d5c 100644 --- a/reference/execution/execution/sender_in.md +++ b/reference/execution/execution/sender_in.md @@ -20,6 +20,7 @@ namespace std::execution { * sender[link sender.md] * queryable[link ../queryable.md] * get_completion_signatures[link get_completion_signatures.md] +* valid-completion-signatures[link completion_signatures.md] ## 概要 `sender_in`は、[Sender型](sender.md)`Sndr`が[環境](../queryable.md)`Env`において非同期操作を作成できることを表すコンセプトである。 @@ -28,15 +29,7 @@ namespace std::execution { ## モデル 説明用に`sndr`を`decltype((sndr))`が`Sndr`型となる式、`rcvr`を環境`Env`に関連付けられた[Receiver](receiver.md)とする。 -```cpp -template -concept valid-completion-signatures = see below; -``` -* see below[italic] - -[`completion_signatures`](completion_signatures.md)クラステンプレートの特殊化であるとき、`Sigs`は説明専用コンセプト`valid-completion-signatures`のモデルである。 - -また、ある完了操作の完了シグネチャが[`completion_signatures_of_t`](completion_signatures_of_t.md)``で取得される[`completion_signatures`](completion_signatures.md)リストに含まれるとき、`Sndr`と`Env`における許容可能完了(permissible completion)となる。 +ある完了操作の完了シグネチャが[`completion_signatures_of_t`](completion_signatures_of_t.md)``で取得される[`completion_signatures`](completion_signatures.md)リストに含まれるとき、`Sndr`と`Env`における許容可能完了(permissible completion)となる。 `sndr`と`rcvr`の[接続](connect.md)後に[Operation State](operation_state.md)を開始することで評価されうる完了操作が、全て許容可能完了(permissible completion)である場合、`Sndr`と`Env`は`sender_in`のモデルとなる。 From ebdeeed0dd24393fe1ecf25fe2a068424d561a59 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 22 Apr 2025 14:33:12 +0900 Subject: [PATCH 1559/3948] execution: get_domain,get_(delegation_)scheduler (#1384) --- reference/execution/execution.md | 6 +-- reference/execution/execution/connect.md | 2 +- .../execution/execution/get-domain-late.md | 8 +-- .../execution/get_delegation_scheduler.md | 53 +++++++++++++++++++ reference/execution/execution/get_domain.md | 52 ++++++++++++++++++ reference/execution/execution/get_env.md | 2 +- .../execution/execution/get_scheduler.md | 52 ++++++++++++++++++ reference/execution/execution/scheduler.md | 2 +- reference/execution/get_allocator.md | 6 +-- reference/execution/get_stop_token.md | 4 +- 10 files changed, 172 insertions(+), 15 deletions(-) create mode 100644 reference/execution/execution/get_delegation_scheduler.md create mode 100644 reference/execution/execution/get_domain.md create mode 100644 reference/execution/execution/get_scheduler.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 72368c2674..8f9619c98b 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -39,9 +39,9 @@ namespace std::execution { | [`get_allocator`](get_allocator.md) | アロケータ取得のクエリオブジェクト (customization point object) | C++26 | | [`get_stop_token`](get_stop_token.md) | 停止トークン取得のクエリオブジェクト (customization point object) | C++26 | | [`stop_token_of_t`](stop_token_of_t.md) | 指定型から停止トークン型を取得 (alias template) | C++26 | -| [`execution::get_domain`](execution/get_domain.md.nolink) | 実行ドメイン取得のクエリオブジェクト (customization point object) | C++26 | -| [`execution::get_scheduler`](execution/get_scheduler.md.nolink) | Scheduler取得のクエリオブジェクト (customization point object) | C++26 | -| [`execution::get_delegation_scheduler`](execution/get_delegation_scheduler.md.nolink) | 委譲Scheduler取得のクエリオブジェクト (customization point object) | C++26 | +| [`execution::get_domain`](execution/get_domain.md) | 実行ドメイン取得のクエリオブジェクト (customization point object) | C++26 | +| [`execution::get_scheduler`](execution/get_scheduler.md) | Scheduler取得のクエリオブジェクト (customization point object) | C++26 | +| [`execution::get_delegation_scheduler`](execution/get_delegation_scheduler.md) | 委任Scheduler取得のクエリオブジェクト (customization point object) | C++26 | | [`execution::forward_progress_guarantee`](execution/forward_progress_guarantee.md.nolink) | 前進保証 (enum) | C++26 | | [`execution::get_forward_progress_guarantee`](execution/get_forward_progress_guarantee.md.nolink) | 前進保証取得のクエリオブジェクト (customization point object) | C++26 | | [`execution::get_completion_scheduler`](execution/get_completion_scheduler.md) | 完了Scheduler取得のクエリオブジェクト (customization point object) | C++26 | diff --git a/reference/execution/execution/connect.md b/reference/execution/execution/connect.md index 867baf9aba..467004ba33 100644 --- a/reference/execution/execution/connect.md +++ b/reference/execution/execution/connect.md @@ -14,7 +14,7 @@ namespace std::execution { ## 概要 `connect`は、[Sender](sender.md)と[Receiver](receiver.md)を接続した結果[Operation State](operation_state.md)を返すカスタマイゼーションポイントオブジェクトである。 -カスタマイゼーションポイントオブジェクトの呼び出し式`connect(sndr, rcvr)`は、下記の動作となる。 +呼び出し式`connect(sndr, rcvr)`は、下記の動作となる。 - [`transform_sender`](transform_sender.md)により`sndr`から新しいSender`new_sndr`へ変換する。(多くのケースで無変換) - 呼び出し式が適格であるならば、`new_sndr.connect(rcvr)`を返す。 diff --git a/reference/execution/execution/get-domain-late.md b/reference/execution/execution/get-domain-late.md index 7650a7dac0..bb9a34f9db 100644 --- a/reference/execution/execution/get-domain-late.md +++ b/reference/execution/execution/get-domain-late.md @@ -25,14 +25,14 @@ constexpr auto get-domain-late(const Sndr& sndr, const Env& env) noexcept; }(); ``` * query-or-default[link query-or-default.md.nolink] - * get_domain[link get_domain.md.nolink] + * get_domain[link get_domain.md] * default_domain()[link default_domain.md] - それ以外のとき、下記リストのうち最初に妥当となる式の型、かつ`void`ではない型とする。 - - [`get_domain`](get_domain.md.nolink)`(`[`get_env`](get_env.md)`(sndr))` + - [`get_domain`](get_domain.md)`(`[`get_env`](get_env.md)`(sndr))` - [`completion-domain`](completion-domain.md.nolink)`(sndr)` - - `get_domain(env)` - - `get_domain(`[`get_scheduler`](get_scheduler.md.nolink)`(env))` + - [`get_domain`](get_domain.md)`(env)` + - [`get_domain`](get_domain.md)`(`[`get_scheduler`](get_scheduler.md)`(env))` - [`default_domain()`](default_domain.md) diff --git a/reference/execution/execution/get_delegation_scheduler.md b/reference/execution/execution/get_delegation_scheduler.md new file mode 100644 index 0000000000..4e53900830 --- /dev/null +++ b/reference/execution/execution/get_delegation_scheduler.md @@ -0,0 +1,53 @@ +# get_delegation_scheduler +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct get_delegation_scheduler_t { unspecified }; + constexpr get_delegation_scheduler_t get_delegation_scheduler{}; +} +``` +* unspecified[italic] + +## 概要 +`get_delegation_scheduler`は、[クエリ可能オブジェクト](../queryable.md)から委任[Scheduler](scheduler.md)を取得する[クエリオブジェクト](../queryable.md)である。 + +コア定数式[`forwarding_query`](forwarding_query.md.nolink)`(get_delegation_scheduler)`は`true`値を返す。 + + +## 効果 +呼び出し式`get_delegation_scheduler(env)`は下記と等価であり、適格であれば[`scheduler`](scheduler.md)を満たす型の値となる。 + +- 引数`env`がconst修飾された`cenv`を用いて、式`cenv.query(get_delegation_scheduler)` + + +## 例外 +投げない + + +## カスタマイゼーションポイント +const修飾[クエリ可能オブジェクト](../queryable.md)`cenv`に対して式`cenv.query(get_delegation_scheduler)`が呼び出される。 +このとき、`noexcept(cenv.query(get_delegation_scheduler)) == true`であること。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`scheduler`](scheduler.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [NVIDIA/stdexec, Pull Request#354, with_delegee_scheduler](https://github.com/NVIDIA/stdexec/pull/354) diff --git a/reference/execution/execution/get_domain.md b/reference/execution/execution/get_domain.md new file mode 100644 index 0000000000..c2162f2a9a --- /dev/null +++ b/reference/execution/execution/get_domain.md @@ -0,0 +1,52 @@ +# get_domain +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct get_domain_t { unspecified }; + constexpr get_domain_t get_domain{}; +} +``` +* unspecified[italic] + +## 概要 +`get_domain`は、[クエリ可能オブジェクト](../queryable.md)から[実行ドメイン](default_domain.md)のタグ型を取得する[クエリオブジェクト](../queryable.md)である。 + +コア定数式[`forwarding_query`](forwarding_query.md.nolink)`(get_domain)`は`true`値を返す。 + + +## 効果 +呼び出し式`get_domain(env)`は下記と等価。 + +- 引数`env`がconst修飾された`cenv`を用いて、式`cenv.query(get_domain)` + + +## 例外 +投げない + + +## カスタマイゼーションポイント +const修飾[クエリ可能オブジェクト](../queryable.md)`cenv`に対して式`cenv.query(get_domain)`が呼び出される。 +このとき、`noexcept(cenv.query(get_domain)) == true`であること。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`default_domain`](default_domain.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/get_env.md b/reference/execution/execution/get_env.md index 91f76cd4fd..7998c204ef 100644 --- a/reference/execution/execution/get_env.md +++ b/reference/execution/execution/get_env.md @@ -20,7 +20,7 @@ namespace std::execution { ## 効果 -式`get_env(o)`は下記と等価であり、[`queryable`](../queryable.md)を満たす型の値となる。 +呼び出し式`get_env(o)`は下記と等価であり、[`queryable`](../queryable.md)を満たす型の値となる。 - 引数`o`がconst修飾された`co`を用いて、式`co.get_env()`が適格であればその値。 - そうでなければ、空のクエリ可能オブジェクト[`env<>{}`](env.md) diff --git a/reference/execution/execution/get_scheduler.md b/reference/execution/execution/get_scheduler.md new file mode 100644 index 0000000000..bbca27bb16 --- /dev/null +++ b/reference/execution/execution/get_scheduler.md @@ -0,0 +1,52 @@ +# get_scheduler +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct get_scheduler { unspecified }; + constexpr get_scheduler_t get_scheduler{}; +} +``` +* unspecified[italic] + +## 概要 +`get_scheduler`は、[クエリ可能オブジェクト](../queryable.md)から[Scheduler](scheduler.md)を取得する[クエリオブジェクト](../queryable.md)である。 + +コア定数式[`forwarding_query`](forwarding_query.md.nolink)`(get_scheduler)`は`true`値を返す。 + + +## 効果 +呼び出し式`get_scheduler(env)`は下記と等価であり、適格であれば[`scheduler`](scheduler.md)を満たす型の値となる。 + +- 引数`env`がconst修飾された`cenv`を用いて、式`cenv.query(get_scheduler)` + + +## 例外 +投げない + + +## カスタマイゼーションポイント +const修飾[クエリ可能オブジェクト](../queryable.md)`cenv`に対して式`cenv.query(get_scheduler)`が呼び出される。 +このとき、`noexcept(cenv.query(get_scheduler)) == true`であること。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`scheduler`](scheduler.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/scheduler.md b/reference/execution/execution/scheduler.md index 1cbe9d0abd..13ccf70ec5 100644 --- a/reference/execution/execution/scheduler.md +++ b/reference/execution/execution/scheduler.md @@ -75,7 +75,7 @@ namespace std::execution { あるScheduler`sch`に対して、式[`get_completion_scheduler`](get_completion_scheduler.md)`<`[`set_value_t`](set_value.md)`>(`[`get_env`](get_env.md)`(`[`schedule`](schedule.md)`(sch)))`が`sch`と等しいこと。 -あるScheduler`sch`に対して式[`get_domain`](get_domain.md.nolink)`(sch)`が適格であるとき、式`get_domain(`[`get_env`](get_env.md)`(`[`schedule`](schedule.md)`(sch)))`も適格であり、かつ同じ型を持つ。 +あるScheduler`sch`に対して式[`get_domain`](get_domain.md)`(sch)`が適格であるとき、式[`get_domain`](get_domain.md)`(`[`get_env`](get_env.md)`(`[`schedule`](schedule.md)`(sch)))`も適格であり、かつ同じ型を持つ。 Scheduler型のデストラクタは、[`schedule`](schedule.md)が返すSenderオブジェクトに接続されたReceiverの完了を待機してブロックしてはならない。 diff --git a/reference/execution/get_allocator.md b/reference/execution/get_allocator.md index 6747421d62..79932980ca 100644 --- a/reference/execution/get_allocator.md +++ b/reference/execution/get_allocator.md @@ -19,9 +19,9 @@ namespace std { ## 効果 -式`get_allocator(env)`は下記と等価であり、説明専用コンセプト`simple-allocator`を満たす型の値となる。 +呼び出し式`get_allocator(env)`は下記と等価であり、適格であれば説明専用コンセプト`simple-allocator`を満たす型の値となる。 -- 引数`env`がconst修飾された`cenv`を用いて、式`cenv.query(get_allocator)`が適格であること。 +- 引数`env`がconst修飾された`cenv`を用いて、式`cenv.query(get_allocator)` ```cpp template @@ -40,7 +40,7 @@ concept simple-allocator = ## カスタマイゼーションポイント -const修飾[クエリ可能オブジェクト](queryable.md)`env`に対して式`env.query(get_allocator)`が呼び出される。 +const修飾[クエリ可能オブジェクト](queryable.md)`cenv`に対して式`cenv.query(get_allocator)`が呼び出される。 このとき、`noexcept(cenv.query(get_allocator)) == true`であること。 diff --git a/reference/execution/get_stop_token.md b/reference/execution/get_stop_token.md index 9bd1ad082f..d83666b856 100644 --- a/reference/execution/get_stop_token.md +++ b/reference/execution/get_stop_token.md @@ -19,7 +19,7 @@ namespace std { ## 効果 -式`get_stop_token(env)`は下記と等価であり、[`stoppable_token`](/reference/stop_token/stoppable_token.md)を満たす型の値となる。 +呼び出し式`get_stop_token(env)`は下記と等価であり、[`stoppable_token`](/reference/stop_token/stoppable_token.md)を満たす型の値となる。 - 引数`env`がconst修飾された`cenv`を用いて、式`cenv.query(get_stop_token)`が適格であればその値。 - そうでなければ、[`never_stop_token{}`](/reference/stop_token/never_stop_token.md) @@ -30,7 +30,7 @@ namespace std { ## カスタマイゼーションポイント -const修飾[クエリ可能オブジェクト](queryable.md)`env`に対して式`env.query(get_stop_token)`が呼び出される。 +const修飾[クエリ可能オブジェクト](queryable.md)`cenv`に対して式`cenv.query(get_stop_token)`が呼び出される。 このとき、`noexcept(cenv.query(get_stop_token)) == true`であること。 From a285ffa64b58b847e320c338356c512cb61f9728 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 22 Apr 2025 18:07:16 +0900 Subject: [PATCH 1560/3948] execution: value_type_of_t,error_type_of_t,sends_stopped (#1384) --- reference/execution/execution.md | 6 +- .../execution/execution/error_types_of_t.md | 80 ++++++++++++++++++ .../execution/execution/gather-signatures.md | 44 ++++++++++ reference/execution/execution/scheduler.md | 2 +- .../execution/execution/sends_stopped.md | 71 ++++++++++++++++ .../execution/execution/value_types_of_t.md | 82 +++++++++++++++++++ 6 files changed, 281 insertions(+), 4 deletions(-) create mode 100644 reference/execution/execution/error_types_of_t.md create mode 100644 reference/execution/execution/gather-signatures.md create mode 100644 reference/execution/execution/sends_stopped.md create mode 100644 reference/execution/execution/value_types_of_t.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 8f9619c98b..b86510b3b9 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -85,9 +85,9 @@ namespace std::execution { | [`execution::sender_to`](execution/sender_to.md) | 指定Receiverに接続可能なSender (concept) | C++26 | | [`execution::get_completion_signatures`](execution/get_completion_signatures.md) | Senderの完了シグネチャ集合を取得 (customization point object) | C++26 | | [`execution::completion_signatures_of_t`](execution/completion_signatures_of_t.md) | Senderの完了シグネチャ集合を取得 (alias template) | C++26 | -| [`execution::value_types_of_t`](execution/value_types_of_t.md.nolink) | Senderの値完了型を取得 (alias template) | C++26 | -| [`execution::error_types_of_t`](execution/error_types_of_t.md.nolink) | Senderのエラー完了型を取得 (alias template) | C++26 | -| [`execution::sends_stopped`](execution/value_types_of_t.md.nolink) | Senderが停止完了に対応するか否か (variable template) | C++26 | +| [`execution::value_types_of_t`](execution/value_types_of_t.md) | Senderの値完了シグネチャ集合から指定操作で型を生成 (alias template) | C++26 | +| [`execution::error_types_of_t`](execution/error_types_of_t.md) | Senderのエラー完了シグネチャ集合から指定操作で型を生成 (alias template) | C++26 | +| [`execution::sends_stopped`](execution/sends_stopped.md) | Senderが停止完了を送信しうるか否か (variable template) | C++26 | | [`execution::tag_of_t`](execution/tag_of_t.md.nolink) | Senderのタグ型を取得 (alias template) | C++26 | | [`execution::transform_sender`](execution/transform_sender.md) | Senderを変換 (function template) | C++26 | | [`execution::transform_env`](execution/transform_env.md) | 環境を変換 (function template) | C++26 | diff --git a/reference/execution/execution/error_types_of_t.md b/reference/execution/execution/error_types_of_t.md new file mode 100644 index 0000000000..416c8551ed --- /dev/null +++ b/reference/execution/execution/error_types_of_t.md @@ -0,0 +1,80 @@ +# error_types_of_t +* execution[meta header] +* std::execution[meta namespace] +* type-alias[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template, + template class Variant = variant-or-empty> + requires sender_in + using error_types_of_t = + gather-signatures, type_identity_t, Variant>; +} +``` +* env<>[link env.md] +* sender_in[link sender_in.md] +* variant-or-empty[link variant-or-empty.md.nolink] +* gather-signatures[link gather-signatures.md] +* set_error_t[link set_error.md] +* completion_signatures_of_t[link completion_signatures_of_t.md] +* type_identity_t[link /reference/type_traits/type_identity.md] + +## 概要 +[Sender型](sender.md)`Sndr`が[環境](receiver.md)`Env`において非同期操作を作成できるとき、[完了シグネチャ集合](completion_signatures.md)のうち[エラー完了シグネチャ](set_error.md)の引数型集合に対して型情報の変換操作を適用し、新たな型を取得する。 + +エラー完了シグネチャの引数型集合を`{E0, E1, ... EN}`としたとき、変換操作をテンプレートパラメータ`Variant`で指定する。 + +- `Variant` : 引数型集合に適用する型変換操作。 + +`error_types_of_t`のデフォルト動作では、引数型集合の[`variant`](/reference/variant/variant.md)に変換される。 + + +## 例 +```cpp example +#include +#include +namespace ex = std::execution; + +int main() +{ + // エラー完了シグネチャを持たないSender + ex::sender auto snd1 = ex::just(123, 'X'); + using Types1 = ex::error_types_of_t; + // Type1 == 有効だがオブジェクト構築不可な型 + + // エラー完了シグネチャ set_error_t(int) + ex::sender auto snd2 = ex::just_error(42); + using Types2 = ex::error_types_of_t; + static_assert(std::same_as>); +} +``` +* ex::error_types_of_t[color ff0000] +* ex::sender[link sender.md] +* ex::just[link just.md.nolink] +* ex::just_error[link just_error.md.nolink] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::completion_signatures`](completion_signatures.md) +- [`execution::set_error`](set_error.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/gather-signatures.md b/reference/execution/execution/gather-signatures.md new file mode 100644 index 0000000000..aae12731bd --- /dev/null +++ b/reference/execution/execution/gather-signatures.md @@ -0,0 +1,44 @@ +# gather-signatures +* execution[meta header] +* std::execution[meta namespace] +* type-alias[meta id-type] +* cpp26[meta cpp] + +```cpp +template class Tuple, + template class Variant> +using gather-signatures = /*see below*/ +``` +* valid-completion-signatures[link completion_signatures.md] +* see below[italic] + +## 概要 +`gather-signatures`は、[完了シグネチャ集合](completion_signatures.md)`Completions`のうち完了タグ`Tag`に適合する引数型リスト集合に対して型情報の変換操作を適用し、新たな型を取得する説明専用のエイリアステンプレートである。 + +完了タグ`Tag`には下記いずれかの型を指定する。 + +- [`execution::set_value_t`](set_value.md) +- [`execution::set_error_t`](set_error.md) +- [`execution::set_stopped_t`](set_stopped.md) + +完了シグネチャに適合する引数型リスト集合を`{Ts0..., Ts1..., ... TsN...}`としたとき、2段階の型変換操作をテンプレートパラメータ`Tuple`, `Variant`で指定する。 + +- `Tuple` : それぞれの引数型リスト`Ts...`に適用する型変換操作。 +- `Variant` : 上記変換後に、引数型リスト集合に適用する型変換操作。 + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`execution::value_types_of_t`](value_types_of_t.md) +- [`execution::error_types_of_t`](error_types_of_t.md) +- [`execution::sends_stopped`](sends_stopped.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/scheduler.md b/reference/execution/execution/scheduler.md index 13ccf70ec5..da64b22d98 100644 --- a/reference/execution/execution/scheduler.md +++ b/reference/execution/execution/scheduler.md @@ -63,7 +63,7 @@ namespace std::execution { ``` * set_value_t[link set_value.md] * sender_in[link sender_in.md] -* value_types_of_t[link value_types_of_t.md.nolink] +* value_types_of_t[link value_types_of_t.md] * type_identity_t[link /reference/type_traits/true_type.md] 型`Sch`を`scheduler`の型、型`Env`を[`sender_in`](sender_in.md)`<`[`schedule_result_t`](schedule_result_t.md)`, Env>`を満たす実行環境の型としたとき、`sender-in-of<`[`schedule_result_t`](schedule_result_t.md)`, Env>`のモデルとなること。 diff --git a/reference/execution/execution/sends_stopped.md b/reference/execution/execution/sends_stopped.md new file mode 100644 index 0000000000..8efd74d33b --- /dev/null +++ b/reference/execution/execution/sends_stopped.md @@ -0,0 +1,71 @@ +# sends_stopped +* execution[meta header] +* std::execution[meta namespace] +* variable[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template> + requires sender_in + constexpr bool sends_stopped = + !same_as, + gather-signatures, + type-list, type-list>>; +} +``` +* env<>[link env.md] +* sender_in[link sender_in.md] +* gather-signatures[link gather-signatures.md] +* set_stopped_t[link set_stopped.md] +* completion_signatures_of_t[link completion_signatures_of_t.md] + +## 概要 +[Sender型](sender.md)`Sndr`が[環境](receiver.md)`Env`において非同期操作を作成できるとき、[完了シグネチャ集合](completion_signatures.md)が[停止完了シグネチャ](set_stopped.md)を含むか否かを返す。 + + +## 例 +```cpp example +#include +#include +namespace ex = std::execution; + +int main() +{ + // 停止完了シグネチャを持たないSender + ex::sender auto snd1 = ex::just(123, 'X'); + static_assert(not ex::sends_stopped); + + // 停止完了シグネチャ set_stopped_t() + ex::sender auto snd2 = ex::just_stopped(); + static_assert(ex::sends_stopped); +} +``` +* ex::sends_stopped[color ff0000] +* ex::sender[link sender.md] +* ex::just[link just.md.nolink] +* ex::just_stopped[link just_stopped.md.nolink] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::completion_signatures`](completion_signatures.md) +- [`execution::set_stopped`](set_stopped.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/value_types_of_t.md b/reference/execution/execution/value_types_of_t.md new file mode 100644 index 0000000000..1a5d74344f --- /dev/null +++ b/reference/execution/execution/value_types_of_t.md @@ -0,0 +1,82 @@ +# value_types_of_t +* execution[meta header] +* std::execution[meta namespace] +* type-alias[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template, + template class Tuple = decayed-tuple, + template class Variant = variant-or-empty> + requires sender_in + using value_types_of_t = + gather-signatures, Tuple, Variant>; +} +``` +* env<>[link env.md] +* sender_in[link sender_in.md] +* decayed-tuple[link decayed-tuple.md.nolink] +* variant-or-empty[link variant-or-empty.md.nolink] +* gather-signatures[link gather-signatures.md] +* set_value_t[link set_value.md] +* completion_signatures_of_t[link completion_signatures_of_t.md] + +## 概要 +[Sender型](sender.md)`Sndr`が[環境](receiver.md)`Env`において非同期操作を作成できるとき、[完了シグネチャ集合](completion_signatures.md)のうち[値完了シグネチャ](set_value.md)の引数型リスト集合に対して型情報の変換操作を適用し、新たな型を取得する。 + +値完了シグネチャの引数型リスト集合を`{Ts0..., Ts1..., ... TsN...}`としたとき、2段階の型変換操作をテンプレートパラメータ`Tuple`, `Variant`で指定する。 + +- `Tuple` : それぞれの引数型リスト`Ts...`に適用する型変換操作。 +- `Variant` : 上記変換後に、引数型リスト集合に適用する型変換操作。 + +`value_types_of_t`のデフォルト動作では、引数型リスト[`tuple`](/reference/tuple/tuple.md)の[`variant`](/reference/variant/variant.md)に変換される。 + + +## 例 +```cpp example +#include +#include +namespace ex = std::execution; + +int main() +{ + // 値完了シグネチャ set_value_t(int, char) + ex::sender auto snd1 = ex::just(123, 'X'); + using Types1 = ex::value_types_of_t; + static_assert(std::same_as>>); + + // 値完了シグネチャを持たないSender + ex::sender auto snd2 = ex::just_error(42); + using Types2 = ex::value_types_of_t; + // Type2 == 有効だがオブジェクト構築不可な型 +} +``` +* ex::value_types_of_t[color ff0000] +* ex::sender[link sender.md] +* ex::just[link just.md.nolink] +* ex::just_error[link just_error.md.nolink] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::completion_signatures`](completion_signatures.md) +- [`execution::set_value`](set_value.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) From 0c1871fe4d90d7fb1e91931273710842ef76198d Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 22 Apr 2025 23:17:34 +0900 Subject: [PATCH 1561/3948] =?UTF-8?q?C++26=20embed:=20=E3=81=8B=E3=82=89?= =?UTF-8?q?=20=E2=86=92=20=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26/embed.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp26/embed.md b/lang/cpp26/embed.md index ef5fc9ee64..7b2b64d8ac 100644 --- a/lang/cpp26/embed.md +++ b/lang/cpp26/embed.md @@ -63,7 +63,7 @@ int main() { - `limit(1024)`では、読み込むバイトサイズを1024byteに制限する。もしファイルサイズが1024byteよりも大きければ、最初の1024バイトのみが読み込まれる。 - `prefix(0x01, 0x02, 0x03)`では、`data.bin`の内容の前に`0x01 0x02 0x03`のバイト列を追加している。 - `suffix(0xFE, 0xFF)`では、`data.bin`の内容のあとに`0xFE 0xFF`のバイト列を追加している。 -- `if_empty(0x00)`では、`data.bin`がからであった場合、`0x00`のバイト列を格納している。 +- `if_empty(0x00)`では、`data.bin`が空であった場合、`0x00`のバイト列を格納している。 また、`#embed`ディレクティブは、複数のパラメータを**順不同**で組み合わせて指定することもできる。 From 586dfedab516829df0c0ad76894c125e87a865fc Mon Sep 17 00:00:00 2001 From: rotarymars Date: Wed, 23 Apr 2025 09:49:37 +0900 Subject: [PATCH 1562/3948] reference/iterator/contiguous_iterator.md: Created new specification Commit for issue #1424 --- reference/iterator/contiguous_iterator.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/reference/iterator/contiguous_iterator.md b/reference/iterator/contiguous_iterator.md index 5a16cc318d..64168c6598 100644 --- a/reference/iterator/contiguous_iterator.md +++ b/reference/iterator/contiguous_iterator.md @@ -42,9 +42,10 @@ C++20で導入された`contiguous_iterator`は、要素がメモリー上で連 `a, b`を間接参照可能なイテレータ、`c`を間接参照不可能なイテレータとし、`b`は`a`から、`c`は`b`からそれぞれ到達可能であるとする。そのような型`I`のイテレータ`a, b, c`と[`iter_difference_t`](/reference/iterator/iter_difference_t.md)の示す型`D`について次の条件を満たす場合に限って、型`I`は`contiguous_iterator`のモデルである。 -- `to_address(a) == addressof(*a)` -- `to_address(b) == to_address(a) + D(b - a)` -- `to_address(c) == to_address(a) + D(c - a)` +## 要件 +- C++26: このイテレータの範囲`[i, s)`はポインタ範囲`[to_address(i), to_address(i + ranges::distance(i, s)))`に置き換えて使用することが実装に許可される + - 注:このイテレータをアルゴリズム適用した場合、イテレータのインクリメントが一回しか起こらない可能性があり、個々のインクリメントに対して副作用を起こすことを期待してはならない + - 備考:連続イテレータの範囲に対する操作として、`std::copy()`の実装が`std::memmove()`の呼び出しで完了するなど、イテレータを一つずつ進めるのではなくメモリ操作で高速実装されることを許可するものである ## 例 ```cpp example From 5cb7ad6fc23e301a8c937de6419a6d07c872edbe Mon Sep 17 00:00:00 2001 From: Keita Nonaka Date: Tue, 22 Apr 2025 19:06:21 -0700 Subject: [PATCH 1563/3948] chore: add `.gitignore` file Signed-off-by: Keita Nonaka --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..046e5ce7de --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store From 93cfae5853d0ecb315d930cbecf7845d162b5a3a Mon Sep 17 00:00:00 2001 From: rotarymars Date: Wed, 23 Apr 2025 12:06:32 +0900 Subject: [PATCH 1564/3948] lang/cpp26/contracts.md: Fixed it correctly Commit for issue #1419 --- lang/cpp26/contracts.md | 53 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/lang/cpp26/contracts.md b/lang/cpp26/contracts.md index f8af8f946b..0d82b64e65 100644 --- a/lang/cpp26/contracts.md +++ b/lang/cpp26/contracts.md @@ -17,6 +17,20 @@ C++26では、関数の正確な動作を明示的に指定でき、プログラ この機能は、関数のインターフェースに対する期待値を明確にする役割があり、バグの早期発見、コードの可読性向上に寄与することが期待されている。 ## 仕様 +### キーワード +`pre`、`post`、`assert`は文脈依存キーワードである。これらは`override`や`final`と同様に、特定の文脈でのみ特別な意味を持つ。 + +- 変数名や関数名として使用可能 + ```cpp + int pre = 42; // OK: 変数名として使用 + void post() {} // OK: 関数名として使用 + ``` +- 契約指定の文脈でのみ特別な意味を持つ + ```cpp + void f() + pre(true); // ここでは契約指定として機能 + ``` + ### 契約の種類 契約には以下の3種類が定められている。 @@ -35,6 +49,24 @@ int safe_division(int numerator, int denominator) ``` ここでは、`denominator`が0でないことを事前条件として指定している。 +事前条件では、必ずしも関数のパラメータを使用する必要はない。グローバル状態やクラスのメンバ変数など、呼び出し時点で有効な任意の式を使用できる。 +```cpp +class Resource { +private: + bool is_available = false; +public: + void use() + pre(is_available) // 引数を使用していない事前条件 + { + // リソースを使用 + } + + void activate() { + is_available = true; + } +}; +``` + #### 事後条件(post) 関数の実行後に満たされているべき条件を指定する。 ```cpp @@ -48,6 +80,25 @@ int increment(int x) `post`では、返り値を`r`としてバインドし、条件式内で利用している。ここには、任意の変数名が使用できる。変数は定数(`const`)な左辺値参照である。 +事後条件の結果名導入子(result-name-introducer)は省略可能である。特に、`void`を返す関数では、戻り値を参照する必要がない場合に省略できる。 + +```cpp +class Container { + // ... +public: + void clear() + post(empty()) // 結果名導入子を省略した事後条件 + { + // コンテナの内容をクリア + } + + bool empty() const { + // コンテナが空かどうかを返す + return true; + } +}; +``` + #### アサーション(assert) 関数の実行中に満たされているべき条件を指定する。 ```cpp @@ -101,7 +152,7 @@ g++ -std=c++26 -fcontracts -fcontract-semantic=observe main.cpp 以下の操作は、気をつけなければならない。 - 契約式内において副作用を要する式を記述した場合(グローバル変数の変更、`volatile`変数への参照、`constexpr`でない関数の呼び出しなど) - 契約式内で例外を送出すると、std::terminate()が呼び出され、プログラムが終了する。 -- 通常の関数やメンバ関数には契約を適用できるが、特殊な関数(例えば`default`によって定義されたコピーコンストラクタやデストラクタ)には適用できない。適用すると、プログラムは不正(ill-formed)となる。 +- 通常の関数やメンバ関数には契約を適用できるが、特殊な関数(例えば`default`によって定義されたコピーコンストラクタやデストラクタ)には適用できない。適用すると、プログラムは不適格(ill-formed)となる。 ## 関連項目 - [C++ 将来 契約に基づくプログラミング](/lang/future/contract-based_programming.md) From dbd3566a381d0bbccd28bfa51211ebeee04a4c5e Mon Sep 17 00:00:00 2001 From: rotarymars Date: Wed, 23 Apr 2025 13:49:45 +0900 Subject: [PATCH 1565/3948] reference/cmath/double_t.md: New sample program --- reference/cmath/double_t.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/reference/cmath/double_t.md b/reference/cmath/double_t.md index 5fecdefac6..57ea716c51 100644 --- a/reference/cmath/double_t.md +++ b/reference/cmath/double_t.md @@ -15,6 +15,20 @@ namespace std { [`FLT_EVAL_METHOD`](/reference/cfloat/flt_eval_method.md) が 0 または 1 のとき `double`, 2 のとき `long double`, それ以外の場合は実装依存。 +## 使用例 +```cpp example +#include +#include +int main() { + std::double_t num = 1.00001; + std::cout << num << std::endl; +} +``` + +## 出力例 +``` +1.00001 +``` ## バージョン ### 言語 From 75705c0f0d110870eb19be7d80a1b0921910a1ef Mon Sep 17 00:00:00 2001 From: rotarymars Date: Wed, 23 Apr 2025 13:57:13 +0900 Subject: [PATCH 1566/3948] reference/cmath/float_t.md: Created sample program --- reference/cmath/float_t.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/reference/cmath/float_t.md b/reference/cmath/float_t.md index 9eb93ac0b7..d05aa527b4 100644 --- a/reference/cmath/float_t.md +++ b/reference/cmath/float_t.md @@ -15,6 +15,19 @@ namespace std { [`FLT_EVAL_METHOD`](/reference/cfloat/flt_eval_method.md) が 0 のとき `float`, 1 のとき `double`, 2 のとき `long double`, それ以外の場合は実装依存。 +## 例 +```cpp example +#include +#include +int main() { + std::float_t num = 1.010; + std::cout << num << std::endl; +} +``` +## 出力例 +``` +1.01 +``` ## バージョン ### 言語 From 06d798bc7c7a4d09d7a907cf3d53d3f63bbd2bf6 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Wed, 23 Apr 2025 14:00:47 +0900 Subject: [PATCH 1567/3948] reference/cstddef/null.md: Created sample program --- reference/cstddef/null.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/reference/cstddef/null.md b/reference/cstddef/null.md index 4626fc22b8..d7dc7f55f8 100644 --- a/reference/cstddef/null.md +++ b/reference/cstddef/null.md @@ -20,6 +20,14 @@ - `` - `` +## 例 +```cpp example +#include +int main() { + int* p = NULL; + delete p; +} +``` ## 備考 C++03において、「ヌルポインタ定数」は「値が0になる整数定数式」と定義されていた。したがって、マクロ`NULL`の値として`0`や`0L`は規格に適合するが、`(void*)0`は整数定数式ではないため適合しない。 From 3465a3900aa5052f703a9ad996847a109f1448c1 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 23 Apr 2025 17:42:49 +0900 Subject: [PATCH 1568/3948] =?UTF-8?q?C++26:=20=E3=80=8C=E5=85=88=E8=A1=8C?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=82=AB=E3=83=B3=E3=83=9E=E3=81=AE=E3=81=AA?= =?UTF-8?q?=E3=81=84=E7=9C=81=E7=95=A5=E8=A8=98=E5=8F=B7=E3=82=92=E9=9D=9E?= =?UTF-8?q?=E6=8E=A8=E5=A5=A8=E5=8C=96=E3=80=8D=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20(close=20#1377)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp26.md | 2 +- lang/cpp26/the_oxford_variadic_comma.md | 34 +++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 lang/cpp26/the_oxford_variadic_comma.md diff --git a/implementation-status.md b/implementation-status.md index db46c0746d..e791f47b7d 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -317,7 +317,7 @@ | P3068R6: [定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) | 定数式の文脈での例外の送出と捕捉を許可 | | | | | | P2865R6: [非推奨だった配列の比較を削除](/lang/cpp26/remove_deprecated_array_comparisons.md.nolink) | C++20で非推奨となっていた配列比較を削除 | 15 | 20 | | | | P1061R10: [構造化束縛でパックを導入できるようにする](/lang/cpp26/structured_bindings_can_introduce_a_pack.md) | タプルを分解する際に複数の変数をパックとして宣言できるようにする。`auto [a, ...xs] = f();` | | | | | -| P3176R0: [先行するカンマのない省略記号を非推奨化](/lang/cpp26/the_oxford_variadic_comma.md.nolink) | `void f(int, ...);`はOK。`void f(int...);`は非推奨 | 15 | 20 | | | +| P3176R0: [先行するカンマのない省略記号を非推奨化](/lang/cpp26/the_oxford_variadic_comma.md) | `void f(int, ...);`はOK。`void f(int...);`は非推奨 | 15 | 20 | | | | P3074R7: [共用体をトリビアルに未初期化できるようにする](/lang/cpp26/trivial_unions.md.nolink) | `constexpr`での`union U { T storage[N]; };`を許可し、未初期化にできるようにする | | | | | | P2900R14: [契約プログラミングをサポートする](/lang/cpp26/contracts.md) | 関数の事前条件、事後条件、不変条件を記述できるようにする | | | | | | P2841R7: [コンセプトと変数テンプレートにテンプレートテンプレートパラメータのサポートを追加](/lang/cpp26/concept_and_variable-template_template-parameters.md.nolink) | テンプレート引数をあとで指定するテンプレートテンプレートパラメータを、コンセプトと変数テンプレートでも使用できるようにする | | | | | diff --git a/lang/cpp26.md b/lang/cpp26.md index e47939c88b..0d843a56ef 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -110,7 +110,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| | [非推奨だった配列の比較を削除](/lang/cpp26/remove_deprecated_array_comparisons.md.nolink) | C++20で非推奨となっていた配列比較を削除 | -| [先行するカンマのない省略記号を非推奨化](/lang/cpp26/the_oxford_variadic_comma.md.nolink) | `void f(int, ...);`はOK。`void f(int...);`は非推奨 | +| [先行するカンマのない省略記号を非推奨化](/lang/cpp26/the_oxford_variadic_comma.md) | `void f(int, ...);`はOK。`void f(int...);`は非推奨 | ## ライブラリ更新の概要 diff --git a/lang/cpp26/the_oxford_variadic_comma.md b/lang/cpp26/the_oxford_variadic_comma.md new file mode 100644 index 0000000000..febee00d6d --- /dev/null +++ b/lang/cpp26/the_oxford_variadic_comma.md @@ -0,0 +1,34 @@ +# 先行するカンマのない省略記号を非推奨化 [P3176R0] +* cpp26[meta cpp] + + + +このページはC++26に採用される見込みの言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + + + +## 概要 +C++26では、カンマ後ではない「`...`」の使用を非推奨化する。 + +```cpp +template +void a(Ts...); // OK, 関数テンプレートのパラメータパック + +void b(auto...); // OK, 関数テンプレートのパラメータパック + +void c(int, ...); // OK, Cとの互換性もある +void d(...); // OK, Cとの互換性もある + +void e(int...); // C++23:OK, C++26:非推奨, C17:不適格 +void f(int x...); // C++23:OK, C++26:非推奨, C17:不適格 + +void g(int... args); // 不適格、あいまい +``` + +この構文は、C言語 (C89) の互換性としてC++98で導入されたが、C17では不適格となっている。C言語との互換性としてこの構文を維持する必要がなくなったため、非推奨となった。 + + +## 参照 +- [P3176R0 The Oxford variadic comma](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3176r0.html) From eede276dfcb30fbbdfd505ed4c10e8eeec8dfefa Mon Sep 17 00:00:00 2001 From: Keita Nonaka Date: Wed, 23 Apr 2025 08:50:54 -0700 Subject: [PATCH 1569/3948] fix: use `replace with` instead of ` replace by` Signed-off-by: Keita Nonaka --- reference/atomic/atomic/exchange.md | 4 ++-- reference/atomic/atomic_exchange.md | 4 ++-- reference/atomic/atomic_exchange_explicit.md | 4 ++-- reference/atomic/atomic_ref/exchange.md | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/reference/atomic/atomic/exchange.md b/reference/atomic/atomic/exchange.md index a0eb2da879..274f7eb3a0 100644 --- a/reference/atomic/atomic/exchange.md +++ b/reference/atomic/atomic/exchange.md @@ -54,7 +54,7 @@ int main() std::atomic x(1); if (x.exchange(2) == 1) { - std::cout << "replaced 1 by 2" << std::endl; + std::cout << "replaced 1 with 2" << std::endl; } else { std::cout << "replace failed" << std::endl; @@ -66,7 +66,7 @@ int main() ### 出力 ``` -replaced 1 by 2 +replaced 1 with 2 ``` diff --git a/reference/atomic/atomic_exchange.md b/reference/atomic/atomic_exchange.md index 7c303880ba..097daa4428 100644 --- a/reference/atomic/atomic_exchange.md +++ b/reference/atomic/atomic_exchange.md @@ -72,7 +72,7 @@ int main() std::atomic x(1); if (std::atomic_exchange(&x, 2) == 1) { - std::cout << "replaced 1 by 2" << std::endl; + std::cout << "replaced 1 with 2" << std::endl; } else { std::cout << "replace failed" << std::endl; @@ -84,7 +84,7 @@ int main() ### 出力 ``` -replaced 1 by 2 +replaced 1 with 2 ``` ## バージョン diff --git a/reference/atomic/atomic_exchange_explicit.md b/reference/atomic/atomic_exchange_explicit.md index eecc353831..47be113b6d 100644 --- a/reference/atomic/atomic_exchange_explicit.md +++ b/reference/atomic/atomic_exchange_explicit.md @@ -78,7 +78,7 @@ int main() std::atomic x(1); if (std::atomic_exchange_explicit(&x, 2, std::memory_order_acquire) == 1) { - std::cout << "replaced 1 by 2" << std::endl; + std::cout << "replaced 1 with 2" << std::endl; } else { std::cout << "replace failed" << std::endl; @@ -90,7 +90,7 @@ int main() ### 出力 ``` -replaced 1 by 2 +replaced 1 with 2 ``` diff --git a/reference/atomic/atomic_ref/exchange.md b/reference/atomic/atomic_ref/exchange.md index 4c3bc9a7d7..8daa8cbf6a 100644 --- a/reference/atomic/atomic_ref/exchange.md +++ b/reference/atomic/atomic_ref/exchange.md @@ -47,7 +47,7 @@ int main() std::atomic_ref x{value}; if (x.exchange(2) == 1) { - std::cout << "replaced 1 by 2" << std::endl; + std::cout << "replaced 1 with 2" << std::endl; } } ``` @@ -56,7 +56,7 @@ int main() ### 出力 ``` -replaced 1 by 2 +replaced 1 with 2 ``` From 4bee12d0e3d2623562717b57c6d4eaff2e126bae Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 24 Apr 2025 10:28:45 +0900 Subject: [PATCH 1570/3948] =?UTF-8?q?C++26:=20carries=5Fdependency?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E3=81=AE=E5=89=8A=E9=99=A4=E3=82=92=E8=A8=98?= =?UTF-8?q?=E8=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp26.md b/lang/cpp26.md index 0d843a56ef..da980ea76f 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -448,7 +448,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 ### 機能の非推奨化 - [``](/reference/type_traits.md)の[`std::is_trivial`](/reference/type_traits/is_trivial.md)を非推奨化 - これは[`std::is_trivially_copyable`](/reference/type_traits/is_trivially_copyable.md)と[`std::is_trivially_default_constructible`](/reference/type_traits/is_trivially_default_constructible.md)の2つが合わさったものであるが、それらは異なる状況で必要になるものであった -- [`std::memory_order::consume`](/reference/atomic/memory_order.md)と[`std::kill_dependency()`](/reference/atomic/kill_dependency.md)を非推奨化 +- [`std::memory_order::consume`](/reference/atomic/memory_order.md)と、それに関連して[`std::kill_dependency()`](/reference/atomic/kill_dependency.md)を非推奨化し、[`[[carries_dependency]]`](/lang/cpp11/attributes.md)属性を削除 ### 非推奨の取り消し From 02e867582d0203c7f9b0fe217f505e28ebe746e1 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 24 Apr 2025 10:37:34 +0900 Subject: [PATCH 1571/3948] =?UTF-8?q?C++11=20=E5=B1=9E=E6=80=A7:=20?= =?UTF-8?q?=E9=96=A2=E9=80=A3=E9=A0=85=E7=9B=AE=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp11/attributes.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lang/cpp11/attributes.md b/lang/cpp11/attributes.md index ac564a646b..89dc7c8e86 100644 --- a/lang/cpp11/attributes.md +++ b/lang/cpp11/attributes.md @@ -168,6 +168,8 @@ C++11で採用されたもの以外で検討された以下の機能は、属性 - [C++14 `[[deprecated]]`属性](/lang/cpp14/deprecated_attr.md) - [C++17 `[[maybe_unused]]`属性](/lang/cpp17/maybe_unused.md) - [C++17 `[[nodiscard]]`属性](/lang/cpp17/nodiscard.md) + - [C++20 `[[nodiscard]]`属性に理由となる文字列を付加できるようにする](/lang/cpp20/nodiscard_should_have_a_reason.md) + - [C++20 `[[nodiscard]]`をコンストラクタのオーバーロードごとに付加できるようにする](/lang/cpp20/nodiscard_for_constructors.md) - [C++17 `[[fallthrough]]`属性](/lang/cpp17/fallthrough.md) - [C++20 `[[no_unique_address]]`属性](/lang/cpp20/language_support_for_empty_objects.md) - [C++20 `[[likely]]`, `[[unlikely]]`属性](/lang/cpp20/likely_and_unlikely_attributes.md) From f91ef86ff2814bbe3c0368e22e1f41d11ee89986 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 24 Apr 2025 11:14:18 +0900 Subject: [PATCH 1572/3948] =?UTF-8?q?C++26:=20=E3=80=8C=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E3=81=AE=E7=84=A1=E8=A6=96=E6=80=A7=E3=82=92=E8=A6=8B=E7=9B=B4?= =?UTF-8?q?=E3=81=97=E3=80=8D=E3=82=92=E8=BF=BD=E5=8A=A0=20(close=20#1175)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp11/attributes.md | 2 + lang/cpp17/non_standard_attributes.md | 3 +- lang/cpp26.md | 2 +- ...the_ignorability_of_standard_attributes.md | 82 +++++++++++++++++++ 5 files changed, 88 insertions(+), 3 deletions(-) create mode 100644 lang/cpp26/on_the_ignorability_of_standard_attributes.md diff --git a/implementation-status.md b/implementation-status.md index e791f47b7d..51d1420b28 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -295,7 +295,7 @@ | P2169R4: [宣言のみで使用しない変数の名前として`_`をサポート](/lang/cpp26/nice_placeholder_with_no_name.md) | 変数名`_`は暗黙で`[[maybe_unused]]`が指定される | 14 | 18 | | | | P1854R4: [文字列リテラルの文字エンコーディング失敗を不適格とする](/lang/cpp26/making_non-encodable_string_literals_ill-formed.md) | 文字列リテラルのエンコーディング時に文字表現が失われる場合にコンパイルエラーにする | 14 | 14 | | | | P2361R6: [コンパイル時にのみ使用される文字列の扱いを明確化](/lang/cpp26/unevaluated_strings.md.nolink) | `static_assert`や`[[deprecated]]`などで使用されるコンパイル時の文字列について、文字コードの指定を禁止し、実行時エンコーディングが行われないことを規定 | 14 | 18 | | | -| P2552R3: [属性の無視性を見直し](/lang/cpp26/on_the_ignorability_of_standard_attributes.md.nolink) | 構文として適格な属性のみを無視できるようにし、そうでない属性の使用を不適格とする | | | | | +| P2552R3: [属性の無視性を見直し](/lang/cpp26/on_the_ignorability_of_standard_attributes.md) | 構文として適格な属性のみを無視できるようにし、そうでない属性の使用を不適格とする | | | | | | P2738R1: [定数式での`void*`からポインタ型へのキャストを許可](/lang/cpp26/constexpr_cast_from_voidptr.md.nolink) | 型消去のために`void*`からポインタ型へのキャストを許可する | 14 | 17 | | | | P2741R3: [`static_assert`の診断メッセージにユーザーが生成した文字列の指定を許可](/lang/cpp26/user-generated_static_assert_messages.md) | `constexpr`な`S.size()`と`S.data()`メンバ関数をもつオブジェクトをコンパイル時文字列として指定できるようにする | 14 | 17 | | | | P2558R2: [基本文字集合に@、$、\`を追加](/lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md) | C言語との互換性のためにこれらの文字を基本文字集合に追加 | | Yes | | | diff --git a/lang/cpp11/attributes.md b/lang/cpp11/attributes.md index 89dc7c8e86..162f7330ad 100644 --- a/lang/cpp11/attributes.md +++ b/lang/cpp11/attributes.md @@ -171,6 +171,8 @@ C++11で採用されたもの以外で検討された以下の機能は、属性 - [C++20 `[[nodiscard]]`属性に理由となる文字列を付加できるようにする](/lang/cpp20/nodiscard_should_have_a_reason.md) - [C++20 `[[nodiscard]]`をコンストラクタのオーバーロードごとに付加できるようにする](/lang/cpp20/nodiscard_for_constructors.md) - [C++17 `[[fallthrough]]`属性](/lang/cpp17/fallthrough.md) +- [C++17 不明な属性を無視する](/lang/cpp17/non_standard_attributes.md) + - [C++26 属性の無視性を見直し](/lang/cpp26/on_the_ignorability_of_standard_attributes.md) - [C++20 `[[no_unique_address]]`属性](/lang/cpp20/language_support_for_empty_objects.md) - [C++20 `[[likely]]`, `[[unlikely]]`属性](/lang/cpp20/likely_and_unlikely_attributes.md) - [C++20 属性の名前空間を予約](/lang/cpp20/reserving_attribute_namespaces_for_future_use.md) diff --git a/lang/cpp17/non_standard_attributes.md b/lang/cpp17/non_standard_attributes.md index b4843517b2..4e8022ebcc 100644 --- a/lang/cpp17/non_standard_attributes.md +++ b/lang/cpp17/non_standard_attributes.md @@ -56,6 +56,7 @@ non_standard_attributes.cpp:7:3: warning: unknown attribute 'unknown_attribute' ## 関連項目 - [C++11 属性構文](/lang/cpp11/attributes.md) +- [C++26 属性の無視性を見直し](/lang/cpp26/on_the_ignorability_of_standard_attributes.md) ## 参照 -- [P0283R2 Standard and non-standard attributes.](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0283r2.html) \ No newline at end of file +- [P0283R2 Standard and non-standard attributes.](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0283r2.html) diff --git a/lang/cpp26.md b/lang/cpp26.md index da980ea76f..3dd40f9404 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -59,7 +59,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| -| [属性の無視性を見直し](/lang/cpp26/on_the_ignorability_of_standard_attributes.md.nolink) | 構文として適格な属性のみを無視できるようにし、そうでない属性の使用を不適格とする | +| [属性の無視性を見直し](/lang/cpp26/on_the_ignorability_of_standard_attributes.md) | 構文として適格な属性のみを無視できるようにし、そうでない属性の使用を不適格とする | | [構造化束縛への属性を許可](/lang/cpp26/attributes_for_structured_bindings.md) | `auto [a, b [[maybe_unused]], c] = f();`のように構造化束縛の要素に対して属性を付加できるようにする | diff --git a/lang/cpp26/on_the_ignorability_of_standard_attributes.md b/lang/cpp26/on_the_ignorability_of_standard_attributes.md new file mode 100644 index 0000000000..a814c7c269 --- /dev/null +++ b/lang/cpp26/on_the_ignorability_of_standard_attributes.md @@ -0,0 +1,82 @@ +# 属性の無視性を見直し [P2552R3] +* cpp26[meta cpp] + + + +このページはC++26に採用される見込みの言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 + + + +## 概要 +C++20時点で、不明な属性を無視する仕様は以下のようになっていた。 + +「この規格書で規定されていない属性の動作は実装定義である。実装が認識できない属性はすべて無視される。」 + +この仕様は、規格外の属性を無視するものなのか、規格内の属性も無視してよい意図なのか、という点であいまいだった。 + +C++26では、以下の方針で属性の無視性を決定する。 + +1. 構文的な無視性 +2. 意味論的な無視性 +3. `__has_cpp_attribute`の動作 + + +### 1. 構文的な無視性 +標準属性は、構文的に無視してはならず、意味論的に無視するとしても、実装は構文を診断しなければならない。パラメータのあり・なし、およびその形式といった構文が規定されたものであること。 + +```cpp +// C++26: noreturn属性はパラメータを持たないため構文エラー +[[noreturn("cannot have a reason")]] +int f(); + +// C++26: deprecated属性のパラメータは文字列でなければならないため構文エラー +[[deprecated(not_a_string)]] int g(); + +// C++26: nodiscard属性のパラメータは文字列でなければならないため構文エラー +[[nodiscard(this?is!a:balanced%{token[sequence]})]] +int h(); +``` + +### 2. 意味論的な無視性 +適格なプログラムが与えられた際、特定の標準属性のインスタンスをすべて削除し、プログラムの観測可能な振る舞いを変化させることが実装に許可される。ただし、削除後の動作が削除前のプログラムにとって適合動作 (conforming behaviour) である場合に限られる。 + +例として、空のオブジェクトのサイズを削減する[`[[no_unique_address]]`](/lang/cpp20/language_support_for_empty_objects.md)において、`sizeof(Y)`は[`[[no_unique_address]]`](/lang/cpp20/language_support_for_empty_objects.md)属性が無視されなければ`sizeof(int)`と同値となり、無視されれば`sizeof(X) + sizeof(int)`となる。 + +```cpp +struct X {}; + +struct Y { + [[no_unique_address]] X x; + int i; +}; + +int main() { + return sizeof(Y) == sizeof(int); +} +``` + +`sizeof(Y) == sizeof(int)`の結果が`true`と`false`どちらであったとしても、適合動作であることに変わりはないため、無視することが許容される。 + +C++11の策定段階では属性だった[`alignas`](/lang/cpp11/alignas.md) (その後キーワードになった) は、アライメントが変わるとプログラムの適格動作 (mandated behaviour) が変わるため、無視してはならない。 + + +### 3. `__has_cpp_attribute`の動作 +標準属性の機能テストマクロは、実装がその属性の (省略可能な) 意味論を実装している場合にのみ正の値を返す。構文チェックのみを行い、意味論を実装しない場合には、正の値を返してはならない。 + +```cpp +// no_unique_addressの構文チェックと意味論まで実装されている場合に、trueとなる +#if __has_cpp_attribute(no_unique_address) + … +#endif +``` + + +## 関連項目 +- [C++11 属性構文](/lang/cpp11/attributes.md) +- [C++17 不明な属性を無視する](/lang/cpp17/non_standard_attributes.md) + + +## 参照 +- [P2552R3 On the ignorability of standard attributes](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2552r3.pdf) From 82b627c13561dcff7a8344640ca1988052f0ab92 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 24 Apr 2025 12:21:52 +0900 Subject: [PATCH 1573/3948] =?UTF-8?q?C++26:=20=E3=80=8Cstd::initializer=5F?= =?UTF-8?q?list=E3=81=AE=E9=85=8D=E5=88=97=E3=82=92=E9=9D=99=E7=9A=84?= =?UTF-8?q?=E8=A8=98=E6=86=B6=E5=9F=9F=E3=81=AB=E9=85=8D=E7=BD=AE=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=80=8D=E3=82=92=E8=BF=BD=E5=8A=A0=20(close=20#1171)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp11/initializer_lists.md | 3 +- lang/cpp26.md | 2 +- .../static_storage_for_braced_initializers.md | 84 +++++++++++++++++++ 4 files changed, 88 insertions(+), 3 deletions(-) create mode 100644 lang/cpp26/static_storage_for_braced_initializers.md diff --git a/implementation-status.md b/implementation-status.md index 51d1420b28..813d0fc03e 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -291,7 +291,7 @@ | 言語機能 | 説明 | [GCC][gcc] | [Clang][clang] | [ICX][icx] | [MSVC][msvc] | |----------|------|------------|----------------|------------|--------------| -| P2752R3: [`std::initializer_list`の配列を静的ストレージに配置する](/lang/cpp26/static_storage_for_braced_initializers.md.nolink) | `std::vector v = {1, 2, 3};`のような初期化で初期化子リストを静的ストレージに配置することで無駄なコピーをなくす | 14 | | | | +| P2752R3: [`std::initializer_list`の配列を静的記憶域に配置する](/lang/cpp26/static_storage_for_braced_initializers.md) | `std::vector v = {1, 2, 3};`のような初期化で初期化子リストを静的記憶域に配置することで無駄なコピーをなくす | 14 | | | | | P2169R4: [宣言のみで使用しない変数の名前として`_`をサポート](/lang/cpp26/nice_placeholder_with_no_name.md) | 変数名`_`は暗黙で`[[maybe_unused]]`が指定される | 14 | 18 | | | | P1854R4: [文字列リテラルの文字エンコーディング失敗を不適格とする](/lang/cpp26/making_non-encodable_string_literals_ill-formed.md) | 文字列リテラルのエンコーディング時に文字表現が失われる場合にコンパイルエラーにする | 14 | 14 | | | | P2361R6: [コンパイル時にのみ使用される文字列の扱いを明確化](/lang/cpp26/unevaluated_strings.md.nolink) | `static_assert`や`[[deprecated]]`などで使用されるコンパイル時の文字列について、文字コードの指定を禁止し、実行時エンコーディングが行われないことを規定 | 14 | 18 | | | diff --git a/lang/cpp11/initializer_lists.md b/lang/cpp11/initializer_lists.md index be80ad5195..7b0c85cad6 100644 --- a/lang/cpp11/initializer_lists.md +++ b/lang/cpp11/initializer_lists.md @@ -341,6 +341,7 @@ std::vector v(ar, ar + N); ## 関連項目 - [C++11 一様初期化](uniform_initialization.md) +- [C++26 `std::initializer_list`の配列を静的記憶域に配置する](/lang/cpp26/static_storage_for_braced_initializers.md) ## 参照 @@ -357,4 +358,4 @@ std::vector v(ar, ar + N); - [N2575 Initializer Lists - Alternative Mechanism and Rationale](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2575.pdf) - [N2640 Initializer Lists - Alternative Mechanism and Rationale (v. 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2640.pdf) - [N2672 Initializer List proposed wording](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm) -- [CWG Issue 1030. Evaluation order in initializer-lists used in aggregate initialization](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1030) \ No newline at end of file +- [CWG Issue 1030. Evaluation order in initializer-lists used in aggregate initialization](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1030) diff --git a/lang/cpp26.md b/lang/cpp26.md index 3dd40f9404..9189909104 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -11,7 +11,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| -| [`std::initializer_list`の配列を静的ストレージに配置する](/lang/cpp26/static_storage_for_braced_initializers.md.nolink) | `std::vector v = {1, 2, 3};`のような初期化で初期化子リストを静的ストレージに配置することで無駄なコピーをなくす | +| [`std::initializer_list`の配列を静的記憶域に配置する](/lang/cpp26/static_storage_for_braced_initializers.md) | `std::vector v = {1, 2, 3};`のような初期化で初期化子リストを静的記憶域に配置することで無駄なコピーをなくす | | [宣言のみで使用しない変数の名前として`_`をサポート](/lang/cpp26/nice_placeholder_with_no_name.md) | 変数名`_`は暗黙で`[[maybe_unused]]`が指定される | | [非推奨となっていた列挙型の算術変換を削除](/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md) | C++20から非推奨となっていた列挙値への算術演算で算術型に暗黙変換される仕様を削除 | | [不完全型へのポインタに対する`delete`を不適格とする](/lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md.nolink) | 未定義動作を引き起こす操作をコンパイルエラーとする | diff --git a/lang/cpp26/static_storage_for_braced_initializers.md b/lang/cpp26/static_storage_for_braced_initializers.md new file mode 100644 index 0000000000..d14722cdf8 --- /dev/null +++ b/lang/cpp26/static_storage_for_braced_initializers.md @@ -0,0 +1,84 @@ +# std::initializer_listの配列を静的記憶域に配置する [P2752R3] +* cpp26[meta cpp] + + + +このページはC++26に採用される見込みの言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 + + + +## 概要 +C++11で導入された[`std::initializer_list`](/reference/initializer_list/initializer_list.md)は、自作クラスで組み込み配列のような配列初期化をする構文であるが、そのメモリとしてはスタック上に配置されていた。 + +```cpp +std::vector v = {1, 2, 3}; + +// 以下と等価: +const int __a[] = {1, 2, 3}; +std::vector v(__a, __a + 3); +``` + +C++26では、プリプロセス時にファイル読み込む[`#embed`](/lang/cpp26/embed.md)機能が導入されることもあり、スタックオーバーフローのリスクがあった。 + +```cpp +std::vector v = { + #embed "2mb-image.png" +}; +``` + +このため、C++26では、定数値のみ、かつ`mutable`に保持しない[`std::initializer_list`](/reference/initializer_list/initializer_list.md)は、静的記憶域に配置されるようになる。 + +```cpp +void f(std::initializer_list il); + +void g(float x) { + f({1, x, 3}); + + // 変数を含むため、静的記憶域には保持されない。 + // 以下と等価: + // const double __a[3] = {double{1}, double{x}, double{3}}; + // f(std::initializer_list(__a, __a+3)); +} + +void h() { + f({1, 2, 3}); + + // 定数のみであるため、静的記憶域に保持される。 + // 以下と等価: + // static constexpr double __b[3] = {double{1}, double{2}, double{3}}; + // f(std::initializer_list(__b, __b+3)); +} + +struct A { + mutable int i; +}; + +void q(std::initializer_list); + +void r() { + q({A{1}, A{2}, A{3}}); + + // mutableにするため、静的記憶域に保持される。 + // 以下と等価: + // const A __c[3] = {A{1}, A{2}, A{3}}; + // q(std::initializer_list(__c, __c+3)); +} +``` + +将来的に、静的記憶域に配置される配列は、共有される可能性がある。この動作のために、共有で予期しない問題が起きる`mutable`は共有から除外される。 + +```cpp +std::initializer_list i1 = {1,2,3,4,5}; +std::initializer_list i2 = {2,3,4}; +PERMIT(i1.begin() == i2.begin() + 1); // 将来的な動作 +``` + +## 関連項目 +- [C++11 初期化子リスト](/lang/cpp11/initializer_lists.md) +- [C++26 ファイルを読み込む`#embed`命令を追加](/lang/cpp26/embed.md) + + +## 参照 +- [P2752R3 Static storage for braced initializers](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2752r3.html) From 786b39a7893f7cd06d5b5bffb5abb22cff326587 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 24 Apr 2025 12:40:04 +0900 Subject: [PATCH 1574/3948] =?UTF-8?q?C++26:=20=E8=A6=8F=E6=A0=BC=E7=94=A8?= =?UTF-8?q?=E8=AA=9E=E3=81=AE=E6=95=B4=E7=90=86=E3=81=A0=E3=81=91=E3=81=A0?= =?UTF-8?q?=E3=81=A3=E3=81=9F=E3=80=8C=E5=A4=89=E6=8F=9B=E3=82=B3=E3=83=B3?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=83=A9=E3=82=AF=E3=82=BF=E3=81=A8=E3=81=84?= =?UTF-8?q?=E3=81=86=E7=94=A8=E8=AA=9E=E3=82=92=E5=BB=83=E6=AD=A2=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=80=8D=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit タスクissueも作ってなかった --- lang/cpp26.md | 1 - 1 file changed, 1 deletion(-) diff --git a/lang/cpp26.md b/lang/cpp26.md index 9189909104..960a186be0 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -50,7 +50,6 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| -| [変換コンストラクタという用語を廃止する](/lang/cpp26/abolish_the_term_converting_constructor.md.nolink) | 規格上で「`explicit`ではないコンストラクタ」という意味で定義されていたあまり使われない用語「変換コンストラクタ」を削除する | | [共用体をトリビアルに未初期化できるようにする](/lang/cpp26/trivial_unions.md.nolink) | `constexpr`での`union U { T storage[N]; };`を許可し、未初期化にできるようにする | | [トリビアルな再配置](/lang/cpp26/trivial_relocatability.md.nolink) | ムーブ構築と破棄のためにビット単位のコピーとデストラクタ評価が必要になる型のオブジェクトを再配置するメカニズムを導入する | From 4e37c0fc80c10260311e02614d02b63fa08d9b42 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 24 Apr 2025 14:11:38 +0900 Subject: [PATCH 1575/3948] =?UTF-8?q?C++20=20/=20C++26=20:=20=E7=B5=84?= =?UTF-8?q?=E3=81=BF=E8=BE=BC=E3=81=BF=E9=85=8D=E5=88=97=E3=81=AE=E6=AF=94?= =?UTF-8?q?=E8=BC=83=E3=81=AE=E9=9D=9E=E6=8E=A8=E5=A5=A8=E3=83=BB=E5=89=8A?= =?UTF-8?q?=E9=99=A4=E3=82=92=E8=BF=BD=E5=8A=A0=20(close=20#1375)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp20.md | 6 ++-- lang/cpp20/consistent_comparison.md | 4 ++- lang/cpp20/deprecate_array_comparisons.md | 32 ++++++++++++++++++ lang/cpp26.md | 2 +- .../remove_deprecated_array_comparisons.md | 33 +++++++++++++++++++ 5 files changed, 72 insertions(+), 5 deletions(-) create mode 100644 lang/cpp20/deprecate_array_comparisons.md create mode 100644 lang/cpp26/remove_deprecated_array_comparisons.md diff --git a/lang/cpp20.md b/lang/cpp20.md index 9ef1fdbc4a..01d911942a 100644 --- a/lang/cpp20.md +++ b/lang/cpp20.md @@ -31,7 +31,6 @@ C++20とは、2020年中に改訂され、ISO/IEC 14882:2020で標準規格化 | 言語機能 | 説明 | |----------|------| | [スコープ付き列挙型のusing宣言](cpp20/using_enum.md) | `using enum EnumType;`もしくは`using EnumType::enumerator`とすることで、列挙値のスコープ指定を省略できるようにする | -| [列挙値から算術型への暗黙変換を非推奨化](cpp20/deprecate_arithmetic_conversion_on_enumerations.md) | 列挙値への算術演算で算術型に暗黙変換される仕様を非推奨とする | ### 変数 @@ -43,7 +42,6 @@ C++20とは、2020年中に改訂され、ISO/IEC 14882:2020で標準規格化 | [丸カッコの値リストからの集成体初期化を許可](cpp20/allow_initializing_aggregates_from_a_parenthesized_list_of_values.md) | `T x{1, 2, 3};`と同様に`T x(1, 2, 3);`でも集成体初期化できるようにする | | [`new`式での配列要素数の推論](cpp20/array_size_deduction_in_new-expressions.md) | `double* p = new double[]{1,2,3};`を許可 | | [要素数不明の配列への変換を許可](cpp20/permit_conversions_to_arrays_of_unknown_bound.md) | 要素数が判明している配列から、要素数が不明の配列への変換を許可 | -| [ほとんどの`volatile`を非推奨化](cpp20/deprecating_volatile.md) | `volatile`の有用な機能のみを残し、効果が疑わしい、または壊れている機能を非推奨化する | | [ポインタから`bool`への変換を縮小変換とする](cpp20/converting_from_pointer_to_bool_should_be_considered_narrowing.md) | ポインタから`bool`値への変換を縮小変換と規定することで、意図しない変換を防止する | @@ -114,7 +112,6 @@ C++20とは、2020年中に改訂され、ISO/IEC 14882:2020で標準規格化 |----------|------| | [ジェネリックラムダのテンプレート構文](cpp20/familiar_template_syntax_for_generic_lambdas.md) | ジェネリックラムダでテンプレートパラメータを定義できるようにする | | [ラムダ式のキャプチャとして`[=, this]`を許可する](cpp20/allow_lambda_capture_equal_this.md) | デフォルトコピーキャプチャと`this`ポインタのコピーキャプチャを両方指定できるようにする | -| [`[=]`による`this`の暗黙のキャプチャを非推奨化](cpp20/deprecate_implicit_capture_of_this_via_defcopy.md) | コピーのデフォルトキャプチャでは、`this`ポインタをキャプチャされなくする | | [暗黙のラムダキャプチャを簡略化](cpp20/simplifying_implicit_lambda_capture.md) | ラムダ式のキャプチャに関する仕様整理 | | [状態を持たないラムダ式を、デフォルト構築可能、代入可能とする](cpp20/default_constructible_and_assignable_stateless_lambdas.md) | キャプチャしていないラムダ式をデフォルト構築・代入可能にする | | [評価されない文脈でのラムダ式](cpp20/wording_for_lambdas_in_unevaluated_contexts.md) | 評価されない文脈でもラムダ式を書くことができるようにする | @@ -155,9 +152,12 @@ C++20とは、2020年中に改訂され、ISO/IEC 14882:2020で標準規格化 | 言語機能 | 説明 | |----------|------| +| [ほとんどの`volatile`を非推奨化](cpp20/deprecating_volatile.md) | `volatile`の有用な機能のみを残し、効果が疑わしい、または壊れている機能を非推奨化する | | [PODを非推奨化](cpp20/deprecate_pod.md) | PODという用語を非推奨化する | | [`[=]`による`this`の暗黙のキャプチャを非推奨化](cpp20/deprecate_implicit_capture_of_this_via_defcopy.md) | コピーのデフォルトキャプチャでは、`this`ポインタのキャプチャを非推奨化する | | [添字演算子内でのカンマ演算子の使用を非推奨化](cpp20/deprecate_uses_of_the_comma_operator_in_subscripting_expressions.md) | `ar[i, j]`を非推奨化。`ar[(i, j)]`はOK | +| [列挙値から算術型への暗黙変換を非推奨化](cpp20/deprecate_arithmetic_conversion_on_enumerations.md) | 列挙値への算術演算で算術型に暗黙変換される仕様を非推奨とする | +| [組み込み配列の比較を非推奨化](cpp20/deprecate_array_comparisons.md) | 組み込み配列同士の比較演算を非推奨とする | ### 機能の削除 diff --git a/lang/cpp20/consistent_comparison.md b/lang/cpp20/consistent_comparison.md index 068fab2103..4e8e4b93f0 100644 --- a/lang/cpp20/consistent_comparison.md +++ b/lang/cpp20/consistent_comparison.md @@ -803,7 +803,9 @@ struct has_vector { - [``](/reference/algorithm.md) - [`lexicographical_compare_three_way`](/reference/algorithm/lexicographical_compare_three_way.md) - [C++20 列挙値から算術型への暗黙変換を非推奨化](deprecate_arithmetic_conversion_on_enumerations.md) -- [C++26 非推奨となっていた列挙値から算術型への暗黙変換を削除](/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md) + - [C++26 非推奨となっていた列挙値から算術型への暗黙変換を削除](/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md) +- [C++20 組み込み配列の比較を非推奨化](/lang/cpp20/deprecate_array_comparisons.md) + - [C++26 非推奨だった組み込み配列の比較を削除](/lang/cpp26/remove_deprecated_array_comparisons.md) ## 参照 diff --git a/lang/cpp20/deprecate_array_comparisons.md b/lang/cpp20/deprecate_array_comparisons.md new file mode 100644 index 0000000000..72be0f3590 --- /dev/null +++ b/lang/cpp20/deprecate_array_comparisons.md @@ -0,0 +1,32 @@ +# 組み込み配列の比較を非推奨化 [P1120R0] +* cpp20[meta cpp] + + + +このページはC++20に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 + + + +## 概要 +[三方比較演算子](consistent_comparison.md)の導入にともない、組み込み配列の等値比較および関係比較は非推奨となる。 + +組み込み配列同士の三方比較は不適格である。 + +```cpp +int arr1[5]; +int arr2[5]; +bool same = arr1 == arr2; // C++20で非推奨。&arr[0] == &arr[1]と同じ。 + // 配列の要素は比較されない +auto cmp = arr1 <=> arr2; // エラー! +``` + + +## 関連項目 +- [C++20 `<=>`/`==`による比較演算子の自動定義](consistent_comparison.md) +- [C++26 非推奨だった組み込み配列の比較を削除](/lang/cpp26/remove_deprecated_array_comparisons.md) + + +## 参照 +- [P1120R0 Consistency improvements for `<=>` and other comparison operators](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1120r0.html) diff --git a/lang/cpp26.md b/lang/cpp26.md index 960a186be0..0d88ea76bc 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -108,7 +108,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| -| [非推奨だった配列の比較を削除](/lang/cpp26/remove_deprecated_array_comparisons.md.nolink) | C++20で非推奨となっていた配列比較を削除 | +| [非推奨だった組み込み配列の比較を削除](/lang/cpp26/remove_deprecated_array_comparisons.md) | C++20で非推奨となっていた配列比較を削除 | | [先行するカンマのない省略記号を非推奨化](/lang/cpp26/the_oxford_variadic_comma.md) | `void f(int, ...);`はOK。`void f(int...);`は非推奨 | diff --git a/lang/cpp26/remove_deprecated_array_comparisons.md b/lang/cpp26/remove_deprecated_array_comparisons.md new file mode 100644 index 0000000000..418345e188 --- /dev/null +++ b/lang/cpp26/remove_deprecated_array_comparisons.md @@ -0,0 +1,33 @@ +# 非推奨だった組み込み配列の比較を削除 [P2865R6] +* cpp26[meta cpp] + + + +このページはC++26に採用される見込みの言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 + + + +## 概要 +C++20での[三方比較演算子](consistent_comparison.md)の導入にともない、組み込み配列の等値比較および関係比較は非推奨となっていたが、これを削除する。 + +組み込み配列同士の三方比較はC++20時点で不適格である。 + +```cpp +int arr1[5]; +int arr2[5]; +bool same = arr1 == arr2; // C++20: 非推奨、C++26: エラー。 + // &arr[0] == &arr[1]と同じ。 + // 配列の要素は比較されない +auto cmp = arr1 <=> arr2; // エラー! +``` + + +## 関連項目 +- [C++20 `<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) +- [C++20 組み込み配列の比較を非推奨化](/lang/cpp20/deprecate_array_comparisons.md) + + +## 参照 +- [P2865R6 Remove Deprecated Array Comparisons from C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2865r6.pdf) From 6ab9b942c9a97804a7bce08a308c76dadb6fa5d3 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 24 Apr 2025 14:15:59 +0900 Subject: [PATCH 1576/3948] fix link --- implementation-status.md | 2 +- lang/cpp26/remove_deprecated_array_comparisons.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/implementation-status.md b/implementation-status.md index 813d0fc03e..014d68c0f5 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -315,7 +315,7 @@ | P0963R3: [条件式での構造化束縛の使用を許可](/lang/cpp26/structured_binding_declaration_as_a_condition.md) | 式全体を`bool`値に変換できる場合に条件式で構造化束縛を使用できることとする | 15 | | | | | P2686R5: [`constexpr`構造化束縛の許可と、定数式への参照を定数式とする](/lang/cpp26/constexpr_structured_bindings_and_references_to_constexpr_variables.md.nolink) | 定数式に対する構造化束縛を許可し、関連する定数式への参照が定数式になるようにする | 15 | | | | | P3068R6: [定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) | 定数式の文脈での例外の送出と捕捉を許可 | | | | | -| P2865R6: [非推奨だった配列の比較を削除](/lang/cpp26/remove_deprecated_array_comparisons.md.nolink) | C++20で非推奨となっていた配列比較を削除 | 15 | 20 | | | +| P2865R6: [非推奨だった組み込み配列の比較を削除](/lang/cpp26/remove_deprecated_array_comparisons.md) | C++20で非推奨となっていた配列比較を削除 | 15 | 20 | | | | P1061R10: [構造化束縛でパックを導入できるようにする](/lang/cpp26/structured_bindings_can_introduce_a_pack.md) | タプルを分解する際に複数の変数をパックとして宣言できるようにする。`auto [a, ...xs] = f();` | | | | | | P3176R0: [先行するカンマのない省略記号を非推奨化](/lang/cpp26/the_oxford_variadic_comma.md) | `void f(int, ...);`はOK。`void f(int...);`は非推奨 | 15 | 20 | | | | P3074R7: [共用体をトリビアルに未初期化できるようにする](/lang/cpp26/trivial_unions.md.nolink) | `constexpr`での`union U { T storage[N]; };`を許可し、未初期化にできるようにする | | | | | diff --git a/lang/cpp26/remove_deprecated_array_comparisons.md b/lang/cpp26/remove_deprecated_array_comparisons.md index 418345e188..83fff0fd04 100644 --- a/lang/cpp26/remove_deprecated_array_comparisons.md +++ b/lang/cpp26/remove_deprecated_array_comparisons.md @@ -10,7 +10,7 @@ ## 概要 -C++20での[三方比較演算子](consistent_comparison.md)の導入にともない、組み込み配列の等値比較および関係比較は非推奨となっていたが、これを削除する。 +C++20での[三方比較演算子](/lang/cpp20/consistent_comparison.md)の導入にともない、組み込み配列の等値比較および関係比較は非推奨となっていたが、これを削除する。 組み込み配列同士の三方比較はC++20時点で不適格である。 From fe938370bb64b704c2e0a57d1091cafa6ea9fb26 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 24 Apr 2025 14:33:10 +0900 Subject: [PATCH 1577/3948] =?UTF-8?q?C++26:=20=E8=A1=A8=E3=82=92=E6=95=B4?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lang/cpp26.md b/lang/cpp26.md index 0d88ea76bc..b31afe24ac 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -13,7 +13,6 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 |----------|------| | [`std::initializer_list`の配列を静的記憶域に配置する](/lang/cpp26/static_storage_for_braced_initializers.md) | `std::vector v = {1, 2, 3};`のような初期化で初期化子リストを静的記憶域に配置することで無駄なコピーをなくす | | [宣言のみで使用しない変数の名前として`_`をサポート](/lang/cpp26/nice_placeholder_with_no_name.md) | 変数名`_`は暗黙で`[[maybe_unused]]`が指定される | -| [非推奨となっていた列挙型の算術変換を削除](/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md) | C++20から非推奨となっていた列挙値への算術演算で算術型に暗黙変換される仕様を削除 | | [不完全型へのポインタに対する`delete`を不適格とする](/lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md.nolink) | 未定義動作を引き起こす操作をコンパイルエラーとする | | [返却された左辺値から暗黙変換された一時オブジェクトが参照に束縛されることを禁止する](/lang/cpp26/disallow_binding_a_returned_glvalue_to_a_temporary.md.nolink) | 寿命切れの変数によって引き起こされるバグを防止する | | [要素数不明の配列を集成体初期化する規則を明確化](/lang/cpp26/clarifying_rules_for_brace_elision_in_aggregate_initialization.md.nolink) | 配列要素の集成体初期化で`{}`が省略された場合の矛盾していた規定を修正 | @@ -112,6 +111,13 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | [先行するカンマのない省略記号を非推奨化](/lang/cpp26/the_oxford_variadic_comma.md) | `void f(int, ...);`はOK。`void f(int...);`は非推奨 | +### 機能の削除 + +| 言語機能 | 説明 | +|----------|------| +| [非推奨となっていた列挙型の算術変換を削除](/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md) | C++20から非推奨となっていた列挙値への算術演算で算術型に暗黙変換される仕様を削除 | + + ## ライブラリ更新の概要 ### 新ライブラリ - 文字列エンコーディングを識別するライブラリとして、[``](/reference/text_encoding.md.nolink)を追加 From 9d7b142a7a0a97f95375c261b07998158b3404e9 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 25 Apr 2025 10:20:55 +0900 Subject: [PATCH 1578/3948] reference/cstdint/int_fast8_t.md: Created sample code --- reference/cstdint/int_fast8_t.md | 49 ++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/reference/cstdint/int_fast8_t.md b/reference/cstdint/int_fast8_t.md index d9bd037fd9..2ef6ea5880 100644 --- a/reference/cstdint/int_fast8_t.md +++ b/reference/cstdint/int_fast8_t.md @@ -16,6 +16,55 @@ namespace std { [`int8_t`](int8_t.md)型が環境によっては定義されないため、そのような状況でこの型を使用する。 +## 例 +```cpp example +#include +#include +#include +#include + +int main() +{ + // int_fast8_tの使用例 + std::int_fast8_t value = 42; + + // 値を出力 + std::cout << "value: " << static_cast(value) << std::endl; + + // サイズを確認(処理系によって異なる可能性がある) + std::cout << "size of int_fast8_t: " << sizeof(std::int_fast8_t) << " bytes" << std::endl; + + // 最小値と最大値 + std::cout << "minimum value: " << static_cast(std::numeric_limits::min()) << std::endl; + std::cout << "maximum value: " << static_cast(std::numeric_limits::max()) << std::endl; + + // int8_tとの比較 + std::cout << "int_fast8_t is the same as int8_t: " + << std::is_same::value << std::endl; + + // 演算の例(オーバーフローに注意) + std::int_fast8_t a = 100; + std::int_fast8_t b = 50; + std::int_fast8_t sum = a + b; // 処理系によってはオーバーフローの可能性あり + + std::cout << "100 + 50 = " << static_cast(sum) << std::endl; + + return 0; +} +``` + +### 出力例 +``` +value: 42 +size of int_fast8_t: 1 bytes +minimum value: -128 +maximum value: 127 +int_fast8_t is the same as int8_t: 0 +100 + 50 = -106 +``` + +この出力例は特定の環境に依存しており、処理系によって異なる可能性があります。特に、`int_fast8_t`のサイズやオーバーフロー動作は処理系によって異なることがある。 + ## バージョン ### 言語 - C++11 From 2a3d37afa20402af06c7e7b498498eb89942aa40 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 25 Apr 2025 10:27:14 +0900 Subject: [PATCH 1579/3948] reference/cstdint/int_fast8_max.md: Created sample program --- reference/cstdint/int_fast8_max.md | 57 +++++++++++++++++++++++++++--- 1 file changed, 53 insertions(+), 4 deletions(-) diff --git a/reference/cstdint/int_fast8_max.md b/reference/cstdint/int_fast8_max.md index a6d302737b..7042a93449 100644 --- a/reference/cstdint/int_fast8_max.md +++ b/reference/cstdint/int_fast8_max.md @@ -8,14 +8,63 @@ ``` ## 概要 -[`int_fast8_t`](int_fast8_t.md) の最大値。 +[`int_fast8_t`](int_fast8_t.md) の最大値を表す定数。 + +[`std::numeric_limits`](/reference/limits/numeric_limits.md)`::`[`max()`](/reference/limits/numeric_limits/max.md) と等しい。 + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::cout << "INT_FAST8_MAX: " << INT_FAST8_MAX << std::endl; + + // numeric_limitsによる値と一致することを確認 + std::cout << "numeric_limits::max(): " + << static_cast(std::numeric_limits::max()) << std::endl; + + std::cout << "INT_FAST8_MAX == numeric_limits::max(): " + << std::boolalpha + << (INT_FAST8_MAX == std::numeric_limits::max()) << std::endl; + + // 型の確認 + std::int_fast8_t max_value = INT_FAST8_MAX; + std::cout << "型を通したときの値: " << static_cast(max_value) << std::endl; + + // オーバーフローの確認 + std::int_fast8_t value = INT_FAST8_MAX; + std::cout << "INT_FAST8_MAX: " << static_cast(value) << std::endl; + std::cout << "INT_FAST8_MAX + 1: " << static_cast(value + 1) << std::endl; + + return 0; +} +``` + +### 出力例 +``` +INT_FAST8_MAX: 127 +numeric_limits::max(): 127 +INT_FAST8_MAX == numeric_limits::max(): true +型を通したときの値: 127 +INT_FAST8_MAX: 127 +INT_FAST8_MAX + 1: -128 +``` + +この出力例は処理系によって異なる場合がある。特に、`int_fast8_t`の実際の型が処理系によって異なる可能性があるため、最大値やオーバーフロー動作も異なることがある。 ## バージョン ### 言語 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 [mark verified] -- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] +- [Clang](/implementation.md#clang): 3.2 +- [GCC](/implementation.md#gcc): 4.7.0 - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 + +## 参照 +- [``](/reference/cstdint.md) +- [`int_fast8_t`](int_fast8_t.md) From 8dc908b42ce85eb95b85711285bf1f4cef55655a Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 25 Apr 2025 10:35:34 +0900 Subject: [PATCH 1580/3948] reference/cstdint/int_fast8_min.md: Created sample program --- reference/cstdint/int_fast8_min.md | 47 +++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/reference/cstdint/int_fast8_min.md b/reference/cstdint/int_fast8_min.md index 7424bf47ab..8e7a278d3b 100644 --- a/reference/cstdint/int_fast8_min.md +++ b/reference/cstdint/int_fast8_min.md @@ -8,7 +8,52 @@ ``` ## 概要 -[`int_fast8_t`](int_fast8_t.md) の最小値。 +[`int_fast8_t`](int_fast8_t.md) の最小値を表す定数。 + +[`std::numeric_limits`](/reference/limits/numeric_limits.md)`::`[`min()`](/reference/limits/numeric_limits/min.md) と等しい。 + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::cout << "INT_FAST8_MIN: " << INT_FAST8_MIN << std::endl; + + // numeric_limitsによる値と一致することを確認 + std::cout << "numeric_limits::min(): " + << static_cast(std::numeric_limits::min()) << std::endl; + + std::cout << "INT_FAST8_MIN == numeric_limits::min(): " + << std::boolalpha + << (INT_FAST8_MIN == std::numeric_limits::min()) << std::endl; + + // 型の確認 + std::int_fast8_t min_value = INT_FAST8_MIN; + std::cout << "型を通したときの値: " << static_cast(min_value) << std::endl; + + // アンダーフローの確認 + std::int_fast8_t value = INT_FAST8_MIN; + std::cout << "INT_FAST8_MIN: " << static_cast(value) << std::endl; + std::cout << "INT_FAST8_MIN - 1: " << static_cast(value - 1) << std::endl; + + return 0; +} +``` + +### 出力例 +``` +INT_FAST8_MIN: -128 +numeric_limits::min(): -128 +INT_FAST8_MIN == numeric_limits::min(): true +型を通したときの値: -128 +INT_FAST8_MIN: -128 +INT_FAST8_MIN - 1: 127 +``` + +この出力例は処理系によって異なる場合がある。特に、`int_fast8_t`の実際の型が処理系によって異なる可能性があるため、最小値やアンダーフロー動作も異なることがある。 ## バージョン ### 言語 From 6fcefb76b8d116e5eb0f7361d5f7fcde6ee31d4f Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 25 Apr 2025 10:38:58 +0900 Subject: [PATCH 1581/3948] reference/cstdint/int_fast16_max.md: Created sample program --- reference/cstdint/int_fast16_max.md | 58 +++++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 4 deletions(-) diff --git a/reference/cstdint/int_fast16_max.md b/reference/cstdint/int_fast16_max.md index e7ae058b61..e11ed9d12c 100644 --- a/reference/cstdint/int_fast16_max.md +++ b/reference/cstdint/int_fast16_max.md @@ -8,14 +8,64 @@ ``` ## 概要 -[`int_fast16_t`](int_fast16_t.md) の最大値。 +[`int_fast16_t`](int_fast16_t.md) の最大値を表す定数。 + +[`std::numeric_limits`](/reference/limits/numeric_limits.md)`::`[`max()`](/reference/limits/numeric_limits/max.md) と等しい。 + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::cout << "INT_FAST16_MAX: " << INT_FAST16_MAX << std::endl; + + // numeric_limitsによる値と一致することを確認 + std::cout << "numeric_limits::max(): " + << std::numeric_limits::max() << std::endl; + + std::cout << "INT_FAST16_MAX == numeric_limits::max(): " + << std::boolalpha + << (INT_FAST16_MAX == std::numeric_limits::max()) << std::endl; + + // 型の確認 + std::int_fast16_t max_value = INT_FAST16_MAX; + std::cout << "型を通したときの値: " << max_value << std::endl; + + // オーバーフローの確認 + std::int_fast16_t value = INT_FAST16_MAX; + std::cout << "INT_FAST16_MAX: " << value << std::endl; + std::cout << "INT_FAST16_MAX + 1: " << value + 1 << std::endl; + + return 0; +} +``` + +### 出力例 +``` +INT_FAST16_MAX: 32767 +numeric_limits::max(): 32767 +INT_FAST16_MAX == numeric_limits::max(): true +型を通したときの値: 32767 +INT_FAST16_MAX: 32767 +INT_FAST16_MAX + 1: -32768 +``` + +この出力例は処理系によって異なる場合がある。特に、`int_fast16_t`の実際の型が処理系によって異なる可能性があるため、最大値やオーバーフロー動作も異なることがある。 ## バージョン ### 言語 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 [mark verified] -- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] +- [Clang](/implementation.md#clang): 3.2 +- [GCC](/implementation.md#gcc): 4.7.0 - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 + +## 参照 +- [``](/reference/cstdint.md) +- [`int_fast16_t`](int_fast16_t.md) +- [`INT_FAST16_MIN`](int_fast16_min.md) From d2cbe3829a808b97eff60aa616a04ff5221c8130 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 25 Apr 2025 10:43:00 +0900 Subject: [PATCH 1582/3948] reference/cstdint/int_fast16_min.md: Created sample program --- reference/cstdint/int_fast16_min.md | 47 ++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/reference/cstdint/int_fast16_min.md b/reference/cstdint/int_fast16_min.md index 63de1921e0..5ed2a13bcd 100644 --- a/reference/cstdint/int_fast16_min.md +++ b/reference/cstdint/int_fast16_min.md @@ -8,7 +8,52 @@ ``` ## 概要 -[`int_fast16_t`](int_fast16_t.md) の最小値。 +[`int_fast16_t`](int_fast16_t.md) の最小値を表す定数。 + +[`std::numeric_limits`](/reference/limits/numeric_limits.md)`::`[`min()`](/reference/limits/numeric_limits/min.md) と等しい。 + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::cout << "INT_FAST16_MIN: " << INT_FAST16_MIN << std::endl; + + // numeric_limitsによる値と一致することを確認 + std::cout << "numeric_limits::min(): " + << std::numeric_limits::min() << std::endl; + + std::cout << "INT_FAST16_MIN == numeric_limits::min(): " + << std::boolalpha + << (INT_FAST16_MIN == std::numeric_limits::min()) << std::endl; + + // 型の確認 + std::int_fast16_t min_value = INT_FAST16_MIN; + std::cout << "型を通したときの値: " << min_value << std::endl; + + // アンダーフローの確認 + std::int_fast16_t value = INT_FAST16_MIN; + std::cout << "INT_FAST16_MIN: " << value << std::endl; + std::cout << "INT_FAST16_MIN - 1: " << value - 1 << std::endl; + + return 0; +} +``` + +### 出力例 +``` +INT_FAST16_MIN: -32768 +numeric_limits::min(): -32768 +INT_FAST16_MIN == numeric_limits::min(): true +型を通したときの値: -32768 +INT_FAST16_MIN: -32768 +INT_FAST16_MIN - 1: 32767 +``` + +この出力例は処理系によって異なる場合がある。特に、`int_fast16_t`の実際の型が処理系によって異なる可能性があるため、最小値やアンダーフロー動作も異なることがある。 ## バージョン ### 言語 From 06d8c882f57e42ed5660dca11ce308b05cb9de60 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 25 Apr 2025 10:45:44 +0900 Subject: [PATCH 1583/3948] reference/cstdint/int_fast8_max.md: Fixed version specification Readded parts that were accidentally deleted --- reference/cstdint/int_fast8_max.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/cstdint/int_fast8_max.md b/reference/cstdint/int_fast8_max.md index 7042a93449..21bf92f843 100644 --- a/reference/cstdint/int_fast8_max.md +++ b/reference/cstdint/int_fast8_max.md @@ -60,10 +60,10 @@ INT_FAST8_MAX + 1: -128 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 - [``](/reference/cstdint.md) From 91b19c426395f333dc4432d8d4671421bd321b6b Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 25 Apr 2025 10:47:01 +0900 Subject: [PATCH 1584/3948] reference/cstdint/int_fast8_max.md: Removed reference column --- reference/cstdint/int_fast8_max.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/reference/cstdint/int_fast8_max.md b/reference/cstdint/int_fast8_max.md index 21bf92f843..973efcf3e1 100644 --- a/reference/cstdint/int_fast8_max.md +++ b/reference/cstdint/int_fast8_max.md @@ -64,7 +64,3 @@ INT_FAST8_MAX + 1: -128 - [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] - -## 参照 -- [``](/reference/cstdint.md) -- [`int_fast8_t`](int_fast8_t.md) From e5250ddb89ee1a771653b14d6bdeae3b06f4bbdc Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 25 Apr 2025 10:49:03 +0900 Subject: [PATCH 1585/3948] reference/cstdint/int_fast16_max.md: Readded verified mark --- reference/cstdint/int_fast16_max.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/cstdint/int_fast16_max.md b/reference/cstdint/int_fast16_max.md index e11ed9d12c..d8235be47e 100644 --- a/reference/cstdint/int_fast16_max.md +++ b/reference/cstdint/int_fast16_max.md @@ -60,10 +60,10 @@ INT_FAST16_MAX + 1: -32768 - C++11 ### 処理系 -- [Clang](/implementation.md#clang): 3.2 -- [GCC](/implementation.md#gcc): 4.7.0 +- [Clang](/implementation.md#clang): 3.2 [mark verified] +- [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2010, 2012, 2013 +- [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 - [``](/reference/cstdint.md) From 62e7c2fad650e453d70f41d12547ea13482479b3 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 25 Apr 2025 10:49:51 +0900 Subject: [PATCH 1586/3948] reference/cstdint/int_fast16_max.md: Removed reference column --- reference/cstdint/int_fast16_max.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/reference/cstdint/int_fast16_max.md b/reference/cstdint/int_fast16_max.md index d8235be47e..fdd28e7d08 100644 --- a/reference/cstdint/int_fast16_max.md +++ b/reference/cstdint/int_fast16_max.md @@ -64,8 +64,3 @@ INT_FAST16_MAX + 1: -32768 - [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] - -## 参照 -- [``](/reference/cstdint.md) -- [`int_fast16_t`](int_fast16_t.md) -- [`INT_FAST16_MIN`](int_fast16_min.md) From 1f4ea486d09cd35a28a35ab3651d4885d5fa21a7 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 25 Apr 2025 10:57:39 +0900 Subject: [PATCH 1587/3948] reference/cstdint/int_fast16_t.md: Create sample program --- reference/cstdint/int_fast16_t.md | 49 +++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/reference/cstdint/int_fast16_t.md b/reference/cstdint/int_fast16_t.md index 6075bba9e8..ca7bcb4650 100644 --- a/reference/cstdint/int_fast16_t.md +++ b/reference/cstdint/int_fast16_t.md @@ -16,6 +16,55 @@ namespace std { [`int16_t`](int16_t.md)型が環境によっては定義されないため、そのような状況でこの型を使用する。 +## 例 +```cpp example +#include +#include +#include +#include + +int main() +{ + // int_fast16_tの使用例 + std::int_fast16_t value = 12345; + + // 値を出力 + std::cout << "value: " << value << std::endl; + + // サイズを確認(処理系によって異なる可能性がある) + std::cout << "size of int_fast16_t: " << sizeof(std::int_fast16_t) << " bytes" << std::endl; + + // 最小値と最大値 + std::cout << "minimum value: " << std::numeric_limits::min() << std::endl; + std::cout << "maximum value: " << std::numeric_limits::max() << std::endl; + + // int16_tとの比較 + std::cout << "int_fast16_t is the same as int16_t: " + << std::is_same::value << std::endl; + + // 演算の例(オーバーフローに注意) + std::int_fast16_t a = 30000; + std::int_fast16_t b = 10000; + std::int_fast16_t sum = a + b; // 処理系によってはオーバーフローの可能性あり + + std::cout << "30000 + 10000 = " << sum << std::endl; + + return 0; +} +``` + +### 出力例 +``` +value: 12345 +size of int_fast16_t: 4 bytes +minimum value: -32768 +maximum value: 32767 +int_fast16_t is the same as int16_t: 0 +30000 + 10000 = -25536 +``` + +この出力例は特定の環境に依存しており、処理系によって異なる可能性があります。特に、`int_fast16_t`のサイズやオーバーフロー動作は処理系によって異なることがある。 + ## バージョン ### 言語 - C++11 From 84b6c7375c4cd9d82bae4f023599a34fb59f7b5d Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 25 Apr 2025 11:00:12 +0900 Subject: [PATCH 1588/3948] reference/cstdint/int_fast32_max.md: Created sample program --- reference/cstdint/int_fast32_max.md | 47 ++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/reference/cstdint/int_fast32_max.md b/reference/cstdint/int_fast32_max.md index f864bcb2a6..771414cc53 100644 --- a/reference/cstdint/int_fast32_max.md +++ b/reference/cstdint/int_fast32_max.md @@ -8,7 +8,52 @@ ``` ## 概要 -[`int_fast32_t`](int_fast32_t.md) の最大値。 +[`int_fast32_t`](int_fast32_t.md) の最大値を表す定数。 + +[`std::numeric_limits`](/reference/limits/numeric_limits.md)`::`[`max()`](/reference/limits/numeric_limits/max.md) と等しい。 + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::cout << "INT_FAST32_MAX: " << INT_FAST32_MAX << std::endl; + + // numeric_limitsによる値と一致することを確認 + std::cout << "numeric_limits::max(): " + << std::numeric_limits::max() << std::endl; + + std::cout << "INT_FAST32_MAX == numeric_limits::max(): " + << std::boolalpha + << (INT_FAST32_MAX == std::numeric_limits::max()) << std::endl; + + // 型の確認 + std::int_fast32_t max_value = INT_FAST32_MAX; + std::cout << "型を通したときの値: " << max_value << std::endl; + + // オーバーフローの確認 + std::int_fast32_t value = INT_FAST32_MAX; + std::cout << "INT_FAST32_MAX: " << value << std::endl; + std::cout << "INT_FAST32_MAX + 1: " << value + 1 << std::endl; + + return 0; +} +``` + +### 出力例 +``` +INT_FAST32_MAX: 2147483647 +numeric_limits::max(): 2147483647 +INT_FAST32_MAX == numeric_limits::max(): true +型を通したときの値: 2147483647 +INT_FAST32_MAX: 2147483647 +INT_FAST32_MAX + 1: -2147483648 +``` + +この出力例は処理系によって異なる場合がある。特に、`int_fast32_t`の実際の型が処理系によって異なる可能性があるため、最大値やオーバーフロー動作も異なることがある。 ## バージョン ### 言語 From 4bc9af54fa0f656bfecb75f7a75688b7e4ea1c4c Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 25 Apr 2025 11:12:53 +0900 Subject: [PATCH 1589/3948] reference/cstdint/int_fast32_min.md: Created sample program --- reference/cstdint/int_fast32_min.md | 47 ++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/reference/cstdint/int_fast32_min.md b/reference/cstdint/int_fast32_min.md index 405db6e921..60e4457d9b 100644 --- a/reference/cstdint/int_fast32_min.md +++ b/reference/cstdint/int_fast32_min.md @@ -8,7 +8,52 @@ ``` ## 概要 -[`int_fast32_t`](int_fast32_t.md) の最小値。 +[`int_fast32_t`](int_fast32_t.md) の最小値を表す定数。 + +[`std::numeric_limits`](/reference/limits/numeric_limits.md)`::`[`min()`](/reference/limits/numeric_limits/min.md) と等しい。 + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::cout << "INT_FAST32_MIN: " << INT_FAST32_MIN << std::endl; + + // numeric_limitsによる値と一致することを確認 + std::cout << "numeric_limits::min(): " + << std::numeric_limits::min() << std::endl; + + std::cout << "INT_FAST32_MIN == numeric_limits::min(): " + << std::boolalpha + << (INT_FAST32_MIN == std::numeric_limits::min()) << std::endl; + + // 型の確認 + std::int_fast32_t min_value = INT_FAST32_MIN; + std::cout << "型を通したときの値: " << min_value << std::endl; + + // アンダーフローの確認 + std::int_fast32_t value = INT_FAST32_MIN; + std::cout << "INT_FAST32_MIN: " << value << std::endl; + std::cout << "INT_FAST32_MIN - 1: " << value - 1 << std::endl; + + return 0; +} +``` + +### 出力例 +``` +INT_FAST32_MIN: -2147483648 +numeric_limits::min(): -2147483648 +INT_FAST32_MIN == numeric_limits::min(): true +型を通したときの値: -2147483648 +INT_FAST32_MIN: -2147483648 +INT_FAST32_MIN - 1: 2147483647 +``` + +この出力例は処理系によって異なる場合がある。特に、`int_fast32_t`の実際の型が処理系によって異なる可能性があるため、最小値やアンダーフロー動作も異なることがある。 ## バージョン ### 言語 From 4bfaf75608fd0a80343511fc15e11da5dc357971 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 25 Apr 2025 11:18:45 +0900 Subject: [PATCH 1590/3948] reference/cstdint/int_fast32_t.md: Added sample program --- reference/cstdint/int_fast32_t.md | 49 +++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/reference/cstdint/int_fast32_t.md b/reference/cstdint/int_fast32_t.md index 1722d67466..d8893f6887 100644 --- a/reference/cstdint/int_fast32_t.md +++ b/reference/cstdint/int_fast32_t.md @@ -16,6 +16,55 @@ namespace std { [`int32_t`](int32_t.md)型が環境によっては定義されないため、そのような状況でこの型を使用する。 +## 例 +```cpp example +#include +#include +#include +#include + +int main() +{ + // int_fast32_tの使用例 + std::int_fast32_t value = 1234567890; + + // 値を出力 + std::cout << "value: " << value << std::endl; + + // サイズを確認(処理系によって異なる可能性がある) + std::cout << "size of int_fast32_t: " << sizeof(std::int_fast32_t) << " bytes" << std::endl; + + // 最小値と最大値 + std::cout << "minimum value: " << std::numeric_limits::min() << std::endl; + std::cout << "maximum value: " << std::numeric_limits::max() << std::endl; + + // int32_tとの比較 + std::cout << "int_fast32_t is the same as int32_t: " + << std::is_same::value << std::endl; + + // 演算の例(オーバーフローに注意) + std::int_fast32_t a = 2000000000; + std::int_fast32_t b = 1000000000; + std::int_fast32_t sum = a + b; // 処理系によってはオーバーフローの可能性あり + + std::cout << "2000000000 + 1000000000 = " << sum << std::endl; + + return 0; +} +``` + +### 出力例 +``` +value: 1234567890 +size of int_fast32_t: 4 bytes +minimum value: -2147483648 +maximum value: 2147483647 +int_fast32_t is the same as int32_t: 0 +2000000000 + 1000000000 = -1294967296 +``` + +この出力例は特定の環境に依存しており、処理系によって異なる可能性があります。特に、`int_fast32_t`のサイズやオーバーフロー動作は処理系によって異なることがある。 + ## バージョン ### 言語 - C++11 From d57130512739ec1b5cf71789440e7228709d52e6 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 25 Apr 2025 12:09:16 +0900 Subject: [PATCH 1591/3948] reference/cstdint/int_fast64_max.md: Created sample program --- reference/cstdint/int_fast64_max.md | 47 ++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/reference/cstdint/int_fast64_max.md b/reference/cstdint/int_fast64_max.md index c01b4e58a7..baf452a181 100644 --- a/reference/cstdint/int_fast64_max.md +++ b/reference/cstdint/int_fast64_max.md @@ -8,7 +8,52 @@ ``` ## 概要 -[`int_fast64_t`](int_fast64_t.md) の最大値。 +[`int_fast64_t`](int_fast64_t.md) の最大値を表す定数。 + +[`std::numeric_limits`](/reference/limits/numeric_limits.md)`::`[`max()`](/reference/limits/numeric_limits/max.md) と等しい。 + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::cout << "INT_FAST64_MAX: " << INT_FAST64_MAX << std::endl; + + // numeric_limitsによる値と一致することを確認 + std::cout << "numeric_limits::max(): " + << std::numeric_limits::max() << std::endl; + + std::cout << "INT_FAST64_MAX == numeric_limits::max(): " + << std::boolalpha + << (INT_FAST64_MAX == std::numeric_limits::max()) << std::endl; + + // 型の確認 + std::int_fast64_t max_value = INT_FAST64_MAX; + std::cout << "型を通したときの値: " << max_value << std::endl; + + // オーバーフローの確認 + std::int_fast64_t value = INT_FAST64_MAX; + std::cout << "INT_FAST64_MAX: " << value << std::endl; + std::cout << "INT_FAST64_MAX + 1: " << value + 1 << std::endl; + + return 0; +} +``` + +### 出力例 +``` +INT_FAST64_MAX: 9223372036854775807 +numeric_limits::max(): 9223372036854775807 +INT_FAST64_MAX == numeric_limits::max(): true +型を通したときの値: 9223372036854775807 +INT_FAST64_MAX: 9223372036854775807 +INT_FAST64_MAX + 1: -9223372036854775808 +``` + +この出力例は処理系によって異なる場合がある。特に、`int_fast64_t`の実際の型が処理系によって異なる可能性があるため、最大値やオーバーフロー動作も異なることがある。 ## バージョン ### 言語 From c476d9c300d2e3d7a7bff81733057a31a33a037e Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 25 Apr 2025 12:09:26 +0900 Subject: [PATCH 1592/3948] reference/cstdint/int_fast64_min.md: Created sample program --- reference/cstdint/int_fast64_min.md | 47 ++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/reference/cstdint/int_fast64_min.md b/reference/cstdint/int_fast64_min.md index 0131bce400..54a8617176 100644 --- a/reference/cstdint/int_fast64_min.md +++ b/reference/cstdint/int_fast64_min.md @@ -8,7 +8,52 @@ ``` ## 概要 -[`int_fast64_t`](int_fast64_t.md) の最小値。 +[`int_fast64_t`](int_fast64_t.md) の最小値を表す定数。 + +[`std::numeric_limits`](/reference/limits/numeric_limits.md)`::`[`min()`](/reference/limits/numeric_limits/min.md) と等しい。 + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::cout << "INT_FAST64_MIN: " << INT_FAST64_MIN << std::endl; + + // numeric_limitsによる値と一致することを確認 + std::cout << "numeric_limits::min(): " + << std::numeric_limits::min() << std::endl; + + std::cout << "INT_FAST64_MIN == numeric_limits::min(): " + << std::boolalpha + << (INT_FAST64_MIN == std::numeric_limits::min()) << std::endl; + + // 型の確認 + std::int_fast64_t min_value = INT_FAST64_MIN; + std::cout << "型を通したときの値: " << min_value << std::endl; + + // アンダーフローの確認 + std::int_fast64_t value = INT_FAST64_MIN; + std::cout << "INT_FAST64_MIN: " << value << std::endl; + std::cout << "INT_FAST64_MIN - 1: " << value - 1 << std::endl; + + return 0; +} +``` + +### 出力例 +``` +INT_FAST64_MIN: -9223372036854775808 +numeric_limits::min(): -9223372036854775808 +INT_FAST64_MIN == numeric_limits::min(): true +型を通したときの値: -9223372036854775808 +INT_FAST64_MIN: -9223372036854775808 +INT_FAST64_MIN - 1: 9223372036854775807 +``` + +この出力例は処理系によって異なる場合がある。特に、`int_fast64_t`の実際の型が処理系によって異なる可能性があるため、最小値やアンダーフロー動作も異なることがある。 ## バージョン ### 言語 From 28c1ed525efc0316f248008b0f4fab431da3ac45 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 25 Apr 2025 12:18:20 +0900 Subject: [PATCH 1593/3948] reference/cstdint/int_fast64_t.md: Created sample program --- reference/cstdint/int_fast64_t.md | 54 +++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/reference/cstdint/int_fast64_t.md b/reference/cstdint/int_fast64_t.md index 600ee1eff6..de6d1bee60 100644 --- a/reference/cstdint/int_fast64_t.md +++ b/reference/cstdint/int_fast64_t.md @@ -16,6 +16,55 @@ namespace std { [`int64_t`](int64_t.md)型が環境によっては定義されないため、そのような状況でこの型を使用する。 +## 例 +```cpp example +#include +#include +#include +#include + +int main() +{ + // int_fast64_tの使用例 + std::int_fast64_t value = 1234567890123456789LL; + + // 値を出力 + std::cout << "value: " << value << std::endl; + + // サイズを確認(処理系によって異なる可能性がある) + std::cout << "size of int_fast64_t: " << sizeof(std::int_fast64_t) << " bytes" << std::endl; + + // 最小値と最大値 + std::cout << "minimum value: " << std::numeric_limits::min() << std::endl; + std::cout << "maximum value: " << std::numeric_limits::max() << std::endl; + + // int64_tとの比較 + std::cout << "int_fast64_t is the same as int64_t: " + << std::is_same::value << std::endl; + + // 演算の例(オーバーフローに注意) + std::int_fast64_t a = 9000000000000000000LL; + std::int_fast64_t b = 1000000000000000000LL; + std::int_fast64_t sum = a + b; // 処理系によってはオーバーフローの可能性あり + + std::cout << "9000000000000000000 + 1000000000000000000 = " << sum << std::endl; + + return 0; +} +``` + +### 出力例 +``` +value: 1234567890123456789 +size of int_fast64_t: 8 bytes +minimum value: -9223372036854775808 +maximum value: 9223372036854775807 +int_fast64_t is the same as int64_t: 0 +9000000000000000000 + 1000000000000000000 = -8446744073709551616 +``` + +この出力例は特定の環境に依存しており、処理系によって異なる可能性があります。特に、`int_fast64_t`のサイズやオーバーフロー動作は処理系によって異なることがある。 + ## バージョン ### 言語 - C++11 @@ -25,3 +74,8 @@ namespace std { - [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] + +## 参照 +- [``](/reference/cstdint.md) +- [`INT_FAST64_MIN`](int_fast64_min.md) +- [`INT_FAST64_MAX`](int_fast64_max.md) From 84f50ba753515dc4a073b7e79f997bb775253273 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 25 Apr 2025 12:45:01 +0900 Subject: [PATCH 1594/3948] reference.md,reference/contracts.md: Aded contracts commit for issue #1419 --- reference.md | 1 + reference/{contract.md => contracts.md} | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) rename reference/{contract.md => contracts.md} (67%) diff --git a/reference.md b/reference.md index 19dcd1dff8..d466434046 100644 --- a/reference.md +++ b/reference.md @@ -158,6 +158,7 @@ | ヘッダ | 説明 | 対応バージョン | |----------------------------------------|------------------|----------------| | [``](/reference/debugging.md) | デバッグサポート | C++26 | +| [``](/reference/contracts.md) | 契約プログラミング | C++26 | ## 入出力ライブラリ diff --git a/reference/contract.md b/reference/contracts.md similarity index 67% rename from reference/contract.md rename to reference/contracts.md index 83d538512a..1e16fde0a2 100644 --- a/reference/contract.md +++ b/reference/contracts.md @@ -1,16 +1,16 @@ -# contract -* contract[meta header] -* future[meta cpp] +# contracts +* contracts[meta header] +* cpp26[meta cpp] -``ヘッダでは、[契約違反](/lang/future/contract-based_programming.md)のハンドリングのための機能を定義する。 +``ヘッダでは、[契約違反](/lang/cpp26/contracts.md)のハンドリングのための機能を定義する。 | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`contract_violation`](contract/contract_violation.md) | 契約違反に関する情報 (class) | C++ (将来) | +| [`contract_violation`](contract/contract_violation.md) | 契約違反に関する情報 (class) | C++26 | ## バージョン ### 言語 -- C++ (将来) +- C++26 ### 処理系 - [Clang](/implementation.md#clang): 未実装 @@ -20,6 +20,7 @@ ## 関連項目 - [契約に基づくプログラミング](/lang/future/contract-based_programming.md) +- [契約プログラミング](/lang/cpp26/contracts.md) ## 参照 - [P0542R5 Support for contract based programming in C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0542r5.html) From a50761fa9e45b5213dbd4e71ca25cc2ea5a6c35d Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 25 Apr 2025 12:47:06 +0900 Subject: [PATCH 1595/3948] lang/future.md: Fixed link commit for issue #1419 --- lang/future.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/future.md b/lang/future.md index 75e9154e63..4744c98355 100644 --- a/lang/future.md +++ b/lang/future.md @@ -20,4 +20,4 @@ cpprefjpでは基本的に[Working Draftに採択された機能のみを解説 | ヘッダ | 説明 | |--------|------| -| [``](/reference/contract.md) | 契約違反のハンドリング | +| [``](/reference/contracts.md) | 契約違反のハンドリング | From 31610ca535d5e0e642bdef92f5f2548196486467 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 25 Apr 2025 13:51:33 +0900 Subject: [PATCH 1596/3948] lang/future.md: Fixed typo Commit for issue #1419 --- lang/future.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/future.md b/lang/future.md index 4744c98355..5929d3d081 100644 --- a/lang/future.md +++ b/lang/future.md @@ -20,4 +20,4 @@ cpprefjpでは基本的に[Working Draftに採択された機能のみを解説 | ヘッダ | 説明 | |--------|------| -| [``](/reference/contracts.md) | 契約違反のハンドリング | +| [``](/reference/contracts.md) | 契約違反のハンドリング | From d3947782d4c569e5a4399959ce8b8ab8e34f61a9 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 25 Apr 2025 14:20:09 +0900 Subject: [PATCH 1597/3948] reference/contracts.md,reference/contracts/contract_violation.md: Fixed link --- reference/contracts.md | 2 +- reference/{contract => contracts}/contract_violation.md | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename reference/{contract => contracts}/contract_violation.md (100%) diff --git a/reference/contracts.md b/reference/contracts.md index 1e16fde0a2..6a0abdd644 100644 --- a/reference/contracts.md +++ b/reference/contracts.md @@ -6,7 +6,7 @@ | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`contract_violation`](contract/contract_violation.md) | 契約違反に関する情報 (class) | C++26 | +| [`contract_violation`](contracts/contract_violation.md) | 契約違反に関する情報 (class) | C++26 | ## バージョン ### 言語 diff --git a/reference/contract/contract_violation.md b/reference/contracts/contract_violation.md similarity index 100% rename from reference/contract/contract_violation.md rename to reference/contracts/contract_violation.md From f9d79b2bc4bfc34638b6c66d24b6ae4cdf26179b Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 25 Apr 2025 14:25:58 +0900 Subject: [PATCH 1598/3948] reference/contracts/contract_violation.md: Fixed meta header Commit for issue #1419 --- reference/contracts/contract_violation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/contracts/contract_violation.md b/reference/contracts/contract_violation.md index 9d0cea8eb7..d54687744c 100644 --- a/reference/contracts/contract_violation.md +++ b/reference/contracts/contract_violation.md @@ -1,5 +1,5 @@ # contract_violation -* contract[meta header] +* contracts[meta header] * class[meta id-type] * std[meta namespace] * future[meta cpp] From d78efbc0b83b75d022175d805bffbeac7a202a6a Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 25 Apr 2025 14:58:45 +0900 Subject: [PATCH 1599/3948] reference/contracts.md: Added and fixed things defined in contracts Commit for issue #1419 --- reference/contracts.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/reference/contracts.md b/reference/contracts.md index 6a0abdd644..5c2ebba7a3 100644 --- a/reference/contracts.md +++ b/reference/contracts.md @@ -2,11 +2,18 @@ * contracts[meta header] * cpp26[meta cpp] -``ヘッダでは、[契約違反](/lang/cpp26/contracts.md)のハンドリングのための機能を定義する。 +## 概要 +``ヘッダでは、C++における契約プログラミングのサポートを提供する。 + +契約プログラミングは、関数やクラスの前提条件、事後条件、およびアサーションを明示的に指定するプログラミング手法である。これらの条件が満たされない場合、プログラムは契約違反を報告する。 + | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`contract_violation`](contracts/contract_violation.md) | 契約違反に関する情報 (class) | C++26 | +| [`assertion_kind`](contracts/assertion_kind.md.nolink) | アサーションの種類 (enum) | C++26 | +| [`evaluation_semantic`](contracts/evaluation_semantic.md.nolink) | アサーションの評価の種類(enum) | C++26 | +| [`detection_mode`](contracts/detection_mode.md.nolink) | 契約違反の検出モード(enum) | C++26 | +| [`contract_violation`](contracts/contract_violation.md.nolink) | 契約違反に関する情報 (class) | C++26 | ## バージョン ### 言語 From 312fc42fa8669162e01645e075f957aa50e31fa6 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 25 Apr 2025 15:35:49 +0900 Subject: [PATCH 1600/3948] reference/contracts/contract_violation.md: Removed wrong file commit for issue #1419 --- reference/contracts/contract_violation.md | 61 ----------------------- 1 file changed, 61 deletions(-) delete mode 100644 reference/contracts/contract_violation.md diff --git a/reference/contracts/contract_violation.md b/reference/contracts/contract_violation.md deleted file mode 100644 index d54687744c..0000000000 --- a/reference/contracts/contract_violation.md +++ /dev/null @@ -1,61 +0,0 @@ -# contract_violation -* contracts[meta header] -* class[meta id-type] -* std[meta namespace] -* future[meta cpp] - -```cpp -namespace std { - class contract_violation { - public: - uint_least32_t line_number() const noexcept; - string_view file_name() const noexcept; - string_view function_name() const noexcept; - string_view comment() const noexcept; - string_view assertion_level() const noexcept; - }; -} -``` - -## 概要 - -`contract_violation`クラスは、発生した[契約違反](/lang/future/contract-based_programming.md)に関する情報を提供する。 - -契約違反が発生したとき、このクラスのオブジェクトが処理系定義の方法により構築され、違反ハンドラーに渡される。 - -違反ハンドラーは`void(const std::contract_violation&) noexcept`または`void(const std::contract_violation&)`の型を持つ関数であり、 -処理系定義の方法によって指定される。 - -## メンバ関数 - -| 名前 | 説明 | 対応バージョン | -|-----------------|----------------|----------------| -| [`line_number`](contract_violation/line_number.md.nolink) | 契約違反が発生したソースコード上の行番号 | C++ (将来) | -| [`file_name`](contract_violation/file_name.md.nolink) | 契約違反が発生したソースコードのファイル名 | C++ (将来) | -| [`function_name`](contract_violation/function_name.md.nolink) | 契約違反が発生した関数の名前 | C++ (将来) | -| [`comment`](contract_violation/comment.md.nolink) | 契約違反の原因となった述語を説明する処理系定義のテキスト | C++ (将来) | -| [`assertion_level`](contract_violation/assertion_level.md.nolink) | 違反した契約のアサーションレベル | C++ (将来) | - - -## 例 -(執筆中) - -### 出力 -(執筆中) - -## バージョン -### 言語 -- C++ (将来) - -### 処理系 -- [Clang](/implementation.md#clang): 未実装 -- [GCC](/implementation.md#gcc): 未実装 -- [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 未実装 - -## 関連項目 -- [契約に基づくプログラミング](/lang/future/contract-based_programming.md) - -## 参照 -- [P0542R5 Support for contract based programming in C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0542r5.html) -- [P0788R3 Standard Library Specification in a Concepts and Contracts World](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0788r3.pdf) From c8a99edd551be2ec19ac17cc4aa96ba2b661d003 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 25 Apr 2025 17:13:12 +0900 Subject: [PATCH 1601/3948] =?UTF-8?q?C++26:=20=E3=80=8C=E4=B8=8D=E5=AE=8C?= =?UTF-8?q?=E5=85=A8=E5=9E=8B=E3=81=B8=E3=81=AE=E3=83=9D=E3=82=A4=E3=83=B3?= =?UTF-8?q?=E3=82=BF=E3=81=AB=E5=AF=BE=E3=81=99=E3=82=8Bdelete=E3=82=92?= =?UTF-8?q?=E4=B8=8D=E9=81=A9=E6=A0=BC=E3=81=A8=E3=81=99=E3=82=8B=E3=80=8D?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20(close=20#1306)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp26.md | 2 +- ...an_incomplete_type_should_be_ill-formed.md | 25 +++++++++++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md diff --git a/implementation-status.md b/implementation-status.md index 014d68c0f5..96b6770398 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -310,7 +310,7 @@ | P2573R2: [関数宣言を削除する理由を指定できるようにする](/lang/cpp26/delete_reason.md) | `f() = delete("reason");` | 15 | 19 | | | | P2893R3: [可変引数テンプレートで`friend`宣言をできるようにする](/lang/cpp26/variadic_friends.md) | クラステンプレートの可変引数テンプレートでまとめて`friend`宣言できるようにする | 15 | | | | | P2747R2: [`constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md.nolink) | 定数式の文脈での配置`new`を許可 | 15 | | | | -| P3144R2: [不完全型へのポインタに対する`delete`を不適格とする](/lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md.nolink) | 未定義動作を引き起こす操作をコンパイルエラーとする | 15 | 19 | | | +| P3144R2: [不完全型へのポインタに対する`delete`を不適格とする](/lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md) | 未定義動作を引き起こす操作をコンパイルエラーとする | 15 | 19 | | | | P2963R3: [制約式内での畳み込み式の順序付け](/lang/cpp26/ordering_of_constraints_involving_fold_expressions.md.nolink) | 畳み込み式では全体ではなく個別の制約を原子制約式として扱う | | 19 | | | | P0963R3: [条件式での構造化束縛の使用を許可](/lang/cpp26/structured_binding_declaration_as_a_condition.md) | 式全体を`bool`値に変換できる場合に条件式で構造化束縛を使用できることとする | 15 | | | | | P2686R5: [`constexpr`構造化束縛の許可と、定数式への参照を定数式とする](/lang/cpp26/constexpr_structured_bindings_and_references_to_constexpr_variables.md.nolink) | 定数式に対する構造化束縛を許可し、関連する定数式への参照が定数式になるようにする | 15 | | | | diff --git a/lang/cpp26.md b/lang/cpp26.md index b31afe24ac..55763fa8c5 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -13,7 +13,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 |----------|------| | [`std::initializer_list`の配列を静的記憶域に配置する](/lang/cpp26/static_storage_for_braced_initializers.md) | `std::vector v = {1, 2, 3};`のような初期化で初期化子リストを静的記憶域に配置することで無駄なコピーをなくす | | [宣言のみで使用しない変数の名前として`_`をサポート](/lang/cpp26/nice_placeholder_with_no_name.md) | 変数名`_`は暗黙で`[[maybe_unused]]`が指定される | -| [不完全型へのポインタに対する`delete`を不適格とする](/lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md.nolink) | 未定義動作を引き起こす操作をコンパイルエラーとする | +| [不完全型へのポインタに対する`delete`を不適格とする](/lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md) | 未定義動作を引き起こす操作をコンパイルエラーとする | | [返却された左辺値から暗黙変換された一時オブジェクトが参照に束縛されることを禁止する](/lang/cpp26/disallow_binding_a_returned_glvalue_to_a_temporary.md.nolink) | 寿命切れの変数によって引き起こされるバグを防止する | | [要素数不明の配列を集成体初期化する規則を明確化](/lang/cpp26/clarifying_rules_for_brace_elision_in_aggregate_initialization.md.nolink) | 配列要素の集成体初期化で`{}`が省略された場合の矛盾していた規定を修正 | | [未初期化変数の読み取りをエラー性動作とする](/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md) | 初期化されていない自動変数の読み取りの安全性を規定する | diff --git a/lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md b/lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md new file mode 100644 index 0000000000..a30bcaf02c --- /dev/null +++ b/lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md @@ -0,0 +1,25 @@ +# 不完全型へのポインタに対するdeleteを不適格とする [P3144R2] +* cpp26[meta cpp] + + + +このページはC++26に採用される見込みの言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + + + +## 概要 +宣言のみで定義がない不完全型へのポインタへの`delete`は、これまで未定義動作を引き起こす操作になっていた。 + +C++26ではこれを不適格とし、コンパイル時エラーとする。 + +```cpp +class C; // 不完全型の宣言 +C* cp = nullptr; // 不完全型へのポインタはOK +delete cp; // C++23:未定義動作, C++26:コンパイルエラー +``` + + +## 参照 +- [P3144R2 Deleting a Pointer to an Incomplete Type Should be Ill-formed](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3144r2.pdf) From 7473d6a97a3fe9068831e513af191d6c942333f3 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 25 Apr 2025 17:57:08 +0900 Subject: [PATCH 1602/3948] =?UTF-8?q?C++26:=20=E3=80=8C=E5=AE=9A=E6=95=B0?= =?UTF-8?q?=E5=BC=8F=E3=81=A7=E3=81=AE`void*`=E3=81=8B=E3=82=89=E3=83=9D?= =?UTF-8?q?=E3=82=A4=E3=83=B3=E3=82=BF=E5=9E=8B=E3=81=B8=E3=81=AE=E3=82=AD?= =?UTF-8?q?=E3=83=A3=E3=82=B9=E3=83=88=E3=82=92=E8=A8=B1=E5=8F=AF=E3=80=8D?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20(close=20#1176)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp11/constexpr.md | 1 + lang/cpp26.md | 2 +- lang/cpp26/constexpr_cast_from_voidptr.md | 69 +++++++++++++++++++++++ 4 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 lang/cpp26/constexpr_cast_from_voidptr.md diff --git a/implementation-status.md b/implementation-status.md index 96b6770398..8d23087842 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -296,7 +296,7 @@ | P1854R4: [文字列リテラルの文字エンコーディング失敗を不適格とする](/lang/cpp26/making_non-encodable_string_literals_ill-formed.md) | 文字列リテラルのエンコーディング時に文字表現が失われる場合にコンパイルエラーにする | 14 | 14 | | | | P2361R6: [コンパイル時にのみ使用される文字列の扱いを明確化](/lang/cpp26/unevaluated_strings.md.nolink) | `static_assert`や`[[deprecated]]`などで使用されるコンパイル時の文字列について、文字コードの指定を禁止し、実行時エンコーディングが行われないことを規定 | 14 | 18 | | | | P2552R3: [属性の無視性を見直し](/lang/cpp26/on_the_ignorability_of_standard_attributes.md) | 構文として適格な属性のみを無視できるようにし、そうでない属性の使用を不適格とする | | | | | -| P2738R1: [定数式での`void*`からポインタ型へのキャストを許可](/lang/cpp26/constexpr_cast_from_voidptr.md.nolink) | 型消去のために`void*`からポインタ型へのキャストを許可する | 14 | 17 | | | +| P2738R1: [定数式での`void*`からポインタ型へのキャストを許可](/lang/cpp26/constexpr_cast_from_voidptr.md) | 型消去のために`void*`からポインタ型へのキャストを許可する | 14 | 17 | | | | P2741R3: [`static_assert`の診断メッセージにユーザーが生成した文字列の指定を許可](/lang/cpp26/user-generated_static_assert_messages.md) | `constexpr`な`S.size()`と`S.data()`メンバ関数をもつオブジェクトをコンパイル時文字列として指定できるようにする | 14 | 17 | | | | P2558R2: [基本文字集合に@、$、\`を追加](/lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md) | C言語との互換性のためにこれらの文字を基本文字集合に追加 | | Yes | | | | P2662R3: [パラメータパックへのインデックスアクセスを許可](/lang/cpp26/pack_indexing.md.nolink) | 可変引数テンプレートのパラメータパックに添字アクセスできるようにする | 15 | | | | diff --git a/lang/cpp11/constexpr.md b/lang/cpp11/constexpr.md index 1a84ebe2b6..01b3db84be 100644 --- a/lang/cpp11/constexpr.md +++ b/lang/cpp11/constexpr.md @@ -216,6 +216,7 @@ GCC 5.2、Clang 3.7、Visual C++ 2015時点で、3つともデフォルトは512 - [C++23 `constexpr`関数内での`static constexpr`変数を許可](/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md) - [C++23 `constexpr`関数内で`consteval`関数を呼び出せない問題を軽減](/lang/cpp23/consteval_needs_to_propagate_up.md) - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) +- [C++26 定数式での`void*`からポインタ型へのキャストを許可](/lang/cpp26/constexpr_cast_from_voidptr.md) ## 参照 diff --git a/lang/cpp26.md b/lang/cpp26.md index 55763fa8c5..0d17694309 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -75,7 +75,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| -| [定数式での`void*`からポインタ型へのキャストを許可](/lang/cpp26/constexpr_cast_from_voidptr.md.nolink) | 型消去のために`void*`からポインタ型へのキャストを許可する | +| [定数式での`void*`からポインタ型へのキャストを許可](/lang/cpp26/constexpr_cast_from_voidptr.md) | 型消去のために`void*`からポインタ型へのキャストを許可する | | [`static_assert`の診断メッセージにユーザーが生成した文字列の指定を許可](/lang/cpp26/user-generated_static_assert_messages.md) | `constexpr`な`S.size()`と`S.data()`メンバ関数をもつオブジェクトをコンパイル時文字列として指定できるようにする | | [`constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md.nolink) | 定数式の文脈での配置`new`を許可 | | [`constexpr`構造化束縛の許可と、定数式への参照を定数式とする](/lang/cpp26/constexpr_structured_bindings_and_references_to_constexpr_variables.md.nolink) | 定数式に対する構造化束縛を許可し、関連する定数式への参照が定数式になるようにする | diff --git a/lang/cpp26/constexpr_cast_from_voidptr.md b/lang/cpp26/constexpr_cast_from_voidptr.md new file mode 100644 index 0000000000..6dec51d654 --- /dev/null +++ b/lang/cpp26/constexpr_cast_from_voidptr.md @@ -0,0 +1,69 @@ +# 定数式での`void*`からポインタ型へのキャストを許可 [P2738R1] +* cpp26[meta cpp] + + + +このページはC++26に採用される見込みの言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 + + + +## 概要 +C++23までは、定数式の文脈での`void*`から元のポインタ型への変換が禁止されていたが、C++26からは許可される。 + +`void*`から元のポインタ型への変換は、「型消去 (type erasure)」で有用に使われるもので、標準ライブラリの実装としては[`std::any`](/reference/any/any.md)、[`std::function_ref`](/reference/function_ref/functional/funcion_ref.md)、[`std::format()`](/reference/format/format.md)などで使われており、これらがコンパイル時に使用できるようにするための必要となる。 + +型消去は、テンプレートインスタンスの数を減らし、バイナリサイズを小さくするために一般的に使用される技法である。とくに、メモリ制約のある組み込みプラットフォームでは、共通のコードパスを確保するために型消去が有効である。 + +`void*`から元のポインタ型に変換することによる型消去の例としては、以下のようになる: + +```cpp +#include + +struct Sheep { + constexpr std::string_view speak() const noexcept { return "Baaaaaa"; } +}; +struct Cow { + constexpr std::string_view speak() const noexcept { return "Mooo"; } +}; + +class AnimalView { +private: + const void* animal; + std::string_view (*speak_function)(const void*); +public: + template + constexpr AnimalView(const Animal &a) + : animal{&a}, speak_function{[](const void* object) { + return static_cast(object)->speak(); + }} + {} + + constexpr std::string_view speak() const noexcept { + return speak_function(animal); + } +}; + +int main() { + constexpr Cow cow; + constexpr AnimalView av{cow}; + constexpr auto result = av.speak(); +} +``` + +## 仕様 +定数式として許可されない操作を、以下のように変更: + +- 変更前:「(CV修飾) `void*` 型からオブジェクトへのポインタ型への変換」 +- 変更後:「(CV修飾) `void` へのポインタ型のprvalue (一時オブジェクト) `P` から、オブジェクトへのポインタ型`T`への変換。ただし、`P`が`T`と類似 (similar) の型のオブジェクトを指している場合を除く」 + +これはつまり、`T`から`void*`を経由して`T`に変換することは許可されるが、`void*`を経由してほかの型に変換することは禁止されたままとなる。 + + +## 関連項目 +- [C++11 constexpr](/lang/cpp11/constexpr.md) + + +## 参照 +- [P2738R1 `constexpr` cast from `void*`: towards `constexpr` type-erasure](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2738r1.pdf) From 3c7eee6f893f8c223edb4f846ef4ec93406420a2 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 25 Apr 2025 17:58:11 +0900 Subject: [PATCH 1603/3948] fix link --- lang/cpp26/constexpr_cast_from_voidptr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp26/constexpr_cast_from_voidptr.md b/lang/cpp26/constexpr_cast_from_voidptr.md index 6dec51d654..9ecf75ba43 100644 --- a/lang/cpp26/constexpr_cast_from_voidptr.md +++ b/lang/cpp26/constexpr_cast_from_voidptr.md @@ -12,7 +12,7 @@ ## 概要 C++23までは、定数式の文脈での`void*`から元のポインタ型への変換が禁止されていたが、C++26からは許可される。 -`void*`から元のポインタ型への変換は、「型消去 (type erasure)」で有用に使われるもので、標準ライブラリの実装としては[`std::any`](/reference/any/any.md)、[`std::function_ref`](/reference/function_ref/functional/funcion_ref.md)、[`std::format()`](/reference/format/format.md)などで使われており、これらがコンパイル時に使用できるようにするための必要となる。 +`void*`から元のポインタ型への変換は、「型消去 (type erasure)」で有用に使われるもので、標準ライブラリの実装としては[`std::any`](/reference/any/any.md)、[`std::function_ref`](/reference/functional/funcion_ref.md)、[`std::format()`](/reference/format/format.md)などで使われており、これらがコンパイル時に使用できるようにするための必要となる。 型消去は、テンプレートインスタンスの数を減らし、バイナリサイズを小さくするために一般的に使用される技法である。とくに、メモリ制約のある組み込みプラットフォームでは、共通のコードパスを確保するために型消去が有効である。 From 09b3c3e59a1c0b808f326d1d924a7e143e2e6dca Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 25 Apr 2025 18:00:28 +0900 Subject: [PATCH 1604/3948] fix link --- lang/cpp26/constexpr_cast_from_voidptr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp26/constexpr_cast_from_voidptr.md b/lang/cpp26/constexpr_cast_from_voidptr.md index 9ecf75ba43..21d55886b9 100644 --- a/lang/cpp26/constexpr_cast_from_voidptr.md +++ b/lang/cpp26/constexpr_cast_from_voidptr.md @@ -12,7 +12,7 @@ ## 概要 C++23までは、定数式の文脈での`void*`から元のポインタ型への変換が禁止されていたが、C++26からは許可される。 -`void*`から元のポインタ型への変換は、「型消去 (type erasure)」で有用に使われるもので、標準ライブラリの実装としては[`std::any`](/reference/any/any.md)、[`std::function_ref`](/reference/functional/funcion_ref.md)、[`std::format()`](/reference/format/format.md)などで使われており、これらがコンパイル時に使用できるようにするための必要となる。 +`void*`から元のポインタ型への変換は、「型消去 (type erasure)」で有用に使われるもので、標準ライブラリの実装としては[`std::any`](/reference/any/any.md)、[`std::function_ref`](/reference/functional/function_ref.md)、[`std::format()`](/reference/format/format.md)などで使われており、これらがコンパイル時に使用できるようにするための必要となる。 型消去は、テンプレートインスタンスの数を減らし、バイナリサイズを小さくするために一般的に使用される技法である。とくに、メモリ制約のある組み込みプラットフォームでは、共通のコードパスを確保するために型消去が有効である。 From 5c5c70946c055fd5626e2637ab053568ae7ebb46 Mon Sep 17 00:00:00 2001 From: Keita Nonaka Date: Fri, 25 Apr 2025 03:29:37 -0700 Subject: [PATCH 1605/3948] fix: missing `#include ` in `std::barrier` Signed-off-by: Keita Nonaka --- reference/barrier/barrier/arrive.md | 1 + reference/barrier/barrier/arrive_and_drop.md | 1 + reference/barrier/barrier/arrive_and_wait.md | 1 + reference/barrier/barrier/wait.md | 1 + 4 files changed, 4 insertions(+) diff --git a/reference/barrier/barrier/arrive.md b/reference/barrier/barrier/arrive.md index 6af0b912ce..e98ab098ab 100644 --- a/reference/barrier/barrier/arrive.md +++ b/reference/barrier/barrier/arrive.md @@ -47,6 +47,7 @@ arrival_token arrive(ptrdiff_t update = 1); // (1) C++26 #include #include #include +#include #include #include diff --git a/reference/barrier/barrier/arrive_and_drop.md b/reference/barrier/barrier/arrive_and_drop.md index 8c54f1e472..fefb63d5c6 100644 --- a/reference/barrier/barrier/arrive_and_drop.md +++ b/reference/barrier/barrier/arrive_and_drop.md @@ -43,6 +43,7 @@ void arrive_and_drop(); #include #include #include +#include #include #include diff --git a/reference/barrier/barrier/arrive_and_wait.md b/reference/barrier/barrier/arrive_and_wait.md index 80259d5523..93abaf94f4 100644 --- a/reference/barrier/barrier/arrive_and_wait.md +++ b/reference/barrier/barrier/arrive_and_wait.md @@ -34,6 +34,7 @@ void arrive_and_wait(); #include #include #include +#include #include #include diff --git a/reference/barrier/barrier/wait.md b/reference/barrier/barrier/wait.md index 1f78e962a3..66905bb73a 100644 --- a/reference/barrier/barrier/wait.md +++ b/reference/barrier/barrier/wait.md @@ -38,6 +38,7 @@ void wait(arrival_token&& arrival) const; #include #include #include +#include #include #include From 0595a39f9b3d8809bb9d77b08c4756889a223016 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sun, 27 Apr 2025 12:37:16 +0900 Subject: [PATCH 1606/3948] reference/contracts.md: Added function --- reference/contracts.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/contracts.md b/reference/contracts.md index 5c2ebba7a3..3b7a551bc5 100644 --- a/reference/contracts.md +++ b/reference/contracts.md @@ -14,6 +14,7 @@ | [`evaluation_semantic`](contracts/evaluation_semantic.md.nolink) | アサーションの評価の種類(enum) | C++26 | | [`detection_mode`](contracts/detection_mode.md.nolink) | 契約違反の検出モード(enum) | C++26 | | [`contract_violation`](contracts/contract_violation.md.nolink) | 契約違反に関する情報 (class) | C++26 | +| [`invoke_default_contract_violation_handler`](contracts/invoke_default_contract_violation_handler.nolink) | デフォルトcontract_violationハンドラー | C++26 | ## バージョン ### 言語 From 398fa68b90551ffb47a5bf4b384b460eb52a80ba Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sun, 27 Apr 2025 12:40:21 +0900 Subject: [PATCH 1607/3948] reference/contracts/contract_violation.md: Initialized page --- reference/contracts/contract_violation.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 reference/contracts/contract_violation.md diff --git a/reference/contracts/contract_violation.md b/reference/contracts/contract_violation.md new file mode 100644 index 0000000000..41737cd51b --- /dev/null +++ b/reference/contracts/contract_violation.md @@ -0,0 +1,19 @@ +# contract_violation +* contracts[meta header] +* std::contracts[meta namespace] +* class[meta id-type] + +```cpp +namespace std::contracts { + class contract_violation { + public: + const char* comment() const noexcept; + contracts::detection_mode detection_mode() const noexcept; + exception_ptr evaluation_exception() const noexcept; + bool is_terminating() const noexcept; + assertion_kind kind() const noexcept; + source_location location() const noexcept; + evaluation_semantic sematic() const noexcept; + } +} +``` From 3227e2159124ca5f3e11287f96782dfb70731c0d Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sun, 27 Apr 2025 13:03:14 +0900 Subject: [PATCH 1608/3948] reference/contracts/contract_violation.md: Added description --- reference/contracts/contract_violation.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reference/contracts/contract_violation.md b/reference/contracts/contract_violation.md index 41737cd51b..d0a9847087 100644 --- a/reference/contracts/contract_violation.md +++ b/reference/contracts/contract_violation.md @@ -17,3 +17,7 @@ namespace std::contracts { } } ``` + +`contract_violation`型は、実行時に発生した契約違反が`handle_contract_violation`関数に渡されるために使用される型である。 + +この型は、ユーザーによって構築、コピー、ムーブ、変更してはならない。 From f1c0d5d4430caa10dd9d0966e4306d71985faae9 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 29 Apr 2025 10:41:04 +0900 Subject: [PATCH 1609/3948] =?UTF-8?q?=E5=A4=96=E9=83=A8=E3=83=AA=E3=83=B3?= =?UTF-8?q?=E3=82=AF=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF=20:=20https://www?= =?UTF-8?q?.gnu.org/=20=E3=82=92=E7=84=A1=E8=A6=96=E3=83=AA=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=81=AB=E7=99=BB=E9=8C=B2=20#1444?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/script/link_check.py | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/script/link_check.py b/.github/workflows/script/link_check.py index 2900cd9bd8..2787f1b7a4 100644 --- a/.github/workflows/script/link_check.py +++ b/.github/workflows/script/link_check.py @@ -58,6 +58,7 @@ def fix_link(link: str) -> str: "http://cse.naro.affrc.go.jp", # 海外 (GitHub Actions) からのアクセスを排除していると思われる "https://www.cryptopp.com", # アクセスチェックでよく失敗するがブラウザ上では問題なくアクセスできる "https://www.microsoft.com/", # ちょくちょく失敗するが、一時的なものだと思われる + "https://www.gnu.org/", # 毎週失敗する。/lang/cpp11/thread_local_storage.md でのみ使用。gcc.gnu.orgは失敗しない ] IGNORE_REGEX_LIST = [ From c3aa7d4600e5369ebae87bac56502c505dfc2fe7 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Tue, 29 Apr 2025 22:04:13 +0900 Subject: [PATCH 1610/3948] reference/contracts/contract_violation.md: Added function description --- reference/contracts/contract_violation.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/reference/contracts/contract_violation.md b/reference/contracts/contract_violation.md index d0a9847087..c973f670a7 100644 --- a/reference/contracts/contract_violation.md +++ b/reference/contracts/contract_violation.md @@ -21,3 +21,14 @@ namespace std::contracts { `contract_violation`型は、実行時に発生した契約違反が`handle_contract_violation`関数に渡されるために使用される型である。 この型は、ユーザーによって構築、コピー、ムーブ、変更してはならない。 + +## メンバ関数 +| 名前 | 説明 | 対応バージョン | +| ---- | ---- | ---- | +| [`comment`](contracts/comment.md.nolink) | 契約違反の詳細を記録したchar列を返す | C++26 | +| [`detection_mode`](contracts/detection_mode.md.nolink) | 契約違反が特定された方法を返す | C++26 | +| [`evaluation_exception`](contracts/evaluation_exception.md.nolink) | 契約が例外を飛ばしたことによって終了した場合の例外へのポインタ | C++26 | +| [`is_terminating`](contracts/is_terminating.md.nolink) | 契約違反によってプログラムがターミネートされるかを返す | C++26| +| [`kind`](contracts/kind.md.nolink) | 違反した契約の種類 | C++26| +| [`location`](contracts/location.md.nolink) | 違反した場所を返す | C++26 | +| [`semantic`](contracts/semantic.md.nolink) | 違反した契約のセマンティクス | C++26 | From eaac109518925a0d97d7f4ea231a3c2b648ced72 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Tue, 29 Apr 2025 22:07:27 +0900 Subject: [PATCH 1611/3948] reference/contracts/contract_violation.md: Added reference column --- reference/contracts/contract_violation.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reference/contracts/contract_violation.md b/reference/contracts/contract_violation.md index c973f670a7..3e24a77dbd 100644 --- a/reference/contracts/contract_violation.md +++ b/reference/contracts/contract_violation.md @@ -32,3 +32,6 @@ namespace std::contracts { | [`kind`](contracts/kind.md.nolink) | 違反した契約の種類 | C++26| | [`location`](contracts/location.md.nolink) | 違反した場所を返す | C++26 | | [`semantic`](contracts/semantic.md.nolink) | 違反した契約のセマンティクス | C++26 | + +## 参照 +- [Contracts for C++](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2900r14.pdf) \ No newline at end of file From 31813303d99331c6c63fbcf358ecbee2b7df15af Mon Sep 17 00:00:00 2001 From: rotarymars Date: Tue, 29 Apr 2025 22:14:15 +0900 Subject: [PATCH 1612/3948] reference/contracts.md: Removed nolink --- reference/contracts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/contracts.md b/reference/contracts.md index 3b7a551bc5..aaacd31db1 100644 --- a/reference/contracts.md +++ b/reference/contracts.md @@ -13,7 +13,7 @@ | [`assertion_kind`](contracts/assertion_kind.md.nolink) | アサーションの種類 (enum) | C++26 | | [`evaluation_semantic`](contracts/evaluation_semantic.md.nolink) | アサーションの評価の種類(enum) | C++26 | | [`detection_mode`](contracts/detection_mode.md.nolink) | 契約違反の検出モード(enum) | C++26 | -| [`contract_violation`](contracts/contract_violation.md.nolink) | 契約違反に関する情報 (class) | C++26 | +| [`contract_violation`](contracts/contract_violation.md) | 契約違反に関する情報 (class) | C++26 | | [`invoke_default_contract_violation_handler`](contracts/invoke_default_contract_violation_handler.nolink) | デフォルトcontract_violationハンドラー | C++26 | ## バージョン From 7a7c220752f7479d782da47c80170b91c8ea01d5 Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 30 Apr 2025 01:23:37 +0900 Subject: [PATCH 1613/3948] execution: run_loop/get_scheduler (#1384) --- reference/execution/execution.md | 2 +- .../execution/get_completion_scheduler.md | 2 +- reference/execution/execution/run_loop.md | 117 ++++++++++++++++++ .../execution/run_loop/get_scheduler.md | 58 +++++++++ .../execution/run_loop/op_constructor.md | 42 +++++++ .../execution/run_loop/op_destructor.md | 34 +++++ .../execution/run_loop/run-loop-scheduler.md | 32 +++++ .../execution/run_loop/run-loop-sender.md | 34 +++++ reference/execution/execution/schedule.md | 4 +- reference/execution/execution/scheduler.md | 4 +- 10 files changed, 323 insertions(+), 6 deletions(-) create mode 100644 reference/execution/execution/run_loop.md create mode 100644 reference/execution/execution/run_loop/get_scheduler.md create mode 100644 reference/execution/execution/run_loop/op_constructor.md create mode 100644 reference/execution/execution/run_loop/op_destructor.md create mode 100644 reference/execution/execution/run_loop/run-loop-scheduler.md create mode 100644 reference/execution/execution/run_loop/run-loop-sender.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index b86510b3b9..5501c1ee10 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -145,7 +145,7 @@ Senderコンシューマは名前空間 `std::this_thread` で定義される。 | [`execution::completion_signatures`](execution/completion_signatures.md) | 完了シグネチャ集合を表現する型 (class template) | C++26 | | [`execution::transform_completion_signatures`](execution/transform_completion_signatures.md.nolink) | 完了シグネチャを変換 (alias template) | C++26 | | [`execution::transform_completion_signatures_of`](execution/transform_completion_signatures_of.md.nolink) | 完了シグネチャを変換 (alias template) | C++26 | -| [`execution::run_loop`](execution/run_loop.md.nolink) | 実行ループ (class) | C++26 | +| [`execution::run_loop`](execution/run_loop.md) | 単一スレッド上でのループ実行 (class) | C++26 | ### コルーチンユーティリティ diff --git a/reference/execution/execution/get_completion_scheduler.md b/reference/execution/execution/get_completion_scheduler.md index 6dc7385982..566ed43348 100644 --- a/reference/execution/execution/get_completion_scheduler.md +++ b/reference/execution/execution/get_completion_scheduler.md @@ -76,7 +76,7 @@ int main() } ``` * ex::get_completion_scheduler[color ff0000] -* ex::run_loop[link run_loop.md.nolink] +* ex::run_loop[link run_loop.md] * ex::scheduler[link scheduler.md] * ex::sender[link sender.md] * ex::schedule[link schedule.md] diff --git a/reference/execution/execution/run_loop.md b/reference/execution/execution/run_loop.md new file mode 100644 index 0000000000..4ed815e629 --- /dev/null +++ b/reference/execution/execution/run_loop.md @@ -0,0 +1,117 @@ +# run_loop +* execution[meta header] +* class[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execition { + class run_loop; +} +``` + +## 概要 +`run_loop`は、実行制御ライブラリの作業を[スケジュール](schedule.md)可能な実行リソース(execution resource)である。 + +内部的にスレッドセーフなFIFO (first-in first-out) 作業キューを保持する。 +[`run`メンバ関数](run_loop/run.md.nolink)はキューから作業を取り出し、同関数を呼び出したスレッド上のループで実行する。 + +`run_loop`インスタンスの動作説明のため、下記の説明用メンバ変数を持つ。 + +- `count` : FIFOキューが保持する作業の個数 +- `state` : 開始(starting)/実行中(running)/完了中(finishing)/完了済み(finished) いずれかのインスタンス状態 + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|-------| +| [`(constructor)`](run_loop/op_constructor.md) | コンストラクタ | C++26 | +| [`(destructor)`](run_loop/op_destructor.md) | デストラクタ | C++26 | +| [`get_scheduler`](run_loop/get_scheduler.md) | Scheduler取得 | C++26 | +| [`run`](run_loop/run.md.nolink) | ループ実行を開始 | C++26 | +| [`finish`](run_loop/finish.md.nolink) | ループ実行を終了 | C++26 | + +## 説明専用のメンバ型 + +| 名前 | 説明 | 対応バージョン | +|------|------|-------| +| [`run-loop-scheduler`](run_loop/run-loop-scheduler.md) | 説明専用クラス | C++26 | +| [`run-loop-sender`](run_loop/run-loop-sender.md) | 説明専用クラス | C++26 | +| [`run-loop-opstate`](run_loop/run-loop-opstate.md.nolink) | 説明専用クラス | C++26 | + + +## 例 +```cpp example +#include +namespace ex = std::execution; + +struct MyReceiver { + using receiver_concept = ex::receiver_t; + + void set_value() noexcept + { std::println("value"); } + void set_error(std::exception_ptr) noexcept + { std::println("error"); } + void set_stopped() noexcept + { std::println("stopped"); } +}; + + +int main() +{ + // run_loopのスケジュールSenderを取得 + ex::run_loop loop; + ex::scheduler auto sch = loop.get_scheduler(); + // state:開始(starting) + + ex::sender auto sndr = ex::schedule(sch); + ex::receiver auto rcvr = MyReceiver{}; + ex::operation_state auto op = ex::connect(sndr, rcvr); + // キューに作業を1つ追加 + ex::start(op); + + // stateを完了中(finished)へ遷移 + loop.finish(); + + // キュー上の作業を全て処理 + loop.run(); + // state:完了済み(finished) +} +``` +* ex::run_loop[color ff0000] +* ex::scheduler[link scheduler.md] +* ex::sender[link sender.md] +* ex::schedule[link schedule.md] +* ex::receiver[link receiver.md] +* ex::receiver_t[link receiver.md] +* ex::operation_state[link operation_state.md] +* ex::connect[link connect.md] +* ex::start[link start.md] +* get_scheduler()[link run_loop/get_scheduler.md] +* finish()[link run_loop/finish.md.nolink] +* run()[link run_loop/run.md.nolink] + +### 出力 +``` +value +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::schedule`](schedule.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/run_loop/get_scheduler.md b/reference/execution/execution/run_loop/get_scheduler.md new file mode 100644 index 0000000000..462704953a --- /dev/null +++ b/reference/execution/execution/run_loop/get_scheduler.md @@ -0,0 +1,58 @@ +# get_scheduler +* execution[meta header] +* std::execution[meta namespace] +* run_loop[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +run-loop-scheduler get_scheduler(); +``` +* run-loop-scheduler[link run-loop-scheduler.md] + +## 概要 +`run_loop`上で実行する[Scheduler](../scheduler.md)を返す。 + + +## 戻り値 +`run_loop`インスタンス上で作業を[スケジュール](../schedule.md)する[`run-loop-scheduler`](run-loop-scheduler.md)インスタンスを返す。 + + +## 例 +```cpp example +#include +namespace ex = std::execution; + +int main() +{ + ex::run_loop loop; + ex::scheduler auto sch = loop.get_scheduler(); +} +``` +* get_scheduler()[color ff0000] +* ex::run_loop[link ../run_loop.md] +* ex::scheduler[link ../scheduler.md] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++26 + + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`run-loop-scheduler`](run-loop-scheduler.md) +- [`execution::schedule`](../schedule.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/run_loop/op_constructor.md b/reference/execution/execution/run_loop/op_constructor.md new file mode 100644 index 0000000000..6358fb8ff7 --- /dev/null +++ b/reference/execution/execution/run_loop/op_constructor.md @@ -0,0 +1,42 @@ +# コンストラクタ +* execution[meta header] +* std::execution[meta namespace] +* run_loop[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +run_loop() noexcept; // (1) +run_loop(run_loop&&) = delete; // (2) +``` + +## 概要 +- (1) : デフォルトコンストラクタ +- (2) : コピー/ムーブ構築の禁止 + + +## 事後条件 +(1) : [`run_loop`](../run_loop.md)の説明専用メンバ変数が次の通り初期化される。 + +- `count` : 値`0` +- `state` : 開始(starting) + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/run_loop/op_destructor.md b/reference/execution/execution/run_loop/op_destructor.md new file mode 100644 index 0000000000..85c59fbe37 --- /dev/null +++ b/reference/execution/execution/run_loop/op_destructor.md @@ -0,0 +1,34 @@ +# デストラクタ +* execution[meta header] +* std::execution[meta namespace] +* run_loop[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +~run_loop(); +``` + +## 概要 +`run_loopオブジェクトを破棄する。 + + +## 効果 +`count`が非`0`かつ`state`が実行中(running)のとき、[`terminate`](/reference/exception/terminate.md)を呼び出す。 +それ以外のときは、効果を持たない。 + + +## バージョン +### 言語 +- C++26 + + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/run_loop/run-loop-scheduler.md b/reference/execution/execution/run_loop/run-loop-scheduler.md new file mode 100644 index 0000000000..dce6681d5b --- /dev/null +++ b/reference/execution/execution/run_loop/run-loop-scheduler.md @@ -0,0 +1,32 @@ +# run-loop-scheduler +* execution[meta header] +* std::execution[meta namespace] +* run_loop[meta class] +* class[meta id-type] +* cpp26[meta cpp] + +```cpp +class run-loop-scheduler; // exposition only +``` + +## 概要 +`run-loop-scheduler`は、[`get_scheduler`メンバ関数](get_scheduler.md)の戻り値型として利用される説明専用のクラスである。 + +- `run-loop-scheduler`型は[`scheduler`](../scheduler.md)のモデルとなる未規定の型。 +- `run-loop-scheduler`インスタンスは、同インスタンスを取得した[`run_loop`](../run_loop.md)インスタンスの生存期間(lifetime)終了まで有効。 +- 2個の`run-loop-scheduler`インスタンスは、[`run_loop`](../run_loop.md)インスタンスから取得された場合に限って等しい。 +- 説明用の式`sch`の型が`run-loop-scheduler`であるとき、式[`schedule`](../schedule.md)`(sch)`は型[`run-loop-sender`](run-loop-sender.md)となり、式`sch`が潜在的に例外送出しない(not potentially-throwing)ならばそれに従う。 + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`get_scheduler`](get_scheduler.md) +- [`execution::scheduler`](../scheduler.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/run_loop/run-loop-sender.md b/reference/execution/execution/run_loop/run-loop-sender.md new file mode 100644 index 0000000000..1ee6fa6ade --- /dev/null +++ b/reference/execution/execution/run_loop/run-loop-sender.md @@ -0,0 +1,34 @@ +# run-loop-sender +* execution[meta header] +* std::execution[meta namespace] +* run_loop[meta class] +* class[meta id-type] +* cpp26[meta cpp] + +```cpp +class run-loop-sender; // exposition only +``` + +## 概要 +`run-loop-sender`は、[`get_scheduler`メンバ関数](get_scheduler.md)が返す[`run-loop-scheduler`](run-loop-scheduler.md)動作仕様の説明で利用される説明専用のクラスである。 + +- `run-loop-sender`型は[`sender`](../sender.md)のモデルである。 +- 任意の型`Env`に対して、[`completion_signatures_of_t`](../completion_signatures_of_t.md)``は[`completion_signatures`](../completion_signatures.md)`<`[`set_value_t`](../set_value.md)`(),` [`set_error_t`](../set_error.md)`(`[`exception_ptr`](/reference/exception/exception_ptr.md)`),` [`set_stopped_t`](../set_stopped.md)`()>` +- `run-loop-sender`インスタンスは、関連付けられた[`run_loop`](../run_loop.md)インスタンスの生存期間(lifetime)終了まで有効。 +- 説明用の式`sndr`の型を`run-loop-sender`、`CS`が上記[`completion_signatures`](../completion_signatures.md)の特殊化であるとき[`receiver_of`](../receiver_of.md)``が`true`となる式`rcvr`としたとき、 + - 式[`connect`](../connect.md)`(sndr, rcvr)`の型は[`run-loop-opstate`](run-loop-opstate.md.nolink)`<`[`decay_t`](/reference/type_traits/decay.md)`>`であり、潜在的な例外送出(potentially-throwing)は式`(void(sndr), auto(rcvr))`に従う。 + - 完了タグ`C`を[`set_value_t`](../set_value.md)または[`set_stopped_t`](../set_stopped.md)としたとき、式[`get_completion_scheduler`](../get_completion_scheduler.md)`(`[`get_env`](../get_env.md)`(sndr))`の潜在的な例外送出は`sndr`に従う。式の型は[`run-loop-scheduler`](run-loop-scheduler.md)となり、そのインスタンスは同一`sndr`から取得された場合に等しくなる。 + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`run-loop-scheduler`](run-loop-scheduler.md) +- [`execution::sender`](../sender.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/schedule.md b/reference/execution/execution/schedule.md index 519e98b5f6..f6557e1661 100644 --- a/reference/execution/execution/schedule.md +++ b/reference/execution/execution/schedule.md @@ -64,8 +64,8 @@ int main() * ex::scheduler[link scheduler.md] * ex::sender[link sender.md] * ex::then[link then.md.nolink] -* ex::run_loop[link run_loop.md.nolink] -* get_scheduler()[link run_loop/get_scheduler.md.nolink] +* ex::run_loop[link run_loop.md] +* get_scheduler()[link run_loop/get_scheduler.md] * run()[link run_loop/run.md.nolink] * finish()[link run_loop/finish.md.nolink] * std::move[link /reference/utility/move.md] diff --git a/reference/execution/execution/scheduler.md b/reference/execution/execution/scheduler.md index da64b22d98..f113de5584 100644 --- a/reference/execution/execution/scheduler.md +++ b/reference/execution/execution/scheduler.md @@ -92,8 +92,8 @@ int main() } ``` * ex::scheduler[color ff0000] -* ex::run_loop[link run_loop.md.nolink] -* get_scheduler()[link run_loop/get_scheduler.md.nolink] +* ex::run_loop[link run_loop.md] +* get_scheduler()[link run_loop/get_scheduler.md] ### 出力 ``` From c1091ca91d0263cca01e11e567e8668ddff8689e Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 30 Apr 2025 10:39:58 +0900 Subject: [PATCH 1614/3948] execution: get-completion-domain (#1384) --- .../execution/execution/completion-domain.md | 41 +++++++++++++++++++ .../execution/execution/get-domain-late.md | 11 ++++- 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 reference/execution/execution/completion-domain.md diff --git a/reference/execution/execution/completion-domain.md b/reference/execution/execution/completion-domain.md new file mode 100644 index 0000000000..70eb1a6ac7 --- /dev/null +++ b/reference/execution/execution/completion-domain.md @@ -0,0 +1,41 @@ +# completion-domain +* execution[meta header] +* function template[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +template +constexpr auto completion-domain(const Sndr& sndr) noexcept; +``` +* default_domain[link default_domain.md] + +## 概要 +[Sender型](sender.md)`sndr`の[完了Scheduler](get_completion_scheduler.md)から[実行ドメイン](default_domain.md)を取得する説明専用の関数テンプレート。 + + +## 効果 +説明用の型`COMPL-DOMAIN(T)`を式[`get_domain`](get_domain.md)`(`[`get_completion_scheduler`](get_completion_scheduler.md)`(`[`get_env`](get_env.md)`(sndr)))`の型とする。 + +- 型`COMPL-DOMAIN(`[`set_value_t`](set_value.md)`)`、`COMPL-DOMAIN(`[`set_error_t`](set_error.md)`)`、`COMPL-DOMAIN(`[`set_stopped_t`](set_stopped.md)`)`の全てが不適格の場合、`completion-domain`は`Default`型のデフォルト構築されたprvalueとなる。 +- そうではなく、上記のうち不適格となる型を除いた型が[共通型](/reference/type_traits/common_type.md)を共有するならば、`completion-domain`はその共有型のデフォルト構築されたprvalueとなる。 +- そうでなければ、`completion-domain`は不適格となる。 + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`get-domain-early`](get-domain-early.md.nolink) +- [`get-domain-late`](get-domain-late.md) + + +## 参照 +- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/get-domain-late.md b/reference/execution/execution/get-domain-late.md index bb9a34f9db..19daa05a98 100644 --- a/reference/execution/execution/get-domain-late.md +++ b/reference/execution/execution/get-domain-late.md @@ -12,6 +12,15 @@ constexpr auto get-domain-late(const Sndr& sndr, const Env& env) noexcept; ## 概要 [Sender](sender.md)と[Receiver](receiver.md)間[接続(connect)](connect.md)時のカスタマイゼーションポイントとして、[実行ドメイン](default_domain.md)を取得する説明専用の関数テンプレート。 +下記の優先順で実行ドメインを検索し、最初に妥当となる型を採用する。 +(Senderアルゴリズム[`continue_on`](continue_on.md.nolink)のみ引数に指定した[Scheduler](scheduler.md)から取得。) + +- Senderの[属性](../queryable.md) +- Senderの[完了Scheduler](get_completion_scheduler.md) +- Receiverの[環境](../queryable.md) +- Receiver環境の[Scheduler](scheduler.md) +- [`default_domain`](default_domain.md) + ## 効果 説明用の型`Domain`を下記の通り定義したとき、`return Doamin();`と等価。 @@ -30,7 +39,7 @@ constexpr auto get-domain-late(const Sndr& sndr, const Env& env) noexcept; - それ以外のとき、下記リストのうち最初に妥当となる式の型、かつ`void`ではない型とする。 - [`get_domain`](get_domain.md)`(`[`get_env`](get_env.md)`(sndr))` - - [`completion-domain`](completion-domain.md.nolink)`(sndr)` + - [`completion-domain`](completion-domain.md)`(sndr)` - [`get_domain`](get_domain.md)`(env)` - [`get_domain`](get_domain.md)`(`[`get_scheduler`](get_scheduler.md)`(env))` - [`default_domain()`](default_domain.md) From 6494e10640804b700440d2fcb5d5248b457d83d3 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Wed, 30 Apr 2025 11:20:06 +0900 Subject: [PATCH 1615/3948] reference/contracts/contract_violation.md: Fixed typo and description --- reference/contracts/contract_violation.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/contracts/contract_violation.md b/reference/contracts/contract_violation.md index 3e24a77dbd..4e4cf77251 100644 --- a/reference/contracts/contract_violation.md +++ b/reference/contracts/contract_violation.md @@ -13,7 +13,7 @@ namespace std::contracts { bool is_terminating() const noexcept; assertion_kind kind() const noexcept; source_location location() const noexcept; - evaluation_semantic sematic() const noexcept; + evaluation_semantic semantic() const noexcept; } } ``` @@ -30,8 +30,8 @@ namespace std::contracts { | [`evaluation_exception`](contracts/evaluation_exception.md.nolink) | 契約が例外を飛ばしたことによって終了した場合の例外へのポインタ | C++26 | | [`is_terminating`](contracts/is_terminating.md.nolink) | 契約違反によってプログラムがターミネートされるかを返す | C++26| | [`kind`](contracts/kind.md.nolink) | 違反した契約の種類 | C++26| -| [`location`](contracts/location.md.nolink) | 違反した場所を返す | C++26 | -| [`semantic`](contracts/semantic.md.nolink) | 違反した契約のセマンティクス | C++26 | +| [`location`](contracts/location.md.nolink) | 契約違反が発生したソースコードの位置 | C++26| +| [`semantic`](contracts/semantic.md.nolink) | 契約の評価方法 | C++26| ## 参照 - [Contracts for C++](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2900r14.pdf) \ No newline at end of file From 8ece610f782e1063681f9605b1e97348830b111d Mon Sep 17 00:00:00 2001 From: rotarymars Date: Wed, 30 Apr 2025 11:26:00 +0900 Subject: [PATCH 1616/3948] reference/contracts.md: Fixed link typo --- reference/contracts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/contracts.md b/reference/contracts.md index aaacd31db1..7aee99db73 100644 --- a/reference/contracts.md +++ b/reference/contracts.md @@ -14,7 +14,7 @@ | [`evaluation_semantic`](contracts/evaluation_semantic.md.nolink) | アサーションの評価の種類(enum) | C++26 | | [`detection_mode`](contracts/detection_mode.md.nolink) | 契約違反の検出モード(enum) | C++26 | | [`contract_violation`](contracts/contract_violation.md) | 契約違反に関する情報 (class) | C++26 | -| [`invoke_default_contract_violation_handler`](contracts/invoke_default_contract_violation_handler.nolink) | デフォルトcontract_violationハンドラー | C++26 | +| [`invoke_default_contract_violation_handler`](contracts/invoke_default_contract_violation_handler.md.nolink) | デフォルトcontract_violationハンドラー | C++26 | ## バージョン ### 言語 From 9e1eb89e0737202d8894289ea930ec68c9a0c0a4 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Wed, 30 Apr 2025 11:35:19 +0900 Subject: [PATCH 1617/3948] reference/algorithm/unique.md: Fixed format --- reference/algorithm/unique.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/reference/algorithm/unique.md b/reference/algorithm/unique.md index 8bb57b3bfa..84dfa2265c 100644 --- a/reference/algorithm/unique.md +++ b/reference/algorithm/unique.md @@ -100,7 +100,7 @@ int main() { // 入力の配列がソート済みではない場合、 // 隣り合った重複要素が取り除かれる { - std::vector v = { 2,5,3,3,1,2,4,2,1,1,4,4,3,3,3 }; + std::vector v = {2, 5, 3, 3, 1, 2, 4, 2, 1, 1, 4, 4, 3, 3, 3}; decltype(v)::iterator result = std::unique(v.begin(), v.end()); @@ -114,7 +114,7 @@ int main() { // 入力の配列がソート済みである場合、 // 重複している全ての要素が取り除かれて一意になる { - std::vector v = { 2,5,3,3,1,2,4,2,1,1,4,4,3,3,3 }; + std::vector v = {2, 5, 3, 3, 1, 2, 4, 2, 1, 1, 4, 4, 3, 3, 3}; std::sort(v.begin(), v.end()); decltype(v)::iterator result = std::unique(v.begin(), v.end()); @@ -143,14 +143,14 @@ ForwardIterator unique(ForwardIterator first, ForwardIterator last) { if (first == last) return first; auto result = first; - auto value = move(*first++); - for ( ; first != last; ++first) { + auto value = std::move(*first++); + for (; first != last; ++first) { if (!(value == *first)) { - *result++ = move(value); - value = move(*first); + *result++ = std::move(value); + value = std::move(*first); } } - *result++ = move(value); + *result++ = std::move(value); return result; } @@ -160,19 +160,19 @@ ForwardIterator unique(ForwardIterator first, ForwardIterator last, BinaryPredic if (first == last) return first; auto result = first; - auto value = move(*first++); - for ( ; first != last; ++first) { + auto value = std::move(*first++); + for (; first != last; ++first) { if (!pred(value, *first)) { - *result++ = move(value); - value = move(*first); + *result++ = std::move(value); + value = std::move(*first); } } - *result++ = move(value); + *result++ = std::move(value); return result; } ``` -* move[link /reference/utility/move.md] +* std::move[link /reference/utility/move.md] ## 参照 From ef7008fada72098bb59eb0a0a58b41fc6ebacc9b Mon Sep 17 00:00:00 2001 From: rotarymars Date: Wed, 30 Apr 2025 11:36:46 +0900 Subject: [PATCH 1618/3948] reference/algorithm/ranges_unique.md: Fixed format --- reference/algorithm/ranges_unique.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/algorithm/ranges_unique.md b/reference/algorithm/ranges_unique.md index 766202c785..f2d53382fa 100644 --- a/reference/algorithm/ranges_unique.md +++ b/reference/algorithm/ranges_unique.md @@ -90,7 +90,7 @@ int main() { // 入力の配列がソート済みではない場合、 // 隣り合った重複要素が取り除かれる { - std::vector v = { 2,5,3,3,1,2,4,2,1,1,4,4,3,3,3 }; + std::vector v = {2, 5, 3, 3, 1, 2, 4, 2, 1, 1, 4, 4, 3, 3, 3}; auto result = std::ranges::unique(v); @@ -104,7 +104,7 @@ int main() { // 入力の配列がソート済みである場合、 // 重複している全ての要素が取り除かれて一意になる { - std::vector v = { 2,5,3,3,1,2,4,2,1,1,4,4,3,3,3 }; + std::vector v = {2, 5, 3, 3, 1, 2, 4, 2, 1, 1, 4, 4, 3, 3, 3}; std::sort(v.begin(), v.end()); auto result = std::ranges::unique(v); From b2f44056652c98c0a92737ee7b3a35a3ffb74a8b Mon Sep 17 00:00:00 2001 From: rotarymars Date: Wed, 30 Apr 2025 12:09:00 +0900 Subject: [PATCH 1619/3948] reference/barrier/barrier.md: Created sample program --- reference/barrier/barrier.md | 78 ++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/reference/barrier/barrier.md b/reference/barrier/barrier.md index 82302258b6..f0e79b6b45 100644 --- a/reference/barrier/barrier.md +++ b/reference/barrier/barrier.md @@ -147,6 +147,84 @@ Worker#2 3 Main 3 ``` +## 完了関数を持つBarrierの例 +```cpp example +#include +#include +#include +#include +#include +#include +#include // for std::ref + +// 各フェーズ完了時に呼び出される完了関数 +struct PhaseNotifier { + void operator()() const noexcept { + std::lock_guard lk{cout_mtx}; + std::cout << "Phase " << current_phase << " completed!" << std::endl; + current_phase++; + } + + static inline std::mutex cout_mtx; + static inline int current_phase = 1; +}; + +void worker_task(int id, std::barrier& sync, int phases) { + for (int phase = 1; phase <= phases; phase++) { + // 各ワーカーがフェーズの作業を実行 + { + std::lock_guard lk{PhaseNotifier::cout_mtx}; + std::cout << "Worker " << id << " executing phase " << phase << std::endl; + } + + // フェーズ完了を通知して次のフェーズまで待機 + // 最後のスレッドが到達すると完了関数が呼び出される + sync.arrive_and_wait(); + } +} + +int main() { + constexpr int num_threads = 3; + constexpr int num_phases = 3; + + // 完了通知関数を持つバリア + std::barrier sync{num_threads, PhaseNotifier{}}; + + std::vector threads; + + // スレッド起動 + for (int i = 1; i <= num_threads; i++) { + threads.emplace_back(worker_task, i, std::ref(sync), num_phases); + } + + // 全スレッドの終了を待機 + for (auto& t : threads) { + t.join(); + } + + return 0; +} +``` +* std::barrier[color ff0000] +* std::ref[link /reference/functional/ref.md] +* arrive_and_wait()[link barrier/arrive_and_wait.md] +* emplace_back[link /reference/vector/vector/emplace_back.md] + +### 出力例 +``` +Worker 1 executing phase 1 +Worker 2 executing phase 1 +Worker 3 executing phase 1 +Phase 1 completed! +Worker 3 executing phase 2 +Worker 2 executing phase 2 +Worker 1 executing phase 2 +Phase 2 completed! +Worker 1 executing phase 3 +Worker 2 executing phase 3 +Worker 3 executing phase 3 +Phase 3 completed! +``` ## バージョン ### 言語 From 3fd522feb4f4290aa60d84afd81a99e973cd63a3 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Wed, 30 Apr 2025 12:44:23 +0900 Subject: [PATCH 1620/3948] reference/cctype/isalnum.md: Added extra info --- reference/cctype/isalnum.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reference/cctype/isalnum.md b/reference/cctype/isalnum.md index 0528d51a40..442338eea7 100644 --- a/reference/cctype/isalnum.md +++ b/reference/cctype/isalnum.md @@ -13,6 +13,8 @@ namespace std { ## 概要 `ch` が英数字かどうかを判定する(判定はロケールの影響を受ける)。 +`isalnum` は、`isalpha(ch) || isdigit(ch)` と等価である。つまり、英字(`isalpha`)または数字(`isdigit`)であれば `true` となる。 + ## 戻り値 `ch` が英数字と判定されれば非ゼロを、そうでなければゼロを返す。 From cd61c31f75cd4354c504d1df26a5c8fef0b8968d Mon Sep 17 00:00:00 2001 From: rotarymars Date: Wed, 30 Apr 2025 12:45:50 +0900 Subject: [PATCH 1621/3948] reference/cctype/isalnum.md: Added sample implementation --- reference/cctype/isalnum.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/reference/cctype/isalnum.md b/reference/cctype/isalnum.md index 442338eea7..d31d62a058 100644 --- a/reference/cctype/isalnum.md +++ b/reference/cctype/isalnum.md @@ -52,3 +52,10 @@ isalnum(' ') = 0 isalnum('\n') = 0 isalnum('0x0f') = 0 ``` + +## 実装例 +```cpp +int isalnum(int ch) { + return isalpha(ch) || isdigit(ch); +} +``` From 523d0361b161a612761b9a256fc4a54508c75d5e Mon Sep 17 00:00:00 2001 From: rotarymars Date: Wed, 30 Apr 2025 12:46:28 +0900 Subject: [PATCH 1622/3948] reference/cctype/isalpha.md: Added sample implementation --- reference/cctype/isalpha.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/reference/cctype/isalpha.md b/reference/cctype/isalpha.md index 3fce38668d..b35ade7996 100644 --- a/reference/cctype/isalpha.md +++ b/reference/cctype/isalpha.md @@ -50,3 +50,10 @@ isalpha(' ') = 0 isalpha('\n') = 0 isalpha('0x0f') = 0 ``` + +## 実装例 +```cpp +int isalpha(int ch) { + return isupper(ch) || islower(ch); +} +``` From b4204babddd86f3cb4f761da4c87e4f37dacccab Mon Sep 17 00:00:00 2001 From: rotarymars Date: Wed, 30 Apr 2025 12:46:57 +0900 Subject: [PATCH 1623/3948] reference/cctype/isblank.md: Added sample implementation --- reference/cctype/isblank.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/reference/cctype/isblank.md b/reference/cctype/isblank.md index 39871ad13e..613edddf7c 100644 --- a/reference/cctype/isblank.md +++ b/reference/cctype/isblank.md @@ -51,3 +51,10 @@ isblank(' ') = 1 isblank('\n') = 0 isblank('0x0f') = 0 ``` + +## 実装例 +```cpp +int isblank(int ch) { + return ch == ' ' || ch == '\t'; +} +``` From b9ee46005d9733b54c0598427d4cb4d0bc8320f5 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Wed, 30 Apr 2025 12:54:17 +0900 Subject: [PATCH 1624/3948] reference/cctype/isdigit.md: Created sample implementation --- reference/cctype/isdigit.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/reference/cctype/isdigit.md b/reference/cctype/isdigit.md index 995c1724ed..6ff4507bd7 100644 --- a/reference/cctype/isdigit.md +++ b/reference/cctype/isdigit.md @@ -50,3 +50,10 @@ isdigit(' ') = 0 isdigit('\n') = 0 isdigit('0x0f') = 0 ``` + +## 実装例 +```cpp +int isdigit(int ch) { + return ch >= '0' && ch <= '9'; +} +``` From 7f86fee6e3160f7956afa535ebd5db74a766b429 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Wed, 30 Apr 2025 12:54:32 +0900 Subject: [PATCH 1625/3948] reference/cctype/isgraph.md: Created sample implementation --- reference/cctype/isgraph.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/reference/cctype/isgraph.md b/reference/cctype/isgraph.md index a1176c7eb5..56dae2b16c 100644 --- a/reference/cctype/isgraph.md +++ b/reference/cctype/isgraph.md @@ -50,3 +50,10 @@ isgraph(' ') = 0 isgraph('\n') = 0 isgraph('0x0f') = 0 ``` + +## 実装例 +```cpp +int isgraph(int ch) { + return isprint(ch) && !isspace(ch); +} +``` \ No newline at end of file From 0b90e93337c0ebb0974fd235c6f159fbfca2a60f Mon Sep 17 00:00:00 2001 From: rotarymars Date: Wed, 30 Apr 2025 12:54:42 +0900 Subject: [PATCH 1626/3948] reference/cctype/islower.md: Created sample implementation --- reference/cctype/islower.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/reference/cctype/islower.md b/reference/cctype/islower.md index 5632c75d87..fc0bc99110 100644 --- a/reference/cctype/islower.md +++ b/reference/cctype/islower.md @@ -50,3 +50,11 @@ islower(' ') = 0 islower('\n') = 0 islower('0x0f') = 0 ``` + +## 実装例 +```cpp +int islower(int ch) { + return ch >= 'a' && ch <= 'z'; +} +``` + From 3ced67c5f10d44a1346212f75df58be45de7415a Mon Sep 17 00:00:00 2001 From: rotarymars Date: Wed, 30 Apr 2025 12:54:53 +0900 Subject: [PATCH 1627/3948] reference/cctype/ispunct.md: Created sample implementation --- reference/cctype/ispunct.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/reference/cctype/ispunct.md b/reference/cctype/ispunct.md index 4c44ffc4cb..aac33a38e0 100644 --- a/reference/cctype/ispunct.md +++ b/reference/cctype/ispunct.md @@ -50,3 +50,10 @@ ispunct(' ') = 0 ispunct('\n') = 0 ispunct('0x0f') = 0 ``` + +## 実装例 +```cpp +int ispunct(int ch) { + return isprint(ch) && !isalnum(ch); +} +``` \ No newline at end of file From 3527568f5c5f8c59b00f4ee03ae050d3ca62ebac Mon Sep 17 00:00:00 2001 From: rotarymars Date: Wed, 30 Apr 2025 12:55:02 +0900 Subject: [PATCH 1628/3948] reference/cctype/isspace.md: Created sample implementation --- reference/cctype/isspace.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/reference/cctype/isspace.md b/reference/cctype/isspace.md index 087dd8fc27..26a1e8f7f4 100644 --- a/reference/cctype/isspace.md +++ b/reference/cctype/isspace.md @@ -50,3 +50,12 @@ isspace(' ') = 8192 isspace('\n') = 8192 isspace('0x0f') = 0 ``` + +## 実装例 +```cpp +int isspace(int ch) { + return ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n' || ch == '\v' || ch == '\f'; +} +``` + + From 365685ee93e4305babfc88e3afc54804527e81dd Mon Sep 17 00:00:00 2001 From: rotarymars Date: Wed, 30 Apr 2025 12:55:14 +0900 Subject: [PATCH 1629/3948] reference/cctype/isupper.md: Created sample implementation --- reference/cctype/isupper.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/reference/cctype/isupper.md b/reference/cctype/isupper.md index 26b29e1f7b..340872faf8 100644 --- a/reference/cctype/isupper.md +++ b/reference/cctype/isupper.md @@ -50,3 +50,11 @@ isupper(' ') = 0 isupper('\n') = 0 isupper('0x0f') = 0 ``` + +## 実装例 +```cpp +int isupper(int ch) { + return ch >= 'A' && ch <= 'Z'; +} +``` + From 3b77b17e0ac396592a2bb77e481fc85edabf695d Mon Sep 17 00:00:00 2001 From: rotarymars Date: Wed, 30 Apr 2025 12:55:34 +0900 Subject: [PATCH 1630/3948] reference/cctype/tolower.md: Created sample implementation --- reference/cctype/tolower.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/reference/cctype/tolower.md b/reference/cctype/tolower.md index 838d96ba00..88da612c6b 100644 --- a/reference/cctype/tolower.md +++ b/reference/cctype/tolower.md @@ -42,3 +42,14 @@ tolower('1') = 1 tolower('.') = . tolower('$') = $ ``` + +## 実装例 +```cpp +int tolower(int ch) { + if (isupper(ch)) { + ch ^= 32 + } + return ch; +} +``` + From 665471d98e7999f8c2ab6af4ba0060ce9fb17491 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Wed, 30 Apr 2025 12:56:05 +0900 Subject: [PATCH 1631/3948] reference/cctype/toupper.md: Created sample implementation --- reference/cctype/toupper.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/reference/cctype/toupper.md b/reference/cctype/toupper.md index b484464591..ca21a56521 100644 --- a/reference/cctype/toupper.md +++ b/reference/cctype/toupper.md @@ -42,3 +42,13 @@ toupper('1') = 1 toupper('.') = . toupper('$') = $ ``` + +## 実装例 +```cpp +int toupper(int ch) { + if (islower(ch)) { + ch ^= 32; + } + return ch; +} +``` From 88bcec60be484f0fe088f6211913885253221050 Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 30 Apr 2025 14:29:54 +0900 Subject: [PATCH 1632/3948] =?UTF-8?q?execution:=20run=5Floop=E5=85=A8?= =?UTF-8?q?=E3=83=A1=E3=83=B3=E3=83=90=20(#1384)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../execution/execution/completion-domain.md | 4 +- reference/execution/execution/run_loop.md | 52 ++++---- .../execution/execution/run_loop/finish.md | 65 ++++++++++ .../execution/run_loop/op_destructor.md | 10 +- .../execution/run_loop/run-loop-opstate.md | 74 +++++++++++ .../execution/run_loop/run-loop-scheduler.md | 4 +- .../execution/run_loop/run-loop-sender.md | 3 +- reference/execution/execution/run_loop/run.md | 119 ++++++++++++++++++ reference/execution/execution/schedule.md | 4 +- reference/execution/execution/sender_in.md | 2 +- 10 files changed, 303 insertions(+), 34 deletions(-) create mode 100644 reference/execution/execution/run_loop/finish.md create mode 100644 reference/execution/execution/run_loop/run-loop-opstate.md create mode 100644 reference/execution/execution/run_loop/run.md diff --git a/reference/execution/execution/completion-domain.md b/reference/execution/execution/completion-domain.md index 70eb1a6ac7..3d4aade361 100644 --- a/reference/execution/execution/completion-domain.md +++ b/reference/execution/execution/completion-domain.md @@ -11,14 +11,14 @@ constexpr auto completion-domain(const Sndr& sndr) noexcept; * default_domain[link default_domain.md] ## 概要 -[Sender型](sender.md)`sndr`の[完了Scheduler](get_completion_scheduler.md)から[実行ドメイン](default_domain.md)を取得する説明専用の関数テンプレート。 +[Sender](sender.md)`sndr`の[完了Scheduler](get_completion_scheduler.md)から[実行ドメイン](default_domain.md)を取得する説明専用の関数テンプレート。 ## 効果 説明用の型`COMPL-DOMAIN(T)`を式[`get_domain`](get_domain.md)`(`[`get_completion_scheduler`](get_completion_scheduler.md)`(`[`get_env`](get_env.md)`(sndr)))`の型とする。 - 型`COMPL-DOMAIN(`[`set_value_t`](set_value.md)`)`、`COMPL-DOMAIN(`[`set_error_t`](set_error.md)`)`、`COMPL-DOMAIN(`[`set_stopped_t`](set_stopped.md)`)`の全てが不適格の場合、`completion-domain`は`Default`型のデフォルト構築されたprvalueとなる。 -- そうではなく、上記のうち不適格となる型を除いた型が[共通型](/reference/type_traits/common_type.md)を共有するならば、`completion-domain`はその共有型のデフォルト構築されたprvalueとなる。 +- そうではなく、上記のうち不適格となる型を除いた型が[共通型](/reference/type_traits/common_type.md)を共有するならば、`completion-domain`はその共通型のデフォルト構築されたprvalueとなる。 - そうでなければ、`completion-domain`は不適格となる。 diff --git a/reference/execution/execution/run_loop.md b/reference/execution/execution/run_loop.md index 4ed815e629..1d469bf4dd 100644 --- a/reference/execution/execution/run_loop.md +++ b/reference/execution/execution/run_loop.md @@ -14,12 +14,12 @@ namespace std::execition { `run_loop`は、実行制御ライブラリの作業を[スケジュール](schedule.md)可能な実行リソース(execution resource)である。 内部的にスレッドセーフなFIFO (first-in first-out) 作業キューを保持する。 -[`run`メンバ関数](run_loop/run.md.nolink)はキューから作業を取り出し、同関数を呼び出したスレッド上のループで実行する。 +[`run`メンバ関数](run_loop/run.md)はキューから作業を取り出し、同関数を呼び出したスレッド上のループで実行する。 `run_loop`インスタンスの動作説明のため、下記の説明用メンバ変数を持つ。 -- `count` : FIFOキューが保持する作業の個数 -- `state` : 開始(starting)/実行中(running)/完了中(finishing)/完了済み(finished) いずれかのインスタンス状態 +- `count` : キュー上に保持している作業の個数 +- `state` : [開始(starting)](run_loop/op_constructor.md)/[実行中(running)](run_loop/run.md)/[終了中(finishing)](run_loop/finish.md)/[終了済み(finished)](run_loop/run.md) いずれかの状態 ## メンバ関数 @@ -29,20 +29,22 @@ namespace std::execition { | [`(constructor)`](run_loop/op_constructor.md) | コンストラクタ | C++26 | | [`(destructor)`](run_loop/op_destructor.md) | デストラクタ | C++26 | | [`get_scheduler`](run_loop/get_scheduler.md) | Scheduler取得 | C++26 | -| [`run`](run_loop/run.md.nolink) | ループ実行を開始 | C++26 | -| [`finish`](run_loop/finish.md.nolink) | ループ実行を終了 | C++26 | +| [`run`](run_loop/run.md) | キュー上の作業を逐次実行 | C++26 | +| [`finish`](run_loop/finish.md) | 状態を終了中に変更 | C++26 | ## 説明専用のメンバ型 | 名前 | 説明 | 対応バージョン | |------|------|-------| -| [`run-loop-scheduler`](run_loop/run-loop-scheduler.md) | 説明専用クラス | C++26 | -| [`run-loop-sender`](run_loop/run-loop-sender.md) | 説明専用クラス | C++26 | -| [`run-loop-opstate`](run_loop/run-loop-opstate.md.nolink) | 説明専用クラス | C++26 | +| [`run-loop-scheduler`](run_loop/run-loop-scheduler.md) | 動作説明用の[Scheduler型](scheduler.md) | C++26 | +| [`run-loop-sender`](run_loop/run-loop-sender.md) | 動作説明用の[Sender型](sender.md) | C++26 | +| [`run-loop-opstate-base`](run_loop/run-loop-opstate.md) | 動作説明用の基底クラス | C++26 | +| [`run-loop-opstate`](run_loop/run-loop-opstate.md) | 動作説明用のクラステンプレート | C++26 | ## 例 ```cpp example +#include #include namespace ex = std::execution; @@ -50,33 +52,36 @@ struct MyReceiver { using receiver_concept = ex::receiver_t; void set_value() noexcept - { std::println("value"); } + { std::println("success"); } void set_error(std::exception_ptr) noexcept - { std::println("error"); } + { std::println("failure"); } void set_stopped() noexcept - { std::println("stopped"); } + { std::println("cancellation"); } }; int main() { - // run_loopのスケジュールSenderを取得 ex::run_loop loop; - ex::scheduler auto sch = loop.get_scheduler(); - // state:開始(starting) + // count=0, state=開始(starting) + // run_loopのスケジュールSenderとReceiverを接続 + ex::scheduler auto sch = loop.get_scheduler(); ex::sender auto sndr = ex::schedule(sch); ex::receiver auto rcvr = MyReceiver{}; - ex::operation_state auto op = ex::connect(sndr, rcvr); - // キューに作業を1つ追加 + auto op = ex::connect(sndr, rcvr); + + // run_loopキューに作業を1つ追加 ex::start(op); + // count=1, state=開始(starting) - // stateを完了中(finished)へ遷移 + // run_loop状態を終了中(finished)へ変更 loop.finish(); + // count=1, state=終了中(finished) - // キュー上の作業を全て処理 + // run_loopキュー上の作業を逐次実行 loop.run(); - // state:完了済み(finished) + // count=0, state=終了済み(finished) } ``` * ex::run_loop[color ff0000] @@ -85,16 +90,15 @@ int main() * ex::schedule[link schedule.md] * ex::receiver[link receiver.md] * ex::receiver_t[link receiver.md] -* ex::operation_state[link operation_state.md] * ex::connect[link connect.md] * ex::start[link start.md] * get_scheduler()[link run_loop/get_scheduler.md] -* finish()[link run_loop/finish.md.nolink] -* run()[link run_loop/run.md.nolink] +* finish()[link run_loop/finish.md] +* run()[link run_loop/run.md] ### 出力 ``` -value +success ``` @@ -110,7 +114,7 @@ value ## 関連項目 -- [`execution::schedule`](schedule.md) +- [`execution::scheduler`](scheduler.md) ## 参照 diff --git a/reference/execution/execution/run_loop/finish.md b/reference/execution/execution/run_loop/finish.md new file mode 100644 index 0000000000..45565054a1 --- /dev/null +++ b/reference/execution/execution/run_loop/finish.md @@ -0,0 +1,65 @@ +# finish +* execution[meta header] +* std::execution[meta namespace] +* run_loop[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +void finish(); +``` + +## 概要 +`run_loop`の状態を終了中(finishing)へ変更する。 + + +## 事前条件 +説明専用メンバ`state`は[開始(starting)](op_constructor.md)もしくは[実行中(running)](run.md)であること。 + + +## 効果 +説明専用メンバ`state`を終了中(finishing)に変更する。 + + +## 同期操作 +メンバ関数`finish`および説明専用メンバ関数[`pop-front`, `push-back`](run.md)は不可分(atomically)に実行される。 + +`finish`は、`nullptr`を返す[`pop-front`操作](run.md)に対して同期する。 + + +## 例 +```cpp example +#include +namespace ex = std::execution; + +int main() +{ + ex::run_loop loop; + loop.finish(); +} +``` +* finish()[color ff0000] +* ex::run_loop[link ../run_loop.md] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++26 + + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`run`](run.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/run_loop/op_destructor.md b/reference/execution/execution/run_loop/op_destructor.md index 85c59fbe37..4c948e1efe 100644 --- a/reference/execution/execution/run_loop/op_destructor.md +++ b/reference/execution/execution/run_loop/op_destructor.md @@ -10,12 +10,16 @@ ``` ## 概要 -`run_loopオブジェクトを破棄する。 +`run_loop`オブジェクトを破棄する。 ## 効果 -`count`が非`0`かつ`state`が実行中(running)のとき、[`terminate`](/reference/exception/terminate.md)を呼び出す。 -それ以外のときは、効果を持たない。 +`count`が非`0`かつ`state`が[実行中(running)](run.md)のとき、[`terminate`](/reference/exception/terminate.md)を呼び出してプログラムを異常終了させる。 +それ以外のとき、効果を持たない。 + + +## 同期操作 +[`run`](run.md)とデストラクタ以外のメンバ関数同時呼び出しは、データ競合を引き起こさない。 ## バージョン diff --git a/reference/execution/execution/run_loop/run-loop-opstate.md b/reference/execution/execution/run_loop/run-loop-opstate.md new file mode 100644 index 0000000000..48d7ebd1c8 --- /dev/null +++ b/reference/execution/execution/run_loop/run-loop-opstate.md @@ -0,0 +1,74 @@ +# run-loop-opstate +* execution[meta header] +* std::execution[meta namespace] +* run_loop[meta class] +* class template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +struct run-loop-opstate; +``` + +## 概要 +`run-loop-opstate`は、[`run_loop`](../run_loop.md)動作説明で利用される説明専用のクラスである。 + + +## クラス仕様 +説明専用の基底クラス`run-loop-opstate-base`を下記の通り定義する。 +`run-loop-opstate`は、`run-loop-opstate-base`から曖昧さなくprivate継承したクラスである。 + +```cpp +struct run-loop-opstate-base { // exposition only + virtual void execute() = 0; // exposition only + run_loop* loop; // exposition only + run-loop-opstate-base* next; // exposition only +}; +``` +* run_loop[link ../run_loop.md] + +説明用の`o`を`run-loop-opstate`型の非const左辺値、`REC(o)`を`o`を返す[接続(connect)](../connect.md)呼び出しへ渡した式`rcvr`で初期化された`Rcvr`型の非const左辺値参照とする。 + +- `REC(o)`が参照するオブジェクトは、`o`が参照するオブジェクトの生存期間(lifetime)で有効である。 +- 型`run-loop-opstate`は`run-loop-opstate-base::execute()`をオーバーライドし、式`o.execute()`は下記と等価 : + + ```cpp + if (get_stop_token(REC(o)).stop_requested()) { + set_stopped(std::move(REC(o))); + } else { + set_value(std::move(REC(o))); + } + ``` + * get_stop_token[link ../../get_stop_token.md] + * set_stopped[link ../set_stopped.md] + * set_value[link ../set_value.md] + * std::move[link /reference/utility/move.md] + +- 式`start(o)`は下記と等価 : + + ```cpp + try { + o.loop->push-back(addressof(o)); + } catch(...) { + set_error(std::move(REC(o)), current_exception()); + } + ``` + * push-back[link run.md] + * set_error[link ../set_value.md] + * addressof[link /reference/memory/addressof.md] + * std::move[link /reference/utility/move.md] + * current_exception()[link /reference/exception/current_exception.md] + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`run`](run.md) +- [`execution::start`](../start.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/run_loop/run-loop-scheduler.md b/reference/execution/execution/run_loop/run-loop-scheduler.md index dce6681d5b..a1b154a041 100644 --- a/reference/execution/execution/run_loop/run-loop-scheduler.md +++ b/reference/execution/execution/run_loop/run-loop-scheduler.md @@ -12,9 +12,11 @@ class run-loop-scheduler; // exposition only ## 概要 `run-loop-scheduler`は、[`get_scheduler`メンバ関数](get_scheduler.md)の戻り値型として利用される説明専用のクラスである。 + +## クラス仕様 - `run-loop-scheduler`型は[`scheduler`](../scheduler.md)のモデルとなる未規定の型。 - `run-loop-scheduler`インスタンスは、同インスタンスを取得した[`run_loop`](../run_loop.md)インスタンスの生存期間(lifetime)終了まで有効。 -- 2個の`run-loop-scheduler`インスタンスは、[`run_loop`](../run_loop.md)インスタンスから取得された場合に限って等しい。 +- 2個の`run-loop-scheduler`インスタンスは、同一[`run_loop`](../run_loop.md)インスタンスから取得された場合に限って等しい。 - 説明用の式`sch`の型が`run-loop-scheduler`であるとき、式[`schedule`](../schedule.md)`(sch)`は型[`run-loop-sender`](run-loop-sender.md)となり、式`sch`が潜在的に例外送出しない(not potentially-throwing)ならばそれに従う。 diff --git a/reference/execution/execution/run_loop/run-loop-sender.md b/reference/execution/execution/run_loop/run-loop-sender.md index 1ee6fa6ade..24f642fed3 100644 --- a/reference/execution/execution/run_loop/run-loop-sender.md +++ b/reference/execution/execution/run_loop/run-loop-sender.md @@ -12,11 +12,12 @@ class run-loop-sender; // exposition only ## 概要 `run-loop-sender`は、[`get_scheduler`メンバ関数](get_scheduler.md)が返す[`run-loop-scheduler`](run-loop-scheduler.md)動作仕様の説明で利用される説明専用のクラスである。 +## クラス仕様 - `run-loop-sender`型は[`sender`](../sender.md)のモデルである。 - 任意の型`Env`に対して、[`completion_signatures_of_t`](../completion_signatures_of_t.md)``は[`completion_signatures`](../completion_signatures.md)`<`[`set_value_t`](../set_value.md)`(),` [`set_error_t`](../set_error.md)`(`[`exception_ptr`](/reference/exception/exception_ptr.md)`),` [`set_stopped_t`](../set_stopped.md)`()>` - `run-loop-sender`インスタンスは、関連付けられた[`run_loop`](../run_loop.md)インスタンスの生存期間(lifetime)終了まで有効。 - 説明用の式`sndr`の型を`run-loop-sender`、`CS`が上記[`completion_signatures`](../completion_signatures.md)の特殊化であるとき[`receiver_of`](../receiver_of.md)``が`true`となる式`rcvr`としたとき、 - - 式[`connect`](../connect.md)`(sndr, rcvr)`の型は[`run-loop-opstate`](run-loop-opstate.md.nolink)`<`[`decay_t`](/reference/type_traits/decay.md)`>`であり、潜在的な例外送出(potentially-throwing)は式`(void(sndr), auto(rcvr))`に従う。 + - 式[`connect`](../connect.md)`(sndr, rcvr)`の型は[`run-loop-opstate`](run-loop-opstate.md)`<`[`decay_t`](/reference/type_traits/decay.md)`>`であり、潜在的な例外送出(potentially-throwing)は式`(void(sndr), auto(rcvr))`に従う。 - 完了タグ`C`を[`set_value_t`](../set_value.md)または[`set_stopped_t`](../set_stopped.md)としたとき、式[`get_completion_scheduler`](../get_completion_scheduler.md)`(`[`get_env`](../get_env.md)`(sndr))`の潜在的な例外送出は`sndr`に従う。式の型は[`run-loop-scheduler`](run-loop-scheduler.md)となり、そのインスタンスは同一`sndr`から取得された場合に等しくなる。 diff --git a/reference/execution/execution/run_loop/run.md b/reference/execution/execution/run_loop/run.md new file mode 100644 index 0000000000..6519680ca8 --- /dev/null +++ b/reference/execution/execution/run_loop/run.md @@ -0,0 +1,119 @@ +# run +* execution[meta header] +* std::execution[meta namespace] +* run_loop[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +void run(); +``` + +## 概要 +`run_loop`のFIFOキュー上にある作業を逐次実行する。 + +`run_loop`動作説明のため、説明専用のメンバ関数`pop-front`, `push-back`を導入する。 +[`finish`](finish.md)および`pop-front`, `push-back`は不可分(atomically)に実行される。 + + +### 説明専用メンバ関数 `pop-front` + +```cpp +run-loop-opstate-base* pop-front(); +``` +* run-loop-opstate-base[link run-loop-opstate.md] + +効果 : 下記条件のいずれか一つが`true`になるまでブロックする。 + +- `count == 0`かつ`state`が[終了中(finishing)](finish.md)のとき、`pop-front`は`state`を終了済み(finished)に設定して`nullptr`を返す。 +- `count > 0`のとき、`count`を`1`減算してFIFOキューから先頭要素を削除し、同要素(ポインタ値)を返す。 + + +### 説明専用メンバ関数 `push-back` + +```cpp +void push-back(run-loop-opstate-base* item); +``` +* run-loop-opstate-base[link run-loop-opstate.md] + +効果 : FIFOキューの末尾に`item`を追加して`count`を`1`加算する。 + +同期操作 : この操作は同`item`を取得する`pop-front`操作に対して同期する。 + + +## 事前条件 +説明専用メンバ`state`は[開始(starting)](op_constructor.md)もしくは[終了中(finishing)](finish.md)であること。 + + +## 効果 +説明専用メンバ`state`が[開始(starting)](op_constructor.md)の場合、実行中(running)に変更する。 +そうでなければ、`state`を変更しない。 + +続いて、以下と等価 : + +```cpp +while (auto* op = pop-front()) { + op->execute(); +} +``` +* execute()[link run-loop-opstate.md] + + +## 同期操作 +`run`と[デストラクタ](op_destructor.md)以外のメンバ関数同時呼び出しは、データ競合を引き起こさない。 + + +## 例 +```cpp example +#include +#include +#include +namespace ex = std::execution; + +int main() +{ + ex::run_loop loop; + std::println("starting"); + + std::jthread th([&]{ + // 2) 別スレッドからfinishを呼び出し + std::println("finishing"); + loop.finish(); + }); + + // 1) メインスレッド上でrunを呼び出すとブロッキングする + loop.run(); + // 3) ブロッキング解除されてメインスレッドを再開 + std::println("finished"); +} +``` +* run()[color ff0000] +* ex::run_loop[link ../run_loop.md] +* finish()[link finish.md] +* std::jthread[link /reference/thread/jthread.md] + +### 出力 +``` +starting +finishing +finished +``` + +## バージョン +### 言語 +- C++26 + + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`finish`](finish.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/schedule.md b/reference/execution/execution/schedule.md index f6557e1661..f112291e5e 100644 --- a/reference/execution/execution/schedule.md +++ b/reference/execution/execution/schedule.md @@ -66,8 +66,8 @@ int main() * ex::then[link then.md.nolink] * ex::run_loop[link run_loop.md] * get_scheduler()[link run_loop/get_scheduler.md] -* run()[link run_loop/run.md.nolink] -* finish()[link run_loop/finish.md.nolink] +* run()[link run_loop/run.md] +* finish()[link run_loop/finish.md] * std::move[link /reference/utility/move.md] * std::jthread[link /reference/thread/jthread.md] * std::this_thread::get_id()[link /reference/thread/this_thread/get_id.md] diff --git a/reference/execution/execution/sender_in.md b/reference/execution/execution/sender_in.md index 52a2293d5c..bb725c8380 100644 --- a/reference/execution/execution/sender_in.md +++ b/reference/execution/execution/sender_in.md @@ -31,7 +31,7 @@ namespace std::execution { ある完了操作の完了シグネチャが[`completion_signatures_of_t`](completion_signatures_of_t.md)``で取得される[`completion_signatures`](completion_signatures.md)リストに含まれるとき、`Sndr`と`Env`における許容可能完了(permissible completion)となる。 -`sndr`と`rcvr`の[接続](connect.md)後に[Operation State](operation_state.md)を開始することで評価されうる完了操作が、全て許容可能完了(permissible completion)である場合、`Sndr`と`Env`は`sender_in`のモデルとなる。 +`sndr`と`rcvr`の[接続(connect)](connect.md)後に[Operation State](operation_state.md)を開始することで評価されうる完了操作が、全て許容可能完了(permissible completion)である場合、`Sndr`と`Env`は`sender_in`のモデルとなる。 ## 例 From e6b7e2cfbe40cd345f07d28f060da229a653766d Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 30 Apr 2025 18:09:00 +0900 Subject: [PATCH 1633/3948] =?UTF-8?q?execution/run=5Floop:=20=E5=BE=AE?= =?UTF-8?q?=E8=AA=BF=E6=95=B4=20(#1384)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/execution/execution/run_loop.md | 5 ++-- .../execution/execution/run_loop/finish.md | 1 + .../execution/run_loop/get_scheduler.md | 26 +++++++++++++++++++ .../execution/run_loop/run-loop-opstate.md | 1 + .../execution/run_loop/run-loop-sender.md | 1 + reference/execution/execution/run_loop/run.md | 1 + 6 files changed, 33 insertions(+), 2 deletions(-) diff --git a/reference/execution/execution/run_loop.md b/reference/execution/execution/run_loop.md index 1d469bf4dd..e87534f35a 100644 --- a/reference/execution/execution/run_loop.md +++ b/reference/execution/execution/run_loop.md @@ -14,7 +14,7 @@ namespace std::execition { `run_loop`は、実行制御ライブラリの作業を[スケジュール](schedule.md)可能な実行リソース(execution resource)である。 内部的にスレッドセーフなFIFO (first-in first-out) 作業キューを保持する。 -[`run`メンバ関数](run_loop/run.md)はキューから作業を取り出し、同関数を呼び出したスレッド上のループで実行する。 +[`run`メンバ関数](run_loop/run.md)はキューから作業を順次取り出し、同関数を呼び出すスレッド上で逐次実行する。 `run_loop`インスタンスの動作説明のため、下記の説明用メンバ変数を持つ。 @@ -32,7 +32,7 @@ namespace std::execition { | [`run`](run_loop/run.md) | キュー上の作業を逐次実行 | C++26 | | [`finish`](run_loop/finish.md) | 状態を終了中に変更 | C++26 | -## 説明専用のメンバ型 +## メンバ型 | 名前 | 説明 | 対応バージョン | |------|------|-------| @@ -119,3 +119,4 @@ success ## 参照 - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3396R1 std::execution wording fixes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3396r1.html) diff --git a/reference/execution/execution/run_loop/finish.md b/reference/execution/execution/run_loop/finish.md index 45565054a1..fe72b5e9a0 100644 --- a/reference/execution/execution/run_loop/finish.md +++ b/reference/execution/execution/run_loop/finish.md @@ -63,3 +63,4 @@ int main() ## 参照 - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3396R1 std::execution wording fixes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3396r1.html) diff --git a/reference/execution/execution/run_loop/get_scheduler.md b/reference/execution/execution/run_loop/get_scheduler.md index 462704953a..ba9707d1f4 100644 --- a/reference/execution/execution/run_loop/get_scheduler.md +++ b/reference/execution/execution/run_loop/get_scheduler.md @@ -20,6 +20,8 @@ run-loop-scheduler get_scheduler(); ## 例 ```cpp example +#include +#include #include namespace ex = std::execution; @@ -27,11 +29,34 @@ int main() { ex::run_loop loop; ex::scheduler auto sch = loop.get_scheduler(); + + // スケジュールSenderを作成 + ex::sender auto sndr = ex::schedule(sch); + + // スケジュールSenderの完了シグネチャ集合を確認 + auto sigs = ex::get_completion_signatures(sndr); + static_assert(std::same_as>); + + // スケジュールSender属性の値完了スケジューラを確認 + auto compl_sch = ex::get_completion_scheduler(ex::get_env(sndr)); + assert(compl_sch == sch); } ``` * get_scheduler()[color ff0000] * ex::run_loop[link ../run_loop.md] * ex::scheduler[link ../scheduler.md] +* ex::sender[link ../sender.md] +* ex::schedule[link ../schedule.md] +* ex::get_completion_signatures[link ../get_completion_signatures.md] +* ex::completion_signatures[link ../completion_signatures.md] +* ex::set_value_t[link ../set_value.md] +* ex::set_error_t[link ../set_error.md] +* ex::set_stopped_t[link ../set_stopped.md] +* ex::get_completion_scheduler[link ../get_completion_scheduler.md] +* ex::get_env[link ../get_env.md] ### 出力 ``` @@ -51,6 +76,7 @@ int main() ## 関連項目 - [`run-loop-scheduler`](run-loop-scheduler.md) +- [`run-loop-sender`](run-loop-sender.md) - [`execution::schedule`](../schedule.md) diff --git a/reference/execution/execution/run_loop/run-loop-opstate.md b/reference/execution/execution/run_loop/run-loop-opstate.md index 48d7ebd1c8..fb631d0513 100644 --- a/reference/execution/execution/run_loop/run-loop-opstate.md +++ b/reference/execution/execution/run_loop/run-loop-opstate.md @@ -67,6 +67,7 @@ struct run-loop-opstate-base { // exposition only ## 関連項目 - [`run`](run.md) +- [`execution::connect`](../connect.md) - [`execution::start`](../start.md) diff --git a/reference/execution/execution/run_loop/run-loop-sender.md b/reference/execution/execution/run_loop/run-loop-sender.md index 24f642fed3..65937e3ef8 100644 --- a/reference/execution/execution/run_loop/run-loop-sender.md +++ b/reference/execution/execution/run_loop/run-loop-sender.md @@ -27,6 +27,7 @@ class run-loop-sender; // exposition only ## 関連項目 +- [`get_scheduler`](get_scheduler.md) - [`run-loop-scheduler`](run-loop-scheduler.md) - [`execution::sender`](../sender.md) diff --git a/reference/execution/execution/run_loop/run.md b/reference/execution/execution/run_loop/run.md index 6519680ca8..3c79708711 100644 --- a/reference/execution/execution/run_loop/run.md +++ b/reference/execution/execution/run_loop/run.md @@ -117,3 +117,4 @@ finished ## 参照 - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3396R1 std::execution wording fixes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3396r1.html) From 2a210a5f43b9423bd5ed8e8e7f415953d99fd29d Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 1 May 2025 16:59:53 +0900 Subject: [PATCH 1634/3948] execution: sync_wait(_with_variant) (#1384) --- reference/execution/execution.md | 4 +- .../execution/execution/completion-domain.md | 2 +- .../execution/execution/get-domain-early.md | 46 ++++++ .../execution/execution/get-domain-late.md | 10 +- reference/execution/this_thread.md | 23 +++ .../execution/this_thread/sync-wait-env.md | 45 ++++++ .../this_thread/sync-wait-receiver.md | 105 +++++++++++++ reference/execution/this_thread/sync_wait.md | 144 ++++++++++++++++++ .../this_thread/sync_wait_with_variant.md | 135 ++++++++++++++++ 9 files changed, 506 insertions(+), 8 deletions(-) create mode 100644 reference/execution/execution/get-domain-early.md create mode 100644 reference/execution/this_thread.md create mode 100644 reference/execution/this_thread/sync-wait-env.md create mode 100644 reference/execution/this_thread/sync-wait-receiver.md create mode 100644 reference/execution/this_thread/sync_wait.md create mode 100644 reference/execution/this_thread/sync_wait_with_variant.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 5501c1ee10..18549d3203 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -133,8 +133,8 @@ namespace std::execution { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`this_thread::sync_wait`](this_thread/sync_wait.md.nolink) | 現在のスレッド上でSender完了を待機 (customization point object) | C++26 | -| [`this_thread::sync_wait_with_variant`](this_thread/sync_wait_with_variant.md.nolink) | 現在のスレッド上でSender完了を待機 (customization point object) | C++26 | +| [`this_thread::sync_wait`](this_thread/sync_wait.md) | 現在のスレッド上でSender完了を待機 (customization point object) | C++26 | +| [`this_thread::sync_wait_with_variant`](this_thread/sync_wait_with_variant.md) | 現在のスレッド上でSender完了を待機 (customization point object) | C++26 | Senderコンシューマは名前空間 `std::this_thread` で定義される。 diff --git a/reference/execution/execution/completion-domain.md b/reference/execution/execution/completion-domain.md index 3d4aade361..2d83422caf 100644 --- a/reference/execution/execution/completion-domain.md +++ b/reference/execution/execution/completion-domain.md @@ -32,7 +32,7 @@ constexpr auto completion-domain(const Sndr& sndr) noexcept; ## 関連項目 -- [`get-domain-early`](get-domain-early.md.nolink) +- [`get-domain-early`](get-domain-early.md) - [`get-domain-late`](get-domain-late.md) diff --git a/reference/execution/execution/get-domain-early.md b/reference/execution/execution/get-domain-early.md new file mode 100644 index 0000000000..cb28411999 --- /dev/null +++ b/reference/execution/execution/get-domain-early.md @@ -0,0 +1,46 @@ +# get-domain-early +* execution[meta header] +* function template[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +template +constexpr auto get-domain-early(const Sndr& sndr) noexcept; +``` + +## 概要 +[Sender](sender.md)アルゴリズム構築時のカスタマイゼーションポイントとして、[実行ドメイン](default_domain.md)を取得する説明専用の関数テンプレート。 + +下記の優先順で実行ドメインを検索し、最初に妥当となる型を採用する。 + +- Senderの[属性](../queryable.md)の実行ドメイン +- Senderの[完了Scheduler](get_completion_scheduler.md)の実行ドメイン +- [デフォルト実行ドメイン](default_domain.md) + + +## 効果 +説明用の型`Domain`を下記リストのうち最初に妥当となる式の型と定義したとき、`return Doamin();`と等価。 + +- [`get_domain`](get_domain.md)`(`[`get_env`](get_env.md)`(sndr))` +- [`completion-domain`](completion-domain.md)`(sndr)` +- [`default_domain()`](default_domain.md) + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`this_thread::sync_wait`](../this_thread/sync_wait.md) +- [`this_thread::sync_wait_with_variant`](../this_thread/sync_wait_with_variant.md) + + +## 参照 +- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/get-domain-late.md b/reference/execution/execution/get-domain-late.md index 19daa05a98..359031a6ba 100644 --- a/reference/execution/execution/get-domain-late.md +++ b/reference/execution/execution/get-domain-late.md @@ -15,11 +15,11 @@ constexpr auto get-domain-late(const Sndr& sndr, const Env& env) noexcept; 下記の優先順で実行ドメインを検索し、最初に妥当となる型を採用する。 (Senderアルゴリズム[`continue_on`](continue_on.md.nolink)のみ引数に指定した[Scheduler](scheduler.md)から取得。) -- Senderの[属性](../queryable.md) -- Senderの[完了Scheduler](get_completion_scheduler.md) -- Receiverの[環境](../queryable.md) -- Receiver環境の[Scheduler](scheduler.md) -- [`default_domain`](default_domain.md) +- Senderの[属性](../queryable.md)の実行ドメイン +- Senderの[完了Scheduler](get_completion_scheduler.md)の実行ドメイン +- Receiverの[環境](../queryable.md)の実行ドメイン +- Receiver環境の[Scheduler](scheduler.md)の実行ドメイン +- [デフォルト実行ドメイン](default_domain.md) ## 効果 diff --git a/reference/execution/this_thread.md b/reference/execution/this_thread.md new file mode 100644 index 0000000000..dfa4cee962 --- /dev/null +++ b/reference/execution/this_thread.md @@ -0,0 +1,23 @@ +# this_thread +* execution[meta header] +* std[meta namespace] +* namespace[meta id-type] +* cpp26[meta cpp] + +ヘッダ [``](../execution.md) の名前空間 `std::this_thread` では、実行制御ライブラリの一部エンティティを定義する。 + +```cpp +namespace std::this_thread { + … +} +``` + +実行制御ライブラリ全体は名前空間 [`std::execution`](../execution/execution.md) ページを参照のこと。 + + +## バージョン +### 言語 +- C++26 + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/this_thread/sync-wait-env.md b/reference/execution/this_thread/sync-wait-env.md new file mode 100644 index 0000000000..2d6ff12773 --- /dev/null +++ b/reference/execution/this_thread/sync-wait-env.md @@ -0,0 +1,45 @@ +# sync-wait-env +* execution[meta header] +* class template[meta id-type] +* std::this_thread[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::this_thread { + struct sync-wait-env { + execution::run_loop* loop; // exposition only + + auto query(execution::get_scheduler_t) const noexcept { + return loop->get_scheduler(); + } + + auto query(execution::get_delegation_scheduler_t) const noexcept { + return loop->get_scheduler(); + } + }; +} +``` +* execution::run_loop[link ../execution/run_loop.md] +* execution::get_scheduler_t[link ../execution/get_scheduler.md] +* execution::get_delegation_scheduler_t[link ../execution/get_delegation_scheduler.md] +* get_scheduler()[link ../execution/run_loop/get_scheduler.md] + +## 概要 +`sync-wait-env`は、実行制御ライブラリの仕様定義で用いられる説明専用のクラステンプレートである。 + +Senderコンシューマ[`sync_wait`](sync_wait.md)、[`sync_wait_with_variant`](sync_wait_with_variant.md)動作において[Receiver](../execution/receiver.md)の[環境](../queryable.md)として利用される。 + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`this_thread::sync_wait`](sync_wait.md) +- [`this_thread::sync_wait_with_variant`](sync_wait_with_variant.md) +- [`execution::run_loop`](../execution/run_loop.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/this_thread/sync-wait-receiver.md b/reference/execution/this_thread/sync-wait-receiver.md new file mode 100644 index 0000000000..f3823750ac --- /dev/null +++ b/reference/execution/this_thread/sync-wait-receiver.md @@ -0,0 +1,105 @@ +# sync-wait-receiver +* execution[meta header] +* class template[meta id-type] +* std::this_thread[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::this_thread { + template + struct sync-wait-receiver { // exposition only + using receiver_concept = execution::receiver_t; + sync-wait-state* state; // exposition only + + template + void set_value(Args&&... args) && noexcept; + + template + void set_error(Error&& err) && noexcept; + + void set_stopped() && noexcept; + + sync-wait-env get_env() const noexcept { return {&state->loop}; } + }; + + template + struct sync-wait-state { // exposition only + execution::run_loop loop; // exposition only + exception_ptr error; // exposition only + sync-wait-result-type result; // exposition only + }; +} +``` +* execution::receiver_t[link ../execution/receiver.md] +* execution::run_loop[link ../execution/run_loop.md] +* exception_ptr[link /reference/exception/exception_ptr.md] +* sync-wait-result-type[link sync_wait.md] + +## 概要 +`sync-wait-receiver`および`sync-wait-state`は、実行制御ライブラリの仕様定義で用いられる説明専用のクラステンプレートである。 + +Senderコンシューマ[`sync_wait`](sync_wait.md)動作において[Sender](../execution/sender.md)と[接続(connect)](../execution/connect.md)する[Receiver](../execution/receiver.md)、同Receiverの内部状態として利用される。 + + +### メンバ関数 `set_value` +```cpp +template +void set_value(Args&&... args) && noexcept; +``` + +効果 : 下記と等価 + +```cpp +try { + state->result.emplace(std::forward(args)...); +} catch (...) { + state->error = current_exception(); +} +state->loop.finish(); +``` +* emplace[link /reference/optional/optional/emplace.md] +* current_exception()[link /reference/exception/current_exception.md] +* finish()[link ../execution/run_loop/finish.md] + + +### メンバ関数 `set_error` +```cpp +template +void set_error(Error&& err) && noexcept +``` + +説明用の式`err`に対して`decltype((err))`を型`Err`としたとき、式`AS-EXCEPT-PTR(err)`を下記の通り定義する。 + +- [`decay_t`](/reference/type_traits/decay.md)``が[`exception_ptr`](/reference/exception/exception_ptr.md)型と等しければ、`err`となる。このとき、事前条件として`!err == false`を満たすこと。 +- そうではなく、[`decay_t`](/reference/type_traits/decay.md)``が[`error_code`](/reference/system_error/error_code.md)型と等しければ、[`make_exception_ptr`](/reference/exception/make_exception_ptr.md)`(`[`system_error`](/reference/system_error/system_error.md)`(err))`となる。 +- そうでなければ、[`make_exception_ptr`](/reference/exception/make_exception_ptr.md)`(err)`となる。 + +効果 : 下記と等価 + +```cpp +state->error = AS-EXCEPT-PTR(std::forward(err)); +state->loop.finish(); +``` +* finish()[link ../execution/run_loop/finish.md] + + +### メンバ関数 `set_stopped` +```cpp +void set_stopped() && noexcept; +``` + +効果 : `state->loop.`[`finish()`](../execution/run_loop/finish.md)と等価。 + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`this_thread::sync_wait`](sync_wait.md) +- [`execution::run_loop`](../execution/run_loop.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/this_thread/sync_wait.md b/reference/execution/this_thread/sync_wait.md new file mode 100644 index 0000000000..b54097da91 --- /dev/null +++ b/reference/execution/this_thread/sync_wait.md @@ -0,0 +1,144 @@ +# sync_wait +* execution[meta header] +* cpo[meta id-type] +* std::this_thread[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::this_thread { + struct sync_wait_t { unspecified }; + inline constexpr sync_wait_t sync_wait{}; +} +``` +* unspecified[italic] + +## 概要 +`sync_wait`は、[Sender](../execution/sender.md)が完了するまで現在のスレッドをブロックし、非同期操作の結果を取得するSenderコンシューマである。 + +`sync_wait`は入力Senderが[値完了シグネチャ](../execution/set_value.md)をただ1種類だけ持つことを要求する。 + + +## 効果 +説明用の`sndr`を`decltype((sndr))`が`Sndr`型となる式とする。 + +[`sender_in`](../execution/sender_in.md)` == false`のとき、呼び出し式`this_thread::sync_wait(sndr)`は不適格となる。 + +そうでなければ、呼び出し式`this_thread::sync_wait(sndr)`は`sndr`が1回だけ評価されることを除いて、下記と等価。 + +```cpp +apply_sender(get-domain-early(sndr), sync_wait, sndr) +``` +* apply_sender[link ../execution/apply_sender.md] +* get-domain-early[link ../execution/get-domain-early.md] + +- 型`sync-wait-result-type`が適格であること。 +- 上記の`apply_sender`式を`e`としたとき、[`same_as`](/reference/concepts/same_as.md)`> == true`であること。 + + +### 戻り値型 +`sync_wait`の戻り値型となる、説明専用のエイリアステンプレート`sync-wait-result-type`を下記の通り定義する。 + +```cpp +namespace std::this_thread { + template Sndr> + using sync-wait-result-type = + optional>; +} +``` +* execution::sender_in[link ../execution/sender_in.md] +* sync-wait-env[link sync-wait-env.md] +* execution::value_types_of_t[link ../execution/value_types_of_t.md] +* optional[link /reference/optional/optional.md] +* decayed-tuple[link decayed-tuple.md.nolink] +* type_identity_t[link /reference/type_traits/type_identity.md] + + +### Senderタグ `sync_wait` +説明用の`sndr`を`decltype((sndr))`が`Sndr`型となる式とする。 + +[`sender_to`](../execution/sender_to.md)`> == false`のとき、式`sync_wait.apply_sender(sndr)`は不適格となる。 + +そうでなければ、式`sync_wait.apply_sender(sndr)`は下記と等価。 + +```cpp +sync-wait-state state; +auto op = connect(sndr, sync-wait-receiver{&state}); +start(op); + +state.loop.run(); +if (state.error) { + rethrow_exception(std::move(state.error)); +} +return std::move(state.result); +``` +* sync-wait-state[link sync-wait-receiver.md] +* connect[link ../execution/connect.md] +* sync-wait-receiver[link sync-wait-receiver.md] +* start[link ../execution/start.md] +* loop.run()[link ../execution/run_loop/run.md] +* rethrow_exception[link /reference/exception/rethrow_exception.md] +* std::move[link /reference/utility/move.md] + + +## カスタマイゼーションポイント +[Sender](../execution/sender.md)`sndr`に[関連付けられた実行ドメイン](../execution/get-domain-early.md)`dom`に対して、 +[`execution::apply_sender`](../execution/apply_sender.md)経由で`dom.apply_sender(sync_wait, sndr)`が呼ばれる。 + +[デフォルト実行ドメイン](../execution/default_domain.md)では、`sync_wait.apply_sender(sndr)`が呼ばれる。 + +下記を満たさない場合、呼び出し式`this_thread::sync_wait(sndr)`の動作は未定義となる。 + +- 指定したSenderが完了するまで、前方進行保証委任(forward progress guarantee delegation)による現在のスレッドをブロックすること。 +- 指定したSenderの非同期操作の結果が返る場合 + - 値完了の場合、結果データは[`optional`](/reference/optional/optional.md)オブジェクト内の[`tuple`](/reference/tuple/tuple.md)で返されること。 + - エラー完了の場合、例外を送出すること。 + - 停止完了の場合、空の[`optional`](/reference/optional/optional.md)オブジェクトが返されること。 + + +## 例 +```cpp +#include +#include +namespace ex = std::execution; + +int main() +{ + // 値(100, 'X')を送信するSender + ex::sender auto sndr = ex::just(100, 'X'); + // メインスレッド上で完了待機 + auto result = std::this_thread::sync_wait(sndr); + // 戻り値型optional>から値を取り出す + auto [n, c] = result.value(); + std::println("result=({}, {})", n, c); +} +``` +* std::this_thread::sync_wait[color ff0000] +* ex::sender[link ../execution/sender.md] +* ex::just[link ../execution/just.md.nolink] +* value()[link /reference/optional/optional/value.md] + +### 出力 +``` +result=(100, X) +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::sender`](../execution/sender.md) +- [`this_thread::sync_wait_with_variant`](sync_wait_with_variant.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/this_thread/sync_wait_with_variant.md b/reference/execution/this_thread/sync_wait_with_variant.md new file mode 100644 index 0000000000..8dc96b1d26 --- /dev/null +++ b/reference/execution/this_thread/sync_wait_with_variant.md @@ -0,0 +1,135 @@ +# sync_wait_with_variant +* execution[meta header] +* cpo[meta id-type] +* std::this_thread[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::this_thread { + struct sync_wait_with_variant_t { unspecified }; + inline constexpr sync_wait_with_variant_t sync_wait_with_variant{}; +} +``` +* unspecified[italic] + +## 概要 +`sync_wait_with_variant`は、[Sender](../execution/sender.md)が完了するまで現在のスレッドをブロックし、非同期操作の結果を取得するSenderコンシューマである。 + +`sync_wait_with_variant`は入力Senderが複数の[値完了シグネチャ](../execution/set_value.md)を持つケースに対応する。 + + +## 効果 +説明用の`sndr`を`decltype(`[`into_variant`](into_variant.md.nolink)`(sndr))`が`Sndr`型となる式とする。 + +[`sender_in`](../execution/sender_in.md)` == false`のとき、呼び出し式`this_thread::sync_wait_with_variant(sndr)`は不適格となる。 + +そうでなければ、呼び出し式`this_thread::sync_wait_with_variant(sndr)`は`sndr`が1回だけ評価されることを除いて、下記と等価。 + +```cpp +apply_sender(get-domain-early(sndr), sync_wait_with_variant, sndr) +``` +* apply_sender[link ../execution/apply_sender.md] +* get-domain-early[link ../execution/get-domain-early.md] + +- 型`sync-wait-with-variant-result-type`が適格であること。 +- 上記の`apply_sender`式を`e`としたとき、[`same_as`](/reference/concepts/same_as.md)`> == true`であること。 + + +### 戻り値型 +`sync_wait_with_variant`の戻り値型となる、説明専用のエイリアステンプレート`sync-wait-with-variant-result-type`を下記の通り定義する。 + +```cpp +namespace std::this_thread { + template Sndr> + using sync-wait-with-variant-result-type = + optional>; +``` +* execution::sender_in[link ../execution/sender_in.md] +* sync-wait-env[link sync-wait-env.md] +* execution::value_types_of_t[link ../execution/value_types_of_t.md] +* optional[link /reference/optional/optional.md] + + +### Senderタグ `sync_wait_with_variant` +説明用の`sndr`を`decltype(`[`into_variant`](into_variant.md.nolink)`(sndr))`が`Sndr`型となる式とする。 + +`callable<`[`sync_wait_t`](sync_wait.md)`, Sndr> == false`のとき、式`sync_wait_with_variant.apply_sender(sndr)`は不適格となる。 + +そうでなければ、式`sync_wait_with_variant.apply_sender(sndr)`は下記と等価。 + +```cpp +using result_type = sync-wait-with-variant-result-type; +if (auto opt_value = sync_wait(into_variant(sndr))) { + return result_type(std::move(get<0>(*opt_value))); +} +return result_type(nullopt); +``` +* sync_wait[link sync_wait.md] +* into_variant[link into_variant.md.nolink] +* std::move[link /reference/utility/move.md] +* get<0>[link /reference/tuple/tuple/get.md] +* nullopt[link /reference/optional/nullopt_t.md] + + +## カスタマイゼーションポイント +[Sender](../execution/sender.md)`sndr`に[関連付けられた実行ドメイン](../execution/get-domain-early.md)`dom`に対して、 +[`execution::apply_sender`](../execution/apply_sender.md)経由で`dom.apply_sender(sync_wait_with_variant, sndr)`が呼ばれる。 + +[デフォルト実行ドメイン](../execution/default_domain.md)では、`sync_wait_with_variant.apply_sender(sndr)`が呼ばれる。 + +下記を満たさない場合、呼び出し式`this_thread::sync_wait_with_variant(sndr)`の動作は未定義となる。 + +- 指定したSenderが完了するまで、前方進行保証委任(forward progress guarantee delegation)による現在のスレッドをブロックすること。 +- 指定したSenderの非同期操作の結果が返る場合 + - 値完了の場合、結果データは[`optional`](/reference/optional/optional.md)オブジェクト内の[`tuple`](/reference/tuple/tuple.md)の[`variant`](/reference/variant/variant.md)で返されること。 + - エラー完了の場合、例外を送出すること。 + - 停止完了の場合、空の[`optional`](/reference/optional/optional.md)オブジェクトが返されること。 + + +## 例 +```cpp +#include +#include +namespace ex = std::execution; + +int main() +{ + // 値(100, 'X')を送信するSender + ex::sender auto sndr = ex::just(100, 'X'); + // メインスレッド上で完了待機 + auto result = std::this_thread::sync_wait_with_variant(sndr); + // 戻り値型optional>>からtupleを取り出す + auto tup = get<0>(result.value()); + std::println("result={}", tup); +} +``` +* std::this_thread::sync_wait_with_variant[color ff0000] +* ex::sender[link ../execution/sender.md] +* ex::just[link ../execution/just.md.nolink] +* get<0>[link /reference/variant/variant/get.md] +* value()[link /reference/optional/optional/value.md] + +### 出力 +``` +result=(100, 'X') +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::sender`](../execution/sender.md) +- [`this_thread::sync_wait`](sync_wait.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) From 7aa4a3a5a9224b867655b6a458e594698cf8f847 Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 1 May 2025 23:33:20 +0900 Subject: [PATCH 1635/3948] =?UTF-8?q?execution/sync=5Fwait(=5Fwith=5Fvaria?= =?UTF-8?q?nt):=20=E5=BE=AE=E8=AA=BF=E6=95=B4=20(#1384)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../execution/this_thread/sync-wait-receiver.md | 1 + reference/execution/this_thread/sync_wait.md | 17 ++++++++++------- .../this_thread/sync_wait_with_variant.md | 16 ++++++++++------ 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/reference/execution/this_thread/sync-wait-receiver.md b/reference/execution/this_thread/sync-wait-receiver.md index f3823750ac..28b5d3e382 100644 --- a/reference/execution/this_thread/sync-wait-receiver.md +++ b/reference/execution/this_thread/sync-wait-receiver.md @@ -31,6 +31,7 @@ namespace std::this_thread { } ``` * execution::receiver_t[link ../execution/receiver.md] +* sync-wait-env[link sync-wait-env.md] * execution::run_loop[link ../execution/run_loop.md] * exception_ptr[link /reference/exception/exception_ptr.md] * sync-wait-result-type[link sync_wait.md] diff --git a/reference/execution/this_thread/sync_wait.md b/reference/execution/this_thread/sync_wait.md index b54097da91..a6625caf82 100644 --- a/reference/execution/this_thread/sync_wait.md +++ b/reference/execution/this_thread/sync_wait.md @@ -15,7 +15,10 @@ namespace std::this_thread { ## 概要 `sync_wait`は、[Sender](../execution/sender.md)が完了するまで現在のスレッドをブロックし、非同期操作の結果を取得するSenderコンシューマである。 -`sync_wait`は入力Senderが[値完了シグネチャ](../execution/set_value.md)をただ1種類だけ持つことを要求する。 +`sync_wait`は入力Senderが[値完了シグネチャ](../execution/set_value.md)を1個だけ持つことを要求する。 +値完了シグネチャが複数存在する場合は[`sync_wait_with_variant`](sync_wait_with_variant.md)アルゴリズムを利用する。 + +入力Senderの値完了シグネチャが[`set_value_t`](../execution/set_value.md)`(Ts...)`のとき、`sync_wait`の結果型は[`optional`](/reference/optional/optional.md)`<`[`tuple`](/reference/tuple/tuple.md)`>`となる。 ## 効果 @@ -35,8 +38,8 @@ apply_sender(get-domain-early(sndr), sync_wait, sndr) - 上記の`apply_sender`式を`e`としたとき、[`same_as`](/reference/concepts/same_as.md)`> == true`であること。 -### 戻り値型 -`sync_wait`の戻り値型となる、説明専用のエイリアステンプレート`sync-wait-result-type`を下記の通り定義する。 +### 結果型 +`sync_wait`の結果型となる、説明専用のエイリアステンプレート`sync-wait-result-type`を下記の通り定義する。 ```cpp namespace std::this_thread { @@ -91,9 +94,9 @@ return std::move(state.result); - 指定したSenderが完了するまで、前方進行保証委任(forward progress guarantee delegation)による現在のスレッドをブロックすること。 - 指定したSenderの非同期操作の結果が返る場合 - - 値完了の場合、結果データは[`optional`](/reference/optional/optional.md)オブジェクト内の[`tuple`](/reference/tuple/tuple.md)で返されること。 - - エラー完了の場合、例外を送出すること。 - - 停止完了の場合、空の[`optional`](/reference/optional/optional.md)オブジェクトが返されること。 + - [値完了](../execution/set_value.md)の場合、結果データは[`optional`](/reference/optional/optional.md)オブジェクト内の[`tuple`](/reference/tuple/tuple.md)で返されること。 + - [エラー完了](../execution/set_error.md)の場合、例外を送出すること。 + - [停止完了](../execution/set_stopped.md)の場合、無効値[`optional`](/reference/optional/optional.md)オブジェクトが返されること。 ## 例 @@ -108,7 +111,7 @@ int main() ex::sender auto sndr = ex::just(100, 'X'); // メインスレッド上で完了待機 auto result = std::this_thread::sync_wait(sndr); - // 戻り値型optional>から値を取り出す + // 結果型optional>から値を取り出す auto [n, c] = result.value(); std::println("result=({}, {})", n, c); } diff --git a/reference/execution/this_thread/sync_wait_with_variant.md b/reference/execution/this_thread/sync_wait_with_variant.md index 8dc96b1d26..a6e2273087 100644 --- a/reference/execution/this_thread/sync_wait_with_variant.md +++ b/reference/execution/this_thread/sync_wait_with_variant.md @@ -16,6 +16,10 @@ namespace std::this_thread { `sync_wait_with_variant`は、[Sender](../execution/sender.md)が完了するまで現在のスレッドをブロックし、非同期操作の結果を取得するSenderコンシューマである。 `sync_wait_with_variant`は入力Senderが複数の[値完了シグネチャ](../execution/set_value.md)を持つケースに対応する。 +値完了シグネチャが1個だけの場合は[`sync_wait`](sync_wait.md)アルゴリズムを利用する。 + + +入力Senderの値完了シグネチャが[`set_value_t`](../execution/set_value.md)`(Ts0...)`, ..., [`set_value_t`](../execution/set_value.md)`(TsN...)`のとき、`sync_wait_with_variant`の結果型は[`optional`](/reference/optional/optional.md)`<`[`variant`](/reference/variant/variant.md)`<`[`tuple`](/reference/tuple/tuple.md)`, ...,` [`tuple`](/reference/tuple/tuple.md)`>`となる。 ## 効果 @@ -35,8 +39,8 @@ apply_sender(get-domain-early(sndr), sync_wait_with_variant, sndr) - 上記の`apply_sender`式を`e`としたとき、[`same_as`](/reference/concepts/same_as.md)`> == true`であること。 -### 戻り値型 -`sync_wait_with_variant`の戻り値型となる、説明専用のエイリアステンプレート`sync-wait-with-variant-result-type`を下記の通り定義する。 +### 結果型 +`sync_wait_with_variant`の結果型となる、説明専用のエイリアステンプレート`sync-wait-with-variant-result-type`を下記の通り定義する。 ```cpp namespace std::this_thread { @@ -81,9 +85,9 @@ return result_type(nullopt); - 指定したSenderが完了するまで、前方進行保証委任(forward progress guarantee delegation)による現在のスレッドをブロックすること。 - 指定したSenderの非同期操作の結果が返る場合 - - 値完了の場合、結果データは[`optional`](/reference/optional/optional.md)オブジェクト内の[`tuple`](/reference/tuple/tuple.md)の[`variant`](/reference/variant/variant.md)で返されること。 - - エラー完了の場合、例外を送出すること。 - - 停止完了の場合、空の[`optional`](/reference/optional/optional.md)オブジェクトが返されること。 + - [値完了](../execution/set_value.md)の場合、結果データは[`optional`](/reference/optional/optional.md)オブジェクト内の[`tuple`](/reference/tuple/tuple.md)の[`variant`](/reference/variant/variant.md)で返されること。 + - [エラー完了](../execution/set_error.md)の場合、例外を送出すること。 + - [停止完了](../execution/set_stopped.md)の場合、無効値[`optional`](/reference/optional/optional.md)オブジェクトが返されること。 ## 例 @@ -98,7 +102,7 @@ int main() ex::sender auto sndr = ex::just(100, 'X'); // メインスレッド上で完了待機 auto result = std::this_thread::sync_wait_with_variant(sndr); - // 戻り値型optional>>からtupleを取り出す + // 結果型optional>>からtupleを取り出す auto tup = get<0>(result.value()); std::println("result={}", tup); } From c629ec04a7d3e4027016f738ceb1f777f62bb852 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 2 May 2025 00:41:32 +0900 Subject: [PATCH 1636/3948] execution/run_loop: fix typos --- reference/execution/execution/run_loop.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/execution/execution/run_loop.md b/reference/execution/execution/run_loop.md index e87534f35a..8a4c149f25 100644 --- a/reference/execution/execution/run_loop.md +++ b/reference/execution/execution/run_loop.md @@ -75,9 +75,9 @@ int main() ex::start(op); // count=1, state=開始(starting) - // run_loop状態を終了中(finished)へ変更 + // run_loop状態を終了中(finishing)へ変更 loop.finish(); - // count=1, state=終了中(finished) + // count=1, state=終了中(finishing) // run_loopキュー上の作業を逐次実行 loop.run(); From b7bf5a18276675dc1b6a14e6c7dc2db3ad0c7a12 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 2 May 2025 00:51:26 +0900 Subject: [PATCH 1637/3948] =?UTF-8?q?GLOBAL=5FQUALIFY=5FLIST:=20std::jthre?= =?UTF-8?q?ad=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 1 + reference/execution/execution/run_loop/run.md | 1 - reference/execution/execution/schedule.md | 1 - reference/rcu/rcu_obj_base.md | 1 - reference/rcu/rcu_retire.md | 1 - reference/rcu/rcu_synchronize.md | 1 - 6 files changed, 1 insertion(+), 5 deletions(-) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index fe43d87782..0f23924dcc 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -273,6 +273,7 @@ * std::error_code[link /reference/system_error/error_code.md] * [link /reference/thread.md] * std::thread[link /reference/thread/thread.md] + * std::jthread[link /reference/thread/jthread.md] * t.join()[link /reference/thread/thread/join.md] * t1.join()[link /reference/thread/thread/join.md] * t2.join()[link /reference/thread/thread/join.md] diff --git a/reference/execution/execution/run_loop/run.md b/reference/execution/execution/run_loop/run.md index 3c79708711..85f406acf7 100644 --- a/reference/execution/execution/run_loop/run.md +++ b/reference/execution/execution/run_loop/run.md @@ -90,7 +90,6 @@ int main() * run()[color ff0000] * ex::run_loop[link ../run_loop.md] * finish()[link finish.md] -* std::jthread[link /reference/thread/jthread.md] ### 出力 ``` diff --git a/reference/execution/execution/schedule.md b/reference/execution/execution/schedule.md index f112291e5e..778b9aa8a6 100644 --- a/reference/execution/execution/schedule.md +++ b/reference/execution/execution/schedule.md @@ -69,7 +69,6 @@ int main() * run()[link run_loop/run.md] * finish()[link run_loop/finish.md] * std::move[link /reference/utility/move.md] -* std::jthread[link /reference/thread/jthread.md] * std::this_thread::get_id()[link /reference/thread/this_thread/get_id.md] ### 出力例 diff --git a/reference/rcu/rcu_obj_base.md b/reference/rcu/rcu_obj_base.md index 3a36d3ebc9..cd2d1639d3 100644 --- a/reference/rcu/rcu_obj_base.md +++ b/reference/rcu/rcu_obj_base.md @@ -87,7 +87,6 @@ int main() * std::rcu_default_domain[link rcu_default_domain.md] * retire()[link rcu_obj_base/retire.md] * std::scoped_lock[link /reference/mutex/scoped_lock.md] -* std::jthread[link /reference/thread/jthread.md] * exchange[link /reference/atomic/atomic/exchange.md] * store[link /reference/atomic/atomic/store.md] diff --git a/reference/rcu/rcu_retire.md b/reference/rcu/rcu_retire.md index d4d63c3743..80aa742f61 100644 --- a/reference/rcu/rcu_retire.md +++ b/reference/rcu/rcu_retire.md @@ -97,7 +97,6 @@ int main() * std::rcu_retire[color ff0000] * std::rcu_default_domain[link rcu_default_domain.md] * std::scoped_lock[link /reference/mutex/scoped_lock.md] -* std::jthread[link /reference/thread/jthread.md] * exchange[link /reference/atomic/atomic/exchange.md] * store[link /reference/atomic/atomic/store.md] diff --git a/reference/rcu/rcu_synchronize.md b/reference/rcu/rcu_synchronize.md index 713b6ab02d..cbb1cf2df7 100644 --- a/reference/rcu/rcu_synchronize.md +++ b/reference/rcu/rcu_synchronize.md @@ -88,7 +88,6 @@ int main() * std::rcu_synchronize[color ff0000] * std::rcu_default_domain[link rcu_default_domain.md] * std::scoped_lock[link /reference/mutex/scoped_lock.md] -* std::jthread[link /reference/thread/jthread.md] * exchange[link /reference/atomic/atomic/exchange.md] * store[link /reference/atomic/atomic/store.md] From 0e7abe950b0cff66280b05cf6fa06b1bdb1c968d Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 2 May 2025 00:54:53 +0900 Subject: [PATCH 1638/3948] =?UTF-8?q?GLOBAL=5FQUALIFY=5FLIST:=20std::varia?= =?UTF-8?q?nt=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 1 + ...ting_from_pointer_to_bool_should_be_considered_narrowing.md | 3 --- reference/utility/in_place_index_t.md | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 0f23924dcc..8f453c0d8a 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -313,6 +313,7 @@ * [link /reference/valarray.md] * std::valarray[link /reference/valarray/valarray.md] * [link /reference/variant.md] + * std::variant[link /reference/variant/variant.md] * [link /reference/vector.md] * std::vector[link /reference/vector/vector.md] * v.begin()[link /reference/vector/vector/begin.md] diff --git a/lang/cpp20/converting_from_pointer_to_bool_should_be_considered_narrowing.md b/lang/cpp20/converting_from_pointer_to_bool_should_be_considered_narrowing.md index 486be44f1f..0a40c7441b 100644 --- a/lang/cpp20/converting_from_pointer_to_bool_should_be_considered_narrowing.md +++ b/lang/cpp20/converting_from_pointer_to_bool_should_be_considered_narrowing.md @@ -34,8 +34,6 @@ C++17で導入された`std::variant`には当初、`const char*`から`bool`へ ```cpp std::variant x = "abc"; // boolを保持して構築されてしまう ``` -* variant[link /reference/variant/variant.md] -* string[link /reference/string/basic_string.md] この他にも構築・代入時に縮小変換が行われてしまう事から同様の問題があり、それはC++20において[P0608R3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0608r3.html)によって解決された。そこでは、構築・代入時の縮小変換を禁止するとともに、`bool`に変換可能な型を`bool`に変換することを禁止することで問題に対処していた。 @@ -46,7 +44,6 @@ std::bitset<4> b("0101"); std::variant v = b[1]; // intを保持して構築されてしまう ``` * bitset[link /reference/bitset/bitset.md] -* variant[link /reference/variant/variant.md] `std::bitset`の非`const`な[`operator[]`](/reference/bitset/bitset/op_at.md)は`bool`型へ暗黙変換可能なプロキシオブジェクトを返す。 diff --git a/reference/utility/in_place_index_t.md b/reference/utility/in_place_index_t.md index 450d23a688..24c61fae2e 100644 --- a/reference/utility/in_place_index_t.md +++ b/reference/utility/in_place_index_t.md @@ -42,7 +42,6 @@ int main() } ``` * std::in_place_index[color ff0000] -* std::variant[link /reference/variant/variant.md] * std::visit[link /reference/variant/visit.md] ### 出力 From 9ea31e83a71896f726b6ff594a35d37f76277847 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 2 May 2025 00:59:23 +0900 Subject: [PATCH 1639/3948] =?UTF-8?q?GLOBAL=5FQUALIFY=5FLIST:=20std::memor?= =?UTF-8?q?y=5Forder=5Fconsume=E5=89=8A=E9=99=A4=20(#1420)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 1 - reference/atomic/kill_dependency.md | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 8f453c0d8a..9f4ed61d59 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -19,7 +19,6 @@ * std::atomic[link /reference/atomic/atomic.md] * std::memory_order_acq_rel[link /reference/atomic/memory_order.md] * std::memory_order_acquire[link /reference/atomic/memory_order.md] - * std::memory_order_consume[link /reference/atomic/memory_order.md] * std::memory_order_relaxed[link /reference/atomic/memory_order.md] * std::memory_order_release[link /reference/atomic/memory_order.md] * std::memory_order_seq_cst[link /reference/atomic/memory_order.md] diff --git a/reference/atomic/kill_dependency.md b/reference/atomic/kill_dependency.md index f7ff021e39..0f41534d7e 100644 --- a/reference/atomic/kill_dependency.md +++ b/reference/atomic/kill_dependency.md @@ -88,6 +88,7 @@ int main() * std::kill_dependency[color ff0000] * a.store[link atomic/store.md] * a.load[link atomic/load.md] +* std::memory_order_consume[link /reference/atomic/memory_order.md] ### 出力例 From 885f6ee7a8b2f4257a21a51e4e97f3adaf46ab1d Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 2 May 2025 17:14:47 +0900 Subject: [PATCH 1640/3948] execution: just (#1384) make-sender, basic-sender, basic-operation, impls-for --- reference/execution/execution.md | 2 +- .../execution/execution/basic-operation.md | 149 ++++++++++++++++++ reference/execution/execution/basic-sender.md | 91 +++++++++++ reference/execution/execution/connect.md | 2 +- .../execution/execution/error_types_of_t.md | 2 +- .../execution/get_completion_signatures.md | 2 +- reference/execution/execution/get_env.md | 2 +- reference/execution/execution/impls-for.md | 124 +++++++++++++++ reference/execution/execution/just.md | 92 +++++++++++ reference/execution/execution/make-sender.md | 47 ++++++ .../execution/execution/operation_state.md | 2 +- reference/execution/execution/sender.md | 2 +- reference/execution/execution/sender_in.md | 2 +- reference/execution/execution/sender_to.md | 2 +- .../execution/execution/sends_stopped.md | 2 +- reference/execution/execution/start.md | 2 +- .../execution/execution/value_types_of_t.md | 2 +- reference/execution/get_stop_token.md | 2 +- reference/execution/this_thread/sync_wait.md | 2 +- .../this_thread/sync_wait_with_variant.md | 2 +- 20 files changed, 518 insertions(+), 15 deletions(-) create mode 100644 reference/execution/execution/basic-operation.md create mode 100644 reference/execution/execution/basic-sender.md create mode 100644 reference/execution/execution/impls-for.md create mode 100644 reference/execution/execution/just.md create mode 100644 reference/execution/execution/make-sender.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 18549d3203..705591d713 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -99,7 +99,7 @@ namespace std::execution { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`execution::just`](execution/just.md.nolink) | 値を送信するSender (customization point object) | C++26 | +| [`execution::just`](execution/just.md) | 値を送信するSender (customization point object) | C++26 | | [`execution::just_error`](execution/just_error.md.nolink) | エラーを送信するSender (customization point object) | C++26 | | [`execution::just_stopped`](execution/just_stopped.md.nolink) | 停止を送信するSender (customization point object) | C++26 | | [`execution::read_env`](execution/read_env.md.nolink) | Receiver環境から構築されるSender (customization point object) | C++26 | diff --git a/reference/execution/execution/basic-operation.md b/reference/execution/execution/basic-operation.md new file mode 100644 index 0000000000..7ac6e0592a --- /dev/null +++ b/reference/execution/execution/basic-operation.md @@ -0,0 +1,149 @@ +# basic-operation +* execution[meta header] +* class template[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template + requires valid-specialization && + valid-specialization + struct basic-operation : basic-state { // exposition only + using operation_state_concept = operation_state_t; + using tag-t = tag_of_t; // exposition only + + connect-all-result inner-ops; // exposition only + + basic-operation(Sndr&& sndr, Rcvr&& rcvr) noexcept(see below) // exposition only + : basic-state(std::forward(sndr), std::move(rcvr)), + inner-ops(connect-all(this, std::forward(sndr), indices-for())) + {} + + void start() & noexcept { + auto& [...ops] = inner-ops; + impls-for::start(this->state, this->rcvr, ops...); + } + }; + + template + struct basic-state { // exposition only + basic-state(Sndr&& sndr, Rcvr&& rcvr) noexcept(see below) + : rcvr(std::move(rcvr)) + , state(impls-for>::get-state(std::forward(sndr), rcvr)) { } + + Rcvr rcvr; // exposition only + state-type state; // exposition only + }; +} +``` +* operation_state_t[link operation_state.md] +* tag_of_t[link tag_of_t.md.nolink] +* impls-for[link impls-for.md] +* see below[italic] + +## 概要 +`basic-operation`および`basic-state`は、Senderアルゴリズム動作仕様定義で用いられる説明専用のクラステンプレートである。 + +`basic-operation`は[`operation_state`](operation_state.md)のモデルであり、[Senderアルゴリズム](basic-sender.md)と[Recevier](receiver.md)の[接続(connect)](connect.md)結果型として利用される。 + +- `rcvr` : 接続先Receiverオブジェクトを保持。Senderアルゴリズム同士を連結する場合は、親Senderアルゴリズム側の[Receiver](receiver.md)が該当する。 +- `state` : Senderアルゴリズム構築時の引数リストを保持。([`impls-for`](impls-for.md)でカスタマイズ可能) +- `inner-ops` : 子SenderリストとSenderアルゴリズムとの接続結果[Operation State](operation_state.md)リストを保持。Senderファクトリでは0個、Senderアダプタでは通常1個の子Senderと接続される。 + + +## クラス仕様 +`basic-operation`コンストラクタ`noexcept`節の式は下記の通り。 + +```cpp +is_nothrow_constructible_v, Self, Rcvr> && +noexcept(connect-all(this, std::forward(sndr), indices-for())) +``` +* is_nothrow_constructible_v[link /reference/type_traits/is_nothrow_constructible.md] + +`basic-state`コンストラクタ`noexcept`節の式は下記の通り。 + +```cpp +is_nothrow_move_constructible_v && +nothrow-callable>::get-state), Sndr, Rcvr&> && +(same_as, get-state-result> || + is_nothrow_constructible_v, get-state-result>) +``` +* impls-for[link impls-for.md] +* tag_of_t[link tag_of_t.md.nolink] +* is_nothrow_move_constructible_v[link /reference/type_traits/is_nothrow_move_constructible.md] +* is_nothrow_constructible_v[link /reference/type_traits/is_nothrow_constructible.md] + +ここで、説明用の型`get-state-result`は下記の通り定義される。 + +```cpp +call-result-t>::get-state), Sndr, Rcvr&>. +``` +* impls-for[link impls-for.md] +* tag_of_t[link tag_of_t.md.nolink] + + +## 説明専用エンティティ + +```cpp +template class T, class... Args> +concept valid-specialization = // exposition only + requires { typename T; }; + +template // exposition only +using state-type = decay_t>::get-state), Sndr, Rcvr&>>; + +constexpr auto connect-all = see below; // exposition only + +template +using connect-all-result = call-result-t< // exposition only + decltype(connect-all), basic-state*, Sndr, indices-for>; + +template +using indices-for = remove_reference_t::indices-for; // exposition only +``` +* impls-for[link impls-for.md] +* tag_of_t[link tag_of_t.md.nolink] +* decay_t[link /reference/type_traits/decay.md] +* remove_reference_t[link /reference/type_traits/remove_reference.md] +* see below[italic] + +説明専用の定数`connect-all`は、下記ラムダ式と等価な関数呼び出し可能なオブジェクトとして初期化される。 + +- 全ての子Sender`child`とSenderアルゴリズム`sndr`の[Receiver](basic-receiver.md)を[接続(connect)](connec.md)し、結果の[Operation State](operation_state.md)リストを[`product-type`](product-type.md.nolink)型にまとめて返す。 + +```cpp +[]( + basic-state* op, Sndr&& sndr, index_sequence) noexcept(see below) + -> decltype(auto) { + auto& [_, data, ...child] = sndr; + return product-type{connect( + std::forward_like(child), + basic-receiver>{op})...}; + } +``` +* index_sequence[link /reference/utility/index_sequence.md] +* product-type[link product-type.md.nolink] +* connect[link connect.md] +* basic-receiver[link basic-receiver.md.nolink] +* integral_constant[link /reference/type_traits/integral_constant.md] +* see below[italic] + +- テンプレートパラメータ制約 : ラムダ式中の`return`文の式が適格であること。 +- ラムダ式中の`return`文の式が例外送出する可能性がある場合は、`noexcept(false)`となる。そうでなければ、`noexcept(true)`となる。 + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`basic-sender`](basic-sender.md) +- [`basic-receiver`](basic-receiver.md.nolink) +- [`execution::operation_state`](operation_state.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/basic-sender.md b/reference/execution/execution/basic-sender.md new file mode 100644 index 0000000000..1d9d0c7da4 --- /dev/null +++ b/reference/execution/execution/basic-sender.md @@ -0,0 +1,91 @@ +# basic-sender +* execution[meta header] +* class template[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template + struct basic-sender : product-type { // exposition only + using sender_concept = sender_t; + using indices-for = index_sequence_for; // exposition only + + decltype(auto) get_env() const noexcept { + auto& [_, data, ...child] = *this; + return impls-for::get-attrs(data, child...); + } + + template Self, receiver Rcvr> + auto connect(this Self&& self, Rcvr rcvr) noexcept(see below) + -> basic-operation { + return {std::forward(self), std::move(rcvr)}; + } + + template Self, class Env> + auto get_completion_signatures(this Self&& self, Env&& env) noexcept + -> completion-signatures-for { + return {}; + } + }; +} +``` +* product-type[link product-type.md.nolink] +* sender_t[link sender.md] +* index_sequence_for[link /reference/utility/index_sequence_for.md] +* impls-for[link impls-for.md] +* receiver[link receiver.md] +* basic-operation[link basic-operation.md] +* this Self[link /lang/cpp23/deducing_this.md.nolink] +* see below[italic] + +## 概要 +`basic-sender`は、Senderアルゴリズム動作仕様定義で用いられる説明専用のクラステンプレートである。 + +`basic-sender`は[`sender`](sender.md)のモデルであり、[Senderアルゴリズム構築](make-sender.md)の結果型として利用される。 + +- `Tag` : [Senderタグ](tag_of_t.md.nolink)(例:[`just`](just.md), [`then`](then.md.nolink)) +- `Data` : Senderアルゴリズムに指定された追加の引数。複数個の引数は[`product-type`](product-type.md.nolink)型を用いて単一値として保持する。 +- `Child` : 子Senderのリスト。Senderファクトリでは0個、Senderアダプタでは通常1個の子Senderを保持する。 + + +## クラス仕様 +`basic-sender`の特殊化が集成体となるか否かは未規定である。 +`basic-sender`型の式は[構造化束縛](/lang/cpp17/structured_bindings.md)における初期化子として利用できる。 + +`basic-sender::connect`メンバ関数`noexcept`節の式は下記の通り。 + +```cpp +is_nothrow_constructible_v, Self, Rcvr> +``` +* is_nothrow_constructible_v[link /reference/type_traits/is_nothrow_constructible.md] +* basic-operation[link basic-operation.md] + +説明専用のエイリアステンプレート`completion-signatures-for`は、下記の通り定義される。 + +``` +template +using completion-signatures-for = see below; // exposition only +``` +* see below[italic] + +説明用の`sndr`を`decltype((sndr))`が`Sndr`型となる式、`rcvr`を[`sender_in`](sender_in.md)` == true`となる[環境](../queryable.md)`Env`に関連付けられた[`Receiver`](receiver.md)とする。 + +`completion-signatures-for`は[`completion_signatures`](completion_signatures.md)の特殊化であり、そのテンプレート引数は `sndr`と`rcvr`との[接続(connect)](connect.md)結果[Operation State](operation_state.md)を[開始(start)](start.md)して得られる可能性のある結果の完了シグネチャ集合となる。 + +[`sender_in`](sender_in.md)` == false`となる場合、`completion-signatures-for`は[`completion_signatures`](completion_signatures.md)の特殊化ではない別の型となる。 + 処理系(標準ライブラリ実装者)は、この型を用いてユーザにエラー理由を通知することが推奨される。 + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`make-sender`](make-sender.md) +- [`execution::sender`](sender.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/connect.md b/reference/execution/execution/connect.md index 467004ba33..233f66d068 100644 --- a/reference/execution/execution/connect.md +++ b/reference/execution/execution/connect.md @@ -209,7 +209,7 @@ int main() * ex::connect[color ff0000] * ex::receiver_t[link receiver.md] * ex::sender[link sender.md] -* ex::just[link just.md.nolink] +* ex::just[link just.md] * ex::operation_state[link operation_state.md] * ex::start[link start.md] diff --git a/reference/execution/execution/error_types_of_t.md b/reference/execution/execution/error_types_of_t.md index 416c8551ed..10b6d9bcf5 100644 --- a/reference/execution/execution/error_types_of_t.md +++ b/reference/execution/execution/error_types_of_t.md @@ -52,7 +52,7 @@ int main() ``` * ex::error_types_of_t[color ff0000] * ex::sender[link sender.md] -* ex::just[link just.md.nolink] +* ex::just[link just.md] * ex::just_error[link just_error.md.nolink] ### 出力 diff --git a/reference/execution/execution/get_completion_signatures.md b/reference/execution/execution/get_completion_signatures.md index 4aee05a22b..4ef53f6013 100644 --- a/reference/execution/execution/get_completion_signatures.md +++ b/reference/execution/execution/get_completion_signatures.md @@ -68,7 +68,7 @@ int main() ``` * ex::get_completion_signatures[color ff0000] * ex::sender[link sender.md] -* ex::just[link just.md.nolink] +* ex::just[link just.md] * ex::completion_signatures[link completion_signatures.md] * ex::env<>[link env.md] * ex::set_value_t[link set_value.md] diff --git a/reference/execution/execution/get_env.md b/reference/execution/execution/get_env.md index 7998c204ef..64fc27b0bf 100644 --- a/reference/execution/execution/get_env.md +++ b/reference/execution/execution/get_env.md @@ -52,7 +52,7 @@ int main() ``` * ex::get_env[color ff0000] * ex::sender[link sender.md] -* ex::just[link just.md.nolink] +* ex::just[link just.md] ### 出力 ``` diff --git a/reference/execution/execution/impls-for.md b/reference/execution/execution/impls-for.md new file mode 100644 index 0000000000..e21c5f00bb --- /dev/null +++ b/reference/execution/execution/impls-for.md @@ -0,0 +1,124 @@ +# impls-for +* execution[meta header] +* class template[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template + struct impls-for : default-impls {}; // exposition only + + struct default-impls { // exposition only + static constexpr auto get-attrs = see below; // exposition only + static constexpr auto get-env = see below; // exposition only + static constexpr auto get-state = see below; // exposition only + static constexpr auto start = see below; // exposition only + static constexpr auto complete = see below; // exposition only + }; +} +``` +* see below[italic] + +## 概要 +`impls-for`は、Senderアルゴリズム動作仕様定義で用いられる説明専用のクラステンプレートである。 + +説明専用のクラス`default-impls`にてSenderアルゴリズム共通動作を記述し、[Senderタグ](tag_of_t.md.nolink)`Tag`を用いて`impls-for`特殊化を定義することでSenderアルゴリズム固有動作を静的にオーバーライドする。 + + +## 説明専用クラス `default-impls` + +### `get-attrs`メンバ +`get-attrs`は、[`basic-sender`](basic-sender.md)実装におけるSender[属性](../queryable.md)取得のカスタマイゼーションポイントとして機能する。 + +`default-impls::get-attrs`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 + +- 子[Sender](sender.md)`child`が1個の場合は、その子Senderの[属性](../queryable.md)を転送する。 +- それ以外の場合は、空の属性[`env<>()`](env.md)を返す。 + +```cpp +[](const auto&, const auto&... child) noexcept -> decltype(auto) { + if constexpr (sizeof...(child) == 1) + return (FWD-ENV(get_env(child)), ...); + else + return env<>(); +} +``` +* get_env[link get_env.md] +* env<>[link env.md] + +### `get-env`メンバ +`get-env`は、[`basic-receiver`](basic-receiver.md.nolink)実装におけるReceiver[環境](../queryable.md)取得のカスタマイゼーションポイントとして機能する。 + +`default-impls::get-env`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 + +- 接続先[Receiver](receiver.md)`rcvr`の[環境](../queryable.md)を転送する。 + +```cpp +[](auto, auto&, const auto& rcvr) noexcept -> decltype(auto) { + return FWD-ENV(get_env(rcvr)); +} +``` +* get_env[link get_env.md] + +### `get-state`メンバ +`get-state`は、[`basic-operation`](basic-operation.md)実装がメンバ変数として保持する状態(state)取得のカスタマイゼーションポイントとして機能する。 + +`default-impls::get-state`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 + +- [Sender](sender.md)`sndr`オブジェクト構築時の引数を返す。 + +```cpp +[](Sndr&& sndr, Rcvr& rcvr) noexcept -> decltype(auto) { + auto& [_, data, ...child] = sndr; + return std::forward_like(data); +} +``` + +### `start`メンバ +`start`は、[`basic-operation`](basic-operation.md)実装における[開始(start)](start.md)のカスタマイゼーションポイントとして機能する。 + +`default-impls::start`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 + +- 子[Operation State](operation_state.md)`ops`を逐次的に[開始(start)](start.md)する。 + +```cpp +[](auto&, auto&, auto&... ops) noexcept -> void { + (execution::start(ops), ...); +} +``` +* execution::start[link start.md] + +### `complete`メンバ +`complete`は、[`basic-receiver`](basic-receiver.md.nolink)実装における各種完了操作のカスタマイゼーションポイントとして機能する。 + +`default-impls::complete`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 + +- 完了タグ`Tag`と引数リスト`args`を用いて、接続先[Receiver](receiver.md)`rcvr`の完了操作を呼び出す。 + - `Tag`型は[`set_value_t`](set_value.md), [`set_error_t`](set_error.md), [`set_stopped_t`](set_stopped.md)のいずれか。 +- 第1引数`Index`は、`default-impls`実装では利用しない。 + - 複数の子Senderを保持するSenderアルゴリズムの`impls-for`オーバーライド実装で利用する(例 : [`when_all`](when_all.md.nolink))。 + +```cpp +[]( + Index, auto& state, Rcvr& rcvr, Tag, Args&&... args) noexcept + -> void requires callable { + static_assert(Index::value == 0); + Tag()(std::move(rcvr), std::forward(args)...); +} +``` + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`basic-sender`](basic-sender.md) +- [`basic-receiver`](basic-receiver.md.nolink) +- [`basic-operation`](basic-operation.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/just.md b/reference/execution/execution/just.md new file mode 100644 index 0000000000..535828449b --- /dev/null +++ b/reference/execution/execution/just.md @@ -0,0 +1,92 @@ +# just +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct just_t { unspecified }; + inline constexpr just_t just{}; +} +``` +* unspecified[italic] + +## 概要 +`just`は、非同期操作の[開始(start)](start.md)で[値完了関数](set_value.md)を呼び出すSenderファクトリである。 + + +## 効果 +- 呼び出し式`just(ts...)`は、`(`[`movable-value`](movable-value.md.nolink)` &&...) == false`のとき不適格となる。 +- そうでなければ、式[`make-sender`](make-sender.md)`(just,` [`product-type`](product-type.md.nolink)`{ts...})`と等価。 + + +### Senderタグ `just` +Senderアルゴリズム動作説明用のクラステンプレート`impls-for`に対して、下記の特殊化が定義される。 + +```cpp +namespace std::execution { + template<> + struct impls-for> : default-impls { + static constexpr auto start = + [](auto& state, auto& rcvr) noexcept -> void { + auto& [...ts] = state; + set_value(std::move(rcvr), std::move(ts)...); + }; + }; +} +``` +* impls-for[link impls-for.md] +* default-impls[link impls-for.md] +* set_value[link set_value.md] + + +## 例 +```cpp example +#include +#include +namespace ex = std::execution; + +int main() +{ + // 値(123,'X')の送信結果は tuple 型で受け取る + ex::sender auto snd1 = ex::just(123, 'X'); + std::tuple result1 = std::this_thread::sync_wait(snd1).value(); + std::println("result1={}", result1); + + // 空値の送信結果は tuple<> 型で受け取る + ex::sender auto snd2 = ex::just(); + std::tuple<> result2 = std::this_thread::sync_wait(snd2).value(); + std::println("result2={}", result2); +} +``` +* ex::just[color ff0000] +* ex::sender[link sender.md] +* std::this_thread::sync_wait[link ../this_thread/sync_wait.md] +* value()[link /reference/optional/optional/value.md] + +### 出力 +``` +result1=(123, 'X') +result2=() +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::just_error`](just_error.md.nolink) +- [`execution::just_stopped`](just_stopped.md.nolink) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/make-sender.md b/reference/execution/execution/make-sender.md new file mode 100644 index 0000000000..b35e298235 --- /dev/null +++ b/reference/execution/execution/make-sender.md @@ -0,0 +1,47 @@ +# make-sender +* execution[meta header] +* function template[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +template +constexpr auto make-sender(Tag tag, Data&& data, Child&&... child); +``` +* see below[italic] + +## 概要 +`make-sender`は、Senderアルゴリズム動作仕様定義で用いられる説明専用の関数テンプレートである。 + +[`sender`](sender.md)のモデルである説明専用クラステンプレート[`basic-sender`](basic-sender.md)のインスタンスを生成する。 + +- `Tag` : [Senderタグ](tag_of_t.md.nolink)(例:[`just`](just.md), [`then`](then.md.nolink)) +- `Data` : Senderアルゴリズムに指定された追加の引数。複数個の引数は[`product-type`](product-type.md.nolink)型を用いて単一値として保持する。 +- `Child` : 子Senderのリスト。Senderファクトリでは0個、Senderアダプタでは通常1個の子Senderを保持する。 + + +## 適格要件 +- [`semiregular`](/reference/concepts/semiregular.md)` == true` +- [`movable-value`](movable-value.md.nolink)` == true` +- `(`[`sender`](sender.md)` && ...) == true` + + +## 戻り値 +転送された各引数により直接非リスト初期化された型[`basic-sender`](basic-sender.md)`,` [`decay_t`](/reference/type_traits/decay.md)`...>`のprvalueを返す。 + + +## 備考 +テンプレートパラメータ`Data`のデフォルト引数は、[`semiregular`](/reference/concepts/semiregular.md)のモデルである空のトリビアルにコピー可能な未規定なクラス型。 + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`basic-sender`](basic-sender.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/operation_state.md b/reference/execution/execution/operation_state.md index dc64053006..57b51859e6 100644 --- a/reference/execution/execution/operation_state.md +++ b/reference/execution/execution/operation_state.md @@ -63,7 +63,7 @@ int main() * ex::operation_state[color ff0000] * ex::receiver_t[link receiver.md] * ex::sender[link sender.md] -* ex::just[link just.md.nolink] +* ex::just[link just.md] * ex::connect[link connect.md] * ex::start[link start.md] diff --git a/reference/execution/execution/sender.md b/reference/execution/execution/sender.md index a7aa146f56..5f6e98eac3 100644 --- a/reference/execution/execution/sender.md +++ b/reference/execution/execution/sender.md @@ -78,7 +78,7 @@ int main() } ``` * ex::sender[color ff0000] -* ex::just[link just.md.nolink] +* ex::just[link just.md] ### 出力 ``` diff --git a/reference/execution/execution/sender_in.md b/reference/execution/execution/sender_in.md index bb725c8380..e587de2344 100644 --- a/reference/execution/execution/sender_in.md +++ b/reference/execution/execution/sender_in.md @@ -47,7 +47,7 @@ int main() ``` * ex::sender_in[color ff0000] * ex::sender[link sender.md] -* ex::just[link just.md.nolink] +* ex::just[link just.md] * ex::env<>[link env.md] ### 出力 diff --git a/reference/execution/execution/sender_to.md b/reference/execution/execution/sender_to.md index edd3efacc7..332587bf7c 100644 --- a/reference/execution/execution/sender_to.md +++ b/reference/execution/execution/sender_to.md @@ -58,7 +58,7 @@ int main() * ex::sender_to[color ff0000] * ex::receiver_t[link receiver.md] * ex::sender[link sender.md] -* ex::just[link just.md.nolink] +* ex::just[link just.md] * ex::operation_state[link operation_state.md] * ex::connect[link connect.md] * ex::start[link start.md] diff --git a/reference/execution/execution/sends_stopped.md b/reference/execution/execution/sends_stopped.md index 8efd74d33b..d4cbda9e03 100644 --- a/reference/execution/execution/sends_stopped.md +++ b/reference/execution/execution/sends_stopped.md @@ -43,7 +43,7 @@ int main() ``` * ex::sends_stopped[color ff0000] * ex::sender[link sender.md] -* ex::just[link just.md.nolink] +* ex::just[link just.md] * ex::just_stopped[link just_stopped.md.nolink] ### 出力 diff --git a/reference/execution/execution/start.md b/reference/execution/execution/start.md index 90fc7ed10b..ea0c3623e1 100644 --- a/reference/execution/execution/start.md +++ b/reference/execution/execution/start.md @@ -62,7 +62,7 @@ int main() * ex::start[color ff0000] * ex::receiver_t[link receiver.md] * ex::sender[link sender.md] -* ex::just[link just.md.nolink] +* ex::just[link just.md] * ex::operation_state[link operation_state.md] * ex::connect[link connect.md] diff --git a/reference/execution/execution/value_types_of_t.md b/reference/execution/execution/value_types_of_t.md index 1a5d74344f..48bebc2087 100644 --- a/reference/execution/execution/value_types_of_t.md +++ b/reference/execution/execution/value_types_of_t.md @@ -54,7 +54,7 @@ int main() ``` * ex::value_types_of_t[color ff0000] * ex::sender[link sender.md] -* ex::just[link just.md.nolink] +* ex::just[link just.md] * ex::just_error[link just_error.md.nolink] ### 出力 diff --git a/reference/execution/get_stop_token.md b/reference/execution/get_stop_token.md index d83666b856..feb7b47788 100644 --- a/reference/execution/get_stop_token.md +++ b/reference/execution/get_stop_token.md @@ -51,7 +51,7 @@ int main() ``` * std::get_stop_token[color ff0000] * ex::sender[link execution/sender.md] -* ex::just[link execution/just.md.nolink] +* ex::just[link execution/just.md] * ex::get_env[link execution/get_env.md] * std::never_stop_token[link /reference/stop_token/never_stop_token.md] diff --git a/reference/execution/this_thread/sync_wait.md b/reference/execution/this_thread/sync_wait.md index a6625caf82..98f7dc66c9 100644 --- a/reference/execution/this_thread/sync_wait.md +++ b/reference/execution/this_thread/sync_wait.md @@ -118,7 +118,7 @@ int main() ``` * std::this_thread::sync_wait[color ff0000] * ex::sender[link ../execution/sender.md] -* ex::just[link ../execution/just.md.nolink] +* ex::just[link ../execution/just.md] * value()[link /reference/optional/optional/value.md] ### 出力 diff --git a/reference/execution/this_thread/sync_wait_with_variant.md b/reference/execution/this_thread/sync_wait_with_variant.md index a6e2273087..711d8fca61 100644 --- a/reference/execution/this_thread/sync_wait_with_variant.md +++ b/reference/execution/this_thread/sync_wait_with_variant.md @@ -109,7 +109,7 @@ int main() ``` * std::this_thread::sync_wait_with_variant[color ff0000] * ex::sender[link ../execution/sender.md] -* ex::just[link ../execution/just.md.nolink] +* ex::just[link ../execution/just.md] * get<0>[link /reference/variant/variant/get.md] * value()[link /reference/optional/optional/value.md] From 5e7c6ee264d5044b5c94d2f1a49e74b84df6edce Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 2 May 2025 17:18:07 +0900 Subject: [PATCH 1641/3948] execution/basic-operation: fix inner links --- reference/execution/execution/basic-operation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/execution/execution/basic-operation.md b/reference/execution/execution/basic-operation.md index 7ac6e0592a..f1181fa9d8 100644 --- a/reference/execution/execution/basic-operation.md +++ b/reference/execution/execution/basic-operation.md @@ -111,7 +111,7 @@ using indices-for = remove_reference_t::indices-for; // exposition only 説明専用の定数`connect-all`は、下記ラムダ式と等価な関数呼び出し可能なオブジェクトとして初期化される。 -- 全ての子Sender`child`とSenderアルゴリズム`sndr`の[Receiver](basic-receiver.md)を[接続(connect)](connec.md)し、結果の[Operation State](operation_state.md)リストを[`product-type`](product-type.md.nolink)型にまとめて返す。 +- 全ての子Sender`child`とSenderアルゴリズム`sndr`の[Receiver](basic-receiver.md.nolink)を[接続(connect)](connect.md)し、結果の[Operation State](operation_state.md)リストを[`product-type`](product-type.md.nolink)型にまとめて返す。 ```cpp []( From e3e7d0958b319645672de3e54a6b0d323747afc5 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Fri, 2 May 2025 21:56:00 +0900 Subject: [PATCH 1642/3948] =?UTF-8?q?C++26:=20=E8=A1=A8=E3=82=92=E6=95=B4?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp26.md b/lang/cpp26.md index 0d17694309..fd4718be32 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -107,7 +107,6 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| -| [非推奨だった組み込み配列の比較を削除](/lang/cpp26/remove_deprecated_array_comparisons.md) | C++20で非推奨となっていた配列比較を削除 | | [先行するカンマのない省略記号を非推奨化](/lang/cpp26/the_oxford_variadic_comma.md) | `void f(int, ...);`はOK。`void f(int...);`は非推奨 | @@ -115,6 +114,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| +| [非推奨だった組み込み配列の比較を削除](/lang/cpp26/remove_deprecated_array_comparisons.md) | C++20で非推奨となっていた配列比較を削除 | | [非推奨となっていた列挙型の算術変換を削除](/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md) | C++20から非推奨となっていた列挙値への算術演算で算術型に暗黙変換される仕様を削除 | From eed2bbf0bf4f07d57639db62b8c21806f64c19fd Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Fri, 2 May 2025 22:10:50 +0900 Subject: [PATCH 1643/3948] =?UTF-8?q?C++26=20=E6=9C=AA=E5=88=9D=E6=9C=9F?= =?UTF-8?q?=E5=8C=96=E5=A4=89=E6=95=B0=E3=81=AE=E8=AA=AD=E3=81=BF=E5=8F=96?= =?UTF-8?q?=E3=82=8A=20:=20=E8=A1=A8=E7=8F=BE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26/erroneous_behavior_for_uninitialized_reads.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md index 4f118a77dd..d3f5519aa9 100644 --- a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md +++ b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md @@ -132,7 +132,7 @@ int main() { | 算術型の変換結果としてその型の表現可能な範囲を超えた | 符号付き整数のオーバーフローと同じ | | 誤ったビットシフト (負のシフト幅や、上限を超えたシフト幅) | 符号付き整数のオーバーフローと同じ | | ゼロ割り | いくつかの固定値での誤った結果となる可能性がある。影響が不明確であるため、変更にはコストがかかる | -| 戻り値型が非`void`な関数から返った、もしくは`[[noreturn]]`属性をつけた関数から返った | [`std::terminate()`](/reference/exception/terminate.md)が呼ばれる可能性がある。変更には軽いコストがかかるが、その変更にどの程度の価値があるかは不明 | +| 戻り値型が非`void`な関数で`return`なしに末尾に到達した、もしくは`[[noreturn]]`属性をつけた関数から返った | [`std::terminate()`](/reference/exception/terminate.md)が呼ばれる可能性がある。変更には軽いコストがかかるが、その変更にどの程度の価値があるかは不明 | | 抽象クラスのコンストラクタ・デストラクタからの純粋仮想関数の呼び出し | 特定の純粋仮想ハンドラが呼ばれる可能性がある。実装によってはすでにエラー性動作のように扱われている可能性がある | | 契約違反 | 契約に関する現在の策定作業では、契約違反時になにが起こるべきかという問題に直面している。エラー性動作という概念は有用な回答を与えてくれる可能性がある | From e5b2c4ff4326727d93793b102a4d229f96955b35 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Fri, 2 May 2025 22:41:27 +0900 Subject: [PATCH 1644/3948] =?UTF-8?q?C++26=20=E5=B1=9E=E6=80=A7=E3=81=AE?= =?UTF-8?q?=E7=84=A1=E8=A6=96=E6=80=A7=E3=82=92=E8=A6=8B=E7=9B=B4=E3=81=97?= =?UTF-8?q?=20:=20=E3=82=AA=E3=83=96=E3=82=B8=E3=82=A7=E3=82=AF=E3=83=88?= =?UTF-8?q?=E3=82=B5=E3=82=A4=E3=82=BA=E3=81=AE=E8=AA=AC=E6=98=8E=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26/on_the_ignorability_of_standard_attributes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp26/on_the_ignorability_of_standard_attributes.md b/lang/cpp26/on_the_ignorability_of_standard_attributes.md index a814c7c269..c522b04b73 100644 --- a/lang/cpp26/on_the_ignorability_of_standard_attributes.md +++ b/lang/cpp26/on_the_ignorability_of_standard_attributes.md @@ -42,7 +42,7 @@ int h(); ### 2. 意味論的な無視性 適格なプログラムが与えられた際、特定の標準属性のインスタンスをすべて削除し、プログラムの観測可能な振る舞いを変化させることが実装に許可される。ただし、削除後の動作が削除前のプログラムにとって適合動作 (conforming behaviour) である場合に限られる。 -例として、空のオブジェクトのサイズを削減する[`[[no_unique_address]]`](/lang/cpp20/language_support_for_empty_objects.md)において、`sizeof(Y)`は[`[[no_unique_address]]`](/lang/cpp20/language_support_for_empty_objects.md)属性が無視されなければ`sizeof(int)`と同値となり、無視されれば`sizeof(X) + sizeof(int)`となる。 +例として、空のオブジェクトのサイズを削減する[`[[no_unique_address]]`](/lang/cpp20/language_support_for_empty_objects.md)において、`sizeof(Y)`は[`[[no_unique_address]]`](/lang/cpp20/language_support_for_empty_objects.md)属性が無視されなければ`sizeof(int)`と同値となり、無視されれば`sizeof(X) + sizeof(int)`以上の値となる。 ```cpp struct X {}; From 4097b491d2a847e31bf7a639021608b4e7566c90 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sat, 3 May 2025 11:56:58 +0900 Subject: [PATCH 1645/3948] fix: Fixed wrong implementation code for islower() --- reference/cctype/islower.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cctype/islower.md b/reference/cctype/islower.md index fc0bc99110..8b59a88314 100644 --- a/reference/cctype/islower.md +++ b/reference/cctype/islower.md @@ -51,7 +51,7 @@ islower('\n') = 0 islower('0x0f') = 0 ``` -## 実装例 +## 実装例(ASCII互換文字コードの場合) ```cpp int islower(int ch) { return ch >= 'a' && ch <= 'z'; From 2750049cc5adfcd9b6a3daa17c1860409ea62b8e Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sat, 3 May 2025 12:01:40 +0900 Subject: [PATCH 1646/3948] Revert "reference/cctype/isspace.md: Created sample implementation" This reverts commit 3527568f5c5f8c59b00f4ee03ae050d3ca62ebac. I've reverted it because it causes confusion. --- reference/cctype/isspace.md | 9 --------- 1 file changed, 9 deletions(-) diff --git a/reference/cctype/isspace.md b/reference/cctype/isspace.md index 26a1e8f7f4..087dd8fc27 100644 --- a/reference/cctype/isspace.md +++ b/reference/cctype/isspace.md @@ -50,12 +50,3 @@ isspace(' ') = 8192 isspace('\n') = 8192 isspace('0x0f') = 0 ``` - -## 実装例 -```cpp -int isspace(int ch) { - return ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n' || ch == '\v' || ch == '\f'; -} -``` - - From a094fcee1a4b4c49184fdd7cf9efcb843d384676 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sat, 3 May 2025 12:05:02 +0900 Subject: [PATCH 1647/3948] fix: Added information for isupper --- reference/cctype/isupper.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cctype/isupper.md b/reference/cctype/isupper.md index 340872faf8..54f3607131 100644 --- a/reference/cctype/isupper.md +++ b/reference/cctype/isupper.md @@ -51,7 +51,7 @@ isupper('\n') = 0 isupper('0x0f') = 0 ``` -## 実装例 +## 実装例(ASCII互換文字コードの場合) ```cpp int isupper(int ch) { return ch >= 'A' && ch <= 'Z'; From 46a42fed15df3f18863d3cbd30e28792dc48b98e Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sat, 3 May 2025 12:05:20 +0900 Subject: [PATCH 1648/3948] fix: Added proper info for tolower and toupper --- reference/cctype/tolower.md | 2 +- reference/cctype/toupper.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/cctype/tolower.md b/reference/cctype/tolower.md index 88da612c6b..b87aa22a59 100644 --- a/reference/cctype/tolower.md +++ b/reference/cctype/tolower.md @@ -43,7 +43,7 @@ tolower('.') = . tolower('$') = $ ``` -## 実装例 +## 実装例(ASCII互換文字コードの場合) ```cpp int tolower(int ch) { if (isupper(ch)) { diff --git a/reference/cctype/toupper.md b/reference/cctype/toupper.md index ca21a56521..c2a7f23a50 100644 --- a/reference/cctype/toupper.md +++ b/reference/cctype/toupper.md @@ -43,7 +43,7 @@ toupper('.') = . toupper('$') = $ ``` -## 実装例 +## 実装例(ASCII互換文字コードの場合) ```cpp int toupper(int ch) { if (islower(ch)) { From f1e2743364723be072c160d2d74dc1e33a53fa76 Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 5 May 2025 00:45:38 +0900 Subject: [PATCH 1649/3948] execution: tag_of_t (#1384) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 標準Senderアルゴリズムの第1要素を"Senderアルゴリズムタグ"に統一。 (P2999R3では単にalgorithm tagと言及されるがSenderとの関連性を強調) --- reference/execution/execution.md | 2 +- .../execution/execution/basic-operation.md | 8 +- reference/execution/execution/basic-sender.md | 3 +- .../execution/default_domain/apply_sender.md | 2 +- .../execution/default_domain/transform_env.md | 4 +- .../default_domain/transform_sender.md | 4 +- reference/execution/execution/impls-for.md | 2 +- reference/execution/execution/just.md | 2 +- reference/execution/execution/make-sender.md | 3 +- reference/execution/execution/sender-for.md | 4 +- reference/execution/execution/tag_of_t.md | 75 +++++++++++++++++++ reference/execution/this_thread/sync_wait.md | 2 +- .../this_thread/sync_wait_with_variant.md | 2 +- 13 files changed, 95 insertions(+), 18 deletions(-) create mode 100644 reference/execution/execution/tag_of_t.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 705591d713..27947d8291 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -88,7 +88,7 @@ namespace std::execution { | [`execution::value_types_of_t`](execution/value_types_of_t.md) | Senderの値完了シグネチャ集合から指定操作で型を生成 (alias template) | C++26 | | [`execution::error_types_of_t`](execution/error_types_of_t.md) | Senderのエラー完了シグネチャ集合から指定操作で型を生成 (alias template) | C++26 | | [`execution::sends_stopped`](execution/sends_stopped.md) | Senderが停止完了を送信しうるか否か (variable template) | C++26 | -| [`execution::tag_of_t`](execution/tag_of_t.md.nolink) | Senderのタグ型を取得 (alias template) | C++26 | +| [`execution::tag_of_t`](execution/tag_of_t.md) | Senderアルゴリズムタグを取得 (alias template) | C++26 | | [`execution::transform_sender`](execution/transform_sender.md) | Senderを変換 (function template) | C++26 | | [`execution::transform_env`](execution/transform_env.md) | 環境を変換 (function template) | C++26 | | [`execution::apply_sender`](execution/apply_sender.md) | Senderアルゴリズムを適用 (function template) | C++26 | diff --git a/reference/execution/execution/basic-operation.md b/reference/execution/execution/basic-operation.md index f1181fa9d8..01387276c2 100644 --- a/reference/execution/execution/basic-operation.md +++ b/reference/execution/execution/basic-operation.md @@ -38,7 +38,7 @@ namespace std::execution { } ``` * operation_state_t[link operation_state.md] -* tag_of_t[link tag_of_t.md.nolink] +* tag_of_t[link tag_of_t.md] * impls-for[link impls-for.md] * see below[italic] @@ -70,7 +70,7 @@ nothrow-callable>::get-state), Sndr, Rcvr&> && is_nothrow_constructible_v, get-state-result>) ``` * impls-for[link impls-for.md] -* tag_of_t[link tag_of_t.md.nolink] +* tag_of_t[link tag_of_t.md] * is_nothrow_move_constructible_v[link /reference/type_traits/is_nothrow_move_constructible.md] * is_nothrow_constructible_v[link /reference/type_traits/is_nothrow_constructible.md] @@ -80,7 +80,7 @@ nothrow-callable>::get-state), Sndr, Rcvr&> && call-result-t>::get-state), Sndr, Rcvr&>. ``` * impls-for[link impls-for.md] -* tag_of_t[link tag_of_t.md.nolink] +* tag_of_t[link tag_of_t.md] ## 説明専用エンティティ @@ -104,7 +104,7 @@ template using indices-for = remove_reference_t::indices-for; // exposition only ``` * impls-for[link impls-for.md] -* tag_of_t[link tag_of_t.md.nolink] +* tag_of_t[link tag_of_t.md] * decay_t[link /reference/type_traits/decay.md] * remove_reference_t[link /reference/type_traits/remove_reference.md] * see below[italic] diff --git a/reference/execution/execution/basic-sender.md b/reference/execution/execution/basic-sender.md index 1d9d0c7da4..99c0e01c1f 100644 --- a/reference/execution/execution/basic-sender.md +++ b/reference/execution/execution/basic-sender.md @@ -44,7 +44,7 @@ namespace std::execution { `basic-sender`は[`sender`](sender.md)のモデルであり、[Senderアルゴリズム構築](make-sender.md)の結果型として利用される。 -- `Tag` : [Senderタグ](tag_of_t.md.nolink)(例:[`just`](just.md), [`then`](then.md.nolink)) +- `Tag` : [Senderアルゴリズムタグ](tag_of_t.md)(例:[`just`](just.md), [`then`](then.md.nolink)) - `Data` : Senderアルゴリズムに指定された追加の引数。複数個の引数は[`product-type`](product-type.md.nolink)型を用いて単一値として保持する。 - `Child` : 子Senderのリスト。Senderファクトリでは0個、Senderアダプタでは通常1個の子Senderを保持する。 @@ -88,4 +88,5 @@ using completion-signatures-for = see below; // exposition only ## 参照 +- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/default_domain/apply_sender.md b/reference/execution/execution/default_domain/apply_sender.md index 0cfb8669cd..1c93cc05a1 100644 --- a/reference/execution/execution/default_domain/apply_sender.md +++ b/reference/execution/execution/default_domain/apply_sender.md @@ -17,7 +17,7 @@ constexpr decltype(auto) apply_sender(Tag, Sndr&& sndr, Args&&... args) Senderアルゴリズム適用のデフォルト動作。 [`execution::apply_sender`](../apply_sender.md)に対するスタマイゼーションポイントとして機能する。 -[Senderタグ型](../tag_of_t.md.nolink)`Tag`に対して、`apply_sender`メンバ関数を呼び出す。 +[Senderアルゴリズムタグ型](../tag_of_t.md)`Tag`に対して、`apply_sender`メンバ関数を呼び出す。 ## テンプレートパラメータ制約 diff --git a/reference/execution/execution/default_domain/transform_env.md b/reference/execution/execution/default_domain/transform_env.md index f1afcc21bf..cdc915cddd 100644 --- a/reference/execution/execution/default_domain/transform_env.md +++ b/reference/execution/execution/default_domain/transform_env.md @@ -16,7 +16,7 @@ template 環境変換のデフォルト動作。 [`execution::transform_env`](../transform_env.md)に対するスタマイゼーションポイントとして機能する。 -- 定義されていれば、[Senderタグ型](../tag_of_t.md.nolink)の`transform_env`メンバ関数に変換動作を委譲する。 +- 定義されていれば、[Senderアルゴリズムタグ型](../tag_of_t.md)の`transform_env`メンバ関数に変換動作を委譲する。 - そうでなければ、無変換。 @@ -27,7 +27,7 @@ template ## 効果 説明用の式`e`を次の通りとしたとき、`e`を返す。 -- 適格であるならば、式[`tag_of_t`](tag_of_t.md.nolink)`().transform_env(`[`std::forward`](/reference/utility/forward.md)`(sndr),` [`std::forward`](/reference/utility/forward.md)`(env))` +- 適格であるならば、式[`tag_of_t`](../tag_of_t.md)`().transform_env(`[`std::forward`](/reference/utility/forward.md)`(sndr),` [`std::forward`](/reference/utility/forward.md)`(env))` - そうでなければ、`static_cast(`[`std::forward`](/reference/utility/forward.md)`(env))` diff --git a/reference/execution/execution/default_domain/transform_sender.md b/reference/execution/execution/default_domain/transform_sender.md index 06f856bb70..4886480afa 100644 --- a/reference/execution/execution/default_domain/transform_sender.md +++ b/reference/execution/execution/default_domain/transform_sender.md @@ -19,14 +19,14 @@ constexpr sender decltype(auto) transform_sender(Sndr&& sndr, const Env&... env) Sender変換のデフォルト動作。 [`execution::transform_sender`](../transform_sender.md)に対するスタマイゼーションポイントとして機能する。 -- 定義されていれば、[Senderタグ型](../tag_of_t.md.nolink)の`transform_sender`メンバ関数に変換動作を委譲する。 +- 定義されていれば、[Senderアルゴリズムタグ型](../tag_of_t.md)の`transform_sender`メンバ関数に変換動作を委譲する。 - そうでなければ、無変換。 ## 効果 説明用の式`e`を次の通りとしたとき、`e`を返す。 -- 適格であるならば、式[`tag_of_t`](tag_of_t.md.nolink)`().transform_sender(`[`std::forward`](/reference/utility/forward.md)`(sndr), env...)` +- 適格であるならば、式[`tag_of_t`](../tag_of_t.md)`().transform_sender(`[`std::forward`](/reference/utility/forward.md)`(sndr), env...)` - そうでなければ、[`std::forward`](/reference/utility/forward.md)`(sndr)` diff --git a/reference/execution/execution/impls-for.md b/reference/execution/execution/impls-for.md index e21c5f00bb..68ee4ec989 100644 --- a/reference/execution/execution/impls-for.md +++ b/reference/execution/execution/impls-for.md @@ -23,7 +23,7 @@ namespace std::execution { ## 概要 `impls-for`は、Senderアルゴリズム動作仕様定義で用いられる説明専用のクラステンプレートである。 -説明専用のクラス`default-impls`にてSenderアルゴリズム共通動作を記述し、[Senderタグ](tag_of_t.md.nolink)`Tag`を用いて`impls-for`特殊化を定義することでSenderアルゴリズム固有動作を静的にオーバーライドする。 +説明専用のクラス`default-impls`にてSenderアルゴリズム共通動作を記述し、[Senderアルゴリズムタグ型](tag_of_t.md)`Tag`を用いて`impls-for`特殊化を定義することでSenderアルゴリズムの固有動作を静的にオーバーライドする。 ## 説明専用クラス `default-impls` diff --git a/reference/execution/execution/just.md b/reference/execution/execution/just.md index 535828449b..6bab6f1044 100644 --- a/reference/execution/execution/just.md +++ b/reference/execution/execution/just.md @@ -21,7 +21,7 @@ namespace std::execution { - そうでなければ、式[`make-sender`](make-sender.md)`(just,` [`product-type`](product-type.md.nolink)`{ts...})`と等価。 -### Senderタグ `just` +### Senderアルゴリズムタグ `just` Senderアルゴリズム動作説明用のクラステンプレート`impls-for`に対して、下記の特殊化が定義される。 ```cpp diff --git a/reference/execution/execution/make-sender.md b/reference/execution/execution/make-sender.md index b35e298235..e259594188 100644 --- a/reference/execution/execution/make-sender.md +++ b/reference/execution/execution/make-sender.md @@ -15,7 +15,7 @@ constexpr auto make-sender(Tag tag, Data&& data, Child&&... child); [`sender`](sender.md)のモデルである説明専用クラステンプレート[`basic-sender`](basic-sender.md)のインスタンスを生成する。 -- `Tag` : [Senderタグ](tag_of_t.md.nolink)(例:[`just`](just.md), [`then`](then.md.nolink)) +- `Tag` : [Senderアルゴリズムタグ](tag_of_t.md)(例:[`just`](just.md), [`then`](then.md.nolink)) - `Data` : Senderアルゴリズムに指定された追加の引数。複数個の引数は[`product-type`](product-type.md.nolink)型を用いて単一値として保持する。 - `Child` : 子Senderのリスト。Senderファクトリでは0個、Senderアダプタでは通常1個の子Senderを保持する。 @@ -44,4 +44,5 @@ constexpr auto make-sender(Tag tag, Data&& data, Child&&... child); ## 参照 +- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/sender-for.md b/reference/execution/execution/sender-for.md index 0c9d597971..1caf041e5d 100644 --- a/reference/execution/execution/sender-for.md +++ b/reference/execution/execution/sender-for.md @@ -13,10 +13,10 @@ namespace std::execution { } ``` * sender[link sender.md] -* tag_of_t[link tag_of_t.md.nolink] +* tag_of_t[link tag_of_t.md] ## 概要 -`sender-for`は、[Sender型](sender.md)`Sndr`が[Senderタグ型](tag_of_t.md.nolink)`Tag`を持つことを表す説明専用のコンセプトである。 +`sender-for`は、[Sender型](sender.md)`Sndr`が[Senderアルゴリズムタグ型](tag_of_t.md)`Tag`を持つことを表す説明専用のコンセプトである。 ## バージョン diff --git a/reference/execution/execution/tag_of_t.md b/reference/execution/execution/tag_of_t.md new file mode 100644 index 0000000000..83d4e4bd4c --- /dev/null +++ b/reference/execution/execution/tag_of_t.md @@ -0,0 +1,75 @@ +# tag_of_t +* execution[meta header] +* std::execution[meta namespace] +* type-alias[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template + using tag_of_t = see below; +} +``` +* see below[italic] + +## 概要 +[Sender型](sender.md)`Sndr`のSenderアルゴリズムタグ型を取得する。 + +説明用の`sndr`を`decltype((sndr))`が`Sndr`型となる式とする。型`tag_of_t`は下記の通り定義される。 + +- 次の宣言が適格であれば、`tag_of_t`は`decltype(auto(tag))`の別名となる。 + + ```cpp + auto&& [tag, data, ...children] = sndr; + ``` + +- そうでなければ、`tag_of_t`は不適格となる。 + + +### Senderアルゴリズムタグ +実行制御ライブラリのSenderアルゴリズムから生成された[Sender](sender.md)`sndr`は、[構造化束縛](/lang/cpp17/structured_bindings.md)によってSenderアルゴリズムタグ`tag`、データ`data`、0個以上の子Senderパック`...children`の組へと分解される。 + +この仕様は[Sender変換](transform_sender.md)が行われる可能性のあるSenderアルゴリズムに対してのみ要求されるものであり、ユーザ定義のSender型において構造化束縛による分解をサポートする必要はない。 + + +## 例 +```cpp example +#include +#include +namespace ex = std::execution; + +int main() +{ + ex::sender auto sndr = ex::just(42); + using Tag = ex::tag_of_t; + static_assert(std::same_as); +} +``` +* ex::tag_of_t[color ff0000] +* ex::sender[link sender.md] +* ex::just[link just.md] +* ex::just_t[link just.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`basic-sender`](basic-sender.md) + + +## 参照 +- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/this_thread/sync_wait.md b/reference/execution/this_thread/sync_wait.md index 98f7dc66c9..bb13274ddc 100644 --- a/reference/execution/this_thread/sync_wait.md +++ b/reference/execution/this_thread/sync_wait.md @@ -57,7 +57,7 @@ namespace std::this_thread { * type_identity_t[link /reference/type_traits/type_identity.md] -### Senderタグ `sync_wait` +### Senderアルゴリズムタグ `sync_wait` 説明用の`sndr`を`decltype((sndr))`が`Sndr`型となる式とする。 [`sender_to`](../execution/sender_to.md)`> == false`のとき、式`sync_wait.apply_sender(sndr)`は不適格となる。 diff --git a/reference/execution/this_thread/sync_wait_with_variant.md b/reference/execution/this_thread/sync_wait_with_variant.md index 711d8fca61..1a60b49929 100644 --- a/reference/execution/this_thread/sync_wait_with_variant.md +++ b/reference/execution/this_thread/sync_wait_with_variant.md @@ -54,7 +54,7 @@ namespace std::this_thread { * optional[link /reference/optional/optional.md] -### Senderタグ `sync_wait_with_variant` +### Senderアルゴリズムタグ `sync_wait_with_variant` 説明用の`sndr`を`decltype(`[`into_variant`](into_variant.md.nolink)`(sndr))`が`Sndr`型となる式とする。 `callable<`[`sync_wait_t`](sync_wait.md)`, Sndr> == false`のとき、式`sync_wait_with_variant.apply_sender(sndr)`は不適格となる。 From ff009c0bd1c4202c152a95f4705a598b34c2f821 Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 5 May 2025 10:13:51 +0900 Subject: [PATCH 1650/3948] execution: movable-value (#1384) --- reference/execution/execution/basic-sender.md | 2 +- reference/execution/execution/just.md | 2 +- reference/execution/execution/make-sender.md | 2 +- reference/execution/movable-value.md | 32 +++++++++++++++++++ 4 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 reference/execution/movable-value.md diff --git a/reference/execution/execution/basic-sender.md b/reference/execution/execution/basic-sender.md index 99c0e01c1f..f7a24b8958 100644 --- a/reference/execution/execution/basic-sender.md +++ b/reference/execution/execution/basic-sender.md @@ -63,7 +63,7 @@ is_nothrow_constructible_v, Self, Rcvr> 説明専用のエイリアステンプレート`completion-signatures-for`は、下記の通り定義される。 -``` +```cpp template using completion-signatures-for = see below; // exposition only ``` diff --git a/reference/execution/execution/just.md b/reference/execution/execution/just.md index 6bab6f1044..db4dad9673 100644 --- a/reference/execution/execution/just.md +++ b/reference/execution/execution/just.md @@ -17,7 +17,7 @@ namespace std::execution { ## 効果 -- 呼び出し式`just(ts...)`は、`(`[`movable-value`](movable-value.md.nolink)` &&...) == false`のとき不適格となる。 +- 呼び出し式`just(ts...)`は、`(`[`movable-value`](../movable-value.md)` &&...) == false`のとき不適格となる。 - そうでなければ、式[`make-sender`](make-sender.md)`(just,` [`product-type`](product-type.md.nolink)`{ts...})`と等価。 diff --git a/reference/execution/execution/make-sender.md b/reference/execution/execution/make-sender.md index e259594188..a916dba622 100644 --- a/reference/execution/execution/make-sender.md +++ b/reference/execution/execution/make-sender.md @@ -22,7 +22,7 @@ constexpr auto make-sender(Tag tag, Data&& data, Child&&... child); ## 適格要件 - [`semiregular`](/reference/concepts/semiregular.md)` == true` -- [`movable-value`](movable-value.md.nolink)` == true` +- [`movable-value`](../movable-value.md)` == true` - `(`[`sender`](sender.md)` && ...) == true` diff --git a/reference/execution/movable-value.md b/reference/execution/movable-value.md new file mode 100644 index 0000000000..39c5206fc2 --- /dev/null +++ b/reference/execution/movable-value.md @@ -0,0 +1,32 @@ +# movable-value +* execution[meta header] +* concept[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std { + template + concept movable-value = // exposition only + move_constructible> && + constructible_from, T> && + (!is_array_v>); +} +``` +* move_constructible[link /reference/concepts/move_constructible.md] +* constructible_from[link /reference/concepts/constructible_from.md] +* decay_t[link /reference/type_traits/decay.md] +* is_array_v[link /reference/type_traits/is_array.md] +* remove_reference_t[link /reference/type_traits/remove_reference.md] + +## 概要 +`movable-value`は、型`T`がムーブ構築可能な値であることを表す説明専用のコンセプトである。 + + +## バージョン +### 言語 +- C++26 + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) From b6538316195d92ec592dc5ad7335a4e3bd05a8d7 Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 5 May 2025 22:12:49 +0900 Subject: [PATCH 1651/3948] execution: product-type (#1384) --- .../execution/execution/basic-operation.md | 4 +- reference/execution/execution/basic-sender.md | 4 +- reference/execution/execution/just.md | 2 +- reference/execution/execution/make-sender.md | 2 +- reference/execution/execution/product-type.md | 72 +++++++++++++++++++ 5 files changed, 78 insertions(+), 6 deletions(-) create mode 100644 reference/execution/execution/product-type.md diff --git a/reference/execution/execution/basic-operation.md b/reference/execution/execution/basic-operation.md index 01387276c2..a099fa36a9 100644 --- a/reference/execution/execution/basic-operation.md +++ b/reference/execution/execution/basic-operation.md @@ -111,7 +111,7 @@ using indices-for = remove_reference_t::indices-for; // exposition only 説明専用の定数`connect-all`は、下記ラムダ式と等価な関数呼び出し可能なオブジェクトとして初期化される。 -- 全ての子Sender`child`とSenderアルゴリズム`sndr`の[Receiver](basic-receiver.md.nolink)を[接続(connect)](connect.md)し、結果の[Operation State](operation_state.md)リストを[`product-type`](product-type.md.nolink)型にまとめて返す。 +- 全ての子Sender`child`とSenderアルゴリズム`sndr`の[Receiver](basic-receiver.md.nolink)を[接続(connect)](connect.md)し、結果の[Operation State](operation_state.md)リストを[`product-type`](product-type.md)型にまとめて返す。 ```cpp []( @@ -124,7 +124,7 @@ using indices-for = remove_reference_t::indices-for; // exposition only } ``` * index_sequence[link /reference/utility/index_sequence.md] -* product-type[link product-type.md.nolink] +* product-type[link product-type.md] * connect[link connect.md] * basic-receiver[link basic-receiver.md.nolink] * integral_constant[link /reference/type_traits/integral_constant.md] diff --git a/reference/execution/execution/basic-sender.md b/reference/execution/execution/basic-sender.md index f7a24b8958..5339aa682a 100644 --- a/reference/execution/execution/basic-sender.md +++ b/reference/execution/execution/basic-sender.md @@ -30,7 +30,7 @@ namespace std::execution { }; } ``` -* product-type[link product-type.md.nolink] +* product-type[link product-type.md] * sender_t[link sender.md] * index_sequence_for[link /reference/utility/index_sequence_for.md] * impls-for[link impls-for.md] @@ -45,7 +45,7 @@ namespace std::execution { `basic-sender`は[`sender`](sender.md)のモデルであり、[Senderアルゴリズム構築](make-sender.md)の結果型として利用される。 - `Tag` : [Senderアルゴリズムタグ](tag_of_t.md)(例:[`just`](just.md), [`then`](then.md.nolink)) -- `Data` : Senderアルゴリズムに指定された追加の引数。複数個の引数は[`product-type`](product-type.md.nolink)型を用いて単一値として保持する。 +- `Data` : Senderアルゴリズムに指定された追加の引数。複数個の引数は[`product-type`](product-type.md)型を用いて単一値として保持する。 - `Child` : 子Senderのリスト。Senderファクトリでは0個、Senderアダプタでは通常1個の子Senderを保持する。 diff --git a/reference/execution/execution/just.md b/reference/execution/execution/just.md index db4dad9673..d4e168243d 100644 --- a/reference/execution/execution/just.md +++ b/reference/execution/execution/just.md @@ -18,7 +18,7 @@ namespace std::execution { ## 効果 - 呼び出し式`just(ts...)`は、`(`[`movable-value`](../movable-value.md)` &&...) == false`のとき不適格となる。 -- そうでなければ、式[`make-sender`](make-sender.md)`(just,` [`product-type`](product-type.md.nolink)`{ts...})`と等価。 +- そうでなければ、式[`make-sender`](make-sender.md)`(just,` [`product-type`](product-type.md)`{ts...})`と等価。 ### Senderアルゴリズムタグ `just` diff --git a/reference/execution/execution/make-sender.md b/reference/execution/execution/make-sender.md index a916dba622..5c2b8be446 100644 --- a/reference/execution/execution/make-sender.md +++ b/reference/execution/execution/make-sender.md @@ -16,7 +16,7 @@ constexpr auto make-sender(Tag tag, Data&& data, Child&&... child); [`sender`](sender.md)のモデルである説明専用クラステンプレート[`basic-sender`](basic-sender.md)のインスタンスを生成する。 - `Tag` : [Senderアルゴリズムタグ](tag_of_t.md)(例:[`just`](just.md), [`then`](then.md.nolink)) -- `Data` : Senderアルゴリズムに指定された追加の引数。複数個の引数は[`product-type`](product-type.md.nolink)型を用いて単一値として保持する。 +- `Data` : Senderアルゴリズムに指定された追加の引数。複数個の引数は[`product-type`](product-type.md)型を用いて単一値として保持する。 - `Child` : 子Senderのリスト。Senderファクトリでは0個、Senderアダプタでは通常1個の子Senderを保持する。 diff --git a/reference/execution/execution/product-type.md b/reference/execution/execution/product-type.md new file mode 100644 index 0000000000..7c2cd45bd0 --- /dev/null +++ b/reference/execution/execution/product-type.md @@ -0,0 +1,72 @@ +# product-type +* execution[meta header] +* class template[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +template +struct product-type { // exposition only + T0 t0; // exposition only + T1 t1; // exposition only + // ... + Tn tn; // exposition only + + template + constexpr decltype(auto) get(this Self&& self) noexcept; // exposition only + + template + constexpr decltype(auto) apply(this Self&& self, Fn&& fn) // exposition only + noexcept(see below); +}; +``` +* see below[italic] + +## 概要 +`product-type`は、実行制御ライブラリの仕様定義で用いられる説明専用のクラステンプレートである。 + +`product-type`型の式は[構造化束縛](/lang/cpp17/structured_bindings.md)における初期化子として利用できる。 + + +## クラス仕様 +```cpp +template +constexpr decltype(auto) get(this Self&& self) noexcept; +``` + +- 効果 : 下記と等価 + + ```cpp + auto& [...ts] = self; + return std::forward_like(ts...[I]); + ``` + +```cpp +template +constexpr decltype(auto) apply(this Self&& self, Fn&& fn) noexcept(see below); +``` +* see below[italic] + +- テンプレートパラメータ制約 : 下記`return`文の式が適格であること。 +- 効果 : 下記と等価 + + ```cpp + auto& [...ts] = self; + return std::forward(fn)(std::forward_like(ts)...); + ``` + +- 備考 : `noexcept`節の式は上記`return`文が潜在的に例外送出しないならば`true`に、そうでなければ`false`となる。 + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`basic-sender`](basic-sender.md) + + +## 参照 +- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) From cef1c672e452f8d1edf9ca376b84761d197736bc Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 5 May 2025 23:05:03 +0900 Subject: [PATCH 1652/3948] execution: decays-to,decayed-tuple,variant-or-empty (#1384) --- reference/execution/decays-to.md | 25 +++++++++++ .../execution/execution/basic-operation.md | 2 + reference/execution/execution/basic-sender.md | 3 ++ .../execution/execution/decayed-tuple.md | 31 +++++++++++++ .../execution/execution/error_types_of_t.md | 2 +- reference/execution/execution/impls-for.md | 2 + reference/execution/execution/just.md | 2 + reference/execution/execution/product-type.md | 11 +++-- reference/execution/execution/prop.md | 2 +- reference/execution/execution/set_error.md | 1 + reference/execution/execution/set_stopped.md | 1 + reference/execution/execution/set_value.md | 1 + .../execution/execution/value_types_of_t.md | 4 +- .../execution/execution/variant-or-empty.md | 43 +++++++++++++++++++ reference/execution/this_thread/sync_wait.md | 2 +- .../this_thread/sync_wait_with_variant.md | 2 +- 16 files changed, 124 insertions(+), 10 deletions(-) create mode 100644 reference/execution/decays-to.md create mode 100644 reference/execution/execution/decayed-tuple.md create mode 100644 reference/execution/execution/variant-or-empty.md diff --git a/reference/execution/decays-to.md b/reference/execution/decays-to.md new file mode 100644 index 0000000000..f949e239d4 --- /dev/null +++ b/reference/execution/decays-to.md @@ -0,0 +1,25 @@ +# decays-to +* execution[meta header] +* concept[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std { + template + concept decays-to = same_as, To>; // exposition only +} +``` +* decay_t[link /reference/type_traits/decay.md] + +## 概要 +`decays-to`は、型`From`の[decay](/reference/type_traits/decay.md)結果が型`To`に一致することを表す説明専用のコンセプトである。 + + +## バージョン +### 言語 +- C++26 + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/basic-operation.md b/reference/execution/execution/basic-operation.md index a099fa36a9..4133f39ad0 100644 --- a/reference/execution/execution/basic-operation.md +++ b/reference/execution/execution/basic-operation.md @@ -40,6 +40,7 @@ namespace std::execution { * operation_state_t[link operation_state.md] * tag_of_t[link tag_of_t.md] * impls-for[link impls-for.md] +* std::move[link /reference/utility/move.md] * see below[italic] ## 概要 @@ -71,6 +72,7 @@ nothrow-callable>::get-state), Sndr, Rcvr&> && ``` * impls-for[link impls-for.md] * tag_of_t[link tag_of_t.md] +* nothrow-callable[link /reference/functional/nothrow-callable.md.nolink] * is_nothrow_move_constructible_v[link /reference/type_traits/is_nothrow_move_constructible.md] * is_nothrow_constructible_v[link /reference/type_traits/is_nothrow_constructible.md] diff --git a/reference/execution/execution/basic-sender.md b/reference/execution/execution/basic-sender.md index 5339aa682a..e6f94ef1e4 100644 --- a/reference/execution/execution/basic-sender.md +++ b/reference/execution/execution/basic-sender.md @@ -34,8 +34,10 @@ namespace std::execution { * sender_t[link sender.md] * index_sequence_for[link /reference/utility/index_sequence_for.md] * impls-for[link impls-for.md] +* decays-to[link ../decays-to.md] * receiver[link receiver.md] * basic-operation[link basic-operation.md] +* std::move[link /reference/utility/move.md] * this Self[link /lang/cpp23/deducing_this.md.nolink] * see below[italic] @@ -84,6 +86,7 @@ using completion-signatures-for = see below; // exposition only ## 関連項目 - [`make-sender`](make-sender.md) +- [`basic-operation`](basic-operation.md) - [`execution::sender`](sender.md) diff --git a/reference/execution/execution/decayed-tuple.md b/reference/execution/execution/decayed-tuple.md new file mode 100644 index 0000000000..6c2c486e11 --- /dev/null +++ b/reference/execution/execution/decayed-tuple.md @@ -0,0 +1,31 @@ +# decayed-tuple +* execution[meta header] +* std::execution[meta namespace] +* type-alias[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template + using decayed-tuple = tuple...>; // exposition only +} +``` +* tuple[link /reference/tuple/tuple.md] +* decay_t[link /reference/type_traits/decay.md] + +## 概要 +`decayed-tuple`は、型パラメータパック`Ts`から[decay](/reference/type_traits/decay.md)結果を要素型とする[`tuple`](/reference/tuple/tuple.md)型を作成する説明専用のエイリアステンプレートである。 + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`execution::value_types_of_t`](value_types_of_t.md) +- [`this_thread::sync_wait`](../this_thread/sync_wait.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/error_types_of_t.md b/reference/execution/execution/error_types_of_t.md index 10b6d9bcf5..d3e6fe645a 100644 --- a/reference/execution/execution/error_types_of_t.md +++ b/reference/execution/execution/error_types_of_t.md @@ -15,7 +15,7 @@ namespace std::execution { ``` * env<>[link env.md] * sender_in[link sender_in.md] -* variant-or-empty[link variant-or-empty.md.nolink] +* variant-or-empty[link variant-or-empty.md] * gather-signatures[link gather-signatures.md] * set_error_t[link set_error.md] * completion_signatures_of_t[link completion_signatures_of_t.md] diff --git a/reference/execution/execution/impls-for.md b/reference/execution/execution/impls-for.md index 68ee4ec989..2e1aaa8a22 100644 --- a/reference/execution/execution/impls-for.md +++ b/reference/execution/execution/impls-for.md @@ -107,6 +107,8 @@ namespace std::execution { Tag()(std::move(rcvr), std::forward(args)...); } ``` +* callable[link /reference/functional/callable.md.nolink] +* std::move[link /reference/utility/move.md] ## バージョン diff --git a/reference/execution/execution/just.md b/reference/execution/execution/just.md index d4e168243d..f8183b8195 100644 --- a/reference/execution/execution/just.md +++ b/reference/execution/execution/just.md @@ -36,9 +36,11 @@ namespace std::execution { }; } ``` +* decayed-typeof[link decayed-typeof.md.nolink] * impls-for[link impls-for.md] * default-impls[link impls-for.md] * set_value[link set_value.md] +* std::move[link /reference/utility/move.md] ## 例 diff --git a/reference/execution/execution/product-type.md b/reference/execution/execution/product-type.md index 7c2cd45bd0..daa0b71a9c 100644 --- a/reference/execution/execution/product-type.md +++ b/reference/execution/execution/product-type.md @@ -20,6 +20,7 @@ struct product-type { // exposition only noexcept(see below); }; ``` +* this Self[link /lang/cpp23/deducing_this.md.nolink] * see below[italic] ## 概要 @@ -33,18 +34,20 @@ struct product-type { // exposition only template constexpr decltype(auto) get(this Self&& self) noexcept; ``` +* this Self[link /lang/cpp23/deducing_this.md.nolink] - 効果 : 下記と等価 - ```cpp - auto& [...ts] = self; - return std::forward_like(ts...[I]); - ``` + ```cpp + auto& [...ts] = self; + return std::forward_like(ts...[I]); + ``` ```cpp template constexpr decltype(auto) apply(this Self&& self, Fn&& fn) noexcept(see below); ``` +* this Self[link /lang/cpp23/deducing_this.md.nolink] * see below[italic] - テンプレートパラメータ制約 : 下記`return`文の式が適格であること。 diff --git a/reference/execution/execution/prop.md b/reference/execution/execution/prop.md index 05055d8db2..a54a73074b 100644 --- a/reference/execution/execution/prop.md +++ b/reference/execution/execution/prop.md @@ -27,7 +27,7 @@ namespace std::execution { ## 適格要件 -説明用の`prop-like`テンプレートクラスを用いて、`QueryTag`と`ValueType`が`callable>`のモデルであること。 +説明用の`prop-like`テンプレートクラスを用いて、`QueryTag`と`ValueType`が[`callable`](/reference/functional/callable.md.nolink)`>`のモデルであること。 ```cpp template diff --git a/reference/execution/execution/set_error.md b/reference/execution/execution/set_error.md index f98c2cb99a..97867367a3 100644 --- a/reference/execution/execution/set_error.md +++ b/reference/execution/execution/set_error.md @@ -57,6 +57,7 @@ int main() ``` * ex::set_error[color ff0000] * ex::receiver_t[link receiver.md] +* std::move[link /reference/utility/move.md] ### 出力 ``` diff --git a/reference/execution/execution/set_stopped.md b/reference/execution/execution/set_stopped.md index d3963f57bb..8514e25fee 100644 --- a/reference/execution/execution/set_stopped.md +++ b/reference/execution/execution/set_stopped.md @@ -57,6 +57,7 @@ int main() ``` * ex::set_stopped[color ff0000] * ex::receiver_t[link receiver.md] +* std::move[link /reference/utility/move.md] ### 出力 ``` diff --git a/reference/execution/execution/set_value.md b/reference/execution/execution/set_value.md index 65984ab5b1..085ec50f3a 100644 --- a/reference/execution/execution/set_value.md +++ b/reference/execution/execution/set_value.md @@ -57,6 +57,7 @@ int main() ``` * ex::set_value[color ff0000] * ex::receiver_t[link receiver.md] +* std::move[link /reference/utility/move.md] ### 出力 ``` diff --git a/reference/execution/execution/value_types_of_t.md b/reference/execution/execution/value_types_of_t.md index 48bebc2087..d2f0ec8b43 100644 --- a/reference/execution/execution/value_types_of_t.md +++ b/reference/execution/execution/value_types_of_t.md @@ -16,8 +16,8 @@ namespace std::execution { ``` * env<>[link env.md] * sender_in[link sender_in.md] -* decayed-tuple[link decayed-tuple.md.nolink] -* variant-or-empty[link variant-or-empty.md.nolink] +* decayed-tuple[link decayed-tuple.md] +* variant-or-empty[link variant-or-empty.md] * gather-signatures[link gather-signatures.md] * set_value_t[link set_value.md] * completion_signatures_of_t[link completion_signatures_of_t.md] diff --git a/reference/execution/execution/variant-or-empty.md b/reference/execution/execution/variant-or-empty.md new file mode 100644 index 0000000000..81dbe5e7b9 --- /dev/null +++ b/reference/execution/execution/variant-or-empty.md @@ -0,0 +1,43 @@ +# variant-or-empty +* execution[meta header] +* std::execution[meta namespace] +* type-alias[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template + using variant-or-empty = see below; // exposition only +} +``` +* see below[italic] + +## 概要 +`variant-or-empty`は、型パラメータパック`Ts`から[decay](/reference/type_traits/decay.md)結果を要素型とする[`variant`](/reference/variant/variant.md)型を作成する説明専用のエイリアステンプレートである。 + +型`variant-or-empty`は下記の通り定義される。 + +- `sizeof...(Ts) > 0`ならば、説明用のパック`Us`を[`decay_t`](/reference/type_traits/decay.md)`...`から重複削除したものとしたとき、`variant-or-empty`は[`variant`](/reference/variant/variant.md)[``]型となる。 +- そうでなければ、`variant-or-empty`は下記の説明専用クラス型となる。 + + ```cpp + namespace std::execution { + struct empty-variant { // exposition only + empty-variant() = delete; + }; + } + ``` + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`execution::value_types_of_t`](value_types_of_t.md) +- [`execution::error_types_of_t`](error_types_of_t.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/this_thread/sync_wait.md b/reference/execution/this_thread/sync_wait.md index bb13274ddc..a82fc3256b 100644 --- a/reference/execution/this_thread/sync_wait.md +++ b/reference/execution/this_thread/sync_wait.md @@ -53,7 +53,7 @@ namespace std::this_thread { * sync-wait-env[link sync-wait-env.md] * execution::value_types_of_t[link ../execution/value_types_of_t.md] * optional[link /reference/optional/optional.md] -* decayed-tuple[link decayed-tuple.md.nolink] +* decayed-tuple[link ../execution/decayed-tuple.md] * type_identity_t[link /reference/type_traits/type_identity.md] diff --git a/reference/execution/this_thread/sync_wait_with_variant.md b/reference/execution/this_thread/sync_wait_with_variant.md index 1a60b49929..9754db1d42 100644 --- a/reference/execution/this_thread/sync_wait_with_variant.md +++ b/reference/execution/this_thread/sync_wait_with_variant.md @@ -57,7 +57,7 @@ namespace std::this_thread { ### Senderアルゴリズムタグ `sync_wait_with_variant` 説明用の`sndr`を`decltype(`[`into_variant`](into_variant.md.nolink)`(sndr))`が`Sndr`型となる式とする。 -`callable<`[`sync_wait_t`](sync_wait.md)`, Sndr> == false`のとき、式`sync_wait_with_variant.apply_sender(sndr)`は不適格となる。 +[`callable`](/reference/functional/callable.md.nolink)`<`[`sync_wait_t`](sync_wait.md)`, Sndr> == false`のとき、式`sync_wait_with_variant.apply_sender(sndr)`は不適格となる。 そうでなければ、式`sync_wait_with_variant.apply_sender(sndr)`は下記と等価。 From 1cb82c9590ce1f665e860086eea904461d1c7ffe Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 5 May 2025 23:58:47 +0900 Subject: [PATCH 1653/3948] execution: forwarding_query (#1384) --- reference/execution/execution.md | 6 +- .../execution/get_completion_scheduler.md | 2 +- .../execution/get_delegation_scheduler.md | 2 +- reference/execution/execution/get_domain.md | 2 +- .../execution/execution/get_scheduler.md | 2 +- reference/execution/execution/impls-for.md | 2 + reference/execution/forwarding_query.md | 73 +++++++++++++++++++ reference/execution/get_allocator.md | 2 +- reference/execution/get_stop_token.md | 2 +- .../this_thread/sync-wait-receiver.md | 2 +- 10 files changed, 85 insertions(+), 10 deletions(-) create mode 100644 reference/execution/forwarding_query.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 27947d8291..10a8dbed17 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -35,15 +35,15 @@ namespace std::execution { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`forwarding_query`](forwarding_query.md.nolink) | クエリオブジェクトに転送問い合わせ可能か否かを返す (customization point object) | C++26 | +| [`forwarding_query`](forwarding_query.md) | 対象クエリオブジェクトの転送可否を取得するクエリオブジェクト (customization point object) | C++26 | | [`get_allocator`](get_allocator.md) | アロケータ取得のクエリオブジェクト (customization point object) | C++26 | | [`get_stop_token`](get_stop_token.md) | 停止トークン取得のクエリオブジェクト (customization point object) | C++26 | | [`stop_token_of_t`](stop_token_of_t.md) | 指定型から停止トークン型を取得 (alias template) | C++26 | | [`execution::get_domain`](execution/get_domain.md) | 実行ドメイン取得のクエリオブジェクト (customization point object) | C++26 | | [`execution::get_scheduler`](execution/get_scheduler.md) | Scheduler取得のクエリオブジェクト (customization point object) | C++26 | | [`execution::get_delegation_scheduler`](execution/get_delegation_scheduler.md) | 委任Scheduler取得のクエリオブジェクト (customization point object) | C++26 | -| [`execution::forward_progress_guarantee`](execution/forward_progress_guarantee.md.nolink) | 前進保証 (enum) | C++26 | -| [`execution::get_forward_progress_guarantee`](execution/get_forward_progress_guarantee.md.nolink) | 前進保証取得のクエリオブジェクト (customization point object) | C++26 | +| [`execution::forward_progress_guarantee`](execution/forward_progress_guarantee.md.nolink) | 前方進行保証 (enum) | C++26 | +| [`execution::get_forward_progress_guarantee`](execution/get_forward_progress_guarantee.md.nolink) | 前方進行保証取得のクエリオブジェクト (customization point object) | C++26 | | [`execution::get_completion_scheduler`](execution/get_completion_scheduler.md) | 完了Scheduler取得のクエリオブジェクト (customization point object) | C++26 | | [`execution::get_env`](execution/get_env.md) | 環境取得のクエリオブジェクト (customization point object) | C++26 | | [`execution::env_of_t`](execution/env_of_t.md) | 指定型から環境型を取得 (alias template) | C++26 | diff --git a/reference/execution/execution/get_completion_scheduler.md b/reference/execution/execution/get_completion_scheduler.md index 566ed43348..4a627a3464 100644 --- a/reference/execution/execution/get_completion_scheduler.md +++ b/reference/execution/execution/get_completion_scheduler.md @@ -19,7 +19,7 @@ namespace std::execution { `get_completion_scheduler`は、[Sender](sender.md)の[属性](get_env.md)から指定完了タグに関連付けられた完了Schedulerを取得する[クエリオブジェクト](../queryable.md)である。 完了タグ`completion-tag`には、[`set_value_t`](set_value.md), [`set_error_t`](set_error.md), [`set_stopped_t`](set_stopped.md)のいずれかを指定する。 -コア定数式[`forwarding_query`](forwarding_query.md.nolink)`(get_completion_scheduler)`は`true`値を返す。 +コア定数式[`forwarding_query`](../forwarding_query.md)`(get_completion_scheduler)`は`true`値を返す。 ### 完了Scheduler diff --git a/reference/execution/execution/get_delegation_scheduler.md b/reference/execution/execution/get_delegation_scheduler.md index 4e53900830..17b2428215 100644 --- a/reference/execution/execution/get_delegation_scheduler.md +++ b/reference/execution/execution/get_delegation_scheduler.md @@ -15,7 +15,7 @@ namespace std::execution { ## 概要 `get_delegation_scheduler`は、[クエリ可能オブジェクト](../queryable.md)から委任[Scheduler](scheduler.md)を取得する[クエリオブジェクト](../queryable.md)である。 -コア定数式[`forwarding_query`](forwarding_query.md.nolink)`(get_delegation_scheduler)`は`true`値を返す。 +コア定数式[`forwarding_query`](../forwarding_query.md)`(get_delegation_scheduler)`は`true`値を返す。 ## 効果 diff --git a/reference/execution/execution/get_domain.md b/reference/execution/execution/get_domain.md index c2162f2a9a..dfbbe540fe 100644 --- a/reference/execution/execution/get_domain.md +++ b/reference/execution/execution/get_domain.md @@ -15,7 +15,7 @@ namespace std::execution { ## 概要 `get_domain`は、[クエリ可能オブジェクト](../queryable.md)から[実行ドメイン](default_domain.md)のタグ型を取得する[クエリオブジェクト](../queryable.md)である。 -コア定数式[`forwarding_query`](forwarding_query.md.nolink)`(get_domain)`は`true`値を返す。 +コア定数式[`forwarding_query`](../forwarding_query.md)`(get_domain)`は`true`値を返す。 ## 効果 diff --git a/reference/execution/execution/get_scheduler.md b/reference/execution/execution/get_scheduler.md index bbca27bb16..b8a729419f 100644 --- a/reference/execution/execution/get_scheduler.md +++ b/reference/execution/execution/get_scheduler.md @@ -15,7 +15,7 @@ namespace std::execution { ## 概要 `get_scheduler`は、[クエリ可能オブジェクト](../queryable.md)から[Scheduler](scheduler.md)を取得する[クエリオブジェクト](../queryable.md)である。 -コア定数式[`forwarding_query`](forwarding_query.md.nolink)`(get_scheduler)`は`true`値を返す。 +コア定数式[`forwarding_query`](../forwarding_query.md)`(get_scheduler)`は`true`値を返す。 ## 効果 diff --git a/reference/execution/execution/impls-for.md b/reference/execution/execution/impls-for.md index 2e1aaa8a22..784f562611 100644 --- a/reference/execution/execution/impls-for.md +++ b/reference/execution/execution/impls-for.md @@ -44,6 +44,7 @@ namespace std::execution { return env<>(); } ``` +* FWD-ENV[link ../forwarding_query.md] * get_env[link get_env.md] * env<>[link env.md] @@ -59,6 +60,7 @@ namespace std::execution { return FWD-ENV(get_env(rcvr)); } ``` +* FWD-ENV[link ../forwarding_query.md] * get_env[link get_env.md] ### `get-state`メンバ diff --git a/reference/execution/forwarding_query.md b/reference/execution/forwarding_query.md new file mode 100644 index 0000000000..9421228d82 --- /dev/null +++ b/reference/execution/forwarding_query.md @@ -0,0 +1,73 @@ +# forwarding_query +* execution[meta header] +* cpo[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std { + struct forwarding_query_t { unspecified }; + inline constexpr forwarding_query_t forwarding_query{}; +} +``` +* unspecified[italic] + +## 概要 +`forwarding_query`は、対象[クエリオブジェクト](queryable.md)に対してクエリ可能アダプタを通じて転送可能か否かを確認するクエリオブジェクトである。 + + +### 説明専用の式 `FWD-ENV` +説明用の[クエリ可能オブジェクト](queryable.md)`env`、[クエリオブジェクト](queryable.md)`q`、パック式`as`に対して、式`FWD-ENV(env)`は下記の通り定義される。 + +- `forwarding_query(q) == false`ならば、式`FWD-ENV(env).query(q, as...)`は不適格となる。 +- そうでなければ、式`FWD-ENV(env)`は式`env.query(q, as...)`と等価であり、その型は[`queryable`](queryable.md)を満たす。 + + +## 効果 +説明用の式`q`を`Q`型の[クエリオブジェクト](queryable.md)としたとき、呼び出し式`forwarding_query(q)`は下記と等価であり、`bool`型の値となる。 + +- 式`q.query(forwarding_query)`が適格であれば、同式の`bool`値。 + - `q`がコア定数式ならば、`q.query(forwarding_query)`もコア定数式となる。 +- そうではなく、[`derived_from`](/reference/concepts/derived_from.md)` == true`ならば`true` +- そうでなければ、`false` + + +## カスタマイゼーションポイント +[クエリ可能オブジェクト](queryable.md)`q`に対して式`q.query(forwarding_query)`が呼び出される。 +このとき`noexcept(q.query(forwarding_query)) == true`であること。 + + +## 備考 +下記[クエリオブジェクト](queryable.md)に対する問い合わせは、`FWD-ENV`経由で転送される。 + +- `forwarding_query`自身 +- [`get_allocator`](get_allocator.md) +- [`get_stop_token`](get_stop_token.md) +- [`execution::get_domain`](execution/get_domain.md) +- [`execution::get_scheduler`](execution/get_scheduler.md) +- [`execution::get_delegation_scheduler`](execution/get_delegation_scheduler.md) +- [`execution::get_completion_scheduler`](execution/get_completion_scheduler.md) + +下記[クエリオブジェクト](queryable.md)に対する問い合わせは、`FWD-ENV`経由で転送されない。 + +- [`execution​::​get_env`](execution/get_env.md) +- [`executoin::get_forward_progress_guarantee`](executionget_forward_progress_guarantee.md.nolink) + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`impls-for`](execution/impls-for.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/get_allocator.md b/reference/execution/get_allocator.md index 79932980ca..4f0440975e 100644 --- a/reference/execution/get_allocator.md +++ b/reference/execution/get_allocator.md @@ -15,7 +15,7 @@ namespace std { ## 概要 `get_allocator`は、[クエリ可能オブジェクト](queryable.md)からアロケータを取得する[クエリオブジェクト](queryable.md)である。 -コア定数式[`forwarding_query`](forwarding_query.md.nolink)`(get_allocator)`は`true`値を返す。 +コア定数式[`forwarding_query`](forwarding_query.md)`(get_allocator)`は`true`値を返す。 ## 効果 diff --git a/reference/execution/get_stop_token.md b/reference/execution/get_stop_token.md index feb7b47788..26e2be5aae 100644 --- a/reference/execution/get_stop_token.md +++ b/reference/execution/get_stop_token.md @@ -15,7 +15,7 @@ namespace std { ## 概要 `get_stop_token`は、[クエリ可能オブジェクト](queryable.md)から[停止トークン](/reference/stop_token/stoppable_token.md)を取得する[クエリオブジェクト](queryable.md)である。 -コア定数式[`forwarding_query`](forwarding_query.md.nolink)`(get_stop_token)`は`true`値を返す。 +コア定数式[`forwarding_query`](forwarding_query.md)`(get_stop_token)`は`true`値を返す。 ## 効果 diff --git a/reference/execution/this_thread/sync-wait-receiver.md b/reference/execution/this_thread/sync-wait-receiver.md index 28b5d3e382..4599e85abf 100644 --- a/reference/execution/this_thread/sync-wait-receiver.md +++ b/reference/execution/this_thread/sync-wait-receiver.md @@ -71,7 +71,7 @@ void set_error(Error&& err) && noexcept 説明用の式`err`に対して`decltype((err))`を型`Err`としたとき、式`AS-EXCEPT-PTR(err)`を下記の通り定義する。 -- [`decay_t`](/reference/type_traits/decay.md)``が[`exception_ptr`](/reference/exception/exception_ptr.md)型と等しければ、`err`となる。このとき、事前条件として`!err == false`を満たすこと。 +- [`decay_t`](/reference/type_traits/decay.md)``が[`exception_ptr`](/reference/exception/exception_ptr.md)型と等しければ、`err`となる。このとき、事前条件として`!err == false`であること。 - そうではなく、[`decay_t`](/reference/type_traits/decay.md)``が[`error_code`](/reference/system_error/error_code.md)型と等しければ、[`make_exception_ptr`](/reference/exception/make_exception_ptr.md)`(`[`system_error`](/reference/system_error/system_error.md)`(err))`となる。 - そうでなければ、[`make_exception_ptr`](/reference/exception/make_exception_ptr.md)`(err)`となる。 From 7baad0148951dbf2404252dbfa98054f0aa114f1 Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 5 May 2025 23:59:56 +0900 Subject: [PATCH 1654/3948] execution/forwarding_query: remove forbid chars --- reference/execution/forwarding_query.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/execution/forwarding_query.md b/reference/execution/forwarding_query.md index 9421228d82..2d72071f71 100644 --- a/reference/execution/forwarding_query.md +++ b/reference/execution/forwarding_query.md @@ -50,7 +50,7 @@ namespace std { 下記[クエリオブジェクト](queryable.md)に対する問い合わせは、`FWD-ENV`経由で転送されない。 -- [`execution​::​get_env`](execution/get_env.md) +- [`execution::get_env`](execution/get_env.md) - [`executoin::get_forward_progress_guarantee`](executionget_forward_progress_guarantee.md.nolink) From 628698f67dc500aa1501e5abddec8f0954976e13 Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 7 May 2025 00:48:46 +0900 Subject: [PATCH 1655/3948] execution: then (#1384) basic-receiver --- reference/execution/execution.md | 2 +- .../execution/execution/basic-operation.md | 7 +- .../execution/execution/basic-receiver.md | 94 +++++++++++++ reference/execution/execution/basic-sender.md | 2 +- .../execution/get_completion_scheduler.md | 2 +- reference/execution/execution/impls-for.md | 6 +- reference/execution/execution/make-sender.md | 2 +- reference/execution/execution/schedule.md | 2 +- reference/execution/execution/then.md | 130 ++++++++++++++++++ 9 files changed, 236 insertions(+), 11 deletions(-) create mode 100644 reference/execution/execution/basic-receiver.md create mode 100644 reference/execution/execution/then.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 10a8dbed17..631483cb23 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -115,7 +115,7 @@ namespace std::execution { | [`execution::continues_on`](execution/continues_on.md.nolink) | 指定Scheduler上で継続する (customization point object) | C++26 | | [`execution::on`](execution/on.md.nolink) | 指定Scheduler上で実行する (customization point object) | C++26 | | [`execution::schedule_from`](execution/schedule_from.md.nolink) | Sender完了に依存する作業をスケジュール (customization point object) | C++26 | -| [`execution::then`](execution/then.md.nolink) | 値完了時の継続処理をアタッチ (customization point object) | C++26 | +| [`execution::then`](execution/then.md) | 値完了時の継続処理をアタッチ (customization point object) | C++26 | | [`execution::upon_error`](execution/upon_error.md.nolink) | エラー完了時の継続処理をアタッチ (customization point object) | C++26 | | [`execution::upon_stopped`](execution/upon_stopped.md.nolink) | 停止完了時の継続処理をアタッチ (customization point object) | C++26 | | [`execution::let_value`](execution/let_value.md.nolink) | 値完了の継続にユーザ定義処理を連結 (customization point object) | C++26 | diff --git a/reference/execution/execution/basic-operation.md b/reference/execution/execution/basic-operation.md index 4133f39ad0..73d0107477 100644 --- a/reference/execution/execution/basic-operation.md +++ b/reference/execution/execution/basic-operation.md @@ -105,6 +105,7 @@ using connect-all-result = call-result-t< // exposition only template using indices-for = remove_reference_t::indices-for; // exposition only ``` +* call-result-t[link call-result-t.md.nolink] * impls-for[link impls-for.md] * tag_of_t[link tag_of_t.md] * decay_t[link /reference/type_traits/decay.md] @@ -113,7 +114,7 @@ using indices-for = remove_reference_t::indices-for; // exposition only 説明専用の定数`connect-all`は、下記ラムダ式と等価な関数呼び出し可能なオブジェクトとして初期化される。 -- 全ての子Sender`child`とSenderアルゴリズム`sndr`の[Receiver](basic-receiver.md.nolink)を[接続(connect)](connect.md)し、結果の[Operation State](operation_state.md)リストを[`product-type`](product-type.md)型にまとめて返す。 +- 全ての子Sender`child`とSenderアルゴリズム`sndr`の[Receiver](basic-receiver.md)を[接続(connect)](connect.md)し、結果の[Operation State](operation_state.md)リストを[`product-type`](product-type.md)型にまとめて返す。 ```cpp []( @@ -128,7 +129,7 @@ using indices-for = remove_reference_t::indices-for; // exposition only * index_sequence[link /reference/utility/index_sequence.md] * product-type[link product-type.md] * connect[link connect.md] -* basic-receiver[link basic-receiver.md.nolink] +* basic-receiver[link basic-receiver.md] * integral_constant[link /reference/type_traits/integral_constant.md] * see below[italic] @@ -143,7 +144,7 @@ using indices-for = remove_reference_t::indices-for; // exposition only ## 関連項目 - [`basic-sender`](basic-sender.md) -- [`basic-receiver`](basic-receiver.md.nolink) +- [`basic-receiver`](basic-receiver.md) - [`execution::operation_state`](operation_state.md) diff --git a/reference/execution/execution/basic-receiver.md b/reference/execution/execution/basic-receiver.md new file mode 100644 index 0000000000..7045171e8c --- /dev/null +++ b/reference/execution/execution/basic-receiver.md @@ -0,0 +1,94 @@ +# basic-receiver +* execution[meta header] +* class template[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template + requires valid-specialization + struct basic-receiver { // exposition only + using receiver_concept = receiver_t; + + using tag-t = tag_of_t; // exposition only + using state-t = state-type; // exposition only + static constexpr const auto& complete = impls-for::complete; // exposition only + + template + requires callable + void set_value(Args&&... args) && noexcept { + complete(Index(), op->state, op->rcvr, set_value_t(), std::forward(args)...); + } + + template + requires callable + void set_error(Error&& err) && noexcept { + complete(Index(), op->state, op->rcvr, set_error_t(), std::forward(err)); + } + + void set_stopped() && noexcept + requires callable { + complete(Index(), op->state, op->rcvr, set_stopped_t()); + } + + auto get_env() const noexcept -> env-type { + return impls-for::get-env(Index(), op->state, op->rcvr); + } + + basic-state* op; // exposition only + }; +} +``` +* receiver_t[link receiver.md] +* tag_of_t[link tag_of_t.md] +* state-type[link basic-operation.md] +* impls-for[link impls-for.md] +* callable[link /reference/functional/callable.md.nolink] +* set_value_t[link set_value.md] +* set_error_t[link set_error.md] +* set_stopped_t[link set_stopped.md] +* basic-state[link basic-operation.md] + + +## 概要 +`basic-receiver`は、Senderアルゴリズム動作仕様定義で用いられる説明専用のクラステンプレートである。 + +`basic-receiver`は[`receiver`](receiver.md)のモデルであり、SenderアルゴリズムのReceiverとしてして[子Senderとの接続時](basic-operation.md)に利用される。 + +- `Sndr` : Senderアルゴリズムの[Sender](sender.md)。 +- `Rcvr` : Senderアルゴリズムの接続先[Receiver](receiver.md)。Senderアルゴリズム同士を連結する場合は、親Senderアルゴリズム側のReceiver型。 +- `Index` : Senderアルゴリズムの子Sender識別用インデクス値。Senderアダプタは通常1個の子Senderと接続され、この場合は`Index()`は定数値`0`となる。 + + +## 説明専用エンティティ + +```cpp +template class T, class... Args> +concept valid-specialization = // exposition only + requires { typename T; }; + +template // exposition only +using env-type = call-result-t< + decltype(impls-for>::get-env), Index, + state-type&, const Rcvr&>; +``` +* call-result-t[link call-result-t.md.nolink] +* impls-for[link impls-for.md] +* tag_of_t[link tag_of_t.md] +* state-type[link basic-operation.md] + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`basic-sender`](basic-sender.md) +- [`basic-operation`](basic-operation.md) +- [`execution::receiver`](receiver.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/basic-sender.md b/reference/execution/execution/basic-sender.md index e6f94ef1e4..cf4d6e1c92 100644 --- a/reference/execution/execution/basic-sender.md +++ b/reference/execution/execution/basic-sender.md @@ -46,7 +46,7 @@ namespace std::execution { `basic-sender`は[`sender`](sender.md)のモデルであり、[Senderアルゴリズム構築](make-sender.md)の結果型として利用される。 -- `Tag` : [Senderアルゴリズムタグ](tag_of_t.md)(例:[`just`](just.md), [`then`](then.md.nolink)) +- `Tag` : [Senderアルゴリズムタグ](tag_of_t.md)(例:[`just`](just.md), [`then`](then.md)) - `Data` : Senderアルゴリズムに指定された追加の引数。複数個の引数は[`product-type`](product-type.md)型を用いて単一値として保持する。 - `Child` : 子Senderのリスト。Senderファクトリでは0個、Senderアダプタでは通常1個の子Senderを保持する。 diff --git a/reference/execution/execution/get_completion_scheduler.md b/reference/execution/execution/get_completion_scheduler.md index 4a627a3464..b23fff224e 100644 --- a/reference/execution/execution/get_completion_scheduler.md +++ b/reference/execution/execution/get_completion_scheduler.md @@ -82,7 +82,7 @@ int main() * ex::schedule[link schedule.md] * ex::set_value_t[link set_value.md] * ex::get_env[link get_env.md] -* ex::then[link then.md.nolink] +* ex::then[link then.md] ### 出力 ``` diff --git a/reference/execution/execution/impls-for.md b/reference/execution/execution/impls-for.md index 784f562611..1ef00f6371 100644 --- a/reference/execution/execution/impls-for.md +++ b/reference/execution/execution/impls-for.md @@ -49,7 +49,7 @@ namespace std::execution { * env<>[link env.md] ### `get-env`メンバ -`get-env`は、[`basic-receiver`](basic-receiver.md.nolink)実装におけるReceiver[環境](../queryable.md)取得のカスタマイゼーションポイントとして機能する。 +`get-env`は、[`basic-receiver`](basic-receiver.md)実装におけるReceiver[環境](../queryable.md)取得のカスタマイゼーションポイントとして機能する。 `default-impls::get-env`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 @@ -92,7 +92,7 @@ namespace std::execution { * execution::start[link start.md] ### `complete`メンバ -`complete`は、[`basic-receiver`](basic-receiver.md.nolink)実装における各種完了操作のカスタマイゼーションポイントとして機能する。 +`complete`は、[`basic-receiver`](basic-receiver.md)実装における各種完了操作のカスタマイゼーションポイントとして機能する。 `default-impls::complete`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 @@ -120,7 +120,7 @@ namespace std::execution { ## 関連項目 - [`basic-sender`](basic-sender.md) -- [`basic-receiver`](basic-receiver.md.nolink) +- [`basic-receiver`](basic-receiver.md) - [`basic-operation`](basic-operation.md) diff --git a/reference/execution/execution/make-sender.md b/reference/execution/execution/make-sender.md index 5c2b8be446..1e1b5c643d 100644 --- a/reference/execution/execution/make-sender.md +++ b/reference/execution/execution/make-sender.md @@ -15,7 +15,7 @@ constexpr auto make-sender(Tag tag, Data&& data, Child&&... child); [`sender`](sender.md)のモデルである説明専用クラステンプレート[`basic-sender`](basic-sender.md)のインスタンスを生成する。 -- `Tag` : [Senderアルゴリズムタグ](tag_of_t.md)(例:[`just`](just.md), [`then`](then.md.nolink)) +- `Tag` : [Senderアルゴリズムタグ](tag_of_t.md)(例:[`just`](just.md), [`then`](then.md)) - `Data` : Senderアルゴリズムに指定された追加の引数。複数個の引数は[`product-type`](product-type.md)型を用いて単一値として保持する。 - `Child` : 子Senderのリスト。Senderファクトリでは0個、Senderアダプタでは通常1個の子Senderを保持する。 diff --git a/reference/execution/execution/schedule.md b/reference/execution/execution/schedule.md index 778b9aa8a6..36712f7058 100644 --- a/reference/execution/execution/schedule.md +++ b/reference/execution/execution/schedule.md @@ -63,7 +63,7 @@ int main() * ex::schedule[color ff0000] * ex::scheduler[link scheduler.md] * ex::sender[link sender.md] -* ex::then[link then.md.nolink] +* ex::then[link then.md] * ex::run_loop[link run_loop.md] * get_scheduler()[link run_loop/get_scheduler.md] * run()[link run_loop/run.md] diff --git a/reference/execution/execution/then.md b/reference/execution/execution/then.md new file mode 100644 index 0000000000..e950bc0be8 --- /dev/null +++ b/reference/execution/execution/then.md @@ -0,0 +1,130 @@ +# then +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct then_t { unspecified }; + inline constexpr then_t then{}; +} +``` +* unspecified[italic] + +## 概要 +`then`は、入力[Sender](sender.md)の[値完了操作](set_value.md)の継続として関数呼び出しをアタッチするSenderアダプタである。 + +`then`はパイプライン記法をサポートする。 + + +## 効果 +説明用の式`sndr`と`f`に対して、`decltype((sndr))`が[`sender`](sender.md)を満たさない、もしくは`decltype((f))`が[`movable-value`](../movable-value.md)を満たさないとき、呼び出し式`then(sndr, f)`は不適格となる。 + +そうでなければ、呼び出し式`then(sndr, f)`は`sndr`が1回だけ評価されることを除いて、下記と等価。 + +```cpp +transform_sender(get-domain-early(sndr), make-sender(then, f, sndr)) +``` +* transform_sender[link transform_sender.md] +* get-domain-early[link get-domain-early.md] +* make-sender[link make-sender.md] + + +### Senderアルゴリズムタグ `then` +Senderアルゴリズム動作説明用のクラステンプレート`impls-for`に対して、下記の特殊化が定義される。 + +```cpp +namespace std::execution { + template<> + struct impls-for> : default-impls { + static constexpr auto complete = + [] + (auto, auto& fn, auto& rcvr, Tag, Args&&... args) noexcept -> void { + if constexpr (same_as>) { + TRY-SET-VALUE(rcvr, + invoke(std::move(fn), std::forward(args)...)); + } else { + Tag()(std::move(rcvr), std::forward(args)...); + } + }; + }; +} +``` +* decayed-typeof[link decayed-typeof.md.nolink] +* impls-for[link impls-for.md] +* default-impls[link impls-for.md] +* set_value[link set_value.md] +* invoke[link /reference/functional/invoke.md] +* std::move[link /reference/utility/move.md] + + +## カスタマイゼーションポイント +[Sender](sender.md)`sndr`に[関連付けられた実行ドメイン](get-domain-early.md)`dom`に対して、[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 +[デフォルト実行ドメイン](../execution/default_domain.md)では無変換。 + +戻り値の[Sender](sender.md)`out_sndr`が下記を満たさない場合、呼び出し式`then(sndr, f)`の動作は未定義となる。 + +- `then`に対する`sndr`の値結果データで`f`またはそのコピーを呼び出し、`out_sndr`の値完了として`f`の結果値を用いること。 +- 他の完了操作では変更なしに転送すること。 + + +## 例 +```cpp example +#include +#include +#include +namespace ex = std::execution; + +int main() +{ + { // 関数呼び出し + ex::sender auto snd0 = ex::just('C', 2); + ex::sender auto snd1 = ex::then(snd0, [](char ch, int s){ + return ch + std::string(2, '+'); + }); + auto [s] = std::this_thread::sync_wait(snd1).value(); + std::println("{}", s); + } + + { // パイプライン記法 + ex::sender auto sndr = ex::just('C', 2); + | ex::then([](char ch, int s){ + return ch + std::string(2, '+'); + }); + auto [s] = std::this_thread::sync_wait(sndr).value(); + std::println("{}", s); + } +} +``` +* ex::then[color ff0000] +* ex::sender[link sender.md] +* ex::just[link just.md] +* std::this_thread::sync_wait[link ../this_thread/sync_wait.md] +* value()[link /reference/optional/optional/value.md] + +### 出力 +``` +C++ +C++ +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::upon_error`](upon_error.md.nolink) +- [`execution::upon_stopped`](upon_stopped.md.nolink) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) From 63b19a362e53407399882264694b97482dd2a700 Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 7 May 2025 01:00:20 +0900 Subject: [PATCH 1656/3948] execution/then: fix example --- reference/execution/execution/then.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/execution/execution/then.md b/reference/execution/execution/then.md index e950bc0be8..3758369d3d 100644 --- a/reference/execution/execution/then.md +++ b/reference/execution/execution/then.md @@ -80,8 +80,8 @@ int main() { { // 関数呼び出し ex::sender auto snd0 = ex::just('C', 2); - ex::sender auto snd1 = ex::then(snd0, [](char ch, int s){ - return ch + std::string(2, '+'); + ex::sender auto snd1 = ex::then(snd0, [](char ch, int n) { + return ch + std::string(n, '+'); }); auto [s] = std::this_thread::sync_wait(snd1).value(); std::println("{}", s); @@ -89,8 +89,8 @@ int main() { // パイプライン記法 ex::sender auto sndr = ex::just('C', 2); - | ex::then([](char ch, int s){ - return ch + std::string(2, '+'); + | ex::then([](char ch, int n) { + return ch + std::string(n, '+'); }); auto [s] = std::this_thread::sync_wait(sndr).value(); std::println("{}", s); From 0de1d6d997254af003ec11bd19f597de81eb3fa3 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 7 May 2025 15:26:01 +0900 Subject: [PATCH 1657/3948] =?UTF-8?q?is=5Fclock=20:=20Clock=E8=A6=81?= =?UTF-8?q?=E4=BB=B6=E3=82=92=E8=A8=98=E8=BC=89=20#1445?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/chrono/is_clock.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/reference/chrono/is_clock.md b/reference/chrono/is_clock.md index c7fe8e4de2..01d3f72923 100644 --- a/reference/chrono/is_clock.md +++ b/reference/chrono/is_clock.md @@ -21,6 +21,22 @@ namespace std::chrono { Clock要件を満たすには、以下が必要である: +| 有効であるべき式 | 戻り値型 | 操作の意味論 | +|------------------|----------|--------------| +| `C1::rep` | 算術型もしくはそのように振る舞うクラス | `C1::duration`の値型 | +| `C1::period` | [`std::ratio`](/reference/ratio/ratio.md)の特殊化 | クロックの時間周期 (秒ベース) | +| `C1::duration` | [`chrono::duration`](duration.md)`` | クロックの`duation`型 | +| `C1::time_point` | [`chrono::time_point`](time_point.md)``もしくは[`chrono::time_point`](time_point.md)`` | クロックの`time_point`型。`C1`と`C2`は同じエポックを参照する | +| `C1::is_steady` | `const bool` | `t1 <= t2`が常に真であり (注:時間が戻らない)、時間間隔が常に一定である場合に`true`、そうでなければ`false` | +| `C1::now()` | `C1::time_point` | 現在の時間点を表す`time_point`オブジェクトを返す | + +ここで、以下のように定義する: + +- `C1`と`C2` : クロックの種類 +- `t1`と`t2` : `C1::now()`によって返される値。ここで、`t1`を返す`now()`呼び出しは`t2`を返す`now()`呼び出しよりも前に発生し、これらの呼び出しは両方とも`C1::time_point::max()`よりも前に発生するものとする (注: これは、`C1`が`t1`と`t2`の間でラップアラウンドしていないことを意味する) + +`is_clock`は、以下を満たさない限り、`Clock`要件として適格ではない: + - 修飾された型`T`が、`T::period`、`T::duration`、`T::time_point`メンバ型を持っていること - 式`T::is_steady`が評価されないオペランドで使用された場合に妥当であること - 式`T::now()`が評価されないオペランドで使用された場合に妥当であること From 8acf79c216090dcb5818046ae852eb8677cd6a36 Mon Sep 17 00:00:00 2001 From: 50c0019uy <137173525+50c0019uy@users.noreply.github.com> Date: Wed, 7 May 2025 17:43:08 +0900 Subject: [PATCH 1658/3948] =?UTF-8?q?=E3=83=9A=E3=83=BC=E3=82=B8=E3=82=BF?= =?UTF-8?q?=E3=82=A4=E3=83=88=E3=83=AB=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../remove_deprecated_arithmetic_conversion_on_enumerations.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md b/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md index c44035a458..62b6c1f612 100644 --- a/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md +++ b/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md @@ -1,4 +1,4 @@ -# 列挙値から算術型への暗黙変換を非推奨化 [P2864R2] +# 非推奨となっていた列挙型の算術変換を削除 [P2864R2] * cpp26[meta cpp] From 77d4a16738e24aaa0624b55333bcf630978e9d91 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Thu, 8 May 2025 08:54:17 +0900 Subject: [PATCH 1659/3948] fix: Added version for contract_violation --- reference/contracts/contract_violation.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/contracts/contract_violation.md b/reference/contracts/contract_violation.md index 4e4cf77251..b09eb93359 100644 --- a/reference/contracts/contract_violation.md +++ b/reference/contracts/contract_violation.md @@ -2,6 +2,7 @@ * contracts[meta header] * std::contracts[meta namespace] * class[meta id-type] +* cpp26[meta cpp] ```cpp namespace std::contracts { From f82d5633e12fa22f077c11599592799417297cfd Mon Sep 17 00:00:00 2001 From: rotarymars Date: Thu, 8 May 2025 13:11:50 +0900 Subject: [PATCH 1660/3948] new: Created page `assertion_kind` --- reference/contracts/assertion_kind.md | 37 +++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 reference/contracts/assertion_kind.md diff --git a/reference/contracts/assertion_kind.md b/reference/contracts/assertion_kind.md new file mode 100644 index 0000000000..4d03f05286 --- /dev/null +++ b/reference/contracts/assertion_kind.md @@ -0,0 +1,37 @@ +# assertion_kind +* contracts[meta header] +* std::contracts[meta namespace] +* enum[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std::contracts { + enum class assertion_kind : unspecified { + pre = 1, + post = 2, + assertion = 3 + } +} +``` + +## 概要 +違反した可能性のある契約の種類を表す列挙型。 + +これの他に、処理系依存のものを定めてもよい。 + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 未実装 +- [GCC](/implementation.md#gcc): 未実装 +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 未実装 + +## 関連項目 +- [契約に基づくプログラミング](/lang/future/contract-based_programming.md) +- [契約プログラミング](/lang/cpp26/contracts.md) + +## 参照 +- [P0542R5 Support for contract based programming in C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0542r5.html) From d18dc841a75a7c62798b9ff1523a8532684e1e50 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Thu, 8 May 2025 13:13:08 +0900 Subject: [PATCH 1661/3948] fix: Removed nolink #1419 --- reference/contracts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/contracts.md b/reference/contracts.md index 7aee99db73..120b7991fa 100644 --- a/reference/contracts.md +++ b/reference/contracts.md @@ -10,7 +10,7 @@ | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`assertion_kind`](contracts/assertion_kind.md.nolink) | アサーションの種類 (enum) | C++26 | +| [`assertion_kind`](contracts/assertion_kind.md) | アサーションの種類 (enum) | C++26 | | [`evaluation_semantic`](contracts/evaluation_semantic.md.nolink) | アサーションの評価の種類(enum) | C++26 | | [`detection_mode`](contracts/detection_mode.md.nolink) | 契約違反の検出モード(enum) | C++26 | | [`contract_violation`](contracts/contract_violation.md) | 契約違反に関する情報 (class) | C++26 | From 7d38e6e917eb96fb94d155a302c3786df9857833 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Thu, 8 May 2025 13:20:36 +0900 Subject: [PATCH 1662/3948] new: Added page `evaluation_semantic` #1419 --- reference/contracts.md | 2 +- reference/contracts/evaluation_semantic.md | 37 ++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 reference/contracts/evaluation_semantic.md diff --git a/reference/contracts.md b/reference/contracts.md index 120b7991fa..bb75f0d434 100644 --- a/reference/contracts.md +++ b/reference/contracts.md @@ -11,7 +11,7 @@ | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`assertion_kind`](contracts/assertion_kind.md) | アサーションの種類 (enum) | C++26 | -| [`evaluation_semantic`](contracts/evaluation_semantic.md.nolink) | アサーションの評価の種類(enum) | C++26 | +| [`evaluation_semantic`](contracts/evaluation_semantic.md) | アサーションの評価の種類(enum) | C++26 | | [`detection_mode`](contracts/detection_mode.md.nolink) | 契約違反の検出モード(enum) | C++26 | | [`contract_violation`](contracts/contract_violation.md) | 契約違反に関する情報 (class) | C++26 | | [`invoke_default_contract_violation_handler`](contracts/invoke_default_contract_violation_handler.md.nolink) | デフォルトcontract_violationハンドラー | C++26 | diff --git a/reference/contracts/evaluation_semantic.md b/reference/contracts/evaluation_semantic.md new file mode 100644 index 0000000000..9fe587cbfc --- /dev/null +++ b/reference/contracts/evaluation_semantic.md @@ -0,0 +1,37 @@ +# evaluation_semantic +* contracts[meta header] +* std::contracts[meta namespace] +* enum[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std::contracts { + enum class evaluation_semantic : unspecified { + ignore = 1, + observe = 2, + enforce = 3, + quick_enforce = 4 // , + // assume = 5 <-- 将来追加予定 + } +} +``` + +## 概要 +契約違反をどのように評価するかを表す列挙型。 + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 未実装 +- [GCC](/implementation.md#gcc): 未実装 +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 未実装 + +## 関連項目 +- [契約に基づくプログラミング](/lang/future/contract-based_programming.md) +- [契約プログラミング](/lang/cpp26/contracts.md) + +## 参照 +- [P0542R5 Support for contract based programming in C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0542r5.html) From f9534c290550c587c3bc780954a09645a5baa531 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Thu, 8 May 2025 13:21:32 +0900 Subject: [PATCH 1663/3948] fix: Fixed compiler version #1419 --- reference/contracts.md | 6 +++--- reference/contracts/assertion_kind.md | 6 +++--- reference/contracts/evaluation_semantic.md | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/reference/contracts.md b/reference/contracts.md index bb75f0d434..ec2f163a1b 100644 --- a/reference/contracts.md +++ b/reference/contracts.md @@ -21,10 +21,10 @@ - C++26 ### 処理系 -- [Clang](/implementation.md#clang): 未実装 -- [GCC](/implementation.md#gcc): 未実装 +- [Clang](/implementation.md#clang): ? +- [GCC](/implementation.md#gcc): ? - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 未実装 +- [Visual C++](/implementation.md#visual_cpp): ? ## 関連項目 - [契約に基づくプログラミング](/lang/future/contract-based_programming.md) diff --git a/reference/contracts/assertion_kind.md b/reference/contracts/assertion_kind.md index 4d03f05286..4388063e7c 100644 --- a/reference/contracts/assertion_kind.md +++ b/reference/contracts/assertion_kind.md @@ -24,10 +24,10 @@ namespace std::contracts { - C++26 ### 処理系 -- [Clang](/implementation.md#clang): 未実装 -- [GCC](/implementation.md#gcc): 未実装 +- [Clang](/implementation.md#clang): ? +- [GCC](/implementation.md#gcc): ? - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 未実装 +- [Visual C++](/implementation.md#visual_cpp): ? ## 関連項目 - [契約に基づくプログラミング](/lang/future/contract-based_programming.md) diff --git a/reference/contracts/evaluation_semantic.md b/reference/contracts/evaluation_semantic.md index 9fe587cbfc..28d381cc21 100644 --- a/reference/contracts/evaluation_semantic.md +++ b/reference/contracts/evaluation_semantic.md @@ -24,10 +24,10 @@ namespace std::contracts { - C++26 ### 処理系 -- [Clang](/implementation.md#clang): 未実装 -- [GCC](/implementation.md#gcc): 未実装 +- [Clang](/implementation.md#clang): ? +- [GCC](/implementation.md#gcc): ? - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 未実装 +- [Visual C++](/implementation.md#visual_cpp): ? ## 関連項目 - [契約に基づくプログラミング](/lang/future/contract-based_programming.md) From b8c7c50fec35db39373dc7b8e006cf05362ce622 Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 8 May 2025 17:49:46 +0900 Subject: [PATCH 1664/3948] execution: read_env (#1384) --- reference/execution/execution.md | 4 +- reference/execution/execution/read_env.md | 94 +++++++++++++++++++++++ 2 files changed, 96 insertions(+), 2 deletions(-) create mode 100644 reference/execution/execution/read_env.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 631483cb23..3bdb0796d9 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -88,7 +88,7 @@ namespace std::execution { | [`execution::value_types_of_t`](execution/value_types_of_t.md) | Senderの値完了シグネチャ集合から指定操作で型を生成 (alias template) | C++26 | | [`execution::error_types_of_t`](execution/error_types_of_t.md) | Senderのエラー完了シグネチャ集合から指定操作で型を生成 (alias template) | C++26 | | [`execution::sends_stopped`](execution/sends_stopped.md) | Senderが停止完了を送信しうるか否か (variable template) | C++26 | -| [`execution::tag_of_t`](execution/tag_of_t.md) | Senderアルゴリズムタグを取得 (alias template) | C++26 | +| [`execution::tag_of_t`](execution/tag_of_t.md) | Senderアルゴリズムタグ型を取得 (alias template) | C++26 | | [`execution::transform_sender`](execution/transform_sender.md) | Senderを変換 (function template) | C++26 | | [`execution::transform_env`](execution/transform_env.md) | 環境を変換 (function template) | C++26 | | [`execution::apply_sender`](execution/apply_sender.md) | Senderアルゴリズムを適用 (function template) | C++26 | @@ -102,7 +102,7 @@ namespace std::execution { | [`execution::just`](execution/just.md) | 値を送信するSender (customization point object) | C++26 | | [`execution::just_error`](execution/just_error.md.nolink) | エラーを送信するSender (customization point object) | C++26 | | [`execution::just_stopped`](execution/just_stopped.md.nolink) | 停止を送信するSender (customization point object) | C++26 | -| [`execution::read_env`](execution/read_env.md.nolink) | Receiver環境から構築されるSender (customization point object) | C++26 | +| [`execution::read_env`](execution/read_env.md) | Receiver環境からクエリオブジェクトで値を読み取るSender (customization point object) | C++26 | | [`execution::schedule`](execution/schedule.md) | Scheduler上で実行されるSender (customization point object) | C++26 | | [`execution::schedule_result_t`](execution/schedule_result_t.md) | [`schedule`](execution/schedule.md)結果型を取得 (alias template) | C++26 | diff --git a/reference/execution/execution/read_env.md b/reference/execution/execution/read_env.md new file mode 100644 index 0000000000..41e98e7f80 --- /dev/null +++ b/reference/execution/execution/read_env.md @@ -0,0 +1,94 @@ +# read_env +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + inline constexpr unspecified read_env{}; +} +``` +* unspecified[italic] + +## 概要 +`read_env`は、非同期動作の[開始(start)](start.md)時に接続先[Receiver](receiver.md)の[環境](../queryable.md)に対して[クエリオブジェクト](../queryable.md)で問い合わせ、読み取った値を[値完了関数](set_value.md)で送信するSenderファクトリである。 + +クエリオブジェクトによるReceiver環境への問い合わせは`read_env`[Sender](sender.md)の構築時ではなく、Receiverと接続されたのち非同期動作が開始されるタイミングまで遅延される。 +[`let_value`](let_value.md.nolink)Senderアダプタと組み合わせたり、[Sender Awaitableなコルーチン](with_awaitable_senders.md.nolink)での`co_await`式によって、[Scheduler](get_scheduler.md)や[停止トークン](../get_stop_token.md)を読み取ることができる。 + + +## 効果 +[クエリオブジェクト](../queryable.md)`q`に対して、呼び出し式`read_env(q)`は式[`make-sender`](make-sender.md)`(read_env, q)`と等価。 + + +### Senderアルゴリズムタグ +Senderアルゴリズム動作説明用のクラステンプレート`impls-for`に対して、下記の特殊化が定義される。 + +```cpp +namespace std::execution { + template<> + struct impls-for> : default-impls { + static constexpr auto start = + [](auto query, auto& rcvr) noexcept -> void { + TRY-SET-VALUE(rcvr, query(get_env(rcvr))); + }; + }; +} +``` +* decayed-typeof[link decayed-typeof.md.nolink] +* impls-for[link impls-for.md] +* default-impls[link impls-for.md] +* get_env[link get_env.md] + + +## 備考 +`read_env`の[Senderアルゴリズムタグ型](tag_of_t.md)は未規定とされる。 + + +## 例 +```cpp example +#include +#include +namespace ex = std::execution; + +int main() +{ + ex::sender auto sndr = ex::read_env(ex::get_scheduler) + | ex::let_value([](auto sch) -> ex::sender auto { + // sch := sync_wait内部のScheduler + return ex::starts_on(sch, std::just(42)); + }); + auto [val] = std::this_thread::sync_wait(sndr).value(); + std::println("{}", val); +} +``` +* ex::read_env[color ff0000] +* ex::sender[link sender.md] +* ex::get_scheduler[link get_scheduler.md] +* ex::starts_on[link starts_on.md.nolink] +* std::this_thread::sync_wait[link ../this_thread/sync_wait.md] + +### 出力 +``` +42 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::get_env`](read_env.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) \ No newline at end of file From 91bc83ecbe2e90462c4b97fbec15b6f7db81d614 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 9 May 2025 11:48:47 +0900 Subject: [PATCH 1665/3948] new: New page `detection_mode` --- reference/contracts.md | 2 +- reference/contracts/detection_mode.md | 41 +++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 reference/contracts/detection_mode.md diff --git a/reference/contracts.md b/reference/contracts.md index ec2f163a1b..73729e35e1 100644 --- a/reference/contracts.md +++ b/reference/contracts.md @@ -12,7 +12,7 @@ |------|------|----------------| | [`assertion_kind`](contracts/assertion_kind.md) | アサーションの種類 (enum) | C++26 | | [`evaluation_semantic`](contracts/evaluation_semantic.md) | アサーションの評価の種類(enum) | C++26 | -| [`detection_mode`](contracts/detection_mode.md.nolink) | 契約違反の検出モード(enum) | C++26 | +| [`detection_mode`](contracts/detection_mode.md) | 契約違反の検出モード(enum) | C++26 | | [`contract_violation`](contracts/contract_violation.md) | 契約違反に関する情報 (class) | C++26 | | [`invoke_default_contract_violation_handler`](contracts/invoke_default_contract_violation_handler.md.nolink) | デフォルトcontract_violationハンドラー | C++26 | diff --git a/reference/contracts/detection_mode.md b/reference/contracts/detection_mode.md new file mode 100644 index 0000000000..6e3c9ecc09 --- /dev/null +++ b/reference/contracts/detection_mode.md @@ -0,0 +1,41 @@ +# detection_mode +* contracts[meta header] +* std::contracts[meta namespace] +* enum[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std::contracts { + enum class detection_mode : unspecified { + predicate_false = 1, + evaluation_exception = 2 + } +} +``` + +## 概要 +契約違反がどのような仕組みでその違反が認識されたかを表す列挙型。 + +### 各列挙子の意味 +| 列挙子 | 値 | 意味 | +|--------|-----|------| +| predicate_false | 1 | 契約の述語が評価され、falseを返す、もしくは評価をするとfalseを返す | +| evaluation_exception | 2 | 評価中に例外が投げられ、キャッチされずに逸脱した | + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ? +- [GCC](/implementation.md#gcc): ? +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): ? + +## 関連項目 +- [契約に基づくプログラミング](/lang/future/contract-based_programming.md) +- [契約プログラミング](/lang/cpp26/contracts.md) + +## 参照 +- [P0542R5 Support for contract based programming in C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0542r5.html) + From 41a9acddcd1b434ca433d74a2f1490224b58c9ce Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 9 May 2025 15:56:37 +0900 Subject: [PATCH 1666/3948] =?UTF-8?q?C++26:=20=E3=80=8C=E8=BF=94=E5=8D=B4?= =?UTF-8?q?=E3=81=95=E3=82=8C=E3=81=9F=E5=B7=A6=E8=BE=BA=E5=80=A4=E3=81=8B?= =?UTF-8?q?=E3=82=89=E6=9A=97=E9=BB=99=E5=A4=89=E6=8F=9B=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=81=9F=E4=B8=80=E6=99=82=E3=82=AA=E3=83=96=E3=82=B8=E3=82=A7?= =?UTF-8?q?=E3=82=AF=E3=83=88=E3=81=8C=E5=8F=82=E7=85=A7=E3=81=AB=E6=9D=9F?= =?UTF-8?q?=E7=B8=9B=E3=81=95=E3=82=8C=E3=82=8B=E3=81=93=E3=81=A8=E3=82=92?= =?UTF-8?q?=E7=A6=81=E6=AD=A2=E3=81=99=E3=82=8B=E3=80=8D=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=20(close=20#1322)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp26.md | 2 +- ...nding_a_returned_glvalue_to_a_temporary.md | 59 +++++++++++++++++++ 3 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 lang/cpp26/disallow_binding_a_returned_glvalue_to_a_temporary.md diff --git a/implementation-status.md b/implementation-status.md index 8d23087842..3b8e6921ea 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -301,7 +301,7 @@ | P2558R2: [基本文字集合に@、$、\`を追加](/lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md) | C言語との互換性のためにこれらの文字を基本文字集合に追加 | | Yes | | | | P2662R3: [パラメータパックへのインデックスアクセスを許可](/lang/cpp26/pack_indexing.md.nolink) | 可変引数テンプレートのパラメータパックに添字アクセスできるようにする | 15 | | | | | P2864R2: [非推奨となっていた列挙値から算術型への暗黙変換を削除](/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md) | C++20から非推奨となっていた列挙値への算術演算で算術型に暗黙変換される仕様を削除 | 14 | 18 | | | -| P2748R5: [返却された左辺値から暗黙変換された一時オブジェクトが参照に束縛されることを禁止する](/lang/cpp26/disallow_binding_a_returned_glvalue_to_a_temporary.md.nolink) | 寿命切れの変数によって引き起こされるバグを防止する | 14 | 19 | | | +| P2748R5: [返却された左辺値から暗黙変換された一時オブジェクトが参照に束縛されることを禁止する](/lang/cpp26/disallow_binding_a_returned_glvalue_to_a_temporary.md) | 寿命切れの変数によって引き起こされるバグを防止する | 14 | 19 | | | | P3106R1: [要素数不明の配列を集成体初期化する規則を明確化](/lang/cpp26/clarifying_rules_for_brace_elision_in_aggregate_initialization.md.nolink) | 配列要素の集成体初期化で`{}`が省略された場合の矛盾していた規定を修正 | yes | 17 | | | | P0609R3: [構造化束縛への属性を許可](/lang/cpp26/attributes_for_structured_bindings.md) | `auto [a, b [[maybe_unused]], c] = f();`のように構造化束縛の要素に対して属性を付加できるようにする | 15 | 19 | | | | P3034R1: [モジュール宣言でのモジュール名のマクロ展開を禁止する](/lang/cpp26/module_declarations_shouldnt_be_macros.md) | `export module MACRO_NAME;`を禁止 | | | | | diff --git a/lang/cpp26.md b/lang/cpp26.md index fd4718be32..ef6c5e72da 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -14,7 +14,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | [`std::initializer_list`の配列を静的記憶域に配置する](/lang/cpp26/static_storage_for_braced_initializers.md) | `std::vector v = {1, 2, 3};`のような初期化で初期化子リストを静的記憶域に配置することで無駄なコピーをなくす | | [宣言のみで使用しない変数の名前として`_`をサポート](/lang/cpp26/nice_placeholder_with_no_name.md) | 変数名`_`は暗黙で`[[maybe_unused]]`が指定される | | [不完全型へのポインタに対する`delete`を不適格とする](/lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md) | 未定義動作を引き起こす操作をコンパイルエラーとする | -| [返却された左辺値から暗黙変換された一時オブジェクトが参照に束縛されることを禁止する](/lang/cpp26/disallow_binding_a_returned_glvalue_to_a_temporary.md.nolink) | 寿命切れの変数によって引き起こされるバグを防止する | +| [返却された左辺値から暗黙変換された一時オブジェクトが参照に束縛されることを禁止する](/lang/cpp26/disallow_binding_a_returned_glvalue_to_a_temporary.md) | 寿命切れの変数によって引き起こされるバグを防止する | | [要素数不明の配列を集成体初期化する規則を明確化](/lang/cpp26/clarifying_rules_for_brace_elision_in_aggregate_initialization.md.nolink) | 配列要素の集成体初期化で`{}`が省略された場合の矛盾していた規定を修正 | | [未初期化変数の読み取りをエラー性動作とする](/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md) | 初期化されていない自動変数の読み取りの安全性を規定する | | [構造化束縛でパックを導入できるようにする](/lang/cpp26/structured_bindings_can_introduce_a_pack.md) | タプルを分解する際に複数の変数をパックとして宣言できるようにする。`auto [a, ...xs] = f();` | diff --git a/lang/cpp26/disallow_binding_a_returned_glvalue_to_a_temporary.md b/lang/cpp26/disallow_binding_a_returned_glvalue_to_a_temporary.md new file mode 100644 index 0000000000..433d0d9694 --- /dev/null +++ b/lang/cpp26/disallow_binding_a_returned_glvalue_to_a_temporary.md @@ -0,0 +1,59 @@ +# 返却された左辺値から暗黙変換された一時オブジェクトが参照に束縛されることを禁止する [P2748R5] +* cpp26[meta cpp] + + + +このページはC++26に採用される見込みの言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため関連項目を参照してください。 + + + +## 概要 +C++26では、暗黙変換された一時オブジェクトが参照に束縛されることを禁止し、寿命切れした変数を参照し続けることによるバグを防止する。 + +例として、以下のコードには一時オブジェクトを参照するバグが存在する。 + +```cpp +struct X { + const std::map d_map; + const std::pair& d_first; + + X(const std::map& map) + : d_map(map), d_first(*d_map.begin()) {} +}; +``` + +ここで、[`std::map`](/reference/map/map.md)の先頭要素を式`d_first(*d_map.begin())`でメンバ変数に保持しようとしているが、先頭要素の実際の型は`std::pair`であり、`std::pair`への暗黙変換によって一時オブジェクトが作られてしまっている。そのため、コンストラクタの終了時にその一時オブジェクトの寿命が終了し、メンバ変数`d_first`は寿命切れした変数を参照してしまっている。 + +このようなコードは初学者だけでなく経験者も書いてしまい危険であるため、禁止する。 + + +## 仕様 +- C++23までの仕様: + - 「関数のreturn文で返される値に束縛された一時オブジェクトの寿命は延長されない。一時オブジェクトは、return文の完全な式の終了時に破棄される」 +- C++26の仕様: + - 「戻り値の型が参照である関数において、返された参照を一時オブジェクトに束縛するreturn文は不適格である」 + + ```cpp + auto&& f1() { + return 42; // C++26: 不適格 + } + + const double& f2() { + static int x = 42; + return x; // C++26: 不適格 + } + + auto&& id(auto&& r) { + return static_cast(r); + } + auto&& f3() { + return id(42); // OKだが、バグの可能性がある + } + ``` + + +## 参照 +- [P2748R5 Disallow Binding a Returned Glvalue to a Temporary](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2748r5.html) + From 43da478bc300807eaf73b725a4748b4024d40407 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 9 May 2025 16:15:34 +0900 Subject: [PATCH 1667/3948] =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=83=91=E3=82=A4?= =?UTF-8?q?=E3=83=A9=E3=81=AE=E5=AE=9F=E8=A3=85=E7=8A=B6=E6=B3=81=20:=20GC?= =?UTF-8?q?C=2015=E3=81=AB=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://isocpp.org//blog/2025/05/gcc-15-is-now-available-with-support-for-more-draft-cpp26-features1 --- implementation-status.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/implementation-status.md b/implementation-status.md index 3b8e6921ea..3b43ab915b 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -295,7 +295,7 @@ | P2169R4: [宣言のみで使用しない変数の名前として`_`をサポート](/lang/cpp26/nice_placeholder_with_no_name.md) | 変数名`_`は暗黙で`[[maybe_unused]]`が指定される | 14 | 18 | | | | P1854R4: [文字列リテラルの文字エンコーディング失敗を不適格とする](/lang/cpp26/making_non-encodable_string_literals_ill-formed.md) | 文字列リテラルのエンコーディング時に文字表現が失われる場合にコンパイルエラーにする | 14 | 14 | | | | P2361R6: [コンパイル時にのみ使用される文字列の扱いを明確化](/lang/cpp26/unevaluated_strings.md.nolink) | `static_assert`や`[[deprecated]]`などで使用されるコンパイル時の文字列について、文字コードの指定を禁止し、実行時エンコーディングが行われないことを規定 | 14 | 18 | | | -| P2552R3: [属性の無視性を見直し](/lang/cpp26/on_the_ignorability_of_standard_attributes.md) | 構文として適格な属性のみを無視できるようにし、そうでない属性の使用を不適格とする | | | | | +| P2552R3: [属性の無視性を見直し](/lang/cpp26/on_the_ignorability_of_standard_attributes.md) | 構文として適格な属性のみを無視できるようにし、そうでない属性の使用を不適格とする | 15 | | | | | P2738R1: [定数式での`void*`からポインタ型へのキャストを許可](/lang/cpp26/constexpr_cast_from_voidptr.md) | 型消去のために`void*`からポインタ型へのキャストを許可する | 14 | 17 | | | | P2741R3: [`static_assert`の診断メッセージにユーザーが生成した文字列の指定を許可](/lang/cpp26/user-generated_static_assert_messages.md) | `constexpr`な`S.size()`と`S.data()`メンバ関数をもつオブジェクトをコンパイル時文字列として指定できるようにする | 14 | 17 | | | | P2558R2: [基本文字集合に@、$、\`を追加](/lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md) | C言語との互換性のためにこれらの文字を基本文字集合に追加 | | Yes | | | @@ -304,7 +304,7 @@ | P2748R5: [返却された左辺値から暗黙変換された一時オブジェクトが参照に束縛されることを禁止する](/lang/cpp26/disallow_binding_a_returned_glvalue_to_a_temporary.md) | 寿命切れの変数によって引き起こされるバグを防止する | 14 | 19 | | | | P3106R1: [要素数不明の配列を集成体初期化する規則を明確化](/lang/cpp26/clarifying_rules_for_brace_elision_in_aggregate_initialization.md.nolink) | 配列要素の集成体初期化で`{}`が省略された場合の矛盾していた規定を修正 | yes | 17 | | | | P0609R3: [構造化束縛への属性を許可](/lang/cpp26/attributes_for_structured_bindings.md) | `auto [a, b [[maybe_unused]], c] = f();`のように構造化束縛の要素に対して属性を付加できるようにする | 15 | 19 | | | -| P3034R1: [モジュール宣言でのモジュール名のマクロ展開を禁止する](/lang/cpp26/module_declarations_shouldnt_be_macros.md) | `export module MACRO_NAME;`を禁止 | | | | | +| P3034R1: [モジュール宣言でのモジュール名のマクロ展開を禁止する](/lang/cpp26/module_declarations_shouldnt_be_macros.md) | `export module MACRO_NAME;`を禁止 | 15 | | | | | P2809R3: [空の無限ループは未定義動作ではないと規定](/lang/cpp26/trivial_infinite_loops_are_not_undefined_behavior.md) | 並行プログラムの進行保証などを考慮して空の無限ループを未定義動作ではないものとする | 14 | 19 | | | | P2795R5: [未初期化変数の読み取りをエラー性動作とする](/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md) | 初期化されていない自動変数の読み取りの安全性を規定する | | | | | | P2573R2: [関数宣言を削除する理由を指定できるようにする](/lang/cpp26/delete_reason.md) | `f() = delete("reason");` | 15 | 19 | | | From 5d83fd5d9e399c68a1141c3b4d05613f8e26df21 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 9 May 2025 16:17:46 +0900 Subject: [PATCH 1668/3948] =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=83=91=E3=82=A4?= =?UTF-8?q?=E3=83=A9=E3=81=AE=E5=AE=9F=E8=A3=85=E7=8A=B6=E6=B3=81=20:=20Cl?= =?UTF-8?q?ang=2020=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://releases.llvm.org/20.1.0/tools/clang/docs/ReleaseNotes.html#c-language-changes --- implementation-status.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/implementation-status.md b/implementation-status.md index 3b43ab915b..457c87d27f 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -308,8 +308,8 @@ | P2809R3: [空の無限ループは未定義動作ではないと規定](/lang/cpp26/trivial_infinite_loops_are_not_undefined_behavior.md) | 並行プログラムの進行保証などを考慮して空の無限ループを未定義動作ではないものとする | 14 | 19 | | | | P2795R5: [未初期化変数の読み取りをエラー性動作とする](/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md) | 初期化されていない自動変数の読み取りの安全性を規定する | | | | | | P2573R2: [関数宣言を削除する理由を指定できるようにする](/lang/cpp26/delete_reason.md) | `f() = delete("reason");` | 15 | 19 | | | -| P2893R3: [可変引数テンプレートで`friend`宣言をできるようにする](/lang/cpp26/variadic_friends.md) | クラステンプレートの可変引数テンプレートでまとめて`friend`宣言できるようにする | 15 | | | | -| P2747R2: [`constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md.nolink) | 定数式の文脈での配置`new`を許可 | 15 | | | | +| P2893R3: [可変引数テンプレートで`friend`宣言をできるようにする](/lang/cpp26/variadic_friends.md) | クラステンプレートの可変引数テンプレートでまとめて`friend`宣言できるようにする | 15 | 20 | | | +| P2747R2: [`constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md.nolink) | 定数式の文脈での配置`new`を許可 | 15 | 20 | | | | P3144R2: [不完全型へのポインタに対する`delete`を不適格とする](/lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md) | 未定義動作を引き起こす操作をコンパイルエラーとする | 15 | 19 | | | | P2963R3: [制約式内での畳み込み式の順序付け](/lang/cpp26/ordering_of_constraints_involving_fold_expressions.md.nolink) | 畳み込み式では全体ではなく個別の制約を原子制約式として扱う | | 19 | | | | P0963R3: [条件式での構造化束縛の使用を許可](/lang/cpp26/structured_binding_declaration_as_a_condition.md) | 式全体を`bool`値に変換できる場合に条件式で構造化束縛を使用できることとする | 15 | | | | From a2c9f2ffd68c10ddf59cb6fcb81eeaf73534f92f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 9 May 2025 22:10:11 +0900 Subject: [PATCH 1669/3948] =?UTF-8?q?fix=20typo:=20=E3=83=87=E3=82=A3?= =?UTF-8?q?=E3=83=AC=E3=82=AF=E3=83=88=E3=83=86=E3=82=A3=E3=83=96=20?= =?UTF-8?q?=E2=86=92=20=E3=83=87=E3=82=A3=E3=83=AC=E3=82=AF=E3=83=86?= =?UTF-8?q?=E3=82=A3=E3=83=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp11/extern_template.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp11/extern_template.md b/lang/cpp11/extern_template.md index e62ec385d3..7bedc9cd92 100644 --- a/lang/cpp11/extern_template.md +++ b/lang/cpp11/extern_template.md @@ -58,7 +58,7 @@ void user2() ## 仕様 -- `extern template`ディレクトティブがひとつの翻訳単位で現れた場合、他のいずれかの翻訳単位、もしくは同じ翻訳単位の`extern template`指定後に、そのエンティティをインスタンス化しなければならない。そのエンティティがインスタンス化されない場合、プログラムは不適格となる +- `extern template`ディレクティブがひとつの翻訳単位で現れた場合、他のいずれかの翻訳単位、もしくは同じ翻訳単位の`extern template`指定後に、そのエンティティをインスタンス化しなければならない。そのエンティティがインスタンス化されない場合、プログラムは不適格となる ## 参照 From e411c3ded63dccff143070d9e897fad4128cbd41 Mon Sep 17 00:00:00 2001 From: yoh Date: Sat, 10 May 2025 12:29:51 +0900 Subject: [PATCH 1670/3948] execution: into_variant (#1384) child-type --- reference/execution/execution.md | 2 +- reference/execution/execution/child-type.md | 29 +++ reference/execution/execution/into_variant.md | 193 ++++++++++++++++++ .../this_thread/sync_wait_with_variant.md | 6 +- 4 files changed, 226 insertions(+), 4 deletions(-) create mode 100644 reference/execution/execution/child-type.md create mode 100644 reference/execution/execution/into_variant.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 3bdb0796d9..c398ec2285 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -125,7 +125,7 @@ namespace std::execution { | [`execution::split`](execution/split.md.nolink) | 入力Senderの値を複製送信 (customization point object) | C++26 | | [`execution::when_all`](execution/when_all.md.nolink) | 全ての入力Sender完了を待機 (customization point object) | C++26 | | [`execution::when_all_with_variant`](execution/when_all_with_variant.md.nolink) | 複数の値完了シグネチャをもつ全ての入力Sender完了を待機 (customization point object) | C++26 | -| [`execution::into_variant`](execution/into_variant.md.nolink) | 複数の値完了シグネチャを単一[`variant`](/reference/variant/variant.md)型の値完了シグネチャに変換 (customization point object) | C++26 | +| [`execution::into_variant`](execution/into_variant.md) | 複数の値完了シグネチャを単一[`variant`](/reference/variant/variant.md)型の値完了シグネチャに変換 (customization point object) | C++26 | | [`execution::stopped_as_optional`](execution/stopped_as_optional.md.nolink) | 入力Senderの停止完了を[`optional`](/reference/optional/optional.md)型の値完了に変換 (customization point object) | C++26 | | [`execution::stopped_as_error`](execution/stopped_as_error.md.nolink) | 入力Senderの停止完了をエラー完了に変換 (customization point object) | C++26 | diff --git a/reference/execution/execution/child-type.md b/reference/execution/execution/child-type.md new file mode 100644 index 0000000000..d9208860c2 --- /dev/null +++ b/reference/execution/execution/child-type.md @@ -0,0 +1,29 @@ +# child-type +* execution[meta header] +* std::execution[meta namespace] +* type-alias[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template + using child-type = decltype(declval().template get()); // exposition only +} +``` +* template get[link product-type.md] + +## 概要 +[Senderアルゴリズム型](basic-sender.md)`Sndr`の子Sender型を取得する説明専用のエイリアステンプレート。 + + +## バージョン +### 言語 +- C++26 + +## 関連項目 +- [`execution::schedule_from`](schedule_from.md.nolink) +- [`execution::into_variant`](into_variant.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/into_variant.md b/reference/execution/execution/into_variant.md new file mode 100644 index 0000000000..68b6379f1a --- /dev/null +++ b/reference/execution/execution/into_variant.md @@ -0,0 +1,193 @@ +# into_variant +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct into_variant_t { unspecified }; + inline constexpr into_variant_t into_variant{}; +} +``` +* unspecified[italic] + +## 概要 +`into_variant`は、複数の[値完了シグネチャ](set_value.md)を持つ入力[Sender](sender.md)から複数[`tuple`](/reference/tuple/tuple.md)型からなる[`variant`](/reference/variant/variant.md)型の[値完了シグネチャへと変換](value_types_of_t.md)するSenderアダプタである。 + +`into_variant`はパイプライン記法をサポートする。 + + +## 効果 +説明用の式`sndr`に対して`decltype((sndr))`が[`sender`](sender.md)を満たさないとき、呼び出し式`into_variant(sndr)`は不適格となる。 + +そうでなければ、呼び出し式`into_variant(sndr)`は`sndr`が1回だけ評価されることを除いて、下記と等価。 + +```cpp +transform_sender(get-domain-early(sndr), make-sender(into_variant, {}, sndr)) +``` +* transform_sender[link transform_sender.md] +* get-domain-early[link get-domain-early.md] +* make-sender[link make-sender.md] + + +### Senderアルゴリズムタグ `into_variant` +Senderアルゴリズム動作説明用のクラステンプレート[`impls-for`](impls-for.md)に対して、下記の特殊化が定義される。 + +```cpp +namespace std::execution { + template<> + struct impls-for : default-impls { + static constexpr auto get-state = see below; + static constexpr auto complete = see below; + }; +} +``` +* impls-for[link impls-for.md] +* default-impls[link impls-for.md] +* see below[italic] + +`impls-for::get-state`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 + +- 子[Sender](sender.md)の[値完了シグニチャを集約](value_types_of_t.md)した[`variant`](/reference/variant/variant.md)`<`[`tuple`](/reference/variant/variant.md)`<...>, ...>`型をデフォルト構築して返す。 + +```cpp +[](Sndr&& sndr, Rcvr& rcvr) noexcept + -> type_identity, env_of_t>> { + return {}; +} +``` +* type_identity[link /reference/type_traits/type_identity.md] +* value_types_of_t[link value_types_of_t.md] +* child-type[link child-type.md] +* env_of_t[link env_of_t.md] + +`impls-for::complete`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 + +- [値完了](set_value.md)の場合、引数パック`args...`から[`variant`](/reference/variant/variant.md)型の送信値を構築して接続先[Receiver](receiver.md)の[値完了関数](set_value.md)を呼び出す。 +- [エラー完了](set_error.md)または[停止完了](set_stopped.md)の場合、接続先[Receiver](receiver.md)の同種完了関数に全引数を転送する。 + +```cpp +[]( + auto, State, Rcvr& rcvr, Tag, Args&&... args) noexcept -> void { + if constexpr (same_as) { + using variant_type = typename State::type; + TRY-SET-VALUE(rcvr, variant_type(decayed-tuple{std::forward(args)...})); + } else { + Tag()(std::move(rcvr), std::forward(args)...); + } +} +``` +* set_value[link set_value.md] +* decayed-tuple[link decayed-tuple.md] +* std::move[link /reference/utility/move.md] + + +## カスタマイゼーションポイント +[Sender](sender.md)`sndr`に[関連付けられた実行ドメイン](get-domain-early.md)`dom`に対して、[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 +[デフォルト実行ドメイン](../execution/default_domain.md)では無変換。 + + +## 例 +```cpp example +#include +#include +#include +#include +#include +namespace ex = stdexec; + +struct FizzBuzzSender { + using sender_concept = ex::sender_t; + using completion_signatures = ex::completion_signatures< + ex::set_value_t(int), + ex::set_value_t(std::string) + >; + + template + struct state { + using operation_state_concept = ex::operation_state_t; + + state(Rcvr rcvr, int val) + : rcvr_{std::move(rcvr)}, val_{val} {} + + void start() noexcept { + if (val_ % 15 == 0) { + ex::set_value(std::move(rcvr_), "FizzBuzz"); + } else if (val_ % 3 == 0) { + ex::set_value(std::move(rcvr_), "Fizz"); + } else if (val_ % 5 == 0) { + ex::set_value(std::move(rcvr_), "Buzz"); + } else { + ex::set_value(std::move(rcvr_), val_); + } + } + + Rcvr rcvr_; + int val_; + }; + + template + auto connect(Rcvr rcvr) noexcept { + return state{std::move(rcvr), val_}; + } + + int val_; +}; + +template +struct overload : Ts... { using Ts::operator()...; }; + +int main() +{ + int val = 15; + ex::sender auto sndr = ex::into_variant(FizzBuzzSender{val}); + auto [result] = std::this_thread::sync_wait(sndr).value(); + + std::visit(overload{ + [](std::tuple n) { + std::println("(int) {}", get<0>(n)); + }, + [](std::tuple s) { + std::println("(str) {}", get<0>(s)); + } + }, result); +} +``` +* ex::into_variant[color ff0000] +* ex::sender_t[link sender.md] +* ex::sender[link sender.md] +* ex::completion_signatures[link completion_signatures.md] +* ex::set_value_t[link set_value.md] +* ex::set_value[link set_value.md] +* ex::operation_state[link operation_state.md] +* std::this_thread::sync_wait[link ../this_thread/sync_wait.md] +* value()[link /reference/optional/optional/value.md] +* std::move[link /reference/utility/move.md] +* std::visit[link /reference/variant/visit.md] +* get<0>[link /reference/tuple/tuple/get.md] + +### 出力 +``` +(str) FizzBuzz +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::when_all_with_variant`](when_all_with_variant.md.nolink) +- [`this_thread::sync_wait_with_variant`](../this_thread/sync_wait_with_variant.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/this_thread/sync_wait_with_variant.md b/reference/execution/this_thread/sync_wait_with_variant.md index 9754db1d42..efa32e34b1 100644 --- a/reference/execution/this_thread/sync_wait_with_variant.md +++ b/reference/execution/this_thread/sync_wait_with_variant.md @@ -23,7 +23,7 @@ namespace std::this_thread { ## 効果 -説明用の`sndr`を`decltype(`[`into_variant`](into_variant.md.nolink)`(sndr))`が`Sndr`型となる式とする。 +説明用の`sndr`を`decltype(`[`into_variant`](../execution/into_variant.md)`(sndr))`が`Sndr`型となる式とする。 [`sender_in`](../execution/sender_in.md)` == false`のとき、呼び出し式`this_thread::sync_wait_with_variant(sndr)`は不適格となる。 @@ -55,7 +55,7 @@ namespace std::this_thread { ### Senderアルゴリズムタグ `sync_wait_with_variant` -説明用の`sndr`を`decltype(`[`into_variant`](into_variant.md.nolink)`(sndr))`が`Sndr`型となる式とする。 +説明用の`sndr`を`decltype(`[`into_variant`](../execution/into_variant.md)`(sndr))`が`Sndr`型となる式とする。 [`callable`](/reference/functional/callable.md.nolink)`<`[`sync_wait_t`](sync_wait.md)`, Sndr> == false`のとき、式`sync_wait_with_variant.apply_sender(sndr)`は不適格となる。 @@ -69,7 +69,7 @@ if (auto opt_value = sync_wait(into_variant(sndr))) { return result_type(nullopt); ``` * sync_wait[link sync_wait.md] -* into_variant[link into_variant.md.nolink] +* into_variant[link ../execution/into_variant.md] * std::move[link /reference/utility/move.md] * get<0>[link /reference/tuple/tuple/get.md] * nullopt[link /reference/optional/nullopt_t.md] From 248c362956d5157b1c7924309b6ea6c86b3c87ba Mon Sep 17 00:00:00 2001 From: yoh Date: Sat, 10 May 2025 13:18:45 +0900 Subject: [PATCH 1671/3948] execution/into_variant: fix example --- reference/execution/execution/into_variant.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/reference/execution/execution/into_variant.md b/reference/execution/execution/into_variant.md index 68b6379f1a..3ec44c2b92 100644 --- a/reference/execution/execution/into_variant.md +++ b/reference/execution/execution/into_variant.md @@ -94,8 +94,8 @@ namespace std::execution { #include #include #include -#include -namespace ex = stdexec; +#include +namespace ex = std::execution; struct FizzBuzzSender { using sender_concept = ex::sender_t; @@ -158,6 +158,7 @@ int main() * ex::sender_t[link sender.md] * ex::sender[link sender.md] * ex::completion_signatures[link completion_signatures.md] +* ex::operation_state[link operation_state.md] * ex::set_value_t[link set_value.md] * ex::set_value[link set_value.md] * ex::operation_state[link operation_state.md] From 1adf476c417dacd845bb7d30ffcd13a2d1eb7956 Mon Sep 17 00:00:00 2001 From: yoh Date: Sat, 10 May 2025 17:07:46 +0900 Subject: [PATCH 1672/3948] =?UTF-8?q?execution/into=5Fvariant:=20=E5=8A=B9?= =?UTF-8?q?=E6=9E=9C=E8=AA=AC=E6=98=8E=E8=AA=A4=E3=82=8A=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20(#1384)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - get-state: 型情報の計算が主目的であり、その値は意味をなさない。 - complete: Stateの型情報のみを利用し、パラメータ値は利用しない。 --- reference/execution/execution/into_variant.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/reference/execution/execution/into_variant.md b/reference/execution/execution/into_variant.md index 3ec44c2b92..484727fa78 100644 --- a/reference/execution/execution/into_variant.md +++ b/reference/execution/execution/into_variant.md @@ -49,7 +49,7 @@ namespace std::execution { `impls-for::get-state`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 -- 子[Sender](sender.md)の[値完了シグニチャを集約](value_types_of_t.md)した[`variant`](/reference/variant/variant.md)`<`[`tuple`](/reference/variant/variant.md)`<...>, ...>`型をデフォルト構築して返す。 +- 子[Sender](sender.md)の[値完了シグニチャを集約](value_types_of_t.md)した[`variant`](/reference/variant/variant.md)`<`[`tuple`](/reference/variant/variant.md)`<...>, ...>`型を[`type_identity`](/reference/type_traits/type_identity.md)クラステンプレートのパラメータに格納して返す。 ```cpp [](Sndr&& sndr, Rcvr& rcvr) noexcept @@ -64,7 +64,8 @@ namespace std::execution { `impls-for::complete`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 -- [値完了](set_value.md)の場合、引数パック`args...`から[`variant`](/reference/variant/variant.md)型の送信値を構築して接続先[Receiver](receiver.md)の[値完了関数](set_value.md)を呼び出す。 +- `State`として渡される前述`get-state`メンバ戻り値型([`type_identity`](/reference/type_traits/type_identity.md))から、`into_varinat`の送信値となる[`variant`](/reference/variant/variant.md)`<`[`tuple`](/reference/variant/variant.md)`<...>, ...>`型情報を取り出す。 +- [値完了](set_value.md)の場合、引数パック`args...`から送信値を構築して接続先[Receiver](receiver.md)の[値完了関数](set_value.md)を呼び出す。 - [エラー完了](set_error.md)または[停止完了](set_stopped.md)の場合、接続先[Receiver](receiver.md)の同種完了関数に全引数を転送する。 ```cpp @@ -78,7 +79,7 @@ namespace std::execution { } } ``` -* set_value[link set_value.md] +* set_value_t[link set_value.md] * decayed-tuple[link decayed-tuple.md] * std::move[link /reference/utility/move.md] From 331cc4e67f7fba8f4aaa49cbd76c92c513ba3b89 Mon Sep 17 00:00:00 2001 From: yoh Date: Sat, 10 May 2025 19:06:59 +0900 Subject: [PATCH 1673/3948] execution: starts_on (#1384) --- reference/execution/execution.md | 2 +- reference/execution/execution/into_variant.md | 2 +- reference/execution/execution/just.md | 2 +- reference/execution/execution/read_env.md | 5 +- reference/execution/execution/schedule.md | 7 +- reference/execution/execution/starts_on.md | 155 ++++++++++++++++++ reference/execution/execution/then.md | 4 +- reference/execution/this_thread/sync_wait.md | 4 +- .../this_thread/sync_wait_with_variant.md | 4 +- 9 files changed, 172 insertions(+), 13 deletions(-) create mode 100644 reference/execution/execution/starts_on.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index c398ec2285..7f05c0f7b0 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -111,7 +111,7 @@ namespace std::execution { | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`execution::sender_adaptor_closure`](execution/sender_adaptor_closure.md.nolink) | Senderアダプタ実装用クロージャ型(class template) | C++26 | -| [`execution::starts_on`](execution/starts_on.md.nolink) | 指定Scheduler上で開始する (customization point object) | C++26 | +| [`execution::starts_on`](execution/starts_on.md) | 指定Scheduler上で開始する (customization point object) | C++26 | | [`execution::continues_on`](execution/continues_on.md.nolink) | 指定Scheduler上で継続する (customization point object) | C++26 | | [`execution::on`](execution/on.md.nolink) | 指定Scheduler上で実行する (customization point object) | C++26 | | [`execution::schedule_from`](execution/schedule_from.md.nolink) | Sender完了に依存する作業をスケジュール (customization point object) | C++26 | diff --git a/reference/execution/execution/into_variant.md b/reference/execution/execution/into_variant.md index 484727fa78..c3fd2b6d2b 100644 --- a/reference/execution/execution/into_variant.md +++ b/reference/execution/execution/into_variant.md @@ -85,7 +85,7 @@ namespace std::execution { ## カスタマイゼーションポイント -[Sender](sender.md)`sndr`に[関連付けられた実行ドメイン](get-domain-early.md)`dom`に対して、[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 +Senderアルゴリズム構築時に、入力[Sender](sender.md)`sndr`に[関連付けられた実行ドメイン](get-domain-early.md)に対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 [デフォルト実行ドメイン](../execution/default_domain.md)では無変換。 diff --git a/reference/execution/execution/just.md b/reference/execution/execution/just.md index f8183b8195..dedcc340cd 100644 --- a/reference/execution/execution/just.md +++ b/reference/execution/execution/just.md @@ -22,7 +22,7 @@ namespace std::execution { ### Senderアルゴリズムタグ `just` -Senderアルゴリズム動作説明用のクラステンプレート`impls-for`に対して、下記の特殊化が定義される。 +Senderアルゴリズム動作説明用のクラステンプレート[`impls-for`](impls-for.md)に対して、下記の特殊化が定義される。 ```cpp namespace std::execution { diff --git a/reference/execution/execution/read_env.md b/reference/execution/execution/read_env.md index 41e98e7f80..616da64979 100644 --- a/reference/execution/execution/read_env.md +++ b/reference/execution/execution/read_env.md @@ -23,7 +23,7 @@ namespace std::execution { ### Senderアルゴリズムタグ -Senderアルゴリズム動作説明用のクラステンプレート`impls-for`に対して、下記の特殊化が定義される。 +Senderアルゴリズム動作説明用のクラステンプレート[`impls-for`](impls-for.md)に対して、下記の特殊化が定義される。 ```cpp namespace std::execution { @@ -66,8 +66,9 @@ int main() * ex::read_env[color ff0000] * ex::sender[link sender.md] * ex::get_scheduler[link get_scheduler.md] -* ex::starts_on[link starts_on.md.nolink] +* ex::starts_on[link starts_on.md] * std::this_thread::sync_wait[link ../this_thread/sync_wait.md] +* value()[link /reference/optional/optional/value.md] ### 出力 ``` diff --git a/reference/execution/execution/schedule.md b/reference/execution/execution/schedule.md index 36712f7058..915d9e7160 100644 --- a/reference/execution/execution/schedule.md +++ b/reference/execution/execution/schedule.md @@ -13,10 +13,13 @@ namespace std::execution { * unspecified[italic] ## 概要 -`schedule`は、[Scheduler](scheduler.md)から[スケジュールSender](sender.md)を取得するSenderファクトリである。 +`schedule`は、[Scheduler](scheduler.md)からスケジュール[Sender](sender.md)を取得するSenderファクトリである。 + +### スケジュールSender +`schedule(sch)`式の結果はスケジュールSender(schedule sender)と呼ばれる。 スケジュールSenderより生成される[非同期操作](operation_state.md)を開始すると、Schedulerに関連付けられた実行リソース上で空の[値完了関数](set_value.md)を呼び出す。 -スケジュールSenderの[値完了Scheduler](get_completion_scheduler.md)は、引数に指定したScheduler`sch`に等しい。 +スケジュールSenderの[値完了Scheduler](get_completion_scheduler.md)は、`schedule(sch)`式の引数に指定した[Scheduler](scheduler.md)`sch`に等しい。 ## 効果 diff --git a/reference/execution/execution/starts_on.md b/reference/execution/execution/starts_on.md new file mode 100644 index 0000000000..2fedaa2a17 --- /dev/null +++ b/reference/execution/execution/starts_on.md @@ -0,0 +1,155 @@ +# starts_on +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct starts_on_t { unspecified }; + inline constexpr starts_on_t starts_on{}; +} +``` +* unspecified[italic] + +## 概要 +`starts_on`は、入力[Sender](sender.md)を指定[Scheduler](scheduler.md)に関連付けられた実行リソースに属する実行エージェント上で開始するSenderアダプタである。 + + +## 効果 +説明用の式`sch`と`sndr`に対して、`decltype((sch))`が[`scheduler`](scheduler.md)を満たさない、もしくは`decltype((sndr))`が[`sender`](sender.md)を満たさないとき、呼び出し式`starts_on(sch, sndr)`は不適格となる。 + +そうでなければ、呼び出し式`starts_on(sch, sndr)`は`sch`が1回だけ評価されることを除いて、下記と等価。 + +```cpp +transform_sender( + query-or-default(get_domain, sch, default_domain()), + make-sender(starts_on, sch, sndr)) +``` +* transform_sender[link transform_sender.md] +* query-or-default[link query-or-default.md.nolink] +* get_domain[link get_domain.md] +* default_domain()[link default_domain.md] +* make-sender[link make-sender.md] + + +### Senderアルゴリズムタグ `starts_on` +説明用の式`out_sndr`と`env`に対して、型`OutSndr`を`decltype((out_sndr))`とする。[`sender-for`](sender-for.md)` == false`のとき、式`starts_on.transform_env(out_sndr, env)`および式`starts_on.transform_sender(out_sndr, env)`はいずれも不適格となる。 + +そうでなければ、下記の通り。 + +- 式`starts_on.transform_env(out_sndr, env)`は下記と等価。 + + ```cpp + auto&& [_, sch, _] = out_sndr; + return JOIN-ENV(SCHED-ENV(sch), FWD-ENV(env)); + ``` + * JOIN-ENV[link JOIN-ENV.md.nolink] + * SCHED-ENV[link SCHED-ENV.md.nolink] + * FWD-ENV[link ../forwarding_query.md] + +- 式`starts_on.transform_sender(out_sndr, env)`は下記と等価。 + + ```cpp + auto&& [_, sch, sndr] = out_sndr; + return let_value( + schedule(sch), + [sndr = std::forward_like(sndr)]() mutable + noexcept(is_nothrow_move_constructible_v>) { + return std::move(sndr); + }); + ``` + * let_value[link let_value.md.nolink] + * schedule[link schedule.md] + * is_nothrow_move_constructible_v[link /reference/type_traits/is_nothrow_move_constructible.md] + * decay_t[link /reference/type_traits/decay.md] + * std::move[link /reference/utility/move.md] + + +## カスタマイゼーションポイント +Senderアルゴリズム構築時に、[Scheduler](scheduler.md)`sch`に[関連付けられた実行ドメイン](query-or-default.md.nolink)に対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 +[デフォルト実行ドメイン](../execution/default_domain.md)では無変換。 + +[Receiver](receiver.md)との[接続(connect)](connect.md)時に、[関連付けられた実行ドメイン](get-domain-late.md)に対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 +[デフォルト実行ドメイン](../execution/default_domain.md)では`starts_on.transform_sender(out_sndr, env)`が呼ばれ、前述仕様通りのSenderへと変換される。 + +説明用の式`out_sndr`を`starts_on(sch, sndr)`の戻り値[Sender](sender.md)とし、型`OutSndr`を`decltype((out_sndr))`とする。式`out_rcvr`を[`sender_in`](sender_in.md)` == true`となる[環境](../queryable.md)`Env`に関連付けられた[Receiver](receiver.md)とする。`out_sndr`と`out_rcvr`との[接続(connect)](connect.md)結果[Operation State](operation_state.md)への左辺値参照を`op`としたとき、 + +- 呼び出し[`start`](start.md)`(op)`は、[Scheduler](scheduler.md)`sch`に関連づけられた実行リソースに属する実行エージェント上で入力[Sender](sender.md)`sndr`を開始すべき。 +- `sch`上でのスケジューリングが失敗した場合、未規定の実行エージェント上で`out_rcvr`の[エラー完了](set_error.md)が行われるべき。 + + +## 例 +```cpp example +#include +#include +#include +namespace ex = std::execution; + +int main() +{ + ex::run_loop loop; + std::jthread worker{[&]{ + std::println("start worker#{}", std::this_thread::get_id()); + loop.run(); + }}; + + ex::scheduler auto sch = loop.get_scheduler(); + ex::sender auto sndr = + ex::starts_on(sch, ex::just(21)) + | ex::then([](int n) { + std::println("on worker#{}", std::this_thread::get_id()); + return n * 2; + }); + + std::println("main#{}", std::this_thread::get_id()); + + auto [val] = std::this_thread::sync_wait(std::move(sndr)).value(); + std::println("val={}", val); + + loop.finish(); +} +``` +* ex::starts_on[color ff0000] +* ex::run_loop[link run_loop.md] +* ex::sender[link sender.md] +* ex::scheduler[link scheduler.md] +* ex::then[link then.md] +* get_scheduler()[link run_loop/get_scheduler.md] +* run()[link run_loop/run.md] +* finish()[link run_loop/finish.md] +* std::this_thread::sync_wait[link ../this_thread/sync_wait.md] +* value()[link /reference/optional/optional/value.md] +* std::move[link /reference/utility/move.md] +* std::this_thread::get_id()[link /reference/thread/this_thread/get_id.md] + + +### 出力例 +``` +main#126057012819776 +start worker#126057007023680 +on worker#126057007023680 +val=42 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::schedule`](schedule.md) +- [`execution::continues_on`](continues_on.md.nolink) +- [`execution::on`](on.md.nolink) + + +## 参照 +- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/then.md b/reference/execution/execution/then.md index 3758369d3d..54dcb1fdff 100644 --- a/reference/execution/execution/then.md +++ b/reference/execution/execution/then.md @@ -32,7 +32,7 @@ transform_sender(get-domain-early(sndr), make-sender(then, f, sndr)) ### Senderアルゴリズムタグ `then` -Senderアルゴリズム動作説明用のクラステンプレート`impls-for`に対して、下記の特殊化が定義される。 +Senderアルゴリズム動作説明用のクラステンプレート[`impls-for`](impls-for.md)に対して、下記の特殊化が定義される。 ```cpp namespace std::execution { @@ -60,7 +60,7 @@ namespace std::execution { ## カスタマイゼーションポイント -[Sender](sender.md)`sndr`に[関連付けられた実行ドメイン](get-domain-early.md)`dom`に対して、[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 +Senderアルゴリズム構築時に、入力[Sender](sender.md)`sndr`に[関連付けられた実行ドメイン](get-domain-early.md)に対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 [デフォルト実行ドメイン](../execution/default_domain.md)では無変換。 戻り値の[Sender](sender.md)`out_sndr`が下記を満たさない場合、呼び出し式`then(sndr, f)`の動作は未定義となる。 diff --git a/reference/execution/this_thread/sync_wait.md b/reference/execution/this_thread/sync_wait.md index a82fc3256b..d80039fd18 100644 --- a/reference/execution/this_thread/sync_wait.md +++ b/reference/execution/this_thread/sync_wait.md @@ -13,7 +13,7 @@ namespace std::this_thread { * unspecified[italic] ## 概要 -`sync_wait`は、[Sender](../execution/sender.md)が完了するまで現在のスレッドをブロックし、非同期操作の結果を取得するSenderコンシューマである。 +`sync_wait`は、入力[Sender](../execution/sender.md)が完了するまで現在のスレッドをブロックし、非同期操作の結果を取得するSenderコンシューマである。 `sync_wait`は入力Senderが[値完了シグネチャ](../execution/set_value.md)を1個だけ持つことを要求する。 値完了シグネチャが複数存在する場合は[`sync_wait_with_variant`](sync_wait_with_variant.md)アルゴリズムを利用する。 @@ -85,7 +85,7 @@ return std::move(state.result); ## カスタマイゼーションポイント -[Sender](../execution/sender.md)`sndr`に[関連付けられた実行ドメイン](../execution/get-domain-early.md)`dom`に対して、 +入力[Sender](../execution/sender.md)`sndr`に[関連付けられた実行ドメイン](../execution/get-domain-early.md)`dom`に対して、 [`execution::apply_sender`](../execution/apply_sender.md)経由で`dom.apply_sender(sync_wait, sndr)`が呼ばれる。 [デフォルト実行ドメイン](../execution/default_domain.md)では、`sync_wait.apply_sender(sndr)`が呼ばれる。 diff --git a/reference/execution/this_thread/sync_wait_with_variant.md b/reference/execution/this_thread/sync_wait_with_variant.md index efa32e34b1..7e49007118 100644 --- a/reference/execution/this_thread/sync_wait_with_variant.md +++ b/reference/execution/this_thread/sync_wait_with_variant.md @@ -13,7 +13,7 @@ namespace std::this_thread { * unspecified[italic] ## 概要 -`sync_wait_with_variant`は、[Sender](../execution/sender.md)が完了するまで現在のスレッドをブロックし、非同期操作の結果を取得するSenderコンシューマである。 +`sync_wait_with_variant`は、入力[Sender](../execution/sender.md)が完了するまで現在のスレッドをブロックし、非同期操作の結果を取得するSenderコンシューマである。 `sync_wait_with_variant`は入力Senderが複数の[値完了シグネチャ](../execution/set_value.md)を持つケースに対応する。 値完了シグネチャが1個だけの場合は[`sync_wait`](sync_wait.md)アルゴリズムを利用する。 @@ -76,7 +76,7 @@ return result_type(nullopt); ## カスタマイゼーションポイント -[Sender](../execution/sender.md)`sndr`に[関連付けられた実行ドメイン](../execution/get-domain-early.md)`dom`に対して、 +入力[Sender](../execution/sender.md)`sndr`に[関連付けられた実行ドメイン](../execution/get-domain-early.md)`dom`に対して、 [`execution::apply_sender`](../execution/apply_sender.md)経由で`dom.apply_sender(sync_wait_with_variant, sndr)`が呼ばれる。 [デフォルト実行ドメイン](../execution/default_domain.md)では、`sync_wait_with_variant.apply_sender(sndr)`が呼ばれる。 From 01eff315e5f9794a3618a65f280f752033509f48 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sat, 10 May 2025 20:25:46 +0900 Subject: [PATCH 1674/3948] add is_implicit_lifetime to type_traits --- ...jects_for_low-level_object_manipulation.md | 2 +- lang/cpp23.md | 1 + lang/cpp23/feature_test_macros.md | 2 +- reference/type_traits.md | 1 + reference/type_traits/is_implicit_lifetime.md | 84 +++++++++++++++++++ 5 files changed, 88 insertions(+), 2 deletions(-) create mode 100644 reference/type_traits/is_implicit_lifetime.md diff --git a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md index 4f19a53d9e..101c295c29 100644 --- a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md +++ b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md @@ -405,7 +405,7 @@ unique_ptr Stream::read() { - [`start_lifetime_as()`](/reference/memory/start_lifetime_as.md.nolink) - [`start_lifetime_as_array()`](/reference/memory/start_lifetime_as_array.md.nolink) -- [`is_implicit_lifetime`](/reference/type_traits/is_implicit_lifetime.md.nolink) +- [`is_implicit_lifetime`](/reference/type_traits/is_implicit_lifetime.md) ## 参照 diff --git a/lang/cpp23.md b/lang/cpp23.md index 707a28225a..ea48a8f9c9 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -223,6 +223,7 @@ C++23とは、2023年中に改訂され、ISO/IEC 14882:2024で標準規格化 - [``](/reference/type_traits.md)に、一時オブジェクトの参照への束縛を検出するための型特性として、以下を追加: - [`std::reference_constructs_from_temporary`](/reference/type_traits/reference_constructs_from_temporary.md) - [`std::reference_converts_from_temporary`](/reference/type_traits/reference_converts_from_temporary.md) +- [``](/reference/type_traits.md)に、暗黙的に構築される型かを判定する型特性[`std::is_implicit_lifetime`](/reference/type_traits/is_implicit_lifetime.md)を追加 ### C互換ライブラリ diff --git a/lang/cpp23/feature_test_macros.md b/lang/cpp23/feature_test_macros.md index a065a03100..98d74f2b98 100644 --- a/lang/cpp23/feature_test_macros.md +++ b/lang/cpp23/feature_test_macros.md @@ -59,7 +59,7 @@ |`__cpp_lib_generator`|`202207L`|[`std::generator`](/reference/generator/generator.md)の追加|[``](/reference/generator.md)| |`__cpp_lib_invoke_r`|`202106L`|[`std::invoke_r()`](/reference/functional/invoke_r.md)の追加|[``](/reference/functional.md)| |`__cpp_lib_ios_noreplace`|`202207L`|[`std::ios::noreplace`](/reference/ios/ios_base/type-openmode.md)の追加|[``](/reference/ios.md)| -|`__cpp_lib_is_implicit_lifetime`|`202302L`|`std::is_implicit_lifetime`の追加|[``](/reference/type_traits.md)| +|`__cpp_lib_is_implicit_lifetime`|`202302L`|[`std::is_implicit_lifetime`](/reference/type_traits/is_implicit_lifetime.md)の追加|[``](/reference/type_traits.md)| |`__cpp_lib_is_scoped_enum`|`202011L`|[`std::is_scoped_enum`](/reference/type_traits/is_scoped_enum.md)の追加|[``](/reference/type_traits.md)| |`__cpp_lib_mdspan`|`202207L`|[``](/reference/mdspan.md)の追加|[``](/reference/mdspan.md)| |`__cpp_lib_modules`|`202207L`|モジュール[``](/module/std.md)と[``](/module/std.compat.md)の追加|| diff --git a/reference/type_traits.md b/reference/type_traits.md index 55dcffd4f8..cad7b2b471 100644 --- a/reference/type_traits.md +++ b/reference/type_traits.md @@ -68,6 +68,7 @@ | [`is_abstract`](type_traits/is_abstract.md) | 型が抽象クラスか調べる (class template) | C++11 | | [`is_final`](type_traits/is_final.md) | 型に`final`が付いているかを調べる (class template) | C++14 | | [`is_aggregate`](type_traits/is_aggregate.md) | 型が集成体かを調べる (class template) | C++17 | +| [`is_implicit_lifetime`](type_traits/is_implicit_lifetime.md) | 型が暗黙的に構築されるかを調べる (class template) | C++23 | | [`is_signed`](type_traits/is_signed.md) | 型が符号付き算術型か調べる (class template) | C++11 | | [`is_unsigned`](type_traits/is_unsigned.md) | 型が符号無し算術型か調べる (class template) | C++11 | | [`is_bounded_array`](type_traits/is_bounded_array.md) | 型が要素数の判明している配列型かを調べる (class template) | C++20 | diff --git a/reference/type_traits/is_implicit_lifetime.md b/reference/type_traits/is_implicit_lifetime.md new file mode 100644 index 0000000000..6dcbcfd97d --- /dev/null +++ b/reference/type_traits/is_implicit_lifetime.md @@ -0,0 +1,84 @@ +# is_implicit_lifetime +* type_traits[meta header] +* std[meta namespace] +* class template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template + struct is_implicit_lifetime; + + template + inline constexpr bool is_implicit_lifetime_v = is_implicit_lifetime::value; +} +``` + +## 概要 +型`T`が暗黙的に構築されるかを調べる。 + +暗黙的な構築はC++20で取り入れられた仕様であり、次のいずれかに該当する型であれば暗黙的に構築される + +1. [スカラ型](/reference/type_traits/is_scalar.md) +2. 配列型 + - 要素型は問わない +3. *implicit-lifetime class types* + - デストラクタがユーザー定義されていない集成体型、もしくは + - 少なくとも1つの資格のあるトリビアルコンストラクタと、トリビアルで削除されていないデストラクタを持つ型 +4. 1~3のCV修飾された型 + + +## 要件 +型`T`は配列型、完全型、または`void`でなければならない。 + + +## 効果 +`is_implicit_lifetime`は、型`T`が暗黙的に構築されるのであれば[`true_type`](true_type.md)から派生し、そうでなければ[`false_type`](false_type.md)から派生する。 + + +## 例 +```cpp example +#include +#include + +enum Enum {}; +class Class {}; +class NotTrivial { +public: + ~NotTrivial() {} +}; + +int main() { + int i_array[1]; + NotTrivial nt_array[1]; + + static_assert(std::is_implicit_lifetime()); + static_assert(std::is_implicit_lifetime()); + static_assert(std::is_implicit_lifetime()); + static_assert(std::is_implicit_lifetime()); + static_assert(std::is_implicit_lifetime()); + static_assert(!std::is_implicit_lifetime()); + static_assert(std::is_implicit_lifetime()); + static_assert(std::is_implicit_lifetime>()); + static_assert(!std::is_implicit_lifetime>()); +} +``` +* std::is_implicit_lifetime[color ff0000] +* std::pair[link /reference/utility/pair.md] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2674R0 A trait for implicit lifetime types](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2674r0.pdf) From 7160b8203708e291ac17f7ca43cf454da0bcf757 Mon Sep 17 00:00:00 2001 From: yoh Date: Sat, 10 May 2025 23:27:12 +0900 Subject: [PATCH 1675/3948] execution: let_value (#1384) --- reference/execution/execution.md | 6 +- reference/execution/execution/connect.md | 2 +- .../execution/default_domain/apply_sender.md | 2 +- reference/execution/execution/emplace-from.md | 41 +++ .../execution/execution/get-domain-early.md | 4 +- .../execution/execution/get-domain-late.md | 4 +- reference/execution/execution/into_variant.md | 2 +- reference/execution/execution/let_value.md | 264 ++++++++++++++++++ reference/execution/execution/read_env.md | 2 +- reference/execution/execution/starts_on.md | 2 +- reference/execution/execution/then.md | 2 +- 11 files changed, 318 insertions(+), 13 deletions(-) create mode 100644 reference/execution/execution/emplace-from.md create mode 100644 reference/execution/execution/let_value.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 7f05c0f7b0..5bcf0530dc 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -118,9 +118,9 @@ namespace std::execution { | [`execution::then`](execution/then.md) | 値完了時の継続処理をアタッチ (customization point object) | C++26 | | [`execution::upon_error`](execution/upon_error.md.nolink) | エラー完了時の継続処理をアタッチ (customization point object) | C++26 | | [`execution::upon_stopped`](execution/upon_stopped.md.nolink) | 停止完了時の継続処理をアタッチ (customization point object) | C++26 | -| [`execution::let_value`](execution/let_value.md.nolink) | 値完了の継続にユーザ定義処理を連結 (customization point object) | C++26 | -| [`execution::let_error`](execution/let_error.md.nolink) | エラー完了の継続にユーザ定義処理を連結 (customization point object) | C++26 | -| [`execution::let_stopped`](execution/let_stopped.md.nolink) | 停止完了の継続にユーザ定義処理を連結 (customization point object) | C++26 | +| [`execution::let_value`](execution/let_value.md) | 値完了結果から入れ子の非同期操作へ変換 (customization point object) | C++26 | +| [`execution::let_error`](execution/let_error.md.nolink) | エラー完了結果から入れ子の非同期操作へ変換 (customization point object) | C++26 | +| [`execution::let_stopped`](execution/let_stopped.md.nolink) | 停止完了を入れ子の非同期操作へ変換 (customization point object) | C++26 | | [`execution::bulk`](execution/bulk.md.nolink) | インデクス空間上で指定関数を連続実行 (customization point object) | C++26 | | [`execution::split`](execution/split.md.nolink) | 入力Senderの値を複製送信 (customization point object) | C++26 | | [`execution::when_all`](execution/when_all.md.nolink) | 全ての入力Sender完了を待機 (customization point object) | C++26 | diff --git a/reference/execution/execution/connect.md b/reference/execution/execution/connect.md index 233f66d068..f519456cd6 100644 --- a/reference/execution/execution/connect.md +++ b/reference/execution/execution/connect.md @@ -112,7 +112,7 @@ namespace std::execution { 型`V`を`await-result-type`とする。 `SET-VALUE-SIG(T)`を、`T`がCV修飾された`void`ならば[`set_value_t`](set_value.md)`()`型、そうでなければ[`set_value_t`](set_value.md)`(T)`型とする。 -型`Sigs`を次の通り定義する。 +型`Sigs`を下記の通り定義する。 ```cpp completion_signatures< diff --git a/reference/execution/execution/default_domain/apply_sender.md b/reference/execution/execution/default_domain/apply_sender.md index 1c93cc05a1..60a31cec66 100644 --- a/reference/execution/execution/default_domain/apply_sender.md +++ b/reference/execution/execution/default_domain/apply_sender.md @@ -21,7 +21,7 @@ Senderアルゴリズム適用のデフォルト動作。 ## テンプレートパラメータ制約 -説明用の式`e`を`Tag().apply_sender(`[`std::forward`](/reference/utility/forward.md)`(sndr), `[`std::forward`](/reference/utility/forward.md)`(args)...)`としたとき、式`e`が適格であること。 +説明用の式`e`を`Tag().apply_sender(`[`std::forward`](/reference/utility/forward.md)`(sndr),` [`std::forward`](/reference/utility/forward.md)`(args)...)`としたとき、式`e`が適格であること。 ## 戻り値 diff --git a/reference/execution/execution/emplace-from.md b/reference/execution/execution/emplace-from.md new file mode 100644 index 0000000000..f74b328907 --- /dev/null +++ b/reference/execution/execution/emplace-from.md @@ -0,0 +1,41 @@ +# emplace-from +* execution[meta header] +* std::execution[meta namespace] +* class template[meta id-type] +* cpp26[meta cpp] + +```cpp +template + requires is_nothrow_move_constructible_v +struct emplace-from { + Fun fun; // exposition only + using type = call-result-t; + + constexpr operator type() && noexcept(nothrow-callable) { + return std::move(fun)(); + } + + constexpr type operator()() && noexcept(nothrow-callable) { + return std::move(fun)(); + } +}; +``` +* is_nothrow_move_constructible_v[link /reference/type_traits/is_nothrow_move_constructible.md] +* call-result-t[link call-result-t.md.nolink] +* nothrow-callable[link /reference/functional/nothrow-callable.md.nolink] +* std::move[link /reference/utility/move.md] + +## 概要 +`emplace-from`は、Senderアルゴリズム動作仕様定義で用いられる説明専用のクラステンプレートである。 + + +## バージョン +### 言語 +- C++26 + +## 関連項目 +- [`execution::let_value`](let_value.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/get-domain-early.md b/reference/execution/execution/get-domain-early.md index cb28411999..a9092276d3 100644 --- a/reference/execution/execution/get-domain-early.md +++ b/reference/execution/execution/get-domain-early.md @@ -12,7 +12,7 @@ constexpr auto get-domain-early(const Sndr& sndr) noexcept; ## 概要 [Sender](sender.md)アルゴリズム構築時のカスタマイゼーションポイントとして、[実行ドメイン](default_domain.md)を取得する説明専用の関数テンプレート。 -下記の優先順で実行ドメインを検索し、最初に妥当となる型を採用する。 +下記の優先順で実行ドメインを検索し、最初に適格となる型を採用する。 - Senderの[属性](../queryable.md)の実行ドメイン - Senderの[完了Scheduler](get_completion_scheduler.md)の実行ドメイン @@ -20,7 +20,7 @@ constexpr auto get-domain-early(const Sndr& sndr) noexcept; ## 効果 -説明用の型`Domain`を下記リストのうち最初に妥当となる式の型と定義したとき、`return Doamin();`と等価。 +説明用の型`Domain`を下記リストのうち最初に適格となる式の型と定義したとき、`return Doamin();`と等価。 - [`get_domain`](get_domain.md)`(`[`get_env`](get_env.md)`(sndr))` - [`completion-domain`](completion-domain.md)`(sndr)` diff --git a/reference/execution/execution/get-domain-late.md b/reference/execution/execution/get-domain-late.md index 359031a6ba..0d4e74a5e1 100644 --- a/reference/execution/execution/get-domain-late.md +++ b/reference/execution/execution/get-domain-late.md @@ -12,7 +12,7 @@ constexpr auto get-domain-late(const Sndr& sndr, const Env& env) noexcept; ## 概要 [Sender](sender.md)と[Receiver](receiver.md)間[接続(connect)](connect.md)時のカスタマイゼーションポイントとして、[実行ドメイン](default_domain.md)を取得する説明専用の関数テンプレート。 -下記の優先順で実行ドメインを検索し、最初に妥当となる型を採用する。 +下記の優先順で実行ドメインを検索し、最初に適格となる型を採用する。 (Senderアルゴリズム[`continue_on`](continue_on.md.nolink)のみ引数に指定した[Scheduler](scheduler.md)から取得。) - Senderの[属性](../queryable.md)の実行ドメイン @@ -37,7 +37,7 @@ constexpr auto get-domain-late(const Sndr& sndr, const Env& env) noexcept; * get_domain[link get_domain.md] * default_domain()[link default_domain.md] -- それ以外のとき、下記リストのうち最初に妥当となる式の型、かつ`void`ではない型とする。 +- それ以外のとき、下記リストのうち最初に適格となる式の型、かつ`void`ではない型とする。 - [`get_domain`](get_domain.md)`(`[`get_env`](get_env.md)`(sndr))` - [`completion-domain`](completion-domain.md)`(sndr)` - [`get_domain`](get_domain.md)`(env)` diff --git a/reference/execution/execution/into_variant.md b/reference/execution/execution/into_variant.md index c3fd2b6d2b..8202ec7ad8 100644 --- a/reference/execution/execution/into_variant.md +++ b/reference/execution/execution/into_variant.md @@ -85,7 +85,7 @@ namespace std::execution { ## カスタマイゼーションポイント -Senderアルゴリズム構築時に、入力[Sender](sender.md)`sndr`に[関連付けられた実行ドメイン](get-domain-early.md)に対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 +Senderアルゴリズム構築時および[Receiver](receiver.md)接続時に、関連付けられた実行ドメインに対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 [デフォルト実行ドメイン](../execution/default_domain.md)では無変換。 diff --git a/reference/execution/execution/let_value.md b/reference/execution/execution/let_value.md new file mode 100644 index 0000000000..e97f498814 --- /dev/null +++ b/reference/execution/execution/let_value.md @@ -0,0 +1,264 @@ +# let_value +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct let_value_t { unspecified }; + inline constexpr let_value_t let_value{}; +} +``` +* unspecified[italic] + +## 概要 +`let_value`は、新しいSenderを返す関数呼び出し可能なオブジェクトに引き渡すことで、入力[Sender](sender.md)の[値完了](set_value.md)結果から子入れ子の非同期操作へと変換するSenderアダプタである。 + +`let_value`はパイプライン記法をサポートする。 + + +## 効果 +説明用の式`sndr`と`f`に対して、`decltype((sndr))`が[`sender`](sender.md)を満たさない、もしくは[`movable-value`](../movable-value.md)を満たさないとき、呼び出し式`let_value(sndr, f)`は不適格となる。 + +そうでなければ、呼び出し式`let_value(sndr, f)`は`sndr`が1回だけ評価されることを除いて、下記と等価。 + +```cpp +transform_sender(get-domain-early(sndr), make-sender(let_value, f, sndr)) +``` +* transform_sender[link transform_sender.md] +* get-domain-early[link get-domain-early.md] +* make-sender[link make-sender.md] + + +### Senderアルゴリズムタグ `let_value` +Senderアルゴリズム動作説明用のクラステンプレート[`impls-for`](impls-for.md)に対して、下記の特殊化が定義される。 + +```cpp +namespace std::execution { + template<> + struct impls-for> : default-impls { + static constexpr auto get-state = see below; + static constexpr auto complete = see below; + }; +} +``` +* impls-for[link impls-for.md] +* default-impls[link impls-for.md] +* decayed-typeof[link decayed-typeof.md.nolink] +* see below[italic] + +`impls-for>::get-state`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 + +```cpp +[](Sndr&& sndr, Rcvr& rcvr) requires see below { + auto& [_, fn, child] = sndr; + using fn_t = decay_t; + using env_t = decltype(let-env(child)); + using args_variant_t = see below; + using ops2_variant_t = see below; + + struct state-type { + fn_t fn; // exposition only + env_t env; // exposition only + args_variant_t args; // exposition only + ops2_variant_t ops2; // exposition only + }; + return state-type{std::forward_like(fn), let-env(child), {}, {}}; +} +``` +* decay_t[link /reference/type_traits/decay.md] +* see below[italic] + +- 説明用のパック`Sigs`を[`completion_signatures_of_t`](completion_signatures_of_t.md)`<`[`child-type`](child-type.md)`,` [`env_of_t`](env_of_t.md)`>`による[`completion_signatures`](completion_signatures.md)特殊化のテンプレートパラメータとし、パック`LetSigs`を`Sigs`に含まれる型のうち戻り値型が`decayed-typeof<`[`set_value`](set_value.md)`>`に等しいものと定義する。説明用のエイリアステンプレート`as-tuple`を[`decayed-tuple`](decayed-tuple.md)``と定義する。型`args_variant_t`は下記定義において重複削除した型となる。 + + ```cpp + variant...> + ``` + * variant[link /reference/variant/variant.md] + * monostate[link /reference/variant/monostate.md] + +- 説明用の型`Tag`とパック`Args`に対して、説明用のエイリアステンプレート`as-sndr2`を`call-result-t&...>`と定義する。型`ops2_variant_t`は下記定義において重複削除した型となる。 + + ```cpp + variant, receiver2>...> + ``` + * variant[link /reference/variant/variant.md] + * monostate[link /reference/variant/monostate.md] + * connect_result_t[link connect_result_t.md] + +- 型`args_variant_t`および`ops2_variant_t`が適格なときに限って、上記ラムダ式のrequires節が満たされる。 + +`impls-for>::complete`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 + +```cpp +[] + (auto, auto& state, auto& rcvr, Tag, Args&&... args) noexcept -> void { + if constexpr (same_as>) { + TRY-EVAL(rcvr, let-bind(state, rcvr, std::forward(args)...)); + } else { + Tag()(std::move(rcvr), std::forward(args)...); + } + } +``` +* set_value[link set_value.md] +* decayed-typeof[link decayed-typeof.md.nolink] +* std::move[link /reference/utility/move.md] + +説明用の式`sndr`と`env`に対して、型`Sndr`を`decltype((sndr))`とする。[`sender-for`](sender-for.md)`> == false`のとき、式`let_value.transform_env(sndr, env)`は不適格となる。 + +そうでなければ、式`let_value.transform_env(sndr, env)`は[`JOIN-ENV`](JOIN-ENV.md.nolink)`(let-env(sndr),` [`FWD-ENV`](../forwarding_query.md)`(env))`と等価。 + + +## 説明専用エンティティ +説明用の式`sndr`を用いて、`let-env(sndr)`を下記リストのうち最初に適格となる式と定義する。 + +- [`SCHED-ENV`](SCHED-ENV.md.nolink)`(`[`get_completion_scheduler`](get_completion_scheduler.md)`>(`[`get_env`](get_env.md)`(sndr)))` +- [`MAKE-ENV`](MAKE-ENV.md.nolink)`(`[`get_domain`](get_domain.md)`,` [`get_domain`](get_domain.md)`(`[`get_env`](get_env.md)`(sndr)))` +- `(void(sndr),` [`env<>{}`](env.md)`)` + +```cpp +namespace std::execution { + template + void let-bind(State& state, Rcvr& rcvr, Args&&... args); // exposition only +} +``` + +説明専用の`let-bind`テンプレート関数の効果は下記と等価。 + +```cpp +using args_t = decayed-tuple; +auto mkop2 = [&] { + return connect( + apply(std::move(state.fn), + state.args.template emplace(std::forward(args)...)), + receiver2{rcvr, std::move(state.env)}); +}; +start(state.ops2.template emplace(emplace-from{mkop2})); +``` +* decayed-tuple[link decayed-tuple.md] +* connect[link connect.md] +* start[link start.md] +* emplace-from[link emplace-from.md] +* apply[link /reference/tuple/apply.md] +* template emplace[link /reference/variant/variant/emplace.md] +* std::move[link /reference/utility/move.md] + +説明専用のテンプレートクラス`receiver2`を下記の通り定義する。 + +```cpp +namespace std::execution { + template + struct receiver2 { + using receiver_concept = receiver_t; + + template + void set_value(Args&&... args) && noexcept { + execution::set_value(std::move(rcvr), std::forward(args)...); + } + + template + void set_error(Error&& err) && noexcept { + execution::set_error(std::move(rcvr), std::forward(err)); + } + + void set_stopped() && noexcept { + execution::set_stopped(std::move(rcvr)); + } + + decltype(auto) get_env() const noexcept { + return see below; + } + + Rcvr& rcvr; // exposition only + Env env; // exposition only + }; +} +``` +* receiver_t[link receiver.md] +* execution::set_value[link set_value.md] +* execution::set_error[link set_error.md] +* execution::set_stopped[link set_stopped.md] +* std::move[link /reference/utility/move.md] +* see below[italic] + +メンバ関数`receiver2::get_env`の呼び出しは、下記を満たすオブジェクト`e`を返す。 + +- 型`decltype(e)`が[`queryable`](../queryable.md)のモデルであり、かつ +- 与えられた[クエリオブジェクト](../queryable.md)`q`に対して、式`e.query(q)`は式`env.query(q)`が有効ならばその式と等価。そうでなければ、式`e.query(q)`は[`get_env`](get_env.md)`(rcvr).query(q)`と等価。 + + +## カスタマイゼーションポイント +Senderアルゴリズム構築時および[Receiver](receiver.md)接続時に、関連付けられた実行ドメインに対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 +[デフォルト実行ドメイン](../execution/default_domain.md)では無変換。 + + +説明用の式`out_sndr`を`let_value(sndr, f)`の戻り値[Sender](sender.md)とし、式`rcvr`を式[`connect`](connect.md)`(out_sndr, rcvr)`が適格となる[Receiver](receiver.md)とする。式[`connect`](connect.md)`(out_sndr, rcvr)`は[開始(start)](start.md)時に下記を満たす非同期操作を生成しない場合、動作は未定義となる。 + +- 入力[Sender](sender.md)`sndr`の完了結果で[`set_value`](set_value.md)が呼ばれるとき、`f`を呼び出すこと。 +- 非同期操作の完了は、`f`が返すSenderの完了に依存すること。 +- `sndr`により送信された他完了操作を伝搬すること。 + + +## 例 +```cpp example +#include +#include +namespace ex = std::execution; + +int main() +{ + { // 関数呼び出し + ex::sender snd0 = ex::just(21); + ex::sender snd1 = ex::let_value( + snd0, + [](int n) -> ex::sender auto { + return ex::just(n * 2); + }); + auto [val] = std::this_thread::sync_wait(snd1).value(); + std::println("{}", val); + } + + { // パイプライン記法 + ex::sender sndr = ex::just(21) + | ex::let_value( + [](int n) -> ex::sender auto { + return ex::just(n * 2); + }); + auto [val] = std::this_thread::sync_wait(sndr).value(); + std::println("{}", val); + } +} +``` +* ex::let_value[color ff0000] +* ex::sender[link sender.md] +* ex::just[link just.md] +* std::this_thread::sync_wait[link ../this_thread/sync_wait.md] +* value()[link /reference/optional/optional/value.md] + +### 出力 +``` +42 +42 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::let_error`](let_error.md.nolink) +- [`execution::let_stopped`](let_stopped.md.nolink) + + +## 参照 +- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/read_env.md b/reference/execution/execution/read_env.md index 616da64979..ca8e9dfbe6 100644 --- a/reference/execution/execution/read_env.md +++ b/reference/execution/execution/read_env.md @@ -15,7 +15,7 @@ namespace std::execution { `read_env`は、非同期動作の[開始(start)](start.md)時に接続先[Receiver](receiver.md)の[環境](../queryable.md)に対して[クエリオブジェクト](../queryable.md)で問い合わせ、読み取った値を[値完了関数](set_value.md)で送信するSenderファクトリである。 クエリオブジェクトによるReceiver環境への問い合わせは`read_env`[Sender](sender.md)の構築時ではなく、Receiverと接続されたのち非同期動作が開始されるタイミングまで遅延される。 -[`let_value`](let_value.md.nolink)Senderアダプタと組み合わせたり、[Sender Awaitableなコルーチン](with_awaitable_senders.md.nolink)での`co_await`式によって、[Scheduler](get_scheduler.md)や[停止トークン](../get_stop_token.md)を読み取ることができる。 +[`let_value`](let_value.md)Senderアダプタと組み合わせたり、[Sender Awaitableなコルーチン](with_awaitable_senders.md.nolink)での`co_await`式によって、[Scheduler](get_scheduler.md)や[停止トークン](../get_stop_token.md)を読み取ることができる。 ## 効果 diff --git a/reference/execution/execution/starts_on.md b/reference/execution/execution/starts_on.md index 2fedaa2a17..ae91c19018 100644 --- a/reference/execution/execution/starts_on.md +++ b/reference/execution/execution/starts_on.md @@ -59,7 +59,7 @@ transform_sender( return std::move(sndr); }); ``` - * let_value[link let_value.md.nolink] + * let_value[link let_value.md] * schedule[link schedule.md] * is_nothrow_move_constructible_v[link /reference/type_traits/is_nothrow_move_constructible.md] * decay_t[link /reference/type_traits/decay.md] diff --git a/reference/execution/execution/then.md b/reference/execution/execution/then.md index 54dcb1fdff..997e4288f1 100644 --- a/reference/execution/execution/then.md +++ b/reference/execution/execution/then.md @@ -60,7 +60,7 @@ namespace std::execution { ## カスタマイゼーションポイント -Senderアルゴリズム構築時に、入力[Sender](sender.md)`sndr`に[関連付けられた実行ドメイン](get-domain-early.md)に対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 +Senderアルゴリズム構築時および[Receiver](receiver.md)接続時に、関連付けられた実行ドメインに対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 [デフォルト実行ドメイン](../execution/default_domain.md)では無変換。 戻り値の[Sender](sender.md)`out_sndr`が下記を満たさない場合、呼び出し式`then(sndr, f)`の動作は未定義となる。 From 034b8e63d0696ca7bd1632a97fcc4b0baeadfe41 Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 12 May 2025 13:30:35 +0900 Subject: [PATCH 1676/3948] =?UTF-8?q?execution:=20=E4=BE=8B=E7=A4=BA?= =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E3=82=92=E6=94=B9=E5=96=84=20(#1384?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - let_value: 複数の値完了シグネチャ例を追加 - into_variant: パイプライン記法を追記 - 他微調整 --- .../execution/completion_signatures.md | 8 +- reference/execution/execution/into_variant.md | 31 +++-- reference/execution/execution/let_value.md | 116 +++++++++++++++++- reference/execution/execution/receiver_of.md | 8 +- reference/execution/execution/run_loop.md | 1 + .../execution/run_loop/get_scheduler.md | 1 + 6 files changed, 146 insertions(+), 19 deletions(-) diff --git a/reference/execution/execution/completion_signatures.md b/reference/execution/execution/completion_signatures.md index 26bb518789..19ac97f5c2 100644 --- a/reference/execution/execution/completion_signatures.md +++ b/reference/execution/execution/completion_signatures.md @@ -47,10 +47,10 @@ namespace ex = std::execution; int main() { - // 下記の完了操作をサポートする - // 値完了 ex::set_value(int), ex::set_value(int, int) - // エラー完了 ex::set_error(std::exception_ptr) - // 停止完了 ex::set_stopped() + // 下記の完了操作をサポートする完了シグニチャ集合型 + // 値完了 set_value(int), set_value(int, int) + // エラー完了 set_error(std::exception_ptr) + // 停止完了 set_stopped() using Sigs = ex::completion_signatures< ex::set_value_t(int), ex::set_value_t(int, int), diff --git a/reference/execution/execution/into_variant.md b/reference/execution/execution/into_variant.md index 8202ec7ad8..85d5ffb370 100644 --- a/reference/execution/execution/into_variant.md +++ b/reference/execution/execution/into_variant.md @@ -49,7 +49,7 @@ namespace std::execution { `impls-for::get-state`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 -- 子[Sender](sender.md)の[値完了シグニチャを集約](value_types_of_t.md)した[`variant`](/reference/variant/variant.md)`<`[`tuple`](/reference/variant/variant.md)`<...>, ...>`型を[`type_identity`](/reference/type_traits/type_identity.md)クラステンプレートのパラメータに格納して返す。 +- 子[Sender](sender.md)の[値完了シグネチャを集約](value_types_of_t.md)した[`variant`](/reference/variant/variant.md)`<`[`tuple`](/reference/variant/variant.md)`<...>, ...>`型を[`type_identity`](/reference/type_traits/type_identity.md)クラステンプレートのパラメータに格納して返す。 ```cpp [](Sndr&& sndr, Rcvr& rcvr) noexcept @@ -100,25 +100,29 @@ namespace ex = std::execution; struct FizzBuzzSender { using sender_concept = ex::sender_t; + + // FizzBuzzSenderは2種類の値完了シグネチャを持つ using completion_signatures = ex::completion_signatures< ex::set_value_t(int), ex::set_value_t(std::string) >; + // Operation State型 template - struct state { + struct State { using operation_state_concept = ex::operation_state_t; - state(Rcvr rcvr, int val) + State(Rcvr rcvr, int val) : rcvr_{std::move(rcvr)}, val_{val} {} void start() noexcept { + using namespace std::string_literals; if (val_ % 15 == 0) { - ex::set_value(std::move(rcvr_), "FizzBuzz"); + ex::set_value(std::move(rcvr_), "FizzBuzz"s); } else if (val_ % 3 == 0) { - ex::set_value(std::move(rcvr_), "Fizz"); + ex::set_value(std::move(rcvr_), "Fizz"s); } else if (val_ % 5 == 0) { - ex::set_value(std::move(rcvr_), "Buzz"); + ex::set_value(std::move(rcvr_), "Buzz"s); } else { ex::set_value(std::move(rcvr_), val_); } @@ -130,7 +134,7 @@ struct FizzBuzzSender { template auto connect(Rcvr rcvr) noexcept { - return state{std::move(rcvr), val_}; + return State{std::move(rcvr), val_}; } int val_; @@ -142,9 +146,17 @@ struct overload : Ts... { using Ts::operator()...; }; int main() { int val = 15; - ex::sender auto sndr = ex::into_variant(FizzBuzzSender{val}); +#if 0 + // 関数呼び出し + ex::sender auto snd0 = FizzBuzzSender{val}; + ex::sender auto sndr = ex::into_variant(snd0); +#else + // パイプライン記法 + ex::sender auto sndr = FizzBuzzSender{val} | ex::into_variant(); +#endif auto [result] = std::this_thread::sync_wait(sndr).value(); + // result := variant, tuple>型 std::visit(overload{ [](std::tuple n) { std::println("(int) {}", get<0>(n)); @@ -159,10 +171,9 @@ int main() * ex::sender_t[link sender.md] * ex::sender[link sender.md] * ex::completion_signatures[link completion_signatures.md] -* ex::operation_state[link operation_state.md] * ex::set_value_t[link set_value.md] * ex::set_value[link set_value.md] -* ex::operation_state[link operation_state.md] +* ex::operation_state_t[link operation_state.md] * std::this_thread::sync_wait[link ../this_thread/sync_wait.md] * value()[link /reference/optional/optional/value.md] * std::move[link /reference/utility/move.md] diff --git a/reference/execution/execution/let_value.md b/reference/execution/execution/let_value.md index e97f498814..ff626bdbfb 100644 --- a/reference/execution/execution/let_value.md +++ b/reference/execution/execution/let_value.md @@ -201,6 +201,7 @@ Senderアルゴリズム構築時および[Receiver](receiver.md)接続時に、 ## 例 +### 例1: 基本の使い方 ```cpp example #include #include @@ -236,12 +237,125 @@ int main() * std::this_thread::sync_wait[link ../this_thread/sync_wait.md] * value()[link /reference/optional/optional/value.md] -### 出力 +#### 出力 ``` 42 42 ``` +### 例2: 複数の値完了シグネチャ +```cpp +#include +#include +#include +namespace ex = std::execution; + + +// MySenderは下記いずれかの完了操作を行う +// 値完了 set_value(int), set_value(string) +// エラー完了 set_error(int) +struct MySender { + using sender_concept = ex::sender_t; + using completion_signatures = ex::completion_signatures< + ex::set_value_t(int), + ex::set_value_t(std::string), + ex::set_error_t(int) + >; + + template + struct state { + using operation_state_concept = ex::operation_state_t; + + state(Rcvr rcvr, int val) + : rcvr_{std::move(rcvr)}, val_{val} {} + + void start() noexcept { + using namespace std::string_literals; + switch (val_) { + case 1: + ex::set_value(std::move(rcvr_), 100); + break; + case 2: + ex::set_value(std::move(rcvr_), "C++"s); + break; + default: + ex::set_error(std::move(rcvr_), val_); + break; + } + } + + Rcvr rcvr_; + int val_; + }; + + template + auto connect(Rcvr rcvr) noexcept { + return state{std::move(rcvr), val_}; + } + + int val_; +}; + +template +struct overload : Ts... { using Ts::operator()...; }; + +int main() +{ + for (int val = 0; ; val++) { + ex::sender auto snd0 = MySender{val}; + ex::sender auto sndr = ex::let_value(snd0, + overload { + [](int n) { + std::println("(int) {}", n); + // intを受信 -> 空値を送信 + return ex::just(); + }, + [](std::string s) { + std::println("(str) {}", s); + // stringを受信 -> 停止完了(キャンセル)送信 + return ex::just_stopped(); + } + }); + // Senderチェインsndrは下記いずれかの完了操作を行う + // 値完了 set_value() + // エラー完了 set_error(int) + // 停止完了 set_stopped() + + try { + auto result = std::this_thread::sync_wait_with_variant(sndr); + // result := optional>>型 + // エラー完了時は受信int値が例外として送出される + if (!result) { + // 停止完了時はstd::nulloptが返却される + break; + } + // 値完了==空値のためアクセスすべきデータ無し + } catch (int n) { + std::println("catch {}", n); + } + } +} +``` +* ex::let_value[color ff0000] +* ex::sender_t[link sender.md] +* ex::sender[link sender.md] +* ex::completion_signatures[link completion_signatures.md] +* ex::set_value_t[link set_value.md] +* ex::set_value[link set_value.md] +* ex::set_error_t[link set_error.md] +* ex::set_error[link set_error.md] +* ex::just_stopped[link just_stopped.md.nolink] +* ex::operation_state_t[link operation_state.md] +* std::this_thread::sync_wait_with_variant[link ../this_thread/sync_wait_with_variant.md] +* std::move[link /reference/utility/move.md] + +#### 出力 +``` +catch 0 +(int) 100 +(str) C++ +``` + ## バージョン ### 言語 diff --git a/reference/execution/execution/receiver_of.md b/reference/execution/execution/receiver_of.md index 5c16cab79c..cc75feef00 100644 --- a/reference/execution/execution/receiver_of.md +++ b/reference/execution/execution/receiver_of.md @@ -61,19 +61,19 @@ struct MyReceiver { int main() { - // 完了操作ex::set_value(int, int)に対応 + // 値完了操作set_value(int, int)に対応 static_assert(ex::receiver_of>); - // 完了操作ex::set_value(int)には非対応 + // 値完了操作set_value(int)には非対応 static_assert(not ex::receiver_of>); - // 完了操作ex::set_error(int)に対応 + // エラー完了操作set_error(int)に対応 static_assert(ex::receiver_of>); - // 完了操作ex::set_stopped()には非対応 + // 停止完了操作set_stopped()には非対応 static_assert(not ex::receiver_of>); } diff --git a/reference/execution/execution/run_loop.md b/reference/execution/execution/run_loop.md index 8a4c149f25..df41151293 100644 --- a/reference/execution/execution/run_loop.md +++ b/reference/execution/execution/run_loop.md @@ -95,6 +95,7 @@ int main() * get_scheduler()[link run_loop/get_scheduler.md] * finish()[link run_loop/finish.md] * run()[link run_loop/run.md] +* std::exception_ptr[link /reference/exception/exception_ptr.md] ### 出力 ``` diff --git a/reference/execution/execution/run_loop/get_scheduler.md b/reference/execution/execution/run_loop/get_scheduler.md index ba9707d1f4..17a4ca094f 100644 --- a/reference/execution/execution/run_loop/get_scheduler.md +++ b/reference/execution/execution/run_loop/get_scheduler.md @@ -57,6 +57,7 @@ int main() * ex::set_stopped_t[link ../set_stopped.md] * ex::get_completion_scheduler[link ../get_completion_scheduler.md] * ex::get_env[link ../get_env.md] +* std::exception_ptr[link /reference/exception/exception_ptr.md] ### 出力 ``` From 8e8fa9863a49038143cad6f457e07965cab47ec1 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 12 May 2025 14:44:06 +0900 Subject: [PATCH 1677/3948] =?UTF-8?q?C++26=20:=20=E3=80=8C=E3=83=91?= =?UTF-8?q?=E3=83=A9=E3=83=A1=E3=83=BC=E3=82=BF=E3=83=91=E3=83=83=E3=82=AF?= =?UTF-8?q?=E3=81=B8=E3=81=AE=E3=82=A4=E3=83=B3=E3=83=87=E3=83=83=E3=82=AF?= =?UTF-8?q?=E3=82=B9=E3=82=A2=E3=82=AF=E3=82=BB=E3=82=B9=E3=82=92=E8=A8=B1?= =?UTF-8?q?=E5=8F=AF=E3=80=8D=E3=82=92=E8=BF=BD=E5=8A=A0=20(close=20#1230)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp11/variadic_templates.md | 2 +- lang/cpp26.md | 2 +- lang/cpp26/pack_indexing.md | 67 ++++++++++++++++++++++++++++++++ 4 files changed, 70 insertions(+), 3 deletions(-) create mode 100644 lang/cpp26/pack_indexing.md diff --git a/implementation-status.md b/implementation-status.md index 457c87d27f..c91229da48 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -299,7 +299,7 @@ | P2738R1: [定数式での`void*`からポインタ型へのキャストを許可](/lang/cpp26/constexpr_cast_from_voidptr.md) | 型消去のために`void*`からポインタ型へのキャストを許可する | 14 | 17 | | | | P2741R3: [`static_assert`の診断メッセージにユーザーが生成した文字列の指定を許可](/lang/cpp26/user-generated_static_assert_messages.md) | `constexpr`な`S.size()`と`S.data()`メンバ関数をもつオブジェクトをコンパイル時文字列として指定できるようにする | 14 | 17 | | | | P2558R2: [基本文字集合に@、$、\`を追加](/lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md) | C言語との互換性のためにこれらの文字を基本文字集合に追加 | | Yes | | | -| P2662R3: [パラメータパックへのインデックスアクセスを許可](/lang/cpp26/pack_indexing.md.nolink) | 可変引数テンプレートのパラメータパックに添字アクセスできるようにする | 15 | | | | +| P2662R3: [パラメータパックへのインデックスアクセスを許可](/lang/cpp26/pack_indexing.md) | 可変引数テンプレートのパラメータパックに添字アクセスできるようにする | 15 | | | | | P2864R2: [非推奨となっていた列挙値から算術型への暗黙変換を削除](/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md) | C++20から非推奨となっていた列挙値への算術演算で算術型に暗黙変換される仕様を削除 | 14 | 18 | | | | P2748R5: [返却された左辺値から暗黙変換された一時オブジェクトが参照に束縛されることを禁止する](/lang/cpp26/disallow_binding_a_returned_glvalue_to_a_temporary.md) | 寿命切れの変数によって引き起こされるバグを防止する | 14 | 19 | | | | P3106R1: [要素数不明の配列を集成体初期化する規則を明確化](/lang/cpp26/clarifying_rules_for_brace_elision_in_aggregate_initialization.md.nolink) | 配列要素の集成体初期化で`{}`が省略された場合の矛盾していた規定を修正 | yes | 17 | | | diff --git a/lang/cpp11/variadic_templates.md b/lang/cpp11/variadic_templates.md index fc9e460dde..977a28d2bb 100644 --- a/lang/cpp11/variadic_templates.md +++ b/lang/cpp11/variadic_templates.md @@ -389,7 +389,7 @@ void f(const T1& t1, const T2& t2, const T3& t3); ## 関連項目 - [C++11 可変引数マクロ](variadic_macros.md) - [C++17 畳み込み式](/lang/cpp17/folding_expressions.md) -- [C++26 パラメータパックへのインデックスアクセスを許可](/lang/cpp26/pack_indexing.md.nolink) +- [C++26 パラメータパックへのインデックスアクセスを許可](/lang/cpp26/pack_indexing.md) - [C++26 可変引数テンプレートで`friend`宣言をできるようにする](/lang/cpp26/variadic_friends.md) diff --git a/lang/cpp26.md b/lang/cpp26.md index ef6c5e72da..ef6ffcd76a 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -65,7 +65,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| -| [パラメータパックへのインデックスアクセスを許可](/lang/cpp26/pack_indexing.md.nolink) | 可変引数テンプレートのパラメータパックに添字アクセスできるようにする | +| [パラメータパックへのインデックスアクセスを許可](/lang/cpp26/pack_indexing.md) | 可変引数テンプレートのパラメータパックに添字アクセスできるようにする | | [制約式内での畳み込み式の順序付け](/lang/cpp26/ordering_of_constraints_involving_fold_expressions.md.nolink) | 畳み込み式では全体ではなく個別の制約を原子制約式として扱う | | [可変引数テンプレートで`friend`宣言をできるようにする](/lang/cpp26/variadic_friends.md) | クラステンプレートの可変引数テンプレートでまとめて`friend`宣言できるようにする | | [コンセプトと変数テンプレートにテンプレートテンプレートパラメータのサポートを追加](/lang/cpp26/concept_and_variable-template_template-parameters.md.nolink) | テンプレート引数をあとで指定するテンプレートテンプレートパラメータを、コンセプトと変数テンプレートでも使用できるようにする | diff --git a/lang/cpp26/pack_indexing.md b/lang/cpp26/pack_indexing.md new file mode 100644 index 0000000000..c268f53fb8 --- /dev/null +++ b/lang/cpp26/pack_indexing.md @@ -0,0 +1,67 @@ +# パラメータパックへのインデックスアクセスを許可 [P2662R3] +* cpp26[meta cpp] + + + +このページはC++26に採用される見込みの言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 + + + +## 概要 +C++26では、可変引数テンプレートのパラメータパックに対してインデックスアクセスを行う添字構文が導入される。この機能により、パラメータパックの特定の要素に直接アクセスできるようになる。 + +これにより、従来の再帰的テンプレートメタプログラミングやタプルの[`std::get()`](/reference/tuple/tuple/get.md)などを使用する必要がなくなり、コードの簡潔さと可読性が向上する。 + +```cpp +template +constexpr auto first_plus_last(T... values) -> T...[0] { + return T...[0](values...[0] + values...[sizeof...(values)-1]); +} + +int main() { + //first_plus_last(); // コンパイルエラー! + static_assert(first_plus_last(1, 2, 10) == 11); +} +``` + +パラメータパックへのインデックスアクセスは、値のパラメータパック、および型のパラメータパックどちらに対しても使用できる。 + +インデックスが範囲外の場合、コンパイルエラーとなる。 + + +## 例 +### N番目の要素を取得する +```cpp example +#include +#include +#include + +template +void print_nth(Args&&... args) { + // C++23実装 : タプルに変換してからI番目の要素を参照する + // auto value = std::get(std::forward_as_tuple(std::forward(args)...)); + + // C++26実装 : 添字構文でI番目の要素を参照する + auto value = args...[I]; + + std::cout << value << std::endl; +} + +int main() { + print_nth<2>("A", "B", "C", "D"); // 出力: C +} +``` + +#### 出力 +``` +C +``` + +## 関連項目 +- [C++11 可変引数テンプレート](/lang/cpp11/variadic_templates.md) + + +## 参照 +- [P2662R3 Pack Indexing](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2662r3.pdf) From 40c3748b3485219fa634ac3cb8f69c0233af6d49 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 12 May 2025 14:52:31 +0900 Subject: [PATCH 1678/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE?= =?UTF-8?q?=E9=A3=BE=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 1 + lang/cpp26/pack_indexing.md | 1 + 2 files changed, 2 insertions(+) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 9f4ed61d59..1ad95101e9 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -279,6 +279,7 @@ * t3.join()[link /reference/thread/thread/join.md] * std::this_thread::sleep_for[link /reference/thread/this_thread/sleep_for.md] * [link /reference/tuple.md] + * std::forward_as_tuple[link /reference/tuple/forward_as_tuple.md] * std::tuple[link /reference/tuple/tuple.md] * std::tie[link /reference/tuple/tie.md] * [link /reference/type_traits.md] diff --git a/lang/cpp26/pack_indexing.md b/lang/cpp26/pack_indexing.md index c268f53fb8..e02a944e9f 100644 --- a/lang/cpp26/pack_indexing.md +++ b/lang/cpp26/pack_indexing.md @@ -53,6 +53,7 @@ int main() { print_nth<2>("A", "B", "C", "D"); // 出力: C } ``` +* std::get[link /reference/tuple/tuple/get.md] #### 出力 ``` From fd7bea75b94805ca1601c776023f1220674859f5 Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 12 May 2025 18:19:39 +0900 Subject: [PATCH 1679/3948] =?UTF-8?q?execution/let=5Fvalue:=20=E5=8A=B9?= =?UTF-8?q?=E6=9E=9C=E3=81=AB=E8=A3=9C=E8=B6=B3=E8=AA=AC=E6=98=8E=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E8=A8=98=20(#1384)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../execution/completion_signatures.md | 2 +- reference/execution/execution/let_value.md | 28 +++++++++++++++---- .../this_thread/sync_wait_with_variant.md | 1 + 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/reference/execution/execution/completion_signatures.md b/reference/execution/execution/completion_signatures.md index 19ac97f5c2..ac941e36cd 100644 --- a/reference/execution/execution/completion_signatures.md +++ b/reference/execution/execution/completion_signatures.md @@ -47,7 +47,7 @@ namespace ex = std::execution; int main() { - // 下記の完了操作をサポートする完了シグニチャ集合型 + // 下記の完了操作をサポートする完了シグネチャ集合型 // 値完了 set_value(int), set_value(int, int) // エラー完了 set_error(std::exception_ptr) // 停止完了 set_stopped() diff --git a/reference/execution/execution/let_value.md b/reference/execution/execution/let_value.md index ff626bdbfb..6bb79a7a58 100644 --- a/reference/execution/execution/let_value.md +++ b/reference/execution/execution/let_value.md @@ -13,13 +13,13 @@ namespace std::execution { * unspecified[italic] ## 概要 -`let_value`は、新しいSenderを返す関数呼び出し可能なオブジェクトに引き渡すことで、入力[Sender](sender.md)の[値完了](set_value.md)結果から子入れ子の非同期操作へと変換するSenderアダプタである。 +`let_value`は、新しいSenderを返す関数呼び出し可能なオブジェクトに引き渡すことで、入力[Sender](sender.md)の[値完了](set_value.md)結果から入れ子の非同期操作へと変換するSenderアダプタである。 `let_value`はパイプライン記法をサポートする。 ## 効果 -説明用の式`sndr`と`f`に対して、`decltype((sndr))`が[`sender`](sender.md)を満たさない、もしくは[`movable-value`](../movable-value.md)を満たさないとき、呼び出し式`let_value(sndr, f)`は不適格となる。 +説明用の式`sndr`と`f`に対して、`decltype((sndr))`が[`sender`](sender.md)を満たさない、もしくは`decltype((f))`が[`movable-value`](../movable-value.md)を満たさないとき、呼び出し式`let_value(sndr, f)`は不適格となる。 そうでなければ、呼び出し式`let_value(sndr, f)`は`sndr`が1回だけ評価されることを除いて、下記と等価。 @@ -50,6 +50,14 @@ namespace std::execution { `impls-for>::get-state`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 +- `args_variant_t` : 入力Sender`sndr`の完了シグネチャ集合から求まる送信値リスト型情報(`variant, ...>`) +- `ops2_variant_t` : `f`が返すSenderに対応する非同期操作型情報(`variant`) +- 戻り値`state-type`型オブジェクトを下記の通り初期化する。同オブジェクトは`complete`メンバから呼ばれる`let-bind`で利用される。 + - `fn` : Senderアルゴリズム構築時に指定した関数呼び出し可能オブジェクト`f` + - `env` : 入力Sender`sndr`に関連付けられた[属性](../queryable.md) + - `args` : `f`呼び出し時の引数リスト格納用変数(空値`monostate`で初期化) + - `ops` : `f`が返すSenderに対応する非同期操作の格納用変数(空値`monostate`で初期化) + ```cpp [](Sndr&& sndr, Rcvr& rcvr) requires see below { auto& [_, fn, child] = sndr; @@ -78,7 +86,7 @@ namespace std::execution { * variant[link /reference/variant/variant.md] * monostate[link /reference/variant/monostate.md] -- 説明用の型`Tag`とパック`Args`に対して、説明用のエイリアステンプレート`as-sndr2`を`call-result-t&...>`と定義する。型`ops2_variant_t`は下記定義において重複削除した型となる。 +- 説明用の型`Tag`とパック`Args`に対して、説明用のエイリアステンプレート`as-sndr2`を`call-result-t&...>`と定義する。型`ops2_variant_t`は下記定義において重複削除した型となる。 ```cpp variant, receiver2>...> @@ -91,6 +99,9 @@ namespace std::execution { `impls-for>::complete`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 +- [値完了](set_value.md)の場合、`let_value`Sender構築時の引数`f`に対して`f(args...)`を呼び出し、戻り値[Sender](sender.md)から入れ子非同期操作を開始する。同Senderの完了結果を接続先[Receiver](receiver.md)へ転送する。 +- それ以外の完了操作の場合、接続先[Receiver](receiver.md)の同種完了関数へ転送する。 + ```cpp [] (auto, auto& state, auto& rcvr, Tag, Args&&... args) noexcept -> void { @@ -117,6 +128,12 @@ namespace std::execution { - [`MAKE-ENV`](MAKE-ENV.md.nolink)`(`[`get_domain`](get_domain.md)`,` [`get_domain`](get_domain.md)`(`[`get_env`](get_env.md)`(sndr)))` - `(void(sndr),` [`env<>{}`](env.md)`)` +説明専用の`let-bind`テンプレート関数を下記の通り定義する。 + +- 入力Senderの完了結果から引数リスト`state.args`を構築し、Senderアルゴリズム構築時に指定した関数呼び出し可能オブジェクト`state.fn`を呼び出す。 +- 上記呼び出しで`state.fn`から返された[Sender](sender.md)と、完了結果をSenderアルゴリズムの接続先[Receiver](receiver.md)`Rcvr`へ転送するヘルパ`receiver2`を[接続(connect)](connect.md)する。 +- 接続結果[Operation State](operation_state.md)を`state.op2`上に構築し、入れ子の非同期操作を[開始(start)](start.md)する。 + ```cpp namespace std::execution { template @@ -124,7 +141,7 @@ namespace std::execution { } ``` -説明専用の`let-bind`テンプレート関数の効果は下記と等価。 +`let-bind`テンプレート関数の効果は下記と等価。 ```cpp using args_t = decayed-tuple; @@ -192,7 +209,6 @@ namespace std::execution { Senderアルゴリズム構築時および[Receiver](receiver.md)接続時に、関連付けられた実行ドメインに対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 [デフォルト実行ドメイン](../execution/default_domain.md)では無変換。 - 説明用の式`out_sndr`を`let_value(sndr, f)`の戻り値[Sender](sender.md)とし、式`rcvr`を式[`connect`](connect.md)`(out_sndr, rcvr)`が適格となる[Receiver](receiver.md)とする。式[`connect`](connect.md)`(out_sndr, rcvr)`は[開始(start)](start.md)時に下記を満たす非同期操作を生成しない場合、動作は未定義となる。 - 入力[Sender](sender.md)`sndr`の完了結果で[`set_value`](set_value.md)が呼ばれるとき、`f`を呼び出すこと。 @@ -324,13 +340,13 @@ int main() try { auto result = std::this_thread::sync_wait_with_variant(sndr); // result := optional>>型 - // エラー完了時は受信int値が例外として送出される if (!result) { // 停止完了時はstd::nulloptが返却される break; } // 値完了==空値のためアクセスすべきデータ無し } catch (int n) { + // エラー完了時は受信int値が例外として送出される std::println("catch {}", n); } } diff --git a/reference/execution/this_thread/sync_wait_with_variant.md b/reference/execution/this_thread/sync_wait_with_variant.md index 7e49007118..39b48b05cc 100644 --- a/reference/execution/this_thread/sync_wait_with_variant.md +++ b/reference/execution/this_thread/sync_wait_with_variant.md @@ -47,6 +47,7 @@ namespace std::this_thread { template Sndr> using sync-wait-with-variant-result-type = optional>; +} ``` * execution::sender_in[link ../execution/sender_in.md] * sync-wait-env[link sync-wait-env.md] From 93e79efed0570ab2b27b5dd8402c0f547d152b31 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 12 May 2025 18:25:27 +0900 Subject: [PATCH 1680/3948] =?UTF-8?q?C++26=20:=20=E3=80=8C=E8=A6=81?= =?UTF-8?q?=E7=B4=A0=E6=95=B0=E4=B8=8D=E6=98=8E=E3=81=AE=E9=85=8D=E5=88=97?= =?UTF-8?q?=E3=82=92=E9=9B=86=E6=88=90=E4=BD=93=E5=88=9D=E6=9C=9F=E5=8C=96?= =?UTF-8?q?=E3=81=99=E3=82=8B=E8=A6=8F=E5=89=87=E3=82=92=E6=98=8E=E7=A2=BA?= =?UTF-8?q?=E5=8C=96=E3=80=8D=E3=82=92=E8=BF=BD=E5=8A=A0=20(close=20#1323)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp26.md | 2 +- ...ace_elision_in_aggregate_initialization.md | 98 +++++++++++++++++++ 3 files changed, 100 insertions(+), 2 deletions(-) create mode 100644 lang/cpp26/clarifying_rules_for_brace_elision_in_aggregate_initialization.md diff --git a/implementation-status.md b/implementation-status.md index c91229da48..f4cb17fea5 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -302,7 +302,7 @@ | P2662R3: [パラメータパックへのインデックスアクセスを許可](/lang/cpp26/pack_indexing.md) | 可変引数テンプレートのパラメータパックに添字アクセスできるようにする | 15 | | | | | P2864R2: [非推奨となっていた列挙値から算術型への暗黙変換を削除](/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md) | C++20から非推奨となっていた列挙値への算術演算で算術型に暗黙変換される仕様を削除 | 14 | 18 | | | | P2748R5: [返却された左辺値から暗黙変換された一時オブジェクトが参照に束縛されることを禁止する](/lang/cpp26/disallow_binding_a_returned_glvalue_to_a_temporary.md) | 寿命切れの変数によって引き起こされるバグを防止する | 14 | 19 | | | -| P3106R1: [要素数不明の配列を集成体初期化する規則を明確化](/lang/cpp26/clarifying_rules_for_brace_elision_in_aggregate_initialization.md.nolink) | 配列要素の集成体初期化で`{}`が省略された場合の矛盾していた規定を修正 | yes | 17 | | | +| P3106R1: [要素数不明の配列を集成体初期化する規則を明確化](/lang/cpp26/clarifying_rules_for_brace_elision_in_aggregate_initialization.md) | 配列要素の集成体初期化で`{}`が省略された場合の矛盾していた規定を修正 | yes | 17 | | | | P0609R3: [構造化束縛への属性を許可](/lang/cpp26/attributes_for_structured_bindings.md) | `auto [a, b [[maybe_unused]], c] = f();`のように構造化束縛の要素に対して属性を付加できるようにする | 15 | 19 | | | | P3034R1: [モジュール宣言でのモジュール名のマクロ展開を禁止する](/lang/cpp26/module_declarations_shouldnt_be_macros.md) | `export module MACRO_NAME;`を禁止 | 15 | | | | | P2809R3: [空の無限ループは未定義動作ではないと規定](/lang/cpp26/trivial_infinite_loops_are_not_undefined_behavior.md) | 並行プログラムの進行保証などを考慮して空の無限ループを未定義動作ではないものとする | 14 | 19 | | | diff --git a/lang/cpp26.md b/lang/cpp26.md index ef6ffcd76a..f6f42363c2 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -15,7 +15,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | [宣言のみで使用しない変数の名前として`_`をサポート](/lang/cpp26/nice_placeholder_with_no_name.md) | 変数名`_`は暗黙で`[[maybe_unused]]`が指定される | | [不完全型へのポインタに対する`delete`を不適格とする](/lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md) | 未定義動作を引き起こす操作をコンパイルエラーとする | | [返却された左辺値から暗黙変換された一時オブジェクトが参照に束縛されることを禁止する](/lang/cpp26/disallow_binding_a_returned_glvalue_to_a_temporary.md) | 寿命切れの変数によって引き起こされるバグを防止する | -| [要素数不明の配列を集成体初期化する規則を明確化](/lang/cpp26/clarifying_rules_for_brace_elision_in_aggregate_initialization.md.nolink) | 配列要素の集成体初期化で`{}`が省略された場合の矛盾していた規定を修正 | +| [要素数不明の配列を集成体初期化する規則を明確化](/lang/cpp26/clarifying_rules_for_brace_elision_in_aggregate_initialization.md) | 配列要素の集成体初期化で`{}`が省略された場合の矛盾していた規定を修正 | | [未初期化変数の読み取りをエラー性動作とする](/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md) | 初期化されていない自動変数の読み取りの安全性を規定する | | [構造化束縛でパックを導入できるようにする](/lang/cpp26/structured_bindings_can_introduce_a_pack.md) | タプルを分解する際に複数の変数をパックとして宣言できるようにする。`auto [a, ...xs] = f();` | diff --git a/lang/cpp26/clarifying_rules_for_brace_elision_in_aggregate_initialization.md b/lang/cpp26/clarifying_rules_for_brace_elision_in_aggregate_initialization.md new file mode 100644 index 0000000000..257cb22d7f --- /dev/null +++ b/lang/cpp26/clarifying_rules_for_brace_elision_in_aggregate_initialization.md @@ -0,0 +1,98 @@ +# 要素数不明の配列を集成体初期化する規則を明確化 [P3106R1] +* cpp26[meta cpp] + + + +このページはC++26に採用される見込みの言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 + + + +## 概要 +C++26では、集成体の配列を初期化する際に、中括弧 `{}` を省略した場合の動作について、規格内で矛盾があった問題を修正する。 + +C++23までの仕様として、要素数不明の配列を初期化する際、配列の要素数は初期化子リスト内の初期化子の数で決まると規定されていた。しかしこの仕様では、中括弧 `{}` を省略した場合の動作に矛盾があった: + +```cpp +struct X { int i, j, k = 42; }; + +// 実際の動作としては、どちらの要素数も2になる。 +// C++23仕様ではaは6になるはずだが、実態と合っていない +X a[] = { 1, 2, 3, 4, 5, 6 }; +X b[2] = { { 1, 2, 3 }, { 4, 5, 6 } }; +``` + +C++26ではこれを、実際のコンパイラの動作に合わせた仕様に修正する。動作としてはおそらく変わることはないと考えられる。 + +そのほかの例: + +```cpp +struct S1 { int a, b; }; +struct S2 { S1 s, t; }; + +// xとyは同じ値 +S2 x[2] = { 1, 2, 3, 4, 5, 6, 7, 8 }; +S2 y[2] = { + { + { 1, 2 }, + { 3, 4 } + }, + { + { 5, 6 }, + { 7, 8 } + } +}; +``` + +```cpp +// y[3]要素の初期化子は省略されている +float y[4][3] = { + { 1, 3, 5 }, + { 2, 4, 6 }, + { 3, 5, 7 }, +}; + +// この初期化子は上記と同じ効果を持つ +float y[4][3] = { + 1, 3, 5, 2, 4, 6, 3, 5, 7 +}; +``` + +```cpp +struct S { } s; +struct A { + S s1; + int i1; + S s2; + int i2; + S s3; + int i3; +} a = { + { }, // s1の初期化子 + 0, + s, // s2の初期化子 + 0 +}; // s3とi3は未初期化 +``` + +```cpp +struct A { + int i; + operator int(); +}; +struct B { + A a1, a2; + int z; +}; + +A a; +B b = { 4, a, a }; +// b.a1.iは4で初期化 +// b.a2はaで初期化 +// b.zはaのint変換演算子の結果で初期化 +``` + + +## 参照 +- [P3106R1 Clarifying rules for brace elision in aggregate initialization](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3106r1.html) From c0bc2348d94e63c45230aaf0b17de1af28eb36d6 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 12 May 2025 18:32:12 +0900 Subject: [PATCH 1681/3948] =?UTF-8?q?NG=E3=83=AF=E3=83=BC=E3=83=89?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ing_rules_for_brace_elision_in_aggregate_initialization.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/cpp26/clarifying_rules_for_brace_elision_in_aggregate_initialization.md b/lang/cpp26/clarifying_rules_for_brace_elision_in_aggregate_initialization.md index 257cb22d7f..b3b00864bc 100644 --- a/lang/cpp26/clarifying_rules_for_brace_elision_in_aggregate_initialization.md +++ b/lang/cpp26/clarifying_rules_for_brace_elision_in_aggregate_initialization.md @@ -10,9 +10,9 @@ ## 概要 -C++26では、集成体の配列を初期化する際に、中括弧 `{}` を省略した場合の動作について、規格内で矛盾があった問題を修正する。 +C++26では、集成体の配列を初期化する際に、中カッコ `{}` を省略した場合の動作について、規格内で矛盾があった問題を修正する。 -C++23までの仕様として、要素数不明の配列を初期化する際、配列の要素数は初期化子リスト内の初期化子の数で決まると規定されていた。しかしこの仕様では、中括弧 `{}` を省略した場合の動作に矛盾があった: +C++23までの仕様として、要素数不明の配列を初期化する際、配列の要素数は初期化子リスト内の初期化子の数で決まると規定されていた。しかしこの仕様では、中カッコ `{}` を省略した場合の動作に矛盾があった: ```cpp struct X { int i, j, k = 42; }; From ed90ef4a403275c76edd6de1f3c4d1a3a1249478 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 12 May 2025 23:04:50 +0900 Subject: [PATCH 1682/3948] =?UTF-8?q?C++26=20:=20=E3=80=8Cconstexpr?= =?UTF-8?q?=E9=85=8D=E7=BD=AEnew=E3=80=8D=E3=82=92=E8=BF=BD=E5=8A=A0=20(cl?= =?UTF-8?q?ose=20#1305)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp11/constexpr.md | 1 + lang/cpp26.md | 2 +- lang/cpp26/constexpr_placement_new.md | 45 +++++++++++++++++++++++++++ reference/new/op_new.md | 7 +++-- reference/new/op_new[].md | 5 ++- 6 files changed, 57 insertions(+), 5 deletions(-) create mode 100644 lang/cpp26/constexpr_placement_new.md diff --git a/implementation-status.md b/implementation-status.md index f4cb17fea5..15c59a3203 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -309,7 +309,7 @@ | P2795R5: [未初期化変数の読み取りをエラー性動作とする](/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md) | 初期化されていない自動変数の読み取りの安全性を規定する | | | | | | P2573R2: [関数宣言を削除する理由を指定できるようにする](/lang/cpp26/delete_reason.md) | `f() = delete("reason");` | 15 | 19 | | | | P2893R3: [可変引数テンプレートで`friend`宣言をできるようにする](/lang/cpp26/variadic_friends.md) | クラステンプレートの可変引数テンプレートでまとめて`friend`宣言できるようにする | 15 | 20 | | | -| P2747R2: [`constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md.nolink) | 定数式の文脈での配置`new`を許可 | 15 | 20 | | | +| P2747R2: [`constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md) | 定数式の文脈での配置`new`を許可 | 15 | 20 | | | | P3144R2: [不完全型へのポインタに対する`delete`を不適格とする](/lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md) | 未定義動作を引き起こす操作をコンパイルエラーとする | 15 | 19 | | | | P2963R3: [制約式内での畳み込み式の順序付け](/lang/cpp26/ordering_of_constraints_involving_fold_expressions.md.nolink) | 畳み込み式では全体ではなく個別の制約を原子制約式として扱う | | 19 | | | | P0963R3: [条件式での構造化束縛の使用を許可](/lang/cpp26/structured_binding_declaration_as_a_condition.md) | 式全体を`bool`値に変換できる場合に条件式で構造化束縛を使用できることとする | 15 | | | | diff --git a/lang/cpp11/constexpr.md b/lang/cpp11/constexpr.md index 01b3db84be..f7390498ba 100644 --- a/lang/cpp11/constexpr.md +++ b/lang/cpp11/constexpr.md @@ -217,6 +217,7 @@ GCC 5.2、Clang 3.7、Visual C++ 2015時点で、3つともデフォルトは512 - [C++23 `constexpr`関数内で`consteval`関数を呼び出せない問題を軽減](/lang/cpp23/consteval_needs_to_propagate_up.md) - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) - [C++26 定数式での`void*`からポインタ型へのキャストを許可](/lang/cpp26/constexpr_cast_from_voidptr.md) +- [C++26 `constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md) ## 参照 diff --git a/lang/cpp26.md b/lang/cpp26.md index f6f42363c2..825c9ce438 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -77,7 +77,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 |----------|------| | [定数式での`void*`からポインタ型へのキャストを許可](/lang/cpp26/constexpr_cast_from_voidptr.md) | 型消去のために`void*`からポインタ型へのキャストを許可する | | [`static_assert`の診断メッセージにユーザーが生成した文字列の指定を許可](/lang/cpp26/user-generated_static_assert_messages.md) | `constexpr`な`S.size()`と`S.data()`メンバ関数をもつオブジェクトをコンパイル時文字列として指定できるようにする | -| [`constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md.nolink) | 定数式の文脈での配置`new`を許可 | +| [`constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md) | 定数式の文脈での配置`new`を許可 | | [`constexpr`構造化束縛の許可と、定数式への参照を定数式とする](/lang/cpp26/constexpr_structured_bindings_and_references_to_constexpr_variables.md.nolink) | 定数式に対する構造化束縛を許可し、関連する定数式への参照が定数式になるようにする | | [定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) | 定数式の文脈での例外の送出と捕捉を許可 | diff --git a/lang/cpp26/constexpr_placement_new.md b/lang/cpp26/constexpr_placement_new.md new file mode 100644 index 0000000000..1004d155c8 --- /dev/null +++ b/lang/cpp26/constexpr_placement_new.md @@ -0,0 +1,45 @@ +# constexpr配置new [P2747R2] +* cpp26[meta cpp] + + + +このページはC++26に採用される見込みの言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 + + + +## 概要 +C++26では、配置`new`構文を定数式の文脈で使用できるようになる。 + +```cpp +template +constexpr void f(T* p, Args... args) { + new (p) T(args...); // C++26: OK +} +``` + +C++20では、[`std::construct_at()`](/reference/memory/construct_at.md)関数が導入された。この関数には`constexpr`がついており、コンパイラが特別扱いすることによって、コンパイル時に配置`new`相当のことができた。 + +しかし、配置`new`構文と[`std::construct_at()`](/reference/memory/construct_at.md)では、できることに大きな差がある。 + +| 操作 | 配置`new` | `std::construct_at()` | +|------|-----------|-----------------------| +| 値初期化 | `new (p) T(args...)` | `std::construct_at(p, args...)` | +| デフォルト初期化 | `new (p) T` | できない。`std::default_construct_at()`が提案されている | +| リスト初期化 | `new (p) T{a, b}` | できない | +| 指示付き初期化 | `new (p) T{.a=a, .b=b}` | できない。関数で表現する方法が現状ない | + +これらの表現力の違いから、配置`new`構文自体が`constexpr`内で使用できることとなった。 + +関連して、[``](/reference/new.md)ライブラリの配置`new`演算子もまた、`constexpr`に対応する + + +## 関連項目 +- [C++11 constexpr](/lang/cpp11/constexpr.md) +- [`new`演算子](/reference/new/op_new.md) +- [`new[]`演算子](/reference/new/op_new[].md) + + +## 参照 +- [P2747R2 constexpr placement new](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2747r2.html) diff --git a/reference/new/op_new.md b/reference/new/op_new.md index c215162aa9..560c70bc2e 100644 --- a/reference/new/op_new.md +++ b/reference/new/op_new.md @@ -39,8 +39,8 @@ void* operator new(std::size_t size, void* ptr) throw(); // (5) C++03 void* operator new(std::size_t size, void* ptr) noexcept; // (5) C++11 [[nodiscard]] void* operator new(std::size_t size, void* ptr) noexcept; // (5) C++20 -void* operator new(std::size_t size, - void* ptr) noexcept; // (5) C++26 +constexpr void* operator new(std::size_t size, + void* ptr) noexcept; // (5) C++26 ``` * std::bad_alloc[link bad_alloc.md] * std::nothrow_t[link nothrow_t.md] @@ -168,6 +168,7 @@ int main() ## 関連項目 - [C++17 アライメント指定されたデータの動的メモリ確保](/lang/cpp17/dynamic_memory_allocation_for_over-aligned_data.md) +- [C++26 `constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md) ## 参照 @@ -175,3 +176,5 @@ int main() - C++20で`[[nodiscard]]`が付加された - [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) - C++26で`[[nodiscard]]`指定が削除された +- [P2747R2 constexpr placement new](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2747r2.html) + - C++26で配置newのオーバーロードが`constexpr`対応した diff --git a/reference/new/op_new[].md b/reference/new/op_new[].md index 1802e38477..6fa34217a3 100644 --- a/reference/new/op_new[].md +++ b/reference/new/op_new[].md @@ -39,7 +39,7 @@ void* operator new[](std::size_t size, void* operator new[](std::size_t size, void* ptr) throw(); // (5) C++03 void* operator new[](std::size_t size, void* ptr) noexcept; // (5) C++11 [[nodiscard]] void* operator new[](std::size_t size, void* ptr) noexcept; // (5) C++20 -void* operator new[](std::size_t size, void* ptr) noexcept; // (5) C++26 +constexpr void* operator new[](std::size_t size, void* ptr) noexcept; // (5) C++26 ``` * std::bad_alloc[link bad_alloc.md] * std::nothrow_t[link nothrow_t.md] @@ -168,6 +168,7 @@ int main() ## 関連項目 - [C++17 アライメント指定されたデータの動的メモリ確保](/lang/cpp17/dynamic_memory_allocation_for_over-aligned_data.md) +- [C++26 `constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md) ## 参照 @@ -175,3 +176,5 @@ int main() - C++20で`[[nodiscard]]`が付加された - [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) - C++26で`[[nodiscard]]`指定が削除された +- [P2747R2 constexpr placement new](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2747r2.html) + - C++26で配置newのオーバーロードが`constexpr`対応した From 2d43dab77bf70fccfda32d136c2f5f937f9452db Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 12 May 2025 23:06:53 +0900 Subject: [PATCH 1683/3948] =?UTF-8?q?construct=5Fat=20:=20=E9=96=A2?= =?UTF-8?q?=E9=80=A3=E9=A0=85=E7=9B=AE=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/memory/construct_at.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/memory/construct_at.md b/reference/memory/construct_at.md index 0b993944fe..93e22fd7fc 100644 --- a/reference/memory/construct_at.md +++ b/reference/memory/construct_at.md @@ -84,6 +84,7 @@ int main() ## 関連項目 - [C++20 可変サイズをもつコンテナの`constexpr`化](/lang/cpp20/more_constexpr_containers.md) +- [C++26 `constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md) - [`std::ranges::construct_at`](ranges_construct_at.md) ## 参照 From ed4cd68bb69e1c0f93129db62b62e72a519d0cb3 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 13 May 2025 00:44:48 +0900 Subject: [PATCH 1684/3948] execution: on (#1384) query-with-default --- reference/execution/execution.md | 2 +- reference/execution/execution/on.md | 313 ++++++++++++++++++ .../execution/execution/query-with-default.md | 39 +++ reference/execution/execution/starts_on.md | 4 +- 4 files changed, 355 insertions(+), 3 deletions(-) create mode 100644 reference/execution/execution/on.md create mode 100644 reference/execution/execution/query-with-default.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 5bcf0530dc..9354319c83 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -113,7 +113,7 @@ namespace std::execution { | [`execution::sender_adaptor_closure`](execution/sender_adaptor_closure.md.nolink) | Senderアダプタ実装用クロージャ型(class template) | C++26 | | [`execution::starts_on`](execution/starts_on.md) | 指定Scheduler上で開始する (customization point object) | C++26 | | [`execution::continues_on`](execution/continues_on.md.nolink) | 指定Scheduler上で継続する (customization point object) | C++26 | -| [`execution::on`](execution/on.md.nolink) | 指定Scheduler上で実行する (customization point object) | C++26 | +| [`execution::on`](execution/on.md) | 指定Senderのみ別Scheduler上で実行する (customization point object) | C++26 | | [`execution::schedule_from`](execution/schedule_from.md.nolink) | Sender完了に依存する作業をスケジュール (customization point object) | C++26 | | [`execution::then`](execution/then.md) | 値完了時の継続処理をアタッチ (customization point object) | C++26 | | [`execution::upon_error`](execution/upon_error.md.nolink) | エラー完了時の継続処理をアタッチ (customization point object) | C++26 | diff --git a/reference/execution/execution/on.md b/reference/execution/execution/on.md new file mode 100644 index 0000000000..d2a057ff3b --- /dev/null +++ b/reference/execution/execution/on.md @@ -0,0 +1,313 @@ +# on +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct on_t { unspecified }; + inline constexpr on_t on{}; +} +``` +* unspecified[italic] + +## 概要 +`on`は、2種類の呼び出し形式サポートするSenderアダプタである。 + +- `on(sch, sndr)` : [Sender](sender.md)`sndr`を[Scheduler](scheduler.md)`sch`に関連付けられた実行リソースに属する実行エージェント上で開始し、完了後に`on`Senderが開始された実行リソースへと実行制御を戻す。 +- `on(sndr, sch, closure)` : [Sender](sender.md)`sndr`の完了後に、[Scheduler](scheduler.md)`sch`に関連付けられた実行リソースに属する実行エージェントへ実行を移し、`sndr`の完了結果をもってSenderアダプタクロージャ`closure`を実行し、Sender`sndr`が完了された実行リソースへと実行制御を戻す。 + +`on`はパイプライン記法をサポートする。 + + +## 効果 +### 呼び出し式 `on(sch, sndr)` +説明用の式`sch`と`sndr`に対して、下記いずれかが`true`となるとき呼び出し式`on(sch, sndr)`は不適格となる。 + +- `decltype((sch))`が[`scheduler`](scheduler.md)を満たさない、もしくは +- `decltype((sndr))`が[`sender`](sender.md)を満たさず、かつパイプライン可能Senderアダプタクロージャオブジェクトではない、もしくは +- `decltype((sndr))`が[`sender`](sender.md)を満たし、かつパイプライン可能Senderアダプタクロージャオブジェクトである。 + +そうでなければ、呼び出し式`on(sch, sndr)`は`sch`が1回だけ評価されることを除いて、下記と等価。 + +```cpp +transform_sender( + query-or-default(get_domain, sch, default_domain()), + make-sender(on, sch, sndr)) +``` +* transform_sender[link transform_sender.md] +* query-or-default[link query-or-default.md.nolink] +* get_domain[link get_domain.md] +* default_domain()[link default_domain.md] +* make-sender[link make-sender.md] + + +### 呼び出し式 `on(sndr, sch, closure)` +説明用の式`sndr`, `sch`, `closure`に対して、下記いずれかが`true`となるとき呼び出し式`on(sndr, sch, closure)`は不適格となる。 + +- `decltype((sch))`が[`scheduler`](scheduler.md)を満たさない、もしくは +- `decltype((sndr))`が[`sender`](sender.md)を満たさない、もしくは +- `closure`がパイプライン可能Senderアダプタクロージャオブジェクトではない。 + +そうでなければ、呼び出し式`on(sndr, sch, closure)`は`sndr`が1回だけ評価されることを除いて、下記と等価。 + +```cpp +transform_sender( + get-domain-early(sndr), + make-sender(on, product-type{sch, closure}, sndr)) +``` +* transform_sender[link transform_sender.md] +* get-domain-early[link get-domain-early.md] +* make-sender[link make-sender.md] +* product-type[link product-type.md] + + +### Senderアルゴリズムタグ `on` +説明用の式`out_sndr`と`env`に対して、型`OutSndr`を`decltype((out_sndr))`とし、型`Env`を`decltype((env))`とする。[`sender-for`](sender-for.md)` == false`のとき、式`on.transform_env(out_sndr, env)`および式`on.transform_sender(out_sndr, env)`はいずれも不適格となる。 + +そうでなければ、下記の通り。 + +- 式`on.transform_env(out_sndr, env)`は下記と等価。 + + ```cpp + auto&& [_, data, _] = out_sndr; + if constexpr (scheduler) { + return JOIN-ENV(SCHED-ENV(std::forward_like(data)), FWD-ENV(std::forward(env))); + } else { + return std::forward(env); + } + ``` + * scheduler[link scheduler.md] + * JOIN-ENV[link JOIN-ENV.md.nolink] + * SCHED-ENV[link SCHED-ENV.md.nolink] + * FWD-ENV[link ../forwarding_query.md] + +- 式`on.transform_sender(out_sndr, env)`は下記と等価。 + + ```cpp + auto&& [_, data, child] = out_sndr; + if constexpr (scheduler) { + auto orig_sch = + query-with-default(get_scheduler, env, not-a-scheduler()); + + if constexpr (same_as) { + return not-a-sender{}; + } else { + return continues_on( + starts_on(std::forward_like(data), std::forward_like(child)), + std::move(orig_sch)); + } + } else { + auto& [sch, closure] = data; + auto orig_sch = query-with-default( + get_completion_scheduler, + get_env(child), + query-with-default(get_scheduler, env, not-a-scheduler())); + + if constexpr (same_as) { + return not-a-sender{}; + } else { + return write-env( + continues_on( + std::forward_like(closure)( + continues_on( + write-env(std::forward_like(child), SCHED-ENV(orig_sch)), + sch)), + orig_sch), + SCHED-ENV(sch)); + } + } + ``` + * scheduler[link scheduler.md] + * get_scheduler[link get_scheduler.md] + * continues_on[link continues_on.md.nolink] + * starts_on[link starts_on.md] + * get_completion_scheduler[link get_completion_scheduler.md] + * set_value_t[link set_value.md] + * get_env[link get_env.md] + * query-with-default[link query-with-default.md] + * write-env[link write-env.md.nolink] + * SCHED-ENV[link SCHED-ENV.md.nolink] + + +## カスタマイゼーションポイント +Senderアルゴリズム構築時に、関連付けられた実行ドメインに対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 +[デフォルト実行ドメイン](../execution/default_domain.md)では無変換。 + +- 呼び出し式`on(sch, sndr)` : [Scheduler](scheduler.md)`sch`に[関連付けられた実行ドメイン](query-or-default.md.nolink) +- 呼び出し式`on(sndr, sch, closure)` : [Sender](sender.md)`sndr`に[関連付けられた実行ドメイン](get-domain-early.md) + +[Receiver](receiver.md)との[接続(connect)](connect.md)時に、[関連付けられた実行ドメイン](get-domain-late.md)に対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 +[デフォルト実行ドメイン](../execution/default_domain.md)では`on.transform_sender(out_sndr, env)`が呼ばれ、前述仕様通りのSenderへと変換される。 + + +### 呼び出し式 `on(sch, sndr)` +説明用の式`out_sndr`を`on(sch, sndr)`の戻り値[Sender](sender.md)とし、型`OutSndr`を`decltype((out_sndr))`とする。式`out_rcvr`を[`sender_in`](sender_in.md)` == true`となる[環境](../queryable.md)`Env`に関連付けられた[Receiver](receiver.md)とする。`out_sndr`と`out_rcvr`との[接続(connect)](connect.md)結果[Operation State](operation_state.md)への左辺値参照を`op`としたとき、[`start`](start.md)`(op)`呼び出しは下記を満たすべき。 + +- 現在のScheduler[`get_scheduler`](get_scheduler.md)`(`[`get_env`](get_env.md)`(rcvr))`を記憶する。 +- [Scheduler](scheduler.md)`sch`に関連付けられた実行リソースに属する実行エージェント上で`sndr`を開始する。 +- `sndr`の完了後に、手順1で記憶したSchedulerに関連付けられた実行リソースに実行制御を戻す。 +- `sndr`の非同期操作の結果を`out_rcvr`へ転送する。 + +いずれかのスケジューリングが失敗した場合、未規定の実行エージェント上で`out_rcvr`の[エラー完了](set_error.md)が行われるべき。 + + +### 呼び出し式 `on(sndr, sch, closure)` +説明用の式`out_sndr`を`on(sndr, sch, closure)`の戻り値[Sender](sender.md)とし、型`OutSndr`を`decltype((out_sndr))`とする。式`out_rcvr`を[`sender_in`](sender_in.md)` == true`となる[環境](../queryable.md)`Env`に関連付けられた[Receiver](receiver.md)とする。`out_sndr`と`out_rcvr`との[接続(connect)](connect.md)結果[Operation State](operation_state.md)への左辺値参照を`op`としたとき、[`start`](start.md)`(op)`呼び出しは下記を満たすべき。 + +- 下記のうち最初に適格となるものを、現在のSchedulerとして記憶する。 + - [`get_completion_scheduler`](get_completion_scheduler.md)`<`[`set_value_t`](set_value.md)`>(`[`get_env`](get_env.md)`(rcvr))` + - [`get_scheduler`](get_scheduler.md)`(`[`get_env`](get_env.md)`(rcvr))` +- `sndr`を現在の実行エージェント上で開始する。 +- `sndr`の完了後に、[Scheduler](scheduler.md)`sch`に関連付けられた実行リソースの実行エージェントに実行制御を移す。 +- `sndr`の非同期操作の結果を、Sender`closure(S)`と接続して開始するかのように転送する。ここで`S`は`sndr`の非同期操作の結果と同期的に完了するSenderとする。 +- 前手順で開始した非同期操作が完了したら、手順1で記憶したSchedulerに関連付けられた実行リソースに実行制御を戻し、非同期操作の結果を`out_rcvr`へ転送する。 + +いずれかのスケジューリングが失敗した場合、未規定の実行エージェント上で`out_rcvr`の[エラー完了](set_error.md)が行われるべき。 + + +## 例 + +### 例1: on(sch, sndr) +```cpp +#include +#include +#include +namespace ex = std::execution; + +int main() +{ + std::println("main#{}", std::this_thread::get_id()); + + ex::run_loop loop; + std::jthread worker{[&]{ + std::println("start worker#{}", std::this_thread::get_id()); + loop.run(); + }}; + ex::scheduler auto sch = loop.get_scheduler(); + + ex::sender auto snd0 = + ex::then(ex::just(), []() { + std::println("on worker#{}", std::this_thread::get_id()); + return 6; + }); + ex::sender auto snd1 = ex::on(sch, snd0); + ex::sender auto snd2 = + ex::then(snd1, [](int n) { + std::println("on main#{}", std::this_thread::get_id()); + return n * 7; + }); + + auto [val] = std::this_thread::sync_wait(std::move(snd2)).value(); + std::println("val={}", val); + + loop.finish(); +} +``` +* ex::on[color ff0000] +* ex::run_loop[link run_loop.md] +* ex::sender[link sender.md] +* ex::scheduler[link scheduler.md] +* ex::just[link just.md] +* ex::then[link then.md] +* get_scheduler()[link run_loop/get_scheduler.md] +* run()[link run_loop/run.md] +* finish()[link run_loop/finish.md] +* std::this_thread::sync_wait[link ../this_thread/sync_wait.md] +* value()[link /reference/optional/optional/value.md] +* std::move[link /reference/utility/move.md] +* std::this_thread::get_id()[link /reference/thread/this_thread/get_id.md] + +#### 出力例 +``` +main#133519926773568 +start worker#133519921645120 +on worker#133519921645120 +on main#133519926773568 +val=42 +``` + +### 例2: on(sndr, sch, closure) +```cpp +#include +#include +#include +namespace ex = std::execution; + +int main() +{ + std::println("main#{}", std::this_thread::get_id()); + + ex::run_loop loop; + std::jthread worker{[&]{ + std::println("start worker#{}", std::this_thread::get_id()); + loop.run(); + }}; + ex::scheduler auto sch = loop.get_scheduler(); + + ex::sender auto sndr = + ex::just() + | ex::then([]() { + std::println("on main#{}", std::this_thread::get_id()); + return 2; + }) + | ex::on(sch, ex::then([](int n) { + std::println("on worker#{}", std::this_thread::get_id()); + return n * 3; + })) + | ex::then([](int n) { + std::println("on main#{}", std::this_thread::get_id()); + return n * 7; + }); + + auto [val] = std::this_thread::sync_wait(std::move(sndr)).value(); + std::println("val={}", val); + + loop.finish(); +} +``` +* ex::on[color ff0000] +* ex::run_loop[link run_loop.md] +* ex::sender[link sender.md] +* ex::scheduler[link scheduler.md] +* ex::just[link just.md] +* ex::then[link then.md] +* get_scheduler()[link run_loop/get_scheduler.md] +* run()[link run_loop/run.md] +* finish()[link run_loop/finish.md] +* std::this_thread::sync_wait[link ../this_thread/sync_wait.md] +* value()[link /reference/optional/optional/value.md] +* std::move[link /reference/utility/move.md] +* std::this_thread::get_id()[link /reference/thread/this_thread/get_id.md] + +#### 出力例 +``` +main#133519926773568 +start worker#133519921645120 +on main#133519926773568 +on worker#133519921645120 +on main#133519926773568 +val=42 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::schedule`](schedule.md) +- [`execution::starts_on`](starts_on.md) +- [`execution::continues_on`](continues_on.md.nolink) + + +## 参照 +- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/query-with-default.md b/reference/execution/execution/query-with-default.md new file mode 100644 index 0000000000..4e4d408386 --- /dev/null +++ b/reference/execution/execution/query-with-default.md @@ -0,0 +1,39 @@ +# query-with-default +* execution[meta header] +* function template[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +template +constexpr decltype(auto) query-with-default( + Tag, const Env& env, Default&& value) noexcept(see below); +``` +* see below[italic] + +## 概要 +`query-with-default`は、実行制御ライブラリの仕様定義で用いられる説明専用の関数テンプレートである。 + +説明用の式`e`を、適格であるならば`Tag()(env)`とする。そうでなければ、`staitc_cast(`[`std::forward`](/reference/utility/forward.md)`(value))`とする。 + + +## 戻り値 +`e`を返す。 + + +## 備考 +noexcept節の式は`noexcept(e)`となる。 + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`execution::on`](on.md) + + +## 参照 +- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/starts_on.md b/reference/execution/execution/starts_on.md index ae91c19018..dcad0c7863 100644 --- a/reference/execution/execution/starts_on.md +++ b/reference/execution/execution/starts_on.md @@ -75,7 +75,7 @@ Senderアルゴリズム構築時に、[Scheduler](scheduler.md)`sch`に[関連 説明用の式`out_sndr`を`starts_on(sch, sndr)`の戻り値[Sender](sender.md)とし、型`OutSndr`を`decltype((out_sndr))`とする。式`out_rcvr`を[`sender_in`](sender_in.md)` == true`となる[環境](../queryable.md)`Env`に関連付けられた[Receiver](receiver.md)とする。`out_sndr`と`out_rcvr`との[接続(connect)](connect.md)結果[Operation State](operation_state.md)への左辺値参照を`op`としたとき、 -- 呼び出し[`start`](start.md)`(op)`は、[Scheduler](scheduler.md)`sch`に関連づけられた実行リソースに属する実行エージェント上で入力[Sender](sender.md)`sndr`を開始すべき。 +- 呼び出し[`start`](start.md)`(op)`は、[Scheduler](scheduler.md)`sch`に関連付けられた実行リソースに属する実行エージェント上で入力[Sender](sender.md)`sndr`を開始すべき。 - `sch`上でのスケジューリングが失敗した場合、未規定の実行エージェント上で`out_rcvr`の[エラー完了](set_error.md)が行われるべき。 @@ -147,7 +147,7 @@ val=42 ## 関連項目 - [`execution::schedule`](schedule.md) - [`execution::continues_on`](continues_on.md.nolink) -- [`execution::on`](on.md.nolink) +- [`execution::on`](on.md) ## 参照 From aed6be47ecf8ed4a4c23ff209daf7df2de517e2e Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 13 May 2025 15:54:28 +0900 Subject: [PATCH 1685/3948] =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=83=91=E3=82=A4?= =?UTF-8?q?=E3=83=A9=E3=81=AE=E5=AE=9F=E8=A3=85=E7=8A=B6=E6=B3=81=20:=20GC?= =?UTF-8?q?C=2015=E3=81=AF=E3=80=8C`constexpr`=E6=A7=8B=E9=80=A0=E5=8C=96?= =?UTF-8?q?=E6=9D=9F=E7=B8=9B=E3=81=AE=E8=A8=B1=E5=8F=AF=E3=81=A8=E3=80=81?= =?UTF-8?q?=E5=AE=9A=E6=95=B0=E5=BC=8F=E3=81=B8=E3=81=AE=E5=8F=82=E7=85=A7?= =?UTF-8?q?=E3=82=92=E5=AE=9A=E6=95=B0=E5=BC=8F=E3=81=A8=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=80=8D=E3=82=92=E5=AE=9F=E8=A3=85=E3=81=97=E3=81=A6=E3=81=84?= =?UTF-8?q?=E3=81=AA=E3=81=8B=E3=81=A3=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/implementation-status.md b/implementation-status.md index 15c59a3203..03f37ab15a 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -313,7 +313,7 @@ | P3144R2: [不完全型へのポインタに対する`delete`を不適格とする](/lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md) | 未定義動作を引き起こす操作をコンパイルエラーとする | 15 | 19 | | | | P2963R3: [制約式内での畳み込み式の順序付け](/lang/cpp26/ordering_of_constraints_involving_fold_expressions.md.nolink) | 畳み込み式では全体ではなく個別の制約を原子制約式として扱う | | 19 | | | | P0963R3: [条件式での構造化束縛の使用を許可](/lang/cpp26/structured_binding_declaration_as_a_condition.md) | 式全体を`bool`値に変換できる場合に条件式で構造化束縛を使用できることとする | 15 | | | | -| P2686R5: [`constexpr`構造化束縛の許可と、定数式への参照を定数式とする](/lang/cpp26/constexpr_structured_bindings_and_references_to_constexpr_variables.md.nolink) | 定数式に対する構造化束縛を許可し、関連する定数式への参照が定数式になるようにする | 15 | | | | +| P2686R5: [`constexpr`構造化束縛の許可と、定数式への参照を定数式とする](/lang/cpp26/constexpr_structured_bindings_and_references_to_constexpr_variables.md.nolink) | 定数式に対する構造化束縛を許可し、関連する定数式への参照が定数式になるようにする | | | | | | P3068R6: [定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) | 定数式の文脈での例外の送出と捕捉を許可 | | | | | | P2865R6: [非推奨だった組み込み配列の比較を削除](/lang/cpp26/remove_deprecated_array_comparisons.md) | C++20で非推奨となっていた配列比較を削除 | 15 | 20 | | | | P1061R10: [構造化束縛でパックを導入できるようにする](/lang/cpp26/structured_bindings_can_introduce_a_pack.md) | タプルを分解する際に複数の変数をパックとして宣言できるようにする。`auto [a, ...xs] = f();` | | | | | From 70977b4be6d8dca0d98faf20614fccd8338fd883 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 13 May 2025 15:56:54 +0900 Subject: [PATCH 1686/3948] =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=83=91=E3=82=A4?= =?UTF-8?q?=E3=83=A9=E3=81=AE=E5=AE=9F=E8=A3=85=E7=8A=B6=E6=B3=81=20:=20GC?= =?UTF-8?q?C=2015=E3=81=A7=E3=80=8C=E5=9F=BA=E6=9C=AC=E6=96=87=E5=AD=97?= =?UTF-8?q?=E9=9B=86=E5=90=88=E3=81=AB@=E3=80=81$=E3=80=81\`=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E3=80=8D=E3=81=AF=E5=AF=BE=E5=BF=9C=E3=81=97?= =?UTF-8?q?=E3=81=A6=E3=81=84=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/implementation-status.md b/implementation-status.md index 03f37ab15a..7db0b28137 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -298,7 +298,7 @@ | P2552R3: [属性の無視性を見直し](/lang/cpp26/on_the_ignorability_of_standard_attributes.md) | 構文として適格な属性のみを無視できるようにし、そうでない属性の使用を不適格とする | 15 | | | | | P2738R1: [定数式での`void*`からポインタ型へのキャストを許可](/lang/cpp26/constexpr_cast_from_voidptr.md) | 型消去のために`void*`からポインタ型へのキャストを許可する | 14 | 17 | | | | P2741R3: [`static_assert`の診断メッセージにユーザーが生成した文字列の指定を許可](/lang/cpp26/user-generated_static_assert_messages.md) | `constexpr`な`S.size()`と`S.data()`メンバ関数をもつオブジェクトをコンパイル時文字列として指定できるようにする | 14 | 17 | | | -| P2558R2: [基本文字集合に@、$、\`を追加](/lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md) | C言語との互換性のためにこれらの文字を基本文字集合に追加 | | Yes | | | +| P2558R2: [基本文字集合に@、$、\`を追加](/lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md) | C言語との互換性のためにこれらの文字を基本文字集合に追加 | 15 | Yes | | | | P2662R3: [パラメータパックへのインデックスアクセスを許可](/lang/cpp26/pack_indexing.md) | 可変引数テンプレートのパラメータパックに添字アクセスできるようにする | 15 | | | | | P2864R2: [非推奨となっていた列挙値から算術型への暗黙変換を削除](/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md) | C++20から非推奨となっていた列挙値への算術演算で算術型に暗黙変換される仕様を削除 | 14 | 18 | | | | P2748R5: [返却された左辺値から暗黙変換された一時オブジェクトが参照に束縛されることを禁止する](/lang/cpp26/disallow_binding_a_returned_glvalue_to_a_temporary.md) | 寿命切れの変数によって引き起こされるバグを防止する | 14 | 19 | | | From eb61e1ad907d51100f2e1c052c91bac29f3c807b Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 13 May 2025 17:20:39 +0900 Subject: [PATCH 1687/3948] =?UTF-8?q?C++26:=20=E3=80=8Cconstexpr=E6=A7=8B?= =?UTF-8?q?=E9=80=A0=E5=8C=96=E6=9D=9F=E7=B8=9B=E3=81=AE=E8=A8=B1=E5=8F=AF?= =?UTF-8?q?=E3=81=A8=E3=80=81constexpr=E5=8F=82=E7=85=A7=E3=81=AE=E5=88=B6?= =?UTF-8?q?=E9=99=90=E7=B7=A9=E5=92=8C=E3=80=8D=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20#1372?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp11/constexpr.md | 1 + lang/cpp17/structured_bindings.md | 1 + lang/cpp26.md | 2 +- ...s_and_references_to_constexpr_variables.md | 56 +++++++++++++++++++ 5 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 lang/cpp26/constexpr_structured_bindings_and_references_to_constexpr_variables.md diff --git a/implementation-status.md b/implementation-status.md index 7db0b28137..a375fee770 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -313,7 +313,7 @@ | P3144R2: [不完全型へのポインタに対する`delete`を不適格とする](/lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md) | 未定義動作を引き起こす操作をコンパイルエラーとする | 15 | 19 | | | | P2963R3: [制約式内での畳み込み式の順序付け](/lang/cpp26/ordering_of_constraints_involving_fold_expressions.md.nolink) | 畳み込み式では全体ではなく個別の制約を原子制約式として扱う | | 19 | | | | P0963R3: [条件式での構造化束縛の使用を許可](/lang/cpp26/structured_binding_declaration_as_a_condition.md) | 式全体を`bool`値に変換できる場合に条件式で構造化束縛を使用できることとする | 15 | | | | -| P2686R5: [`constexpr`構造化束縛の許可と、定数式への参照を定数式とする](/lang/cpp26/constexpr_structured_bindings_and_references_to_constexpr_variables.md.nolink) | 定数式に対する構造化束縛を許可し、関連する定数式への参照が定数式になるようにする | | | | | +| P2686R5: [`constexpr`構造化束縛の許可と、`constexpr`参照の制限緩和](/lang/cpp26/constexpr_structured_bindings_and_references_to_constexpr_variables.md) | 定数式に対する構造化束縛を許可し、関連して`constexpr`参照がの制限を緩和して自動変数も参照できるようにする | | | | | | P3068R6: [定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) | 定数式の文脈での例外の送出と捕捉を許可 | | | | | | P2865R6: [非推奨だった組み込み配列の比較を削除](/lang/cpp26/remove_deprecated_array_comparisons.md) | C++20で非推奨となっていた配列比較を削除 | 15 | 20 | | | | P1061R10: [構造化束縛でパックを導入できるようにする](/lang/cpp26/structured_bindings_can_introduce_a_pack.md) | タプルを分解する際に複数の変数をパックとして宣言できるようにする。`auto [a, ...xs] = f();` | | | | | diff --git a/lang/cpp11/constexpr.md b/lang/cpp11/constexpr.md index f7390498ba..17ac9eeb38 100644 --- a/lang/cpp11/constexpr.md +++ b/lang/cpp11/constexpr.md @@ -218,6 +218,7 @@ GCC 5.2、Clang 3.7、Visual C++ 2015時点で、3つともデフォルトは512 - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) - [C++26 定数式での`void*`からポインタ型へのキャストを許可](/lang/cpp26/constexpr_cast_from_voidptr.md) - [C++26 `constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md) +- [C++26 `constexpr`構造化束縛の許可と、`constexpr`参照の制限緩和](/lang/cpp26/constexpr_structured_bindings_and_references_to_constexpr_variables.md) ## 参照 diff --git a/lang/cpp17/structured_bindings.md b/lang/cpp17/structured_bindings.md index 424d317770..f3036ded8b 100644 --- a/lang/cpp17/structured_bindings.md +++ b/lang/cpp17/structured_bindings.md @@ -343,6 +343,7 @@ auto { w, {x, y}, z } = f(); // このような、tuple内にあるpairを同時 - [C++26 条件式での構造化束縛の使用を許可](/lang/cpp26/structured_binding_declaration_as_a_condition.md) - [C++26 宣言のみで使用しない変数の名前として`_`をサポート](/lang/cpp26/nice_placeholder_with_no_name.md) - [C++26 構造化束縛でパックを導入できるようにする](/lang/cpp26/structured_bindings_can_introduce_a_pack.md) +- [C++26 `constexpr`構造化束縛の許可と、`constexpr`参照の制限緩和](/lang/cpp26/constexpr_structured_bindings_and_references_to_constexpr_variables.md) ## 参照 diff --git a/lang/cpp26.md b/lang/cpp26.md index 825c9ce438..80da59c2a6 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -78,7 +78,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | [定数式での`void*`からポインタ型へのキャストを許可](/lang/cpp26/constexpr_cast_from_voidptr.md) | 型消去のために`void*`からポインタ型へのキャストを許可する | | [`static_assert`の診断メッセージにユーザーが生成した文字列の指定を許可](/lang/cpp26/user-generated_static_assert_messages.md) | `constexpr`な`S.size()`と`S.data()`メンバ関数をもつオブジェクトをコンパイル時文字列として指定できるようにする | | [`constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md) | 定数式の文脈での配置`new`を許可 | -| [`constexpr`構造化束縛の許可と、定数式への参照を定数式とする](/lang/cpp26/constexpr_structured_bindings_and_references_to_constexpr_variables.md.nolink) | 定数式に対する構造化束縛を許可し、関連する定数式への参照が定数式になるようにする | +| [`constexpr`構造化束縛の許可と、`constexpr`参照の制限緩和](/lang/cpp26/constexpr_structured_bindings_and_references_to_constexpr_variables.md) | 定数式に対する構造化束縛を許可し、関連して`constexpr`参照がの制限を緩和して自動変数も参照できるようにする | | [定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) | 定数式の文脈での例外の送出と捕捉を許可 | diff --git a/lang/cpp26/constexpr_structured_bindings_and_references_to_constexpr_variables.md b/lang/cpp26/constexpr_structured_bindings_and_references_to_constexpr_variables.md new file mode 100644 index 0000000000..acb74707ff --- /dev/null +++ b/lang/cpp26/constexpr_structured_bindings_and_references_to_constexpr_variables.md @@ -0,0 +1,56 @@ +# constexpr構造化束縛の許可と、constexpr参照の制限緩和 [P2686R5] +* cpp26[meta cpp] + + + +このページはC++26に採用される見込みの言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 + + + +## 概要 +C++26では、定数式の文脈での構造化束縛が許可されるようになり、`constexpr`変数への参照が定数式として扱われるようになる。 + +### `constexpr`構造化束縛の許可 + +C++23までは構造化束縛を`constexpr`として使用することはできなかったが、C++26では以下のようなコードが許可される。 + +```cpp +constexpr std::tuple p{1, 2}; +constexpr auto [x, y] = p; // C++26: OK +``` + +構造化束縛は以下のように参照に展開されるため、`constexpr`参照と同じ制限を受ける: + +```cpp +void f() { + constexpr std::tuple p{1, 2}; + constexpr const auto& x = get<0>(p); + constexpr const auto& y = get<1>(p); +} +``` +* get[link /reference/tuple/tuple/get.md] + + +### `constexpr`変数への参照の制限緩和 +`constexpr`参照はC++23まで、静的記憶域をもつ変数への参照のみ許可されていた (テンプレートパラメータの`template `も同様)。C++26ではその制限が緩和され、自動記憶域 (ブロックスコープ) をもつ変数でも`constexpr`参照ができるようになる。 + +```cpp +void f() { + constexpr int a = 42; + constexpr const int& ref = a; // C++23: NG, C++26: OK +} +``` + +ただし`constexpr`参照の制限として、参照する変数のアドレスが、参照または構造化束縛が存在するスタックフレームを基準とした定数である場合に限られる。 + + +## 関連項目 +- [C++11 constexpr](/lang/cpp11/constexpr.md) +- [C++17 構造化束縛](/lang/cpp17/structured_bindings.md) + + +## 参照 +- [P2686R5 `constexpr` structured bindings and references to `constexpr` variables](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2686r5.pdf) +- [Trip report: November 2024 ISO C++ standards meeting (Wrocław, Poland) - Sutter's Mill](https://herbsutter.com/2024/11/24/wg21-2024-11/) From 4a750d84b5b319ec2360d43b1748873cd765d56e Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Tue, 13 May 2025 18:04:57 +0900 Subject: [PATCH 1688/3948] =?UTF-8?q?typo=E4=BF=AE=E6=AD=A3=E3=81=A8NG?= =?UTF-8?q?=E3=83=AF=E3=83=BC=E3=83=89=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/script/ngword_check.py | 4 ++++ reference/execution/execution/basic-operation.md | 2 +- reference/execution/execution/get-domain-early.md | 2 +- reference/execution/execution/get-domain-late.md | 2 +- reference/execution/execution/query-with-default.md | 2 +- reference/execution/execution/sender.md | 2 +- 6 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/script/ngword_check.py b/.github/workflows/script/ngword_check.py index b55124e2aa..94e3843469 100644 --- a/.github/workflows/script/ngword_check.py +++ b/.github/workflows/script/ngword_check.py @@ -14,7 +14,9 @@ ("", "algined", "aligned"), ("", "concpet", "concept"), ("", "condtion", "condition"), + ("", "contraint", "constraint"), ("", "Dimentional", "Dimensional"), + ("", "Doamin", "Domain"), ("", "eror", "error"), ("", "enumrate", "enumerate"), ("", "expceted", "expected"), @@ -30,8 +32,10 @@ ("", "Ohter", "Other"), ("", "protmise_type", "promise_type"), ("", "pvalue", "prvalue"), + ("", "Recevier", "Receiver"), ("", "refernce", "reference"), ("", "repear", "repeat"), + ("", "staitc", "static"), ("", "std::range::", "std::ranges::"), ("", "swtich", "switch"), ("", "voaltile", "volatile"), diff --git a/reference/execution/execution/basic-operation.md b/reference/execution/execution/basic-operation.md index 73d0107477..43cbb0c46b 100644 --- a/reference/execution/execution/basic-operation.md +++ b/reference/execution/execution/basic-operation.md @@ -46,7 +46,7 @@ namespace std::execution { ## 概要 `basic-operation`および`basic-state`は、Senderアルゴリズム動作仕様定義で用いられる説明専用のクラステンプレートである。 -`basic-operation`は[`operation_state`](operation_state.md)のモデルであり、[Senderアルゴリズム](basic-sender.md)と[Recevier](receiver.md)の[接続(connect)](connect.md)結果型として利用される。 +`basic-operation`は[`operation_state`](operation_state.md)のモデルであり、[Senderアルゴリズム](basic-sender.md)と[Receiver](receiver.md)の[接続(connect)](connect.md)結果型として利用される。 - `rcvr` : 接続先Receiverオブジェクトを保持。Senderアルゴリズム同士を連結する場合は、親Senderアルゴリズム側の[Receiver](receiver.md)が該当する。 - `state` : Senderアルゴリズム構築時の引数リストを保持。([`impls-for`](impls-for.md)でカスタマイズ可能) diff --git a/reference/execution/execution/get-domain-early.md b/reference/execution/execution/get-domain-early.md index a9092276d3..8ca93cb864 100644 --- a/reference/execution/execution/get-domain-early.md +++ b/reference/execution/execution/get-domain-early.md @@ -20,7 +20,7 @@ constexpr auto get-domain-early(const Sndr& sndr) noexcept; ## 効果 -説明用の型`Domain`を下記リストのうち最初に適格となる式の型と定義したとき、`return Doamin();`と等価。 +説明用の型`Domain`を下記リストのうち最初に適格となる式の型と定義したとき、`return Domain();`と等価。 - [`get_domain`](get_domain.md)`(`[`get_env`](get_env.md)`(sndr))` - [`completion-domain`](completion-domain.md)`(sndr)` diff --git a/reference/execution/execution/get-domain-late.md b/reference/execution/execution/get-domain-late.md index 0d4e74a5e1..bdfaec0988 100644 --- a/reference/execution/execution/get-domain-late.md +++ b/reference/execution/execution/get-domain-late.md @@ -23,7 +23,7 @@ constexpr auto get-domain-late(const Sndr& sndr, const Env& env) noexcept; ## 効果 -説明用の型`Domain`を下記の通り定義したとき、`return Doamin();`と等価。 +説明用の型`Domain`を下記の通り定義したとき、`return Domain();`と等価。 - [`sender-for`](sender-for.md)` == true`のとき、次のラムダ式呼び出し結果の型とする。 diff --git a/reference/execution/execution/query-with-default.md b/reference/execution/execution/query-with-default.md index 4e4d408386..85520c871a 100644 --- a/reference/execution/execution/query-with-default.md +++ b/reference/execution/execution/query-with-default.md @@ -14,7 +14,7 @@ constexpr decltype(auto) query-with-default( ## 概要 `query-with-default`は、実行制御ライブラリの仕様定義で用いられる説明専用の関数テンプレートである。 -説明用の式`e`を、適格であるならば`Tag()(env)`とする。そうでなければ、`staitc_cast(`[`std::forward`](/reference/utility/forward.md)`(value))`とする。 +説明用の式`e`を、適格であるならば`Tag()(env)`とする。そうでなければ、`static_cast(`[`std::forward`](/reference/utility/forward.md)`(value))`とする。 ## 戻り値 diff --git a/reference/execution/execution/sender.md b/reference/execution/execution/sender.md index 5f6e98eac3..479fede9f3 100644 --- a/reference/execution/execution/sender.md +++ b/reference/execution/execution/sender.md @@ -62,7 +62,7 @@ concept sender = ## 備考 -`sender`コンセプトの制約式に現れる第1項`bool(enable-sender<...>)`は[原子制約(atomic contraint)](/lang/cpp20/concepts.md)を構成する。 +`sender`コンセプトの制約式に現れる第1項`bool(enable-sender<...>)`は[原子制約(atomic constraint)](/lang/cpp20/concepts.md)を構成する。 これによりオーバーロード解決時の優先順比較において`enable-sender`コンセプトの`||`を単純なOR条件とみなせ、コンパイル時の複雑な包摂関係計算コストを抑制できる。 From b15f55fa1cc885b3284cf315f99f0085eec160b9 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 13 May 2025 18:06:58 +0900 Subject: [PATCH 1689/3948] =?UTF-8?q?=20execution:=20=E5=BE=AE=E8=AA=BF?= =?UTF-8?q?=E6=95=B4=20(#1384)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/execution/execution/on.md | 20 ++++++- reference/execution/execution/product-type.md | 2 +- .../execution/execution/query-with-default.md | 2 +- .../execution/with-await-transform.md | 2 +- reference/execution/execution/write-env.md | 59 +++++++++++++++++++ .../execution/this_thread/sync-wait-env.md | 2 +- .../this_thread/sync-wait-receiver.md | 2 +- 7 files changed, 83 insertions(+), 6 deletions(-) create mode 100644 reference/execution/execution/write-env.md diff --git a/reference/execution/execution/on.md b/reference/execution/execution/on.md index d2a057ff3b..361cb2c14c 100644 --- a/reference/execution/execution/on.md +++ b/reference/execution/execution/on.md @@ -127,8 +127,26 @@ transform_sender( * set_value_t[link set_value.md] * get_env[link get_env.md] * query-with-default[link query-with-default.md] - * write-env[link write-env.md.nolink] + * write-env[link write-env.md] * SCHED-ENV[link SCHED-ENV.md.nolink] + * std::move[link /reference/utility/move.md] + +説明専用のクラス`not-a-scheduler`を未規定な空のクラス型、`not-a-sender`を下記の通り定義する。 + +```cpp +struct not-a-sender { + using sender_concept = sender_t; + + auto get_completion_signatures(auto&&) const { + return see below; + } +}; +``` +* sender_t[link sender.md] +* see below[italic] + +メンバ関数`get_completion_signatures`は[`completion_signatures`](completion_signatures.md)クラステンプレートの特殊化とは異なる型のオブジェクトを返す。 +処理系(標準ライブラリ実装者)は、この型を用いてユーザにエラー理由を通知することが推奨される。 ## カスタマイゼーションポイント diff --git a/reference/execution/execution/product-type.md b/reference/execution/execution/product-type.md index daa0b71a9c..ac23581b2d 100644 --- a/reference/execution/execution/product-type.md +++ b/reference/execution/execution/product-type.md @@ -24,7 +24,7 @@ struct product-type { // exposition only * see below[italic] ## 概要 -`product-type`は、実行制御ライブラリの仕様定義で用いられる説明専用のクラステンプレートである。 +`product-type`は、Senderアルゴリズム動作仕様定義で用いられる説明専用のクラステンプレートである。 `product-type`型の式は[構造化束縛](/lang/cpp17/structured_bindings.md)における初期化子として利用できる。 diff --git a/reference/execution/execution/query-with-default.md b/reference/execution/execution/query-with-default.md index 85520c871a..0df3e1fef6 100644 --- a/reference/execution/execution/query-with-default.md +++ b/reference/execution/execution/query-with-default.md @@ -12,7 +12,7 @@ constexpr decltype(auto) query-with-default( * see below[italic] ## 概要 -`query-with-default`は、実行制御ライブラリの仕様定義で用いられる説明専用の関数テンプレートである。 +`query-with-default`は、Senderアルゴリズム動作仕様定義で用いられる説明専用の関数テンプレートである。 説明用の式`e`を、適格であるならば`Tag()(env)`とする。そうでなければ、`static_cast(`[`std::forward`](/reference/utility/forward.md)`(value))`とする。 diff --git a/reference/execution/execution/with-await-transform.md b/reference/execution/execution/with-await-transform.md index 6f8973a14e..ea25313480 100644 --- a/reference/execution/execution/with-await-transform.md +++ b/reference/execution/execution/with-await-transform.md @@ -23,7 +23,7 @@ namespace std::execution { decltype(auto) await_transform(T&& value) noexcept(noexcept(std::forward(value).as_awaitable(declval()))) { - return std::forward(value).as_awaitable(static_cast(*this)); + return std::forward(value).as_awaitable(static_cast(*this)); } }; } diff --git a/reference/execution/execution/write-env.md b/reference/execution/execution/write-env.md new file mode 100644 index 0000000000..e7e357de2d --- /dev/null +++ b/reference/execution/execution/write-env.md @@ -0,0 +1,59 @@ +# write-env +* execution[meta header] +* function template[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +template +constexpr auto write-env(Sndr&& sndr, Env&& env); // exposition only +``` + +## 概要 +`write-env`は、Senderアルゴリズム動作仕様定義で用いられる説明専用のSenderアダプタである。 + +[クエリ可能オブジェクト](../queryable.md)`env`と接続先[Receiver](receiver.md)の環境を合成した、新たなクエリ可能オブジェクトに関連付けれられたSenderを生成する。 + + +## 戻り値 +説明専用の`write-env-t`を空のクラスとしたとき、下記を返す。 + +```cpp +make-sender(write-env-t(), std::forward(env), std::forward(sndr)) +``` +* make-sender[link make-sender.md] + + +### Senderアルゴリズムタグ +Senderアルゴリズム動作説明用のクラステンプレート[`impls-for`](impls-for.md)に対して、下記の特殊化が定義される。 + +```cpp +template<> +struct impls-for : default-impls { + static constexpr auto get-env = + [](auto, const auto& state, const auto& rcvr) noexcept { + return see below; + }; +}; +``` +* impls-for[link impls-for.md] +* default-impls[link impls-for.md] +* see below[italic] + +`impls-for​::​get-env`メンバの呼び出しは下記を満たすオブジェクト`e`を返す。 + +- 型`decltype(e)`が[`queryable`](../queryable.md)のモデルであり、かつ +- 与えられた[クエリオブジェクト](../queryable.md)`q`に対して、式`e.query(q)`は式`state.query(q)`が有効ならばその式と等価。そうでなければ、式`e.query(q)`は[`get_env`](get_env.md)`(rcvr).query(q)`と等価。 + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`execution::on`](on.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/this_thread/sync-wait-env.md b/reference/execution/this_thread/sync-wait-env.md index 2d6ff12773..aa20456ceb 100644 --- a/reference/execution/this_thread/sync-wait-env.md +++ b/reference/execution/this_thread/sync-wait-env.md @@ -25,7 +25,7 @@ namespace std::this_thread { * get_scheduler()[link ../execution/run_loop/get_scheduler.md] ## 概要 -`sync-wait-env`は、実行制御ライブラリの仕様定義で用いられる説明専用のクラステンプレートである。 +`sync-wait-env`は、Senderアルゴリズム動作仕様定義で用いられる説明専用のクラステンプレートである。 Senderコンシューマ[`sync_wait`](sync_wait.md)、[`sync_wait_with_variant`](sync_wait_with_variant.md)動作において[Receiver](../execution/receiver.md)の[環境](../queryable.md)として利用される。 diff --git a/reference/execution/this_thread/sync-wait-receiver.md b/reference/execution/this_thread/sync-wait-receiver.md index 4599e85abf..b105d28147 100644 --- a/reference/execution/this_thread/sync-wait-receiver.md +++ b/reference/execution/this_thread/sync-wait-receiver.md @@ -37,7 +37,7 @@ namespace std::this_thread { * sync-wait-result-type[link sync_wait.md] ## 概要 -`sync-wait-receiver`および`sync-wait-state`は、実行制御ライブラリの仕様定義で用いられる説明専用のクラステンプレートである。 +`sync-wait-receiver`および`sync-wait-state`は、Senderアルゴリズム動作仕様定義で用いられる説明専用のクラステンプレートである。 Senderコンシューマ[`sync_wait`](sync_wait.md)動作において[Sender](../execution/sender.md)と[接続(connect)](../execution/connect.md)する[Receiver](../execution/receiver.md)、同Receiverの内部状態として利用される。 From ee11fa07069906abf782d1de8f101d27770da0b3 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 13 May 2025 18:12:09 +0900 Subject: [PATCH 1690/3948] execution/write-env: remove forbid chars --- reference/execution/execution/write-env.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/execution/execution/write-env.md b/reference/execution/execution/write-env.md index e7e357de2d..8b97ac73c6 100644 --- a/reference/execution/execution/write-env.md +++ b/reference/execution/execution/write-env.md @@ -40,7 +40,7 @@ struct impls-for : default-impls { * default-impls[link impls-for.md] * see below[italic] -`impls-for​::​get-env`メンバの呼び出しは下記を満たすオブジェクト`e`を返す。 +`impls-for::get-env`メンバの呼び出しは下記を満たすオブジェクト`e`を返す。 - 型`decltype(e)`が[`queryable`](../queryable.md)のモデルであり、かつ - 与えられた[クエリオブジェクト](../queryable.md)`q`に対して、式`e.query(q)`は式`state.query(q)`が有効ならばその式と等価。そうでなければ、式`e.query(q)`は[`get_env`](get_env.md)`(rcvr).query(q)`と等価。 From d26d5358721abc66d47653921598fc5270d1f3e6 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 14 May 2025 14:11:30 +0900 Subject: [PATCH 1691/3948] =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=83=91=E3=82=A4?= =?UTF-8?q?=E3=83=A9=E3=81=AE=E5=AE=9F=E8=A3=85=E7=8A=B6=E6=B3=81=20:=20Vi?= =?UTF-8?q?sual=20Studio=202022=2017.14=E3=81=AB=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 11 ++++++----- implementation.md | 8 +++++++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/implementation-status.md b/implementation-status.md index a375fee770..a15f7638b0 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -252,22 +252,22 @@ | P0847R7: [自身のオブジェクトを明示的にパラメータとして指定する](/lang/cpp23/deducing_this.md.nolink) | メンバ関数が`*this`の型・オブジェクトをパラメータとしてとり、`*this`オブジェクトがconst/非const、左辺値/右辺値であるかをメンバ関数内で識別できるようにする | - | 18 | - | 2022 Update 2 (partial) | | P1847R4: [アクセス制御の異なるメンバ変数のレイアウトを宣言順に規定](/lang/cpp23/make_declaration_order_layout_mandated.md) | アクセス制御の異なるメンバ変数のレイアウトは並び替えを許可されていたが宣言順に規定する | Yes | Yes | - | 2022 | | P2128R6: [添字演算子の多次元サポート](/lang/cpp23/multidimensional_subscript_operator.md) | `operator[](int x, int y, int z)`のように添字演算子のオーバーロードで複数のパラメータをとることを許可 | 12 | 15 | 2022.2 | 2022 Update 12 | -| P1169R4: [`this`ポインタをもつ必要のない演算子を`static`として宣言できるようにする](/lang/cpp23/static_operator.md) | 状態をもたないいくつかの演算子を`static`として宣言できるようにする | 13 | 16 | 2023.2 | - | +| P1169R4: [`this`ポインタをもつ必要のない演算子を`static`として宣言できるようにする](/lang/cpp23/static_operator.md) | 状態をもたないいくつかの演算子を`static`として宣言できるようにする | 13 | 16 | 2023.2 | 2022 Update 14 | | P2201R1: [異なる文字エンコーディングをもつ文字列リテラルの連結を不適格とする](/lang/cpp23/mixed_string_literal_concatenation.md) | `auto a = u8"" L"";`のような異なる文字エンコーディング同士での文字列リテラルを連結を禁止する | Yes | Yes | 2022.2 | Yes | | P2029R4: [文字・文字列リテラル中の数値・ユニバーサルキャラクタのエスケープに関する問題解決](/lang/cpp23/numeric_and_universal_character_escapes_in_character_and_string_literals.md.nolink) | | - | - | - | - | | P2362R3: [1ワイド文字に収まらないワイド文字リテラルを禁止する](/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md) | エンコード結果として`wchar_t`の大きさに収まらないワイド文字リテラルを禁止する | 13 | 14 | 2023.2 | - | | P2071R2: [名前付きユニバーサルキャラクタ名](/lang/cpp23/named_universal_character_escapes.md) | 16進数のユニバーサルキャラクタだけでなく、その文字の名前を入力できるようにする | 13 | 15 | 2023.2 | - | | P2096R2: [変数テンプレートの部分特殊化を許可](/lang/cpp23/generalized_wording_for_partial_specializations.md) | 変数テンプレートの部分特殊化を許可するために部分特殊化の仕様を汎用化 | - | - | - | - | | P2582R1: [継承コンストラクタからのクラステンプレート引数の推論](/lang/cpp23/class_template_argument_deduction_from_inherited.md) | 継承コンストラクタからもクラステンプレート引数を推論できるようにする | - | - | - | - | -| P1938R3: [`if consteval`](/lang/cpp23/if_consteval.md) | コンパイル時の文脈かどうかで分岐させる | 12 | 14 | - | - | -| P1401R5: [定数式の文脈での`bool`への縮小変換を許可](/lang/cpp23/narrowing_contextual_conversions_to_bool.md) | `if constexpr(flags & Flags::Exec)`や`static_assert(N);`を許可 | 9 | 13 | 2022.2 | - | +| P1938R3: [`if consteval`](/lang/cpp23/if_consteval.md) | コンパイル時の文脈かどうかで分岐させる | 12 | 14 | - | 2022 Update 14 | +| P1401R5: [定数式の文脈での`bool`への縮小変換を許可](/lang/cpp23/narrowing_contextual_conversions_to_bool.md) | `if constexpr(flags & Flags::Exec)`や`static_assert(N);`を許可 | 9 | 13 | 2022.2 | 2022 Update 14 | | P2242R3: [定数式内での非リテラル変数、静的変数・スレッドローカル変数およびgotoとラベルの存在を許可する](/lang/cpp23/non_literal_variables_in_constexpr_functions.md) | コンパイル時に評価されない限り、定数式内に静的変数・スレッドローカル変数およびgoto文とラベルを含むことを許可する | 12 | 15 | 2022.2 | 2022 Update 13 | | P2246R1: [静的な診断メッセージの文字エンコーディング](/lang/cpp23/character_encoding_of_diagnostic_text.md) | `static_assert`や`[[deprecated]]`などの診断メッセージの文字集合に関する要件をなくす | - | yes | 2022.2 | 2022 | | P2448R2: [`constexpr`関数が定数実行できない場合でも適格とする](/lang/cpp23/relaxing_some_constexpr_restrictions.md) | | 13 | 17 (partial) | 2024.0 (partial) | - | | P2647R1: [`constexpr`関数内での`static constexpr`変数を許可](/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md) | `constexpr`関数のローカルで定数を定義できるようにする | 13 | 16 | 2023.2 | - | | P2564R3: [`constexpr`関数内で`consteval`関数を呼び出せない問題を緩和](/lang/cpp23/consteval_needs_to_propagate_up.md) | `consteval`呼び出しを含む`constexpr`関数を条件付きで`consteval`関数とみなすようにする | - | 17 | 2024.0 | - | -| P1102R2: [ラムダ式で`()`を省略できる条件を緩和](/lang/cpp23/down_with_lambda_parens.md) | 修飾や戻り値型をともなってもパラメータリストが空であれば`()`を省略できる | 11 | 13 | 2022.2 | - | -| P2173R1: [ラムダ式に対する属性](/lang/cpp23/attributes_on_lambda_expressions.md) | ラムダ式のいくつかの箇所に属性を記述できるようにする | 9 | 13 | 2022.2 | - | +| P1102R2: [ラムダ式で`()`を省略できる条件を緩和](/lang/cpp23/down_with_lambda_parens.md) | 修飾や戻り値型をともなってもパラメータリストが空であれば`()`を省略できる | 11 | 13 | 2022.2 | 2022 Update 14 | +| P2173R1: [ラムダ式に対する属性](/lang/cpp23/attributes_on_lambda_expressions.md) | ラムダ式のいくつかの箇所に属性を記述できるようにする | 9 | 13 | 2022.2 | 2022 Update 14 | | P1774R8: [コード内容の仮定をコンパイラに伝えるassume属性](/lang/cpp23/portable_assumptions.md) | 最適化のために、コードの仮定をコンパイラに伝える属性を標準化する | 13 | 19 | - | - | | P2316R2: [文字リテラルエンコーディングを一貫させる](/lang/cpp23/consistent_character_literal_encoding.md) | プリプロセッサの条件式での文字リテラルの扱いをC++式と同様にする | yes | yes | 2022.2 | 2022 | | P2334R1: [`elif`/`elifdef`/`elifndef`のサポートを追加](/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md) | `#if`/`#ifdef`/`#ifndef`に対応する複数条件命令のサポートを追加する | 12 | 13 | 2022.2 | 2022 Update 10 | @@ -284,6 +284,7 @@ - [C++ Conformance improvements, behavior changes, and bug fixes in Visual Studio 2022](https://learn.microsoft.com/en-us/cpp/overview/cpp-conformance-improvements?view=msvc-170) - [C++ Language Updates in MSVC in Visual Studio 2022 17.13](https://devblogs.microsoft.com/cppblog/msvc-compiler-updates-in-visual-studio-2022-version-17-13/) - [MSVC Compiler Language Updates in Visual Studio 2022 version 17.12](https://devblogs.microsoft.com/cppblog/msvc-compiler-language-updates-in-visual-studio-2022-version-17-12/) + - [C++ Language Updates in MSVC in Visual Studio 2022 17.14](https://devblogs.microsoft.com/cppblog/c-language-updates-in-msvc-in-visual-studio-2022-17-14/) - ICX: [C++23 Features Supported by Intel® C++ Compiler](https://www.intel.com/content/www/us/en/developer/articles/technical/c23-features-supported-by-intel-c-compiler.html) diff --git a/implementation.md b/implementation.md index cd906e1a15..1f58099141 100644 --- a/implementation.md +++ b/implementation.md @@ -141,6 +141,7 @@ | 表記 | 製品名 [Visual Studio バージョン] †1 | VC++ バージョン †2 | `_MSC_VER` | `_MSC_FULL_VER` | |---------------|----------------------------------------|-----------------|------------|-----------------| +| 2022 Update 14 | Visual Studio 2022 Version 17.14.0 | | | | | 2022 Update 13 | Visual Studio 2022 Version 17.13.2 | 14.43 | 1943 | 194334808 | | 2022 Update 13 | Visual Studio 2022 Version 17.13.0 | 14.43 | 1943 | 194334808 | | 2022 Update 12 | Visual Studio 2022 Version 17.12.4 | 14.42 | 1942 | 194234436 | @@ -268,7 +269,12 @@ ### C++20の機能を有効にする -- 2019以降に実装された機能については、`/std:c++latest`オプションを使用する +- 2019 Update 11以降は`/std:c++23`オプションを使用する。それ以前は`/std:c++latest`オプションを使用する + + +### C++23の機能を有効にする + +- 2022 Update 14以降は`/std:c++23preview`オプションを使用する。それ以前は`/std:c++latest`オプションを使用する ### 最新バージョンの言語機能を有効にする From 9c1556ac4928691d6339c2045c19204303dceae0 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 14 May 2025 14:30:27 +0900 Subject: [PATCH 1692/3948] =?UTF-8?q?Visual=20Studio=202022=20Update=2014:?= =?UTF-8?q?=20VC++=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3=E3=81=A8?= =?UTF-8?q?=5FMSC=5FVER=E3=82=92=E5=9F=8B=E3=82=81=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/implementation.md b/implementation.md index 1f58099141..7d9ecf01ad 100644 --- a/implementation.md +++ b/implementation.md @@ -141,7 +141,7 @@ | 表記 | 製品名 [Visual Studio バージョン] †1 | VC++ バージョン †2 | `_MSC_VER` | `_MSC_FULL_VER` | |---------------|----------------------------------------|-----------------|------------|-----------------| -| 2022 Update 14 | Visual Studio 2022 Version 17.14.0 | | | | +| 2022 Update 14 | Visual Studio 2022 Version 17.14.0 | 14.44 | 1944 | | | 2022 Update 13 | Visual Studio 2022 Version 17.13.2 | 14.43 | 1943 | 194334808 | | 2022 Update 13 | Visual Studio 2022 Version 17.13.0 | 14.43 | 1943 | 194334808 | | 2022 Update 12 | Visual Studio 2022 Version 17.12.4 | 14.42 | 1942 | 194234436 | @@ -251,7 +251,8 @@ [Visual Studio 2015 の Visual C++](https://docs.microsoft.com/ja-JP/previous-versions/60k1461a(v=vs.140)?redirectedfrom=MSDN) の [警告] を参照。 - 2017 Update 5からside-by-sideがサポートされ、一つの製品内で同時に複数のVisual C++ツールセットを選択できるようになった。 [Side-by-side minor version MSVC toolsets in Visual Studio 2017 | Visual C++ Team Blog](https://blogs.msdn.microsoft.com/vcblog/2017/11/15/side-by-side-minor-version-msvc-toolsets-in-visual-studio-2017/) - +- コンパイラのバージョン情報は、以下のページで確認できる。 + [Microsoft Visual C++ compiler versioning](https://learn.microsoft.com/en-us/cpp/overview/compiler-versions) ### C++11の機能を有効にする From 8043d35a56076a5036c88dcf8acb41a56bf7b6fc Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 14 May 2025 15:27:50 +0900 Subject: [PATCH 1693/3948] =?UTF-8?q?flat=5Fmap=20:=20=E6=A6=82=E8=A6=81?= =?UTF-8?q?=E6=96=87=E7=AB=A0=E3=82=92=E8=BF=BD=E5=8A=A0=20#1448?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map.md | 37 ++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/reference/flat_map/flat_map.md b/reference/flat_map/flat_map.md index 584048a911..222468b993 100644 --- a/reference/flat_map/flat_map.md +++ b/reference/flat_map/flat_map.md @@ -18,6 +18,43 @@ namespace std { * vector[link /reference/vector/vector.md] ## 概要 +`std::flat_map`は、重複しない要素を格納する連想コンテナの一種であり、キーとそれに対応する値を格納する。 + +`std::flat_map`は、ノードベースで実装される[`std::map`](/reference/map/map.md)、ハッシュテーブルで実装される[`std::unordered_map`](/reference/unordered_map/unordered_map.md)とは異なり、ソート済み配列と二分探索の組み合わせで実装される。これはほかの実装と比較して、メモリ使用量と列挙速度において優位であり、一方で挿入速度と検索速度はほかの実装に劣る。 + +また、このクラスは分類としては[`std::queue`](/reference/queue/queue.md)や[`std::skack`](/reference/stack/stack.md)と同様のコンテナアダプタに分類され、キーの配列と値の配列の2つを内部で持ち、それを[`std::ranges::zip_view`](/reference/ranges/zip_view.md)で綴じあわせて扱う実装となっている。 + +このコンテナクラスは、ランダムアクセスイテレータをサポートする。 + + +### ほかの連想コンテナとの要件の違い +このクラスは要件として、コンテナクラスと、逆順コンテナクラスであることは満たすが、連想コンテナの要件としては以下を満たさない: + +- node handleに関する要件 +- イテレータ無効化に関する要件 +- 単一要素の挿入と削除に線形時間かかる (挿入位置のイテレータを指定したとしても) + +また、このコンテナはメモリアロケータを指定できない設計にもなっている。 + +`value_type`は、[`std::map`](/reference/map/map.md)では[`std::pair`](/reference/utility/pair.md)``だが、このクラスは[`std::pair`](/reference/utility/pair.md)``である (`const`がつかない)。 + +以下の不変条件をもち、メンバ関数のいずれかが例外によって終了した場合には不変条件の状態に復元される (ただし、その復元操作によってコンテナが空になる可能性がある): + +- キーの配列と値の配列が、同じ要素数をもつ +- キーの配列が、指定された比較関数オブジェクトを尊重してソートを行う +- 値の配列内のオフセット`off`の値は、キー配列内のオフセット`off`のキーに関連付けられた値である + + +## テンプレートパラメータ制約 +- `KeyContainer`と`MappedContainer`に指定するコンテナ型は、 + - シーケンスコンテナの要件を満たし、 + - ランダムアクセスイテレータをもち、 + - 例外を送出しないメンバ関数`size()`と`max_size()`をもつこと + + +## 適格要件 +- `Key`が`KeyContainer::value_type`と同じ型であること +- `T`が`MappedContainer::value_type`と同じ型であること ## メンバ関数 From 7ec528e2e1d007b5c761cbcfed5694063b3c8abc Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 14 May 2025 15:50:27 +0900 Subject: [PATCH 1694/3948] =?UTF-8?q?multimap=20:=20=E3=83=A6=E3=83=8B?= =?UTF-8?q?=E3=83=BC=E3=82=AF=20=E2=86=92=20=E5=90=8C=E4=B8=80=E3=82=AD?= =?UTF-8?q?=E3=83=BC=E3=81=AE=E8=A6=81=E7=B4=A0=E3=82=92=E8=A4=87=E6=95=B0?= =?UTF-8?q?=E6=A0=BC=E7=B4=8D=E3=81=A7=E3=81=8D=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/map/multimap.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/map/multimap.md b/reference/map/multimap.md index aece7355cf..caf7eaede9 100644 --- a/reference/map/multimap.md +++ b/reference/map/multimap.md @@ -36,7 +36,7 @@ namespace std { - `Allocator`: ストレージアロケーションモデルを決定づける、アロケータオブジェクトの型である。デフォルトでは、`pair` への [`allocator`](/reference/memory/allocator.md) クラステンプレート(これは値に依存しないシンプルなメモリ確保モデルを定義する)が使われる。 ## 概要 -`multimap` はユニークな要素を格納する連想コンテナの一種であり、キーとそれに対応する値を格納する。 +`multimap` は同一キーの要素を複数格納できる連想コンテナの一種であり、キーとそれに対応する値を格納する。 連想コンテナは特にそれらキーによる要素アクセスが効率的になるようよう設計されたコンテナである(要素への相対位置または絶対位置によるアクセスが効率的であるシーケンシャルコンテナとは異なる)。 From f5e7d4484f1748b98381c24f4a61ce37f57518d0 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 14 May 2025 15:51:47 +0900 Subject: [PATCH 1695/3948] =?UTF-8?q?map=20/=20multimap=20:=20=E6=A6=82?= =?UTF-8?q?=E8=A6=81=E3=81=AE=E4=B8=8A=E3=81=AB=E3=83=86=E3=83=B3=E3=83=97?= =?UTF-8?q?=E3=83=AC=E3=83=BC=E3=83=88=E3=83=91=E3=83=A9=E3=83=A1=E3=83=BC?= =?UTF-8?q?=E3=82=BF=E3=81=AE=E8=AA=AC=E6=98=8E=E3=81=8C=E3=81=82=E3=81=A3?= =?UTF-8?q?=E3=81=9F=E3=81=AE=E3=82=92=E6=A6=82=E8=A6=81=E3=81=AE=E4=B8=8B?= =?UTF-8?q?=E3=81=AB=E7=A7=BB=E5=8B=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/map/map.md | 18 ++++++++---------- reference/map/multimap.md | 16 ++++++++-------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/reference/map/map.md b/reference/map/map.md index b0996ee653..75c8b0825f 100644 --- a/reference/map/map.md +++ b/reference/map/map.md @@ -25,16 +25,6 @@ namespace std { * pair[link /reference/utility/pair.md] * polymorphic_allocator[link /reference/memory_resource/polymorphic_allocator.md] -`map` コンテナは 4 つのテンプレートパラメータを取る。 - -各テンプレートパラメータは以下のような意味である。 - -- `Key`: キーの型。キーの値の大小に従って自動的に並び替えられる。 -- `T`: 値の型。 -- `pair`: 要素の型。 -- `Compare`: 比較クラス。このクラスは 2 つの引数(同じ型)をとり `bool` 値を返す。[狭義の弱順序](/reference/algorithm.md#strict-weak-ordering)において `a` が `b` よりも前の場所に位置づけられる場合に `true` である。これはクラスが関数呼び出しオブジェクトを実装したクラスであっても良いし関数ポインタであっても良い(例は コンストラクタ を参照)。これは、`operator<()` を適用( `a < b` )したときと同じ値を返す `less` がデフォルトである。 -- `Allocator`: ストレージアロケーションモデルを決定づける、アロケータオブジェクトの型である。デフォルトでは、`pair` への [`allocator`](/reference/memory/allocator.md) クラステンプレート(これは値に依存しないシンプルなメモリ確保モデルを定義する)が使われる。 - ## 概要 `map` はユニークな要素を格納する連想コンテナの一種であり、キーとそれに対応する値を格納する。 @@ -52,6 +42,14 @@ namespace std { このコンテナクラスは、双方向イテレータをサポートする。 +## テンプレートパラメータ +- `Key`: キーの型。キーの値の大小に従って自動的に並び替えられる。 +- `T`: 値の型。 +- `pair`: 要素の型。 +- `Compare`: 比較クラス。このクラスは 2 つの引数(同じ型)をとり `bool` 値を返す。[狭義の弱順序](/reference/algorithm.md#strict-weak-ordering)において `a` が `b` よりも前の場所に位置づけられる場合に `true` である。これはクラスが関数呼び出しオブジェクトを実装したクラスであっても良いし関数ポインタであっても良い(例は コンストラクタ を参照)。これは、`operator<()` を適用( `a < b` )したときと同じ値を返す `less` がデフォルトである。 +- `Allocator`: ストレージアロケーションモデルを決定づける、アロケータオブジェクトの型である。デフォルトでは、`pair` への [`allocator`](/reference/memory/allocator.md) クラステンプレート(これは値に依存しないシンプルなメモリ確保モデルを定義する)が使われる。 + + ## メンバ関数 ### 構築・破棄 diff --git a/reference/map/multimap.md b/reference/map/multimap.md index caf7eaede9..e494b51b53 100644 --- a/reference/map/multimap.md +++ b/reference/map/multimap.md @@ -27,14 +27,6 @@ namespace std { `multimap` コンテナは 4 つのテンプレートパラメータを取る。 -各テンプレートパラメータは以下のような意味である。 - -- `Key`: キーの型。キーの値の大小に従って自動的に並び替えられる。 -- `T`: 値の型。 -- `pair`: 要素の型。 -- `Compare`: 比較クラス。このクラスは 2 つの引数(同じ型)をとり `bool` 値を返す。[狭義の弱順序](/reference/algorithm.md#strict-weak-ordering)において `a` が `b` よりも前の場所に位置づけられる場合に `true` である。これはクラスが関数呼び出しオブジェクトを実装したクラスであっても良いし関数ポインタであっても良い(例は コンストラクタ を参照)。これは、`operator<()` を適用( `a < b` )したときと同じ値を返す `less` がデフォルトである。 -- `Allocator`: ストレージアロケーションモデルを決定づける、アロケータオブジェクトの型である。デフォルトでは、`pair` への [`allocator`](/reference/memory/allocator.md) クラステンプレート(これは値に依存しないシンプルなメモリ確保モデルを定義する)が使われる。 - ## 概要 `multimap` は同一キーの要素を複数格納できる連想コンテナの一種であり、キーとそれに対応する値を格納する。 @@ -51,6 +43,14 @@ namespace std { このコンテナクラスは、双方向イテレータをサポートする。 +## テンプレートパラメータ +- `Key`: キーの型。キーの値の大小に従って自動的に並び替えられる。 +- `T`: 値の型。 +- `pair`: 要素の型。 +- `Compare`: 比較クラス。このクラスは 2 つの引数(同じ型)をとり `bool` 値を返す。[狭義の弱順序](/reference/algorithm.md#strict-weak-ordering)において `a` が `b` よりも前の場所に位置づけられる場合に `true` である。これはクラスが関数呼び出しオブジェクトを実装したクラスであっても良いし関数ポインタであっても良い(例は コンストラクタ を参照)。これは、`operator<()` を適用( `a < b` )したときと同じ値を返す `less` がデフォルトである。 +- `Allocator`: ストレージアロケーションモデルを決定づける、アロケータオブジェクトの型である。デフォルトでは、`pair` への [`allocator`](/reference/memory/allocator.md) クラステンプレート(これは値に依存しないシンプルなメモリ確保モデルを定義する)が使われる。 + + ## メンバ関数 ### 構築・破棄 From bfed2f08a048f683bae9c9c3c7cb845b51127ebc Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 14 May 2025 15:56:34 +0900 Subject: [PATCH 1696/3948] =?UTF-8?q?flat=5Fmultimap=20:=20=E6=A6=82?= =?UTF-8?q?=E8=A6=81=E6=96=87=E7=AB=A0=E3=82=92=E8=BF=BD=E5=8A=A0=20#1448?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_multimap.md | 37 +++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/reference/flat_map/flat_multimap.md b/reference/flat_map/flat_multimap.md index cc49593b5f..e4ef34f39d 100644 --- a/reference/flat_map/flat_multimap.md +++ b/reference/flat_map/flat_multimap.md @@ -18,6 +18,43 @@ namespace std { * vector[link /reference/vector/vector.md] ## 概要 +`flat_multimap` は同一キーの要素を複数格納できる連想コンテナの一種であり、キーとそれに対応する値を格納する。 + +`std::flat_multimap`は、ノードベースで実装される[`std::multimap`](/reference/map/multimap.md)、ハッシュテーブルで実装される[`std::unordered_multimap`](/reference/unordered_map/unordered_multimap.md)とは異なり、ソート済み配列と二分探索の組み合わせで実装される。これはほかの実装と比較して、メモリ使用量と列挙速度において優位であり、一方で挿入速度と検索速度はほかの実装に劣る。 + +また、このクラスは分類としては[`std::queue`](/reference/queue/queue.md)や[`std::skack`](/reference/stack/stack.md)と同様のコンテナアダプタに分類され、キーの配列と値の配列の2つを内部で持ち、それを[`std::ranges::zip_view`](/reference/ranges/zip_view.md)で綴じあわせて扱う実装となっている。 + +このコンテナクラスは、ランダムアクセスイテレータをサポートする。 + + +### ほかの連想コンテナとの要件の違い +このクラスは要件として、コンテナクラスと、逆順コンテナクラスであることは満たすが、連想コンテナの要件としては以下を満たさない: + +- node handleに関する要件 +- イテレータ無効化に関する要件 +- 単一要素の挿入と削除に線形時間かかる (挿入位置のイテレータを指定したとしても) + +また、このコンテナはメモリアロケータを指定できない設計にもなっている。 + +`value_type`は、[`std::multimap`](/reference/map/multimap.md)では[`std::pair`](/reference/utility/pair.md)``だが、このクラスは[`std::pair`](/reference/utility/pair.md)``である (`const`がつかない)。 + +以下の不変条件をもち、メンバ関数のいずれかが例外によって終了した場合には不変条件の状態に復元される (ただし、その復元操作によってコンテナが空になる可能性がある): + +- キーの配列と値の配列が、同じ要素数をもつ +- キーの配列が、指定された比較関数オブジェクトを尊重してソートを行う +- 値の配列内のオフセット`off`の値は、キー配列内のオフセット`off`のキーに関連付けられた値である + + +## テンプレートパラメータ制約 +- `KeyContainer`と`MappedContainer`に指定するコンテナ型は、 + - シーケンスコンテナの要件を満たし、 + - ランダムアクセスイテレータをもち、 + - 例外を送出しないメンバ関数`size()`と`max_size()`をもつこと + + +## 適格要件 +- `Key`が`KeyContainer::value_type`と同じ型であること +- `T`が`MappedContainer::value_type`と同じ型であること ## メンバ関数 From fb9b7a8dbb69406653571dd3f1950a53175d6aee Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 14 May 2025 16:21:55 +0900 Subject: [PATCH 1697/3948] =?UTF-8?q?set=20/=20multiset=20:=20=E3=80=8C?= =?UTF-8?q?=E9=9B=86=E5=90=88=E3=80=8D=E3=81=A8=E3=81=84=E3=81=86=E8=A8=80?= =?UTF-8?q?=E8=91=89=E3=81=8C=E3=81=A7=E3=81=A6=E3=81=8D=E3=81=A6=E3=81=84?= =?UTF-8?q?=E3=81=AA=E3=81=8B=E3=81=A3=E3=81=9F=E3=81=AE=E3=81=A7=E8=A3=9C?= =?UTF-8?q?=E8=B6=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/set/multiset.md | 6 +++--- reference/set/set.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/reference/set/multiset.md b/reference/set/multiset.md index 595668e353..8afb5598ea 100644 --- a/reference/set/multiset.md +++ b/reference/set/multiset.md @@ -19,8 +19,8 @@ namespace std { * allocator[link /reference/memory/allocator.md] * polymorphic_allocator[link /reference/memory_resource/polymorphic_allocator.md] - -`multiset` は連想コンテナの一種であり、要素自身がキーとなる。 +## 概要 +`multiset` は重複を許可する連想コンテナの一種であり、要素自身がキーとなる、集合を表すクラスである。 連想コンテナは特にそれらキーによる要素アクセスが効率的になるよう設計されたコンテナである(要素への相対位置または絶対位置によるアクセスが効率的であるシーケンシャルコンテナとは異なる)。 @@ -33,8 +33,8 @@ namespace std { このコンテナクラスは、双方向イテレータをサポートする。 -各テンプレートパラメータは以下のような意味である。 +## テンプレートパラメータ - `Key`: キーの型。このコンテナに格納されれる要素の型。`multiset` に格納される要素はそれぞれはキーでもある。 - `Compare`: 比較クラス。このクラスは 2 つの引数(同じ型であり、コンテナの要素型でもある)をとり `bool` 値を返す。[狭義の弱順序](/reference/algorithm.md#strict-weak-ordering)において `a` が `b` よりも前の場所に位置づけられる場合に `true` である。これはクラスが関数呼び出しオブジェクトを実装したクラスであっても良いし関数ポインタであっても良い(例は コンストラクタ を参照)。これは、`operator<()` を適用( `a < b` )したときと同じ値を返す [`less`](/reference/functional/less.md)`` がデフォルトである。 - `Allocator`: ストレージアロケーションモデルを決定づける、アロケータオブジェクトの型である。デフォルトでは、`Key` への [`allocator`](/reference/memory/allocator.md) クラステンプレート(これは値に依存しないシンプルなメモリ確保モデルを定義する)が使われる。 diff --git a/reference/set/set.md b/reference/set/set.md index e564e5944f..c1b6460fb4 100644 --- a/reference/set/set.md +++ b/reference/set/set.md @@ -19,8 +19,8 @@ namespace std { * allocator[link /reference/memory/allocator.md] * polymorphic_allocator[link /reference/memory_resource/polymorphic_allocator.md] - -`set` はユニークな要素を格納する連想コンテナの一種であり、要素自身がキーとなる。 +## 概要 +`set` はユニークな要素を格納する連想コンテナの一種であり、要素自身がキーとなる、集合を表すクラスである。 連想コンテナは特にそれらキーによる要素アクセスが効率的になるよう設計されたコンテナである(要素への相対位置または絶対位置によるアクセスが効率的であるシーケンシャルコンテナとは異なる)。 @@ -34,8 +34,8 @@ namespace std { このコンテナクラスは、双方向イテレータをサポートする。 -各テンプレートパラメータは以下のような意味である。 +## テンプレートパラメータ - `Key`: キーの型。このコンテナに格納されれる要素の型。`set` に格納される要素はそれぞれはキーでもある。 - `Compare`: 比較クラス。このクラスは 2 つの引数(同じ型であり、コンテナの要素型でもある)をとり `bool` 値を返す。[狭義の弱順序](/reference/algorithm.md#strict-weak-ordering)において `a` が `b` よりも前の場所に位置づけられる場合に `true` である。これはクラスが関数呼び出しオブジェクトを実装したクラスであっても良いし関数ポインタであっても良い(例は コンストラクタ を参照)。これは、`operator<()` を適用( `a < b` )したときと同じ値を返す [`less`](/reference/functional/less.md)`` がデフォルトである。 - `Allocator`: ストレージアロケーションモデルを決定づける、アロケータオブジェクトの型である。デフォルトでは、`Key` への [`allocator`](/reference/memory/allocator.md) クラステンプレート(これは値に依存しないシンプルなメモリ確保モデルを定義する)が使われる。 From f529f5d9fea79c03660a64477e0afacfc787351a Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 14 May 2025 16:24:04 +0900 Subject: [PATCH 1698/3948] =?UTF-8?q?flat=5Fset=20/=20flat=5Fmultiset=20:?= =?UTF-8?q?=20=E6=A6=82=E8=A6=81=E6=96=87=E7=AB=A0=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=20#1448?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_set/flat_multiset.md | 26 ++++++++++++++++++++++++++ reference/flat_set/flat_set.md | 26 ++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/reference/flat_set/flat_multiset.md b/reference/flat_set/flat_multiset.md index 60d49067e1..5c10721b4d 100644 --- a/reference/flat_set/flat_multiset.md +++ b/reference/flat_set/flat_multiset.md @@ -16,6 +16,32 @@ namespace std { * vector[link /reference/vector/vector.md] ## 概要 +`std::flat_multiset`は、重複する要素を許可する連想コンテナの一種であり、要素自身がキーとなる、集合を表すクラスである。 + +`std::flat_multiset`は、ノードベースで実装される[`std::multiset`](/reference/set/multiset.md)、ハッシュテーブルで実装される[`std::unordered_multiset`](/reference/unordered_set/unordered_multiset.md)とは異なり、ソート済み配列と二分探索の組み合わせで実装される。これはほかの実装と比較して、メモリ使用量と列挙速度において優位であり、一方で挿入速度と検索速度はほかの実装に劣る。 + +また、このクラスは分類としては[`std::queue`](/reference/queue/queue.md)や[`std::skack`](/reference/stack/stack.md)と同様のコンテナアダプタに分類され、キーの配列をラップして扱う実装となっている。 + +このコンテナクラスは、ランダムアクセスイテレータをサポートする。 + + +### ほかの連想コンテナとの要件の違い +このクラスは要件として、コンテナクラスと、逆順コンテナクラスであることは満たすが、連想コンテナの要件としては以下を満たさない: + +- node handleに関する要件 +- イテレータ無効化に関する要件 +- 単一要素の挿入と削除に線形時間かかる (挿入位置のイテレータを指定したとしても) + +また、このコンテナはメモリアロケータを指定できない設計にもなっている。 + +## テンプレートパラメータ制約 +- `KeyContainer`に指定するコンテナ型は、 + - シーケンスコンテナの要件を満たし、 + - ランダムアクセスイテレータをもつこと + + +## 適格要件 +- `Key`が`KeyContainer::value_type`と同じ型であること ## メンバ関数 diff --git a/reference/flat_set/flat_set.md b/reference/flat_set/flat_set.md index ece18174ac..50e95d4bdb 100644 --- a/reference/flat_set/flat_set.md +++ b/reference/flat_set/flat_set.md @@ -16,6 +16,32 @@ namespace std { * vector[link /reference/vector/vector.md] ## 概要 +`std::flat_set`は、重複しない要素を格納する連想コンテナの一種であり、要素自身がキーとなる、集合を表すクラスである。 + +`std::flat_set`は、ノードベースで実装される[`std::set`](/reference/set/set.md)、ハッシュテーブルで実装される[`std::unordered_set`](/reference/unordered_set/unordered_set.md)とは異なり、ソート済み配列と二分探索の組み合わせで実装される。これはほかの実装と比較して、メモリ使用量と列挙速度において優位であり、一方で挿入速度と検索速度はほかの実装に劣る。 + +また、このクラスは分類としては[`std::queue`](/reference/queue/queue.md)や[`std::skack`](/reference/stack/stack.md)と同様のコンテナアダプタに分類され、キーの配列をラップして扱う実装となっている。 + +このコンテナクラスは、ランダムアクセスイテレータをサポートする。 + + +### ほかの連想コンテナとの要件の違い +このクラスは要件として、コンテナクラスと、逆順コンテナクラスであることは満たすが、連想コンテナの要件としては以下を満たさない: + +- node handleに関する要件 +- イテレータ無効化に関する要件 +- 単一要素の挿入と削除に線形時間かかる (挿入位置のイテレータを指定したとしても) + +また、このコンテナはメモリアロケータを指定できない設計にもなっている。 + +## テンプレートパラメータ制約 +- `KeyContainer`に指定するコンテナ型は、 + - シーケンスコンテナの要件を満たし、 + - ランダムアクセスイテレータをもつこと + + +## 適格要件 +- `Key`が`KeyContainer::value_type`と同じ型であること ## メンバ関数 From 344ed2d0d4a23922cadecce19bc74dcb03ab8c94 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 15 May 2025 11:48:50 +0900 Subject: [PATCH 1699/3948] =?UTF-8?q?=E7=94=A8=E8=AA=9E=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=EF=BC=9A=20=E3=82=B3=E3=83=B3=E3=83=86=E3=83=8A=E3=82=A2?= =?UTF-8?q?=E3=83=80=E3=83=97=E3=82=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_DEFINED_WORDS.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/GLOBAL_DEFINED_WORDS.json b/GLOBAL_DEFINED_WORDS.json index 35068574c3..d80cd9ebc1 100644 --- a/GLOBAL_DEFINED_WORDS.json +++ b/GLOBAL_DEFINED_WORDS.json @@ -118,6 +118,10 @@ "yomi": "えらーじょうけん", "desc": "関数等の意味論を構成する要素の1つ。Error conditions。関数が各エラーコードを返す条件" }, + "コンテナアダプタ": { + "yomi": "コンテナアダプタ", + "desc": "コンテナをラップしたクラス。一部のコンテナインタフェースをもたない場合がある" + }, "イテレータ範囲": { "yomi": "いてれーたはんい", "desc": "2つのイテレータで表現される半開区間を表す。C++20からイテレータと番兵で異なる型であっても指定可能になる" From b1ce4365524d542e92d772ce35a6d422cd7463eb Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 15 May 2025 12:25:06 +0900 Subject: [PATCH 1700/3948] =?UTF-8?q?move=5Fiterator=20:=20=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=90=E5=9E=8B=E3=81=AE=E8=A1=A8=E3=82=92=E6=95=B4?= =?UTF-8?q?=E7=90=86=E3=81=97=E3=81=A6=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7?= =?UTF-8?q?=E3=83=B3=E5=B7=AE=E7=95=B0=E3=81=8C=E3=81=82=E3=82=8B=E3=82=82?= =?UTF-8?q?=E3=81=AE=E3=81=AF=E5=80=8B=E5=88=A5=E3=83=9A=E3=83=BC=E3=82=B8?= =?UTF-8?q?=E3=82=92=E7=94=A8=E6=84=8F=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 4 +++ reference/iterator/move_iterator.md | 32 +++++++------------ .../move_iterator/type-deferrence_type.md | 22 +++++++++++++ .../move_iterator/type-iterator_category.md | 27 ++++++++++++++++ .../move_iterator/type-iterator_concept.md | 21 ++++++++++++ .../iterator/move_iterator/type-reference.md | 22 +++++++++++++ .../iterator/move_iterator/type-value_type.md | 22 +++++++++++++ 7 files changed, 129 insertions(+), 21 deletions(-) create mode 100644 reference/iterator/move_iterator/type-deferrence_type.md create mode 100644 reference/iterator/move_iterator/type-iterator_category.md create mode 100644 reference/iterator/move_iterator/type-iterator_concept.md create mode 100644 reference/iterator/move_iterator/type-reference.md create mode 100644 reference/iterator/move_iterator/type-value_type.md diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 1ad95101e9..c5e3a856dd 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -149,6 +149,10 @@ * indirect_unary_predicate[link /reference/iterator/indirect_unary_predicate.md] * indirectly_comparable[link /reference/iterator/indirectly_comparable.md] * input_iterator[link /reference/iterator/input_iterator.md] + * iterator_traits[link /reference/iterator/iterator_traits.md] + * iter_difference_t[link /reference/iterator/iter_difference_t.md] + * iter_rvalue_reference_t[link /reference/iterator/iter_rvalue_reference_t.md] + * iter_value_t[link reference/iterator/iter_value_t.md] * output_iterator[link /reference/iterator/output_iterator.md] * projected[link /reference/iterator/projected.md] * random_access_iterator[link /reference/iterator/random_access_iterator.md] diff --git a/reference/iterator/move_iterator.md b/reference/iterator/move_iterator.md index 56f23972f4..29b57543f5 100644 --- a/reference/iterator/move_iterator.md +++ b/reference/iterator/move_iterator.md @@ -42,28 +42,15 @@ namespace std { ## メンバ型 -### C++17まで - -| 名前 | 説明 | 対応バージョン | -|------------------------------------------------------|-------------|-------| -| `iterator_type` | `Iterator` | C++11 | -| `difference_type` | [`iterator_traits`](/reference/iterator/iterator_traits.md)`::difference_type` | C++11 | -| `pointer` | `Iterator` | C++11 | -| `value_type` | [`iterator_traits`](/reference/iterator/iterator_traits.md)`::value_type` | C++11 | -| `iterator_category` | [`iterator_traits`](/reference/iterator/iterator_traits.md)`::iterator_category` | C++11 | -| `reference` | `value_type&&` | C++11 | - -### C++20 - | 名前 | 説明 | 対応バージョン | |------------------------------------------------------|-------------|-------| -| `iterator_type` | `Iterator` | C++11 | -| `difference_type` | [`iter_difference_t`](/reference/iterator/iter_difference_t.md)`` | C++20 | -| `pointer` | `Iterator` | C++11 | -| `value_type` | [`iter_value_t`](/reference/iterator/iter_value_t.md)`` | C++20 | -| `iterator_category` | [`iterator_traits`](/reference/iterator/iterator_traits.md)`::iterator_category`
ただし、[`contiguous_iterator_tag`](/reference/iterator/iterator_tag.md)となるときは`random_access_iterator_tag` | C++20 | -| `iterator_concept` | [`input_iterator_tag`](/reference/iterator/iterator_tag.md) | C++20 | -| `reference` | [`iter_rvalue_reference_t`](/reference/iterator/iter_rvalue_reference_t.md)`` | C++20 | +| `iterator_type` | 元となるイテレータ型 `Iterator` | C++11 | +| [`difference_type`](move_iterator/type-deferrence_type.md) | イテレータ間の差を表す数値型 | C++11 | +| `pointer` | ポインタ型 `Iterator` | C++11 | +| [`value_type`](move_iterator/type-value_type.md) | イテレータが指す値型 | C++11 | +| [`iterator_category`](move_iterator/type-iterator_category.md) | イテレータの分類を表す型 | C++11 | +| [`iterator_concept`](move_iterator/type-iterator_concept.md) | イテレータコンセプトを表す型 | C++20 | +| [`reference`](move_iterator/type-reference.md) | イテレータを間接参照する型 | C++11 | ## 非メンバ関数 @@ -137,6 +124,9 @@ int main() - [Visual C++](/implementation.md#visual_cpp): ?? -## 参照 +## 関連項目 - [C++11 右辺値参照・ムーブセマンティクス](/lang/cpp11/rvalue_ref_and_move_semantics.md) + + +## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/iterator/move_iterator/type-deferrence_type.md b/reference/iterator/move_iterator/type-deferrence_type.md new file mode 100644 index 0000000000..1278ae8d02 --- /dev/null +++ b/reference/iterator/move_iterator/type-deferrence_type.md @@ -0,0 +1,22 @@ +# deferrence_type +* iterator[meta header] +* std[meta namespace] +* move_iterator[meta class] +* type-alias[meta id-type] +* cpp11[meta cpp] + +```cpp +using difference_type = iterator_traits::difference_type; // (1) C++11 +using difference_type = iter_difference_t; // (1) C++20 +``` + +## 概要 +イテレータの差を表す型。 + + +## バージョン +### 言語 +- C++11 + +## 参照 +- [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/iterator/move_iterator/type-iterator_category.md b/reference/iterator/move_iterator/type-iterator_category.md new file mode 100644 index 0000000000..a7cbce2471 --- /dev/null +++ b/reference/iterator/move_iterator/type-iterator_category.md @@ -0,0 +1,27 @@ +# iterator_category +* iterator[meta header] +* std[meta namespace] +* move_iterator[meta class] +* type-alias[meta id-type] +* cpp11[meta cpp] + +```cpp +using iterator_category = 以下参照; // (1) C++11 +``` + +## 概要 +イテレータの分類を表す型。 + +- C++11: + - [`iterator_traits`](/reference/iterator/iterator_traits.md)`::iterator_category` +- C++20: + - [`iterator_traits`](/reference/iterator/iterator_traits.md)`::iterator_category` + - ただし、[`contiguous_iterator_tag`](/reference/iterator/iterator_tag.md)となる場合は[`random_access_iterator_tag`](/reference/iterator/iterator_tag.md) + + +## バージョン +### 言語 +- C++11 + +## 参照 +- [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/iterator/move_iterator/type-iterator_concept.md b/reference/iterator/move_iterator/type-iterator_concept.md new file mode 100644 index 0000000000..0df1bcae24 --- /dev/null +++ b/reference/iterator/move_iterator/type-iterator_concept.md @@ -0,0 +1,21 @@ +# iterator_concept +* iterator[meta header] +* std[meta namespace] +* move_iterator[meta class] +* type-alias[meta id-type] +* cpp20[meta cpp] + +```cpp +using iterator_concept = input_iterator_tag; // (1) C++20 +``` +* input_iterator_tag[link /reference/iterator/iterator_tag.md] + +## 概要 +イテレータコンセプトを表す型。 + +## バージョン +### 言語 +- C++20 + +## 参照 +- [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/iterator/move_iterator/type-reference.md b/reference/iterator/move_iterator/type-reference.md new file mode 100644 index 0000000000..2b96ab2d1b --- /dev/null +++ b/reference/iterator/move_iterator/type-reference.md @@ -0,0 +1,22 @@ +# reference +* iterator[meta header] +* std[meta namespace] +* move_iterator[meta class] +* type-alias[meta id-type] +* cpp11[meta cpp] + +```cpp +using difference_type = value_type&&; // (1) C++11 +using difference_type = iter_rvalue_reference_t; // (1) C++20 +``` + +## 概要 +イテレータを間接参照する型。 + + +## バージョン +### 言語 +- C++11 + +## 参照 +- [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/iterator/move_iterator/type-value_type.md b/reference/iterator/move_iterator/type-value_type.md new file mode 100644 index 0000000000..983dd2b733 --- /dev/null +++ b/reference/iterator/move_iterator/type-value_type.md @@ -0,0 +1,22 @@ +# value_type +* iterator[meta header] +* std[meta namespace] +* move_iterator[meta class] +* type-alias[meta id-type] +* cpp11[meta cpp] + +```cpp +using difference_type = iterator_traits::value_type; // (1) C++11 +using difference_type = iter_value_t; // (1) C++20 +``` + +## 概要 +イテレータが指す値型。 + + +## バージョン +### 言語 +- C++11 + +## 参照 +- [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) From c698466afe668ebd1f9e62d855ad04ca4586a67d Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 15 May 2025 12:31:03 +0900 Subject: [PATCH 1701/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=83=9F?= =?UTF-8?q?=E3=82=B9=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index c5e3a856dd..708e0af4a6 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -152,7 +152,7 @@ * iterator_traits[link /reference/iterator/iterator_traits.md] * iter_difference_t[link /reference/iterator/iter_difference_t.md] * iter_rvalue_reference_t[link /reference/iterator/iter_rvalue_reference_t.md] - * iter_value_t[link reference/iterator/iter_value_t.md] + * iter_value_t[link /reference/iterator/iter_value_t.md] * output_iterator[link /reference/iterator/output_iterator.md] * projected[link /reference/iterator/projected.md] * random_access_iterator[link /reference/iterator/random_access_iterator.md] From 2d8141892da0c3ada9b1835e213d303a89e10c41 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 15 May 2025 12:38:56 +0900 Subject: [PATCH 1702/3948] =?UTF-8?q?move=5Fiterator::iterator=5Fconcept?= =?UTF-8?q?=20:=20C++23=E5=AF=BE=E5=BF=9C=20(close=20#1099)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../move_iterator/type-iterator_concept.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/reference/iterator/move_iterator/type-iterator_concept.md b/reference/iterator/move_iterator/type-iterator_concept.md index 0df1bcae24..297c74b203 100644 --- a/reference/iterator/move_iterator/type-iterator_concept.md +++ b/reference/iterator/move_iterator/type-iterator_concept.md @@ -6,16 +6,26 @@ * cpp20[meta cpp] ```cpp -using iterator_concept = input_iterator_tag; // (1) C++20 +using iterator_concept = 以下参照; // (1) C++20 ``` -* input_iterator_tag[link /reference/iterator/iterator_tag.md] ## 概要 イテレータコンセプトを表す型。 +- C++20: + - [`input_iterator_tag`](/reference/iterator/iterator_tag.md) +- C++23: + - `Iterator`が[`random_access_iterator`](/reference/iterator/random_access_iterator.md)コンセプトのモデルである場合、[`random_access_iterator_tag`](/reference/iterator/iterator_tag.md) + - `Iterator`が[`bidirectional_iterator`](/reference/iterator/bidirectional_iterator.md)コンセプトのモデルである場合、[`bidirectional_iterator_tag`](/reference/iterator/iterator_tag.md) + - `Iterator`が[`forward_iterator`](/reference/iterator/forward_iterator.md)コンセプトのモデルである場合、[`forward_iterator_tag`](/reference/iterator/iterator_tag.md) + - そうでない場合、[`input_iterator_tag`](/reference/iterator/iterator_tag.md) + + ## バージョン ### 言語 - C++20 ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P2520R0 `move_iterator` should be a random access iterator](https://wg21.link/p2520r0) + - C++23で`iterator_concept`がランダムアクセスイテレータにできるようになった From 676aba0cd327f2f742d2d3f3bb89c29e08247b74 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 15 May 2025 14:13:05 +0900 Subject: [PATCH 1703/3948] =?UTF-8?q?ignore=20:=20C++26=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=E3=81=A8=E3=81=97=E3=81=A6=E8=A9=B3=E7=B4=B0=E3=81=AA=E5=AE=9A?= =?UTF-8?q?=E7=BE=A9=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=97=E3=80=81=E4=BE=8B?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20(close=20#1315)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tieページのignoreに関する記述は、とくに消さなくても問題なさそうだったのでそのまま --- lang/cpp26/nice_placeholder_with_no_name.md | 1 + reference/tuple/ignore.md | 72 ++++++++++++++++++++- reference/tuple/tie.md | 1 + 3 files changed, 71 insertions(+), 3 deletions(-) diff --git a/lang/cpp26/nice_placeholder_with_no_name.md b/lang/cpp26/nice_placeholder_with_no_name.md index 8e36638dca..e26b125873 100644 --- a/lang/cpp26/nice_placeholder_with_no_name.md +++ b/lang/cpp26/nice_placeholder_with_no_name.md @@ -86,6 +86,7 @@ int main() { ## 関連項目 - [C++17 `[[maybe_unused]]`属性](/lang/cpp17/maybe_unused.md) +- [`std::ignore`](/reference/tuple/ignore.md) ## 参照 - [P2169R4 A nice placeholder with no name](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2169r4.pdf) diff --git a/reference/tuple/ignore.md b/reference/tuple/ignore.md index 46b212ca59..8d3d8a3bcd 100644 --- a/reference/tuple/ignore.md +++ b/reference/tuple/ignore.md @@ -6,8 +6,15 @@ ```cpp namespace std { - const unspecified ignore; // C++11 - inline constexpr unspecified ignore; // C++17 + struct ignore-type { // 説明用の定義 (C++26) + constexpr const ignore-type& + operator=(const auto &) const noexcept + { return *this; } + }; + + const unspecified ignore; // (1) C++11 + inline constexpr unspecified ignore; // (1) C++17 + inline constexpr ignore-type ignore; // (1) C++26 } ``` * unspecified[italic] @@ -15,7 +22,61 @@ namespace std { ## 概要 `ignore`は、[`tie()`](tie.md)を使用してタプルから値を抽出する際に、「不要な値」をマーキングするためのプレースホルダーである。 -使用例は[`tie()`](tie.md)を参照。 +そのほか、関数の戻り値を明示的に無視する際にも使用できる。 + +C++26以降は、[``](/reference/utility.md)をインクルードして使用することもできる。 + + +## 例 +### タプルの要素を取り出す際に一部の要素を無視する +```cpp example +#include +#include +#include + +std::tuple f() +{ + return {1, 'a', "hello"}; +} + +int main() { + // char要素は無視する + int a; + std::string c; + std::tie(a, std::ignore, c) = f(); + + std::cout << a << std::endl; + std::cout << c << std::endl; +} +``` +* std::ignore[color ff0000] + +#### 出力 +``` +1 +hello +``` + +### 関数の戻り値を無視する (C++17) +```cpp example +#include +#include +#include + +[[nodiscard]] +int print_string(std::string s) +{ + std::cout << s << std::endl; + return 0; +} + +int main() { + // 自分の用途ではこの関数は必ず成功するため、 + // 戻り値を無視する + std::ignore = print_string("hello"); +} +``` +* std::ignore[color ff0000] ## バージョン @@ -33,4 +94,9 @@ namespace std { - [`std::make_tuple`](make_tuple.md) - [`std::forward_as_tuple`](forward_as_tuple.md) - [`std::tie`](tie.md) +- [C++17 `[[nodiscard]]`属性](/lang/cpp17/nodiscard.md) +- [C++26 宣言のみで使用しない変数の名前として`_`をサポート](/lang/cpp26/nice_placeholder_with_no_name.md) + +## 参照 +- [P2968R2 Make `std::ignore` a first-class object](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2968r2.html) diff --git a/reference/tuple/tie.md b/reference/tuple/tie.md index 255593bd64..949b3494c6 100644 --- a/reference/tuple/tie.md +++ b/reference/tuple/tie.md @@ -160,4 +160,5 @@ text, b.txt ## 参照 - [LWG2301 Why is std::tie not constexpr?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#2301) +- [P2968R2 Make `std::ignore` a first-class object](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2968r2.html) From c036064051b5a5985af8b5f9777772c65eb8016f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 15 May 2025 15:31:22 +0900 Subject: [PATCH 1704/3948] =?UTF-8?q?map::operator[=20]=E3=81=A8at=20:=20C?= =?UTF-8?q?++26=E5=AF=BE=E5=BF=9C=E3=81=A8=E3=81=97=E3=81=A6=E7=95=B0?= =?UTF-8?q?=E7=A8=AE=E6=B7=B7=E5=90=88=E3=83=AB=E3=83=83=E3=82=AF=E3=82=A2?= =?UTF-8?q?=E3=83=83=E3=83=97=E3=81=AB=E5=AF=BE=E5=BF=9C=20#1189?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/map/map/at.md | 38 +++++++++++++++++++++++++++++++++----- reference/map/map/op_at.md | 20 ++++++++++++++++++++ 2 files changed, 53 insertions(+), 5 deletions(-) diff --git a/reference/map/map/at.md b/reference/map/map/at.md index 16eccbdf4b..fc8ffd2472 100644 --- a/reference/map/map/at.md +++ b/reference/map/map/at.md @@ -6,23 +6,49 @@ * cpp11[meta cpp] ```cpp -T& at(const key_type& x); -const T& at(const key_type & x) const; +T& at(const key_type& x); // (1) C++11 +const T& at(const key_type & x) const; // (2) C++11 + +template +mapped_type& at(const K& x); // (3) C++26 +template +const mapped_type& at(const K& x) const; // (4) C++26 ``` ## 概要 指定したキーを持つ要素を取得する。 -要素を取り出す際にキーの存在チェックをする。 +[`operator[]`](op_at.md)と違って、要素を取り出す際にキーに対応する値がなければ例外が送出される。 + +- (1), (2) : クラスのテンプレートパラメータ`key_type`型のキーに対応する要素を取得する +- (3), (4) : `key_type`と比較可能な`K`型のキーに対応する要素を取得する + + +## テンプレートパラメータ制約 +- (3), (4) : `key_compare::is_transparent` が妥当な式であること + + +## 事前条件 +- (3), (4) : [`find`](find.md)`(x)`が妥当な式であり、定義された動作をすること ## 戻り値 -キー`x`に対応する値を返す。対応する要素が存在しないときは、[`out_of_range`](/reference/stdexcept.md)例外を投げる。 +キー`x`に対応する値を返す。 ## 計算量 要素数に対して対数時間 +## 例外 +- 対応する要素が存在しない場合、[`std::out_of_range`](/reference/stdexcept.md)例外を送出する + + +## 備考 +- (3), (4) : + - `is_transparent`は、標準ライブラリの[`std::less`](/reference/functional/less.md)、[`std::greater`](/reference/functional/greater.md)といった関数オブジェクトの、`void`に対する特殊化で定義される。それ以外のテンプレートパラメータで`is_transparent`が定義されないのは、互換性のためである。 + - これらのオーバーロードは、`map`のようなコンテナに対し、検索操作で文字列リテラルを渡した際に、キー型の一時オブジェクトが生成されるコストを減らすためにある。 + + ## 例 ```cpp example #include @@ -78,4 +104,6 @@ exception std::out_of_range ## 参照 - [LWG Issue 464. Suggestion for new member functions in standard containers](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#464) - +## 参照 +- [P2363R5 Extending associative containers with the remaining heterogeneous overloads](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2363r5.html) + - C++26で`template `のバージョンが追加された diff --git a/reference/map/map/op_at.md b/reference/map/map/op_at.md index 99d6e53ee8..eb7b29d3c8 100644 --- a/reference/map/map/op_at.md +++ b/reference/map/map/op_at.md @@ -6,12 +6,23 @@ ```cpp T& operator[](const key_type& x); // (1) C++03 + T& operator[](key_type&& x); // (2) C++11 + +template +T& operator[](K&& x); // (3) C++26 ``` ## 概要 指定したキーを持つ要素を取得する。対応する要素が存在しない場合は生成して返す。 +- (1), (2) : クラスのテンプレートパラメータ`key_type`型のキーに対応する要素を取得する +- (3) : `key_type`と比較可能な`K`型のキーに対応する要素を取得する + + +## テンプレートパラメータ制約 +- (3) : `key_compare::is_transparent` が妥当な式であること + ## 戻り値 キー`x`に対応する値を返す。対応する要素が存在しない場合は、要素を値初期化して参照を返す。 @@ -21,6 +32,12 @@ T& operator[](key_type&& x); // (2) C++11 要素数に対して対数時間 +## 備考 +- (3) : + - `is_transparent`は、標準ライブラリの[`std::less`](/reference/functional/less.md)、[`std::greater`](/reference/functional/greater.md)といった関数オブジェクトの、`void`に対する特殊化で定義される。それ以外のテンプレートパラメータで`is_transparent`が定義されないのは、互換性のためである。 + - これらのオーバーロードは、`map`のようなコンテナに対し、検索操作で文字列リテラルを渡した際に、キー型の一時オブジェクトが生成されるコストを減らすためにある。 + + ## 例 ```cpp example #include @@ -56,3 +73,6 @@ a | [`insert`](insert.md) | 要素を挿入する | +## 参照 +- [P2363R5 Extending associative containers with the remaining heterogeneous overloads](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2363r5.html) + - C++26で`template `のバージョンが追加された From c0573256bbe5a21bdf1c2d073a17b679eb27b092 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 15 May 2025 15:51:25 +0900 Subject: [PATCH 1705/3948] =?UTF-8?q?map::try=5Femplace=20:=20C++26?= =?UTF-8?q?=E3=81=AE=E7=95=B0=E7=A8=AE=E6=B7=B7=E5=90=88=E3=83=AB=E3=83=83?= =?UTF-8?q?=E3=82=AF=E3=82=A2=E3=83=83=E3=83=97=E3=81=AB=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=20#1189?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/map/map/try_emplace.md | 59 +++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 20 deletions(-) diff --git a/reference/map/map/try_emplace.md b/reference/map/map/try_emplace.md index f43067b02d..7bb94f5dda 100644 --- a/reference/map/map/try_emplace.md +++ b/reference/map/map/try_emplace.md @@ -7,16 +7,34 @@ ```cpp template -pair try_emplace(const key_type& k, Args&&... args); // (1) +pair + try_emplace(const key_type& k, Args&&... args); // (1) C++17 template -pair try_emplace(key_type&& k, Args&&... args); // (2) +pair + try_emplace(key_type&& k, Args&&... args); // (2) C++17 template -iterator try_emplace(const_iterator hint, const key_type& k, Args&&... args); // (3) +iterator + try_emplace(const_iterator hint, + const key_type& k, + Args&&... args); // (3) C++17 template -iterator try_emplace(const_iterator hint, key_type&& k, Args&&... args); // (4) +iterator + try_emplace(const_iterator hint, + key_type&& k, + Args&&... args); // (4) C++17 + +template +pair + try_emplace(K&& k, Args&&... args); // (5) C++26 + +template +iterator + try_emplace(const_iterator hint, + K&& k, + Args&&... args); // (6) C++26 ``` * pair[link /reference/utility/pair.md] @@ -32,44 +50,43 @@ iterator try_emplace(const_iterator hint, key_type&& k, Args&&... args); - (2) : 指定された一時オブジェクトのキーが存在しない場合に、要素を直接構築で挿入する - (3) : キーを検索するヒントを指定し、指定されたキーが存在しない場合に、要素を直接構築で挿入する - (4) : キーを検索するヒントを指定し、指定された一時オブジェクトのキーが存在しない場合に、要素を直接構築で挿入する +- (5) : `key_type`型と比較可能なキーが存在しない場合に、要素を直接構築で挿入する +- (6) : キーを検索するヒントを指定し、指定された`key_type`型と比較可能なキーが存在しない場合に、要素を直接構築で挿入する ## テンプレートパラメータ制約 -- (1)、(3) : `value_type` は、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(k)`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から `map` に直接構築可能であること -- (2)、(4) : `value_type` は、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`move`](/reference/utility/move.md)`(k))`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から `map` に直接構築可能であること +- (1)、(3)、(5) : `value_type` は、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(k)`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から `map` に直接構築可能であること +- (2)、(4)、(6) : `value_type` は、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`move`](/reference/utility/move.md)`(k))`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から `map` に直接構築可能であること +- (5), (6) : `key_compare::is_transparent` が妥当な式であること なお、規格に記載はないが、`hint` は [`emplace_hint`](emplace_hint.md) と同様、コンテナの有効な読み取り専用イテレータである必要があるものと思われる。 ## 効果 -- (1)、(3) : `map` が `k` と同値のキーを持つ要素を持っている場合、何もしない(引数への副作用もない)。そうでなければ、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(k)`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から構築した `value_type` 型のオブジェクトを挿入する。 -- (2)、(4) : `map` が `k` と同値のキーを持つ要素を持っている場合、何もしない(引数への副作用もない)。そうでなければ、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`move`](/reference/utility/move.md)`(k))`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から構築した `value_type` 型のオブジェクトを挿入する。 +- (1)、(3)、(5) : `map` が `k` と同値のキーを持つ要素を持っている場合、何もしない(引数への副作用もない)。そうでなければ、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(k)`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から構築した `value_type` 型のオブジェクトを挿入する。 +- (2)、(4)、(6) : `map` が `k` と同値のキーを持つ要素を持っている場合、何もしない(引数への副作用もない)。そうでなければ、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`move`](/reference/utility/move.md)`(k))`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から構築した `value_type` 型のオブジェクトを挿入する。 ## 戻り値 -- (1)、(2) : イテレータと `bool` 値の [`pair`](/reference/utility/pair.md) を返す。 +- (1)、(2)、(5) : イテレータと `bool` 値の [`pair`](/reference/utility/pair.md) を返す。 - 挿入された場合には、`first` に挿入された要素へのイテレータ、`second` に `true` が設定される。 - 挿入されなかった場合には、`first` に `k` と等価のキーを持つ既存の要素へのイテレータ、`second` に `false` が設定される。 -- (3)、(4) : +- (3)、(4)、(6) : - 挿入された場合には、挿入された要素へのイテレータを返す。 - 挿入されなかった場合には、`k` と等価のキーを持つ既存の要素へのイテレータを返す。 ## 計算量 -- (1)、(2) : [`emplace`](emplace.md) と同じ。 -- (3)、(4) : [`emplace_hint`](emplace_hint.md) と同じ。 +- (1)、(2)、(5) : [`emplace`](emplace.md) と同じ。 +- (3)、(4)、(6) : [`emplace_hint`](emplace_hint.md) と同じ。 ## 備考 - 概要に記載されているように、本メンバ関数は指定されたキーと等価の要素が既に存在する場合には、引数に副作用が発生しない。 - 一方、[`emplace`](emplace.md)、[`emplace_hint`](emplace_hint.md)、[`insert`](insert.md) にはそのような規定は無く、挿入がされなかった場合でも引数に副作用(引数からのムーブ)が発生してしまう可能性があるため、注意が必要である。 - -- このメンバ関数の機能テストマクロは以下の通り。 - - | マクロ名 | 値 | - |-----------------------------|----------| - | `__cpp_lib_map_try_emplace` | `201411` | - + - 一方、[`emplace`](emplace.md)、[`emplace_hint`](emplace_hint.md)、[`insert`](insert.md) にはそのような規定は無く、挿入がされなかった場合でも引数に副作用(引数からのムーブ)が発生してしまう可能性があるため、注意が必要である。 +- (5), (6) : + - `is_transparent`は、標準ライブラリの[`std::less`](/reference/functional/less.md)、[`std::greater`](/reference/functional/greater.md)といった関数オブジェクトの、`void`に対する特殊化で定義される。それ以外のテンプレートパラメータで`is_transparent`が定義されないのは、互換性のためである。 + - これらのオーバーロードは、`map`のようなコンテナに対し、検索操作で文字列リテラルを渡した際に、キー型の一時オブジェクトが生成されるコストを減らすためにある。 ## 例 @@ -129,3 +146,5 @@ false, 114, false - [N4006 An improved emplace() for unique-key maps](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4006.html) - [N4240 Improved insertion interface for unique-key maps (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4240.html) - [N4279 Improved insertion interface for unique-key maps (Revision 2.3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4279.html) +- [P2363R5: Extending associative containers with the remaining heterogeneous overloads](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2363r5.html) + - C++26で`template `のバージョンが追加された From 302be0fb1814097dedf1a2b1a93dc7367f6c54aa Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 15 May 2025 19:05:30 +0900 Subject: [PATCH 1706/3948] =?UTF-8?q?map::insert=5For=5Fassign=20:=20C++26?= =?UTF-8?q?=E3=81=AE=E7=95=B0=E7=A8=AE=E6=B7=B7=E5=90=88=E3=83=AB=E3=83=83?= =?UTF-8?q?=E3=82=AF=E3=82=A2=E3=83=83=E3=83=97=E3=81=AB=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=20#1189?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/map/map/at.md | 1 - reference/map/map/insert_or_assign.md | 59 +++++++++++++++++++-------- 2 files changed, 41 insertions(+), 19 deletions(-) diff --git a/reference/map/map/at.md b/reference/map/map/at.md index fc8ffd2472..a73dc3c212 100644 --- a/reference/map/map/at.md +++ b/reference/map/map/at.md @@ -104,6 +104,5 @@ exception std::out_of_range ## 参照 - [LWG Issue 464. Suggestion for new member functions in standard containers](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#464) -## 参照 - [P2363R5 Extending associative containers with the remaining heterogeneous overloads](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2363r5.html) - C++26で`template `のバージョンが追加された diff --git a/reference/map/map/insert_or_assign.md b/reference/map/map/insert_or_assign.md index 6825c7d2a8..9fddf5c7eb 100644 --- a/reference/map/map/insert_or_assign.md +++ b/reference/map/map/insert_or_assign.md @@ -7,16 +7,33 @@ ```cpp template -pair insert_or_assign(const key_type& k, M&& obj); // (1) - +pair + insert_or_assign(const key_type& k, + M&& obj); // (1) C++17 template -pair insert_or_assign(key_type&& k, M&& obj); // (2) - +pair + insert_or_assign(key_type&& k, + M&& obj); // (2) C++17 template -iterator insert_or_assign(const_iterator hint, const key_type& k, M&& obj); // (3) - +iterator + insert_or_assign(const_iterator hint, + const key_type& k, + M&& obj); // (3) C++17 template -iterator insert_or_assign(const_iterator hint, key_type&& k, M&& obj); // (4) +iterator + insert_or_assign(const_iterator hint, + key_type&& k, + M&& obj); // (4) C++17 + +template +pair + insert_or_assign(K&& k, + M&& obj); // (5) C++26 +template +iterator + insert_or_assign(const_iterator hint, + K&& k, + M&& obj); // (6) C++26 ``` * pair[link /reference/utility/pair.md] @@ -29,40 +46,44 @@ iterator insert_or_assign(const_iterator hint, key_type&& k, M&& obj); - (2) : `key_type`型の一時オブジェクトのキーをとって挿入もしくは代入する - (3) : 挿入位置のヒントをともない、`key_type`型のキーをとって挿入もしくは代入する - (4) : 挿入位置のヒントをともない、`key_type`型の一時オブジェクトのキーをとって挿入もしくは代入する +- (5) : `key_type`と比較可能な`K`型のキーをとって挿入もしくは代入する +- (6) : 挿入位置のヒントをともない、`key_type`と比較可能な`K`型のキーをとって挿入もしくは代入する ## テンプレートパラメータ制約 -- (1)、(3) : [`is_assignable_v`](/reference/type_traits/is_assignable.md)`` が `true` であること。`value_type` は、`k`, [`forward`](/reference/utility/forward.md)`(obj)` から `map` に直接構築可能であること +- (5), (6) : `key_compare::is_transparent` が妥当な式であること + + +## 適格要件 +- (1)、(3)、(5)、(6) : [`is_assignable_v`](/reference/type_traits/is_assignable.md)`` が `true` であること。`value_type` は、`k`, [`forward`](/reference/utility/forward.md)`(obj)` から `map` に直接構築可能であること - (2)、(4) : [`is_assignable_v`](/reference/type_traits/is_assignable.md)`` が `true` であること。`value_type` は、[`move`](/reference/utility/move.md)`(k)`, [`forward`](/reference/utility/forward.md)`(obj)` から `map` に直接構築可能であること なお、規格に記載はないが、`hint` は [`emplace_hint`](emplace_hint.md) と同様、コンテナの有効な読み取り専用イテレータである必要があるものと思われる。 ## 効果 -- (1)、(3) : `map` が `k` と同値のキーを持つ要素 `e` を持っている場合、`e.second` に [`forward`](/reference/utility/forward.md)`(obj)` を代入する。そうでなければ、`k`, [`forward`](/reference/utility/forward.md)`(obj)` から構築した `value_type` 型のオブジェクトを挿入する。 +- (1)、(3)、(5)、(6) : `map` が `k` と同値のキーを持つ要素 `e` を持っている場合、`e.second` に [`forward`](/reference/utility/forward.md)`(obj)` を代入する。そうでなければ、`k`, [`forward`](/reference/utility/forward.md)`(obj)` から構築した `value_type` 型のオブジェクトを挿入する。 - (2)、(4) : `map` が `k` と同値のキーを持つ要素 `e` を持っている場合、`e.second` に [`forward`](/reference/utility/forward.md)`(obj)` を代入する。そうでなければ、[`move`](/reference/utility/move.md)`(k)`, [`forward`](/reference/utility/forward.md)`(obj)` から構築した `value_type` 型のオブジェクトを挿入する。 ## 戻り値 -- (1)、(2) : イテレータと `bool` 値の [`pair`](/reference/utility/pair.md) を返す。 +- (1)、(2)、(5) : イテレータと `bool` 値の [`pair`](/reference/utility/pair.md) を返す。 - 挿入された場合には、`first` に挿入された要素へのイテレータ、`second` に `true` が設定される。 - 代入された場合には、`first` に代入された要素へのイテレータ、`second` に `false` が設定される。 -- (3)、(4) : +- (3)、(4)、(6) : - 挿入された場合には、挿入された要素へのイテレータを返す。 - 代入された場合には、代入された要素へのイテレータを返す。 ## 計算量 -- (1)、(2) : [`emplace`](emplace.md) と同じ。 -- (3)、(4) : [`emplace_hint`](emplace_hint.md) と同じ。 +- (1)、(2)、(5) : [`emplace`](emplace.md) と同じ。 +- (3)、(4)、(6) : [`emplace_hint`](emplace_hint.md) と同じ。 ## 備考 -このメンバ関数の機能テストマクロは以下の通り。 - -| マクロ名 | 値 | -|-----------------------------|----------| -| `__cpp_lib_map_try_emplace` | `201411` | +- (5), (6) : + - `is_transparent`は、標準ライブラリの[`std::less`](/reference/functional/less.md)、[`std::greater`](/reference/functional/greater.md)といった関数オブジェクトの、`void`に対する特殊化で定義される。それ以外のテンプレートパラメータで`is_transparent`が定義されないのは、互換性のためである。 + - これらのオーバーロードは、`map`のようなコンテナに対し、検索操作で文字列リテラルを渡した際に、キー型の一時オブジェクトが生成されるコストを減らすためにある。 ## 例 @@ -116,3 +137,5 @@ int main() - [N4006 An improved emplace() for unique-key maps](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4006.html) - [N4240 Improved insertion interface for unique-key maps (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4240.html) - [N4279 Improved insertion interface for unique-key maps (Revision 2.3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4279.html) +- [P2363R5 Extending associative containers with the remaining heterogeneous overloads](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2363r5.html) + - C++26で`template `のバージョンが追加された From 3f41dc923eef6e73d53b1515dd7b931e767e8b9c Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 16 May 2025 00:36:18 +0900 Subject: [PATCH 1707/3948] execution: continues_on,schedule_from (#1384) --- reference/execution/execution.md | 4 +- reference/execution/execution/child-type.md | 2 +- reference/execution/execution/continues_on.md | 164 ++++++++++++++ .../execution/execution/get-domain-late.md | 7 +- reference/execution/execution/on.md | 4 +- .../execution/execution/schedule_from.md | 214 ++++++++++++++++++ reference/execution/execution/starts_on.md | 6 +- 7 files changed, 390 insertions(+), 11 deletions(-) create mode 100644 reference/execution/execution/continues_on.md create mode 100644 reference/execution/execution/schedule_from.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 9354319c83..08afa903d4 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -112,9 +112,9 @@ namespace std::execution { |------|------|----------------| | [`execution::sender_adaptor_closure`](execution/sender_adaptor_closure.md.nolink) | Senderアダプタ実装用クロージャ型(class template) | C++26 | | [`execution::starts_on`](execution/starts_on.md) | 指定Scheduler上で開始する (customization point object) | C++26 | -| [`execution::continues_on`](execution/continues_on.md.nolink) | 指定Scheduler上で継続する (customization point object) | C++26 | +| [`execution::continues_on`](execution/continues_on.md) | 指定Scheduler上で継続する (customization point object) | C++26 | | [`execution::on`](execution/on.md) | 指定Senderのみ別Scheduler上で実行する (customization point object) | C++26 | -| [`execution::schedule_from`](execution/schedule_from.md.nolink) | Sender完了に依存する作業をスケジュール (customization point object) | C++26 | +| [`execution::schedule_from`](execution/schedule_from.md) | Sender完了に依存する作業をスケジュール (customization point object) | C++26 | | [`execution::then`](execution/then.md) | 値完了時の継続処理をアタッチ (customization point object) | C++26 | | [`execution::upon_error`](execution/upon_error.md.nolink) | エラー完了時の継続処理をアタッチ (customization point object) | C++26 | | [`execution::upon_stopped`](execution/upon_stopped.md.nolink) | 停止完了時の継続処理をアタッチ (customization point object) | C++26 | diff --git a/reference/execution/execution/child-type.md b/reference/execution/execution/child-type.md index d9208860c2..07ed69cdbe 100644 --- a/reference/execution/execution/child-type.md +++ b/reference/execution/execution/child-type.md @@ -21,7 +21,7 @@ namespace std::execution { - C++26 ## 関連項目 -- [`execution::schedule_from`](schedule_from.md.nolink) +- [`execution::schedule_from`](schedule_from.md) - [`execution::into_variant`](into_variant.md) diff --git a/reference/execution/execution/continues_on.md b/reference/execution/execution/continues_on.md new file mode 100644 index 0000000000..a43586be4f --- /dev/null +++ b/reference/execution/execution/continues_on.md @@ -0,0 +1,164 @@ +# continues_on +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct continues_on_t { unspecified }; + inline constexpr continues_on_t continues_on{}; +} +``` +* unspecified[italic] + +## 概要 +`continues_on`は、指定[Scheduler](scheduler.md)上で完了させるSenderアダプタである。 + +`continues_on`はパイプライン記法をサポートする。 + + +## 効果 +説明用の式`sch`と`sndr`に対して、`decltype((sch))`が[`scheduler`](scheduler.md)を満たさない、もしくは`decltype((sndr))`が[`sender`](sender.md)を満たさないとき、呼び出し式`continues_on(sndr, sch)`は不適格となる。 + +そうでなければ、呼び出し式`continues_on(sndr, sch)`は`sndr`が1回だけ評価されることを除いて、下記と等価。 + +```cpp +transform_sender(get-domain-early(sndr), make-sender(continues_on, sch, sndr)) +``` +* transform_sender[link transform_sender.md] +* get-domain-early[link get-domain-early.md] +* make-sender[link make-sender.md] + + +### Senderアルゴリズムタグ `continues_on` +Senderアルゴリズム動作説明用のクラステンプレート[`impls-for`](impls-for.md)に対して、下記の特殊化が定義される。 + +```cpp +namespace std::execution { + template<> + struct impls-for : default-impls { + static constexpr auto get-attrs = + [](const auto& data, const auto& child) noexcept -> decltype(auto) { + return JOIN-ENV(SCHED-ATTRS(data), FWD-ENV(get_env(child))); + }; + }; +} +``` +* impls-for[link impls-for.md] +* default-impls[link impls-for.md] +* JOIN-ENV[link JOIN-ENV.md.nolink] +* SCHED-ATTRS[link SCHED-ATTRS.md.nolink] +* FWD-ENV[link ../forwarding_query.md] +* get_env[link get_env.md] + +説明用の式`sndr`と`env`に対して、型`Sndr`を`decltype((sndr))`とする。[`sender-for`](sender-for.md)` == false`のとき、式`continues_on.transform_sender(sndr, env)`は不適格となる。 + +そうでなければ、式`continues_on.transform_sender(sndr, env)`は下記と等価。 + +```cpp +auto [_, data, child] = sndr; +return schedule_from(std::move(data), std::move(child)); +``` +* schedule_from[link schedule_from.md] +* std::move[link /reference/utility/move.md] + + +## カスタマイゼーションポイント +Senderアルゴリズム構築時に、[Sender](sender.md)`sndr`に[関連付けられた実行ドメイン](get-domain-early.md)に対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 +[デフォルト実行ドメイン](../execution/default_domain.md)では無変換。 + +[Receiver](receiver.md)との[接続(connect)](connect.md)時に、[Scheduler](scheduler.md)`sch`に[関連付けられた実行ドメイン](get-domain-late.md)に対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 +[デフォルト実行ドメイン](../execution/default_domain.md)では`continues_on.transform_sender(out_sndr, env)`が呼ばれ、[`schedule_from`](schedule_from.md)Senderへと変換される。 + +説明用の式`out_sndr`を`continues_on(sndr, sch)`の戻り値[Sender](sender.md)とし、型`OutSndr`を`decltype((out_sndr))`とする。式`out_rcvr`を[`sender_in`](sender_in.md)` == true`となる[環境](../queryable.md)`Env`に関連付けられた[Receiver](receiver.md)とする。`out_sndr`と`out_rcvr`との[接続(connect)](connect.md)結果[Operation State](operation_state.md)への左辺値参照を`op`としたとき、 + +- 呼び出し[`start`](start.md)`(op)`は、現在の実行エージェント上で入力[Sender](sender.md)`sndr`を開始し、[Scheduler](scheduler.md)`sch`に関連付けられた実行リソースに属する実行エージェント上で`out_rcvr`の完了操作を実行すべき。 +- `sch`上でのスケジューリングが失敗した場合、未規定の実行エージェント上で`out_rcvr`の[エラー完了](set_error.md)が行われるべき。 + + +## 備考 +`continues_on`Senderアルゴリズムの動作は、[Receiver](receiver.md)[接続(connect)](connect.md)時の[`schedule_from`](schedule_from.md)Senderアルゴリズムへの変換、および説明専用の[`get-domain-late`](get-domain-late.md)関数テンプレートでの特別扱いによって実現される。 + + +## 例 +```cpp example +#include +#include +#include +namespace ex = std::execution; + + +int main() +{ + std::println("main#{}", std::this_thread::get_id()); + + ex::run_loop loop; + std::jthread worker{[&]{ + std::println("start worker#{}", std::this_thread::get_id()); + loop.run(); + }}; + + ex::scheduler auto sch = loop.get_scheduler(); + ex::sender auto sndr = + ex::just(2) + | ex::then([](int n) { + std::println("on main#{}", std::this_thread::get_id()); + return n * 3; + }) + | ex::continues_on(sch) + | ex::then([](int n) { + std::println("on worker#{}", std::this_thread::get_id()); + return n * 7; + }); + + auto [val] = std::this_thread::sync_wait(std::move(sndr)).value(); + std::println("val={}", val); + + loop.finish(); +} +``` +* ex::continues_on[color ff0000] +* ex::run_loop[link run_loop.md] +* ex::sender[link sender.md] +* ex::scheduler[link scheduler.md] +* ex::just[link just.md] +* ex::then[link then.md] +* get_scheduler()[link run_loop/get_scheduler.md] +* run()[link run_loop/run.md] +* finish()[link run_loop/finish.md] +* std::this_thread::sync_wait[link ../this_thread/sync_wait.md] +* value()[link /reference/optional/optional/value.md] +* std::move[link /reference/utility/move.md] +* std::this_thread::get_id()[link /reference/thread/this_thread/get_id.md] + +### 出力例 +``` +main#137071308048192 +on main#137071308048192 +start worker#137071301756480 +on worker#137071301756480 +val=42 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::schedule`](schedule.md) +- [`execution::starts_on`](starts_on.md) +- [`execution::on`](on.md) + + +## 参照 +- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/get-domain-late.md b/reference/execution/execution/get-domain-late.md index bdfaec0988..5d6c3880d2 100644 --- a/reference/execution/execution/get-domain-late.md +++ b/reference/execution/execution/get-domain-late.md @@ -13,7 +13,7 @@ constexpr auto get-domain-late(const Sndr& sndr, const Env& env) noexcept; [Sender](sender.md)と[Receiver](receiver.md)間[接続(connect)](connect.md)時のカスタマイゼーションポイントとして、[実行ドメイン](default_domain.md)を取得する説明専用の関数テンプレート。 下記の優先順で実行ドメインを検索し、最初に適格となる型を採用する。 -(Senderアルゴリズム[`continue_on`](continue_on.md.nolink)のみ引数に指定した[Scheduler](scheduler.md)から取得。) +(Senderアルゴリズム[`continues_on`](continues_on.md)のみ引数に指定した[Scheduler](scheduler.md)から取得。) - Senderの[属性](../queryable.md)の実行ドメイン - Senderの[完了Scheduler](get_completion_scheduler.md)の実行ドメイン @@ -25,7 +25,7 @@ constexpr auto get-domain-late(const Sndr& sndr, const Env& env) noexcept; ## 効果 説明用の型`Domain`を下記の通り定義したとき、`return Domain();`と等価。 -- [`sender-for`](sender-for.md)` == true`のとき、次のラムダ式呼び出し結果の型とする。 +- [`sender-for`](sender-for.md)` == true`のとき、次のラムダ式呼び出し結果の型とする。 ```cpp [] { @@ -50,7 +50,7 @@ constexpr auto get-domain-late(const Sndr& sndr, const Env& env) noexcept; ## 備考 -Senderアダプタ[`continue_on`](continue_on.md.nolink)は[`schedule_from`](schedule_from.md.nolink)と連動して、実行コンテキスト遷移制御のカスタマイゼーションポイントをSchedulerに提供する。 +Senderアダプタ[`continues_on`](continues_on.md)は[`schedule_from`](schedule_from.md)と連携して、実行コンテキスト遷移制御のカスタマイゼーションポイントをSchedulerに提供する。 ## バージョン @@ -60,6 +60,7 @@ Senderアダプタ[`continue_on`](continue_on.md.nolink)は[`schedule_from`](sch ## 関連項目 - [`execution::connect`](connect.md) +- [`execution::continues_on`](continues_on.md) ## 参照 diff --git a/reference/execution/execution/on.md b/reference/execution/execution/on.md index 361cb2c14c..f8afd7065e 100644 --- a/reference/execution/execution/on.md +++ b/reference/execution/execution/on.md @@ -121,7 +121,7 @@ transform_sender( ``` * scheduler[link scheduler.md] * get_scheduler[link get_scheduler.md] - * continues_on[link continues_on.md.nolink] + * continues_on[link continues_on.md] * starts_on[link starts_on.md] * get_completion_scheduler[link get_completion_scheduler.md] * set_value_t[link set_value.md] @@ -323,7 +323,7 @@ val=42 ## 関連項目 - [`execution::schedule`](schedule.md) - [`execution::starts_on`](starts_on.md) -- [`execution::continues_on`](continues_on.md.nolink) +- [`execution::continues_on`](continues_on.md) ## 参照 diff --git a/reference/execution/execution/schedule_from.md b/reference/execution/execution/schedule_from.md new file mode 100644 index 0000000000..b72a43225b --- /dev/null +++ b/reference/execution/execution/schedule_from.md @@ -0,0 +1,214 @@ +# schedule_from +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct schedule_from_t { unspecified }; + inline constexpr schedule_from_t schedule_from{}; +} +``` +* unspecified[italic] + +## 概要 +`schedule_from`は、[Sender](sender.md)の完了に依存する作業を[Scheduler](scheduler.md)に関連付けられた実行リソースにスケジュールするSenderアダプタである。 + +`schedule_from`はユーザコードで利用されるものではなく、[`continues_on`](continues_on.md)Senderアルゴリズムの実装において利用される。 + + +## 効果 +説明用の式`sch`と`sndr`に対して、`decltype((sch))`が[`scheduler`](scheduler.md)を満たさない、もしくは`decltype((sndr))`が[`sender`](sender.md)を満たさないとき、呼び出し式`schedule_from(sch, sndr)`は不適格となる。 + +そうでなければ、呼び出し式`schedule_from(sch, sndr)`は`sch`が1回だけ評価されることを除いて、下記と等価。 + +```cpp +transform_sender( + query-or-default(get_domain, sch, default_domain()), + make-sender(schedule_from, sch, sndr)) +``` +* transform_sender[link transform_sender.md] +* query-or-default[link query-or-default.md.nolink] +* get_domain[link get_domain.md] +* default_domain()[link default_domain.md] +* make-sender[link make-sender.md] + + +### Senderアルゴリズムタグ `schedule_from` +Senderアルゴリズム動作説明用のクラステンプレート[`impls-for`](impls-for.md)に対して、下記の特殊化が定義される。 + +```cpp +namespace std::execution { + template<> + struct impls-for : default-impls { + static constexpr auto get-attrs = see below; + static constexpr auto get-state = see below; + static constexpr auto complete = see below; + }; +} +``` +* impls-for[link impls-for.md] +* default-impls[link impls-for.md] +* see below[italic] + +`impls-for>::get-attrs`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 + +```cpp +[](const auto& data, const auto& child) noexcept -> decltype(auto) { + return JOIN-ENV(SCHED-ATTRS(data), FWD-ENV(get_env(child))); +} +``` +* JOIN-ENV[link JOIN-ENV.md.nolink] +* SCHED-ATTRS[link SCHED-ATTRS.md.nolink] +* FWD-ENV[link ../forwarding_query.md] +* get_env[link get_env.md] + +`impls-for>::get-state`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 + +```cpp +[](Sndr&& sndr, Rcvr& rcvr) noexcept(see below) + requires sender_in, env_of_t> { + + auto& [_, sch, child] = sndr; + + using sched_t = decltype(auto(sch)); + using variant_t = see below; + using receiver_t = see below; + using operation_t = connect_result_t, receiver_t>; + constexpr bool nothrow = noexcept(connect(schedule(sch), receiver_t{nullptr})); + + struct state-type { + Rcvr& rcvr; // exposition only + variant_t async-result; // exposition only + operation_t op-state; // exposition only + + explicit state-type(sched_t sch, Rcvr& rcvr) noexcept(nothrow) + : rcvr(rcvr), op-state(connect(schedule(sch), receiver_t{this})) {} + }; + + return state-type{sch, rcvr}; +} +``` +* sender_in[link sender_in.md] +* child-type[link child-type.md] +* env_of_t[link env_of_t.md] +* connect_result_t[link connect_result_t.md] +* schedule_result_t[link schedule_result_t.md] +* connect[link connect.md] +* schedule[link schedule.md] +* see below[italic] + +- ローカルクラス`state-type`のオブジェクトは[構造化束縛](/lang/cpp17/structured_bindings.md)における初期化子として利用できる。 +- 説明用のパック`Sigs`を[`completion_signatures_of_t`](completion_signatures_of_t.md)`<`[`child-type`](child-type.md)`,` [`env_of_t`](env_of_t.md)`>`による[`completion_signatures`](completion_signatures.md)特殊化のテンプレートパラメータと定義する。説明用のエイリアステンプレート`as-tuple`を[`decayed-tuple`](decayed-tuple.md)``と定義する。型`variant_t`は下記定義において重複削除した型となる。 + + ```cpp + variant...> + ``` + * variant[link /reference/variant/variant.md] + * monostate[link /reference/variant/monostate.md] + +- `receiver_t`は説明専用クラス`receiver-type`のエイリアスとする。 + +`impls-for>::complete`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 + +```cpp +[](auto, auto& state, auto& rcvr, Tag, Args&&... args) noexcept + -> void { + using result_t = decayed-tuple; + constexpr bool nothrow = is_nothrow_constructible_v; + + try { + state.async-result.template emplace(Tag(), std::forward(args)...); + } catch (...) { + if constexpr (!nothrow) { + set_error(std::move(rcvr), current_exception()); + return; + } + } + start(state.op-state); +}; +``` +* decayed-tuple[link decayed-tuple.md] +* set_error[link set_error.md] +* start[link start.md] +* is_nothrow_constructible_v[link /reference/type_traits/is_nothrow_constructible.md] +* template emplace[link /reference/variant/variant/emplace.md] +* current_exception()[link /reference/exception/current_exception.md] +* std::move[link /reference/utility/move.md] + + +## 説明専用エンティティ +説明専用のクラス`receiver-type`を下記の通り定義する。 + +```cpp +namespace std::execution { + struct receiver-type { + using receiver_concept = receiver_t; + state-type* state; // exposition only + + void set_value() && noexcept { + visit( + [this](Tuple& result) noexcept -> void { + if constexpr (!same_as) { + auto& [tag, ...args] = result; + tag(std::move(state->rcvr), std::move(args)...); + } + }, + state->async-result); + } + + template + void set_error(Error&& err) && noexcept { + execution::set_error(std::move(state->rcvr), std::forward(err)); + } + + void set_stopped() && noexcept { + execution::set_stopped(std::move(state->rcvr)); + } + + decltype(auto) get_env() const noexcept { + return FWD-ENV(execution::get_env(state->rcvr)); + } + }; +} +``` +* receiver_t[link receiver.md] +* execution::set_error[link set_error.md] +* execution::set_stopped[link set_stopped.md] +* execution::get_env[link get_env.md] +* FWD-ENV[link ../forwarding_query.md] +* visit[link /reference/variant/visit.md] +* monostate[link /reference/variant/monostate.md] +* std::move[link /reference/utility/move.md] + + +## カスタマイゼーションポイント +Senderアルゴリズム構築時および[Receiver](receiver.md)接続時に、関連付けられた実行ドメインに対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 +[デフォルト実行ドメイン](../execution/default_domain.md)では無変換。 + +説明用の式`out_sndr`を`schedule_from(sndr, sch)`の戻り値[Sender](sender.md)とし、型`OutSndr`を`decltype((out_sndr))`とする。式`out_rcvr`を[`sender_in`](sender_in.md)` == true`となる[環境](../queryable.md)`Env`に関連付けられた[Receiver](receiver.md)とする。`out_sndr`と`out_rcvr`との[接続(connect)](connect.md)結果[Operation State](operation_state.md)への左辺値参照を`op`としたとき、 + +- 呼び出し[`start`](start.md)`(op)`は、現在の実行エージェント上で入力[Sender](sender.md)`sndr`を開始し、[Scheduler](scheduler.md)`sch`に関連付けられた実行リソースに属する実行エージェント上で`out_rcvr`の完了操作を実行すべき。 +- `sch`上でのスケジューリングが失敗した場合、未規定の実行エージェント上で`out_rcvr`の[エラー完了](set_error.md)が行われるべき。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::schedule`](schedule.md) +- [`execution::continues_on`](continues_on.md) + + +## 参照 +- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/starts_on.md b/reference/execution/execution/starts_on.md index dcad0c7863..169c24ac56 100644 --- a/reference/execution/execution/starts_on.md +++ b/reference/execution/execution/starts_on.md @@ -88,6 +88,8 @@ namespace ex = std::execution; int main() { + std::println("main#{}", std::this_thread::get_id()); + ex::run_loop loop; std::jthread worker{[&]{ std::println("start worker#{}", std::this_thread::get_id()); @@ -102,8 +104,6 @@ int main() return n * 2; }); - std::println("main#{}", std::this_thread::get_id()); - auto [val] = std::this_thread::sync_wait(std::move(sndr)).value(); std::println("val={}", val); @@ -146,7 +146,7 @@ val=42 ## 関連項目 - [`execution::schedule`](schedule.md) -- [`execution::continues_on`](continues_on.md.nolink) +- [`execution::continues_on`](continues_on.md) - [`execution::on`](on.md) From 3175722cafabd80cce386bdfb2de0656b1ac46b8 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sun, 18 May 2025 14:59:17 +0900 Subject: [PATCH 1708/3948] =?UTF-8?q?map::try=5Femplace=20:=20=E8=A6=81?= =?UTF-8?q?=E4=BB=B6=E3=82=92=E4=BF=AE=E6=AD=A3=20#1189?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/map/map/try_emplace.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/reference/map/map/try_emplace.md b/reference/map/map/try_emplace.md index 7bb94f5dda..498af971b9 100644 --- a/reference/map/map/try_emplace.md +++ b/reference/map/map/try_emplace.md @@ -55,16 +55,19 @@ iterator ## テンプレートパラメータ制約 -- (1)、(3)、(5) : `value_type` は、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(k)`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から `map` に直接構築可能であること -- (2)、(4)、(6) : `value_type` は、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`move`](/reference/utility/move.md)`(k))`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から `map` に直接構築可能であること +- (1)、(3)、(5)、(6) : `value_type` は、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(k)`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から `map` に直接構築可能であること +- (2)、(4) : `value_type` は、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`move`](/reference/utility/move.md)`(k))`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から `map` に直接構築可能であること - (5), (6) : `key_compare::is_transparent` が妥当な式であること +- (5) : 以下のすべてを満たすこと: + - [`is_convertible_v`](/reference/type_traits/is_convertible.md)` == false` + - [`is_convertible_v`](/reference/type_traits/is_convertible.md)` == false` なお、規格に記載はないが、`hint` は [`emplace_hint`](emplace_hint.md) と同様、コンテナの有効な読み取り専用イテレータである必要があるものと思われる。 ## 効果 -- (1)、(3)、(5) : `map` が `k` と同値のキーを持つ要素を持っている場合、何もしない(引数への副作用もない)。そうでなければ、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(k)`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から構築した `value_type` 型のオブジェクトを挿入する。 -- (2)、(4)、(6) : `map` が `k` と同値のキーを持つ要素を持っている場合、何もしない(引数への副作用もない)。そうでなければ、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`move`](/reference/utility/move.md)`(k))`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から構築した `value_type` 型のオブジェクトを挿入する。 +- (1)、(3)、(5)、(6) : `map` が `k` と同値のキーを持つ要素を持っている場合、何もしない(引数への副作用もない)。そうでなければ、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(k)`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から構築した `value_type` 型のオブジェクトを挿入する。 +- (2)、(4) : `map` が `k` と同値のキーを持つ要素を持っている場合、何もしない(引数への副作用もない)。そうでなければ、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`move`](/reference/utility/move.md)`(k))`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から構築した `value_type` 型のオブジェクトを挿入する。 ## 戻り値 From 8e136851714ae262cd98b11b1a35b41622527a9e Mon Sep 17 00:00:00 2001 From: koki watanabe Date: Sun, 18 May 2025 16:13:53 +0900 Subject: [PATCH 1709/3948] fix complexity of clear method --- reference/unordered_map/unordered_map/clear.md | 2 +- reference/unordered_map/unordered_multimap/clear.md | 2 +- reference/unordered_set/unordered_multiset/clear.md | 2 +- reference/unordered_set/unordered_set/clear.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/unordered_map/unordered_map/clear.md b/reference/unordered_map/unordered_map/clear.md index 1d0ce4f0c2..fd12bdc0e2 100644 --- a/reference/unordered_map/unordered_map/clear.md +++ b/reference/unordered_map/unordered_map/clear.md @@ -34,7 +34,7 @@ void clear() noexcept; ## 計算量 -本関数呼び出し前のコンテナの要素数([`size`](size.md)`()`)に比例 +本関数呼び出し前のコンテナの要素数([`bucket_count`](bucket_count.md)`()`)に比例 ## 例 diff --git a/reference/unordered_map/unordered_multimap/clear.md b/reference/unordered_map/unordered_multimap/clear.md index e4d2525812..a1f76170ca 100644 --- a/reference/unordered_map/unordered_multimap/clear.md +++ b/reference/unordered_map/unordered_multimap/clear.md @@ -34,7 +34,7 @@ void clear() noexcept; ## 計算量 -本関数呼び出し前のコンテナの要素数([`size`](size.md)`()`)に比例 +本関数呼び出し前のコンテナの要素数([`bucket_count`](bucket_count.md)`()`)に比例 ## 例 diff --git a/reference/unordered_set/unordered_multiset/clear.md b/reference/unordered_set/unordered_multiset/clear.md index 8ba2f6e249..f2fd9a7829 100644 --- a/reference/unordered_set/unordered_multiset/clear.md +++ b/reference/unordered_set/unordered_multiset/clear.md @@ -34,7 +34,7 @@ void clear() noexcept; ## 計算量 -本関数呼び出し前のコンテナの要素数([`size`](size.md)`()`)に比例 +本関数呼び出し前のコンテナの要素数([`bucket_count`](bucket_count.md)`()`)に比例 ## 例 diff --git a/reference/unordered_set/unordered_set/clear.md b/reference/unordered_set/unordered_set/clear.md index e54f8a9f44..b6394e9f7c 100644 --- a/reference/unordered_set/unordered_set/clear.md +++ b/reference/unordered_set/unordered_set/clear.md @@ -34,7 +34,7 @@ void clear() noexcept; ## 計算量 -本関数呼び出し前のコンテナの要素数([`size`](size.md)`()`)に比例 +本関数呼び出し前のコンテナの要素数([`bucket_count`](bucket_count.md)`()`)に比例 ## 例 From 056967cba35edd35031492137dd1c1d43e008bc8 Mon Sep 17 00:00:00 2001 From: koki watanabe Date: Sun, 18 May 2025 16:20:42 +0900 Subject: [PATCH 1710/3948] fix: explanation --- reference/unordered_map/unordered_map/clear.md | 2 +- reference/unordered_map/unordered_multimap/clear.md | 2 +- reference/unordered_set/unordered_multiset/clear.md | 2 +- reference/unordered_set/unordered_set/clear.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/unordered_map/unordered_map/clear.md b/reference/unordered_map/unordered_map/clear.md index fd12bdc0e2..92bc6159b3 100644 --- a/reference/unordered_map/unordered_map/clear.md +++ b/reference/unordered_map/unordered_map/clear.md @@ -34,7 +34,7 @@ void clear() noexcept; ## 計算量 -本関数呼び出し前のコンテナの要素数([`bucket_count`](bucket_count.md)`()`)に比例 +本関数呼び出し前のバケット数([`bucket_count`](bucket_count.md)`()`)に比例 ## 例 diff --git a/reference/unordered_map/unordered_multimap/clear.md b/reference/unordered_map/unordered_multimap/clear.md index a1f76170ca..cd593049ea 100644 --- a/reference/unordered_map/unordered_multimap/clear.md +++ b/reference/unordered_map/unordered_multimap/clear.md @@ -34,7 +34,7 @@ void clear() noexcept; ## 計算量 -本関数呼び出し前のコンテナの要素数([`bucket_count`](bucket_count.md)`()`)に比例 +本関数呼び出し前のバケット数([`bucket_count`](bucket_count.md)`()`)に比例 ## 例 diff --git a/reference/unordered_set/unordered_multiset/clear.md b/reference/unordered_set/unordered_multiset/clear.md index f2fd9a7829..ed4129e925 100644 --- a/reference/unordered_set/unordered_multiset/clear.md +++ b/reference/unordered_set/unordered_multiset/clear.md @@ -34,7 +34,7 @@ void clear() noexcept; ## 計算量 -本関数呼び出し前のコンテナの要素数([`bucket_count`](bucket_count.md)`()`)に比例 +本関数呼び出し前のバケット数([`bucket_count`](bucket_count.md)`()`)に比例 ## 例 diff --git a/reference/unordered_set/unordered_set/clear.md b/reference/unordered_set/unordered_set/clear.md index b6394e9f7c..0062e4a920 100644 --- a/reference/unordered_set/unordered_set/clear.md +++ b/reference/unordered_set/unordered_set/clear.md @@ -34,7 +34,7 @@ void clear() noexcept; ## 計算量 -本関数呼び出し前のコンテナの要素数([`bucket_count`](bucket_count.md)`()`)に比例 +本関数呼び出し前のバケット数([`bucket_count`](bucket_count.md)`()`)に比例 ## 例 From 0036d1d6b893ee18fda33535962addd83a622a66 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 19 May 2025 16:09:50 +0900 Subject: [PATCH 1711/3948] =?UTF-8?q?map::try=5Femplace=20:=20=E8=A6=81?= =?UTF-8?q?=E4=BB=B6=E3=82=92=E6=95=B4=E7=90=86=20#1189?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/map/map/try_emplace.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/map/map/try_emplace.md b/reference/map/map/try_emplace.md index 498af971b9..c6b4b178bb 100644 --- a/reference/map/map/try_emplace.md +++ b/reference/map/map/try_emplace.md @@ -57,10 +57,10 @@ iterator ## テンプレートパラメータ制約 - (1)、(3)、(5)、(6) : `value_type` は、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(k)`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から `map` に直接構築可能であること - (2)、(4) : `value_type` は、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`move`](/reference/utility/move.md)`(k))`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から `map` に直接構築可能であること -- (5), (6) : `key_compare::is_transparent` が妥当な式であること -- (5) : 以下のすべてを満たすこと: - - [`is_convertible_v`](/reference/type_traits/is_convertible.md)` == false` - - [`is_convertible_v`](/reference/type_traits/is_convertible.md)` == false` +- (5)、(6) : + - `key_compare::is_transparent` が妥当な式であること + - [`is_convertible_v`](/reference/type_traits/is_convertible.md)` == false`であること + - [`is_convertible_v`](/reference/type_traits/is_convertible.md)` == false`であること なお、規格に記載はないが、`hint` は [`emplace_hint`](emplace_hint.md) と同様、コンテナの有効な読み取り専用イテレータである必要があるものと思われる。 From 91f56d04fed8799683fe403a74714e85344256cb Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 19 May 2025 16:16:03 +0900 Subject: [PATCH 1712/3948] =?UTF-8?q?set::insert=20:=20C++26=E3=81=AE?= =?UTF-8?q?=E7=95=B0=E7=A8=AE=E6=B7=B7=E5=90=88=E3=83=AB=E3=83=83=E3=82=AF?= =?UTF-8?q?=E3=82=A2=E3=83=83=E3=83=97=E3=81=AB=E5=AF=BE=E5=BF=9C=20#1189?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/set/set/insert.md | 77 +++++++++++++++++++++++-------------- 1 file changed, 49 insertions(+), 28 deletions(-) diff --git a/reference/set/set/insert.md b/reference/set/set/insert.md index c572100eaa..5310bb901f 100644 --- a/reference/set/set/insert.md +++ b/reference/set/set/insert.md @@ -5,21 +5,27 @@ * function[meta id-type] ```cpp -pair insert(const value_type& x); // (1) -pair insert(value_type&& y); // (2) C++11 +pair insert(const value_type& x); // (1) C++03 +pair insert(value_type&& y); // (2) C++11 -iterator insert(iterator position, const value_type& x); // (3) C++03 -iterator insert(const_iterator position, const value_type& x); // (3) C++11 +template +pair insert(K&& x); // (3) C++26 -iterator insert(const_iterator position, value_type&& y); // (4) C++11 +iterator insert(iterator hint, const value_type& x); // (4) C++03 +iterator insert(const_iterator hint, const value_type& x); // (4) C++11 + +iterator insert(const_iterator hint, value_type&& y); // (5) C++11 + +template +iterator insert(const_iterator hint, K&& x); // (6) C++26 template -void insert(InputIterator first, InputIterator last); // (5) +void insert(InputIterator first, InputIterator last); // (7) C++03 -void insert(initializer_list init); // (6) +void insert(initializer_list init); // (8) C++03 -insert_return_type insert(node_type&& nh); // (7) C++17 -iterator insert(const_iterator hint, node_type&& nh); // (8) C++17 +insert_return_type insert(node_type&& nh); // (9) C++17 +iterator insert(const_iterator hint, node_type&& nh); // (10) C++17 ``` * pair[link /reference/utility/pair.md] * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -29,42 +35,55 @@ iterator insert(const_iterator hint, node_type&& nh); // (8) C++17 `set` コンテナは重複した値を許さないため、挿入操作はそれぞれの要素が他のコンテナ内の既存要素と同じ値かどうかをチェックし、同じ要素がすでにあれば挿入されない。`multiset`の場合には、同じ値の要素でも挿入される。 - - (1) : 新たな要素`x`をコピー挿入する - (2) : 新たな要素`y`をムーブ挿入する -- (3) : 新たな要素`x`をコピー挿入する。`position`パラメータに適切な挿入位置を指定すれば、高速に挿入できる -- (4) : 新たな要素`y`をムーブ挿入する。`position`パラメータに適切な挿入位置を指定すれば、高速に挿入できる -- (5) : イテレータ範囲`[first, last)`の要素を挿入する -- (6) : 初期化子リスト`init`の要素を挿入する -- (7) : `nh`が空の場合、効果はない。 +- (3) : `value_type`に変換可能な`Key`型の新たな要素`x`を転送して挿入する +- (4) : 新たな要素`x`をコピー挿入する。`hint`パラメータに適切な挿入位置を指定すれば、高速に挿入できる +- (5) : 新たな要素`y`をムーブ挿入する。`hint`パラメータに適切な挿入位置を指定すれば、高速に挿入できる +- (6) : `value_type`に変換可能な`Key`型の新たな要素`x`を転送して挿入する。`hint`パラメータに適切な挿入位置を指定すれば、高速に挿入できる +- (7) : イテレータ範囲`[first, last)`の要素を挿入する +- (8) : 初期化子リスト`init`の要素を挿入する +- (9) : `nh`が空の場合、効果はない。 それ以外の場合、`nh.key()`と等価のキーを持つ要素がコンテナにない場合に限り、`nh`が所有する要素を挿入する。 -- (8) : `nh`が空の場合、効果はなく、`(*this).end()`を返す。 +- (10) : `nh`が空の場合、効果はなく、`(*this).end()`を返す。 それ以外の場合、`nh.key()`と等価のキーを持つ要素がコンテナにない場合に限り、`nh`が所有する要素を挿入する。 `nh.key()`と同等のキーの要素を指すイテレータを常に返す。要素は、`hint`の直前の位置のできるだけ近くに挿入される。 +## テンプレートパラメータ制約 +- (3), (6) : + - `key_compare::is_transparent` が妥当な式であること + - [`is_convertible_v`](/reference/type_traits/is_convertible.md)` == false`であること + - [`is_convertible_v`](/reference/type_traits/is_convertible.md)` == false`であること + - `value_type`が[`std::forward`](/reference/utility/forward.md)`(x)`によって直接構築可能であること + + ## 戻り値 -- (1), (2) : `first` に新しく挿入された要素またはすでに `set` に格納されていた同じ値の要素を指すイテレータを設定する。`second` には、要素が挿入されたときに `true` を、同じ値の要素が存在したときに `false` を設定する。 -- (3), (4) : 新しく挿入された要素またはすでに `set` に格納されていた同じ値の要素を指すイテレータを返す。 -- (5), (6) : なし -- (7) : [`insert_return_type`](/reference/map/map.md)を返す。`insert_return_type`のイテレータ型メンバ変数`position`、`bool`型メンバ変数`inserted`に格納される値は(1), (2)のものと同じ情報である。`nh`が空の場合は、`position`は終端イテレータである。`node_type`型メンバ変数`node`には、 +- (1), (2), (3) : `first` に新しく挿入された要素またはすでに `set` に格納されていた同じ値の要素を指すイテレータを設定する。`second` には、要素が挿入されたときに `true` を、同じ値の要素が存在したときに `false` を設定する。 +- (4), (5), (6) : 新しく挿入された要素またはすでに `set` に格納されていた同じ値の要素を指すイテレータを返す。 +- (7), (8) : なし +- (9) : [`insert_return_type`](/reference/map/map.md)を返す。`insert_return_type`のイテレータ型メンバ変数`position`、`bool`型メンバ変数`inserted`に格納される値は(1), (2)のものと同じ情報である。`nh`が空の場合は、`position`は終端イテレータである。`node_type`型メンバ変数`node`には、 - 挿入された場合には、空の[ノードハンドル](/reference/node_handle/node_handle.md)。 - 挿入されなかった場合には、`nh`の値である。 -- (8) : `nh`が空の場合、`(*this).end()`を返す。そうではない場合、`nh`と等価のキーの要素を指すイテレータを常に返す。 +- (10) : `nh`が空の場合、`(*this).end()`を返す。そうではない場合、`nh`と等価のキーの要素を指すイテレータを常に返す。 ## 計算量 -- (1), (2) : 対数時間 -- (3), (4) : 一般に対数時間だが、`x` または `y` が `position` が指す要素の直前に挿入された場合は償却定数時間 -- (5), (6) : 一般に N log(size + N) +- (1), (2), (3) : 対数時間 +- (4), (5), (6) : 一般に対数時間だが、`x` または `y` が `hint` が指す要素の直前に挿入された場合は償却定数時間 +- (7), (8) : 一般に N log(size + N) - ※ ここで `N` は `first` と `last` の間の距離であり `size` は挿入前のコンテナの [`size()`](size.md) -- (7) : 対数時間 -- (8) : 一般に対数時間だが、指定された新たな要素が `hint` が指す要素の直前に挿入された場合は償却定数時間。 +- (9) : 対数時間 +- (10) : 一般に対数時間だが、指定された新たな要素が `hint` が指す要素の直前に挿入された場合は償却定数時間。 ## 備考 - これらの関数が呼ばれた後も、当該コンテナ内の要素を指す参照やイテレータは無効にはならない。 なお、規格書に明確な記載は無いが、当該コンテナ内の要素を指すポインタも無効にはならない。 -- 内部的に `set` コンテナは、コンストラクト時に指定された比較オブジェクトによって要素を下位から上位へとソートして保持する。 (7), (8) の場合、要素はコピーもムーブもされない。 +- 内部的に `set` コンテナは、コンストラクト時に指定された比較オブジェクトによって要素を下位から上位へとソートして保持する。 (9), (10) の場合、要素はコピーもムーブもされない。 +- (3), (6) : + - `is_transparent`は、標準ライブラリの[`std::less`](/reference/functional/less.md)、[`std::greater`](/reference/functional/greater.md)といった関数オブジェクトの、`void`に対する特殊化で定義される。それ以外のテンプレートパラメータで`is_transparent`が定義されないのは、互換性のためである。 + - これらのオーバーロードは、`map`のようなコンテナに対し、検索操作で文字列リテラルを渡した際に、キー型の一時オブジェクトが生成されるコストを減らすためにある。 + ## 例 ```cpp example @@ -112,4 +131,6 @@ int main () - [N2350 Container insert/erase and iterator constness (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2350.pdf) - [N2679 Initializer Lists for Standard Containers(Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2679.pdf) - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) - - (7), (8)経緯となる提案文書 \ No newline at end of file + - C++17で導入されたノード挿入(9), (10)の経緯となる提案文書 +- [P2363R5: Extending associative containers with the remaining heterogeneous overloads](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2363r5.html) + - C++26で`template `のバージョンが追加された From e8b37eff3b349680414defd2a1dbc70547111eaa Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 20 May 2025 19:21:00 +0900 Subject: [PATCH 1713/3948] =?UTF-8?q?unordered=5Fmap::try=5Femplace:=20C++?= =?UTF-8?q?26=E3=81=AE=E7=95=B0=E7=A8=AE=E6=B7=B7=E5=90=88=E3=83=AB?= =?UTF-8?q?=E3=83=83=E3=82=AF=E3=82=A2=E3=83=83=E3=83=97=E3=81=AB=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C=20#1189?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../unordered_map/try_emplace.md | 69 +++++++++++++------ 1 file changed, 49 insertions(+), 20 deletions(-) diff --git a/reference/unordered_map/unordered_map/try_emplace.md b/reference/unordered_map/unordered_map/try_emplace.md index d172d00eb4..b4a3ccbd21 100644 --- a/reference/unordered_map/unordered_map/try_emplace.md +++ b/reference/unordered_map/unordered_map/try_emplace.md @@ -7,16 +7,37 @@ ```cpp template -pair try_emplace(const key_type& k, Args&&... args); // (1) +pair + try_emplace(const key_type& k, + Args&&... args); // (1) C++17 template -pair try_emplace(key_type&& k, Args&&... args); // (2) +pair + try_emplace(key_type&& k, + Args&&... args); // (2) C++17 + +template +pair + try_emplace(K&& k, + Args&&... args); // (3) C++26 template -iterator try_emplace(const_iterator hint, const key_type& k, Args&&... args); // (3) +iterator + try_emplace(const_iterator hint, + const key_type& k, + Args&&... args); // (4) C++17 template -iterator try_emplace(const_iterator hint, key_type&& k, Args&&... args); // (4) +iterator + try_emplace(const_iterator hint, + key_type&& k, + Args&&... args); // (5) C++17 + +template +iterator + try_emplace(const_iterator hint, + K&& k, + Args&&... args); // (6) C++26 ``` * pair[link /reference/utility/pair.md] @@ -26,46 +47,52 @@ iterator try_emplace(const_iterator hint, key_type&& k, Args&&... args); 引数 `hint` は、`k` を検索する際のヒントに使用される。(が、実際に使用されることはないものと思われる。[`emplace_hint`](emplace_hint.md) の備考を参照) +- (1) : キーをコピーし、値型のコンストラクタ引数をとり直接構築して、新たな要素を挿入する +- (2) : キーをムーブし、値型のコンストラクタ引数をとり直接構築して、新たな要素を挿入する +- (3) : `key_type`型と比較可能なキーを転送し、値型のコンストラクタ引数をとり直接構築して、新たな要素を挿入する +- (4) : 検索位置のヒントを受け取ってキーをコピーし、値型のコンストラクタ引数をとり直接構築して、新たな要素を挿入する +- (5) : 検索位置のヒントを受け取ってキーをムーブし、値型のコンストラクタ引数をとり直接構築して、新たな要素を挿入する +- (6) : 検索位置のヒントを受け取って`key_type`型と比較可能なキーをムーブし、値型のコンストラクタ引数をとり直接構築して、新たな要素を挿入する + ## テンプレートパラメータ制約 -- (1)、(3) : `value_type` は、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(k)`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から `unordered_map` に直接構築可能であること -- (2)、(4) : `value_type` は、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`move`](/reference/utility/move.md)`(k))`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から `unordered_map` に直接構築可能であること +- (1)、(3)、(4)、(6) : `value_type` は、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(k)`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から `unordered_map` に直接構築可能であること +- (2)、(5) : `value_type` は、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`move`](/reference/utility/move.md)`(k))`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から `unordered_map` に直接構築可能であること +- (3)、(6) : + - `key_compare::is_transparent` が妥当な式であること + - [`is_convertible_v`](/reference/type_traits/is_convertible.md)` == false`であること + - [`is_convertible_v`](/reference/type_traits/is_convertible.md)` == false`であること なお、規格に記載はないが、`hint` は [`emplace_hint`](emplace_hint.md) と同様、コンテナの有効な読み取り専用イテレータである必要があるものと思われる。 ## 効果 -- (1)、(3) : `unordered_map` が `k` と同値のキーを持つ要素を持っている場合、何もしない(引数への副作用もない)。そうでなければ、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(k)`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から構築した `value_type` 型のオブジェクトを挿入する。 -- (2)、(4) : `unordered_map` が `k` と同値のキーを持つ要素を持っている場合、何もしない(引数への副作用もない)。そうでなければ、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`move`](/reference/utility/move.md)`(k))`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から構築した `value_type` 型のオブジェクトを挿入する。 +- (1)、(3)、(4)、(6) : `unordered_map` が `k` と同値のキーを持つ要素を持っている場合、何もしない(引数への副作用もない)。そうでなければ、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(k)`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から構築した `value_type` 型のオブジェクトを挿入する。 +- (2)、(5) : `unordered_map` が `k` と同値のキーを持つ要素を持っている場合、何もしない(引数への副作用もない)。そうでなければ、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`move`](/reference/utility/move.md)`(k))`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から構築した `value_type` 型のオブジェクトを挿入する。 ## 戻り値 -- (1)、(2) : イテレータと `bool` 値の [`pair`](/reference/utility/pair.md) を返す。 +- (1)、(2)、(3) : イテレータと `bool` 値の [`pair`](/reference/utility/pair.md) を返す。 - 挿入された場合には、`first` に挿入された要素へのイテレータ、`second` に `true` が設定される。 - 挿入されなかった場合には、`first` に `k` と等価のキーを持つ既存の要素へのイテレータ、`second` に `false` が設定される。 -- (3)、(4) : +- (4)、(5)、(6) : - 挿入された場合には、挿入された要素へのイテレータを返す。 - 挿入されなかった場合には、`k` と等価のキーを持つ既存の要素へのイテレータを返す。 ## 計算量 - (1)、(2) : [`emplace`](emplace.md) と同じ。 -- (3)、(4) : [`emplace_hint`](emplace_hint.md) と同じ。 +- (4)、(5) : [`emplace_hint`](emplace_hint.md) と同じ。 ## 備考 - 概要に記載されているように、本メンバ関数は指定されたキーと等価の要素が既に存在する場合には、引数に副作用が発生しない。 - 一方、[`emplace`](emplace.md)、[`emplace_hint`](emplace_hint.md)、[`insert`](insert.md) にはそのような規定は無く、挿入がされなかった場合でも引数に副作用(引数からのムーブ)が発生してしまう可能性があるため、注意が必要である。 - + - 一方、[`emplace`](emplace.md)、[`emplace_hint`](emplace_hint.md)、[`insert`](insert.md) にはそのような規定は無く、挿入がされなかった場合でも引数に副作用(引数からのムーブ)が発生してしまう可能性があるため、注意が必要である。 - 規格にはこの関数の例外安全性についての記載が無いが、[`emplace`](emplace.md) や [`emplace_hint`](emplace_hint.md) と等価と考えて問題ないと思われる。 - - 規格にはこの関数が呼ばれた後のイテレータや要素へのポインタ・参照の有効性についての記載が無いが、[`emplace`](emplace.md) や [`emplace_hint`](emplace_hint.md) と等価と考えて問題ないと思われる。 - -- このメンバ関数の[`機能テストマクロ`](/lang/cpp17/feature_test_macros.md)は以下の通り。 - - | マクロ名 | 値 | - |---------------------------------------|----------| - | `__cpp_lib_unordered_map_try_emplace` | `201411` | +- (3), (6) : + - `is_transparent`は、標準ライブラリの[`std::less`](/reference/functional/less.md)、[`std::greater`](/reference/functional/greater.md)といった関数オブジェクトの、`void`に対する特殊化で定義される。それ以外のテンプレートパラメータで`is_transparent`が定義されないのは、互換性のためである。 + - これらのオーバーロードは、`map`のようなコンテナに対し、検索操作で文字列リテラルを渡した際に、キー型の一時オブジェクトが生成されるコストを減らすためにある。 ## 例 @@ -147,3 +174,5 @@ key = two, value = 2, is inserted = false, is empty = false - [N4006 An improved emplace() for unique-key maps](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4006.html) - [N4240 Improved insertion interface for unique-key maps (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4240.html) - [N4279 Improved insertion interface for unique-key maps (Revision 2.3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4279.html) +- [P2363R5: Extending associative containers with the remaining heterogeneous overloads](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2363r5.html) + - C++26で`template `のバージョンが追加された From 26ded1a892908b4b1afc182aa7bd669ed1d2a03f Mon Sep 17 00:00:00 2001 From: koki watanabe Date: Wed, 21 May 2025 00:54:16 +0900 Subject: [PATCH 1714/3948] fix: reflect issue conversation --- .../unordered_map/unordered_map/clear.md | 20 ++++++++++++++++++- .../unordered_map/unordered_multimap/clear.md | 20 ++++++++++++++++++- .../unordered_set/unordered_multiset/clear.md | 20 ++++++++++++++++++- .../unordered_set/unordered_set/clear.md | 20 ++++++++++++++++++- 4 files changed, 76 insertions(+), 4 deletions(-) diff --git a/reference/unordered_map/unordered_map/clear.md b/reference/unordered_map/unordered_map/clear.md index 92bc6159b3..c84f0cf83c 100644 --- a/reference/unordered_map/unordered_map/clear.md +++ b/reference/unordered_map/unordered_map/clear.md @@ -33,8 +33,26 @@ void clear() noexcept; 投げない。 +## 備考 +- clear() は バケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格上は要求していない。 +実装によっては clear 後もバケット配列が温存され、動的メモリが残る場合がある。 +- メモリを確実に解放したいときには以下のように操作を行う +```CPP +std::unordered_map tmp; +s.swap(tmp); +``` + + ## 計算量 -本関数呼び出し前のバケット数([`bucket_count`](bucket_count.md)`()`)に比例 +本関数呼び出し前のコンテナの要素数([`size`](size.md)`()`)に比例 + +### 計算量に関する備考 +- 多くの実装(GCC libstdc++, LLVM libc++ など)は + 1. すべてのバケットを順に走査し + 2. 各バケットを破棄する + +という手順を取るため、実行時間は概ね [`bucket_count`](bucket_count.md)`()` + [`size`](size.md)`()` に比例 する傾向がある。 +これは規格が定義する「計算量」(オブジェクトに対する操作の数)とは別物である。 ## 例 diff --git a/reference/unordered_map/unordered_multimap/clear.md b/reference/unordered_map/unordered_multimap/clear.md index cd593049ea..399652ef34 100644 --- a/reference/unordered_map/unordered_multimap/clear.md +++ b/reference/unordered_map/unordered_multimap/clear.md @@ -33,8 +33,26 @@ void clear() noexcept; 投げない。 +## 備考 +- clear() は バケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格上は要求していない。 +実装によっては clear 後もバケット配列が温存され、動的メモリが残る場合がある。 +- メモリを確実に解放したいときには以下のように操作を行う +```CPP +std::unordered_multimap tmp; +s.swap(tmp); +``` + + ## 計算量 -本関数呼び出し前のバケット数([`bucket_count`](bucket_count.md)`()`)に比例 +本関数呼び出し前のコンテナの要素数([`size`](size.md)`()`)に比例 + +### 計算量に関する備考 +- 多くの実装(GCC libstdc++, LLVM libc++ など)は + 1. すべてのバケットを順に走査し + 2. 各バケットを破棄する + +という手順を取るため、実行時間は概ね [`bucket_count`](bucket_count.md)`()` + [`size`](size.md)`()` に比例 する傾向がある。 +これは規格が定義する「計算量」(オブジェクトに対する操作の数)とは別物である。 ## 例 diff --git a/reference/unordered_set/unordered_multiset/clear.md b/reference/unordered_set/unordered_multiset/clear.md index ed4129e925..295b271219 100644 --- a/reference/unordered_set/unordered_multiset/clear.md +++ b/reference/unordered_set/unordered_multiset/clear.md @@ -33,8 +33,26 @@ void clear() noexcept; 投げない。 +## 備考 +- clear() は バケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格上は要求していない。 +実装によっては clear 後もバケット配列が温存され、動的メモリが残る場合がある。 +- メモリを確実に解放したいときには以下のように操作を行う +```CPP +std::unordered_multiset tmp; +s.swap(tmp); +``` + + ## 計算量 -本関数呼び出し前のバケット数([`bucket_count`](bucket_count.md)`()`)に比例 +本関数呼び出し前のコンテナの要素数([`size`](size.md)`()`)に比例 + +### 計算量に関する備考 +- 多くの実装(GCC libstdc++, LLVM libc++ など)は + 1. すべてのバケットを順に走査し + 2. 各バケットを破棄する + +という手順を取るため、実行時間は概ね [`bucket_count`](bucket_count.md)`()` + [`size`](size.md)`()` に比例 する傾向がある。 +これは規格が定義する「計算量」(オブジェクトに対する操作の数)とは別物である。 ## 例 diff --git a/reference/unordered_set/unordered_set/clear.md b/reference/unordered_set/unordered_set/clear.md index 0062e4a920..9e45067d9c 100644 --- a/reference/unordered_set/unordered_set/clear.md +++ b/reference/unordered_set/unordered_set/clear.md @@ -33,8 +33,26 @@ void clear() noexcept; 投げない。 +## 備考 +- clear() は バケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格上は要求していない。 +実装によっては clear 後もバケット配列が温存され、動的メモリが残る場合がある。 +- メモリを確実に解放したいときには以下のように操作を行う +```CPP +std::unordered_set tmp; +s.swap(tmp); +``` + + ## 計算量 -本関数呼び出し前のバケット数([`bucket_count`](bucket_count.md)`()`)に比例 +本関数呼び出し前のコンテナの要素数([`size`](size.md)`()`)に比例 + +### 計算量に関する備考 +- 多くの実装(GCC libstdc++, LLVM libc++ など)は + 1. すべてのバケットを順に走査し + 2. 各バケットを破棄する + +という手順を取るため、実行時間は概ね [`bucket_count`](bucket_count.md)`()` + [`size`](size.md)`()` に比例 する傾向がある。 +これは規格が定義する「計算量」(オブジェクトに対する操作の数)とは別物である。 ## 例 From 588262dd873ddedd784e9b27f11042090a8f21a4 Mon Sep 17 00:00:00 2001 From: koki watanabe Date: Wed, 21 May 2025 00:56:22 +0900 Subject: [PATCH 1715/3948] fix: format --- reference/unordered_map/unordered_map/clear.md | 4 ++-- reference/unordered_map/unordered_multimap/clear.md | 4 ++-- reference/unordered_set/unordered_multiset/clear.md | 4 ++-- reference/unordered_set/unordered_set/clear.md | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/reference/unordered_map/unordered_map/clear.md b/reference/unordered_map/unordered_map/clear.md index c84f0cf83c..f08c941536 100644 --- a/reference/unordered_map/unordered_map/clear.md +++ b/reference/unordered_map/unordered_map/clear.md @@ -48,8 +48,8 @@ s.swap(tmp); ### 計算量に関する備考 - 多くの実装(GCC libstdc++, LLVM libc++ など)は - 1. すべてのバケットを順に走査し - 2. 各バケットを破棄する + 1. すべてのバケットを順に走査し + 2. 各バケットを破棄する という手順を取るため、実行時間は概ね [`bucket_count`](bucket_count.md)`()` + [`size`](size.md)`()` に比例 する傾向がある。 これは規格が定義する「計算量」(オブジェクトに対する操作の数)とは別物である。 diff --git a/reference/unordered_map/unordered_multimap/clear.md b/reference/unordered_map/unordered_multimap/clear.md index 399652ef34..1709e5a12c 100644 --- a/reference/unordered_map/unordered_multimap/clear.md +++ b/reference/unordered_map/unordered_multimap/clear.md @@ -48,8 +48,8 @@ s.swap(tmp); ### 計算量に関する備考 - 多くの実装(GCC libstdc++, LLVM libc++ など)は - 1. すべてのバケットを順に走査し - 2. 各バケットを破棄する + 1. すべてのバケットを順に走査し + 2. 各バケットを破棄する という手順を取るため、実行時間は概ね [`bucket_count`](bucket_count.md)`()` + [`size`](size.md)`()` に比例 する傾向がある。 これは規格が定義する「計算量」(オブジェクトに対する操作の数)とは別物である。 diff --git a/reference/unordered_set/unordered_multiset/clear.md b/reference/unordered_set/unordered_multiset/clear.md index 295b271219..6297aa4b32 100644 --- a/reference/unordered_set/unordered_multiset/clear.md +++ b/reference/unordered_set/unordered_multiset/clear.md @@ -48,8 +48,8 @@ s.swap(tmp); ### 計算量に関する備考 - 多くの実装(GCC libstdc++, LLVM libc++ など)は - 1. すべてのバケットを順に走査し - 2. 各バケットを破棄する + 1. すべてのバケットを順に走査し + 2. 各バケットを破棄する という手順を取るため、実行時間は概ね [`bucket_count`](bucket_count.md)`()` + [`size`](size.md)`()` に比例 する傾向がある。 これは規格が定義する「計算量」(オブジェクトに対する操作の数)とは別物である。 diff --git a/reference/unordered_set/unordered_set/clear.md b/reference/unordered_set/unordered_set/clear.md index 9e45067d9c..99d4dfc32c 100644 --- a/reference/unordered_set/unordered_set/clear.md +++ b/reference/unordered_set/unordered_set/clear.md @@ -48,8 +48,8 @@ s.swap(tmp); ### 計算量に関する備考 - 多くの実装(GCC libstdc++, LLVM libc++ など)は - 1. すべてのバケットを順に走査し - 2. 各バケットを破棄する + 1. すべてのバケットを順に走査し + 2. 各バケットを破棄する という手順を取るため、実行時間は概ね [`bucket_count`](bucket_count.md)`()` + [`size`](size.md)`()` に比例 する傾向がある。 これは規格が定義する「計算量」(オブジェクトに対する操作の数)とは別物である。 From 6f51ec9fc5d2391a979c581a5b50ca35faf44f14 Mon Sep 17 00:00:00 2001 From: koki watanabe Date: Wed, 21 May 2025 01:01:47 +0900 Subject: [PATCH 1716/3948] fix: minor fix --- reference/unordered_map/unordered_map/clear.md | 2 +- reference/unordered_map/unordered_multimap/clear.md | 2 +- reference/unordered_set/unordered_multiset/clear.md | 2 +- reference/unordered_set/unordered_set/clear.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/unordered_map/unordered_map/clear.md b/reference/unordered_map/unordered_map/clear.md index f08c941536..15cf893c73 100644 --- a/reference/unordered_map/unordered_map/clear.md +++ b/reference/unordered_map/unordered_map/clear.md @@ -51,7 +51,7 @@ s.swap(tmp); 1. すべてのバケットを順に走査し 2. 各バケットを破棄する -という手順を取るため、実行時間は概ね [`bucket_count`](bucket_count.md)`()` + [`size`](size.md)`()` に比例 する傾向がある。 +という手順を取るため、実行時間は概ね [`bucket_count`](bucket_count.md)`()` + [`size`](size.md)`()` に比例する傾向がある。 これは規格が定義する「計算量」(オブジェクトに対する操作の数)とは別物である。 diff --git a/reference/unordered_map/unordered_multimap/clear.md b/reference/unordered_map/unordered_multimap/clear.md index 1709e5a12c..b57e326f08 100644 --- a/reference/unordered_map/unordered_multimap/clear.md +++ b/reference/unordered_map/unordered_multimap/clear.md @@ -51,7 +51,7 @@ s.swap(tmp); 1. すべてのバケットを順に走査し 2. 各バケットを破棄する -という手順を取るため、実行時間は概ね [`bucket_count`](bucket_count.md)`()` + [`size`](size.md)`()` に比例 する傾向がある。 +という手順を取るため、実行時間は概ね [`bucket_count`](bucket_count.md)`()` + [`size`](size.md)`()` に比例する傾向がある。 これは規格が定義する「計算量」(オブジェクトに対する操作の数)とは別物である。 diff --git a/reference/unordered_set/unordered_multiset/clear.md b/reference/unordered_set/unordered_multiset/clear.md index 6297aa4b32..0c02d3ef4e 100644 --- a/reference/unordered_set/unordered_multiset/clear.md +++ b/reference/unordered_set/unordered_multiset/clear.md @@ -51,7 +51,7 @@ s.swap(tmp); 1. すべてのバケットを順に走査し 2. 各バケットを破棄する -という手順を取るため、実行時間は概ね [`bucket_count`](bucket_count.md)`()` + [`size`](size.md)`()` に比例 する傾向がある。 +という手順を取るため、実行時間は概ね [`bucket_count`](bucket_count.md)`()` + [`size`](size.md)`()` に比例する傾向がある。 これは規格が定義する「計算量」(オブジェクトに対する操作の数)とは別物である。 diff --git a/reference/unordered_set/unordered_set/clear.md b/reference/unordered_set/unordered_set/clear.md index 99d4dfc32c..72acb0a6b8 100644 --- a/reference/unordered_set/unordered_set/clear.md +++ b/reference/unordered_set/unordered_set/clear.md @@ -51,7 +51,7 @@ s.swap(tmp); 1. すべてのバケットを順に走査し 2. 各バケットを破棄する -という手順を取るため、実行時間は概ね [`bucket_count`](bucket_count.md)`()` + [`size`](size.md)`()` に比例 する傾向がある。 +という手順を取るため、実行時間は概ね [`bucket_count`](bucket_count.md)`()` + [`size`](size.md)`()` に比例する傾向がある。 これは規格が定義する「計算量」(オブジェクトに対する操作の数)とは別物である。 From 6b1650ab2dfc76432983b5162f80c9164883ea1c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 22 May 2025 14:41:30 +0900 Subject: [PATCH 1717/3948] =?UTF-8?q?map::insert=5For=5Fassign=20:=20?= =?UTF-8?q?=E3=82=AA=E3=83=BC=E3=83=90=E3=83=BC=E3=83=AD=E3=83=BC=E3=83=89?= =?UTF-8?q?=E7=95=AA=E5=8F=B7=E3=82=92=E6=8C=AF=E3=82=8A=E7=9B=B4=E3=81=97?= =?UTF-8?q?=20#1189?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/map/map/insert_or_assign.md | 39 +++++++++++++-------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/reference/map/map/insert_or_assign.md b/reference/map/map/insert_or_assign.md index 9fddf5c7eb..f6c5c07df3 100644 --- a/reference/map/map/insert_or_assign.md +++ b/reference/map/map/insert_or_assign.md @@ -14,21 +14,20 @@ template pair insert_or_assign(key_type&& k, M&& obj); // (2) C++17 +template +pair + insert_or_assign(K&& k, + M&& obj); // (3) C++26 template iterator insert_or_assign(const_iterator hint, const key_type& k, - M&& obj); // (3) C++17 + M&& obj); // (4) C++17 template iterator insert_or_assign(const_iterator hint, key_type&& k, - M&& obj); // (4) C++17 - -template -pair - insert_or_assign(K&& k, - M&& obj); // (5) C++26 + M&& obj); // (5) C++17 template iterator insert_or_assign(const_iterator hint, @@ -44,44 +43,44 @@ iterator - (1) : `key_type`型のキーをとって挿入もしくは代入する - (2) : `key_type`型の一時オブジェクトのキーをとって挿入もしくは代入する -- (3) : 挿入位置のヒントをともない、`key_type`型のキーをとって挿入もしくは代入する -- (4) : 挿入位置のヒントをともない、`key_type`型の一時オブジェクトのキーをとって挿入もしくは代入する -- (5) : `key_type`と比較可能な`K`型のキーをとって挿入もしくは代入する +- (3) : `key_type`と比較可能な`K`型のキーをとって挿入もしくは代入する +- (4) : 挿入位置のヒントをともない、`key_type`型のキーをとって挿入もしくは代入する +- (5) : 挿入位置のヒントをともない、`key_type`型の一時オブジェクトのキーをとって挿入もしくは代入する - (6) : 挿入位置のヒントをともない、`key_type`と比較可能な`K`型のキーをとって挿入もしくは代入する ## テンプレートパラメータ制約 -- (5), (6) : `key_compare::is_transparent` が妥当な式であること +- (3), (6) : `key_compare::is_transparent` が妥当な式であること ## 適格要件 -- (1)、(3)、(5)、(6) : [`is_assignable_v`](/reference/type_traits/is_assignable.md)`` が `true` であること。`value_type` は、`k`, [`forward`](/reference/utility/forward.md)`(obj)` から `map` に直接構築可能であること -- (2)、(4) : [`is_assignable_v`](/reference/type_traits/is_assignable.md)`` が `true` であること。`value_type` は、[`move`](/reference/utility/move.md)`(k)`, [`forward`](/reference/utility/forward.md)`(obj)` から `map` に直接構築可能であること +- (1)、(3)、(4)、(6) : [`is_assignable_v`](/reference/type_traits/is_assignable.md)`` が `true` であること。`value_type` は、`k`, [`forward`](/reference/utility/forward.md)`(obj)` から `map` に直接構築可能であること +- (2)、(5) : [`is_assignable_v`](/reference/type_traits/is_assignable.md)`` が `true` であること。`value_type` は、[`move`](/reference/utility/move.md)`(k)`, [`forward`](/reference/utility/forward.md)`(obj)` から `map` に直接構築可能であること なお、規格に記載はないが、`hint` は [`emplace_hint`](emplace_hint.md) と同様、コンテナの有効な読み取り専用イテレータである必要があるものと思われる。 ## 効果 -- (1)、(3)、(5)、(6) : `map` が `k` と同値のキーを持つ要素 `e` を持っている場合、`e.second` に [`forward`](/reference/utility/forward.md)`(obj)` を代入する。そうでなければ、`k`, [`forward`](/reference/utility/forward.md)`(obj)` から構築した `value_type` 型のオブジェクトを挿入する。 -- (2)、(4) : `map` が `k` と同値のキーを持つ要素 `e` を持っている場合、`e.second` に [`forward`](/reference/utility/forward.md)`(obj)` を代入する。そうでなければ、[`move`](/reference/utility/move.md)`(k)`, [`forward`](/reference/utility/forward.md)`(obj)` から構築した `value_type` 型のオブジェクトを挿入する。 +- (1)、(3)、(4)、(6) : `map` が `k` と同値のキーを持つ要素 `e` を持っている場合、`e.second` に [`forward`](/reference/utility/forward.md)`(obj)` を代入する。そうでなければ、`k`, [`forward`](/reference/utility/forward.md)`(obj)` から構築した `value_type` 型のオブジェクトを挿入する。 +- (2)、(5) : `map` が `k` と同値のキーを持つ要素 `e` を持っている場合、`e.second` に [`forward`](/reference/utility/forward.md)`(obj)` を代入する。そうでなければ、[`move`](/reference/utility/move.md)`(k)`, [`forward`](/reference/utility/forward.md)`(obj)` から構築した `value_type` 型のオブジェクトを挿入する。 ## 戻り値 -- (1)、(2)、(5) : イテレータと `bool` 値の [`pair`](/reference/utility/pair.md) を返す。 +- (1)、(2)、(3) : イテレータと `bool` 値の [`pair`](/reference/utility/pair.md) を返す。 - 挿入された場合には、`first` に挿入された要素へのイテレータ、`second` に `true` が設定される。 - 代入された場合には、`first` に代入された要素へのイテレータ、`second` に `false` が設定される。 -- (3)、(4)、(6) : +- (4)、(5)、(6) : - 挿入された場合には、挿入された要素へのイテレータを返す。 - 代入された場合には、代入された要素へのイテレータを返す。 ## 計算量 -- (1)、(2)、(5) : [`emplace`](emplace.md) と同じ。 -- (3)、(4)、(6) : [`emplace_hint`](emplace_hint.md) と同じ。 +- (1)、(2)、(3) : [`emplace`](emplace.md) と同じ。 +- (4)、(5)、(6) : [`emplace_hint`](emplace_hint.md) と同じ。 ## 備考 -- (5), (6) : +- (3), (6) : - `is_transparent`は、標準ライブラリの[`std::less`](/reference/functional/less.md)、[`std::greater`](/reference/functional/greater.md)といった関数オブジェクトの、`void`に対する特殊化で定義される。それ以外のテンプレートパラメータで`is_transparent`が定義されないのは、互換性のためである。 - これらのオーバーロードは、`map`のようなコンテナに対し、検索操作で文字列リテラルを渡した際に、キー型の一時オブジェクトが生成されるコストを減らすためにある。 From 6580bd966e200af44dc548b313e93b0a3f84340e Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 22 May 2025 14:47:43 +0900 Subject: [PATCH 1718/3948] =?UTF-8?q?unordered=5Fmap::insert=5For=5Fassign?= =?UTF-8?q?=20:=20C++26=E3=81=AE=E7=95=B0=E7=A8=AE=E6=B7=B7=E5=90=88?= =?UTF-8?q?=E3=83=AB=E3=83=83=E3=82=AF=E3=82=A2=E3=83=83=E3=83=97=E3=81=AB?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C=20#1189?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../unordered_map/insert_or_assign.md | 70 +++++++++++++------ 1 file changed, 49 insertions(+), 21 deletions(-) diff --git a/reference/unordered_map/unordered_map/insert_or_assign.md b/reference/unordered_map/unordered_map/insert_or_assign.md index a1fc699bd5..259f0ef984 100644 --- a/reference/unordered_map/unordered_map/insert_or_assign.md +++ b/reference/unordered_map/unordered_map/insert_or_assign.md @@ -7,16 +7,37 @@ ```cpp template -pair insert_or_assign(const key_type& k, M&& obj); // (1) +pair + insert_or_assign(const key_type& k, + M&& obj); // (1) C++17 template -pair insert_or_assign(key_type&& k, M&& obj); // (2) +pair + insert_or_assign(key_type&& k, + M&& obj); // (2) C++17 + +template +pair + insert_or_assign(K&& k, + M&& obj); // (3) C++26 template -iterator insert_or_assign(const_iterator hint, const key_type& k, M&& obj); // (3) +iterator + insert_or_assign(const_iterator hint, + const key_type& k, + M&& obj); // (4) C++17 template -iterator insert_or_assign(const_iterator hint, key_type&& k, M&& obj); // (4) +iterator + insert_or_assign(const_iterator hint, + key_type&& k, + M&& obj); // (5) C++17 + +template +iterator + insert_or_assign(const_iterator hint, + K&& k, + M&& obj); // (6) C++26 ``` * pair[link /reference/utility/pair.md] @@ -25,41 +46,48 @@ iterator insert_or_assign(const_iterator hint, key_type&& k, M&& obj); 引数 `hint` は、`k` を検索する際のヒントに使用される。(が、実際に使用されることはないものと思われる。[`emplace_hint`](emplace_hint.md) の備考を参照) +- (1) : `key_type`型のキーをとって挿入もしくは代入する +- (2) : `key_type`型の一時オブジェクトのキーをとって挿入もしくは代入する +- (3) : `key_type`と比較可能な`K`型のキーをとって挿入もしくは代入する +- (4) : 挿入位置のヒントをともない、`key_type`型のキーをとって挿入もしくは代入する +- (5) : 挿入位置のヒントをともない、`key_type`型の一時オブジェクトのキーをとって挿入もしくは代入する +- (6) : 挿入位置のヒントをともない、`key_type`と比較可能な`K`型のキーをとって挿入もしくは代入する + ## テンプレートパラメータ制約 -- (1)、(3) : [`is_assignable_v`](/reference/type_traits/is_assignable.md)`` が `true` であること。`value_type` は、`k`, [`forward`](/reference/utility/forward.md)`(obj)` から `map` に直接構築可能であること -- (2)、(4) : [`is_assignable_v`](/reference/type_traits/is_assignable.md)`` が `true` であること。`value_type` は、[`move`](/reference/utility/move.md)`(k)`, [`forward`](/reference/utility/forward.md)`(obj)` から `map` に直接構築可能であること +- (3), (6) : `key_compare::is_transparent` が妥当な式であること + + +## 適格要件 +- (1)、(3)、(4)、(6) : [`is_assignable_v`](/reference/type_traits/is_assignable.md)`` が `true` であること。`value_type` は、`k`, [`forward`](/reference/utility/forward.md)`(obj)` から `map` に直接構築可能であること +- (2)、(5) : [`is_assignable_v`](/reference/type_traits/is_assignable.md)`` が `true` であること。`value_type` は、[`move`](/reference/utility/move.md)`(k)`, [`forward`](/reference/utility/forward.md)`(obj)` から `map` に直接構築可能であること ## 効果 -- (1)、(3) : `unordered_map` が `k` と同値のキーを持つ要素 `e` を持っている場合、`e.second` に [`forward`](/reference/utility/forward.md)`(obj)` を代入する。そうでなければ、`k`, [`forward`](/reference/utility/forward.md)`(obj)` から構築した `value_type` 型のオブジェクトを挿入する。 -- (2)、(4) : `unordered_map` が `k` と同値のキーを持つ要素 `e` を持っている場合、`e.second` に [`forward`](/reference/utility/forward.md)`(obj)` を代入する。そうでなければ、[`move`](/reference/utility/move.md)`(k)`, [`forward`](/reference/utility/forward.md)`(obj)` から構築した `value_type` 型のオブジェクトを挿入する。 +- (1)、(3)、(4)、(6) : `unordered_map` が `k` と同値のキーを持つ要素 `e` を持っている場合、`e.second` に [`forward`](/reference/utility/forward.md)`(obj)` を代入する。そうでなければ、`k`, [`forward`](/reference/utility/forward.md)`(obj)` から構築した `value_type` 型のオブジェクトを挿入する。 +- (2)、(5) : `unordered_map` が `k` と同値のキーを持つ要素 `e` を持っている場合、`e.second` に [`forward`](/reference/utility/forward.md)`(obj)` を代入する。そうでなければ、[`move`](/reference/utility/move.md)`(k)`, [`forward`](/reference/utility/forward.md)`(obj)` から構築した `value_type` 型のオブジェクトを挿入する。 ## 戻り値 -- (1)、(2) : イテレータと `bool` 値の [`pair`](/reference/utility/pair.md) を返す。 +- (1)、(2)、(3) : イテレータと `bool` 値の [`pair`](/reference/utility/pair.md) を返す。 - 挿入された場合には、`first` に挿入された要素へのイテレータ、`second` に `true` が設定される。 - 代入された場合には、`first` に代入された要素へのイテレータ、`second` に `false` が設定される。 -- (3)、(4) : +- (4)、(5)、(6) : - 挿入された場合には、挿入された要素へのイテレータを返す。 - 代入された場合には、代入された要素へのイテレータを返す。 ## 計算量 -- (1)、(2) : [`emplace`](emplace.md) と同じ。 -- (3)、(4) : [`emplace_hint`](emplace_hint.md) と同じ。 +- (1)、(2)、(3) : [`emplace`](emplace.md) と同じ。 +- (4)、(5)、(6) : [`emplace_hint`](emplace_hint.md) と同じ。 ## 備考 - 規格にはこの関数の例外安全性についての記載が無いが、[`emplace`](emplace.md) や [`emplace_hint`](emplace_hint.md) と等価と考えて問題ないと思われる。 - - 規格にはこの関数が呼ばれた後のイテレータや要素へのポインタ・参照の有効性についての記載が無いが、[`emplace`](emplace.md) や [`emplace_hint`](emplace_hint.md) と等価と考えて問題ないと思われる。 - -- このメンバ関数の[`機能テストマクロ`](/lang/cpp17/feature_test_macros.md)は以下の通り。 - - | マクロ名 | 値 | - |---------------------------------------|----------| - | `__cpp_lib_unordered_map_try_emplace` | `201411` | +- (3), (6) : + - `is_transparent`は、標準ライブラリの[`std::less`](/reference/functional/less.md)、[`std::greater`](/reference/functional/greater.md)といった関数オブジェクトの、`void`に対する特殊化で定義される。それ以外のテンプレートパラメータで`is_transparent`が定義されないのは、互換性のためである。 + - これらのオーバーロードは、`map`のようなコンテナに対し、検索操作で文字列リテラルを渡した際に、キー型の一時オブジェクトが生成されるコストを減らすためにある。 ## 例 @@ -107,8 +135,6 @@ key = two, value = 42, is inserted = false, is empty = true ``` - - ## バージョン ### 言語 - C++17 @@ -142,3 +168,5 @@ key = two, value = 42, is inserted = false, is empty = true - [N4006 An improved emplace() for unique-key maps](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4006.html) - [N4240 Improved insertion interface for unique-key maps (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4240.html) - [N4279 Improved insertion interface for unique-key maps (Revision 2.3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4279.html) +- [P2363R5 Extending associative containers with the remaining heterogeneous overloads](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2363r5.html) + - C++26で`template `のバージョンが追加された From bd07d857fbfcbbd5b70f17025d583d9a88d84945 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 22 May 2025 14:54:19 +0900 Subject: [PATCH 1719/3948] =?UTF-8?q?unordered=5Fmap=20:=20at=E3=81=A8oper?= =?UTF-8?q?ator[]=E3=82=92C++26=E7=95=B0=E7=A8=AE=E6=B7=B7=E5=90=88?= =?UTF-8?q?=E3=83=AB=E3=83=83=E3=82=AF=E3=82=A2=E3=83=83=E3=83=97=E3=81=AB?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/map/map/at.md | 6 ++-- reference/unordered_map/unordered_map/at.md | 35 ++++++++++++++++--- .../unordered_map/unordered_map/op_at.md | 31 ++++++++++++++-- 3 files changed, 62 insertions(+), 10 deletions(-) diff --git a/reference/map/map/at.md b/reference/map/map/at.md index a73dc3c212..dd0782d6ad 100644 --- a/reference/map/map/at.md +++ b/reference/map/map/at.md @@ -10,9 +10,9 @@ T& at(const key_type& x); // (1) C++11 const T& at(const key_type & x) const; // (2) C++11 template -mapped_type& at(const K& x); // (3) C++26 +T& at(const K& x); // (3) C++26 template -const mapped_type& at(const K& x) const; // (4) C++26 +const T& at(const K& x) const; // (4) C++26 ``` ## 概要 @@ -40,7 +40,7 @@ const mapped_type& at(const K& x) const; // (4) C++26 ## 例外 -- 対応する要素が存在しない場合、[`std::out_of_range`](/reference/stdexcept.md)例外を送出する +- 指定されたキーに対応する要素が存在しない場合、[`std::out_of_range`](/reference/stdexcept.md)例外を送出する ## 備考 diff --git a/reference/unordered_map/unordered_map/at.md b/reference/unordered_map/unordered_map/at.md index a6e81bd1f7..aa49034fdb 100644 --- a/reference/unordered_map/unordered_map/at.md +++ b/reference/unordered_map/unordered_map/at.md @@ -6,24 +6,49 @@ * cpp11[meta cpp] ```cpp -T& at(const key_type& x); -const T& at(const key_type & x) const; +T& at(const key_type& x); // (1) C++11 +const T& at(const key_type & x) const; // (2) C++11 + +template +T& at(const K& x); // (3) C++26 +template +const T& at(const K& x) const; // (4) C++26 ``` ## 概要 参照のためのメソッドで、取り出す時にキーの存在チェックをする。 +- (1), (2) : クラスのテンプレートパラメータ`key_type`型のキーに対応する要素を取得する +- (3), (4) : `key_type`と比較可能な`K`型のキーに対応する要素を取得する + + +## テンプレートパラメータ制約 +- (3), (4) : `key_compare::is_transparent` が妥当な式であること + + +## 事前条件 +- (3), (4) : [`find`](find.md)`(x)`が妥当な式であり、定義された動作をすること + + ## 戻り値 -キーxに対応する値を返す。 +キー`x`に対応する値を返す。 + ## 例外 -オブジェクトが存在しないときは、out_of_range例外を投げる。 +- 指定されたキーに対応する要素が存在しない場合、[`std::out_of_range`](/reference/stdexcept.md)例外を送出する + ## 計算量 - 平均: 定数時間 - 最悪: [`size`](size.md) について線形時間 +## 備考 +- (3), (4) : + - `is_transparent`は、標準ライブラリの[`std::less`](/reference/functional/less.md)、[`std::greater`](/reference/functional/greater.md)といった関数オブジェクトの、`void`に対する特殊化で定義される。それ以外のテンプレートパラメータで`is_transparent`が定義されないのは、互換性のためである。 + - これらのオーバーロードは、`map`のようなコンテナに対し、検索操作で文字列リテラルを渡した際に、キー型の一時オブジェクトが生成されるコストを減らすためにある。 + + ## 例 ```cpp example #include @@ -81,3 +106,5 @@ exception std::out_of_range ## 参照 - [LWG Issue 761. `unordered_map` needs an `at()` member function](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#761) +- [P2363R5 Extending associative containers with the remaining heterogeneous overloads](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2363r5.html) + - C++26で`template `のバージョンが追加された diff --git a/reference/unordered_map/unordered_map/op_at.md b/reference/unordered_map/unordered_map/op_at.md index d4d4e79101..a06ea79464 100644 --- a/reference/unordered_map/unordered_map/op_at.md +++ b/reference/unordered_map/unordered_map/op_at.md @@ -6,24 +6,44 @@ * cpp11[meta cpp] ```cpp -T& operator[](const key_type& x); -T& operator[](key_type&& x); +T& operator[](const key_type& x); // (1) C++11 + +T& operator[](key_type&& x); // (2) C++11 + +template +T& operator[](K&& k); // (3) C++26 ``` ## 概要 -要素へのアクセス +要素へのアクセス。 + +- (1), (2) : クラスのテンプレートパラメータ`key_type`型のキーに対応する要素を取得する +- (3) : `key_type`と比較可能な`K`型のキーに対応する要素を取得する + + +## テンプレートパラメータ制約 +- (3) : `key_compare::is_transparent` が妥当な式であること + ## 戻り値 キー`x`に対応する値を返す。対応する要素が存在しない場合は、要素を値初期化して参照を返す。 + ## 例外 ハッシュ関数以外から例外が投げられた場合には、対応する要素がない場合の新規要素の挿入処理は実施されない。 + ## 計算量 - 平均: 定数時間 - 最悪: [`size`](size.md) について線形時間 +## 備考 +- (3) : + - `is_transparent`は、標準ライブラリの[`std::less`](/reference/functional/less.md)、[`std::greater`](/reference/functional/greater.md)といった関数オブジェクトの、`void`に対する特殊化で定義される。それ以外のテンプレートパラメータで`is_transparent`が定義されないのは、互換性のためである。 + - これらのオーバーロードは、`map`のようなコンテナに対し、検索操作で文字列リテラルを渡した際に、キー型の一時オブジェクトが生成されるコストを減らすためにある。 + + ## 例 ```cpp example #include @@ -78,3 +98,8 @@ size=2 |-----------------------------|----------------| | [`operator=`](op_assign.md) | 代入演算子 | | [`insert`](insert.md) | 要素を挿入する | + + +## 参照 +- [P2363R5 Extending associative containers with the remaining heterogeneous overloads](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2363r5.html) + - C++26で`template `のバージョンが追加された From 567ae393df32e6e6a8bd4e7275da6ad2ae966712 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 22 May 2025 15:06:46 +0900 Subject: [PATCH 1720/3948] =?UTF-8?q?unordered=5Fmap::bucket=20:=20C++26?= =?UTF-8?q?=E7=95=B0=E7=A8=AE=E6=B7=B7=E5=90=88=E3=83=AB=E3=83=83=E3=82=AF?= =?UTF-8?q?=E3=82=A2=E3=83=83=E3=83=97=E3=81=AB=E5=AF=BE=E5=BF=9C=20#1189?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../unordered_map/unordered_map/bucket.md | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/reference/unordered_map/unordered_map/bucket.md b/reference/unordered_map/unordered_map/bucket.md index 2f7729450f..25418c5ded 100644 --- a/reference/unordered_map/unordered_map/bucket.md +++ b/reference/unordered_map/unordered_map/bucket.md @@ -6,20 +6,29 @@ * cpp11[meta cpp] ```cpp -size_type bucket(const key_type& k) const; +size_type bucket(const key_type& k) const; // (1) C++11 + +template +size_type bucket(const K& k) const; // (2) C++26 ``` ## 概要 指定したキーと等価な要素が格納されている場合、そのバケットのインデックス(添え字)を取得する。 -## 要件 +## テンプレートパラメータ制約 +- (2) : `key_compare::is_transparent` が妥当な式であること + + +## 事前条件 当該コンテナは [`bucket_count`](bucket_count.md)`() > 0` であること ## 戻り値 パラメータ `k` と等価なキーの要素が格納されているバケットのインデックス(添え字) + +## 事後条件 戻り値は `[0,` [`bucket_count`](bucket_count.md)`())` の範囲である。 @@ -28,7 +37,10 @@ size_type bucket(const key_type& k) const; ## 備考 -指定したキーと等価な要素が格納されていない場合、そのキーを挿入した際に [`rehash`](rehash.md) が発生しなければ格納されるバケットのインデックス(添え字)が返る。 +- 指定したキーと等価な要素が格納されていない場合、そのキーを挿入した際に [`rehash`](rehash.md) が発生しなければ格納されるバケットのインデックス(添え字)が返る。 +- (2) : + - `is_transparent`は、標準ライブラリの[`std::less`](/reference/functional/less.md)、[`std::greater`](/reference/functional/greater.md)といった関数オブジェクトの、`void`に対する特殊化で定義される。それ以外のテンプレートパラメータで`is_transparent`が定義されないのは、互換性のためである。 + - これらのオーバーロードは、`map`のようなコンテナに対し、検索操作で文字列リテラルを渡した際に、キー型の一時オブジェクトが生成されるコストを減らすためにある。 ## 例 @@ -95,3 +107,7 @@ key = H, bucket = 6, bucket_size = 0 |---------------------------------------------|----------------------| | [`max_bucket_count`](max_bucket_count.md) | 最大バケット数の取得 | + +## 参照 +- [P2363R5 Extending associative containers with the remaining heterogeneous overloads](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2363r5.html) + - C++26で`template `のバージョンが追加された From 8378911c8421931c861ebf61ff4a0974e67b3823 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 22 May 2025 15:08:47 +0900 Subject: [PATCH 1721/3948] =?UTF-8?q?unordered=5Fmap::bucket=20:=20?= =?UTF-8?q?=E3=82=AA=E3=83=BC=E3=83=90=E3=83=BC=E3=83=AD=E3=83=BC=E3=83=89?= =?UTF-8?q?=E3=81=AE=E6=A6=82=E8=A6=81=E3=82=92=E8=A8=98=E8=BC=89=20#1189?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/unordered_map/unordered_map/bucket.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reference/unordered_map/unordered_map/bucket.md b/reference/unordered_map/unordered_map/bucket.md index 25418c5ded..0a02d5c0d5 100644 --- a/reference/unordered_map/unordered_map/bucket.md +++ b/reference/unordered_map/unordered_map/bucket.md @@ -15,6 +15,9 @@ size_type bucket(const K& k) const; // (2) C++26 ## 概要 指定したキーと等価な要素が格納されている場合、そのバケットのインデックス(添え字)を取得する。 +- (1) : `key_type`型のキーを受け取って、バケットのインデックスを取得する +- (2) : `key_type`と比較可能なキーを受け取って、バケットのインデックスを取得する + ## テンプレートパラメータ制約 - (2) : `key_compare::is_transparent` が妥当な式であること From 4d246b623406cad4bdf1376e1c84471d5117c744 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 22 May 2025 15:11:34 +0900 Subject: [PATCH 1722/3948] =?UTF-8?q?unordered=5Fmultimap::bucket=20:=20C+?= =?UTF-8?q?+26=E7=95=B0=E7=A8=AE=E6=B7=B7=E5=90=88=E3=83=AB=E3=83=83?= =?UTF-8?q?=E3=82=AF=E3=82=A2=E3=83=83=E3=83=97=E3=81=AB=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=20#1189?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../unordered_multimap/bucket.md | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/reference/unordered_map/unordered_multimap/bucket.md b/reference/unordered_map/unordered_multimap/bucket.md index ad908cc31d..a4e16b2616 100644 --- a/reference/unordered_map/unordered_multimap/bucket.md +++ b/reference/unordered_map/unordered_multimap/bucket.md @@ -6,20 +6,32 @@ * cpp11[meta cpp] ```cpp -size_type bucket(const key_type& k) const; +size_type bucket(const key_type& k) const; // (1) C++26 + +template +size_type bucket(const K& k) const; // (2) C++26 ``` ## 概要 指定したキーと等価な要素が格納されている場合、そのバケットのインデックス(添え字)を取得する。 +- (1) : `key_type`型のキーを受け取って、バケットのインデックスを取得する +- (2) : `key_type`と比較可能なキーを受け取って、バケットのインデックスを取得する + + +## テンプレートパラメータ制約 +- (2) : `key_compare::is_transparent` が妥当な式であること -## 要件 + +## 事前条件 当該コンテナは [`bucket_count`](bucket_count.md)`() > 0` であること ## 戻り値 パラメータ `k` と等価なキーの要素が格納されているバケットのインデックス(添え字) + +## 事後条件 戻り値は `[0,` [`bucket_count`](bucket_count.md)`())` の範囲である。 @@ -28,7 +40,10 @@ size_type bucket(const key_type& k) const; ## 備考 -指定したキーと等価な要素が格納されていない場合、そのキーを挿入した際に [`rehash`](rehash.md) が発生しなければ格納されるバケットのインデックス(添え字)が返る。 +- 指定したキーと等価な要素が格納されていない場合、そのキーを挿入した際に [`rehash`](rehash.md) が発生しなければ格納されるバケットのインデックス(添え字)が返る。 +- (2) : + - `is_transparent`は、標準ライブラリの[`std::less`](/reference/functional/less.md)、[`std::greater`](/reference/functional/greater.md)といった関数オブジェクトの、`void`に対する特殊化で定義される。それ以外のテンプレートパラメータで`is_transparent`が定義されないのは、互換性のためである。 + - これらのオーバーロードは、`map`のようなコンテナに対し、検索操作で文字列リテラルを渡した際に、キー型の一時オブジェクトが生成されるコストを減らすためにある。 ## 例 @@ -95,3 +110,6 @@ key = H, bucket = 6, bucket_size = 0 |---------------------------------------------|----------------------| | [`max_bucket_count`](max_bucket_count.md) | 最大バケット数の取得 | +## 参照 +- [P2363R5 Extending associative containers with the remaining heterogeneous overloads](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2363r5.html) + - C++26で`template `のバージョンが追加された From e350c4dae68548cdcb156be5d492d7bc345b0fa5 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 22 May 2025 15:51:56 +0900 Subject: [PATCH 1723/3948] =?UTF-8?q?unordered=5Fset::insert=20:=20?= =?UTF-8?q?=E3=82=AA=E3=83=BC=E3=83=90=E3=83=BC=E3=83=AD=E3=83=BC=E3=83=89?= =?UTF-8?q?=E7=95=AA=E5=8F=B7=E3=82=92=E6=8C=AF=E3=82=8A=E7=9B=B4=E3=81=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 左辺値版と右辺値版をひとつとして扱っていた --- .../unordered_set/unordered_set/insert.md | 144 +++++++++--------- 1 file changed, 70 insertions(+), 74 deletions(-) diff --git a/reference/unordered_set/unordered_set/insert.md b/reference/unordered_set/unordered_set/insert.md index ffa4344d83..7a2b876475 100644 --- a/reference/unordered_set/unordered_set/insert.md +++ b/reference/unordered_set/unordered_set/insert.md @@ -6,19 +6,19 @@ * cpp11[meta cpp] ```cpp -pair insert(const value_type& v); -pair insert(value_type&& rv); // (1) +pair insert(const value_type& v); // (1) C++11 +pair insert(value_type&& rv); // (2) C++11 -iterator insert(const_iterator position, const value_type& v); -iterator insert(const_iterator position, value_type&& rv); // (2) +iterator insert(const_iterator position, const value_type& v); // (3) C++11 +iterator insert(const_iterator position, value_type&& rv); // (4) C++11 template -void insert(InputIterator first, InputIterator last); // (3) +void insert(InputIterator first, InputIterator last); // (5) C++11 -void insert(initializer_list il); // (4) +void insert(initializer_list il); // (6) C++11 -insert_return_type insert(node_type&& nh); // (5) C++17 -iterator insert(const_iterator hint, node_type&& nh); // (6) C++17 +insert_return_type insert(node_type&& nh); // (7) C++17 +iterator insert(const_iterator hint, node_type&& nh); // (8) C++17 ``` * pair[link /reference/utility/pair.md] * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -26,58 +26,59 @@ iterator insert(const_iterator hint, node_type&& nh); // (6) C++17 ## 概要 コンテナに要素を追加する。 - -## 要件 -- `v` を引数にとる形式((1)、(2)の上側)では、`value_type` はコンテナに対してコピー挿入可能(CopyInsertable)でなければならない。 - コンテナに対してコピー挿入可能とは、`m` をアロケータ型 `allocator_type` の左辺値、`p` を要素型 `value_type` へのポインタとすると、以下の式が適格(well-formed)であるということである。 - - `std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::`[`construct`](/reference/memory/allocator_traits/construct.md)`(m, p, v);` - -- `rv` を引数にとる形式((1)、(2)の下側)では、`value_type` はコンテナに対してムーブ挿入可能(MoveInsertable)でなければならない。 - コンテナに対してムーブ挿入可能とは、`m` をアロケータ型 `allocator_type` の左辺値、`p` を要素型 `value_type` へのポインタとすると、以下の式が適格(well-formed)であるということである。 - - `std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::`[`construct`](/reference/memory/allocator_traits/construct.md)`(m, p, std::`[`move`](/reference/utility/move.md)`(rv));` - -- 引数 `position` は、コンテナの有効な読み取り専用イテレータでなければならない。 - なお、標準では間接参照可能(dereferenceable)である必要があることになっているが、その必要はない(つまり、最終要素の次を指すイテレータでも良い)ものと思われる。 - -- 引数 `first`、および、`last`は、入力イテレータの要件を満たし、かつ、イテレータ範囲 `[first, last)` が当該コンテナ**以外を指す**有効な範囲でなければならない。 - また、引数 `first`、および、`last` を引数にとる形式((3))では、このコンテナの要素型 `value_type` は、コンテナに対して `*first` から直接構築可能(EmplaceConstructible)でなければならない。 - ここで、コンテナに対して `*first` から直接構築可能とは、`m` をアロケータ型 `allocator_type` の左辺値、`p` を要素型 `value_type` へのポインタとすると、以下の式が適格(well-formed)であるということである。 - - `std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::`[`construct`](/reference/memory/allocator_traits/construct.md)`(m, p, *first);` - - なお、`first`、および、`last`は、標準では `value_type` を参照しなければならない(つまり、コンテナの `value_type` と `std::`[`iterator_traits`](/reference/iterator/iterator_traits.md)`::value_type` が同一の型でなければならない)ことになっているが、実際にはその必要はなく、上記の直接構築可能の要件を満たすだけで良いものと思われる。 - -- (4)の形式では、`value_type` はコンテナに対してコピー挿入可能でなければならない。 - -- (5), (6)の形式では、 `nh` は空である、または、`(*this).get_allocator() == nh.get_allocator()`でなければならない。 +- (1) : 新たな要素`v`をコピー挿入する +- (2) : 新たな要素`rv`をムーブ挿入する +- (3) : 新たな要素`v`をコピー挿入する。`hint`パラメータに適切な挿入位置を指定すれば、高速に挿入できる +- (4) : 新たな要素`rv`をムーブ挿入する。`hint`パラメータに適切な挿入位置を指定すれば、高速に挿入できる +- (5) : イテレータ範囲`[first, last)`の要素を挿入する +- (6) : 初期化子リスト`il`の要素を挿入する +- (7) : `nh`が空の場合、効果はない。それ以外の場合、`nh.key()`と等価のキーを持つ要素がコンテナにない場合に限り、`nh`が所有する要素を挿入する。 +- (8) : `nh`が空の場合、効果はなく、`(*this).end()`を返す。それ以外の場合、`nh.key()`と等価のキーを持つ要素がコンテナにない場合に限り、`nh`が所有する要素を挿入する。 `nh.key()`と同等のキーの要素を指すイテレータを常に返す。要素は、`hint`の直前の位置のできるだけ近くに挿入される。 + + +## 適格要件 +- (1)、(3) : `value_type` はコンテナに対してコピー挿入可能(CopyInsertable)でなければならない。 + - コンテナに対してコピー挿入可能とは、`m` をアロケータ型 `allocator_type` の左辺値、`p` を要素型 `value_type` へのポインタとすると、以下の式が適格(well-formed)であるということである。 + - `std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::`[`construct`](/reference/memory/allocator_traits/construct.md)`(m, p, v);` +- (2)、(4) : `value_type` はコンテナに対してムーブ挿入可能(MoveInsertable)でなければならない。 + - コンテナに対してムーブ挿入可能とは、`m` をアロケータ型 `allocator_type` の左辺値、`p` を要素型 `value_type` へのポインタとすると、以下の式が適格(well-formed)であるということである。 + - `std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::`[`construct`](/reference/memory/allocator_traits/construct.md)`(m, p, std::`[`move`](/reference/utility/move.md)`(rv));` +- (3)、(4) : 引数 `position` は、コンテナの有効な読み取り専用イテレータでなければならない。 + - なお、標準では間接参照可能(dereferenceable)である必要があることになっているが、その必要はない(つまり、最終要素の次を指すイテレータでも良い)ものと思われる。 +- (5) : 引数 `first`、および、`last`は、入力イテレータの要件を満たし、かつ、イテレータ範囲 `[first, last)` が当該コンテナ**以外を指す**有効な範囲でなければならない。 + - また、このコンテナの要素型 `value_type` は、コンテナに対して `*first` から直接構築可能(EmplaceConstructible)でなければならない。 + - ここで、コンテナに対して `*first` から直接構築可能とは、`m` をアロケータ型 `allocator_type` の左辺値、`p` を要素型 `value_type` へのポインタとすると、以下の式が適格(well-formed)であるということである。 + - `std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::`[`construct`](/reference/memory/allocator_traits/construct.md)`(m, p, *first);` + - なお、`first`、および、`last`は、標準では `value_type` を参照しなければならない(つまり、コンテナの `value_type` と `std::`[`iterator_traits`](/reference/iterator/iterator_traits.md)`::value_type` が同一の型でなければならない)ことになっているが、実際にはその必要はなく、上記の直接構築可能の要件を満たすだけで良いものと思われる。 +- (6) : `value_type` はコンテナに対してコピー挿入可能でなければならない。 + + +## 事前条件 +- (5), (6) : `nh` は空である、または、`(*this).get_allocator() == nh.get_allocator()`でなければならない。 ## 効果 -- (1) : 引数 `v`、あるいは `rv` で指定した値と等価なキーがコンテナに存在していなければ、当該要素を追加する。 -- (2) : 引数 `v`、あるいは `rv` で指定した値と等価なキーがコンテナに存在していなければ、当該要素を追加する。 - 引数 `position` は、要素の挿入位置を探し始める場所のヒントとして使用されるが、実装によって無視されるかもしれない。 -- (3) : イテレータ範囲 `[first, last)` のすべての要素 `t` に対して、(1)の形式の `insert(t)` を呼び出した場合と等価である。 -- (4) : (3)の形式を `insert(il.begin(), il.end())` として呼び出した場合と等価である。 -- (5) : `nh`が空の場合、効果はない。 -それ以外の場合、`nh.key()`と等価のキーを持つ要素がコンテナにない場合に限り、`nh`が所有する要素を挿入する。 -- (6) : `nh`が空の場合、効果はなく、`(*this).end()`を返す。 -それ以外の場合、`nh.key()`と等価のキーを持つ要素がコンテナにない場合に限り、`nh`が所有する要素を挿入する。`nh.key()`と等価のキーの要素を指すイテレータを常に返す。 -要素は、`hint`の直前の位置のできるだけ近くに挿入される。 +- (1)、(2) : 引数 `v`、あるいは `rv` で指定した値と等価なキーがコンテナに存在していなければ、当該要素を追加する。 +- (3)、(4) : 引数 `v`、あるいは `rv` で指定した値と等価なキーがコンテナに存在していなければ、当該要素を追加する。 + - 引数 `position` は、要素の挿入位置を探し始める場所のヒントとして使用されるが、実装によって無視されるかもしれない。 +- (5) : イテレータ範囲 `[first, last)` のすべての要素 `t` に対して、(1)の形式の `insert(t)` を呼び出した場合と等価である。 +- (6) : (3)の形式を `insert(il.begin(), il.end())` として呼び出した場合と等価である。 +- (7) : `nh`が空の場合、効果はない。それ以外の場合、`nh.key()`と等価のキーを持つ要素がコンテナにない場合に限り、`nh`が所有する要素を挿入する。 +- (8) : `nh`が空の場合、効果はなく、`(*this).end()`を返す。それ以外の場合、`nh.key()`と等価のキーを持つ要素がコンテナにない場合に限り、`nh`が所有する要素を挿入する。`nh.key()`と等価のキーの要素を指すイテレータを常に返す。 + - 要素は、`hint`の直前の位置のできるだけ近くに挿入される。 ## 戻り値 -- (1) : [`pair`](/reference/utility/pair.md) の `bool` 部分(`second` 部)は、要素が追加されたら `true`、追加されなかったら(既にあったら)`false`。 - [`pair`](/reference/utility/pair.md) の `iterator` 部分(`first` 部)は、追加された要素(`bool` 部分が `true` の場合)、あるいは、既にあった要素(`bool` 部分が `false` の場合)を指すイテレータ。 -- (2) : 新たな要素が追加された場合、その追加された要素を指すイテレータ。 +- (1)、(2) : [`pair`](/reference/utility/pair.md) の `bool` 部分(`second` 部)は、要素が追加されたら `true`、追加されなかったら(既にあったら)`false`。 + - [`pair`](/reference/utility/pair.md) の `iterator` 部分(`first` 部)は、追加された要素(`bool` 部分が `true` の場合)、あるいは、既にあった要素(`bool` 部分が `false` の場合)を指すイテレータ。 +- (3)、(4) : 新たな要素が追加された場合、その追加された要素を指すイテレータ。 新たな要素が追加されなかった場合、既にあった要素を指すイテレータ。 -- (3) : なし -- (4) : なし -- (5) : 戻り値としては、[`insert_return_type`](/reference/map/map.md)を返す。`insert_return_type`のイテレータ型メンバ変数`position`、`bool`型メンバ変数`inserted`に格納される値は(1), (2)のものと同じ情報である。`nh`が空の場合は、`position`は終端イテレータである。`node_type`型メンバ変数`node`には、 +- (5) : なし +- (6) : なし +- (7) : 戻り値としては、[`insert_return_type`](/reference/map/map.md)を返す。`insert_return_type`のイテレータ型メンバ変数`position`、`bool`型メンバ変数`inserted`に格納される値は(1), (2)のものと同じ情報である。`nh`が空の場合は、`position`は終端イテレータである。`node_type`型メンバ変数`node`には、 - 挿入された場合には、空の[ノードハンドル](/reference/node_handle/node_handle.md)。 - 挿入されなかった場合には、`nh`の値である。 -- (6) : `nh`が空の場合、`(*this).end()`を返す。そうではない場合、`nh`と等価のキーの要素を指すイテレータを常に返す。 +- (8) : `nh`が空の場合、`(*this).end()`を返す。そうではない場合、`nh`と等価のキーの要素を指すイテレータを常に返す。 ## 例外 @@ -85,28 +86,23 @@ iterator insert(const_iterator hint, node_type&& nh); // (6) C++17 ## 計算量 -- (1) : 平均的なケースでは定数(O(1))だが、最悪のケースではコンテナの要素数 [`size`](size.md)`()` に比例(O(N))。 -- (2) : 平均的なケースでは定数(O(1))だが、最悪のケースではコンテナの要素数 [`size`](size.md)`()` に比例(O(N))。 -- (3) : 平均的なケースでは引数の範囲の要素数 `std::`[`distance`](/reference/iterator/distance.md)`(first, last)` に比例(O(N))するが、最悪のケースでは引数の範囲の要素数 `std::`[`distance`](/reference/iterator/distance.md)`(first, last)` とコンテナの要素数 [`size()`](size.md) に 1 加えたものの積に比例(O(`std::`[`distance`](/reference/iterator/distance.md)`(first, last) * (`[`size`](size.md)`() + 1)`))。 -- (4) : (3)の形式を `insert(il.begin(), il.end())` として呼び出した場合と等価。 - -- (5), (6) : 平均的なケースでは `O(1)`、最悪のケースでは `O(size())`。 +- (1)、(2) : 平均的なケースでは定数(O(1))だが、最悪のケースではコンテナの要素数 [`size`](size.md)`()` に比例(O(N))。 +- (3)、(4) : 平均的なケースでは定数(O(1))だが、最悪のケースではコンテナの要素数 [`size`](size.md)`()` に比例(O(N))。 +- (5) : 平均的なケースでは引数の範囲の要素数 `std::`[`distance`](/reference/iterator/distance.md)`(first, last)` に比例(O(N))するが、最悪のケースでは引数の範囲の要素数 `std::`[`distance`](/reference/iterator/distance.md)`(first, last)` とコンテナの要素数 [`size()`](size.md) に 1 加えたものの積に比例(O(`std::`[`distance`](/reference/iterator/distance.md)`(first, last) * (`[`size`](size.md)`() + 1)`))。 +- (6) : (4)の形式を `insert(il.begin(), il.end())` として呼び出した場合と等価。 +- (7), (8) : 平均的なケースでは `O(1)`、最悪のケースでは `O(size())`。 ## 備考 - これらの関数が呼ばれた後も、当該コンテナ内の要素を指す参照は無効にはならない。 なお、規格書に明確な記載は無いが、当該コンテナ内の要素を指すポインタも無効にはならない。 - これらの関数が呼ばれた後も、呼び出しの前後でこのコンテナのバケット数([`bucket_count`](bucket_count.md)`()` の戻り値)が変わらなかった場合には当該コンテナを指すイテレータは無効にはならない。 - それ以外の場合は、当該コンテナを指すイテレータは無効になる可能性がある。 - コンテナのバケット数が変わらない場合とは、 - - * 追加しようとした要素と等価なキーの要素が全て既にコンテナに存在したため、要素が追加されなかった。 - * 要素追加後の要素数が、要素追加前のバケット数([`bucket_count`](bucket_count.md)`()` の戻り値)×最大負荷率([`max_load_factor`](max_load_factor.md)`()` の戻り値)よりも小さかった。 - - のいずれかである。 - なお、後者の条件は「よりも小さい」となっているが、最大負荷率の定義からすると「以下」の方が適切と思われる。[`reserve`](reserve.md) も参照。 - -- (5), (6) の場合、要素はコピーもムーブもされない。 + - それ以外の場合は、当該コンテナを指すイテレータは無効になる可能性がある。 + - コンテナのバケット数が変わらない場合とは、以下のいずれかである: + - 追加しようとした要素と等価なキーの要素が全て既にコンテナに存在したため、要素が追加されなかった。 + - 要素追加後の要素数が、要素追加前のバケット数([`bucket_count`](bucket_count.md)`()` の戻り値)×最大負荷率([`max_load_factor`](max_load_factor.md)`()` の戻り値)よりも小さかった。 + - なお、後者の条件は「よりも小さい」となっているが、最大負荷率の定義からすると「以下」の方が適切と思われる。[`reserve`](reserve.md) も参照。 +- (7), (8) の場合、要素はコピーもムーブもされない。 ## 例 @@ -130,7 +126,7 @@ int main() { std::cout << std::boolalpha; - // 一つの要素を挿入((1)の形式) + // 一つの要素を挿入((1)、(2)の形式) { std::unordered_set us{ 0, 1, 2, 3, 4, 5, }; @@ -141,7 +137,7 @@ int main() print("insert one element", us); } - // 一つの要素を挿入((2)の形式) + // 一つの要素を挿入((3)、(4)の形式) { std::unordered_set us{ 0, 1, 2, 3, 4, 5, }; @@ -152,7 +148,7 @@ int main() print("insert one element with hint", us); } - // 複数の要素を挿入((3)の形式) + // 複数の要素を挿入((5)の形式) { std::unordered_set us{ 0, 1, 2, 3, 4, 5, }; @@ -161,7 +157,7 @@ int main() print("insert range", us); } - // 複数の要素を挿入((4)の形式) + // 複数の要素を挿入((6)の形式) { std::unordered_set us{ 0, 1, 2, 3, 4, 5, }; @@ -203,7 +199,7 @@ insert initializer_list : 7 8 6 5 4 3 2 1 0 - [Visual C++](/implementation.md#visual_cpp): ? ## 実装例 -(2)以降の形式は、(1)の形式を使って実装することができる。 +(3)、(4)、(5)、(6)の形式は、(1)、(2)の形式を使って実装することができる。 ```cpp template @@ -257,7 +253,7 @@ inline void unordered_set::insert(initializer_list Date: Thu, 22 May 2025 15:56:38 +0900 Subject: [PATCH 1724/3948] =?UTF-8?q?=E3=82=A4=E3=83=B3=E3=83=87=E3=83=B3?= =?UTF-8?q?=E3=83=88=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../unordered_set/unordered_set/insert.md | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/reference/unordered_set/unordered_set/insert.md b/reference/unordered_set/unordered_set/insert.md index 7a2b876475..29a16a84dd 100644 --- a/reference/unordered_set/unordered_set/insert.md +++ b/reference/unordered_set/unordered_set/insert.md @@ -39,17 +39,17 @@ iterator insert(const_iterator hint, node_type&& nh); // (8) C++17 ## 適格要件 - (1)、(3) : `value_type` はコンテナに対してコピー挿入可能(CopyInsertable)でなければならない。 - コンテナに対してコピー挿入可能とは、`m` をアロケータ型 `allocator_type` の左辺値、`p` を要素型 `value_type` へのポインタとすると、以下の式が適格(well-formed)であるということである。 - - `std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::`[`construct`](/reference/memory/allocator_traits/construct.md)`(m, p, v);` + - `std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::`[`construct`](/reference/memory/allocator_traits/construct.md)`(m, p, v);` - (2)、(4) : `value_type` はコンテナに対してムーブ挿入可能(MoveInsertable)でなければならない。 - コンテナに対してムーブ挿入可能とは、`m` をアロケータ型 `allocator_type` の左辺値、`p` を要素型 `value_type` へのポインタとすると、以下の式が適格(well-formed)であるということである。 - - `std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::`[`construct`](/reference/memory/allocator_traits/construct.md)`(m, p, std::`[`move`](/reference/utility/move.md)`(rv));` + - `std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::`[`construct`](/reference/memory/allocator_traits/construct.md)`(m, p, std::`[`move`](/reference/utility/move.md)`(rv));` - (3)、(4) : 引数 `position` は、コンテナの有効な読み取り専用イテレータでなければならない。 - - なお、標準では間接参照可能(dereferenceable)である必要があることになっているが、その必要はない(つまり、最終要素の次を指すイテレータでも良い)ものと思われる。 + - なお、標準では間接参照可能(dereferenceable)である必要があることになっているが、その必要はない(つまり、最終要素の次を指すイテレータでも良い)ものと思われる。 - (5) : 引数 `first`、および、`last`は、入力イテレータの要件を満たし、かつ、イテレータ範囲 `[first, last)` が当該コンテナ**以外を指す**有効な範囲でなければならない。 - - また、このコンテナの要素型 `value_type` は、コンテナに対して `*first` から直接構築可能(EmplaceConstructible)でなければならない。 - - ここで、コンテナに対して `*first` から直接構築可能とは、`m` をアロケータ型 `allocator_type` の左辺値、`p` を要素型 `value_type` へのポインタとすると、以下の式が適格(well-formed)であるということである。 - - `std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::`[`construct`](/reference/memory/allocator_traits/construct.md)`(m, p, *first);` - - なお、`first`、および、`last`は、標準では `value_type` を参照しなければならない(つまり、コンテナの `value_type` と `std::`[`iterator_traits`](/reference/iterator/iterator_traits.md)`::value_type` が同一の型でなければならない)ことになっているが、実際にはその必要はなく、上記の直接構築可能の要件を満たすだけで良いものと思われる。 + - また、このコンテナの要素型 `value_type` は、コンテナに対して `*first` から直接構築可能(EmplaceConstructible)でなければならない。 + - ここで、コンテナに対して `*first` から直接構築可能とは、`m` をアロケータ型 `allocator_type` の左辺値、`p` を要素型 `value_type` へのポインタとすると、以下の式が適格(well-formed)であるということである。 + - `std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::`[`construct`](/reference/memory/allocator_traits/construct.md)`(m, p, *first);` + - なお、`first`、および、`last`は、標準では `value_type` を参照しなければならない(つまり、コンテナの `value_type` と `std::`[`iterator_traits`](/reference/iterator/iterator_traits.md)`::value_type` が同一の型でなければならない)ことになっているが、実際にはその必要はなく、上記の直接構築可能の要件を満たすだけで良いものと思われる。 - (6) : `value_type` はコンテナに対してコピー挿入可能でなければならない。 @@ -60,7 +60,7 @@ iterator insert(const_iterator hint, node_type&& nh); // (8) C++17 ## 効果 - (1)、(2) : 引数 `v`、あるいは `rv` で指定した値と等価なキーがコンテナに存在していなければ、当該要素を追加する。 - (3)、(4) : 引数 `v`、あるいは `rv` で指定した値と等価なキーがコンテナに存在していなければ、当該要素を追加する。 - - 引数 `position` は、要素の挿入位置を探し始める場所のヒントとして使用されるが、実装によって無視されるかもしれない。 + - 引数 `position` は、要素の挿入位置を探し始める場所のヒントとして使用されるが、実装によって無視されるかもしれない。 - (5) : イテレータ範囲 `[first, last)` のすべての要素 `t` に対して、(1)の形式の `insert(t)` を呼び出した場合と等価である。 - (6) : (3)の形式を `insert(il.begin(), il.end())` として呼び出した場合と等価である。 - (7) : `nh`が空の場合、効果はない。それ以外の場合、`nh.key()`と等価のキーを持つ要素がコンテナにない場合に限り、`nh`が所有する要素を挿入する。 @@ -70,7 +70,7 @@ iterator insert(const_iterator hint, node_type&& nh); // (8) C++17 ## 戻り値 - (1)、(2) : [`pair`](/reference/utility/pair.md) の `bool` 部分(`second` 部)は、要素が追加されたら `true`、追加されなかったら(既にあったら)`false`。 - - [`pair`](/reference/utility/pair.md) の `iterator` 部分(`first` 部)は、追加された要素(`bool` 部分が `true` の場合)、あるいは、既にあった要素(`bool` 部分が `false` の場合)を指すイテレータ。 + - [`pair`](/reference/utility/pair.md) の `iterator` 部分(`first` 部)は、追加された要素(`bool` 部分が `true` の場合)、あるいは、既にあった要素(`bool` 部分が `false` の場合)を指すイテレータ。 - (3)、(4) : 新たな要素が追加された場合、その追加された要素を指すイテレータ。 新たな要素が追加されなかった場合、既にあった要素を指すイテレータ。 - (5) : なし @@ -97,11 +97,11 @@ iterator insert(const_iterator hint, node_type&& nh); // (8) C++17 - これらの関数が呼ばれた後も、当該コンテナ内の要素を指す参照は無効にはならない。 なお、規格書に明確な記載は無いが、当該コンテナ内の要素を指すポインタも無効にはならない。 - これらの関数が呼ばれた後も、呼び出しの前後でこのコンテナのバケット数([`bucket_count`](bucket_count.md)`()` の戻り値)が変わらなかった場合には当該コンテナを指すイテレータは無効にはならない。 - - それ以外の場合は、当該コンテナを指すイテレータは無効になる可能性がある。 - - コンテナのバケット数が変わらない場合とは、以下のいずれかである: - - 追加しようとした要素と等価なキーの要素が全て既にコンテナに存在したため、要素が追加されなかった。 - - 要素追加後の要素数が、要素追加前のバケット数([`bucket_count`](bucket_count.md)`()` の戻り値)×最大負荷率([`max_load_factor`](max_load_factor.md)`()` の戻り値)よりも小さかった。 - - なお、後者の条件は「よりも小さい」となっているが、最大負荷率の定義からすると「以下」の方が適切と思われる。[`reserve`](reserve.md) も参照。 + - それ以外の場合は、当該コンテナを指すイテレータは無効になる可能性がある。 + - コンテナのバケット数が変わらない場合とは、以下のいずれかである: + - 追加しようとした要素と等価なキーの要素が全て既にコンテナに存在したため、要素が追加されなかった。 + - 要素追加後の要素数が、要素追加前のバケット数([`bucket_count`](bucket_count.md)`()` の戻り値)×最大負荷率([`max_load_factor`](max_load_factor.md)`()` の戻り値)よりも小さかった。 + - なお、後者の条件は「よりも小さい」となっているが、最大負荷率の定義からすると「以下」の方が適切と思われる。[`reserve`](reserve.md) も参照。 - (7), (8) の場合、要素はコピーもムーブもされない。 From 0ff1c70cff068a5069c9a2f51a7727e763055e1e Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 22 May 2025 16:04:22 +0900 Subject: [PATCH 1725/3948] =?UTF-8?q?=E3=82=A4=E3=83=B3=E3=83=87=E3=83=B3?= =?UTF-8?q?=E3=83=88=E3=82=92=E5=86=8D=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit VSCodeむずかしい… --- .../unordered_set/unordered_set/insert.md | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/reference/unordered_set/unordered_set/insert.md b/reference/unordered_set/unordered_set/insert.md index 29a16a84dd..0db8c87cf3 100644 --- a/reference/unordered_set/unordered_set/insert.md +++ b/reference/unordered_set/unordered_set/insert.md @@ -37,19 +37,19 @@ iterator insert(const_iterator hint, node_type&& nh); // (8) C++17 ## 適格要件 -- (1)、(3) : `value_type` はコンテナに対してコピー挿入可能(CopyInsertable)でなければならない。 +- (1)、(3) : `value_type` はコンテナに対してコピー挿入可能(CopyInsertable)でなければならない。 - コンテナに対してコピー挿入可能とは、`m` をアロケータ型 `allocator_type` の左辺値、`p` を要素型 `value_type` へのポインタとすると、以下の式が適格(well-formed)であるということである。 - - `std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::`[`construct`](/reference/memory/allocator_traits/construct.md)`(m, p, v);` -- (2)、(4) : `value_type` はコンテナに対してムーブ挿入可能(MoveInsertable)でなければならない。 + - `std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::`[`construct`](/reference/memory/allocator_traits/construct.md)`(m, p, v);` +- (2)、(4) : `value_type` はコンテナに対してムーブ挿入可能(MoveInsertable)でなければならない。 - コンテナに対してムーブ挿入可能とは、`m` をアロケータ型 `allocator_type` の左辺値、`p` を要素型 `value_type` へのポインタとすると、以下の式が適格(well-formed)であるということである。 - - `std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::`[`construct`](/reference/memory/allocator_traits/construct.md)`(m, p, std::`[`move`](/reference/utility/move.md)`(rv));` -- (3)、(4) : 引数 `position` は、コンテナの有効な読み取り専用イテレータでなければならない。 - - なお、標準では間接参照可能(dereferenceable)である必要があることになっているが、その必要はない(つまり、最終要素の次を指すイテレータでも良い)ものと思われる。 -- (5) : 引数 `first`、および、`last`は、入力イテレータの要件を満たし、かつ、イテレータ範囲 `[first, last)` が当該コンテナ**以外を指す**有効な範囲でなければならない。 - - また、このコンテナの要素型 `value_type` は、コンテナに対して `*first` から直接構築可能(EmplaceConstructible)でなければならない。 - - ここで、コンテナに対して `*first` から直接構築可能とは、`m` をアロケータ型 `allocator_type` の左辺値、`p` を要素型 `value_type` へのポインタとすると、以下の式が適格(well-formed)であるということである。 - - `std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::`[`construct`](/reference/memory/allocator_traits/construct.md)`(m, p, *first);` - - なお、`first`、および、`last`は、標準では `value_type` を参照しなければならない(つまり、コンテナの `value_type` と `std::`[`iterator_traits`](/reference/iterator/iterator_traits.md)`::value_type` が同一の型でなければならない)ことになっているが、実際にはその必要はなく、上記の直接構築可能の要件を満たすだけで良いものと思われる。 + - `std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::`[`construct`](/reference/memory/allocator_traits/construct.md)`(m, p, std::`[`move`](/reference/utility/move.md)`(rv));` +- (3)、(4) : 引数 `position` は、コンテナの有効な読み取り専用イテレータでなければならない。 + - なお、標準では間接参照可能(dereferenceable)である必要があることになっているが、その必要はない(つまり、最終要素の次を指すイテレータでも良い)ものと思われる。 +- (5) : 引数 `first`、および、`last`は、入力イテレータの要件を満たし、かつ、イテレータ範囲 `[first, last)` が当該コンテナ**以外を指す**有効な範囲でなければならない。 + - また、このコンテナの要素型 `value_type` は、コンテナに対して `*first` から直接構築可能(EmplaceConstructible)でなければならない。 + - ここで、コンテナに対して `*first` から直接構築可能とは、`m` をアロケータ型 `allocator_type` の左辺値、`p` を要素型 `value_type` へのポインタとすると、以下の式が適格(well-formed)であるということである。 + - `std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::`[`construct`](/reference/memory/allocator_traits/construct.md)`(m, p, *first);` + - なお、`first`、および、`last`は、標準では `value_type` を参照しなければならない(つまり、コンテナの `value_type` と `std::`[`iterator_traits`](/reference/iterator/iterator_traits.md)`::value_type` が同一の型でなければならない)ことになっているが、実際にはその必要はなく、上記の直接構築可能の要件を満たすだけで良いものと思われる。 - (6) : `value_type` はコンテナに対してコピー挿入可能でなければならない。 @@ -59,8 +59,8 @@ iterator insert(const_iterator hint, node_type&& nh); // (8) C++17 ## 効果 - (1)、(2) : 引数 `v`、あるいは `rv` で指定した値と等価なキーがコンテナに存在していなければ、当該要素を追加する。 -- (3)、(4) : 引数 `v`、あるいは `rv` で指定した値と等価なキーがコンテナに存在していなければ、当該要素を追加する。 - - 引数 `position` は、要素の挿入位置を探し始める場所のヒントとして使用されるが、実装によって無視されるかもしれない。 +- (3)、(4) : 引数 `v`、あるいは `rv` で指定した値と等価なキーがコンテナに存在していなければ、当該要素を追加する。 + - 引数 `position` は、要素の挿入位置を探し始める場所のヒントとして使用されるが、実装によって無視されるかもしれない。 - (5) : イテレータ範囲 `[first, last)` のすべての要素 `t` に対して、(1)の形式の `insert(t)` を呼び出した場合と等価である。 - (6) : (3)の形式を `insert(il.begin(), il.end())` として呼び出した場合と等価である。 - (7) : `nh`が空の場合、効果はない。それ以外の場合、`nh.key()`と等価のキーを持つ要素がコンテナにない場合に限り、`nh`が所有する要素を挿入する。 @@ -69,10 +69,10 @@ iterator insert(const_iterator hint, node_type&& nh); // (8) C++17 ## 戻り値 -- (1)、(2) : [`pair`](/reference/utility/pair.md) の `bool` 部分(`second` 部)は、要素が追加されたら `true`、追加されなかったら(既にあったら)`false`。 - - [`pair`](/reference/utility/pair.md) の `iterator` 部分(`first` 部)は、追加された要素(`bool` 部分が `true` の場合)、あるいは、既にあった要素(`bool` 部分が `false` の場合)を指すイテレータ。 -- (3)、(4) : 新たな要素が追加された場合、その追加された要素を指すイテレータ。 - 新たな要素が追加されなかった場合、既にあった要素を指すイテレータ。 +- (1)、(2) : [`pair`](/reference/utility/pair.md) の `bool` 部分(`second` 部)は、要素が追加されたら `true`、追加されなかったら(既にあったら)`false`。 + - [`pair`](/reference/utility/pair.md) の `iterator` 部分(`first` 部)は、追加された要素(`bool` 部分が `true` の場合)、あるいは、既にあった要素(`bool` 部分が `false` の場合)を指すイテレータ。 +- (3)、(4) : 新たな要素が追加された場合、その追加された要素を指すイテレータ。 + - 新たな要素が追加されなかった場合、既にあった要素を指すイテレータ。 - (5) : なし - (6) : なし - (7) : 戻り値としては、[`insert_return_type`](/reference/map/map.md)を返す。`insert_return_type`のイテレータ型メンバ変数`position`、`bool`型メンバ変数`inserted`に格納される値は(1), (2)のものと同じ情報である。`nh`が空の場合は、`position`は終端イテレータである。`node_type`型メンバ変数`node`には、 @@ -95,13 +95,13 @@ iterator insert(const_iterator hint, node_type&& nh); // (8) C++17 ## 備考 - これらの関数が呼ばれた後も、当該コンテナ内の要素を指す参照は無効にはならない。 - なお、規格書に明確な記載は無いが、当該コンテナ内の要素を指すポインタも無効にはならない。 -- これらの関数が呼ばれた後も、呼び出しの前後でこのコンテナのバケット数([`bucket_count`](bucket_count.md)`()` の戻り値)が変わらなかった場合には当該コンテナを指すイテレータは無効にはならない。 - - それ以外の場合は、当該コンテナを指すイテレータは無効になる可能性がある。 - - コンテナのバケット数が変わらない場合とは、以下のいずれかである: - - 追加しようとした要素と等価なキーの要素が全て既にコンテナに存在したため、要素が追加されなかった。 - - 要素追加後の要素数が、要素追加前のバケット数([`bucket_count`](bucket_count.md)`()` の戻り値)×最大負荷率([`max_load_factor`](max_load_factor.md)`()` の戻り値)よりも小さかった。 - - なお、後者の条件は「よりも小さい」となっているが、最大負荷率の定義からすると「以下」の方が適切と思われる。[`reserve`](reserve.md) も参照。 + - なお、規格書に明確な記載は無いが、当該コンテナ内の要素を指すポインタも無効にはならない。 +- これらの関数が呼ばれた後も、呼び出しの前後でこのコンテナのバケット数([`bucket_count`](bucket_count.md)`()` の戻り値)が変わらなかった場合には当該コンテナを指すイテレータは無効にはならない。 + - それ以外の場合は、当該コンテナを指すイテレータは無効になる可能性がある。 + - コンテナのバケット数が変わらない場合とは、以下のいずれかである: + - 追加しようとした要素と等価なキーの要素が全て既にコンテナに存在したため、要素が追加されなかった。 + - 要素追加後の要素数が、要素追加前のバケット数([`bucket_count`](bucket_count.md)`()` の戻り値)×最大負荷率([`max_load_factor`](max_load_factor.md)`()` の戻り値)よりも小さかった。 + - なお、後者の条件は「よりも小さい」となっているが、最大負荷率の定義からすると「以下」の方が適切と思われる。[`reserve`](reserve.md) も参照。 - (7), (8) の場合、要素はコピーもムーブもされない。 From 6216138ce74cd31f4d2b8567733a769fc9f5f320 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 22 May 2025 16:18:32 +0900 Subject: [PATCH 1726/3948] =?UTF-8?q?unordered=5Fset::insert=20:=20C++26?= =?UTF-8?q?=E7=95=B0=E7=A8=AE=E6=B7=B7=E5=90=88=E3=83=AB=E3=83=83=E3=82=AF?= =?UTF-8?q?=E3=82=A2=E3=83=83=E3=83=97=E3=81=AB=E5=AF=BE=E5=BF=9C=20#1189?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/set/set/insert.md | 4 +- .../unordered_set/unordered_set/insert.md | 132 +++++++++++------- 2 files changed, 86 insertions(+), 50 deletions(-) diff --git a/reference/set/set/insert.md b/reference/set/set/insert.md index 5310bb901f..180fb3d7a5 100644 --- a/reference/set/set/insert.md +++ b/reference/set/set/insert.md @@ -37,10 +37,10 @@ iterator insert(const_iterator hint, node_type&& nh); // (10) C++17 - (1) : 新たな要素`x`をコピー挿入する - (2) : 新たな要素`y`をムーブ挿入する -- (3) : `value_type`に変換可能な`Key`型の新たな要素`x`を転送して挿入する +- (3) : `value_type`に変換可能な`K`型の新たな要素`x`を転送して挿入する - (4) : 新たな要素`x`をコピー挿入する。`hint`パラメータに適切な挿入位置を指定すれば、高速に挿入できる - (5) : 新たな要素`y`をムーブ挿入する。`hint`パラメータに適切な挿入位置を指定すれば、高速に挿入できる -- (6) : `value_type`に変換可能な`Key`型の新たな要素`x`を転送して挿入する。`hint`パラメータに適切な挿入位置を指定すれば、高速に挿入できる +- (6) : `value_type`に変換可能な`K`型の新たな要素`x`を転送して挿入する。`hint`パラメータに適切な挿入位置を指定すれば、高速に挿入できる - (7) : イテレータ範囲`[first, last)`の要素を挿入する - (8) : 初期化子リスト`init`の要素を挿入する - (9) : `nh`が空の場合、効果はない。 diff --git a/reference/unordered_set/unordered_set/insert.md b/reference/unordered_set/unordered_set/insert.md index 0db8c87cf3..6aaa0be138 100644 --- a/reference/unordered_set/unordered_set/insert.md +++ b/reference/unordered_set/unordered_set/insert.md @@ -6,19 +6,40 @@ * cpp11[meta cpp] ```cpp -pair insert(const value_type& v); // (1) C++11 -pair insert(value_type&& rv); // (2) C++11 - -iterator insert(const_iterator position, const value_type& v); // (3) C++11 -iterator insert(const_iterator position, value_type&& rv); // (4) C++11 +pair + insert(const value_type& v); // (1) C++11 +pair + insert(value_type&& rv); // (2) C++11 + +template +pair + insert(K&& x); // (3) C++26 + +iterator + insert(const_iterator position, + const value_type& v); // (4) C++11 +iterator + insert(const_iterator position, + value_type&& rv); // (5) C++11 + +template +iterator + insert(const_iterator hint, + K&& x); // (6) C++11 template -void insert(InputIterator first, InputIterator last); // (5) C++11 - -void insert(initializer_list il); // (6) C++11 - -insert_return_type insert(node_type&& nh); // (7) C++17 -iterator insert(const_iterator hint, node_type&& nh); // (8) C++17 +void + insert(InputIterator first, + InputIterator last); // (7) C++11 + +void + insert(initializer_list il); // (8) C++11 + +insert_return_type + insert(node_type&& nh); // (9) C++17 +iterator + insert(const_iterator hint, + node_type&& nh); // (10) C++17 ``` * pair[link /reference/utility/pair.md] * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -28,57 +49,67 @@ iterator insert(const_iterator hint, node_type&& nh); // (8) C++17 - (1) : 新たな要素`v`をコピー挿入する - (2) : 新たな要素`rv`をムーブ挿入する -- (3) : 新たな要素`v`をコピー挿入する。`hint`パラメータに適切な挿入位置を指定すれば、高速に挿入できる -- (4) : 新たな要素`rv`をムーブ挿入する。`hint`パラメータに適切な挿入位置を指定すれば、高速に挿入できる -- (5) : イテレータ範囲`[first, last)`の要素を挿入する -- (6) : 初期化子リスト`il`の要素を挿入する -- (7) : `nh`が空の場合、効果はない。それ以外の場合、`nh.key()`と等価のキーを持つ要素がコンテナにない場合に限り、`nh`が所有する要素を挿入する。 -- (8) : `nh`が空の場合、効果はなく、`(*this).end()`を返す。それ以外の場合、`nh.key()`と等価のキーを持つ要素がコンテナにない場合に限り、`nh`が所有する要素を挿入する。 `nh.key()`と同等のキーの要素を指すイテレータを常に返す。要素は、`hint`の直前の位置のできるだけ近くに挿入される。 +- (3) : `value_type`に変換可能な`K`型の新たな要素`x`を転送して挿入する +- (4) : 新たな要素`v`をコピー挿入する。`hint`パラメータに適切な挿入位置を指定すれば、高速に挿入できる +- (5) : 新たな要素`rv`をムーブ挿入する。`hint`パラメータに適切な挿入位置を指定すれば、高速に挿入できる +- (6) : `value_type`に変換可能な`K`型の新たな要素`x`を転送して挿入する。`hint`パラメータに適切な挿入位置を指定すれば、高速に挿入できる +- (7) : イテレータ範囲`[first, last)`の要素を挿入する +- (8) : 初期化子リスト`il`の要素を挿入する +- (9) : `nh`が空の場合、効果はない。それ以外の場合、`nh.key()`と等価のキーを持つ要素がコンテナにない場合に限り、`nh`が所有する要素を挿入する。 +- (10) : `nh`が空の場合、効果はなく、`(*this).end()`を返す。それ以外の場合、`nh.key()`と等価のキーを持つ要素がコンテナにない場合に限り、`nh`が所有する要素を挿入する。 `nh.key()`と同等のキーの要素を指すイテレータを常に返す。要素は、`hint`の直前の位置のできるだけ近くに挿入される。 + + +## テンプレートパラメータ制約 +- (3), (6) : + - `key_compare::is_transparent` が妥当な式であること + - [`is_convertible_v`](/reference/type_traits/is_convertible.md)` == false`であること + - [`is_convertible_v`](/reference/type_traits/is_convertible.md)` == false`であること + - `value_type`が[`std::forward`](/reference/utility/forward.md)`(x)`によって直接構築可能であること ## 適格要件 -- (1)、(3) : `value_type` はコンテナに対してコピー挿入可能(CopyInsertable)でなければならない。 +- (1)、(4) : `value_type` はコンテナに対してコピー挿入可能(CopyInsertable)でなければならない。 - コンテナに対してコピー挿入可能とは、`m` をアロケータ型 `allocator_type` の左辺値、`p` を要素型 `value_type` へのポインタとすると、以下の式が適格(well-formed)であるということである。 - `std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::`[`construct`](/reference/memory/allocator_traits/construct.md)`(m, p, v);` -- (2)、(4) : `value_type` はコンテナに対してムーブ挿入可能(MoveInsertable)でなければならない。 +- (2)、(5) : `value_type` はコンテナに対してムーブ挿入可能(MoveInsertable)でなければならない。 - コンテナに対してムーブ挿入可能とは、`m` をアロケータ型 `allocator_type` の左辺値、`p` を要素型 `value_type` へのポインタとすると、以下の式が適格(well-formed)であるということである。 - `std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::`[`construct`](/reference/memory/allocator_traits/construct.md)`(m, p, std::`[`move`](/reference/utility/move.md)`(rv));` -- (3)、(4) : 引数 `position` は、コンテナの有効な読み取り専用イテレータでなければならない。 +- (4)、(5) : 引数 `position` は、コンテナの有効な読み取り専用イテレータでなければならない。 - なお、標準では間接参照可能(dereferenceable)である必要があることになっているが、その必要はない(つまり、最終要素の次を指すイテレータでも良い)ものと思われる。 -- (5) : 引数 `first`、および、`last`は、入力イテレータの要件を満たし、かつ、イテレータ範囲 `[first, last)` が当該コンテナ**以外を指す**有効な範囲でなければならない。 +- (7) : 引数 `first`、および、`last`は、入力イテレータの要件を満たし、かつ、イテレータ範囲 `[first, last)` が当該コンテナ**以外を指す**有効な範囲でなければならない。 - また、このコンテナの要素型 `value_type` は、コンテナに対して `*first` から直接構築可能(EmplaceConstructible)でなければならない。 - ここで、コンテナに対して `*first` から直接構築可能とは、`m` をアロケータ型 `allocator_type` の左辺値、`p` を要素型 `value_type` へのポインタとすると、以下の式が適格(well-formed)であるということである。 - `std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::`[`construct`](/reference/memory/allocator_traits/construct.md)`(m, p, *first);` - なお、`first`、および、`last`は、標準では `value_type` を参照しなければならない(つまり、コンテナの `value_type` と `std::`[`iterator_traits`](/reference/iterator/iterator_traits.md)`::value_type` が同一の型でなければならない)ことになっているが、実際にはその必要はなく、上記の直接構築可能の要件を満たすだけで良いものと思われる。 -- (6) : `value_type` はコンテナに対してコピー挿入可能でなければならない。 +- (8) : `value_type` はコンテナに対してコピー挿入可能でなければならない。 ## 事前条件 -- (5), (6) : `nh` は空である、または、`(*this).get_allocator() == nh.get_allocator()`でなければならない。 +- (9), (10) : `nh` は空である、または、`(*this).get_allocator() == nh.get_allocator()`でなければならない。 ## 効果 -- (1)、(2) : 引数 `v`、あるいは `rv` で指定した値と等価なキーがコンテナに存在していなければ、当該要素を追加する。 -- (3)、(4) : 引数 `v`、あるいは `rv` で指定した値と等価なキーがコンテナに存在していなければ、当該要素を追加する。 +- (1)、(2)、(3) : 引数で指定した値と等価なキーがコンテナに存在していなければ、当該要素を追加する。 +- (4)、(5)、(6) : 第1引数で指定した値と等価なキーがコンテナに存在していなければ、当該要素を追加する。 - 引数 `position` は、要素の挿入位置を探し始める場所のヒントとして使用されるが、実装によって無視されるかもしれない。 -- (5) : イテレータ範囲 `[first, last)` のすべての要素 `t` に対して、(1)の形式の `insert(t)` を呼び出した場合と等価である。 -- (6) : (3)の形式を `insert(il.begin(), il.end())` として呼び出した場合と等価である。 -- (7) : `nh`が空の場合、効果はない。それ以外の場合、`nh.key()`と等価のキーを持つ要素がコンテナにない場合に限り、`nh`が所有する要素を挿入する。 -- (8) : `nh`が空の場合、効果はなく、`(*this).end()`を返す。それ以外の場合、`nh.key()`と等価のキーを持つ要素がコンテナにない場合に限り、`nh`が所有する要素を挿入する。`nh.key()`と等価のキーの要素を指すイテレータを常に返す。 +- (7) : イテレータ範囲 `[first, last)` のすべての要素 `t` に対して、(1)の形式の `insert(t)` を呼び出した場合と等価である。 +- (8) : (7)の形式を `insert(il.begin(), il.end())` として呼び出した場合と等価である。 +- (9) : `nh`が空の場合、効果はない。それ以外の場合、`nh.key()`と等価のキーを持つ要素がコンテナにない場合に限り、`nh`が所有する要素を挿入する。 +- (10) : `nh`が空の場合、効果はなく、`(*this).end()`を返す。それ以外の場合、`nh.key()`と等価のキーを持つ要素がコンテナにない場合に限り、`nh`が所有する要素を挿入する。`nh.key()`と等価のキーの要素を指すイテレータを常に返す。 - 要素は、`hint`の直前の位置のできるだけ近くに挿入される。 ## 戻り値 -- (1)、(2) : [`pair`](/reference/utility/pair.md) の `bool` 部分(`second` 部)は、要素が追加されたら `true`、追加されなかったら(既にあったら)`false`。 +- (1)、(2)、(3) : [`pair`](/reference/utility/pair.md) の `bool` 部分(`second` 部)は、要素が追加されたら `true`、追加されなかったら(既にあったら)`false`。 - [`pair`](/reference/utility/pair.md) の `iterator` 部分(`first` 部)は、追加された要素(`bool` 部分が `true` の場合)、あるいは、既にあった要素(`bool` 部分が `false` の場合)を指すイテレータ。 -- (3)、(4) : 新たな要素が追加された場合、その追加された要素を指すイテレータ。 +- (4)、(5)、(6) : 新たな要素が追加された場合、その追加された要素を指すイテレータ。 - 新たな要素が追加されなかった場合、既にあった要素を指すイテレータ。 -- (5) : なし -- (6) : なし -- (7) : 戻り値としては、[`insert_return_type`](/reference/map/map.md)を返す。`insert_return_type`のイテレータ型メンバ変数`position`、`bool`型メンバ変数`inserted`に格納される値は(1), (2)のものと同じ情報である。`nh`が空の場合は、`position`は終端イテレータである。`node_type`型メンバ変数`node`には、 +- (7) : なし +- (8) : なし +- (9) : 戻り値としては、[`insert_return_type`](/reference/map/map.md)を返す。`insert_return_type`のイテレータ型メンバ変数`position`、`bool`型メンバ変数`inserted`に格納される値は(1), (2)のものと同じ情報である。`nh`が空の場合は、`position`は終端イテレータである。`node_type`型メンバ変数`node`には、 - 挿入された場合には、空の[ノードハンドル](/reference/node_handle/node_handle.md)。 - 挿入されなかった場合には、`nh`の値である。 -- (8) : `nh`が空の場合、`(*this).end()`を返す。そうではない場合、`nh`と等価のキーの要素を指すイテレータを常に返す。 +- (10) : `nh`が空の場合、`(*this).end()`を返す。そうではない場合、`nh`と等価のキーの要素を指すイテレータを常に返す。 ## 例外 @@ -86,11 +117,11 @@ iterator insert(const_iterator hint, node_type&& nh); // (8) C++17 ## 計算量 -- (1)、(2) : 平均的なケースでは定数(O(1))だが、最悪のケースではコンテナの要素数 [`size`](size.md)`()` に比例(O(N))。 -- (3)、(4) : 平均的なケースでは定数(O(1))だが、最悪のケースではコンテナの要素数 [`size`](size.md)`()` に比例(O(N))。 -- (5) : 平均的なケースでは引数の範囲の要素数 `std::`[`distance`](/reference/iterator/distance.md)`(first, last)` に比例(O(N))するが、最悪のケースでは引数の範囲の要素数 `std::`[`distance`](/reference/iterator/distance.md)`(first, last)` とコンテナの要素数 [`size()`](size.md) に 1 加えたものの積に比例(O(`std::`[`distance`](/reference/iterator/distance.md)`(first, last) * (`[`size`](size.md)`() + 1)`))。 -- (6) : (4)の形式を `insert(il.begin(), il.end())` として呼び出した場合と等価。 -- (7), (8) : 平均的なケースでは `O(1)`、最悪のケースでは `O(size())`。 +- (1)、(2)、(3) : 平均的なケースでは定数(O(1))だが、最悪のケースではコンテナの要素数 [`size`](size.md)`()` に比例(O(N))。 +- (4)、(5)、(6) : 平均的なケースでは定数(O(1))だが、最悪のケースではコンテナの要素数 [`size`](size.md)`()` に比例(O(N))。 +- (7) : 平均的なケースでは引数の範囲の要素数 `std::`[`distance`](/reference/iterator/distance.md)`(first, last)` に比例(O(N))するが、最悪のケースでは引数の範囲の要素数 `std::`[`distance`](/reference/iterator/distance.md)`(first, last)` とコンテナの要素数 [`size()`](size.md) に 1 加えたものの積に比例(O(`std::`[`distance`](/reference/iterator/distance.md)`(first, last) * (`[`size`](size.md)`() + 1)`))。 +- (8) : (7)の形式を `insert(il.begin(), il.end())` として呼び出した場合と等価。 +- (9), (10) : 平均的なケースでは `O(1)`、最悪のケースでは `O(size())`。 ## 備考 @@ -102,7 +133,10 @@ iterator insert(const_iterator hint, node_type&& nh); // (8) C++17 - 追加しようとした要素と等価なキーの要素が全て既にコンテナに存在したため、要素が追加されなかった。 - 要素追加後の要素数が、要素追加前のバケット数([`bucket_count`](bucket_count.md)`()` の戻り値)×最大負荷率([`max_load_factor`](max_load_factor.md)`()` の戻り値)よりも小さかった。 - なお、後者の条件は「よりも小さい」となっているが、最大負荷率の定義からすると「以下」の方が適切と思われる。[`reserve`](reserve.md) も参照。 -- (7), (8) の場合、要素はコピーもムーブもされない。 +- (9), (10) の場合、要素はコピーもムーブもされない。 +- (3), (6) : + - `is_transparent`は、標準ライブラリの[`std::less`](/reference/functional/less.md)、[`std::greater`](/reference/functional/greater.md)といった関数オブジェクトの、`void`に対する特殊化で定義される。それ以外のテンプレートパラメータで`is_transparent`が定義されないのは、互換性のためである。 + - これらのオーバーロードは、`map`のようなコンテナに対し、検索操作で文字列リテラルを渡した際に、キー型の一時オブジェクトが生成されるコストを減らすためにある。 ## 例 @@ -126,7 +160,7 @@ int main() { std::cout << std::boolalpha; - // 一つの要素を挿入((1)、(2)の形式) + // 一つの要素を挿入((1)、(2)、(3)の形式) { std::unordered_set us{ 0, 1, 2, 3, 4, 5, }; @@ -137,7 +171,7 @@ int main() print("insert one element", us); } - // 一つの要素を挿入((3)、(4)の形式) + // 一つの要素を挿入((4)、(5)、(6)の形式) { std::unordered_set us{ 0, 1, 2, 3, 4, 5, }; @@ -148,7 +182,7 @@ int main() print("insert one element with hint", us); } - // 複数の要素を挿入((5)の形式) + // 複数の要素を挿入((7)の形式) { std::unordered_set us{ 0, 1, 2, 3, 4, 5, }; @@ -157,7 +191,7 @@ int main() print("insert range", us); } - // 複数の要素を挿入((6)の形式) + // 複数の要素を挿入((8)の形式) { std::unordered_set us{ 0, 1, 2, 3, 4, 5, }; @@ -199,7 +233,7 @@ insert initializer_list : 7 8 6 5 4 3 2 1 0 - [Visual C++](/implementation.md#visual_cpp): ? ## 実装例 -(3)、(4)、(5)、(6)の形式は、(1)、(2)の形式を使って実装することができる。 +(4)、(5)、(7)、(8)の形式は、(1)、(2)の形式を使って実装することができる。 ```cpp template @@ -253,7 +287,9 @@ inline void unordered_set::insert(initializer_list`のバージョンが追加された From 9bcd535b0cb4a69bb29748b0a10fa83c8b58ac20 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 22 May 2025 16:22:52 +0900 Subject: [PATCH 1727/3948] =?UTF-8?q?unordered=5F(multi)set::bucket=20:=20?= =?UTF-8?q?C++26=E3=81=AE=E7=95=B0=E7=A8=AE=E6=B7=B7=E5=90=88=E3=83=AB?= =?UTF-8?q?=E3=83=83=E3=82=AF=E3=82=A2=E3=83=83=E3=83=97=E3=81=AB=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C=20#1189?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../unordered_multiset/bucket.md | 24 +++++++++++++++--- .../unordered_set/unordered_set/bucket.md | 25 ++++++++++++++++--- 2 files changed, 42 insertions(+), 7 deletions(-) diff --git a/reference/unordered_set/unordered_multiset/bucket.md b/reference/unordered_set/unordered_multiset/bucket.md index d970e5566b..165c9ec600 100644 --- a/reference/unordered_set/unordered_multiset/bucket.md +++ b/reference/unordered_set/unordered_multiset/bucket.md @@ -6,20 +6,32 @@ * cpp11[meta cpp] ```cpp -size_type bucket(const key_type& k) const; +size_type bucket(const key_type& k) const; // (1) C++11 + +template +size_type bucket(const K& k) const; // (2) C++26 ``` ## 概要 指定したキーと等価な要素が格納されている場合、そのバケットのインデックス(添え字)を取得する。 +- (1) : `key_type`型のキーを受け取って、バケットのインデックスを取得する +- (2) : `key_type`と比較可能なキーを受け取って、バケットのインデックスを取得する + + +## テンプレートパラメータ制約 +- (2) : `key_compare::is_transparent` が妥当な式であること -## 要件 + +## 事前条件 当該コンテナは [`bucket_count`](bucket_count.md)`() > 0` であること ## 戻り値 パラメータ `k` と等価なキーの要素が格納されているバケットのインデックス(添え字) + +## 事後条件 戻り値は `[0,` [`bucket_count`](bucket_count.md)`())` の範囲である。 @@ -28,7 +40,10 @@ size_type bucket(const key_type& k) const; ## 備考 -指定したキーと等価な要素が格納されていない場合、そのキーを挿入した際に [`rehash`](rehash.md) が発生しなければ格納されるバケットのインデックス(添え字)が返る。 +- 指定したキーと等価な要素が格納されていない場合、そのキーを挿入した際に [`rehash`](rehash.md) が発生しなければ格納されるバケットのインデックス(添え字)が返る。 +- (2) : + - `is_transparent`は、標準ライブラリの[`std::less`](/reference/functional/less.md)、[`std::greater`](/reference/functional/greater.md)といった関数オブジェクトの、`void`に対する特殊化で定義される。それ以外のテンプレートパラメータで`is_transparent`が定義されないのは、互換性のためである。 + - これらのオーバーロードは、`map`のようなコンテナに対し、検索操作で文字列リテラルを渡した際に、キー型の一時オブジェクトが生成されるコストを減らすためにある。 ## 例 @@ -94,3 +109,6 @@ key = H, bucket = 3, bucket_size = 0 |----------------------------------------------|----------------------| | [`max_bucket_count`](max_bucket_count.md) | 最大バケット数の取得 | +## 参照 +- [P2363R5 Extending associative containers with the remaining heterogeneous overloads](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2363r5.html) + - C++26で`template `のバージョンが追加された diff --git a/reference/unordered_set/unordered_set/bucket.md b/reference/unordered_set/unordered_set/bucket.md index c8c990ed47..a7d2700cb2 100644 --- a/reference/unordered_set/unordered_set/bucket.md +++ b/reference/unordered_set/unordered_set/bucket.md @@ -6,20 +6,32 @@ * cpp11[meta cpp] ```cpp -size_type bucket(const key_type& k) const; +size_type bucket(const key_type& k) const; // (1) C++11 + +template +size_type bucket(const K& k) const; // (2) C++26 ``` ## 概要 指定したキーと等価な要素が格納されている場合、そのバケットのインデックス(添え字)を取得する。 +- (1) : `key_type`型のキーを受け取って、バケットのインデックスを取得する +- (2) : `key_type`と比較可能なキーを受け取って、バケットのインデックスを取得する + + +## テンプレートパラメータ制約 +- (2) : `key_compare::is_transparent` が妥当な式であること -## 要件 + +## 事前条件 当該コンテナは [`bucket_count`](bucket_count.md)`() > 0` であること ## 戻り値 パラメータ `k` と等価なキーの要素が格納されているバケットのインデックス(添え字) + +## 事後条件 戻り値は `[0,` [`bucket_count`](bucket_count.md)`())` の範囲である。 @@ -28,7 +40,10 @@ size_type bucket(const key_type& k) const; ## 備考 -指定したキーと等価な要素が格納されていない場合、そのキーを挿入した際に [`rehash`](rehash.md) が発生しなければ格納されるバケットのインデックス(添え字)が返る。 +- 指定したキーと等価な要素が格納されていない場合、そのキーを挿入した際に [`rehash`](rehash.md) が発生しなければ格納されるバケットのインデックス(添え字)が返る。 +- (2) : + - `is_transparent`は、標準ライブラリの[`std::less`](/reference/functional/less.md)、[`std::greater`](/reference/functional/greater.md)といった関数オブジェクトの、`void`に対する特殊化で定義される。それ以外のテンプレートパラメータで`is_transparent`が定義されないのは、互換性のためである。 + - これらのオーバーロードは、`map`のようなコンテナに対し、検索操作で文字列リテラルを渡した際に、キー型の一時オブジェクトが生成されるコストを減らすためにある。 ## 例 @@ -85,8 +100,10 @@ key = H, bucket = 2, bucket_size = 0 ## 関連項目 - | 名前 | 説明 | |-------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------| | [`max_bucket_count`](max_bucket_count.md) | 最大バケット数の取得 | +## 参照 +- [P2363R5 Extending associative containers with the remaining heterogeneous overloads](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2363r5.html) + - C++26で`template `のバージョンが追加された From e34727d477d17ad4aa7a92b2cddeec2eace0e9b2 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 22 May 2025 16:35:09 +0900 Subject: [PATCH 1728/3948] =?UTF-8?q?=E5=85=A8=E4=BD=93:=20=E3=82=AA?= =?UTF-8?q?=E3=83=BC=E3=83=90=E3=83=BC=E3=83=AD=E3=83=BC=E3=83=89=E7=95=AA?= =?UTF-8?q?=E5=8F=B7=E3=81=AE=E5=8C=BA=E5=88=87=E3=82=8A=E3=81=8C=E3=80=8C?= =?UTF-8?q?=E3=80=81=E3=80=8D=E3=80=8C,=20=E3=80=8D=E3=81=A7=E8=A1=A8?= =?UTF-8?q?=E8=A8=98=E6=8F=BA=E3=82=8C=E3=81=97=E3=81=A6=E3=81=84=E3=81=9F?= =?UTF-8?q?=E3=81=9F=E3=82=81=E3=80=8C,=20=E3=80=8D=E3=81=AB=E7=B5=B1?= =?UTF-8?q?=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://gist.github.com/faithandbrave/8b4197ec353acfd5cc5ab78d5dc26fc5 --- reference/cmath/abs.md | 2 +- reference/cmath/acos.md | 2 +- reference/cmath/acosh.md | 2 +- reference/cmath/asin.md | 2 +- reference/cmath/asinh.md | 2 +- reference/cmath/atan.md | 2 +- reference/cmath/atan2.md | 2 +- reference/cmath/atanh.md | 2 +- reference/cmath/cbrt.md | 2 +- reference/cmath/ceil.md | 2 +- reference/cmath/copysign.md | 2 +- reference/cmath/cos.md | 2 +- reference/cmath/cosh.md | 2 +- reference/cmath/erf.md | 2 +- reference/cmath/erfc.md | 2 +- reference/cmath/exp.md | 2 +- reference/cmath/exp2.md | 2 +- reference/cmath/fabs.md | 2 +- reference/cmath/fdim.md | 2 +- reference/cmath/floor.md | 2 +- reference/cmath/fma.md | 2 +- reference/cmath/fmax.md | 2 +- reference/cmath/fmin.md | 2 +- reference/cmath/fpclassify.md | 2 +- reference/cmath/frexp.md | 2 +- reference/cmath/hypot.md | 2 +- reference/cmath/ilogb.md | 2 +- reference/cmath/isfinite.md | 2 +- reference/cmath/isgreater.md | 2 +- reference/cmath/isgreaterequal.md | 2 +- reference/cmath/isinf.md | 2 +- reference/cmath/isless.md | 2 +- reference/cmath/islessequal.md | 2 +- reference/cmath/islessgreater.md | 2 +- reference/cmath/isnan.md | 2 +- reference/cmath/isnormal.md | 2 +- reference/cmath/isunordered.md | 2 +- reference/cmath/ldexp.md | 2 +- reference/cmath/lgamma.md | 2 +- reference/cmath/llrint.md | 2 +- reference/cmath/llround.md | 2 +- reference/cmath/log.md | 2 +- reference/cmath/log10.md | 2 +- reference/cmath/log1p.md | 2 +- reference/cmath/log2.md | 2 +- reference/cmath/logb.md | 2 +- reference/cmath/lrint.md | 2 +- reference/cmath/lround.md | 2 +- reference/cmath/modf.md | 2 +- reference/cmath/nearbyint.md | 2 +- reference/cmath/nextafter.md | 2 +- reference/cmath/nexttoward.md | 2 +- reference/cmath/pow.md | 2 +- reference/cmath/remainder.md | 2 +- reference/cmath/remquo.md | 2 +- reference/cmath/rint.md | 2 +- reference/cmath/round.md | 2 +- reference/cmath/scalbln.md | 2 +- reference/cmath/scalbn.md | 2 +- reference/cmath/signbit.md | 2 +- reference/cmath/sin.md | 2 +- reference/cmath/sinh.md | 2 +- reference/cmath/sqrt.md | 2 +- reference/cmath/tan.md | 2 +- reference/cmath/tanh.md | 2 +- reference/cmath/tgamma.md | 2 +- reference/cmath/trunc.md | 2 +- reference/cstdlib/abs.md | 2 +- .../flat_map/flat_map/insert_or_assign.md | 8 +++---- .../ios/ios_base/failure/op_constructor.md | 2 +- reference/map/map/insert_or_assign.md | 16 ++++++------- reference/map/map/op_constructor.md | 12 +++++----- reference/map/map/try_emplace.md | 18 +++++++------- reference/map/multimap/op_constructor.md | 12 +++++----- reference/numeric/transform_reduce.md | 2 +- .../ostream/basic_ostream/op_ostream_free.md | 6 ++--- reference/ranges/view_interface/back.md | 2 +- reference/ranges/view_interface/cbegin.md | 2 +- reference/ranges/view_interface/cend.md | 2 +- reference/ranges/view_interface/data.md | 2 +- reference/ranges/view_interface/empty.md | 2 +- reference/ranges/view_interface/front.md | 2 +- reference/ranges/view_interface/op_at.md | 2 +- reference/ranges/view_interface/op_bool.md | 2 +- reference/ranges/view_interface/size.md | 2 +- reference/regex/match_results/op_assign.md | 2 +- reference/regex/regex_replace.md | 18 +++++++------- reference/set/multiset/op_constructor.md | 2 +- reference/set/set/op_constructor.md | 2 +- reference/string/basic_string/op_plus.md | 2 +- .../unordered_map/equal_range.md | 2 +- reference/unordered_map/unordered_map/find.md | 2 +- .../unordered_map/unordered_map/insert.md | 6 ++--- .../unordered_map/insert_or_assign.md | 16 ++++++------- .../unordered_map/op_constructor.md | 6 ++--- .../unordered_map/try_emplace.md | 18 +++++++------- .../unordered_multimap/equal_range.md | 2 +- .../unordered_map/unordered_multimap/find.md | 2 +- .../unordered_multimap/insert.md | 4 ++-- .../unordered_multimap/op_constructor.md | 6 ++--- .../unordered_multiset/equal_range.md | 2 +- .../unordered_set/unordered_multiset/find.md | 2 +- .../unordered_multiset/insert.md | 4 ++-- .../unordered_multiset/op_constructor.md | 6 ++--- .../unordered_set/equal_range.md | 2 +- reference/unordered_set/unordered_set/find.md | 2 +- .../unordered_set/unordered_set/insert.md | 24 +++++++++---------- .../unordered_set/op_constructor.md | 6 ++--- 108 files changed, 184 insertions(+), 184 deletions(-) diff --git a/reference/cmath/abs.md b/reference/cmath/abs.md index 8ae5febb3b..faf0f2b9ad 100644 --- a/reference/cmath/abs.md +++ b/reference/cmath/abs.md @@ -51,7 +51,7 @@ namespace std { ## 備考 - $$ f(x) = | x | $$ - 任意の整数型に対するオーバーロード(5)は C++11 で追加されたが、[一部の符号なし整数型に対して問題を引き起こす](http://wg21.cmeerw.net/lwg/issue2192)ことから C++17 で削除され、符号付き整数型に対するオーバーロード(6),(7),(8)が追加された -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/acos.md b/reference/cmath/acos.md index ec8954c95f..ec36db7eb0 100644 --- a/reference/cmath/acos.md +++ b/reference/cmath/acos.md @@ -59,7 +59,7 @@ namespace std { - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 - `x = 1` の場合、戻り値は `+0` となる。 - `x > |1|` の場合、戻り値は quiet NaN となり、[`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外)が発生する。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/acosh.md b/reference/cmath/acosh.md index 37351dd1a6..24648e4567 100644 --- a/reference/cmath/acosh.md +++ b/reference/cmath/acosh.md @@ -59,7 +59,7 @@ namespace std { - `x = 1` の場合、戻り値は `+0` となる。 - `x < 1` の場合、戻り値は quiet NaN となり、[`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外)が発生する。 - `x = +∞` の場合、戻り値は `+∞` となる。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/asin.md b/reference/cmath/asin.md index aed3a97b75..bd4645e544 100644 --- a/reference/cmath/asin.md +++ b/reference/cmath/asin.md @@ -59,7 +59,7 @@ namespace std { - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 - `x = ±0` の場合、戻り値は `±0` となる。(複号同順) - `x > |1|` の場合、戻り値は quiet NaN となり、[`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外)が発生する。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/asinh.md b/reference/cmath/asinh.md index 744ff3e8fc..086f25b222 100644 --- a/reference/cmath/asinh.md +++ b/reference/cmath/asinh.md @@ -55,7 +55,7 @@ namespace std { - 処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。(複号同順) - `x = ±0` の場合、戻り値は `±0` となる。 - `x = ±∞` の場合、戻り値は `±∞` となる。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/atan.md b/reference/cmath/atan.md index 2fa1667e7d..06612bb69c 100644 --- a/reference/cmath/atan.md +++ b/reference/cmath/atan.md @@ -46,7 +46,7 @@ namespace std { - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 - `x = ±0` の場合、戻り値は `±0` となる。(複号同順) - `x = ±∞` の場合、戻り値は `±π/2` となる。(複号同順) -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/atan2.md b/reference/cmath/atan2.md index 2cb6bf45bc..51087c7837 100644 --- a/reference/cmath/atan2.md +++ b/reference/cmath/atan2.md @@ -81,7 +81,7 @@ namespace std { - `y = ±∞` で `x = +∞` の場合、戻り値は `±π/4` となる。 特に、`y` と `x` の両方がゼロの場合に定義域エラー([`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外))となったり、`y` が非ゼロで `x` がゼロの場合に極エラー([`FE_DIVBYZERO`](../cfenv/fe_divbyzero.md)(ゼロ除算浮動小数点例外))となったりは**しない**事に注意。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/atanh.md b/reference/cmath/atanh.md index 0233b76ca3..76787833a8 100644 --- a/reference/cmath/atanh.md +++ b/reference/cmath/atanh.md @@ -59,7 +59,7 @@ namespace std { - `x = ±0` の場合、戻り値は `±0` となる。 - `x = ±1` の場合、戻り値は `±∞` となり、[`FE_DIVBYZERO`](../cfenv/fe_divbyzero.md)(ゼロ除算浮動小数点例外)が発生する。 - `|x| > 1` の場合、戻り値は NaN となり、[`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外)が発生する。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/cbrt.md b/reference/cmath/cbrt.md index 07cb2f3f40..9db2a6277d 100644 --- a/reference/cmath/cbrt.md +++ b/reference/cmath/cbrt.md @@ -55,7 +55,7 @@ namespace std { - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。(複号同順) - `x = ±0` の場合、戻り値は `±0` となる。 - `x = ±∞` の場合、戻り値は `±∞` となる。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/ceil.md b/reference/cmath/ceil.md index eaf8388e55..8fba8b842a 100644 --- a/reference/cmath/ceil.md +++ b/reference/cmath/ceil.md @@ -56,7 +56,7 @@ namespace std { また、本関数の挙動は、丸めモードが [`FE_UPWARD`](/reference/cfenv/fe_upward.md) に設定されている時の [`rint`](rint.md)、あるいは [`nearbyint`](nearbyint.md) のいずれかと等価である。 したがって、本関数において戻り値が引数 `x` と異なる場合に例外 [`FE_INEXACT`](/reference/cfenv/fe_inexact.md) が発生するか否かは実装依存である。 なお、本関数の挙動は、現在の丸めモードには依存しない。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/copysign.md b/reference/cmath/copysign.md index 378d7a66a7..b4679ea14a 100644 --- a/reference/cmath/copysign.md +++ b/reference/cmath/copysign.md @@ -64,7 +64,7 @@ namespace std { ## 備考 - 符号付きゼロを表現するが負のゼロを取り扱わない実装では、この関数はゼロを正と見なす。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/cos.md b/reference/cmath/cos.md index c86438c446..8a1f3543dc 100644 --- a/reference/cmath/cos.md +++ b/reference/cmath/cos.md @@ -54,7 +54,7 @@ namespace std { - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 - `x = ±0` の場合、戻り値は `1` となる。 - `x = ±∞` の場合、戻り値は quiet NaN となり、[`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外)が発生する。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/cosh.md b/reference/cmath/cosh.md index ebc6b8c318..bc9d9eafaf 100644 --- a/reference/cmath/cosh.md +++ b/reference/cmath/cosh.md @@ -57,7 +57,7 @@ namespace std { - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 - `x = ±0` の場合、戻り値は `1` となる。 - `x = ±∞` の場合、戻り値は `+∞` となる。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/erf.md b/reference/cmath/erf.md index 32fdcefeac..ee557797ff 100644 --- a/reference/cmath/erf.md +++ b/reference/cmath/erf.md @@ -56,7 +56,7 @@ namespace std { - `x = ±0` の場合、戻り値は `±0` となる。 - `x = ±∞` の場合、戻り値は `±1` となる。 - 平均μ, 標準偏差σの正規分布の累積分布関数は $$\frac{1}{2} \left( 1 + \mathrm{erf} ~ \frac{x - \mu}{\sqrt{2} \sigma} \right)$$ で与えられる。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/erfc.md b/reference/cmath/erfc.md index fb6191431e..268d3b7eca 100644 --- a/reference/cmath/erfc.md +++ b/reference/cmath/erfc.md @@ -56,7 +56,7 @@ namespace std { - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 - `x = -∞` の場合、戻り値は `2` となる。 - `x = +∞` の場合、戻り値は `+0` となる。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/exp.md b/reference/cmath/exp.md index a2d16e2b93..fc84b3496f 100644 --- a/reference/cmath/exp.md +++ b/reference/cmath/exp.md @@ -58,7 +58,7 @@ namespace std { - `x = ±0` の場合、戻り値は `1` となる。 - `x = -∞` の場合、戻り値は `+0` となる。 - `x = +∞` の場合、戻り値は `+∞` となる。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/exp2.md b/reference/cmath/exp2.md index cf5fef37f2..dc5b55ed4f 100644 --- a/reference/cmath/exp2.md +++ b/reference/cmath/exp2.md @@ -59,7 +59,7 @@ namespace std { - `x = ±0` の場合、戻り値は `1` となる。 - `x = -∞` の場合、戻り値は `+0` となる。 - `x = +∞` の場合、戻り値は `+∞` となる。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/fabs.md b/reference/cmath/fabs.md index dbdc987deb..62bbf60f1f 100644 --- a/reference/cmath/fabs.md +++ b/reference/cmath/fabs.md @@ -55,7 +55,7 @@ namespace std { - `value = ±0` の場合、戻り値は `+0` となる。 - `value = ±∞` の場合、戻り値は `+∞` となる。 - 戻り値は正確で、現在の丸め方式には依存しない。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/fdim.md b/reference/cmath/fdim.md index 00b146ce45..4c843e7974 100644 --- a/reference/cmath/fdim.md +++ b/reference/cmath/fdim.md @@ -55,7 +55,7 @@ namespace std { ## 備考 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/floor.md b/reference/cmath/floor.md index b3bb3b5b99..1d732e2dc0 100644 --- a/reference/cmath/floor.md +++ b/reference/cmath/floor.md @@ -56,7 +56,7 @@ namespace std { また、本関数の挙動は、丸めモードが [`FE_DOWNWARD`](/reference/cfenv/fe_downward.md) に設定されている時の [`rint`](rint.md)、あるいは [`nearbyint`](nearbyint.md) のいずれかと等価である。 したがって、本関数において戻り値が引数 `x` と異なる場合に例外 [`FE_INEXACT`](/reference/cfenv/fe_inexact.md) が発生するか否かは実装依存である。 なお、本関数の挙動は、現在の丸めモードには依存しない。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/fma.md b/reference/cmath/fma.md index 7e633925fe..39f924d8db 100644 --- a/reference/cmath/fma.md +++ b/reference/cmath/fma.md @@ -90,7 +90,7 @@ namespace std { - 本関数が単純に `x * y + z` を計算するのと等価か、より速い場合には、引数の型に応じて [`FP_FAST_FMA`](fp_fast_fma.md)(`double` の場合)、[`FP_FAST_FMAF`](fp_fast_fmaf.md)(`float` の場合)、[`FP_FAST_FMAL`](fp_fast_fmal.md)(`long double` の場合)と言ったマクロが定義される。 これらのマクロは、一般的に本関数がハードウェアによる積和演算命令を使用している場合にのみ定義される。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/fmax.md b/reference/cmath/fmax.md index 5acd818050..efb7214c54 100644 --- a/reference/cmath/fmax.md +++ b/reference/cmath/fmax.md @@ -58,7 +58,7 @@ namespace std { - 引数の1つが NaN の場合 NaN でない方を返す。 - 引数が2つとも NaN の場合 NaN を返す。 - 理想的には `fmax(-0.0, +0.0)` は `+0` を返す。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/fmin.md b/reference/cmath/fmin.md index 11bc5ae4e4..9798f518a7 100644 --- a/reference/cmath/fmin.md +++ b/reference/cmath/fmin.md @@ -59,7 +59,7 @@ namespace std { - 引数の1つが NaN の場合 NaN でない方を返す。 - 引数が2つとも NaN の場合 NaN を返す。 - 理想的には `fmin(-0.0, +0.0)` は `-0` を返す。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/fpclassify.md b/reference/cmath/fpclassify.md index 16242d32d6..222ecf4ad6 100644 --- a/reference/cmath/fpclassify.md +++ b/reference/cmath/fpclassify.md @@ -48,7 +48,7 @@ namespace std { ## 備考 - C標準ライブラリでは`fpclassify`は関数マクロとして定義されるが、C++標準ライブラリでは関数として定義される -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/frexp.md b/reference/cmath/frexp.md index 27e351ad45..679e0826bd 100644 --- a/reference/cmath/frexp.md +++ b/reference/cmath/frexp.md @@ -61,7 +61,7 @@ C++11 以降では、処理系が IEC 60559 に準拠している場合([`std: - `value = ±∞` の場合、戻り値は `±∞` となり、`*exp` には未規定の値が設定される。 - `value` が NaN の場合、戻り値は NaN となり、`*exp` には未規定の値が設定される。 - この関数は浮動小数点例外を発生させない。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/hypot.md b/reference/cmath/hypot.md index 9bd9dd2442..70b9e8c111 100644 --- a/reference/cmath/hypot.md +++ b/reference/cmath/hypot.md @@ -127,7 +127,7 @@ $$ f(x, y) = \sqrt{x^2 + y^2} $$ - `hypot(x, y)` と `hypot(y, x)` と `hypot(x, -y)` は等価である。 - `hypot(x, ±0)` は、[`fabs`](fabs.md)`(x)` と等価である。 - `hypot(±∞, y)` の戻り値は、たとえ `y` が NaN の場合でも `+∞` となる。 -- C++23では、(1)、(2)、(3)が(4)に統合、(8)、(9)、(10)が(11)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合、(8), (9), (10)が(11)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/ilogb.md b/reference/cmath/ilogb.md index af2c447dab..7abababfd9 100644 --- a/reference/cmath/ilogb.md +++ b/reference/cmath/ilogb.md @@ -55,7 +55,7 @@ namespace std { - 正しい結果が戻り値の型(`int`)の範囲で表現可能な場合は、戻り値は正確で、現在の丸め方式に依存しない。 - 正しい結果が戻り値の型(`int`)の範囲外の場合は、戻り値は未規定で、[`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外)が発生する。 - `x` がゼロ、無限大、あるいは NaN の場合には、[`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外)が発生する。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/isfinite.md b/reference/cmath/isfinite.md index 30ca0708c3..39e1ebaedb 100644 --- a/reference/cmath/isfinite.md +++ b/reference/cmath/isfinite.md @@ -37,7 +37,7 @@ namespace std { ## 備考 - C標準ライブラリでは`isfinite`は関数マクロとして定義されるが、C++標準ライブラリでは関数として定義される -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/isgreater.md b/reference/cmath/isgreater.md index 9f325007ca..4a3f4798fb 100644 --- a/reference/cmath/isgreater.md +++ b/reference/cmath/isgreater.md @@ -41,7 +41,7 @@ namespace std { ## 備考 - C標準ライブラリでは本関数は関数マクロとして定義されるが、C++標準ライブラリでは関数として定義される - C標準ライブラリでは本関数は`int`型を戻り値とするが、C++標準ライブラリでは`bool`型を戻り値とする -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/isgreaterequal.md b/reference/cmath/isgreaterequal.md index 81362665ce..59bbdd8145 100644 --- a/reference/cmath/isgreaterequal.md +++ b/reference/cmath/isgreaterequal.md @@ -41,7 +41,7 @@ namespace std { ## 備考 - C標準ライブラリでは本関数は関数マクロとして定義されるが、C++標準ライブラリでは関数として定義される - C標準ライブラリでは本関数は`int`型を戻り値とするが、C++標準ライブラリでは`bool`型を戻り値とする -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/isinf.md b/reference/cmath/isinf.md index f962c92ece..54bdfbe176 100644 --- a/reference/cmath/isinf.md +++ b/reference/cmath/isinf.md @@ -37,7 +37,7 @@ namespace std { ## 備考 - C標準ライブラリでは`isinf`は関数マクロとして定義されるが、C++標準ライブラリでは関数として定義される -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/isless.md b/reference/cmath/isless.md index 78fc46a878..78bed4d0c3 100644 --- a/reference/cmath/isless.md +++ b/reference/cmath/isless.md @@ -41,7 +41,7 @@ namespace std { ## 備考 - C標準ライブラリでは本関数は関数マクロとして定義されるが、C++標準ライブラリでは関数として定義される - C標準ライブラリでは本関数は`int`型を戻り値とするが、C++標準ライブラリでは`bool`型を戻り値とする -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/islessequal.md b/reference/cmath/islessequal.md index 44a39cfe6d..d4ab66480f 100644 --- a/reference/cmath/islessequal.md +++ b/reference/cmath/islessequal.md @@ -41,7 +41,7 @@ namespace std { ## 備考 - C標準ライブラリでは本関数は関数マクロとして定義されるが、C++標準ライブラリでは関数として定義される - C標準ライブラリでは本関数は`int`型を戻り値とするが、C++標準ライブラリでは`bool`型を戻り値とする -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/islessgreater.md b/reference/cmath/islessgreater.md index 60cb3e87ab..d10f1947ba 100644 --- a/reference/cmath/islessgreater.md +++ b/reference/cmath/islessgreater.md @@ -41,7 +41,7 @@ namespace std { ## 備考 - C標準ライブラリでは本関数は関数マクロとして定義されるが、C++標準ライブラリでは関数として定義される - C標準ライブラリでは本関数は`int`型を戻り値とするが、C++標準ライブラリでは`bool`型を戻り値とする -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/isnan.md b/reference/cmath/isnan.md index 440e2a07c6..0052da26de 100644 --- a/reference/cmath/isnan.md +++ b/reference/cmath/isnan.md @@ -37,7 +37,7 @@ namespace std { ## 備考 - C標準ライブラリでは`isnan`は関数マクロとして定義されるが、C++標準ライブラリでは関数として定義される -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/isnormal.md b/reference/cmath/isnormal.md index 6aeaa41834..051ac7fc48 100644 --- a/reference/cmath/isnormal.md +++ b/reference/cmath/isnormal.md @@ -37,7 +37,7 @@ namespace std { ## 備考 - C標準ライブラリでは`isnormal`は関数マクロとして定義されるが、C++標準ライブラリでは関数として定義される -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/isunordered.md b/reference/cmath/isunordered.md index 7adb781418..f1013c2bd6 100644 --- a/reference/cmath/isunordered.md +++ b/reference/cmath/isunordered.md @@ -41,7 +41,7 @@ NaNに対する順序付けはされないため、`x`と`y`のいずれかがNa ## 備考 - C標準ライブラリでは本関数は関数マクロとして定義されるが、C++標準ライブラリでは関数として定義される - C標準ライブラリでは本関数は`int`型を戻り値とするが、C++標準ライブラリでは`bool`型を戻り値とする -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/ldexp.md b/reference/cmath/ldexp.md index 00ca443394..ee18fec2c3 100644 --- a/reference/cmath/ldexp.md +++ b/reference/cmath/ldexp.md @@ -55,7 +55,7 @@ namespace std { ## 備考 - オーバーフローエラー、アンダーフローエラーが発生した場合の挙動については、[``](../cmath.md) を参照。 - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、かつ、基数が 2 の場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`radix`](../limits/numeric_limits/radix.md)`() == 2`)、[`scalbn`](scalbn.md)`(x, exp)` と等価である。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/lgamma.md b/reference/cmath/lgamma.md index 03027e27d0..f0cec5c2f2 100644 --- a/reference/cmath/lgamma.md +++ b/reference/cmath/lgamma.md @@ -59,7 +59,7 @@ namespace std { [`FE_DIVBYZERO`](../cfenv/fe_divbyzero.md)(ゼロ除算浮動小数点例外)が発生する。 - `x = -∞` の場合、戻り値は `+∞` となる。 - `x = +∞` の場合、戻り値は `+∞` となる。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された - この関数はガンマ関数 ([`tgamma`](tgamma.md)) がオーバーフローするような場合に使う。 具体例については[ガンマ関数の備考](tgamma.md#remarks-lgamma)を参照のこと。 diff --git a/reference/cmath/llrint.md b/reference/cmath/llrint.md index aa478ca9ba..141355dfcb 100644 --- a/reference/cmath/llrint.md +++ b/reference/cmath/llrint.md @@ -46,7 +46,7 @@ namespace std { なお、C99 でも `FENV_ACCESS` のデフォルトは処理系定義である。 - 丸めモード [`FE_TONEAREST`](../cfenv/fe_tonearest.md) は四捨五入ではなく、最近接偶数への丸めであることに注意。(例を参照) 四捨五入が必要であれば、[`llround`](llround.md) を使用すること。(ただし、[`llround`](llround.md) は本関数と異なり、ISO IEC 60559 に準拠していても [`FE_INEXACT`](../cfenv/fe_inexact.md) が発生するか否かは処理系定義である) -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/llround.md b/reference/cmath/llround.md index 57a106b16a..fba7a7fe8b 100644 --- a/reference/cmath/llround.md +++ b/reference/cmath/llround.md @@ -54,7 +54,7 @@ namespace std { - [`round`](round.md)関数と違い、本関数において戻り値が非整数型引数 `x` と異なる場合に、例外 [`FE_INEXACT`](/reference/cfenv/fe_inexact.md) を発生させる必要はない。 - 戻り値が[`long long`型](/lang/cpp11/long_long_type.md)の範囲を超えた場合、定義域エラーが起こる可能性がある。その際の挙動については、[``](../cmath.md) を参照。 - なお、本関数の挙動は、現在の丸めモードには依存しない。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/log.md b/reference/cmath/log.md index 9faf891717..6e21aa6241 100644 --- a/reference/cmath/log.md +++ b/reference/cmath/log.md @@ -59,7 +59,7 @@ namespace std { - `x = 1` の場合、戻り値は `+0` となる。 - `x < 0` の場合、戻り値は quiet NaN となり、[`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外)が発生する。 - `x = +∞` の場合、戻り値は `+∞` となる。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/log10.md b/reference/cmath/log10.md index 7ecd19f593..af742ee0b1 100644 --- a/reference/cmath/log10.md +++ b/reference/cmath/log10.md @@ -59,7 +59,7 @@ namespace std { - `x = 1` の場合、戻り値は `+0` となる。 - `x < 0` の場合、戻り値は quiet NaN となり、[`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外)が発生する。 - `x = +∞` の場合、戻り値は `+∞` となる。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/log1p.md b/reference/cmath/log1p.md index f8cd0da401..360293555a 100644 --- a/reference/cmath/log1p.md +++ b/reference/cmath/log1p.md @@ -62,7 +62,7 @@ namespace std { - `x = -1` の場合、戻り値は `-∞` となり、[`FE_DIVBYZERO`](../cfenv/fe_divbyzero.md)(ゼロ除算浮動小数点例外)が発生する。 - `x < -1` の場合、戻り値は quiet NaN となり、[`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外)が発生する。 - `x = +∞` の場合、戻り値は `+∞` となる。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/log2.md b/reference/cmath/log2.md index 3995ae4613..ff0566f418 100644 --- a/reference/cmath/log2.md +++ b/reference/cmath/log2.md @@ -60,7 +60,7 @@ namespace std { - `x = 1` の場合、戻り値は `+0` となる。 - `x < 0` の場合、戻り値は quiet NaN となり、[`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外)が発生する。 - `x = +∞` の場合、戻り値は `+∞` となる。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/logb.md b/reference/cmath/logb.md index c0c2f54eaf..5a704abad3 100644 --- a/reference/cmath/logb.md +++ b/reference/cmath/logb.md @@ -57,7 +57,7 @@ namespace std { - `x = ±0` の場合、戻り値は `-∞` となり、[`FE_DIVBYZERO`](../cfenv/fe_divbyzero.md)(ゼロ除算浮動小数点例外)が発生する。 - `x = ±∞` の場合、戻り値は `+∞` となる。 - 戻り値は正確で、現在の丸め方式に依存しない。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/lrint.md b/reference/cmath/lrint.md index 387b950a3c..ffa8687f7a 100644 --- a/reference/cmath/lrint.md +++ b/reference/cmath/lrint.md @@ -45,7 +45,7 @@ namespace std { なお、C99 でも `FENV_ACCESS` のデフォルトは処理系定義である。 - 丸めモード [`FE_TONEAREST`](../cfenv/fe_tonearest.md) は単なる四捨五入ではないことに注意。 四捨五入が必要であれば、[`lround`](lround.md) を使用すること。(ただし、[`lround`](lround.md) は本関数と異なり、ISO IEC 60559 に準拠していても [`FE_INEXACT`](../cfenv/fe_inexact.md) が発生するか否かは処理系定義である) -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/lround.md b/reference/cmath/lround.md index d3bc0e7dbd..4be8c303a2 100644 --- a/reference/cmath/lround.md +++ b/reference/cmath/lround.md @@ -54,7 +54,7 @@ namespace std { - [`round`](round.md)関数と違い、本関数において戻り値が非整数型引数 `x` と異なる場合に、例外 [`FE_INEXACT`](/reference/cfenv/fe_inexact.md) を発生させる必要はない。 - 戻り値が`long`型の範囲を超えた場合、定義域エラーが起こる可能性がある。その際の挙動については、[``](../cmath.md) を参照。 - なお、本関数の挙動は、現在の丸めモードには依存しない。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/modf.md b/reference/cmath/modf.md index b0f620b46b..3a271bac69 100644 --- a/reference/cmath/modf.md +++ b/reference/cmath/modf.md @@ -63,7 +63,7 @@ namespace std { - C++11 で `value` が整数型のオーバーロードが追加されているが、`iptr` の型によって呼び出されるオーバーロードが一意に決まるため、存在意義は無いものと思われる。 (`value` に整数型、`iptr` に `nullptr` を渡した場合のみ当該オーバーロードによって呼び出しが曖昧ではなくなるが、その場合は未定義動作となってしまうため、本オーバーロードの存在はむしろ有害) -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/nearbyint.md b/reference/cmath/nearbyint.md index 339a58b2c2..ccb56c8337 100644 --- a/reference/cmath/nearbyint.md +++ b/reference/cmath/nearbyint.md @@ -46,7 +46,7 @@ namespace std { - C99 では、丸めモードの設定時には `#pragma STDC FENV_ACCESS ON` でなければなければならないと記載されているが、C++ には該当する記載を見つけることができなかった。 なお、C99 でも `FENV_ACCESS` のデフォルトは処理系定義である。 - 丸めモード [`FE_TONEAREST`](../cfenv/fe_tonearest.md) は単なる四捨五入ではないことに注意。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/nextafter.md b/reference/cmath/nextafter.md index f66bdfebba..8a5647008f 100644 --- a/reference/cmath/nextafter.md +++ b/reference/cmath/nextafter.md @@ -69,7 +69,7 @@ namespace std { ## 備考 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/nexttoward.md b/reference/cmath/nexttoward.md index 5d285c4fe4..f1568f7a1f 100644 --- a/reference/cmath/nexttoward.md +++ b/reference/cmath/nexttoward.md @@ -70,7 +70,7 @@ namespace std { ## 備考 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/pow.md b/reference/cmath/pow.md index 8b27ff64a2..5878da2f8c 100644 --- a/reference/cmath/pow.md +++ b/reference/cmath/pow.md @@ -102,7 +102,7 @@ namespace std { - `x = -∞` で `y` が正でかつ奇数ではない場合、戻り値は `+∞` となる。 - `x = +∞` で `y < 0` の場合、戻り値は `+0` となる。 - `x = +∞` で `y > 0` の場合、戻り値は `+∞` となる。 -- C++23では、(1)、(2)、(3)が(7)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(7)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/remainder.md b/reference/cmath/remainder.md index d0e32ab57e..4d4a6e1c49 100644 --- a/reference/cmath/remainder.md +++ b/reference/cmath/remainder.md @@ -59,7 +59,7 @@ IEC 60559で要求された`x REM y`を計算して返す。 - 本関数は、C99 の規格にある `remainder`(より正確には `math.h` ヘッダの `remainder`、`remainderf`、`remainderl` の 3 つ。それぞれ C++ の `double`、`float`、`long double` バージョンに相当)と等価である。 - IEC 60559で要求された`x REM y`の計算とは以下のようなものであり、全ての実装に適用できる。 - 「y≠0である場合、剰余r = x REM yは、丸めモードに関係なく数学的な関係r = x - nyによって定義される。ここで、nはx/yの正確な値に最も近い整数である。| n - x/y | = 1/2ならば、nは常に偶数である。したがって、剰余は常に正確である。r = 0の場合、その符号はxの符号とする」 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/remquo.md b/reference/cmath/remquo.md index 4696daaf51..40c30b2ecc 100644 --- a/reference/cmath/remquo.md +++ b/reference/cmath/remquo.md @@ -80,7 +80,7 @@ namespace std { `remquo`関数では`x/y`の厳密な商を求めることはできない。 三角関数のような周期性をもつ数学関数の内部実装において、商の低次ビットを利用した引数の還元(argument reduction)操作で利用する。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/rint.md b/reference/cmath/rint.md index c656b58ffc..4dcdeeafa8 100644 --- a/reference/cmath/rint.md +++ b/reference/cmath/rint.md @@ -47,7 +47,7 @@ namespace std { - C99 では、丸めモードの設定時には `#pragma STDC FENV_ACCESS ON` でなければなければならないと記載されているが、C++ には該当する記載を見つけることができなかった。 なお、C99 でも `FENV_ACCESS` のデフォルトは処理系定義である。 - 丸めモード [`FE_TONEAREST`](../cfenv/fe_tonearest.md) は単なる四捨五入ではないことに注意。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/round.md b/reference/cmath/round.md index a685b14eae..c88d88beb9 100644 --- a/reference/cmath/round.md +++ b/reference/cmath/round.md @@ -85,7 +85,7 @@ namespace std { ただし、本関数において戻り値が引数 `x` と異なる場合に、上記の実装のように例外 [`FE_INEXACT`](/reference/cfenv/fe_inexact.md) が発生するか否かは実装依存である。 なお、本関数の挙動は、現在の丸めモードには依存しない。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/scalbln.md b/reference/cmath/scalbln.md index 3fee1c1b09..ad0fafd0b2 100644 --- a/reference/cmath/scalbln.md +++ b/reference/cmath/scalbln.md @@ -63,7 +63,7 @@ namespace std { - もしオーバーフローエラーやアンダーフローエラーを起こさなければ、結果は正確で現在の丸め方式には依存しない。 - `scalbln()` 関数は、パラメータ `n` の型が `long int` であることを除いて、`scalbn()` 関数と等価である。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/scalbn.md b/reference/cmath/scalbn.md index f30f9fdb1d..0e0cc2315d 100644 --- a/reference/cmath/scalbn.md +++ b/reference/cmath/scalbn.md @@ -71,7 +71,7 @@ namespace std { - もしオーバーフローエラーやアンダーフローエラーを起こさなければ、結果は正確で現在の丸め方式には依存しない。 - `scalbln()` 関数は、パラメータ `n` の型が `long int` であることを除いて、`scalbn()` 関数と等価である。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/signbit.md b/reference/cmath/signbit.md index 70b744e3df..9689541eac 100644 --- a/reference/cmath/signbit.md +++ b/reference/cmath/signbit.md @@ -40,7 +40,7 @@ namespace std { ## 備考 - C標準ライブラリでは`signbit`は関数マクロとして定義されるが、C++標準ライブラリでは関数として定義される -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/sin.md b/reference/cmath/sin.md index 60450378af..1978c2964c 100644 --- a/reference/cmath/sin.md +++ b/reference/cmath/sin.md @@ -54,7 +54,7 @@ namespace std { - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 - `x = ±0` の場合、戻り値は `±0` となる。(複号同順) - `x = ±∞` の場合、戻り値は quiet NaN となり、[`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外)が発生する。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/sinh.md b/reference/cmath/sinh.md index 6e8594c3f0..5f0e4441b8 100644 --- a/reference/cmath/sinh.md +++ b/reference/cmath/sinh.md @@ -57,7 +57,7 @@ namespace std { - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。(複号同順) - `x = ±0` の場合、戻り値は `±0` となる。 - `x = ±∞` の場合、戻り値は `±∞` となる。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/sqrt.md b/reference/cmath/sqrt.md index f837ec613f..be41bd8c0e 100644 --- a/reference/cmath/sqrt.md +++ b/reference/cmath/sqrt.md @@ -58,7 +58,7 @@ namespace std { - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。(複号同順) - `x = ±0` の場合、戻り値は `±0` となる。 - `-0.0`は`0.0`と等しいため、定義域エラーにはならず、`-0.0`が返る -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/tan.md b/reference/cmath/tan.md index 2eecf915b8..eb4ab0fe42 100644 --- a/reference/cmath/tan.md +++ b/reference/cmath/tan.md @@ -54,7 +54,7 @@ namespace std { - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 - `x = ±0` の場合、戻り値は `±0` となる。(複号同順) - `x = ±∞` の場合、戻り値は quiet NaN となり、[`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外)が発生する。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/tanh.md b/reference/cmath/tanh.md index bfae3387eb..b4580f2949 100644 --- a/reference/cmath/tanh.md +++ b/reference/cmath/tanh.md @@ -54,7 +54,7 @@ namespace std { - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。(複号同順) - `x = ±0` の場合、戻り値は `±0` となる。 - `x = ±∞` の場合、戻り値は `±1` となる。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cmath/tgamma.md b/reference/cmath/tgamma.md index 615ff77179..ae4b949ecf 100644 --- a/reference/cmath/tgamma.md +++ b/reference/cmath/tgamma.md @@ -62,7 +62,7 @@ $$ \Gamma (x) = \int_0^\infty t^{x-1} e^{-t} dt $$ [`FE_INVALID`](../cfenv/fe_invalid.md)(無効演算浮動小数点例外)が発生する。 - `x = +∞` の場合、戻り値は `+∞` となる。 - `gamma` という関数は既にあったが処理系によって定義が違ったため、本当の (true) ガンマ関数 `tgamma` と名付けられた。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ### lgamma との使い分け ガンマ関数は急激に増加し容易にオーバーフローするので、代わりにガンマ関数の結果を自然対数で返す関数 [`lgamma`](lgamma.md) を用いた方が良いことが多くある。 diff --git a/reference/cmath/trunc.md b/reference/cmath/trunc.md index d81a623db7..7b9b27c173 100644 --- a/reference/cmath/trunc.md +++ b/reference/cmath/trunc.md @@ -58,7 +58,7 @@ namespace std { また、本関数の挙動は、丸めモードが [`FE_TOWARDZERO`](/reference/cfenv/fe_towardzero.md) に設定されている時の [`rint`](rint.md)、あるいは [`nearbyint`](nearbyint.md) のいずれかと等価である。 したがって、本関数において戻り値が引数 `x` と異なる場合に例外 [`FE_INEXACT`](/reference/cfenv/fe_inexact.md) が発生するか否かは実装依存である。 なお、本関数の挙動は、現在の丸めモードには依存しない。 -- C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/cstdlib/abs.md b/reference/cstdlib/abs.md index ad61f0b6aa..d8dd259e09 100644 --- a/reference/cstdlib/abs.md +++ b/reference/cstdlib/abs.md @@ -65,7 +65,7 @@ namespace std { ## 備考 - パラメータの型`X`において[`is_unsigned_v`](/reference/type_traits/is_unsigned.md)``が`true`であり、`X`が整数昇格によって`int`に変換できない場合、プログラムは不適格となる - Cとの互換性のため、`int`に昇格できる符号なし整数型は許可される -- C++23では、(4)、(5)、(6)が(7)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された +- C++23では、(4), (5), (6)が(7)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された ## 例 diff --git a/reference/flat_map/flat_map/insert_or_assign.md b/reference/flat_map/flat_map/insert_or_assign.md index 0a0328719b..95f5324225 100644 --- a/reference/flat_map/flat_map/insert_or_assign.md +++ b/reference/flat_map/flat_map/insert_or_assign.md @@ -93,17 +93,17 @@ iterator ## 戻り値 -- (1)、(2)、(3) : イテレータと `bool` 値の [`pair`](/reference/utility/pair.md) を返す。 +- (1), (2), (3) : イテレータと `bool` 値の [`pair`](/reference/utility/pair.md) を返す。 - 挿入された場合には、`first` に挿入された要素へのイテレータ、`second` に `true` が設定される。 - 代入された場合には、`first` に代入された要素へのイテレータ、`second` に `false` が設定される。 -- (4)、(5)、(6) : +- (4), (5), (6) : - 挿入された場合には、挿入された要素へのイテレータを返す。 - 代入された場合には、代入された要素へのイテレータを返す。 ## 計算量 -- (1)、(2)、(3) : [`emplace`](emplace.md) と同じ -- (4)、(5)、(6) : [`emplace_hint`](emplace_hint.md) と同じ +- (1), (2), (3) : [`emplace`](emplace.md) と同じ +- (4), (5), (6) : [`emplace_hint`](emplace_hint.md) と同じ ## 例 diff --git a/reference/ios/ios_base/failure/op_constructor.md b/reference/ios/ios_base/failure/op_constructor.md index 1b068c3602..e2841223a2 100644 --- a/reference/ios/ios_base/failure/op_constructor.md +++ b/reference/ios/ios_base/failure/op_constructor.md @@ -20,7 +20,7 @@ explicit failure(const char* msg, const error_code& ec = io_errc::stream); ## 効果 - (1) [`strcmp`](../../../cstring/strcmp.md.nolink)`(`[`what`](what.md)`(), msg.`[`c_str`](../../../string/basic_string/c_str.md)`()) == 0` となる [`ios_base`](../../ios_base.md)`::`[`failure`](../failure.md) オブジェクトを構築する。 -- (2)、(3) 引数 `msg` と `ec` を用いて基底クラスを構築して、[`ios_base`](../../ios_base.md)`::`[`failure`](../failure.md) オブジェクトを構築する。 +- (2), (3) 引数 `msg` と `ec` を用いて基底クラスを構築して、[`ios_base`](../../ios_base.md)`::`[`failure`](../failure.md) オブジェクトを構築する。 ## 例 diff --git a/reference/map/map/insert_or_assign.md b/reference/map/map/insert_or_assign.md index f6c5c07df3..a9e0b2b622 100644 --- a/reference/map/map/insert_or_assign.md +++ b/reference/map/map/insert_or_assign.md @@ -54,29 +54,29 @@ iterator ## 適格要件 -- (1)、(3)、(4)、(6) : [`is_assignable_v`](/reference/type_traits/is_assignable.md)`` が `true` であること。`value_type` は、`k`, [`forward`](/reference/utility/forward.md)`(obj)` から `map` に直接構築可能であること -- (2)、(5) : [`is_assignable_v`](/reference/type_traits/is_assignable.md)`` が `true` であること。`value_type` は、[`move`](/reference/utility/move.md)`(k)`, [`forward`](/reference/utility/forward.md)`(obj)` から `map` に直接構築可能であること +- (1), (3), (4), (6) : [`is_assignable_v`](/reference/type_traits/is_assignable.md)`` が `true` であること。`value_type` は、`k`, [`forward`](/reference/utility/forward.md)`(obj)` から `map` に直接構築可能であること +- (2), (5) : [`is_assignable_v`](/reference/type_traits/is_assignable.md)`` が `true` であること。`value_type` は、[`move`](/reference/utility/move.md)`(k)`, [`forward`](/reference/utility/forward.md)`(obj)` から `map` に直接構築可能であること なお、規格に記載はないが、`hint` は [`emplace_hint`](emplace_hint.md) と同様、コンテナの有効な読み取り専用イテレータである必要があるものと思われる。 ## 効果 -- (1)、(3)、(4)、(6) : `map` が `k` と同値のキーを持つ要素 `e` を持っている場合、`e.second` に [`forward`](/reference/utility/forward.md)`(obj)` を代入する。そうでなければ、`k`, [`forward`](/reference/utility/forward.md)`(obj)` から構築した `value_type` 型のオブジェクトを挿入する。 -- (2)、(5) : `map` が `k` と同値のキーを持つ要素 `e` を持っている場合、`e.second` に [`forward`](/reference/utility/forward.md)`(obj)` を代入する。そうでなければ、[`move`](/reference/utility/move.md)`(k)`, [`forward`](/reference/utility/forward.md)`(obj)` から構築した `value_type` 型のオブジェクトを挿入する。 +- (1), (3), (4), (6) : `map` が `k` と同値のキーを持つ要素 `e` を持っている場合、`e.second` に [`forward`](/reference/utility/forward.md)`(obj)` を代入する。そうでなければ、`k`, [`forward`](/reference/utility/forward.md)`(obj)` から構築した `value_type` 型のオブジェクトを挿入する。 +- (2), (5) : `map` が `k` と同値のキーを持つ要素 `e` を持っている場合、`e.second` に [`forward`](/reference/utility/forward.md)`(obj)` を代入する。そうでなければ、[`move`](/reference/utility/move.md)`(k)`, [`forward`](/reference/utility/forward.md)`(obj)` から構築した `value_type` 型のオブジェクトを挿入する。 ## 戻り値 -- (1)、(2)、(3) : イテレータと `bool` 値の [`pair`](/reference/utility/pair.md) を返す。 +- (1), (2), (3) : イテレータと `bool` 値の [`pair`](/reference/utility/pair.md) を返す。 - 挿入された場合には、`first` に挿入された要素へのイテレータ、`second` に `true` が設定される。 - 代入された場合には、`first` に代入された要素へのイテレータ、`second` に `false` が設定される。 -- (4)、(5)、(6) : +- (4), (5), (6) : - 挿入された場合には、挿入された要素へのイテレータを返す。 - 代入された場合には、代入された要素へのイテレータを返す。 ## 計算量 -- (1)、(2)、(3) : [`emplace`](emplace.md) と同じ。 -- (4)、(5)、(6) : [`emplace_hint`](emplace_hint.md) と同じ。 +- (1), (2), (3) : [`emplace`](emplace.md) と同じ。 +- (4), (5), (6) : [`emplace_hint`](emplace_hint.md) と同じ。 ## 備考 diff --git a/reference/map/map/op_constructor.md b/reference/map/map/op_constructor.md index 1ff4175f9b..e3f9c22a35 100644 --- a/reference/map/map/op_constructor.md +++ b/reference/map/map/op_constructor.md @@ -75,13 +75,13 @@ map(from_range_t, R&& rg, ## 計算量 -- (1)、(2)、(3) 定数時間 -- (4)、(5) `N =` [`distance`](../../iterator/distance.md)`(first, last)` とすると、範囲 `[first, last)` が比較オブジェクト `comp` によって既にソート済みである場合は `N` に比例、そうでなければ `N log N` に比例 -- (6)、(7) `x.`[`size`](size.md)`()` に対して線形時間 +- (1), (2), (3) 定数時間 +- (4), (5) `N =` [`distance`](../../iterator/distance.md)`(first, last)` とすると、範囲 `[first, last)` が比較オブジェクト `comp` によって既にソート済みである場合は `N` に比例、そうでなければ `N log N` に比例 +- (6), (7) `x.`[`size`](size.md)`()` に対して線形時間 - (8) 定数時間 - (9) 定数時間。但し、`alloc == y.`[`get_allocator`](get_allocator.md)`()` でなければ `y.`[`size`](size.md)`()` に対して線形時間 -- (10)、(11) `N = init.`[`size`](../../initializer_list/initializer_list/size.md)`()` とすると、範囲 `[init.`[`begin`](../../initializer_list/initializer_list/begin.md)`(), init.`[`end`](../../initializer_list/initializer_list/end.md)`())` が比較オブジェクト `comp` によって既にソート済みである場合は `N` に比例、そうでなければ `N log N` に比例 -- (12)、(13) `N =` [`ranges::distance`](../../iterator/ranges_distance.md)`(rg)` とすると、`rg` が比較オブジェクト `comp` によって既にソート済みである場合は `N` に比例、そうでなければ `N log N` に比例 +- (10), (11) `N = init.`[`size`](../../initializer_list/initializer_list/size.md)`()` とすると、範囲 `[init.`[`begin`](../../initializer_list/initializer_list/begin.md)`(), init.`[`end`](../../initializer_list/initializer_list/end.md)`())` が比較オブジェクト `comp` によって既にソート済みである場合は `N` に比例、そうでなければ `N log N` に比例 +- (12), (13) `N =` [`ranges::distance`](../../iterator/ranges_distance.md)`(rg)` とすると、`rg` が比較オブジェクト `comp` によって既にソート済みである場合は `N` に比例、そうでなければ `N log N` に比例 ## 備考 @@ -166,5 +166,5 @@ Size of c2: 2 - [LWG 2193. Default constructors for standard library containers are explicit](http://cplusplus.github.io/LWG/lwg-defects.html#2193) (1) + (2) を 2 つのオーバーロードに分割するきっかけとなったレポート - [LWG 2210. Missing allocator-extended constructor for allocator-aware containers](http://cplusplus.github.io/LWG/lwg-defects.html#2210) - (5)、(11) を追加するきっかけとなったレポート + (5), (11) を追加するきっかけとなったレポート なお、Discussion の例はアロケータの型が誤っているので注意 diff --git a/reference/map/map/try_emplace.md b/reference/map/map/try_emplace.md index c6b4b178bb..0659acc06d 100644 --- a/reference/map/map/try_emplace.md +++ b/reference/map/map/try_emplace.md @@ -55,9 +55,9 @@ iterator ## テンプレートパラメータ制約 -- (1)、(3)、(5)、(6) : `value_type` は、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(k)`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から `map` に直接構築可能であること -- (2)、(4) : `value_type` は、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`move`](/reference/utility/move.md)`(k))`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から `map` に直接構築可能であること -- (5)、(6) : +- (1), (3), (5), (6) : `value_type` は、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(k)`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から `map` に直接構築可能であること +- (2), (4) : `value_type` は、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`move`](/reference/utility/move.md)`(k))`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から `map` に直接構築可能であること +- (5), (6) : - `key_compare::is_transparent` が妥当な式であること - [`is_convertible_v`](/reference/type_traits/is_convertible.md)` == false`であること - [`is_convertible_v`](/reference/type_traits/is_convertible.md)` == false`であること @@ -66,22 +66,22 @@ iterator ## 効果 -- (1)、(3)、(5)、(6) : `map` が `k` と同値のキーを持つ要素を持っている場合、何もしない(引数への副作用もない)。そうでなければ、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(k)`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から構築した `value_type` 型のオブジェクトを挿入する。 -- (2)、(4) : `map` が `k` と同値のキーを持つ要素を持っている場合、何もしない(引数への副作用もない)。そうでなければ、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`move`](/reference/utility/move.md)`(k))`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から構築した `value_type` 型のオブジェクトを挿入する。 +- (1), (3), (5), (6) : `map` が `k` と同値のキーを持つ要素を持っている場合、何もしない(引数への副作用もない)。そうでなければ、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(k)`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から構築した `value_type` 型のオブジェクトを挿入する。 +- (2), (4) : `map` が `k` と同値のキーを持つ要素を持っている場合、何もしない(引数への副作用もない)。そうでなければ、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`move`](/reference/utility/move.md)`(k))`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から構築した `value_type` 型のオブジェクトを挿入する。 ## 戻り値 -- (1)、(2)、(5) : イテレータと `bool` 値の [`pair`](/reference/utility/pair.md) を返す。 +- (1), (2), (5) : イテレータと `bool` 値の [`pair`](/reference/utility/pair.md) を返す。 - 挿入された場合には、`first` に挿入された要素へのイテレータ、`second` に `true` が設定される。 - 挿入されなかった場合には、`first` に `k` と等価のキーを持つ既存の要素へのイテレータ、`second` に `false` が設定される。 -- (3)、(4)、(6) : +- (3), (4), (6) : - 挿入された場合には、挿入された要素へのイテレータを返す。 - 挿入されなかった場合には、`k` と等価のキーを持つ既存の要素へのイテレータを返す。 ## 計算量 -- (1)、(2)、(5) : [`emplace`](emplace.md) と同じ。 -- (3)、(4)、(6) : [`emplace_hint`](emplace_hint.md) と同じ。 +- (1), (2), (5) : [`emplace`](emplace.md) と同じ。 +- (3), (4), (6) : [`emplace_hint`](emplace_hint.md) と同じ。 ## 備考 diff --git a/reference/map/multimap/op_constructor.md b/reference/map/multimap/op_constructor.md index b3d68db064..8543c63cd9 100644 --- a/reference/map/multimap/op_constructor.md +++ b/reference/map/multimap/op_constructor.md @@ -78,13 +78,13 @@ multimap(from_range_t, R&& rg, ## 計算量 -- (1)、(2)、(3) 定数時間 -- (4)、(5) `N =` [`distance`](../../iterator/distance.md)`(first, last)` とすると、範囲 `[first, last)` が比較オブジェクト `comp` によって既にソート済みである場合は `N` に比例、そうでなければ `N log N` に比例 -- (6)、(7) `x.`[`size`](size.md)`()` に対して線形時間 +- (1), (2), (3) 定数時間 +- (4), (5) `N =` [`distance`](../../iterator/distance.md)`(first, last)` とすると、範囲 `[first, last)` が比較オブジェクト `comp` によって既にソート済みである場合は `N` に比例、そうでなければ `N log N` に比例 +- (6), (7) `x.`[`size`](size.md)`()` に対して線形時間 - (8) 定数時間 - (9) 定数時間。ただし、`alloc == y.`[`get_allocator`](get_allocator.md)`()` でなければ `y.`[`size`](size.md)`()` に対して線形時間 -- (10)、(11) `N = init.`[`size`](../../initializer_list/initializer_list/size.md)`()` とすると、範囲 `[init.`[`begin`](../../initializer_list/initializer_list/begin.md)`(), init.`[`end`](../../initializer_list/initializer_list/end.md)`())` が比較オブジェクト `comp` によって既にソート済みである場合は `N` に比例、そうでなければ `N log N` に比例 -- (12)、(13) `N =` [`ranges::distance`](../../iterator/ranges_distance.md)`(rg)` とすると、`rg` が比較オブジェクト `comp` によって既にソート済みである場合は `N` に比例、そうでなければ `N log N` に比例 +- (10), (11) `N = init.`[`size`](../../initializer_list/initializer_list/size.md)`()` とすると、範囲 `[init.`[`begin`](../../initializer_list/initializer_list/begin.md)`(), init.`[`end`](../../initializer_list/initializer_list/end.md)`())` が比較オブジェクト `comp` によって既にソート済みである場合は `N` に比例、そうでなければ `N log N` に比例 +- (12), (13) `N =` [`ranges::distance`](../../iterator/ranges_distance.md)`(rg)` とすると、`rg` が比較オブジェクト `comp` によって既にソート済みである場合は `N` に比例、そうでなければ `N log N` に比例 ## 備考 @@ -169,5 +169,5 @@ Size of m2: 3 - [LWG 2193. Default constructors for standard library containers are explicit](http://cplusplus.github.io/LWG/lwg-defects.html#2193) (1) + (2) の形式を 2 つのオーバーロードに分割するきっかけとなったレポート - [LWG 2210. Missing allocator-extended constructor for allocator-aware containers](http://cplusplus.github.io/LWG/lwg-defects.html#2210) - (5)、(11) の形式を追加するきっかけとなったレポート + (5), (11) の形式を追加するきっかけとなったレポート なお、Discussion の例はアロケータの型が誤っているので注意 diff --git a/reference/numeric/transform_reduce.md b/reference/numeric/transform_reduce.md index a0731dc3c4..32c7cbcf7e 100644 --- a/reference/numeric/transform_reduce.md +++ b/reference/numeric/transform_reduce.md @@ -86,7 +86,7 @@ namespace std { ## 概要 `transform_reduce()`は、イテレータ範囲の要素を変換しながら集計する関数である。 -(1)、(2)、(4)、(5)は、イテレータ範囲`[first1, last1)`の各要素を`x`、イテレータ範囲`[first2, first2+(last1 - first1))`の各要素を`y`として、初期値(`init`)と`binary_op2(x, y)`した各要素を合算したリストの任意の組み合わせに、順不同で`binary_op1(binary_op1(a, b), binary_op1(c, d))`のように適用していき、集計値を計算する。 +(1), (2), (4), (5)は、イテレータ範囲`[first1, last1)`の各要素を`x`、イテレータ範囲`[first2, first2+(last1 - first1))`の各要素を`y`として、初期値(`init`)と`binary_op2(x, y)`した各要素を合算したリストの任意の組み合わせに、順不同で`binary_op1(binary_op1(a, b), binary_op1(c, d))`のように適用していき、集計値を計算する。 (3)と(6)は、初期値(`init`)と、イテレータ範囲`[first, last)`の各要素に関数オブジェクト`unary_op`を適用して合算したリストの任意の組み合わせに、順不同で`binary_op(binary_op(a, b), binary_op(c, d))`のように適用していき、集計値を計算する。 diff --git a/reference/ostream/basic_ostream/op_ostream_free.md b/reference/ostream/basic_ostream/op_ostream_free.md index 3ea6ffb763..45e9ac08ce 100644 --- a/reference/ostream/basic_ostream/op_ostream_free.md +++ b/reference/ostream/basic_ostream/op_ostream_free.md @@ -119,7 +119,7 @@ namespace std { ## 例 -### (1)、(2)、(13)、(14) の例 +### (1), (2), (13), (14) の例 ```cpp example #include #include @@ -148,7 +148,7 @@ cpprefjp++ cpprefjp++ ``` -### (3)~(5)、(15)~(17) の例 +### (3)~(5), (15)~(17) の例 ```cpp example #include #include @@ -227,7 +227,7 @@ int main() これは`char8_t`/`char16_t`/`char32_t`に対するostreamの`operator<<`が提供されないため、他のオーバーロードが選ばれるためにこのような直感に反する挙動が発生する。 -そこで(6)~(12)、(18)~(24)のように`delete`指定された`operator<<`を追加することで不適格にし、このような直感的ではない挙動を避ける。 +そこで(6)~(12), (18)~(24)のように`delete`指定された`operator<<`を追加することで不適格にし、このような直感的ではない挙動を避ける。 [機能テストマクロ](/lang/cpp20/feature_test_macros.md)は`__cpp_lib_char8_t`で、値は`201907`。 diff --git a/reference/ranges/view_interface/back.md b/reference/ranges/view_interface/back.md index ab75247776..51a2d6d3b4 100644 --- a/reference/ranges/view_interface/back.md +++ b/reference/ranges/view_interface/back.md @@ -28,7 +28,7 @@ Rangeの末尾の要素を取得する。 `!`[`empty`](empty.md)`()` ## 戻り値 -(1)、(2)共に、以下と等価: +(1), (2)共に、以下と等価: ```cpp *ranges::prev(ranges::end(derived())) diff --git a/reference/ranges/view_interface/cbegin.md b/reference/ranges/view_interface/cbegin.md index 39c4b302d7..f00bb033a1 100644 --- a/reference/ranges/view_interface/cbegin.md +++ b/reference/ranges/view_interface/cbegin.md @@ -20,7 +20,7 @@ Rangeの定数イテレータを取得する。 ## 戻り値 -(1)、(2)共に、以下と等価 +(1), (2)共に、以下と等価 ```cpp return ranges::cbegin(derived()); diff --git a/reference/ranges/view_interface/cend.md b/reference/ranges/view_interface/cend.md index 5c652bc215..76fd620a14 100644 --- a/reference/ranges/view_interface/cend.md +++ b/reference/ranges/view_interface/cend.md @@ -20,7 +20,7 @@ Rangeの定数イテレータに対応する番兵を取得する。 ## 戻り値 -(1)、(2)共に、以下と等価 +(1), (2)共に、以下と等価 ```cpp return ranges::cend(derived()); diff --git a/reference/ranges/view_interface/data.md b/reference/ranges/view_interface/data.md index d42c3a64f9..2ad22e1b39 100644 --- a/reference/ranges/view_interface/data.md +++ b/reference/ranges/view_interface/data.md @@ -26,7 +26,7 @@ Rangeの要素へのポインタを取得する。 - (2): `const D`が[`range`](../range.md)かつ`const D`のイテレータが[`contiguous_iterator`](/reference/iterator/contiguous_iterator.md)であること。 ## 戻り値 -(1)、(2)共に、以下と等価: +(1), (2)共に、以下と等価: ```cpp to_address(ranges::begin(derived())); diff --git a/reference/ranges/view_interface/empty.md b/reference/ranges/view_interface/empty.md index 3ed312c3e5..2cdc27261a 100644 --- a/reference/ranges/view_interface/empty.md +++ b/reference/ranges/view_interface/empty.md @@ -25,7 +25,7 @@ Rangeが空かどうかを判定する。 - (2): `const D`が[`sized_range`](../sized_range.md)もしくは[`forward_range`](../forward_range.md)であること。 ## 戻り値 -(1)、(2)共に、以下と等価: +(1), (2)共に、以下と等価: ```cpp ranges::begin(derived()) == ranges::end(derived()) diff --git a/reference/ranges/view_interface/front.md b/reference/ranges/view_interface/front.md index d7b45e158c..832ab5167f 100644 --- a/reference/ranges/view_interface/front.md +++ b/reference/ranges/view_interface/front.md @@ -27,7 +27,7 @@ Rangeの先頭の要素を取得する。 `!`[`empty`](empty.md)`()` ## 戻り値 -(1)、(2)共に、以下と等価: +(1), (2)共に、以下と等価: ```cpp *ranges::begin(derived()) diff --git a/reference/ranges/view_interface/op_at.md b/reference/ranges/view_interface/op_at.md index c52ada1e10..00ef7c67ce 100644 --- a/reference/ranges/view_interface/op_at.md +++ b/reference/ranges/view_interface/op_at.md @@ -22,7 +22,7 @@ Rangeの要素にアクセスする。 `R`が[`random_access_range`](../random_access_range.md)であること。 ## 戻り値 -(1)、(2)共に、以下と等価: +(1), (2)共に、以下と等価: ```cpp ranges::begin(derived())[n]; diff --git a/reference/ranges/view_interface/op_bool.md b/reference/ranges/view_interface/op_bool.md index d02e69d765..00eb64403c 100644 --- a/reference/ranges/view_interface/op_bool.md +++ b/reference/ranges/view_interface/op_bool.md @@ -22,7 +22,7 @@ Rangeが空かどうかを判定する。 式[`ranges::empty`](../empty.md)`(`[`derived`](derived.md)`())`が有効であること。 ## 戻り値 -(1)、(2)共に、以下と等価: +(1), (2)共に、以下と等価: ```cpp !ranges::empty(derived()) diff --git a/reference/ranges/view_interface/size.md b/reference/ranges/view_interface/size.md index 73bbe46b1c..33e356b7b9 100644 --- a/reference/ranges/view_interface/size.md +++ b/reference/ranges/view_interface/size.md @@ -27,7 +27,7 @@ Rangeの大きさを取得する。 - (2): `const D`が[`forward_range`](../forward_range.md)であり、`const D`のイテレータ`I`と番兵`S`が[`sized_sentinel_for`](/reference/iterator/sized_sentinel_for.md)を満たすこと。 ## 戻り値 -(1)、(2)共に、以下と等価: +(1), (2)共に、以下と等価: ```cpp ranges::end(derived()) - ranges::begin(derived()); diff --git a/reference/regex/match_results/op_assign.md b/reference/regex/match_results/op_assign.md index 40465f41aa..9b39f782f2 100644 --- a/reference/regex/match_results/op_assign.md +++ b/reference/regex/match_results/op_assign.md @@ -26,7 +26,7 @@ match_results& operator=(match_results&& m) noexcept; // (2) ## 事後条件 -- (1)、(2) 以下の表を満たす。 +- (1), (2) 以下の表を満たす。 | 要素 | 値 | |-----------------------------------------|-----------------------------------------------------------------------------------------------| diff --git a/reference/regex/regex_replace.md b/reference/regex/regex_replace.md index 1b131f713f..97adb92ac2 100644 --- a/reference/regex/regex_replace.md +++ b/reference/regex/regex_replace.md @@ -64,18 +64,18 @@ namespace std { ## 効果 -- (1)、(2) `[first, last)` で指定された文字列内に出現する、正規表現 `e` にマッチする部分を、置換文字列 `fmt` で置換した結果を出力イテレータ `out` に出力する。 +- (1), (2) `[first, last)` で指定された文字列内に出現する、正規表現 `e` にマッチする部分を、置換文字列 `fmt` で置換した結果を出力イテレータ `out` に出力する。 置換文字列 `fmt` には通常の文字の他、マッチした文字列全体やキャプチャグループを表すシーケンスを使用することができる。 指定可能なシーケンスは、デフォルトでは ECMAScript の置換文字列と等価であるが、`flags` に [`regex_constants::format_sed`](regex_constants/match_flag_type.md) が指定されていた場合には POSIX にて規定されている sed の置換文字列と等価となる。 なお、デフォルトでは全てのマッチする部分が `fmt` で置換されるが、`flags` に [`regex_constants::format_first_only`](regex_constants/match_flag_type.md) が指定されていた場合には最初にマッチする部分のみが置換される。 また、デフォルトではマッチしない部分はそのまま `out` に出力されるが、`flags` に [`regex_constants::format_no_copy`](regex_constants/match_flag_type.md) が指定されていた場合には、マッチしない部分は `out` には出力されない。 -- (3)、(4) 置換対象文字列が [`basic_string`](../string/basic_string.md)`` 型の文字列 `s` であること、および、置換結果が [`basic_string`](../string/basic_string.md)`` 型の文字列として返される点を除いて、(1)、(2) と同様である。 -- (5)、(6) 置換対象文字列が `const charT*` 型の文字列 `s` であること、および、置換結果が [`basic_string`](../string/basic_string.md)`` 型の文字列として返される点を除いて、(1)、(2) と同様である。 +- (3), (4) 置換対象文字列が [`basic_string`](../string/basic_string.md)`` 型の文字列 `s` であること、および、置換結果が [`basic_string`](../string/basic_string.md)`` 型の文字列として返される点を除いて、(1), (2) と同様である。 +- (5), (6) 置換対象文字列が `const charT*` 型の文字列 `s` であること、および、置換結果が [`basic_string`](../string/basic_string.md)`` 型の文字列として返される点を除いて、(1), (2) と同様である。 ## 戻り値 -- (1)、(2) 置換結果出力後の `out`(引数のコピーではない) -- (3)、(4) 置換結果の文字列 -- (5)、(6) 置換結果の文字列 +- (1), (2) 置換結果出力後の `out`(引数のコピーではない) +- (3), (4) 置換結果の文字列 +- (5), (6) 置換結果の文字列 ## 例外 @@ -86,7 +86,7 @@ namespace std { ## 備考 本関数の正確な挙動は以下の通りである。 -- (1)、(2) [`regex_iterator`](regex_iterator.md) 型のオブジェクト `i` を +- (1), (2) [`regex_iterator`](regex_iterator.md) 型のオブジェクト `i` を ```cpp regex_iterator i(first, last, e, flags) @@ -147,9 +147,9 @@ namespace std { を呼び出す。 -- (3)、(4) [`basic_string`](../string/basic_string.md)`` 型の空の文字列オブジェクト `result` を構築し、`regex_replace(`[`back_inserter`](../iterator/back_inserter.md)`(result), s.`[`begin`](../string/basic_string/begin.md)`(), s.`[`end`](../string/basic_string/end.md)`(), e, fmt, flags)` を呼び出す。 +- (3), (4) [`basic_string`](../string/basic_string.md)`` 型の空の文字列オブジェクト `result` を構築し、`regex_replace(`[`back_inserter`](../iterator/back_inserter.md)`(result), s.`[`begin`](../string/basic_string/begin.md)`(), s.`[`end`](../string/basic_string/end.md)`(), e, fmt, flags)` を呼び出す。 戻り値は `result` となる。 -- (5)、(6) [`basic_string`](../string/basic_string.md)`` 型の空の文字列オブジェクト `result` を構築し、`regex_replace(`[`back_inserter`](../iterator/back_inserter.md)`(result), s, s +` [`char_traits`](../string/char_traits.md)`::`[`length`](../string/char_traits/length.md)`(s), e, fmt, flags)` を呼び出す。 +- (5), (6) [`basic_string`](../string/basic_string.md)`` 型の空の文字列オブジェクト `result` を構築し、`regex_replace(`[`back_inserter`](../iterator/back_inserter.md)`(result), s, s +` [`char_traits`](../string/char_traits.md)`::`[`length`](../string/char_traits/length.md)`(s), e, fmt, flags)` を呼び出す。 戻り値は `result` となる。 diff --git a/reference/set/multiset/op_constructor.md b/reference/set/multiset/op_constructor.md index dff5fb8b5f..d4022a8a68 100644 --- a/reference/set/multiset/op_constructor.md +++ b/reference/set/multiset/op_constructor.md @@ -152,6 +152,6 @@ Size of c2: 7 - [LWG 2193. Default constructors for standard library containers are explicit](http://cplusplus.github.io/LWG/lwg-defects.html#2193) `explicit set(const Compare& comp = Compare(), const Allocator& alloc = Allocator());` を 2 つのオーバーロードに分割するきっかけとなったレポート - [LWG 2210. Missing allocator-extended constructor for allocator-aware containers](http://cplusplus.github.io/LWG/lwg-defects.html#2210) - (5)、(11) を追加するきっかけとなったレポート + (5), (11) を追加するきっかけとなったレポート なお、Discussion の例はアロケータの型が誤っているので注意 diff --git a/reference/set/set/op_constructor.md b/reference/set/set/op_constructor.md index 69d2b48343..30ab3f2a00 100644 --- a/reference/set/set/op_constructor.md +++ b/reference/set/set/op_constructor.md @@ -152,6 +152,6 @@ Size of c2: 6 - [LWG 2193. Default constructors for standard library containers are explicit](http://cplusplus.github.io/LWG/lwg-defects.html#2193) `explicit set(const Compare& comp = Compare(), const Allocator& alloc = Allocator());` を 2 つのオーバーロードに分割するきっかけとなったレポート - [LWG 2210. Missing allocator-extended constructor for allocator-aware containers](http://cplusplus.github.io/LWG/lwg-defects.html#2210) - (5)、(11) を追加するきっかけとなったレポート + (5), (11) を追加するきっかけとなったレポート なお、Discussion の例はアロケータの型が誤っているので注意 diff --git a/reference/string/basic_string/op_plus.md b/reference/string/basic_string/op_plus.md index d44c7578ec..0452ec6fd9 100644 --- a/reference/string/basic_string/op_plus.md +++ b/reference/string/basic_string/op_plus.md @@ -222,7 +222,7 @@ namespace std { ## 備考 -(5)、(6) の形式の `lhs`、および、(9)、(10) の形式の `rhs` の文字列長算出のために `traits::length()` が使用される +(5), (6) の形式の `lhs`、および、(9), (10) の形式の `rhs` の文字列長算出のために `traits::length()` が使用される ## アロケータの伝播 diff --git a/reference/unordered_map/unordered_map/equal_range.md b/reference/unordered_map/unordered_map/equal_range.md index 4b6f787964..c3ba4e15b4 100644 --- a/reference/unordered_map/unordered_map/equal_range.md +++ b/reference/unordered_map/unordered_map/equal_range.md @@ -30,7 +30,7 @@ pair - (3) : 非`const`な`this`に対してキー`k`を透過的に検索し、合致する全ての要素を含む範囲を取得する - (4) : `const`な`this`に対してキー`k`を透過的に検索し、合致する全ての要素を含む範囲を取得する -(3)、(4)の透過的な検索は、`Pred::is_transparent`および`Hash::is_transparent`が定義される場合に有効になる機能であり、例として`unordered_map m;`に対して`m.equal_range("key");`のように`string`型のキーを持つ連想コンテナの検索インタフェースに文字列リテラルを渡した際、`string`の一時オブジェクトが作られないようにできる。詳細は[`std::hash`](/reference/functional/hash.md)クラスのページを参照。 +(3), (4)の透過的な検索は、`Pred::is_transparent`および`Hash::is_transparent`が定義される場合に有効になる機能であり、例として`unordered_map m;`に対して`m.equal_range("key");`のように`string`型のキーを持つ連想コンテナの検索インタフェースに文字列リテラルを渡した際、`string`の一時オブジェクトが作られないようにできる。詳細は[`std::hash`](/reference/functional/hash.md)クラスのページを参照。 ## パラメータ diff --git a/reference/unordered_map/unordered_map/find.md b/reference/unordered_map/unordered_map/find.md index 912c23c02c..43066fc4f4 100644 --- a/reference/unordered_map/unordered_map/find.md +++ b/reference/unordered_map/unordered_map/find.md @@ -21,7 +21,7 @@ template const_iterator find(const K& k) const; // (4) C++20 - (3) : 非`const`な`*this`オブジェクトに対する透過的な検索 - (4) : `const`な`*this`オブジェクトに対する透過的な検索 -(3)、(4)の透過的な検索は、`Pred::is_transparent`および`Hash::is_transparent`型が定義される場合に有効になる機能であり、例として`unordered_map m;`に対して`m.find("key");`のように`string`型のキーを持つ連想コンテナの検索インタフェースに文字列リテラルを渡した際、`string`の一時オブジェクトが作られないようにできる。詳細は[`std::hash`](/reference/functional/hash.md)クラスのページを参照。 +(3), (4)の透過的な検索は、`Pred::is_transparent`および`Hash::is_transparent`型が定義される場合に有効になる機能であり、例として`unordered_map m;`に対して`m.find("key");`のように`string`型のキーを持つ連想コンテナの検索インタフェースに文字列リテラルを渡した際、`string`の一時オブジェクトが作られないようにできる。詳細は[`std::hash`](/reference/functional/hash.md)クラスのページを参照。 ## パラメータ diff --git a/reference/unordered_map/unordered_map/insert.md b/reference/unordered_map/unordered_map/insert.md index 4eec85b023..3b89f15a12 100644 --- a/reference/unordered_map/unordered_map/insert.md +++ b/reference/unordered_map/unordered_map/insert.md @@ -75,13 +75,13 @@ iterator insert(const_iterator hint, node_type&& nh); // (10) C++17 ## 戻り値 -- (1)、(2), (3) : +- (1), (2), (3) : - [`pair`](/reference/utility/pair.md) の `bool` 部分(`second` 部)は、要素が追加されたら `true`、追加されなかったら(既にあったら)`false`を返す - [`pair`](/reference/utility/pair.md) の `iterator` 部分(`first` 部)は、追加された要素(`bool` 部分が `true` の場合)、あるいは、既にあった要素(`bool` 部分が `false` の場合)を指すイテレータを返す -- (4)、(5) : +- (4), (5) : - 新たな要素が追加された場合、その追加された要素を指すイテレータを返す - 新たな要素が追加されなかった場合、すでにあった要素を指すイテレータを返す -- (6)、(7) : なし +- (6), (7) : なし - (9) : - [`insert_return_type`](/reference/map/map.md)を返す。`insert_return_type`のイテレータ型メンバ変数`position`、`bool`型メンバ変数`inserted`に格納される値は(1), (2), (3)のものと同じ情報である。`nh`が空の場合は、`position`は終端イテレータである。`node_type`型メンバ変数`node`には、 - 挿入された場合には、空の[ノードハンドル](/reference/node_handle/node_handle.md) diff --git a/reference/unordered_map/unordered_map/insert_or_assign.md b/reference/unordered_map/unordered_map/insert_or_assign.md index 259f0ef984..64a133fb19 100644 --- a/reference/unordered_map/unordered_map/insert_or_assign.md +++ b/reference/unordered_map/unordered_map/insert_or_assign.md @@ -59,27 +59,27 @@ iterator ## 適格要件 -- (1)、(3)、(4)、(6) : [`is_assignable_v`](/reference/type_traits/is_assignable.md)`` が `true` であること。`value_type` は、`k`, [`forward`](/reference/utility/forward.md)`(obj)` から `map` に直接構築可能であること -- (2)、(5) : [`is_assignable_v`](/reference/type_traits/is_assignable.md)`` が `true` であること。`value_type` は、[`move`](/reference/utility/move.md)`(k)`, [`forward`](/reference/utility/forward.md)`(obj)` から `map` に直接構築可能であること +- (1), (3), (4), (6) : [`is_assignable_v`](/reference/type_traits/is_assignable.md)`` が `true` であること。`value_type` は、`k`, [`forward`](/reference/utility/forward.md)`(obj)` から `map` に直接構築可能であること +- (2), (5) : [`is_assignable_v`](/reference/type_traits/is_assignable.md)`` が `true` であること。`value_type` は、[`move`](/reference/utility/move.md)`(k)`, [`forward`](/reference/utility/forward.md)`(obj)` から `map` に直接構築可能であること ## 効果 -- (1)、(3)、(4)、(6) : `unordered_map` が `k` と同値のキーを持つ要素 `e` を持っている場合、`e.second` に [`forward`](/reference/utility/forward.md)`(obj)` を代入する。そうでなければ、`k`, [`forward`](/reference/utility/forward.md)`(obj)` から構築した `value_type` 型のオブジェクトを挿入する。 -- (2)、(5) : `unordered_map` が `k` と同値のキーを持つ要素 `e` を持っている場合、`e.second` に [`forward`](/reference/utility/forward.md)`(obj)` を代入する。そうでなければ、[`move`](/reference/utility/move.md)`(k)`, [`forward`](/reference/utility/forward.md)`(obj)` から構築した `value_type` 型のオブジェクトを挿入する。 +- (1), (3), (4), (6) : `unordered_map` が `k` と同値のキーを持つ要素 `e` を持っている場合、`e.second` に [`forward`](/reference/utility/forward.md)`(obj)` を代入する。そうでなければ、`k`, [`forward`](/reference/utility/forward.md)`(obj)` から構築した `value_type` 型のオブジェクトを挿入する。 +- (2), (5) : `unordered_map` が `k` と同値のキーを持つ要素 `e` を持っている場合、`e.second` に [`forward`](/reference/utility/forward.md)`(obj)` を代入する。そうでなければ、[`move`](/reference/utility/move.md)`(k)`, [`forward`](/reference/utility/forward.md)`(obj)` から構築した `value_type` 型のオブジェクトを挿入する。 ## 戻り値 -- (1)、(2)、(3) : イテレータと `bool` 値の [`pair`](/reference/utility/pair.md) を返す。 +- (1), (2), (3) : イテレータと `bool` 値の [`pair`](/reference/utility/pair.md) を返す。 - 挿入された場合には、`first` に挿入された要素へのイテレータ、`second` に `true` が設定される。 - 代入された場合には、`first` に代入された要素へのイテレータ、`second` に `false` が設定される。 -- (4)、(5)、(6) : +- (4), (5), (6) : - 挿入された場合には、挿入された要素へのイテレータを返す。 - 代入された場合には、代入された要素へのイテレータを返す。 ## 計算量 -- (1)、(2)、(3) : [`emplace`](emplace.md) と同じ。 -- (4)、(5)、(6) : [`emplace_hint`](emplace_hint.md) と同じ。 +- (1), (2), (3) : [`emplace`](emplace.md) と同じ。 +- (4), (5), (6) : [`emplace_hint`](emplace_hint.md) と同じ。 ## 備考 diff --git a/reference/unordered_map/unordered_map/op_constructor.md b/reference/unordered_map/unordered_map/op_constructor.md index 34b0d996e0..52717ff235 100644 --- a/reference/unordered_map/unordered_map/op_constructor.md +++ b/reference/unordered_map/unordered_map/op_constructor.md @@ -102,7 +102,7 @@ unordered_map(std::from_range_t, R&& rg, - (3) の形式の場合、`value_type` は `*first` からこの `unordered_map` に EmplaceConstructible であること。 -- (4)、(7)、および (9) の形式の場合、`value_type` はこの `unordered_map` に CopyInsertable であること。 +- (4), (7)、および (9) の形式の場合、`value_type` はこの `unordered_map` に CopyInsertable であること。 - (5) の形式の場合、`allocator_type` のムーブ構築は例外終了しないこと。 @@ -242,7 +242,7 @@ unordered_map(std::from_range_t, R&& rg, - [Visual C++](/implementation.md#visual_cpp): ? #### 備考 -libstdc++ には 4.8.2 現在、(6)、(7)、(8)の形式はない。 +libstdc++ には 4.8.2 現在、(6), (7), (8)の形式はない。 ## 関連項目 @@ -259,6 +259,6 @@ libstdc++ には 4.8.2 現在、(6)、(7)、(8)の形式はない。 - [LWG 2193. Default constructors for standard library containers are explicit](http://cplusplus.github.io/LWG/lwg-defects.html#2193) (1) + (2) を 2 つのオーバーロードに分割するきっかけとなったレポート - [LWG 2210. Missing allocator-extended constructor for allocator-aware containers](http://cplusplus.github.io/LWG/lwg-defects.html#2210) - (10)、(11)、(12)、(13)、(14)、(15) を追加するきっかけとなったレポート + (10), (11), (12), (13), (14), (15) を追加するきっかけとなったレポート なお、Discussion の例はアロケータの型が誤っているので注意 diff --git a/reference/unordered_map/unordered_map/try_emplace.md b/reference/unordered_map/unordered_map/try_emplace.md index b4a3ccbd21..8ad001b14e 100644 --- a/reference/unordered_map/unordered_map/try_emplace.md +++ b/reference/unordered_map/unordered_map/try_emplace.md @@ -56,9 +56,9 @@ iterator ## テンプレートパラメータ制約 -- (1)、(3)、(4)、(6) : `value_type` は、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(k)`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から `unordered_map` に直接構築可能であること -- (2)、(5) : `value_type` は、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`move`](/reference/utility/move.md)`(k))`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から `unordered_map` に直接構築可能であること -- (3)、(6) : +- (1), (3), (4), (6) : `value_type` は、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(k)`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から `unordered_map` に直接構築可能であること +- (2), (5) : `value_type` は、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`move`](/reference/utility/move.md)`(k))`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から `unordered_map` に直接構築可能であること +- (3), (6) : - `key_compare::is_transparent` が妥当な式であること - [`is_convertible_v`](/reference/type_traits/is_convertible.md)` == false`であること - [`is_convertible_v`](/reference/type_traits/is_convertible.md)` == false`であること @@ -67,22 +67,22 @@ iterator ## 効果 -- (1)、(3)、(4)、(6) : `unordered_map` が `k` と同値のキーを持つ要素を持っている場合、何もしない(引数への副作用もない)。そうでなければ、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(k)`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から構築した `value_type` 型のオブジェクトを挿入する。 -- (2)、(5) : `unordered_map` が `k` と同値のキーを持つ要素を持っている場合、何もしない(引数への副作用もない)。そうでなければ、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`move`](/reference/utility/move.md)`(k))`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から構築した `value_type` 型のオブジェクトを挿入する。 +- (1), (3), (4), (6) : `unordered_map` が `k` と同値のキーを持つ要素を持っている場合、何もしない(引数への副作用もない)。そうでなければ、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(k)`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から構築した `value_type` 型のオブジェクトを挿入する。 +- (2), (5) : `unordered_map` が `k` と同値のキーを持つ要素を持っている場合、何もしない(引数への副作用もない)。そうでなければ、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`move`](/reference/utility/move.md)`(k))`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`(args)...)` から構築した `value_type` 型のオブジェクトを挿入する。 ## 戻り値 -- (1)、(2)、(3) : イテレータと `bool` 値の [`pair`](/reference/utility/pair.md) を返す。 +- (1), (2), (3) : イテレータと `bool` 値の [`pair`](/reference/utility/pair.md) を返す。 - 挿入された場合には、`first` に挿入された要素へのイテレータ、`second` に `true` が設定される。 - 挿入されなかった場合には、`first` に `k` と等価のキーを持つ既存の要素へのイテレータ、`second` に `false` が設定される。 -- (4)、(5)、(6) : +- (4), (5), (6) : - 挿入された場合には、挿入された要素へのイテレータを返す。 - 挿入されなかった場合には、`k` と等価のキーを持つ既存の要素へのイテレータを返す。 ## 計算量 -- (1)、(2) : [`emplace`](emplace.md) と同じ。 -- (4)、(5) : [`emplace_hint`](emplace_hint.md) と同じ。 +- (1), (2) : [`emplace`](emplace.md) と同じ。 +- (4), (5) : [`emplace_hint`](emplace_hint.md) と同じ。 ## 備考 diff --git a/reference/unordered_map/unordered_multimap/equal_range.md b/reference/unordered_map/unordered_multimap/equal_range.md index 533f2f3a7b..a9bdc81801 100644 --- a/reference/unordered_map/unordered_multimap/equal_range.md +++ b/reference/unordered_map/unordered_multimap/equal_range.md @@ -30,7 +30,7 @@ pair - (3) : 非`const`な`this`に対してキー`k`を透過的に検索し、合致する全ての要素を含む範囲を取得する - (4) : `const`な`this`に対してキー`k`を透過的に検索し、合致する全ての要素を含む範囲を取得する -(3)、(4)の透過的な検索は、`Pred::is_transparent`および`Hash::is_transparent`が定義される場合に有効になる機能であり、例として`unordered_multimap m;`に対して`m.equal_range("key");`のように`string`型のキーを持つ連想コンテナの検索インタフェースに文字列リテラルを渡した際、`string`の一時オブジェクトが作られないようにできる。詳細は[`std::hash`](/reference/functional/hash.md)クラスのページを参照。 +(3), (4)の透過的な検索は、`Pred::is_transparent`および`Hash::is_transparent`が定義される場合に有効になる機能であり、例として`unordered_multimap m;`に対して`m.equal_range("key");`のように`string`型のキーを持つ連想コンテナの検索インタフェースに文字列リテラルを渡した際、`string`の一時オブジェクトが作られないようにできる。詳細は[`std::hash`](/reference/functional/hash.md)クラスのページを参照。 ## パラメータ diff --git a/reference/unordered_map/unordered_multimap/find.md b/reference/unordered_map/unordered_multimap/find.md index d31985692e..219cf82262 100644 --- a/reference/unordered_map/unordered_multimap/find.md +++ b/reference/unordered_map/unordered_multimap/find.md @@ -23,7 +23,7 @@ template const_iterator find(const K& k) const; // (4) C++20 - (3) : 非`const`な`*this`オブジェクトに対する透過的な検索 - (4) : `const`な`*this`オブジェクトに対する透過的な検索 -(3)、(4)の透過的な検索は、`Pred::is_transparent`および`Hash::is_transparent`が定義される場合に有効になる機能であり、例として`unordered_multimap m;`に対して`m.find("key");`のように`string`型のキーを持つ連想コンテナの検索インタフェースに文字列リテラルを渡した際、`string`の一時オブジェクトが作られないようにできる。詳細は[`std::hash`](/reference/functional/hash.md)クラスのページを参照。 +(3), (4)の透過的な検索は、`Pred::is_transparent`および`Hash::is_transparent`が定義される場合に有効になる機能であり、例として`unordered_multimap m;`に対して`m.find("key");`のように`string`型のキーを持つ連想コンテナの検索インタフェースに文字列リテラルを渡した際、`string`の一時オブジェクトが作られないようにできる。詳細は[`std::hash`](/reference/functional/hash.md)クラスのページを参照。 ## パラメータ diff --git a/reference/unordered_map/unordered_multimap/insert.md b/reference/unordered_map/unordered_multimap/insert.md index 209d4ca8a7..fd2dd08f58 100644 --- a/reference/unordered_map/unordered_multimap/insert.md +++ b/reference/unordered_map/unordered_multimap/insert.md @@ -76,7 +76,7 @@ iterator insert(const_iterator hint, node_type&& nh); // (10) C++17 ## 戻り値 - (1)から(6) : 追加された要素を指すイテレータを返す -- (7)、(8) : なし +- (7), (8) : なし - (9), (10) : `nh` が空の場合は終端イテレータ、そうでなければ挿入された要素を指すイテレータを返す @@ -106,7 +106,7 @@ iterator insert(const_iterator hint, node_type&& nh); // (10) C++17 これは規格の誤りとして C++17 で修正されたが、使用する処理系やそのバージョンによっては以前の「よりも小さい」という条件でしかイテレータの有効性を保証していない可能性があるため、注意が必要である。 - これらの関数が呼ばれた後、たとえ呼び出しの前後でこのコンテナのバケット数([`bucket_count`](bucket_count.md)`()` の戻り値)が変わった(=リハッシュが発生した)場合でも、等価なキーの要素同士の相対的な順序は変わらない。 -- (4)、(5), (6) : +- (4), (5), (6) : - 本関数呼び出しで構築されるオブジェクトを `t` とすると、`t.first` と等価なキーの要素が既に存在する場合、`position` に応じて既存の要素と新規の要素が順序付けられると期待されるが、規格書にそのような規定は存在しない。従って、そのような期待はすべきではない。[`emplace_hint`](emplace_hint.md) も参照。 - 引数 `position` は、C++14 までは間接参照可能(dereferenceable)でなければならない(つまり、[`cend`](cend.md)`()` ではいけない)との記載になっていたが、これは規格の誤りとして C++17 で修正された。 - 上記の要件に示したように、`first`、および、`last` の参照先の要素は `value_type` 型でなければならないとされているが、その要件を満たさなくてももう一つの要件である直接構築可能を満たすだけで十分にライブラリを実装可能と思われる。 diff --git a/reference/unordered_map/unordered_multimap/op_constructor.md b/reference/unordered_map/unordered_multimap/op_constructor.md index 0e44aed119..677cf0816a 100644 --- a/reference/unordered_map/unordered_multimap/op_constructor.md +++ b/reference/unordered_map/unordered_multimap/op_constructor.md @@ -103,7 +103,7 @@ unordered_multimap(std::from_range_t, R&& rg, - (3) の形式の場合、`value_type` は `*first` からこの `unordered_multimap` に EmplaceConstructible であること。 -- (4)、(7)、および (9) の形式の場合、`value_type` はこの `unordered_multimap` に CopyInsertable であること。 +- (4), (7)、および (9) の形式の場合、`value_type` はこの `unordered_multimap` に CopyInsertable であること。 - (5) の形式の場合、`allocator_type` のムーブ構築は例外終了しないこと。 @@ -246,7 +246,7 @@ unordered_multimap(std::from_range_t, R&& rg, - [Visual C++](/implementation.md#visual_cpp): ? #### 備考 -libstdc++ には 4.8.2 現在、(6)、(7)、(8)の形式はない。 +libstdc++ には 4.8.2 現在、(6), (7), (8)の形式はない。 ## 関連項目 @@ -263,6 +263,6 @@ libstdc++ には 4.8.2 現在、(6)、(7)、(8)の形式はない。 - [LWG 2193. Default constructors for standard library containers are explicit](http://cplusplus.github.io/LWG/lwg-defects.html#2193) (1) + (2) を 2 つのオーバーロードに分割するきっかけとなったレポート - [LWG 2210. Missing allocator-extended constructor for allocator-aware containers](http://cplusplus.github.io/LWG/lwg-defects.html#2210) - (10)、(11)、(12)、(13)、(14)、(15) を追加するきっかけとなったレポート + (10), (11), (12), (13), (14), (15) を追加するきっかけとなったレポート なお、Discussion の例はアロケータの型が誤っているので注意 diff --git a/reference/unordered_set/unordered_multiset/equal_range.md b/reference/unordered_set/unordered_multiset/equal_range.md index db8e2b7e98..8c54ff70ec 100644 --- a/reference/unordered_set/unordered_multiset/equal_range.md +++ b/reference/unordered_set/unordered_multiset/equal_range.md @@ -30,7 +30,7 @@ pair - (3) : 非`const`な`this`に対してキー`k`を透過的に検索し、合致する全ての要素を含む範囲を取得する - (4) : `const`な`this`に対してキー`k`を透過的に検索し、合致する全ての要素を含む範囲を取得する -(3)、(4)の透過的な検索は、`Pred::is_transparent`および`Hash::is_transparent`が定義される場合に有効になる機能であり、例として`unordered_multiset s;`に対して`s.equal_range("key");`のように`string`型のキーを持つ連想コンテナの検索インタフェースに文字列リテラルを渡した際、`string`の一時オブジェクトが作られないようにできる。詳細は[`std::hash`](/reference/functional/hash.md)クラスのページを参照。 +(3), (4)の透過的な検索は、`Pred::is_transparent`および`Hash::is_transparent`が定義される場合に有効になる機能であり、例として`unordered_multiset s;`に対して`s.equal_range("key");`のように`string`型のキーを持つ連想コンテナの検索インタフェースに文字列リテラルを渡した際、`string`の一時オブジェクトが作られないようにできる。詳細は[`std::hash`](/reference/functional/hash.md)クラスのページを参照。 ## テンプレートパラメータ制約 diff --git a/reference/unordered_set/unordered_multiset/find.md b/reference/unordered_set/unordered_multiset/find.md index bc0fefa02a..4c3809a4a0 100644 --- a/reference/unordered_set/unordered_multiset/find.md +++ b/reference/unordered_set/unordered_multiset/find.md @@ -23,7 +23,7 @@ template const_iterator find(const K& k) const; // (4) C++20 - (3) : 非`const`な`*this`オブジェクトに対する透過的な検索 - (4) : `const`な`*this`オブジェクトに対する透過的な検索 -(3)、(4)の透過的な検索は、`Pred::is_transparent`および`Hash::is_transparent`が定義される場合に有効になる機能であり、例として`unordered_multiset s;`に対して`s.find("key");`のように`string`型のキーを持つ連想コンテナの検索インタフェースに文字列リテラルを渡した際、`string`の一時オブジェクトが作られないようにできる。詳細は[`std::hash`](/reference/functional/hash.md)クラスのページを参照。 +(3), (4)の透過的な検索は、`Pred::is_transparent`および`Hash::is_transparent`が定義される場合に有効になる機能であり、例として`unordered_multiset s;`に対して`s.find("key");`のように`string`型のキーを持つ連想コンテナの検索インタフェースに文字列リテラルを渡した際、`string`の一時オブジェクトが作られないようにできる。詳細は[`std::hash`](/reference/functional/hash.md)クラスのページを参照。 ## テンプレートパラメータ制約 diff --git a/reference/unordered_set/unordered_multiset/insert.md b/reference/unordered_set/unordered_multiset/insert.md index 918f905b2b..40b564a3f5 100644 --- a/reference/unordered_set/unordered_multiset/insert.md +++ b/reference/unordered_set/unordered_multiset/insert.md @@ -27,12 +27,12 @@ iterator insert(const_iterator hint, node_type&& nh); // (6) C++17 ## 要件 -- `v` を引数にとる形式((1)、(2)の上側)では、`value_type` はコンテナに対してコピー挿入可能(CopyInsertable)でなければならない。 +- `v` を引数にとる形式((1), (2)の上側)では、`value_type` はコンテナに対してコピー挿入可能(CopyInsertable)でなければならない。 コンテナに対してコピー挿入可能とは、`m` をアロケータ型 `allocator_type` の左辺値、`p` を要素型 `value_type` へのポインタとすると、以下の式が適格(well-formed)であるということである。 `std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::`[`construct`](/reference/memory/allocator_traits/construct.md)`(m, p, v);` -- `rv` を引数にとる形式((1)、(2)の下側)では、`value_type` はコンテナに対してムーブ挿入可能(MoveInsertable)でなければならない。 +- `rv` を引数にとる形式((1), (2)の下側)では、`value_type` はコンテナに対してムーブ挿入可能(MoveInsertable)でなければならない。 コンテナに対してムーブ挿入可能とは、`m` をアロケータ型 `allocator_type` の左辺値、`p` を要素型 `value_type` へのポインタとすると、以下の式が適格(well-formed)であるということである。 `std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::`[`construct`](/reference/memory/allocator_traits/construct.md)`(m, p, std::`[`move`](/reference/utility/move.md)`(rv));` diff --git a/reference/unordered_set/unordered_multiset/op_constructor.md b/reference/unordered_set/unordered_multiset/op_constructor.md index 3cbeb1ced5..fe3d5b79b0 100644 --- a/reference/unordered_set/unordered_multiset/op_constructor.md +++ b/reference/unordered_set/unordered_multiset/op_constructor.md @@ -104,7 +104,7 @@ unordered_multiset(std::from_range_t, R&& rg, - (3) の形式の場合、`value_type` は `*first` からこの `unordered_multiset` に EmplaceConstructible であること。 -- (4)、(7)、および (9) の形式の場合、`value_type` はこの `unordered_multiset` に CopyInsertable であること。 +- (4), (7)、および (9) の形式の場合、`value_type` はこの `unordered_multiset` に CopyInsertable であること。 - (5) の形式の場合、`allocator_type` のムーブ構築は例外終了しないこと。 @@ -247,7 +247,7 @@ unordered_multiset(std::from_range_t, R&& rg, - [Visual C++](/implementation.md#visual_cpp): ? #### 備考 -libstdc++ には 4.8.2 現在、(6)、(7)、(8)の形式はない。 +libstdc++ には 4.8.2 現在、(6), (7), (8)の形式はない。 ## 関連項目 @@ -264,6 +264,6 @@ libstdc++ には 4.8.2 現在、(6)、(7)、(8)の形式はない。 - [LWG 2193. Default constructors for standard library containers are explicit](http://cplusplus.github.io/LWG/lwg-defects.html#2193) (1) + (2) を 2 つのオーバーロードに分割するきっかけとなったレポート - [LWG 2210. Missing allocator-extended constructor for allocator-aware containers](http://cplusplus.github.io/LWG/lwg-defects.html#2210) - (10)、(11)、(12)、(13)、(14)、(15) を追加するきっかけとなったレポート + (10), (11), (12), (13), (14), (15) を追加するきっかけとなったレポート なお、Discussion の例はアロケータの型が誤っているので注意 diff --git a/reference/unordered_set/unordered_set/equal_range.md b/reference/unordered_set/unordered_set/equal_range.md index 60c1abf6fc..a49cae0082 100644 --- a/reference/unordered_set/unordered_set/equal_range.md +++ b/reference/unordered_set/unordered_set/equal_range.md @@ -30,7 +30,7 @@ pair - (3) : 非`const`な`this`に対してキー`k`を透過的に検索し、合致する全ての要素を含む範囲を取得する - (4) : `const`な`this`に対してキー`k`を透過的に検索し、合致する全ての要素を含む範囲を取得する -(3)、(4)の透過的な検索は、`Pred::is_transparent`および`Hash::is_transparent`が定義される場合に有効になる機能であり、例として`unordered_set s;`に対して`s.equal_range("key");`のように`string`型のキーを持つ連想コンテナの検索インタフェースに文字列リテラルを渡した際、`string`の一時オブジェクトが作られないようにできる。詳細は[`std::hash`](/reference/functional/hash.md)クラスのページを参照。 +(3), (4)の透過的な検索は、`Pred::is_transparent`および`Hash::is_transparent`が定義される場合に有効になる機能であり、例として`unordered_set s;`に対して`s.equal_range("key");`のように`string`型のキーを持つ連想コンテナの検索インタフェースに文字列リテラルを渡した際、`string`の一時オブジェクトが作られないようにできる。詳細は[`std::hash`](/reference/functional/hash.md)クラスのページを参照。 ## テンプレートパラメータ制約 diff --git a/reference/unordered_set/unordered_set/find.md b/reference/unordered_set/unordered_set/find.md index 51fd19ffc8..50e36f60be 100644 --- a/reference/unordered_set/unordered_set/find.md +++ b/reference/unordered_set/unordered_set/find.md @@ -21,7 +21,7 @@ template const_iterator find(const K& k) const; // (4) C++20 - (3) : 非`const`な`*this`オブジェクトに対する透過的な検索 - (4) : `const`な`*this`オブジェクトに対する透過的な検索 -(3)、(4)の透過的な検索は、`Pred::is_transparent`および`Hash::is_transparent`が定義される場合に有効になる機能であり、例として`unordered_set s;`に対して`s.find("key");`のように`string`型のキーを持つ連想コンテナの検索インタフェースに文字列リテラルを渡した際、`string`の一時オブジェクトが作られないようにできる。詳細は[`std::hash`](/reference/functional/hash.md)クラスのページを参照。 +(3), (4)の透過的な検索は、`Pred::is_transparent`および`Hash::is_transparent`が定義される場合に有効になる機能であり、例として`unordered_set s;`に対して`s.find("key");`のように`string`型のキーを持つ連想コンテナの検索インタフェースに文字列リテラルを渡した際、`string`の一時オブジェクトが作られないようにできる。詳細は[`std::hash`](/reference/functional/hash.md)クラスのページを参照。 ## テンプレートパラメータ制約 diff --git a/reference/unordered_set/unordered_set/insert.md b/reference/unordered_set/unordered_set/insert.md index 6aaa0be138..072f428bb4 100644 --- a/reference/unordered_set/unordered_set/insert.md +++ b/reference/unordered_set/unordered_set/insert.md @@ -68,13 +68,13 @@ iterator ## 適格要件 -- (1)、(4) : `value_type` はコンテナに対してコピー挿入可能(CopyInsertable)でなければならない。 +- (1), (4) : `value_type` はコンテナに対してコピー挿入可能(CopyInsertable)でなければならない。 - コンテナに対してコピー挿入可能とは、`m` をアロケータ型 `allocator_type` の左辺値、`p` を要素型 `value_type` へのポインタとすると、以下の式が適格(well-formed)であるということである。 - `std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::`[`construct`](/reference/memory/allocator_traits/construct.md)`(m, p, v);` -- (2)、(5) : `value_type` はコンテナに対してムーブ挿入可能(MoveInsertable)でなければならない。 +- (2), (5) : `value_type` はコンテナに対してムーブ挿入可能(MoveInsertable)でなければならない。 - コンテナに対してムーブ挿入可能とは、`m` をアロケータ型 `allocator_type` の左辺値、`p` を要素型 `value_type` へのポインタとすると、以下の式が適格(well-formed)であるということである。 - `std::`[`allocator_traits`](/reference/memory/allocator_traits.md)`::`[`construct`](/reference/memory/allocator_traits/construct.md)`(m, p, std::`[`move`](/reference/utility/move.md)`(rv));` -- (4)、(5) : 引数 `position` は、コンテナの有効な読み取り専用イテレータでなければならない。 +- (4), (5) : 引数 `position` は、コンテナの有効な読み取り専用イテレータでなければならない。 - なお、標準では間接参照可能(dereferenceable)である必要があることになっているが、その必要はない(つまり、最終要素の次を指すイテレータでも良い)ものと思われる。 - (7) : 引数 `first`、および、`last`は、入力イテレータの要件を満たし、かつ、イテレータ範囲 `[first, last)` が当該コンテナ**以外を指す**有効な範囲でなければならない。 - また、このコンテナの要素型 `value_type` は、コンテナに対して `*first` から直接構築可能(EmplaceConstructible)でなければならない。 @@ -89,8 +89,8 @@ iterator ## 効果 -- (1)、(2)、(3) : 引数で指定した値と等価なキーがコンテナに存在していなければ、当該要素を追加する。 -- (4)、(5)、(6) : 第1引数で指定した値と等価なキーがコンテナに存在していなければ、当該要素を追加する。 +- (1), (2), (3) : 引数で指定した値と等価なキーがコンテナに存在していなければ、当該要素を追加する。 +- (4), (5), (6) : 第1引数で指定した値と等価なキーがコンテナに存在していなければ、当該要素を追加する。 - 引数 `position` は、要素の挿入位置を探し始める場所のヒントとして使用されるが、実装によって無視されるかもしれない。 - (7) : イテレータ範囲 `[first, last)` のすべての要素 `t` に対して、(1)の形式の `insert(t)` を呼び出した場合と等価である。 - (8) : (7)の形式を `insert(il.begin(), il.end())` として呼び出した場合と等価である。 @@ -100,9 +100,9 @@ iterator ## 戻り値 -- (1)、(2)、(3) : [`pair`](/reference/utility/pair.md) の `bool` 部分(`second` 部)は、要素が追加されたら `true`、追加されなかったら(既にあったら)`false`。 +- (1), (2), (3) : [`pair`](/reference/utility/pair.md) の `bool` 部分(`second` 部)は、要素が追加されたら `true`、追加されなかったら(既にあったら)`false`。 - [`pair`](/reference/utility/pair.md) の `iterator` 部分(`first` 部)は、追加された要素(`bool` 部分が `true` の場合)、あるいは、既にあった要素(`bool` 部分が `false` の場合)を指すイテレータ。 -- (4)、(5)、(6) : 新たな要素が追加された場合、その追加された要素を指すイテレータ。 +- (4), (5), (6) : 新たな要素が追加された場合、その追加された要素を指すイテレータ。 - 新たな要素が追加されなかった場合、既にあった要素を指すイテレータ。 - (7) : なし - (8) : なし @@ -117,8 +117,8 @@ iterator ## 計算量 -- (1)、(2)、(3) : 平均的なケースでは定数(O(1))だが、最悪のケースではコンテナの要素数 [`size`](size.md)`()` に比例(O(N))。 -- (4)、(5)、(6) : 平均的なケースでは定数(O(1))だが、最悪のケースではコンテナの要素数 [`size`](size.md)`()` に比例(O(N))。 +- (1), (2), (3) : 平均的なケースでは定数(O(1))だが、最悪のケースではコンテナの要素数 [`size`](size.md)`()` に比例(O(N))。 +- (4), (5), (6) : 平均的なケースでは定数(O(1))だが、最悪のケースではコンテナの要素数 [`size`](size.md)`()` に比例(O(N))。 - (7) : 平均的なケースでは引数の範囲の要素数 `std::`[`distance`](/reference/iterator/distance.md)`(first, last)` に比例(O(N))するが、最悪のケースでは引数の範囲の要素数 `std::`[`distance`](/reference/iterator/distance.md)`(first, last)` とコンテナの要素数 [`size()`](size.md) に 1 加えたものの積に比例(O(`std::`[`distance`](/reference/iterator/distance.md)`(first, last) * (`[`size`](size.md)`() + 1)`))。 - (8) : (7)の形式を `insert(il.begin(), il.end())` として呼び出した場合と等価。 - (9), (10) : 平均的なケースでは `O(1)`、最悪のケースでは `O(size())`。 @@ -160,7 +160,7 @@ int main() { std::cout << std::boolalpha; - // 一つの要素を挿入((1)、(2)、(3)の形式) + // 一つの要素を挿入((1), (2), (3)の形式) { std::unordered_set us{ 0, 1, 2, 3, 4, 5, }; @@ -171,7 +171,7 @@ int main() print("insert one element", us); } - // 一つの要素を挿入((4)、(5)、(6)の形式) + // 一つの要素を挿入((4), (5), (6)の形式) { std::unordered_set us{ 0, 1, 2, 3, 4, 5, }; @@ -233,7 +233,7 @@ insert initializer_list : 7 8 6 5 4 3 2 1 0 - [Visual C++](/implementation.md#visual_cpp): ? ## 実装例 -(4)、(5)、(7)、(8)の形式は、(1)、(2)の形式を使って実装することができる。 +(4), (5), (7), (8)の形式は、(1), (2)の形式を使って実装することができる。 ```cpp template diff --git a/reference/unordered_set/unordered_set/op_constructor.md b/reference/unordered_set/unordered_set/op_constructor.md index e55faf15ea..28886dd98d 100644 --- a/reference/unordered_set/unordered_set/op_constructor.md +++ b/reference/unordered_set/unordered_set/op_constructor.md @@ -104,7 +104,7 @@ unordered_set(std::from_range_t, R&& rg, - (3) の形式の場合、`value_type` は `*first` からこの `unordered_set` に EmplaceConstructible であること。 -- (4)、(7)、および (9) の形式の場合、`value_type` はこの `unordered_set` に CopyInsertable であること。 +- (4), (7)、および (9) の形式の場合、`value_type` はこの `unordered_set` に CopyInsertable であること。 - (5) の形式の場合、`allocator_type` のムーブ構築は例外終了しないこと。 @@ -247,7 +247,7 @@ unordered_set(std::from_range_t, R&& rg, - [Visual C++](/implementation.md#visual_cpp): ? #### 備考 -libstdc++ には 4.8.2 現在、(6)、(7)、(8)の形式はない。 +libstdc++ には 4.8.2 現在、(6), (7), (8)の形式はない。 ## 関連項目 @@ -264,6 +264,6 @@ libstdc++ には 4.8.2 現在、(6)、(7)、(8)の形式はない。 - [LWG 2193. Default constructors for standard library containers are explicit](http://cplusplus.github.io/LWG/lwg-defects.html#2193) (1) + (2) を 2 つのオーバーロードに分割するきっかけとなったレポート - [LWG 2210. Missing allocator-extended constructor for allocator-aware containers](http://cplusplus.github.io/LWG/lwg-defects.html#2210) - (10)、(11)、(12)、(13)、(14)、(15) を追加するきっかけとなったレポート + (10), (11), (12), (13), (14), (15) を追加するきっかけとなったレポート なお、Discussion の例はアロケータの型が誤っているので注意 From 003bb897a82f0e7946d76abc1da6eb2f3f3e0e03 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 22 May 2025 17:27:34 +0900 Subject: [PATCH 1729/3948] =?UTF-8?q?=E5=85=A8=E4=BD=93:=20=E3=82=AA?= =?UTF-8?q?=E3=83=BC=E3=83=90=E3=83=BC=E3=83=AD=E3=83=BC=E3=83=89=E7=95=AA?= =?UTF-8?q?=E5=8F=B7=E3=81=AE=E5=88=97=E6=8C=99=E3=82=92=E3=80=8C(1),(2)?= =?UTF-8?q?=E3=80=8D=E3=81=AB=E3=81=AA=E3=81=A3=E3=81=A6=E3=81=84=E3=82=8B?= =?UTF-8?q?=E3=82=82=E3=81=AE=E3=81=8B=E3=82=89=E3=80=8C(1),=20(2)?= =?UTF-8?q?=E3=80=8D=E3=81=AE=E5=BD=A2=E5=BC=8F=E3=81=AB=E5=A4=89=E6=9B=B4?= =?UTF-8?q?=20#1451?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://gist.github.com/faithandbrave/40cf4559a6a48578788e860ee55ad08c --- reference/cmath/abs.md | 4 ++-- .../condition_variable/condition_variable_any/wait.md | 2 +- reference/cstdlib/abs.md | 2 +- reference/expected/expected.void/op_constructor.md | 4 ++-- reference/expected/expected/op_constructor.md | 6 +++--- reference/expected/unexpected/op_constructor.md | 2 +- reference/format/format_to.md | 8 ++++---- reference/format/vformat_to.md | 8 ++++---- reference/forward_list/forward_list/splice_after.md | 6 +++--- reference/generator/generator/promise_type/yield_value.md | 2 +- reference/queue/queue/op_constructor.md | 4 ++-- reference/stack/stack/op_constructor.md | 4 ++-- reference/string/basic_string/op_constructor.md | 2 +- 13 files changed, 27 insertions(+), 27 deletions(-) diff --git a/reference/cmath/abs.md b/reference/cmath/abs.md index 8ae5febb3b..52d2b8bda5 100644 --- a/reference/cmath/abs.md +++ b/reference/cmath/abs.md @@ -45,12 +45,12 @@ namespace std { ## 戻り値 引数 `x` の絶対値を返す。 -- (1),(2),(3),(4) : `x` が `±∞` だった場合 `+∞` を返す。 +- (1), (2), (3), (4) : `x` が `±∞` だった場合 `+∞` を返す。 ## 備考 - $$ f(x) = | x | $$ -- 任意の整数型に対するオーバーロード(5)は C++11 で追加されたが、[一部の符号なし整数型に対して問題を引き起こす](http://wg21.cmeerw.net/lwg/issue2192)ことから C++17 で削除され、符号付き整数型に対するオーバーロード(6),(7),(8)が追加された +- 任意の整数型に対するオーバーロード(5)は C++11 で追加されたが、[一部の符号なし整数型に対して問題を引き起こす](http://wg21.cmeerw.net/lwg/issue2192)ことから C++17 で削除され、符号付き整数型に対するオーバーロード(6), (7), (8)が追加された - C++23では、(1)、(2)、(3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された diff --git a/reference/condition_variable/condition_variable_any/wait.md b/reference/condition_variable/condition_variable_any/wait.md index 3694af8c13..32a3965798 100644 --- a/reference/condition_variable/condition_variable_any/wait.md +++ b/reference/condition_variable/condition_variable_any/wait.md @@ -65,7 +65,7 @@ return pred(); ## 戻り値 -- (1),(2) : なし +- (1), (2) : なし - (3) : 停止要求の有無によらず、`pred()`の結果が返る。 diff --git a/reference/cstdlib/abs.md b/reference/cstdlib/abs.md index ad61f0b6aa..a9bbede8c1 100644 --- a/reference/cstdlib/abs.md +++ b/reference/cstdlib/abs.md @@ -59,7 +59,7 @@ namespace std { ## 戻り値 引数 `j` の絶対値を返す。 -- (4),(5),(6),(7) : `j` が `±∞` だった場合 `+∞` を返す。 +- (4), (5), (6), (7) : `j` が `±∞` だった場合 `+∞` を返す。 ## 備考 diff --git a/reference/expected/expected.void/op_constructor.md b/reference/expected/expected.void/op_constructor.md index 84266a1934..494caea13c 100644 --- a/reference/expected/expected.void/op_constructor.md +++ b/reference/expected/expected.void/op_constructor.md @@ -198,7 +198,7 @@ int main() // ムーブ後のstd::unique_ptr型はnullptrが保証される } - // (6),(7) エラー値の変換コピー/ムーブ構築 + // (6), (7) エラー値の変換コピー/ムーブ構築 { std::unexpected src1{std::in_place, 1, 2}; std::expected dst1 = src1; @@ -217,7 +217,7 @@ int main() assert(x1.has_value()); } - // (9),(10) 引数リストからエラー値を直接構築 + // (9), (10) 引数リストからエラー値を直接構築 { std::expected x1{std::unexpect, "C++", 1}; assert(not x1.has_value()); diff --git a/reference/expected/expected/op_constructor.md b/reference/expected/expected/op_constructor.md index 43c739071f..96418b457f 100644 --- a/reference/expected/expected/op_constructor.md +++ b/reference/expected/expected/op_constructor.md @@ -255,7 +255,7 @@ int main() assert(*dst2.value() == 42); } - // (7),(8) エラー値の変換コピー/ムーブ構築 + // (7), (8) エラー値の変換コピー/ムーブ構築 { std::unexpected src1{std::in_place, 1, 2}; std::expected dst1 = src1; @@ -268,7 +268,7 @@ int main() assert(*dst2.error() == 42); } - // (9),(10) 引数リストから正常値を直接構築 + // (9), (10) 引数リストから正常値を直接構築 { std::expected x1{std::in_place, "C++", 1}; assert(x1.has_value()); @@ -281,7 +281,7 @@ int main() assert((x2.value().seq == std::vector{5, 6, 7, 8})); } - // (11),(12) 引数リストからエラー値を直接構築 + // (11), (12) 引数リストからエラー値を直接構築 { std::expected x1{std::unexpect, "Hello!", 4}; assert(not x1.has_value()); diff --git a/reference/expected/unexpected/op_constructor.md b/reference/expected/unexpected/op_constructor.md index 02406bb5d0..1b8373301a 100644 --- a/reference/expected/unexpected/op_constructor.md +++ b/reference/expected/unexpected/op_constructor.md @@ -109,7 +109,7 @@ int main() // ムーブ後のstd::unique_ptr型はnullptrが保証される } - // (4),(5) 引数リストから直接構築 + // (4), (5) 引数リストから直接構築 { std::unexpected x1{std::in_place, "C++", 1}; assert(x1.error().data == "C"); diff --git a/reference/format/format_to.md b/reference/format/format_to.md index 03cc3bc5c8..2cd9f2489f 100644 --- a/reference/format/format_to.md +++ b/reference/format/format_to.md @@ -51,15 +51,15 @@ format_to(back_inserter(buffer), "The answer is {}.", 42); `Out`は以下の制約を満たす。 -* (1),(3): [`output_iterator`](/reference/iterator/output_iterator.md)`` -* (2),(4): [`output_iterator`](/reference/iterator/output_iterator.md)`` +* (1), (3): [`output_iterator`](/reference/iterator/output_iterator.md)`` +* (2), (4): [`output_iterator`](/reference/iterator/output_iterator.md)`` ## 事前条件 `Out`は以下のコンセプトのモデルである。 -* (1),(3): [`output_iterator`](/reference/iterator/output_iterator.md)`` -* (2),(4): [`output_iterator`](/reference/iterator/output_iterator.md)`` +* (1), (3): [`output_iterator`](/reference/iterator/output_iterator.md)`` +* (2), (4): [`output_iterator`](/reference/iterator/output_iterator.md)`` ## 効果 diff --git a/reference/format/vformat_to.md b/reference/format/vformat_to.md index dd565dd0d5..e14207425f 100644 --- a/reference/format/vformat_to.md +++ b/reference/format/vformat_to.md @@ -42,15 +42,15 @@ namespace std { `Out`は以下の制約を満たす。 -* (1),(3): `OutputIterator` -* (2),(4): `OutputIterator` +* (1), (3): `OutputIterator` +* (2), (4): `OutputIterator` ## 事前条件 `out`は以下の制約を満たす型の有効なオブジェクトである。 -* (1),(3): `OutputIterator` -* (2),(4): `OutputIterator` +* (1), (3): `OutputIterator` +* (2), (4): `OutputIterator` ## 効果 diff --git a/reference/forward_list/forward_list/splice_after.md b/reference/forward_list/forward_list/splice_after.md index ecb33dfab2..20677d81e0 100644 --- a/reference/forward_list/forward_list/splice_after.md +++ b/reference/forward_list/forward_list/splice_after.md @@ -35,9 +35,9 @@ void splice_after(const_iterator position, forward_list&& x, ## 効果 -- (1),(2) : `position`の指す要素の後ろに、`x`の全ての要素を移動する -- (3),(4) : `position`の指す要素の後ろに、`x`の要素のうち`i`の次の要素を移動する -- (5),(6) : `position`の指す要素の後ろに、`x`の要素のうち`(first, last)`の範囲を移動する +- (1), (2) : `position`の指す要素の後ろに、`x`の全ての要素を移動する +- (3), (4) : `position`の指す要素の後ろに、`x`の要素のうち`i`の次の要素を移動する +- (5), (6) : `position`の指す要素の後ろに、`x`の要素のうち`(first, last)`の範囲を移動する ## 戻り値 diff --git a/reference/generator/generator/promise_type/yield_value.md b/reference/generator/generator/promise_type/yield_value.md index 51bcb800fe..ca95b2820a 100644 --- a/reference/generator/generator/promise_type/yield_value.md +++ b/reference/generator/generator/promise_type/yield_value.md @@ -90,7 +90,7 @@ return yield_value(ranges::elements_of(nested( ## 例外 -- (1),(3),(4) : 投げない。 +- (1), (3), (4) : 投げない。 - (2) : 格納されるオブジェクトの初期化によって送出された例外。 diff --git a/reference/queue/queue/op_constructor.md b/reference/queue/queue/op_constructor.md index 0dfe840c68..4596320db1 100644 --- a/reference/queue/queue/op_constructor.md +++ b/reference/queue/queue/op_constructor.md @@ -6,11 +6,11 @@ ```cpp // C++03まで -explicit queue(const Container& other = Container()); // (1),(2) +explicit queue(const Container& other = Container()); // (1), (2) // C++11以降 C++17まで explicit queue(const Container& other); // (2) -explicit queue(Container&& other = Container()); // (1),(3) +explicit queue(Container&& other = Container()); // (1), (3) // C++20以降 queue() : queue(Container()) {} // (1) diff --git a/reference/stack/stack/op_constructor.md b/reference/stack/stack/op_constructor.md index 14b0c8d2f2..f173b91cad 100644 --- a/reference/stack/stack/op_constructor.md +++ b/reference/stack/stack/op_constructor.md @@ -6,11 +6,11 @@ ```cpp // C++03まで -explicit stack(const Container& cont = Container()); // (1),(2) +explicit stack(const Container& cont = Container()); // (1), (2) // C++11以降 C++17まで explicit stack(const Container& cont); // (2) -explicit stack(Container&& cont = Container()); // (1),(3) +explicit stack(Container&& cont = Container()); // (1), (3) // C++20以降 stack() : stack(Container()) {} // (1) diff --git a/reference/string/basic_string/op_constructor.md b/reference/string/basic_string/op_constructor.md index 5bf5008240..b0a95566dd 100644 --- a/reference/string/basic_string/op_constructor.md +++ b/reference/string/basic_string/op_constructor.md @@ -268,4 +268,4 @@ s14 : Hello - [P2166R1 A Proposal to Prohibit std::basic_string and std::basic_string_view construction from nullptr.](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2166r1.html) - C++23での(16)`nullptr_t`をとるコンストラクタのdelete宣言追加 - [P2438R2 `std::string::substr() &&`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2438r2.html) - - C++23での(17),(18)`basic_string&&`と範囲指定をとるコンストラクタ追加 + - C++23での(17), (18)`basic_string&&`と範囲指定をとるコンストラクタ追加 From 0436b335fec184162762daa2bb35df8becfe269c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 22 May 2025 21:22:45 +0900 Subject: [PATCH 1730/3948] =?UTF-8?q?basic=5Fstring::compare=20:=20?= =?UTF-8?q?=E3=82=AA=E3=83=BC=E3=83=90=E3=83=BC=E3=83=AD=E3=83=BC=E3=83=89?= =?UTF-8?q?=E3=81=AE=E5=8C=BA=E5=88=87=E3=82=8A=E3=82=92=E8=A6=8B=E7=9B=B4?= =?UTF-8?q?=E3=81=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/string/basic_string/compare.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/reference/string/basic_string/compare.md b/reference/string/basic_string/compare.md index dc9ef61c3b..9bb3b821f4 100644 --- a/reference/string/basic_string/compare.md +++ b/reference/string/basic_string/compare.md @@ -101,17 +101,17 @@ constexpr int ## テンプレートパラメータ制約 -- (7)(8)(9) : 以下の両方を満たしていること +- (7), (8), (9) : 以下の両方を満たしていること - [`is_convertible_v`](/reference/type_traits/is_convertible.md)`> == true` - [`is_convertible_v`](/reference/type_traits/is_convertible.md)` == false` ## 効果 -- (1) 自身の文字列長とパラメータ`str`の文字列長のうち、小さい長さを`rlen`とし、[`traits::compare`](/reference/string/char_traits/compare.md)`(`[`data()`](data.md)`, str.`[`data()`](data.md)`, rlen)`を呼び出す。 -- (7) 自身の文字列長とパラメータ`sv`の文字列長のうち、小さい長さを`rlen`とし、[`traits::compare`](/reference/string/char_traits/compare.md)`(`[`data()`](data.md)`, sv.`[`data()`](/reference/string_view/basic_string_view/data.md)`, rlen)`を呼び出す。 +- (1) : 自身の文字列長とパラメータ`str`の文字列長のうち、小さい長さを`rlen`とし、[`traits::compare`](/reference/string/char_traits/compare.md)`(`[`data()`](data.md)`, str.`[`data()`](data.md)`, rlen)`を呼び出す。 +- (7) : 自身の文字列長とパラメータ`sv`の文字列長のうち、小さい長さを`rlen`とし、[`traits::compare`](/reference/string/char_traits/compare.md)`(`[`data()`](data.md)`, sv.`[`data()`](/reference/string_view/basic_string_view/data.md)`, rlen)`を呼び出す。 ## 戻り値 -- (1) 比較結果が非`0`を返した場合は、比較結果をそのまま返す。そうでなければ、以下の条件に従って戻り値を返す: +- (1) : 比較結果が非`0`を返した場合は、比較結果をそのまま返す。そうでなければ、以下の条件に従って戻り値を返す: | 条件 | 戻り値 | |--------------------------------------------------------|-----------------------| @@ -119,14 +119,14 @@ constexpr int | [`size()`](size.md) `==` `str.`[`size()`](size.md) | `0`を返す | | [`size()`](size.md) `>` `str.`[`size()`](size.md) | `0`より大きい値を返す | -- (2) `basic_string(*this, pos1, n1).compare(str)` と等価 -- (3) `basic_string(*this, pos1, n1).compare(basic_string(str, pos2, n2))` と等価 -- (4) `compare(basic_string(s))` と等価 -- (5) `basic_string(*this, pos, n1).compare(basic_string(s))` と等価 -- (6) `basic_string(*this, pos, n1).compare(basic_string(s, n2))` と等価 -- (7) (1)と同様の結果を返す。`return basic_string_view(*this).`[`compare`](/reference/string_view/basic_string_view/compare.md)`(t);`と等価。 -- (8) `basic_string_view(*this).`[`substr`](/reference/string_view/basic_string_view/substr.md)`(pos1, n1).`[`compare`](/reference/string_view/basic_string_view/compare.md)`(t)` と等価 -- (9) 以下と等価。 +- (2) : `basic_string(*this, pos1, n1).compare(str)` と等価 +- (3) : `basic_string(*this, pos1, n1).compare(basic_string(str, pos2, n2))` と等価 +- (4) : `compare(basic_string(s))` と等価 +- (5) : `basic_string(*this, pos, n1).compare(basic_string(s))` と等価 +- (6) : `basic_string(*this, pos, n1).compare(basic_string(s, n2))` と等価 +- (7) : (1)と同様の結果を返す。`return basic_string_view(*this).`[`compare`](/reference/string_view/basic_string_view/compare.md)`(t);`と等価。 +- (8) : `basic_string_view(*this).`[`substr`](/reference/string_view/basic_string_view/substr.md)`(pos1, n1).`[`compare`](/reference/string_view/basic_string_view/compare.md)`(t)` と等価 +- (9) : 以下と等価。 ```cpp basic_string_view s = *this, sv = t; return s.substr(pos1, n1).compare(sv.substr(pos2, n2)); From 096b6d811e1439f945d84466e9d874609b2617d1 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 22 May 2025 21:25:02 +0900 Subject: [PATCH 1731/3948] =?UTF-8?q?=E5=85=A8=E4=BD=93=20:=20=E3=80=8C(1)?= =?UTF-8?q?=E3=80=9C(4)=E3=80=8D=20(=E6=B3=A2=E3=83=80=E3=83=83=E3=82=B7?= =?UTF-8?q?=E3=83=A5)=E3=80=81=E3=80=8C(1)=EF=BD=9E(4)=E3=80=8D=20(?= =?UTF-8?q?=E5=85=A8=E8=A7=92=E3=83=81=E3=83=AB=E3=83=80)=20=E3=82=92?= =?UTF-8?q?=E3=80=8C(1)-(4)=E3=80=8D=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/search.md | 2 +- reference/charconv/from_chars.md | 4 ++-- reference/memory/uses_allocator_construction_args.md | 4 ++-- reference/ostream/basic_ostream/op_ostream_free.md | 12 ++++++------ .../regex/regex_token_iterator/op_constructor.md | 12 ++++++------ .../syncstream/basic_osyncstream/op_constructor.md | 4 ++-- reference/tuple/tuple/get.md | 4 ++-- reference/utility/pair/get.md | 4 ++-- 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/reference/algorithm/search.md b/reference/algorithm/search.md index ab73e10148..a131fca3f3 100644 --- a/reference/algorithm/search.md +++ b/reference/algorithm/search.md @@ -97,7 +97,7 @@ namespace std { ## 備考 -- (1)〜(4) : `search()` と [`find_end()`](find_end.md) は共にサブシーケンスを検索する関数だが、以下の点が異なる。 +- (1)-(4) : `search()` と [`find_end()`](find_end.md) は共にサブシーケンスを検索する関数だが、以下の点が異なる。 - `search()` は見つかった最初のサブシーケンスを返すが [`find_end()`](find_end.md) は見つかった最後のサブシーケンスを返す - `[first2,last2)` が空であるときに `search()` は `first1` を返すが、[`find_end()`](find_end.md) は `last1` を返す - (5) : `Searcher`は[`std::copy_constructible`](/reference/concepts/copy_constructible.md)要件を満たす必要はない diff --git a/reference/charconv/from_chars.md b/reference/charconv/from_chars.md index f0581a3f3d..03215c68ac 100644 --- a/reference/charconv/from_chars.md +++ b/reference/charconv/from_chars.md @@ -62,7 +62,7 @@ C++標準はこれら関数の実装の詳細について何も規定しない ## 要件 - 全て : 入力イテレータ範囲`[first, last)`は有効な範囲であること(charのオブジェクトが構築済みであり、連続していること)。 - (1) : `base`は2~36までの値であること。 -- (2)~(4) : `fmt`は[`chars_format`](../charconv/chars_format.md)の列挙値のうちの一つであること。 +- (2)-(4) : `fmt`は[`chars_format`](../charconv/chars_format.md)の列挙値のうちの一つであること。 ## 引数 - `first` -- 入力文字列の先頭ポインタ。 @@ -80,7 +80,7 @@ C++標準はこれら関数の実装の詳細について何も規定しない nを基数としたCロケールによる`strtol`で変換する際と同様のパターンを用いる。 ただし、`value`の型が符号付である場合にのみ`-`は考慮され、`+`や16進数の`0x`等の他の記号は考慮されない。 -- (2)~(5) : 浮動小数点数字列を浮動小数点数へ変換する。 +- (2)-(5) : 浮動小数点数字列を浮動小数点数へ変換する。 Cロケールによる`strtod`で変換する際と同様のパターンを用いる。ただし、以下の違いがある。 数字の先頭の符号は`-`のみが考慮され、`+`等は考慮されない。 また、`fmt`に`chars_format::general`が設定されておらず(`scientific`と`fixed`が同時に設定されておらず) diff --git a/reference/memory/uses_allocator_construction_args.md b/reference/memory/uses_allocator_construction_args.md index 3fbbeec455..133a4af454 100644 --- a/reference/memory/uses_allocator_construction_args.md +++ b/reference/memory/uses_allocator_construction_args.md @@ -35,7 +35,7 @@ template ## テンプレートパラメータ制約 - (1) : `T` が [`pair`](../utility/pair.md) の特殊化**ではない**場合のみオーバーロード解決に参加する -- (2)~(6) : `T` が [`pair`](../utility/pair.md) の特殊化**である**場合のみオーバーロード解決に参加する +- (2)-(6) : `T` が [`pair`](../utility/pair.md) の特殊化**である**場合のみオーバーロード解決に参加する ## 戻り値 @@ -141,7 +141,7 @@ uses_allocator_construction_args(alloc, piecewise_construct, ただし、実際には構築まで実施する [`make_obj_using_allocator`](make_obj_using_allocator.md) や [`uninitialized_construct_using_allocator`](uninitialized_construct_using_allocator.md) が存在するため、これらの関数を直接呼び出す機会はあまり多くはないだろう。 - 上記 (1) を見ればわかる通り、uses-allocator 構築は、その名前に反して必ずしもアロケータオブジェクトを使うとは限らないので注意。 ([`uses_allocator_v`](uses_allocator.md)`` が `false` の場合、アロケータオブジェクト `alloc` は無視される) -- 上記 (2)~(6) を見ればわかる通り、`T` が [`pair`](../utility/pair.md) の場合には再帰的に `uses_allocator_construction_args` を呼び出しているため、ネストした [`pair`](../utility/pair.md) に対しても正しく uses-allocator 構築をサポートできる。 +- 上記 (2)-(6) を見ればわかる通り、`T` が [`pair`](../utility/pair.md) の場合には再帰的に `uses_allocator_construction_args` を呼び出しているため、ネストした [`pair`](../utility/pair.md) に対しても正しく uses-allocator 構築をサポートできる。 ## 例 diff --git a/reference/ostream/basic_ostream/op_ostream_free.md b/reference/ostream/basic_ostream/op_ostream_free.md index 45e9ac08ce..f655a5dad4 100644 --- a/reference/ostream/basic_ostream/op_ostream_free.md +++ b/reference/ostream/basic_ostream/op_ostream_free.md @@ -74,17 +74,17 @@ namespace std { ## 効果 -### (1)~(5) 文字の書式化出力 +### (1)-(5) 文字の書式化出力 文字 `c` を出力ストリーム `os` に出力する。この際、`os` に設定されている幅、埋め文字、および、整列方向に従う。 なお、(2) の形式(`os` の文字型(`char_type`)が `char` 以外で `c` が `char` )の時は、`c` を直接出力するのではなく、`os.`[`widen`](../../ios/basic_ios/widen.md)`(c)` を出力する。 出力後、幅指定は `0` にリセットされる。 -### (6)~(12) 文字の書式化出力 (C++20) +### (6)-(12) 文字の書式化出力 (C++20) これらの関数は削除されている -### (13)~(17) 文字列の書式化出力 +### (13)-(17) 文字列の書式化出力 ヌル終端文字列 `s` を出力ストリーム `os` に出力する。この際、`os` に設定されている幅、埋め文字、および、整列方向に従う。 出力する文字列の長さは以下で求める。 @@ -96,7 +96,7 @@ namespace std { なお、(14) の形式(`os` の文字型(`char_type`)が `char` 以外で `s` が `const char*`)の時は、`s` の各文字 `c` を直接出力するのではなく、`os.`[`widen`](../../ios/basic_ios/widen.md)`(c)` を出力する。 出力後、幅指定は `0` にリセットされる。 -### (18)~(24) 文字列の書式化出力 (C++20) +### (18)-(24) 文字列の書式化出力 (C++20) これらの関数は削除されている @@ -148,7 +148,7 @@ cpprefjp++ cpprefjp++ ``` -### (3)~(5), (15)~(17) の例 +### (3)-(5), (15)-(17) の例 ```cpp example #include #include @@ -227,7 +227,7 @@ int main() これは`char8_t`/`char16_t`/`char32_t`に対するostreamの`operator<<`が提供されないため、他のオーバーロードが選ばれるためにこのような直感に反する挙動が発生する。 -そこで(6)~(12), (18)~(24)のように`delete`指定された`operator<<`を追加することで不適格にし、このような直感的ではない挙動を避ける。 +そこで(6)-(12), (18)-(24)のように`delete`指定された`operator<<`を追加することで不適格にし、このような直感的ではない挙動を避ける。 [機能テストマクロ](/lang/cpp20/feature_test_macros.md)は`__cpp_lib_char8_t`で、値は`201907`。 diff --git a/reference/regex/regex_token_iterator/op_constructor.md b/reference/regex/regex_token_iterator/op_constructor.md index 3f9403e0b2..c6b22ca933 100644 --- a/reference/regex/regex_token_iterator/op_constructor.md +++ b/reference/regex/regex_token_iterator/op_constructor.md @@ -57,12 +57,12 @@ regex_token_iterator(const regex_token_iterator&); ## 効果 - (1) デフォルトコンストラクタ。シーケンス終端イテレータ(シーケンスの終端を示す特別なイテレータ)を構築する。 -- (2)~(5) メンバ変数 `subs` を、引数 `submatch` の 1 要素のみで((2) の形式の場合)、あるいは、引数 `submatches` で((3)~(5) の形式の場合)初期化する。 +- (2)-(5) メンバ変数 `subs` を、引数 `submatch` の 1 要素のみで((2) の形式の場合)、あるいは、引数 `submatches` で((3)-(5) の形式の場合)初期化する。 また、メンバ変数 `N`、`position` をそれぞれ、`0`、[`regex_iterator`](../regex_iterator.md)`(a, b, re, m)` で初期化する。 もし、`position` がシーケンス終端イテレータでなければ、メンバ変数 `result` を現在のマッチ(備考参照)のアドレスに設定する。 そうでなくて、もし、メンバ変数 `subs` が `-1` を含んでいたら、`*this` を範囲 `[a, b)` を指す接尾辞イテレータとして設定する。 そうでなければ、`*this` をシーケンス終端イテレータとして設定する。 -- (6)~(9) deleted コンストラクタであるため、使用するとコンパイルエラーとなる。((2)~(5) の形式の `re` の型を `const regex_type&` から `regex_type&&` に変更したもの) +- (6)-(9) deleted コンストラクタであるため、使用するとコンパイルエラーとなる。((2)-(5) の形式の `re` の型を `const regex_type&` から `regex_type&&` に変更したもの) - (10) コピーコンストラクタ。 @@ -70,8 +70,8 @@ regex_token_iterator(const regex_token_iterator&); - 「現在のマッチ」とは、もし `subs[N]` が -1 の場合には `(*position).`[`prefix`](../match_results/prefix.md)`()`、そうでなければ `(*position).[subs[N]]` の事を指す。 - メンバ変数 `subs`、`N`、`position`、`result` はあくまでも説明用のプライベートメンバ変数であるため、注意すること。 - `regex_token_iterator` は、メンバ変数 `position` を通して指定された正規表現 `re` のコピーではなく、`re` へのポインタをオブジェクト内に保持するため、引数に渡した正規表現オブジェクトは当該イテレータを使用し終わるまで破棄されないようにする必要がある。 - 従って、(2)~(5) の形式のコンストラクタに渡す引数 `re` に一時オブジェクトを指定することはほぼ間違いなくプログラミング上のエラーを意味する。 - (6)~(9) の形式のコンストラクタが C++14 で追加された理由は、この事態をコンパイル時に検出するためである。 + 従って、(2)-(5) の形式のコンストラクタに渡す引数 `re` に一時オブジェクトを指定することはほぼ間違いなくプログラミング上のエラーを意味する。 + (6)-(9) の形式のコンストラクタが C++14 で追加された理由は、この事態をコンパイル時に検出するためである。 しかし、この追加のため、C++11 では適格となりうる以下のようなコードは C++14 ではコンパイルエラーになる。 ```cpp void f(std::sregex_token_iterator&&); @@ -161,5 +161,5 @@ match range = (67, 73), str = 'value3' ### 備考 -- libstdc++ には 5.0.0 rev.218373 現在、(6)~(9) の形式のコンストラクタは存在しない。 -- libc++ には、3.4 までは (6)~(9) の形式のコンストラクタは存在しない。また、3.0 には (4) の形式のコンストラクタも存在しない。 +- libstdc++ には 5.0.0 rev.218373 現在、(6)-(9) の形式のコンストラクタは存在しない。 +- libc++ には、3.4 までは (6)-(9) の形式のコンストラクタは存在しない。また、3.0 には (4) の形式のコンストラクタも存在しない。 diff --git a/reference/syncstream/basic_osyncstream/op_constructor.md b/reference/syncstream/basic_osyncstream/op_constructor.md index bd81a85a2e..95eb9da66a 100644 --- a/reference/syncstream/basic_osyncstream/op_constructor.md +++ b/reference/syncstream/basic_osyncstream/op_constructor.md @@ -21,7 +21,7 @@ basic_osyncstream(basic_osyncstream&& other) noexcept; ``` ## 概要 -- (1)〜(4) : ラップするストリーム、アロケータ(もしあれば)を受け取るコンストラクタ。 +- (1)-(4) : ラップするストリーム、アロケータ(もしあれば)を受け取るコンストラクタ。 - (5) : ムーブコンストラクタ。 @@ -33,7 +33,7 @@ basic_osyncstream(basic_osyncstream&& other) noexcept; ## 事後条件 -- (1)〜(4) : `get_wrapped() == buf`が`true`である。 +- (1)-(4) : `get_wrapped() == buf`が`true`である。 - (5) : `get_wrapped()`によって返される値は、このコンストラクタを呼び出す前に`os.get_wrapped()`によって返される値である。また、`nullptr == other.get_wrapped()`が`true`である。 diff --git a/reference/tuple/tuple/get.md b/reference/tuple/tuple/get.md index 1b47353823..19e33d412a 100644 --- a/reference/tuple/tuple/get.md +++ b/reference/tuple/tuple/get.md @@ -82,7 +82,7 @@ int main() { std::tuple t(1, 'a', "hello"); - // 位置を指定して取得する方法。(1)〜(4) + // 位置を指定して取得する方法。(1)-(4) { int& i = std::get<0>(t); char& c = std::get<1>(t); @@ -94,7 +94,7 @@ int main() } std::cout << std::endl; - // 型を指定して取得する方法。(5)〜(7) + // 型を指定して取得する方法。(5)-(7) { int& i = std::get(t); char& c = std::get(t); diff --git a/reference/utility/pair/get.md b/reference/utility/pair/get.md index bbf59b17ae..4565cc5e6a 100644 --- a/reference/utility/pair/get.md +++ b/reference/utility/pair/get.md @@ -102,7 +102,7 @@ int main() { std::pair p(1, 'a'); - //位置を指定して取得する方法。(1)〜(4) + //位置を指定して取得する方法。(1)-(4) { int& i = std::get<0>(p); char& c = std::get<1>(p); @@ -112,7 +112,7 @@ int main() } std::cout << std::endl; - //型を指定して取得する方法。(5)〜(12) + //型を指定して取得する方法。(5)-(12) { int& i = std::get(p); char& c = std::get(p); From 2f17d2a3d7cede4846c3bd8bf144b013b0622f1b Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 22 May 2025 21:25:45 +0900 Subject: [PATCH 1732/3948] =?UTF-8?q?equal=20:=20=E3=80=8C(1)=20(2)?= =?UTF-8?q?=E3=80=8D=E3=82=92=E3=80=8C(1),=20(2)=E3=80=8D=E3=81=AB?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/equal.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/algorithm/equal.md b/reference/algorithm/equal.md index 513364df01..913ea9a089 100644 --- a/reference/algorithm/equal.md +++ b/reference/algorithm/equal.md @@ -112,7 +112,7 @@ namespace std { ## 備考 -- ランダムアクセスイテレータの範囲を使用する場合、状況によっては(1) (2)のバージョンよりも、(3) (4)を使用する方が効率がよくなることが期待できる。ランダムアクセスイテレータはイテレータ同士の差を定数時間で求められるため、イテレーションを行うことなく2つの範囲の要素数が異なることを検出できるためである +- ランダムアクセスイテレータの範囲を使用する場合、状況によっては(1), (2)のバージョンよりも、(3), (4)を使用する方が効率がよくなることが期待できる。ランダムアクセスイテレータはイテレータ同士の差を定数時間で求められるため、イテレーションを行うことなく2つの範囲の要素数が異なることを検出できるためである ## 例 From 2cca94f9b1f61885178ab97c8b99f68d64f1f538 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 22 May 2025 21:26:16 +0900 Subject: [PATCH 1733/3948] =?UTF-8?q?charconv/to=5Fchars=20:=20=E3=80=8C(6?= =?UTF-8?q?)=EF=BD=9E(13)=E3=80=8D=E3=82=92=E3=80=8C(6)-(13)=E3=80=8D?= =?UTF-8?q?=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/charconv/to_chars.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/charconv/to_chars.md b/reference/charconv/to_chars.md index a337df453c..ed77a9bb0e 100644 --- a/reference/charconv/to_chars.md +++ b/reference/charconv/to_chars.md @@ -119,7 +119,7 @@ C++標準はこれら関数の実装の詳細について何も規定しない ## 要件 - 全て : 出力イテレータ範囲`[first, last)`は有効な範囲であること(charのオブジェクトが構築済みであり、連続していること)。 - (1) : `base`は2~36までの値であること。 -- (6)~(13) : `fmt`は[`chars_format`](../charconv/chars_format.md)の列挙値のうちの一つであること。 +- (6)-(13) : `fmt`は[`chars_format`](../charconv/chars_format.md)の列挙値のうちの一つであること。 ## 引数 - `first` -- 変換結果の文字列を出力する範囲の先頭ポインタ。 From 80bd5f9e7674d7d24afdf983ae8aaeada2c40912 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 22 May 2025 21:29:14 +0900 Subject: [PATCH 1734/3948] =?UTF-8?q?basic=5Fstring=20:=20=E3=82=AA?= =?UTF-8?q?=E3=83=BC=E3=83=90=E3=83=BC=E3=83=AD=E3=83=BC=E3=83=89=E3=81=A8?= =?UTF-8?q?=E8=AA=AC=E6=98=8E=E3=81=AE=E5=8C=BA=E5=88=87=E3=82=8A=E3=82=92?= =?UTF-8?q?=E8=A6=8B=E7=9B=B4=E3=81=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/string/basic_string/find.md | 14 +++++++------- .../string/basic_string/find_first_not_of.md | 16 ++++++++-------- reference/string/basic_string/find_first_of.md | 16 ++++++++-------- .../string/basic_string/find_last_not_of.md | 16 ++++++++-------- reference/string/basic_string/find_last_of.md | 16 ++++++++-------- reference/string/basic_string/rfind.md | 16 ++++++++-------- 6 files changed, 47 insertions(+), 47 deletions(-) diff --git a/reference/string/basic_string/find.md b/reference/string/basic_string/find.md index 8f6ffd1c18..2fd2c4437c 100644 --- a/reference/string/basic_string/find.md +++ b/reference/string/basic_string/find.md @@ -64,11 +64,11 @@ constexpr size_type ## 効果 -- (1) `pos` 以降で最初に `str` と一致する位置を返す。 -- (2) `pos` 以降で最初に `s` と一致する位置を返す。`s` は長さ `n` の文字列へのポインタである。 -- (3) (2) と同様だが、こちらは NULL 終端の文字列を扱う。 -- (4) `pos` 以降で最初に `c` と一致する位置を返す。 -- (5) `basic_string_view sv = t;`として変数`sv`を作成し、`pos` 以降で最初に `sv` と一致する位置を返す。 +- (1) : `pos` 以降で最初に `str` と一致する位置を返す。 +- (2) : `pos` 以降で最初に `s` と一致する位置を返す。`s` は長さ `n` の文字列へのポインタである。 +- (3) : (2) と同様だが、こちらは NULL 終端の文字列を扱う。 +- (4) : `pos` 以降で最初に `c` と一致する位置を返す。 +- (5) : `basic_string_view sv = t;`として変数`sv`を作成し、`pos` 以降で最初に `sv` と一致する位置を返す。 ## 戻り値 @@ -76,8 +76,8 @@ constexpr size_type ## 例外 -- (1) 投げない -- (5) `noexcept`内の式は、以下と等価である +- (1) : 投げない +- (5) : `noexcept`内の式は、以下と等価である ```cpp is_nothrow_convertible_v> ``` diff --git a/reference/string/basic_string/find_first_not_of.md b/reference/string/basic_string/find_first_not_of.md index f3a1df692f..b9f1fe4203 100644 --- a/reference/string/basic_string/find_first_not_of.md +++ b/reference/string/basic_string/find_first_not_of.md @@ -58,15 +58,15 @@ constexpr size_type - [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`false`であること ## 要件 -(3) の形式の場合、`s` は少なくとも `traits_type::length(s) + 1` の要素を持つ `charT` の配列を指していること。 +- (3) の形式の場合、`s` は少なくとも `traits_type::length(s) + 1` の要素を持つ `charT` の配列を指していること。 ## 効果 -- (1) `pos` 以降で最初に `str` 内に存在しない文字の位置を返す。 -- (2) `pos` 以降で最初に `s` 内に存在しない文字の位置を返す。`s` は長さ `n` の文字列へのポインタである。 -- (3) (2) と同様だが、こちらは NULL 終端の文字列を扱う。 -- (4) `pos` 以降で最初に `c` と一致しない文字の位置を返す。 -- (5) `basic_string_view sv = t;`として変数`sv`を作成し、`pos` 以降で最初に `sv` 内に存在しない文字の位置を返す。 +- (1) : `pos` 以降で最初に `str` 内に存在しない文字の位置を返す。 +- (2) : `pos` 以降で最初に `s` 内に存在しない文字の位置を返す。`s` は長さ `n` の文字列へのポインタである。 +- (3) : (2) と同様だが、こちらは NULL 終端の文字列を扱う。 +- (4) : `pos` 以降で最初に `c` と一致しない文字の位置を返す。 +- (5) : `basic_string_view sv = t;`として変数`sv`を作成し、`pos` 以降で最初に `sv` 内に存在しない文字の位置を返す。 ## 戻り値 @@ -74,8 +74,8 @@ constexpr size_type ## 例外 -- (1) 投げない -- (5) `noexcept`内の式は、以下と等価である +- (1) : 投げない +- (5) : `noexcept`内の式は、以下と等価である ```cpp is_nothrow_convertible_v> ``` diff --git a/reference/string/basic_string/find_first_of.md b/reference/string/basic_string/find_first_of.md index 2e1bed6192..2853865ff4 100644 --- a/reference/string/basic_string/find_first_of.md +++ b/reference/string/basic_string/find_first_of.md @@ -57,15 +57,15 @@ constexpr size_type ## 要件 -(3) の形式の場合、`s` は少なくとも `traits_type::length(s) + 1` の要素を持つ `charT` の配列を指していること。 +- (3) の形式の場合、`s` は少なくとも `traits_type::length(s) + 1` の要素を持つ `charT` の配列を指していること。 ## 効果 -- (1) `pos` 以降で最初に `str` 内に存在する文字の位置を返す。 -- (2) `pos` 以降で最初に `s` 内に存在する文字の位置を返す。`s` は長さ `n` の文字列へのポインタである。 -- (3) (2) と同様だが、こちらは NULL 終端の文字列を扱う。 -- (4) `pos` 以降で最初に `c` と一致する文字の位置を返す。 -- (5) `basic_string_view sv = t;`として変数`sv`を作成し、`pos` 以降で最初に `sv` 内に存在する文字の位置を返す。 +- (1) : `pos` 以降で最初に `str` 内に存在する文字の位置を返す。 +- (2) : `pos` 以降で最初に `s` 内に存在する文字の位置を返す。`s` は長さ `n` の文字列へのポインタである。 +- (3) : (2) と同様だが、こちらは NULL 終端の文字列を扱う。 +- (4) : `pos` 以降で最初に `c` と一致する文字の位置を返す。 +- (5) : `basic_string_view sv = t;`として変数`sv`を作成し、`pos` 以降で最初に `sv` 内に存在する文字の位置を返す。 ## 戻り値 @@ -73,8 +73,8 @@ constexpr size_type ## 例外 -- (1) 投げない -- (5) `noexcept`内の式は、以下と等価である +- (1) : 投げない +- (5) : `noexcept`内の式は、以下と等価である ```cpp is_nothrow_convertible_v> ``` diff --git a/reference/string/basic_string/find_last_not_of.md b/reference/string/basic_string/find_last_not_of.md index 4496453a25..6be710f9bf 100644 --- a/reference/string/basic_string/find_last_not_of.md +++ b/reference/string/basic_string/find_last_not_of.md @@ -59,15 +59,15 @@ constexpr size_type ## 要件 -(3) の形式の場合、`s` は少なくとも `traits_type::length(s) + 1` の要素を持つ `charT` の配列を指していること。 +- (3) の形式の場合、`s` は少なくとも `traits_type::length(s) + 1` の要素を持つ `charT` の配列を指していること。 ## 効果 -- (1) `pos` 以前で最後に `str` 内に存在しない文字の位置を返す。 -- (2) `pos` 以前で最後に `s` 内に存在しない文字の位置を返す。`s` は長さ `n` の文字列へのポインタである。 -- (3) (2) と同様だが、こちらは NULL 終端の文字列を扱う。 -- (4) `pos` 以前で最後に `c` と一致しない文字の位置を返す。 -- (5) `basic_string_view sv = t;`として変数`sv`を作成し、`pos` より前で最後に `sv` 内に存在しない文字の位置を返す。 +- (1) : `pos` 以前で最後に `str` 内に存在しない文字の位置を返す。 +- (2) : `pos` 以前で最後に `s` 内に存在しない文字の位置を返す。`s` は長さ `n` の文字列へのポインタである。 +- (3) : (2) と同様だが、こちらは NULL 終端の文字列を扱う。 +- (4) : `pos` 以前で最後に `c` と一致しない文字の位置を返す。 +- (5) : `basic_string_view sv = t;`として変数`sv`を作成し、`pos` より前で最後に `sv` 内に存在しない文字の位置を返す。 ## 戻り値 @@ -75,8 +75,8 @@ constexpr size_type ## 例外 -- (1) 投げない -- (5) `noexcept`内の式は、以下と等価である +- (1) : 投げない +- (5) : `noexcept`内の式は、以下と等価である ```cpp is_nothrow_convertible_v> ``` diff --git a/reference/string/basic_string/find_last_of.md b/reference/string/basic_string/find_last_of.md index 3300f58678..46549478fb 100644 --- a/reference/string/basic_string/find_last_of.md +++ b/reference/string/basic_string/find_last_of.md @@ -57,15 +57,15 @@ constexpr size_type ## 要件 -(3) の形式の場合、`s` は少なくとも `traits_type::length(s) + 1` の要素を持つ `charT` の配列を指していること。 +- (3) の形式の場合、`s` は少なくとも `traits_type::length(s) + 1` の要素を持つ `charT` の配列を指していること。 ## 効果 -- (1) `pos` 以前で最後に `str` 内に存在する文字の位置を返す。 -- (2) `pos` 以前で最後に `s` 内に存在する文字の位置を返す。`s` は長さ `n` の文字列へのポインタである。 -- (3) (2) と同様だが、こちらは NULL 終端の文字列を扱う。 -- (4) `pos` 以前で最後に `c` と一致する文字の位置を返す。 -- (5) `basic_string_view sv = t;`として変数`sv`を作成し、`pos` より前で最後に `sv` 内に存在する文字の位置を返す。 +- (1) : `pos` 以前で最後に `str` 内に存在する文字の位置を返す。 +- (2) : `pos` 以前で最後に `s` 内に存在する文字の位置を返す。`s` は長さ `n` の文字列へのポインタである。 +- (3) : (2) と同様だが、こちらは NULL 終端の文字列を扱う。 +- (4) : `pos` 以前で最後に `c` と一致する文字の位置を返す。 +- (5) : `basic_string_view sv = t;`として変数`sv`を作成し、`pos` より前で最後に `sv` 内に存在する文字の位置を返す。 ## 戻り値 @@ -73,8 +73,8 @@ constexpr size_type ## 例外 -- (1) 投げない -- (5) `noexcept`内の式は、以下と等価である +- (1) : 投げない +- (5) : `noexcept`内の式は、以下と等価である ```cpp is_nothrow_convertible_v> ``` diff --git a/reference/string/basic_string/rfind.md b/reference/string/basic_string/rfind.md index 1b35fd6f53..baff9ae8d7 100644 --- a/reference/string/basic_string/rfind.md +++ b/reference/string/basic_string/rfind.md @@ -56,15 +56,15 @@ constexpr size_type - [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`false`であること ## 要件 -(3) の形式の場合、`s` は少なくとも `traits_type::length(s) + 1` の要素を持つ `charT` の配列を指していること。 +- (3) の形式の場合、`s` は少なくとも `traits_type::length(s) + 1` の要素を持つ `charT` の配列を指していること。 ## 効果 -- (1) `pos` 以前で最後に `str` と一致する位置を返す。 -- (2) `pos` 以前で最後に `s` と一致する位置を返す。`s` は長さ `n` の文字列へのポインタである。 -- (3) (2) と同様だが、こちらは NULL 終端の文字列を扱う。 -- (4) `pos` 以前で最後に `c` と一致する位置を返す。 -- (5) `basic_string_view sv = t;`として変数`sv`を作成し、`pos` より前で最後に `sv` と一致する位置を返す。 +- (1) : `pos` 以前で最後に `str` と一致する位置を返す。 +- (2) : `pos` 以前で最後に `s` と一致する位置を返す。`s` は長さ `n` の文字列へのポインタである。 +- (3) : (2) と同様だが、こちらは NULL 終端の文字列を扱う。 +- (4) : `pos` 以前で最後に `c` と一致する位置を返す。 +- (5) : `basic_string_view sv = t;`として変数`sv`を作成し、`pos` より前で最後に `sv` と一致する位置を返す。 ## 戻り値 @@ -72,8 +72,8 @@ constexpr size_type ## 例外 -- (1) 投げない -- (5) `noexcept`内の式は、以下と等価である +- (1) : 投げない +- (5) : `noexcept`内の式は、以下と等価である ```cpp is_nothrow_convertible_v> ``` From e36b137e8a237c71b7a03306148cc7b44ed405e8 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 22 May 2025 23:44:27 +0900 Subject: [PATCH 1735/3948] =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=83=86=E3=83=8A?= =?UTF-8?q?=E3=81=AEstd::erase=20:=20C++26=E3=81=AE=E6=B3=A2=E3=82=AB?= =?UTF-8?q?=E3=83=83=E3=82=B3=E5=88=9D=E6=9C=9F=E5=8C=96=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=20#1311?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/deque/deque/erase_free.md | 47 ++++++++++++++++++- .../forward_list/forward_list/erase_free.md | 47 ++++++++++++++++++- reference/list/list/erase_free.md | 47 ++++++++++++++++++- reference/string/basic_string/erase_free.md | 41 +++++++++++++++- reference/vector/vector/erase_free.md | 45 +++++++++++++++++- 5 files changed, 217 insertions(+), 10 deletions(-) diff --git a/reference/deque/deque/erase_free.md b/reference/deque/deque/erase_free.md index 5ed9fec9a9..6c95c90d4f 100644 --- a/reference/deque/deque/erase_free.md +++ b/reference/deque/deque/erase_free.md @@ -7,7 +7,11 @@ ```cpp namespace std { template - typename deque::size_type erase(deque& c, const U& value); + typename deque::size_type + erase(deque& c, const U& value); // (1) C++20 + template + typename deque::size_type + erase(deque& c, const U& value); // (1) C++26 } ``` @@ -35,7 +39,18 @@ return r; 削除した要素数を返す。 +## 備考 +- (1) : + - C++26 : 引数として波カッコ初期化`{}`を受け付ける + ```cpp + std::deque> d; + erase(d, {}); // 空の要素を削除 + erase(d, {1, 2, 3}); // 値{1, 2, 3}をもつ要素を削除 + ``` + + ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -54,13 +69,39 @@ int main() ``` * std::erase[color ff0000] -### 出力 +#### 出力 ``` 3 4 5 ``` +### 波カッコ初期化を入力として使用する (C++26) +```cpp example +#include +#include +#include + +int main() { + std::deque> d = { + {1, 2, 3}, + {4, 5, 6}, + {}, + {7, 8} + }; + + std::erase(d, {}); // 空の要素を削除 + std::erase(d, {1, 2, 3}); // 値{1, 2, 3}をもつ要素を削除 + + std::println("{}", d); +} +``` + +#### 出力 +``` +[[4, 5, 6], [7, 8]] +``` + ## バージョン ### 言語 - C++20 @@ -74,3 +115,5 @@ int main() ## 参照 - [P1209R0 Adopt consistent container erasure from Library Fundamentals 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1209r0.html) - [R1115R3 Improving the Return Value of Erase-Like Algorithms II: Free `erase`/`erase_if`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1115r3.pdf) +- [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) + - C++26で波カッコ初期化 (リスト初期化) に対応した diff --git a/reference/forward_list/forward_list/erase_free.md b/reference/forward_list/forward_list/erase_free.md index 9e8ca21341..b6b6ffc186 100644 --- a/reference/forward_list/forward_list/erase_free.md +++ b/reference/forward_list/forward_list/erase_free.md @@ -7,7 +7,11 @@ ```cpp namespace std { template - typename forward_list::size_type erase(forward_list& c, const U& value); + typename forward_list::size_type + erase(forward_list& c, const U& value); // (1) C++20 + template + typename forward_list::size_type + erase(forward_list& c, const U& value); // (1) C++26 } ``` @@ -28,7 +32,18 @@ erase_if(c, [&](auto& elem) { return elem == value; }); 削除した要素数を返す。 +## 備考 +- (1) : + - C++26 : 引数として波カッコ初期化`{}`を受け付ける + ```cpp + std::forward_list> ls; + erase(ls, {}); // 空の要素を削除 + erase(ls, {1, 2, 3}); // 値{1, 2, 3}をもつ要素を削除 + ``` + + ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -47,13 +62,39 @@ int main() ``` * std::erase[color ff0000] -### 出力 +#### 出力 ``` 3 4 5 ``` +### 波カッコ初期化を入力として使用する (C++26) +```cpp example +#include +#include +#include + +int main() { + std::forward_list> ls = { + {1, 2, 3}, + {4, 5, 6}, + {}, + {7, 8} + }; + + std::erase(ls, {}); // 空の要素を削除 + std::erase(ls, {1, 2, 3}); // 値{1, 2, 3}をもつ要素を削除 + + std::println("{}", ls); +} +``` + +#### 出力 +``` +[[4, 5, 6], [7, 8]] +``` + ## バージョン ### 言語 - C++20 @@ -67,3 +108,5 @@ int main() ## 参照 - [P1209R0 Adopt consistent container erasure from Library Fundamentals 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1209r0.html) - [R1115R3 Improving the Return Value of Erase-Like Algorithms II: Free `erase`/`erase_if`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1115r3.pdf) +- [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) + - C++26で波カッコ初期化 (リスト初期化) に対応した diff --git a/reference/list/list/erase_free.md b/reference/list/list/erase_free.md index 8f1c859cf8..004e672b90 100644 --- a/reference/list/list/erase_free.md +++ b/reference/list/list/erase_free.md @@ -7,7 +7,11 @@ ```cpp namespace std { template - typename list::size_type erase(list& c, const U& value); + typename list::size_type + erase(list& c, const U& value); // (1) C++20 + template + typename list::size_type + erase(list& c, const U& value); // (1) C++26 } ``` @@ -28,7 +32,18 @@ erase_if(c, [&](auto& elem) { return elem == value; }); 削除した要素数を返す。 +## 備考 +- (1) : + - C++26 : 引数として波カッコ初期化`{}`を受け付ける + ```cpp + std::list> ls; + erase(ls, {}); // 空の要素を削除 + erase(ls, {1, 2, 3}); // 値{1, 2, 3}をもつ要素を削除 + ``` + + ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -47,13 +62,39 @@ int main() ``` * std::erase[color ff0000] -### 出力 +#### 出力 ``` 3 4 5 ``` +### 波カッコ初期化を入力として使用する (C++26) +```cpp example +#include +#include +#include + +int main() { + std::list> ls = { + {1, 2, 3}, + {4, 5, 6}, + {}, + {7, 8} + }; + + std::erase(ls, {}); // 空の要素を削除 + std::erase(ls, {1, 2, 3}); // 値{1, 2, 3}をもつ要素を削除 + + std::println("{}", ls); +} +``` + +#### 出力 +``` +[[4, 5, 6], [7, 8]] +``` + ## バージョン ### 言語 - C++20 @@ -67,3 +108,5 @@ int main() ## 参照 - [P1209R0 Adopt consistent container erasure from Library Fundamentals 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1209r0.html) - [R1115R3 Improving the Return Value of Erase-Like Algorithms II: Free `erase`/`erase_if`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1115r3.pdf) +- [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) + - C++26で波カッコ初期化 (リスト初期化) に対応した diff --git a/reference/string/basic_string/erase_free.md b/reference/string/basic_string/erase_free.md index 35d7ec1a3d..dfc18ebacf 100644 --- a/reference/string/basic_string/erase_free.md +++ b/reference/string/basic_string/erase_free.md @@ -8,7 +8,10 @@ namespace std { template constexpr typename basic_string::size_type - erase(basic_string& c, const U& value); + erase(basic_string& c, const U& value); // (1) C++20 + template + constexpr typename basic_string::size_type + erase(basic_string& c, const U& value); // (1) C++26 } ``` @@ -36,7 +39,17 @@ return r; 削除した要素数を返す。 +## 備考 +- (1) : + - C++26 : 引数として波カッコ初期化`{}`を受け付ける + ```cpp + erase(s, {}); // ヌル文字'\0'を削除 + erase(s, {'a'}); // 文字'a'を削除 + ``` + + ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -53,11 +66,33 @@ int main() ``` * std::erase[color ff0000] -### 出力 +#### 出力 ``` HelloWorld ``` +### 波カッコ初期化を入力文字として使用する (C++26) +```cpp example +#include +#include + +int main() { + const char ar[] = "hel\0lo"; + std::string s(ar, ar + sizeof(ar)); + + std::erase(s, {}); + std::erase(s, {'l'}); + + std::cout << s << std::endl; +} +``` + +#### 出力 +``` +heo +``` + + ## バージョン ### 言語 - C++20 @@ -71,3 +106,5 @@ HelloWorld ## 参照 - [P1209R0 Adopt consistent container erasure from Library Fundamentals 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1209r0.html) - [R1115R3 Improving the Return Value of Erase-Like Algorithms II: Free `erase`/`erase_if`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1115r3.pdf) +- [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) + - C++26で波カッコ初期化 (リスト初期化) に対応した diff --git a/reference/vector/vector/erase_free.md b/reference/vector/vector/erase_free.md index 81a12080a0..82a5411ff0 100644 --- a/reference/vector/vector/erase_free.md +++ b/reference/vector/vector/erase_free.md @@ -8,7 +8,10 @@ namespace std { template constexpr typename vector::size_type - erase(vector& c, const U& value); + erase(vector& c, const U& value); // (1) C++20 + template + constexpr typename vector::size_type + erase(vector& c, const U& value); // (1) C++26 } ``` @@ -36,7 +39,18 @@ return r; 削除した要素数を返す。 +## 備考 +- (1) : + - C++26 : 引数として波カッコ初期化`{}`を受け付ける + ```cpp + std::vector> v; + erase(v, {}); // 空の要素を削除 + erase(v, {1, 2, 3}); // 値{1, 2, 3}をもつ要素を削除 + ``` + + ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -55,13 +69,38 @@ int main() ``` * std::erase[color ff0000] -### 出力 +#### 出力 ``` 3 4 5 ``` +### 波カッコ初期化を入力として使用する (C++26) +```cpp example +#include +#include + +int main() { + std::vector> v = { + {1, 2, 3}, + {4, 5, 6}, + {}, + {7, 8} + }; + + std::erase(v, {}); // 空の要素を削除 + std::erase(v, {1, 2, 3}); // 値{1, 2, 3}をもつ要素を削除 + + std::println("{}", v); +} +``` + +#### 出力 +``` +[[4, 5, 6], [7, 8]] +``` + ## バージョン ### 言語 - C++20 @@ -75,3 +114,5 @@ int main() ## 参照 - [P1209R0 Adopt consistent container erasure from Library Fundamentals 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1209r0.html) - [R1115R3 Improving the Return Value of Erase-Like Algorithms II: Free `erase`/`erase_if`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1115r3.pdf) +- [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) + - C++26で波カッコ初期化 (リスト初期化) に対応した From 16a3e8098a15303a79fbbc3e038b3a295714835d Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 23 May 2025 10:33:50 +0900 Subject: [PATCH 1736/3948] =?UTF-8?q?=E5=85=A8=E4=BD=93=20:=20=E3=82=AA?= =?UTF-8?q?=E3=83=BC=E3=83=90=E3=83=BC=E3=83=AD=E3=83=BC=E3=83=89=E7=95=AA?= =?UTF-8?q?=E5=8F=B7=E3=81=AE=E5=88=97=E6=8C=99=E3=80=8C(1)(2)=E3=80=8D?= =?UTF-8?q?=E3=82=92=E3=80=8C(1),=20(2)=E3=80=8D=E3=81=AB=E5=A4=89?= =?UTF-8?q?=E6=8F=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp17/folding_expressions.md | 6 +++--- reference/algorithm/ranges_fold_right.md | 2 +- reference/algorithm/ranges_fold_right_last.md | 2 +- reference/any/any_cast.md | 2 +- reference/charconv/to_chars.md | 10 +++++----- reference/compare/partial_ordering/op_equal.md | 2 +- reference/compare/partial_ordering/op_not_equal.md | 4 ++-- reference/compare/strong_ordering/op_equal.md | 2 +- reference/compare/strong_ordering/op_not_equal.md | 4 ++-- reference/compare/weak_ordering/op_equal.md | 2 +- reference/compare/weak_ordering/op_not_equal.md | 4 ++-- reference/generator/generator/promise_type/op_new.md | 2 +- reference/iterator/basic_const_iterator/common_type.md | 2 +- .../iterator/basic_const_iterator/op_increment.md | 2 +- reference/iterator/counted_iterator/op_increment.md | 4 ++-- reference/iterator/ranges_advance.md | 2 +- reference/locale/wstring_convert/op_constructor.md | 2 +- .../monotonic_buffer_resource/op_constructor.md | 8 ++++---- .../polymorphic_allocator/op_constructor.md | 4 ++-- .../memory_resource/pool_resource/op_constructor.md | 2 +- .../linear_congruential_engine/op_constructor.md | 2 +- .../random/mersenne_twister_engine/op_constructor.md | 2 +- reference/random/random_device/op_constructor.md | 2 +- .../subtract_with_carry_engine/op_constructor.md | 2 +- .../random/uniform_int_distribution/op_constructor.md | 2 +- .../random/uniform_real_distribution/op_constructor.md | 2 +- reference/ranges/as_const_view/begin.md | 2 +- reference/ranges/as_const_view/end.md | 2 +- reference/ranges/as_const_view/size.md | 2 +- reference/regex/match_results/op_constructor.md | 4 ++-- reference/string/basic_string/append.md | 4 ++-- reference/string/basic_string/assign.md | 4 ++-- reference/string/basic_string/compare.md | 2 +- reference/string/basic_string/insert.md | 4 ++-- reference/string/basic_string/op_plus.md | 6 +++--- reference/string/basic_string/replace.md | 4 ++-- .../syncstream/basic_osyncstream/op_constructor.md | 2 +- 37 files changed, 58 insertions(+), 58 deletions(-) diff --git a/lang/cpp17/folding_expressions.md b/lang/cpp17/folding_expressions.md index 080253f9b1..a6feba34f8 100644 --- a/lang/cpp17/folding_expressions.md +++ b/lang/cpp17/folding_expressions.md @@ -28,7 +28,7 @@ * 畳み込み式はカッコ `()` で囲まれなければならない * `op` は後述する二項演算子 - 二項畳み込み (3)(4) の場合 `op` は同一でなければならない + 二項畳み込み (3), (4) の場合 `op` は同一でなければならない * `pack` は未展開のパラメータパック (規格ではキャスト式 cast-expression と呼ばれる) * `init` は未展開のパラメータパック以外 (規格ではキャスト式 cast-expression と呼ばれる) * 畳み込み式は以下のように展開される: @@ -81,7 +81,7 @@ ### パラメータパックが空のときの式の値 -単項畳み込み (1)(2) でパラメータパックが空の場合、以下の演算子については式の値が設定される: +単項畳み込み (1), (2) でパラメータパックが空の場合、以下の演算子については式の値が設定される: | 演算子 | 値 | |------|------| @@ -91,7 +91,7 @@ 上記以外の演算子に対し空のパラメータパックが適用された場合、プログラムは不適格となる。 -空のパラメータパックが適用された場合の挙動を変えるには二項畳み込み (3)(4) で値を与える。 +空のパラメータパックが適用された場合の挙動を変えるには二項畳み込み (3), (4) で値を与える。 ## 例 diff --git a/reference/algorithm/ranges_fold_right.md b/reference/algorithm/ranges_fold_right.md index ea0c5ef57d..96a13edc2a 100644 --- a/reference/algorithm/ranges_fold_right.md +++ b/reference/algorithm/ranges_fold_right.md @@ -88,7 +88,7 @@ public: ## 戻り値 -(1)(2)ともに、以下と等価 +(1), (2)ともに、以下と等価 ```cpp using U = decay_t, T>>; diff --git a/reference/algorithm/ranges_fold_right_last.md b/reference/algorithm/ranges_fold_right_last.md index 0aaef54729..1e15b1e59b 100644 --- a/reference/algorithm/ranges_fold_right_last.md +++ b/reference/algorithm/ranges_fold_right_last.md @@ -52,7 +52,7 @@ namespace std::ranges { ## 戻り値 -(1)(2)ともに、以下と等価 +(1), (2)ともに、以下と等価 ```cpp using U = decay_t, T>>; diff --git a/reference/any/any_cast.md b/reference/any/any_cast.md index bed4111902..f4c65910dd 100644 --- a/reference/any/any_cast.md +++ b/reference/any/any_cast.md @@ -37,7 +37,7 @@ namespace std { - (1) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true`であること。そうでない場合、プログラムは不適格となる - (2) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true`であること。そうでない場合、プログラムは不適格となる - (3) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true`であること。そうでない場合、プログラムは不適格となる -- (4)(5) : [`is_void_v`](/reference/type_traits/is_void.md)` == false`であること +- (4), (5) : [`is_void_v`](/reference/type_traits/is_void.md)` == false`であること - C++26から ## 効果 diff --git a/reference/charconv/to_chars.md b/reference/charconv/to_chars.md index ed77a9bb0e..26417c913f 100644 --- a/reference/charconv/to_chars.md +++ b/reference/charconv/to_chars.md @@ -137,14 +137,14 @@ C++標準はこれら関数の実装の詳細について何も規定しない 10 < nの場合、10~35の値はアルファベットの小文字a~zがあてられる。 桁数を合わせるために左側を0をパディングすること(0埋め)は行われない。 -- (2)(3)(4)(5) : Cロケールで`printf`によって行われたかのように浮動小数点数を文字列へ変換する。 +- (2), (3), (4), (5) : Cロケールで`printf`によって行われたかのように浮動小数点数を文字列へ変換する。 フォーマット指定子は`%f,%e`どちらかを出力文字列が最も短くなるように(両者が同じなら`%f`が優先)選択する。 -- (6)(7)(8)(9) : `fmt`によって指定されたフォーマット指定子を用いて、Cロケールで`printf`によって行われたかのように浮動小数点数を文字列へ変換する。 +- (6), (7), (8), (9) : `fmt`によって指定されたフォーマット指定子を用いて、Cロケールで`printf`によって行われたかのように浮動小数点数を文字列へ変換する。 出力文字列が最も短くなるように変換される。 - `chars_format::general`が指定された場合は(2)(3)(4)(5)と同等。 + `chars_format::general`が指定された場合は(2), (3), (4), (5)と同等。 -- (10)(11)(12)(13) : `fmt`と`precision`によって指定されたフォーマット指定子と精度を用いて、Cロケールで`printf`によって行われたかのように浮動小数点数を文字列へ変換する。 +- (10), (11), (12), (13) : `fmt`と`precision`によって指定されたフォーマット指定子と精度を用いて、Cロケールで`printf`によって行われたかのように浮動小数点数を文字列へ変換する。 精度は、`chars_format::fixed`では小数点以下の正確な桁数、`chars_format::scientific`と`chars_format::hex`では最小の桁数を表す。 `chars_format::general`が指定された場合は次のようになる。 - 指数表記したときの指数を`X`、`precision`と1の大きいほうを`P`とする。 @@ -176,7 +176,7 @@ C++標準はこれら関数の実装の詳細について何も規定しない ## 備考 - MSVCでは浮動小数点数→10進文字列変換の実装に[Ryu](https://github.com/ulfjack/ryu)というアルゴリズムを利用している。 - (1) : 実装によって全ての整数型(符号付、無し)および`char`のオーバーロードが提供される -- (5)(9)(13) : 浮動小数点数型は拡張浮動小数点数型を含む +- (5), (9), (13) : 浮動小数点数型は拡張浮動小数点数型を含む ## 例 diff --git a/reference/compare/partial_ordering/op_equal.md b/reference/compare/partial_ordering/op_equal.md index e961cf9916..f1438f8879 100644 --- a/reference/compare/partial_ordering/op_equal.md +++ b/reference/compare/partial_ordering/op_equal.md @@ -18,7 +18,7 @@ friend constexpr bool operator==(/*unspecified*/, partial_ordering v) noexcept; ## 概要 - (1) : `partial_ordering`同士の等値比較を行う -- (2)(3) : `partial_ordering`の値が`partial_ordering::equivalent`であるかを調べる。 +- (2), (3) : `partial_ordering`の値が`partial_ordering::equivalent`であるかを調べる。 ## 戻り値 diff --git a/reference/compare/partial_ordering/op_not_equal.md b/reference/compare/partial_ordering/op_not_equal.md index 986a40bfe6..29754ebf17 100644 --- a/reference/compare/partial_ordering/op_not_equal.md +++ b/reference/compare/partial_ordering/op_not_equal.md @@ -18,12 +18,12 @@ friend constexpr bool operator!=(/*unspecified*/, partial_ordering v) noexcept; ## 概要 - (1) : `partial_ordering`同士の非等値比較を行う -- (2)(3) : `partial_ordering`の値が`partial_ordering::equivalent`で無いことを調べる。 +- (2), (3) : `partial_ordering`の値が`partial_ordering::equivalent`で無いことを調べる。 ## 戻り値 - (1) : `return !(v == w)` -- (2)(3) : `return !(v == 0)` +- (2), (3) : `return !(v == 0)` ## 例外 diff --git a/reference/compare/strong_ordering/op_equal.md b/reference/compare/strong_ordering/op_equal.md index 421860f86a..b70bb7c53a 100644 --- a/reference/compare/strong_ordering/op_equal.md +++ b/reference/compare/strong_ordering/op_equal.md @@ -18,7 +18,7 @@ friend constexpr bool operator==(/*unspecified*/, strong_ordering v) noexcept; ## 概要 - (1) : `strong_ordering`同士の等値比較を行う -- (2)(3) : `strong_ordering`の値が`strong_ordering::equal`であるかを調べる。 +- (2), (3) : `strong_ordering`の値が`strong_ordering::equal`であるかを調べる。 ## 戻り値 diff --git a/reference/compare/strong_ordering/op_not_equal.md b/reference/compare/strong_ordering/op_not_equal.md index e2fb0d7f30..ecd9eabb5d 100644 --- a/reference/compare/strong_ordering/op_not_equal.md +++ b/reference/compare/strong_ordering/op_not_equal.md @@ -18,12 +18,12 @@ friend constexpr bool operator!=(/*unspecified*/, strong_ordering v) noexcept; ## 概要 - (1) : `strong_ordering`同士の非等値比較を行う -- (2)(3) : `strong_ordering`の値が`strong_ordering::equal`で無いことを調べる。 +- (2), (3) : `strong_ordering`の値が`strong_ordering::equal`で無いことを調べる。 ## 戻り値 - (1) : `return !(v == w)` -- (2)(3) : `return !(v == 0)` +- (2), (3) : `return !(v == 0)` ## 例外 diff --git a/reference/compare/weak_ordering/op_equal.md b/reference/compare/weak_ordering/op_equal.md index c6eba5fdb9..78c2e3903c 100644 --- a/reference/compare/weak_ordering/op_equal.md +++ b/reference/compare/weak_ordering/op_equal.md @@ -18,7 +18,7 @@ friend constexpr bool operator==(/*unspecified*/, weak_ordering v) noexcept; / ## 概要 - (1) : `weak_ordering`同士の等値比較を行う -- (2)(3) : `weak_ordering`の値が`weak_ordering::equivalent`であるかを調べる。 +- (2), (3) : `weak_ordering`の値が`weak_ordering::equivalent`であるかを調べる。 ## 戻り値 diff --git a/reference/compare/weak_ordering/op_not_equal.md b/reference/compare/weak_ordering/op_not_equal.md index 05fd85355b..9d72db850f 100644 --- a/reference/compare/weak_ordering/op_not_equal.md +++ b/reference/compare/weak_ordering/op_not_equal.md @@ -18,12 +18,12 @@ friend constexpr bool operator!=(/*unspecified*/, weak_ordering v) noexcept; / ## 概要 - (1) : `weak_ordering`同士の非等値比較を行う -- (2)(3) : `weak_ordering`の値が`weak_ordering::equivalent`で無いことを調べる。 +- (2), (3) : `weak_ordering`の値が`weak_ordering::equivalent`で無いことを調べる。 ## 戻り値 - (1) : `return !(v == w)` -- (2)(3) : `return !(v == 0)` +- (2), (3) : `return !(v == 0)` ## 例外 diff --git a/reference/generator/generator/promise_type/op_new.md b/reference/generator/generator/promise_type/op_new.md index 3764efb606..19c0ffee44 100644 --- a/reference/generator/generator/promise_type/op_new.md +++ b/reference/generator/generator/promise_type/op_new.md @@ -39,7 +39,7 @@ void* operator new(size_t size, const This&, allocator_arg_t, const Alloc& alloc ## 効果 -`B`型のアロケータ`b`を、オーバーロード(1)では`A()`により、オーバーロード(2)(3)では`A(alloc)`により初期化する。 +`B`型のアロケータ`b`を、オーバーロード(1)では`A()`により、オーバーロード(2), (3)では`A(alloc)`により初期化する。 アロケータ`b`を用いて、サイズ`size`の[コルーチン・ステート](/lang/cpp20/coroutines.md)と、後ほど[`operator delete`](op_delete.md)による`b`を用いたメモリブロック解放で必要とされる追加状態を合わせたストレージに必要となる、`U`型の最小配列ストレージを確保する。 diff --git a/reference/iterator/basic_const_iterator/common_type.md b/reference/iterator/basic_const_iterator/common_type.md index 88be1e536f..3702dd0324 100644 --- a/reference/iterator/basic_const_iterator/common_type.md +++ b/reference/iterator/basic_const_iterator/common_type.md @@ -37,7 +37,7 @@ namespace std { `basic_const_iterator`のための[`common_type`](/reference/type_traits/common_type.md)特殊化。 -- (1)(2) : `basic_const_iterator`とその他のイテレータ型の間の共通の型を取得する +- (1), (2) : `basic_const_iterator`とその他のイテレータ型の間の共通の型を取得する - (3) : 異なるイテレータ型による`basic_const_iterator`特殊化の間の共通の型を取得する ## 例 diff --git a/reference/iterator/basic_const_iterator/op_increment.md b/reference/iterator/basic_const_iterator/op_increment.md index bc2c4c577e..36ca5873f3 100644 --- a/reference/iterator/basic_const_iterator/op_increment.md +++ b/reference/iterator/basic_const_iterator/op_increment.md @@ -18,7 +18,7 @@ constexpr basic_const_iterator operator++(int) requires forward_iterator 0` +- (1), (2) : [`count()`](count.md)` > 0` ## 効果 diff --git a/reference/iterator/ranges_advance.md b/reference/iterator/ranges_advance.md index eb165ddd7a..d4a3403e48 100644 --- a/reference/iterator/ranges_advance.md +++ b/reference/iterator/ranges_advance.md @@ -61,7 +61,7 @@ namespace std::ranges { ## 戻り値 -- (1)(2) : なし +- (1), (2) : なし - (3) : 指定した距離`n`と実際に進めた距離との差(進めなかった距離)を返す - `i`の処理終了時と開始時の位置の差を`M`として、`n - M`を返す diff --git a/reference/locale/wstring_convert/op_constructor.md b/reference/locale/wstring_convert/op_constructor.md index 43b69f596a..5c2382ec75 100644 --- a/reference/locale/wstring_convert/op_constructor.md +++ b/reference/locale/wstring_convert/op_constructor.md @@ -38,7 +38,7 @@ wstring_convert(const wstring_convert&) = delete; // (5) C++14 ## 要件 -- (2)(3) : `pcvt != nullptr`であること。 +- (2), (3) : `pcvt != nullptr`であること。 ## 効果 diff --git a/reference/memory_resource/monotonic_buffer_resource/op_constructor.md b/reference/memory_resource/monotonic_buffer_resource/op_constructor.md index 67e7ebe4da..f9aa787398 100644 --- a/reference/memory_resource/monotonic_buffer_resource/op_constructor.md +++ b/reference/memory_resource/monotonic_buffer_resource/op_constructor.md @@ -38,9 +38,9 @@ monotonic_buffer_resource(const monotonic_buffer_resource&) = delete; ## 要件 -- (1)(2)(3) : `upstream`は有効な`memory_resource`オブジェクトを指していること。(当然、nullでないこと) -- (2)(5) : `initial_size`は0より大きいこと -- (3)(6) : `buffer_size`は`buffer`に割り当てられているメモリ領域のサイズ以下であること。 +- (1), (2), (3) : `upstream`は有効な`memory_resource`オブジェクトを指していること。(当然、nullでないこと) +- (2), (5) : `initial_size`は0より大きいこと +- (3), (6) : `buffer_size`は`buffer`に割り当てられているメモリ領域のサイズ以下であること。 ## 引数 @@ -63,7 +63,7 @@ monotonic_buffer_resource(const monotonic_buffer_resource&) = delete; - (6) : `buffer`と`buffer_size`及び[`get_default_resource()`](/reference/memory_resource/get_default_resource.md)から取得した`memory_resource`を(3)に渡し委譲 -(4)(5)(6)のコンストラクタは上流メモリリソースとして[`get_default_resource()`](/reference/memory_resource/get_default_resource.md)から取得した`memory_resource`を利用する。 +(4), (5), (6)のコンストラクタは上流メモリリソースとして[`get_default_resource()`](/reference/memory_resource/get_default_resource.md)から取得した`memory_resource`を利用する。 ## 備考 どのコンストラクタの初期化においても、上流メモリリソースの所有権を保持しない。 diff --git a/reference/memory_resource/polymorphic_allocator/op_constructor.md b/reference/memory_resource/polymorphic_allocator/op_constructor.md index 1fdbcee0b9..3d974e9ed3 100644 --- a/reference/memory_resource/polymorphic_allocator/op_constructor.md +++ b/reference/memory_resource/polymorphic_allocator/op_constructor.md @@ -32,10 +32,10 @@ polymorphic_allocator(const polymorphic_allocator& other) noexcept; //(4) ## 効果 - (1) : [`get_default_resource()`](/reference/memory_resource/get_default_resource.md)からデフォルトの`memory_resource`を取得して構築 - (2) : `r`を`memory_resource`として構築 -- (3)(4) : [`other.resource()`](resource.md)から`memory_resource`を取得して構築 +- (3), (4) : [`other.resource()`](resource.md)から`memory_resource`を取得して構築 ## 例外 -- (1)(4) : 投げない +- (1), (4) : 投げない ## 備考 どのコンストラクタからの初期化においても、取得する`memory_resource`の所有権を保持しない。 diff --git a/reference/memory_resource/pool_resource/op_constructor.md b/reference/memory_resource/pool_resource/op_constructor.md index bd0883de84..980f727340 100644 --- a/reference/memory_resource/pool_resource/op_constructor.md +++ b/reference/memory_resource/pool_resource/op_constructor.md @@ -34,7 +34,7 @@ pool_resource(const pool_resource&) = delete; //(5) ## 要件 -- (1)(3) : `upstream`は有効な`memory_resource`オブジェクトを指していること。(当然、nullでないこと) +- (1), (3) : `upstream`は有効な`memory_resource`オブジェクトを指していること。(当然、nullでないこと) ## 引数 diff --git a/reference/random/linear_congruential_engine/op_constructor.md b/reference/random/linear_congruential_engine/op_constructor.md index 86189541c9..9aa822f6a2 100644 --- a/reference/random/linear_congruential_engine/op_constructor.md +++ b/reference/random/linear_congruential_engine/op_constructor.md @@ -29,7 +29,7 @@ linear_congruential_engine(linear_congruential_engine&& e) = default; // (5 ## 計算量 -- (1)(2) : O(1) +- (1), (2) : O(1) ## 例 diff --git a/reference/random/mersenne_twister_engine/op_constructor.md b/reference/random/mersenne_twister_engine/op_constructor.md index 1df5e50f44..316b358724 100644 --- a/reference/random/mersenne_twister_engine/op_constructor.md +++ b/reference/random/mersenne_twister_engine/op_constructor.md @@ -29,7 +29,7 @@ mersenne_twister_engine(mersenne_twister_engine&& e) = default; // (5) ## 計算量 -- (1)(2) : 状態のサイズ `n` (`mersenne_twister_engine::state_size`) に対し O(n) +- (1), (2) : 状態のサイズ `n` (`mersenne_twister_engine::state_size`) に対し O(n) - (5) : 状態シーケンスの要素数はコンパイル時に決定されるため、多くの場合状態シーケンスはスタック上(配列)に作られる。そのため、ムーブが効果的に動作することは期待できない diff --git a/reference/random/random_device/op_constructor.md b/reference/random/random_device/op_constructor.md index cfc1661bc3..f4efdfc36c 100644 --- a/reference/random/random_device/op_constructor.md +++ b/reference/random/random_device/op_constructor.md @@ -37,7 +37,7 @@ random_device(const random_device&) = delete; // (3) デフォルトでは、CPU の `RDRAND` 命令が使用できれば (`_GLIBCXX_X86_RDRAND` が定義されていれば) それを、そうでなければ `/dev/urandom` から値を取得する ## 例外 -- (1)(2) : 乱数生成器を初期化できなかった場合、[`exception`](/reference/exception/exception.md)から派生した実装定義の例外オブジェクトを送出する +- (1), (2) : 乱数生成器を初期化できなかった場合、[`exception`](/reference/exception/exception.md)から派生した実装定義の例外オブジェクトを送出する ## 例 diff --git a/reference/random/subtract_with_carry_engine/op_constructor.md b/reference/random/subtract_with_carry_engine/op_constructor.md index a954e310da..cadd3aaf40 100644 --- a/reference/random/subtract_with_carry_engine/op_constructor.md +++ b/reference/random/subtract_with_carry_engine/op_constructor.md @@ -35,7 +35,7 @@ subtract_with_carry_engine(subtract_with_carry_engine&& e) = default; // (5 ## 計算量 -- (1)(2) : 正確に $n \times \mathtt{r}$ 回 (`r` は `subtract_with_carry_engine::long_lag`) [`linear_congruential_engine` を呼ぶ](../linear_congruential_engine/op_call.md) +- (1), (2) : 正確に $n \times \mathtt{r}$ 回 (`r` は `subtract_with_carry_engine::long_lag`) [`linear_congruential_engine` を呼ぶ](../linear_congruential_engine/op_call.md) ## 例 diff --git a/reference/random/uniform_int_distribution/op_constructor.md b/reference/random/uniform_int_distribution/op_constructor.md index 0335d5c4ae..c157377118 100644 --- a/reference/random/uniform_int_distribution/op_constructor.md +++ b/reference/random/uniform_int_distribution/op_constructor.md @@ -28,7 +28,7 @@ explicit uniform_int_distribution(const param_type& parm); / ## 要件 -- (1)(2) : `a <= b`であること +- (1), (2) : `a <= b`であること ## 例 diff --git a/reference/random/uniform_real_distribution/op_constructor.md b/reference/random/uniform_real_distribution/op_constructor.md index 990146a3db..52da9ba0ff 100644 --- a/reference/random/uniform_real_distribution/op_constructor.md +++ b/reference/random/uniform_real_distribution/op_constructor.md @@ -24,7 +24,7 @@ explicit uniform_real_distribution(const param_type& parm); // (3) ## 要件 -- (1)(2) : `a <= b`かつ`b - a <=` [`numeric_limits`](/reference/limits/numeric_limits.md)`::`[`max()`](/reference/limits/numeric_limits/max.md)であること +- (1), (2) : `a <= b`かつ`b - a <=` [`numeric_limits`](/reference/limits/numeric_limits.md)`::`[`max()`](/reference/limits/numeric_limits/max.md)であること ## 例 diff --git a/reference/ranges/as_const_view/begin.md b/reference/ranges/as_const_view/begin.md index ccd9c8247c..0cd45667b9 100644 --- a/reference/ranges/as_const_view/begin.md +++ b/reference/ranges/as_const_view/begin.md @@ -18,7 +18,7 @@ constexpr auto begin() const requires range; // (2) ## 戻り値 -入力`view`(`V`)のオブジェクトを`base_`というメンバに保持するとして、(1)(2)どちらも +入力`view`(`V`)のオブジェクトを`base_`というメンバに保持するとして、(1), (2)どちらも ```cpp return ranges::cbegin(base_); diff --git a/reference/ranges/as_const_view/end.md b/reference/ranges/as_const_view/end.md index 5b08c30cc1..b1c953ed11 100644 --- a/reference/ranges/as_const_view/end.md +++ b/reference/ranges/as_const_view/end.md @@ -18,7 +18,7 @@ constexpr auto end() const requires range; // (2) ## 戻り値 -入力`view`(`V`)のオブジェクトを`base_`というメンバに保持するとして、(1)(2)どちらも +入力`view`(`V`)のオブジェクトを`base_`というメンバに保持するとして、(1), (2)どちらも ```cpp return ranges::cend(base_); diff --git a/reference/ranges/as_const_view/size.md b/reference/ranges/as_const_view/size.md index 392911257e..0ddeace6e0 100644 --- a/reference/ranges/as_const_view/size.md +++ b/reference/ranges/as_const_view/size.md @@ -19,7 +19,7 @@ constexpr auto size() const requires sized_range; // (2) ## 戻り値 -入力`view`(`V`)のオブジェクトを`base_`というメンバに保持するとして、(1)(2)どちらも +入力`view`(`V`)のオブジェクトを`base_`というメンバに保持するとして、(1), (2)どちらも ```cpp return ranges::size(base_); diff --git a/reference/regex/match_results/op_constructor.md b/reference/regex/match_results/op_constructor.md index a7f503564b..659426002d 100644 --- a/reference/regex/match_results/op_constructor.md +++ b/reference/regex/match_results/op_constructor.md @@ -34,7 +34,7 @@ match_results(match_results&& m) noexcept; // (4) ## 事後条件 -- (1)(2) [`ready`](ready.md)`() == false`、かつ、[`size`](size.md)`() == 0`、かつ、[`get_allocator`](get_allocator.md)`() == a` +- (1), (2) [`ready`](ready.md)`() == false`、かつ、[`size`](size.md)`() == 0`、かつ、[`get_allocator`](get_allocator.md)`() == a` - (3) 構築したオブジェクトを `u` とすると、`u == m` - (4) 以下の表を満たす。 @@ -52,7 +52,7 @@ match_results(match_results&& m) noexcept; // (4) ## 計算量 -- (1)(2) 定数時間 +- (1), (2) 定数時間 - (3) 線形時間 - (4) 定数時間 diff --git a/reference/string/basic_string/append.md b/reference/string/basic_string/append.md index 8115e47037..b1be83c9bd 100644 --- a/reference/string/basic_string/append.md +++ b/reference/string/basic_string/append.md @@ -68,7 +68,7 @@ constexpr basic_string& ## テンプレートパラメータ制約 -- (8)(9) : 以下の両方を満たしていること +- (8), (9) : 以下の両方を満たしていること - [`is_convertible_v`](/reference/type_traits/is_convertible.md)`> == true` - [`is_convertible_v`](/reference/type_traits/is_convertible.md)` == false` @@ -218,5 +218,5 @@ Hello, world - [P0254R2 Integrating `std::string_view` and `std::string`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0254r2.pdf) - [LWG Issue 2758. `std::string{}.assign("ABCDE", 0, 1)` is ambiguous](https://wg21.cmeerw.net/lwg/issue2758) - [LWG Issue 2946. LWG 2758's resolution missed further corrections](https://wg21.cmeerw.net/lwg/issue2946) - - 意図しない暗黙変換防止のために`string_view`を受けるオーバーロード(8)(9)の引数型を`const T&`に変更 + - 意図しない暗黙変換防止のために`string_view`を受けるオーバーロード(8), (9)の引数型を`const T&`に変更 - [P0980R1 Making `std::string` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0980r1.pdf) diff --git a/reference/string/basic_string/assign.md b/reference/string/basic_string/assign.md index 8cdbf74ac2..342e2d797b 100644 --- a/reference/string/basic_string/assign.md +++ b/reference/string/basic_string/assign.md @@ -71,7 +71,7 @@ constexpr basic_string& ## テンプレートパラメータ制約 -- (9)(10) : 以下の両方を満たしていること +- (9), (10) : 以下の両方を満たしていること - [`is_convertible_v`](/reference/type_traits/is_convertible.md)`> == true` - [`is_convertible_v`](/reference/type_traits/is_convertible.md)` == false` @@ -210,5 +210,5 @@ s10 : Hello - [P0254R2 Integrating `std::string_view` and `std::string`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0254r2.pdf) - [LWG Issue 2758. `std::string{}.assign("ABCDE", 0, 1)` is ambiguous](https://wg21.cmeerw.net/lwg/issue2758) - [LWG Issue 2946. LWG 2758's resolution missed further corrections](https://wg21.cmeerw.net/lwg/issue2946) - - 意図しない暗黙変換防止のために`string_view`を受けるオーバーロード(9)(10)の引数型を`const T&`に変更 + - 意図しない暗黙変換防止のために`string_view`を受けるオーバーロード(9), (10)の引数型を`const T&`に変更 - [P0980R1 Making `std::string` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0980r1.pdf) diff --git a/reference/string/basic_string/compare.md b/reference/string/basic_string/compare.md index 9bb3b821f4..590f219603 100644 --- a/reference/string/basic_string/compare.md +++ b/reference/string/basic_string/compare.md @@ -168,5 +168,5 @@ int main() - [P0254R2 Integrating `std::string_view` and `std::string`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0254r2.pdf) - [LWG Issue 2758. `std::string{}.assign("ABCDE", 0, 1)` is ambiguous](https://wg21.cmeerw.net/lwg/issue2758) - [LWG Issue 2946. LWG 2758's resolution missed further corrections](https://wg21.cmeerw.net/lwg/issue2946) - - 意図しない暗黙変換防止のために`string_view`を受けるオーバーロード(7)(8)(9)の引数型を`const T&`に変更 + - 意図しない暗黙変換防止のために`string_view`を受けるオーバーロード(7), (8), (9)の引数型を`const T&`に変更 - [P0980R1 Making `std::string` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0980r1.pdf) diff --git a/reference/string/basic_string/insert.md b/reference/string/basic_string/insert.md index 452956796d..def1e70bba 100644 --- a/reference/string/basic_string/insert.md +++ b/reference/string/basic_string/insert.md @@ -91,7 +91,7 @@ constexpr basic_string& ## テンプレートパラメータ制約 -- (10)(11) : 以下の両方を満たしていること +- (10), (11) : 以下の両方を満たしていること - [`is_convertible_v`](/reference/type_traits/is_convertible.md)`> == true` - [`is_convertible_v`](/reference/type_traits/is_convertible.md)` == false` @@ -292,5 +292,5 @@ int main() - [P0254R2 Integrating `std::string_view` and `std::string`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0254r2.pdf) - [LWG Issue 2758. `std::string{}.assign("ABCDE", 0, 1)` is ambiguous](https://wg21.cmeerw.net/lwg/issue2758) - [LWG Issue 2946. LWG 2758's resolution missed further corrections](https://wg21.cmeerw.net/lwg/issue2946) - - 意図しない暗黙変換防止のために`string_view`を受けるオーバーロード(10)(11)の引数型を`const T&`に変更 + - 意図しない暗黙変換防止のために`string_view`を受けるオーバーロード(10), (11)の引数型を`const T&`に変更 - [P0980R1 Making `std::string` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0980r1.pdf) diff --git a/reference/string/basic_string/op_plus.md b/reference/string/basic_string/op_plus.md index 0452ec6fd9..6b181c21b7 100644 --- a/reference/string/basic_string/op_plus.md +++ b/reference/string/basic_string/op_plus.md @@ -151,7 +151,7 @@ namespace std { ### C++20から -- (1)(9) : 以下と等価 +- (1), (9) : 以下と等価 ```cpp basic_string r = lhs; r.append(rhs); @@ -159,14 +159,14 @@ namespace std { ``` * append[link append.md] -- (2)(10) : 以下と等価 +- (2), (10) : 以下と等価 ```cpp lhs.append(rhs); return std::move(lhs); ``` * append[link append.md] -- (3)(6) : 以下と等価 +- (3), (6) : 以下と等価 ```cpp rhs.insert(0, lhs); return std::move(rhs); diff --git a/reference/string/basic_string/replace.md b/reference/string/basic_string/replace.md index 623eebd07a..207ae106d2 100644 --- a/reference/string/basic_string/replace.md +++ b/reference/string/basic_string/replace.md @@ -192,7 +192,7 @@ constexpr basic_string& ## テンプレートパラメータ制約 -- (12)(13)(14) : 以下の両方を満たしていること +- (12), (13), (14) : 以下の両方を満たしていること - [`is_convertible_v`](/reference/type_traits/is_convertible.md)`> == true` - [`is_convertible_v`](/reference/type_traits/is_convertible.md)` == false` @@ -440,5 +440,5 @@ int main() - [P0254R2 Integrating `std::string_view` and `std::string`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0254r2.pdf) - [LWG Issue 2758. `std::string{}.assign("ABCDE", 0, 1)` is ambiguous](https://wg21.cmeerw.net/lwg/issue2758) - [LWG Issue 2946. LWG 2758's resolution missed further corrections](https://wg21.cmeerw.net/lwg/issue2946) - - 意図しない暗黙変換防止のために`string_view`を受けるオーバーロード(12)(13)(14)の引数型を`const T&`に変更 + - 意図しない暗黙変換防止のために`string_view`を受けるオーバーロード(12), (13), (14)の引数型を`const T&`に変更 - [P0980R1 Making `std::string` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0980r1.pdf) diff --git a/reference/syncstream/basic_osyncstream/op_constructor.md b/reference/syncstream/basic_osyncstream/op_constructor.md index 95eb9da66a..cc4bdc5e23 100644 --- a/reference/syncstream/basic_osyncstream/op_constructor.md +++ b/reference/syncstream/basic_osyncstream/op_constructor.md @@ -27,7 +27,7 @@ basic_osyncstream(basic_osyncstream&& other) noexcept; ## 効果 - (1) : 提供されるストリームバッファ(`buf`)、アロケータ(`allocator`)を使用してプライベートメンバの[`std::basic_syncbuf`](../basic_syncbuf.md)を初期化し、そのポインタを用いて基底クラスである[`std::basic_ostream`](../../ostream/basic_ostream.md)を初期化する。 -- (2)(3) : (1)に委譲。 +- (2), (3) : (1)に委譲。 - (4) : (3)に委譲。 - (5) : 対応する`other`のサブオブジェクトから基底クラスとプライベートメンバの`std::basic_syncbuf`をムーブ構築し、基底クラスの初期化を完了するために`std::basic_ostream::set_rdbuf(addressof(sb))`を呼び出す。 From 0f3ab3ae9af4e61b5f15be6aed0792f6337ef2b4 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 23 May 2025 16:13:32 +0900 Subject: [PATCH 1737/3948] =?UTF-8?q?algorithm/find=20:=20C++26=E3=81=AE?= =?UTF-8?q?=E6=B3=A2=E3=82=AB=E3=83=83=E3=82=B3=E5=88=9D=E6=9C=9F=E5=8C=96?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C=20#1311?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 2 + reference/algorithm/find.md | 98 +++++++++++++++++++++---- reference/algorithm/ranges_find.md | 67 ++++++++++++++++- reference/iterator.md | 1 + reference/iterator/projected.md | 1 + reference/iterator/projected_value_t.md | 81 ++++++++++++++++++++ 6 files changed, 233 insertions(+), 17 deletions(-) create mode 100644 reference/iterator/projected_value_t.md diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 708e0af4a6..e2a2d398ff 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -127,6 +127,7 @@ * [link /reference/functional.md] * identity[link /reference/functional/identity.md] * ranges::equal_to[link /reference/functional/ranges_equal_to.md] + * std::identity[link /reference/functional/identity.md] * [link /reference/future.md] * [link /reference/generator.md] * [link /reference/initializer_list.md] @@ -155,6 +156,7 @@ * iter_value_t[link /reference/iterator/iter_value_t.md] * output_iterator[link /reference/iterator/output_iterator.md] * projected[link /reference/iterator/projected.md] + * projected_value_t[link /reference/iterator/projected_value_t.md] * random_access_iterator[link /reference/iterator/random_access_iterator.md] * sentinel_for[link /reference/iterator/sentinel_for.md] * std::back_inserter[link /reference/iterator/back_inserter.md] diff --git a/reference/algorithm/find.md b/reference/algorithm/find.md index 958f3f53ac..41aecc8385 100644 --- a/reference/algorithm/find.md +++ b/reference/algorithm/find.md @@ -5,21 +5,41 @@ ```cpp namespace std { - template - InputIterator find(InputIterator first, - InputIterator last, - const T& value); // (1) C++03 - - template - constexpr InputIterator find(InputIterator first, - InputIterator last, - const T& value); // (1) C++20 - - template - ForwardIterator find(ExecutionPolicy&& exec, - ForwardIterator first, - ForwardIterator last, - const T& value); // (2) C++17 + template + InputIterator + find(InputIterator first, + InputIterator last, + const T& value); // (1) C++03 + template + constexpr InputIterator + find(InputIterator first, + InputIterator last, + const T& value); // (1) C++20 + template ::value_type> + constexpr InputIterator + find(InputIterator first, + InputIterator last, + const T& value); // (1) C++26 + + template + ForwardIterator + find(ExecutionPolicy&& exec, + ForwardIterator first, + ForwardIterator last, + const T& value); // (2) C++17 + template::value_type> + ForwardIterator + find(ExecutionPolicy&& exec, + ForwardIterator first, + ForwardIterator last, + const T& value); // (2) C++26 } ``` @@ -35,7 +55,16 @@ namespace std { 最大で `last - first` 回比較を行う +## 備考 +- (1), (2) : + - C++26 : 引数として波カッコ初期化`{}`を受け付ける + ```cpp + std::vector v; + auto it = std::find(v.begin(), v.begin(), {a, b}); + ``` + ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -53,11 +82,46 @@ int main() { ``` * std::find[color ff0000] -### 出力 +#### 出力 ``` found: 1 ``` +### 波カッコ初期化を入力として使用する (C++26) +```cpp example +#include +#include +#include + +struct Point { + int x; + int y; + + bool operator==(const Point& other) const = default; +}; + +int main() { + std::vector v = { + {1, 2}, + {3, 4}, + {5, 6} + }; + + auto it = std::find(v.begin(), v.end(), {3, 4}); + if (it == v.end()) { + std::cout << "not found" << std::endl; + } else { + std::cout << "found: " << it->x << "," << it->y << std::endl; + } +} +``` +* std::find[color ff0000] + +#### 出力 +``` +found: 3,4 +``` + ## 実装例 ```cpp @@ -73,3 +137,5 @@ InputIterator find(InputIterator first, InputIterator last, const T& value) { ## 参照 - [P0202R3 Add Constexpr Modifiers to Functions in `` and `` Headers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0202r3.html) - [P0467R2 Iterator Concerns for Parallel Algorithms](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0467r2.html) +- [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) + - C++26で波カッコ初期化 (リスト初期化) に対応した diff --git a/reference/algorithm/ranges_find.md b/reference/algorithm/ranges_find.md index 9e404321cd..bfb96b38ab 100644 --- a/reference/algorithm/ranges_find.md +++ b/reference/algorithm/ranges_find.md @@ -16,6 +16,16 @@ namespace std::ranges { S last, const T& value, Proj proj = {}); // (1) C++20 + template S, + class Proj = identity, + class T = projected_value_t> + requires indirect_binary_predicate, const T*> + constexpr I + find(I first, + S last, + const T& value, + Proj proj = {}); // (1) C++26 template , Proj>> + requires indirect_binary_predicate, Proj>, const T*> + constexpr borrowed_iterator_t + find(R&& r, + const T& value, + Proj proj = {}); // (2) C++26 } ``` * input_iterator[link /reference/iterator/input_iterator.md] @@ -51,7 +69,17 @@ namespace std::ranges { 最大で `last - first` 回比較を行う +## 備考 +- (1), (2) : + - C++26 : 引数として波カッコ初期化`{}`を受け付ける + ```cpp + std::vector v; + auto it = std::ranges::find(r, {a, b}); + ``` + + ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -69,11 +97,46 @@ int main() { ``` * std::ranges::find[color ff0000] -### 出力 +#### 出力 ``` found: 1 ``` +### 波カッコ初期化を入力として使用する (C++26) +```cpp example +#include +#include +#include + +struct Point { + int x; + int y; + + bool operator==(const Point& other) const = default; +}; + +int main() { + std::vector v = { + {1, 2}, + {3, 4}, + {5, 6} + }; + + auto it = std::ranges::find(v, {3, 4}); + if (it == v.end()) { + std::cout << "not found" << std::endl; + } else { + std::cout << "found: " << it->x << "," << it->y << std::endl; + } +} +``` +* std::ranges::find[color ff0000] + +#### 出力 +``` +found: 3,4 +``` + ## 実装例 ```cpp @@ -120,3 +183,5 @@ inline constexpr find_impl find; ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) + - C++26で波カッコ初期化 (リスト初期化) に対応した diff --git a/reference/iterator.md b/reference/iterator.md index 585eb9ff58..1184f3d4f2 100644 --- a/reference/iterator.md +++ b/reference/iterator.md @@ -81,6 +81,7 @@ C++20以降の標準ライブラリでは、任意のイテレータに対して | [`iter_const_reference_t`](iterator/iter_const_reference_t.md) | イテレータの参照型(`iter_reference_t`)を`const`化したものを取得する (alias template) | C++23 | | [`indirect_result_t`](iterator/indirect_result_t.md) | 関数呼び出し可能な型`F`を複数のイテレータ`Is...`によって呼び出した時の戻り値型を取得する (alias template) | C++20 | | [`projected`](iterator/projected.md) | イテレータ`I`の`Proj`による射影操作の結果を表すことのできる[`indirectly_readable`](/reference/iterator/indirectly_readable.md)なクラス (class template) | C++20 | +| [`projected_value_t`](iterator/projected_value_t.md) | イイテレータ`I`の`Proj`による射影操作の結果となる値型を取得する (alias template) | C++26 | | [`incrementable_traits`](iterator/incrementable_traits.md) | `iter_difference_t`にアダプトするためのカスタマイゼーションポイント (class template) | C++20 | | [`indirectly_readable_traits`](iterator/indirectly_readable_traits.md) | `iter_value_t`にアダプトするためのカスタマイゼーションポイント (class template) | C++20 | | [`input_iterator_tag`](iterator/iterator_tag.md) | 入力イテレータを表すタグ(class) | | diff --git a/reference/iterator/projected.md b/reference/iterator/projected.md index 9e769a725f..cf694bbc71 100644 --- a/reference/iterator/projected.md +++ b/reference/iterator/projected.md @@ -87,6 +87,7 @@ int main() { ## 関連項目 +- [`projected_value_t`](projected_value_t.md) - [`indirectly_comparable`](indirectly_comparable.md) - [`mergeable`](mergeable.md) - [`sortable`](sortable.md) diff --git a/reference/iterator/projected_value_t.md b/reference/iterator/projected_value_t.md new file mode 100644 index 0000000000..3c9315a020 --- /dev/null +++ b/reference/iterator/projected_value_t.md @@ -0,0 +1,81 @@ +# projected_value_t +* iterator[meta header] +* std[meta namespace] +* type-alias[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template Proj> + using projected_value_t = remove_cvref_t&>>; +} +``` +* indirectly_readable[link /reference/iterator/indirectly_readable.md] +* indirectly_­regular_­unary_­invocable[link /reference/iterator/indirectly_­regular_­unary_­invocable.md.nolink] + +## 概要 +イテレータ型`I`が指す値型を取得する。 + +この型は、間接参照可能な型`I`に任意の射影操作`Proj`を適用した結果となる値型を返す。 + + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + using vec_iterator = std::vector::iterator; + using pointer = double*; + + static_assert(std::same_as< + std::projected_value_t, + int + >); + + static_assert(std::same_as< + std::projected_value_t, + double + >); +} +``` +* std::projected_value_t[color ff0000] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark verified] +- [GCC](/implementation.md#gcc): 15.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 13 [mark noimpl] + + +## 関連項目 +- [`std::projected`](projected.md) +- [`std::ranges::find()`](/reference/algorithm/ranges_find.md) +- [`std::ranges::find_last()`](/reference/algorithm/ranges_find_last.md) +- [`std::ranges::count()`](/reference/algorithm/ranges_count.md) +- [`std::ranges::search_n()`](/reference/algorithm/ranges_search_n.md) +- [`std::ranges::replace()`](/reference/algorithm/ranges_replace.md) +- [`std::ranges::replace_if()`](/reference/algorithm/ranges_replace_if.md) +- [`std::ranges::replace_copy()`](/reference/algorithm/replace_copy.md) +- [`std::ranges::remove()`](/reference/algorithm/ranges_remove.md) +- [`std::ranges::remove_copy()`](/reference/algorithm/ranges_remove_copy.md) +- [`std::ranges::lower_bound()`](/reference/algorithm/ranges_lower_bound.md) +- [`std::ranges::upper_bound()`](/reference/algorithm/ranges_upper_bound.md) +- [`std::ranges::equal_range()`](/reference/algorithm/ranges_equal_range.md) +- [`std::ranges::binary_search()`](/reference/algorithm/ranges_binary_search.md) +- [`std::ranges::contains()`](/reference/algorithm/ranges_contains.md) + + +## 参照 +- [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) + - C++26で、アルゴリズムに波カッコ初期化 (リスト初期化) を渡せるようにするために導入された。`find(r, {1, 2});` From 047c55b383de775f4a241e99d3fcc9faa0720b0f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 23 May 2025 16:25:31 +0900 Subject: [PATCH 1738/3948] =?UTF-8?q?=E4=B8=8D=E5=8F=AF=E8=A6=96=E6=96=87?= =?UTF-8?q?=E5=AD=97=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit VSCodeで不可視文字を表示するよう設定したので、このあとは大丈夫なはず --- reference/iterator/projected_value_t.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/iterator/projected_value_t.md b/reference/iterator/projected_value_t.md index 3c9315a020..241752afb5 100644 --- a/reference/iterator/projected_value_t.md +++ b/reference/iterator/projected_value_t.md @@ -6,13 +6,13 @@ ```cpp namespace std { - template Proj> + template Proj> using projected_value_t = remove_cvref_t&>>; } ``` * indirectly_readable[link /reference/iterator/indirectly_readable.md] -* indirectly_­regular_­unary_­invocable[link /reference/iterator/indirectly_­regular_­unary_­invocable.md.nolink] +* indirectly_regular_unary_invocable[link /reference/iterator/indirectly_regular_unary_invocable.md.nolink] ## 概要 イテレータ型`I`が指す値型を取得する。 From 047e1191ef711f8fcd7fdea93660261e9c655747 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 23 May 2025 22:38:37 +0900 Subject: [PATCH 1739/3948] execution: when_all (#1384) on-stop-request --- reference/execution/execution.md | 2 +- reference/execution/execution/impls-for.md | 2 +- .../execution/execution/on-stop-request.md | 30 ++ reference/execution/execution/when_all.md | 478 ++++++++++++++++++ 4 files changed, 510 insertions(+), 2 deletions(-) create mode 100644 reference/execution/execution/on-stop-request.md create mode 100644 reference/execution/execution/when_all.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 08afa903d4..fbd7bf5d40 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -123,7 +123,7 @@ namespace std::execution { | [`execution::let_stopped`](execution/let_stopped.md.nolink) | 停止完了を入れ子の非同期操作へ変換 (customization point object) | C++26 | | [`execution::bulk`](execution/bulk.md.nolink) | インデクス空間上で指定関数を連続実行 (customization point object) | C++26 | | [`execution::split`](execution/split.md.nolink) | 入力Senderの値を複製送信 (customization point object) | C++26 | -| [`execution::when_all`](execution/when_all.md.nolink) | 全ての入力Sender完了を待機 (customization point object) | C++26 | +| [`execution::when_all`](execution/when_all.md) | 全ての入力Sender完了を待機 (customization point object) | C++26 | | [`execution::when_all_with_variant`](execution/when_all_with_variant.md.nolink) | 複数の値完了シグネチャをもつ全ての入力Sender完了を待機 (customization point object) | C++26 | | [`execution::into_variant`](execution/into_variant.md) | 複数の値完了シグネチャを単一[`variant`](/reference/variant/variant.md)型の値完了シグネチャに変換 (customization point object) | C++26 | | [`execution::stopped_as_optional`](execution/stopped_as_optional.md.nolink) | 入力Senderの停止完了を[`optional`](/reference/optional/optional.md)型の値完了に変換 (customization point object) | C++26 | diff --git a/reference/execution/execution/impls-for.md b/reference/execution/execution/impls-for.md index 1ef00f6371..a52188719a 100644 --- a/reference/execution/execution/impls-for.md +++ b/reference/execution/execution/impls-for.md @@ -99,7 +99,7 @@ namespace std::execution { - 完了タグ`Tag`と引数リスト`args`を用いて、接続先[Receiver](receiver.md)`rcvr`の完了操作を呼び出す。 - `Tag`型は[`set_value_t`](set_value.md), [`set_error_t`](set_error.md), [`set_stopped_t`](set_stopped.md)のいずれか。 - 第1引数`Index`は、`default-impls`実装では利用しない。 - - 複数の子Senderを保持するSenderアルゴリズムの`impls-for`オーバーライド実装で利用する(例 : [`when_all`](when_all.md.nolink))。 + - 複数の子Senderを保持するSenderアルゴリズムの`impls-for`オーバーライド実装で利用する(例 : [`when_all`](when_all.md))。 ```cpp []( diff --git a/reference/execution/execution/on-stop-request.md b/reference/execution/execution/on-stop-request.md new file mode 100644 index 0000000000..06ad7d68cb --- /dev/null +++ b/reference/execution/execution/on-stop-request.md @@ -0,0 +1,30 @@ +# on-stop-request +* execution[meta header] +* class[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +struct on-stop-request { + inplace_stop_source& stop-src; // exposition only + void operator()() noexcept { stop-src.request_stop(); } +}; +``` +* inplace_stop_source[link /reference/stop_token/inplace_stop_source.md] +* request_stop()[link /reference/stop_token/inplace_stop_source/request_stop.md] + +## 概要 +`on-stop-request`は、Senderアルゴリズム動作仕様定義で用いられる説明専用のクラステンプレートである。 + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`execution::when_all`](when_all.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/when_all.md b/reference/execution/execution/when_all.md new file mode 100644 index 0000000000..9a727719ad --- /dev/null +++ b/reference/execution/execution/when_all.md @@ -0,0 +1,478 @@ +# when_all +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct when_all_t { unspecified }; + inline constexpr when_all_t when_all{}; +} +``` +* unspecified[italic] + +## 概要 +`when_all`は、複数の入力[Sender](sender.md)が全て完了するまで待機するSenderアダプタである。 + +- 入力Sender全てが値完了のとき、全ての値完了結果を[`tuple`](/reference/tuple/tuple.md)に結合して値完了操作を行う。 +- いずれかがエラー完了のとき、同エラー値をもってエラー完了操作を行う。このとき停止要求が作成される。 +- いずれかが停止完了のとき、停止完了操作を行う。このとき停止要求が作成される。 + + +## 効果 +説明用のパック`sndrs`に対してパック`Sndrs`を`decltype((sndrs))...`としたとき、型`CD`を[`common_type_t`](/reference/type_traits/common_type.md)``とする。 + +下記いずれかが`true`となるとき、呼び出し式`when_all(sndrs...)`は不適格となる。 + +- `sizeof...(sndrs) == 0`、または +- `(`[`sender`](sender.md)` && ...) == false`、または +- 型`CD`が不適格 + +そうでなければ、呼び出し式`when_all(sndrs...)`は下記と等価。 + +```cpp +transform_sender(CD(), make-sender(when_all, {}, sndrs...)) +``` +* transform_sender[link transform_sender.md] +* make-sender[link make-sender.md] + + +### Senderアルゴリズムタグ `when_all` +Senderアルゴリズム動作説明用のクラステンプレート[`impls-for`](impls-for.md)に対して、下記の特殊化が定義される。 + +```cpp +namespace std::execution { + template<> + struct impls-for : default-impls { + static constexpr auto get-attrs = see below; + static constexpr auto get-env = see below; + static constexpr auto get-state = see below; + static constexpr auto start = see below; + static constexpr auto complete = see below; + }; +} +``` +* impls-for[link impls-for.md] +* default-impls[link impls-for.md] +* see below[italic] + +`impls-for::get-attrs`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 + +```cpp +[](auto&&, auto&&... child) noexcept { + if constexpr (same_as) { + return env<>(); + } else { + return MAKE-ENV(get_domain, CD()); + } +} +``` +* default_domain[link default_domain.md] +* env<>[link env.md] +* MAKE-ENV[link MAKE-ENV.md.nolink] +* get_domain[link get_domain.md] + +`impls-for::get-env`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 + +```cpp +[](auto&&, State& state, const Receiver& rcvr) noexcept { + return see below; +} +``` +* see below[italic] + +ラムダ式は下記を満たすオブジェクト`e`を返す。 + +- `decltype(e)`が[`queryable`](../queryable.md)のモデル、かつ +- 式`e.query(`[`get_stop_token`](../get_stop_token.md)`)`が`state.stop-src.get_token()`と等価、かつ +- [`get_stop_token`](../get_stop_token.md)以外の[クエリオブジェクト](../queryable.md)`q`に対して、式`e.query(q)`は[`get_env`](get_env.md)`(rcvr).query(q)`と等価。 + +`impls-for::get-state`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 + +```cpp +[](Sndr&& sndr, Rcvr& rcvr) noexcept(e) -> decltype(e) { + return e; +} +``` + +ラムダ式が返す式`e`は下記の通り。 + +```cpp +std::forward(sndr).apply(make-state()) +``` +* apply[link product-type.md] + +`impls-for::start`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 + +```cpp +[]( + State& state, Rcvr& rcvr, Ops&... ops) noexcept -> void { + state.on_stop.emplace( + get_stop_token(get_env(rcvr)), + on-stop-request{state.stop_src}); + if (state.stop_src.stop_requested()) { + state.on_stop.reset(); + set_stopped(std::move(rcvr)); + } else { + (start(ops), ...); + } +} +``` +* get_stop_token[link ../get_stop_token.md] +* get_env[link get_env.md] +* on-stop-request[link on-stop-request.md] +* set_stopped[link set_stopped.md] +* start[link start.md] +* emplace[link /reference/optional/optional/emplace.md] +* reset()[link /reference/optional/optional/reset.md] +* stop_requested()[link /reference/stop_token/inplace_stop_token/stop_requested.md] +* std::move[link /reference/utility/move.md] + +`impls-for::complete`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 + +```cpp +[]( + this auto& complete, Index, State& state, Rcvr& rcvr, Set, Args&&... args) noexcept -> void { + if constexpr (same_as) { + if (disposition::error != state.disp.exchange(disposition::error)) { + state.stop_src.request_stop(); + TRY-EMPLACE-ERROR(state.errors, std::forward(args)...); + } + } else if constexpr (same_as) { + auto expected = disposition::started; + if (state.disp.compare_exchange_strong(expected, disposition::stopped)) { + state.stop_src.request_stop(); + } + } else if constexpr (!same_as>) { + if (state.disp == disposition::started) { + auto& opt = get(state.values); + TRY-EMPLACE-VALUE(complete, opt, std::forward(args)...); + } + } + state.arrive(rcvr); +} +``` +* set_error_t[link set_error.md] +* set_stopped_t[link set_stopped.md] +* tuple<>[link /reference/tuple/tuple.md] +* get[link /reference/tuple/tuple/get.md] +* exchange[link /reference/atomic/atomic/exchange.md] +* compare_exchange_strong[link /reference/atomic/atomic/compare_exchange_strong.md] +* request_stop()[link /reference/stop_token/inplace_stop_source/request_stop.md] + +説明用の式`v`, `e`に対して、式`decltype(auto(e))(e)`が潜在的に例外送出するならば、`TRY-EMPLACE-ERROR(v, e)`を下記と等価な式とする。 +そうでなければ、`v.`[`template emplace`](/reference/variant/variant/emplace.md)`(e)`とする。 + +```cpp +try { + v.template emplace(e); +} catch (...) { + v.template emplace(current_exception()); +} +``` +* template emplace[link /reference/variant/variant/emplace.md] +* exception_ptr[link /reference/exception/exception_ptr.md] +* current_exception()[link /reference/exception/current_exception.md] + +説明用の式`c`, `o`およびパック`as`に対して、式[`decayed-tuple`](decayed-tuple.md)`{as...}`が潜在的に例外送出するならば、`TRY-EMPLACE-VALUE(c, o, as...)`を下記と等価な式とする。 +そうでなければ、`o.`[`emplace`](/reference/optional/optional/emplace.md)`(as...)`とする。 + +```cpp +try { + o.emplace(as...); +} catch (...) { + c(Index(), state, rcvr, set_error, current_exception()); + return; +} +``` +* set_error[link set_error.md] +* emplace[link /reference/optional/optional/emplace.md] +* current_exception()[link /reference/exception/current_exception.md] + + +## 説明専用エンティティ +説明専用のコンセプト`max-1-sender-in`, 列挙型`disposition`, クラス`make-state`は、それぞれ下記の通り定義される。 + +```cpp +template +concept max-1-sender-in = sender_in && // exposition only + (tuple_size_v> <= 1); +``` +* sender_in[link sender_in.md] +* value_types_of_t[link value_types_of_t.md] +* tuple_size_v[link /reference/tuple/tuple_size.md] +* tuple[link /reference/tuple/tuple.md] + +```cpp +enum class disposition { started, error, stopped }; // exposition only +``` + +```cpp +template +struct make-state { + template>... Sndrs> + auto operator()(auto, auto, Sndrs&&... sndrs) const { + using values_tuple = see below; + using errors_variant = see below; + using stop_callback = stop_callback_for_t>, on-stop-request>; + + struct state-type { + void arrive(Rcvr& rcvr) noexcept { // exposition only + if (0 == --count) { + complete(rcvr); + } + } + + void complete(Rcvr& rcvr) noexcept; // exposition only + + atomic count{sizeof...(sndrs)}; // exposition only + inplace_stop_source stop_src{}; // exposition only + atomic disp{disposition::started}; // exposition only + errors_variant errors{}; // exposition only + values_tuple values{}; // exposition only + optional on_stop{nullopt}; // exposition only + }; + + return state-type{}; + } +}; +``` +* env_of_t[link env_of_t.md] +* stop_token_of_t[link ../stop_token_of_t.md] +* on-stop-request[link on-stop-request.md] +* atomic[link /reference/atomic/atomic.md] +* stop_callback_for_t[link /reference/stop_token/stop_callback_for_t.md] +* inplace_stop_source[link /reference/stop_token/inplace_stop_source.md] +* stop_callback[link /reference/stop_token/stop_token.md] +* optional[link /reference/optional/optional.md] +* nullopt[link /reference/optional/nullopt_t.md] +* see below[italic] + +説明用の型`copy-fail`を、いずれかの子[Sender](sender.md)の値結果データのdecayコピーが潜在的に例外送出するならば[`exception_ptr`](/reference/exception/exception_ptr.md)とする。そうでなければ、未規定の空のクラス型`none-such`とする。 + +型`values_tuple`は、適格であるならば下記の型とする。そうでなければ、[`tuple<>`](/reference/tuple/tuple.md)とする。 + +```cpp +tuple, decayed-tuple, optional>...> +``` +* value_types_of_t[link value_types_of_t.md] +* env_of_t[link env_of_t.md] +* decayed-tuple[link decayed-tuple.md] +* tuple[link /reference/tuple/tuple.md] +* optional[link /reference/optional/optional.md] + +説明用のパック`Es`を全ての子[Sender](sender.md)のエラー結果データの[decayed](/reference/type_traits/decay.md)型としたとき、型`errors_variant`は下記定義において重複削除した型となる。 + +```cpp +variant +``` +* variant[link /reference/variant/variant.md] + +メンバ関数`void state-type::complete(Rcvr& rcvr) noexcept`の動作は下記の通り。 + +- `disp == disposition::started`のとき、下記を評価する。 + + ```cpp + auto tie = [](tuple& t) noexcept { return tuple(t); }; + auto set = [&](auto&... t) noexcept { set_value(std::move(rcvr), std::move(t)...); }; + + on_stop.reset(); + apply( + [&](auto&... opts) noexcept { + apply(set, tuple_cat(tie(*opts)...)); + }, + values); + ``` + * set_value[link set_value.md] + * tuple[link /reference/tuple/tuple.md] + * apply[link /reference/tuple/apply.md] + * tuple_cat[link /reference/tuple/tuple_cat.md] + * reset()[link /reference/optional/optional/reset.md] + * std::move[link /reference/utility/move.md] + +- そうではなく、`disp == disposition::error`のとき、下記を評価する。 + + ```cpp + on_stop.reset(); + visit( + [&](Error& error) noexcept { + if constexpr (!same_as) { + set_error(std::move(rcvr), std::move(error)); + } + }, + errors); + ``` + * set_error[link set_error.md] + * reset()[link /reference/optional/optional/reset.md] + * visit[link /reference/variant/visit.md] + * std::move[link /reference/utility/move.md] + +- それ以外のとき、下記を評価する。 + + ```cpp + on_stop.reset(); + set_stopped(std::move(rcvr)); + ``` + * set_stopped[link set_stopped.md] + * reset()[link /reference/optional/optional/reset.md] + + +## カスタマイゼーションポイント +Senderアルゴリズム構築時および[Receiver](receiver.md)接続時に、関連付けられた実行ドメインに対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 +[デフォルト実行ドメイン](../execution/default_domain.md)では無変換。 + + +## 例 +### 例1: 基本の使い方 +```cpp example +#include +#include +#include +namespace ex = std::execution; +using namespace std::string_literals; + +int main() +{ + // string型の値を送信するSender + ex::sender auto snd1 = ex::just("C++"s); + // (int,char)型の値を送信するSender + ex::sender auto snd2 = ex::just(123, 'X'); + // snd1,snd2両方の完了を待機するSender + ex::sender auto sndr = ex::when_all(snd1, snd2); + + auto result = std::this_thread::sync_wait(sndr); + // result := optional>型 + std::println("result={}", result.value()); +} +``` +* ex::when_all[color ff0000] +* ex::sender[link sender.md] +* ex::just[link just.md] +* std::this_thread::sync_wait[link ../this_thread/sync_wait.md] +* value()[link /reference/optional/optional/value.md] + +#### 出力 +``` +result=("C++", 123, 'X') +``` + +### 例2: 停止要求のハンドリング +```cpp +#include +#include +#include +namespace ex = std::execution; + + +// MySenderは下記いずれかの完了操作を行う +// 値完了 set_value(string) +// エラー完了 set_error(int) +// 停止完了 set_stopped() +struct MySender { + using sender_concept = ex::sender_t; + using completion_signatures = ex::completion_signatures< + ex::set_value_t(std::string), + ex::set_error_t(int), + ex::set_stopped_t() + >; + + template + struct state { + using operation_state_concept = ex::operation_state_t; + + state(Rcvr rcvr, int val) + : rcvr_{std::move(rcvr)}, val_{val} {} + + void start() noexcept { + auto stok = ex::get_stop_token(ex::get_env(rcvr_)); + if (stok.stop_requested()) { +    // 接続先Receiverにおいて停止要求が行われていれば + // MySenderも停止完了により早期リターンする + std::println("{}: set_stopped", val_); + ex::set_stopped(std::move(rcvr_)); + return; + } + // MySenderの本体処理 + if (0 <= val_) { + // 成功: 値完了操作 + using namespace std::string_literals; + std::println("{}: set_value", val_); + ex::set_value(std::move(rcvr_), "Hello"s); + } else { + // 失敗: エラー完了操作 + std::println("{}: set_error", val_); + ex::set_error(std::move(rcvr_), val_); + } + } + + Rcvr rcvr_; + int val_; + }; + + template + auto connect(Rcvr rcvr) noexcept { + return state{std::move(rcvr), val_}; + } + + int val_; +}; + +int main() +{ + ex::sender auto snd1 = MySender{1}; // 値完了 + ex::sender auto snd2 = MySender{-2}; // エラー完了 → 停止要求 + ex::sender auto snd3 = MySender{3}; // 停止完了 + ex::sender auto sndr = ex::when_all(snd1, snd2, snd3); + try { + auto result = std::this_thread::sync_wait(sndr); + // result := optional>型 + std::println("value={}", *result); + } catch (int err) { + std::println("error={}", err); + } +} +``` +* ex::when_all[color ff0000] +* ex::sender_t[link sender.md] +* ex::sender[link sender.md] +* ex::completion_signatures[link completion_signatures.md] +* ex::set_value_t[link set_value.md] +* ex::set_value[link set_value.md] +* ex::set_error_t[link set_error.md] +* ex::set_error[link set_error.md] +* ex::set_stopped_t[link set_stopped.md] +* ex::set_stopped[link set_stopped.md] +* ex::operation_state_t[link operation_state.md] +* ex::get_stop_token[link ../get_stop_token.md] +* ex::get_env[link get_env.md] +* std::this_thread::sync_wait[link ../this_thread/sync_wait.md] +* stop_requested()[link /reference/stop_token/inplace_stop_token/stop_requested.md] +* std::move[link /reference/utility/move.md] + +#### 出力 +``` +1: set_value +-2: set_error +3: set_stopped +error=-2 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::when_all_with_variant`](when_all_with_variant.md.nolink) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) From f572dabcf8c9b588b8b4ba14c20f4bd8a9bc0087 Mon Sep 17 00:00:00 2001 From: koki watanabe <56009584+math-hiyoko@users.noreply.github.com> Date: Sun, 25 May 2025 23:42:28 +0900 Subject: [PATCH 1740/3948] Update reference/unordered_map/unordered_map/clear.md Co-authored-by: Akira Takahashi --- reference/unordered_map/unordered_map/clear.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/unordered_map/unordered_map/clear.md b/reference/unordered_map/unordered_map/clear.md index 15cf893c73..610429a354 100644 --- a/reference/unordered_map/unordered_map/clear.md +++ b/reference/unordered_map/unordered_map/clear.md @@ -35,7 +35,7 @@ void clear() noexcept; ## 備考 - clear() は バケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格上は要求していない。 -実装によっては clear 後もバケット配列が温存され、動的メモリが残る場合がある。 +実装によっては clear 後もバケット配列が維持され、動的メモリが残る場合がある。 - メモリを確実に解放したいときには以下のように操作を行う ```CPP std::unordered_map tmp; From b25ee37d0372f32dec1ad9ef183cfc5dc55d2271 Mon Sep 17 00:00:00 2001 From: koki watanabe Date: Mon, 26 May 2025 00:14:18 +0900 Subject: [PATCH 1741/3948] reflect suggestions --- reference/unordered_map/unordered_multimap/clear.md | 2 +- reference/unordered_set/unordered_multiset/clear.md | 2 +- reference/unordered_set/unordered_set/clear.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/unordered_map/unordered_multimap/clear.md b/reference/unordered_map/unordered_multimap/clear.md index b57e326f08..ab16a56dff 100644 --- a/reference/unordered_map/unordered_multimap/clear.md +++ b/reference/unordered_map/unordered_multimap/clear.md @@ -35,7 +35,7 @@ void clear() noexcept; ## 備考 - clear() は バケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格上は要求していない。 -実装によっては clear 後もバケット配列が温存され、動的メモリが残る場合がある。 +実装によっては clear 後もバケット配列が維持され、動的メモリが残る場合がある。 - メモリを確実に解放したいときには以下のように操作を行う ```CPP std::unordered_multimap tmp; diff --git a/reference/unordered_set/unordered_multiset/clear.md b/reference/unordered_set/unordered_multiset/clear.md index 0c02d3ef4e..bef4ac38b6 100644 --- a/reference/unordered_set/unordered_multiset/clear.md +++ b/reference/unordered_set/unordered_multiset/clear.md @@ -35,7 +35,7 @@ void clear() noexcept; ## 備考 - clear() は バケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格上は要求していない。 -実装によっては clear 後もバケット配列が温存され、動的メモリが残る場合がある。 +実装によっては clear 後もバケット配列が維持され、動的メモリが残る場合がある。 - メモリを確実に解放したいときには以下のように操作を行う ```CPP std::unordered_multiset tmp; diff --git a/reference/unordered_set/unordered_set/clear.md b/reference/unordered_set/unordered_set/clear.md index 72acb0a6b8..a281059707 100644 --- a/reference/unordered_set/unordered_set/clear.md +++ b/reference/unordered_set/unordered_set/clear.md @@ -35,7 +35,7 @@ void clear() noexcept; ## 備考 - clear() は バケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格上は要求していない。 -実装によっては clear 後もバケット配列が温存され、動的メモリが残る場合がある。 +実装によっては clear 後もバケット配列が維持され、動的メモリが残る場合がある。 - メモリを確実に解放したいときには以下のように操作を行う ```CPP std::unordered_set tmp; From 3bb29a21a224749d75c2ced270b2bf59fd8a61d4 Mon Sep 17 00:00:00 2001 From: koki watanabe Date: Mon, 26 May 2025 00:16:50 +0900 Subject: [PATCH 1742/3948] fix: amend procedure --- reference/unordered_map/unordered_map/clear.md | 4 ++-- reference/unordered_map/unordered_multimap/clear.md | 4 ++-- reference/unordered_set/unordered_multiset/clear.md | 4 ++-- reference/unordered_set/unordered_set/clear.md | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/reference/unordered_map/unordered_map/clear.md b/reference/unordered_map/unordered_map/clear.md index 610429a354..bd0b88a237 100644 --- a/reference/unordered_map/unordered_map/clear.md +++ b/reference/unordered_map/unordered_map/clear.md @@ -48,8 +48,8 @@ s.swap(tmp); ### 計算量に関する備考 - 多くの実装(GCC libstdc++, LLVM libc++ など)は - 1. すべてのバケットを順に走査し - 2. 各バケットを破棄する + 1. 全ての要素を破棄する + 2. 全てのバケットを順に走査して各バケットを破棄 という手順を取るため、実行時間は概ね [`bucket_count`](bucket_count.md)`()` + [`size`](size.md)`()` に比例する傾向がある。 これは規格が定義する「計算量」(オブジェクトに対する操作の数)とは別物である。 diff --git a/reference/unordered_map/unordered_multimap/clear.md b/reference/unordered_map/unordered_multimap/clear.md index ab16a56dff..0cea90a256 100644 --- a/reference/unordered_map/unordered_multimap/clear.md +++ b/reference/unordered_map/unordered_multimap/clear.md @@ -48,8 +48,8 @@ s.swap(tmp); ### 計算量に関する備考 - 多くの実装(GCC libstdc++, LLVM libc++ など)は - 1. すべてのバケットを順に走査し - 2. 各バケットを破棄する + 1. 全ての要素を破棄する + 2. 全てのバケットを順に走査して各バケットを破棄 という手順を取るため、実行時間は概ね [`bucket_count`](bucket_count.md)`()` + [`size`](size.md)`()` に比例する傾向がある。 これは規格が定義する「計算量」(オブジェクトに対する操作の数)とは別物である。 diff --git a/reference/unordered_set/unordered_multiset/clear.md b/reference/unordered_set/unordered_multiset/clear.md index bef4ac38b6..ef733cb026 100644 --- a/reference/unordered_set/unordered_multiset/clear.md +++ b/reference/unordered_set/unordered_multiset/clear.md @@ -48,8 +48,8 @@ s.swap(tmp); ### 計算量に関する備考 - 多くの実装(GCC libstdc++, LLVM libc++ など)は - 1. すべてのバケットを順に走査し - 2. 各バケットを破棄する + 1. 全ての要素を破棄する + 2. 全てのバケットを順に走査して各バケットを破棄 という手順を取るため、実行時間は概ね [`bucket_count`](bucket_count.md)`()` + [`size`](size.md)`()` に比例する傾向がある。 これは規格が定義する「計算量」(オブジェクトに対する操作の数)とは別物である。 diff --git a/reference/unordered_set/unordered_set/clear.md b/reference/unordered_set/unordered_set/clear.md index a281059707..f734aef3e3 100644 --- a/reference/unordered_set/unordered_set/clear.md +++ b/reference/unordered_set/unordered_set/clear.md @@ -48,8 +48,8 @@ s.swap(tmp); ### 計算量に関する備考 - 多くの実装(GCC libstdc++, LLVM libc++ など)は - 1. すべてのバケットを順に走査し - 2. 各バケットを破棄する + 1. 全ての要素を破棄する + 2. 全てのバケットを順に走査して各バケットを破棄 という手順を取るため、実行時間は概ね [`bucket_count`](bucket_count.md)`()` + [`size`](size.md)`()` に比例する傾向がある。 これは規格が定義する「計算量」(オブジェクトに対する操作の数)とは別物である。 From bb0ffafab558ff1b5551f22c3329e60e16798d42 Mon Sep 17 00:00:00 2001 From: koki watanabe <56009584+math-hiyoko@users.noreply.github.com> Date: Mon, 26 May 2025 00:34:05 +0900 Subject: [PATCH 1743/3948] Apply suggestions from code review Co-authored-by: Koichi Murase --- reference/unordered_map/unordered_map/clear.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/unordered_map/unordered_map/clear.md b/reference/unordered_map/unordered_map/clear.md index bd0b88a237..07aa45df0b 100644 --- a/reference/unordered_map/unordered_map/clear.md +++ b/reference/unordered_map/unordered_map/clear.md @@ -34,8 +34,8 @@ void clear() noexcept; ## 備考 -- clear() は バケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格上は要求していない。 -実装によっては clear 後もバケット配列が維持され、動的メモリが残る場合がある。 +- `clear()` は バケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格上は要求していない。 +実装によっては `clear()` 後もバケット配列が維持され、動的メモリが残る場合がある。 - メモリを確実に解放したいときには以下のように操作を行う ```CPP std::unordered_map tmp; From e6690f088d59faee2203dae918e1375b6900791f Mon Sep 17 00:00:00 2001 From: koki watanabe Date: Mon, 26 May 2025 00:36:09 +0900 Subject: [PATCH 1744/3948] reflect suggestions --- reference/unordered_map/unordered_multimap/clear.md | 4 ++-- reference/unordered_set/unordered_multiset/clear.md | 4 ++-- reference/unordered_set/unordered_set/clear.md | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/reference/unordered_map/unordered_multimap/clear.md b/reference/unordered_map/unordered_multimap/clear.md index 0cea90a256..b4fcf646e9 100644 --- a/reference/unordered_map/unordered_multimap/clear.md +++ b/reference/unordered_map/unordered_multimap/clear.md @@ -34,8 +34,8 @@ void clear() noexcept; ## 備考 -- clear() は バケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格上は要求していない。 -実装によっては clear 後もバケット配列が維持され、動的メモリが残る場合がある。 +- `clear()` は バケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格上は要求していない。 +実装によっては `clear()` 後もバケット配列が維持され、動的メモリが残る場合がある。 - メモリを確実に解放したいときには以下のように操作を行う ```CPP std::unordered_multimap tmp; diff --git a/reference/unordered_set/unordered_multiset/clear.md b/reference/unordered_set/unordered_multiset/clear.md index ef733cb026..73a6c20d51 100644 --- a/reference/unordered_set/unordered_multiset/clear.md +++ b/reference/unordered_set/unordered_multiset/clear.md @@ -34,8 +34,8 @@ void clear() noexcept; ## 備考 -- clear() は バケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格上は要求していない。 -実装によっては clear 後もバケット配列が維持され、動的メモリが残る場合がある。 +- `clear()` は バケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格上は要求していない。 +実装によっては `clear()` 後もバケット配列が維持され、動的メモリが残る場合がある。 - メモリを確実に解放したいときには以下のように操作を行う ```CPP std::unordered_multiset tmp; diff --git a/reference/unordered_set/unordered_set/clear.md b/reference/unordered_set/unordered_set/clear.md index f734aef3e3..3f8b24f45f 100644 --- a/reference/unordered_set/unordered_set/clear.md +++ b/reference/unordered_set/unordered_set/clear.md @@ -34,8 +34,8 @@ void clear() noexcept; ## 備考 -- clear() は バケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格上は要求していない。 -実装によっては clear 後もバケット配列が維持され、動的メモリが残る場合がある。 +- `clear()` は バケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格上は要求していない。 +実装によっては `clear()` 後もバケット配列が維持され、動的メモリが残る場合がある。 - メモリを確実に解放したいときには以下のように操作を行う ```CPP std::unordered_set tmp; From f6a62c4c715293615895a7af474f7b979edb31d6 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 26 May 2025 15:59:52 +0900 Subject: [PATCH 1745/3948] =?UTF-8?q?algorithm/count=20:=20C++26=E6=B3=A2?= =?UTF-8?q?=E3=82=AB=E3=83=83=E3=82=B3=E5=88=9D=E6=9C=9F=E5=8C=96=E3=81=AB?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C=20#1311?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/count.md | 74 ++++++++++++++++++++++++--- reference/algorithm/ranges_count.md | 77 +++++++++++++++++++++++++++-- 2 files changed, 141 insertions(+), 10 deletions(-) diff --git a/reference/algorithm/count.md b/reference/algorithm/count.md index d8ae4e993b..8a9e8ba34a 100644 --- a/reference/algorithm/count.md +++ b/reference/algorithm/count.md @@ -5,24 +5,41 @@ ```cpp namespace std { - template + template typename iterator_traits::difference_type count(InputIterator first, InputIterator last, const T& value); // (1) C++03 - - template + template constexpr typename iterator_traits::difference_type count(InputIterator first, InputIterator last, const T& value); // (1) C++20 + template ::value_type> + constexpr typename iterator_traits::difference_type + count(InputIterator first, + InputIterator last, + const T& value); // (1) C++26 - template + template typename iterator_traits::difference_type count(ExecutionPolicy&& exec, ForwardIterator first, ForwardIterator last, const T& value); // (2) C++17 + template ::value_type> + typename iterator_traits::difference_type + count(ExecutionPolicy&& exec, + ForwardIterator first, + ForwardIterator last, + const T& value); // (2) C++16 } ``` * iterator_traits[link /reference/iterator/iterator_traits.md] @@ -39,7 +56,16 @@ namespace std { 正確に `last - first` 回の比較を行う +## 備考 +- (1), (2) : + - C++26 : 引数として波カッコ初期化`{}`を受け付ける + ```cpp + std::vector v; + int n = std::count(v.begin(), v.begin(), {a, b}); + ``` + ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -49,16 +75,50 @@ int main() { std::vector v = { 1,4,3,3,1,2,2,1 }; // 値が 1 の要素がいくつあるかを数える - std::cout << "count of 1: " << std::count(v.begin(), v.end(), 1) << std::endl; + int n = std::count(v.begin(), v.end(), 1); + std::cout << "count of 1: " << n << std::endl; } ``` * std::count[color ff0000] -### 出力 +#### 出力 ``` count of 1: 3 ``` +### 波カッコ初期化を入力として使用する (C++26) +```cpp example +#include +#include +#include + +struct Point { + int x; + int y; + + bool operator==(const Point& other) const = default; +}; + +int main() { + std::vector v = { + {1, 2}, + {3, 4}, + {5, 6}, + {1, 2}, + }; + + // 値が {1, 2} の要素がいくつあるかを数える + int n = std::count(v.begin(), v.end(), {1, 2}); + std::cout << "count of {1,2}: " << n << std::endl; +} +``` +* std::count[color ff0000] + +#### 出力 +``` +count of {1,2}: 2 +``` + ## 実装例 ```cpp @@ -85,3 +145,5 @@ typename iterator_traits::difference_type ## 参照 - [P0202R3 Add Constexpr Modifiers to Functions in `` and `` Headers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0202r3.html) - [P0467R2 Iterator Concerns for Parallel Algorithms](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0467r2.html) +- [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) + - C++26で波カッコ初期化 (リスト初期化) に対応した diff --git a/reference/algorithm/ranges_count.md b/reference/algorithm/ranges_count.md index 95b91a81ae..ef745e41ea 100644 --- a/reference/algorithm/ranges_count.md +++ b/reference/algorithm/ranges_count.md @@ -12,14 +12,37 @@ namespace std::ranges { class Proj = identity> requires indirect_binary_predicate, const T*> constexpr iter_difference_t - count(I first, S last, const T& value, Proj proj = {}); // (1) C++20 + count(I first, + S last, + const T& value, + Proj proj = {}); // (1) C++20 + template S, + class Proj = identity, + class T = projected_value_t> + requires indirect_binary_predicate, const T*> + constexpr iter_difference_t + count(I first, + S last, + const T& value, + Proj proj = {}); // (1) C++26 template requires indirect_binary_predicate, Proj>, const T*> constexpr range_difference_t - count(R&& r, const T& value, Proj proj = {}); // (2) C++20 + count(R&& r, + const T& value, + Proj proj = {}); // (2) C++20 + template , Proj>> + requires indirect_binary_predicate, Proj>, const T*> + constexpr range_difference_t + count(R&& r, + const T& value, + Proj proj = {}); // (2) C++26 } ``` * input_iterator[link /reference/iterator/input_iterator.md] @@ -55,7 +78,17 @@ namespace std::ranges { 正確に `last - first` 回の比較を行う +## 備考 +- (1), (2) : + - C++26 : 引数として波カッコ初期化`{}`を受け付ける + ```cpp + std::vector v; + int n = std::ranges::count(v, {a, b}); + ``` + + ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -65,16 +98,50 @@ int main() { constexpr std::array v = { 1,4,3,3,1,2,2,1 }; // 値が 1 の要素がいくつあるかを数える - std::cout << "count of 1: " << std::ranges::count(v, 1) << std::endl; + int n = std::ranges::count(v, 1); + std::cout << "count of 1: " << n << std::endl; } ``` * std::ranges::count[color ff0000] -### 出力 +#### 出力 ``` count of 1: 3 ``` +### 波カッコ初期化を入力として使用する (C++26) +```cpp example +#include +#include +#include + +struct Point { + int x; + int y; + + bool operator==(const Point& other) const = default; +}; + +int main() { + std::vector v = { + {1, 2}, + {3, 4}, + {5, 6}, + {1, 2}, + }; + + // 値が {1, 2} の要素がいくつあるかを数える + int n = std::ranges::count(v, {1, 2}); + std::cout << "count of {1,2}: " << n << std::endl; +} +``` +* std::ranges::count[color ff0000] + +#### 出力 +``` +count of {1,2}: 2 +``` + ## 実装例 ```cpp @@ -124,3 +191,5 @@ inline constexpr count_impl count; ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) + - C++26で波カッコ初期化 (リスト初期化) に対応した From c3e940c055160eaa353060dafaff5a28b7aa2b09 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 26 May 2025 16:00:10 +0900 Subject: [PATCH 1746/3948] =?UTF-8?q?algorithm/search=5Fn=20:=20C++26?= =?UTF-8?q?=E6=B3=A2=E3=82=AB=E3=83=83=E3=82=B3=E5=88=9D=E6=9C=9F=E5=8C=96?= =?UTF-8?q?=E3=81=AB=E5=AF=BE=E5=BF=9C=20#1311?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_search_n.md | 77 ++++++++++++++- reference/algorithm/search_n.md | 127 +++++++++++++++++++++++-- 2 files changed, 191 insertions(+), 13 deletions(-) diff --git a/reference/algorithm/ranges_search_n.md b/reference/algorithm/ranges_search_n.md index cd5c0b108f..5d6bdd59f6 100644 --- a/reference/algorithm/ranges_search_n.md +++ b/reference/algorithm/ranges_search_n.md @@ -5,7 +5,7 @@ * cpp20[meta cpp] ```cpp -namespace std::ranges {] +namespace std::ranges { template S, class T, @@ -19,6 +19,19 @@ namespace std::ranges {] const T& value, Pred pred = {}, Proj proj = {}); // (1) C++20 + template S, + class Pred = ranges::equal_to, + class Proj = identity, + class T = projected_value_t> + requires indirectly_comparable + constexpr subrange + search_n(I first, + S last, + iter_difference_t count, + const T& value, + Pred pred = {}, + Proj proj = {}); // (1) C++26 template , Proj>> + requires indirectly_comparable, const T*, Pred, Proj> + constexpr borrowed_subrange_t + search_n(R&& r, + range_difference_t count, + const T& value, + Pred pred = {}, + Proj proj = {}); // (2) C++26 } ``` * forward_iterator[link /reference/iterator/forward_iterator.md] @@ -61,7 +85,17 @@ namespace std::ranges {] 最大で `last - first` 回の対応する比較もしくは述語が適用される。 +## 備考 +- (1), (2) : + - C++26 : パラメータ`value`として波カッコ初期化`{}`を受け付ける + ```cpp + std::vector v; + auto sr = std::ranges::search_n(v, 3, {a, b}); + ``` + + ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -90,14 +124,49 @@ int main() { } ``` * std::ranges::search_n[color ff0000] -* v.begin()[link /reference/vector/vector/begin.md] -### 出力 +#### 出力 ``` found: index==5 found: index==0 ``` +### 波カッコ初期化を入力として使用する (C++26) +```cpp example +#include +#include +#include + +struct Point { + int x; + int y; + + bool operator==(const Point& other) const = default; +}; + +int main() { + std::vector v = { + {1, 2}, + {3, 4}, + {3, 4}, + {5, 6}, + }; + + // 値が {3, 4} が2回連続している場所を探す + std::ranges::subrange sr = std::ranges::search_n(v, 2, {3, 4}); + if (!sr.empty()) { + int index = std::distance(v.begin(), sr.begin()); + std::cout << "found: index==" << index << std::endl; + } +} +``` +* std::ranges::search_n[color ff0000] + +#### 出力 +``` +found: index==1 +``` + ## 実装例 ```cpp @@ -163,3 +232,5 @@ inline constexpr search_n_impl search_n; ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) + - C++26で波カッコ初期化 (リスト初期化) に対応した diff --git a/reference/algorithm/search_n.md b/reference/algorithm/search_n.md index 830f2e023d..0bae948605 100644 --- a/reference/algorithm/search_n.md +++ b/reference/algorithm/search_n.md @@ -5,45 +5,87 @@ ```cpp namespace std { - template + template ForwardIterator search_n(ForwardIterator first, ForwardIterator last, Size count, const T& value); // (1) C++03 - - template + template constexpr ForwardIterator search_n(ForwardIterator first, ForwardIterator last, Size count, const T& value); // (1) C++20 + template ::value_type> + constexpr ForwardIterator + search_n(ForwardIterator first, + ForwardIterator last, + Size count, + const T& value); // (1) C++26 - template + template ForwardIterator search_n(ForwardIterator first, ForwardIterator last, Size count, const T& value, BinaryPredicate pred); // (2) C++03 - - template + template constexpr ForwardIterator search_n(ForwardIterator first, ForwardIterator last, Size count, const T& value, BinaryPredicate pred); // (2) C++20 + template ::value_type, + class BinaryPredicate> + constexpr ForwardIterator + search_n(ForwardIterator first, + ForwardIterator last, + Size count, + const T& value, + BinaryPredicate pred); // (2) C++26 - template + template ForwardIterator search_n(ExecutionPolicy&& exec, ForwardIterator first, ForwardIterator last, Size count, const T& value); // (3) C++17 + template ::value_type> + ForwardIterator + search_n(ExecutionPolicy&& exec, + ForwardIterator first, + ForwardIterator last, + Size count, + const T& value); // (3) C++26 - template ForwardIterator search_n(ExecutionPolicy&& exec, @@ -52,14 +94,31 @@ namespace std { Size count, const T& value, BinaryPredicate pred); // (4) C++17 + template ::value_type, + class BinaryPredicate> + ForwardIterator + search_n(ExecutionPolicy&& exec, + ForwardIterator first, + ForwardIterator last, + Size count, + const T& value, + BinaryPredicate pred); // (4) C++26 } ``` ## 概要 あるシーケンスの中から、特定のサブシーケンスを探す。 +- (1): イテレータ範囲`[first, last)`から、値`value`が`count`回連続しているサブシーケンスを検索する +- (2): イテレータ範囲`[first, last)`から、`pred(*it, value) == true`となる要素が`count`回連続しているサブシーケンスを検索する +- (3): 実行ポリシーにしたがって、イテレータ範囲`[first, last)`から、値`value`が`count`回連続しているサブシーケンスを検索する +- (4): 実行ポリシーにしたがって、イテレータ範囲`[first, last)`から、`pred(*it, value) == true`となる要素が`count`回連続しているサブシーケンスを検索する -## 要件 + +## 適格要件 `Size`は整数型に変換できる型である必要がある。 @@ -73,7 +132,17 @@ namespace std { 最大で `last - first` 回の対応する比較もしくは述語が適用される。 +## 備考 +- (1), (2), (3), (4) : + - C++26 : パラメータ`value`として波カッコ初期化`{}`を受け付ける + ```cpp + std::vector v; + auto it = std::search_n(v.begin(), v.begin(), 3, {a, b}); + ``` + + ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -105,12 +174,48 @@ int main() { * v.cbegin()[link /reference/vector/vector/cbegin.md] * v.cend()[link /reference/vector/vector/cend.md] -### 出力 +#### 出力 ``` found: index==5 found: index==0 ``` +### 波カッコ初期化を入力として使用する (C++26) +```cpp example +#include +#include +#include + +struct Point { + int x; + int y; + + bool operator==(const Point& other) const = default; +}; + +int main() { + std::vector v = { + {1, 2}, + {3, 4}, + {3, 4}, + {5, 6}, + }; + + // 値が {3, 4} が2回連続している場所を探す + auto it = std::search_n(v.begin(), v.end(), 2, {3, 4}); + if (it != v.end()) { + int index = std::distance(v.begin(), it); + std::cout << "found: index==" << index << std::endl; + } +} +``` +* std::search_n[color ff0000] + +#### 出力 +``` +found: index==1 +``` + ## 実装例 ```cpp @@ -171,3 +276,5 @@ ForwardIterator search_n(ForwardIterator first, ForwardIterator last, - [LWG Issue 714. `search_n` complexity is too lax](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#714) - [LWG Issue 2150. Unclear specification of `find_end`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2150) - [P0202R3 Add Constexpr Modifiers to Functions in `` and `` Headers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0202r3.html) +- [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) + - C++26で波カッコ初期化 (リスト初期化) に対応した From 78b4c319e202ff61afaafdfc3a49381c973213d5 Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 26 May 2025 16:21:10 +0900 Subject: [PATCH 1747/3948] execution: when_all_with_variant (#1384) --- reference/execution/execution.md | 2 +- reference/execution/execution/continues_on.md | 4 +- reference/execution/execution/into_variant.md | 4 +- reference/execution/execution/let_value.md | 2 +- reference/execution/execution/on.md | 4 +- reference/execution/execution/starts_on.md | 4 +- reference/execution/execution/then.md | 2 +- reference/execution/execution/when_all.md | 11 +- .../execution/when_all_with_variant.md | 185 ++++++++++++++++++ 9 files changed, 203 insertions(+), 15 deletions(-) create mode 100644 reference/execution/execution/when_all_with_variant.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index fbd7bf5d40..ff06aaaa96 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -124,7 +124,7 @@ namespace std::execution { | [`execution::bulk`](execution/bulk.md.nolink) | インデクス空間上で指定関数を連続実行 (customization point object) | C++26 | | [`execution::split`](execution/split.md.nolink) | 入力Senderの値を複製送信 (customization point object) | C++26 | | [`execution::when_all`](execution/when_all.md) | 全ての入力Sender完了を待機 (customization point object) | C++26 | -| [`execution::when_all_with_variant`](execution/when_all_with_variant.md.nolink) | 複数の値完了シグネチャをもつ全ての入力Sender完了を待機 (customization point object) | C++26 | +| [`execution::when_all_with_variant`](execution/when_all_with_variant.md) | 複数の値完了シグネチャをもつ全ての入力Sender完了を待機 (customization point object) | C++26 | | [`execution::into_variant`](execution/into_variant.md) | 複数の値完了シグネチャを単一[`variant`](/reference/variant/variant.md)型の値完了シグネチャに変換 (customization point object) | C++26 | | [`execution::stopped_as_optional`](execution/stopped_as_optional.md.nolink) | 入力Senderの停止完了を[`optional`](/reference/optional/optional.md)型の値完了に変換 (customization point object) | C++26 | | [`execution::stopped_as_error`](execution/stopped_as_error.md.nolink) | 入力Senderの停止完了をエラー完了に変換 (customization point object) | C++26 | diff --git a/reference/execution/execution/continues_on.md b/reference/execution/execution/continues_on.md index a43586be4f..1ac47acb22 100644 --- a/reference/execution/execution/continues_on.md +++ b/reference/execution/execution/continues_on.md @@ -66,10 +66,10 @@ return schedule_from(std::move(data), std::move(child)); ## カスタマイゼーションポイント Senderアルゴリズム構築時に、[Sender](sender.md)`sndr`に[関連付けられた実行ドメイン](get-domain-early.md)に対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 -[デフォルト実行ドメイン](../execution/default_domain.md)では無変換。 +[デフォルト実行ドメイン](default_domain.md)では無変換。 [Receiver](receiver.md)との[接続(connect)](connect.md)時に、[Scheduler](scheduler.md)`sch`に[関連付けられた実行ドメイン](get-domain-late.md)に対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 -[デフォルト実行ドメイン](../execution/default_domain.md)では`continues_on.transform_sender(out_sndr, env)`が呼ばれ、[`schedule_from`](schedule_from.md)Senderへと変換される。 +[デフォルト実行ドメイン](default_domain.md)では`continues_on.transform_sender(out_sndr, env)`が呼ばれ、[`schedule_from`](schedule_from.md)Senderへと変換される。 説明用の式`out_sndr`を`continues_on(sndr, sch)`の戻り値[Sender](sender.md)とし、型`OutSndr`を`decltype((out_sndr))`とする。式`out_rcvr`を[`sender_in`](sender_in.md)` == true`となる[環境](../queryable.md)`Env`に関連付けられた[Receiver](receiver.md)とする。`out_sndr`と`out_rcvr`との[接続(connect)](connect.md)結果[Operation State](operation_state.md)への左辺値参照を`op`としたとき、 diff --git a/reference/execution/execution/into_variant.md b/reference/execution/execution/into_variant.md index 85d5ffb370..3e912ee224 100644 --- a/reference/execution/execution/into_variant.md +++ b/reference/execution/execution/into_variant.md @@ -86,7 +86,7 @@ namespace std::execution { ## カスタマイゼーションポイント Senderアルゴリズム構築時および[Receiver](receiver.md)接続時に、関連付けられた実行ドメインに対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 -[デフォルト実行ドメイン](../execution/default_domain.md)では無変換。 +[デフォルト実行ドメイン](default_domain.md)では無変換。 ## 例 @@ -198,7 +198,7 @@ int main() ## 関連項目 -- [`execution::when_all_with_variant`](when_all_with_variant.md.nolink) +- [`execution::when_all_with_variant`](when_all_with_variant.md) - [`this_thread::sync_wait_with_variant`](../this_thread/sync_wait_with_variant.md) diff --git a/reference/execution/execution/let_value.md b/reference/execution/execution/let_value.md index 6bb79a7a58..0ed0099578 100644 --- a/reference/execution/execution/let_value.md +++ b/reference/execution/execution/let_value.md @@ -207,7 +207,7 @@ namespace std::execution { ## カスタマイゼーションポイント Senderアルゴリズム構築時および[Receiver](receiver.md)接続時に、関連付けられた実行ドメインに対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 -[デフォルト実行ドメイン](../execution/default_domain.md)では無変換。 +[デフォルト実行ドメイン](default_domain.md)では無変換。 説明用の式`out_sndr`を`let_value(sndr, f)`の戻り値[Sender](sender.md)とし、式`rcvr`を式[`connect`](connect.md)`(out_sndr, rcvr)`が適格となる[Receiver](receiver.md)とする。式[`connect`](connect.md)`(out_sndr, rcvr)`は[開始(start)](start.md)時に下記を満たす非同期操作を生成しない場合、動作は未定義となる。 diff --git a/reference/execution/execution/on.md b/reference/execution/execution/on.md index f8afd7065e..431ef4feb3 100644 --- a/reference/execution/execution/on.md +++ b/reference/execution/execution/on.md @@ -151,13 +151,13 @@ struct not-a-sender { ## カスタマイゼーションポイント Senderアルゴリズム構築時に、関連付けられた実行ドメインに対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 -[デフォルト実行ドメイン](../execution/default_domain.md)では無変換。 +[デフォルト実行ドメイン](default_domain.md)では無変換。 - 呼び出し式`on(sch, sndr)` : [Scheduler](scheduler.md)`sch`に[関連付けられた実行ドメイン](query-or-default.md.nolink) - 呼び出し式`on(sndr, sch, closure)` : [Sender](sender.md)`sndr`に[関連付けられた実行ドメイン](get-domain-early.md) [Receiver](receiver.md)との[接続(connect)](connect.md)時に、[関連付けられた実行ドメイン](get-domain-late.md)に対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 -[デフォルト実行ドメイン](../execution/default_domain.md)では`on.transform_sender(out_sndr, env)`が呼ばれ、前述仕様通りのSenderへと変換される。 +[デフォルト実行ドメイン](default_domain.md)では`on.transform_sender(out_sndr, env)`が呼ばれ、前述仕様通りのSenderへと変換される。 ### 呼び出し式 `on(sch, sndr)` diff --git a/reference/execution/execution/starts_on.md b/reference/execution/execution/starts_on.md index 169c24ac56..9b7603c133 100644 --- a/reference/execution/execution/starts_on.md +++ b/reference/execution/execution/starts_on.md @@ -68,10 +68,10 @@ transform_sender( ## カスタマイゼーションポイント Senderアルゴリズム構築時に、[Scheduler](scheduler.md)`sch`に[関連付けられた実行ドメイン](query-or-default.md.nolink)に対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 -[デフォルト実行ドメイン](../execution/default_domain.md)では無変換。 +[デフォルト実行ドメイン](default_domain.md)では無変換。 [Receiver](receiver.md)との[接続(connect)](connect.md)時に、[関連付けられた実行ドメイン](get-domain-late.md)に対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 -[デフォルト実行ドメイン](../execution/default_domain.md)では`starts_on.transform_sender(out_sndr, env)`が呼ばれ、前述仕様通りのSenderへと変換される。 +[デフォルト実行ドメイン](default_domain.md)では`starts_on.transform_sender(out_sndr, env)`が呼ばれ、前述仕様通りのSenderへと変換される。 説明用の式`out_sndr`を`starts_on(sch, sndr)`の戻り値[Sender](sender.md)とし、型`OutSndr`を`decltype((out_sndr))`とする。式`out_rcvr`を[`sender_in`](sender_in.md)` == true`となる[環境](../queryable.md)`Env`に関連付けられた[Receiver](receiver.md)とする。`out_sndr`と`out_rcvr`との[接続(connect)](connect.md)結果[Operation State](operation_state.md)への左辺値参照を`op`としたとき、 diff --git a/reference/execution/execution/then.md b/reference/execution/execution/then.md index 997e4288f1..bdbbdb2a6c 100644 --- a/reference/execution/execution/then.md +++ b/reference/execution/execution/then.md @@ -61,7 +61,7 @@ namespace std::execution { ## カスタマイゼーションポイント Senderアルゴリズム構築時および[Receiver](receiver.md)接続時に、関連付けられた実行ドメインに対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 -[デフォルト実行ドメイン](../execution/default_domain.md)では無変換。 +[デフォルト実行ドメイン](default_domain.md)では無変換。 戻り値の[Sender](sender.md)`out_sndr`が下記を満たさない場合、呼び出し式`then(sndr, f)`の動作は未定義となる。 diff --git a/reference/execution/execution/when_all.md b/reference/execution/execution/when_all.md index 9a727719ad..d22c00b32f 100644 --- a/reference/execution/execution/when_all.md +++ b/reference/execution/execution/when_all.md @@ -15,6 +15,9 @@ namespace std::execution { ## 概要 `when_all`は、複数の入力[Sender](sender.md)が全て完了するまで待機するSenderアダプタである。 +`when_all`は全ての入力Senderが[値完了シグネチャ](set_value.md)を1個だけ持つことを要求する。 +値完了シグネチャが複数存在する場合は[`when_all_with_variant`](when_all_with_variant.md)アルゴリズムを利用する + - 入力Sender全てが値完了のとき、全ての値完了結果を[`tuple`](/reference/tuple/tuple.md)に結合して値完了操作を行う。 - いずれかがエラー完了のとき、同エラー値をもってエラー完了操作を行う。このとき停止要求が作成される。 - いずれかが停止完了のとき、停止完了操作を行う。このとき停止要求が作成される。 @@ -85,7 +88,7 @@ namespace std::execution { ラムダ式は下記を満たすオブジェクト`e`を返す。 - `decltype(e)`が[`queryable`](../queryable.md)のモデル、かつ -- 式`e.query(`[`get_stop_token`](../get_stop_token.md)`)`が`state.stop-src.get_token()`と等価、かつ +- 式`e.query(`[`get_stop_token`](../get_stop_token.md)`)`が`state.stop-src.`[`get_token()`](/reference/stop_token/inplace_stop_source/get_token.md)と等価、かつ - [`get_stop_token`](../get_stop_token.md)以外の[クエリオブジェクト](../queryable.md)`q`に対して、式`e.query(q)`は[`get_env`](get_env.md)`(rcvr).query(q)`と等価。 `impls-for::get-state`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 @@ -126,7 +129,7 @@ std::forward(sndr).apply(make-state()) * start[link start.md] * emplace[link /reference/optional/optional/emplace.md] * reset()[link /reference/optional/optional/reset.md] -* stop_requested()[link /reference/stop_token/inplace_stop_token/stop_requested.md] +* stop_requested()[link /reference/stop_token/inplace_stop_source/stop_requested.md] * std::move[link /reference/utility/move.md] `impls-for::complete`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 @@ -320,7 +323,7 @@ variant ## カスタマイゼーションポイント Senderアルゴリズム構築時および[Receiver](receiver.md)接続時に、関連付けられた実行ドメインに対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 -[デフォルト実行ドメイン](../execution/default_domain.md)では無変換。 +[デフォルト実行ドメイン](default_domain.md)では無変換。 ## 例 @@ -471,7 +474,7 @@ error=-2 ## 関連項目 -- [`execution::when_all_with_variant`](when_all_with_variant.md.nolink) +- [`execution::when_all_with_variant`](when_all_with_variant.md) ## 参照 diff --git a/reference/execution/execution/when_all_with_variant.md b/reference/execution/execution/when_all_with_variant.md new file mode 100644 index 0000000000..7aef2d143a --- /dev/null +++ b/reference/execution/execution/when_all_with_variant.md @@ -0,0 +1,185 @@ +# when_all_with_variant +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct when_all_with_variant_t { unspecified }; + inline constexpr when_all_with_variant_t when_all_with_variant{}; +} +``` +* unspecified[italic] + +## 概要 +`when_all_with_variant`は、複数の入力[Sender](sender.md)が全て完了するまで待機するSenderアダプタである。 + +`when_all_with_variant`は入力Senderが複数の[値完了シグネチャ](set_value.md)を持つケースに対応する。 +全入力Senderの値完了シグネチャが1個だけの場合は[`when_all`](when_all.md)アルゴリズムを利用する + +- 入力Sender全てが値完了のとき、全ての値完了結果を[`variant`](/reference/variant/variant.md)の[`tuple`](/reference/tuple/tuple.md)に結合して値完了操作を行う。 +- いずれかがエラー完了のとき、同エラー値をもってエラー完了操作を行う。このとき停止要求が作成される。 +- いずれかが停止完了のとき、停止完了操作を行う。このとき停止要求が作成される。 + + +## 効果 +説明用のパック`sndrs`に対してパック`Sndrs`を`decltype((sndrs))...`としたとき、型`CD`を[`common_type_t`](/reference/type_traits/common_type.md)``とする。 + +下記いずれかが`true`となるとき、呼び出し式`when_all_with_variant(sndrs...)`は不適格となる。 + +- `sizeof...(sndrs) == 0`、または +- `(`[`sender`](sender.md)` && ...) == false`、または +- 型`CD`が不適格 + +そうでなければ、呼び出し式`when_all_with_variant(sndrs...)`は下記と等価。 + +```cpp +transform_sender(CD(), make-sender(when_all_with_variant, {}, sndrs...)) +``` +* transform_sender[link transform_sender.md] +* make-sender[link make-sender.md] + + +### Senderアルゴリズムタグ `when_all_with_variant` +説明用の式`sndr`と`env`に対して、[`sender-for`](sender-for.md)` == false`のとき、式`when_all_with_variant.transform_sender(sndr, env)`は不適格となる。 + +そうでなければ、式`when_all_with_variant.transform_sender(sndr, env)`は下記と等価。 + +```cpp +auto&& [_, _, ...child] = sndr; +return when_all(into_variant(std::forward_like(child))...); +``` +* when_all[link when_all.md] +* into_variant[link into_variant.md] + + +## カスタマイゼーションポイント +Senderアルゴリズム構築時に、関連付けられた実行ドメインに対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 +[デフォルト実行ドメイン](default_domain.md)では無変換。 + +[Receiver](receiver.md)との[接続(connect)](connect.md)時に、関連付けられた実行ドメインに対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 +[デフォルト実行ドメイン](default_domain.md)では`when_all_with_variant.transform_sender(sndr, env)`が呼ばれ、前述仕様通りのSenderへと変換される。 + + +## 例 +```cpp example +#include +#include +#include +namespace ex = std::execution; + +// MySenderは下記いずれかの完了操作を行う +// 値完了 set_value(int), set_value(string) +// エラー完了 set_error(int) +struct MySender { + using sender_concept = ex::sender_t; + using completion_signatures = ex::completion_signatures< + ex::set_value_t(int), + ex::set_value_t(std::string), + ex::set_error_t(int) + >; + + template + struct state { + using operation_state_concept = ex::operation_state_t; + + state(Rcvr rcvr, int val) + : rcvr_{std::move(rcvr)}, val_{val} {} + + void start() noexcept { + using namespace std::string_literals; + switch (val_) { + case 1: + ex::set_value(std::move(rcvr_), 100); + break; + case 2: + ex::set_value(std::move(rcvr_), "C++"s); + break; + default: + ex::set_error(std::move(rcvr_), val_); + break; + } + } + + Rcvr rcvr_; + int val_; + }; + + template + auto connect(Rcvr rcvr) noexcept { + return state{std::move(rcvr), val_}; + } + + int val_; +}; + +int main() +{ + ex::sender auto snd1 = MySender{1}; + ex::sender auto snd2 = MySender{2}; + ex::sender auto sndr = ex::when_all_with_variant(snd1, snd2); + + auto result = std::this_thread::sync_wait(sndr); + // result := optional< + // tuple< + // variant, tuple>, + // variant, tuple> + // > + // >型 + + auto [val1, val2] = result.value(); + // val1,val2 := variant, tuple>型 + + struct DumpVal { + void operator()(std::tuple n) { + std::println("(int) {}", get<0>(n)); + } + void operator()(std::tuple s) { + std::println("(str) {}", get<0>(s)); + } + }; + std::visit(DumpVal{}, val1); + std::visit(DumpVal{}, val2); +} +``` +* ex::when_all_with_variant[color ff0000] +* ex::sender_t[link sender.md] +* ex::sender[link sender.md] +* ex::completion_signatures[link completion_signatures.md] +* ex::set_value_t[link set_value.md] +* ex::set_value[link set_value.md] +* ex::set_error_t[link set_error.md] +* ex::set_error[link set_error.md] +* ex::operation_state_t[link operation_state.md] +* std::this_thread::sync_wait[link ../this_thread/sync_wait.md] +* value()[link /reference/optional/optional/value.md] +* std::move[link /reference/utility/move.md] +* std::visit[link /reference/variant/visit.md] +* get<0>[link /reference/tuple/tuple/get.md] + +### 出力 +``` +(int) 100 +(str) C++ +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::when_all`](when_all.md) +- [`execution::into_variant`](into_variant.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) From 1fe8918bfff93e305e8a33cdfd52f11dfb7f665b Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 26 May 2025 16:38:51 +0900 Subject: [PATCH 1748/3948] =?UTF-8?q?count,=20find,=20search=5Fn=20:=20?= =?UTF-8?q?=E4=BE=8B=E3=81=AE=E3=82=A4=E3=83=86=E3=83=AC=E3=83=BC=E3=82=BF?= =?UTF-8?q?=E7=AF=84=E5=9B=B2=E3=83=9F=E3=82=B9=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/count.md | 4 ++-- reference/algorithm/find.md | 4 ++-- reference/algorithm/ranges_count.md | 2 +- reference/algorithm/ranges_find.md | 2 +- reference/algorithm/ranges_search_n.md | 2 +- reference/algorithm/search_n.md | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/reference/algorithm/count.md b/reference/algorithm/count.md index 8a9e8ba34a..c79512c963 100644 --- a/reference/algorithm/count.md +++ b/reference/algorithm/count.md @@ -60,8 +60,8 @@ namespace std { - (1), (2) : - C++26 : 引数として波カッコ初期化`{}`を受け付ける ```cpp - std::vector v; - int n = std::count(v.begin(), v.begin(), {a, b}); + std::vector v; + int n = std::count(v.begin(), v.end(), {a, b}); ``` ## 例 diff --git a/reference/algorithm/find.md b/reference/algorithm/find.md index 41aecc8385..2eb04c2dda 100644 --- a/reference/algorithm/find.md +++ b/reference/algorithm/find.md @@ -59,8 +59,8 @@ namespace std { - (1), (2) : - C++26 : 引数として波カッコ初期化`{}`を受け付ける ```cpp - std::vector v; - auto it = std::find(v.begin(), v.begin(), {a, b}); + std::vector v; + auto it = std::find(v.begin(), v.end(), {a, b}); ``` ## 例 diff --git a/reference/algorithm/ranges_count.md b/reference/algorithm/ranges_count.md index ef745e41ea..0c35048156 100644 --- a/reference/algorithm/ranges_count.md +++ b/reference/algorithm/ranges_count.md @@ -82,7 +82,7 @@ namespace std::ranges { - (1), (2) : - C++26 : 引数として波カッコ初期化`{}`を受け付ける ```cpp - std::vector v; + std::vector v; int n = std::ranges::count(v, {a, b}); ``` diff --git a/reference/algorithm/ranges_find.md b/reference/algorithm/ranges_find.md index bfb96b38ab..7f76d59763 100644 --- a/reference/algorithm/ranges_find.md +++ b/reference/algorithm/ranges_find.md @@ -73,7 +73,7 @@ namespace std::ranges { - (1), (2) : - C++26 : 引数として波カッコ初期化`{}`を受け付ける ```cpp - std::vector v; + std::vector v; auto it = std::ranges::find(r, {a, b}); ``` diff --git a/reference/algorithm/ranges_search_n.md b/reference/algorithm/ranges_search_n.md index 5d6bdd59f6..eef1aa2a11 100644 --- a/reference/algorithm/ranges_search_n.md +++ b/reference/algorithm/ranges_search_n.md @@ -89,7 +89,7 @@ namespace std::ranges { - (1), (2) : - C++26 : パラメータ`value`として波カッコ初期化`{}`を受け付ける ```cpp - std::vector v; + std::vector v; auto sr = std::ranges::search_n(v, 3, {a, b}); ``` diff --git a/reference/algorithm/search_n.md b/reference/algorithm/search_n.md index 0bae948605..14ed107278 100644 --- a/reference/algorithm/search_n.md +++ b/reference/algorithm/search_n.md @@ -136,8 +136,8 @@ namespace std { - (1), (2), (3), (4) : - C++26 : パラメータ`value`として波カッコ初期化`{}`を受け付ける ```cpp - std::vector v; - auto it = std::search_n(v.begin(), v.begin(), 3, {a, b}); + std::vector v; + auto it = std::search_n(v.begin(), v.end(), 3, {a, b}); ``` From 6fd6be3c90d60e1c9d013123ed17e08a375d5f95 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 26 May 2025 16:39:18 +0900 Subject: [PATCH 1749/3948] =?UTF-8?q?replace(=5Fif)=20:=20C++26=E6=B3=A2?= =?UTF-8?q?=E3=82=AB=E3=83=83=E3=82=B3=E5=88=9D=E6=9C=9F=E5=8C=96=E3=81=AB?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C=20#1311?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_replace.md | 91 ++++++++++++++++- reference/algorithm/ranges_replace_if.md | 2 + reference/algorithm/replace.md | 113 +++++++++++++++++---- reference/algorithm/replace_if.md | 122 +++++++++++++++++++---- 4 files changed, 286 insertions(+), 42 deletions(-) diff --git a/reference/algorithm/ranges_replace.md b/reference/algorithm/ranges_replace.md index 153da9cdef..f2c39e4e44 100644 --- a/reference/algorithm/ranges_replace.md +++ b/reference/algorithm/ranges_replace.md @@ -12,13 +12,34 @@ namespace std::ranges { class T2, class Proj = identity> requires indirectly_writable && - indirect_binary_predicate, const T1*> + indirect_binary_predicate< + ranges::equal_to + projected, + const T1* + > constexpr I replace(I first, S last, const T1& old_value, const T2& new_value, Proj proj = {}); // (1) C++20 + template S, + class Proj = identity, + class T1 = projected_value_t, + class T2 = T1> + requires indirectly_writable && + indirect_binary_predicate< + ranges::equal_to + projected, + const T1* + > + constexpr I + replace(I first, + S last, + const T1& old_value, + const T2& new_value, + Proj proj = {}); // (1) C++26 template , Proj>, + class T2 = T1> + requires indirectly_writable, const T2&> && + indirect_binary_predicate< + ranges::equal_to, + projected, Proj>, + const T1* + > + constexpr borrowed_iterator_t + replace(R&& r, + const T1& old_value, + const T2& new_value, + Proj proj = {}); // (2) C++26 } ``` * input_iterator[link /reference/iterator/input_iterator.md] @@ -67,7 +103,17 @@ namespace std::ranges { 正確に `last - first` 回の比較を行う +## 備考 +- (1), (2) : + - C++26 : 引数として波カッコ初期化`{}`を受け付ける + ```cpp + std::vector v; + int n = std::ranges::replace(v, {a, b}, {c, d}); + ``` + + ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -86,11 +132,50 @@ int main() { ``` * std::ranges::replace[color ff0000] -### 出力 +#### 出力 ``` 3,10,2,10,2, ``` +### 波カッコ初期化を入力として使用する (C++26) +```cpp example +#include +#include +#include + +struct Point { + int x; + int y; + + bool operator==(const Point& other) const = default; +}; + +int main() { + std::vector v = { + {1, 2}, + {3, 4}, + {5, 6}, + {1, 2}, + }; + + // 値が{1, 2}の要素をすべて{9, 9}に置き換える + std::ranges::replace(v, {1, 2}, {9, 9}); + + for (const Point& p : v) { + std::cout << p.x << ',' << p.y << std::endl; + } +} +``` +* std::ranges::replace[color ff0000] + +#### 出力 +``` +9,9 +3,4 +5,6 +9,9 +``` + ## バージョン ### 言語 - C++20 @@ -103,3 +188,5 @@ int main() { ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) + - C++26で波カッコ初期化 (リスト初期化) に対応した diff --git a/reference/algorithm/ranges_replace_if.md b/reference/algorithm/ranges_replace_if.md index 355979deb2..7d9b906d50 100644 --- a/reference/algorithm/ranges_replace_if.md +++ b/reference/algorithm/ranges_replace_if.md @@ -97,3 +97,5 @@ int main() { ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) + - C++26で波カッコ初期化 (リスト初期化) に対応した diff --git a/reference/algorithm/replace.md b/reference/algorithm/replace.md index 099e9ba72e..f42559ab8a 100644 --- a/reference/algorithm/replace.md +++ b/reference/algorithm/replace.md @@ -5,24 +5,46 @@ ```cpp namespace std { - template - void replace(ForwardIterator first, - ForwardIterator last, - const T& old_value, - const T& new_value); // (1) C++03 - - template - constexpr void replace(ForwardIterator first, - ForwardIterator last, - const T& old_value, - const T& new_value); // (1) C++20 - - template - void replace(ExecutionPolicy&& exec, - ForwardIterator first, - ForwardIterator last, - const T& old_value, - const T& new_value); // (2) C++17 + template + void + replace(ForwardIterator first, + ForwardIterator last, + const T& old_value, + const T& new_value); // (1) C++03 + template + constexpr void + replace(ForwardIterator first, + ForwardIterator last, + const T& old_value, + const T& new_value); // (1) C++20 + template ::value_type> + constexpr void + replace(ForwardIterator first, + ForwardIterator last, + const T& old_value, + const T& new_value); // (1) C++26 + + template + void + replace(ExecutionPolicy&& exec, + ForwardIterator first, + ForwardIterator last, + const T& old_value, + const T& new_value); // (2) C++17 + template ::value_type> + void + replace(ExecutionPolicy&& exec, + ForwardIterator first, + ForwardIterator last, + const T& old_value, + const T& new_value); // (2) C++26 } ``` @@ -30,7 +52,7 @@ namespace std { 指定された値と一致する要素を指定された値に置き換える。 -## 要件 +## 適格要件 `*first = new_value` という式が有効でなければならない。 @@ -42,7 +64,17 @@ namespace std { 正確に `last - first` 回の比較を行う +## 備考 +- (1), (2) : + - C++26 : 引数として波カッコ初期化`{}`を受け付ける + ```cpp + std::vector v; + int n = std::replace(v.begin(), v.end(), {a, b}, {c, d}); + ``` + + ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -60,11 +92,50 @@ int main() { ``` * std::replace[color ff0000] -### 出力 +#### 出力 ``` 3,10,2,10,2, ``` +### 波カッコ初期化を入力として使用する (C++26) +```cpp example +#include +#include +#include + +struct Point { + int x; + int y; + + bool operator==(const Point& other) const = default; +}; + +int main() { + std::vector v = { + {1, 2}, + {3, 4}, + {5, 6}, + {1, 2}, + }; + + // 値が{1, 2}の要素をすべて{9, 9}に置き換える + std::replace(v.begin(), v.end(), {1, 2}, {9, 9}); + + for (const Point& p : v) { + std::cout << p.x << ',' << p.y << std::endl; + } +} +``` +* std::replace[color ff0000] + +#### 出力 +``` +9,9 +3,4 +5,6 +9,9 +``` + ## 実装例 ```cpp @@ -80,3 +151,5 @@ void replace(ForwardIterator first, ForwardIterator last, ## 参照 - [P0202R3 Add Constexpr Modifiers to Functions in `` and `` Headers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0202r3.html) +- [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) + - C++26で波カッコ初期化 (リスト初期化) に対応した diff --git a/reference/algorithm/replace_if.md b/reference/algorithm/replace_if.md index 9bb02b88c6..1581d2576f 100644 --- a/reference/algorithm/replace_if.md +++ b/reference/algorithm/replace_if.md @@ -5,24 +5,51 @@ ```cpp namespace std { - template - void replace_if(ForwardIterator first, - ForwardIterator last, - Predicate pred, - const T& new_value); // (1) C++03 - - template - constexpr void replace_if(ForwardIterator first, - ForwardIterator last, - Predicate pred, - const T& new_value); // (1) C++20 - - template - void replace_if(ExecutionPolicy&& exec, - ForwardIterator first, - ForwardIterator last, - Predicate pred, - const T& new_value); // (2) C++17 + template + void + replace_if(ForwardIterator first, + ForwardIterator last, + Predicate pred, + const T& new_value); // (1) C++03 + template + constexpr void + replace_if(ForwardIterator first, + ForwardIterator last, + Predicate pred, + const T& new_value); // (1) C++20 + template ::value_type> + constexpr void + replace_if(ForwardIterator first, + ForwardIterator last, + Predicate pred, + const T& new_value); // (1) C++26 + + template + void + replace_if(ExecutionPolicy&& exec, + ForwardIterator first, + ForwardIterator last, + Predicate pred, + const T& new_value); // (2) C++17 + template ::value_type> + void + replace_if(ExecutionPolicy&& exec, + ForwardIterator first, + ForwardIterator last, + Predicate pred, + const T& new_value); // (2) C++26 } ``` @@ -30,7 +57,7 @@ namespace std { 条件を満たす要素を指定された値に置き換える。 -## 要件 +## 適格要件 `*first = new_value` という式が有効でなければならない。 @@ -42,7 +69,17 @@ namespace std { 正確に `last - first` 回の述語の適用を行う。 +## 備考 +- (1), (2) : + - C++26 : 引数として波カッコ初期化`{}`を受け付ける + ```cpp + std::vector v; + int n = std::replace_if(v.begin(), v.end(), pred, {a, b}); + ``` + + ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -61,11 +98,54 @@ int main() { ``` * std::replace_if[color ff0000] -### 出力 +#### 出力 ``` 10,10,2,10,2, ``` +### 波カッコ初期化を入力として使用する (C++26) +```cpp example +#include +#include +#include + +struct Point { + int x; + int y; + + bool operator==(const Point& other) const = default; +}; + +int main() { + std::vector v = { + {1, 2}, + {3, 4}, + {5, 6}, + {1, 2}, + }; + + // 値が{1, 2}の要素をすべて{9, 9}に置き換える + std::replace_if( + v.begin(), + v.end(), + [](const Point& p) { return p.x == 1 && p.y == 2; }, + {9, 9} + ); + + for (const Point& p : v) { + std::cout << p.x << ',' << p.y << std::endl; + } +} +``` +* std::replace_if[color ff0000] + +#### 出力 +``` +9,9 +3,4 +5,6 +9,9 +``` ## 実装例 ```cpp @@ -81,3 +161,5 @@ void replace_if(ForwardIterator first, ForwardIterator last, ## 参照 - [P0202R3 Add Constexpr Modifiers to Functions in `` and `` Headers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0202r3.html) +- [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) + - C++26で波カッコ初期化 (リスト初期化) に対応した From 06f6cd438792c30081c6cfda896321b57bdd2cb8 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 26 May 2025 16:46:24 +0900 Subject: [PATCH 1750/3948] =?UTF-8?q?replace=5Fif=20:=20=E5=82=99=E8=80=83?= =?UTF-8?q?=E6=9B=B8=E3=81=8D=E3=83=9F=E3=82=B9=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_replace_if.md | 10 ++++++++++ reference/algorithm/replace_if.md | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/reference/algorithm/ranges_replace_if.md b/reference/algorithm/ranges_replace_if.md index 7d9b906d50..aa5adae009 100644 --- a/reference/algorithm/ranges_replace_if.md +++ b/reference/algorithm/ranges_replace_if.md @@ -60,6 +60,16 @@ namespace std::ranges { 正確に `last - first` 回の述語の適用を行う。 +## 備考 +- (1), (2) : + - C++26 : 引数として波カッコ初期化`{}`を受け付ける + ```cpp + std::vector v; + int n = std::ranges::replace_if(v, pred, {a, b}); + ``` + + + ## 例 ```cpp example #include diff --git a/reference/algorithm/replace_if.md b/reference/algorithm/replace_if.md index 1581d2576f..2693e6be60 100644 --- a/reference/algorithm/replace_if.md +++ b/reference/algorithm/replace_if.md @@ -73,7 +73,7 @@ namespace std { - (1), (2) : - C++26 : 引数として波カッコ初期化`{}`を受け付ける ```cpp - std::vector v; + std::vector v; int n = std::replace_if(v.begin(), v.end(), pred, {a, b}); ``` From 977a82a33931d84a397af55f0a6b5624ba55a8ad Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 26 May 2025 16:48:35 +0900 Subject: [PATCH 1751/3948] =?UTF-8?q?replace(=5Fif)=20:=20=E4=BE=8B?= =?UTF-8?q?=E3=81=AE=E3=83=9F=E3=82=B9=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_replace.md | 4 ++-- reference/algorithm/ranges_replace_if.md | 2 +- reference/algorithm/replace.md | 4 ++-- reference/algorithm/replace_if.md | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/reference/algorithm/ranges_replace.md b/reference/algorithm/ranges_replace.md index f2c39e4e44..f83d97540a 100644 --- a/reference/algorithm/ranges_replace.md +++ b/reference/algorithm/ranges_replace.md @@ -107,8 +107,8 @@ namespace std::ranges { - (1), (2) : - C++26 : 引数として波カッコ初期化`{}`を受け付ける ```cpp - std::vector v; - int n = std::ranges::replace(v, {a, b}, {c, d}); + std::vector v; + std::ranges::replace(v, {a, b}, {c, d}); ``` diff --git a/reference/algorithm/ranges_replace_if.md b/reference/algorithm/ranges_replace_if.md index aa5adae009..1534c562e7 100644 --- a/reference/algorithm/ranges_replace_if.md +++ b/reference/algorithm/ranges_replace_if.md @@ -65,7 +65,7 @@ namespace std::ranges { - C++26 : 引数として波カッコ初期化`{}`を受け付ける ```cpp std::vector v; - int n = std::ranges::replace_if(v, pred, {a, b}); + std::ranges::replace_if(v, pred, {a, b}); ``` diff --git a/reference/algorithm/replace.md b/reference/algorithm/replace.md index f42559ab8a..a53b7d086d 100644 --- a/reference/algorithm/replace.md +++ b/reference/algorithm/replace.md @@ -68,8 +68,8 @@ namespace std { - (1), (2) : - C++26 : 引数として波カッコ初期化`{}`を受け付ける ```cpp - std::vector v; - int n = std::replace(v.begin(), v.end(), {a, b}, {c, d}); + std::vector v; + std::replace(v.begin(), v.end(), {a, b}, {c, d}); ``` diff --git a/reference/algorithm/replace_if.md b/reference/algorithm/replace_if.md index 2693e6be60..b0eabae70c 100644 --- a/reference/algorithm/replace_if.md +++ b/reference/algorithm/replace_if.md @@ -74,7 +74,7 @@ namespace std { - C++26 : 引数として波カッコ初期化`{}`を受け付ける ```cpp std::vector v; - int n = std::replace_if(v.begin(), v.end(), pred, {a, b}); + std::replace_if(v.begin(), v.end(), pred, {a, b}); ``` From 4c8f46515766f4d4dab7f34ad65e0675ce966c37 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 26 May 2025 17:12:34 +0900 Subject: [PATCH 1752/3948] =?UTF-8?q?replace=5Fcopy(=5Fif)=20:=20C++26?= =?UTF-8?q?=E6=B3=A2=E3=82=AB=E3=83=83=E3=82=B3=E5=88=9D=E6=9C=9F=E5=8C=96?= =?UTF-8?q?=E3=81=AB=E5=AF=BE=E5=BF=9C=20#1311?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_replace_copy.md | 100 +++++++++++++++++- reference/algorithm/ranges_replace_copy_if.md | 95 ++++++++++++++++- reference/algorithm/replace_copy_if.md | 88 ++++++++++++++- 3 files changed, 275 insertions(+), 8 deletions(-) diff --git a/reference/algorithm/ranges_replace_copy.md b/reference/algorithm/ranges_replace_copy.md index 108231a708..fc6c6e3f6f 100644 --- a/reference/algorithm/ranges_replace_copy.md +++ b/reference/algorithm/ranges_replace_copy.md @@ -25,6 +25,25 @@ namespace std::ranges { const T1& old_value, const T2& new_value, Proj proj = {}); // (1) C++20 + template S, + class O, + class Proj = identity, + class T1 = projected_value_t, + class T2 = iter_value_t> + requires indirectly_copyable && + indirect_binary_predicate< + ranges::equal_to, + projected, + const T1* + > + constexpr replace_copy_result + replace_copy(I first, + S last, + O result, + const T1& old_value, + const T2& new_value, + Proj proj = {}); // (1) C++26 template , Proj>, const T1* - > + > && + output_iterator constexpr replace_copy_result, O> replace_copy(R&& r, O result, const T1& old_value, const T2& new_value, Proj proj = {}); // (2) C++20 + template , Proj>, + class T2 = iter_value_t> + requires indirectly_copyable, O> && + indirect_binary_predicate< + ranges::equal_to, + projected, Proj>, + const T1* + > && + output_iterator + constexpr replace_copy_result, O> + replace_copy(R&& r, + O result, + const T1& old_value, + const T2& new_value, + Proj proj = {}); // (2) C++26 } ``` * input_iterator[link /reference/iterator/input_iterator.md] @@ -80,7 +118,17 @@ namespace std::ranges { 正確に `last - first` 回の比較を行う +## 備考 +- (1), (2) : + - C++26 : 引数として波カッコ初期化`{}`を受け付ける + ```cpp + std::vector v; + std::ranges::replace_copy_if(v, result, {a, b}, {c, d}); + ``` + + ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -96,11 +144,57 @@ int main() { ``` * std::ranges::replace_copy[color ff0000] -### 出力 +#### 出力 ``` 3,10,2,10,2, ``` +### 波カッコ初期化を入力として使用する (C++26) +```cpp example +#include +#include +#include +#include + +struct Point { + int x; + int y; + + bool operator==(const Point& other) const = default; +}; + +std::ostream& operator<<(std::ostream& os, const Point& p) { + return os << p.x << ',' << p.y << std::endl; +} + +int main() { + std::vector v = { + {1, 2}, + {3, 4}, + {5, 6}, + {1, 2}, + }; + + // 値が{1, 2}の要素をすべて{9, 9}に置き換えたものを出力する + std::replace_copy( + v.begin(), + v.end(), + std::ostream_iterator(std::cout, "\n"), + {1, 2}, + {9, 9} + ); +} +``` +* std::ranges::replace_copy[color ff0000] + +#### 出力 +``` +9,9 +3,4 +5,6 +9,9 +``` + ## バージョン ### 言語 - C++20 @@ -113,3 +207,5 @@ int main() { ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) + - C++26で波カッコ初期化 (リスト初期化) に対応した diff --git a/reference/algorithm/ranges_replace_copy_if.md b/reference/algorithm/ranges_replace_copy_if.md index 3d6e5bbe14..75cd002563 100644 --- a/reference/algorithm/ranges_replace_copy_if.md +++ b/reference/algorithm/ranges_replace_copy_if.md @@ -20,6 +20,22 @@ namespace std::ranges { Pred pred, const T& new_value, Proj proj = {}); // (1) C++20 + template S, + class O, + class T = iter_value_t, + class Proj = identity, + indirect_unary_predicate> Pred> + requires + indirectly_copyable && + output_iterator + constexpr replace_copy_if_result + replace_copy_if(I first, + S last, + O result, + Pred pred, + const T& new_value, + Proj proj = {}); // (1) C++26 template , + class Proj = identity, + indirect_unary_predicate, Proj>> Pred> + requires + indirectly_copyable, O> && + output_iterator + constexpr replace_copy_if_result, O> + replace_copy_if(R&& r, + O result, + Pred pred, + const T& new_value, + Proj proj = {}); // (2) C++26 } ``` * input_iterator[link /reference/iterator/input_iterator.md] @@ -69,7 +99,17 @@ namespace std::ranges { 正確に `last - first` 回の述語の適用を行う +## 備考 +- (1), (2) : + - C++26 : 引数として波カッコ初期化`{}`を受け付ける + ```cpp + std::vector v; + std::ranges::replace_copy_if(v, result, pred, {a, b}); + ``` + + ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -80,16 +120,65 @@ int main() { std::vector v = { 3,1,2,1,2 }; // 奇数の要素を全部 10 に置き換えたものを出力する - std::ranges::replace_copy_if(v, std::ostream_iterator(std::cout, ","), [](int x) { return x%2 != 0; }, 10); + std::ranges::replace_copy_if( + v, + std::ostream_iterator(std::cout, ","), + [](int x) { return x%2 != 0; }, + 10 + ); } ``` * std::ranges::replace_copy_if[color ff0000] -### 出力 +#### 出力 ``` 10,10,2,10,2, ``` +### 波カッコ初期化を入力として使用する (C++26) +```cpp example +#include +#include +#include +#include + +struct Point { + int x; + int y; + + bool operator==(const Point& other) const = default; +}; + +std::ostream& operator<<(std::ostream& os, const Point& p) { + return os << p.x << ',' << p.y << std::endl; +} + +int main() { + std::vector v = { + {1, 2}, + {3, 4}, + {5, 6}, + {1, 2}, + }; + + // 値が{1, 2}の要素をすべて{9, 9}に置き換えたものを出力する + std::ranges::replace_copy_if( + v, + std::ostream_iterator(std::cout, "\n"), + [](const Point& p) { return p.x == 1 && p.y == 2; }, + {9, 9} + ); +} +``` +* std::ranges::replace_copy_if[color ff0000] + +#### 出力 +``` +9,9 +3,4 +5,6 +9,9 +``` ## バージョン ### 言語 @@ -103,3 +192,5 @@ int main() { ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) + - C++26で波カッコ初期化 (リスト初期化) に対応した diff --git a/reference/algorithm/replace_copy_if.md b/reference/algorithm/replace_copy_if.md index 82635adc8e..afcf0e6421 100644 --- a/reference/algorithm/replace_copy_if.md +++ b/reference/algorithm/replace_copy_if.md @@ -15,7 +15,6 @@ namespace std { OutputIterator result, Predicate pred, const T& new_value); // (1) C++03 - template ::value_type> + constexpr OutputIterator + replace_copy_if(InputIterator first, + InputIterator last, + OutputIterator result, + Predicate pred, + const T& new_value); // (1) C++26 template + class Predicate, + class T> ForwardIterator2 replace_copy_if(ExecutionPolicy&& exec, ForwardIterator1 first, @@ -38,6 +48,18 @@ namespace std { ForwardIterator2 result, Predicate pred, const T& new_value); // (2) C++17 + template ::value_type> + ForwardIterator2 + replace_copy_if(ExecutionPolicy&& exec, + ForwardIterator1 first, + ForwardIterator1 last, + ForwardIterator2 result, + Predicate pred, + const T& new_value); // (2) C++26 } ``` @@ -45,7 +67,7 @@ namespace std { イテレータ範囲`[first, last)`のうち、条件を満たす要素を指定された値に置き換え、その結果を出力の範囲へコピーする。 -## テンプレートパラメータ制約 +## 適格要件 - `*first` と `new_value` は `result` へ書き込み可能であること @@ -65,7 +87,17 @@ namespace std { 正確に `last - first` 回の述語の適用を行う +## 備考 +- (1), (2) : + - C++26 : 引数として波カッコ初期化`{}`を受け付ける + ```cpp + std::vector v; + std::replace_copy_if(v.begin(), v.end(), result, pred, {a, b}); + ``` + + ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -83,11 +115,57 @@ int main() { ``` * std::replace_copy_if[color ff0000] -### 出力 +#### 出力 ``` 10,10,2,10,2, ``` +### 波カッコ初期化を入力として使用する (C++26) +```cpp example +#include +#include +#include +#include + +struct Point { + int x; + int y; + + bool operator==(const Point& other) const = default; +}; + +std::ostream& operator<<(std::ostream& os, const Point& p) { + return os << p.x << ',' << p.y << std::endl; +} + +int main() { + std::vector v = { + {1, 2}, + {3, 4}, + {5, 6}, + {1, 2}, + }; + + // 値が{1, 2}の要素をすべて{9, 9}に置き換えたものを出力する + std::replace_copy_if( + v.begin(), + v.end(), + std::ostream_iterator(std::cout, "\n"), + [](const Point& p) { return p.x == 1 && p.y == 2; }, + {9, 9} + ); +} +``` +* std::replace_copy_if[color ff0000] + +#### 出力 +``` +9,9 +3,4 +5,6 +9,9 +``` + ## 実装例 ```cpp template @@ -103,3 +181,5 @@ OutputIterator replace_copy_if(InputIterator first, InputIterator last, OutputIt ## 参照 - [P0202R3 Add Constexpr Modifiers to Functions in `` and `` Headers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0202r3.html) - [P0467R2 Iterator Concerns for Parallel Algorithms](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0467r2.html) +- [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) + - C++26で波カッコ初期化 (リスト初期化) に対応した From a2bacbe63b0c1af074a06d1dbfca46289ab492d3 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 26 May 2025 17:15:23 +0900 Subject: [PATCH 1753/3948] =?UTF-8?q?ranges::replace=5Fcopy=20:=20?= =?UTF-8?q?=E3=82=B5=E3=83=B3=E3=83=97=E3=83=AB=E3=82=B3=E3=83=BC=E3=83=89?= =?UTF-8?q?=E3=81=AE=E3=83=9F=E3=82=B9=E3=82=92=E4=BF=AE=E6=AD=A3=20#1311?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_replace_copy.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/reference/algorithm/ranges_replace_copy.md b/reference/algorithm/ranges_replace_copy.md index fc6c6e3f6f..9630d53bd8 100644 --- a/reference/algorithm/ranges_replace_copy.md +++ b/reference/algorithm/ranges_replace_copy.md @@ -123,7 +123,7 @@ namespace std::ranges { - C++26 : 引数として波カッコ初期化`{}`を受け付ける ```cpp std::vector v; - std::ranges::replace_copy_if(v, result, {a, b}, {c, d}); + std::ranges::replace_copy(v, result, {a, b}, {c, d}); ``` @@ -176,9 +176,8 @@ int main() { }; // 値が{1, 2}の要素をすべて{9, 9}に置き換えたものを出力する - std::replace_copy( - v.begin(), - v.end(), + std::ranges::replace_copy( + v, std::ostream_iterator(std::cout, "\n"), {1, 2}, {9, 9} From 319fdf9e7686cad754111f1a91b35f9c965273b3 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 26 May 2025 18:30:02 +0900 Subject: [PATCH 1754/3948] =?UTF-8?q?algorithm/fill=20:=20C++26=E6=B3=A2?= =?UTF-8?q?=E3=82=AB=E3=83=83=E3=82=B3=E5=88=9D=E6=9C=9F=E5=8C=96=E3=81=AB?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C=20#1311?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/fill.md | 99 +++++++++++++++++++++++++----- reference/algorithm/ranges_fill.md | 60 +++++++++++++++++- 2 files changed, 140 insertions(+), 19 deletions(-) diff --git a/reference/algorithm/fill.md b/reference/algorithm/fill.md index d37db4a8ee..4828c5f282 100644 --- a/reference/algorithm/fill.md +++ b/reference/algorithm/fill.md @@ -5,22 +5,41 @@ ```cpp namespace std { - template - void fill(ForwardIterator first, - ForwardIterator last, - const T& value); // (1) C++03 - - template - constexpr void fill(ForwardIterator first, - ForwardIterator last, - const T& value); // (1) C++20 - - template + void + fill(ForwardIterator first, + ForwardIterator last, + const T& value); // (1) C++03 + template - void fill(ExecutionPolicy&& exec, - ForwardIterator first, - ForwardIterator last, - const T& value); // (2) C++17 + constexpr void + fill(ForwardIterator first, + ForwardIterator last, + const T& value); // (1) C++20 + template ::value_type> + constexpr void + fill(ForwardIterator first, + ForwardIterator last, + const T& value); // (1) C++20 + + template + void + fill(ExecutionPolicy&& exec, + ForwardIterator first, + ForwardIterator last, + const T& value); // (2) C++17 + template ::value_type> + void + fill(ExecutionPolicy&& exec, + ForwardIterator first, + ForwardIterator last, + const T& value); // (2) C++26 } ``` @@ -28,7 +47,7 @@ namespace std { イテレータ範囲`[first, last)`のすべての要素に指定された値を書き込む。 -## 要件 +## 適格要件 `value` は `output iterator` へ書き込み可能でなければならない @@ -40,7 +59,17 @@ namespace std { 正確に `last - first` 回の代入を行う +## 備考 +- (1), (2) : + - C++26 : 引数として波カッコ初期化`{}`を受け付ける + ```cpp + std::vector v; + std::fill(v.begin(), v.end(), {a, b}); + ``` + + ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -57,11 +86,45 @@ int main() { ``` * std::fill[color ff0000] -### 出力 +#### 出力 ``` 3,3,3,3,3, ``` +### 波カッコ初期化を入力として使用する (C++26) +```cpp example +#include +#include +#include + +struct Point { + int x; + int y; + + bool operator==(const Point& other) const = default; +}; + +int main() { + std::vector v(5); + + std::fill(v.begin(), v.end(), {1, 2}); + + for (const Point& p : v) { + std::cout << p.x << "," << p.y << std::endl; + } +} +``` +* std::fill[color ff0000] + +#### 出力 +``` +1,2 +1,2 +1,2 +1,2 +1,2 +``` + ## 実装例 ```cpp @@ -75,3 +138,5 @@ void fill(ForwardIterator first, ForwardIterator last, const T& value) { ## 参照 - [P0202R3 Add Constexpr Modifiers to Functions in `` and `` Headers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0202r3.html) +- [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) + - C++26で波カッコ初期化 (リスト初期化) に対応した diff --git a/reference/algorithm/ranges_fill.md b/reference/algorithm/ranges_fill.md index 4726a288fc..2b28d0a90c 100644 --- a/reference/algorithm/ranges_fill.md +++ b/reference/algorithm/ranges_fill.md @@ -11,12 +11,22 @@ namespace std::ranges { sentinel_for S> constexpr O fill(O first, S last, const T& value); // (1) C++20 + template S, + class T = iter_value_t> + requires output_iterator + constexpr O + fill(O first, S last, const T& value); // (1) C++26 template R> constexpr borrowed_iterator_t fill(R&& r, const T& value); // (2) C++20 - + template > + requires output_range + constexpr borrowed_iterator_t + fill(R&& r, const T& value); // (2) C++26 } ``` * output_iterator[link /reference/iterator/output_iterator.md] @@ -43,7 +53,17 @@ namespace std::ranges { 正確に `last - first` 回の代入を行う +## 備考 +- (1), (2) : + - C++26 : 引数として波カッコ初期化`{}`を受け付ける + ```cpp + std::vector v; + std::ranges::fill(v, {a, b}); + ``` + + ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -62,11 +82,45 @@ int main() { ``` * std::ranges::fill[color ff0000] -### 出力 +#### 出力 ``` 3,3,3,3,3, ``` +### 波カッコ初期化を入力として使用する (C++26) +```cpp example +#include +#include +#include + +struct Point { + int x; + int y; + + bool operator==(const Point& other) const = default; +}; + +int main() { + std::vector v(5); + + std::ranges::fill(v.begin(), v.end(), {1, 2}); + + for (const Point& p : v) { + std::cout << p.x << "," << p.y << std::endl; + } +} +``` +* std::ranges::fill[color ff0000] + +#### 出力 +``` +1,2 +1,2 +1,2 +1,2 +1,2 +``` + ## バージョン ### 言語 - C++20 @@ -79,3 +133,5 @@ int main() { ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) + - C++26で波カッコ初期化 (リスト初期化) に対応した From e463c2f1b30245bf44d5d57c3eaa3cfb0e5dbb9a Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 26 May 2025 18:42:51 +0900 Subject: [PATCH 1755/3948] =?UTF-8?q?algorithm/fill=5Fn=20:=20C++26?= =?UTF-8?q?=E6=B3=A2=E3=82=AB=E3=83=83=E3=82=B3=E5=88=9D=E6=9C=9F=E5=8C=96?= =?UTF-8?q?=E3=81=AB=E5=AF=BE=E5=BF=9C=20#1311?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/fill_n.md | 89 ++++++++++++++++++++++++---- reference/algorithm/ranges_fill_n.md | 65 ++++++++++++++++++-- 2 files changed, 140 insertions(+), 14 deletions(-) diff --git a/reference/algorithm/fill_n.md b/reference/algorithm/fill_n.md index d737860ca2..d79e725d8c 100644 --- a/reference/algorithm/fill_n.md +++ b/reference/algorithm/fill_n.md @@ -5,31 +5,53 @@ ```cpp namespace std { - template + template void fill_n(OutputIterator first, Size n, const T& value); // (1) C++03 - - template + template OutputIterator fill_n(OutputIterator first, Size n, const T& value); // (1) C++11 - - template + template constexpr OutputIterator fill_n(OutputIterator first, Size n, const T& value); // (1) C++20 + template ::value_type> + constexpr OutputIterator + fill_n(OutputIterator first, + Size n, + const T& value); // (1) C++26 - template + template ForwardIterator fill_n(ExecutionPolicy&& exec, ForwardIterator first, Size n, const T& value); // (2) C++17 + template ::value_type> + ForwardIterator + fill_n(ExecutionPolicy&& exec, + ForwardIterator first, + Size n, + const T& value); // (2) C++26 } ``` @@ -37,7 +59,7 @@ namespace std { イテレータ範囲`[first, first + n)`のすべての要素に指定された値を書き込む。 -## 要件 +## 適格要件 - `value` は `output iterator` へ書き込み可能でなければならない。 - `Size` は `integral type` に変換可能でなければならない。 @@ -57,24 +79,69 @@ namespace std { `n` が 1 以上の場合は `n` 回、そうでない場合は 0 回の代入を行う。 +## 備考 +- (1), (2) : + - C++26 : `value`パラメータとして波カッコ初期化`{}`を受け付ける + ```cpp + std::vector v; + std::fill_n(v.begin(), n, {a, b}); + ``` + + ## 例 +### 基本的な使い方 ```cpp example #include #include #include int main() { - // 3 を出力しまくる + // 値3を10個出力する std::fill_n(std::ostream_iterator(std::cout, ","), 10, 3); } ``` * std::fill_n[color ff0000] -### 出力 +#### 出力 ``` 3,3,3,3,3,3,3,3,3,3, ``` +### 波カッコ初期化を入力として使用する (C++26) +```cpp example +#include +#include +#include + +struct Point { + int x; + int y; + + bool operator==(const Point& other) const = default; +}; + +int main() { + std::vector v(5); + + // 先頭3個の要素を値{1, 2}で埋める + std::fill_n(v.begin(), 3, {1, 2}); + + for (const Point& p : v) { + std::cout << p.x << "," << p.y << std::endl; + } +} +``` +* std::fill_n[color ff0000] + +#### 出力 +``` +1,2 +1,2 +1,2 +0,0 +0,0 +``` + ## 実装例 ```cpp @@ -107,3 +174,5 @@ fill_n(OutputIterator first, Size n, const T& value) { 戻り値が追加されるきっかけとなったレポート - [P0202R3 Add Constexpr Modifiers to Functions in `` and `` Headers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0202r3.html) - [P0467R2 Iterator Concerns for Parallel Algorithms](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0467r2.html) +- [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) + - C++26で波カッコ初期化 (リスト初期化) に対応した diff --git a/reference/algorithm/ranges_fill_n.md b/reference/algorithm/ranges_fill_n.md index 4ccd268ed8..6a89db71ca 100644 --- a/reference/algorithm/ranges_fill_n.md +++ b/reference/algorithm/ranges_fill_n.md @@ -6,9 +6,19 @@ ```cpp namespace std::ranges { - template O> + template O> constexpr O - fill_n(O first, iter_difference_t n, const T& value); // (1) C++20 + fill_n(O first, + iter_difference_t n, + const T& value); // (1) C++20 + template > + requires output_iterator + constexpr O + fill_n(O first, + iter_difference_t n, + const T& value); // (1) C++26 } ``` * output_iterator[link /reference/iterator/output_iterator.md] @@ -30,24 +40,69 @@ namespace std::ranges { `n` が 1 以上の場合は `n` 回、そうでない場合は 0 回の代入を行う。 +## 備考 +- (1) : + - C++26 : `value`パラメータとして波カッコ初期化`{}`を受け付ける + ```cpp + std::vector v; + std::ranges::fill_n(v.begin(), n, {a, b}); + ``` + + ## 例 +### 基本的な使い方 ```cpp example #include #include #include int main() { - // 3 を10回出力する + // 値3を10個出力する std::ranges::fill_n(std::ostream_iterator(std::cout, ","), 10, 3); } ``` * std::ranges::fill_n[color ff0000] -### 出力 +#### 出力 ``` 3,3,3,3,3,3,3,3,3,3, ``` +### 波カッコ初期化を入力として使用する (C++26) +```cpp example +#include +#include +#include + +struct Point { + int x; + int y; + + bool operator==(const Point& other) const = default; +}; + +int main() { + std::vector v(5); + + // 先頭3個の要素を値{1, 2}で埋める + std::ranges::fill_n(v.begin(), 3, {1, 2}); + + for (const Point& p : v) { + std::cout << p.x << "," << p.y << std::endl; + } +} +``` +* std::ranges::fill_n[color ff0000] + +#### 出力 +``` +1,2 +1,2 +1,2 +0,0 +0,0 +``` + ## バージョン ### 言語 @@ -61,3 +116,5 @@ int main() { ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) + - C++26で波カッコ初期化 (リスト初期化) に対応した From b810699ddaff07d777dd421a8600be32cb5df601 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 26 May 2025 19:08:03 +0900 Subject: [PATCH 1756/3948] =?UTF-8?q?algorithm/remove=20:=20C++26=E6=B3=A2?= =?UTF-8?q?=E3=82=AB=E3=83=83=E3=82=B3=E5=88=9D=E6=9C=9F=E5=8C=96=E3=81=AB?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C=20#1311?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_remove.md | 81 +++++++++++++++++++++++++-- reference/algorithm/remove.md | 82 +++++++++++++++++++++++++--- 2 files changed, 149 insertions(+), 14 deletions(-) diff --git a/reference/algorithm/ranges_remove.md b/reference/algorithm/ranges_remove.md index 515d892479..5a3564710e 100644 --- a/reference/algorithm/ranges_remove.md +++ b/reference/algorithm/ranges_remove.md @@ -16,6 +16,16 @@ namespace std::ranges { S last, const T& value, Proj proj = {}); // (1) C++20 + template S, + class Proj = identity, + class T = projected_value_t> + requires indirect_binary_predicate, const T*> + constexpr subrange + remove(I first, + S last, + const T& value, + Proj proj = {}); // (1) C++26 template , Proj>> + requires permutable> && + indirect_binary_predicate< + ranges::equal_to, + projected, Proj>, + const T* + > + constexpr borrowed_subrange_t + remove(R&& r, + const T& value, + Proj proj = {}); // (2) C++26 } ``` * permutable[link /reference/iterator/permutable.md] @@ -67,12 +90,18 @@ namespace std::ranges { ## 備考 -有効な要素を範囲の前方に集める処理には、ムーブを使用する。 - -取り除いた要素の先頭を指すイテレータを`ret`とし、範囲`[ret, last)`の各要素には、有効な要素からムーブされた値が設定される。それらの値は、「有効だが未規定な値」となる。 +- 有効な要素を範囲の前方に集める処理には、ムーブが使用される + - 取り除いた要素の先頭を指すイテレータを`ret`とし、範囲`[ret, last)`の各要素には、有効な要素からムーブされた値が設定される。それらの値は、「有効だが未規定な値」となる +- (1), (2) : + - C++26 : 引数として波カッコ初期化`{}`を受け付ける + ```cpp + std::vector v; + auto sr = std::ranges::remove(v, {a, b}); + ``` ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -101,17 +130,57 @@ int main() { ``` * result[color ff0000] * std::ranges::remove[color ff0000] -* v.erase[color ff0000][link /reference/vector/vector/erase.md] +* v.erase[link /reference/vector/vector/erase.md] * std::ranges::subrange[link /reference/ranges/subrange.md] * Erase-remove イディオム[link https://ja.wikibooks.org/wiki/More_C%2B%2B_Idioms/%E6%B6%88%E5%8E%BB%E3%83%BB%E5%89%8A%E9%99%A4(Erase-Remove)] -### 出力 +#### 出力 ``` 2,3,2, size before: 5 size after: 3 ``` +### 波カッコ初期化を入力として使用する (C++26) +```cpp example +#include +#include +#include + +struct Point { + int x; + int y; + + bool operator==(const Point& other) const = default; +}; + +int main() { + std::vector v = { + {1, 2}, + {3, 4}, + {5, 6}, + {1, 2}, + }; + + // 値{1, 2}を除去する + std::ranges::subrange sr = std::ranges::remove(v, {1, 2}); + v.erase(sr.begin(), v.end()); + + for (const Point& p : v) { + std::cout << p.x << "," << p.y << std::endl; + } +} +``` +* std::ranges::remove[color ff0000] +* v.erase[link /reference/vector/vector/erase.md] +* std::ranges::subrange[link /reference/ranges/subrange.md] + +#### 出力 +``` +3,4 +5,6 +``` + ## バージョン ### 言語 - C++20 @@ -124,3 +193,5 @@ size after: 3 ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) + - C++26で波カッコ初期化 (リスト初期化) に対応した diff --git a/reference/algorithm/remove.md b/reference/algorithm/remove.md index fbbca82699..425eb88945 100644 --- a/reference/algorithm/remove.md +++ b/reference/algorithm/remove.md @@ -5,24 +5,41 @@ ```cpp namespace std { - template + template ForwardIterator remove(ForwardIterator first, ForwardIterator last, const T& value); // (1) C++03 - - template + template constexpr ForwardIterator remove(ForwardIterator first, ForwardIterator last, const T& value); // (1) C++20 + template ::value_type> + constexpr ForwardIterator + remove(ForwardIterator first, + ForwardIterator last, + const T& value); // (1) C++26 - template + template ForwardIterator remove(ExecutionPolicy&& exec, ForwardIterator first, ForwardIterator last, const T& value); // (2) C++17 + template ::value_type> + ForwardIterator + remove(ExecutionPolicy&& exec, + ForwardIterator first, + ForwardIterator last, + const T& value); // (2) C++26 } ``` @@ -51,12 +68,18 @@ namespace std { ## 備考 -有効な要素を範囲の前方に集める処理には、ムーブを使用する。 - -取り除いた要素の先頭を指すイテレータを`ret`とし、範囲`[ret, last)`の各要素には、有効な要素からムーブされた値が設定される。それらの値は、「有効だが未規定な値」となる。 +- 有効な要素を範囲の前方に集める処理には、ムーブが使用される + - 取り除いた要素の先頭を指すイテレータを`ret`とし、範囲`[ret, last)`の各要素には、有効な要素からムーブされた値が設定される。それらの値は、「有効だが未規定な値」となる +- (1), (2) : + - C++26 : 引数として波カッコ初期化`{}`を受け付ける + ```cpp + std::vector v; + auto it = std::remove(v.begin(), v.end(), {a, b}); + ``` ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -83,16 +106,55 @@ int main() { ``` * result[color ff0000] * std::remove[color ff0000] -* v.erase[color ff0000][link /reference/vector/vector/erase.md] +* v.erase[link /reference/vector/vector/erase.md] * Erase-remove イディオム[link https://ja.wikibooks.org/wiki/More_C%2B%2B_Idioms/%E6%B6%88%E5%8E%BB%E3%83%BB%E5%89%8A%E9%99%A4(Erase-Remove)] -### 出力 +#### 出力 ``` 2,3,2, size before: 5 size after: 3 ``` +### 波カッコ初期化を入力として使用する (C++26) +```cpp example +#include +#include +#include + +struct Point { + int x; + int y; + + bool operator==(const Point& other) const = default; +}; + +int main() { + std::vector v = { + {1, 2}, + {3, 4}, + {5, 6}, + {1, 2}, + }; + + // 値{1, 2}を除去する + auto it = std::remove(v.begin(), v.end(), {1, 2}); + v.erase(it, v.end()); + + for (const Point& p : v) { + std::cout << p.x << "," << p.y << std::endl; + } +} +``` +* std::remove[color ff0000] +* v.erase[link /reference/vector/vector/erase.md] + +#### 出力 +``` +3,4 +5,6 +``` + ## 実装例 ```cpp @@ -113,3 +175,5 @@ ForwardIterator remove(ForwardIterator first, ForwardIterator last, const T& val - [LWG Issue 2110. `remove` can't swap but note says it might](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2110) - C++11までのこのアルゴリズムは、要素の移動にswap操作が行われるかもしれない、と書いていた。だが、このアルゴリズムの要件は`MoveAssignable`のみであるため、swapはできない。そのため、C++14からは、ムーブのみで要素の移動が行われるようになった。 - [P0202R3 Add Constexpr Modifiers to Functions in `` and `` Headers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0202r3.html) +- [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) + - C++26で波カッコ初期化 (リスト初期化) に対応した From 2a7fe576da66585d24834cd22a9b89e97a3849c6 Mon Sep 17 00:00:00 2001 From: koki watanabe Date: Mon, 26 May 2025 23:17:33 +0900 Subject: [PATCH 1757/3948] =?UTF-8?q?fix:=20=E7=A0=B4=E6=A3=84->=E5=88=9D?= =?UTF-8?q?=E6=9C=9F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/unordered_map/unordered_map/clear.md | 2 +- reference/unordered_map/unordered_multimap/clear.md | 2 +- reference/unordered_set/unordered_multiset/clear.md | 2 +- reference/unordered_set/unordered_set/clear.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/unordered_map/unordered_map/clear.md b/reference/unordered_map/unordered_map/clear.md index 07aa45df0b..0409a9a652 100644 --- a/reference/unordered_map/unordered_map/clear.md +++ b/reference/unordered_map/unordered_map/clear.md @@ -49,7 +49,7 @@ s.swap(tmp); ### 計算量に関する備考 - 多くの実装(GCC libstdc++, LLVM libc++ など)は 1. 全ての要素を破棄する - 2. 全てのバケットを順に走査して各バケットを破棄 + 2. 全てのバケットを順に走査して各バケットを初期化 という手順を取るため、実行時間は概ね [`bucket_count`](bucket_count.md)`()` + [`size`](size.md)`()` に比例する傾向がある。 これは規格が定義する「計算量」(オブジェクトに対する操作の数)とは別物である。 diff --git a/reference/unordered_map/unordered_multimap/clear.md b/reference/unordered_map/unordered_multimap/clear.md index b4fcf646e9..8b1f9a7bec 100644 --- a/reference/unordered_map/unordered_multimap/clear.md +++ b/reference/unordered_map/unordered_multimap/clear.md @@ -49,7 +49,7 @@ s.swap(tmp); ### 計算量に関する備考 - 多くの実装(GCC libstdc++, LLVM libc++ など)は 1. 全ての要素を破棄する - 2. 全てのバケットを順に走査して各バケットを破棄 + 2. 全てのバケットを順に走査して各バケットを初期化 という手順を取るため、実行時間は概ね [`bucket_count`](bucket_count.md)`()` + [`size`](size.md)`()` に比例する傾向がある。 これは規格が定義する「計算量」(オブジェクトに対する操作の数)とは別物である。 diff --git a/reference/unordered_set/unordered_multiset/clear.md b/reference/unordered_set/unordered_multiset/clear.md index 73a6c20d51..846f3bafdf 100644 --- a/reference/unordered_set/unordered_multiset/clear.md +++ b/reference/unordered_set/unordered_multiset/clear.md @@ -49,7 +49,7 @@ s.swap(tmp); ### 計算量に関する備考 - 多くの実装(GCC libstdc++, LLVM libc++ など)は 1. 全ての要素を破棄する - 2. 全てのバケットを順に走査して各バケットを破棄 + 2. 全てのバケットを順に走査して各バケットを初期化 という手順を取るため、実行時間は概ね [`bucket_count`](bucket_count.md)`()` + [`size`](size.md)`()` に比例する傾向がある。 これは規格が定義する「計算量」(オブジェクトに対する操作の数)とは別物である。 diff --git a/reference/unordered_set/unordered_set/clear.md b/reference/unordered_set/unordered_set/clear.md index 3f8b24f45f..f1a4c6d4d0 100644 --- a/reference/unordered_set/unordered_set/clear.md +++ b/reference/unordered_set/unordered_set/clear.md @@ -49,7 +49,7 @@ s.swap(tmp); ### 計算量に関する備考 - 多くの実装(GCC libstdc++, LLVM libc++ など)は 1. 全ての要素を破棄する - 2. 全てのバケットを順に走査して各バケットを破棄 + 2. 全てのバケットを順に走査して各バケットを初期化 という手順を取るため、実行時間は概ね [`bucket_count`](bucket_count.md)`()` + [`size`](size.md)`()` に比例する傾向がある。 これは規格が定義する「計算量」(オブジェクトに対する操作の数)とは別物である。 From af3a11d31a25784b8c84c75f21f4e7c68f1d7b50 Mon Sep 17 00:00:00 2001 From: koki watanabe Date: Mon, 26 May 2025 23:20:53 +0900 Subject: [PATCH 1758/3948] fix: order of factor --- reference/unordered_map/unordered_map/clear.md | 2 +- reference/unordered_map/unordered_multimap/clear.md | 2 +- reference/unordered_set/unordered_multiset/clear.md | 2 +- reference/unordered_set/unordered_set/clear.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/unordered_map/unordered_map/clear.md b/reference/unordered_map/unordered_map/clear.md index 0409a9a652..4fccb40771 100644 --- a/reference/unordered_map/unordered_map/clear.md +++ b/reference/unordered_map/unordered_map/clear.md @@ -51,7 +51,7 @@ s.swap(tmp); 1. 全ての要素を破棄する 2. 全てのバケットを順に走査して各バケットを初期化 -という手順を取るため、実行時間は概ね [`bucket_count`](bucket_count.md)`()` + [`size`](size.md)`()` に比例する傾向がある。 +という手順を取るため、実行時間は概ね [`size`](size.md)`()` + [`bucket_count`](bucket_count.md)`()` に比例する傾向がある。 これは規格が定義する「計算量」(オブジェクトに対する操作の数)とは別物である。 diff --git a/reference/unordered_map/unordered_multimap/clear.md b/reference/unordered_map/unordered_multimap/clear.md index 8b1f9a7bec..f9bcd8b89d 100644 --- a/reference/unordered_map/unordered_multimap/clear.md +++ b/reference/unordered_map/unordered_multimap/clear.md @@ -51,7 +51,7 @@ s.swap(tmp); 1. 全ての要素を破棄する 2. 全てのバケットを順に走査して各バケットを初期化 -という手順を取るため、実行時間は概ね [`bucket_count`](bucket_count.md)`()` + [`size`](size.md)`()` に比例する傾向がある。 +という手順を取るため、実行時間は概ね [`size`](size.md)`()` + [`bucket_count`](bucket_count.md)`()` に比例する傾向がある。 これは規格が定義する「計算量」(オブジェクトに対する操作の数)とは別物である。 diff --git a/reference/unordered_set/unordered_multiset/clear.md b/reference/unordered_set/unordered_multiset/clear.md index 846f3bafdf..5d19486ecd 100644 --- a/reference/unordered_set/unordered_multiset/clear.md +++ b/reference/unordered_set/unordered_multiset/clear.md @@ -51,7 +51,7 @@ s.swap(tmp); 1. 全ての要素を破棄する 2. 全てのバケットを順に走査して各バケットを初期化 -という手順を取るため、実行時間は概ね [`bucket_count`](bucket_count.md)`()` + [`size`](size.md)`()` に比例する傾向がある。 +という手順を取るため、実行時間は概ね [`size`](size.md)`()` + [`bucket_count`](bucket_count.md)`()` に比例する傾向がある。 これは規格が定義する「計算量」(オブジェクトに対する操作の数)とは別物である。 diff --git a/reference/unordered_set/unordered_set/clear.md b/reference/unordered_set/unordered_set/clear.md index f1a4c6d4d0..ad5ec237eb 100644 --- a/reference/unordered_set/unordered_set/clear.md +++ b/reference/unordered_set/unordered_set/clear.md @@ -51,7 +51,7 @@ s.swap(tmp); 1. 全ての要素を破棄する 2. 全てのバケットを順に走査して各バケットを初期化 -という手順を取るため、実行時間は概ね [`bucket_count`](bucket_count.md)`()` + [`size`](size.md)`()` に比例する傾向がある。 +という手順を取るため、実行時間は概ね [`size`](size.md)`()` + [`bucket_count`](bucket_count.md)`()` に比例する傾向がある。 これは規格が定義する「計算量」(オブジェクトに対する操作の数)とは別物である。 From 4c79551c79079ba7b99f87061226e4f8fd36c12a Mon Sep 17 00:00:00 2001 From: koki watanabe Date: Mon, 26 May 2025 23:23:05 +0900 Subject: [PATCH 1759/3948] fix: apply suggestion --- reference/unordered_map/unordered_map/clear.md | 2 +- reference/unordered_map/unordered_multimap/clear.md | 2 +- reference/unordered_set/unordered_multiset/clear.md | 2 +- reference/unordered_set/unordered_set/clear.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/unordered_map/unordered_map/clear.md b/reference/unordered_map/unordered_map/clear.md index 4fccb40771..9fbd16572e 100644 --- a/reference/unordered_map/unordered_map/clear.md +++ b/reference/unordered_map/unordered_map/clear.md @@ -52,7 +52,7 @@ s.swap(tmp); 2. 全てのバケットを順に走査して各バケットを初期化 という手順を取るため、実行時間は概ね [`size`](size.md)`()` + [`bucket_count`](bucket_count.md)`()` に比例する傾向がある。 -これは規格が定義する「計算量」(オブジェクトに対する操作の数)とは別物である。 +規格がコンテナに対して定義する計算量は「コンテナに格納している要素に対する操作の数の計算量」であるためバケットの走査を考慮せず「コンテナの全要素を削除する」として、全要素数Nに対してO(N)に規定されるが、実行時間に影響する時間計算量としてはバケット数Cに対して線形となる。 ## 例 diff --git a/reference/unordered_map/unordered_multimap/clear.md b/reference/unordered_map/unordered_multimap/clear.md index f9bcd8b89d..65b02b8314 100644 --- a/reference/unordered_map/unordered_multimap/clear.md +++ b/reference/unordered_map/unordered_multimap/clear.md @@ -52,7 +52,7 @@ s.swap(tmp); 2. 全てのバケットを順に走査して各バケットを初期化 という手順を取るため、実行時間は概ね [`size`](size.md)`()` + [`bucket_count`](bucket_count.md)`()` に比例する傾向がある。 -これは規格が定義する「計算量」(オブジェクトに対する操作の数)とは別物である。 +規格がコンテナに対して定義する計算量は「コンテナに格納している要素に対する操作の数の計算量」であるためバケットの走査を考慮せず「コンテナの全要素を削除する」として、全要素数Nに対してO(N)に規定されるが、実行時間に影響する時間計算量としてはバケット数Cに対して線形となる。 ## 例 diff --git a/reference/unordered_set/unordered_multiset/clear.md b/reference/unordered_set/unordered_multiset/clear.md index 5d19486ecd..29e8fbfd49 100644 --- a/reference/unordered_set/unordered_multiset/clear.md +++ b/reference/unordered_set/unordered_multiset/clear.md @@ -52,7 +52,7 @@ s.swap(tmp); 2. 全てのバケットを順に走査して各バケットを初期化 という手順を取るため、実行時間は概ね [`size`](size.md)`()` + [`bucket_count`](bucket_count.md)`()` に比例する傾向がある。 -これは規格が定義する「計算量」(オブジェクトに対する操作の数)とは別物である。 +規格がコンテナに対して定義する計算量は「コンテナに格納している要素に対する操作の数の計算量」であるためバケットの走査を考慮せず「コンテナの全要素を削除する」として、全要素数Nに対してO(N)に規定されるが、実行時間に影響する時間計算量としてはバケット数Cに対して線形となる。 ## 例 diff --git a/reference/unordered_set/unordered_set/clear.md b/reference/unordered_set/unordered_set/clear.md index ad5ec237eb..e96d563831 100644 --- a/reference/unordered_set/unordered_set/clear.md +++ b/reference/unordered_set/unordered_set/clear.md @@ -52,7 +52,7 @@ s.swap(tmp); 2. 全てのバケットを順に走査して各バケットを初期化 という手順を取るため、実行時間は概ね [`size`](size.md)`()` + [`bucket_count`](bucket_count.md)`()` に比例する傾向がある。 -これは規格が定義する「計算量」(オブジェクトに対する操作の数)とは別物である。 +規格がコンテナに対して定義する計算量は「コンテナに格納している要素に対する操作の数の計算量」であるためバケットの走査を考慮せず「コンテナの全要素を削除する」として、全要素数Nに対してO(N)に規定されるが、実行時間に影響する時間計算量としてはバケット数Cに対して線形となる。 ## 例 From bb394c16fccaee75e975cd363072afa8cbb38ada Mon Sep 17 00:00:00 2001 From: koki watanabe Date: Mon, 26 May 2025 23:24:43 +0900 Subject: [PATCH 1760/3948] fix: order of topic --- .../unordered_map/unordered_map/clear.md | 20 +++++++++---------- .../unordered_map/unordered_multimap/clear.md | 20 +++++++++---------- .../unordered_set/unordered_multiset/clear.md | 20 +++++++++---------- .../unordered_set/unordered_set/clear.md | 20 +++++++++---------- 4 files changed, 40 insertions(+), 40 deletions(-) diff --git a/reference/unordered_map/unordered_map/clear.md b/reference/unordered_map/unordered_map/clear.md index 9fbd16572e..be2530f472 100644 --- a/reference/unordered_map/unordered_map/clear.md +++ b/reference/unordered_map/unordered_map/clear.md @@ -33,16 +33,6 @@ void clear() noexcept; 投げない。 -## 備考 -- `clear()` は バケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格上は要求していない。 -実装によっては `clear()` 後もバケット配列が維持され、動的メモリが残る場合がある。 -- メモリを確実に解放したいときには以下のように操作を行う -```CPP -std::unordered_map tmp; -s.swap(tmp); -``` - - ## 計算量 本関数呼び出し前のコンテナの要素数([`size`](size.md)`()`)に比例 @@ -55,6 +45,16 @@ s.swap(tmp); 規格がコンテナに対して定義する計算量は「コンテナに格納している要素に対する操作の数の計算量」であるためバケットの走査を考慮せず「コンテナの全要素を削除する」として、全要素数Nに対してO(N)に規定されるが、実行時間に影響する時間計算量としてはバケット数Cに対して線形となる。 +## 備考 +- `clear()` は バケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格上は要求していない。 +実装によっては `clear()` 後もバケット配列が維持され、動的メモリが残る場合がある。 +- メモリを確実に解放したいときには以下のように操作を行う +```CPP +std::unordered_map tmp; +s.swap(tmp); +``` + + ## 例 ```cpp example #include diff --git a/reference/unordered_map/unordered_multimap/clear.md b/reference/unordered_map/unordered_multimap/clear.md index 65b02b8314..ffa0832a4a 100644 --- a/reference/unordered_map/unordered_multimap/clear.md +++ b/reference/unordered_map/unordered_multimap/clear.md @@ -33,16 +33,6 @@ void clear() noexcept; 投げない。 -## 備考 -- `clear()` は バケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格上は要求していない。 -実装によっては `clear()` 後もバケット配列が維持され、動的メモリが残る場合がある。 -- メモリを確実に解放したいときには以下のように操作を行う -```CPP -std::unordered_multimap tmp; -s.swap(tmp); -``` - - ## 計算量 本関数呼び出し前のコンテナの要素数([`size`](size.md)`()`)に比例 @@ -55,6 +45,16 @@ s.swap(tmp); 規格がコンテナに対して定義する計算量は「コンテナに格納している要素に対する操作の数の計算量」であるためバケットの走査を考慮せず「コンテナの全要素を削除する」として、全要素数Nに対してO(N)に規定されるが、実行時間に影響する時間計算量としてはバケット数Cに対して線形となる。 +## 備考 +- `clear()` は バケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格上は要求していない。 +実装によっては `clear()` 後もバケット配列が維持され、動的メモリが残る場合がある。 +- メモリを確実に解放したいときには以下のように操作を行う +```CPP +std::unordered_multimap tmp; +s.swap(tmp); +``` + + ## 例 ```cpp example #include diff --git a/reference/unordered_set/unordered_multiset/clear.md b/reference/unordered_set/unordered_multiset/clear.md index 29e8fbfd49..94488f2997 100644 --- a/reference/unordered_set/unordered_multiset/clear.md +++ b/reference/unordered_set/unordered_multiset/clear.md @@ -33,16 +33,6 @@ void clear() noexcept; 投げない。 -## 備考 -- `clear()` は バケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格上は要求していない。 -実装によっては `clear()` 後もバケット配列が維持され、動的メモリが残る場合がある。 -- メモリを確実に解放したいときには以下のように操作を行う -```CPP -std::unordered_multiset tmp; -s.swap(tmp); -``` - - ## 計算量 本関数呼び出し前のコンテナの要素数([`size`](size.md)`()`)に比例 @@ -55,6 +45,16 @@ s.swap(tmp); 規格がコンテナに対して定義する計算量は「コンテナに格納している要素に対する操作の数の計算量」であるためバケットの走査を考慮せず「コンテナの全要素を削除する」として、全要素数Nに対してO(N)に規定されるが、実行時間に影響する時間計算量としてはバケット数Cに対して線形となる。 +## 備考 +- `clear()` は バケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格上は要求していない。 +実装によっては `clear()` 後もバケット配列が維持され、動的メモリが残る場合がある。 +- メモリを確実に解放したいときには以下のように操作を行う +```CPP +std::unordered_multiset tmp; +s.swap(tmp); +``` + + ## 例 ```cpp example #include diff --git a/reference/unordered_set/unordered_set/clear.md b/reference/unordered_set/unordered_set/clear.md index e96d563831..188ae2c6d9 100644 --- a/reference/unordered_set/unordered_set/clear.md +++ b/reference/unordered_set/unordered_set/clear.md @@ -33,16 +33,6 @@ void clear() noexcept; 投げない。 -## 備考 -- `clear()` は バケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格上は要求していない。 -実装によっては `clear()` 後もバケット配列が維持され、動的メモリが残る場合がある。 -- メモリを確実に解放したいときには以下のように操作を行う -```CPP -std::unordered_set tmp; -s.swap(tmp); -``` - - ## 計算量 本関数呼び出し前のコンテナの要素数([`size`](size.md)`()`)に比例 @@ -55,6 +45,16 @@ s.swap(tmp); 規格がコンテナに対して定義する計算量は「コンテナに格納している要素に対する操作の数の計算量」であるためバケットの走査を考慮せず「コンテナの全要素を削除する」として、全要素数Nに対してO(N)に規定されるが、実行時間に影響する時間計算量としてはバケット数Cに対して線形となる。 +## 備考 +- `clear()` は バケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格上は要求していない。 +実装によっては `clear()` 後もバケット配列が維持され、動的メモリが残る場合がある。 +- メモリを確実に解放したいときには以下のように操作を行う +```CPP +std::unordered_set tmp; +s.swap(tmp); +``` + + ## 例 ```cpp example #include From 202823f1b3367e7eb4a9a9f7be0bbd14b493ad3a Mon Sep 17 00:00:00 2001 From: koki watanabe Date: Mon, 26 May 2025 23:30:15 +0900 Subject: [PATCH 1761/3948] fix: minor fix --- reference/unordered_map/unordered_map/clear.md | 4 ++-- reference/unordered_map/unordered_multimap/clear.md | 4 ++-- reference/unordered_set/unordered_multiset/clear.md | 4 ++-- reference/unordered_set/unordered_set/clear.md | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/reference/unordered_map/unordered_map/clear.md b/reference/unordered_map/unordered_map/clear.md index be2530f472..e91f81b0ba 100644 --- a/reference/unordered_map/unordered_map/clear.md +++ b/reference/unordered_map/unordered_map/clear.md @@ -38,8 +38,8 @@ void clear() noexcept; ### 計算量に関する備考 - 多くの実装(GCC libstdc++, LLVM libc++ など)は - 1. 全ての要素を破棄する - 2. 全てのバケットを順に走査して各バケットを初期化 + 1. 全ての要素を走査して各要素を破棄 + 2. 全てのバケットを走査して各バケットを初期化 という手順を取るため、実行時間は概ね [`size`](size.md)`()` + [`bucket_count`](bucket_count.md)`()` に比例する傾向がある。 規格がコンテナに対して定義する計算量は「コンテナに格納している要素に対する操作の数の計算量」であるためバケットの走査を考慮せず「コンテナの全要素を削除する」として、全要素数Nに対してO(N)に規定されるが、実行時間に影響する時間計算量としてはバケット数Cに対して線形となる。 diff --git a/reference/unordered_map/unordered_multimap/clear.md b/reference/unordered_map/unordered_multimap/clear.md index ffa0832a4a..3c02d091bd 100644 --- a/reference/unordered_map/unordered_multimap/clear.md +++ b/reference/unordered_map/unordered_multimap/clear.md @@ -38,8 +38,8 @@ void clear() noexcept; ### 計算量に関する備考 - 多くの実装(GCC libstdc++, LLVM libc++ など)は - 1. 全ての要素を破棄する - 2. 全てのバケットを順に走査して各バケットを初期化 + 1. 全ての要素を走査して各要素を破棄 + 2. 全てのバケットを走査して各バケットを初期化 という手順を取るため、実行時間は概ね [`size`](size.md)`()` + [`bucket_count`](bucket_count.md)`()` に比例する傾向がある。 規格がコンテナに対して定義する計算量は「コンテナに格納している要素に対する操作の数の計算量」であるためバケットの走査を考慮せず「コンテナの全要素を削除する」として、全要素数Nに対してO(N)に規定されるが、実行時間に影響する時間計算量としてはバケット数Cに対して線形となる。 diff --git a/reference/unordered_set/unordered_multiset/clear.md b/reference/unordered_set/unordered_multiset/clear.md index 94488f2997..8120d2c239 100644 --- a/reference/unordered_set/unordered_multiset/clear.md +++ b/reference/unordered_set/unordered_multiset/clear.md @@ -38,8 +38,8 @@ void clear() noexcept; ### 計算量に関する備考 - 多くの実装(GCC libstdc++, LLVM libc++ など)は - 1. 全ての要素を破棄する - 2. 全てのバケットを順に走査して各バケットを初期化 + 1. 全ての要素を走査して各要素を破棄 + 2. 全てのバケットを走査して各バケットを初期化 という手順を取るため、実行時間は概ね [`size`](size.md)`()` + [`bucket_count`](bucket_count.md)`()` に比例する傾向がある。 規格がコンテナに対して定義する計算量は「コンテナに格納している要素に対する操作の数の計算量」であるためバケットの走査を考慮せず「コンテナの全要素を削除する」として、全要素数Nに対してO(N)に規定されるが、実行時間に影響する時間計算量としてはバケット数Cに対して線形となる。 diff --git a/reference/unordered_set/unordered_set/clear.md b/reference/unordered_set/unordered_set/clear.md index 188ae2c6d9..0643255597 100644 --- a/reference/unordered_set/unordered_set/clear.md +++ b/reference/unordered_set/unordered_set/clear.md @@ -38,8 +38,8 @@ void clear() noexcept; ### 計算量に関する備考 - 多くの実装(GCC libstdc++, LLVM libc++ など)は - 1. 全ての要素を破棄する - 2. 全てのバケットを順に走査して各バケットを初期化 + 1. 全ての要素を走査して各要素を破棄 + 2. 全てのバケットを走査して各バケットを初期化 という手順を取るため、実行時間は概ね [`size`](size.md)`()` + [`bucket_count`](bucket_count.md)`()` に比例する傾向がある。 規格がコンテナに対して定義する計算量は「コンテナに格納している要素に対する操作の数の計算量」であるためバケットの走査を考慮せず「コンテナの全要素を削除する」として、全要素数Nに対してO(N)に規定されるが、実行時間に影響する時間計算量としてはバケット数Cに対して線形となる。 From 260bfc553044c57089e17e64687fd428d2c49e4c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 27 May 2025 14:13:34 +0900 Subject: [PATCH 1762/3948] =?UTF-8?q?algorithm/remove=5Fcopy=20:=20C++26?= =?UTF-8?q?=E6=B3=A2=E3=82=AB=E3=83=83=E3=82=B3=E5=88=9D=E6=9C=9F=E5=8C=96?= =?UTF-8?q?=E3=81=AB=E5=AF=BE=E5=BF=9C=20#1311?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_remove_copy.md | 87 +++++++++++++++++++++- reference/algorithm/remove_copy.md | 89 +++++++++++++++++++++-- 2 files changed, 167 insertions(+), 9 deletions(-) diff --git a/reference/algorithm/ranges_remove_copy.md b/reference/algorithm/ranges_remove_copy.md index baf9c73346..d47feda88f 100644 --- a/reference/algorithm/ranges_remove_copy.md +++ b/reference/algorithm/ranges_remove_copy.md @@ -23,6 +23,23 @@ namespace std::ranges { O result, const T& value, Proj proj = {}); // (1) C++20 + template S, + weakly_incrementable O, + class Proj = identity, + class T = projected_value_t> + requires indirectly_copyable && + indirect_binary_predicate< + ranges::equal_to, + projected, + const T* + > + constexpr remove_copy_result + remove_copy(I first, + S last, + O result, + const T& value, + Proj proj = {}); // (1) C++26 template , Proj>> + requires indirectly_copyable, O> && + indirect_binary_predicate< + ranges::equal_to, + projected, Proj>, + const T* + > + constexpr remove_copy_result, O> + remove_copy(R&& r, + O result, + const T& value, + Proj proj = {}); // (2) C++26 } ``` * input_iterator[link /reference/iterator/input_iterator.md] @@ -76,10 +108,17 @@ namespace std::ranges { ## 備考 -安定。 +- 安定。 +- (1), (2) : + - C++26 : 引数として波カッコ初期化`{}`を受け付ける + ```cpp + std::vector v; + std::ranges::remove_copy(v, result, {a, b}); + ``` ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -95,11 +134,53 @@ int main() { ``` * std::ranges::remove_copy[color ff0000] -### 出力 +#### 出力 ``` 2,3,2, ``` +### 波カッコ初期化を入力として使用する (C++26) +```cpp example +#include +#include +#include +#include + +struct Point { + int x; + int y; + + bool operator==(const Point& other) const = default; +}; + +std::ostream& operator<<(std::ostream& os, const Point& p) { + return os << p.x << "," << p.y; +} + +int main() { + std::vector v = { + {1, 2}, + {3, 4}, + {5, 6}, + {1, 2}, + }; + + // 値{1, 2}を除去した結果を出力する + std::ranges::remove_copy( + v, + std::ostream_iterator(std::cout, "\n"), + {1, 2} + ); +} +``` +* std::ranges::remove_copy[color ff0000] + +#### 出力 +``` +3,4 +5,6 +``` + ## バージョン ### 言語 @@ -113,3 +194,5 @@ int main() { ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) + - C++26で波カッコ初期化 (リスト初期化) に対応した diff --git a/reference/algorithm/remove_copy.md b/reference/algorithm/remove_copy.md index 2e9046c396..a7d0807a7d 100644 --- a/reference/algorithm/remove_copy.md +++ b/reference/algorithm/remove_copy.md @@ -5,21 +5,34 @@ ```cpp namespace std { - template + template OutputIterator remove_copy(InputIterator first, InputIterator last, OutputIterator result, const T& value); // (1) C++03 - - template + template constexpr OutputIterator remove_copy(InputIterator first, InputIterator last, OutputIterator result, const T& value); // (1) C++20 + template ::value_type> + constexpr OutputIterator + remove_copy(InputIterator first, + InputIterator last, + OutputIterator result, + const T& value); // (1) C++26 - template ForwardIterator2 remove_copy(ExecutionPolicy&& exec, @@ -27,6 +40,16 @@ namespace std { ForwardIterator1 last, ForwardIterator2 result, const T& value); // (2) C++17 + template ::value_type> + ForwardIterator2 + remove_copy(ExecutionPolicy&& exec, + ForwardIterator1 first, + ForwardIterator1 last, + ForwardIterator2 result, + const T& value); // (2) C++26 } ``` @@ -34,7 +57,7 @@ namespace std { イテレータ範囲`[first, last)`から指定された要素を除け、その結果を出力の範囲へコピーする。 -## テンプレートパラメータ制約 +## 適格要件 - `*result = *first` という式が有効であること @@ -55,10 +78,17 @@ namespace std { ## 備考 -安定。 +- 安定。 +- (1), (2) : + - C++26 : 引数として波カッコ初期化`{}`を受け付ける + ```cpp + std::vector v; + std::remove_copy(v.begin(), v.end(), result, {a, b}); + ``` ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -75,11 +105,54 @@ int main() { ``` * std::remove_copy[color ff0000] -### 出力 +#### 出力 ``` 2,3,2, ``` +### 波カッコ初期化を入力として使用する (C++26) +```cpp example +#include +#include +#include +#include + +struct Point { + int x; + int y; + + bool operator==(const Point& other) const = default; +}; + +std::ostream& operator<<(std::ostream& os, const Point& p) { + return os << p.x << "," << p.y; +} + +int main() { + std::vector v = { + {1, 2}, + {3, 4}, + {5, 6}, + {1, 2}, + }; + + // 値{1, 2}を除去した結果を出力する + std::remove_copy( + v.begin(), + v.end(), + std::ostream_iterator(std::cout, "\n"), + {1, 2} + ); +} +``` +* std::remove_copy[color ff0000] + +#### 出力 +``` +3,4 +5,6 +``` + ## 実装例 ```cpp @@ -97,3 +170,5 @@ OutputIterator remove_copy(InputIterator first, InputIterator last, ## 参照 - [P0202R3 Add Constexpr Modifiers to Functions in `` and `` Headers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0202r3.html) - [P0467R2 Iterator Concerns for Parallel Algorithms](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0467r2.html) +- [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) + - C++26で波カッコ初期化 (リスト初期化) に対応した From bd1ef79d48ec9fd9f3ac5a7950ab86ea82844b83 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 27 May 2025 14:19:16 +0900 Subject: [PATCH 1763/3948] =?UTF-8?q?replace=5Fcopy=5Fif=20:=20=E3=82=B3?= =?UTF-8?q?=E3=83=B3=E3=83=91=E3=82=A4=E3=83=AB=E3=82=A8=E3=83=A9=E3=83=BC?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20#1311?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_replace_copy_if.md | 2 +- reference/algorithm/replace_copy_if.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/algorithm/ranges_replace_copy_if.md b/reference/algorithm/ranges_replace_copy_if.md index 75cd002563..1993964cd2 100644 --- a/reference/algorithm/ranges_replace_copy_if.md +++ b/reference/algorithm/ranges_replace_copy_if.md @@ -164,7 +164,7 @@ int main() { // 値が{1, 2}の要素をすべて{9, 9}に置き換えたものを出力する std::ranges::replace_copy_if( v, - std::ostream_iterator(std::cout, "\n"), + std::ostream_iterator(std::cout, "\n"), [](const Point& p) { return p.x == 1 && p.y == 2; }, {9, 9} ); diff --git a/reference/algorithm/replace_copy_if.md b/reference/algorithm/replace_copy_if.md index afcf0e6421..39692570c6 100644 --- a/reference/algorithm/replace_copy_if.md +++ b/reference/algorithm/replace_copy_if.md @@ -150,7 +150,7 @@ int main() { std::replace_copy_if( v.begin(), v.end(), - std::ostream_iterator(std::cout, "\n"), + std::ostream_iterator(std::cout, "\n"), [](const Point& p) { return p.x == 1 && p.y == 2; }, {9, 9} ); From 8eae9db6e6aa52ad8e2a4f4fc5cca009be560b16 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 27 May 2025 14:43:21 +0900 Subject: [PATCH 1764/3948] =?UTF-8?q?lower=5Fbound=20/=20upper=5Fbound=20:?= =?UTF-8?q?=20C++26=E6=B3=A2=E3=82=AB=E3=83=83=E3=82=B3=E5=88=9D=E6=9C=9F?= =?UTF-8?q?=E5=8C=96=E3=81=AB=E5=AF=BE=E5=BF=9C=20#1311?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/lower_bound.md | 81 ++++++++++++++++++-- reference/algorithm/ranges_lower_bound.md | 92 ++++++++++++++++++++++- reference/algorithm/ranges_upper_bound.md | 87 ++++++++++++++++++++- reference/algorithm/upper_bound.md | 85 +++++++++++++++++++-- 4 files changed, 325 insertions(+), 20 deletions(-) diff --git a/reference/algorithm/lower_bound.md b/reference/algorithm/lower_bound.md index 24bc996d40..64d79a2416 100644 --- a/reference/algorithm/lower_bound.md +++ b/reference/algorithm/lower_bound.md @@ -5,31 +5,49 @@ ```cpp namespace std { - template + template ForwardIterator lower_bound(ForwardIterator first, ForwardIterator last, const T& value); // (1) C++03 - - template + template + constexpr ForwardIterator + lower_bound(ForwardIterator first, + ForwardIterator last, + const T& value); // (1) C++20 + template ::value_type> constexpr ForwardIterator lower_bound(ForwardIterator first, ForwardIterator last, const T& value); // (1) C++20 - template + template ForwardIterator lower_bound(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); // (2) C++03 - - template + template constexpr ForwardIterator lower_bound(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); // (2) C++20 + template ::value_type, + class Compare> + constexpr ForwardIterator + lower_bound(ForwardIterator first, + ForwardIterator last, + const T& value, + Compare comp); // (2) C++26 } ``` @@ -71,9 +89,16 @@ namespace std { 具体的には、[`partition_point`](partition_point.md)`(first, last, [value](const T& e) { return e < value; })`、あるいは、[`partition_point`](partition_point.md)`(first, last, [value, comp](const T& e) { return comp(e, value); })` とすることで等価の結果が得られる。 - 本関数の要件は、上記の通り C++03 までの方が C++11 よりも厳しい。 しかし、本アルゴリズムの特性上、処理系が C++03 までにしか準拠していない場合でも、昇順に並んでいなくても正常に動作する可能性は高いものと思われる。 +- (1), (2) : + - C++26 : 引数として波カッコ初期化`{}`を受け付ける + ```cpp + std::vector v; + auto it = std::lower_bound(v.begin(), v.end(), {a, b}); + ``` ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -152,13 +177,53 @@ int main() ``` * std::lower_bound[color ff0000] -### 出力 +#### 出力 ``` 4 pos=2 4 pos=2 id=4 name=Carol pos=2 ``` +### 波カッコ初期化を入力として使用する (C++26) +```cpp example +#include +#include +#include +#include + +struct Point { + int x; + int y; + + bool operator==(const Point& other) const = default; + auto operator<=>(const Point& other) const = default; +}; + +int main() { + std::vector v = { + {1, 2}, + {1, 2}, + {3, 4}, + {5, 6}, + }; + + auto it = std::lower_bound(v.begin(), v.end(), {3, 4}); + + // lower_boundでは指定した値"以上"の値が見つかるので、 + // 指定した値を見つけたいなら検索結果の値を比較する必要がある + if (it != v.end() && *it == Point{3, 4}) { + std::size_t pos = std::distance(v.begin(), it); + std::cout << "pos=" << pos << std::endl; + } +} +``` +* std::lower_bound[color ff0000] + +#### 出力 +``` +pos=2 +``` + ## 実装例 ```cpp @@ -201,3 +266,5 @@ lower_bound(ForwardIterator first, ForwardIterator last, const T& value) - [LWG Issue 384. `equal_range` has unimplementable runtime complexity](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#384) - [LWG Issue 2150. Unclear specification of `find_end`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2150) - [P0202R3 Add Constexpr Modifiers to Functions in `` and `` Headers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0202r3.html) +- [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) + - C++26で波カッコ初期化 (リスト初期化) に対応した diff --git a/reference/algorithm/ranges_lower_bound.md b/reference/algorithm/ranges_lower_bound.md index 08c91d33a3..9fb2c56598 100644 --- a/reference/algorithm/ranges_lower_bound.md +++ b/reference/algorithm/ranges_lower_bound.md @@ -10,23 +10,57 @@ namespace std::ranges { sentinel_for S, class T, class Proj = identity, - indirect_strict_weak_order> Comp = ranges::less> + indirect_strict_weak_order< + const T*, + projected + > Comp = ranges::less> constexpr I lower_bound(I first, S last, const T& value, Comp comp = {}, Proj proj = {}); // (1) C++20 + template S, + class Proj = identity, + class T = projected_value_t, + indirect_strict_weak_order< + const T*, + projected + > Comp = ranges::less> + constexpr I + lower_bound(I first, + S last, + const T& value, + Comp comp = {}, + Proj proj = {}); // (1) C++26 template , Proj>> Comp = ranges::less> + indirect_strict_weak_order< + const T*, + projected, + Proj> + > Comp = ranges::less> constexpr borrowed_iterator_t lower_bound(R&& r, const T& value, Comp comp = {}, Proj proj = {}); // (2) C++20 + template , Proj>, + indirect_strict_weak_order< + const T*, + projected, + Proj> + > Comp = ranges::less> + constexpr borrowed_iterator_t + lower_bound(R&& r, + const T& value, + Comp comp = {}, + Proj proj = {}); // (2) C++26 } ``` * forward_iterator[link /reference/iterator/forward_iterator.md] @@ -64,7 +98,17 @@ namespace std::ranges { ## 計算量 最大で log2(`last - first`) + O(1) 回の比較を行う + +## 備考 +- (1), (2) : + - C++26 : 引数として波カッコ初期化`{}`を受け付ける + ```cpp + std::vector v; + auto it = std::ranges::lower_bound(v, {a, b}); + ``` + ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -139,13 +183,53 @@ int main() * std::ranges::distance[link /reference/iterator/ranges_distance.md] * std::ranges::lower_bound[color ff0000] -### 出力 +#### 出力 ``` 4 pos=2 4 pos=2 id=4 name=Bob pos=2 ``` +### 波カッコ初期化を入力として使用する (C++26) +```cpp example +#include +#include +#include +#include + +struct Point { + int x; + int y; + + bool operator==(const Point& other) const = default; + auto operator<=>(const Point& other) const = default; +}; + +int main() { + std::vector v = { + {1, 2}, + {1, 2}, + {3, 4}, + {5, 6}, + }; + + auto it = std::ranges::lower_bound(v, {3, 4}); + + // lower_boundでは指定した値"以上"の値が見つかるので、 + // 指定した値を見つけたいなら検索結果の値を比較する必要がある + if (it != v.end() && *it == Point{3, 4}) { + std::size_t pos = std::distance(v.begin(), it); + std::cout << "pos=" << pos << std::endl; + } +} +``` +* std::ranges::lower_bound[color ff0000] + +#### 出力 +``` +pos=2 +``` + ## バージョン ### 言語 - C++20 @@ -158,3 +242,5 @@ id=4 name=Bob pos=2 ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) + - C++26で波カッコ初期化 (リスト初期化) に対応した diff --git a/reference/algorithm/ranges_upper_bound.md b/reference/algorithm/ranges_upper_bound.md index 427567d233..22151d4dc5 100644 --- a/reference/algorithm/ranges_upper_bound.md +++ b/reference/algorithm/ranges_upper_bound.md @@ -10,13 +10,30 @@ namespace std::ranges { sentinel_for S, class T, class Proj = identity, - indirect_strict_weak_order> Comp = ranges::less> + indirect_strict_weak_order< + const T*, + projected + > Comp = ranges::less> constexpr I upper_bound(I first, S last, const T& value, Comp comp = {}, Proj proj = {}); // (1) C++20 + template S, + class Proj = identity, + class T = projected_value_t, + indirect_strict_weak_order< + const T*, + projected + > Comp = ranges::less> + constexpr I + upper_bound(I first, + S last, + const T& value, + Comp comp = {}, + Proj proj = {}); // (1) C++26 template , Proj>, + indirect_strict_weak_order< + const T*, + projected, Proj> + > Comp = ranges::less> + constexpr borrowed_iterator_t + upper_bound(R&& r, + const T& value, + Comp comp = {}, + Proj proj = {}); // (2) C++26 } ``` * forward_iterator[link /reference/iterator/forward_iterator.md] @@ -69,9 +98,15 @@ namespace std::ranges { ## 備考 - 本関数は、本質的に [`partition_point`](ranges_partition_point.md) と等価である。 具体的には、[`partition_point`](ranges_partition_point.md)`(first, last, [value](const T& e) { return !bool(value < e); })`、あるいは、[`partition_point`](ranges_partition_point.md)`(first, last, [value, comp](const T& e) { return !bool(comp(value, e)); })` とすることで等価の結果が得られる。 - +- (1), (2) : + - C++26 : 引数として波カッコ初期化`{}`を受け付ける + ```cpp + std::vector v; + auto it = std::ranges::upper_bound(v, {a, b}); + ``` ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -128,12 +163,56 @@ int main() * std::ranges::upper_bound[color ff0000] -### 出力 +#### 出力 ``` 4 100:1 100:2 200:1 200:2 300:1 300:2 ``` +### 波カッコ初期化を入力として使用する (C++26) +```cpp example +#include +#include +#include +#include + +struct Point { + int x; + int y; + + bool operator==(const Point& other) const = default; + auto operator<=>(const Point& other) const = default; +}; + +int main() { + std::vector v = { + {1, 2}, + {3, 4}, + {3, 4}, + {5, 6}, + }; + + // 値{3, 4}が見つかる範囲を取得 + auto first = std::ranges::lower_bound(v, {3, 4}); + auto last = std::ranges::upper_bound(v, {3, 4}); + + if (first != v.end() && last != v.end()) { + while (first != last) { + std::cout << first->x << "," << first->y << std::endl; + ++first; + } + } +} +``` +* std::ranges::upper_bound[color ff0000] +* std::ranges::lower_bound[link /reference/algorithm/lower_bound.md] + +#### 出力 +``` +3,4 +3,4 +``` + ## バージョン ### 言語 - C++20 @@ -146,3 +225,5 @@ int main() ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) + - C++26で波カッコ初期化 (リスト初期化) に対応した diff --git a/reference/algorithm/upper_bound.md b/reference/algorithm/upper_bound.md index 3ce4be90aa..2f86c5121a 100644 --- a/reference/algorithm/upper_bound.md +++ b/reference/algorithm/upper_bound.md @@ -5,31 +5,49 @@ ```cpp namespace std { - template + template ForwardIterator upper_bound(ForwardIterator first, ForwardIterator last, const T& value); // (1) C++03 - - template + template constexpr ForwardIterator upper_bound(ForwardIterator first, ForwardIterator last, const T& value); // (1) C++20 + template ::value_type> + constexpr ForwardIterator + upper_bound(ForwardIterator first, + ForwardIterator last, + const T& value); // (1) C++26 - template + template ForwardIterator upper_bound(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); // (2) C++03 - - template + template constexpr ForwardIterator upper_bound(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); // (2) C++20 + template ::value_type, + class Compare> + constexpr ForwardIterator + upper_bound(ForwardIterator first, + ForwardIterator last, + const T& value, + Compare comp); // (2) C++26 } ``` @@ -68,9 +86,16 @@ namespace std { 具体的には、[`partition_point`](partition_point.md)`(first, last, [value](const T& e) { return !bool(value < e); })`、あるいは、[`partition_point`](partition_point.md)`(first, last, [value, comp](const T& e) { return !bool(comp(value, e)); })` とすることで等価の結果が得られる。 - 本関数の要件は、上記の通り C++03 までの方が C++11 よりも厳しい。 しかし、本アルゴリズムの特性上、処理系が C++03 までにしか準拠していない場合でも、昇順に並んでいなくても正常に動作する可能性は高いものと思われる。 +- (1), (2) : + - C++26 : 引数として波カッコ初期化`{}`を受け付ける + ```cpp + std::vector v; + auto it = std::upper_bound(v.begin(), v.end(), {a, b}); + ``` ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -132,13 +157,57 @@ int main() * std::upper_bound[color ff0000] -### 出力 +#### 出力 ``` 4 100:1 100:2 200:1 200:2 300:1 300:2 ``` +### 波カッコ初期化を入力として使用する (C++26) +```cpp example +#include +#include +#include + +struct Point { + int x; + int y; + + bool operator==(const Point& other) const = default; + auto operator<=>(const Point& other) const = default; +}; + +int main() { + std::vector v = { + {1, 2}, + {3, 4}, + {3, 4}, + {5, 6}, + }; + + // 値{3, 4}が見つかる範囲を取得 + auto first = std::lower_bound(v.begin(), v.end(), {3, 4}); + auto last = std::upper_bound(v.begin(), v.end(), {3, 4}); + + if (first != v.end() && last != v.end()) { + while (first != last) { + std::cout << first->x << "," << first->y << std::endl; + ++first; + } + } +} +``` +* std::upper_bound[color ff0000] +* std::lower_bound[link /reference/algorithm/lower_bound.md] + +#### 出力 +``` +3,4 +3,4 +``` + + ## 実装例 ```cpp template @@ -180,3 +249,5 @@ upper_bound(ForwardIterator first, ForwardIterator last, const T& value) - [LWG Issue 384. `equal_range` has unimplementable runtime complexity](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#384) - [LWG Issue 2150. Unclear specification of `find_end`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2150) - [P0202R3 Add Constexpr Modifiers to Functions in `` and `` Headers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0202r3.html) +- [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) + - C++26で波カッコ初期化 (リスト初期化) に対応した From 1a1278ca88432498e33f6f87618e96f03a99c948 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 27 May 2025 14:53:08 +0900 Subject: [PATCH 1765/3948] =?UTF-8?q?equal=5Frange=20:=20C++26=E6=B3=A2?= =?UTF-8?q?=E3=82=AB=E3=83=83=E3=82=B3=E5=88=9D=E6=9C=9F=E5=8C=96=E3=81=AB?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C=20#1311?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/equal_range.md | 82 +++++++++++++++++++-- reference/algorithm/ranges_equal_range.md | 88 ++++++++++++++++++++++- 2 files changed, 160 insertions(+), 10 deletions(-) diff --git a/reference/algorithm/equal_range.md b/reference/algorithm/equal_range.md index 9e1add89e9..63b841b0fe 100644 --- a/reference/algorithm/equal_range.md +++ b/reference/algorithm/equal_range.md @@ -5,31 +5,49 @@ ```cpp namespace std { - template + template pair equal_range(ForwardIterator first, ForwardIterator last, const T& value); // (1) C++03 - - template + template constexpr pair equal_range(ForwardIterator first, ForwardIterator last, const T& value); // (1) C++20 + template ::value_type> + constexpr pair + equal_range(ForwardIterator first, + ForwardIterator last, + const T& value); // (1) C++26 - template + template pair equal_range(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); // (2) C++03 - - template + template constexpr pair equal_range(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); // (2) C++20 + template ::value_type, + class Compare> + constexpr pair + equal_range(ForwardIterator first, + ForwardIterator last, + const T& value, + Compare comp); // (2) C++26 } ``` * pair[link /reference/utility/pair.md] @@ -54,7 +72,17 @@ namespace std { 最大で 2 * log2(`last - first`) + O(1) 回の比較を行う +## 備考 +- (1), (2) : + - C++26 : 引数として波カッコ初期化`{}`を受け付ける + ```cpp + std::vector v; + auto result = std::equal_range(v.begin(), v.end(), {a, b}); + ``` + + ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -75,13 +103,53 @@ int main() ``` * equal_range[color ff0000] -### 出力 +#### 出力 ``` 3 4 ``` +### 波カッコ初期化を入力として使用する (C++26) +```cpp example +#include +#include +#include + +struct Point { + int x; + int y; + + bool operator==(const Point& other) const = default; + auto operator<=>(const Point& other) const = default; +}; + +int main() { + std::vector v = { + {1, 2}, + {3, 4}, + {3, 4}, + {5, 6}, + }; + + // 値{3, 4}が見つかる範囲を取得 + auto result = std::equal_range(v.begin(), v.end(), {3, 4}); + + while (result.first != result.second) { + std::cout << result.first->x << "," << result.first->y << std::endl; + ++result.first; + } +} +``` +* std::equal_range[color ff0000] + +#### 出力 +``` +3,4 +3,4 +``` ## 参照 - [LWG Issue 384. `equal_range` has unimplementable runtime complexity](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#384) - [P0202R3 Add Constexpr Modifiers to Functions in `` and `` Headers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0202r3.html) +- [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) + - C++26で波カッコ初期化 (リスト初期化) に対応した diff --git a/reference/algorithm/ranges_equal_range.md b/reference/algorithm/ranges_equal_range.md index a580318ff1..225f563da0 100644 --- a/reference/algorithm/ranges_equal_range.md +++ b/reference/algorithm/ranges_equal_range.md @@ -10,23 +10,55 @@ namespace std::ranges { sentinel_for S, class T, class Proj = identity, - indirect_strict_weak_order> Comp = ranges::less> + indirect_strict_weak_order< + const T*, + projected + > Comp = ranges::less> constexpr subrange equal_range(I first, S last, const T& value, Comp comp = {}, Proj proj = {}); // (1) C++20 + template S, + class Proj = identity, + class T = projected_value_t, + indirect_strict_weak_order< + const T*, + projected + > Comp = ranges::less> + constexpr subrange + equal_range(I first, + S last, + const T& value, + Comp comp = {}, + Proj proj = {}); // (1) C++26 template , Proj>> Comp = ranges::less> + indirect_strict_weak_order< + const T*, + projected, Proj> + > Comp = ranges::less> constexpr borrowed_subrange_t equal_range(R&& r, const T& value, Comp comp = {}, Proj proj = {}); // (2) C++20 + template , Proj>, + indirect_strict_weak_order< + const T*, + projected, Proj> + > Comp = ranges::less> + constexpr borrowed_subrange_t + equal_range(R&& r, + const T& value, + Comp comp = {}, + Proj proj = {}); // (2) C++26 } ``` * forward_iterator[link /reference/iterator/forward_iterator.md] @@ -57,11 +89,21 @@ namespace std::ranges { ## 戻り値 `{`[`ranges::lower_bound`](ranges_lower_bound.md)`(first, last, value, comp, proj), `[`ranges::upper_bound`](ranges_upper_bound.md)`(first, last, value, comp, proj)}` + ## 計算量 最大で 2 * log2(`last - first`) + O(1) 回の比較を行う +## 備考 +- (1), (2) : + - C++26 : 引数として波カッコ初期化`{}`を受け付ける + ```cpp + std::vector v; + auto result = std::ranges::equal_range(v, {a, b}); + ``` + ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -93,7 +135,7 @@ int main() * std::ranges::sort[link ranges_sort.md] * std::ranges::equal_range[color ff0000] -### 出力 +#### 出力 ``` size: 2 3 @@ -102,6 +144,44 @@ size: 2 size: 0 ``` +### 波カッコ初期化を入力として使用する (C++26) +```cpp example +#include +#include +#include + +struct Point { + int x; + int y; + + bool operator==(const Point& other) const = default; + auto operator<=>(const Point& other) const = default; +}; + +int main() { + std::vector v = { + {1, 2}, + {3, 4}, + {3, 4}, + {5, 6}, + }; + + // 値{3, 4}が見つかる範囲を取得 + auto result = std::ranges::equal_range(v, {3, 4}); + + for (const Point& p : result) { + std::cout << p.x << "," << p.y << std::endl; + } +} +``` +* std::ranges::equal_range[color ff0000] + +#### 出力 +``` +3,4 +3,4 +``` + ## バージョン ### 言語 - C++20 @@ -114,3 +194,5 @@ size: 0 ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) + - C++26で波カッコ初期化 (リスト初期化) に対応した From 93b8c47923f9c1090573b00a071cad863607d0a1 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 27 May 2025 15:06:45 +0900 Subject: [PATCH 1766/3948] =?UTF-8?q?binary=5Fsearch=20:=20C++26=E6=B3=A2?= =?UTF-8?q?=E3=82=AB=E3=83=83=E3=82=B3=E5=88=9D=E6=9C=9F=E5=8C=96=E3=81=AB?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C=20#1311?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/binary_search.md | 97 ++++++++++++++++----- reference/algorithm/ranges_binary_search.md | 79 ++++++++++++++++- 2 files changed, 153 insertions(+), 23 deletions(-) diff --git a/reference/algorithm/binary_search.md b/reference/algorithm/binary_search.md index 342f67c3df..a1c10635e2 100644 --- a/reference/algorithm/binary_search.md +++ b/reference/algorithm/binary_search.md @@ -5,27 +5,35 @@ ```cpp namespace std { - template - bool binary_search(ForwardIterator first, - ForwardIterator last, - const T& value); // (1) C++03 - - template - constexpr bool binary_search(ForwardIterator first, - ForwardIterator last, - const T& value); // (1) C++20 - - template - bool binary_search(ForwardIterator first, - ForwardIterator last, - const T& value, - Compare comp); // (2) C++03 - - template - constexpr bool binary_search(ForwardIterator first, - ForwardIterator last, - const T& value, - Compare comp); // (2) C++20 + template + bool + binary_search(ForwardIterator first, + ForwardIterator last, + const T& value); // (1) C++03 + template + constexpr bool + binary_search(ForwardIterator first, + ForwardIterator last, + const T& value); // (1) C++20 + + template + bool + binary_search(ForwardIterator first, + ForwardIterator last, + const T& value, + Compare comp); // (2) C++03 + template + constexpr bool + binary_search(ForwardIterator first, + ForwardIterator last, + const T& value, + Compare comp); // (2) C++20 } ``` @@ -49,9 +57,16 @@ namespace std { ## 備考 - `comp` は 2 引数の関数オブジェクトで、1 番目の引数が 2 番目の引数「より小さい」場合に `true` を、そうでない場合に `false` を返すものとして扱われる。 +- (1), (2) : + - C++26 : 引数として波カッコ初期化`{}`を受け付ける + ```cpp + std::vector v; + bool found = std::binary_search(v.begin(), v.end(), {a, b}); + ``` ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -74,6 +89,44 @@ int main() ``` * std::binary_search[color ff0000] +#### 出力 +``` +found +``` + +### 波カッコ初期化を入力として使用する (C++26) +```cpp example +#include +#include +#include + +struct Point { + int x; + int y; + + bool operator==(const Point& other) const = default; + auto operator<=>(const Point& other) const = default; +}; + +int main() { + std::vector v = { + {1, 2}, + {3, 4}, + {5, 6}, + }; + + // 値{3, 4}を二分検索 + bool found = std::binary_search(v.begin(), v.end(), {3, 4}); + if (found) { + std::cout << "found" << std::endl; + } + else { + std::cout << "not found" << std::endl; + } +} +``` +* std::binary_search[color ff0000] + ### 出力 ``` found @@ -114,3 +167,5 @@ bool binary_search(ForwardIterator first, ForwardIterator last, - [LWG Issue 787. complexity of `binary_search`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#787) - C++03までの計算量が間違っていたので、C++11で修正。 - [P0202R3 Add Constexpr Modifiers to Functions in `` and `` Headers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0202r3.html) +- [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) + - C++26で波カッコ初期化 (リスト初期化) に対応した diff --git a/reference/algorithm/ranges_binary_search.md b/reference/algorithm/ranges_binary_search.md index 54df913138..7c950f41a6 100644 --- a/reference/algorithm/ranges_binary_search.md +++ b/reference/algorithm/ranges_binary_search.md @@ -10,13 +10,30 @@ namespace std::ranges { sentinel_for S, class T, class Proj = identity, - indirect_strict_weak_order> Comp = ranges::less> + indirect_strict_weak_order< + const T*, + projected + > Comp = ranges::less> constexpr bool binary_search(I first, S last, const T& value, Comp comp = {}, Proj proj = {}); // (1) C++20 + template S, + class Proj = identity, + class T = projected_value_t, + indirect_strict_weak_order< + const T*, + projected + > Comp = ranges::less> + constexpr bool + binary_search(I first, + S last, + const T& value, + Comp comp = {}, + Proj proj = {}); // (1) C++26 template , Proj>, + indirect_strict_weak_order< + const T*, + projected, Proj> + > Comp = ranges::less> + constexpr bool + binary_search(R&& r, + const T& value, + Comp comp = {}, + Proj proj = {}); // (2) C++26 } ``` * forward_iterator[link /reference/iterator/forward_iterator.md] @@ -65,9 +94,15 @@ namespace std::ranges { ## 備考 - `comp` は 2 引数の関数オブジェクトで、1 番目の引数が 2 番目の引数「より小さい」場合に `true` を、そうでない場合に `false` を返すものとして扱われる。 - +- (1), (2) : + - C++26 : 引数として波カッコ初期化`{}`を受け付ける + ```cpp + std::vector v; + bool found = std::ranges::binary_search(v, {a, b}); + ``` ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -90,6 +125,44 @@ int main() ``` * std::ranges::binary_search[color ff0000] +#### 出力 +``` +found +``` + +### 波カッコ初期化を入力として使用する (C++26) +```cpp example +#include +#include +#include + +struct Point { + int x; + int y; + + bool operator==(const Point& other) const = default; + auto operator<=>(const Point& other) const = default; +}; + +int main() { + std::vector v = { + {1, 2}, + {3, 4}, + {5, 6}, + }; + + // 値{3, 4}を二分検索 + bool found = std::ranges::binary_search(v, {3, 4}); + if (found) { + std::cout << "found" << std::endl; + } + else { + std::cout << "not found" << std::endl; + } +} +``` +* std::ranges::binary_search[color ff0000] + ### 出力 ``` found @@ -107,3 +180,5 @@ found ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) + - C++26で波カッコ初期化 (リスト初期化) に対応した From 18c5fd30b91a20479cf45076a4b48e3b59b7fd6e Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 27 May 2025 16:36:03 +0900 Subject: [PATCH 1767/3948] =?UTF-8?q?fold=E9=96=A2=E4=BF=82=20:=20C++26?= =?UTF-8?q?=E6=B3=A2=E3=82=AB=E3=83=83=E3=82=B3=E5=88=9D=E6=9C=9F=E5=8C=96?= =?UTF-8?q?=E3=81=AB=E5=AF=BE=E5=BF=9C=20#1311?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_fold_left.md | 99 +++++++++++++---- .../algorithm/ranges_fold_left_with_iter.md | 83 ++++++++++++--- reference/algorithm/ranges_fold_right.md | 100 ++++++++++++++---- 3 files changed, 225 insertions(+), 57 deletions(-) diff --git a/reference/algorithm/ranges_fold_left.md b/reference/algorithm/ranges_fold_left.md index 3477c8c6d4..8c7651f38e 100644 --- a/reference/algorithm/ranges_fold_left.md +++ b/reference/algorithm/ranges_fold_left.md @@ -6,13 +6,39 @@ ```cpp namespace std::ranges { - template S, class T, - indirectly-binary-left-foldable F> - constexpr auto fold_left(I first, S last, T init, F f); // (1) - - template> F> - constexpr auto fold_left(R&& r, T init, F f); // (2) + template S, + class T, + indirectly-binary-left-foldable F> + constexpr auto + fold_left(I first, + S last, + T init, + F f); // (1) C++23 + template S, + class T = iter_value_t, + indirectly-binary-left-foldable F> + constexpr auto + fold_left(I first, + S last, + T init, + F f); // (1) C++26 + + template > F> + constexpr auto + fold_left(R&& r, + T init, + F f); // (2) C++23 + template , + indirectly-binary-left-foldable> F> + constexpr auto + fold_left(R&& r, + T init, + F f); // (2) C++26 } ``` * input_iterator[link /reference/iterator/input_iterator.md] @@ -116,19 +142,22 @@ concept indirectly-binary-left-foldable = 入力範囲`r`(`[first, last)`)の要素数を`N`とすると、正確に`N`回の`f`の適用が行われる。 ## 備考 - -この関数の戻り値型は、入力の型`F, T, I`から次のような`U`として取得される - -```cpp -using U = decay_t>>; -``` -* decay_t[link /reference/type_traits/decay.md] -* invoke_result_t[link /reference/type_traits/invoke_result.md] -* iter_reference_t[link /reference/iterator/iter_reference_t.md] - -すなわち、指定した二項演算を初期値とイテレータによって`f(std::move(init), *first)`のように呼び出した時の戻り値型がこの関数の戻り値型となる。 - -また、この型`U`は`fold_left`の処理内部で積算値の型として使用されるものでもあり、`f`は`init`の代わりに`U`の右辺値も受け取れる必要がある。二項演算の呼び出しにおいては、第一引数に初期値もしくは積算値が渡され、第二引数にイテレータの間接参照結果が直接渡される。そして、二項演算の適用結果は積算値を保存する変数に直接代入される(つまり、結果を次のステップに引き継ぎたい場合は積算処理も二項演算内で行う必要がある)。詳細は下の実装例を参照。 +- この関数の戻り値型は、入力の型`F, T, I`から次のような`U`として取得される + ```cpp + using U = decay_t>>; + ``` + * decay_t[link /reference/type_traits/decay.md] + * invoke_result_t[link /reference/type_traits/invoke_result.md] + * iter_reference_t[link /reference/iterator/iter_reference_t.md] + + - すなわち、指定した二項演算を初期値とイテレータによって`f(std::move(init), *first)`のように呼び出した時の戻り値型がこの関数の戻り値型となる。 + - また、この型`U`は`fold_left`の処理内部で積算値の型として使用されるものでもあり、`f`は`init`の代わりに`U`の右辺値も受け取れる必要がある。二項演算の呼び出しにおいては、第一引数に初期値もしくは積算値が渡され、第二引数にイテレータの間接参照結果が直接渡される。そして、二項演算の適用結果は積算値を保存する変数に直接代入される(つまり、結果を次のステップに引き継ぎたい場合は積算処理も二項演算内で行う必要がある)。詳細は下の実装例を参照。 +- (1), (2) : + - C++26 : 引数として波カッコ初期化`{}`を受け付ける + ```cpp + std::vector v; + T sum = std::ranges::fold_left(v, {a, b}, op); + ``` ## 例 @@ -172,7 +201,7 @@ int main() { * plus[link /reference/functional/plus.md] * println[link /reference/print/println.md] -### 出力 +#### 出力 ``` 55 1.125 @@ -217,12 +246,36 @@ int main() { * println[link /reference/print/println.md] * fold_right[link ranges_fold_right.md] -### 出力 +#### 出力 ``` init -> a -> b -> c -> d -> e -> f init -> f -> e -> d -> c -> b -> a ``` +### 波カッコ初期化を入力として使用する (C++26) +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3}; + + int sum = std::ranges::fold_left( + v, + {}, + [](auto&& a, auto&& b) { return a + b; } + ); + std::println("{}", sum); +} +``` +* std::ranges::fold_left[color ff0000] + +#### 出力 +``` +6 +``` + ## 実装例 ```cpp @@ -273,3 +326,5 @@ constexpr auto fold_left(I first, S last, T init, F f) { - [P2322R6 `ranges::fold`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2322r6.html) - [プログラミングHaskellのfoldr, foldlの説明が秀逸だった件 - あと味](https://taiju.hatenablog.com/entry/20130202/1359773888) +- [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) + - C++26で波カッコ初期化 (リスト初期化) に対応した diff --git a/reference/algorithm/ranges_fold_left_with_iter.md b/reference/algorithm/ranges_fold_left_with_iter.md index a1e264bbcb..1646732ec9 100644 --- a/reference/algorithm/ranges_fold_left_with_iter.md +++ b/reference/algorithm/ranges_fold_left_with_iter.md @@ -6,13 +6,39 @@ ```cpp namespace std::ranges { - template S, class T, - indirectly-binary-left-foldable F> - constexpr auto fold_left_with_iter(I first, S last, T init, F f); // (1) - - template> F> - constexpr auto fold_left_with_iter(R&& r, T init, F f); // (2) + template S, + class T, + indirectly-binary-left-foldable F> + constexpr auto + fold_left_with_iter(I first, + S last, + T init, + F f); // (1) C++23 + template S, + class T = iter_value_t, + indirectly-binary-left-foldable F> + constexpr auto + fold_left_with_iter(I first, + S last, + T init, + F f); // (1) C++26 + + template > F> + constexpr auto + fold_left_with_iter(R&& r, + T init, + F f); // (2) C++23 + template , + indirectly-binary-left-foldable> F> + constexpr auto + fold_left_with_iter(R&& r, + T init, + F f); // (2) C++26 } ``` * input_iterator[link /reference/iterator/input_iterator.md] @@ -96,10 +122,15 @@ constexpr fold_left_with_iter_result, U> 入力範囲`r`(`[first, last)`)の要素数を`N`とすると、正確に`N`回の`f`の適用が行われる。 ## 備考 +- 戻り値の項で使用している`U`は、指定した二項演算を初期値とイテレータによって`f(std::move(init), *first)`のように呼び出した時の戻り値型であり、`fold_left_with_iter()`の処理内部で積算値の型として使用されるものでもある。 +- `fold_left`同様に、`f`は`init`の代わりに`U`の右辺値も受け取れる必要がある。二項演算の呼び出しにおいては、第一引数に初期値もしくは積算値が渡され、第二引数にイテレータの間接参照結果が直接渡される。そして、二項演算の適用結果は積算値を保存する変数に直接代入される(つまり、結果を次のステップに引き継ぎたい場合は積算処理も二項演算内で行う必要がある)。詳細は下の実装例を参照。 +- (1), (2) : + - C++26 : 引数として波カッコ初期化`{}`を受け付ける + ```cpp + std::vector v; + auto [end, sum] = std::ranges::fold_left_with_iter(v, {a, b}, op); + ``` -戻り値の項で使用している`U`は、指定した二項演算を初期値とイテレータによって`f(std::move(init), *first)`のように呼び出した時の戻り値型であり、`fold_left_with_iter()`の処理内部で積算値の型として使用されるものでもある。 - -`fold_left`同様に、`f`は`init`の代わりに`U`の右辺値も受け取れる必要がある。二項演算の呼び出しにおいては、第一引数に初期値もしくは積算値が渡され、第二引数にイテレータの間接参照結果が直接渡される。そして、二項演算の適用結果は積算値を保存する変数に直接代入される(つまり、結果を次のステップに引き継ぎたい場合は積算処理も二項演算内で行う必要がある)。詳細は下の実装例を参照。 ## 例 @@ -141,7 +172,7 @@ int main() { * plus[link /reference/functional/plus.md] * println[link /reference/print/println.md] -### 出力 +#### 出力 ``` { true, 55 } { true, 1.125 } @@ -178,7 +209,7 @@ int main() { * println[link /reference/print/println.md] * value_or[link /reference/optional/optional/value_or.md] -### 出力 +#### 出力 ``` -1 -1 @@ -222,13 +253,37 @@ int main() { * subrange[link /reference/ranges/subrange.md] * println[link /reference/print/println.md] -### 出力 +#### 出力 ``` sum = 36 mul = 36288, 36288 ``` +### 波カッコ初期化を入力として使用する (C++26) +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3}; + + auto [end, sum] = std::ranges::fold_left_with_iter( + v, + {}, + [](auto&& a, auto&& b) { return a + b; } + ); + std::println("{} {}", end == v.end(), sum); +} +``` +* std::ranges::fold_left_with_iter[color ff0000] + +#### 出力 +``` +true 6 +``` + ## 実装例 ```cpp @@ -282,3 +337,5 @@ constexpr auto fold_left_with_iter(I first, S last, T init, F f) -> fold_left_wi ## 参照 - [P2322R6 `ranges::fold`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2322r6.html) +- [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) + - C++26で波カッコ初期化 (リスト初期化) に対応した diff --git a/reference/algorithm/ranges_fold_right.md b/reference/algorithm/ranges_fold_right.md index 96a13edc2a..2c418690b1 100644 --- a/reference/algorithm/ranges_fold_right.md +++ b/reference/algorithm/ranges_fold_right.md @@ -6,13 +6,39 @@ ```cpp namespace std::ranges { - template S, class T, - indirectly-binary-right-foldable F> - constexpr auto fold_right(I first, S last, T init, F f); // (1) - - template> F> - constexpr auto fold_right(R&& r, T init, F f); // (2) + template S, + class T, + indirectly-binary-right-foldable F> + constexpr auto + fold_right(I first, + S last, + T init, + F f); // (1) C++23 + template S, + class T = iter_value_t, + indirectly-binary-right-foldable F> + constexpr auto + fold_right(I first, + S last, + T init, + F f); // (1) C++23 + + template > F> + constexpr auto + fold_right(R&& r, + T init, + F f); // (2) C++23 + template , + indirectly-binary-right-foldable> F> + constexpr auto + fold_right(R&& r, + T init, + F f); // (2) C++26 } ``` * bidirectional_iterator[link /reference/iterator/bidirectional_iterator.md] @@ -113,19 +139,23 @@ return accum; 入力範囲`r`(`[first, last)`)の要素数を`N`とすると、正確に`N`回の`f`の適用が行われる。 ## 備考 +- この関数の戻り値型は、入力の型`F, T, I`から次のような`U`として取得される + ```cpp + using U = decay_t, T>>; + ``` + * decay_t[link /reference/type_traits/decay.md] + * invoke_result_t[link /reference/type_traits/invoke_result.md] + * iter_reference_t[link /reference/iterator/iter_reference_t.md] + + - すなわち、指定した二項演算をイテレータと初期値によって`f(*first, std::move(init))`のように呼び出した時の戻り値型がこの関数の戻り値型となる。 + - また、この型`U`は`fold_right`の処理内部で積算値の型として使用されるものでもあり、`f`は`init`の代わりに`U`の右辺値も受け取れる必要がある。二項演算の呼び出しにおいては、第一引数にイテレータの間接参照結果が直接渡され、第二引数に初期値もしくは積算値が渡される。そして、二項演算の適用結果は積算値を保存する変数に直接代入される(つまり、結果を次のステップに引き継ぎたい場合は積算処理も二項演算内で行う必要がある)。詳細は下の実装例を参照。 +- (1), (2) : + - C++26 : 引数として波カッコ初期化`{}`を受け付ける + ```cpp + std::vector v; + T sum = std::ranges::fold_right(v, {a, b}, op); + ``` -この関数の戻り値型は、入力の型`F, T, I`から次のような`U`として取得される - -```cpp -using U = decay_t, T>>; -``` -* decay_t[link /reference/type_traits/decay.md] -* invoke_result_t[link /reference/type_traits/invoke_result.md] -* iter_reference_t[link /reference/iterator/iter_reference_t.md] - -すなわち、指定した二項演算をイテレータと初期値によって`f(*first, std::move(init))`のように呼び出した時の戻り値型がこの関数の戻り値型となる。 - -また、この型`U`は`fold_right`の処理内部で積算値の型として使用されるものでもあり、`f`は`init`の代わりに`U`の右辺値も受け取れる必要がある。二項演算の呼び出しにおいては、第一引数にイテレータの間接参照結果が直接渡され、第二引数に初期値もしくは積算値が渡される。そして、二項演算の適用結果は積算値を保存する変数に直接代入される(つまり、結果を次のステップに引き継ぎたい場合は積算処理も二項演算内で行う必要がある)。詳細は下の実装例を参照。 ## 例 @@ -170,7 +200,7 @@ int main() { * plus[link /reference/functional/plus.md] * println[link /reference/print/println.md] -### 出力 +#### 出力 ``` 55 1.125 @@ -217,7 +247,7 @@ int main() { * println[link /reference/print/println.md] * fold_left[link /reference/algorithm/ranges_fold_left.md] -### 出力 +#### 出力 ``` init -> a -> b -> c -> d -> e -> f init -> f -> e -> d -> c -> b -> a @@ -255,11 +285,35 @@ int main() { * iota[link /reference/ranges/iota_view.md] * println[link /reference/print/println.md] -### 出力 +#### 出力 ``` [10, 9, 8, 7, 6, 5, 4, 3, 2, 1] ``` +### 波カッコ初期化を入力として使用する (C++26) +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3}; + + int sum = std::ranges::fold_right( + v, + {}, + [](auto&& a, auto&& b) { return a + b; } + ); + std::println("{}", sum); +} +``` +* std::ranges::fold_right[color ff0000] + +#### 出力 +``` +6 +``` + ## 実装例 ```cpp @@ -309,3 +363,5 @@ constexpr auto fold_right(I first, S last, T init, F f) { - [P2322R6 `ranges::fold`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2322r6.html) - [プログラミングHaskellのfoldr, foldlの説明が秀逸だった件 - あと味](https://taiju.hatenablog.com/entry/20130202/1359773888) +- [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) + - C++26で波カッコ初期化 (リスト初期化) に対応した From 1350ce71a23944efb2f73e7eabded20f52930d17 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 27 May 2025 16:52:49 +0900 Subject: [PATCH 1768/3948] =?UTF-8?q?find=5Flast,=20contains=20:=20C++26?= =?UTF-8?q?=E6=B3=A2=E3=82=AB=E3=83=83=E3=82=B3=E5=88=9D=E6=9C=9F=E5=8C=96?= =?UTF-8?q?=E3=81=AB=E5=AF=BE=E5=BF=9C=20#1311?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_contains.md | 118 +++++++++++++++++++++--- reference/algorithm/ranges_find_last.md | 105 +++++++++++++++++++-- 2 files changed, 202 insertions(+), 21 deletions(-) diff --git a/reference/algorithm/ranges_contains.md b/reference/algorithm/ranges_contains.md index be782ad089..2f3e2ded39 100644 --- a/reference/algorithm/ranges_contains.md +++ b/reference/algorithm/ranges_contains.md @@ -6,16 +6,59 @@ ```cpp namespace ranges { - // (1) - template S, class T, class Proj = identity> - requires indirect_binary_predicate, const T*> - constexpr bool contains(I first, S last, const T& value, Proj proj = {}); - - // (2) - template - requires - indirect_binary_predicate, Proj>, const T*> - constexpr bool contains(R&& r, const T& value, Proj proj = {}); + template S, + class T, + class Proj = identity> + requires indirect_binary_predicate< + ranges::equal_to, + projected, + const T* + > + constexpr bool + contains(I first, + S last, + const T& value, + Proj proj = {}); // (1) C++23 + template S, + class Proj = identity, + class T = projected_value_t> + requires indirect_binary_predicate< + ranges::equal_to, + projected, + const T* + > + constexpr bool + contains(I first, + S last, + const T& value, + Proj proj = {}); // (1) C++26 + + template + requires indirect_binary_predicate< + ranges::equal_to, + projected, Proj>, + const T* + > + constexpr bool + contains(R&& r, + const T& value, + Proj proj = {}); // (2) C++23 + template , Proj>> + requires indirect_binary_predicate< + ranges::equal_to, + projected, Proj>, + const T* + > + constexpr bool + contains(R&& r, + const T& value, + Proj proj = {}); // (2) C++26 } ``` @@ -25,25 +68,72 @@ namespace ranges { - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する + ## 戻り値 ```cpp ranges::find(std::move(first), last, value, proj) != last ``` * ranges::find[link ranges_find.md] + ## 計算量 最大で `last - first` 回比較を行う +## 備考 +- (1), (2) : + - C++26 : 引数として波カッコ初期化`{}`を受け付ける + ```cpp + std::vector v; + bool found = std::ranges::contains(r, {a, b}); + ``` + + ## 例 +### 基本的な使い方 ```cpp example #include #include #include int main() { - constexpr std::array v = { 3, 1, 4 }; - if (std::ranges::contains(v, 1)) { + constexpr std::array ar = { 3, 1, 4 }; + if (std::ranges::contains(ar, 1)) { + std::println("found"); + } else { + std::println("not found"); + } +} +``` +* std::ranges::contains[color ff0000] + +#### 出力 +``` +found +``` + +### 波カッコ初期化を入力として使用する (C++26) +```cpp example +#include +#include +#include + +struct Point { + int x; + int y; + + bool operator==(const Point& other) const = default; +}; + +int main() { + std::vector v = { + {1, 2}, + {3, 4}, + {5, 6} + }; + + bool found = std::ranges::contains(v, {3, 4}); + if (found) { std::println("found"); } else { std::println("not found"); @@ -52,7 +142,7 @@ int main() { ``` * std::ranges::contains[color ff0000] -### 出力 +#### 出力 ``` found ``` @@ -90,3 +180,5 @@ inline constexpr contains_impl contains; ## 参照 - [N4950 27 Algorithms library](https://timsong-cpp.github.io/cppwp/n4950/algorithms) +- [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) + - C++26で波カッコ初期化 (リスト初期化) に対応した diff --git a/reference/algorithm/ranges_find_last.md b/reference/algorithm/ranges_find_last.md index 47afea8da5..a2c7878bc6 100644 --- a/reference/algorithm/ranges_find_last.md +++ b/reference/algorithm/ranges_find_last.md @@ -10,21 +10,55 @@ namespace std::ranges { sentinel_for S, class T, class Proj = identity> - requires indirect_binary_predicate, const T*> + requires indirect_binary_predicate< + ranges::equal_to, + projected, + const T* + > constexpr ranges::subrange find_last(I first, S last, const T& value, Proj proj = {}); // (1) C++23 + template S, + class Proj = identity, + class T = projected_value_t> + requires indirect_binary_predicate< + ranges::equal_to, + projected, + const T* + > + constexpr ranges::subrange + find_last(I first, + S last, + const T& value, + Proj proj = {}); // (1) C++26 template - requires indirect_binary_predicate, Proj>, const T*> + requires indirect_binary_predicate< + ranges::equal_to, + projected, Proj>, + const T* + > constexpr ranges::borrowed_subrange_t find_last(R&& r, const T& value, Proj proj = {}); // (2) C++23 + template , Proj>> + requires indirect_binary_predicate< + ranges::equal_to, + projected, Proj>, + const T* + > + constexpr ranges::borrowed_subrange_t + find_last(R&& r, + const T& value, + Proj proj = {}); // (2) C++26 } ``` * forward_iterator[link /reference/iterator/forward_iterator.md] @@ -50,31 +84,82 @@ namespace std::ranges { 最大で `last - first` 回比較を行う +## 備考 +- (1), (2) : + - C++26 : 引数として波カッコ初期化`{}`を受け付ける + ```cpp + std::vector v; + bool found = std::ranges::find_last(r, {a, b}); + ``` + + ## 例 +### 基本的な使い方 ```cpp example #include #include #include int main() { - constexpr std::array v = { 3, 1, 4, 1, 5 }; - const auto result = std::ranges::find_last(v, 1); - if (result.begin() == v.end()) { + constexpr std::array ar = { 3, 1, 4, 1, 5 }; + const std::ranges::subrange result = std::ranges::find_last(ar, 1); + if (result.begin() == ar.end()) { std::cout << "not found" << std::endl; } else { std::cout << "found: " << *result.begin() << std::endl; - std::cout << " pos: " << std::distance(v.begin(), result.begin()) << std::endl; + std::cout << " pos: " << std::distance(ar.begin(), result.begin()) << std::endl; } } ``` * std::ranges::find_last[color ff0000] -### 出力 +#### 出力 ``` found: 1 pos: 3 ``` +### 波カッコ初期化を入力として使用する (C++26) +```cpp example +#include +#include +#include + +struct Point { + int x; + int y; + + bool operator==(const Point& other) const = default; +}; + +std::ostream& operator<<(std::ostream& os, const Point& p) { + return os << p.x << ',' << p.y; +} + +int main() { + constexpr std::array ar = {{ + {1, 2}, + {3, 4}, + {5, 6} + }}; + + const std::ranges::subrange result = std::ranges::find_last(ar, {3, 4}); + if (result.begin() == ar.end()) { + std::cout << "not found" << std::endl; + } else { + std::cout << "found: " << *result.begin() << std::endl; + std::cout << " pos: " << std::distance(ar.begin(), result.begin()) << std::endl; + } +} +``` +* std::ranges::find_last[color ff0000] + +#### 出力 +``` +found: 3,4 + pos: 1 +``` + ## バージョン ### 言語 @@ -87,4 +172,8 @@ found: 1 - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 -- [P1223R5 find_last](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1223r5.pdf) +- [P1223R5 `find_last`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1223r5.pdf) +- [P3217R0 Adjoints to "Enabling list-initialization for algorithms": `find_last`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3217r0.html) + - C++26で波カッコ初期化 (リスト初期化) に対応した + - 関連文書: + - [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) From 0dfcb84d27bb4a6a4eed9c75a13522415335c80a Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 27 May 2025 17:08:10 +0900 Subject: [PATCH 1769/3948] =?UTF-8?q?ranges::find=20:=20=E5=B0=84=E5=BD=B1?= =?UTF-8?q?=E5=A4=89=E6=8F=9B=E3=81=AE=E4=BE=8B=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_find.md | 56 ++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/reference/algorithm/ranges_find.md b/reference/algorithm/ranges_find.md index 7f76d59763..41dfe9d96f 100644 --- a/reference/algorithm/ranges_find.md +++ b/reference/algorithm/ranges_find.md @@ -102,6 +102,62 @@ int main() { found: 1 ``` +### 射影変換を使用した例 +```cpp example +#include +#include +#include +#include + +struct Item { + int id; + std::string name; +}; + +int main() { + std::vector v = { + {1, "aaa"}, + {3, "bbb"}, + {5, "ccc"} + }; + + // メンバ変数ポインタを使って特定のメンバ変数で検索 + { + auto it = std::ranges::find( + v, + std::string("bbb"), + &Item::name + ); + if (it == v.end()) { + std::cout << "not found" << std::endl; + } else { + std::cout << "found: " << it->id << ',' << it->name << std::endl; + } + } + + // ラムダ式で特定のメンバ変数を検索 + { + auto it = std::ranges::find( + v, + std::string("bbb"), + [](const Item& x) { return x.name; } + ); + if (it == v.end()) { + std::cout << "not found" << std::endl; + } else { + std::cout << "found: " << it->id << ',' << it->name << std::endl; + } + } +} +``` +* std::ranges::find[color ff0000] + +#### 出力 +``` +found: 3,bbb +found: 3,bbb +``` + ### 波カッコ初期化を入力として使用する (C++26) ```cpp example #include From 1f87d6a9e341dd8e5fe7a0f74d7545a804e9895a Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 27 May 2025 17:23:04 +0900 Subject: [PATCH 1770/3948] =?UTF-8?q?ranges::count,=20equal=5Frange,=20low?= =?UTF-8?q?er=5Fbound=20:=20=E5=B0=84=E5=BD=B1=E5=A4=89=E6=8F=9B=E3=81=AE?= =?UTF-8?q?=E4=BE=8B=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_count.md | 37 +++++++++++++++ reference/algorithm/ranges_equal_range.md | 56 +++++++++++++++++++++++ reference/algorithm/ranges_lower_bound.md | 56 +++++++++++++++++++++++ 3 files changed, 149 insertions(+) diff --git a/reference/algorithm/ranges_count.md b/reference/algorithm/ranges_count.md index 0c35048156..294f0855ba 100644 --- a/reference/algorithm/ranges_count.md +++ b/reference/algorithm/ranges_count.md @@ -142,6 +142,43 @@ int main() { count of {1,2}: 2 ``` +### 射影変換を使用した例 +```cpp example +#include +#include +#include +#include + +struct Item { + int id; + std::string label; +}; + +int main() { + std::vector v = { + {1, "foo"}, + {3, "bar"}, + {5, "foo"}, + {2, "baz"}, + }; + + // メンバ変数ポインタを使って label=="foo" の要素数を数える + int n1 = std::ranges::count(v, std::string("foo"), &Item::label); + std::cout << "count of label==\"foo\": " << n1 << std::endl; + + // ラムダ式を使って id==1 の要素数を数える + int n2 = std::ranges::count(v, 1, [](const Item& p) { return p.id; }); + std::cout << "count of id==1: " << n2 << std::endl; +} +``` +* std::ranges::count[color ff0000] + +#### 出力 +``` +count of label=="foo": 2 +count of id==1: 2 +``` + ## 実装例 ```cpp diff --git a/reference/algorithm/ranges_equal_range.md b/reference/algorithm/ranges_equal_range.md index 225f563da0..fa5266fb4a 100644 --- a/reference/algorithm/ranges_equal_range.md +++ b/reference/algorithm/ranges_equal_range.md @@ -182,6 +182,62 @@ int main() { 3,4 ``` +### 射影変換を使用した例 +```cpp example +#include +#include +#include +#include + +struct X { + int id; + std::string name; +}; + +int main() { + std::vector v = { + {1, "Carol"}, + {3, "Alice"}, + {4, "Bob"}, + {4, "Bob"}, + {5, "Eve"}, + {6, "Dave"} + }; + const std::string key = "Bob"; + + // メンバ変数nameをキーとして検索 + // 1. メンバ変数ポインタを使う方法 + auto result1 = std::ranges::equal_range(v, key, {}, &X::name); + std::cout << "[メンバ変数ポインタ]" << std::endl; + for (const X& x : result1) { + std::cout << "id=" << x.id << " name=" << x.name << std::endl; + } + + // 2. ラムダ式を使う方法 + auto result2 = std::ranges::equal_range( + v, + key, + {}, + [](const X& x) { return x.name; } +); + std::cout << "[ラムダ式]" << std::endl; + for (const X& x : result2) { + std::cout << "id=" << x.id << " name=" << x.name << std::endl; + } +} +``` +* std::ranges::equal_range[color ff0000] + +#### 出力 +``` +[メンバ変数ポインタ] +id=4 name=Bob +id=4 name=Bob +[ラムダ式] +id=4 name=Bob +id=4 name=Bob +``` + ## バージョン ### 言語 - C++20 diff --git a/reference/algorithm/ranges_lower_bound.md b/reference/algorithm/ranges_lower_bound.md index 9fb2c56598..9b4d1be4fa 100644 --- a/reference/algorithm/ranges_lower_bound.md +++ b/reference/algorithm/ranges_lower_bound.md @@ -230,6 +230,62 @@ int main() { pos=2 ``` +### 射影変換を使用した例 +```cpp example +#include +#include +#include +#include + +struct X { + int id; + std::string name; +}; + +int main() { + std::vector v = { + {1, "Carol"}, + {3, "Alice"}, + {4, "Bob"}, + {5, "Eve"}, + {6, "Dave"} + }; + const std::string key = "Bob"; + + // nameメンバ変数をキーとして検索 + // 1. メンバ変数ポインタを使う方法 + auto it1 = std::ranges::lower_bound(v, key, {}, &X::name); + if (it1 != v.end() && it1->name == key) { + std::size_t pos = std::ranges::distance(v.begin(), it1); + std::cout << "id=" << it1->id + << " name=" << it1->name + << " pos=" << pos << std::endl; + } + + // 2. ラムダ式を使う方法 + auto it2 = std::ranges::lower_bound( + v, + key, + {}, + [](const X& x) { return x.name; } + ); + if (it2 != v.end() && it2->name == key) { + std::size_t pos = std::ranges::distance(v.begin(), it2); + std::cout << "id=" << it2->id + << " name=" << it2->name + << " pos=" << pos << std::endl; + } +} +``` +* std::ranges::lower_bound[color ff0000] +* std::ranges::distance[link /reference/iterator/ranges_distance.md] + +#### 出力 +``` +id=4 name=Bob pos=2 +id=4 name=Bob pos=2 +``` + ## バージョン ### 言語 - C++20 From 9094beb997b31879c2fe78a6249d4cddc5163ba6 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 27 May 2025 17:59:26 +0900 Subject: [PATCH 1771/3948] =?UTF-8?q?fold=5Fleft,=20fold=5Fright=20:=20?= =?UTF-8?q?=E7=AE=87=E6=9D=A1=E6=9B=B8=E3=81=8D=E3=81=AE=E8=A1=A8=E7=A4=BA?= =?UTF-8?q?=E5=B4=A9=E3=82=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_fold_left.md | 1 + reference/algorithm/ranges_fold_right.md | 1 + 2 files changed, 2 insertions(+) diff --git a/reference/algorithm/ranges_fold_left.md b/reference/algorithm/ranges_fold_left.md index 8c7651f38e..cd35caa38d 100644 --- a/reference/algorithm/ranges_fold_left.md +++ b/reference/algorithm/ranges_fold_left.md @@ -152,6 +152,7 @@ concept indirectly-binary-left-foldable = - すなわち、指定した二項演算を初期値とイテレータによって`f(std::move(init), *first)`のように呼び出した時の戻り値型がこの関数の戻り値型となる。 - また、この型`U`は`fold_left`の処理内部で積算値の型として使用されるものでもあり、`f`は`init`の代わりに`U`の右辺値も受け取れる必要がある。二項演算の呼び出しにおいては、第一引数に初期値もしくは積算値が渡され、第二引数にイテレータの間接参照結果が直接渡される。そして、二項演算の適用結果は積算値を保存する変数に直接代入される(つまり、結果を次のステップに引き継ぎたい場合は積算処理も二項演算内で行う必要がある)。詳細は下の実装例を参照。 + - (1), (2) : - C++26 : 引数として波カッコ初期化`{}`を受け付ける ```cpp diff --git a/reference/algorithm/ranges_fold_right.md b/reference/algorithm/ranges_fold_right.md index 2c418690b1..89531d1fde 100644 --- a/reference/algorithm/ranges_fold_right.md +++ b/reference/algorithm/ranges_fold_right.md @@ -149,6 +149,7 @@ return accum; - すなわち、指定した二項演算をイテレータと初期値によって`f(*first, std::move(init))`のように呼び出した時の戻り値型がこの関数の戻り値型となる。 - また、この型`U`は`fold_right`の処理内部で積算値の型として使用されるものでもあり、`f`は`init`の代わりに`U`の右辺値も受け取れる必要がある。二項演算の呼び出しにおいては、第一引数にイテレータの間接参照結果が直接渡され、第二引数に初期値もしくは積算値が渡される。そして、二項演算の適用結果は積算値を保存する変数に直接代入される(つまり、結果を次のステップに引き継ぎたい場合は積算処理も二項演算内で行う必要がある)。詳細は下の実装例を参照。 + - (1), (2) : - C++26 : 引数として波カッコ初期化`{}`を受け付ける ```cpp From ae2af9069e2ce2af75afc1660f0568839fafbc13 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 27 May 2025 19:13:29 +0900 Subject: [PATCH 1772/3948] execution: split (#1384) --- reference/execution/execution.md | 2 +- reference/execution/execution/into_variant.md | 1 + .../execution/execution/on-stop-request.md | 1 + reference/execution/execution/split.md | 404 ++++++++++++++++++ reference/execution/execution/then.md | 1 + reference/execution/execution/when_all.md | 8 +- .../execution/when_all_with_variant.md | 3 +- 7 files changed, 415 insertions(+), 5 deletions(-) create mode 100644 reference/execution/execution/split.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index ff06aaaa96..c103bdf8ee 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -122,7 +122,7 @@ namespace std::execution { | [`execution::let_error`](execution/let_error.md.nolink) | エラー完了結果から入れ子の非同期操作へ変換 (customization point object) | C++26 | | [`execution::let_stopped`](execution/let_stopped.md.nolink) | 停止完了を入れ子の非同期操作へ変換 (customization point object) | C++26 | | [`execution::bulk`](execution/bulk.md.nolink) | インデクス空間上で指定関数を連続実行 (customization point object) | C++26 | -| [`execution::split`](execution/split.md.nolink) | 入力Senderの値を複製送信 (customization point object) | C++26 | +| [`execution::split`](execution/split.md) | 入力Senderの値を複製回送信可能とする (customization point object) | C++26 | | [`execution::when_all`](execution/when_all.md) | 全ての入力Sender完了を待機 (customization point object) | C++26 | | [`execution::when_all_with_variant`](execution/when_all_with_variant.md) | 複数の値完了シグネチャをもつ全ての入力Sender完了を待機 (customization point object) | C++26 | | [`execution::into_variant`](execution/into_variant.md) | 複数の値完了シグネチャを単一[`variant`](/reference/variant/variant.md)型の値完了シグネチャに変換 (customization point object) | C++26 | diff --git a/reference/execution/execution/into_variant.md b/reference/execution/execution/into_variant.md index 3e912ee224..afabb4205a 100644 --- a/reference/execution/execution/into_variant.md +++ b/reference/execution/execution/into_variant.md @@ -203,4 +203,5 @@ int main() ## 参照 +- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/on-stop-request.md b/reference/execution/execution/on-stop-request.md index 06ad7d68cb..447aa6986d 100644 --- a/reference/execution/execution/on-stop-request.md +++ b/reference/execution/execution/on-stop-request.md @@ -24,6 +24,7 @@ struct on-stop-request { ## 関連項目 - [`execution::when_all`](when_all.md) +- [`execution::split`](split.md) ## 参照 diff --git a/reference/execution/execution/split.md b/reference/execution/execution/split.md new file mode 100644 index 0000000000..0f68960cc3 --- /dev/null +++ b/reference/execution/execution/split.md @@ -0,0 +1,404 @@ +# split +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct split_t { unspecified }; + inline constexpr split_t split{}; +} +``` +* unspecified[italic] + +## 概要 +`split`は、任意の入力[Sender](sender.md)を複数回[接続(connect)](connect.md)可能とするSenderアダプタである。 + +`split`はパイプライン記法をサポートする。 + + +## 効果 +説明用の型`split-env`を、インスタンス`env`に対して式[`get_stop_token`](../get_stop_token.md)`(env)`が適格かつ型[`inplace_stop_token`](/reference/stop_token/inplace_stop_token.md)をもつ型とする。 + +説明用の式`sndr`に対して、型`Sndr`を`decltype((sndr))`とする。[`sender_in`](sender_in.md)` == false`のとき、呼び出し式`split(sndr)`は不適格となる。 + +そうでなければ、呼び出し式`split(sndr)`は`sndr`が1回だけ評価されることを除いて、下記と等価。 + +```cpp +transform_sender(get-domain-early(sndr), make-sender(split, {}, sndr)) +``` +* transform_sender[link transform_sender.md] +* get-domain-early[link get-domain-early.md] +* make-sender[link make-sender.md] + + +### Senderアルゴリズムタグ `split` +説明用のSenderアルゴリズムタグ型`split-impl-tag`を空の型とする。説明用の式`sndr`に対して、式`split.transform_sender(sndr)`は下記と等価。 + +```cpp +auto&& [tag, _, child] = sndr; +auto* sh_state = new shared-state{std::forward_like(child)}; +return make-sender(split-impl-tag(), shared-wrapper{sh_state, tag}); +``` +* make-sender[link make-sender.md] + +説明用の型`shared-wrapper`は、`sh_state`が指す`shared-state`オブジェクトの参照カウントを管理するクラスである。 + +- `shared-wrapper`は[`copyable`](/reference/concepts/copyable.md)のモデルである。 +- ムーブ操作 : 移動済みオブジェクトをヌルとする。 +- コピー操作 : `sh_state->inc-ref()`を呼び出して参照カウントをインクリメントする。 +- 代入操作 : Copy-And-Swap操作を行う。 +- デストラクタ : `sh_state`がヌルのときは何もしない。そうでないとき、`sh_state->dec-ref()`を評価して参照カウントをデクリメントする。 + + +### Senderアルゴリズムタグ `split-impl-tag` +Senderアルゴリズム動作説明用のクラステンプレート[`impls-for`](impls-for.md)に対して、下記の特殊化が定義される。 + +```cpp +namespace std::execution { + template<> + struct impls-for : default-impls { + static constexpr auto get-state = see below; + static constexpr auto start = see below; + }; +} +``` +* impls-for[link impls-for.md] +* default-impls[link impls-for.md] +* see below[italic] + +`impls-for::get-state`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 + +```cpp +[](Sndr&& sndr, auto& rcvr) noexcept { + return local-state{std::forward(sndr), rcvr}; +} +``` + +`impls-for::start`メンバは、下記の関数呼び出し演算子をもつオブジェクトで初期化される。 + +```cpp +template +void operator()(local-state& state, Rcvr& rcvr) const noexcept; +``` + +効果 : `state.sh_state->completed == true`のとき、`state.notify()`を評価してリターンする。そうでなければ、下記を順番に行う。 + +- 以下を評価する。 + + ```cpp + state.on_stop.emplace( + get_stop_token(get_env(rcvr)), + on-stop-request{state.sh_state->stop_src}); + ``` + * emplace[link /reference/optional/optional/emplace.md] + * get_stop_token[link ../get_stop_token.md] + * get_env[link get_env.md] + * on-stop-request[link on-stop-request.md] + +- 下記をアトミックに行う。 + - `state.sh_state->completed`の値`c`を読み取り + - `c == false`のとき、`state.sh_state->waiting_state`に[`addressof`](/reference/memory/addressof.md)`(state)`を挿入する +- `c == true`ならば、`state.notify()`を呼び出してリターンする。 +- そうではなく、[`addressof`](/reference/memory/addressof.md)`(state)`が`state.sh_state->waiting_state`に最初に追加されるアイテムならば、`state.sh_state->start-op()`を評価する。 + + +## 説明専用エンティティ +### `local-state`クラステンプレート + +```cpp +namespace std::execution { + struct local-state-base { // exposition only + virtual ~local-state-base() = default; + virtual void notify() noexcept = 0; // exposition only + }; + + template + struct local-state : local-state-base { // exposition only + using on-stop-callback = // exposition only + stop_callback_for_t>, on-stop-request>; + + local-state(Sndr&& sndr, Rcvr& rcvr) noexcept; + ~local-state(); + + void notify() noexcept override; + + private: + optional on_stop; // exposition only + shared-state* sh_state; // exposition only + Rcvr* rcvr; // exposition only + }; +} +``` +* stop_callback_for_t[link /reference/stop_token/stop_callback_for_t.md] +* stop_token_of_t[link ../stop_token_of_t.md] +* env_of_t[link env_of_t.md] +* on-stop-request[link on-stop-request.md] +* optional[link /reference/optional/optional.md] + +```cpp +local-state(Sndr&& sndr, Rcvr& rcvr) noexcept; +``` + +- 効果 : 下記と等価。 + + ```cpp + auto& [_, data, _] = sndr; + this->sh_state = data.sh_state.get(); + this->sh_state->inc-ref(); + this->rcvr = addressof(rcvr); + ``` + * addressof[link /reference/memory/addressof.md] + +```cpp +~local-state(); +``` + +- 効果 : 下記と等価。 + + ```cpp + sh_state->dec-ref(); + ``` + +```cpp +void notify() noexcept override; +``` + +- 効果 : 下記と等価。 + + ```cpp + on_stop.reset(); + visit( + [this](const auto& tupl) noexcept -> void { + apply( + [this](auto tag, const auto&... args) noexcept -> void { + tag(std::move(*rcvr), args...); + }, + tupl); + }, + sh_state->result); + ``` + * reset()[link /reference/optional/optional/reset.md] + * visit[link /reference/variant/visit.md] + * apply[link /reference/tuple/apply.md] + * std::move[link /reference/utility/move.md] + + +### `split-receiver`クラステンプレート + +```cpp +namespace std::execution { + template + struct split-receiver { // exposition only + using receiver_concept = receiver_t; + + template + void complete(Tag, Args&&... args) noexcept { // exposition only + using tuple_t = decayed-tuple; + try { + sh_state->result.template emplace(Tag(), std::forward(args)...); + } catch (...) { + using tuple_t = tuple; + sh_state->result.template emplace(set_error, current_exception()); + } + sh_state->notify(); + } + + template + void set_value(Args&&... args) && noexcept { + complete(execution::set_value, std::forward(args)...); + } + + template + void set_error(Error&& err) && noexcept { + complete(execution::set_error, std::forward(err)); + } + + void set_stopped() && noexcept { + complete(execution::set_stopped); + } + + struct env { // exposition only + shared-state* sh-state; // exposition only + + inplace_stop_token query(get_stop_token_t) const noexcept { + return sh-state->stop_src.get_token(); + } + }; + + env get_env() const noexcept { + return env{sh_state}; + } + + shared-state* sh_state; // exposition only + }; +} +``` +* receiver_t[link receiver.md] +* decayed-tuple[link decayed-tuple.md] +* template emplace[link /reference/variant/variant/emplace.md] +* set_error_t[link set_error.md] +* exception_ptr[link /reference/exception/exception_ptr.md] +* current_exception()[link /reference/exception/current_exception.md] +* execution::set_value[link set_value.md] +* execution::set_error[link set_error.md] +* execution::set_stopped[link set_stopped.md] +* inplace_stop_token[link /reference/stop_token/inplace_stop_token.md] +* get_stop_token_t[link ../get_stop_token.md] +* get_token()[link /reference/stop_token/inplace_stop_source/get_token.md] + + +### `shared-state`クラステンプレート + +```cpp +namespace std::execution { + template + struct shared-state { + using variant-type = see below; // exposition only + using state-list-type = see below; // exposition only + + explicit shared-state(Sndr&& sndr); + + void start-op() noexcept; // exposition only + void notify() noexcept; // exposition only + void inc-ref() noexcept; // exposition only + void dec-ref() noexcept; // exposition only + + inplace_stop_source stop_src{}; // exposition only + variant-type result{}; // exposition only + state-list-type waiting_states; // exposition only + atomic completed{false}; // exposition only + atomic ref_count{1}; // exposition only + connect_result_t> op_state; // exposition only + }; +} +``` +* inplace_stop_source[link /reference/stop_token/inplace_stop_source.md] +* atomic[link /reference/atomic/atomic.md] +* connect_result_t[link connect_result_t.md] +* see below[italic] + +- 説明用のパック`Sigs`を[`completion_signatures_of_t`](completion_signatures_of_t.md)``による[`completion_signatures`](completion_signatures.md)特殊化のテンプレートパラメータと定義する。説明用の型`Tag`とパック`Args`に対して、説明用のエイリアステンプレート`as-tuple`を[`decayed-tuple`](decayed-tuple.md)``と定義する。型`variant-type`は下記定義において重複削除した型となる。 + + ```cpp + variant, tuple, as-tuple...> + ``` + * variant[link /reference/variant/variant.md] + * tuple[link /reference/tuple/tuple.md] + * set_stopped_t[link set_stopped.md] + * set_error_t[link set_error.md] + * exception_ptr[link /reference/exception/exception_ptr.md] + +- 型`state-list-type`を、`local-state-base`オブジェクトへのポインタのリストを格納し、アトミックに要素挿入できる型とする。 + +```cpp +explicit shared-state(Sndr&& sndr); +``` + +- 効果 : `op_state`を[`connect`](connect.md)`(`[`std::forward`](/reference/utility/forward.md)`(sndr), split-receiver{this})`の結果で初期化する。 +- 事後条件 : `waiting_states`が空、かつ`completed == false` + +```cpp +void start-op() noexcept; +``` + +- 効果 : `inc-ref()`を評価する。`stop_src.`[`stop_requested()`](/reference/stop_token/inplace_stop_source/stop_requested.md) `== ture`のとき`notify()`を評価する。そうでなければ、[`start`](start.md)`(op_state)`を評価する。 + +```cpp +void notify() noexcept; +``` + +- 効果 : 下記をアトミックに行い、ローカル変数`prior_states`の各ポインタ`p`に対して`p->notify()`を評価し、最後に`dec-ref()`を評価する。 + - `completed`に`true`を設定し、 + - `waiting_states`を空のリストと交換し、古い値をローカル変数`prior_states`に格納する。 + +```cpp +void inc-ref() noexcept; +``` + +- 効果 : `ref_count`をインクリメントする。 + +```cpp +void dec-ref() noexcept; +``` + +- 効果 : `ref_count`をデクリメントする。`ref_count`の新たな値が`0`のとき、`delete this`を呼び出す。 +- 同期操作 : `dec-ref()`の評価が`ref_count`を値`0`にデクリメントしないとき、`ref_count`を値`0`へデクリメントする`dec-ref()`の評価に対して同期する。 + + +## カスタマイゼーションポイント +Senderアルゴリズム構築時に、[Sender](sender.md)`sndr`に[関連付けられた実行ドメイン](get-domain-early.md)に対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 +[デフォルト実行ドメイン](default_domain.md)では`split.transform_sender(sndr)`が呼ばれ、前述仕様通りのSenderへと変換される。 + + +## 例 +```cpp example +#include +#include +namespace ex = std::execution; + +int main() +{ + { // 関数呼び出し + ex::sender auto snd0 = ex::just(21); + ex::sender auto snd1 = ex::then(snd0, [](int n) { + std::println("then"); + return 2 * n; + }); + ex::sender auto sndr = ex::split(snd1); + + auto [val1] = std::this_thread::sync_wait(sndr).value(); + std::println("{}", val1); + auto [val2] = std::this_thread::sync_wait(sndr).value(); + std::println("{}", val2); + } + + { // パイプライン記法 + ex::sender auto sndr = + ex::just(21) + | ex::then([](int n) { + std::println("then"); + return 2 * n; + }) + | ex::split(); + + auto [val1] = std::this_thread::sync_wait(sndr).value(); + std::println("{}", val1); + auto [val2] = std::this_thread::sync_wait(sndr).value(); + std::println("{}", val2); + } +} +``` +* ex::split[color ff0000] +* ex::sender[link sender.md] +* ex::just[link just.md] +* ex::then[link then.md] +* std::this_thread::sync_wait[link ../this_thread/sync_wait.md] +* value()[link /reference/optional/optional/value.md] + +### 出力 +``` +then +42 +42 +then +42 +42 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/then.md b/reference/execution/execution/then.md index bdbbdb2a6c..257d738ed4 100644 --- a/reference/execution/execution/then.md +++ b/reference/execution/execution/then.md @@ -127,4 +127,5 @@ C++ ## 参照 +- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/when_all.md b/reference/execution/execution/when_all.md index d22c00b32f..44a3653831 100644 --- a/reference/execution/execution/when_all.md +++ b/reference/execution/execution/when_all.md @@ -16,7 +16,7 @@ namespace std::execution { `when_all`は、複数の入力[Sender](sender.md)が全て完了するまで待機するSenderアダプタである。 `when_all`は全ての入力Senderが[値完了シグネチャ](set_value.md)を1個だけ持つことを要求する。 -値完了シグネチャが複数存在する場合は[`when_all_with_variant`](when_all_with_variant.md)アルゴリズムを利用する +値完了シグネチャが複数存在する場合は[`when_all_with_variant`](when_all_with_variant.md)アルゴリズムを利用する。 - 入力Sender全てが値完了のとき、全ての値完了結果を[`tuple`](/reference/tuple/tuple.md)に結合して値完了操作を行う。 - いずれかがエラー完了のとき、同エラー値をもってエラー完了操作を行う。このとき停止要求が作成される。 @@ -319,6 +319,7 @@ variant ``` * set_stopped[link set_stopped.md] * reset()[link /reference/optional/optional/reset.md] + * std::move[link /reference/utility/move.md] ## カスタマイゼーションポイント @@ -390,8 +391,8 @@ struct MySender { void start() noexcept { auto stok = ex::get_stop_token(ex::get_env(rcvr_)); if (stok.stop_requested()) { -    // 接続先Receiverにおいて停止要求が行われていれば - // MySenderも停止完了により早期リターンする + // 接続先Receiverにおいて停止要求が行われていれば + // 非同期操作も停止完了により早期リターンさせる std::println("{}: set_stopped", val_); ex::set_stopped(std::move(rcvr_)); return; @@ -478,4 +479,5 @@ error=-2 ## 参照 +- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/when_all_with_variant.md b/reference/execution/execution/when_all_with_variant.md index 7aef2d143a..fb413fec84 100644 --- a/reference/execution/execution/when_all_with_variant.md +++ b/reference/execution/execution/when_all_with_variant.md @@ -16,7 +16,7 @@ namespace std::execution { `when_all_with_variant`は、複数の入力[Sender](sender.md)が全て完了するまで待機するSenderアダプタである。 `when_all_with_variant`は入力Senderが複数の[値完了シグネチャ](set_value.md)を持つケースに対応する。 -全入力Senderの値完了シグネチャが1個だけの場合は[`when_all`](when_all.md)アルゴリズムを利用する +全入力Senderの値完了シグネチャが1個だけの場合は[`when_all`](when_all.md)アルゴリズムを利用する。 - 入力Sender全てが値完了のとき、全ての値完了結果を[`variant`](/reference/variant/variant.md)の[`tuple`](/reference/tuple/tuple.md)に結合して値完了操作を行う。 - いずれかがエラー完了のとき、同エラー値をもってエラー完了操作を行う。このとき停止要求が作成される。 @@ -182,4 +182,5 @@ int main() ## 参照 +- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) From b13d26967049fcf31f235581692e7ca01815bdd5 Mon Sep 17 00:00:00 2001 From: Koki Watanabe <56009584+math-hiyoko@users.noreply.github.com> Date: Tue, 27 May 2025 21:07:32 +0900 Subject: [PATCH 1773/3948] Apply suggestions from code review Co-authored-by: Koichi Murase --- reference/unordered_map/unordered_map/clear.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/unordered_map/unordered_map/clear.md b/reference/unordered_map/unordered_map/clear.md index e91f81b0ba..5f72a8196d 100644 --- a/reference/unordered_map/unordered_map/clear.md +++ b/reference/unordered_map/unordered_map/clear.md @@ -41,15 +41,15 @@ void clear() noexcept; 1. 全ての要素を走査して各要素を破棄 2. 全てのバケットを走査して各バケットを初期化 -という手順を取るため、実行時間は概ね [`size`](size.md)`()` + [`bucket_count`](bucket_count.md)`()` に比例する傾向がある。 -規格がコンテナに対して定義する計算量は「コンテナに格納している要素に対する操作の数の計算量」であるためバケットの走査を考慮せず「コンテナの全要素を削除する」として、全要素数Nに対してO(N)に規定されるが、実行時間に影響する時間計算量としてはバケット数Cに対して線形となる。 +という手順を取るため、実際の実行時間はバケット数 [`bucket_count`](bucket_count.md)`()` について線形となる (`size() <= bucket_count() * `[`max_load_factor()`](max_load_factor.md) = O(`bucket_count()`) であることに注意)。 +規格の計算量の要件は要素数 `size()` に線形となっているが、規格がコンテナに対して定義する計算量は「コンテナに格納している要素に対する操作の数の計算量」であるためバケットの走査などを考慮していない。 ## 備考 -- `clear()` は バケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格上は要求していない。 +- `clear()` がバケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格は要求していない。 実装によっては `clear()` 後もバケット配列が維持され、動的メモリが残る場合がある。 - メモリを確実に解放したいときには以下のように操作を行う -```CPP +```cpp std::unordered_map tmp; s.swap(tmp); ``` From 7f7b3ab4fade724c7a1c44062dc15cbabc35a1f5 Mon Sep 17 00:00:00 2001 From: koki watanabe Date: Tue, 27 May 2025 21:10:44 +0900 Subject: [PATCH 1774/3948] fix: reflect suggestions --- reference/unordered_map/unordered_multimap/clear.md | 8 ++++---- reference/unordered_set/unordered_multiset/clear.md | 8 ++++---- reference/unordered_set/unordered_set/clear.md | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/reference/unordered_map/unordered_multimap/clear.md b/reference/unordered_map/unordered_multimap/clear.md index 3c02d091bd..21b00f4702 100644 --- a/reference/unordered_map/unordered_multimap/clear.md +++ b/reference/unordered_map/unordered_multimap/clear.md @@ -41,15 +41,15 @@ void clear() noexcept; 1. 全ての要素を走査して各要素を破棄 2. 全てのバケットを走査して各バケットを初期化 -という手順を取るため、実行時間は概ね [`size`](size.md)`()` + [`bucket_count`](bucket_count.md)`()` に比例する傾向がある。 -規格がコンテナに対して定義する計算量は「コンテナに格納している要素に対する操作の数の計算量」であるためバケットの走査を考慮せず「コンテナの全要素を削除する」として、全要素数Nに対してO(N)に規定されるが、実行時間に影響する時間計算量としてはバケット数Cに対して線形となる。 +という手順を取るため、実際の実行時間はバケット数 [`bucket_count`](bucket_count.md)`()` について線形となる (`size() <= bucket_count() * `[`max_load_factor()`](max_load_factor.md) = O(`bucket_count()`) であることに注意)。 +規格の計算量の要件は要素数 `size()` に線形となっているが、規格がコンテナに対して定義する計算量は「コンテナに格納している要素に対する操作の数の計算量」であるためバケットの走査などを考慮していない。 ## 備考 -- `clear()` は バケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格上は要求していない。 +- `clear()` がバケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格は要求していない。 実装によっては `clear()` 後もバケット配列が維持され、動的メモリが残る場合がある。 - メモリを確実に解放したいときには以下のように操作を行う -```CPP +```cpp std::unordered_multimap tmp; s.swap(tmp); ``` diff --git a/reference/unordered_set/unordered_multiset/clear.md b/reference/unordered_set/unordered_multiset/clear.md index 8120d2c239..8b075a03f5 100644 --- a/reference/unordered_set/unordered_multiset/clear.md +++ b/reference/unordered_set/unordered_multiset/clear.md @@ -41,15 +41,15 @@ void clear() noexcept; 1. 全ての要素を走査して各要素を破棄 2. 全てのバケットを走査して各バケットを初期化 -という手順を取るため、実行時間は概ね [`size`](size.md)`()` + [`bucket_count`](bucket_count.md)`()` に比例する傾向がある。 -規格がコンテナに対して定義する計算量は「コンテナに格納している要素に対する操作の数の計算量」であるためバケットの走査を考慮せず「コンテナの全要素を削除する」として、全要素数Nに対してO(N)に規定されるが、実行時間に影響する時間計算量としてはバケット数Cに対して線形となる。 +という手順を取るため、実際の実行時間はバケット数 [`bucket_count`](bucket_count.md)`()` について線形となる (`size() <= bucket_count() * `[`max_load_factor()`](max_load_factor.md) = O(`bucket_count()`) であることに注意)。 +規格の計算量の要件は要素数 `size()` に線形となっているが、規格がコンテナに対して定義する計算量は「コンテナに格納している要素に対する操作の数の計算量」であるためバケットの走査などを考慮していない。 ## 備考 -- `clear()` は バケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格上は要求していない。 +- `clear()` がバケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格は要求していない。 実装によっては `clear()` 後もバケット配列が維持され、動的メモリが残る場合がある。 - メモリを確実に解放したいときには以下のように操作を行う -```CPP +```cpp std::unordered_multiset tmp; s.swap(tmp); ``` diff --git a/reference/unordered_set/unordered_set/clear.md b/reference/unordered_set/unordered_set/clear.md index 0643255597..4569f3e5d1 100644 --- a/reference/unordered_set/unordered_set/clear.md +++ b/reference/unordered_set/unordered_set/clear.md @@ -41,15 +41,15 @@ void clear() noexcept; 1. 全ての要素を走査して各要素を破棄 2. 全てのバケットを走査して各バケットを初期化 -という手順を取るため、実行時間は概ね [`size`](size.md)`()` + [`bucket_count`](bucket_count.md)`()` に比例する傾向がある。 -規格がコンテナに対して定義する計算量は「コンテナに格納している要素に対する操作の数の計算量」であるためバケットの走査を考慮せず「コンテナの全要素を削除する」として、全要素数Nに対してO(N)に規定されるが、実行時間に影響する時間計算量としてはバケット数Cに対して線形となる。 +という手順を取るため、実際の実行時間はバケット数 [`bucket_count`](bucket_count.md)`()` について線形となる (`size() <= bucket_count() * `[`max_load_factor()`](max_load_factor.md) = O(`bucket_count()`) であることに注意)。 +規格の計算量の要件は要素数 `size()` に線形となっているが、規格がコンテナに対して定義する計算量は「コンテナに格納している要素に対する操作の数の計算量」であるためバケットの走査などを考慮していない。 ## 備考 -- `clear()` は バケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格上は要求していない。 +- `clear()` がバケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格は要求していない。 実装によっては `clear()` 後もバケット配列が維持され、動的メモリが残る場合がある。 - メモリを確実に解放したいときには以下のように操作を行う -```CPP +```cpp std::unordered_set tmp; s.swap(tmp); ``` From 349f1175f01f0ed94ea4bb10bee40dc23309b7bc Mon Sep 17 00:00:00 2001 From: koki watanabe Date: Tue, 27 May 2025 21:14:16 +0900 Subject: [PATCH 1775/3948] fix: change statement --- reference/unordered_map/unordered_map/clear.md | 2 +- reference/unordered_map/unordered_multimap/clear.md | 2 +- reference/unordered_set/unordered_multiset/clear.md | 2 +- reference/unordered_set/unordered_set/clear.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/unordered_map/unordered_map/clear.md b/reference/unordered_map/unordered_map/clear.md index 5f72a8196d..224b2d8f2f 100644 --- a/reference/unordered_map/unordered_map/clear.md +++ b/reference/unordered_map/unordered_map/clear.md @@ -39,7 +39,7 @@ void clear() noexcept; ### 計算量に関する備考 - 多くの実装(GCC libstdc++, LLVM libc++ など)は 1. 全ての要素を走査して各要素を破棄 - 2. 全てのバケットを走査して各バケットを初期化 + 2. 全てのバケットを走査して各バケットの状態をリセット という手順を取るため、実際の実行時間はバケット数 [`bucket_count`](bucket_count.md)`()` について線形となる (`size() <= bucket_count() * `[`max_load_factor()`](max_load_factor.md) = O(`bucket_count()`) であることに注意)。 規格の計算量の要件は要素数 `size()` に線形となっているが、規格がコンテナに対して定義する計算量は「コンテナに格納している要素に対する操作の数の計算量」であるためバケットの走査などを考慮していない。 diff --git a/reference/unordered_map/unordered_multimap/clear.md b/reference/unordered_map/unordered_multimap/clear.md index 21b00f4702..11fb1a1031 100644 --- a/reference/unordered_map/unordered_multimap/clear.md +++ b/reference/unordered_map/unordered_multimap/clear.md @@ -39,7 +39,7 @@ void clear() noexcept; ### 計算量に関する備考 - 多くの実装(GCC libstdc++, LLVM libc++ など)は 1. 全ての要素を走査して各要素を破棄 - 2. 全てのバケットを走査して各バケットを初期化 + 2. 全てのバケットを走査して各バケットの状態をリセット という手順を取るため、実際の実行時間はバケット数 [`bucket_count`](bucket_count.md)`()` について線形となる (`size() <= bucket_count() * `[`max_load_factor()`](max_load_factor.md) = O(`bucket_count()`) であることに注意)。 規格の計算量の要件は要素数 `size()` に線形となっているが、規格がコンテナに対して定義する計算量は「コンテナに格納している要素に対する操作の数の計算量」であるためバケットの走査などを考慮していない。 diff --git a/reference/unordered_set/unordered_multiset/clear.md b/reference/unordered_set/unordered_multiset/clear.md index 8b075a03f5..aadc66f8fd 100644 --- a/reference/unordered_set/unordered_multiset/clear.md +++ b/reference/unordered_set/unordered_multiset/clear.md @@ -39,7 +39,7 @@ void clear() noexcept; ### 計算量に関する備考 - 多くの実装(GCC libstdc++, LLVM libc++ など)は 1. 全ての要素を走査して各要素を破棄 - 2. 全てのバケットを走査して各バケットを初期化 + 2. 全てのバケットを走査して各バケットの状態をリセット という手順を取るため、実際の実行時間はバケット数 [`bucket_count`](bucket_count.md)`()` について線形となる (`size() <= bucket_count() * `[`max_load_factor()`](max_load_factor.md) = O(`bucket_count()`) であることに注意)。 規格の計算量の要件は要素数 `size()` に線形となっているが、規格がコンテナに対して定義する計算量は「コンテナに格納している要素に対する操作の数の計算量」であるためバケットの走査などを考慮していない。 diff --git a/reference/unordered_set/unordered_set/clear.md b/reference/unordered_set/unordered_set/clear.md index 4569f3e5d1..acd8bc23c9 100644 --- a/reference/unordered_set/unordered_set/clear.md +++ b/reference/unordered_set/unordered_set/clear.md @@ -39,7 +39,7 @@ void clear() noexcept; ### 計算量に関する備考 - 多くの実装(GCC libstdc++, LLVM libc++ など)は 1. 全ての要素を走査して各要素を破棄 - 2. 全てのバケットを走査して各バケットを初期化 + 2. 全てのバケットを走査して各バケットの状態をリセット という手順を取るため、実際の実行時間はバケット数 [`bucket_count`](bucket_count.md)`()` について線形となる (`size() <= bucket_count() * `[`max_load_factor()`](max_load_factor.md) = O(`bucket_count()`) であることに注意)。 規格の計算量の要件は要素数 `size()` に線形となっているが、規格がコンテナに対して定義する計算量は「コンテナに格納している要素に対する操作の数の計算量」であるためバケットの走査などを考慮していない。 From 876474cda3ade253d72668edd968a4131ed58e14 Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 28 May 2025 00:49:34 +0900 Subject: [PATCH 1776/3948] execution: bulk (#1384) --- reference/execution/execution.md | 2 +- reference/execution/execution/bulk.md | 137 +++++++++++++++++++++ reference/execution/execution/let_value.md | 1 + 3 files changed, 139 insertions(+), 1 deletion(-) create mode 100644 reference/execution/execution/bulk.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index c103bdf8ee..ef8fdbfc64 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -121,7 +121,7 @@ namespace std::execution { | [`execution::let_value`](execution/let_value.md) | 値完了結果から入れ子の非同期操作へ変換 (customization point object) | C++26 | | [`execution::let_error`](execution/let_error.md.nolink) | エラー完了結果から入れ子の非同期操作へ変換 (customization point object) | C++26 | | [`execution::let_stopped`](execution/let_stopped.md.nolink) | 停止完了を入れ子の非同期操作へ変換 (customization point object) | C++26 | -| [`execution::bulk`](execution/bulk.md.nolink) | インデクス空間上で指定関数を連続実行 (customization point object) | C++26 | +| [`execution::bulk`](execution/bulk.md) | インデクス空間上で指定関数を反復実行 (customization point object) | C++26 | | [`execution::split`](execution/split.md) | 入力Senderの値を複製回送信可能とする (customization point object) | C++26 | | [`execution::when_all`](execution/when_all.md) | 全ての入力Sender完了を待機 (customization point object) | C++26 | | [`execution::when_all_with_variant`](execution/when_all_with_variant.md) | 複数の値完了シグネチャをもつ全ての入力Sender完了を待機 (customization point object) | C++26 | diff --git a/reference/execution/execution/bulk.md b/reference/execution/execution/bulk.md new file mode 100644 index 0000000000..82ad14e323 --- /dev/null +++ b/reference/execution/execution/bulk.md @@ -0,0 +1,137 @@ +# bulk +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct bulk_t { unspecified }; + inline constexpr bulk_t bulk{}; +} +``` +* unspecified[italic] + +## 概要 +`bulk`は、インデクス空間の各インデクスに対してタスクを反復実行するSenderアダプタである。 + +`bulk`はパイプライン記法をサポートする。 + + +## 効果 +説明用の式`sndr`, `shape`, `f`に対して、型`Shape`を`decltype(auto(shape))`とする。下記いずれかの条件をみたすとき、呼び出し式`bulk(sndr, shape, f)`は不適格となる。 + +- `decltype((sndr))`が[`sender`](sender.md)を満たさない、もしくは +- `Shape`が[`integral`](/reference/concepts/integral.md)を満たさない、もしくは +- `decltype((f))`が[`movable-value`](../movable-value.md)を満たさないとき。 + +そうでなければ、呼び出し式`bulk(sndr, shape, f)`は`sndr`が1回だけ評価されることを除いて、下記と等価。 + +```cpp +transform_sender(get-domain-early(sndr), make-sender(bulk, product-type{shape, f}, sndr)) +``` +* transform_sender[link transform_sender.md] +* get-domain-early[link get-domain-early.md] +* make-sender[link make-sender.md] +* product-type[link product-type.md] + + +### Senderアルゴリズムタグ `bulk` +Senderアルゴリズム動作説明用のクラステンプレート[`impls-for`](impls-for.md)に対して、下記の特殊化が定義される。 + +```cpp +namespace std::execution { + template<> + struct impls-for : default-impls { + static constexpr auto complete = see below; + }; +} +``` +* impls-for[link impls-for.md] +* default-impls[link impls-for.md] +* see below[italic] + +`impls-for::complete`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 + +```cpp +[] + (Index, State& state, Rcvr& rcvr, Tag, Args&&... args) noexcept -> void requires see below { + if constexpr (same_as) { + auto& [shape, f] = state; + constexpr bool nothrow = noexcept(f(auto(shape), args...)); + TRY-EVAL(rcvr, [&]() noexcept(nothrow) { + for (decltype(auto(shape)) i = 0; i < shape; ++i) { + f(auto(i), args...); + } + Tag()(std::move(rcvr), std::forward(args)...); + }()); + } else { + Tag()(std::move(rcvr), std::forward(args)...); + } + } +``` +* set_value_t[link set_value.md] +* TRY-EVAL[link TRY-EVAL.md.nolink] +* std::move[link /reference/utility/move.md] +* see below[italic] + +型`Tag`が[`set_value_t`](set_value.md)以外の型であるとき、もしくは式`f(auto(shape), args...)`が適格なときに限って、上記ラムダ式のrequires節が満たされる。 + + +## カスタマイゼーションポイント +Senderアルゴリズム構築時および[Receiver](receiver.md)接続時に、関連付けられた実行ドメインに対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 +[デフォルト実行ドメイン](default_domain.md)では無変換。 + +説明用の式`out_sndr`を`bulk(sndr, shape, f)`の戻り値[Sender](sender.md)とし、式`rcvr`を式[`connect`](connect.md)`(out_sndr, rcvr)`が適格となる[Receiver](receiver.md)とする。式[`connect`](connect.md)`(out_sndr, rcvr)`は[開始(start)](start.md)時に下記を満たす非同期操作を生成しない場合、動作は未定義となる。 + +- 値完了操作において、パック`args`を入力[Sender](sender.md)の値完了結果データを参照する左辺値式としたとき、型`Shape`の半開区間`[0, Shape)`における全ての`i`に対して`f(i, args...)`を呼び出すこと。 +- `sndr`により送信された全ての完了操作を伝搬すること。 + + +## 備考 +非同期実行フレームワークで定義される[デフォルト実行ドメイン](default_domain.md)では、`bulk`に指定したタスク`f`は単一スレッド上で逐次実行される。 + + +## 例 +```cpp example +#include +#include +namespace ex = std::execution; + +int main() +{ + ex::sender auto sndr = + ex::just() + | ex::bulk(3, [](int i) { + std::println("{}", i); + }); + std::this_thread::sync_wait(sndr); +} +``` +* ex::bulk[color ff0000] +* ex::sender[link sender.md] +* ex::just[link just.md] +* std::this_thread::sync_wait[link ../this_thread/sync_wait.md] + +### 出力例 +``` +0 +1 +2 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/let_value.md b/reference/execution/execution/let_value.md index 0ed0099578..5a216c85f3 100644 --- a/reference/execution/execution/let_value.md +++ b/reference/execution/execution/let_value.md @@ -114,6 +114,7 @@ namespace std::execution { ``` * set_value[link set_value.md] * decayed-typeof[link decayed-typeof.md.nolink] +* TRY-EVAL[link TRY-EVAL.md.nolink] * std::move[link /reference/utility/move.md] 説明用の式`sndr`と`env`に対して、型`Sndr`を`decltype((sndr))`とする。[`sender-for`](sender-for.md)`> == false`のとき、式`let_value.transform_env(sndr, env)`は不適格となる。 From 1fe3de6f2d3c0162a5f2b4b89231c01f20f24380 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 28 May 2025 14:49:37 +0900 Subject: [PATCH 1777/3948] =?UTF-8?q?projected=20:=20C++26=E3=81=A7?= =?UTF-8?q?=E3=81=AE=E4=B8=8D=E5=AE=8C=E5=85=A8=E5=9E=8B=E3=81=B8=E3=81=AE?= =?UTF-8?q?=E5=AF=BE=E7=AD=96=E3=81=AB=E5=AF=BE=E5=BF=9C=20(close=20#1185)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/projected.md | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/reference/iterator/projected.md b/reference/iterator/projected.md index cf694bbc71..85023e7ad7 100644 --- a/reference/iterator/projected.md +++ b/reference/iterator/projected.md @@ -6,20 +6,30 @@ ```cpp namespace std { - - template Proj> + // (1) C++20の定義 + template Proj> struct projected { using value_type = remove_cvref_t>; indirect_result_t operator*() const; // 宣言のみ }; - - // incrementable_traitsにアダプトする - template + template struct incrementable_traits> { using difference_type = iter_difference_t; }; + + // (1) C++26の定義 + template + struct projected-impl { // 説明用の型 + struct type { // 説明用の型 + using value_type = remove_cvref_t>; + using difference_type = iter_difference_t; // weakly_incrementableをモデル化する場合にのみ存在する + indirect_result_t operator*() const; // 宣言のみで定義なし + }; + }; + template Proj> + using projected = projected-impl::type; } ``` * indirectly_readable[link /reference/iterator/indirectly_readable.md] @@ -34,6 +44,15 @@ namespace std { これは射影操作を受け取るコンセプトやアルゴリズムを制約するために使用するものであり、評価される文脈で使用可能ではない。主に、射影操作の結果に対してイテレータ関連のコンセプトを適用する場合に使用する(射影の結果を再び`indirectly_readable`な型に写す事で、一部のイテレータに対するコンセプトを使いまわす事が出来る)。 + +## 備考 +- C++26: + - C++20の`projected`の定義では、ADLによって不完全型に完全な定義を要求してしまっており、以下のようなコードがコンパイルエラーになっていたが、C++26での定義変更によって不完全型が許容されるようになった。 + ```cpp + Holder *a[10] = {}; + std::ranges::count(a, a + 10, nullptr); // コンパイルエラー + ``` + ## 例 ```cpp example #include @@ -95,3 +114,4 @@ int main() { ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P2538R1 ADL-proof `std::projected`](http://open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2538r1.html) From c3e97ea8a80e4a22e82c6b943a35492f2894d99e Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 28 May 2025 17:09:01 +0900 Subject: [PATCH 1778/3948] =?UTF-8?q?allocator=20:=20C++26=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C=E3=81=A8=E3=81=97=E3=81=A6is=5Falways=5Fequal?= =?UTF-8?q?=E3=82=92=E5=89=8A=E9=99=A4=20(close=20#1242)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/memory/allocator.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/reference/memory/allocator.md b/reference/memory/allocator.md index f38eef148c..7d9970fe2d 100644 --- a/reference/memory/allocator.md +++ b/reference/memory/allocator.md @@ -64,7 +64,7 @@ C++11から: | `reference` | 要素の参照型 `T&` | C++17から非推奨
C++20で削除 | | `const_reference` | 読み取り専用の要素の参照型 `const T&` | C++17から非推奨
C++20で削除 | | `rebind` | 型`U`を確保するように再束縛する | C++17から非推奨
C++20で削除 | -| `is_always_equal` | 同じ型のアロケータオブジェクトが2つある場合、それらが常に同値であるか。[`true_type`](/reference/type_traits/true_type.md) | C++17 | +| `is_always_equal` | 同じ型のアロケータオブジェクトが2つある場合、それらが常に同値であるか。[`true_type`](/reference/type_traits/true_type.md) | C++17
C++20で非推奨
C++26で削除 | ## 非メンバ関数 @@ -87,6 +87,9 @@ C++11から: - なお、プライマリテンプレートからインスタンス化されるようになっても`allocate`/`deallocate`メンバは内部で`sizeof(void)`を要求するため引き続き使用不可能であり、`std::allocator`の使用用途としては従来と同じく再束縛を目的とすることになる(上述のように[`std::allocator_traits`](allocator_traits.md)の代替機能を用いて`typename` [`std::allocator_traits`](allocator_traits.md)`>::template rebind_alloc`のようにする)。 - メンバ型の`size_type`と`difference_type`は、C++17で非推奨となったがC++20で非推奨が取り消された。 +- メンバ型の`is_always_equal`は、このクラスを継承したメモリアロケータが`is_always_equal`の値を引き継いでしまうという点で問題があったため、C++20で非推奨となり、C++26で削除された。 + - 代わりに[`std::allocator_traits`](allocator_traits.md)クラスの`is_always_equal`メンバ型を使用すること。 + ## 例 ```cpp example @@ -140,3 +143,7 @@ int main(int argc, char** argv) { - [P0174R2 Deprecating Vestigial Library Parts in C++17](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0174r2.html) - [P0619R4 Reviewing deprecated facilities of C++17 for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0619r4.html) - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) +- [LWG Issue 3170. `is_always_equal` added to `std::allocator` makes the standard library treat derived types as always equal](https://cplusplus.github.io/LWG/issue3170) + - C++20で`is_always_equal`メンバ型が非推奨化された +- [P2868R3 Remove Deprecated `std::allocator` Typedef From C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2868r3.pdf) + - C++26で`is_always_equal`メンバ型が削除された From 3a27b55ef5f235a317e5a0e7767db1ad05b77998 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 28 May 2025 17:27:36 +0900 Subject: [PATCH 1779/3948] =?UTF-8?q?basic=5Fifstream,=20basic=5Fofstream?= =?UTF-8?q?=20:=20=E3=82=B5=E3=83=B3=E3=83=97=E3=83=AB=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=89=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/fstream/basic_ifstream.md | 29 +++++++++++++++++++++++++++++ reference/fstream/basic_ofstream.md | 25 +++++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/reference/fstream/basic_ifstream.md b/reference/fstream/basic_ifstream.md index 5f0a699a69..c15e79c2c5 100644 --- a/reference/fstream/basic_ifstream.md +++ b/reference/fstream/basic_ifstream.md @@ -50,3 +50,32 @@ namespace std { | `off_type` | `Traits::off_type` | | | `traits_type` | テンプレート仮引数`Traits` | | +## 例 +```cpp example +#include +#include +#include + +int main() { + // example.txtファイルを読み取り専用で開く + std::ifstream ifs("example.txt"); + if (!ifs.is_open()) { + std::cerr << "ファイルを開けませんでした" << std::endl; + return 1; + } + + // ファイルの内容を1行ずつ読み取り、出力する + std::string line; + while (std::getline(ifs, line)) { + std::cout << line << std::endl; + } + + // ファイルを閉じる (デストラクタでも自動的に閉じられる) + ifs.close(); +} +``` +* std::ifstream[color ff0000] +* ifs.is_open[link ifstream/is_open.md] +* ifs.close[link ifstream/close.md] +* std::getline[link /reference/string/basic_string/getline.md] + diff --git a/reference/fstream/basic_ofstream.md b/reference/fstream/basic_ofstream.md index 4f02d74d56..34e226e4f0 100644 --- a/reference/fstream/basic_ofstream.md +++ b/reference/fstream/basic_ofstream.md @@ -50,3 +50,28 @@ namespace std { | `off_type` | `Traits::off_type` | | | `traits_type` | テンプレート仮引数`Traits` | | +## 例 +```cpp example +#include +#include +#include + +int main() { + // example.txtファイルを出力専用で開く + std::ofstream ofs("example.txt"); + if (!ofs.is_open()) { + std::cerr << "ファイルを開けませんでした" << std::endl; + return 1; + } + + // ファイルに文字列を書き込む + ofs << "Hello, world!" << std::endl; + + // ファイルを閉じる (デストラクタでも自動的に閉じられる) + ofs.close(); +} +``` +* std::ofstream[color ff0000] +* ofs.is_open[link ofstream/is_open.md] +* ofs.close[link ofstream/close.md] + From fa3dcb5f9735b4013050ad5b0855e665144f7ef0 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 28 May 2025 17:30:52 +0900 Subject: [PATCH 1780/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=83=9F?= =?UTF-8?q?=E3=82=B9=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/fstream/basic_ifstream.md | 4 ++-- reference/fstream/basic_ofstream.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/fstream/basic_ifstream.md b/reference/fstream/basic_ifstream.md index c15e79c2c5..e012d09da3 100644 --- a/reference/fstream/basic_ifstream.md +++ b/reference/fstream/basic_ifstream.md @@ -75,7 +75,7 @@ int main() { } ``` * std::ifstream[color ff0000] -* ifs.is_open[link ifstream/is_open.md] -* ifs.close[link ifstream/close.md] +* ifs.is_open[link basic_ifstream/is_open.md] +* ifs.close[link basic_ifstream/close.md] * std::getline[link /reference/string/basic_string/getline.md] diff --git a/reference/fstream/basic_ofstream.md b/reference/fstream/basic_ofstream.md index 34e226e4f0..ddccc8f3c7 100644 --- a/reference/fstream/basic_ofstream.md +++ b/reference/fstream/basic_ofstream.md @@ -72,6 +72,6 @@ int main() { } ``` * std::ofstream[color ff0000] -* ofs.is_open[link ofstream/is_open.md] -* ofs.close[link ofstream/close.md] +* ofs.is_open[link basic_ofstream/is_open.md] +* ofs.close[link basic_ofstream/close.md] From cdaf0f76e3f641b39b06efb9a75352f82b8c97a5 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 28 May 2025 17:44:12 +0900 Subject: [PATCH 1781/3948] =?UTF-8?q?fstream=20:=20=E3=82=B5=E3=83=B3?= =?UTF-8?q?=E3=83=97=E3=83=AB=E3=82=B3=E3=83=BC=E3=83=89=E3=81=AE=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=83=87=E3=83=B3=E3=83=88=E3=82=924=20=E2=86=92=202?= =?UTF-8?q?=E3=82=B9=E3=83=9A=E3=83=BC=E3=82=B9=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/fstream/basic_filebuf/close.md | 2 +- reference/fstream/basic_filebuf/is_open.md | 2 +- reference/fstream/basic_filebuf/open.md | 2 +- reference/fstream/basic_fstream/is_open.md | 2 +- reference/fstream/basic_ifstream/is_open.md | 2 +- reference/fstream/basic_ofstream/is_open.md | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/reference/fstream/basic_filebuf/close.md b/reference/fstream/basic_filebuf/close.md index fded215193..f97f54475f 100644 --- a/reference/fstream/basic_filebuf/close.md +++ b/reference/fstream/basic_filebuf/close.md @@ -44,7 +44,7 @@ int main() std::filebuf* buf = fs.rdbuf(); if (buf->open("foo", std::ios_base::out)) { - buf->close(); + buf->close(); } } ``` diff --git a/reference/fstream/basic_filebuf/is_open.md b/reference/fstream/basic_filebuf/is_open.md index ed3cad0bba..8aa2b46134 100644 --- a/reference/fstream/basic_filebuf/is_open.md +++ b/reference/fstream/basic_filebuf/is_open.md @@ -27,7 +27,7 @@ int main() std::filebuf* buf = fs.rdbuf(); if (buf->is_open()) { - std::cout << "opened" << std::endl; + std::cout << "opened" << std::endl; } } ``` diff --git a/reference/fstream/basic_filebuf/open.md b/reference/fstream/basic_filebuf/open.md index b7d1bf2377..9149039d90 100644 --- a/reference/fstream/basic_filebuf/open.md +++ b/reference/fstream/basic_filebuf/open.md @@ -68,7 +68,7 @@ int main() std::filebuf* buf = fs.rdbuf(); if (buf->open("foo", std::ios_base::out)) { - std::cout << "opened" << std::endl; + std::cout << "opened" << std::endl; } } ``` diff --git a/reference/fstream/basic_fstream/is_open.md b/reference/fstream/basic_fstream/is_open.md index 4bd8dc8911..6c4692ad44 100644 --- a/reference/fstream/basic_fstream/is_open.md +++ b/reference/fstream/basic_fstream/is_open.md @@ -26,7 +26,7 @@ int main() { std::fstream fs("foo", std::ios_base::out); if (fs.is_open()) { - std::cout << "opened" << std::endl; + std::cout << "opened" << std::endl; } } ``` diff --git a/reference/fstream/basic_ifstream/is_open.md b/reference/fstream/basic_ifstream/is_open.md index 275105dc75..4c0ce85d0b 100644 --- a/reference/fstream/basic_ifstream/is_open.md +++ b/reference/fstream/basic_ifstream/is_open.md @@ -26,7 +26,7 @@ int main() { std::ifstream fs("foo", std::ios_base::in); if (fs.is_open()) { - std::cout << "opened" << std::endl; + std::cout << "opened" << std::endl; } } ``` diff --git a/reference/fstream/basic_ofstream/is_open.md b/reference/fstream/basic_ofstream/is_open.md index 70646ce849..d5901c468a 100644 --- a/reference/fstream/basic_ofstream/is_open.md +++ b/reference/fstream/basic_ofstream/is_open.md @@ -26,7 +26,7 @@ int main() { std::ofstream fs("foo", std::ios_base::out); if (fs.is_open()) { - std::cout << "opened" << std::endl; + std::cout << "opened" << std::endl; } } ``` From f462880917802c8358138aab564c921e8970daf7 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 28 May 2025 18:17:52 +0900 Subject: [PATCH 1782/3948] =?UTF-8?q?fstream=20:=20C++26=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=E3=81=A8=E3=81=97=E3=81=A6native=5Fhandle=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=20(close=20#1196)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/fstream/basic_filebuf.md | 29 ++++--- .../fstream/basic_filebuf/native_handle.md | 79 ++++++++++++++++++ reference/fstream/basic_fstream.md | 11 ++- .../fstream/basic_fstream/native_handle.md | 82 +++++++++++++++++++ reference/fstream/basic_ifstream.md | 9 ++ .../fstream/basic_ifstream/native_handle.md | 82 +++++++++++++++++++ reference/fstream/basic_ofstream.md | 9 ++ .../fstream/basic_ofstream/native_handle.md | 82 +++++++++++++++++++ 8 files changed, 372 insertions(+), 11 deletions(-) create mode 100644 reference/fstream/basic_filebuf/native_handle.md create mode 100644 reference/fstream/basic_fstream/native_handle.md create mode 100644 reference/fstream/basic_ifstream/native_handle.md create mode 100644 reference/fstream/basic_ofstream/native_handle.md diff --git a/reference/fstream/basic_filebuf.md b/reference/fstream/basic_filebuf.md index 6db55d159e..110b46a665 100644 --- a/reference/fstream/basic_filebuf.md +++ b/reference/fstream/basic_filebuf.md @@ -30,16 +30,6 @@ Cの`FILE*`に対する入出力関数を使って実装される。 | `wfilebuf` | `wchar_t`型。ワイド文字列として使用する。 | | -### 型 - -| 名前 | 説明 | 対応バージョン | -|---------------|----------------------------|----------------| -| `char_type` | テンプレート仮引数`CharT` | | -| `int_type` | `Traits::int_type` | | -| `pos_type` | `Traits::pos_type` | | -| `off_type` | `Traits::off_type` | | -| `traits_type` | テンプレート仮引数`Traits` | | - ### 構築・破棄 | 名前 | 説明 | 対応バージョン | @@ -59,6 +49,13 @@ Cの`FILE*`に対する入出力関数を使って実装される。 | [`open`](basic_filebuf/open.md) | ファイルを開く | | | [`close`](basic_filebuf/close.md) | ファイルを閉じる | | +### 環境固有の情報 + +| 名前 | 説明|対応バージョン | +|-----|-----|-------------| +| [`native_handle()`](basic_filebuf/native_handle.md) | ネイティブハンドルを取得する[処理系定義] | C++26 | + + ### オーバーライドされている関数 すべて`protected`で定義されている。 @@ -76,5 +73,17 @@ Cの`FILE*`に対する入出力関数を使って実装される。 | `pbackfail` | 1文字を入力列に戻す (protected virtual) | | | `overflow` | (protected virtual) | +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|---------------|----------------------------|----------------| +| `char_type` | テンプレート仮引数`CharT` | | +| `int_type` | `Traits::int_type` | | +| `pos_type` | `Traits::pos_type` | | +| `off_type` | `Traits::off_type` | | +| `traits_type` | テンプレート仮引数`Traits` | | +| `native_handle_type` | ネイティブハンドルの型 [処理系定義] | C++26 | + + ## 参照 - [`basic_streambuf`](../streambuf/basic_streambuf.md) diff --git a/reference/fstream/basic_filebuf/native_handle.md b/reference/fstream/basic_filebuf/native_handle.md new file mode 100644 index 0000000000..d17a290dfc --- /dev/null +++ b/reference/fstream/basic_filebuf/native_handle.md @@ -0,0 +1,79 @@ +# native_handle +* fstream[meta header] +* std[meta namespace] +* basic_filebuf[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +native_handle_type native_handle() const noexcept; +``` + +## 概要 +処理系定義のネイティブハンドルを取得する。 + + +## 事前条件 +- [`is_open()`](is_open.md)が`true`を返すこと + + +## 戻り値 +`*this`が指すファイルに対するネイティブハンドルを返す。 + + +## 備考 +- ネイティブハンドルは、ファイルが閉じられると無効になる + + +## 例 +```cpp example +// POSIX環境 +#include +#include +#include + +#include +#include + +int main() { + std::fstream fs("example.txt", std::ios_base::in); + std::filebuf* buf = fs.rdbuf(); + + if (!buf->is_open()) { + std::println("ファイルを開けなかった"); + return 1; + } + + // ネイティブハンドルから、POSIXのAPIでファイルの最終更新日時を取得する + int fd = buf->native_handle(); + struct ::stat s{}; + ::fstat(fd, &s); + + std::chrono::sys_seconds last_modified {std::chrono::seconds(s.st_mtim.tv_sec)}; + std::chrono::zoned_time zoned{"Asia/Tokyo", last_modified}; + std::println("Last modified: {}", zoned); +} +``` +* native_handle[color ff0000] +* std::fstream[link /reference/fstream/basic_fstream.md] +* fs.rdbuf()[link /reference/fstream/basic_fstream/rdbuf.md] +* buf->isopen()[link is_open.md] +* std::chrono::sys_seconds[link /reference/chrono/sys_time.md] +* std::chrono::zoned_time[link /reference/chrono/zoned_time.md] + +### 出力例 +``` +Last modified: 2025-05-28 17:56:55 JST +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 18 [mark verified] +- [GCC](/implementation.md#gcc): 14 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P1759R6 Native handles and file streams](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1759r6.html) \ No newline at end of file diff --git a/reference/fstream/basic_fstream.md b/reference/fstream/basic_fstream.md index e98b27570c..38d2bd7beb 100644 --- a/reference/fstream/basic_fstream.md +++ b/reference/fstream/basic_fstream.md @@ -32,6 +32,13 @@ namespace std { | [`close`](basic_fstream/close.md) | ファイルを閉じる | | +### ネイティブハンドルの取得 + +| 名前 | 説明|対応バージョン | +|-----|-----|-------------| +| [`native_handle()`](basic_fstream/native_handle.md) | ネイティブハンドルを取得する[処理系定義] | C++26 | + + ## 非メンバ関数 | 名前 | 説明 | 対応バージョン | @@ -48,6 +55,8 @@ namespace std { | `pos_type` | `Traits::pos_type` | | | `off_type` | `Traits::off_type` | | | `traits_type` | テンプレート仮引数`Traits` | | +| `native_handle_type` | 処理系定義のネイティブハンドルの型`typename basic_filebuf::native_handle_type` | C++26 | + ## 例 ```cpp example @@ -83,4 +92,4 @@ int main() { } return 0; } -``` \ No newline at end of file +``` diff --git a/reference/fstream/basic_fstream/native_handle.md b/reference/fstream/basic_fstream/native_handle.md new file mode 100644 index 0000000000..7e22f519a7 --- /dev/null +++ b/reference/fstream/basic_fstream/native_handle.md @@ -0,0 +1,82 @@ +# native_handle +* fstream[meta header] +* std[meta namespace] +* basic_fstream[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +native_handle_type native_handle() const noexcept; +``` + +## 概要 +処理系定義のネイティブハンドルを取得する。 + + +## 事前条件 +- [`is_open()`](is_open.md)が`true`を返すこと + + +## 戻り値 +以下と等価: + +```cpp +return rdbuf()->native_handle(); +``` +* rdbuf()[link rdbuf.md] +* native_handle()[link /reference/fstream/basic_filebuf/native_handle.md] + + +## 備考 +- ネイティブハンドルは、ファイルが閉じられると無効になる + + +## 例 +```cpp example +// POSIX環境 +#include +#include +#include + +#include +#include + +int main() { + std::fstream fs("example.txt", std::ios_base::in); + + if (!fs.is_open()) { + std::println("ファイルを開けなかった"); + return 1; + } + + // ネイティブハンドルから、POSIXのAPIでファイルの最終更新日時を取得する + int fd = fs.native_handle(); + struct ::stat s{}; + ::fstat(fd, &s); + + std::chrono::sys_seconds last_modified {std::chrono::seconds(s.st_mtim.tv_sec)}; + std::chrono::zoned_time zoned{"Asia/Tokyo", last_modified}; + std::println("Last modified: {}", zoned); +} +``` +* native_handle[color ff0000] +* fs.is_open()[link is_open.md] +* std::chrono::sys_seconds[link /reference/chrono/sys_time.md] +* std::chrono::zoned_time[link /reference/chrono/zoned_time.md] + +### 出力例 +``` +Last modified: 2025-05-28 17:56:55 JST +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 18 [mark verified] +- [GCC](/implementation.md#gcc): 14 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P1759R6 Native handles and file streams](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1759r6.html) \ No newline at end of file diff --git a/reference/fstream/basic_ifstream.md b/reference/fstream/basic_ifstream.md index e012d09da3..6c1b64081d 100644 --- a/reference/fstream/basic_ifstream.md +++ b/reference/fstream/basic_ifstream.md @@ -33,6 +33,13 @@ namespace std { | [`close`](basic_ifstream/close.md) | ファイルを閉じる | | +### ネイティブハンドルの取得 + +| 名前 | 説明|対応バージョン | +|-----|-----|-------------| +| [`native_handle()`](basic_ifstream/native_handle.md) | ネイティブハンドルを取得する[処理系定義] | C++26 | + + ## 非メンバ関数 | 名前 | 説明 | 対応バージョン | @@ -49,6 +56,8 @@ namespace std { | `pos_type` | `Traits::pos_type` | | | `off_type` | `Traits::off_type` | | | `traits_type` | テンプレート仮引数`Traits` | | +| `native_handle_type` | 処理系定義のネイティブハンドルの型`typename basic_filebuf::native_handle_type` | C++26 | + ## 例 ```cpp example diff --git a/reference/fstream/basic_ifstream/native_handle.md b/reference/fstream/basic_ifstream/native_handle.md new file mode 100644 index 0000000000..c110f4c961 --- /dev/null +++ b/reference/fstream/basic_ifstream/native_handle.md @@ -0,0 +1,82 @@ +# native_handle +* fstream[meta header] +* std[meta namespace] +* basic_ifstream[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +native_handle_type native_handle() const noexcept; +``` + +## 概要 +処理系定義のネイティブハンドルを取得する。 + + +## 事前条件 +- [`is_open()`](is_open.md)が`true`を返すこと + + +## 戻り値 +以下と等価: + +```cpp +return rdbuf()->native_handle(); +``` +* rdbuf()[link rdbuf.md] +* native_handle()[link /reference/fstream/basic_filebuf/native_handle.md] + + +## 備考 +- ネイティブハンドルは、ファイルが閉じられると無効になる + + +## 例 +```cpp example +// POSIX環境 +#include +#include +#include + +#include +#include + +int main() { + std::ifstream ifs("example.txt"); + + if (!ifs.is_open()) { + std::println("ファイルを開けなかった"); + return 1; + } + + // ネイティブハンドルから、POSIXのAPIでファイルの最終更新日時を取得する + int fd = ifs.native_handle(); + struct ::stat s{}; + ::fstat(fd, &s); + + std::chrono::sys_seconds last_modified {std::chrono::seconds(s.st_mtim.tv_sec)}; + std::chrono::zoned_time zoned{"Asia/Tokyo", last_modified}; + std::println("Last modified: {}", zoned); +} +``` +* native_handle[color ff0000] +* ifs.is_open()[link is_open.md] +* std::chrono::sys_seconds[link /reference/chrono/sys_time.md] +* std::chrono::zoned_time[link /reference/chrono/zoned_time.md] + +### 出力例 +``` +Last modified: 2025-05-28 17:56:55 JST +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 18 [mark verified] +- [GCC](/implementation.md#gcc): 14 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P1759R6 Native handles and file streams](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1759r6.html) \ No newline at end of file diff --git a/reference/fstream/basic_ofstream.md b/reference/fstream/basic_ofstream.md index ddccc8f3c7..1bc10e0d7d 100644 --- a/reference/fstream/basic_ofstream.md +++ b/reference/fstream/basic_ofstream.md @@ -33,6 +33,13 @@ namespace std { | [`close`](basic_ofstream/close.md) | ファイルを閉じる | | +### ネイティブハンドルの取得 + +| 名前 | 説明|対応バージョン | +|-----|-----|-------------| +| [`native_handle()`](basic_ofstream/native_handle.md) | ネイティブハンドルを取得する[処理系定義] | C++26 | + + ## 非メンバ関数 | 名前 | 説明 | 対応バージョン | @@ -49,6 +56,8 @@ namespace std { | `pos_type` | `Traits::pos_type` | | | `off_type` | `Traits::off_type` | | | `traits_type` | テンプレート仮引数`Traits` | | +| `native_handle_type` | 処理系定義のネイティブハンドルの型`typename basic_filebuf::native_handle_type` | C++26 | + ## 例 ```cpp example diff --git a/reference/fstream/basic_ofstream/native_handle.md b/reference/fstream/basic_ofstream/native_handle.md new file mode 100644 index 0000000000..d1868a4ba4 --- /dev/null +++ b/reference/fstream/basic_ofstream/native_handle.md @@ -0,0 +1,82 @@ +# native_handle +* fstream[meta header] +* std[meta namespace] +* basic_ofstream[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +native_handle_type native_handle() const noexcept; +``` + +## 概要 +処理系定義のネイティブハンドルを取得する。 + + +## 事前条件 +- [`is_open()`](is_open.md)が`true`を返すこと + + +## 戻り値 +以下と等価: + +```cpp +return rdbuf()->native_handle(); +``` +* rdbuf()[link rdbuf.md] +* native_handle()[link /reference/fstream/basic_filebuf/native_handle.md] + + +## 備考 +- ネイティブハンドルは、ファイルが閉じられると無効になる + + +## 例 +```cpp example +// POSIX環境 +#include +#include +#include + +#include +#include + +int main() { + std::ofstream ofs("example.txt"); + + if (!ofs.is_open()) { + std::println("ファイルを開けなかった"); + return 1; + } + + // ネイティブハンドルから、POSIXのAPIでファイルの最終更新日時を取得する + int fd = ofs.native_handle(); + struct ::stat s{}; + ::fstat(fd, &s); + + std::chrono::sys_seconds last_modified {std::chrono::seconds(s.st_mtim.tv_sec)}; + std::chrono::zoned_time zoned{"Asia/Tokyo", last_modified}; + std::println("Last modified: {}", zoned); +} +``` +* native_handle[color ff0000] +* ofs.is_open()[link is_open.md] +* std::chrono::sys_seconds[link /reference/chrono/sys_time.md] +* std::chrono::zoned_time[link /reference/chrono/zoned_time.md] + +### 出力例 +``` +Last modified: 2025-05-28 17:56:55 JST +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 18 [mark verified] +- [GCC](/implementation.md#gcc): 14 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P1759R6 Native handles and file streams](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1759r6.html) \ No newline at end of file From 8113c79d1e3023d966e2e1d74dd61937219de954 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 28 May 2025 18:19:24 +0900 Subject: [PATCH 1783/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE?= =?UTF-8?q?=E9=A3=BE=E3=83=9F=E3=82=B9=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/fstream/basic_filebuf/native_handle.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/fstream/basic_filebuf/native_handle.md b/reference/fstream/basic_filebuf/native_handle.md index d17a290dfc..50c96b372e 100644 --- a/reference/fstream/basic_filebuf/native_handle.md +++ b/reference/fstream/basic_filebuf/native_handle.md @@ -57,7 +57,7 @@ int main() { * native_handle[color ff0000] * std::fstream[link /reference/fstream/basic_fstream.md] * fs.rdbuf()[link /reference/fstream/basic_fstream/rdbuf.md] -* buf->isopen()[link is_open.md] +* buf->is_open()[link is_open.md] * std::chrono::sys_seconds[link /reference/chrono/sys_time.md] * std::chrono::zoned_time[link /reference/chrono/zoned_time.md] From 16242c558605d77ff06276bab29d0701fdc2c0a9 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 28 May 2025 18:29:15 +0900 Subject: [PATCH 1784/3948] =?UTF-8?q?=E8=A1=A8=E3=81=AE=E8=A1=A8=E7=A4=BA?= =?UTF-8?q?=E5=B4=A9=E3=82=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/fstream/basic_filebuf.md | 4 ++-- reference/fstream/basic_fstream.md | 4 ++-- reference/fstream/basic_ifstream.md | 4 ++-- reference/fstream/basic_ofstream.md | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/reference/fstream/basic_filebuf.md b/reference/fstream/basic_filebuf.md index 110b46a665..5f8acb66ec 100644 --- a/reference/fstream/basic_filebuf.md +++ b/reference/fstream/basic_filebuf.md @@ -51,8 +51,8 @@ Cの`FILE*`に対する入出力関数を使って実装される。 ### 環境固有の情報 -| 名前 | 説明|対応バージョン | -|-----|-----|-------------| +| 名前 | 説明 | 対応バージョン | +|-----|------|--------------| | [`native_handle()`](basic_filebuf/native_handle.md) | ネイティブハンドルを取得する[処理系定義] | C++26 | diff --git a/reference/fstream/basic_fstream.md b/reference/fstream/basic_fstream.md index 38d2bd7beb..6db7c51395 100644 --- a/reference/fstream/basic_fstream.md +++ b/reference/fstream/basic_fstream.md @@ -34,8 +34,8 @@ namespace std { ### ネイティブハンドルの取得 -| 名前 | 説明|対応バージョン | -|-----|-----|-------------| +| 名前 | 説明 | 対応バージョン | +|-----|------|--------------| | [`native_handle()`](basic_fstream/native_handle.md) | ネイティブハンドルを取得する[処理系定義] | C++26 | diff --git a/reference/fstream/basic_ifstream.md b/reference/fstream/basic_ifstream.md index 6c1b64081d..fd40a5789a 100644 --- a/reference/fstream/basic_ifstream.md +++ b/reference/fstream/basic_ifstream.md @@ -35,8 +35,8 @@ namespace std { ### ネイティブハンドルの取得 -| 名前 | 説明|対応バージョン | -|-----|-----|-------------| +| 名前 | 説明 | 対応バージョン | +|-----|------|--------------| | [`native_handle()`](basic_ifstream/native_handle.md) | ネイティブハンドルを取得する[処理系定義] | C++26 | diff --git a/reference/fstream/basic_ofstream.md b/reference/fstream/basic_ofstream.md index 1bc10e0d7d..f370f905a9 100644 --- a/reference/fstream/basic_ofstream.md +++ b/reference/fstream/basic_ofstream.md @@ -35,8 +35,8 @@ namespace std { ### ネイティブハンドルの取得 -| 名前 | 説明|対応バージョン | -|-----|-----|-------------| +| 名前 | 説明 | 対応バージョン | +|-----|------|--------------| | [`native_handle()`](basic_ofstream/native_handle.md) | ネイティブハンドルを取得する[処理系定義] | C++26 | From cdd25735c10e6810c7339cde27161be345589451 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 28 May 2025 18:37:41 +0900 Subject: [PATCH 1785/3948] =?UTF-8?q?=E8=A1=A8=E3=81=AE=E8=A1=A8=E7=A4=BA?= =?UTF-8?q?=E5=B4=A9=E3=82=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/fstream/basic_filebuf.md | 2 +- reference/fstream/basic_fstream.md | 2 +- reference/fstream/basic_ifstream.md | 2 +- reference/fstream/basic_ofstream.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/fstream/basic_filebuf.md b/reference/fstream/basic_filebuf.md index 5f8acb66ec..279610ecc9 100644 --- a/reference/fstream/basic_filebuf.md +++ b/reference/fstream/basic_filebuf.md @@ -51,7 +51,7 @@ Cの`FILE*`に対する入出力関数を使って実装される。 ### 環境固有の情報 -| 名前 | 説明 | 対応バージョン | +| 名前 | 説明 | 対応バージョン | |-----|------|--------------| | [`native_handle()`](basic_filebuf/native_handle.md) | ネイティブハンドルを取得する[処理系定義] | C++26 | diff --git a/reference/fstream/basic_fstream.md b/reference/fstream/basic_fstream.md index 6db7c51395..6213e06747 100644 --- a/reference/fstream/basic_fstream.md +++ b/reference/fstream/basic_fstream.md @@ -34,7 +34,7 @@ namespace std { ### ネイティブハンドルの取得 -| 名前 | 説明 | 対応バージョン | +| 名前 | 説明 | 対応バージョン | |-----|------|--------------| | [`native_handle()`](basic_fstream/native_handle.md) | ネイティブハンドルを取得する[処理系定義] | C++26 | diff --git a/reference/fstream/basic_ifstream.md b/reference/fstream/basic_ifstream.md index fd40a5789a..5e32930896 100644 --- a/reference/fstream/basic_ifstream.md +++ b/reference/fstream/basic_ifstream.md @@ -35,7 +35,7 @@ namespace std { ### ネイティブハンドルの取得 -| 名前 | 説明 | 対応バージョン | +| 名前 | 説明 | 対応バージョン | |-----|------|--------------| | [`native_handle()`](basic_ifstream/native_handle.md) | ネイティブハンドルを取得する[処理系定義] | C++26 | diff --git a/reference/fstream/basic_ofstream.md b/reference/fstream/basic_ofstream.md index f370f905a9..654cec44fb 100644 --- a/reference/fstream/basic_ofstream.md +++ b/reference/fstream/basic_ofstream.md @@ -35,7 +35,7 @@ namespace std { ### ネイティブハンドルの取得 -| 名前 | 説明 | 対応バージョン | +| 名前 | 説明 | 対応バージョン | |-----|------|--------------| | [`native_handle()`](basic_ofstream/native_handle.md) | ネイティブハンドルを取得する[処理系定義] | C++26 | From 47cef6b54e55c03822566220eac1f78bb97913b2 Mon Sep 17 00:00:00 2001 From: koki watanabe Date: Wed, 28 May 2025 22:54:36 +0900 Subject: [PATCH 1786/3948] fix: reflect discussions on the PR --- reference/unordered_map/unordered_map/clear.md | 5 ++--- reference/unordered_map/unordered_multimap/clear.md | 5 ++--- reference/unordered_set/unordered_multiset/clear.md | 5 ++--- reference/unordered_set/unordered_set/clear.md | 5 ++--- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/reference/unordered_map/unordered_map/clear.md b/reference/unordered_map/unordered_map/clear.md index 224b2d8f2f..f4801435c8 100644 --- a/reference/unordered_map/unordered_map/clear.md +++ b/reference/unordered_map/unordered_map/clear.md @@ -48,10 +48,9 @@ void clear() noexcept; ## 備考 - `clear()` がバケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格は要求していない。 実装によっては `clear()` 後もバケット配列が維持され、動的メモリが残る場合がある。 -- メモリを確実に解放したいときには以下のように操作を行う +- バケット数を初期状態まで縮小させたいときには以下のように操作を行う ```cpp -std::unordered_map tmp; -s.swap(tmp); +um = std::unordered_map(); ``` diff --git a/reference/unordered_map/unordered_multimap/clear.md b/reference/unordered_map/unordered_multimap/clear.md index 11fb1a1031..a398dd962c 100644 --- a/reference/unordered_map/unordered_multimap/clear.md +++ b/reference/unordered_map/unordered_multimap/clear.md @@ -48,10 +48,9 @@ void clear() noexcept; ## 備考 - `clear()` がバケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格は要求していない。 実装によっては `clear()` 後もバケット配列が維持され、動的メモリが残る場合がある。 -- メモリを確実に解放したいときには以下のように操作を行う +- バケット数を初期状態まで縮小させたいときには以下のように操作を行う ```cpp -std::unordered_multimap tmp; -s.swap(tmp); +um = std::unordered_multimap(); ``` diff --git a/reference/unordered_set/unordered_multiset/clear.md b/reference/unordered_set/unordered_multiset/clear.md index aadc66f8fd..400dbac0b0 100644 --- a/reference/unordered_set/unordered_multiset/clear.md +++ b/reference/unordered_set/unordered_multiset/clear.md @@ -48,10 +48,9 @@ void clear() noexcept; ## 備考 - `clear()` がバケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格は要求していない。 実装によっては `clear()` 後もバケット配列が維持され、動的メモリが残る場合がある。 -- メモリを確実に解放したいときには以下のように操作を行う +- バケット数を初期状態まで縮小させたいときには以下のように操作を行う ```cpp -std::unordered_multiset tmp; -s.swap(tmp); +ums = std::unordered_multiset(); ``` diff --git a/reference/unordered_set/unordered_set/clear.md b/reference/unordered_set/unordered_set/clear.md index acd8bc23c9..38e5d5d244 100644 --- a/reference/unordered_set/unordered_set/clear.md +++ b/reference/unordered_set/unordered_set/clear.md @@ -48,10 +48,9 @@ void clear() noexcept; ## 備考 - `clear()` がバケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格は要求していない。 実装によっては `clear()` 後もバケット配列が維持され、動的メモリが残る場合がある。 -- メモリを確実に解放したいときには以下のように操作を行う +- バケット数を初期状態まで縮小させたいときには以下のように操作を行う ```cpp -std::unordered_set tmp; -s.swap(tmp); +us = std::unordered_set(); ``` From 05294b6e27b4f0a7b5fc74f72ff29afab42e150f Mon Sep 17 00:00:00 2001 From: suomesta Date: Wed, 28 May 2025 23:40:48 +0900 Subject: [PATCH 1787/3948] add std::start_lifetime_as() and std::start_lifetime_as_array(). (#1409) --- ...jects_for_low-level_object_manipulation.md | 4 +- lang/cpp23.md | 2 +- lang/cpp23/feature_test_macros.md | 2 +- reference/memory.md | 2 + reference/memory/start_lifetime_as.md | 85 ++++++++++++++++++ reference/memory/start_lifetime_as_array.md | 86 +++++++++++++++++++ 6 files changed, 177 insertions(+), 4 deletions(-) create mode 100644 reference/memory/start_lifetime_as.md create mode 100644 reference/memory/start_lifetime_as_array.md diff --git a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md index 101c295c29..c4fcb1c12d 100644 --- a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md +++ b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md @@ -403,8 +403,8 @@ unique_ptr Stream::read() { ## 関連項目 -- [`start_lifetime_as()`](/reference/memory/start_lifetime_as.md.nolink) -- [`start_lifetime_as_array()`](/reference/memory/start_lifetime_as_array.md.nolink) +- [`start_lifetime_as()`](/reference/memory/start_lifetime_as.md) +- [`start_lifetime_as_array()`](/reference/memory/start_lifetime_as_array.md) - [`is_implicit_lifetime`](/reference/type_traits/is_implicit_lifetime.md) ## 参照 diff --git a/lang/cpp23.md b/lang/cpp23.md index ea48a8f9c9..fdb7160655 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -201,7 +201,7 @@ C++23とは、2023年中に改訂され、ISO/IEC 14882:2024で標準規格化 ### メモリ - [``](/reference/memory.md)に、レガシーC関数からスマートポインタへの直接出力をサポートする、スマートポインタアダプタ[`std::out_ptr`](/reference/memory/out_ptr.md)と[`std::inout_ptr`](/reference/memory/inout_ptr.md)を追加 - [`std::unique_ptr`](/reference/memory/unique_ptr.md)クラスを`constexpr`に対応 -- [``](/reference/memory.md)に、オブジェクトの生存期間を開始することを明示する関数として、[`std::start_lifetime_as()`](/reference/memory/start_lifetime_as.md.nolink)と[`std::start_lifetime_as_array()`](/reference/memory/start_lifetime_as_array.md.nolink)を追加 +- [``](/reference/memory.md)に、オブジェクトの生存期間を開始することを明示する関数として、[`std::start_lifetime_as()`](/reference/memory/start_lifetime_as.md)と[`std::start_lifetime_as_array()`](/reference/memory/start_lifetime_as_array.md)を追加 - [``](/reference/bit.md)に、値のバイト入れ替え (エンディアン変換) を行う[`std::byteswap()`](/reference/bit/byteswap.md)関数を追加 diff --git a/lang/cpp23/feature_test_macros.md b/lang/cpp23/feature_test_macros.md index 98d74f2b98..ec0ed18940 100644 --- a/lang/cpp23/feature_test_macros.md +++ b/lang/cpp23/feature_test_macros.md @@ -89,7 +89,7 @@ |`__cpp_lib_shift`|`202202L`|[`std::ranges::shift_left()`](/reference/algorithm/ranges_shift_left.md)と[`std::ranges::shift_right()`](/reference/algorithm/ranges_shift_right.md)の追加|[``](/reference/algorithm.md)| |`__cpp_lib_spanstream`|`202106L`|``の追加|``| |`__cpp_lib_stacktrace`|`202011L`|[``](/reference/stacktrace.md)の追加|[``](/reference/stacktrace.md)| -|`__cpp_lib_start_lifetime_as`|`202207L`|`std::start_lifetime_as()`の追加|[``](/reference/memory.md)| +|`__cpp_lib_start_lifetime_as`|`202207L`|[`std::start_lifetime_as()`](/reference/memory/start_lifetime_as.md)の追加|[``](/reference/memory.md)| |`__cpp_lib_stdatomic_h`|`202011L`|[``](/reference/stdatomic.h.md)の追加|[``](/reference/stdatomic.h.md)| |`__cpp_lib_string_contains`|`202011L`|[`std::basic_string::contains()`](/reference/string/basic_string/contains.md)と[`std::basic_string_view::contains()`](/reference/string_view/basic_string_view/contains.md)の追加|[``](/reference/string.md)
[``](/reference/string_view.md)| |`__cpp_lib_string_resize_and_overwrite`|`202110L`|[`std::basic_string::resize_and_overwrite()`](/reference/string/basic_string/resize_and_overwrite.md)の追加|[``](/reference/string.md)| diff --git a/reference/memory.md b/reference/memory.md index 056f8f36a7..ace4a60a88 100644 --- a/reference/memory.md +++ b/reference/memory.md @@ -131,6 +131,8 @@ | [`align`](memory/align.md) | アライメント調整された領域を得る(function) | C++11 | | [`assume_aligned`](memory/assume_aligned.md) | コンパイラへアライメントのヒントを与える(function template) | C++20 | | [`is_sufficiently_aligned`](memory/is_sufficiently_aligned.md) | ポインタのアライメントを判定する(function template) | C++26 | +| [`start_lifetime_as`](memory/start_lifetime_as.md) | オブジェクトの生存期間を開始することを明示する(function template) | C++23 | +| [`start_lifetime_as_array`](memory/start_lifetime_as_array.md) | 配列オブジェクトの生存期間を開始することを明示する(function template) | C++23 | ## ガベージコレクション支援(C++23で削除) diff --git a/reference/memory/start_lifetime_as.md b/reference/memory/start_lifetime_as.md new file mode 100644 index 0000000000..6edac78b0c --- /dev/null +++ b/reference/memory/start_lifetime_as.md @@ -0,0 +1,85 @@ +# start_lifetime_as +* memory[meta header] +* function template[meta id-type] +* std[meta namespace] +* cpp23[meta cpp] + +```cpp +namespace std { +template +T* start_lifetime_as(void* p) noexcept; // (1) + +template +const T* start_lifetime_as(const void* p) noexcept; // (2) + +template +volatile T* start_lifetime_as(volatile void* p) noexcept; // (3) + +template +const volatile T* start_lifetime_as(const volatile void* p) noexcept; // (4) +} +``` + +## 概要 +オブジェクトの生存期間を開始することを明示する。 + + +## 要件 +`T` が *implicit-lifetime types* であること。また、`T` が 完全型であること。 + + +## 事前条件 +- `[p, (char*)p + sizeof(T))` の範囲が `p` を通じてアクセス可能な領域であること。 +- `p` が型 `T` のアライメントを満たすこと。 + + +## 効果 +型 `T` のオブジェクト(アドレスは `p`)が暗黙的に構築される。`T` 内にネストされているオブジェクトも暗黙的に構築される。 + + +## 戻り値 +暗黙的に構築された型 `T` のオブジェクトのポインタを返す。ポインタの値は `p`。 + + +## 例外 +投げない。 + + +## 例 +```cpp example +#include +#include + +int main() { + float f = 3.14f; + + std::uint32_t* n = std::start_lifetime_as(&f); + + std::cout << *n << std::endl; +} +``` +* std::start_lifetime_as[color ff0000] + +### 出力 +``` +1078523331 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`std::start_lifetime_as_array`](/reference/memory/start_lifetime_as_array.md) + + +## 参照 +- [P2590R2: Explicit lifetime management](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2590r2.pdf) +- [P2679R2: Fixing std::start_lifetime_as and std::start_lifetime_as_array](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2679r2.pdf) diff --git a/reference/memory/start_lifetime_as_array.md b/reference/memory/start_lifetime_as_array.md new file mode 100644 index 0000000000..06e402dcbe --- /dev/null +++ b/reference/memory/start_lifetime_as_array.md @@ -0,0 +1,86 @@ +# start_lifetime_as_array +* memory[meta header] +* function template[meta id-type] +* std[meta namespace] +* cpp23[meta cpp] + +```cpp +namespace std { +template +T* start_lifetime_as_array(void* p, size_t n) noexcept; // (1) + +template +const T* start_lifetime_as_array(const void* p, size_t n) noexcept; // (2) + +template +volatile T* start_lifetime_as_array(volatile void* p, size_t n) noexcept; // (3) + +template +const volatile T* start_lifetime_as_array(const volatile void* p, size_t n) noexcept; // (4) +} +``` + +## 概要 +配列オブジェクトの生存期間を開始することを明示する。 + + +## 要件 +`T` が完全型であること。 + + +## 事前条件 +- `p` が、型 `T` の配列のアライメントを満たすこと。または、`p` がnullであること。 +- `n <= size_t(-1) / sizeof(T)` が真であること。 +- `n > 0` が真ならば、`[(char*)p, (char*)p + (n * sizeof(T)))` の範囲が `p` を通じてアクセス可能な領域であること。 + + +## 効果 +`n > 0` が真ならば、サイズ `n` の `T` の配列の型を `U` とすると、[`start_lifetime_as`](/reference/memory/start_lifetime_as.md)`(p)` と同じ効果。そうでなければ、何もしない。 + + +## 戻り値 +`n > 0` が真ならば、暗黙的に構築されたサイズ `n` の `T` の配列の、最初の要素へのポインタを返す。そうでなければ、`p`。 + + +## 例外 +投げない。 + + +## 例 +```cpp example +#include +#include + +int main() { + float f = 3.14f; + + std::uint16_t* n = std::start_lifetime_as_array(&f, 2); + + std::cout << n[0] << " " << n[1] << std::endl; +} +``` +* std::start_lifetime_as_array[color ff0000] + +### 出力 +``` +62915 16456 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`std::start_lifetime_as`](/reference/memory/start_lifetime_as.md) + + +## 参照 +- [P2590R2: Explicit lifetime management](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2590r2.pdf) +- [P2679R2: Fixing std::start_lifetime_as and std::start_lifetime_as_array](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2679r2.pdf) From 921ab266a13422a47d70b666d5bced48d1a5f206 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 29 May 2025 12:28:06 +0900 Subject: [PATCH 1788/3948] =?UTF-8?q?filter=5Fview::iterator=20:=20iterato?= =?UTF-8?q?r=5Fcategory=E3=81=A8iterator=5Fconcept=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/filter_view/iterator.md | 12 ++++----- .../iterator/type-iterator_category.md | 25 +++++++++++++++++++ .../iterator/type-iterator_concept.md | 22 ++++++++++++++++ 3 files changed, 53 insertions(+), 6 deletions(-) create mode 100644 reference/ranges/filter_view/iterator/type-iterator_category.md create mode 100644 reference/ranges/filter_view/iterator/type-iterator_concept.md diff --git a/reference/ranges/filter_view/iterator.md b/reference/ranges/filter_view/iterator.md index eee3690cf0..10cbc710ff 100644 --- a/reference/ranges/filter_view/iterator.md +++ b/reference/ranges/filter_view/iterator.md @@ -44,12 +44,12 @@ namespace std::ranges { ## メンバ型 -| 名前 | 説明 | 対応バージョン | -|------------------------------------------------------|----------------------------------------------------------|----------------| -| [`iterator_concept`](iterator/iterator_concept.md.nolink) | イテレータコンセプト | C++20 | -| [`iterator_category`](iterator/iterator_category.md.nolink) | イテレータカテゴリ | C++20 | -| `value_type` | [`range_value_t`](../range_value_t.md) | C++20 | -| `difference_type` | [`range_difference_t`](../range_difference_t.md) | C++20 | +| 名前 | 説明 | 対応バージョン | +|-----------------------------------------------------------|-----------------------------------------------------|----------------| +| [`iterator_concept`](iterator/type-iterator_concept.md) | イテレータコンセプト | C++20 | +| [`iterator_category`](iterator/type-iterator_category.md) | イテレータカテゴリ | C++20 | +| `value_type` | [`range_value_t`](../range_value_t.md) | C++20 | +| `difference_type` | [`range_difference_t`](../range_difference_t.md) | C++20 | ## 非メンバ(*Hidden friends*)関数 diff --git a/reference/ranges/filter_view/iterator/type-iterator_category.md b/reference/ranges/filter_view/iterator/type-iterator_category.md new file mode 100644 index 0000000000..df036f7fda --- /dev/null +++ b/reference/ranges/filter_view/iterator/type-iterator_category.md @@ -0,0 +1,25 @@ +# iterator_category +* ranges[meta header] +* std::ranges[meta namespace] +* filter_view::iterator[meta class] +* type-alias[meta id-type] +* cpp20[meta cpp] + +```cpp +using iterator_category = 以下参照; // (1) C++20 +``` + +## 概要 +イテレータの分類を表す型。 + +このメンバ型`iterator_concept`は、`V`が[`forward_ranges`](/reference/ranges/forward_range.md)コンセプトのモデルである場合にのみ、以下のように定義される。 + +- `C = iterator_traits>::iterator_category;`であるとして、 +- `C`が[`derived_from`](/reference/concepts/derived_from.md)`<`[`bidirectional_iterator_tag`](/reference/iterator/iterator_tag.md)`>`のモデルである場合、`iterator_category`は[`bidirectional_iterator_tag`](/reference/iterator/iterator_tag.md)となる +- そうでない場合、`C`が[`derived_from`](/reference/concepts/derived_from.md)`<`[`forward_iterator_tag`](/reference/iterator/iterator_tag.md)`>`のモデルである場合、`iterator_category`は[`forward_iterator_tag`](/reference/iterator/iterator_tag.md)となる +- そうでない場合、`iterator_category`は`C`となる + + +## バージョン +### 言語 +- C++20 diff --git a/reference/ranges/filter_view/iterator/type-iterator_concept.md b/reference/ranges/filter_view/iterator/type-iterator_concept.md new file mode 100644 index 0000000000..94bba0e365 --- /dev/null +++ b/reference/ranges/filter_view/iterator/type-iterator_concept.md @@ -0,0 +1,22 @@ +# iterator_concept +* ranges[meta header] +* std::ranges[meta namespace] +* filter_view::iterator[meta class] +* type-alias[meta id-type] +* cpp20[meta cpp] + +```cpp +using iterator_concept = 以下参照; // (1) C++20 +``` + +## 概要 +イテレータコンセプトを表す型。 + +- `V`が[`bidirectional_ranges`](/reference/ranges/bidirectional_range.md)コンセプトのモデルである場合、[`bidirectional_iterator_tag`](/reference/iterator/iterator_tag.md) +- `V`が[`forward_ranges`](/reference/ranges/forward_range.md)コンセプトのモデルである場合、[`forward_iterator_tag`](/reference/iterator/iterator_tag.md) +- そうでない場合、[`input_iterator_tag`](/reference/iterator/iterator_tag.md) + + +## バージョン +### 言語 +- C++20 From b8797410fdfb2cbf6149ea9c056a0a8464f6d81f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 29 May 2025 12:43:56 +0900 Subject: [PATCH 1789/3948] =?UTF-8?q?filter=5Fview::iterator=20:=20iter=5F?= =?UTF-8?q?move=E3=81=A8iter=5Fswap=E3=82=92=E8=BF=BD=E5=8A=A0=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 4 ++ reference/ranges/filter_view/iterator.md | 4 +- .../ranges/filter_view/iterator/iter_move.md | 65 +++++++++++++++++++ .../ranges/filter_view/iterator/iter_swap.md | 63 ++++++++++++++++++ 4 files changed, 134 insertions(+), 2 deletions(-) create mode 100644 reference/ranges/filter_view/iterator/iter_move.md create mode 100644 reference/ranges/filter_view/iterator/iter_swap.md diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index e2a2d398ff..e50d879091 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -149,6 +149,7 @@ * indirect_binary_predicate[link /reference/iterator/indirect_binary_predicate.md] * indirect_unary_predicate[link /reference/iterator/indirect_unary_predicate.md] * indirectly_comparable[link /reference/iterator/indirectly_comparable.md] + * indirectly_swappable[link /reference/iterator/indirectly_swappable.md] * input_iterator[link /reference/iterator/input_iterator.md] * iterator_traits[link /reference/iterator/iterator_traits.md] * iter_difference_t[link /reference/iterator/iter_difference_t.md] @@ -158,11 +159,14 @@ * projected[link /reference/iterator/projected.md] * projected_value_t[link /reference/iterator/projected_value_t.md] * random_access_iterator[link /reference/iterator/random_access_iterator.md] + * ranges::iter_move[link /reference/iterator/iter_move.md] + * ranges::iter_swap[link /reference/iterator/iter_swap.md] * sentinel_for[link /reference/iterator/sentinel_for.md] * std::back_inserter[link /reference/iterator/back_inserter.md] * std::begin[link /reference/iterator/begin.md] * std::distance[link /reference/iterator/distance.md] * std::end[link /reference/iterator/end.md] + * std::next[link /reference/iterator/next.md] * std::ostream_iterator[link /reference/iterator/ostream_iterator.md] * [link /reference/latch.md] * [link /reference/limits.md] diff --git a/reference/ranges/filter_view/iterator.md b/reference/ranges/filter_view/iterator.md index 10cbc710ff..94bb138899 100644 --- a/reference/ranges/filter_view/iterator.md +++ b/reference/ranges/filter_view/iterator.md @@ -55,8 +55,8 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |------------------------------------------|------------------------|----------------| -| [`iter_move`](iterator/iter_move.md.nolink) | イテレータの要素の移動 | C++20 | -| [`iter_swap`](iterator/iter_swap.md.nolink) | イテレータの要素の交換 | C++20 | +| [`iter_move`](iterator/iter_move.md) | イテレータの要素の移動 | C++20 | +| [`iter_swap`](iterator/iter_swap.md) | イテレータの要素の交換 | C++20 | ### 比較演算子 diff --git a/reference/ranges/filter_view/iterator/iter_move.md b/reference/ranges/filter_view/iterator/iter_move.md new file mode 100644 index 0000000000..2d1c8883a0 --- /dev/null +++ b/reference/ranges/filter_view/iterator/iter_move.md @@ -0,0 +1,65 @@ +# iter_move +* ranges[meta header] +* std::ranges[meta namespace] +* filter_view::iterator[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +friend constexpr range_rvalue_reference_t + iter_move(const iterator& i) + noexcept(noexcept(ranges::iter_move(i.current_))); // (1) C++20 +``` + +## 概要 +イテレータの要素を移動する。 + + +## 効果 +以下と等価: + +```cpp +return ranges::iter_move(i.current_); +``` + + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {"apple", "banana", "cherry", "date"}; + auto is_long = [](const std::string& s) { return s.size() > 5; }; + + std::ranges::filter_view fv{v, is_long}; + auto it = fv.begin(); + + // iter_moveで要素をムーブ + std::string s = iter_move(it); + std::cout << s << std::endl; // banana + + // ムーブ後の元要素は空になる + std::cout << std::boolalpha << v[1].empty() << std::endl; // true +} +``` +* iter_move[color ff0000] + +### 出力 + +``` +banana +true +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/filter_view/iterator/iter_swap.md b/reference/ranges/filter_view/iterator/iter_swap.md new file mode 100644 index 0000000000..a4d860badc --- /dev/null +++ b/reference/ranges/filter_view/iterator/iter_swap.md @@ -0,0 +1,63 @@ +# iter_swap +* ranges[meta header] +* std::ranges[meta namespace] +* filter_view::iterator[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +friend constexpr void + iter_swap(const iterator& x, const iterator& y) + noexcept(noexcept(ranges::iter_swap(x.current_, y.current_))) + requires indirectly_swappable>; // (1) C++20 +``` + +## 概要 +イテレータの要素を交換する。 + + +## 効果 +以下と等価: + +```cpp +return ranges::iter_swap(x.current_, y.current_); +``` + + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5, 6}; + auto is_even = [](int x) { return x % 2 == 0; }; + std::ranges::filter_view fv{v, is_even}; + + auto it1 = fv.begin(); // v[1] を指す + auto it2 = std::next(fv.begin()); // v[3] を指す + + std::cout << v[1] << ", " << v[3] << std::endl; // 2, 4 + iter_swap(it1, it2); + std::cout << v[1] << ", " << v[3] << std::endl; // 4, 2 +} +``` +* iter_swap[color ff0000] + +### 出力 + +``` +2, 4 +4, 2 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] From 9e745c427376d39ee4129540c2b24bcad43bcfeb Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 29 May 2025 12:49:46 +0900 Subject: [PATCH 1790/3948] =?UTF-8?q?filter=5Fview::iterator=20:=20value?= =?UTF-8?q?=5Ftype=E3=81=A8difference=5Ftype=E3=81=AE=E8=AA=AC=E6=98=8E?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/filter_view/iterator.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/ranges/filter_view/iterator.md b/reference/ranges/filter_view/iterator.md index 94bb138899..46f7645b49 100644 --- a/reference/ranges/filter_view/iterator.md +++ b/reference/ranges/filter_view/iterator.md @@ -48,8 +48,8 @@ namespace std::ranges { |-----------------------------------------------------------|-----------------------------------------------------|----------------| | [`iterator_concept`](iterator/type-iterator_concept.md) | イテレータコンセプト | C++20 | | [`iterator_category`](iterator/type-iterator_category.md) | イテレータカテゴリ | C++20 | -| `value_type` | [`range_value_t`](../range_value_t.md) | C++20 | -| `difference_type` | [`range_difference_t`](../range_difference_t.md) | C++20 | +| `value_type` | [イテレータの要素を表す型`range_value_t`](../range_value_t.md) | C++20 | +| `difference_type` | イテレータ間の差を表す型[`range_difference_t`](../range_difference_t.md) | C++20 | ## 非メンバ(*Hidden friends*)関数 From 38de7a55bc4e93cf202c44323e6d6a27c69c07f3 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 29 May 2025 13:49:39 +0900 Subject: [PATCH 1791/3948] =?UTF-8?q?empty=5Fview=20:=20=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=89=E4=BF=AE=E9=A3=BE=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/empty_view.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/ranges/empty_view.md b/reference/ranges/empty_view.md index 14304e371d..6be4b3008b 100644 --- a/reference/ranges/empty_view.md +++ b/reference/ranges/empty_view.md @@ -81,6 +81,7 @@ int main() { } ``` * views::empty[color ff0000] +* ranges::empty[link /reference/ranges/empty.md] ### 出力 ``` From 2a23e4da72a0e01764cf681b2f45f7823955cc16 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 29 May 2025 13:50:36 +0900 Subject: [PATCH 1792/3948] =?UTF-8?q?empty=5Fview=20:=20=E3=83=A1=E3=83=B3?= =?UTF-8?q?=E3=83=90=E9=96=A2=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/empty_view.md | 23 +++++++-------------- reference/ranges/empty_view/begin.md | 30 +++++++++++++++++++++++++++ reference/ranges/empty_view/data.md | 30 +++++++++++++++++++++++++++ reference/ranges/empty_view/empty.md | 30 +++++++++++++++++++++++++++ reference/ranges/empty_view/end.md | 31 ++++++++++++++++++++++++++++ reference/ranges/empty_view/size.md | 30 +++++++++++++++++++++++++++ 6 files changed, 159 insertions(+), 15 deletions(-) create mode 100644 reference/ranges/empty_view/begin.md create mode 100644 reference/ranges/empty_view/data.md create mode 100644 reference/ranges/empty_view/empty.md create mode 100644 reference/ranges/empty_view/end.md create mode 100644 reference/ranges/empty_view/size.md diff --git a/reference/ranges/empty_view.md b/reference/ranges/empty_view.md index 6be4b3008b..77a31f852e 100644 --- a/reference/ranges/empty_view.md +++ b/reference/ranges/empty_view.md @@ -8,14 +8,7 @@ namespace std::ranges { template requires is_object_v - class empty_view : public view_interface> { // (1) - public: - static constexpr T* begin() noexcept { return nullptr; } - static constexpr T* end() noexcept { return nullptr; } - static constexpr T* data() noexcept { return nullptr; } - static constexpr size_t size() noexcept { return 0; } - static constexpr bool empty() noexcept { return true; } - }; + class empty_view : public view_interface> { …… }; // (1) namespace views { template @@ -42,13 +35,13 @@ namespace std::ranges { ## 静的メンバ関数 -| 名前 | 説明 | 対応バージョン | -|--------------------------------------------------|----------------------------------|----------------| -| [`begin`](empty_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++20 | -| [`end`](empty_view/end.md.nolink) | 番兵を取得する | C++20 | -| [`data`](empty_view/data.md.nolink) | 配列の先頭へのポインタを取得する | C++20 | -| [`size`](empty_view/size.md.nolink) | 要素数を取得する | C++20 | -| [`empty`](empty_view/empty.md.nolink) | Rangeが空かどうかを判定する | C++20 | +| 名前 | 説明 | 対応バージョン | +|--------------------------------|----------------------------------|----------------| +| [`begin`](empty_view/begin.md) | 先頭を指すイテレータを取得する | C++20 | +| [`end`](empty_view/end.md) | 番兵を取得する | C++20 | +| [`data`](empty_view/data.md) | 配列の先頭へのポインタを取得する | C++20 | +| [`size`](empty_view/size.md) | 要素数を取得する | C++20 | +| [`empty`](empty_view/empty.md) | Rangeが空かどうかを判定する | C++20 | ## 継承しているメンバ関数 diff --git a/reference/ranges/empty_view/begin.md b/reference/ranges/empty_view/begin.md new file mode 100644 index 0000000000..eb5f274f50 --- /dev/null +++ b/reference/ranges/empty_view/begin.md @@ -0,0 +1,30 @@ +# begin +* ranges[meta header] +* std::ranges[meta namespace] +* empty_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +static constexpr T* begin() noexcept; // (1) C++20 +``` + +## 概要 +`view`の先頭要素を指すイテレータを取得する。 + +## 戻り値 + +```cpp +return nullptr; +``` + + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/empty_view/data.md b/reference/ranges/empty_view/data.md new file mode 100644 index 0000000000..7ad10bd5ef --- /dev/null +++ b/reference/ranges/empty_view/data.md @@ -0,0 +1,30 @@ +# data +* ranges[meta header] +* std::ranges[meta namespace] +* empty_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +static constexpr T* data() noexcept; // (1) C++20 +``` + +## 概要 +配列の先頭へのポインタを取得する。 + +## 戻り値 + +```cpp +return nullptr; +``` + + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/empty_view/empty.md b/reference/ranges/empty_view/empty.md new file mode 100644 index 0000000000..fed7a28f09 --- /dev/null +++ b/reference/ranges/empty_view/empty.md @@ -0,0 +1,30 @@ +# empty +* ranges[meta header] +* std::ranges[meta namespace] +* empty_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +static constexpr bool empty() noexcept; // (1) C++20 +``` + +## 概要 +Rangeが空かどうかを判定する。 + +## 戻り値 + +```cpp +return true; +``` + + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/empty_view/end.md b/reference/ranges/empty_view/end.md new file mode 100644 index 0000000000..6ac4b4399b --- /dev/null +++ b/reference/ranges/empty_view/end.md @@ -0,0 +1,31 @@ +# end +* ranges[meta header] +* std::ranges[meta namespace] +* empty_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +static constexpr T* end() noexcept; // (1) C++20 +``` + +## 概要 + +番兵を取得する。 + + +## 戻り値 + +```cpp +return nullptr; +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/empty_view/size.md b/reference/ranges/empty_view/size.md new file mode 100644 index 0000000000..f8adf916f8 --- /dev/null +++ b/reference/ranges/empty_view/size.md @@ -0,0 +1,30 @@ +# size +* ranges[meta header] +* std::ranges[meta namespace] +* empty_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +static constexpr size_t size() noexcept; // (1) C++20 +``` + +## 概要 +要素数を取得する。 + +## 戻り値 + +```cpp +return 0; +``` + + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] From 2c260022753de92e7967e9f890b48111645577a3 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 29 May 2025 13:55:40 +0900 Subject: [PATCH 1793/3948] =?UTF-8?q?empty=5Fview=20:=20=E7=B6=99=E6=89=BF?= =?UTF-8?q?=E3=81=97=E3=81=A6=E3=81=84=E3=82=8B=E3=83=A1=E3=83=B3=E3=83=90?= =?UTF-8?q?=E9=96=A2=E6=95=B0=E3=81=A8=E3=81=97=E3=81=A6=E4=B8=8D=E8=B6=B3?= =?UTF-8?q?=E3=81=97=E3=81=A6=E3=81=84=E3=81=9F=E3=82=82=E3=81=AE=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/empty_view.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/reference/ranges/empty_view.md b/reference/ranges/empty_view.md index 77a31f852e..00d8cc5090 100644 --- a/reference/ranges/empty_view.md +++ b/reference/ranges/empty_view.md @@ -45,12 +45,14 @@ namespace std::ranges { ## 継承しているメンバ関数 -| 名前 | 説明 | 対応バージョン | -|----------------------------------------------|----------------------------------|----------------| +| 名前 | 説明 | 対応バージョン | +|----------------------------------------------|-----------------------------------|----------------| | [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++20 | -| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | -| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | -| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | +| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | +| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | +| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | ## カスタマイゼーション From eb2177ac4b47fe64a28648dfec74e18ffc8e78f1 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 29 May 2025 14:47:22 +0900 Subject: [PATCH 1794/3948] =?UTF-8?q?single=5Fview=20:=20=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=90=E9=96=A2=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/single_view.md | 37 ++++--- reference/ranges/single_view/begin.md | 58 +++++++++++ reference/ranges/single_view/data.md | 53 ++++++++++ reference/ranges/single_view/empty.md | 30 ++++++ reference/ranges/single_view/end.md | 59 +++++++++++ .../ranges/single_view/op_constructor.md | 98 +++++++++++++++++++ .../ranges/single_view/op_deduction_guide.md | 47 +++++++++ reference/ranges/single_view/size.md | 32 ++++++ 8 files changed, 403 insertions(+), 11 deletions(-) create mode 100644 reference/ranges/single_view/begin.md create mode 100644 reference/ranges/single_view/data.md create mode 100644 reference/ranges/single_view/empty.md create mode 100644 reference/ranges/single_view/end.md create mode 100644 reference/ranges/single_view/op_constructor.md create mode 100644 reference/ranges/single_view/op_deduction_guide.md create mode 100644 reference/ranges/single_view/size.md diff --git a/reference/ranges/single_view.md b/reference/ranges/single_view.md index 0ec0b96e0f..f23b329b2f 100644 --- a/reference/ranges/single_view.md +++ b/reference/ranges/single_view.md @@ -9,7 +9,6 @@ namespace std::ranges { template requires is_object_v class single_view : public view_interface> { …… }; // (1) C++20 - template requires is_object_v class single_view : public view_interface> { …… }; // (1) C++23 @@ -30,23 +29,37 @@ namespace std::ranges { |----------|-------|--------|-------|---------|---------------|---------------|------------|--------|----------|------| | | ○ | ○ | ○ | ○ | ○ | ○ | ○ | ○ | ○ | ○ | +## テンプレートパラメータ制約 +- (1) : + - C++20 : 型`T`がコピー構築可能であること + - C++23 : 型`T`がムーブ構築可能であること + + ## 効果 - 式`views::single(E)`の効果は`single_view>(E)`と等しい。 +## メンバ変数 + +| 名前 | 説明 | 対応バージョン | +|---------------------------------------------|--------------|-----------------------| +| [`movable-box`](movable_box.md)` value_` | 単一要素の値 | C++20 | + + ## メンバ関数 | 名前 | 説明 | 対応バージョン | |--------------------------------------------------|----------------------------------|----------------| -| [`(constructor)`](single_view/op_constructor.md.nolink) | コンストラクタ | C++20 | -| [`begin`](single_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++20 | -| [`end`](single_view/end.md.nolink) | 番兵を取得する | C++20 | -| [`data`](single_view/data.md.nolink) | 配列の先頭へのポインタを取得する | C++20 | +| [`(constructor)`](single_view/op_constructor.md) | コンストラクタ | C++20 | +| [`begin`](single_view/begin.md) | 先頭を指すイテレータを取得する | C++20 | +| [`end`](single_view/end.md) | 番兵を取得する | C++20 | +| [`data`](single_view/data.md) | 配列の先頭へのポインタを取得する | C++20 | ## 静的メンバ関数 -| 名前 | 説明 | 対応バージョン | -|--------------------------------------------------|----------------------------------|----------------| -| [`size`](single_view/size.md.nolink) | 要素数を取得する | C++20 | +| 名前 | 説明 | 対応バージョン | +|---------------------------------|-----------------------------|----------------| +| [`size`](single_view/size.md) | 要素数を取得する | C++20 | +| [`empty`](single_view/empty.md) | Rangeが空かどうかを判定する | C++20 | ## 継承しているメンバ関数 @@ -56,12 +69,14 @@ namespace std::ranges { | [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | | [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | | [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | ## 推論補助 -| 名前 | 説明 | 対応バージョン | -|-------------------------------------------------------|------------------------------|----------------| -| [`(deduction_guide)`](single_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++20 | +| 名前 | 説明 | 対応バージョン | +|----------------------------------------------------------|------------------------------|----------------| +| [`(deduction_guide)`](single_view/op_deduction_guide.md) | クラステンプレートの推論補助 | C++20 | ## 例 ```cpp example diff --git a/reference/ranges/single_view/begin.md b/reference/ranges/single_view/begin.md new file mode 100644 index 0000000000..7ab33ec4da --- /dev/null +++ b/reference/ranges/single_view/begin.md @@ -0,0 +1,58 @@ +# begin +* ranges[meta header] +* std::ranges[meta namespace] +* single_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr T* begin() noexcept; // (1) C++20 +constexpr const T* begin() const noexcept; // (2) C++20 +``` + +## 概要 +`view`の先頭要素を指すイテレータを取得する。 + +## 戻り値 +以下と等価: + +```cpp +return data(); +``` +* data()[link data.md] + + +## 例 + +```cpp example +#include +#include + +int main() { + auto r = std::views::single(1); + int* it = r.begin(); + int* last = r.end(); + + for (; it != last; ++it) { + std::cout << *it << std::endl; + } +} +``` +* begin[color ff0000] +* end[link end.md] + +### 出力 + +``` +1 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/single_view/data.md b/reference/ranges/single_view/data.md new file mode 100644 index 0000000000..fbde218667 --- /dev/null +++ b/reference/ranges/single_view/data.md @@ -0,0 +1,53 @@ +# data +* ranges[meta header] +* std::ranges[meta namespace] +* single_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr T* data() noexcept; // (1) C++20 +constexpr const T* data() const noexcept; // (2) C++20 +``` + +## 概要 +配列の先頭へのポインタを取得する。 + +## 戻り値 +以下と等価: + +```cpp +return value_.operator->(); +``` + + +## 例 + +```cpp example +#include +#include + +int main() { + auto r = std::views::single(1); + int* p = r.data(); + + std::cout << *p << std::endl; +} +``` +* data[color ff0000] + +### 出力 + +``` +1 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/single_view/empty.md b/reference/ranges/single_view/empty.md new file mode 100644 index 0000000000..346a5d2c40 --- /dev/null +++ b/reference/ranges/single_view/empty.md @@ -0,0 +1,30 @@ +# empty +* ranges[meta header] +* std::ranges[meta namespace] +* single_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +static constexpr bool empty() noexcept; // (1) C++20 +``` + +## 概要 +Rangeが空かどうかを判定する。 + +## 戻り値 + +```cpp +return false; +``` + + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/single_view/end.md b/reference/ranges/single_view/end.md new file mode 100644 index 0000000000..087d8b17b6 --- /dev/null +++ b/reference/ranges/single_view/end.md @@ -0,0 +1,59 @@ +# end +* ranges[meta header] +* std::ranges[meta namespace] +* single_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr T* end() noexcept; // (1) C++20 +constexpr const T* end() const noexcept; // (2) C++20 +``` + +## 概要 + +番兵を取得する。 + +## 戻り値 +以下と等価: + +```cpp +return data() + 1; +``` +* data()[link data.md] + + +## 例 + +```cpp example +#include +#include + +int main() { + auto r = std::views::single(1); + int* it = r.begin(); + int* last = r.end(); + + for (; it != last; ++it) { + std::cout << *it << std::endl; + } +} +``` +* end[color ff0000] +* begin[link begin.md] + +### 出力 + +``` +1 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/single_view/op_constructor.md b/reference/ranges/single_view/op_constructor.md new file mode 100644 index 0000000000..18467b2993 --- /dev/null +++ b/reference/ranges/single_view/op_constructor.md @@ -0,0 +1,98 @@ +# コンストラクタ +* ranges[meta header] +* std::ranges[meta namespace] +* single_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +single_view() + requires default_initializable = default; // (1) C++20 + +constexpr explicit single_view(const T& t) + requires copy_constructible; // (2) C++20 + +constexpr explicit single_view(T&& t); // (3) C++20 + +template + requires constructible_from +constexpr explicit single_view(in_place_t, Args&&... args); // (4) C++20 +``` + +## 概要 +[`single_view`](../single_view.md)オブジェクトを構築する。 + +- (1) : デフォルト構築 +- (2) : `t`をコピーして、`*this`に保持する +- (3) : `t`をムーブして、`*this`に保持する +- (4) : 型`T`のコンストラクタ引数`args...`を転送して`T`型オブジェクトを内部で構築し、`*this`に保持する + + +## テンプレートパラメータ制約 +- (1) : 型`T`がデフォルト構築可能であること +- (2) : 型`T`がコピー構築可能であること +- (4) : 型`T`が`Args...`で構築可能であること + + +## 効果 + +- (2) : `value_`を`t`で初期化する +- (3) : `value_`を[`std::move`](/reference/utility/move.md)`(t)`で初期化する +- (4) : `value_{`[`in_place`](/reference/utility/in_place_t.md)`,` [`std::forward`](/reference/utility/forward.md)`(args)...}`で初期化する + + +## 例 +```cpp example +#include +#include +#include + +int main() { + // (2) コピー構築 + { + std::string s1 = "hello"; + for (const std::string& x : std::views::single(s1)) { + std::cout << x << std::endl; + } + } + + // (3) ムーブ構築 + { + std::string s1 = "hello"; + for (const std::string& x : std::views::single(std::move(s1))) { + std::cout << x << std::endl; + } + } + + // (4) コンストラクタ引数から構築 + { + for (const std::string& x : std::ranges::single_view(std::in_place, 3, 'a')) { + std::cout << x << std::endl; + } + } +} + +``` +* std::ranges::single_view[color ff0000] +* std::views::single[color ff0000] + +### 出力 +``` +hello +hello +aaa +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4861 24.7.4 Filter view](https://timsong-cpp.github.io/cppwp/n4861/range.filter) +- [N4950 26.7.8 Filter view](https://timsong-cpp.github.io/cppwp/n4950/range.filter) diff --git a/reference/ranges/single_view/op_deduction_guide.md b/reference/ranges/single_view/op_deduction_guide.md new file mode 100644 index 0000000000..122d810452 --- /dev/null +++ b/reference/ranges/single_view/op_deduction_guide.md @@ -0,0 +1,47 @@ +# 推論補助 +* ranges[meta header] +* std::ranges[meta namespace] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +namespace std::ranges { + template + single_view(T) -> single_view; +} +``` +* single_view[link ../single_view.md] + +## 概要 + +[`single_view`](../single_view.md)クラステンプレートの型推論補助。 + + +## 例 +```cpp example +#include +#include + +int main() { + auto r = std::ranges::single_view(1); + for (int x : r) { + std::cout << x << std::endl; + } +} + +``` + +### 出力 +``` +1 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/single_view/size.md b/reference/ranges/single_view/size.md new file mode 100644 index 0000000000..cfc519fc23 --- /dev/null +++ b/reference/ranges/single_view/size.md @@ -0,0 +1,32 @@ +# size +* ranges[meta header] +* std::ranges[meta namespace] +* single_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +static constexpr size_t size() noexcept; // (1) C++20 +``` + +## 概要 +要素数を取得する。 + +## 戻り値 + +以下と等価: + +```cpp +return 1; +``` + + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] From 9df8a069f0ef157bae64add3c9618cf19c9eeb7c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 29 May 2025 14:48:55 +0900 Subject: [PATCH 1795/3948] =?UTF-8?q?=E3=82=B0=E3=83=AD=E3=83=BC=E3=83=90?= =?UTF-8?q?=E3=83=AB=E4=BF=AE=E9=A3=BE=20:=20in=5Fplace=E3=82=92=E7=99=BB?= =?UTF-8?q?=E9=8C=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index e50d879091..ad9ac97cfb 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -315,6 +315,8 @@ * std::unordered_set[link /reference/unordered_set/unordered_set.md] * [link /reference/utility.md] * declval[link /reference/utility/declval.md] + * in_place_t[link /reference/utility/in_place_t.md] + * in_place[link /reference/utility/in_place_t.md] * std::forward_like[link /reference/utility/forward_like.md] * std::forward[link /reference/utility/forward.md] * std::make_pair[link /reference/utility/make_pair.md] From cb70d2cd764f019f5f31daf4e75225e55fac9801 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 29 May 2025 15:14:48 +0900 Subject: [PATCH 1796/3948] =?UTF-8?q?filter=5Fview=20:=20empty=E3=81=AF?= =?UTF-8?q?=E7=B6=99=E6=89=BF=E3=81=97=E3=81=A6=E3=81=9F=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/filter_view.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/ranges/filter_view.md b/reference/ranges/filter_view.md index 099745d595..31d7da22f7 100644 --- a/reference/ranges/filter_view.md +++ b/reference/ranges/filter_view.md @@ -75,6 +75,7 @@ namespace std::ranges { | [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++20 | | [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | | [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | +| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++20 | | [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | | [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | From d134ea8c1cc43660d7f61bf4844fae87085d1a5e Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 29 May 2025 15:55:34 +0900 Subject: [PATCH 1797/3948] execution: just_error,just_stopped (#1384) --- reference/execution/execution.md | 4 +- .../execution/execution/error_types_of_t.md | 2 +- reference/execution/execution/just.md | 47 ++++++--- reference/execution/execution/just_error.md | 98 +++++++++++++++++++ reference/execution/execution/just_stopped.md | 93 ++++++++++++++++++ reference/execution/execution/let_value.md | 2 +- .../execution/execution/sends_stopped.md | 2 +- .../execution/execution/value_types_of_t.md | 2 +- .../execution/when_all_with_variant.md | 4 +- 9 files changed, 234 insertions(+), 20 deletions(-) create mode 100644 reference/execution/execution/just_error.md create mode 100644 reference/execution/execution/just_stopped.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index ef8fdbfc64..24fc001d06 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -100,8 +100,8 @@ namespace std::execution { | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`execution::just`](execution/just.md) | 値を送信するSender (customization point object) | C++26 | -| [`execution::just_error`](execution/just_error.md.nolink) | エラーを送信するSender (customization point object) | C++26 | -| [`execution::just_stopped`](execution/just_stopped.md.nolink) | 停止を送信するSender (customization point object) | C++26 | +| [`execution::just_error`](execution/just_error.md) | エラーを送信するSender (customization point object) | C++26 | +| [`execution::just_stopped`](execution/just_stopped.md) | 停止を送信するSender (customization point object) | C++26 | | [`execution::read_env`](execution/read_env.md) | Receiver環境からクエリオブジェクトで値を読み取るSender (customization point object) | C++26 | | [`execution::schedule`](execution/schedule.md) | Scheduler上で実行されるSender (customization point object) | C++26 | | [`execution::schedule_result_t`](execution/schedule_result_t.md) | [`schedule`](execution/schedule.md)結果型を取得 (alias template) | C++26 | diff --git a/reference/execution/execution/error_types_of_t.md b/reference/execution/execution/error_types_of_t.md index d3e6fe645a..c6e5f147b9 100644 --- a/reference/execution/execution/error_types_of_t.md +++ b/reference/execution/execution/error_types_of_t.md @@ -53,7 +53,7 @@ int main() * ex::error_types_of_t[color ff0000] * ex::sender[link sender.md] * ex::just[link just.md] -* ex::just_error[link just_error.md.nolink] +* ex::just_error[link just_error.md] ### 出力 ``` diff --git a/reference/execution/execution/just.md b/reference/execution/execution/just.md index dedcc340cd..f5a6c18610 100644 --- a/reference/execution/execution/just.md +++ b/reference/execution/execution/just.md @@ -17,8 +17,17 @@ namespace std::execution { ## 効果 -- 呼び出し式`just(ts...)`は、`(`[`movable-value`](../movable-value.md)` &&...) == false`のとき不適格となる。 -- そうでなければ、式[`make-sender`](make-sender.md)`(just,` [`product-type`](product-type.md)`{ts...})`と等価。 +説明用のパック`ts`に対して、パック`Ts`を`decltype((ts))`とする。下記いずれかの条件をみたすとき、呼び出し式`just(ts...)`は不適格となる。 + +- `(`[`movable-value`](../movable-value.md)` &&...) == false` + +そうでなければ、呼び出し式`just(ts...)`は下記と等価。 + +```cpp +make-sender(just, product-type{ts...}) +``` +* make-sender[link make-sender.md] +* product-type[link product-type.md] ### Senderアルゴリズムタグ `just` @@ -43,22 +52,34 @@ namespace std::execution { * std::move[link /reference/utility/move.md] +## カスタマイゼーションポイント +[Receiver](receiver.md)との[接続(connect)](connect.md)時に、[関連付けられた実行ドメイン](get-domain-late.md)に対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 +[デフォルト実行ドメイン](default_domain.md)では無変換。 + + ## 例 ```cpp example +#include #include #include namespace ex = std::execution; +using namespace std::string_literals; int main() { - // 値(123,'X')の送信結果は tuple 型で受け取る - ex::sender auto snd1 = ex::just(123, 'X'); - std::tuple result1 = std::this_thread::sync_wait(snd1).value(); + // 空の値を送信するSender + ex::sender auto snd0 = ex::just(); + std::tuple<> result0 = std::this_thread::sync_wait(snd0).value(); + std::println("result0={}", result0); + + // 値"C++"を送信するSender + ex::sender auto snd1 = ex::just("C++"s); + std::tuple result1 = std::this_thread::sync_wait(snd1).value(); std::println("result1={}", result1); - // 空値の送信結果は tuple<> 型で受け取る - ex::sender auto snd2 = ex::just(); - std::tuple<> result2 = std::this_thread::sync_wait(snd2).value(); + // 値(123,'X')を送信するSender + ex::sender auto snd2 = ex::just(123, 'X'); + std::tuple result2 = std::this_thread::sync_wait(snd2).value(); std::println("result2={}", result2); } ``` @@ -69,8 +90,9 @@ int main() ### 出力 ``` -result1=(123, 'X') -result2=() +result0=() +result1=("C++") +result2=(123, 'X') ``` @@ -86,9 +108,10 @@ result2=() ## 関連項目 -- [`execution::just_error`](just_error.md.nolink) -- [`execution::just_stopped`](just_stopped.md.nolink) +- [`execution::just_error`](just_error.md) +- [`execution::just_stopped`](just_stopped.md) ## 参照 +- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/just_error.md b/reference/execution/execution/just_error.md new file mode 100644 index 0000000000..840f2c3a92 --- /dev/null +++ b/reference/execution/execution/just_error.md @@ -0,0 +1,98 @@ +# just_error +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct just_error_t { unspecified }; + inline constexpr just_error_t just_error{}; +} +``` +* unspecified[italic] + +## 概要 +`just_error`は、非同期操作の[開始(start)](start.md)で[エラー完了関数](set_error.md)を呼び出すSenderファクトリである。 + + +## 効果 +説明用のパック`ts`に対して、パック`Ts`を`decltype((ts))`とする。下記いずれかの条件をみたすとき、呼び出し式`just_error(ts...)`は不適格となる。 + +- `(`[`movable-value`](../movable-value.md)` &&...) == false`、もしくは +- `sizeof...(ts) == 1`が`false` + +そうでなければ、呼び出し式`just_error(ts...)`は下記と等価。 + +```cpp +make-sender(just_error, product-type{ts...}) +``` +* make-sender[link make-sender.md] +* product-type[link product-type.md] + + +### Senderアルゴリズムタグ `just_error` +Senderアルゴリズム動作説明用のクラステンプレート[`impls-for`](impls-for.md)に対して、下記の特殊化が定義される。 + +```cpp +namespace std::execution { + template<> + struct impls-for> : default-impls { + static constexpr auto start = + [](auto& state, auto& rcvr) noexcept -> void { + auto& [...ts] = state; + set_error(std::move(rcvr), std::move(ts)...); + }; + }; +} +``` +* decayed-typeof[link decayed-typeof.md.nolink] +* impls-for[link impls-for.md] +* default-impls[link impls-for.md] +* set_error[link set_error.md] +* std::move[link /reference/utility/move.md] + + +## カスタマイゼーションポイント +[Receiver](receiver.md)との[接続(connect)](connect.md)時に、[関連付けられた実行ドメイン](get-domain-late.md)に対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 +[デフォルト実行ドメイン](default_domain.md)では無変換。 + + +## 例 +```cpp example +#include +namespace ex = std::execution; + +int main() +{ + // エラー(42)を送信するSender + ex::sender auto sndr = ex::just_error(42); +} +``` +* ex::just_error[color ff0000] +* ex::sender[link sender.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::just`](just.md) +- [`execution::just_stopped`](just_stopped.md) + + +## 参照 +- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/just_stopped.md b/reference/execution/execution/just_stopped.md new file mode 100644 index 0000000000..a48ed153f0 --- /dev/null +++ b/reference/execution/execution/just_stopped.md @@ -0,0 +1,93 @@ +# just_stopped +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct just_stopped_t { unspecified }; + inline constexpr just_stopped_t just_stopped{}; +} +``` +* unspecified[italic] + +## 概要 +`just_stopped`は、非同期操作の[開始(start)](start.md)で[停止完了関数](set_stopped.md)を呼び出すSenderファクトリである。 + + +## 効果 +呼び出し式`just_stopped()`は下記と等価。 + +```cpp +make-sender(just_stopped, product-type{}) +``` +* make-sender[link make-sender.md] +* product-type[link product-type.md] + + +### Senderアルゴリズムタグ `just_stopped` +Senderアルゴリズム動作説明用のクラステンプレート[`impls-for`](impls-for.md)に対して、下記の特殊化が定義される。 + +```cpp +namespace std::execution { + template<> + struct impls-for> : default-impls { + static constexpr auto start = + [](auto& state, auto& rcvr) noexcept -> void { + /*auto& [...ts] = state;*/ + set_stopped(std::move(rcvr)); + }; + }; +} +``` +* decayed-typeof[link decayed-typeof.md.nolink] +* impls-for[link impls-for.md] +* default-impls[link impls-for.md] +* set_stopped[link set_stopped.md] +* std::move[link /reference/utility/move.md] + + +## カスタマイゼーションポイント +[Receiver](receiver.md)との[接続(connect)](connect.md)時に、[関連付けられた実行ドメイン](get-domain-late.md)に対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 +[デフォルト実行ドメイン](default_domain.md)では無変換。 + + +## 例 +```cpp example +#include +namespace ex = std::execution; + +int main() +{ + // 停止を送信するSender + ex::sender auto sndr = ex::just_stopped(); +} +``` +* ex::just_stopped[color ff0000] +* ex::sender[link sender.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::just`](just.md) +- [`execution::just_error`](just_error.md) + + +## 参照 +- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/let_value.md b/reference/execution/execution/let_value.md index 5a216c85f3..728a686fa9 100644 --- a/reference/execution/execution/let_value.md +++ b/reference/execution/execution/let_value.md @@ -361,7 +361,7 @@ int main() * ex::set_value[link set_value.md] * ex::set_error_t[link set_error.md] * ex::set_error[link set_error.md] -* ex::just_stopped[link just_stopped.md.nolink] +* ex::just_stopped[link just_stopped.md] * ex::operation_state_t[link operation_state.md] * std::this_thread::sync_wait_with_variant[link ../this_thread/sync_wait_with_variant.md] * std::move[link /reference/utility/move.md] diff --git a/reference/execution/execution/sends_stopped.md b/reference/execution/execution/sends_stopped.md index d4cbda9e03..810f929f88 100644 --- a/reference/execution/execution/sends_stopped.md +++ b/reference/execution/execution/sends_stopped.md @@ -44,7 +44,7 @@ int main() * ex::sends_stopped[color ff0000] * ex::sender[link sender.md] * ex::just[link just.md] -* ex::just_stopped[link just_stopped.md.nolink] +* ex::just_stopped[link just_stopped.md] ### 出力 ``` diff --git a/reference/execution/execution/value_types_of_t.md b/reference/execution/execution/value_types_of_t.md index d2f0ec8b43..4b082d7719 100644 --- a/reference/execution/execution/value_types_of_t.md +++ b/reference/execution/execution/value_types_of_t.md @@ -55,7 +55,7 @@ int main() * ex::value_types_of_t[color ff0000] * ex::sender[link sender.md] * ex::just[link just.md] -* ex::just_error[link just_error.md.nolink] +* ex::just_error[link just_error.md] ### 出力 ``` diff --git a/reference/execution/execution/when_all_with_variant.md b/reference/execution/execution/when_all_with_variant.md index fb413fec84..1329f52b62 100644 --- a/reference/execution/execution/when_all_with_variant.md +++ b/reference/execution/execution/when_all_with_variant.md @@ -55,10 +55,10 @@ return when_all(into_variant(std::forward_like(child))...); ## カスタマイゼーションポイント -Senderアルゴリズム構築時に、関連付けられた実行ドメインに対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 +Senderアルゴリズム構築時に、全入力Senderに関連付けられた共通の実行ドメイン`CD`に対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 [デフォルト実行ドメイン](default_domain.md)では無変換。 -[Receiver](receiver.md)との[接続(connect)](connect.md)時に、関連付けられた実行ドメインに対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 +[Receiver](receiver.md)との[接続(connect)](connect.md)時に、[関連付けられた実行ドメイン](get-domain-late.md)に対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 [デフォルト実行ドメイン](default_domain.md)では`when_all_with_variant.transform_sender(sndr, env)`が呼ばれ、前述仕様通りのSenderへと変換される。 From 82881a7387799eeb154f46dc7cf93f733f8fdea6 Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 29 May 2025 16:49:32 +0900 Subject: [PATCH 1798/3948] =?UTF-8?q?execution:=20=E5=BE=AE=E8=AA=BF?= =?UTF-8?q?=E6=95=B4=20(#1384)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/execution/execution/let_value.md | 7 ++++--- reference/execution/execution/read_env.md | 4 +++- reference/execution/execution/schedule.md | 2 ++ reference/execution/execution/schedule_from.md | 6 +++--- reference/execution/execution/starts_on.md | 1 + 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/reference/execution/execution/let_value.md b/reference/execution/execution/let_value.md index 728a686fa9..becaf60551 100644 --- a/reference/execution/execution/let_value.md +++ b/reference/execution/execution/let_value.md @@ -227,8 +227,8 @@ namespace ex = std::execution; int main() { { // 関数呼び出し - ex::sender snd0 = ex::just(21); - ex::sender snd1 = ex::let_value( + ex::sender auto snd0 = ex::just(21); + ex::sender auto snd1 = ex::let_value( snd0, [](int n) -> ex::sender auto { return ex::just(n * 2); @@ -238,7 +238,7 @@ int main() } { // パイプライン記法 - ex::sender sndr = ex::just(21) + ex::sender auto sndr = ex::just(21) | ex::let_value( [](int n) -> ex::sender auto { return ex::just(n * 2); @@ -361,6 +361,7 @@ int main() * ex::set_value[link set_value.md] * ex::set_error_t[link set_error.md] * ex::set_error[link set_error.md] +* ex::just[link just.md] * ex::just_stopped[link just_stopped.md] * ex::operation_state_t[link operation_state.md] * std::this_thread::sync_wait_with_variant[link ../this_thread/sync_wait_with_variant.md] diff --git a/reference/execution/execution/read_env.md b/reference/execution/execution/read_env.md index ca8e9dfbe6..b679a92b3f 100644 --- a/reference/execution/execution/read_env.md +++ b/reference/execution/execution/read_env.md @@ -57,7 +57,7 @@ int main() ex::sender auto sndr = ex::read_env(ex::get_scheduler) | ex::let_value([](auto sch) -> ex::sender auto { // sch := sync_wait内部のScheduler - return ex::starts_on(sch, std::just(42)); + return ex::starts_on(sch, ex::just(42)); }); auto [val] = std::this_thread::sync_wait(sndr).value(); std::println("{}", val); @@ -66,7 +66,9 @@ int main() * ex::read_env[color ff0000] * ex::sender[link sender.md] * ex::get_scheduler[link get_scheduler.md] +* ex::let_value[lin let_value.md] * ex::starts_on[link starts_on.md] +* ex::just[lin just.md] * std::this_thread::sync_wait[link ../this_thread/sync_wait.md] * value()[link /reference/optional/optional/value.md] diff --git a/reference/execution/execution/schedule.md b/reference/execution/execution/schedule.md index 915d9e7160..ed254fc64b 100644 --- a/reference/execution/execution/schedule.md +++ b/reference/execution/execution/schedule.md @@ -73,6 +73,8 @@ int main() * finish()[link run_loop/finish.md] * std::move[link /reference/utility/move.md] * std::this_thread::get_id()[link /reference/thread/this_thread/get_id.md] +* std::this_thread::sync_wait[link ../this_thread/sync_wait.md] +* value()[link /reference/optional/optional/value.md] ### 出力例 ``` diff --git a/reference/execution/execution/schedule_from.md b/reference/execution/execution/schedule_from.md index b72a43225b..6c3014d2c7 100644 --- a/reference/execution/execution/schedule_from.md +++ b/reference/execution/execution/schedule_from.md @@ -52,7 +52,7 @@ namespace std::execution { * default-impls[link impls-for.md] * see below[italic] -`impls-for>::get-attrs`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 +`impls-for::get-attrs`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 ```cpp [](const auto& data, const auto& child) noexcept -> decltype(auto) { @@ -64,7 +64,7 @@ namespace std::execution { * FWD-ENV[link ../forwarding_query.md] * get_env[link get_env.md] -`impls-for>::get-state`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 +`impls-for::get-state`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 ```cpp [](Sndr&& sndr, Rcvr& rcvr) noexcept(see below) @@ -110,7 +110,7 @@ namespace std::execution { - `receiver_t`は説明専用クラス`receiver-type`のエイリアスとする。 -`impls-for>::complete`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 +`impls-for::complete`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 ```cpp [](auto, auto& state, auto& rcvr, Tag, Args&&... args) noexcept diff --git a/reference/execution/execution/starts_on.md b/reference/execution/execution/starts_on.md index 9b7603c133..4f23445fb9 100644 --- a/reference/execution/execution/starts_on.md +++ b/reference/execution/execution/starts_on.md @@ -114,6 +114,7 @@ int main() * ex::run_loop[link run_loop.md] * ex::sender[link sender.md] * ex::scheduler[link scheduler.md] +* ex::just[link just.md] * ex::then[link then.md] * get_scheduler()[link run_loop/get_scheduler.md] * run()[link run_loop/run.md] From d3f5ac2de2123122828ef67e8ac0187ca6d87524 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 29 May 2025 17:39:27 +0900 Subject: [PATCH 1799/3948] =?UTF-8?q?filter=5Fview=20:=20=E3=83=90?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3=E6=8C=87=E5=AE=9A=E3=83=9F?= =?UTF-8?q?=E3=82=B9=E3=82=92=E4=BF=AE=E6=AD=A3=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/filter_view/end.md | 2 +- reference/ranges/filter_view/iterator.md | 2 +- reference/ranges/filter_view/sentinel.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/ranges/filter_view/end.md b/reference/ranges/filter_view/end.md index bbb68419e3..5a9f716e17 100644 --- a/reference/ranges/filter_view/end.md +++ b/reference/ranges/filter_view/end.md @@ -3,7 +3,7 @@ * std::ranges[meta namespace] * filter_view[meta class] * function[meta id-type] -* cpp23[meta cpp] +* cpp20[meta cpp] ```cpp constexpr auto end() { diff --git a/reference/ranges/filter_view/iterator.md b/reference/ranges/filter_view/iterator.md index 46f7645b49..d991a8d4f9 100644 --- a/reference/ranges/filter_view/iterator.md +++ b/reference/ranges/filter_view/iterator.md @@ -3,7 +3,7 @@ * std::ranges[meta namespace] * filter_view[meta class] * class template[meta id-type] -* cpp23[meta cpp] +* cpp20[meta cpp] ```cpp namespace std::ranges { diff --git a/reference/ranges/filter_view/sentinel.md b/reference/ranges/filter_view/sentinel.md index 6cbf942928..df9e737f19 100644 --- a/reference/ranges/filter_view/sentinel.md +++ b/reference/ranges/filter_view/sentinel.md @@ -3,7 +3,7 @@ * std::ranges[meta namespace] * filter_view[meta class] * class template[meta id-type] -* cpp23[meta cpp] +* cpp20[meta cpp] ```cpp namespace std::ranges { From c551d630518f11f8187237f758da52e9043eda45 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 29 May 2025 17:50:57 +0900 Subject: [PATCH 1800/3948] =?UTF-8?q?repeat=5Fview=20:=20=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=90=E9=96=A2=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 5 + reference/ranges/repeat_view.md | 29 +++-- reference/ranges/repeat_view/begin.md | 54 ++++++++ reference/ranges/repeat_view/end.md | 58 +++++++++ .../ranges/repeat_view/op_constructor.md | 117 ++++++++++++++++++ .../ranges/repeat_view/op_deduction_guide.md | 48 +++++++ reference/ranges/repeat_view/size.md | 50 ++++++++ 7 files changed, 348 insertions(+), 13 deletions(-) create mode 100644 reference/ranges/repeat_view/begin.md create mode 100644 reference/ranges/repeat_view/end.md create mode 100644 reference/ranges/repeat_view/op_constructor.md create mode 100644 reference/ranges/repeat_view/op_deduction_guide.md create mode 100644 reference/ranges/repeat_view/size.md diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index ad9ac97cfb..2a8394f03a 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -168,6 +168,7 @@ * std::end[link /reference/iterator/end.md] * std::next[link /reference/iterator/next.md] * std::ostream_iterator[link /reference/iterator/ostream_iterator.md] + * unreachable_sentinel_t[link /reference/iterator/unreachable_sentinel_t.md] * [link /reference/latch.md] * [link /reference/limits.md] * std::numeric_limits[link /reference/limits/numeric_limits.md] @@ -182,6 +183,7 @@ * std::dextents[link /reference/mdspan/extents.md] * std::mdspan[link /reference/mdspan/mdspan.md] * [link /reference/memory.md] + * addressof[link /reference/memory/addressof.md] * std::allocator[link /reference/memory/allocator.md] * std::shared_ptr[link /reference/memory/shared_ptr.md] * std::unique_ptr[link /reference/memory/unique_ptr.md] @@ -292,6 +294,7 @@ * std::forward_as_tuple[link /reference/tuple/forward_as_tuple.md] * std::tuple[link /reference/tuple/tuple.md] * std::tie[link /reference/tuple/tie.md] + * tuple[link /reference/tuple/tuple.md] * [link /reference/type_traits.md] * common_type_t[link /reference/type_traits/common_type.md] * std::common_type_t[link /reference/type_traits/common_type.md] @@ -322,6 +325,8 @@ * std::make_pair[link /reference/utility/make_pair.md] * std::pair[link /reference/utility/pair.md] * pair[link /reference/utility/pair.md] + * piecewise_construct_t[link /reference/utility/piecewise_construct_t.md] + * piecewise_construct[link /reference/utility/piecewise_construct_t.md] * [link /reference/valarray.md] * std::valarray[link /reference/valarray/valarray.md] * [link /reference/variant.md] diff --git a/reference/ranges/repeat_view.md b/reference/ranges/repeat_view.md index 07c75def57..8f32a3c8c4 100644 --- a/reference/ranges/repeat_view.md +++ b/reference/ranges/repeat_view.md @@ -47,10 +47,10 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |--------------------------------------------------|----------------------------------|----------------| -| [`(constructor)`](repeat_view/op_constructor.md.nolink) | コンストラクタ | C++23 | -| [`begin`](repeat_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++23 | -| [`end`](repeat_view/end.md.nolink) | 番兵を取得する | C++23 | -| [`size`](repeat_view/data.md.nolink) | 配列の先頭へのポインタを取得する | C++23 | +| [`(constructor)`](repeat_view/op_constructor.md) | コンストラクタ | C++23 | +| [`begin`](repeat_view/begin.md) | 先頭を指すイテレータを取得する | C++23 | +| [`end`](repeat_view/end.md) | 番兵を取得する | C++23 | +| [`size`](repeat_view/size.md) | 配列の先頭へのポインタを取得する | C++23 | ## 継承しているメンバ関数 @@ -60,19 +60,22 @@ namespace std::ranges { | [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++23 | | [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++23 | | [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++23 | +| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++23 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | ## メンバ型 -| 名前 | 説明 | 対応バージョン | -|-------------------------------------------|------------------------------|----------------| -| [`iterator`](repeat_view/iterator.md) | イテレータ型(説明専用) | C++23 | +| 名前 | 説明 | 対応バージョン | +|---------------------------------------|------------------------------|----------------| +| [`iterator`](repeat_view/iterator.md) | イテレータ型(説明専用) | C++23 | ## 推論補助 -| 名前 | 説明 | 対応バージョン | -|-------------------------------------------------------|------------------------------|----------------| -| [`(deduction_guide)`](repeat_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | +| 名前 | 説明 | 対応バージョン | +|----------------------------------------------------------|------------------------------|----------------| +| [`(deduction_guide)`](repeat_view/op_deduction_guide.md) | クラステンプレートの推論補助 | C++23 | ## 例 ```cpp example @@ -99,10 +102,10 @@ int main() { - C++23 ### 処理系 -- [Clang](/implementation.md#clang): ? -- [GCC](/implementation.md#gcc): ? +- [Clang](/implementation.md#clang): 17 [mark verified] +- [GCC](/implementation.md#gcc): 13 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): ? +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 - [N4950 26 Ranges library](https://timsong-cpp.github.io/cppwp/n4950/ranges) diff --git a/reference/ranges/repeat_view/begin.md b/reference/ranges/repeat_view/begin.md new file mode 100644 index 0000000000..69c4f08e0e --- /dev/null +++ b/reference/ranges/repeat_view/begin.md @@ -0,0 +1,54 @@ +# begin +* ranges[meta header] +* std::ranges[meta namespace] +* repeat_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr iterator begin() const; // (1) C++23 +``` +* iterator[link iterator.md] + +## 概要 + +`view`の先頭要素を指すイテレータを取得する。 + + +## 戻り値 +以下と等価: + +```cpp +return iterator(addressof(*value_)); +``` + + +## 例 + +```cpp example +#include +#include + +int main() { + auto r = std::views::repeat(42, 3); + auto it = r.begin(); + std::cout << *it << std::endl; // 42 +} +``` +* begin[color ff0000] + +### 出力 + +``` +42 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 17 [mark verified] +- [GCC](/implementation.md#gcc): 13 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] diff --git a/reference/ranges/repeat_view/end.md b/reference/ranges/repeat_view/end.md new file mode 100644 index 0000000000..0b7fa4bf64 --- /dev/null +++ b/reference/ranges/repeat_view/end.md @@ -0,0 +1,58 @@ +# end +* ranges[meta header] +* std::ranges[meta namespace] +* repeat_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr iterator end() const + requires (!same_as); // (1) C++23 +``` + +## 概要 + +番兵を取得する。 + + +## 戻り値 +以下と等価: + +```cpp +return iterator(addressof(*value_), bound_); +``` + +## 例 + +```cpp example +#include +#include + +int main() { + auto r = std::views::repeat(42, 3); + auto it = r.begin(); + auto last = r.end(); + + for (; it != last; ++it) { + std::cout << *it << ' '; + } +} +``` +* end[color ff0000] +* begin()[link begin.md] + +### 出力 + +``` +42 42 42 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 17 [mark verified] +- [GCC](/implementation.md#gcc): 13 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] diff --git a/reference/ranges/repeat_view/op_constructor.md b/reference/ranges/repeat_view/op_constructor.md new file mode 100644 index 0000000000..72f4e728cc --- /dev/null +++ b/reference/ranges/repeat_view/op_constructor.md @@ -0,0 +1,117 @@ +# コンストラクタ +* ranges[meta header] +* std::ranges[meta namespace] +* repeat_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +repeat_view() + requires default_initializable = default; // (1) C++23 + +constexpr explicit + repeat_view(const T& value, Bound bound = Bound()) + requires copy_constructible; // (2) C++23 + +constexpr explicit + repeat_view(T&& value, Bound bound = Bound()); // (3) C++23 + +template + requires constructible_from && + constructible_from +constexpr explicit + repeat_view(piecewise_construct_t, + tuple value_args, + tuple bound_args = tuple<>{}); // (4) C++23 +``` + +## 概要 +[`repeat_view`](../repeat_view.md)オブジェクトを構築する。 + +- (1) : デフォルト構築 +- (2) : `value`と`bound`をコピーして、`*this`に保持する +- (3) : `value`をムーブし、`bound`をコピーして、`*this`に保持する +- (4) : 値型`T`のコンストラクタ引数をタプルにまとめた`value_args`と、繰り返し回数を表す型`Bound`のコンストラクタ引数をタプルにまとめた`bound_args`を転送して、オブジェクトを内部で構築して`*this`に保持する + + +## 事前条件 +- (1), (2) : + - 型`Bound`が型[`unreachable_sentinel_t`](/reference/iterator/unreachable_sentinel_t.md)でないこと + - `bound >= 0`であること + + +## 効果 + +- (2) : `value_`を`value`で初期化する +- (3) : `value_`を[`std::move`](/reference/utility/move.md)`(value)`で初期化する +- (4) : + - `value_`を[`make_from_tuple`](/reference/tuple/make_from_tuple.md)`(`[`std::move`](/reference/utility/move.md)`(value_args))`で初期化する + - `bound_`を[`make_from_tuple`](/reference/tuple/make_from_tuple.md)`(`[`std::move`](/reference/utility/move.md)`(bound_args))`で初期化する + - `bound`が型`unreachable_sentinel_t`である場合、もしくは`bound < 0`である場合、未定義動作を引き起こす + + +## 例 +```cpp example +#include +#include +#include + +int main() { + // (2) コピー構築 + { + std::string s1 = "hello"; + for (const std::string& x : std::views::repeat(s1, 3)) { + std::cout << x << std::endl; + } + } + std::cout << std::endl; + + // (3) ムーブ構築 + { + std::string s1 = "hello"; + for (const std::string& x : std::views::repeat(std::move(s1), 3)) { + std::cout << x << std::endl; + } + } + std::cout << std::endl; + + // (4) コンストラクタ引数から構築 + { + auto r = std::ranges::repeat_view{ + std::piecewise_construct, + std::make_tuple(3, 'a'), + std::make_tuple(3) + }; + for (const std::string& x : r) { + std::cout << x << std::endl; + } + } +} +``` +* std::ranges::repeat_view[color ff0000] +* std::views::repeat[color ff0000] + +### 出力 +``` +hello +hello +hello + +hello +hello +hello + +aaa +aaa +aaa +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 17 [mark verified] +- [GCC](/implementation.md#gcc): 13 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] diff --git a/reference/ranges/repeat_view/op_deduction_guide.md b/reference/ranges/repeat_view/op_deduction_guide.md new file mode 100644 index 0000000000..87c87c7cc4 --- /dev/null +++ b/reference/ranges/repeat_view/op_deduction_guide.md @@ -0,0 +1,48 @@ +# 推論補助 +* ranges[meta header] +* std::ranges[meta namespace] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +namespace std::ranges { + template + repeat_view(T, Bound = Bound()) -> repeat_view; +} +``` + +## 概要 + +[`repeat_view`](../repeat_view.md)クラステンプレートの型推論補助。 + + +## 例 +```cpp example +#include +#include + +int main() { + auto r = std::ranges::repeat_view(42, 3); + for (int x : r) { + std::cout << x << std::endl; + } +} + +``` + +### 出力 +``` +42 +42 +42 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 17 [mark verified] +- [GCC](/implementation.md#gcc): 13 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] diff --git a/reference/ranges/repeat_view/size.md b/reference/ranges/repeat_view/size.md new file mode 100644 index 0000000000..5c45681bf1 --- /dev/null +++ b/reference/ranges/repeat_view/size.md @@ -0,0 +1,50 @@ +# size +* ranges[meta header] +* std::ranges[meta namespace] +* repeat_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr auto size() const + requires (!same_as); // (1) C++23 +``` + +## 概要 +要素数を取得する。 + +## 戻り値 + +以下と等価: + +```cpp +return to-unsigned-like(bound_); +``` + +## 例 +```cpp example +#include +#include + +int main() { + auto r = std::views::repeat(42, 3); + std::cout << r.size() << std::endl; +} +``` +* size[color ff0000] + +### 出力 +``` +3 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 17 [mark verified] +- [GCC](/implementation.md#gcc): 13 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] From f27450ba473bf1580f57359bd57bd064467990e7 Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 29 May 2025 18:44:42 +0900 Subject: [PATCH 1801/3948] =?UTF-8?q?functional:=20C++26=20std::execution?= =?UTF-8?q?=E8=AA=AC=E6=98=8E=E7=94=A8=E3=82=A8=E3=83=B3=E3=83=86=E3=82=A3?= =?UTF-8?q?=E3=83=86=E3=82=A3=20(#1384)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit callable,nothrow-callable,call-result-t,decayed-typeof --- .../execution/execution/basic-operation.md | 5 +-- .../execution/execution/basic-receiver.md | 4 +-- .../execution/completion_signatures_of_t.md | 2 +- reference/execution/execution/emplace-from.md | 4 +-- reference/execution/execution/impls-for.md | 2 +- reference/execution/execution/just.md | 2 +- reference/execution/execution/just_error.md | 2 +- reference/execution/execution/just_stopped.md | 2 +- reference/execution/execution/let_value.md | 12 +++---- reference/execution/execution/prop.md | 2 +- reference/execution/execution/read_env.md | 2 +- reference/execution/execution/receiver_of.md | 2 +- reference/execution/execution/then.md | 2 +- .../this_thread/sync_wait_with_variant.md | 2 +- reference/functional/call-result-t.md | 26 ++++++++++++++++ reference/functional/callable.md | 29 +++++++++++++++++ reference/functional/decayed-typeof.md | 26 ++++++++++++++++ reference/functional/nothrow-callable.md | 31 +++++++++++++++++++ 18 files changed, 135 insertions(+), 22 deletions(-) create mode 100644 reference/functional/call-result-t.md create mode 100644 reference/functional/callable.md create mode 100644 reference/functional/decayed-typeof.md create mode 100644 reference/functional/nothrow-callable.md diff --git a/reference/execution/execution/basic-operation.md b/reference/execution/execution/basic-operation.md index 43cbb0c46b..d6b41da854 100644 --- a/reference/execution/execution/basic-operation.md +++ b/reference/execution/execution/basic-operation.md @@ -72,7 +72,7 @@ nothrow-callable>::get-state), Sndr, Rcvr&> && ``` * impls-for[link impls-for.md] * tag_of_t[link tag_of_t.md] -* nothrow-callable[link /reference/functional/nothrow-callable.md.nolink] +* nothrow-callable[link /reference/functional/nothrow-callable.md] * is_nothrow_move_constructible_v[link /reference/type_traits/is_nothrow_move_constructible.md] * is_nothrow_constructible_v[link /reference/type_traits/is_nothrow_constructible.md] @@ -81,6 +81,7 @@ nothrow-callable>::get-state), Sndr, Rcvr&> && ```cpp call-result-t>::get-state), Sndr, Rcvr&>. ``` +* call-result-t[link /reference/functional/call-result-t.md] * impls-for[link impls-for.md] * tag_of_t[link tag_of_t.md] @@ -105,7 +106,7 @@ using connect-all-result = call-result-t< // exposition only template using indices-for = remove_reference_t::indices-for; // exposition only ``` -* call-result-t[link call-result-t.md.nolink] +* call-result-t[link /reference/functional/call-result-t.md] * impls-for[link impls-for.md] * tag_of_t[link tag_of_t.md] * decay_t[link /reference/type_traits/decay.md] diff --git a/reference/execution/execution/basic-receiver.md b/reference/execution/execution/basic-receiver.md index 7045171e8c..ceac2741d2 100644 --- a/reference/execution/execution/basic-receiver.md +++ b/reference/execution/execution/basic-receiver.md @@ -44,7 +44,7 @@ namespace std::execution { * tag_of_t[link tag_of_t.md] * state-type[link basic-operation.md] * impls-for[link impls-for.md] -* callable[link /reference/functional/callable.md.nolink] +* callable[link /reference/functional/callable.md] * set_value_t[link set_value.md] * set_error_t[link set_error.md] * set_stopped_t[link set_stopped.md] @@ -73,7 +73,7 @@ using env-type = call-result-t< decltype(impls-for>::get-env), Index, state-type&, const Rcvr&>; ``` -* call-result-t[link call-result-t.md.nolink] +* call-result-t[link /reference/functional/call-result-t.md] * impls-for[link impls-for.md] * tag_of_t[link tag_of_t.md] * state-type[link basic-operation.md] diff --git a/reference/execution/execution/completion_signatures_of_t.md b/reference/execution/execution/completion_signatures_of_t.md index 3c2a386c88..94616cf721 100644 --- a/reference/execution/execution/completion_signatures_of_t.md +++ b/reference/execution/execution/completion_signatures_of_t.md @@ -13,7 +13,7 @@ namespace std::execution { ``` * env<>[link env.md] * sender_in[link sender_in.md] -* call-result-t[link call-result-t.md.nolink] +* call-result-t[link /reference/functional/call-result-t.md] * get_completion_signatures_t[link get_completion_signatures.md] ## 概要 diff --git a/reference/execution/execution/emplace-from.md b/reference/execution/execution/emplace-from.md index f74b328907..b7eec63771 100644 --- a/reference/execution/execution/emplace-from.md +++ b/reference/execution/execution/emplace-from.md @@ -21,8 +21,8 @@ struct emplace-from { }; ``` * is_nothrow_move_constructible_v[link /reference/type_traits/is_nothrow_move_constructible.md] -* call-result-t[link call-result-t.md.nolink] -* nothrow-callable[link /reference/functional/nothrow-callable.md.nolink] +* call-result-t[link /reference/functional/call-result-t.md] +* nothrow-callable[link /reference/functional/nothrow-callable.md] * std::move[link /reference/utility/move.md] ## 概要 diff --git a/reference/execution/execution/impls-for.md b/reference/execution/execution/impls-for.md index a52188719a..10354d22e8 100644 --- a/reference/execution/execution/impls-for.md +++ b/reference/execution/execution/impls-for.md @@ -109,7 +109,7 @@ namespace std::execution { Tag()(std::move(rcvr), std::forward(args)...); } ``` -* callable[link /reference/functional/callable.md.nolink] +* callable[link /reference/functional/callable.md] * std::move[link /reference/utility/move.md] diff --git a/reference/execution/execution/just.md b/reference/execution/execution/just.md index f5a6c18610..171b2162e4 100644 --- a/reference/execution/execution/just.md +++ b/reference/execution/execution/just.md @@ -45,7 +45,7 @@ namespace std::execution { }; } ``` -* decayed-typeof[link decayed-typeof.md.nolink] +* decayed-typeof[link /reference/functional/decayed-typeof.md] * impls-for[link impls-for.md] * default-impls[link impls-for.md] * set_value[link set_value.md] diff --git a/reference/execution/execution/just_error.md b/reference/execution/execution/just_error.md index 840f2c3a92..6a8b42b087 100644 --- a/reference/execution/execution/just_error.md +++ b/reference/execution/execution/just_error.md @@ -46,7 +46,7 @@ namespace std::execution { }; } ``` -* decayed-typeof[link decayed-typeof.md.nolink] +* decayed-typeof[link /reference/functional/decayed-typeof.md] * impls-for[link impls-for.md] * default-impls[link impls-for.md] * set_error[link set_error.md] diff --git a/reference/execution/execution/just_stopped.md b/reference/execution/execution/just_stopped.md index a48ed153f0..f3b343d7ea 100644 --- a/reference/execution/execution/just_stopped.md +++ b/reference/execution/execution/just_stopped.md @@ -41,7 +41,7 @@ namespace std::execution { }; } ``` -* decayed-typeof[link decayed-typeof.md.nolink] +* decayed-typeof[link /reference/functional/decayed-typeof.md] * impls-for[link impls-for.md] * default-impls[link impls-for.md] * set_stopped[link set_stopped.md] diff --git a/reference/execution/execution/let_value.md b/reference/execution/execution/let_value.md index becaf60551..b983c0ebc8 100644 --- a/reference/execution/execution/let_value.md +++ b/reference/execution/execution/let_value.md @@ -45,7 +45,7 @@ namespace std::execution { ``` * impls-for[link impls-for.md] * default-impls[link impls-for.md] -* decayed-typeof[link decayed-typeof.md.nolink] +* decayed-typeof[link /reference/functional/decayed-typeof.md] * see below[italic] `impls-for>::get-state`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 @@ -78,7 +78,7 @@ namespace std::execution { * decay_t[link /reference/type_traits/decay.md] * see below[italic] -- 説明用のパック`Sigs`を[`completion_signatures_of_t`](completion_signatures_of_t.md)`<`[`child-type`](child-type.md)`,` [`env_of_t`](env_of_t.md)`>`による[`completion_signatures`](completion_signatures.md)特殊化のテンプレートパラメータとし、パック`LetSigs`を`Sigs`に含まれる型のうち戻り値型が`decayed-typeof<`[`set_value`](set_value.md)`>`に等しいものと定義する。説明用のエイリアステンプレート`as-tuple`を[`decayed-tuple`](decayed-tuple.md)``と定義する。型`args_variant_t`は下記定義において重複削除した型となる。 +- 説明用のパック`Sigs`を[`completion_signatures_of_t`](completion_signatures_of_t.md)`<`[`child-type`](child-type.md)`,` [`env_of_t`](env_of_t.md)`>`による[`completion_signatures`](completion_signatures.md)特殊化のテンプレートパラメータとし、パック`LetSigs`を`Sigs`に含まれる型のうち戻り値型が[`decayed-typeof`](/reference/functional/decayed-typeof.md)`<`[`set_value`](set_value.md)`>`に等しいものと定義する。説明用のエイリアステンプレート`as-tuple`を[`decayed-tuple`](decayed-tuple.md)``と定義する。型`args_variant_t`は下記定義において重複削除した型となる。 ```cpp variant...> @@ -86,7 +86,7 @@ namespace std::execution { * variant[link /reference/variant/variant.md] * monostate[link /reference/variant/monostate.md] -- 説明用の型`Tag`とパック`Args`に対して、説明用のエイリアステンプレート`as-sndr2`を`call-result-t&...>`と定義する。型`ops2_variant_t`は下記定義において重複削除した型となる。 +- 説明用の型`Tag`とパック`Args`に対して、説明用のエイリアステンプレート`as-sndr2`を[`call-result-t`](/reference/functional/call-result-t.md)`&...>`と定義する。型`ops2_variant_t`は下記定義において重複削除した型となる。 ```cpp variant, receiver2>...> @@ -113,11 +113,11 @@ namespace std::execution { } ``` * set_value[link set_value.md] -* decayed-typeof[link decayed-typeof.md.nolink] +* decayed-typeof[link /reference/functional/decayed-typeof.md] * TRY-EVAL[link TRY-EVAL.md.nolink] * std::move[link /reference/utility/move.md] -説明用の式`sndr`と`env`に対して、型`Sndr`を`decltype((sndr))`とする。[`sender-for`](sender-for.md)`> == false`のとき、式`let_value.transform_env(sndr, env)`は不適格となる。 +説明用の式`sndr`と`env`に対して、型`Sndr`を`decltype((sndr))`とする。[`sender-for`](sender-for.md)`> == false`のとき、式`let_value.transform_env(sndr, env)`は不適格となる。 そうでなければ、式`let_value.transform_env(sndr, env)`は[`JOIN-ENV`](JOIN-ENV.md.nolink)`(let-env(sndr),` [`FWD-ENV`](../forwarding_query.md)`(env))`と等価。 @@ -125,7 +125,7 @@ namespace std::execution { ## 説明専用エンティティ 説明用の式`sndr`を用いて、`let-env(sndr)`を下記リストのうち最初に適格となる式と定義する。 -- [`SCHED-ENV`](SCHED-ENV.md.nolink)`(`[`get_completion_scheduler`](get_completion_scheduler.md)`>(`[`get_env`](get_env.md)`(sndr)))` +- [`SCHED-ENV`](SCHED-ENV.md.nolink)`(`[`get_completion_scheduler`](get_completion_scheduler.md)`<`[`decayed-typeof`](/reference/functional/decayed-typeof.md)`<`[`set_value`](set_value.md)`>>(`[`get_env`](get_env.md)`(sndr)))` - [`MAKE-ENV`](MAKE-ENV.md.nolink)`(`[`get_domain`](get_domain.md)`,` [`get_domain`](get_domain.md)`(`[`get_env`](get_env.md)`(sndr)))` - `(void(sndr),` [`env<>{}`](env.md)`)` diff --git a/reference/execution/execution/prop.md b/reference/execution/execution/prop.md index a54a73074b..d58f8f3840 100644 --- a/reference/execution/execution/prop.md +++ b/reference/execution/execution/prop.md @@ -27,7 +27,7 @@ namespace std::execution { ## 適格要件 -説明用の`prop-like`テンプレートクラスを用いて、`QueryTag`と`ValueType`が[`callable`](/reference/functional/callable.md.nolink)`>`のモデルであること。 +説明用の`prop-like`テンプレートクラスを用いて、`QueryTag`と`ValueType`が[`callable`](/reference/functional/callable.md)`>`のモデルであること。 ```cpp template diff --git a/reference/execution/execution/read_env.md b/reference/execution/execution/read_env.md index b679a92b3f..3675865892 100644 --- a/reference/execution/execution/read_env.md +++ b/reference/execution/execution/read_env.md @@ -36,7 +36,7 @@ namespace std::execution { }; } ``` -* decayed-typeof[link decayed-typeof.md.nolink] +* decayed-typeof[link /reference/functional/decayed-typeof.md] * impls-for[link impls-for.md] * default-impls[link impls-for.md] * get_env[link get_env.md] diff --git a/reference/execution/execution/receiver_of.md b/reference/execution/execution/receiver_of.md index cc75feef00..9371cd1c76 100644 --- a/reference/execution/execution/receiver_of.md +++ b/reference/execution/execution/receiver_of.md @@ -34,7 +34,7 @@ concept has-completions = {}(completions); }; ``` -* callable[link /reference/functional/callable.md.nolink] +* callable[link /reference/functional/callable.md] * completion_signatures[link completion_signatures.md] `receiver_of`コンセプトは、以下のように定義される。 diff --git a/reference/execution/execution/then.md b/reference/execution/execution/then.md index 257d738ed4..9a2eb12b8c 100644 --- a/reference/execution/execution/then.md +++ b/reference/execution/execution/then.md @@ -51,7 +51,7 @@ namespace std::execution { }; } ``` -* decayed-typeof[link decayed-typeof.md.nolink] +* decayed-typeof[link /reference/functional/decayed-typeof.md] * impls-for[link impls-for.md] * default-impls[link impls-for.md] * set_value[link set_value.md] diff --git a/reference/execution/this_thread/sync_wait_with_variant.md b/reference/execution/this_thread/sync_wait_with_variant.md index 39b48b05cc..d23cf60182 100644 --- a/reference/execution/this_thread/sync_wait_with_variant.md +++ b/reference/execution/this_thread/sync_wait_with_variant.md @@ -58,7 +58,7 @@ namespace std::this_thread { ### Senderアルゴリズムタグ `sync_wait_with_variant` 説明用の`sndr`を`decltype(`[`into_variant`](../execution/into_variant.md)`(sndr))`が`Sndr`型となる式とする。 -[`callable`](/reference/functional/callable.md.nolink)`<`[`sync_wait_t`](sync_wait.md)`, Sndr> == false`のとき、式`sync_wait_with_variant.apply_sender(sndr)`は不適格となる。 +[`callable`](/reference/functional/callable.md)`<`[`sync_wait_t`](sync_wait.md)`, Sndr> == false`のとき、式`sync_wait_with_variant.apply_sender(sndr)`は不適格となる。 そうでなければ、式`sync_wait_with_variant.apply_sender(sndr)`は下記と等価。 diff --git a/reference/functional/call-result-t.md b/reference/functional/call-result-t.md new file mode 100644 index 0000000000..687b8eda25 --- /dev/null +++ b/reference/functional/call-result-t.md @@ -0,0 +1,26 @@ +# call-result-t +* functional[meta header] +* type-alias[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +template +using call-result-t = decltype(declval()(declval()...)); // exposition only +``` + +## 概要 +`call-result-t`は、`Fn`型オブジェクトを引数型リスト`Args...`で関数呼び出したときの戻り値型を取得する説明専用のエイリアステンプレートである。 + + +## 備考 +説明専用のエイリアステンプレート`call-result-t`は、実行制御ライブラリの仕様定義のため導入された。 + + +## バージョン +### 言語 +- C++26 + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/functional/callable.md b/reference/functional/callable.md new file mode 100644 index 0000000000..da1ac1b63b --- /dev/null +++ b/reference/functional/callable.md @@ -0,0 +1,29 @@ +# callable +* functional[meta header] +* concept[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +template +concept callable = // exposition only + requires (Fn&& fn, Args&&... args) { + std::forward(fn)(std::forward(args)...); + }; +``` + +## 概要 +`callable`は、関数呼び出し式`fn(args...)`が適格であることを表す説明専用のコンセプトである。 + + +## 備考 +説明専用のコンセプト`callable`は、実行制御ライブラリの仕様定義のため導入された。 + + +## バージョン +### 言語 +- C++26 + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/functional/decayed-typeof.md b/reference/functional/decayed-typeof.md new file mode 100644 index 0000000000..f7d9e6cc5a --- /dev/null +++ b/reference/functional/decayed-typeof.md @@ -0,0 +1,26 @@ +# decayed-typeof +* functional[meta header] +* type-alias[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +template +using decayed-typeof = decltype(auto(Tag)); // exposition only +``` + +## 概要 +`decayed-typeof`は、型`Tag`の[Decayed](/reference/type_traits/decay.md)結果型を取得する説明専用のエイリアステンプレートである。 + + +## 備考 +説明専用のエイリアステンプレート`decayed-typeof`は、実行制御ライブラリの仕様定義のため導入された。 + + +## バージョン +### 言語 +- C++26 + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/functional/nothrow-callable.md b/reference/functional/nothrow-callable.md new file mode 100644 index 0000000000..d82448883e --- /dev/null +++ b/reference/functional/nothrow-callable.md @@ -0,0 +1,31 @@ +# nothrow-callable +* functional[meta header] +* concept[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +template +concept nothrow-callable = // exposition only + callable && + requires (Fn&& fn, Args&&... args) { + { std::forward(fn)(std::forward(args)...) } noexcept; + }; +``` +* callable[link callable.md] + +## 概要 +`nothrow-callable`は、関数呼び出し式`fn(args...)`が適格かつ例外送出しないことを表す説明専用のコンセプトである。 + + +## 備考 +説明専用のコンセプト`nothrow-callable`は、実行制御ライブラリの仕様定義のため導入された。 + + +## バージョン +### 言語 +- C++26 + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) From d6addf6b97d3d67a96a2d2e148179f9fe0d25459 Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 29 May 2025 19:52:55 +0900 Subject: [PATCH 1802/3948] execution: sender_adaptor_closure (#1384) --- reference/execution/execution.md | 2 +- reference/execution/execution/bulk.md | 2 +- reference/execution/execution/continues_on.md | 2 +- reference/execution/execution/into_variant.md | 2 +- reference/execution/execution/let_value.md | 2 +- reference/execution/execution/on.md | 8 +- .../execution/sender_adaptor_closure.md | 73 +++++++++++++++++++ reference/execution/execution/split.md | 2 +- reference/execution/execution/then.md | 2 +- 9 files changed, 84 insertions(+), 11 deletions(-) create mode 100644 reference/execution/execution/sender_adaptor_closure.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 24fc001d06..ad7cf4d469 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -110,7 +110,7 @@ namespace std::execution { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`execution::sender_adaptor_closure`](execution/sender_adaptor_closure.md.nolink) | Senderアダプタ実装用クロージャ型(class template) | C++26 | +| [`execution::sender_adaptor_closure`](execution/sender_adaptor_closure.md) | パイプライン記法をサポートするSenderアダプタ実装補助 (class template) | C++26 | | [`execution::starts_on`](execution/starts_on.md) | 指定Scheduler上で開始する (customization point object) | C++26 | | [`execution::continues_on`](execution/continues_on.md) | 指定Scheduler上で継続する (customization point object) | C++26 | | [`execution::on`](execution/on.md) | 指定Senderのみ別Scheduler上で実行する (customization point object) | C++26 | diff --git a/reference/execution/execution/bulk.md b/reference/execution/execution/bulk.md index 82ad14e323..3689a9aed6 100644 --- a/reference/execution/execution/bulk.md +++ b/reference/execution/execution/bulk.md @@ -15,7 +15,7 @@ namespace std::execution { ## 概要 `bulk`は、インデクス空間の各インデクスに対してタスクを反復実行するSenderアダプタである。 -`bulk`はパイプライン記法をサポートする。 +`bulk`は[パイプ可能Senderアダプタオブジェクト](sender_adaptor_closure.md)であり、パイプライン記法をサポートする。 ## 効果 diff --git a/reference/execution/execution/continues_on.md b/reference/execution/execution/continues_on.md index 1ac47acb22..d320b53aca 100644 --- a/reference/execution/execution/continues_on.md +++ b/reference/execution/execution/continues_on.md @@ -15,7 +15,7 @@ namespace std::execution { ## 概要 `continues_on`は、指定[Scheduler](scheduler.md)上で完了させるSenderアダプタである。 -`continues_on`はパイプライン記法をサポートする。 +`continues_on`は[パイプ可能Senderアダプタオブジェクト](sender_adaptor_closure.md)であり、パイプライン記法をサポートする。 ## 効果 diff --git a/reference/execution/execution/into_variant.md b/reference/execution/execution/into_variant.md index afabb4205a..d511575a39 100644 --- a/reference/execution/execution/into_variant.md +++ b/reference/execution/execution/into_variant.md @@ -15,7 +15,7 @@ namespace std::execution { ## 概要 `into_variant`は、複数の[値完了シグネチャ](set_value.md)を持つ入力[Sender](sender.md)から複数[`tuple`](/reference/tuple/tuple.md)型からなる[`variant`](/reference/variant/variant.md)型の[値完了シグネチャへと変換](value_types_of_t.md)するSenderアダプタである。 -`into_variant`はパイプライン記法をサポートする。 +`into_variant`は[パイプ可能Senderアダプタオブジェクト](sender_adaptor_closure.md)であり、パイプライン記法をサポートする。 ## 効果 diff --git a/reference/execution/execution/let_value.md b/reference/execution/execution/let_value.md index b983c0ebc8..d0b36b0889 100644 --- a/reference/execution/execution/let_value.md +++ b/reference/execution/execution/let_value.md @@ -15,7 +15,7 @@ namespace std::execution { ## 概要 `let_value`は、新しいSenderを返す関数呼び出し可能なオブジェクトに引き渡すことで、入力[Sender](sender.md)の[値完了](set_value.md)結果から入れ子の非同期操作へと変換するSenderアダプタである。 -`let_value`はパイプライン記法をサポートする。 +`let_value`は[パイプ可能Senderアダプタオブジェクト](sender_adaptor_closure.md)であり、パイプライン記法をサポートする。 ## 効果 diff --git a/reference/execution/execution/on.md b/reference/execution/execution/on.md index 431ef4feb3..90c4e0fa71 100644 --- a/reference/execution/execution/on.md +++ b/reference/execution/execution/on.md @@ -18,7 +18,7 @@ namespace std::execution { - `on(sch, sndr)` : [Sender](sender.md)`sndr`を[Scheduler](scheduler.md)`sch`に関連付けられた実行リソースに属する実行エージェント上で開始し、完了後に`on`Senderが開始された実行リソースへと実行制御を戻す。 - `on(sndr, sch, closure)` : [Sender](sender.md)`sndr`の完了後に、[Scheduler](scheduler.md)`sch`に関連付けられた実行リソースに属する実行エージェントへ実行を移し、`sndr`の完了結果をもってSenderアダプタクロージャ`closure`を実行し、Sender`sndr`が完了された実行リソースへと実行制御を戻す。 -`on`はパイプライン記法をサポートする。 +`on`は[パイプ可能Senderアダプタオブジェクト](sender_adaptor_closure.md)であり、パイプライン記法をサポートする。 ## 効果 @@ -26,8 +26,8 @@ namespace std::execution { 説明用の式`sch`と`sndr`に対して、下記いずれかが`true`となるとき呼び出し式`on(sch, sndr)`は不適格となる。 - `decltype((sch))`が[`scheduler`](scheduler.md)を満たさない、もしくは -- `decltype((sndr))`が[`sender`](sender.md)を満たさず、かつパイプライン可能Senderアダプタクロージャオブジェクトではない、もしくは -- `decltype((sndr))`が[`sender`](sender.md)を満たし、かつパイプライン可能Senderアダプタクロージャオブジェクトである。 +- `decltype((sndr))`が[`sender`](sender.md)を満たさず、かつ[パイプ可能Senderアダプタクロージャオブジェクト](sender_adaptor_closure.md)ではない、もしくは +- `decltype((sndr))`が[`sender`](sender.md)を満たし、かつ[パイプ可能Senderアダプタクロージャオブジェクト](sender_adaptor_closure.md)である。 そうでなければ、呼び出し式`on(sch, sndr)`は`sch`が1回だけ評価されることを除いて、下記と等価。 @@ -48,7 +48,7 @@ transform_sender( - `decltype((sch))`が[`scheduler`](scheduler.md)を満たさない、もしくは - `decltype((sndr))`が[`sender`](sender.md)を満たさない、もしくは -- `closure`がパイプライン可能Senderアダプタクロージャオブジェクトではない。 +- `closure`が[パイプ可能Senderアダプタクロージャオブジェクト](sender_adaptor_closure.md)ではない。 そうでなければ、呼び出し式`on(sndr, sch, closure)`は`sndr`が1回だけ評価されることを除いて、下記と等価。 diff --git a/reference/execution/execution/sender_adaptor_closure.md b/reference/execution/execution/sender_adaptor_closure.md new file mode 100644 index 0000000000..e0b6ecaee4 --- /dev/null +++ b/reference/execution/execution/sender_adaptor_closure.md @@ -0,0 +1,73 @@ +# sender_adaptor_closure +* execution[meta header] +* class template[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template + struct sender_adaptor_closure { }; +} +``` + +## 概要 +`sender_adaptor_closure`は、ユーザ定義のパイプ可能Senderアダプタクロージャオブジェクトの実装を補助するクラステンプレートである。 + +`sender_adaptor_closure`を基底クラスとして持つクラス型`T`のオブジェクトは、パイプ可能Senderアダプタクロージャオブジェクトとなる。 + +`sender_adaptor_closure`のテンプレートパラメータ`D`は不完全型でもよい。 +`|`演算子のオペランドにcv修飾された型`D`の式が登場するまでに、`D`は完全型かつ[`derived_from`](/reference/concepts/derived_from.md)`>`のモデルとなるべき。 + + +### パイプ可能Senderアダプタクロージャオブジェクト +パイプ可能Senderアダプタクロージャオブジェクト(pipeable sender adaptor closure object)とは、1つ以上の[`sender`](sender.md)を引数にとり、戻り値として[`sender`](sender.md)を返す関数オブジェクトである。 + +パイプ可能Senderアダプタクロージャオブジェクト`c`と型`decltype((sndr))`が[`sender`](sender.md)のモデルである式`sndr`に対して、下記の2つの式は等価であり、いずれも[`sender`](sender.md)を生成する。 + +```cpp +c(sndr) +sndr | c +``` + +さらにパイプ可能Senderアダプタクロージャオブジェクト`d`が与えられたとき、式 `c | d` は別のパイプ可能Senderアダプタクロージャオブジェクト`e`となる。 +このとき、`e`は下記の特性を持つ完全転送呼び出しラッパー(perfect forwarding call wrapper)である。 + +- 対象オブジェクトは、`d`で直接非リスト初期化された型`decltype(auto(d))`のオブジェクト`d2`である。 +- `c`で直接非リスト初期化された型`decltype(auto(c))`のオブジェクト`c2`を、1個の束縛引数エンティティとして持つ。 +- 説明用の`arg`を`e`に対する関数呼び出し式の引数としたとき、呼び出しパターン`d2(c2(arg))`に対応する。 + +式 `c | d` は、`e`の全て状態エンティティ(state entities)の初期化が適格な場合に限って適格となる。 + + +### パイプ可能Senderアダプタオブジェクト +パイプ可能Senderアダプタオブジェクト(pipeable sender adaptor object)とは、第1引数に[`sender`](sender.md)をとり、戻り値として[`sender`](sender.md)を返すカスタマイゼーションポイントオブジェクトである。 +パイプ可能Senderアダプタオブジェクトが1個の引数しかとらないとき、パイプ可能Senderアダプタクロージャオブジェクトとなる。 + +パイプ可能Senderアダプタオブジェクト`adaptor`が1個より多い引数をとるとき、型`decltype((sndr))`が[`sender`](sender.md)のモデルである式`sndr`、`args...`を式`adaptor(sndr, args...)`が適格となる引数リスト、型パック`BoundsArgs`を`decltype(auto(args))...`とする。 +式`adaptor(args...)`は、下記の特性をもつ完全転送呼び出しラッパーであるパイプ可能Senderアダプタクロージャオブジェクト`f`を生成する。 + +- 対象オブジェクトは`adaptor`のコピー。 +- 束縛引数エンティティ`bound_args`は、それぞれ[`std::forward`](/reference/utility/forward.md)`(args)...`で直接非リスト初期化された型`BoundArgs...`のオブジェクトから構成される。 +- 説明用の`rcvr`を`f`に対する関数呼び出し式の引数としたとき、呼び出しパターン`adaptor(rcvr, bound_args...)`に対応する。 + +式`adaptor(args...)`は、前述の通り結果の束縛引数エンティティの初期化が適格な場合に限って適格となる。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::sender`](sender.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/split.md b/reference/execution/execution/split.md index 0f68960cc3..08b1e35d4b 100644 --- a/reference/execution/execution/split.md +++ b/reference/execution/execution/split.md @@ -15,7 +15,7 @@ namespace std::execution { ## 概要 `split`は、任意の入力[Sender](sender.md)を複数回[接続(connect)](connect.md)可能とするSenderアダプタである。 -`split`はパイプライン記法をサポートする。 +`split`は[パイプ可能Senderアダプタオブジェクト](sender_adaptor_closure.md)であり、パイプライン記法をサポートする。 ## 効果 diff --git a/reference/execution/execution/then.md b/reference/execution/execution/then.md index 9a2eb12b8c..22d67d5a4c 100644 --- a/reference/execution/execution/then.md +++ b/reference/execution/execution/then.md @@ -15,7 +15,7 @@ namespace std::execution { ## 概要 `then`は、入力[Sender](sender.md)の[値完了操作](set_value.md)の継続として関数呼び出しをアタッチするSenderアダプタである。 -`then`はパイプライン記法をサポートする。 +`then`は[パイプ可能Senderアダプタオブジェクト](sender_adaptor_closure.md)であり、パイプライン記法をサポートする。 ## 効果 From 457602ec9ed561bf47cb0ad0877ceda8aa07408b Mon Sep 17 00:00:00 2001 From: Koki Watanabe <56009584+math-hiyoko@users.noreply.github.com> Date: Fri, 30 May 2025 01:50:47 +0900 Subject: [PATCH 1803/3948] Apply suggestions from code review Co-authored-by: Koichi Murase --- reference/unordered_map/unordered_map/clear.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/reference/unordered_map/unordered_map/clear.md b/reference/unordered_map/unordered_map/clear.md index f4801435c8..f7890756aa 100644 --- a/reference/unordered_map/unordered_map/clear.md +++ b/reference/unordered_map/unordered_map/clear.md @@ -37,9 +37,10 @@ void clear() noexcept; 本関数呼び出し前のコンテナの要素数([`size`](size.md)`()`)に比例 ### 計算量に関する備考 -- 多くの実装(GCC libstdc++, LLVM libc++ など)は - 1. 全ての要素を走査して各要素を破棄 - 2. 全てのバケットを走査して各バケットの状態をリセット +多くの実装(GCC libstdc++, LLVM libc++ など)は + +1. 全ての要素を走査して各要素を破棄 +2. 全てのバケットを走査して各バケットの状態をリセット という手順を取るため、実際の実行時間はバケット数 [`bucket_count`](bucket_count.md)`()` について線形となる (`size() <= bucket_count() * `[`max_load_factor()`](max_load_factor.md) = O(`bucket_count()`) であることに注意)。 規格の計算量の要件は要素数 `size()` に線形となっているが、規格がコンテナに対して定義する計算量は「コンテナに格納している要素に対する操作の数の計算量」であるためバケットの走査などを考慮していない。 @@ -48,7 +49,7 @@ void clear() noexcept; ## 備考 - `clear()` がバケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格は要求していない。 実装によっては `clear()` 後もバケット配列が維持され、動的メモリが残る場合がある。 -- バケット数を初期状態まで縮小させたいときには以下のように操作を行う +- バケット数を初期状態まで縮小させたいときには `clear()` の代わりに以下のように操作する ```cpp um = std::unordered_map(); ``` From b7bc91cf101774c98f5b100c60f57cd3f9ce064a Mon Sep 17 00:00:00 2001 From: koki watanabe Date: Fri, 30 May 2025 01:54:47 +0900 Subject: [PATCH 1804/3948] fix: reflect suggestions --- reference/unordered_map/unordered_multimap/clear.md | 9 +++++---- reference/unordered_set/unordered_multiset/clear.md | 9 +++++---- reference/unordered_set/unordered_set/clear.md | 9 +++++---- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/reference/unordered_map/unordered_multimap/clear.md b/reference/unordered_map/unordered_multimap/clear.md index a398dd962c..9eb3aab77d 100644 --- a/reference/unordered_map/unordered_multimap/clear.md +++ b/reference/unordered_map/unordered_multimap/clear.md @@ -37,9 +37,10 @@ void clear() noexcept; 本関数呼び出し前のコンテナの要素数([`size`](size.md)`()`)に比例 ### 計算量に関する備考 -- 多くの実装(GCC libstdc++, LLVM libc++ など)は - 1. 全ての要素を走査して各要素を破棄 - 2. 全てのバケットを走査して各バケットの状態をリセット +多くの実装(GCC libstdc++, LLVM libc++ など)は + +1. 全ての要素を走査して各要素を破棄 +2. 全てのバケットを走査して各バケットの状態をリセット という手順を取るため、実際の実行時間はバケット数 [`bucket_count`](bucket_count.md)`()` について線形となる (`size() <= bucket_count() * `[`max_load_factor()`](max_load_factor.md) = O(`bucket_count()`) であることに注意)。 規格の計算量の要件は要素数 `size()` に線形となっているが、規格がコンテナに対して定義する計算量は「コンテナに格納している要素に対する操作の数の計算量」であるためバケットの走査などを考慮していない。 @@ -48,7 +49,7 @@ void clear() noexcept; ## 備考 - `clear()` がバケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格は要求していない。 実装によっては `clear()` 後もバケット配列が維持され、動的メモリが残る場合がある。 -- バケット数を初期状態まで縮小させたいときには以下のように操作を行う +- バケット数を初期状態まで縮小させたいときには `clear()` の代わりに以下のように操作する ```cpp um = std::unordered_multimap(); ``` diff --git a/reference/unordered_set/unordered_multiset/clear.md b/reference/unordered_set/unordered_multiset/clear.md index 400dbac0b0..18a00adaed 100644 --- a/reference/unordered_set/unordered_multiset/clear.md +++ b/reference/unordered_set/unordered_multiset/clear.md @@ -37,9 +37,10 @@ void clear() noexcept; 本関数呼び出し前のコンテナの要素数([`size`](size.md)`()`)に比例 ### 計算量に関する備考 -- 多くの実装(GCC libstdc++, LLVM libc++ など)は - 1. 全ての要素を走査して各要素を破棄 - 2. 全てのバケットを走査して各バケットの状態をリセット +多くの実装(GCC libstdc++, LLVM libc++ など)は + +1. 全ての要素を走査して各要素を破棄 +2. 全てのバケットを走査して各バケットの状態をリセット という手順を取るため、実際の実行時間はバケット数 [`bucket_count`](bucket_count.md)`()` について線形となる (`size() <= bucket_count() * `[`max_load_factor()`](max_load_factor.md) = O(`bucket_count()`) であることに注意)。 規格の計算量の要件は要素数 `size()` に線形となっているが、規格がコンテナに対して定義する計算量は「コンテナに格納している要素に対する操作の数の計算量」であるためバケットの走査などを考慮していない。 @@ -48,7 +49,7 @@ void clear() noexcept; ## 備考 - `clear()` がバケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格は要求していない。 実装によっては `clear()` 後もバケット配列が維持され、動的メモリが残る場合がある。 -- バケット数を初期状態まで縮小させたいときには以下のように操作を行う +- バケット数を初期状態まで縮小させたいときには `clear()` の代わりに以下のように操作する ```cpp ums = std::unordered_multiset(); ``` diff --git a/reference/unordered_set/unordered_set/clear.md b/reference/unordered_set/unordered_set/clear.md index 38e5d5d244..ca24658e1a 100644 --- a/reference/unordered_set/unordered_set/clear.md +++ b/reference/unordered_set/unordered_set/clear.md @@ -37,9 +37,10 @@ void clear() noexcept; 本関数呼び出し前のコンテナの要素数([`size`](size.md)`()`)に比例 ### 計算量に関する備考 -- 多くの実装(GCC libstdc++, LLVM libc++ など)は - 1. 全ての要素を走査して各要素を破棄 - 2. 全てのバケットを走査して各バケットの状態をリセット +多くの実装(GCC libstdc++, LLVM libc++ など)は + +1. 全ての要素を走査して各要素を破棄 +2. 全てのバケットを走査して各バケットの状態をリセット という手順を取るため、実際の実行時間はバケット数 [`bucket_count`](bucket_count.md)`()` について線形となる (`size() <= bucket_count() * `[`max_load_factor()`](max_load_factor.md) = O(`bucket_count()`) であることに注意)。 規格の計算量の要件は要素数 `size()` に線形となっているが、規格がコンテナに対して定義する計算量は「コンテナに格納している要素に対する操作の数の計算量」であるためバケットの走査などを考慮していない。 @@ -48,7 +49,7 @@ void clear() noexcept; ## 備考 - `clear()` がバケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格は要求していない。 実装によっては `clear()` 後もバケット配列が維持され、動的メモリが残る場合がある。 -- バケット数を初期状態まで縮小させたいときには以下のように操作を行う +- バケット数を初期状態まで縮小させたいときには `clear()` の代わりに以下のように操作する ```cpp us = std::unordered_set(); ``` From 0107d7b93199c7c20a4cb7b513952ff8816b0b0f Mon Sep 17 00:00:00 2001 From: koki watanabe Date: Fri, 30 May 2025 01:56:41 +0900 Subject: [PATCH 1805/3948] fix: indent code block --- reference/unordered_map/unordered_map/clear.md | 6 +++--- reference/unordered_map/unordered_multimap/clear.md | 6 +++--- reference/unordered_set/unordered_multiset/clear.md | 6 +++--- reference/unordered_set/unordered_set/clear.md | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/reference/unordered_map/unordered_map/clear.md b/reference/unordered_map/unordered_map/clear.md index f7890756aa..77f01844e1 100644 --- a/reference/unordered_map/unordered_map/clear.md +++ b/reference/unordered_map/unordered_map/clear.md @@ -50,9 +50,9 @@ void clear() noexcept; - `clear()` がバケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格は要求していない。 実装によっては `clear()` 後もバケット配列が維持され、動的メモリが残る場合がある。 - バケット数を初期状態まで縮小させたいときには `clear()` の代わりに以下のように操作する -```cpp -um = std::unordered_map(); -``` + ```cpp + um = std::unordered_map(); + ``` ## 例 diff --git a/reference/unordered_map/unordered_multimap/clear.md b/reference/unordered_map/unordered_multimap/clear.md index 9eb3aab77d..42e015bfd0 100644 --- a/reference/unordered_map/unordered_multimap/clear.md +++ b/reference/unordered_map/unordered_multimap/clear.md @@ -50,9 +50,9 @@ void clear() noexcept; - `clear()` がバケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格は要求していない。 実装によっては `clear()` 後もバケット配列が維持され、動的メモリが残る場合がある。 - バケット数を初期状態まで縮小させたいときには `clear()` の代わりに以下のように操作する -```cpp -um = std::unordered_multimap(); -``` + ```cpp + um = std::unordered_multimap(); + ``` ## 例 diff --git a/reference/unordered_set/unordered_multiset/clear.md b/reference/unordered_set/unordered_multiset/clear.md index 18a00adaed..e3c3f92333 100644 --- a/reference/unordered_set/unordered_multiset/clear.md +++ b/reference/unordered_set/unordered_multiset/clear.md @@ -50,9 +50,9 @@ void clear() noexcept; - `clear()` がバケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格は要求していない。 実装によっては `clear()` 後もバケット配列が維持され、動的メモリが残る場合がある。 - バケット数を初期状態まで縮小させたいときには `clear()` の代わりに以下のように操作する -```cpp -ums = std::unordered_multiset(); -``` + ```cpp + ums = std::unordered_multiset(); + ``` ## 例 diff --git a/reference/unordered_set/unordered_set/clear.md b/reference/unordered_set/unordered_set/clear.md index ca24658e1a..66d2c8b14d 100644 --- a/reference/unordered_set/unordered_set/clear.md +++ b/reference/unordered_set/unordered_set/clear.md @@ -50,9 +50,9 @@ void clear() noexcept; - `clear()` がバケット数([`bucket_count`](bucket_count.md)`()`)を縮小することを規格は要求していない。 実装によっては `clear()` 後もバケット配列が維持され、動的メモリが残る場合がある。 - バケット数を初期状態まで縮小させたいときには `clear()` の代わりに以下のように操作する -```cpp -us = std::unordered_set(); -``` + ```cpp + us = std::unordered_set(); + ``` ## 例 From 507925290698fc75f0e2c4d05849a850b81da4f3 Mon Sep 17 00:00:00 2001 From: koki watanabe Date: Fri, 30 May 2025 01:59:02 +0900 Subject: [PATCH 1806/3948] fix: markdown format --- reference/unordered_map/unordered_map/clear.md | 2 +- reference/unordered_map/unordered_multimap/clear.md | 2 +- reference/unordered_set/unordered_multiset/clear.md | 2 +- reference/unordered_set/unordered_set/clear.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/unordered_map/unordered_map/clear.md b/reference/unordered_map/unordered_map/clear.md index 77f01844e1..34eaefc58f 100644 --- a/reference/unordered_map/unordered_map/clear.md +++ b/reference/unordered_map/unordered_map/clear.md @@ -42,7 +42,7 @@ void clear() noexcept; 1. 全ての要素を走査して各要素を破棄 2. 全てのバケットを走査して各バケットの状態をリセット -という手順を取るため、実際の実行時間はバケット数 [`bucket_count`](bucket_count.md)`()` について線形となる (`size() <= bucket_count() * `[`max_load_factor()`](max_load_factor.md) = O(`bucket_count()`) であることに注意)。 +という手順を取るため、実際の実行時間はバケット数 [`bucket_count`](bucket_count.md)`()` について線形となる (`size() <= bucket_count() *` [`max_load_factor()`](max_load_factor.md) = O(`bucket_count()`) であることに注意)。 規格の計算量の要件は要素数 `size()` に線形となっているが、規格がコンテナに対して定義する計算量は「コンテナに格納している要素に対する操作の数の計算量」であるためバケットの走査などを考慮していない。 diff --git a/reference/unordered_map/unordered_multimap/clear.md b/reference/unordered_map/unordered_multimap/clear.md index 42e015bfd0..9480119e06 100644 --- a/reference/unordered_map/unordered_multimap/clear.md +++ b/reference/unordered_map/unordered_multimap/clear.md @@ -42,7 +42,7 @@ void clear() noexcept; 1. 全ての要素を走査して各要素を破棄 2. 全てのバケットを走査して各バケットの状態をリセット -という手順を取るため、実際の実行時間はバケット数 [`bucket_count`](bucket_count.md)`()` について線形となる (`size() <= bucket_count() * `[`max_load_factor()`](max_load_factor.md) = O(`bucket_count()`) であることに注意)。 +という手順を取るため、実際の実行時間はバケット数 [`bucket_count`](bucket_count.md)`()` について線形となる (`size() <= bucket_count() *` [`max_load_factor()`](max_load_factor.md) = O(`bucket_count()`) であることに注意)。 規格の計算量の要件は要素数 `size()` に線形となっているが、規格がコンテナに対して定義する計算量は「コンテナに格納している要素に対する操作の数の計算量」であるためバケットの走査などを考慮していない。 diff --git a/reference/unordered_set/unordered_multiset/clear.md b/reference/unordered_set/unordered_multiset/clear.md index e3c3f92333..f19039fd31 100644 --- a/reference/unordered_set/unordered_multiset/clear.md +++ b/reference/unordered_set/unordered_multiset/clear.md @@ -42,7 +42,7 @@ void clear() noexcept; 1. 全ての要素を走査して各要素を破棄 2. 全てのバケットを走査して各バケットの状態をリセット -という手順を取るため、実際の実行時間はバケット数 [`bucket_count`](bucket_count.md)`()` について線形となる (`size() <= bucket_count() * `[`max_load_factor()`](max_load_factor.md) = O(`bucket_count()`) であることに注意)。 +という手順を取るため、実際の実行時間はバケット数 [`bucket_count`](bucket_count.md)`()` について線形となる (`size() <= bucket_count() *` [`max_load_factor()`](max_load_factor.md) = O(`bucket_count()`) であることに注意)。 規格の計算量の要件は要素数 `size()` に線形となっているが、規格がコンテナに対して定義する計算量は「コンテナに格納している要素に対する操作の数の計算量」であるためバケットの走査などを考慮していない。 diff --git a/reference/unordered_set/unordered_set/clear.md b/reference/unordered_set/unordered_set/clear.md index 66d2c8b14d..4aabb8fe94 100644 --- a/reference/unordered_set/unordered_set/clear.md +++ b/reference/unordered_set/unordered_set/clear.md @@ -42,7 +42,7 @@ void clear() noexcept; 1. 全ての要素を走査して各要素を破棄 2. 全てのバケットを走査して各バケットの状態をリセット -という手順を取るため、実際の実行時間はバケット数 [`bucket_count`](bucket_count.md)`()` について線形となる (`size() <= bucket_count() * `[`max_load_factor()`](max_load_factor.md) = O(`bucket_count()`) であることに注意)。 +という手順を取るため、実際の実行時間はバケット数 [`bucket_count`](bucket_count.md)`()` について線形となる (`size() <= bucket_count() *` [`max_load_factor()`](max_load_factor.md) = O(`bucket_count()`) であることに注意)。 規格の計算量の要件は要素数 `size()` に線形となっているが、規格がコンテナに対して定義する計算量は「コンテナに格納している要素に対する操作の数の計算量」であるためバケットの走査などを考慮していない。 From b272152786f1bf6578039bc74ac6d7e05a9c6aed Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 30 May 2025 10:42:05 +0900 Subject: [PATCH 1807/3948] execution: stopped_as_{error,optional} (#1384) --- reference/execution/execution.md | 4 +- .../execution/execution/stopped_as_error.md | 167 ++++++++++++++++++ .../execution/stopped_as_optional.md | 167 ++++++++++++++++++ 3 files changed, 336 insertions(+), 2 deletions(-) create mode 100644 reference/execution/execution/stopped_as_error.md create mode 100644 reference/execution/execution/stopped_as_optional.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index ad7cf4d469..16b4448d75 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -126,8 +126,8 @@ namespace std::execution { | [`execution::when_all`](execution/when_all.md) | 全ての入力Sender完了を待機 (customization point object) | C++26 | | [`execution::when_all_with_variant`](execution/when_all_with_variant.md) | 複数の値完了シグネチャをもつ全ての入力Sender完了を待機 (customization point object) | C++26 | | [`execution::into_variant`](execution/into_variant.md) | 複数の値完了シグネチャを単一[`variant`](/reference/variant/variant.md)型の値完了シグネチャに変換 (customization point object) | C++26 | -| [`execution::stopped_as_optional`](execution/stopped_as_optional.md.nolink) | 入力Senderの停止完了を[`optional`](/reference/optional/optional.md)型の値完了に変換 (customization point object) | C++26 | -| [`execution::stopped_as_error`](execution/stopped_as_error.md.nolink) | 入力Senderの停止完了をエラー完了に変換 (customization point object) | C++26 | +| [`execution::stopped_as_optional`](execution/stopped_as_optional.md) | 入力Senderの停止完了を空の[`optional`](/reference/optional/optional.md)値完了に変換 (customization point object) | C++26 | +| [`execution::stopped_as_error`](execution/stopped_as_error.md) | 入力Senderの停止完了をエラー完了に変換 (customization point object) | C++26 | ### Senderコンシューマ diff --git a/reference/execution/execution/stopped_as_error.md b/reference/execution/execution/stopped_as_error.md new file mode 100644 index 0000000000..c815f97296 --- /dev/null +++ b/reference/execution/execution/stopped_as_error.md @@ -0,0 +1,167 @@ +# stopped_as_error +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct stopped_as_error_t { unspecified }; + inline constexpr stopped_as_error_t stopped_as_error{}; +} +``` +* unspecified[italic] + +## 概要 +`stopped_as_error`は、入力[Sender](sender.md)の[停止完了](set_stopped.md)をカスタムエラー型の[エラー完了](set_error.md)にマップするSenderアダプタである。 + +`stopped_as_error`は[パイプ可能Senderアダプタオブジェクト](sender_adaptor_closure.md)であり、パイプライン記法をサポートする。 + + +## 効果 +説明用の式`sndr`と`err`に対して、型`Sndr`を`decltype((sndr))`、型`Err`を`decltype((err))`とする。`Sndr`が[`sender`](sender.md)を満たさない、もしくは`Err`が[`moveable-value`](../movable-value.md)を満たさないとき、呼び出し式`stopped_as_error(sndr, err)`は不適格となる。 + +そうでなければ、呼び出し式`stopped_as_error(sndr, err)`は`sndr`が1回だけ評価されることを除いて、下記と等価。 + +```cpp +transform_sender(get-domain-early(sndr), make-sender(stopped_as_error, err, sndr)) +``` +* transform_sender[link transform_sender.md] +* get-domain-early[link get-domain-early.md] +* make-sender[link make-sender.md] + + +### Senderアルゴリズムタグ `stopped_as_error` +説明用の式`sndr`と`env`に対して、型`Sndr`を`decltype((sndr))`、型`Env`を`decltype((env))`とする。[`sender-for`](sender-for.md)` == false`、もしくは[`single-sender-value-type`](single-sender-value-type.md.nolink)``が不適格または`void`のとき、式`stopped_as_error.transform_sender(sndr, env)`は不適格となる。 + +そうでなければ、式`stopped_as_error.transform_sender(sndr, env)`は下記と等価。 + +```cpp +auto&& [_, err, child] = sndr; +using E = decltype(auto(err)); +return let_stopped( + std::forward_like(child), + [err = std::forward_like(err)]() mutable noexcept(is_nothrow_move_constructible_v) { + return just_error(std::move(err)); + }); +``` +* let_stopped[link let_stopped.md.nolink] +* just_error[link just_error.md] +* is_nothrow_move_constructible_v[link /reference/type_traits/is_nothrow_move_constructible.md] +* std::move[link /reference/utility/move.md] + + +## カスタマイゼーションポイント +Senderアルゴリズム構築時に、[Sender](sender.md)`sndr`に[関連付けられた実行ドメイン](get-domain-early.md)に対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 +[デフォルト実行ドメイン](default_domain.md)では無変換。 + +[Receiver](receiver.md)との[接続(connect)](connect.md)時に、[関連付けられた実行ドメイン](get-domain-late.md)に対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 +[デフォルト実行ドメイン](default_domain.md)では`stopped_as_error.transform_sender(sndr, env)`が呼ばれ、前述仕様通りのSenderへと変換される。 + + +## 例 +```cpp example +#include +#include +namespace ex = std::execution; + +// MySenderは下記いずれかの完了操作を行う +// 値完了 set_value(int) +// 停止完了 set_stopped() +struct MySender { + using sender_concept = ex::sender_t; + using completion_signatures = ex::completion_signatures< + ex::set_value_t(int), + ex::set_stopped_t() + >; + + template + struct state { + using operation_state_concept = ex::operation_state_t; + + state(Rcvr rcvr, int val) + : rcvr_{std::move(rcvr)}, val_{val} {} + + void start() noexcept { + if (0 < val_) { + ex::set_value(std::move(rcvr_), val_); + } else { + ex::set_stopped(std::move(rcvr_)); + } + } + + Rcvr rcvr_; + int val_; + }; + + template + auto connect(Rcvr rcvr) noexcept { + return state{std::move(rcvr), val_}; + } + + int val_; +}; + +int main() +{ + { // 関数呼び出し + ex::sender auto snd0 = MySender{-1}; + ex::sender auto snd1 = ex::stopped_as_error(snd0, MyStoppedError{}); + try { + auto result = std::this_thread::sync_wait(snd1).value(); + std::println("(int) {}", result); + } catch (MyStoppedError) { + std::println("stopped"); + } + } + + { // パイプライン記法 + ex::sender auto sndr = + MySender{-1} + | ex::stopped_as_error(MyStoppedError{}); + try { + auto result = std::this_thread::sync_wait(sndr).value(); + std::println("(int) {}", result); + } catch (MyStoppedError) { + std::println("stopped"); + } + } +} +``` +* ex::stopped_as_error[color ff0000] +* ex::sender_t[link sender.md] +* ex::sender[link sender.md] +* ex::completion_signatures[link completion_signatures.md] +* ex::set_value_t[link set_value.md] +* ex::set_value[link set_value.md] +* ex::set_stopped_t[link set_stopped.md] +* ex::set_stopped[link set_stopped.md] +* ex::operation_state_t[link operation_state.md] +* std::this_thread::sync_wait[link ../this_thread/sync_wait.md] +* std::move[link /reference/utility/move.md] + +### 出力 +``` +stopped +stopped +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::stopped_as_optional`](stopped_as_optional.md) + + +## 参照 +- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/stopped_as_optional.md b/reference/execution/execution/stopped_as_optional.md new file mode 100644 index 0000000000..1f056d35ff --- /dev/null +++ b/reference/execution/execution/stopped_as_optional.md @@ -0,0 +1,167 @@ +# stopped_as_optional +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct stopped_as_optional_t { unspecified }; + inline constexpr stopped_as_optional_t stopped_as_optional{}; +} +``` +* unspecified[italic] + +## 概要 +`stopped_as_optional`は、入力[Sender](sender.md)の[停止完了](set_stopped.md)を空の[`optional`](/reference/optional/optional.md)による[値完了](set_value.md)にマップするSenderアダプタである。入力Senderの値完了操作も[`optional`](/reference/optional/optional.md)へと変換される。 + +`stopped_as_optional`は[パイプ可能Senderアダプタオブジェクト](sender_adaptor_closure.md)であり、パイプライン記法をサポートする。 + + +## 効果 +説明用の式`sndr`に対して、型`Sndr`を`decltype((sndr))`とする。呼び出し式`stopped_as_optional(sndr)`は`sndr`が1回だけ評価されることを除いて、下記と等価。 + +```cpp +transform_sender(get-domain-early(sndr), make-sender(stopped_as_optional, {}, sndr)) +``` +* transform_sender[link transform_sender.md] +* get-domain-early[link get-domain-early.md] +* make-sender[link make-sender.md] + + +### Senderアルゴリズムタグ `stopped_as_optional` +説明用の式`sndr`と`env`に対して、型`Sndr`を`decltype((sndr))`、型`Env`を`decltype((env))`とする。[`sender-for`](sender-for.md)` == false`、もしくは[`single-sender-value-type`](single-sender-value-type.md.nolink)``が不適格または`void`のとき、式`stopped_as_optional.transform_sender(sndr, env)`は不適格となる。 + +そうでなければ、式`stopped_as_optional.transform_sender(sndr, env)`は下記と等価。 + +```cpp +auto&& [_, _, child] = sndr; +using V = single-sender-value-type; +return let_stopped( + then(std::forward_like(child), + [](Ts&&... ts) noexcept(is_nothrow_constructible_v) { + return optional(in_place, std::forward(ts)...); + }), + []() noexcept { return just(optional()); }); +``` +* single-sender-value-type[link single-sender-value-type.md.nolink] +* let_stopped[link let_stopped.md.nolink] +* then[link then.md] +* just[link just.md] +* is_nothrow_constructible_v[link /reference/type_traits/is_nothrow_constructible.md] +* optional[link /reference/optional/optional.md] +* in_place[link /reference/utility/in_place_t.md] + + +## カスタマイゼーションポイント +Senderアルゴリズム構築時に、[Sender](sender.md)`sndr`に[関連付けられた実行ドメイン](get-domain-early.md)に対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 +[デフォルト実行ドメイン](default_domain.md)では無変換。 + +[Receiver](receiver.md)との[接続(connect)](connect.md)時に、[関連付けられた実行ドメイン](get-domain-late.md)に対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 +[デフォルト実行ドメイン](default_domain.md)では`stopped_as_optional.transform_sender(sndr, env)`が呼ばれ、前述仕様通りのSenderへと変換される。 + + +## 例 +```cpp example +#include +#include +namespace ex = std::execution; + +// MySenderは下記いずれかの完了操作を行う +// 値完了 set_value(int) +// 停止完了 set_stopped() +struct MySender { + using sender_concept = ex::sender_t; + using completion_signatures = ex::completion_signatures< + ex::set_value_t(int), + ex::set_stopped_t() + >; + + template + struct state { + using operation_state_concept = ex::operation_state_t; + + state(Rcvr rcvr, int val) + : rcvr_{std::move(rcvr)}, val_{val} {} + + void start() noexcept { + if (0 < val_) { + ex::set_value(std::move(rcvr_), val_); + } else { + ex::set_stopped(std::move(rcvr_)); + } + } + + Rcvr rcvr_; + int val_; + }; + + template + auto connect(Rcvr rcvr) noexcept { + return state{std::move(rcvr), val_}; + } + + int val_; +}; + +int main() +{ + { // 関数呼び出し + ex::sender auto snd0 = MySender{-1}; + ex::sender auto snd1 = ex::stopped_as_optional(snd0); + auto [result] = std::this_thread::sync_wait(snd1).value(); + if (result) { + std::println("(int) {}", *result); + } else { + std::println("stopped"); + } + } + + { // パイプライン記法 + ex::sender auto sndr = MySender{-1} | ex::stopped_as_optional(); + auto [result] = std::this_thread::sync_wait(sndr).value(); + if (result) { + std::println("(int) {}", *result); + } else { + std::println("stopped"); + } + } +} +``` +* ex::stopped_as_optional[color ff0000] +* ex::sender_t[link sender.md] +* ex::sender[link sender.md] +* ex::completion_signatures[link completion_signatures.md] +* ex::set_value_t[link set_value.md] +* ex::set_value[link set_value.md] +* ex::set_stopped_t[link set_stopped.md] +* ex::set_stopped[link set_stopped.md] +* ex::operation_state_t[link operation_state.md] +* std::this_thread::sync_wait[link ../this_thread/sync_wait.md] +* std::move[link /reference/utility/move.md] + +### 出力 +``` +stopped +stopped +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::stopped_as_error`](stopped_as_error.md) + + +## 参照 +- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) From c658129825465e613e0ed82e5af2f5ae1379365a Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 30 May 2025 10:54:47 +0900 Subject: [PATCH 1808/3948] =?UTF-8?q?execution/stopped=5Fas=5Ferror:=20?= =?UTF-8?q?=E5=8A=B9=E6=9E=9C=E3=82=92=E4=BF=AE=E6=AD=A3=20(#1384)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/execution/execution/stopped_as_error.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/execution/execution/stopped_as_error.md b/reference/execution/execution/stopped_as_error.md index c815f97296..678417fc25 100644 --- a/reference/execution/execution/stopped_as_error.md +++ b/reference/execution/execution/stopped_as_error.md @@ -32,7 +32,7 @@ transform_sender(get-domain-early(sndr), make-sender(stopped_as_error, err, sndr ### Senderアルゴリズムタグ `stopped_as_error` -説明用の式`sndr`と`env`に対して、型`Sndr`を`decltype((sndr))`、型`Env`を`decltype((env))`とする。[`sender-for`](sender-for.md)` == false`、もしくは[`single-sender-value-type`](single-sender-value-type.md.nolink)``が不適格または`void`のとき、式`stopped_as_error.transform_sender(sndr, env)`は不適格となる。 +説明用の式`sndr`と`env`に対して、型`Sndr`を`decltype((sndr))`、型`Env`を`decltype((env))`とする。[`sender-for`](sender-for.md)` == false`のとき、式`stopped_as_error.transform_sender(sndr, env)`は不適格となる。 そうでなければ、式`stopped_as_error.transform_sender(sndr, env)`は下記と等価。 @@ -108,7 +108,7 @@ int main() ex::sender auto snd0 = MySender{-1}; ex::sender auto snd1 = ex::stopped_as_error(snd0, MyStoppedError{}); try { - auto result = std::this_thread::sync_wait(snd1).value(); + auto [result] = std::this_thread::sync_wait(snd1).value(); std::println("(int) {}", result); } catch (MyStoppedError) { std::println("stopped"); @@ -120,7 +120,7 @@ int main() MySender{-1} | ex::stopped_as_error(MyStoppedError{}); try { - auto result = std::this_thread::sync_wait(sndr).value(); + auto [result] = std::this_thread::sync_wait(sndr).value(); std::println("(int) {}", result); } catch (MyStoppedError) { std::println("stopped"); From 0d8274fb2864796421c8f9bb995382a00906040d Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 30 May 2025 12:45:03 +0900 Subject: [PATCH 1809/3948] =?UTF-8?q?basic=5Fistream=5Fview=20:=20?= =?UTF-8?q?=E3=83=A1=E3=83=B3=E3=83=90=E9=96=A2=E6=95=B0=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 2 + reference/ranges/basic_istream_view.md | 14 ++++- reference/ranges/basic_istream_view/begin.md | 56 +++++++++++++++++ reference/ranges/basic_istream_view/end.md | 60 +++++++++++++++++++ .../basic_istream_view/op_constructor.md | 52 ++++++++++++++++ 5 files changed, 181 insertions(+), 3 deletions(-) create mode 100644 reference/ranges/basic_istream_view/begin.md create mode 100644 reference/ranges/basic_istream_view/end.md create mode 100644 reference/ranges/basic_istream_view/op_constructor.md diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 2a8394f03a..7cc87f849c 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -145,6 +145,7 @@ * bidirectional_iterator[link /reference/iterator/bidirectional_iterator.md] * contiguous_iterator[link /reference/iterator/contiguous_iterator.md] * default_sentinel_t[link /reference/iterator/default_sentinel_t.md] + * default_sentinel[link /reference/iterator/default_sentinel_t.md] * forward_iterator[link /reference/iterator/forward_iterator.md] * indirect_binary_predicate[link /reference/iterator/indirect_binary_predicate.md] * indirect_unary_predicate[link /reference/iterator/indirect_unary_predicate.md] @@ -254,6 +255,7 @@ * std::span[link /reference/span/span.md] * std::dynamic_extent[link /reference/span/dynamic_extent.md] * [link /reference/sstream.md] + * std::istringstream[link /reference/sstream/basic_istream.md] * [link /reference/stack.md] * [link /reference/stacktrace.md] * [link /reference/stdexcept.md] diff --git a/reference/ranges/basic_istream_view.md b/reference/ranges/basic_istream_view.md index 9008e803c5..ee8f80af0e 100644 --- a/reference/ranges/basic_istream_view.md +++ b/reference/ranges/basic_istream_view.md @@ -69,9 +69,17 @@ concept stream-extractable = requires(basic_istream& is, Val& t) | 名前 | 説明 | 対応バージョン | |----------------------------------------------------------|----------------------------------|----------------| -| [`(constructor)`](basic_istream_view/op_constructor.md.nolink) | コンストラクタ | C++20 | -| [`begin`](basic_istream_view/begin.md.nolink) | ストリームから値を1つ読み、それを指すイテレータを取得する | C++20 | -| [`end`](basic_istream_view/end.md.nolink) | 番兵を取得する | C++20 | +| [`(constructor)`](basic_istream_view/op_constructor.md) | コンストラクタ | C++20 | +| [`begin`](basic_istream_view/begin.md) | ストリームから値を1つ読み、それを指すイテレータを取得する | C++20 | +| [`end`](basic_istream_view/end.md) | 番兵を取得する | C++20 | + +## 継承しているメンバ関数 + +| 名前 | 説明 | 対応バージョン | +|----------------------------------------------|------------------------------ ----|----------------| +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | + ## 例 ```cpp example diff --git a/reference/ranges/basic_istream_view/begin.md b/reference/ranges/basic_istream_view/begin.md new file mode 100644 index 0000000000..237814e8a5 --- /dev/null +++ b/reference/ranges/basic_istream_view/begin.md @@ -0,0 +1,56 @@ +# begin +* ranges[meta header] +* std::ranges[meta namespace] +* basic_istream_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr auto begin(); // (1) C++20 +``` + +## 概要 + +ストリームから値を1つ読み、それを指すイテレータを取得する。 + + +## 効果 +以下と等価: + +```cpp +*stream_ >> value_; +return iterator{*this}; +``` + + +## 例 + +```cpp example +#include +#include +#include + +int main() { + auto iss = std::istringstream{"1 2 3 4 5"}; + auto r = std::views::istream(iss); + auto it = r.begin(); + std::cout << *it << std::endl; +} +``` +* begin[color ff0000] + +### 出力 + +``` +1 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/basic_istream_view/end.md b/reference/ranges/basic_istream_view/end.md new file mode 100644 index 0000000000..be86e677fa --- /dev/null +++ b/reference/ranges/basic_istream_view/end.md @@ -0,0 +1,60 @@ +# end +* ranges[meta header] +* std::ranges[meta namespace] +* basic_istream_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr default_sentinel_t end() const noexcept; // (1) C++20 +``` + +## 概要 + +番兵を取得する。 + + +## 戻り値 +以下と等価: + +```cpp +return default_sentinel; +``` + + +## 例 + +```cpp example +#include +#include +#include + +int main() { + auto iss = std::istringstream{"1 2 3 4 5"}; + auto r = std::views::istream(iss); + auto it = r.begin(); + auto last = r.end(); + + for (; it != last; ++it) { + std::cout << *it << ' '; + } +} +``` +* end[color ff0000] +* begin()[link begin.md] + +### 出力 + +``` +1 2 3 4 5 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/basic_istream_view/op_constructor.md b/reference/ranges/basic_istream_view/op_constructor.md new file mode 100644 index 0000000000..c37f9b480d --- /dev/null +++ b/reference/ranges/basic_istream_view/op_constructor.md @@ -0,0 +1,52 @@ +# コンストラクタ +* ranges[meta header] +* std::ranges[meta namespace] +* basic_istream_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr explicit + basic_istream_view(basic_istream& stream); // (1) C++20 +``` + +## 概要 +[`basic_istream_view`](../basic_istream_view.md)オブジェクトを構築する。 + +- (1) : [`basic_istream`](/reference/istream/basic_istream.md)の参照を受け取るコンストラクタ + + +## 効果 + +- (1) : [`addressof`](/reference/memory/addressof.md)`(stream)`をメンバ変数`stream_`に保持する + + +## 例 +```cpp example +#include +#include +#include + +int main() { + auto iss = std::istringstream{"1 2 3 4 5"}; + + for (int i : std::views::istream(iss)) { + std::cout << i; + } +} +``` + +### 出力 +``` +12345 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] From d9e860a139bd1ecbe5ba1b1cbe691d6637042a3b Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 30 May 2025 13:42:02 +0900 Subject: [PATCH 1810/3948] =?UTF-8?q?ref=5Fview=20:=20=E3=83=A1=E3=83=B3?= =?UTF-8?q?=E3=83=90=E9=96=A2=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 1 + reference/ranges/ref_view.md | 24 +++---- reference/ranges/ref_view/base.md | 54 +++++++++++++++ reference/ranges/ref_view/begin.md | 57 ++++++++++++++++ reference/ranges/ref_view/data.md | 61 +++++++++++++++++ reference/ranges/ref_view/empty.md | 60 ++++++++++++++++ reference/ranges/ref_view/end.md | 60 ++++++++++++++++ reference/ranges/ref_view/op_constructor.md | 68 +++++++++++++++++++ .../ranges/ref_view/op_deduction_guide.md | 49 +++++++++++++ reference/ranges/ref_view/size.md | 59 ++++++++++++++++ 10 files changed, 481 insertions(+), 12 deletions(-) create mode 100644 reference/ranges/ref_view/base.md create mode 100644 reference/ranges/ref_view/begin.md create mode 100644 reference/ranges/ref_view/data.md create mode 100644 reference/ranges/ref_view/empty.md create mode 100644 reference/ranges/ref_view/end.md create mode 100644 reference/ranges/ref_view/op_constructor.md create mode 100644 reference/ranges/ref_view/op_deduction_guide.md create mode 100644 reference/ranges/ref_view/size.md diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 7cc87f849c..eb829e58fe 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -78,6 +78,7 @@ * [link /reference/concepts.md] * common_reference_with[link /reference/concepts/common_reference_with.md] * common_with[link /reference/concepts/common_with.md] + * convertible_to[link /reference/concepts/convertible_to.md] * copy_constructible[link /reference/concepts/copy_constructible.md] * default_initializable[link /reference/concepts/default_initializable.md] * equality_comparable[link /reference/concepts/equality_comparable.md] diff --git a/reference/ranges/ref_view.md b/reference/ranges/ref_view.md index 9d9341dab1..73c0212b16 100644 --- a/reference/ranges/ref_view.md +++ b/reference/ranges/ref_view.md @@ -29,15 +29,15 @@ Rangeへの参照として振る舞う[`view`](view.md)。このクラスのオ ## メンバ関数 -| 名前 | 説明 | 対応バージョン | -|--------------------------------------------------|-----------------------------------|----------------| -| [`(constructor)`](ref_view/op_constructor.md.nolink) | コンストラクタ | C++20 | -| [`base`](ref_view/base.md.nolink) | `R`の参照を取得する | C++20 | -| [`begin`](ref_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++20 | -| [`end`](ref_view/end.md.nolink) | 番兵を取得する | C++20 | -| [`empty`](ref_view/empty.md.nolink) | Rangeが空かどうかを判定する | C++20 | -| [`size`](ref_view/size.md.nolink) | 要素数を取得する | C++20 | -| [`data`](ref_view/data.md.nolink) | Rangeの先頭へのポインタを取得する | C++20 | +| 名前 | 説明 | 対応バージョン | +|------------------------------------------------|-----------------------------------|----------------| +| [`(constructor)`](ref_view/op_constructor.md) | コンストラクタ | C++20 | +| [`base`](ref_view/base.md) | 元となるRangeへの参照を取得する | C++20 | +| [`begin`](ref_view/begin.md) | 先頭を指すイテレータを取得する | C++20 | +| [`end`](ref_view/end.md) | 番兵を取得する | C++20 | +| [`empty`](ref_view/empty.md) | Rangeが空かどうかを判定する | C++20 | +| [`size`](ref_view/size.md) | 要素数を取得する | C++20 | +| [`data`](ref_view/data.md) | Rangeの先頭へのポインタを取得する | C++20 | `r`を参照先のRangeとする。`empty`、`size`、`data`は、それぞれ[`ranges::empty`](empty.md)`(r)`、[`ranges::size`](size.md)`(r)`、[`ranges::data`](data.md)`(r)`が有効な式であるときに定義される。 @@ -49,14 +49,14 @@ Rangeへの参照として振る舞う[`view`](view.md)。このクラスのオ | [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | | [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | | [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | -| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | -| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | ## 推論補助 | 名前 | 説明 | 対応バージョン | |-------------------------------------------------------|------------------------------|----------------| -| [`(deduction_guide)`](ref_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++20 | +| [`(deduction_guide)`](ref_view/op_deduction_guide.md) | クラステンプレートの推論補助 | C++20 | ## 例 ```cpp example diff --git a/reference/ranges/ref_view/base.md b/reference/ranges/ref_view/base.md new file mode 100644 index 0000000000..b35f657d6a --- /dev/null +++ b/reference/ranges/ref_view/base.md @@ -0,0 +1,54 @@ +# base +* ranges[meta header] +* std::ranges[meta namespace] +* ref_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr R& base() const; // (1) C++20 +``` + +## 概要 +元となるRangeへの参照を取得する。 + + +## 戻り値 + +メンバ変数`r_`として保持しているRangeへのポインタがあるとして、以下を返す: + +```cpp +return *r_; +``` + + +## 例 +```cpp +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3}; + auto r = std::ranges::ref_view(v); + auto& base = r.base(); + + assert(&base == &v); +} +``` +* base()[color ff0000] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/ref_view/begin.md b/reference/ranges/ref_view/begin.md new file mode 100644 index 0000000000..dab222e137 --- /dev/null +++ b/reference/ranges/ref_view/begin.md @@ -0,0 +1,57 @@ +# begin +* ranges[meta header] +* std::ranges[meta namespace] +* ref_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr iterator_t begin() const; // (1) C++20 +``` + +## 概要 +`view`の先頭要素を指すイテレータを取得する。 + +## 戻り値 +メンバ変数`r_`として保持しているRangeへのポインタがあるとして、以下を返す: + +```cpp +return ranges::begin(*r_); +``` +* ranges::begin[link /reference/ranges/begin.md] + + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3}; + auto r = std::ranges::ref_view(v); + auto it = r.begin(); + auto end = r.end(); + + while (it != end) { + std::cout << *it << ' '; + ++it; +} +``` +* begin[color ff0000] +* end()[link end.md] + +### 出力 +``` +1 2 3 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/ref_view/data.md b/reference/ranges/ref_view/data.md new file mode 100644 index 0000000000..d1213ae615 --- /dev/null +++ b/reference/ranges/ref_view/data.md @@ -0,0 +1,61 @@ +# data +* ranges[meta header] +* std::ranges[meta namespace] +* ref_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr auto data() const + requires contiguous_range; // (1) C++20 +``` + +## 概要 +Rangeの先頭へのポインタを取得する。 + + +## テンプレートパラメータ制約 +- 型`R`が[`contiguous_range`](/reference/ranges/contiguous_range.md)であること。 + + +## 戻り値 + +メンバ変数`r_`として保持しているRangeへのポインタがあるとして、以下を返す: + +```cpp +return ranges::data(*r_); +``` +* ranges::data[link /reference/ranges/data.md] + + +## 例 +```cpp +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3}; + auto r = std::ranges::ref_view(v); + + int* p = r.data(); + assert(p == v.data()); +} +``` +* r.data[color ff0000] +* v.data()[link /reference/vector/vector/data.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/ref_view/empty.md b/reference/ranges/ref_view/empty.md new file mode 100644 index 0000000000..d848628d86 --- /dev/null +++ b/reference/ranges/ref_view/empty.md @@ -0,0 +1,60 @@ +# empty +* ranges[meta header] +* std::ranges[meta namespace] +* ref_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr bool empty() const + requires requires { ranges::empty(*r_); }; // (1) C++20 +``` +* ranges::empty[link /reference/ranges/empty.md] + +## 概要 +Rangeが空かどうかを判定する。 + + +## テンプレートパラメータ制約 +- [`ranges::empty`](/reference/ranges/empty.md)`(*r_)`が有効な式であること + + +## 戻り値 + +メンバ変数`r_`として保持しているRangeへのポインタがあるとして、以下を返す: + +```cpp +return ranges::empty(*r_); +``` +* ranges::empty[link /reference/ranges/empty.md] + + +## 例 +```cpp +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3}; + auto r = std::ranges::ref_view(v); + std::cout << r.empty() << std::endl; +} +``` +* empty[color ff0000] + +### 出力 +``` +0 +``` + + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/ref_view/end.md b/reference/ranges/ref_view/end.md new file mode 100644 index 0000000000..4256efda32 --- /dev/null +++ b/reference/ranges/ref_view/end.md @@ -0,0 +1,60 @@ +# end +* ranges[meta header] +* std::ranges[meta namespace] +* ref_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr sentinel_t end() const; // (1) C++20 +``` + +## 概要 + +番兵を取得する。 + + +## 戻り値 +メンバ変数`r_`として保持しているRangeへのポインタがあるとして、以下を返す: + +```cpp +ranges::end(*r_); +``` +* ranges::end[link /reference/ranges/end.md] + + + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3}; + auto r = std::ranges::ref_view(v); + auto it = r.begin(); + auto end = r.end(); + + while (it != end) { + std::cout << *it << ' '; + ++it; +} +``` +* end[color ff0000] +* begin()[link begin.md] + +### 出力 +``` +1 2 3 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/ref_view/op_constructor.md b/reference/ranges/ref_view/op_constructor.md new file mode 100644 index 0000000000..2c028299ed --- /dev/null +++ b/reference/ranges/ref_view/op_constructor.md @@ -0,0 +1,68 @@ +# コンストラクタ +* ranges[meta header] +* std::ranges[meta namespace] +* ref_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +template T> + requires 以下参照 +constexpr + ref_view(T&& t); // (1) C++20 +``` + +## 概要 +[`ref_view`](../ref_view.md)オブジェクトを構築する。 + +- (1) : `t`へのポインタを`*this`に保持する + + +## 効果 +- (1) : メンバ変数`r_`を[`addressof`](/reference/memory/addressof.md)`(static_cast(`[`std::forward`](/reference/utility/forward.md)`(t)))`で初期化する + + +## 備考 +- (1) : 説明専用の関数`FUN`を以下のように定義する: + ```cpp + void FUN(R&); + void FUN(R&&) = delete; + ``` + + - requires節は、以下と等価になる: + + ```cpp + convertible_to && requires { FUN(declval()); } + ``` + + - これはつまり、このコンストラクタには一時オブジェクトは渡せないことを意味する + + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3}; + for (int x : std::ranges::ref_view(v)) { + std::cout << x << ' '; + } +} +``` + +### 出力 +``` +1 2 3 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/ref_view/op_deduction_guide.md b/reference/ranges/ref_view/op_deduction_guide.md new file mode 100644 index 0000000000..a9e8c0995a --- /dev/null +++ b/reference/ranges/ref_view/op_deduction_guide.md @@ -0,0 +1,49 @@ +# 推論補助 +* ranges[meta header] +* std::ranges[meta namespace] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +namespace std::ranges { + template + ref_view(R&) -> ref_view; +} +``` + +## 概要 + +[`ref_view`](../ref_view.md)クラステンプレートの型推論補助。 + + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3}; + auto r = std::ranges::ref_view(v); + for (int x : r) { + std::cout << x << std::endl; + } +} +``` + +### 出力 +``` +1 +2 +3 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/ref_view/size.md b/reference/ranges/ref_view/size.md new file mode 100644 index 0000000000..62dd20500c --- /dev/null +++ b/reference/ranges/ref_view/size.md @@ -0,0 +1,59 @@ +# size +* ranges[meta header] +* std::ranges[meta namespace] +* ref_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr auto size() const + requires sized_range; // (1) C++20 +``` + +## 概要 +要素数を取得する。 + + +## テンプレートパラメータ制約 +- 型`R`が[`sized_range`](/reference/ranges/sized_range.md)であること。 + + +## 戻り値 + +メンバ変数`r_`として保持しているRangeへのポインタがあるとして、以下を返す: + +```cpp +return ranges::size(*r_); +``` +* ranges::size[link /reference/ranges/size.md] + + +## 例 +```cpp +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3}; + auto r = std::ranges::ref_view(v); + std::cout << r.size() << std::endl; +} +``` +* size[color ff0000] + +### 出力 +``` +3 +``` + + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] From 515f73141a9de4600b098df7934924b728afd5f9 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 30 May 2025 13:47:44 +0900 Subject: [PATCH 1811/3948] =?UTF-8?q?as=5Frvalue=5Fview=20:=20=E3=82=B0?= =?UTF-8?q?=E3=83=AD=E3=83=BC=E3=83=90=E3=83=AB=E4=BF=AE=E9=A3=BE=E3=81=8C?= =?UTF-8?q?=E5=8A=B9=E3=81=8F=E3=82=88=E3=81=86=E3=81=ABstd::=E3=82=92?= =?UTF-8?q?=E3=81=A4=E3=81=91=E3=81=9F=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/as_rvalue_view.md | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/reference/ranges/as_rvalue_view.md b/reference/ranges/as_rvalue_view.md index 68f163a31a..c8b41aee1c 100644 --- a/reference/ranges/as_rvalue_view.md +++ b/reference/ranges/as_rvalue_view.md @@ -27,10 +27,11 @@ namespace std::ranges { この[`view`](view.md)は、あるRangeの要素をムーブして別のコンテナに挿入する場合などに利用できる。 ```cpp -vector words = {"the", "quick", "brown", "fox", "ate", "a", "pterodactyl"}; -vector new_words; -ranges::copy(words | views::as_rvalue, back_inserter(new_words)); +std::vector words = {"the", "quick", "brown", "fox", "ate", "a", "pterodactyl"}; +std::vector new_words; +std::ranges::copy(words | views::as_rvalue, std::back_inserter(new_words)); ``` +* std::ranges::copy[link /reference/algorithm/ranges_copy.md] ### Rangeコンセプト @@ -88,19 +89,17 @@ ranges::copy(words | views::as_rvalue, back_inserter(new_words)); #include #include #include +#include #include int main() { - using namespace std; - - vector words = {"the", "quick", "brown", "fox", "ate", "a", "pterodactyl"}; - vector new_words; - ranges::copy(words | views::as_rvalue, back_inserter(new_words)); - print("{}", new_words); + std::vector words = {"the", "quick", "brown", "fox", "ate", "a", "pterodactyl"}; + std::vector new_words; + std::ranges::copy(words | std::views::as_rvalue, std::back_inserter(new_words)); + std::println("{}", new_words); } ``` -* views::as_rvalue[color ff0000] -* print[link /reference/print/print.md] +* std::views::as_rvalue[color ff0000] ### 出力 ``` From fea94ab824d364752eda41e3ead0e9ca70629418 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 30 May 2025 14:32:30 +0900 Subject: [PATCH 1812/3948] =?UTF-8?q?as=5Frvalue=5Fview=20:=20=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=90=E9=96=A2=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 2 + reference/ranges/as_rvalue_view.md | 37 +++++----- reference/ranges/as_rvalue_view/base.md | 73 +++++++++++++++++++ reference/ranges/as_rvalue_view/begin.md | 65 +++++++++++++++++ reference/ranges/as_rvalue_view/end.md | 72 ++++++++++++++++++ .../ranges/as_rvalue_view/op_constructor.md | 60 +++++++++++++++ .../as_rvalue_view/op_deduction_guide.md | 49 +++++++++++++ reference/ranges/as_rvalue_view/size.md | 58 +++++++++++++++ 8 files changed, 397 insertions(+), 19 deletions(-) create mode 100644 reference/ranges/as_rvalue_view/base.md create mode 100644 reference/ranges/as_rvalue_view/begin.md create mode 100644 reference/ranges/as_rvalue_view/end.md create mode 100644 reference/ranges/as_rvalue_view/op_constructor.md create mode 100644 reference/ranges/as_rvalue_view/op_deduction_guide.md create mode 100644 reference/ranges/as_rvalue_view/size.md diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index eb829e58fe..bbe3559d62 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -168,6 +168,8 @@ * std::begin[link /reference/iterator/begin.md] * std::distance[link /reference/iterator/distance.md] * std::end[link /reference/iterator/end.md] + * std::move_iterator[link /reference/iterator/move_iterator.md] + * std::move_sentinel[link /reference/iterator/move_sentinel.md] * std::next[link /reference/iterator/next.md] * std::ostream_iterator[link /reference/iterator/ostream_iterator.md] * unreachable_sentinel_t[link /reference/iterator/unreachable_sentinel_t.md] diff --git a/reference/ranges/as_rvalue_view.md b/reference/ranges/as_rvalue_view.md index c8b41aee1c..70c3f3adda 100644 --- a/reference/ranges/as_rvalue_view.md +++ b/reference/ranges/as_rvalue_view.md @@ -55,13 +55,13 @@ std::ranges::copy(words | views::as_rvalue, std::back_inserter(new_words)); ## メンバ関数 -| 名前 | 説明 | 対応バージョン | -|--------------------------------------------------|-----------------------------------|----------------| -| [`(constructor)`](as_rvalue_view/op_constructor.md.nolink) | コンストラクタ | C++20 | -| [`base`](as_rvalue_view/base.md.nolink) | `R`の参照を取得する | C++20 | -| [`begin`](as_rvalue_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++20 | -| [`end`](as_rvalue_view/end.md.nolink) | 番兵を取得する | C++20 | -| [`size`](as_rvalue_view/size.md.nolink) | 要素数を取得する | C++20 | +| 名前 | 説明 | 対応バージョン | +|-----------------------------------------------------|--------------------------------|----------------| +| [`(constructor)`](as_rvalue_view/op_constructor.md) | コンストラクタ | C++23 | +| [`base`](as_rvalue_view/base.md) | 元となるRangeを取得する | C++23 | +| [`begin`](as_rvalue_view/begin.md) | 先頭を指すイテレータを取得する | C++23 | +| [`end`](as_rvalue_view/end.md) | 番兵を取得する | C++23 | +| [`size`](as_rvalue_view/size.md) | 要素数を取得する | C++23 | `r`を参照先のRangeとする。`size`は、[`ranges::size`](size.md)`(r)`が有効な式であるときに定義される。 @@ -69,12 +69,12 @@ std::ranges::copy(words | views::as_rvalue, std::back_inserter(new_words)); | 名前 | 説明 | 対応バージョン | |----------------------------------------------|-----------------------------------|----------------| -| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++20 | -| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++20 | -| [`data`](view_interface/data.md) | Rangeの先頭へのポインタを取得する | C++20 | -| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | -| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | -| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | +| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++23 | +| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++23 | +| [`data`](view_interface/data.md) | Rangeの先頭へのポインタを取得する | C++23 | +| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++23 | +| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++23 | +| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++23 | | [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | | [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | @@ -82,7 +82,7 @@ std::ranges::copy(words | views::as_rvalue, std::back_inserter(new_words)); | 名前 | 説明 | 対応バージョン | |-------------------------------------------------------|------------------------------|----------------| -| [`(deduction_guide)`](as_rvalue_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++20 | +| [`(deduction_guide)`](as_rvalue_view/op_deduction_guide.md) | クラステンプレートの推論補助 | C++23 | ## 例 ```cpp example @@ -173,10 +173,9 @@ constexpr explicit as_rvalue_view(V base); - C++23 ### 処理系 -- [Clang](/implementation.md#clang): ? -- [GCC](/implementation.md#gcc): ? -- [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): ? +- [Clang](/implementation.md#clang): 17 [mark verified] +- [GCC](/implementation.md#gcc): 13 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 4 [mark verified] ## 参照 -- [N4950 26 Ranges library](https://timsong-cpp.github.io/cppwp/n4950/ranges) +- [P2446R2 `views::as_rvalue`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2446r2.html) diff --git a/reference/ranges/as_rvalue_view/base.md b/reference/ranges/as_rvalue_view/base.md new file mode 100644 index 0000000000..17106ff0e6 --- /dev/null +++ b/reference/ranges/as_rvalue_view/base.md @@ -0,0 +1,73 @@ +# base +* ranges[meta header] +* std::ranges[meta namespace] +* as_rvalue_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr V base() const & + requires copy_constructible; // (1) C++23 + +constexpr V base() &&; // (2) C++23 +``` + +## 概要 +元となるRangeを取得する。 + +- (1) : 元となるRangeをコピーして返す +- (2) : 元となるRangeをムーブして返す + + +## 戻り値 + +メンバ変数`base_`として保持している、元となるRangeオブジェクトがあるとして、以下を返す: + +- (1) : + ```cpp + return base_; + ``` + +- (2) : + ```cpp + return std::move(base_); + ``` + * std::move[link /reference/utility/move.md] + + +## 備考 +- ここで、`V`は[`std::ranges::ref_view`](../ref_view.md)であり、元となるRangeは`view`に変換されている。 + + +## 例 +```cpp +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3}; + auto r = std::views::as_rvalue(v); + std::ranges::ref_view> base = r.base(); + + assert(&base.base() == &v); +} +``` +* r.base()[color ff0000] +* std::ranges::ref_view[link /reference/ranges/ref_view.md] +* base.base()[link /reference/ranges/ref_view/base.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 17 [mark verified] +- [GCC](/implementation.md#gcc): 13 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 4 [mark verified] diff --git a/reference/ranges/as_rvalue_view/begin.md b/reference/ranges/as_rvalue_view/begin.md new file mode 100644 index 0000000000..1c20185184 --- /dev/null +++ b/reference/ranges/as_rvalue_view/begin.md @@ -0,0 +1,65 @@ +# begin +* ranges[meta header] +* std::ranges[meta namespace] +* as_rvalue_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr auto begin() + requires (!simple-view ); // (1) C++23 + +constexpr auto begin() const + requires range; // (2) C++23 +``` + +## 概要 +`view`の先頭要素を指すイテレータを取得する。 + +## 戻り値 +メンバ変数`base_`として保持しているRangeへのポインタがあるとして、以下を返す: + +```cpp +return std::move_iterator(ranges::begin(*base_)); +``` +* ranges::begin[link /reference/ranges/begin.md] + + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {"one", "two", "three"}; + auto r = std::ranges::as_rvalue_view(v); + auto it = r.begin(); + auto end = r.end(); + + while (it != end) { + std::string x = *it; // ここでムーブされる + std::cout << x << std::endl; + ++it; + } +} +``` +* begin[color ff0000] +* end()[link end.md] + +### 出力 +``` +one +two +three +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 17 [mark verified] +- [GCC](/implementation.md#gcc): 13 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 4 [mark verified] diff --git a/reference/ranges/as_rvalue_view/end.md b/reference/ranges/as_rvalue_view/end.md new file mode 100644 index 0000000000..272f11f159 --- /dev/null +++ b/reference/ranges/as_rvalue_view/end.md @@ -0,0 +1,72 @@ +# end +* ranges[meta header] +* std::ranges[meta namespace] +* as_rvalue_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr auto end() + requires (!simple-view ); // (1) C++23 + +constexpr auto end() const + requires range; // (2) C++23 +``` + +## 概要 + +番兵を取得する。 + + +## 戻り値 +メンバ変数`r_`として保持しているRangeへのポインタがあるとして、以下を返す: + +```cpp +if constexpr (common_range) { + return std::move_iterator(ranges::end(base_)); +} +else { + return std::move_sentinel(ranges::end(base_)); +} +``` +* ranges::end[link /reference/ranges/end.md] + + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {"one", "two", "three"}; + auto r = std::ranges::as_rvalue_view(v); + auto it = r.begin(); + auto end = r.end(); + + while (it != end) { + std::string x = *it; // ここでムーブされる + std::cout << x << std::endl; + ++it; + } +} +``` +* begin[color ff0000] +* end()[link end.md] + +### 出力 +``` +one +two +three +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 17 [mark verified] +- [GCC](/implementation.md#gcc): 13 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 4 [mark verified] diff --git a/reference/ranges/as_rvalue_view/op_constructor.md b/reference/ranges/as_rvalue_view/op_constructor.md new file mode 100644 index 0000000000..86646f0c4f --- /dev/null +++ b/reference/ranges/as_rvalue_view/op_constructor.md @@ -0,0 +1,60 @@ +# コンストラクタ +* ranges[meta header] +* std::ranges[meta namespace] +* as_rvalue_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +as_rvalue_view() + requires default_initializable = default; // (1) C++23 + +constexpr explicit + as_rvalue_view(V base); // (2) C++23 +``` + +## 概要 +[`as_rvalue_view`](../as_rvalue_view.md)オブジェクトを構築する。 + +- (1) : `base`をムーブして`*this`に保持する + + +## 効果 +- (1) : メンバ変数`base_`を[`std::move`](/reference/utility/move.md)`(base)`で初期化する + + +## 備考 +- ここで、`V`は[`std::ranges::ref_view`](../ref_view.md)であり、元となるRangeは`view`に変換されて保持される。 + + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3}; + std::ranges::for_each( + std::views::as_rvalue(v), + [](int x) { std::cout << x << ' '; } + ); +} +``` +* std::ranges::for_each[link /reference/algorithm/ranges_for_each.md] + +### 出力 +``` +1 2 3 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 17 [mark verified] +- [GCC](/implementation.md#gcc): 13 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 4 [mark verified] diff --git a/reference/ranges/as_rvalue_view/op_deduction_guide.md b/reference/ranges/as_rvalue_view/op_deduction_guide.md new file mode 100644 index 0000000000..e4d214ff67 --- /dev/null +++ b/reference/ranges/as_rvalue_view/op_deduction_guide.md @@ -0,0 +1,49 @@ +# 推論補助 +* ranges[meta header] +* std::ranges[meta namespace] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template + as_rvalue_view(R&&) -> as_rvalue_view>; +} +``` + +## 概要 + +[`as_rvalue_view`](../as_rvalue_view.md)クラステンプレートの型推論補助。 + + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3}; + auto r = std::ranges::as_rvalue_view(v); + for (int x : r) { + std::cout << x << std::endl; + } +} +``` + +### 出力 +``` +1 +2 +3 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 17 [mark verified] +- [GCC](/implementation.md#gcc): 13 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 4 [mark verified] diff --git a/reference/ranges/as_rvalue_view/size.md b/reference/ranges/as_rvalue_view/size.md new file mode 100644 index 0000000000..657d05de96 --- /dev/null +++ b/reference/ranges/as_rvalue_view/size.md @@ -0,0 +1,58 @@ +# size +* ranges[meta header] +* std::ranges[meta namespace] +* as_rvalue_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr auto size() + requires sized_range; // (1) C++23 + +constexpr auto size() const + requires sized_range; // (2) C++23 +``` + +## 概要 +要素数を取得する。 + + +## 戻り値 + +メンバ変数`base_`として保持しているRangeへのポインタがあるとして、以下を返す: + +```cpp +return ranges::size(base_); +``` +* ranges::size[link /reference/ranges/size.md] + + +## 例 +```cpp +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3}; + auto r = std::ranges::as_rvalue_view(v); + std::cout << r.size() << std::endl; +} +``` +* size[color ff0000] + +### 出力 +``` +3 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 17 [mark verified] +- [GCC](/implementation.md#gcc): 13 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 4 [mark verified] From fce3c6abf9f880e8ca54fd97a1eb8f8dc35eec09 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 30 May 2025 15:46:06 +0900 Subject: [PATCH 1813/3948] =?UTF-8?q?filter=5Fview=E3=81=AE=E3=82=B3?= =?UTF-8?q?=E3=83=B3=E3=82=B9=E3=83=88=E3=83=A9=E3=82=AF=E3=82=BF=20:=20?= =?UTF-8?q?=E6=94=B9=E8=A1=8C=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/filter_view/op_constructor.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/reference/ranges/filter_view/op_constructor.md b/reference/ranges/filter_view/op_constructor.md index f3c4002a54..a3441e273c 100644 --- a/reference/ranges/filter_view/op_constructor.md +++ b/reference/ranges/filter_view/op_constructor.md @@ -6,9 +6,12 @@ * cpp20[meta cpp] ```cpp -filter_view() requires default_initializable && default_initializable = default; // (1) +filter_view() + requires default_initializable && + default_initializable = default; // (1) C++20 -constexpr explicit filter_view(V base, Pred pred); // (2) +constexpr explicit + filter_view(V base, Pred pred); // (2) C++20 ``` ## 概要 From 8b6a865c87955b2ae276e89362e95dcb6b8940de Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 30 May 2025 15:54:00 +0900 Subject: [PATCH 1814/3948] =?UTF-8?q?filter=5Fview::base=20:=20=E7=AD=89?= =?UTF-8?q?=E3=81=97=E3=81=84=20=E2=86=92=20=E7=AD=89=E4=BE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/filter_view/base.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/ranges/filter_view/base.md b/reference/ranges/filter_view/base.md index d9f3dac03a..f654974392 100644 --- a/reference/ranges/filter_view/base.md +++ b/reference/ranges/filter_view/base.md @@ -18,8 +18,8 @@ constexpr V base() &&; // (2) 入力`view`(`V`)のオブジェクトを`base_`というメンバに保持するとして -- (1) : `return base_;` と等しい -- (2) : `return std::move(base_);` と等しい +- (1) : `return base_;` と等価 +- (2) : `return std::move(base_);` と等価 ## 例 From a6d6258134dcbcbee4bbec9658d3edcfe772961c Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 30 May 2025 17:05:25 +0900 Subject: [PATCH 1815/3948] execution: with_awaitable_senders (#1384) single-sender-value-type --- reference/execution/execution.md | 2 +- reference/execution/execution/read_env.md | 2 +- .../execution/sender_adaptor_closure.md | 1 + .../execution/single-sender-value-type.md | 35 ++++ .../execution/stopped_as_optional.md | 4 +- .../execution/with_awaitable_senders.md | 183 ++++++++++++++++++ .../with_awaitable_senders/await_transform.md | 45 +++++ .../set_continuation.md | 58 ++++++ 8 files changed, 326 insertions(+), 4 deletions(-) create mode 100644 reference/execution/execution/single-sender-value-type.md create mode 100644 reference/execution/execution/with_awaitable_senders.md create mode 100644 reference/execution/execution/with_awaitable_senders/await_transform.md create mode 100644 reference/execution/execution/with_awaitable_senders/set_continuation.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 16b4448d75..e596e690b7 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -152,7 +152,7 @@ Senderコンシューマは名前空間 `std::this_thread` で定義される。 | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`execution::as_awaitable`](execution/as_awaitable.md.nolink) | Senderを[Awaitable型](/lang/cpp20/coroutines.md)へ変換 (customization point object) | C++26 | -| [`execution::with_awaitable_senders`](execution/with_awaitable_senders.md.nolink) | [Promise型](/lang/cpp20/coroutines.md)の基底クラス (class template) | C++26 | +| [`execution::with_awaitable_senders`](execution/with_awaitable_senders.md) | [Promise型](/lang/cpp20/coroutines.md)の基底クラス (class template) | C++26 | ## バージョン diff --git a/reference/execution/execution/read_env.md b/reference/execution/execution/read_env.md index 3675865892..e93d649f32 100644 --- a/reference/execution/execution/read_env.md +++ b/reference/execution/execution/read_env.md @@ -15,7 +15,7 @@ namespace std::execution { `read_env`は、非同期動作の[開始(start)](start.md)時に接続先[Receiver](receiver.md)の[環境](../queryable.md)に対して[クエリオブジェクト](../queryable.md)で問い合わせ、読み取った値を[値完了関数](set_value.md)で送信するSenderファクトリである。 クエリオブジェクトによるReceiver環境への問い合わせは`read_env`[Sender](sender.md)の構築時ではなく、Receiverと接続されたのち非同期動作が開始されるタイミングまで遅延される。 -[`let_value`](let_value.md)Senderアダプタと組み合わせたり、[Sender Awaitableなコルーチン](with_awaitable_senders.md.nolink)での`co_await`式によって、[Scheduler](get_scheduler.md)や[停止トークン](../get_stop_token.md)を読み取ることができる。 +[`let_value`](let_value.md)Senderアダプタと組み合わせたり、[Sender Awaitableなコルーチン](with_awaitable_senders.md)での`co_await`式によって、[Scheduler](get_scheduler.md)や[停止トークン](../get_stop_token.md)を読み取ることができる。 ## 効果 diff --git a/reference/execution/execution/sender_adaptor_closure.md b/reference/execution/execution/sender_adaptor_closure.md index e0b6ecaee4..d92530aef5 100644 --- a/reference/execution/execution/sender_adaptor_closure.md +++ b/reference/execution/execution/sender_adaptor_closure.md @@ -10,6 +10,7 @@ namespace std::execution { struct sender_adaptor_closure { }; } ``` +* class-type[link class-type.md.nolink] ## 概要 `sender_adaptor_closure`は、ユーザ定義のパイプ可能Senderアダプタクロージャオブジェクトの実装を補助するクラステンプレートである。 diff --git a/reference/execution/execution/single-sender-value-type.md b/reference/execution/execution/single-sender-value-type.md new file mode 100644 index 0000000000..9687b191d6 --- /dev/null +++ b/reference/execution/execution/single-sender-value-type.md @@ -0,0 +1,35 @@ +# single-sender-value-type +* execution[meta header] +* type-alias[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +template +using single-sender-value-type = see below; // exposition only +``` +* see below[italic] + +## 概要 +`single-sender-value-type`は、実行制御ライブラリの仕様定義で用いられる説明専用のエイリアステンプレートである。 + +型`Sndr`と`Env`に対して、`single-sender-value-type`は下記のエイリアスとなる。 + +- [`value_types_of_t`](value_types_of_t.md)``が適格であるならば、その型。 +- そうではなく、[`value_types_of_t`](value_types_of_t.md)``が`variant>`もしくは`variant<>`ならば、`void`型。 +- [`value_types_of_t`](value_types_of_t.md)``が適格であるならば、その型。 +- そうでなければ、`single-sender-value-type`は不適格。 + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`execution::stopped_as_optional`](stopped_as_optional.md) +- [`sender-awaitable`](sender-awaitable.md.nolink) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/stopped_as_optional.md b/reference/execution/execution/stopped_as_optional.md index 1f056d35ff..7cbab481f7 100644 --- a/reference/execution/execution/stopped_as_optional.md +++ b/reference/execution/execution/stopped_as_optional.md @@ -30,7 +30,7 @@ transform_sender(get-domain-early(sndr), make-sender(stopped_as_optional, {}, sn ### Senderアルゴリズムタグ `stopped_as_optional` -説明用の式`sndr`と`env`に対して、型`Sndr`を`decltype((sndr))`、型`Env`を`decltype((env))`とする。[`sender-for`](sender-for.md)` == false`、もしくは[`single-sender-value-type`](single-sender-value-type.md.nolink)``が不適格または`void`のとき、式`stopped_as_optional.transform_sender(sndr, env)`は不適格となる。 +説明用の式`sndr`と`env`に対して、型`Sndr`を`decltype((sndr))`、型`Env`を`decltype((env))`とする。[`sender-for`](sender-for.md)` == false`、もしくは[`single-sender-value-type`](single-sender-value-type.md)``が不適格または`void`のとき、式`stopped_as_optional.transform_sender(sndr, env)`は不適格となる。 そうでなければ、式`stopped_as_optional.transform_sender(sndr, env)`は下記と等価。 @@ -44,7 +44,7 @@ return let_stopped( }), []() noexcept { return just(optional()); }); ``` -* single-sender-value-type[link single-sender-value-type.md.nolink] +* single-sender-value-type[link single-sender-value-type.md] * let_stopped[link let_stopped.md.nolink] * then[link then.md] * just[link just.md] diff --git a/reference/execution/execution/with_awaitable_senders.md b/reference/execution/execution/with_awaitable_senders.md new file mode 100644 index 0000000000..429e09102d --- /dev/null +++ b/reference/execution/execution/with_awaitable_senders.md @@ -0,0 +1,183 @@ +# with_awaitable_senders +* execution[meta header] +* class template[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template + struct with_awaitable_senders { + template + requires (!same_as) + void set_continuation(coroutine_handle h) noexcept; + + coroutine_handle<> continuation() const noexcept { return continuation; } + + coroutine_handle<> unhandled_stopped() noexcept { + return stopped-handler(continuation.address()); + } + + template + see below await_transform(Value&& value); + + private: + [[noreturn]] static coroutine_handle<> + default-unhandled-stopped(void*) noexcept { // exposition only + terminate(); + } + + coroutine_handle<> continuation{}; // exposition only + coroutine_handle<> (*stopped-handler)(void*) noexcept = // exposition only + &default-unhandled-stopped; + }; +} +``` +* class-type[link class-type.md.nolink] +* terminate()[link /reference/exception/terminate.md] +* coroutine_handle[link /reference/coroutine/coroutine_handle.md] +* address()[link /reference/coroutine/coroutine_handle/address.md] +* see below[italic] + +## 概要 +`with_awaitable_senders`は、[コルーチンPromise型](/lang/cpp20/coroutines.md)の基底クラスとして利用することで、[Sender](sender.md)を`co_await`演算子でAwait可能とするクラステンプレートである。 + +また`unhandled_stopped`のデフォルト実装を提供し、Senderが[`set_stopped`](set_stopped.md)を呼び出して停止完了したとき、Await式からキャッチできない "停止" 例外が送出されたかのように取り扱う。 + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|-------| +| `(constructor)` | コンストラクタ | C++26 | +| `(destructor)` | デストラクタ | C++26 | +| [`set_continuation`](with_awaitable_senders/set_continuation.md) | 継続ハンドラを設定する | C++26 | +| `continuation` | 継続ハンドラを返す | C++26 | +| `unhandled_stopped` | 停止ハンドラを返す | C++26 | +| [`await_transform`](with_awaitable_senders/await_transform.md) | [`co_await`演算子](/lang/cpp20/coroutines.md)へアダプトしAwaitableオブジェクトを返す | C++26 | + + +## 静的メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|-------| +| `default-unhandled-stopped` | 説明専用のデフォルト停止ハンドラ | C++26 | + + +## 例 +```cpp example +#include +#include +#include +namespace ex = std::execution; + +template +class Lazy { +public: + struct promise_type; + using value_type = T; + using handle_type = std::coroutine_handle; + + struct promise_type : ex::with_awaitable_senders { + value_type value_; + auto get_return_object() { return Lazy{handle_type::from_promise(*this)}; } + auto initial_suspend() noexcept { return std::suspend_always{}; } + auto final_suspend() noexcept { return std::suspend_always{}; } + void unhandled_exception() { throw; } + void return_value(value_type v) noexcept { value_ = v; } + }; + +private: + Lazy(handle_type h) : coro_{h} {} + +public: + Lazy(Lazy&& rhs) + : coro_{std::exchange(rhs.coro_, nullptr)} {} + Lazy& operator=(Lazy&& rhs) { + if (coro_) { std::exchange(coro_, nullptr).destroy(); } + std::swap(rhs.coro_, coro_); + return *this; + } + ~Lazy() + { if (coro_) { coro_.destroy(); } } + + value_type get() { + assert(coro_); + if (!coro_.done()) { + coro_.resume(); + } + return coro_.promise().value_; + } + +private: + handle_type coro_; +}; + +// SenderをAwait可能なコルーチン +Lazy coro(int n) +{ + std::println("coro start"); + ex::sender auto sndr = + ex::just(n) + | ex::then([](int m){ return m * 3; }); + + // Senderを開始して値取得を待機 + int val = co_await sndr; + + std::println("coro end"); + co_return val * 7; +} + +int main() +{ + try { + auto task = coro(2); + std::println("get"); + auto value = task.get(); + std::println("value={}", value); + } catch (...) { + std::println(""); + } +} +``` +* ex::with_awaitable_senders[color ff0000] +* ex::sender[link sender.md] +* ex::just[link just.md] +* ex::then[link then.md] +* std::coroutine_handle[link /reference/coroutine/coroutine_handle.md] +* from_promise[link /reference/coroutine/coroutine_handle/from_promise.md] +* destroy()[link /reference/coroutine/coroutine_handle/destroy.md] +* done()[link /reference/coroutine/coroutine_handle/done.md] +* resume()[link /reference/coroutine/coroutine_handle/resume.md] +* promise()[link /reference/coroutine/coroutine_handle/promise.md] +* std::suspend_always[link /reference/coroutine/suspend_always.md] + +### 出力 +``` +get +coro start +coro end +value=42 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::​as_awaitable`](​as_awaitable.md.nolink) +- [コルーチン](/lang/cpp20/coroutines.md) + + +## 参照 +- [P3325R5 A Utility for Creating Execution Environments](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3325r5.html) + + diff --git a/reference/execution/execution/with_awaitable_senders/await_transform.md b/reference/execution/execution/with_awaitable_senders/await_transform.md new file mode 100644 index 0000000000..4127777e57 --- /dev/null +++ b/reference/execution/execution/with_awaitable_senders/await_transform.md @@ -0,0 +1,45 @@ +# await_transform +* execution[meta header] +* function template[meta id-type] +* std::execution[meta namespace] +* with_awaitable_senders[meta class] +* cpp26[meta cpp] + +```cpp +template +call-result-t + await_transform(Value&& value); +``` +* call-result-t[link /reference/functional/call-result-t.md] +* as_awaitable_t[link ../as_awaitable.md.nolink] + +## 概要 +コルーチンの[`co_await`演算子](/lang/cpp20/coroutines.md)にアダプトし、[`as_awaitable`](../as_awaitable.md.nolink)で変換したAwaitableオブジェクトを返す。 + + +## 効果 +下記と等価。 + +```cpp +return as_awaitable(std::forward(value), static_cast(*this)); +``` +* as_awaitable[link ../as_awaitable.md.nolink] + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::as_awaitable`](../as_awaitable.md.nolink) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/with_awaitable_senders/set_continuation.md b/reference/execution/execution/with_awaitable_senders/set_continuation.md new file mode 100644 index 0000000000..e52034c951 --- /dev/null +++ b/reference/execution/execution/with_awaitable_senders/set_continuation.md @@ -0,0 +1,58 @@ +# set_continuation +* execution[meta header] +* function template[meta id-type] +* std::execution[meta namespace] +* with_awaitable_senders[meta class] +* cpp26[meta cpp] + +```cpp +template + requires (!same_as) +void set_continuation(coroutine_handle h) noexcept; +``` +* coroutine_handle[link /reference/coroutine/coroutine_handle.md] + +## 概要 +継続処理のコルーチンハンドルを設定する。 + + +## テンプレートパラメータ制約 +`!`[`same_as`](/reference/concepts/same_as.md)`` + + +## 効果 +下記と等価。 + +```cpp +continuation = h; +if constexpr ( requires(OtherPromise& other) { other.unhandled_stopped(); } ) { + stopped-handler = [](void* p) noexcept -> coroutine_handle<> { + return coroutine_handle::from_address(p) + .promise().unhandled_stopped(); + }; +} else { + stopped-handler = &default-unhandled-stopped; +} +``` +* coroutine_handle[link /reference/coroutine/coroutine_handle.md] +* from_address[link /reference/coroutine/coroutine_handle/from_address.md] +* promise()[link /reference/coroutine/coroutine_handle/promise.md] + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) From a1eaff0ecb6591461ea27f6eb861a47fdb57d1d9 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 30 May 2025 17:17:23 +0900 Subject: [PATCH 1816/3948] execution/with_awaitable_senders: remove forbid chars --- reference/execution/execution/with_awaitable_senders.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/execution/execution/with_awaitable_senders.md b/reference/execution/execution/with_awaitable_senders.md index 429e09102d..ec76e23adb 100644 --- a/reference/execution/execution/with_awaitable_senders.md +++ b/reference/execution/execution/with_awaitable_senders.md @@ -173,7 +173,7 @@ value=42 ## 関連項目 -- [`execution::​as_awaitable`](​as_awaitable.md.nolink) +- [`execution::as_awaitable`](as_awaitable.md.nolink) - [コルーチン](/lang/cpp20/coroutines.md) From 15c75ce0fc2fa8826cd2141d350b3ac22188975c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 30 May 2025 17:25:09 +0900 Subject: [PATCH 1817/3948] =?UTF-8?q?transform=5Fview=20:=20=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=90=E9=96=A2=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 5 + reference/ranges/transform_view.md | 30 +++--- reference/ranges/transform_view/base.md | 67 +++++++++++++ reference/ranges/transform_view/begin.md | 70 +++++++++++++ reference/ranges/transform_view/end.md | 97 +++++++++++++++++++ .../ranges/transform_view/op_constructor.md | 64 ++++++++++++ .../transform_view/op_deduction_guide.md | 56 +++++++++++ reference/ranges/transform_view/size.md | 58 +++++++++++ 8 files changed, 432 insertions(+), 15 deletions(-) create mode 100644 reference/ranges/transform_view/base.md create mode 100644 reference/ranges/transform_view/begin.md create mode 100644 reference/ranges/transform_view/end.md create mode 100644 reference/ranges/transform_view/op_constructor.md create mode 100644 reference/ranges/transform_view/op_deduction_guide.md create mode 100644 reference/ranges/transform_view/size.md diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index bbe3559d62..d3c49cbe4d 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -238,9 +238,14 @@ * range_size_t[link /reference/ranges/range_size_t.md] * range_value_t[link /reference/ranges/range_value_t.md] * range[link /reference/ranges/range.md] + * ranges::begin[link /reference/ranges/begin.md] + * ranges::end[link /reference/ranges/end.md] + * ranges::size[link /reference/ranges/size.md] * ref_view[link /reference/ranges/ref_view.md] * sentinel_t[link /reference/ranges/sentinel_t.md] * sized_range[link /reference/ranges/sized_range.md] + * std::ranges::owning_view[link /reference/ranges/owning_view.md] + * std::ranges::ref_view[link /reference/ranges/ref_view.md] * subrange[link /reference/ranges/subrange.md] * view_interface[link /reference/ranges/view_interface.md] * view[link /reference/ranges/view.md] diff --git a/reference/ranges/transform_view.md b/reference/ranges/transform_view.md index cefa5c55cd..c4e9efe332 100644 --- a/reference/ranges/transform_view.md +++ b/reference/ranges/transform_view.md @@ -44,33 +44,33 @@ namespace std::ranges { ## メンバ関数 -| 名前 | 説明 | 対応バージョン | -|--------------------------------------------------|----------------------------------|----------------| -| [`(constructor)`](transform_view/op_constructor.md.nolink) | コンストラクタ | C++20 | -| [`base`](transform_view/base.md.nolink) | `V`の参照を取得する | C++20 | -| [`begin`](transform_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++20 | -| [`end`](transform_view/end.md.nolink) | 番兵を取得する | C++20 | -| [`size`](transform_view/size.md.nolink) | 要素数を取得する | C++20 | +| 名前 | 説明 | 対応バージョン | +|-----------------------------------------------------|----------------------------------|----------------| +| [`(constructor)`](transform_view/op_constructor.md) | コンストラクタ | C++20 | +| [`base`](transform_view/base.md) | `V`の参照を取得する | C++20 | +| [`begin`](transform_view/begin.md) | 先頭を指すイテレータを取得する | C++20 | +| [`end`](transform_view/end.md) | 番兵を取得する | C++20 | +| [`size`](transform_view/size.md) | 要素数を取得する | C++20 | `r`を元のRangeとする。`size`は[`ranges::size`](size.md)`(r)`が有効な式であるときに定義される。 ## 継承しているメンバ関数 -| 名前 | 説明 | 対応バージョン | -|----------------------------------------------|----------------------------------|----------------| +| 名前 | 説明 | 対応バージョン | +|----------------------------------------------|-----------------------------------|----------------| | [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++20 | | [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++20 | -| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | -| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | -| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | -| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | -| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | +| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | +| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | +| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | ## 推論補助 | 名前 | 説明 | 対応バージョン | |-------------------------------------------------------|------------------------------|----------------| -| [`(deduction_guide)`](transform_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++20 | +| [`(deduction_guide)`](transform_view/op_deduction_guide.md) | クラステンプレートの推論補助 | C++20 | ## 例 ```cpp example diff --git a/reference/ranges/transform_view/base.md b/reference/ranges/transform_view/base.md new file mode 100644 index 0000000000..9f91a74944 --- /dev/null +++ b/reference/ranges/transform_view/base.md @@ -0,0 +1,67 @@ +# base +* ranges[meta header] +* std::ranges[meta namespace] +* transform_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr V base() const & + requires copy_constructible; // (1) C++20 + +constexpr V base() &&; // (2) C++20 +``` + +## 概要 + +メンバ変数として保持している、元の`view`を取得する。 + +## 効果 + +入力`view`(`V`)のオブジェクトを`base_`というメンバに保持するとして + +- (1) : `return base_;` と等価 +- (2) : `return std::move(base_);` と等価 + +## 例 + +```cpp example +#include +#include +#include + +int main() { + using std::ranges::view; + + std::vector vec = {1, 2, 3, 4, 5}; + + std::ranges::transform_view r{vec, [](int i) { return i * 2; }}; + + // (1) コピーして取得 + view auto b1 = r.base(); + + // (2) ムーブして取得 + view auto b2 = std::move(r).base(); + + // 得られるのは元のRangeではなく、あくまでview + static_assert(not std::same_as>); + static_assert( std::same_as>>); + static_assert( std::same_as>>); +} +``` +* base[color ff0000] + +### 出力 + +``` +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/transform_view/begin.md b/reference/ranges/transform_view/begin.md new file mode 100644 index 0000000000..4eff1088a3 --- /dev/null +++ b/reference/ranges/transform_view/begin.md @@ -0,0 +1,70 @@ +# begin +* ranges[meta header] +* std::ranges[meta namespace] +* transform_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr iterator begin(); // (1) C++20 + +constexpr iterator begin() const + requires range && + regular_invocable< + const F&, + range_reference_t + >; // (2) C++20 +``` + +## 概要 + +`view`の先頭要素を指すイテレータを取得する。 + +## 戻り値 +- (1) : 以下と等価: + ```cpp + return iterator{*this, ranges::begin(base_)}; + ``` + +- (2) : 以下と等価: + ```cpp + return iterator{*this, ranges::begin(base_)}; + ``` + + +## 例 + +```cpp example +#include +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + std::ranges::transform_view r{vec, [](int i) { return std::to_string(i); }}; + + auto it = r.begin(); + + std::string x = *it; + std::cout << x << '\n'; +} +``` +* begin[color ff0000] + +### 出力 + +``` +1 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/transform_view/end.md b/reference/ranges/transform_view/end.md new file mode 100644 index 0000000000..e27fca46b4 --- /dev/null +++ b/reference/ranges/transform_view/end.md @@ -0,0 +1,97 @@ +# end +* ranges[meta header] +* std::ranges[meta namespace] +* transform_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr sentinel end(); // (1) C++20 + +constexpr iterator end() // (2) C++20 + requires common_range; + +constexpr sentinel end() const + requires range && + regular_invocable< + const F&, + range_reference_t + >; // (3) C++20 + +constexpr iterator end() const + requires common_range && + regular_invocable< + const F&, + range_reference_t + >; // (4) C++20 +``` + +## 概要 +番兵を取得する。 + +## 戻り値 +- (1) : 以下と等価: + ```cpp + return sentinel{ranges::end(base_)}; + ``` + +- (2) : 以下と等価: + ```cpp + return iterator{*this, ranges::end(base_)}; + ``` + +- (3) : 以下と等価: + ```cpp + return sentinel{ranges::end(base_)}; + ``` + +- (4) : 以下と等価: + ```cpp + return iterator{*this, ranges::end(base_)}; + ``` + + +## 例 + +```cpp example +#include +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + std::ranges::transform_view r{vec, [](int i) { return std::to_string(i); }}; + + auto it = r.begin(); + auto end_it = r.end(); + while (it != end_it) { + std::string x = *it; + std::cout << x << std::endl; + ++it; + } +} +``` +* end[color ff0000] +* begin[link begin.md] + +### 出力 + +``` +1 +2 +3 +4 +5 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/transform_view/op_constructor.md b/reference/ranges/transform_view/op_constructor.md new file mode 100644 index 0000000000..464b0b6f70 --- /dev/null +++ b/reference/ranges/transform_view/op_constructor.md @@ -0,0 +1,64 @@ +# コンストラクタ +* ranges[meta header] +* std::ranges[meta namespace] +* transform_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +transform_view() + requires default_initializable && + default_initializable = default; // (1) C++20 + +constexpr explicit + transform_view(V base, F fun); // (2) C++20 +``` + +## 概要 + +[`transform_view`](../transform_view.md)オブジェクトを構築する。 + +- (1) : デフォルト構築 +- (2) : 元となるviewと変換関数を指定して構築 + + +## 効果 + +- (2) : メンバ変数`base_`を`std::move(base)`で、メンバ変数`fun_`を`std::move(fun)`で初期化する + + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + std::ranges::transform_view view{vec, [](int x){ return x * 2; }}; + for (const auto& x : view) { + std::cout << x << std::endl; + } +} +``` +* transform_view[color ff0000] + +### 出力 +``` +2 +4 +6 +8 +10 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/transform_view/op_deduction_guide.md b/reference/ranges/transform_view/op_deduction_guide.md new file mode 100644 index 0000000000..0d51b1dfa4 --- /dev/null +++ b/reference/ranges/transform_view/op_deduction_guide.md @@ -0,0 +1,56 @@ +# 推論補助 +* ranges[meta header] +* std::ranges[meta namespace] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +namespace std::ranges { + template + transform_view(R&&, F) -> transform_view, F>; +} +``` + +## 概要 + +[`transform_view`](../transform_view.md)クラステンプレートの型推論補助。 + +この推論補助によって、元のRangeが暗黙的に[all view](../all.md)でラップされる。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4}; + auto fun = [](int i) { return i * 2; }; + + std::ranges::transform_view r1{vec, fun}; + static_assert(std::same_as< + decltype(r1), + std::ranges::transform_view>, decltype(fun)> + >); + + std::ranges::transform_view r2{std::vector{1, 2}, fun}; + static_assert(std::same_as< + decltype(r2), + std::ranges::transform_view>, decltype(fun)> + >); +} +``` + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/transform_view/size.md b/reference/ranges/transform_view/size.md new file mode 100644 index 0000000000..c031719590 --- /dev/null +++ b/reference/ranges/transform_view/size.md @@ -0,0 +1,58 @@ +# size +* ranges[meta header] +* std::ranges[meta namespace] +* transform_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr auto size() + requires sized_range; // (1) C++20 + +constexpr auto size() const + requires sized_range; // (2) C++20 +``` + +## 概要 +要素数を取得する。 + + +## 効果 +入力`view`(`V`)のオブジェクトを`base_`というメンバに保持するとして、以下と等価: + +```cpp +return ranges::size(base_); +``` + + +## 例 + +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + std::ranges::transform_view r{vec, [](int i) { return i * 2; }}; + + std::size_t n = r.size(); + std::cout << n << std::endl; +} +``` +* size[color ff0000] + +### 出力 +``` +5 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] From d36b13a0f5b40b965e48464b316b9392d11b6bf9 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 30 May 2025 17:29:01 +0900 Subject: [PATCH 1818/3948] =?UTF-8?q?transform=5Fview=20:=20=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=90=E5=9E=8B=E3=81=AE=E6=A6=82=E8=A6=81=E3=81=A0?= =?UTF-8?q?=E3=81=91=E8=BF=BD=E5=8A=A0=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/transform_view.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/reference/ranges/transform_view.md b/reference/ranges/transform_view.md index c4e9efe332..ba6c6e4880 100644 --- a/reference/ranges/transform_view.md +++ b/reference/ranges/transform_view.md @@ -66,6 +66,13 @@ namespace std::ranges { | [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | | [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------------------------------------|------------------------------|----------------| +| `template iterator;` | イテレータ型(説明専用) | C++20 | +| `template sentinel;` | 番兵型(説明専用) | C++20 | + ## 推論補助 | 名前 | 説明 | 対応バージョン | From 24f1d8158e909d0e8285da40f6644084592c7344 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 30 May 2025 22:19:32 +0900 Subject: [PATCH 1819/3948] =?UTF-8?q?GLOBAL=5FQUALIFY=5FLIST:=20std::excha?= =?UTF-8?q?nge=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 1 + lang/cpp17/remove_deprecated_increment_of_bool.md | 1 - lang/cpp20/coroutines.md | 1 - reference/coroutine/coroutine_handle.md | 1 - reference/coroutine/coroutine_traits.md | 1 - reference/coroutine/noop_coroutine.md | 1 - reference/coroutine/suspend_always.md | 1 - reference/coroutine/suspend_never.md | 1 - reference/span/span.md | 2 -- 9 files changed, 1 insertion(+), 9 deletions(-) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index d3c49cbe4d..ff0a03d748 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -330,6 +330,7 @@ * declval[link /reference/utility/declval.md] * in_place_t[link /reference/utility/in_place_t.md] * in_place[link /reference/utility/in_place_t.md] + * std::exchange[link /reference/utility/exchange.md] * std::forward_like[link /reference/utility/forward_like.md] * std::forward[link /reference/utility/forward.md] * std::make_pair[link /reference/utility/make_pair.md] diff --git a/lang/cpp17/remove_deprecated_increment_of_bool.md b/lang/cpp17/remove_deprecated_increment_of_bool.md index cb4a2fe810..f0e2048d9e 100644 --- a/lang/cpp17/remove_deprecated_increment_of_bool.md +++ b/lang/cpp17/remove_deprecated_increment_of_bool.md @@ -77,7 +77,6 @@ int main() std::cout << std::boolalpha << b << std::endl; // => true } ``` -* std::exchange[link /reference/utility/exchange.md] ## 仕様 diff --git a/lang/cpp20/coroutines.md b/lang/cpp20/coroutines.md index 763a5db47b..87891533ec 100644 --- a/lang/cpp20/coroutines.md +++ b/lang/cpp20/coroutines.md @@ -577,7 +577,6 @@ int main() } ``` * co_yield[color ff0000] -* std::exchange[link /reference/utility/exchange.md] * std::terminate()[link /reference/exception/terminate.md] * std::coroutine_handle[link /reference/coroutine/coroutine_handle.md] * std::suspend_always[link /reference/coroutine/suspend_always.md] diff --git a/reference/coroutine/coroutine_handle.md b/reference/coroutine/coroutine_handle.md index 98de8c5ed3..630932db70 100644 --- a/reference/coroutine/coroutine_handle.md +++ b/reference/coroutine/coroutine_handle.md @@ -171,7 +171,6 @@ int main() * done()[link coroutine_handle/done.md] * from_promise[link coroutine_handle/from_promise.md] * promise()[link coroutine_handle/promise.md] -* std::exchange[link /reference/utility/exchange.md] ### 出力 ``` diff --git a/reference/coroutine/coroutine_traits.md b/reference/coroutine/coroutine_traits.md index 1fe6a6c4af..3c2a8c0e77 100644 --- a/reference/coroutine/coroutine_traits.md +++ b/reference/coroutine/coroutine_traits.md @@ -103,7 +103,6 @@ int main() * resume()[link coroutine_handle/resume.md] * done()[link coroutine_handle/done.md] * from_promise[link coroutine_handle/from_promise.md] -* std::exchange[link /reference/utility/exchange.md] ### 出力 ``` diff --git a/reference/coroutine/noop_coroutine.md b/reference/coroutine/noop_coroutine.md index 2d5de67eee..2d90f81e80 100644 --- a/reference/coroutine/noop_coroutine.md +++ b/reference/coroutine/noop_coroutine.md @@ -119,7 +119,6 @@ int main() * done()[link coroutine_handle/done.md] * from_promise[link coroutine_handle/from_promise.md] * promise()[link coroutine_handle/promise.md] -* std::exchange[link /reference/utility/exchange.md] ### 出力 ``` diff --git a/reference/coroutine/suspend_always.md b/reference/coroutine/suspend_always.md index 74f2ab1753..039d79a135 100644 --- a/reference/coroutine/suspend_always.md +++ b/reference/coroutine/suspend_always.md @@ -97,7 +97,6 @@ int main() * done()[link coroutine_handle/done.md] * from_promise[link coroutine_handle/from_promise.md] * promise()[link coroutine_handle/promise.md] -* std::exchange[link /reference/utility/exchange.md] ### 出力 ``` diff --git a/reference/coroutine/suspend_never.md b/reference/coroutine/suspend_never.md index 3b0752ff57..a909bf231f 100644 --- a/reference/coroutine/suspend_never.md +++ b/reference/coroutine/suspend_never.md @@ -98,7 +98,6 @@ int main() * done()[link coroutine_handle/done.md] * from_promise[link coroutine_handle/from_promise.md] * promise()[link coroutine_handle/promise.md] -* std::exchange[link /reference/utility/exchange.md] ### 出力 ``` diff --git a/reference/span/span.md b/reference/span/span.md index f04dee8859..f29a439937 100644 --- a/reference/span/span.md +++ b/reference/span/span.md @@ -192,7 +192,6 @@ int main() print(std::span{ar, 3}); } ``` -* std::exchange[link /reference/utility/exchange.md] * subspan[link span/subspan.md] #### 出力 @@ -251,7 +250,6 @@ int main() * s.first[link span/first.md] * s.last[link span/last.md] * s.size()[link span/size.md] -* std::exchange[link /reference/utility/exchange.md] #### 出力 ``` From 2705e5ad6beba34acdc803456a0afd3cf2a868b9 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 30 May 2025 23:37:05 +0900 Subject: [PATCH 1820/3948] execution: as_awaitable (#1384) class-type,single-sender,forwarding-query --- reference/execution/class-type.md | 26 +++ reference/execution/execution.md | 2 +- reference/execution/execution/as_awaitable.md | 199 ++++++++++++++++++ .../execution/sender_adaptor_closure.md | 2 +- .../execution/single-sender-value-type.md | 2 +- .../execution/execution/single-sender.md | 31 +++ .../execution/with_awaitable_senders.md | 4 +- .../with_awaitable_senders/await_transform.md | 8 +- reference/execution/forwarding-query.md | 29 +++ 9 files changed, 294 insertions(+), 9 deletions(-) create mode 100644 reference/execution/class-type.md create mode 100644 reference/execution/execution/as_awaitable.md create mode 100644 reference/execution/execution/single-sender.md create mode 100644 reference/execution/forwarding-query.md diff --git a/reference/execution/class-type.md b/reference/execution/class-type.md new file mode 100644 index 0000000000..92511231c9 --- /dev/null +++ b/reference/execution/class-type.md @@ -0,0 +1,26 @@ +# class-type +* execution[meta header] +* concept[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std { + template + concept class-type = decays-to && is_class_v; // exposition only +} +``` +* decays-to[link decays-to.md] +* is_class_v[link /reference/type_traits/is_class.md] + +## 概要 +`class-type`は、型`T`がクラス型であることを表す説明専用のコンセプトである。 + + +## バージョン +### 言語 +- C++26 + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution.md b/reference/execution/execution.md index e596e690b7..a2499d1626 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -151,7 +151,7 @@ Senderコンシューマは名前空間 `std::this_thread` で定義される。 | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`execution::as_awaitable`](execution/as_awaitable.md.nolink) | Senderを[Awaitable型](/lang/cpp20/coroutines.md)へ変換 (customization point object) | C++26 | +| [`execution::as_awaitable`](execution/as_awaitable.md) | Senderを[Awaitable型](/lang/cpp20/coroutines.md)へ変換 (customization point object) | C++26 | | [`execution::with_awaitable_senders`](execution/with_awaitable_senders.md) | [Promise型](/lang/cpp20/coroutines.md)の基底クラス (class template) | C++26 | diff --git a/reference/execution/execution/as_awaitable.md b/reference/execution/execution/as_awaitable.md new file mode 100644 index 0000000000..96fb0d8039 --- /dev/null +++ b/reference/execution/execution/as_awaitable.md @@ -0,0 +1,199 @@ +# as_awaitable +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct as_awaitable_t { unspecified }; + inline constexpr as_awaitable_t as_awaitable{}; +} +``` +* unspecified[italic] + +## 概要 +`as_awaitable`は、オブジェクトを特定コルーチン内でAwaitableに変換するカスタマイゼーションポイントオブジェクトである。 + + +## 効果 +説明用の式`expr`と左辺値`p`に対して、型`Expr`を`decltype((expr))`、型`Promise`を[`decay_t`](/reference/type_traits/decay.md)``とする。 + +呼び出し式`as_awaitable(expr, p)`は、`expr`と`p`の評価が不定順で順序付けられることを除いて、下記と等価。 + +- 適格であるならば、式`expr.as_awaitable(p)` + - 適格要件 : 同式の型を`A`としたとき、[`is-awaitable`](../is-awaitable.md)` == true`であるべき。 +- そうではなく、説明用の型`U`を`Promise`とは異なりかつ`await_transform`メンバ関数を持たない未規定の型としたとき、[`is-awaitable`](../is-awaitable.md)` == true`ならば、式`(void(p), expr)` + - 事前条件 : [`is-awaitable`](../is-awaitable.md)` == true`、かつPromise型`U`のコルーチンにおける式`co_await expr`がPromise型`Promise`のコルーチンにおける同式と等しさを保持すること。 +- そうではなく、`awaitable-sender`ならば、式`sender-awaitable{expr, p}` +- そうでなければ、式`(void(p), expr)` + + +## 説明専用エンティティ +### コンセプト`awaitable-sender` +```cpp +namespace std::execution { + template + concept awaitable-sender = + single-sender> && + sender_to && // see below + requires (Promise& p) { + { p.unhandled_stopped() } -> convertible_to>; + }; +} +``` +* single-sender[link single-sender.md] +* sender_to[link sender_to.md] +* convertible_to[link /reference/concepts/convertible_to.md] +* coroutine_handle<>[link /reference/coroutine/coroutine_handle.md] +* see below[italic] + +### クラステンプレート`sender-awaitable` +```cpp +namespace std::execution { + template + class sender-awaitable { + struct unit {}; // exposition only + using value-type = // exposition only + single-sender-value-type>; + using result-type = // exposition only + conditional_t, unit, value-type>; + struct awaitable-receiver; // exposition only + + variant result{}; // exposition only + connect_result_t state; // exposition only + + public: + sender-awaitable(Sndr&& sndr, Promise& p); + static constexpr bool await_ready() noexcept { return false; } + void await_suspend(coroutine_handle) noexcept { start(state); } + value-type await_resume(); + }; +} +``` +* single-sender-value-type[link single-sender-value-type.md] +* env_of_t[link env_of_t.md] +* connect_result_t[link connect_result_t.md] +* start[link start.md] +* conditional_t[link /reference/type_traits/conditional.md] +* is_void_v[link /reference/type_traits/is_void.md] +* variant[link /reference/variant/variant.md] +* monostate[link /reference/variant/monostate.md] +* exception_ptr[link /reference/exception/exception_ptr.md] +* coroutine_handle[link /reference/coroutine/coroutine_handle.md] + +### クラステンプレート`awaitable-receiver` +説明専用のクラステンプレート`sender-awaitable::awaitable-receiver`は下記の通り定義される。 + +```cpp +struct awaitable-receiver { + using receiver_concept = receiver_t; + variant* result-ptr; // exposition only + coroutine_handle continuation; // exposition only + // see below +}; +``` +* receiver_t[link receiver.md] +* variant[link /reference/variant/variant.md] +* monostate[link /reference/variant/monostate.md] +* exception_ptr[link /reference/exception/exception_ptr.md] +* coroutine_handle[link /reference/coroutine/coroutine_handle.md] +* see below[italic] + +説明用の式`rcvr`を`awaitable-reciever`型の右辺値、`crcvr`を`rcvr`をconst参照する左辺値、`vs`を式パック、`err`を`Err`型の式とする。このとき + +- [`constructible_from`](/reference/concepts/constructible_from.md)``を満たすとき、式`set_value(rcvr, vs...)`は下記と等価。そうでなければ、式`set_value(rcvr, vs...)`は不適格となる。 + + ```cpp + try { + rcvr.result-ptr->template emplace<1>(vs...); + } catch(...) { + rcvr.result-ptr->template emplace<2>(current_exception()); + } + rcvr.continuation.resume(); + ``` + * template emplace[link /reference/variant/variant/emplace.md] + * current_exception()[link /reference/exception/current_exception.md] + * resume()[link /reference/coroutine/coroutine_handle/resume.md] + +- 式`set_error(rcvr, err)`は下記と等価。 + + ```cpp + rcvr.result-ptr->template emplace<2>(AS-EXCEPT-PTR(err)); + rcvr.continuation.resume(); + ``` + * template emplace[link /reference/variant/variant/emplace.md] + * resume()[link /reference/coroutine/coroutine_handle/resume.md] + +- 式`set_stopped(rcvr)`は下記と等価。 + + ```cpp + static_cast>(rcvr.continuation.promise().unhandled_stopped()).resume(); + ``` + * coroutine_handle<>[link /reference/coroutine/coroutine_handle.md] + * promise()[link /reference/coroutine/coroutine_handle/promise.md] + * resume()[link /reference/coroutine/coroutine_handle/resume.md] + +- [`forwarding-query`](../forwarding-query.md)を満たす型の式`tag`とパック式`as`に対して、[`get_env`](get_env.md)`(crcvr).query(tag, as...)`は下記と等価。 + + ```cpp + tag(get_env(as_const(crcvr.continuation.promise())), as...) + ``` + * get_env[link get_env.md] + * as_const[link /reference/utility/as_const.md] + * promise()[link /reference/coroutine/coroutine_handle/promise.md] + +```cpp +sender-awaitable(Sndr&& sndr, Promise& p); +``` + +- 効果 : `state`を下記で初期化する。 + + ```cpp + connect(std::forward(sndr), + awaitable-receiver{addressof(result), coroutine_handle::from_promise(p)}) + ``` + * connect[link connect.md] + * coroutine_handle[link /reference/coroutine/coroutine_handle.md] + * from_promise[link /reference/coroutine/coroutine_handle/from_promise.md] + +```cpp +value-type await_resume(); +``` + +- 効果 : 下記と等価。 + + ```cpp + if (result.index() == 2) + rethrow_exception(get<2>(result)); + if constexpr (!is_void_v) + return std::forward(get<1>(result)); + ``` + * index()[link /reference/variant/variant/index.md] + * get[link /reference/variant/variant/get.md] + * rethrow_exception[link /reference/exception/rethrow_exception.md] + * is_void_v[link /reference/type_traits/is_void.md] + + +## カスタマイゼーションポイント +`expr`に対して、適格であるならば式`expr.as_awaitable(p)`が呼び出される。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::with_awaitable_senders`](with_awaitable_senders.md) +- [C++20 コルーチン](/lang/cpp20/coroutines.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/sender_adaptor_closure.md b/reference/execution/execution/sender_adaptor_closure.md index d92530aef5..dfd10664d0 100644 --- a/reference/execution/execution/sender_adaptor_closure.md +++ b/reference/execution/execution/sender_adaptor_closure.md @@ -10,7 +10,7 @@ namespace std::execution { struct sender_adaptor_closure { }; } ``` -* class-type[link class-type.md.nolink] +* class-type[link ../class-type.md] ## 概要 `sender_adaptor_closure`は、ユーザ定義のパイプ可能Senderアダプタクロージャオブジェクトの実装を補助するクラステンプレートである。 diff --git a/reference/execution/execution/single-sender-value-type.md b/reference/execution/execution/single-sender-value-type.md index 9687b191d6..38d30c9fb3 100644 --- a/reference/execution/execution/single-sender-value-type.md +++ b/reference/execution/execution/single-sender-value-type.md @@ -28,7 +28,7 @@ using single-sender-value-type = see below; // exposition only ## 関連項目 - [`execution::stopped_as_optional`](stopped_as_optional.md) -- [`sender-awaitable`](sender-awaitable.md.nolink) +- [`execution::as_awaitable`](as_awaitable.md) ## 参照 diff --git a/reference/execution/execution/single-sender.md b/reference/execution/execution/single-sender.md new file mode 100644 index 0000000000..b1e7242886 --- /dev/null +++ b/reference/execution/execution/single-sender.md @@ -0,0 +1,31 @@ +# single-sender +* execution[meta header] +* type-alias[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +template +concept single-sender = sender_in && + requires { + typename single-sender-value-type; + }; +``` +* sender_in[link sender_in.md] +* single-sender-value-type[link single-sender-value-type.md] + +## 概要 +`single-sender`は、実行制御ライブラリの仕様定義で用いられる説明専用のエイリアステンプレートである。 + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`execution::as_awaitable`](as_awaitable.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/with_awaitable_senders.md b/reference/execution/execution/with_awaitable_senders.md index ec76e23adb..fd0cabaa16 100644 --- a/reference/execution/execution/with_awaitable_senders.md +++ b/reference/execution/execution/with_awaitable_senders.md @@ -33,7 +33,7 @@ namespace std::execution { }; } ``` -* class-type[link class-type.md.nolink] +* class-type[link ../class-type.md] * terminate()[link /reference/exception/terminate.md] * coroutine_handle[link /reference/coroutine/coroutine_handle.md] * address()[link /reference/coroutine/coroutine_handle/address.md] @@ -173,7 +173,7 @@ value=42 ## 関連項目 -- [`execution::as_awaitable`](as_awaitable.md.nolink) +- [`execution::as_awaitable`](as_awaitable.md) - [コルーチン](/lang/cpp20/coroutines.md) diff --git a/reference/execution/execution/with_awaitable_senders/await_transform.md b/reference/execution/execution/with_awaitable_senders/await_transform.md index 4127777e57..1f96434273 100644 --- a/reference/execution/execution/with_awaitable_senders/await_transform.md +++ b/reference/execution/execution/with_awaitable_senders/await_transform.md @@ -11,10 +11,10 @@ call-result-t await_transform(Value&& value); ``` * call-result-t[link /reference/functional/call-result-t.md] -* as_awaitable_t[link ../as_awaitable.md.nolink] +* as_awaitable_t[link ../as_awaitable.md] ## 概要 -コルーチンの[`co_await`演算子](/lang/cpp20/coroutines.md)にアダプトし、[`as_awaitable`](../as_awaitable.md.nolink)で変換したAwaitableオブジェクトを返す。 +コルーチンの[`co_await`演算子](/lang/cpp20/coroutines.md)にアダプトし、[`as_awaitable`](../as_awaitable.md)で変換したAwaitableオブジェクトを返す。 ## 効果 @@ -23,7 +23,7 @@ call-result-t ```cpp return as_awaitable(std::forward(value), static_cast(*this)); ``` -* as_awaitable[link ../as_awaitable.md.nolink] +* as_awaitable[link ../as_awaitable.md] ## バージョン @@ -38,7 +38,7 @@ return as_awaitable(std::forward(value), static_cast(*this)); ## 関連項目 -- [`execution::as_awaitable`](../as_awaitable.md.nolink) +- [`execution::as_awaitable`](../as_awaitable.md) ## 参照 diff --git a/reference/execution/forwarding-query.md b/reference/execution/forwarding-query.md new file mode 100644 index 0000000000..2cc3f7d1c9 --- /dev/null +++ b/reference/execution/forwarding-query.md @@ -0,0 +1,29 @@ +# forwarding-query +* execution[meta header] +* concept[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std { + template + concept forwarding-query = forwarding_query(T{}); // exposition only +} +``` +* forwarding_query[link forwarding_query.md] + +## 概要 +`forwarding_query`は、型`T`が[クエリ可能アダプタを通じて転送可能](forwarding_query.md)か否かを確認する説明専用のコンセプトである。 + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`forwarding_query`](forwarding_query.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) From 1a6cd9cb028ec39fe556b218ffebd57039df314d Mon Sep 17 00:00:00 2001 From: yoh Date: Sat, 31 May 2025 00:39:36 +0900 Subject: [PATCH 1821/3948] =?UTF-8?q?execution/as=5Fawaitable:=20=E6=A6=82?= =?UTF-8?q?=E8=A6=81=E5=A2=97=E8=A3=9C=20(#1384)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/execution/execution/as_awaitable.md | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/reference/execution/execution/as_awaitable.md b/reference/execution/execution/as_awaitable.md index 96fb0d8039..eede9fa1b7 100644 --- a/reference/execution/execution/as_awaitable.md +++ b/reference/execution/execution/as_awaitable.md @@ -13,7 +13,19 @@ namespace std::execution { * unspecified[italic] ## 概要 -`as_awaitable`は、オブジェクトを特定コルーチン内でAwaitableに変換するカスタマイゼーションポイントオブジェクトである。 +`as_awaitable`は、オブジェクトを特定の[コルーチン](/lang/cpp20/coroutines.md)内でAwaitableに変換するカスタマイゼーションポイントオブジェクトである。 + +Promise型`p`をもつコルーチンにおいて、Await式`co_await as_awaitable(expr, p)`は下記のように動作する。 + +- 式`expr.as_awaitable(p)`が有効ならば、同式が返すAwaitableオブジェクトに対してAwait式を実行する。 +- `expr`が[単一の値を送信するSender](single-sender.md)であり、Promise型が停止完了ハンドラを定義するならば、下記動作を行う。 + - Senderを[接続(connect)](connect.md)し、結果[Operation State](operation_state.md)をAwaitableオブジェクトに格納する。 + - コルーチンを中断し、Operation Stateを[開始(start)](start.md)する。 + - [クエリオブジェクト](../queryable.md)による[Receiver](receiver.md)環境への問い合わせは、Promise型に関連付けられた環境(`get_env`)へと転送される。 + - Senderが[値完了](set_value.md)した場合、送信値をAwait式の結果としてコルーチンを再開する。 + - Senderが[エラー完了](set_error.md)した場合、エラー値を例外としてコルーチンから再スローする。 + - Senderが[停止完了](set_stopped.md)した場合、停止完了ハンドラ(`unhandled_stopped`)が返す別のコルーチンを再開させる。 +- そうでなければ、式`expr`に対してAwait式を実行する。 ## 効果 @@ -43,6 +55,7 @@ namespace std::execution { } ``` * single-sender[link single-sender.md] +* env_of_t[link env_of_t.md] * sender_to[link sender_to.md] * convertible_to[link /reference/concepts/convertible_to.md] * coroutine_handle<>[link /reference/coroutine/coroutine_handle.md] @@ -102,7 +115,7 @@ struct awaitable-receiver { 説明用の式`rcvr`を`awaitable-reciever`型の右辺値、`crcvr`を`rcvr`をconst参照する左辺値、`vs`を式パック、`err`を`Err`型の式とする。このとき -- [`constructible_from`](/reference/concepts/constructible_from.md)``を満たすとき、式`set_value(rcvr, vs...)`は下記と等価。そうでなければ、式`set_value(rcvr, vs...)`は不適格となる。 +- [`constructible_from`](/reference/concepts/constructible_from.md)``を満たすとき、式[`set_value`](set_value.md)`(rcvr, vs...)`は下記と等価。そうでなければ、式`set_value(rcvr, vs...)`は不適格となる。 ```cpp try { @@ -116,7 +129,7 @@ struct awaitable-receiver { * current_exception()[link /reference/exception/current_exception.md] * resume()[link /reference/coroutine/coroutine_handle/resume.md] -- 式`set_error(rcvr, err)`は下記と等価。 +- 式[`set_error`](set_error.md)`(rcvr, err)`は下記と等価。 ```cpp rcvr.result-ptr->template emplace<2>(AS-EXCEPT-PTR(err)); @@ -125,7 +138,7 @@ struct awaitable-receiver { * template emplace[link /reference/variant/variant/emplace.md] * resume()[link /reference/coroutine/coroutine_handle/resume.md] -- 式`set_stopped(rcvr)`は下記と等価。 +- 式[`set_stopped`](set_stopped.md)`(rcvr)`は下記と等価。 ```cpp static_cast>(rcvr.continuation.promise().unhandled_stopped()).resume(); @@ -134,7 +147,7 @@ struct awaitable-receiver { * promise()[link /reference/coroutine/coroutine_handle/promise.md] * resume()[link /reference/coroutine/coroutine_handle/resume.md] -- [`forwarding-query`](../forwarding-query.md)を満たす型の式`tag`とパック式`as`に対して、[`get_env`](get_env.md)`(crcvr).query(tag, as...)`は下記と等価。 +- [`forwarding-query`](../forwarding-query.md)を満たす型の式`tag`とパック式`as`に対して、式[`get_env`](get_env.md)`(crcvr).query(tag, as...)`は下記と等価。 ```cpp tag(get_env(as_const(crcvr.continuation.promise())), as...) From 5907be1caf5fe5cb6a9ea16d9ff5e79fad87e682 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sun, 1 Jun 2025 11:21:36 +0900 Subject: [PATCH 1822/3948] fix wrong numbers in unordered_map::insert() --- reference/unordered_map/unordered_map/insert.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/unordered_map/unordered_map/insert.md b/reference/unordered_map/unordered_map/insert.md index 3b89f15a12..c837beeee6 100644 --- a/reference/unordered_map/unordered_map/insert.md +++ b/reference/unordered_map/unordered_map/insert.md @@ -78,15 +78,15 @@ iterator insert(const_iterator hint, node_type&& nh); // (10) C++17 - (1), (2), (3) : - [`pair`](/reference/utility/pair.md) の `bool` 部分(`second` 部)は、要素が追加されたら `true`、追加されなかったら(既にあったら)`false`を返す - [`pair`](/reference/utility/pair.md) の `iterator` 部分(`first` 部)は、追加された要素(`bool` 部分が `true` の場合)、あるいは、既にあった要素(`bool` 部分が `false` の場合)を指すイテレータを返す -- (4), (5) : +- (4), (5), (6) : - 新たな要素が追加された場合、その追加された要素を指すイテレータを返す - 新たな要素が追加されなかった場合、すでにあった要素を指すイテレータを返す -- (6), (7) : なし +- (7), (8) : なし - (9) : - [`insert_return_type`](/reference/map/map.md)を返す。`insert_return_type`のイテレータ型メンバ変数`position`、`bool`型メンバ変数`inserted`に格納される値は(1), (2), (3)のものと同じ情報である。`nh`が空の場合は、`position`は終端イテレータである。`node_type`型メンバ変数`node`には、 - 挿入された場合には、空の[ノードハンドル](/reference/node_handle/node_handle.md) - 挿入されなかった場合には、`nh`の値である -- (8) : `nh`が空の場合、`(*this).end()`を返す。そうではない場合、`nh`と等価のキーの要素を指すイテレータを常に返す +- (10) : `nh`が空の場合、`(*this).end()`を返す。そうではない場合、`nh`と等価のキーの要素を指すイテレータを常に返す ## 例外 From deaaa1657f781bafd179d51a1a448e1e5e1760d5 Mon Sep 17 00:00:00 2001 From: yoh Date: Sun, 1 Jun 2025 17:08:40 +0900 Subject: [PATCH 1823/3948] execution: get_forward_progress_guarantee (#1384) --- reference/execution/execution.md | 4 +- .../execution/forward_progress_guarantee.md | 45 ++++++++++++++++ .../execution/get_delegation_scheduler.md | 4 +- reference/execution/execution/get_domain.md | 4 +- .../get_forward_progress_guarantee.md | 54 +++++++++++++++++++ .../execution/execution/get_scheduler.md | 4 +- reference/execution/forwarding-query.md | 2 +- reference/execution/get_allocator.md | 2 +- reference/execution/get_stop_token.md | 2 +- 9 files changed, 110 insertions(+), 11 deletions(-) create mode 100644 reference/execution/execution/forward_progress_guarantee.md create mode 100644 reference/execution/execution/get_forward_progress_guarantee.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index a2499d1626..b9cb375947 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -42,8 +42,8 @@ namespace std::execution { | [`execution::get_domain`](execution/get_domain.md) | 実行ドメイン取得のクエリオブジェクト (customization point object) | C++26 | | [`execution::get_scheduler`](execution/get_scheduler.md) | Scheduler取得のクエリオブジェクト (customization point object) | C++26 | | [`execution::get_delegation_scheduler`](execution/get_delegation_scheduler.md) | 委任Scheduler取得のクエリオブジェクト (customization point object) | C++26 | -| [`execution::forward_progress_guarantee`](execution/forward_progress_guarantee.md.nolink) | 前方進行保証 (enum) | C++26 | -| [`execution::get_forward_progress_guarantee`](execution/get_forward_progress_guarantee.md.nolink) | 前方進行保証取得のクエリオブジェクト (customization point object) | C++26 | +| [`execution::forward_progress_guarantee`](execution/forward_progress_guarantee.md) | 前方進行保証 (enum) | C++26 | +| [`execution::get_forward_progress_guarantee`](execution/get_forward_progress_guarantee.md) | 前方進行保証取得のクエリオブジェクト (customization point object) | C++26 | | [`execution::get_completion_scheduler`](execution/get_completion_scheduler.md) | 完了Scheduler取得のクエリオブジェクト (customization point object) | C++26 | | [`execution::get_env`](execution/get_env.md) | 環境取得のクエリオブジェクト (customization point object) | C++26 | | [`execution::env_of_t`](execution/env_of_t.md) | 指定型から環境型を取得 (alias template) | C++26 | diff --git a/reference/execution/execution/forward_progress_guarantee.md b/reference/execution/execution/forward_progress_guarantee.md new file mode 100644 index 0000000000..a5c1daf8f3 --- /dev/null +++ b/reference/execution/execution/forward_progress_guarantee.md @@ -0,0 +1,45 @@ +# forward_progress_guarantee +* execution[meta header] +* std::execution[meta namespace] +* enum[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + enum class forward_progress_guarantee { + concurrent, + parallel, + weakly_parallel + }; +} +``` + +## 概要 +[Scheduler](scheduler.md)に関連付けられた実行リソースに属する実行エージェントの、前方進行保証(forward progress guarantees)レベルを表現する列挙型。 + +| 列挙子 | 前方進行保証レベル | +|----|----| +| `concurrent` | 全ての実行エージェントが並行前方進行保証(concurrent forward progress guarantees)を提供する | +| `parallel` | 全ての実行エージェントが少なくとも並列前方進行保証(parallel forward progress guarantees)を提供する | +| `weakly_parallel` | 弱い並列前方進行保証(weakly parallel forward progress guarantees)となる | + +`concurrent`が最も強い前方進行保証を与え、`parallel`、`weakly_parallel`の順に前方進行保証が弱くなる。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::get_forward_progress_guarantee`](get_forward_progress_guarantee.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/get_delegation_scheduler.md b/reference/execution/execution/get_delegation_scheduler.md index 17b2428215..cafd4f4893 100644 --- a/reference/execution/execution/get_delegation_scheduler.md +++ b/reference/execution/execution/get_delegation_scheduler.md @@ -7,7 +7,7 @@ ```cpp namespace std::execution { struct get_delegation_scheduler_t { unspecified }; - constexpr get_delegation_scheduler_t get_delegation_scheduler{}; + inline constexpr get_delegation_scheduler_t get_delegation_scheduler{}; } ``` * unspecified[italic] @@ -45,7 +45,7 @@ const修飾[クエリ可能オブジェクト](../queryable.md)`cenv`に対し ## 関連項目 -- [`scheduler`](scheduler.md) +- [`execution::scheduler`](scheduler.md) ## 参照 diff --git a/reference/execution/execution/get_domain.md b/reference/execution/execution/get_domain.md index dfbbe540fe..62aeb6164e 100644 --- a/reference/execution/execution/get_domain.md +++ b/reference/execution/execution/get_domain.md @@ -7,7 +7,7 @@ ```cpp namespace std::execution { struct get_domain_t { unspecified }; - constexpr get_domain_t get_domain{}; + inline constexpr get_domain_t get_domain{}; } ``` * unspecified[italic] @@ -45,7 +45,7 @@ const修飾[クエリ可能オブジェクト](../queryable.md)`cenv`に対し ## 関連項目 -- [`default_domain`](default_domain.md) +- [`execution::default_domain`](default_domain.md) ## 参照 diff --git a/reference/execution/execution/get_forward_progress_guarantee.md b/reference/execution/execution/get_forward_progress_guarantee.md new file mode 100644 index 0000000000..ff555bdca2 --- /dev/null +++ b/reference/execution/execution/get_forward_progress_guarantee.md @@ -0,0 +1,54 @@ +# get_forward_progress_guarantee +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct get_forward_progress_guarantee_t { unspecified }; + inline constexpr get_forward_progress_guarantee_t get_forward_progress_guarantee{}; +} +``` +* unspecified[italic] + +## 概要 +`get_forward_progress_guarantee_t`は、[Scheduler](scheduler.md)に関連付けられた実行リソースによる実行エージェントの前方進行保証を取得する[クエリオブジェクト](../queryable.md)である。 + + +## 効果 +説明用の変数`sch`に対して、型`Sch`を`decltype((sch))`とする。`Sch`が[`scheduler`](scheduler.md)を満たさないとき、`get_forward_progress_guarantee`は不適格となる。 + +そうでなければ、呼び出し式`get_forward_progress_guarantee(sch)`は下記と等価であり、[`forward_progress_guarantee`](forward_progress_guarantee.md)列挙型の値となる。 + +- 引数`sch`がconst修飾された`csch`を用いて、適格であるならば式`cenv.query(get_forward_progress_guarantee)` +- そうでなければ、[`forward_progress_guarantee::weakly_parallel`](forward_progress_guarantee.md) + + +## 例外 +投げない + + +## カスタマイゼーションポイント +const修飾[Scheduler](scheduler.md)`sch`に対して式`csch.query(get_forward_progress_guarantee)`が呼び出される。 +このとき、`noexcept(csch.query(get_forward_progress_guarantee)) == true`であること。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::scheduler`](scheduler.md) +- [`execution::forward_progress_guarantee`](forward_progress_guarantee.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/get_scheduler.md b/reference/execution/execution/get_scheduler.md index b8a729419f..80079c60ec 100644 --- a/reference/execution/execution/get_scheduler.md +++ b/reference/execution/execution/get_scheduler.md @@ -7,7 +7,7 @@ ```cpp namespace std::execution { struct get_scheduler { unspecified }; - constexpr get_scheduler_t get_scheduler{}; + inline constexpr get_scheduler_t get_scheduler{}; } ``` * unspecified[italic] @@ -45,7 +45,7 @@ const修飾[クエリ可能オブジェクト](../queryable.md)`cenv`に対し ## 関連項目 -- [`scheduler`](scheduler.md) +- [`execution::scheduler`](scheduler.md) ## 参照 diff --git a/reference/execution/forwarding-query.md b/reference/execution/forwarding-query.md index 2cc3f7d1c9..bc1f240df5 100644 --- a/reference/execution/forwarding-query.md +++ b/reference/execution/forwarding-query.md @@ -22,7 +22,7 @@ namespace std { ## 関連項目 -- [`forwarding_query`](forwarding_query.md) +- [`execution::forwarding_query`](forwarding_query.md) ## 参照 diff --git a/reference/execution/get_allocator.md b/reference/execution/get_allocator.md index 4f0440975e..bf6bb267ee 100644 --- a/reference/execution/get_allocator.md +++ b/reference/execution/get_allocator.md @@ -7,7 +7,7 @@ ```cpp namespace std { struct get_allocator_t { unspecified }; - constexpr get_allocator_t get_allocator{}; + inline constexpr get_allocator_t get_allocator{}; } ``` * unspecified[italic] diff --git a/reference/execution/get_stop_token.md b/reference/execution/get_stop_token.md index 26e2be5aae..d31e8962db 100644 --- a/reference/execution/get_stop_token.md +++ b/reference/execution/get_stop_token.md @@ -7,7 +7,7 @@ ```cpp namespace std { struct get_stop_token_t { unspecified }; - constexpr get_stop_token_t get_stop_token{}; + inline constexpr get_stop_token_t get_stop_token{}; } ``` * unspecified[italic] From 8253efad70efca59c631ec1d2cab56be41c96898 Mon Sep 17 00:00:00 2001 From: yoh Date: Sun, 1 Jun 2025 19:59:29 +0900 Subject: [PATCH 1824/3948] =?UTF-8?q?execution:=20=E8=AA=AC=E6=98=8E?= =?UTF-8?q?=E5=B0=82=E7=94=A8=E3=82=A8=E3=83=B3=E3=83=86=E3=82=A3=E3=83=86?= =?UTF-8?q?=E3=82=A3=20(#1384)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - SET-VALUE,TRY-EVAL,TRY-SET-VALUE - SCHED-ATTRS,SCHED-ENV - MAKE-ENV,JOIN-ENV --- reference/execution/execution/bulk.md | 2 +- reference/execution/execution/connect.md | 3 +- reference/execution/execution/continues_on.md | 4 +- .../execution/get_completion_signatures.md | 2 +- reference/execution/execution/into_variant.md | 1 + reference/execution/execution/let_value.md | 8 ++-- reference/execution/execution/on.md | 6 +-- reference/execution/execution/read_env.md | 1 + .../execution/execution/schedule_from.md | 4 +- reference/execution/execution/scheduler.md | 14 +++++++ reference/execution/execution/set_value.md | 39 +++++++++++++++++++ reference/execution/execution/starts_on.md | 4 +- reference/execution/execution/then.md | 1 + reference/execution/execution/when_all.md | 2 +- reference/execution/forwarding_query.md | 2 +- reference/execution/queryable.md | 15 +++++++ 16 files changed, 89 insertions(+), 19 deletions(-) diff --git a/reference/execution/execution/bulk.md b/reference/execution/execution/bulk.md index 3689a9aed6..1b90ea800a 100644 --- a/reference/execution/execution/bulk.md +++ b/reference/execution/execution/bulk.md @@ -71,7 +71,7 @@ namespace std::execution { } ``` * set_value_t[link set_value.md] -* TRY-EVAL[link TRY-EVAL.md.nolink] +* TRY-EVAL[link set_value.md] * std::move[link /reference/utility/move.md] * see below[italic] diff --git a/reference/execution/execution/connect.md b/reference/execution/execution/connect.md index f519456cd6..079f27adba 100644 --- a/reference/execution/execution/connect.md +++ b/reference/execution/execution/connect.md @@ -111,7 +111,6 @@ namespace std::execution { `C`型の`c`と[コルーチンPromise型](/lang/cpp20/coroutines.md)の左辺値`p`に対して、`await-result-type`を`decltype(`[`GET-AWAITER`](../is-awaitable.md)`(c, p).`[`await_resume()`](/lang/cpp20/coroutines.md)`)`型とする。 型`V`を`await-result-type`とする。 -`SET-VALUE-SIG(T)`を、`T`がCV修飾された`void`ならば[`set_value_t`](set_value.md)`()`型、そうでなければ[`set_value_t`](set_value.md)`(T)`型とする。 型`Sigs`を下記の通り定義する。 ```cpp @@ -121,10 +120,10 @@ completion_signatures< set_stopped_t()> ``` * completion_signatures[link completion_signatures.md] +* SET-VALUE-SIG[link set_value.md] * set_error_t[link set_error.md] * set_stopped_t[link set_stopped.md] * exception_ptr[link /reference/exception/exception_ptr.md] -* SET-VALUE-SIG[italic] 説明用の関数テンプレート`suspend-complete`とコルーチン`suspend-awaitable`を下記の通り定義する。 diff --git a/reference/execution/execution/continues_on.md b/reference/execution/execution/continues_on.md index d320b53aca..917fdd8977 100644 --- a/reference/execution/execution/continues_on.md +++ b/reference/execution/execution/continues_on.md @@ -47,8 +47,8 @@ namespace std::execution { ``` * impls-for[link impls-for.md] * default-impls[link impls-for.md] -* JOIN-ENV[link JOIN-ENV.md.nolink] -* SCHED-ATTRS[link SCHED-ATTRS.md.nolink] +* JOIN-ENV[link ../queryable.md] +* SCHED-ATTRS[link scheduler.md] * FWD-ENV[link ../forwarding_query.md] * get_env[link get_env.md] diff --git a/reference/execution/execution/get_completion_signatures.md b/reference/execution/execution/get_completion_signatures.md index 4ef53f6013..f8838b3a30 100644 --- a/reference/execution/execution/get_completion_signatures.md +++ b/reference/execution/execution/get_completion_signatures.md @@ -34,7 +34,7 @@ namespace std::execution { set_stopped_t()> ``` * completion_signatures[link completion_signatures.md] - * SET-VALUE-SIG[link connect.md] + * SET-VALUE-SIG[link set_value.md] * await-result-type[link connect.md] * env-promise[link env-promise.md] * set_error_t[link set_error.md] diff --git a/reference/execution/execution/into_variant.md b/reference/execution/execution/into_variant.md index d511575a39..2008a4b40e 100644 --- a/reference/execution/execution/into_variant.md +++ b/reference/execution/execution/into_variant.md @@ -80,6 +80,7 @@ namespace std::execution { } ``` * set_value_t[link set_value.md] +* TRY-SET-VALUE[link set_value.md] * decayed-tuple[link decayed-tuple.md] * std::move[link /reference/utility/move.md] diff --git a/reference/execution/execution/let_value.md b/reference/execution/execution/let_value.md index d0b36b0889..a8ef9f8421 100644 --- a/reference/execution/execution/let_value.md +++ b/reference/execution/execution/let_value.md @@ -114,19 +114,19 @@ namespace std::execution { ``` * set_value[link set_value.md] * decayed-typeof[link /reference/functional/decayed-typeof.md] -* TRY-EVAL[link TRY-EVAL.md.nolink] +* TRY-EVAL[link set_value.md] * std::move[link /reference/utility/move.md] 説明用の式`sndr`と`env`に対して、型`Sndr`を`decltype((sndr))`とする。[`sender-for`](sender-for.md)`> == false`のとき、式`let_value.transform_env(sndr, env)`は不適格となる。 -そうでなければ、式`let_value.transform_env(sndr, env)`は[`JOIN-ENV`](JOIN-ENV.md.nolink)`(let-env(sndr),` [`FWD-ENV`](../forwarding_query.md)`(env))`と等価。 +そうでなければ、式`let_value.transform_env(sndr, env)`は[`JOIN-ENV`](../queryable.md)`(let-env(sndr),` [`FWD-ENV`](../forwarding_query.md)`(env))`と等価。 ## 説明専用エンティティ 説明用の式`sndr`を用いて、`let-env(sndr)`を下記リストのうち最初に適格となる式と定義する。 -- [`SCHED-ENV`](SCHED-ENV.md.nolink)`(`[`get_completion_scheduler`](get_completion_scheduler.md)`<`[`decayed-typeof`](/reference/functional/decayed-typeof.md)`<`[`set_value`](set_value.md)`>>(`[`get_env`](get_env.md)`(sndr)))` -- [`MAKE-ENV`](MAKE-ENV.md.nolink)`(`[`get_domain`](get_domain.md)`,` [`get_domain`](get_domain.md)`(`[`get_env`](get_env.md)`(sndr)))` +- [`SCHED-ENV`](schedule.md)`(`[`get_completion_scheduler`](get_completion_scheduler.md)`<`[`decayed-typeof`](/reference/functional/decayed-typeof.md)`<`[`set_value`](set_value.md)`>>(`[`get_env`](get_env.md)`(sndr)))` +- [`MAKE-ENV`](../queryable.md)`(`[`get_domain`](get_domain.md)`,` [`get_domain`](get_domain.md)`(`[`get_env`](get_env.md)`(sndr)))` - `(void(sndr),` [`env<>{}`](env.md)`)` 説明専用の`let-bind`テンプレート関数を下記の通り定義する。 diff --git a/reference/execution/execution/on.md b/reference/execution/execution/on.md index 90c4e0fa71..134e06588a 100644 --- a/reference/execution/execution/on.md +++ b/reference/execution/execution/on.md @@ -79,8 +79,8 @@ transform_sender( } ``` * scheduler[link scheduler.md] - * JOIN-ENV[link JOIN-ENV.md.nolink] - * SCHED-ENV[link SCHED-ENV.md.nolink] + * JOIN-ENV[link ../queryable.md] + * SCHED-ENV[link scheduler.md] * FWD-ENV[link ../forwarding_query.md] - 式`on.transform_sender(out_sndr, env)`は下記と等価。 @@ -128,7 +128,7 @@ transform_sender( * get_env[link get_env.md] * query-with-default[link query-with-default.md] * write-env[link write-env.md] - * SCHED-ENV[link SCHED-ENV.md.nolink] + * SCHED-ENV[link scheduler.nolink] * std::move[link /reference/utility/move.md] 説明専用のクラス`not-a-scheduler`を未規定な空のクラス型、`not-a-sender`を下記の通り定義する。 diff --git a/reference/execution/execution/read_env.md b/reference/execution/execution/read_env.md index e93d649f32..d494bedbd2 100644 --- a/reference/execution/execution/read_env.md +++ b/reference/execution/execution/read_env.md @@ -39,6 +39,7 @@ namespace std::execution { * decayed-typeof[link /reference/functional/decayed-typeof.md] * impls-for[link impls-for.md] * default-impls[link impls-for.md] +* TRY-SET-VALUE[link set_value.md] * get_env[link get_env.md] diff --git a/reference/execution/execution/schedule_from.md b/reference/execution/execution/schedule_from.md index 6c3014d2c7..eec40b797f 100644 --- a/reference/execution/execution/schedule_from.md +++ b/reference/execution/execution/schedule_from.md @@ -59,8 +59,8 @@ namespace std::execution { return JOIN-ENV(SCHED-ATTRS(data), FWD-ENV(get_env(child))); } ``` -* JOIN-ENV[link JOIN-ENV.md.nolink] -* SCHED-ATTRS[link SCHED-ATTRS.md.nolink] +* JOIN-ENV[link ../queryable.md] +* SCHED-ATTRS[link scheduler.md] * FWD-ENV[link ../forwarding_query.md] * get_env[link get_env.md] diff --git a/reference/execution/execution/scheduler.md b/reference/execution/execution/scheduler.md index f113de5584..959ceaa348 100644 --- a/reference/execution/execution/scheduler.md +++ b/reference/execution/execution/scheduler.md @@ -80,6 +80,20 @@ namespace std::execution { Scheduler型のデストラクタは、[`schedule`](schedule.md)が返すSenderオブジェクトに接続されたReceiverの完了を待機してブロックしてはならない。 +## 説明専用エンティティ +### `SCHED-ATTRS` +説明用のScheduler`sch`に対して、式`SCHED-ATTRS(sch)`は[`queryable`](../queryable.md)を満たす型の式`o1`となり、下記を満たす。 + +- 型`Tag`が[`set_value_t`](set_value.md)もしくは[`set_stopped_t`](set_stopped.md)のとき、式`o1.query(`[`get_completion_scheduler`](get_completion_scheduler.md)`)`の型および値が`sch`と等しい。 +- 式`o1.query(`[`get_domain`](get_domain.md)`)`は`sch.query(`[`get_domain`](get_domain.md)`)`と等価。 + +### `SCHED-ENV` +説明用のScheduler`sch`に対して、式`SCHED-ENV(sch)`は[`queryable`](../queryable.md)を満たす型の式`o2`となり、下記を満たす。 + +- 式`o2.query(`[`get_scheduler`](get_scheduler.md)`)`は、型および値が`sch`と等しい右辺値。 +- 式`o2.query(`[`get_domain`](get_domain.md)`)`は`sch.query(`[`get_domain`](get_domain.md)`)`と等価。 + + ## 例 ```cpp example #include diff --git a/reference/execution/execution/set_value.md b/reference/execution/execution/set_value.md index 085ec50f3a..e62d9f1afe 100644 --- a/reference/execution/execution/set_value.md +++ b/reference/execution/execution/set_value.md @@ -33,6 +33,45 @@ namespace std::execution { このとき、`noexcept(rcvr.set_value(vs...)) == true`であること。 +## 説明専用エンティティ +### `SET-VALUE` +説明用の式`rcvr`, `expr`に対して、説明専用の式`SET-VALUE(rcvr, expr)`は下記と等価である。 + +- `expr`の型が`void`のとき、式`(expr, set_value(`[`std::move`](/reference/utility/move.md)`(rcvr)))` +- そうでなければ、式`set_value(`[`std::move`](/reference/utility/move.md)`(rcvr), expr)` + +### `TRY-EVAL` +説明用の式`rcvr`, `expr`に対して、説明専用の式`TRY-EVAL(rcvr, expr)`は下記と等価である。 + +- `expr`が潜在的に例外送出するならば、下記と等価。 + + ```cpp + try { + expr; + } catch(...) { + set_error(std::move(rcvr), current_exception()); + } + ``` + * set_error[link set_error.md] + * std::move[link /reference/utility/move.md] + * current_exception()[link /reference/exception/current_exception.md] + +- そうでなければ、式`expr` + +### `TRY-SET-VALUE` +説明用の式`rcvr`, `expr`に対して、説明専用の式`TRY-SET-VALUE(rcvr, expr)`は`rcvr`が1回だけ評価されることを除いて、下記と等価。 + +```cpp +TRY-EVAL(rcvr, SET-VALUE(rcvr, expr)) +``` + +### `SET-VALUE-SIG` +説明用の型`T`に対して、説明専用の型`SET-VALUE-SIG(T)`を下記の通り定義する。 + +- `T`がCV修飾された`void`ならば、型`set_value_t()` +- そうでなければ、型`set_value_t(T)` + + ## 備考 完了関数`set_value`は[Sender](sender.md)内部実装から呼び出される想定であり、実行制御ライブラリ利用者が直接利用する必要はない。 diff --git a/reference/execution/execution/starts_on.md b/reference/execution/execution/starts_on.md index 4f23445fb9..c82f71db8a 100644 --- a/reference/execution/execution/starts_on.md +++ b/reference/execution/execution/starts_on.md @@ -44,8 +44,8 @@ transform_sender( auto&& [_, sch, _] = out_sndr; return JOIN-ENV(SCHED-ENV(sch), FWD-ENV(env)); ``` - * JOIN-ENV[link JOIN-ENV.md.nolink] - * SCHED-ENV[link SCHED-ENV.md.nolink] + * JOIN-ENV[link ../queryable.md] + * SCHED-ENV[link scheduler.md] * FWD-ENV[link ../forwarding_query.md] - 式`starts_on.transform_sender(out_sndr, env)`は下記と等価。 diff --git a/reference/execution/execution/then.md b/reference/execution/execution/then.md index 22d67d5a4c..27187eda48 100644 --- a/reference/execution/execution/then.md +++ b/reference/execution/execution/then.md @@ -55,6 +55,7 @@ namespace std::execution { * impls-for[link impls-for.md] * default-impls[link impls-for.md] * set_value[link set_value.md] +* TRY-SET-VALUE[link set_value.md] * invoke[link /reference/functional/invoke.md] * std::move[link /reference/utility/move.md] diff --git a/reference/execution/execution/when_all.md b/reference/execution/execution/when_all.md index 44a3653831..bfa79b04f1 100644 --- a/reference/execution/execution/when_all.md +++ b/reference/execution/execution/when_all.md @@ -73,7 +73,7 @@ namespace std::execution { ``` * default_domain[link default_domain.md] * env<>[link env.md] -* MAKE-ENV[link MAKE-ENV.md.nolink] +* MAKE-ENV[link ../queryable.md] * get_domain[link get_domain.md] `impls-for::get-env`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 diff --git a/reference/execution/forwarding_query.md b/reference/execution/forwarding_query.md index 2d72071f71..3f973fabe6 100644 --- a/reference/execution/forwarding_query.md +++ b/reference/execution/forwarding_query.md @@ -51,7 +51,7 @@ namespace std { 下記[クエリオブジェクト](queryable.md)に対する問い合わせは、`FWD-ENV`経由で転送されない。 - [`execution::get_env`](execution/get_env.md) -- [`executoin::get_forward_progress_guarantee`](executionget_forward_progress_guarantee.md.nolink) +- [`executoin::get_forward_progress_guarantee`](execution/get_forward_progress_guarantee.md) ## バージョン diff --git a/reference/execution/queryable.md b/reference/execution/queryable.md index b6caabdc0f..f0852bfc73 100644 --- a/reference/execution/queryable.md +++ b/reference/execution/queryable.md @@ -44,6 +44,21 @@ concept queryable = destructible; 呼び出し可能オブジェクト`q`と部分式パック`args`に対して、`requires { q(env, args...) }`が`true`であれば、`q(env, args...)`が`q`に課されるセマンティック要件を満たす場合に、`Env`は`queryable`のモデルである。 +## 説明専用エンティティ +### `MAKE-ENV` +説明用のクエリオブジェクト`q`と式`v`に対して、式`MAKE-ENV(q, v)`は`queryable`を満たす型の式`env`となり、下記を満たす。 + +- `env.query(q)`の結果が`v`と等しい。 +- 明に規定されない限り、`env`が有効の間は`env.query(q)`のオブジェクトも有効である。 + +### `JOIN-ENV` +説明用のクエリ可能オブジェクト`env1`, `env2`、クエリオブジェクト`q`、パック式`as`に対して、式`JOIN-ENV(env1, env2)`は`queryable`を満たす型の式`env3`となり、式`env3.query(q, as...)`は下記と等価である。 + +- 適格であるならば、式`env1.query(q, as...)` +- そうではなく、適格であるならば、式`env2.query(q, as...)` +- そうでなければ、式`env3.query(q, as...)`は不適格 + + ## 備考 [Sender](execution/sender.md)に関連付けられたクエリ可能オブジェクトは「属性(attributes)」と呼ばれるが、実行制御ライブラリの仕様記述では[Receiver](execution/receiver.md)の「環境(environment)」と合わせて`Env`型や識別子名`env`として包括的に言及される。 From a122f1561e407a9c4ee67795af8f045b40d84b99 Mon Sep 17 00:00:00 2001 From: Kazutoshi SATODA Date: Mon, 2 Jun 2025 00:09:38 +0900 Subject: [PATCH 1825/3948] =?UTF-8?q?start=5Flifetime=5Fas:=20=E6=88=BB?= =?UTF-8?q?=E3=82=8A=E5=80=A4=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6=E4=B8=8D?= =?UTF-8?q?=E6=AD=A3=E3=81=AA=E3=80=8C=E3=83=9D=E3=82=A4=E3=83=B3=E3=82=BF?= =?UTF-8?q?=E3=81=AE=E5=80=A4=E3=81=AF=20`p`=E3=80=8D=E3=82=92=E5=89=8A?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 戻り値は新しく構築されたオブジェクトへのポインタであり、引数 p と 同じ値になることはあり得ないので不正な記述となっていました。 https://github.com/cpprefjp/site/commit/05294b6e27b4f0a7b5fc74f72ff29afab42e150f#r158754186 ついでに脱字修正。 「オブジェクトのポインタ」→「オブジェクトへのポインタ」 --- reference/memory/start_lifetime_as.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/memory/start_lifetime_as.md b/reference/memory/start_lifetime_as.md index 6edac78b0c..13fd0d8744 100644 --- a/reference/memory/start_lifetime_as.md +++ b/reference/memory/start_lifetime_as.md @@ -38,7 +38,7 @@ const volatile T* start_lifetime_as(const volatile void* p) noexcept; // (4) ## 戻り値 -暗黙的に構築された型 `T` のオブジェクトのポインタを返す。ポインタの値は `p`。 +暗黙的に構築された型 `T` のオブジェクトへのポインタを返す。 ## 例外 From e1744f9eb4cc371687222579bbc2276f301fe1e9 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 2 Jun 2025 15:48:20 +0900 Subject: [PATCH 1826/3948] =?UTF-8?q?take=5Fview=20:=20=E3=83=A1=E3=83=B3?= =?UTF-8?q?=E3=83=90=E9=96=A2=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Claude Codeで「.nolinkになっているページを作成してください」と伝えただけでいい感じにしてくれた。感動極まりない --- reference/ranges/stride_view.md | 2 +- reference/ranges/take_view.md | 12 +-- reference/ranges/take_view/base.md | 67 +++++++++++++++++ reference/ranges/take_view/begin.md | 62 ++++++++++++++++ reference/ranges/take_view/end.md | 74 +++++++++++++++++++ reference/ranges/take_view/op_constructor.md | 63 ++++++++++++++++ .../ranges/take_view/op_deduction_guide.md | 55 ++++++++++++++ reference/ranges/take_view/size.md | 60 +++++++++++++++ reference/ranges/zip_transform_view.md | 2 +- 9 files changed, 389 insertions(+), 8 deletions(-) create mode 100644 reference/ranges/take_view/base.md create mode 100644 reference/ranges/take_view/begin.md create mode 100644 reference/ranges/take_view/end.md create mode 100644 reference/ranges/take_view/op_constructor.md create mode 100644 reference/ranges/take_view/op_deduction_guide.md create mode 100644 reference/ranges/take_view/size.md diff --git a/reference/ranges/stride_view.md b/reference/ranges/stride_view.md index 6f26792ce7..7074702f23 100644 --- a/reference/ranges/stride_view.md +++ b/reference/ranges/stride_view.md @@ -44,7 +44,7 @@ namespace std::ranges { | [`stride`](stride_view/stride.md.nolink) | 1回で移動する要素数を取得する | C++23 | | [`begin`](stride_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++23 | | [`end`](stride_view/end.md.nolink) | 番兵を取得する | C++23 | -| [`size`](take_view/size.md.nolink) | 要素数を取得する | C++23 | +| [`size`](stride_view/size.md.nolink) | 要素数を取得する | C++23 | ## 継承しているメンバ関数 diff --git a/reference/ranges/take_view.md b/reference/ranges/take_view.md index c0a154b4f5..4be2cc4543 100644 --- a/reference/ranges/take_view.md +++ b/reference/ranges/take_view.md @@ -53,11 +53,11 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |--------------------------------------------------|----------------------------------|----------------| -| [`(constructor)`](take_view/op_constructor.md.nolink) | コンストラクタ | C++20 | -| [`base`](take_view/base.md.nolink) | `V`の参照を取得する | C++20 | -| [`begin`](take_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++20 | -| [`end`](take_view/end.md.nolink) | 番兵を取得する | C++20 | -| [`size`](take_view/size.md.nolink) | 要素数を取得する | C++20 | +| [`(constructor)`](take_view/op_constructor.md) | コンストラクタ | C++20 | +| [`base`](take_view/base.md) | `V`の参照を取得する | C++20 | +| [`begin`](take_view/begin.md) | 先頭を指すイテレータを取得する | C++20 | +| [`end`](take_view/end.md) | 番兵を取得する | C++20 | +| [`size`](take_view/size.md) | 要素数を取得する | C++20 | `r`を元のRangeとする。`size`は[`ranges::size`](size.md)`(r)`が有効な式であるときに定義される。 @@ -78,7 +78,7 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |-------------------------------------------------------|------------------------------|----------------| -| [`(deduction_guide)`](take_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++20 | +| [`(deduction_guide)`](take_view/op_deduction_guide.md) | クラステンプレートの推論補助 | C++20 | ## 使用上の注意 diff --git a/reference/ranges/take_view/base.md b/reference/ranges/take_view/base.md new file mode 100644 index 0000000000..b0303b718e --- /dev/null +++ b/reference/ranges/take_view/base.md @@ -0,0 +1,67 @@ +# base +* ranges[meta header] +* std::ranges[meta namespace] +* take_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr V base() const & + requires copy_constructible; // (1) C++20 + +constexpr V base() &&; // (2) C++20 +``` + +## 概要 + +メンバ変数として保持している、元の`view`を取得する。 + +## 効果 + +入力`view`(`V`)のオブジェクトを`base_`というメンバに保持するとして + +- (1) : `return base_;` と等価 +- (2) : `return std::move(base_);` と等価 + +## 例 + +```cpp example +#include +#include +#include + +int main() { + using std::ranges::view; + + std::vector vec = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + + std::ranges::take_view r{vec, 5}; + + // (1) コピーして取得 + view auto b1 = r.base(); + + // (2) ムーブして取得 + view auto b2 = std::move(r).base(); + + // 得られるのは元のRangeではなく、あくまでview + static_assert(not std::same_as>); + static_assert( std::same_as>>); + static_assert( std::same_as>>); +} +``` +* base[color ff0000] + +### 出力 + +``` +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file diff --git a/reference/ranges/take_view/begin.md b/reference/ranges/take_view/begin.md new file mode 100644 index 0000000000..4dd933fbd8 --- /dev/null +++ b/reference/ranges/take_view/begin.md @@ -0,0 +1,62 @@ +# begin +* ranges[meta header] +* std::ranges[meta namespace] +* take_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr auto begin() + requires (!simple-view); // (1) C++20 + +constexpr auto begin() const + requires range; // (2) C++20 +``` + +## 概要 + +`view`の先頭要素を指すイテレータを取得する。 + +## 戻り値 +- (1), (2) : 以下と等価: + ```cpp + return ranges::begin(base_); + ``` + +ただし、`base_`は元の`view`を表すメンバ変数。 + +## 例 + +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + + std::ranges::take_view r{vec, 5}; + + auto it = r.begin(); + + int x = *it; + std::cout << x << '\n'; +} +``` +* begin[color ff0000] + +### 出力 + +``` +1 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file diff --git a/reference/ranges/take_view/end.md b/reference/ranges/take_view/end.md new file mode 100644 index 0000000000..3fc578807b --- /dev/null +++ b/reference/ranges/take_view/end.md @@ -0,0 +1,74 @@ +# end +* ranges[meta header] +* std::ranges[meta namespace] +* take_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr auto end() + requires (!simple-view); // (1) C++20 + +constexpr auto end() const + requires range; // (2) C++20 +``` + +## 概要 +番兵を取得する。 + +## 戻り値 +入力が[`sized_range`](../sized_range.md)かつ[`random_access_range`](../random_access_range.md)の場合: +- (1), (2) : 以下と等価: + ```cpp + return ranges::begin(base_) + min(ranges::size(base_), count_); + ``` + ここで、`D`は[`range_difference_t`](../range_difference_t.md)``。 + +それ以外の場合: +- (1), (2) : 以下と等価: + ```cpp + return counted_iterator{ranges::begin(base_), count_}; + ``` + +ただし、`base_`は元の`view`を表すメンバ変数、`count_`は取得する要素数を表すメンバ変数。 + +## 例 + +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + + std::ranges::take_view r{vec, 5}; + + auto it = r.begin(); + auto end_it = r.end(); + while (it != end_it) { + int x = *it; + std::cout << x << " "; + ++it; + } + std::cout << std::endl; +} +``` +* end[color ff0000] +* begin[link begin.md] + +### 出力 + +``` +1 2 3 4 5 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file diff --git a/reference/ranges/take_view/op_constructor.md b/reference/ranges/take_view/op_constructor.md new file mode 100644 index 0000000000..1f371354a4 --- /dev/null +++ b/reference/ranges/take_view/op_constructor.md @@ -0,0 +1,63 @@ +# コンストラクタ +* ranges[meta header] +* std::ranges[meta namespace] +* take_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +take_view() + requires default_initializable = default; // (1) C++20 + +constexpr explicit + take_view(V base, range_difference_t count); // (2) C++20 +``` + +## 概要 + +[`take_view`](../take_view.md)オブジェクトを構築する。 + +- (1) : デフォルト構築 +- (2) : 元となるviewと取得する要素数を指定して構築 + +## 効果 + +- (1) : `base_`と`count_`をデフォルト構築する +- (2) : `base_`を`std::move(base)`で、`count_`を`count`で初期化する + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + + std::ranges::take_view view{vec, 5}; + for (const auto& x : view) { + std::cout << x << " "; + } + std::cout << std::endl; +} +``` +* take_view[color ff0000] + +### 出力 +``` +1 2 3 4 5 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4861 24.7.10 Take view](https://timsong-cpp.github.io/cppwp/n4861/range.take) +- [N4950 26.7.14 Take view](https://timsong-cpp.github.io/cppwp/n4950/range.take) \ No newline at end of file diff --git a/reference/ranges/take_view/op_deduction_guide.md b/reference/ranges/take_view/op_deduction_guide.md new file mode 100644 index 0000000000..ede2a16831 --- /dev/null +++ b/reference/ranges/take_view/op_deduction_guide.md @@ -0,0 +1,55 @@ +# 推論補助 +* ranges[meta header] +* std::ranges[meta namespace] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +namespace std::ranges { + template + take_view(R&&, range_difference_t) -> take_view>; +} +``` + +## 概要 + +[`take_view`](../take_view.md)クラステンプレートの型推論補助。 + +この推論補助によって、元のRangeが暗黙的に[all view](../all.md)でラップされる。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + + std::ranges::take_view r1{vec, 5}; + static_assert(std::same_as< + decltype(r1), + std::ranges::take_view>> + >); + + std::ranges::take_view r2{std::vector{1, 2, 3, 4, 5}, 3}; + static_assert(std::same_as< + decltype(r2), + std::ranges::take_view>> + >); +} +``` + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file diff --git a/reference/ranges/take_view/size.md b/reference/ranges/take_view/size.md new file mode 100644 index 0000000000..97866e7500 --- /dev/null +++ b/reference/ranges/take_view/size.md @@ -0,0 +1,60 @@ +# size +* ranges[meta header] +* std::ranges[meta namespace] +* take_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr auto size() + requires sized_range; // (1) C++20 + +constexpr auto size() const + requires sized_range; // (2) C++20 +``` + +## 概要 +要素数を取得する。 + +## 効果 +入力`view`(`V`)のオブジェクトを`base_`、取得する要素数を`count_`というメンバに保持するとして、以下と等価: + +```cpp +auto n = ranges::size(base_); +return min(n, static_cast(count_)); +``` +* min[link /reference/algorithm/min.md] + +ここで、`D`は`decltype(n)`。 + +## 例 + +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + std::ranges::take_view r{vec, 5}; + + std::size_t n = r.size(); + std::cout << n << std::endl; +} +``` +* size[color ff0000] + +### 出力 +``` +5 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file diff --git a/reference/ranges/zip_transform_view.md b/reference/ranges/zip_transform_view.md index 93a6dda402..314dee467b 100644 --- a/reference/ranges/zip_transform_view.md +++ b/reference/ranges/zip_transform_view.md @@ -54,7 +54,7 @@ zipするRangeのサイズが異なっている場合、`zip_transform_view`の | [`(constructor)`](zip_transform_view/op_constructor.md.nolink) | コンストラクタ | C++23 | | [`begin`](zip_transform_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++23 | | [`end`](zip_transform_view/end.md.nolink) | 番兵を取得する | C++23 | -| [`size`](take_view/size.md.nolink) | 要素数を取得する | C++23 | +| [`size`](zip_transform_view/size.md.nolink) | 要素数を取得する | C++23 | ## 継承しているメンバ関数 From 85980d0f72416acc7e893a120f38db28b76d2cf0 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 2 Jun 2025 15:56:37 +0900 Subject: [PATCH 1827/3948] =?UTF-8?q?take=5Fwhile=5Fview=20:=20=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=90=E9=96=A2=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/take_while_view.md | 12 ++-- reference/ranges/take_while_view/base.md | 67 ++++++++++++++++++ reference/ranges/take_while_view/begin.md | 66 +++++++++++++++++ reference/ranges/take_while_view/end.md | 70 +++++++++++++++++++ .../ranges/take_while_view/op_constructor.md | 60 ++++++++++++++++ .../take_while_view/op_deduction_guide.md | 56 +++++++++++++++ reference/ranges/take_while_view/pred.md | 58 +++++++++++++++ 7 files changed, 383 insertions(+), 6 deletions(-) create mode 100644 reference/ranges/take_while_view/base.md create mode 100644 reference/ranges/take_while_view/begin.md create mode 100644 reference/ranges/take_while_view/end.md create mode 100644 reference/ranges/take_while_view/op_constructor.md create mode 100644 reference/ranges/take_while_view/op_deduction_guide.md create mode 100644 reference/ranges/take_while_view/pred.md diff --git a/reference/ranges/take_while_view.md b/reference/ranges/take_while_view.md index 4a26432ef9..00eb02cc41 100644 --- a/reference/ranges/take_while_view.md +++ b/reference/ranges/take_while_view.md @@ -49,11 +49,11 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |--------------------------------------------------------------|----------------------------------|----------------| -| [`(constructor)`](take_while_view/op_constructor.md.nolink) | コンストラクタ | C++20 | -| [`base`](take_while_view/base.md.nolink) | `V`の参照を取得する | C++20 | -| [`pred`](take_while_view/pred.md.nolink) | 述語を取得する | C++20 | -| [`begin`](take_while_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++20 | -| [`end`](take_while_view/end.md.nolink) | 番兵を取得する | C++20 | +| [`(constructor)`](take_while_view/op_constructor.md) | コンストラクタ | C++20 | +| [`base`](take_while_view/base.md) | `V`の参照を取得する | C++20 | +| [`pred`](take_while_view/pred.md) | 述語を取得する | C++20 | +| [`begin`](take_while_view/begin.md) | 先頭を指すイテレータを取得する | C++20 | +| [`end`](take_while_view/end.md) | 番兵を取得する | C++20 | ## 継承しているメンバ関数 @@ -72,7 +72,7 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |-------------------------------------------------------|------------------------------|----------------| -| [`(deduction_guide)`](take_while_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++20 | +| [`(deduction_guide)`](take_while_view/op_deduction_guide.md) | クラステンプレートの推論補助 | C++20 | ## 例 ```cpp example diff --git a/reference/ranges/take_while_view/base.md b/reference/ranges/take_while_view/base.md new file mode 100644 index 0000000000..18267e18de --- /dev/null +++ b/reference/ranges/take_while_view/base.md @@ -0,0 +1,67 @@ +# base +* ranges[meta header] +* std::ranges[meta namespace] +* take_while_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr V base() const & + requires copy_constructible; // (1) C++20 + +constexpr V base() &&; // (2) C++20 +``` + +## 概要 + +メンバ変数として保持している、元の`view`を取得する。 + +## 効果 + +入力`view`(`V`)のオブジェクトを`base_`というメンバに保持するとして + +- (1) : `return base_;` と等価 +- (2) : `return std::move(base_);` と等価 + +## 例 + +```cpp example +#include +#include +#include + +int main() { + using std::ranges::view; + + std::vector vec = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + + std::ranges::take_while_view r{vec, [](int x) { return x < 6; }}; + + // (1) コピーして取得 + view auto b1 = r.base(); + + // (2) ムーブして取得 + view auto b2 = std::move(r).base(); + + // 得られるのは元のRangeではなく、あくまでview + static_assert(not std::same_as>); + static_assert( std::same_as>>); + static_assert( std::same_as>>); +} +``` +* base[color ff0000] + +### 出力 + +``` +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file diff --git a/reference/ranges/take_while_view/begin.md b/reference/ranges/take_while_view/begin.md new file mode 100644 index 0000000000..25c138e066 --- /dev/null +++ b/reference/ranges/take_while_view/begin.md @@ -0,0 +1,66 @@ +# begin +* ranges[meta header] +* std::ranges[meta namespace] +* take_while_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr auto begin() + requires (!simple-view); // (1) C++20 + +constexpr auto begin() const + requires range && + indirect_unary_predicate< + const Pred, + iterator_t + >; // (2) C++20 +``` + +## 概要 + +`view`の先頭要素を指すイテレータを取得する。 + +## 戻り値 +- (1), (2) : 以下と等価: + ```cpp + return ranges::begin(base_); + ``` + +ただし、`base_`は元の`view`を表すメンバ変数。 + +## 例 + +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + + std::ranges::take_while_view r{vec, [](int x) { return x < 6; }}; + + auto it = r.begin(); + + int x = *it; + std::cout << x << '\n'; +} +``` +* begin[color ff0000] + +### 出力 + +``` +1 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file diff --git a/reference/ranges/take_while_view/end.md b/reference/ranges/take_while_view/end.md new file mode 100644 index 0000000000..c01d6fc46c --- /dev/null +++ b/reference/ranges/take_while_view/end.md @@ -0,0 +1,70 @@ +# end +* ranges[meta header] +* std::ranges[meta namespace] +* take_while_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr auto end() + requires (!simple-view); // (1) C++20 + +constexpr auto end() const + requires range && + indirect_unary_predicate< + const Pred, + iterator_t + >; // (2) C++20 +``` + +## 概要 +番兵を取得する。 + +## 戻り値 +- (1), (2) : 以下と等価: + ```cpp + return ranges::end(base_); + ``` + +ただし、`base_`は元の`view`を表すメンバ変数。 + +## 例 + +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + + std::ranges::take_while_view r{vec, [](int x) { return x < 6; }}; + + auto it = r.begin(); + auto end_it = r.end(); + while (it != end_it) { + int x = *it; + std::cout << x << " "; + ++it; + } + std::cout << std::endl; +} +``` +* end[color ff0000] +* begin[link begin.md] + +### 出力 + +``` +1 2 3 4 5 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file diff --git a/reference/ranges/take_while_view/op_constructor.md b/reference/ranges/take_while_view/op_constructor.md new file mode 100644 index 0000000000..b1f3c10d4a --- /dev/null +++ b/reference/ranges/take_while_view/op_constructor.md @@ -0,0 +1,60 @@ +# コンストラクタ +* ranges[meta header] +* std::ranges[meta namespace] +* take_while_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +take_while_view() + requires default_initializable && + default_initializable = default; // (1) C++20 + +constexpr explicit + take_while_view(V base, Pred pred); // (2) C++20 +``` + +## 概要 + +[`take_while_view`](../take_while_view.md)オブジェクトを構築する。 + +- (1) : デフォルト構築 +- (2) : 元となるviewと述語を指定して構築 + +## 効果 + +- (1) : `base_`と`pred_`をデフォルト構築する +- (2) : `base_`を`std::move(base)`で、`pred_`を`std::move(pred)`で初期化する + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + + std::ranges::take_while_view view{vec, [](int x) { return x < 6; }}; + for (const auto& x : view) { + std::cout << x << " "; + } + std::cout << std::endl; +} +``` +* take_while_view[color ff0000] + +### 出力 +``` +1 2 3 4 5 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file diff --git a/reference/ranges/take_while_view/op_deduction_guide.md b/reference/ranges/take_while_view/op_deduction_guide.md new file mode 100644 index 0000000000..318327942a --- /dev/null +++ b/reference/ranges/take_while_view/op_deduction_guide.md @@ -0,0 +1,56 @@ +# 推論補助 +* ranges[meta header] +* std::ranges[meta namespace] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +namespace std::ranges { + template + take_while_view(R&&, Pred) -> take_while_view, Pred>; +} +``` + +## 概要 + +[`take_while_view`](../take_while_view.md)クラステンプレートの型推論補助。 + +この推論補助によって、元のRangeが暗黙的に[all view](../all.md)でラップされる。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + auto pred = [](int x) { return x < 6; }; + + std::ranges::take_while_view r1{vec, pred}; + static_assert(std::same_as< + decltype(r1), + std::ranges::take_while_view>, decltype(pred)> + >); + + std::ranges::take_while_view r2{std::vector{1, 2, 3, 4, 5}, pred}; + static_assert(std::same_as< + decltype(r2), + std::ranges::take_while_view>, decltype(pred)> + >); +} +``` + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file diff --git a/reference/ranges/take_while_view/pred.md b/reference/ranges/take_while_view/pred.md new file mode 100644 index 0000000000..e39dbd2c0a --- /dev/null +++ b/reference/ranges/take_while_view/pred.md @@ -0,0 +1,58 @@ +# pred +* ranges[meta header] +* std::ranges[meta namespace] +* take_while_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr const Pred& pred() const; +``` + +## 概要 + +メンバ変数として保持している述語を取得する。 + +## 戻り値 + +述語`Pred`のオブジェクトを[`movable-box`](../movable_box.md)(C++20は[`copyable-box`](../copyable_box.md))でラップした `pred_`というメンバに保持するとして + +```cpp +return *pred_; +``` + +## 例 + +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + + std::ranges::take_while_view twv{vec, [](int i) { return i < 6; }}; + + std::cout << twv.pred()(3) << '\n'; + std::cout << twv.pred()(7) << '\n'; +} +``` +* pred[color ff0000] +* take_while_view[link ../take_while_view.md] + +### 出力 + +``` +1 +0 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file From 23b7fdfde3262c3441b275ef321b034c7be64049 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 2 Jun 2025 16:13:42 +0900 Subject: [PATCH 1828/3948] =?UTF-8?q?drop=5Fview=20:=20=E3=83=A1=E3=83=B3?= =?UTF-8?q?=E3=83=90=E9=96=A2=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/drop_view.md | 12 ++-- reference/ranges/drop_view/base.md | 67 ++++++++++++++++++ reference/ranges/drop_view/begin.md | 70 +++++++++++++++++++ reference/ranges/drop_view/end.md | 66 +++++++++++++++++ reference/ranges/drop_view/op_constructor.md | 59 ++++++++++++++++ .../ranges/drop_view/op_deduction_guide.md | 55 +++++++++++++++ reference/ranges/drop_view/size.md | 59 ++++++++++++++++ 7 files changed, 382 insertions(+), 6 deletions(-) create mode 100644 reference/ranges/drop_view/base.md create mode 100644 reference/ranges/drop_view/begin.md create mode 100644 reference/ranges/drop_view/end.md create mode 100644 reference/ranges/drop_view/op_constructor.md create mode 100644 reference/ranges/drop_view/op_deduction_guide.md create mode 100644 reference/ranges/drop_view/size.md diff --git a/reference/ranges/drop_view.md b/reference/ranges/drop_view.md index 0d7fc58912..56a88433f3 100644 --- a/reference/ranges/drop_view.md +++ b/reference/ranges/drop_view.md @@ -53,11 +53,11 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |--------------------------------------------------|----------------------------------|----------------| -| [`(constructor)`](drop_view/op_constructor.md.nolink) | コンストラクタ | C++20 | -| [`base`](drop_view/base.md.nolink) | `V`の参照を取得する | C++20 | -| [`begin`](drop_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++20 | -| [`end`](drop_view/end.md.nolink) | 番兵を取得する | C++20 | -| [`size`](drop_view/size.md.nolink) | 要素数を取得する | C++20 | +| [`(constructor)`](drop_view/op_constructor.md) | コンストラクタ | C++20 | +| [`base`](drop_view/base.md) | `V`の参照を取得する | C++20 | +| [`begin`](drop_view/begin.md) | 先頭を指すイテレータを取得する | C++20 | +| [`end`](drop_view/end.md) | 番兵を取得する | C++20 | +| [`size`](drop_view/size.md) | 要素数を取得する | C++20 | `r`を元のRangeとする。`size`は[`ranges::size`](size.md)`(r)`が有効な式であるときに定義される。 @@ -78,7 +78,7 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |-------------------------------------------------------|------------------------------|----------------| -| [`(deduction_guide)`](drop_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++20 | +| [`(deduction_guide)`](drop_view/op_deduction_guide.md) | クラステンプレートの推論補助 | C++20 | ## 例 ```cpp example diff --git a/reference/ranges/drop_view/base.md b/reference/ranges/drop_view/base.md new file mode 100644 index 0000000000..933c36b6e9 --- /dev/null +++ b/reference/ranges/drop_view/base.md @@ -0,0 +1,67 @@ +# base +* ranges[meta header] +* std::ranges[meta namespace] +* drop_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr V base() const & + requires copy_constructible; // (1) C++20 + +constexpr V base() &&; // (2) C++20 +``` + +## 概要 + +メンバ変数として保持している、元の`view`を取得する。 + +## 効果 + +入力`view`(`V`)のオブジェクトを`base_`というメンバに保持するとして + +- (1) : `return base_;` と等価 +- (2) : `return std::move(base_);` と等価 + +## 例 + +```cpp example +#include +#include +#include + +int main() { + using std::ranges::view; + + std::vector vec = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + + std::ranges::drop_view r{vec, 5}; + + // (1) コピーして取得 + view auto b1 = r.base(); + + // (2) ムーブして取得 + view auto b2 = std::move(r).base(); + + // 得られるのは元のRangeではなく、あくまでview + static_assert(not std::same_as>); + static_assert( std::same_as>>); + static_assert( std::same_as>>); +} +``` +* base[color ff0000] + +### 出力 + +``` +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file diff --git a/reference/ranges/drop_view/begin.md b/reference/ranges/drop_view/begin.md new file mode 100644 index 0000000000..0fe7e7feae --- /dev/null +++ b/reference/ranges/drop_view/begin.md @@ -0,0 +1,70 @@ +# begin +* ranges[meta header] +* std::ranges[meta namespace] +* drop_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr auto begin() + requires (!simple-view); // (1) C++20 + +constexpr auto begin() const + requires range; // (2) C++20 +``` + +## 概要 + +`view`の先頭要素を指すイテレータを取得する。 + +## 戻り値 +入力が[`random_access_range`](../random_access_range.md)かつ[`sized_range`](../sized_range.md)の場合: +- (1), (2) : 以下と等価: + ```cpp + return ranges::begin(base_) + min(ranges::size(base_), count_); + ``` + ここで、`D`は[`range_difference_t`](../range_difference_t.md)``。 + +それ以外の場合: +- (1), (2) : 以下と等価: + ```cpp + return ranges::next(ranges::begin(base_), count_, ranges::end(base_)); + ``` + +ただし、`base_`は元の`view`を表すメンバ変数、`count_`は除去する要素数を表すメンバ変数。 + +## 例 + +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + + std::ranges::drop_view r{vec, 5}; + + auto it = r.begin(); + + int x = *it; + std::cout << x << '\n'; +} +``` +* begin[color ff0000] + +### 出力 + +``` +6 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file diff --git a/reference/ranges/drop_view/end.md b/reference/ranges/drop_view/end.md new file mode 100644 index 0000000000..8a7872dda4 --- /dev/null +++ b/reference/ranges/drop_view/end.md @@ -0,0 +1,66 @@ +# end +* ranges[meta header] +* std::ranges[meta namespace] +* drop_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr auto end() + requires (!simple-view); // (1) C++20 + +constexpr auto end() const + requires range; // (2) C++20 +``` + +## 概要 +番兵を取得する。 + +## 戻り値 +- (1), (2) : 以下と等価: + ```cpp + return ranges::end(base_); + ``` + +ただし、`base_`は元の`view`を表すメンバ変数。 + +## 例 + +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + + std::ranges::drop_view r{vec, 5}; + + auto it = r.begin(); + auto end_it = r.end(); + while (it != end_it) { + int x = *it; + std::cout << x << " "; + ++it; + } + std::cout << std::endl; +} +``` +* end[color ff0000] +* begin[link begin.md] + +### 出力 + +``` +6 7 8 9 10 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file diff --git a/reference/ranges/drop_view/op_constructor.md b/reference/ranges/drop_view/op_constructor.md new file mode 100644 index 0000000000..7785416756 --- /dev/null +++ b/reference/ranges/drop_view/op_constructor.md @@ -0,0 +1,59 @@ +# コンストラクタ +* ranges[meta header] +* std::ranges[meta namespace] +* drop_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +drop_view() + requires default_initializable = default; // (1) C++20 + +constexpr explicit + drop_view(V base, range_difference_t count); // (2) C++20 +``` + +## 概要 + +[`drop_view`](../drop_view.md)オブジェクトを構築する。 + +- (1) : デフォルト構築 +- (2) : 元となるviewと除去する要素数を指定して構築 + +## 効果 + +- (1) : `base_`と`count_`をデフォルト構築する +- (2) : `base_`を`std::move(base)`で、`count_`を`count`で初期化する + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + + std::ranges::drop_view view{vec, 5}; + for (const auto& x : view) { + std::cout << x << " "; + } + std::cout << std::endl; +} +``` +* drop_view[color ff0000] + +### 出力 +``` +6 7 8 9 10 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file diff --git a/reference/ranges/drop_view/op_deduction_guide.md b/reference/ranges/drop_view/op_deduction_guide.md new file mode 100644 index 0000000000..d74629dac5 --- /dev/null +++ b/reference/ranges/drop_view/op_deduction_guide.md @@ -0,0 +1,55 @@ +# 推論補助 +* ranges[meta header] +* std::ranges[meta namespace] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +namespace std::ranges { + template + drop_view(R&&, range_difference_t) -> drop_view>; +} +``` + +## 概要 + +[`drop_view`](../drop_view.md)クラステンプレートの型推論補助。 + +この推論補助によって、元のRangeが暗黙的に[all view](../all.md)でラップされる。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + + std::ranges::drop_view r1{vec, 5}; + static_assert(std::same_as< + decltype(r1), + std::ranges::drop_view>> + >); + + std::ranges::drop_view r2{std::vector{1, 2, 3, 4, 5}, 3}; + static_assert(std::same_as< + decltype(r2), + std::ranges::drop_view>> + >); +} +``` + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file diff --git a/reference/ranges/drop_view/size.md b/reference/ranges/drop_view/size.md new file mode 100644 index 0000000000..5860f5afd1 --- /dev/null +++ b/reference/ranges/drop_view/size.md @@ -0,0 +1,59 @@ +# size +* ranges[meta header] +* std::ranges[meta namespace] +* drop_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr auto size() + requires sized_range; // (1) C++20 + +constexpr auto size() const + requires sized_range; // (2) C++20 +``` + +## 概要 +要素数を取得する。 + +## 効果 +入力`view`(`V`)のオブジェクトを`base_`、除去する要素数を`count_`というメンバに保持するとして、以下と等価: + +```cpp +auto n = ranges::size(base_); +auto c = static_cast(count_); +return n - min(n, c); +``` +* min[link /reference/algorithm/min.md] + +## 例 + +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + std::ranges::drop_view r{vec, 5}; + + std::size_t n = r.size(); + std::cout << n << std::endl; +} +``` +* size[color ff0000] + +### 出力 +``` +5 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file From ff88ad34e03665713ad8edf2c2b5d989111df0b8 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 2 Jun 2025 16:21:12 +0900 Subject: [PATCH 1829/3948] =?UTF-8?q?drop=5Fwhile=5Fview=20:=20=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=90=E9=96=A2=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 1 + reference/ranges/drop_while_view.md | 12 ++-- reference/ranges/drop_while_view/base.md | 67 ++++++++++++++++++ reference/ranges/drop_while_view/begin.md | 68 ++++++++++++++++++ reference/ranges/drop_while_view/end.md | 70 +++++++++++++++++++ .../ranges/drop_while_view/op_constructor.md | 60 ++++++++++++++++ .../drop_while_view/op_deduction_guide.md | 56 +++++++++++++++ reference/ranges/drop_while_view/pred.md | 58 +++++++++++++++ 8 files changed, 386 insertions(+), 6 deletions(-) create mode 100644 reference/ranges/drop_while_view/base.md create mode 100644 reference/ranges/drop_while_view/begin.md create mode 100644 reference/ranges/drop_while_view/end.md create mode 100644 reference/ranges/drop_while_view/op_constructor.md create mode 100644 reference/ranges/drop_while_view/op_deduction_guide.md create mode 100644 reference/ranges/drop_while_view/pred.md diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index ff0a03d748..146b28a0ee 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -8,6 +8,7 @@ * synth-three-way[link /reference/exposition-only/synth-three-way-result.md] * [link /reference/algorithm.md] * ExecutionPolicy[link /reference/execution/execution/execution_policy.md] + * ranges::find_if_not[link /reference/algorithm/ranges/find_if_not.md] * std::copy[link /reference/algorithm/copy.md] * std::copy_n[link /reference/algorithm/copy_n.md] * std::for_each[link /reference/algorithm/for_each.md] diff --git a/reference/ranges/drop_while_view.md b/reference/ranges/drop_while_view.md index 2c94c9965b..6230260000 100644 --- a/reference/ranges/drop_while_view.md +++ b/reference/ranges/drop_while_view.md @@ -49,11 +49,11 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |--------------------------------------------------------------|----------------------------------|----------------| -| [`(constructor)`](drop_while_view/op_constructor.md.nolink) | コンストラクタ | C++20 | -| [`base`](drop_while_view/base.md.nolink) | `V`の参照を取得する | C++20 | -| [`pred`](drop_while_view/pred.md.nolink) | 述語を取得する | C++20 | -| [`begin`](drop_while_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++20 | -| [`end`](drop_while_view/end.md.nolink) | 番兵を取得する | C++20 | +| [`(constructor)`](drop_while_view/op_constructor.md) | コンストラクタ | C++20 | +| [`base`](drop_while_view/base.md) | `V`の参照を取得する | C++20 | +| [`pred`](drop_while_view/pred.md) | 述語を取得する | C++20 | +| [`begin`](drop_while_view/begin.md) | 先頭を指すイテレータを取得する | C++20 | +| [`end`](drop_while_view/end.md) | 番兵を取得する | C++20 | ## 継承しているメンバ関数 @@ -72,7 +72,7 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |-------------------------------------------------------|------------------------------|----------------| -| [`(deduction_guide)`](drop_while_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++20 | +| [`(deduction_guide)`](drop_while_view/op_deduction_guide.md) | クラステンプレートの推論補助 | C++20 | ## 例 ```cpp example diff --git a/reference/ranges/drop_while_view/base.md b/reference/ranges/drop_while_view/base.md new file mode 100644 index 0000000000..66dcfca3be --- /dev/null +++ b/reference/ranges/drop_while_view/base.md @@ -0,0 +1,67 @@ +# base +* ranges[meta header] +* std::ranges[meta namespace] +* drop_while_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr V base() const & + requires copy_constructible; // (1) C++20 + +constexpr V base() &&; // (2) C++20 +``` + +## 概要 + +メンバ変数として保持している、元の`view`を取得する。 + +## 効果 + +入力`view`(`V`)のオブジェクトを`base_`というメンバに保持するとして + +- (1) : `return base_;` と等価 +- (2) : `return std::move(base_);` と等価 + +## 例 + +```cpp example +#include +#include +#include + +int main() { + using std::ranges::view; + + std::vector vec = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + + std::ranges::drop_while_view r{vec, [](int x) { return x < 6; }}; + + // (1) コピーして取得 + view auto b1 = r.base(); + + // (2) ムーブして取得 + view auto b2 = std::move(r).base(); + + // 得られるのは元のRangeではなく、あくまでview + static_assert(not std::same_as>); + static_assert( std::same_as>>); + static_assert( std::same_as>>); +} +``` +* base[color ff0000] + +### 出力 + +``` +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file diff --git a/reference/ranges/drop_while_view/begin.md b/reference/ranges/drop_while_view/begin.md new file mode 100644 index 0000000000..d346ddcade --- /dev/null +++ b/reference/ranges/drop_while_view/begin.md @@ -0,0 +1,68 @@ +# begin +* ranges[meta header] +* std::ranges[meta namespace] +* drop_while_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr auto begin() + requires (!simple-view); // (1) C++20 + +constexpr auto begin() const + requires range && + indirect_unary_predicate< + const Pred, + iterator_t + >; // (2) C++20 +``` + +## 概要 + +`view`の先頭要素を指すイテレータを取得する。 + +## 戻り値 +先頭から条件を満たさない最初の要素を指すイテレータを返す。 + +- (1), (2) : 実装時にキャッシュした結果を返すか、以下と等価: + ```cpp + return ranges::find_if_not(ranges::begin(base_), ranges::end(base_), pred_); + ``` + +ただし、`base_`は元の`view`を表すメンバ変数、`pred_`は述語を表すメンバ変数。 + +## 例 + +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + + std::ranges::drop_while_view r{vec, [](int x) { return x < 6; }}; + + auto it = r.begin(); + + int x = *it; + std::cout << x << '\n'; +} +``` +* begin[color ff0000] + +### 出力 + +``` +6 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file diff --git a/reference/ranges/drop_while_view/end.md b/reference/ranges/drop_while_view/end.md new file mode 100644 index 0000000000..4866fcacc4 --- /dev/null +++ b/reference/ranges/drop_while_view/end.md @@ -0,0 +1,70 @@ +# end +* ranges[meta header] +* std::ranges[meta namespace] +* drop_while_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr auto end() + requires (!simple-view); // (1) C++20 + +constexpr auto end() const + requires range && + indirect_unary_predicate< + const Pred, + iterator_t + >; // (2) C++20 +``` + +## 概要 +番兵を取得する。 + +## 戻り値 +- (1), (2) : 以下と等価: + ```cpp + return ranges::end(base_); + ``` + +ただし、`base_`は元の`view`を表すメンバ変数。 + +## 例 + +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + + std::ranges::drop_while_view r{vec, [](int x) { return x < 6; }}; + + auto it = r.begin(); + auto end_it = r.end(); + while (it != end_it) { + int x = *it; + std::cout << x << " "; + ++it; + } + std::cout << std::endl; +} +``` +* end[color ff0000] +* begin[link begin.md] + +### 出力 + +``` +6 7 8 9 10 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file diff --git a/reference/ranges/drop_while_view/op_constructor.md b/reference/ranges/drop_while_view/op_constructor.md new file mode 100644 index 0000000000..9e06d2d067 --- /dev/null +++ b/reference/ranges/drop_while_view/op_constructor.md @@ -0,0 +1,60 @@ +# コンストラクタ +* ranges[meta header] +* std::ranges[meta namespace] +* drop_while_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +drop_while_view() + requires default_initializable && + default_initializable = default; // (1) C++20 + +constexpr explicit + drop_while_view(V base, Pred pred); // (2) C++20 +``` + +## 概要 + +[`drop_while_view`](../drop_while_view.md)オブジェクトを構築する。 + +- (1) : デフォルト構築 +- (2) : 元となるviewと述語を指定して構築 + +## 効果 + +- (1) : `base_`と`pred_`をデフォルト構築する +- (2) : `base_`を`std::move(base)`で、`pred_`を`std::move(pred)`で初期化する + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + + std::ranges::drop_while_view view{vec, [](int x) { return x < 6; }}; + for (const auto& x : view) { + std::cout << x << " "; + } + std::cout << std::endl; +} +``` +* drop_while_view[color ff0000] + +### 出力 +``` +6 7 8 9 10 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file diff --git a/reference/ranges/drop_while_view/op_deduction_guide.md b/reference/ranges/drop_while_view/op_deduction_guide.md new file mode 100644 index 0000000000..acb96db841 --- /dev/null +++ b/reference/ranges/drop_while_view/op_deduction_guide.md @@ -0,0 +1,56 @@ +# 推論補助 +* ranges[meta header] +* std::ranges[meta namespace] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +namespace std::ranges { + template + drop_while_view(R&&, Pred) -> drop_while_view, Pred>; +} +``` + +## 概要 + +[`drop_while_view`](../drop_while_view.md)クラステンプレートの型推論補助。 + +この推論補助によって、元のRangeが暗黙的に[all view](../all.md)でラップされる。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + auto pred = [](int x) { return x < 6; }; + + std::ranges::drop_while_view r1{vec, pred}; + static_assert(std::same_as< + decltype(r1), + std::ranges::drop_while_view>, decltype(pred)> + >); + + std::ranges::drop_while_view r2{std::vector{1, 2, 3, 4, 5}, pred}; + static_assert(std::same_as< + decltype(r2), + std::ranges::drop_while_view>, decltype(pred)> + >); +} +``` + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file diff --git a/reference/ranges/drop_while_view/pred.md b/reference/ranges/drop_while_view/pred.md new file mode 100644 index 0000000000..3c864b1108 --- /dev/null +++ b/reference/ranges/drop_while_view/pred.md @@ -0,0 +1,58 @@ +# pred +* ranges[meta header] +* std::ranges[meta namespace] +* drop_while_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr const Pred& pred() const; +``` + +## 概要 + +メンバ変数として保持している述語を取得する。 + +## 戻り値 + +述語`Pred`のオブジェクトを[`movable-box`](../movable_box.md)(C++20は[`copyable-box`](../copyable_box.md))でラップした `pred_`というメンバに保持するとして + +```cpp +return *pred_; +``` + +## 例 + +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + + std::ranges::drop_while_view dwv{vec, [](int i) { return i < 6; }}; + + std::cout << dwv.pred()(3) << '\n'; + std::cout << dwv.pred()(7) << '\n'; +} +``` +* pred[color ff0000] +* drop_while_view[link ../drop_while_view.md] + +### 出力 + +``` +1 +0 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file From a5b62f32b154d09ed36609f2eb1a89c5faa061bd Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 2 Jun 2025 16:28:54 +0900 Subject: [PATCH 1830/3948] =?UTF-8?q?join=5Fview=20:=20=E3=83=A1=E3=83=B3?= =?UTF-8?q?=E3=83=90=E9=96=A2=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/join_view.md | 10 +-- reference/ranges/join_view/base.md | 68 +++++++++++++++++++ reference/ranges/join_view/begin.md | 59 ++++++++++++++++ reference/ranges/join_view/end.md | 63 +++++++++++++++++ reference/ranges/join_view/op_constructor.md | 59 ++++++++++++++++ .../ranges/join_view/op_deduction_guide.md | 56 +++++++++++++++ 6 files changed, 310 insertions(+), 5 deletions(-) create mode 100644 reference/ranges/join_view/base.md create mode 100644 reference/ranges/join_view/begin.md create mode 100644 reference/ranges/join_view/end.md create mode 100644 reference/ranges/join_view/op_constructor.md create mode 100644 reference/ranges/join_view/op_deduction_guide.md diff --git a/reference/ranges/join_view.md b/reference/ranges/join_view.md index a9a3d5d340..c1ad22bc18 100644 --- a/reference/ranges/join_view.md +++ b/reference/ranges/join_view.md @@ -51,10 +51,10 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |--------------------------------------------------|----------------------------------|----------------| -| [`(constructor)`](join_view/op_constructor.md.nolink) | コンストラクタ | C++20 | -| [`base`](join_view/base.md.nolink) | `V`の参照を取得する | C++20 | -| [`begin`](join_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++20 | -| [`end`](join_view/end.md.nolink) | 番兵を取得する | C++20 | +| [`(constructor)`](join_view/op_constructor.md) | コンストラクタ | C++20 | +| [`base`](join_view/base.md) | `V`の参照を取得する | C++20 | +| [`begin`](join_view/begin.md) | 先頭を指すイテレータを取得する | C++20 | +| [`end`](join_view/end.md) | 番兵を取得する | C++20 | ## 継承しているメンバ関数 @@ -71,7 +71,7 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |-------------------------------------------------------|------------------------------|----------------| -| [`(deduction_guide)`](join_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++20 | +| [`(deduction_guide)`](join_view/op_deduction_guide.md) | クラステンプレートの推論補助 | C++20 | ## 例 ```cpp example diff --git a/reference/ranges/join_view/base.md b/reference/ranges/join_view/base.md new file mode 100644 index 0000000000..923fd03c68 --- /dev/null +++ b/reference/ranges/join_view/base.md @@ -0,0 +1,68 @@ +# base +* ranges[meta header] +* std::ranges[meta namespace] +* join_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr V base() const & + requires copy_constructible; // (1) C++20 + +constexpr V base() &&; // (2) C++20 +``` + +## 概要 + +メンバ変数として保持している、元の`view`を取得する。 + +## 効果 + +入力`view`(`V`)のオブジェクトを`base_`というメンバに保持するとして + +- (1) : `return base_;` と等価 +- (2) : `return std::move(base_);` と等価 + +## 例 + +```cpp example +#include +#include +#include +#include + +int main() { + using std::ranges::view; + + std::vector words = {"hello", "world", "join"}; + + std::ranges::join_view r{words}; + + // (1) コピーして取得 + view auto b1 = r.base(); + + // (2) ムーブして取得 + view auto b2 = std::move(r).base(); + + // 得られるのは元のRangeではなく、あくまでview + static_assert(not std::same_as>); + static_assert( std::same_as>>); + static_assert( std::same_as>>); +} +``` +* base[color ff0000] + +### 出力 + +``` +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file diff --git a/reference/ranges/join_view/begin.md b/reference/ranges/join_view/begin.md new file mode 100644 index 0000000000..7444fdef90 --- /dev/null +++ b/reference/ranges/join_view/begin.md @@ -0,0 +1,59 @@ +# begin +* ranges[meta header] +* std::ranges[meta namespace] +* join_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr auto begin() + requires (!simple-view); // (1) C++20 + +constexpr auto begin() const + requires range && + input_range>; // (2) C++20 +``` + +## 概要 + +`view`の先頭要素を指すイテレータを取得する。 + +## 戻り値 +- (1), (2) : `join_view`の先頭を指すイテレータを返す。外側のRangeが空でない場合、最初の内側Rangeの先頭要素を指す。外側のRangeが空の場合、[`end()`](end.md)と等価なイテレータを返す。 + +## 例 + +```cpp example +#include +#include +#include +#include + +int main() { + std::vector words = {"hello", "world", "join"}; + + std::ranges::join_view r{words}; + + auto it = r.begin(); + + char x = *it; + std::cout << x << '\n'; +} +``` +* begin[color ff0000] + +### 出力 + +``` +h +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file diff --git a/reference/ranges/join_view/end.md b/reference/ranges/join_view/end.md new file mode 100644 index 0000000000..f540b9003d --- /dev/null +++ b/reference/ranges/join_view/end.md @@ -0,0 +1,63 @@ +# end +* ranges[meta header] +* std::ranges[meta namespace] +* join_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr auto end() + requires (!simple-view); // (1) C++20 + +constexpr auto end() const + requires range && + input_range>; // (2) C++20 +``` + +## 概要 +番兵を取得する。 + +## 戻り値 +- (1), (2) : `join_view`の番兵を返す + +## 例 + +```cpp example +#include +#include +#include +#include + +int main() { + std::vector words = {"hello", "world", "join"}; + + std::ranges::join_view r{words}; + + auto it = r.begin(); + auto end_it = r.end(); + while (it != end_it) { + char x = *it; + std::cout << x; + ++it; + } + std::cout << std::endl; +} +``` +* end[color ff0000] +* begin[link begin.md] + +### 出力 + +``` +helloworldjoin +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file diff --git a/reference/ranges/join_view/op_constructor.md b/reference/ranges/join_view/op_constructor.md new file mode 100644 index 0000000000..81f89d576b --- /dev/null +++ b/reference/ranges/join_view/op_constructor.md @@ -0,0 +1,59 @@ +# コンストラクタ +* ranges[meta header] +* std::ranges[meta namespace] +* join_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +join_view() + requires default_initializable = default; // (1) C++20 + +constexpr explicit join_view(V base); // (2) C++20 +``` + +## 概要 + +[`join_view`](../join_view.md)オブジェクトを構築する。 + +- (1) : デフォルト構築 +- (2) : 元となるviewを指定して構築 + +## 効果 + +- (1) : `base_`をデフォルト構築する +- (2) : `base_`を`std::move(base)`で初期化する + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector words = {"hello", "world", "join"}; + + std::ranges::join_view view{words}; + for (char c : view) { + std::cout << c; + } + std::cout << std::endl; +} +``` +* join_view[color ff0000] + +### 出力 +``` +helloworldjoin +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file diff --git a/reference/ranges/join_view/op_deduction_guide.md b/reference/ranges/join_view/op_deduction_guide.md new file mode 100644 index 0000000000..b5e29d85e0 --- /dev/null +++ b/reference/ranges/join_view/op_deduction_guide.md @@ -0,0 +1,56 @@ +# 推論補助 +* ranges[meta header] +* std::ranges[meta namespace] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +namespace std::ranges { + template + join_view(R&&) -> join_view>; +} +``` + +## 概要 + +[`join_view`](../join_view.md)クラステンプレートの型推論補助。 + +この推論補助によって、元のRangeが暗黙的に[all view](../all.md)でラップされる。 + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector words = {"hello", "world", "join"}; + + std::ranges::join_view r1{words}; + static_assert(std::same_as< + decltype(r1), + std::ranges::join_view>> + >); + + std::ranges::join_view r2{std::vector{"a", "b", "c"}}; + static_assert(std::same_as< + decltype(r2), + std::ranges::join_view>> + >); +} +``` + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file From 30dd29ce7dd10b8d4d2541d93293a9aed833bd94 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 2 Jun 2025 17:21:04 +0900 Subject: [PATCH 1831/3948] =?UTF-8?q?join=5Fwith=5Fview=20:=20=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=90=E9=96=A2=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/join_with_view.md | 12 ++-- reference/ranges/join_with_view/base.md | 69 +++++++++++++++++++ reference/ranges/join_with_view/begin.md | 61 ++++++++++++++++ reference/ranges/join_with_view/end.md | 65 +++++++++++++++++ .../ranges/join_with_view/op_constructor.md | 60 ++++++++++++++++ .../join_with_view/op_deduction_guide.md | 66 ++++++++++++++++++ 6 files changed, 327 insertions(+), 6 deletions(-) create mode 100644 reference/ranges/join_with_view/base.md create mode 100644 reference/ranges/join_with_view/begin.md create mode 100644 reference/ranges/join_with_view/end.md create mode 100644 reference/ranges/join_with_view/op_constructor.md create mode 100644 reference/ranges/join_with_view/op_deduction_guide.md diff --git a/reference/ranges/join_with_view.md b/reference/ranges/join_with_view.md index ed47370d6a..222d0f4e84 100644 --- a/reference/ranges/join_with_view.md +++ b/reference/ranges/join_with_view.md @@ -43,7 +43,7 @@ namespace std::ranges { ## 効果 -- (2): 式`views::join_with(E, F)`の効果は[`join_with_view{E, F}`](join_with_view/op_constructor.md.nolink)と等しい。 +- (2): 式`views::join_with(E, F)`の効果は[`join_with_view{E, F}`](join_with_view/op_constructor.md)と等しい。 ## 備考 @@ -66,10 +66,10 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |--------------------------------------------------|----------------------------------|----------------| -| [`(constructor)`](join_with_view/op_constructor.md.nolink) | コンストラクタ | C++23 | -| [`base`](join_with_view/base.md.nolink) | `V`の参照を取得する | C++23 | -| [`begin`](join_with_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++23 | -| [`end`](join_with_view/end.md.nolink) | 番兵を取得する | C++23 | +| [`(constructor)`](join_with_view/op_constructor.md) | コンストラクタ | C++23 | +| [`base`](join_with_view/base.md) | `V`の参照を取得する | C++23 | +| [`begin`](join_with_view/begin.md) | 先頭を指すイテレータを取得する | C++23 | +| [`end`](join_with_view/end.md) | 番兵を取得する | C++23 | ## 継承しているメンバ関数 @@ -86,7 +86,7 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |-------------------------------------------------------|------------------------------|----------------| -| [`(deduction_guide)`](join_with_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | +| [`(deduction_guide)`](join_with_view/op_deduction_guide.md) | クラステンプレートの推論補助 | C++23 | ## 例 ```cpp example diff --git a/reference/ranges/join_with_view/base.md b/reference/ranges/join_with_view/base.md new file mode 100644 index 0000000000..b1f4de3692 --- /dev/null +++ b/reference/ranges/join_with_view/base.md @@ -0,0 +1,69 @@ +# base +* ranges[meta header] +* std::ranges[meta namespace] +* join_with_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr V base() const & + requires copy_constructible; // (1) C++23 + +constexpr V base() &&; // (2) C++23 +``` + +## 概要 + +メンバ変数として保持している、元の`view`を取得する。 + +## 効果 + +入力`view`(`V`)のオブジェクトを`base_`というメンバに保持するとして + +- (1) : `return base_;` と等価 +- (2) : `return std::move(base_);` と等価 + +## 例 + +```cpp example +#include +#include +#include +#include + +int main() { + using std::ranges::view; + + std::vector words = {"hello", "world", "join"}; + std::string delimiter = "-"; + + std::ranges::join_with_view r{words, delimiter}; + + // (1) コピーして取得 + view auto b1 = r.base(); + + // (2) ムーブして取得 + view auto b2 = std::move(r).base(); + + // 得られるのは元のRangeではなく、あくまでview + static_assert(not std::same_as>); + static_assert( std::same_as>>); + static_assert( std::same_as>>); +} +``` +* base[color ff0000] + +### 出力 + +``` +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.2 [mark verified] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file diff --git a/reference/ranges/join_with_view/begin.md b/reference/ranges/join_with_view/begin.md new file mode 100644 index 0000000000..930cb18a02 --- /dev/null +++ b/reference/ranges/join_with_view/begin.md @@ -0,0 +1,61 @@ +# begin +* ranges[meta header] +* std::ranges[meta namespace] +* join_with_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr auto begin() + requires (!simple-view); // (1) C++23 + +constexpr auto begin() const + requires range && + input_range> && + range; // (2) C++23 +``` + +## 概要 + +`view`の先頭要素を指すイテレータを取得する。 + +## 戻り値 +- (1), (2) : `join_with_view`の先頭を指すイテレータを返す。外側のRangeが空でない場合、最初の内側Rangeの先頭要素を指す。外側のRangeが空の場合、[`end()`](end.md)と等価なイテレータを返す。 + +## 例 + +```cpp example +#include +#include +#include +#include + +int main() { + std::vector words = {"hello", "world", "join"}; + std::string delimiter = "-"; + + std::ranges::join_with_view r{words, delimiter}; + + auto it = r.begin(); + + char x = *it; + std::cout << x << '\n'; +} +``` +* begin[color ff0000] + +### 出力 + +``` +h +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.2 [mark verified] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file diff --git a/reference/ranges/join_with_view/end.md b/reference/ranges/join_with_view/end.md new file mode 100644 index 0000000000..cc934046af --- /dev/null +++ b/reference/ranges/join_with_view/end.md @@ -0,0 +1,65 @@ +# end +* ranges[meta header] +* std::ranges[meta namespace] +* join_with_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr auto end() + requires (!simple-view); // (1) C++23 + +constexpr auto end() const + requires range && + input_range> && + range; // (2) C++23 +``` + +## 概要 +番兵を取得する。 + +## 戻り値 +- (1), (2) : `join_with_view`の番兵を返す + +## 例 + +```cpp example +#include +#include +#include +#include + +int main() { + std::vector words = {"hello", "world", "join"}; + std::string delimiter = "-"; + + std::ranges::join_with_view r{words, delimiter}; + + auto it = r.begin(); + auto end_it = r.end(); + while (it != end_it) { + char x = *it; + std::cout << x; + ++it; + } + std::cout << std::endl; +} +``` +* end[color ff0000] +* begin[link begin.md] + +### 出力 + +``` +hello-world-join +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.2 [mark verified] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file diff --git a/reference/ranges/join_with_view/op_constructor.md b/reference/ranges/join_with_view/op_constructor.md new file mode 100644 index 0000000000..bafc3d2b79 --- /dev/null +++ b/reference/ranges/join_with_view/op_constructor.md @@ -0,0 +1,60 @@ +# コンストラクタ +* ranges[meta header] +* std::ranges[meta namespace] +* join_with_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +join_with_view() + requires default_initializable && default_initializable = default; // (1) C++23 + +constexpr explicit join_with_view(V base, Pattern pattern); // (2) C++23 +``` + +## 概要 + +[`join_with_view`](../join_with_view.md)オブジェクトを構築する。 + +- (1) : デフォルト構築 +- (2) : 元となるviewとデリミタパターンを指定して構築 + +## 効果 + +- (1) : `base_`と`pattern_`をデフォルト構築する +- (2) : `base_`を`std::move(base)`で、`pattern_`を`std::move(pattern)`で初期化する + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector words = {"hello", "world", "join"}; + std::string delimiter = "-"; + + std::ranges::join_with_view view{words, delimiter}; + for (char c : view) { + std::cout << c; + } + std::cout << std::endl; +} +``` +* join_with_view[color ff0000] + +### 出力 +``` +hello-world-join +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.2 [mark verified] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file diff --git a/reference/ranges/join_with_view/op_deduction_guide.md b/reference/ranges/join_with_view/op_deduction_guide.md new file mode 100644 index 0000000000..0372e92440 --- /dev/null +++ b/reference/ranges/join_with_view/op_deduction_guide.md @@ -0,0 +1,66 @@ +# 推論補助 +* ranges[meta header] +* std::ranges[meta namespace] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template + join_with_view(R&&, P&&) -> join_with_view, views::all_t

>; +} +``` + +## 概要 + +[`join_with_view`](../join_with_view.md)クラステンプレートの型推論補助。 + +この推論補助によって、元のRangeとパターンが暗黙的に[all view](../all.md)でラップされる。 + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector words = {"hello", "world", "join"}; + std::string delimiter = "-"; + + std::ranges::join_with_view r1{words, delimiter}; + static_assert(std::same_as< + decltype(r1), + std::ranges::join_with_view< + std::ranges::ref_view>, + std::ranges::ref_view + > + >); + + std::ranges::join_with_view r2{ + std::vector{"a", "b", "c"}, + std::string{"--"} + }; + static_assert(std::same_as< + decltype(r2), + std::ranges::join_with_view< + std::ranges::owning_view>, + std::ranges::owning_view + > + >); +} +``` + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.2 [mark verified] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file From 0f03a4a16538a5448d67af17387b8233e5bc0984 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 2 Jun 2025 17:50:40 +0900 Subject: [PATCH 1832/3948] =?UTF-8?q?lazy=5Fsplit=5Fview=20:=20=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=90=E9=96=A2=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 1 + reference/ranges/lazy_split_view.md | 10 +-- reference/ranges/lazy_split_view/base.md | 68 ++++++++++++++++ reference/ranges/lazy_split_view/begin.md | 63 +++++++++++++++ reference/ranges/lazy_split_view/end.md | 66 ++++++++++++++++ .../ranges/lazy_split_view/op_constructor.md | 74 ++++++++++++++++++ .../lazy_split_view/op_deduction_guide.md | 78 +++++++++++++++++++ 7 files changed, 355 insertions(+), 5 deletions(-) create mode 100644 reference/ranges/lazy_split_view/base.md create mode 100644 reference/ranges/lazy_split_view/begin.md create mode 100644 reference/ranges/lazy_split_view/end.md create mode 100644 reference/ranges/lazy_split_view/op_constructor.md create mode 100644 reference/ranges/lazy_split_view/op_deduction_guide.md diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 146b28a0ee..c35d3901e4 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -247,6 +247,7 @@ * sized_range[link /reference/ranges/sized_range.md] * std::ranges::owning_view[link /reference/ranges/owning_view.md] * std::ranges::ref_view[link /reference/ranges/ref_view.md] + * std::ranges::single_view[link /reference/ranges/single_view.md] * subrange[link /reference/ranges/subrange.md] * view_interface[link /reference/ranges/view_interface.md] * view[link /reference/ranges/view.md] diff --git a/reference/ranges/lazy_split_view.md b/reference/ranges/lazy_split_view.md index da299f76e9..34115a424d 100644 --- a/reference/ranges/lazy_split_view.md +++ b/reference/ranges/lazy_split_view.md @@ -78,10 +78,10 @@ concept tiny-range = sized_range && | 名前 | 説明 | 対応バージョン | |--------------------------------------------------|----------------------------------|----------------| -| [`(constructor)`](lazy_split_view/op_constructor.md.nolink) | コンストラクタ | C++20 | -| [`base`](lazy_split_view/base.md.nolink) | `V`の参照を取得する | C++20 | -| [`begin`](lazy_split_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++20 | -| [`end`](lazy_split_view/end.md.nolink) | 番兵を取得する | C++20 | +| [`(constructor)`](lazy_split_view/op_constructor.md) | コンストラクタ | C++20 | +| [`base`](lazy_split_view/base.md) | `V`の参照を取得する | C++20 | +| [`begin`](lazy_split_view/begin.md) | 先頭を指すイテレータを取得する | C++20 | +| [`end`](lazy_split_view/end.md) | 番兵を取得する | C++20 | ## 継承しているメンバ関数 @@ -98,7 +98,7 @@ concept tiny-range = sized_range && | 名前 | 説明 | 対応バージョン | |-------------------------------------------------------|------------------------------|----------------| -| [`(deduction_guide)`](lazy_split_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++20 | +| [`(deduction_guide)`](lazy_split_view/op_deduction_guide.md) | クラステンプレートの推論補助 | C++20 | ## 例 diff --git a/reference/ranges/lazy_split_view/base.md b/reference/ranges/lazy_split_view/base.md new file mode 100644 index 0000000000..fc98d76478 --- /dev/null +++ b/reference/ranges/lazy_split_view/base.md @@ -0,0 +1,68 @@ +# base +* ranges[meta header] +* std::ranges[meta namespace] +* lazy_split_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr V base() const & + requires copy_constructible; // (1) C++20 + +constexpr V base() &&; // (2) C++20 +``` + +## 概要 + +メンバ変数として保持している、元の`view`を取得する。 + +## 効果 + +入力`view`(`V`)のオブジェクトを`base_`というメンバに保持するとして + +- (1) : `return base_;` と等価 +- (2) : `return std::move(base_);` と等価 + +## 例 + +```cpp example +#include +#include +#include + +int main() { + using std::ranges::view; + + std::vector v = {1, 2, 3, 4, 5, 6, 7, 8, 9}; + std::vector pattern = {4, 5}; + + std::ranges::lazy_split_view r{v, pattern}; + + // (1) コピーして取得 + view auto b1 = r.base(); + + // (2) ムーブして取得 + view auto b2 = std::move(r).base(); + + // 得られるのは元のRangeではなく、あくまでview + static_assert(not std::same_as>); + static_assert( std::same_as>>); + static_assert( std::same_as>>); +} +``` +* base[color ff0000] + +### 出力 + +``` +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file diff --git a/reference/ranges/lazy_split_view/begin.md b/reference/ranges/lazy_split_view/begin.md new file mode 100644 index 0000000000..a532da7c7a --- /dev/null +++ b/reference/ranges/lazy_split_view/begin.md @@ -0,0 +1,63 @@ +# begin +* ranges[meta header] +* std::ranges[meta namespace] +* lazy_split_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr auto begin() + requires (!simple-view); // (1) C++20 + +constexpr auto begin() const + requires range && + forward_range; // (2) C++20 +``` + +## 概要 + +`view`の先頭要素を指すイテレータを取得する。 + +## 戻り値 +- (1), (2) : `lazy_split_view`の先頭を指すイテレータを返す。このイテレータは部分Rangeを指し、外側のRangeが空でない場合、最初の部分Rangeを指す。外側のRangeが空の場合、[`end()`](end.md)と等価なイテレータを返す。 + +## 例 + +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5, 6, 7, 8, 9}; + std::vector pattern = {4, 5}; + + std::ranges::lazy_split_view r{v, pattern}; + + auto it = r.begin(); + + // 最初の部分Rangeを取得 + auto first_subrange = *it; + for (int n : first_subrange) { + std::cout << n; + } + std::cout << '\n'; +} +``` +* begin[color ff0000] + +### 出力 + +``` +123 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file diff --git a/reference/ranges/lazy_split_view/end.md b/reference/ranges/lazy_split_view/end.md new file mode 100644 index 0000000000..5ab73514d5 --- /dev/null +++ b/reference/ranges/lazy_split_view/end.md @@ -0,0 +1,66 @@ +# end +* ranges[meta header] +* std::ranges[meta namespace] +* lazy_split_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr auto end() + requires (!simple-view); // (1) C++20 + +constexpr auto end() const + requires range && + forward_range; // (2) C++20 +``` + +## 概要 +番兵を取得する。 + +## 戻り値 +- (1), (2) : `lazy_split_view`の番兵を返す + +## 例 + +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5, 6, 7, 8, 9}; + std::vector pattern = {4, 5}; + + std::ranges::lazy_split_view r{v, pattern}; + + auto it = r.begin(); + auto end_it = r.end(); + while (it != end_it) { + auto subrange = *it; + for (int n : subrange) { + std::cout << n; + } + std::cout << '\n'; + ++it; + } +} +``` +* end[color ff0000] +* begin[link begin.md] + +### 出力 + +``` +123 +6789 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file diff --git a/reference/ranges/lazy_split_view/op_constructor.md b/reference/ranges/lazy_split_view/op_constructor.md new file mode 100644 index 0000000000..7492de4484 --- /dev/null +++ b/reference/ranges/lazy_split_view/op_constructor.md @@ -0,0 +1,74 @@ +# コンストラクタ +* ranges[meta header] +* std::ranges[meta namespace] +* lazy_split_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +lazy_split_view() + requires default_initializable && default_initializable = default; // (1) C++20 + +constexpr explicit lazy_split_view(V base, Pattern pattern); // (2) C++20 + +template + requires constructible_from> && constructible_from>> +constexpr explicit lazy_split_view(R&& r, range_value_t e); // (3) C++20 +``` + +## 概要 + +[`lazy_split_view`](../lazy_split_view.md)オブジェクトを構築する。 + +- (1) : デフォルト構築 +- (2) : 元となるviewとパターンを指定して構築 +- (3) : 元となるRangeと区切り要素を指定して構築 + +## 効果 + +- (1) : `base_`と`pattern_`をデフォルト構築する +- (2) : `base_`を`std::move(base)`で、`pattern_`を`std::move(pattern)`で初期化する +- (3) : `base_`を`views::all(std::forward(r))`で、`pattern_`を`views::single(std::move(e))`で初期化する + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5, 6, 7, 8, 9}; + std::vector pattern = {4, 5}; + + // (2) パターンを指定して構築 + std::ranges::lazy_split_view view1{v, pattern}; + + // (3) 区切り要素を指定して構築 + std::ranges::lazy_split_view view2{v, 5}; + + for (auto inner_range : view1) { + for (int n : inner_range) { + std::cout << n; + } + std::cout << '\n'; + } +} +``` +* lazy_split_view[color ff0000] + +### 出力 +``` +123 +6789 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file diff --git a/reference/ranges/lazy_split_view/op_deduction_guide.md b/reference/ranges/lazy_split_view/op_deduction_guide.md new file mode 100644 index 0000000000..5e24f2dd7f --- /dev/null +++ b/reference/ranges/lazy_split_view/op_deduction_guide.md @@ -0,0 +1,78 @@ +# 推論補助 +* ranges[meta header] +* std::ranges[meta namespace] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +namespace std::ranges { + template + lazy_split_view(R&&, P&&) + -> lazy_split_view< + views::all_t, + views::all_t

+ >; // (1) C++20 + + template + lazy_split_view(R&&, range_value_t) + -> lazy_split_view< + views::all_t, + single_view> + >; // (2) C++20 +} +``` +* single_view[link /reference/ranges/single_view.md] + +## 概要 + +[`lazy_split_view`](../lazy_split_view.md)クラステンプレートの型推論補助。 + +- (1) : 元のRangeとパターンが暗黙的に[all view](../all.md)でラップされる +- (2) : 元のRangeが[all view](../all.md)、区切り要素が[`single_view`](../single_view.md)でラップされる + + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5, 6, 7, 8, 9}; + std::vector pattern = {4, 5}; + + // Rangeとパターン + std::ranges::lazy_split_view r1{v, pattern}; + static_assert(std::same_as< + decltype(r1), + std::ranges::lazy_split_view< + std::ranges::ref_view>, + std::ranges::ref_view> + > + >); + + // Rangeと区切り要素 + std::ranges::lazy_split_view r2{v, 5}; + static_assert(std::same_as< + decltype(r2), + std::ranges::lazy_split_view< + std::ranges::ref_view>, + std::ranges::single_view + > + >); +} +``` + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file From 4ae7b92cd7a2f7d38cc6c2a27ee3bf1136f08c62 Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 2 Jun 2025 17:53:13 +0900 Subject: [PATCH 1833/3948] execution: transform_completion_signatures(_of) (#1384) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - type-list,MATCHING-SIG追加 - 微調整 --- reference/execution/execution.md | 4 +- reference/execution/execution/as_awaitable.md | 8 ++ reference/execution/execution/connect.md | 2 +- .../execution/execution/gather-signatures.md | 1 + .../execution/get_completion_signatures.md | 16 +++- reference/execution/execution/on.md | 2 +- reference/execution/execution/receiver_of.md | 6 +- reference/execution/execution/scheduler.md | 5 +- .../execution/execution/sends_stopped.md | 1 + reference/execution/execution/set_error.md | 4 +- reference/execution/execution/set_stopped.md | 4 +- reference/execution/execution/set_value.md | 12 +-- reference/execution/execution/split.md | 8 +- reference/execution/execution/tag_of_t.md | 1 + .../transform_completion_signatures.md | 87 +++++++++++++++++++ .../transform_completion_signatures_of.md | 53 +++++++++++ reference/execution/execution/type-list.md | 27 ++++++ .../execution/execution/variant-or-empty.md | 2 +- reference/execution/execution/when_all.md | 5 +- reference/execution/queryable.md | 4 +- .../this_thread/sync-wait-receiver.md | 7 +- 21 files changed, 223 insertions(+), 36 deletions(-) create mode 100644 reference/execution/execution/transform_completion_signatures.md create mode 100644 reference/execution/execution/transform_completion_signatures_of.md create mode 100644 reference/execution/execution/type-list.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index b9cb375947..01255f417b 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -143,8 +143,8 @@ Senderコンシューマは名前空間 `std::this_thread` で定義される。 | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`execution::completion_signatures`](execution/completion_signatures.md) | 完了シグネチャ集合を表現する型 (class template) | C++26 | -| [`execution::transform_completion_signatures`](execution/transform_completion_signatures.md.nolink) | 完了シグネチャを変換 (alias template) | C++26 | -| [`execution::transform_completion_signatures_of`](execution/transform_completion_signatures_of.md.nolink) | 完了シグネチャを変換 (alias template) | C++26 | +| [`execution::transform_completion_signatures`](execution/transform_completion_signatures.md) | 完了シグネチャ集合を変換 (alias template) | C++26 | +| [`execution::transform_completion_signatures_of`](execution/transform_completion_signatures_of.md) | Senderの完了シグネチャ集合を変換 (alias template) | C++26 | | [`execution::run_loop`](execution/run_loop.md) | 単一スレッド上でのループ実行 (class) | C++26 | ### コルーチンユーティリティ diff --git a/reference/execution/execution/as_awaitable.md b/reference/execution/execution/as_awaitable.md index eede9fa1b7..fa406534a5 100644 --- a/reference/execution/execution/as_awaitable.md +++ b/reference/execution/execution/as_awaitable.md @@ -95,6 +95,13 @@ namespace std::execution { * exception_ptr[link /reference/exception/exception_ptr.md] * coroutine_handle[link /reference/coroutine/coroutine_handle.md] +### 式`AS-EXCEPT-PTR` +説明用の式`err`に対して`decltype((err))`を型`Err`としたとき、式`AS-EXCEPT-PTR(err)`を下記の通り定義する。 + +- [`decay_t`](/reference/type_traits/decay.md)``が[`exception_ptr`](/reference/exception/exception_ptr.md)型と等しければ、`err`となる。このとき、事前条件として`!err == false`であること。 +- そうではなく、[`decay_t`](/reference/type_traits/decay.md)``が[`error_code`](/reference/system_error/error_code.md)型と等しければ、[`make_exception_ptr`](/reference/exception/make_exception_ptr.md)`(`[`system_error`](/reference/system_error/system_error.md)`(err))`となる。 +- そうでなければ、[`make_exception_ptr`](/reference/exception/make_exception_ptr.md)`(err)`となる。 + ### クラステンプレート`awaitable-receiver` 説明専用のクラステンプレート`sender-awaitable::awaitable-receiver`は下記の通り定義される。 @@ -135,6 +142,7 @@ struct awaitable-receiver { rcvr.result-ptr->template emplace<2>(AS-EXCEPT-PTR(err)); rcvr.continuation.resume(); ``` + * AS-EXCEPT-PTR[italic] * template emplace[link /reference/variant/variant/emplace.md] * resume()[link /reference/coroutine/coroutine_handle/resume.md] diff --git a/reference/execution/execution/connect.md b/reference/execution/execution/connect.md index 079f27adba..346172278b 100644 --- a/reference/execution/execution/connect.md +++ b/reference/execution/execution/connect.md @@ -111,7 +111,7 @@ namespace std::execution { `C`型の`c`と[コルーチンPromise型](/lang/cpp20/coroutines.md)の左辺値`p`に対して、`await-result-type`を`decltype(`[`GET-AWAITER`](../is-awaitable.md)`(c, p).`[`await_resume()`](/lang/cpp20/coroutines.md)`)`型とする。 型`V`を`await-result-type`とする。 -型`Sigs`を下記の通り定義する。 +[完了シグネチャ集合型](completion_signatures.md)`Sigs`を下記の通り定義する。 ```cpp completion_signatures< diff --git a/reference/execution/execution/gather-signatures.md b/reference/execution/execution/gather-signatures.md index aae12731bd..df0e52cc7f 100644 --- a/reference/execution/execution/gather-signatures.md +++ b/reference/execution/execution/gather-signatures.md @@ -38,6 +38,7 @@ using gather-signatures = /*see below*/ - [`execution::value_types_of_t`](value_types_of_t.md) - [`execution::error_types_of_t`](error_types_of_t.md) - [`execution::sends_stopped`](sends_stopped.md) +- [`execution::transform_completion_signatures`](transform_completion_signatures.md) ## 参照 diff --git a/reference/execution/execution/get_completion_signatures.md b/reference/execution/execution/get_completion_signatures.md index f8838b3a30..1461fb2674 100644 --- a/reference/execution/execution/get_completion_signatures.md +++ b/reference/execution/execution/get_completion_signatures.md @@ -46,7 +46,21 @@ namespace std::execution { ## カスタマイゼーションポイント - Sender`sndr`[変換後](transform_sender.md)の`new_sndr`に対して、`new_sndr.get_completion_signatures(env)`が返す型。 -- 変換後Senderの型`NewSndr`に対して、メンバ型`completion_signatures`。 +- 変換後Senderの型`NewSndr`に対して、メンバ型`NewSndr::completion_signatures` + +説明用の式`rcvr`を[`receiver`](receiver.md)のモデルである型`Rcvr`の右辺値、型`Sndr`を[`sender_in`](sender_in.md)`> == true`となる型とする。 +`Sigs...`を[`completion_signatures_of_t`](completion_signatures_of_t.md)`>`による[`completion_signatures`](completion_signatures.md)特殊化のテンプレートパラメータと定義する。 +`CSO`を完了関数とする。 + +Sender型`Sndr`、もしくは式`CSO(rcvr, args...)`を呼び出す[Operation State](operation_state.md)が潜在的に例外送出するならば、`Sigs...`の完了シグネチャ`Sig`は次の式が`true`となるべき。 + +```cpp +MATCHING-SIG(decayed-typeof(decltype(args)...), Sig) +``` +* MATCHING-SIG[italic] +* decayed-typeof[link /reference/functional/decayed-typeof.md] + +説明用の関数型`F1`, `F2`をそれぞれ`R1(Args1...)`, `R2(Args2...)`としたとき、説明専用の式`MATCHING-SIG(F1, F2)`は、[`same_as`](/reference/concepts/same_as.md)` == true`となる場合にかぎって`true`となる。 ## 例 diff --git a/reference/execution/execution/on.md b/reference/execution/execution/on.md index 134e06588a..80fd0b3da5 100644 --- a/reference/execution/execution/on.md +++ b/reference/execution/execution/on.md @@ -128,7 +128,7 @@ transform_sender( * get_env[link get_env.md] * query-with-default[link query-with-default.md] * write-env[link write-env.md] - * SCHED-ENV[link scheduler.nolink] + * SCHED-ENV[link scheduler.md] * std::move[link /reference/utility/move.md] 説明専用のクラス`not-a-scheduler`を未規定な空のクラス型、`not-a-sender`を下記の通り定義する。 diff --git a/reference/execution/execution/receiver_of.md b/reference/execution/execution/receiver_of.md index 9371cd1c76..fa3cf9514d 100644 --- a/reference/execution/execution/receiver_of.md +++ b/reference/execution/execution/receiver_of.md @@ -103,9 +103,9 @@ int main() ## 関連項目 - [`execution::receiver`](receiver.md) -- [`execution::set_value_t`](set_value.md) -- [`execution::set_error_t`](set_error.md) -- [`execution::set_stopped_t`](set_stopped.md) +- [`execution::set_value`](set_value.md) +- [`execution::set_error`](set_error.md) +- [`execution::set_stopped`](set_stopped.md) ## 参照 diff --git a/reference/execution/execution/scheduler.md b/reference/execution/execution/scheduler.md index 959ceaa348..0a456b15a1 100644 --- a/reference/execution/execution/scheduler.md +++ b/reference/execution/execution/scheduler.md @@ -63,6 +63,7 @@ namespace std::execution { ``` * set_value_t[link set_value.md] * sender_in[link sender_in.md] +* MATCHING-SIG[link get_completion_signatures.md] * value_types_of_t[link value_types_of_t.md] * type_identity_t[link /reference/type_traits/true_type.md] @@ -81,13 +82,13 @@ Scheduler型のデストラクタは、[`schedule`](schedule.md)が返すSender ## 説明専用エンティティ -### `SCHED-ATTRS` +### 式`SCHED-ATTRS` 説明用のScheduler`sch`に対して、式`SCHED-ATTRS(sch)`は[`queryable`](../queryable.md)を満たす型の式`o1`となり、下記を満たす。 - 型`Tag`が[`set_value_t`](set_value.md)もしくは[`set_stopped_t`](set_stopped.md)のとき、式`o1.query(`[`get_completion_scheduler`](get_completion_scheduler.md)`)`の型および値が`sch`と等しい。 - 式`o1.query(`[`get_domain`](get_domain.md)`)`は`sch.query(`[`get_domain`](get_domain.md)`)`と等価。 -### `SCHED-ENV` +### 式`SCHED-ENV` 説明用のScheduler`sch`に対して、式`SCHED-ENV(sch)`は[`queryable`](../queryable.md)を満たす型の式`o2`となり、下記を満たす。 - 式`o2.query(`[`get_scheduler`](get_scheduler.md)`)`は、型および値が`sch`と等しい右辺値。 diff --git a/reference/execution/execution/sends_stopped.md b/reference/execution/execution/sends_stopped.md index 810f929f88..065889e5dd 100644 --- a/reference/execution/execution/sends_stopped.md +++ b/reference/execution/execution/sends_stopped.md @@ -16,6 +16,7 @@ namespace std::execution { ``` * env<>[link env.md] * sender_in[link sender_in.md] +* type-list[link type-list.md] * gather-signatures[link gather-signatures.md] * set_stopped_t[link set_stopped.md] * completion_signatures_of_t[link completion_signatures_of_t.md] diff --git a/reference/execution/execution/set_error.md b/reference/execution/execution/set_error.md index 97867367a3..9b67e51c8f 100644 --- a/reference/execution/execution/set_error.md +++ b/reference/execution/execution/set_error.md @@ -77,8 +77,8 @@ int main() ## 関連項目 - [`execution::receiver`](receiver.md) -- [`execution::set_value_t`](set_value.md) -- [`execution::set_stopped_t`](set_stopped.md) +- [`execution::set_value`](set_value.md) +- [`execution::set_stopped`](set_stopped.md) ## 参照 diff --git a/reference/execution/execution/set_stopped.md b/reference/execution/execution/set_stopped.md index 8514e25fee..1dff3b1ba1 100644 --- a/reference/execution/execution/set_stopped.md +++ b/reference/execution/execution/set_stopped.md @@ -77,8 +77,8 @@ int main() ## 関連項目 - [`execution::receiver`](receiver.md) -- [`execution::set_value_t`](set_value.md) -- [`execution::set_error_t`](set_error.md) +- [`execution::set_value`](set_value.md) +- [`execution::set_error`](set_error.md) ## 参照 diff --git a/reference/execution/execution/set_value.md b/reference/execution/execution/set_value.md index e62d9f1afe..b404c9aa7a 100644 --- a/reference/execution/execution/set_value.md +++ b/reference/execution/execution/set_value.md @@ -34,13 +34,13 @@ namespace std::execution { ## 説明専用エンティティ -### `SET-VALUE` +### 式`SET-VALUE` 説明用の式`rcvr`, `expr`に対して、説明専用の式`SET-VALUE(rcvr, expr)`は下記と等価である。 - `expr`の型が`void`のとき、式`(expr, set_value(`[`std::move`](/reference/utility/move.md)`(rcvr)))` - そうでなければ、式`set_value(`[`std::move`](/reference/utility/move.md)`(rcvr), expr)` -### `TRY-EVAL` +### 式`TRY-EVAL` 説明用の式`rcvr`, `expr`に対して、説明専用の式`TRY-EVAL(rcvr, expr)`は下記と等価である。 - `expr`が潜在的に例外送出するならば、下記と等価。 @@ -58,14 +58,14 @@ namespace std::execution { - そうでなければ、式`expr` -### `TRY-SET-VALUE` +### 式`TRY-SET-VALUE` 説明用の式`rcvr`, `expr`に対して、説明専用の式`TRY-SET-VALUE(rcvr, expr)`は`rcvr`が1回だけ評価されることを除いて、下記と等価。 ```cpp TRY-EVAL(rcvr, SET-VALUE(rcvr, expr)) ``` -### `SET-VALUE-SIG` +### 型`SET-VALUE-SIG` 説明用の型`T`に対して、説明専用の型`SET-VALUE-SIG(T)`を下記の通り定義する。 - `T`がCV修飾された`void`ならば、型`set_value_t()` @@ -116,8 +116,8 @@ int main() ## 関連項目 - [`execution::receiver`](receiver.md) -- [`execution::set_error_t`](set_error.md) -- [`execution::set_stopped_t`](set_stopped.md) +- [`execution::set_error`](set_error.md) +- [`execution::set_stopped`](set_stopped.md) ## 参照 diff --git a/reference/execution/execution/split.md b/reference/execution/execution/split.md index 08b1e35d4b..3117c5e3b1 100644 --- a/reference/execution/execution/split.md +++ b/reference/execution/execution/split.md @@ -105,7 +105,7 @@ void operator()(local-state& state, Rcvr& rcvr) const noexcept; ## 説明専用エンティティ -### `local-state`クラステンプレート +### クラステンプレート`local-state` ```cpp namespace std::execution { @@ -184,8 +184,7 @@ void notify() noexcept override; * apply[link /reference/tuple/apply.md] * std::move[link /reference/utility/move.md] - -### `split-receiver`クラステンプレート +### クラステンプレート`split-receiver` ```cpp namespace std::execution { @@ -248,8 +247,7 @@ namespace std::execution { * get_stop_token_t[link ../get_stop_token.md] * get_token()[link /reference/stop_token/inplace_stop_source/get_token.md] - -### `shared-state`クラステンプレート +### クラステンプレート`shared-state` ```cpp namespace std::execution { diff --git a/reference/execution/execution/tag_of_t.md b/reference/execution/execution/tag_of_t.md index 83d4e4bd4c..56ae80990a 100644 --- a/reference/execution/execution/tag_of_t.md +++ b/reference/execution/execution/tag_of_t.md @@ -10,6 +10,7 @@ namespace std::execution { using tag_of_t = see below; } ``` +* sender[link sender.md] * see below[italic] ## 概要 diff --git a/reference/execution/execution/transform_completion_signatures.md b/reference/execution/execution/transform_completion_signatures.md new file mode 100644 index 0000000000..072b2da5da --- /dev/null +++ b/reference/execution/execution/transform_completion_signatures.md @@ -0,0 +1,87 @@ +# transform_completion_signatures +* execution[meta header] +* std::execution[meta namespace] +* type-alias[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std::exectution { + template< + valid-completion-signatures InputSignatures, + valid-completion-signatures AdditionalSignatures = completion_signatures<>, + template class SetValue = default-set-value, + template class SetError = default-set-error, + valid-completion-signatures SetStopped = completion_signatures> + using transform_completion_signatures = completion_signatures; +} +``` +* valid-completion-signatures[link completion_signatures.md] +* completion_signatures[link completion_signatures.md] +* set_stopped_t()[link set_stopped.md] +* see below[italic] + +## 概要 +[完了シグネチャ集合](completion_signatures.md)から別の完了シグネチャ集合へ変換するエイリアステンプレート。 + +テンプレートパラメータとして完了シグネチャ集合と、各完了シグネチャに対して型変更を適用する複数のテンプレート引数をとり、[`completion_signatures`](completion_signatures.md)の新しい特殊化を生成する。 + +- `InputSignatures` : 変換元の入力完了シグネチャ集合 +- `AdditionalSignatures` : 追加される完了シグネチャ集合(下記3種の変換適用後に追加される) +- `SetValue` : [値完了シグネチャ](set_value.md)集合に適用する型変換メタ操作 +- `SetError` : [エラー完了シグネチャ](set_value.md)集合に適用する型変換メタ操作 +- `SetStopped` : [停止完了シグネチャ](set_stopped.md)を置換する完了シグネチャ集合 + + +### 詳細仕様 +説明専用のエイリアステンプレート`default-set-value`, `default-set-error`を次の通り定義する。 +```cpp +template +using default-set-value = + completion_signatures; + +template +using default-set-error = + completion_signatures; +``` +* completion_signatures[link completion_signatures.md] +* set_value_t[link set_value.md] +* set_error_t[link set_error.md] + +説明用のパック型`As`に対して、エイリアステンプレート`SetValue`を不適格、もしくは[`valid-completion-signatures`](completion_signatures.md)`>`を満たす型とする。 +説明用の型`Err`に対して、エイリアステンプレート`SetError`を不適格、もしくは[`valid-completion-signatures`](completion_signatures.md)`>`を満たす型とする。 + +説明用のパック`Vs`を、[`gather-signatures`](gather-signatures.md)`<`[`set_value_t`](set_value.md)`, InputSignatures, SetValue,` [`type-list`](type-list.md)`>`で得られる`type-list`の型パラメータパックとする。 + +説明用のパック`Es`を、[`gather-signatures`](gather-signatures.md)`<`[`set_error_t`](set_error.md)`, InputSignatures,` [`type_identity_t`](/reference/type_traits/type_identity.md)`, error-list>`で得られる[`type-list`](type-list.md)の型パラメータパックとする。ここでエイリアステンプレート`error-list`は`type-list...>`とする。 + +[`gather-signatures`](gather-signatures.md)`<`[`set_stopped_t`](set_stopped.md)`, InputSignatures, type-list, type-list>`が[`type-list<>`](type-list.md)となるならば、説明用のパック`Ss`を[`completion_signatures<>`](completion_signatures.md)とする。そうでなければ、`Ss`を`SetStopped`とする。 + +上記いずれかの型が不適格となる場合、下記は不適格となる。 + +```cpp +transform_completion_signatures< + InputSignatures, AdditionalSignatures, + SetValue, SetError, SetStopped> +``` + +そうでなければ、集合`AdditionalSignatures`, `Vs...`, `Es...`, `Ss`に含まれる[`completion_signatures`](completion_signatures.md)特殊化のテンプレート引数型の一意な集合を`Sig...`としたとき、`transform_completion_signatures`は[`completion_signatures`](completion_signatures.md)``のエイリアスとなる。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::completion_signatures`](completion_signatures.md) +- [`execution::transform_completion_signatures_of`](transform_completion_signatures_of.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/transform_completion_signatures_of.md b/reference/execution/execution/transform_completion_signatures_of.md new file mode 100644 index 0000000000..a45d973242 --- /dev/null +++ b/reference/execution/execution/transform_completion_signatures_of.md @@ -0,0 +1,53 @@ +# transform_completion_signatures_of +* execution[meta header] +* std::execution[meta namespace] +* type-alias[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std::exectution { + template< + sender Sndr, + class Env = env<>, + valid-completion-signatures AdditionalSignatures = completion_signatures<>, + template class SetValue = see below, + template class SetError = see below, + valid-completion-signatures SetStopped = completion_signatures> + requires sender_in + using transform_completion_signatures_of = + transform_completion_signatures< + completion_signatures_of_t, + AdditionalSignatures, SetValue, SetError, SetStopped>; +} +``` +* env<>[link env.md] +* valid-completion-signatures[link completion_signatures.md] +* completion_signatures[link completion_signatures.md] +* set_stopped_t()[link set_stopped.md] +* sender_in[lin sender_in.md] +* transform_completion_signatures[link transform_completion_signatures.md] +* completion_signatures_of_t[link completion_signatures_of_t.md] +* see below[italic] + +## 概要 +[Sender型](sender.md)`Sndr`が[環境](../queryable.md)`Env`において非同期操作を作成できるとき、Senderの[完了シグネチャ集合](get_completion_signatures.md)から別の完了シグネチャ集合へ変換するエイリアステンプレート。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::get_completion_signatures`](get_completion_signatures.md) +- [`execution::transform_completion_signatures`](transform_completion_signatures.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/type-list.md b/reference/execution/execution/type-list.md new file mode 100644 index 0000000000..be6b38550c --- /dev/null +++ b/reference/execution/execution/type-list.md @@ -0,0 +1,27 @@ +# type-list +* execution[meta header] +* class template[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +template +struct type-list; // exposition only +``` + +## 備考 +`type-list`は、実行制御ライブラリの仕様定義で用いられる説明専用のクラステンプレートである。 + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`execution::sends_stopped`](sends_stopped.md) +- [`execution::transform_completion_signatures`](transform_completion_signatures.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/variant-or-empty.md b/reference/execution/execution/variant-or-empty.md index 81dbe5e7b9..c8efdb028b 100644 --- a/reference/execution/execution/variant-or-empty.md +++ b/reference/execution/execution/variant-or-empty.md @@ -17,7 +17,7 @@ namespace std::execution { 型`variant-or-empty`は下記の通り定義される。 -- `sizeof...(Ts) > 0`ならば、説明用のパック`Us`を[`decay_t`](/reference/type_traits/decay.md)`...`から重複削除したものとしたとき、`variant-or-empty`は[`variant`](/reference/variant/variant.md)[``]型となる。 +- `sizeof...(Ts) > 0`ならば、説明用のパック`Us`を[`decay_t`](/reference/type_traits/decay.md)`...`から重複削除したものとしたとき、`variant-or-empty`は[`variant`](/reference/variant/variant.md)``型となる。 - そうでなければ、`variant-or-empty`は下記の説明専用クラス型となる。 ```cpp diff --git a/reference/execution/execution/when_all.md b/reference/execution/execution/when_all.md index bfa79b04f1..31cff92e19 100644 --- a/reference/execution/execution/when_all.md +++ b/reference/execution/execution/when_all.md @@ -195,8 +195,7 @@ try { ## 説明専用エンティティ -説明専用のコンセプト`max-1-sender-in`, 列挙型`disposition`, クラス`make-state`は、それぞれ下記の通り定義される。 - +### コンセプト`max-1-sender-in` ```cpp template concept max-1-sender-in = sender_in && // exposition only @@ -207,10 +206,12 @@ concept max-1-sender-in = sender_in && // exposition only * tuple_size_v[link /reference/tuple/tuple_size.md] * tuple[link /reference/tuple/tuple.md] +### 列挙型`disposition` ```cpp enum class disposition { started, error, stopped }; // exposition only ``` +### クラステンプレート`make-state` ```cpp template struct make-state { diff --git a/reference/execution/queryable.md b/reference/execution/queryable.md index f0852bfc73..590a415b7e 100644 --- a/reference/execution/queryable.md +++ b/reference/execution/queryable.md @@ -45,13 +45,13 @@ concept queryable = destructible; ## 説明専用エンティティ -### `MAKE-ENV` +### 式`MAKE-ENV` 説明用のクエリオブジェクト`q`と式`v`に対して、式`MAKE-ENV(q, v)`は`queryable`を満たす型の式`env`となり、下記を満たす。 - `env.query(q)`の結果が`v`と等しい。 - 明に規定されない限り、`env`が有効の間は`env.query(q)`のオブジェクトも有効である。 -### `JOIN-ENV` +### 式`JOIN-ENV` 説明用のクエリ可能オブジェクト`env1`, `env2`、クエリオブジェクト`q`、パック式`as`に対して、式`JOIN-ENV(env1, env2)`は`queryable`を満たす型の式`env3`となり、式`env3.query(q, as...)`は下記と等価である。 - 適格であるならば、式`env1.query(q, as...)` diff --git a/reference/execution/this_thread/sync-wait-receiver.md b/reference/execution/this_thread/sync-wait-receiver.md index b105d28147..baa38762d4 100644 --- a/reference/execution/this_thread/sync-wait-receiver.md +++ b/reference/execution/this_thread/sync-wait-receiver.md @@ -69,18 +69,13 @@ template void set_error(Error&& err) && noexcept ``` -説明用の式`err`に対して`decltype((err))`を型`Err`としたとき、式`AS-EXCEPT-PTR(err)`を下記の通り定義する。 - -- [`decay_t`](/reference/type_traits/decay.md)``が[`exception_ptr`](/reference/exception/exception_ptr.md)型と等しければ、`err`となる。このとき、事前条件として`!err == false`であること。 -- そうではなく、[`decay_t`](/reference/type_traits/decay.md)``が[`error_code`](/reference/system_error/error_code.md)型と等しければ、[`make_exception_ptr`](/reference/exception/make_exception_ptr.md)`(`[`system_error`](/reference/system_error/system_error.md)`(err))`となる。 -- そうでなければ、[`make_exception_ptr`](/reference/exception/make_exception_ptr.md)`(err)`となる。 - 効果 : 下記と等価 ```cpp state->error = AS-EXCEPT-PTR(std::forward(err)); state->loop.finish(); ``` +* AS-EXCEPT-PTR[link ../execution/as_awaitable.md] * finish()[link ../execution/run_loop/finish.md] From d4f031709a452650ac165782c25b2a0cb3749e56 Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 2 Jun 2025 18:02:10 +0900 Subject: [PATCH 1834/3948] execution/transform_completion_signatures_of: fix markup --- .../execution/execution/transform_completion_signatures_of.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reference/execution/execution/transform_completion_signatures_of.md b/reference/execution/execution/transform_completion_signatures_of.md index a45d973242..84e1c6dbf8 100644 --- a/reference/execution/execution/transform_completion_signatures_of.md +++ b/reference/execution/execution/transform_completion_signatures_of.md @@ -20,11 +20,12 @@ namespace std::exectution { AdditionalSignatures, SetValue, SetError, SetStopped>; } ``` +* sender[link sender.md] * env<>[link env.md] * valid-completion-signatures[link completion_signatures.md] * completion_signatures[link completion_signatures.md] * set_stopped_t()[link set_stopped.md] -* sender_in[lin sender_in.md] +* sender_in[link sender_in.md] * transform_completion_signatures[link transform_completion_signatures.md] * completion_signatures_of_t[link completion_signatures_of_t.md] * see below[italic] From 1ab7976cd1c26cbcb356e1e3a8e4771d802a46e1 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 2 Jun 2025 18:11:16 +0900 Subject: [PATCH 1835/3948] =?UTF-8?q?split=5Fview=20:=20=E3=83=A1=E3=83=B3?= =?UTF-8?q?=E3=83=90=E9=96=A2=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 1 + reference/ranges/split_view.md | 10 +-- reference/ranges/split_view/base.md | 69 ++++++++++++++++++ reference/ranges/split_view/begin.md | 63 ++++++++++++++++ reference/ranges/split_view/end.md | 67 +++++++++++++++++ reference/ranges/split_view/op_constructor.md | 66 +++++++++++++++++ .../ranges/split_view/op_deduction_guide.md | 71 +++++++++++++++++++ 7 files changed, 342 insertions(+), 5 deletions(-) create mode 100644 reference/ranges/split_view/base.md create mode 100644 reference/ranges/split_view/begin.md create mode 100644 reference/ranges/split_view/end.md create mode 100644 reference/ranges/split_view/op_constructor.md create mode 100644 reference/ranges/split_view/op_deduction_guide.md diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index c35d3901e4..b36be51a82 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -243,6 +243,7 @@ * ranges::end[link /reference/ranges/end.md] * ranges::size[link /reference/ranges/size.md] * ref_view[link /reference/ranges/ref_view.md] + * single_view[link /reference/ranges/single_view.md] * sentinel_t[link /reference/ranges/sentinel_t.md] * sized_range[link /reference/ranges/sized_range.md] * std::ranges::owning_view[link /reference/ranges/owning_view.md] diff --git a/reference/ranges/split_view.md b/reference/ranges/split_view.md index 411ef0e7c8..bd478450de 100644 --- a/reference/ranges/split_view.md +++ b/reference/ranges/split_view.md @@ -62,10 +62,10 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |--------------------------------------------------|----------------------------------|----------------| -| [`(constructor)`](split_view/op_constructor.md.nolink) | コンストラクタ | C++20 | -| [`base`](split_view/base.md.nolink) | `V`の参照を取得する | C++20 | -| [`begin`](split_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++20 | -| [`end`](split_view/end.md.nolink) | 番兵を取得する | C++20 | +| [`(constructor)`](split_view/op_constructor.md) | コンストラクタ | C++20 | +| [`base`](split_view/base.md) | `V`の参照を取得する | C++20 | +| [`begin`](split_view/begin.md) | 先頭を指すイテレータを取得する | C++20 | +| [`end`](split_view/end.md) | 番兵を取得する | C++20 | ## 継承しているメンバ関数 @@ -81,7 +81,7 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |-------------------------------------------------------|------------------------------|----------------| -| [`(deduction_guide)`](split_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++20 | +| [`(deduction_guide)`](split_view/op_deduction_guide.md) | クラステンプレートの推論補助 | C++20 | ## 例 ```cpp example diff --git a/reference/ranges/split_view/base.md b/reference/ranges/split_view/base.md new file mode 100644 index 0000000000..8b08080c2c --- /dev/null +++ b/reference/ranges/split_view/base.md @@ -0,0 +1,69 @@ +# base +* ranges[meta header] +* std::ranges[meta namespace] +* split_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr V base() const & + requires copy_constructible; // (1) C++20 + +constexpr V base() &&; // (2) C++20 +``` + +## 概要 + +メンバ変数として保持している、元の`view`を取得する。 + +## 効果 + +入力`view`(`V`)のオブジェクトを`base_`というメンバに保持するとして + +- (1) : `return base_;` と等価 +- (2) : `return std::move(base_);` と等価 + +## 例 + +```cpp example +#include +#include +#include + +int main() { + using std::ranges::view; + using namespace std::literals; + + std::string_view text = "hello,world,split"; + std::string_view delimiter = ","; + + std::ranges::split_view r{text, delimiter}; + + // (1) コピーして取得 + view auto b1 = r.base(); + + // (2) ムーブして取得 + view auto b2 = std::move(r).base(); + + // 得られるのは元のRangeではなく、あくまでview + static_assert(not std::same_as); + static_assert( std::same_as>); + static_assert( std::same_as>); +} +``` +* base[color ff0000] + +### 出力 + +``` +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file diff --git a/reference/ranges/split_view/begin.md b/reference/ranges/split_view/begin.md new file mode 100644 index 0000000000..e2f2773f80 --- /dev/null +++ b/reference/ranges/split_view/begin.md @@ -0,0 +1,63 @@ +# begin +* ranges[meta header] +* std::ranges[meta namespace] +* split_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr auto begin() + requires (!simple-view); // (1) C++20 + +constexpr auto begin() const + requires range && + forward_range; // (2) C++20 +``` + +## 概要 + +`view`の先頭要素を指すイテレータを取得する。 + +## 戻り値 +- (1), (2) : `split_view`の先頭を指すイテレータを返す。このイテレータは部分Rangeを指し、外側のRangeが空でない場合、最初の部分Rangeを指す。外側のRangeが空の場合、[`end()`](end.md)と等価なイテレータを返す。 + +## 例 + +```cpp example +#include +#include +#include + +int main() { + using namespace std::literals; + + std::string_view text = "hello,world,split"; + std::string_view delimiter = ","; + + std::ranges::split_view r{text, delimiter}; + + auto it = r.begin(); + + // 最初の部分Rangeを取得 + auto first_subrange = *it; + std::string_view sv{first_subrange.begin(), first_subrange.end()}; + std::cout << sv << '\n'; +} +``` +* begin[color ff0000] + +### 出力 + +``` +hello +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file diff --git a/reference/ranges/split_view/end.md b/reference/ranges/split_view/end.md new file mode 100644 index 0000000000..dcc5332f7f --- /dev/null +++ b/reference/ranges/split_view/end.md @@ -0,0 +1,67 @@ +# end +* ranges[meta header] +* std::ranges[meta namespace] +* split_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr auto end() + requires (!simple-view); // (1) C++20 + +constexpr auto end() const + requires range && + forward_range; // (2) C++20 +``` + +## 概要 +番兵を取得する。 + +## 戻り値 +- (1), (2) : `split_view`の番兵を返す + +## 例 + +```cpp example +#include +#include +#include + +int main() { + using namespace std::literals; + + std::string_view text = "hello,world,split"; + std::string_view delimiter = ","; + + std::ranges::split_view r{text, delimiter}; + + auto it = r.begin(); + auto end_it = r.end(); + while (it != end_it) { + auto subrange = *it; + std::string_view sv{subrange.begin(), subrange.end()}; + std::cout << sv << '\n'; + ++it; + } +} +``` +* end[color ff0000] +* begin[link begin.md] + +### 出力 + +``` +hello +world +split +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file diff --git a/reference/ranges/split_view/op_constructor.md b/reference/ranges/split_view/op_constructor.md new file mode 100644 index 0000000000..86679fb979 --- /dev/null +++ b/reference/ranges/split_view/op_constructor.md @@ -0,0 +1,66 @@ +# コンストラクタ +* ranges[meta header] +* std::ranges[meta namespace] +* split_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +split_view() + requires default_initializable && + default_initializable + = default; // (1) C++20 + +constexpr split_view(V base, Pattern pattern); // (2) C++20 +``` + +## 概要 + +[`split_view`](../split_view.md)オブジェクトを構築する。 + +- (1) : デフォルト構築 +- (2) : 元となるviewとパターンを指定して構築 + +## 効果 + +- (1) : `base_`と`pattern_`をデフォルト構築する +- (2) : `base_`を`std::move(base)`で、`pattern_`を`std::move(pattern)`で初期化する + +## 例 +```cpp example +#include +#include +#include + +int main() { + using namespace std::literals; + + std::string_view text = "hello,world,split"; + std::string_view delimiter = ","; + + std::ranges::split_view view{text, delimiter}; + + for (auto subrange : view) { + std::string_view sv{subrange.begin(), subrange.end()}; + std::cout << sv << '\n'; + } +} +``` +* split_view[color ff0000] + +### 出力 +``` +hello +world +split +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file diff --git a/reference/ranges/split_view/op_deduction_guide.md b/reference/ranges/split_view/op_deduction_guide.md new file mode 100644 index 0000000000..004edda08b --- /dev/null +++ b/reference/ranges/split_view/op_deduction_guide.md @@ -0,0 +1,71 @@ +# 推論補助 +* ranges[meta header] +* std::ranges[meta namespace] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +namespace std::ranges { + template + split_view(R&&, P&&) + -> split_view, views::all_t

>; // (1) C++20 + + template + split_view(R&&, range_value_t) + -> split_view, single_view>>; // (2) C++20 +} +``` + +## 概要 + +[`split_view`](../split_view.md)クラステンプレートの型推論補助。 + +- (1) : 元のRangeとパターンが暗黙的に[all view](../all.md)でラップされる +- (2) : 元のRangeが[all view](../all.md)、区切り要素が[`single_view`](../single_view.md)でラップされる + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::string_view text = "hello,world,split"; + std::string_view delimiter = ","; + + std::ranges::split_view r1{text, delimiter}; + static_assert(std::same_as< + decltype(r1), + std::ranges::split_view< + std::string_view, + std::string_view + > + >); + + std::ranges::split_view r2{ + std::string{"hello,world,split"}, + std::string{","} + }; + static_assert(std::same_as< + decltype(r2), + std::ranges::split_view< + std::ranges::owning_view, + std::ranges::owning_view + > + >); +} +``` + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file From f1ce7b622d6fa307ae67bef1b2681de9738b0571 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 2 Jun 2025 18:28:22 +0900 Subject: [PATCH 1836/3948] =?UTF-8?q?concat=5Fview=20:=20=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=90=E9=96=A2=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/concat_view.md | 31 ++++----- reference/ranges/concat_view/begin.md | 59 ++++++++++++++++ reference/ranges/concat_view/end.md | 62 +++++++++++++++++ .../ranges/concat_view/op_constructor.md | 61 ++++++++++++++++ .../ranges/concat_view/op_deduction_guide.md | 69 +++++++++++++++++++ reference/ranges/concat_view/size.md | 68 ++++++++++++++++++ 6 files changed, 334 insertions(+), 16 deletions(-) create mode 100644 reference/ranges/concat_view/begin.md create mode 100644 reference/ranges/concat_view/end.md create mode 100644 reference/ranges/concat_view/op_constructor.md create mode 100644 reference/ranges/concat_view/op_deduction_guide.md create mode 100644 reference/ranges/concat_view/size.md diff --git a/reference/ranges/concat_view.md b/reference/ranges/concat_view.md index 769dd0c113..54b39fc32a 100644 --- a/reference/ranges/concat_view.md +++ b/reference/ranges/concat_view.md @@ -108,28 +108,28 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |--------------------------------------------------|----------------------------------|----------------| -| [`(constructor)`](concat_view/op_constructor.md.nolink) | コンストラクタ | C++26 | -| [`begin`](concat_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++26 | -| [`end`](concat_view/end.md.nolink) | 番兵を取得する | C++26 | -| [`size`](concat_view/size.md.nolink) | 要素数を取得する | C++26 | +| [`(constructor)`](concat_view/op_constructor.md) | コンストラクタ | C++26 | +| [`begin`](concat_view/begin.md) | 先頭を指すイテレータを取得する | C++26 | +| [`end`](concat_view/end.md) | 番兵を取得する | C++26 | +| [`size`](concat_view/size.md) | 要素数を取得する | C++26 | ## 継承しているメンバ関数 | 名前 | 説明 | 対応バージョン | |----------------------------------------------|-----------------------------------|----------------| -| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++20 | -| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++20 | -| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | -| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | -| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | -| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | -| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | +| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++26 | +| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++26 | +| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++26 | +| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++26 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++26 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++26 | +| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++26 | ## 推論補助 | 名前 | 説明 | 対応バージョン | |-------------------------------------------------------|------------------------------|----------------| -| [`(deduction_guide)`](concat_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | +| [`(deduction_guide)`](concat_view/op_deduction_guide.md) | クラステンプレートの推論補助 | C++26 | ## 例 ```cpp example @@ -155,10 +155,9 @@ int main() { - C++26 ### 処理系 -- [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? -- [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? +- [Clang](/implementation.md#clang): 20 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] ## 参照 - [26.7.18 Concat view](https://timsong-cpp.github.io/cppwp/range.concat) (2024-08-10) diff --git a/reference/ranges/concat_view/begin.md b/reference/ranges/concat_view/begin.md new file mode 100644 index 0000000000..01986d7ae4 --- /dev/null +++ b/reference/ranges/concat_view/begin.md @@ -0,0 +1,59 @@ +# begin +* ranges[meta header] +* std::ranges[meta namespace] +* concat_view[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr auto begin() + requires (!simple-view || ...); // (1) C++26 + +constexpr auto begin() const + requires (range && ...); // (2) C++26 +``` + +## 概要 + +`view`の先頭要素を指すイテレータを取得する。 + +## 戻り値 +- (1), (2) : `concat_view`の先頭を指すイテレータを返す。連結されたRangeが空でない場合、最初の非空Rangeの先頭要素を指す。すべてのRangeが空の場合、[`end()`](end.md)と等価なイテレータを返す。 + +## 例 + +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v1{1, 2, 3}; + std::vector v2{4, 5}; + std::array a{6, 7, 8}; + + std::ranges::concat_view r{v1, v2, a}; + + auto it = r.begin(); + + int x = *it; + std::println("{}", x); +} +``` +* begin[color ff0000] + +### 出力 + +``` +1 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 20 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] diff --git a/reference/ranges/concat_view/end.md b/reference/ranges/concat_view/end.md new file mode 100644 index 0000000000..992c02a504 --- /dev/null +++ b/reference/ranges/concat_view/end.md @@ -0,0 +1,62 @@ +# end +* ranges[meta header] +* std::ranges[meta namespace] +* concat_view[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr auto end() + requires (!simple-view || ...); // (1) C++26 + +constexpr auto end() const + requires (range && ...); // (2) C++26 +``` + +## 概要 +番兵を取得する。 + +## 戻り値 +- (1), (2) : `concat_view`の番兵を返す + +## 例 + +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v1{1, 2, 3}; + std::vector v2{4, 5}; + std::array a{6, 7, 8}; + + std::ranges::concat_view r{v1, v2, a}; + + auto it = r.begin(); + auto end_it = r.end(); + while (it != end_it) { + std::print("{} ", *it); + ++it; + } + std::println(); +} +``` +* end[color ff0000] +* begin[link begin.md] + +### 出力 + +``` +1 2 3 4 5 6 7 8 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 20 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] diff --git a/reference/ranges/concat_view/op_constructor.md b/reference/ranges/concat_view/op_constructor.md new file mode 100644 index 0000000000..0d1be8934d --- /dev/null +++ b/reference/ranges/concat_view/op_constructor.md @@ -0,0 +1,61 @@ +# コンストラクタ +* ranges[meta header] +* std::ranges[meta namespace] +* concat_view[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +concat_view() + requires (default_initializable && ...) = default; // (1) C++26 + +constexpr explicit concat_view(Views... views); // (2) C++26 +``` + +## 概要 + +[`concat_view`](../concat_view.md)オブジェクトを構築する。 + +- (1) : デフォルト構築 +- (2) : 連結する複数のviewを指定して構築 + +## 効果 + +- (1) : 各`views_`メンバをデフォルト構築する +- (2) : `views_`を`std::move(views)...`で初期化する + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v1{1, 2, 3}; + std::vector v2{4, 5}; + std::array a{6, 7, 8}; + + std::ranges::concat_view view{v1, v2, a}; + + for (int i : view) { + std::print("{} ", i); + } + std::println(); +} +``` +* concat_view[color ff0000] + +### 出力 +``` +1 2 3 4 5 6 7 8 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 20 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] diff --git a/reference/ranges/concat_view/op_deduction_guide.md b/reference/ranges/concat_view/op_deduction_guide.md new file mode 100644 index 0000000000..a82d21f75a --- /dev/null +++ b/reference/ranges/concat_view/op_deduction_guide.md @@ -0,0 +1,69 @@ +# 推論補助 +* ranges[meta header] +* std::ranges[meta namespace] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std::ranges { + template + concat_view(Rs&&...) -> concat_view...>; +} +``` + +## 概要 + +[`concat_view`](../concat_view.md)クラステンプレートの型推論補助。 + +この推論補助によって、渡されたRangeが暗黙的に[all view](../all.md)でラップされる。 + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v1{1, 2, 3}; + std::vector v2{4, 5}; + std::array a{6, 7, 8}; + + std::ranges::concat_view r1{v1, v2, a}; + static_assert(std::same_as< + decltype(r1), + std::ranges::concat_view< + std::ranges::ref_view>, + std::ranges::ref_view>, + std::ranges::ref_view> + > + >); + + std::ranges::concat_view r2{ + std::vector{1, 2, 3}, + std::vector{4, 5}, + std::array{6, 7, 8} + }; + static_assert(std::same_as< + decltype(r2), + std::ranges::concat_view< + std::ranges::owning_view>, + std::ranges::owning_view>, + std::ranges::owning_view> + > + >); +} +``` + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 20 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] diff --git a/reference/ranges/concat_view/size.md b/reference/ranges/concat_view/size.md new file mode 100644 index 0000000000..8fd66ab5dc --- /dev/null +++ b/reference/ranges/concat_view/size.md @@ -0,0 +1,68 @@ +# size +* ranges[meta header] +* std::ranges[meta namespace] +* concat_view[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr auto size() + requires (sized_range && ...); // (1) C++26 + +constexpr auto size() const + requires (sized_range && ...); // (2) C++26 +``` + +## 概要 +連結されたすべてのRangeの要素数の合計を取得する。 + +## 制約 +- (1) : `Views...`のすべてが[`sized_range`](../sized_range.md)であること +- (2) : `const Views...`のすべてが[`sized_range`](../sized_range.md)であること + +## 戻り値 +- (1), (2) : 連結されたすべてのRangeの要素数の合計を返す + +## 計算量 +- O(1) + +## 例 + +```cpp example +#include +#include +#include +#include +#include + +int main() { + std::vector v1{1, 2, 3}; + std::vector v2{4, 5}; + std::array a{6, 7, 8}; + + std::ranges::concat_view r{v1, v2, a}; + + std::println("size: {}", r.size()); + + // 実際の要素数を確認 + auto count = std::ranges::distance(r); + std::println("distance: {}", count); +} +``` +* size[color ff0000] + +### 出力 + +``` +size: 8 +distance: 8 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 20 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] From e399f0d76a3cfe60d255e529df7f805f5bf3efca Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 2 Jun 2025 19:02:20 +0900 Subject: [PATCH 1837/3948] =?UTF-8?q?common=5Frange=20:=20=E4=BE=8B?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/common_range.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/reference/ranges/common_range.md b/reference/ranges/common_range.md index 8fe68d450d..1bff945a90 100644 --- a/reference/ranges/common_range.md +++ b/reference/ranges/common_range.md @@ -23,10 +23,25 @@ namespace std::ranges { 型`T`が`common_range`のモデルとなるのは、`T`が[`range`](range.md)のモデルであり、`T`から取得した番兵とイテレータの型が等しい場合である。 ## 例 -(執筆中) +```cpp example +#include + +int main() { + namespace ranges = std::ranges; + namespace views = std::views; + + // 無限長のiotaはcommon_rangeではない + // (イテレータと番兵の型が異なる) + static_assert(!ranges::common_range); + + // commonを適用するとcommon_rangeになる + static_assert(ranges::common_range); +} +``` ### 出力 -(執筆中) +``` +``` ## バージョン ### 言語 From 3380084316ebdc67be4d7541f2ad61f93305cd8f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 2 Jun 2025 19:13:56 +0900 Subject: [PATCH 1838/3948] =?UTF-8?q?common=5Fview=20:=20=E6=A6=82?= =?UTF-8?q?=E8=A6=81=E6=96=87=E7=AB=A0=E3=81=8C=E3=82=8F=E3=81=8B=E3=82=8A?= =?UTF-8?q?=E3=81=AB=E3=81=8F=E3=81=8B=E3=81=A3=E3=81=9F=E3=81=AE=E3=81=A7?= =?UTF-8?q?=E5=B9=B3=E6=98=93=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/common_view.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reference/ranges/common_view.md b/reference/ranges/common_view.md index 10213afb59..38d4784eb5 100644 --- a/reference/ranges/common_view.md +++ b/reference/ranges/common_view.md @@ -25,7 +25,8 @@ namespace std::ranges { - (1): 任意のRangeを[`common_range`](common_range.md)にする[`view`](view.md) - (2): `common_view`または同じ効果を実現する[`view`](view.md)を生成するRangeアダプタオブジェクト -同じ型のイテレータペアを受け取るレガシーなアルゴリズム関数に対して、[`common_range`](common_range.md)ではない範囲を渡したい場合、`common`を使用することで同じ型のイテレータペアを取得できるようになる。 +イテレータと番兵の型が同じである必要があるレガシーなアルゴリズム関数に対して、イテレータと番兵が異なるRangeを渡したい場合 (たとえば[`iota_view`](iota_view.md))、このビューで[`common_range`](common_range.md)に変換することで、同じ型のイテレータペアを取得できるようになる。 + ### Rangeコンセプト From 0c02cf40879fec512bd109452b4f9e8059685fbc Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 2 Jun 2025 22:16:41 +0900 Subject: [PATCH 1839/3948] =?UTF-8?q?common=5Fview=20:=20=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=90=E9=96=A2=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 1 + reference/ranges/common_view.md | 12 +-- reference/ranges/common_view/base.md | 75 ++++++++++++++ reference/ranges/common_view/begin.md | 99 +++++++++++++++++++ reference/ranges/common_view/end.md | 87 ++++++++++++++++ .../ranges/common_view/op_constructor.md | 69 +++++++++++++ .../ranges/common_view/op_deduction_guide.md | 61 ++++++++++++ reference/ranges/common_view/size.md | 71 +++++++++++++ 8 files changed, 469 insertions(+), 6 deletions(-) create mode 100644 reference/ranges/common_view/base.md create mode 100644 reference/ranges/common_view/begin.md create mode 100644 reference/ranges/common_view/end.md create mode 100644 reference/ranges/common_view/op_constructor.md create mode 100644 reference/ranges/common_view/op_deduction_guide.md create mode 100644 reference/ranges/common_view/size.md diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index b36be51a82..be1406bf11 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -145,6 +145,7 @@ * std::basic_istream[link /reference/istream/basic_istream.md] * [link /reference/iterator.md] * bidirectional_iterator[link /reference/iterator/bidirectional_iterator.md] + * common_iterator[link /reference/iterator/common_iterator.md] * contiguous_iterator[link /reference/iterator/contiguous_iterator.md] * default_sentinel_t[link /reference/iterator/default_sentinel_t.md] * default_sentinel[link /reference/iterator/default_sentinel_t.md] diff --git a/reference/ranges/common_view.md b/reference/ranges/common_view.md index 38d4784eb5..d9051b9bfe 100644 --- a/reference/ranges/common_view.md +++ b/reference/ranges/common_view.md @@ -52,11 +52,11 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |--------------------------------------------------|-----------------------------------|----------------| -| [`(constructor)`](common_view/op_constructor.md.nolink) | コンストラクタ | C++20 | -| [`base`](common_view/base.md.nolink) | `R`の参照を取得する | C++20 | -| [`begin`](common_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++20 | -| [`end`](common_view/end.md.nolink) | 番兵を取得する | C++20 | -| [`size`](common_view/size.md.nolink) | 要素数を取得する | C++20 | +| [`(constructor)`](common_view/op_constructor.md) | コンストラクタ | C++20 | +| [`base`](common_view/base.md) | `R`の参照を取得する | C++20 | +| [`begin`](common_view/begin.md) | 先頭を指すイテレータを取得する | C++20 | +| [`end`](common_view/end.md) | 番兵を取得する | C++20 | +| [`size`](common_view/size.md) | 要素数を取得する | C++20 | `r`を参照先のRangeとする。`size`は、[`ranges::size`](size.md)`(r)`が有効な式であるときに定義される。 @@ -77,7 +77,7 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |-------------------------------------------------------|------------------------------|----------------| -| [`(deduction_guide)`](common_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++20 | +| [`(deduction_guide)`](common_view/op_deduction_guide.md) | クラステンプレートの推論補助 | C++20 | ## 例 ```cpp example diff --git a/reference/ranges/common_view/base.md b/reference/ranges/common_view/base.md new file mode 100644 index 0000000000..83015d999b --- /dev/null +++ b/reference/ranges/common_view/base.md @@ -0,0 +1,75 @@ +# base +* ranges[meta header] +* std::ranges[meta namespace] +* common_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr V base() const & + requires copy_constructible; // (1) C++20 + +constexpr V base() &&; // (2) C++20 +``` +* copy_constructible[link /reference/concepts/copy_constructible.md] + +## 概要 + +メンバ変数として保持している、元のviewを取得する。 + +## 効果 + +- (1) : `return base_;` +- (2) : `return std::move(base_);` + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + auto taken = vec | std::views::take(3); + std::ranges::common_view cv(taken); + + // (1) コピーして取得 + auto base1 = cv.base(); + static_assert(std::same_as>>>); + + // (2) ムーブして取得 + auto base2 = std::move(cv).base(); + static_assert(std::same_as>>>); + + // 取得したviewを使用 + for (int n : base1) { + std::cout << n << " "; + } + std::cout << std::endl; +} +``` +* base[color ff0000] +* std::ranges::common_view[link ../common_view.md] +* std::views::take[link ../take_view.md] +* std::ranges::take_view[link ../take_view.md] +* std::ranges::ref_view[link ../ref_view.md] + +### 出力 +``` +1 2 3 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4861 24.7.5.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.common.view) \ No newline at end of file diff --git a/reference/ranges/common_view/begin.md b/reference/ranges/common_view/begin.md new file mode 100644 index 0000000000..82aa8e3efb --- /dev/null +++ b/reference/ranges/common_view/begin.md @@ -0,0 +1,99 @@ +# begin +* ranges[meta header] +* std::ranges[meta namespace] +* common_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr auto begin(); // (1) +constexpr auto begin() const requires range; // (2) +``` +* range[link ../range.md] + +## 概要 + +先頭を指すイテレータを取得する。 + +## 効果 + +- (1) : + ```cpp + if constexpr (random_access_range && sized_range) + return ranges::begin(base_); + else + return common_iterator, sentinel_t>(ranges::begin(base_)); + ``` + * random_access_range[link ../random_access_range.md] + * sized_range[link ../sized_range.md] + * common_iterator[link /reference/iterator/common_iterator.md] + * iterator_t[link ../iterator_t.md] + * sentinel_t[link ../sentinel_t.md] + * ranges::begin[link ../begin.md] + +- (2) : + ```cpp + if constexpr (random_access_range && sized_range) + return ranges::begin(base_); + else + return common_iterator, sentinel_t>(ranges::begin(base_)); + ``` + * random_access_range[link ../random_access_range.md] + * sized_range[link ../sized_range.md] + * common_iterator[link /reference/iterator/common_iterator.md] + * iterator_t[link ../iterator_t.md] + * sentinel_t[link ../sentinel_t.md] + * ranges::begin[link ../begin.md] + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + // common_rangeではないviewを作成 + auto taken = vec | std::views::take(3); + static_assert(!std::ranges::common_range); + + // common_viewでラップ + std::ranges::common_view cv(taken); + static_assert(std::ranges::common_range); + + // begin()とend()が同じ型を返す + auto it = cv.begin(); + auto end = cv.end(); + static_assert(std::same_as); + + // イテレータを使用 + for (; it != end; ++it) { + std::cout << *it << " "; + } + std::cout << std::endl; +} +``` +* begin[color ff0000] +* end[link end.md] +* std::ranges::common_range[link ../common_range.md] +* std::ranges::common_view[link ../common_view.md] +* std::views::take[link ../take_view.md] + +### 出力 +``` +1 2 3 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4861 24.7.5.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.common.view) \ No newline at end of file diff --git a/reference/ranges/common_view/end.md b/reference/ranges/common_view/end.md new file mode 100644 index 0000000000..0ff35e598c --- /dev/null +++ b/reference/ranges/common_view/end.md @@ -0,0 +1,87 @@ +# end +* ranges[meta header] +* std::ranges[meta namespace] +* common_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr auto end(); // (1) C++20 +constexpr auto end() const + requires range; // (2) C++20 +``` +* range[link ../range.md] + +## 概要 + +番兵を取得する。 + +## 効果 + +- (1) : + ```cpp + if constexpr (random_access_range && sized_range) + return ranges::begin(base_) + ranges::size(base_); + else + return common_iterator, sentinel_t>(ranges::end(base_)); + ``` + +- (2) : + ```cpp + if constexpr (random_access_range && sized_range) + return ranges::begin(base_) + ranges::size(base_); + else + return common_iterator, sentinel_t>(ranges::end(base_)); + ``` + + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + // common_rangeではないviewを作成 + auto taken = vec | std::views::take(3); + + // common_viewでラップ + std::ranges::common_view cv(taken); + + // begin()とend()が同じ型を返す + auto begin = cv.begin(); + auto end = cv.end(); + static_assert(std::same_as); + + // レガシーアルゴリズムに渡せる + std::for_each(begin, end, [](int n) { + std::cout << n << " "; + }); + std::cout << std::endl; +} +``` +* end[color ff0000] +* begin[link begin.md] +* std::ranges::common_view[link ../common_view.md] +* std::views::take[link ../take_view.md] + +### 出力 +``` +1 2 3 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4861 24.7.5.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.common.view) \ No newline at end of file diff --git a/reference/ranges/common_view/op_constructor.md b/reference/ranges/common_view/op_constructor.md new file mode 100644 index 0000000000..ecf659172e --- /dev/null +++ b/reference/ranges/common_view/op_constructor.md @@ -0,0 +1,69 @@ +# コンストラクタ +* ranges[meta header] +* std::ranges[meta namespace] +* common_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +common_view() + requires default_initializable = default; // (1) C++20 + +constexpr explicit +common_view(V r); // (2) C++20 +``` +* default_initializable[link /reference/concepts/default_initializable.md] + +## 概要 + +- (1) : デフォルトコンストラクタ +- (2) : 元となるRangeを受け取るコンストラクタ + +## 効果 + +- (1) : `base_`をデフォルト構築する +- (2) : `base_`を`std::move(r)`で初期化する + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + // (1) デフォルトコンストラクタ + std::ranges::common_view> cv1; + + // (2) 元となるRangeを受け取るコンストラクタ + auto taken = vec | std::views::take(3); + std::ranges::common_view cv2(taken); + + for (int n : cv2) { + std::cout << n << " "; + } + std::cout << std::endl; +} +``` +* std::ranges::common_view[color ff0000] +* std::ranges::empty_view[link ../empty_view.md] +* std::views::take[link ../take_view.md] + +### 出力 +``` +1 2 3 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4861 24.7.5.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.common.view) \ No newline at end of file diff --git a/reference/ranges/common_view/op_deduction_guide.md b/reference/ranges/common_view/op_deduction_guide.md new file mode 100644 index 0000000000..4d07d482c4 --- /dev/null +++ b/reference/ranges/common_view/op_deduction_guide.md @@ -0,0 +1,61 @@ +# 推論補助 +* ranges[meta header] +* std::ranges[meta namespace] +* common_view[meta class] +* deduction guide[meta id-type] +* cpp20[meta cpp] + +```cpp +namespace std::ranges { + template + common_view(R&&) -> common_view>; +} +``` +* views::all_t[link ../all.md] + +## 概要 +`common_view`クラステンプレートの型推論補助。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + // views::takeはcommon_rangeではない + auto taken = vec | std::views::take(3); + + // common_viewの型を明示的に指定する必要がない + std::ranges::common_view cv{taken}; + + // 推論された型を確認 + static_assert(std::same_as< + decltype(cv), + std::ranges::common_view>>> + >); +} +``` +* std::ranges::common_view[color ff0000] +* std::views::take[link ../take_view.md] +* std::ranges::take_view[link ../take_view.md] +* std::ranges::ref_view[link ../ref_view.md] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 関連項目 +- [`views::all`](../all.md) \ No newline at end of file diff --git a/reference/ranges/common_view/size.md b/reference/ranges/common_view/size.md new file mode 100644 index 0000000000..73eaf1dac6 --- /dev/null +++ b/reference/ranges/common_view/size.md @@ -0,0 +1,71 @@ +# size +* ranges[meta header] +* std::ranges[meta namespace] +* common_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr auto size() + requires sized_range; // (1) C++20 +constexpr auto size() const + requires sized_range; // (2) C++20 +``` +* sized_range[link ../sized_range.md] + +## 概要 + +要素数を取得する。 + +## 効果 + +- (1) : `return ranges::size(base_);` +- (2) : `return ranges::size(base_);` + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + // sized_rangeなviewを作成 + auto taken = vec | std::views::take(3); + static_assert(std::ranges::sized_range); + + // common_viewでラップ + std::ranges::common_view cv(taken); + + // サイズを取得 + std::cout << "size: " << cv.size() << std::endl; + + // const版も動作する + const auto& ccv = cv; + std::cout << "const size: " << ccv.size() << std::endl; +} +``` +* size[color ff0000] +* std::ranges::sized_range[link ../sized_range.md] +* std::ranges::common_view[link ../common_view.md] +* std::views::take[link ../take_view.md] + +### 出力 +``` +size: 3 +const size: 3 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4861 24.7.5.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.common.view) \ No newline at end of file From daf97795ae81c9c74e8eccce6e32f6cde4535458 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 2 Jun 2025 22:23:52 +0900 Subject: [PATCH 1840/3948] =?UTF-8?q?common=5Fview::begin=20:=20=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=83=87=E3=83=B3=E3=83=88=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/common_view/begin.md | 37 ++++++++++----------------- 1 file changed, 13 insertions(+), 24 deletions(-) diff --git a/reference/ranges/common_view/begin.md b/reference/ranges/common_view/begin.md index 82aa8e3efb..0127b7ac4e 100644 --- a/reference/ranges/common_view/begin.md +++ b/reference/ranges/common_view/begin.md @@ -18,32 +18,21 @@ constexpr auto begin() const requires range; // (2) ## 効果 - (1) : - ```cpp - if constexpr (random_access_range && sized_range) - return ranges::begin(base_); - else - return common_iterator, sentinel_t>(ranges::begin(base_)); - ``` - * random_access_range[link ../random_access_range.md] - * sized_range[link ../sized_range.md] - * common_iterator[link /reference/iterator/common_iterator.md] - * iterator_t[link ../iterator_t.md] - * sentinel_t[link ../sentinel_t.md] - * ranges::begin[link ../begin.md] + ```cpp + if constexpr (random_access_range && sized_range) + return ranges::begin(base_); + else + return common_iterator, sentinel_t>(ranges::begin(base_)); + ``` - (2) : - ```cpp - if constexpr (random_access_range && sized_range) - return ranges::begin(base_); - else - return common_iterator, sentinel_t>(ranges::begin(base_)); - ``` - * random_access_range[link ../random_access_range.md] - * sized_range[link ../sized_range.md] - * common_iterator[link /reference/iterator/common_iterator.md] - * iterator_t[link ../iterator_t.md] - * sentinel_t[link ../sentinel_t.md] - * ranges::begin[link ../begin.md] + ```cpp + if constexpr (random_access_range && sized_range) + return ranges::begin(base_); + else + return common_iterator, sentinel_t>(ranges::begin(base_)); + ``` + ## 例 ```cpp example From 6df87c76800d2e82fc232bafe4b5383d2d074489 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 2 Jun 2025 22:26:52 +0900 Subject: [PATCH 1841/3948] =?UTF-8?q?common=5Fview::=E6=8E=A8=E8=AB=96?= =?UTF-8?q?=E8=A3=9C=E5=8A=A9=20:=20id=20type=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/common_view/op_deduction_guide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/ranges/common_view/op_deduction_guide.md b/reference/ranges/common_view/op_deduction_guide.md index 4d07d482c4..79e8b2107d 100644 --- a/reference/ranges/common_view/op_deduction_guide.md +++ b/reference/ranges/common_view/op_deduction_guide.md @@ -2,7 +2,7 @@ * ranges[meta header] * std::ranges[meta namespace] * common_view[meta class] -* deduction guide[meta id-type] +* function[meta id-type] * cpp20[meta cpp] ```cpp From 4f5dd2acb5473aabe4e3d0b9bdc55c82d6f15649 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 3 Jun 2025 13:48:26 +0900 Subject: [PATCH 1842/3948] execution: fix spelling query-or-default (#1384) 'query-or-default' -> 'query-with-default' https://github.com/cplusplus/draft/pull/7905 --- reference/execution/execution/get-domain-late.md | 4 ++-- reference/execution/execution/on.md | 6 +++--- reference/execution/execution/schedule_from.md | 4 ++-- reference/execution/execution/starts_on.md | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/reference/execution/execution/get-domain-late.md b/reference/execution/execution/get-domain-late.md index 5d6c3880d2..877a17341b 100644 --- a/reference/execution/execution/get-domain-late.md +++ b/reference/execution/execution/get-domain-late.md @@ -30,10 +30,10 @@ constexpr auto get-domain-late(const Sndr& sndr, const Env& env) noexcept; ```cpp [] { auto [_, sch, _] = sndr; - return query-or-default(get_domain, sch, default_domain()); + return query-with-default(get_domain, sch, default_domain()); }(); ``` - * query-or-default[link query-or-default.md.nolink] + * query-with-default[link query-with-default.md] * get_domain[link get_domain.md] * default_domain()[link default_domain.md] diff --git a/reference/execution/execution/on.md b/reference/execution/execution/on.md index 80fd0b3da5..22906fc8b6 100644 --- a/reference/execution/execution/on.md +++ b/reference/execution/execution/on.md @@ -33,11 +33,11 @@ namespace std::execution { ```cpp transform_sender( - query-or-default(get_domain, sch, default_domain()), + query-with-default(get_domain, sch, default_domain()), make-sender(on, sch, sndr)) ``` * transform_sender[link transform_sender.md] -* query-or-default[link query-or-default.md.nolink] +* query-with-default[link query-with-default.md] * get_domain[link get_domain.md] * default_domain()[link default_domain.md] * make-sender[link make-sender.md] @@ -153,7 +153,7 @@ struct not-a-sender { Senderアルゴリズム構築時に、関連付けられた実行ドメインに対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 [デフォルト実行ドメイン](default_domain.md)では無変換。 -- 呼び出し式`on(sch, sndr)` : [Scheduler](scheduler.md)`sch`に[関連付けられた実行ドメイン](query-or-default.md.nolink) +- 呼び出し式`on(sch, sndr)` : [Scheduler](scheduler.md)`sch`に[関連付けられた実行ドメイン](query-with-default.md) - 呼び出し式`on(sndr, sch, closure)` : [Sender](sender.md)`sndr`に[関連付けられた実行ドメイン](get-domain-early.md) [Receiver](receiver.md)との[接続(connect)](connect.md)時に、[関連付けられた実行ドメイン](get-domain-late.md)に対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 diff --git a/reference/execution/execution/schedule_from.md b/reference/execution/execution/schedule_from.md index eec40b797f..43464855e0 100644 --- a/reference/execution/execution/schedule_from.md +++ b/reference/execution/execution/schedule_from.md @@ -25,11 +25,11 @@ namespace std::execution { ```cpp transform_sender( - query-or-default(get_domain, sch, default_domain()), + query-with-default(get_domain, sch, default_domain()), make-sender(schedule_from, sch, sndr)) ``` * transform_sender[link transform_sender.md] -* query-or-default[link query-or-default.md.nolink] +* query-with-default[link query-with-default.md] * get_domain[link get_domain.md] * default_domain()[link default_domain.md] * make-sender[link make-sender.md] diff --git a/reference/execution/execution/starts_on.md b/reference/execution/execution/starts_on.md index c82f71db8a..6673b28080 100644 --- a/reference/execution/execution/starts_on.md +++ b/reference/execution/execution/starts_on.md @@ -23,11 +23,11 @@ namespace std::execution { ```cpp transform_sender( - query-or-default(get_domain, sch, default_domain()), + query-with-default(get_domain, sch, default_domain()), make-sender(starts_on, sch, sndr)) ``` * transform_sender[link transform_sender.md] -* query-or-default[link query-or-default.md.nolink] +* query-with-default[link query-with-default.md] * get_domain[link get_domain.md] * default_domain()[link default_domain.md] * make-sender[link make-sender.md] @@ -67,7 +67,7 @@ transform_sender( ## カスタマイゼーションポイント -Senderアルゴリズム構築時に、[Scheduler](scheduler.md)`sch`に[関連付けられた実行ドメイン](query-or-default.md.nolink)に対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 +Senderアルゴリズム構築時に、[Scheduler](scheduler.md)`sch`に[関連付けられた実行ドメイン](query-with-default.md)に対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 [デフォルト実行ドメイン](default_domain.md)では無変換。 [Receiver](receiver.md)との[接続(connect)](connect.md)時に、[関連付けられた実行ドメイン](get-domain-late.md)に対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 From aa4f065f193c94d10572df14e16978c139589627 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 3 Jun 2025 18:13:45 +0900 Subject: [PATCH 1843/3948] execution: upon_error,upon_stopped (#1384) --- reference/execution/execution.md | 4 +- reference/execution/execution/then.md | 4 +- reference/execution/execution/upon_error.md | 131 ++++++++++++++++++ reference/execution/execution/upon_stopped.md | 131 ++++++++++++++++++ 4 files changed, 266 insertions(+), 4 deletions(-) create mode 100644 reference/execution/execution/upon_error.md create mode 100644 reference/execution/execution/upon_stopped.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 01255f417b..2b8269b57c 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -116,8 +116,8 @@ namespace std::execution { | [`execution::on`](execution/on.md) | 指定Senderのみ別Scheduler上で実行する (customization point object) | C++26 | | [`execution::schedule_from`](execution/schedule_from.md) | Sender完了に依存する作業をスケジュール (customization point object) | C++26 | | [`execution::then`](execution/then.md) | 値完了時の継続処理をアタッチ (customization point object) | C++26 | -| [`execution::upon_error`](execution/upon_error.md.nolink) | エラー完了時の継続処理をアタッチ (customization point object) | C++26 | -| [`execution::upon_stopped`](execution/upon_stopped.md.nolink) | 停止完了時の継続処理をアタッチ (customization point object) | C++26 | +| [`execution::upon_error`](execution/upon_error.md) | エラー完了時の継続処理をアタッチ (customization point object) | C++26 | +| [`execution::upon_stopped`](execution/upon_stopped.md) | 停止完了時の継続処理をアタッチ (customization point object) | C++26 | | [`execution::let_value`](execution/let_value.md) | 値完了結果から入れ子の非同期操作へ変換 (customization point object) | C++26 | | [`execution::let_error`](execution/let_error.md.nolink) | エラー完了結果から入れ子の非同期操作へ変換 (customization point object) | C++26 | | [`execution::let_stopped`](execution/let_stopped.md.nolink) | 停止完了を入れ子の非同期操作へ変換 (customization point object) | C++26 | diff --git a/reference/execution/execution/then.md b/reference/execution/execution/then.md index 27187eda48..3ec21dcda2 100644 --- a/reference/execution/execution/then.md +++ b/reference/execution/execution/then.md @@ -123,8 +123,8 @@ C++ ## 関連項目 -- [`execution::upon_error`](upon_error.md.nolink) -- [`execution::upon_stopped`](upon_stopped.md.nolink) +- [`execution::upon_error`](upon_error.md) +- [`execution::upon_stopped`](upon_stopped.md) ## 参照 diff --git a/reference/execution/execution/upon_error.md b/reference/execution/execution/upon_error.md new file mode 100644 index 0000000000..0dce0ce7ed --- /dev/null +++ b/reference/execution/execution/upon_error.md @@ -0,0 +1,131 @@ +# upon_error +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct upon_error_t { unspecified }; + inline constexpr upon_error_t upon_error{}; +} +``` +* unspecified[italic] + +## 概要 +`upon_error`は、入力[Sender](sender.md)の[エラー完了操作](set_error.md)の継続として関数呼び出しをアタッチし、戻り値データを[正常完了](set_value.md)として送信するSenderアダプタである。 + +`upon_error`は[パイプ可能Senderアダプタオブジェクト](sender_adaptor_closure.md)であり、パイプライン記法をサポートする。 + + +## 効果 +説明用の式`sndr`と`f`に対して、`decltype((sndr))`が[`sender`](sender.md)を満たさない、もしくは`decltype((f))`が[`movable-value`](../movable-value.md)を満たさないとき、呼び出し式`upon_error(sndr, f)`は不適格となる。 + +そうでなければ、呼び出し式`upon_error(sndr, f)`は`sndr`が1回だけ評価されることを除いて、下記と等価。 + +```cpp +transform_sender(get-domain-early(sndr), make-sender(upon_error, f, sndr)) +``` +* transform_sender[link transform_sender.md] +* get-domain-early[link get-domain-early.md] +* make-sender[link make-sender.md] + + +### Senderアルゴリズムタグ `upon_error` +Senderアルゴリズム動作説明用のクラステンプレート[`impls-for`](impls-for.md)に対して、下記の特殊化が定義される。 + +```cpp +namespace std::execution { + template<> + struct impls-for> : default-impls { + static constexpr auto complete = + [] + (auto, auto& fn, auto& rcvr, Tag, Args&&... args) noexcept -> void { + if constexpr (same_as>) { + TRY-SET-VALUE(rcvr, + invoke(std::move(fn), std::forward(args)...)); + } else { + Tag()(std::move(rcvr), std::forward(args)...); + } + }; + }; +} +``` +* decayed-typeof[link /reference/functional/decayed-typeof.md] +* impls-for[link impls-for.md] +* default-impls[link impls-for.md] +* set_error[link set_error.md] +* TRY-SET-VALUE[link set_value.md] +* invoke[link /reference/functional/invoke.md] +* std::move[link /reference/utility/move.md] + + +## カスタマイゼーションポイント +Senderアルゴリズム構築時および[Receiver](receiver.md)接続時に、関連付けられた実行ドメインに対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 +[デフォルト実行ドメイン](default_domain.md)では無変換。 + +戻り値の[Sender](sender.md)`out_sndr`が下記を満たさない場合、呼び出し式`upon_error(sndr, f)`の動作は未定義となる。 + +- `upon_error`に対する`sndr`のエラー結果データで`f`またはそのコピーを呼び出し、`out_sndr`の値完了として`f`の結果値を用いること。 +- 他の完了操作では変更なしに転送すること。 + + +## 例 +```cpp example +#include +#include +namespace ex = std::execution; + +int main() +{ + { // 関数呼び出し + ex::sender auto snd0 = ex::just_error(42); + ex::sender auto snd1 = ex::upon_error(snd0, [](int err) { + return err; + }); + auto [v] = std::this_thread::sync_wait(snd1).value(); + std::println("{}", v); + } + + { // パイプライン記法 + ex::sender auto sndr = ex::just_error(42) + | ex::upon_error([](int err) { + return err; + }); + auto [v] = std::this_thread::sync_wait(sndr).value(); + std::println("{}", v); + } +} +``` +* ex::upon_error[color ff0000] +* ex::sender[link sender.md] +* ex::just_error[link just.md] +* std::this_thread::sync_wait[link ../this_thread/sync_wait.md] +* value()[link /reference/optional/optional/value.md] + +### 出力 +``` +42 +42 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::then`](then.md) +- [`execution::upon_stopped`](upon_stopped.md) + + +## 参照 +- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/upon_stopped.md b/reference/execution/execution/upon_stopped.md new file mode 100644 index 0000000000..dc0698ae60 --- /dev/null +++ b/reference/execution/execution/upon_stopped.md @@ -0,0 +1,131 @@ +# upon_stopped +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct upon_stopped_t { unspecified }; + inline constexpr upon_stopped_t upon_stopped{}; +} +``` +* unspecified[italic] + +## 概要 +`upon_stopped`は、入力[Sender](sender.md)の[停止完了操作](set_stopped.md)の継続として関数呼び出しをアタッチし、戻り値データを[正常完了](set_value.md)として送信するSenderアダプタである。 + +`upon_stopped`は[パイプ可能Senderアダプタオブジェクト](sender_adaptor_closure.md)であり、パイプライン記法をサポートする。 + + +## 効果 +説明用の式`sndr`と`f`に対して、`decltype((sndr))`が[`sender`](sender.md)を満たさない、もしくは`decltype((f))`が[`movable-value`](../movable-value.md)を満たさないとき、呼び出し式`upon_stopped(sndr, f)`は不適格となる。 + +そうでなければ、呼び出し式`upon_stopped(sndr, f)`は`sndr`が1回だけ評価されることを除いて、下記と等価。 + +```cpp +transform_sender(get-domain-early(sndr), make-sender(upon_stopped, f, sndr)) +``` +* transform_sender[link transform_sender.md] +* get-domain-early[link get-domain-early.md] +* make-sender[link make-sender.md] + + +### Senderアルゴリズムタグ `upon_error` +Senderアルゴリズム動作説明用のクラステンプレート[`impls-for`](impls-for.md)に対して、下記の特殊化が定義される。 + +```cpp +namespace std::execution { + template<> + struct impls-for> : default-impls { + static constexpr auto complete = + [] + (auto, auto& fn, auto& rcvr, Tag, Args&&... args) noexcept -> void { + if constexpr (same_as>) { + TRY-SET-VALUE(rcvr, + invoke(std::move(fn), std::forward(args)...)); + } else { + Tag()(std::move(rcvr), std::forward(args)...); + } + }; + }; +} +``` +* decayed-typeof[link /reference/functional/decayed-typeof.md] +* impls-for[link impls-for.md] +* default-impls[link impls-for.md] +* set_stopped[link set_stopped.md] +* TRY-SET-VALUE[link set_value.md] +* invoke[link /reference/functional/invoke.md] +* std::move[link /reference/utility/move.md] + + +## カスタマイゼーションポイント +Senderアルゴリズム構築時および[Receiver](receiver.md)接続時に、関連付けられた実行ドメインに対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 +[デフォルト実行ドメイン](default_domain.md)では無変換。 + +戻り値の[Sender](sender.md)`out_sndr`が下記を満たさない場合、呼び出し式`upon_stopped(sndr, f)`の動作は未定義となる。 + +- `upon_stopped`に対する`sndr`の停止結果データで`f`またはそのコピーを呼び出し、`out_sndr`の値完了として`f`の結果値を用いること。 +- 他の完了操作では変更なしに転送すること。 + + +## 例 +```cpp example +#include +#include +namespace ex = std::execution; + +int main() +{ + { // 関数呼び出し + ex::sender auto snd0 = ex::just_stopped(); + ex::sender auto snd1 = ex::upon_stopped(snd0, []() { + return 42; + }); + auto [v] = std::this_thread::sync_wait(snd1).value(); + std::println("{}", v); + } + + { // パイプライン記法 + ex::sender auto sndr = ex::just_stopped() + | ex::upon_stopped([]() { + return 42; + }); + auto [v] = std::this_thread::sync_wait(sndr).value(); + std::println("{}", v); + } +} +``` +* ex::upon_stopped[color ff0000] +* ex::sender[link sender.md] +* ex::just_stopped[link just.md] +* std::this_thread::sync_wait[link ../this_thread/sync_wait.md] +* value()[link /reference/optional/optional/value.md] + +### 出力 +``` +42 +42 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::then`](then.md) +- [`execution::upon_error`](upon_error.md) + + +## 参照 +- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) From 01410683b0f418c9a07af00cd1f4ff03a37a0b72 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 3 Jun 2025 23:36:23 +0900 Subject: [PATCH 1844/3948] execution: let_error,let_stopped (#1384) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit let_valueページにて包括的な仕様説明を記述 --- reference/execution/execution.md | 4 +- reference/execution/execution/let_error.md | 84 +++++++++++++++++++ reference/execution/execution/let_stopped.md | 84 +++++++++++++++++++ reference/execution/execution/let_value.md | 47 ++++++----- .../execution/execution/stopped_as_error.md | 2 +- .../execution/stopped_as_optional.md | 2 +- 6 files changed, 200 insertions(+), 23 deletions(-) create mode 100644 reference/execution/execution/let_error.md create mode 100644 reference/execution/execution/let_stopped.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 2b8269b57c..352d5fec1a 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -119,8 +119,8 @@ namespace std::execution { | [`execution::upon_error`](execution/upon_error.md) | エラー完了時の継続処理をアタッチ (customization point object) | C++26 | | [`execution::upon_stopped`](execution/upon_stopped.md) | 停止完了時の継続処理をアタッチ (customization point object) | C++26 | | [`execution::let_value`](execution/let_value.md) | 値完了結果から入れ子の非同期操作へ変換 (customization point object) | C++26 | -| [`execution::let_error`](execution/let_error.md.nolink) | エラー完了結果から入れ子の非同期操作へ変換 (customization point object) | C++26 | -| [`execution::let_stopped`](execution/let_stopped.md.nolink) | 停止完了を入れ子の非同期操作へ変換 (customization point object) | C++26 | +| [`execution::let_error`](execution/let_error.md) | エラー完了結果から入れ子の非同期操作へ変換 (customization point object) | C++26 | +| [`execution::let_stopped`](execution/let_stopped.md) | 停止完了を入れ子の非同期操作へ変換 (customization point object) | C++26 | | [`execution::bulk`](execution/bulk.md) | インデクス空間上で指定関数を反復実行 (customization point object) | C++26 | | [`execution::split`](execution/split.md) | 入力Senderの値を複製回送信可能とする (customization point object) | C++26 | | [`execution::when_all`](execution/when_all.md) | 全ての入力Sender完了を待機 (customization point object) | C++26 | diff --git a/reference/execution/execution/let_error.md b/reference/execution/execution/let_error.md new file mode 100644 index 0000000000..696142e475 --- /dev/null +++ b/reference/execution/execution/let_error.md @@ -0,0 +1,84 @@ +# let_error +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct let_error_t { unspecified }; + inline constexpr let_error_t let_error{}; +} +``` +* unspecified[italic] + +## 概要 +`let_error`は、新しいSenderを返す関数呼び出し可能なオブジェクトに引き渡すことで、入力[Sender](sender.md)の[エラー完了](set_error.md)結果から入れ子の非同期操作へと変換するSenderアダプタである。 + +`let_error`は[パイプ可能Senderアダプタオブジェクト](sender_adaptor_closure.md)であり、パイプライン記法をサポートする。 + +Senderアルゴリズム`let_error`の仕様は、[`let_value`](let_value.md)ページを参照のこと。 + + +## 例 +```cpp example +#include +#include +namespace ex = std::execution; + +int main() +{ + { // 関数呼び出し + ex::sender auto snd0 = ex::just_error(21); + ex::sender auto snd1 = ex::let_error( + snd0, + [](int n) -> ex::sender auto { + return ex::just(n * 2); + }); + auto [val] = std::this_thread::sync_wait(snd1).value(); + std::println("{}", val); + } + + { // パイプライン記法 + ex::sender auto sndr = ex::just_error(21) + | ex::let_error( + [](int n) -> ex::sender auto { + return ex::just(n * 2); + }); + auto [val] = std::this_thread::sync_wait(sndr).value(); + std::println("{}", val); + } +} +``` +* ex::let_error[color ff0000] +* ex::sender[link sender.md] +* ex::just[link just.md] +* ex::just_error[link just_error.md] +* std::this_thread::sync_wait[link ../this_thread/sync_wait.md] +* value()[link /reference/optional/optional/value.md] + +### 出力 +``` +42 +42 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::let_value`](let_value.md) +- [`execution::let_stopped`](let_stopped.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/let_stopped.md b/reference/execution/execution/let_stopped.md new file mode 100644 index 0000000000..6710af764e --- /dev/null +++ b/reference/execution/execution/let_stopped.md @@ -0,0 +1,84 @@ +# let_stopped +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct let_stopped_t { unspecified }; + inline constexpr let_stopped_t let_stopped{}; +} +``` +* unspecified[italic] + +## 概要 +`let_stopped`は、新しいSenderを返す関数呼び出し可能なオブジェクトに引き渡すことで、入力[Sender](sender.md)の[停止完了](set_stopped.md)結果から入れ子の非同期操作へと変換するSenderアダプタである。 + +`let_stopped`は[パイプ可能Senderアダプタオブジェクト](sender_adaptor_closure.md)であり、パイプライン記法をサポートする。 + +Senderアルゴリズム`let_stopped`の仕様は、[`let_value`](let_value.md)ページを参照のこと。 + + +## 例 +```cpp example +#include +#include +namespace ex = std::execution; + +int main() +{ + { // 関数呼び出し + ex::sender auto snd0 = ex::just_stopped(); + ex::sender auto snd1 = ex::let_stopped( + snd0, + []() -> ex::sender auto { + return ex::just(42); + }); + auto [val] = std::this_thread::sync_wait(snd1).value(); + std::println("{}", val); + } + + { // パイプライン記法 + ex::sender auto sndr = ex::just_stopped() + | ex::let_stopped( + []() -> ex::sender auto { + return ex::just(42); + }); + auto [val] = std::this_thread::sync_wait(sndr).value(); + std::println("{}", val); + } +} +``` +* ex::let_stopped[color ff0000] +* ex::sender[link sender.md] +* ex::just[link just.md] +* ex::just_stopped[link just_stopped.md] +* std::this_thread::sync_wait[link ../this_thread/sync_wait.md] +* value()[link /reference/optional/optional/value.md] + +### 出力 +``` +42 +42 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::let_value`](let_value.md) +- [`execution::let_error`](let_error.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/let_value.md b/reference/execution/execution/let_value.md index a8ef9f8421..effdb9a9df 100644 --- a/reference/execution/execution/let_value.md +++ b/reference/execution/execution/let_value.md @@ -17,27 +17,35 @@ namespace std::execution { `let_value`は[パイプ可能Senderアダプタオブジェクト](sender_adaptor_closure.md)であり、パイプライン記法をサポートする。 +本ページにてSenderアルゴリズム`let_value`/[`let_error`](let_error.md)/[`let_stopped`](let_stopped.md)の動作仕様を包括的に説明するため、以降のセクションにおいては、`let-cpo`, `set-cpo`をそれぞれ下記の通りとする。 + +| `let-cpo` | `set-cpo` | +|----|----| +| `let_value` | [`set_value`](set_value.md) | +| [`let_error`](let_error.md) | [`set_error`](set_error.md) | +| [`let_stopped`](let_stopped.md) | [`set_stopped`](set_stopped.md) | + ## 効果 -説明用の式`sndr`と`f`に対して、`decltype((sndr))`が[`sender`](sender.md)を満たさない、もしくは`decltype((f))`が[`movable-value`](../movable-value.md)を満たさないとき、呼び出し式`let_value(sndr, f)`は不適格となる。 +説明用の式`sndr`と`f`に対して、`decltype((sndr))`が[`sender`](sender.md)を満たさない、もしくは`decltype((f))`が[`movable-value`](../movable-value.md)を満たさないとき、呼び出し式`let-cpo(sndr, f)`は不適格となる。 -そうでなければ、呼び出し式`let_value(sndr, f)`は`sndr`が1回だけ評価されることを除いて、下記と等価。 +そうでなければ、呼び出し式`let-cpo(sndr, f)`は`sndr`が1回だけ評価されることを除いて、下記と等価。 ```cpp -transform_sender(get-domain-early(sndr), make-sender(let_value, f, sndr)) +transform_sender(get-domain-early(sndr), make-sender(let-cpo, f, sndr)) ``` * transform_sender[link transform_sender.md] * get-domain-early[link get-domain-early.md] * make-sender[link make-sender.md] -### Senderアルゴリズムタグ `let_value` +### Senderアルゴリズムタグ `let-cpo` Senderアルゴリズム動作説明用のクラステンプレート[`impls-for`](impls-for.md)に対して、下記の特殊化が定義される。 ```cpp namespace std::execution { template<> - struct impls-for> : default-impls { + struct impls-for> : default-impls { static constexpr auto get-state = see below; static constexpr auto complete = see below; }; @@ -46,9 +54,10 @@ namespace std::execution { * impls-for[link impls-for.md] * default-impls[link impls-for.md] * decayed-typeof[link /reference/functional/decayed-typeof.md] +* let-cpo[italic] * see below[italic] -`impls-for>::get-state`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 +`impls-for>::get-state`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 - `args_variant_t` : 入力Sender`sndr`の完了シグネチャ集合から求まる送信値リスト型情報(`variant, ...>`) - `ops2_variant_t` : `f`が返すSenderに対応する非同期操作型情報(`variant`) @@ -78,7 +87,7 @@ namespace std::execution { * decay_t[link /reference/type_traits/decay.md] * see below[italic] -- 説明用のパック`Sigs`を[`completion_signatures_of_t`](completion_signatures_of_t.md)`<`[`child-type`](child-type.md)`,` [`env_of_t`](env_of_t.md)`>`による[`completion_signatures`](completion_signatures.md)特殊化のテンプレートパラメータとし、パック`LetSigs`を`Sigs`に含まれる型のうち戻り値型が[`decayed-typeof`](/reference/functional/decayed-typeof.md)`<`[`set_value`](set_value.md)`>`に等しいものと定義する。説明用のエイリアステンプレート`as-tuple`を[`decayed-tuple`](decayed-tuple.md)``と定義する。型`args_variant_t`は下記定義において重複削除した型となる。 +- 説明用のパック`Sigs`を[`completion_signatures_of_t`](completion_signatures_of_t.md)`<`[`child-type`](child-type.md)`,` [`env_of_t`](env_of_t.md)`>`による[`completion_signatures`](completion_signatures.md)特殊化のテンプレートパラメータとし、パック`LetSigs`を`Sigs`に含まれる型のうち戻り値型が[`decayed-typeof`](/reference/functional/decayed-typeof.md)``に等しいものと定義する。説明用のエイリアステンプレート`as-tuple`を[`decayed-tuple`](decayed-tuple.md)``と定義する。型`args_variant_t`は下記定義において重複削除した型となる。 ```cpp variant...> @@ -97,35 +106,35 @@ namespace std::execution { - 型`args_variant_t`および`ops2_variant_t`が適格なときに限って、上記ラムダ式のrequires節が満たされる。 -`impls-for>::complete`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 +`impls-for>::complete`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 -- [値完了](set_value.md)の場合、`let_value`Sender構築時の引数`f`に対して`f(args...)`を呼び出し、戻り値[Sender](sender.md)から入れ子非同期操作を開始する。同Senderの完了結果を接続先[Receiver](receiver.md)へ転送する。 +- 完了関数`set-cpo`の場合、Sender構築時の引数`f`に対して`f(args...)`を呼び出し、戻り値[Sender](sender.md)から入れ子非同期操作を開始する。同Senderの完了結果を接続先[Receiver](receiver.md)へ転送する。 - それ以外の完了操作の場合、接続先[Receiver](receiver.md)の同種完了関数へ転送する。 ```cpp [] (auto, auto& state, auto& rcvr, Tag, Args&&... args) noexcept -> void { - if constexpr (same_as>) { + if constexpr (same_as>) { TRY-EVAL(rcvr, let-bind(state, rcvr, std::forward(args)...)); } else { Tag()(std::move(rcvr), std::forward(args)...); } } ``` -* set_value[link set_value.md] * decayed-typeof[link /reference/functional/decayed-typeof.md] * TRY-EVAL[link set_value.md] * std::move[link /reference/utility/move.md] +* set-cpo[italic] -説明用の式`sndr`と`env`に対して、型`Sndr`を`decltype((sndr))`とする。[`sender-for`](sender-for.md)`> == false`のとき、式`let_value.transform_env(sndr, env)`は不適格となる。 +説明用の式`sndr`と`env`に対して、型`Sndr`を`decltype((sndr))`とする。[`sender-for`](sender-for.md)`> == false`のとき、式`let-cpo.transform_env(sndr, env)`は不適格となる。 -そうでなければ、式`let_value.transform_env(sndr, env)`は[`JOIN-ENV`](../queryable.md)`(let-env(sndr),` [`FWD-ENV`](../forwarding_query.md)`(env))`と等価。 +そうでなければ、式`let-cpo.transform_env(sndr, env)`は[`JOIN-ENV`](../queryable.md)`(let-env(sndr),` [`FWD-ENV`](../forwarding_query.md)`(env))`と等価。 ## 説明専用エンティティ 説明用の式`sndr`を用いて、`let-env(sndr)`を下記リストのうち最初に適格となる式と定義する。 -- [`SCHED-ENV`](schedule.md)`(`[`get_completion_scheduler`](get_completion_scheduler.md)`<`[`decayed-typeof`](/reference/functional/decayed-typeof.md)`<`[`set_value`](set_value.md)`>>(`[`get_env`](get_env.md)`(sndr)))` +- [`SCHED-ENV`](schedule.md)`(`[`get_completion_scheduler`](get_completion_scheduler.md)`<`[`decayed-typeof`](/reference/functional/decayed-typeof.md)`>(`[`get_env`](get_env.md)`(sndr)))` - [`MAKE-ENV`](../queryable.md)`(`[`get_domain`](get_domain.md)`,` [`get_domain`](get_domain.md)`(`[`get_env`](get_env.md)`(sndr)))` - `(void(sndr),` [`env<>{}`](env.md)`)` @@ -210,11 +219,11 @@ namespace std::execution { Senderアルゴリズム構築時および[Receiver](receiver.md)接続時に、関連付けられた実行ドメインに対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 [デフォルト実行ドメイン](default_domain.md)では無変換。 -説明用の式`out_sndr`を`let_value(sndr, f)`の戻り値[Sender](sender.md)とし、式`rcvr`を式[`connect`](connect.md)`(out_sndr, rcvr)`が適格となる[Receiver](receiver.md)とする。式[`connect`](connect.md)`(out_sndr, rcvr)`は[開始(start)](start.md)時に下記を満たす非同期操作を生成しない場合、動作は未定義となる。 +説明用の式`out_sndr`を`let-cpo(sndr, f)`の戻り値[Sender](sender.md)とし、式`rcvr`を式[`connect`](connect.md)`(out_sndr, rcvr)`が適格となる[Receiver](receiver.md)とする。式[`connect`](connect.md)`(out_sndr, rcvr)`は[開始(start)](start.md)時に下記を満たす非同期操作を生成しない場合、動作は未定義となる。 -- 入力[Sender](sender.md)`sndr`の完了結果で[`set_value`](set_value.md)が呼ばれるとき、`f`を呼び出すこと。 +- 入力[Sender](sender.md)`sndr`の完了結果で`set-cpo`が呼ばれるとき、`f`を呼び出すこと。 - 非同期操作の完了は、`f`が返すSenderの完了に依存すること。 -- `sndr`により送信された他完了操作を伝搬すること。 +- `sndr`により送信された他の完了操作を伝搬すること。 ## 例 @@ -387,8 +396,8 @@ catch 0 ## 関連項目 -- [`execution::let_error`](let_error.md.nolink) -- [`execution::let_stopped`](let_stopped.md.nolink) +- [`execution::let_error`](let_error.md) +- [`execution::let_stopped`](let_stopped.md) ## 参照 diff --git a/reference/execution/execution/stopped_as_error.md b/reference/execution/execution/stopped_as_error.md index 678417fc25..92c680eee4 100644 --- a/reference/execution/execution/stopped_as_error.md +++ b/reference/execution/execution/stopped_as_error.md @@ -45,7 +45,7 @@ return let_stopped( return just_error(std::move(err)); }); ``` -* let_stopped[link let_stopped.md.nolink] +* let_stopped[link let_stopped.md] * just_error[link just_error.md] * is_nothrow_move_constructible_v[link /reference/type_traits/is_nothrow_move_constructible.md] * std::move[link /reference/utility/move.md] diff --git a/reference/execution/execution/stopped_as_optional.md b/reference/execution/execution/stopped_as_optional.md index 7cbab481f7..fab6ba572b 100644 --- a/reference/execution/execution/stopped_as_optional.md +++ b/reference/execution/execution/stopped_as_optional.md @@ -45,7 +45,7 @@ return let_stopped( []() noexcept { return just(optional()); }); ``` * single-sender-value-type[link single-sender-value-type.md] -* let_stopped[link let_stopped.md.nolink] +* let_stopped[link let_stopped.md] * then[link then.md] * just[link just.md] * is_nothrow_constructible_v[link /reference/type_traits/is_nothrow_constructible.md] From d512d567fb5228d3abb008e160cfdbe8be1fb7d0 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 3 Jun 2025 23:55:13 +0900 Subject: [PATCH 1845/3948] =?UTF-8?q?functional:=20=E5=AE=9F=E8=A1=8C?= =?UTF-8?q?=E5=88=B6=E5=BE=A1=E3=83=A9=E3=82=A4=E3=83=96=E3=83=A9=E3=83=AA?= =?UTF-8?q?=E3=81=B8=E3=81=AE=E5=86=85=E9=83=A8=E3=83=AA=E3=83=B3=E3=82=AF?= =?UTF-8?q?=E4=BB=98=E4=B8=8E=20(#1384)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/functional/call-result-t.md | 2 +- reference/functional/callable.md | 2 +- reference/functional/decayed-typeof.md | 2 +- reference/functional/nothrow-callable.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/functional/call-result-t.md b/reference/functional/call-result-t.md index 687b8eda25..bccac00510 100644 --- a/reference/functional/call-result-t.md +++ b/reference/functional/call-result-t.md @@ -14,7 +14,7 @@ using call-result-t = decltype(declval()(declval()...)); // expositio ## 備考 -説明専用のエイリアステンプレート`call-result-t`は、実行制御ライブラリの仕様定義のため導入された。 +説明専用のエイリアステンプレート`call-result-t`は、[実行制御ライブラリ](/reference/execution/execution.md)の仕様定義のため導入された。 ## バージョン diff --git a/reference/functional/callable.md b/reference/functional/callable.md index da1ac1b63b..29ca46abb4 100644 --- a/reference/functional/callable.md +++ b/reference/functional/callable.md @@ -17,7 +17,7 @@ concept callable = // exposition only ## 備考 -説明専用のコンセプト`callable`は、実行制御ライブラリの仕様定義のため導入された。 +説明専用のコンセプト`callable`は、[実行制御ライブラリ](/reference/execution/execution.md)の仕様定義のため導入された。 ## バージョン diff --git a/reference/functional/decayed-typeof.md b/reference/functional/decayed-typeof.md index f7d9e6cc5a..6c243dc425 100644 --- a/reference/functional/decayed-typeof.md +++ b/reference/functional/decayed-typeof.md @@ -14,7 +14,7 @@ using decayed-typeof = decltype(auto(Tag)); // exposition only ## 備考 -説明専用のエイリアステンプレート`decayed-typeof`は、実行制御ライブラリの仕様定義のため導入された。 +説明専用のエイリアステンプレート`decayed-typeof`は、[実行制御ライブラリ](/reference/execution/execution.md)の仕様定義のため導入された。 ## バージョン diff --git a/reference/functional/nothrow-callable.md b/reference/functional/nothrow-callable.md index d82448883e..836c61e12b 100644 --- a/reference/functional/nothrow-callable.md +++ b/reference/functional/nothrow-callable.md @@ -19,7 +19,7 @@ concept nothrow-callable = // exposition only ## 備考 -説明専用のコンセプト`nothrow-callable`は、実行制御ライブラリの仕様定義のため導入された。 +説明専用のコンセプト`nothrow-callable`は、[実行制御ライブラリ](/reference/execution/execution.md)の仕様定義のため導入された。 ## バージョン From 30c85314c8ce33811bd787a30fbb96a001c8931e Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 4 Jun 2025 00:06:10 +0900 Subject: [PATCH 1846/3948] =?UTF-8?q?execution:=20=E5=BD=B1=E9=9F=BF?= =?UTF-8?q?=E7=AE=87=E6=89=80=E3=81=B8P3396R1=E5=8F=82=E7=85=A7=E8=BF=BD?= =?UTF-8?q?=E8=A8=98=20(#1384)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/execution/execution/as_awaitable.md | 1 + reference/execution/execution/basic-operation.md | 1 + reference/execution/execution/connect.md | 3 ++- reference/execution/execution/let_value.md | 1 + reference/execution/execution/schedule_from.md | 1 + reference/execution/execution/scheduler.md | 1 + reference/execution/execution/when_all.md | 1 + reference/execution/execution/write-env.md | 1 + 8 files changed, 9 insertions(+), 1 deletion(-) diff --git a/reference/execution/execution/as_awaitable.md b/reference/execution/execution/as_awaitable.md index fa406534a5..9b758ed05f 100644 --- a/reference/execution/execution/as_awaitable.md +++ b/reference/execution/execution/as_awaitable.md @@ -218,3 +218,4 @@ value-type await_resume(); ## 参照 - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3396R1 std::execution wording fixes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3396r1.html) diff --git a/reference/execution/execution/basic-operation.md b/reference/execution/execution/basic-operation.md index d6b41da854..ff9838484e 100644 --- a/reference/execution/execution/basic-operation.md +++ b/reference/execution/execution/basic-operation.md @@ -151,3 +151,4 @@ using indices-for = remove_reference_t::indices-for; // exposition only ## 参照 - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3396R1 std::execution wording fixes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3396r1.html) diff --git a/reference/execution/execution/connect.md b/reference/execution/execution/connect.md index 346172278b..1ca3d497b1 100644 --- a/reference/execution/execution/connect.md +++ b/reference/execution/execution/connect.md @@ -125,7 +125,7 @@ completion_signatures< * set_stopped_t[link set_stopped.md] * exception_ptr[link /reference/exception/exception_ptr.md] -説明用の関数テンプレート`suspend-complete`とコルーチン`suspend-awaitable`を下記の通り定義する。 +説明用の関数テンプレート`suspend-complete`とコルーチン`connect-awaitable`を下記の通り定義する。 ```cpp namespace std::execution { @@ -237,3 +237,4 @@ int main() ## 参照 - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3396R1 std::execution wording fixes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3396r1.html) diff --git a/reference/execution/execution/let_value.md b/reference/execution/execution/let_value.md index effdb9a9df..126b5d1e8d 100644 --- a/reference/execution/execution/let_value.md +++ b/reference/execution/execution/let_value.md @@ -403,3 +403,4 @@ catch 0 ## 参照 - [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3396R1 std::execution wording fixes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3396r1.html) diff --git a/reference/execution/execution/schedule_from.md b/reference/execution/execution/schedule_from.md index 43464855e0..7ca0c2e014 100644 --- a/reference/execution/execution/schedule_from.md +++ b/reference/execution/execution/schedule_from.md @@ -212,3 +212,4 @@ Senderアルゴリズム構築時および[Receiver](receiver.md)接続時に、 ## 参照 - [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3396R1 std::execution wording fixes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3396r1.html) diff --git a/reference/execution/execution/scheduler.md b/reference/execution/execution/scheduler.md index 0a456b15a1..9cb7b25f29 100644 --- a/reference/execution/execution/scheduler.md +++ b/reference/execution/execution/scheduler.md @@ -133,3 +133,4 @@ int main() ## 参照 - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3396R1 std::execution wording fixes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3396r1.html) diff --git a/reference/execution/execution/when_all.md b/reference/execution/execution/when_all.md index 31cff92e19..b94f58fd72 100644 --- a/reference/execution/execution/when_all.md +++ b/reference/execution/execution/when_all.md @@ -482,3 +482,4 @@ error=-2 ## 参照 - [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3396R1 std::execution wording fixes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3396r1.html) diff --git a/reference/execution/execution/write-env.md b/reference/execution/execution/write-env.md index 8b97ac73c6..3bfda3d391 100644 --- a/reference/execution/execution/write-env.md +++ b/reference/execution/execution/write-env.md @@ -57,3 +57,4 @@ struct impls-for : default-impls { ## 参照 - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3396R1 std::execution wording fixes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3396r1.html) From 03cf02bed041cce71b018d21e9ae2320ac30c20c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 4 Jun 2025 11:59:05 +0900 Subject: [PATCH 1847/3948] =?UTF-8?q?adjacent=5Ftransform=5Fview=20:=20?= =?UTF-8?q?=E3=83=A1=E3=83=B3=E3=83=90=E9=96=A2=E6=95=B0=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/adjacent_transform_view.md | 49 +++++++----- .../ranges/adjacent_transform_view/base.md | 71 +++++++++++++++++ .../ranges/adjacent_transform_view/begin.md | 72 +++++++++++++++++ .../ranges/adjacent_transform_view/end.md | 79 +++++++++++++++++++ .../adjacent_transform_view/op_constructor.md | 68 ++++++++++++++++ .../op_deduction_guide.md | 59 ++++++++++++++ .../ranges/adjacent_transform_view/size.md | 73 +++++++++++++++++ 7 files changed, 453 insertions(+), 18 deletions(-) create mode 100644 reference/ranges/adjacent_transform_view/base.md create mode 100644 reference/ranges/adjacent_transform_view/begin.md create mode 100644 reference/ranges/adjacent_transform_view/end.md create mode 100644 reference/ranges/adjacent_transform_view/op_constructor.md create mode 100644 reference/ranges/adjacent_transform_view/op_deduction_guide.md create mode 100644 reference/ranges/adjacent_transform_view/size.md diff --git a/reference/ranges/adjacent_transform_view.md b/reference/ranges/adjacent_transform_view.md index 4e4c10baa5..96e0921348 100644 --- a/reference/ranges/adjacent_transform_view.md +++ b/reference/ranges/adjacent_transform_view.md @@ -54,43 +54,54 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |--------------------------------------------------|----------------------------------|----------------| -| [`(constructor)`](adjacent_transform_view/op_constructor.md.nolink) | コンストラクタ | C++23 | -| [`base`](adjacent_transform_view/base.md.nolink) | `V`の参照を取得する | C++23 | -| [`begin`](adjacent_transform_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++23 | -| [`end`](adjacent_transform_view/end.md.nolink) | 番兵を取得する | C++23 | -| [`size`](adjacent_transform_view/size.md.nolink) | 要素数を取得する | C++23 | +| [`(constructor)`](adjacent_transform_view/op_constructor.md) | コンストラクタ | C++23 | +| [`base`](adjacent_transform_view/base.md) | `V`の参照を取得する | C++23 | +| [`begin`](adjacent_transform_view/begin.md) | 先頭を指すイテレータを取得する | C++23 | +| [`end`](adjacent_transform_view/end.md) | 番兵を取得する | C++23 | +| [`size`](adjacent_transform_view/size.md) | 要素数を取得する | C++23 | ## 継承しているメンバ関数 | 名前 | 説明 | 対応バージョン | |----------------------------------------------|-----------------------------------|----------------| -| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++20 | -| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++20 | -| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | -| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | +| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++23 | +| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++23 | +| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++23 | +| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++23 | | [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | | [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | -| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | +| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++23 | ## 推論補助 | 名前 | 説明 | 対応バージョン | |-------------------------------------------------------|------------------------------|----------------| -| [`(deduction_guide)`](adjacent_transform_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | +| [`(deduction_guide)`](adjacent_transform_view/op_deduction_guide.md) | クラステンプレートの推論補助 | C++23 | ## 例 ```cpp example +#include +#include +#include + int main() { // 隣接する要素間の差を計算する std::vector v = {9, 2, 5, 3, 6, 7}; - std::println("{}", v | std::views::adjacent_transform_view<2>([](auto x, auto y) { return y - x; })); + for (int x : v | std::views::adjacent_transform_view<2>( + [](auto x, auto y) { return y - x; })) { + std::cout << x << std::endl; + } } ``` * std::views::adjacent_transform_view[color ff0000] ### 出力 ``` -[-7, 3, -2, 3, 1] +-7 +3 +-2 +3 +1 ``` @@ -99,13 +110,15 @@ int main() { - C++23 ### 処理系 -- [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? -- [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? +- [Clang](/implementation.md#clang): 20 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] ## 関連項目 -- [`adjacent_difference`](/reference/numeric/adjacent_difference.md) 隣接する2つの要素間の差を計算するアルゴリズム関数 +- [`std::adjacent_difference`](/reference/numeric/adjacent_difference.md) + - 隣接する2つの要素間の差を計算するアルゴリズム関数 + ## 参照 - [N4950 26 Ranges library](https://timsong-cpp.github.io/cppwp/n4950/ranges) +- [P2321R2 zip](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2321r2.html) diff --git a/reference/ranges/adjacent_transform_view/base.md b/reference/ranges/adjacent_transform_view/base.md new file mode 100644 index 0000000000..27640b2f6f --- /dev/null +++ b/reference/ranges/adjacent_transform_view/base.md @@ -0,0 +1,71 @@ +# base +* ranges[meta header] +* std::ranges[meta namespace] +* adjacent_transform_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr V base() const & + requires copy_constructible; // (1) C++23 + +constexpr V base() &&; // (2) C++23 +``` + +## 概要 + +メンバ変数として保持している、元のviewを取得する。 + +## 効果 + +- (1) : `return inner_.base();` +- (2) : `return std::move(inner_).base();` + +ここで、`inner_`は`adjacent_view`型のメンバ変数。 + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5}; + + auto diff = [](int x, int y) { return y - x; }; + std::ranges::adjacent_transform_view&>, decltype(diff), 2> atv(v, diff); + + // (1) コピーして取得 + auto base1 = atv.base(); + static_assert(std::same_as>>); + + // (2) ムーブして取得 + auto base2 = std::move(atv).base(); + static_assert(std::same_as>>); + + // 取得したviewを使用(元の要素を表示) + for (int n : base1) { + std::cout << n << " "; + } + std::cout << std::endl; +} +``` +* base[color ff0000] + +### 出力 +``` +1 2 3 4 5 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 20 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] + +## 参照 +- [N4950 26.7.28 Adjacent transform view](https://timsong-cpp.github.io/cppwp/n4950/range.adjacent.transform) \ No newline at end of file diff --git a/reference/ranges/adjacent_transform_view/begin.md b/reference/ranges/adjacent_transform_view/begin.md new file mode 100644 index 0000000000..0b1e5550bd --- /dev/null +++ b/reference/ranges/adjacent_transform_view/begin.md @@ -0,0 +1,72 @@ +# begin +* ranges[meta header] +* std::ranges[meta namespace] +* adjacent_transform_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr auto begin(); // (1) C++23 + +constexpr auto begin() const + requires range && + regular_invocable, N)...>; // (2) C++23 +``` +* REPEAT[italic] + +## 概要 + +先頭を指すイテレータを取得する。 + +## 効果 + +- (1) : `return iterator(*this, inner_.begin());` +- (2) : `return iterator(*this, inner_.begin());` + +ここで、`iterator`は`adjacent_transform_view`の内部で定義される説明専用のイテレータクラスであり、`InnerView`は説明専用の[`adjacent_view`](../adjacent_view.md)``である。 + +## 備考 +- `REPEAT(T, N)` をT型のN個のパックとする。 + + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5}; + + auto diff = [](int x, int y) { return y - x; }; + std::ranges::adjacent_transform_view&>, decltype(diff), 2> atv(v, diff); + + auto it = atv.begin(); + + // 最初の要素(隣接する2要素の差) + std::cout << *it << std::endl; // 2 - 1 = 1 + + // 次の要素へ + ++it; + std::cout << *it << std::endl; // 3 - 2 = 1 +} +``` +* begin[color ff0000] + +### 出力 +``` +1 +1 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 20 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] + +## 参照 +- [N4950 26.7.28 Adjacent transform view](https://timsong-cpp.github.io/cppwp/n4950/range.adjacent.transform) \ No newline at end of file diff --git a/reference/ranges/adjacent_transform_view/end.md b/reference/ranges/adjacent_transform_view/end.md new file mode 100644 index 0000000000..259037cc1f --- /dev/null +++ b/reference/ranges/adjacent_transform_view/end.md @@ -0,0 +1,79 @@ +# end +* ranges[meta header] +* std::ranges[meta namespace] +* adjacent_transform_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr auto end(); // (1) C++23 + +constexpr auto end() const + requires range && + regular_invocable, N)...>; // (2) C++23 +``` +* REPEAT[italic] + +## 概要 + +番兵を取得する。 + +## 効果 + +`common_range`が`true`の場合: + +- (1) : `return iterator(*this, inner_.end());` +- (2) : `return iterator(*this, inner_.end());` + +それ以外の場合: + +- (1) : `return sentinel(inner_.end());` +- (2) : `return sentinel(inner_.end());` + +ここで、`iterator`と`sentinel`は`adjacent_transform_view`の内部で定義される説明専用のクラスであり、`InnerView`は説明専用の[`adjacent_view`](../adjacent_view.md)``である。 + +## 備考 +- `REPEAT(T, N)` をT型のN個のパックとする。 + + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5}; + + auto diff = [](int x, int y) { return y - x; }; + std::ranges::adjacent_transform_view&>, decltype(diff), 2> atv(v, diff); + + auto begin = atv.begin(); + auto end = atv.end(); + + // 全要素を出力 + for (auto it = begin; it != end; ++it) { + std::cout << *it << " "; + } + std::cout << std::endl; +} +``` +* end[color ff0000] +* begin[link begin.md] + +### 出力 +``` +1 1 1 1 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 20 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] + +## 参照 +- [N4950 26.7.28 Adjacent transform view](https://timsong-cpp.github.io/cppwp/n4950/range.adjacent.transform) \ No newline at end of file diff --git a/reference/ranges/adjacent_transform_view/op_constructor.md b/reference/ranges/adjacent_transform_view/op_constructor.md new file mode 100644 index 0000000000..a3c26db745 --- /dev/null +++ b/reference/ranges/adjacent_transform_view/op_constructor.md @@ -0,0 +1,68 @@ +# コンストラクタ +* ranges[meta header] +* std::ranges[meta namespace] +* adjacent_transform_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +adjacent_transform_view() = default; // (1) C++23 + +constexpr explicit +adjacent_transform_view(V base, F fun); // (2) C++23 +``` + +## 概要 + +- (1) : デフォルトコンストラクタ +- (2) : 元となるRangeと変換関数を受け取るコンストラクタ + +## 効果 + +- (1) : `fun_`と`inner_`をデフォルト構築する +- (2) : `fun_`を`std::move(fun)`で初期化し、`inner_`を`std::move(base)`で初期化する + +## 例 +```cpp example +#include +#include +#include + +int main() { + // (1) デフォルトコンストラクタ + std::ranges::adjacent_transform_view< + std::ranges::empty_view, + decltype([](int, int) { return 0; }), + 2 + > atv1; + + // (2) 元となるRangeと変換関数を受け取るコンストラクタ + std::vector v = {1, 2, 3, 4, 5}; + auto diff = [](int x, int y) { return y - x; }; + std::ranges::adjacent_transform_view&>, decltype(diff), 2> atv2(v, diff); + + for (int d : atv2) { + std::cout << d << " "; + } + std::cout << std::endl; +} +``` +* std::ranges::adjacent_transform_view[color ff0000] +* std::ranges::empty_view[link ../empty_view.md] + +### 出力 +``` +1 1 1 1 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 20 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] + +## 参照 +- [N4950 26.7.28 Adjacent transform view](https://timsong-cpp.github.io/cppwp/n4950/range.adjacent.transform) \ No newline at end of file diff --git a/reference/ranges/adjacent_transform_view/op_deduction_guide.md b/reference/ranges/adjacent_transform_view/op_deduction_guide.md new file mode 100644 index 0000000000..d5fd8d477d --- /dev/null +++ b/reference/ranges/adjacent_transform_view/op_deduction_guide.md @@ -0,0 +1,59 @@ +# 推論補助 +* ranges[meta header] +* std::ranges[meta namespace] +* adjacent_transform_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template + adjacent_transform_view(R&&, F) -> + adjacent_transform_view, decay_t, 2>; +} +``` + +## 概要 +`adjacent_transform_view`クラステンプレートの型推論補助。 + +## 備考 + +この推論補助は、第3テンプレート引数`N`のデフォルト値として`2`を使用する。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5}; + auto diff = [](int x, int y) { return y - x; }; + + // adjacent_transform_viewの型を明示的に指定する必要がない(Nはデフォルトで2) + std::ranges::adjacent_transform_view atv{v, diff}; + + // 推論された型を確認 + static_assert(std::same_as< + decltype(atv), + std::ranges::adjacent_transform_view< + std::ranges::ref_view>, + decltype(diff), + 2 + > + >); +} +``` + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 20 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] diff --git a/reference/ranges/adjacent_transform_view/size.md b/reference/ranges/adjacent_transform_view/size.md new file mode 100644 index 0000000000..b9ac49e06e --- /dev/null +++ b/reference/ranges/adjacent_transform_view/size.md @@ -0,0 +1,73 @@ +# size +* ranges[meta header] +* std::ranges[meta namespace] +* adjacent_transform_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr auto size() + requires sized_range; // (1) C++23 + +constexpr auto size() const + requires sized_range; // (2) C++23 +``` +* sized_range[link ../sized_range.md] + +## 概要 + +要素数を取得する。 + +## 効果 + +- (1) : `return inner_.size();` +- (2) : `return inner_.size();` + +ここで、`InnerView`は説明専用の[`adjacent_view`](../adjacent_view.md)``である。 + +## 備考 + +`adjacent_transform_view`のサイズは、内部で保持する`adjacent_view`のサイズと同じ。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5}; + + auto diff = [](int x, int y) { return y - x; }; + std::ranges::adjacent_transform_view&>, decltype(diff), 2> atv(v, diff); + + // サイズは元のサイズ(5) - (N(2) - 1) = 4 + std::cout << "size: " << atv.size() << std::endl; + + // const版も動作する + const auto& catv = atv; + std::cout << "const size: " << catv.size() << std::endl; +} +``` +* size[color ff0000] +* std::ranges::adjacent_transform_view[link ../adjacent_transform_view.md] +* std::views::all_t[link ../all.md] + +### 出力 +``` +size: 4 +const size: 4 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [N4950 26.7.28 Adjacent transform view](https://timsong-cpp.github.io/cppwp/n4950/range.adjacent.transform) \ No newline at end of file From 47160743e4d780b8e52f709475e1af514b6ece92 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 4 Jun 2025 11:59:19 +0900 Subject: [PATCH 1848/3948] =?UTF-8?q?adjacent=5Fview=20:=20=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=90=E9=96=A2=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/adjacent_view.md | 20 ++--- reference/ranges/adjacent_view/base.md | 68 +++++++++++++++++ reference/ranges/adjacent_view/begin.md | 68 +++++++++++++++++ reference/ranges/adjacent_view/end.md | 75 +++++++++++++++++++ .../ranges/adjacent_view/op_constructor.md | 64 ++++++++++++++++ .../adjacent_view/op_deduction_guide.md | 53 +++++++++++++ reference/ranges/adjacent_view/size.md | 73 ++++++++++++++++++ 7 files changed, 411 insertions(+), 10 deletions(-) create mode 100644 reference/ranges/adjacent_view/base.md create mode 100644 reference/ranges/adjacent_view/begin.md create mode 100644 reference/ranges/adjacent_view/end.md create mode 100644 reference/ranges/adjacent_view/op_constructor.md create mode 100644 reference/ranges/adjacent_view/op_deduction_guide.md create mode 100644 reference/ranges/adjacent_view/size.md diff --git a/reference/ranges/adjacent_view.md b/reference/ranges/adjacent_view.md index c43cdb9997..63b69d494b 100644 --- a/reference/ranges/adjacent_view.md +++ b/reference/ranges/adjacent_view.md @@ -50,11 +50,11 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |-----------------------------------------------------|----------------------------------|----------------| -| [`(constructor)`](adjacent_view/op_constructor.md.nolink) | コンストラクタ | C++23 | -| [`base`](adjacent_view/base.md.nolink) | `V`の参照を取得する | C++23 | -| [`begin`](adjacent_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++23 | -| [`end`](adjacent_view/end.md.nolink) | 番兵を取得する | C++23 | -| [`size`](adjacent_view/size.md.nolink) | 要素数を取得する | C++23 | +| [`(constructor)`](adjacent_view/op_constructor.md) | コンストラクタ | C++23 | +| [`base`](adjacent_view/base.md) | `V`の参照を取得する | C++23 | +| [`begin`](adjacent_view/begin.md) | 先頭を指すイテレータを取得する | C++23 | +| [`end`](adjacent_view/end.md) | 番兵を取得する | C++23 | +| [`size`](adjacent_view/size.md) | 要素数を取得する | C++23 | ## 継承しているメンバ関数 @@ -72,7 +72,7 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |-------------------------------------------------------|------------------------------|----------------| -| [`(deduction_guide)`](adjacent_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | +| [`(deduction_guide)`](adjacent_view/op_deduction_guide.md) | クラステンプレートの推論補助 | C++23 | ## 例 ```cpp example @@ -105,10 +105,9 @@ int main() { - C++23 ### 処理系 -- [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? -- [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? +- [Clang](/implementation.md#clang): 19 [mark verified] +- [GCC](/implementation.md#gcc): 13 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] ## 関連項目 - [`adjacent_transform_view`](adjacent_transform_view.md): `adjacent_view` と同じように要素を取得して関数を適用する @@ -116,3 +115,4 @@ int main() { ## 参照 - [N4950 26 Ranges library](https://timsong-cpp.github.io/cppwp/n4950/ranges) +- [P2321R2 zip](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2321r2.html) diff --git a/reference/ranges/adjacent_view/base.md b/reference/ranges/adjacent_view/base.md new file mode 100644 index 0000000000..117b9bfc5c --- /dev/null +++ b/reference/ranges/adjacent_view/base.md @@ -0,0 +1,68 @@ +# base +* ranges[meta header] +* std::ranges[meta namespace] +* adjacent_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr V base() const & + requires copy_constructible; // (1) C++23 + +constexpr V base() &&; // (2) C++23 +``` + +## 概要 + +メンバ変数として保持している、元のviewを取得する。 + +## 効果 + +- (1) : `return base_;` +- (2) : `return std::move(base_);` + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5}; + + std::ranges::adjacent_view&>, 3> av(v); + + // (1) コピーして取得 + auto base1 = av.base(); + static_assert(std::same_as>>); + + // (2) ムーブして取得 + auto base2 = std::move(av).base(); + static_assert(std::same_as>>); + + // 取得したviewを使用(元の要素を表示) + for (int n : base1) { + std::cout << n << " "; + } + std::cout << std::endl; +} +``` +* base[color ff0000] + +### 出力 +``` +1 2 3 4 5 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 19 [mark verified] +- [GCC](/implementation.md#gcc): 13 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] + +## 参照 +- [N4950 26.7.27 Adjacent view](https://timsong-cpp.github.io/cppwp/n4950/range.adjacent) \ No newline at end of file diff --git a/reference/ranges/adjacent_view/begin.md b/reference/ranges/adjacent_view/begin.md new file mode 100644 index 0000000000..c0c6951b3e --- /dev/null +++ b/reference/ranges/adjacent_view/begin.md @@ -0,0 +1,68 @@ +# begin +* ranges[meta header] +* std::ranges[meta namespace] +* adjacent_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr auto begin() + requires (!simple-view); // (1) C++23 + +constexpr auto begin() const + requires range; // (2) C++23 +``` + +## 概要 + +先頭を指すイテレータを取得する。 + +## 効果 + +- (1) : `return iterator(ranges::begin(base_), ranges::end(base_));` +- (2) : `return iterator(ranges::begin(base_), ranges::end(base_));` + +ここで、`iterator`は`adjacent_view`の内部で定義される説明専用のイテレータクラスである。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5}; + + std::ranges::adjacent_view&>, 3> av(v); + + auto it = av.begin(); + + // 最初の要素(隣接する3要素のタプル) + auto [a, b, c] = *it; + std::cout << a << ", " << b << ", " << c << std::endl; + + // 次の要素へ + ++it; + auto [a2, b2, c2] = *it; + std::cout << a2 << ", " << b2 << ", " << c2 << std::endl; +} +``` +* begin[color ff0000] + +### 出力 +``` +1, 2, 3 +2, 3, 4 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 19 [mark verified] +- [GCC](/implementation.md#gcc): 13 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] + +## 参照 +- [N4950 26.7.27 Adjacent view](https://timsong-cpp.github.io/cppwp/n4950/range.adjacent) \ No newline at end of file diff --git a/reference/ranges/adjacent_view/end.md b/reference/ranges/adjacent_view/end.md new file mode 100644 index 0000000000..7fca485b2e --- /dev/null +++ b/reference/ranges/adjacent_view/end.md @@ -0,0 +1,75 @@ +# end +* ranges[meta header] +* std::ranges[meta namespace] +* adjacent_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr auto end() + requires (!simple-view); // (1) C++23 + +constexpr auto end() const + requires range; // (2) C++23 +``` + +## 概要 + +番兵を取得する。 + +## 効果 + +`common_range`が`true`の場合: + +- (1) : `return iterator(as-sentinel{ranges::end(base_)}, ranges::begin(base_), ranges::end(base_));` +- (2) : `return iterator(as-sentinel{ranges::end(base_)}, ranges::begin(base_), ranges::end(base_));` + +それ以外の場合: + +- (1) : `return sentinel(ranges::end(base_));` +- (2) : `return sentinel(ranges::end(base_));` + +ここで、`iterator`と`sentinel`は`adjacent_view`の内部で定義される説明専用のクラスであり、`as-sentinel`は説明専用の空クラスである。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5}; + + std::ranges::adjacent_view&>, 3> av(v); + + auto begin = av.begin(); + auto end = av.end(); + + // 全要素を出力 + for (auto it = begin; it != end; ++it) { + auto [a, b, c] = *it; + std::cout << a << ", " << b << ", " << c << std::endl; + } +} +``` +* end[color ff0000] +* begin[link begin.md] + +### 出力 +``` +1, 2, 3 +2, 3, 4 +3, 4, 5 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 19 [mark verified] +- [GCC](/implementation.md#gcc): 13 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] + +## 参照 +- [N4950 26.7.27 Adjacent view](https://timsong-cpp.github.io/cppwp/n4950/range.adjacent) \ No newline at end of file diff --git a/reference/ranges/adjacent_view/op_constructor.md b/reference/ranges/adjacent_view/op_constructor.md new file mode 100644 index 0000000000..d198413457 --- /dev/null +++ b/reference/ranges/adjacent_view/op_constructor.md @@ -0,0 +1,64 @@ +# コンストラクタ +* ranges[meta header] +* std::ranges[meta namespace] +* adjacent_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +adjacent_view() + requires default_initializable = default; // (1) C++23 + +constexpr explicit +adjacent_view(V base); // (2) C++23 +``` + +## 概要 + +- (1) : デフォルトコンストラクタ +- (2) : 元となるRangeを受け取るコンストラクタ + +## 効果 + +- (1) : `base_`をデフォルト構築する +- (2) : `base_`を`std::move(base)`で初期化する + +## 例 +```cpp example +#include +#include +#include + +int main() { + // (1) デフォルトコンストラクタ + std::ranges::adjacent_view, 2> av1; + + // (2) 元となるRangeを受け取るコンストラクタ + std::vector v = {1, 2, 3, 4, 5}; + std::ranges::adjacent_view&>, 3> av2(v); + + for (auto [a, b, c] : av2) { + std::cout << a << ", " << b << ", " << c << std::endl; + } +} +``` +* std::ranges::adjacent_view[color ff0000] + +### 出力 +``` +1, 2, 3 +2, 3, 4 +3, 4, 5 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 19 [mark verified] +- [GCC](/implementation.md#gcc): 13 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] + +## 参照 +- [N4950 26.7.27 Adjacent view](https://timsong-cpp.github.io/cppwp/n4950/range.adjacent) \ No newline at end of file diff --git a/reference/ranges/adjacent_view/op_deduction_guide.md b/reference/ranges/adjacent_view/op_deduction_guide.md new file mode 100644 index 0000000000..8eca83ea98 --- /dev/null +++ b/reference/ranges/adjacent_view/op_deduction_guide.md @@ -0,0 +1,53 @@ +# 推論補助 +* ranges[meta header] +* std::ranges[meta namespace] +* adjacent_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template + adjacent_view(R&&) -> adjacent_view, 1>; +} +``` + +## 概要 +`adjacent_view`クラステンプレートの型推論補助。 + +## 備考 + +この推論補助は、第2テンプレート引数`N`のデフォルト値として`1`を使用する。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5}; + + // adjacent_viewの型を明示的に指定する必要がない(Nはデフォルトで1) + std::ranges::adjacent_view av{v}; + + // 推論された型を確認 + static_assert(std::same_as< + decltype(av), + std::ranges::adjacent_view>, 1> + >); +} +``` + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 19 [mark verified] +- [GCC](/implementation.md#gcc): 13 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] diff --git a/reference/ranges/adjacent_view/size.md b/reference/ranges/adjacent_view/size.md new file mode 100644 index 0000000000..afd9c8ae88 --- /dev/null +++ b/reference/ranges/adjacent_view/size.md @@ -0,0 +1,73 @@ +# size +* ranges[meta header] +* std::ranges[meta namespace] +* adjacent_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr auto size() + requires sized_range; // (1) C++23 + +constexpr auto size() const + requires sized_range; // (2) C++23 +``` + +## 概要 + +要素数を取得する。 + +## 効果 + +説明専用の変数 `n` を `ranges::size(base_)` とする。 + +- (1)、(2) : `n` が `N` 未満なら `0` を返す。それ以外なら `n - (N - 1)` を返す。 + +## 備考 + +元のRangeのサイズが`N`未満の場合、`adjacent_view`は空となる。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5}; + + std::ranges::adjacent_view&>, 3> av(v); + + // サイズは元のサイズ(5) - (N(3) - 1) = 3 + std::cout << "size: " << av.size() << std::endl; + + // const版も動作する + const auto& cav = av; + std::cout << "const size: " << cav.size() << std::endl; + + // 元のRangeが小さい場合 + std::vector v2 = {1, 2}; + std::ranges::adjacent_view&>, 3> av2(v2); + std::cout << "small range size: " << av2.size() << std::endl; // 0 +} +``` +* size[color ff0000] + +### 出力 +``` +size: 3 +const size: 3 +small range size: 0 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 19 [mark verified] +- [GCC](/implementation.md#gcc): 13 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] + +## 参照 +- [N4950 26.7.27 Adjacent view](https://timsong-cpp.github.io/cppwp/n4950/range.adjacent) \ No newline at end of file From 3aebb6ec9b7b2a78594143738e61ab37a7a42716 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 4 Jun 2025 12:06:39 +0900 Subject: [PATCH 1849/3948] =?UTF-8?q?certesian=5Fproduct=5Fview=20:=20?= =?UTF-8?q?=E3=83=A1=E3=83=B3=E3=83=90=E9=96=A2=E6=95=B0=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/cartesian_product_view.md | 13 ++- .../ranges/cartesian_product_view/begin.md | 65 +++++++++++++++ .../ranges/cartesian_product_view/end.md | 83 +++++++++++++++++++ .../cartesian_product_view/op_constructor.md | 66 +++++++++++++++ .../op_deduction_guide.md | 55 ++++++++++++ .../ranges/cartesian_product_view/size.md | 74 +++++++++++++++++ 6 files changed, 349 insertions(+), 7 deletions(-) create mode 100644 reference/ranges/cartesian_product_view/begin.md create mode 100644 reference/ranges/cartesian_product_view/end.md create mode 100644 reference/ranges/cartesian_product_view/op_constructor.md create mode 100644 reference/ranges/cartesian_product_view/op_deduction_guide.md create mode 100644 reference/ranges/cartesian_product_view/size.md diff --git a/reference/ranges/cartesian_product_view.md b/reference/ranges/cartesian_product_view.md index 47cd666902..f70ebf3ea7 100644 --- a/reference/ranges/cartesian_product_view.md +++ b/reference/ranges/cartesian_product_view.md @@ -96,10 +96,10 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |--------------------------------------------------|----------------------------------|----------------| -| [`(constructor)`](cartesian_product_view/op_constructor.md.nolink) | コンストラクタ | C++23 | -| [`begin`](cartesian_product_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++23 | -| [`end`](cartesian_product_view/end.md.nolink) | 番兵を取得する | C++23 | -| [`size`](cartesian_product_view/size.md.nolink) | 要素数を取得する | C++23 | +| [`(constructor)`](cartesian_product_view/op_constructor.md) | コンストラクタ | C++23 | +| [`begin`](cartesian_product_view/begin.md) | 先頭を指すイテレータを取得する | C++23 | +| [`end`](cartesian_product_view/end.md) | 番兵を取得する | C++23 | +| [`size`](cartesian_product_view/size.md) | 要素数を取得する | C++23 | ## 継承しているメンバ関数 @@ -117,7 +117,7 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |-------------------------------------------------------|------------------------------|----------------| -| [`(deduction_guide)`](cartesian_product_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | +| [`(deduction_guide)`](cartesian_product_view/op_deduction_guide.md) | クラステンプレートの推論補助 | C++23 | ## 例 ```cpp example @@ -151,8 +151,7 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): 16.0 [mark verified] - [GCC](/implementation.md#gcc): 13.2 [mark verified] -- [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] ## 参照 - [N4950 26 Ranges library](https://timsong-cpp.github.io/cppwp/n4950/ranges) diff --git a/reference/ranges/cartesian_product_view/begin.md b/reference/ranges/cartesian_product_view/begin.md new file mode 100644 index 0000000000..dffa7b6b5d --- /dev/null +++ b/reference/ranges/cartesian_product_view/begin.md @@ -0,0 +1,65 @@ +# begin +* ranges[meta header] +* std::ranges[meta namespace] +* cartesian_product_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr iterator begin() + requires (!simple-view || ... || !simple-view); // (1) C++23 + +constexpr iterator begin() const; // (2) C++23 +``` +* iterator[italic] + +## 概要 + +先頭要素を指すイテレータを取得する。 + +## 効果 + +- (1), (2) : 以下と等価 + ```cpp + return iterator(*this, tuple-transform(ranges::begin, bases_)); + ``` + +ここで、`iterator`は説明専用のイテレータクラスであり、`tuple-transform`は説明専用の関数で、tupleの各要素に関数を適用する。`Const`は各オーバーロードに応じて`false`または`true`となる。 + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2}; + std::list l = {'a', 'b'}; + + std::ranges::cartesian_product_view cv{v, l}; + + auto it = cv.begin(); + + // 最初の要素を出力 + std::println("first element: {}", *it); +} +``` +* begin[color ff0000] + +### 出力 +``` +first element: (1, 'a') +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 13.2 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] + +## 参照 +- [N4950 26.7.33 Cartesian product view](https://timsong-cpp.github.io/cppwp/n4950/range.cartesian) \ No newline at end of file diff --git a/reference/ranges/cartesian_product_view/end.md b/reference/ranges/cartesian_product_view/end.md new file mode 100644 index 0000000000..795d4996dd --- /dev/null +++ b/reference/ranges/cartesian_product_view/end.md @@ -0,0 +1,83 @@ +# end +* ranges[meta header] +* std::ranges[meta namespace] +* cartesian_product_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr iterator end() + requires ((!simple-view || ... || !simple-view) && + cartesian-product-is-common); // (1) C++23 + +constexpr default_sentinel_t end() const noexcept; // (2) C++23 + +constexpr iterator end() const + requires cartesian-product-is-common; // (3) C++23 +``` +* iterator[italic] +* cartesian-product-is-common[italic] + +## 概要 + +番兵またはイテレータを取得する。 + +## 効果 + +- (1) : 以下と等価 + ```cpp + auto end_tuple = tuple-transform([](auto& r) { return cartesian-common-arg-end(r); }, bases_); + return iterator(*this, std::move(end_tuple)); + ``` + +- (2) : `return default_sentinel;` + +- (3) : 以下と等価 + ```cpp + auto end_tuple = tuple-transform([](auto& r) { return cartesian-common-arg-end(r); }, bases_); + return iterator(*this, std::move(end_tuple)); + ``` + +ここで、`iterator`は説明専用のイテレータクラス、`tuple-transform`は説明専用の関数で、tupleの各要素に関数を適用する。`cartesian-common-arg-end`は説明専用の関数である。 + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2}; + std::list l = {'a', 'b'}; + + std::ranges::cartesian_product_view cv{v, l}; + + // イテレータ範囲で全要素を出力 + for (auto it = cv.begin(); it != cv.end(); ++it) { + std::println("{}", *it); + } +} +``` +* end[color ff0000] +* begin[link begin.md] + +### 出力 +``` +(1, 'a') +(1, 'b') +(2, 'a') +(2, 'b') +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 13.2 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] + +## 参照 +- [N4950 26.7.33 Cartesian product view](https://timsong-cpp.github.io/cppwp/n4950/range.cartesian) \ No newline at end of file diff --git a/reference/ranges/cartesian_product_view/op_constructor.md b/reference/ranges/cartesian_product_view/op_constructor.md new file mode 100644 index 0000000000..0660cbce25 --- /dev/null +++ b/reference/ranges/cartesian_product_view/op_constructor.md @@ -0,0 +1,66 @@ +# コンストラクタ +* ranges[meta header] +* std::ranges[meta namespace] +* cartesian_product_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +cartesian_product_view() = default; // (1) C++23 + +constexpr explicit +cartesian_product_view(First first_base, Vs... bases); // (2) C++23 +``` + +## 概要 + +`cartesian_product_view`オブジェクトを構築する。 + +- (1) : デフォルトコンストラクタ。各Rangeを値初期化する。 +- (2) : 複数のRangeを受け取るコンストラクタ。 + +## 効果 + +- (1) : 各メンバを値初期化する。 +- (2) : `bases_`を`std::tuple(std::move(first_base), std::move(bases)...)`で初期化する。 + +ここで、`bases_`は複数のRangeを保持するメンバ変数である。 + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2}; + std::list l = {'a', 'b'}; + + // デフォルトコンストラクタ + std::ranges::cartesian_product_view>, std::views::all_t>> cv1{}; + + // Rangeを指定 + std::ranges::cartesian_product_view cv2{v, l}; + + std::println("{}", cv2); +} +``` +* std::ranges::cartesian_product_view[color ff0000] + +### 出力 +``` +[(1, 'a'), (1, 'b'), (2, 'a'), (2, 'b')] +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 13.2 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] + +## 参照 +- [N4950 26.7.33 Cartesian product view](https://timsong-cpp.github.io/cppwp/n4950/range.cartesian) \ No newline at end of file diff --git a/reference/ranges/cartesian_product_view/op_deduction_guide.md b/reference/ranges/cartesian_product_view/op_deduction_guide.md new file mode 100644 index 0000000000..7036e1e379 --- /dev/null +++ b/reference/ranges/cartesian_product_view/op_deduction_guide.md @@ -0,0 +1,55 @@ +# 推論補助 +* ranges[meta header] +* std::ranges[meta namespace] +* cartesian_product_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template + cartesian_product_view(Rs&&...) -> cartesian_product_view...>; +} +``` + +## 概要 +`cartesian_product_view`クラステンプレートの型推論補助。 + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2}; + std::list l = {'a', 'b'}; + + // cartesian_product_viewの型を明示的に指定する必要がない + std::ranges::cartesian_product_view cv{v, l}; + + // 推論された型を確認 + static_assert(std::same_as< + decltype(cv), + std::ranges::cartesian_product_view< + std::ranges::ref_view>, + std::ranges::ref_view> + > + >); +} +``` +* std::ranges::cartesian_product_view[color ff0000] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 13.2 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] diff --git a/reference/ranges/cartesian_product_view/size.md b/reference/ranges/cartesian_product_view/size.md new file mode 100644 index 0000000000..647f006cc0 --- /dev/null +++ b/reference/ranges/cartesian_product_view/size.md @@ -0,0 +1,74 @@ +# size +* ranges[meta header] +* std::ranges[meta namespace] +* cartesian_product_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr 以下参照 size() + requires cartesian-product-is-sized; // (1) C++23 + +constexpr 以下参照 size() const + requires cartesian-product-is-sized; // (2) C++23 +``` +* cartesian-product-is-sized[italic] + +## 概要 + +要素数を取得する。 + +## 効果 + +以下と等価: + +```cpp +return apply([](auto... sizes) { + using CT = make-unsigned-like-t>; + return (static_cast(sizes) * ...); +}, tuple-transform(ranges::size, bases_)); +``` +* make-unsigned-like-t[italic] +* tuple-transform[italic] + +ここで、`tuple-transform`は説明専用の関数で、tupleの各要素に関数を適用する。 + +## 備考 +- 直積の要素数は、すべてのRangeの要素数の積となる。 + + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3}; // 3要素 + std::list l = {'a', 'b'}; // 2要素 + + std::ranges::cartesian_product_view cv{v, l}; + + // 直積の要素数は 3 * 2 = 6 + std::cout << "cartesian product size: " << cv.size() << std::endl; +} +``` +* size[color ff0000] + +### 出力 +``` +cartesian product size: 6 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 13.2 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] + +## 参照 +- [N4950 26.7.33 Cartesian product view](https://timsong-cpp.github.io/cppwp/n4950/range.cartesian) \ No newline at end of file From 2c7144340b1373a95fbe71d1b794167f0be4d9c2 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 4 Jun 2025 12:16:17 +0900 Subject: [PATCH 1850/3948] =?UTF-8?q?chunk=5Fby=5Fview=20:=20=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=90=E9=96=A2=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/chunk_by_view.md | 18 +++-- reference/ranges/chunk_by_view/base.md | 61 +++++++++++++++++ reference/ranges/chunk_by_view/begin.md | 63 +++++++++++++++++ reference/ranges/chunk_by_view/end.md | 62 +++++++++++++++++ .../ranges/chunk_by_view/op_constructor.md | 67 +++++++++++++++++++ .../chunk_by_view/op_deduction_guide.md | 54 +++++++++++++++ reference/ranges/chunk_by_view/pred.md | 58 ++++++++++++++++ 7 files changed, 373 insertions(+), 10 deletions(-) create mode 100644 reference/ranges/chunk_by_view/base.md create mode 100644 reference/ranges/chunk_by_view/begin.md create mode 100644 reference/ranges/chunk_by_view/end.md create mode 100644 reference/ranges/chunk_by_view/op_constructor.md create mode 100644 reference/ranges/chunk_by_view/op_deduction_guide.md create mode 100644 reference/ranges/chunk_by_view/pred.md diff --git a/reference/ranges/chunk_by_view.md b/reference/ranges/chunk_by_view.md index 8ff94d4eb6..8b8d90632a 100644 --- a/reference/ranges/chunk_by_view.md +++ b/reference/ranges/chunk_by_view.md @@ -49,11 +49,11 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |-----------------------------------------------------|----------------------------------|----------------| -| [`(constructor)`](chunk_by_view/op_constructor.md.nolink) | コンストラクタ | C++23 | -| [`base`](chunk_by_view/base.md.nolink) | `V`の参照を取得する | C++23 | -| [`pred`](chunk_by_view/pred.md.nolink) | 述語を取得する | C++23 | -| [`begin`](chunk_by_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++23 | -| [`end`](chunk_by_view/end.md.nolink) | 番兵を取得する | C++23 | +| [`(constructor)`](chunk_by_view/op_constructor.md) | コンストラクタ | C++23 | +| [`base`](chunk_by_view/base.md) | `V`の参照を取得する | C++23 | +| [`pred`](chunk_by_view/pred.md) | 述語を取得する | C++23 | +| [`begin`](chunk_by_view/begin.md) | 先頭を指すイテレータを取得する | C++23 | +| [`end`](chunk_by_view/end.md) | 番兵を取得する | C++23 | ## 継承しているメンバ関数 @@ -71,7 +71,7 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |-------------------------------------------------------|------------------------------|----------------| -| [`(deduction_guide)`](chunk_by_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | +| [`(deduction_guide)`](chunk_by_view/op_deduction_guide.md) | クラステンプレートの推論補助 | C++23 | ## 例 ```cpp example @@ -87,7 +87,6 @@ int main() { } ``` * std::views::chunk_by[color ff0000] -* std::ranges::less_equal[link /reference/functional/ranges_less_equal.md] * 転倒[link https://ja.wikipedia.org/wiki/%E8%BB%A2%E5%80%92_(%E6%95%B0%E5%AD%A6)] ### 出力 @@ -100,10 +99,9 @@ int main() { - C++23 ### 処理系 -- [Clang](/implementation.md#clang): ?? +- [Clang](/implementation.md#clang): 17 [mark verified] - [GCC](/implementation.md#gcc): 14.0 [mark verified] -- [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 3 [mark verified] ## 参照 - [N4950 26 Ranges library](https://timsong-cpp.github.io/cppwp/n4950/ranges) diff --git a/reference/ranges/chunk_by_view/base.md b/reference/ranges/chunk_by_view/base.md new file mode 100644 index 0000000000..eed7407c31 --- /dev/null +++ b/reference/ranges/chunk_by_view/base.md @@ -0,0 +1,61 @@ +# base +* ranges[meta header] +* std::ranges[meta namespace] +* chunk_by_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr V base() const & requires copy_constructible; // (1) C++23 +constexpr V base() &&; // (2) C++23 +``` + +## 概要 + +メンバ変数として保持している、元となるRangeを取得する。 + +## 効果 + +- (1) : `return base_;` +- (2) : `return std::move(base_);` + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2, 2, 3, 0, 4, 5, 2}; + + std::ranges::chunk_by_view cv{v, std::ranges::less_equal{}}; + + // (1) const左辺値参照版 + const auto& base1 = cv.base(); + std::cout << "base size: " << base1.size() << std::endl; + + // (2) 右辺値参照版 + auto base2 = std::move(cv).base(); + std::cout << "moved base size: " << base2.size() << std::endl; +} +``` +* base[color ff0000] + +### 出力 +``` +base size: 8 +moved base size: 8 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 17 [mark verified] +- [GCC](/implementation.md#gcc): 14.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 3 [mark verified] + +## 参照 +- [N4950 26.7.30 Chunk by view](https://timsong-cpp.github.io/cppwp/n4950/range.chunk.by) \ No newline at end of file diff --git a/reference/ranges/chunk_by_view/begin.md b/reference/ranges/chunk_by_view/begin.md new file mode 100644 index 0000000000..9102a0fa65 --- /dev/null +++ b/reference/ranges/chunk_by_view/begin.md @@ -0,0 +1,63 @@ +# begin +* ranges[meta header] +* std::ranges[meta namespace] +* chunk_by_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr iterator begin(); // (1) C++23 + +constexpr const_iterator begin() const + requires forward_range; // (2) C++23 +``` +* iterator[italic] +* const_iterator[italic] + +## 概要 + +先頭要素を指すイテレータを取得する。 + +## 効果 + +- (1) : `return iterator(*this, ranges::begin(base_));` +- (2) : `return const_iterator(*this, ranges::begin(base_));` + +ここで、`iterator`と`const_iterator`は説明専用のイテレータクラスである。 + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2, 2, 3, 0, 4, 5, 2}; + + std::ranges::chunk_by_view cv{v, std::ranges::less_equal{}}; + + auto it = cv.begin(); + + // 最初のチャンクを出力 + std::println("{}", *it); +} +``` +* begin[color ff0000] + +### 出力 +``` +[1, 2, 2, 3] +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 17 [mark verified] +- [GCC](/implementation.md#gcc): 14.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 3 [mark verified] + +## 参照 +- [N4950 26.7.30 Chunk by view](https://timsong-cpp.github.io/cppwp/n4950/range.chunk.by) \ No newline at end of file diff --git a/reference/ranges/chunk_by_view/end.md b/reference/ranges/chunk_by_view/end.md new file mode 100644 index 0000000000..193d1699bd --- /dev/null +++ b/reference/ranges/chunk_by_view/end.md @@ -0,0 +1,62 @@ +# end +* ranges[meta header] +* std::ranges[meta namespace] +* chunk_by_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr default_sentinel_t end() const; // (1) C++23 +``` + +## 概要 + +番兵を取得する。 + +## 効果 + +- (1) : `return default_sentinel;` + +## 備考 + +`chunk_by_view`は常に`default_sentinel_t`を番兵として使用する。これは、チャンクの境界が動的に決まるため、事前にサイズを計算することができないためである。 + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2, 2, 3, 0, 4, 5, 2}; + + std::ranges::chunk_by_view cv{v, std::ranges::less_equal{}}; + + // イテレータ範囲で全チャンクを出力 + for (auto it = cv.begin(); it != cv.end(); ++it) { + std::println("{}", *it); + } +} +``` +* end[color ff0000] +* begin[link begin.md] + +### 出力 +``` +[1, 2, 2, 3] +[0, 4, 5] +[2] +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 17 [mark verified] +- [GCC](/implementation.md#gcc): 14.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 3 [mark verified] + +## 参照 +- [N4950 26.7.30 Chunk by view](https://timsong-cpp.github.io/cppwp/n4950/range.chunk.by) \ No newline at end of file diff --git a/reference/ranges/chunk_by_view/op_constructor.md b/reference/ranges/chunk_by_view/op_constructor.md new file mode 100644 index 0000000000..ef69362fc9 --- /dev/null +++ b/reference/ranges/chunk_by_view/op_constructor.md @@ -0,0 +1,67 @@ +# コンストラクタ +* ranges[meta header] +* std::ranges[meta namespace] +* chunk_by_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +chunk_by_view() + requires default_initializable && + default_initializable = default; // (1) C++23 + +constexpr explicit +chunk_by_view(V base, Pred pred); // (2) C++23 +``` + +## 概要 + +`chunk_by_view`オブジェクトを構築する。 + +- (1) : デフォルトコンストラクタ。元となるRangeと述語を値初期化する。 +- (2) : 元となるRangeと述語を受け取るコンストラクタ。 + +## 効果 + +- (1) : `base_`と`pred_`を値初期化する。 +- (2) : `base_(std::move(base))`、`pred_(std::move(pred))`で初期化する。 + +ここで、`base_`は元となるRangeを保持するメンバ変数、`pred_`は述語を保持するメンバ変数である。 + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2, 2, 3, 0, 4, 5, 2}; + + // デフォルトコンストラクタ + std::ranges::chunk_by_view>, std::ranges::less_equal> cv1{}; + + // 元となるRangeと述語を指定 + std::ranges::chunk_by_view cv2{v, std::ranges::less_equal{}}; + + std::println("{}", cv2); +} +``` +* std::ranges::chunk_by_view[color ff0000] + +### 出力 +``` +[[1, 2, 2, 3], [0, 4, 5], [2]] +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 17 [mark verified] +- [GCC](/implementation.md#gcc): 14.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 3 [mark verified] + +## 参照 +- [N4950 26.7.30 Chunk by view](https://timsong-cpp.github.io/cppwp/n4950/range.chunk.by) \ No newline at end of file diff --git a/reference/ranges/chunk_by_view/op_deduction_guide.md b/reference/ranges/chunk_by_view/op_deduction_guide.md new file mode 100644 index 0000000000..a666b29a60 --- /dev/null +++ b/reference/ranges/chunk_by_view/op_deduction_guide.md @@ -0,0 +1,54 @@ +# 推論補助 +* ranges[meta header] +* std::ranges[meta namespace] +* chunk_by_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template + chunk_by_view(R&&, Pred) -> chunk_by_view, Pred>; +} +``` + +## 概要 +`chunk_by_view`クラステンプレートの型推論補助。 + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2, 2, 3, 0, 4, 5, 2}; + + // chunk_by_viewの型を明示的に指定する必要がない + std::ranges::chunk_by_view cv{v, std::ranges::less_equal{}}; + + // 推論された型を確認 + static_assert(std::same_as< + decltype(cv), + std::ranges::chunk_by_view< + std::ranges::ref_view>, + std::ranges::less_equal + > + >); +} +``` +* std::ranges::chunk_by_view[color ff0000] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 17 [mark verified] +- [GCC](/implementation.md#gcc): 14.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 3 [mark verified] diff --git a/reference/ranges/chunk_by_view/pred.md b/reference/ranges/chunk_by_view/pred.md new file mode 100644 index 0000000000..e68b955fc1 --- /dev/null +++ b/reference/ranges/chunk_by_view/pred.md @@ -0,0 +1,58 @@ +# pred +* ranges[meta header] +* std::ranges[meta namespace] +* chunk_by_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr const Pred& pred() const; // (1) C++23 +``` + +## 概要 + +メンバ変数として保持している、述語を取得する。 + +## 効果 + +- (1) : `return pred_;` + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2, 2, 3, 0, 4, 5, 2}; + + std::ranges::chunk_by_view cv{v, std::ranges::less_equal{}}; + + // 述語を取得 + const auto& predicate = cv.pred(); + + // 述語を使用して比較 + std::cout << "predicate(1, 2): " << predicate(1, 2) << std::endl; + std::cout << "predicate(3, 0): " << predicate(3, 0) << std::endl; +} +``` +* pred[color ff0000] + +### 出力 +``` +predicate(1, 2): 1 +predicate(3, 0): 0 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 17 [mark verified] +- [GCC](/implementation.md#gcc): 14.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 3 [mark verified] + +## 参照 +- [N4950 26.7.30 Chunk by view](https://timsong-cpp.github.io/cppwp/n4950/range.chunk.by) \ No newline at end of file From 5b1f4d465f5fad18d47fe9ddb7039afdbf0d7f8c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 4 Jun 2025 12:21:58 +0900 Subject: [PATCH 1851/3948] =?UTF-8?q?chunk=5Fview=20:=20=E3=83=A1=E3=83=B3?= =?UTF-8?q?=E3=83=90=E9=96=A2=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/chunk_view.md | 27 +++---- reference/ranges/chunk_view/base.md | 62 +++++++++++++++ reference/ranges/chunk_view/begin.md | 76 ++++++++++++++++++ reference/ranges/chunk_view/end.md | 79 +++++++++++++++++++ reference/ranges/chunk_view/op_constructor.md | 69 ++++++++++++++++ .../ranges/chunk_view/op_deduction_guide.md | 50 ++++++++++++ reference/ranges/chunk_view/size.md | 71 +++++++++++++++++ 7 files changed, 420 insertions(+), 14 deletions(-) create mode 100644 reference/ranges/chunk_view/base.md create mode 100644 reference/ranges/chunk_view/begin.md create mode 100644 reference/ranges/chunk_view/end.md create mode 100644 reference/ranges/chunk_view/op_constructor.md create mode 100644 reference/ranges/chunk_view/op_deduction_guide.md create mode 100644 reference/ranges/chunk_view/size.md diff --git a/reference/ranges/chunk_view.md b/reference/ranges/chunk_view.md index 6ca1a52501..1452c0e03a 100644 --- a/reference/ranges/chunk_view.md +++ b/reference/ranges/chunk_view.md @@ -55,29 +55,29 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |-----------------------------------------------------|----------------------------------|----------------| -| [`(constructor)`](chunk_view/op_constructor.md.nolink) | コンストラクタ | C++23 | -| [`base`](chunk_view/base.md.nolink) | `V`の参照を取得する | C++23 | -| [`begin`](chunk_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++23 | -| [`end`](chunk_view/end.md.nolink) | 番兵を取得する | C++23 | -| [`size`](chunk_view/size.md.nolink) | 要素数を取得する | C++23 | +| [`(constructor)`](chunk_view/op_constructor.md) | コンストラクタ | C++23 | +| [`base`](chunk_view/base.md) | `V`の参照を取得する | C++23 | +| [`begin`](chunk_view/begin.md) | 先頭を指すイテレータを取得する | C++23 | +| [`end`](chunk_view/end.md) | 番兵を取得する | C++23 | +| [`size`](chunk_view/size.md) | 要素数を取得する | C++23 | ## 継承しているメンバ関数 | 名前 | 説明 | 対応バージョン | |----------------------------------------------|-----------------------------------|----------------| -| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++20 | -| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++20 | -| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | -| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | +| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++23 | +| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++23 | +| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++23 | +| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++23 | | [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | | [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | -| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | +| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++23 | ## 推論補助 | 名前 | 説明 | 対応バージョン | |-------------------------------------------------------|------------------------------|----------------| -| [`(deduction_guide)`](chunk_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | +| [`(deduction_guide)`](chunk_view/op_deduction_guide.md) | クラステンプレートの推論補助 | C++23 | ## 例 ```cpp example @@ -145,10 +145,9 @@ int main() { - C++23 ### 処理系 -- [Clang](/implementation.md#clang): ?? +- [Clang](/implementation.md#clang): 17 [mark verified] - [GCC](/implementation.md#gcc): 14.0 [mark verified] -- [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 3 [mark verified] ## 参照 - [N4950 26 Ranges library](https://timsong-cpp.github.io/cppwp/n4950/ranges) diff --git a/reference/ranges/chunk_view/base.md b/reference/ranges/chunk_view/base.md new file mode 100644 index 0000000000..2455cc23a1 --- /dev/null +++ b/reference/ranges/chunk_view/base.md @@ -0,0 +1,62 @@ +# base +* ranges[meta header] +* std::ranges[meta namespace] +* chunk_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr V base() const & + requires copy_constructible; // (1) C++23 + +constexpr V base() &&; // (2) C++23 +``` + +## 概要 + +メンバ変数として保持している、元となるRangeを取得する。 + +## 効果 + +- (1) : `return base_;` +- (2) : `return std::move(base_);` + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5, 6}; + + std::ranges::chunk_view cv{v, 2}; + + // (1) const左辺値参照版 + const auto& base1 = cv.base(); + std::cout << "base size: " << base1.size() << std::endl; + + // (2) 右辺値参照版 + auto base2 = std::move(cv).base(); + std::cout << "moved base size: " << base2.size() << std::endl; +} +``` +* base[color ff0000] + +### 出力 +``` +base size: 6 +moved base size: 6 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 17 [mark verified] +- [GCC](/implementation.md#gcc): 14.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 3 [mark verified] + +## 参照 +- [N4950 26.7.29 Chunk view](https://timsong-cpp.github.io/cppwp/n4950/range.chunk) \ No newline at end of file diff --git a/reference/ranges/chunk_view/begin.md b/reference/ranges/chunk_view/begin.md new file mode 100644 index 0000000000..5c4f2ccaf9 --- /dev/null +++ b/reference/ranges/chunk_view/begin.md @@ -0,0 +1,76 @@ +# begin +* ranges[meta header] +* std::ranges[meta namespace] +* chunk_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr outer-iterator begin(); // (1) C++23 + +constexpr outer-iterator begin() const + requires forward_range; // (2) C++23 +``` +* outer-iterator[italic] + +## 概要 + +先頭要素を指すイテレータを取得する。 + +## 効果 + +- (1) : 以下と等価 + ```cpp + V& r = base_; + auto first = ranges::begin(r); + if constexpr (forward_range) { + return outer-iterator(this, std::move(first)); + } else { + current_ = first; + remainder_ = n_; + return outer-iterator(this); + } + ``` + +- (2) : 以下と等価 + ```cpp + return outer-iterator(this, ranges::begin(base_)); + ``` + +ここで、`outer-iterator`は説明専用のイテレータクラスであり、`current_`と`remainder_`は`chunk_view`の説明専用のメンバ変数である。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5, 6, 7, 8}; + + std::ranges::chunk_view cv{v, 3}; + + auto it = cv.begin(); + + // 最初のチャンクを出力 + std::println("{}", *it); +} +``` +* begin[color ff0000] + +### 出力 +``` +[1, 2, 3] +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 17 [mark verified] +- [GCC](/implementation.md#gcc): 14.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 3 [mark verified] + +## 参照 +- [N4950 26.7.29 Chunk view](https://timsong-cpp.github.io/cppwp/n4950/range.chunk) \ No newline at end of file diff --git a/reference/ranges/chunk_view/end.md b/reference/ranges/chunk_view/end.md new file mode 100644 index 0000000000..c92444c25f --- /dev/null +++ b/reference/ranges/chunk_view/end.md @@ -0,0 +1,79 @@ +# end +* ranges[meta header] +* std::ranges[meta namespace] +* chunk_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr default_sentinel_t end() const noexcept; // (1) C++23 + +constexpr auto end() requires forward_range && common_range; // (2) C++23 + +constexpr auto end() const + requires forward_range && common_range; // (3) C++23 +``` + +## 概要 + +番兵またはイテレータを取得する。 + +## 効果 + +- (1) : `return default_sentinel;` +- (2) : 以下と等価 + ```cpp + auto missing = (n_ - ranges::distance(base_) % n_) % n_; + return outer-iterator(this, ranges::end(base_), missing); + ``` + +- (3) : 以下と等価 + ```cpp + auto missing = (n_ - ranges::distance(base_) % n_) % n_; + return outer-iterator(this, ranges::end(base_), missing); + ``` + +ここで、`outer-iterator`は説明専用のイテレータクラスである。 + +## 備考 + +`missing`は、最後のチャンクを`n_`個の要素にするために必要な不足要素数を表す。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5, 6, 7, 8}; + + std::ranges::chunk_view cv{v, 3}; + + // イテレータ範囲で全チャンクを出力 + for (auto it = cv.begin(); it != cv.end(); ++it) { + std::println("{}", *it); + } +} +``` +* end[color ff0000] +* begin[link begin.md] + +### 出力 +``` +[1, 2, 3] +[4, 5, 6] +[7, 8] +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 17 [mark verified] +- [GCC](/implementation.md#gcc): 14.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 3 [mark verified] + +## 参照 +- [N4950 26.7.29 Chunk view](https://timsong-cpp.github.io/cppwp/n4950/range.chunk) \ No newline at end of file diff --git a/reference/ranges/chunk_view/op_constructor.md b/reference/ranges/chunk_view/op_constructor.md new file mode 100644 index 0000000000..5a139fa237 --- /dev/null +++ b/reference/ranges/chunk_view/op_constructor.md @@ -0,0 +1,69 @@ +# コンストラクタ +* ranges[meta header] +* std::ranges[meta namespace] +* chunk_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +chunk_view() + requires default_initializable = default; // (1) C++23 + +constexpr explicit +chunk_view(V base, range_difference_t n); // (2) C++23 +``` + +## 概要 + +`chunk_view`オブジェクトを構築する。 + +- (1) : デフォルトコンストラクタ。元となるRangeを値初期化する。 +- (2) : 元となるRangeと分割数を受け取るコンストラクタ。 + +## 効果 + +- (1) : `base_`と`n_`を値初期化する。 +- (2) : `base_(std::move(base))`、`n_(n)`で初期化する。 + +ここで、`base_`は元となるRangeを保持するメンバ変数、`n_`は分割する要素数を保持するメンバ変数である。 + +## 事前条件 + +- (2) : `n > 0` + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5, 6, 7, 8}; + + // デフォルトコンストラクタ + std::ranges::chunk_view>> cv1{}; + + // 元となるRangeと分割数を指定 + std::ranges::chunk_view cv2{v, 3}; + + std::println("{}", cv2); +} +``` +* std::ranges::chunk_view[color ff0000] + +### 出力 +``` +[[1, 2, 3], [4, 5, 6], [7, 8]] +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 17 [mark verified] +- [GCC](/implementation.md#gcc): 14.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 3 [mark verified] + +## 参照 +- [N4950 26.7.29 Chunk view](https://timsong-cpp.github.io/cppwp/n4950/range.chunk) \ No newline at end of file diff --git a/reference/ranges/chunk_view/op_deduction_guide.md b/reference/ranges/chunk_view/op_deduction_guide.md new file mode 100644 index 0000000000..9fa72fa2f4 --- /dev/null +++ b/reference/ranges/chunk_view/op_deduction_guide.md @@ -0,0 +1,50 @@ +# 推論補助 +* ranges[meta header] +* std::ranges[meta namespace] +* chunk_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template + chunk_view(R&&, range_difference_t) -> chunk_view>; +} +``` + +## 概要 +`chunk_view`クラステンプレートの型推論補助。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5, 6}; + + // chunk_viewの型を明示的に指定する必要がない + std::ranges::chunk_view cv{v, 3}; + + // 推論された型を確認 + static_assert(std::same_as< + decltype(cv), + std::ranges::chunk_view>> + >); +} +``` +* std::ranges::chunk_view[color ff0000] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 17 [mark verified] +- [GCC](/implementation.md#gcc): 14.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 3 [mark verified] diff --git a/reference/ranges/chunk_view/size.md b/reference/ranges/chunk_view/size.md new file mode 100644 index 0000000000..c810321d97 --- /dev/null +++ b/reference/ranges/chunk_view/size.md @@ -0,0 +1,71 @@ +# size +* ranges[meta header] +* std::ranges[meta namespace] +* chunk_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr auto size() requires sized_range; // (1) C++23 + +constexpr auto size() const requires sized_range; // (2) C++23 +``` +* sized_range[link ../sized_range.md] + +## 概要 + +要素数(チャンク数)を取得する。 + +## 効果 + +以下と等価: + +```cpp +return to-unsigned-like(div-ceil(ranges::distance(base_), n_)); +``` +* to-unsigned-like[italic] +* div-ceil[italic] + +ここで、`to-unsigned-like`は説明専用の関数であり、整数型を対応する符号なし整数型に変換する。`div-ceil(x, y)`は`x`を`y`で割った切り上げを計算する説明専用の関数である。 + +## 備考 + +元のRangeの要素数を`n`で割った切り上げがチャンク数となる。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5, 6, 7, 8}; + + // 3要素ずつのチャンクに分割 + std::ranges::chunk_view cv1{v, 3}; + std::cout << "chunk_view(8 elements, chunk size 3): " << cv1.size() << " chunks" << std::endl; + + // 5要素ずつのチャンクに分割 + std::ranges::chunk_view cv2{v, 5}; + std::cout << "chunk_view(8 elements, chunk size 5): " << cv2.size() << " chunks" << std::endl; +} +``` +* size[color ff0000] + +### 出力 +``` +chunk_view(8 elements, chunk size 3): 3 chunks +chunk_view(8 elements, chunk size 5): 2 chunks +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 17 [mark verified] +- [GCC](/implementation.md#gcc): 14.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 3 [mark verified] + +## 参照 +- [N4950 26.7.29 Chunk view](https://timsong-cpp.github.io/cppwp/n4950/range.chunk) \ No newline at end of file From 8b59890593416a61af1859beb49171e7ed2dbbe8 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 4 Jun 2025 12:24:56 +0900 Subject: [PATCH 1852/3948] =?UTF-8?q?elements=5Fview=20:=20=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=90=E9=96=A2=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/elements_view.md | 29 ++++--- reference/ranges/elements_view/base.md | 71 ++++++++++++++++ reference/ranges/elements_view/begin.md | 70 ++++++++++++++++ reference/ranges/elements_view/end.md | 83 +++++++++++++++++++ .../ranges/elements_view/op_constructor.md | 75 +++++++++++++++++ .../elements_view/op_deduction_guide.md | 74 +++++++++++++++++ reference/ranges/elements_view/size.md | 68 +++++++++++++++ 7 files changed, 455 insertions(+), 15 deletions(-) create mode 100644 reference/ranges/elements_view/base.md create mode 100644 reference/ranges/elements_view/begin.md create mode 100644 reference/ranges/elements_view/end.md create mode 100644 reference/ranges/elements_view/op_constructor.md create mode 100644 reference/ranges/elements_view/op_deduction_guide.md create mode 100644 reference/ranges/elements_view/size.md diff --git a/reference/ranges/elements_view.md b/reference/ranges/elements_view.md index 0090fc63fc..78372d9d80 100644 --- a/reference/ranges/elements_view.md +++ b/reference/ranges/elements_view.md @@ -89,11 +89,11 @@ concept has-tuple-element = | 名前 | 説明 | 対応バージョン | |--------------------------------------------------|----------------------------------|----------------| -| [`(constructor)`](elements_view/op_constructor.md.nolink) | コンストラクタ | C++20 | -| [`base`](elements_view/base.md.nolink) | `V`の参照を取得する | C++20 | -| [`begin`](elements_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++20 | -| [`end`](elements_view/end.md.nolink) | 番兵を取得する | C++20 | -| [`size`](elements_view/size.md.nolink) | 要素数を取得する | C++20 | +| [`(constructor)`](elements_view/op_constructor.md) | コンストラクタ | C++20 | +| [`base`](elements_view/base.md) | `V`の参照を取得する | C++20 | +| [`begin`](elements_view/begin.md) | 先頭を指すイテレータを取得する | C++20 | +| [`end`](elements_view/end.md) | 番兵を取得する | C++20 | +| [`size`](elements_view/size.md) | 要素数を取得する | C++20 | `r`を元のRangeとする。`size`は[`ranges::size`](size.md)`(r)`が有効な式であるときに定義される。 @@ -113,7 +113,7 @@ concept has-tuple-element = | 名前 | 説明 | 対応バージョン | |-------------------------------------------------------|------------------------------|----------------| -| [`(deduction_guide)`](elements_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++20 | +| [`(deduction_guide)`](elements_view/op_deduction_guide.md) | クラステンプレートの推論補助 | C++20 | ## 例 ```cpp example @@ -123,20 +123,19 @@ concept has-tuple-element = #include int main() { - using namespace std; - map m = {{1, "one"}, {2, "two"}, {3, "three"}}; + std::map m = {{1, "one"}, {2, "two"}, {3, "three"}}; - for (int i : m | views::keys) { - cout << i << '\n'; + for (int i : m | std::views::keys) { + std::cout << i << '\n'; } - - for (const string& i : m | views::values) { - cout << i << '\n'; + + for (const std::string& i : m | std::views::values) { + std::cout << i << '\n'; } } ``` -* views::keys[color ff0000] -* views::values[color ff0000] +* std::views::keys[color ff0000] +* std::views::values[color ff0000] ### 出力 ``` diff --git a/reference/ranges/elements_view/base.md b/reference/ranges/elements_view/base.md new file mode 100644 index 0000000000..59772d0770 --- /dev/null +++ b/reference/ranges/elements_view/base.md @@ -0,0 +1,71 @@ +# base +* ranges[meta header] +* std::ranges[meta namespace] +* elements_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr V base() const & + requires copy_constructible; // (1) C++20 + +constexpr V base() &&; // (2) C++20 +``` + +## 概要 + +メンバ変数として保持している、元のviewを取得する。 + +## 効果 + +- (1) : `return base_;` +- (2) : `return std::move(base_);` + +## 例 +```cpp example +#include +#include +#include +#include +#include + +int main() { + std::map m = {{1, "one"}, {2, "two"}, {3, "three"}}; + + std::ranges::keys_view kv(m); + + // (1) コピーして取得 + auto base1 = kv.base(); + static_assert(std::same_as>>); + + // (2) ムーブして取得 + auto base2 = std::move(kv).base(); + static_assert(std::same_as>>); + + // 取得したviewを使用(元のmap要素を表示) + for (const auto& [key, value] : base1) { + std::cout << key << ": " << value << std::endl; + } +} +``` +* base[color ff0000] + +### 出力 +``` +1: one +2: two +3: three +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4861 24.7.21.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.elements.view) \ No newline at end of file diff --git a/reference/ranges/elements_view/begin.md b/reference/ranges/elements_view/begin.md new file mode 100644 index 0000000000..fffa498577 --- /dev/null +++ b/reference/ranges/elements_view/begin.md @@ -0,0 +1,70 @@ +# begin +* ranges[meta header] +* std::ranges[meta namespace] +* elements_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr auto begin() + requires (!simple-view); // (1) C++20 + +constexpr auto begin() const + requires range; // (2) C++20 +``` + +## 概要 + +先頭を指すイテレータを取得する。 + +## 効果 + +- (1) : `return iterator(ranges::begin(base_));` +- (2) : `return iterator(ranges::begin(base_));` + +ここで、`iterator`は`elements_view`の内部で定義される説明専用のイテレータクラスである。 + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::map m = {{1, "one"}, {2, "two"}, {3, "three"}}; + + // keys_viewを使用 + std::ranges::keys_view kv(m); + auto it = kv.begin(); + std::cout << *it << std::endl; // 1 + ++it; + std::cout << *it << std::endl; // 2 + + // values_viewを使用 + std::ranges::values_view vv(m); + auto vit = vv.begin(); + std::cout << *vit << std::endl; // one +} +``` +* begin[color ff0000] + +### 出力 +``` +1 +2 +one +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4861 24.7.21.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.elements.view) \ No newline at end of file diff --git a/reference/ranges/elements_view/end.md b/reference/ranges/elements_view/end.md new file mode 100644 index 0000000000..4e6fc0f415 --- /dev/null +++ b/reference/ranges/elements_view/end.md @@ -0,0 +1,83 @@ +# end +* ranges[meta header] +* std::ranges[meta namespace] +* elements_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr auto end() + requires (!simple-view && !common_range); // (1) C++20 + +constexpr auto end() + requires (!simple-view && common_range); // (2) C++20 + +constexpr auto end() const + requires range; // (3) C++20 + +constexpr auto end() const + requires common_range; // (4) C++20 +``` + +## 概要 + +番兵を取得する。 + +## 効果 + +- (1) : `return sentinel{ranges::end(base_)};` +- (2) : `return iterator{ranges::end(base_)};` +- (3) : `return sentinel{ranges::end(base_)};` +- (4) : `return iterator{ranges::end(base_)};` + +ここで、`sentinel`は`elements_view`の内部で定義される説明専用の番兵クラスであり、`iterator`は説明専用のイテレータクラスである。 + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::map m = {{1, "one"}, {2, "two"}, {3, "three"}}; + + // keys_viewを使用 + std::ranges::keys_view kv(m); + auto begin = kv.begin(); + auto end = kv.end(); + + for (auto it = begin; it != end; ++it) { + std::cout << *it << " "; + } + std::cout << std::endl; + + // values_viewを使用 + std::ranges::values_view vv(m); + for (auto it = vv.begin(); it != vv.end(); ++it) { + std::cout << *it << " "; + } + std::cout << std::endl; +} +``` +* end[color ff0000] +* begin[link begin.md] + +### 出力 +``` +1 2 3 +one two three +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4861 24.7.21.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.elements.view) \ No newline at end of file diff --git a/reference/ranges/elements_view/op_constructor.md b/reference/ranges/elements_view/op_constructor.md new file mode 100644 index 0000000000..2f53d40014 --- /dev/null +++ b/reference/ranges/elements_view/op_constructor.md @@ -0,0 +1,75 @@ +# コンストラクタ +* ranges[meta header] +* std::ranges[meta namespace] +* elements_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +elements_view() + requires default_initializable = default; // (1) C++20 + +constexpr explicit +elements_view(V base); // (2) C++20 +``` + +## 概要 + +- (1) : デフォルトコンストラクタ +- (2) : 元となるRangeを受け取るコンストラクタ + +## 効果 + +- (1) : `base_`をデフォルト構築する +- (2) : `base_`を`std::move(base)`で初期化する + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::map m = {{1, "one"}, {2, "two"}, {3, "three"}}; + + // (1) デフォルトコンストラクタ + std::ranges::elements_view>, 0> ev1; + + // (2) 元となるRangeを受け取るコンストラクタ + std::ranges::elements_view&>, 0> ev2(m); + + // keys_viewを使用 + for (int key : ev2) { + std::cout << key << " "; + } + std::cout << std::endl; + + // values_viewを使用 + std::ranges::values_view vv(m); + for (const std::string& value : vv) { + std::cout << value << " "; + } + std::cout << std::endl; +} +``` +* std::ranges::elements_view[color ff0000] + +### 出力 +``` +1 2 3 +one two three +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4861 24.7.21.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.elements.view) \ No newline at end of file diff --git a/reference/ranges/elements_view/op_deduction_guide.md b/reference/ranges/elements_view/op_deduction_guide.md new file mode 100644 index 0000000000..b2980122ec --- /dev/null +++ b/reference/ranges/elements_view/op_deduction_guide.md @@ -0,0 +1,74 @@ +# 推論補助 +* ranges[meta header] +* std::ranges[meta namespace] +* elements_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +namespace std::ranges { + template + elements_view(R&&, const integral_constant&) -> + elements_view, N>; // (1) C++20 (削除) + + template + elements_view(R&&) -> elements_view, N>; // (2) C++23 +} +``` +* integral_constant[link /reference/type_traits/integral_constant.md] +* views::all_t[link ../all.md] + +## 概要 +`elements_view`クラステンプレートの型推論補助。 + +- (1) : C++20で導入されたが、C++23で削除された +- (2) : C++23で導入された新しい推論補助 + +## 備考 + +C++20では、`elements_view`は第2引数として`integral_constant`を受け取っていたが、C++23からはテンプレート引数として`N`を直接指定するように変更された。 + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::map m = {{1, "one"}, {2, "two"}, {3, "three"}}; + + // C++23以降の使用方法 + std::ranges::elements_view&>, 0> ev{m}; + + // 推論された型を確認 + static_assert(std::same_as< + decltype(ev), + std::ranges::elements_view>, 0> + >); +} +``` +* std::ranges::elements_view[color ff0000] +* std::views::all_t[link ../all.md] +* std::ranges::ref_view[link ../ref_view.md] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++20: (1) +- C++23: (2) + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 関連項目 +- [`views::all`](../all.md) + +## 参照 +- [P2367R0 Remove misuses of list-initialization in Clause 24](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2367r0.html) \ No newline at end of file diff --git a/reference/ranges/elements_view/size.md b/reference/ranges/elements_view/size.md new file mode 100644 index 0000000000..16cabefdf9 --- /dev/null +++ b/reference/ranges/elements_view/size.md @@ -0,0 +1,68 @@ +# size +* ranges[meta header] +* std::ranges[meta namespace] +* elements_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr auto size() + requires sized_range; // (1) C++20 + +constexpr auto size() const + requires sized_range; // (2) C++20 +``` + +## 概要 + +要素数を取得する。 + +## 効果 + +- (1) : `return ranges::size(base_);` +- (2) : `return ranges::size(base_);` + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::map m = {{1, "one"}, {2, "two"}, {3, "three"}}; + + // keys_viewを使用 + std::ranges::keys_view kv(m); + std::cout << "keys size: " << kv.size() << std::endl; + + // values_viewを使用 + std::ranges::values_view vv(m); + std::cout << "values size: " << vv.size() << std::endl; + + // const版も動作する + const auto& ckv = kv; + std::cout << "const keys size: " << ckv.size() << std::endl; +} +``` +* size[color ff0000] + +### 出力 +``` +keys size: 3 +values size: 3 +const keys size: 3 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4861 24.7.21.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.elements.view) \ No newline at end of file From 649a2ca9888ad81b95ae6c596511fae960154446 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 4 Jun 2025 12:38:05 +0900 Subject: [PATCH 1853/3948] =?UTF-8?q?enumerate=5Fview=20:=20=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=90=E9=96=A2=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/enumerate_view.md | 39 +++++----- reference/ranges/enumerate_view/base.md | 69 +++++++++++++++++ reference/ranges/enumerate_view/begin.md | 68 +++++++++++++++++ reference/ranges/enumerate_view/end.md | 75 +++++++++++++++++++ .../ranges/enumerate_view/op_constructor.md | 64 ++++++++++++++++ .../enumerate_view/op_deduction_guide.md | 50 +++++++++++++ reference/ranges/enumerate_view/size.md | 62 +++++++++++++++ 7 files changed, 409 insertions(+), 18 deletions(-) create mode 100644 reference/ranges/enumerate_view/base.md create mode 100644 reference/ranges/enumerate_view/begin.md create mode 100644 reference/ranges/enumerate_view/end.md create mode 100644 reference/ranges/enumerate_view/op_constructor.md create mode 100644 reference/ranges/enumerate_view/op_deduction_guide.md create mode 100644 reference/ranges/enumerate_view/size.md diff --git a/reference/ranges/enumerate_view.md b/reference/ranges/enumerate_view.md index 86e2d90031..c91b79d113 100644 --- a/reference/ranges/enumerate_view.md +++ b/reference/ranges/enumerate_view.md @@ -43,47 +43,51 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |--------------------------------------------------|----------------------------------|----------------| -| [`(constructor)`](enumerate_view/op_constructor.md.nolink) | コンストラクタ | C++23 | -| [`base`](enumerate_view/base.md.nolink) | `V`の参照を取得する | C++23 | -| [`begin`](enumerate_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++23 | -| [`end`](enumerate_view/end.md.nolink) | 番兵を取得する | C++23 | -| [`size`](enumerate_view/size.md.nolink) | 要素数を取得する | C++23 | +| [`(constructor)`](enumerate_view/op_constructor.md) | コンストラクタ | C++23 | +| [`base`](enumerate_view/base.md) | `V`の参照を取得する | C++23 | +| [`begin`](enumerate_view/begin.md) | 先頭を指すイテレータを取得する | C++23 | +| [`end`](enumerate_view/end.md) | 番兵を取得する | C++23 | +| [`size`](enumerate_view/size.md) | 要素数を取得する | C++23 | ## 継承しているメンバ関数 | 名前 | 説明 | 対応バージョン | |----------------------------------------------|-----------------------------------|----------------| -| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++20 | -| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++20 | -| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | -| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | +| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++23 | +| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++23 | +| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++23 | +| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++23 | | [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | | [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | -| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | +| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++23 | ## 推論補助 | 名前 | 説明 | 対応バージョン | |-------------------------------------------------------|------------------------------|----------------| -| [`(deduction_guide)`](enumerate_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | +| [`(deduction_guide)`](enumerate_view/op_deduction_guide.md) | クラステンプレートの推論補助 | C++23 | ## 例 ```cpp example +#include #include #include -#include int main() { const std::vector v = {'a', 'b', 'c'}; - std::println("{}", v | std::views::enumerate); + for (auto [index, x] : v | std::views::enumerate) { + std::cout << index << ' ' << x << std::endl; + } } ``` * std::views::enumerate[color ff0000] ### 出力 ``` -[(0, 'a'), (1, 'b'), (2, 'c')] +0 a +1 b +2 c ``` ## バージョン @@ -91,10 +95,9 @@ int main() { - C++23 ### 処理系 -- [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? -- [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? +- [Clang](/implementation.md#clang): 17 [mark verified] +- [GCC](/implementation.md#gcc): 13 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] ## 参照 - [N4950 26 Ranges library](https://timsong-cpp.github.io/cppwp/n4950/ranges) diff --git a/reference/ranges/enumerate_view/base.md b/reference/ranges/enumerate_view/base.md new file mode 100644 index 0000000000..f74a5b13b4 --- /dev/null +++ b/reference/ranges/enumerate_view/base.md @@ -0,0 +1,69 @@ +# base +* ranges[meta header] +* std::ranges[meta namespace] +* enumerate_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr V base() const & + requires copy_constructible; // (1) C++23 + +constexpr V base() &&; // (2) C++23 +``` + +## 概要 + +メンバ変数として保持している、元のviewを取得する。 + +## 効果 + +- (1) : `return base_;` +- (2) : `return std::move(base_);` + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {'a', 'b', 'c'}; + + std::ranges::enumerate_view ev(v); + + // (1) コピーして取得 + auto base1 = ev.base(); + static_assert(std::same_as>>); + + // (2) ムーブして取得 + auto base2 = std::move(ev).base(); + static_assert(std::same_as>>); + + // 取得したviewを使用(元の要素のみ) + for (char c : base1) { + std::cout << c << " "; + } + std::cout << std::endl; +} +``` +* base[color ff0000] + +### 出力 +``` +a b c +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 13.1 [mark verified] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] + +## 参照 +- [N4950 26.7.23 Enumerate view](https://timsong-cpp.github.io/cppwp/n4950/range.enumerate) \ No newline at end of file diff --git a/reference/ranges/enumerate_view/begin.md b/reference/ranges/enumerate_view/begin.md new file mode 100644 index 0000000000..0c8fcf02df --- /dev/null +++ b/reference/ranges/enumerate_view/begin.md @@ -0,0 +1,68 @@ +# begin +* ranges[meta header] +* std::ranges[meta namespace] +* enumerate_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr auto begin() + requires (!simple-view); // (1) C++23 + +constexpr auto begin() const + requires range-with-movable-references; // (2) C++23 +``` + +## 概要 + +先頭を指すイテレータを取得する。 + +## 効果 + +- (1) : `return iterator(ranges::begin(base_), 0);` +- (2) : `return iterator(ranges::begin(base_), 0);` + +ここで、`iterator`は`enumerate_view`の内部で定義される説明専用のイテレータクラスである。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {'a', 'b', 'c'}; + + std::ranges::enumerate_view ev(v); + + auto it = ev.begin(); + + // 最初の要素(インデックスと値のタプル) + auto [index, value] = *it; + std::cout << index << ": " << value << std::endl; + + // 次の要素へ + ++it; + auto [index2, value2] = *it; + std::cout << index2 << ": " << value2 << std::endl; +} +``` +* begin[color ff0000] + +### 出力 +``` +0: a +1: b +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 17 [mark verified] +- [GCC](/implementation.md#gcc): 13 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] + +## 参照 +- [N4950 26.7.23 Enumerate view](https://timsong-cpp.github.io/cppwp/n4950/range.enumerate) \ No newline at end of file diff --git a/reference/ranges/enumerate_view/end.md b/reference/ranges/enumerate_view/end.md new file mode 100644 index 0000000000..8d4f32f71a --- /dev/null +++ b/reference/ranges/enumerate_view/end.md @@ -0,0 +1,75 @@ +# end +* ranges[meta header] +* std::ranges[meta namespace] +* enumerate_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr auto end() + requires (!simple-view); // (1) C++23 + +constexpr auto end() const + requires range-with-movable-references; // (2) C++23 +``` + +## 概要 + +番兵を取得する。 + +## 効果 + +`common_range && sized_range`が`true`の場合: + +- (1) : `return iterator(ranges::end(base_), ranges::distance(base_));` +- (2) : `return iterator(ranges::end(base_), ranges::distance(base_));` + +それ以外の場合: + +- (1) : `return sentinel(ranges::end(base_));` +- (2) : `return sentinel(ranges::end(base_));` + +ここで、`iterator`と`sentinel`は`enumerate_view`の内部で定義される説明専用のクラスである。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {'a', 'b', 'c'}; + + std::ranges::enumerate_view ev(v); + + auto begin = ev.begin(); + auto end = ev.end(); + + // 全要素を出力 + for (auto it = begin; it != end; ++it) { + auto [index, value] = *it; + std::cout << index << ": " << value << std::endl; + } +} +``` +* end[color ff0000] +* begin[link begin.md] + +### 出力 +``` +0: a +1: b +2: c +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 17 [mark verified] +- [GCC](/implementation.md#gcc): 13 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] + +## 参照 +- [N4950 26.7.23 Enumerate view](https://timsong-cpp.github.io/cppwp/n4950/range.enumerate) \ No newline at end of file diff --git a/reference/ranges/enumerate_view/op_constructor.md b/reference/ranges/enumerate_view/op_constructor.md new file mode 100644 index 0000000000..eeac2f3cbb --- /dev/null +++ b/reference/ranges/enumerate_view/op_constructor.md @@ -0,0 +1,64 @@ +# コンストラクタ +* ranges[meta header] +* std::ranges[meta namespace] +* enumerate_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +enumerate_view() + requires default_initializable = default; // (1) C++23 + +constexpr explicit +enumerate_view(V base); // (2) C++23 +``` + +## 概要 + +- (1) : デフォルトコンストラクタ +- (2) : 元となるRangeを受け取るコンストラクタ + +## 効果 + +- (1) : `base_`をデフォルト構築する +- (2) : `base_`を`std::move(base)`で初期化する + +## 例 +```cpp example +#include +#include +#include + +int main() { + // (1) デフォルトコンストラクタ + std::ranges::enumerate_view> ev1; + + // (2) 元となるRangeを受け取るコンストラクタ + std::vector v = {'a', 'b', 'c'}; + std::ranges::enumerate_view ev2(v); + + for (auto [index, value] : ev2) { + std::cout << index << ": " << value << std::endl; + } +} +``` +* std::ranges::enumerate_view[color ff0000] + +### 出力 +``` +0: a +1: b +2: c +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 17 [mark verified] +- [GCC](/implementation.md#gcc): 13 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] + +## 参照 +- [N4950 26.7.23 Enumerate view](https://timsong-cpp.github.io/cppwp/n4950/range.enumerate) \ No newline at end of file diff --git a/reference/ranges/enumerate_view/op_deduction_guide.md b/reference/ranges/enumerate_view/op_deduction_guide.md new file mode 100644 index 0000000000..7f1fde6f0e --- /dev/null +++ b/reference/ranges/enumerate_view/op_deduction_guide.md @@ -0,0 +1,50 @@ +# 推論補助 +* ranges[meta header] +* std::ranges[meta namespace] +* enumerate_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template + enumerate_view(R&&) -> enumerate_view>; +} +``` + +## 概要 +`enumerate_view`クラステンプレートの型推論補助。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {'a', 'b', 'c'}; + + // enumerate_viewの型を明示的に指定する必要がない + std::ranges::enumerate_view ev{v}; + + // 推論された型を確認 + static_assert(std::same_as< + decltype(ev), + std::ranges::enumerate_view>> + >); +} +``` +* std::ranges::enumerate_view[color ff0000] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 17 [mark verified] +- [GCC](/implementation.md#gcc): 13 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] diff --git a/reference/ranges/enumerate_view/size.md b/reference/ranges/enumerate_view/size.md new file mode 100644 index 0000000000..5d57af0da3 --- /dev/null +++ b/reference/ranges/enumerate_view/size.md @@ -0,0 +1,62 @@ +# size +* ranges[meta header] +* std::ranges[meta namespace] +* enumerate_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr auto size() + requires sized_range; // (1) C++23 + +constexpr auto size() const + requires sized_range; // (2) C++23 +``` + +## 概要 + +要素数を取得する。 + +## 効果 + +- (1) : `return ranges::size(base_);` +- (2) : `return ranges::size(base_);` + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {'a', 'b', 'c'}; + + std::ranges::enumerate_view ev(v); + + // サイズを取得 + std::cout << "size: " << ev.size() << std::endl; + + // const版も動作する + const auto& cev = ev; + std::cout << "const size: " << cev.size() << std::endl; +} +``` +* size[color ff0000] + +### 出力 +``` +size: 3 +const size: 3 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 17 [mark verified] +- [GCC](/implementation.md#gcc): 13 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] + +## 参照 +- [N4950 26.7.23 Enumerate view](https://timsong-cpp.github.io/cppwp/n4950/range.enumerate) \ No newline at end of file From a87893323d914fb156eeab0a648c64e1070586e4 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 4 Jun 2025 12:43:01 +0900 Subject: [PATCH 1854/3948] =?UTF-8?q?owning=5Fview=20:=20=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=90=E9=96=A2=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/owning_view.md | 24 +++--- reference/ranges/owning_view/base.md | 70 +++++++++++++++ reference/ranges/owning_view/begin.md | 62 ++++++++++++++ reference/ranges/owning_view/data.md | 70 +++++++++++++++ reference/ranges/owning_view/empty.md | 64 ++++++++++++++ reference/ranges/owning_view/end.md | 60 +++++++++++++ .../ranges/owning_view/op_constructor.md | 85 +++++++++++++++++++ .../ranges/owning_view/op_deduction_guide.md | 51 +++++++++++ reference/ranges/owning_view/size.md | 65 ++++++++++++++ 9 files changed, 539 insertions(+), 12 deletions(-) create mode 100644 reference/ranges/owning_view/base.md create mode 100644 reference/ranges/owning_view/begin.md create mode 100644 reference/ranges/owning_view/data.md create mode 100644 reference/ranges/owning_view/empty.md create mode 100644 reference/ranges/owning_view/end.md create mode 100644 reference/ranges/owning_view/op_constructor.md create mode 100644 reference/ranges/owning_view/op_deduction_guide.md create mode 100644 reference/ranges/owning_view/size.md diff --git a/reference/ranges/owning_view.md b/reference/ranges/owning_view.md index 4fe88c5536..6dbbc04529 100644 --- a/reference/ranges/owning_view.md +++ b/reference/ranges/owning_view.md @@ -29,15 +29,15 @@ Rangeの右辺値をムーブして所有する[`view`](view.md)。このクラ ## メンバ関数 -| 名前 | 説明 | 対応バージョン | -|--------------------------------------------------|-----------------------------------|----------------| -| [`(constructor)`](owning_view/op_constructor.md.nolink) | コンストラクタ | C++20 | -| [`base`](owning_view/base.md.nolink) | `R`の参照を取得する | C++20 | -| [`begin`](owning_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++20 | -| [`end`](owning_view/end.md.nolink) | 番兵を取得する | C++20 | -| [`empty`](owning_view/empty.md.nolink) | Rangeが空かどうかを判定する | C++20 | -| [`size`](owning_view/size.md.nolink) | 要素数を取得する | C++20 | -| [`data`](owning_view/data.md.nolink) | Rangeの先頭へのポインタを取得する | C++20 | +| 名前 | 説明 | 対応バージョン | +|---------------------------------------------------|-----------------------------------|----------------| +| [`(constructor)`](owning_view/op_constructor.md) | コンストラクタ | C++20 | +| [`base`](owning_view/base.md) | `R`の参照を取得する | C++20 | +| [`begin`](owning_view/begin.md) | 先頭を指すイテレータを取得する | C++20 | +| [`end`](owning_view/end.md) | 番兵を取得する | C++20 | +| [`empty`](owning_view/empty.md) | Rangeが空かどうかを判定する | C++20 | +| [`size`](owning_view/size.md) | 要素数を取得する | C++20 | +| [`data`](owning_view/data.md) | Rangeの先頭へのポインタを取得する | C++20 | `r`を参照先のRangeとする。`empty`、`size`、`data`は、それぞれ[`ranges::empty`](empty.md)`(r)`、[`ranges::size`](size.md)`(r)`、[`ranges::data`](data.md)`(r)`が有効な式であるときに定義される。 @@ -49,14 +49,14 @@ Rangeの右辺値をムーブして所有する[`view`](view.md)。このクラ | [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | | [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | | [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | -| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | -| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | ## 推論補助 | 名前 | 説明 | 対応バージョン | |-------------------------------------------------------|------------------------------|----------------| -| [`(deduction_guide)`](owning_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++20 | +| [`(deduction_guide)`](owning_view/op_deduction_guide.md) | クラステンプレートの推論補助 | C++20 | ## 例 ```cpp example diff --git a/reference/ranges/owning_view/base.md b/reference/ranges/owning_view/base.md new file mode 100644 index 0000000000..f421da1f93 --- /dev/null +++ b/reference/ranges/owning_view/base.md @@ -0,0 +1,70 @@ +# base +* ranges[meta header] +* std::ranges[meta namespace] +* owning_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr R& base() & noexcept; // (1) C++20 +constexpr const R& base() const & noexcept; // (2) C++20 +constexpr R&& base() && noexcept; // (3) C++20 +constexpr const R&& base() const && noexcept; // (4) C++20 +``` + +## 概要 + +メンバ変数として保持している、元となるRangeを取得する。 + +## 効果 + +- (1) : `return r_;` +- (2) : `return r_;` +- (3) : `return std::move(r_);` +- (4) : `return std::move(r_);` + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5}; + std::ranges::owning_view ov{std::move(v)}; + + // (1) 左辺値参照版 + auto& base1 = ov.base(); + std::cout << "base size: " << base1.size() << std::endl; + + // (2) const左辺値参照版 + const auto& cov = ov; + const auto& base2 = cov.base(); + std::cout << "const base size: " << base2.size() << std::endl; + + // (3) 右辺値参照版 + auto base3 = std::move(ov).base(); + std::cout << "moved base size: " << base3.size() << std::endl; +} +``` +* base[color ff0000] + +### 出力 +``` +base size: 5 +const base size: 5 +moved base size: 5 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4892 24.7.3 All view](https://timsong-cpp.github.io/cppwp/n4892/range.all) \ No newline at end of file diff --git a/reference/ranges/owning_view/begin.md b/reference/ranges/owning_view/begin.md new file mode 100644 index 0000000000..e98a03906c --- /dev/null +++ b/reference/ranges/owning_view/begin.md @@ -0,0 +1,62 @@ +# begin +* ranges[meta header] +* std::ranges[meta namespace] +* owning_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr iterator_t begin(); // (1) C++20 + +constexpr auto begin() const + requires range; // (2) C++20 +``` + +## 概要 + +先頭要素を指すイテレータを取得する。 + +## 効果 + +- (1) : `return ranges::begin(r_);` +- (2) : `return ranges::begin(r_);` + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5}; + std::ranges::owning_view ov{std::move(v)}; + + auto it = ov.begin(); + std::cout << "first element: " << *it << std::endl; + + // const版も使用可能 + const auto& cov = ov; + auto const_it = cov.begin(); + std::cout << "const first element: " << *const_it << std::endl; +} +``` +* begin[color ff0000] + +### 出力 +``` +first element: 1 +const first element: 1 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4892 24.7.3 All view](https://timsong-cpp.github.io/cppwp/n4892/range.all) \ No newline at end of file diff --git a/reference/ranges/owning_view/data.md b/reference/ranges/owning_view/data.md new file mode 100644 index 0000000000..e29ef9c028 --- /dev/null +++ b/reference/ranges/owning_view/data.md @@ -0,0 +1,70 @@ +# data +* ranges[meta header] +* std::ranges[meta namespace] +* owning_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr auto data() + requires contiguous_range; // (1) C++20 + +constexpr auto data() const + requires contiguous_range; // (2) C++20 +``` +* contiguous_range[link ../contiguous_range.md] + +## 概要 + +Rangeの先頭要素へのポインタを取得する。 + +## 効果 + +- (1) : `return ranges::data(r_);` +- (2) : `return ranges::data(r_);` + +## 備考 + +この関数は、元となるRangeが[`contiguous_range`](../contiguous_range.md)コンセプトを満たす場合のみ定義される。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5}; + std::ranges::owning_view ov{std::move(v)}; + + auto ptr = ov.data(); + std::cout << "first element via data(): " << *ptr << std::endl; + std::cout << "second element via data(): " << *(ptr + 1) << std::endl; + + // const版も使用可能 + const auto& cov = ov; + auto const_ptr = cov.data(); + std::cout << "const first element via data(): " << *const_ptr << std::endl; +} +``` +* data[color ff0000] + +### 出力 +``` +first element via data(): 1 +second element via data(): 2 +const first element via data(): 1 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4892 24.7.3 All view](https://timsong-cpp.github.io/cppwp/n4892/range.all) \ No newline at end of file diff --git a/reference/ranges/owning_view/empty.md b/reference/ranges/owning_view/empty.md new file mode 100644 index 0000000000..f6064a5521 --- /dev/null +++ b/reference/ranges/owning_view/empty.md @@ -0,0 +1,64 @@ +# empty +* ranges[meta header] +* std::ranges[meta namespace] +* owning_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr bool empty() + requires requires { ranges::empty(r_); }; // (1) C++20 + +constexpr bool empty() const + requires requires { ranges::empty(r_); }; // (2) C++20 +``` + +## 概要 + +Rangeが空かどうかを判定する。 + +## 効果 + +- (1) : `return ranges::empty(r_);` +- (2) : `return ranges::empty(r_);` + +## 備考 + +この関数は、元となるRangeに対して[`ranges::empty`](../empty.md)が呼び出せる場合のみ定義される。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + // 空のvector + std::ranges::owning_view ov1{std::vector{}}; + std::cout << "empty vector: " << ov1.empty() << std::endl; + + // 要素を持つvector + std::ranges::owning_view ov2{std::vector{1, 2, 3}}; + std::cout << "non-empty vector: " << ov2.empty() << std::endl; +} +``` +* empty[color ff0000] + +### 出力 +``` +empty vector: 1 +non-empty vector: 0 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4892 24.7.3 All view](https://timsong-cpp.github.io/cppwp/n4892/range.all) \ No newline at end of file diff --git a/reference/ranges/owning_view/end.md b/reference/ranges/owning_view/end.md new file mode 100644 index 0000000000..285c4b73e3 --- /dev/null +++ b/reference/ranges/owning_view/end.md @@ -0,0 +1,60 @@ +# end +* ranges[meta header] +* std::ranges[meta namespace] +* owning_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr sentinel_t end(); // (1) C++20 + +constexpr auto end() const + requires range; // (2) C++20 +``` + +## 概要 + +番兵を取得する。 + +## 効果 + +- (1) : `return ranges::end(r_);` +- (2) : `return ranges::end(r_);` + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5}; + std::ranges::owning_view ov{std::move(v)}; + + // イテレータ範囲で全要素を出力 + for (auto it = ov.begin(); it != ov.end(); ++it) { + std::cout << *it << " "; + } + std::cout << std::endl; +} +``` +* end[color ff0000] +* begin[link begin.md] + +### 出力 +``` +1 2 3 4 5 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4892 24.7.3 All view](https://timsong-cpp.github.io/cppwp/n4892/range.all) \ No newline at end of file diff --git a/reference/ranges/owning_view/op_constructor.md b/reference/ranges/owning_view/op_constructor.md new file mode 100644 index 0000000000..096fd83e29 --- /dev/null +++ b/reference/ranges/owning_view/op_constructor.md @@ -0,0 +1,85 @@ +# コンストラクタ +* ranges[meta header] +* std::ranges[meta namespace] +* owning_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +owning_view() + requires default_initializable = default; // (1) C++20 + +constexpr owning_view(R&& t); // (2) C++20 + +owning_view(owning_view&&) = default; // (3) C++20 +owning_view& operator=(owning_view&&) = default; // (4) C++20 +``` + +## 概要 + +`owning_view`オブジェクトを構築する。 + +- (1) : デフォルトコンストラクタ。元となるRangeを値初期化する。 +- (2) : 元となるRangeの右辺値参照を受け取り、ムーブして所有するコンストラクタ。 +- (3) : ムーブコンストラクタ。 +- (4) : ムーブ代入演算子。 + +## 効果 + +- (1) : `r_`を値初期化する。 +- (2) : `r_(std::move(t))`でメンバを初期化する。 +- (3) : 他の`owning_view`オブジェクトからムーブ構築する。 +- (4) : 他の`owning_view`オブジェクトからムーブ代入する。 + +ここで、`r_`は元となるRangeを保持するメンバ変数である。 + +## 備考 + +- `owning_view`はコピー不可である(コピーコンストラクタとコピー代入演算子は削除されている)。 +- 元のRangeオブジェクトを所有するため、元のオブジェクトの寿命に依存しない。 + +## 例 +```cpp example +#include +#include +#include + +std::vector get_vector() { + return {1, 2, 3, 4, 5}; +} + +int main() { + // (1) デフォルトコンストラクタ + std::ranges::owning_view> ov1{}; + + // (2) 右辺値参照から構築 + std::ranges::owning_view ov2{get_vector()}; + + // (3) ムーブコンストラクタ + auto ov3 = std::move(ov2); + + for (int n : ov3) { + std::cout << n << " "; + } + std::cout << std::endl; +} +``` +* std::ranges::owning_view[color ff0000] + +### 出力 +``` +1 2 3 4 5 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4892 24.7.3 All view](https://timsong-cpp.github.io/cppwp/n4892/range.all) \ No newline at end of file diff --git a/reference/ranges/owning_view/op_deduction_guide.md b/reference/ranges/owning_view/op_deduction_guide.md new file mode 100644 index 0000000000..00d237fc31 --- /dev/null +++ b/reference/ranges/owning_view/op_deduction_guide.md @@ -0,0 +1,51 @@ +# 推論補助 +* ranges[meta header] +* std::ranges[meta namespace] +* owning_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +namespace std::ranges { + template + owning_view(R&&) -> owning_view; +} +``` + +## 概要 +`owning_view`クラステンプレートの型推論補助。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5}; + + // owning_viewの型を明示的に指定する必要がない + std::ranges::owning_view ov{std::move(v)}; + + // 推論された型を確認 + static_assert(std::same_as< + decltype(ov), + std::ranges::owning_view> + >); +} +``` +* std::ranges::owning_view[color ff0000] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/owning_view/size.md b/reference/ranges/owning_view/size.md new file mode 100644 index 0000000000..6620b6186b --- /dev/null +++ b/reference/ranges/owning_view/size.md @@ -0,0 +1,65 @@ +# size +* ranges[meta header] +* std::ranges[meta namespace] +* owning_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr auto size() + requires sized_range; // (1) C++20 + +constexpr auto size() const + requires sized_range; // (2) C++20 +``` + +## 概要 + +要素数を取得する。 + +## 効果 + +- (1) : `return ranges::size(r_);` +- (2) : `return ranges::size(r_);` + +## 備考 + +この関数は、元となるRangeが[`sized_range`](../sized_range.md)コンセプトを満たす場合のみ定義される。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5}; + std::ranges::owning_view ov{std::move(v)}; + + std::cout << "size: " << ov.size() << std::endl; + + // const版も使用可能 + const auto& cov = ov; + std::cout << "const size: " << cov.size() << std::endl; +} +``` +* size[color ff0000] + +### 出力 +``` +size: 5 +const size: 5 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4892 24.7.3 All view](https://timsong-cpp.github.io/cppwp/n4892/range.all) \ No newline at end of file From 305a617cb445abc7827bf4aeb43acca8a83b23f3 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 4 Jun 2025 12:46:04 +0900 Subject: [PATCH 1855/3948] =?UTF-8?q?reverse=5Fview=20:=20=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=90=E9=96=A2=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/reverse_view.md | 16 ++-- reference/ranges/reverse_view/base.md | 69 +++++++++++++++++ reference/ranges/reverse_view/begin.md | 77 +++++++++++++++++++ reference/ranges/reverse_view/end.md | 75 ++++++++++++++++++ .../ranges/reverse_view/op_constructor.md | 65 ++++++++++++++++ .../ranges/reverse_view/op_deduction_guide.md | 51 ++++++++++++ reference/ranges/reverse_view/size.md | 63 +++++++++++++++ 7 files changed, 408 insertions(+), 8 deletions(-) create mode 100644 reference/ranges/reverse_view/base.md create mode 100644 reference/ranges/reverse_view/begin.md create mode 100644 reference/ranges/reverse_view/end.md create mode 100644 reference/ranges/reverse_view/op_constructor.md create mode 100644 reference/ranges/reverse_view/op_deduction_guide.md create mode 100644 reference/ranges/reverse_view/size.md diff --git a/reference/ranges/reverse_view.md b/reference/ranges/reverse_view.md index 1d799ae4a6..d86c4196a5 100644 --- a/reference/ranges/reverse_view.md +++ b/reference/ranges/reverse_view.md @@ -51,11 +51,11 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |--------------------------------------------------|-----------------------------------|----------------| -| [`(constructor)`](reverse_view/op_constructor.md.nolink) | コンストラクタ | C++20 | -| [`base`](reverse_view/base.md.nolink) | `V`の参照を取得する | C++20 | -| [`begin`](reverse_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++20 | -| [`end`](reverse_view/end.md.nolink) | 番兵を取得する | C++20 | -| [`size`](reverse_view/size.md.nolink) | 要素数を取得する | C++20 | +| [`(constructor)`](reverse_view/op_constructor.md) | コンストラクタ | C++20 | +| [`base`](reverse_view/base.md) | `V`の参照を取得する | C++20 | +| [`begin`](reverse_view/begin.md) | 先頭を指すイテレータを取得する | C++20 | +| [`end`](reverse_view/end.md) | 番兵を取得する | C++20 | +| [`size`](reverse_view/size.md) | 要素数を取得する | C++20 | `r`を参照先のRangeとする。`size`は、[`ranges::size`](size.md)`(r)`が有効な式であるときに定義される。 @@ -69,14 +69,14 @@ namespace std::ranges { | [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | | [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | | [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | -| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | -| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | ## 推論補助 | 名前 | 説明 | 対応バージョン | |-------------------------------------------------------|------------------------------|----------------| -| [`(deduction_guide)`](reverse_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++20 | +| [`(deduction_guide)`](reverse_view/op_deduction_guide.md) | クラステンプレートの推論補助 | C++20 | ## 例 ```cpp example diff --git a/reference/ranges/reverse_view/base.md b/reference/ranges/reverse_view/base.md new file mode 100644 index 0000000000..8cef2e99f0 --- /dev/null +++ b/reference/ranges/reverse_view/base.md @@ -0,0 +1,69 @@ +# base +* ranges[meta header] +* std::ranges[meta namespace] +* reverse_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr V base() const & + requires copy_constructible; // (1) C++20 + +constexpr V base() &&; // (2) C++20 +``` + +## 概要 + +メンバ変数として保持している、元のviewを取得する。 + +## 効果 + +- (1) : `return base_;` +- (2) : `return std::move(base_);` + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + std::ranges::reverse_view rv(vec); + + // (1) コピーして取得 + auto base1 = rv.base(); + static_assert(std::same_as>>); + + // (2) ムーブして取得 + auto base2 = std::move(rv).base(); + static_assert(std::same_as>>); + + // 取得したviewを使用(元の順序) + for (int n : base1) { + std::cout << n << " "; + } + std::cout << std::endl; +} +``` +* base[color ff0000] + +### 出力 +``` +1 2 3 4 5 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4861 24.7.6.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.reverse.view) \ No newline at end of file diff --git a/reference/ranges/reverse_view/begin.md b/reference/ranges/reverse_view/begin.md new file mode 100644 index 0000000000..f6345a87d1 --- /dev/null +++ b/reference/ranges/reverse_view/begin.md @@ -0,0 +1,77 @@ +# begin +* ranges[meta header] +* std::ranges[meta namespace] +* reverse_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr reverse_iterator> begin(); // (1) C++20 + +constexpr reverse_iterator> begin() + requires common_range; // (2) C++20 + +constexpr auto begin() const + requires common_range; // (3) C++20 +``` +* reverse_iterator[link /reference/iterator/reverse_iterator.md] + +## 概要 + +先頭を指すイテレータを取得する。 + +## 効果 + +- (1) : キャッシュが空の場合、`cache_ = make_reverse_iterator(ranges::next(ranges::begin(base_), ranges::end(base_)))`を実行する。そうでなければ`return *cache_;` +- (2) : `return make_reverse_iterator(ranges::end(base_));` +- (3) : `return make_reverse_iterator(ranges::end(base_));` + +## 備考 + +- (1)は、[`common_range`](../common_range.md)ではないRangeのために、終端位置をキャッシュして償却定数時間で返す + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + std::ranges::reverse_view rv(vec); + + auto it = rv.begin(); + + // 逆順に出力 + std::cout << *it << std::endl; // 5 + ++it; + std::cout << *it << std::endl; // 4 + + // const版 + const auto& crv = rv; + auto cit = crv.begin(); + std::cout << *cit << std::endl; // 5 +} +``` +* begin[color ff0000] + +### 出力 +``` +5 +4 +5 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4861 24.7.6.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.reverse.view) \ No newline at end of file diff --git a/reference/ranges/reverse_view/end.md b/reference/ranges/reverse_view/end.md new file mode 100644 index 0000000000..28fcdd5bda --- /dev/null +++ b/reference/ranges/reverse_view/end.md @@ -0,0 +1,75 @@ +# end +* ranges[meta header] +* std::ranges[meta namespace] +* reverse_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr reverse_iterator> end(); // (1) C++20 + +constexpr auto end() const + requires common_range; // (2) C++20 +``` +* reverse_iterator[link /reference/iterator/reverse_iterator.md] + +## 概要 + +番兵を取得する。 + +## 効果 + +- (1) : `return make_reverse_iterator(ranges::begin(base_));` +- (2) : `return make_reverse_iterator(ranges::begin(base_));` + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + std::ranges::reverse_view rv(vec); + + auto begin = rv.begin(); + auto end = rv.end(); + + // 逆順に全要素を出力 + for (auto it = begin; it != end; ++it) { + std::cout << *it << " "; + } + std::cout << std::endl; + + // const版 + const auto& crv = rv; + auto cbegin = crv.begin(); + auto cend = crv.end(); + for (auto it = cbegin; it != cend; ++it) { + std::cout << *it << " "; + } + std::cout << std::endl; +} +``` +* end[color ff0000] +* begin[link begin.md] + +### 出力 +``` +5 4 3 2 1 +5 4 3 2 1 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4861 24.7.6.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.reverse.view) \ No newline at end of file diff --git a/reference/ranges/reverse_view/op_constructor.md b/reference/ranges/reverse_view/op_constructor.md new file mode 100644 index 0000000000..4369454a56 --- /dev/null +++ b/reference/ranges/reverse_view/op_constructor.md @@ -0,0 +1,65 @@ +# コンストラクタ +* ranges[meta header] +* std::ranges[meta namespace] +* reverse_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +reverse_view() + requires default_initializable = default; // (1) C++20 + +constexpr explicit +reverse_view(V r); // (2) C++20 +``` + +## 概要 + +- (1) : デフォルトコンストラクタ +- (2) : 元となるRangeを受け取るコンストラクタ + +## 効果 + +- (1) : `base_`をデフォルト構築する +- (2) : `base_`を`std::move(r)`で初期化する + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + // (1) デフォルトコンストラクタ + std::ranges::reverse_view> rv1; + + // (2) 元となるRangeを受け取るコンストラクタ + std::ranges::reverse_view rv2(vec); + + for (int n : rv2) { + std::cout << n << " "; + } + std::cout << std::endl; +} +``` +* std::ranges::reverse_view[color ff0000] + +### 出力 +``` +5 4 3 2 1 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4861 24.7.6.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.reverse.view) \ No newline at end of file diff --git a/reference/ranges/reverse_view/op_deduction_guide.md b/reference/ranges/reverse_view/op_deduction_guide.md new file mode 100644 index 0000000000..148d0e73ed --- /dev/null +++ b/reference/ranges/reverse_view/op_deduction_guide.md @@ -0,0 +1,51 @@ +# 推論補助 +* ranges[meta header] +* std::ranges[meta namespace] +* reverse_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +namespace std::ranges { + template + reverse_view(R&&) -> reverse_view>; +} +``` + +## 概要 +`reverse_view`クラステンプレートの型推論補助。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + // reverse_viewの型を明示的に指定する必要がない + std::ranges::reverse_view rv{vec}; + + // 推論された型を確認 + static_assert(std::same_as< + decltype(rv), + std::ranges::reverse_view>> + >); +} +``` +* std::ranges::reverse_view[color ff0000] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/reverse_view/size.md b/reference/ranges/reverse_view/size.md new file mode 100644 index 0000000000..bc38982372 --- /dev/null +++ b/reference/ranges/reverse_view/size.md @@ -0,0 +1,63 @@ +# size +* ranges[meta header] +* std::ranges[meta namespace] +* reverse_view[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +constexpr auto size() + requires sized_range; // (1) C++20 + +constexpr auto size() const + requires sized_range; // (2) C++20 +``` + +## 概要 + +要素数を取得する。 + +## 効果 + +- (1) : `return ranges::size(base_);` +- (2) : `return ranges::size(base_);` + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + std::ranges::reverse_view rv(vec); + + // サイズを取得 + std::cout << "size: " << rv.size() << std::endl; + + // const版も動作する + const auto& crv = rv; + std::cout << "const size: " << crv.size() << std::endl; +} +``` +* size[color ff0000] + +### 出力 +``` +size: 5 +const size: 5 +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4861 24.7.6.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.reverse.view) \ No newline at end of file From f69a490e0c673e958cf1c76dc6eae8cf95ccefcc Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 4 Jun 2025 12:57:22 +0900 Subject: [PATCH 1856/3948] =?UTF-8?q?slide=5Fview=20:=20=E3=83=A1=E3=83=B3?= =?UTF-8?q?=E3=83=90=E9=96=A2=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/slide_view.md | 41 +++++----- reference/ranges/slide_view/base.md | 62 +++++++++++++++ reference/ranges/slide_view/begin.md | 68 ++++++++++++++++ reference/ranges/slide_view/end.md | 74 ++++++++++++++++++ reference/ranges/slide_view/op_constructor.md | 68 ++++++++++++++++ .../ranges/slide_view/op_deduction_guide.md | 49 ++++++++++++ reference/ranges/slide_view/size.md | 78 +++++++++++++++++++ 7 files changed, 419 insertions(+), 21 deletions(-) create mode 100644 reference/ranges/slide_view/base.md create mode 100644 reference/ranges/slide_view/begin.md create mode 100644 reference/ranges/slide_view/end.md create mode 100644 reference/ranges/slide_view/op_constructor.md create mode 100644 reference/ranges/slide_view/op_deduction_guide.md create mode 100644 reference/ranges/slide_view/size.md diff --git a/reference/ranges/slide_view.md b/reference/ranges/slide_view.md index 7bcf4998b4..7f48717348 100644 --- a/reference/ranges/slide_view.md +++ b/reference/ranges/slide_view.md @@ -53,31 +53,31 @@ namespace std::ranges { ## メンバ関数 -| 名前 | 説明 | 対応バージョン | -|-----------------------------------------------------|----------------------------------|----------------| -| [`(constructor)`](slide_view/op_constructor.md.nolink) | コンストラクタ | C++23 | -| [`base`](slide_view/base.md.nolink) | `V`の参照を取得する | C++23 | -| [`begin`](slide_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++23 | -| [`end`](slide_view/end.md.nolink) | 番兵を取得する | C++23 | -| [`size`](slide_view/size.md.nolink) | 要素数を取得する | C++23 | +| 名前 | 説明 | 対応バージョン | +|--------------------------------------------------|----------------------------------|----------------| +| [`(constructor)`](slide_view/op_constructor.md) | コンストラクタ | C++23 | +| [`base`](slide_view/base.md) | `V`の参照を取得する | C++23 | +| [`begin`](slide_view/begin.md) | 先頭を指すイテレータを取得する | C++23 | +| [`end`](slide_view/end.md) | 番兵を取得する | C++23 | +| [`size`](slide_view/size.md) | 要素数を取得する | C++23 | ## 継承しているメンバ関数 | 名前 | 説明 | 対応バージョン | |----------------------------------------------|-----------------------------------|----------------| -| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++20 | -| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++20 | -| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | -| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | +| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++23 | +| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++23 | +| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++23 | +| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++23 | | [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | | [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | -| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | +| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++23 | ## 推論補助 | 名前 | 説明 | 対応バージョン | |-------------------------------------------------------|------------------------------|----------------| -| [`(deduction_guide)`](slide_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | +| [`(deduction_guide)`](slide_view/op_deduction_guide.md) | クラステンプレートの推論補助 | C++23 | ## 例 ```cpp example @@ -87,10 +87,10 @@ namespace std::ranges { int main() { std::vector v = {1, 2, 3, 4, 5, 6}; - std::println("{}", v | std::views::slide<1>); - std::println("{}", v | std::views::slide<3>); - std::println("{}", v | std::views::slide<6>); - std::println("{}", v | std::views::slide<7>); + std::println("{}", v | std::views::slide(1)); + std::println("{}", v | std::views::slide(3)); + std::println("{}", v | std::views::slide(6)); + std::println("{}", v | std::views::slide(7)); } ``` * std::views::slide[color ff0000] @@ -108,10 +108,9 @@ int main() { - C++23 ### 処理系 -- [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): 14.0 [mark verified] -- [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? +- [Clang](/implementation.md#clang): 17 [mark verified] +- [GCC](/implementation.md#gcc): 13.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 3 [mark verified] ## 関連項目 - [`adjacent_view`](adjacent_view.md): `slide_view` と同じように要素を取得するが、個数をコンパイル時に指定する。内側はRangeではなく[`tuple`](/reference/tuple/tuple.md)となる diff --git a/reference/ranges/slide_view/base.md b/reference/ranges/slide_view/base.md new file mode 100644 index 0000000000..77e0c3002a --- /dev/null +++ b/reference/ranges/slide_view/base.md @@ -0,0 +1,62 @@ +# base +* ranges[meta header] +* std::ranges[meta namespace] +* slide_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr V base() const & + requires copy_constructible; // (1) C++23 + +constexpr V base() &&; // (2) C++23 +``` + +## 概要 + +メンバ変数として保持している、元となるRangeを取得する。 + +## 効果 + +- (1) : `return base_;` +- (2) : `return std::move(base_);` + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5, 6}; + + std::ranges::slide_view sv{v, 3}; + + // (1) const左辺値参照版 + const auto& base1 = sv.base(); + std::cout << "base size: " << base1.size() << std::endl; + + // (2) 右辺値参照版 + auto base2 = std::move(sv).base(); + std::cout << "moved base size: " << base2.size() << std::endl; +} +``` +* base[color ff0000] + +### 出力 +``` +base size: 6 +moved base size: 6 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 17 [mark verified] +- [GCC](/implementation.md#gcc): 13.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 3 [mark verified] + +## 参照 +- [N4950 26.7.31 Slide view](https://timsong-cpp.github.io/cppwp/n4950/range.slide) \ No newline at end of file diff --git a/reference/ranges/slide_view/begin.md b/reference/ranges/slide_view/begin.md new file mode 100644 index 0000000000..6785092284 --- /dev/null +++ b/reference/ranges/slide_view/begin.md @@ -0,0 +1,68 @@ +# begin +* ranges[meta header] +* std::ranges[meta namespace] +* slide_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr auto begin() + requires (!(simple-view && slide-caches-nothing)); // (1) C++23 + +constexpr auto begin() const + requires slide-caches-nothing; // (2) C++23 +``` +* slide-caches-nothing[italic] + +## 概要 + +先頭要素を指すイテレータを取得する。 + +## 効果 + +`forward_range`の場合: + +- (1), (2) : `return iterator(ranges::begin(base_), ranges::end(base_), n_);` + +それ以外の場合: + +- (1) : `return iterator(this);` +- (2) : `return iterator(this);` + +ここで、`iterator`は説明専用のイテレータクラスであり、`slide-caches-nothing`は`forward_range`かつ`V`が`random_access_range`または`sized_range`であることを表す説明専用のコンセプトである。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5, 6}; + + std::ranges::slide_view sv{v, 3}; + + auto it = sv.begin(); + + // 最初のスライドを出力 + std::println("{}", *it); +} +``` +* begin[color ff0000] + +### 出力 +``` +[1, 2, 3] +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 17 [mark verified] +- [GCC](/implementation.md#gcc): 13.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 3 [mark verified] + +## 参照 +- [N4950 26.7.31 Slide view](https://timsong-cpp.github.io/cppwp/n4950/range.slide) \ No newline at end of file diff --git a/reference/ranges/slide_view/end.md b/reference/ranges/slide_view/end.md new file mode 100644 index 0000000000..dc7dd1c64c --- /dev/null +++ b/reference/ranges/slide_view/end.md @@ -0,0 +1,74 @@ +# end +* ranges[meta header] +* std::ranges[meta namespace] +* slide_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr auto end() + requires (!(simple-view && slide-caches-nothing)); // (1) C++23 + +constexpr auto end() const + requires slide-caches-nothing; // (2) C++23 +``` +* slide-caches-nothing[italic] + +## 概要 + +番兵またはイテレータを取得する。 + +## 効果 + +`forward_range`の場合: + +`common_range`の場合: +- (1), (2) : `return iterator(ranges::end(base_) - min(n_ - 1, ranges::distance(base_)), ranges::end(base_), n_);` + +それ以外の場合: +- (1), (2) : `return sentinel(ranges::end(base_));` + +それ以外の場合(`forward_range`でない場合): +- (1), (2) : `return default_sentinel;` + +ここで、`iterator`と`sentinel`は説明専用のクラスであり、`Const`は各オーバーロードに応じて`false`または`true`となる。`slide-caches-nothing`は`forward_range`かつ`V`が`random_access_range`または`sized_range`であることを表す説明専用のコンセプトである。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5, 6}; + + std::ranges::slide_view sv{v, 3}; + + // イテレータ範囲で全スライドを出力 + for (auto it = sv.begin(); it != sv.end(); ++it) { + std::println("{}", *it); + } +} +``` +* end[color ff0000] +* begin[link begin.md] + +### 出力 +``` +[1, 2, 3] +[2, 3, 4] +[3, 4, 5] +[4, 5, 6] +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 17 [mark verified] +- [GCC](/implementation.md#gcc): 13.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 3 [mark verified] + +## 参照 +- [N4950 26.7.31 Slide view](https://timsong-cpp.github.io/cppwp/n4950/range.slide) \ No newline at end of file diff --git a/reference/ranges/slide_view/op_constructor.md b/reference/ranges/slide_view/op_constructor.md new file mode 100644 index 0000000000..b3fcfcae2d --- /dev/null +++ b/reference/ranges/slide_view/op_constructor.md @@ -0,0 +1,68 @@ +# コンストラクタ +* ranges[meta header] +* std::ranges[meta namespace] +* slide_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +slide_view() + requires default_initializable = default; // (1) C++23 + +constexpr explicit +slide_view(V base, range_difference_t n); // (2) C++23 +``` + +## 概要 + +`slide_view`オブジェクトを構築する。 + +- (1) : デフォルトコンストラクタ。元となるRangeを値初期化する。 +- (2) : 元となるRangeとスライドサイズを受け取るコンストラクタ。 + +## 効果 + +- (1) : `base_`と`n_`を値初期化する。 +- (2) : `base_(std::move(base))`、`n_(n)`で初期化する。 + +ここで、`base_`は元となるRangeを保持するメンバ変数、`n_`はスライドサイズを保持するメンバ変数である。 + +## 事前条件 + +- (2) : `n > 0` + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5, 6}; + + // デフォルトコンストラクタ + std::ranges::slide_view>> sv1{}; + + // 元となるRangeとスライドサイズを指定 + std::ranges::slide_view sv2{v, 3}; + + std::println("{}", sv2); +} +``` + +### 出力 +``` +[[1, 2, 3], [2, 3, 4], [3, 4, 5], [4, 5, 6]] +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 17 [mark verified] +- [GCC](/implementation.md#gcc): 13.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 3 [mark verified] + +## 参照 +- [N4950 26.7.31 Slide view](https://timsong-cpp.github.io/cppwp/n4950/range.slide) \ No newline at end of file diff --git a/reference/ranges/slide_view/op_deduction_guide.md b/reference/ranges/slide_view/op_deduction_guide.md new file mode 100644 index 0000000000..05ab050ab8 --- /dev/null +++ b/reference/ranges/slide_view/op_deduction_guide.md @@ -0,0 +1,49 @@ +# 推論補助 +* ranges[meta header] +* std::ranges[meta namespace] +* slide_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template + slide_view(R&&, range_difference_t) -> slide_view>; +} +``` + +## 概要 +`slide_view`クラステンプレートの型推論補助。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5, 6}; + + // slide_viewの型を明示的に指定する必要がない + std::ranges::slide_view sv{v, 3}; + + // 推論された型を確認 + static_assert(std::same_as< + decltype(sv), + std::ranges::slide_view>> + >); +} +``` + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 17 [mark verified] +- [GCC](/implementation.md#gcc): 13.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 3 [mark verified] diff --git a/reference/ranges/slide_view/size.md b/reference/ranges/slide_view/size.md new file mode 100644 index 0000000000..9dd4cad864 --- /dev/null +++ b/reference/ranges/slide_view/size.md @@ -0,0 +1,78 @@ +# size +* ranges[meta header] +* std::ranges[meta namespace] +* slide_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr auto size() + requires sized_range; // (1) C++23 + +constexpr auto size() const + requires sized_range; // (2) C++23 +``` + +## 概要 + +要素数(スライド数)を取得する。 + +## 効果 + +以下と等価: + +```cpp +auto sz = ranges::distance(base_); +if (sz < n_) return 0; +return to-unsigned-like(sz - n_ + 1); +``` +* to-unsigned-like[italic] + +ここで、`to-unsigned-like`は説明専用の関数であり、整数型を対応する符号なし整数型に変換する。 + +## 備考 + +元のRangeの要素数が`n`より小さい場合は0を返し、そうでなければ`sz - n + 1`を返す。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5, 6}; + + // サイズ3のスライド + std::ranges::slide_view sv1{v, 3}; + std::cout << "slide_view(6 elements, slide size 3): " << sv1.size() << " slides" << std::endl; + + // サイズ6のスライド + std::ranges::slide_view sv2{v, 6}; + std::cout << "slide_view(6 elements, slide size 6): " << sv2.size() << " slides" << std::endl; + + // サイズ7のスライド(元より大きい) + std::ranges::slide_view sv3{v, 7}; + std::cout << "slide_view(6 elements, slide size 7): " << sv3.size() << " slides" << std::endl; +} +``` +* size[color ff0000] + +### 出力 +``` +slide_view(6 elements, slide size 3): 4 slides +slide_view(6 elements, slide size 6): 1 slides +slide_view(6 elements, slide size 7): 0 slides +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 17 [mark verified] +- [GCC](/implementation.md#gcc): 13.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 3 [mark verified] + +## 参照 +- [N4950 26.7.31 Slide view](https://timsong-cpp.github.io/cppwp/n4950/range.slide) \ No newline at end of file From d79c2be843088526c7760943dce41a521fc4980a Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 4 Jun 2025 13:03:31 +0900 Subject: [PATCH 1857/3948] =?UTF-8?q?stride=5Fview=20:=20=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=90=E9=96=A2=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/stride_view.md | 29 ++++---- reference/ranges/stride_view/base.md | 60 ++++++++++++++++ reference/ranges/stride_view/begin.md | 61 ++++++++++++++++ reference/ranges/stride_view/end.md | 69 ++++++++++++++++++ .../ranges/stride_view/op_constructor.md | 72 +++++++++++++++++++ .../ranges/stride_view/op_deduction_guide.md | 51 +++++++++++++ reference/ranges/stride_view/size.md | 72 +++++++++++++++++++ reference/ranges/stride_view/stride.md | 52 ++++++++++++++ 8 files changed, 451 insertions(+), 15 deletions(-) create mode 100644 reference/ranges/stride_view/base.md create mode 100644 reference/ranges/stride_view/begin.md create mode 100644 reference/ranges/stride_view/end.md create mode 100644 reference/ranges/stride_view/op_constructor.md create mode 100644 reference/ranges/stride_view/op_deduction_guide.md create mode 100644 reference/ranges/stride_view/size.md create mode 100644 reference/ranges/stride_view/stride.md diff --git a/reference/ranges/stride_view.md b/reference/ranges/stride_view.md index 7074702f23..d14de81ecc 100644 --- a/reference/ranges/stride_view.md +++ b/reference/ranges/stride_view.md @@ -39,30 +39,30 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |--------------------------------------------------|----------------------------------|----------------| -| [`(constructor)`](stride_view/op_constructor.md.nolink) | コンストラクタ | C++23 | -| [`base`](stride_view/base.md.nolink) | `V`の参照を取得する | C++23 | -| [`stride`](stride_view/stride.md.nolink) | 1回で移動する要素数を取得する | C++23 | -| [`begin`](stride_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++23 | -| [`end`](stride_view/end.md.nolink) | 番兵を取得する | C++23 | -| [`size`](stride_view/size.md.nolink) | 要素数を取得する | C++23 | +| [`(constructor)`](stride_view/op_constructor.md) | コンストラクタ | C++23 | +| [`base`](stride_view/base.md) | `V`の参照を取得する | C++23 | +| [`stride`](stride_view/stride.md) | 1回で移動する要素数を取得する | C++23 | +| [`begin`](stride_view/begin.md) | 先頭を指すイテレータを取得する | C++23 | +| [`end`](stride_view/end.md) | 番兵を取得する | C++23 | +| [`size`](stride_view/size.md) | 要素数を取得する | C++23 | ## 継承しているメンバ関数 | 名前 | 説明 | 対応バージョン | |----------------------------------------------|-----------------------------------|----------------| -| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++20 | -| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++20 | -| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | -| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | +| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++23 | +| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++23 | +| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++23 | +| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++23 | | [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | | [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | -| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | +| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++23 | ## 推論補助 | 名前 | 説明 | 対応バージョン | |-------------------------------------------------------|------------------------------|----------------| -| [`(deduction_guide)`](stride_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | +| [`(deduction_guide)`](stride_view/op_deduction_guide.md) | クラステンプレートの推論補助 | C++23 | ## 例 ```cpp example @@ -75,7 +75,7 @@ int main() { std::println("{}", v | std::views::stride(3)); - for (auto&& i : v | std::views::stride(3)) { + for (auto& i : v | std::views::stride(3)) { i *= 10; // 要素を書き換えても良い } std::println("{}", v); @@ -96,8 +96,7 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): 16.0 [mark verified] - [GCC](/implementation.md#gcc): 13.2 [mark verified] -- [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 4 [mark verified] ## 参照 - [N4950 26 Ranges library](https://timsong-cpp.github.io/cppwp/n4950/ranges) diff --git a/reference/ranges/stride_view/base.md b/reference/ranges/stride_view/base.md new file mode 100644 index 0000000000..39944edfe9 --- /dev/null +++ b/reference/ranges/stride_view/base.md @@ -0,0 +1,60 @@ +# base +* ranges[meta header] +* std::ranges[meta namespace] +* stride_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr V base() const & requires copy_constructible; // (1) C++23 +constexpr V base() &&; // (2) C++23 +``` + +## 概要 + +メンバ変数として保持している、元となるRangeを取得する。 + +## 効果 + +- (1) : `return base_;` +- (2) : `return std::move(base_);` + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {0, 1, 2, 3, 4, 5, 6, 7, 8}; + + std::ranges::stride_view sv{v, 3}; + + // (1) const左辺値参照版 + const auto& base1 = sv.base(); + std::cout << "base size: " << base1.size() << std::endl; + + // (2) 右辺値参照版 + auto base2 = std::move(sv).base(); + std::cout << "moved base size: " << base2.size() << std::endl; +} +``` +* base[color ff0000] + +### 出力 +``` +base size: 9 +moved base size: 9 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 13.2 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 4 [mark verified] + +## 参照 +- [N4950 26.7.32 Stride view](https://timsong-cpp.github.io/cppwp/n4950/range.stride) \ No newline at end of file diff --git a/reference/ranges/stride_view/begin.md b/reference/ranges/stride_view/begin.md new file mode 100644 index 0000000000..e3b948c4a7 --- /dev/null +++ b/reference/ranges/stride_view/begin.md @@ -0,0 +1,61 @@ +# begin +* ranges[meta header] +* std::ranges[meta namespace] +* stride_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr auto begin() + requires (!simple-view); // (1) C++23 + +constexpr auto begin() const + requires range; // (2) C++23 +``` + +## 概要 + +先頭要素を指すイテレータを取得する。 + +## 効果 + +- (1) : `return iterator(this, ranges::begin(base_));` +- (2) : `return iterator(this, ranges::begin(base_));` + +ここで、`iterator`は説明専用のイテレータクラスである。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {0, 1, 2, 3, 4, 5, 6, 7, 8}; + + std::ranges::stride_view sv{v, 3}; + + auto it = sv.begin(); + + // 最初の要素を出力 + std::println("first element: {}", *it); +} +``` +* begin[color ff0000] + +### 出力 +``` +first element: 0 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 13.2 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 4 [mark verified] + +## 参照 +- [N4950 26.7.32 Stride view](https://timsong-cpp.github.io/cppwp/n4950/range.stride) \ No newline at end of file diff --git a/reference/ranges/stride_view/end.md b/reference/ranges/stride_view/end.md new file mode 100644 index 0000000000..623737e030 --- /dev/null +++ b/reference/ranges/stride_view/end.md @@ -0,0 +1,69 @@ +# end +* ranges[meta header] +* std::ranges[meta namespace] +* stride_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr auto end() + requires (!simple-view); // (1) C++23 + +constexpr auto end() const + requires range; // (2) C++23 +``` + +## 概要 + +番兵またはイテレータを取得する。 + +## 効果 + +`common_range`の場合: +- (1) : `return iterator(this, ranges::end(base_));` +- (2) : `return iterator(this, ranges::end(base_));` + +それ以外の場合: +- (1) : `return default_sentinel;` +- (2) : `return default_sentinel;` + +ここで、`iterator`は説明専用のイテレータクラスである。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {0, 1, 2, 3, 4, 5, 6, 7, 8}; + + std::ranges::stride_view sv{v, 3}; + + // イテレータ範囲で全要素を出力 + for (auto it = sv.begin(); it != sv.end(); ++it) { + std::println("{}", *it); + } +} +``` +* end[color ff0000] +* begin[link begin.md] + +### 出力 +``` +0 +3 +6 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 13.2 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 4 [mark verified] + +## 参照 +- [N4950 26.7.32 Stride view](https://timsong-cpp.github.io/cppwp/n4950/range.stride) \ No newline at end of file diff --git a/reference/ranges/stride_view/op_constructor.md b/reference/ranges/stride_view/op_constructor.md new file mode 100644 index 0000000000..1fbc17b890 --- /dev/null +++ b/reference/ranges/stride_view/op_constructor.md @@ -0,0 +1,72 @@ +# コンストラクタ +* ranges[meta header] +* std::ranges[meta namespace] +* stride_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +stride_view() + requires default_initializable = default; // (1) C++23 + +constexpr explicit +stride_view(V base, range_difference_t stride); // (2) C++23 +``` + +## 概要 + +`stride_view`オブジェクトを構築する。 + +- (1) : デフォルトコンストラクタ。元となるRangeを値初期化する。 +- (2) : 元となるRangeと歩幅を受け取るコンストラクタ。 + +## 事前条件 + +- (2) : `stride > 0` + + +## 効果 + +- (1) : `base_`と`stride_`を値初期化する。 +- (2) : `base_(std::move(base))`、`stride_(stride)`で初期化する。 + +ここで、`base_`は元となるRangeを保持するメンバ変数、`stride_`は歩幅を保持するメンバ変数である。 + + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {0, 1, 2, 3, 4, 5, 6, 7, 8}; + + // デフォルトコンストラクタ + std::ranges::stride_view>> sv1{}; + + // 元となるRangeと歩幅を指定 + std::ranges::stride_view sv2{v, 3}; + + std::println("{}", sv2); +} +``` +* std::ranges::stride_view[color ff0000] +* std::views::all_t[link ../all.md] + +### 出力 +``` +[0, 3, 6] +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 13.2 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 4 [mark verified] + +## 参照 +- [N4950 26.7.32 Stride view](https://timsong-cpp.github.io/cppwp/n4950/range.stride) \ No newline at end of file diff --git a/reference/ranges/stride_view/op_deduction_guide.md b/reference/ranges/stride_view/op_deduction_guide.md new file mode 100644 index 0000000000..8e073b4400 --- /dev/null +++ b/reference/ranges/stride_view/op_deduction_guide.md @@ -0,0 +1,51 @@ +# 推論補助 +* ranges[meta header] +* std::ranges[meta namespace] +* stride_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template + stride_view(R&&, range_difference_t) -> stride_view>; +} +``` + +## 概要 +`stride_view`クラステンプレートの型推論補助。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {0, 1, 2, 3, 4, 5, 6, 7, 8}; + + // stride_viewの型を明示的に指定する必要がない + std::ranges::stride_view sv{v, 3}; + + // 推論された型を確認 + static_assert(std::same_as< + decltype(sv), + std::ranges::stride_view>> + >); +} +``` +* std::ranges::stride_view[color ff0000] +* std::ranges::ref_view[link ../ref_view.md] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 13.2 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 4 [mark verified] diff --git a/reference/ranges/stride_view/size.md b/reference/ranges/stride_view/size.md new file mode 100644 index 0000000000..0533d0d46e --- /dev/null +++ b/reference/ranges/stride_view/size.md @@ -0,0 +1,72 @@ +# size +* ranges[meta header] +* std::ranges[meta namespace] +* stride_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr auto size() + requires sized_range; // (1) C++23 + +constexpr auto size() const + requires sized_range; // (2) C++23 +``` + +## 概要 + +要素数を取得する。 + +## 効果 + +以下と等価: + +```cpp +return to-unsigned-like(div-ceil(ranges::distance(base_), stride_)); +``` +* to-unsigned-like[italic] +* div-ceil[italic] + +ここで、`to-unsigned-like`は説明専用の関数であり、整数型を対応する符号なし整数型に変換する。`div-ceil(x, y)`は`x`を`y`で割った切り上げを計算する説明専用の関数である。 + +## 備考 + +元のRangeの要素数を歩幅で割った切り上げが要素数となる。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {0, 1, 2, 3, 4, 5, 6, 7, 8}; // 9要素 + + // 歩幅3のstride_view + std::ranges::stride_view sv1{v, 3}; + std::cout << "stride_view(9 elements, stride 3): " << sv1.size() << " elements" << std::endl; + + // 歩幅4のstride_view + std::ranges::stride_view sv2{v, 4}; + std::cout << "stride_view(9 elements, stride 4): " << sv2.size() << " elements" << std::endl; +} +``` +* size[color ff0000] + +### 出力 +``` +stride_view(9 elements, stride 3): 3 elements +stride_view(9 elements, stride 4): 3 elements +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 13.2 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 4 [mark verified] + +## 参照 +- [N4950 26.7.32 Stride view](https://timsong-cpp.github.io/cppwp/n4950/range.stride) \ No newline at end of file diff --git a/reference/ranges/stride_view/stride.md b/reference/ranges/stride_view/stride.md new file mode 100644 index 0000000000..ca4b776fbf --- /dev/null +++ b/reference/ranges/stride_view/stride.md @@ -0,0 +1,52 @@ +# stride +* ranges[meta header] +* std::ranges[meta namespace] +* stride_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr range_difference_t stride() const noexcept; // (1) C++23 +``` + +## 概要 + +メンバ変数として保持している、歩幅を取得する。 + +## 効果 + +- (1) : `return stride_;` + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {0, 1, 2, 3, 4, 5, 6, 7, 8}; + + std::ranges::stride_view sv{v, 3}; + + // 歩幅を取得 + std::cout << "stride: " << sv.stride() << std::endl; +} +``` +* stride[color ff0000] + +### 出力 +``` +stride: 3 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 13.2 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 4 [mark verified] + +## 参照 +- [N4950 26.7.32 Stride view](https://timsong-cpp.github.io/cppwp/n4950/range.stride) \ No newline at end of file From 826d291c1187e36c21aba6dabef4931e97beabde Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 4 Jun 2025 13:13:47 +0900 Subject: [PATCH 1858/3948] =?UTF-8?q?zip=5Ftransform=5Fview=20:=20?= =?UTF-8?q?=E3=83=A1=E3=83=B3=E3=83=90=E9=96=A2=E6=95=B0=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/zip_transform_view.md | 30 ++++--- reference/ranges/zip_transform_view/begin.md | 77 +++++++++++++++++ reference/ranges/zip_transform_view/end.md | 86 +++++++++++++++++++ .../zip_transform_view/op_constructor.md | 71 +++++++++++++++ .../zip_transform_view/op_deduction_guide.md | 59 +++++++++++++ reference/ranges/zip_transform_view/size.md | 72 ++++++++++++++++ 6 files changed, 381 insertions(+), 14 deletions(-) create mode 100644 reference/ranges/zip_transform_view/begin.md create mode 100644 reference/ranges/zip_transform_view/end.md create mode 100644 reference/ranges/zip_transform_view/op_constructor.md create mode 100644 reference/ranges/zip_transform_view/op_deduction_guide.md create mode 100644 reference/ranges/zip_transform_view/size.md diff --git a/reference/ranges/zip_transform_view.md b/reference/ranges/zip_transform_view.md index 314dee467b..cad05caf03 100644 --- a/reference/ranges/zip_transform_view.md +++ b/reference/ranges/zip_transform_view.md @@ -51,28 +51,28 @@ zipするRangeのサイズが異なっている場合、`zip_transform_view`の | 名前 | 説明 | 対応バージョン | |--------------------------------------------------|----------------------------------|----------------| -| [`(constructor)`](zip_transform_view/op_constructor.md.nolink) | コンストラクタ | C++23 | -| [`begin`](zip_transform_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++23 | -| [`end`](zip_transform_view/end.md.nolink) | 番兵を取得する | C++23 | -| [`size`](zip_transform_view/size.md.nolink) | 要素数を取得する | C++23 | +| [`(constructor)`](zip_transform_view/op_constructor.md) | コンストラクタ | C++23 | +| [`begin`](zip_transform_view/begin.md) | 先頭を指すイテレータを取得する | C++23 | +| [`end`](zip_transform_view/end.md) | 番兵を取得する | C++23 | +| [`size`](zip_transform_view/size.md) | 要素数を取得する | C++23 | ## 継承しているメンバ関数 | 名前 | 説明 | 対応バージョン | |----------------------------------------------|-----------------------------------|----------------| -| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++20 | -| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++20 | -| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | -| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | +| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++23 | +| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++23 | +| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++23 | +| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++23 | | [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | | [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | -| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | +| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++23 | ## 推論補助 | 名前 | 説明 | 対応バージョン | |-------------------------------------------------------|------------------------------|----------------| -| [`(deduction_guide)`](zip_transform_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | +| [`(deduction_guide)`](zip_transform_view/op_deduction_guide.md) | クラステンプレートの推論補助 | C++23 | ## 例 ```cpp example @@ -85,6 +85,7 @@ int main() { std::vector p = {1, 10, 100, 1000}; std::println("{}", std::views::zip_transform([](auto x, auto y){ return x * y; }, d, p)); + std::println("{}", std::views::zip_transform([](auto x, auto y){ return std::pair{x, y}; }, d, p)); } ``` * std::views::zip_transform[color ff0000] @@ -92,6 +93,7 @@ int main() { ### 出力 ``` [1, 20, 300] +[(1, 1), (2, 10), (3, 100)] ``` ## バージョン @@ -99,10 +101,9 @@ int main() { - C++23 ### 処理系 -- [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? -- [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? +- [Clang](/implementation.md#clang): 19 [mark verified] +- [GCC](/implementation.md#gcc): 13 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 関連項目 - [`transform_view`](transform_view.md) zipする範囲が1つの場合 @@ -110,3 +111,4 @@ int main() { ## 参照 - [N4950 26 Ranges library](https://timsong-cpp.github.io/cppwp/n4950/ranges) +- [P2321R2 zip](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2321r2.html) diff --git a/reference/ranges/zip_transform_view/begin.md b/reference/ranges/zip_transform_view/begin.md new file mode 100644 index 0000000000..9b6a923369 --- /dev/null +++ b/reference/ranges/zip_transform_view/begin.md @@ -0,0 +1,77 @@ +# begin +* ranges[meta header] +* std::ranges[meta namespace] +* zip_transform_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr auto begin(); // (1) C++23 + +constexpr auto begin() const + requires range && + regular_invocable< + const F&, + range_reference_t... + >; // (2) C++23 +``` +* range[link ../range.md] +* regular_invocable[link /reference/concepts/invocable.md] +* range_reference_t[link ../range_reference_t.md] + +## 概要 + +先頭を指すイテレータを取得する。 + +## 効果 + +- (1) : `return iterator(*this, zip_.begin());` +- (2) : `return iterator(*this, zip_.begin());` + +ここで、`iterator`は`zip_transform_view`の内部で定義される説明専用のイテレータクラスであり、`InnerView`は説明専用の[`zip_view`](../zip_view.md)``である。 + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3}; + std::list l = {'a', 'b', 'c'}; + + auto f = [](int n, char c) { return std::pair{n * 10, c}; }; + std::ranges::zip_transform_view ztv(f, v, l); + + auto it = ztv.begin(); + + // 最初の要素(変換結果) + auto [n, c] = *it; + std::cout << n << ", " << c << std::endl; + + // 次の要素へ + ++it; + auto [n2, c2] = *it; + std::cout << n2 << ", " << c2 << std::endl; +} +``` +* begin[color ff0000] + +### 出力 +``` +10, a +20, b +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 19 [mark verified] +- [GCC](/implementation.md#gcc): 13 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] + +## 参照 +- [N4950 26.7.26 Zip transform view](https://timsong-cpp.github.io/cppwp/n4950/range.zip.transform) \ No newline at end of file diff --git a/reference/ranges/zip_transform_view/end.md b/reference/ranges/zip_transform_view/end.md new file mode 100644 index 0000000000..876c0c5594 --- /dev/null +++ b/reference/ranges/zip_transform_view/end.md @@ -0,0 +1,86 @@ +# end +* ranges[meta header] +* std::ranges[meta namespace] +* zip_transform_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr auto end(); // (1) C++23 + +constexpr auto end() const + requires range && + regular_invocable< + const F&, + range_reference_t... + >; // (2) C++23 +``` +* range[link ../range.md] +* regular_invocable[link /reference/concepts/invocable.md] +* range_reference_t[link ../range_reference_t.md] + +## 概要 + +番兵を取得する。 + +## 効果 + +説明専用コンセプト`zip-is-common`を用いて、 + +`zip-is-common`が`false`の場合: + +- (1) : `return sentinel(zip_.end());` +- (2) : `return sentinel(zip_.end());` + +それ以外の場合: + +- (1) : `return iterator(*this, zip_.end());` +- (2) : `return iterator(*this, zip_.end());` + +ここで、`iterator`と`sentinel`は`zip_transform_view`の内部で定義される説明専用のクラスであり、`InnerView`は説明専用の[`zip_view`](../zip_view.md)``である。 + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3}; + std::list l = {'a', 'b', 'c', 'd'}; + + auto f = [](int n, char c) { return std::pair{n * 10, c}; }; + std::ranges::zip_transform_view ztv(f, v, l); + + auto begin = ztv.begin(); + auto end = ztv.end(); + + // 全要素を出力(短い方のRangeのサイズで終わる) + for (auto it = begin; it != end; ++it) { + auto [n, c] = *it; + std::cout << n << ", " << c << std::endl; + } +} +``` +* end[color ff0000] +* begin[link begin.md] + +### 出力 +``` +10, a +20, b +30, c +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 19 [mark verified] +- [GCC](/implementation.md#gcc): 13 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] + +## 参照 +- [N4950 26.7.26 Zip transform view](https://timsong-cpp.github.io/cppwp/n4950/range.zip.transform) \ No newline at end of file diff --git a/reference/ranges/zip_transform_view/op_constructor.md b/reference/ranges/zip_transform_view/op_constructor.md new file mode 100644 index 0000000000..14590deed2 --- /dev/null +++ b/reference/ranges/zip_transform_view/op_constructor.md @@ -0,0 +1,71 @@ +# コンストラクタ +* ranges[meta header] +* std::ranges[meta namespace] +* zip_transform_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +zip_transform_view() = default; // (1) C++23 + +constexpr explicit +zip_transform_view(F fun, Views... views); // (2) C++23 +``` + +## 概要 + +- (1) : デフォルトコンストラクタ +- (2) : 変換関数と各Rangeを受け取るコンストラクタ + +## 効果 + +- (1) : `fun_`と`zip_`をデフォルト構築する +- (2) : `fun_`を`std::move(fun)`で初期化し、`zip_`を`std::move(views)...`で初期化する + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + // (1) デフォルトコンストラクタ + std::ranges::zip_transform_view< + decltype([](int, char) { return 0; }), + std::ranges::empty_view, + std::ranges::empty_view + > ztv1; + + // (2) 変換関数と各Rangeを受け取るコンストラクタ + std::vector v = {1, 2, 3}; + std::list l = {'a', 'b', 'c', 'd'}; + + auto f = [](int n, char c) { return std::pair{n * 10, c}; }; + std::ranges::zip_transform_view ztv2(f, v, l); + + for (auto [n, c] : ztv2) { + std::cout << n << ", " << c << std::endl; + } +} +``` +* std::ranges::zip_transform_view[color ff0000] + +### 出力 +``` +10, a +20, b +30, c +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 19 [mark verified] +- [GCC](/implementation.md#gcc): 13 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] + +## 参照 +- [N4950 26.7.26 Zip transform view](https://timsong-cpp.github.io/cppwp/n4950/range.zip.transform) \ No newline at end of file diff --git a/reference/ranges/zip_transform_view/op_deduction_guide.md b/reference/ranges/zip_transform_view/op_deduction_guide.md new file mode 100644 index 0000000000..37c50f56d8 --- /dev/null +++ b/reference/ranges/zip_transform_view/op_deduction_guide.md @@ -0,0 +1,59 @@ +# 推論補助 +* ranges[meta header] +* std::ranges[meta namespace] +* zip_transform_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template + zip_transform_view(F, Rs&&...) -> + zip_transform_view...>; +} +``` + +## 概要 +`zip_transform_view`クラステンプレートの型推論補助。 + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3}; + std::list l = {'a', 'b', 'c'}; + + auto f = [](int n, char c) { return std::pair{n * 10, c}; }; + + // zip_transform_viewの型を明示的に指定する必要がない + std::ranges::zip_transform_view ztv{f, v, l}; + + // 推論された型を確認 + static_assert(std::same_as< + decltype(ztv), + std::ranges::zip_transform_view< + decltype(f), + std::ranges::ref_view>, + std::ranges::ref_view> + > + >); +} +``` +* std::ranges::zip_transform_view[color ff0000] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 19 [mark verified] +- [GCC](/implementation.md#gcc): 13 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] diff --git a/reference/ranges/zip_transform_view/size.md b/reference/ranges/zip_transform_view/size.md new file mode 100644 index 0000000000..e29dbf6250 --- /dev/null +++ b/reference/ranges/zip_transform_view/size.md @@ -0,0 +1,72 @@ +# size +* ranges[meta header] +* std::ranges[meta namespace] +* zip_transform_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr auto size() + requires sized_range; // (1) C++23 + +constexpr auto size() const + requires sized_range; // (2) C++23 +``` +* sized_range[link ../sized_range.md] + +## 概要 + +要素数を取得する。 + +## 効果 + +- (1) : `return zip_.size();` +- (2) : `return zip_.size();` + +ここで、`InnerView`は説明専用の[`zip_view`](../zip_view.md)``である。 + +## 備考 + +`zip_transform_view`のサイズは、内部で保持する`zip_view`のサイズと同じで、zipする各Rangeのサイズの最小値となる。 + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3}; + std::array a = {'a', 'b', 'c', 'd', 'e'}; + + auto f = [](int n, char c) { return std::pair{n * 10, c}; }; + std::ranges::zip_transform_view ztv(f, v, a); + + // サイズは小さい方のサイズ(3)になる + std::cout << "size: " << ztv.size() << std::endl; + + // const版も動作する + const auto& cztv = ztv; + std::cout << "const size: " << cztv.size() << std::endl; +} +``` +* size[color ff0000] + +### 出力 +``` +size: 3 +const size: 3 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 19 [mark verified] +- [GCC](/implementation.md#gcc): 13 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] + +## 参照 +- [N4950 26.7.26 Zip transform view](https://timsong-cpp.github.io/cppwp/n4950/range.zip.transform) \ No newline at end of file From 8d73664fbb06ca0f9ea0855a61a6242cbfdf7316 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 4 Jun 2025 13:19:08 +0900 Subject: [PATCH 1859/3948] =?UTF-8?q?zip=5Fview=20:=20=E3=83=A1=E3=83=B3?= =?UTF-8?q?=E3=83=90=E9=96=A2=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/zip_view.md | 24 ++--- reference/ranges/zip_view/begin.md | 70 ++++++++++++++ reference/ranges/zip_view/end.md | 94 +++++++++++++++++++ reference/ranges/zip_view/op_constructor.md | 66 +++++++++++++ .../ranges/zip_view/op_deduction_guide.md | 54 +++++++++++ reference/ranges/zip_view/size.md | 80 ++++++++++++++++ 6 files changed, 376 insertions(+), 12 deletions(-) create mode 100644 reference/ranges/zip_view/begin.md create mode 100644 reference/ranges/zip_view/end.md create mode 100644 reference/ranges/zip_view/op_constructor.md create mode 100644 reference/ranges/zip_view/op_deduction_guide.md create mode 100644 reference/ranges/zip_view/size.md diff --git a/reference/ranges/zip_view.md b/reference/ranges/zip_view.md index b55e45a004..74720f2903 100644 --- a/reference/ranges/zip_view.md +++ b/reference/ranges/zip_view.md @@ -65,28 +65,28 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |--------------------------------------------------|----------------------------------|----------------| -| [`(constructor)`](zip_view/op_constructor.md.nolink) | コンストラクタ | C++23 | -| [`begin`](zip_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++23 | -| [`end`](zip_view/end.md.nolink) | 番兵を取得する | C++23 | -| [`size`](zip_view/size.md.nolink) | 要素数を取得する | C++23 | +| [`(constructor)`](zip_view/op_constructor.md) | コンストラクタ | C++23 | +| [`begin`](zip_view/begin.md) | 先頭を指すイテレータを取得する | C++23 | +| [`end`](zip_view/end.md) | 番兵を取得する | C++23 | +| [`size`](zip_view/size.md) | 要素数を取得する | C++23 | ## 継承しているメンバ関数 | 名前 | 説明 | 対応バージョン | |----------------------------------------------|-----------------------------------|----------------| -| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++20 | -| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++20 | -| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | -| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | +| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++23 | +| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++23 | +| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++23 | +| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++23 | | [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | | [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | -| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | +| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++23 | ## 推論補助 | 名前 | 説明 | 対応バージョン | |-------------------------------------------------------|------------------------------|----------------| -| [`(deduction_guide)`](zip_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++23 | +| [`(deduction_guide)`](zip_view/op_deduction_guide.md) | クラステンプレートの推論補助 | C++23 | ## 例 ```cpp example @@ -133,8 +133,7 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): 16.0 [mark verified] - [GCC](/implementation.md#gcc): 13.2 [mark verified] -- [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 5 [mark verified] ## 関連項目 - [`elements_view`](elements_view.md) zipの逆(タプルから要素を取り出す) @@ -142,3 +141,4 @@ int main() { ## 参照 - [N4950 26 Ranges library](https://timsong-cpp.github.io/cppwp/n4950/ranges) +- [P2321R2 zip](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2321r2.html) diff --git a/reference/ranges/zip_view/begin.md b/reference/ranges/zip_view/begin.md new file mode 100644 index 0000000000..18cf2caa4f --- /dev/null +++ b/reference/ranges/zip_view/begin.md @@ -0,0 +1,70 @@ +# begin +* ranges[meta header] +* std::ranges[meta namespace] +* zip_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr auto begin() + requires (!(simple-view && ...)); // (1) C++23 + +constexpr auto begin() const + requires (range && ...); // (2) C++23 +``` + +## 概要 + +先頭を指すイテレータを取得する。 + +## 効果 + +- (1) : `return iterator(tuple-transform(ranges::begin, views_));` +- (2) : `return iterator(tuple-transform(ranges::begin, views_));` + +ここで、`iterator`は`zip_view`の内部で定義される説明専用のイテレータクラスであり、`tuple-transform`は説明専用の関数テンプレートである。 + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3}; + std::list l = {'a', 'b', 'c'}; + + std::ranges::zip_view zv(v, l); + + auto it = zv.begin(); + + // 最初の要素(各Rangeの最初の要素のタプル) + auto [n, c] = *it; + std::cout << n << ", " << c << std::endl; + + // 次の要素へ + ++it; + auto [n2, c2] = *it; + std::cout << n2 << ", " << c2 << std::endl; +} +``` +* begin[color ff0000] + +### 出力 +``` +1, a +2, b +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 13.2 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 5 [mark verified] + +## 参照 +- [N4950 26.7.25 Zip view](https://timsong-cpp.github.io/cppwp/n4950/range.zip) \ No newline at end of file diff --git a/reference/ranges/zip_view/end.md b/reference/ranges/zip_view/end.md new file mode 100644 index 0000000000..307a467f29 --- /dev/null +++ b/reference/ranges/zip_view/end.md @@ -0,0 +1,94 @@ +# end +* ranges[meta header] +* std::ranges[meta namespace] +* zip_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr auto end() + requires (!(simple-view && ...)); // (1) C++23 + +constexpr auto end() const + requires ((range && ...) && + (random_access_range && ...) && + (sized_range && ...)); // (2) C++23 + +constexpr auto end() const + requires (range && ...); // (3) C++23 +``` + +## 概要 + +番兵を取得する。 + +## 効果 + +説明専用コンセプト`zip-is-common`を用いて、 + +- (1) : + - `zip-is-common`が`false`の場合: + - `return sentinel(tuple-transform(ranges::end, views_));` + - `(random_access_range && ...) && (sized_range && ...)`が`true`の場合: + - `return begin() + `[`iter_difference_t`](/reference/iterator/iter_difference_t.md)`>(size());` + - それ以外の場合: + - `return iterator(tuple-transform(ranges::end, views_));` + +- (2) : `return begin() + `[`iter_difference_t`](/reference/iterator/iter_difference_t.md)`>(size());` + +- (3) : +```cpp +if constexpr (!zip-is-common) { + return sentinel(tuple-transform(ranges::end, views_)); +} +else { + return iterator(tuple-transform(ranges::end, views_)); +} +``` + +ここで、`iterator`と`sentinel`は`zip_view`の内部で定義される説明専用のクラスであり、`tuple-transform`は説明専用の関数テンプレートである。 + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3}; + std::list l = {'a', 'b', 'c', 'd'}; + + std::ranges::zip_view zv(v, l); + + auto begin = zv.begin(); + auto end = zv.end(); + + // 全要素を出力(短い方のRangeのサイズで終わる) + for (auto it = begin; it != end; ++it) { + auto [n, c] = *it; + std::cout << n << ", " << c << std::endl; + } +} +``` +* end[color ff0000] +* begin[link begin.md] + +### 出力 +``` +1, a +2, b +3, c +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 13.2 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 5 [mark verified] + +## 参照 +- [N4950 26.7.25 Zip view](https://timsong-cpp.github.io/cppwp/n4950/range.zip) \ No newline at end of file diff --git a/reference/ranges/zip_view/op_constructor.md b/reference/ranges/zip_view/op_constructor.md new file mode 100644 index 0000000000..f1da464774 --- /dev/null +++ b/reference/ranges/zip_view/op_constructor.md @@ -0,0 +1,66 @@ +# コンストラクタ +* ranges[meta header] +* std::ranges[meta namespace] +* zip_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +zip_view() = default; // (1) C++23 + +constexpr explicit +zip_view(Views... views); // (2) C++23 +``` + +## 概要 + +- (1) : デフォルトコンストラクタ +- (2) : zipする各Rangeを受け取るコンストラクタ + +## 効果 + +- (1) : `views_`をデフォルト構築する +- (2) : `views_`を`std::move(views)...`で初期化する + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + // (1) デフォルトコンストラクタ + std::ranges::zip_view, std::ranges::empty_view> zv1; + + // (2) 各Rangeを受け取るコンストラクタ + std::vector v = {1, 2, 3}; + std::list l = {'a', 'b', 'c', 'd'}; + std::ranges::zip_view zv2(v, l); + + for (auto [n, c] : zv2) { + std::cout << n << ", " << c << std::endl; + } +} +``` +* std::ranges::zip_view[color ff0000] +* std::ranges::empty_view[link ../empty_view.md] + +### 出力 +``` +1, a +2, b +3, c +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 13.2 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 5 [mark verified] + +## 参照 +- [N4950 26.7.25 Zip view](https://timsong-cpp.github.io/cppwp/n4950/range.zip) \ No newline at end of file diff --git a/reference/ranges/zip_view/op_deduction_guide.md b/reference/ranges/zip_view/op_deduction_guide.md new file mode 100644 index 0000000000..291698f2b6 --- /dev/null +++ b/reference/ranges/zip_view/op_deduction_guide.md @@ -0,0 +1,54 @@ +# 推論補助 +* ranges[meta header] +* std::ranges[meta namespace] +* zip_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std::ranges { + template + zip_view(Rs&&...) -> zip_view...>; +} +``` + +## 概要 +`zip_view`クラステンプレートの型推論補助。 + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3}; + std::list l = {'a', 'b', 'c'}; + + // zip_viewの型を明示的に指定する必要がない + std::ranges::zip_view zv{v, l}; + + // 推論された型を確認 + static_assert(std::same_as< + decltype(zv), + std::ranges::zip_view< + std::ranges::ref_view>, + std::ranges::ref_view> + > + >); +} +``` + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 13.2 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 5 [mark verified] diff --git a/reference/ranges/zip_view/size.md b/reference/ranges/zip_view/size.md new file mode 100644 index 0000000000..b84f1afeab --- /dev/null +++ b/reference/ranges/zip_view/size.md @@ -0,0 +1,80 @@ +# size +* ranges[meta header] +* std::ranges[meta namespace] +* zip_view[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +constexpr auto size() + requires (sized_range && ...); // (1) C++23 + +constexpr auto size() const + requires (sized_range && ...); // (2) C++23 +``` + +## 概要 + +要素数を取得する。 + +## 効果 + +以下と等価: + +```cpp +return apply( + [](auto... sizes) { + using CT = make-unsigned-like-t>; + return ranges::min({CT(sizes)...}); + }, + tuple-transform(ranges::size, views_)); +``` +* apply[link /reference/tuple/apply.md] +* make-unsigned-like-t[link /reference/type_traits/make_unsigned.md] + +ここで、`tuple-transform`は説明専用の関数テンプレートである。 + +## 備考 + +`zip_view`のサイズは、zipする各Rangeのサイズの最小値となる。 + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3}; + std::array a = {'a', 'b', 'c', 'd', 'e'}; + + std::ranges::zip_view zv(v, a); + + // サイズは小さい方のサイズ(3)になる + std::cout << "size: " << zv.size() << std::endl; + + // const版も動作する + const auto& czv = zv; + std::cout << "const size: " << czv.size() << std::endl; +} +``` +* size[color ff0000] + +### 出力 +``` +size: 3 +const size: 3 +``` + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): 16.0 [mark verified] +- [GCC](/implementation.md#gcc): 13.2 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 5 [mark verified] + +## 参照 +- [N4950 26.7.25 Zip view](https://timsong-cpp.github.io/cppwp/n4950/range.zip) \ No newline at end of file From 58911a306e6be57570293d8d75f5f259326a7d55 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 4 Jun 2025 13:19:18 +0900 Subject: [PATCH 1860/3948] =?UTF-8?q?Range=E9=96=A2=E4=BF=82=E3=81=AE?= =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE=E9=A3=BE=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index be1406bf11..e6c2b2fd66 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -130,6 +130,7 @@ * identity[link /reference/functional/identity.md] * ranges::equal_to[link /reference/functional/ranges_equal_to.md] * std::identity[link /reference/functional/identity.md] + * std::ranges::less_equal[link /reference/functional/ranges_less_equal.md] * [link /reference/future.md] * [link /reference/generator.md] * [link /reference/initializer_list.md] @@ -163,6 +164,7 @@ * projected[link /reference/iterator/projected.md] * projected_value_t[link /reference/iterator/projected_value_t.md] * random_access_iterator[link /reference/iterator/random_access_iterator.md] + * ranges::distance[link /reference/iterator/distance.md] * ranges::iter_move[link /reference/iterator/iter_move.md] * ranges::iter_swap[link /reference/iterator/iter_swap.md] * sentinel_for[link /reference/iterator/sentinel_for.md] @@ -239,6 +241,7 @@ * range_rvalue_reference_t[link /reference/ranges/range_rvalue_reference_t.md] * range_size_t[link /reference/ranges/range_size_t.md] * range_value_t[link /reference/ranges/range_value_t.md] + * range-with-movable-references[link /reference/ranges/range-with-movable-references.md] * range[link /reference/ranges/range.md] * ranges::begin[link /reference/ranges/begin.md] * ranges::end[link /reference/ranges/end.md] @@ -311,19 +314,20 @@ * tuple[link /reference/tuple/tuple.md] * [link /reference/type_traits.md] * common_type_t[link /reference/type_traits/common_type.md] - * std::common_type_t[link /reference/type_traits/common_type.md] * common_reference_t[link /reference/type_traits/common_reference.md] + * decay_t[link /reference/type_traits/decay.md] * invoke_result_t[link /reference/type_traits/invoke_result.md] * is_class_v[link /reference/type_traits/is_class.md] * is_object_v[link /reference/type_traits/is_object.md] * remove_cv_t[link /reference/type_traits/remove_cv.md] * remove_cvref_t[link /reference/type_traits/remove_cvref.md] * remove_reference_t[link /reference/type_traits/remove_reference.md] + * std::common_type_t[link /reference/type_traits/common_type.md] + * std::decay_t[link /reference/type_traits/decay.md] * std::false_type[link /reference/type_traits/false_type.md] * std::is_same_v[link /reference/type_traits/is_same.md] * std::is_same[link /reference/type_traits/is_same.md] * std::true_type[link /reference/type_traits/true_type.md] - * std::decay_t[link /reference/type_traits/decay.md] * [link /reference/typeindex.md] * [link /reference/typeinfo.md] * [link /reference/unordered_map.md] From a4199a45d9a3bb53893b210deae79a32a5e4a1fb Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 4 Jun 2025 13:20:30 +0900 Subject: [PATCH 1861/3948] =?UTF-8?q?empty=5Fview=20:=20enable=5Fborrowed?= =?UTF-8?q?=5Frange=E3=82=92=E8=BF=BD=E5=8A=A0=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/empty_view.md | 2 +- .../empty_view/enable_borrowed_range.md | 56 +++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 reference/ranges/empty_view/enable_borrowed_range.md diff --git a/reference/ranges/empty_view.md b/reference/ranges/empty_view.md index 00d8cc5090..72e702eb47 100644 --- a/reference/ranges/empty_view.md +++ b/reference/ranges/empty_view.md @@ -58,7 +58,7 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |-------------------------------------------------------|------------------------------|----------------| -| [`enable_borrowed_range`](empty_view/enable_borrowed_range.md.nolink) | `enable_borrowed_range`の特殊化 (variable template) | C++20 | +| [`enable_borrowed_range`](empty_view/enable_borrowed_range.md) | `enable_borrowed_range`の特殊化 (variable template) | C++20 | ## 例 ```cpp example diff --git a/reference/ranges/empty_view/enable_borrowed_range.md b/reference/ranges/empty_view/enable_borrowed_range.md new file mode 100644 index 0000000000..e8dd4a5beb --- /dev/null +++ b/reference/ranges/empty_view/enable_borrowed_range.md @@ -0,0 +1,56 @@ +# enable_borrowed_range +* ranges[meta header] +* std::ranges[meta namespace] +* empty_view[meta class] +* variable template[meta id-type] +* cpp20[meta cpp] + +```cpp +namespace std::ranges { + template + inline constexpr bool enable_borrowed_range> = true; +} +``` + +## 概要 + +`empty_view`に対する[`enable_borrowed_range`](../enable_borrowed_range.md)の特殊化。 + +`empty_view`は常に空であり、要素への参照を返すことがないため、安全に借用可能である。 + +## 備考 + +この特殊化により、`empty_view`は[`borrowed_range`](../borrowed_range.md)コンセプトを満たすようになる。 + +## 例 +```cpp example +#include +#include + +int main() { + // empty_viewはborrowed_rangeである + static_assert(std::ranges::borrowed_range>); + + // enable_borrowed_rangeがtrueに設定されている + static_assert(std::ranges::enable_borrowed_range>); +} +``` +* std::ranges::borrowed_range[link ../borrowed_range.md] +* std::ranges::enable_borrowed_range[link ../enable_borrowed_range.md] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 13.0.0 [mark verified] +- [GCC](/implementation.md#gcc): 10.1.0 [mark verified] +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [N4861 24.7.8 Empty view](https://timsong-cpp.github.io/cppwp/n4861/range.empty) \ No newline at end of file From 76e1dab54abf495ef12d5bbbfa4ce8e8647411af Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 4 Jun 2025 13:28:29 +0900 Subject: [PATCH 1862/3948] =?UTF-8?q?as=5Frvalue=5Fview,=20slide=5Fview=20?= =?UTF-8?q?:=20C++23=E3=81=AA=E3=81=AE=E3=81=AB=E7=B6=99=E6=89=BF=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=90=E3=83=BC=E3=81=8CC++20=E3=81=AB=E3=81=AA?= =?UTF-8?q?=E3=81=A3=E3=81=A6=E3=81=84=E3=81=9F=E3=81=AE=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20#713?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/as_rvalue_view.md | 12 ++++++------ reference/ranges/slide_view.md | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/reference/ranges/as_rvalue_view.md b/reference/ranges/as_rvalue_view.md index 70c3f3adda..1be96bc0d1 100644 --- a/reference/ranges/as_rvalue_view.md +++ b/reference/ranges/as_rvalue_view.md @@ -69,12 +69,12 @@ std::ranges::copy(words | views::as_rvalue, std::back_inserter(new_words)); | 名前 | 説明 | 対応バージョン | |----------------------------------------------|-----------------------------------|----------------| -| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++23 | -| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++23 | -| [`data`](view_interface/data.md) | Rangeの先頭へのポインタを取得する | C++23 | -| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++23 | -| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++23 | -| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++23 | +| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++20 | +| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++20 | +| [`data`](view_interface/data.md) | Rangeの先頭へのポインタを取得する | C++20 | +| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | +| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | +| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | | [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | | [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | diff --git a/reference/ranges/slide_view.md b/reference/ranges/slide_view.md index 7f48717348..671e63e6d1 100644 --- a/reference/ranges/slide_view.md +++ b/reference/ranges/slide_view.md @@ -65,13 +65,13 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |----------------------------------------------|-----------------------------------|----------------| -| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++23 | -| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++23 | -| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++23 | -| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++23 | +| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++20 | +| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++20 | +| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | +| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | | [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | | [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | -| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++23 | +| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | ## 推論補助 From 97e2c6feab74731eff5186a6d1687da65ff26746 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 4 Jun 2025 13:33:51 +0900 Subject: [PATCH 1863/3948] slide_view : revert --- reference/ranges/slide_view.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/reference/ranges/slide_view.md b/reference/ranges/slide_view.md index 671e63e6d1..7f48717348 100644 --- a/reference/ranges/slide_view.md +++ b/reference/ranges/slide_view.md @@ -65,13 +65,13 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |----------------------------------------------|-----------------------------------|----------------| -| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++20 | -| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++20 | -| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++20 | -| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++20 | +| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++23 | +| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++23 | +| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++23 | +| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++23 | | [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++23 | | [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++23 | -| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++20 | +| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++23 | ## 推論補助 From 0405eaf3bb709581f987423a40af95384d7fd5b1 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 4 Jun 2025 13:48:23 +0900 Subject: [PATCH 1864/3948] =?UTF-8?q?empty=5Fview::enable=5Fborrowed=5Fran?= =?UTF-8?q?ge=20:=20meta=20id=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/empty_view/enable_borrowed_range.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/ranges/empty_view/enable_borrowed_range.md b/reference/ranges/empty_view/enable_borrowed_range.md index e8dd4a5beb..eff21b2790 100644 --- a/reference/ranges/empty_view/enable_borrowed_range.md +++ b/reference/ranges/empty_view/enable_borrowed_range.md @@ -2,7 +2,7 @@ * ranges[meta header] * std::ranges[meta namespace] * empty_view[meta class] -* variable template[meta id-type] +* variable[meta id-type] * cpp20[meta cpp] ```cpp From 3aa3df84dafc10d7c0cdaf55ae0bbb82296bb4f9 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 4 Jun 2025 14:08:03 +0900 Subject: [PATCH 1865/3948] =?UTF-8?q?uses=5Fallocator=5Fconstruction=5Farg?= =?UTF-8?q?s=20:=20C++23=E5=AF=BE=E5=BF=9C=20#1063?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../uses_allocator_construction_args.md | 132 ++++++++++++++---- 1 file changed, 107 insertions(+), 25 deletions(-) diff --git a/reference/memory/uses_allocator_construction_args.md b/reference/memory/uses_allocator_construction_args.md index 133a4af454..1efdcafdc1 100644 --- a/reference/memory/uses_allocator_construction_args.md +++ b/reference/memory/uses_allocator_construction_args.md @@ -5,29 +5,73 @@ * cpp20[meta cpp] ```cpp -template - auto uses_allocator_construction_args(const Alloc& alloc, Args&&... args) -> see below; // (1) - -template - auto uses_allocator_construction_args(const Alloc& alloc, piecewise_construct_t, - Tuple1&& x, Tuple2&& y) -> see below; // (2) - -template - auto uses_allocator_construction_args(const Alloc& alloc) -> see below; // (3) - -template - auto uses_allocator_construction_args(const Alloc& alloc, U&& u, V&& v) -> see below; // (4) - -template - auto uses_allocator_construction_args(const Alloc& alloc, const pair& pr) -> see below; // (5) - -template - auto uses_allocator_construction_args(const Alloc& alloc, pair&& pr) -> see below; // (6) +template +constexpr auto + uses_allocator_construction_args( + const Alloc& alloc, + Args&&... args) -> see below; // (1) C++20 + +template +constexpr auto + uses_allocator_construction_args( + const Alloc& alloc, + piecewise_construct_t, + Tuple1&& x, + Tuple2&& y) -> see below; // (2) C++20 + +template +constexpr auto + uses_allocator_construction_args( + const Alloc& alloc) -> see below; // (3) C++20 + +template +constexpr auto + uses_allocator_construction_args( + const Alloc& alloc, + U&& u, + V&& v) -> see below; // (4) C++20 + +template +constexpr auto + uses_allocator_construction_args( + const Alloc& alloc, + pair& pr) noexcept; // (5) C++23 + +template +constexpr auto + uses_allocator_construction_args( + const Alloc& alloc, + const pair& pr) -> see below; // (6) C++20 + +template +constexpr auto + uses_allocator_construction_args( + const Alloc& alloc, + pair&& pr) -> see below; // (7) C++20 + +template +constexpr auto + uses_allocator_construction_args( + const Alloc& alloc, + const pair&& pr) noexcept; // (8) C++23 + +template +constexpr auto + uses_allocator_construction_args( + const Alloc& alloc, + P&& p) noexcept; // (9) C++23 + +template +constexpr auto + uses_allocator_construction_args( + const Alloc& alloc, + U&& u) noexcept; // (10) C++23 ``` * see below[italic] ## 概要 `Alloc` 型のアロケータオブジェクト `alloc` を使用した `T` 型オブジェクトの uses-allocator 構築のために必要なコンストラクタ引数を、[`tuple`](../tuple/tuple.md) 型にして返す。 + また、`T` が [`pair`](../utility/pair.md) だった場合は、それぞれの要素に対して uses-allocator 構築するために必要なコンストラクタ引数を、[`tuple`](../tuple/tuple.md) 型にして返す。 構築対象の型 `T` は関数引数からは推論できないため、明示的に指定する必要がある。 @@ -35,11 +79,15 @@ template ## テンプレートパラメータ制約 - (1) : `T` が [`pair`](../utility/pair.md) の特殊化**ではない**場合のみオーバーロード解決に参加する -- (2)-(6) : `T` が [`pair`](../utility/pair.md) の特殊化**である**場合のみオーバーロード解決に参加する +- (2)-(10) : `T` が [`pair`](../utility/pair.md) の特殊化**である**場合のみオーバーロード解決に参加する +- (9) : `P`が[`std::ranges::subrange`](/reference/ranges/subrange.md)の特殊化である場合のみオーバーロード解決に参加する +- (10) : 以下のいずれかを満たす場合のみオーバーロード解決に参加する + - `P`が[`std::ranges::subrange`](/reference/ranges/subrange.md)の特殊化であること。もしくは + - `U`が`pair-like`の要件を満たさず、関数`template void FUN (const pair&);`に`FUN(u)`した場合に適格ではないこと ## 戻り値 -- (1) : 以下のいずれかと同等 +- (1) : 以下のいずれかと等価 - もし [`uses_allocator_v`](uses_allocator.md)`` が `false` で、かつ、[`is_constructible_v`](../type_traits/is_constructible.md)`` が `true` の場合、 ```cpp @@ -69,7 +117,7 @@ forward_as_tuple(std::forward(args)..., alloc) - 上記以外の場合、不適格となる。 -- (2) : `T` を [`pair`](../utility/pair.md)`` とすると、以下と同等 +- (2) : `T` を [`pair`](../utility/pair.md)`` とすると、以下と等価 ```cpp make_tuple( @@ -89,7 +137,7 @@ make_tuple( * apply[link ../tuple/apply.md] * make_tuple[link ../tuple/make_tuple.md] -- (3) : 以下と同等 +- (3) : 以下と等価 ```cpp uses_allocator_construction_args(alloc, piecewise_construct, @@ -99,7 +147,7 @@ uses_allocator_construction_args(alloc, piecewise_construct, * tuple[link ../tuple/tuple/op_constructor.md] * uses_allocator_construction_args[color ff0000] -- (4) : 以下と同等 +- (4) : 以下と等価 ```cpp uses_allocator_construction_args(alloc, piecewise_construct, @@ -111,7 +159,7 @@ uses_allocator_construction_args(alloc, piecewise_construct, * forward[link ../utility/forward.md] * uses_allocator_construction_args[color ff0000] -- (5) : 以下と同等 +- (5), (6) : 以下と等価 ```cpp uses_allocator_construction_args(alloc, piecewise_construct, @@ -122,7 +170,7 @@ uses_allocator_construction_args(alloc, piecewise_construct, * forward_as_tuple[link ../tuple/forward_as_tuple.md] * uses_allocator_construction_args[color ff0000] -- (6) : 以下と同等 +- (7), (8) : 以下と等価 ```cpp uses_allocator_construction_args(alloc, piecewise_construct, @@ -134,6 +182,39 @@ uses_allocator_construction_args(alloc, piecewise_construct, * move[link ../utility/move.md] * uses_allocator_construction_args[color ff0000] +- (9) : 以下と等価 + + ```cpp +return uses_allocator_construction_args(alloc, piecewise_construct, + forward_as_tuple(get<0>(std::forward

(p))), + forward_as_tuple(get<1>(std::forward

(p)))); +``` +* piecewise_construct[link ../utility/piecewise_construct_t.md] +* forward_as_tuple[link ../tuple/forward_as_tuple.md] + +- (10) : 以下の説明用クラスを定義し、 + ```cpp + class pair-constructor { + using pair-type = remove_cv_t; + constexpr auto do-construct(const pair-type& p) const { + return make_obj_using_allocator(alloc_, p); + } + + constexpr auto do-construct(pair-type&& p) const { + return make_obj_using_allocator(alloc_, std::move(p)); + } + + const Alloc& alloc_; + U& u_; + public: + constexpr operator pair-type() const { + return do-construct(std::forward(u_)); + } + }; + ``` + + - `u`で`u_`、`alloc`で`alloc_`初期化した`pair-constructor`オブジェクト`pc`を生成し、`make_tuple(pc)`を返す + ## 備考 - 本関数は、uses-allocator 構築をサポートするために C++20 で導入された。 @@ -248,3 +329,4 @@ tuple(piecewise_construct_t, tuple(allocator_arg_t, MyAlloc, 3, ), tuple(4, MyAl ## 参照 - [P0591R4 Utility functions to implement uses-allocator construction](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0591r4.pdf) +- [P2321R2 zip](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2321r2.html) From 0923d23a602778d490aee9e26aff6b690ae5723a Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 4 Jun 2025 18:35:54 +0900 Subject: [PATCH 1866/3948] =?UTF-8?q?as=5Fconst=5Fview=20:=20=E4=BE=8B?= =?UTF-8?q?=E3=81=AE=E3=82=A4=E3=83=B3=E3=82=AF=E3=83=AB=E3=83=BC=E3=83=89?= =?UTF-8?q?=E4=B8=8D=E8=B6=B3=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/as_const_view.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/ranges/as_const_view.md b/reference/ranges/as_const_view.md index 53d93ab596..68310616e9 100644 --- a/reference/ranges/as_const_view.md +++ b/reference/ranges/as_const_view.md @@ -73,6 +73,7 @@ namespace std::ranges { ```cpp example #include #include +#include int main() { std::vector vec = {1, 2, 3, 4}; From 5bd194c53fad0e797b9c787ce83eac4c4ce5a05c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 4 Jun 2025 19:07:53 +0900 Subject: [PATCH 1867/3948] =?UTF-8?q?ranges=20:=20to=5Finput=5Fview?= =?UTF-8?q?=E3=81=AE=E3=82=AF=E3=83=A9=E3=82=B9=E3=83=9A=E3=83=BC=E3=82=B8?= =?UTF-8?q?=E3=82=92=E4=BD=9C=E6=88=90=20#1423?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 2 +- reference/ranges.md | 8 ++ reference/ranges/to_input_view.md | 143 ++++++++++++++++++++++++++++++ 3 files changed, 152 insertions(+), 1 deletion(-) create mode 100644 reference/ranges/to_input_view.md diff --git a/lang/cpp26.md b/lang/cpp26.md index 80da59c2a6..a4eed40cf6 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -167,7 +167,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [`std::span`](/reference/span/span.md)と[`std::mdspan`](/reference/mdspan/mdspan.md)の推論補助を改善 - [`std::views::concat`](/reference/ranges/concat_view.md)を追加 - [`std::views::cache_latest`](/reference/ranges/cache_latest.md.nolink)を追加 -- [`std::views::to_input`](/reference/ranges/to_input_view.md.nolink)を追加。書き換えできない入力専用の値に変換する +- [`std::views::to_input`](/reference/ranges/to_input_view.md)を追加。これはパフォーマンス向上のために、Rangeを入力Rangeかつ非[`common_range`](/reference/ranges/common_range.md) (イテレータと番兵の型を別する) に変換する - Range関係の、償却定数時間での要素追加を行う機能を追加 - 各viewクラスに`reserve_hint()`メンバ関数を追加 - [`std::ranges::reserve_hint()`](/reference/ranges/reserve_hint.md.nolink)関数を追加 diff --git a/reference/ranges.md b/reference/ranges.md index 5a824b4bf6..6956f1b61c 100644 --- a/reference/ranges.md +++ b/reference/ranges.md @@ -427,6 +427,14 @@ range | adaptor(args...) | [`views::cartesian_product`](ranges/cartesian_product_view.md) | `cartesian_product_view`を生成する (customization point object) | C++23 | +### to input view + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`to_input_view`](ranges/to_input_view.md) | 入力用Rangeに変換する (class template) | C++26 | +| [`views::to_input`](ranges/to_input_view.md) | `to_input_view`を生成する (customization point object) | C++26 | + + ## Range変換 | 名前 | 説明 | 対応バージョン | diff --git a/reference/ranges/to_input_view.md b/reference/ranges/to_input_view.md new file mode 100644 index 0000000000..b06359d0fd --- /dev/null +++ b/reference/ranges/to_input_view.md @@ -0,0 +1,143 @@ +# to_input_view +* ranges[meta header] +* std::ranges[meta namespace] +* class template[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std::ranges { + template + requires view + class to_input_view : public view_interface> { …… }; // (1) + + namespace views { + inline constexpr /*unspecified*/ to_input = /*unspecified*/; // (2) + } +} +``` +* view[link view.md] +* view_interface[link view_interface.md] + +## 概要 +- (1): [`input_range`](/reference/ranges/input_range.md)として振る舞う[`view`](view.md) +- (2): `to_input_view`を生成するRangeアダプタオブジェクト + +この`view`は、Rangeを`input_range`に変換し、非[`common_range`](common_range.md)にする (イテレータと番兵の型を別にする)。 + +この`view`は、パフォーマンス向上のために使用する。以下に例示する: + +- [`views::join`](join_view.md)`(r)`は、`r`が[`common_range`](common_range.md) (イテレータと番兵の型が同じRange) である場合、イテレータと番兵の比較のために外側と内側の2種類のイテレータを順番に比較することになり比較コストが高くなる。`to_input`を使用することで、番兵との比較が一回で済むためにイテレータの比較コストが小さくなり、パフォーマンス向上が見込める +- [`views::chunk`](chunk_view.md)の場合、`r | views::chunk(n)`は`r`が[`forward_range`](forward_range.md)以上である場合に各要素が[`views::take`](take_view.md)`(n)`となり、各要素を2回ずつイテレートすることになる。[`input_range`](input_range.md)に変換することで、各要素を1回ずつイテレートすることになり、パフォーマンス向上が見込める + + +### Rangeコンセプト + +| borrowed | sized | output | input | forward | bidirectional | random_access | contiguous | common | viewable | view | +|:--------:|:-----:|:------:|:-----:|:-------:|:-------------:|:-------------:|:----------:|:------:|:--------:|:----:| +| ※ | ※ | | ○ | | | | ※ | | ○ | ○ | + +- ※: `V`に従う + +## 効果 + +- (2): 式`views::to_input(E)`の効果は次のいずれか(`T = decltype((E))`、`U = remove_cvref_t`とする) + - `T`が[`input_range`](input_range.md)のモデルであり、[`common_range`](common_range.md)を満たさず、[`forward_range`](forward_range.md)も満たさない場合 : `views::all(E)` + - それ以外の場合 : `to_input_view(E)` + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|--------------------------------------------------|----------------------------------|----------------| +| [`(constructor)`](to_input_view/op_constructor.md.nolink) | コンストラクタ | C++26 | +| [`base`](to_input_view/base.md.nolink) | `V`の参照を取得する | C++26 | +| [`begin`](to_input_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++26 | +| [`end`](to_input_view/end.md.nolink) | 番兵を取得する | C++26 | +| [`size`](to_input_view/size.md.nolink) | 要素数を取得する | C++26 | + +## 継承しているメンバ関数 + +| 名前 | 説明 | 対応バージョン | +|----------------------------------------------|-----------------------------------|----------------| +| [`empty`](view_interface/empty.md) | Rangeが空かどうかを判定する | C++26 | +| [`operator bool`](view_interface/op_bool.md) | Rangeが空でないかどうかを判定する | C++26 | +| [`front`](view_interface/front.md) | 先頭要素への参照を取得する | C++26 | +| [`back`](view_interface/back.md) | 末尾要素への参照を取得する | C++26 | +| [`operator[]`](view_interface/op_at.md) | 要素へアクセスする | C++26 | +| [`cbegin`](view_interface/cbegin.md) | 定数イテレータを取得する | C++26 | +| [`cend`](view_interface/cend.md) | 定数イテレータ(番兵)を取得する | C++26 | + +## 推論補助 + +| 名前 | 説明 | 対応バージョン | +|-------------------------------------------------------|------------------------------|----------------| +| [`(deduction_guide)`](to_input_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++26 | + +## 例 +### 基本的な使い方 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4}; + + for (auto i : v | std::views::to_input) { + std::cout << i << ' '; + } +} +``` +* views::to_input[color ff0000] + +#### 出力 +``` +1 2 3 4 +``` + +### viewをパフォーマンス向上させる +```cpp example +#include +#include +#include + +int main() { + std::vector> v1 = {{1, 2}, {3, 4}}; + + // `v1 | std::views::join`と比較して、イテレータと番兵の比較コストが低くなり、 + // パフォーマンスが向上する + for (auto i : v1 | std::views::to_input | std::views::join) { + std::cout << i << ' '; + } + + // `v2 | std::views::chunk(3)`と比較して、各要素が1回ずつイテレートで済むため、 + // パフォーマンスが向上する + std::vector v2 = {1, 2, 3, 4, 5, 6}; + for (const auto& v : v2 | std::views::to_input | std::views::chunk(3)) { + for (const auto& i : v) { + std::cout << i << ' '; + } + std::cout << std::endl; + } +} +``` +* views::to_input[color ff0000] +* std::views::join[link join_view.md] +* std::views::chunk[link chunk_view.md] + +#### 出力 +``` +1 2 3 4 1 2 3 +4 5 6 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark verified] +- [GCC](/implementation.md#gcc): 15.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] + +## 参照 +- [P3137R3 `views::to_input`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3137r3.html) From 2f6270fdf097c8b560b45410b776b2ffd03d17e0 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 4 Jun 2025 19:22:34 +0900 Subject: [PATCH 1868/3948] =?UTF-8?q?to=5Finput=5Fview=20:=20=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=90=E9=96=A2=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20#1423?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/to_input_view.md | 12 ++-- reference/ranges/to_input_view/base.md | 58 ++++++++++++++++ reference/ranges/to_input_view/begin.md | 57 ++++++++++++++++ reference/ranges/to_input_view/end.md | 66 +++++++++++++++++++ .../ranges/to_input_view/op_constructor.md | 53 +++++++++++++++ .../to_input_view/op_deduction_guide.md | 48 ++++++++++++++ reference/ranges/to_input_view/size.md | 54 +++++++++++++++ 7 files changed, 342 insertions(+), 6 deletions(-) create mode 100644 reference/ranges/to_input_view/base.md create mode 100644 reference/ranges/to_input_view/begin.md create mode 100644 reference/ranges/to_input_view/end.md create mode 100644 reference/ranges/to_input_view/op_constructor.md create mode 100644 reference/ranges/to_input_view/op_deduction_guide.md create mode 100644 reference/ranges/to_input_view/size.md diff --git a/reference/ranges/to_input_view.md b/reference/ranges/to_input_view.md index b06359d0fd..88459150b1 100644 --- a/reference/ranges/to_input_view.md +++ b/reference/ranges/to_input_view.md @@ -48,11 +48,11 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |--------------------------------------------------|----------------------------------|----------------| -| [`(constructor)`](to_input_view/op_constructor.md.nolink) | コンストラクタ | C++26 | -| [`base`](to_input_view/base.md.nolink) | `V`の参照を取得する | C++26 | -| [`begin`](to_input_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++26 | -| [`end`](to_input_view/end.md.nolink) | 番兵を取得する | C++26 | -| [`size`](to_input_view/size.md.nolink) | 要素数を取得する | C++26 | +| [`(constructor)`](to_input_view/op_constructor.md) | コンストラクタ | C++26 | +| [`base`](to_input_view/base.md) | `V`の参照を取得する | C++26 | +| [`begin`](to_input_view/begin.md) | 先頭を指すイテレータを取得する | C++26 | +| [`end`](to_input_view/end.md) | 番兵を取得する | C++26 | +| [`size`](to_input_view/size.md) | 要素数を取得する | C++26 | ## 継承しているメンバ関数 @@ -70,7 +70,7 @@ namespace std::ranges { | 名前 | 説明 | 対応バージョン | |-------------------------------------------------------|------------------------------|----------------| -| [`(deduction_guide)`](to_input_view/op_deduction_guide.md.nolink) | クラステンプレートの推論補助 | C++26 | +| [`(deduction_guide)`](to_input_view/op_deduction_guide.md) | クラステンプレートの推論補助 | C++26 | ## 例 ### 基本的な使い方 diff --git a/reference/ranges/to_input_view/base.md b/reference/ranges/to_input_view/base.md new file mode 100644 index 0000000000..7571f2a49c --- /dev/null +++ b/reference/ranges/to_input_view/base.md @@ -0,0 +1,58 @@ +# base +* to_input_view[meta header] +* std::ranges[meta namespace] +* to_input_view[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr V base() const& + requires copy_constructible; // (1) C++26 + +constexpr V base() &&; // (2) C++26 +``` + +## 概要 +メンバ変数として保持している、元のRangeを取得する。 + +## 効果 +- (1): `return base_;` +- (2): `return std::move(base_);` + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3, 4, 5}; + + std::ranges::to_input_view view{vec}; + + // (1) コピーして取得 + std::vector v1 = view.base(); + + // (2) ムーブして取得 + std::ranges::to_input_view view2{vec}; + std::vector v2 = std::move(view2).base(); + + std::cout << v1.size() << std::endl; + std::cout << v2.size() << std::endl; +} +``` + +### 出力 +``` +5 +5 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark verified] +- [GCC](/implementation.md#gcc): 15.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] \ No newline at end of file diff --git a/reference/ranges/to_input_view/begin.md b/reference/ranges/to_input_view/begin.md new file mode 100644 index 0000000000..14db28ac06 --- /dev/null +++ b/reference/ranges/to_input_view/begin.md @@ -0,0 +1,57 @@ +# begin +* to_input_view[meta header] +* std::ranges[meta namespace] +* to_input_view[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr auto begin() + requires (!simple-view); // (1) C++26 + +constexpr auto begin() const + requires range; // (2) C++26 +``` + +## 概要 +先頭を指すイテレータを取得する。 + +## 効果 +- (1): `return iterator(ranges::begin(base_));` +- (2): `return iterator(ranges::begin(base_));` + +ここで、`iterator`は`to_input_view`の内部で定義される説明専用のイテレータクラスである。 + +## 備考 +- このイテレータは`input_iterator`コンセプトを満たし、`forward_iterator`コンセプトを満たさない。 + + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5}; + + std::ranges::to_input_view view{v}; + + auto it = view.begin(); + std::cout << *it << std::endl; +} +``` + +### 出力 +``` +1 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark verified] +- [GCC](/implementation.md#gcc): 15.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] \ No newline at end of file diff --git a/reference/ranges/to_input_view/end.md b/reference/ranges/to_input_view/end.md new file mode 100644 index 0000000000..0e7245afb7 --- /dev/null +++ b/reference/ranges/to_input_view/end.md @@ -0,0 +1,66 @@ +# end +* to_input_view[meta header] +* std::ranges[meta namespace] +* to_input_view[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr auto end() + requires (!simple-view); // (1) C++26 + +constexpr auto end() const + requires range; // (2) C++26 +``` + +## 概要 +番兵を取得する。 + +## 効果 +以下と等価: + +```cpp +return ranges::end(base_); +``` + +## 備考 +- `to_input_view`は[`common_range`](/reference/ranges/common_range.md)コンセプトを満たさないため、イテレータ型と番兵型は異なる型となる + + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5}; + + std::ranges::to_input_view view{v}; + + auto it = view.begin(); + auto sentinel = view.end(); + static_assert(!std::same_as); + + int count = 0; + for (; it != sentinel; ++it) { + ++count; + } + + std::cout << "size: " << count << std::endl; +} +``` + +### 出力 +``` +size: 5 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark verified] +- [GCC](/implementation.md#gcc): 15.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] \ No newline at end of file diff --git a/reference/ranges/to_input_view/op_constructor.md b/reference/ranges/to_input_view/op_constructor.md new file mode 100644 index 0000000000..79534fdaaf --- /dev/null +++ b/reference/ranges/to_input_view/op_constructor.md @@ -0,0 +1,53 @@ +# コンストラクタ +* to_input_view[meta header] +* std::ranges[meta namespace] +* to_input_view[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +to_input_view() + requires default_initializable = default; // (1) C++26 + +constexpr explicit +to_input_view(V base); // (2) C++26 +``` + +## 概要 +`to_input_view`オブジェクトを構築する。 + +- (1): デフォルトコンストラクタ +- (2): ベースとなるRangeを受け取るコンストラクタ + +## 効果 +- (1): ベースとなるRangeをデフォルト構築する +- (2): ベースとなるRangeを`std::move(base)`で初期化する + +## 例 +```cpp example +#include +#include + +int main() { + std::vector v = {1, 2, 3}; + + // (1) デフォルトコンストラクタ + std::ranges::to_input_view&>> view1{}; + + // (2) ベースRangeを受け取るコンストラクタ + std::ranges::to_input_view view2{v}; +} +``` + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark verified] +- [GCC](/implementation.md#gcc): 15.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] \ No newline at end of file diff --git a/reference/ranges/to_input_view/op_deduction_guide.md b/reference/ranges/to_input_view/op_deduction_guide.md new file mode 100644 index 0000000000..4ade4bf5b5 --- /dev/null +++ b/reference/ranges/to_input_view/op_deduction_guide.md @@ -0,0 +1,48 @@ +# 推論補助 +* to_input_view[meta header] +* std::ranges[meta namespace] +* to_input_view[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std::ranges { + template + to_input_view(V) -> to_input_view>; +} +``` + +## 概要 +`to_input_view`クラステンプレートの型推論補助。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3}; + + // 推論補助によりテンプレート引数を明示的に指定する必要がない + std::ranges::to_input_view view{v}; + + static_assert(std::same_as< + decltype(view), + std::ranges::to_input_view>> + >); +} +``` + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark verified] +- [GCC](/implementation.md#gcc): 15.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] \ No newline at end of file diff --git a/reference/ranges/to_input_view/size.md b/reference/ranges/to_input_view/size.md new file mode 100644 index 0000000000..79fb4ac0df --- /dev/null +++ b/reference/ranges/to_input_view/size.md @@ -0,0 +1,54 @@ +# size +* to_input_view[meta header] +* std::ranges[meta namespace] +* to_input_view[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr auto size() + requires sized_range; // (1) C++26 + +constexpr auto size() const + requires sized_range; // (2) C++26 +``` + +## 概要 +要素数を取得する。 + +## 効果 +- (1), (2): 以下と等価: + +```cpp +return ranges::size(base_); +``` + + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5}; + + std::ranges::to_input_view view{v}; + + std::cout << view.size() << std::endl; +} +``` + +### 出力 +``` +5 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark verified] +- [GCC](/implementation.md#gcc): 15.1 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] \ No newline at end of file From 197166c65d7647ce67a63c4f91d6522d5c0113eb Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 4 Jun 2025 19:24:51 +0900 Subject: [PATCH 1869/3948] =?UTF-8?q?meta=20header=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/to_input_view/base.md | 2 +- reference/ranges/to_input_view/begin.md | 2 +- reference/ranges/to_input_view/end.md | 2 +- reference/ranges/to_input_view/op_constructor.md | 2 +- reference/ranges/to_input_view/op_deduction_guide.md | 2 +- reference/ranges/to_input_view/size.md | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/reference/ranges/to_input_view/base.md b/reference/ranges/to_input_view/base.md index 7571f2a49c..b7073445d7 100644 --- a/reference/ranges/to_input_view/base.md +++ b/reference/ranges/to_input_view/base.md @@ -1,5 +1,5 @@ # base -* to_input_view[meta header] +* ranges[meta header] * std::ranges[meta namespace] * to_input_view[meta class] * function[meta id-type] diff --git a/reference/ranges/to_input_view/begin.md b/reference/ranges/to_input_view/begin.md index 14db28ac06..d6236644fc 100644 --- a/reference/ranges/to_input_view/begin.md +++ b/reference/ranges/to_input_view/begin.md @@ -1,5 +1,5 @@ # begin -* to_input_view[meta header] +* ranges[meta header] * std::ranges[meta namespace] * to_input_view[meta class] * function[meta id-type] diff --git a/reference/ranges/to_input_view/end.md b/reference/ranges/to_input_view/end.md index 0e7245afb7..1fc532852c 100644 --- a/reference/ranges/to_input_view/end.md +++ b/reference/ranges/to_input_view/end.md @@ -1,5 +1,5 @@ # end -* to_input_view[meta header] +* ranges[meta header] * std::ranges[meta namespace] * to_input_view[meta class] * function[meta id-type] diff --git a/reference/ranges/to_input_view/op_constructor.md b/reference/ranges/to_input_view/op_constructor.md index 79534fdaaf..a6b41061a8 100644 --- a/reference/ranges/to_input_view/op_constructor.md +++ b/reference/ranges/to_input_view/op_constructor.md @@ -1,5 +1,5 @@ # コンストラクタ -* to_input_view[meta header] +* ranges[meta header] * std::ranges[meta namespace] * to_input_view[meta class] * function[meta id-type] diff --git a/reference/ranges/to_input_view/op_deduction_guide.md b/reference/ranges/to_input_view/op_deduction_guide.md index 4ade4bf5b5..68f1b925b5 100644 --- a/reference/ranges/to_input_view/op_deduction_guide.md +++ b/reference/ranges/to_input_view/op_deduction_guide.md @@ -1,5 +1,5 @@ # 推論補助 -* to_input_view[meta header] +* ranges[meta header] * std::ranges[meta namespace] * to_input_view[meta class] * function[meta id-type] diff --git a/reference/ranges/to_input_view/size.md b/reference/ranges/to_input_view/size.md index 79fb4ac0df..9f06c84128 100644 --- a/reference/ranges/to_input_view/size.md +++ b/reference/ranges/to_input_view/size.md @@ -1,5 +1,5 @@ # size -* to_input_view[meta header] +* ranges[meta header] * std::ranges[meta namespace] * to_input_view[meta class] * function[meta id-type] From c4d5bec557079e03eb029537a59c5b9964d8c5c3 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Thu, 5 Jun 2025 03:01:33 +0900 Subject: [PATCH 1870/3948] =?UTF-8?q?unreachable=5Fsentinel:=20=E8=AA=AC?= =?UTF-8?q?=E6=98=8E=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/unreachable_sentinel_t.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/reference/iterator/unreachable_sentinel_t.md b/reference/iterator/unreachable_sentinel_t.md index 4694befc9f..15ecfbff87 100644 --- a/reference/iterator/unreachable_sentinel_t.md +++ b/reference/iterator/unreachable_sentinel_t.md @@ -19,11 +19,13 @@ namespace std { ## 概要 -`unreachable_sentinel_t`は、`weakly_incrementable`な型(イテレータ型)とともに用いて、任意の(半)開区間の上界を示すことのできる番兵型である。 +`unreachable_sentinel_t`は、`weakly_incrementable`な型(主にイテレータ型)とともに用いて、非有界な区間の上界を表すことのできる番兵型である。 -検索などを目的として範囲を走査する際、検索対象が範囲内に存在している場合その終端まで到達することは無く、範囲の探索は必ずしも範囲の先頭から行われる訳でも無い。任意の(半)開区間とは、ある範囲の内部にあるその様な走査の対象となる部分範囲のことを指す。`unreachable_sentinel`はその様な区間の終端を暗に指定する、その様な開区間の上界を表す番兵である。 +非有界な区間とは無限長の範囲のように、その終端が指定されない区間(範囲)のこと。そのような範囲の走査に対して`unreachable_sentinel`を使用して、別の方法によって範囲の終端が示されることを表し、それによって区間の上界を指定することができる。 -検索など、ある範囲の一部を走査する際にそのイテレータに対する番兵として用いる事で、範囲の終端チェックを省略して走査を効率化できる可能性がある。ただし、実際の終端に到達しても走査が終了しないため、利用にあたっては事前条件(終端となる値が存在しているか)が必ず満たされるかに注意を払う必要がある。 +1つの使い方は、無限長の範囲や`view`の番兵型として指定することで、その長さが無制限であることを表すことである。[`views::iota`](/reference/ranges/iota_view.md)や[`views::repeat`](/reference/ranges/repeat_view.md)でそのような使用方法を見ることができる。 + +もう一つの使い方として、検索などにおいてある範囲の一部を走査する際にそのイテレータに対する番兵として用いる事で、範囲の終端チェックを省略して走査を効率化できる可能性がある。ただし、実際の終端に到達しても走査が終了しないため、利用にあたっては事前条件(終端となる値が存在しているか)が必ず満たされるかに注意を払う必要がある。 ## 非メンバ(*Hidden friends*)関数 From 639c8172b1c235a48bca3650d9854a35404d6fa1 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 5 Jun 2025 12:37:16 +0900 Subject: [PATCH 1871/3948] =?UTF-8?q?sstream=20:=20C++20=E6=99=82=E7=82=B9?= =?UTF-8?q?=E3=81=AE=E3=83=A1=E3=83=B3=E3=83=90=E9=96=A2=E6=95=B0=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/sstream/basic_istringstream.md | 16 +-- .../sstream/basic_istringstream/op_assign.md | 54 +++++++++ .../basic_istringstream/op_constructor.md | 97 ++++++++++++++++ .../basic_istringstream/op_destructor.md | 12 ++ .../sstream/basic_istringstream/rdbuf.md | 39 +++++++ reference/sstream/basic_istringstream/str.md | 11 +- reference/sstream/basic_istringstream/swap.md | 60 ++++++++++ .../sstream/basic_istringstream/swap_free.md | 57 ++++++++++ reference/sstream/basic_istringstream/view.md | 51 +++++++++ reference/sstream/basic_ostringstream.md | 16 +-- .../sstream/basic_ostringstream/op_assign.md | 56 ++++++++++ .../basic_ostringstream/op_constructor.md | 99 +++++++++++++++++ .../basic_ostringstream/op_destructor.md | 12 ++ .../sstream/basic_ostringstream/rdbuf.md | 43 +++++++ reference/sstream/basic_ostringstream/str.md | 6 +- reference/sstream/basic_ostringstream/swap.md | 60 ++++++++++ .../sstream/basic_ostringstream/swap_free.md | 57 ++++++++++ reference/sstream/basic_ostringstream/view.md | 52 +++++++++ reference/sstream/basic_stringbuf.md | 16 +-- .../sstream/basic_stringbuf/get_allocator.md | 49 ++++++++ .../sstream/basic_stringbuf/op_assign.md | 54 +++++++++ .../sstream/basic_stringbuf/op_constructor.md | 105 ++++++++++++++++++ .../sstream/basic_stringbuf/op_destructor.md | 12 ++ reference/sstream/basic_stringbuf/str.md | 6 +- reference/sstream/basic_stringbuf/swap.md | 55 +++++++++ .../sstream/basic_stringbuf/swap_free.md | 54 +++++++++ reference/sstream/basic_stringbuf/view.md | 52 +++++++++ reference/sstream/basic_stringstream.md | 16 +-- .../sstream/basic_stringstream/op_assign.md | 54 +++++++++ .../basic_stringstream/op_constructor.md | 99 +++++++++++++++++ .../basic_stringstream/op_destructor.md | 12 ++ reference/sstream/basic_stringstream/rdbuf.md | 46 ++++++++ reference/sstream/basic_stringstream/str.md | 8 +- reference/sstream/basic_stringstream/swap.md | 55 +++++++++ .../sstream/basic_stringstream/swap_free.md | 54 +++++++++ reference/sstream/basic_stringstream/view.md | 51 +++++++++ 36 files changed, 1558 insertions(+), 38 deletions(-) create mode 100644 reference/sstream/basic_istringstream/op_assign.md create mode 100644 reference/sstream/basic_istringstream/op_constructor.md create mode 100644 reference/sstream/basic_istringstream/op_destructor.md create mode 100644 reference/sstream/basic_istringstream/rdbuf.md create mode 100644 reference/sstream/basic_istringstream/swap.md create mode 100644 reference/sstream/basic_istringstream/swap_free.md create mode 100644 reference/sstream/basic_istringstream/view.md create mode 100644 reference/sstream/basic_ostringstream/op_assign.md create mode 100644 reference/sstream/basic_ostringstream/op_constructor.md create mode 100644 reference/sstream/basic_ostringstream/op_destructor.md create mode 100644 reference/sstream/basic_ostringstream/rdbuf.md create mode 100644 reference/sstream/basic_ostringstream/swap.md create mode 100644 reference/sstream/basic_ostringstream/swap_free.md create mode 100644 reference/sstream/basic_ostringstream/view.md create mode 100644 reference/sstream/basic_stringbuf/get_allocator.md create mode 100644 reference/sstream/basic_stringbuf/op_assign.md create mode 100644 reference/sstream/basic_stringbuf/op_constructor.md create mode 100644 reference/sstream/basic_stringbuf/op_destructor.md create mode 100644 reference/sstream/basic_stringbuf/swap.md create mode 100644 reference/sstream/basic_stringbuf/swap_free.md create mode 100644 reference/sstream/basic_stringbuf/view.md create mode 100644 reference/sstream/basic_stringstream/op_assign.md create mode 100644 reference/sstream/basic_stringstream/op_constructor.md create mode 100644 reference/sstream/basic_stringstream/op_destructor.md create mode 100644 reference/sstream/basic_stringstream/rdbuf.md create mode 100644 reference/sstream/basic_stringstream/swap.md create mode 100644 reference/sstream/basic_stringstream/swap_free.md create mode 100644 reference/sstream/basic_stringstream/view.md diff --git a/reference/sstream/basic_istringstream.md b/reference/sstream/basic_istringstream.md index 4b8565091e..8aa37930cf 100644 --- a/reference/sstream/basic_istringstream.md +++ b/reference/sstream/basic_istringstream.md @@ -25,20 +25,20 @@ namespace std { | 名前 | 説明 | 対応バージョン | |-------------------------------------|--------------------------------------------|----------------| -| `(constructor)` | コンストラクタ | | -| `(destructor)` | デストラクタ | | -| `operator=` | ムーブ代入 | C++11 | -| `swap` | 値の交換 | C++11 | -| `rdbuf` | ストリームバッファオブジェクトの設定・取得 | | -| [`str`](basic_istringstream/str.md) | 文字列オブジェクトの設定・取得 | | -| `view` | 文字列ビューオブジェクトの取得 | C++20 | +| [`(constructor)`](basic_istringstream/op_constructor.md) | コンストラクタ | | +| [`(destructor)`](basic_istringstream/op_destructor.md) | デストラクタ | | +| [`operator=`](basic_istringstream/op_assign.md) | ムーブ代入 | C++11 | +| [`swap`](basic_istringstream/swap.md) | 値の交換 | C++11 | +| [`rdbuf`](basic_istringstream/rdbuf.md) | ストリームバッファオブジェクトの設定・取得 | | +| [`str`](basic_istringstream/str.md) | 文字列オブジェクトの設定・取得 | | +| [`view`](basic_istringstream/view.md) | 文字列ビューオブジェクトの取得 | C++20 | ## 非メンバ関数 | 名前 | 説明 | 対応バージョン | |--------|-------------------------------|----------------| -| `swap` | 2つのオブジェクトを入れ替える | C++11 | +| [`swap`](basic_istringstream/swap_free.md) | 2つのオブジェクトを入れ替える | C++11 | ## メンバ型 diff --git a/reference/sstream/basic_istringstream/op_assign.md b/reference/sstream/basic_istringstream/op_assign.md new file mode 100644 index 0000000000..d0c7dfb25b --- /dev/null +++ b/reference/sstream/basic_istringstream/op_assign.md @@ -0,0 +1,54 @@ +# operator= +* sstream[meta header] +* std[meta namespace] +* basic_istringstream[meta class] +* function[meta id-type] +* cpp11[meta cpp] + +```cpp +basic_istringstream& operator=(basic_istringstream&& rhs); // (1) C++11 +basic_istringstream& operator=(const basic_istringstream&) = delete; // (2) C++11 +``` + +## 概要 +ムーブ代入を行う。 + +## 効果 +- (1) : `basic_istream::operator=(std::move(rhs))`を呼び出し、`sb = std::move(rhs.sb)`を実行する。ここで`sb`は内部の`basic_stringbuf`オブジェクトである。 + +## 戻り値 +`*this` + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::istringstream ss1("first"); + std::istringstream ss2; + + // ムーブ代入 + ss2 = std::move(ss1); + + std::string s; + ss2 >> s; + std::cout << s << std::endl; +} +``` + +### 出力 +``` +first +``` + +## バージョン +### 言語 +- C++11 + +### 処理系 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 5.1.0 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file diff --git a/reference/sstream/basic_istringstream/op_constructor.md b/reference/sstream/basic_istringstream/op_constructor.md new file mode 100644 index 0000000000..906de25e79 --- /dev/null +++ b/reference/sstream/basic_istringstream/op_constructor.md @@ -0,0 +1,97 @@ +# コンストラクタ +* sstream[meta header] +* std[meta namespace] +* basic_istringstream[meta class] +* function[meta id-type] + +```cpp +basic_istringstream() + : basic_istringstream(ios_base::in) {} // (1) C++11 +explicit basic_istringstream( + ios_base::openmode which); // (2) C++11 +explicit basic_istringstream( + ios_base::openmode which = ios_base::in); // (1)+(2) C++03 + +explicit basic_istringstream( + const basic_string& s, + ios_base::openmode which = ios_base::in); // (2) C++03 + +explicit basic_istringstream( + basic_string&& s, + ios_base::openmode which = ios_base::in); // (3) C++20 + +basic_istringstream( + ios_base::openmode which, + const Allocator& a); // (4) C++20 + +explicit basic_istringstream( + const basic_string& s, + const Allocator& a) + : basic_istringstream(s, ios_base::in, a) {} // (5) C++20 + +explicit basic_istringstream( + const basic_string& s, + ios_base::openmode which, + const Allocator& a); // (6) C++20 + +template +explicit basic_istringstream( + const basic_string& s, + ios_base::openmode which = ios_base::in); // (7) C++20 + +template +basic_istringstream( + const basic_string& s, + const Allocator& a) + : basic_istringstream(s, ios_base::in, a) {} // (8) C++20 + +template +basic_istringstream( + const basic_string& s, + ios_base::openmode which, + const Allocator& a); // (9) C++20 + +basic_istringstream(basic_istringstream&& rhs); // (10) C++11 +``` +* ios_base[link /reference/ios/ios_base.md] +* basic_string[link /reference/string/basic_string.md] + +## 概要 +`basic_istringstream`オブジェクトを構築する。 + +## 効果 +- (1) : 内部の`basic_stringbuf`オブジェクトを`basic_stringbuf(ios_base::in)`で構築する +- (2) : 内部の`basic_stringbuf`オブジェクトを`basic_stringbuf(which | ios_base::in)`で構築する +- (3) : 内部の`basic_stringbuf`オブジェクトを`basic_stringbuf(s, which | ios_base::in)`で構築する +- (4) : 内部の`basic_stringbuf`オブジェクトを`basic_stringbuf(std::move(s), which | ios_base::in)`で構築する +- (5) : 内部の`basic_stringbuf`オブジェクトを`basic_stringbuf(which | ios_base::in, a)`で構築する +- (6), (7), (8), (9), (10) : 各引数が対応する`basic_stringbuf`のコンストラクタに渡される +- (11) : `rhs`から`basic_istringstream`オブジェクトをムーブ構築する + + +## 例 +```cpp example +#include +#include + +int main() +{ + // (1) デフォルト構築 + std::istringstream ss1; + + // (3) 文字列を指定して構築 + std::istringstream ss2("initial text"); + + int value; + ss2 >> value; + std::cout << value << std::endl; +} +``` + +### 出力 +``` +initial +``` + +## 参照 +- [P0408R7 Efficient Access to `basic_stringbuf`'s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) \ No newline at end of file diff --git a/reference/sstream/basic_istringstream/op_destructor.md b/reference/sstream/basic_istringstream/op_destructor.md new file mode 100644 index 0000000000..cf64d0abbb --- /dev/null +++ b/reference/sstream/basic_istringstream/op_destructor.md @@ -0,0 +1,12 @@ +# デストラクタ +* sstream[meta header] +* std[meta namespace] +* basic_istringstream[meta class] +* function[meta id-type] + +```cpp +virtual ~basic_istringstream(); +``` + +## 概要 +`basic_istringstream`オブジェクトを破棄する。 diff --git a/reference/sstream/basic_istringstream/rdbuf.md b/reference/sstream/basic_istringstream/rdbuf.md new file mode 100644 index 0000000000..36a2417e58 --- /dev/null +++ b/reference/sstream/basic_istringstream/rdbuf.md @@ -0,0 +1,39 @@ +# rdbuf +* sstream[meta header] +* std[meta namespace] +* basic_istringstream[meta class] +* function[meta id-type] + +```cpp +basic_stringbuf* rdbuf() const; +``` +* basic_stringbuf[link /reference/sstream/basic_stringbuf.md] + +## 概要 +ストリームバッファオブジェクトを取得する。 + +## 戻り値 +内部の`basic_stringbuf`オブジェクトへのポインタ。 + +## 例 +```cpp example +#include +#include + +int main() +{ + std::istringstream ss("test"); + + std::streambuf* buf = ss.rdbuf(); + + std::cout << static_cast(buf->sbumpc()) << std::endl; // 't' + std::cout << static_cast(buf->sbumpc()) << std::endl; // 'e' +} +``` +* sbumpc()[link /reference/streambuf/basic_streambuf/sbumpc.md] + +### 出力 +``` +t +e +``` diff --git a/reference/sstream/basic_istringstream/str.md b/reference/sstream/basic_istringstream/str.md index ef88b99513..fae012a552 100644 --- a/reference/sstream/basic_istringstream/str.md +++ b/reference/sstream/basic_istringstream/str.md @@ -7,11 +7,14 @@ ```cpp basic_string str() const; // (1) C++03 basic_string str() const &; // (1) C++20 + template basic_string str(const SAlloc& sa) const &; // (2) C++20 + basic_string str() const &&; // (3) C++20 -void str(const basic_string& s); // (4) +void str(const basic_string& s); // (4) C++03 + template void str(const basic_string& s); // (5) C++20 void str(const basic_string&& s); // (6) C++20 @@ -30,4 +33,8 @@ void str(const basic_string&& s); // (6) C++20 - (6) : `rdbuf()->str(std::move(s))` と等価 ## 関連項目 -[basic_stringbuf::str](../basic_stringbuf/str.md) +- [`basic_stringbuf::str`](../basic_stringbuf/str.md) + + +## 参照 +- [P0408R7 Efficient Access to `basic_stringbuf`'s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) diff --git a/reference/sstream/basic_istringstream/swap.md b/reference/sstream/basic_istringstream/swap.md new file mode 100644 index 0000000000..3857dbaff1 --- /dev/null +++ b/reference/sstream/basic_istringstream/swap.md @@ -0,0 +1,60 @@ +# swap +* sstream[meta header] +* std[meta namespace] +* basic_istringstream[meta class] +* function[meta id-type] +* cpp11[meta cpp] + +```cpp +void swap(basic_istringstream& rhs); // (1) C++11 +void swap(basic_istringstream& rhs) noexcept(/*see below*/); // (1) C++17 +``` + +## 概要 +値を交換する。 + +## 効果 +`basic_istream::swap(rhs)`を呼び出し、`sb.swap(rhs.sb)`を実行する。ここで`sb`は内部の`basic_stringbuf`オブジェクトである。 + + +## 例外 +- C++17 : 実装が例外を投げない場合、この関数は`noexcept`が指定される。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::istringstream ss1("first"); + std::istringstream ss2("second"); + + ss1.swap(ss2); + + std::string s1, s2; + ss1 >> s1; + ss2 >> s2; + + std::cout << s1 << std::endl; + std::cout << s2 << std::endl; +} +``` + +### 出力 +``` +second +first +``` + +## バージョン +### 言語 +- C++11 + +### 処理系 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 5.1.0 [mark verified] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/sstream/basic_istringstream/swap_free.md b/reference/sstream/basic_istringstream/swap_free.md new file mode 100644 index 0000000000..eec17efd83 --- /dev/null +++ b/reference/sstream/basic_istringstream/swap_free.md @@ -0,0 +1,57 @@ +# swap (非メンバ関数) +* sstream[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp11[meta cpp] + +```cpp +namespace std { + template + void swap(basic_istringstream& x, + basic_istringstream& y); +} +``` + +## 概要 +2つの`basic_istringstream`オブジェクトを入れ替える。 + +## 効果 +`x.swap(y)` + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::istringstream ss1("first"); + std::istringstream ss2("second"); + + std::swap(ss1, ss2); + + std::string s1, s2; + ss1 >> s1; + ss2 >> s2; + + std::cout << s1 << std::endl; + std::cout << s2 << std::endl; +} +``` + +### 出力 +``` +second +first +``` + +## バージョン +### 言語 +- C++11 + +### 処理系 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 5.1.0 [mark verified] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file diff --git a/reference/sstream/basic_istringstream/view.md b/reference/sstream/basic_istringstream/view.md new file mode 100644 index 0000000000..d5ffef3e59 --- /dev/null +++ b/reference/sstream/basic_istringstream/view.md @@ -0,0 +1,51 @@ +# view +* sstream[meta header] +* std[meta namespace] +* basic_istringstream[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +basic_string_view view() const noexcept; +``` +* basic_string_view[link /reference/string_view/basic_string_view.md] + +## 概要 +文字列ビューオブジェクトの取得を行う。 + +## 戻り値 +`rdbuf()->view()` + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::istringstream ss("Hello World"); + + std::string_view sv = ss.view(); + + std::cout << sv.substr(0, 5) << std::endl; // "Hello" +} +``` +* substr[link /reference/string_view/basic_string_view/substr.md] + +### 出力 +``` +Hello +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 12 [mark verified] +- [GCC](/implementation.md#gcc): 12 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [P0408R7 Efficient Access to `basic_stringbuf`'s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) \ No newline at end of file diff --git a/reference/sstream/basic_ostringstream.md b/reference/sstream/basic_ostringstream.md index e6f90336c5..3d5aed8ed8 100644 --- a/reference/sstream/basic_ostringstream.md +++ b/reference/sstream/basic_ostringstream.md @@ -25,20 +25,20 @@ namespace std { | 名前 | 説明 | 対応バージョン | |-------------------------------------|--------------------------------------------|----------------| -| `(constructor)` | コンストラクタ | | -| `(destructor)` | デストラクタ | | -| `operator=` | ムーブ代入 | C++11 | -| `swap` | 値の交換 | C++11 | -| `rdbuf` | ストリームバッファオブジェクトの設定・取得 | | -| [`str`](basic_ostringstream/str.md) | 文字列オブジェクトの設定・取得 | | -| `view` | 文字列ビューオブジェクトの取得 | C++20 | +| [`(constructor)`](basic_ostringstream/op_constructor.md) | コンストラクタ | | +| [`(destructor)`](basic_ostringstream/op_destructor.md) | デストラクタ | | +| [`operator=`](basic_ostringstream/op_assign.md) | ムーブ代入 | C++11 | +| [`swap`](basic_ostringstream/swap.md) | 値の交換 | C++11 | +| [`rdbuf`](basic_ostringstream/rdbuf.md) | ストリームバッファオブジェクトの設定・取得 | | +| [`str`](basic_ostringstream/str.md) | 文字列オブジェクトの設定・取得 | | +| [`view`](basic_ostringstream/view.md) | 文字列ビューオブジェクトの取得 | C++20 | ## 非メンバ関数 | 名前 | 説明 | 対応バージョン | |--------|-------------------------------|----------------| -| `swap` | 2つのオブジェクトを入れ替える | C++11 | +| [`swap`](basic_ostringstream/swap_free.md) | 2つのオブジェクトを入れ替える | C++11 | ## メンバ型 diff --git a/reference/sstream/basic_ostringstream/op_assign.md b/reference/sstream/basic_ostringstream/op_assign.md new file mode 100644 index 0000000000..52fd35a1ce --- /dev/null +++ b/reference/sstream/basic_ostringstream/op_assign.md @@ -0,0 +1,56 @@ +# operator= +* sstream[meta header] +* std[meta namespace] +* basic_ostringstream[meta class] +* function[meta id-type] +* cpp11[meta cpp] + +```cpp +basic_ostringstream& operator=(basic_ostringstream&& rhs); // (1) C++11 +basic_ostringstream& operator=(const basic_ostringstream&) = delete; // (2) C++11 +``` + +## 概要 +ムーブ代入を行う。 + +## 効果 +- (1) : `basic_ostream::operator=(std::move(rhs))`を呼び出し、`sb = std::move(rhs.sb)`を実行する。ここで`sb`は内部の`basic_stringbuf`オブジェクトである。 + +## 戻り値 +`*this` + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::ostringstream ss1; + std::ostringstream ss2; + + ss1 << "first"; + + // ムーブ代入 + ss2 = std::move(ss1); + + std::cout << ss2.str() << std::endl; +} +``` +* str()[link str.md] + +### 出力 +``` +first +``` + +## バージョン +### 言語 +- C++11 + +### 処理系 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5.0 [mark verified], 3.6.0 [mark verified], 3.7.0 [mark verified], 3.8.0 [mark verified] +- [GCC](/implementation.md#gcc): 5.1.0 [mark verified], 5.2.0 [mark verified], 6.0.0 [mark verified] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file diff --git a/reference/sstream/basic_ostringstream/op_constructor.md b/reference/sstream/basic_ostringstream/op_constructor.md new file mode 100644 index 0000000000..075af3c237 --- /dev/null +++ b/reference/sstream/basic_ostringstream/op_constructor.md @@ -0,0 +1,99 @@ +# コンストラクタ +* sstream[meta header] +* std[meta namespace] +* basic_ostringstream[meta class] +* function[meta id-type] + +```cpp +basic_ostringstream() + : basic_ostringstream(ios_base::out) {} // (1) C++11 +explicit basic_ostringstream( + ios_base::openmode which); // (2) C++11 +explicit basic_ostringstream( + ios_base::openmode which = ios_base::out); // (1)+(2) C++03 + +explicit basic_ostringstream( + const basic_string& s, + ios_base::openmode which = ios_base::out); // (2) C++03 + +explicit basic_ostringstream( + basic_string&& s, + ios_base::openmode which = ios_base::out); // (3) C++20 + +basic_ostringstream( + ios_base::openmode which, + const Allocator& a); // (4) C++20 + +explicit basic_ostringstream( + const basic_string& s, + const Allocator& a) + : basic_ostringstream(s, ios_base::out, a) {} // (5) C++20 + +explicit basic_ostringstream( + const basic_string& s, + ios_base::openmode which, + const Allocator& a); // (6) C++20 + +template +explicit basic_ostringstream( + const basic_string& s, + ios_base::openmode which = ios_base::out); // (7) C++20 + +template +basic_ostringstream( + const basic_string& s, + const Allocator& a) + : basic_ostringstream(s, ios_base::out, a) {} // (8) C++20 + +template +basic_ostringstream( + const basic_string& s, + ios_base::openmode which, + const Allocator& a); // (9) C++20 + +basic_ostringstream(basic_ostringstream&& rhs); // (10) C++11 +``` +* ios_base[link /reference/ios/ios_base.md] +* basic_string[link /reference/string/basic_string.md] + +## 概要 +`basic_ostringstream`オブジェクトを構築する。 + +## 効果 +- (1) : 内部の`basic_stringbuf`オブジェクトを`basic_stringbuf(ios_base::out)`で構築する +- (2) : 内部の`basic_stringbuf`オブジェクトを`basic_stringbuf(which | ios_base::out)`で構築する +- (3) : 内部の`basic_stringbuf`オブジェクトを`basic_stringbuf(s, which | ios_base::out)`で構築する +- (4) : 内部の`basic_stringbuf`オブジェクトを`basic_stringbuf(std::move(s), which | ios_base::out)`で構築する +- (5) : 内部の`basic_stringbuf`オブジェクトを`basic_stringbuf(which | ios_base::out, a)`で構築する +- (6), (7), (8), (9), (10) : 各引数が対応する`basic_stringbuf`のコンストラクタに渡される +- (11) : `rhs`から`basic_ostringstream`オブジェクトをムーブ構築する + + +## 例 +```cpp example +#include +#include + +int main() +{ + // (1) デフォルト構築 + std::ostringstream ss1; + ss1 << "default"; + std::cout << ss1.str() << std::endl; + + // (3) 文字列を指定して構築 + std::ostringstream ss2("initial "); + ss2 << "text"; + std::cout << ss2.str() << std::endl; +} +``` +* str()[link str.md] + +### 出力 +``` +default +initial text +``` + +## 参照 +- [P0408R7 Efficient Access to `basic_stringbuf`'s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) \ No newline at end of file diff --git a/reference/sstream/basic_ostringstream/op_destructor.md b/reference/sstream/basic_ostringstream/op_destructor.md new file mode 100644 index 0000000000..7fccec10f9 --- /dev/null +++ b/reference/sstream/basic_ostringstream/op_destructor.md @@ -0,0 +1,12 @@ +# デストラクタ +* sstream[meta header] +* std[meta namespace] +* basic_ostringstream[meta class] +* function[meta id-type] + +```cpp +virtual ~basic_ostringstream(); +``` + +## 概要 +`basic_ostringstream`オブジェクトを破棄する。 diff --git a/reference/sstream/basic_ostringstream/rdbuf.md b/reference/sstream/basic_ostringstream/rdbuf.md new file mode 100644 index 0000000000..cfa07d54f4 --- /dev/null +++ b/reference/sstream/basic_ostringstream/rdbuf.md @@ -0,0 +1,43 @@ +# rdbuf +* sstream[meta header] +* std[meta namespace] +* basic_ostringstream[meta class] +* function[meta id-type] + +```cpp +basic_stringbuf* rdbuf() const; +``` +* basic_stringbuf[link /reference/sstream/basic_stringbuf.md] + +## 概要 +ストリームバッファオブジェクトを取得する。 + +## 戻り値 +内部の`basic_stringbuf`オブジェクトへのポインタ。 + +## 例 +```cpp example +#include +#include + +int main() +{ + std::ostringstream ss; + + std::streambuf* buf = ss.rdbuf(); + + buf->sputc('t'); + buf->sputc('e'); + buf->sputc('s'); + buf->sputc('t'); + + std::cout << ss.str() << std::endl; +} +``` +* sputc[link /reference/streambuf/basic_streambuf/sputc.md] +* str()[link str.md] + +### 出力 +``` +test +``` diff --git a/reference/sstream/basic_ostringstream/str.md b/reference/sstream/basic_ostringstream/str.md index f0c1eca187..0412ec5401 100644 --- a/reference/sstream/basic_ostringstream/str.md +++ b/reference/sstream/basic_ostringstream/str.md @@ -7,13 +7,17 @@ ```cpp basic_string str() const; // (1) C++03 basic_string str() const &; // (1) C++20 + template basic_string str(const SAlloc& sa) const; // (2) C++20 + basic_string str() &&; // (3) C++20 -void str(const basic_string& s); // (4) +void str(const basic_string& s); // (4) C++03 + template void str(const basic_string& s); // (5) C++20 + void str(const basic_string&& s); // (6) C++20 ``` * basic_string[link /reference/string/basic_string.md] diff --git a/reference/sstream/basic_ostringstream/swap.md b/reference/sstream/basic_ostringstream/swap.md new file mode 100644 index 0000000000..cb7d94d5e0 --- /dev/null +++ b/reference/sstream/basic_ostringstream/swap.md @@ -0,0 +1,60 @@ +# swap +* sstream[meta header] +* std[meta namespace] +* basic_ostringstream[meta class] +* function[meta id-type] +* cpp11[meta cpp] + +```cpp +void swap(basic_ostringstream& rhs); // (1) C++11 +void swap(basic_ostringstream& rhs) noexcept(/*see below*/); // (1) C++17 +``` + +## 概要 +値を交換する。 + +## 効果 +`basic_ostream::swap(rhs)`を呼び出し、`sb.swap(rhs.sb)`を実行する。ここで`sb`は内部の`basic_stringbuf`オブジェクトである。 + + +## 例外 +- C++17 : 実装が例外を投げない場合、この関数は`noexcept`が指定される。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::ostringstream ss1; + std::ostringstream ss2; + + ss1 << "first"; + ss2 << "second"; + + ss1.swap(ss2); + + std::cout << ss1.str() << std::endl; + std::cout << ss2.str() << std::endl; +} +``` +* str()[link str.md] + +### 出力 +``` +second +first +``` + +## バージョン +### 言語 +- C++11 + +### 処理系 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 5.1.0 [mark verified] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/sstream/basic_ostringstream/swap_free.md b/reference/sstream/basic_ostringstream/swap_free.md new file mode 100644 index 0000000000..3d9fe4c1e5 --- /dev/null +++ b/reference/sstream/basic_ostringstream/swap_free.md @@ -0,0 +1,57 @@ +# swap (非メンバ関数) +* sstream[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp11[meta cpp] + +```cpp +namespace std { + template + void swap(basic_ostringstream& x, + basic_ostringstream& y); +} +``` + +## 概要 +2つの`basic_ostringstream`オブジェクトを入れ替える。 + +## 効果 +`x.swap(y)` + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::ostringstream ss1; + std::ostringstream ss2; + + ss1 << "first"; + ss2 << "second"; + + std::swap(ss1, ss2); + + std::cout << ss1.str() << std::endl; + std::cout << ss2.str() << std::endl; +} +``` +* str()[link str.md] + +### 出力 +``` +second +first +``` + +## バージョン +### 言語 +- C++11 + +### 処理系 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 5.1.0 [mark verified] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file diff --git a/reference/sstream/basic_ostringstream/view.md b/reference/sstream/basic_ostringstream/view.md new file mode 100644 index 0000000000..f956af85e4 --- /dev/null +++ b/reference/sstream/basic_ostringstream/view.md @@ -0,0 +1,52 @@ +# view +* sstream[meta header] +* std[meta namespace] +* basic_ostringstream[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +basic_string_view view() const noexcept; +``` +* basic_string_view[link /reference/string_view/basic_string_view.md] + +## 概要 +文字列ビューオブジェクトの取得を行う。 + +## 戻り値 +`rdbuf()->view()` + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::ostringstream ss; + ss << "Hello World"; + + std::string_view sv = ss.view(); + + std::cout << sv.substr(0, 5) << std::endl; // "Hello" +} +``` +* substr[link /reference/string_view/basic_string_view/substr.md] + +### 出力 +``` +Hello +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 12 [mark verified] +- [GCC](/implementation.md#gcc): 12 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [P0408R7 Efficient Access to `basic_stringbuf`'s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) \ No newline at end of file diff --git a/reference/sstream/basic_stringbuf.md b/reference/sstream/basic_stringbuf.md index eeb830933b..76ac70b0e9 100644 --- a/reference/sstream/basic_stringbuf.md +++ b/reference/sstream/basic_stringbuf.md @@ -25,20 +25,20 @@ namespace std { | 名前 | 説明 | 対応バージョン | |---------------------------------|--------------------------------------------|----------------| -| `(constructor)` | コンストラクタ | | -| `(destructor)` | デストラクタ | | -| `operator=` | ムーブ代入 | C++11 | -| `swap` | 値の交換 | C++11 | -| [`str`](basic_stringbuf/str.md) | 文字列オブジェクトの設定・取得 | | -| `view` | 文字列ビューオブジェクトの取得 | C++20 | -| `get_allocator` | アロケータの取得 | C++20 | +| [`(constructor)`](basic_stringbuf/op_constructor.md) | コンストラクタ | | +| [`(destructor)`](basic_stringbuf/op_destructor.md) | デストラクタ | | +| [`operator=`](basic_stringbuf/op_assign.md) | ムーブ代入 | C++11 | +| [`swap`](basic_stringbuf/swap.md) | 値の交換 | C++11 | +| [`str`](basic_stringbuf/str.md) | 文字列オブジェクトの設定・取得 | | +| [`view`](basic_stringbuf/view.md) | 文字列ビューオブジェクトの取得 | C++20 | +| [`get_allocator`](basic_stringbuf/get_allocator.md) | アロケータの取得 | C++20 | ## 非メンバ関数 | 名前 | 説明 | 対応バージョン | |--------|-------------------------------|----------------| -| `swap` | 2つのオブジェクトを入れ替える | C++11 | +| [`swap`](basic_stringbuf/swap_free.md) | 2つのオブジェクトを入れ替える | C++11 | ## メンバ型 diff --git a/reference/sstream/basic_stringbuf/get_allocator.md b/reference/sstream/basic_stringbuf/get_allocator.md new file mode 100644 index 0000000000..2c36d251a9 --- /dev/null +++ b/reference/sstream/basic_stringbuf/get_allocator.md @@ -0,0 +1,49 @@ +# get_allocator +* sstream[meta header] +* std[meta namespace] +* basic_stringbuf[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +allocator_type get_allocator() const noexcept; +``` + +## 概要 +アロケータを取得する。 + +## 戻り値 +内部の文字列バッファが保持しているアロケータのコピー。 + +## 例 +```cpp example +#include +#include + +int main() +{ + std::stringbuf buf; + + auto alloc = buf.get_allocator(); + + // アロケータの型名を出力(処理系依存) + std::cout << typeid(alloc).name() << std::endl; +} +``` + +### 出力例 +``` +std::allocator +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 12 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P0408R7 Efficient Access to `basic_stringbuf`'s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) \ No newline at end of file diff --git a/reference/sstream/basic_stringbuf/op_assign.md b/reference/sstream/basic_stringbuf/op_assign.md new file mode 100644 index 0000000000..9abfaf684d --- /dev/null +++ b/reference/sstream/basic_stringbuf/op_assign.md @@ -0,0 +1,54 @@ +# operator= +* sstream[meta header] +* std[meta namespace] +* basic_stringbuf[meta class] +* function[meta id-type] +* cpp11[meta cpp] + +```cpp +basic_stringbuf& operator=(basic_stringbuf&& rhs); // (1) C++11 +basic_stringbuf& operator=(const basic_stringbuf&) = delete; // (2) C++11 +``` + +## 概要 +ムーブ代入を行う。 + +## 効果 +- (1) : `basic_streambuf::operator=(std::move(rhs))`を呼び出した後、`mode = rhs.mode`、`buf = std::move(rhs.buf)`を実行する。ここで`mode`は内部のオープンモード、`buf`は内部の文字列バッファである。 + +## 戻り値 +`*this` + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::stringbuf buf1("first"); + std::stringbuf buf2; + + // ムーブ代入 + buf2 = std::move(buf1); + + std::cout << buf2.str() << std::endl; +} +``` +* str()[link str.md] + +### 出力 +``` +first +``` + +## バージョン +### 言語 +- C++11 + +### 処理系 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5.0 [mark verified], 3.6.0 [mark verified], 3.7.0 [mark verified], 3.8.0 [mark verified] +- [GCC](/implementation.md#gcc): 5.1.0 [mark verified], 5.2.0 [mark verified], 6.0.0 [mark verified] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file diff --git a/reference/sstream/basic_stringbuf/op_constructor.md b/reference/sstream/basic_stringbuf/op_constructor.md new file mode 100644 index 0000000000..ed4659c25d --- /dev/null +++ b/reference/sstream/basic_stringbuf/op_constructor.md @@ -0,0 +1,105 @@ +# コンストラクタ +* sstream[meta header] +* std[meta namespace] +* basic_stringbuf[meta class] +* function[meta id-type] + +```cpp +basic_stringbuf() + : basic_stringbuf(ios_base::in | ios_base::out) {} // (1) C++11 +explicit basic_stringbuf( + ios_base::openmode which); // (2) C++11 +explicit basic_stringbuf( + ios_base::openmode which = ios_base::in | ios_base::out); // (1)+(2) C++03 + +explicit basic_stringbuf( + const basic_string& s, + ios_base::openmode which = ios_base::in | ios_base::out); // (2) C++03 + +explicit basic_stringbuf( + basic_string&& s, + ios_base::openmode which = ios_base::in | ios_base::out); // (3) C++20 + +basic_stringbuf( + ios_base::openmode which, + const Allocator& a); // (4) C++20 + +explicit basic_stringbuf(const Allocator& a) + : basic_stringbuf(ios_base::in | ios_base::out, a) {} // (5) C++20 + +explicit basic_stringbuf( + const basic_string& s, + const Allocator& a) + : basic_stringbuf(s, ios_base::in | ios_base::out, a) {} // (6) C++20 + +explicit basic_stringbuf( + const basic_string& s, + ios_base::openmode which, + const Allocator& a); // (7) C++20 + +template +explicit basic_stringbuf( + const basic_string& s, + ios_base::openmode which = ios_base::in | ios_base::out); // (8) C++20 + +template +basic_stringbuf( + const basic_string& s, + const Allocator& a) + : basic_stringbuf(s, ios_base::in | ios_base::out, a) {} // (9) C++20 + +template +basic_stringbuf( + const basic_string& s, + ios_base::openmode which, + const Allocator& a); // (10) C++20 + +basic_stringbuf(basic_stringbuf&& rhs); // (11) C++11 +basic_stringbuf(basic_stringbuf&& rhs, const Allocator& a); // (12) C++20 +``` +* ios_base[link /reference/ios/ios_base.md] +* basic_string[link /reference/string/basic_string.md] + +## 概要 +`basic_stringbuf`オブジェクトを構築する。 + +## 効果 +- (1) : 内部の文字列バッファを空にし、モードは`ios_base::in | ios_base::out`に設定する +- (2) : 内部の文字列バッファを空にし、モードは`which`に設定する +- (3) : 内部の文字列バッファを`s`のコピー、モードは`which`に設定する +- (4) : 内部の文字列バッファを`std::move(s)`で、モードは`which`に設定する +- (5) : 内部の文字列バッファを空にし、モードは`which`、アロケータは`a`に設定する +- (6), (7), (8), (9), (10), (11) : 各引数は内部状態の初期化に使用される +- (12) : `rhs`から`basic_stringbuf`オブジェクトをムーブ構築する +- (13) : `rhs`から`basic_stringbuf`オブジェクトをムーブ構築し、アロケータは`a`を使用する + + +## 例 +```cpp example +#include +#include + +int main() +{ + // (1) デフォルト構築 + std::stringbuf buf1; + buf1.sputc('a'); + std::cout << buf1.str() << std::endl; + + // (3) 文字列を指定して構築 + std::stringbuf buf2("initial"); + buf2.sputc('!'); + std::cout << buf2.str() << std::endl; +} +``` +* sputc[link /reference/streambuf/basic_streambuf/sputc.md] +* str()[link str.md] + +### 出力 +``` +a +initial! +``` + +## 参照 +- [P0408R7 Efficient Access to `basic_stringbuf`'s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) \ No newline at end of file diff --git a/reference/sstream/basic_stringbuf/op_destructor.md b/reference/sstream/basic_stringbuf/op_destructor.md new file mode 100644 index 0000000000..38998425a7 --- /dev/null +++ b/reference/sstream/basic_stringbuf/op_destructor.md @@ -0,0 +1,12 @@ +# デストラクタ +* sstream[meta header] +* std[meta namespace] +* basic_stringbuf[meta class] +* function[meta id-type] + +```cpp +virtual ~basic_stringbuf(); +``` + +## 概要 +`basic_stringbuf`オブジェクトを破棄する。 diff --git a/reference/sstream/basic_stringbuf/str.md b/reference/sstream/basic_stringbuf/str.md index 1d4b691af5..4f7b917045 100644 --- a/reference/sstream/basic_stringbuf/str.md +++ b/reference/sstream/basic_stringbuf/str.md @@ -7,13 +7,17 @@ ```cpp basic_string str() const; // (1) C++03 basic_string str() const &; // (1) C++20 + template basic_string str(const SAlloc& sa) const; // (2) C++20 + basic_string str() &&; // (3) C++20 -void str(const basic_string& s); // (4) +void str(const basic_string& s); // (4) C++03 + template void str(const basic_string& s); // (5) C++20 + void str(const basic_string&& s); // (6) C++20 ``` * basic_string[link /reference/string/basic_string.md] diff --git a/reference/sstream/basic_stringbuf/swap.md b/reference/sstream/basic_stringbuf/swap.md new file mode 100644 index 0000000000..89f1a7c5fc --- /dev/null +++ b/reference/sstream/basic_stringbuf/swap.md @@ -0,0 +1,55 @@ +# swap +* sstream[meta header] +* std[meta namespace] +* basic_stringbuf[meta class] +* function[meta id-type] +* cpp11[meta cpp] + +```cpp +void swap(basic_stringbuf& rhs); // (1) C++11 +void swap(basic_stringbuf& rhs) noexcept(/*see below*/); // (1) C++17 +``` + +## 概要 +値を交換する。 + +## 効果 +`basic_streambuf::swap(rhs)`を呼び出し、`mode`と内部の文字列バッファを`rhs`と交換する。 + +## 例外 +- C++17 : 実装が例外を投げない場合、この関数は`noexcept`が指定される。 + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::stringbuf buf1("first"); + std::stringbuf buf2("second"); + + buf1.swap(buf2); + + std::cout << buf1.str() << std::endl; + std::cout << buf2.str() << std::endl; +} +``` +* str()[link str.md] + +### 出力 +``` +second +first +``` + +## バージョン +### 言語 +- C++11 + +### 処理系 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 5.1.0 [mark verified] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/sstream/basic_stringbuf/swap_free.md b/reference/sstream/basic_stringbuf/swap_free.md new file mode 100644 index 0000000000..6cf73ef46d --- /dev/null +++ b/reference/sstream/basic_stringbuf/swap_free.md @@ -0,0 +1,54 @@ +# swap (非メンバ関数) +* sstream[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp11[meta cpp] + +```cpp +namespace std { + template + void swap(basic_stringbuf& x, + basic_stringbuf& y); +} +``` + +## 概要 +2つの`basic_stringbuf`オブジェクトを入れ替える。 + +## 効果 +`x.swap(y)` + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::stringbuf buf1("first"); + std::stringbuf buf2("second"); + + std::swap(buf1, buf2); + + std::cout << buf1.str() << std::endl; + std::cout << buf2.str() << std::endl; +} +``` +* str()[link str.md] + +### 出力 +``` +second +first +``` + +## バージョン +### 言語 +- C++11 + +### 処理系 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 5.1.0 [mark verified] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file diff --git a/reference/sstream/basic_stringbuf/view.md b/reference/sstream/basic_stringbuf/view.md new file mode 100644 index 0000000000..521657fea5 --- /dev/null +++ b/reference/sstream/basic_stringbuf/view.md @@ -0,0 +1,52 @@ +# view +* sstream[meta header] +* std[meta namespace] +* basic_stringbuf[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +basic_string_view view() const noexcept; +``` +* basic_string_view[link /reference/string_view/basic_string_view.md] + +## 概要 +文字列ビューオブジェクトの取得を行う。 + +## 戻り値 +バッファが初期化されている場合、[`gptr()`](/reference/streambuf/basic_streambuf/gptr.md)と[`egptr()`](/reference/streambuf/basic_streambuf/egptr.md)の間の文字列を指す`basic_string_view`オブジェクトを返す。 +それ以外の場合、[`pbase()`](/reference/streambuf/basic_streambuf/pbase.md)と[`epptr()`](/reference/streambuf/basic_streambuf/pptr.md)の間の文字列を指す`basic_string_view`オブジェクトを返す。 + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::stringbuf buf("Hello World"); + + std::string_view sv = buf.view(); + + std::cout << sv.substr(0, 5) << std::endl; // "Hello" +} +``` +* substr[link /reference/string_view/basic_string_view/substr.md] + +### 出力 +``` +Hello +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 12 [mark verified] +- [GCC](/implementation.md#gcc): 12 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [P0408R7 Efficient Access to `basic_stringbuf`'s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) diff --git a/reference/sstream/basic_stringstream.md b/reference/sstream/basic_stringstream.md index 71337c1462..b10e7a68e6 100644 --- a/reference/sstream/basic_stringstream.md +++ b/reference/sstream/basic_stringstream.md @@ -25,20 +25,20 @@ namespace std { | 名前 | 説明 | 対応バージョン | |-------------------------------------|--------------------------------------------|----------------| -| `(constructor)` | コンストラクタ | | -| `(destructor)` | デストラクタ | | -| `operator=` | ムーブ代入 | C++11 | -| `swap` | 値の交換 | C++11 | -| `rdbuf` | ストリームバッファオブジェクトの設定・取得 | | -| [`str`](basic_stringstream/str.md) | 文字列オブジェクトの設定・取得 | | -| `view` | 文字列ビューオブジェクトの取得 | C++20 | +| [`(constructor)`](basic_stringstream/op_constructor.md) | コンストラクタ | | +| [`(destructor)`](basic_stringstream/op_destructor.md) | デストラクタ | | +| [`operator=`](basic_stringstream/op_assign.md) | ムーブ代入 | C++11 | +| [`swap`](basic_stringstream/swap.md) | 値の交換 | C++11 | +| [`rdbuf`](basic_stringstream/rdbuf.md) | ストリームバッファオブジェクトの設定・取得 | | +| [`str`](basic_stringstream/str.md) | 文字列オブジェクトの設定・取得 | | +| [`view`](basic_stringstream/view.md) | 文字列ビューオブジェクトの取得 | C++20 | ## 非メンバ関数 | 名前 | 説明 | 対応バージョン | |--------|-------------------------------|----------------| -| `swap` | 2つのオブジェクトを入れ替える | C++11 | +| [`swap`](basic_stringstream/swap_free.md) | 2つのオブジェクトを入れ替える | C++11 | ## メンバ型 diff --git a/reference/sstream/basic_stringstream/op_assign.md b/reference/sstream/basic_stringstream/op_assign.md new file mode 100644 index 0000000000..07460e7461 --- /dev/null +++ b/reference/sstream/basic_stringstream/op_assign.md @@ -0,0 +1,54 @@ +# operator= +* sstream[meta header] +* std[meta namespace] +* basic_stringstream[meta class] +* function[meta id-type] +* cpp11[meta cpp] + +```cpp +basic_stringstream& operator=(basic_stringstream&& rhs); // (1) C++11 +basic_stringstream& operator=(const basic_stringstream&) = delete; // (2) C++11 +``` + +## 概要 +ムーブ代入を行う。 + +## 効果 +- (1) : `basic_iostream::operator=(std::move(rhs))`を呼び出し、`sb = std::move(rhs.sb)`を実行する。ここで`sb`は内部の`basic_stringbuf`オブジェクトである。 + +## 戻り値 +`*this` + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::stringstream ss1("first"); + std::stringstream ss2; + + // ムーブ代入 + ss2 = std::move(ss1); + + std::cout << ss2.str() << std::endl; +} +``` +* str()[link str.md] + +### 出力 +``` +first +``` + +## バージョン +### 言語 +- C++11 + +### 処理系 +- [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5.0 [mark verified], 3.6.0 [mark verified], 3.7.0 [mark verified], 3.8.0 [mark verified] +- [GCC](/implementation.md#gcc): 5.1.0 [mark verified], 5.2.0 [mark verified], 6.0.0 [mark verified] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file diff --git a/reference/sstream/basic_stringstream/op_constructor.md b/reference/sstream/basic_stringstream/op_constructor.md new file mode 100644 index 0000000000..6bf358acae --- /dev/null +++ b/reference/sstream/basic_stringstream/op_constructor.md @@ -0,0 +1,99 @@ +# コンストラクタ +* sstream[meta header] +* std[meta namespace] +* basic_stringstream[meta class] +* function[meta id-type] + +```cpp +basic_stringstream() + : basic_stringstream(ios_base::in | ios_base::out) {} // (1) C++11 +explicit basic_stringstream( + ios_base::openmode which); // (1) C++11 +explicit basic_stringstream( + ios_base::openmode which = ios_base::in | ios_base::out); // (1)+(2) C++03 + +explicit basic_stringstream( + const basic_string& s, + ios_base::openmode which = ios_base::in | ios_base::out); // (2) C++03 + +explicit basic_stringstream( + basic_string&& s, + ios_base::openmode which = ios_base::in | ios_base::out); // (3) C++20 + +basic_stringstream(ios_base::openmode which, const Allocator& a); // (4) C++20 + +explicit basic_stringstream( + const basic_string& s, + const Allocator& a) + : basic_stringstream(s, ios_base::in | ios_base::out, a) {} // (5) C++20 + +explicit basic_stringstream( + const basic_string& s, + ios_base::openmode which, + const Allocator& a); // (6) C++20 + +template +explicit basic_stringstream( + const basic_string& s, + ios_base::openmode which = ios_base::in | ios_base::out); // (7) C++20 + +template +basic_stringstream( + const basic_string& s, + const Allocator& a) + : basic_stringstream(s, ios_base::in | ios_base::out, a) {} // (8) C++20 + +template +basic_stringstream( + const basic_string& s, + ios_base::openmode which, + const Allocator& a); // (9) C++20 + +basic_stringstream(basic_stringstream&& rhs); // (10) C++11 +``` +* ios_base[link /reference/ios/ios_base.md] +* basic_string[link /reference/string/basic_string.md] + +## 概要 +`basic_stringstream`オブジェクトを構築する。 + +## 効果 +- (1) : 内部の`basic_stringbuf`オブジェクトを`basic_stringbuf(ios_base::in | ios_base::out)`で構築する +- (2) : 内部の`basic_stringbuf`オブジェクトを`basic_stringbuf(which)`で構築する +- (3) : 内部の`basic_stringbuf`オブジェクトを`basic_stringbuf(s, which)`で構築する +- (4) : 内部の`basic_stringbuf`オブジェクトを`basic_stringbuf(std::move(s), which)`で構築する +- (5) : 内部の`basic_stringbuf`オブジェクトを`basic_stringbuf(which, a)`で構築する +- (6), (7), (8), (9), (10) : 各引数は対応する`basic_stringbuf`のコンストラクタに渡される +- (11) : `rhs`から`basic_stringstream`オブジェクトをムーブ構築する + + +## 例 +```cpp example +#include +#include + +int main() +{ + // (1) デフォルト構築 + std::stringstream ss1; + ss1 << "hello"; + std::string s; + ss1 >> s; + std::cout << s << std::endl; + + // (3) 文字列を指定して構築 + std::stringstream ss2("initial value"); + ss2 << " added"; + std::cout << ss2.str() << std::endl; +} +``` +* str()[link str.md] + +### 出力 +``` +hello +initial value added +``` + +## 参照 +- [P0408R7 Efficient Access to `basic_stringbuf`'s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) \ No newline at end of file diff --git a/reference/sstream/basic_stringstream/op_destructor.md b/reference/sstream/basic_stringstream/op_destructor.md new file mode 100644 index 0000000000..63865e4a92 --- /dev/null +++ b/reference/sstream/basic_stringstream/op_destructor.md @@ -0,0 +1,12 @@ +# デストラクタ +* sstream[meta header] +* std[meta namespace] +* basic_stringstream[meta class] +* function[meta id-type] + +```cpp +virtual ~basic_stringstream(); +``` + +## 概要 +`basic_stringstream`オブジェクトを破棄する。 diff --git a/reference/sstream/basic_stringstream/rdbuf.md b/reference/sstream/basic_stringstream/rdbuf.md new file mode 100644 index 0000000000..c797602272 --- /dev/null +++ b/reference/sstream/basic_stringstream/rdbuf.md @@ -0,0 +1,46 @@ +# rdbuf +* sstream[meta header] +* std[meta namespace] +* basic_stringstream[meta class] +* function[meta id-type] + +```cpp +basic_stringbuf* rdbuf() const; +``` +* basic_stringbuf[link /reference/sstream/basic_stringbuf.md] + +## 概要 +ストリームバッファオブジェクトを取得する。 + +## 戻り値 +内部の`basic_stringbuf`オブジェクトへのポインタ。 + +## 例 +```cpp example +#include +#include + +int main() +{ + std::stringstream ss("test"); + + std::streambuf* buf = ss.rdbuf(); + + // バッファから文字を読み取り + std::cout << static_cast(buf->sbumpc()) << std::endl; // 't' + + // バッファに文字を書き込み + buf->sputc('!'); + + std::cout << ss.str() << std::endl; +} +``` +* sbumpc()[link /reference/streambuf/basic_streambuf/sbumpc.md] +* sputc[link /reference/streambuf/basic_streambuf/sputc.md] +* str()[link str.md] + +### 出力 +``` +t +est! +``` diff --git a/reference/sstream/basic_stringstream/str.md b/reference/sstream/basic_stringstream/str.md index d76900b4f2..72e0f5b0fa 100644 --- a/reference/sstream/basic_stringstream/str.md +++ b/reference/sstream/basic_stringstream/str.md @@ -7,13 +7,17 @@ ```cpp basic_string str() const; // (1) C++03 basic_string str() const &; // (1) C++20 + template basic_string str(const SAlloc& sa) const &; // (2) C++20 + basic_string str() const &&; // (3) C++20 -void str(const basic_string& s); // (4) +void str(const basic_string& s); // (4) C++03 + template void str(const basic_string& s); // (5) C++20 + void str(const basic_string&& s); // (6) C++20 ``` * basic_string[link /reference/string/basic_string.md] @@ -30,4 +34,4 @@ void str(const basic_string&& s); // (6) C++20 - (6) : `rdbuf()->str(std::move(s))` と等価 ## 関連項目 -[basic_stringbuf::str](../basic_stringbuf/str.md) +- [`basic_stringbuf::str`](../basic_stringbuf/str.md) diff --git a/reference/sstream/basic_stringstream/swap.md b/reference/sstream/basic_stringstream/swap.md new file mode 100644 index 0000000000..915112f683 --- /dev/null +++ b/reference/sstream/basic_stringstream/swap.md @@ -0,0 +1,55 @@ +# swap +* sstream[meta header] +* std[meta namespace] +* basic_stringstream[meta class] +* function[meta id-type] +* cpp11[meta cpp] + +```cpp +void swap(basic_stringstream& rhs); // (1) C++11 +void swap(basic_stringstream& rhs) noexcept(/*see below*/); // (1) C++17 +``` + +## 概要 +値を交換する。 + +## 効果 +`basic_iostream::swap(rhs)`を呼び出し、`sb.swap(rhs.sb)`を実行する。ここで`sb`は内部の`basic_stringbuf`オブジェクトである。 + +## 例外 +- C++17 : 実装が例外を投げない場合、この関数は`noexcept`が指定される。 + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::stringstream ss1("first"); + std::stringstream ss2("second"); + + ss1.swap(ss2); + + std::cout << ss1.str() << std::endl; + std::cout << ss2.str() << std::endl; +} +``` +* str()[link str.md] + +### 出力 +``` +second +first +``` + +## バージョン +### 言語 +- C++11 + +### 処理系 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 5.1.0 [mark verified] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/sstream/basic_stringstream/swap_free.md b/reference/sstream/basic_stringstream/swap_free.md new file mode 100644 index 0000000000..7df16d334d --- /dev/null +++ b/reference/sstream/basic_stringstream/swap_free.md @@ -0,0 +1,54 @@ +# swap (非メンバ関数) +* sstream[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp11[meta cpp] + +```cpp +namespace std { + template + void swap(basic_stringstream& x, + basic_stringstream& y); +} +``` + +## 概要 +2つの`basic_stringstream`オブジェクトを入れ替える。 + +## 効果 +`x.swap(y)` + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::stringstream ss1("first"); + std::stringstream ss2("second"); + + std::swap(ss1, ss2); + + std::cout << ss1.str() << std::endl; + std::cout << ss2.str() << std::endl; +} +``` +* str()[link str.md] + +### 出力 +``` +second +first +``` + +## バージョン +### 言語 +- C++11 + +### 処理系 +- [Clang](/implementation.md#clang): 3.0 [mark verified] +- [GCC](/implementation.md#gcc): 5.1.0 [mark verified] +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/sstream/basic_stringstream/view.md b/reference/sstream/basic_stringstream/view.md new file mode 100644 index 0000000000..767963f4ff --- /dev/null +++ b/reference/sstream/basic_stringstream/view.md @@ -0,0 +1,51 @@ +# view +* sstream[meta header] +* std[meta namespace] +* basic_stringstream[meta class] +* function[meta id-type] +* cpp20[meta cpp] + +```cpp +basic_string_view view() const noexcept; +``` +* basic_string_view[link /reference/string_view/basic_string_view.md] + +## 概要 +文字列ビューオブジェクトの取得を行う。 + +## 戻り値 +`rdbuf()->view()` + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::stringstream ss("Hello World"); + + std::string_view sv = ss.view(); + + std::cout << sv.substr(0, 5) << std::endl; // "Hello" +} +``` +* substr[link /reference/string_view/basic_string_view/substr.md] + +### 出力 +``` +Hello +``` + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): 12 [mark verified] +- [GCC](/implementation.md#gcc): 12 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [P0408R7 Efficient Access to `basic_stringbuf`'s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) \ No newline at end of file From 3dd6a8e1f56eaa67a717f7879360d74d1c7b98f6 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 5 Jun 2025 12:42:05 +0900 Subject: [PATCH 1872/3948] =?UTF-8?q?=E3=82=B9=E3=83=9D=E3=83=B3=E3=82=B5?= =?UTF-8?q?=E3=83=BC=E6=9B=B4=E6=96=B0=20#1453?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.md b/index.md index 84ccd85697..713f81995b 100644 --- a/index.md +++ b/index.md @@ -129,6 +129,8 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい [sponsor name:soramimi, img:https://www.soramimi.jp/avater.jpg, link:https://github.com/soramimi, size:256, fee:5, amount:12] +[sponsor name:Agate Pris様, fee:5, amount:12] + [sponsor name:odan様, img:https://odan.dev/icon.jpeg, link:https://opencollective.com/odan, size:320, fee:50, amount:1, period:2024-06-05] [sponsor name:unagi様, img:https://www.unagiworks.net/blog/wp-content/uploads/2019/01/logo.gif, fee:50, amount:1, period:2025-07-02] From 47a5703c92ab58bb27c33297e3eabae5cc2642c8 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 5 Jun 2025 12:56:00 +0900 Subject: [PATCH 1873/3948] =?UTF-8?q?sstream:=20=E4=B8=8D=E8=B6=B3?= =?UTF-8?q?=E3=81=97=E3=81=A6=E3=81=84=E3=81=9F=E4=BE=8B=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/sstream/basic_istringstream/str.md | 43 +++++++++++++++ reference/sstream/basic_ostringstream.md | 25 ++++++++- reference/sstream/basic_ostringstream/str.md | 43 ++++++++++++++- reference/sstream/basic_stringbuf.md | 58 ++++++++++++++++++++ reference/sstream/basic_stringbuf/str.md | 55 +++++++++++++++++++ reference/sstream/basic_stringstream.md | 49 ++++++++++++++++- reference/sstream/basic_stringstream/str.md | 44 +++++++++++++++ 7 files changed, 314 insertions(+), 3 deletions(-) diff --git a/reference/sstream/basic_istringstream/str.md b/reference/sstream/basic_istringstream/str.md index fae012a552..090f76f192 100644 --- a/reference/sstream/basic_istringstream/str.md +++ b/reference/sstream/basic_istringstream/str.md @@ -32,6 +32,49 @@ void str(const basic_string&& s); // (6) C++20 - (5) : `rdbuf()->str(s)` と等価 - (6) : `rdbuf()->str(std::move(s))` と等価 +## 例 +```cpp example +#include +#include +#include + +int main() +{ + // 文字列の取得 + std::istringstream iss("Hello World 123 45.67"); + std::cout << "Content: " << iss.str() << std::endl; + + // 一部を読み取っても、str()は全体を返す + std::string word; + iss >> word; + std::cout << "Read word: " << word << std::endl; + std::cout << "Full content: " << iss.str() << std::endl; + + // 新しい文字列を設定 + iss.str("New content 999"); + iss.clear(); // エラーフラグをクリア + + // 新しい内容から読み取り + std::string s1, s2; + int num; + iss >> s1 >> s2 >> num; + std::cout << "New read: " << s1 << " " << s2 << " " << num << std::endl; + + // 空文字列を設定してリセット + iss.str(""); + std::cout << "Empty? " << (iss.str().empty() ? "yes" : "no") << std::endl; +} +``` + +### 出力 +``` +Content: Hello World 123 45.67 +Read word: Hello +Full content: Hello World 123 45.67 +New read: New content 999 +Empty? yes +``` + ## 関連項目 - [`basic_stringbuf::str`](../basic_stringbuf/str.md) diff --git a/reference/sstream/basic_ostringstream.md b/reference/sstream/basic_ostringstream.md index 3d5aed8ed8..e14486acbf 100644 --- a/reference/sstream/basic_ostringstream.md +++ b/reference/sstream/basic_ostringstream.md @@ -53,11 +53,34 @@ namespace std { | `allocator_type` | テンプレート仮引数`Allocator` | | ## 例 -```cpp +```cpp example +#include +#include +#include + +int main() +{ + std::ostringstream oss; + + // 数値や文字列を書き込む + oss << "The answer is " << 42 << " and pi is approximately " << 3.14; + + // 文字列として取得 + std::string result = oss.str(); + std::cout << result << std::endl; + + // バッファをクリアして新しい内容を書き込む + oss.str(""); + oss << "New content: " << 123.456; + std::cout << oss.str() << std::endl; +} ``` +* oss.str[link basic_ostringstream/str.md] ### 出力 ``` +The answer is 42 and pi is approximately 3.14 +New content: 123.456 ``` ## 参照 diff --git a/reference/sstream/basic_ostringstream/str.md b/reference/sstream/basic_ostringstream/str.md index 0412ec5401..e8d2d32588 100644 --- a/reference/sstream/basic_ostringstream/str.md +++ b/reference/sstream/basic_ostringstream/str.md @@ -33,5 +33,46 @@ void str(const basic_string&& s); // (6) C++20 - (5) : `rdbuf()->str(s)` と等価 - (6) : `rdbuf()->str(std::move(s))` と等価 +## 例 +```cpp example +#include +#include +#include + +int main() +{ + // 文字列の取得 + std::ostringstream oss; + oss << "Hello " << 123 << " World"; + std::cout << "Content: " << oss.str() << std::endl; + + // 追記モード + oss << " + more"; + std::cout << "After append: " << oss.str() << std::endl; + + // 新しい文字列を設定(内容を置き換える) + oss.str("Reset content"); + std::cout << "After reset: " << oss.str() << std::endl; + + // 書き込み位置は先頭にリセットされる + oss << "!!"; + std::cout << "After write: " << oss.str() << std::endl; + + // 空文字列でクリア + oss.str(""); + oss << "Fresh start"; + std::cout << "Final: " << oss.str() << std::endl; +} +``` + +### 出力 +``` +Content: Hello 123 World +After append: Hello 123 World + more +After reset: Reset content +After write: !!set content +Final: Fresh start +``` + ## 関連項目 -[basic_stringbuf::str](../basic_stringbuf/str.md) +- [`basic_stringbuf::str`](../basic_stringbuf/str.md) diff --git a/reference/sstream/basic_stringbuf.md b/reference/sstream/basic_stringbuf.md index 76ac70b0e9..0c2f2a467d 100644 --- a/reference/sstream/basic_stringbuf.md +++ b/reference/sstream/basic_stringbuf.md @@ -53,5 +53,63 @@ namespace std { | `allocator_type` | テンプレート仮引数`Allocator` | | +## 例 +```cpp example +#include +#include +#include +#include + +int main() +{ + // basic_stringbufはストリームの内部バッファとして動作する + std::stringbuf buf; + + // 書き込み: sputc()で1文字ずつ書き込む + buf.sputc('H'); + buf.sputc('e'); + buf.sputc('l'); + buf.sputc('l'); + buf.sputc('o'); + + // 文字列として取得 + std::cout << "Written: " << buf.str() << std::endl; + + // 新しい文字列を設定 + buf.str("World"); + + // 読み取り: sbumpc()で1文字ずつ読み取る + std::cout << "Read: "; + while (buf.in_avail() > 0) { + char c = buf.sbumpc(); + std::cout << c; + } + std::cout << std::endl; + + // sputn()で文字列を一度に書き込む + buf.str(""); // バッファをクリア + const char* message = "Hello, World!"; + buf.sputn(message, std::strlen(message)); + + // C++20以降: view()で文字列ビューとして取得 + // std::string_view sv = buf.view(); + // std::cout << "View: " << sv << std::endl; + + std::cout << "Final: " << buf.str() << std::endl; +} +``` +* sputc[link /reference/streambuf/basic_streambuf/sputc.md] +* sbumpc[link /reference/streambuf/basic_streambuf/sbumpc.md] +* in_avail[link /reference/streambuf/basic_streambuf/in_avail.md] +* sputn[link /reference/streambuf/basic_streambuf/sputn.md] +* str[link basic_stringbuf/str.md] + +### 出力 +``` +Written: Hello +Read: World +Final: Hello, World! +``` + ## 参照 - [P0408R7 Efficient Access to `basic_stringbuf`’s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) diff --git a/reference/sstream/basic_stringbuf/str.md b/reference/sstream/basic_stringbuf/str.md index 4f7b917045..3b05fee010 100644 --- a/reference/sstream/basic_stringbuf/str.md +++ b/reference/sstream/basic_stringbuf/str.md @@ -32,3 +32,58 @@ void str(const basic_string&& s); // (6) C++20 - (4) : 文字列オブジェクト`s`を設定する - (5) : `SAlloc`型のアロケータによって確保されているデータをコピーして、文字列オブジェクト`s`を設定する - (6) : 与えられた文字列オブジェクト`s`をムーブして設定する + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + // 文字列の取得 + std::stringbuf buf; + buf.sputn("Hello, World!", 13); + std::cout << "1: " << buf.str() << std::endl; + + // 文字列の設定 + buf.str("New content"); + std::cout << "2: " << buf.str() << std::endl; + + // 読み書き位置のリセット + buf.str("Read/Write test"); + + // 読み取り + char ch; + ch = buf.sbumpc(); // 'R' + ch = buf.sbumpc(); // 'e' + std::cout << "3: After reading 2 chars: " << buf.str() << std::endl; + + // 書き込み(現在の位置から) + buf.sputc('X'); + buf.sputc('Y'); + std::cout << "4: After writing: " << buf.str() << std::endl; + + // C++20: ムーブによる設定 + std::string s = "Move test"; + buf.str(std::move(s)); + std::cout << "5: " << buf.str() << std::endl; + + // 空文字列でクリア + buf.str(""); + std::cout << "6: Empty? " << (buf.str().empty() ? "yes" : "no") << std::endl; +} +``` +* sputn[link /reference/streambuf/basic_streambuf/sputn.md] +* sbumpc[link /reference/streambuf/basic_streambuf/sbumpc.md] +* sputc[link /reference/streambuf/basic_streambuf/sputc.md] + +### 出力 +``` +1: Hello, World! +2: New content +3: After reading 2 chars: Read/Write test +4: After writing: ReXY/Write test +5: Move test +6: Empty? yes +``` diff --git a/reference/sstream/basic_stringstream.md b/reference/sstream/basic_stringstream.md index b10e7a68e6..1557bc7633 100644 --- a/reference/sstream/basic_stringstream.md +++ b/reference/sstream/basic_stringstream.md @@ -53,11 +53,58 @@ namespace std { | `allocator_type` | テンプレート仮引数`Allocator` | | ## 例 -```cpp +```cpp example +#include +#include +#include + +int main() +{ + // 読み取りと書き込みが可能なストリーム + std::stringstream ss; + + // データを書き込む + ss << "Hello " << 123 << " World " << 45.67; + + // 文字列として取得 + std::cout << "Content: " << ss.str() << std::endl; + + // 読み取り位置をリセット + ss.seekg(0); + + // データを読み取る + std::string word1, word3; + int num1; + double num2; + + ss >> word1 >> num1 >> word3 >> num2; + + std::cout << "Read: word1=" << word1 + << ", num1=" << num1 + << ", word3=" << word3 + << ", num2=" << num2 << std::endl; + + // 新しい内容でリセット + ss.str("42 3.14159 test"); + ss.clear(); // エラーフラグをクリア + + int value; + double pi; + std::string text; + ss >> value >> pi >> text; + + std::cout << "New data: " << value << ", " << pi << ", " << text << std::endl; +} ``` +* ss.str[link basic_stringstream/str.md] +* ss.seekg[link /reference/istream/basic_istream/seekg.md] +* ss.clear[link /reference/ios/basic_ios/clear.md] ### 出力 ``` +Content: Hello 123 World 45.67 +Read: word1=Hello, num1=123, word3=World, num2=45.67 +New data: 42, 3.14159, test ``` ## 参照 diff --git a/reference/sstream/basic_stringstream/str.md b/reference/sstream/basic_stringstream/str.md index 72e0f5b0fa..7c4b542b3c 100644 --- a/reference/sstream/basic_stringstream/str.md +++ b/reference/sstream/basic_stringstream/str.md @@ -33,5 +33,49 @@ void str(const basic_string&& s); // (6) C++20 - (5) : `rdbuf()->str(s)` と等価 - (6) : `rdbuf()->str(std::move(s))` と等価 +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::stringstream ss; + + // 文字列を設定 + ss.str("initial content"); + std::cout << "1: " << ss.str() << std::endl; + + // ストリームに追記 + ss << " + added"; + std::cout << "2: " << ss.str() << std::endl; + + // 新しい文字列で置き換え + ss.str("new content"); + std::cout << "3: " << ss.str() << std::endl; + + // 読み取り位置に注意 + std::string word; + ss >> word; // "new"を読む + std::cout << "Read: " << word << std::endl; + std::cout << "4: " << ss.str() << std::endl; // 全体は変わらない + + // 空文字列でクリア + ss.str(""); + std::cout << "5: Empty? " << (ss.str().empty() ? "yes" : "no") << std::endl; +} +``` + +### 出力 +``` +1: initial content +2: initial content + added +3: new content +Read: new +4: new content +5: Empty? yes +``` + ## 関連項目 - [`basic_stringbuf::str`](../basic_stringbuf/str.md) From d9fff1aa54f0134b841eaf56b2a74baca8478c9e Mon Sep 17 00:00:00 2001 From: suomesta Date: Thu, 5 Jun 2025 20:11:19 +0900 Subject: [PATCH 1874/3948] fix typo in basic_istream --- reference/istream/basic_istream/op_istream_free.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/istream/basic_istream/op_istream_free.md b/reference/istream/basic_istream/op_istream_free.md index 1dc60946e1..152d4f5f02 100644 --- a/reference/istream/basic_istream/op_istream_free.md +++ b/reference/istream/basic_istream/op_istream_free.md @@ -88,7 +88,7 @@ namespace std { ## 戻り値 -`*this` +`is` ## 例(文字列) From 1a53cfe9f233ee2fd70f96ff186f7c04ab38a160 Mon Sep 17 00:00:00 2001 From: suomesta Date: Thu, 5 Jun 2025 20:23:01 +0900 Subject: [PATCH 1875/3948] add sample to std::ws --- reference/istream/ws.md | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/reference/istream/ws.md b/reference/istream/ws.md index c523930baf..58dea186d3 100644 --- a/reference/istream/ws.md +++ b/reference/istream/ws.md @@ -24,13 +24,36 @@ namespace std { `is` ## 例 -TBD +```cpp +#include +#include +#include + +int main() { + // マニピュレータとして使用 + { + std::istringstream ss(" 42"); + std::string line; + std::getline(ss >> std::ws, line); + std::cout << line << std::endl; // "42" + } + + // 関数として使用(通常はしない) + { + std::istringstream ss(" 42"); + std::cout << ss.tellg() << std::endl; // "0" + std::ws(ss); + std::cout << ss.tellg() << std::endl; // "3" + } +} +``` ### 出力 -TBD - -## 実装例 -TBD +``` +42 +0 +3 +``` ## バージョン ### 言語 From 67160f5f8b23448c7a71e7a0001c79de190ec5a5 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 6 Jun 2025 10:38:25 +0900 Subject: [PATCH 1876/3948] =?UTF-8?q?ws=20:=20=E3=82=B5=E3=83=B3=E3=83=97?= =?UTF-8?q?=E3=83=AB=E3=82=B3=E3=83=BC=E3=83=89=E3=81=AE=E3=82=A4=E3=83=B3?= =?UTF-8?q?=E3=83=87=E3=83=B3=E3=83=88=E3=82=924=E2=86=922=E3=81=AB?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/istream/ws.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/reference/istream/ws.md b/reference/istream/ws.md index 58dea186d3..7e59b2c560 100644 --- a/reference/istream/ws.md +++ b/reference/istream/ws.md @@ -30,21 +30,21 @@ namespace std { #include int main() { - // マニピュレータとして使用 - { - std::istringstream ss(" 42"); - std::string line; - std::getline(ss >> std::ws, line); - std::cout << line << std::endl; // "42" - } - - // 関数として使用(通常はしない) - { - std::istringstream ss(" 42"); - std::cout << ss.tellg() << std::endl; // "0" - std::ws(ss); - std::cout << ss.tellg() << std::endl; // "3" - } + // マニピュレータとして使用 + { + std::istringstream ss(" 42"); + std::string line; + std::getline(ss >> std::ws, line); + std::cout << line << std::endl; // "42" + } + + // 関数として使用(通常はしない) + { + std::istringstream ss(" 42"); + std::cout << ss.tellg() << std::endl; // "0" + std::ws(ss); + std::cout << ss.tellg() << std::endl; // "3" + } } ``` From 128604dd6229da84c06238db27e64b5a94c00a0d Mon Sep 17 00:00:00 2001 From: yoh Date: Sun, 8 Jun 2025 20:02:22 +0900 Subject: [PATCH 1877/3948] execution/execution_policy: add inner link --- reference/execution/execution/execution_policy.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/execution/execution/execution_policy.md b/reference/execution/execution/execution_policy.md index 3a546b20d8..a9d078547e 100644 --- a/reference/execution/execution/execution_policy.md +++ b/reference/execution/execution/execution_policy.md @@ -162,7 +162,7 @@ int main() * std::execution::par[color ff0000] * std::execution::par_unseq[color ff0000] * count.load[link /reference/atomic/atomic/load.md] -* is_always_lock_free[link /reference/atomic/atomic/is_always_lock_free.md.nolink] +* is_always_lock_free[link /reference/atomic/atomic.md] #### 出力例 ``` From 97ddfcb3c48bbce35daaac6244cb31af4982c2ca Mon Sep 17 00:00:00 2001 From: yoh Date: Sun, 8 Jun 2025 21:43:49 +0900 Subject: [PATCH 1878/3948] stop_token: fix inner links --- reference/stop_token/inplace_stop_callback.md | 2 +- reference/stop_token/stop_callback.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/stop_token/inplace_stop_callback.md b/reference/stop_token/inplace_stop_callback.md index b66c5b516c..32794afac5 100644 --- a/reference/stop_token/inplace_stop_callback.md +++ b/reference/stop_token/inplace_stop_callback.md @@ -16,7 +16,7 @@ namespace std { ## 適格要件 -テンプレート引数`CallbackFn`が[`invocable`](/reference/concepts/invokable.md.nolink)および[`destructible`](/reference/concepts/destructible.md)を満たすこと。 +テンプレート引数`CallbackFn`が[`invocable`](/reference/concepts/invocable.md)および[`destructible`](/reference/concepts/destructible.md)を満たすこと。 ## メンバ関数 diff --git a/reference/stop_token/stop_callback.md b/reference/stop_token/stop_callback.md index bea16a99e9..c6a4090da6 100644 --- a/reference/stop_token/stop_callback.md +++ b/reference/stop_token/stop_callback.md @@ -16,7 +16,7 @@ namespace std { ## 適格要件 -テンプレート引数`CallbackFn`が[`invocable`](/reference/concepts/invokable.md.nolink)および[`destructible`](/reference/concepts/destructible.md)を満たすこと。 +テンプレート引数`CallbackFn`が[`invocable`](/reference/concepts/invocable.md)および[`destructible`](/reference/concepts/destructible.md)を満たすこと。 ## メンバ関数 From 1142f7967bc51e2ddf1de8042624e7265a03af53 Mon Sep 17 00:00:00 2001 From: yoh Date: Sun, 8 Jun 2025 22:10:12 +0900 Subject: [PATCH 1879/3948] iterator/projected_value_t: add inner link --- reference/iterator/projected_value_t.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/iterator/projected_value_t.md b/reference/iterator/projected_value_t.md index 241752afb5..700435a980 100644 --- a/reference/iterator/projected_value_t.md +++ b/reference/iterator/projected_value_t.md @@ -12,7 +12,7 @@ namespace std { } ``` * indirectly_readable[link /reference/iterator/indirectly_readable.md] -* indirectly_regular_unary_invocable[link /reference/iterator/indirectly_regular_unary_invocable.md.nolink] +* indirectly_regular_unary_invocable[link /reference/iterator/indirectly_unary_invocable.md] ## 概要 イテレータ型`I`が指す値型を取得する。 From d7d9887e3ef106a0c7afeec8f8362e34a8d04379 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sun, 8 Jun 2025 22:22:14 +0900 Subject: [PATCH 1880/3948] =?UTF-8?q?typo=E4=BF=AE=E6=AD=A3=E3=81=A8NG?= =?UTF-8?q?=E3=83=AF=E3=83=BC=E3=83=89=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/script/ngword_check.py | 2 ++ reference/execution/execution/as_awaitable.md | 2 +- reference/execution/execution/split.md | 2 +- .../execution/execution/transform_completion_signatures.md | 2 +- .../execution/execution/transform_completion_signatures_of.md | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/script/ngword_check.py b/.github/workflows/script/ngword_check.py index 94e3843469..8b0349219a 100644 --- a/.github/workflows/script/ngword_check.py +++ b/.github/workflows/script/ngword_check.py @@ -19,6 +19,7 @@ ("", "Doamin", "Domain"), ("", "eror", "error"), ("", "enumrate", "enumerate"), + ("", "exectution", "execution"), ("", "expceted", "expected"), ("", "exposion", "exposition"), ("", "functon", "function"), @@ -33,6 +34,7 @@ ("", "protmise_type", "promise_type"), ("", "pvalue", "prvalue"), ("", "Recevier", "Receiver"), + ("", "reciever", "receiver"), ("", "refernce", "reference"), ("", "repear", "repeat"), ("", "staitc", "static"), diff --git a/reference/execution/execution/as_awaitable.md b/reference/execution/execution/as_awaitable.md index 9b758ed05f..9ed3e13812 100644 --- a/reference/execution/execution/as_awaitable.md +++ b/reference/execution/execution/as_awaitable.md @@ -120,7 +120,7 @@ struct awaitable-receiver { * coroutine_handle[link /reference/coroutine/coroutine_handle.md] * see below[italic] -説明用の式`rcvr`を`awaitable-reciever`型の右辺値、`crcvr`を`rcvr`をconst参照する左辺値、`vs`を式パック、`err`を`Err`型の式とする。このとき +説明用の式`rcvr`を`awaitable-receiver`型の右辺値、`crcvr`を`rcvr`をconst参照する左辺値、`vs`を式パック、`err`を`Err`型の式とする。このとき - [`constructible_from`](/reference/concepts/constructible_from.md)``を満たすとき、式[`set_value`](set_value.md)`(rcvr, vs...)`は下記と等価。そうでなければ、式`set_value(rcvr, vs...)`は不適格となる。 diff --git a/reference/execution/execution/split.md b/reference/execution/execution/split.md index 3117c5e3b1..06a180de1e 100644 --- a/reference/execution/execution/split.md +++ b/reference/execution/execution/split.md @@ -301,7 +301,7 @@ explicit shared-state(Sndr&& sndr); void start-op() noexcept; ``` -- 効果 : `inc-ref()`を評価する。`stop_src.`[`stop_requested()`](/reference/stop_token/inplace_stop_source/stop_requested.md) `== ture`のとき`notify()`を評価する。そうでなければ、[`start`](start.md)`(op_state)`を評価する。 +- 効果 : `inc-ref()`を評価する。`stop_src.`[`stop_requested()`](/reference/stop_token/inplace_stop_source/stop_requested.md) `== true`のとき`notify()`を評価する。そうでなければ、[`start`](start.md)`(op_state)`を評価する。 ```cpp void notify() noexcept; diff --git a/reference/execution/execution/transform_completion_signatures.md b/reference/execution/execution/transform_completion_signatures.md index 072b2da5da..23fd1d7ab2 100644 --- a/reference/execution/execution/transform_completion_signatures.md +++ b/reference/execution/execution/transform_completion_signatures.md @@ -5,7 +5,7 @@ * cpp26[meta cpp] ```cpp -namespace std::exectution { +namespace std::execution { template< valid-completion-signatures InputSignatures, valid-completion-signatures AdditionalSignatures = completion_signatures<>, diff --git a/reference/execution/execution/transform_completion_signatures_of.md b/reference/execution/execution/transform_completion_signatures_of.md index 84e1c6dbf8..9894aa959c 100644 --- a/reference/execution/execution/transform_completion_signatures_of.md +++ b/reference/execution/execution/transform_completion_signatures_of.md @@ -5,7 +5,7 @@ * cpp26[meta cpp] ```cpp -namespace std::exectution { +namespace std::execution { template< sender Sndr, class Env = env<>, From 0587fce8e2443f498a66200e36ffb45a54d3b591 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 9 Jun 2025 17:31:47 +0900 Subject: [PATCH 1881/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E5=88=87?= =?UTF-8?q?=E3=82=8C=E3=82=92=E4=BF=AE=E6=AD=A3=20#1454?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ..._dynamic_cast_polymorphic_typeid_in_constant_expressions.md | 1 - reference/ranges/owning_view/base.md | 3 --- reference/ranges/owning_view/begin.md | 3 --- reference/ranges/owning_view/data.md | 3 --- reference/ranges/owning_view/empty.md | 3 --- reference/ranges/owning_view/end.md | 3 --- reference/ranges/owning_view/op_constructor.md | 3 --- reference/ranges/owning_view/size.md | 3 --- 8 files changed, 22 deletions(-) diff --git a/lang/cpp20/allowing_dynamic_cast_polymorphic_typeid_in_constant_expressions.md b/lang/cpp20/allowing_dynamic_cast_polymorphic_typeid_in_constant_expressions.md index 723cff331a..309c3d4fd7 100644 --- a/lang/cpp20/allowing_dynamic_cast_polymorphic_typeid_in_constant_expressions.md +++ b/lang/cpp20/allowing_dynamic_cast_polymorphic_typeid_in_constant_expressions.md @@ -111,4 +111,3 @@ false - [P1327R1 Allowing dynamic_cast, polymorphic typeid in Constant Expressions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1327r1.html) - [P1328R0 Making std::type_info::operator== constexpr](https://wg21.link/P1328) -- [P1328 Making std::type_info::operator== constexpr - cplusplus/papers](https://github.com/cplusplus/papers/issues/70) \ No newline at end of file diff --git a/reference/ranges/owning_view/base.md b/reference/ranges/owning_view/base.md index f421da1f93..9b8e6527a0 100644 --- a/reference/ranges/owning_view/base.md +++ b/reference/ranges/owning_view/base.md @@ -65,6 +65,3 @@ moved base size: 5 - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] - -## 参照 -- [N4892 24.7.3 All view](https://timsong-cpp.github.io/cppwp/n4892/range.all) \ No newline at end of file diff --git a/reference/ranges/owning_view/begin.md b/reference/ranges/owning_view/begin.md index e98a03906c..14171db805 100644 --- a/reference/ranges/owning_view/begin.md +++ b/reference/ranges/owning_view/begin.md @@ -57,6 +57,3 @@ const first element: 1 - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] - -## 参照 -- [N4892 24.7.3 All view](https://timsong-cpp.github.io/cppwp/n4892/range.all) \ No newline at end of file diff --git a/reference/ranges/owning_view/data.md b/reference/ranges/owning_view/data.md index e29ef9c028..22d0f34470 100644 --- a/reference/ranges/owning_view/data.md +++ b/reference/ranges/owning_view/data.md @@ -65,6 +65,3 @@ const first element via data(): 1 - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] - -## 参照 -- [N4892 24.7.3 All view](https://timsong-cpp.github.io/cppwp/n4892/range.all) \ No newline at end of file diff --git a/reference/ranges/owning_view/empty.md b/reference/ranges/owning_view/empty.md index f6064a5521..51bb3933b3 100644 --- a/reference/ranges/owning_view/empty.md +++ b/reference/ranges/owning_view/empty.md @@ -59,6 +59,3 @@ non-empty vector: 0 - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] - -## 参照 -- [N4892 24.7.3 All view](https://timsong-cpp.github.io/cppwp/n4892/range.all) \ No newline at end of file diff --git a/reference/ranges/owning_view/end.md b/reference/ranges/owning_view/end.md index 285c4b73e3..b4562738c5 100644 --- a/reference/ranges/owning_view/end.md +++ b/reference/ranges/owning_view/end.md @@ -55,6 +55,3 @@ int main() { - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] - -## 参照 -- [N4892 24.7.3 All view](https://timsong-cpp.github.io/cppwp/n4892/range.all) \ No newline at end of file diff --git a/reference/ranges/owning_view/op_constructor.md b/reference/ranges/owning_view/op_constructor.md index 096fd83e29..e9f72598a9 100644 --- a/reference/ranges/owning_view/op_constructor.md +++ b/reference/ranges/owning_view/op_constructor.md @@ -80,6 +80,3 @@ int main() { - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] - -## 参照 -- [N4892 24.7.3 All view](https://timsong-cpp.github.io/cppwp/n4892/range.all) \ No newline at end of file diff --git a/reference/ranges/owning_view/size.md b/reference/ranges/owning_view/size.md index 6620b6186b..ada1abbcde 100644 --- a/reference/ranges/owning_view/size.md +++ b/reference/ranges/owning_view/size.md @@ -60,6 +60,3 @@ const size: 5 - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] - -## 参照 -- [N4892 24.7.3 All view](https://timsong-cpp.github.io/cppwp/n4892/range.all) \ No newline at end of file From 919efc3d014f37d4b4de910db6ccf49c8e978575 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Wed, 11 Jun 2025 23:15:20 +0900 Subject: [PATCH 1882/3948] =?UTF-8?q?=E3=82=AF=E3=83=A9=E3=82=B9=E5=AE=9A?= =?UTF-8?q?=E7=BE=A9=E3=81=AE=E5=BE=8C=E3=81=AE=E3=82=BB=E3=83=9F=E3=82=B3?= =?UTF-8?q?=E3=83=AD=E3=83=B3=E5=BF=98=E3=82=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp11/override_final.md | 2 +- lang/cpp17/guaranteed_copy_elision.md | 2 +- lang/cpp20/constinit.md | 4 ++-- lang/cpp20/more_constexpr_containers.md | 2 +- lang/future/contract-based_programming.md | 2 +- reference/array/array/tuple_element.md | 2 +- reference/contracts/assertion_kind.md | 2 +- reference/contracts/contract_violation.md | 2 +- reference/contracts/detection_mode.md | 2 +- reference/contracts/evaluation_semantic.md | 2 +- reference/locale/moneypunct_byname.md | 2 +- reference/type_traits/unwrap_reference.md | 4 ++-- reference/vector/vector.md | 2 +- 13 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lang/cpp11/override_final.md b/lang/cpp11/override_final.md index a1d082e0af..17cc8b6629 100644 --- a/lang/cpp11/override_final.md +++ b/lang/cpp11/override_final.md @@ -42,7 +42,7 @@ class-head: ```cpp class derived_class final : public base_class { ... -} +}; ``` また、メンバ変数やメンバ関数の名前以降(member-declarator)は下記の文法となる: diff --git a/lang/cpp17/guaranteed_copy_elision.md b/lang/cpp17/guaranteed_copy_elision.md index c11f847d88..95d86a6a04 100644 --- a/lang/cpp17/guaranteed_copy_elision.md +++ b/lang/cpp17/guaranteed_copy_elision.md @@ -25,7 +25,7 @@ Temporary materialization conversion 例: ```cpp -struct X { int n; } +struct X { int n; }; int k = X().n; // ok, X() prvalue は xvalue に変換される ``` diff --git a/lang/cpp20/constinit.md b/lang/cpp20/constinit.md index 3997d19d83..5f49c34e86 100644 --- a/lang/cpp20/constinit.md +++ b/lang/cpp20/constinit.md @@ -77,7 +77,7 @@ int main () { ```cpp struct S { constinit int n; // NG -} +}; int main() { constinit int m = 10; // NG @@ -91,7 +91,7 @@ constinit extern int N; // NG、未定義動作、何も言われない struct S { constinit static int M; -} +}; int S::M = 12; // NG、constinitはこちらに必要、おそらく警告が発せられる ``` diff --git a/lang/cpp20/more_constexpr_containers.md b/lang/cpp20/more_constexpr_containers.md index a693e3c5b0..36010cc6e6 100644 --- a/lang/cpp20/more_constexpr_containers.md +++ b/lang/cpp20/more_constexpr_containers.md @@ -313,7 +313,7 @@ struct sample { } m_alloc.deallocate(m_p, m_size); } -} +}; constexpr sample str{"Hello."}; // 実行時、strは"Hello"を保持する静的配列を参照するようになる diff --git a/lang/future/contract-based_programming.md b/lang/future/contract-based_programming.md index 4d05db8c7f..63857ab27f 100644 --- a/lang/future/contract-based_programming.md +++ b/lang/future/contract-based_programming.md @@ -247,7 +247,7 @@ struct derived : base { int g(int n) override { return -1; } -} +}; ``` ## この機能が必要になった背景・経緯 diff --git a/reference/array/array/tuple_element.md b/reference/array/array/tuple_element.md index feeec4060e..94b4c2daaf 100644 --- a/reference/array/array/tuple_element.md +++ b/reference/array/array/tuple_element.md @@ -12,7 +12,7 @@ namespace std { struct tuple_element> { static_assert(I < N, implementation-defined); using type = T; - } + }; } ``` diff --git a/reference/contracts/assertion_kind.md b/reference/contracts/assertion_kind.md index 4388063e7c..8b4d2768d5 100644 --- a/reference/contracts/assertion_kind.md +++ b/reference/contracts/assertion_kind.md @@ -10,7 +10,7 @@ namespace std::contracts { pre = 1, post = 2, assertion = 3 - } + }; } ``` diff --git a/reference/contracts/contract_violation.md b/reference/contracts/contract_violation.md index b09eb93359..9f182bd021 100644 --- a/reference/contracts/contract_violation.md +++ b/reference/contracts/contract_violation.md @@ -15,7 +15,7 @@ namespace std::contracts { assertion_kind kind() const noexcept; source_location location() const noexcept; evaluation_semantic semantic() const noexcept; - } + }; } ``` diff --git a/reference/contracts/detection_mode.md b/reference/contracts/detection_mode.md index 6e3c9ecc09..31c740bb2c 100644 --- a/reference/contracts/detection_mode.md +++ b/reference/contracts/detection_mode.md @@ -9,7 +9,7 @@ namespace std::contracts { enum class detection_mode : unspecified { predicate_false = 1, evaluation_exception = 2 - } + }; } ``` diff --git a/reference/contracts/evaluation_semantic.md b/reference/contracts/evaluation_semantic.md index 28d381cc21..de7316cd52 100644 --- a/reference/contracts/evaluation_semantic.md +++ b/reference/contracts/evaluation_semantic.md @@ -12,7 +12,7 @@ namespace std::contracts { enforce = 3, quick_enforce = 4 // , // assume = 5 <-- 将来追加予定 - } + }; } ``` diff --git a/reference/locale/moneypunct_byname.md b/reference/locale/moneypunct_byname.md index 96b158b312..74ebb768c6 100644 --- a/reference/locale/moneypunct_byname.md +++ b/reference/locale/moneypunct_byname.md @@ -6,7 +6,7 @@ ```cpp namespace std { template - class moneypunct_byname : public moneypunct + class moneypunct_byname : public moneypunct; } ``` * moneypunct[link /reference/locale/moneypunct.md] diff --git a/reference/type_traits/unwrap_reference.md b/reference/type_traits/unwrap_reference.md index a870b356b3..70ec485ce7 100644 --- a/reference/type_traits/unwrap_reference.md +++ b/reference/type_traits/unwrap_reference.md @@ -85,10 +85,10 @@ int main() ```cpp namespace std { template - struct unwrap_reference { using type = T; } + struct unwrap_reference { using type = T; }; template - struct unwrap_reference> { using type = T&; } + struct unwrap_reference> { using type = T&; }; } ``` * reference_wrapper[link /reference/functional/reference_wrapper.md] diff --git a/reference/vector/vector.md b/reference/vector/vector.md index c98058e9b3..3e9eaa8c85 100644 --- a/reference/vector/vector.md +++ b/reference/vector/vector.md @@ -193,7 +193,7 @@ public: constexpr reference& operator=(const reference& x) noexcept; // vectorのビットからの代入 constexpr const reference& operator=(bool x) const noexcept; // *thisがconst時のboolからの代入(C++23) constexpr void flip() noexcept; // ビットの反転 -} +}; ``` ### ハッシュサポート From ece3ce92ab8fd0548216b50582023ed6963ac309 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Wed, 11 Jun 2025 23:18:15 +0900 Subject: [PATCH 1883/3948] =?UTF-8?q?=E5=AF=BE=E5=BF=9C=E3=81=97=E3=81=AA?= =?UTF-8?q?=E3=81=84=E6=B3=A2=E3=82=AB=E3=83=83=E3=82=B3=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/atomic/atomic_exchange_explicit.md | 2 +- reference/bitset/bitset/reference.md | 1 + reference/chrono/clock_time_conversion.md | 1 + reference/flat_map/flat_map/op_deduction_guide.md | 1 + reference/flat_map/flat_multimap/op_deduction_guide.md | 1 + reference/flat_set/flat_multiset/op_deduction_guide.md | 1 + reference/flat_set/flat_set/op_deduction_guide.md | 1 + reference/format/formattable.md | 3 +-- reference/linalg/is-mdspan.md | 1 - reference/ranges/ref_view/begin.md | 1 + reference/ranges/ref_view/end.md | 1 + reference/stacktrace/basic_stacktrace/op_ostream.md | 1 + reference/stacktrace/stacktrace_entry/op_ostream.md | 1 + 13 files changed, 12 insertions(+), 4 deletions(-) diff --git a/reference/atomic/atomic_exchange_explicit.md b/reference/atomic/atomic_exchange_explicit.md index 47be113b6d..abf282734d 100644 --- a/reference/atomic/atomic_exchange_explicit.md +++ b/reference/atomic/atomic_exchange_explicit.md @@ -37,7 +37,7 @@ namespace std { atomic* object, typename atomic::value_type desired, memory_order order) noexcept; // (2) C++26 -] +} ``` * atomic[link atomic.md] * memory_order[link memory_order.md] diff --git a/reference/bitset/bitset/reference.md b/reference/bitset/bitset/reference.md index 76add68b88..13ff26a29f 100644 --- a/reference/bitset/bitset/reference.md +++ b/reference/bitset/bitset/reference.md @@ -21,6 +21,7 @@ namespace std { CONSTEXPR reference& flip() noexcept; }; }; +} ``` * CONSTEXPR[italic] diff --git a/reference/chrono/clock_time_conversion.md b/reference/chrono/clock_time_conversion.md index 7795ba08d1..397054b412 100644 --- a/reference/chrono/clock_time_conversion.md +++ b/reference/chrono/clock_time_conversion.md @@ -16,6 +16,7 @@ namespace std::chrono { template time_point operator()(const time_point& t) const; + }; // (3) C++20 template <> diff --git a/reference/flat_map/flat_map/op_deduction_guide.md b/reference/flat_map/flat_map/op_deduction_guide.md index 3bb63d4d85..7efe3b1fed 100644 --- a/reference/flat_map/flat_map/op_deduction_guide.md +++ b/reference/flat_map/flat_map/op_deduction_guide.md @@ -78,6 +78,7 @@ namespace std { template> flat_map(sorted_unique_t, initializer_list>, Compare = Compare()) -> flat_map; // (12) +} ``` * vector[link /reference/vector/vector.md] * from_range_t[link ../../ranges/from_range_t.md] diff --git a/reference/flat_map/flat_multimap/op_deduction_guide.md b/reference/flat_map/flat_multimap/op_deduction_guide.md index 811665f2a7..8d697687ef 100644 --- a/reference/flat_map/flat_multimap/op_deduction_guide.md +++ b/reference/flat_map/flat_multimap/op_deduction_guide.md @@ -78,6 +78,7 @@ namespace std { template> flat_multimap(sorted_equivalent_t, initializer_list>, Compare = Compare()) -> flat_multimap; // (12) +} ``` * vector[link /reference/vector/vector.md] * from_range_t[link ../../ranges/from_range_t.md] diff --git a/reference/flat_set/flat_multiset/op_deduction_guide.md b/reference/flat_set/flat_multiset/op_deduction_guide.md index 2b1a907c97..a075b7ef1d 100644 --- a/reference/flat_set/flat_multiset/op_deduction_guide.md +++ b/reference/flat_set/flat_multiset/op_deduction_guide.md @@ -66,6 +66,7 @@ namespace std { template> flat_multiset(sorted_equivalent_t, initializer_list, Compare = Compare()) -> flat_multiset; // (12) +} ``` * vector[link /reference/vector/vector.md] * from_range_t[link ../../ranges/from_range_t.md] diff --git a/reference/flat_set/flat_set/op_deduction_guide.md b/reference/flat_set/flat_set/op_deduction_guide.md index cadaca6b29..22f0caa70e 100644 --- a/reference/flat_set/flat_set/op_deduction_guide.md +++ b/reference/flat_set/flat_set/op_deduction_guide.md @@ -66,6 +66,7 @@ namespace std { template> flat_set(sorted_unique_t, initializer_list, Compare = Compare()) -> flat_set; // (12) +} ``` * vector[link /reference/vector/vector.md] * from_range_t[link ../../ranges/from_range_t.md] diff --git a/reference/format/formattable.md b/reference/format/formattable.md index 41989cc60c..82eaaf4475 100644 --- a/reference/format/formattable.md +++ b/reference/format/formattable.md @@ -19,8 +19,7 @@ namespace std { basic_format_parse_context pc) { { f.parse(pc) } -> same_as::iterator>; { cf.format(t, fc) } -> same_as>; - } - }; + }; } ``` * fmt-iter-for[italic] diff --git a/reference/linalg/is-mdspan.md b/reference/linalg/is-mdspan.md index 1079ccc946..3ffdf1d967 100644 --- a/reference/linalg/is-mdspan.md +++ b/reference/linalg/is-mdspan.md @@ -9,7 +9,6 @@ constexpr bool is-mdspan = false; template constexpr bool is-mdspan> = true; -} ``` ## 概要 diff --git a/reference/ranges/ref_view/begin.md b/reference/ranges/ref_view/begin.md index dab222e137..93b7a4f55b 100644 --- a/reference/ranges/ref_view/begin.md +++ b/reference/ranges/ref_view/begin.md @@ -36,6 +36,7 @@ int main() { while (it != end) { std::cout << *it << ' '; ++it; + } } ``` * begin[color ff0000] diff --git a/reference/ranges/ref_view/end.md b/reference/ranges/ref_view/end.md index 4256efda32..2c9d4c7e18 100644 --- a/reference/ranges/ref_view/end.md +++ b/reference/ranges/ref_view/end.md @@ -39,6 +39,7 @@ int main() { while (it != end) { std::cout << *it << ' '; ++it; + } } ``` * end[color ff0000] diff --git a/reference/stacktrace/basic_stacktrace/op_ostream.md b/reference/stacktrace/basic_stacktrace/op_ostream.md index 314b09505f..a4651dbbf0 100644 --- a/reference/stacktrace/basic_stacktrace/op_ostream.md +++ b/reference/stacktrace/basic_stacktrace/op_ostream.md @@ -11,6 +11,7 @@ namespace std { basic_ostream& operator<<(basic_ostream& os, const basic_stacktrace& st); +} ``` ## 概要 diff --git a/reference/stacktrace/stacktrace_entry/op_ostream.md b/reference/stacktrace/stacktrace_entry/op_ostream.md index 41769250d5..8b4e77cf87 100644 --- a/reference/stacktrace/stacktrace_entry/op_ostream.md +++ b/reference/stacktrace/stacktrace_entry/op_ostream.md @@ -11,6 +11,7 @@ namespace std { basic_ostream& operator<<(basic_ostream& os, const stacktrace_entry& f); +} ``` ## 概要 From 6a95ccadda2bcfe89cff9116b04ed24a37d11e3b Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Thu, 12 Jun 2025 02:58:26 +0900 Subject: [PATCH 1884/3948] =?UTF-8?q?=E3=82=B0=E3=83=AD=E3=83=BC=E3=83=90?= =?UTF-8?q?=E3=83=AB=E4=BF=AE=E9=A3=BE=E3=81=AE=E3=83=AA=E3=83=B3=E3=82=AF?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index e6c2b2fd66..0c106e8455 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -8,7 +8,7 @@ * synth-three-way[link /reference/exposition-only/synth-three-way-result.md] * [link /reference/algorithm.md] * ExecutionPolicy[link /reference/execution/execution/execution_policy.md] - * ranges::find_if_not[link /reference/algorithm/ranges/find_if_not.md] + * ranges::find_if_not[link /reference/algorithm/ranges_find_if_not.md] * std::copy[link /reference/algorithm/copy.md] * std::copy_n[link /reference/algorithm/copy_n.md] * std::for_each[link /reference/algorithm/for_each.md] @@ -164,7 +164,7 @@ * projected[link /reference/iterator/projected.md] * projected_value_t[link /reference/iterator/projected_value_t.md] * random_access_iterator[link /reference/iterator/random_access_iterator.md] - * ranges::distance[link /reference/iterator/distance.md] + * ranges::distance[link /reference/iterator/ranges_distance.md] * ranges::iter_move[link /reference/iterator/iter_move.md] * ranges::iter_swap[link /reference/iterator/iter_swap.md] * sentinel_for[link /reference/iterator/sentinel_for.md] @@ -270,7 +270,7 @@ * std::span[link /reference/span/span.md] * std::dynamic_extent[link /reference/span/dynamic_extent.md] * [link /reference/sstream.md] - * std::istringstream[link /reference/sstream/basic_istream.md] + * std::istringstream[link /reference/sstream/basic_istringstream.md] * [link /reference/stack.md] * [link /reference/stacktrace.md] * [link /reference/stdexcept.md] From b30cc4611f87d076bd60fe61f3b2df6c4bebb1ce Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 12 Jun 2025 10:43:55 +0900 Subject: [PATCH 1885/3948] =?UTF-8?q?sstream=20:=20=E5=90=84=E3=82=AF?= =?UTF-8?q?=E3=83=A9=E3=82=B9=E3=81=AE=E6=A6=82=E8=A6=81=E3=82=92=E8=A3=9C?= =?UTF-8?q?=E5=BC=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/sstream/basic_istringstream.md | 4 +++- reference/sstream/basic_ostringstream.md | 4 +++- reference/sstream/basic_stringbuf.md | 2 +- reference/sstream/basic_stringstream.md | 4 +++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/reference/sstream/basic_istringstream.md b/reference/sstream/basic_istringstream.md index 8aa37930cf..ebbf02ec14 100644 --- a/reference/sstream/basic_istringstream.md +++ b/reference/sstream/basic_istringstream.md @@ -18,7 +18,9 @@ namespace std { * basic_istream[link /reference/istream/basic_istream.md] ## 概要 -バッファに保持された文字列への読み取り操作ができるストリーム +`std::basic_istringstream`クラスは、文字列を入力元とするストリームであり、文字列からの読み取り操作ができる。 + +このクラスは、内部バッファに文字列を保持し、ストリーム操作で文字列の内容を解析することができる。 ## メンバ関数 diff --git a/reference/sstream/basic_ostringstream.md b/reference/sstream/basic_ostringstream.md index e14486acbf..3e70ab69c2 100644 --- a/reference/sstream/basic_ostringstream.md +++ b/reference/sstream/basic_ostringstream.md @@ -18,7 +18,9 @@ namespace std { * basic_ostream[link /reference/ostream/basic_ostream.md] ## 概要 -バッファに保持された文字列への書き込み操作ができるストリーム +`std::basic_ostringstream`クラスは、文字列への書き込み操作ができる出力ストリームである。 + +このクラスは、内部バッファに文字列を保持し、ストリーム操作で文字列の内容を組み立てることができる。 ## メンバ関数 diff --git a/reference/sstream/basic_stringbuf.md b/reference/sstream/basic_stringbuf.md index 0c2f2a467d..64241ac577 100644 --- a/reference/sstream/basic_stringbuf.md +++ b/reference/sstream/basic_stringbuf.md @@ -18,7 +18,7 @@ namespace std { * basic_streambuf[link /reference/streambuf/basic_streambuf.md] ## 概要 -文字列を保持するストリームバッファ +`std::basic_stringbuf`クラスは、文字列を保持するストリームバッファであり、文字列を読み書きするストレージとして機能する。 ## メンバ関数 diff --git a/reference/sstream/basic_stringstream.md b/reference/sstream/basic_stringstream.md index 1557bc7633..399c3b3b10 100644 --- a/reference/sstream/basic_stringstream.md +++ b/reference/sstream/basic_stringstream.md @@ -18,7 +18,9 @@ namespace std { * basic_iostream[link /reference/istream/basic_iostream.md] ## 概要 -バッファに保持された文字列への読み取りおよび書き込み操作ができるストリーム +`std::basic_stringstream`クラスは、文字列を出力先・入力元とするストリームであり、読み取りと書き込みの両方の操作ができる。 + +このクラスは、内部バッファに文字列を保持し、ストリーム操作で文字列の内容を組み立てたり、文字列内容を解析したりすることができる。 ## メンバ関数 From 9ff68ed23110ce265c33182f4f0e6cb074291660 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 12 Jun 2025 14:54:25 +0900 Subject: [PATCH 1886/3948] =?UTF-8?q?basic=5Fstringbuf=20:=20C++26=20strin?= =?UTF-8?q?g=5Fview=E3=81=AB=E5=AF=BE=E5=BF=9C=20#1186?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sstream/basic_stringbuf/op_constructor.md | 78 +++++++++++++++- reference/sstream/basic_stringbuf/str.md | 91 +++++++++++++++++-- 2 files changed, 156 insertions(+), 13 deletions(-) diff --git a/reference/sstream/basic_stringbuf/op_constructor.md b/reference/sstream/basic_stringbuf/op_constructor.md index ed4659c25d..3e875f918d 100644 --- a/reference/sstream/basic_stringbuf/op_constructor.md +++ b/reference/sstream/basic_stringbuf/op_constructor.md @@ -56,6 +56,23 @@ basic_stringbuf( basic_stringbuf(basic_stringbuf&& rhs); // (11) C++11 basic_stringbuf(basic_stringbuf&& rhs, const Allocator& a); // (12) C++20 + +template +explicit +basic_stringbuf( + const T& t, + ios_base::openmode which = ios_base::in | ios_base::out); // (13) C++26 + +template +basic_stringbuf( + const T& t, + const Allocator& a); // (14) C++26 + +template +basic_stringbuf( + const T& t, + ios_base::openmode which, + const Allocator& a); // (15) C++26 ``` * ios_base[link /reference/ios/ios_base.md] * basic_string[link /reference/string/basic_string.md] @@ -63,18 +80,43 @@ basic_stringbuf(basic_stringbuf&& rhs, const Allocator& a); // (12) C++20 ## 概要 `basic_stringbuf`オブジェクトを構築する。 +- (1) : デフォルトコンストラクタ +- (2) : 指定されたモードで構築する +- (3) : [`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピーと、指定されたモードで構築する +- (4) : モードとアロケータを指定して構築する +- (5) : アロケータを指定して構築する +- (6) : [`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピーと、アロケータを指定して構築する +- (7) : [`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピー、モード、アロケータを指定して構築する +- (8) : `Allocator`に変換可能なアロケータ型をもつ`std::basic_string`オブジェクトのコピーと、指定されたモードで構築する +- (9) : `Allocator`に変換可能なアロケータ型をもつ`std::basic_string`オブジェクトのコピーと、アロケータを指定して構築する +- (10) : `Allocator`に変換可能なアロケータ型をもつ`std::basic_string`オブジェクトのコピー、モード、アロケータを指定して構築する +- (11) : ムーブコンストラクタ +- (12) : ムーブコンストラクタでアロケータを指定して構築する +- (13) : [`basic_string_view`](/reference/string_view/basic_string_view.md)に変換可能な文字列を初期化し、モードを設定する +- (14) : [`basic_string_view`](/reference/string_view/basic_string_view.md)に変換可能な文字列を初期化、アロケータを設定する +- (15) : [`basic_string_view`](/reference/string_view/basic_string_view.md)に変換可能な文字列を初期化し、モードとアロケータを設定する + + +## テンプレートパラメータ制約 +- (13), (14), (15) : `is_convertible_v>`が`true`であること + + ## 効果 - (1) : 内部の文字列バッファを空にし、モードは`ios_base::in | ios_base::out`に設定する - (2) : 内部の文字列バッファを空にし、モードは`which`に設定する - (3) : 内部の文字列バッファを`s`のコピー、モードは`which`に設定する - (4) : 内部の文字列バッファを`std::move(s)`で、モードは`which`に設定する - (5) : 内部の文字列バッファを空にし、モードは`which`、アロケータは`a`に設定する -- (6), (7), (8), (9), (10), (11) : 各引数は内部状態の初期化に使用される -- (12) : `rhs`から`basic_stringbuf`オブジェクトをムーブ構築する -- (13) : `rhs`から`basic_stringbuf`オブジェクトをムーブ構築し、アロケータは`a`を使用する +- (6), (7), (8), (9), (10) : 各引数は内部状態の初期化に使用される +- (11) : `rhs`から`basic_stringbuf`オブジェクトをムーブ構築する +- (12) : `rhs`から`basic_stringbuf`オブジェクトをムーブ構築し、アロケータは`a`を使用する +- (13) : `basic_string_view(t)`で文字列を初期化し、モードは`which`に設定する +- (14) : `basic_string_view(t)`で文字列を初期化し、モードは`ios_base::in | ios_base::out`、アロケータは`a`に設定する +- (15) : `basic_string_view(t)`で文字列を初期化し、モードは`which`、アロケータは`a`に設定する ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -95,11 +137,37 @@ int main() * sputc[link /reference/streambuf/basic_streambuf/sputc.md] * str()[link str.md] -### 出力 +#### 出力 ``` a initial! ``` +#### string_viewからの構築 (C++26) +```cpp example +#include +#include +#include + +int main() +{ + std::string_view sv = "from string literal"; + std::stringbuf buf1{sv}; + std::println("{}", buf1.str()); + + std::string_view sv2 = "from string_view"; + std::stringbuf buf2{sv2}; + std::println("{}", buf2.str()); +} +``` + +#### 出力 +``` +from string literal +from string_view +``` + ## 参照 -- [P0408R7 Efficient Access to `basic_stringbuf`'s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) \ No newline at end of file +- [P0408R7 Efficient Access to `basic_stringbuf`'s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) +- [P2495R3 Interfacing stringstreams with `string_view`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2495r3.pdf) + - C++26で[`std::string_view`](/reference/string_view/basic_string_view.md)に対応した diff --git a/reference/sstream/basic_stringbuf/str.md b/reference/sstream/basic_stringbuf/str.md index 3b05fee010..f09ec1573f 100644 --- a/reference/sstream/basic_stringbuf/str.md +++ b/reference/sstream/basic_stringbuf/str.md @@ -19,21 +19,40 @@ template void str(const basic_string& s); // (5) C++20 void str(const basic_string&& s); // (6) C++20 + +template +void str(const T& t); // (7) C++26 ``` * basic_string[link /reference/string/basic_string.md] ## 概要 文字列オブジェクトを取得または設定する。 +- (1) : 文字列オブジェクトを取得する +- (2) : 文字列オブジェクトを取得し、`SAlloc`型のアロケータ`sa`によってメモリ確保する +- (3) : 保持する文字列オブジェクトをムーブして取得する +- (4) : 文字列オブジェクト`s`を設定する +- (5) : `Allocator`に変換可能な`SAlloc`型のアロケータによって確保されているデータをコピーして、文字列オブジェクト`s`を設定する +- (6) : 与えられた文字列オブジェクト`s`をムーブして設定する +- (7) : [`basic_string_view`](/reference/string_view/basic_string_view.md)に変換可能な文字列を設定する + + +## テンプレートパラメータ制約 +- (7) : `is_convertible_v>`が`true`であること + + ## 効果 - (1) : 文字列オブジェクトを取得する - (2) : 文字列オブジェクトを取得して、`SAlloc`型のアロケータ`sa`によって確保する - (3) : 保持する文字列オブジェクトをムーブして取得する - (4) : 文字列オブジェクト`s`を設定する -- (5) : `SAlloc`型のアロケータによって確保されているデータをコピーして、文字列オブジェクト`s`を設定する +- (5) : `Allocator`に変換可能な`SAlloc`型のアロケータによって確保されているデータをコピーして、文字列オブジェクト`s`を設定する - (6) : 与えられた文字列オブジェクト`s`をムーブして設定する +- (7) : [`basic_string_view`](/reference/string_view/basic_string_view.md)`(t)`から文字列を設定する + ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -64,26 +83,82 @@ int main() buf.sputc('Y'); std::cout << "4: After writing: " << buf.str() << std::endl; - // C++20: ムーブによる設定 - std::string s = "Move test"; - buf.str(std::move(s)); - std::cout << "5: " << buf.str() << std::endl; + // C++26: string_viewから設定 + // std::string_view sv = "string_view test"; + // buf.str(sv); + // std::cout << "6: " << buf.str() << std::endl; // 空文字列でクリア buf.str(""); - std::cout << "6: Empty? " << (buf.str().empty() ? "yes" : "no") << std::endl; + std::cout << "7: Empty? " << (buf.str().empty() ? "yes" : "no") << std::endl; } ``` * sputn[link /reference/streambuf/basic_streambuf/sputn.md] * sbumpc[link /reference/streambuf/basic_streambuf/sbumpc.md] * sputc[link /reference/streambuf/basic_streambuf/sputc.md] -### 出力 +#### 出力 ``` 1: Hello, World! 2: New content 3: After reading 2 chars: Read/Write test 4: After writing: ReXY/Write test 5: Move test -6: Empty? yes +7: Empty? yes ``` + +#### ムーブを使用する例 (C++20) +```cpp example +#include +#include + +int main() { + std::stringbuf buf; + + // ムーブして文字列を設定 + std::string s = "Move string"; + buf.str(std::move(s)); + std::cout << buf.str() << std::endl; + + // ムーブで文字列を取得 + std::string r = std::move(buf).str(); + std::cout << r << std::endl; +} +``` + +#### 出力 +``` +Move string +Move string +``` + +### string_viewからの設定 (C++26) +```cpp example +#include +#include +#include + +int main() { + std::stringbuf buf; + + // 文字列リテラルを設定 + buf.str("set from string literal"); + std::cout << buf.str() << std::endl; + + // string_viewを設定 + std::string_view sv = "set from string_view"; + buf.str(sv); + std::cout << buf.str() << std::endl; +} +``` + +#### 出力 +``` +set from string literal +set from string_view +``` + +## 参照 +- [P0408R7 Efficient Access to `basic_stringbuf`'s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) +- [P2495R3 Interfacing stringstreams with `string_view`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2495r3.pdf) + - C++26で[`std::string_view`](/reference/string_view/basic_string_view.md)に対応した \ No newline at end of file From 64398ea9addcfc8a692a6c16b92fb57a6588e842 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 12 Jun 2025 17:40:59 +0900 Subject: [PATCH 1887/3948] =?UTF-8?q?[i|o]stringstream=20:=20C++26=20strin?= =?UTF-8?q?g=5Fview=E3=81=AE=E4=BB=95=E6=A7=98=E3=81=AB=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=20#1186?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basic_istringstream/op_constructor.md | 80 +++++++++++++++-- reference/sstream/basic_istringstream/str.md | 74 +++++++++++++++- .../basic_ostringstream/op_constructor.md | 81 +++++++++++++++-- reference/sstream/basic_ostringstream/str.md | 87 ++++++++++++++++++- .../sstream/basic_stringbuf/op_constructor.md | 18 ++-- reference/sstream/basic_stringbuf/str.md | 12 +-- .../basic_stringstream/op_constructor.md | 76 +++++++++++++++- reference/sstream/basic_stringstream/str.md | 84 +++++++++++++++++- 8 files changed, 475 insertions(+), 37 deletions(-) diff --git a/reference/sstream/basic_istringstream/op_constructor.md b/reference/sstream/basic_istringstream/op_constructor.md index 906de25e79..f3910c37b0 100644 --- a/reference/sstream/basic_istringstream/op_constructor.md +++ b/reference/sstream/basic_istringstream/op_constructor.md @@ -52,6 +52,22 @@ basic_istringstream( const Allocator& a); // (9) C++20 basic_istringstream(basic_istringstream&& rhs); // (10) C++11 + +template +explicit basic_istringstream( + const T& t, + ios_base::openmode which = ios_base::in); // (11) C++26 + +template +basic_istringstream( + const T& t, + const Allocator& a); // (12) C++26 + +template +basic_istringstream( + const T& t, + ios_base::openmode which, + const Allocator& a); // (13) C++26 ``` * ios_base[link /reference/ios/ios_base.md] * basic_string[link /reference/string/basic_string.md] @@ -59,17 +75,39 @@ basic_istringstream(basic_istringstream&& rhs); // (10) C++11 ## 概要 `basic_istringstream`オブジェクトを構築する。 +- (1) : デフォルトコンストラクタ +- (2) : 指定されたモードで構築する +- (3) : 入力文字列として[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピーを指定して構築する +- (4) : 指定されたモードとアロケータで構築する +- (5) : 入力文字列として[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピーと、アロケータを指定して構築する +- (6) : 入力文字列として[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピー、モード、アロケータを指定して構築する +- (7) : 入力文字列として`Allocator`に変換可能なアロケータをもつ[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピーと、モードを指定して構築する +- (8) : 入力文字列として`Allocator`に変換可能なアロケータをもつ[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピーと、アロケータを指定して構築する +- (9) : 入力文字列として`Allocator`に変換可能なアロケータをもつ[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピー、モード、アロケータを指定して構築する +- (10) : ムーブコンストラクタ +- (11) : 入力文字列として[`std::basic_string_view`](/reference/string_view/basic_string_view.md)に変換可能な文字列と、モードを指定して構築する +- (12) : 入力文字列として[`std::basic_string_view`](/reference/string_view/basic_string_view.md)に変換可能な文字列と、アロケータを指定して構築する +- (13) : 入力文字列として[`std::basic_string_view`](/reference/string_view/basic_string_view.md)に変換可能な文字列、モード、アロケータを指定して構築する + + +## テンプレートパラメータ制約 +- (11), (12), (13) : `is_convertible_v>`が`true`であること + ## 効果 - (1) : 内部の`basic_stringbuf`オブジェクトを`basic_stringbuf(ios_base::in)`で構築する - (2) : 内部の`basic_stringbuf`オブジェクトを`basic_stringbuf(which | ios_base::in)`で構築する - (3) : 内部の`basic_stringbuf`オブジェクトを`basic_stringbuf(s, which | ios_base::in)`で構築する - (4) : 内部の`basic_stringbuf`オブジェクトを`basic_stringbuf(std::move(s), which | ios_base::in)`で構築する - (5) : 内部の`basic_stringbuf`オブジェクトを`basic_stringbuf(which | ios_base::in, a)`で構築する -- (6), (7), (8), (9), (10) : 各引数が対応する`basic_stringbuf`のコンストラクタに渡される -- (11) : `rhs`から`basic_istringstream`オブジェクトをムーブ構築する +- (6), (7), (8), (9) : 各引数が対応する`basic_stringbuf`のコンストラクタに渡される +- (10) : `rhs`から`basic_istringstream`オブジェクトをムーブ構築する +- (11) : `basic_string_view(t)`で文字列を初期化し、モードは`which | ios_base::in`に設定する +- (12) : `basic_string_view(t)`で文字列を初期化し、モードは`ios_base::in`、アロケータは`a`に設定する +- (13) : `basic_string_view(t)`で文字列を初期化し、モードは`which | ios_base::in`、アロケータは`a`に設定する ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -82,16 +120,48 @@ int main() // (3) 文字列を指定して構築 std::istringstream ss2("initial text"); - int value; + std::string value; ss2 >> value; std::cout << value << std::endl; } ``` -### 出力 +#### 出力 ``` initial ``` +### string_viewからの構築 (C++26) +```cpp example +#include +#include +#include + +int main() +{ + // 文字列リテラルから構築 + std::istringstream ss1{"Hello World"}; + std::string s1; + ss1 >> s1; + std::cout << s1 << std::endl; + + // string_viewから構築 + std::string_view sv = "Hello World"; + std::istringstream ss2{sv}; + std::string s2; + ss2 >> s2; + std::cout << s2 << std::endl; +} +``` + +#### 出力 +``` +Hello +Hello +``` + + ## 参照 -- [P0408R7 Efficient Access to `basic_stringbuf`'s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) \ No newline at end of file +- [P0408R7 Efficient Access to `basic_stringbuf`'s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) +- [P2495R3 Interfacing stringstreams with `string_view`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2495r3.pdf) + - C++26で[`std::string_view`](/reference/string_view/basic_string_view.md)に対応した \ No newline at end of file diff --git a/reference/sstream/basic_istringstream/str.md b/reference/sstream/basic_istringstream/str.md index 090f76f192..8563b18e65 100644 --- a/reference/sstream/basic_istringstream/str.md +++ b/reference/sstream/basic_istringstream/str.md @@ -18,12 +18,27 @@ void str(const basic_string& s); // (4) C++03 template void str(const basic_string& s); // (5) C++20 void str(const basic_string&& s); // (6) C++20 + +template +void str(const T& t); // (7) C++26 ``` * basic_string[link /reference/string/basic_string.md] ## 概要 文字列オブジェクトを取得または設定する。 +- (1) : 文字列オブジェクトを取得する +- (2) : 文字列オブジェクトを取得して、`SAlloc`型のアロケータ`sa`によって確保する +- (3) : 保持する文字列オブジェクトをムーブして取得する +- (4) : 文字列オブジェクト`s`を設定する +- (5) : `Allocator`に変換可能な`SAlloc`型のアロケータによって確保されているデータをコピーして、文字列オブジェクト`s`を設定する +- (6) : 与えられた文字列オブジェクト`s`をムーブして設定する +- (7) : [`std::basic_string_view`](/reference/string_view/basic_string_view.md)に変換可能な文字列を設定する + + +## テンプレートパラメータ制約 +- (7) : `is_convertible_v>`が`true`であること + ## 効果 - (1) : `return rdbuf()->str()` と等価 - (2) : `return rdbuf()->str(sa)` と等価 @@ -31,8 +46,10 @@ void str(const basic_string&& s); // (6) C++20 - (4) : `rdbuf()->str(s)` と等価 - (5) : `rdbuf()->str(s)` と等価 - (6) : `rdbuf()->str(std::move(s))` と等価 +- (7) : `rdbuf()->str(t)` と等価 ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -66,7 +83,7 @@ int main() } ``` -### 出力 +#### 出力 ``` Content: Hello World 123 45.67 Read word: Hello @@ -75,9 +92,64 @@ New read: New content 999 Empty? yes ``` +#### ムーブを使用する例 (C++20) +```cpp example +#include +#include + +int main() { + std::istringstream ss; + + // ムーブして文字列を設定 + std::string s = "Move string"; + ss.str(std::move(s)); + std::cout << ss.str() << std::endl; + + // ムーブで文字列を取得 + std::string r = std::move(ss).str(); + std::cout << r << std::endl; +} +``` + +#### 出力 +``` +Move string +Move string +``` + + +### string_viewからの設定 (C++26) +```cpp example +#include +#include +#include + +int main() { + std::istringstream ss; + + // 文字列リテラルを設定 + ss.str("set from string literal"); + std::cout << ss.str() << std::endl; + + // string_viewを設定 + std::string_view sv = "set from string_view"; + ss.str(sv); + std::cout << ss.str() << std::endl; +} +``` + +#### 出力 +``` +set from string literal +set from string_view +``` + + ## 関連項目 - [`basic_stringbuf::str`](../basic_stringbuf/str.md) ## 参照 - [P0408R7 Efficient Access to `basic_stringbuf`'s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) +- [P2495R3 Interfacing stringstreams with `string_view`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2495r3.pdf) + - C++26で[`std::string_view`](/reference/string_view/basic_string_view.md)に対応した \ No newline at end of file diff --git a/reference/sstream/basic_ostringstream/op_constructor.md b/reference/sstream/basic_ostringstream/op_constructor.md index 075af3c237..63472388b9 100644 --- a/reference/sstream/basic_ostringstream/op_constructor.md +++ b/reference/sstream/basic_ostringstream/op_constructor.md @@ -52,6 +52,22 @@ basic_ostringstream( const Allocator& a); // (9) C++20 basic_ostringstream(basic_ostringstream&& rhs); // (10) C++11 + +template +explicit basic_ostringstream( + const T& t, + ios_base::openmode which = ios_base::out); // (11) C++26 + +template +basic_ostringstream( + const T& t, + const Allocator& a); // (12) C++26 + +template +basic_ostringstream( + const T& t, + ios_base::openmode which, + const Allocator& a); // (13) C++26 ``` * ios_base[link /reference/ios/ios_base.md] * basic_string[link /reference/string/basic_string.md] @@ -59,17 +75,41 @@ basic_ostringstream(basic_ostringstream&& rhs); // (10) C++11 ## 概要 `basic_ostringstream`オブジェクトを構築する。 +ここで、初期値として設定する文字列は、既存のファイルを上書きモードで開くことに似ており、ストリームの初期位置が先頭のまま、ストリーム内容の文字列を設定するものである。モードとして[`std::ios_base::ate`](/reference/ios/ios_base/type-openmode.md)を指定しすると、ストリームの初期位置が末尾に設定される。 + +- (1) : デフォルトコンストラクタ +- (2) : 指定されたモードで構築する +- (3) : 初期文字列として[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピーを指定して構築する +- (4) : 指定されたモードとアロケータで構築する +- (5) : 初期文字列として[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピーと、アロケータを指定して構築する +- (6) : 初期文字列として[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピー、モード、アロケータを指定して構築する +- (7) : 初期文字列として`Allocator`に変換可能なアロケータをもつ[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピーと、モードを指定して構築する +- (8) : 初期文字列として`Allocator`に変換可能なアロケータをもつ[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピーと、アロケータを指定して構築する +- (9) : 初期文字列として`Allocator`に変換可能なアロケータをもつ[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピー、モード、アロケータを指定して構築する +- (10) : ムーブコンストラクタ +- (11) : 初期文字列として[`std::basic_string_view`](/reference/string_view/basic_string_view.md)に変換可能な文字列と、モードを指定して構築する +- (12) : 初期文字列として[`std::basic_string_view`](/reference/string_view/basic_string_view.md)に変換可能な文字列と、アロケータを指定して構築する +- (13) : 初期文字列として[`std::basic_string_view`](/reference/string_view/basic_string_view.md)に変換可能な文字列、モード、アロケータを指定して構築する + + +## テンプレートパラメータ制約 +- (11), (12), (13) : `is_convertible_v>`が`true`であること + ## 効果 - (1) : 内部の`basic_stringbuf`オブジェクトを`basic_stringbuf(ios_base::out)`で構築する - (2) : 内部の`basic_stringbuf`オブジェクトを`basic_stringbuf(which | ios_base::out)`で構築する - (3) : 内部の`basic_stringbuf`オブジェクトを`basic_stringbuf(s, which | ios_base::out)`で構築する - (4) : 内部の`basic_stringbuf`オブジェクトを`basic_stringbuf(std::move(s), which | ios_base::out)`で構築する - (5) : 内部の`basic_stringbuf`オブジェクトを`basic_stringbuf(which | ios_base::out, a)`で構築する -- (6), (7), (8), (9), (10) : 各引数が対応する`basic_stringbuf`のコンストラクタに渡される -- (11) : `rhs`から`basic_ostringstream`オブジェクトをムーブ構築する +- (6), (7), (8), (9) : 各引数が対応する`basic_stringbuf`のコンストラクタに渡される +- (10) : `rhs`から`basic_ostringstream`オブジェクトをムーブ構築する +- (11) : `basic_string_view(t)`で文字列を初期化し、モードは`which | ios_base::out`に設定する +- (12) : `basic_string_view(t)`で文字列を初期化し、モードは`ios_base::out`、アロケータは`a`に設定する +- (13) : `basic_string_view(t)`で文字列を初期化し、モードは`which | ios_base::out`、アロケータは`a`に設定する ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -82,18 +122,47 @@ int main() std::cout << ss1.str() << std::endl; // (3) 文字列を指定して構築 - std::ostringstream ss2("initial "); + std::ostringstream ss2("xxxx yyyy"); ss2 << "text"; std::cout << ss2.str() << std::endl; } ``` * str()[link str.md] -### 出力 +#### 出力 ``` default -initial text +text yyyy +``` + +### string_viewからの構築 (C++26) +```cpp example +#include +#include +#include + +int main() +{ + // 文字列リテラルから構築 + std::ostringstream ss1{"Hello?", std::ios_base::ate}; + ss1 << "World"; + std::cout << ss1.str() << std::endl; + + // string_viewから構築 + std::string_view sv = "Hello?"; + std::ostringstream ss2{sv}; + ss2 << "World"; + std::cout << ss2.str() << std::endl; +} +``` + +#### 出力 +``` +Hello?World +World? ``` ## 参照 -- [P0408R7 Efficient Access to `basic_stringbuf`'s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) \ No newline at end of file +- [P0408R7 Efficient Access to `basic_stringbuf`'s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) +- [P2495R3 Interfacing stringstreams with `string_view`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2495r3.pdf) + - C++26で[`std::string_view`](/reference/string_view/basic_string_view.md)に対応した \ No newline at end of file diff --git a/reference/sstream/basic_ostringstream/str.md b/reference/sstream/basic_ostringstream/str.md index e8d2d32588..2becd6290d 100644 --- a/reference/sstream/basic_ostringstream/str.md +++ b/reference/sstream/basic_ostringstream/str.md @@ -19,12 +19,28 @@ template void str(const basic_string& s); // (5) C++20 void str(const basic_string&& s); // (6) C++20 + +template +void str(const T& t); // (7) C++26 ``` * basic_string[link /reference/string/basic_string.md] ## 概要 文字列オブジェクトを取得または設定する。 +書き込み位置としては先頭にリセットされるため注意すること。 + +- (1) : 文字列オブジェクトを取得する +- (2) : 文字列オブジェクトを取得して、`SAlloc`型のアロケータ`sa`によって確保する +- (3) : 保持する文字列オブジェクトをムーブして取得する +- (4) : 文字列オブジェクト`s`を設定する +- (5) : `Allocator`に変換可能な`SAlloc`型のアロケータによって確保されているデータをコピーして、文字列オブジェクト`s`を設定する +- (6) : 与えられた文字列オブジェクト`s`をムーブして設定する +- (7) : [`std::basic_string_view`](/reference/string_view/basic_string_view.md)に変換可能な文字列を設定する + +## テンプレートパラメータ制約 +- (7) : `is_convertible_v>`が`true`であること + ## 効果 - (1) : `return rdbuf()->str()` と等価 - (2) : `return rdbuf()->str(sa)` と等価 @@ -32,8 +48,10 @@ void str(const basic_string&& s); // (6) C++20 - (4) : `rdbuf()->str(s)` と等価 - (5) : `rdbuf()->str(s)` と等価 - (6) : `rdbuf()->str(std::move(s))` と等価 +- (7) : `rdbuf()->str(t)` と等価 ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -57,7 +75,7 @@ int main() // 書き込み位置は先頭にリセットされる oss << "!!"; std::cout << "After write: " << oss.str() << std::endl; - + // 空文字列でクリア oss.str(""); oss << "Fresh start"; @@ -65,7 +83,7 @@ int main() } ``` -### 出力 +#### 出力 ``` Content: Hello 123 World After append: Hello 123 World + more @@ -74,5 +92,70 @@ After write: !!set content Final: Fresh start ``` +#### ムーブを使用する例 (C++20) +```cpp example +#include +#include + +int main() { + std::ostringstream ss; + + // ムーブして文字列を設定 + std::string s = "Move string"; + ss.str(std::move(s)); + ss.seekp(0, std::ios_base::end); // 書き込み位置を末尾に移動 + ss << " more"; + std::cout << ss.str() << std::endl; + + // ムーブで文字列を取得 + std::string r = std::move(ss).str(); + std::cout << r << std::endl; +} +``` + +#### 出力 +``` +Move string more +Move string more +``` + + +### string_viewからの設定 (C++26) +```cpp example +#include +#include +#include + +int main() { + std::ostringstream ss; + + // 文字列リテラルを設定 + ss.str("set from string literal"); + ss.seekp(0, std::ios_base::end); // 書き込み位置を末尾に移動 + ss << " test"; + std::cout << ss.str() << std::endl; + + // string_viewを設定 + std::string_view sv = "set from string_view"; + ss.str(sv); + ss.seekp(0, std::ios_base::end); // 書き込み位置を末尾に移動 + ss << " test"; + std::cout << ss.str() << std::endl; +} +``` + +#### 出力 +``` +set from string literal test +set from string_view test +``` + + ## 関連項目 - [`basic_stringbuf::str`](../basic_stringbuf/str.md) + + +## 参照 +- [P0408R7 Efficient Access to `basic_stringbuf`'s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) +- [P2495R3 Interfacing stringstreams with `string_view`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2495r3.pdf) + - C++26で[`std::string_view`](/reference/string_view/basic_string_view.md)に対応した \ No newline at end of file diff --git a/reference/sstream/basic_stringbuf/op_constructor.md b/reference/sstream/basic_stringbuf/op_constructor.md index 3e875f918d..4936f70c85 100644 --- a/reference/sstream/basic_stringbuf/op_constructor.md +++ b/reference/sstream/basic_stringbuf/op_constructor.md @@ -82,19 +82,19 @@ basic_stringbuf( - (1) : デフォルトコンストラクタ - (2) : 指定されたモードで構築する -- (3) : [`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピーと、指定されたモードで構築する +- (3) : 入力文字列として[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピーと、指定されたモードで構築する - (4) : モードとアロケータを指定して構築する - (5) : アロケータを指定して構築する -- (6) : [`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピーと、アロケータを指定して構築する -- (7) : [`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピー、モード、アロケータを指定して構築する -- (8) : `Allocator`に変換可能なアロケータ型をもつ`std::basic_string`オブジェクトのコピーと、指定されたモードで構築する -- (9) : `Allocator`に変換可能なアロケータ型をもつ`std::basic_string`オブジェクトのコピーと、アロケータを指定して構築する -- (10) : `Allocator`に変換可能なアロケータ型をもつ`std::basic_string`オブジェクトのコピー、モード、アロケータを指定して構築する +- (6) : 入力文字列として[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピーと、アロケータを指定して構築する +- (7) : 入力文字列として[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピー、モード、アロケータを指定して構築する +- (8) : 入力文字列として`Allocator`に変換可能なアロケータ型をもつ[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピーと、指定されたモードで構築する +- (9) : 入力文字列として`Allocator`に変換可能なアロケータ型をもつ[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピーと、アロケータを指定して構築する +- (10) : 入力文字列として`Allocator`に変換可能なアロケータ型をもつ[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピー、モード、アロケータを指定して構築する - (11) : ムーブコンストラクタ - (12) : ムーブコンストラクタでアロケータを指定して構築する -- (13) : [`basic_string_view`](/reference/string_view/basic_string_view.md)に変換可能な文字列を初期化し、モードを設定する -- (14) : [`basic_string_view`](/reference/string_view/basic_string_view.md)に変換可能な文字列を初期化、アロケータを設定する -- (15) : [`basic_string_view`](/reference/string_view/basic_string_view.md)に変換可能な文字列を初期化し、モードとアロケータを設定する +- (13) : 入力文字列として[`basic_string_view`](/reference/string_view/basic_string_view.md)に変換可能な文字列と、モードを設定する +- (14) : 入力文字列として[`basic_string_view`](/reference/string_view/basic_string_view.md)に変換可能な文字列と、アロケータを設定する +- (15) : 入力文字列として[`basic_string_view`](/reference/string_view/basic_string_view.md)に変換可能な文字列と、モードとアロケータを設定する ## テンプレートパラメータ制約 diff --git a/reference/sstream/basic_stringbuf/str.md b/reference/sstream/basic_stringbuf/str.md index f09ec1573f..8ae0dade46 100644 --- a/reference/sstream/basic_stringbuf/str.md +++ b/reference/sstream/basic_stringbuf/str.md @@ -48,7 +48,7 @@ void str(const T& t); // (7) C++26 - (4) : 文字列オブジェクト`s`を設定する - (5) : `Allocator`に変換可能な`SAlloc`型のアロケータによって確保されているデータをコピーして、文字列オブジェクト`s`を設定する - (6) : 与えられた文字列オブジェクト`s`をムーブして設定する -- (7) : [`basic_string_view`](/reference/string_view/basic_string_view.md)`(t)`から文字列を設定する +- (7) : [`std::basic_string_view`](/reference/string_view/basic_string_view.md)に変換可能な文字列を設定する ## 例 @@ -83,14 +83,9 @@ int main() buf.sputc('Y'); std::cout << "4: After writing: " << buf.str() << std::endl; - // C++26: string_viewから設定 - // std::string_view sv = "string_view test"; - // buf.str(sv); - // std::cout << "6: " << buf.str() << std::endl; - // 空文字列でクリア buf.str(""); - std::cout << "7: Empty? " << (buf.str().empty() ? "yes" : "no") << std::endl; + std::cout << "5: Empty? " << (buf.str().empty() ? "yes" : "no") << std::endl; } ``` * sputn[link /reference/streambuf/basic_streambuf/sputn.md] @@ -103,8 +98,7 @@ int main() 2: New content 3: After reading 2 chars: Read/Write test 4: After writing: ReXY/Write test -5: Move test -7: Empty? yes +5: Empty? yes ``` #### ムーブを使用する例 (C++20) diff --git a/reference/sstream/basic_stringstream/op_constructor.md b/reference/sstream/basic_stringstream/op_constructor.md index 6bf358acae..06e23a9a9d 100644 --- a/reference/sstream/basic_stringstream/op_constructor.md +++ b/reference/sstream/basic_stringstream/op_constructor.md @@ -50,6 +50,21 @@ basic_stringstream( const Allocator& a); // (9) C++20 basic_stringstream(basic_stringstream&& rhs); // (10) C++11 + +template +explicit basic_stringstream( + const T& t, + ios_base::openmode which = ios_base::in | ios_base::out); // (11) C++26 + +template +basic_stringstream( + const T& t, + const Allocator& a); // (12) C++26 + +template +basic_stringstream(const T& t, + ios_base::openmode which, + const Allocator& a); // (13) C++26 ``` * ios_base[link /reference/ios/ios_base.md] * basic_string[link /reference/string/basic_string.md] @@ -57,17 +72,40 @@ basic_stringstream(basic_stringstream&& rhs); // (10) C++11 ## 概要 `basic_stringstream`オブジェクトを構築する。 +ここで、初期値として設定する文字列は、既存のファイルを上書きモードで開くことに似ており、ストリームの初期位置が先頭のまま、ストリーム内容の文字列を設定するものである。 + +- (1) : デフォルトコンストラクタ +- (2) : 指定されたモードで構築する +- (3) : 初期文字列として[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピーを指定して構築する +- (4) : 指定されたモードとアロケータで構築する +- (5) : 初期文字列として[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピーと、アロケータを指定して構築する +- (6) : 初期文字列として[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピー、モード、アロケータを指定して構築する +- (7) : 初期文字列として`Allocator`に変換可能なアロケータをもつ[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピーと、モードを指定して構築する +- (8) : 初期文字列として`Allocator`に変換可能なアロケータをもつ[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピーと、アロケータを指定して構築する +- (9) : 初期文字列として`Allocator`に変換可能なアロケータをもつ[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピー、モード、アロケータを指定して構築する +- (10) : ムーブコンストラクタ +- (11) : 初期文字列として[`std::basic_string_view`](/reference/string_view/basic_string_view.md)に変換可能な文字列と、モードを指定して構築する +- (12) : 初期文字列として[`std::basic_string_view`](/reference/string_view/basic_string_view.md)に変換可能な文字列と、アロケータを指定して構築する +- (13) : 初期文字列として[`std::basic_string_view`](/reference/string_view/basic_string_view.md)に変換可能な文字列、モード、アロケータを指定して構築する + +## テンプレートパラメータ制約 +- (11), (12), (13) : `is_convertible_v>`が`true`であること + ## 効果 - (1) : 内部の`basic_stringbuf`オブジェクトを`basic_stringbuf(ios_base::in | ios_base::out)`で構築する - (2) : 内部の`basic_stringbuf`オブジェクトを`basic_stringbuf(which)`で構築する - (3) : 内部の`basic_stringbuf`オブジェクトを`basic_stringbuf(s, which)`で構築する - (4) : 内部の`basic_stringbuf`オブジェクトを`basic_stringbuf(std::move(s), which)`で構築する - (5) : 内部の`basic_stringbuf`オブジェクトを`basic_stringbuf(which, a)`で構築する -- (6), (7), (8), (9), (10) : 各引数は対応する`basic_stringbuf`のコンストラクタに渡される -- (11) : `rhs`から`basic_stringstream`オブジェクトをムーブ構築する +- (6), (7), (8), (9) : 各引数は対応する`basic_stringbuf`のコンストラクタに渡される +- (10) : `rhs`から`basic_stringstream`オブジェクトをムーブ構築する +- (11) : `basic_string_view(t)`で文字列を初期化し、モードは`which`に設定する +- (12) : `basic_string_view(t)`で文字列を初期化し、モードは`ios_base::in | ios_base::out`、アロケータは`a`に設定する +- (13) : `basic_string_view(t)`で文字列を初期化し、モードは`which`、アロケータは`a`に設定する ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -89,11 +127,41 @@ int main() ``` * str()[link str.md] -### 出力 +#### 出力 ``` hello initial value added ``` +### string_viewからの構築 (C++26) +```cpp example +#include +#include +#include + +int main() +{ + // 文字列リテラルから構築 + std::stringstream ss1{"Hello?"}; + ss1.seekp(0, std::ios_base::end); // 書き込み位置を末尾に設定 + ss1 << "World"; + std::cout << ss1.str() << std::endl; + + // string_viewから構築 + std::string_view sv = "Hello?"; + std::stringstream ss2{sv}; + ss2 << "World"; + std::cout << ss2.str() << std::endl; +} +``` + +#### 出力 +``` +Hello?World +World? +``` + ## 参照 -- [P0408R7 Efficient Access to `basic_stringbuf`'s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) \ No newline at end of file +- [P0408R7 Efficient Access to `basic_stringbuf`'s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) +- [P2495R3 Interfacing stringstreams with `string_view`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2495r3.pdf) + - C++26で[`std::string_view`](/reference/string_view/basic_string_view.md)に対応した diff --git a/reference/sstream/basic_stringstream/str.md b/reference/sstream/basic_stringstream/str.md index 7c4b542b3c..9e62e17ef1 100644 --- a/reference/sstream/basic_stringstream/str.md +++ b/reference/sstream/basic_stringstream/str.md @@ -19,12 +19,29 @@ template void str(const basic_string& s); // (5) C++20 void str(const basic_string&& s); // (6) C++20 + +template +void str(const T& t); // (7) C++26 ``` * basic_string[link /reference/string/basic_string.md] ## 概要 文字列オブジェクトを取得または設定する。 +書き込み位置としては先頭にリセットされるため注意すること。 + +- (1) : 文字列オブジェクトを取得する +- (2) : 文字列オブジェクトを取得して、`SAlloc`型のアロケータ`sa`によって確保する +- (3) : 保持する文字列オブジェクトをムーブして取得する +- (4) : 文字列オブジェクト`s`を設定する +- (5) : `Allocator`に変換可能な`SAlloc`型のアロケータによって確保されているデータをコピーして、文字列オブジェクト`s`を設定する +- (6) : 与えられた文字列オブジェクト`s`をムーブして設定する +- (7) : [`std::basic_string_view`](/reference/string_view/basic_string_view.md)に変換可能な文字列を設定する + + +## テンプレートパラメータ制約 +- (7) : `is_convertible_v>`が`true`であること + ## 効果 - (1) : `return rdbuf()->str()` と等価 - (2) : `return rdbuf()->str(sa)` と等価 @@ -32,8 +49,10 @@ void str(const basic_string&& s); // (6) C++20 - (4) : `rdbuf()->str(s)` と等価 - (5) : `rdbuf()->str(s)` と等価 - (6) : `rdbuf()->str(std::move(s))` と等価 +- (7) : `rdbuf()->str(t)` と等価 ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -67,7 +86,7 @@ int main() } ``` -### 出力 +#### 出力 ``` 1: initial content 2: initial content + added @@ -77,5 +96,68 @@ Read: new 5: Empty? yes ``` +#### ムーブを使用する例 (C++20) +```cpp example +#include +#include + +int main() { + std::stringstream ss; + + // ムーブして文字列を設定 + std::string s = "Move string"; + ss.str(std::move(s)); + ss.seekp(0, std::ios_base::end); // 書き込み位置を末尾に移動 + ss << " more"; + std::cout << ss.str() << std::endl; + + // ムーブで文字列を取得 + std::string r = std::move(ss).str(); + std::cout << r << std::endl; +} +``` + +#### 出力 +``` +Move string more +Move string more +``` + + +### string_viewからの設定 (C++26) +```cpp example +#include +#include +#include + +int main() { + std::stringstream ss; + + // 文字列リテラルを設定 + ss.str("set from string literal"); + ss.seekp(0, std::ios_base::end); // 書き込み位置を末尾に移動 + ss << " test"; + std::cout << ss.str() << std::endl; + + // string_viewを設定 + std::string_view sv = "set from string_view"; + ss.str(sv); + ss.seekp(0, std::ios_base::end); // 書き込み位置を末尾に移動 + ss << " test"; + std::cout << ss.str() << std::endl; +} +``` + +#### 出力 +``` +set from string literal test +set from string_view test +``` + ## 関連項目 - [`basic_stringbuf::str`](../basic_stringbuf/str.md) + +## 参照 +- [P0408R7 Efficient Access to `basic_stringbuf`'s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) +- [P2495R3 Interfacing stringstreams with `string_view`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2495r3.pdf) + - C++26で[`std::string_view`](/reference/string_view/basic_string_view.md)に対応した From 7491d107336f24890601534ce11122b7beae2f44 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 13 Jun 2025 12:06:45 +0900 Subject: [PATCH 1888/3948] new page `invoke_default_contract_violation_handler.md` (#1419) --- ...voke_default_contract_violation_handler.md | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 reference/contracts/invoke_default_contract_violation_handler.md diff --git a/reference/contracts/invoke_default_contract_violation_handler.md b/reference/contracts/invoke_default_contract_violation_handler.md new file mode 100644 index 0000000000..844f318141 --- /dev/null +++ b/reference/contracts/invoke_default_contract_violation_handler.md @@ -0,0 +1,37 @@ +# invoke_default_contract_violation_handler +* contracts[meta header] +* std::contracts[meta namespace] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std::contracts { + void invoke_default_contract_violation_handler(const contract_violation& violation); +} +``` + +## 概要 +契約違反が発生した際に呼び出されるデフォルトのハンドラー関数。 + +この関数は、契約違反が発生した際に、[`contract_violation`](contract_violation.md)オブジェクトを受け取り、デフォルトの処理を実行する。 + +## 効果 +契約違反の情報を標準エラー出力に出力し、[`std::terminate()`](/reference/exception/terminate.md)を呼び出す。 + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ? +- [GCC](/implementation.md#gcc): ? +- [ICC](/implementation.md#icc): ? +- [Visual C++](/implementation.md#visual_cpp): ? + +## 関連項目 +- [契約に基づくプログラミング](/lang/future/contract-based_programming.md) +- [契約プログラミング](/lang/cpp26/contracts.md) +- [`contract_violation`](contract_violation.md) + +## 参照 +- [P2900R14 Contracts for C++](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2900r14.pdf) \ No newline at end of file From 3c65924b17eb8f2e7f19b5e937dcbcb82390179b Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 13 Jun 2025 12:11:41 +0900 Subject: [PATCH 1889/3948] removed nolink --- reference/contracts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/contracts.md b/reference/contracts.md index 73729e35e1..388207bb0d 100644 --- a/reference/contracts.md +++ b/reference/contracts.md @@ -14,7 +14,7 @@ | [`evaluation_semantic`](contracts/evaluation_semantic.md) | アサーションの評価の種類(enum) | C++26 | | [`detection_mode`](contracts/detection_mode.md) | 契約違反の検出モード(enum) | C++26 | | [`contract_violation`](contracts/contract_violation.md) | 契約違反に関する情報 (class) | C++26 | -| [`invoke_default_contract_violation_handler`](contracts/invoke_default_contract_violation_handler.md.nolink) | デフォルトcontract_violationハンドラー | C++26 | +| [`invoke_default_contract_violation_handler`](contracts/invoke_default_contract_violation_handler.md) | デフォルトcontract_violationハンドラー | C++26 | ## バージョン ### 言語 From 8bd1a9a9826c76307f017ea4560de0ca49533f8f Mon Sep 17 00:00:00 2001 From: suomesta Date: Sat, 14 Jun 2025 17:37:52 +0900 Subject: [PATCH 1890/3948] improve chrono::format --- reference/chrono/format.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/reference/chrono/format.md b/reference/chrono/format.md index 491b7d90ca..e93ea0d141 100644 --- a/reference/chrono/format.md +++ b/reference/chrono/format.md @@ -53,8 +53,8 @@ chronoライブラリではこれに加え、たとえばデフォルトでは | `%g` | ISOの週ベースのうしろ2桁10進数の年。結果が1桁の場合、先頭に`0`がつく | `"20"` | | `%G` | ISOの週ベースの10進数の年。結果が4桁未満の場合、4桁になるよう左が`0`で埋められる | `"2020"` | | `%h` | `%b`と等価 | `"Jan"`, `"4月"` | -| `%H` | 24時間時計での10進数の時。結果が1桁の場合、先頭に`0`がつく。改良コマンド`%OH`を指定知ると、ロケール依存の異なる表現を出力する | `"17"` | -| `%I` | 12時間時計での10進数の時。結果が1桁の場合、先頭に`0`がつく。改良コマンド`%OI`を指定知ると、ロケール依存の異なる表現を出力する | `"05"` | +| `%H` | 24時間時計での10進数の時。結果が1桁の場合、先頭に`0`がつく。改良コマンド`%OH`を指定すると、ロケール依存の異なる表現を出力する | `"17"` | +| `%I` | 12時間時計での10進数の時。結果が1桁の場合、先頭に`0`がつく。改良コマンド`%OI`を指定すると、ロケール依存の異なる表現を出力する | `"05"` | | `%j` | 10進数での年の日。1月1日は`001`が出力される。結果が3桁未満の場合、3桁になるよう左が`0`で埋められる。[`duration`](duration.md)の特殊化が与えられた場合、[`days`](duration_aliases.md)の10進数値として0埋めなしで書式化される | `"115"` | | `%m` | 10進数での月。1月は`01`が出力される。結果が1桁の場合、先頭に`0`がつく。改良コマンド`%Om`を指定すると、ロケール依存の異なる表現を出力する | `"04"` | | `%M` | 10進数での分。結果が1桁の場合、先頭に`0`がつく。改良コマンド`%OM`を指定すると、ロケール依存の異なる表現を出力する | `"14"` | @@ -107,12 +107,11 @@ int main() std::cout << std::format("2. {:%H時%M分%S秒}", now) << std::endl; std::cout << std::format("3. {:%H時%M分%S秒}", now_sec) << std::endl; std::cout << std::format("4. {:%p %I時%M分%S秒}", now_sec) << std::endl; - std::cout << std::format("4. {:%p %I時%M分%S秒}", now_sec) << std::endl; // その他要素 - std::cout << std::format("6. {:%C}", now) << std::endl; // 世紀 (100で割って切り下げた値) - std::cout << std::format("7. {:%a}", now) << std::endl; // 曜日の略称 - std::cout << std::format("8. {:%A}", now) << std::endl; // 曜日の完全名 + std::cout << std::format("5. {:%C}", now) << std::endl; // 世紀 (100で割って切り下げた値) + std::cout << std::format("6. {:%a}", now) << std::endl; // 曜日の略称 + std::cout << std::format("7. {:%A}", now) << std::endl; // 曜日の完全名 } ``` * std::chrono::system_clock[link /reference/chrono/system_clock.md] @@ -125,9 +124,9 @@ int main() 2. 08時27分28.1822610秒 3. 08時27分28秒 4. AM 08時27分28秒 -6. 20 -7. Tue -8. Tuesday +5. 20 +6. Tue +7. Tuesday ``` ## バージョン From 1434e2d7e07d1078914fdcea7c7a6bd7d40b33b1 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sat, 14 Jun 2025 18:18:52 +0900 Subject: [PATCH 1891/3948] checked gcc version for std::ssize() --- reference/iterator/ssize.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/iterator/ssize.md b/reference/iterator/ssize.md index 263580943b..24e2488d21 100644 --- a/reference/iterator/ssize.md +++ b/reference/iterator/ssize.md @@ -65,7 +65,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): 9.0 [mark verified] -- [GCC](/implementation.md#gcc): +- [GCC](/implementation.md#gcc): 12.3.0 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? From 10d613142bb65190d6d5c25169d768e0d2bbf10d Mon Sep 17 00:00:00 2001 From: suomesta Date: Tue, 17 Jun 2025 20:00:32 +0900 Subject: [PATCH 1892/3948] improve std::execution::read_env() --- reference/execution/execution/read_env.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/execution/execution/read_env.md b/reference/execution/execution/read_env.md index d494bedbd2..db4146deef 100644 --- a/reference/execution/execution/read_env.md +++ b/reference/execution/execution/read_env.md @@ -67,9 +67,9 @@ int main() * ex::read_env[color ff0000] * ex::sender[link sender.md] * ex::get_scheduler[link get_scheduler.md] -* ex::let_value[lin let_value.md] +* ex::let_value[link let_value.md] * ex::starts_on[link starts_on.md] -* ex::just[lin just.md] +* ex::just[link just.md] * std::this_thread::sync_wait[link ../this_thread/sync_wait.md] * value()[link /reference/optional/optional/value.md] @@ -91,7 +91,7 @@ int main() ## 関連項目 -- [`execution::get_env`](read_env.md) +- [`execution::get_env`](get_env.md) ## 参照 From 0844fd3a6ec8c5815e74faa4b49e84f6150a7bac Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 18 Jun 2025 13:57:43 +0900 Subject: [PATCH 1893/3948] =?UTF-8?q?NG=E3=83=AF=E3=83=BC=E3=83=89?= =?UTF-8?q?=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF=20:=20=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=89=E4=BF=AE=E9=A3=BE=E3=83=9F=E3=82=B9=E3=81=AE=E6=A4=9C?= =?UTF-8?q?=E5=87=BA=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/cpprefjp/site/commit/10d613142bb65190d6d5c25169d768e0d2bbf10d --- .github/workflows/script/ngword_check.py | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/script/ngword_check.py b/.github/workflows/script/ngword_check.py index 8b0349219a..9fd1ea29a5 100644 --- a/.github/workflows/script/ngword_check.py +++ b/.github/workflows/script/ngword_check.py @@ -49,6 +49,7 @@ ("", "括弧", "カッコ"), ("", "constepx", "constexpr"), ("", "wsting", "wstring"), + ("", "\[lin ", "[link "), # コード修飾ミス ("reference/chrono", "dulation", "duration"), ("reference/random", "施行", "試行"), ("reference/random", "疑似", "擬似"), From 03948a4259a83ca1fd22828ff60b945b45ac9431 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 18 Jun 2025 14:11:01 +0900 Subject: [PATCH 1894/3948] =?UTF-8?q?ranges::find,=20lower=5Fbound,=20equa?= =?UTF-8?q?l=5Frange=20:=20=E5=B0=84=E5=BD=B1=E5=A4=89=E6=8F=9B=E3=81=AE?= =?UTF-8?q?=E4=BE=8B=E3=81=A7=E3=82=B3=E3=83=94=E3=83=BC=E3=82=92=E6=8A=91?= =?UTF-8?q?=E6=AD=A2=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_equal_range.md | 3 ++- reference/algorithm/ranges_find.md | 3 ++- reference/algorithm/ranges_lower_bound.md | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/reference/algorithm/ranges_equal_range.md b/reference/algorithm/ranges_equal_range.md index fa5266fb4a..41354e6feb 100644 --- a/reference/algorithm/ranges_equal_range.md +++ b/reference/algorithm/ranges_equal_range.md @@ -218,7 +218,8 @@ int main() { v, key, {}, - [](const X& x) { return x.name; } + // x.nameがコピーされないよう戻り値型を明示的に指定 + [](const X& x) -> const std::string& { return x.name; } ); std::cout << "[ラムダ式]" << std::endl; for (const X& x : result2) { diff --git a/reference/algorithm/ranges_find.md b/reference/algorithm/ranges_find.md index 41dfe9d96f..274724a14e 100644 --- a/reference/algorithm/ranges_find.md +++ b/reference/algorithm/ranges_find.md @@ -140,7 +140,8 @@ int main() { auto it = std::ranges::find( v, std::string("bbb"), - [](const Item& x) { return x.name; } + // コピーされないよう戻り値型を明示的に指定 + [](const Item& x) -> const std::string& { return x.name; } ); if (it == v.end()) { std::cout << "not found" << std::endl; diff --git a/reference/algorithm/ranges_lower_bound.md b/reference/algorithm/ranges_lower_bound.md index 9b4d1be4fa..b046fa0b73 100644 --- a/reference/algorithm/ranges_lower_bound.md +++ b/reference/algorithm/ranges_lower_bound.md @@ -267,7 +267,8 @@ int main() { v, key, {}, - [](const X& x) { return x.name; } + // コピーされないよう戻り値型を明示的に指定 + [](const X& x) -> const std::string& { return x.name; } ); if (it2 != v.end() && it2->name == key) { std::size_t pos = std::ranges::distance(v.begin(), it2); From 8d5640384d41e916d49abd375ebd94ffcda1708c Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 19 Jun 2025 14:55:12 +0900 Subject: [PATCH 1895/3948] =?UTF-8?q?execution/read=5Fenv:=20=E6=A6=82?= =?UTF-8?q?=E8=A6=81=E8=AA=AC=E6=98=8E=E3=81=AE=E5=BE=AE=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit クエリオブジェクトによる環境読取タイミング説明を改善 --- reference/execution/execution/read_env.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/execution/execution/read_env.md b/reference/execution/execution/read_env.md index db4146deef..9d278cfa3b 100644 --- a/reference/execution/execution/read_env.md +++ b/reference/execution/execution/read_env.md @@ -14,7 +14,7 @@ namespace std::execution { ## 概要 `read_env`は、非同期動作の[開始(start)](start.md)時に接続先[Receiver](receiver.md)の[環境](../queryable.md)に対して[クエリオブジェクト](../queryable.md)で問い合わせ、読み取った値を[値完了関数](set_value.md)で送信するSenderファクトリである。 -クエリオブジェクトによるReceiver環境への問い合わせは`read_env`[Sender](sender.md)の構築時ではなく、Receiverと接続されたのち非同期動作が開始されるタイミングまで遅延される。 +クエリオブジェクトによるReceiver環境への問い合わせは`read_env`[Sender](sender.md)構築時やReceiver[接続(connect)](connect.md)ではなく、非同期動作が開始されるタイミングまで遅延される。 [`let_value`](let_value.md)Senderアダプタと組み合わせたり、[Sender Awaitableなコルーチン](with_awaitable_senders.md)での`co_await`式によって、[Scheduler](get_scheduler.md)や[停止トークン](../get_stop_token.md)を読み取ることができる。 From 64a666569b4cf874ecb1f3a9761c6fdbafb95c7a Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Fri, 20 Jun 2025 15:53:44 +0900 Subject: [PATCH 1896/3948] =?UTF-8?q?C++=20=E3=81=AE=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=89=E3=83=96=E3=83=AD=E3=83=83=E3=82=AF=E3=81=AB=20cpp=20?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/complex/complex/op_ostream.md | 2 +- reference/deque/deque/erase_free.md | 2 +- reference/deque/deque/erase_if_free.md | 2 +- reference/forward_list/forward_list/erase_free.md | 2 +- reference/forward_list/forward_list/erase_if_free.md | 2 +- reference/istream/basic_istream/putback.md | 2 +- reference/list/list/erase_free.md | 2 +- reference/list/list/erase_if_free.md | 2 +- reference/map/map/erase_if_free.md | 2 +- reference/map/multimap/erase_if_free.md | 2 +- reference/regex/regex_traits/length.md | 2 +- reference/set/multiset/erase_if_free.md | 2 +- reference/set/set/erase_if_free.md | 2 +- reference/string/basic_string/erase_free.md | 2 +- reference/string/basic_string/erase_if_free.md | 2 +- reference/string_view/basic_string_view/at.md | 2 +- reference/string_view/basic_string_view/back.md | 2 +- reference/string_view/basic_string_view/cend.md | 2 +- reference/string_view/basic_string_view/end.md | 2 +- reference/string_view/basic_string_view/front.md | 2 +- reference/string_view/basic_string_view/op_at.md | 2 +- reference/unordered_map/unordered_map/erase_if_free.md | 2 +- reference/unordered_map/unordered_multimap/erase_if_free.md | 2 +- reference/unordered_set/unordered_multiset/erase_if_free.md | 2 +- reference/unordered_set/unordered_set/erase_if_free.md | 2 +- reference/vector/vector/erase_free.md | 2 +- reference/vector/vector/erase_if_free.md | 2 +- 27 files changed, 27 insertions(+), 27 deletions(-) diff --git a/reference/complex/complex/op_ostream.md b/reference/complex/complex/op_ostream.md index 6f696c2359..1141e965aa 100644 --- a/reference/complex/complex/op_ostream.md +++ b/reference/complex/complex/op_ostream.md @@ -17,7 +17,7 @@ namespace std { ## 効果 -``` +```cpp basic_ostringstream s; s.flags(os.flags()); s.imbue(os.getloc()); diff --git a/reference/deque/deque/erase_free.md b/reference/deque/deque/erase_free.md index 6c95c90d4f..de73078d4a 100644 --- a/reference/deque/deque/erase_free.md +++ b/reference/deque/deque/erase_free.md @@ -22,7 +22,7 @@ namespace std { ## 効果 以下と等価: -``` +```cpp auto it = remove(c.begin(), c.end(), value); auto r = distance(it, c.end()); c.erase(it, c.end()); diff --git a/reference/deque/deque/erase_if_free.md b/reference/deque/deque/erase_if_free.md index 03c68fadb2..0e8e34c544 100644 --- a/reference/deque/deque/erase_if_free.md +++ b/reference/deque/deque/erase_if_free.md @@ -18,7 +18,7 @@ namespace std { ## 効果 以下と等価: -``` +```cpp auto it = remove_if(c.begin(), c.end(), pred); auto r = distance(it, c.end()); c.erase(it, c.end()); diff --git a/reference/forward_list/forward_list/erase_free.md b/reference/forward_list/forward_list/erase_free.md index b6b6ffc186..1e686e63bc 100644 --- a/reference/forward_list/forward_list/erase_free.md +++ b/reference/forward_list/forward_list/erase_free.md @@ -22,7 +22,7 @@ namespace std { ## 効果 以下と等価: -``` +```cpp erase_if(c, [&](auto& elem) { return elem == value; }); ``` * erase_if[link erase_if_free.md] diff --git a/reference/forward_list/forward_list/erase_if_free.md b/reference/forward_list/forward_list/erase_if_free.md index 3902ee1eb6..85a1963d31 100644 --- a/reference/forward_list/forward_list/erase_if_free.md +++ b/reference/forward_list/forward_list/erase_if_free.md @@ -18,7 +18,7 @@ namespace std { ## 効果 以下と等価: -``` +```cpp c.remove_if(pred); ``` * c.remove_if[link remove_if.md] diff --git a/reference/istream/basic_istream/putback.md b/reference/istream/basic_istream/putback.md index f2592d8dfe..aa5fd0fd41 100644 --- a/reference/istream/basic_istream/putback.md +++ b/reference/istream/basic_istream/putback.md @@ -28,7 +28,7 @@ basic_istream& putback(char_type c); この関数は1文字も入力を行わないため、この後の`gcount()`は常に`0`を返す。 ## 例 -``` +```cpp #include #include #include diff --git a/reference/list/list/erase_free.md b/reference/list/list/erase_free.md index 004e672b90..0eb2535cfb 100644 --- a/reference/list/list/erase_free.md +++ b/reference/list/list/erase_free.md @@ -22,7 +22,7 @@ namespace std { ## 効果 以下と等価: -``` +```cpp erase_if(c, [&](auto& elem) { return elem == value; }); ``` * erase_if[link erase_if_free.md] diff --git a/reference/list/list/erase_if_free.md b/reference/list/list/erase_if_free.md index 68d1d03938..1ffc7304bc 100644 --- a/reference/list/list/erase_if_free.md +++ b/reference/list/list/erase_if_free.md @@ -18,7 +18,7 @@ namespace std { ## 効果 以下と等価: -``` +```cpp c.remove_if(pred); ``` * c.remove_if[link remove_if.md] diff --git a/reference/map/map/erase_if_free.md b/reference/map/map/erase_if_free.md index 7b48c194e8..cdd23088c0 100644 --- a/reference/map/map/erase_if_free.md +++ b/reference/map/map/erase_if_free.md @@ -21,7 +21,7 @@ namespace std { ## 効果 以下と等価: -``` +```cpp auto original_size = c.size(); for (auto i = c.begin(), last = c.end(); i != last;) { if (pred(*i)) { diff --git a/reference/map/multimap/erase_if_free.md b/reference/map/multimap/erase_if_free.md index e5d0cbd827..59458a3a42 100644 --- a/reference/map/multimap/erase_if_free.md +++ b/reference/map/multimap/erase_if_free.md @@ -21,7 +21,7 @@ namespace std { ## 効果 以下と等価: -``` +```cpp auto original_size = c.size(); for (auto i = c.begin(), last = c.end(); i != last;) { if (pred(*i)) { diff --git a/reference/regex/regex_traits/length.md b/reference/regex/regex_traits/length.md index 5929a0e030..9b803ceced 100644 --- a/reference/regex/regex_traits/length.md +++ b/reference/regex/regex_traits/length.md @@ -15,7 +15,7 @@ static std::size_t length(const char_type* p); ## 戻り値 -``` +```cpp char_traits::length(p) ``` * char_traits[link /reference/string/char_traits.md] diff --git a/reference/set/multiset/erase_if_free.md b/reference/set/multiset/erase_if_free.md index 911273825d..6d846ca1e9 100644 --- a/reference/set/multiset/erase_if_free.md +++ b/reference/set/multiset/erase_if_free.md @@ -19,7 +19,7 @@ namespace std { ## 効果 以下と等価: -``` +```cpp auto original_size = c.size(); for (auto i = c.begin(), last = c.end(); i != last;) { if (pred(*i)) { diff --git a/reference/set/set/erase_if_free.md b/reference/set/set/erase_if_free.md index ef6be21991..9011dbd30b 100644 --- a/reference/set/set/erase_if_free.md +++ b/reference/set/set/erase_if_free.md @@ -19,7 +19,7 @@ namespace std { ## 効果 以下と等価: -``` +```cpp auto original_size = c.size(); for (auto i = c.begin(), last = c.end(); i != last;) { if (pred(*i)) { diff --git a/reference/string/basic_string/erase_free.md b/reference/string/basic_string/erase_free.md index dfc18ebacf..afc64568a7 100644 --- a/reference/string/basic_string/erase_free.md +++ b/reference/string/basic_string/erase_free.md @@ -22,7 +22,7 @@ namespace std { ## 効果 以下と等価: -``` +```cpp auto it = remove(c.begin(), c.end(), value); auto r = distance(it, c.end()); c.erase(it, c.end()); diff --git a/reference/string/basic_string/erase_if_free.md b/reference/string/basic_string/erase_if_free.md index e994f3d7de..5c2e4daa8f 100644 --- a/reference/string/basic_string/erase_if_free.md +++ b/reference/string/basic_string/erase_if_free.md @@ -19,7 +19,7 @@ namespace std { ## 効果 以下と等価: -``` +```cpp auto it = remove_if(c.begin(), c.end(), pred); auto r = distance(it, c.end()); c.erase(it, c.end()); diff --git a/reference/string_view/basic_string_view/at.md b/reference/string_view/basic_string_view/at.md index 7d1ebc8667..87ef28ac6f 100644 --- a/reference/string_view/basic_string_view/at.md +++ b/reference/string_view/basic_string_view/at.md @@ -14,7 +14,7 @@ constexpr const_reference at(size_type pos) const; ## 戻り値 -``` +```cpp return data()[pos]; ``` * data()[link data.md] diff --git a/reference/string_view/basic_string_view/back.md b/reference/string_view/basic_string_view/back.md index 360eab74d4..43c9cb02ca 100644 --- a/reference/string_view/basic_string_view/back.md +++ b/reference/string_view/basic_string_view/back.md @@ -18,7 +18,7 @@ constexpr const_reference back() const; ## 戻り値 -``` +```cpp return data()[size() - 1]; ``` * data()[link data.md] diff --git a/reference/string_view/basic_string_view/cend.md b/reference/string_view/basic_string_view/cend.md index c177a904db..bc90762abd 100644 --- a/reference/string_view/basic_string_view/cend.md +++ b/reference/string_view/basic_string_view/cend.md @@ -14,7 +14,7 @@ constexpr const_iterator cend() const noexcept; ## 戻り値 -``` +```cpp return cbegin() + size(); ``` * cbegin()[link cbegin.md] diff --git a/reference/string_view/basic_string_view/end.md b/reference/string_view/basic_string_view/end.md index e8c863758d..7952973a78 100644 --- a/reference/string_view/basic_string_view/end.md +++ b/reference/string_view/basic_string_view/end.md @@ -14,7 +14,7 @@ constexpr const_iterator end() const noexcept; ## 戻り値 -``` +```cpp return begin() + size(); ``` * begin()[link begin.md] diff --git a/reference/string_view/basic_string_view/front.md b/reference/string_view/basic_string_view/front.md index 762fba64b4..08ec24696a 100644 --- a/reference/string_view/basic_string_view/front.md +++ b/reference/string_view/basic_string_view/front.md @@ -18,7 +18,7 @@ constexpr const_reference front() const; ## 戻り値 -``` +```cpp return data()[0]; ``` * data()[link data.md] diff --git a/reference/string_view/basic_string_view/op_at.md b/reference/string_view/basic_string_view/op_at.md index 636bcc850f..376685c355 100644 --- a/reference/string_view/basic_string_view/op_at.md +++ b/reference/string_view/basic_string_view/op_at.md @@ -18,7 +18,7 @@ constexpr const_reference operator[](size_type pos) const; ## 戻り値 -``` +```cpp return data()[pos]; ``` * data()[link data.md] diff --git a/reference/unordered_map/unordered_map/erase_if_free.md b/reference/unordered_map/unordered_map/erase_if_free.md index b2f2d8c5f2..c527dcc231 100644 --- a/reference/unordered_map/unordered_map/erase_if_free.md +++ b/reference/unordered_map/unordered_map/erase_if_free.md @@ -21,7 +21,7 @@ namespace std { ## 効果 以下と等価: -``` +```cpp auto original_size = c.size(); for (auto i = c.begin(), last = c.end(); i != last;) { if (pred(*i)) { diff --git a/reference/unordered_map/unordered_multimap/erase_if_free.md b/reference/unordered_map/unordered_multimap/erase_if_free.md index 1ea5de5d76..c12017d40c 100644 --- a/reference/unordered_map/unordered_multimap/erase_if_free.md +++ b/reference/unordered_map/unordered_multimap/erase_if_free.md @@ -21,7 +21,7 @@ namespace std { ## 効果 以下と等価: -``` +```cpp auto original_size = c.size(); for (auto i = c.begin(), last = c.end(); i != last;) { if (pred(*i)) { diff --git a/reference/unordered_set/unordered_multiset/erase_if_free.md b/reference/unordered_set/unordered_multiset/erase_if_free.md index 10bf147e62..73d47bfa54 100644 --- a/reference/unordered_set/unordered_multiset/erase_if_free.md +++ b/reference/unordered_set/unordered_multiset/erase_if_free.md @@ -19,7 +19,7 @@ namespace std { ## 効果 以下と等価: -``` +```cpp auto original_size = c.size(); for (auto i = c.begin(), last = c.end(); i != last;) { if (pred(*i)) { diff --git a/reference/unordered_set/unordered_set/erase_if_free.md b/reference/unordered_set/unordered_set/erase_if_free.md index 01b6b4eb29..ea70475735 100644 --- a/reference/unordered_set/unordered_set/erase_if_free.md +++ b/reference/unordered_set/unordered_set/erase_if_free.md @@ -19,7 +19,7 @@ namespace std { ## 効果 以下と等価: -``` +```cpp auto original_size = c.size(); for (auto i = c.begin(), last = c.end(); i != last;) { if (pred(*i)) { diff --git a/reference/vector/vector/erase_free.md b/reference/vector/vector/erase_free.md index 82a5411ff0..7361962b95 100644 --- a/reference/vector/vector/erase_free.md +++ b/reference/vector/vector/erase_free.md @@ -22,7 +22,7 @@ namespace std { ## 効果 以下と等価: -``` +```cpp auto it = remove(c.begin(), c.end(), value); auto r = distance(it, c.end()); c.erase(it, c.end()); diff --git a/reference/vector/vector/erase_if_free.md b/reference/vector/vector/erase_if_free.md index 5112a379aa..a949bde566 100644 --- a/reference/vector/vector/erase_if_free.md +++ b/reference/vector/vector/erase_if_free.md @@ -19,7 +19,7 @@ namespace std { ## 効果 以下と等価: -``` +```cpp auto it = remove_if(c.begin(), c.end(), pred); auto r = distance(it, c.end()); c.erase(it, c.end()); From a9d264c4ed2ba86f5949f89923bf17ff8e4bcccc Mon Sep 17 00:00:00 2001 From: suomesta Date: Sat, 21 Jun 2025 20:23:17 +0900 Subject: [PATCH 1897/3948] improve std::move_only_function --- reference/functional/move_only_function.md | 44 +++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/reference/functional/move_only_function.md b/reference/functional/move_only_function.md index 66ccd0b1b3..ab24a4fc69 100644 --- a/reference/functional/move_only_function.md +++ b/reference/functional/move_only_function.md @@ -222,6 +222,48 @@ int main() ``` ``` +### 例5: ムーブオンリーオブジェクト +```cpp example +#include +#include +#include +#include + +// ムーブオンリーの関数オブジェクトクラス +struct UniqueInt { + std::unique_ptr ptr; + + void operator()(void) { + std::cout << *ptr << std::endl; + } +}; + +int main() +{ + UniqueInt ui = {std::make_unique(42)}; + + // コンパイルエラー! + // std::functionはムーブオンリーオブジェクトを格納できない +// std::function f = std::move(ui); + + // OK + // std::move_only_functionなら格納可能 + std::move_only_function f = std::move(ui); + + f(); +} +``` +* std::move_only_function[color ff0000] +* std::function[link /reference/functional/function.md] +* std::unique_ptr[link /reference/memory/unique_ptr.md] +* std::make_unique[link /reference/memory/make_unique.md] +* std::move[link /reference/utility/move.md] + +#### 出力 +``` +42 +``` + ## バージョン ### 言語 @@ -237,7 +279,7 @@ int main() ## 関連項目 - C++11 [`function`](function.md) - C++26 [`copyable_function`](copyable_function.md) -- C++26 [`copyable_function`](copyable_function.md) +- C++26 [`function_ref`](function_ref.md) ## 参照 From 267a954cdf087832ca47cf490997b7f6240e892c Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 23 Jun 2025 13:05:22 +0900 Subject: [PATCH 1898/3948] =?UTF-8?q?get()=20=E3=81=AB=20const=20tuple&&?= =?UTF-8?q?=20=E7=89=88=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/tuple/tuple/get.md | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/reference/tuple/tuple/get.md b/reference/tuple/tuple/get.md index 19e33d412a..8c170518b4 100644 --- a/reference/tuple/tuple/get.md +++ b/reference/tuple/tuple/get.md @@ -8,40 +8,43 @@ namespace std { template typename tuple_element >::type& - get(tuple& t) noexcept; // (1) C++11 + get(tuple& t) noexcept; // (1) C++11 template constexpr tuple_element_t>& - get(tuple&) noexcept; // (1) C++14 + get(tuple&) noexcept; // (1) C++14 template typename tuple_element >::type&& - get(tuple&& t) noexcept; // (2) C++11 + get(tuple&& t) noexcept; // (2) C++11 template constexpr tuple_element_t>&& - get(tuple&&) noexcept; // (2) C++14 + get(tuple&&) noexcept; // (2) C++14 template typename tuple_element >::type const& - get(const tuple& t) noexcept; // (3) C++11 + get(const tuple& t) noexcept; // (3) C++11 template constexpr const tuple_element_t>& - get(const tuple& t) noexcept; // (3) C++14 + get(const tuple& t) noexcept; // (3) C++14 template constexpr const tuple_element_t >&& - get(const tuple&& t) noexcept; // (4) C++17 + get(const tuple&& t) noexcept; // (4) C++17 template - constexpr T& get(tuple& t) noexcept; // (5) C++14 + constexpr T& get(tuple& t) noexcept; // (5) C++14 template - constexpr T&& get(tuple&& t) noexcept; // (6) C++14 + constexpr T&& get(tuple&& t) noexcept; // (6) C++14 template - constexpr const T& get(const tuple& t) noexcept; // (7) C++14 + constexpr const T& get(const tuple& t) noexcept; // (7) C++14 + + template + constexpr const T&& get(const tuple&& t) noexcept; // (8) C++14 } ``` * tuple_element[link ../tuple_element.md] @@ -55,12 +58,12 @@ namespace std { ## 要件 - (1), (2), (3), (4) : テンプレートパラメータ`I`が`tuple`の要素数よりも小さいこと。この要件を満たさない場合は、コンパイルエラーとなる。 -- (5), (6), (7) : 型`T`が`Types...`の中にひとつだけ含まれること。この要件を満たさない場合は、コンパイルエラーとなる。 +- (5), (6), (7), (8) : 型`T`が`Types...`の中にひとつだけ含まれること。この要件を満たさない場合は、コンパイルエラーとなる。 ## 戻り値 - (1), (2), (3), (4) : `tuple`オブジェクト`t`の`I`番目の要素への参照 -- (5), (6), (7) : `tuple`オブジェクト`t`に含まれる`T`型の要素への参照 +- (5), (6), (7), (8) : `tuple`オブジェクト`t`に含まれる`T`型の要素への参照 ## 例外 @@ -94,7 +97,7 @@ int main() } std::cout << std::endl; - // 型を指定して取得する方法。(5)-(7) + // 型を指定して取得する方法。(5)-(8) { int& i = std::get(t); char& c = std::get(t); @@ -119,7 +122,7 @@ a hello ``` -### const右辺値参照版が必要な状況 (4) +### const右辺値参照版が必要な状況 (4), (8) ```cpp example #include #include From c601a46e52984303554cad21991d10469a9a9cde Mon Sep 17 00:00:00 2001 From: Raclamusi <61970673+Raclamusi@users.noreply.github.com> Date: Mon, 23 Jun 2025 19:51:49 +0900 Subject: [PATCH 1899/3948] =?UTF-8?q?get(const=20tuple&&)=20=E3=81=AE=20C+?= =?UTF-8?q?+=20=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/tuple/tuple/get.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/tuple/tuple/get.md b/reference/tuple/tuple/get.md index 8c170518b4..a5a19b8b29 100644 --- a/reference/tuple/tuple/get.md +++ b/reference/tuple/tuple/get.md @@ -44,7 +44,7 @@ namespace std { constexpr const T& get(const tuple& t) noexcept; // (7) C++14 template - constexpr const T&& get(const tuple&& t) noexcept; // (8) C++14 + constexpr const T&& get(const tuple&& t) noexcept; // (8) C++17 } ``` * tuple_element[link ../tuple_element.md] From 22f113ec79b132299ea4ef236affc14c0adc201d Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Tue, 24 Jun 2025 11:47:43 +0900 Subject: [PATCH 1900/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BE=8B?= =?UTF-8?q?=E3=81=AE=E3=82=A8=E3=83=A9=E3=83=BC=E3=82=92=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=20#1456?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26/structured_bindings_can_introduce_a_pack.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lang/cpp26/structured_bindings_can_introduce_a_pack.md b/lang/cpp26/structured_bindings_can_introduce_a_pack.md index 5b9018db0a..f6debe55b9 100644 --- a/lang/cpp26/structured_bindings_can_introduce_a_pack.md +++ b/lang/cpp26/structured_bindings_can_introduce_a_pack.md @@ -53,14 +53,21 @@ constexpr decltype(auto) apply(F &&f, Tuple &&t) C++26での実装: ```cpp +namespace detail { + template + using override_ref = std::conditional_t, B&&, B&>; +} + template constexpr decltype(auto) apply(F &&f, Tuple &&t) { auto&& [...elems] = t; return std::invoke(std::forward(f), - std::forward_like(elems)...); + static_cast>(elems)...); } ``` +* std::conditional_t[link /reference/type_traits/conditional.md] +* std::is_rvalue_reference_v[link /reference/type_traits/is_rvalue_reference.md] * std::invoke[link /reference/functional/invoke.md] From 1fb173fc57f5ac8e68fbbbc93af9846664ff3a70 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Wed, 25 Jun 2025 13:00:37 +0900 Subject: [PATCH 1901/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/unique_copy.md | 2 +- reference/mdspan/mdspan/op_at.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/algorithm/unique_copy.md b/reference/algorithm/unique_copy.md index b2b33ae236..875fdfd84f 100644 --- a/reference/algorithm/unique_copy.md +++ b/reference/algorithm/unique_copy.md @@ -62,7 +62,7 @@ namespace std { ## テンプレートパラメータ制約 - `*result = *first` は有効な式でなければならない -- `InputIterator` と `OutputIterator` のどちらも forward iterator の要求を満たしていない場合、`InputIterator` の値型は [コピー構築可能](/reference/concepts/copy_constructible.md) かつ [コピー代入可能](/reference/type_traits/copy_assignable.md.nolink) でなければならない。そうでない場合は [コピー構築可能](/reference/concepts/copy_constructible.md) であることは要求されない +- `InputIterator` と `OutputIterator` のどちらも forward iterator の要求を満たしていない場合、`InputIterator` の値型は [コピー構築可能](/reference/concepts/copy_constructible.md) かつ [コピー代入可能](/reference/type_traits/is_copy_assignable.md) でなければならない。そうでない場合は [コピー構築可能](/reference/concepts/copy_constructible.md) であることは要求されない ## 効果 diff --git a/reference/mdspan/mdspan/op_at.md b/reference/mdspan/mdspan/op_at.md index 56c2e0630c..3da007b870 100644 --- a/reference/mdspan/mdspan/op_at.md +++ b/reference/mdspan/mdspan/op_at.md @@ -89,7 +89,7 @@ int main() ## 関連項目 -- C++23 [添字演算子の多次元サポート](cpp23/multidimensional_subscript_operator.nd.nolink) +- C++23 [添字演算子の多次元サポート](/lang/cpp23/multidimensional_subscript_operator.md) ## 参照 From 6cc5b6b2428b200c474b9001480ec0e34f61b700 Mon Sep 17 00:00:00 2001 From: suomesta Date: Wed, 25 Jun 2025 22:48:21 +0900 Subject: [PATCH 1902/3948] fix some typo --- implementation-status.md | 4 ++-- lang/cpp20.md | 2 +- lang/cpp23.md | 2 +- lang/cpp26.md | 2 +- reference/barrier/barrier.md | 2 +- reference/chrono/duration_aliases.md | 2 +- reference/flat_map/flat_map.md | 2 +- reference/flat_map/flat_multimap.md | 2 +- reference/flat_set/flat_multiset.md | 2 +- reference/flat_set/flat_set.md | 2 +- reference/iterator.md | 2 +- reference/mdspan/extents/op_constructor.md | 6 +++--- reference/regex/sub_match/op_compare_3way.md | 2 +- reference/regex/sub_match/op_equal.md | 2 +- reference/string/basic_string/clear.md | 2 +- start_editing/comparison_operator_template_page.md | 2 +- start_editing/cpo_template_page.md | 2 +- start_editing/function_template_page.md | 2 +- 18 files changed, 21 insertions(+), 21 deletions(-) diff --git a/implementation-status.md b/implementation-status.md index a15f7638b0..f4c7befdd6 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -253,7 +253,7 @@ | P1847R4: [アクセス制御の異なるメンバ変数のレイアウトを宣言順に規定](/lang/cpp23/make_declaration_order_layout_mandated.md) | アクセス制御の異なるメンバ変数のレイアウトは並び替えを許可されていたが宣言順に規定する | Yes | Yes | - | 2022 | | P2128R6: [添字演算子の多次元サポート](/lang/cpp23/multidimensional_subscript_operator.md) | `operator[](int x, int y, int z)`のように添字演算子のオーバーロードで複数のパラメータをとることを許可 | 12 | 15 | 2022.2 | 2022 Update 12 | | P1169R4: [`this`ポインタをもつ必要のない演算子を`static`として宣言できるようにする](/lang/cpp23/static_operator.md) | 状態をもたないいくつかの演算子を`static`として宣言できるようにする | 13 | 16 | 2023.2 | 2022 Update 14 | -| P2201R1: [異なる文字エンコーディングをもつ文字列リテラルの連結を不適格とする](/lang/cpp23/mixed_string_literal_concatenation.md) | `auto a = u8"" L"";`のような異なる文字エンコーディング同士での文字列リテラルを連結を禁止する | Yes | Yes | 2022.2 | Yes | +| P2201R1: [異なる文字エンコーディングをもつ文字列リテラルの連結を不適格とする](/lang/cpp23/mixed_string_literal_concatenation.md) | `auto a = u8"" L"";`のような異なる文字エンコーディング同士での文字列リテラルの連結を禁止する | Yes | Yes | 2022.2 | Yes | | P2029R4: [文字・文字列リテラル中の数値・ユニバーサルキャラクタのエスケープに関する問題解決](/lang/cpp23/numeric_and_universal_character_escapes_in_character_and_string_literals.md.nolink) | | - | - | - | - | | P2362R3: [1ワイド文字に収まらないワイド文字リテラルを禁止する](/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md) | エンコード結果として`wchar_t`の大きさに収まらないワイド文字リテラルを禁止する | 13 | 14 | 2023.2 | - | | P2071R2: [名前付きユニバーサルキャラクタ名](/lang/cpp23/named_universal_character_escapes.md) | 16進数のユニバーサルキャラクタだけでなく、その文字の名前を入力できるようにする | 13 | 15 | 2023.2 | - | @@ -314,7 +314,7 @@ | P3144R2: [不完全型へのポインタに対する`delete`を不適格とする](/lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md) | 未定義動作を引き起こす操作をコンパイルエラーとする | 15 | 19 | | | | P2963R3: [制約式内での畳み込み式の順序付け](/lang/cpp26/ordering_of_constraints_involving_fold_expressions.md.nolink) | 畳み込み式では全体ではなく個別の制約を原子制約式として扱う | | 19 | | | | P0963R3: [条件式での構造化束縛の使用を許可](/lang/cpp26/structured_binding_declaration_as_a_condition.md) | 式全体を`bool`値に変換できる場合に条件式で構造化束縛を使用できることとする | 15 | | | | -| P2686R5: [`constexpr`構造化束縛の許可と、`constexpr`参照の制限緩和](/lang/cpp26/constexpr_structured_bindings_and_references_to_constexpr_variables.md) | 定数式に対する構造化束縛を許可し、関連して`constexpr`参照がの制限を緩和して自動変数も参照できるようにする | | | | | +| P2686R5: [`constexpr`構造化束縛の許可と、`constexpr`参照の制限緩和](/lang/cpp26/constexpr_structured_bindings_and_references_to_constexpr_variables.md) | 定数式に対する構造化束縛を許可し、関連して`constexpr`参照の制限を緩和して自動変数も参照できるようにする | | | | | | P3068R6: [定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) | 定数式の文脈での例外の送出と捕捉を許可 | | | | | | P2865R6: [非推奨だった組み込み配列の比較を削除](/lang/cpp26/remove_deprecated_array_comparisons.md) | C++20で非推奨となっていた配列比較を削除 | 15 | 20 | | | | P1061R10: [構造化束縛でパックを導入できるようにする](/lang/cpp26/structured_bindings_can_introduce_a_pack.md) | タプルを分解する際に複数の変数をパックとして宣言できるようにする。`auto [a, ...xs] = f();` | | | | | diff --git a/lang/cpp20.md b/lang/cpp20.md index 01d911942a..3a630afe87 100644 --- a/lang/cpp20.md +++ b/lang/cpp20.md @@ -82,7 +82,7 @@ C++20とは、2020年中に改訂され、ISO/IEC 14882:2020で標準規格化 | 言語機能 | 説明 | |----------|------| | [コンセプト](cpp20/concepts.md) | テンプレートパラメータに対する制約を行う | -| [autoパラメータによる関数テンプレートの簡易定義](cpp20/function_templates_with_auto_parameters.md) | ジェネリックラムダと同様、関数パラメータをの型を`auto`にすることで簡易的に関数テンプレートを定義できるようにする | +| [autoパラメータによる関数テンプレートの簡易定義](cpp20/function_templates_with_auto_parameters.md) | ジェネリックラムダと同様、関数パラメータの型を`auto`にすることで簡易的に関数テンプレートを定義できるようにする | | [型の文脈で`typename`の省略を許可](cpp20/down_with_typename.md) | 型しか現れない文脈では、依存名を解決するための`typename`キーワードを省略できるようにする | | [非型テンプレートパラメータとしてクラス型を許可する](cpp20/class_types_in_non-type_template_parameters.md) | 定数式として使用できる型を広く非型テンプレートパラメータとして使用できるようにする | | [関数テンプレートに明示的に型指定した場合にADLで見つからない問題を修正](cpp20/adl_and_function_templates_that_are_not_visible.md) | 名前空間内の関数テンプレートをテンプレート引数指定かつ非修飾・ADLで正しく呼び出せるよう修正 | diff --git a/lang/cpp23.md b/lang/cpp23.md index fdb7160655..e4ba3ea5c4 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -48,7 +48,7 @@ C++23とは、2023年中に改訂され、ISO/IEC 14882:2024で標準規格化 | 言語機能 | 説明 | |----------|------| -| [異なる文字エンコーディングをもつ文字列リテラルの連結を不適格とする](cpp23/mixed_string_literal_concatenation.md) | `auto a = u8"" L"";`のような異なる文字エンコーディング同士での文字列リテラルを連結を禁止する | +| [異なる文字エンコーディングをもつ文字列リテラルの連結を不適格とする](cpp23/mixed_string_literal_concatenation.md) | `auto a = u8"" L"";`のような異なる文字エンコーディング同士での文字列リテラルの連結を禁止する | | [エスケープシーケンスの区切り](cpp23/delimited_escape_sequences.md) | エスケープシーケンスの範囲を明確にする構文を追加する | | [文字・文字列リテラル中の数値・ユニバーサルキャラクタのエスケープに関する問題解決](cpp23/numeric_and_universal_character_escapes_in_character_and_string_literals.md.nolink) | | | [1ワイド文字に収まらないワイド文字リテラルを禁止する](cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md) | エンコード結果として`wchar_t`の大きさに収まらないワイド文字リテラルを禁止する | diff --git a/lang/cpp26.md b/lang/cpp26.md index a4eed40cf6..102c08f7af 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -78,7 +78,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | [定数式での`void*`からポインタ型へのキャストを許可](/lang/cpp26/constexpr_cast_from_voidptr.md) | 型消去のために`void*`からポインタ型へのキャストを許可する | | [`static_assert`の診断メッセージにユーザーが生成した文字列の指定を許可](/lang/cpp26/user-generated_static_assert_messages.md) | `constexpr`な`S.size()`と`S.data()`メンバ関数をもつオブジェクトをコンパイル時文字列として指定できるようにする | | [`constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md) | 定数式の文脈での配置`new`を許可 | -| [`constexpr`構造化束縛の許可と、`constexpr`参照の制限緩和](/lang/cpp26/constexpr_structured_bindings_and_references_to_constexpr_variables.md) | 定数式に対する構造化束縛を許可し、関連して`constexpr`参照がの制限を緩和して自動変数も参照できるようにする | +| [`constexpr`構造化束縛の許可と、`constexpr`参照の制限緩和](/lang/cpp26/constexpr_structured_bindings_and_references_to_constexpr_variables.md) | 定数式に対する構造化束縛を許可し、関連して`constexpr`参照の制限を緩和して自動変数も参照できるようにする | | [定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) | 定数式の文脈での例外の送出と捕捉を許可 | diff --git a/reference/barrier/barrier.md b/reference/barrier/barrier.md index f0e79b6b45..b69d2c5c64 100644 --- a/reference/barrier/barrier.md +++ b/reference/barrier/barrier.md @@ -32,7 +32,7 @@ namespace std { 各バリアフェーズ(barrier phase)は下記のステップで構成される: - [`arrive()`](barrier/arrive.md)または[`arrive_and_drop()`](barrier/arrive_and_drop.md)呼び出しによって、予定カウントを減算する。 -- 予定カウントが`0`に到達した後、[`arrive()`](barrier/arrive.md)/[`arrive_and_drop()`](barrier/arrive_and_drop.md)/[`wait()`](barrier/wait.md)いずれかの呼び出しの間に、いずれかのスレッドにより正確に1回だけ完了ステップが実行される。だだし[`wait()`](barrier/wait.md)呼び出しを行うスレッドがない場合に、完了ステップが実行されるか否かは処理系定義とされる。 +- 予定カウントが`0`に到達した後、[`arrive()`](barrier/arrive.md)/[`arrive_and_drop()`](barrier/arrive_and_drop.md)/[`wait()`](barrier/wait.md)いずれかの呼び出しの間に、いずれかのスレッドにより正確に1回だけ完了ステップが実行される。ただし[`wait()`](barrier/wait.md)呼び出しを行うスレッドがない場合に、完了ステップが実行されるか否かは処理系定義とされる。 - 完了ステップが終了したのち、予定カウントをコンストラクタ実引数`expected`でリセットし、[`arrive_and_drop()`](barrier/arrive_and_drop.md)呼び出しの場合は調整を行って、次のフェーズを開始する。 各フェーズは、フェーズ同期ポイント(phase synchronization point)を定義する。 diff --git a/reference/chrono/duration_aliases.md b/reference/chrono/duration_aliases.md index 00491cea5c..447b4ea424 100644 --- a/reference/chrono/duration_aliases.md +++ b/reference/chrono/duration_aliases.md @@ -32,7 +32,7 @@ namespace chrono { * ratio_divide[link /reference/ratio/ratio_divide.md] ## 概要 -さまざまな日付・時間単位をの時間間隔を表現する[`duration`](duration.md)型の別名。 +さまざまな日付・時間単位の時間間隔を表現する[`duration`](duration.md)型の別名。 - (1) : ナノ秒単位で時間間隔を表現する[`duration`](duration.md)型の別名 - (2) : マイクロ秒単位で時間間隔を表現する[`duration`](duration.md)型の別名 diff --git a/reference/flat_map/flat_map.md b/reference/flat_map/flat_map.md index 222468b993..287f7b9bbc 100644 --- a/reference/flat_map/flat_map.md +++ b/reference/flat_map/flat_map.md @@ -22,7 +22,7 @@ namespace std { `std::flat_map`は、ノードベースで実装される[`std::map`](/reference/map/map.md)、ハッシュテーブルで実装される[`std::unordered_map`](/reference/unordered_map/unordered_map.md)とは異なり、ソート済み配列と二分探索の組み合わせで実装される。これはほかの実装と比較して、メモリ使用量と列挙速度において優位であり、一方で挿入速度と検索速度はほかの実装に劣る。 -また、このクラスは分類としては[`std::queue`](/reference/queue/queue.md)や[`std::skack`](/reference/stack/stack.md)と同様のコンテナアダプタに分類され、キーの配列と値の配列の2つを内部で持ち、それを[`std::ranges::zip_view`](/reference/ranges/zip_view.md)で綴じあわせて扱う実装となっている。 +また、このクラスは分類としては[`std::queue`](/reference/queue/queue.md)や[`std::stack`](/reference/stack/stack.md)と同様のコンテナアダプタに分類され、キーの配列と値の配列の2つを内部で持ち、それを[`std::ranges::zip_view`](/reference/ranges/zip_view.md)で綴じあわせて扱う実装となっている。 このコンテナクラスは、ランダムアクセスイテレータをサポートする。 diff --git a/reference/flat_map/flat_multimap.md b/reference/flat_map/flat_multimap.md index e4ef34f39d..d3f017722c 100644 --- a/reference/flat_map/flat_multimap.md +++ b/reference/flat_map/flat_multimap.md @@ -22,7 +22,7 @@ namespace std { `std::flat_multimap`は、ノードベースで実装される[`std::multimap`](/reference/map/multimap.md)、ハッシュテーブルで実装される[`std::unordered_multimap`](/reference/unordered_map/unordered_multimap.md)とは異なり、ソート済み配列と二分探索の組み合わせで実装される。これはほかの実装と比較して、メモリ使用量と列挙速度において優位であり、一方で挿入速度と検索速度はほかの実装に劣る。 -また、このクラスは分類としては[`std::queue`](/reference/queue/queue.md)や[`std::skack`](/reference/stack/stack.md)と同様のコンテナアダプタに分類され、キーの配列と値の配列の2つを内部で持ち、それを[`std::ranges::zip_view`](/reference/ranges/zip_view.md)で綴じあわせて扱う実装となっている。 +また、このクラスは分類としては[`std::queue`](/reference/queue/queue.md)や[`std::stack`](/reference/stack/stack.md)と同様のコンテナアダプタに分類され、キーの配列と値の配列の2つを内部で持ち、それを[`std::ranges::zip_view`](/reference/ranges/zip_view.md)で綴じあわせて扱う実装となっている。 このコンテナクラスは、ランダムアクセスイテレータをサポートする。 diff --git a/reference/flat_set/flat_multiset.md b/reference/flat_set/flat_multiset.md index 5c10721b4d..7772514bb6 100644 --- a/reference/flat_set/flat_multiset.md +++ b/reference/flat_set/flat_multiset.md @@ -20,7 +20,7 @@ namespace std { `std::flat_multiset`は、ノードベースで実装される[`std::multiset`](/reference/set/multiset.md)、ハッシュテーブルで実装される[`std::unordered_multiset`](/reference/unordered_set/unordered_multiset.md)とは異なり、ソート済み配列と二分探索の組み合わせで実装される。これはほかの実装と比較して、メモリ使用量と列挙速度において優位であり、一方で挿入速度と検索速度はほかの実装に劣る。 -また、このクラスは分類としては[`std::queue`](/reference/queue/queue.md)や[`std::skack`](/reference/stack/stack.md)と同様のコンテナアダプタに分類され、キーの配列をラップして扱う実装となっている。 +また、このクラスは分類としては[`std::queue`](/reference/queue/queue.md)や[`std::stack`](/reference/stack/stack.md)と同様のコンテナアダプタに分類され、キーの配列をラップして扱う実装となっている。 このコンテナクラスは、ランダムアクセスイテレータをサポートする。 diff --git a/reference/flat_set/flat_set.md b/reference/flat_set/flat_set.md index 50e95d4bdb..70debad4d8 100644 --- a/reference/flat_set/flat_set.md +++ b/reference/flat_set/flat_set.md @@ -20,7 +20,7 @@ namespace std { `std::flat_set`は、ノードベースで実装される[`std::set`](/reference/set/set.md)、ハッシュテーブルで実装される[`std::unordered_set`](/reference/unordered_set/unordered_set.md)とは異なり、ソート済み配列と二分探索の組み合わせで実装される。これはほかの実装と比較して、メモリ使用量と列挙速度において優位であり、一方で挿入速度と検索速度はほかの実装に劣る。 -また、このクラスは分類としては[`std::queue`](/reference/queue/queue.md)や[`std::skack`](/reference/stack/stack.md)と同様のコンテナアダプタに分類され、キーの配列をラップして扱う実装となっている。 +また、このクラスは分類としては[`std::queue`](/reference/queue/queue.md)や[`std::stack`](/reference/stack/stack.md)と同様のコンテナアダプタに分類され、キーの配列をラップして扱う実装となっている。 このコンテナクラスは、ランダムアクセスイテレータをサポートする。 diff --git a/reference/iterator.md b/reference/iterator.md index 1184f3d4f2..86dfb11d1f 100644 --- a/reference/iterator.md +++ b/reference/iterator.md @@ -81,7 +81,7 @@ C++20以降の標準ライブラリでは、任意のイテレータに対して | [`iter_const_reference_t`](iterator/iter_const_reference_t.md) | イテレータの参照型(`iter_reference_t`)を`const`化したものを取得する (alias template) | C++23 | | [`indirect_result_t`](iterator/indirect_result_t.md) | 関数呼び出し可能な型`F`を複数のイテレータ`Is...`によって呼び出した時の戻り値型を取得する (alias template) | C++20 | | [`projected`](iterator/projected.md) | イテレータ`I`の`Proj`による射影操作の結果を表すことのできる[`indirectly_readable`](/reference/iterator/indirectly_readable.md)なクラス (class template) | C++20 | -| [`projected_value_t`](iterator/projected_value_t.md) | イイテレータ`I`の`Proj`による射影操作の結果となる値型を取得する (alias template) | C++26 | +| [`projected_value_t`](iterator/projected_value_t.md) | イテレータ`I`の`Proj`による射影操作の結果となる値型を取得する (alias template) | C++26 | | [`incrementable_traits`](iterator/incrementable_traits.md) | `iter_difference_t`にアダプトするためのカスタマイゼーションポイント (class template) | C++20 | | [`indirectly_readable_traits`](iterator/indirectly_readable_traits.md) | `iter_value_t`にアダプトするためのカスタマイゼーションポイント (class template) | C++20 | | [`input_iterator_tag`](iterator/iterator_tag.md) | 入力イテレータを表すタグ(class) | | diff --git a/reference/mdspan/extents/op_constructor.md b/reference/mdspan/extents/op_constructor.md index 41cfe61dba..e35d311147 100644 --- a/reference/mdspan/extents/op_constructor.md +++ b/reference/mdspan/extents/op_constructor.md @@ -40,7 +40,7 @@ constexpr explicit(N != rank_dynamic()) - (2) : - `sizeof...(OtherExtents) ==` [`rank()`](rank.md)が`true`、かつ - `((OtherExtents == dynamic_extent || Extents == dynamic_extent || OtherExtents == Extents) && ...)`が`true`であること -- (3) : `N`を`sizeof...(OtherIndexTypes)`、`exts_arr`を[`array`](/reference/array/array.md)`{static_cast(std:move(exts))...}`としたとき +- (3) : `N`を`sizeof...(OtherIndexTypes)`、`exts_arr`を[`array`](/reference/array/array.md)`{static_cast(std::move(exts))...}`としたとき - `(`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` && ...)`が`true`、かつ - `(`[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_convertible.md)` && ...)`が`true`、かつ - `N ==` [`rank_dynamic()`](rank_dynamic.md) `|| N ==` [`rank()`](rank.md)が`true`であること @@ -54,7 +54,7 @@ constexpr explicit(N != rank_dynamic()) - (2) : それぞれ`r`番目の次元が静的要素数に対して要素数が`other.`[`extent`](extent.md)`(r)`と等しく、かつ - `sizeof...(OtherExtents) == 0`、もしくは - `other`の全ての次元`r`において`other.extent(r)`が`index_type`型で表現可能な値であること -- (3) : `N`を`sizeof...(OtherIndexTypes)`、`exts_arr`を[`array`](/reference/array/array.md)`{static_cast(std:move(exts))...}`としたとき +- (3) : `N`を`sizeof...(OtherIndexTypes)`、`exts_arr`を[`array`](/reference/array/array.md)`{static_cast(std::move(exts))...}`としたとき - `N !=` [`rank_dynamic()`](rank_dynamic.md)ならば、それぞれ`r`番目の次元が静的要素数に対して要素数が`exts_arr[r]`と等しく、かつ - `sizeof...(exts) == 0`もしくは`exts`の各要素が`index_type`型で表現可能な値であること - (4), (5) : `N !=` [`rank_dynamic()`](rank_dynamic.md)ならば、それぞれ`r`番目の次元が静的要素数に対して要素数が`exts[r]`と等しく、かつ @@ -68,7 +68,7 @@ constexpr explicit(N != rank_dynamic()) ## 事後条件 - (2) : `*this == other` -- (3) : `exts_arr`を[`array`](/reference/array/array.md)`{static_cast(std:move(exts))...}`としたとき、`*this == extents(exts_arr)`(オーバーロード(5)の効果を参照) +- (3) : `exts_arr`を[`array`](/reference/array/array.md)`{static_cast(std::move(exts))...}`としたとき、`*this == extents(exts_arr)`(オーバーロード(5)の効果を参照) ## 例外 diff --git a/reference/regex/sub_match/op_compare_3way.md b/reference/regex/sub_match/op_compare_3way.md index f1f7e96c2f..8cf3d892aa 100644 --- a/reference/regex/sub_match/op_compare_3way.md +++ b/reference/regex/sub_match/op_compare_3way.md @@ -77,7 +77,7 @@ SM_CAT(I) = compare_three_way_result_t: ## 備考 - (1) の形式でもマッチした文字列のみが比較され、マッチした位置は考慮されない。(例を参照) - (2) の形式でも比較に使用する文字特性クラスは標準の [`char_traits`](../../string/char_traits.md)`` が使用され、テンプレート引数に指定された文字特性クラス `ST` は考慮されない。 -- この演算子により、以下の演算子が使用可能にになる: +- この演算子により、以下の演算子が使用可能になる: - `operator<` - `operator<=` - `operator>` diff --git a/reference/regex/sub_match/op_equal.md b/reference/regex/sub_match/op_equal.md index d558d191cd..29fadb91a2 100644 --- a/reference/regex/sub_match/op_equal.md +++ b/reference/regex/sub_match/op_equal.md @@ -70,7 +70,7 @@ namespace std { ## 備考 - (1) の形式でもマッチした文字列のみが比較され、マッチした位置は考慮されない。(例を参照) - (2)、および、(5) の形式でも比較に使用する文字特性クラスは標準の [`char_traits`](../../string/char_traits.md)`` が使用され、テンプレート引数に指定された文字特性クラス `ST` は考慮されない。 -- この演算子により、以下の演算子が使用可能にになる (C++20): +- この演算子により、以下の演算子が使用可能になる (C++20): - `operator!=` diff --git a/reference/string/basic_string/clear.md b/reference/string/basic_string/clear.md index 0aa0eebccd..adcdc5be69 100644 --- a/reference/string/basic_string/clear.md +++ b/reference/string/basic_string/clear.md @@ -7,7 +7,7 @@ ```cpp void clear(); // (1) C++03 void clear() noexcept; // (1) C++11 -constexpe void clear() noexcept; // (1) C++20 +constexpr void clear() noexcept; // (1) C++20 ``` ## 概要 diff --git a/start_editing/comparison_operator_template_page.md b/start_editing/comparison_operator_template_page.md index e8c9406713..8a134c590c 100644 --- a/start_editing/comparison_operator_template_page.md +++ b/start_editing/comparison_operator_template_page.md @@ -14,7 +14,7 @@ * cpp17[meta cpp] - + diff --git a/start_editing/cpo_template_page.md b/start_editing/cpo_template_page.md index b440943c25..50f2eac098 100644 --- a/start_editing/cpo_template_page.md +++ b/start_editing/cpo_template_page.md @@ -13,7 +13,7 @@ * cpp20[meta cpp] - + diff --git a/start_editing/function_template_page.md b/start_editing/function_template_page.md index 8f9836f900..6d08557e88 100644 --- a/start_editing/function_template_page.md +++ b/start_editing/function_template_page.md @@ -14,7 +14,7 @@ * cpp17[meta cpp] - + From f3b78ac847a9f0fcfd1df7e30b392876a9b8ba65 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Wed, 25 Jun 2025 23:34:22 +0900 Subject: [PATCH 1903/3948] =?UTF-8?q?flat=5Fxxx:=20erase=E3=81=AE=E8=A8=88?= =?UTF-8?q?=E7=AE=97=E9=87=8F=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map/erase.md | 5 ++--- reference/flat_map/flat_multimap/erase.md | 6 +++--- reference/flat_set/flat_multiset/erase.md | 7 +++---- reference/flat_set/flat_set/erase.md | 5 ++--- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/reference/flat_map/flat_map/erase.md b/reference/flat_map/flat_map/erase.md index 021cd76687..a0ef98afff 100644 --- a/reference/flat_map/flat_map/erase.md +++ b/reference/flat_map/flat_map/erase.md @@ -42,9 +42,8 @@ iterator erase(const_iterator first, const_iterator last); // (5) C++23 ## 計算量 -- (1), (2) : 定数時間 -- (3), (4) : コンテナの [`size()`](size.md) について対数時間 -- (5) : コンテナの [`size()`](size.md) について対数時間、それに加えて `first` と `last` の間の距離に対する線形時間 +- (1)(2)(3)(4) : コンテナの [`size()`](size.md) について線形時間 +- (5) : コンテナの [`size()`](size.md) について線形時間、それに加えて `first` と `last` の間の距離について線形時間 ## 備考 diff --git a/reference/flat_map/flat_multimap/erase.md b/reference/flat_map/flat_multimap/erase.md index 0ca562866e..7c1c5bf87a 100644 --- a/reference/flat_map/flat_multimap/erase.md +++ b/reference/flat_map/flat_multimap/erase.md @@ -42,9 +42,9 @@ iterator erase(const_iterator first, const_iterator last); // (5) C++23 ## 計算量 -- (1), (2) : 定数時間 -- (3), (4) : コンテナの [`size()`](size.md) について対数時間に加えて、`count(x)` について線形時間 -- (5) : コンテナの [`size()`](size.md) について対数時間、それに加えて `first` と `last` の間の距離に対する線形時間 +- (1), (2) : コンテナの [`size()`](size.md) について線形時間 +- (3), (4) : コンテナの [`size()`](size.md) について線形時間、それに加えて、`count(x)` について線形時間 +- (5) : コンテナの [`size()`](size.md) について線形時間、それに加えて `first` と `last` の間の距離について線形時間 ## 備考 diff --git a/reference/flat_set/flat_multiset/erase.md b/reference/flat_set/flat_multiset/erase.md index 725f6a5a65..44d0db376d 100644 --- a/reference/flat_set/flat_multiset/erase.md +++ b/reference/flat_set/flat_multiset/erase.md @@ -42,10 +42,9 @@ iterator erase(const_iterator first, const_iterator last); // (5) C++23 ## 計算量 -- (1), (2) : 定数時間 -- (3), (4) : コンテナの [`size()`](size.md) について対数時間に加えて、`count(x)` について線形時間 -- (5) : コンテナの [`size()`](size.md) について対数時間、それに加えて `first` と `last` の間の距離に対する線形時間 - +- (1), (2) : コンテナの [`size()`](size.md) について線形時間 +- (3), (4) : コンテナの [`size()`](size.md) について線形時間、それに加えて、`count(x)` について線形時間 +- (5) : コンテナの [`size()`](size.md) について線形時間、それに加えて `first` と `last` の間の距離について線形時間 ## 備考 - (1), (2) : この関数に、範囲外のイテレータ (終端イテレータを含む) を指定した場合の動作は未定義 diff --git a/reference/flat_set/flat_set/erase.md b/reference/flat_set/flat_set/erase.md index dd2274cfea..f700f70f81 100644 --- a/reference/flat_set/flat_set/erase.md +++ b/reference/flat_set/flat_set/erase.md @@ -42,9 +42,8 @@ iterator erase(const_iterator first, const_iterator last); // (5) C++23 ## 計算量 -- (1), (2) : 定数時間 -- (3), (4) : コンテナの [`size()`](size.md) について対数時間 -- (5) : コンテナの [`size()`](size.md) について対数時間、それに加えて `first` と `last` の間の距離に対する線形時間 +- (1)(2)(3)(4) : コンテナの [`size()`](size.md) について線形時間 +- (5) : コンテナの [`size()`](size.md) について線形時間、それに加えて `first` と `last` の間の距離について線形時間 ## 備考 From 7e8b52ea314ed9c44f3ac57cd8d7e3493e1cffac Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Thu, 26 Jun 2025 23:50:22 +0900 Subject: [PATCH 1904/3948] =?UTF-8?q?Typo=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/chrono/format.md | 4 ++-- reference/chrono/parse.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/chrono/format.md b/reference/chrono/format.md index e93ea0d141..f9ce419a6d 100644 --- a/reference/chrono/format.md +++ b/reference/chrono/format.md @@ -134,7 +134,7 @@ int main() - C++20 ### 処理系 -- [Clang](/implementation.md#clang): 17 [mark mark verified] +- [Clang](/implementation.md#clang): 17 [mark verified] - [GCC](/implementation.md#gcc): 13 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] @@ -145,7 +145,7 @@ int main() - [LWG Issue 3230. Format specifier `%y`/`%Y` is missing locale alternative versions](https://wg21.cmeerw.net/lwg/issue3230) - [LWG Issue 3262. Formatting of negative durations is not specified](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2117r0.html#3262) - [LWG Issue 3270. Parsing and formatting `%j` with `duration`s](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2117r0.html#3270) -- [LWG Issue 3272. `%I``%p` should `parse`/`format` `duration` since midnight](https://wg21.cmeerw.net/lwg/issue3272) +- [LWG Issue 3272. `%I%p` should `parse`/`format` `duration` since midnight](https://wg21.cmeerw.net/lwg/issue3272) - [P2372R1 Fixing locale handling in chrono formatters](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2372r1.html) - この提案文書はC++20の策定後に採択されたが、実装が追いついていない時期の採択だったために、C++20の仕様として扱われる diff --git a/reference/chrono/parse.md b/reference/chrono/parse.md index 235391d4ed..d762cb0114 100644 --- a/reference/chrono/parse.md +++ b/reference/chrono/parse.md @@ -184,4 +184,4 @@ JST - [LWG Issue 3245. Unnecessary restriction on `'%p'` parse specifier](https://wg21.cmeerw.net/lwg/issue3245) - [LWG Issue 3269. Parse manipulators do not specify the result of the extraction from stream](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2117r0.html#3269) - [LWG Issue 3270. Parsing and formatting `%j` with `duration`s](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2117r0.html#3270) -- [LWG Issue 3272. `%I``%p` should `parse`/`format` `duration` since midnight](https://wg21.cmeerw.net/lwg/issue3272) +- [LWG Issue 3272. `%I%p` should `parse`/`format` `duration` since midnight](https://wg21.cmeerw.net/lwg/issue3272) From 30247c1fff6c4f6389bd61012b23f209308dd11d Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 27 Jun 2025 12:45:39 +0900 Subject: [PATCH 1905/3948] =?UTF-8?q?ranges::(stable=5F)partition=20:=20?= =?UTF-8?q?=E8=A8=88=E7=AE=97=E9=87=8F=E3=81=AE=E3=82=B3=E3=83=94=E3=83=9A?= =?UTF-8?q?=E3=83=9F=E3=82=B9=E3=81=A7=E5=AE=9F=E8=A1=8C=E3=83=9D=E3=83=AA?= =?UTF-8?q?=E3=82=B7=E3=83=BC=E3=81=AE=E8=A8=88=E7=AE=97=E9=87=8F=E3=81=8C?= =?UTF-8?q?=E8=A8=98=E8=BC=89=E3=81=95=E3=82=8C=E3=81=A6=E3=81=97=E3=81=BE?= =?UTF-8?q?=E3=81=A3=E3=81=A6=E3=81=84=E3=81=9F=E5=95=8F=E9=A1=8C=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20#1458?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_partition.md | 3 +-- reference/algorithm/ranges_stable_partition.md | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/reference/algorithm/ranges_partition.md b/reference/algorithm/ranges_partition.md index 32aa4228cf..0a9b6ad028 100644 --- a/reference/algorithm/ranges_partition.md +++ b/reference/algorithm/ranges_partition.md @@ -58,8 +58,7 @@ namespace std::ranges { `N = last - first`として -- (1) : `I` が [`bidirectional_iterator`](/reference/iterator/bidirectional_iterator.md)のモデルとなる場合、最大で `N / 2` 回 swap され、そうでない場合、最大で `N` 回 swap される。それに加えて、正確に `N` 回だけ述語が適用される -- (2) : O(NlogN) 回の swap に加え、述語が O(N) 回適用される +- (1), (2) : `I` が [`bidirectional_iterator`](/reference/iterator/bidirectional_iterator.md)のモデルとなる場合、最大で `N / 2` 回 swap され、そうでない場合、最大で `N` 回 swap される。それに加えて、正確に `N` 回だけ述語が適用される ## 例 diff --git a/reference/algorithm/ranges_stable_partition.md b/reference/algorithm/ranges_stable_partition.md index 5fd20f2956..a15e99860d 100644 --- a/reference/algorithm/ranges_stable_partition.md +++ b/reference/algorithm/ranges_stable_partition.md @@ -79,8 +79,7 @@ namespace std::ranges { ## 計算量 `N = last - first`として説明する。 -- (1) : 最大でN log N回 swap が行われるが、余分なメモリを使って構わないのであれば線形回数の swap になる。それに加えて、正確にN回だけ述語が適用される -- (2) : O(N log N) 回の swap に加え、述語が O(N) 回適用される +- (1), (2) : 最大でN log N回 swap が行われるが、余分なメモリを使って構わないのであれば線形回数の swap になる。それに加えて、正確にN回だけ述語が適用される ## 例 From b7c5b2444e59843e212e7220504fdd552a890047 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 27 Jun 2025 16:27:11 +0900 Subject: [PATCH 1906/3948] =?UTF-8?q?iterator:=20C++26=20P2997R1=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C(#1309)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/n4987.html Defect Reportではない仕様変更に読めるためC++20/26仕様を併記 --- .../iterator/indirect_binary_predicate.md | 13 ++++++++- .../iterator/indirect_equivalence_relation.md | 13 ++++++++- .../iterator/indirect_strict_weak_order.md | 13 ++++++++- .../iterator/indirect_unary_predicate.md | 11 +++++++- .../iterator/indirectly_unary_invocable.md | 28 +++++++++++++++++-- 5 files changed, 71 insertions(+), 7 deletions(-) diff --git a/reference/iterator/indirect_binary_predicate.md b/reference/iterator/indirect_binary_predicate.md index 1afed55369..27cf796efb 100644 --- a/reference/iterator/indirect_binary_predicate.md +++ b/reference/iterator/indirect_binary_predicate.md @@ -14,7 +14,16 @@ namespace std { predicate&, iter_reference_t> && predicate, iter_value_t&> && predicate, iter_reference_t> && - predicate, iter_common_reference_t>; + predicate, iter_common_reference_t>; // C++20 + + template + concept indirect_binary_predicate = + indirectly_readable && indirectly_readable && + copy_constructible && + predicate&, iter_value_t&> && + predicate&, iter_reference_t> && + predicate, iter_value_t&> && + predicate, iter_reference_t>; // C++26 } ``` * indirectly_readable[link /reference/iterator/indirectly_readable.md] @@ -96,3 +105,5 @@ std::istream_iterator and double* is not indirect_binary_predicate int(cons ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P2997R1 Removing the common reference requirement from the indirectly invocable concepts](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2997r1.html) + - C++26でイテレータの共通参照要件を削除 diff --git a/reference/iterator/indirect_equivalence_relation.md b/reference/iterator/indirect_equivalence_relation.md index e9d63421fe..bce0748696 100644 --- a/reference/iterator/indirect_equivalence_relation.md +++ b/reference/iterator/indirect_equivalence_relation.md @@ -14,7 +14,16 @@ namespace std { equivalence_relation&, iter_reference_t> && equivalence_relation, iter_value_t&> && equivalence_relation, iter_reference_t> && - equivalence_relation, iter_common_reference_t>; + equivalence_relation, iter_common_reference_t>; // C++20 + + template + concept indirect_equivalence_relation = + indirectly_readable && indirectly_readable && + copy_constructible && + equivalence_relation&, iter_value_t&> && + equivalence_relation&, iter_reference_t> && + equivalence_relation, iter_value_t&> && + equivalence_relation, iter_reference_t>; // C++26 } ``` * indirectly_readable[link /reference/iterator/indirectly_readable.md] @@ -99,3 +108,5 @@ std::istream_iterator is not indirect_equivalence_relation void(const int&, ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P2997R1 Removing the common reference requirement from the indirectly invocable concepts](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2997r1.html) + - C++26でイテレータの共通参照要件を削除 diff --git a/reference/iterator/indirect_strict_weak_order.md b/reference/iterator/indirect_strict_weak_order.md index 3605c4e86b..8279d3ae9b 100644 --- a/reference/iterator/indirect_strict_weak_order.md +++ b/reference/iterator/indirect_strict_weak_order.md @@ -14,7 +14,16 @@ namespace std { strict_weak_order&, iter_reference_t> && strict_weak_order, iter_value_t&> && strict_weak_order, iter_reference_t> && - strict_weak_order, iter_common_reference_t>; + strict_weak_order, iter_common_reference_t>; // C++20 + + template + concept indirect_strict_weak_order = + indirectly_readable && indirectly_readable && + copy_constructible && + strict_weak_order&, iter_value_t&> && + strict_weak_order&, iter_reference_t> && + strict_weak_order, iter_value_t&> && + strict_weak_order, iter_reference_t>; // C++26 } ``` * indirectly_readable[link /reference/iterator/indirectly_readable.md] @@ -98,3 +107,5 @@ std::istream_iterator is not indirect_strict_weak_order void(const int&, co ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P2997R1 Removing the common reference requirement from the indirectly invocable concepts](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2997r1.html) + - C++26でイテレータの共通参照要件を削除 diff --git a/reference/iterator/indirect_unary_predicate.md b/reference/iterator/indirect_unary_predicate.md index 2b488b36ec..ca8f1a9c16 100644 --- a/reference/iterator/indirect_unary_predicate.md +++ b/reference/iterator/indirect_unary_predicate.md @@ -12,7 +12,14 @@ namespace std { copy_constructible && predicate&> && predicate> && - predicate>; + predicate>; // C++20 + + template + concept indirect_unary_predicate = + indirectly_readable && + copy_constructible && + predicate&> && + predicate>; // C++26 } ``` * indirectly_readable[link /reference/iterator/indirectly_readable.md] @@ -96,3 +103,5 @@ std::istream_iterator is not indirect_unary_predicate void(const int&) ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P2997R1 Removing the common reference requirement from the indirectly invocable concepts](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2997r1.html) + - C++26でイテレータの共通参照要件を削除 diff --git a/reference/iterator/indirectly_unary_invocable.md b/reference/iterator/indirectly_unary_invocable.md index a7d8165ce2..fd0bdc5808 100644 --- a/reference/iterator/indirectly_unary_invocable.md +++ b/reference/iterator/indirectly_unary_invocable.md @@ -15,8 +15,18 @@ namespace std { invocable> && common_reference_with< invoke_result_t&>, - invoke_result_t>>; - + invoke_result_t>>; // C++20 + + template + concept indirectly_unary_invocable = + indirectly_readable && + copy_constructible && + invocable&> && + invocable> && + common_reference_with< + invoke_result_t&>, + invoke_result_t>>; // C++26 + template concept indirectly_regular_unary_invocable = indirectly_readable && @@ -26,7 +36,17 @@ namespace std { regular_invocable> && common_reference_with< invoke_result_t&>, - invoke_result_t>>; + invoke_result_t>>; // C++20 + + template + concept indirectly_regular_unary_invocable = + indirectly_readable && + copy_constructible && + regular_invocable&> && + regular_invocable> && + common_reference_with< + invoke_result_t&>, + invoke_result_t>>; // C++26 } ``` * indirectly_readable[link /reference/iterator/indirectly_readable.md] @@ -117,3 +137,5 @@ std::istream_iterator is not indirectly_unary_invocable int(int&&) ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P2997R1 Removing the common reference requirement from the indirectly invocable concepts](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2997r1.html) + - C++26でイテレータの共通参照要件を削除 From 73ba33097aa97477d9613aaafcb09d19ac338ddb Mon Sep 17 00:00:00 2001 From: suomesta Date: Sat, 28 Jun 2025 11:55:48 +0900 Subject: [PATCH 1907/3948] fix some versions --- reference/algorithm/fill.md | 2 +- reference/algorithm/lower_bound.md | 2 +- reference/algorithm/ranges_fold_right.md | 2 +- ...atomic_compare_exchange_strong_explicit.md | 2 +- reference/atomic/atomic_fetch_add.md | 2 +- reference/atomic/atomic_flag_clear.md | 2 +- reference/atomic/atomic_ref/notify_all.md | 2 +- reference/cmath/tgamma.md | 2 +- .../basic_stringstream/op_constructor.md | 59 ++++++++++--------- reference/string/basic_string/replace.md | 2 +- 10 files changed, 39 insertions(+), 38 deletions(-) diff --git a/reference/algorithm/fill.md b/reference/algorithm/fill.md index 4828c5f282..80b66018c6 100644 --- a/reference/algorithm/fill.md +++ b/reference/algorithm/fill.md @@ -22,7 +22,7 @@ namespace std { constexpr void fill(ForwardIterator first, ForwardIterator last, - const T& value); // (1) C++20 + const T& value); // (1) C++26 template ::value_type* expected, typename atomic::value_type desired, memory_order success, - memory_order failure) noexcept; // (2) C++17 + memory_order failure) noexcept; // (2) C++26 } ``` * atomic[link atomic.md] diff --git a/reference/atomic/atomic_fetch_add.md b/reference/atomic/atomic_fetch_add.md index 87b5a3547d..9532a2e460 100644 --- a/reference/atomic/atomic_fetch_add.md +++ b/reference/atomic/atomic_fetch_add.md @@ -31,7 +31,7 @@ namespace std { constexpr T atomic_fetch_add( atomic* object, - typename atomic::difference_type operand) noexcept; // (2) C++17 + typename atomic::difference_type operand) noexcept; // (2) C++26 } ``` * atomic[link /reference/atomic/atomic.md] diff --git a/reference/atomic/atomic_flag_clear.md b/reference/atomic/atomic_flag_clear.md index bede0b52a8..fcd70f9a57 100644 --- a/reference/atomic/atomic_flag_clear.md +++ b/reference/atomic/atomic_flag_clear.md @@ -10,7 +10,7 @@ namespace std { atomic_flag_clear(volatile atomic_flag* object) noexcept; // (1) C++11 void - atomic_flag_clear(atomic_flag* object) noexcept; // (2) C++26 + atomic_flag_clear(atomic_flag* object) noexcept; // (2) C++11 constexpr void atomic_flag_clear(atomic_flag* object) noexcept; // (2) C++26 } diff --git a/reference/atomic/atomic_ref/notify_all.md b/reference/atomic/atomic_ref/notify_all.md index 64feab6415..a931b89606 100644 --- a/reference/atomic/atomic_ref/notify_all.md +++ b/reference/atomic/atomic_ref/notify_all.md @@ -7,7 +7,7 @@ ```cpp void notify_all() const noexcept; // (1) C++20 -constexpr void notify_all() const noexcept; // (1) C++20 +constexpr void notify_all() const noexcept; // (1) C++26 ``` ## 概要 diff --git a/reference/cmath/tgamma.md b/reference/cmath/tgamma.md index ae4b949ecf..3460acee9f 100644 --- a/reference/cmath/tgamma.md +++ b/reference/cmath/tgamma.md @@ -19,7 +19,7 @@ namespace std { double tgamma(Integral x); // (5) C++11 constexpr double - tgamma(Integral x); // (5) C++11 + tgamma(Integral x); // (5) C++26 float tgammaf(float x); // (6) C++17 diff --git a/reference/sstream/basic_stringstream/op_constructor.md b/reference/sstream/basic_stringstream/op_constructor.md index 06e23a9a9d..43a302aa19 100644 --- a/reference/sstream/basic_stringstream/op_constructor.md +++ b/reference/sstream/basic_stringstream/op_constructor.md @@ -8,63 +8,63 @@ basic_stringstream() : basic_stringstream(ios_base::in | ios_base::out) {} // (1) C++11 explicit basic_stringstream( - ios_base::openmode which); // (1) C++11 + ios_base::openmode which); // (2) C++11 explicit basic_stringstream( ios_base::openmode which = ios_base::in | ios_base::out); // (1)+(2) C++03 explicit basic_stringstream( const basic_string& s, - ios_base::openmode which = ios_base::in | ios_base::out); // (2) C++03 + ios_base::openmode which = ios_base::in | ios_base::out); // (3) C++03 explicit basic_stringstream( basic_string&& s, - ios_base::openmode which = ios_base::in | ios_base::out); // (3) C++20 + ios_base::openmode which = ios_base::in | ios_base::out); // (4) C++20 -basic_stringstream(ios_base::openmode which, const Allocator& a); // (4) C++20 +basic_stringstream(ios_base::openmode which, const Allocator& a); // (5) C++20 explicit basic_stringstream( const basic_string& s, const Allocator& a) - : basic_stringstream(s, ios_base::in | ios_base::out, a) {} // (5) C++20 + : basic_stringstream(s, ios_base::in | ios_base::out, a) {} // (6) C++20 explicit basic_stringstream( const basic_string& s, ios_base::openmode which, - const Allocator& a); // (6) C++20 + const Allocator& a); // (7) C++20 template explicit basic_stringstream( const basic_string& s, - ios_base::openmode which = ios_base::in | ios_base::out); // (7) C++20 + ios_base::openmode which = ios_base::in | ios_base::out); // (8) C++20 template basic_stringstream( const basic_string& s, const Allocator& a) - : basic_stringstream(s, ios_base::in | ios_base::out, a) {} // (8) C++20 + : basic_stringstream(s, ios_base::in | ios_base::out, a) {} // (9) C++20 template basic_stringstream( const basic_string& s, ios_base::openmode which, - const Allocator& a); // (9) C++20 + const Allocator& a); // (10) C++20 -basic_stringstream(basic_stringstream&& rhs); // (10) C++11 +basic_stringstream(basic_stringstream&& rhs); // (11) C++11 template explicit basic_stringstream( const T& t, - ios_base::openmode which = ios_base::in | ios_base::out); // (11) C++26 + ios_base::openmode which = ios_base::in | ios_base::out); // (12) C++26 template basic_stringstream( const T& t, - const Allocator& a); // (12) C++26 + const Allocator& a); // (13) C++26 template basic_stringstream(const T& t, ios_base::openmode which, - const Allocator& a); // (13) C++26 + const Allocator& a); // (14) C++26 ``` * ios_base[link /reference/ios/ios_base.md] * basic_string[link /reference/string/basic_string.md] @@ -77,19 +77,20 @@ basic_stringstream(const T& t, - (1) : デフォルトコンストラクタ - (2) : 指定されたモードで構築する - (3) : 初期文字列として[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピーを指定して構築する -- (4) : 指定されたモードとアロケータで構築する -- (5) : 初期文字列として[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピーと、アロケータを指定して構築する -- (6) : 初期文字列として[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピー、モード、アロケータを指定して構築する -- (7) : 初期文字列として`Allocator`に変換可能なアロケータをもつ[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピーと、モードを指定して構築する -- (8) : 初期文字列として`Allocator`に変換可能なアロケータをもつ[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピーと、アロケータを指定して構築する -- (9) : 初期文字列として`Allocator`に変換可能なアロケータをもつ[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピー、モード、アロケータを指定して構築する -- (10) : ムーブコンストラクタ -- (11) : 初期文字列として[`std::basic_string_view`](/reference/string_view/basic_string_view.md)に変換可能な文字列と、モードを指定して構築する -- (12) : 初期文字列として[`std::basic_string_view`](/reference/string_view/basic_string_view.md)に変換可能な文字列と、アロケータを指定して構築する -- (13) : 初期文字列として[`std::basic_string_view`](/reference/string_view/basic_string_view.md)に変換可能な文字列、モード、アロケータを指定して構築する +- (4) : 初期文字列として[`std::basic_string`](/reference/string/basic_string.md)オブジェクトの右辺値参照を指定して構築する +- (5) : 指定されたモードとアロケータで構築する +- (6) : 初期文字列として[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピーと、アロケータを指定して構築する +- (7) : 初期文字列として[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピー、モード、アロケータを指定して構築する +- (8) : 初期文字列として`Allocator`に変換可能なアロケータをもつ[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピーと、モードを指定して構築する +- (9) : 初期文字列として`Allocator`に変換可能なアロケータをもつ[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピーと、アロケータを指定して構築する +- (10) : 初期文字列として`Allocator`に変換可能なアロケータをもつ[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピー、モード、アロケータを指定して構築する +- (11) : ムーブコンストラクタ +- (12) : 初期文字列として[`std::basic_string_view`](/reference/string_view/basic_string_view.md)に変換可能な文字列と、モードを指定して構築する +- (13) : 初期文字列として[`std::basic_string_view`](/reference/string_view/basic_string_view.md)に変換可能な文字列と、アロケータを指定して構築する +- (14) : 初期文字列として[`std::basic_string_view`](/reference/string_view/basic_string_view.md)に変換可能な文字列、モード、アロケータを指定して構築する ## テンプレートパラメータ制約 -- (11), (12), (13) : `is_convertible_v>`が`true`であること +- (12), (13), (14) : `is_convertible_v>`が`true`であること ## 効果 - (1) : 内部の`basic_stringbuf`オブジェクトを`basic_stringbuf(ios_base::in | ios_base::out)`で構築する @@ -97,11 +98,11 @@ basic_stringstream(const T& t, - (3) : 内部の`basic_stringbuf`オブジェクトを`basic_stringbuf(s, which)`で構築する - (4) : 内部の`basic_stringbuf`オブジェクトを`basic_stringbuf(std::move(s), which)`で構築する - (5) : 内部の`basic_stringbuf`オブジェクトを`basic_stringbuf(which, a)`で構築する -- (6), (7), (8), (9) : 各引数は対応する`basic_stringbuf`のコンストラクタに渡される -- (10) : `rhs`から`basic_stringstream`オブジェクトをムーブ構築する -- (11) : `basic_string_view(t)`で文字列を初期化し、モードは`which`に設定する -- (12) : `basic_string_view(t)`で文字列を初期化し、モードは`ios_base::in | ios_base::out`、アロケータは`a`に設定する -- (13) : `basic_string_view(t)`で文字列を初期化し、モードは`which`、アロケータは`a`に設定する +- (6), (7), (8), (9), (10) : 各引数は対応する`basic_stringbuf`のコンストラクタに渡される +- (11) : `rhs`から`basic_stringstream`オブジェクトをムーブ構築する +- (12) : `basic_string_view(t)`で文字列を初期化し、モードは`which`に設定する +- (13) : `basic_string_view(t)`で文字列を初期化し、モードは`ios_base::in | ios_base::out`、アロケータは`a`に設定する +- (14) : `basic_string_view(t)`で文字列を初期化し、モードは`which`、アロケータは`a`に設定する ## 例 diff --git a/reference/string/basic_string/replace.md b/reference/string/basic_string/replace.md index 207ae106d2..6aad3304ca 100644 --- a/reference/string/basic_string/replace.md +++ b/reference/string/basic_string/replace.md @@ -158,7 +158,7 @@ template constexpr basic_string& replace(size_type pos1, size_type n1, - const T& t); // (12) C++17 + const T& t); // (12) C++20 template basic_string& From 4e12116e6e998dc265c7ff0859108707c066ae18 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sun, 29 Jun 2025 15:56:54 +0900 Subject: [PATCH 1908/3948] fix some links in code --- reference/cfloat/flt_rounds.md | 2 +- reference/execution/execution/run_loop/run-loop-opstate.md | 2 +- reference/filesystem/file_time_type.md | 4 ++-- reference/format/vformat.md | 2 +- reference/future/promise/set_value.md | 1 + reference/future/shared_future/get.md | 3 ++- reference/numbers/inv_sqrt3.md | 2 +- reference/numbers/sqrt2.md | 2 +- reference/numbers/sqrt3.md | 2 +- reference/ranges/as_rvalue_view/end.md | 4 ++-- reference/system_error/error_code/default_error_condition.md | 2 +- reference/system_error/error_condition/assign.md | 2 +- reference/type_traits/disjunction.md | 2 +- 13 files changed, 16 insertions(+), 14 deletions(-) diff --git a/reference/cfloat/flt_rounds.md b/reference/cfloat/flt_rounds.md index 7aa09e0191..d125fcd94b 100644 --- a/reference/cfloat/flt_rounds.md +++ b/reference/cfloat/flt_rounds.md @@ -41,7 +41,7 @@ int main() } ``` * FLT_ROUNDS[color ff0000] -* std::fesetround[link ../cfenv.md] +* std::fesetround[link ../cfenv/fesetround.md] * FE_TOWARDZERO[link ../cfenv/fe_towardzero.md] ### 出力例 diff --git a/reference/execution/execution/run_loop/run-loop-opstate.md b/reference/execution/execution/run_loop/run-loop-opstate.md index fb631d0513..a629dda3b2 100644 --- a/reference/execution/execution/run_loop/run-loop-opstate.md +++ b/reference/execution/execution/run_loop/run-loop-opstate.md @@ -54,7 +54,7 @@ struct run-loop-opstate-base { // exposition only } ``` * push-back[link run.md] - * set_error[link ../set_value.md] + * set_error[link ../set_error.md] * addressof[link /reference/memory/addressof.md] * std::move[link /reference/utility/move.md] * current_exception()[link /reference/exception/current_exception.md] diff --git a/reference/filesystem/file_time_type.md b/reference/filesystem/file_time_type.md index 377840dbce..f542e9de8e 100644 --- a/reference/filesystem/file_time_type.md +++ b/reference/filesystem/file_time_type.md @@ -108,8 +108,8 @@ int main() fs::last_write_time("regular.txt", fs::file_time_type::clock::now()); } ``` -* fs::last_write_time[color ff0000] -* fs::file_time_type[link file_time_type.md] +* fs::file_time_type[color ff0000] +* fs::last_write_time[link last_write_time.md] * fs::create_directory[link create_directory.md] * chrono::sys_time[link /reference/chrono/sys_time.md] * chrono::file_clock[link /reference/chrono/file_clock.md] diff --git a/reference/format/vformat.md b/reference/format/vformat.md index 54a2f69bc5..27c099b76a 100644 --- a/reference/format/vformat.md +++ b/reference/format/vformat.md @@ -78,7 +78,7 @@ string vformat(const locale& loc, wstring_view fmt, wformat_args args) { * format_args[link /reference/format/basic_format_args.md] * wformat_args[link /reference/format/basic_format_args.md] * locale[link /reference/locale/locale.md] -* vformat_to[link vformat.md] +* vformat_to[link vformat_to.md] * back_inserter[link /reference/iterator/back_inserter.md] ## バージョン diff --git a/reference/future/promise/set_value.md b/reference/future/promise/set_value.md index e46e9d720d..9ce46eba6e 100644 --- a/reference/future/promise/set_value.md +++ b/reference/future/promise/set_value.md @@ -198,6 +198,7 @@ int main() std::cout << result << std::endl; } ``` +* set_value[color ff0000] ### 出力 ``` diff --git a/reference/future/shared_future/get.md b/reference/future/shared_future/get.md index 15b1bec706..5f33047225 100644 --- a/reference/future/shared_future/get.md +++ b/reference/future/shared_future/get.md @@ -150,7 +150,8 @@ int main() x.join(); } ``` -* set_value[color ff0000] +* get()[color ff0000] +* p.set_value()[link /reference/future/promise/set_value.md] ### 出力例 ``` diff --git a/reference/numbers/inv_sqrt3.md b/reference/numbers/inv_sqrt3.md index f60f846ed5..e6812d42d0 100644 --- a/reference/numbers/inv_sqrt3.md +++ b/reference/numbers/inv_sqrt3.md @@ -74,7 +74,7 @@ int main() ``` * std::numbers::inv_sqrt3[color ff0000] * std::numbers::inv_sqrt3_v[color ff0000] -* std::sqrt[link /reference/cmath/log.md] +* std::sqrt[link /reference/cmath/sqrt.md] ### 出力 ``` diff --git a/reference/numbers/sqrt2.md b/reference/numbers/sqrt2.md index 32b44749fb..e3eaaf80dc 100644 --- a/reference/numbers/sqrt2.md +++ b/reference/numbers/sqrt2.md @@ -50,7 +50,7 @@ int main() ``` * std::numbers::sqrt2[color ff0000] * std::numbers::sqrt2_v[color ff0000] -* std::sqrt[link /reference/cmath/log.md] +* std::sqrt[link /reference/cmath/sqrt.md] ### 出力 ``` diff --git a/reference/numbers/sqrt3.md b/reference/numbers/sqrt3.md index 36046a152d..28fa567b12 100644 --- a/reference/numbers/sqrt3.md +++ b/reference/numbers/sqrt3.md @@ -50,7 +50,7 @@ int main() ``` * std::numbers::sqrt3[color ff0000] * std::numbers::sqrt3_v[color ff0000] -* std::sqrt[link /reference/cmath/log.md] +* std::sqrt[link /reference/cmath/sqrt.md] ### 出力 ``` diff --git a/reference/ranges/as_rvalue_view/end.md b/reference/ranges/as_rvalue_view/end.md index 272f11f159..3e01d7821d 100644 --- a/reference/ranges/as_rvalue_view/end.md +++ b/reference/ranges/as_rvalue_view/end.md @@ -51,8 +51,8 @@ int main() { } } ``` -* begin[color ff0000] -* end()[link end.md] +* end[color ff0000] +* begin()[link begin.md] ### 出力 ``` diff --git a/reference/system_error/error_code/default_error_condition.md b/reference/system_error/error_code/default_error_condition.md index 8764b48b39..5e15eed4eb 100644 --- a/reference/system_error/error_code/default_error_condition.md +++ b/reference/system_error/error_code/default_error_condition.md @@ -61,7 +61,7 @@ int main() * std::error_condition[link /reference/system_error/error_condition.md] * ec.value()[link value.md] * ec.category()[link category.md] -* ec.message()[link category.md] +* ec.message()[link message.md] * name()[link /reference/system_error/error_category/name.md] * ed.value()[link /reference/system_error/error_condition/value.md] * ed.category()[link /reference/system_error/error_condition/category.md] diff --git a/reference/system_error/error_condition/assign.md b/reference/system_error/error_condition/assign.md index ff61f46898..e1a42c7ec0 100644 --- a/reference/system_error/error_condition/assign.md +++ b/reference/system_error/error_condition/assign.md @@ -8,7 +8,7 @@ ```cpp void assign(int val, const error_category& cat) noexcept; ``` -* error_category[link assign.md] +* error_category[link /reference/system_error/error_category.md] ## 概要 エラー値とエラーカテゴリを再設定する。 diff --git a/reference/type_traits/disjunction.md b/reference/type_traits/disjunction.md index 23df2ea753..39ed7d45d6 100644 --- a/reference/type_traits/disjunction.md +++ b/reference/type_traits/disjunction.md @@ -70,7 +70,7 @@ int main() ``` * std::disjunction[color ff0000] * std::is_pointer[link is_pointer.md] -* std::is_member_object_pointer[link is_move_assignable.md] +* std::is_member_object_pointer[link is_member_object_pointer.md] * std::is_member_function_pointer[link is_member_function_pointer.md] * std::enable_if_t[link enable_if.md] From 01869e00d13a88d59d7ad18b8890ef091d062420 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sun, 29 Jun 2025 16:04:11 +0900 Subject: [PATCH 1909/3948] fix some versions --- reference/functional/function/op_deduction_guide.md | 2 +- reference/random/philox_engine/op_istream.md | 4 ---- reference/ranges/empty_view/end.md | 2 +- reference/ranges/repeat_view/op_deduction_guide.md | 2 +- reference/string_view/basic_string_view/contains.md | 2 +- 5 files changed, 4 insertions(+), 8 deletions(-) diff --git a/reference/functional/function/op_deduction_guide.md b/reference/functional/function/op_deduction_guide.md index fbda0db09a..43f3d4e3a4 100644 --- a/reference/functional/function/op_deduction_guide.md +++ b/reference/functional/function/op_deduction_guide.md @@ -78,7 +78,7 @@ int main() ## バージョン ### 言語 -- C++20 +- C++17 ### 処理系 - [Clang](/implementation.md#clang): diff --git a/reference/random/philox_engine/op_istream.md b/reference/random/philox_engine/op_istream.md index 23384edd0e..dae3941356 100644 --- a/reference/random/philox_engine/op_istream.md +++ b/reference/random/philox_engine/op_istream.md @@ -66,10 +66,6 @@ int main() ### 出力 (未検証) -## バージョン -### 言語 -- C++11 - ## バージョン ### 言語 - C++26 diff --git a/reference/ranges/empty_view/end.md b/reference/ranges/empty_view/end.md index 6ac4b4399b..65af00f3b2 100644 --- a/reference/ranges/empty_view/end.md +++ b/reference/ranges/empty_view/end.md @@ -3,7 +3,7 @@ * std::ranges[meta namespace] * empty_view[meta class] * function[meta id-type] -* cpp23[meta cpp] +* cpp20[meta cpp] ```cpp static constexpr T* end() noexcept; // (1) C++20 diff --git a/reference/ranges/repeat_view/op_deduction_guide.md b/reference/ranges/repeat_view/op_deduction_guide.md index 87c87c7cc4..5a5bdc18e1 100644 --- a/reference/ranges/repeat_view/op_deduction_guide.md +++ b/reference/ranges/repeat_view/op_deduction_guide.md @@ -2,7 +2,7 @@ * ranges[meta header] * std::ranges[meta namespace] * function[meta id-type] -* cpp20[meta cpp] +* cpp23[meta cpp] ```cpp namespace std::ranges { diff --git a/reference/string_view/basic_string_view/contains.md b/reference/string_view/basic_string_view/contains.md index 1cad2cabd2..d0e2d4f782 100644 --- a/reference/string_view/basic_string_view/contains.md +++ b/reference/string_view/basic_string_view/contains.md @@ -66,7 +66,7 @@ int main() { ## バージョン ### 言語 -- C++20 +- C++23 ### 処理系 - [Clang](/implementation.md#clang): 12.0 [mark verified] From f5c719e89d0b7319bc5967a79361b8473627d30b Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 30 Jun 2025 11:53:52 +0900 Subject: [PATCH 1910/3948] =?UTF-8?q?[meta=20class]=20=E3=81=AE=E6=8A=9C?= =?UTF-8?q?=E3=81=91=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/as_const_view/op_deduction_guide.md | 1 + reference/ranges/as_rvalue_view/op_deduction_guide.md | 1 + reference/ranges/concat_view/op_deduction_guide.md | 1 + reference/ranges/drop_view/op_deduction_guide.md | 1 + reference/ranges/drop_while_view/op_deduction_guide.md | 1 + reference/ranges/filter_view/op_deduction_guide.md | 1 + reference/ranges/iota_view/op_deduction_guide.md | 1 + reference/ranges/join_view/op_deduction_guide.md | 1 + reference/ranges/join_with_view/op_deduction_guide.md | 1 + reference/ranges/lazy_split_view/op_deduction_guide.md | 1 + reference/ranges/ref_view/op_deduction_guide.md | 1 + reference/ranges/repeat_view/op_deduction_guide.md | 1 + reference/ranges/single_view/op_deduction_guide.md | 1 + reference/ranges/split_view/op_deduction_guide.md | 1 + reference/ranges/subrange/op_deduction_guide.md | 1 + reference/ranges/take_view/op_deduction_guide.md | 1 + reference/ranges/take_while_view/op_deduction_guide.md | 1 + reference/ranges/transform_view/op_deduction_guide.md | 1 + 18 files changed, 18 insertions(+) diff --git a/reference/ranges/as_const_view/op_deduction_guide.md b/reference/ranges/as_const_view/op_deduction_guide.md index 6223e704ba..fecbc42808 100644 --- a/reference/ranges/as_const_view/op_deduction_guide.md +++ b/reference/ranges/as_const_view/op_deduction_guide.md @@ -1,6 +1,7 @@ # 推論補助 * ranges[meta header] * std::ranges[meta namespace] +* as_const_view[meta class] * function[meta id-type] * cpp23[meta cpp] diff --git a/reference/ranges/as_rvalue_view/op_deduction_guide.md b/reference/ranges/as_rvalue_view/op_deduction_guide.md index e4d214ff67..9ea63448a2 100644 --- a/reference/ranges/as_rvalue_view/op_deduction_guide.md +++ b/reference/ranges/as_rvalue_view/op_deduction_guide.md @@ -1,6 +1,7 @@ # 推論補助 * ranges[meta header] * std::ranges[meta namespace] +* as_rvalue_view[meta class] * function[meta id-type] * cpp23[meta cpp] diff --git a/reference/ranges/concat_view/op_deduction_guide.md b/reference/ranges/concat_view/op_deduction_guide.md index a82d21f75a..0f91c5166f 100644 --- a/reference/ranges/concat_view/op_deduction_guide.md +++ b/reference/ranges/concat_view/op_deduction_guide.md @@ -1,6 +1,7 @@ # 推論補助 * ranges[meta header] * std::ranges[meta namespace] +* concat_view[meta class] * function[meta id-type] * cpp26[meta cpp] diff --git a/reference/ranges/drop_view/op_deduction_guide.md b/reference/ranges/drop_view/op_deduction_guide.md index d74629dac5..acbe9b2d02 100644 --- a/reference/ranges/drop_view/op_deduction_guide.md +++ b/reference/ranges/drop_view/op_deduction_guide.md @@ -1,6 +1,7 @@ # 推論補助 * ranges[meta header] * std::ranges[meta namespace] +* drop_view[meta class] * function[meta id-type] * cpp20[meta cpp] diff --git a/reference/ranges/drop_while_view/op_deduction_guide.md b/reference/ranges/drop_while_view/op_deduction_guide.md index acb96db841..f46fc8a1b8 100644 --- a/reference/ranges/drop_while_view/op_deduction_guide.md +++ b/reference/ranges/drop_while_view/op_deduction_guide.md @@ -1,6 +1,7 @@ # 推論補助 * ranges[meta header] * std::ranges[meta namespace] +* drop_while_view[meta class] * function[meta id-type] * cpp20[meta cpp] diff --git a/reference/ranges/filter_view/op_deduction_guide.md b/reference/ranges/filter_view/op_deduction_guide.md index 2c8de43f09..66fb6f189e 100644 --- a/reference/ranges/filter_view/op_deduction_guide.md +++ b/reference/ranges/filter_view/op_deduction_guide.md @@ -1,6 +1,7 @@ # 推論補助 * ranges[meta header] * std::ranges[meta namespace] +* filter_view[meta class] * function[meta id-type] * cpp20[meta cpp] diff --git a/reference/ranges/iota_view/op_deduction_guide.md b/reference/ranges/iota_view/op_deduction_guide.md index e4066645c0..d992c19f8d 100644 --- a/reference/ranges/iota_view/op_deduction_guide.md +++ b/reference/ranges/iota_view/op_deduction_guide.md @@ -1,6 +1,7 @@ # 推論補助 * ranges[meta header] * std::ranges[meta namespace] +* iota_view[meta class] * function[meta id-type] * cpp20[meta cpp] diff --git a/reference/ranges/join_view/op_deduction_guide.md b/reference/ranges/join_view/op_deduction_guide.md index b5e29d85e0..5720d6c3f1 100644 --- a/reference/ranges/join_view/op_deduction_guide.md +++ b/reference/ranges/join_view/op_deduction_guide.md @@ -1,6 +1,7 @@ # 推論補助 * ranges[meta header] * std::ranges[meta namespace] +* join_view[meta class] * function[meta id-type] * cpp20[meta cpp] diff --git a/reference/ranges/join_with_view/op_deduction_guide.md b/reference/ranges/join_with_view/op_deduction_guide.md index 0372e92440..3921a11de4 100644 --- a/reference/ranges/join_with_view/op_deduction_guide.md +++ b/reference/ranges/join_with_view/op_deduction_guide.md @@ -1,6 +1,7 @@ # 推論補助 * ranges[meta header] * std::ranges[meta namespace] +* join_with_view[meta class] * function[meta id-type] * cpp23[meta cpp] diff --git a/reference/ranges/lazy_split_view/op_deduction_guide.md b/reference/ranges/lazy_split_view/op_deduction_guide.md index 5e24f2dd7f..111e10d7fb 100644 --- a/reference/ranges/lazy_split_view/op_deduction_guide.md +++ b/reference/ranges/lazy_split_view/op_deduction_guide.md @@ -1,6 +1,7 @@ # 推論補助 * ranges[meta header] * std::ranges[meta namespace] +* lazy_split_view[meta class] * function[meta id-type] * cpp20[meta cpp] diff --git a/reference/ranges/ref_view/op_deduction_guide.md b/reference/ranges/ref_view/op_deduction_guide.md index a9e8c0995a..1792e14817 100644 --- a/reference/ranges/ref_view/op_deduction_guide.md +++ b/reference/ranges/ref_view/op_deduction_guide.md @@ -1,6 +1,7 @@ # 推論補助 * ranges[meta header] * std::ranges[meta namespace] +* ref_view[meta class] * function[meta id-type] * cpp20[meta cpp] diff --git a/reference/ranges/repeat_view/op_deduction_guide.md b/reference/ranges/repeat_view/op_deduction_guide.md index 5a5bdc18e1..ac84c17549 100644 --- a/reference/ranges/repeat_view/op_deduction_guide.md +++ b/reference/ranges/repeat_view/op_deduction_guide.md @@ -1,6 +1,7 @@ # 推論補助 * ranges[meta header] * std::ranges[meta namespace] +* repeat_view[meta class] * function[meta id-type] * cpp23[meta cpp] diff --git a/reference/ranges/single_view/op_deduction_guide.md b/reference/ranges/single_view/op_deduction_guide.md index 122d810452..4055c1f250 100644 --- a/reference/ranges/single_view/op_deduction_guide.md +++ b/reference/ranges/single_view/op_deduction_guide.md @@ -1,6 +1,7 @@ # 推論補助 * ranges[meta header] * std::ranges[meta namespace] +* single_view[meta class] * function[meta id-type] * cpp20[meta cpp] diff --git a/reference/ranges/split_view/op_deduction_guide.md b/reference/ranges/split_view/op_deduction_guide.md index 004edda08b..ce8a0b2cde 100644 --- a/reference/ranges/split_view/op_deduction_guide.md +++ b/reference/ranges/split_view/op_deduction_guide.md @@ -1,6 +1,7 @@ # 推論補助 * ranges[meta header] * std::ranges[meta namespace] +* split_view[meta class] * function[meta id-type] * cpp20[meta cpp] diff --git a/reference/ranges/subrange/op_deduction_guide.md b/reference/ranges/subrange/op_deduction_guide.md index 44eb62c083..5eb1911868 100644 --- a/reference/ranges/subrange/op_deduction_guide.md +++ b/reference/ranges/subrange/op_deduction_guide.md @@ -1,6 +1,7 @@ # 推論補助 * ranges[meta header] * std::ranges[meta namespace] +* subrange[meta class] * function[meta id-type] * cpp20[meta cpp] diff --git a/reference/ranges/take_view/op_deduction_guide.md b/reference/ranges/take_view/op_deduction_guide.md index ede2a16831..4ddbaa8c09 100644 --- a/reference/ranges/take_view/op_deduction_guide.md +++ b/reference/ranges/take_view/op_deduction_guide.md @@ -1,6 +1,7 @@ # 推論補助 * ranges[meta header] * std::ranges[meta namespace] +* take_view[meta class] * function[meta id-type] * cpp20[meta cpp] diff --git a/reference/ranges/take_while_view/op_deduction_guide.md b/reference/ranges/take_while_view/op_deduction_guide.md index 318327942a..badba1cc9b 100644 --- a/reference/ranges/take_while_view/op_deduction_guide.md +++ b/reference/ranges/take_while_view/op_deduction_guide.md @@ -1,6 +1,7 @@ # 推論補助 * ranges[meta header] * std::ranges[meta namespace] +* take_while_view[meta class] * function[meta id-type] * cpp20[meta cpp] diff --git a/reference/ranges/transform_view/op_deduction_guide.md b/reference/ranges/transform_view/op_deduction_guide.md index 0d51b1dfa4..032298ac0d 100644 --- a/reference/ranges/transform_view/op_deduction_guide.md +++ b/reference/ranges/transform_view/op_deduction_guide.md @@ -1,6 +1,7 @@ # 推論補助 * ranges[meta header] * std::ranges[meta namespace] +* transform_view[meta class] * function[meta id-type] * cpp20[meta cpp] From 7fe13579cf47b3a25620dec73ae74de33fede9ec Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 30 Jun 2025 14:31:11 +0900 Subject: [PATCH 1911/3948] =?UTF-8?q?[meta=20id-type]=20=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_in_found_result.md | 2 +- reference/algorithm/ranges_in_fun_result.md | 2 +- reference/algorithm/ranges_in_in_out_result.md | 2 +- reference/algorithm/ranges_in_in_result.md | 2 +- reference/algorithm/ranges_in_out_out_result.md | 2 +- reference/algorithm/ranges_in_out_result.md | 2 +- reference/algorithm/ranges_in_value_result.md | 2 +- reference/algorithm/ranges_min_max_result.md | 2 +- reference/algorithm/ranges_out_value_result.md | 2 +- reference/ios/ios_base/type-event.md | 2 +- reference/ranges/subrange/get.md | 2 +- reference/ratio/ratio_add.md | 2 +- reference/ratio/ratio_divide.md | 2 +- reference/ratio/ratio_multiply.md | 2 +- reference/ratio/ratio_subtract.md | 2 +- reference/type_traits/void_t.md | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/reference/algorithm/ranges_in_found_result.md b/reference/algorithm/ranges_in_found_result.md index c392f6c709..da742ff432 100644 --- a/reference/algorithm/ranges_in_found_result.md +++ b/reference/algorithm/ranges_in_found_result.md @@ -1,7 +1,7 @@ # in_found_result * algorithm[meta header] * std::ranges[meta namespace] -* function template[meta id-type] +* class template[meta id-type] * cpp20[meta cpp] ```cpp diff --git a/reference/algorithm/ranges_in_fun_result.md b/reference/algorithm/ranges_in_fun_result.md index f9a16f4aaa..e993e4fa54 100644 --- a/reference/algorithm/ranges_in_fun_result.md +++ b/reference/algorithm/ranges_in_fun_result.md @@ -1,7 +1,7 @@ # in_fun_result * algorithm[meta header] * std::ranges[meta namespace] -* function template[meta id-type] +* class template[meta id-type] * cpp20[meta cpp] ```cpp diff --git a/reference/algorithm/ranges_in_in_out_result.md b/reference/algorithm/ranges_in_in_out_result.md index 55fcd85f18..ff9032d0af 100644 --- a/reference/algorithm/ranges_in_in_out_result.md +++ b/reference/algorithm/ranges_in_in_out_result.md @@ -1,7 +1,7 @@ # in_in_out_result * algorithm[meta header] * std::ranges[meta namespace] -* function template[meta id-type] +* class template[meta id-type] * cpp20[meta cpp] ```cpp diff --git a/reference/algorithm/ranges_in_in_result.md b/reference/algorithm/ranges_in_in_result.md index c75af14082..4e25b2408b 100644 --- a/reference/algorithm/ranges_in_in_result.md +++ b/reference/algorithm/ranges_in_in_result.md @@ -1,7 +1,7 @@ # in_in_result * algorithm[meta header] * std::ranges[meta namespace] -* function template[meta id-type] +* class template[meta id-type] * cpp20[meta cpp] ```cpp diff --git a/reference/algorithm/ranges_in_out_out_result.md b/reference/algorithm/ranges_in_out_out_result.md index 207fd2f91a..e998f93dd8 100644 --- a/reference/algorithm/ranges_in_out_out_result.md +++ b/reference/algorithm/ranges_in_out_out_result.md @@ -1,7 +1,7 @@ # in_out_out_result * algorithm[meta header] * std::ranges[meta namespace] -* function template[meta id-type] +* class template[meta id-type] * cpp20[meta cpp] ```cpp diff --git a/reference/algorithm/ranges_in_out_result.md b/reference/algorithm/ranges_in_out_result.md index ba0241ad9e..f0885623e0 100644 --- a/reference/algorithm/ranges_in_out_result.md +++ b/reference/algorithm/ranges_in_out_result.md @@ -1,7 +1,7 @@ # in_out_result * algorithm[meta header] * std::ranges[meta namespace] -* function template[meta id-type] +* class template[meta id-type] * cpp20[meta cpp] ```cpp diff --git a/reference/algorithm/ranges_in_value_result.md b/reference/algorithm/ranges_in_value_result.md index d38609df9f..f2658d58a9 100644 --- a/reference/algorithm/ranges_in_value_result.md +++ b/reference/algorithm/ranges_in_value_result.md @@ -1,7 +1,7 @@ # in_value_result * algorithm[meta header] * std::ranges[meta namespace] -* class[meta id-type] +* class template[meta id-type] * cpp23[meta cpp] ```cpp diff --git a/reference/algorithm/ranges_min_max_result.md b/reference/algorithm/ranges_min_max_result.md index 2e6ae7e787..87f1a3d3d5 100644 --- a/reference/algorithm/ranges_min_max_result.md +++ b/reference/algorithm/ranges_min_max_result.md @@ -1,7 +1,7 @@ # min_max_result * algorithm[meta header] * std::ranges[meta namespace] -* function template[meta id-type] +* class template[meta id-type] * cpp20[meta cpp] ```cpp diff --git a/reference/algorithm/ranges_out_value_result.md b/reference/algorithm/ranges_out_value_result.md index 7433145f33..d637e67538 100644 --- a/reference/algorithm/ranges_out_value_result.md +++ b/reference/algorithm/ranges_out_value_result.md @@ -1,7 +1,7 @@ # out_value_result * algorithm[meta header] * std::ranges[meta namespace] -* function template[meta id-type] +* class template[meta id-type] * cpp23[meta cpp] ```cpp diff --git a/reference/ios/ios_base/type-event.md b/reference/ios/ios_base/type-event.md index bc59431738..87cdf46f35 100644 --- a/reference/ios/ios_base/type-event.md +++ b/reference/ios/ios_base/type-event.md @@ -1,6 +1,6 @@ # event * ios[meta header] -* type-alias[meta id-type] +* enum[meta id-type] * std[meta namespace] * ios_base[meta class] diff --git a/reference/ranges/subrange/get.md b/reference/ranges/subrange/get.md index c53240ac89..1ee89a0bbf 100644 --- a/reference/ranges/subrange/get.md +++ b/reference/ranges/subrange/get.md @@ -1,7 +1,7 @@ # get * ranges[meta header] * std[meta namespace] -* class template[meta id-type] +* function template[meta id-type] * cpp20[meta cpp] ```cpp diff --git a/reference/ratio/ratio_add.md b/reference/ratio/ratio_add.md index 003cb7278e..d153d65403 100644 --- a/reference/ratio/ratio_add.md +++ b/reference/ratio/ratio_add.md @@ -1,7 +1,7 @@ # ratio_add * ratio[meta header] * std[meta namespace] -* class template[meta id-type] +* type-alias[meta id-type] * cpp11[meta cpp] ```cpp diff --git a/reference/ratio/ratio_divide.md b/reference/ratio/ratio_divide.md index 8147d02da3..452d5ab1c9 100644 --- a/reference/ratio/ratio_divide.md +++ b/reference/ratio/ratio_divide.md @@ -1,7 +1,7 @@ # ratio_divide * ratio[meta header] * std[meta namespace] -* class template[meta id-type] +* type-alias[meta id-type] * cpp11[meta cpp] ```cpp diff --git a/reference/ratio/ratio_multiply.md b/reference/ratio/ratio_multiply.md index 056b5711e9..d640cba3b9 100644 --- a/reference/ratio/ratio_multiply.md +++ b/reference/ratio/ratio_multiply.md @@ -1,7 +1,7 @@ # ratio_multiply * ratio[meta header] * std[meta namespace] -* class template[meta id-type] +* type-alias[meta id-type] * cpp11[meta cpp] ```cpp diff --git a/reference/ratio/ratio_subtract.md b/reference/ratio/ratio_subtract.md index 8f04dab8f2..2a6285a905 100644 --- a/reference/ratio/ratio_subtract.md +++ b/reference/ratio/ratio_subtract.md @@ -1,7 +1,7 @@ # ratio_subtract * ratio[meta header] * std[meta namespace] -* class template[meta id-type] +* type-alias[meta id-type] * cpp11[meta cpp] ```cpp diff --git a/reference/type_traits/void_t.md b/reference/type_traits/void_t.md index c366b20955..6186f39d39 100644 --- a/reference/type_traits/void_t.md +++ b/reference/type_traits/void_t.md @@ -1,7 +1,7 @@ # void_t * type_traits[meta header] * std[meta namespace] -* class template[meta id-type] +* type-alias[meta id-type] * cpp17[meta cpp] ```cpp From 0328c1179dd1c665ec5d8485801c14a4da9555e1 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 30 Jun 2025 14:34:19 +0900 Subject: [PATCH 1912/3948] =?UTF-8?q?=E3=82=AF=E3=83=A9=E3=82=B9=E5=AE=9A?= =?UTF-8?q?=E7=BE=A9=E3=81=AE=E5=BE=8C=E3=81=AE=E3=82=BB=E3=83=9F=E3=82=B3?= =?UTF-8?q?=E3=83=AD=E3=83=B3=E5=BF=98=E3=82=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/compare/compare_three_way_result.md | 2 +- reference/iterator/istream_iterator.md | 2 +- reference/iterator/istreambuf_iterator.md | 2 +- reference/iterator/ostream_iterator.md | 2 +- reference/iterator/ostreambuf_iterator.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/reference/compare/compare_three_way_result.md b/reference/compare/compare_three_way_result.md index 9728ea4d26..f478606794 100644 --- a/reference/compare/compare_three_way_result.md +++ b/reference/compare/compare_three_way_result.md @@ -52,7 +52,7 @@ struct wrap { auto operator<=>(const wrap&) const -> fallback_comp3way_t = default; -} +}; // <=>を定義しない型 struct no_spaceship { diff --git a/reference/iterator/istream_iterator.md b/reference/iterator/istream_iterator.md index 3d2818ea53..c325f3e274 100644 --- a/reference/iterator/istream_iterator.md +++ b/reference/iterator/istream_iterator.md @@ -8,7 +8,7 @@ namespace std { template , class Distance = ptrdiff_t> class istream_iterator - : public iterator + : public iterator; } ``` * char_traits[link /reference/string/char_traits.md] diff --git a/reference/iterator/istreambuf_iterator.md b/reference/iterator/istreambuf_iterator.md index 066c5a35f3..c76d20f76d 100644 --- a/reference/iterator/istreambuf_iterator.md +++ b/reference/iterator/istreambuf_iterator.md @@ -7,7 +7,7 @@ namespace std { template > class istreambuf_iterator - : public iterator + : public iterator; } ``` * char_traits[link /reference/string/char_traits.md] diff --git a/reference/iterator/ostream_iterator.md b/reference/iterator/ostream_iterator.md index 86bcb604f7..0a8e0a1a44 100644 --- a/reference/iterator/ostream_iterator.md +++ b/reference/iterator/ostream_iterator.md @@ -7,7 +7,7 @@ namespace std { template > class ostream_iterator - : public iterator + : public iterator; } ``` * char_traits[link /reference/string/char_traits.md] diff --git a/reference/iterator/ostreambuf_iterator.md b/reference/iterator/ostreambuf_iterator.md index 57f1002778..6670f32e2f 100644 --- a/reference/iterator/ostreambuf_iterator.md +++ b/reference/iterator/ostreambuf_iterator.md @@ -7,7 +7,7 @@ namespace std { template > class ostreambuf_iterator - : public iterator + : public iterator; } ``` * char_traits[link /reference/string/char_traits.md] From 88ba553f248e6237f9bb24e603f54ada47725bd2 Mon Sep 17 00:00:00 2001 From: suomesta Date: Mon, 30 Jun 2025 21:27:59 +0900 Subject: [PATCH 1913/3948] improve std::vector::shrink_to_fit() --- reference/vector/vector/shrink_to_fit.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/vector/vector/shrink_to_fit.md b/reference/vector/vector/shrink_to_fit.md index 686f2ad5a3..8224094cfd 100644 --- a/reference/vector/vector/shrink_to_fit.md +++ b/reference/vector/vector/shrink_to_fit.md @@ -53,13 +53,13 @@ int main() // 領域を切り詰める v.shrink_to_fit(); std::cout << v.capacity() << std::endl; - assert(v.capacity() == v.size()); } ``` * shrink_to_fit()[color ff0000] * v.capacity()[link capacity.md] +* v.erase[link erase.md] -### 出力 +### 出力例 ``` 3 3 From 4f4fdfb987f51eaf72cf6e4bb4df98612f035ced Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Tue, 1 Jul 2025 17:10:29 +0900 Subject: [PATCH 1914/3948] =?UTF-8?q?=E3=82=BF=E3=82=A4=E3=83=88=E3=83=AB?= =?UTF-8?q?=E3=81=AE=E9=96=93=E9=81=95=E3=81=84=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_contains_subrange.md | 2 +- reference/chrono/weekday_indexed/index.md | 2 +- reference/stacktrace/basic_stacktrace/get_allocator.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/algorithm/ranges_contains_subrange.md b/reference/algorithm/ranges_contains_subrange.md index 460c17b481..9be4d01fe9 100644 --- a/reference/algorithm/ranges_contains_subrange.md +++ b/reference/algorithm/ranges_contains_subrange.md @@ -1,4 +1,4 @@ -# search +# contains_subrange * algorithm[meta header] * std::ranges[meta namespace] * function template[meta id-type] diff --git a/reference/chrono/weekday_indexed/index.md b/reference/chrono/weekday_indexed/index.md index cb7053089b..52651980de 100644 --- a/reference/chrono/weekday_indexed/index.md +++ b/reference/chrono/weekday_indexed/index.md @@ -1,4 +1,4 @@ -# weekday +# index * chrono[meta header] * std::chrono[meta namespace] * weekday_indexed[meta class] diff --git a/reference/stacktrace/basic_stacktrace/get_allocator.md b/reference/stacktrace/basic_stacktrace/get_allocator.md index 44153124c4..41a87e8ae3 100644 --- a/reference/stacktrace/basic_stacktrace/get_allocator.md +++ b/reference/stacktrace/basic_stacktrace/get_allocator.md @@ -1,4 +1,4 @@ -# max_size +# get_allocator * stacktrace[meta header] * std[meta namespace] * basic_stacktrace[meta class] From be3b1439fbb6c27137451b60c305739abfc1165c Mon Sep 17 00:00:00 2001 From: suomesta Date: Tue, 1 Jul 2025 21:03:30 +0900 Subject: [PATCH 1915/3948] improve --- reference/charconv.md | 2 +- reference/charconv/from_chars.md | 2 +- reference/charconv/to_chars.md | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/reference/charconv.md b/reference/charconv.md index da6702674c..77c2b7317a 100644 --- a/reference/charconv.md +++ b/reference/charconv.md @@ -66,7 +66,7 @@ XMLやJSONに代表されるテキストベースのデータを利用するケ - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0(整数のみ) [mark verified], 14.0(to_chars()のみ浮動小数点もsupport) [mark verified] +- [Clang](/implementation.md#clang): 7.0(整数のみ) [mark verified], 14.0(to_chars()のみ浮動小数点もsupport), 20.1(from_chars()もdouble, floatをsupport) [mark verified] - [GCC](/implementation.md#gcc): 8.0(整数のみ) [mark verified], 11.1(full support) [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2017 update 7(整数のみ) [mark verified], update 9(full support) [mark verified] diff --git a/reference/charconv/from_chars.md b/reference/charconv/from_chars.md index 03215c68ac..352832016a 100644 --- a/reference/charconv/from_chars.md +++ b/reference/charconv/from_chars.md @@ -514,7 +514,7 @@ int main() { - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0(整数のみ) [mark verified] +- [Clang](/implementation.md#clang): 7.0(整数のみ), 20.1(from_chars()もdouble, floatをsupport) [mark verified] - [GCC](/implementation.md#gcc): 8.0(整数のみ) [mark verified], 11.1(full support) [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2017 update 7(整数のみ) [mark verified], update 9(full support) [mark verified] diff --git a/reference/charconv/to_chars.md b/reference/charconv/to_chars.md index 26417c913f..e3f2677877 100644 --- a/reference/charconv/to_chars.md +++ b/reference/charconv/to_chars.md @@ -396,10 +396,12 @@ z - C++17 ### 処理系 -- [Clang](/implementation.md#clang): 7.0(整数のみ) [mark verified], 14.0(full support) [mark verified] +- [Clang](/implementation.md#clang): 7.0(整数のみ) [mark verified], 14.0(full support ※) [mark verified] - [GCC](/implementation.md#gcc): 8.0(整数のみ) [mark verified], 11.1(full support) [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2017 update 7(整数のみ) [mark verified], update 9(full support) [mark verified] +※ Clangの実装では、(8), (12)は第3引数のlong double変数が関数内でdouble型に変換される。 + ## 関連項目 - [`chars_format`](../charconv/chars_format.md) - [`to_chars_result`](../charconv/to_chars_result.md) From bd7e5a82ac8638086bbe45ac15f1a42cb12ac6f7 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 2 Jul 2025 12:51:20 +0900 Subject: [PATCH 1916/3948] =?UTF-8?q?LICENSE=E3=83=95=E3=82=A1=E3=82=A4?= =?UTF-8?q?=E3=83=AB=E3=82=92=E8=BF=BD=E5=8A=A0=20(CC=20BY=204.0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Open Collectiveから、「有効なライセンスファイルがないようなので追加してください」と連絡がきていたため --- LICENSE | 395 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 395 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000..4ea99c213c --- /dev/null +++ b/LICENSE @@ -0,0 +1,395 @@ +Attribution 4.0 International + +======================================================================= + +Creative Commons Corporation ("Creative Commons") is not a law firm and +does not provide legal services or legal advice. Distribution of +Creative Commons public licenses does not create a lawyer-client or +other relationship. Creative Commons makes its licenses and related +information available on an "as-is" basis. Creative Commons gives no +warranties regarding its licenses, any material licensed under their +terms and conditions, or any related information. Creative Commons +disclaims all liability for damages resulting from their use to the +fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and +conditions that creators and other rights holders may use to share +original works of authorship and other material subject to copyright +and certain other rights specified in the public license below. The +following considerations are for informational purposes only, are not +exhaustive, and do not form part of our licenses. + + Considerations for licensors: Our public licenses are + intended for use by those authorized to give the public + permission to use material in ways otherwise restricted by + copyright and certain other rights. Our licenses are + irrevocable. Licensors should read and understand the terms + and conditions of the license they choose before applying it. + Licensors should also secure all rights necessary before + applying our licenses so that the public can reuse the + material as expected. Licensors should clearly mark any + material not subject to the license. This includes other CC- + licensed material, or material used under an exception or + limitation to copyright. More considerations for licensors: + wiki.creativecommons.org/Considerations_for_licensors + + Considerations for the public: By using one of our public + licenses, a licensor grants the public permission to use the + licensed material under specified terms and conditions. If + the licensor's permission is not necessary for any reason--for + example, because of any applicable exception or limitation to + copyright--then that use is not regulated by the license. Our + licenses grant only permissions under copyright and certain + other rights that a licensor has authority to grant. Use of + the licensed material may still be restricted for other + reasons, including because others have copyright or other + rights in the material. A licensor may make special requests, + such as asking that all changes be marked or described. + Although not required by our licenses, you are encouraged to + respect those requests where reasonable. More considerations + for the public: + wiki.creativecommons.org/Considerations_for_licensees + +======================================================================= + +Creative Commons Attribution 4.0 International Public License + +By exercising the Licensed Rights (defined below), You accept and agree +to be bound by the terms and conditions of this Creative Commons +Attribution 4.0 International Public License ("Public License"). To the +extent this Public License may be interpreted as a contract, You are +granted the Licensed Rights in consideration of Your acceptance of +these terms and conditions, and the Licensor grants You such rights in +consideration of benefits the Licensor receives from making the +Licensed Material available under these terms and conditions. + + +Section 1 -- Definitions. + + a. Adapted Material means material subject to Copyright and Similar + Rights that is derived from or based upon the Licensed Material + and in which the Licensed Material is translated, altered, + arranged, transformed, or otherwise modified in a manner requiring + permission under the Copyright and Similar Rights held by the + Licensor. For purposes of this Public License, where the Licensed + Material is a musical work, performance, or sound recording, + Adapted Material is always produced where the Licensed Material is + synched in timed relation with a moving image. + + b. Adapter's License means the license You apply to Your Copyright + and Similar Rights in Your contributions to Adapted Material in + accordance with the terms and conditions of this Public License. + + c. Copyright and Similar Rights means copyright and/or similar rights + closely related to copyright including, without limitation, + performance, broadcast, sound recording, and Sui Generis Database + Rights, without regard to how the rights are labeled or + categorized. For purposes of this Public License, the rights + specified in Section 2(b)(1)-(2) are not Copyright and Similar + Rights. + + d. Effective Technological Measures means those measures that, in the + absence of proper authority, may not be circumvented under laws + fulfilling obligations under Article 11 of the WIPO Copyright + Treaty adopted on December 20, 1996, and/or similar international + agreements. + + e. Exceptions and Limitations means fair use, fair dealing, and/or + any other exception or limitation to Copyright and Similar Rights + that applies to Your use of the Licensed Material. + + f. Licensed Material means the artistic or literary work, database, + or other material to which the Licensor applied this Public + License. + + g. Licensed Rights means the rights granted to You subject to the + terms and conditions of this Public License, which are limited to + all Copyright and Similar Rights that apply to Your use of the + Licensed Material and that the Licensor has authority to license. + + h. Licensor means the individual(s) or entity(ies) granting rights + under this Public License. + + i. Share means to provide material to the public by any means or + process that requires permission under the Licensed Rights, such + as reproduction, public display, public performance, distribution, + dissemination, communication, or importation, and to make material + available to the public including in ways that members of the + public may access the material from a place and at a time + individually chosen by them. + + j. Sui Generis Database Rights means rights other than copyright + resulting from Directive 96/9/EC of the European Parliament and of + the Council of 11 March 1996 on the legal protection of databases, + as amended and/or succeeded, as well as other essentially + equivalent rights anywhere in the world. + + k. You means the individual or entity exercising the Licensed Rights + under this Public License. Your has a corresponding meaning. + + +Section 2 -- Scope. + + a. License grant. + + 1. Subject to the terms and conditions of this Public License, + the Licensor hereby grants You a worldwide, royalty-free, + non-sublicensable, non-exclusive, irrevocable license to + exercise the Licensed Rights in the Licensed Material to: + + a. reproduce and Share the Licensed Material, in whole or + in part; and + + b. produce, reproduce, and Share Adapted Material. + + 2. Exceptions and Limitations. For the avoidance of doubt, where + Exceptions and Limitations apply to Your use, this Public + License does not apply, and You do not need to comply with + its terms and conditions. + + 3. Term. The term of this Public License is specified in Section + 6(a). + + 4. Media and formats; technical modifications allowed. The + Licensor authorizes You to exercise the Licensed Rights in + all media and formats whether now known or hereafter created, + and to make technical modifications necessary to do so. The + Licensor waives and/or agrees not to assert any right or + authority to forbid You from making technical modifications + necessary to exercise the Licensed Rights, including + technical modifications necessary to circumvent Effective + Technological Measures. For purposes of this Public License, + simply making modifications authorized by this Section 2(a) + (4) never produces Adapted Material. + + 5. Downstream recipients. + + a. Offer from the Licensor -- Licensed Material. Every + recipient of the Licensed Material automatically + receives an offer from the Licensor to exercise the + Licensed Rights under the terms and conditions of this + Public License. + + b. No downstream restrictions. You may not offer or impose + any additional or different terms or conditions on, or + apply any Effective Technological Measures to, the + Licensed Material if doing so restricts exercise of the + Licensed Rights by any recipient of the Licensed + Material. + + 6. No endorsement. Nothing in this Public License constitutes or + may be construed as permission to assert or imply that You + are, or that Your use of the Licensed Material is, connected + with, or sponsored, endorsed, or granted official status by, + the Licensor or others designated to receive attribution as + provided in Section 3(a)(1)(A)(i). + + b. Other rights. + + 1. Moral rights, such as the right of integrity, are not + licensed under this Public License, nor are publicity, + privacy, and/or other similar personality rights; however, to + the extent possible, the Licensor waives and/or agrees not to + assert any such rights held by the Licensor to the limited + extent necessary to allow You to exercise the Licensed + Rights, but not otherwise. + + 2. Patent and trademark rights are not licensed under this + Public License. + + 3. To the extent possible, the Licensor waives any right to + collect royalties from You for the exercise of the Licensed + Rights, whether directly or through a collecting society + under any voluntary or waivable statutory or compulsory + licensing scheme. In all other cases the Licensor expressly + reserves any right to collect such royalties. + + +Section 3 -- License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the +following conditions. + + a. Attribution. + + 1. If You Share the Licensed Material (including in modified + form), You must: + + a. retain the following if it is supplied by the Licensor + with the Licensed Material: + + i. identification of the creator(s) of the Licensed + Material and any others designated to receive + attribution, in any reasonable manner requested by + the Licensor (including by pseudonym if + designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of + warranties; + + v. a URI or hyperlink to the Licensed Material to the + extent reasonably practicable; + + b. indicate if You modified the Licensed Material and + retain an indication of any previous modifications; and + + c. indicate the Licensed Material is licensed under this + Public License, and include the text of, or the URI or + hyperlink to, this Public License. + + 2. You may satisfy the conditions in Section 3(a)(1) in any + reasonable manner based on the medium, means, and context in + which You Share the Licensed Material. For example, it may be + reasonable to satisfy the conditions by providing a URI or + hyperlink to a resource that includes the required + information. + + 3. If requested by the Licensor, You must remove any of the + information required by Section 3(a)(1)(A) to the extent + reasonably practicable. + + 4. If You Share Adapted Material You produce, the Adapter's + License You apply must not prevent recipients of the Adapted + Material from complying with this Public License. + + +Section 4 -- Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that +apply to Your use of the Licensed Material: + + a. for the avoidance of doubt, Section 2(a)(1) grants You the right + to extract, reuse, reproduce, and Share all or a substantial + portion of the contents of the database; + + b. if You include all or a substantial portion of the database + contents in a database in which You have Sui Generis Database + Rights, then the database in which You have Sui Generis Database + Rights (but not its individual contents) is Adapted Material; and + + c. You must comply with the conditions in Section 3(a) if You Share + all or a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not +replace Your obligations under this Public License where the Licensed +Rights include other Copyright and Similar Rights. + + +Section 5 -- Disclaimer of Warranties and Limitation of Liability. + + a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE + EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS + AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF + ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, + IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, + WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, + ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT + KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT + ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. + + b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE + TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, + NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, + INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, + COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR + USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR + DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR + IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. + + c. The disclaimer of warranties and limitation of liability provided + above shall be interpreted in a manner that, to the extent + possible, most closely approximates an absolute disclaimer and + waiver of all liability. + + +Section 6 -- Term and Termination. + + a. This Public License applies for the term of the Copyright and + Similar Rights licensed here. However, if You fail to comply with + this Public License, then Your rights under this Public License + terminate automatically. + + b. Where Your right to use the Licensed Material has terminated under + Section 6(a), it reinstates: + + 1. automatically as of the date the violation is cured, provided + it is cured within 30 days of Your discovery of the + violation; or + + 2. upon express reinstatement by the Licensor. + + For the avoidance of doubt, this Section 6(b) does not affect any + right the Licensor may have to seek remedies for Your violations + of this Public License. + + c. For the avoidance of doubt, the Licensor may also offer the + Licensed Material under separate terms or conditions or stop + distributing the Licensed Material at any time; however, doing so + will not terminate this Public License. + + d. Sections 1, 5, 6, 7, and 8 survive termination of this Public + License. + + +Section 7 -- Other Terms and Conditions. + + a. The Licensor shall not be bound by any additional or different + terms or conditions communicated by You unless expressly agreed. + + b. Any arrangements, understandings, or agreements regarding the + Licensed Material not stated herein are separate from and + independent of the terms and conditions of this Public License. + + +Section 8 -- Interpretation. + + a. For the avoidance of doubt, this Public License does not, and + shall not be interpreted to, reduce, limit, restrict, or impose + conditions on any use of the Licensed Material that could lawfully + be made without permission under this Public License. + + b. To the extent possible, if any provision of this Public License is + deemed unenforceable, it shall be automatically reformed to the + minimum extent necessary to make it enforceable. If the provision + cannot be reformed, it shall be severed from this Public License + without affecting the enforceability of the remaining terms and + conditions. + + c. No term or condition of this Public License will be waived and no + failure to comply consented to unless expressly agreed to by the + Licensor. + + d. Nothing in this Public License constitutes or may be interpreted + as a limitation upon, or waiver of, any privileges and immunities + that apply to the Licensor or You, including from the legal + processes of any jurisdiction or authority. + + +======================================================================= + +Creative Commons is not a party to its public +licenses. Notwithstanding, Creative Commons may elect to apply one of +its public licenses to material it publishes and in those instances +will be considered the “Licensor.” The text of the Creative Commons +public licenses is dedicated to the public domain under the CC0 Public +Domain Dedication. Except for the limited purpose of indicating that +material is shared under a Creative Commons public license or as +otherwise permitted by the Creative Commons policies published at +creativecommons.org/policies, Creative Commons does not authorize the +use of the trademark "Creative Commons" or any other trademark or logo +of Creative Commons without its prior written consent including, +without limitation, in connection with any unauthorized modifications +to any of its public licenses or any other arrangements, +understandings, or agreements concerning use of licensed material. For +the avoidance of doubt, this paragraph does not form part of the +public licenses. + +Creative Commons may be contacted at creativecommons.org. From 293579bdedeca100fef5cc57fc2499a057f07836 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 2 Jul 2025 12:56:11 +0900 Subject: [PATCH 1917/3948] =?UTF-8?q?=E3=83=A9=E3=82=A4=E3=82=BB=E3=83=B3?= =?UTF-8?q?=E3=82=B9=E3=81=AE=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3?= =?UTF-8?q?=E3=82=92=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.md b/index.md index 713f81995b..6328f46012 100644 --- a/index.md +++ b/index.md @@ -163,9 +163,9 @@ Googleによるデータ使用の詳細は、以下のURLで確認すること ## ライセンスについて -本サイトの情報は、[クリエイティブ・コモンズ 表示 3.0 非移植 ライセンス(CC BY)](https://creativecommons.org/licenses/by/3.0/)の下に提供しています。 +本サイトの情報は、[クリエイティブ・コモンズ 表示 4.0 非移植 ライセンス(CC BY)](https://creativecommons.org/licenses/by/4.0/)の下に提供しています。 -![](https://i.creativecommons.org/l/by/3.0/88x31.png) +![](https://i.creativecommons.org/l/by/4.0/88x31.png) cpprefjpサイトのアイコン・ロゴ画像は、[クリエイティブ・コモンズ 表示 - 非営利 - 改変禁止 4.0 国際 (CC BY-NC-ND 4.0)](https://creativecommons.org/licenses/by-nc-nd/4.0/deed.ja)の下に提供しています。 From 87fe6ed6cf414f61402a3878823d0091d7f72aeb Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Wed, 2 Jul 2025 13:48:55 +0900 Subject: [PATCH 1918/3948] =?UTF-8?q?=E7=89=B9=E6=AE=8A=E5=8C=96=E3=81=8B?= =?UTF-8?q?=E3=82=89=20[meta=20class]=20=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/empty_view/enable_borrowed_range.md | 1 - reference/thread/thread/id/formatter.md | 1 - 2 files changed, 2 deletions(-) diff --git a/reference/ranges/empty_view/enable_borrowed_range.md b/reference/ranges/empty_view/enable_borrowed_range.md index eff21b2790..8bee873d09 100644 --- a/reference/ranges/empty_view/enable_borrowed_range.md +++ b/reference/ranges/empty_view/enable_borrowed_range.md @@ -1,7 +1,6 @@ # enable_borrowed_range * ranges[meta header] * std::ranges[meta namespace] -* empty_view[meta class] * variable[meta id-type] * cpp20[meta cpp] diff --git a/reference/thread/thread/id/formatter.md b/reference/thread/thread/id/formatter.md index d1b84cef70..443cd274a0 100644 --- a/reference/thread/thread/id/formatter.md +++ b/reference/thread/thread/id/formatter.md @@ -1,7 +1,6 @@ # formatter * thread[meta header] * std[meta namespace] -* thread::id[meta class] * class[meta id-type] * cpp23[meta cpp] From 5dd8cd882070365995310e41ccc4e7efcc1733ba Mon Sep 17 00:00:00 2001 From: suomesta Date: Wed, 2 Jul 2025 20:02:52 +0900 Subject: [PATCH 1919/3948] improve std::max_align_t --- reference/cstddef/max_align_t.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reference/cstddef/max_align_t.md b/reference/cstddef/max_align_t.md index 9e99e20786..0c04c6d608 100644 --- a/reference/cstddef/max_align_t.md +++ b/reference/cstddef/max_align_t.md @@ -11,7 +11,7 @@ namespace std { ``` ## 概要 -`std::max_align_t`は、どのスカラー型よりも大きいアライメントを必要とする型である。 +`std::max_align_t`のアライメントサイズは、スカラー型の中の最も大きなアライメントサイズと同じかそれ以上である。 この型は、C++11では[POD型](/reference/type_traits/is_pod.md)、C++20では[トリビアル型](/reference/type_traits/is_trivial.md)に分類される。 @@ -28,6 +28,8 @@ int main() { std::cout << "sizeof(max_align_t): " << sizeof(std::max_align_t) << std::endl; std::cout << "alignof(max_align_t): " << alignof(std::max_align_t) << std::endl; + static_assert(alignof(std::max_align_t) >= alignof(long long), ""); + static_assert(alignof(std::max_align_t) >= alignof(long double), ""); std::cout << "is_object: " << std::is_object::value << std::endl; std::cout << "is_scalar: " << std::is_scalar::value << std::endl; @@ -45,7 +47,7 @@ int main() * std::is_class[link /reference/type_traits/is_class.md] * std::is_pod[link /reference/type_traits/is_pod.md] -### 出力 +### 出力例 ``` sizeof(max_align_t): 24 alignof(max_align_t): 8 From e408f41fdb26245e3edc72ec45590ca5ea217b6e Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Thu, 3 Jul 2025 18:44:28 +0900 Subject: [PATCH 1920/3948] =?UTF-8?q?=E3=82=BF=E3=82=A4=E3=83=88=E3=83=AB?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/move_iterator/type-deferrence_type.md | 2 +- reference/linalg/vector_idx_abs_max.md | 2 +- reference/type_traits/is_virtual_base_of.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/iterator/move_iterator/type-deferrence_type.md b/reference/iterator/move_iterator/type-deferrence_type.md index 1278ae8d02..5ff758cb56 100644 --- a/reference/iterator/move_iterator/type-deferrence_type.md +++ b/reference/iterator/move_iterator/type-deferrence_type.md @@ -1,4 +1,4 @@ -# deferrence_type +# difference_type * iterator[meta header] * std[meta namespace] * move_iterator[meta class] diff --git a/reference/linalg/vector_idx_abs_max.md b/reference/linalg/vector_idx_abs_max.md index 7c55f38551..5172a42fee 100644 --- a/reference/linalg/vector_idx_abs_max.md +++ b/reference/linalg/vector_idx_abs_max.md @@ -1,4 +1,4 @@ -# vector_idx_abs_sum +# vector_idx_abs_max * [mathjax enable] * linalg[meta header] * function template[meta id-type] diff --git a/reference/type_traits/is_virtual_base_of.md b/reference/type_traits/is_virtual_base_of.md index 9f6fab2276..4d20f58a14 100644 --- a/reference/type_traits/is_virtual_base_of.md +++ b/reference/type_traits/is_virtual_base_of.md @@ -1,4 +1,4 @@ -# is_virtualbase_of +# is_virtual_base_of * type_traits[meta header] * std[meta namespace] * class template[meta id-type] From a47d09f68a07153c37e6e2dcd7cc55dd6e311c09 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Thu, 3 Jul 2025 18:46:03 +0900 Subject: [PATCH 1921/3948] =?UTF-8?q?=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB?= =?UTF-8?q?=E5=90=8D=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/move_iterator.md | 2 +- .../{type-deferrence_type.md => type-difference_type.md} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename reference/iterator/move_iterator/{type-deferrence_type.md => type-difference_type.md} (100%) diff --git a/reference/iterator/move_iterator.md b/reference/iterator/move_iterator.md index 29b57543f5..51940304b3 100644 --- a/reference/iterator/move_iterator.md +++ b/reference/iterator/move_iterator.md @@ -45,7 +45,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------------------------------------------------------|-------------|-------| | `iterator_type` | 元となるイテレータ型 `Iterator` | C++11 | -| [`difference_type`](move_iterator/type-deferrence_type.md) | イテレータ間の差を表す数値型 | C++11 | +| [`difference_type`](move_iterator/type-difference_type.md) | イテレータ間の差を表す数値型 | C++11 | | `pointer` | ポインタ型 `Iterator` | C++11 | | [`value_type`](move_iterator/type-value_type.md) | イテレータが指す値型 | C++11 | | [`iterator_category`](move_iterator/type-iterator_category.md) | イテレータの分類を表す型 | C++11 | diff --git a/reference/iterator/move_iterator/type-deferrence_type.md b/reference/iterator/move_iterator/type-difference_type.md similarity index 100% rename from reference/iterator/move_iterator/type-deferrence_type.md rename to reference/iterator/move_iterator/type-difference_type.md From e5793966a34a3e119c8f6abfd4e3794c2d3484af Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Thu, 3 Jul 2025 18:48:12 +0900 Subject: [PATCH 1922/3948] =?UTF-8?q?=E3=82=BF=E3=82=A4=E3=83=88=E3=83=AB?= =?UTF-8?q?=E3=81=A8=E4=B8=80=E8=87=B4=E3=81=97=E3=81=AA=E3=81=84=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/atomic/atomic_wait_explicit.md | 6 +++--- reference/filesystem/directory_iterator/op_arrow.md | 2 +- .../filesystem/recursive_directory_iterator/op_arrow.md | 2 +- reference/memory/no-throw-forward-iterator.md | 2 +- reference/memory/no-throw-forward-range.md | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/reference/atomic/atomic_wait_explicit.md b/reference/atomic/atomic_wait_explicit.md index 1c5f02754e..12f391f6fe 100644 --- a/reference/atomic/atomic_wait_explicit.md +++ b/reference/atomic/atomic_wait_explicit.md @@ -8,18 +8,18 @@ namespace std { template void - atomic_wait(const volatile atomic* object, + atomic_wait_explicit(const volatile atomic* object, typename atomic::value_type old, memory_order order); // (1) C++20 template void - atomic_wait(const atomic* object, + atomic_wait_explicit(const atomic* object, typename atomic::value_type old, memory_order order); // (2) C++20 template constexpr void - atomic_wait(const atomic* object, + atomic_wait_explicit(const atomic* object, typename atomic::value_type old, memory_order order); // (2) C++26 } diff --git a/reference/filesystem/directory_iterator/op_arrow.md b/reference/filesystem/directory_iterator/op_arrow.md index 52b6dc1ac6..d40563486a 100644 --- a/reference/filesystem/directory_iterator/op_arrow.md +++ b/reference/filesystem/directory_iterator/op_arrow.md @@ -6,7 +6,7 @@ * cpp17[meta cpp] ```cpp -const directory_entry& operator*() const; +const directory_entry& operator->() const; ``` * directory_entry[link /reference/filesystem/directory_entry.md] diff --git a/reference/filesystem/recursive_directory_iterator/op_arrow.md b/reference/filesystem/recursive_directory_iterator/op_arrow.md index e223b0e083..0f704f0e0d 100644 --- a/reference/filesystem/recursive_directory_iterator/op_arrow.md +++ b/reference/filesystem/recursive_directory_iterator/op_arrow.md @@ -6,7 +6,7 @@ * cpp17[meta cpp] ```cpp -const directory_entry& operator*() const; +const directory_entry& operator->() const; ``` * directory_entry[link /reference/filesystem/directory_entry.md] diff --git a/reference/memory/no-throw-forward-iterator.md b/reference/memory/no-throw-forward-iterator.md index 739574a00d..5fd5008733 100644 --- a/reference/memory/no-throw-forward-iterator.md +++ b/reference/memory/no-throw-forward-iterator.md @@ -7,7 +7,7 @@ ```cpp namespace std { template - concept no-throw-input-iterator = + concept no-throw-forward-iterator = no-throw-input-iterator && forward_iterator && no-throw-sentinel diff --git a/reference/memory/no-throw-forward-range.md b/reference/memory/no-throw-forward-range.md index 97f2dc7552..04649db415 100644 --- a/reference/memory/no-throw-forward-range.md +++ b/reference/memory/no-throw-forward-range.md @@ -7,7 +7,7 @@ ```cpp namespace std { template - concept no-throw-input-range = + concept no-throw-forward-range = no-throw-input-range && no-throw-forward-iterator>; } From a8797d0960c754d3ac0d80fb1fa376482cf98cc9 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Thu, 3 Jul 2025 18:48:46 +0900 Subject: [PATCH 1923/3948] =?UTF-8?q?=E4=BB=A3=E5=85=A5=E6=BC=94=E7=AE=97?= =?UTF-8?q?=E5=AD=90=E3=81=AE=E3=82=BF=E3=82=A4=E3=83=88=E3=83=AB=E3=82=92?= =?UTF-8?q?=20operator=3D=20=E3=81=A7=E7=B5=B1=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/coroutine/coroutine_handle/op_assign.md | 2 +- reference/locale/wstring_convert/op_assign.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/coroutine/coroutine_handle/op_assign.md b/reference/coroutine/coroutine_handle/op_assign.md index 01e0354edb..d43b557854 100644 --- a/reference/coroutine/coroutine_handle/op_assign.md +++ b/reference/coroutine/coroutine_handle/op_assign.md @@ -1,4 +1,4 @@ -# 代入演算子 +# operator= * coroutine[meta header] * std[meta namespace] * coroutine_handle[meta class] diff --git a/reference/locale/wstring_convert/op_assign.md b/reference/locale/wstring_convert/op_assign.md index aca1466a4f..f5aa4bcb9d 100644 --- a/reference/locale/wstring_convert/op_assign.md +++ b/reference/locale/wstring_convert/op_assign.md @@ -1,4 +1,4 @@ -# 代入演算子 +# operator= * locale[meta header] * std[meta namespace] * wstring_convert[meta class] From 50d77b3b5ea16125b14c01203dd5efae367bfb4d Mon Sep 17 00:00:00 2001 From: suomesta Date: Thu, 3 Jul 2025 20:03:27 +0900 Subject: [PATCH 1924/3948] remove duplicate line --- .../memory/shared_ptr/atomic_compare_exchange_strong_explicit.md | 1 - reference/unordered_map/unordered_map/max_load_factor.md | 1 - reference/unordered_map/unordered_multimap/max_load_factor.md | 1 - 3 files changed, 3 deletions(-) diff --git a/reference/memory/shared_ptr/atomic_compare_exchange_strong_explicit.md b/reference/memory/shared_ptr/atomic_compare_exchange_strong_explicit.md index ce9e638990..ccc340401a 100644 --- a/reference/memory/shared_ptr/atomic_compare_exchange_strong_explicit.md +++ b/reference/memory/shared_ptr/atomic_compare_exchange_strong_explicit.md @@ -102,7 +102,6 @@ int main() ## 参照 - [`atomic_compare_exchange_strong() - shared_ptr`](atomic_compare_exchange_strong.md) - [`atomic_compare_exchange_strong_explicit() - `](/reference/atomic/atomic_compare_exchange_strong_explicit.md) -- [`atomic_compare_exchange_strong_explicit() - `](/reference/atomic/atomic_compare_exchange_strong_explicit.md) - [N2674 Shared_ptr atomic access, revision 1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2674.htm) - [C++0x Shared_ptr atomic access - Faith and Brave - C++で遊ぼう](http://faithandbrave.hateblo.jp/entry/20081015/1224066366) - [LWG Issue 2172. Does `atomic_compare_exchange_*` accept `v == nullptr` arguments?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2172) diff --git a/reference/unordered_map/unordered_map/max_load_factor.md b/reference/unordered_map/unordered_map/max_load_factor.md index 0611743d43..8b64fc6d44 100644 --- a/reference/unordered_map/unordered_map/max_load_factor.md +++ b/reference/unordered_map/unordered_map/max_load_factor.md @@ -127,7 +127,6 @@ new load_factor: 1.125 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] diff --git a/reference/unordered_map/unordered_multimap/max_load_factor.md b/reference/unordered_map/unordered_multimap/max_load_factor.md index 160c947964..7b587bc740 100644 --- a/reference/unordered_map/unordered_multimap/max_load_factor.md +++ b/reference/unordered_map/unordered_multimap/max_load_factor.md @@ -129,7 +129,6 @@ new load_factor: 1.125 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] From 52c95b647c81c8d78270365bffc1aaceb9dd5412 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 4 Jul 2025 11:27:53 +0900 Subject: [PATCH 1925/3948] =?UTF-8?q?=E3=82=B9=E3=83=9D=E3=83=B3=E3=82=B5?= =?UTF-8?q?=E3=83=BC=E6=9B=B4=E6=96=B0=20#1460?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.md b/index.md index 6328f46012..5bb98e7900 100644 --- a/index.md +++ b/index.md @@ -145,6 +145,8 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい [sponsor name:ugai様, link:https://opencollective.com/ugai, fee:5, amount:1, period:2025-02-06] +[sponsor name:ぼっちマスター様, img:https://raw.githubusercontent.com/cpprefjp/image/master/sponsors/bocchi-master/my-icon.png, link:https://profile.bocchi-master.net/ size:320, fee:5, amount:12] + スポンサーシップについては、以下のページを参照ください。 From 7a4190f0d30e265bd0a9830488995763bc96119a Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 4 Jul 2025 11:33:39 +0900 Subject: [PATCH 1926/3948] =?UTF-8?q?=E3=82=B9=E3=83=9D=E3=83=B3=E3=82=B5?= =?UTF-8?q?=E3=83=BC=E6=9B=B4=E6=96=B0=20#1460?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.md b/index.md index 5bb98e7900..bacfcea5c6 100644 --- a/index.md +++ b/index.md @@ -145,7 +145,7 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい [sponsor name:ugai様, link:https://opencollective.com/ugai, fee:5, amount:1, period:2025-02-06] -[sponsor name:ぼっちマスター様, img:https://raw.githubusercontent.com/cpprefjp/image/master/sponsors/bocchi-master/my-icon.png, link:https://profile.bocchi-master.net/ size:320, fee:5, amount:12] +[sponsor name:ぼっちマスター様, img:https://raw.githubusercontent.com/cpprefjp/image/master/sponsors/bocchi-master/my-icon.png, link:https://profile.bocchi-master.net/, size:320, fee:5, amount:12] スポンサーシップについては、以下のページを参照ください。 From c0b01b0c263461ecdde798b213463161fe412f03 Mon Sep 17 00:00:00 2001 From: suomesta Date: Fri, 4 Jul 2025 22:35:59 +0900 Subject: [PATCH 1927/3948] add meta version to flat_XXX operator== --- reference/flat_map/flat_map/op_equal.md | 1 + reference/flat_map/flat_multimap/op_equal.md | 1 + reference/flat_set/flat_multiset/op_equal.md | 1 + reference/flat_set/flat_set/op_equal.md | 1 + 4 files changed, 4 insertions(+) diff --git a/reference/flat_map/flat_map/op_equal.md b/reference/flat_map/flat_map/op_equal.md index 11299d74bc..4059c7b3eb 100644 --- a/reference/flat_map/flat_map/op_equal.md +++ b/reference/flat_map/flat_map/op_equal.md @@ -3,6 +3,7 @@ * std[meta namespace] * function template[meta id-type] * flat_map[meta class] +* cpp23[meta cpp] ```cpp friend bool operator==(const flat_map& x, const flat_map& y); diff --git a/reference/flat_map/flat_multimap/op_equal.md b/reference/flat_map/flat_multimap/op_equal.md index 41266b52ff..2826035089 100644 --- a/reference/flat_map/flat_multimap/op_equal.md +++ b/reference/flat_map/flat_multimap/op_equal.md @@ -3,6 +3,7 @@ * std[meta namespace] * function template[meta id-type] * flat_multimap[meta class] +* cpp23[meta cpp] ```cpp friend bool operator==(const flat_multimap& x, const flat_multimap& y); diff --git a/reference/flat_set/flat_multiset/op_equal.md b/reference/flat_set/flat_multiset/op_equal.md index 68b3975567..a34524a175 100644 --- a/reference/flat_set/flat_multiset/op_equal.md +++ b/reference/flat_set/flat_multiset/op_equal.md @@ -3,6 +3,7 @@ * std[meta namespace] * function template[meta id-type] * flat_multiset[meta class] +* cpp23[meta cpp] ```cpp friend bool operator==(const flat_multiset& x, const flat_multiset& y); diff --git a/reference/flat_set/flat_set/op_equal.md b/reference/flat_set/flat_set/op_equal.md index 4f7786a38e..83e8b60edf 100644 --- a/reference/flat_set/flat_set/op_equal.md +++ b/reference/flat_set/flat_set/op_equal.md @@ -3,6 +3,7 @@ * std[meta namespace] * function template[meta id-type] * flat_set[meta class] +* cpp23[meta cpp] ```cpp friend bool operator==(const flat_set& x, const flat_set& y); From 415b00e5bb41eac29a73de8a6ec4fd0be6cfbca0 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 4 Jul 2025 22:35:16 +0900 Subject: [PATCH 1928/3948] fixed link for contract_violation's member functions(#1419) --- reference/contracts/contract_violation.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/reference/contracts/contract_violation.md b/reference/contracts/contract_violation.md index 9f182bd021..28b8e15c43 100644 --- a/reference/contracts/contract_violation.md +++ b/reference/contracts/contract_violation.md @@ -26,13 +26,13 @@ namespace std::contracts { ## メンバ関数 | 名前 | 説明 | 対応バージョン | | ---- | ---- | ---- | -| [`comment`](contracts/comment.md.nolink) | 契約違反の詳細を記録したchar列を返す | C++26 | -| [`detection_mode`](contracts/detection_mode.md.nolink) | 契約違反が特定された方法を返す | C++26 | -| [`evaluation_exception`](contracts/evaluation_exception.md.nolink) | 契約が例外を飛ばしたことによって終了した場合の例外へのポインタ | C++26 | -| [`is_terminating`](contracts/is_terminating.md.nolink) | 契約違反によってプログラムがターミネートされるかを返す | C++26| -| [`kind`](contracts/kind.md.nolink) | 違反した契約の種類 | C++26| -| [`location`](contracts/location.md.nolink) | 契約違反が発生したソースコードの位置 | C++26| -| [`semantic`](contracts/semantic.md.nolink) | 契約の評価方法 | C++26| +| [`comment`](contracts/contract_violation/comment.md.nolink) | 契約違反の詳細を記録したchar列を返す | C++26 | +| [`detection_mode`](contracts/contract_violation/detection_mode.md.nolink) | 契約違反が特定された方法を返す | C++26 | +| [`evaluation_exception`](contracts/contract_violation/evaluation_exception.md.nolink) | 契約が例外を飛ばしたことによって終了した場合の例外へのポインタ | C++26 | +| [`is_terminating`](contracts/contract_violation/is_terminating.md.nolink) | 契約違反によってプログラムがターミネートされるかを返す | C++26| +| [`kind`](contracts/contract_violation/kind.md.nolink) | 違反した契約の種類 | C++26| +| [`location`](contracts/contract_violation/location.md.nolink) | 契約違反が発生したソースコードの位置 | C++26| +| [`semantic`](contracts/contract_violation/semantic.md.nolink) | 契約の評価方法 | C++26| ## 参照 - [Contracts for C++](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2900r14.pdf) \ No newline at end of file From 766f58a8ec2f797c193699e33029da9e0d899ac3 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 4 Jul 2025 22:42:20 +0900 Subject: [PATCH 1929/3948] new page `reference/contracts/contract_violation` (#1419) --- .../contracts/contract_violation/comment.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 reference/contracts/contract_violation/comment.md diff --git a/reference/contracts/contract_violation/comment.md b/reference/contracts/contract_violation/comment.md new file mode 100644 index 0000000000..125a967202 --- /dev/null +++ b/reference/contracts/contract_violation/comment.md @@ -0,0 +1,19 @@ +# comment +* contracts[meta header] +* std::contracts[meta namespace] +* function[meta id-type] +* cpp26[meta cpp] +* contract_violation[meta class] + +```cpp +const char* comment() const noexcept; +``` + +## 概要 +契約違反の詳細を記録したchar列を返す。 + +このchar列は`null-terminated multi-byte string`、すなわち`'\0'`で終端されたマルチバイト文字列であることが保証されている。 + +## 戻り値 +契約違反の詳細を記録したchar列 + From d909f26e55188145dc1332a1a3d0589b9ceea4bb Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 4 Jul 2025 22:44:33 +0900 Subject: [PATCH 1930/3948] added more description for `comment.md`(#1419) --- .../contracts/contract_violation/comment.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/reference/contracts/contract_violation/comment.md b/reference/contracts/contract_violation/comment.md index 125a967202..2e71cf0a01 100644 --- a/reference/contracts/contract_violation/comment.md +++ b/reference/contracts/contract_violation/comment.md @@ -17,3 +17,19 @@ const char* comment() const noexcept; ## 戻り値 契約違反の詳細を記録したchar列 + +## 例外 +投げない + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [Contracts for C++](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2900r14.pdf) +- \ No newline at end of file From a2f32bb0047143ca0a14dc5301b703e95b2b3959 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 4 Jul 2025 22:46:21 +0900 Subject: [PATCH 1931/3948] new page `reference/contracts/contract_violation/detection_mode.md`(#1419) --- .../contract_violation/detection_mode.md | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 reference/contracts/contract_violation/detection_mode.md diff --git a/reference/contracts/contract_violation/detection_mode.md b/reference/contracts/contract_violation/detection_mode.md new file mode 100644 index 0000000000..0c01c411e2 --- /dev/null +++ b/reference/contracts/contract_violation/detection_mode.md @@ -0,0 +1,31 @@ +# detection_mode +* contracts[meta header] +* std::contracts[meta namespace] +* function[meta id-type] +* cpp26[meta cpp] +* contract_violation[meta class] + +```cpp +contracts::detection_mode detection_mode() const noexcept; +``` + +## 概要 +契約違反が特定された方法を返す。 + +## 戻り値 +契約違反が特定された方法を表す`contracts::detection_mode`型 + +## 例外 +投げない + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [Contracts for C++](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2900r14.pdf) \ No newline at end of file From c867da97e340ebccb66e239f54a9496373caf89d Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 4 Jul 2025 22:47:13 +0900 Subject: [PATCH 1932/3948] removed .nolink --- reference/contracts/contract_violation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/contracts/contract_violation.md b/reference/contracts/contract_violation.md index 28b8e15c43..3926c71323 100644 --- a/reference/contracts/contract_violation.md +++ b/reference/contracts/contract_violation.md @@ -26,8 +26,8 @@ namespace std::contracts { ## メンバ関数 | 名前 | 説明 | 対応バージョン | | ---- | ---- | ---- | -| [`comment`](contracts/contract_violation/comment.md.nolink) | 契約違反の詳細を記録したchar列を返す | C++26 | -| [`detection_mode`](contracts/contract_violation/detection_mode.md.nolink) | 契約違反が特定された方法を返す | C++26 | +| [`comment`](contracts/contract_violation/comment.md) | 契約違反の詳細を記録したchar列を返す | C++26 | +| [`detection_mode`](contracts/contract_violation/detection_mode.md) | 契約違反が特定された方法を返す | C++26 | | [`evaluation_exception`](contracts/contract_violation/evaluation_exception.md.nolink) | 契約が例外を飛ばしたことによって終了した場合の例外へのポインタ | C++26 | | [`is_terminating`](contracts/contract_violation/is_terminating.md.nolink) | 契約違反によってプログラムがターミネートされるかを返す | C++26| | [`kind`](contracts/contract_violation/kind.md.nolink) | 違反した契約の種類 | C++26| From 4cf530397e692a4bd64960d49aded8007345e879 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 4 Jul 2025 22:49:54 +0900 Subject: [PATCH 1933/3948] new page `reference/contracts/contract_violation/evaluation_exception.md`(#1419) --- reference/contracts/contract_violation.md | 2 +- .../evaluation_exception.md | 35 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 reference/contracts/contract_violation/evaluation_exception.md diff --git a/reference/contracts/contract_violation.md b/reference/contracts/contract_violation.md index 3926c71323..91a3020c23 100644 --- a/reference/contracts/contract_violation.md +++ b/reference/contracts/contract_violation.md @@ -28,7 +28,7 @@ namespace std::contracts { | ---- | ---- | ---- | | [`comment`](contracts/contract_violation/comment.md) | 契約違反の詳細を記録したchar列を返す | C++26 | | [`detection_mode`](contracts/contract_violation/detection_mode.md) | 契約違反が特定された方法を返す | C++26 | -| [`evaluation_exception`](contracts/contract_violation/evaluation_exception.md.nolink) | 契約が例外を飛ばしたことによって終了した場合の例外へのポインタ | C++26 | +| [`evaluation_exception`](contracts/contract_violation/evaluation_exception.md) | 契約が例外を飛ばしたことによって終了した場合の例外へのポインタ | C++26 | | [`is_terminating`](contracts/contract_violation/is_terminating.md.nolink) | 契約違反によってプログラムがターミネートされるかを返す | C++26| | [`kind`](contracts/contract_violation/kind.md.nolink) | 違反した契約の種類 | C++26| | [`location`](contracts/contract_violation/location.md.nolink) | 契約違反が発生したソースコードの位置 | C++26| diff --git a/reference/contracts/contract_violation/evaluation_exception.md b/reference/contracts/contract_violation/evaluation_exception.md new file mode 100644 index 0000000000..4d9cc3a7ec --- /dev/null +++ b/reference/contracts/contract_violation/evaluation_exception.md @@ -0,0 +1,35 @@ +# evaluation_exception +* contracts[meta header] +* std::contracts[meta namespace] +* function[meta id-type] +* cpp26[meta cpp] +* contract_violation[meta class] + +```cpp +exception_ptr evaluation_exception() const noexcept; +``` + +## 概要 +契約の判定時に例外が投げられた場合、その例外へのポインタを返す。 + +例外が飛ばなければ、空の`std::exception_ptr`を返す。 + +## 戻り値 +契約の判定時に例外が投げられた場合、その例外へのポインタを返す。 + +例外が飛ばなければ、空の`std::exception_ptr`を返す。 + +## 例外 +投げない + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [Contracts for C++](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2900r14.pdf) From 6ae914490e3b30efda80be539784bd5e0a895dc7 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 4 Jul 2025 22:51:53 +0900 Subject: [PATCH 1934/3948] new page `reference/contracts/contract_violation/is_terminating.md`(#1419) --- reference/contracts/contract_violation.md | 2 +- .../contract_violation/is_terminating.md | 31 +++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 reference/contracts/contract_violation/is_terminating.md diff --git a/reference/contracts/contract_violation.md b/reference/contracts/contract_violation.md index 91a3020c23..b3c9f1a12c 100644 --- a/reference/contracts/contract_violation.md +++ b/reference/contracts/contract_violation.md @@ -29,7 +29,7 @@ namespace std::contracts { | [`comment`](contracts/contract_violation/comment.md) | 契約違反の詳細を記録したchar列を返す | C++26 | | [`detection_mode`](contracts/contract_violation/detection_mode.md) | 契約違反が特定された方法を返す | C++26 | | [`evaluation_exception`](contracts/contract_violation/evaluation_exception.md) | 契約が例外を飛ばしたことによって終了した場合の例外へのポインタ | C++26 | -| [`is_terminating`](contracts/contract_violation/is_terminating.md.nolink) | 契約違反によってプログラムがターミネートされるかを返す | C++26| +| [`is_terminating`](contracts/contract_violation/is_terminating.md) | 契約違反によってプログラムがターミネートされるかを返す | C++26| | [`kind`](contracts/contract_violation/kind.md.nolink) | 違反した契約の種類 | C++26| | [`location`](contracts/contract_violation/location.md.nolink) | 契約違反が発生したソースコードの位置 | C++26| | [`semantic`](contracts/contract_violation/semantic.md.nolink) | 契約の評価方法 | C++26| diff --git a/reference/contracts/contract_violation/is_terminating.md b/reference/contracts/contract_violation/is_terminating.md new file mode 100644 index 0000000000..4c56ad323a --- /dev/null +++ b/reference/contracts/contract_violation/is_terminating.md @@ -0,0 +1,31 @@ +# is_terminating +* contracts[meta header] +* std::contracts[meta namespace] +* function[meta id-type] +* cpp26[meta cpp] +* contract_violation[meta class] + +```cpp +bool is_terminating() const noexcept; +``` + +## 概要 +契約違反によってプログラムが終了するかどうかを返す。 + +## 戻り値 +契約違反によってプログラムが終了する場合は`true`、そうでない場合は`false`を返す + +## 例外 +投げない + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [Contracts for C++](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2900r14.pdf) \ No newline at end of file From 95dd140110e07179b5cf35afbaa200cbd784f898 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 4 Jul 2025 22:54:01 +0900 Subject: [PATCH 1935/3948] new page `reference/contracts/contract_violation/kind.md`(#1419) --- reference/contracts/contract_violation.md | 2 +- .../contracts/contract_violation/kind.md | 31 +++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 reference/contracts/contract_violation/kind.md diff --git a/reference/contracts/contract_violation.md b/reference/contracts/contract_violation.md index b3c9f1a12c..b09bc37e7d 100644 --- a/reference/contracts/contract_violation.md +++ b/reference/contracts/contract_violation.md @@ -30,7 +30,7 @@ namespace std::contracts { | [`detection_mode`](contracts/contract_violation/detection_mode.md) | 契約違反が特定された方法を返す | C++26 | | [`evaluation_exception`](contracts/contract_violation/evaluation_exception.md) | 契約が例外を飛ばしたことによって終了した場合の例外へのポインタ | C++26 | | [`is_terminating`](contracts/contract_violation/is_terminating.md) | 契約違反によってプログラムがターミネートされるかを返す | C++26| -| [`kind`](contracts/contract_violation/kind.md.nolink) | 違反した契約の種類 | C++26| +| [`kind`](contracts/contract_violation/kind.md) | 違反した契約の種類 | C++26| | [`location`](contracts/contract_violation/location.md.nolink) | 契約違反が発生したソースコードの位置 | C++26| | [`semantic`](contracts/contract_violation/semantic.md.nolink) | 契約の評価方法 | C++26| diff --git a/reference/contracts/contract_violation/kind.md b/reference/contracts/contract_violation/kind.md new file mode 100644 index 0000000000..b2a995aa93 --- /dev/null +++ b/reference/contracts/contract_violation/kind.md @@ -0,0 +1,31 @@ +# kind +* contracts[meta header] +* std::contracts[meta namespace] +* function[meta id-type] +* cpp26[meta cpp] +* contract_violation[meta class] + +```cpp +assertion_kind kind() const noexcept; +``` + +## 概要 +契約違反の種類を返す。 + +## 戻り値 +契約違反の種類を表す`assertion_kind`型 + +## 例外 +投げない + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [Contracts for C++](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2900r14.pdf) \ No newline at end of file From 8769b4027780008cda07d6fbcd97b1afc3cd67a0 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 4 Jul 2025 22:57:53 +0900 Subject: [PATCH 1936/3948] new page `reference/contracts/contract_violation/location.md`(#1419) --- reference/contracts/contract_violation.md | 2 +- .../contracts/contract_violation/location.md | 35 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 reference/contracts/contract_violation/location.md diff --git a/reference/contracts/contract_violation.md b/reference/contracts/contract_violation.md index b09bc37e7d..8146794a5e 100644 --- a/reference/contracts/contract_violation.md +++ b/reference/contracts/contract_violation.md @@ -31,7 +31,7 @@ namespace std::contracts { | [`evaluation_exception`](contracts/contract_violation/evaluation_exception.md) | 契約が例外を飛ばしたことによって終了した場合の例外へのポインタ | C++26 | | [`is_terminating`](contracts/contract_violation/is_terminating.md) | 契約違反によってプログラムがターミネートされるかを返す | C++26| | [`kind`](contracts/contract_violation/kind.md) | 違反した契約の種類 | C++26| -| [`location`](contracts/contract_violation/location.md.nolink) | 契約違反が発生したソースコードの位置 | C++26| +| [`location`](contracts/contract_violation/location.md) | 契約違反が発生したソースコードの位置 | C++26| | [`semantic`](contracts/contract_violation/semantic.md.nolink) | 契約の評価方法 | C++26| ## 参照 diff --git a/reference/contracts/contract_violation/location.md b/reference/contracts/contract_violation/location.md new file mode 100644 index 0000000000..e3357943eb --- /dev/null +++ b/reference/contracts/contract_violation/location.md @@ -0,0 +1,35 @@ +# location +* contracts[meta header] +* std::contracts[meta namespace] +* function[meta id-type] +* cpp26[meta cpp] +* contract_violation[meta class] + +```cpp +source_location location() const noexcept; +``` + +## 概要 +契約違反が発生したソースコードの場所を返す。 + +厳密にはどの場所を返すかは規定されていない。 + +`precondition`違反の場合は関数の宣言の場所、それ以外では契約が記述された場所を返すことが推奨されている。 + +## 戻り値 +契約違反が発生したソースコードの場所を返す(ただし厳密には定義されていない)。 + +## 例外 +投げない + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [Contracts for C++](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2900r14.pdf) From a4157064c381f8af2b9e42ec9186b8a6c518892a Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 4 Jul 2025 23:00:21 +0900 Subject: [PATCH 1937/3948] new page `reference/contracts/contract_violation/semantic.md`(#1419) --- reference/contracts/contract_violation.md | 2 +- .../contracts/contract_violation/semantic.md | 30 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 reference/contracts/contract_violation/semantic.md diff --git a/reference/contracts/contract_violation.md b/reference/contracts/contract_violation.md index 8146794a5e..7253100480 100644 --- a/reference/contracts/contract_violation.md +++ b/reference/contracts/contract_violation.md @@ -32,7 +32,7 @@ namespace std::contracts { | [`is_terminating`](contracts/contract_violation/is_terminating.md) | 契約違反によってプログラムがターミネートされるかを返す | C++26| | [`kind`](contracts/contract_violation/kind.md) | 違反した契約の種類 | C++26| | [`location`](contracts/contract_violation/location.md) | 契約違反が発生したソースコードの位置 | C++26| -| [`semantic`](contracts/contract_violation/semantic.md.nolink) | 契約の評価方法 | C++26| +| [`semantic`](contracts/contract_violation/semantic.md) | 契約の評価方法 | C++26| ## 参照 - [Contracts for C++](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2900r14.pdf) \ No newline at end of file diff --git a/reference/contracts/contract_violation/semantic.md b/reference/contracts/contract_violation/semantic.md new file mode 100644 index 0000000000..56abd9b989 --- /dev/null +++ b/reference/contracts/contract_violation/semantic.md @@ -0,0 +1,30 @@ +# semantic +* contracts[meta header] +* std::contracts[meta namespace] +* function[meta id-type] +* cpp26[meta cpp] +* contract_violation[meta class] + +```cpp +evaluation_semantic semantic() const noexcept; +``` + +## 概要 +契約の評価方法を返す。 + +## 戻り値 +契約の評価方法を表す`evaluation_semantic`型 + +## 例外 +投げない + +## バージョン +- C++26 + +## 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [Contracts for C++](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2900r14.pdf) \ No newline at end of file From 082105297497b2c96530d944b8b1d1d08e817ee5 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 4 Jul 2025 23:08:09 +0900 Subject: [PATCH 1938/3948] fixed path --- reference/contracts/contract_violation.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/reference/contracts/contract_violation.md b/reference/contracts/contract_violation.md index 7253100480..8c82af079e 100644 --- a/reference/contracts/contract_violation.md +++ b/reference/contracts/contract_violation.md @@ -26,13 +26,13 @@ namespace std::contracts { ## メンバ関数 | 名前 | 説明 | 対応バージョン | | ---- | ---- | ---- | -| [`comment`](contracts/contract_violation/comment.md) | 契約違反の詳細を記録したchar列を返す | C++26 | -| [`detection_mode`](contracts/contract_violation/detection_mode.md) | 契約違反が特定された方法を返す | C++26 | -| [`evaluation_exception`](contracts/contract_violation/evaluation_exception.md) | 契約が例外を飛ばしたことによって終了した場合の例外へのポインタ | C++26 | -| [`is_terminating`](contracts/contract_violation/is_terminating.md) | 契約違反によってプログラムがターミネートされるかを返す | C++26| -| [`kind`](contracts/contract_violation/kind.md) | 違反した契約の種類 | C++26| -| [`location`](contracts/contract_violation/location.md) | 契約違反が発生したソースコードの位置 | C++26| -| [`semantic`](contracts/contract_violation/semantic.md) | 契約の評価方法 | C++26| +| [`comment`](contract_violation/comment.md) | 契約違反の詳細を記録したchar列を返す | C++26 | +| [`detection_mode`](contract_violation/detection_mode.md) | 契約違反が特定された方法を返す | C++26 | +| [`evaluation_exception`](contract_violation/evaluation_exception.md) | 契約が例外を飛ばしたことによって終了した場合の例外へのポインタ | C++26 | +| [`is_terminating`](contract_violation/is_terminating.md) | 契約違反によってプログラムがターミネートされるかを返す | C++26| +| [`kind`](contract_violation/kind.md) | 違反した契約の種類 | C++26| +| [`location`](contract_violation/location.md) | 契約違反が発生したソースコードの位置 | C++26| +| [`semantic`](contract_violation/semantic.md) | 契約の評価方法 | C++26| ## 参照 - [Contracts for C++](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2900r14.pdf) \ No newline at end of file From aeafc9cc6d089e2bad04bff6dc5b759ae96317b5 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 4 Jul 2025 23:25:50 +0900 Subject: [PATCH 1939/3948] new page `reference/cstdio/stdout.md` --- reference/cstdio.md | 2 +- reference/cstdio/stdout.md | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 reference/cstdio/stdout.md diff --git a/reference/cstdio.md b/reference/cstdio.md index a8752fb55f..9ddf48ba8e 100644 --- a/reference/cstdio.md +++ b/reference/cstdio.md @@ -32,7 +32,7 @@ | `TMP_MAX` | `tempnam()`関数によって生成できる一時ファイル名の、実装が保証する最低限の数を表す整数定数 | | | `stderr` | 標準エラーを表す`FILE*`型の式 | | `stdin` | 標準入力を表す`FILE*`型の式 | -| `stdout` | 標準出力を表す`FILE*`型の式 | +| [`stdout`](/reference/cstdio/stdout.md) | 標準出力を表す`FILE*`型の式 | ## ファイル操作 diff --git a/reference/cstdio/stdout.md b/reference/cstdio/stdout.md new file mode 100644 index 0000000000..9583bfbcf8 --- /dev/null +++ b/reference/cstdio/stdout.md @@ -0,0 +1,35 @@ +# stdout +* cstdio[meta header] +* std[meta namespace] +* object[meta id-type] + +```cpp +#define stdout /* implementation-defined */ +``` + +## 概要 +標準出力を表す`*FILE`型のオブジェクト。 + +マクロとして定義されているため、std名前空間には存在しない。 + +## 例 +```cpp example +#include + +int main() { + std::FILE* fp = stdout; + std::fprintf(fp, "Hello, World!\n"); +} +``` +* std::stdout[color ff0000] +* std::fprintf[link /reference/cstdio/fprintf.md.nolink] + +### 出力 +``` +Hello, World! +``` + +## 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? From be1a6258f1fbb60563406304186040fec5ba8e73 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 4 Jul 2025 23:29:54 +0900 Subject: [PATCH 1940/3948] fixed meta id-type for stdout.md --- reference/cstdio/stdout.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdio/stdout.md b/reference/cstdio/stdout.md index 9583bfbcf8..813c864a4e 100644 --- a/reference/cstdio/stdout.md +++ b/reference/cstdio/stdout.md @@ -1,7 +1,7 @@ # stdout * cstdio[meta header] * std[meta namespace] -* object[meta id-type] +* macro[meta id-type] ```cpp #define stdout /* implementation-defined */ From 3e084fb35deb052fc0057c7952713367587e7f44 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 4 Jul 2025 23:33:25 +0900 Subject: [PATCH 1941/3948] new page `reference/cstdio/stdin.md` --- reference/cstdio.md | 2 +- reference/cstdio/stdin.md | 45 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 reference/cstdio/stdin.md diff --git a/reference/cstdio.md b/reference/cstdio.md index 9ddf48ba8e..8b407be0dd 100644 --- a/reference/cstdio.md +++ b/reference/cstdio.md @@ -31,7 +31,7 @@ | `SEEK_END` | ファイルの終端を指定するための整数定数 | | | `TMP_MAX` | `tempnam()`関数によって生成できる一時ファイル名の、実装が保証する最低限の数を表す整数定数 | | | `stderr` | 標準エラーを表す`FILE*`型の式 | -| `stdin` | 標準入力を表す`FILE*`型の式 | +| [`stdin`](/reference/cstdio/stdin.md) | 標準入力を表す`FILE*`型の式 | | [`stdout`](/reference/cstdio/stdout.md) | 標準出力を表す`FILE*`型の式 | diff --git a/reference/cstdio/stdin.md b/reference/cstdio/stdin.md new file mode 100644 index 0000000000..4cd17c77ff --- /dev/null +++ b/reference/cstdio/stdin.md @@ -0,0 +1,45 @@ +# stdin +* cstdio[meta header] +* std[meta namespace] +* macro[meta id-type] + +```cpp +#define stdin /* implementation-defined */ +``` + +## 概要 +標準入力を表す`*FILE`型のオブジェクト。 + +マクロとして定義されているため、std名前空間には存在しない。 + +## 例 +```cpp example +#include + +int main() { + int n; + std::FILE* fp = stdin; + std::FILE* fp2 = stdout; + std::fscanf(fp, "%d", &n); + std::fprintf(fp2, "%d\n", n); +} +``` +* std::stdin[color ff0000] +* std::fprintf[link /reference/cstdio/fprintf.md.nolink] +* std::fscanf[link /reference/cstdio/fscanf.md.nolink] +* std::fprintf[link /reference/cstdio/fprintf.md.nolink] + +### 入力 +``` +123 +``` + +### 出力 +``` +123 +``` + +## 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? From 196f954718b85165ca10495cd263dff9b8971bd6 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 4 Jul 2025 23:35:07 +0900 Subject: [PATCH 1942/3948] new page `reference/cstdio/stderr.md` --- reference/cstdio.md | 2 +- reference/cstdio/stderr.md | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 reference/cstdio/stderr.md diff --git a/reference/cstdio.md b/reference/cstdio.md index 8b407be0dd..4f4d08549a 100644 --- a/reference/cstdio.md +++ b/reference/cstdio.md @@ -30,7 +30,7 @@ | `SEEK_CUR` | ファイルの現在位置を指定するための整数定数 | | | `SEEK_END` | ファイルの終端を指定するための整数定数 | | | `TMP_MAX` | `tempnam()`関数によって生成できる一時ファイル名の、実装が保証する最低限の数を表す整数定数 | | -| `stderr` | 標準エラーを表す`FILE*`型の式 | +| [`stderr`](/reference/cstdio/stderr.md) | 標準エラーを表す`FILE*`型の式 | | [`stdin`](/reference/cstdio/stdin.md) | 標準入力を表す`FILE*`型の式 | | [`stdout`](/reference/cstdio/stdout.md) | 標準出力を表す`FILE*`型の式 | diff --git a/reference/cstdio/stderr.md b/reference/cstdio/stderr.md new file mode 100644 index 0000000000..4660599675 --- /dev/null +++ b/reference/cstdio/stderr.md @@ -0,0 +1,35 @@ +# stderr +* cstdio[meta header] +* std[meta namespace] +* macro[meta id-type] + +```cpp +#define stderr /* implementation-defined */ +``` + +## 概要 +標準エラー出力を表す`*FILE`型のオブジェクト。 + +マクロとして定義されているため、std名前空間には存在しない。 + +## 例 +```cpp example +#include + +int main() { + std::FILE* fp = stderr; + std::fprintf(fp, "Hello, World!\n"); +} +``` +* std::stderr[color ff0000] +* std::fprintf[link /reference/cstdio/fprintf.md.nolink] + +### 出力(標準エラー出力) +``` +Hello, World! +``` + +## 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? From 2a94b63011310c4c51c4db26938ec2cffaf3f4ed Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 4 Jul 2025 23:36:22 +0900 Subject: [PATCH 1943/3948] fixed highlighting keyword --- reference/cstdio/stderr.md | 2 +- reference/cstdio/stdin.md | 2 +- reference/cstdio/stdout.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/cstdio/stderr.md b/reference/cstdio/stderr.md index 4660599675..ddbcfa4ec4 100644 --- a/reference/cstdio/stderr.md +++ b/reference/cstdio/stderr.md @@ -21,7 +21,7 @@ int main() { std::fprintf(fp, "Hello, World!\n"); } ``` -* std::stderr[color ff0000] +* stderr[color ff0000] * std::fprintf[link /reference/cstdio/fprintf.md.nolink] ### 出力(標準エラー出力) diff --git a/reference/cstdio/stdin.md b/reference/cstdio/stdin.md index 4cd17c77ff..8bdd244324 100644 --- a/reference/cstdio/stdin.md +++ b/reference/cstdio/stdin.md @@ -24,7 +24,7 @@ int main() { std::fprintf(fp2, "%d\n", n); } ``` -* std::stdin[color ff0000] +* stdin[color ff0000] * std::fprintf[link /reference/cstdio/fprintf.md.nolink] * std::fscanf[link /reference/cstdio/fscanf.md.nolink] * std::fprintf[link /reference/cstdio/fprintf.md.nolink] diff --git a/reference/cstdio/stdout.md b/reference/cstdio/stdout.md index 813c864a4e..6cc7652c3c 100644 --- a/reference/cstdio/stdout.md +++ b/reference/cstdio/stdout.md @@ -21,7 +21,7 @@ int main() { std::fprintf(fp, "Hello, World!\n"); } ``` -* std::stdout[color ff0000] +* stdout[color ff0000] * std::fprintf[link /reference/cstdio/fprintf.md.nolink] ### 出力 From b069a5ba764d7e4730fffae04797068331351a6a Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 4 Jul 2025 23:45:30 +0900 Subject: [PATCH 1944/3948] new page `reference/cstdio/fprintf.md` --- reference/cstdio.md | 2 +- reference/cstdio/fprintf.md | 43 +++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 reference/cstdio/fprintf.md diff --git a/reference/cstdio.md b/reference/cstdio.md index 4f4d08549a..8547f754a4 100644 --- a/reference/cstdio.md +++ b/reference/cstdio.md @@ -46,7 +46,7 @@ | `fclose` | ファイルを閉じる | | | `fopen` | ファイルを開く | | | `fflush` | ファイルをフラッシュする | | -| `fprintf` | 書式を指定してファイルに出力する | | +| [`fprintf`](/reference/cstdio/fprintf.md) | 書式を指定してファイルに出力する | | | `fscanf` | 書式を指定してファイルから入力する | | | `vfprintf` | 可変引数リスト`va_list`を使用し、書式を指定してファイルに出力する | | | `vfscanf` | 可変引数リスト`va_list`を使用し、書式を指定してファイルから入力する | C++17 | diff --git a/reference/cstdio/fprintf.md b/reference/cstdio/fprintf.md new file mode 100644 index 0000000000..693fe1810c --- /dev/null +++ b/reference/cstdio/fprintf.md @@ -0,0 +1,43 @@ +# fprintf +* cstdio[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +int fprintf( FILE* restrict stream, const char* restrict format, ... ); +``` + +## 概要 +指定されたファイルストリームに、指定された書式文字列を使用してデータを出力する。 + +## 例 +```cpp example +#include + +int main() { + int n = 123; + std::fprintf(stdout, "Hello, World!\n%d\n", n); + const char* path = "test.txt"; + std::FILE* fp = std::fopen(path, "w"); + std::fprintf(fp, "Hello, World!\n%d\n", n); + std::fclose(fp); +} +``` +* std::fprintf[color ff0000] +* std::fopen[link /reference/cstdio/fopen.md.nolink] +* std::fclose[link /reference/cstdio/fclose.md.nolink] +* std::FILE[link /reference/cstdio/file.md.nolink] +### 出力 +``` +Hello, World! +123 +``` + +### ファイル出力(test.txt) +``` +Hello, World! +123 +``` + +* std::fopen[link /reference/cstdio/fopen.md.nolink] +* std::fclose[link /reference/cstdio/fclose.md.nolink] From 7e71dfc7d9797da59148931ece1f31b2dcb5da29 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 4 Jul 2025 23:49:05 +0900 Subject: [PATCH 1945/3948] remvoed wired words and added compiler column --- reference/cstdio/fprintf.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reference/cstdio/fprintf.md b/reference/cstdio/fprintf.md index 693fe1810c..98439de698 100644 --- a/reference/cstdio/fprintf.md +++ b/reference/cstdio/fprintf.md @@ -39,5 +39,7 @@ Hello, World! 123 ``` -* std::fopen[link /reference/cstdio/fopen.md.nolink] -* std::fclose[link /reference/cstdio/fclose.md.nolink] +## 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? From 3f4fdd55371de124d624f875ad2e9cfacc473fb8 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 4 Jul 2025 23:51:05 +0900 Subject: [PATCH 1946/3948] new page `reference/cstdio/fscanf.md` --- reference/cstdio.md | 2 +- reference/cstdio/fscanf.md | 43 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 reference/cstdio/fscanf.md diff --git a/reference/cstdio.md b/reference/cstdio.md index 8547f754a4..5fcb1549dc 100644 --- a/reference/cstdio.md +++ b/reference/cstdio.md @@ -47,7 +47,7 @@ | `fopen` | ファイルを開く | | | `fflush` | ファイルをフラッシュする | | | [`fprintf`](/reference/cstdio/fprintf.md) | 書式を指定してファイルに出力する | | -| `fscanf` | 書式を指定してファイルから入力する | | +| [`fscanf`](/reference/cstdio/fscanf.md) | 書式を指定してファイルから入力する | | | `vfprintf` | 可変引数リスト`va_list`を使用し、書式を指定してファイルに出力する | | | `vfscanf` | 可変引数リスト`va_list`を使用し、書式を指定してファイルから入力する | C++17 | | `fgetc` | ファイルから1文字入力する | | diff --git a/reference/cstdio/fscanf.md b/reference/cstdio/fscanf.md new file mode 100644 index 0000000000..c6eddd5321 --- /dev/null +++ b/reference/cstdio/fscanf.md @@ -0,0 +1,43 @@ +# fscanf +* cstdio[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +int fscanf( FILE* restrict stream, const char* restrict format, ... ); +``` + +## 概要 +指定されたファイルストリームから、指定された書式文字列を使用してデータを入力する。 + +## 例 +```cpp example +#include + +int main() { + int n; + const char* path = "test.txt"; + std::FILE* fp = std::fopen(path, "r"); + std::fscanf(fp, "%d", &n); + std::fclose(fp); + std::printf("%d\n", n); +} +``` +* std::fscanf[color ff0000] +* std::fopen[link /reference/cstdio/fopen.md.nolink] +* std::fclose[link /reference/cstdio/fclose.md.nolink] +* std::FILE[link /reference/cstdio/file.md.nolink] +### 出力(test.txtは以下参照) +``` +123 +``` + +### ファイル内容(test.txt) +``` +123 +``` + +## 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? From 48b9d779e0600cad86ecb0096e8dd71954e633ff Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 4 Jul 2025 23:55:38 +0900 Subject: [PATCH 1947/3948] fixed a lot of .nolink --- reference/cstdio/stderr.md | 2 +- reference/cstdio/stdin.md | 2 +- reference/cstdio/stdout.md | 2 +- reference/ios/ios_base/sync_with_stdio.md | 6 +++--- reference/print/print.md | 2 +- reference/print/println.md | 4 ++-- reference/print/vprint_nonunicode.md | 2 +- reference/print/vprint_unicode.md | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/reference/cstdio/stderr.md b/reference/cstdio/stderr.md index ddbcfa4ec4..886da3ccf1 100644 --- a/reference/cstdio/stderr.md +++ b/reference/cstdio/stderr.md @@ -22,7 +22,7 @@ int main() { } ``` * stderr[color ff0000] -* std::fprintf[link /reference/cstdio/fprintf.md.nolink] +* std::fprintf[link /reference/cstdio/fprintf.md] ### 出力(標準エラー出力) ``` diff --git a/reference/cstdio/stdin.md b/reference/cstdio/stdin.md index 8bdd244324..7411bae9ec 100644 --- a/reference/cstdio/stdin.md +++ b/reference/cstdio/stdin.md @@ -25,7 +25,7 @@ int main() { } ``` * stdin[color ff0000] -* std::fprintf[link /reference/cstdio/fprintf.md.nolink] +* std::fprintf[link /reference/cstdio/fprintf.md] * std::fscanf[link /reference/cstdio/fscanf.md.nolink] * std::fprintf[link /reference/cstdio/fprintf.md.nolink] diff --git a/reference/cstdio/stdout.md b/reference/cstdio/stdout.md index 6cc7652c3c..dec08c801b 100644 --- a/reference/cstdio/stdout.md +++ b/reference/cstdio/stdout.md @@ -22,7 +22,7 @@ int main() { } ``` * stdout[color ff0000] -* std::fprintf[link /reference/cstdio/fprintf.md.nolink] +* std::fprintf[link /reference/cstdio/fprintf.md] ### 出力 ``` diff --git a/reference/ios/ios_base/sync_with_stdio.md b/reference/ios/ios_base/sync_with_stdio.md index f3d6f1fa42..582d1bc550 100644 --- a/reference/ios/ios_base/sync_with_stdio.md +++ b/reference/ios/ios_base/sync_with_stdio.md @@ -65,6 +65,6 @@ int main() - [`wcerr`](../../iostream/wcerr.md.nolink) - [`wclog`](../../iostream/wclog.md.nolink) - C 言語ライブラリの標準ストリームオブジェクト - - [`stdin`](../../cstdio/stdin.md.nolink) - - [`stdout`](../../cstdio/stdout.md.nolink) - - [`stderr`](../../cstdio/stderr.md.nolink) + - [`stdin`](../../cstdio/stdin.md) + - [`stdout`](../../cstdio/stdout.md) + - [`stderr`](../../cstdio/stderr.md) diff --git a/reference/print/print.md b/reference/print/print.md index 87a33baa92..8278a0d480 100644 --- a/reference/print/print.md +++ b/reference/print/print.md @@ -39,7 +39,7 @@ namespace std { ```cpp print(stdout, fmt, std::forward(args)...); ``` - * stdout[link /reference/cstdio/stdout.md.nolink] + * stdout[link /reference/cstdio/stdout.md] * std::forward[link /reference/utility/forward.md] - (2) : diff --git a/reference/print/println.md b/reference/print/println.md index 67830f962c..9cf37fbe69 100644 --- a/reference/print/println.md +++ b/reference/print/println.md @@ -45,14 +45,14 @@ namespace std { ```cpp println(stdout, fmt, std::forward(args)...); ``` - * stdout[link /reference/cstdio/stdout.md.nolink] + * stdout[link /reference/cstdio/stdout.md] * std::forward[link /reference/utility/forward.md] - (2) : 以下と等価: ```cpp println(stdout); ``` - * stdout[link /reference/cstdio/stdout.md.nolink] + * stdout[link /reference/cstdio/stdout.md] - (3) : 以下と等価: ```cpp diff --git a/reference/print/vprint_nonunicode.md b/reference/print/vprint_nonunicode.md index 8d7e459c3f..df2f758f92 100644 --- a/reference/print/vprint_nonunicode.md +++ b/reference/print/vprint_nonunicode.md @@ -35,7 +35,7 @@ namespace std { ```cpp vprint_unicode(stdout, fmt, args); ``` - * stdout[link /reference/cstdio/stdout.md.nolink] + * stdout[link /reference/cstdio/stdout.md] - (2) : - C++23 : [`vformat`](/reference/format/vformat.md)`(fmt, args)`の結果を`stream`に書き出す diff --git a/reference/print/vprint_unicode.md b/reference/print/vprint_unicode.md index 775af92699..94ab55d78c 100644 --- a/reference/print/vprint_unicode.md +++ b/reference/print/vprint_unicode.md @@ -35,7 +35,7 @@ namespace std { ```cpp vprint_unicode(stdout, fmt, args); ``` - * stdout[link /reference/cstdio/stdout.md.nolink] + * stdout[link /reference/cstdio/stdout.md] - (2) : - C++23 : From e1a0612f1c3bfe1092f47daf1511496ca7cc6c78 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 4 Jul 2025 23:58:11 +0900 Subject: [PATCH 1948/3948] fixed .nolink --- lang/cpp11/long_long_type.md | 4 ++-- reference/cstdio/stdin.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lang/cpp11/long_long_type.md b/lang/cpp11/long_long_type.md index 4d38aaec05..990fc62e39 100644 --- a/lang/cpp11/long_long_type.md +++ b/lang/cpp11/long_long_type.md @@ -30,7 +30,7 @@ C99互換として、`long long`整数型が追加された。 ## 備考 `long long`型の追加にともなって、ライブラリにも以下のような変更が入った: -- [`fprintf()`](/reference/cstdio/fprintf.md.nolink)と[`fscanf()`](/reference/cstdio/fscanf.md.nolink)およびそのフォーマットを使用する関数に、`long long`を表す`ll`が表現幅を指示するために追加された。 +- [`fprintf()`](/reference/cstdio/fprintf.md)と[`fscanf()`](/reference/cstdio/fscanf.md)およびそのフォーマットを使用する関数に、`long long`を表す`ll`が表現幅を指示するために追加された。 - `#if`および`#elif`に指定する定数条件式の評価について、「`(unsigned) int`は`(unsigned) long`と同じ表現(範囲)を持つように振舞う」とされていたのが、「全ての符号付きまたは符号無し整数型はそれぞれ[`intmax_t`](/reference/cstdint/intmax_t.md)または[`uintmax_t`](/reference/cstdint/uintmax_t.md)の表現(範囲)を持つように振舞う」と変更された。 - その他、入出力や数学の関数にも、`long long`型のサポートが追加された。 @@ -75,4 +75,4 @@ int main() - [N0715 Incorporate the `long long` integral data type in C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/1995/N0715.ps) - [N1565 Adding the `long long` type to C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1565.pdf) - [N1735 Adding the `long long` type to C++ (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1735.pdf) -- [N1811 Adding the `long long` type to C++ (Revision 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1811.pdf) \ No newline at end of file +- [N1811 Adding the `long long` type to C++ (Revision 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1811.pdf) diff --git a/reference/cstdio/stdin.md b/reference/cstdio/stdin.md index 7411bae9ec..4310cb24f5 100644 --- a/reference/cstdio/stdin.md +++ b/reference/cstdio/stdin.md @@ -26,8 +26,8 @@ int main() { ``` * stdin[color ff0000] * std::fprintf[link /reference/cstdio/fprintf.md] -* std::fscanf[link /reference/cstdio/fscanf.md.nolink] -* std::fprintf[link /reference/cstdio/fprintf.md.nolink] +* std::fscanf[link /reference/cstdio/fscanf.md] +* std::fprintf[link /reference/cstdio/fprintf.md] ### 入力 ``` From 831654717de18db3c5a7c7711d3bba6d9506d071 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 4 Jul 2025 23:59:02 +0900 Subject: [PATCH 1949/3948] fixed .nolink --- lang/cpp11/raw_string_literals.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/cpp11/raw_string_literals.md b/lang/cpp11/raw_string_literals.md index 20bdfe8f90..09b4273e0c 100644 --- a/lang/cpp11/raw_string_literals.md +++ b/lang/cpp11/raw_string_literals.md @@ -139,7 +139,7 @@ int main() * rdbuf[link /reference/ios/basic_ios/rdbuf.md] * std::stringstream[link /reference/sstream/basic_stringstream.md] * str()[link /reference/sstream/basic_stringstream/str.md] -* std::fprintf[link /reference/cstdio/fprintf.md.nolink] +* std::fprintf[link /reference/cstdio/fprintf.md] * Boost.Format[link http://www.boost.org/libs/format] * fmtlib[link https://github.com/fmtlib/fmt] * std::format[link /reference/format/format.md] @@ -273,4 +273,4 @@ Perl、Python、Luaやその他の言語ではこの問題に対応するため - [N2295 Raw and Unicode String Literals; Unified Proposal](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2295.html) - [N2384 Raw and Unicode String Literals; Unified Proposal (Rev. 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2384.html) - [N2442 Raw and Unicode String Literals; Unified Proposal (Rev. 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm) -- [N3077 Alternative approach to Raw String issues](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3077.html) \ No newline at end of file +- [N3077 Alternative approach to Raw String issues](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3077.html) From 216a9c36fb0da3f28ff07bc1f52ac6c19815dbdf Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sat, 5 Jul 2025 12:44:34 +0900 Subject: [PATCH 1950/3948] new page `fgetc.md` and removed nolink --- reference/cstdio.md | 2 +- reference/cstdio/fgetc.md | 45 +++++++++++++++++++++++ reference/ios/ios_base/sync_with_stdio.md | 2 +- 3 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 reference/cstdio/fgetc.md diff --git a/reference/cstdio.md b/reference/cstdio.md index 5fcb1549dc..c6585deda1 100644 --- a/reference/cstdio.md +++ b/reference/cstdio.md @@ -50,7 +50,7 @@ | [`fscanf`](/reference/cstdio/fscanf.md) | 書式を指定してファイルから入力する | | | `vfprintf` | 可変引数リスト`va_list`を使用し、書式を指定してファイルに出力する | | | `vfscanf` | 可変引数リスト`va_list`を使用し、書式を指定してファイルから入力する | C++17 | -| `fgetc` | ファイルから1文字入力する | | +| [`fgetc`](/reference/cstdio/fgetc.md) | ファイルから1文字入力する | | | `fgets` | ファイルからN文字入力する | | | `fputc` | ファイルに1文字出力する | | | `fputs` | ファイルにN文字出力する | | diff --git a/reference/cstdio/fgetc.md b/reference/cstdio/fgetc.md new file mode 100644 index 0000000000..85a12b8a78 --- /dev/null +++ b/reference/cstdio/fgetc.md @@ -0,0 +1,45 @@ +# fgetc +* cstdio[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +int fgetc( FILE* stream ); +``` + +## 概要 +指定されたファイルストリームから1文字入力する。 + +[`getc`][/reference/cstdio/getc.md.nolink]とは違い、関数として定義することが定められているため、引数は一度しか評価されないことが保証されている。 + +## 戻り値 +入力された文字を返す。 + +## 例 +```cpp example +#include + +int main() { + int c; + while ((c = fgetc(stdin)) != EOF) { + putc(c, stdout); + } +} +``` +* fgetc[color ff0000] +* putc[link /reference/cstdio/putc.md.nolink] + +### 入力 +``` +abc +``` + +### 出力 +``` +abc +``` + +## 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ios/ios_base/sync_with_stdio.md b/reference/ios/ios_base/sync_with_stdio.md index 582d1bc550..5e761e485b 100644 --- a/reference/ios/ios_base/sync_with_stdio.md +++ b/reference/ios/ios_base/sync_with_stdio.md @@ -26,7 +26,7 @@ static bool sync_with_stdio(bool sync = true); 標準ストリーム `str` が C 言語ライブラリの標準ストリーム `f` と同期している場合、 - 文字 `c` のストリームへの出力 [`fputc`](../../cstdio/fputc.md.nolink)`(f, c);` は `str.`[`rdbuf`](../basic_ios/rdbuf.md)`()->`[`sputc`](../../streambuf/basic_streambuf/sputc.md)`(c);` と等価であり、 -- 文字 `c` のストリームからの入力 `c =` [`fgetc`](../../cstdio/fgetc.md.nolink)`(f);` は `c = str.`[`rdbuf`](../basic_ios/rdbuf.md)`()->`[`sbumpc`](../../streambuf/basic_streambuf/sbumpc.md)`();` と等価であり、 +- 文字 `c` のストリームからの入力 `c =` [`fgetc`](../../cstdio/fgetc.md)`(f);` は `c = str.`[`rdbuf`](../basic_ios/rdbuf.md)`()->`[`sbumpc`](../../streambuf/basic_streambuf/sbumpc.md)`();` と等価であり、 - 文字 `c` のストリームへの戻し [`ungetc`](../../cstdio/ungetc.md.nolink)`(c, f)` は `str.`[`rdbuf`](../basic_ios/rdbuf.md)`()->`[`sputbackc`](../../streambuf/basic_streambuf/sputbackc.md)`(c);` と等価である。 From a2e9bfcddd9bc11578d78e78640fc40c2a04d3ff Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sat, 5 Jul 2025 12:52:42 +0900 Subject: [PATCH 1951/3948] new page `fgets.md` --- reference/cstdio.md | 2 +- reference/cstdio/fgets.md | 46 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 reference/cstdio/fgets.md diff --git a/reference/cstdio.md b/reference/cstdio.md index c6585deda1..34804497d1 100644 --- a/reference/cstdio.md +++ b/reference/cstdio.md @@ -51,7 +51,7 @@ | `vfprintf` | 可変引数リスト`va_list`を使用し、書式を指定してファイルに出力する | | | `vfscanf` | 可変引数リスト`va_list`を使用し、書式を指定してファイルから入力する | C++17 | | [`fgetc`](/reference/cstdio/fgetc.md) | ファイルから1文字入力する | | -| `fgets` | ファイルからN文字入力する | | +| [`fgets`](/reference/cstdio/fgets.md) | ファイルからN文字入力する | | | `fputc` | ファイルに1文字出力する | | | `fputs` | ファイルにN文字出力する | | | `fread` | ファイルからN文字読み込む | | diff --git a/reference/cstdio/fgets.md b/reference/cstdio/fgets.md new file mode 100644 index 0000000000..cb98ca8cb1 --- /dev/null +++ b/reference/cstdio/fgets.md @@ -0,0 +1,46 @@ +# fgets +* cstdio[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +char* fgets( char* restrict str, int count, FILE* restrict stream ); +``` + +## 概要 +指定されたファイルストリームから、指定されたバッファに指定された最大文字数までの文字を読み込む。 + +読まれる文字はcount-1文字まで、終端にはヌル文字が追加される。 + +また、改行にたどり着くとそこで読み込みを終了する(末尾に改行文字を含める)。 + +## 戻り値 +成功すれば読み込まれた文字列を、そうでなければ`NULL`を返す。 + +## 例 +```cpp example +#include + +int main() { + char str[10]; + fgets(str, sizeof(str), stdin); + puts(str); +} +``` +* fgets[color ff0000] +* puts[link /reference/cstdio/puts.md.nolink] + +### 入力 +``` +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +``` + +### 出力 +``` +aaaaaaaaa +``` + +## 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? From 0470b064aa3f8ec3dd4f0db615ab839c93869caa Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sat, 5 Jul 2025 12:56:39 +0900 Subject: [PATCH 1952/3948] new page `fputc.md` and removed nolink --- reference/cstdio.md | 2 +- reference/cstdio/fputc.md | 39 +++++++++++++++++++++++ reference/ios/ios_base/sync_with_stdio.md | 2 +- 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 reference/cstdio/fputc.md diff --git a/reference/cstdio.md b/reference/cstdio.md index 34804497d1..65afb973c7 100644 --- a/reference/cstdio.md +++ b/reference/cstdio.md @@ -52,7 +52,7 @@ | `vfscanf` | 可変引数リスト`va_list`を使用し、書式を指定してファイルから入力する | C++17 | | [`fgetc`](/reference/cstdio/fgetc.md) | ファイルから1文字入力する | | | [`fgets`](/reference/cstdio/fgets.md) | ファイルからN文字入力する | | -| `fputc` | ファイルに1文字出力する | | +| [`fputc`](/reference/cstdio/fputc.md) | ファイルに1文字出力する | | | `fputs` | ファイルにN文字出力する | | | `fread` | ファイルからN文字読み込む | | | `fwrite` | ファイルにN文字書き込む | | diff --git a/reference/cstdio/fputc.md b/reference/cstdio/fputc.md new file mode 100644 index 0000000000..d775cfc7f7 --- /dev/null +++ b/reference/cstdio/fputc.md @@ -0,0 +1,39 @@ +# fputc +* cstdio[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +int fputc( int ch, FILE* stream ); +``` + +## 概要 +指定されたファイルストリームに1文字出力する。 + +[`putc`][/reference/cstdio/putc.md.nolink]とは違い、関数として定義することが定められているため、引数は一度しか評価されないことが保証されている。 + +## 戻り値 +出力された文字を返す。 + +失敗した場合、[`EOF`](/reference/cstdio/eof.md)を返す。 + +## 例 +```cpp example +#include + +int main() { + fputc('a', stdout); +} +``` +* fputc[color ff0000] +* stdout[link /reference/cstdio/stdout.md] + +### 出力 +``` +a +``` + +## 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ios/ios_base/sync_with_stdio.md b/reference/ios/ios_base/sync_with_stdio.md index 5e761e485b..14491ef740 100644 --- a/reference/ios/ios_base/sync_with_stdio.md +++ b/reference/ios/ios_base/sync_with_stdio.md @@ -25,7 +25,7 @@ static bool sync_with_stdio(bool sync = true); ## 備考 標準ストリーム `str` が C 言語ライブラリの標準ストリーム `f` と同期している場合、 -- 文字 `c` のストリームへの出力 [`fputc`](../../cstdio/fputc.md.nolink)`(f, c);` は `str.`[`rdbuf`](../basic_ios/rdbuf.md)`()->`[`sputc`](../../streambuf/basic_streambuf/sputc.md)`(c);` と等価であり、 +- 文字 `c` のストリームへの出力 [`fputc`](../../cstdio/fputc.md)`(f, c);` は `str.`[`rdbuf`](../basic_ios/rdbuf.md)`()->`[`sputc`](../../streambuf/basic_streambuf/sputc.md)`(c);` と等価であり、 - 文字 `c` のストリームからの入力 `c =` [`fgetc`](../../cstdio/fgetc.md)`(f);` は `c = str.`[`rdbuf`](../basic_ios/rdbuf.md)`()->`[`sbumpc`](../../streambuf/basic_streambuf/sbumpc.md)`();` と等価であり、 - 文字 `c` のストリームへの戻し [`ungetc`](../../cstdio/ungetc.md.nolink)`(c, f)` は `str.`[`rdbuf`](../basic_ios/rdbuf.md)`()->`[`sputbackc`](../../streambuf/basic_streambuf/sputbackc.md)`(c);` と等価である。 From 1a6ace7c5545fde3687575591b29fb63f5d61e9e Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sat, 5 Jul 2025 12:57:44 +0900 Subject: [PATCH 1953/3948] added nolink --- reference/cstdio/fputc.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdio/fputc.md b/reference/cstdio/fputc.md index d775cfc7f7..a8d678c1db 100644 --- a/reference/cstdio/fputc.md +++ b/reference/cstdio/fputc.md @@ -15,7 +15,7 @@ int fputc( int ch, FILE* stream ); ## 戻り値 出力された文字を返す。 -失敗した場合、[`EOF`](/reference/cstdio/eof.md)を返す。 +失敗した場合、[`EOF`](/reference/cstdio/eof.md.nolink)を返す。 ## 例 ```cpp example From b2b7126459a5d933dcce46c434d11f7cbefdb5dd Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sat, 5 Jul 2025 13:01:46 +0900 Subject: [PATCH 1954/3948] added nolink --- reference/cstdio.md | 104 ++++++++++++++++++++++---------------------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/reference/cstdio.md b/reference/cstdio.md index 65afb973c7..5f438f34d7 100644 --- a/reference/cstdio.md +++ b/reference/cstdio.md @@ -9,8 +9,8 @@ | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`size_t`](/reference/cstddef/size_t.md) | 符号なし整数型 | | -| `FILE` | ストリームの制御に必要な情報を持つオブジェクト型 | | -| `fpos_t` | ファイルの全ての位置にアクセスするための配列以外の完全オブジェクト型 | | +| [`FILE`](/reference/cstdio/file.md.nolink) | ストリームの制御に必要な情報を持つオブジェクト型 | | +| [`fpos_t`](/reference/cstdio/fpos_t.md.nolink) | ファイルの全ての位置にアクセスするための配列以外の完全オブジェクト型 | | ## マクロ @@ -18,18 +18,18 @@ | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`NULL`](/reference/cstddef/null.md) | ヌルポインタ定数に展開されるマクロ | | -| `_IOFBF` | 入出力を完全にバッファリングする指定のための整数定数 | | -| `_IOLBF` | 入出力を行バッファリングする指定のための整数定数 | | -| `_IONBF` | 入出力をバッファリングしない指定のための整数定数 | | -| `BUFSIZ` | バッファサイズを表す整数定数 | | -| `EOF` | ファイルの終端であることを表す`int`型の整数定数 | | -| `FOPEN_MAX` | 実装によって保証されるファイルを開ける最低限の数を表す整数定数 | | -| `FILENAME_MAX` | 実装によって保証されるファイル名の最大の長さを表す整数定数 | | -| `L_tmpnam` | `tmpnam()`関数によって作られた一時ファイル名を保持する似に必要な長さを表す整数定数 | | -| `SEEK_SET` | ファイルの先頭位置を指定するための整数定数 | | -| `SEEK_CUR` | ファイルの現在位置を指定するための整数定数 | | -| `SEEK_END` | ファイルの終端を指定するための整数定数 | | -| `TMP_MAX` | `tempnam()`関数によって生成できる一時ファイル名の、実装が保証する最低限の数を表す整数定数 | | +| [`_IOFBF`](/reference/cstdio/iofbf.md.nolink) | 入出力を完全にバッファリングする指定のための整数定数 | | +| [`_IOLBF`](/reference/cstdio/iolbf.md.nolink) | 入出力を行バッファリングする指定のための整数定数 | | +| [`_IONBF`](/reference/cstdio/ionbf.md.nolink) | 入出力をバッファリングしない指定のための整数定数 | | +| [`BUFSIZ`](/reference/cstdio/bufsiz.md.nolink) | バッファサイズを表す整数定数 | | +| [`EOF`](/reference/cstdio/eof.md.nolink) | ファイルの終端であることを表す`int`型の整数定数 | | +| [`FOPEN_MAX`](/reference/cstdio/fopen_max.md.nolink) | 実装によって保証されるファイルを開ける最低限の数を表す整数定数 | | +| [`FILENAME_MAX`](/reference/cstdio/filename_max.md.nolink) | 実装によって保証されるファイル名の最大の長さを表す整数定数 | | +| [`L_tmpnam`](/reference/cstdio/l_tmpnam.md.nolink) | `tmpnam()`関数によって作られた一時ファイル名を保持する似に必要な長さを表す整数定数 | | +| [`SEEK_SET`](/reference/cstdio/seek_set.md.nolink) | ファイルの先頭位置を指定するための整数定数 | | +| [`SEEK_CUR`](/reference/cstdio/seek_cur.md.nolink) | ファイルの現在位置を指定するための整数定数 | | +| [`SEEK_END`](/reference/cstdio/seek_end.md.nolink) | ファイルの終端を指定するための整数定数 | | +| [`TMP_MAX`](/reference/cstdio/tmp_max.md.nolink) | `tempnam()`関数によって生成できる一時ファイル名の、実装が保証する最低限の数を表す整数定数 | | | [`stderr`](/reference/cstdio/stderr.md) | 標準エラーを表す`FILE*`型の式 | | [`stdin`](/reference/cstdio/stdin.md) | 標準入力を表す`FILE*`型の式 | | [`stdout`](/reference/cstdio/stdout.md) | 標準出力を表す`FILE*`型の式 | @@ -39,68 +39,68 @@ | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| `remove` | ファイルを削除する | | -| `rename` | ファイル名を変更、ファイルを移動する | | -| `tmpfile` | 一時ファイルを生成する | | -| `tempname` | 一時ファイル名を生成する | | -| `fclose` | ファイルを閉じる | | -| `fopen` | ファイルを開く | | -| `fflush` | ファイルをフラッシュする | | +| [`remove`](/reference/cstdio/remove.md.nolink) | ファイルを削除する | | +| [`rename`](/reference/cstdio/rename.md.nolink) | ファイル名を変更、ファイルを移動する | | +| [`tmpfile`](/reference/cstdio/tmpfile.md.nolink) | 一時ファイルを生成する | | +| [`tempname`](/reference/cstdio/tempname.md.nolink) | 一時ファイル名を生成する | | +| [`fclose`](/reference/cstdio/fclose.md.nolink) | ファイルを閉じる | | +| [`fopen`](/reference/cstdio/fopen.md.nolink) | ファイルを開く | | +| [`fflush`](/reference/cstdio/fflush.md.nolink) | ファイルをフラッシュする | | | [`fprintf`](/reference/cstdio/fprintf.md) | 書式を指定してファイルに出力する | | | [`fscanf`](/reference/cstdio/fscanf.md) | 書式を指定してファイルから入力する | | -| `vfprintf` | 可変引数リスト`va_list`を使用し、書式を指定してファイルに出力する | | -| `vfscanf` | 可変引数リスト`va_list`を使用し、書式を指定してファイルから入力する | C++17 | +| [`vfprintf`](/reference/cstdio/vfprintf.md.nolink) | 可変引数リスト`va_list`を使用し、書式を指定してファイルに出力する | | +| [`vfscanf`](/reference/cstdio/vfscanf.md.nolink) | 可変引数リスト`va_list`を使用し、書式を指定してファイルから入力する | C++17 | | [`fgetc`](/reference/cstdio/fgetc.md) | ファイルから1文字入力する | | | [`fgets`](/reference/cstdio/fgets.md) | ファイルからN文字入力する | | | [`fputc`](/reference/cstdio/fputc.md) | ファイルに1文字出力する | | -| `fputs` | ファイルにN文字出力する | | -| `fread` | ファイルからN文字読み込む | | -| `fwrite` | ファイルにN文字書き込む | | -| `fgetpos` | ファイルの現在位置を取得する | | -| `fseek` | ファイルの現在位置を移動する | | -| `fsetpos` | ファイルの現在位置を設定する | | -| `ftell` | ファイルの現在位置を取得する | | -| `rewind` | ファイルの現在位置を先頭に戻し、エラーや終端判定をクリアする | | -| `clearerr` | エラーをクリアする | | -| `feof` | ファイルが終端に到達したか判定する | | -| `ferror` | ファイルストリームがエラー状態かを判定する | | -| `perror` | システムエラーメッセージを出力する | | +| [`fputs`](/reference/cstdio/fputs.md.nolink) | ファイルにN文字出力する | | +| [`fread`](/reference/cstdio/fread.md.nolink) | ファイルからN文字読み込む | | +| [`fwrite`](/reference/cstdio/fwrite.md.nolink) | ファイルにN文字書き込む | | +| [`fgetpos`](/reference/cstdio/fgetpos.md.nolink) | ファイルの現在位置を取得する | | +| [`fseek`](/reference/cstdio/fseek.md.nolink) | ファイルの現在位置を移動する | | +| [`fsetpos`](/reference/cstdio/fsetpos.md.nolink) | ファイルの現在位置を設定する | | +| [`ftell`](/reference/cstdio/ftell.md.nolink) | ファイルの現在位置を取得する | | +| [`rewind`](/reference/cstdio/rewind.md.nolink) | ファイルの現在位置を先頭に戻し、エラーや終端判定をクリアする | | +| [`clearerr`](/reference/cstdio/clearerr.md.nolink) | エラーをクリアする | | +| [`feof`](/reference/cstdio/feof.md.nolink) | ファイルが終端に到達したか判定する | | +| [`ferror`](/reference/cstdio/ferror.md.nolink) | ファイルストリームがエラー状態かを判定する | | +| [`perror`](/reference/cstdio/perror.md.nolink) | システムエラーメッセージを出力する | | ## 標準入出力 | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| `printf` | 書式を指定して標準出力に出力する | | -| `scanf` | 書式を指定して標準入力から入力する | | -| `vprintf` | 可変引数リスト`va_list`を使用し、書式を指定して標準出力に出力する | | -| `vscanf` | 可変引数リスト`va_list`を使用し、書式を指定して標準入力から入力する | | -| `getc` | ストリームから1文字入力する | | -| `getchar` | 標準入力から1文字入力する | | -| `putc` | ストリームに1文字出力する | | -| `putchar` | 標準出力に1文字出力する | | -| `puts` | 標準出力に文字列を出力する | | -| `ungetc` | 入力ストリームに1文字戻す | | +| [`printf`](/reference/cstdio/printf.md.nolink) | 書式を指定して標準出力に出力する | | +| [`scanf`](/reference/cstdio/scanf.md.nolink) | 書式を指定して標準入力から入力する | | +| [`vprintf`](/reference/cstdio/vprintf.md.nolink) | 可変引数リスト`va_list`を使用し、書式を指定して標準出力に出力する | | +| [`vscanf`](/reference/cstdio/vscanf.md.nolink) | 可変引数リスト`va_list`を使用し、書式を指定して標準入力から入力する | | +| [`getc`](/reference/cstdio/getc.md.nolink) | ストリームから1文字入力する | | +| [`getchar`](/reference/cstdio/getchar.md.nolink) | 標準入力から1文字入力する | | +| [`putc`](/reference/cstdio/putc.md.nolink) | ストリームに1文字出力する | | +| [`putchar`](/reference/cstdio/putchar.md.nolink) | 標準出力に1文字出力する | | +| [`puts`](/reference/cstdio/puts.md.nolink) | 標準出力に文字列を出力する | | +| [`ungetc`](/reference/cstdio/ungetc.md.nolink) | 入力ストリームに1文字戻す | | ## 文字列入出力 | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| `snprintf` | 書式と文字数を指定して、文字列領域に出力する | | -| `sprintf` | 書式を指定して文字列領域に出力する | | -| `sscanf` | 書式を指定して文字列領域から入力する | | +| [`snprintf`](/reference/cstdio/snprintf.md.nolink) | 書式と文字数を指定して、文字列領域に出力する | | +| [`sprintf`](/reference/cstdio/sprintf.md.nolink) | 書式を指定して文字列領域に出力する | | +| [`sscanf`](/reference/cstdio/sscanf.md.nolink) | 書式を指定して文字列領域から入力する | | | `vsnprintf` | 可変引数リスト`va_list`を使用し、書式と文字数を指定して、文字列領域に出力する | | -| `vsprintf` | 可変引数リスト`va_list`を使用し、書式を指定して文字列領域に出力する | | -| `vsscanf` | 可変引数リスト`va_list`を使用し、書式を指定して文字列領域から入力する | | +| [`vsprintf`](/reference/cstdio/vsprintf.md.nolink) | 可変引数リスト`va_list`を使用し、書式を指定して文字列領域に出力する | | +| [`vsscanf`](/reference/cstdio/vsscanf.md.nolink) | 可変引数リスト`va_list`を使用し、書式を指定して文字列領域から入力する | | ## バッファ操作 | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| `setbuf` | 入出力用のバッファを設定する | | -| `setvbuf` | 戦略を指定して入出力用のバッファを設定する | | +| [`setbuf`](/reference/cstdio/setbuf.md.nolink) | 入出力用のバッファを設定する | | +| [`setvbuf`](/reference/cstdio/setvbuf.md.nolink) | 戦略を指定して入出力用のバッファを設定する | | ## 参照 From c2781ecbf0b1b122ab71b9ee3502cf19a00d7f31 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sat, 5 Jul 2025 14:11:16 +0900 Subject: [PATCH 1955/3948] new page `cstdlib/system.md` --- reference/cstdlib/system.md | 52 +++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 reference/cstdlib/system.md diff --git a/reference/cstdlib/system.md b/reference/cstdlib/system.md new file mode 100644 index 0000000000..f4d329eb6b --- /dev/null +++ b/reference/cstdlib/system.md @@ -0,0 +1,52 @@ +# system +* cstdlib[meta header] + + +```cpp +int system( const char* command ); +``` +## 概要 + + +ホスト環境のコマンド呼び出す。(e.g. /bin/sh, cmd.exe) + + +Returns an implementation-defined value (usually the value that the invoked program returns). + +If command is a null pointer, checks if the host environment has a command processor and returns a nonzero value if and only if the command processor exists. + +Parameters +command - character string identifying the command to be run in the command processor. If a null pointer is given, command processor is checked for existence +Return value +Implementation-defined value. If command is a null pointer, returns a nonzero value if and only if the command processor exists. + +Notes +On POSIX systems, the return value can be decomposed using WEXITSTATUS and WSTOPSIG. + +The related POSIX function popen makes the output generated by command available to the caller. + +An explicit flush of std::cout is also necessary before a call to std::system, if the spawned process performs any screen I/O. + +## 例 + +```cpp example +#include +#include +#include + +int main() +{ + std::system("ls -l"); + std::cout << std::ifstream("test.txt").rdbuf(); +} +``` + +## 出力結果 + +``` +total 16 +-rwxr-xr-x 1 2001 2000 8859 Sep 30 20:52 a.out +-rw-rw-rw- 1 2001 2000 161 Sep 30 20:52 main.cpp +-rw-r--r-- 1 2001 2000 0 Sep 30 20:52 test.txt +``` + From 09de4c46995fab06e07aae6e9298515a03a2722f Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sat, 5 Jul 2025 14:13:46 +0900 Subject: [PATCH 1956/3948] fix cstdlib/system.md --- reference/cstdlib/system.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/reference/cstdlib/system.md b/reference/cstdlib/system.md index f4d329eb6b..2a25607827 100644 --- a/reference/cstdlib/system.md +++ b/reference/cstdlib/system.md @@ -5,27 +5,20 @@ ```cpp int system( const char* command ); ``` -## 概要 - - -ホスト環境のコマンド呼び出す。(e.g. /bin/sh, cmd.exe) +## 概要 -Returns an implementation-defined value (usually the value that the invoked program returns). +ホスト環境のコマンド呼び出す。(e.g. `/bin/sh`, `cmd.exe`) -If command is a null pointer, checks if the host environment has a command processor and returns a nonzero value if and only if the command processor exists. +基本の返り値はコマンドの実行結果。 -Parameters -command - character string identifying the command to be run in the command processor. If a null pointer is given, command processor is checked for existence -Return value -Implementation-defined value. If command is a null pointer, returns a nonzero value if and only if the command processor exists. +コマンドがヌルポインタの場合、ホスト環境にコマンドプロセッサが存在するか確認し、存在している場合のみに非ゼロ値を返す。 -Notes -On POSIX systems, the return value can be decomposed using WEXITSTATUS and WSTOPSIG. +## 注釈 -The related POSIX function popen makes the output generated by command available to the caller. +POSIXでは`WEXITSTATUS`と`WSTOPSIG`を使用、分解できる -An explicit flush of std::cout is also necessary before a call to std::system, if the spawned process performs any screen I/O. +生成されるプロセスが画面の入出力を伴う場合、`std::system`を呼び出す前に、`std::cout`の明示的なフラッシュが必要になる場合がある。 ## 例 @@ -36,7 +29,7 @@ An explicit flush of std::cout is also necessary before a call to std::system, i int main() { - std::system("ls -l"); + std::system("ls -l >test.txt");//"ls -l >test.txt"を実行 std::cout << std::ifstream("test.txt").rdbuf(); } ``` @@ -50,3 +43,10 @@ total 16 -rw-r--r-- 1 2001 2000 0 Sep 30 20:52 test.txt ``` +## 関連項目 + +| 名前 | 説明 | +|------|------| +|[`flush`](../ostream/flush.md)|バッファをフラッシュする| +| [`WEXITSTATUS`]() | 子プロセスが正常に終了した場合、非ゼロ値を返す | +| [`WSTOPSIG`]() | 子プロセスを停止したシグナル数を評価する | From 54ee769b5d4367055a39f70f09b072debfc7d140 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sat, 5 Jul 2025 14:14:22 +0900 Subject: [PATCH 1957/3948] added linl `cstdlib/system.md` --- reference/cstdlib.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdlib.md b/reference/cstdlib.md index 3aa4bd7ba0..fca00a5122 100644 --- a/reference/cstdlib.md +++ b/reference/cstdlib.md @@ -65,7 +65,7 @@ | 名前 | 説明 | 対応バージョン | |----------|------|----------------| | `getenv` | 環境変数を取得する (function) | | -| `system` | システムコマンドを実行する (function) | | +| [`system`](cstdlib/system.md) | システムコマンドを実行する (function) | | ## 検索と並び替え From 2f9e3f4077512155ad56507696bc0813192c0d7e Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sat, 5 Jul 2025 14:23:29 +0900 Subject: [PATCH 1958/3948] `cstdlib/system`: fix class header --- reference/cstdlib/system.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reference/cstdlib/system.md b/reference/cstdlib/system.md index 2a25607827..569fae6b61 100644 --- a/reference/cstdlib/system.md +++ b/reference/cstdlib/system.md @@ -1,6 +1,7 @@ # system * cstdlib[meta header] - +* std[meta namespace] +* function[meta id-type] ```cpp int system( const char* command ); From 3f7dfed81e848e061d3619024ff176c003ef7a8a Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sat, 5 Jul 2025 15:31:50 +0900 Subject: [PATCH 1959/3948] new page `file.md` and removed .nolink --- reference/cstdio.md | 2 +- reference/cstdio/file.md | 19 +++++++++++++++++++ reference/cstdio/fprintf.md | 2 +- reference/cstdio/fscanf.md | 2 +- reference/print/print.md | 4 ++-- reference/print/println.md | 6 +++--- reference/print/vprint_nonunicode.md | 4 ++-- reference/print/vprint_nonunicode_buffered.md | 2 +- reference/print/vprint_unicode.md | 4 ++-- reference/print/vprint_unicode_buffered.md | 2 +- 10 files changed, 33 insertions(+), 14 deletions(-) create mode 100644 reference/cstdio/file.md diff --git a/reference/cstdio.md b/reference/cstdio.md index 5f438f34d7..92f569bbfa 100644 --- a/reference/cstdio.md +++ b/reference/cstdio.md @@ -9,7 +9,7 @@ | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`size_t`](/reference/cstddef/size_t.md) | 符号なし整数型 | | -| [`FILE`](/reference/cstdio/file.md.nolink) | ストリームの制御に必要な情報を持つオブジェクト型 | | +| [`FILE`](/reference/cstdio/file.md) | ストリームの制御に必要な情報を持つオブジェクト型 | | | [`fpos_t`](/reference/cstdio/fpos_t.md.nolink) | ファイルの全ての位置にアクセスするための配列以外の完全オブジェクト型 | | diff --git a/reference/cstdio/file.md b/reference/cstdio/file.md new file mode 100644 index 0000000000..44c0c938a6 --- /dev/null +++ b/reference/cstdio/file.md @@ -0,0 +1,19 @@ +# FILE +* cstdio[meta header] +* std[meta namespace] +* class[meta id-type] + +```cpp +typedef /* unspecified */ FILE; +``` + +## 概要 +`FILE`型は、ストリームの制御に必要な情報を持つオブジェクト型である。 + +`FILE`型のオブジェクトは、完全な型であることが保証されていない。つまり、コピーをしたときの動作は不定である(未定義ではない)。 + +## 処理系 + +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cstdio/fprintf.md b/reference/cstdio/fprintf.md index 98439de698..70636d1ca9 100644 --- a/reference/cstdio/fprintf.md +++ b/reference/cstdio/fprintf.md @@ -26,7 +26,7 @@ int main() { * std::fprintf[color ff0000] * std::fopen[link /reference/cstdio/fopen.md.nolink] * std::fclose[link /reference/cstdio/fclose.md.nolink] -* std::FILE[link /reference/cstdio/file.md.nolink] +* std::FILE[link /reference/cstdio/file.md] ### 出力 ``` Hello, World! diff --git a/reference/cstdio/fscanf.md b/reference/cstdio/fscanf.md index c6eddd5321..1d7705e2e3 100644 --- a/reference/cstdio/fscanf.md +++ b/reference/cstdio/fscanf.md @@ -26,7 +26,7 @@ int main() { * std::fscanf[color ff0000] * std::fopen[link /reference/cstdio/fopen.md.nolink] * std::fclose[link /reference/cstdio/fclose.md.nolink] -* std::FILE[link /reference/cstdio/file.md.nolink] +* std::FILE[link /reference/cstdio/file.md] ### 出力(test.txtは以下参照) ``` 123 diff --git a/reference/print/print.md b/reference/print/print.md index 8278a0d480..73880f95ae 100644 --- a/reference/print/print.md +++ b/reference/print/print.md @@ -17,7 +17,7 @@ namespace std { } ``` * format_string[link /reference/format/basic_format_string.md] -* FILE[link /reference/cstdio/file.md.nolink] +* FILE[link /reference/cstdio/file.md] ## 概要 書式指定で出力する。 @@ -27,7 +27,7 @@ namespace std { この関数は、[`std::printf()`](/reference/cstdio/printf.md.nolink)関数ライクな書式指定で引数を文字列化して出力する。 - (1) : 標準出力に、書式指定で出力する -- (2) : 指定された[`FILE`](/reference/cstdio/file.md.nolink)に、書式指定で出力する +- (2) : 指定された[`FILE`](/reference/cstdio/file.md)に、書式指定で出力する この関数は、末尾に改行コードが付かないことに注意。改行コードを自動で付けたい場合は、[`std::println()`](println.md)関数を使用すること。 diff --git a/reference/print/println.md b/reference/print/println.md index 9cf37fbe69..384f41deb8 100644 --- a/reference/print/println.md +++ b/reference/print/println.md @@ -21,7 +21,7 @@ namespace std { } ``` * format_string[link /reference/format/basic_format_string.md] -* FILE[link /reference/cstdio/file.md.nolink] +* FILE[link /reference/cstdio/file.md] ## 概要 書式指定で出力する。この関数は、出力の末尾に改行コードが自動で付加される。 @@ -32,8 +32,8 @@ namespace std { - (1) : 標準出力に、書式指定で出力する - (2) : 標準出力に改行コードを出力する -- (3) : 指定された[`FILE`](/reference/cstdio/file.md.nolink)に、書式指定で出力する -- (4) : 指定された[`FILE`](/reference/cstdio/file.md.nolink)に、改行コードを出力する +- (3) : 指定された[`FILE`](/reference/cstdio/file.md)に、書式指定で出力する +- (4) : 指定された[`FILE`](/reference/cstdio/file.md)に、改行コードを出力する この関数は、末尾に改行コードが付くことに注意。改行コードが不要な場合は、[`std::print()`](print.md)関数を使用すること。 diff --git a/reference/print/vprint_nonunicode.md b/reference/print/vprint_nonunicode.md index df2f758f92..581aa6bd13 100644 --- a/reference/print/vprint_nonunicode.md +++ b/reference/print/vprint_nonunicode.md @@ -14,14 +14,14 @@ namespace std { format_args args); // (2) C++23 } ``` -* FILE[link /reference/cstdio/file.md.nolink] +* FILE[link /reference/cstdio/file.md] * format_args[link /reference/format/basic_format_args.md] ## 概要 書式指定で非Unicode出力する。 - (1) : 標準出力に、書式指定で非Unicode出力する -- (2) : 指定された[`FILE`](/reference/cstdio/file.md.nolink)に、書式指定で非Unicode出力する +- (2) : 指定された[`FILE`](/reference/cstdio/file.md)に、書式指定で非Unicode出力する [`std::ostream`](/reference/ostream/basic_ostream.md)から派生したクラスオブジェクトに対して出力したい場合は、[``](/reference/ostream.md)ヘッダの[`std::vprint_nonunicode()`](/reference/ostream/vprint_nonunicode.md)関数を使用すること。 diff --git a/reference/print/vprint_nonunicode_buffered.md b/reference/print/vprint_nonunicode_buffered.md index 6521cbc1c6..97a380ee84 100644 --- a/reference/print/vprint_nonunicode_buffered.md +++ b/reference/print/vprint_nonunicode_buffered.md @@ -12,7 +12,7 @@ namespace std { format_args args); // (1) C++26 } ``` -* FILE[link /reference/cstdio/file.md.nolink] +* FILE[link /reference/cstdio/file.md] * format_args[link /reference/format/basic_format_args.md] ## 概要 diff --git a/reference/print/vprint_unicode.md b/reference/print/vprint_unicode.md index 94ab55d78c..e1b94254fd 100644 --- a/reference/print/vprint_unicode.md +++ b/reference/print/vprint_unicode.md @@ -14,14 +14,14 @@ namespace std { format_args args); // (2) C++23 } ``` -* FILE[link /reference/cstdio/file.md.nolink] +* FILE[link /reference/cstdio/file.md] * format_args[link /reference/format/basic_format_args.md] ## 概要 書式指定でUnicode出力する。 - (1) : 標準出力に、書式指定でUnicode出力する -- (2) : 指定された[`FILE`](/reference/cstdio/file.md.nolink)に、書式指定でUnicode出力する +- (2) : 指定された[`FILE`](/reference/cstdio/file.md)に、書式指定でUnicode出力する [`std::ostream`](/reference/ostream/basic_ostream.md)から派生したクラスオブジェクトに対して出力したい場合は、[``](/reference/ostream.md)ヘッダの[`std::vprint_unicode()`](/reference/ostream/vprint_unicode.md)関数を使用すること。 diff --git a/reference/print/vprint_unicode_buffered.md b/reference/print/vprint_unicode_buffered.md index 34fcb526ea..4377bc7fd0 100644 --- a/reference/print/vprint_unicode_buffered.md +++ b/reference/print/vprint_unicode_buffered.md @@ -12,7 +12,7 @@ namespace std { format_args args); // (1) C++26 } ``` -* FILE[link /reference/cstdio/file.md.nolink] +* FILE[link /reference/cstdio/file.md] * format_args[link /reference/format/basic_format_args.md] ## 概要 From 3e6fdb54cd3ee0a9c36985337941bb5e89881a69 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sat, 5 Jul 2025 15:33:35 +0900 Subject: [PATCH 1960/3948] fixed explanation --- reference/cstdio/file.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdio/file.md b/reference/cstdio/file.md index 44c0c938a6..d3fbc50c36 100644 --- a/reference/cstdio/file.md +++ b/reference/cstdio/file.md @@ -10,7 +10,7 @@ typedef /* unspecified */ FILE; ## 概要 `FILE`型は、ストリームの制御に必要な情報を持つオブジェクト型である。 -`FILE`型のオブジェクトは、完全な型であることが保証されていない。つまり、コピーをしたときの動作は不定である(未定義ではない)。 +`FILE`型のオブジェクトは、完全な型であることが保証されていない。つまり、コピーをしたときの動作は不定である(未定義動作ではない)。 ## 処理系 From 3b792ce6e263120768ef2050cd8d2cb907301a15 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sat, 5 Jul 2025 15:40:07 +0900 Subject: [PATCH 1961/3948] new page `eof.md` and removed nolink --- reference/cstdio.md | 2 +- reference/cstdio/eof.md | 46 +++++++++++++++++++++++++++++++++++++++ reference/cstdio/fputc.md | 2 +- 3 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 reference/cstdio/eof.md diff --git a/reference/cstdio.md b/reference/cstdio.md index 92f569bbfa..5f39359708 100644 --- a/reference/cstdio.md +++ b/reference/cstdio.md @@ -22,7 +22,7 @@ | [`_IOLBF`](/reference/cstdio/iolbf.md.nolink) | 入出力を行バッファリングする指定のための整数定数 | | | [`_IONBF`](/reference/cstdio/ionbf.md.nolink) | 入出力をバッファリングしない指定のための整数定数 | | | [`BUFSIZ`](/reference/cstdio/bufsiz.md.nolink) | バッファサイズを表す整数定数 | | -| [`EOF`](/reference/cstdio/eof.md.nolink) | ファイルの終端であることを表す`int`型の整数定数 | | +| [`EOF`](/reference/cstdio/eof.md) | ファイルの終端であることを表す`int`型の整数定数 | | | [`FOPEN_MAX`](/reference/cstdio/fopen_max.md.nolink) | 実装によって保証されるファイルを開ける最低限の数を表す整数定数 | | | [`FILENAME_MAX`](/reference/cstdio/filename_max.md.nolink) | 実装によって保証されるファイル名の最大の長さを表す整数定数 | | | [`L_tmpnam`](/reference/cstdio/l_tmpnam.md.nolink) | `tmpnam()`関数によって作られた一時ファイル名を保持する似に必要な長さを表す整数定数 | | diff --git a/reference/cstdio/eof.md b/reference/cstdio/eof.md new file mode 100644 index 0000000000..b4b8db4cf4 --- /dev/null +++ b/reference/cstdio/eof.md @@ -0,0 +1,46 @@ +# EOF +* cstdio[meta header] +* std[meta namespace] +* macro[meta id-type] + +```cpp +#define EOF /* implementation defined */ +``` + +## 概要 +ファイルの終端であることを表すマクロ。 + +型は`int`であり、負であることが保証されている。 + +## 例 +```cpp example +#include +int main() { + int c; + while ((c = getchar()) != EOF) { + putchar(c); + } + if (c == EOF) + puts("REACHED END"); +} + +``` + +### 入力 +``` +aa +``` + +### 出力 +``` +aa +REACHED END +``` + + +## 処理系 + +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + diff --git a/reference/cstdio/fputc.md b/reference/cstdio/fputc.md index a8d678c1db..d775cfc7f7 100644 --- a/reference/cstdio/fputc.md +++ b/reference/cstdio/fputc.md @@ -15,7 +15,7 @@ int fputc( int ch, FILE* stream ); ## 戻り値 出力された文字を返す。 -失敗した場合、[`EOF`](/reference/cstdio/eof.md.nolink)を返す。 +失敗した場合、[`EOF`](/reference/cstdio/eof.md)を返す。 ## 例 ```cpp example From 09eb35eb4a7da7326deb056d2a16a2d25c2f4d08 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sat, 5 Jul 2025 15:43:24 +0900 Subject: [PATCH 1962/3948] new page `filename_max.md` and removed nolink --- reference/cstdio.md | 2 +- reference/cstdio/filename_max.md | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 reference/cstdio/filename_max.md diff --git a/reference/cstdio.md b/reference/cstdio.md index 5f39359708..4910aad33d 100644 --- a/reference/cstdio.md +++ b/reference/cstdio.md @@ -24,7 +24,7 @@ | [`BUFSIZ`](/reference/cstdio/bufsiz.md.nolink) | バッファサイズを表す整数定数 | | | [`EOF`](/reference/cstdio/eof.md) | ファイルの終端であることを表す`int`型の整数定数 | | | [`FOPEN_MAX`](/reference/cstdio/fopen_max.md.nolink) | 実装によって保証されるファイルを開ける最低限の数を表す整数定数 | | -| [`FILENAME_MAX`](/reference/cstdio/filename_max.md.nolink) | 実装によって保証されるファイル名の最大の長さを表す整数定数 | | +| [`FILENAME_MAX`](/reference/cstdio/filename_max.md) | 実装によって保証されるファイル名の最大の長さを表す整数定数 | | | [`L_tmpnam`](/reference/cstdio/l_tmpnam.md.nolink) | `tmpnam()`関数によって作られた一時ファイル名を保持する似に必要な長さを表す整数定数 | | | [`SEEK_SET`](/reference/cstdio/seek_set.md.nolink) | ファイルの先頭位置を指定するための整数定数 | | | [`SEEK_CUR`](/reference/cstdio/seek_cur.md.nolink) | ファイルの現在位置を指定するための整数定数 | | diff --git a/reference/cstdio/filename_max.md b/reference/cstdio/filename_max.md new file mode 100644 index 0000000000..83c07fb2c8 --- /dev/null +++ b/reference/cstdio/filename_max.md @@ -0,0 +1,19 @@ +# FILENAME_MAX +* cstdio[meta header] +* std[meta namespace] +* macro[meta id-type] + +```cpp +#define FILENAME_MAX /* implementation defined */ +``` + +## 概要 +ファイル名の最大の長さを表すマクロ。 + +一般的なLinuxカーネルでは`4096`である。 + +## 処理系 + +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? From 62c038cece78788052fcb86d9a34afd7a98e05a7 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sat, 5 Jul 2025 15:46:03 +0900 Subject: [PATCH 1963/3948] new page `remove.md` and removed nolink --- reference/cstdio.md | 2 +- reference/cstdio/remove.md | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 reference/cstdio/remove.md diff --git a/reference/cstdio.md b/reference/cstdio.md index 4910aad33d..b850fdc996 100644 --- a/reference/cstdio.md +++ b/reference/cstdio.md @@ -39,7 +39,7 @@ | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`remove`](/reference/cstdio/remove.md.nolink) | ファイルを削除する | | +| [`remove`](/reference/cstdio/remove.md) | ファイルを削除する | | | [`rename`](/reference/cstdio/rename.md.nolink) | ファイル名を変更、ファイルを移動する | | | [`tmpfile`](/reference/cstdio/tmpfile.md.nolink) | 一時ファイルを生成する | | | [`tempname`](/reference/cstdio/tempname.md.nolink) | 一時ファイル名を生成する | | diff --git a/reference/cstdio/remove.md b/reference/cstdio/remove.md new file mode 100644 index 0000000000..51846b5464 --- /dev/null +++ b/reference/cstdio/remove.md @@ -0,0 +1,24 @@ +# remove +* cstdio[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +int remove( const char* pathname ); +``` + +## 概要 +指定されたファイルを削除する。 + +他のプロセスによってファイルが開かれている場合、その動作は処理系依存である。 + +## 戻り値 +成功した場合、`0`を返す。 + +失敗した場合、`0`以外の値を返す。 + +## 処理系 + +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? From 84741e0f68fc35cb621d1d307bb2e300bd404517 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sat, 5 Jul 2025 15:48:23 +0900 Subject: [PATCH 1964/3948] new page `rename.md` and removed nolink --- reference/cstdio.md | 2 +- reference/cstdio/rename.md | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 reference/cstdio/rename.md diff --git a/reference/cstdio.md b/reference/cstdio.md index b850fdc996..44b3a6e31a 100644 --- a/reference/cstdio.md +++ b/reference/cstdio.md @@ -40,7 +40,7 @@ | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`remove`](/reference/cstdio/remove.md) | ファイルを削除する | | -| [`rename`](/reference/cstdio/rename.md.nolink) | ファイル名を変更、ファイルを移動する | | +| [`rename`](/reference/cstdio/rename.md) | ファイル名を変更、ファイルを移動する | | | [`tmpfile`](/reference/cstdio/tmpfile.md.nolink) | 一時ファイルを生成する | | | [`tempname`](/reference/cstdio/tempname.md.nolink) | 一時ファイル名を生成する | | | [`fclose`](/reference/cstdio/fclose.md.nolink) | ファイルを閉じる | | diff --git a/reference/cstdio/rename.md b/reference/cstdio/rename.md new file mode 100644 index 0000000000..b45dff6680 --- /dev/null +++ b/reference/cstdio/rename.md @@ -0,0 +1,24 @@ +# rename +* cstdio[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +int rename( const char* old_filename, const char* new_filename ); +``` + +## 概要 +指定されたファイル名を新しいファイル名に変更する。 + +新しいファイル名に既にファイルが存在している場合の動作は処理系依存である。 + +## 戻り値 +成功した場合、`0`を返す。 + +失敗した場合、`0`以外の値を返す。 + +## 処理系 + +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file From 472ef704707e360f89f7ec80240b653d5c44ea82 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sat, 5 Jul 2025 15:59:15 +0900 Subject: [PATCH 1965/3948] new page `tmpfile.md` and removed nolink --- reference/cstdio.md | 2 +- reference/cstdio/tmpfile.md | 30 ++++++++++++++++++++++++++++++ reference/cstdlib/exit.md | 2 +- 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 reference/cstdio/tmpfile.md diff --git a/reference/cstdio.md b/reference/cstdio.md index 44b3a6e31a..df62965029 100644 --- a/reference/cstdio.md +++ b/reference/cstdio.md @@ -41,7 +41,7 @@ |------|------|----------------| | [`remove`](/reference/cstdio/remove.md) | ファイルを削除する | | | [`rename`](/reference/cstdio/rename.md) | ファイル名を変更、ファイルを移動する | | -| [`tmpfile`](/reference/cstdio/tmpfile.md.nolink) | 一時ファイルを生成する | | +| [`tmpfile`](/reference/cstdio/tmpfile.md) | 一時ファイルを生成する | | | [`tempname`](/reference/cstdio/tempname.md.nolink) | 一時ファイル名を生成する | | | [`fclose`](/reference/cstdio/fclose.md.nolink) | ファイルを閉じる | | | [`fopen`](/reference/cstdio/fopen.md.nolink) | ファイルを開く | | diff --git a/reference/cstdio/tmpfile.md b/reference/cstdio/tmpfile.md new file mode 100644 index 0000000000..807315c264 --- /dev/null +++ b/reference/cstdio/tmpfile.md @@ -0,0 +1,30 @@ +# tmpfile +* cstdio[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +std::FILE* tmpfile(); +``` + +## 概要 +一時ファイルを生成する。 + +[`std::fclose`](/reference/cstdio/fclose.md.nolink)関数を呼び出すと、一時ファイルは自動的に削除される。 + +通常終了([`exit`](/reference/cstdlib/exit.md)関数や`main`関数のreturn文)時には、一時ファイルは自動的に削除される。 + +それ以外の場合による終了は処理系依存である。 + +## 戻り値 +成功した場合、一時ファイルを指すファイルストリームを返す。 + +失敗した場合、`NULL`を返す。 + +## 処理系 + +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + diff --git a/reference/cstdlib/exit.md b/reference/cstdlib/exit.md index 225510719b..6cab65e729 100644 --- a/reference/cstdlib/exit.md +++ b/reference/cstdlib/exit.md @@ -29,7 +29,7 @@ namespace std { 4. 全てのCストリームが破棄される。 - まだ書き出されていないバッファリングされたデータはフラッシュされる。 - ストリームが閉じられる。 - - [`tmpfile()`](/reference/cstdio/tmpfile.md.nolink)関数の呼び出しで作成された一時ファイルが削除される。 + - [`tmpfile()`](/reference/cstdio/tmpfile.md)関数の呼び出しで作成された一時ファイルが削除される。 5. ホスト環境に制御が戻される。 - パラメータ`status`の値が`0`もしくは[`EXIT_SUCCESS`](exit_success.md)であった場合、実装依存の正常終了値が返る。 - パラメータ`status`の値が[`EXIT_FAILURE`](exit_failure.md)であった場合、実装依存の異常終了値が返る。 From f266b0f6ec6467598449268938a27a4f432c2c6a Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sat, 5 Jul 2025 16:11:33 +0900 Subject: [PATCH 1966/3948] new page `tmpnam.md` and fixed name for `cstdio.md` and removed nolink --- reference/cstdio.md | 2 +- reference/cstdio/tmpnam.md | 47 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 reference/cstdio/tmpnam.md diff --git a/reference/cstdio.md b/reference/cstdio.md index df62965029..047ca3ecae 100644 --- a/reference/cstdio.md +++ b/reference/cstdio.md @@ -42,7 +42,7 @@ | [`remove`](/reference/cstdio/remove.md) | ファイルを削除する | | | [`rename`](/reference/cstdio/rename.md) | ファイル名を変更、ファイルを移動する | | | [`tmpfile`](/reference/cstdio/tmpfile.md) | 一時ファイルを生成する | | -| [`tempname`](/reference/cstdio/tempname.md.nolink) | 一時ファイル名を生成する | | +| [`tmpnam`](/reference/cstdio/tmpnam.md) | 一時ファイル名を生成する | | | [`fclose`](/reference/cstdio/fclose.md.nolink) | ファイルを閉じる | | | [`fopen`](/reference/cstdio/fopen.md.nolink) | ファイルを開く | | | [`fflush`](/reference/cstdio/fflush.md.nolink) | ファイルをフラッシュする | | diff --git a/reference/cstdio/tmpnam.md b/reference/cstdio/tmpnam.md new file mode 100644 index 0000000000..ba97e0f2b0 --- /dev/null +++ b/reference/cstdio/tmpnam.md @@ -0,0 +1,47 @@ +# tmpnam +* cstdio[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +char* tmpnam( char* filename ); +``` + +## 概要 +一時ファイル名を生成する。 + +渡した引数の中にファイル名が格納される。 + +この関数はスレッドセーフではないため、マルチスレッド環境での使用は推奨されない。 + +また、生成された名前が他のファイル名とかぶらないことは保証されていない(保証する必要があるならば[`tmpfile`](/reference/cstdio/tmpfile.md)を使用する)。 + +## 戻り値 +成功した場合 +- 渡した引数のポインタを返す。 +- 渡した引数が`NULL`であった場合、内部にある静的なバッファへのポインタが返される。 + +失敗した場合、`NULL`を返す。 + +## 例 +```cpp example +#include +#include + +int main() { + char filename[1000]; + if (std::tmpnam(filename)) { + std::cout << "Generated filename: " << filename << '\n'; + // ここで fopen(filename, "w") とかして使う(が、あまり推奨されない) + } else { + std::cerr << "Failed to generate temp name\n"; + } +} +``` + +## 処理系 + +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + From fd567d568575919272900cff134d6cf98405564e Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sat, 5 Jul 2025 18:10:27 +0900 Subject: [PATCH 1967/3948] cstdlib/system:fixed text --- reference/cstdlib/system.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdlib/system.md b/reference/cstdlib/system.md index 569fae6b61..db93e60e73 100644 --- a/reference/cstdlib/system.md +++ b/reference/cstdlib/system.md @@ -15,7 +15,7 @@ int system( const char* command ); コマンドがヌルポインタの場合、ホスト環境にコマンドプロセッサが存在するか確認し、存在している場合のみに非ゼロ値を返す。 -## 注釈 +## 備考 POSIXでは`WEXITSTATUS`と`WSTOPSIG`を使用、分解できる From 52760d224783a840dc206dbf2a7b76bdcd31cf1e Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sat, 5 Jul 2025 18:21:18 +0900 Subject: [PATCH 1968/3948] new page cstdlib/getenv --- reference/cstdlib/getenv.md | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 reference/cstdlib/getenv.md diff --git a/reference/cstdlib/getenv.md b/reference/cstdlib/getenv.md new file mode 100644 index 0000000000..3d0f60cf47 --- /dev/null +++ b/reference/cstdlib/getenv.md @@ -0,0 +1,40 @@ +# getenv +* cstdlib[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +char* getenv( const char* env_var ); +``` + +## 概要 + +ホスト環境(OS)が提供する環境リストから、Cストリング`env_var`と一致する文字列を検索、一致したもののポインタを返す + +## 返り値 + +一致したものがあれば環境変数を保持した文字列、なければヌルポインタを返す + +## 備考 + +C++11以前は、他の関数でホスト環境が変更されなければ、この関数はスレッドセーフである。(他のスレッドで呼び出された場合でも) + +C++11以降では、`getenv`が返す文字列を変更すると未定義動作となる。 + +## 例 +```cpp example +#include +#include + +int main() +{ + if (const char* env_p = std::getenv("PATH")) + std::cout << "Your PATH is: " << env_p << '\n'; +} +``` + +## 出力結果 +``` +Your PATH is: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games +``` + From 84f93b2d75f843391fea98433d38912bdf11adac Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sat, 5 Jul 2025 18:22:27 +0900 Subject: [PATCH 1969/3948] add path cstdlib/getenv in cstdlib.md --- reference/cstdlib.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdlib.md b/reference/cstdlib.md index fca00a5122..97381805a4 100644 --- a/reference/cstdlib.md +++ b/reference/cstdlib.md @@ -64,7 +64,7 @@ | 名前 | 説明 | 対応バージョン | |----------|------|----------------| -| `getenv` | 環境変数を取得する (function) | | +| [`getenv`](cstdlib/getenv.md) | 環境変数を取得する (function) | | | [`system`](cstdlib/system.md) | システムコマンドを実行する (function) | | From 7cd29afc7bf42fed62584ec3c1f511355daa1173 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sat, 5 Jul 2025 19:01:28 +0900 Subject: [PATCH 1970/3948] new page `cstdlib/atoi_atol_atoll` --- reference/cstdlib/atoi_atol_atoll.md | 68 ++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 reference/cstdlib/atoi_atol_atoll.md diff --git a/reference/cstdlib/atoi_atol_atoll.md b/reference/cstdlib/atoi_atol_atoll.md new file mode 100644 index 0000000000..28413ac13d --- /dev/null +++ b/reference/cstdlib/atoi_atol_atoll.md @@ -0,0 +1,68 @@ +## atoi,atol,atoll +* cstdlib[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +int atoi ( const char* str ); +long atol ( const char* str ); +long long atoll( const char* str ); +``` + +## 概要 + +`str`を`int` `long` `long long`に変換する。 + +基数は常に10である。 + +## 変換方法 + +空白文字から始まる場合、最初の非空白文字から変換する。 + +\+ ,\-は変換後の符号に適用される。 + + +変換不可能ならば0を返す.。 + +## 備考 + +変換後の数値が戻り値の範囲外の場合、動作は未定義である。 + +名前は、ASCII to integerから命名。 + +## 例 + +```cpp example +#include +#include + +int main(void) +{ + printf("%i\n", atoi(" -123junk")); + printf("%i\n", atoi(" +321dust")); + printf("%i\n", atoi("0")); + printf("%i\n", atoi("0042")); // 先頭の0を含む10進数として変換 + printf("%i\n", atoi("0x2A")); // 0のみを変換、"x2A"は破棄される + printf("%i\n", atoi("junk")); // 変換不可 + printf("%i\n", atoi("2147483648")); //intの範囲外 +} +``` + +## 出力例 + +``` +-123 +321 +0 +42 +0 +0 +-2147483648 +``` + +## 参照 +- [7.22.1.2 The atoi, atol, and atoll functions](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3220.pdf) +- [7.22.1.2 The atoi, atol, and atoll functions (p: 249)](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2310.pdf) +- [7.22.1.2 The atoi, atol, and atoll functions (p: 341)](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1548.pdf) +- [7.20.1.2 The atoi, atol, and atoll functions (p: 307)](https://www.dii.uchile.cl/~daespino/files/Iso_C_1999_definition.pdf) +- [4.10.1.2 The atoi function](https://www.dii.uchile.cl/~daespino/files/Iso_C_1999_definition.pdf) From f970e6fafe2fc6c0586bdc4914019bab2093cedc Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sat, 5 Jul 2025 19:03:12 +0900 Subject: [PATCH 1971/3948] add path atoi_atol_atoll.md in cstlib --- reference/cstdlib.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/cstdlib.md b/reference/cstdlib.md index 97381805a4..04aaeb17e6 100644 --- a/reference/cstdlib.md +++ b/reference/cstdlib.md @@ -13,9 +13,9 @@ | 名前 | 説明 | 対応バージョン | |--------|------|----------------| -| `atoi` | 文字列を`int`型に変換する (function) | | -| `atol` | 文字列を`long`型に変換する (function) | | -| `atoll` | 文字列を`long long`型に変換する (function) | C++11 | +| [`atoi`](cstdlib/atoi_atol_atoll.md) | 文字列を`int`型に変換する (function) | | +| [`atol`](cstdlib/atoi_atol_atoll.md) | 文字列を`long`型に変換する (function) | | +| [`atoll`](cstdlib/atoi_atol_atoll.md) | 文字列を`long long`型に変換する (function) | C++11 | | `atof` | 文字列を`double`型に変換する (function) | | | `strtol` | 文字列を、基数を指定して`long`型に変換する (function) | | | `strtoll` | 文字列を、基数を指定して`long long`型に変換する (function) | C++11 | From 69f3c46305c4286a458d9014ac7dfd1e7d1012e0 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sat, 5 Jul 2025 20:15:11 +0900 Subject: [PATCH 1972/3948] fix head size --- reference/cstdlib/atoi_atol_atoll.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdlib/atoi_atol_atoll.md b/reference/cstdlib/atoi_atol_atoll.md index 28413ac13d..d8e856ad5e 100644 --- a/reference/cstdlib/atoi_atol_atoll.md +++ b/reference/cstdlib/atoi_atol_atoll.md @@ -1,4 +1,4 @@ -## atoi,atol,atoll +# atoi,atol,atoll * cstdlib[meta header] * std[meta namespace] * function[meta id-type] From a086c7ffb9647ea30f3db83023cf3a76e8ba2c4a Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sat, 5 Jul 2025 20:26:53 +0900 Subject: [PATCH 1973/3948] =?UTF-8?q?=E4=B8=8D=E8=A6=81=E6=96=87=E5=AD=97?= =?UTF-8?q?=E3=81=AE=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/atoi_atol_atoll.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/cstdlib/atoi_atol_atoll.md b/reference/cstdlib/atoi_atol_atoll.md index d8e856ad5e..7d31e88ec5 100644 --- a/reference/cstdlib/atoi_atol_atoll.md +++ b/reference/cstdlib/atoi_atol_atoll.md @@ -19,10 +19,10 @@ long long atoll( const char* str ); 空白文字から始まる場合、最初の非空白文字から変換する。 -\+ ,\-は変換後の符号に適用される。 +\+ 、\-は変換後の符号に適用される。 -変換不可能ならば0を返す.。 +変換不可能ならば0を返す。 ## 備考 From 60a1a63aebda133c602885c081a4587493dff3bb Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sat, 5 Jul 2025 21:35:34 +0900 Subject: [PATCH 1974/3948] string/stoi.md: add path to atoi --- reference/string/stoi.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/string/stoi.md b/reference/string/stoi.md index 91dec0477e..657d5e1d8f 100644 --- a/reference/string/stoi.md +++ b/reference/string/stoi.md @@ -234,7 +234,7 @@ int stoi(const std::wstring& str, std::size_t* idx = nullptr, int base = 10) { ## 関連リンク ### C標準ライブラリに由来する関数 -- `atoi`: `stoi`は`atoi`を`std::string`および`std::wstring`に対応させたものと見なせる。 +- [`atoi`](/reference/cstdlib/atoi_atol_atoll.md): `stoi`は[`atoi`](/reference/cstdlib/atoi_atol_atoll.md)を`std::string`および`std::wstring`に対応させたものと見なせる。 - `strtol`, `wcstol`: `stoi`は`strtol`および`wcstol`をそれぞれ`std::string`と`std::wstring`に対応させ、戻り値の型を`int`に変更したものと見なせる。 ### ファミリー From e7e43342dce5ca52efed562580e1d1529758f4b5 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sat, 5 Jul 2025 21:37:07 +0900 Subject: [PATCH 1975/3948] string/stol:add path to atol --- reference/string/stol.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/string/stol.md b/reference/string/stol.md index d558864eea..0b9401b257 100644 --- a/reference/string/stol.md +++ b/reference/string/stol.md @@ -232,7 +232,7 @@ long stol(const std::wstring& str, std::size_t* idx = nullptr, long base = 10) { ## 関連リンク ### C標準ライブラリに由来する関数 -- `atol`: `stol`は`atol`を`std::string`および`std::wstring`に対応させたものと見なせる。 +- [`atol`](/reference/cstdlib/atoi_atol_atoll.md): `stol`は[`atol`](/reference/cstdlib/atoi_atol_atoll.md)を`std::string`および`std::wstring`に対応させたものと見なせる。 - `strtol`, `wcstol`: `stol`は`strtol`および`wcstol`をそれぞれ`std::string`と`std::wstring`に対応させたものと見なせる。 ### ファミリー From fb601381f6ee7085743b2ae5dea6f2fa5c68afe6 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sat, 5 Jul 2025 21:42:16 +0900 Subject: [PATCH 1976/3948] string/stouol:add path to atol --- reference/string/stoul.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/string/stoul.md b/reference/string/stoul.md index 0cdb0ef75c..6c156599c3 100644 --- a/reference/string/stoul.md +++ b/reference/string/stoul.md @@ -237,7 +237,7 @@ unsigned long stoul(const std::wstring& str, std::size_t* idx = nullptr, unsigne ## 関連リンク ### C標準ライブラリに由来する関数 -- `atol`: `stoul`は`atol`を`std::string`および`std::wstring`に対応させ、戻り値の型を`unsigned long`に変更したものと見なせる。 +- [`atol`](/reference/cstdlib/atoi_atol_atoll.md): `stoul`は[`atol`](/reference/cstdlib/atoi_atol_atoll.md)を`std::string`および`std::wstring`に対応させ、戻り値の型を`unsigned long`に変更したものと見なせる。 - `strtoul`, `wcstoul`: `stoul`は`strtoul`および`wcstoul`をそれぞれ`std::string`と`std::wstring`に対応させたものと見なせる。 ### ファミリー From 2742bc71a0e5547644f89d8de9a7fface9936971 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sat, 5 Jul 2025 21:42:29 +0900 Subject: [PATCH 1977/3948] string/stoll:add path to atoll --- reference/string/stoll.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/string/stoll.md b/reference/string/stoll.md index 8dcb6ff153..e310cb6019 100644 --- a/reference/string/stoll.md +++ b/reference/string/stoll.md @@ -237,7 +237,7 @@ long long stoll(const std::wstring& str, std::size_t* idx = nullptr, long long b ## 関連リンク ### C標準ライブラリに由来する関数 -- `atoll`: `stoll`は`atoll`を`std::string`および`std::wstring`に対応させたものと見なせる。 +- [`atoll`](/reference/cstdlib/atoi_atol_atoll.md): `stoll`は[`atoll`](/reference/cstdlib/atoi_atol_atoll.md)を`std::string`および`std::wstring`に対応させたものと見なせる。 - `strtoll`, `wcstlol`: `stoll`は`strtoll`および`wcstoll`をそれぞれ`std::string`と`std::wstring`に対応させたものと見なせる。 ### ファミリー From 3f1903d2f419b979d383ee58bbdcff339504f937 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sat, 5 Jul 2025 21:42:53 +0900 Subject: [PATCH 1978/3948] charconv:add path to atol --- reference/charconv.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/charconv.md b/reference/charconv.md index 77c2b7317a..e8827dfee4 100644 --- a/reference/charconv.md +++ b/reference/charconv.md @@ -50,7 +50,7 @@ XMLやJSONに代表されるテキストベースのデータを利用するケ | `sprintf` | ロケール依存、フォーマットの動的解析、バッファオーバーランの危険性 | | `snprintf` | ロケール依存、フォーマットの動的解析 | | `sscanf` | ロケール依存、フォーマットの動的解析 | -| `atol` | ロケール依存、エラー報告の不足 | +| [`atol`](/reference/cstdlib/atoi_atol_atoll.md) | ロケール依存、エラー報告の不足 | | `strtol` | ロケール依存、先頭ホワイトスペースの無視、接頭辞(0x等)を考慮する | | `strstream` | ロケール依存、先頭ホワイトスペースの無視 | | `stringstream` | ロケール依存、先頭ホワイトスペースの無視、動的メモリ確保 | From 19b6ba2acab7b5b56c07f9c92dcd60f48b7bd7f2 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sat, 5 Jul 2025 22:08:12 +0900 Subject: [PATCH 1979/3948] cstdlib/atoi..:add version --- reference/cstdlib/atoi_atol_atoll.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/reference/cstdlib/atoi_atol_atoll.md b/reference/cstdlib/atoi_atol_atoll.md index 7d31e88ec5..5cf9fef000 100644 --- a/reference/cstdlib/atoi_atol_atoll.md +++ b/reference/cstdlib/atoi_atol_atoll.md @@ -60,6 +60,14 @@ int main(void) -2147483648 ``` +## 処理系 +### 処理系 +- Clang: ? +- GCC: 13[mark verified] +- ICC: ? +- Visual C++ + + ## 参照 - [7.22.1.2 The atoi, atol, and atoll functions](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3220.pdf) - [7.22.1.2 The atoi, atol, and atoll functions (p: 249)](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2310.pdf) From f7d4f261f6a54c5c2fbc2116d2ebfc1c978a6805 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sat, 5 Jul 2025 22:20:46 +0900 Subject: [PATCH 1980/3948] =?UTF-8?q?cstdlib/atoi..:=E3=83=90=E3=83=BC?= =?UTF-8?q?=E3=82=B8=E3=83=A7=E3=83=B3=E8=A1=A8=E8=A8=98=E3=81=AB=E5=A4=89?= =?UTF-8?q?=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/atoi_atol_atoll.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdlib/atoi_atol_atoll.md b/reference/cstdlib/atoi_atol_atoll.md index 5cf9fef000..638bfd6ac8 100644 --- a/reference/cstdlib/atoi_atol_atoll.md +++ b/reference/cstdlib/atoi_atol_atoll.md @@ -60,7 +60,7 @@ int main(void) -2147483648 ``` -## 処理系 +## バージョン ### 処理系 - Clang: ? - GCC: 13[mark verified] From 1db6393a0461ea27e688d1858e127d2a8937c8ad Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sat, 5 Jul 2025 22:32:44 +0900 Subject: [PATCH 1981/3948] add new page `cstdlib/atof` --- reference/cstdlib/atof.md | 75 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 reference/cstdlib/atof.md diff --git a/reference/cstdlib/atof.md b/reference/cstdlib/atof.md new file mode 100644 index 0000000000..5d0b3ee9df --- /dev/null +++ b/reference/cstdlib/atof.md @@ -0,0 +1,75 @@ +# atof +* cstdlib[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +double atof( const char* str ); +``` + +## 概要 + +`str`を`float`に変換する。 + +## 変換方法 + +- 空白文字から始まる場合、最初の非空白文字から変換する。 + +- `0x` または `0X` の場合、空白でない16進数として処理する。 + +- `e`または`E`は、それより前を基数、その後ろを指数として処理する。 + +- \+ 、\-は変換後の符号に適用される。 + +- `INF`または`INFINITY`(大小文字区別せず)は`inf`を返す。 + +- NAN(大小文字区別せず)はそれ以前の数値を返す。もし以前の数値がないなら、`nan`を返す。 + + +## 返り値 + +変換可能ならば変換後の数値。 + +変換後の数値が`float`の範囲外なら、その動作は未定義である。 + +変換不能なら`0.0`を返す。 + + +## 例 + +```cpp example +#include +#include + +int main() +{ + std::cout << std::atof("0.0000000123") << '\n' + << std::atof("0.012") << '\n' + << std::atof("15e16") << '\n' + << std::atof("-0x1afp-2") << '\n' + << std::atof("inF") << '\n' + << std::atof("12Nan23") << '\n' + << std::atof("NAN") << '\n' + << std::atof("invalid") << '\n'; +} +``` + +## バージョン +### 処理系 +- Clang: ? +- GCC: 13[mark verified] +- ICC: ? +- Visual C++ + +## 出力結果 + +``` +1.23e-08 +0.012 +1.5e+17 +-107.75 +inf +12 +nan +0 +``` From b6b5fd6986501a4fb9db9841c6e8397d176325c1 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sat, 5 Jul 2025 22:33:39 +0900 Subject: [PATCH 1982/3948] cstdlib.md:add path to atof.md --- reference/cstdlib.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdlib.md b/reference/cstdlib.md index 04aaeb17e6..6fe0158a1a 100644 --- a/reference/cstdlib.md +++ b/reference/cstdlib.md @@ -16,7 +16,7 @@ | [`atoi`](cstdlib/atoi_atol_atoll.md) | 文字列を`int`型に変換する (function) | | | [`atol`](cstdlib/atoi_atol_atoll.md) | 文字列を`long`型に変換する (function) | | | [`atoll`](cstdlib/atoi_atol_atoll.md) | 文字列を`long long`型に変換する (function) | C++11 | -| `atof` | 文字列を`double`型に変換する (function) | | +| [`atof`](cstdlib/atof.md) | 文字列を`double`型に変換する (function) | | | `strtol` | 文字列を、基数を指定して`long`型に変換する (function) | | | `strtoll` | 文字列を、基数を指定して`long long`型に変換する (function) | C++11 | | `strtoul` | 文字列を、基数を指定して`unsigned long`型に変換する (function) | | From e10856ace4748d2c3c50081d5395093fe24ba701 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sat, 5 Jul 2025 22:40:22 +0900 Subject: [PATCH 1983/3948] =?UTF-8?q?cstdlib/atoi..:=E9=96=A2=E9=80=A3?= =?UTF-8?q?=E9=A0=85=E7=9B=AE=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/atoi_atol_atoll.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/reference/cstdlib/atoi_atol_atoll.md b/reference/cstdlib/atoi_atol_atoll.md index 638bfd6ac8..fa38b9d6d8 100644 --- a/reference/cstdlib/atoi_atol_atoll.md +++ b/reference/cstdlib/atoi_atol_atoll.md @@ -65,8 +65,14 @@ int main(void) - Clang: ? - GCC: 13[mark verified] - ICC: ? -- Visual C++ +- Visual C++ ? +## 関連項目 +- [`stoi`](/reference/string/stoi.md) +- [`stol`](/reference/string/stol.md) +- [`stoll`](/reference/string/stoll.md) + +それぞれ`std::string` および `std::wstring` に対応させたものと見なせる。 ## 参照 - [7.22.1.2 The atoi, atol, and atoll functions](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3220.pdf) From 8c6d8f1b789e790ad0be54574c6f093c94cedafd Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sat, 5 Jul 2025 22:41:47 +0900 Subject: [PATCH 1984/3948] =?UTF-8?q?=E4=B8=8D=E8=A6=81=E3=82=B9=E3=83=9A?= =?UTF-8?q?=E3=83=BC=E3=82=B9=E3=81=AE=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/atof.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/reference/cstdlib/atof.md b/reference/cstdlib/atof.md index 5d0b3ee9df..d24063fdf0 100644 --- a/reference/cstdlib/atof.md +++ b/reference/cstdlib/atof.md @@ -14,15 +14,10 @@ double atof( const char* str ); ## 変換方法 - 空白文字から始まる場合、最初の非空白文字から変換する。 - - `0x` または `0X` の場合、空白でない16進数として処理する。 - - `e`または`E`は、それより前を基数、その後ろを指数として処理する。 - - \+ 、\-は変換後の符号に適用される。 - - `INF`または`INFINITY`(大小文字区別せず)は`inf`を返す。 - - NAN(大小文字区別せず)はそれ以前の数値を返す。もし以前の数値がないなら、`nan`を返す。 From 5d24dd2270f135533b37459dccb29642007e68af Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sun, 6 Jul 2025 01:39:11 +0900 Subject: [PATCH 1985/3948] Update getenv.md --- reference/cstdlib/getenv.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdlib/getenv.md b/reference/cstdlib/getenv.md index 3d0f60cf47..32b64c2fb8 100644 --- a/reference/cstdlib/getenv.md +++ b/reference/cstdlib/getenv.md @@ -19,7 +19,7 @@ char* getenv( const char* env_var ); C++11以前は、他の関数でホスト環境が変更されなければ、この関数はスレッドセーフである。(他のスレッドで呼び出された場合でも) -C++11以降では、`getenv`が返す文字列を変更すると未定義動作となる。 +C++11以降では、`getenv`が返す文字列を変更したときの動作は未定義である。 ## 例 ```cpp example From 9529b813064a4b61926bc9e2a69eecd48c4d8738 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sun, 6 Jul 2025 16:11:54 +0900 Subject: [PATCH 1986/3948] new page `cstdlib/srand` --- reference/cstdlib/srand.md | 50 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 reference/cstdlib/srand.md diff --git a/reference/cstdlib/srand.md b/reference/cstdlib/srand.md new file mode 100644 index 0000000000..24e83aa31b --- /dev/null +++ b/reference/cstdlib/srand.md @@ -0,0 +1,50 @@ +# srand +* cstdlib[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +void srand( unsigned seed ); +``` + +## 概要 + +`std::rand()`関数の疑似乱数生成器にシード値を渡す。 + +この関数が呼ばれる前に`std::rand()`が呼ばれた場合、`srand(1)`をシード値として実行される。 + +また、`stand()`が同様の数値、つまりシード値が同じなら、`std::rand()`は同様の数値を返す。 + +## 備考 +この関数はスレッドセーフではない。 + +一般的には、`srand()`を一度呼び出し、シード値を定義したあとに、再シードするべきではない。 + +また、`std::time`は`std::time_t`を返し、整数型である保証はされていない。 + +ただし、多くの環境では、整数値として定義されている。 + +## 例 + +```cpp example +#include +#include +#include + +int main() +{ + std::srand(std::time(0)); // 現在時刻を疑似乱数のシード値とする。 + std::cout << std::rand() << '\n'; +} +``` + +## 出力例 +``` +1373858591 +``` + +## 関連項目 +- `rand`:疑似乱数を生成する +- `RAND_MAX`:`std::rand()`が返す最高値。 +- `time`:時刻を取得する +- [`time_t`](/reference/ctime/time_t.md):UNIX時間を表すための型。 From 9b4133cee544880cb7a43a3934dbd2c16d024fb5 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sun, 6 Jul 2025 16:12:08 +0900 Subject: [PATCH 1987/3948] fix some English description --- reference/filesystem/filesystem_error/code.md | 2 +- .../filesystem/filesystem_error/op_constructor.md | 12 ++++++------ reference/filesystem/filesystem_error/path1.md | 2 +- reference/filesystem/filesystem_error/path2.md | 2 +- reference/filesystem/filesystem_error/what.md | 4 ++-- reference/type_traits/is_final.md | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/reference/filesystem/filesystem_error/code.md b/reference/filesystem/filesystem_error/code.md index a17e7e6fa9..36fe507efb 100644 --- a/reference/filesystem/filesystem_error/code.md +++ b/reference/filesystem/filesystem_error/code.md @@ -29,7 +29,7 @@ int main() { try { throw fs::filesystem_error( - "can't copy file. source file doesn't found", + "can't copy file. source file isn't found", std::make_error_code(std::errc::no_such_file_or_directory) ); } diff --git a/reference/filesystem/filesystem_error/op_constructor.md b/reference/filesystem/filesystem_error/op_constructor.md index 4c46667980..52b5825db4 100644 --- a/reference/filesystem/filesystem_error/op_constructor.md +++ b/reference/filesystem/filesystem_error/op_constructor.md @@ -64,7 +64,7 @@ int main() // (1) try { throw fs::filesystem_error( - "can't copy file. source file doesn't found", + "can't copy file. source file isn't found", std::make_error_code(std::errc::no_such_file_or_directory) ); } @@ -75,7 +75,7 @@ int main() // (2) try { throw fs::filesystem_error( - "can't copy file. source file doesn't found", + "can't copy file. source file isn't found", "a/b.txt", std::make_error_code(std::errc::no_such_file_or_directory) ); @@ -87,7 +87,7 @@ int main() // (3) try { throw fs::filesystem_error( - "can't copy file. source file doesn't found", + "can't copy file. source file isn't found", "a/from.txt", "b/to.txt", std::make_error_code(std::errc::no_such_file_or_directory) @@ -104,9 +104,9 @@ int main() ### 出力例 ``` -filesystem error: can't copy file. source file doesn't found: No such file or directory -filesystem error: can't copy file. source file doesn't found: No such file or directory [a/b.txt] -filesystem error: can't copy file. source file doesn't found: No such file or directory [a/from.txt] [b/to.txt] +filesystem error: can't copy file. source file isn't found: No such file or directory +filesystem error: can't copy file. source file isn't found: No such file or directory [a/b.txt] +filesystem error: can't copy file. source file isn't found: No such file or directory [a/from.txt] [b/to.txt] ``` ## バージョン diff --git a/reference/filesystem/filesystem_error/path1.md b/reference/filesystem/filesystem_error/path1.md index 197a5b6922..76a68f789d 100644 --- a/reference/filesystem/filesystem_error/path1.md +++ b/reference/filesystem/filesystem_error/path1.md @@ -29,7 +29,7 @@ int main() { try { throw fs::filesystem_error( - "can't copy file. source file doesn't found", + "can't copy file. source file isn't found", "a/from.txt", "b/to.txt", std::make_error_code(std::errc::no_such_file_or_directory) diff --git a/reference/filesystem/filesystem_error/path2.md b/reference/filesystem/filesystem_error/path2.md index d38e955aaf..4c1aa5cd98 100644 --- a/reference/filesystem/filesystem_error/path2.md +++ b/reference/filesystem/filesystem_error/path2.md @@ -29,7 +29,7 @@ int main() { try { throw fs::filesystem_error( - "can't copy file. source file doesn't found", + "can't copy file. source file isn't found", "a/from.txt", "b/to.txt", std::make_error_code(std::errc::no_such_file_or_directory) diff --git a/reference/filesystem/filesystem_error/what.md b/reference/filesystem/filesystem_error/what.md index ed147a12ee..9a5235cd3c 100644 --- a/reference/filesystem/filesystem_error/what.md +++ b/reference/filesystem/filesystem_error/what.md @@ -30,7 +30,7 @@ int main() { try { throw fs::filesystem_error( - "can't copy file. source file doesn't found", + "can't copy file. source file isn't found", std::make_error_code(std::errc::no_such_file_or_directory) ); } @@ -45,7 +45,7 @@ int main() ### 出力例 ``` -filesystem error: can't copy file. source file doesn't found: No such file or directory +filesystem error: can't copy file. source file isn't found: No such file or directory ``` ## バージョン diff --git a/reference/type_traits/is_final.md b/reference/type_traits/is_final.md index 0a5decc9e9..f8e4661857 100644 --- a/reference/type_traits/is_final.md +++ b/reference/type_traits/is_final.md @@ -39,9 +39,9 @@ namespace std { struct A {}; struct B final {}; -static_assert(std::is_final::value == false, "A is a not final class"); +static_assert(std::is_final::value == false, "A is not a final class"); static_assert(std::is_final::value == true, "B is a final class"); -static_assert(std::is_final::value == false, "int is a not final class"); +static_assert(std::is_final::value == false, "int is not a final class"); int main(){} ``` From d3e0d4373abf9627c1be81578e486aa4dfc8fc56 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sun, 6 Jul 2025 16:13:05 +0900 Subject: [PATCH 1988/3948] add path to srand() in cstdlib.md --- reference/cstdlib.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdlib.md b/reference/cstdlib.md index 6fe0158a1a..c71d0fe351 100644 --- a/reference/cstdlib.md +++ b/reference/cstdlib.md @@ -31,7 +31,7 @@ | 名前 | 説明 | 対応バージョン | |------------|------------------------------------------|-----------------| | `RAND_MAX` | `rand`関数によって生成される値域の最大値を表す整数値マクロ (macro) | C++14から非推奨 | -| `srand` | `rand`関数によって生成される擬似乱数のシードを指定する (function) | C++14から非推奨 | +| [`srand`](cstdlib/srand.md) | `rand`関数によって生成される擬似乱数のシードを指定する (function) | C++14から非推奨 | | `rand` | `srand`で指定されたシードを元に、擬似乱数を生成する (function) | C++14から非推奨 | From 5c0e2cccbd96c2f6d7cbfdec94e65f843474b357 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sun, 6 Jul 2025 16:36:28 +0900 Subject: [PATCH 1989/3948] new page `cstdlib/rand` and add path in `cstdlib.md` --- reference/cstdlib.md | 2 +- reference/cstdlib/rand.md | 46 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 reference/cstdlib/rand.md diff --git a/reference/cstdlib.md b/reference/cstdlib.md index c71d0fe351..d68ca232b3 100644 --- a/reference/cstdlib.md +++ b/reference/cstdlib.md @@ -32,7 +32,7 @@ |------------|------------------------------------------|-----------------| | `RAND_MAX` | `rand`関数によって生成される値域の最大値を表す整数値マクロ (macro) | C++14から非推奨 | | [`srand`](cstdlib/srand.md) | `rand`関数によって生成される擬似乱数のシードを指定する (function) | C++14から非推奨 | -| `rand` | `srand`で指定されたシードを元に、擬似乱数を生成する (function) | C++14から非推奨 | +| [`rand`](cstdlib/rand.md) | `srand`で指定されたシードを元に、擬似乱数を生成する (function) | C++14から非推奨 | ## メモリ管理 diff --git a/reference/cstdlib/rand.md b/reference/cstdlib/rand.md new file mode 100644 index 0000000000..e451faa516 --- /dev/null +++ b/reference/cstdlib/rand.md @@ -0,0 +1,46 @@ +# rand +* cstdlib[meta header] +* std[meta namespace] +* function[meta id-type] + +## 概要 +`0`から`RAND_MAX`までの値の疑似乱数を返す。 + +[`std::srand()`](srand.md)関数はこの関数の疑似乱数生成器で使用するシード値を決定する。 + +もし[`std::srand()`](srand.md)の前に、`std::rand()`が使用された場合、`srand(1)`として生成される。 + +シード値が同じなら、`std::rand()`も同じ値を返す。 + +また、標準ライブラリの複数の関数で`std::rand()`関数が呼び出される場合がある。 + +これは実装に依存している。 + +この関数がスレッドセーフであるかどうかも実装に依存している。 + +## 備考 +この関数の疑似乱数の品質は保証されていない。 + +より安全な乱数を使いたい場合は`random`ライブラリなどを使用したほうが良い。 + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::srand(std::time(0)); // 現在時刻を疑似乱数のシード値とする。 + std::cout << std::rand() << '\n'; +} +``` + +## 出力例 +``` +1373858591 +``` + +## 関連項目 +- [`srand()`](srand.md):この関数の疑似乱数生成器で使用するシード値を決定する。 +- [`RAND_MAX`]():この関数で返される疑似乱数の最大値。 From 31d07e72caa9e07774b300f841226f226a14e6e5 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sun, 6 Jul 2025 16:36:36 +0900 Subject: [PATCH 1990/3948] add pat to `ramd.md` --- reference/cstdlib/srand.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdlib/srand.md b/reference/cstdlib/srand.md index 24e83aa31b..726effe715 100644 --- a/reference/cstdlib/srand.md +++ b/reference/cstdlib/srand.md @@ -44,7 +44,7 @@ int main() ``` ## 関連項目 -- `rand`:疑似乱数を生成する +- [`rand`](rand.md):疑似乱数を生成する - `RAND_MAX`:`std::rand()`が返す最高値。 - `time`:時刻を取得する - [`time_t`](/reference/ctime/time_t.md):UNIX時間を表すための型。 From 129dc5c77180cc9f2f6379bd1ff3013fb2b39456 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sun, 6 Jul 2025 16:44:06 +0900 Subject: [PATCH 1991/3948] add path to `random`library --- reference/cstdlib/rand.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/cstdlib/rand.md b/reference/cstdlib/rand.md index e451faa516..057ed18d82 100644 --- a/reference/cstdlib/rand.md +++ b/reference/cstdlib/rand.md @@ -44,3 +44,4 @@ int main() ## 関連項目 - [`srand()`](srand.md):この関数の疑似乱数生成器で使用するシード値を決定する。 - [`RAND_MAX`]():この関数で返される疑似乱数の最大値。 +- [`random`](/reference/random.md):より安全な乱数生成ライブラリ。 From 29f79cc2b24a2586a4d935b6820c03c3b86b0159 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sun, 6 Jul 2025 16:46:44 +0900 Subject: [PATCH 1992/3948] delete `.nolink` in path to `cstdlib/rand` --- reference/random/linear_congruential_engine.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/random/linear_congruential_engine.md b/reference/random/linear_congruential_engine.md index 6011bbc5bc..3cfa8af5af 100644 --- a/reference/random/linear_congruential_engine.md +++ b/reference/random/linear_congruential_engine.md @@ -35,7 +35,7 @@ $$x_{n+1}= (a \times x_n + c) \bmod m$$ * 周期が短い(231-1) 省メモリで高速という点から、多くの言語で、標準の乱数生成法として使用されている。 -C言語から引き継いだ標準ライブラリ関数[`std::rand()`](/reference/cstdlib/rand.md.nolink)の乱数生成法は実装定義だが、多くの実装で線形合同法が使用されている。 +C言語から引き継いだ標準ライブラリ関数[`std::rand()`](/reference/cstdlib/rand.md)の乱数生成法は実装定義だが、多くの実装で線形合同法が使用されている。 しかし、メモリ使用量がそれほど問題にならないのであれば、メルセンヌ・ツイスター([`mt19937`](mt19937.md))の使用を検討した方がいいだろう。 From 76d4ce82c58a306d7bd36340270f547bd5bf29a1 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sun, 6 Jul 2025 16:58:42 +0900 Subject: [PATCH 1993/3948] new page `cstdlib/RAND_MAX` --- reference/cstdlib.md | 2 +- reference/cstdlib/rand_max.md | 38 +++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 reference/cstdlib/rand_max.md diff --git a/reference/cstdlib.md b/reference/cstdlib.md index d68ca232b3..6f5af064d1 100644 --- a/reference/cstdlib.md +++ b/reference/cstdlib.md @@ -30,7 +30,7 @@ | 名前 | 説明 | 対応バージョン | |------------|------------------------------------------|-----------------| -| `RAND_MAX` | `rand`関数によって生成される値域の最大値を表す整数値マクロ (macro) | C++14から非推奨 | +| [`RAND_MAX`](cstdlib/rand_max.md) | `rand`関数によって生成される値域の最大値を表す整数値マクロ (macro) | C++14から非推奨 | | [`srand`](cstdlib/srand.md) | `rand`関数によって生成される擬似乱数のシードを指定する (function) | C++14から非推奨 | | [`rand`](cstdlib/rand.md) | `srand`で指定されたシードを元に、擬似乱数を生成する (function) | C++14から非推奨 | diff --git a/reference/cstdlib/rand_max.md b/reference/cstdlib/rand_max.md new file mode 100644 index 0000000000..a78c39747e --- /dev/null +++ b/reference/cstdlib/rand_max.md @@ -0,0 +1,38 @@ +# RAND_MAX +* cstdlib[meta header] +* macro[meta id-type] + +```cpp +#define RAND_MAX /*implementation defined*/ +``` + +## 概要 +`std::rand()`関数で生成される疑似乱数の最大値を定義しているマクロ。 + +このマクロの値は実装依存である。 + +また、少なくとも`32767`以上であることは保証されている。 + +## 例 +```cpp example +#include +#include +#include +#include + +int main() +{ + // use current time as seed for random generator + std::srand(std::time(NULL)); + + std::cout << "RAND_MAX: " << RAND_MAX << '\n'; +} +``` + +## 出力例 +``` +RAND_MAX: 2147483647 +``` + +## 関連項目 +- [`rand()`](rand.md): 疑似乱数を生成する。 From ce18c980e315d55a4a1e3c9f54d96f8252078a13 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sun, 6 Jul 2025 16:58:56 +0900 Subject: [PATCH 1994/3948] add path to `RAND_MAX` --- reference/cstdlib/rand.md | 2 +- reference/cstdlib/srand.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/cstdlib/rand.md b/reference/cstdlib/rand.md index 057ed18d82..9b8ded0db9 100644 --- a/reference/cstdlib/rand.md +++ b/reference/cstdlib/rand.md @@ -43,5 +43,5 @@ int main() ## 関連項目 - [`srand()`](srand.md):この関数の疑似乱数生成器で使用するシード値を決定する。 -- [`RAND_MAX`]():この関数で返される疑似乱数の最大値。 +- [`RAND_MAX`](rand_max.md):この関数で返される疑似乱数の最大値。 - [`random`](/reference/random.md):より安全な乱数生成ライブラリ。 diff --git a/reference/cstdlib/srand.md b/reference/cstdlib/srand.md index 726effe715..6a0c1b3923 100644 --- a/reference/cstdlib/srand.md +++ b/reference/cstdlib/srand.md @@ -45,6 +45,6 @@ int main() ## 関連項目 - [`rand`](rand.md):疑似乱数を生成する -- `RAND_MAX`:`std::rand()`が返す最高値。 -- `time`:時刻を取得する +- [`RAND_MAX`](rand_max.md):`std::rand()`が返す最高値。 +- [`time`]():時刻を取得する - [`time_t`](/reference/ctime/time_t.md):UNIX時間を表すための型。 From e1b31f5923717d346622beaa27dbb48c755689cc Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sun, 6 Jul 2025 17:09:38 +0900 Subject: [PATCH 1995/3948] add .nolink in `time` path --- reference/cstdlib/srand.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdlib/srand.md b/reference/cstdlib/srand.md index 6a0c1b3923..2b3b0b6136 100644 --- a/reference/cstdlib/srand.md +++ b/reference/cstdlib/srand.md @@ -46,5 +46,5 @@ int main() ## 関連項目 - [`rand`](rand.md):疑似乱数を生成する - [`RAND_MAX`](rand_max.md):`std::rand()`が返す最高値。 -- [`time`]():時刻を取得する +- [`time`](/reference/ctime/time.md.nolink):時刻を取得する - [`time_t`](/reference/ctime/time_t.md):UNIX時間を表すための型。 From 9e68ff56de3400d7a359ae47ab5c920480a303fd Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sun, 6 Jul 2025 18:34:48 +0900 Subject: [PATCH 1996/3948] new page `cstdlib/calloc` --- reference/cstdlib/calloc.md | 65 +++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 reference/cstdlib/calloc.md diff --git a/reference/cstdlib/calloc.md b/reference/cstdlib/calloc.md new file mode 100644 index 0000000000..bf1f6f1b09 --- /dev/null +++ b/reference/cstdlib/calloc.md @@ -0,0 +1,65 @@ +# calloc +* cstdlib[meta header] +* std[meta namespace] +* function[meta id-type] + +## 概要 + +``` +void *calloc(size_t nmemb, size_t size); +``` + +任意の個数のオブジェクトへの配列用ポインタを動的に確保し、その領域を0で初期化する。 + +この関数で返されるポインタは、割当領域の先頭のポインタである。 + +領域が割り当てられない場合は、[`nullptr`](/lang/cpp11/nullptr.md)を返す。 + +割り当てられたオブジェクトの寿命は、このメモリが割り当てられてられた時から、[`free`](free.md.nolink)などで解放されるまでである。 + +この関数は、静的ストレージにはアクセスしない、スレッドセーフである。 + +## 備考 + +- `calloc`、`malloc`および `realloc`関数による連続的なメモリ確保によるメモリの割当の順序、連続性は、未定義である。 + +## 例 + +```cpp example +#include +#include + +int main(void) +{ + int* p1 = calloc(4, sizeof(int)); // 4個のint配列のポインタを確保、0二初期化 + int* p2 = calloc(1, sizeof(int[4])); // 上と同じ + int* p3 = calloc(4, sizeof *p3); // 上と同じ + + if (p2) + { + for (int n = 0; n < 4; ++n) + printf("p2[%d] == %d\n", n, p2[n]); + } + + free(p1); + free(p2); + free(p3); +} +``` + +## 出力例 +``` +p2[0] == 0 +p2[1] == 0 +p2[2] == 0 +p2[3] == 0 +``` + +## 関連項目 +- ["free"]("free.md.nolink"):確保されたメモリを解放する。 + + + +## 参照 +-[7.20.3 Memory management functions]("https://www.dii.uchile.cl/~daespino/files/Iso_C_1999_definition.pdf") + From a6b6cf76aa42a6ae3aa8bc9219318a0bc529d76d Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sun, 6 Jul 2025 18:35:32 +0900 Subject: [PATCH 1997/3948] add path to `calloc` in cstdlib.md --- reference/cstdlib.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdlib.md b/reference/cstdlib.md index 6f5af064d1..0086551ad2 100644 --- a/reference/cstdlib.md +++ b/reference/cstdlib.md @@ -41,7 +41,7 @@ |------|------|----------------| | `aligned_alloc` | 指定したアライメントでメモリを確保する (function) | C++17 | | `malloc` | メモリを確保する (function) | | -| `calloc` | メモリを確保し、領域をゼロ初期化する (function) | | +| [`calloc`](cstdlib/calloc.md) | メモリを確保し、領域をゼロ初期化する (function) | | | `realloc` | メモリを再確保する (function) | | | `free` | 確保したメモリを解放する (function) | | From 515cb5ae237fe2026b797c5e9c0aba3ba0897f35 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sun, 6 Jul 2025 18:36:55 +0900 Subject: [PATCH 1998/3948] add path to `calloc` --- ...cit_creation_of_objects_for_low-level_object_manipulation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md index c4fcb1c12d..72fcec09c3 100644 --- a/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md +++ b/lang/cpp20/implicit_creation_of_objects_for_low-level_object_manipulation.md @@ -181,7 +181,7 @@ C++においては、ポインタに対する演算(`+ -`など)はそのポ - [`std::allocator::allocate`](/reference/memory/allocator/allocate.md) - Cライブラリ関数 - `std::aligned_alloc` - - `std::calloc` + - [`std::calloc`](/reference/cstdlib/calloc.md) - `std::malloc` - `std::realloc` - `std::memcpy` From ff7570cbeacdbafcc1ee890a3e980afadb2f3a59 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sun, 6 Jul 2025 18:39:42 +0900 Subject: [PATCH 1999/3948] =?UTF-8?q?=E8=A8=98=E8=BF=B0=E3=81=AE=E5=A4=89?= =?UTF-8?q?=E6=9B=B4(Github=20actions)=E3=81=AB=E3=81=8B=E3=81=8B=E3=82=89?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=82=88=E3=81=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/calloc.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdlib/calloc.md b/reference/cstdlib/calloc.md index bf1f6f1b09..6f7e4ebb71 100644 --- a/reference/cstdlib/calloc.md +++ b/reference/cstdlib/calloc.md @@ -21,7 +21,7 @@ void *calloc(size_t nmemb, size_t size); ## 備考 -- `calloc`、`malloc`および `realloc`関数による連続的なメモリ確保によるメモリの割当の順序、連続性は、未定義である。 +- `calloc`、`malloc`および `realloc`関数による連続的なメモリ確保によるメモリの割当の順序、連続性は、未定義となる。 ## 例 From 1f5f23e4df6abe23f2cab4c234bd512fccca2756 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sun, 6 Jul 2025 18:42:48 +0900 Subject: [PATCH 2000/3948] =?UTF-8?q?=E8=A8=98=E8=BF=B0=E3=81=AE=E5=A4=89?= =?UTF-8?q?=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/calloc.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdlib/calloc.md b/reference/cstdlib/calloc.md index 6f7e4ebb71..4311b0abb0 100644 --- a/reference/cstdlib/calloc.md +++ b/reference/cstdlib/calloc.md @@ -21,7 +21,7 @@ void *calloc(size_t nmemb, size_t size); ## 備考 -- `calloc`、`malloc`および `realloc`関数による連続的なメモリ確保によるメモリの割当の順序、連続性は、未定義となる。 +- `calloc`、`malloc`および `realloc`関数による連続的なメモリ確保によるメモリの割当の順序、連続性は未定義。 ## 例 From 5b0f8cb49991895c03b89ae0fadabc120c66f7ab Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sun, 6 Jul 2025 18:49:48 +0900 Subject: [PATCH 2001/3948] change path --- reference/cstdlib/calloc.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/cstdlib/calloc.md b/reference/cstdlib/calloc.md index 4311b0abb0..caca072793 100644 --- a/reference/cstdlib/calloc.md +++ b/reference/cstdlib/calloc.md @@ -21,7 +21,7 @@ void *calloc(size_t nmemb, size_t size); ## 備考 -- `calloc`、`malloc`および `realloc`関数による連続的なメモリ確保によるメモリの割当の順序、連続性は未定義。 +- `calloc`、`malloc`および `realloc`関数による連続的なメモリ確保によるメモリの割当の順序、連続性は未定義である。 ## 例 @@ -56,7 +56,7 @@ p2[3] == 0 ``` ## 関連項目 -- ["free"]("free.md.nolink"):確保されたメモリを解放する。 +- `free`:確保されたメモリを解放する。 From 18a9e14d7d6d9ef912746ebf9cd73a3a448d2adc Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sun, 6 Jul 2025 18:49:56 +0900 Subject: [PATCH 2002/3948] add .nolink --- reference/cstdlib.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/cstdlib.md b/reference/cstdlib.md index 0086551ad2..cac5938b24 100644 --- a/reference/cstdlib.md +++ b/reference/cstdlib.md @@ -39,11 +39,11 @@ | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| `aligned_alloc` | 指定したアライメントでメモリを確保する (function) | C++17 | -| `malloc` | メモリを確保する (function) | | +| [`aligned_alloc`](cstdlib/aligned_alloc.md.nolink) | 指定したアライメントでメモリを確保する (function) | C++17 | +| [`malloc`](cstdlib/malloc.md.nolink) | メモリを確保する (function) | | | [`calloc`](cstdlib/calloc.md) | メモリを確保し、領域をゼロ初期化する (function) | | -| `realloc` | メモリを再確保する (function) | | -| `free` | 確保したメモリを解放する (function) | | +| [`realloc`](cstdlib/realloc.md.nolink) | メモリを再確保する (function) | | +| [`free`](cstdlib/free.md.nolink) | 確保したメモリを解放する (function) | | ## プログラムの開始と終了 From a182dacb239bb808caca85c6a84b0e397ac20ac1 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sun, 6 Jul 2025 18:53:39 +0900 Subject: [PATCH 2003/3948] add path to `cstdlib/aligined_alloc.md` --- reference/cstdlib.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdlib.md b/reference/cstdlib.md index cac5938b24..24dca132c2 100644 --- a/reference/cstdlib.md +++ b/reference/cstdlib.md @@ -39,7 +39,7 @@ | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`aligned_alloc`](cstdlib/aligned_alloc.md.nolink) | 指定したアライメントでメモリを確保する (function) | C++17 | +| [`aligned_alloc`](cstdlib/aligned_alloc.md) | 指定したアライメントでメモリを確保する (function) | C++17 | | [`malloc`](cstdlib/malloc.md.nolink) | メモリを確保する (function) | | | [`calloc`](cstdlib/calloc.md) | メモリを確保し、領域をゼロ初期化する (function) | | | [`realloc`](cstdlib/realloc.md.nolink) | メモリを再確保する (function) | | From f93c17f50efd0ffe95564cdfcf377f4dd1880f0e Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sun, 6 Jul 2025 22:20:13 +0000 Subject: [PATCH 2004/3948] Update atoi_atol_atoll.md --- reference/cstdlib/atoi_atol_atoll.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdlib/atoi_atol_atoll.md b/reference/cstdlib/atoi_atol_atoll.md index fa38b9d6d8..15a4246c09 100644 --- a/reference/cstdlib/atoi_atol_atoll.md +++ b/reference/cstdlib/atoi_atol_atoll.md @@ -11,7 +11,7 @@ long long atoll( const char* str ); ## 概要 -`str`を`int` `long` `long long`に変換する。 +`str`を`int` 、`long` 、`long long`に変換する。 基数は常に10である。 From 850a54f6cb0095a99dd38389c00b8d18fe2d8ac1 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 10:26:33 +0900 Subject: [PATCH 2005/3948] added color for eof --- reference/cstdio/eof.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reference/cstdio/eof.md b/reference/cstdio/eof.md index b4b8db4cf4..a6b3d269cd 100644 --- a/reference/cstdio/eof.md +++ b/reference/cstdio/eof.md @@ -25,6 +25,10 @@ int main() { } ``` +* EOF[color ff0000] +* getchar[link /reference/cstdio/getchar.md.nolink] +* putchar[link /reference/cstdio/putchar.md.nolink] +* puts[link /reference/cstdio/puts.md.nolink] ### 入力 ``` From fb36b7c63cd9baa0125d36272d076607e4425388 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 10:29:11 +0900 Subject: [PATCH 2006/3948] fixed failing test --- reference/cstdlib/calloc.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdlib/calloc.md b/reference/cstdlib/calloc.md index caca072793..229fa532d1 100644 --- a/reference/cstdlib/calloc.md +++ b/reference/cstdlib/calloc.md @@ -21,7 +21,7 @@ void *calloc(size_t nmemb, size_t size); ## 備考 -- `calloc`、`malloc`および `realloc`関数による連続的なメモリ確保によるメモリの割当の順序、連続性は未定義である。 +- `calloc`、`malloc`および `realloc`関数による連続的なメモリ確保によるメモリの割当の順序、連続性は不定である。 ## 例 From aabf3753ecbae0aa3ef524ac2b4a32e7cf2a90f9 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 10:32:48 +0900 Subject: [PATCH 2007/3948] added link --- reference/algorithm/adjacent_find.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reference/algorithm/adjacent_find.md b/reference/algorithm/adjacent_find.md index fe20630d87..f49c763d39 100644 --- a/reference/algorithm/adjacent_find.md +++ b/reference/algorithm/adjacent_find.md @@ -95,6 +95,10 @@ int main() { } ``` * adjacent_find[color ff0000] +* std::vector[link /reference/vector/vector.md] +* std::cout[link /reference/iostream/cout.md] +* std::distance[link /reference/iterator/distance.md] +* std::boolalpha[link /reference/ios/boolalpha.md] ### 出力 ``` From b23f7fd21372bfccfb25c351c655f995ed0fae76 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 11:02:21 +0900 Subject: [PATCH 2008/3948] defined all functions for algorithm header at GLOBAL_QUALIFY_LIST.txt --- GLOBAL_QUALIFY_LIST.txt | 197 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 196 insertions(+), 1 deletion(-) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 0c106e8455..8b4cf073c6 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -8,11 +8,206 @@ * synth-three-way[link /reference/exposition-only/synth-three-way-result.md] * [link /reference/algorithm.md] * ExecutionPolicy[link /reference/execution/execution/execution_policy.md] - * ranges::find_if_not[link /reference/algorithm/ranges_find_if_not.md] + * std::adjacent_find[link /reference/algorithm/adjacent_find.md] + * std::all_of[link /reference/algorithm/all_of.md] + * std::any_of[link /reference/algorithm/any_of.md] + * std::binary_search[link /reference/algorithm/binary_search.md] + * std::clamp[link /reference/algorithm/clamp.md] * std::copy[link /reference/algorithm/copy.md] + * std::copy_backward[link /reference/algorithm/copy_backward.md] + * std::copy_if[link /reference/algorithm/copy_if.md] * std::copy_n[link /reference/algorithm/copy_n.md] + * std::count[link /reference/algorithm/count.md] + * std::count_if[link /reference/algorithm/count_if.md] + * std::equal[link /reference/algorithm/equal.md] + * std::equal_range[link /reference/algorithm/equal_range.md] + * std::fill[link /reference/algorithm/fill.md] + * std::fill_n[link /reference/algorithm/fill_n.md] + * std::find[link /reference/algorithm/find.md] + * std::find_end[link /reference/algorithm/find_end.md] + * std::find_first_of[link /reference/algorithm/find_first_of.md] + * std::find_if[link /reference/algorithm/find_if.md] + * std::find_if_not[link /reference/algorithm/find_if_not.md] * std::for_each[link /reference/algorithm/for_each.md] + * std::for_each_n[link /reference/algorithm/for_each_n.md] + * std::generate[link /reference/algorithm/generate.md] + * std::generate_n[link /reference/algorithm/generate_n.md] + * std::includes[link /reference/algorithm/includes.md] + * std::inplace_merge[link /reference/algorithm/inplace_merge.md] + * std::is_heap[link /reference/algorithm/is_heap.md] + * std::is_heap_until[link /reference/algorithm/is_heap_until.md] + * std::is_partitioned[link /reference/algorithm/is_partitioned.md] + * std::is_permutation[link /reference/algorithm/is_permutation.md] + * std::is_sorted[link /reference/algorithm/is_sorted.md] + * std::is_sorted_until[link /reference/algorithm/is_sorted_until.md] + * std::iter_swap[link /reference/algorithm/iter_swap.md] + * std::lexicographical_compare[link /reference/algorithm/lexicographical_compare.md] + * std::lexicographical_compare_three_way[link /reference/algorithm/lexicographical_compare_three_way.md] + * std::lower_bound[link /reference/algorithm/lower_bound.md] + * std::make_heap[link /reference/algorithm/make_heap.md] + * std::max[link /reference/algorithm/max.md] + * std::max_element[link /reference/algorithm/max_element.md] + * std::merge[link /reference/algorithm/merge.md] + * std::min[link /reference/algorithm/min.md] + * std::min_element[link /reference/algorithm/min_element.md] + * std::minmax[link /reference/algorithm/minmax.md] + * std::minmax_element[link /reference/algorithm/minmax_element.md] + * std::mismatch[link /reference/algorithm/mismatch.md] + * std::move[link /reference/algorithm/move.md] + * std::move_backward[link /reference/algorithm/move_backward.md] + * std::next_permutation[link /reference/algorithm/next_permutation.md] + * std::none_of[link /reference/algorithm/none_of.md] + * std::nth_element[link /reference/algorithm/nth_element.md] + * std::partial_sort[link /reference/algorithm/partial_sort.md] + * std::partial_sort_copy[link /reference/algorithm/partial_sort_copy.md] + * std::partition[link /reference/algorithm/partition.md] + * std::partition_copy[link /reference/algorithm/partition_copy.md] + * std::partition_point[link /reference/algorithm/partition_point.md] + * std::pop_heap[link /reference/algorithm/pop_heap.md] + * std::prev_permutation[link /reference/algorithm/prev_permutation.md] + * std::push_heap[link /reference/algorithm/push_heap.md] + * std::random_shuffle[link /reference/algorithm/random_shuffle.md] + * std::remove[link /reference/algorithm/remove.md] + * std::remove_copy[link /reference/algorithm/remove_copy.md] + * std::remove_copy_if[link /reference/algorithm/remove_copy_if.md] + * std::remove_if[link /reference/algorithm/remove_if.md] + * std::replace[link /reference/algorithm/replace.md] + * std::replace_copy[link /reference/algorithm/replace_copy.md] + * std::replace_copy_if[link /reference/algorithm/replace_copy_if.md] + * std::replace_if[link /reference/algorithm/replace_if.md] + * std::reverse[link /reference/algorithm/reverse.md] + * std::reverse_copy[link /reference/algorithm/reverse_copy.md] + * std::rotate[link /reference/algorithm/rotate.md] + * std::rotate_copy[link /reference/algorithm/rotate_copy.md] + * std::sample[link /reference/algorithm/sample.md] + * std::search[link /reference/algorithm/search.md] + * std::search_n[link /reference/algorithm/search_n.md] + * std::set_difference[link /reference/algorithm/set_difference.md] + * std::set_intersection[link /reference/algorithm/set_intersection.md] + * std::set_symmetric_difference[link /reference/algorithm/set_symmetric_difference.md] + * std::set_union[link /reference/algorithm/set_union.md] + * std::shift_left[link /reference/algorithm/shift_left.md] + * std::shift_right[link /reference/algorithm/shift_right.md] + * std::shuffle[link /reference/algorithm/shuffle.md] * std::sort[link /reference/algorithm/sort.md] + * std::sort_heap[link /reference/algorithm/sort_heap.md] + * std::stable_partition[link /reference/algorithm/stable_partition.md] + * std::stable_sort[link /reference/algorithm/stable_sort.md] + * std::swap_ranges[link /reference/algorithm/swap_ranges.md] + * std::transform[link /reference/algorithm/transform.md] + * std::unique[link /reference/algorithm/unique.md] + * std::unique_copy[link /reference/algorithm/unique_copy.md] + * std::upper_bound[link /reference/algorithm/upper_bound.md] + * ranges::adjacent_find[link /reference/algorithm/ranges_adjacent_find.md] + * ranges::all_of[link /reference/algorithm/ranges_all_of.md] + * ranges::any_of[link /reference/algorithm/ranges_any_of.md] + * ranges::binary_search[link /reference/algorithm/ranges_binary_search.md] + * ranges::clamp[link /reference/algorithm/ranges_clamp.md] + * ranges::contains[link /reference/algorithm/ranges_contains.md] + * ranges::contains_subrange[link /reference/algorithm/ranges_contains_subrange.md] + * ranges::copy[link /reference/algorithm/ranges_copy.md] + * ranges::copy_backward[link /reference/algorithm/ranges_copy_backward.md] + * ranges::copy_if[link /reference/algorithm/ranges_copy_if.md] + * ranges::copy_n[link /reference/algorithm/ranges_copy_n.md] + * ranges::count[link /reference/algorithm/ranges_count.md] + * ranges::count_if[link /reference/algorithm/ranges_count_if.md] + * ranges::ends_with[link /reference/algorithm/ranges_ends_with.md] + * ranges::equal[link /reference/algorithm/ranges_equal.md] + * ranges::equal_range[link /reference/algorithm/ranges_equal_range.md] + * ranges::fill[link /reference/algorithm/ranges_fill.md] + * ranges::fill_n[link /reference/algorithm/ranges_fill_n.md] + * ranges::find[link /reference/algorithm/ranges_find.md] + * ranges::find_end[link /reference/algorithm/ranges_find_end.md] + * ranges::find_first_of[link /reference/algorithm/ranges_find_first_of.md] + * ranges::find_if[link /reference/algorithm/ranges_find_if.md] + * ranges::find_if_not[link /reference/algorithm/ranges_find_if_not.md] + * ranges::find_last[link /reference/algorithm/ranges_find_last.md] + * ranges::find_last_if[link /reference/algorithm/ranges_find_last_if.md] + * ranges::find_last_if_not[link /reference/algorithm/ranges_find_last_if_not.md] + * ranges::fold_left[link /reference/algorithm/ranges_fold_left.md] + * ranges::fold_left_first[link /reference/algorithm/ranges_fold_left_first.md] + * ranges::fold_left_first_with_iter[link /reference/algorithm/ranges_fold_left_first_with_iter.md] + * ranges::fold_left_with_iter[link /reference/algorithm/ranges_fold_left_with_iter.md] + * ranges::fold_right[link /reference/algorithm/ranges_fold_right.md] + * ranges::fold_right_last[link /reference/algorithm/ranges_fold_right_last.md] + * ranges::for_each[link /reference/algorithm/ranges_for_each.md] + * ranges::for_each_n[link /reference/algorithm/ranges_for_each_n.md] + * ranges::generate[link /reference/algorithm/ranges_generate.md] + * ranges::generate_n[link /reference/algorithm/ranges_generate_n.md] + * ranges::in_found_result[link /reference/algorithm/ranges_in_found_result.md] + * ranges::in_fun_result[link /reference/algorithm/ranges_in_fun_result.md] + * ranges::in_in_out_result[link /reference/algorithm/ranges_in_in_out_result.md] + * ranges::in_in_result[link /reference/algorithm/ranges_in_in_result.md] + * ranges::in_out_out_result[link /reference/algorithm/ranges_in_out_out_result.md] + * ranges::in_out_result[link /reference/algorithm/ranges_in_out_result.md] + * ranges::in_value_result[link /reference/algorithm/ranges_in_value_result.md] + * ranges::includes[link /reference/algorithm/ranges_includes.md] + * ranges::inplace_merge[link /reference/algorithm/ranges_inplace_merge.md] + * ranges::is_heap[link /reference/algorithm/ranges_is_heap.md] + * ranges::is_heap_until[link /reference/algorithm/ranges_is_heap_until.md] + * ranges::is_partitioned[link /reference/algorithm/ranges_is_partitioned.md] + * ranges::is_permutation[link /reference/algorithm/ranges_is_permutation.md] + * ranges::is_sorted[link /reference/algorithm/ranges_is_sorted.md] + * ranges::is_sorted_until[link /reference/algorithm/ranges_is_sorted_until.md] + * ranges::lexicographical_compare[link /reference/algorithm/ranges_lexicographical_compare.md] + * ranges::lower_bound[link /reference/algorithm/ranges_lower_bound.md] + * ranges::make_heap[link /reference/algorithm/ranges_make_heap.md] + * ranges::max[link /reference/algorithm/ranges_max.md] + * ranges::max_element[link /reference/algorithm/ranges_max_element.md] + * ranges::merge[link /reference/algorithm/ranges_merge.md] + * ranges::min[link /reference/algorithm/ranges_min.md] + * ranges::min_element[link /reference/algorithm/ranges_min_element.md] + * ranges::min_max_result[link /reference/algorithm/ranges_min_max_result.md] + * ranges::minmax[link /reference/algorithm/ranges_minmax.md] + * ranges::minmax_element[link /reference/algorithm/ranges_minmax_element.md] + * ranges::mismatch[link /reference/algorithm/ranges_mismatch.md] + * ranges::move[link /reference/algorithm/ranges_move.md] + * ranges::move_backward[link /reference/algorithm/ranges_move_backward.md] + * ranges::next_permutation[link /reference/algorithm/ranges_next_permutation.md] + * ranges::none_of[link /reference/algorithm/ranges_none_of.md] + * ranges::nth_element[link /reference/algorithm/ranges_nth_element.md] + * ranges::out_value_result[link /reference/algorithm/ranges_out_value_result.md] + * ranges::partial_sort[link /reference/algorithm/ranges_partial_sort.md] + * ranges::partial_sort_copy[link /reference/algorithm/ranges_partial_sort_copy.md] + * ranges::partition[link /reference/algorithm/ranges_partition.md] + * ranges::partition_copy[link /reference/algorithm/ranges_partition_copy.md] + * ranges::partition_point[link /reference/algorithm/ranges_partition_point.md] + * ranges::pop_heap[link /reference/algorithm/ranges_pop_heap.md] + * ranges::prev_permutation[link /reference/algorithm/ranges_prev_permutation.md] + * ranges::push_heap[link /reference/algorithm/ranges_push_heap.md] + * ranges::remove[link /reference/algorithm/ranges_remove.md] + * ranges::remove_copy[link /reference/algorithm/ranges_remove_copy.md] + * ranges::remove_copy_if[link /reference/algorithm/ranges_remove_copy_if.md] + * ranges::remove_if[link /reference/algorithm/ranges_remove_if.md] + * ranges::replace[link /reference/algorithm/ranges_replace.md] + * ranges::replace_copy[link /reference/algorithm/ranges_replace_copy.md] + * ranges::replace_copy_if[link /reference/algorithm/ranges_replace_copy_if.md] + * ranges::replace_if[link /reference/algorithm/ranges_replace_if.md] + * ranges::reverse[link /reference/algorithm/ranges_reverse.md] + * ranges::reverse_copy[link /reference/algorithm/ranges_reverse_copy.md] + * ranges::rotate[link /reference/algorithm/ranges_rotate.md] + * ranges::rotate_copy[link /reference/algorithm/ranges_rotate_copy.md] + * ranges::sample[link /reference/algorithm/ranges_sample.md] + * ranges::search[link /reference/algorithm/ranges_search.md] + * ranges::search_n[link /reference/algorithm/ranges_search_n.md] + * ranges::set_difference[link /reference/algorithm/ranges_set_difference.md] + * ranges::set_intersection[link /reference/algorithm/ranges_set_intersection.md] + * ranges::set_symmetric_difference[link /reference/algorithm/ranges_set_symmetric_difference.md] + * ranges::set_union[link /reference/algorithm/ranges_set_union.md] + * ranges::shift_left[link /reference/algorithm/ranges_shift_left.md] + * ranges::shift_right[link /reference/algorithm/ranges_shift_right.md] + * ranges::shuffle[link /reference/algorithm/ranges_shuffle.md] + * ranges::sort[link /reference/algorithm/ranges_sort.md] + * ranges::sort_heap[link /reference/algorithm/ranges_sort_heap.md] + * ranges::stable_partition[link /reference/algorithm/ranges_stable_partition.md] + * ranges::stable_sort[link /reference/algorithm/ranges_stable_sort.md] + * ranges::starts_with[link /reference/algorithm/ranges_starts_with.md] + * ranges::swap_ranges[link /reference/algorithm/ranges_swap_ranges.md] + * ranges::transform[link /reference/algorithm/ranges_transform.md] + * ranges::unique[link /reference/algorithm/ranges_unique.md] + * ranges::unique_copy[link /reference/algorithm/ranges_unique_copy.md] + * ranges::upper_bound[link /reference/algorithm/ranges_upper_bound.md] + * [link /reference/any.md] * [link /reference/array.md] * std::array[link /reference/array/array.md] From 2b4608d5ceaebcf22b57e56c5debca1b84e39e0f Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 11:08:55 +0900 Subject: [PATCH 2009/3948] added functions for any header at GLOBAL_QUALIFY_LIST.txt --- GLOBAL_QUALIFY_LIST.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 8b4cf073c6..6e1f9d0848 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -209,6 +209,10 @@ * ranges::upper_bound[link /reference/algorithm/ranges_upper_bound.md] * [link /reference/any.md] + * std::any[link /reference/algorithm/any.md] + * std::any_cast[link /reference/algorithm/any_cast.md] + * std::bad_any_cast[link /reference/algorithm/bad_any_cast.md] + * std::make_any[link /reference/algorithm/make_any.md] * [link /reference/array.md] * std::array[link /reference/array/array.md] * [link /reference/atomic.md] From a8b880894ab46d7c60d6998059767e470feee59c Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 11:10:22 +0900 Subject: [PATCH 2010/3948] defined items for at GLOBAL_QUALIFY_LIST --- GLOBAL_QUALIFY_LIST.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 6e1f9d0848..9ec7729e82 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -214,7 +214,9 @@ * std::bad_any_cast[link /reference/algorithm/bad_any_cast.md] * std::make_any[link /reference/algorithm/make_any.md] * [link /reference/array.md] - * std::array[link /reference/array/array.md] + * std::array[link /reference/algorithm/array.md] + * std::to_array[link /reference/algorithm/to_array.md] + * [link /reference/atomic.md] * std::atomic[link /reference/atomic/atomic.md] * std::memory_order_acq_rel[link /reference/atomic/memory_order.md] From 53c2993f68c1c8476afd3662126b7ab10b2fb2c9 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 11:14:16 +0900 Subject: [PATCH 2011/3948] defined items in atomic at GLOBAL_QUALIFY_LIST --- GLOBAL_QUALIFY_LIST.txt | 48 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 9ec7729e82..0b71565774 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -218,7 +218,53 @@ * std::to_array[link /reference/algorithm/to_array.md] * [link /reference/atomic.md] - * std::atomic[link /reference/atomic/atomic.md] + * std::atomic[link /reference/algorithm/atomic.md] + * std::atomic_compare_exchange_strong[link /reference/algorithm/atomic_compare_exchange_strong.md] + * std::atomic_compare_exchange_strong_explicit[link /reference/algorithm/atomic_compare_exchange_strong_explicit.md] + * std::atomic_compare_exchange_weak[link /reference/algorithm/atomic_compare_exchange_weak.md] + * std::atomic_compare_exchange_weak_explicit[link /reference/algorithm/atomic_compare_exchange_weak_explicit.md] + * std::atomic_exchange[link /reference/algorithm/atomic_exchange.md] + * std::atomic_exchange_explicit[link /reference/algorithm/atomic_exchange_explicit.md] + * std::atomic_fetch_add[link /reference/algorithm/atomic_fetch_add.md] + * std::atomic_fetch_add_explicit[link /reference/algorithm/atomic_fetch_add_explicit.md] + * std::atomic_fetch_and[link /reference/algorithm/atomic_fetch_and.md] + * std::atomic_fetch_and_explicit[link /reference/algorithm/atomic_fetch_and_explicit.md] + * std::atomic_fetch_max[link /reference/algorithm/atomic_fetch_max.md] + * std::atomic_fetch_max_explicit[link /reference/algorithm/atomic_fetch_max_explicit.md] + * std::atomic_fetch_min[link /reference/algorithm/atomic_fetch_min.md] + * std::atomic_fetch_min_explicit[link /reference/algorithm/atomic_fetch_min_explicit.md] + * std::atomic_fetch_or[link /reference/algorithm/atomic_fetch_or.md] + * std::atomic_fetch_or_explicit[link /reference/algorithm/atomic_fetch_or_explicit.md] + * std::atomic_fetch_sub[link /reference/algorithm/atomic_fetch_sub.md] + * std::atomic_fetch_sub_explicit[link /reference/algorithm/atomic_fetch_sub_explicit.md] + * std::atomic_fetch_xor[link /reference/algorithm/atomic_fetch_xor.md] + * std::atomic_fetch_xor_explicit[link /reference/algorithm/atomic_fetch_xor_explicit.md] + * std::atomic_flag[link /reference/algorithm/atomic_flag.md] + * std::atomic_flag_clear[link /reference/algorithm/atomic_flag_clear.md] + * std::atomic_flag_clear_explicit[link /reference/algorithm/atomic_flag_clear_explicit.md] + * std::atomic_flag_init[link /reference/algorithm/atomic_flag_init.md] + * std::atomic_flag_notify_all[link /reference/algorithm/atomic_flag_notify_all.md] + * std::atomic_flag_notify_one[link /reference/algorithm/atomic_flag_notify_one.md] + * std::atomic_flag_test[link /reference/algorithm/atomic_flag_test.md] + * std::atomic_flag_test_and_set[link /reference/algorithm/atomic_flag_test_and_set.md] + * std::atomic_flag_test_and_set_explicit[link /reference/algorithm/atomic_flag_test_and_set_explicit.md] + * std::atomic_flag_test_explicit[link /reference/algorithm/atomic_flag_test_explicit.md] + * std::atomic_flag_wait[link /reference/algorithm/atomic_flag_wait.md] + * std::atomic_flag_wait_explicit[link /reference/algorithm/atomic_flag_wait_explicit.md] + * std::atomic_init[link /reference/algorithm/atomic_init.md] + * std::atomic_is_lock_free[link /reference/algorithm/atomic_is_lock_free.md] + * std::atomic_load[link /reference/algorithm/atomic_load.md] + * std::atomic_load_explicit[link /reference/algorithm/atomic_load_explicit.md] + * std::atomic_notify_all[link /reference/algorithm/atomic_notify_all.md] + * std::atomic_notify_one[link /reference/algorithm/atomic_notify_one.md] + * std::atomic_ref[link /reference/algorithm/atomic_ref.md] + * std::atomic_signal_fence[link /reference/algorithm/atomic_signal_fence.md] + * std::atomic_store[link /reference/algorithm/atomic_store.md] + * std::atomic_store_explicit[link /reference/algorithm/atomic_store_explicit.md] + * std::atomic_thread_fence[link /reference/algorithm/atomic_thread_fence.md] + * std::atomic_var_init[link /reference/algorithm/atomic_var_init.md] + * std::atomic_wait[link /reference/algorithm/atomic_wait.md] + * std::atomic_wait_explicit[link /reference/algorithm/atomic_wait_explicit.md] * std::memory_order_acq_rel[link /reference/atomic/memory_order.md] * std::memory_order_acquire[link /reference/atomic/memory_order.md] * std::memory_order_relaxed[link /reference/atomic/memory_order.md] From 9631cc22178d4eb9ad2cfc32ba4eebf2b69f5406 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 11:15:23 +0900 Subject: [PATCH 2012/3948] defined items in barrier at GLOBAL_QUALIFY_LIST.txt --- GLOBAL_QUALIFY_LIST.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 0b71565774..0fce835937 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -271,6 +271,7 @@ * std::memory_order_release[link /reference/atomic/memory_order.md] * std::memory_order_seq_cst[link /reference/atomic/memory_order.md] * [link /reference/barrier.md] + * std::barrier[link /reference/barrier/barrier.md] * [link /reference/bit.md] * [link /reference/bitset.md] * std::bitset[link /reference/bitset/bitset.md] From efff8868047a96561e54050e574cf00ed26b1138 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 11:16:22 +0900 Subject: [PATCH 2013/3948] defined items in bit at GLOBAL_QUALIFY_LIST.txt --- GLOBAL_QUALIFY_LIST.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 0fce835937..0ad6b4fbd3 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -273,6 +273,20 @@ * [link /reference/barrier.md] * std::barrier[link /reference/barrier/barrier.md] * [link /reference/bit.md] + * std::bit_cast[link /reference/algorithm/bit_cast.md] + * std::bit_ceil[link /reference/algorithm/bit_ceil.md] + * std::bit_floor[link /reference/algorithm/bit_floor.md] + * std::bit_width[link /reference/algorithm/bit_width.md] + * std::byteswap[link /reference/algorithm/byteswap.md] + * std::countl_one[link /reference/algorithm/countl_one.md] + * std::countl_zero[link /reference/algorithm/countl_zero.md] + * std::countr_one[link /reference/algorithm/countr_one.md] + * std::countr_zero[link /reference/algorithm/countr_zero.md] + * std::endian[link /reference/algorithm/endian.md] + * std::has_single_bit[link /reference/algorithm/has_single_bit.md] + * std::popcount[link /reference/algorithm/popcount.md] + * std::rotl[link /reference/algorithm/rotl.md] + * std::rotr[link /reference/algorithm/rotr.md] * [link /reference/bitset.md] * std::bitset[link /reference/bitset/bitset.md] * [link /reference/cassert.md] From 50c0e58f780a61230f41d1a78c6b0638e4a94d3d Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 11:17:35 +0900 Subject: [PATCH 2014/3948] defined items in cctype at GLOBAL_QUALIFY_LIST.txt defined items in cerrno at GLOBAL_QUALIFY_LIST.txt defined items in cfenv at GLOBAL_QUALIFY_LIST.txt defined items in cfloat at GLOBAL_QUALIFY_LIST.txt defined items in charconv at GLOBAL_QUALIFY_LIST.txt fixed wrong GLOBAL_QUALIFY_LIST links --- GLOBAL_QUALIFY_LIST.txt | 232 ++++++++++++++++++++++++++++------------ 1 file changed, 165 insertions(+), 67 deletions(-) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 0ad6b4fbd3..29e5067621 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -209,62 +209,62 @@ * ranges::upper_bound[link /reference/algorithm/ranges_upper_bound.md] * [link /reference/any.md] - * std::any[link /reference/algorithm/any.md] - * std::any_cast[link /reference/algorithm/any_cast.md] - * std::bad_any_cast[link /reference/algorithm/bad_any_cast.md] - * std::make_any[link /reference/algorithm/make_any.md] + * std::any[link /reference/any/any.md] + * std::any_cast[link /reference/any/any_cast.md] + * std::bad_any_cast[link /reference/any/bad_any_cast.md] + * std::make_any[link /reference/any/make_any.md] * [link /reference/array.md] - * std::array[link /reference/algorithm/array.md] - * std::to_array[link /reference/algorithm/to_array.md] + * std::array[link /reference/array/array.md] + * std::to_array[link /reference/array/to_array.md] * [link /reference/atomic.md] - * std::atomic[link /reference/algorithm/atomic.md] - * std::atomic_compare_exchange_strong[link /reference/algorithm/atomic_compare_exchange_strong.md] - * std::atomic_compare_exchange_strong_explicit[link /reference/algorithm/atomic_compare_exchange_strong_explicit.md] - * std::atomic_compare_exchange_weak[link /reference/algorithm/atomic_compare_exchange_weak.md] - * std::atomic_compare_exchange_weak_explicit[link /reference/algorithm/atomic_compare_exchange_weak_explicit.md] - * std::atomic_exchange[link /reference/algorithm/atomic_exchange.md] - * std::atomic_exchange_explicit[link /reference/algorithm/atomic_exchange_explicit.md] - * std::atomic_fetch_add[link /reference/algorithm/atomic_fetch_add.md] - * std::atomic_fetch_add_explicit[link /reference/algorithm/atomic_fetch_add_explicit.md] - * std::atomic_fetch_and[link /reference/algorithm/atomic_fetch_and.md] - * std::atomic_fetch_and_explicit[link /reference/algorithm/atomic_fetch_and_explicit.md] - * std::atomic_fetch_max[link /reference/algorithm/atomic_fetch_max.md] - * std::atomic_fetch_max_explicit[link /reference/algorithm/atomic_fetch_max_explicit.md] - * std::atomic_fetch_min[link /reference/algorithm/atomic_fetch_min.md] - * std::atomic_fetch_min_explicit[link /reference/algorithm/atomic_fetch_min_explicit.md] - * std::atomic_fetch_or[link /reference/algorithm/atomic_fetch_or.md] - * std::atomic_fetch_or_explicit[link /reference/algorithm/atomic_fetch_or_explicit.md] - * std::atomic_fetch_sub[link /reference/algorithm/atomic_fetch_sub.md] - * std::atomic_fetch_sub_explicit[link /reference/algorithm/atomic_fetch_sub_explicit.md] - * std::atomic_fetch_xor[link /reference/algorithm/atomic_fetch_xor.md] - * std::atomic_fetch_xor_explicit[link /reference/algorithm/atomic_fetch_xor_explicit.md] - * std::atomic_flag[link /reference/algorithm/atomic_flag.md] - * std::atomic_flag_clear[link /reference/algorithm/atomic_flag_clear.md] - * std::atomic_flag_clear_explicit[link /reference/algorithm/atomic_flag_clear_explicit.md] - * std::atomic_flag_init[link /reference/algorithm/atomic_flag_init.md] - * std::atomic_flag_notify_all[link /reference/algorithm/atomic_flag_notify_all.md] - * std::atomic_flag_notify_one[link /reference/algorithm/atomic_flag_notify_one.md] - * std::atomic_flag_test[link /reference/algorithm/atomic_flag_test.md] - * std::atomic_flag_test_and_set[link /reference/algorithm/atomic_flag_test_and_set.md] - * std::atomic_flag_test_and_set_explicit[link /reference/algorithm/atomic_flag_test_and_set_explicit.md] - * std::atomic_flag_test_explicit[link /reference/algorithm/atomic_flag_test_explicit.md] - * std::atomic_flag_wait[link /reference/algorithm/atomic_flag_wait.md] - * std::atomic_flag_wait_explicit[link /reference/algorithm/atomic_flag_wait_explicit.md] - * std::atomic_init[link /reference/algorithm/atomic_init.md] - * std::atomic_is_lock_free[link /reference/algorithm/atomic_is_lock_free.md] - * std::atomic_load[link /reference/algorithm/atomic_load.md] - * std::atomic_load_explicit[link /reference/algorithm/atomic_load_explicit.md] - * std::atomic_notify_all[link /reference/algorithm/atomic_notify_all.md] - * std::atomic_notify_one[link /reference/algorithm/atomic_notify_one.md] - * std::atomic_ref[link /reference/algorithm/atomic_ref.md] - * std::atomic_signal_fence[link /reference/algorithm/atomic_signal_fence.md] - * std::atomic_store[link /reference/algorithm/atomic_store.md] - * std::atomic_store_explicit[link /reference/algorithm/atomic_store_explicit.md] - * std::atomic_thread_fence[link /reference/algorithm/atomic_thread_fence.md] - * std::atomic_var_init[link /reference/algorithm/atomic_var_init.md] - * std::atomic_wait[link /reference/algorithm/atomic_wait.md] - * std::atomic_wait_explicit[link /reference/algorithm/atomic_wait_explicit.md] + * std::atomic[link /reference/atomic/atomic.md] + * std::atomic_compare_exchange_strong[link /reference/atomic/atomic_compare_exchange_strong.md] + * std::atomic_compare_exchange_strong_explicit[link /reference/atomic/atomic_compare_exchange_strong_explicit.md] + * std::atomic_compare_exchange_weak[link /reference/atomic/atomic_compare_exchange_weak.md] + * std::atomic_compare_exchange_weak_explicit[link /reference/atomic/atomic_compare_exchange_weak_explicit.md] + * std::atomic_exchange[link /reference/atomic/atomic_exchange.md] + * std::atomic_exchange_explicit[link /reference/atomic/atomic_exchange_explicit.md] + * std::atomic_fetch_add[link /reference/atomic/atomic_fetch_add.md] + * std::atomic_fetch_add_explicit[link /reference/atomic/atomic_fetch_add_explicit.md] + * std::atomic_fetch_and[link /reference/atomic/atomic_fetch_and.md] + * std::atomic_fetch_and_explicit[link /reference/atomic/atomic_fetch_and_explicit.md] + * std::atomic_fetch_max[link /reference/atomic/atomic_fetch_max.md] + * std::atomic_fetch_max_explicit[link /reference/atomic/atomic_fetch_max_explicit.md] + * std::atomic_fetch_min[link /reference/atomic/atomic_fetch_min.md] + * std::atomic_fetch_min_explicit[link /reference/atomic/atomic_fetch_min_explicit.md] + * std::atomic_fetch_or[link /reference/atomic/atomic_fetch_or.md] + * std::atomic_fetch_or_explicit[link /reference/atomic/atomic_fetch_or_explicit.md] + * std::atomic_fetch_sub[link /reference/atomic/atomic_fetch_sub.md] + * std::atomic_fetch_sub_explicit[link /reference/atomic/atomic_fetch_sub_explicit.md] + * std::atomic_fetch_xor[link /reference/atomic/atomic_fetch_xor.md] + * std::atomic_fetch_xor_explicit[link /reference/atomic/atomic_fetch_xor_explicit.md] + * std::atomic_flag[link /reference/atomic/atomic_flag.md] + * std::atomic_flag_clear[link /reference/atomic/atomic_flag_clear.md] + * std::atomic_flag_clear_explicit[link /reference/atomic/atomic_flag_clear_explicit.md] + * std::atomic_flag_init[link /reference/atomic/atomic_flag_init.md] + * std::atomic_flag_notify_all[link /reference/atomic/atomic_flag_notify_all.md] + * std::atomic_flag_notify_one[link /reference/atomic/atomic_flag_notify_one.md] + * std::atomic_flag_test[link /reference/atomic/atomic_flag_test.md] + * std::atomic_flag_test_and_set[link /reference/atomic/atomic_flag_test_and_set.md] + * std::atomic_flag_test_and_set_explicit[link /reference/atomic/atomic_flag_test_and_set_explicit.md] + * std::atomic_flag_test_explicit[link /reference/atomic/atomic_flag_test_explicit.md] + * std::atomic_flag_wait[link /reference/atomic/atomic_flag_wait.md] + * std::atomic_flag_wait_explicit[link /reference/atomic/atomic_flag_wait_explicit.md] + * std::atomic_init[link /reference/atomic/atomic_init.md] + * std::atomic_is_lock_free[link /reference/atomic/atomic_is_lock_free.md] + * std::atomic_load[link /reference/atomic/atomic_load.md] + * std::atomic_load_explicit[link /reference/atomic/atomic_load_explicit.md] + * std::atomic_notify_all[link /reference/atomic/atomic_notify_all.md] + * std::atomic_notify_one[link /reference/atomic/atomic_notify_one.md] + * std::atomic_ref[link /reference/atomic/atomic_ref.md] + * std::atomic_signal_fence[link /reference/atomic/atomic_signal_fence.md] + * std::atomic_store[link /reference/atomic/atomic_store.md] + * std::atomic_store_explicit[link /reference/atomic/atomic_store_explicit.md] + * std::atomic_thread_fence[link /reference/atomic/atomic_thread_fence.md] + * std::atomic_var_init[link /reference/atomic/atomic_var_init.md] + * std::atomic_wait[link /reference/atomic/atomic_wait.md] + * std::atomic_wait_explicit[link /reference/atomic/atomic_wait_explicit.md] * std::memory_order_acq_rel[link /reference/atomic/memory_order.md] * std::memory_order_acquire[link /reference/atomic/memory_order.md] * std::memory_order_relaxed[link /reference/atomic/memory_order.md] @@ -273,28 +273,107 @@ * [link /reference/barrier.md] * std::barrier[link /reference/barrier/barrier.md] * [link /reference/bit.md] - * std::bit_cast[link /reference/algorithm/bit_cast.md] - * std::bit_ceil[link /reference/algorithm/bit_ceil.md] - * std::bit_floor[link /reference/algorithm/bit_floor.md] - * std::bit_width[link /reference/algorithm/bit_width.md] - * std::byteswap[link /reference/algorithm/byteswap.md] - * std::countl_one[link /reference/algorithm/countl_one.md] - * std::countl_zero[link /reference/algorithm/countl_zero.md] - * std::countr_one[link /reference/algorithm/countr_one.md] - * std::countr_zero[link /reference/algorithm/countr_zero.md] - * std::endian[link /reference/algorithm/endian.md] - * std::has_single_bit[link /reference/algorithm/has_single_bit.md] - * std::popcount[link /reference/algorithm/popcount.md] - * std::rotl[link /reference/algorithm/rotl.md] - * std::rotr[link /reference/algorithm/rotr.md] + * std::bit_cast[link /reference/bit/bit_cast.md] + * std::bit_ceil[link /reference/bit/bit_ceil.md] + * std::bit_floor[link /reference/bit/bit_floor.md] + * std::bit_width[link /reference/bit/bit_width.md] + * std::byteswap[link /reference/bit/byteswap.md] + * std::countl_one[link /reference/bit/countl_one.md] + * std::countl_zero[link /reference/bit/countl_zero.md] + * std::countr_one[link /reference/bit/countr_one.md] + * std::countr_zero[link /reference/bit/countr_zero.md] + * std::endian[link /reference/bit/endian.md] + * std::has_single_bit[link /reference/bit/has_single_bit.md] + * std::popcount[link /reference/bit/popcount.md] + * std::rotl[link /reference/bit/rotl.md] + * std::rotr[link /reference/bit/rotr.md] * [link /reference/bitset.md] * std::bitset[link /reference/bitset/bitset.md] * [link /reference/cassert.md] * assert[link /reference/cassert/assert.md] +* [link /reference/cctype.md] + * std::isalnum[link /reference/cctype/isalnum.md] + * std::isalpha[link /reference/cctype/isalpha.md] + * std::isblank[link /reference/cctype/isblank.md] + * std::iscntrl[link /reference/cctype/iscntrl.md] + * std::isdigit[link /reference/cctype/isdigit.md] + * std::isgraph[link /reference/cctype/isgraph.md] + * std::islower[link /reference/cctype/islower.md] + * std::isprint[link /reference/cctype/isprint.md] + * std::ispunct[link /reference/cctype/ispunct.md] + * std::isspace[link /reference/cctype/isspace.md] + * std::isupper[link /reference/cctype/isupper.md] + * std::isxdigit[link /reference/cctype/isxdigit.md] + * std::tolower[link /reference/cctype/tolower.md] + * std::toupper[link /reference/cctype/toupper.md] * [link /reference/cerrno.md] + * std::errno[link /reference/cerrno/errno.md] * [link /reference/cfenv.md] + * std::fe_all_except[link /reference/cfenv/fe_all_except.md] + * std::fe_divbyzero[link /reference/cfenv/fe_divbyzero.md] + * std::fe_downward[link /reference/cfenv/fe_downward.md] + * std::fe_inexact[link /reference/cfenv/fe_inexact.md] + * std::fe_invalid[link /reference/cfenv/fe_invalid.md] + * std::fe_overflow[link /reference/cfenv/fe_overflow.md] + * std::fe_tonearest[link /reference/cfenv/fe_tonearest.md] + * std::fe_towardzero[link /reference/cfenv/fe_towardzero.md] + * std::fe_underflow[link /reference/cfenv/fe_underflow.md] + * std::fe_upward[link /reference/cfenv/fe_upward.md] + * std::feclearexcept[link /reference/cfenv/feclearexcept.md] + * std::fegetexceptflag[link /reference/cfenv/fegetexceptflag.md] + * std::fegetround[link /reference/cfenv/fegetround.md] + * std::feraiseexcept[link /reference/cfenv/feraiseexcept.md] + * std::fesetexceptflag[link /reference/cfenv/fesetexceptflag.md] + * std::fesetround[link /reference/cfenv/fesetround.md] + * std::fetestexcept[link /reference/cfenv/fetestexcept.md] + * std::fexcept_t[link /reference/cfenv/fexcept_t.md] * [link /reference/cfloat.md] + * std::dbl_decimal_dig[link /reference/cfloat/dbl_decimal_dig.md] + * std::dbl_dig[link /reference/cfloat/dbl_dig.md] + * std::dbl_epsilon[link /reference/cfloat/dbl_epsilon.md] + * std::dbl_has_subnorm[link /reference/cfloat/dbl_has_subnorm.md] + * std::dbl_mant_dig[link /reference/cfloat/dbl_mant_dig.md] + * std::dbl_max[link /reference/cfloat/dbl_max.md] + * std::dbl_max_10_exp[link /reference/cfloat/dbl_max_10_exp.md] + * std::dbl_max_exp[link /reference/cfloat/dbl_max_exp.md] + * std::dbl_min[link /reference/cfloat/dbl_min.md] + * std::dbl_min_10_exp[link /reference/cfloat/dbl_min_10_exp.md] + * std::dbl_min_exp[link /reference/cfloat/dbl_min_exp.md] + * std::dbl_true_min[link /reference/cfloat/dbl_true_min.md] + * std::decimal_dig[link /reference/cfloat/decimal_dig.md] + * std::flt_decimal_dig[link /reference/cfloat/flt_decimal_dig.md] + * std::flt_dig[link /reference/cfloat/flt_dig.md] + * std::flt_epsilon[link /reference/cfloat/flt_epsilon.md] + * std::flt_eval_method[link /reference/cfloat/flt_eval_method.md] + * std::flt_has_subnorm[link /reference/cfloat/flt_has_subnorm.md] + * std::flt_mant_dig[link /reference/cfloat/flt_mant_dig.md] + * std::flt_max[link /reference/cfloat/flt_max.md] + * std::flt_max_10_exp[link /reference/cfloat/flt_max_10_exp.md] + * std::flt_max_exp[link /reference/cfloat/flt_max_exp.md] + * std::flt_min[link /reference/cfloat/flt_min.md] + * std::flt_min_10_exp[link /reference/cfloat/flt_min_10_exp.md] + * std::flt_min_exp[link /reference/cfloat/flt_min_exp.md] + * std::flt_radix[link /reference/cfloat/flt_radix.md] + * std::flt_rounds[link /reference/cfloat/flt_rounds.md] + * std::flt_true_min[link /reference/cfloat/flt_true_min.md] + * std::ldbl_decimal_dig[link /reference/cfloat/ldbl_decimal_dig.md] + * std::ldbl_dig[link /reference/cfloat/ldbl_dig.md] + * std::ldbl_epsilon[link /reference/cfloat/ldbl_epsilon.md] + * std::ldbl_has_subnorm[link /reference/cfloat/ldbl_has_subnorm.md] + * std::ldbl_mant_dig[link /reference/cfloat/ldbl_mant_dig.md] + * std::ldbl_max[link /reference/cfloat/ldbl_max.md] + * std::ldbl_max_10_exp[link /reference/cfloat/ldbl_max_10_exp.md] + * std::ldbl_max_exp[link /reference/cfloat/ldbl_max_exp.md] + * std::ldbl_min[link /reference/cfloat/ldbl_min.md] + * std::ldbl_min_10_exp[link /reference/cfloat/ldbl_min_10_exp.md] + * std::ldbl_min_exp[link /reference/cfloat/ldbl_min_exp.md] + * std::ldbl_true_min[link /reference/cfloat/ldbl_true_min.md] * [link /reference/charconv.md] + * std::chars_format[link /reference/charconv/chars_format.md] + * std::from_chars_result[link /reference/charconv/from_chars_result.md] + * std::from_chars[link /reference/charconv/from_chars.md] + * std::to_chars_result[link /reference/charconv/to_chars_result.md] + * std::to_chars[link /reference/charconv/to_chars.md] * [link /reference/chrono.md] * std::chrono::days[link /reference/chrono/duration_aliases.md] * std::chrono::duration[link /reference/chrono/duration.md] @@ -329,6 +408,25 @@ * weeks[link /reference/chrono/duration_aliases.md] * years[link /reference/chrono/duration_aliases.md] * [link /reference/climits.md] + * std::char_bit[link /reference/climits/char_bit.md] + * std::char_max[link /reference/climits/char_max.md] + * std::char_min[link /reference/climits/char_min.md] + * std::int_max[link /reference/climits/int_max.md] + * std::int_min[link /reference/climits/int_min.md] + * std::llong_max[link /reference/climits/llong_max.md] + * std::llong_min[link /reference/climits/llong_min.md] + * std::long_max[link /reference/climits/long_max.md] + * std::long_min[link /reference/climits/long_min.md] + * std::mb_len_max[link /reference/climits/mb_len_max.md] + * std::schar_max[link /reference/climits/schar_max.md] + * std::schar_min[link /reference/climits/schar_min.md] + * std::shrt_max[link /reference/climits/shrt_max.md] + * std::shrt_min[link /reference/climits/shrt_min.md] + * std::uchar_max[link /reference/climits/uchar_max.md] + * std::uint_max[link /reference/climits/uint_max.md] + * std::ullong_max[link /reference/climits/ullong_max.md] + * std::ulong_max[link /reference/climits/ulong_max.md] + * std::ushrt_max[link /reference/climits/ushrt_max.md] * [link /reference/compare.md] * compare_three_way_result_t[link /reference/compare/compare_three_way_result.md] * strong_ordering[link /reference/compare/strong_ordering.md] From 27058845cc5aaf6f9edcf8568869250bd67207f5 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 11:36:10 +0900 Subject: [PATCH 2015/3948] added link for all_of.md --- reference/algorithm/all_of.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reference/algorithm/all_of.md b/reference/algorithm/all_of.md index 120a261023..fb11af6710 100644 --- a/reference/algorithm/all_of.md +++ b/reference/algorithm/all_of.md @@ -57,6 +57,10 @@ int main() { } ``` * std::all_of[color ff0000] +* std::vector[link /reference/vector/vector.md] +* std::cout[link /reference/iostream/cout.md] +* std::boolalpha[link /reference/ios/boolalpha.md] +* std::endl[link /reference/ostream/endl.md] ### 出力 ``` From 477ae694e4c56d18b2add47f9f97f1c1af2d340e Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 11:37:53 +0900 Subject: [PATCH 2016/3948] added link for all_of.md and any_of.md --- reference/algorithm/all_of.md | 2 ++ reference/algorithm/any_of.md | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/reference/algorithm/all_of.md b/reference/algorithm/all_of.md index fb11af6710..e0ff83bd64 100644 --- a/reference/algorithm/all_of.md +++ b/reference/algorithm/all_of.md @@ -61,6 +61,8 @@ int main() { * std::cout[link /reference/iostream/cout.md] * std::boolalpha[link /reference/ios/boolalpha.md] * std::endl[link /reference/ostream/endl.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] ### 出力 ``` diff --git a/reference/algorithm/any_of.md b/reference/algorithm/any_of.md index 1923e1dbea..01f58e5062 100644 --- a/reference/algorithm/any_of.md +++ b/reference/algorithm/any_of.md @@ -58,6 +58,12 @@ int main() { } ``` * std::any_of[color ff0000] +* std::cout[link /reference/iostream/cout.md] +* std::boolalpha[link /reference/ios/boolalpha.md] +* std::endl[link /reference/ostream/endl.md] +* std::vector[link /reference/vector/vector.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] ### 出力 ``` From 91e8c01b9594ee1d63433a639ec7687227d87824 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 11:38:52 +0900 Subject: [PATCH 2017/3948] added link for binary_search.md --- reference/algorithm/binary_search.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reference/algorithm/binary_search.md b/reference/algorithm/binary_search.md index a1c10635e2..a7b9cccc04 100644 --- a/reference/algorithm/binary_search.md +++ b/reference/algorithm/binary_search.md @@ -88,6 +88,11 @@ int main() } ``` * std::binary_search[color ff0000] +* std::vector[link /reference/vector/vector.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] #### 出力 ``` From d4d4623f893c48ea9bf399a613ee9f1d3b3ef3f0 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 11:40:04 +0900 Subject: [PATCH 2018/3948] added link for clamp.md --- reference/algorithm/clamp.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reference/algorithm/clamp.md b/reference/algorithm/clamp.md index 1500a095f9..33ab7e4487 100644 --- a/reference/algorithm/clamp.md +++ b/reference/algorithm/clamp.md @@ -53,6 +53,8 @@ int main() } ``` * std::clamp[color ff0000] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] ### 出力 ``` From 9a9bd35585533905c83e1797afafc59a00f30d3f Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 11:41:41 +0900 Subject: [PATCH 2019/3948] added link for copy_backward.md --- reference/algorithm/copy_backward.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reference/algorithm/copy_backward.md b/reference/algorithm/copy_backward.md index 81610824bd..1947e463cb 100644 --- a/reference/algorithm/copy_backward.md +++ b/reference/algorithm/copy_backward.md @@ -64,9 +64,14 @@ int main() { } ``` * std::copy_backward[color ff0000] +* std::list[link /reference/list/list.md] * ls.begin()[link /reference/list/list/begin.md] * std::next[link /reference/iterator/next.md] * ls.end()[link /reference/list/list/end.md] +* std::ostream_iterator[link /reference/iterator/ostream_iterator.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] +* std::copy[link /reference/algorithm/copy.md] ### 出力 ``` From b2fbf7848ddc024bd2334a5bf622ec1268d0154a Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 11:44:40 +0900 Subject: [PATCH 2020/3948] added link for copy_if.md --- reference/algorithm/copy_if.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/reference/algorithm/copy_if.md b/reference/algorithm/copy_if.md index 17c3b4e12b..0305009ce3 100644 --- a/reference/algorithm/copy_if.md +++ b/reference/algorithm/copy_if.md @@ -80,7 +80,22 @@ int main() { } ``` * std::copy_if[color ff0000] -* result.begin()[link /reference/vector/vector/begin.md] +* std::vector[link /reference/vector/vector.md] +* v1.size[link /reference/vector/vector/size.md] +* v2.size[link /reference/vector/vector/size.md] +* v3.size[link /reference/vector/vector/size.md] +* v1.begin[link /reference/vector/vector/begin.md] +* v1.end[link /reference/vector/vector/end.md] +* v2.begin[link /reference/vector/vector/begin.md] +* v2.end[link /reference/vector/vector/end.md] +* v3.begin[link /reference/vector/vector/begin.md] +* v3.end[link /reference/vector/vector/end.md] +* copy_if[link /reference/algorithm/copy_if.md] +* result.begin[link /reference/vector/vector/begin.md] +* std::ostream_iterator[link /reference/iterator/ostream_iterator.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] +* std::copy[link /reference/algorithm/copy.md] ### 出力 ``` From 8194a2f806dfb0a0fede7f31e2b027a888c5670d Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 11:45:50 +0900 Subject: [PATCH 2021/3948] fixed code_qualify error --- reference/algorithm/copy_backward.md | 1 - 1 file changed, 1 deletion(-) diff --git a/reference/algorithm/copy_backward.md b/reference/algorithm/copy_backward.md index 1947e463cb..a24850df79 100644 --- a/reference/algorithm/copy_backward.md +++ b/reference/algorithm/copy_backward.md @@ -70,7 +70,6 @@ int main() { * ls.end()[link /reference/list/list/end.md] * std::ostream_iterator[link /reference/iterator/ostream_iterator.md] * std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] * std::copy[link /reference/algorithm/copy.md] ### 出力 From f38c489d15661269b168a60ecf740ceb521e0109 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 11:47:04 +0900 Subject: [PATCH 2022/3948] added link for copy_n.md --- reference/algorithm/copy_n.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reference/algorithm/copy_n.md b/reference/algorithm/copy_n.md index 4e495dcde2..5f70643179 100644 --- a/reference/algorithm/copy_n.md +++ b/reference/algorithm/copy_n.md @@ -58,6 +58,11 @@ int main() { } ``` * std::copy_n[color ff0000] +* std::vector[link /reference/vector/vector.md] +* std::copy_n[link /reference/algorithm/copy_n.md] +* std::v.begin[link /reference/vector/vector/begin.md] +* std::ostream_iterator[link /reference/iterator/ostream_iterator.md] +* std::cout[link /reference/iostream/cout.md] ### 出力 ``` From f9ef82c1e99a32544a70a861d064e63e5d60c226 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 11:49:32 +0900 Subject: [PATCH 2023/3948] added link for copy.md --- reference/algorithm/copy.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/reference/algorithm/copy.md b/reference/algorithm/copy.md index 0a5b33447e..3c419e9349 100644 --- a/reference/algorithm/copy.md +++ b/reference/algorithm/copy.md @@ -74,7 +74,19 @@ int main() { } ``` * std::copy[color ff0000] - +* std::vector[link /reference/vector/vector.md] +* v.size[link /reference/vector/vector/size.md] +* std::copy[link /reference/algorithm/copy.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] +* v2.begin[link /reference/vector/vector/begin.md] +* std::list[link /reference/list/list.md] +* v2.end[link /reference/vector/vector/end.md] +* std::back_inserter[link /reference/iterator/back_inserter.md] +* ls3.begin[link /reference/list/list/begin.md] +* ls3.end[link /reference/list/list/end.md] +* std::ostream_iterator[link /reference/iterator/ostream_iterator.md] +* std::cout[link /reference/iostream/cout.md] ### 出力 ``` 3,1,2, From 00f3f8e4a5977df7abf854dacbd27bfcfee1360e Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 11:50:09 +0900 Subject: [PATCH 2024/3948] added link for count_if.md --- reference/algorithm/count_if.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reference/algorithm/count_if.md b/reference/algorithm/count_if.md index c17a48ee2b..5343f1de49 100644 --- a/reference/algorithm/count_if.md +++ b/reference/algorithm/count_if.md @@ -54,6 +54,12 @@ int main() { } ``` * std::count_if[color ff0000] +* std::vector[link /reference/vector/vector.md] +* std::count_if[link /reference/algorithm/count_if.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] ### 出力 ```cpp From 83b2464bfd21afe2e05eead013ae3abcdc760689 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 11:51:43 +0900 Subject: [PATCH 2025/3948] added link for count.md --- reference/algorithm/count.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/reference/algorithm/count.md b/reference/algorithm/count.md index c79512c963..6616a597da 100644 --- a/reference/algorithm/count.md +++ b/reference/algorithm/count.md @@ -80,6 +80,11 @@ int main() { } ``` * std::count[color ff0000] +* std::vector[link /reference/vector/vector.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] #### 出力 ``` @@ -113,6 +118,11 @@ int main() { } ``` * std::count[color ff0000] +* std::vector[link /reference/vector/vector.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] #### 出力 ``` From 484e4f433e88c857331b5da80e8e450dbfd7fac5 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 11:53:14 +0900 Subject: [PATCH 2026/3948] added link for equal_range.md --- reference/algorithm/equal_range.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/reference/algorithm/equal_range.md b/reference/algorithm/equal_range.md index 63b841b0fe..4103a1854d 100644 --- a/reference/algorithm/equal_range.md +++ b/reference/algorithm/equal_range.md @@ -102,6 +102,12 @@ int main() } ``` * equal_range[color ff0000] +* std::vector[link /reference/vector/vector.md] +* std::sort[link /reference/algorithm/sort.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] #### 出力 ``` @@ -141,6 +147,11 @@ int main() { } ``` * std::equal_range[color ff0000] +* std::vector[link /reference/vector/vector.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] #### 出力 ``` From d1690679f0ce112710ee6b8c6ec246534ee9052f Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 11:55:12 +0900 Subject: [PATCH 2027/3948] added link for equal.md --- reference/algorithm/equal.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/reference/algorithm/equal.md b/reference/algorithm/equal.md index 913ea9a089..f7c16685f5 100644 --- a/reference/algorithm/equal.md +++ b/reference/algorithm/equal.md @@ -138,6 +138,13 @@ int main() { } ``` * std::equal[color ff0000] +* std::vector[link /reference/vector/vector.md] +* std::array[link /reference/array/array.md] +* std::begin[link /reference/iterator/begin.md] +* std::end[link /reference/iterator/end.md] +* std::cout[link /reference/iostream/cout.md] +* std::boolalpha[link /reference/ios/boolalpha.md] +* std::endl[link /reference/ostream/endl.md] ### 出力 ``` From 25b915381d7f6529a76490ccf0ba99d6ab8bda7e Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 11:55:56 +0900 Subject: [PATCH 2028/3948] added link for fill_n.md --- reference/algorithm/fill_n.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reference/algorithm/fill_n.md b/reference/algorithm/fill_n.md index d79e725d8c..4ce3c90313 100644 --- a/reference/algorithm/fill_n.md +++ b/reference/algorithm/fill_n.md @@ -101,6 +101,8 @@ int main() { } ``` * std::fill_n[color ff0000] +* std::ostream_iterator[link /reference/iterator/ostream_iterator.md] +* std::cout[link /reference/iostream/cout.md] #### 出力 ``` From 0034664dba18cd64ec9719a58691f33d15f35198 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 11:56:40 +0900 Subject: [PATCH 2029/3948] added link for fill.md --- reference/algorithm/fill.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reference/algorithm/fill.md b/reference/algorithm/fill.md index 80b66018c6..d6db827cf0 100644 --- a/reference/algorithm/fill.md +++ b/reference/algorithm/fill.md @@ -85,6 +85,11 @@ int main() { } ``` * std::fill[color ff0000] +* std::vector[link /reference/vector/vector.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] +* std::for_each[link /reference/algorithm/for_each.md] +* std::cout[link /reference/iostream/cout.md] #### 出力 ``` From d129597919c4b2cd634607cc27b647057dc9fda6 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 11:59:25 +0900 Subject: [PATCH 2030/3948] added link for find_end.md --- reference/algorithm/find_end.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/reference/algorithm/find_end.md b/reference/algorithm/find_end.md index 675a493532..8f55b082c9 100644 --- a/reference/algorithm/find_end.md +++ b/reference/algorithm/find_end.md @@ -95,8 +95,15 @@ int main() { } ``` * std::find_end[color ff0000] -* ls.begin()[link /reference/list/list/begin.md] -* ls.end()[link /reference/list/list/end.md] +* std::vector[link /reference/vector/vector.md] +* std::list[link /reference/list/list.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] +* ls.begin[link /reference/list/list/begin.md] +* ls.end[link /reference/list/list/end.md] +* std::distance[link /reference/iterator/distance.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] ### 出力 ``` From cbcfdb7efa930d0340710be455327af70b81a1d1 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 12:02:32 +0900 Subject: [PATCH 2031/3948] fixed code_qualify error --- reference/algorithm/copy_if.md | 1 - reference/algorithm/copy_n.md | 1 - 2 files changed, 2 deletions(-) diff --git a/reference/algorithm/copy_if.md b/reference/algorithm/copy_if.md index 0305009ce3..7b5c693532 100644 --- a/reference/algorithm/copy_if.md +++ b/reference/algorithm/copy_if.md @@ -94,7 +94,6 @@ int main() { * result.begin[link /reference/vector/vector/begin.md] * std::ostream_iterator[link /reference/iterator/ostream_iterator.md] * std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] * std::copy[link /reference/algorithm/copy.md] ### 出力 diff --git a/reference/algorithm/copy_n.md b/reference/algorithm/copy_n.md index 5f70643179..d49ed205b5 100644 --- a/reference/algorithm/copy_n.md +++ b/reference/algorithm/copy_n.md @@ -60,7 +60,6 @@ int main() { * std::copy_n[color ff0000] * std::vector[link /reference/vector/vector.md] * std::copy_n[link /reference/algorithm/copy_n.md] -* std::v.begin[link /reference/vector/vector/begin.md] * std::ostream_iterator[link /reference/iterator/ostream_iterator.md] * std::cout[link /reference/iostream/cout.md] From e4bd88863a2b0aca9818d258e77d270558e26369 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 12:33:37 +0900 Subject: [PATCH 2032/3948] added link for find_first_of.md --- reference/algorithm/find_first_of.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/reference/algorithm/find_first_of.md b/reference/algorithm/find_first_of.md index be67c0a13c..ee530c3f18 100644 --- a/reference/algorithm/find_first_of.md +++ b/reference/algorithm/find_first_of.md @@ -105,8 +105,15 @@ int main() { } ``` * std::find_first_of[color ff0000] -* ls.begin()[link /reference/list/list/begin.md] -* ls.end()[link /reference/list/list/end.md] +* std::vector[link /reference/vector/vector.md] +* std::list[link /reference/list/list.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] +* ls.begin[link /reference/list/list/begin.md] +* ls.end[link /reference/list/list/end.md] +* std::distance[link /reference/iterator/distance.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] ### 出力 ``` From 405e787e5a8c0abc5a3e9b07a34c57de9c4739af Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 12:34:39 +0900 Subject: [PATCH 2033/3948] added link for find_if_not.md --- reference/algorithm/find_if_not.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reference/algorithm/find_if_not.md b/reference/algorithm/find_if_not.md index 352e17c24b..8c9242507d 100644 --- a/reference/algorithm/find_if_not.md +++ b/reference/algorithm/find_if_not.md @@ -54,6 +54,11 @@ int main() { } ``` * std::find_if_not[color ff0000] +* std::vector[link /reference/vector/vector.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] ### 出力 ``` From 95f352f636a6a3ca4f058666f9ffba80f0fd37ff Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 12:35:24 +0900 Subject: [PATCH 2034/3948] added link for find_if.md --- reference/algorithm/find_if.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reference/algorithm/find_if.md b/reference/algorithm/find_if.md index c3cb3a8ad7..915d36bb99 100644 --- a/reference/algorithm/find_if.md +++ b/reference/algorithm/find_if.md @@ -53,6 +53,11 @@ int main() { } ``` * std::find_if[color ff0000] +* std::vector[link /reference/vector/vector.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] ### 出力 ``` From 85f63fe01aab3114b1dc208a551f60ac80d59a95 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 12:36:00 +0900 Subject: [PATCH 2035/3948] added link for find.md --- reference/algorithm/find.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reference/algorithm/find.md b/reference/algorithm/find.md index 2eb04c2dda..0c025c676c 100644 --- a/reference/algorithm/find.md +++ b/reference/algorithm/find.md @@ -81,6 +81,11 @@ int main() { } ``` * std::find[color ff0000] +* std::vector[link /reference/vector/vector.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] #### 出力 ``` From 3d4a2ef2be4363b9eeaf84defd850ce37ad723c3 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 12:36:26 +0900 Subject: [PATCH 2036/3948] added link for for_each_n.md --- reference/algorithm/for_each_n.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reference/algorithm/for_each_n.md b/reference/algorithm/for_each_n.md index 452705bc0a..20f2eee4a0 100644 --- a/reference/algorithm/for_each_n.md +++ b/reference/algorithm/for_each_n.md @@ -79,6 +79,10 @@ int main() } ``` * std::for_each_n[color ff0000] +* std::vector[link /reference/vector/vector.md] +* v.begin[link /reference/vector/vector/begin.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] ### 出力 ``` From 293009535b8359be4d1a71250c41561a5b16008b Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 7 Jul 2025 13:17:55 +0900 Subject: [PATCH 2037/3948] cpp26/embed: remove redundant ';' --- lang/cpp26/embed.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/cpp26/embed.md b/lang/cpp26/embed.md index 7b2b64d8ac..fa2b4860f0 100644 --- a/lang/cpp26/embed.md +++ b/lang/cpp26/embed.md @@ -46,7 +46,7 @@ int main() { ```cpp example int main() { constexpr unsigned char limited_data[] = { - #embed "data.bin" limit(1024); + #embed "data.bin" limit(1024) }; constexpr unsigned char prefixed_data[] = { #embed "data.bin" prefix(0x01, 0x02, 0x03) @@ -79,4 +79,4 @@ int main() { ## 参照 -- [P1967R14 #embed - a scannable, tooling-friendly binary resource inclusion mechanism](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p1967r14.html) \ No newline at end of file +- [P1967R14 #embed - a scannable, tooling-friendly binary resource inclusion mechanism](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p1967r14.html) From b89a92321b50f0dc2f3d0e4ddfc637f56c1535e9 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Mon, 7 Jul 2025 13:54:18 +0900 Subject: [PATCH 2038/3948] add note --- reference/cstdlib/calloc.md | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/reference/cstdlib/calloc.md b/reference/cstdlib/calloc.md index 229fa532d1..7715d94cbe 100644 --- a/reference/cstdlib/calloc.md +++ b/reference/cstdlib/calloc.md @@ -1,7 +1,8 @@ # calloc -* cstdlib[meta header] -* std[meta namespace] -* function[meta id-type] + +- cstdlib[meta header] +- std[meta namespace] +- function[meta id-type] ## 概要 @@ -9,7 +10,7 @@ void *calloc(size_t nmemb, size_t size); ``` -任意の個数のオブジェクトへの配列用ポインタを動的に確保し、その領域を0で初期化する。 +任意の個数のオブジェクトへの配列用ポインタを動的に確保し、その領域を 0 で初期化する。 この関数で返されるポインタは、割当領域の先頭のポインタである。 @@ -23,24 +24,26 @@ void *calloc(size_t nmemb, size_t size); - `calloc`、`malloc`および `realloc`関数による連続的なメモリ確保によるメモリの割当の順序、連続性は不定である。 +- 目盛りリークを避けるため、この関数で確保したメモリは、`free`などを使い、メモリ解放するべきである。 + ## 例 ```cpp example #include #include - + int main(void) { int* p1 = calloc(4, sizeof(int)); // 4個のint配列のポインタを確保、0二初期化 int* p2 = calloc(1, sizeof(int[4])); // 上と同じ int* p3 = calloc(4, sizeof *p3); // 上と同じ - + if (p2) { for (int n = 0; n < 4; ++n) printf("p2[%d] == %d\n", n, p2[n]); } - + free(p1); free(p2); free(p3); @@ -48,6 +51,7 @@ int main(void) ``` ## 出力例 + ``` p2[0] == 0 p2[1] == 0 @@ -56,10 +60,9 @@ p2[3] == 0 ``` ## 関連項目 -- `free`:確保されたメモリを解放する。 - +- `free`:確保されたメモリを解放する。 ## 参照 --[7.20.3 Memory management functions]("https://www.dii.uchile.cl/~daespino/files/Iso_C_1999_definition.pdf") +-[7.20.3 Memory management functions]("https://www.dii.uchile.cl/~daespino/files/Iso_C_1999_definition.pdf") From 2b759faa887174ba5ecb1b45b8bc279e6ee7e2e6 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Mon, 7 Jul 2025 14:09:42 +0900 Subject: [PATCH 2039/3948] new page and add path in --- reference/cstdlib/malloc.md | 75 +++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 reference/cstdlib/malloc.md diff --git a/reference/cstdlib/malloc.md b/reference/cstdlib/malloc.md new file mode 100644 index 0000000000..5d856a4164 --- /dev/null +++ b/reference/cstdlib/malloc.md @@ -0,0 +1,75 @@ +# malloc + +- cstdlib[meta header] +- std[meta namespace] +- function[meta id-type] + +## 概要 + +```cpp +void *malloc( size_t size ); +``` + +初期化されていない`size_t`個の`size`型配列のメモリを確保する。 + +確保可能なら、配列の初めのポインタを返す。 + +確保不可能なら、`null`を返す。 + +確保するサイズが 0 の時に`malloc`が返す値は、定義されていない。 + +具体的には、`null`ポインタが返される場合もある。 + +また、`null`以外のポインタが返された場合もあり、この場合はメモリリークを避けるため参照を解除せずに`free`関数に渡すべきである。 + +この関数でできた、オブジェクトの寿命は、メモリ割り当て時から、 `free`などで解放されるまでである。 + +## 備考 + +この関数はスレッドセーフである。 + +メモリリークを避けるため、この関数で確保したメモリは、`free`などを使い、メモリ解放するべきである。 + +## 例 + +cppref より引用。 + +```cpp example +#include +#include + +int main(void) +{ + int *p1 = malloc(4*sizeof(int)); // 4個のint型配列の目盛りを確保 + int *p2 = malloc(sizeof(int[4])); // 上と同じ。 + int *p3 = malloc(4*sizeof *p3); // 上と同じ。 + + if(p1) { + for(int n=0; n<4; ++n) + p1[n] = n*n; + for(int n=0; n<4; ++n) + printf("p1[%d] == %d\n", n, p1[n]); + } + + free(p1);//メモリを開放 + free(p2); + free(p3); +} +``` + +## 出力例 + +``` +p1[0] == 0 +p1[1] == 1 +p1[2] == 4 +p1[3] == 9 +``` + +## 関連リンク + +- [`free`](/cstdlib/free.md.nolink): 確保したメモリを解放する。 + +## 参照 + +- [7.22.3 Memory management functions](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2310.pdf) From fd6f46ff61738c3a220e9fd7dcb4bc7f6e26ae47 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Mon, 7 Jul 2025 05:21:12 +0000 Subject: [PATCH 2040/3948] fix path to `cstdlib/malloc` --- lang/cpp14/sized_deallocation.md | 2 +- reference/cstdlib.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/cpp14/sized_deallocation.md b/lang/cpp14/sized_deallocation.md index dd98f00a9b..e037c45afe 100644 --- a/lang/cpp14/sized_deallocation.md +++ b/lang/cpp14/sized_deallocation.md @@ -85,7 +85,7 @@ int main() } ``` * std::printf[link /reference/cstdio/printf.md.nolink] -* std::malloc[link /reference/cstdlib/malloc.md.nolink] +* std::malloc[link /reference/cstdlib/malloc.md] ### 出力 diff --git a/reference/cstdlib.md b/reference/cstdlib.md index 24dca132c2..6eeb74778c 100644 --- a/reference/cstdlib.md +++ b/reference/cstdlib.md @@ -40,7 +40,7 @@ | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`aligned_alloc`](cstdlib/aligned_alloc.md) | 指定したアライメントでメモリを確保する (function) | C++17 | -| [`malloc`](cstdlib/malloc.md.nolink) | メモリを確保する (function) | | +| [`malloc`](cstdlib/malloc.md) | メモリを確保する (function) | | | [`calloc`](cstdlib/calloc.md) | メモリを確保し、領域をゼロ初期化する (function) | | | [`realloc`](cstdlib/realloc.md.nolink) | メモリを再確保する (function) | | | [`free`](cstdlib/free.md.nolink) | 確保したメモリを解放する (function) | | From e05f8b5cfde6e28e5948346ca872bb1313514dc9 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 7 Jul 2025 14:41:51 +0900 Subject: [PATCH 2041/3948] =?UTF-8?q?[meta=20...]=20=E3=81=AE=E6=9B=B8?= =?UTF-8?q?=E3=81=8D=E6=96=B9=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/calloc.md | 6 +++--- reference/cstdlib/malloc.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/reference/cstdlib/calloc.md b/reference/cstdlib/calloc.md index 7715d94cbe..a234a0450b 100644 --- a/reference/cstdlib/calloc.md +++ b/reference/cstdlib/calloc.md @@ -1,8 +1,8 @@ # calloc -- cstdlib[meta header] -- std[meta namespace] -- function[meta id-type] +* cstdlib[meta header] +* std[meta namespace] +* function[meta id-type] ## 概要 diff --git a/reference/cstdlib/malloc.md b/reference/cstdlib/malloc.md index 5d856a4164..a6eb509f01 100644 --- a/reference/cstdlib/malloc.md +++ b/reference/cstdlib/malloc.md @@ -1,8 +1,8 @@ # malloc -- cstdlib[meta header] -- std[meta namespace] -- function[meta id-type] +* cstdlib[meta header] +* std[meta namespace] +* function[meta id-type] ## 概要 From aee1e25e52e15820dfe85cce9f8eb2965cfde0d4 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 7 Jul 2025 17:23:31 +0900 Subject: [PATCH 2042/3948] =?UTF-8?q?=E3=82=B0=E3=83=AD=E3=83=BC=E3=83=90?= =?UTF-8?q?=E3=83=AB=E4=BF=AE=E9=A3=BE=E3=83=AA=E3=82=B9=E3=83=88=20:=20st?= =?UTF-8?q?d::move=E3=81=AFalgorithm=E3=81=A8utility=E3=81=AB=E3=81=82?= =?UTF-8?q?=E3=82=8B=E3=81=AE=E3=81=A7=E7=99=BB=E9=8C=B2=E3=81=97=E3=81=AA?= =?UTF-8?q?=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 29e5067621..e1741f0dcb 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -53,7 +53,6 @@ * std::minmax[link /reference/algorithm/minmax.md] * std::minmax_element[link /reference/algorithm/minmax_element.md] * std::mismatch[link /reference/algorithm/mismatch.md] - * std::move[link /reference/algorithm/move.md] * std::move_backward[link /reference/algorithm/move_backward.md] * std::next_permutation[link /reference/algorithm/next_permutation.md] * std::none_of[link /reference/algorithm/none_of.md] From 2a43c74275b3ff0e51ec6406783bff49fe0c38ea Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 7 Jul 2025 17:54:53 +0900 Subject: [PATCH 2043/3948] =?UTF-8?q?malloc,=20calloc=20:=20=E5=AE=A3?= =?UTF-8?q?=E8=A8=80=E3=82=92=E6=9B=B8=E3=81=8F=E5=A0=B4=E6=89=80=E3=82=92?= =?UTF-8?q?=E7=A7=BB=E5=8B=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/calloc.md | 6 +++--- reference/cstdlib/malloc.md | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/reference/cstdlib/calloc.md b/reference/cstdlib/calloc.md index a234a0450b..102212b17e 100644 --- a/reference/cstdlib/calloc.md +++ b/reference/cstdlib/calloc.md @@ -4,12 +4,12 @@ * std[meta namespace] * function[meta id-type] -## 概要 - -``` +```cpp void *calloc(size_t nmemb, size_t size); ``` +## 概要 + 任意の個数のオブジェクトへの配列用ポインタを動的に確保し、その領域を 0 で初期化する。 この関数で返されるポインタは、割当領域の先頭のポインタである。 diff --git a/reference/cstdlib/malloc.md b/reference/cstdlib/malloc.md index a6eb509f01..22e678aa50 100644 --- a/reference/cstdlib/malloc.md +++ b/reference/cstdlib/malloc.md @@ -4,12 +4,12 @@ * std[meta namespace] * function[meta id-type] -## 概要 - ```cpp void *malloc( size_t size ); ``` +## 概要 + 初期化されていない`size_t`個の`size`型配列のメモリを確保する。 確保可能なら、配列の初めのポインタを返す。 From 2219858da0d751ce0020ee60b4c697831e9c67ef Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 7 Jul 2025 17:57:21 +0900 Subject: [PATCH 2044/3948] =?UTF-8?q?cstdlib=E3=81=AE=E3=82=B5=E3=83=B3?= =?UTF-8?q?=E3=83=97=E3=83=AB=E3=82=B3=E3=83=BC=E3=83=89=20:=20=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=83=87=E3=83=B3=E3=83=88=E3=82=924=20=E2=86=92=202?= =?UTF-8?q?=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/atoi_atol_atoll.md | 14 +++++++------- reference/cstdlib/calloc.md | 26 +++++++++++++------------- reference/cstdlib/getenv.md | 4 ++-- reference/cstdlib/malloc.md | 28 ++++++++++++++-------------- reference/cstdlib/rand.md | 4 ++-- reference/cstdlib/rand_max.md | 6 +++--- reference/cstdlib/srand.md | 4 ++-- reference/cstdlib/system.md | 4 ++-- 8 files changed, 45 insertions(+), 45 deletions(-) diff --git a/reference/cstdlib/atoi_atol_atoll.md b/reference/cstdlib/atoi_atol_atoll.md index 15a4246c09..b313f96212 100644 --- a/reference/cstdlib/atoi_atol_atoll.md +++ b/reference/cstdlib/atoi_atol_atoll.md @@ -38,13 +38,13 @@ long long atoll( const char* str ); int main(void) { - printf("%i\n", atoi(" -123junk")); - printf("%i\n", atoi(" +321dust")); - printf("%i\n", atoi("0")); - printf("%i\n", atoi("0042")); // 先頭の0を含む10進数として変換 - printf("%i\n", atoi("0x2A")); // 0のみを変換、"x2A"は破棄される - printf("%i\n", atoi("junk")); // 変換不可 - printf("%i\n", atoi("2147483648")); //intの範囲外 + printf("%i\n", atoi(" -123junk")); + printf("%i\n", atoi(" +321dust")); + printf("%i\n", atoi("0")); + printf("%i\n", atoi("0042")); // 先頭の0を含む10進数として変換 + printf("%i\n", atoi("0x2A")); // 0のみを変換、"x2A"は破棄される + printf("%i\n", atoi("junk")); // 変換不可 + printf("%i\n", atoi("2147483648")); //intの範囲外 } ``` diff --git a/reference/cstdlib/calloc.md b/reference/cstdlib/calloc.md index 102212b17e..767ed9128c 100644 --- a/reference/cstdlib/calloc.md +++ b/reference/cstdlib/calloc.md @@ -34,19 +34,19 @@ void *calloc(size_t nmemb, size_t size); int main(void) { - int* p1 = calloc(4, sizeof(int)); // 4個のint配列のポインタを確保、0二初期化 - int* p2 = calloc(1, sizeof(int[4])); // 上と同じ - int* p3 = calloc(4, sizeof *p3); // 上と同じ - - if (p2) - { - for (int n = 0; n < 4; ++n) - printf("p2[%d] == %d\n", n, p2[n]); - } - - free(p1); - free(p2); - free(p3); + int* p1 = calloc(4, sizeof(int)); // 4個のint配列のポインタを確保、0二初期化 + int* p2 = calloc(1, sizeof(int[4])); // 上と同じ + int* p3 = calloc(4, sizeof *p3); // 上と同じ + + if (p2) + { + for (int n = 0; n < 4; ++n) + printf("p2[%d] == %d\n", n, p2[n]); + } + + free(p1); + free(p2); + free(p3); } ``` diff --git a/reference/cstdlib/getenv.md b/reference/cstdlib/getenv.md index 32b64c2fb8..45c3184a4b 100644 --- a/reference/cstdlib/getenv.md +++ b/reference/cstdlib/getenv.md @@ -28,8 +28,8 @@ C++11以降では、`getenv`が返す文字列を変更したときの動作は int main() { - if (const char* env_p = std::getenv("PATH")) - std::cout << "Your PATH is: " << env_p << '\n'; + if (const char* env_p = std::getenv("PATH")) + std::cout << "Your PATH is: " << env_p << '\n'; } ``` diff --git a/reference/cstdlib/malloc.md b/reference/cstdlib/malloc.md index 22e678aa50..258eb2e851 100644 --- a/reference/cstdlib/malloc.md +++ b/reference/cstdlib/malloc.md @@ -40,20 +40,20 @@ cppref より引用。 int main(void) { - int *p1 = malloc(4*sizeof(int)); // 4個のint型配列の目盛りを確保 - int *p2 = malloc(sizeof(int[4])); // 上と同じ。 - int *p3 = malloc(4*sizeof *p3); // 上と同じ。 - - if(p1) { - for(int n=0; n<4; ++n) - p1[n] = n*n; - for(int n=0; n<4; ++n) - printf("p1[%d] == %d\n", n, p1[n]); - } - - free(p1);//メモリを開放 - free(p2); - free(p3); + int *p1 = malloc(4*sizeof(int)); // 4個のint型配列の目盛りを確保 + int *p2 = malloc(sizeof(int[4])); // 上と同じ。 + int *p3 = malloc(4*sizeof *p3); // 上と同じ。 + + if(p1) { + for(int n=0; n<4; ++n) + p1[n] = n*n; + for(int n=0; n<4; ++n) + printf("p1[%d] == %d\n", n, p1[n]); + } + + free(p1);//メモリを開放 + free(p2); + free(p3); } ``` diff --git a/reference/cstdlib/rand.md b/reference/cstdlib/rand.md index 9b8ded0db9..adf9f47c64 100644 --- a/reference/cstdlib/rand.md +++ b/reference/cstdlib/rand.md @@ -31,8 +31,8 @@ int main() { - std::srand(std::time(0)); // 現在時刻を疑似乱数のシード値とする。 - std::cout << std::rand() << '\n'; + std::srand(std::time(0)); // 現在時刻を疑似乱数のシード値とする。 + std::cout << std::rand() << '\n'; } ``` diff --git a/reference/cstdlib/rand_max.md b/reference/cstdlib/rand_max.md index a78c39747e..cbb6ba54bd 100644 --- a/reference/cstdlib/rand_max.md +++ b/reference/cstdlib/rand_max.md @@ -22,10 +22,10 @@ int main() { - // use current time as seed for random generator - std::srand(std::time(NULL)); + // use current time as seed for random generator + std::srand(std::time(NULL)); - std::cout << "RAND_MAX: " << RAND_MAX << '\n'; + std::cout << "RAND_MAX: " << RAND_MAX << '\n'; } ``` diff --git a/reference/cstdlib/srand.md b/reference/cstdlib/srand.md index 2b3b0b6136..4d6338e171 100644 --- a/reference/cstdlib/srand.md +++ b/reference/cstdlib/srand.md @@ -33,8 +33,8 @@ void srand( unsigned seed ); int main() { - std::srand(std::time(0)); // 現在時刻を疑似乱数のシード値とする。 - std::cout << std::rand() << '\n'; + std::srand(std::time(0)); // 現在時刻を疑似乱数のシード値とする。 + std::cout << std::rand() << '\n'; } ``` diff --git a/reference/cstdlib/system.md b/reference/cstdlib/system.md index db93e60e73..7a28ef4b22 100644 --- a/reference/cstdlib/system.md +++ b/reference/cstdlib/system.md @@ -30,8 +30,8 @@ POSIXでは`WEXITSTATUS`と`WSTOPSIG`を使用、分解できる int main() { - std::system("ls -l >test.txt");//"ls -l >test.txt"を実行 - std::cout << std::ifstream("test.txt").rdbuf(); + std::system("ls -l >test.txt");//"ls -l >test.txt"を実行 + std::cout << std::ifstream("test.txt").rdbuf(); } ``` From 9cb1ee8850a1b31790256d1c93685ddb4311d37c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 7 Jul 2025 18:00:45 +0900 Subject: [PATCH 2045/3948] =?UTF-8?q?cstdlib=20:=20C++=E3=81=AEC=E4=BA=92?= =?UTF-8?q?=E6=8F=9B=E3=83=A9=E3=82=A4=E3=83=96=E3=83=A9=E3=83=AA=E3=81=AF?= =?UTF-8?q?std=E5=90=8D=E5=89=8D=E7=A9=BA=E9=96=93=E3=81=AB=E5=B1=9E?= =?UTF-8?q?=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/atof.md | 20 +++++++++++--------- reference/cstdlib/atoi_atol_atoll.md | 12 +++++++----- reference/cstdlib/calloc.md | 8 +++++--- reference/cstdlib/getenv.md | 4 +++- reference/cstdlib/malloc.md | 4 +++- reference/cstdlib/srand.md | 4 +++- reference/cstdlib/system.md | 4 +++- 7 files changed, 35 insertions(+), 21 deletions(-) diff --git a/reference/cstdlib/atof.md b/reference/cstdlib/atof.md index d24063fdf0..0e40bc2ed2 100644 --- a/reference/cstdlib/atof.md +++ b/reference/cstdlib/atof.md @@ -4,7 +4,9 @@ * function[meta id-type] ```cpp -double atof( const char* str ); +namespace std { + double atof( const char* str ); +} ``` ## 概要 @@ -38,14 +40,14 @@ double atof( const char* str ); int main() { - std::cout << std::atof("0.0000000123") << '\n' - << std::atof("0.012") << '\n' - << std::atof("15e16") << '\n' - << std::atof("-0x1afp-2") << '\n' - << std::atof("inF") << '\n' - << std::atof("12Nan23") << '\n' - << std::atof("NAN") << '\n' - << std::atof("invalid") << '\n'; + std::cout << std::atof("0.0000000123") << '\n' + << std::atof("0.012") << '\n' + << std::atof("15e16") << '\n' + << std::atof("-0x1afp-2") << '\n' + << std::atof("inF") << '\n' + << std::atof("12Nan23") << '\n' + << std::atof("NAN") << '\n' + << std::atof("invalid") << '\n'; } ``` diff --git a/reference/cstdlib/atoi_atol_atoll.md b/reference/cstdlib/atoi_atol_atoll.md index b313f96212..ff9ee530b9 100644 --- a/reference/cstdlib/atoi_atol_atoll.md +++ b/reference/cstdlib/atoi_atol_atoll.md @@ -4,9 +4,11 @@ * function[meta id-type] ```cpp -int atoi ( const char* str ); -long atol ( const char* str ); -long long atoll( const char* str ); +namespace std { + int atoi ( const char* str ); + long atol ( const char* str ); + long long atoll( const char* str ); +} ``` ## 概要 @@ -33,8 +35,8 @@ long long atoll( const char* str ); ## 例 ```cpp example -#include -#include +#include +#include int main(void) { diff --git a/reference/cstdlib/calloc.md b/reference/cstdlib/calloc.md index 767ed9128c..86d48df70a 100644 --- a/reference/cstdlib/calloc.md +++ b/reference/cstdlib/calloc.md @@ -5,7 +5,9 @@ * function[meta id-type] ```cpp -void *calloc(size_t nmemb, size_t size); +namespace std { + void *calloc(size_t nmemb, size_t size); +} ``` ## 概要 @@ -29,8 +31,8 @@ void *calloc(size_t nmemb, size_t size); ## 例 ```cpp example -#include -#include +#include +#include int main(void) { diff --git a/reference/cstdlib/getenv.md b/reference/cstdlib/getenv.md index 45c3184a4b..ece6120cf4 100644 --- a/reference/cstdlib/getenv.md +++ b/reference/cstdlib/getenv.md @@ -4,7 +4,9 @@ * function[meta id-type] ```cpp -char* getenv( const char* env_var ); +namespace std { + char* getenv( const char* env_var ); +} ``` ## 概要 diff --git a/reference/cstdlib/malloc.md b/reference/cstdlib/malloc.md index 258eb2e851..f44267f574 100644 --- a/reference/cstdlib/malloc.md +++ b/reference/cstdlib/malloc.md @@ -5,7 +5,9 @@ * function[meta id-type] ```cpp -void *malloc( size_t size ); +namespace std { + void *malloc( size_t size ); +} ``` ## 概要 diff --git a/reference/cstdlib/srand.md b/reference/cstdlib/srand.md index 4d6338e171..044fa8de50 100644 --- a/reference/cstdlib/srand.md +++ b/reference/cstdlib/srand.md @@ -4,7 +4,9 @@ * function[meta id-type] ```cpp -void srand( unsigned seed ); +namespace std { + void srand( unsigned seed ); +} ``` ## 概要 diff --git a/reference/cstdlib/system.md b/reference/cstdlib/system.md index 7a28ef4b22..6fd9827354 100644 --- a/reference/cstdlib/system.md +++ b/reference/cstdlib/system.md @@ -4,7 +4,9 @@ * function[meta id-type] ```cpp -int system( const char* command ); +namespace std { + int system( const char* command ); +} ``` ## 概要 From e1018d0b3c817c97f913f1cd6eb7c8db777333e2 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 7 Jul 2025 18:01:58 +0900 Subject: [PATCH 2046/3948] =?UTF-8?q?rand=20:=20=E5=AE=A3=E8=A8=80?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/rand.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reference/cstdlib/rand.md b/reference/cstdlib/rand.md index adf9f47c64..0adee36d67 100644 --- a/reference/cstdlib/rand.md +++ b/reference/cstdlib/rand.md @@ -3,6 +3,12 @@ * std[meta namespace] * function[meta id-type] +```cpp +namespace std { + int rand(); +} +``` + ## 概要 `0`から`RAND_MAX`までの値の疑似乱数を返す。 From 52363fd30374cff38e76f4898a34f8548229adf8 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 7 Jul 2025 18:03:31 +0900 Subject: [PATCH 2047/3948] =?UTF-8?q?=E3=83=A1=E3=83=A2=E3=83=AA=E3=81=AE?= =?UTF-8?q?=E6=96=87=E8=84=88=E3=81=A7=E3=81=AE=E3=80=8C=E9=96=8B=E6=94=BE?= =?UTF-8?q?=E3=80=8D=E3=82=92=E3=80=8C=E8=A7=A3=E6=94=BE=E3=80=8D=E3=81=AB?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/malloc.md | 2 +- reference/memory_resource.md | 2 +- reference/memory_resource/null_memory_resource.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/cstdlib/malloc.md b/reference/cstdlib/malloc.md index f44267f574..913a283fe3 100644 --- a/reference/cstdlib/malloc.md +++ b/reference/cstdlib/malloc.md @@ -53,7 +53,7 @@ int main(void) printf("p1[%d] == %d\n", n, p1[n]); } - free(p1);//メモリを開放 + free(p1);//メモリを解放 free(p2); free(p3); } diff --git a/reference/memory_resource.md b/reference/memory_resource.md index d682a40bbf..7b5116c830 100644 --- a/reference/memory_resource.md +++ b/reference/memory_resource.md @@ -25,7 +25,7 @@ | 名前 | 説明 | 対応バージョン | |-----------------|----------------|----------------| |[`new_delete_resource`](memory_resource/new_delete_resource.md) | `operator new`、`operator delete`を利用する`memory_resource`を取得 | C++17 | -|[`null_memory_resource`](memory_resource/null_memory_resource.md) | 確保も開放も行わない`memory_resource`を取得 | C++17 | +|[`null_memory_resource`](memory_resource/null_memory_resource.md) | 確保も解放も行わない`memory_resource`を取得 | C++17 | |[`set_default_resource`](memory_resource/set_default_resource.md) | デフォルトで使用される`memory_resource`の設定 | C++17 | |[`get_default_resource`](memory_resource/get_default_resource.md) | デフォルトで使用される`memory_resource`の取得 | C++17 | diff --git a/reference/memory_resource/null_memory_resource.md b/reference/memory_resource/null_memory_resource.md index 7cd0304a82..8110139950 100644 --- a/reference/memory_resource/null_memory_resource.md +++ b/reference/memory_resource/null_memory_resource.md @@ -11,7 +11,7 @@ namespace std::pmr { ``` ## 概要 -メモリの確保も開放も行わない`memory_resource`を取得する。 +メモリの確保も解放も行わない`memory_resource`を取得する。 この関数によって取得された`memory_resource`は以下の特徴を持つ。 From 3edf1100f4ce4155d9b42d11434c1fe4eeadeb1c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 7 Jul 2025 18:05:03 +0900 Subject: [PATCH 2048/3948] calloc : fix typo --- reference/cstdlib/calloc.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdlib/calloc.md b/reference/cstdlib/calloc.md index 86d48df70a..e0d1d7222e 100644 --- a/reference/cstdlib/calloc.md +++ b/reference/cstdlib/calloc.md @@ -26,7 +26,7 @@ namespace std { - `calloc`、`malloc`および `realloc`関数による連続的なメモリ確保によるメモリの割当の順序、連続性は不定である。 -- 目盛りリークを避けるため、この関数で確保したメモリは、`free`などを使い、メモリ解放するべきである。 +- メモリリークを避けるため、この関数で確保したメモリは、`free`などを使い、メモリ解放するべきである。 ## 例 From 5ad0b19e2092299b1a31b8521793d92aa325f021 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 7 Jul 2025 18:06:14 +0900 Subject: [PATCH 2049/3948] =?UTF-8?q?atof=20:=20=E5=87=BA=E5=8A=9B?= =?UTF-8?q?=E4=BE=8B=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/atof.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/reference/cstdlib/atof.md b/reference/cstdlib/atof.md index 0e40bc2ed2..26b44694be 100644 --- a/reference/cstdlib/atof.md +++ b/reference/cstdlib/atof.md @@ -51,6 +51,19 @@ int main() } ``` +### 出力例 + +``` +1.23e-08 +0.012 +1.5e+17 +-107.75 +inf +12 +nan +0 +``` + ## バージョン ### 処理系 - Clang: ? From 73818d33c15eb4ed64b6a6d2bc57fa544c9a6f53 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 7 Jul 2025 18:06:34 +0900 Subject: [PATCH 2050/3948] =?UTF-8?q?getenv=20:=20=E8=A6=8B=E5=87=BA?= =?UTF-8?q?=E3=81=97=E3=82=92=E3=80=8C=E5=87=BA=E5=8A=9B=E7=B5=90=E6=9E=9C?= =?UTF-8?q?=E3=80=8D=20=E2=86=92=20=E3=80=8C=E5=87=BA=E5=8A=9B=E4=BE=8B?= =?UTF-8?q?=E3=80=8D=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/getenv.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdlib/getenv.md b/reference/cstdlib/getenv.md index ece6120cf4..f99577bb66 100644 --- a/reference/cstdlib/getenv.md +++ b/reference/cstdlib/getenv.md @@ -35,7 +35,7 @@ int main() } ``` -## 出力結果 +## 出力例 ``` Your PATH is: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games ``` From a17c2a66cf4e2e77291d80ab4850b0e6bf71e8a1 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 7 Jul 2025 18:09:51 +0900 Subject: [PATCH 2051/3948] =?UTF-8?q?atof,=20atoi:=20C++98=E3=81=8B?= =?UTF-8?q?=E3=82=89=E3=81=82=E3=82=8B=E6=A9=9F=E8=83=BD=E3=81=AF=E3=80=81?= =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=83=91=E3=82=A4=E3=83=A9=E3=81=AE=E3=83=90?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3=E8=A8=98=E8=BC=89=E3=81=AF?= =?UTF-8?q?=E3=81=A8=E3=81=8F=E3=81=AB=E3=81=AA=E3=81=8F=E3=81=A6=E3=82=88?= =?UTF-8?q?=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit すべてのコンパイラに大昔から実装されているのに「?」と書いてあるのはユーザー・コンパイラベンダからの心象がよくない --- reference/cstdlib/atof.md | 22 +--------------------- reference/cstdlib/atoi_atol_atoll.md | 7 ------- 2 files changed, 1 insertion(+), 28 deletions(-) diff --git a/reference/cstdlib/atof.md b/reference/cstdlib/atof.md index 26b44694be..8a2a2d64dd 100644 --- a/reference/cstdlib/atof.md +++ b/reference/cstdlib/atof.md @@ -51,27 +51,7 @@ int main() } ``` -### 出力例 - -``` -1.23e-08 -0.012 -1.5e+17 --107.75 -inf -12 -nan -0 -``` - -## バージョン -### 処理系 -- Clang: ? -- GCC: 13[mark verified] -- ICC: ? -- Visual C++ - -## 出力結果 +## 出力例 ``` 1.23e-08 diff --git a/reference/cstdlib/atoi_atol_atoll.md b/reference/cstdlib/atoi_atol_atoll.md index ff9ee530b9..114b1c79f0 100644 --- a/reference/cstdlib/atoi_atol_atoll.md +++ b/reference/cstdlib/atoi_atol_atoll.md @@ -62,13 +62,6 @@ int main(void) -2147483648 ``` -## バージョン -### 処理系 -- Clang: ? -- GCC: 13[mark verified] -- ICC: ? -- Visual C++ ? - ## 関連項目 - [`stoi`](/reference/string/stoi.md) - [`stol`](/reference/string/stol.md) From 020eed05144c16139f9c8c0bcb92aed0a0efd349 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 7 Jul 2025 18:10:05 +0900 Subject: [PATCH 2052/3948] =?UTF-8?q?malloc:=20=E3=80=8C=E9=96=A2=E9=80=A3?= =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=80=8D=20=E2=86=92=20=E3=80=8C?= =?UTF-8?q?=E9=96=A2=E9=80=A3=E9=A0=85=E7=9B=AE=E3=80=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/malloc.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdlib/malloc.md b/reference/cstdlib/malloc.md index 913a283fe3..540ece0054 100644 --- a/reference/cstdlib/malloc.md +++ b/reference/cstdlib/malloc.md @@ -68,7 +68,7 @@ p1[2] == 4 p1[3] == 9 ``` -## 関連リンク +## 関連項目 - [`free`](/cstdlib/free.md.nolink): 確保したメモリを解放する。 From e3cd83c7e3a9d58c7c4748aa4ba92517ce448c8a Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 20:00:30 +0900 Subject: [PATCH 2053/3948] added link for for_each.md --- reference/algorithm/for_each.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reference/algorithm/for_each.md b/reference/algorithm/for_each.md index 1dace08230..6e9f71ed1a 100644 --- a/reference/algorithm/for_each.md +++ b/reference/algorithm/for_each.md @@ -89,6 +89,11 @@ int main() { } ``` * std::for_each[color ff0000] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] +* std::vector[link /reference/vector/vector.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] * v.push_back[link /reference/vector/vector/push_back.md] #### 出力 From e3bd4b750e2754278fd05625bba28287307ac7c6 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 20:00:56 +0900 Subject: [PATCH 2054/3948] added link for generate_n.md --- reference/algorithm/generate_n.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reference/algorithm/generate_n.md b/reference/algorithm/generate_n.md index a858e03a9d..0c8d32cbea 100644 --- a/reference/algorithm/generate_n.md +++ b/reference/algorithm/generate_n.md @@ -75,6 +75,8 @@ int main() { } ``` * std::generate_n[color ff0000] +* std::ostream_iterator[link /reference/iterator/ostream_iterator.md] +* std::cout[link /reference/iostream/cout.md] ### 出力 ``` From 7332210e7b4734ed2e29acdac389fb0d2abd3e41 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 20:01:43 +0900 Subject: [PATCH 2055/3948] added link for generate.md --- reference/algorithm/generate.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reference/algorithm/generate.md b/reference/algorithm/generate.md index 17aacb71aa..685d60e445 100644 --- a/reference/algorithm/generate.md +++ b/reference/algorithm/generate.md @@ -56,6 +56,11 @@ int main() { } ``` * std::generate[color ff0000] +* std::vector[link /reference/vector/vector.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] +* std::for_each[link /reference/algorithm/for_each.md] +* std::cout[link /reference/iostream/cout.md] ### 出力 ``` From d0181e4a7566afaa1333545e114a527ff81054cc Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 20:02:39 +0900 Subject: [PATCH 2056/3948] added link for includes.md --- reference/algorithm/includes.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reference/algorithm/includes.md b/reference/algorithm/includes.md index 82b393e2c1..361793a029 100644 --- a/reference/algorithm/includes.md +++ b/reference/algorithm/includes.md @@ -82,8 +82,12 @@ int main() } ``` * std::includes[color ff0000] +* std::set[link /reference/set/set.md] * begin()[link /reference/set/set/begin.md] * end()[link /reference/set/set/end.md] +* std::cout[link /reference/iostream/cout.md] +* std::boolalpha[link /reference/ios/boolalpha.md] +* std::endl[link /reference/ostream/endl.md] ### 出力 ``` From ea3bac4c57eaa00147664df34fd943ffbb252a58 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 20:03:21 +0900 Subject: [PATCH 2057/3948] added link for inplace_merge.md --- reference/algorithm/inplace_merge.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reference/algorithm/inplace_merge.md b/reference/algorithm/inplace_merge.md index 2af32581f8..2edfe703e4 100644 --- a/reference/algorithm/inplace_merge.md +++ b/reference/algorithm/inplace_merge.md @@ -93,6 +93,12 @@ int main() } ``` * std::inplace_merge[color ff0000] +* std::vector[link /reference/vector/vector.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] +* std::for_each[link /reference/algorithm/for_each.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] ### 出力 ``` From c0dd5e68034e96d6a39bf4d510b9e926effe7b36 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 20:04:16 +0900 Subject: [PATCH 2058/3948] added link for is_heap_until.md --- reference/algorithm/is_heap_until.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reference/algorithm/is_heap_until.md b/reference/algorithm/is_heap_until.md index 094cb609c7..6d94ef2c9d 100644 --- a/reference/algorithm/is_heap_until.md +++ b/reference/algorithm/is_heap_until.md @@ -76,6 +76,12 @@ int main() } ``` * std::is_heap_until[color ff0000] +* std::vector[link /reference/vector/vector.md] +* std::cout[link /reference/iostream/cout.md] +* std::boolalpha[link /reference/ios/boolalpha.md] +* std::endl[link /reference/ostream/endl.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] * std::make_heap[link make_heap.md] ### 出力 From 9d3ab82b837a9098f4ce8047dc9eec76a633865a Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 20:04:57 +0900 Subject: [PATCH 2059/3948] added link for is_heap.md --- reference/algorithm/is_heap.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reference/algorithm/is_heap.md b/reference/algorithm/is_heap.md index 6498b559b7..a67f6dd8ad 100644 --- a/reference/algorithm/is_heap.md +++ b/reference/algorithm/is_heap.md @@ -69,6 +69,12 @@ int main() } ``` * std::is_heap[color ff0000] +* std::vector[link /reference/vector/vector.md] +* std::cout[link /reference/iostream/cout.md] +* std::boolalpha[link /reference/ios/boolalpha.md] +* std::endl[link /reference/ostream/endl.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] * std::make_heap[link make_heap.md] ### 出力 From 34b3a1151d9f9af10cbc43dfcf40d52f09fb5f75 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 20:05:58 +0900 Subject: [PATCH 2060/3948] added link for is_partitioned.md --- reference/algorithm/is_partitioned.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reference/algorithm/is_partitioned.md b/reference/algorithm/is_partitioned.md index 94506f9508..3da09add81 100644 --- a/reference/algorithm/is_partitioned.md +++ b/reference/algorithm/is_partitioned.md @@ -72,7 +72,13 @@ int main() } ``` * std::is_partitioned[color ff0000] +* std::vector[link /reference/vector/vector.md] * std::partition[link partition.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] +* std::for_each[link /reference/algorithm/for_each.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] ### 出力 ``` From f4b2f118f99629c1ae298b5477d822c861da7593 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 20:07:12 +0900 Subject: [PATCH 2061/3948] added link for is_permutation.md --- reference/algorithm/is_permutation.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reference/algorithm/is_permutation.md b/reference/algorithm/is_permutation.md index 40483f8a42..6aab74d2c5 100644 --- a/reference/algorithm/is_permutation.md +++ b/reference/algorithm/is_permutation.md @@ -96,8 +96,14 @@ int main () } ``` * std::is_permutation[color ff0000] +* std::vector[link /reference/vector/vector.md] +* v.begin()[link /reference/vector/vector/begin.md] +* v.end()[link /reference/vector/vector/end.md] * good.begin()[link /reference/vector/vector/begin.md] * bad.begin()[link /reference/vector/vector/begin.md] +* std::cout[link /reference/iostream/cout.md] +* std::boolalpha[link /reference/ios/boolalpha.md] +* std::endl[link /reference/ostream/endl.md] ### 出力 ``` From 87567816d1d6c230a453ac0435a4bebeed5c58a6 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 20:08:05 +0900 Subject: [PATCH 2062/3948] added link for is_sorted_until.md --- reference/algorithm/is_sorted_until.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/reference/algorithm/is_sorted_until.md b/reference/algorithm/is_sorted_until.md index 621f615d06..b60924a497 100644 --- a/reference/algorithm/is_sorted_until.md +++ b/reference/algorithm/is_sorted_until.md @@ -76,6 +76,13 @@ int main() } ``` * std::is_sorted_until[color ff0000] +* std::vector[link /reference/vector/vector.md] +* std::cout[link /reference/iostream/cout.md] +* std::boolalpha[link /reference/ios/boolalpha.md] +* std::sort[link sort.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] +* std::endl[link /reference/ostream/endl.md] ### 出力 ``` From a03646f5a7cf41af310f354a5bc2a4d34d82f17d Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 20:08:27 +0900 Subject: [PATCH 2063/3948] added link for is_sorted.md --- reference/algorithm/is_sorted.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/reference/algorithm/is_sorted.md b/reference/algorithm/is_sorted.md index f0c2de657f..b0a3a318d0 100644 --- a/reference/algorithm/is_sorted.md +++ b/reference/algorithm/is_sorted.md @@ -64,6 +64,13 @@ int main() } ``` * std::is_sorted[color ff0000] +* std::vector[link /reference/vector/vector.md] +* std::cout[link /reference/iostream/cout.md] +* std::boolalpha[link /reference/ios/boolalpha.md] +* std::endl[link /reference/ostream/endl.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] +* std::sort[link sort.md] ### 出力 ``` From f1b24b515a78dfeea72eb8d0214069430ddc3fd2 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 20:09:21 +0900 Subject: [PATCH 2064/3948] added link for iter_swap.md --- reference/algorithm/iter_swap.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/reference/algorithm/iter_swap.md b/reference/algorithm/iter_swap.md index aa599262d8..d0f70af2aa 100644 --- a/reference/algorithm/iter_swap.md +++ b/reference/algorithm/iter_swap.md @@ -57,7 +57,14 @@ int main() { } ``` * std::iter_swap[color ff0000] - +* std::vector[link /reference/vector/vector.md] +* v1.begin[link /reference/vector/vector/begin.md] +* v1.end[link /reference/vector/vector/end.md] +* v2.begin[link /reference/vector/vector/begin.md] +* v2.end[link /reference/vector/vector/end.md] +* std::ostream_iterator[link /reference/iterator/ostream_iterator.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] ### 出力 ``` v1: 3,5,4, From 8ba9a70367125332843b7d728ac1acf749bacb07 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 20:37:38 +0900 Subject: [PATCH 2065/3948] added link for lexicographical_compare_three_way.md --- .../algorithm/lexicographical_compare_three_way.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/reference/algorithm/lexicographical_compare_three_way.md b/reference/algorithm/lexicographical_compare_three_way.md index caf3b5a090..9a1253cdbb 100644 --- a/reference/algorithm/lexicographical_compare_three_way.md +++ b/reference/algorithm/lexicographical_compare_three_way.md @@ -114,7 +114,19 @@ int main() { } } ``` +* std::lexicographical_compare_three_way[color ff0000] +* std::string[link /reference/string/string.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] +* std::isalpha[link /reference/cctype/isalpha.md] +* std::tolower[link /reference/cctype/tolower.md] * weak_ordering[link /reference/compare/weak_ordering.md] +* str1.begin[link /reference/string/string/begin.md] +* str1.end[link /reference/string/string/end.md] +* str2.begin[link /reference/string/string/begin.md] +* str2.end[link /reference/string/string/end.md] +* str3.begin[link /reference/string/string/begin.md] +* str3.end[link /reference/string/string/end.md] ### 出力例 ``` From c668d08fda9371ab271c21dbd66470957b2f8637 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 20:39:31 +0900 Subject: [PATCH 2066/3948] added link for lexicographical_compare.md --- reference/algorithm/lexicographical_compare.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reference/algorithm/lexicographical_compare.md b/reference/algorithm/lexicographical_compare.md index b486aed5dc..8bbeb701af 100644 --- a/reference/algorithm/lexicographical_compare.md +++ b/reference/algorithm/lexicographical_compare.md @@ -137,6 +137,9 @@ int main() * begin()[link /reference/string/basic_string/begin.md] * end()[link /reference/string/basic_string/end.md] * std::greater[link /reference/functional/greater.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] +* std::string[link /reference/string/string.md] ### 出力 ``` From cf458c7bc4961d3b460c5b6c8a748f721970db1b Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 20:41:04 +0900 Subject: [PATCH 2067/3948] added link for lower_bound.md --- reference/algorithm/lower_bound.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/reference/algorithm/lower_bound.md b/reference/algorithm/lower_bound.md index 7b3b2e2f06..6416d9fb10 100644 --- a/reference/algorithm/lower_bound.md +++ b/reference/algorithm/lower_bound.md @@ -176,6 +176,15 @@ int main() } ``` * std::lower_bound[color ff0000] +* std::string[link /reference/string/string.md] +* std::vector[link /reference/vector/vector.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] +* std::size_t[link /reference/cstddef/size_t.md] +* std::distance[link /reference/iterator/distance.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] +* std::sort[link sort.md] #### 出力 ``` From 29ef38b41d0e6abce75ffd6763208124af731395 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 20:41:25 +0900 Subject: [PATCH 2068/3948] added link for make_heap.md --- reference/algorithm/make_heap.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reference/algorithm/make_heap.md b/reference/algorithm/make_heap.md index a57a55f691..aad14771d9 100644 --- a/reference/algorithm/make_heap.md +++ b/reference/algorithm/make_heap.md @@ -64,6 +64,10 @@ int main() } ``` * std::make_heap[color ff0000] +* std::vector[link /reference/vector/vector.md] +* std::for_each[link /reference/algorithm/for_each.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] ### 出力 ``` From a262ea3baa2fc27c3af19039fd0176fcd5ad6b7e Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 20:42:08 +0900 Subject: [PATCH 2069/3948] added link for max_element.md --- reference/algorithm/max_element.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/reference/algorithm/max_element.md b/reference/algorithm/max_element.md index 5b042cb165..1aec717323 100644 --- a/reference/algorithm/max_element.md +++ b/reference/algorithm/max_element.md @@ -71,6 +71,15 @@ int main() } ``` * std::max_element[color ff0000] +* std::vector[link /reference/vector/vector.md] +* std::pair[link /reference/utility/pair.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] +* v1.begin[link /reference/vector/vector/begin.md] +* v1.end[link /reference/vector/vector/end.md] +* v2.begin[link /reference/vector/vector/begin.md] +* v2.end[link /reference/vector/vector/end.md] +* assert[link /reference/cassert/assert.md] ### 出力 ``` From fe7d64940615e65e59e0135622d9462e968ca831 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 20:42:27 +0900 Subject: [PATCH 2070/3948] added link for max.md --- reference/algorithm/max.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/algorithm/max.md b/reference/algorithm/max.md index 1366d76d3e..4cd2343aec 100644 --- a/reference/algorithm/max.md +++ b/reference/algorithm/max.md @@ -75,6 +75,7 @@ int main() ``` * std::max[color ff0000] * std::greater[link /reference/functional/greater.md] +* assert[link /reference/cassert/assert.md] ### 出力 ``` From 339a6f6a5c89fa00c3f0f0722b01ef06f85e159e Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 20:43:15 +0900 Subject: [PATCH 2071/3948] added link for merge.md --- reference/algorithm/merge.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reference/algorithm/merge.md b/reference/algorithm/merge.md index 7b224746c3..68c044d27e 100644 --- a/reference/algorithm/merge.md +++ b/reference/algorithm/merge.md @@ -126,6 +126,10 @@ int main() * b.end()[link /reference/vector/vector/end.md] * result.begin()[link /reference/vector/vector/begin.md] * result.end()[link /reference/vector/vector/end.md] +* std::back_inserter[link /reference/iterator/back_inserter.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] +* std::for_each[link /reference/algorithm/for_each.md] ### 出力 ``` From bffea50335356884eccd61e1e2e248e808d4f6b4 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 20:44:09 +0900 Subject: [PATCH 2072/3948] added link for min_element.md --- reference/algorithm/min_element.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/reference/algorithm/min_element.md b/reference/algorithm/min_element.md index 53fe864980..8d9084ea96 100644 --- a/reference/algorithm/min_element.md +++ b/reference/algorithm/min_element.md @@ -70,6 +70,17 @@ int main() } ``` * std::min_element[color ff0000] +* std::vector[link /reference/vector/vector.md] +* std::v1.begin[link /reference/vector/vector/begin.md] +* std::v1.end[link /reference/vector/vector/end.md] +* std::v2.begin[link /reference/vector/vector/begin.md] +* std::v2.end[link /reference/vector/vector/end.md] +* std::pair[link /reference/utility/pair.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] +* assert[link /reference/cassert/assert.md] +* v2_min_element->first[link /reference/utility/pair/first.md] +* v2_min_element->second[link /reference/utility/pair/second.md] ### 出力 ``` From 3bac8d44ae7650c564b12af1d20fc4b979ffceb5 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 20:44:28 +0900 Subject: [PATCH 2073/3948] added link for min.md --- reference/algorithm/min.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/algorithm/min.md b/reference/algorithm/min.md index d4915042c0..7f790b4cdc 100644 --- a/reference/algorithm/min.md +++ b/reference/algorithm/min.md @@ -75,6 +75,7 @@ int main() ``` * std::min[color ff0000] * std::greater[link /reference/functional/greater.md] +* assert[link /reference/cassert/assert.md] ### 出力 ``` From 958aa28456a73e5106c8aff690956b892ed8e8bd Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 20:47:09 +0900 Subject: [PATCH 2074/3948] added link for minmax_element.md --- reference/algorithm/minmax_element.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/reference/algorithm/minmax_element.md b/reference/algorithm/minmax_element.md index a82470b608..0ee0c506e8 100644 --- a/reference/algorithm/minmax_element.md +++ b/reference/algorithm/minmax_element.md @@ -79,7 +79,14 @@ int main() } ``` * std::minmax_element[color ff0000] - +* std::vector[link /reference/vector/vector.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] +* *i.first[link /reference/utility/pair/first.md] +* *i.second[link /reference/utility/pair/second.md] +* *j.first[link /reference/utility/pair/first.md] +* *j.second[link /reference/utility/pair/second.md] +* assert[link /reference/cassert/assert.md] ### 出力 ``` ``` From a0201a29e2f5149e292e8e4e5465208026ec9bbb Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 20:48:02 +0900 Subject: [PATCH 2075/3948] added link for minmax.md --- reference/algorithm/minmax.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/reference/algorithm/minmax.md b/reference/algorithm/minmax.md index 5737f9fcf8..08d3be4c54 100644 --- a/reference/algorithm/minmax.md +++ b/reference/algorithm/minmax.md @@ -96,7 +96,16 @@ int main() ``` * std::minmax[color ff0000] * std::greater[link /reference/functional/greater.md] - +* std::pair[link /reference/utility/pair.md] +* assert[link /reference/cassert/assert.md] +* result1.first[link /reference/utility/pair/first.md] +* result1.second[link /reference/utility/pair/second.md] +* result2.first[link /reference/utility/pair/first.md] +* result2.second[link /reference/utility/pair/second.md] +* result3.first[link /reference/utility/pair/first.md] +* result3.second[link /reference/utility/pair/second.md] +* result4.first[link /reference/utility/pair/first.md] +* result4.second[link /reference/utility/pair/second.md] ### 出力 ``` ``` From 639493b4798c55c0cb920a92e4fa1cf49b213601 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 20:49:48 +0900 Subject: [PATCH 2076/3948] added link for mismatch.md --- reference/algorithm/mismatch.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/reference/algorithm/mismatch.md b/reference/algorithm/mismatch.md index 0e8d63fdbe..c5f0372b60 100644 --- a/reference/algorithm/mismatch.md +++ b/reference/algorithm/mismatch.md @@ -147,6 +147,19 @@ int main() { ``` * std::mismatch[color ff0000] * std::to_string[link /reference/string/to_string.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] +* *p.first[link /reference/utility/pair/first.md] +* *p.second[link /reference/utility/pair/second.md] +* std::vector[link /reference/vector/vector.md] +* std::array[link /reference/array/array.md] +* std::list[link /reference/list/list.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] +* v2.begin[link /reference/array/array/begin.md] +* v2.end[link /reference/array/array/end.md] +* v3.begin[link /reference/list/list/begin.md] +* v3.end[link /reference/list/list/end.md] ### 出力 ``` From e6d780c1c9e83f3a51e4393ec90db3da941b2a64 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 20:51:52 +0900 Subject: [PATCH 2077/3948] added link for move_backward.md --- reference/algorithm/move_backward.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reference/algorithm/move_backward.md b/reference/algorithm/move_backward.md index 460289ed1d..450ba5552e 100644 --- a/reference/algorithm/move_backward.md +++ b/reference/algorithm/move_backward.md @@ -77,6 +77,10 @@ int main() { * std::move_backward[color ff0000] * v.emplace_back[link /reference/vector/vector/emplace_back.md] * std::move[link move.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] +* std::for_each[link /reference/algorithm/for_each.md] +* std::unique_ptr[link /reference/memory/unique_ptr.md] ### 出力 ``` From 4ec75f12446e309a9469dcd57edf9047724c900c Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 20:52:55 +0900 Subject: [PATCH 2078/3948] added link for move.md --- reference/algorithm/move.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/reference/algorithm/move.md b/reference/algorithm/move.md index a52904c38a..6100e30814 100644 --- a/reference/algorithm/move.md +++ b/reference/algorithm/move.md @@ -73,6 +73,17 @@ int main() { ``` * std::move[color ff0000] * v.emplace_back[link /reference/vector/vector/emplace_back.md] +* std::vector[link /reference/vector/vector.md] +* std::unique_ptr[link /reference/memory/unique_ptr.md] +* std::back_inserter[link /reference/iterator/back_inserter.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] +* std::for_each[link /reference/algorithm/for_each.md] +* v.emplace_back[link /reference/vector/vector/emplace_back.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] +* v2.begin[link /reference/vector/vector/begin.md] +* v2.end[link /reference/vector/vector/end.md] ### 出力 ``` From c1742218e63c0685234d5a4dbdb2e579f5c2436f Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 20:53:22 +0900 Subject: [PATCH 2079/3948] added link for next_permutation --- reference/algorithm/next_permutation.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reference/algorithm/next_permutation.md b/reference/algorithm/next_permutation.md index c1938dfe89..ec031899fc 100644 --- a/reference/algorithm/next_permutation.md +++ b/reference/algorithm/next_permutation.md @@ -81,6 +81,12 @@ int main () } ``` * std::next_permutation[color ff0000] +* std::vector[link /reference/vector/vector.md] +* std::for_each[link /reference/algorithm/for_each.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] ### 出力 ``` From d4002e221589f4e75c4eae966ae6f7b96c5b8924 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 20:53:59 +0900 Subject: [PATCH 2080/3948] added link for none_of.md --- reference/algorithm/none_of.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reference/algorithm/none_of.md b/reference/algorithm/none_of.md index 77520c8add..5de0d58530 100644 --- a/reference/algorithm/none_of.md +++ b/reference/algorithm/none_of.md @@ -68,6 +68,12 @@ int main() { } ``` * std::none_of[color ff0000] +* std::vector[link /reference/vector/vector.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] +* std::boolalpha[link /reference/ios/boolalpha.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] ### 出力 ``` From f304c110afedc8de3847a83d7d6dcb61b65ba4ec Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 20:54:25 +0900 Subject: [PATCH 2081/3948] added link for nth_element --- reference/algorithm/nth_element.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reference/algorithm/nth_element.md b/reference/algorithm/nth_element.md index 6c8890ac7b..8e01a8e686 100644 --- a/reference/algorithm/nth_element.md +++ b/reference/algorithm/nth_element.md @@ -86,6 +86,12 @@ int main() } ``` * std::nth_element[color ff0000] +* std::vector[link /reference/vector/vector.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] +* std::for_each[link /reference/algorithm/for_each.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] ### 出力例 ``` From 2daaf8c4aa37bc6a7343377d0b6eae4469e10538 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 20:54:51 +0900 Subject: [PATCH 2082/3948] added link for parital_sort_copy.md --- reference/algorithm/partial_sort_copy.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reference/algorithm/partial_sort_copy.md b/reference/algorithm/partial_sort_copy.md index f70f56d010..1edb30e81d 100644 --- a/reference/algorithm/partial_sort_copy.md +++ b/reference/algorithm/partial_sort_copy.md @@ -97,6 +97,12 @@ int main() * std::partial_sort_copy[color ff0000] * result.begin()[link /reference/vector/vector/begin.md] * result.end()[link /reference/vector/vector/end.md] +* std::vector[link /reference/vector/vector.md] +* std::v.begin[link /reference/vector/vector/begin.md] +* std::v.end[link /reference/vector/vector/end.md] +* std::for_each[link /reference/algorithm/for_each.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] ### 出力 ``` From 5488d9736c9c491b45ef681e0fd426ffc43d2b4f Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 20:55:20 +0900 Subject: [PATCH 2083/3948] added link for partial_sort.md --- reference/algorithm/partial_sort.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reference/algorithm/partial_sort.md b/reference/algorithm/partial_sort.md index 4c0d673366..6dfb6c1bac 100644 --- a/reference/algorithm/partial_sort.md +++ b/reference/algorithm/partial_sort.md @@ -85,6 +85,12 @@ int main() } ``` * std::partial_sort[color ff0000] +* std::vector[link /reference/vector/vector.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] +* std::for_each[link /reference/algorithm/for_each.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] ### 出力 ``` From fdb16779dffe4864b956101ec90d87c993467f19 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 20:56:10 +0900 Subject: [PATCH 2084/3948] added link for partition_copy.md --- reference/algorithm/partition_copy.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/reference/algorithm/partition_copy.md b/reference/algorithm/partition_copy.md index 7c9d56c799..681ce1508d 100644 --- a/reference/algorithm/partition_copy.md +++ b/reference/algorithm/partition_copy.md @@ -107,6 +107,15 @@ int main() } ``` * std::partition_copy[color ff0000] +* std::string[link /reference/string/string.md] +* std::vector[link /reference/vector/vector.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] +* std::for_each[link /reference/algorithm/for_each.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] +* std::back_inserter[link /reference/iterator/back_inserter.md] +* is_even[link /reference/algorithm/is_partitioned.md] ### 出力 ``` From 17a48cd5935d0ba76f852f94aed5cc0a9b46b1ff Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 20:56:50 +0900 Subject: [PATCH 2085/3948] added link for partition_point.md --- reference/algorithm/partition_point.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reference/algorithm/partition_point.md b/reference/algorithm/partition_point.md index c32df28146..a768044009 100644 --- a/reference/algorithm/partition_point.md +++ b/reference/algorithm/partition_point.md @@ -72,6 +72,12 @@ int main() ``` * std::partition_point[color ff0000] * std::partition[link partition.md] +* std::vector[link /reference/vector/vector.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] +* std::for_each[link /reference/algorithm/for_each.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] ### 出力 ``` From 463ba065a8cb65bdf1882e7fdc42be21a4f2ffc2 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 20:57:22 +0900 Subject: [PATCH 2086/3948] added link for partition.md --- reference/algorithm/partition.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reference/algorithm/partition.md b/reference/algorithm/partition.md index f58de2d53c..f7a849abf4 100644 --- a/reference/algorithm/partition.md +++ b/reference/algorithm/partition.md @@ -82,6 +82,12 @@ int main() } ``` * std::partition[color ff0000] +* std::vector[link /reference/vector/vector.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] +* std::for_each[link /reference/algorithm/for_each.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] ### 出力 ``` From 12233d70a4971cdfeeebc213ea69e359e714eb44 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 20:58:10 +0900 Subject: [PATCH 2087/3948] added link for pop_heap.md --- reference/algorithm/pop_heap.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reference/algorithm/pop_heap.md b/reference/algorithm/pop_heap.md index 56cb4179d6..018d1920a4 100644 --- a/reference/algorithm/pop_heap.md +++ b/reference/algorithm/pop_heap.md @@ -77,6 +77,12 @@ int main() * std::make_heap[link make_heap.md] * v.pop_back()[link /reference/vector/vector/pop_back.md] * std::sort_heap[link sort_heap.md] +* std::vector[link /reference/vector/vector.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] +* std::for_each[link /reference/algorithm/for_each.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] ### 出力 ``` From 1c5492355097d47613b7c4b7a280b752862522a3 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 20:58:40 +0900 Subject: [PATCH 2088/3948] added link for prev_permutation --- reference/algorithm/prev_permutation.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reference/algorithm/prev_permutation.md b/reference/algorithm/prev_permutation.md index dbdea5b985..7df7dfee4d 100644 --- a/reference/algorithm/prev_permutation.md +++ b/reference/algorithm/prev_permutation.md @@ -76,6 +76,12 @@ int main () } ``` * std::prev_permutation[color ff0000] +* std::vector[link /reference/vector/vector.md] +* std::for_each[link /reference/algorithm/for_each.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] ### 出力 ``` From fb0cc444ce62aae470f642133f312ba7d0d1c6f4 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 20:59:17 +0900 Subject: [PATCH 2089/3948] added link for push_heap.md --- reference/algorithm/push_heap.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reference/algorithm/push_heap.md b/reference/algorithm/push_heap.md index 3e1cdf5f7d..8635d1f6b1 100644 --- a/reference/algorithm/push_heap.md +++ b/reference/algorithm/push_heap.md @@ -78,6 +78,12 @@ int main() * std::make_heap[link make_heap.md] * v.push_back[link /reference/vector/vector/push_back.md] * std::sort_heap[link sort_heap.md] +* std::vector[link /reference/vector/vector.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] +* std::for_each[link /reference/algorithm/for_each.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] ### 出力 ``` From f991a36f7a93aee12e27bfb762782710c14a5050 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 21:00:11 +0900 Subject: [PATCH 2090/3948] added link for random_shuffle.md --- reference/algorithm/random_shuffle.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/reference/algorithm/random_shuffle.md b/reference/algorithm/random_shuffle.md index fc8e3c3329..41ab8bbe29 100644 --- a/reference/algorithm/random_shuffle.md +++ b/reference/algorithm/random_shuffle.md @@ -85,6 +85,14 @@ int main() { } ``` * std::random_shuffle[color ff0000] +* std::vector[link /reference/vector/vector.md] +* std::iota[link /reference/numeric/iota.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] +* std::ostream_iterator[link /reference/iterator/ostream_iterator.md] +* std::copy[link /reference/algorithm/copy.md] ### 出力 ``` From 736f5483f027bc460b84d53016cf7cfd4699a874 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 21:01:00 +0900 Subject: [PATCH 2091/3948] added link for ranges_adjacent_find.md --- reference/algorithm/ranges_adjacent_find.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reference/algorithm/ranges_adjacent_find.md b/reference/algorithm/ranges_adjacent_find.md index 03572230ec..5104248172 100644 --- a/reference/algorithm/ranges_adjacent_find.md +++ b/reference/algorithm/ranges_adjacent_find.md @@ -90,6 +90,12 @@ int main() { ``` * std::ranges::distance[link /reference/iterator/ranges_distance.md] * std::ranges::adjacent_find[color ff0000] +* std::vector[link /reference/vector/vector.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] +* std::boolalpha[link /reference/ios/boolalpha.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] ### 出力 ``` From c7a59d66a52fc87af2c6ede9077605e40b442bb3 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 21:01:48 +0900 Subject: [PATCH 2092/3948] added link for ranges_all_of.md --- reference/algorithm/ranges_all_of.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reference/algorithm/ranges_all_of.md b/reference/algorithm/ranges_all_of.md index d5e6dc2469..153ee9038d 100644 --- a/reference/algorithm/ranges_all_of.md +++ b/reference/algorithm/ranges_all_of.md @@ -69,6 +69,10 @@ int main() { } ``` * std::ranges::all_of[color ff0000] +* std::array[link /reference/array/array.md] +* std::cout[link /reference/iostream/cout.md] +* std::boolalpha[link /reference/ios/boolalpha.md] +* std::endl[link /reference/ostream/endl.md] ### 出力 ``` From 155cbfcb2eae255557bc8d633d6b6eb88943dd31 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 21:02:16 +0900 Subject: [PATCH 2093/3948] added link for ranges_any_of.md --- reference/algorithm/ranges_any_of.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reference/algorithm/ranges_any_of.md b/reference/algorithm/ranges_any_of.md index 72d7dc4f59..fc414ba926 100644 --- a/reference/algorithm/ranges_any_of.md +++ b/reference/algorithm/ranges_any_of.md @@ -71,6 +71,10 @@ int main() { } ``` * std::ranges::any_of[color ff0000] +* std::array[link /reference/array/array.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] +* std::boolalpha[link /reference/ios/boolalpha.md] ### 出力 ``` From fa9dc4a11744286fa6f40cf6de4ba29d6c99cce0 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 21:02:40 +0900 Subject: [PATCH 2094/3948] added link for ranges_binary_search.md --- reference/algorithm/ranges_binary_search.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reference/algorithm/ranges_binary_search.md b/reference/algorithm/ranges_binary_search.md index 7c950f41a6..3c84ad0894 100644 --- a/reference/algorithm/ranges_binary_search.md +++ b/reference/algorithm/ranges_binary_search.md @@ -124,6 +124,9 @@ int main() } ``` * std::ranges::binary_search[color ff0000] +* std::vector[link /reference/vector/vector.md] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] #### 出力 ``` From ee0aed9ebe49c32dab199c0616eb1028b0c78292 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 21:03:00 +0900 Subject: [PATCH 2095/3948] added link for ranges_clamp.md --- reference/algorithm/ranges_clamp.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reference/algorithm/ranges_clamp.md b/reference/algorithm/ranges_clamp.md index 8dbf408023..0dc75fdf93 100644 --- a/reference/algorithm/ranges_clamp.md +++ b/reference/algorithm/ranges_clamp.md @@ -46,6 +46,8 @@ int main() } ``` * std::ranges::clamp[color ff0000] +* std::cout[link /reference/iostream/cout.md] +* std::endl[link /reference/ostream/endl.md] ### 出力 ``` From 36ca2f5adc5fc57471213ee4abe2ecb509c61d80 Mon Sep 17 00:00:00 2001 From: suomesta Date: Mon, 7 Jul 2025 21:03:22 +0900 Subject: [PATCH 2096/3948] fix some typo regarding to ranges --- reference/algorithm/ranges_fold_right_last.md | 4 ++-- reference/algorithm/ranges_is_permutation.md | 2 +- reference/ranges/subrange/op_constructor.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/algorithm/ranges_fold_right_last.md b/reference/algorithm/ranges_fold_right_last.md index 1e15b1e59b..f191e60466 100644 --- a/reference/algorithm/ranges_fold_right_last.md +++ b/reference/algorithm/ranges_fold_right_last.md @@ -150,7 +150,7 @@ int main() { range auto rng = views::empty; auto op = std::plus<>{}; - auto res1 = fold_left(rng, -1, op); + auto res1 = fold_right(rng, -1, op); auto res2 = fold_right_last(rng, op); std::println("{:d}", res1); @@ -158,7 +158,7 @@ int main() { } ``` * fold_right_last[color ff0000] -* fold_left[link ranges_fold_right.md] +* fold_right[link ranges_fold_right.md] * println[link /reference/print/println.md] * value_or[link /reference/optional/optional/value_or.md] diff --git a/reference/algorithm/ranges_is_permutation.md b/reference/algorithm/ranges_is_permutation.md index 9ed6aa40c1..12f6a95e62 100644 --- a/reference/algorithm/ranges_is_permutation.md +++ b/reference/algorithm/ranges_is_permutation.md @@ -43,7 +43,7 @@ namespace std::ranges { ``` * forward_iterator[link /reference/iterator/forward_iterator.md] * sentinel_for[link /reference/iterator/sentinel_for.md] -* ranges::equal_to[link /reference/functional/ranges_less.md] +* ranges::equal_to[link /reference/functional/ranges_equal_to.md] * identity[link /reference/functional/identity.md] * indirect_equivalence_relation[link /reference/iterator/indirect_equivalence_relation.md] * projected[link /reference/iterator/projected.md] diff --git a/reference/ranges/subrange/op_constructor.md b/reference/ranges/subrange/op_constructor.md index 522eeffd58..401aef5496 100644 --- a/reference/ranges/subrange/op_constructor.md +++ b/reference/ranges/subrange/op_constructor.md @@ -109,7 +109,7 @@ int main() const std::ranges::subrange sub5(fwl, 3); // forward_listはsized_rangeではないが、長さを指定しているのでsubrangeはsized_rangeとなり、sizeメンバ関数が定義される static_assert(std::ranges::sized_range); - assert(sub4.size() == 3); + assert(sub5.size() == 3); } ``` From 4d7a6b8da994f5634c7ac5adf5f65cf3288d0de5 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 21:03:43 +0900 Subject: [PATCH 2097/3948] added link for ranges_contains_subrange.md --- reference/algorithm/ranges_contains_subrange.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reference/algorithm/ranges_contains_subrange.md b/reference/algorithm/ranges_contains_subrange.md index 9be4d01fe9..4baeea43b7 100644 --- a/reference/algorithm/ranges_contains_subrange.md +++ b/reference/algorithm/ranges_contains_subrange.md @@ -58,6 +58,9 @@ int main() { } ``` * std::ranges::contains_subrange[color ff0000] +* std::vector[link /reference/vector/vector.md] +* std::list[link /reference/list/list.md] +* std::println[link /reference/print/println.md] #### 出力 ``` From 19f065b9b1537d04c29b9b56eb63ef24060c655c Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 21:07:08 +0900 Subject: [PATCH 2098/3948] fixed code_qualify errors --- reference/algorithm/max_element.md | 2 -- reference/algorithm/min_element.md | 10 ++++------ reference/algorithm/mismatch.md | 1 - reference/algorithm/partial_sort_copy.md | 4 ++-- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/reference/algorithm/max_element.md b/reference/algorithm/max_element.md index 1aec717323..1655be9b84 100644 --- a/reference/algorithm/max_element.md +++ b/reference/algorithm/max_element.md @@ -73,8 +73,6 @@ int main() * std::max_element[color ff0000] * std::vector[link /reference/vector/vector.md] * std::pair[link /reference/utility/pair.md] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] * v1.begin[link /reference/vector/vector/begin.md] * v1.end[link /reference/vector/vector/end.md] * v2.begin[link /reference/vector/vector/begin.md] diff --git a/reference/algorithm/min_element.md b/reference/algorithm/min_element.md index 8d9084ea96..a546f97c24 100644 --- a/reference/algorithm/min_element.md +++ b/reference/algorithm/min_element.md @@ -71,13 +71,11 @@ int main() ``` * std::min_element[color ff0000] * std::vector[link /reference/vector/vector.md] -* std::v1.begin[link /reference/vector/vector/begin.md] -* std::v1.end[link /reference/vector/vector/end.md] -* std::v2.begin[link /reference/vector/vector/begin.md] -* std::v2.end[link /reference/vector/vector/end.md] +* v1.begin[link /reference/vector/vector/begin.md] +* v1.end[link /reference/vector/vector/end.md] +* v2.begin[link /reference/vector/vector/begin.md] +* v2.end[link /reference/vector/vector/end.md] * std::pair[link /reference/utility/pair.md] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] * assert[link /reference/cassert/assert.md] * v2_min_element->first[link /reference/utility/pair/first.md] * v2_min_element->second[link /reference/utility/pair/second.md] diff --git a/reference/algorithm/mismatch.md b/reference/algorithm/mismatch.md index c5f0372b60..92efc3047f 100644 --- a/reference/algorithm/mismatch.md +++ b/reference/algorithm/mismatch.md @@ -157,7 +157,6 @@ int main() { * v.begin[link /reference/vector/vector/begin.md] * v.end[link /reference/vector/vector/end.md] * v2.begin[link /reference/array/array/begin.md] -* v2.end[link /reference/array/array/end.md] * v3.begin[link /reference/list/list/begin.md] * v3.end[link /reference/list/list/end.md] diff --git a/reference/algorithm/partial_sort_copy.md b/reference/algorithm/partial_sort_copy.md index 1edb30e81d..84978e8125 100644 --- a/reference/algorithm/partial_sort_copy.md +++ b/reference/algorithm/partial_sort_copy.md @@ -98,8 +98,8 @@ int main() * result.begin()[link /reference/vector/vector/begin.md] * result.end()[link /reference/vector/vector/end.md] * std::vector[link /reference/vector/vector.md] -* std::v.begin[link /reference/vector/vector/begin.md] -* std::v.end[link /reference/vector/vector/end.md] +* v.begin[link /reference/vector/vector/begin.md] +* v.end[link /reference/vector/vector/end.md] * std::for_each[link /reference/algorithm/for_each.md] * std::cout[link /reference/iostream/cout.md] * std::endl[link /reference/ostream/endl.md] From ba2b72c41b4522c0d896111dc9ce9ee4bddea9ea Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 21:13:12 +0900 Subject: [PATCH 2099/3948] fixed inner-link errors --- reference/algorithm/lexicographical_compare.md | 2 +- .../lexicographical_compare_three_way.md | 14 +++++++------- reference/algorithm/lower_bound.md | 2 +- reference/algorithm/min_element.md | 4 ++-- reference/algorithm/minmax.md | 16 ++++++++-------- reference/algorithm/minmax_element.md | 8 ++++---- reference/algorithm/mismatch.md | 4 ++-- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/reference/algorithm/lexicographical_compare.md b/reference/algorithm/lexicographical_compare.md index 8bbeb701af..b578892c0d 100644 --- a/reference/algorithm/lexicographical_compare.md +++ b/reference/algorithm/lexicographical_compare.md @@ -139,7 +139,7 @@ int main() * std::greater[link /reference/functional/greater.md] * std::cout[link /reference/iostream/cout.md] * std::endl[link /reference/ostream/endl.md] -* std::string[link /reference/string/string.md] +* std::string[link /reference/string/string.md.nolink] ### 出力 ``` diff --git a/reference/algorithm/lexicographical_compare_three_way.md b/reference/algorithm/lexicographical_compare_three_way.md index 9a1253cdbb..690959da12 100644 --- a/reference/algorithm/lexicographical_compare_three_way.md +++ b/reference/algorithm/lexicographical_compare_three_way.md @@ -115,18 +115,18 @@ int main() { } ``` * std::lexicographical_compare_three_way[color ff0000] -* std::string[link /reference/string/string.md] +* std::string[link /reference/string/string.md.nolink] * std::cout[link /reference/iostream/cout.md] * std::endl[link /reference/ostream/endl.md] * std::isalpha[link /reference/cctype/isalpha.md] * std::tolower[link /reference/cctype/tolower.md] * weak_ordering[link /reference/compare/weak_ordering.md] -* str1.begin[link /reference/string/string/begin.md] -* str1.end[link /reference/string/string/end.md] -* str2.begin[link /reference/string/string/begin.md] -* str2.end[link /reference/string/string/end.md] -* str3.begin[link /reference/string/string/begin.md] -* str3.end[link /reference/string/string/end.md] +* str1.begin[link /reference/string/string/begin.md.nolink] +* str1.end[link /reference/string/string/end.md.nolink] +* str2.begin[link /reference/string/string/begin.md.nolink] +* str2.end[link /reference/string/string/end.md.nolink] +* str3.begin[link /reference/string/string/begin.md.nolink] +* str3.end[link /reference/string/string/end.md.nolink] ### 出力例 ``` diff --git a/reference/algorithm/lower_bound.md b/reference/algorithm/lower_bound.md index 6416d9fb10..129c38ab98 100644 --- a/reference/algorithm/lower_bound.md +++ b/reference/algorithm/lower_bound.md @@ -176,7 +176,7 @@ int main() } ``` * std::lower_bound[color ff0000] -* std::string[link /reference/string/string.md] +* std::string[link /reference/string/string.md.nolink] * std::vector[link /reference/vector/vector.md] * v.begin[link /reference/vector/vector/begin.md] * v.end[link /reference/vector/vector/end.md] diff --git a/reference/algorithm/min_element.md b/reference/algorithm/min_element.md index a546f97c24..84c1329976 100644 --- a/reference/algorithm/min_element.md +++ b/reference/algorithm/min_element.md @@ -77,8 +77,8 @@ int main() * v2.end[link /reference/vector/vector/end.md] * std::pair[link /reference/utility/pair.md] * assert[link /reference/cassert/assert.md] -* v2_min_element->first[link /reference/utility/pair/first.md] -* v2_min_element->second[link /reference/utility/pair/second.md] +* v2_min_element->first[link /reference/utility/pair/first.md.nolink] +* v2_min_element->second[link /reference/utility/pair/second.md.nolink] ### 出力 ``` diff --git a/reference/algorithm/minmax.md b/reference/algorithm/minmax.md index 08d3be4c54..ee70312b16 100644 --- a/reference/algorithm/minmax.md +++ b/reference/algorithm/minmax.md @@ -98,14 +98,14 @@ int main() * std::greater[link /reference/functional/greater.md] * std::pair[link /reference/utility/pair.md] * assert[link /reference/cassert/assert.md] -* result1.first[link /reference/utility/pair/first.md] -* result1.second[link /reference/utility/pair/second.md] -* result2.first[link /reference/utility/pair/first.md] -* result2.second[link /reference/utility/pair/second.md] -* result3.first[link /reference/utility/pair/first.md] -* result3.second[link /reference/utility/pair/second.md] -* result4.first[link /reference/utility/pair/first.md] -* result4.second[link /reference/utility/pair/second.md] +* result1.first[link /reference/utility/pair/first.md.nolink] +* result1.second[link /reference/utility/pair/second.md.nolink] +* result2.first[link /reference/utility/pair/first.md.nolink] +* result2.second[link /reference/utility/pair/second.md.nolink] +* result3.first[link /reference/utility/pair/first.md.nolink] +* result3.second[link /reference/utility/pair/second.md.nolink] +* result4.first[link /reference/utility/pair/first.md.nolink] +* result4.second[link /reference/utility/pair/second.md.nolink] ### 出力 ``` ``` diff --git a/reference/algorithm/minmax_element.md b/reference/algorithm/minmax_element.md index 0ee0c506e8..86607b820f 100644 --- a/reference/algorithm/minmax_element.md +++ b/reference/algorithm/minmax_element.md @@ -82,10 +82,10 @@ int main() * std::vector[link /reference/vector/vector.md] * v.begin[link /reference/vector/vector/begin.md] * v.end[link /reference/vector/vector/end.md] -* *i.first[link /reference/utility/pair/first.md] -* *i.second[link /reference/utility/pair/second.md] -* *j.first[link /reference/utility/pair/first.md] -* *j.second[link /reference/utility/pair/second.md] +* *i.first[link /reference/utility/pair/first.md.nolink] +* *i.second[link /reference/utility/pair/second.md.nolink] +* *j.first[link /reference/utility/pair/first.md.nolink] +* *j.second[link /reference/utility/pair/second.md.nolink] * assert[link /reference/cassert/assert.md] ### 出力 ``` diff --git a/reference/algorithm/mismatch.md b/reference/algorithm/mismatch.md index 92efc3047f..a437dbad0a 100644 --- a/reference/algorithm/mismatch.md +++ b/reference/algorithm/mismatch.md @@ -149,8 +149,8 @@ int main() { * std::to_string[link /reference/string/to_string.md] * std::cout[link /reference/iostream/cout.md] * std::endl[link /reference/ostream/endl.md] -* *p.first[link /reference/utility/pair/first.md] -* *p.second[link /reference/utility/pair/second.md] +* *p.first[link /reference/utility/pair/first.md.nolink] +* *p.second[link /reference/utility/pair/second.md.nolink] * std::vector[link /reference/vector/vector.md] * std::array[link /reference/array/array.md] * std::list[link /reference/list/list.md] From cb305c1ad16b38a955cb1eba1dcdba60005abf0d Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 7 Jul 2025 21:14:20 +0900 Subject: [PATCH 2100/3948] fixed inner-link errors --- reference/algorithm/partition_copy.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/algorithm/partition_copy.md b/reference/algorithm/partition_copy.md index 681ce1508d..e49a0ec950 100644 --- a/reference/algorithm/partition_copy.md +++ b/reference/algorithm/partition_copy.md @@ -107,7 +107,7 @@ int main() } ``` * std::partition_copy[color ff0000] -* std::string[link /reference/string/string.md] +* std::string[link /reference/string/string.md.nolink] * std::vector[link /reference/vector/vector.md] * std::cout[link /reference/iostream/cout.md] * std::endl[link /reference/ostream/endl.md] From 443e16eaaa078da9366270aef4d386e1b0ceee70 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Mon, 7 Jul 2025 21:35:36 +0900 Subject: [PATCH 2101/3948] =?UTF-8?q?=E6=96=87=E6=B3=95=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixes #1463 --- reference/cstdlib/calloc.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/reference/cstdlib/calloc.md b/reference/cstdlib/calloc.md index e0d1d7222e..ef15785803 100644 --- a/reference/cstdlib/calloc.md +++ b/reference/cstdlib/calloc.md @@ -16,15 +16,15 @@ namespace std { この関数で返されるポインタは、割当領域の先頭のポインタである。 -領域が割り当てられない場合は、[`nullptr`](/lang/cpp11/nullptr.md)を返す。 +領域の確保に失敗した場合は、[`nullptr`](/lang/cpp11/nullptr.md)を返す。 -割り当てられたオブジェクトの寿命は、このメモリが割り当てられてられた時から、[`free`](free.md.nolink)などで解放されるまでである。 +割り当てられたオブジェクトの寿命は、このメモリが割り当てられた時から、[`free`](free.md.nolink)などで解放されるまでである。 -この関数は、静的ストレージにはアクセスしない、スレッドセーフである。 +この関数は、静的ストレージにはアクセスせず、スレッドセーフである。 ## 備考 -- `calloc`、`malloc`および `realloc`関数による連続的なメモリ確保によるメモリの割当の順序、連続性は不定である。 +- `calloc`・`malloc`・`realloc` によって確保されたメモリの連続性や順序は保証されない。 - メモリリークを避けるため、この関数で確保したメモリは、`free`などを使い、メモリ解放するべきである。 @@ -36,7 +36,7 @@ namespace std { int main(void) { - int* p1 = calloc(4, sizeof(int)); // 4個のint配列のポインタを確保、0二初期化 + int* p1 = calloc(4, sizeof(int)); // 4個のint配列のポインタを確保、0に初期化 int* p2 = calloc(1, sizeof(int[4])); // 上と同じ int* p3 = calloc(4, sizeof *p3); // 上と同じ From 8233b0ac1307817793277d7a9a163166f33cd11b Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Mon, 7 Jul 2025 22:05:09 +0900 Subject: [PATCH 2102/3948] new page `cstdlib/free` --- reference/cstdlib/free.md | 49 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 reference/cstdlib/free.md diff --git a/reference/cstdlib/free.md b/reference/cstdlib/free.md new file mode 100644 index 0000000000..5c36452ff4 --- /dev/null +++ b/reference/cstdlib/free.md @@ -0,0 +1,49 @@ +# free +* cstdlib[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +namespace std { + void free( void *ptr ); +} +``` + +## 概要 +`malloc()`、`calloc()`、`aligned_alloc`、`realloc`で確保されたメモリ領域を解放する。 + +もし上記の4つの関数で渡されたポインタ以外をこの関数の引数にした場合は、未定義動作となる。 + +また、渡されたメモリがすでに解放されている場合も、未定義動作となる。 + +ポインタが`nullptr`の場合、この関数は何も実行しない。 + +解放されたポインタに再びアクセスする場合、未定義動作を引き起こす恐れがある。 + +## 備考 +この関数はスレッドセーフである。 + +## 実装例 +```cpp example +int main(void) +{ + int *p1 = malloc(10*sizeof *p1); + free(p1); // p1のメモリを解放 + + int *p2 = calloc(10, sizeof *p2); + int *p3 = realloc(p2, 1000*sizeof *p3); + if(p3) + free(p3);//p2は`null`ではないので、p3が解放される。 + else + free(p2); +} +``` +### 出力結果 +``` +``` + +## 関連項目 +- [`aligned_alloc`](aligned_alloc.md):指定したアライメントでメモリを確保する +- [`malloc`](malloc.md):メモリを確保する +- [`calloc`](calloc.md):メモリを確保する(0で初期化する) +- [`realloc`](realloc.md.nolink):メモリを再確保する From 272f47f45ee5ab17318aa92cd5319a71cd41c179 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Mon, 7 Jul 2025 22:06:00 +0900 Subject: [PATCH 2103/3948] fixed `cstdlib/free` --- reference/cstdlib/free.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/reference/cstdlib/free.md b/reference/cstdlib/free.md index 5c36452ff4..fd1dc695a9 100644 --- a/reference/cstdlib/free.md +++ b/reference/cstdlib/free.md @@ -5,16 +5,14 @@ ```cpp namespace std { - void free( void *ptr ); + void free(void* ptr) noexcept; } ``` ## 概要 -`malloc()`、`calloc()`、`aligned_alloc`、`realloc`で確保されたメモリ領域を解放する。 +`malloc`、`calloc`、`aligned_alloc`、`realloc`で確保されたメモリ領域を解放する。 -もし上記の4つの関数で渡されたポインタ以外をこの関数の引数にした場合は、未定義動作となる。 - -また、渡されたメモリがすでに解放されている場合も、未定義動作となる。 +解放済みのポインタを再度 `free` に渡したり、アクセスしたりすると未定義動作となる。 ポインタが`nullptr`の場合、この関数は何も実行しない。 @@ -33,13 +31,14 @@ int main(void) int *p2 = calloc(10, sizeof *p2); int *p3 = realloc(p2, 1000*sizeof *p3); if(p3) - free(p3);//p2は`null`ではないので、p3が解放される。 + free(p3); // realloc により新しい領域が確保された場合、それを解放 else - free(p2); + free(p2); // realloc が失敗した場合は元の領域を解放 } ``` ### 出力結果 ``` + ``` ## 関連項目 From c57731f3c6ca91c9f2f744b73f9f49de089d5753 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Mon, 7 Jul 2025 22:06:15 +0900 Subject: [PATCH 2104/3948] add path to `free` in `cstdlib.md` --- reference/cstdlib.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdlib.md b/reference/cstdlib.md index 6eeb74778c..58f0765e8c 100644 --- a/reference/cstdlib.md +++ b/reference/cstdlib.md @@ -43,7 +43,7 @@ | [`malloc`](cstdlib/malloc.md) | メモリを確保する (function) | | | [`calloc`](cstdlib/calloc.md) | メモリを確保し、領域をゼロ初期化する (function) | | | [`realloc`](cstdlib/realloc.md.nolink) | メモリを再確保する (function) | | -| [`free`](cstdlib/free.md.nolink) | 確保したメモリを解放する (function) | | +| [`free`](cstdlib/free.md) | 確保したメモリを解放する (function) | | ## プログラムの開始と終了 From 6eddf2fab70c28d4c17ef4f5c49c0dbd2187b8c3 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Mon, 7 Jul 2025 22:07:28 +0900 Subject: [PATCH 2105/3948] delete .nolink in `free` path --- reference/cstdlib/calloc.md | 6 +++--- reference/cstdlib/malloc.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/cstdlib/calloc.md b/reference/cstdlib/calloc.md index ef15785803..8defdcecbc 100644 --- a/reference/cstdlib/calloc.md +++ b/reference/cstdlib/calloc.md @@ -16,9 +16,9 @@ namespace std { この関数で返されるポインタは、割当領域の先頭のポインタである。 -領域の確保に失敗した場合は、[`nullptr`](/lang/cpp11/nullptr.md)を返す。 +領域の確保に失敗し た場合は、[`nullptr`](/lang/cpp11/nullptr.md)を返す。 -割り当てられたオブジェクトの寿命は、このメモリが割り当てられた時から、[`free`](free.md.nolink)などで解放されるまでである。 +割り当てられたオブジェクトの寿命は、このメモリが割り当てられた時から、[`free`](free.md)などで解放されるまでである。 この関数は、静的ストレージにはアクセスせず、スレッドセーフである。 @@ -63,7 +63,7 @@ p2[3] == 0 ## 関連項目 -- `free`:確保されたメモリを解放する。 +- [`free`](free.md):確保されたメモリを解放する。 ## 参照 diff --git a/reference/cstdlib/malloc.md b/reference/cstdlib/malloc.md index 540ece0054..98990cf859 100644 --- a/reference/cstdlib/malloc.md +++ b/reference/cstdlib/malloc.md @@ -70,7 +70,7 @@ p1[3] == 9 ## 関連項目 -- [`free`](/cstdlib/free.md.nolink): 確保したメモリを解放する。 +- [`free`](/cstdlib/free.md): 確保したメモリを解放する。 ## 参照 From f11509601cfac4c7730f3cf113d2308ec8acfd6f Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Mon, 7 Jul 2025 22:10:21 +0900 Subject: [PATCH 2106/3948] =?UTF-8?q?=E6=96=87=E6=B3=95=E3=81=AE=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/calloc.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdlib/calloc.md b/reference/cstdlib/calloc.md index 8defdcecbc..c370b8ad17 100644 --- a/reference/cstdlib/calloc.md +++ b/reference/cstdlib/calloc.md @@ -24,7 +24,7 @@ namespace std { ## 備考 -- `calloc`・`malloc`・`realloc` によって確保されたメモリの連続性や順序は保証されない。 +- `calloc`・`malloc`・`realloc` によって複数個の異なる領域が確保された場合、それらの連続性や順序は保証されない。 - メモリリークを避けるため、この関数で確保したメモリは、`free`などを使い、メモリ解放するべきである。 From f189c2260e14694f7db6fbb34b27cc00006d27e8 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Mon, 7 Jul 2025 22:12:57 +0900 Subject: [PATCH 2107/3948] =?UTF-8?q?=E6=96=87=E6=B3=95=E3=81=AE=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/free.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdlib/free.md b/reference/cstdlib/free.md index fd1dc695a9..389c2fbb8b 100644 --- a/reference/cstdlib/free.md +++ b/reference/cstdlib/free.md @@ -12,7 +12,7 @@ namespace std { ## 概要 `malloc`、`calloc`、`aligned_alloc`、`realloc`で確保されたメモリ領域を解放する。 -解放済みのポインタを再度 `free` に渡したり、アクセスしたりすると未定義動作となる。 +解放済みのポインタを再度 `free` に渡したり、アクセスしたりするときの動作は未定義となる。 ポインタが`nullptr`の場合、この関数は何も実行しない。 From 6ba8c53818059f2d2de201eb3f02d9b58e0d65be Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Mon, 7 Jul 2025 22:15:06 +0900 Subject: [PATCH 2108/3948] =?UTF-8?q?`free.md`=E3=81=AE=E3=83=91=E3=82=B9?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/malloc.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdlib/malloc.md b/reference/cstdlib/malloc.md index 98990cf859..6820bc78f5 100644 --- a/reference/cstdlib/malloc.md +++ b/reference/cstdlib/malloc.md @@ -70,7 +70,7 @@ p1[3] == 9 ## 関連項目 -- [`free`](/cstdlib/free.md): 確保したメモリを解放する。 +- [`free`](free.md): 確保したメモリを解放する。 ## 参照 From 39b99d1b9628accc8ddb71e9e2f08be4359ac926 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Mon, 7 Jul 2025 22:38:46 +0900 Subject: [PATCH 2109/3948] =?UTF-8?q?flat=E3=81=AA=E3=82=B3=E3=83=B3?= =?UTF-8?q?=E3=83=86=E3=83=8A=E3=81=AEinsert()=E3=81=AE=E8=A8=88=E7=AE=97?= =?UTF-8?q?=E9=87=8F=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map/insert.md | 5 +++-- reference/flat_map/flat_multimap/insert.md | 5 +++-- reference/flat_set/flat_multiset/insert.md | 5 +++-- reference/flat_set/flat_set/insert.md | 5 +++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/reference/flat_map/flat_map/insert.md b/reference/flat_map/flat_map/insert.md index a4ce80b3fd..f83c8ca4e8 100644 --- a/reference/flat_map/flat_map/insert.md +++ b/reference/flat_map/flat_map/insert.md @@ -50,8 +50,6 @@ void insert(sorted_unique_t s, 内部的に `flat_map` コンテナは、コンストラクト時に指定された比較オブジェクトによって要素を下位から上位へとソートして保持する。 -この操作は、適切な引数 `position` を提供することで効率を飛躍的に改善することができる。 - - (1) : 単一要素を挿入する - (2) : 単一要素の一時オブジェクトを挿入する - (3) : 指定された位置に、単一要素を挿入する @@ -198,8 +196,11 @@ void insert(sorted_unique_t s, ## 計算量 +- (1)~(6) : コンテナサイズ([`size()`](size.md))に対して線形 - (7) : Nをこの操作の前の[`size()`](size.md)、Mを[`distance`](/reference/iterator/distance.md)`(first, last)`として、N + MlogM - (8) : Nをこの操作のあとの[`size()`](size.md)として、Nに対して線形 +- (9) : Nをこの操作の前の[`size()`](size.md)、Mを`il.size()`として、N + MlogM +- (10) : Nをこの操作のあとの[`size()`](size.md)として、Nに対して線形 ## 備考 diff --git a/reference/flat_map/flat_multimap/insert.md b/reference/flat_map/flat_multimap/insert.md index 08e944b5fc..4f8ebed9f0 100644 --- a/reference/flat_map/flat_multimap/insert.md +++ b/reference/flat_map/flat_multimap/insert.md @@ -45,8 +45,6 @@ void insert(sorted_equivalent_t, 内部的に `flat_multimap` コンテナは、コンストラクト時に指定された比較オブジェクトによって要素を下位から上位へとソートして保持する。 -この操作は、適切な引数 `position` を提供することで効率を飛躍的に改善することができる。 - - (1) : 単一要素を挿入する - (2) : 単一要素の一時オブジェクトを挿入する - (3) : 指定された位置に、単一要素を挿入する @@ -158,8 +156,11 @@ void insert(sorted_equivalent_t, ## 計算量 +- (1)~(6) : コンテナサイズ([`size()`](size.md))に対して線形 - (7) : Nをこの操作の前の[`size()`](size.md)、Mを[`distance`](/reference/iterator/distance.md)`(first, last)`として、N + MlogM - (8) : Nをこの操作のあとの[`size()`](size.md)として、Nに対して線形 +- (9) : Nをこの操作の前の[`size()`](size.md)、Mを`il.size()`として、N + MlogM +- (10) : Nをこの操作のあとの[`size()`](size.md)として、Nに対して線形 ## 備考 diff --git a/reference/flat_set/flat_multiset/insert.md b/reference/flat_set/flat_multiset/insert.md index 58985f98d4..14294b61e2 100644 --- a/reference/flat_set/flat_multiset/insert.md +++ b/reference/flat_set/flat_multiset/insert.md @@ -45,8 +45,6 @@ void insert(sorted_equivalent_t, 内部的に `flat_multiset` コンテナは、コンストラクト時に指定された比較オブジェクトによって要素を下位から上位へとソートして保持する。 -この操作は、適切な引数 `position` を提供することで効率を飛躍的に改善することができる。 - - (1) : 単一要素を挿入する - (2) : 単一要素の一時オブジェクトを挿入する - (3) : 指定された位置に、単一要素を挿入する @@ -148,8 +146,11 @@ void insert(sorted_equivalent_t, ## 計算量 +- (1)~(6) : コンテナサイズ([`size()`](size.md))に対して線形 - (7) : Nをこの操作の前の[`size()`](size.md)、Mを[`distance`](/reference/iterator/distance.md)`(first, last)`として、N + MlogM - (8) : Nをこの操作のあとの[`size()`](size.md)として、Nに対して線形 +- (9) : Nをこの操作の前の[`size()`](size.md)、Mを`il.size()`として、N + MlogM +- (10) : Nをこの操作のあとの[`size()`](size.md)として、Nに対して線形 ## 備考 diff --git a/reference/flat_set/flat_set/insert.md b/reference/flat_set/flat_set/insert.md index 02134d89c0..2096a7078f 100644 --- a/reference/flat_set/flat_set/insert.md +++ b/reference/flat_set/flat_set/insert.md @@ -50,8 +50,6 @@ void insert(sorted_unique_t s, 内部的に `flat_set` コンテナは、コンストラクト時に指定された比較オブジェクトによって要素を下位から上位へとソートして保持する。 -この操作は、適切な引数 `position` を提供することで効率を飛躍的に改善することができる。 - - (1) : 単一要素を挿入する - (2) : 単一要素の一時オブジェクトを挿入する - (3) : 指定された位置に、単一要素を挿入する @@ -160,8 +158,11 @@ void insert(sorted_unique_t s, ## 計算量 +- (1)~(6) : コンテナサイズ([`size()`](size.md))に対して線形 - (7) : Nをこの操作の前の[`size()`](size.md)、Mを[`distance`](/reference/iterator/distance.md)`(first, last)`として、N + MlogM - (8) : Nをこの操作のあとの[`size()`](size.md)として、Nに対して線形 +- (9) : Nをこの操作の前の[`size()`](size.md)、Mを`il.size()`として、N + MlogM +- (10) : Nをこの操作のあとの[`size()`](size.md)として、Nに対して線形 ## 備考 From 1b8a7cdc159a3c9475930fb8d215f8c9522c0b6b Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Mon, 7 Jul 2025 13:40:35 +0000 Subject: [PATCH 2110/3948] =?UTF-8?q?=E5=87=BA=E5=8A=9B=E7=B5=90=E6=9E=9C?= =?UTF-8?q?=E2=88=92=EF=BC=9E=E5=87=BA=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/free.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdlib/free.md b/reference/cstdlib/free.md index 389c2fbb8b..8d785c8089 100644 --- a/reference/cstdlib/free.md +++ b/reference/cstdlib/free.md @@ -36,7 +36,7 @@ int main(void) free(p2); // realloc が失敗した場合は元の領域を解放 } ``` -### 出力結果 +### 出力 ``` ``` From 42b481a53ba309965dac7fc99cea47367bc13098 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Mon, 7 Jul 2025 23:29:20 +0900 Subject: [PATCH 2111/3948] =?UTF-8?q?flat=E3=81=AA=E3=82=B3=E3=83=B3?= =?UTF-8?q?=E3=83=86=E3=83=8A=E3=81=AEemplace/=5Fhint=E3=81=AE=E8=A8=88?= =?UTF-8?q?=E7=AE=97=E9=87=8F=E8=BF=BD=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map/emplace.md | 6 ++++++ reference/flat_map/flat_map/emplace_hint.md | 2 +- reference/flat_map/flat_multimap/emplace.md | 3 +++ reference/flat_map/flat_multimap/emplace_hint.md | 2 +- reference/flat_set/flat_multiset/emplace.md | 3 +++ reference/flat_set/flat_multiset/emplace_hint.md | 2 +- reference/flat_set/flat_set/emplace.md | 6 ++++++ reference/flat_set/flat_set/emplace_hint.md | 2 +- 8 files changed, 22 insertions(+), 4 deletions(-) diff --git a/reference/flat_map/flat_map/emplace.md b/reference/flat_map/flat_map/emplace.md index 155d95fdca..fbb790e476 100644 --- a/reference/flat_map/flat_map/emplace.md +++ b/reference/flat_map/flat_map/emplace.md @@ -44,6 +44,12 @@ c.values.insert(value_it, std::move(t.second)); ## 戻り値 挿入されたかどうかを示す `bool` と、挿入された要素へのイテレータからなる [`pair`](/reference/utility/pair.md) を返す。挿入されなかったときは、既存要素へのイテレータを返す。 +## 計算量 + +操作の前のコンテナサイズ([`size()`](size.md))を`N`とすると + +- 新しい要素が挿入された場合: `N`に対して線形 +- 要素の挿入が行われなかった場合: `N`に対して対数 ## 例 ### 単純なキー・値を挿入する例 diff --git a/reference/flat_map/flat_map/emplace_hint.md b/reference/flat_map/flat_map/emplace_hint.md index 193f6698c4..de5263167d 100644 --- a/reference/flat_map/flat_map/emplace_hint.md +++ b/reference/flat_map/flat_map/emplace_hint.md @@ -24,8 +24,8 @@ iterator emplace_hint(const_iterator hint, Args&&... args); ## 計算量 -一般にコンテナのサイズについて対数時間だが、新しい要素が `hint` の前に挿入された場合は償却定数時間。 +操作の前のコンテナサイズ([`size()`](size.md))を`N`とすると、`O(N)`(挿入が行われなかった場合は`O(log N)`より小さくなる可能性がある)。 ## 備考 - [`try_emplace`](try_emplace.md) と異なり、たとえ要素が挿入されなかった場合でも `value_type` 型のオブジェクトが構築される可能性があり、結果として引数 `args` が [`move`](/reference/utility/move.md) の対象となって変更されてしまっている可能性があるため、注意が必要である。 diff --git a/reference/flat_map/flat_multimap/emplace.md b/reference/flat_map/flat_multimap/emplace.md index b82cd98d58..e9ac1748aa 100644 --- a/reference/flat_map/flat_multimap/emplace.md +++ b/reference/flat_map/flat_multimap/emplace.md @@ -25,6 +25,9 @@ iterator emplace(Args&&... args); ## 戻り値 挿入された要素へのイテレータを返す。 +## 計算量 + +コンテナサイズ([`size()`](size.md))に対して線形 ## 例 ```cpp example diff --git a/reference/flat_map/flat_multimap/emplace_hint.md b/reference/flat_map/flat_multimap/emplace_hint.md index 8bc40631b9..019c1a2659 100644 --- a/reference/flat_map/flat_multimap/emplace_hint.md +++ b/reference/flat_map/flat_multimap/emplace_hint.md @@ -24,8 +24,8 @@ iterator emplace_hint(const_iterator hint, Args&&... args); ## 計算量 -一般にコンテナのサイズについて対数時間だが、新しい要素が `hint` の前に挿入された場合は償却定数時間。 +コンテナサイズ([`size()`](size.md))に対して線形 ## 例 ```cpp example diff --git a/reference/flat_set/flat_multiset/emplace.md b/reference/flat_set/flat_multiset/emplace.md index 02e7feb99d..c6609212db 100644 --- a/reference/flat_set/flat_multiset/emplace.md +++ b/reference/flat_set/flat_multiset/emplace.md @@ -25,6 +25,9 @@ iterator emplace(Args&&... args); ## 戻り値 挿入された要素へのイテレータを返す。 +## 計算量 + +コンテナサイズ([`size()`](size.md))に対して線形 ## 例 ### 単純な挿入の例 diff --git a/reference/flat_set/flat_multiset/emplace_hint.md b/reference/flat_set/flat_multiset/emplace_hint.md index acaa292836..46e96497cf 100644 --- a/reference/flat_set/flat_multiset/emplace_hint.md +++ b/reference/flat_set/flat_multiset/emplace_hint.md @@ -24,8 +24,8 @@ iterator emplace_hint(const_iterator hint, Args&&... args); ## 計算量 -一般にコンテナのサイズについて対数時間だが、新しい要素が `hint` の前に挿入された場合は償却定数時間。 +コンテナサイズ([`size()`](size.md))に対して線形 ## 例 ```cpp example diff --git a/reference/flat_set/flat_set/emplace.md b/reference/flat_set/flat_set/emplace.md index 7378406a27..abd530ea24 100644 --- a/reference/flat_set/flat_set/emplace.md +++ b/reference/flat_set/flat_set/emplace.md @@ -39,6 +39,12 @@ c.insert(it, std::move(t)); ## 戻り値 挿入されたかどうかを示す `bool` と、挿入された要素へのイテレータからなる [`pair`](/reference/utility/pair.md) を返す。挿入されなかったときは、既存要素へのイテレータを返す。 +## 計算量 + +操作の前のコンテナサイズ([`size()`](size.md))を`N`とすると + +- 新しい要素が挿入された場合: `N`に対して線形 +- 要素の挿入が行われなかった場合: `N`に対して対数 ## 例 ### 単純な挿入の例 diff --git a/reference/flat_set/flat_set/emplace_hint.md b/reference/flat_set/flat_set/emplace_hint.md index 8fd7b5a7cc..46f6abed66 100644 --- a/reference/flat_set/flat_set/emplace_hint.md +++ b/reference/flat_set/flat_set/emplace_hint.md @@ -24,8 +24,8 @@ iterator emplace_hint(const_iterator hint, Args&&... args); ## 計算量 -一般にコンテナのサイズについて対数時間だが、新しい要素が `hint` の前に挿入された場合は償却定数時間。 +操作の前のコンテナサイズ([`size()`](size.md))を`N`とすると、`O(N)`(挿入が行われなかった場合は`O(log N)`より小さくなる可能性がある)。 ## 例 ```cpp example From 28dcdfac5b4dd06005971b3fd05155b40ed26280 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Tue, 8 Jul 2025 00:16:37 +0900 Subject: [PATCH 2112/3948] delete unnecessary space --- reference/cstdlib/calloc.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdlib/calloc.md b/reference/cstdlib/calloc.md index c370b8ad17..8349851074 100644 --- a/reference/cstdlib/calloc.md +++ b/reference/cstdlib/calloc.md @@ -16,7 +16,7 @@ namespace std { この関数で返されるポインタは、割当領域の先頭のポインタである。 -領域の確保に失敗し た場合は、[`nullptr`](/lang/cpp11/nullptr.md)を返す。 +領域の確保に失敗した場合は、[`nullptr`](/lang/cpp11/nullptr.md)を返す。 割り当てられたオブジェクトの寿命は、このメモリが割り当てられた時から、[`free`](free.md)などで解放されるまでである。 From 785abde422c12399ef180abc7f67384d683ab563 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 17 Feb 2025 15:35:02 +0900 Subject: [PATCH 2113/3948] =?UTF-8?q?implementation:=20=E8=A3=BD=E5=93=81?= =?UTF-8?q?=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3=E3=81=AE=E8=A1=A8?= =?UTF-8?q?=E8=A8=98=E3=81=AB=E5=AF=BE=E3=81=99=E3=82=8B=E8=A8=BB=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/implementation.md b/implementation.md index 7d9ecf01ad..a4911c98ac 100644 --- a/implementation.md +++ b/implementation.md @@ -239,7 +239,12 @@ | | Microsoft C/C++ 7.0 | | 700 | | | | Microsoft C 6.0 | | 600 | | -1. **^** 製品名の列にはVisual C++コンパイラを含む実際に入手する製品の名称を示す。製品のエディション (Express/Standard/Professional/Enterprise/Community 他) は省略する。Visual Studioの製品バージョンは、製品名に現れていないときは `[ ~ ]` 内に記す。製品バージョンは、2017以降、メインメニューの [ヘルプ]-[Microsoft Visual Studio のバージョン情報] から確認できるものを指す。 +1. **^** 製品名の列にはVisual C++コンパイラを含む実際に入手する製品の名称を示す。製品のエディション (Express/Standard/Professional/Enterprise/Community 他) は省略する。 + Visual Studioの製品バージョンは、製品名に現れていないときは `[ ~ ]` 内に記す。 + 製品バージョンの番号は、2017以降、C++ツールセットのバージョンなど類似のものが色々あるが、ここではメインメニューの [ヘルプ]-[Microsoft Visual Studio のバージョン情報] から確認できるものを指す。 + バージョン表記として "バージョン \<番号\>" と "Version 番号" が混在しているが、これは編集者の裁量によるもので特に理由はない。 + バージョン \<番号\> の表記はリリースノートに見られる「Visual Studio 2017 バージョン 15.0」などに基づく。 + "Version \<番号\>" の表記はバージョン情報の画面に見られる「Version 17.13.0」という表記に基づく。 2. **^** VC++バージョンの列にはVisual C++ツールセットのバージョンを記述する。この表では特にVisual C++を入れた時に既定で選択されるツールセットのみについて扱う。Visual Studio 2022においては`C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC`配下のフォルダ名(`14.39.33519`など)で確認できる。 3. ^ [**a**](#note_ref-t1-3-a) [**b**](#note_ref-t1-3-b) [**c**](#note_ref-t1-3-c) IDEのみ修正され、コンパイラ、ヘッダー、ライブラリ等は変更されなかった。 - [C++17 Features And STL Fixes In VS 2017 15.3 | Visual C++ Team Blog](https://blogs.msdn.microsoft.com/vcblog/2017/08/11/c17-features-and-stl-fixes-in-vs-2017-15-3/) - "*After VS 2017 RTM, the 15.1 and 15.2 updates improved the IDE. The 15.3 update improves both the IDE and the toolset.*" From 2462479457d7fe8eb85749bf8b50be36b7f469d3 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Tue, 8 Jul 2025 00:32:46 +0900 Subject: [PATCH 2114/3948] =?UTF-8?q?cmath:=20std::comp=5Fellint=5F1:=20?= =?UTF-8?q?=E6=8C=AF=E3=82=8A=E5=AD=90=E5=91=A8=E6=9C=9F=E3=81=AE=CE=B8?= =?UTF-8?q?=E3=81=AE=E8=AA=AC=E6=98=8E=E6=8A=9C=E3=81=91=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cmath/comp_ellint_1.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cmath/comp_ellint_1.md b/reference/cmath/comp_ellint_1.md index 2ddd282798..91ca15b4d6 100644 --- a/reference/cmath/comp_ellint_1.md +++ b/reference/cmath/comp_ellint_1.md @@ -73,7 +73,7 @@ comp_ellint_1(1) = nan ## 単振り子の周期と等時性の破れ -単振り子の周期$ T $は、第1種完全楕円積分$ K $を用いて、$ T = 4 \sqrt{\frac{l}{g}} K(\sin(\frac{\theta}{2})) $と書ける($ l $は長さ、$ g $は重力加速度)。$ l = 1 [m]$の時の周期 $ T [s]$と、近似値$ T_0 = 2\pi\sqrt{\frac{l}{g}}$との比$T/T_0$を計算する例。 +単振り子の周期$ T $は、第1種完全楕円積分$ K $を用いて、$ T = 4 \sqrt{\frac{l}{g}} K(\sin(\frac{\theta}{2})) $と書ける($ l $は長さ、$ g $は重力加速度、$\theta$ は最大振れ幅の角度)。$ l = 1 [m]$の時の周期 $ T [s]$と、近似値$ T_0 = 2\pi\sqrt{\frac{l}{g}}$との比$T/T_0$を計算する例。 ```cpp example #include From dbd90167c147221115778c16db8c526de8a52f41 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Tue, 8 Jul 2025 00:52:52 +0900 Subject: [PATCH 2115/3948] =?UTF-8?q?cmath:=20=E9=A1=9E=E4=BC=BC=E3=81=AE?= =?UTF-8?q?=E4=B8=B8=E3=82=81=E9=96=A2=E6=95=B0=E3=81=A8=E3=81=AE=E7=9B=B8?= =?UTF-8?q?=E4=BA=92=E3=83=AA=E3=83=B3=E3=82=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cmath/ceil.md | 3 +++ reference/cmath/floor.md | 3 +++ reference/cmath/llrint.md | 5 +++++ reference/cmath/llround.md | 3 +++ reference/cmath/lrint.md | 5 +++++ reference/cmath/lround.md | 3 +++ reference/cmath/nearbyint.md | 4 ++++ reference/cmath/rint.md | 6 ++++++ reference/cmath/round.md | 5 +++++ reference/cmath/trunc.md | 3 +++ 10 files changed, 40 insertions(+) diff --git a/reference/cmath/ceil.md b/reference/cmath/ceil.md index 8fba8b842a..8a41f3cebb 100644 --- a/reference/cmath/ceil.md +++ b/reference/cmath/ceil.md @@ -120,6 +120,9 @@ FE_INEXACT = true 引数と結果が異なる場合に例外 `FE_INEXACT` が発生するか否かは実装によって異なる。 +## 関連項目 +- 床関数 (負の無限への丸め) [`floor`](floor.md) +- 切り捨て (ゼロ方向への丸め) [`trunc`](trunc.md) ## 参照 - [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) diff --git a/reference/cmath/floor.md b/reference/cmath/floor.md index 1d732e2dc0..5d0a67871b 100644 --- a/reference/cmath/floor.md +++ b/reference/cmath/floor.md @@ -120,6 +120,9 @@ FE_INEXACT = true 引数と結果が異なる場合に例外 `FE_INEXACT` が発生するか否かは実装によって異なる。 +## 関連項目 +- 天井関数 (正の無限への丸め) [`ceil`](ceil.md) +- 切り捨て (ゼロ方向への丸め) [`trunc`](trunc.md) ## 参照 - [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) diff --git a/reference/cmath/llrint.md b/reference/cmath/llrint.md index 141355dfcb..3508baf9bf 100644 --- a/reference/cmath/llrint.md +++ b/reference/cmath/llrint.md @@ -162,6 +162,11 @@ llrint(9.22337e+18) = -9223372036854775808, FE_INEXACT = false, FE_INVALID = tru - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] +## 関連項目 +- 戻り値浮動小数点数版 [`rint`](rint.md) +- 戻り値 `long` 版 [`lrint`](lrint.md) +- [`FE_INEXACT`](../cfenv/fe_inexact.md) +- 丸めモード: [`fesetround`](../cfenv/fesetround.md) (設定)、[`fegetround`](../cfenv/fegetround.md) (取得)、[`FLT_ROUNDS`](../cfloat/flt_rounds.md) (マクロ) ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) diff --git a/reference/cmath/llround.md b/reference/cmath/llround.md index fba7a7fe8b..c47c2fa251 100644 --- a/reference/cmath/llround.md +++ b/reference/cmath/llround.md @@ -104,6 +104,9 @@ llround(-2.9) = -3 - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? +## 関連項目 +- 戻り値浮動小数点数版 [`round`](round.md) +- 戻り値 `long` 版 [`lround`](lround.md) ## 参照 - [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) diff --git a/reference/cmath/lrint.md b/reference/cmath/lrint.md index ffa8687f7a..6733a4426c 100644 --- a/reference/cmath/lrint.md +++ b/reference/cmath/lrint.md @@ -164,6 +164,11 @@ lrint(9.22337e+18) = -9223372036854775808, FE_INEXACT = false, FE_INVALID = true ### 備考 - 本関数は C++11 で追加されたが、Clang(libc++) では C++11 モードでなくても使用可能である +## 関連項目 +- 戻り値浮動小数点数版 [`rint`](rint.md) +- 戻り値 `long long` 版 [`llrint`](llrint.md) +- [`FE_INEXACT`](../cfenv/fe_inexact.md) +- 丸めモード: [`fesetround`](../cfenv/fesetround.md) (設定)、[`fegetround`](../cfenv/fegetround.md) (取得)、[`FLT_ROUNDS`](../cfloat/flt_rounds.md) (マクロ) ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) diff --git a/reference/cmath/lround.md b/reference/cmath/lround.md index 4be8c303a2..2c15e6b496 100644 --- a/reference/cmath/lround.md +++ b/reference/cmath/lround.md @@ -104,6 +104,9 @@ lround(-2.9) = -3 - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? +## 関連項目 +- 戻り値浮動小数点数版 [`round`](round.md) +- 戻り値 `long long` 版 [`llround`](llround.md) ## 参照 - [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) diff --git a/reference/cmath/nearbyint.md b/reference/cmath/nearbyint.md index ccb56c8337..bc35556333 100644 --- a/reference/cmath/nearbyint.md +++ b/reference/cmath/nearbyint.md @@ -134,6 +134,10 @@ FE_INEXACT = false ### 備考 - 本関数は C++11 で追加されたが、Clang(libc++) では C++11 モードでなくても使用可能である。 +## 関連項目 +- [`FE_INEXACT`](../cfenv/fe_inexact.md) チェックを行う版: [`round`](round.md)、[`lround`](lround.md) (戻り値 `long`)、[`llround`](llround.md) (戻り値 `long long`) +- 常に四捨五入: [`round`](round.md)、[`lround`](lround.md) (戻り値 `long`)、[`llround`](llround.md) (戻り値 `long long`) +- 丸めモード: [`fesetround`](../cfenv/fesetround.md) (設定)、[`fegetround`](../cfenv/fegetround.md) (取得)、[`FLT_ROUNDS`](../cfloat/flt_rounds.md) (マクロ) ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) diff --git a/reference/cmath/rint.md b/reference/cmath/rint.md index 4dcdeeafa8..0d7122ea32 100644 --- a/reference/cmath/rint.md +++ b/reference/cmath/rint.md @@ -136,6 +136,12 @@ FE_INEXACT = true ### 備考 - 本関数は C++11 で追加されたが、Clang(libc++) では C++11 モードでなくても使用可能である。 +## 関連項目 +- 戻り値 `long` 版 [`lrint`](lrint.md) +- 戻り値 `long long` 版 [`llrint`](llrint.md) +- [`FE_INEXACT`](../cfenv/fe_inexact.md) が発生しない版 [`nearbyint`](nearbyint.md) +- 常に四捨五入: [`round`](round.md)、[`lround`](lround.md) (戻り値 `long`)、[`llround`](llround.md) (戻り値 `long long`) +- 丸めモード: [`fesetround`](../cfenv/fesetround.md) (設定)、[`fegetround`](../cfenv/fegetround.md) (取得)、[`FLT_ROUNDS`](../cfloat/flt_rounds.md) (マクロ) ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) diff --git a/reference/cmath/round.md b/reference/cmath/round.md index c88d88beb9..73fd56f1cd 100644 --- a/reference/cmath/round.md +++ b/reference/cmath/round.md @@ -149,6 +149,11 @@ FE_INEXACT = false 引数と結果が異なる場合に例外 `FE_INEXACT` が発生するか否かは実装によって異なる。 +## 関連項目 +- 戻り値 `long` 版 [`lround`](lround.md) +- 戻り値 `long long` 版 [`llround`](llround.md) +- 現在の丸めモードによる丸め: [`nearbyint`](nearbyint.md) +- 現在の丸めモードによる丸め (`FE_INEXACT` をチェック) [`rint`](rint.md)、[`lrint`](lrint.md) (戻り値 `long`)、[`llrint`](llrint.md) (戻り値 `long long`) ## 参照 - [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) diff --git a/reference/cmath/trunc.md b/reference/cmath/trunc.md index 7b9b27c173..44984c34bf 100644 --- a/reference/cmath/trunc.md +++ b/reference/cmath/trunc.md @@ -122,6 +122,9 @@ FE_INEXACT = false 引数と結果が異なる場合に例外 `FE_INEXACT` が発生するか否かは実装によって異なる。 +## 関連項目 +- 天井関数 (正の無限への丸め) [`ceil`](ceil.md) +- 床関数 (負の無限への丸め) [`floor`](floor.md) ## 参照 - [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) From c46d1e8dd9a4c286a332532e6d28666752655d6c Mon Sep 17 00:00:00 2001 From: rotarymars Date: Tue, 8 Jul 2025 11:40:05 +0900 Subject: [PATCH 2116/3948] defined items in cmath at GLOBAL_QUALIFY_LIST.txt defined items at GLOBAL_QUALIFY_LIST.txt --- GLOBAL_QUALIFY_LIST.txt | 261 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 254 insertions(+), 7 deletions(-) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index e1741f0dcb..986a8b213e 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -426,15 +426,132 @@ * std::ullong_max[link /reference/climits/ullong_max.md] * std::ulong_max[link /reference/climits/ulong_max.md] * std::ushrt_max[link /reference/climits/ushrt_max.md] +* [link /reference/cmath.md] + * std::abs[link /reference/cmath/abs.md] + * std::acos[link /reference/cmath/acos.md] + * std::acosh[link /reference/cmath/acosh.md] + * std::asin[link /reference/cmath/asin.md] + * std::asinh[link /reference/cmath/asinh.md] + * std::assoc_laguerre[link /reference/cmath/assoc_laguerre.md] + * std::assoc_legendre[link /reference/cmath/assoc_legendre.md] + * std::atan[link /reference/cmath/atan.md] + * std::atan2[link /reference/cmath/atan2.md] + * std::atanh[link /reference/cmath/atanh.md] + * std::beta[link /reference/cmath/beta.md] + * std::cbrt[link /reference/cmath/cbrt.md] + * std::ceil[link /reference/cmath/ceil.md] + * std::comp_ellint_1[link /reference/cmath/comp_ellint_1.md] + * std::comp_ellint_2[link /reference/cmath/comp_ellint_2.md] + * std::comp_ellint_3[link /reference/cmath/comp_ellint_3.md] + * std::copysign[link /reference/cmath/copysign.md] + * std::cos[link /reference/cmath/cos.md] + * std::cosh[link /reference/cmath/cosh.md] + * std::cyl_bessel_i[link /reference/cmath/cyl_bessel_i.md] + * std::cyl_bessel_j[link /reference/cmath/cyl_bessel_j.md] + * std::cyl_bessel_k[link /reference/cmath/cyl_bessel_k.md] + * std::cyl_neumann[link /reference/cmath/cyl_neumann.md] + * std::double_t[link /reference/cmath/double_t.md] + * std::ellint_1[link /reference/cmath/ellint_1.md] + * std::ellint_2[link /reference/cmath/ellint_2.md] + * std::ellint_3[link /reference/cmath/ellint_3.md] + * std::erf[link /reference/cmath/erf.md] + * std::erfc[link /reference/cmath/erfc.md] + * std::exp[link /reference/cmath/exp.md] + * std::exp2[link /reference/cmath/exp2.md] + * std::expint[link /reference/cmath/expint.md] + * std::expm1[link /reference/cmath/expm1.md] + * std::fabs[link /reference/cmath/fabs.md] + * std::fdim[link /reference/cmath/fdim.md] + * std::float_t[link /reference/cmath/float_t.md] + * std::floor[link /reference/cmath/floor.md] + * std::fma[link /reference/cmath/fma.md] + * std::fmax[link /reference/cmath/fmax.md] + * std::fmin[link /reference/cmath/fmin.md] + * std::fmod[link /reference/cmath/fmod.md] + * std::fp_fast_fma[link /reference/cmath/fp_fast_fma.md] + * std::fp_fast_fmaf[link /reference/cmath/fp_fast_fmaf.md] + * std::fp_fast_fmal[link /reference/cmath/fp_fast_fmal.md] + * std::fp_ilogb0[link /reference/cmath/fp_ilogb0.md] + * std::fp_ilogbnan[link /reference/cmath/fp_ilogbnan.md] + * std::fp_infinite[link /reference/cmath/fp_infinite.md] + * std::fp_nan[link /reference/cmath/fp_nan.md] + * std::fp_normal[link /reference/cmath/fp_normal.md] + * std::fp_subnormal[link /reference/cmath/fp_subnormal.md] + * std::fp_zero[link /reference/cmath/fp_zero.md] + * std::fpclassify[link /reference/cmath/fpclassify.md] + * std::frexp[link /reference/cmath/frexp.md] + * std::hermite[link /reference/cmath/hermite.md] + * std::huge_val[link /reference/cmath/huge_val.md] + * std::huge_valf[link /reference/cmath/huge_valf.md] + * std::huge_vall[link /reference/cmath/huge_vall.md] + * std::hypot[link /reference/cmath/hypot.md] + * std::ilogb[link /reference/cmath/ilogb.md] + * std::infinity[link /reference/cmath/infinity.md] + * std::isfinite[link /reference/cmath/isfinite.md] + * std::isgreater[link /reference/cmath/isgreater.md] + * std::isgreaterequal[link /reference/cmath/isgreaterequal.md] + * std::isinf[link /reference/cmath/isinf.md] + * std::isless[link /reference/cmath/isless.md] + * std::islessequal[link /reference/cmath/islessequal.md] + * std::islessgreater[link /reference/cmath/islessgreater.md] + * std::isnan[link /reference/cmath/isnan.md] + * std::isnormal[link /reference/cmath/isnormal.md] + * std::isunordered[link /reference/cmath/isunordered.md] + * std::laguerre[link /reference/cmath/laguerre.md] + * std::ldexp[link /reference/cmath/ldexp.md] + * std::legendre[link /reference/cmath/legendre.md] + * std::lerp[link /reference/cmath/lerp.md] + * std::lgamma[link /reference/cmath/lgamma.md] + * std::llrint[link /reference/cmath/llrint.md] + * std::llround[link /reference/cmath/llround.md] + * std::log[link /reference/cmath/log.md] + * std::log10[link /reference/cmath/log10.md] + * std::log1p[link /reference/cmath/log1p.md] + * std::log2[link /reference/cmath/log2.md] + * std::logb[link /reference/cmath/logb.md] + * std::lrint[link /reference/cmath/lrint.md] + * std::lround[link /reference/cmath/lround.md] + * std::math_errexcept[link /reference/cmath/math_errexcept.md] + * std::math_errhandling[link /reference/cmath/math_errhandling.md] + * std::math_errno[link /reference/cmath/math_errno.md] + * std::modf[link /reference/cmath/modf.md] + * std::nan[link /reference/cmath/nan.md] + * std::nanf[link /reference/cmath/nanf.md] + * std::nearbyint[link /reference/cmath/nearbyint.md] + * std::nextafter[link /reference/cmath/nextafter.md] + * std::nexttoward[link /reference/cmath/nexttoward.md] + * std::pow[link /reference/cmath/pow.md] + * std::remainder[link /reference/cmath/remainder.md] + * std::remquo[link /reference/cmath/remquo.md] + * std::riemann_zeta[link /reference/cmath/riemann_zeta.md] + * std::rint[link /reference/cmath/rint.md] + * std::round[link /reference/cmath/round.md] + * std::scalbln[link /reference/cmath/scalbln.md] + * std::scalbn[link /reference/cmath/scalbn.md] + * std::signbit[link /reference/cmath/signbit.md] + * std::sin[link /reference/cmath/sin.md] + * std::sinh[link /reference/cmath/sinh.md] + * std::sph_bessel[link /reference/cmath/sph_bessel.md] + * std::sph_legendre[link /reference/cmath/sph_legendre.md] + * std::sph_neumann[link /reference/cmath/sph_neumann.md] + * std::sqrt[link /reference/cmath/sqrt.md] + * std::tan[link /reference/cmath/tan.md] + * std::tanh[link /reference/cmath/tanh.md] + * std::tgamma[link /reference/cmath/tgamma.md] + * std::trunc[link /reference/cmath/trunc.md] +* [link /reference/codecvt.md] + * std::codecvt_mode[link /reference/codecvt/codecvt_mode.md] + * std::codecvt_utf16[link /reference/codecvt/codecvt_utf16.md] + * std::codecvt_utf8[link /reference/codecvt/codecvt_utf8.md] + * std::codecvt_utf8_utf16[link /reference/codecvt/codecvt_utf8_utf16.md] * [link /reference/compare.md] * compare_three_way_result_t[link /reference/compare/compare_three_way_result.md] * strong_ordering[link /reference/compare/strong_ordering.md] * three_way_comparable_with[link /reference/compare/three_way_comparable.md] * three_way_comparable[link /reference/compare/three_way_comparable.md] * [link /reference/coroutine.md] -* [link /reference/cmath.md] -* [link /reference/codecvt.md] * [link /reference/complex.md] + * std::complex[link /reference/complex/complex.md] * [link /reference/concepts.md] * common_reference_with[link /reference/concepts/common_reference_with.md] * common_with[link /reference/concepts/common_with.md] @@ -448,24 +565,154 @@ * same_as[link /reference/concepts/same_as.md] * [link /reference/condition_variable.md] * std::condition_variable[link /reference/condition_variable/condition_variable.md] + * std::condition_variable_any[link /reference/condition_variable/condition_variable_any.md] + * std::cv_status[link /reference/condition_variable/cv_status.md] +* [link /reference/contracts.md] + * std::assertion_kind[link /reference/contracts/assertion_kind.md] + * std::contract_violation[link /reference/contracts/contract_violation.md] + * std::detection_mode[link /reference/contracts/detection_mode.md] + * std::evaluation_semantic[link /reference/contracts/evaluation_semantic.md] + * std::invoke_default_contract_violation_handler[link /reference/contracts/invoke_default_contract_violation_handler.md] +* [link /reference/coroutine.md] * [link /reference/cstddef.md] * nullptr_t[link /reference/cstddef/nullptr_t.md] * std::nullptr_t[link /reference/cstddef/nullptr_t.md] * std::size_t[link /reference/cstddef/size_t.md] + * NULL[link /reference/cstddef/null.md] + * std::size_t[link /reference/cstddef/size_t.md] + * offsetof[link /reference/cstddef/offsetof.md] + * std::ptrdiff_t[link /reference/cstddef/ptrdiff_t.md] * [link /reference/cstdint.md] - * std::uint8_t[link /reference/cstdint/uint8_t.md] - * std::uint16_t[link /reference/cstdint/uint16_t.md] - * std::uint32_t[link /reference/cstdint/uint32_t.md] - * std::uint64_t[link /reference/cstdint/uint64_t.md] - * std::int8_t[link /reference/cstdint/int8_t.md] + * std::int_fast16_max[link /reference/cstdint/int_fast16_max.md] + * std::int_fast16_min[link /reference/cstdint/int_fast16_min.md] + * std::int_fast16_t[link /reference/cstdint/int_fast16_t.md] + * std::int_fast32_max[link /reference/cstdint/int_fast32_max.md] + * std::int_fast32_min[link /reference/cstdint/int_fast32_min.md] + * std::int_fast32_t[link /reference/cstdint/int_fast32_t.md] + * std::int_fast64_max[link /reference/cstdint/int_fast64_max.md] + * std::int_fast64_min[link /reference/cstdint/int_fast64_min.md] + * std::int_fast64_t[link /reference/cstdint/int_fast64_t.md] + * std::int_fast8_max[link /reference/cstdint/int_fast8_max.md] + * std::int_fast8_min[link /reference/cstdint/int_fast8_min.md] + * std::int_fast8_t[link /reference/cstdint/int_fast8_t.md] + * std::int_least16_max[link /reference/cstdint/int_least16_max.md] + * std::int_least16_min[link /reference/cstdint/int_least16_min.md] + * std::int_least16_t[link /reference/cstdint/int_least16_t.md] + * std::int_least32_max[link /reference/cstdint/int_least32_max.md] + * std::int_least32_min[link /reference/cstdint/int_least32_min.md] + * std::int_least32_t[link /reference/cstdint/int_least32_t.md] + * std::int_least64_max[link /reference/cstdint/int_least64_max.md] + * std::int_least64_min[link /reference/cstdint/int_least64_min.md] + * std::int_least64_t[link /reference/cstdint/int_least64_t.md] + * std::int_least8_max[link /reference/cstdint/int_least8_max.md] + * std::int_least8_min[link /reference/cstdint/int_least8_min.md] + * std::int_least8_t[link /reference/cstdint/int_least8_t.md] + * std::int16_max[link /reference/cstdint/int16_max.md] + * std::int16_min[link /reference/cstdint/int16_min.md] * std::int16_t[link /reference/cstdint/int16_t.md] + * std::int32_max[link /reference/cstdint/int32_max.md] + * std::int32_min[link /reference/cstdint/int32_min.md] * std::int32_t[link /reference/cstdint/int32_t.md] + * std::int64_max[link /reference/cstdint/int64_max.md] + * std::int64_min[link /reference/cstdint/int64_min.md] * std::int64_t[link /reference/cstdint/int64_t.md] + * std::int8_max[link /reference/cstdint/int8_max.md] + * std::int8_min[link /reference/cstdint/int8_min.md] + * std::int8_t[link /reference/cstdint/int8_t.md] + * std::intmax_max[link /reference/cstdint/intmax_max.md] + * std::intmax_min[link /reference/cstdint/intmax_min.md] + * std::intmax_t[link /reference/cstdint/intmax_t.md] + * std::intptr_max[link /reference/cstdint/intptr_max.md] + * std::intptr_min[link /reference/cstdint/intptr_min.md] + * std::intptr_t[link /reference/cstdint/intptr_t.md] + * std::ptrdiff_max[link /reference/cstdint/ptrdiff_max.md] + * std::ptrdiff_min[link /reference/cstdint/ptrdiff_min.md] + * std::sig_atomic_max[link /reference/cstdint/sig_atomic_max.md] + * std::sig_atomic_min[link /reference/cstdint/sig_atomic_min.md] + * std::size_max[link /reference/cstdint/size_max.md] + * std::uint_fast16_max[link /reference/cstdint/uint_fast16_max.md] + * std::uint_fast16_t[link /reference/cstdint/uint_fast16_t.md] + * std::uint_fast32_max[link /reference/cstdint/uint_fast32_max.md] + * std::uint_fast32_t[link /reference/cstdint/uint_fast32_t.md] + * std::uint_fast64_max[link /reference/cstdint/uint_fast64_max.md] + * std::uint_fast64_t[link /reference/cstdint/uint_fast64_t.md] + * std::uint_fast8_max[link /reference/cstdint/uint_fast8_max.md] + * std::uint_fast8_t[link /reference/cstdint/uint_fast8_t.md] + * std::uint_least16_max[link /reference/cstdint/uint_least16_max.md] + * std::uint_least16_t[link /reference/cstdint/uint_least16_t.md] + * std::uint_least32_max[link /reference/cstdint/uint_least32_max.md] + * std::uint_least32_t[link /reference/cstdint/uint_least32_t.md] + * std::uint_least64_max[link /reference/cstdint/uint_least64_max.md] + * std::uint_least64_t[link /reference/cstdint/uint_least64_t.md] + * std::uint_least8_max[link /reference/cstdint/uint_least8_max.md] + * std::uint_least8_t[link /reference/cstdint/uint_least8_t.md] + * std::uint16_max[link /reference/cstdint/uint16_max.md] + * std::uint16_t[link /reference/cstdint/uint16_t.md] + * std::uint32_max[link /reference/cstdint/uint32_max.md] + * std::uint32_t[link /reference/cstdint/uint32_t.md] + * std::uint64_max[link /reference/cstdint/uint64_max.md] + * std::uint64_t[link /reference/cstdint/uint64_t.md] + * std::uint8_max[link /reference/cstdint/uint8_max.md] + * std::uint8_t[link /reference/cstdint/uint8_t.md] + * std::uintmax_max[link /reference/cstdint/uintmax_max.md] + * std::uintmax_t[link /reference/cstdint/uintmax_t.md] + * std::uintptr_max[link /reference/cstdint/uintptr_max.md] + * std::uintptr_t[link /reference/cstdint/uintptr_t.md] + * std::wchar_max[link /reference/cstdint/wchar_max.md] + * std::wchar_min[link /reference/cstdint/wchar_min.md] + * std::wint_max[link /reference/cstdint/wint_max.md] + * std::wint_min[link /reference/cstdint/wint_min.md] * [link /reference/cstdio.md] + * EOF[link /reference/cstdio/eof.md] + * fgetc[link /reference/cstdio/fgetc.md] + * fgets[link /reference/cstdio/fgets.md] + * FILE[link /reference/cstdio/file.md] + * FILENAME_MAX[link /reference/cstdio/filename_max.md] + * fprintf[link /reference/cstdio/fprintf.md] + * fputc[link /reference/cstdio/fputc.md] + * fscanf[link /reference/cstdio/fscanf.md] + * remove[link /reference/cstdio/remove.md] + * rename[link /reference/cstdio/rename.md] + * stderr[link /reference/cstdio/stderr.md] + * stdin[link /reference/cstdio/stdin.md] + * stdout[link /reference/cstdio/stdout.md] + * tmpfile[link /reference/cstdio/tmpfile.md] + * tmpnam[link /reference/cstdio/tmpnam.md] * [link /reference/cstdlib.md] + * std::abort[link /reference/cstdlib/abort.md] + * std::abs[link /reference/cstdlib/abs.md] + * std::aligned_alloc[link /reference/cstdlib/aligned_alloc.md] + * std::at_quick_exit[link /reference/cstdlib/at_quick_exit.md] + * std::atexit[link /reference/cstdlib/atexit.md] + * std::atof[link /reference/cstdlib/atof.md] + * std::atoi_atol_atoll[link /reference/cstdlib/atoi_atol_atoll.md] + * std::calloc[link /reference/cstdlib/calloc.md] + * std::div[link /reference/cstdlib/div.md] + * std::div_t[link /reference/cstdlib/div_t.md] + * std::exit[link /reference/cstdlib/exit.md] + * std::exit_[link /reference/cstdlib/exit_.md] + * std::exit_failure[link /reference/cstdlib/exit_failure.md] + * std::exit_success[link /reference/cstdlib/exit_success.md] + * std::free[link /reference/cstdlib/free.md] + * std::getenv[link /reference/cstdlib/getenv.md] + * std::ldiv_t[link /reference/cstdlib/ldiv_t.md] + * std::lldiv_t[link /reference/cstdlib/lldiv_t.md] + * std::malloc[link /reference/cstdlib/malloc.md] + * std::quick_exit[link /reference/cstdlib/quick_exit.md] + * std::rand[link /reference/cstdlib/rand.md] + * std::rand_max[link /reference/cstdlib/rand_max.md] + * std::srand[link /reference/cstdlib/srand.md] + * std::system[link /reference/cstdlib/system.md] * [link /reference/cstring.md] * [link /reference/ctime.md] + * std::time_t[link /reference/ctime/time_t.md] + * std::time_utc[link /reference/ctime/time_utc.md] + * std::timespec[link /reference/ctime/timespec.md] + * std::timespec_get[link /reference/ctime/timespec_get.md] * [link /reference/debugging.md] + * std::breakpoint[link /reference/debugging/breakpoint.md] + * std::breakpoint_if_debugging[link /reference/debugging/breakpoint_if_debugging.md] + * std::is_debugger_present[link /reference/debugging/is_debugger_present.md] * [link /reference/deque/deque.md] * std::deque[link /reference/deque/deque.md] * [link /reference/exception.md] From 5600030e4ebaf5724ba4038fba8b5191ca2c5f5f Mon Sep 17 00:00:00 2001 From: rotarymars Date: Tue, 8 Jul 2025 12:08:06 +0900 Subject: [PATCH 2117/3948] Revert "defined items in cmath at GLOBAL_QUALIFY_LIST.txt" This reverts commit c46d1e8dd9a4c286a332532e6d28666752655d6c. --- GLOBAL_QUALIFY_LIST.txt | 261 ++-------------------------------------- 1 file changed, 7 insertions(+), 254 deletions(-) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 986a8b213e..e1741f0dcb 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -426,132 +426,15 @@ * std::ullong_max[link /reference/climits/ullong_max.md] * std::ulong_max[link /reference/climits/ulong_max.md] * std::ushrt_max[link /reference/climits/ushrt_max.md] -* [link /reference/cmath.md] - * std::abs[link /reference/cmath/abs.md] - * std::acos[link /reference/cmath/acos.md] - * std::acosh[link /reference/cmath/acosh.md] - * std::asin[link /reference/cmath/asin.md] - * std::asinh[link /reference/cmath/asinh.md] - * std::assoc_laguerre[link /reference/cmath/assoc_laguerre.md] - * std::assoc_legendre[link /reference/cmath/assoc_legendre.md] - * std::atan[link /reference/cmath/atan.md] - * std::atan2[link /reference/cmath/atan2.md] - * std::atanh[link /reference/cmath/atanh.md] - * std::beta[link /reference/cmath/beta.md] - * std::cbrt[link /reference/cmath/cbrt.md] - * std::ceil[link /reference/cmath/ceil.md] - * std::comp_ellint_1[link /reference/cmath/comp_ellint_1.md] - * std::comp_ellint_2[link /reference/cmath/comp_ellint_2.md] - * std::comp_ellint_3[link /reference/cmath/comp_ellint_3.md] - * std::copysign[link /reference/cmath/copysign.md] - * std::cos[link /reference/cmath/cos.md] - * std::cosh[link /reference/cmath/cosh.md] - * std::cyl_bessel_i[link /reference/cmath/cyl_bessel_i.md] - * std::cyl_bessel_j[link /reference/cmath/cyl_bessel_j.md] - * std::cyl_bessel_k[link /reference/cmath/cyl_bessel_k.md] - * std::cyl_neumann[link /reference/cmath/cyl_neumann.md] - * std::double_t[link /reference/cmath/double_t.md] - * std::ellint_1[link /reference/cmath/ellint_1.md] - * std::ellint_2[link /reference/cmath/ellint_2.md] - * std::ellint_3[link /reference/cmath/ellint_3.md] - * std::erf[link /reference/cmath/erf.md] - * std::erfc[link /reference/cmath/erfc.md] - * std::exp[link /reference/cmath/exp.md] - * std::exp2[link /reference/cmath/exp2.md] - * std::expint[link /reference/cmath/expint.md] - * std::expm1[link /reference/cmath/expm1.md] - * std::fabs[link /reference/cmath/fabs.md] - * std::fdim[link /reference/cmath/fdim.md] - * std::float_t[link /reference/cmath/float_t.md] - * std::floor[link /reference/cmath/floor.md] - * std::fma[link /reference/cmath/fma.md] - * std::fmax[link /reference/cmath/fmax.md] - * std::fmin[link /reference/cmath/fmin.md] - * std::fmod[link /reference/cmath/fmod.md] - * std::fp_fast_fma[link /reference/cmath/fp_fast_fma.md] - * std::fp_fast_fmaf[link /reference/cmath/fp_fast_fmaf.md] - * std::fp_fast_fmal[link /reference/cmath/fp_fast_fmal.md] - * std::fp_ilogb0[link /reference/cmath/fp_ilogb0.md] - * std::fp_ilogbnan[link /reference/cmath/fp_ilogbnan.md] - * std::fp_infinite[link /reference/cmath/fp_infinite.md] - * std::fp_nan[link /reference/cmath/fp_nan.md] - * std::fp_normal[link /reference/cmath/fp_normal.md] - * std::fp_subnormal[link /reference/cmath/fp_subnormal.md] - * std::fp_zero[link /reference/cmath/fp_zero.md] - * std::fpclassify[link /reference/cmath/fpclassify.md] - * std::frexp[link /reference/cmath/frexp.md] - * std::hermite[link /reference/cmath/hermite.md] - * std::huge_val[link /reference/cmath/huge_val.md] - * std::huge_valf[link /reference/cmath/huge_valf.md] - * std::huge_vall[link /reference/cmath/huge_vall.md] - * std::hypot[link /reference/cmath/hypot.md] - * std::ilogb[link /reference/cmath/ilogb.md] - * std::infinity[link /reference/cmath/infinity.md] - * std::isfinite[link /reference/cmath/isfinite.md] - * std::isgreater[link /reference/cmath/isgreater.md] - * std::isgreaterequal[link /reference/cmath/isgreaterequal.md] - * std::isinf[link /reference/cmath/isinf.md] - * std::isless[link /reference/cmath/isless.md] - * std::islessequal[link /reference/cmath/islessequal.md] - * std::islessgreater[link /reference/cmath/islessgreater.md] - * std::isnan[link /reference/cmath/isnan.md] - * std::isnormal[link /reference/cmath/isnormal.md] - * std::isunordered[link /reference/cmath/isunordered.md] - * std::laguerre[link /reference/cmath/laguerre.md] - * std::ldexp[link /reference/cmath/ldexp.md] - * std::legendre[link /reference/cmath/legendre.md] - * std::lerp[link /reference/cmath/lerp.md] - * std::lgamma[link /reference/cmath/lgamma.md] - * std::llrint[link /reference/cmath/llrint.md] - * std::llround[link /reference/cmath/llround.md] - * std::log[link /reference/cmath/log.md] - * std::log10[link /reference/cmath/log10.md] - * std::log1p[link /reference/cmath/log1p.md] - * std::log2[link /reference/cmath/log2.md] - * std::logb[link /reference/cmath/logb.md] - * std::lrint[link /reference/cmath/lrint.md] - * std::lround[link /reference/cmath/lround.md] - * std::math_errexcept[link /reference/cmath/math_errexcept.md] - * std::math_errhandling[link /reference/cmath/math_errhandling.md] - * std::math_errno[link /reference/cmath/math_errno.md] - * std::modf[link /reference/cmath/modf.md] - * std::nan[link /reference/cmath/nan.md] - * std::nanf[link /reference/cmath/nanf.md] - * std::nearbyint[link /reference/cmath/nearbyint.md] - * std::nextafter[link /reference/cmath/nextafter.md] - * std::nexttoward[link /reference/cmath/nexttoward.md] - * std::pow[link /reference/cmath/pow.md] - * std::remainder[link /reference/cmath/remainder.md] - * std::remquo[link /reference/cmath/remquo.md] - * std::riemann_zeta[link /reference/cmath/riemann_zeta.md] - * std::rint[link /reference/cmath/rint.md] - * std::round[link /reference/cmath/round.md] - * std::scalbln[link /reference/cmath/scalbln.md] - * std::scalbn[link /reference/cmath/scalbn.md] - * std::signbit[link /reference/cmath/signbit.md] - * std::sin[link /reference/cmath/sin.md] - * std::sinh[link /reference/cmath/sinh.md] - * std::sph_bessel[link /reference/cmath/sph_bessel.md] - * std::sph_legendre[link /reference/cmath/sph_legendre.md] - * std::sph_neumann[link /reference/cmath/sph_neumann.md] - * std::sqrt[link /reference/cmath/sqrt.md] - * std::tan[link /reference/cmath/tan.md] - * std::tanh[link /reference/cmath/tanh.md] - * std::tgamma[link /reference/cmath/tgamma.md] - * std::trunc[link /reference/cmath/trunc.md] -* [link /reference/codecvt.md] - * std::codecvt_mode[link /reference/codecvt/codecvt_mode.md] - * std::codecvt_utf16[link /reference/codecvt/codecvt_utf16.md] - * std::codecvt_utf8[link /reference/codecvt/codecvt_utf8.md] - * std::codecvt_utf8_utf16[link /reference/codecvt/codecvt_utf8_utf16.md] * [link /reference/compare.md] * compare_three_way_result_t[link /reference/compare/compare_three_way_result.md] * strong_ordering[link /reference/compare/strong_ordering.md] * three_way_comparable_with[link /reference/compare/three_way_comparable.md] * three_way_comparable[link /reference/compare/three_way_comparable.md] * [link /reference/coroutine.md] +* [link /reference/cmath.md] +* [link /reference/codecvt.md] * [link /reference/complex.md] - * std::complex[link /reference/complex/complex.md] * [link /reference/concepts.md] * common_reference_with[link /reference/concepts/common_reference_with.md] * common_with[link /reference/concepts/common_with.md] @@ -565,154 +448,24 @@ * same_as[link /reference/concepts/same_as.md] * [link /reference/condition_variable.md] * std::condition_variable[link /reference/condition_variable/condition_variable.md] - * std::condition_variable_any[link /reference/condition_variable/condition_variable_any.md] - * std::cv_status[link /reference/condition_variable/cv_status.md] -* [link /reference/contracts.md] - * std::assertion_kind[link /reference/contracts/assertion_kind.md] - * std::contract_violation[link /reference/contracts/contract_violation.md] - * std::detection_mode[link /reference/contracts/detection_mode.md] - * std::evaluation_semantic[link /reference/contracts/evaluation_semantic.md] - * std::invoke_default_contract_violation_handler[link /reference/contracts/invoke_default_contract_violation_handler.md] -* [link /reference/coroutine.md] * [link /reference/cstddef.md] * nullptr_t[link /reference/cstddef/nullptr_t.md] * std::nullptr_t[link /reference/cstddef/nullptr_t.md] * std::size_t[link /reference/cstddef/size_t.md] - * NULL[link /reference/cstddef/null.md] - * std::size_t[link /reference/cstddef/size_t.md] - * offsetof[link /reference/cstddef/offsetof.md] - * std::ptrdiff_t[link /reference/cstddef/ptrdiff_t.md] * [link /reference/cstdint.md] - * std::int_fast16_max[link /reference/cstdint/int_fast16_max.md] - * std::int_fast16_min[link /reference/cstdint/int_fast16_min.md] - * std::int_fast16_t[link /reference/cstdint/int_fast16_t.md] - * std::int_fast32_max[link /reference/cstdint/int_fast32_max.md] - * std::int_fast32_min[link /reference/cstdint/int_fast32_min.md] - * std::int_fast32_t[link /reference/cstdint/int_fast32_t.md] - * std::int_fast64_max[link /reference/cstdint/int_fast64_max.md] - * std::int_fast64_min[link /reference/cstdint/int_fast64_min.md] - * std::int_fast64_t[link /reference/cstdint/int_fast64_t.md] - * std::int_fast8_max[link /reference/cstdint/int_fast8_max.md] - * std::int_fast8_min[link /reference/cstdint/int_fast8_min.md] - * std::int_fast8_t[link /reference/cstdint/int_fast8_t.md] - * std::int_least16_max[link /reference/cstdint/int_least16_max.md] - * std::int_least16_min[link /reference/cstdint/int_least16_min.md] - * std::int_least16_t[link /reference/cstdint/int_least16_t.md] - * std::int_least32_max[link /reference/cstdint/int_least32_max.md] - * std::int_least32_min[link /reference/cstdint/int_least32_min.md] - * std::int_least32_t[link /reference/cstdint/int_least32_t.md] - * std::int_least64_max[link /reference/cstdint/int_least64_max.md] - * std::int_least64_min[link /reference/cstdint/int_least64_min.md] - * std::int_least64_t[link /reference/cstdint/int_least64_t.md] - * std::int_least8_max[link /reference/cstdint/int_least8_max.md] - * std::int_least8_min[link /reference/cstdint/int_least8_min.md] - * std::int_least8_t[link /reference/cstdint/int_least8_t.md] - * std::int16_max[link /reference/cstdint/int16_max.md] - * std::int16_min[link /reference/cstdint/int16_min.md] - * std::int16_t[link /reference/cstdint/int16_t.md] - * std::int32_max[link /reference/cstdint/int32_max.md] - * std::int32_min[link /reference/cstdint/int32_min.md] - * std::int32_t[link /reference/cstdint/int32_t.md] - * std::int64_max[link /reference/cstdint/int64_max.md] - * std::int64_min[link /reference/cstdint/int64_min.md] - * std::int64_t[link /reference/cstdint/int64_t.md] - * std::int8_max[link /reference/cstdint/int8_max.md] - * std::int8_min[link /reference/cstdint/int8_min.md] - * std::int8_t[link /reference/cstdint/int8_t.md] - * std::intmax_max[link /reference/cstdint/intmax_max.md] - * std::intmax_min[link /reference/cstdint/intmax_min.md] - * std::intmax_t[link /reference/cstdint/intmax_t.md] - * std::intptr_max[link /reference/cstdint/intptr_max.md] - * std::intptr_min[link /reference/cstdint/intptr_min.md] - * std::intptr_t[link /reference/cstdint/intptr_t.md] - * std::ptrdiff_max[link /reference/cstdint/ptrdiff_max.md] - * std::ptrdiff_min[link /reference/cstdint/ptrdiff_min.md] - * std::sig_atomic_max[link /reference/cstdint/sig_atomic_max.md] - * std::sig_atomic_min[link /reference/cstdint/sig_atomic_min.md] - * std::size_max[link /reference/cstdint/size_max.md] - * std::uint_fast16_max[link /reference/cstdint/uint_fast16_max.md] - * std::uint_fast16_t[link /reference/cstdint/uint_fast16_t.md] - * std::uint_fast32_max[link /reference/cstdint/uint_fast32_max.md] - * std::uint_fast32_t[link /reference/cstdint/uint_fast32_t.md] - * std::uint_fast64_max[link /reference/cstdint/uint_fast64_max.md] - * std::uint_fast64_t[link /reference/cstdint/uint_fast64_t.md] - * std::uint_fast8_max[link /reference/cstdint/uint_fast8_max.md] - * std::uint_fast8_t[link /reference/cstdint/uint_fast8_t.md] - * std::uint_least16_max[link /reference/cstdint/uint_least16_max.md] - * std::uint_least16_t[link /reference/cstdint/uint_least16_t.md] - * std::uint_least32_max[link /reference/cstdint/uint_least32_max.md] - * std::uint_least32_t[link /reference/cstdint/uint_least32_t.md] - * std::uint_least64_max[link /reference/cstdint/uint_least64_max.md] - * std::uint_least64_t[link /reference/cstdint/uint_least64_t.md] - * std::uint_least8_max[link /reference/cstdint/uint_least8_max.md] - * std::uint_least8_t[link /reference/cstdint/uint_least8_t.md] - * std::uint16_max[link /reference/cstdint/uint16_max.md] + * std::uint8_t[link /reference/cstdint/uint8_t.md] * std::uint16_t[link /reference/cstdint/uint16_t.md] - * std::uint32_max[link /reference/cstdint/uint32_max.md] * std::uint32_t[link /reference/cstdint/uint32_t.md] - * std::uint64_max[link /reference/cstdint/uint64_max.md] * std::uint64_t[link /reference/cstdint/uint64_t.md] - * std::uint8_max[link /reference/cstdint/uint8_max.md] - * std::uint8_t[link /reference/cstdint/uint8_t.md] - * std::uintmax_max[link /reference/cstdint/uintmax_max.md] - * std::uintmax_t[link /reference/cstdint/uintmax_t.md] - * std::uintptr_max[link /reference/cstdint/uintptr_max.md] - * std::uintptr_t[link /reference/cstdint/uintptr_t.md] - * std::wchar_max[link /reference/cstdint/wchar_max.md] - * std::wchar_min[link /reference/cstdint/wchar_min.md] - * std::wint_max[link /reference/cstdint/wint_max.md] - * std::wint_min[link /reference/cstdint/wint_min.md] + * std::int8_t[link /reference/cstdint/int8_t.md] + * std::int16_t[link /reference/cstdint/int16_t.md] + * std::int32_t[link /reference/cstdint/int32_t.md] + * std::int64_t[link /reference/cstdint/int64_t.md] * [link /reference/cstdio.md] - * EOF[link /reference/cstdio/eof.md] - * fgetc[link /reference/cstdio/fgetc.md] - * fgets[link /reference/cstdio/fgets.md] - * FILE[link /reference/cstdio/file.md] - * FILENAME_MAX[link /reference/cstdio/filename_max.md] - * fprintf[link /reference/cstdio/fprintf.md] - * fputc[link /reference/cstdio/fputc.md] - * fscanf[link /reference/cstdio/fscanf.md] - * remove[link /reference/cstdio/remove.md] - * rename[link /reference/cstdio/rename.md] - * stderr[link /reference/cstdio/stderr.md] - * stdin[link /reference/cstdio/stdin.md] - * stdout[link /reference/cstdio/stdout.md] - * tmpfile[link /reference/cstdio/tmpfile.md] - * tmpnam[link /reference/cstdio/tmpnam.md] * [link /reference/cstdlib.md] - * std::abort[link /reference/cstdlib/abort.md] - * std::abs[link /reference/cstdlib/abs.md] - * std::aligned_alloc[link /reference/cstdlib/aligned_alloc.md] - * std::at_quick_exit[link /reference/cstdlib/at_quick_exit.md] - * std::atexit[link /reference/cstdlib/atexit.md] - * std::atof[link /reference/cstdlib/atof.md] - * std::atoi_atol_atoll[link /reference/cstdlib/atoi_atol_atoll.md] - * std::calloc[link /reference/cstdlib/calloc.md] - * std::div[link /reference/cstdlib/div.md] - * std::div_t[link /reference/cstdlib/div_t.md] - * std::exit[link /reference/cstdlib/exit.md] - * std::exit_[link /reference/cstdlib/exit_.md] - * std::exit_failure[link /reference/cstdlib/exit_failure.md] - * std::exit_success[link /reference/cstdlib/exit_success.md] - * std::free[link /reference/cstdlib/free.md] - * std::getenv[link /reference/cstdlib/getenv.md] - * std::ldiv_t[link /reference/cstdlib/ldiv_t.md] - * std::lldiv_t[link /reference/cstdlib/lldiv_t.md] - * std::malloc[link /reference/cstdlib/malloc.md] - * std::quick_exit[link /reference/cstdlib/quick_exit.md] - * std::rand[link /reference/cstdlib/rand.md] - * std::rand_max[link /reference/cstdlib/rand_max.md] - * std::srand[link /reference/cstdlib/srand.md] - * std::system[link /reference/cstdlib/system.md] * [link /reference/cstring.md] * [link /reference/ctime.md] - * std::time_t[link /reference/ctime/time_t.md] - * std::time_utc[link /reference/ctime/time_utc.md] - * std::timespec[link /reference/ctime/timespec.md] - * std::timespec_get[link /reference/ctime/timespec_get.md] * [link /reference/debugging.md] - * std::breakpoint[link /reference/debugging/breakpoint.md] - * std::breakpoint_if_debugging[link /reference/debugging/breakpoint_if_debugging.md] - * std::is_debugger_present[link /reference/debugging/is_debugger_present.md] * [link /reference/deque/deque.md] * std::deque[link /reference/deque/deque.md] * [link /reference/exception.md] From dfadaaddfdee0a8b9d6d42500a2d681c3080b612 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Tue, 8 Jul 2025 12:08:25 +0900 Subject: [PATCH 2118/3948] Revert "defined items in cctype at GLOBAL_QUALIFY_LIST.txt" This reverts commit 50c0e58f780a61230f41d1a78c6b0638e4a94d3d. --- GLOBAL_QUALIFY_LIST.txt | 232 ++++++++++++---------------------------- 1 file changed, 67 insertions(+), 165 deletions(-) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index e1741f0dcb..cda7c527d6 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -208,62 +208,62 @@ * ranges::upper_bound[link /reference/algorithm/ranges_upper_bound.md] * [link /reference/any.md] - * std::any[link /reference/any/any.md] - * std::any_cast[link /reference/any/any_cast.md] - * std::bad_any_cast[link /reference/any/bad_any_cast.md] - * std::make_any[link /reference/any/make_any.md] + * std::any[link /reference/algorithm/any.md] + * std::any_cast[link /reference/algorithm/any_cast.md] + * std::bad_any_cast[link /reference/algorithm/bad_any_cast.md] + * std::make_any[link /reference/algorithm/make_any.md] * [link /reference/array.md] - * std::array[link /reference/array/array.md] - * std::to_array[link /reference/array/to_array.md] + * std::array[link /reference/algorithm/array.md] + * std::to_array[link /reference/algorithm/to_array.md] * [link /reference/atomic.md] - * std::atomic[link /reference/atomic/atomic.md] - * std::atomic_compare_exchange_strong[link /reference/atomic/atomic_compare_exchange_strong.md] - * std::atomic_compare_exchange_strong_explicit[link /reference/atomic/atomic_compare_exchange_strong_explicit.md] - * std::atomic_compare_exchange_weak[link /reference/atomic/atomic_compare_exchange_weak.md] - * std::atomic_compare_exchange_weak_explicit[link /reference/atomic/atomic_compare_exchange_weak_explicit.md] - * std::atomic_exchange[link /reference/atomic/atomic_exchange.md] - * std::atomic_exchange_explicit[link /reference/atomic/atomic_exchange_explicit.md] - * std::atomic_fetch_add[link /reference/atomic/atomic_fetch_add.md] - * std::atomic_fetch_add_explicit[link /reference/atomic/atomic_fetch_add_explicit.md] - * std::atomic_fetch_and[link /reference/atomic/atomic_fetch_and.md] - * std::atomic_fetch_and_explicit[link /reference/atomic/atomic_fetch_and_explicit.md] - * std::atomic_fetch_max[link /reference/atomic/atomic_fetch_max.md] - * std::atomic_fetch_max_explicit[link /reference/atomic/atomic_fetch_max_explicit.md] - * std::atomic_fetch_min[link /reference/atomic/atomic_fetch_min.md] - * std::atomic_fetch_min_explicit[link /reference/atomic/atomic_fetch_min_explicit.md] - * std::atomic_fetch_or[link /reference/atomic/atomic_fetch_or.md] - * std::atomic_fetch_or_explicit[link /reference/atomic/atomic_fetch_or_explicit.md] - * std::atomic_fetch_sub[link /reference/atomic/atomic_fetch_sub.md] - * std::atomic_fetch_sub_explicit[link /reference/atomic/atomic_fetch_sub_explicit.md] - * std::atomic_fetch_xor[link /reference/atomic/atomic_fetch_xor.md] - * std::atomic_fetch_xor_explicit[link /reference/atomic/atomic_fetch_xor_explicit.md] - * std::atomic_flag[link /reference/atomic/atomic_flag.md] - * std::atomic_flag_clear[link /reference/atomic/atomic_flag_clear.md] - * std::atomic_flag_clear_explicit[link /reference/atomic/atomic_flag_clear_explicit.md] - * std::atomic_flag_init[link /reference/atomic/atomic_flag_init.md] - * std::atomic_flag_notify_all[link /reference/atomic/atomic_flag_notify_all.md] - * std::atomic_flag_notify_one[link /reference/atomic/atomic_flag_notify_one.md] - * std::atomic_flag_test[link /reference/atomic/atomic_flag_test.md] - * std::atomic_flag_test_and_set[link /reference/atomic/atomic_flag_test_and_set.md] - * std::atomic_flag_test_and_set_explicit[link /reference/atomic/atomic_flag_test_and_set_explicit.md] - * std::atomic_flag_test_explicit[link /reference/atomic/atomic_flag_test_explicit.md] - * std::atomic_flag_wait[link /reference/atomic/atomic_flag_wait.md] - * std::atomic_flag_wait_explicit[link /reference/atomic/atomic_flag_wait_explicit.md] - * std::atomic_init[link /reference/atomic/atomic_init.md] - * std::atomic_is_lock_free[link /reference/atomic/atomic_is_lock_free.md] - * std::atomic_load[link /reference/atomic/atomic_load.md] - * std::atomic_load_explicit[link /reference/atomic/atomic_load_explicit.md] - * std::atomic_notify_all[link /reference/atomic/atomic_notify_all.md] - * std::atomic_notify_one[link /reference/atomic/atomic_notify_one.md] - * std::atomic_ref[link /reference/atomic/atomic_ref.md] - * std::atomic_signal_fence[link /reference/atomic/atomic_signal_fence.md] - * std::atomic_store[link /reference/atomic/atomic_store.md] - * std::atomic_store_explicit[link /reference/atomic/atomic_store_explicit.md] - * std::atomic_thread_fence[link /reference/atomic/atomic_thread_fence.md] - * std::atomic_var_init[link /reference/atomic/atomic_var_init.md] - * std::atomic_wait[link /reference/atomic/atomic_wait.md] - * std::atomic_wait_explicit[link /reference/atomic/atomic_wait_explicit.md] + * std::atomic[link /reference/algorithm/atomic.md] + * std::atomic_compare_exchange_strong[link /reference/algorithm/atomic_compare_exchange_strong.md] + * std::atomic_compare_exchange_strong_explicit[link /reference/algorithm/atomic_compare_exchange_strong_explicit.md] + * std::atomic_compare_exchange_weak[link /reference/algorithm/atomic_compare_exchange_weak.md] + * std::atomic_compare_exchange_weak_explicit[link /reference/algorithm/atomic_compare_exchange_weak_explicit.md] + * std::atomic_exchange[link /reference/algorithm/atomic_exchange.md] + * std::atomic_exchange_explicit[link /reference/algorithm/atomic_exchange_explicit.md] + * std::atomic_fetch_add[link /reference/algorithm/atomic_fetch_add.md] + * std::atomic_fetch_add_explicit[link /reference/algorithm/atomic_fetch_add_explicit.md] + * std::atomic_fetch_and[link /reference/algorithm/atomic_fetch_and.md] + * std::atomic_fetch_and_explicit[link /reference/algorithm/atomic_fetch_and_explicit.md] + * std::atomic_fetch_max[link /reference/algorithm/atomic_fetch_max.md] + * std::atomic_fetch_max_explicit[link /reference/algorithm/atomic_fetch_max_explicit.md] + * std::atomic_fetch_min[link /reference/algorithm/atomic_fetch_min.md] + * std::atomic_fetch_min_explicit[link /reference/algorithm/atomic_fetch_min_explicit.md] + * std::atomic_fetch_or[link /reference/algorithm/atomic_fetch_or.md] + * std::atomic_fetch_or_explicit[link /reference/algorithm/atomic_fetch_or_explicit.md] + * std::atomic_fetch_sub[link /reference/algorithm/atomic_fetch_sub.md] + * std::atomic_fetch_sub_explicit[link /reference/algorithm/atomic_fetch_sub_explicit.md] + * std::atomic_fetch_xor[link /reference/algorithm/atomic_fetch_xor.md] + * std::atomic_fetch_xor_explicit[link /reference/algorithm/atomic_fetch_xor_explicit.md] + * std::atomic_flag[link /reference/algorithm/atomic_flag.md] + * std::atomic_flag_clear[link /reference/algorithm/atomic_flag_clear.md] + * std::atomic_flag_clear_explicit[link /reference/algorithm/atomic_flag_clear_explicit.md] + * std::atomic_flag_init[link /reference/algorithm/atomic_flag_init.md] + * std::atomic_flag_notify_all[link /reference/algorithm/atomic_flag_notify_all.md] + * std::atomic_flag_notify_one[link /reference/algorithm/atomic_flag_notify_one.md] + * std::atomic_flag_test[link /reference/algorithm/atomic_flag_test.md] + * std::atomic_flag_test_and_set[link /reference/algorithm/atomic_flag_test_and_set.md] + * std::atomic_flag_test_and_set_explicit[link /reference/algorithm/atomic_flag_test_and_set_explicit.md] + * std::atomic_flag_test_explicit[link /reference/algorithm/atomic_flag_test_explicit.md] + * std::atomic_flag_wait[link /reference/algorithm/atomic_flag_wait.md] + * std::atomic_flag_wait_explicit[link /reference/algorithm/atomic_flag_wait_explicit.md] + * std::atomic_init[link /reference/algorithm/atomic_init.md] + * std::atomic_is_lock_free[link /reference/algorithm/atomic_is_lock_free.md] + * std::atomic_load[link /reference/algorithm/atomic_load.md] + * std::atomic_load_explicit[link /reference/algorithm/atomic_load_explicit.md] + * std::atomic_notify_all[link /reference/algorithm/atomic_notify_all.md] + * std::atomic_notify_one[link /reference/algorithm/atomic_notify_one.md] + * std::atomic_ref[link /reference/algorithm/atomic_ref.md] + * std::atomic_signal_fence[link /reference/algorithm/atomic_signal_fence.md] + * std::atomic_store[link /reference/algorithm/atomic_store.md] + * std::atomic_store_explicit[link /reference/algorithm/atomic_store_explicit.md] + * std::atomic_thread_fence[link /reference/algorithm/atomic_thread_fence.md] + * std::atomic_var_init[link /reference/algorithm/atomic_var_init.md] + * std::atomic_wait[link /reference/algorithm/atomic_wait.md] + * std::atomic_wait_explicit[link /reference/algorithm/atomic_wait_explicit.md] * std::memory_order_acq_rel[link /reference/atomic/memory_order.md] * std::memory_order_acquire[link /reference/atomic/memory_order.md] * std::memory_order_relaxed[link /reference/atomic/memory_order.md] @@ -272,107 +272,28 @@ * [link /reference/barrier.md] * std::barrier[link /reference/barrier/barrier.md] * [link /reference/bit.md] - * std::bit_cast[link /reference/bit/bit_cast.md] - * std::bit_ceil[link /reference/bit/bit_ceil.md] - * std::bit_floor[link /reference/bit/bit_floor.md] - * std::bit_width[link /reference/bit/bit_width.md] - * std::byteswap[link /reference/bit/byteswap.md] - * std::countl_one[link /reference/bit/countl_one.md] - * std::countl_zero[link /reference/bit/countl_zero.md] - * std::countr_one[link /reference/bit/countr_one.md] - * std::countr_zero[link /reference/bit/countr_zero.md] - * std::endian[link /reference/bit/endian.md] - * std::has_single_bit[link /reference/bit/has_single_bit.md] - * std::popcount[link /reference/bit/popcount.md] - * std::rotl[link /reference/bit/rotl.md] - * std::rotr[link /reference/bit/rotr.md] + * std::bit_cast[link /reference/algorithm/bit_cast.md] + * std::bit_ceil[link /reference/algorithm/bit_ceil.md] + * std::bit_floor[link /reference/algorithm/bit_floor.md] + * std::bit_width[link /reference/algorithm/bit_width.md] + * std::byteswap[link /reference/algorithm/byteswap.md] + * std::countl_one[link /reference/algorithm/countl_one.md] + * std::countl_zero[link /reference/algorithm/countl_zero.md] + * std::countr_one[link /reference/algorithm/countr_one.md] + * std::countr_zero[link /reference/algorithm/countr_zero.md] + * std::endian[link /reference/algorithm/endian.md] + * std::has_single_bit[link /reference/algorithm/has_single_bit.md] + * std::popcount[link /reference/algorithm/popcount.md] + * std::rotl[link /reference/algorithm/rotl.md] + * std::rotr[link /reference/algorithm/rotr.md] * [link /reference/bitset.md] * std::bitset[link /reference/bitset/bitset.md] * [link /reference/cassert.md] * assert[link /reference/cassert/assert.md] -* [link /reference/cctype.md] - * std::isalnum[link /reference/cctype/isalnum.md] - * std::isalpha[link /reference/cctype/isalpha.md] - * std::isblank[link /reference/cctype/isblank.md] - * std::iscntrl[link /reference/cctype/iscntrl.md] - * std::isdigit[link /reference/cctype/isdigit.md] - * std::isgraph[link /reference/cctype/isgraph.md] - * std::islower[link /reference/cctype/islower.md] - * std::isprint[link /reference/cctype/isprint.md] - * std::ispunct[link /reference/cctype/ispunct.md] - * std::isspace[link /reference/cctype/isspace.md] - * std::isupper[link /reference/cctype/isupper.md] - * std::isxdigit[link /reference/cctype/isxdigit.md] - * std::tolower[link /reference/cctype/tolower.md] - * std::toupper[link /reference/cctype/toupper.md] * [link /reference/cerrno.md] - * std::errno[link /reference/cerrno/errno.md] * [link /reference/cfenv.md] - * std::fe_all_except[link /reference/cfenv/fe_all_except.md] - * std::fe_divbyzero[link /reference/cfenv/fe_divbyzero.md] - * std::fe_downward[link /reference/cfenv/fe_downward.md] - * std::fe_inexact[link /reference/cfenv/fe_inexact.md] - * std::fe_invalid[link /reference/cfenv/fe_invalid.md] - * std::fe_overflow[link /reference/cfenv/fe_overflow.md] - * std::fe_tonearest[link /reference/cfenv/fe_tonearest.md] - * std::fe_towardzero[link /reference/cfenv/fe_towardzero.md] - * std::fe_underflow[link /reference/cfenv/fe_underflow.md] - * std::fe_upward[link /reference/cfenv/fe_upward.md] - * std::feclearexcept[link /reference/cfenv/feclearexcept.md] - * std::fegetexceptflag[link /reference/cfenv/fegetexceptflag.md] - * std::fegetround[link /reference/cfenv/fegetround.md] - * std::feraiseexcept[link /reference/cfenv/feraiseexcept.md] - * std::fesetexceptflag[link /reference/cfenv/fesetexceptflag.md] - * std::fesetround[link /reference/cfenv/fesetround.md] - * std::fetestexcept[link /reference/cfenv/fetestexcept.md] - * std::fexcept_t[link /reference/cfenv/fexcept_t.md] * [link /reference/cfloat.md] - * std::dbl_decimal_dig[link /reference/cfloat/dbl_decimal_dig.md] - * std::dbl_dig[link /reference/cfloat/dbl_dig.md] - * std::dbl_epsilon[link /reference/cfloat/dbl_epsilon.md] - * std::dbl_has_subnorm[link /reference/cfloat/dbl_has_subnorm.md] - * std::dbl_mant_dig[link /reference/cfloat/dbl_mant_dig.md] - * std::dbl_max[link /reference/cfloat/dbl_max.md] - * std::dbl_max_10_exp[link /reference/cfloat/dbl_max_10_exp.md] - * std::dbl_max_exp[link /reference/cfloat/dbl_max_exp.md] - * std::dbl_min[link /reference/cfloat/dbl_min.md] - * std::dbl_min_10_exp[link /reference/cfloat/dbl_min_10_exp.md] - * std::dbl_min_exp[link /reference/cfloat/dbl_min_exp.md] - * std::dbl_true_min[link /reference/cfloat/dbl_true_min.md] - * std::decimal_dig[link /reference/cfloat/decimal_dig.md] - * std::flt_decimal_dig[link /reference/cfloat/flt_decimal_dig.md] - * std::flt_dig[link /reference/cfloat/flt_dig.md] - * std::flt_epsilon[link /reference/cfloat/flt_epsilon.md] - * std::flt_eval_method[link /reference/cfloat/flt_eval_method.md] - * std::flt_has_subnorm[link /reference/cfloat/flt_has_subnorm.md] - * std::flt_mant_dig[link /reference/cfloat/flt_mant_dig.md] - * std::flt_max[link /reference/cfloat/flt_max.md] - * std::flt_max_10_exp[link /reference/cfloat/flt_max_10_exp.md] - * std::flt_max_exp[link /reference/cfloat/flt_max_exp.md] - * std::flt_min[link /reference/cfloat/flt_min.md] - * std::flt_min_10_exp[link /reference/cfloat/flt_min_10_exp.md] - * std::flt_min_exp[link /reference/cfloat/flt_min_exp.md] - * std::flt_radix[link /reference/cfloat/flt_radix.md] - * std::flt_rounds[link /reference/cfloat/flt_rounds.md] - * std::flt_true_min[link /reference/cfloat/flt_true_min.md] - * std::ldbl_decimal_dig[link /reference/cfloat/ldbl_decimal_dig.md] - * std::ldbl_dig[link /reference/cfloat/ldbl_dig.md] - * std::ldbl_epsilon[link /reference/cfloat/ldbl_epsilon.md] - * std::ldbl_has_subnorm[link /reference/cfloat/ldbl_has_subnorm.md] - * std::ldbl_mant_dig[link /reference/cfloat/ldbl_mant_dig.md] - * std::ldbl_max[link /reference/cfloat/ldbl_max.md] - * std::ldbl_max_10_exp[link /reference/cfloat/ldbl_max_10_exp.md] - * std::ldbl_max_exp[link /reference/cfloat/ldbl_max_exp.md] - * std::ldbl_min[link /reference/cfloat/ldbl_min.md] - * std::ldbl_min_10_exp[link /reference/cfloat/ldbl_min_10_exp.md] - * std::ldbl_min_exp[link /reference/cfloat/ldbl_min_exp.md] - * std::ldbl_true_min[link /reference/cfloat/ldbl_true_min.md] * [link /reference/charconv.md] - * std::chars_format[link /reference/charconv/chars_format.md] - * std::from_chars_result[link /reference/charconv/from_chars_result.md] - * std::from_chars[link /reference/charconv/from_chars.md] - * std::to_chars_result[link /reference/charconv/to_chars_result.md] - * std::to_chars[link /reference/charconv/to_chars.md] * [link /reference/chrono.md] * std::chrono::days[link /reference/chrono/duration_aliases.md] * std::chrono::duration[link /reference/chrono/duration.md] @@ -407,25 +328,6 @@ * weeks[link /reference/chrono/duration_aliases.md] * years[link /reference/chrono/duration_aliases.md] * [link /reference/climits.md] - * std::char_bit[link /reference/climits/char_bit.md] - * std::char_max[link /reference/climits/char_max.md] - * std::char_min[link /reference/climits/char_min.md] - * std::int_max[link /reference/climits/int_max.md] - * std::int_min[link /reference/climits/int_min.md] - * std::llong_max[link /reference/climits/llong_max.md] - * std::llong_min[link /reference/climits/llong_min.md] - * std::long_max[link /reference/climits/long_max.md] - * std::long_min[link /reference/climits/long_min.md] - * std::mb_len_max[link /reference/climits/mb_len_max.md] - * std::schar_max[link /reference/climits/schar_max.md] - * std::schar_min[link /reference/climits/schar_min.md] - * std::shrt_max[link /reference/climits/shrt_max.md] - * std::shrt_min[link /reference/climits/shrt_min.md] - * std::uchar_max[link /reference/climits/uchar_max.md] - * std::uint_max[link /reference/climits/uint_max.md] - * std::ullong_max[link /reference/climits/ullong_max.md] - * std::ulong_max[link /reference/climits/ulong_max.md] - * std::ushrt_max[link /reference/climits/ushrt_max.md] * [link /reference/compare.md] * compare_three_way_result_t[link /reference/compare/compare_three_way_result.md] * strong_ordering[link /reference/compare/strong_ordering.md] From bcfccc62357eaa92e4bc3b14e515405c4c88f703 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Tue, 8 Jul 2025 12:08:27 +0900 Subject: [PATCH 2119/3948] Revert "defined items in bit at GLOBAL_QUALIFY_LIST.txt" This reverts commit efff8868047a96561e54050e574cf00ed26b1138. --- GLOBAL_QUALIFY_LIST.txt | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index cda7c527d6..2e3ba92296 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -272,20 +272,6 @@ * [link /reference/barrier.md] * std::barrier[link /reference/barrier/barrier.md] * [link /reference/bit.md] - * std::bit_cast[link /reference/algorithm/bit_cast.md] - * std::bit_ceil[link /reference/algorithm/bit_ceil.md] - * std::bit_floor[link /reference/algorithm/bit_floor.md] - * std::bit_width[link /reference/algorithm/bit_width.md] - * std::byteswap[link /reference/algorithm/byteswap.md] - * std::countl_one[link /reference/algorithm/countl_one.md] - * std::countl_zero[link /reference/algorithm/countl_zero.md] - * std::countr_one[link /reference/algorithm/countr_one.md] - * std::countr_zero[link /reference/algorithm/countr_zero.md] - * std::endian[link /reference/algorithm/endian.md] - * std::has_single_bit[link /reference/algorithm/has_single_bit.md] - * std::popcount[link /reference/algorithm/popcount.md] - * std::rotl[link /reference/algorithm/rotl.md] - * std::rotr[link /reference/algorithm/rotr.md] * [link /reference/bitset.md] * std::bitset[link /reference/bitset/bitset.md] * [link /reference/cassert.md] From 1234784c11579cfc804b403dfd751b1c21cabad1 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Tue, 8 Jul 2025 12:08:29 +0900 Subject: [PATCH 2120/3948] Revert "defined items in barrier at GLOBAL_QUALIFY_LIST.txt" This reverts commit 9631cc22178d4eb9ad2cfc32ba4eebf2b69f5406. --- GLOBAL_QUALIFY_LIST.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 2e3ba92296..d4f8a717cb 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -270,7 +270,6 @@ * std::memory_order_release[link /reference/atomic/memory_order.md] * std::memory_order_seq_cst[link /reference/atomic/memory_order.md] * [link /reference/barrier.md] - * std::barrier[link /reference/barrier/barrier.md] * [link /reference/bit.md] * [link /reference/bitset.md] * std::bitset[link /reference/bitset/bitset.md] From a61a9f3aeaabe95dc9e15cc26f09fb39e198e817 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Tue, 8 Jul 2025 12:08:32 +0900 Subject: [PATCH 2121/3948] Revert "defined items in atomic at GLOBAL_QUALIFY_LIST" This reverts commit 53c2993f68c1c8476afd3662126b7ab10b2fb2c9. --- GLOBAL_QUALIFY_LIST.txt | 48 +---------------------------------------- 1 file changed, 1 insertion(+), 47 deletions(-) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index d4f8a717cb..fa3f27cc4e 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -217,53 +217,7 @@ * std::to_array[link /reference/algorithm/to_array.md] * [link /reference/atomic.md] - * std::atomic[link /reference/algorithm/atomic.md] - * std::atomic_compare_exchange_strong[link /reference/algorithm/atomic_compare_exchange_strong.md] - * std::atomic_compare_exchange_strong_explicit[link /reference/algorithm/atomic_compare_exchange_strong_explicit.md] - * std::atomic_compare_exchange_weak[link /reference/algorithm/atomic_compare_exchange_weak.md] - * std::atomic_compare_exchange_weak_explicit[link /reference/algorithm/atomic_compare_exchange_weak_explicit.md] - * std::atomic_exchange[link /reference/algorithm/atomic_exchange.md] - * std::atomic_exchange_explicit[link /reference/algorithm/atomic_exchange_explicit.md] - * std::atomic_fetch_add[link /reference/algorithm/atomic_fetch_add.md] - * std::atomic_fetch_add_explicit[link /reference/algorithm/atomic_fetch_add_explicit.md] - * std::atomic_fetch_and[link /reference/algorithm/atomic_fetch_and.md] - * std::atomic_fetch_and_explicit[link /reference/algorithm/atomic_fetch_and_explicit.md] - * std::atomic_fetch_max[link /reference/algorithm/atomic_fetch_max.md] - * std::atomic_fetch_max_explicit[link /reference/algorithm/atomic_fetch_max_explicit.md] - * std::atomic_fetch_min[link /reference/algorithm/atomic_fetch_min.md] - * std::atomic_fetch_min_explicit[link /reference/algorithm/atomic_fetch_min_explicit.md] - * std::atomic_fetch_or[link /reference/algorithm/atomic_fetch_or.md] - * std::atomic_fetch_or_explicit[link /reference/algorithm/atomic_fetch_or_explicit.md] - * std::atomic_fetch_sub[link /reference/algorithm/atomic_fetch_sub.md] - * std::atomic_fetch_sub_explicit[link /reference/algorithm/atomic_fetch_sub_explicit.md] - * std::atomic_fetch_xor[link /reference/algorithm/atomic_fetch_xor.md] - * std::atomic_fetch_xor_explicit[link /reference/algorithm/atomic_fetch_xor_explicit.md] - * std::atomic_flag[link /reference/algorithm/atomic_flag.md] - * std::atomic_flag_clear[link /reference/algorithm/atomic_flag_clear.md] - * std::atomic_flag_clear_explicit[link /reference/algorithm/atomic_flag_clear_explicit.md] - * std::atomic_flag_init[link /reference/algorithm/atomic_flag_init.md] - * std::atomic_flag_notify_all[link /reference/algorithm/atomic_flag_notify_all.md] - * std::atomic_flag_notify_one[link /reference/algorithm/atomic_flag_notify_one.md] - * std::atomic_flag_test[link /reference/algorithm/atomic_flag_test.md] - * std::atomic_flag_test_and_set[link /reference/algorithm/atomic_flag_test_and_set.md] - * std::atomic_flag_test_and_set_explicit[link /reference/algorithm/atomic_flag_test_and_set_explicit.md] - * std::atomic_flag_test_explicit[link /reference/algorithm/atomic_flag_test_explicit.md] - * std::atomic_flag_wait[link /reference/algorithm/atomic_flag_wait.md] - * std::atomic_flag_wait_explicit[link /reference/algorithm/atomic_flag_wait_explicit.md] - * std::atomic_init[link /reference/algorithm/atomic_init.md] - * std::atomic_is_lock_free[link /reference/algorithm/atomic_is_lock_free.md] - * std::atomic_load[link /reference/algorithm/atomic_load.md] - * std::atomic_load_explicit[link /reference/algorithm/atomic_load_explicit.md] - * std::atomic_notify_all[link /reference/algorithm/atomic_notify_all.md] - * std::atomic_notify_one[link /reference/algorithm/atomic_notify_one.md] - * std::atomic_ref[link /reference/algorithm/atomic_ref.md] - * std::atomic_signal_fence[link /reference/algorithm/atomic_signal_fence.md] - * std::atomic_store[link /reference/algorithm/atomic_store.md] - * std::atomic_store_explicit[link /reference/algorithm/atomic_store_explicit.md] - * std::atomic_thread_fence[link /reference/algorithm/atomic_thread_fence.md] - * std::atomic_var_init[link /reference/algorithm/atomic_var_init.md] - * std::atomic_wait[link /reference/algorithm/atomic_wait.md] - * std::atomic_wait_explicit[link /reference/algorithm/atomic_wait_explicit.md] + * std::atomic[link /reference/atomic/atomic.md] * std::memory_order_acq_rel[link /reference/atomic/memory_order.md] * std::memory_order_acquire[link /reference/atomic/memory_order.md] * std::memory_order_relaxed[link /reference/atomic/memory_order.md] From 295b764e227078d0b30767c568742cff5c686a4e Mon Sep 17 00:00:00 2001 From: rotarymars Date: Tue, 8 Jul 2025 12:08:35 +0900 Subject: [PATCH 2122/3948] Revert "defined items for at GLOBAL_QUALIFY_LIST" This reverts commit a8b880894ab46d7c60d6998059767e470feee59c. --- GLOBAL_QUALIFY_LIST.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index fa3f27cc4e..2765f22c54 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -213,9 +213,7 @@ * std::bad_any_cast[link /reference/algorithm/bad_any_cast.md] * std::make_any[link /reference/algorithm/make_any.md] * [link /reference/array.md] - * std::array[link /reference/algorithm/array.md] - * std::to_array[link /reference/algorithm/to_array.md] - + * std::array[link /reference/array/array.md] * [link /reference/atomic.md] * std::atomic[link /reference/atomic/atomic.md] * std::memory_order_acq_rel[link /reference/atomic/memory_order.md] From e4c1ff5f20df2c33d95d98c07e50b642b92480c9 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Tue, 8 Jul 2025 12:08:39 +0900 Subject: [PATCH 2123/3948] Revert "added functions for any header at GLOBAL_QUALIFY_LIST.txt" This reverts commit 2b4608d5ceaebcf22b57e56c5debca1b84e39e0f. --- GLOBAL_QUALIFY_LIST.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 2765f22c54..2ce6202228 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -208,10 +208,6 @@ * ranges::upper_bound[link /reference/algorithm/ranges_upper_bound.md] * [link /reference/any.md] - * std::any[link /reference/algorithm/any.md] - * std::any_cast[link /reference/algorithm/any_cast.md] - * std::bad_any_cast[link /reference/algorithm/bad_any_cast.md] - * std::make_any[link /reference/algorithm/make_any.md] * [link /reference/array.md] * std::array[link /reference/array/array.md] * [link /reference/atomic.md] From e424b2ab0714357399b1bc6041451e8e6f7a4b3e Mon Sep 17 00:00:00 2001 From: rotarymars Date: Tue, 8 Jul 2025 12:12:31 +0900 Subject: [PATCH 2124/3948] Revert "defined all functions for algorithm header at GLOBAL_QUALIFY_LIST.txt" --- GLOBAL_QUALIFY_LIST.txt | 196 +--------------------------------------- 1 file changed, 1 insertion(+), 195 deletions(-) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 2ce6202228..0c106e8455 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -8,205 +8,11 @@ * synth-three-way[link /reference/exposition-only/synth-three-way-result.md] * [link /reference/algorithm.md] * ExecutionPolicy[link /reference/execution/execution/execution_policy.md] - * std::adjacent_find[link /reference/algorithm/adjacent_find.md] - * std::all_of[link /reference/algorithm/all_of.md] - * std::any_of[link /reference/algorithm/any_of.md] - * std::binary_search[link /reference/algorithm/binary_search.md] - * std::clamp[link /reference/algorithm/clamp.md] + * ranges::find_if_not[link /reference/algorithm/ranges_find_if_not.md] * std::copy[link /reference/algorithm/copy.md] - * std::copy_backward[link /reference/algorithm/copy_backward.md] - * std::copy_if[link /reference/algorithm/copy_if.md] * std::copy_n[link /reference/algorithm/copy_n.md] - * std::count[link /reference/algorithm/count.md] - * std::count_if[link /reference/algorithm/count_if.md] - * std::equal[link /reference/algorithm/equal.md] - * std::equal_range[link /reference/algorithm/equal_range.md] - * std::fill[link /reference/algorithm/fill.md] - * std::fill_n[link /reference/algorithm/fill_n.md] - * std::find[link /reference/algorithm/find.md] - * std::find_end[link /reference/algorithm/find_end.md] - * std::find_first_of[link /reference/algorithm/find_first_of.md] - * std::find_if[link /reference/algorithm/find_if.md] - * std::find_if_not[link /reference/algorithm/find_if_not.md] * std::for_each[link /reference/algorithm/for_each.md] - * std::for_each_n[link /reference/algorithm/for_each_n.md] - * std::generate[link /reference/algorithm/generate.md] - * std::generate_n[link /reference/algorithm/generate_n.md] - * std::includes[link /reference/algorithm/includes.md] - * std::inplace_merge[link /reference/algorithm/inplace_merge.md] - * std::is_heap[link /reference/algorithm/is_heap.md] - * std::is_heap_until[link /reference/algorithm/is_heap_until.md] - * std::is_partitioned[link /reference/algorithm/is_partitioned.md] - * std::is_permutation[link /reference/algorithm/is_permutation.md] - * std::is_sorted[link /reference/algorithm/is_sorted.md] - * std::is_sorted_until[link /reference/algorithm/is_sorted_until.md] - * std::iter_swap[link /reference/algorithm/iter_swap.md] - * std::lexicographical_compare[link /reference/algorithm/lexicographical_compare.md] - * std::lexicographical_compare_three_way[link /reference/algorithm/lexicographical_compare_three_way.md] - * std::lower_bound[link /reference/algorithm/lower_bound.md] - * std::make_heap[link /reference/algorithm/make_heap.md] - * std::max[link /reference/algorithm/max.md] - * std::max_element[link /reference/algorithm/max_element.md] - * std::merge[link /reference/algorithm/merge.md] - * std::min[link /reference/algorithm/min.md] - * std::min_element[link /reference/algorithm/min_element.md] - * std::minmax[link /reference/algorithm/minmax.md] - * std::minmax_element[link /reference/algorithm/minmax_element.md] - * std::mismatch[link /reference/algorithm/mismatch.md] - * std::move_backward[link /reference/algorithm/move_backward.md] - * std::next_permutation[link /reference/algorithm/next_permutation.md] - * std::none_of[link /reference/algorithm/none_of.md] - * std::nth_element[link /reference/algorithm/nth_element.md] - * std::partial_sort[link /reference/algorithm/partial_sort.md] - * std::partial_sort_copy[link /reference/algorithm/partial_sort_copy.md] - * std::partition[link /reference/algorithm/partition.md] - * std::partition_copy[link /reference/algorithm/partition_copy.md] - * std::partition_point[link /reference/algorithm/partition_point.md] - * std::pop_heap[link /reference/algorithm/pop_heap.md] - * std::prev_permutation[link /reference/algorithm/prev_permutation.md] - * std::push_heap[link /reference/algorithm/push_heap.md] - * std::random_shuffle[link /reference/algorithm/random_shuffle.md] - * std::remove[link /reference/algorithm/remove.md] - * std::remove_copy[link /reference/algorithm/remove_copy.md] - * std::remove_copy_if[link /reference/algorithm/remove_copy_if.md] - * std::remove_if[link /reference/algorithm/remove_if.md] - * std::replace[link /reference/algorithm/replace.md] - * std::replace_copy[link /reference/algorithm/replace_copy.md] - * std::replace_copy_if[link /reference/algorithm/replace_copy_if.md] - * std::replace_if[link /reference/algorithm/replace_if.md] - * std::reverse[link /reference/algorithm/reverse.md] - * std::reverse_copy[link /reference/algorithm/reverse_copy.md] - * std::rotate[link /reference/algorithm/rotate.md] - * std::rotate_copy[link /reference/algorithm/rotate_copy.md] - * std::sample[link /reference/algorithm/sample.md] - * std::search[link /reference/algorithm/search.md] - * std::search_n[link /reference/algorithm/search_n.md] - * std::set_difference[link /reference/algorithm/set_difference.md] - * std::set_intersection[link /reference/algorithm/set_intersection.md] - * std::set_symmetric_difference[link /reference/algorithm/set_symmetric_difference.md] - * std::set_union[link /reference/algorithm/set_union.md] - * std::shift_left[link /reference/algorithm/shift_left.md] - * std::shift_right[link /reference/algorithm/shift_right.md] - * std::shuffle[link /reference/algorithm/shuffle.md] * std::sort[link /reference/algorithm/sort.md] - * std::sort_heap[link /reference/algorithm/sort_heap.md] - * std::stable_partition[link /reference/algorithm/stable_partition.md] - * std::stable_sort[link /reference/algorithm/stable_sort.md] - * std::swap_ranges[link /reference/algorithm/swap_ranges.md] - * std::transform[link /reference/algorithm/transform.md] - * std::unique[link /reference/algorithm/unique.md] - * std::unique_copy[link /reference/algorithm/unique_copy.md] - * std::upper_bound[link /reference/algorithm/upper_bound.md] - * ranges::adjacent_find[link /reference/algorithm/ranges_adjacent_find.md] - * ranges::all_of[link /reference/algorithm/ranges_all_of.md] - * ranges::any_of[link /reference/algorithm/ranges_any_of.md] - * ranges::binary_search[link /reference/algorithm/ranges_binary_search.md] - * ranges::clamp[link /reference/algorithm/ranges_clamp.md] - * ranges::contains[link /reference/algorithm/ranges_contains.md] - * ranges::contains_subrange[link /reference/algorithm/ranges_contains_subrange.md] - * ranges::copy[link /reference/algorithm/ranges_copy.md] - * ranges::copy_backward[link /reference/algorithm/ranges_copy_backward.md] - * ranges::copy_if[link /reference/algorithm/ranges_copy_if.md] - * ranges::copy_n[link /reference/algorithm/ranges_copy_n.md] - * ranges::count[link /reference/algorithm/ranges_count.md] - * ranges::count_if[link /reference/algorithm/ranges_count_if.md] - * ranges::ends_with[link /reference/algorithm/ranges_ends_with.md] - * ranges::equal[link /reference/algorithm/ranges_equal.md] - * ranges::equal_range[link /reference/algorithm/ranges_equal_range.md] - * ranges::fill[link /reference/algorithm/ranges_fill.md] - * ranges::fill_n[link /reference/algorithm/ranges_fill_n.md] - * ranges::find[link /reference/algorithm/ranges_find.md] - * ranges::find_end[link /reference/algorithm/ranges_find_end.md] - * ranges::find_first_of[link /reference/algorithm/ranges_find_first_of.md] - * ranges::find_if[link /reference/algorithm/ranges_find_if.md] - * ranges::find_if_not[link /reference/algorithm/ranges_find_if_not.md] - * ranges::find_last[link /reference/algorithm/ranges_find_last.md] - * ranges::find_last_if[link /reference/algorithm/ranges_find_last_if.md] - * ranges::find_last_if_not[link /reference/algorithm/ranges_find_last_if_not.md] - * ranges::fold_left[link /reference/algorithm/ranges_fold_left.md] - * ranges::fold_left_first[link /reference/algorithm/ranges_fold_left_first.md] - * ranges::fold_left_first_with_iter[link /reference/algorithm/ranges_fold_left_first_with_iter.md] - * ranges::fold_left_with_iter[link /reference/algorithm/ranges_fold_left_with_iter.md] - * ranges::fold_right[link /reference/algorithm/ranges_fold_right.md] - * ranges::fold_right_last[link /reference/algorithm/ranges_fold_right_last.md] - * ranges::for_each[link /reference/algorithm/ranges_for_each.md] - * ranges::for_each_n[link /reference/algorithm/ranges_for_each_n.md] - * ranges::generate[link /reference/algorithm/ranges_generate.md] - * ranges::generate_n[link /reference/algorithm/ranges_generate_n.md] - * ranges::in_found_result[link /reference/algorithm/ranges_in_found_result.md] - * ranges::in_fun_result[link /reference/algorithm/ranges_in_fun_result.md] - * ranges::in_in_out_result[link /reference/algorithm/ranges_in_in_out_result.md] - * ranges::in_in_result[link /reference/algorithm/ranges_in_in_result.md] - * ranges::in_out_out_result[link /reference/algorithm/ranges_in_out_out_result.md] - * ranges::in_out_result[link /reference/algorithm/ranges_in_out_result.md] - * ranges::in_value_result[link /reference/algorithm/ranges_in_value_result.md] - * ranges::includes[link /reference/algorithm/ranges_includes.md] - * ranges::inplace_merge[link /reference/algorithm/ranges_inplace_merge.md] - * ranges::is_heap[link /reference/algorithm/ranges_is_heap.md] - * ranges::is_heap_until[link /reference/algorithm/ranges_is_heap_until.md] - * ranges::is_partitioned[link /reference/algorithm/ranges_is_partitioned.md] - * ranges::is_permutation[link /reference/algorithm/ranges_is_permutation.md] - * ranges::is_sorted[link /reference/algorithm/ranges_is_sorted.md] - * ranges::is_sorted_until[link /reference/algorithm/ranges_is_sorted_until.md] - * ranges::lexicographical_compare[link /reference/algorithm/ranges_lexicographical_compare.md] - * ranges::lower_bound[link /reference/algorithm/ranges_lower_bound.md] - * ranges::make_heap[link /reference/algorithm/ranges_make_heap.md] - * ranges::max[link /reference/algorithm/ranges_max.md] - * ranges::max_element[link /reference/algorithm/ranges_max_element.md] - * ranges::merge[link /reference/algorithm/ranges_merge.md] - * ranges::min[link /reference/algorithm/ranges_min.md] - * ranges::min_element[link /reference/algorithm/ranges_min_element.md] - * ranges::min_max_result[link /reference/algorithm/ranges_min_max_result.md] - * ranges::minmax[link /reference/algorithm/ranges_minmax.md] - * ranges::minmax_element[link /reference/algorithm/ranges_minmax_element.md] - * ranges::mismatch[link /reference/algorithm/ranges_mismatch.md] - * ranges::move[link /reference/algorithm/ranges_move.md] - * ranges::move_backward[link /reference/algorithm/ranges_move_backward.md] - * ranges::next_permutation[link /reference/algorithm/ranges_next_permutation.md] - * ranges::none_of[link /reference/algorithm/ranges_none_of.md] - * ranges::nth_element[link /reference/algorithm/ranges_nth_element.md] - * ranges::out_value_result[link /reference/algorithm/ranges_out_value_result.md] - * ranges::partial_sort[link /reference/algorithm/ranges_partial_sort.md] - * ranges::partial_sort_copy[link /reference/algorithm/ranges_partial_sort_copy.md] - * ranges::partition[link /reference/algorithm/ranges_partition.md] - * ranges::partition_copy[link /reference/algorithm/ranges_partition_copy.md] - * ranges::partition_point[link /reference/algorithm/ranges_partition_point.md] - * ranges::pop_heap[link /reference/algorithm/ranges_pop_heap.md] - * ranges::prev_permutation[link /reference/algorithm/ranges_prev_permutation.md] - * ranges::push_heap[link /reference/algorithm/ranges_push_heap.md] - * ranges::remove[link /reference/algorithm/ranges_remove.md] - * ranges::remove_copy[link /reference/algorithm/ranges_remove_copy.md] - * ranges::remove_copy_if[link /reference/algorithm/ranges_remove_copy_if.md] - * ranges::remove_if[link /reference/algorithm/ranges_remove_if.md] - * ranges::replace[link /reference/algorithm/ranges_replace.md] - * ranges::replace_copy[link /reference/algorithm/ranges_replace_copy.md] - * ranges::replace_copy_if[link /reference/algorithm/ranges_replace_copy_if.md] - * ranges::replace_if[link /reference/algorithm/ranges_replace_if.md] - * ranges::reverse[link /reference/algorithm/ranges_reverse.md] - * ranges::reverse_copy[link /reference/algorithm/ranges_reverse_copy.md] - * ranges::rotate[link /reference/algorithm/ranges_rotate.md] - * ranges::rotate_copy[link /reference/algorithm/ranges_rotate_copy.md] - * ranges::sample[link /reference/algorithm/ranges_sample.md] - * ranges::search[link /reference/algorithm/ranges_search.md] - * ranges::search_n[link /reference/algorithm/ranges_search_n.md] - * ranges::set_difference[link /reference/algorithm/ranges_set_difference.md] - * ranges::set_intersection[link /reference/algorithm/ranges_set_intersection.md] - * ranges::set_symmetric_difference[link /reference/algorithm/ranges_set_symmetric_difference.md] - * ranges::set_union[link /reference/algorithm/ranges_set_union.md] - * ranges::shift_left[link /reference/algorithm/ranges_shift_left.md] - * ranges::shift_right[link /reference/algorithm/ranges_shift_right.md] - * ranges::shuffle[link /reference/algorithm/ranges_shuffle.md] - * ranges::sort[link /reference/algorithm/ranges_sort.md] - * ranges::sort_heap[link /reference/algorithm/ranges_sort_heap.md] - * ranges::stable_partition[link /reference/algorithm/ranges_stable_partition.md] - * ranges::stable_sort[link /reference/algorithm/ranges_stable_sort.md] - * ranges::starts_with[link /reference/algorithm/ranges_starts_with.md] - * ranges::swap_ranges[link /reference/algorithm/ranges_swap_ranges.md] - * ranges::transform[link /reference/algorithm/ranges_transform.md] - * ranges::unique[link /reference/algorithm/ranges_unique.md] - * ranges::unique_copy[link /reference/algorithm/ranges_unique_copy.md] - * ranges::upper_bound[link /reference/algorithm/ranges_upper_bound.md] - * [link /reference/any.md] * [link /reference/array.md] * std::array[link /reference/array/array.md] From f52245801379796df95cd3829341795846bfd15b Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Tue, 8 Jul 2025 19:57:31 +0900 Subject: [PATCH 2125/3948] new page `cstdlib/realloc` --- reference/cstdlib/realloc.md | 79 ++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 reference/cstdlib/realloc.md diff --git a/reference/cstdlib/realloc.md b/reference/cstdlib/realloc.md new file mode 100644 index 0000000000..3b807a5b82 --- /dev/null +++ b/reference/cstdlib/realloc.md @@ -0,0 +1,79 @@ +# realloc +* cstdlib[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +namespace std { + void* realloc(void* ptr, size_t new_size); +} +``` + +## 概要 +確保済みの領域`ptr`を`new_size`に再確保する。 + +`ptr`は、`calloc`、`malloc`、`realloc`で事前に確保され、なおかつ`free`で解放されていないメモリである必要がある。 + +それ以外のメモリの場合、動作は未定義である。 + +`ptr`に`nullptr`を渡した場合、`malloc(new_size)`として動作する。 + +## 効果 +メモリの確保は次のいずれかの方法で行われる。 + + - 既存のメモリを拡張、縮小する。 + + 縮小した場合、再確保されたメモリのサイズまでの領域の内容が保持される。 + + 拡張した場合、新しい領域の内容は未定義である。 + + - 新しいサイズの領域を確保、割り当てする。その後、新しいサイズと古いサイズのいずれか小さい方のサイズに等しいメモリ領域をコピーし、古いブロックを解放する。 + + - メモリが不足している場合、`nullpte`が返される。 + +## 備考 +`new_size`が0の場合の動作は定義されていない。 + +## 戻り値 +再確保できた場合、その領域の先頭のポインタを返す。 + +なお、その領域はメモリリークを避けるため、`free`、`realloc`で解放する必要がある。 + +失敗した場合、`nullptr`を返す。もとのポインタは有効なままで、解放する必要がある。 + +## 例 +```cpp example +#include +#include + +int main() { + // 初期サイズでメモリを確保 + int* p = static_cast(std::malloc(5 * sizeof(int))); + if (!p) return 1; + for (int i = 0; i < 5; ++i) { + p[i] = i; + } + // サイズを再確保(拡張) + int* q = static_cast(std::realloc(p, 10 * sizeof(int))); + if (!q) { + std::free(p); + std::cerr << "realloc failed" << std::endl; + return 1; + }// 拡張後の内容を出力(追加領域の値は未定義) + for (int i = 0; i < 10; ++i) { + std::cout << q[i] << ' '; + } + std::cout << std::endl; + std::free(q); +} +``` +## 出力例 +``` +0 1 2 3 4 0 0 0 0 0 +``` + + +## 関連項目 +- [`calloc`](calloc.md): メモリを確保する +- [`malloc`](malloc.md): メモリを確保し、領域をゼロ初期化する +- [`free`](free.md): 確保したメモリを解放する From cbd69c8038354d117679bbe7986d99e084c8d1ee Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Tue, 8 Jul 2025 19:58:18 +0900 Subject: [PATCH 2126/3948] add path to `realloc` --- reference/cstdlib.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdlib.md b/reference/cstdlib.md index 58f0765e8c..560a7fc6da 100644 --- a/reference/cstdlib.md +++ b/reference/cstdlib.md @@ -42,7 +42,7 @@ | [`aligned_alloc`](cstdlib/aligned_alloc.md) | 指定したアライメントでメモリを確保する (function) | C++17 | | [`malloc`](cstdlib/malloc.md) | メモリを確保する (function) | | | [`calloc`](cstdlib/calloc.md) | メモリを確保し、領域をゼロ初期化する (function) | | -| [`realloc`](cstdlib/realloc.md.nolink) | メモリを再確保する (function) | | +| [`realloc`](cstdlib/realloc.md) | メモリを再確保する (function) | | | [`free`](cstdlib/free.md) | 確保したメモリを解放する (function) | | From 50d4d183f04bd9747a1a6506627836c9db067a1b Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Tue, 8 Jul 2025 19:58:28 +0900 Subject: [PATCH 2127/3948] delete .nolink to `realloc` --- reference/cstdlib/free.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdlib/free.md b/reference/cstdlib/free.md index 8d785c8089..5ebd2ff786 100644 --- a/reference/cstdlib/free.md +++ b/reference/cstdlib/free.md @@ -45,4 +45,4 @@ int main(void) - [`aligned_alloc`](aligned_alloc.md):指定したアライメントでメモリを確保する - [`malloc`](malloc.md):メモリを確保する - [`calloc`](calloc.md):メモリを確保する(0で初期化する) -- [`realloc`](realloc.md.nolink):メモリを再確保する +- [`realloc`](realloc.md):メモリを再確保する From 56437ced601cee2e9ca6a80c6c5c1acd88a4e088 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Tue, 8 Jul 2025 20:57:19 +0900 Subject: [PATCH 2128/3948] update --- reference/cstdlib/realloc.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/cstdlib/realloc.md b/reference/cstdlib/realloc.md index 3b807a5b82..5082139917 100644 --- a/reference/cstdlib/realloc.md +++ b/reference/cstdlib/realloc.md @@ -14,7 +14,7 @@ namespace std { `ptr`は、`calloc`、`malloc`、`realloc`で事前に確保され、なおかつ`free`で解放されていないメモリである必要がある。 -それ以外のメモリの場合、動作は未定義である。 +それ以外のメモリの場合、動作は未定義。 `ptr`に`nullptr`を渡した場合、`malloc(new_size)`として動作する。 @@ -25,7 +25,7 @@ namespace std { 縮小した場合、再確保されたメモリのサイズまでの領域の内容が保持される。 - 拡張した場合、新しい領域の内容は未定義である。 + 拡張した場合、新しい領域の内容は未定義。 - 新しいサイズの領域を確保、割り当てする。その後、新しいサイズと古いサイズのいずれか小さい方のサイズに等しいメモリ領域をコピーし、古いブロックを解放する。 From 3f31163a0b1c6633b1c6940c4493066da0f339bc Mon Sep 17 00:00:00 2001 From: suomesta Date: Tue, 8 Jul 2025 22:32:19 +0900 Subject: [PATCH 2129/3948] improve std::derived_from --- reference/concepts/derived_from.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/reference/concepts/derived_from.md b/reference/concepts/derived_from.md index 869a70edd1..2951ef9a95 100644 --- a/reference/concepts/derived_from.md +++ b/reference/concepts/derived_from.md @@ -27,7 +27,7 @@ namespace std { - `Base`は`Derived`の曖昧ではない`public`継承されたクラスである - `Base`と`Derived`はCV修飾の違いを除いて同じクラス型である -`Derived`が`Base`を公開継承しない場合、[`std::is_base_of`](/reference/type_traits/is_base_of.md)の判定とは異なる結果となる。 +`Derived`が`Base`を公開継承しない場合、[`std::is_base_of`](/reference/type_traits/is_base_of.md)の判定とは異なる結果となる。 ## 例 ```cpp example @@ -42,16 +42,16 @@ void check_derived() { template void check_derived() { - std::cout << "U and T are others" << std::endl; + std::cout << "U is not base class of T" << std::endl; } struct Base {}; //public継承 struct Derived1 : Base {}; -//private +//private継承 struct Derived2 : private Base {}; -//protected +//protected継承 struct Derived3 : protected Base {}; //曖昧な継承 struct Derived4 : Base, Derived1 {}; @@ -79,12 +79,12 @@ int main() ### 出力 ``` -U and T are others +U is not base class of T U is base class of T U is base class of T -U and T are others -U and T are others -U and T are others +U is not base class of T +U is not base class of T +U is not base class of T U is base class of T U is base class of T U is base class of T From b7d05c0d904106c98c194f1a9cac27ad71253e8e Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Tue, 8 Jul 2025 22:49:10 +0900 Subject: [PATCH 2130/3948] =?UTF-8?q?deque::erase():=20=E3=82=A4=E3=83=86?= =?UTF-8?q?=E3=83=AC=E3=83=BC=E3=82=BF=E3=81=A8=E5=8F=82=E7=85=A7=E3=81=AE?= =?UTF-8?q?=E7=84=A1=E5=8A=B9=E5=8C=96=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6?= =?UTF-8?q?=E5=BE=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/deque/deque/erase.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/deque/deque/erase.md b/reference/deque/deque/erase.md index 303d0facb7..8d31747777 100644 --- a/reference/deque/deque/erase.md +++ b/reference/deque/deque/erase.md @@ -20,7 +20,7 @@ iterator erase(const_iterator first, const_iterator last); // (2) C++11 - (1) : `position`が指す要素を削除する。 - (2) : イテレータ範囲`[first, last)`の要素を削除する。 -もし削除がシーケンスの先頭または末尾から行われた場合、削除された要素へのイテレータと参照は無効化される。もし削除が中間位置から行われた場合、全てのイテレータと削除は無効化される。 +もし削除がシーケンスの先頭または末尾から行われた場合、削除された要素へのイテレータと参照だけが無効化される(そのほかの要素への参照/イテレータは有効であり続ける)。一方、削除が中間位置から行われた場合は全てのイテレータと参照が無効化される。 ## 戻り値 From bada4782a24270e3b9c77d4ddaf87e8fd932f978 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 8 Jul 2025 23:06:30 +0900 Subject: [PATCH 2131/3948] =?UTF-8?q?realloc=20:=20=E6=9C=AA=E5=AE=9A?= =?UTF-8?q?=E7=BE=A9=20=E2=86=92=20=E6=9C=AA=E8=A6=8F=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/realloc.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdlib/realloc.md b/reference/cstdlib/realloc.md index 5082139917..69648d655f 100644 --- a/reference/cstdlib/realloc.md +++ b/reference/cstdlib/realloc.md @@ -25,7 +25,7 @@ namespace std { 縮小した場合、再確保されたメモリのサイズまでの領域の内容が保持される。 - 拡張した場合、新しい領域の内容は未定義。 + 拡張した場合、新しい領域の内容は未規定。 - 新しいサイズの領域を確保、割り当てする。その後、新しいサイズと古いサイズのいずれか小さい方のサイズに等しいメモリ領域をコピーし、古いブロックを解放する。 From 0c244fb2734e3824d2e86eda81c8610bd1e4f97b Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 8 Jul 2025 23:06:37 +0900 Subject: [PATCH 2132/3948] realloc : fix typo --- reference/cstdlib/realloc.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdlib/realloc.md b/reference/cstdlib/realloc.md index 69648d655f..ff0dada9d3 100644 --- a/reference/cstdlib/realloc.md +++ b/reference/cstdlib/realloc.md @@ -29,7 +29,7 @@ namespace std { - 新しいサイズの領域を確保、割り当てする。その後、新しいサイズと古いサイズのいずれか小さい方のサイズに等しいメモリ領域をコピーし、古いブロックを解放する。 - - メモリが不足している場合、`nullpte`が返される。 + - メモリが不足している場合、`nullptr`が返される。 ## 備考 `new_size`が0の場合の動作は定義されていない。 From 89af337229e0e55fccff475dc596b66b78960384 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 8 Jul 2025 23:28:00 +0900 Subject: [PATCH 2133/3948] =?UTF-8?q?realloc:=20=E6=9C=AA=E5=AE=9A?= =?UTF-8?q?=E7=BE=A9=20=E2=86=92=20=E6=9C=AA=E8=A6=8F=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/realloc.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdlib/realloc.md b/reference/cstdlib/realloc.md index ff0dada9d3..be2e9cf1a7 100644 --- a/reference/cstdlib/realloc.md +++ b/reference/cstdlib/realloc.md @@ -59,7 +59,7 @@ int main() { std::free(p); std::cerr << "realloc failed" << std::endl; return 1; - }// 拡張後の内容を出力(追加領域の値は未定義) + }// 拡張後の内容を出力(追加領域の値は未規定) for (int i = 0; i < 10; ++i) { std::cout << q[i] << ' '; } From 7f399059bd0da68a435467af802301edc159f12e Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 9 Jul 2025 00:10:29 +0900 Subject: [PATCH 2134/3948] =?UTF-8?q?realloc=20:=20=E3=82=A4=E3=83=B3?= =?UTF-8?q?=E3=83=87=E3=83=B3=E3=83=88=E3=81=AE=E3=82=A8=E3=83=A9=E3=83=BC?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/realloc.md | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/reference/cstdlib/realloc.md b/reference/cstdlib/realloc.md index be2e9cf1a7..a42e20d5c6 100644 --- a/reference/cstdlib/realloc.md +++ b/reference/cstdlib/realloc.md @@ -21,15 +21,11 @@ namespace std { ## 効果 メモリの確保は次のいずれかの方法で行われる。 - - 既存のメモリを拡張、縮小する。 - - 縮小した場合、再確保されたメモリのサイズまでの領域の内容が保持される。 - - 拡張した場合、新しい領域の内容は未規定。 - - - 新しいサイズの領域を確保、割り当てする。その後、新しいサイズと古いサイズのいずれか小さい方のサイズに等しいメモリ領域をコピーし、古いブロックを解放する。 - - - メモリが不足している場合、`nullptr`が返される。 +- 既存のメモリを拡張、縮小する。 + - 縮小した場合、再確保されたメモリのサイズまでの領域の内容が保持される。 + - 拡張した場合、新しい領域の内容は未規定。 +- 新しいサイズの領域を確保、割り当てする。その後、新しいサイズと古いサイズのいずれか小さい方のサイズに等しいメモリ領域をコピーし、古いブロックを解放する。 +- メモリが不足している場合、`nullptr`が返される。 ## 備考 `new_size`が0の場合の動作は定義されていない。 From ec127b7079201b4ad45d6d985f3ae793870c301c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 9 Jul 2025 00:11:33 +0900 Subject: [PATCH 2135/3948] =?UTF-8?q?realloc=20:=20=E5=82=99=E8=80=83?= =?UTF-8?q?=E3=82=92=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/realloc.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/reference/cstdlib/realloc.md b/reference/cstdlib/realloc.md index a42e20d5c6..ac4df8fd20 100644 --- a/reference/cstdlib/realloc.md +++ b/reference/cstdlib/realloc.md @@ -27,16 +27,18 @@ namespace std { - 新しいサイズの領域を確保、割り当てする。その後、新しいサイズと古いサイズのいずれか小さい方のサイズに等しいメモリ領域をコピーし、古いブロックを解放する。 - メモリが不足している場合、`nullptr`が返される。 -## 備考 -`new_size`が0の場合の動作は定義されていない。 ## 戻り値 再確保できた場合、その領域の先頭のポインタを返す。 -なお、その領域はメモリリークを避けるため、`free`、`realloc`で解放する必要がある。 - 失敗した場合、`nullptr`を返す。もとのポインタは有効なままで、解放する必要がある。 + +## 備考 +- `new_size`が0の場合の動作は未規定。 +- 確保された領域はメモリリークを避けるため、`free`、`realloc`で解放する必要がある。 + + ## 例 ```cpp example #include From d1283b625f5b230d96cca41c4b2cfe5378dfa6fd Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 9 Jul 2025 00:29:41 +0900 Subject: [PATCH 2136/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE?= =?UTF-8?q?=E9=A3=BE=E3=81=AE=E9=87=8D=E8=A4=87=E3=82=92=E5=89=8A=E9=99=A4?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=82=B9=E3=82=AF=E3=83=AA=E3=83=97=E3=83=88?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../script/remove_duplicated_qualify.py | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 .github/workflows/script/remove_duplicated_qualify.py diff --git a/.github/workflows/script/remove_duplicated_qualify.py b/.github/workflows/script/remove_duplicated_qualify.py new file mode 100644 index 0000000000..dcd253f3b3 --- /dev/null +++ b/.github/workflows/script/remove_duplicated_qualify.py @@ -0,0 +1,75 @@ +import os +import re +from pathlib import Path + +# GLOBAL_QUALIFY_LIST.txtを読み込んで、コード修飾パターンを抽出 +def load_global_qualify_patterns(): + patterns = [] + with open('GLOBAL_QUALIFY_LIST.txt', 'r', encoding='utf-8') as f: + for line in f: + line = line.strip() + if line and line.startswith('*'): + # "* pattern[link path]" の形式からpatternを抽出 + match = re.match(r'\*\s+(.+?)\[link\s+.+?\]', line) + if match: + pattern = match.group(1) + # 正規表現用にエスケープ + escaped_pattern = re.escape(pattern) + patterns.append(escaped_pattern) + + # パターンを一つの正規表現に結合(OR条件) + if patterns: + combined_pattern = r'\*\s+(?:' + '|'.join(patterns) + r')\[link\s+.+?\]' + return re.compile(combined_pattern) + return None + +# ファイルを処理して、該当する行を削除 +def process_file(file_path, pattern_regex): + if pattern_regex is None: + return 0 + + with open(file_path, 'r', encoding='utf-8') as f: + lines = f.readlines() + + new_lines = [] + removed_count = 0 + + for line in lines: + if pattern_regex.search(line): + removed_count += 1 + else: + new_lines.append(line) + + if removed_count > 0: + with open(file_path, 'w', encoding='utf-8') as f: + f.writelines(new_lines) + print(f"{file_path}: {removed_count} 行を削除しました") + + return removed_count + +def main(): + # GLOBAL_QUALIFY_LIST.txtからパターンを読み込む + pattern_regex = load_global_qualify_patterns() + if pattern_regex is None: + print("パターンが見つかりませんでした") + return + + # すべての.mdファイルを処理 + total_removed = 0 + processed_files = 0 + total_files = 0 + + for md_file in Path('.').rglob('*.md'): + removed = process_file(md_file, pattern_regex) + if removed > 0: + processed_files += 1 + total_removed += removed + + print(f"\n処理完了:") + print(f" スキャンしたファイル数: {total_files}") + print(f" 変更したファイル数: {processed_files}") + print(f" 削除した行数: {total_removed}") + +if __name__ == '__main__': + main() + From 7bcebc80e130e5299fc89d05a3f276aecf5d65ec Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 9 Jul 2025 00:33:39 +0900 Subject: [PATCH 2137/3948] =?UTF-8?q?=E9=87=8D=E8=A4=87=E7=99=BB=E9=8C=B2?= =?UTF-8?q?=E3=81=95=E3=82=8C=E3=81=9F=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE?= =?UTF-8?q?=E9=A3=BE=E3=83=AA=E3=83=B3=E3=82=AF=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp11/decltype.md | 1 - lang/cpp11/rvalue_ref_and_move_semantics.md | 1 - lang/cpp11/thread_local_storage.md | 1 - lang/cpp11/variadic_templates.md | 1 - lang/cpp17/if_constexpr.md | 1 - ...ss_objects_containing_reference_members.md | 1 - lang/cpp17/structured_bindings.md | 2 - lang/cpp20/concepts.md | 1 - lang/cpp20/consistent_comparison.md | 1 - lang/cpp20/coroutines.md | 1 - ...iar_template_syntax_for_generic_lambdas.md | 2 - .../signed_integers_are_twos_complement.md | 5 -- reference/algorithm/adjacent_find.md | 4 -- reference/algorithm/all_of.md | 6 -- reference/algorithm/any_of.md | 6 -- reference/algorithm/binary_search.md | 5 -- reference/algorithm/clamp.md | 2 - reference/algorithm/copy.md | 11 ---- reference/algorithm/copy_backward.md | 5 -- reference/algorithm/copy_if.md | 13 ----- reference/algorithm/copy_n.md | 4 -- reference/algorithm/count.md | 11 ---- reference/algorithm/count_if.md | 6 -- reference/algorithm/equal.md | 8 --- reference/algorithm/equal_range.md | 12 ---- reference/algorithm/fill.md | 5 -- reference/algorithm/fill_n.md | 2 - reference/algorithm/find.md | 5 -- reference/algorithm/find_end.md | 7 --- reference/algorithm/find_first_of.md | 7 --- reference/algorithm/find_if.md | 5 -- reference/algorithm/find_if_not.md | 5 -- reference/algorithm/for_each.md | 5 -- reference/algorithm/for_each_n.md | 4 -- reference/algorithm/generate.md | 5 -- reference/algorithm/generate_n.md | 2 - reference/algorithm/includes.md | 4 -- reference/algorithm/inplace_merge.md | 6 -- reference/algorithm/is_heap.md | 6 -- reference/algorithm/is_heap_until.md | 6 -- reference/algorithm/is_partitioned.md | 6 -- reference/algorithm/is_permutation.md | 8 --- reference/algorithm/is_sorted.md | 7 --- reference/algorithm/is_sorted_until.md | 7 --- reference/algorithm/iter_swap.md | 8 --- .../algorithm/lexicographical_compare.md | 3 - .../lexicographical_compare_three_way.md | 3 - reference/algorithm/lower_bound.md | 9 --- reference/algorithm/make_heap.md | 4 -- reference/algorithm/max.md | 1 - reference/algorithm/max_element.md | 7 --- reference/algorithm/merge.md | 5 -- reference/algorithm/min.md | 1 - reference/algorithm/min_element.md | 7 --- reference/algorithm/minmax.md | 3 - reference/algorithm/minmax_element.md | 5 -- reference/algorithm/mismatch.md | 11 ---- reference/algorithm/move.md | 10 ---- reference/algorithm/move_backward.md | 4 -- reference/algorithm/next_permutation.md | 6 -- reference/algorithm/none_of.md | 6 -- reference/algorithm/nth_element.md | 6 -- reference/algorithm/partial_sort.md | 6 -- reference/algorithm/partial_sort_copy.md | 6 -- reference/algorithm/partition.md | 6 -- reference/algorithm/partition_copy.md | 9 --- reference/algorithm/partition_point.md | 7 --- reference/algorithm/pop_heap.md | 6 -- reference/algorithm/prev_permutation.md | 6 -- reference/algorithm/push_heap.md | 6 -- reference/algorithm/random_shuffle.md | 8 --- reference/algorithm/ranges_adjacent_find.md | 22 -------- reference/algorithm/ranges_all_of.md | 17 ------ reference/algorithm/ranges_any_of.md | 17 ------ reference/algorithm/ranges_binary_search.md | 9 --- reference/algorithm/ranges_clamp.md | 4 -- .../algorithm/ranges_contains_subrange.md | 3 - reference/algorithm/ranges_copy.md | 4 -- reference/algorithm/ranges_copy_backward.md | 5 -- reference/algorithm/ranges_copy_if.md | 6 -- reference/algorithm/ranges_copy_n.md | 1 - reference/algorithm/ranges_count.md | 20 ------- reference/algorithm/ranges_count_if.md | 18 ------ reference/algorithm/ranges_ends_with.md | 19 ------- reference/algorithm/ranges_equal.md | 14 ----- reference/algorithm/ranges_equal_range.md | 8 --- reference/algorithm/ranges_fill.md | 3 - reference/algorithm/ranges_fill_n.md | 2 - reference/algorithm/ranges_find.md | 16 ------ reference/algorithm/ranges_find_first_of.md | 18 ------ reference/algorithm/ranges_find_if.md | 14 ----- reference/algorithm/ranges_find_if_not.md | 14 ----- reference/algorithm/ranges_find_last.md | 8 --- reference/algorithm/ranges_find_last_if.md | 7 --- .../algorithm/ranges_find_last_if_not.md | 7 --- reference/algorithm/ranges_fold_left.md | 12 ---- reference/algorithm/ranges_fold_left_first.md | 8 --- .../ranges_fold_left_first_with_iter.md | 9 --- .../algorithm/ranges_fold_left_with_iter.md | 7 --- reference/algorithm/ranges_fold_right.md | 9 --- reference/algorithm/ranges_fold_right_last.md | 11 ---- reference/algorithm/ranges_for_each.md | 13 ----- reference/algorithm/ranges_for_each_n.md | 9 --- reference/algorithm/ranges_generate.md | 5 -- reference/algorithm/ranges_generate_n.md | 3 - reference/algorithm/ranges_in_found_result.md | 1 - reference/algorithm/ranges_in_fun_result.md | 1 - .../algorithm/ranges_in_in_out_result.md | 1 - reference/algorithm/ranges_in_in_result.md | 1 - .../algorithm/ranges_in_out_out_result.md | 1 - reference/algorithm/ranges_in_out_result.md | 1 - reference/algorithm/ranges_in_value_result.md | 1 - reference/algorithm/ranges_includes.md | 6 -- reference/algorithm/ranges_inplace_merge.md | 5 -- reference/algorithm/ranges_is_heap.md | 5 -- reference/algorithm/ranges_is_heap_until.md | 5 -- reference/algorithm/ranges_is_partitioned.md | 7 --- reference/algorithm/ranges_is_permutation.md | 7 --- reference/algorithm/ranges_is_sorted.md | 6 -- reference/algorithm/ranges_is_sorted_until.md | 12 ---- .../ranges_lexicographical_compare.md | 6 -- reference/algorithm/ranges_lower_bound.md | 6 -- reference/algorithm/ranges_make_heap.md | 5 -- reference/algorithm/ranges_max.md | 5 -- reference/algorithm/ranges_max_element.md | 5 -- reference/algorithm/ranges_merge.md | 5 -- reference/algorithm/ranges_min.md | 5 -- reference/algorithm/ranges_min_element.md | 5 -- reference/algorithm/ranges_min_max_result.md | 1 - reference/algorithm/ranges_minmax.md | 5 -- reference/algorithm/ranges_minmax_element.md | 5 -- reference/algorithm/ranges_mismatch.md | 14 ----- reference/algorithm/ranges_move.md | 4 -- reference/algorithm/ranges_move_backward.md | 4 -- .../algorithm/ranges_next_permutation.md | 5 -- reference/algorithm/ranges_none_of.md | 13 ----- reference/algorithm/ranges_nth_element.md | 5 -- .../algorithm/ranges_out_value_result.md | 1 - reference/algorithm/ranges_partial_sort.md | 5 -- .../algorithm/ranges_partial_sort_copy.md | 8 --- reference/algorithm/ranges_partition.md | 8 --- reference/algorithm/ranges_partition_copy.md | 7 --- reference/algorithm/ranges_partition_point.md | 7 --- reference/algorithm/ranges_pop_heap.md | 5 -- .../algorithm/ranges_prev_permutation.md | 5 -- reference/algorithm/ranges_push_heap.md | 5 -- reference/algorithm/ranges_remove.md | 9 --- reference/algorithm/ranges_remove_copy.md | 8 --- reference/algorithm/ranges_remove_copy_if.md | 7 --- reference/algorithm/ranges_remove_if.md | 8 --- reference/algorithm/ranges_replace.md | 8 --- reference/algorithm/ranges_replace_copy.md | 9 --- reference/algorithm/ranges_replace_copy_if.md | 8 --- reference/algorithm/ranges_replace_if.md | 7 --- reference/algorithm/ranges_reverse.md | 4 -- reference/algorithm/ranges_reverse_copy.md | 4 -- reference/algorithm/ranges_rotate.md | 5 -- reference/algorithm/ranges_rotate_copy.md | 4 -- reference/algorithm/ranges_sample.md | 7 --- reference/algorithm/ranges_search.md | 18 ------ reference/algorithm/ranges_search_n.md | 20 ------- reference/algorithm/ranges_set_difference.md | 5 -- .../algorithm/ranges_set_intersection.md | 5 -- .../ranges_set_symmetric_difference.md | 5 -- reference/algorithm/ranges_set_union.md | 5 -- reference/algorithm/ranges_shift_left.md | 7 --- reference/algorithm/ranges_shift_right.md | 7 --- reference/algorithm/ranges_shuffle.md | 5 -- reference/algorithm/ranges_sort.md | 5 -- reference/algorithm/ranges_sort_heap.md | 5 -- .../algorithm/ranges_stable_partition.md | 9 --- reference/algorithm/ranges_stable_sort.md | 5 -- reference/algorithm/ranges_starts_with.md | 14 ----- reference/algorithm/ranges_swap_ranges.md | 5 -- reference/algorithm/ranges_transform.md | 7 --- reference/algorithm/ranges_unique.md | 7 --- reference/algorithm/ranges_unique_copy.md | 9 --- reference/algorithm/ranges_upper_bound.md | 6 -- reference/algorithm/set_union.md | 1 - reference/algorithm/shift_left.md | 1 - reference/algorithm/shift_right.md | 1 - reference/algorithm/shuffle.md | 1 - reference/algorithm/sort.md | 1 - reference/any/any/emplace.md | 1 - reference/array/array/swap.md | 1 - reference/array/to_array.md | 1 - reference/barrier/barrier/arrive.md | 1 - reference/barrier/barrier/arrive_and_drop.md | 1 - reference/barrier/barrier/arrive_and_wait.md | 1 - reference/barrier/barrier/wait.md | 1 - reference/bit/bit_cast.md | 1 - reference/bit/countl_one.md | 1 - reference/bit/countl_zero.md | 1 - reference/bit/countr_one.md | 1 - reference/bit/countr_zero.md | 1 - reference/bit/popcount.md | 1 - reference/bit/rotl.md | 1 - reference/bit/rotr.md | 1 - reference/bitset/bitset/count.md | 1 - reference/charconv/from_chars.md | 2 - reference/chrono/clock_time_conversion.md | 1 - reference/chrono/duration/op_compare_3way.md | 1 - reference/chrono/duration/op_ostream.md | 1 - reference/chrono/duration/op_unary_minus.md | 1 - reference/chrono/duration/op_unary_plus.md | 1 - reference/chrono/duration/op_us.md | 1 - reference/chrono/gps_clock/from_utc.md | 2 - reference/chrono/gps_clock/to_utc.md | 2 - reference/chrono/hh_mm_ss/fractional_width.md | 1 - reference/chrono/high_resolution_clock.md | 1 - .../chrono/leap_second/op_compare_3way.md | 1 - reference/chrono/steady_clock.md | 1 - reference/chrono/sys_time.md | 1 - reference/chrono/tai_clock/from_utc.md | 2 - reference/chrono/tai_clock/to_utc.md | 2 - reference/chrono/time_zone/to_local.md | 1 - reference/chrono/time_zone/to_sys.md | 1 - reference/chrono/treat_as_floating_point.md | 1 - reference/chrono/tzdb_list/begin.md | 1 - reference/chrono/tzdb_list/cbegin.md | 1 - reference/chrono/tzdb_list/cend.md | 1 - reference/chrono/tzdb_list/end.md | 1 - reference/chrono/utc_clock/from_sys.md | 1 - reference/chrono/utc_clock/to_sys.md | 1 - reference/chrono/zoned_time/op_constructor.md | 1 - .../chrono/zoned_time/op_deduction_guide.md | 2 - reference/chrono/zoned_traits/locate_zone.md | 1 - reference/cmath/hypot.md | 1 - reference/cmath/log10.md | 1 - reference/cmath/nanf.md | 1 - reference/codecvt/codecvt_utf16.md | 2 - reference/codecvt/codecvt_utf8.md | 2 - reference/codecvt/codecvt_utf8_utf16.md | 2 - reference/compare/compare_three_way.md | 1 - .../compare/compare_three_way/op_call.md | 1 - reference/compare/three_way_comparable.md | 5 -- reference/concepts/assignable_from.md | 2 - reference/concepts/boolean-testable.md | 3 - reference/concepts/common_reference_with.md | 2 - reference/concepts/common_with.md | 3 - reference/concepts/copy_constructible.md | 2 - reference/concepts/copyable.md | 1 - reference/concepts/equality_comparable.md | 4 -- reference/concepts/movable.md | 2 - reference/concepts/move_constructible.md | 1 - reference/concepts/predicate.md | 2 - reference/concepts/regular.md | 1 - reference/concepts/semiregular.md | 1 - reference/concepts/swappable.md | 2 - reference/concepts/totally_ordered.md | 3 - reference/deque/deque/op_constructor.md | 1 - reference/deque/deque/op_deduction_guide.md | 1 - reference/execution/class-type.md | 1 - reference/execution/decays-to.md | 1 - reference/execution/execution/as_awaitable.md | 1 - .../execution/execution/basic-operation.md | 2 - .../execution/execution/decayed-tuple.md | 2 - reference/execution/execution/let_value.md | 1 - .../execution/execution/operation_state.md | 1 - reference/execution/execution/receiver.md | 1 - .../execution/run_loop/run-loop-opstate.md | 1 - reference/execution/execution/scheduler.md | 1 - reference/execution/execution/sender.md | 1 - reference/execution/execution/split.md | 2 - reference/execution/execution/starts_on.md | 1 - .../execution/stopped_as_optional.md | 1 - reference/execution/execution/when_all.md | 3 - reference/execution/movable-value.md | 3 - reference/expected/expected.void/and_then.md | 2 - .../expected/expected.void/op_constructor.md | 1 - reference/expected/expected.void/or_else.md | 4 -- reference/expected/expected.void/swap.md | 1 - reference/expected/expected/and_then.md | 2 - reference/expected/expected/emplace.md | 4 -- reference/expected/expected/op_assign.md | 2 - reference/expected/expected/op_constructor.md | 1 - reference/expected/expected/or_else.md | 4 -- reference/expected/expected/swap.md | 1 - reference/expected/unexpected.md | 1 - .../expected/unexpected/op_constructor.md | 1 - .../container-compatible-range.md | 1 - reference/exposition-only/decay-copy.md | 2 - .../exposition-only/synth-three-way-result.md | 2 - .../filesystem/directory_entry/file_size.md | 1 - .../filesystem/directory_entry/refresh.md | 1 - reference/filesystem/file_size.md | 1 - reference/filesystem/resize_file.md | 1 - reference/flat_map/flat_map/emplace.md | 2 - reference/flat_map/flat_map/equal_range.md | 1 - reference/flat_map/flat_map/insert.md | 1 - .../flat_map/flat_map/insert_or_assign.md | 3 - reference/flat_map/flat_map/op_at.md | 1 - .../flat_map/flat_map/op_deduction_guide.md | 2 - reference/flat_map/flat_map/try_emplace.md | 3 - reference/flat_map/flat_map/uses_allocator.md | 1 - .../flat_map/flat_multimap/equal_range.md | 1 - .../flat_multimap/op_deduction_guide.md | 2 - .../flat_map/flat_multimap/uses_allocator.md | 1 - reference/flat_set/flat_multiset/emplace.md | 2 - .../flat_set/flat_multiset/equal_range.md | 1 - .../flat_multiset/op_deduction_guide.md | 1 - .../flat_set/flat_multiset/uses_allocator.md | 1 - reference/flat_set/flat_set/emplace.md | 3 - reference/flat_set/flat_set/equal_range.md | 1 - reference/flat_set/flat_set/insert.md | 1 - .../flat_set/flat_set/op_deduction_guide.md | 1 - reference/flat_set/flat_set/uses_allocator.md | 1 - .../format/basic_format_arg/op_constructor.md | 1 - .../format/basic_format_parse_context.md | 1 - reference/format/basic_format_string.md | 3 - reference/format/format.md | 2 - reference/format/format_to_n.md | 1 - reference/format/format_to_n_result.md | 1 - reference/format/vformat.md | 2 - reference/format/vformat_to.md | 1 - reference/format/visit_format_arg.md | 1 - .../forward_list/emplace_after.md | 1 - .../forward_list/forward_list/erase_after.md | 1 - .../forward_list/forward_list/insert_after.md | 1 - .../forward_list/op_constructor.md | 1 - .../forward_list/op_deduction_guide.md | 1 - .../forward_list/forward_list/splice_after.md | 1 - .../fstream/basic_fstream/op_constructor.md | 1 - .../fstream/basic_ifstream/op_constructor.md | 1 - .../fstream/basic_ofstream/op_constructor.md | 1 - reference/functional/bind_front.md | 1 - .../boyer_moore_horspool_searcher.md | 1 - reference/functional/boyer_moore_searcher.md | 1 - .../functional/copyable_function/op_equal.md | 1 - .../copyable_function/op_not_equal.md | 1 - reference/functional/divides.md | 1 - reference/functional/equal_to.md | 1 - reference/functional/function/assign.md | 1 - .../functional/function/op_constructor.md | 1 - reference/functional/function/op_equal.md | 1 - reference/functional/function/op_not_equal.md | 1 - reference/functional/function_ref/op_call.md | 1 - reference/functional/greater.md | 1 - reference/functional/greater_equal.md | 1 - reference/functional/invoke.md | 1 - reference/functional/less.md | 1 - reference/functional/less_equal.md | 1 - reference/functional/logical_and.md | 1 - reference/functional/logical_not.md | 1 - reference/functional/logical_or.md | 1 - reference/functional/minus.md | 1 - reference/functional/modulus.md | 1 - reference/functional/move_only_function.md | 1 - .../functional/move_only_function/op_equal.md | 1 - .../move_only_function/op_not_equal.md | 1 - reference/functional/multiplies.md | 1 - reference/functional/negate.md | 1 - reference/functional/not_equal_to.md | 1 - reference/functional/not_fn.md | 3 - reference/functional/plus.md | 1 - reference/future/async.md | 3 - reference/future/make_error_condition.md | 1 - reference/generator/generator/end.md | 1 - .../generator/generator/iterator/op_equal.md | 1 - .../generator/promise_type/op_new.md | 2 - .../generator/promise_type/yield_value.md | 5 -- .../initializer_list/end_free.md | 1 - reference/ios/ios_base/setf.md | 1 - reference/ios/ios_base/type-fmtflags.md | 1 - reference/ios/ios_base/type-iostate.md | 1 - reference/ios/ios_base/unsetf.md | 1 - reference/ios/make_error_condition.md | 1 - reference/ios/noskipws.md | 1 - reference/ios/skipws.md | 1 - reference/istream/basic_istream/readsome.md | 1 - reference/istream/basic_istream/seekg.md | 1 - reference/istream/basic_istream/tellg.md | 1 - reference/istream/basic_istream/unget.md | 1 - reference/iterator/basic_const_iterator.md | 1 - .../basic_const_iterator/common_type.md | 3 - .../basic_const_iterator/iter_move.md | 2 - .../iterator/basic_const_iterator/op_arrow.md | 2 - .../iterator/basic_const_iterator/op_at.md | 1 - .../basic_const_iterator/op_compare_3way.md | 2 - .../basic_const_iterator/op_constructor.md | 2 - .../basic_const_iterator/op_decrement.md | 1 - .../iterator/basic_const_iterator/op_equal.md | 1 - .../basic_const_iterator/op_greater.md | 1 - .../basic_const_iterator/op_greater_equal.md | 1 - .../basic_const_iterator/op_increment.md | 1 - .../iterator/basic_const_iterator/op_less.md | 1 - .../basic_const_iterator/op_less_equal.md | 1 - .../basic_const_iterator/op_minus_assign.md | 1 - .../iterator/basic_const_iterator/op_plus.md | 1 - .../basic_const_iterator/op_plus_assign.md | 1 - .../basic_const_iterator/op_unary_minus.md | 1 - reference/iterator/bidirectional_iterator.md | 1 - reference/iterator/cbegin.md | 1 - reference/iterator/cend.md | 1 - reference/iterator/common_iterator.md | 8 --- .../iterator/common_iterator/iter_move.md | 5 -- .../iterator/common_iterator/iter_swap.md | 4 -- .../iterator/common_iterator/op_arrow.md | 4 -- .../iterator/common_iterator/op_assign.md | 1 - .../common_iterator/op_constructor.md | 6 -- .../iterator/common_iterator/op_deref.md | 3 - .../iterator/common_iterator/op_equal.md | 4 -- .../iterator/common_iterator/op_increment.md | 3 - .../iterator/common_iterator/op_minus.md | 4 -- reference/iterator/const_iterator.md | 1 - reference/iterator/constant-iterator.md | 56 +++++++++---------- reference/iterator/contiguous_iterator.md | 2 - reference/iterator/counted_iterator.md | 6 -- reference/iterator/counted_iterator/base.md | 1 - reference/iterator/counted_iterator/count.md | 2 - .../iterator/counted_iterator/iter_move.md | 4 -- .../iterator/counted_iterator/iter_swap.md | 4 -- .../iterator/counted_iterator/op_arrow.md | 2 - reference/iterator/counted_iterator/op_at.md | 3 - .../counted_iterator/op_compare_3way.md | 3 - .../counted_iterator/op_constructor.md | 4 -- .../iterator/counted_iterator/op_decrement.md | 2 - .../iterator/counted_iterator/op_deref.md | 1 - .../iterator/counted_iterator/op_equal.md | 4 -- .../iterator/counted_iterator/op_increment.md | 2 - .../iterator/counted_iterator/op_minus.md | 3 - .../counted_iterator/op_minus_assign.md | 3 - .../iterator/counted_iterator/op_plus.md | 3 - .../counted_iterator/op_plus_assign.md | 3 - .../counted_iterator/op_unary_minus.md | 3 - reference/iterator/default_sentinel_t.md | 1 - reference/iterator/forward_iterator.md | 2 - reference/iterator/incrementable_traits.md | 2 - .../iterator/indirect_binary_predicate.md | 2 - .../iterator/indirect_equivalence_relation.md | 2 - reference/iterator/indirect_result_t.md | 2 - .../iterator/indirect_strict_weak_order.md | 2 - .../iterator/indirect_unary_predicate.md | 2 - reference/iterator/indirectly_comparable.md | 5 -- .../iterator/indirectly_copyable_storable.md | 1 - reference/iterator/indirectly_movable.md | 1 - .../iterator/indirectly_movable_storable.md | 2 - reference/iterator/indirectly_readable.md | 3 - .../iterator/indirectly_readable_traits.md | 2 - .../iterator/indirectly_unary_invocable.md | 6 -- reference/iterator/indirectly_writable.md | 2 - .../insert_iterator/op_constructor.md | 1 - reference/iterator/is_integer_like.md | 1 - .../istream_iterator/op_constructor.md | 1 - .../istreambuf_iterator/op_constructor.md | 1 - reference/iterator/iter_common_reference_t.md | 2 - reference/iterator/iter_const_reference_t.md | 2 - reference/iterator/iter_reference_t.md | 1 - reference/iterator/iter_rvalue_reference_t.md | 1 - reference/iterator/iter_swap.md | 1 - reference/iterator/iterator_traits.md | 3 - reference/iterator/make_const_iterator.md | 1 - reference/iterator/mergeable.md | 3 - reference/iterator/move_iterator/iter_move.md | 4 -- reference/iterator/move_iterator/iter_swap.md | 3 - reference/iterator/move_iterator/op_equal.md | 1 - reference/iterator/move_iterator/op_minus.md | 1 - reference/iterator/move_iterator/op_plus.md | 1 - reference/iterator/move_sentinel.md | 2 - .../iterator/move_sentinel/op_constructor.md | 1 - reference/iterator/next.md | 1 - reference/iterator/permutable.md | 2 - reference/iterator/prev.md | 1 - reference/iterator/projected.md | 5 -- reference/iterator/random_access_iterator.md | 2 - reference/iterator/ranges_advance.md | 4 -- reference/iterator/ranges_distance.md | 6 -- reference/iterator/ranges_next.md | 3 - reference/iterator/ranges_prev.md | 2 - reference/iterator/reverse_iterator.md | 1 - .../iterator/reverse_iterator/iter_move.md | 4 -- .../iterator/reverse_iterator/iter_swap.md | 4 -- reference/iterator/sized_sentinel_for.md | 3 - reference/iterator/sortable.md | 2 - reference/iterator/ssize.md | 1 - reference/iterator/weakly_incrementable.md | 1 - .../limits/numeric_limits/max_digits10.md | 1 - reference/linalg/hermitian_matrix_product.md | 3 - .../linalg/hermitian_matrix_rank_1_update.md | 3 - .../linalg/hermitian_matrix_rank_2_update.md | 3 - .../linalg/hermitian_matrix_rank_2k_update.md | 3 - .../linalg/hermitian_matrix_rank_k_update.md | 3 - .../linalg/hermitian_matrix_vector_product.md | 3 - reference/linalg/layout_blas_packed.md | 1 - .../linalg/layout_blas_packed/mapping.md | 1 - reference/linalg/matrix_product.md | 2 - reference/linalg/matrix_rank_1_update.md | 2 - reference/linalg/matrix_rank_1_update_c.md | 2 - reference/linalg/matrix_vector_product.md | 2 - reference/linalg/symmetric_matrix_product.md | 3 - .../linalg/symmetric_matrix_rank_1_update.md | 3 - .../linalg/symmetric_matrix_rank_2_update.md | 3 - .../linalg/symmetric_matrix_rank_2k_update.md | 3 - .../linalg/symmetric_matrix_rank_k_update.md | 3 - .../linalg/symmetric_matrix_vector_product.md | 3 - .../linalg/triangular_matrix_left_product.md | 3 - .../triangular_matrix_matrix_left_solve.md | 3 - .../triangular_matrix_matrix_right_solve.md | 3 - reference/linalg/triangular_matrix_product.md | 3 - .../linalg/triangular_matrix_right_product.md | 3 - .../triangular_matrix_vector_product.md | 3 - .../linalg/triangular_matrix_vector_solve.md | 3 - reference/list/list/erase.md | 1 - reference/list/list/insert.md | 1 - reference/list/list/op_constructor.md | 1 - reference/list/list/op_deduction_guide.md | 1 - reference/map/map.md | 3 - reference/map/map/emplace.md | 2 - reference/map/map/equal_range.md | 1 - reference/map/map/insert.md | 1 - reference/map/map/insert_or_assign.md | 1 - reference/map/map/op_compare_3way.md | 1 - reference/map/map/op_constructor.md | 1 - reference/map/map/op_deduction_guide.md | 2 - reference/map/map/try_emplace.md | 1 - reference/map/multimap.md | 1 - reference/map/multimap/emplace.md | 1 - reference/map/multimap/equal_range.md | 1 - reference/map/multimap/op_compare_3way.md | 1 - reference/map/multimap/op_constructor.md | 1 - reference/map/multimap/op_deduction_guide.md | 2 - reference/mdspan/full_extent_t.md | 1 - reference/mdspan/index-pair-like.md | 1 - reference/mdspan/mdspan/op_deduction_guide.md | 1 - reference/mdspan/strided_slice.md | 1 - reference/mdspan/submdspan.md | 2 - reference/memory/allocate_shared.md | 1 - reference/memory/allocator_traits.md | 1 - .../allocator_traits/allocate_at_least.md | 1 - reference/memory/assume_aligned.md | 1 - reference/memory/construct_at.md | 2 - reference/memory/destroy.md | 1 - reference/memory/destroy_n.md | 1 - reference/memory/get_temporary_buffer.md | 2 - reference/memory/no-throw-forward-iterator.md | 3 - reference/memory/no-throw-forward-range.md | 1 - reference/memory/no-throw-input-iterator.md | 4 -- reference/memory/no-throw-input-range.md | 3 - reference/memory/no-throw-sentinel.md | 1 - reference/memory/ranges_construct_at.md | 2 - reference/memory/ranges_destroy.md | 3 - reference/memory/ranges_destroy_n.md | 4 -- reference/memory/ranges_uninitialized_copy.md | 8 --- .../memory/ranges_uninitialized_copy_n.md | 4 -- .../ranges_uninitialized_default_construct.md | 6 -- ...anges_uninitialized_default_construct_n.md | 5 -- reference/memory/ranges_uninitialized_fill.md | 5 -- .../memory/ranges_uninitialized_fill_n.md | 4 -- reference/memory/ranges_uninitialized_move.md | 10 ---- .../memory/ranges_uninitialized_move_n.md | 5 -- .../ranges_uninitialized_value_construct.md | 6 -- .../ranges_uninitialized_value_construct_n.md | 5 -- reference/memory/raw_storage_iterator.md | 1 - reference/memory/return_temporary_buffer.md | 1 - .../memory/shared_ptr/op_compare_3way.md | 1 - reference/memory/shared_ptr/op_constructor.md | 1 - reference/memory/shared_ptr/op_equal.md | 1 - reference/memory/shared_ptr/op_greater.md | 1 - .../memory/shared_ptr/op_greater_equal.md | 1 - reference/memory/shared_ptr/op_less.md | 1 - reference/memory/shared_ptr/op_less_equal.md | 1 - reference/memory/shared_ptr/op_not_equal.md | 1 - .../shared_ptr/reinterpret_pointer_cast.md | 2 - reference/memory/uninitialized_copy.md | 4 -- reference/memory/uninitialized_copy_n.md | 4 -- .../memory/uninitialized_default_construct.md | 3 - .../uninitialized_default_construct_n.md | 3 - reference/memory/uninitialized_fill.md | 4 -- reference/memory/uninitialized_fill_n.md | 4 -- reference/memory/uninitialized_move.md | 3 - reference/memory/uninitialized_move_n.md | 3 - .../memory/uninitialized_value_construct.md | 3 - .../memory/uninitialized_value_construct_n.md | 3 - reference/memory/unique_ptr/op_assign.md | 2 - .../memory/unique_ptr/op_compare_3way.md | 1 - reference/memory/unique_ptr/op_constructor.md | 2 - reference/memory/unique_ptr/op_equal.md | 1 - reference/memory/unique_ptr/op_greater.md | 1 - .../memory/unique_ptr/op_greater_equal.md | 1 - reference/memory/unique_ptr/op_less.md | 1 - reference/memory/unique_ptr/op_less_equal.md | 1 - reference/memory/unique_ptr/op_not_equal.md | 1 - reference/memory/uses_allocator.md | 1 - .../uses_allocator_construction_args.md | 8 --- .../polymorphic_allocator/construct.md | 10 ---- reference/mutex/adopt_lock.md | 1 - reference/mutex/defer_lock.md | 1 - reference/mutex/lock.md | 1 - reference/mutex/try_lock.md | 1 - reference/mutex/try_to_lock.md | 1 - reference/new/op_new.md | 1 - reference/new/op_new[].md | 1 - reference/numeric/add_sat.md | 1 - reference/numeric/div_sat.md | 1 - reference/numeric/exclusive_scan.md | 1 - reference/numeric/gcd.md | 4 -- reference/numeric/inclusive_scan.md | 1 - reference/numeric/lcm.md | 3 - reference/numeric/mul_sat.md | 1 - reference/numeric/ranges_iota.md | 2 - reference/numeric/reduce.md | 5 -- reference/numeric/saturate_cast.md | 1 - reference/numeric/sub_sat.md | 1 - reference/numeric/transform_reduce.md | 1 - reference/optional/bad_optional_access.md | 1 - reference/optional/optional/and_then.md | 2 - reference/optional/optional/op_constructor.md | 1 - reference/optional/optional/or_else.md | 3 - reference/optional/optional/value_or.md | 1 - reference/ostream/basic_ostream/op_ostream.md | 1 - reference/ostream/print.md | 2 - reference/ostream/println.md | 1 - reference/print/print.md | 3 - reference/print/println.md | 2 - .../priority_queue/op_deduction_guide.md | 1 - reference/queue/queue/emplace.md | 2 - reference/random.md | 1 - reference/random/bernoulli_distribution.md | 1 - reference/random/default_random_engine.md | 1 - reference/random/discard_block_engine/max.md | 1 - reference/random/discard_block_engine/min.md | 1 - .../random/discard_block_engine/op_call.md | 1 - .../discard_block_engine/op_constructor.md | 1 - reference/random/discard_block_engine/seed.md | 1 - reference/random/generate_random.md | 11 ---- reference/random/independent_bits_engine.md | 2 - .../random/independent_bits_engine/base.md | 1 - .../random/independent_bits_engine/discard.md | 1 - .../random/independent_bits_engine/max.md | 1 - .../random/independent_bits_engine/min.md | 1 - .../random/independent_bits_engine/op_call.md | 1 - .../independent_bits_engine/op_constructor.md | 2 - .../independent_bits_engine/op_equal.md | 1 - .../independent_bits_engine/op_istream.md | 1 - .../independent_bits_engine/op_not_equal.md | 1 - .../independent_bits_engine/op_ostream.md | 1 - .../random/independent_bits_engine/seed.md | 2 - reference/random/knuth_b.md | 1 - .../random/linear_congruential_engine.md | 1 - .../random/linear_congruential_engine/max.md | 1 - .../random/linear_congruential_engine/min.md | 1 - .../linear_congruential_engine/op_call.md | 1 - .../op_constructor.md | 1 - .../random/linear_congruential_engine/seed.md | 1 - reference/random/mersenne_twister_engine.md | 1 - .../random/mersenne_twister_engine/max.md | 1 - .../random/mersenne_twister_engine/min.md | 1 - .../random/mersenne_twister_engine/op_call.md | 1 - .../mersenne_twister_engine/op_constructor.md | 1 - .../random/mersenne_twister_engine/seed.md | 1 - reference/random/minstd_rand.md | 1 - reference/random/minstd_rand0.md | 1 - reference/random/mt19937.md | 2 - reference/random/mt19937_64.md | 1 - reference/random/philox4x32.md | 2 - reference/random/philox4x64.md | 2 - reference/random/philox_engine.md | 2 - reference/random/philox_engine/max.md | 1 - reference/random/philox_engine/min.md | 1 - reference/random/philox_engine/op_call.md | 1 - .../random/philox_engine/op_constructor.md | 1 - reference/random/philox_engine/seed.md | 1 - reference/random/philox_engine/set_counter.md | 1 - reference/random/random_device.md | 1 - reference/random/ranlux24.md | 3 - reference/random/ranlux48.md | 3 - reference/random/seed_seq.md | 3 - reference/random/seed_seq/generate.md | 1 - reference/random/seed_seq/op_constructor.md | 4 -- reference/random/seed_seq/param.md | 1 - reference/random/shuffle_order_engine/max.md | 1 - reference/random/shuffle_order_engine/min.md | 1 - .../random/shuffle_order_engine/op_call.md | 1 - .../shuffle_order_engine/op_constructor.md | 1 - reference/random/shuffle_order_engine/seed.md | 1 - .../random/subtract_with_carry_engine.md | 1 - .../random/subtract_with_carry_engine/max.md | 1 - .../random/subtract_with_carry_engine/min.md | 1 - .../subtract_with_carry_engine/op_call.md | 1 - .../op_constructor.md | 1 - .../random/subtract_with_carry_engine/seed.md | 1 - .../random/uniform_random_bit_generator.md | 2 - .../ranges/adjacent_transform_view/size.md | 1 - reference/ranges/all.md | 2 - reference/ranges/as_const_view.md | 3 - reference/ranges/as_const_view/base.md | 3 - reference/ranges/as_const_view/begin.md | 1 - reference/ranges/as_const_view/end.md | 1 - .../ranges/as_const_view/op_constructor.md | 1 - .../as_const_view/op_deduction_guide.md | 2 - reference/ranges/as_const_view/size.md | 1 - reference/ranges/as_rvalue_view.md | 12 ---- reference/ranges/as_rvalue_view/base.md | 1 - reference/ranges/as_rvalue_view/begin.md | 1 - reference/ranges/as_rvalue_view/end.md | 1 - reference/ranges/as_rvalue_view/size.md | 1 - reference/ranges/basic_istream_view.md | 6 -- reference/ranges/bidirectional_range.md | 3 - reference/ranges/borrowed_iterator_t.md | 6 -- reference/ranges/borrowed_range.md | 1 - reference/ranges/borrowed_subrange_t.md | 7 --- reference/ranges/chunk_view/size.md | 1 - reference/ranges/common_range.md | 3 - reference/ranges/common_view.md | 17 ------ reference/ranges/common_view/base.md | 2 - reference/ranges/common_view/begin.md | 1 - reference/ranges/common_view/end.md | 1 - .../ranges/common_view/op_constructor.md | 1 - .../ranges/common_view/op_deduction_guide.md | 1 - reference/ranges/common_view/size.md | 1 - reference/ranges/const_iterator_t.md | 2 - reference/ranges/const_sentinel_t.md | 2 - reference/ranges/constant_range.md | 2 - reference/ranges/contiguous_range.md | 4 -- reference/ranges/copyable_box.md | 2 - reference/ranges/dangling.md | 1 - reference/ranges/different-from.md | 2 - reference/ranges/drop_view.md | 2 - reference/ranges/drop_while_view.md | 6 -- reference/ranges/elements_view.md | 1 - .../elements_view/op_deduction_guide.md | 1 - reference/ranges/empty_view.md | 2 - reference/ranges/enumerate_view.md | 1 - reference/ranges/filter_view/end.md | 1 - .../filter_view/iterator/op_increment.md | 1 - .../ranges/filter_view/op_deduction_guide.md | 1 - reference/ranges/forward_range.md | 3 - reference/ranges/has-arrow.md | 1 - reference/ranges/input_range.md | 3 - reference/ranges/iota_view.md | 2 - reference/ranges/iota_view/end.md | 1 - reference/ranges/iota_view/iota_diff_t.md | 1 - reference/ranges/iota_view/iterator.md | 1 - reference/ranges/iota_view/sentinel.md | 1 - reference/ranges/iterator_t.md | 2 - reference/ranges/join_view.md | 3 - reference/ranges/lazy_split_view.md | 7 --- .../lazy_split_view/op_deduction_guide.md | 1 - reference/ranges/movable_box.md | 2 - reference/ranges/output_range.md | 3 - reference/ranges/owning_view.md | 12 ---- reference/ranges/owning_view/data.md | 1 - reference/ranges/possibly-const-range.md | 2 - reference/ranges/random_access_range.md | 3 - reference/ranges/range.md | 2 - reference/ranges/range_const_reference_t.md | 2 - reference/ranges/range_difference_t.md | 3 - reference/ranges/range_reference_t.md | 2 - reference/ranges/range_rvalue_reference_t.md | 3 - reference/ranges/range_size_t.md | 3 - reference/ranges/range_value_t.md | 3 - reference/ranges/ref_view.md | 17 ------ reference/ranges/ref_view/begin.md | 1 - reference/ranges/ref_view/end.md | 1 - reference/ranges/ref_view/size.md | 1 - reference/ranges/repeat_view.md | 6 -- reference/ranges/repeat_view/iterator.md | 5 -- reference/ranges/reverse_view.md | 14 ----- reference/ranges/sentinel_t.md | 3 - reference/ranges/simple-view.md | 5 -- reference/ranges/single_view.md | 4 -- .../ranges/single_view/op_deduction_guide.md | 1 - reference/ranges/sized_range.md | 2 - reference/ranges/split_view.md | 5 -- .../ranges/stride_view/op_deduction_guide.md | 1 - reference/ranges/subrange.md | 2 - reference/ranges/subrange/advance.md | 2 - .../subrange/convertible-to-non-slicing.md | 2 - .../ranges/subrange/enable_borrowed_range.md | 1 - reference/ranges/subrange/get.md | 1 - reference/ranges/subrange/next.md | 3 - reference/ranges/subrange/op_constructor.md | 5 -- .../ranges/subrange/op_deduction_guide.md | 7 --- .../subrange/pair-like-convertible-from.md | 2 - reference/ranges/subrange/prev.md | 3 - reference/ranges/subrange/size.md | 1 - ...ses-nonqualification-pointer-conversion.md | 1 - reference/ranges/take_view.md | 2 - reference/ranges/take_while_view.md | 6 -- reference/ranges/to.md | 1 - reference/ranges/to_input_view.md | 2 - reference/ranges/view.md | 2 - reference/ranges/view_interface.md | 2 - reference/ranges/view_interface/back.md | 3 - reference/ranges/view_interface/cbegin.md | 1 - reference/ranges/view_interface/cend.md | 1 - reference/ranges/view_interface/data.md | 4 -- reference/ranges/view_interface/empty.md | 4 -- reference/ranges/view_interface/front.md | 2 - reference/ranges/view_interface/op_at.md | 3 - reference/ranges/view_interface/size.md | 5 -- reference/ranges/viewable_range.md | 3 - reference/ranges/zip_transform_view/begin.md | 3 - reference/ranges/zip_transform_view/end.md | 3 - reference/ranges/zip_transform_view/size.md | 1 - .../regex/basic_regex/op_deduction_guide.md | 1 - reference/regex/regex_iterator.md | 1 - reference/regex/regex_token_iterator.md | 1 - reference/regex/sub_match.md | 1 - .../scoped_allocator_adaptor/construct.md | 5 -- reference/set/multiset/emplace.md | 1 - reference/set/multiset/equal_range.md | 1 - reference/set/multiset/op_constructor.md | 1 - reference/set/multiset/op_deduction_guide.md | 1 - reference/set/set/emplace.md | 1 - reference/set/set/equal_range.md | 1 - reference/set/set/insert.md | 1 - reference/set/set/op_constructor.md | 1 - reference/set/set/op_deduction_guide.md | 1 - reference/shared_mutex/shared_mutex.md | 1 - reference/shared_mutex/shared_timed_mutex.md | 1 - reference/span/integral-constant-like.md | 1 - reference/span/span/begin.md | 2 - reference/span/span/cend.md | 1 - reference/span/span/crend.md | 1 - reference/span/span/end.md | 2 - reference/span/span/op_deduction_guide.md | 1 - reference/sstream/basic_istringstream/view.md | 1 - reference/sstream/basic_ostringstream/view.md | 1 - reference/sstream/basic_stringbuf/view.md | 1 - reference/sstream/basic_stringstream/view.md | 1 - reference/stack/stack/emplace.md | 2 - reference/stack/stack/op_deduction_guide.md | 1 - .../stop_token/stop_callback/op_destructor.md | 1 - .../stop_token/stop_source/request_stop.md | 1 - reference/stop_token/stoppable_token.md | 3 - reference/string/basic_string/append.md | 2 - reference/string/basic_string/assign.md | 2 - reference/string/basic_string/compare.md | 1 - reference/string/basic_string/contains.md | 2 - reference/string/basic_string/find.md | 1 - .../string/basic_string/find_first_not_of.md | 1 - .../string/basic_string/find_first_of.md | 1 - .../string/basic_string/find_last_not_of.md | 1 - reference/string/basic_string/find_last_of.md | 1 - reference/string/basic_string/insert.md | 2 - reference/string/basic_string/op_assign.md | 1 - .../basic_string/op_basic_string_view.md | 1 - .../string/basic_string/op_compare_3way.md | 1 - .../string/basic_string/op_deduction_guide.md | 2 - .../string/basic_string/op_plus_assign.md | 1 - reference/string/basic_string/replace.md | 3 - reference/string/basic_string/rfind.md | 1 - reference/string/char_traits.md | 1 - .../basic_string_view/op_constructor.md | 2 - .../basic_string_view/op_deduction_guide.md | 1 - reference/system_error/error_code.md | 1 - .../error_code/default_error_condition.md | 1 - .../system_error/error_code/op_constructor.md | 1 - reference/system_error/error_condition.md | 1 - reference/system_error/make_error_code.md | 2 - .../system_error/make_error_condition.md | 1 - reference/system_error/op_equal.md | 1 - reference/system_error/op_not_equal.md | 1 - reference/system_error/system_error.md | 1 - reference/thread/jthread.md | 2 - reference/thread/jthread/op_constructor.md | 4 -- reference/thread/jthread/op_destructor.md | 2 - reference/thread/jthread/request_stop.md | 1 - reference/tuple/apply.md | 4 -- reference/tuple/make_from_tuple.md | 1 - reference/tuple/pair-like.md | 2 - reference/tuple/tie.md | 1 - reference/tuple/tuple/get.md | 1 - reference/tuple/tuple/op_assign.md | 1 - reference/tuple/tuple/op_compare_3way.md | 3 - reference/tuple/tuple/op_constructor.md | 1 - reference/tuple/tuple/op_deduction_guide.md | 1 - reference/tuple/tuple/op_equal.md | 1 - reference/tuple/tuple/op_not_equal.md | 1 - reference/tuple/tuple/swap.md | 1 - reference/tuple/tuple_cat.md | 1 - reference/tuple/tuple_element.md | 1 - reference/tuple/tuple_size.md | 1 - reference/type_traits/common_type.md | 3 - reference/type_traits/invoke_result.md | 1 - reference/type_traits/is_implicit_lifetime.md | 1 - reference/type_traits/negation.md | 1 - reference/type_traits/remove_cvref.md | 2 - reference/type_traits/result_of.md | 1 - reference/type_traits/unwrap_ref_decay.md | 1 - .../unordered_map/unordered_map/emplace.md | 2 - .../unordered_map/emplace_hint.md | 2 - .../unordered_map/equal_range.md | 1 - .../unordered_map/unordered_map/erase.md | 1 - .../unordered_map/unordered_map/insert.md | 1 - .../unordered_map/insert_or_assign.md | 1 - .../unordered_map/op_deduction_guide.md | 2 - .../unordered_map/try_emplace.md | 1 - .../unordered_multimap/emplace_hint.md | 1 - .../unordered_multimap/equal_range.md | 1 - .../unordered_map/unordered_multimap/erase.md | 1 - .../unordered_multimap/op_deduction_guide.md | 2 - .../unordered_multiset/emplace_hint.md | 1 - .../unordered_multiset/equal_range.md | 1 - .../unordered_set/unordered_multiset/erase.md | 1 - .../unordered_multiset/insert.md | 2 - .../unordered_multiset/op_deduction_guide.md | 1 - .../unordered_set/equal_range.md | 1 - .../unordered_set/unordered_set/erase.md | 1 - .../unordered_set/unordered_set/insert.md | 3 - .../unordered_set/op_deduction_guide.md | 1 - reference/utility/declval.md | 1 - reference/utility/exchange.md | 1 - reference/utility/forward_like.md | 4 -- reference/utility/in_range.md | 2 - reference/utility/make_pair.md | 2 - .../utility/pair/basic_common_reference.md | 2 - reference/utility/pair/common_type.md | 2 - reference/utility/pair/get.md | 1 - reference/utility/pair/op_constructor.md | 2 - reference/utility/pair/tuple_element.md | 1 - reference/valarray/gslice.md | 3 - reference/valarray/gslice_array.md | 1 - .../valarray/gslice_array/op_and_assign.md | 2 - reference/valarray/gslice_array/op_assign.md | 2 - .../valarray/gslice_array/op_divide_assign.md | 2 - .../gslice_array/op_left_shift_assign.md | 2 - .../valarray/gslice_array/op_minus_assign.md | 2 - .../valarray/gslice_array/op_modulo_assign.md | 2 - .../gslice_array/op_multiply_assign.md | 2 - .../valarray/gslice_array/op_or_assign.md | 2 - .../valarray/gslice_array/op_plus_assign.md | 2 - .../gslice_array/op_right_shift_assign.md | 2 - .../valarray/gslice_array/op_xor_assign.md | 2 - reference/valarray/indirect_array.md | 1 - reference/valarray/mask_array.md | 1 - reference/valarray/slice.md | 3 - reference/valarray/slice_array.md | 1 - reference/valarray/valarray/begin_free.md | 2 - reference/valarray/valarray/end_free.md | 2 - reference/valarray/valarray/op_and.md | 2 - reference/valarray/valarray/op_and_assign.md | 2 - reference/valarray/valarray/op_at.md | 2 - reference/valarray/valarray/op_equal.md | 2 - reference/valarray/valarray/op_flip.md | 2 - reference/valarray/valarray/op_greater.md | 2 - .../valarray/valarray/op_greater_equal.md | 2 - reference/valarray/valarray/op_left_shift.md | 2 - .../valarray/valarray/op_left_shift_assign.md | 2 - reference/valarray/valarray/op_less.md | 2 - reference/valarray/valarray/op_less_equal.md | 2 - reference/valarray/valarray/op_not_equal.md | 2 - reference/valarray/valarray/op_or.md | 2 - reference/valarray/valarray/op_or_assign.md | 2 - reference/valarray/valarray/op_right_shift.md | 2 - .../valarray/op_right_shift_assign.md | 2 - reference/valarray/valarray/op_xor.md | 2 - reference/valarray/valarray/op_xor_assign.md | 2 - reference/variant/bad_variant_access.md | 1 - reference/variant/monostate.md | 1 - reference/variant/variant/emplace.md | 2 - reference/variant/variant_alternative.md | 1 - reference/variant/variant_size.md | 1 - reference/vector/vector/op_deduction_guide.md | 4 -- 955 files changed, 27 insertions(+), 2666 deletions(-) diff --git a/lang/cpp11/decltype.md b/lang/cpp11/decltype.md index f6f8caeb69..81a9677e29 100644 --- a/lang/cpp11/decltype.md +++ b/lang/cpp11/decltype.md @@ -210,7 +210,6 @@ int main() std::cout << l(S::g) << '\n'; } ``` -* std::forward[link ../../reference/utility/forward.md] * decltype[color ff0000] #### 出力 diff --git a/lang/cpp11/rvalue_ref_and_move_semantics.md b/lang/cpp11/rvalue_ref_and_move_semantics.md index 4ab7b484cc..bcc992bbf6 100644 --- a/lang/cpp11/rvalue_ref_and_move_semantics.md +++ b/lang/cpp11/rvalue_ref_and_move_semantics.md @@ -324,7 +324,6 @@ void f(T&& a) // 左辺値ではコピーが、右辺値ではムーブが行われる。 } ``` -* std::forward[link /reference/utility/forward.md] ## 仕様 diff --git a/lang/cpp11/thread_local_storage.md b/lang/cpp11/thread_local_storage.md index 685fc26fa7..b6cc681435 100644 --- a/lang/cpp11/thread_local_storage.md +++ b/lang/cpp11/thread_local_storage.md @@ -82,7 +82,6 @@ int main() } ``` * thread_local[color ff0000] -* std::uniform_int_distribution[link /reference/random/uniform_int_distribution.md] * std::to_string[link /reference/string/to_string.md] ### 出力例 diff --git a/lang/cpp11/variadic_templates.md b/lang/cpp11/variadic_templates.md index 977a28d2bb..697de6eb4d 100644 --- a/lang/cpp11/variadic_templates.md +++ b/lang/cpp11/variadic_templates.md @@ -74,7 +74,6 @@ int main() print(1, 'a', "hello"); } ``` -* std::forward[link /reference/utility/forward.md] 出力: diff --git a/lang/cpp17/if_constexpr.md b/lang/cpp17/if_constexpr.md index 86e7ac2536..00be421c80 100644 --- a/lang/cpp17/if_constexpr.md +++ b/lang/cpp17/if_constexpr.md @@ -273,7 +273,6 @@ int main() * std::conditional[link /reference/type_traits/conditional.md] * std::conditional_t[link /reference/type_traits/conditional.md] * std::mt19937_64[link /reference/random/mt19937_64.md] -* std::uint32_t[link /reference/cstdint/uint32_t.md] ## この機能が必要になった背景・経緯 diff --git a/lang/cpp17/replacement_of_class_objects_containing_reference_members.md b/lang/cpp17/replacement_of_class_objects_containing_reference_members.md index 880ffa01e4..4f53a7466e 100644 --- a/lang/cpp17/replacement_of_class_objects_containing_reference_members.md +++ b/lang/cpp17/replacement_of_class_objects_containing_reference_members.md @@ -84,7 +84,6 @@ public: } }; ``` -* std::forward[link /reference/utility/forward.md] このオーバーヘッドを避けるために`std::launder()`関数が導入された。 diff --git a/lang/cpp17/structured_bindings.md b/lang/cpp17/structured_bindings.md index f3036ded8b..7bcafa5958 100644 --- a/lang/cpp17/structured_bindings.md +++ b/lang/cpp17/structured_bindings.md @@ -130,7 +130,6 @@ int main() } } ``` -* std::forward_as_tuple[link /reference/tuple/forward_as_tuple.md] #### 出力 ``` @@ -313,7 +312,6 @@ int id; std::string message; std::tie(id, message) = f(); ``` -* std::tie[link /reference/tuple/tie.md] これらの問題は、変数宣言と構造の分解が同時にできないことで、その間にバグが入り込む余地があったということである。また、分解対象の型に対して「デフォルトコンストラクタを持っていること」という余分な要求をしてしまう問題もあった。 diff --git a/lang/cpp20/concepts.md b/lang/cpp20/concepts.md index 3f80a1a9ec..e5963a0fa5 100644 --- a/lang/cpp20/concepts.md +++ b/lang/cpp20/concepts.md @@ -372,7 +372,6 @@ int main() { ``` * std::integral[link /reference/concepts/integral.md] * std::floating_point[link /reference/concepts/floating_point.md] -* std::common_type_t[link /reference/type_traits/common_type.md] * std::abs[link /reference/cmath/abs.md] * epsilon()[link /reference/limits/numeric_limits/epsilon.md] diff --git a/lang/cpp20/consistent_comparison.md b/lang/cpp20/consistent_comparison.md index 4e8e4b93f0..2fb956d0ad 100644 --- a/lang/cpp20/consistent_comparison.md +++ b/lang/cpp20/consistent_comparison.md @@ -582,7 +582,6 @@ int main() std::cout << (s1 != s2) << std::endl; } ``` -* std::tie[link /reference/tuple/tie.md] ### 出力 ``` diff --git a/lang/cpp20/coroutines.md b/lang/cpp20/coroutines.md index 87891533ec..6a380acd1f 100644 --- a/lang/cpp20/coroutines.md +++ b/lang/cpp20/coroutines.md @@ -414,7 +414,6 @@ int main() { * co_yield[color ff0000] * std::suspend_always[link /reference/coroutine/suspend_always.md] * std::move[link /reference/utility/move.md] -* pair[link /reference/utility/pair.md] * make_pair[link /reference/utility/make_pair.md] * std::equal[link /reference/algorithm/equal.md] diff --git a/lang/cpp20/familiar_template_syntax_for_generic_lambdas.md b/lang/cpp20/familiar_template_syntax_for_generic_lambdas.md index 5c8013d87e..c742ee992d 100644 --- a/lang/cpp20/familiar_template_syntax_for_generic_lambdas.md +++ b/lang/cpp20/familiar_template_syntax_for_generic_lambdas.md @@ -118,7 +118,6 @@ auto f = [](auto&&... args) { g(std::forward(args)...); }; ``` -* std::forward[link /reference/utility/forward.md] これは正しく動作し、この書き方はScott Meyersのブログでも記事で紹介されているが、Meyersが記事を書かなければならなかったということが、これがユーザーにとって難しい問題であることを表していた。 @@ -129,7 +128,6 @@ auto f = [](Args&&... args) { g(std::forward(args)...); }; ``` -* std::forward[link /reference/utility/forward.md] ## 関連項目 diff --git a/lang/cpp20/signed_integers_are_twos_complement.md b/lang/cpp20/signed_integers_are_twos_complement.md index d8360109f0..1e4bc5d09e 100644 --- a/lang/cpp20/signed_integers_are_twos_complement.md +++ b/lang/cpp20/signed_integers_are_twos_complement.md @@ -75,7 +75,6 @@ int main() } } ``` -* std::int8_t[link /reference/cstdint/int8_t.md] #### 出力 ``` @@ -101,10 +100,6 @@ int main() } ``` * std::has_unique_object_representations[link /reference/type_traits/has_unique_object_representations.md] -* std::int8_t[link /reference/cstdint/int8_t.md] -* std::int16_t[link /reference/cstdint/int16_t.md] -* std::int32_t[link /reference/cstdint/int32_t.md] -* std::int64_t[link /reference/cstdint/int64_t.md] #### 出力 ``` diff --git a/reference/algorithm/adjacent_find.md b/reference/algorithm/adjacent_find.md index f49c763d39..fe20630d87 100644 --- a/reference/algorithm/adjacent_find.md +++ b/reference/algorithm/adjacent_find.md @@ -95,10 +95,6 @@ int main() { } ``` * adjacent_find[color ff0000] -* std::vector[link /reference/vector/vector.md] -* std::cout[link /reference/iostream/cout.md] -* std::distance[link /reference/iterator/distance.md] -* std::boolalpha[link /reference/ios/boolalpha.md] ### 出力 ``` diff --git a/reference/algorithm/all_of.md b/reference/algorithm/all_of.md index e0ff83bd64..120a261023 100644 --- a/reference/algorithm/all_of.md +++ b/reference/algorithm/all_of.md @@ -57,12 +57,6 @@ int main() { } ``` * std::all_of[color ff0000] -* std::vector[link /reference/vector/vector.md] -* std::cout[link /reference/iostream/cout.md] -* std::boolalpha[link /reference/ios/boolalpha.md] -* std::endl[link /reference/ostream/endl.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] ### 出力 ``` diff --git a/reference/algorithm/any_of.md b/reference/algorithm/any_of.md index 01f58e5062..1923e1dbea 100644 --- a/reference/algorithm/any_of.md +++ b/reference/algorithm/any_of.md @@ -58,12 +58,6 @@ int main() { } ``` * std::any_of[color ff0000] -* std::cout[link /reference/iostream/cout.md] -* std::boolalpha[link /reference/ios/boolalpha.md] -* std::endl[link /reference/ostream/endl.md] -* std::vector[link /reference/vector/vector.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] ### 出力 ``` diff --git a/reference/algorithm/binary_search.md b/reference/algorithm/binary_search.md index a7b9cccc04..a1c10635e2 100644 --- a/reference/algorithm/binary_search.md +++ b/reference/algorithm/binary_search.md @@ -88,11 +88,6 @@ int main() } ``` * std::binary_search[color ff0000] -* std::vector[link /reference/vector/vector.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] #### 出力 ``` diff --git a/reference/algorithm/clamp.md b/reference/algorithm/clamp.md index 33ab7e4487..1500a095f9 100644 --- a/reference/algorithm/clamp.md +++ b/reference/algorithm/clamp.md @@ -53,8 +53,6 @@ int main() } ``` * std::clamp[color ff0000] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] ### 出力 ``` diff --git a/reference/algorithm/copy.md b/reference/algorithm/copy.md index 3c419e9349..b2a8fdc655 100644 --- a/reference/algorithm/copy.md +++ b/reference/algorithm/copy.md @@ -74,19 +74,8 @@ int main() { } ``` * std::copy[color ff0000] -* std::vector[link /reference/vector/vector.md] -* v.size[link /reference/vector/vector/size.md] -* std::copy[link /reference/algorithm/copy.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] -* v2.begin[link /reference/vector/vector/begin.md] -* std::list[link /reference/list/list.md] -* v2.end[link /reference/vector/vector/end.md] -* std::back_inserter[link /reference/iterator/back_inserter.md] * ls3.begin[link /reference/list/list/begin.md] * ls3.end[link /reference/list/list/end.md] -* std::ostream_iterator[link /reference/iterator/ostream_iterator.md] -* std::cout[link /reference/iostream/cout.md] ### 出力 ``` 3,1,2, diff --git a/reference/algorithm/copy_backward.md b/reference/algorithm/copy_backward.md index a24850df79..5c1fc81de6 100644 --- a/reference/algorithm/copy_backward.md +++ b/reference/algorithm/copy_backward.md @@ -64,13 +64,8 @@ int main() { } ``` * std::copy_backward[color ff0000] -* std::list[link /reference/list/list.md] * ls.begin()[link /reference/list/list/begin.md] -* std::next[link /reference/iterator/next.md] * ls.end()[link /reference/list/list/end.md] -* std::ostream_iterator[link /reference/iterator/ostream_iterator.md] -* std::cout[link /reference/iostream/cout.md] -* std::copy[link /reference/algorithm/copy.md] ### 出力 ``` diff --git a/reference/algorithm/copy_if.md b/reference/algorithm/copy_if.md index 7b5c693532..fae041b1dd 100644 --- a/reference/algorithm/copy_if.md +++ b/reference/algorithm/copy_if.md @@ -80,21 +80,8 @@ int main() { } ``` * std::copy_if[color ff0000] -* std::vector[link /reference/vector/vector.md] -* v1.size[link /reference/vector/vector/size.md] -* v2.size[link /reference/vector/vector/size.md] -* v3.size[link /reference/vector/vector/size.md] -* v1.begin[link /reference/vector/vector/begin.md] -* v1.end[link /reference/vector/vector/end.md] -* v2.begin[link /reference/vector/vector/begin.md] -* v2.end[link /reference/vector/vector/end.md] -* v3.begin[link /reference/vector/vector/begin.md] -* v3.end[link /reference/vector/vector/end.md] * copy_if[link /reference/algorithm/copy_if.md] * result.begin[link /reference/vector/vector/begin.md] -* std::ostream_iterator[link /reference/iterator/ostream_iterator.md] -* std::cout[link /reference/iostream/cout.md] -* std::copy[link /reference/algorithm/copy.md] ### 出力 ``` diff --git a/reference/algorithm/copy_n.md b/reference/algorithm/copy_n.md index d49ed205b5..4e495dcde2 100644 --- a/reference/algorithm/copy_n.md +++ b/reference/algorithm/copy_n.md @@ -58,10 +58,6 @@ int main() { } ``` * std::copy_n[color ff0000] -* std::vector[link /reference/vector/vector.md] -* std::copy_n[link /reference/algorithm/copy_n.md] -* std::ostream_iterator[link /reference/iterator/ostream_iterator.md] -* std::cout[link /reference/iostream/cout.md] ### 出力 ``` diff --git a/reference/algorithm/count.md b/reference/algorithm/count.md index 6616a597da..324da12ef5 100644 --- a/reference/algorithm/count.md +++ b/reference/algorithm/count.md @@ -42,7 +42,6 @@ namespace std { const T& value); // (2) C++16 } ``` -* iterator_traits[link /reference/iterator/iterator_traits.md] ## 概要 イテレータ範囲`[first, last)`から、指定された値と等値な要素の数を数える。 @@ -80,11 +79,6 @@ int main() { } ``` * std::count[color ff0000] -* std::vector[link /reference/vector/vector.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] #### 出力 ``` @@ -118,11 +112,6 @@ int main() { } ``` * std::count[color ff0000] -* std::vector[link /reference/vector/vector.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] #### 出力 ``` diff --git a/reference/algorithm/count_if.md b/reference/algorithm/count_if.md index 5343f1de49..ee073c087a 100644 --- a/reference/algorithm/count_if.md +++ b/reference/algorithm/count_if.md @@ -25,7 +25,6 @@ namespace std { Predicate pred); // (2) C++17 } ``` -* iterator_traits[link /reference/iterator/iterator_traits.md] ## 概要 イテレータ範囲`[first, last)`から、条件を満たしている要素の数を数える。 @@ -54,12 +53,7 @@ int main() { } ``` * std::count_if[color ff0000] -* std::vector[link /reference/vector/vector.md] * std::count_if[link /reference/algorithm/count_if.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] ### 出力 ```cpp diff --git a/reference/algorithm/equal.md b/reference/algorithm/equal.md index f7c16685f5..42aada54af 100644 --- a/reference/algorithm/equal.md +++ b/reference/algorithm/equal.md @@ -138,13 +138,6 @@ int main() { } ``` * std::equal[color ff0000] -* std::vector[link /reference/vector/vector.md] -* std::array[link /reference/array/array.md] -* std::begin[link /reference/iterator/begin.md] -* std::end[link /reference/iterator/end.md] -* std::cout[link /reference/iostream/cout.md] -* std::boolalpha[link /reference/ios/boolalpha.md] -* std::endl[link /reference/ostream/endl.md] ### 出力 ``` @@ -212,7 +205,6 @@ inline bool equal(InputIterator1 first1, InputIterator1 last1, # endif ``` * equal_to[link ../functional/equal_to.md] -* iterator_traits[link ../iterator/iterator_traits.md] ## バージョン diff --git a/reference/algorithm/equal_range.md b/reference/algorithm/equal_range.md index 4103a1854d..0b6d040308 100644 --- a/reference/algorithm/equal_range.md +++ b/reference/algorithm/equal_range.md @@ -50,7 +50,6 @@ namespace std { Compare comp); // (2) C++26 } ``` -* pair[link /reference/utility/pair.md] ## 概要 @@ -102,12 +101,6 @@ int main() } ``` * equal_range[color ff0000] -* std::vector[link /reference/vector/vector.md] -* std::sort[link /reference/algorithm/sort.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] #### 出力 ``` @@ -147,11 +140,6 @@ int main() { } ``` * std::equal_range[color ff0000] -* std::vector[link /reference/vector/vector.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] #### 出力 ``` diff --git a/reference/algorithm/fill.md b/reference/algorithm/fill.md index d6db827cf0..80b66018c6 100644 --- a/reference/algorithm/fill.md +++ b/reference/algorithm/fill.md @@ -85,11 +85,6 @@ int main() { } ``` * std::fill[color ff0000] -* std::vector[link /reference/vector/vector.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] -* std::for_each[link /reference/algorithm/for_each.md] -* std::cout[link /reference/iostream/cout.md] #### 出力 ``` diff --git a/reference/algorithm/fill_n.md b/reference/algorithm/fill_n.md index 4ce3c90313..d79e725d8c 100644 --- a/reference/algorithm/fill_n.md +++ b/reference/algorithm/fill_n.md @@ -101,8 +101,6 @@ int main() { } ``` * std::fill_n[color ff0000] -* std::ostream_iterator[link /reference/iterator/ostream_iterator.md] -* std::cout[link /reference/iostream/cout.md] #### 出力 ``` diff --git a/reference/algorithm/find.md b/reference/algorithm/find.md index 0c025c676c..2eb04c2dda 100644 --- a/reference/algorithm/find.md +++ b/reference/algorithm/find.md @@ -81,11 +81,6 @@ int main() { } ``` * std::find[color ff0000] -* std::vector[link /reference/vector/vector.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] #### 出力 ``` diff --git a/reference/algorithm/find_end.md b/reference/algorithm/find_end.md index 8f55b082c9..1998bcd9a3 100644 --- a/reference/algorithm/find_end.md +++ b/reference/algorithm/find_end.md @@ -95,15 +95,8 @@ int main() { } ``` * std::find_end[color ff0000] -* std::vector[link /reference/vector/vector.md] -* std::list[link /reference/list/list.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] * ls.begin[link /reference/list/list/begin.md] * ls.end[link /reference/list/list/end.md] -* std::distance[link /reference/iterator/distance.md] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] ### 出力 ``` diff --git a/reference/algorithm/find_first_of.md b/reference/algorithm/find_first_of.md index ee530c3f18..ba3158c385 100644 --- a/reference/algorithm/find_first_of.md +++ b/reference/algorithm/find_first_of.md @@ -105,15 +105,8 @@ int main() { } ``` * std::find_first_of[color ff0000] -* std::vector[link /reference/vector/vector.md] -* std::list[link /reference/list/list.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] * ls.begin[link /reference/list/list/begin.md] * ls.end[link /reference/list/list/end.md] -* std::distance[link /reference/iterator/distance.md] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] ### 出力 ``` diff --git a/reference/algorithm/find_if.md b/reference/algorithm/find_if.md index 915d36bb99..c3cb3a8ad7 100644 --- a/reference/algorithm/find_if.md +++ b/reference/algorithm/find_if.md @@ -53,11 +53,6 @@ int main() { } ``` * std::find_if[color ff0000] -* std::vector[link /reference/vector/vector.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] ### 出力 ``` diff --git a/reference/algorithm/find_if_not.md b/reference/algorithm/find_if_not.md index 8c9242507d..352e17c24b 100644 --- a/reference/algorithm/find_if_not.md +++ b/reference/algorithm/find_if_not.md @@ -54,11 +54,6 @@ int main() { } ``` * std::find_if_not[color ff0000] -* std::vector[link /reference/vector/vector.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] ### 出力 ``` diff --git a/reference/algorithm/for_each.md b/reference/algorithm/for_each.md index 6e9f71ed1a..1dace08230 100644 --- a/reference/algorithm/for_each.md +++ b/reference/algorithm/for_each.md @@ -89,11 +89,6 @@ int main() { } ``` * std::for_each[color ff0000] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] -* std::vector[link /reference/vector/vector.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] * v.push_back[link /reference/vector/vector/push_back.md] #### 出力 diff --git a/reference/algorithm/for_each_n.md b/reference/algorithm/for_each_n.md index 20f2eee4a0..452705bc0a 100644 --- a/reference/algorithm/for_each_n.md +++ b/reference/algorithm/for_each_n.md @@ -79,10 +79,6 @@ int main() } ``` * std::for_each_n[color ff0000] -* std::vector[link /reference/vector/vector.md] -* v.begin[link /reference/vector/vector/begin.md] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] ### 出力 ``` diff --git a/reference/algorithm/generate.md b/reference/algorithm/generate.md index 685d60e445..17aacb71aa 100644 --- a/reference/algorithm/generate.md +++ b/reference/algorithm/generate.md @@ -56,11 +56,6 @@ int main() { } ``` * std::generate[color ff0000] -* std::vector[link /reference/vector/vector.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] -* std::for_each[link /reference/algorithm/for_each.md] -* std::cout[link /reference/iostream/cout.md] ### 出力 ``` diff --git a/reference/algorithm/generate_n.md b/reference/algorithm/generate_n.md index 0c8d32cbea..a858e03a9d 100644 --- a/reference/algorithm/generate_n.md +++ b/reference/algorithm/generate_n.md @@ -75,8 +75,6 @@ int main() { } ``` * std::generate_n[color ff0000] -* std::ostream_iterator[link /reference/iterator/ostream_iterator.md] -* std::cout[link /reference/iostream/cout.md] ### 出力 ``` diff --git a/reference/algorithm/includes.md b/reference/algorithm/includes.md index 361793a029..82b393e2c1 100644 --- a/reference/algorithm/includes.md +++ b/reference/algorithm/includes.md @@ -82,12 +82,8 @@ int main() } ``` * std::includes[color ff0000] -* std::set[link /reference/set/set.md] * begin()[link /reference/set/set/begin.md] * end()[link /reference/set/set/end.md] -* std::cout[link /reference/iostream/cout.md] -* std::boolalpha[link /reference/ios/boolalpha.md] -* std::endl[link /reference/ostream/endl.md] ### 出力 ``` diff --git a/reference/algorithm/inplace_merge.md b/reference/algorithm/inplace_merge.md index 2edfe703e4..2af32581f8 100644 --- a/reference/algorithm/inplace_merge.md +++ b/reference/algorithm/inplace_merge.md @@ -93,12 +93,6 @@ int main() } ``` * std::inplace_merge[color ff0000] -* std::vector[link /reference/vector/vector.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] -* std::for_each[link /reference/algorithm/for_each.md] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] ### 出力 ``` diff --git a/reference/algorithm/is_heap.md b/reference/algorithm/is_heap.md index a67f6dd8ad..6498b559b7 100644 --- a/reference/algorithm/is_heap.md +++ b/reference/algorithm/is_heap.md @@ -69,12 +69,6 @@ int main() } ``` * std::is_heap[color ff0000] -* std::vector[link /reference/vector/vector.md] -* std::cout[link /reference/iostream/cout.md] -* std::boolalpha[link /reference/ios/boolalpha.md] -* std::endl[link /reference/ostream/endl.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] * std::make_heap[link make_heap.md] ### 出力 diff --git a/reference/algorithm/is_heap_until.md b/reference/algorithm/is_heap_until.md index 6d94ef2c9d..094cb609c7 100644 --- a/reference/algorithm/is_heap_until.md +++ b/reference/algorithm/is_heap_until.md @@ -76,12 +76,6 @@ int main() } ``` * std::is_heap_until[color ff0000] -* std::vector[link /reference/vector/vector.md] -* std::cout[link /reference/iostream/cout.md] -* std::boolalpha[link /reference/ios/boolalpha.md] -* std::endl[link /reference/ostream/endl.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] * std::make_heap[link make_heap.md] ### 出力 diff --git a/reference/algorithm/is_partitioned.md b/reference/algorithm/is_partitioned.md index 3da09add81..94506f9508 100644 --- a/reference/algorithm/is_partitioned.md +++ b/reference/algorithm/is_partitioned.md @@ -72,13 +72,7 @@ int main() } ``` * std::is_partitioned[color ff0000] -* std::vector[link /reference/vector/vector.md] * std::partition[link partition.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] -* std::for_each[link /reference/algorithm/for_each.md] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] ### 出力 ``` diff --git a/reference/algorithm/is_permutation.md b/reference/algorithm/is_permutation.md index 6aab74d2c5..09edf068c5 100644 --- a/reference/algorithm/is_permutation.md +++ b/reference/algorithm/is_permutation.md @@ -96,14 +96,8 @@ int main () } ``` * std::is_permutation[color ff0000] -* std::vector[link /reference/vector/vector.md] -* v.begin()[link /reference/vector/vector/begin.md] -* v.end()[link /reference/vector/vector/end.md] * good.begin()[link /reference/vector/vector/begin.md] * bad.begin()[link /reference/vector/vector/begin.md] -* std::cout[link /reference/iostream/cout.md] -* std::boolalpha[link /reference/ios/boolalpha.md] -* std::endl[link /reference/ostream/endl.md] ### 出力 ``` @@ -206,11 +200,9 @@ bool is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, # endif ``` -* std::tie[link /reference/tuple/tie.md] * std::mismatch[link mismatch.md] * std::count[link count.md] * std::count_if[link count_if.md] -* std::next[link /reference/iterator/next.md] * std::iterator_traits[link /reference/iterator/iterator_traits.md] * std::equal_to[link /reference/functional/equal_to.md] * std::random_access_iterator_tag[link /reference/iterator/iterator_tag.md] diff --git a/reference/algorithm/is_sorted.md b/reference/algorithm/is_sorted.md index b0a3a318d0..f0c2de657f 100644 --- a/reference/algorithm/is_sorted.md +++ b/reference/algorithm/is_sorted.md @@ -64,13 +64,6 @@ int main() } ``` * std::is_sorted[color ff0000] -* std::vector[link /reference/vector/vector.md] -* std::cout[link /reference/iostream/cout.md] -* std::boolalpha[link /reference/ios/boolalpha.md] -* std::endl[link /reference/ostream/endl.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] -* std::sort[link sort.md] ### 出力 ``` diff --git a/reference/algorithm/is_sorted_until.md b/reference/algorithm/is_sorted_until.md index b60924a497..621f615d06 100644 --- a/reference/algorithm/is_sorted_until.md +++ b/reference/algorithm/is_sorted_until.md @@ -76,13 +76,6 @@ int main() } ``` * std::is_sorted_until[color ff0000] -* std::vector[link /reference/vector/vector.md] -* std::cout[link /reference/iostream/cout.md] -* std::boolalpha[link /reference/ios/boolalpha.md] -* std::sort[link sort.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] -* std::endl[link /reference/ostream/endl.md] ### 出力 ``` diff --git a/reference/algorithm/iter_swap.md b/reference/algorithm/iter_swap.md index d0f70af2aa..85f8cc5858 100644 --- a/reference/algorithm/iter_swap.md +++ b/reference/algorithm/iter_swap.md @@ -57,14 +57,6 @@ int main() { } ``` * std::iter_swap[color ff0000] -* std::vector[link /reference/vector/vector.md] -* v1.begin[link /reference/vector/vector/begin.md] -* v1.end[link /reference/vector/vector/end.md] -* v2.begin[link /reference/vector/vector/begin.md] -* v2.end[link /reference/vector/vector/end.md] -* std::ostream_iterator[link /reference/iterator/ostream_iterator.md] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] ### 出力 ``` v1: 3,5,4, diff --git a/reference/algorithm/lexicographical_compare.md b/reference/algorithm/lexicographical_compare.md index b578892c0d..b486aed5dc 100644 --- a/reference/algorithm/lexicographical_compare.md +++ b/reference/algorithm/lexicographical_compare.md @@ -137,9 +137,6 @@ int main() * begin()[link /reference/string/basic_string/begin.md] * end()[link /reference/string/basic_string/end.md] * std::greater[link /reference/functional/greater.md] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] -* std::string[link /reference/string/string.md.nolink] ### 出力 ``` diff --git a/reference/algorithm/lexicographical_compare_three_way.md b/reference/algorithm/lexicographical_compare_three_way.md index 690959da12..af65f303d7 100644 --- a/reference/algorithm/lexicographical_compare_three_way.md +++ b/reference/algorithm/lexicographical_compare_three_way.md @@ -115,9 +115,6 @@ int main() { } ``` * std::lexicographical_compare_three_way[color ff0000] -* std::string[link /reference/string/string.md.nolink] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] * std::isalpha[link /reference/cctype/isalpha.md] * std::tolower[link /reference/cctype/tolower.md] * weak_ordering[link /reference/compare/weak_ordering.md] diff --git a/reference/algorithm/lower_bound.md b/reference/algorithm/lower_bound.md index 129c38ab98..7b3b2e2f06 100644 --- a/reference/algorithm/lower_bound.md +++ b/reference/algorithm/lower_bound.md @@ -176,15 +176,6 @@ int main() } ``` * std::lower_bound[color ff0000] -* std::string[link /reference/string/string.md.nolink] -* std::vector[link /reference/vector/vector.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] -* std::size_t[link /reference/cstddef/size_t.md] -* std::distance[link /reference/iterator/distance.md] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] -* std::sort[link sort.md] #### 出力 ``` diff --git a/reference/algorithm/make_heap.md b/reference/algorithm/make_heap.md index aad14771d9..a57a55f691 100644 --- a/reference/algorithm/make_heap.md +++ b/reference/algorithm/make_heap.md @@ -64,10 +64,6 @@ int main() } ``` * std::make_heap[color ff0000] -* std::vector[link /reference/vector/vector.md] -* std::for_each[link /reference/algorithm/for_each.md] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] ### 出力 ``` diff --git a/reference/algorithm/max.md b/reference/algorithm/max.md index 4cd2343aec..1366d76d3e 100644 --- a/reference/algorithm/max.md +++ b/reference/algorithm/max.md @@ -75,7 +75,6 @@ int main() ``` * std::max[color ff0000] * std::greater[link /reference/functional/greater.md] -* assert[link /reference/cassert/assert.md] ### 出力 ``` diff --git a/reference/algorithm/max_element.md b/reference/algorithm/max_element.md index 1655be9b84..5b042cb165 100644 --- a/reference/algorithm/max_element.md +++ b/reference/algorithm/max_element.md @@ -71,13 +71,6 @@ int main() } ``` * std::max_element[color ff0000] -* std::vector[link /reference/vector/vector.md] -* std::pair[link /reference/utility/pair.md] -* v1.begin[link /reference/vector/vector/begin.md] -* v1.end[link /reference/vector/vector/end.md] -* v2.begin[link /reference/vector/vector/begin.md] -* v2.end[link /reference/vector/vector/end.md] -* assert[link /reference/cassert/assert.md] ### 出力 ``` diff --git a/reference/algorithm/merge.md b/reference/algorithm/merge.md index 68c044d27e..933045f7b2 100644 --- a/reference/algorithm/merge.md +++ b/reference/algorithm/merge.md @@ -126,10 +126,6 @@ int main() * b.end()[link /reference/vector/vector/end.md] * result.begin()[link /reference/vector/vector/begin.md] * result.end()[link /reference/vector/vector/end.md] -* std::back_inserter[link /reference/iterator/back_inserter.md] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] -* std::for_each[link /reference/algorithm/for_each.md] ### 出力 ``` @@ -173,7 +169,6 @@ OutputIterator merge(InputIterator1 first1, InputIterator1 last1, return std::copy(first2, last2, result); } ``` -* std::copy[link copy.md] ## 関連項目 diff --git a/reference/algorithm/min.md b/reference/algorithm/min.md index 7f790b4cdc..d4915042c0 100644 --- a/reference/algorithm/min.md +++ b/reference/algorithm/min.md @@ -75,7 +75,6 @@ int main() ``` * std::min[color ff0000] * std::greater[link /reference/functional/greater.md] -* assert[link /reference/cassert/assert.md] ### 出力 ``` diff --git a/reference/algorithm/min_element.md b/reference/algorithm/min_element.md index 84c1329976..9f6e9e215d 100644 --- a/reference/algorithm/min_element.md +++ b/reference/algorithm/min_element.md @@ -70,13 +70,6 @@ int main() } ``` * std::min_element[color ff0000] -* std::vector[link /reference/vector/vector.md] -* v1.begin[link /reference/vector/vector/begin.md] -* v1.end[link /reference/vector/vector/end.md] -* v2.begin[link /reference/vector/vector/begin.md] -* v2.end[link /reference/vector/vector/end.md] -* std::pair[link /reference/utility/pair.md] -* assert[link /reference/cassert/assert.md] * v2_min_element->first[link /reference/utility/pair/first.md.nolink] * v2_min_element->second[link /reference/utility/pair/second.md.nolink] diff --git a/reference/algorithm/minmax.md b/reference/algorithm/minmax.md index ee70312b16..e1aca9fbf0 100644 --- a/reference/algorithm/minmax.md +++ b/reference/algorithm/minmax.md @@ -31,7 +31,6 @@ namespace std { constexpr pair minmax(initializer_list t, Compare comp); // (4) C++14 } ``` -* pair[link /reference/utility/pair.md] * initializer_list[link /reference/initializer_list/initializer_list.md] ## 概要 @@ -96,8 +95,6 @@ int main() ``` * std::minmax[color ff0000] * std::greater[link /reference/functional/greater.md] -* std::pair[link /reference/utility/pair.md] -* assert[link /reference/cassert/assert.md] * result1.first[link /reference/utility/pair/first.md.nolink] * result1.second[link /reference/utility/pair/second.md.nolink] * result2.first[link /reference/utility/pair/first.md.nolink] diff --git a/reference/algorithm/minmax_element.md b/reference/algorithm/minmax_element.md index 86607b820f..8a63e11007 100644 --- a/reference/algorithm/minmax_element.md +++ b/reference/algorithm/minmax_element.md @@ -31,7 +31,6 @@ namespace std { Compare comp); // (4) C++17 } ``` -* pair[link /reference/utility/pair.md] ## 概要 イテレータ範囲`[first, last)`のうち、最小要素を指すイテレータと最大要素を指すイテレータの組を取得する。 @@ -79,14 +78,10 @@ int main() } ``` * std::minmax_element[color ff0000] -* std::vector[link /reference/vector/vector.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] * *i.first[link /reference/utility/pair/first.md.nolink] * *i.second[link /reference/utility/pair/second.md.nolink] * *j.first[link /reference/utility/pair/first.md.nolink] * *j.second[link /reference/utility/pair/second.md.nolink] -* assert[link /reference/cassert/assert.md] ### 出力 ``` ``` diff --git a/reference/algorithm/mismatch.md b/reference/algorithm/mismatch.md index a437dbad0a..e31d996338 100644 --- a/reference/algorithm/mismatch.md +++ b/reference/algorithm/mismatch.md @@ -86,7 +86,6 @@ namespace std { BinaryPredicate pred); // (8) C++17 } ``` -* pair[link /reference/utility/pair.md] ## 概要 @@ -147,18 +146,8 @@ int main() { ``` * std::mismatch[color ff0000] * std::to_string[link /reference/string/to_string.md] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] * *p.first[link /reference/utility/pair/first.md.nolink] * *p.second[link /reference/utility/pair/second.md.nolink] -* std::vector[link /reference/vector/vector.md] -* std::array[link /reference/array/array.md] -* std::list[link /reference/list/list.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] -* v2.begin[link /reference/array/array/begin.md] -* v3.begin[link /reference/list/list/begin.md] -* v3.end[link /reference/list/list/end.md] ### 出力 ``` diff --git a/reference/algorithm/move.md b/reference/algorithm/move.md index 6100e30814..5449dfe49f 100644 --- a/reference/algorithm/move.md +++ b/reference/algorithm/move.md @@ -73,17 +73,7 @@ int main() { ``` * std::move[color ff0000] * v.emplace_back[link /reference/vector/vector/emplace_back.md] -* std::vector[link /reference/vector/vector.md] -* std::unique_ptr[link /reference/memory/unique_ptr.md] -* std::back_inserter[link /reference/iterator/back_inserter.md] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] -* std::for_each[link /reference/algorithm/for_each.md] * v.emplace_back[link /reference/vector/vector/emplace_back.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] -* v2.begin[link /reference/vector/vector/begin.md] -* v2.end[link /reference/vector/vector/end.md] ### 出力 ``` diff --git a/reference/algorithm/move_backward.md b/reference/algorithm/move_backward.md index 450ba5552e..460289ed1d 100644 --- a/reference/algorithm/move_backward.md +++ b/reference/algorithm/move_backward.md @@ -77,10 +77,6 @@ int main() { * std::move_backward[color ff0000] * v.emplace_back[link /reference/vector/vector/emplace_back.md] * std::move[link move.md] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] -* std::for_each[link /reference/algorithm/for_each.md] -* std::unique_ptr[link /reference/memory/unique_ptr.md] ### 出力 ``` diff --git a/reference/algorithm/next_permutation.md b/reference/algorithm/next_permutation.md index ec031899fc..c1938dfe89 100644 --- a/reference/algorithm/next_permutation.md +++ b/reference/algorithm/next_permutation.md @@ -81,12 +81,6 @@ int main () } ``` * std::next_permutation[color ff0000] -* std::vector[link /reference/vector/vector.md] -* std::for_each[link /reference/algorithm/for_each.md] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] ### 出力 ``` diff --git a/reference/algorithm/none_of.md b/reference/algorithm/none_of.md index 5de0d58530..77520c8add 100644 --- a/reference/algorithm/none_of.md +++ b/reference/algorithm/none_of.md @@ -68,12 +68,6 @@ int main() { } ``` * std::none_of[color ff0000] -* std::vector[link /reference/vector/vector.md] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] -* std::boolalpha[link /reference/ios/boolalpha.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] ### 出力 ``` diff --git a/reference/algorithm/nth_element.md b/reference/algorithm/nth_element.md index 8e01a8e686..6c8890ac7b 100644 --- a/reference/algorithm/nth_element.md +++ b/reference/algorithm/nth_element.md @@ -86,12 +86,6 @@ int main() } ``` * std::nth_element[color ff0000] -* std::vector[link /reference/vector/vector.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] -* std::for_each[link /reference/algorithm/for_each.md] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] ### 出力例 ``` diff --git a/reference/algorithm/partial_sort.md b/reference/algorithm/partial_sort.md index 6dfb6c1bac..4c0d673366 100644 --- a/reference/algorithm/partial_sort.md +++ b/reference/algorithm/partial_sort.md @@ -85,12 +85,6 @@ int main() } ``` * std::partial_sort[color ff0000] -* std::vector[link /reference/vector/vector.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] -* std::for_each[link /reference/algorithm/for_each.md] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] ### 出力 ``` diff --git a/reference/algorithm/partial_sort_copy.md b/reference/algorithm/partial_sort_copy.md index 84978e8125..f70f56d010 100644 --- a/reference/algorithm/partial_sort_copy.md +++ b/reference/algorithm/partial_sort_copy.md @@ -97,12 +97,6 @@ int main() * std::partial_sort_copy[color ff0000] * result.begin()[link /reference/vector/vector/begin.md] * result.end()[link /reference/vector/vector/end.md] -* std::vector[link /reference/vector/vector.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] -* std::for_each[link /reference/algorithm/for_each.md] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] ### 出力 ``` diff --git a/reference/algorithm/partition.md b/reference/algorithm/partition.md index f7a849abf4..f58de2d53c 100644 --- a/reference/algorithm/partition.md +++ b/reference/algorithm/partition.md @@ -82,12 +82,6 @@ int main() } ``` * std::partition[color ff0000] -* std::vector[link /reference/vector/vector.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] -* std::for_each[link /reference/algorithm/for_each.md] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] ### 出力 ``` diff --git a/reference/algorithm/partition_copy.md b/reference/algorithm/partition_copy.md index e49a0ec950..399627dcda 100644 --- a/reference/algorithm/partition_copy.md +++ b/reference/algorithm/partition_copy.md @@ -42,7 +42,6 @@ namespace std { Predicate pred); // (2) C++17 } ``` -* pair[link /reference/utility/pair.md] ## 概要 イテレータ範囲`[first, last)`を条件を満たすか満たさないかで、2つの出力範囲へ分けてコピーする。 @@ -107,14 +106,6 @@ int main() } ``` * std::partition_copy[color ff0000] -* std::string[link /reference/string/string.md.nolink] -* std::vector[link /reference/vector/vector.md] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] -* std::for_each[link /reference/algorithm/for_each.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] -* std::back_inserter[link /reference/iterator/back_inserter.md] * is_even[link /reference/algorithm/is_partitioned.md] ### 出力 diff --git a/reference/algorithm/partition_point.md b/reference/algorithm/partition_point.md index a768044009..88cfab5d63 100644 --- a/reference/algorithm/partition_point.md +++ b/reference/algorithm/partition_point.md @@ -72,12 +72,6 @@ int main() ``` * std::partition_point[color ff0000] * std::partition[link partition.md] -* std::vector[link /reference/vector/vector.md] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] -* std::for_each[link /reference/algorithm/for_each.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] ### 出力 ``` @@ -104,7 +98,6 @@ partition_point(ForwardIterator first, ForwardIterator last, Predicate pred) return first; } ``` -* std::next[link /reference/iterator/next.md] ## バージョン diff --git a/reference/algorithm/pop_heap.md b/reference/algorithm/pop_heap.md index 018d1920a4..56cb4179d6 100644 --- a/reference/algorithm/pop_heap.md +++ b/reference/algorithm/pop_heap.md @@ -77,12 +77,6 @@ int main() * std::make_heap[link make_heap.md] * v.pop_back()[link /reference/vector/vector/pop_back.md] * std::sort_heap[link sort_heap.md] -* std::vector[link /reference/vector/vector.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] -* std::for_each[link /reference/algorithm/for_each.md] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] ### 出力 ``` diff --git a/reference/algorithm/prev_permutation.md b/reference/algorithm/prev_permutation.md index 7df7dfee4d..dbdea5b985 100644 --- a/reference/algorithm/prev_permutation.md +++ b/reference/algorithm/prev_permutation.md @@ -76,12 +76,6 @@ int main () } ``` * std::prev_permutation[color ff0000] -* std::vector[link /reference/vector/vector.md] -* std::for_each[link /reference/algorithm/for_each.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] ### 出力 ``` diff --git a/reference/algorithm/push_heap.md b/reference/algorithm/push_heap.md index 8635d1f6b1..3e1cdf5f7d 100644 --- a/reference/algorithm/push_heap.md +++ b/reference/algorithm/push_heap.md @@ -78,12 +78,6 @@ int main() * std::make_heap[link make_heap.md] * v.push_back[link /reference/vector/vector/push_back.md] * std::sort_heap[link sort_heap.md] -* std::vector[link /reference/vector/vector.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] -* std::for_each[link /reference/algorithm/for_each.md] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] ### 出力 ``` diff --git a/reference/algorithm/random_shuffle.md b/reference/algorithm/random_shuffle.md index 41ab8bbe29..fc8e3c3329 100644 --- a/reference/algorithm/random_shuffle.md +++ b/reference/algorithm/random_shuffle.md @@ -85,14 +85,6 @@ int main() { } ``` * std::random_shuffle[color ff0000] -* std::vector[link /reference/vector/vector.md] -* std::iota[link /reference/numeric/iota.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] -* std::ostream_iterator[link /reference/iterator/ostream_iterator.md] -* std::copy[link /reference/algorithm/copy.md] ### 出力 ``` diff --git a/reference/algorithm/ranges_adjacent_find.md b/reference/algorithm/ranges_adjacent_find.md index 5104248172..4685f276c9 100644 --- a/reference/algorithm/ranges_adjacent_find.md +++ b/reference/algorithm/ranges_adjacent_find.md @@ -22,14 +22,6 @@ namespace std::ranges { adjacent_find(R&& r, Pred pred = {}, Proj proj = {}); // (2) C++20 } ``` -* forward_iterator[link /reference/iterator/forward_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* identity[link /reference/functional/identity.md] -* indirect_binary_predicate[link /reference/iterator/indirect_binary_predicate.md] -* projected[link /reference/iterator/projected.md] -* ranges::equal_to[link /reference/functional/ranges_equal_to.md] -* forward_range[link /reference/ranges/forward_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] @@ -90,12 +82,6 @@ int main() { ``` * std::ranges::distance[link /reference/iterator/ranges_distance.md] * std::ranges::adjacent_find[color ff0000] -* std::vector[link /reference/vector/vector.md] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] -* std::boolalpha[link /reference/ios/boolalpha.md] -* v.begin[link /reference/vector/vector/begin.md] -* v.end[link /reference/vector/vector/end.md] ### 出力 ``` @@ -140,14 +126,6 @@ struct adjacent_find_impl { inline constexpr adjacent_find_impl adjacent_find; ``` -* forward_iterator[link /reference/iterator/forward_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* identity[link /reference/functional/identity.md] -* indirect_binary_predicate[link /reference/iterator/indirect_binary_predicate.md] -* projected[link /reference/iterator/projected.md] -* ranges::equal_to[link /reference/functional/ranges_equal_to.md] -* forward_range[link /reference/ranges/forward_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] * invoke[link /reference/functional/invoke.md] * begin[link /reference/ranges/begin.md] diff --git a/reference/algorithm/ranges_all_of.md b/reference/algorithm/ranges_all_of.md index 153ee9038d..09cb6a9a9a 100644 --- a/reference/algorithm/ranges_all_of.md +++ b/reference/algorithm/ranges_all_of.md @@ -20,12 +20,6 @@ namespace std::ranges { all_of(R&& r, Pred pred, Proj proj = {}); // (2) C++20 } ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* identity[link /reference/functional/identity.md] -* indirect_unary_predicate[link /reference/iterator/indirect_unary_predicate.md] -* input_range[link /reference/ranges/input_range.md] -* projected[link /reference/iterator/projected.md] ## 概要 範囲の全ての要素が条件を満たすかを判定する。 @@ -69,10 +63,6 @@ int main() { } ``` * std::ranges::all_of[color ff0000] -* std::array[link /reference/array/array.md] -* std::cout[link /reference/iostream/cout.md] -* std::boolalpha[link /reference/ios/boolalpha.md] -* std::endl[link /reference/ostream/endl.md] ### 出力 ``` @@ -98,13 +88,6 @@ struct all_of_impl { inline constexpr all_of_impl all_of; ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* identity[link /reference/functional/identity.md] -* indirect_unary_predicate[link /reference/iterator/indirect_unary_predicate.md] -* input_range[link /reference/ranges/input_range.md] -* projected[link /reference/iterator/projected.md] * invoke[link /reference/functional/invoke.md] * begin[link /reference/ranges/begin.md] * end[link /reference/ranges/end.md] diff --git a/reference/algorithm/ranges_any_of.md b/reference/algorithm/ranges_any_of.md index fc414ba926..77e2ffd1ee 100644 --- a/reference/algorithm/ranges_any_of.md +++ b/reference/algorithm/ranges_any_of.md @@ -20,12 +20,6 @@ namespace std::ranges { any_of(R&& r, Pred pred, Proj proj = {}); // (2) C++20 } ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* identity[link /reference/functional/identity.md] -* indirect_unary_predicate[link /reference/iterator/indirect_unary_predicate.md] -* input_range[link /reference/ranges/input_range.md] -* projected[link /reference/iterator/projected.md] ## 概要 範囲のいずれかの要素が条件を満たすかを判定する。 @@ -71,10 +65,6 @@ int main() { } ``` * std::ranges::any_of[color ff0000] -* std::array[link /reference/array/array.md] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] -* std::boolalpha[link /reference/ios/boolalpha.md] ### 出力 ``` @@ -100,13 +90,6 @@ struct any_of_impl { inline constexpr any_of_impl any_of; ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* identity[link /reference/functional/identity.md] -* indirect_unary_predicate[link /reference/iterator/indirect_unary_predicate.md] -* input_range[link /reference/ranges/input_range.md] -* projected[link /reference/iterator/projected.md] * invoke[link /reference/functional/invoke.md] * begin[link /reference/ranges/begin.md] * end[link /reference/ranges/end.md] diff --git a/reference/algorithm/ranges_binary_search.md b/reference/algorithm/ranges_binary_search.md index 3c84ad0894..a0c9bd5816 100644 --- a/reference/algorithm/ranges_binary_search.md +++ b/reference/algorithm/ranges_binary_search.md @@ -61,14 +61,8 @@ namespace std::ranges { Proj proj = {}); // (2) C++26 } ``` -* forward_iterator[link /reference/iterator/forward_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * ranges::less[link /reference/functional/ranges_less.md] -* identity[link /reference/functional/identity.md] * indirect_strict_weak_order[link /reference/iterator/indirect_strict_weak_order.md] -* projected[link /reference/iterator/projected.md] -* forward_range[link /reference/ranges/forward_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] ## 概要 @@ -124,9 +118,6 @@ int main() } ``` * std::ranges::binary_search[color ff0000] -* std::vector[link /reference/vector/vector.md] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] #### 出力 ``` diff --git a/reference/algorithm/ranges_clamp.md b/reference/algorithm/ranges_clamp.md index 0dc75fdf93..489120d535 100644 --- a/reference/algorithm/ranges_clamp.md +++ b/reference/algorithm/ranges_clamp.md @@ -13,9 +13,7 @@ namespace std::ranges { clamp(const T& v, const T& lo, const T& hi, Comp comp = {}, Proj proj = {}); // (1) C++20 } ``` -* identity[link /reference/functional/identity.md] * indirect_strict_weak_order[link /reference/iterator/indirect_strict_weak_order.md] -* projected[link /reference/iterator/projected.md] * ranges::less[link /reference/functional/ranges_less.md] ## 概要 @@ -46,8 +44,6 @@ int main() } ``` * std::ranges::clamp[color ff0000] -* std::cout[link /reference/iostream/cout.md] -* std::endl[link /reference/ostream/endl.md] ### 出力 ``` diff --git a/reference/algorithm/ranges_contains_subrange.md b/reference/algorithm/ranges_contains_subrange.md index 4baeea43b7..9be4d01fe9 100644 --- a/reference/algorithm/ranges_contains_subrange.md +++ b/reference/algorithm/ranges_contains_subrange.md @@ -58,9 +58,6 @@ int main() { } ``` * std::ranges::contains_subrange[color ff0000] -* std::vector[link /reference/vector/vector.md] -* std::list[link /reference/list/list.md] -* std::println[link /reference/print/println.md] #### 出力 ``` diff --git a/reference/algorithm/ranges_copy.md b/reference/algorithm/ranges_copy.md index 69f37d47d8..7e13c6f733 100644 --- a/reference/algorithm/ranges_copy.md +++ b/reference/algorithm/ranges_copy.md @@ -21,12 +21,8 @@ namespace std::ranges { } ``` * copy_result[link ranges_in_out_result.md] -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * weakly_incrementable[link /reference/iterator/weakly_incrementable.md] * indirectly_copyable[link /reference/iterator/indirectly_copyable.md] -* input_range[link /reference/ranges/input_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 diff --git a/reference/algorithm/ranges_copy_backward.md b/reference/algorithm/ranges_copy_backward.md index c0de166b38..e8e20bdf7a 100644 --- a/reference/algorithm/ranges_copy_backward.md +++ b/reference/algorithm/ranges_copy_backward.md @@ -21,11 +21,7 @@ namespace std::ranges { } ``` * copy_backward_result[link ranges_in_out_result.md] -* bidirectional_iterator[link /reference/iterator/bidirectional_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * indirectly_copyable[link /reference/iterator/indirectly_copyable.md] -* bidirectional_range[link /reference/ranges/bidirectional_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 @@ -81,7 +77,6 @@ int main() { ``` * std::ranges::copy_backward[color ff0000] * ls.begin()[link /reference/list/list/begin.md] -* std::next[link /reference/iterator/next.md] * ls.end()[link /reference/list/list/end.md] ### 出力 diff --git a/reference/algorithm/ranges_copy_if.md b/reference/algorithm/ranges_copy_if.md index 9aa7a1e0b6..978a8b995d 100644 --- a/reference/algorithm/ranges_copy_if.md +++ b/reference/algorithm/ranges_copy_if.md @@ -25,14 +25,8 @@ namespace std::ranges { } ``` * copy_if_result[link ranges_in_out_result.md] -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * weakly_incrementable[link /reference/iterator/weakly_incrementable.md] -* indirect_unary_predicate[link /reference/iterator/indirect_unary_predicate.md] -* projected[link /reference/iterator/projected.md] * indirectly_copyable[link /reference/iterator/indirectly_copyable.md] -* input_range[link /reference/ranges/input_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 diff --git a/reference/algorithm/ranges_copy_n.md b/reference/algorithm/ranges_copy_n.md index 5276890401..34cb49ca28 100644 --- a/reference/algorithm/ranges_copy_n.md +++ b/reference/algorithm/ranges_copy_n.md @@ -17,7 +17,6 @@ namespace std::ranges { } ``` * copy_n_result[link ranges_in_out_result.md] -* input_iterator[link /reference/iterator/input_iterator.md] * weakly_incrementable[link /reference/iterator/weakly_incrementable.md] * indirectly_copyable[link /reference/iterator/indirectly_copyable.md] diff --git a/reference/algorithm/ranges_count.md b/reference/algorithm/ranges_count.md index 294f0855ba..1863ea3121 100644 --- a/reference/algorithm/ranges_count.md +++ b/reference/algorithm/ranges_count.md @@ -45,16 +45,6 @@ namespace std::ranges { Proj proj = {}); // (2) C++26 } ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* input_range[link /reference/ranges/input_range.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* identity[link /reference/functional/identity.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* indirect_binary_predicate[link /reference/iterator/indirect_binary_predicate.md] -* ranges::equal_to[link /reference/functional/ranges_equal_to.md] -* projected[link /reference/iterator/projected.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] -* range_difference_t[link /reference/ranges/range_difference_t.md] ## 概要 指定された値と等値な要素の数を数える。 @@ -201,16 +191,6 @@ struct count_impl { inline constexpr count_impl count; ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* input_range[link /reference/ranges/input_range.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* identity[link /reference/functional/identity.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* indirect_binary_predicate[link /reference/iterator/indirect_binary_predicate.md] -* ranges::equal_to[link /reference/functional/ranges_equal_to.md] -* projected[link /reference/iterator/projected.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] -* range_difference_t[link /reference/ranges/range_difference_t.md] * invoke[link /reference/functional/invoke.md] * begin[link /reference/ranges/begin.md] * end[link /reference/ranges/end.md] diff --git a/reference/algorithm/ranges_count_if.md b/reference/algorithm/ranges_count_if.md index ab67dca231..e4881886a2 100644 --- a/reference/algorithm/ranges_count_if.md +++ b/reference/algorithm/ranges_count_if.md @@ -20,15 +20,6 @@ namespace std::ranges { count_if(R&& r, Pred pred, Proj proj = {}); // (2) C++20 } ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* input_range[link /reference/ranges/input_range.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* identity[link /reference/functional/identity.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* indirect_unary_predicate[link /reference/iterator/indirect_unary_predicate.md] -* projected[link /reference/iterator/projected.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] -* range_difference_t[link /reference/ranges/range_difference_t.md] ## 概要 @@ -96,15 +87,6 @@ struct count_if_impl { inline constexpr count_if_impl count_if; ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* input_range[link /reference/ranges/input_range.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* identity[link /reference/functional/identity.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* indirect_unary_predicate[link /reference/iterator/indirect_unary_predicate.md] -* projected[link /reference/iterator/projected.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] -* range_difference_t[link /reference/ranges/range_difference_t.md] * invoke[link /reference/functional/invoke.md] * begin[link /reference/ranges/begin.md] * end[link /reference/ranges/end.md] diff --git a/reference/algorithm/ranges_ends_with.md b/reference/algorithm/ranges_ends_with.md index 4ec8b780de..2f32e02f3d 100644 --- a/reference/algorithm/ranges_ends_with.md +++ b/reference/algorithm/ranges_ends_with.md @@ -41,16 +41,7 @@ namespace std::ranges { Proj2 proj2 = {}); // (2) C++23 } ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* forward_iterator[link /reference/iterator/forward_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] -* ranges::equal_to[link /reference/functional/ranges_equal_to.md] -* identity[link /reference/functional/identity.md] -* indirectly_comparable[link /reference/iterator/indirectly_comparable.md] -* forward_range[link /reference/ranges/forward_range.md] -* sized_range[link /reference/ranges/sized_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] ## 概要 @@ -128,21 +119,11 @@ struct ends_with_impl { inline constexpr ends_with_impl ends_with; ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* forward_iterator[link /reference/iterator/forward_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] -* ranges::equal_to[link /reference/functional/ranges_equal_to.md] -* identity[link /reference/functional/identity.md] -* indirectly_comparable[link /reference/iterator/indirectly_comparable.md] -* forward_range[link /reference/ranges/forward_range.md] -* sized_range[link /reference/ranges/sized_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * move[link /reference/utility/move.md] * distance[link /reference/iterator/ranges_distance.md] * equal[link ranges_equal.md] * drop_view[link /reference/ranges/drop_view.md] -* ref_view[link /reference/ranges/ref_view.md] ## バージョン ### 言語 diff --git a/reference/algorithm/ranges_equal.md b/reference/algorithm/ranges_equal.md index 1b3cadf1b5..e69f260082 100644 --- a/reference/algorithm/ranges_equal.md +++ b/reference/algorithm/ranges_equal.md @@ -37,13 +37,6 @@ namespace std::ranges { Proj2 proj2 = {}); // (2) C++20 } ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* ranges::equal_to[link /reference/functional/ranges_equal_to.md] -* identity[link /reference/functional/identity.md] -* indirectly_comparable[link /reference/iterator/indirectly_comparable.md] -* input_range[link /reference/ranges/input_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] ## 概要 2つの範囲を等値比較する。 @@ -118,13 +111,6 @@ struct equal_impl { inline constexpr equal_impl equal; ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* ranges::equal_to[link /reference/functional/ranges_equal_to.md] -* identity[link /reference/functional/identity.md] -* indirectly_comparable[link /reference/iterator/indirectly_comparable.md] -* input_range[link /reference/ranges/input_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] * distance[link /reference/iterator/ranges_distance.md] * invoke[link /reference/functional/invoke.md] diff --git a/reference/algorithm/ranges_equal_range.md b/reference/algorithm/ranges_equal_range.md index 41354e6feb..3b0e59e80c 100644 --- a/reference/algorithm/ranges_equal_range.md +++ b/reference/algorithm/ranges_equal_range.md @@ -61,16 +61,8 @@ namespace std::ranges { Proj proj = {}); // (2) C++26 } ``` -* forward_iterator[link /reference/iterator/forward_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * ranges::less[link /reference/functional/ranges_less.md] -* identity[link /reference/functional/identity.md] * indirect_strict_weak_order[link /reference/iterator/indirect_strict_weak_order.md] -* projected[link /reference/iterator/projected.md] -* subrange[link /reference/ranges/subrange.md] -* forward_range[link /reference/ranges/forward_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* borrowed_subrange_t[link /reference/ranges/borrowed_subrange_t.md] ## 概要 diff --git a/reference/algorithm/ranges_fill.md b/reference/algorithm/ranges_fill.md index 2b28d0a90c..2c2985e6b0 100644 --- a/reference/algorithm/ranges_fill.md +++ b/reference/algorithm/ranges_fill.md @@ -29,9 +29,6 @@ namespace std::ranges { fill(R&& r, const T& value); // (2) C++26 } ``` -* output_iterator[link /reference/iterator/output_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* output_range[link /reference/ranges/output_range.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 diff --git a/reference/algorithm/ranges_fill_n.md b/reference/algorithm/ranges_fill_n.md index 6a89db71ca..dfca5a816f 100644 --- a/reference/algorithm/ranges_fill_n.md +++ b/reference/algorithm/ranges_fill_n.md @@ -21,8 +21,6 @@ namespace std::ranges { const T& value); // (1) C++26 } ``` -* output_iterator[link /reference/iterator/output_iterator.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] ## 概要 指定された値で出力の範囲に `n` 個を書き込む。 diff --git a/reference/algorithm/ranges_find.md b/reference/algorithm/ranges_find.md index 274724a14e..8823240a02 100644 --- a/reference/algorithm/ranges_find.md +++ b/reference/algorithm/ranges_find.md @@ -45,15 +45,7 @@ namespace std::ranges { Proj proj = {}); // (2) C++26 } ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* identity[link /reference/functional/identity.md] -* indirect_binary_predicate[link /reference/iterator/indirect_binary_predicate.md] -* ranges::equal_to[link /reference/functional/ranges_equal_to.md] -* input_range[link /reference/ranges/input_range.md] -* projected[link /reference/iterator/projected.md] ## 概要 指定された値を検索する。 @@ -215,15 +207,7 @@ struct find_impl { inline constexpr find_impl find; ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* identity[link /reference/functional/identity.md] -* indirect_binary_predicate[link /reference/iterator/indirect_binary_predicate.md] -* ranges::equal_to[link /reference/functional/ranges_equal_to.md] -* input_range[link /reference/ranges/input_range.md] -* projected[link /reference/iterator/projected.md] * begin[link /reference/ranges/begin.md] * end[link /reference/ranges/end.md] * ref[link /reference/functional/ref.md] diff --git a/reference/algorithm/ranges_find_first_of.md b/reference/algorithm/ranges_find_first_of.md index 9ed578762d..cf2c7a8052 100644 --- a/reference/algorithm/ranges_find_first_of.md +++ b/reference/algorithm/ranges_find_first_of.md @@ -37,16 +37,7 @@ namespace std::ranges { Proj2 proj2 = {}); // (2) C++20 } ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* forward_iterator[link /reference/iterator/forward_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* ranges::equal_to[link /reference/functional/ranges_equal_to.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* identity[link /reference/functional/identity.md] -* indirectly_comparable[link /reference/iterator/indirectly_comparable.md] -* input_range[link /reference/ranges/input_range.md] -* forward_range[link /reference/ranges/forward_range.md] ## 概要 ある集合の1つとマッチする最初の要素を検索する。 @@ -116,16 +107,7 @@ struct find_first_of_impl { inline constexpr find_first_of_impl find_first_of; ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* forward_iterator[link /reference/iterator/forward_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* ranges::equal_to[link /reference/functional/ranges_equal_to.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* identity[link /reference/functional/identity.md] -* indirectly_comparable[link /reference/iterator/indirectly_comparable.md] -* input_range[link /reference/ranges/input_range.md] -* forward_range[link /reference/ranges/forward_range.md] * invoke[link /reference/functional/invoke.md] * begin[link /reference/ranges/begin.md] * end[link /reference/ranges/end.md] diff --git a/reference/algorithm/ranges_find_if.md b/reference/algorithm/ranges_find_if.md index cd50115033..132209765f 100644 --- a/reference/algorithm/ranges_find_if.md +++ b/reference/algorithm/ranges_find_if.md @@ -25,14 +25,7 @@ namespace std::ranges { Proj proj = {}); // (2) C++20 } ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* identity[link /reference/functional/identity.md] -* indirect_unary_predicate[link /reference/iterator/indirect_unary_predicate.md] -* input_range[link /reference/ranges/input_range.md] -* projected[link /reference/iterator/projected.md] ## 概要 範囲の中から、指定された条件を満たす最初の要素を検索する。 @@ -92,14 +85,7 @@ struct find_if_impl { inline constexpr find_if_impl find_if; ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* identity[link /reference/functional/identity.md] -* indirect_unary_predicate[link /reference/iterator/indirect_unary_predicate.md] -* input_range[link /reference/ranges/input_range.md] -* projected[link /reference/iterator/projected.md] * invoke[link /reference/functional/invoke.md] * begin[link /reference/ranges/begin.md] * end[link /reference/ranges/end.md] diff --git a/reference/algorithm/ranges_find_if_not.md b/reference/algorithm/ranges_find_if_not.md index 50d8439db7..e2b25e41c2 100644 --- a/reference/algorithm/ranges_find_if_not.md +++ b/reference/algorithm/ranges_find_if_not.md @@ -25,14 +25,7 @@ namespace std::ranges { Proj proj = {}); // (2) C++20 } ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* identity[link /reference/functional/identity.md] -* indirect_unary_predicate[link /reference/iterator/indirect_unary_predicate.md] -* input_range[link /reference/ranges/input_range.md] -* projected[link /reference/iterator/projected.md] ## 概要 範囲の中から、指定された条件を満たさない最初の要素を検索する。 @@ -92,14 +85,7 @@ struct find_if_not_impl { inline constexpr find_if_not_impl find_if_not; ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* identity[link /reference/functional/identity.md] -* indirect_unary_predicate[link /reference/iterator/indirect_unary_predicate.md] -* input_range[link /reference/ranges/input_range.md] -* projected[link /reference/iterator/projected.md] * invoke[link /reference/functional/invoke.md] * begin[link /reference/ranges/begin.md] * end[link /reference/ranges/end.md] diff --git a/reference/algorithm/ranges_find_last.md b/reference/algorithm/ranges_find_last.md index a2c7878bc6..228a6d65f6 100644 --- a/reference/algorithm/ranges_find_last.md +++ b/reference/algorithm/ranges_find_last.md @@ -61,14 +61,6 @@ namespace std::ranges { Proj proj = {}); // (2) C++26 } ``` -* forward_iterator[link /reference/iterator/forward_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* identity[link /reference/functional/identity.md] -* indirect_binary_predicate[link /reference/iterator/indirect_binary_predicate.md] -* ranges::equal_to[link /reference/functional/ranges_equal_to.md] -* forward_range[link /reference/ranges/forward_range.md] -* projected[link /reference/iterator/projected.md] ## 概要 指定された値を末尾から検索する。 diff --git a/reference/algorithm/ranges_find_last_if.md b/reference/algorithm/ranges_find_last_if.md index b7d008bf0a..33aa02e731 100644 --- a/reference/algorithm/ranges_find_last_if.md +++ b/reference/algorithm/ranges_find_last_if.md @@ -25,13 +25,6 @@ namespace std::ranges { Proj proj = {}); // (2) C++23 } ``` -* forward_iterator[link /reference/iterator/forward_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* identity[link /reference/functional/identity.md] -* indirect_unary_predicate[link /reference/iterator/indirect_unary_predicate.md] -* forward_range[link /reference/ranges/forward_range.md] -* projected[link /reference/iterator/projected.md] ## 概要 範囲の中から、指定された条件を満たす最後の要素を検索する。 diff --git a/reference/algorithm/ranges_find_last_if_not.md b/reference/algorithm/ranges_find_last_if_not.md index d9dd8b90f1..1ffbed588e 100644 --- a/reference/algorithm/ranges_find_last_if_not.md +++ b/reference/algorithm/ranges_find_last_if_not.md @@ -25,13 +25,6 @@ namespace std::ranges { Proj proj = {}); // (2) C++23 } ``` -* forward_iterator[link /reference/iterator/forward_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* identity[link /reference/functional/identity.md] -* indirect_unary_predicate[link /reference/iterator/indirect_unary_predicate.md] -* forward_range[link /reference/ranges/forward_range.md] -* projected[link /reference/iterator/projected.md] ## 概要 範囲の中から、指定された条件を満たさない最後の要素を検索する。 diff --git a/reference/algorithm/ranges_fold_left.md b/reference/algorithm/ranges_fold_left.md index cd35caa38d..6dcd4cd043 100644 --- a/reference/algorithm/ranges_fold_left.md +++ b/reference/algorithm/ranges_fold_left.md @@ -41,10 +41,6 @@ namespace std::ranges { F f); // (2) C++26 } ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* input_range[link /reference/ranges/input_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] ## 概要 @@ -107,14 +103,9 @@ concept indirectly-binary-left-foldable = decay_t>>>; ``` * movable[link /reference/concepts/movable.md] -* convertible_to[link /reference/concepts/convertible_to.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] -* invocable[link /reference/concepts/invocable.md] * assignable_from[link /reference/concepts/assignable_from.md] -* copy_constructible[link /reference/concepts/copy_constructible.md] * indirectly_readable[link /reference/iterator/indirectly_readable.md] -* invoke_result_t[link /reference/type_traits/invoke_result.md] -* decay_t[link /reference/type_traits/decay.md] ここでのテンプレートパラメータはそれぞれ、二項演算を指定する呼出可能な型`F`、初期値の型`T`、イテレータ型`I`、戻り値型(積算値の型)`U`である。 @@ -146,8 +137,6 @@ concept indirectly-binary-left-foldable = ```cpp using U = decay_t>>; ``` - * decay_t[link /reference/type_traits/decay.md] - * invoke_result_t[link /reference/type_traits/invoke_result.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] - すなわち、指定した二項演算を初期値とイテレータによって`f(std::move(init), *first)`のように呼び出した時の戻り値型がこの関数の戻り値型となる。 @@ -197,7 +186,6 @@ int main() { } ``` * fold_left[color ff0000] -* same_as[link /reference/concepts/same_as.md] * iota[link /reference/ranges/iota_view.md] * plus[link /reference/functional/plus.md] * println[link /reference/print/println.md] diff --git a/reference/algorithm/ranges_fold_left_first.md b/reference/algorithm/ranges_fold_left_first.md index 0365a1065e..c9c9531caf 100644 --- a/reference/algorithm/ranges_fold_left_first.md +++ b/reference/algorithm/ranges_fold_left_first.md @@ -17,15 +17,8 @@ namespace std::ranges { constexpr auto fold_left_first(R&& r, F f); // (2) } ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * constructible_from[link /reference/concepts/constructible_from.md] -* iter_value_t[link /reference/iterator/iter_value_t.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] -* input_range[link /reference/ranges/input_range.md] -* range_value_t[link /reference/ranges/range_value_t.md] -* range_reference_t[link /reference/ranges/range_reference_t.md] -* iterator_t[link /reference/ranges/iterator_t.md] * indirectly-binary-left-foldable[link ./ranges_fold_left.md] ## 概要 @@ -77,7 +70,6 @@ namespace std::ranges { using U = decltype(ranges::fold_left(std::move(first), last, iter_value_t(*first), f)); ``` * fold_left[link ./ranges_fold_left.md] -* iter_value_t[link /reference/iterator/iter_value_t.md] すなわち、他の引数はそのままに初期値として入力範囲`r`の要素を手動で指定して`fold_left`を呼び出した際の戻り値型を包む`optional`となる。 diff --git a/reference/algorithm/ranges_fold_left_first_with_iter.md b/reference/algorithm/ranges_fold_left_first_with_iter.md index 9f17f8c109..dce9fe282f 100644 --- a/reference/algorithm/ranges_fold_left_first_with_iter.md +++ b/reference/algorithm/ranges_fold_left_first_with_iter.md @@ -17,16 +17,9 @@ namespace std::ranges { constexpr auto fold_left_first_with_iter(R&& r, F f); // (2) } ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * indirectly-binary-left-foldable[link ./ranges_fold_left.md] -* iter_value_t[link /reference/iterator/iter_value_t.md] * constructible_from[link /reference/concepts/constructible_from.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] -* input_range[link /reference/ranges/input_range.md] -* range_value_t[link /reference/ranges/range_value_t.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* range_reference_t[link /reference/ranges/range_reference_t.md] ## 概要 @@ -56,7 +49,6 @@ namespace std::ranges { using U = decltype(ranges::fold_left(std::move(first), last, iter_value_t(*first), f)); ``` * fold_left[link ./ranges_fold_left.md] -* iter_value_t[link /reference/iterator/iter_value_t.md] - (1) : 以下と等価 ```cpp @@ -225,7 +217,6 @@ int main() { ``` * fold_left_first_with_iter[color ff0000] * take_while[link /reference/ranges/take_while_view.md] -* subrange[link /reference/ranges/subrange.md] * println[link /reference/print/println.md] * value_or[link /reference/optional/optional/value_or.md] diff --git a/reference/algorithm/ranges_fold_left_with_iter.md b/reference/algorithm/ranges_fold_left_with_iter.md index 1646732ec9..dd682d6c08 100644 --- a/reference/algorithm/ranges_fold_left_with_iter.md +++ b/reference/algorithm/ranges_fold_left_with_iter.md @@ -41,11 +41,7 @@ namespace std::ranges { F f); // (2) C++26 } ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * indirectly-binary-left-foldable[link ./ranges_fold_left.md] -* input_range[link /reference/ranges/input_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] ## 概要 @@ -75,8 +71,6 @@ namespace std::ranges { ```cpp using U = decay_t>>; ``` -* decay_t[link /reference/type_traits/decay.md] -* invoke_result_t[link /reference/type_traits/invoke_result.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] - (1) : 以下と等価 @@ -250,7 +244,6 @@ int main() { ``` * fold_left_with_iter[color ff0000] * take_while[link /reference/ranges/take_while_view.md] -* subrange[link /reference/ranges/subrange.md] * println[link /reference/print/println.md] #### 出力 diff --git a/reference/algorithm/ranges_fold_right.md b/reference/algorithm/ranges_fold_right.md index cacc81b108..9d90cfa0ca 100644 --- a/reference/algorithm/ranges_fold_right.md +++ b/reference/algorithm/ranges_fold_right.md @@ -41,10 +41,6 @@ namespace std::ranges { F f); // (2) C++26 } ``` -* bidirectional_iterator[link /reference/iterator/bidirectional_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* bidirectional_range[link /reference/ranges/bidirectional_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] ## 概要 @@ -126,8 +122,6 @@ while (first != tail) accum = invoke(f, *--tail, std::move(accum)); return accum; ``` -* decay_t[link /reference/type_traits/decay.md] -* invoke_result_t[link /reference/type_traits/invoke_result.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] * next[link /reference/iterator/ranges_next.md] * invoke[link /reference/functional/invoke.md] @@ -143,8 +137,6 @@ return accum; ```cpp using U = decay_t, T>>; ``` - * decay_t[link /reference/type_traits/decay.md] - * invoke_result_t[link /reference/type_traits/invoke_result.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] - すなわち、指定した二項演算をイテレータと初期値によって`f(*first, std::move(init))`のように呼び出した時の戻り値型がこの関数の戻り値型となる。 @@ -196,7 +188,6 @@ int main() { } ``` * fold_right[color ff0000] -* same_as[link /reference/concepts/same_as.md] * iota[link /reference/ranges/iota_view.md] * plus[link /reference/functional/plus.md] * println[link /reference/print/println.md] diff --git a/reference/algorithm/ranges_fold_right_last.md b/reference/algorithm/ranges_fold_right_last.md index f191e60466..2e3d621ab1 100644 --- a/reference/algorithm/ranges_fold_right_last.md +++ b/reference/algorithm/ranges_fold_right_last.md @@ -17,15 +17,8 @@ namespace std::ranges { constexpr auto fold_right_last(R&& r, F f); // (2) } ``` -* bidirectional_iterator[link /reference/iterator/bidirectional_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * constructible_from[link /reference/concepts/constructible_from.md] -* iter_value_t[link /reference/iterator/iter_value_t.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] -* bidirectional_range[link /reference/ranges/bidirectional_range.md] -* range_value_t[link /reference/ranges/range_value_t.md] -* range_reference_t[link /reference/ranges/range_reference_t.md] -* iterator_t[link /reference/ranges/iterator_t.md] * indirectly-binary-right-foldable[link ./ranges_fold_right.md] ## 概要 @@ -61,14 +54,11 @@ if (first == last) I tail = ranges::prev(ranges::next(first, std::move(last))); return optional(in_place, ranges::fold_right(std::move(first), tail, iter_value_t(*tail), std::move(f))); ``` -* decay_t[link /reference/type_traits/decay.md] -* invoke_result_t[link /reference/type_traits/invoke_result.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] * prev[link /reference/iterator/ranges_prev.md] * invoke[link /reference/functional/invoke.md] * optional[link /reference/optional/optional.md] * fold_right[link ./ranges_fold_right.md] -* iter_value_t[link /reference/iterator/iter_value_t.md] 空の入力範囲に対しては無効値を保持する[`optional`](/reference/optional/optional.md)を返す。 @@ -85,7 +75,6 @@ auto tail = --last; decltype(ranges::fold_right(std::move(first), tail, iter_value_t(*tail), f)); ``` * fold_right[link ./ranges_fold_right.md] -* iter_value_t[link /reference/iterator/iter_value_t.md] すなわち、他の引数はそのままに初期値として入力範囲`r`の要素を手動で指定して`fold_right`を呼び出した際の戻り値型を包む`optional`となる。 diff --git a/reference/algorithm/ranges_for_each.md b/reference/algorithm/ranges_for_each.md index 6ef38d2aa2..b68d9e5dcb 100644 --- a/reference/algorithm/ranges_for_each.md +++ b/reference/algorithm/ranges_for_each.md @@ -25,14 +25,8 @@ namespace std::ranges { Proj proj = {}); // (2) C++20 } ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* identity[link /reference/functional/identity.md] -* iterator_t[link /reference/ranges/iterator_t.md] * indirectly_unary_invocable[link /reference/iterator/indirectly_unary_invocable.md] -* input_range[link /reference/ranges/input_range.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] -* projected[link /reference/iterator/projected.md] * for_each_result[link /reference/algorithm/ranges_in_fun_result.md] @@ -140,15 +134,8 @@ struct for_each_impl { inline constexpr for_each_impl for_each; ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* identity[link /reference/functional/identity.md] -* iterator_t[link /reference/ranges/iterator_t.md] * indirectly_unary_invocable[link /reference/iterator/indirectly_unary_invocable.md] -* copy_constructible[link /reference/concepts/copy_constructible.md] -* input_range[link /reference/ranges/input_range.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] -* projected[link /reference/iterator/projected.md] * ref[link /reference/functional/ref.md] * move[link /reference/utility/move.md] diff --git a/reference/algorithm/ranges_for_each_n.md b/reference/algorithm/ranges_for_each_n.md index bddd5733c4..d6eb16ba95 100644 --- a/reference/algorithm/ranges_for_each_n.md +++ b/reference/algorithm/ranges_for_each_n.md @@ -16,11 +16,7 @@ namespace std::ranges { Proj proj = {}); // (1) C++20 } ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* identity[link /reference/functional/identity.md] * indirectly_unary_invocable[link /reference/iterator/indirectly_unary_invocable.md] -* projected[link /reference/iterator/projected.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] * for_each_n_result[link /reference/algorithm/ranges_in_fun_result.md] ## 概要 @@ -111,12 +107,7 @@ struct for_each_n_impl { inline constexpr for_each_n_impl for_each_n; ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* identity[link /reference/functional/identity.md] * indirectly_unary_invocable[link /reference/iterator/indirectly_unary_invocable.md] -* copy_constructible[link /reference/concepts/copy_constructible.md] -* projected[link /reference/iterator/projected.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] * move[link /reference/utility/move.md] diff --git a/reference/algorithm/ranges_generate.md b/reference/algorithm/ranges_generate.md index 3bc406c838..45d70770d7 100644 --- a/reference/algorithm/ranges_generate.md +++ b/reference/algorithm/ranges_generate.md @@ -24,12 +24,7 @@ namespace std::ranges { } ``` * input_or_output_iterator[link /reference/iterator/input_or_output_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* copy_constructible[link /reference/concepts/copy_constructible.md] -* invocable[link /reference/concepts/invocable.md] * indirectly_writable[link /reference/iterator/indirectly_writable.md] -* invoke_result_t[link /reference/type_traits/invoke_result.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 diff --git a/reference/algorithm/ranges_generate_n.md b/reference/algorithm/ranges_generate_n.md index 7db985b467..6f06cec132 100644 --- a/reference/algorithm/ranges_generate_n.md +++ b/reference/algorithm/ranges_generate_n.md @@ -16,10 +16,7 @@ namespace std::ranges { } ``` * input_or_output_iterator[link /reference/iterator/input_or_output_iterator.md] -* copy_constructible[link /reference/concepts/copy_constructible.md] -* invocable[link /reference/concepts/invocable.md] * indirectly_writable[link /reference/iterator/indirectly_writable.md] -* invoke_result_t[link /reference/type_traits/invoke_result.md] ## 概要 diff --git a/reference/algorithm/ranges_in_found_result.md b/reference/algorithm/ranges_in_found_result.md index da742ff432..bb0f493986 100644 --- a/reference/algorithm/ranges_in_found_result.md +++ b/reference/algorithm/ranges_in_found_result.md @@ -34,7 +34,6 @@ namespace std::ranges { } ``` * no_unique_address[link /lang/cpp20/language_support_for_empty_objects.md] -* convertible_to[link /reference/concepts/convertible_to.md] * std::move[link /reference/utility/move.md] ## 概要 diff --git a/reference/algorithm/ranges_in_fun_result.md b/reference/algorithm/ranges_in_fun_result.md index e993e4fa54..66abce56d1 100644 --- a/reference/algorithm/ranges_in_fun_result.md +++ b/reference/algorithm/ranges_in_fun_result.md @@ -35,7 +35,6 @@ namespace std::ranges { } ``` * no_unique_address[link /lang/cpp20/language_support_for_empty_objects.md] -* convertible_to[link /reference/concepts/convertible_to.md] * std::move[link /reference/utility/move.md] ## 概要 diff --git a/reference/algorithm/ranges_in_in_out_result.md b/reference/algorithm/ranges_in_in_out_result.md index ff9032d0af..0ae68f3334 100644 --- a/reference/algorithm/ranges_in_in_out_result.md +++ b/reference/algorithm/ranges_in_in_out_result.md @@ -52,7 +52,6 @@ namespace std::ranges { } ``` * no_unique_address[link /lang/cpp20/language_support_for_empty_objects.md] -* convertible_to[link /reference/concepts/convertible_to.md] * std::move[link /reference/utility/move.md] ## 概要 diff --git a/reference/algorithm/ranges_in_in_result.md b/reference/algorithm/ranges_in_in_result.md index 4e25b2408b..d02409dc5c 100644 --- a/reference/algorithm/ranges_in_in_result.md +++ b/reference/algorithm/ranges_in_in_result.md @@ -35,7 +35,6 @@ namespace std::ranges { } ``` * no_unique_address[link /lang/cpp20/language_support_for_empty_objects.md] -* convertible_to[link /reference/concepts/convertible_to.md] * std::move[link /reference/utility/move.md] ## 概要 diff --git a/reference/algorithm/ranges_in_out_out_result.md b/reference/algorithm/ranges_in_out_out_result.md index e998f93dd8..a35ed052d3 100644 --- a/reference/algorithm/ranges_in_out_out_result.md +++ b/reference/algorithm/ranges_in_out_out_result.md @@ -36,7 +36,6 @@ namespace std::ranges { } ``` * no_unique_address[link /lang/cpp20/language_support_for_empty_objects.md] -* convertible_to[link /reference/concepts/convertible_to.md] * std::move[link /reference/utility/move.md] ## 概要 diff --git a/reference/algorithm/ranges_in_out_result.md b/reference/algorithm/ranges_in_out_result.md index f0885623e0..97aa92f573 100644 --- a/reference/algorithm/ranges_in_out_result.md +++ b/reference/algorithm/ranges_in_out_result.md @@ -91,7 +91,6 @@ namespace std::ranges { } ``` * no_unique_address[link /lang/cpp20/language_support_for_empty_objects.md] -* convertible_to[link /reference/concepts/convertible_to.md] * std::move[link /reference/utility/move.md] ## 概要 diff --git a/reference/algorithm/ranges_in_value_result.md b/reference/algorithm/ranges_in_value_result.md index f2658d58a9..2755be246c 100644 --- a/reference/algorithm/ranges_in_value_result.md +++ b/reference/algorithm/ranges_in_value_result.md @@ -37,7 +37,6 @@ namespace std::ranges { } ``` * no_unique_address[link /lang/cpp20/language_support_for_empty_objects.md] -* convertible_to[link /reference/concepts/convertible_to.md] * std::move[link /reference/utility/move.md] ## 概要 diff --git a/reference/algorithm/ranges_includes.md b/reference/algorithm/ranges_includes.md index 66f6cfda04..41e5babb6d 100644 --- a/reference/algorithm/ranges_includes.md +++ b/reference/algorithm/ranges_includes.md @@ -41,14 +41,8 @@ namespace std::ranges { Proj2 proj2 = {}); // (2) C++20 } ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * indirect_strict_weak_order[link /reference/iterator/indirect_strict_weak_order.md] -* projected[link /reference/iterator/projected.md] * ranges::less[link /reference/functional/ranges_less.md] -* identity[link /reference/functional/identity.md] -* input_range[link /reference/ranges/input_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] ## 概要 2つのソート済み範囲において、一方の範囲の要素がもう一方の範囲に全て含まれているかを判定する。 diff --git a/reference/algorithm/ranges_inplace_merge.md b/reference/algorithm/ranges_inplace_merge.md index 062a0e0a0f..58cfe9bb48 100644 --- a/reference/algorithm/ranges_inplace_merge.md +++ b/reference/algorithm/ranges_inplace_merge.md @@ -49,13 +49,8 @@ namespace std::ranges { Proj proj = {}); // (2) C++26 } ``` -* bidirectional_iterator[link /reference/iterator/bidirectional_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * ranges::less[link /reference/functional/ranges_less.md] -* identity[link /reference/functional/identity.md] * sortable[link /reference/iterator/sortable.md] -* bidirectional_range[link /reference/ranges/bidirectional_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 diff --git a/reference/algorithm/ranges_is_heap.md b/reference/algorithm/ranges_is_heap.md index 32159b8754..35abb8e9fa 100644 --- a/reference/algorithm/ranges_is_heap.md +++ b/reference/algorithm/ranges_is_heap.md @@ -25,13 +25,8 @@ namespace std::ranges { Proj proj = {}); // (2) C++20 } ``` -* random_access_iterator[link /reference/iterator/random_access_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * ranges::less[link /reference/functional/ranges_less.md] -* identity[link /reference/functional/identity.md] * indirect_strict_weak_order[link /reference/iterator/indirect_strict_weak_order.md] -* random_access_range[link /reference/ranges/random_access_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] ## 概要 範囲がヒープ化されているか判定する。 diff --git a/reference/algorithm/ranges_is_heap_until.md b/reference/algorithm/ranges_is_heap_until.md index 6eb790193a..d96bc5c22c 100644 --- a/reference/algorithm/ranges_is_heap_until.md +++ b/reference/algorithm/ranges_is_heap_until.md @@ -25,13 +25,8 @@ namespace std::ranges { Proj proj = {}); // (2) C++20 } ``` -* random_access_iterator[link /reference/iterator/random_access_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * ranges::less[link /reference/functional/ranges_less.md] -* identity[link /reference/functional/identity.md] * indirect_strict_weak_order[link /reference/iterator/indirect_strict_weak_order.md] -* random_access_range[link /reference/ranges/random_access_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] ## 概要 範囲がヒープ化されているか判定し、ヒープ化されていない最初の要素を指すイテレータを取得する。 diff --git a/reference/algorithm/ranges_is_partitioned.md b/reference/algorithm/ranges_is_partitioned.md index ca6ede33be..ffff76a496 100644 --- a/reference/algorithm/ranges_is_partitioned.md +++ b/reference/algorithm/ranges_is_partitioned.md @@ -25,13 +25,6 @@ namespace std::ranges { Proj proj = {}); // (2) C++20 } ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* identity[link /reference/functional/identity.md] -* indirect_unary_predicate[link /reference/iterator/indirect_unary_predicate.md] -* projected[link /reference/iterator/projected.md] -* input_range[link /reference/ranges/input_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] ## 概要 与えられた範囲が条件によって[区分化](/reference/algorithm.md#sequence-is-partitioned)されているか判定する。 diff --git a/reference/algorithm/ranges_is_permutation.md b/reference/algorithm/ranges_is_permutation.md index 12f6a95e62..c1462a2d13 100644 --- a/reference/algorithm/ranges_is_permutation.md +++ b/reference/algorithm/ranges_is_permutation.md @@ -41,14 +41,7 @@ namespace std::ranges { Proj2 proj2 = {}); // (2) C++20 } ``` -* forward_iterator[link /reference/iterator/forward_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* ranges::equal_to[link /reference/functional/ranges_equal_to.md] -* identity[link /reference/functional/identity.md] * indirect_equivalence_relation[link /reference/iterator/indirect_equivalence_relation.md] -* projected[link /reference/iterator/projected.md] -* forward_range[link /reference/ranges/forward_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] ## 概要 範囲 `[first2, last2)` を並べ替えたものが、`[first1, last1)` の範囲と一致するか判定する。 diff --git a/reference/algorithm/ranges_is_sorted.md b/reference/algorithm/ranges_is_sorted.md index 5db4b0ce9b..b5bf9efb07 100644 --- a/reference/algorithm/ranges_is_sorted.md +++ b/reference/algorithm/ranges_is_sorted.md @@ -25,14 +25,8 @@ namespace std::ranges { Proj proj = {}); // (2) C++20 } ``` -* forward_iterator[link /reference/iterator/forward_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * ranges::less[link /reference/functional/ranges_less.md] -* identity[link /reference/functional/identity.md] * indirect_strict_weak_order[link /reference/iterator/indirect_strict_weak_order.md] -* projected[link /reference/iterator/projected.md] -* forward_range[link /reference/ranges/forward_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] ## 概要 与えられた範囲がソート済みか判定する。 diff --git a/reference/algorithm/ranges_is_sorted_until.md b/reference/algorithm/ranges_is_sorted_until.md index b06950f435..d01cf16df7 100644 --- a/reference/algorithm/ranges_is_sorted_until.md +++ b/reference/algorithm/ranges_is_sorted_until.md @@ -25,14 +25,8 @@ namespace std::ranges { Proj proj = {}); // (2) C++20 } ``` -* forward_iterator[link /reference/iterator/forward_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * ranges::less[link /reference/functional/ranges_less.md] -* identity[link /reference/functional/identity.md] * indirect_strict_weak_order[link /reference/iterator/indirect_strict_weak_order.md] -* projected[link /reference/iterator/projected.md] -* forward_range[link /reference/ranges/forward_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 @@ -102,14 +96,8 @@ struct is_sorted_until_impl { inline constexpr is_sorted_until_impl is_sorted_until; ``` -* forward_iterator[link /reference/iterator/forward_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * ranges::less[link /reference/functional/ranges_less.md] -* identity[link /reference/functional/identity.md] * indirect_strict_weak_order[link /reference/iterator/indirect_strict_weak_order.md] -* projected[link /reference/iterator/projected.md] -* forward_range[link /reference/ranges/forward_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] * begin[link /reference/ranges/begin.md] * end[link /reference/ranges/end.md] diff --git a/reference/algorithm/ranges_lexicographical_compare.md b/reference/algorithm/ranges_lexicographical_compare.md index 34deff6682..80fb244482 100644 --- a/reference/algorithm/ranges_lexicographical_compare.md +++ b/reference/algorithm/ranges_lexicographical_compare.md @@ -42,14 +42,8 @@ namespace std::ranges { Proj2 proj2 = {}); // (2) C++20 } ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * indirect_strict_weak_order[link /reference/iterator/indirect_strict_weak_order.md] -* projected[link /reference/iterator/projected.md] * ranges::less[link /reference/functional/ranges_less.md] -* identity[link /reference/functional/identity.md] -* input_range[link /reference/ranges/input_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] ## 概要 `[first1, last1)`および`[first2, last2)`の2つの範囲を辞書式順序で比較する。 diff --git a/reference/algorithm/ranges_lower_bound.md b/reference/algorithm/ranges_lower_bound.md index b046fa0b73..1e67938832 100644 --- a/reference/algorithm/ranges_lower_bound.md +++ b/reference/algorithm/ranges_lower_bound.md @@ -63,14 +63,8 @@ namespace std::ranges { Proj proj = {}); // (2) C++26 } ``` -* forward_iterator[link /reference/iterator/forward_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * ranges::less[link /reference/functional/ranges_less.md] -* identity[link /reference/functional/identity.md] * indirect_strict_weak_order[link /reference/iterator/indirect_strict_weak_order.md] -* projected[link /reference/iterator/projected.md] -* forward_range[link /reference/ranges/forward_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 diff --git a/reference/algorithm/ranges_make_heap.md b/reference/algorithm/ranges_make_heap.md index 0525fa9cf3..b7ffdb88e2 100644 --- a/reference/algorithm/ranges_make_heap.md +++ b/reference/algorithm/ranges_make_heap.md @@ -27,13 +27,8 @@ namespace std::ranges { Proj proj = {}); // (2) C++20 } ``` -* random_access_iterator[link /reference/iterator/random_access_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * ranges::less[link /reference/functional/ranges_less.md] -* identity[link /reference/functional/identity.md] * sortable[link /reference/iterator/sortable.md] -* random_access_range[link /reference/ranges/random_access_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 diff --git a/reference/algorithm/ranges_max.md b/reference/algorithm/ranges_max.md index 3a685af8a3..862861ece3 100644 --- a/reference/algorithm/ranges_max.md +++ b/reference/algorithm/ranges_max.md @@ -33,15 +33,10 @@ namespace std::ranges { Proj proj = {}); // (3) C++20 } ``` -* identity[link /reference/functional/identity.md] * indirect_strict_weak_order[link /reference/iterator/indirect_strict_weak_order.md] -* projected[link /reference/iterator/projected.md] * ranges::less[link /reference/functional/ranges_less.md] * initializer_list[link /reference/initializer_list/initializer_list.md] -* input_range[link /reference/ranges/input_range.md] * indirectly_copyable_storable[link /reference/iterator/indirectly_copyable_storable.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* range_value_t[link /reference/ranges/range_value_t.md] ## 概要 同じ型の2つの値、もしくは範囲によるN個の値のうち、最大値を取得する。 diff --git a/reference/algorithm/ranges_max_element.md b/reference/algorithm/ranges_max_element.md index 7f4793388e..9d00ee5d41 100644 --- a/reference/algorithm/ranges_max_element.md +++ b/reference/algorithm/ranges_max_element.md @@ -25,13 +25,8 @@ namespace std::ranges { Proj proj = {}); // (2) C++20 } ``` -* forward_iterator[link /reference/iterator/forward_iterator.md] -* identity[link /reference/functional/identity.md] * indirect_strict_weak_order[link /reference/iterator/indirect_strict_weak_order.md] -* projected[link /reference/iterator/projected.md] * ranges::less[link /reference/functional/ranges_less.md] -* forward_range[link /reference/ranges/forward_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 diff --git a/reference/algorithm/ranges_merge.md b/reference/algorithm/ranges_merge.md index a51a24e026..739eace4ed 100644 --- a/reference/algorithm/ranges_merge.md +++ b/reference/algorithm/ranges_merge.md @@ -46,14 +46,9 @@ namespace std::ranges { } ``` * merge_result[link ranges_in_in_out_result.md] -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * weakly_incrementable[link /reference/iterator/weakly_incrementable.md] * ranges::less[link /reference/functional/ranges_less.md] -* identity[link /reference/functional/identity.md] * mergeable[link /reference/iterator/mergeable.md] -* input_range[link /reference/ranges/input_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 diff --git a/reference/algorithm/ranges_min.md b/reference/algorithm/ranges_min.md index c8fb0877e1..7282981d4d 100644 --- a/reference/algorithm/ranges_min.md +++ b/reference/algorithm/ranges_min.md @@ -33,15 +33,10 @@ namespace std::ranges { Proj proj = {}); // (3) C++20 } ``` -* identity[link /reference/functional/identity.md] * indirect_strict_weak_order[link /reference/iterator/indirect_strict_weak_order.md] -* projected[link /reference/iterator/projected.md] * ranges::less[link /reference/functional/ranges_less.md] * initializer_list[link /reference/initializer_list/initializer_list.md] -* input_range[link /reference/ranges/input_range.md] * indirectly_copyable_storable[link /reference/iterator/indirectly_copyable_storable.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* range_value_t[link /reference/ranges/range_value_t.md] ## 概要 同じ型の2つの値、もしくは範囲によるN個の値のうち、最小値を取得する。 diff --git a/reference/algorithm/ranges_min_element.md b/reference/algorithm/ranges_min_element.md index 72390b9137..c81c1e676d 100644 --- a/reference/algorithm/ranges_min_element.md +++ b/reference/algorithm/ranges_min_element.md @@ -25,13 +25,8 @@ namespace std::ranges { Proj proj = {}); // (2) C++20 } ``` -* forward_iterator[link /reference/iterator/forward_iterator.md] -* identity[link /reference/functional/identity.md] * indirect_strict_weak_order[link /reference/iterator/indirect_strict_weak_order.md] -* projected[link /reference/iterator/projected.md] * ranges::less[link /reference/functional/ranges_less.md] -* forward_range[link /reference/ranges/forward_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] diff --git a/reference/algorithm/ranges_min_max_result.md b/reference/algorithm/ranges_min_max_result.md index 87f1a3d3d5..11e3c00ec2 100644 --- a/reference/algorithm/ranges_min_max_result.md +++ b/reference/algorithm/ranges_min_max_result.md @@ -35,7 +35,6 @@ namespace std::ranges { } ``` * no_unique_address[link /lang/cpp20/language_support_for_empty_objects.md] -* convertible_to[link /reference/concepts/convertible_to.md] * std::move[link /reference/utility/move.md] ## 概要 diff --git a/reference/algorithm/ranges_minmax.md b/reference/algorithm/ranges_minmax.md index bd5c656a0f..96d0dacf66 100644 --- a/reference/algorithm/ranges_minmax.md +++ b/reference/algorithm/ranges_minmax.md @@ -34,15 +34,10 @@ namespace std::ranges { } ``` * minmax_result[link ranges_min_max_result.md] -* identity[link /reference/functional/identity.md] * indirect_strict_weak_order[link /reference/iterator/indirect_strict_weak_order.md] -* projected[link /reference/iterator/projected.md] * ranges::less[link /reference/functional/ranges_less.md] * initializer_list[link /reference/initializer_list/initializer_list.md] -* input_range[link /reference/ranges/input_range.md] * indirectly_copyable_storable[link /reference/iterator/indirectly_copyable_storable.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* range_value_t[link /reference/ranges/range_value_t.md] ## 概要 同じ型の2つの値、もしくは範囲によるN個の値のうち、最小値と最大値の組を取得する。 diff --git a/reference/algorithm/ranges_minmax_element.md b/reference/algorithm/ranges_minmax_element.md index 6a21cc38d4..e7e170459a 100644 --- a/reference/algorithm/ranges_minmax_element.md +++ b/reference/algorithm/ranges_minmax_element.md @@ -26,13 +26,8 @@ namespace std::ranges { } ``` * minmax_element_result[link ranges_min_max_result.md] -* forward_iterator[link /reference/iterator/forward_iterator.md] -* identity[link /reference/functional/identity.md] * indirect_strict_weak_order[link /reference/iterator/indirect_strict_weak_order.md] -* projected[link /reference/iterator/projected.md] * ranges::less[link /reference/functional/ranges_less.md] -* forward_range[link /reference/ranges/forward_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] diff --git a/reference/algorithm/ranges_mismatch.md b/reference/algorithm/ranges_mismatch.md index aaca10edee..f5aedb6f87 100644 --- a/reference/algorithm/ranges_mismatch.md +++ b/reference/algorithm/ranges_mismatch.md @@ -41,13 +41,6 @@ namespace std::ranges { } ``` * mismatch_result[link ranges_in_in_result.md] -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* ranges::equal_to[link /reference/functional/ranges_equal_to.md] -* identity[link /reference/functional/identity.md] -* indirectly_comparable[link /reference/iterator/indirectly_comparable.md] -* input_range[link /reference/ranges/input_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] @@ -146,13 +139,6 @@ struct mismatch_impl { inline constexpr mismatch_impl mismatch; ``` * mismatch_result[link ranges_in_in_result.md] -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* ranges::equal_to[link /reference/functional/ranges_equal_to.md] -* identity[link /reference/functional/identity.md] -* indirectly_comparable[link /reference/iterator/indirectly_comparable.md] -* input_range[link /reference/ranges/input_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] * invoke[link /reference/functional/invoke.md] * begin[link /reference/ranges/begin.md] diff --git a/reference/algorithm/ranges_move.md b/reference/algorithm/ranges_move.md index 0b75f515ce..08ab3cf3cd 100644 --- a/reference/algorithm/ranges_move.md +++ b/reference/algorithm/ranges_move.md @@ -24,12 +24,8 @@ namespace std::ranges { } ``` * move_result[link ranges_in_out_result.md] -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * weakly_incrementable[link /reference/iterator/weakly_incrementable.md] * indirectly_movable[link /reference/iterator/indirectly_movable.md] -* input_range[link /reference/ranges/input_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 diff --git a/reference/algorithm/ranges_move_backward.md b/reference/algorithm/ranges_move_backward.md index 6bf0da0be5..4e6ab8bb61 100644 --- a/reference/algorithm/ranges_move_backward.md +++ b/reference/algorithm/ranges_move_backward.md @@ -24,11 +24,7 @@ namespace std::ranges { } ``` * move_backward_result[link ranges_in_out_result.md] -* bidirectional_iterator[link /reference/iterator/bidirectional_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * indirectly_movable[link /reference/iterator/indirectly_movable.md] -* bidirectional_range[link /reference/ranges/bidirectional_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 diff --git a/reference/algorithm/ranges_next_permutation.md b/reference/algorithm/ranges_next_permutation.md index f06b19554a..0c18b0c5de 100644 --- a/reference/algorithm/ranges_next_permutation.md +++ b/reference/algorithm/ranges_next_permutation.md @@ -29,13 +29,8 @@ namespace std::ranges { } ``` * next_permutation_result[link ranges_in_found_result.md] -* bidirectional_iterator[link /reference/iterator/bidirectional_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * ranges::less[link /reference/functional/ranges_less.md] -* identity[link /reference/functional/identity.md] * sortable[link /reference/iterator/sortable.md] -* bidirectional_range[link /reference/ranges/bidirectional_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 diff --git a/reference/algorithm/ranges_none_of.md b/reference/algorithm/ranges_none_of.md index 997ced252d..6521578ba8 100644 --- a/reference/algorithm/ranges_none_of.md +++ b/reference/algorithm/ranges_none_of.md @@ -25,12 +25,6 @@ namespace std::ranges { Proj proj = {}); // (2) C++20 } ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* identity[link /reference/functional/identity.md] -* indirect_unary_predicate[link /reference/iterator/indirect_unary_predicate.md] -* input_range[link /reference/ranges/input_range.md] -* projected[link /reference/iterator/projected.md] ## 概要 範囲の全ての要素が条件を満たさないかを判定する。 @@ -113,13 +107,6 @@ struct none_of_impl { inline constexpr none_of_impl none_of; ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* identity[link /reference/functional/identity.md] -* indirect_unary_predicate[link /reference/iterator/indirect_unary_predicate.md] -* input_range[link /reference/ranges/input_range.md] -* projected[link /reference/iterator/projected.md] * invoke[link /reference/functional/invoke.md] * begin[link /reference/ranges/begin.md] * end[link /reference/ranges/end.md] diff --git a/reference/algorithm/ranges_nth_element.md b/reference/algorithm/ranges_nth_element.md index bcd69094bf..46e6a0f6e5 100644 --- a/reference/algorithm/ranges_nth_element.md +++ b/reference/algorithm/ranges_nth_element.md @@ -29,13 +29,8 @@ namespace std::ranges { Proj proj = {}); // (2) C++20 } ``` -* random_access_iterator[link /reference/iterator/random_access_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * ranges::less[link /reference/functional/ranges_less.md] -* identity[link /reference/functional/identity.md] * sortable[link /reference/iterator/sortable.md] -* random_access_range[link /reference/ranges/random_access_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] diff --git a/reference/algorithm/ranges_out_value_result.md b/reference/algorithm/ranges_out_value_result.md index d637e67538..38f020b144 100644 --- a/reference/algorithm/ranges_out_value_result.md +++ b/reference/algorithm/ranges_out_value_result.md @@ -31,7 +31,6 @@ namespace std::ranges { } ``` * no_unique_address[link /lang/cpp20/language_support_for_empty_objects.md] -* convertible_to[link /reference/concepts/convertible_to.md] * std::move[link /reference/utility/move.md] ## 概要 diff --git a/reference/algorithm/ranges_partial_sort.md b/reference/algorithm/ranges_partial_sort.md index cdd591a3f2..e5e6cfcb84 100644 --- a/reference/algorithm/ranges_partial_sort.md +++ b/reference/algorithm/ranges_partial_sort.md @@ -29,13 +29,8 @@ namespace std::ranges { Proj proj = {}); // (2) C++20 } ``` -* random_access_iterator[link /reference/iterator/random_access_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * ranges::less[link /reference/functional/ranges_less.md] -* identity[link /reference/functional/identity.md] * sortable[link /reference/iterator/sortable.md] -* random_access_range[link /reference/ranges/random_access_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] diff --git a/reference/algorithm/ranges_partial_sort_copy.md b/reference/algorithm/ranges_partial_sort_copy.md index 873c7d0261..538b68a6a0 100644 --- a/reference/algorithm/ranges_partial_sort_copy.md +++ b/reference/algorithm/ranges_partial_sort_copy.md @@ -45,18 +45,10 @@ namespace std::ranges { } ``` * partial_sort_copy_result[link ranges_in_out_result.md] -* input_iterator[link /reference/iterator/input_iterator.md] -* random_access_iterator[link /reference/iterator/random_access_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * ranges::less[link /reference/functional/ranges_less.md] -* identity[link /reference/functional/identity.md] * indirectly_copyable[link /reference/iterator/indirectly_copyable.md] * indirect_strict_weak_order[link /reference/iterator/indirect_strict_weak_order.md] -* projected[link /reference/iterator/projected.md] * sortable[link /reference/iterator/sortable.md] -* input_range[link /reference/ranges/input_range.md] -* random_access_range[link /reference/ranges/random_access_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 diff --git a/reference/algorithm/ranges_partition.md b/reference/algorithm/ranges_partition.md index 0a9b6ad028..6d73b817e1 100644 --- a/reference/algorithm/ranges_partition.md +++ b/reference/algorithm/ranges_partition.md @@ -27,14 +27,6 @@ namespace std::ranges { } ``` * permutable[link /reference/iterator/permutable.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* identity[link /reference/functional/identity.md] -* indirect_unary_predicate[link /reference/iterator/indirect_unary_predicate.md] -* projected[link /reference/iterator/projected.md] -* subrange[link /reference/ranges/subrange.md] -* forward_range[link /reference/ranges/forward_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* borrowed_subrange_t[link /reference/ranges/borrowed_subrange_t.md] ## 概要 与えられた範囲を条件によって[区分化](/reference/algorithm.md#sequence-is-partitioned)する。 diff --git a/reference/algorithm/ranges_partition_copy.md b/reference/algorithm/ranges_partition_copy.md index eee1911142..26ec256e38 100644 --- a/reference/algorithm/ranges_partition_copy.md +++ b/reference/algorithm/ranges_partition_copy.md @@ -35,16 +35,9 @@ namespace std::ranges { Proj proj = {}); // (2) C++20 } ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * weakly_incrementable[link /reference/iterator/weakly_incrementable.md] -* identity[link /reference/functional/identity.md] -* indirect_unary_predicate[link /reference/iterator/indirect_unary_predicate.md] -* projected[link /reference/iterator/projected.md] * indirectly_copyable[link /reference/iterator/indirectly_copyable.md] * partition_copy_result[link ranges_in_out_out_result.md] -* input_range[link /reference/ranges/input_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] diff --git a/reference/algorithm/ranges_partition_point.md b/reference/algorithm/ranges_partition_point.md index 5a9b01b8bd..58d7348916 100644 --- a/reference/algorithm/ranges_partition_point.md +++ b/reference/algorithm/ranges_partition_point.md @@ -25,13 +25,6 @@ namespace std::ranges { Proj proj = {}); // (2) C++20 } ``` -* forward_iterator[link /reference/iterator/forward_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* identity[link /reference/functional/identity.md] -* indirect_unary_predicate[link /reference/iterator/indirect_unary_predicate.md] -* projected[link /reference/iterator/projected.md] -* forward_range[link /reference/ranges/forward_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] diff --git a/reference/algorithm/ranges_pop_heap.md b/reference/algorithm/ranges_pop_heap.md index 4e77d31d2e..49fe90a00a 100644 --- a/reference/algorithm/ranges_pop_heap.md +++ b/reference/algorithm/ranges_pop_heap.md @@ -27,13 +27,8 @@ namespace std::ranges { Proj proj = {}); // (2) C++20 } ``` -* random_access_iterator[link /reference/iterator/random_access_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * ranges::less[link /reference/functional/ranges_less.md] -* identity[link /reference/functional/identity.md] * sortable[link /reference/iterator/sortable.md] -* random_access_range[link /reference/ranges/random_access_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 diff --git a/reference/algorithm/ranges_prev_permutation.md b/reference/algorithm/ranges_prev_permutation.md index 0f8dfb4eb2..05d947f3a0 100644 --- a/reference/algorithm/ranges_prev_permutation.md +++ b/reference/algorithm/ranges_prev_permutation.md @@ -28,13 +28,8 @@ namespace std::ranges { } ``` * prev_permutation_result[link ranges_in_found_result.md] -* bidirectional_iterator[link /reference/iterator/bidirectional_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * ranges::less[link /reference/functional/ranges_less.md] -* identity[link /reference/functional/identity.md] * sortable[link /reference/iterator/sortable.md] -* bidirectional_range[link /reference/ranges/bidirectional_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 diff --git a/reference/algorithm/ranges_push_heap.md b/reference/algorithm/ranges_push_heap.md index aed525d613..c1094f67b3 100644 --- a/reference/algorithm/ranges_push_heap.md +++ b/reference/algorithm/ranges_push_heap.md @@ -27,13 +27,8 @@ namespace std::ranges { Proj proj = {}); // (2) C++20 } ``` -* random_access_iterator[link /reference/iterator/random_access_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * ranges::less[link /reference/functional/ranges_less.md] -* identity[link /reference/functional/identity.md] * sortable[link /reference/iterator/sortable.md] -* random_access_range[link /reference/ranges/random_access_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 diff --git a/reference/algorithm/ranges_remove.md b/reference/algorithm/ranges_remove.md index 5a3564710e..046703e18a 100644 --- a/reference/algorithm/ranges_remove.md +++ b/reference/algorithm/ranges_remove.md @@ -56,15 +56,6 @@ namespace std::ranges { } ``` * permutable[link /reference/iterator/permutable.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* ranges::equal_to[link /reference/functional/ranges_equal_to.md] -* identity[link /reference/functional/identity.md] -* projected[link /reference/iterator/projected.md] -* indirect_binary_predicate[link /reference/iterator/indirect_binary_predicate.md] -* subrange[link /reference/ranges/subrange.md] -* borrowed_subrange_t[link /reference/ranges/borrowed_subrange_t.md] -* forward_range[link /reference/ranges/forward_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] ## 概要 指定された要素を取り除く。 diff --git a/reference/algorithm/ranges_remove_copy.md b/reference/algorithm/ranges_remove_copy.md index d47feda88f..5766aa8f0e 100644 --- a/reference/algorithm/ranges_remove_copy.md +++ b/reference/algorithm/ranges_remove_copy.md @@ -73,17 +73,9 @@ namespace std::ranges { Proj proj = {}); // (2) C++26 } ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * weakly_incrementable[link /reference/iterator/weakly_incrementable.md] * indirectly_copyable[link /reference/iterator/indirectly_copyable.md] -* ranges::equal_to[link /reference/functional/ranges_equal_to.md] -* identity[link /reference/functional/identity.md] -* projected[link /reference/iterator/projected.md] -* indirect_binary_predicate[link /reference/iterator/indirect_binary_predicate.md] * remove_copy_result[link ranges_in_out_result.md] -* input_range[link /reference/ranges/input_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 diff --git a/reference/algorithm/ranges_remove_copy_if.md b/reference/algorithm/ranges_remove_copy_if.md index eac3d9a063..810f918c20 100644 --- a/reference/algorithm/ranges_remove_copy_if.md +++ b/reference/algorithm/ranges_remove_copy_if.md @@ -31,16 +31,9 @@ namespace std::ranges { Proj proj = {}); // (2) C++20 } ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * weakly_incrementable[link /reference/iterator/weakly_incrementable.md] -* identity[link /reference/functional/identity.md] -* indirect_unary_predicate[link /reference/iterator/indirect_unary_predicate.md] -* projected[link /reference/iterator/projected.md] * indirectly_copyable[link /reference/iterator/indirectly_copyable.md] * remove_copy_if_result[link ranges_in_out_result.md] -* input_range[link /reference/ranges/input_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 diff --git a/reference/algorithm/ranges_remove_if.md b/reference/algorithm/ranges_remove_if.md index 494d0f6c24..5d3b31601c 100644 --- a/reference/algorithm/ranges_remove_if.md +++ b/reference/algorithm/ranges_remove_if.md @@ -27,14 +27,6 @@ namespace std::ranges { } ``` * permutable[link /reference/iterator/permutable.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* indirect_unary_predicate[link /reference/iterator/indirect_unary_predicate.md] -* identity[link /reference/functional/identity.md] -* projected[link /reference/iterator/projected.md] -* subrange[link /reference/ranges/subrange.md] -* borrowed_subrange_t[link /reference/ranges/borrowed_subrange_t.md] -* forward_range[link /reference/ranges/forward_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] ## 概要 diff --git a/reference/algorithm/ranges_replace.md b/reference/algorithm/ranges_replace.md index f83d97540a..9e208283a8 100644 --- a/reference/algorithm/ranges_replace.md +++ b/reference/algorithm/ranges_replace.md @@ -73,15 +73,7 @@ namespace std::ranges { Proj proj = {}); // (2) C++26 } ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* identity[link /reference/functional/identity.md] * indirectly_writable[link /reference/iterator/indirectly_writable.md] -* indirect_binary_predicate[link /reference/iterator/indirect_binary_predicate.md] -* ranges::equal_to[link /reference/functional/ranges_equal_to.md] -* projected[link /reference/iterator/projected.md] -* input_range[link /reference/ranges/input_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 diff --git a/reference/algorithm/ranges_replace_copy.md b/reference/algorithm/ranges_replace_copy.md index 9630d53bd8..a9ccb04432 100644 --- a/reference/algorithm/ranges_replace_copy.md +++ b/reference/algorithm/ranges_replace_copy.md @@ -83,17 +83,8 @@ namespace std::ranges { Proj proj = {}); // (2) C++26 } ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* output_iterator[link /reference/iterator/output_iterator.md] -* identity[link /reference/functional/identity.md] * indirectly_copyable[link /reference/iterator/indirectly_copyable.md] -* indirect_binary_predicate[link /reference/iterator/indirect_binary_predicate.md] -* ranges::equal_to[link /reference/functional/ranges_equal_to.md] -* projected[link /reference/iterator/projected.md] * replace_copy_result[link ranges_in_out_result.md] -* input_range[link /reference/ranges/input_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 diff --git a/reference/algorithm/ranges_replace_copy_if.md b/reference/algorithm/ranges_replace_copy_if.md index 1993964cd2..ef97b244c7 100644 --- a/reference/algorithm/ranges_replace_copy_if.md +++ b/reference/algorithm/ranges_replace_copy_if.md @@ -65,16 +65,8 @@ namespace std::ranges { Proj proj = {}); // (2) C++26 } ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* output_iterator[link /reference/iterator/output_iterator.md] -* identity[link /reference/functional/identity.md] * indirectly_copyable[link /reference/iterator/indirectly_copyable.md] -* indirect_unary_predicate[link /reference/iterator/indirect_binary_predicate.md] -* projected[link /reference/iterator/projected.md] * replace_copy_if_result[link ranges_in_out_result.md] -* input_range[link /reference/ranges/input_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 diff --git a/reference/algorithm/ranges_replace_if.md b/reference/algorithm/ranges_replace_if.md index 1534c562e7..21580be08c 100644 --- a/reference/algorithm/ranges_replace_if.md +++ b/reference/algorithm/ranges_replace_if.md @@ -31,14 +31,7 @@ namespace std::ranges { Proj proj = {}); // (2) C++20 } ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* identity[link /reference/functional/identity.md] * indirectly_writable[link /reference/iterator/indirectly_writable.md] -* indirect_unary_predicate[link /reference/iterator/indirect_unary_predicate.md] -* projected[link /reference/iterator/projected.md] -* input_range[link /reference/ranges/input_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 diff --git a/reference/algorithm/ranges_reverse.md b/reference/algorithm/ranges_reverse.md index 1a81f5f7bd..d144567a34 100644 --- a/reference/algorithm/ranges_reverse.md +++ b/reference/algorithm/ranges_reverse.md @@ -19,11 +19,7 @@ namespace std::ranges { reverse(R&& r); // (2) C++20 } ``` -* bidirectional_iterator[link /reference/iterator/bidirectional_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * permutable[link /reference/iterator/permutable.md] -* bidirectional_range[link /reference/ranges/bidirectional_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 diff --git a/reference/algorithm/ranges_reverse_copy.md b/reference/algorithm/ranges_reverse_copy.md index 45806f4426..40cffaef98 100644 --- a/reference/algorithm/ranges_reverse_copy.md +++ b/reference/algorithm/ranges_reverse_copy.md @@ -23,13 +23,9 @@ namespace std::ranges { O result); // (2) C++20 } ``` -* bidirectional_iterator[link /reference/iterator/bidirectional_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * weakly_incrementable[link /reference/iterator/weakly_incrementable.md] * indirectly_copyable[link /reference/iterator/indirectly_copyable.md] * reverse_copy_result[link ranges_in_out_result.md] -* bidirectional_range[link /reference/ranges/bidirectional_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 diff --git a/reference/algorithm/ranges_rotate.md b/reference/algorithm/ranges_rotate.md index 0aa974c479..a72fe1ebba 100644 --- a/reference/algorithm/ranges_rotate.md +++ b/reference/algorithm/ranges_rotate.md @@ -21,11 +21,6 @@ namespace std::ranges { } ``` * permutable[link /reference/iterator/permutable.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* subrange[link /reference/ranges/subrange.md] -* forward_range[link /reference/ranges/forward_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* borrowed_subrange_t[link /reference/ranges/borrowed_subrange_t.md] ## 概要 `middle`の要素が先頭、`middle-1`の要素が末尾となるように、`[first,last)`の要素の並びを回転させる。 diff --git a/reference/algorithm/ranges_rotate_copy.md b/reference/algorithm/ranges_rotate_copy.md index 4b3e048ef0..6e2aa01a10 100644 --- a/reference/algorithm/ranges_rotate_copy.md +++ b/reference/algorithm/ranges_rotate_copy.md @@ -25,12 +25,8 @@ namespace std::ranges { O result); // (2) C++20 } ``` -* forward_iterator[link /reference/iterator/forward_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * weakly_incrementable[link /reference/iterator/weakly_incrementable.md] * rotate_copy_result[link ranges_in_out_result.md] -* forward_range[link /reference/ranges/forward_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 diff --git a/reference/algorithm/ranges_sample.md b/reference/algorithm/ranges_sample.md index f357752436..c65b4077a7 100644 --- a/reference/algorithm/ranges_sample.md +++ b/reference/algorithm/ranges_sample.md @@ -34,16 +34,9 @@ namespace std::ranges { Gen&& g); // (2) C++20 } ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * weakly_incrementable[link /reference/iterator/weakly_incrementable.md] -* forward_iterator[link /reference/iterator/forward_iterator.md] -* random_access_iterator[link /reference/iterator/random_access_iterator.md] * indirectly_copyable[link /reference/iterator/indirectly_copyable.md] * uniform_random_bit_generator[link /reference/random/uniform_random_bit_generator.md] -* remove_reference_t[link /reference/type_traits/remove_reference.md] -* input_range[link /reference/ranges/input_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] ## 概要 範囲から指定された個数の要素をランダムに抽出する。 diff --git a/reference/algorithm/ranges_search.md b/reference/algorithm/ranges_search.md index f2bdf5183a..51a1b2d165 100644 --- a/reference/algorithm/ranges_search.md +++ b/reference/algorithm/ranges_search.md @@ -37,15 +37,6 @@ namespace std::ranges { Proj2 proj2 = {}); // (2) C++20 } ``` -* forward_iterator[link /reference/iterator/forward_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* ranges::equal_to[link /reference/functional/ranges_equal_to.md] -* identity[link /reference/functional/identity.md] -* indirectly_comparable[link /reference/iterator/indirectly_comparable.md] -* subrange[link /reference/ranges/subrange.md] -* forward_range[link /reference/ranges/forward_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* borrowed_subrange_t[link /reference/ranges/borrowed_subrange_t.md] ## 概要 あるシーケンスの中から、特定のサブシーケンスを探す @@ -120,15 +111,6 @@ struct search_impl { inline constexpr search_impl search; ``` -* forward_iterator[link /reference/iterator/forward_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* ranges::equal_to[link /reference/functional/ranges_equal_to.md] -* identity[link /reference/functional/identity.md] -* indirectly_comparable[link /reference/iterator/indirectly_comparable.md] -* subrange[link /reference/ranges/subrange.md] -* forward_range[link /reference/ranges/forward_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* borrowed_subrange_t[link /reference/ranges/borrowed_subrange_t.md] * invoke[link /reference/functional/invoke.md] * begin[link /reference/ranges/begin.md] * end[link /reference/ranges/end.md] diff --git a/reference/algorithm/ranges_search_n.md b/reference/algorithm/ranges_search_n.md index eef1aa2a11..52816a0f56 100644 --- a/reference/algorithm/ranges_search_n.md +++ b/reference/algorithm/ranges_search_n.md @@ -57,16 +57,6 @@ namespace std::ranges { Proj proj = {}); // (2) C++26 } ``` -* forward_iterator[link /reference/iterator/forward_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* ranges::equal_to[link /reference/functional/ranges_equal_to.md] -* identity[link /reference/functional/identity.md] -* indirectly_comparable[link /reference/iterator/indirectly_comparable.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] -* subrange[link /reference/ranges/subrange.md] -* forward_range[link /reference/ranges/forward_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* borrowed_subrange_t[link /reference/ranges/borrowed_subrange_t.md] ## 概要 @@ -204,16 +194,6 @@ struct search_n_impl { inline constexpr search_n_impl search_n; ``` -* forward_iterator[link /reference/iterator/forward_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* ranges::equal_to[link /reference/functional/ranges_equal_to.md] -* identity[link /reference/functional/identity.md] -* indirectly_comparable[link /reference/iterator/indirectly_comparable.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] -* subrange[link /reference/ranges/subrange.md] -* forward_range[link /reference/ranges/forward_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* borrowed_subrange_t[link /reference/ranges/borrowed_subrange_t.md] * invoke[link /reference/functional/invoke.md] * begin[link /reference/ranges/begin.md] * end[link /reference/ranges/end.md] diff --git a/reference/algorithm/ranges_set_difference.md b/reference/algorithm/ranges_set_difference.md index 1f2b357740..3cf8ab2d23 100644 --- a/reference/algorithm/ranges_set_difference.md +++ b/reference/algorithm/ranges_set_difference.md @@ -42,14 +42,9 @@ namespace std::ranges { } ``` * set_difference_result[link ranges_in_out_result.md] -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * weakly_incrementable[link /reference/iterator/weakly_incrementable.md] * ranges::less[link /reference/functional/ranges_less.md] -* identity[link /reference/functional/identity.md] * mergeable[link /reference/iterator/mergeable.md] -* input_range[link /reference/ranges/input_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] diff --git a/reference/algorithm/ranges_set_intersection.md b/reference/algorithm/ranges_set_intersection.md index 8949784d27..6ae748e665 100644 --- a/reference/algorithm/ranges_set_intersection.md +++ b/reference/algorithm/ranges_set_intersection.md @@ -46,14 +46,9 @@ namespace std::ranges { } ``` * set_intersection_result[link ranges_in_in_out_result.md] -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * weakly_incrementable[link /reference/iterator/weakly_incrementable.md] * ranges::less[link /reference/functional/ranges_less.md] -* identity[link /reference/functional/identity.md] * mergeable[link /reference/iterator/mergeable.md] -* input_range[link /reference/ranges/input_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 diff --git a/reference/algorithm/ranges_set_symmetric_difference.md b/reference/algorithm/ranges_set_symmetric_difference.md index 8d5d0c7794..b2c8fa3ce2 100644 --- a/reference/algorithm/ranges_set_symmetric_difference.md +++ b/reference/algorithm/ranges_set_symmetric_difference.md @@ -46,14 +46,9 @@ namespace std::ranges { } ``` * set_symmetric_difference_result[link ranges_in_in_out_result.md] -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * weakly_incrementable[link /reference/iterator/weakly_incrementable.md] * ranges::less[link /reference/functional/ranges_less.md] -* identity[link /reference/functional/identity.md] * mergeable[link /reference/iterator/mergeable.md] -* input_range[link /reference/ranges/input_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 diff --git a/reference/algorithm/ranges_set_union.md b/reference/algorithm/ranges_set_union.md index ad5526f312..e4f8a977f4 100644 --- a/reference/algorithm/ranges_set_union.md +++ b/reference/algorithm/ranges_set_union.md @@ -48,14 +48,9 @@ namespace std::ranges { } ``` * set_union_result[link ranges_in_in_out_result.md] -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * weakly_incrementable[link /reference/iterator/weakly_incrementable.md] * ranges::less[link /reference/functional/ranges_less.md] -* identity[link /reference/functional/identity.md] * mergeable[link /reference/iterator/mergeable.md] -* input_range[link /reference/ranges/input_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 diff --git a/reference/algorithm/ranges_shift_left.md b/reference/algorithm/ranges_shift_left.md index 3a5556dec0..73310893b3 100644 --- a/reference/algorithm/ranges_shift_left.md +++ b/reference/algorithm/ranges_shift_left.md @@ -21,13 +21,6 @@ namespace std::ranges { } ``` * permutable[link /reference/iterator/permutable.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* subrange[link /reference/ranges/subrange.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] -* forward_range[link /reference/ranges/forward_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* borrowed_subrange_t[link /reference/ranges/borrowed_subrange_t.md] -* range_difference_t[link /reference/ranges/range_difference_t.md] ## 概要 範囲の要素をn個だけ左にシフトさせる。 diff --git a/reference/algorithm/ranges_shift_right.md b/reference/algorithm/ranges_shift_right.md index 1a59d172c8..1d90e77d20 100644 --- a/reference/algorithm/ranges_shift_right.md +++ b/reference/algorithm/ranges_shift_right.md @@ -21,13 +21,6 @@ namespace std::ranges { } ``` * permutable[link /reference/iterator/permutable.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* subrange[link /reference/ranges/subrange.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] -* forward_range[link /reference/ranges/forward_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* borrowed_subrange_t[link /reference/ranges/borrowed_subrange_t.md] -* range_difference_t[link /reference/ranges/range_difference_t.md] ## 概要 diff --git a/reference/algorithm/ranges_shuffle.md b/reference/algorithm/ranges_shuffle.md index 5dcc8a46d4..84858db080 100644 --- a/reference/algorithm/ranges_shuffle.md +++ b/reference/algorithm/ranges_shuffle.md @@ -25,13 +25,8 @@ namespace std::ranges { Gen&& g); // (2) C++20 } ``` -* random_access_iterator[link /reference/iterator/random_access_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * permutable[link /reference/iterator/permutable.md] * uniform_random_bit_generator[link /reference/random/uniform_random_bit_generator.md] -* remove_reference_t[link /reference/type_traits/remove_reference.md] -* random_access_range[link /reference/ranges/random_access_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] diff --git a/reference/algorithm/ranges_sort.md b/reference/algorithm/ranges_sort.md index 1145a7faf7..95bb2f9017 100644 --- a/reference/algorithm/ranges_sort.md +++ b/reference/algorithm/ranges_sort.md @@ -27,13 +27,8 @@ namespace std::ranges { Proj proj = {}); // (2) C++20 } ``` -* random_access_iterator[link /reference/iterator/random_access_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * ranges::less[link /reference/functional/ranges_less.md] -* identity[link /reference/functional/identity.md] * sortable[link /reference/iterator/sortable.md] -* random_access_range[link /reference/ranges/random_access_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 diff --git a/reference/algorithm/ranges_sort_heap.md b/reference/algorithm/ranges_sort_heap.md index e0fa2480de..3f8ca25b37 100644 --- a/reference/algorithm/ranges_sort_heap.md +++ b/reference/algorithm/ranges_sort_heap.md @@ -27,13 +27,8 @@ namespace std::ranges { Proj proj = {}); // (2) C++20 } ``` -* random_access_iterator[link /reference/iterator/random_access_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * ranges::less[link /reference/functional/ranges_less.md] -* identity[link /reference/functional/identity.md] * sortable[link /reference/iterator/sortable.md] -* random_access_range[link /reference/ranges/random_access_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 diff --git a/reference/algorithm/ranges_stable_partition.md b/reference/algorithm/ranges_stable_partition.md index a15e99860d..872f5f7cc8 100644 --- a/reference/algorithm/ranges_stable_partition.md +++ b/reference/algorithm/ranges_stable_partition.md @@ -45,16 +45,7 @@ namespace std::ranges { Proj proj = {}); // (2) C++26 } ``` -* bidirectional_iterator[link /reference/iterator/bidirectional_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* identity[link /reference/functional/identity.md] -* indirect_unary_predicate[link /reference/iterator/indirect_unary_predicate.md] -* projected[link /reference/iterator/projected.md] * permutable[link /reference/iterator/permutable.md] -* subrange[link /reference/ranges/subrange.md] -* bidirectional_range[link /reference/ranges/bidirectional_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* borrowed_subrange_t[link /reference/ranges/borrowed_subrange_t.md] ## 概要 diff --git a/reference/algorithm/ranges_stable_sort.md b/reference/algorithm/ranges_stable_sort.md index bde206d5cd..8497fd89e3 100644 --- a/reference/algorithm/ranges_stable_sort.md +++ b/reference/algorithm/ranges_stable_sort.md @@ -45,13 +45,8 @@ namespace std::ranges { Proj proj = {}); // (2) C++26 } ``` -* random_access_iterator[link /reference/iterator/random_access_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * ranges::less[link /reference/functional/ranges_less.md] -* identity[link /reference/functional/identity.md] * sortable[link /reference/iterator/sortable.md] -* random_access_range[link /reference/ranges/random_access_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 diff --git a/reference/algorithm/ranges_starts_with.md b/reference/algorithm/ranges_starts_with.md index 77cb580de3..3dae90c875 100644 --- a/reference/algorithm/ranges_starts_with.md +++ b/reference/algorithm/ranges_starts_with.md @@ -37,13 +37,6 @@ namespace std::ranges { Proj2 proj2 = {}); // (2) C++23 } ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* ranges::equal_to[link /reference/functional/ranges_equal_to.md] -* identity[link /reference/functional/identity.md] -* indirectly_comparable[link /reference/iterator/indirectly_comparable.md] -* input_range[link /reference/ranges/input_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] ## 概要 @@ -102,13 +95,6 @@ struct starts_with_impl { inline constexpr starts_with_impl starts_with; ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* ranges::equal_to[link /reference/functional/ranges_equal_to.md] -* identity[link /reference/functional/identity.md] -* indirectly_comparable[link /reference/iterator/indirectly_comparable.md] -* input_range[link /reference/ranges/input_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * move[link /reference/utility/move.md] * mismatch[link ranges_mismatch.md] * begin[link /reference/ranges/begin.md] diff --git a/reference/algorithm/ranges_swap_ranges.md b/reference/algorithm/ranges_swap_ranges.md index fd7af8d928..0b17e98b7d 100644 --- a/reference/algorithm/ranges_swap_ranges.md +++ b/reference/algorithm/ranges_swap_ranges.md @@ -28,11 +28,6 @@ namespace std::ranges { } ``` * swap_ranges_result[link ranges_in_in_result.md] -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* indirectly_swappable[link /reference/iterator/indirectly_swappable.md] -* input_range[link /reference/ranges/input_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 diff --git a/reference/algorithm/ranges_transform.md b/reference/algorithm/ranges_transform.md index d01c459368..349d48de6e 100644 --- a/reference/algorithm/ranges_transform.md +++ b/reference/algorithm/ranges_transform.md @@ -82,16 +82,9 @@ namespace std::ranges { Proj2 proj2 = {}); // (4) C++20 } ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * weakly_incrementable[link /reference/iterator/weakly_incrementable.md] -* copy_constructible[link /reference/concepts/copy_constructible.md] -* identity[link /reference/functional/identity.md] * indirectly_writable[link /reference/iterator/indirectly_writable.md] * indirect_result_t[link /reference/iterator/indirect_result_t.md] -* projected[link /reference/iterator/projected.md] -* input_range[link /reference/ranges/input_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] * unary_transform_result[link ranges_in_out_result.md] * binary_transform_result[link ranges_in_in_out_result.md] diff --git a/reference/algorithm/ranges_unique.md b/reference/algorithm/ranges_unique.md index f2d53382fa..31f6880e65 100644 --- a/reference/algorithm/ranges_unique.md +++ b/reference/algorithm/ranges_unique.md @@ -27,14 +27,7 @@ namespace std::ranges { } ``` * permutable[link /reference/iterator/permutable.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* identity[link /reference/functional/identity.md] * indirect_equivalence_relation[link /reference/iterator/indirect_equivalence_relation.md] -* ranges::equal_to[link /reference/functional/ranges_equal_to.md] -* subrange[link /reference/ranges/subrange.md] -* forward_range[link /reference/ranges/forward_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* borrowed_subrange_t[link /reference/ranges/borrowed_subrange_t.md] ## 概要 diff --git a/reference/algorithm/ranges_unique_copy.md b/reference/algorithm/ranges_unique_copy.md index 64f65a1176..eb7d537938 100644 --- a/reference/algorithm/ranges_unique_copy.md +++ b/reference/algorithm/ranges_unique_copy.md @@ -39,20 +39,11 @@ namespace std::ranges { Proj proj = {}); // (2) C++20 } ``` -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * weakly_incrementable[link /reference/iterator/weakly_incrementable.md] -* identity[link /reference/functional/identity.md] * indirect_equivalence_relation[link /reference/iterator/indirect_equivalence_relation.md] * indirectly_copyable[link /reference/iterator/indirectly_copyable.md] -* forward_iterator[link /reference/iterator/forward_iterator.md] -* iter_value_t[link /reference/iterator/iter_value_t.md] * indirectly_copyable_storable[link /reference/iterator/indirectly_copyable_storable.md] -* projected[link /reference/iterator/projected.md] -* ranges::equal_to[link /reference/functional/ranges_equal_to.md] * unique_copy_result[link ranges_in_out_result.md] -* input_range[link /reference/ranges/input_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 diff --git a/reference/algorithm/ranges_upper_bound.md b/reference/algorithm/ranges_upper_bound.md index 22151d4dc5..3c00a337f8 100644 --- a/reference/algorithm/ranges_upper_bound.md +++ b/reference/algorithm/ranges_upper_bound.md @@ -61,14 +61,8 @@ namespace std::ranges { Proj proj = {}); // (2) C++26 } ``` -* forward_iterator[link /reference/iterator/forward_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * ranges::less[link /reference/functional/ranges_less.md] -* identity[link /reference/functional/identity.md] * indirect_strict_weak_order[link /reference/iterator/indirect_strict_weak_order.md] -* projected[link /reference/iterator/projected.md] -* forward_range[link /reference/ranges/forward_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 diff --git a/reference/algorithm/set_union.md b/reference/algorithm/set_union.md index b33c110636..981418c3b4 100644 --- a/reference/algorithm/set_union.md +++ b/reference/algorithm/set_union.md @@ -167,7 +167,6 @@ OutputIterator set_union(InputIterator1 first1, InputIterator1 last1, return std::set_union(first1, last1, first2, last2, result, less_inner()); } ``` -* std::copy[link copy.md] ## 参照 diff --git a/reference/algorithm/shift_left.md b/reference/algorithm/shift_left.md index 7cbae619af..b0c5e19e16 100644 --- a/reference/algorithm/shift_left.md +++ b/reference/algorithm/shift_left.md @@ -20,7 +20,6 @@ namespace std { typename iterator_traits::difference_type n); // (2) } ``` -* iterator_traits[link /reference/iterator/iterator_traits.md] ## 概要 イテレータ範囲`[first, last)`の要素をn個だけ左にシフトさせる。 diff --git a/reference/algorithm/shift_right.md b/reference/algorithm/shift_right.md index ec54813bac..c7f0d71d39 100644 --- a/reference/algorithm/shift_right.md +++ b/reference/algorithm/shift_right.md @@ -20,7 +20,6 @@ namespace std { typename iterator_traits::difference_type n); // (2) } ``` -* iterator_traits[link /reference/iterator/iterator_traits.md] ## 概要 イテレータ範囲`[first, last)`の要素をn個だけ右にシフトさせる。 diff --git a/reference/algorithm/shuffle.md b/reference/algorithm/shuffle.md index 571d40a63a..48d2b0fb9a 100644 --- a/reference/algorithm/shuffle.md +++ b/reference/algorithm/shuffle.md @@ -116,7 +116,6 @@ void shuffle(RandomAccessIterator first, RandomAccessIterator last, UniformRando iter_swap(it, first + d(g, param_type(0, it - first))); } ``` -* iterator_traits[link /reference/iterator/iterator_traits.md] * make_unsigned[link /reference/type_traits/make_unsigned.md] * uniform_int_distribution[link /reference/random/uniform_int_distribution.md] * iter_swap[link iter_swap.md] diff --git a/reference/algorithm/sort.md b/reference/algorithm/sort.md index f88eae8163..d06ec0b0a2 100644 --- a/reference/algorithm/sort.md +++ b/reference/algorithm/sort.md @@ -168,7 +168,6 @@ int main() { } ``` * std::sort[color ff0000] -* std::tie[link /reference/tuple/tie.md] #### 出力 ``` diff --git a/reference/any/any/emplace.md b/reference/any/any/emplace.md index e396637561..b208bc228a 100644 --- a/reference/any/any/emplace.md +++ b/reference/any/any/emplace.md @@ -13,7 +13,6 @@ template decay_t& emplace(std::initializer_list il, Args&&... args); // (2) ``` -* decay_t[link /reference/type_traits/decay.md] ## 概要 要素型のコンストラクタ引数から直接構築する。 diff --git a/reference/array/array/swap.md b/reference/array/array/swap.md index c99055d24e..726204c14b 100644 --- a/reference/array/array/swap.md +++ b/reference/array/array/swap.md @@ -12,7 +12,6 @@ void swap(array& other) constexpr void swap(array& other) noexcept(noexcept(swap(declval(), declval()))); // C++20 ``` -* declval[link /reference/utility/declval.md] ## 概要 自身と他の`array`オブジェクトの値を入れ替える diff --git a/reference/array/to_array.md b/reference/array/to_array.md index fd960f6958..27b5dfcf95 100644 --- a/reference/array/to_array.md +++ b/reference/array/to_array.md @@ -12,7 +12,6 @@ namespace std { constexpr array, N> to_array(T (&&a)[N]); // (2) } ``` -* remove_cv_t[link /reference/type_traits/remove_cv.md] ## 概要 組み込み 1 次元配列から、[`std::array`](array.md) を作成する。 diff --git a/reference/barrier/barrier/arrive.md b/reference/barrier/barrier/arrive.md index e98ab098ab..1cec2d5b48 100644 --- a/reference/barrier/barrier/arrive.md +++ b/reference/barrier/barrier/arrive.md @@ -96,7 +96,6 @@ int main() * wait[link wait.md] * arrive_and_wait[link arrive_and_wait.md] * std::move[link /reference/utility/move.md] -* std::this_thread::sleep_for[link /reference/thread/this_thread/sleep_for.md] ### 出力例 ``` diff --git a/reference/barrier/barrier/arrive_and_drop.md b/reference/barrier/barrier/arrive_and_drop.md index fefb63d5c6..76e7ad8471 100644 --- a/reference/barrier/barrier/arrive_and_drop.md +++ b/reference/barrier/barrier/arrive_and_drop.md @@ -95,7 +95,6 @@ int main() ``` * arrive_and_drop[color ff0000] * arrive_and_wait[link arrive_and_wait.md] -* std::this_thread::sleep_for[link /reference/thread/this_thread/sleep_for.md] ### 出力例 ``` diff --git a/reference/barrier/barrier/arrive_and_wait.md b/reference/barrier/barrier/arrive_and_wait.md index 93abaf94f4..40920a753f 100644 --- a/reference/barrier/barrier/arrive_and_wait.md +++ b/reference/barrier/barrier/arrive_and_wait.md @@ -76,7 +76,6 @@ int main() } ``` * arrive_and_wait[color ff0000] -* std::this_thread::sleep_for[link /reference/thread/this_thread/sleep_for.md] ### 出力例 ``` diff --git a/reference/barrier/barrier/wait.md b/reference/barrier/barrier/wait.md index 66905bb73a..b5fb5621d0 100644 --- a/reference/barrier/barrier/wait.md +++ b/reference/barrier/barrier/wait.md @@ -87,7 +87,6 @@ int main() * arrive[link arrive.md] * arrive_and_wait[link arrive_and_wait.md] * std::move[link /reference/utility/move.md] -* std::this_thread::sleep_for[link /reference/thread/this_thread/sleep_for.md] ### 出力例 ``` diff --git a/reference/bit/bit_cast.md b/reference/bit/bit_cast.md index 5ae118bcd3..1eaed44928 100644 --- a/reference/bit/bit_cast.md +++ b/reference/bit/bit_cast.md @@ -81,7 +81,6 @@ int main() } ``` * std::bit_cast[color ff0000] -* std::uint32_t[link /reference/cstdint/uint32_t.md] ### 出力 ``` diff --git a/reference/bit/countl_one.md b/reference/bit/countl_one.md index b17a7d96fb..0b22b7347b 100644 --- a/reference/bit/countl_one.md +++ b/reference/bit/countl_one.md @@ -51,7 +51,6 @@ int main() } ``` * std::countl_one[color ff0000] -* std::uint32_t[link /reference/cstdint/uint32_t.md] ### 出力 ``` diff --git a/reference/bit/countl_zero.md b/reference/bit/countl_zero.md index 47e4a29786..fc6dcf62f2 100644 --- a/reference/bit/countl_zero.md +++ b/reference/bit/countl_zero.md @@ -52,7 +52,6 @@ int main() } ``` * std::countl_zero[color ff0000] -* std::uint32_t[link /reference/cstdint/uint32_t.md] ### 出力 ``` diff --git a/reference/bit/countr_one.md b/reference/bit/countr_one.md index 971e37e200..6ed752c7cf 100644 --- a/reference/bit/countr_one.md +++ b/reference/bit/countr_one.md @@ -47,7 +47,6 @@ int main() } ``` * std::countr_one[color ff0000] -* std::uint32_t[link /reference/cstdint/uint32_t.md] ### 出力 ``` diff --git a/reference/bit/countr_zero.md b/reference/bit/countr_zero.md index 13b86d0e07..7924781009 100644 --- a/reference/bit/countr_zero.md +++ b/reference/bit/countr_zero.md @@ -52,7 +52,6 @@ int main() } ``` * std::countr_zero[color ff0000] -* std::uint32_t[link /reference/cstdint/uint32_t.md] ### 出力 ``` diff --git a/reference/bit/popcount.md b/reference/bit/popcount.md index 70f7338879..0b667ffd95 100644 --- a/reference/bit/popcount.md +++ b/reference/bit/popcount.md @@ -53,7 +53,6 @@ int main() } ``` * std::popcount[color ff0000] -* std::uint32_t[link /reference/cstdint/uint32_t.md] ### 出力 ``` diff --git a/reference/bit/rotl.md b/reference/bit/rotl.md index 058f16faef..f7f24e52f5 100644 --- a/reference/bit/rotl.md +++ b/reference/bit/rotl.md @@ -57,7 +57,6 @@ int main() } ``` * std::rotl[color ff0000] -* std::uint32_t[link /reference/cstdint/uint32_t.md] ### 出力 ``` diff --git a/reference/bit/rotr.md b/reference/bit/rotr.md index 64df7741bd..65dc6100c0 100644 --- a/reference/bit/rotr.md +++ b/reference/bit/rotr.md @@ -57,7 +57,6 @@ int main() } ``` * std::rotr[color ff0000] -* std::uint32_t[link /reference/cstdint/uint32_t.md] ### 出力 ``` diff --git a/reference/bitset/bitset/count.md b/reference/bitset/bitset/count.md index 2a4e8ff6a6..94be6ffa56 100644 --- a/reference/bitset/bitset/count.md +++ b/reference/bitset/bitset/count.md @@ -58,7 +58,6 @@ int main() } } ``` -* std::uint32_t[link /reference/cstdint/uint32_t.md] #### 出力 ``` diff --git a/reference/charconv/from_chars.md b/reference/charconv/from_chars.md index 352832016a..065dd96b10 100644 --- a/reference/charconv/from_chars.md +++ b/reference/charconv/from_chars.md @@ -492,8 +492,6 @@ int main() { } ``` * std::from_chars[color ff0000] -* contiguous_range[link /reference/ranges/contiguous_range.md] -* range_value_t[link /reference/ranges/range_value_t.md] * begin[link /reference/ranges/begin.md] * end[link /reference/ranges/end.md] * to_address[link /reference/memory/to_address.md] diff --git a/reference/chrono/clock_time_conversion.md b/reference/chrono/clock_time_conversion.md index 397054b412..f2c9aada11 100644 --- a/reference/chrono/clock_time_conversion.md +++ b/reference/chrono/clock_time_conversion.md @@ -87,7 +87,6 @@ namespace std::chrono { * sys_time[link sys_time.md] * utc_clock[link utc_clock.md] * utc_time[link utc_time.md] -* common_type_t[link common_type.md] * time_point[link time_point.md] ## 概要 diff --git a/reference/chrono/duration/op_compare_3way.md b/reference/chrono/duration/op_compare_3way.md index 8695ca874f..831791ac5d 100644 --- a/reference/chrono/duration/op_compare_3way.md +++ b/reference/chrono/duration/op_compare_3way.md @@ -18,7 +18,6 @@ namespace std::chrono { const duration& rhs); // (1) C++20 } ``` -* common_type_t[link /reference/chrono/common_type.md] ## 概要 三方比較を行う diff --git a/reference/chrono/duration/op_ostream.md b/reference/chrono/duration/op_ostream.md index 759979ee9f..a6922b9fcd 100644 --- a/reference/chrono/duration/op_ostream.md +++ b/reference/chrono/duration/op_ostream.md @@ -99,7 +99,6 @@ int main() std::cout << "float sec : " << float_seconds{1.23f} << std::endl; } ``` -* chrono::weeks[link /reference/chrono/duration_aliases.md] * std::ratio[link /reference/ratio/ratio.md] ### 出力 diff --git a/reference/chrono/duration/op_unary_minus.md b/reference/chrono/duration/op_unary_minus.md index dcc5ff4669..4bdf26a960 100644 --- a/reference/chrono/duration/op_unary_minus.md +++ b/reference/chrono/duration/op_unary_minus.md @@ -8,7 +8,6 @@ ```cpp constexpr common_type_t operator-() const; ``` -* common_type_t[link /reference/chrono/common_type.md] ## 概要 負の符号。 diff --git a/reference/chrono/duration/op_unary_plus.md b/reference/chrono/duration/op_unary_plus.md index 989edfe59e..710e4205a1 100644 --- a/reference/chrono/duration/op_unary_plus.md +++ b/reference/chrono/duration/op_unary_plus.md @@ -8,7 +8,6 @@ ```cpp constexpr common_type_t operator+() const; ``` -* common_type_t[link /reference/chrono/common_type.md] ## 概要 正の符号。 diff --git a/reference/chrono/duration/op_us.md b/reference/chrono/duration/op_us.md index 35b6afb335..360b564900 100644 --- a/reference/chrono/duration/op_us.md +++ b/reference/chrono/duration/op_us.md @@ -22,7 +22,6 @@ using namespace literals::chrono_literals; } // namespace std ``` -* chrono::microseconds[link /reference/chrono/duration_aliases.md] * micro[link /reference/ratio/si_prefix.md] * unspecified[italic] diff --git a/reference/chrono/gps_clock/from_utc.md b/reference/chrono/gps_clock/from_utc.md index 472cec2792..9580e8f392 100644 --- a/reference/chrono/gps_clock/from_utc.md +++ b/reference/chrono/gps_clock/from_utc.md @@ -12,7 +12,6 @@ static gps_time> ``` * gps_time[link /reference/chrono/gps_time.md] * utc_time[link /reference/chrono/utc_time.md] -* common_type_t[link /reference/chrono/common_type.md] ## 概要 UTC時間からGPS時間に変換する。 @@ -23,7 +22,6 @@ UTC時間からGPS時間に変換する。 return gps_time>{t.time_since_epoch()} - 315964809s; ``` * gps_time[link /reference/chrono/gps_time.md] -* common_type_t[link /reference/chrono/common_type.md] * t.time_since_epoch()[link /reference/chrono/time_point/time_since_epoch.md] * 315964809s[link /reference/chrono/duration/op_s.md] diff --git a/reference/chrono/gps_clock/to_utc.md b/reference/chrono/gps_clock/to_utc.md index 1bc92cf475..34f9ec8a79 100644 --- a/reference/chrono/gps_clock/to_utc.md +++ b/reference/chrono/gps_clock/to_utc.md @@ -12,7 +12,6 @@ static utc_time> ``` * gps_time[link /reference/chrono/gps_time.md] * utc_time[link /reference/chrono/utc_time.md] -* common_type_t[link /reference/chrono/common_type.md] ## 概要 GPS時間からUTC時間に変換する。 @@ -23,7 +22,6 @@ GPS時間からUTC時間に変換する。 return utc_time>{t.time_since_epoch()} + 315964809s; ``` * utc_time[link /reference/chrono/utc_time.md] -* common_type_t[link /reference/chrono/common_type.md] * t.time_since_epoch()[link /reference/chrono/time_point/time_since_epoch.md] * 315964809s[link /reference/chrono/duration/op_s.md] diff --git a/reference/chrono/hh_mm_ss/fractional_width.md b/reference/chrono/hh_mm_ss/fractional_width.md index 3c759082e8..3fa1aa56f3 100644 --- a/reference/chrono/hh_mm_ss/fractional_width.md +++ b/reference/chrono/hh_mm_ss/fractional_width.md @@ -60,7 +60,6 @@ int main() { ``` * 1ms[link /reference/chrono/duration/op_ms.md] * 1ns[link /reference/chrono/duration/op_ns.md] -* chrono::duration[link /reference/chrono/duration.md] * std::ratio[link /reference/ratio/ratio.md] ### 出力 diff --git a/reference/chrono/high_resolution_clock.md b/reference/chrono/high_resolution_clock.md index fe75819f35..7fbe9e92e2 100644 --- a/reference/chrono/high_resolution_clock.md +++ b/reference/chrono/high_resolution_clock.md @@ -68,7 +68,6 @@ int main() } ``` * now()[link high_resolution_clock/now.md] -* std::this_thread::sleep_for[link /reference/thread/this_thread/sleep_for.md] * count()[link duration/count.md] ### 出力例 diff --git a/reference/chrono/leap_second/op_compare_3way.md b/reference/chrono/leap_second/op_compare_3way.md index 393e3634f2..f801129a89 100644 --- a/reference/chrono/leap_second/op_compare_3way.md +++ b/reference/chrono/leap_second/op_compare_3way.md @@ -15,7 +15,6 @@ namespace std::chrono { operator<=>(const leap_second& x, const sys_time& y) noexcept; // (2) C++20 } ``` -* three_way_comparable_with[link /reference/compare/three_way_comparable.md] * sys_seconds[link /reference/chrono/sys_time.md] * sys_time[link /reference/chrono/sys_time.md] diff --git a/reference/chrono/steady_clock.md b/reference/chrono/steady_clock.md index b8dbeed13c..6852946713 100644 --- a/reference/chrono/steady_clock.md +++ b/reference/chrono/steady_clock.md @@ -73,7 +73,6 @@ int main() } ``` * now()[link steady_clock/now.md] -* std::this_thread::sleep_for[link /reference/thread/this_thread/sleep_for.md] * count()[link duration/count.md] ### 出力例 diff --git a/reference/chrono/sys_time.md b/reference/chrono/sys_time.md index c7d9a214fa..002c44c81f 100644 --- a/reference/chrono/sys_time.md +++ b/reference/chrono/sys_time.md @@ -65,7 +65,6 @@ namespace std { year_month_day{dp}, hh_mm_ss{tp - dp}); ``` * floor[link time_point/floor.md] - * days[link duration_aliases.md] * format[link /reference/format/format.md] * os.getloc()[link /reference/ios/ios_base/getloc.md] * year_month_day[link year_month_day.md] diff --git a/reference/chrono/tai_clock/from_utc.md b/reference/chrono/tai_clock/from_utc.md index 2422493956..a0409a4998 100644 --- a/reference/chrono/tai_clock/from_utc.md +++ b/reference/chrono/tai_clock/from_utc.md @@ -12,7 +12,6 @@ static tai_time> ``` * tai_time[link /reference/chrono/tai_time.md] * utc_time[link /reference/chrono/utc_time.md] -* common_type_t[link /reference/chrono/common_type.md] ## 概要 UTC時間からTAI時間に変換する。 @@ -23,7 +22,6 @@ UTC時間からTAI時間に変換する。 return tai_time>{t.time_since_epoch()} + 378691210s; ``` * tai_time[link /reference/chrono/tai_time.md] -* common_type_t[link /reference/chrono/common_type.md] * t.time_since_epoch()[link /reference/chrono/time_point/time_since_epoch.md] * 378691210s[link /reference/chrono/duration/op_s.md] diff --git a/reference/chrono/tai_clock/to_utc.md b/reference/chrono/tai_clock/to_utc.md index 7a92545660..55ef1c4236 100644 --- a/reference/chrono/tai_clock/to_utc.md +++ b/reference/chrono/tai_clock/to_utc.md @@ -12,7 +12,6 @@ static utc_time> ``` * tai_time[link /reference/chrono/tai_time.md] * utc_time[link /reference/chrono/utc_time.md] -* common_type_t[link /reference/chrono/common_type.md] ## 概要 TAI時間からUTC時間に変換する。 @@ -23,7 +22,6 @@ TAI時間からUTC時間に変換する。 return utc_time>{t.time_since_epoch()} - 378691210s; ``` * utc_time[link /reference/chrono/utc_time.md] -* common_type_t[link /reference/chrono/common_type.md] * t.time_since_epoch()[link /reference/chrono/time_point/time_since_epoch.md] * 378691210s[link /reference/chrono/duration/op_s.md] diff --git a/reference/chrono/time_zone/to_local.md b/reference/chrono/time_zone/to_local.md index 24301c0a26..c641d20005 100644 --- a/reference/chrono/time_zone/to_local.md +++ b/reference/chrono/time_zone/to_local.md @@ -12,7 +12,6 @@ local_time> ``` * sys_time[link /reference/chrono/sys_time.md] * local_time[link /reference/chrono/local_time.md] -* common_type_t[link /reference/chrono/common_type.md] ## 概要 システム時間からローカル時間に変換する。 diff --git a/reference/chrono/time_zone/to_sys.md b/reference/chrono/time_zone/to_sys.md index f5fa214333..b0cde3de54 100644 --- a/reference/chrono/time_zone/to_sys.md +++ b/reference/chrono/time_zone/to_sys.md @@ -16,7 +16,6 @@ sys_time> ``` * sys_time[link /reference/chrono/sys_time.md] * local_time[link /reference/chrono/local_time.md] -* common_type_t[link /reference/chrono/common_type.md] * choose[link /reference/chrono/choose.md] ## 概要 diff --git a/reference/chrono/treat_as_floating_point.md b/reference/chrono/treat_as_floating_point.md index 66cbcf9f60..f0823db47f 100644 --- a/reference/chrono/treat_as_floating_point.md +++ b/reference/chrono/treat_as_floating_point.md @@ -47,7 +47,6 @@ int main() } ``` * treat_as_floating_point[color ff0000] -* duration[link duration.md] * std::ratio[link /reference/ratio/ratio.md] ### 出力 diff --git a/reference/chrono/tzdb_list/begin.md b/reference/chrono/tzdb_list/begin.md index 79daafb07e..45ef0682a3 100644 --- a/reference/chrono/tzdb_list/begin.md +++ b/reference/chrono/tzdb_list/begin.md @@ -43,7 +43,6 @@ int main() * begin()[color ff0000] * ls.end()[link end.md] * chrono::get_tzdb_list()[link /reference/chrono/get_tzdb_list.md] -* std::distance[link /reference/iterator/distance.md] * chrono::tzdb[link /reference/chrono/tzdb.md] ### 出力例 diff --git a/reference/chrono/tzdb_list/cbegin.md b/reference/chrono/tzdb_list/cbegin.md index 4a3ef347ea..3c5959d6a5 100644 --- a/reference/chrono/tzdb_list/cbegin.md +++ b/reference/chrono/tzdb_list/cbegin.md @@ -46,7 +46,6 @@ int main() * cbegin()[color ff0000] * ls.cend()[link cend.md] * chrono::get_tzdb_list()[link /reference/chrono/get_tzdb_list.md] -* std::distance[link /reference/iterator/distance.md] * chrono::tzdb[link /reference/chrono/tzdb.md] ### 出力例 diff --git a/reference/chrono/tzdb_list/cend.md b/reference/chrono/tzdb_list/cend.md index e5048d11e9..f7360ac317 100644 --- a/reference/chrono/tzdb_list/cend.md +++ b/reference/chrono/tzdb_list/cend.md @@ -46,7 +46,6 @@ int main() * cend()[color ff0000] * ls.cbegin()[link cbegin.md] * chrono::get_tzdb_list()[link /reference/chrono/get_tzdb_list.md] -* std::distance[link /reference/iterator/distance.md] * chrono::tzdb[link /reference/chrono/tzdb.md] ### 出力例 diff --git a/reference/chrono/tzdb_list/end.md b/reference/chrono/tzdb_list/end.md index 2ae522af83..043241211f 100644 --- a/reference/chrono/tzdb_list/end.md +++ b/reference/chrono/tzdb_list/end.md @@ -43,7 +43,6 @@ int main() * end()[color ff0000] * ls.begin()[link begin.md] * chrono::get_tzdb_list()[link /reference/chrono/get_tzdb_list.md] -* std::distance[link /reference/iterator/distance.md] * chrono::tzdb[link /reference/chrono/tzdb.md] ### 出力例 diff --git a/reference/chrono/utc_clock/from_sys.md b/reference/chrono/utc_clock/from_sys.md index 0616566200..eb7d6de106 100644 --- a/reference/chrono/utc_clock/from_sys.md +++ b/reference/chrono/utc_clock/from_sys.md @@ -12,7 +12,6 @@ static utc_time> ``` * utc_time[link /reference/chrono/utc_time.md] * sys_time[link /reference/chrono/sys_time.md] -* common_type_t[link /reference/chrono/common_type.md] ## 概要 システム時間からUTC時間に変換する。 diff --git a/reference/chrono/utc_clock/to_sys.md b/reference/chrono/utc_clock/to_sys.md index 812678a093..804eebafea 100644 --- a/reference/chrono/utc_clock/to_sys.md +++ b/reference/chrono/utc_clock/to_sys.md @@ -12,7 +12,6 @@ static sys_time> ``` * sys_time[link /reference/chrono/sys_time.md] * utc_time[link /reference/chrono/utc_time.md] -* common_type_t[link /reference/chrono/common_type.md] ## 概要 UTC時間からシステム時間に変換する。 diff --git a/reference/chrono/zoned_time/op_constructor.md b/reference/chrono/zoned_time/op_constructor.md index a20d0623d2..fbb834025b 100644 --- a/reference/chrono/zoned_time/op_constructor.md +++ b/reference/chrono/zoned_time/op_constructor.md @@ -44,7 +44,6 @@ zoned_time(string_view name, ``` * sys_time[link /reference/chrono/sys_time.md] * local_time[link /reference/chrono/local_time.md] -* string_view[link /reference/string_view/basic_string_view.md] * choose[link /reference/chrono/choose.md] ## 概要 diff --git a/reference/chrono/zoned_time/op_deduction_guide.md b/reference/chrono/zoned_time/op_deduction_guide.md index a018a50853..8bebe82400 100644 --- a/reference/chrono/zoned_time/op_deduction_guide.md +++ b/reference/chrono/zoned_time/op_deduction_guide.md @@ -46,10 +46,8 @@ namespace std::chrono { } ``` * sys_time[link /reference/chrono/sys_time.md] -* common_type_t[link /reference/chrono/common_type.md] * local_time[link /reference/chrono/local_time.md] * choose[link /reference/chrono/choose.md] -* string_view[link /reference/string_view/basic_string_view.md] * conditional_t[link /reference/type_traits/conditional.md] * is_convertible[link /reference/type_traits/is_convertible.md] * time_zone[link /reference/chrono/time_zone.md] diff --git a/reference/chrono/zoned_traits/locate_zone.md b/reference/chrono/zoned_traits/locate_zone.md index 862bab765c..133a9f520f 100644 --- a/reference/chrono/zoned_traits/locate_zone.md +++ b/reference/chrono/zoned_traits/locate_zone.md @@ -9,7 +9,6 @@ static const time_zone* locate_zone(string_view name); // (1) C++20 ``` * time_zone[link /reference/chrono/time_zone.md] -* string_view[link /reference/string_view/basic_string_view.md] ## 概要 タイムゾーン名を指定してタイムゾーンを取得する。 diff --git a/reference/cmath/hypot.md b/reference/cmath/hypot.md index 70b9e8c111..4490e5bc73 100644 --- a/reference/cmath/hypot.md +++ b/reference/cmath/hypot.md @@ -153,7 +153,6 @@ int main() { ``` * std::fixed[link ../ios/fixed.md] * std::hypot[color ff0000] -* std::numeric_limits[link ../limits/numeric_limits.md] * infinity[link ../limits/numeric_limits/infinity.md] * quiet_NaN[link ../limits/numeric_limits/quiet_nan.md] diff --git a/reference/cmath/log10.md b/reference/cmath/log10.md index af742ee0b1..1e268e85ee 100644 --- a/reference/cmath/log10.md +++ b/reference/cmath/log10.md @@ -79,7 +79,6 @@ int main() { ``` * std::log10[color ff0000] * std::fixed[link ../ios/fixed.md] -* std::numeric_limits[link ../limits/numeric_limits.md] * infinity[link ../limits/numeric_limits/infinity.md] #### 出力例 diff --git a/reference/cmath/nanf.md b/reference/cmath/nanf.md index 8b3ed826f6..3c0f84ff7c 100644 --- a/reference/cmath/nanf.md +++ b/reference/cmath/nanf.md @@ -53,7 +53,6 @@ int main() } ``` * std::nan[color ff0000] -* std::uint64_t[link /reference/cstdint/uint64_t.md] * std::memcpy[link /reference/cstring/memcpy.md.nolink] * std::hex[link /reference/ios/hex.md] diff --git a/reference/codecvt/codecvt_utf16.md b/reference/codecvt/codecvt_utf16.md index 7af7ffb713..eca7d29043 100644 --- a/reference/codecvt/codecvt_utf16.md +++ b/reference/codecvt/codecvt_utf16.md @@ -65,8 +65,6 @@ int main() ``` * std::codecvt_utf16[color ff0000] * std::wstring_convert[link ../locale/wstring_convert.md] -* std::u32string[link ../string/basic_string.md] -* std::string[link ../string/basic_string.md] * u16str.size()[link ../string/basic_string/size.md] * u16str[0][link ../string/basic_string/op_at.md] * u16str[1][link ../string/basic_string/op_at.md] diff --git a/reference/codecvt/codecvt_utf8.md b/reference/codecvt/codecvt_utf8.md index fc29491f38..d993a9dc15 100644 --- a/reference/codecvt/codecvt_utf8.md +++ b/reference/codecvt/codecvt_utf8.md @@ -65,8 +65,6 @@ int main() ``` * std::codecvt_utf8[color ff0000] * std::wstring_convert[link ../locale/wstring_convert.md] -* std::u32string[link ../string/basic_string.md] -* std::string[link ../string/basic_string.md] * u8str.size()[link ../string/basic_string/size.md] * u8str[0][link ../string/basic_string/op_at.md] * u8str[1][link ../string/basic_string/op_at.md] diff --git a/reference/codecvt/codecvt_utf8_utf16.md b/reference/codecvt/codecvt_utf8_utf16.md index ed3c5387f7..b67766ec88 100644 --- a/reference/codecvt/codecvt_utf8_utf16.md +++ b/reference/codecvt/codecvt_utf8_utf16.md @@ -66,8 +66,6 @@ int main() ``` * std::codecvt_utf8_utf16[color ff0000] * std::wstring_convert[link ../locale/wstring_convert.md] -* std::u16string[link ../string/basic_string.md] -* std::string[link ../string/basic_string.md] * u8str.size()[link ../string/basic_string/size.md] * u8str[0][link ../string/basic_string/op_at.md] * u8str[1][link ../string/basic_string/op_at.md] diff --git a/reference/compare/compare_three_way.md b/reference/compare/compare_three_way.md index 58978f4c7f..77f2ae9094 100644 --- a/reference/compare/compare_three_way.md +++ b/reference/compare/compare_three_way.md @@ -15,7 +15,6 @@ struct compare_three_way { using is_transparent = /*unspecified*/; }; ``` -* three_way_comparable_with[link /reference/compare/three_way_comparable.md] ## 概要 diff --git a/reference/compare/compare_three_way/op_call.md b/reference/compare/compare_three_way/op_call.md index a4e1e061b5..d223cc3e68 100644 --- a/reference/compare/compare_three_way/op_call.md +++ b/reference/compare/compare_three_way/op_call.md @@ -10,7 +10,6 @@ template requires three_way_comparable_with || BUILTIN-PTR-THREE-WAY(T, U) constexpr auto operator()(T&& t, U&& u) const; ``` -* three_way_comparable_with[link /reference/compare/three_way_comparable.md] ## 概要 diff --git a/reference/compare/three_way_comparable.md b/reference/compare/three_way_comparable.md index bd25f06c34..484bbd9ee1 100644 --- a/reference/compare/three_way_comparable.md +++ b/reference/compare/three_way_comparable.md @@ -43,7 +43,6 @@ concept partially-ordered-with = }; ``` * common_comparison_category_t[link /reference/compare/common_comparison_category.md] -* remove_reference_t[link /reference/type_traits/remove_reference.md] * boolean-testable[link /reference/concepts/boolean-testable.md] - (1) : 以下のように定義される。 @@ -59,7 +58,6 @@ concept three_way_comparable = ``` * partial_ordering[link /reference/compare/partial_ordering.md] * weakly-equality-comparable-with[link /reference/concepts/equality_comparable.md] -* remove_reference_t[link /reference/type_traits/remove_reference.md] - (2) : 以下のように定義される。 @@ -80,9 +78,6 @@ concept three_way_comparable_with = ``` * partial_ordering[link /reference/compare/partial_ordering.md] * weakly-equality-comparable-with[link /reference/concepts/equality_comparable.md] -* remove_reference_t[link /reference/type_traits/remove_reference.md] -* common_reference_with[link /reference/concepts/common_reference_with.md] -* common_reference_t[link /reference/type_traits/common_reference.md] ## モデル diff --git a/reference/concepts/assignable_from.md b/reference/concepts/assignable_from.md index 33ed68acef..571b8fcae2 100644 --- a/reference/concepts/assignable_from.md +++ b/reference/concepts/assignable_from.md @@ -16,8 +16,6 @@ namespace std { } ``` * is_lvalue_reference_v[link /reference/type_traits/is_lvalue_reference.md] -* remove_reference_t[link /reference/type_traits/remove_reference.md] -* common_reference_with[link common_reference_with.md] ## 概要 diff --git a/reference/concepts/boolean-testable.md b/reference/concepts/boolean-testable.md index 8b8a13df77..35ec8b320f 100644 --- a/reference/concepts/boolean-testable.md +++ b/reference/concepts/boolean-testable.md @@ -26,7 +26,6 @@ namespace std { template concept boolean-testable-impl = convertible_to; ``` -* convertible_to[link /reference/concepts/convertible_to.md] これを用いて、`boolean-testable`は以下の様に定義される。 @@ -85,8 +84,6 @@ namespace std { } ``` * movable[link /reference/concepts/movable.md] -* convertible_to[link /reference/concepts/convertible_to.md] -* remove_reference_t[link /reference/type_traits/remove_reference.md] この`boolean`コンセプトは14個の制約式によって定義されている。これらは真理値式をなるべく正しく表現するために議論の経過と共に追加されていったものだが、これによって以下の様な問題が発生していた。 diff --git a/reference/concepts/common_reference_with.md b/reference/concepts/common_reference_with.md index a601ac68f0..b34c5de45a 100644 --- a/reference/concepts/common_reference_with.md +++ b/reference/concepts/common_reference_with.md @@ -13,8 +13,6 @@ namespace std { convertible_to>; } ``` -* convertible_to[link /reference/concepts/convertible_to.md] -* common_reference_t[link /reference/type_traits/common_reference.md] ## 概要 diff --git a/reference/concepts/common_with.md b/reference/concepts/common_with.md index 2fa4efb7de..db53e531c0 100644 --- a/reference/concepts/common_with.md +++ b/reference/concepts/common_with.md @@ -23,10 +23,7 @@ namespace std { add_lvalue_reference_t>>; } ``` -* common_type_t[link /reference/type_traits/common_type.md] * add_lvalue_reference_t[link /reference/type_traits/add_lvalue_reference.md] -* common_reference_with[link /reference/concepts/common_reference_with.md] -* common_reference_t[link /reference/type_traits/common_reference.md] ## 概要 diff --git a/reference/concepts/copy_constructible.md b/reference/concepts/copy_constructible.md index 1c7268d421..a6156f0a2a 100644 --- a/reference/concepts/copy_constructible.md +++ b/reference/concepts/copy_constructible.md @@ -14,9 +14,7 @@ namespace std { constructible_from && convertible_to; } ``` -* move_constructible[link /reference/concepts/move_constructible.md] * constructible_from[link /reference/concepts/constructible_from.md] -* convertible_to[link /reference/concepts/convertible_to.md] ## 概要 diff --git a/reference/concepts/copyable.md b/reference/concepts/copyable.md index efb5d4c63b..eed875cb2a 100644 --- a/reference/concepts/copyable.md +++ b/reference/concepts/copyable.md @@ -16,7 +16,6 @@ namespace std { } ``` * assignable_from[link /reference/concepts/assignable_from.md] -* copy_constructible[link /reference/concepts/copy_constructible.md] * movable[link /reference/concepts/movable.md] ## 概要 diff --git a/reference/concepts/equality_comparable.md b/reference/concepts/equality_comparable.md index 2a2f6f59ed..4f94310232 100644 --- a/reference/concepts/equality_comparable.md +++ b/reference/concepts/equality_comparable.md @@ -35,7 +35,6 @@ concept weakly-equality-comparable-with = { u != t } -> boolean-testable; }; ``` -* remove_reference_t[link /reference/type_traits/remove_reference.md] * boolean-testable[link /reference/concepts/boolean-testable.md] - (1) : 以下のように定義される @@ -58,9 +57,6 @@ concept equality_comparable_with = const remove_reference_t&>> && weakly-equality-comparable-with; ``` -* common_reference_with[link /reference/concepts/common_reference_with.md] -* remove_reference_t[link /reference/type_traits/remove_reference.md] -* common_reference_t[link /reference/type_traits/common_reference.md] ## モデル diff --git a/reference/concepts/movable.md b/reference/concepts/movable.md index 2227b92e1b..a92ac903c5 100644 --- a/reference/concepts/movable.md +++ b/reference/concepts/movable.md @@ -14,8 +14,6 @@ namespace std { } ``` * assignable_from[link /reference/concepts/assignable_from.md] -* is_object_v[link /reference/type_traits/is_object.md] -* move_constructible[link /reference/concepts/move_constructible.md] * swappable[link /reference/concepts/swappable.md] ## 概要 diff --git a/reference/concepts/move_constructible.md b/reference/concepts/move_constructible.md index b0a2ee4d98..04498594b0 100644 --- a/reference/concepts/move_constructible.md +++ b/reference/concepts/move_constructible.md @@ -11,7 +11,6 @@ namespace std { } ``` * constructible_from[link /reference/concepts/constructible_from.md] -* convertible_to[link /reference/concepts/convertible_to.md] ## 概要 diff --git a/reference/concepts/predicate.md b/reference/concepts/predicate.md index 0ffe307729..0feae1e3d2 100644 --- a/reference/concepts/predicate.md +++ b/reference/concepts/predicate.md @@ -11,9 +11,7 @@ namespace std { regular_invocable && boolean-testable>; } ``` -* regular_invocable[link /reference/concepts/invocable.md] * boolean-testable[link /reference/concepts/boolean-testable.md] -* invoke_result_t[link /reference/type_traits/invoke_result.md] ## 概要 diff --git a/reference/concepts/regular.md b/reference/concepts/regular.md index 32982b1d85..4226df2454 100644 --- a/reference/concepts/regular.md +++ b/reference/concepts/regular.md @@ -10,7 +10,6 @@ namespace std { concept regular = semiregular && equality_comparable; } ``` -* equality_comparable[link /reference/concepts/equality_comparable.md] * semiregular[link /reference/concepts/semiregular.md] ## 概要 diff --git a/reference/concepts/semiregular.md b/reference/concepts/semiregular.md index 4a21ae050f..329ecc6828 100644 --- a/reference/concepts/semiregular.md +++ b/reference/concepts/semiregular.md @@ -11,7 +11,6 @@ namespace std { } ``` * copyable[link /reference/concepts/copyable.md] -* default_initializable[link /reference/concepts/default_initializable.md] ## 概要 diff --git a/reference/concepts/swappable.md b/reference/concepts/swappable.md index e17c553e4d..53a41dc3ba 100644 --- a/reference/concepts/swappable.md +++ b/reference/concepts/swappable.md @@ -21,8 +21,6 @@ namespace std { } ``` * swap[link /reference/concepts/swap.md] -* common_reference_with[link /reference/concepts/common_reference_with.md] -* std::forward[link /reference/utility/forward.md] ## 概要 diff --git a/reference/concepts/totally_ordered.md b/reference/concepts/totally_ordered.md index 7bed3af79c..8975853576 100644 --- a/reference/concepts/totally_ordered.md +++ b/reference/concepts/totally_ordered.md @@ -22,10 +22,7 @@ namespace std { partially-ordered-with; } ``` -* common_reference_t[link /reference/type_traits/common_reference.md] -* equality_comparable[link /reference/concepts/equality_comparable.md] * equality_comparable_with[link /reference/concepts/equality_comparable.md] -* remove_reference_t[link /reference/type_traits/remove_reference.md] * partially-ordered-with[link /reference/compare/three_way_comparable.md] ## 概要 diff --git a/reference/deque/deque/op_constructor.md b/reference/deque/deque/op_constructor.md index 81bb9d0442..726534f06c 100644 --- a/reference/deque/deque/op_constructor.md +++ b/reference/deque/deque/op_constructor.md @@ -109,7 +109,6 @@ deque(from_range_t, R&& rg, } ``` * std::scoped_allocator_adaptor[link ../../scoped_allocator/scoped_allocator_adaptor.md] - * std::allocator[link ../../memory/allocator.md] * emplace_back[link ../../list/list/emplace_back.md] diff --git a/reference/deque/deque/op_deduction_guide.md b/reference/deque/deque/op_deduction_guide.md index 2f223cdf39..813dc555f6 100644 --- a/reference/deque/deque/op_deduction_guide.md +++ b/reference/deque/deque/op_deduction_guide.md @@ -17,7 +17,6 @@ namespace std { -> deque, Allocator>; // (2) C++23から } ``` -* iterator_traits[link /reference/iterator/iterator_traits.md] * ranges::input_range[link /reference/ranges/input_range.md] * allocator[link /reference/memory/allocator.md] * ranges::range_value_t[link /reference/ranges/range_value_t.md] diff --git a/reference/execution/class-type.md b/reference/execution/class-type.md index 92511231c9..0793ba4f03 100644 --- a/reference/execution/class-type.md +++ b/reference/execution/class-type.md @@ -11,7 +11,6 @@ namespace std { } ``` * decays-to[link decays-to.md] -* is_class_v[link /reference/type_traits/is_class.md] ## 概要 `class-type`は、型`T`がクラス型であることを表す説明専用のコンセプトである。 diff --git a/reference/execution/decays-to.md b/reference/execution/decays-to.md index f949e239d4..e0b208bdbd 100644 --- a/reference/execution/decays-to.md +++ b/reference/execution/decays-to.md @@ -10,7 +10,6 @@ namespace std { concept decays-to = same_as, To>; // exposition only } ``` -* decay_t[link /reference/type_traits/decay.md] ## 概要 `decays-to`は、型`From`の[decay](/reference/type_traits/decay.md)結果が型`To`に一致することを表す説明専用のコンセプトである。 diff --git a/reference/execution/execution/as_awaitable.md b/reference/execution/execution/as_awaitable.md index 9ed3e13812..3261083df0 100644 --- a/reference/execution/execution/as_awaitable.md +++ b/reference/execution/execution/as_awaitable.md @@ -57,7 +57,6 @@ namespace std::execution { * single-sender[link single-sender.md] * env_of_t[link env_of_t.md] * sender_to[link sender_to.md] -* convertible_to[link /reference/concepts/convertible_to.md] * coroutine_handle<>[link /reference/coroutine/coroutine_handle.md] * see below[italic] diff --git a/reference/execution/execution/basic-operation.md b/reference/execution/execution/basic-operation.md index ff9838484e..5151b2b2c0 100644 --- a/reference/execution/execution/basic-operation.md +++ b/reference/execution/execution/basic-operation.md @@ -109,8 +109,6 @@ using indices-for = remove_reference_t::indices-for; // exposition only * call-result-t[link /reference/functional/call-result-t.md] * impls-for[link impls-for.md] * tag_of_t[link tag_of_t.md] -* decay_t[link /reference/type_traits/decay.md] -* remove_reference_t[link /reference/type_traits/remove_reference.md] * see below[italic] 説明専用の定数`connect-all`は、下記ラムダ式と等価な関数呼び出し可能なオブジェクトとして初期化される。 diff --git a/reference/execution/execution/decayed-tuple.md b/reference/execution/execution/decayed-tuple.md index 6c2c486e11..bb71042659 100644 --- a/reference/execution/execution/decayed-tuple.md +++ b/reference/execution/execution/decayed-tuple.md @@ -10,8 +10,6 @@ namespace std::execution { using decayed-tuple = tuple...>; // exposition only } ``` -* tuple[link /reference/tuple/tuple.md] -* decay_t[link /reference/type_traits/decay.md] ## 概要 `decayed-tuple`は、型パラメータパック`Ts`から[decay](/reference/type_traits/decay.md)結果を要素型とする[`tuple`](/reference/tuple/tuple.md)型を作成する説明専用のエイリアステンプレートである。 diff --git a/reference/execution/execution/let_value.md b/reference/execution/execution/let_value.md index 126b5d1e8d..105a327b18 100644 --- a/reference/execution/execution/let_value.md +++ b/reference/execution/execution/let_value.md @@ -84,7 +84,6 @@ namespace std::execution { return state-type{std::forward_like(fn), let-env(child), {}, {}}; } ``` -* decay_t[link /reference/type_traits/decay.md] * see below[italic] - 説明用のパック`Sigs`を[`completion_signatures_of_t`](completion_signatures_of_t.md)`<`[`child-type`](child-type.md)`,` [`env_of_t`](env_of_t.md)`>`による[`completion_signatures`](completion_signatures.md)特殊化のテンプレートパラメータとし、パック`LetSigs`を`Sigs`に含まれる型のうち戻り値型が[`decayed-typeof`](/reference/functional/decayed-typeof.md)``に等しいものと定義する。説明用のエイリアステンプレート`as-tuple`を[`decayed-tuple`](decayed-tuple.md)``と定義する。型`args_variant_t`は下記定義において重複削除した型となる。 diff --git a/reference/execution/execution/operation_state.md b/reference/execution/execution/operation_state.md index 57b51859e6..ac0ea20c8d 100644 --- a/reference/execution/execution/operation_state.md +++ b/reference/execution/execution/operation_state.md @@ -18,7 +18,6 @@ namespace std::execution { } ``` * derived_from[link /reference/concepts/derived_from.md] -* is_object_v[link /reference/type_traits/is_object.md] * start[link start.md] ## 概要 diff --git a/reference/execution/execution/receiver.md b/reference/execution/execution/receiver.md index 05a15160f4..7ba8cee154 100644 --- a/reference/execution/execution/receiver.md +++ b/reference/execution/execution/receiver.md @@ -21,7 +21,6 @@ namespace std::execution { * get_env[link get_env.md] * queryable[link ../queryable.md] * derived_from[link /reference/concepts/derived_from.md] -* move_constructible[link /reference/concepts/move_constructible.md] * constructible_from[link /reference/concepts/constructible_from.md] ## 概要 diff --git a/reference/execution/execution/run_loop/run-loop-opstate.md b/reference/execution/execution/run_loop/run-loop-opstate.md index a629dda3b2..75a4389a17 100644 --- a/reference/execution/execution/run_loop/run-loop-opstate.md +++ b/reference/execution/execution/run_loop/run-loop-opstate.md @@ -55,7 +55,6 @@ struct run-loop-opstate-base { // exposition only ``` * push-back[link run.md] * set_error[link ../set_error.md] - * addressof[link /reference/memory/addressof.md] * std::move[link /reference/utility/move.md] * current_exception()[link /reference/exception/current_exception.md] diff --git a/reference/execution/execution/scheduler.md b/reference/execution/execution/scheduler.md index 9cb7b25f29..b7f645accc 100644 --- a/reference/execution/execution/scheduler.md +++ b/reference/execution/execution/scheduler.md @@ -29,7 +29,6 @@ namespace std::execution { * get_completion_scheduler[link get_completion_scheduler.md] * set_value_t[link set_value.md] * get_env[link get_env.md] -* equality_comparable[link /reference/concepts/equality_comparable.md] * copyable[link /reference/concepts/copyable.md] ## 概要 diff --git a/reference/execution/execution/sender.md b/reference/execution/execution/sender.md index 479fede9f3..216fea494b 100644 --- a/reference/execution/execution/sender.md +++ b/reference/execution/execution/sender.md @@ -57,7 +57,6 @@ concept sender = ``` * get_env[link get_env.md] * queryable[link ../queryable.md] -* move_constructible[link /reference/concepts/move_constructible.md] * constructible_from[link /reference/concepts/constructible_from.md] diff --git a/reference/execution/execution/split.md b/reference/execution/execution/split.md index 06a180de1e..29ac7e4ff5 100644 --- a/reference/execution/execution/split.md +++ b/reference/execution/execution/split.md @@ -149,7 +149,6 @@ local-state(Sndr&& sndr, Rcvr& rcvr) noexcept; this->sh_state->inc-ref(); this->rcvr = addressof(rcvr); ``` - * addressof[link /reference/memory/addressof.md] ```cpp ~local-state(); @@ -283,7 +282,6 @@ namespace std::execution { variant, tuple, as-tuple...> ``` * variant[link /reference/variant/variant.md] - * tuple[link /reference/tuple/tuple.md] * set_stopped_t[link set_stopped.md] * set_error_t[link set_error.md] * exception_ptr[link /reference/exception/exception_ptr.md] diff --git a/reference/execution/execution/starts_on.md b/reference/execution/execution/starts_on.md index 6673b28080..7f6a2899c1 100644 --- a/reference/execution/execution/starts_on.md +++ b/reference/execution/execution/starts_on.md @@ -62,7 +62,6 @@ transform_sender( * let_value[link let_value.md] * schedule[link schedule.md] * is_nothrow_move_constructible_v[link /reference/type_traits/is_nothrow_move_constructible.md] - * decay_t[link /reference/type_traits/decay.md] * std::move[link /reference/utility/move.md] diff --git a/reference/execution/execution/stopped_as_optional.md b/reference/execution/execution/stopped_as_optional.md index fab6ba572b..da13267d45 100644 --- a/reference/execution/execution/stopped_as_optional.md +++ b/reference/execution/execution/stopped_as_optional.md @@ -50,7 +50,6 @@ return let_stopped( * just[link just.md] * is_nothrow_constructible_v[link /reference/type_traits/is_nothrow_constructible.md] * optional[link /reference/optional/optional.md] -* in_place[link /reference/utility/in_place_t.md] ## カスタマイゼーションポイント diff --git a/reference/execution/execution/when_all.md b/reference/execution/execution/when_all.md index b94f58fd72..f2475dd1be 100644 --- a/reference/execution/execution/when_all.md +++ b/reference/execution/execution/when_all.md @@ -204,7 +204,6 @@ concept max-1-sender-in = sender_in && // exposition only * sender_in[link sender_in.md] * value_types_of_t[link value_types_of_t.md] * tuple_size_v[link /reference/tuple/tuple_size.md] -* tuple[link /reference/tuple/tuple.md] ### 列挙型`disposition` ```cpp @@ -263,7 +262,6 @@ tuple, decayed-tuple, optional>...> * value_types_of_t[link value_types_of_t.md] * env_of_t[link env_of_t.md] * decayed-tuple[link decayed-tuple.md] -* tuple[link /reference/tuple/tuple.md] * optional[link /reference/optional/optional.md] 説明用のパック`Es`を全ての子[Sender](sender.md)のエラー結果データの[decayed](/reference/type_traits/decay.md)型としたとき、型`errors_variant`は下記定義において重複削除した型となる。 @@ -289,7 +287,6 @@ variant values); ``` * set_value[link set_value.md] - * tuple[link /reference/tuple/tuple.md] * apply[link /reference/tuple/apply.md] * tuple_cat[link /reference/tuple/tuple_cat.md] * reset()[link /reference/optional/optional/reset.md] diff --git a/reference/execution/movable-value.md b/reference/execution/movable-value.md index 39c5206fc2..df9ad05345 100644 --- a/reference/execution/movable-value.md +++ b/reference/execution/movable-value.md @@ -13,11 +13,8 @@ namespace std { (!is_array_v>); } ``` -* move_constructible[link /reference/concepts/move_constructible.md] * constructible_from[link /reference/concepts/constructible_from.md] -* decay_t[link /reference/type_traits/decay.md] * is_array_v[link /reference/type_traits/is_array.md] -* remove_reference_t[link /reference/type_traits/remove_reference.md] ## 概要 `movable-value`は、型`T`がムーブ構築可能な値であることを表す説明専用のコンセプトである。 diff --git a/reference/expected/expected.void/and_then.md b/reference/expected/expected.void/and_then.md index e4b8b2894f..33fe86272f 100644 --- a/reference/expected/expected.void/and_then.md +++ b/reference/expected/expected.void/and_then.md @@ -56,7 +56,6 @@ class expected { * error()[link error.md] * unexpect[link ../unexpect_t.md] * invoke[link /reference/functional/invoke.md] - * std::forward[link /reference/utility/forward.md] - (3), (4) : 次の処理と等価 ```cpp @@ -69,7 +68,6 @@ class expected { * error()[link error.md] * unexpect[link ../unexpect_t.md] * invoke[link /reference/functional/invoke.md] - * std::forward[link /reference/utility/forward.md] * std::move[link /reference/utility/move.md] diff --git a/reference/expected/expected.void/op_constructor.md b/reference/expected/expected.void/op_constructor.md index 494caea13c..69163677cc 100644 --- a/reference/expected/expected.void/op_constructor.md +++ b/reference/expected/expected.void/op_constructor.md @@ -31,7 +31,6 @@ constexpr explicit expected(unexpect_t, initializer_list il, Args&&... args); * see below[italic] * unexpected[link ../unexpected.md] * unexpect_t[link ../unexpect_t.md] -* in_place_t[link /reference/utility/in_place_t.md] * initializer_list[link /reference/initializer_list/initializer_list.md] ## 概要 diff --git a/reference/expected/expected.void/or_else.md b/reference/expected/expected.void/or_else.md index d5dae6b815..a571c44026 100644 --- a/reference/expected/expected.void/or_else.md +++ b/reference/expected/expected.void/or_else.md @@ -50,8 +50,6 @@ class expected { * has_value()[link has_value.md] * error()[link error.md] * invoke[link /reference/functional/invoke.md] - * in_place[link /reference/utility/in_place_t.md] - * std::forward[link /reference/utility/forward.md] - (3), (4) : 次の処理と等価 ```cpp @@ -63,8 +61,6 @@ class expected { * has_value()[link has_value.md] * error()[link error.md] * invoke[link /reference/functional/invoke.md] - * in_place[link /reference/utility/in_place_t.md] - * std::forward[link /reference/utility/forward.md] * std::move[link /reference/utility/move.md] diff --git a/reference/expected/expected.void/swap.md b/reference/expected/expected.void/swap.md index 57e27cfe98..f57e0618f3 100644 --- a/reference/expected/expected.void/swap.md +++ b/reference/expected/expected.void/swap.md @@ -40,7 +40,6 @@ constexpr void swap(expected& rhs) noexcept(see below); has_val = false; rhs.has_val = true; ``` - * addressof[link /reference/memory/addressof.md] * construct_at[link /reference/memory/construct_at.md] * destroy_at[link /reference/memory/destroy_at.md] * std::move[link /reference/utility/move.md] diff --git a/reference/expected/expected/and_then.md b/reference/expected/expected/and_then.md index 534fd20750..6545fdbe49 100644 --- a/reference/expected/expected/and_then.md +++ b/reference/expected/expected/and_then.md @@ -56,7 +56,6 @@ class expected { * error()[link error.md] * unexpect[link ../unexpect_t.md] * invoke[link /reference/functional/invoke.md] - * std::forward[link /reference/utility/forward.md] - (3), (4) : 次の処理と等価 ```cpp @@ -70,7 +69,6 @@ class expected { * error()[link error.md] * unexpect[link ../unexpect_t.md] * invoke[link /reference/functional/invoke.md] - * std::forward[link /reference/utility/forward.md] * std::move[link /reference/utility/move.md] diff --git a/reference/expected/expected/emplace.md b/reference/expected/expected/emplace.md index c7d374fedd..f1e0fe8f51 100644 --- a/reference/expected/expected/emplace.md +++ b/reference/expected/expected/emplace.md @@ -43,10 +43,8 @@ constexpr T& emplace(initializer_list il, Args&&... args) noexcept; // (2) return *construct_at(addressof(val), std::forward(args)...); ``` * has_value[link has_value.md] - * addressof[link /reference/memory/addressof.md] * construct_at[link /reference/memory/construct_at.md] * destroy_at[link /reference/memory/destroy_at.md] - * std::forward[link /reference/utility/forward.md] - (2) : 次の処理と等価 ```cpp @@ -59,10 +57,8 @@ constexpr T& emplace(initializer_list il, Args&&... args) noexcept; // (2) return *construct_at(addressof(val), il, std::forward(args)...); ``` * has_value[link has_value.md] - * addressof[link /reference/memory/addressof.md] * construct_at[link /reference/memory/construct_at.md] * destroy_at[link /reference/memory/destroy_at.md] - * std::forward[link /reference/utility/forward.md] ## 例 diff --git a/reference/expected/expected/op_assign.md b/reference/expected/expected/op_assign.md index 90316fa6d3..a05f7ec1f0 100644 --- a/reference/expected/expected/op_assign.md +++ b/reference/expected/expected/op_assign.md @@ -60,12 +60,10 @@ constexpr void reinit-expected(T& newval, U& oldval, Args&&... args) { } } ``` -* addressof[link /reference/memory/addressof.md] * construct_at[link /reference/memory/construct_at.md] * destroy_at[link /reference/memory/destroy_at.md] * is_nothrow_constructible_v[link /reference/type_traits/is_nothrow_constructible.md] * is_nothrow_move_constructible_v[link /reference/type_traits/is_nothrow_move_constructible.md] -* std::forward[link /reference/utility/forward.md] * std::move[link /reference/utility/move.md] ## テンプレートパラメータ制約 diff --git a/reference/expected/expected/op_constructor.md b/reference/expected/expected/op_constructor.md index 96418b457f..9bc92cb407 100644 --- a/reference/expected/expected/op_constructor.md +++ b/reference/expected/expected/op_constructor.md @@ -36,7 +36,6 @@ constexpr explicit expected(unexpect_t, initializer_list il, Args&&... args); * see below[italic] * unexpected[link ../unexpected.md] * unexpect_t[link ../unexpect_t.md] -* in_place_t[link /reference/utility/in_place_t.md] * initializer_list[link /reference/initializer_list/initializer_list.md] ## 概要 diff --git a/reference/expected/expected/or_else.md b/reference/expected/expected/or_else.md index 111100851d..b1b2932431 100644 --- a/reference/expected/expected/or_else.md +++ b/reference/expected/expected/or_else.md @@ -55,8 +55,6 @@ class expected { * value()[link value.md] * error()[link error.md] * invoke[link /reference/functional/invoke.md] - * in_place[link /reference/utility/in_place_t.md] - * std::forward[link /reference/utility/forward.md] - (3), (4) : 次の処理と等価 ```cpp @@ -69,8 +67,6 @@ class expected { * value()[link value.md] * error()[link error.md] * invoke[link /reference/functional/invoke.md] - * in_place[link /reference/utility/in_place_t.md] - * std::forward[link /reference/utility/forward.md] * std::move[link /reference/utility/move.md] diff --git a/reference/expected/expected/swap.md b/reference/expected/expected/swap.md index 9a4225f2cd..8c6f5c8f3c 100644 --- a/reference/expected/expected/swap.md +++ b/reference/expected/expected/swap.md @@ -63,7 +63,6 @@ constexpr void swap(expected& rhs) noexcept(see below); has_val = false; rhs.has_val = true; ``` - * addressof[link /reference/memory/addressof.md] * construct_at[link /reference/memory/construct_at.md] * destroy_at[link /reference/memory/destroy_at.md] * std::move[link /reference/utility/move.md] diff --git a/reference/expected/unexpected.md b/reference/expected/unexpected.md index 87ddde4db1..da2cb1ddca 100644 --- a/reference/expected/unexpected.md +++ b/reference/expected/unexpected.md @@ -98,7 +98,6 @@ int main() } ``` * std::unexpected[color ff0000] -* std::expected[link expected.md] * std::quoted[link ../iomanip/quoted.md] ### 出力 diff --git a/reference/expected/unexpected/op_constructor.md b/reference/expected/unexpected/op_constructor.md index 1b8373301a..00e6e6855e 100644 --- a/reference/expected/unexpected/op_constructor.md +++ b/reference/expected/unexpected/op_constructor.md @@ -17,7 +17,6 @@ constexpr explicit unexpected(in_place_t, Args&&... args); // (4) template constexpr explicit unexpected(in_place_t, initializer_list il, Args&&... args); // (5) ``` -* in_place_t[link /reference/utility/in_place_t.md] * initializer_list[link /reference/initializer_list/initializer_list.md] ## 概要 diff --git a/reference/exposition-only/container-compatible-range.md b/reference/exposition-only/container-compatible-range.md index a6b13dd0d9..c2bb8c14f7 100644 --- a/reference/exposition-only/container-compatible-range.md +++ b/reference/exposition-only/container-compatible-range.md @@ -12,7 +12,6 @@ namespace std { ``` * ranges::input_range[link /reference/ranges/input_range.md] * ranges::range_reference[link /reference/ranges/range_reference_t.md] -* convertible_to[link /reference/concepts/convertible_to.md] ## 概要 container-compatible-rangeは、指定されたコンテナと互換性のあるRangeであることを表すコンセプトである。 diff --git a/reference/exposition-only/decay-copy.md b/reference/exposition-only/decay-copy.md index 5a52bd2754..d8993b53e7 100644 --- a/reference/exposition-only/decay-copy.md +++ b/reference/exposition-only/decay-copy.md @@ -12,8 +12,6 @@ constexpr decay_t decay-copy(T&& v) noexcept(is_nothrow_convertible_v pair emplace(Args&&... args); ``` -* pair[link /reference/utility/pair.md] ## 概要 コンテナに新しい要素を挿入する。要素は直接構築される(コピーもムーブもされない)。要素のコンストラクタはこの関数に渡された引数を与えることによって呼ばれる。 @@ -115,7 +114,6 @@ int main() ``` * emplace[color ff0000] * std::piecewise_construct[link /reference/utility/piecewise_construct_t.md] -* std::forward_as_tuple[link /reference/tuple/forward_as_tuple.md] #### 出力 ``` diff --git a/reference/flat_map/flat_map/equal_range.md b/reference/flat_map/flat_map/equal_range.md index 2ecacea396..3e9b4e03cd 100644 --- a/reference/flat_map/flat_map/equal_range.md +++ b/reference/flat_map/flat_map/equal_range.md @@ -18,7 +18,6 @@ template pair equal_range(const K& x) const; // (4) C++23 ``` -* pair[link /reference/utility/pair.md] ## 概要 コンテナ内の、`x` と等しいキー要素を全て含む範囲の境界を返す。`flat_map` コンテナではキーの重複は無いため、この範囲は最大一つの要素を含む。 diff --git a/reference/flat_map/flat_map/insert.md b/reference/flat_map/flat_map/insert.md index f83c8ca4e8..2347f5031e 100644 --- a/reference/flat_map/flat_map/insert.md +++ b/reference/flat_map/flat_map/insert.md @@ -35,7 +35,6 @@ void insert(initializer_list il); // (9) C++23 void insert(sorted_unique_t s, initializer_list il); // (10) C++23 ``` -* pair[link /reference/utility/pair.md] * initializer_list[link /reference/initializer_list/initializer_list.md] * sorted_unique_t[link /reference/flat_map/sorted_unique_t.md] diff --git a/reference/flat_map/flat_map/insert_or_assign.md b/reference/flat_map/flat_map/insert_or_assign.md index 95f5324225..b6f11c62e8 100644 --- a/reference/flat_map/flat_map/insert_or_assign.md +++ b/reference/flat_map/flat_map/insert_or_assign.md @@ -39,7 +39,6 @@ iterator K&& k, M&& obj); // (6) C++23 ``` -* pair[link /reference/utility/pair.md] ## 概要 引数 `k` で指定されたキーが存在しなければ対応する値を引数 `obj` の値として要素を挿入し(`insert`)、さもなければ(`or`)、そのキーに対応する値に引数 `obj` を代入する(`assign`)。 @@ -80,7 +79,6 @@ iterator try_emplace(std::forward(k), std::forward(obj)); ``` * try_emplace[link try_emplace.md] - * std::forward[link /reference/utility/forward.md] - (4), (5), (6) : - `k`と等価なキーをもつ要素`e`が存在している場合、[`std::forward`](/reference/utility/forward.md)`(obj)`を`e.second`に代入する @@ -89,7 +87,6 @@ iterator try_emplace_hint(hint, std::forward(k), std::forward(obj)); ``` * try_emplace_hint[link try_emplace.md] - * std::forward[link /reference/utility/forward.md] ## 戻り値 diff --git a/reference/flat_map/flat_map/op_at.md b/reference/flat_map/flat_map/op_at.md index a2400349c4..30ab910e6b 100644 --- a/reference/flat_map/flat_map/op_at.md +++ b/reference/flat_map/flat_map/op_at.md @@ -44,7 +44,6 @@ mapped_type& operator[](K&& x); // (3) C++23 return try_emplace(std::forward(x)).first->second; ``` * try_emplace[link try_emplace.md] - * std::forward[link /reference/utility/forward.md] ## 計算量 diff --git a/reference/flat_map/flat_map/op_deduction_guide.md b/reference/flat_map/flat_map/op_deduction_guide.md index 7efe3b1fed..03544f1a7e 100644 --- a/reference/flat_map/flat_map/op_deduction_guide.md +++ b/reference/flat_map/flat_map/op_deduction_guide.md @@ -84,8 +84,6 @@ namespace std { * from_range_t[link ../../ranges/from_range_t.md] * sorted_unique_t[link ../sorted_unique_t.md] * remove_const_t[link /reference/type_traits/remove_const.md] -* pair[link /reference/utility/pair.md] -* iterator_traits[link /reference/iterator/iterator_traits.md] * less[link /reference/functional/less.md] * allocator[link /reference/memory/allocator.md] * initializer_list[link /reference/initializer_list/initializer_list.md] diff --git a/reference/flat_map/flat_map/try_emplace.md b/reference/flat_map/flat_map/try_emplace.md index 8cc66c14c6..966097865d 100644 --- a/reference/flat_map/flat_map/try_emplace.md +++ b/reference/flat_map/flat_map/try_emplace.md @@ -39,7 +39,6 @@ iterator K&& k, Args&&... args); // (6) C++23 ``` -* pair[link /reference/utility/pair.md] ## 概要 指定されたキーが存在しない場合のみ要素を直接構築で挿入する。 @@ -89,7 +88,6 @@ iterator * distance[link /reference/iterator/distance.md] * insert[link /reference/vector/vector/insert.md] * emplace[link /reference/vector/vector/emplace.md] - * std::forward[link /reference/utility/forward.md] - (5), (6) : ```cpp @@ -104,7 +102,6 @@ iterator * begin()[link /reference/vector/vector/begin.md] * distance[link /reference/iterator/distance.md] * emplace[link /reference/vector/vector/emplace.md] - * std::forward[link /reference/utility/forward.md] ## 戻り値 diff --git a/reference/flat_map/flat_map/uses_allocator.md b/reference/flat_map/flat_map/uses_allocator.md index c318a4d0f8..2bea224595 100644 --- a/reference/flat_map/flat_map/uses_allocator.md +++ b/reference/flat_map/flat_map/uses_allocator.md @@ -35,7 +35,6 @@ int main() } ``` * std::uses_allocator[color ff0000] -* std::allocator[link /reference/memory/allocator.md] ### 出力 ```cpp diff --git a/reference/flat_map/flat_multimap/equal_range.md b/reference/flat_map/flat_multimap/equal_range.md index 4d0d883f2f..16475ee282 100644 --- a/reference/flat_map/flat_multimap/equal_range.md +++ b/reference/flat_map/flat_multimap/equal_range.md @@ -18,7 +18,6 @@ template pair equal_range(const K& x) const; // (4) C++23 ``` -* pair[link /reference/utility/pair.md] ## 概要 コンテナ内の、`x` と等しいキー要素を全て含む範囲の境界を返す。 diff --git a/reference/flat_map/flat_multimap/op_deduction_guide.md b/reference/flat_map/flat_multimap/op_deduction_guide.md index 8d697687ef..f9b79f3d87 100644 --- a/reference/flat_map/flat_multimap/op_deduction_guide.md +++ b/reference/flat_map/flat_multimap/op_deduction_guide.md @@ -84,8 +84,6 @@ namespace std { * from_range_t[link ../../ranges/from_range_t.md] * sorted_equivalent_t[link ../sorted_equivalent_t.md] * remove_const_t[link /reference/type_traits/remove_const.md] -* pair[link /reference/utility/pair.md] -* iterator_traits[link /reference/iterator/iterator_traits.md] * less[link /reference/functional/less.md] * allocator[link /reference/memory/allocator.md] * initializer_list[link /reference/initializer_list/initializer_list.md] diff --git a/reference/flat_map/flat_multimap/uses_allocator.md b/reference/flat_map/flat_multimap/uses_allocator.md index c67c80f8d6..445702d92e 100644 --- a/reference/flat_map/flat_multimap/uses_allocator.md +++ b/reference/flat_map/flat_multimap/uses_allocator.md @@ -35,7 +35,6 @@ int main() } ``` * std::uses_allocator[color ff0000] -* std::allocator[link /reference/memory/allocator.md] ### 出力 ```cpp diff --git a/reference/flat_set/flat_multiset/emplace.md b/reference/flat_set/flat_multiset/emplace.md index c6609212db..49c04e5e44 100644 --- a/reference/flat_set/flat_multiset/emplace.md +++ b/reference/flat_set/flat_multiset/emplace.md @@ -82,8 +82,6 @@ int main() } ``` * emplace[color ff0000] -* std::begin[link /reference/iterator/begin.md] -* std::end[link /reference/iterator/end.md] #### 出力 ``` diff --git a/reference/flat_set/flat_multiset/equal_range.md b/reference/flat_set/flat_multiset/equal_range.md index 6ead8e62e3..9c7d4e6da8 100644 --- a/reference/flat_set/flat_multiset/equal_range.md +++ b/reference/flat_set/flat_multiset/equal_range.md @@ -18,7 +18,6 @@ template pair equal_range(const K& x) const; // (4) C++23 ``` -* pair[link /reference/utility/pair.md] ## 概要 コンテナ内の、`x` と等しいキー要素を全て含む範囲の境界を返す。 diff --git a/reference/flat_set/flat_multiset/op_deduction_guide.md b/reference/flat_set/flat_multiset/op_deduction_guide.md index a075b7ef1d..52cd057a24 100644 --- a/reference/flat_set/flat_multiset/op_deduction_guide.md +++ b/reference/flat_set/flat_multiset/op_deduction_guide.md @@ -71,7 +71,6 @@ namespace std { * vector[link /reference/vector/vector.md] * from_range_t[link ../../ranges/from_range_t.md] * sorted_equivalent_t[link ../sorted_equivalent_t.md] -* iterator_traits[link /reference/iterator/iterator_traits.md] * less[link /reference/functional/less.md] * allocator[link /reference/memory/allocator.md] * initializer_list[link /reference/initializer_list/initializer_list.md] diff --git a/reference/flat_set/flat_multiset/uses_allocator.md b/reference/flat_set/flat_multiset/uses_allocator.md index a107e6c1f9..5fb893711a 100644 --- a/reference/flat_set/flat_multiset/uses_allocator.md +++ b/reference/flat_set/flat_multiset/uses_allocator.md @@ -34,7 +34,6 @@ int main() } ``` * std::uses_allocator[color ff0000] -* std::allocator[link /reference/memory/allocator.md] ### 出力 ```cpp diff --git a/reference/flat_set/flat_set/emplace.md b/reference/flat_set/flat_set/emplace.md index abd530ea24..1c04c403c4 100644 --- a/reference/flat_set/flat_set/emplace.md +++ b/reference/flat_set/flat_set/emplace.md @@ -9,7 +9,6 @@ template pair emplace(Args&&... args); ``` -* pair[link /reference/utility/pair.md] ## 概要 コンテナに新しい要素を挿入する。要素は直接構築される(コピーもムーブもされない)。要素のコンストラクタはこの関数に渡された引数を与えることによって呼ばれる。 @@ -96,8 +95,6 @@ int main() } ``` * emplace[color ff0000] -* std::begin[link /reference/iterator/begin.md] -* std::end[link /reference/iterator/end.md] #### 出力 ``` diff --git a/reference/flat_set/flat_set/equal_range.md b/reference/flat_set/flat_set/equal_range.md index c03c414317..f7d0551679 100644 --- a/reference/flat_set/flat_set/equal_range.md +++ b/reference/flat_set/flat_set/equal_range.md @@ -18,7 +18,6 @@ template pair equal_range(const K& x) const; // (4) C++23 ``` -* pair[link /reference/utility/pair.md] ## 概要 コンテナ内の、`x` と等しいキー要素を全て含む範囲の境界を返す。`flat_set` コンテナではキーの重複は無いため、この範囲は最大一つの要素を含む。 diff --git a/reference/flat_set/flat_set/insert.md b/reference/flat_set/flat_set/insert.md index 2096a7078f..669f34497d 100644 --- a/reference/flat_set/flat_set/insert.md +++ b/reference/flat_set/flat_set/insert.md @@ -35,7 +35,6 @@ void insert(initializer_list il); // (9) C++23 void insert(sorted_unique_t s, initializer_list il); // (10) C++23 ``` -* pair[link /reference/utility/pair.md] * initializer_list[link /reference/initializer_list/initializer_list.md] * sorted_unique_t[link /reference/flat_set/sorted_unique_t.md] diff --git a/reference/flat_set/flat_set/op_deduction_guide.md b/reference/flat_set/flat_set/op_deduction_guide.md index 22f0caa70e..7fb1f6e320 100644 --- a/reference/flat_set/flat_set/op_deduction_guide.md +++ b/reference/flat_set/flat_set/op_deduction_guide.md @@ -71,7 +71,6 @@ namespace std { * vector[link /reference/vector/vector.md] * from_range_t[link ../../ranges/from_range_t.md] * sorted_unique_t[link ../sorted_unique_t.md] -* iterator_traits[link /reference/iterator/iterator_traits.md] * less[link /reference/functional/less.md] * allocator[link /reference/memory/allocator.md] * initializer_list[link /reference/initializer_list/initializer_list.md] diff --git a/reference/flat_set/flat_set/uses_allocator.md b/reference/flat_set/flat_set/uses_allocator.md index 582575ff3f..76b0c46f8e 100644 --- a/reference/flat_set/flat_set/uses_allocator.md +++ b/reference/flat_set/flat_set/uses_allocator.md @@ -34,7 +34,6 @@ int main() } ``` * std::uses_allocator[color ff0000] -* std::allocator[link /reference/memory/allocator.md] ### 出力 ```cpp diff --git a/reference/format/basic_format_arg/op_constructor.md b/reference/format/basic_format_arg/op_constructor.md index f847702f1e..aec5476581 100644 --- a/reference/format/basic_format_arg/op_constructor.md +++ b/reference/format/basic_format_arg/op_constructor.md @@ -28,7 +28,6 @@ namespace std { ``` * variant[link /reference/variant/variant.md] * monostate[link /reference/variant/monostate.md] -* basic_string_view[link /reference/string_view/basic_string_view.md] * handle[link handle.md] * basic_format_arg[italic] diff --git a/reference/format/basic_format_parse_context.md b/reference/format/basic_format_parse_context.md index f02a306339..552f6ef5e0 100644 --- a/reference/format/basic_format_parse_context.md +++ b/reference/format/basic_format_parse_context.md @@ -110,7 +110,6 @@ namespace std { }; } ``` -* basic_string_view[link /reference/string_view/basic_string_view.md] * format_error[link /reference/string_view/basic_string_view.md] ## バージョン diff --git a/reference/format/basic_format_string.md b/reference/format/basic_format_string.md index fd812599d0..d6a534940a 100644 --- a/reference/format/basic_format_string.md +++ b/reference/format/basic_format_string.md @@ -50,7 +50,6 @@ void log(std::format_string s, Args&&... args) { } ``` * std::format[link /reference/format/format.md] -* std::forward[link /reference/utility/forward.md] ## メンバ関数 @@ -92,9 +91,7 @@ int main() * chrono::system_clock[link /reference/chrono/system_clock.md] * now[link /reference/chrono/system_clock/now.md] * chrono::floor[link /reference/chrono/time_point/floor.md] -* chrono::seconds[link /reference/chrono/duration_aliases.md] * chrono::zoned_time[link /reference/chrono/zoned_time.md] -* std::forward[link /reference/utility/forward.md] * std::format[link /reference/format/format.md] ### 出力 diff --git a/reference/format/format.md b/reference/format/format.md index de569ac665..6b01cd0e8a 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -622,9 +622,7 @@ int main() * chrono::system_clock[link /reference/chrono/system_clock.md] * now[link /reference/chrono/system_clock/now.md] * chrono::floor[link /reference/chrono/time_point/floor.md] -* chrono::seconds[link /reference/chrono/duration_aliases.md] * chrono::zoned_time[link /reference/chrono/zoned_time.md] -* std::forward[link /reference/utility/forward.md] #### 出力 ``` diff --git a/reference/format/format_to_n.md b/reference/format/format_to_n.md index 3647d188fd..449fa4c879 100644 --- a/reference/format/format_to_n.md +++ b/reference/format/format_to_n.md @@ -176,7 +176,6 @@ format_to_n_result format_to_n(Out out, iter_difference_t n, const loc * locale[link /reference/locale/locale.md] * forward[link /reference/utility/forward.md] * back_inserter[link /reference/iterator/back_inserter.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] ## バージョン diff --git a/reference/format/format_to_n_result.md b/reference/format/format_to_n_result.md index a0b8214e65..16c59dad4f 100644 --- a/reference/format/format_to_n_result.md +++ b/reference/format/format_to_n_result.md @@ -14,7 +14,6 @@ namespace std { }; } ``` -* iter_difference_t[link /reference/iterator/iter_difference_t.md] ## 概要 [`format_to_n`](format_to_n.md)の結果を表す構造体。 diff --git a/reference/format/vformat.md b/reference/format/vformat.md index 27c099b76a..da0cfc5d2a 100644 --- a/reference/format/vformat.md +++ b/reference/format/vformat.md @@ -18,7 +18,6 @@ namespace std { ``` * string[link /reference/string/basic_string.md] * wstring[link /reference/string/basic_string.md] -* string_view[link /reference/string_view/basic_string_view.md] * wstring_view[link /reference/string_view/basic_string_view.md] * format_args[link /reference/format/basic_format_args.md] * wformat_args[link /reference/format/basic_format_args.md] @@ -73,7 +72,6 @@ string vformat(const locale& loc, wstring_view fmt, wformat_args args) { ``` * string[link /reference/string/basic_string.md] * wstring[link /reference/string/basic_string.md] -* string_view[link /reference/string_view/basic_string_view.md] * wstring_view[link /reference/string_view/basic_string_view.md] * format_args[link /reference/format/basic_format_args.md] * wformat_args[link /reference/format/basic_format_args.md] diff --git a/reference/format/vformat_to.md b/reference/format/vformat_to.md index e14207425f..75e3bb91ee 100644 --- a/reference/format/vformat_to.md +++ b/reference/format/vformat_to.md @@ -20,7 +20,6 @@ namespace std { Out vformat_to(Out out, const locale& loc, wstring_view fmt, wformat_args args); // (4) } ``` -* string_view[link /reference/string_view/basic_string_view.md] * wstring_view[link /reference/string_view/basic_string_view.md] * format_args[link /reference/format/basic_format_args.md] * wformat_args[link /reference/format/basic_format_args.md] diff --git a/reference/format/visit_format_arg.md b/reference/format/visit_format_arg.md index aa287bd490..70a514b1e2 100644 --- a/reference/format/visit_format_arg.md +++ b/reference/format/visit_format_arg.md @@ -56,7 +56,6 @@ namespace std { * monostate[link /reference/variant/monostate.md] * handle[link /reference/format/basic_format_arg/handle.md] * basic_string[link /reference/string/basic_string.md] -* basic_string_view[link /reference/string_view/basic_string_view.md] * basic_format_arg[link /reference/format/basic_format_arg.md] ## 戻り値 diff --git a/reference/forward_list/forward_list/emplace_after.md b/reference/forward_list/forward_list/emplace_after.md index 9d3a266a23..429e2c431a 100644 --- a/reference/forward_list/forward_list/emplace_after.md +++ b/reference/forward_list/forward_list/emplace_after.md @@ -55,7 +55,6 @@ int main() } ``` * emplace_after[color ff0000] -* std::next[link /reference/iterator/next.md] * ls.begin()[link begin.md] * ls.end()[link end.md] diff --git a/reference/forward_list/forward_list/erase_after.md b/reference/forward_list/forward_list/erase_after.md index cc243f3570..fa2608addb 100644 --- a/reference/forward_list/forward_list/erase_after.md +++ b/reference/forward_list/forward_list/erase_after.md @@ -79,7 +79,6 @@ int main() * erase_after[color ff0000] * ls.before_begin()[link before_begin.md] * ls.end()[link end.md] -* std::next[link /reference/iterator/next.md] #### 出力 ``` diff --git a/reference/forward_list/forward_list/insert_after.md b/reference/forward_list/forward_list/insert_after.md index d14fb26dbf..3cb9dd869e 100644 --- a/reference/forward_list/forward_list/insert_after.md +++ b/reference/forward_list/forward_list/insert_after.md @@ -116,7 +116,6 @@ int main() * ls.begin()[link begin.md] * ls.end()[link end.md] * ls.before_begin()[link before_begin.md] -* std::next[link /reference/iterator/next.md] ### 出力 ``` diff --git a/reference/forward_list/forward_list/op_constructor.md b/reference/forward_list/forward_list/op_constructor.md index 8c5aea629e..f606138eb8 100644 --- a/reference/forward_list/forward_list/op_constructor.md +++ b/reference/forward_list/forward_list/op_constructor.md @@ -102,7 +102,6 @@ forward_list(from_range_t, R&& rg, } ``` * std::scoped_allocator_adaptor[link ../../scoped_allocator/scoped_allocator_adaptor.md] - * std::allocator[link ../../memory/allocator.md] * emplace_back[link ../../list/list/emplace_back.md] diff --git a/reference/forward_list/forward_list/op_deduction_guide.md b/reference/forward_list/forward_list/op_deduction_guide.md index b882d76664..1ad682aa34 100644 --- a/reference/forward_list/forward_list/op_deduction_guide.md +++ b/reference/forward_list/forward_list/op_deduction_guide.md @@ -17,7 +17,6 @@ namespace std { -> forward_list, Allocator>; // (2) C++23から } ``` -* iterator_traits[link /reference/iterator/iterator_traits.md] * ranges::input_range[link /reference/ranges/input_range.md] * allocator[link /reference/memory/allocator.md] * ranges::range_value_t[link /reference/ranges/range_value_t.md] diff --git a/reference/forward_list/forward_list/splice_after.md b/reference/forward_list/forward_list/splice_after.md index 20677d81e0..7e328b50e0 100644 --- a/reference/forward_list/forward_list/splice_after.md +++ b/reference/forward_list/forward_list/splice_after.md @@ -109,7 +109,6 @@ int main() ``` * splice_after[color ff0000] * begin()[link begin.md] -* std::next[link /reference/iterator/next.md] ### 出力 ``` diff --git a/reference/fstream/basic_fstream/op_constructor.md b/reference/fstream/basic_fstream/op_constructor.md index 12bb50112a..29d06c4342 100644 --- a/reference/fstream/basic_fstream/op_constructor.md +++ b/reference/fstream/basic_fstream/op_constructor.md @@ -98,7 +98,6 @@ basic_fstream::basic_fstream(basic_fstream&& rhs) set_rdbuf(addressof(sb)); // C++11 } ``` -* addressof[link /reference/memory/addressof.md] ## バージョン ### 言語 diff --git a/reference/fstream/basic_ifstream/op_constructor.md b/reference/fstream/basic_ifstream/op_constructor.md index 253cf9e494..3a99a07919 100644 --- a/reference/fstream/basic_ifstream/op_constructor.md +++ b/reference/fstream/basic_ifstream/op_constructor.md @@ -98,7 +98,6 @@ basic_ifstream::basic_ifstream(basic_ifstream&& rhs) set_rdbuf(addressof(sb)); // C++11 } ``` -* addressof[link /reference/memory/addressof.md] ## バージョン ### 言語 diff --git a/reference/fstream/basic_ofstream/op_constructor.md b/reference/fstream/basic_ofstream/op_constructor.md index 238f371270..69dfa3394f 100644 --- a/reference/fstream/basic_ofstream/op_constructor.md +++ b/reference/fstream/basic_ofstream/op_constructor.md @@ -97,7 +97,6 @@ basic_ofstream::basic_ofstream(basic_ofstream&& rhs) set_rdbuf(addressof(sb)); // C++11 } ``` -* addressof[link /reference/memory/addressof.md] ## バージョン ### 言語 diff --git a/reference/functional/bind_front.md b/reference/functional/bind_front.md index b0f53e5feb..558ac6c550 100644 --- a/reference/functional/bind_front.md +++ b/reference/functional/bind_front.md @@ -47,7 +47,6 @@ auto f3 = bind_front(&Strategy::process, Strategy{}); * _2[link placeholders.md] * _3[link placeholders.md] * _4[link placeholders.md] -* std::forward[link /reference/utility/forward.md] ただし、この関数はメンバ関数とレシーバーを受け取る専用にはなっておらず、「引数を先頭から順に束縛する」という汎用的な機能になっているため、「メンバ関数ポインタのみを束縛」「関数と引数の一部を束縛」といった利用もできる。 diff --git a/reference/functional/boyer_moore_horspool_searcher.md b/reference/functional/boyer_moore_horspool_searcher.md index 294741ce18..f884a77437 100644 --- a/reference/functional/boyer_moore_horspool_searcher.md +++ b/reference/functional/boyer_moore_horspool_searcher.md @@ -13,7 +13,6 @@ namespace std { } ``` * hash[link hash.md] -* iterator_traits[link /reference/iterator/iterator_traits.md] * equal_to[link equal_to.md] ## 概要 diff --git a/reference/functional/boyer_moore_searcher.md b/reference/functional/boyer_moore_searcher.md index 6f91bedbd2..93d62115b3 100644 --- a/reference/functional/boyer_moore_searcher.md +++ b/reference/functional/boyer_moore_searcher.md @@ -13,7 +13,6 @@ namespace std { } ``` * hash[link hash.md] -* iterator_traits[link /reference/iterator/iterator_traits.md] * equal_to[link equal_to.md] ## 概要 diff --git a/reference/functional/copyable_function/op_equal.md b/reference/functional/copyable_function/op_equal.md index 0d88b8ba41..f0eb732da3 100644 --- a/reference/functional/copyable_function/op_equal.md +++ b/reference/functional/copyable_function/op_equal.md @@ -11,7 +11,6 @@ friend bool operator==(const copyable_function& f, nullptr_t) noexcept; // (1) // (1)により、以下のオーバーロードが使用可能になる friend bool operator==(nullptr_t, const copyable_function& f) noexcept; // (2) ``` -* nullptr_t[link /reference/cstddef/nullptr_t.md] ## 概要 等値比較する。 diff --git a/reference/functional/copyable_function/op_not_equal.md b/reference/functional/copyable_function/op_not_equal.md index df0b7a6b4e..07277fee7d 100644 --- a/reference/functional/copyable_function/op_not_equal.md +++ b/reference/functional/copyable_function/op_not_equal.md @@ -11,7 +11,6 @@ bool operator!=(const copyable_function& f, nullptr_t) noexcept; // (1) bool operator!=(nullptr_t, const copyable_function& f) noexcept; // (2) ``` -* nullptr_t[link /reference/cstddef/nullptr_t.md] ## 概要 非等値比較する。 diff --git a/reference/functional/divides.md b/reference/functional/divides.md index 78baebf799..2a3cf259d4 100644 --- a/reference/functional/divides.md +++ b/reference/functional/divides.md @@ -45,7 +45,6 @@ namespace std { } ``` * unspecified[italic] -* std::forward[link ../utility/forward.md] ## 概要 `divides`クラスは、除算を行う関数オブジェクトである。 diff --git a/reference/functional/equal_to.md b/reference/functional/equal_to.md index 23be223e81..a4a89c4421 100644 --- a/reference/functional/equal_to.md +++ b/reference/functional/equal_to.md @@ -45,7 +45,6 @@ namespace std { } ``` * unspecified[italic] -* std::forward[link ../utility/forward.md] ## 概要 `equal_to`クラスは、等値比較を行う関数オブジェクトである。 diff --git a/reference/functional/function/assign.md b/reference/functional/function/assign.md index ce5a583364..e7009e891a 100644 --- a/reference/functional/function/assign.md +++ b/reference/functional/function/assign.md @@ -24,7 +24,6 @@ function(allocator_arg, alloc, std::forward(f)).swap(*this) ``` * function[link op_constructor.md] * allocator_arg[link /reference/memory/allocator_arg_t.md] -* std::forward[link /reference/utility/forward.md] * swap[link swap.md] diff --git a/reference/functional/function/op_constructor.md b/reference/functional/function/op_constructor.md index e3d6172f54..3086238b6e 100644 --- a/reference/functional/function/op_constructor.md +++ b/reference/functional/function/op_constructor.md @@ -33,7 +33,6 @@ function(allocator_arg_t, const Alloc& alloc, function&& f); // (9) C++17 template function(allocator_arg_t, const Alloc& alloc, F f); // (10) C++17で削除 ``` -* nullptr_t[link /reference/cstddef/nullptr_t.md] * allocator_arg_t[link /reference/memory/allocator_arg_t.md] ## 概要 diff --git a/reference/functional/function/op_equal.md b/reference/functional/function/op_equal.md index dac4fa4184..4bad784df7 100644 --- a/reference/functional/function/op_equal.md +++ b/reference/functional/function/op_equal.md @@ -14,7 +14,6 @@ namespace std { bool operator==(nullptr_t, const function& f) noexcept; // (2) C++20 } ``` -* nullptr_t[link /reference/cstddef/nullptr_t.md] ## 概要 等値比較する。 diff --git a/reference/functional/function/op_not_equal.md b/reference/functional/function/op_not_equal.md index 78f351ddb8..4e6818fe34 100644 --- a/reference/functional/function/op_not_equal.md +++ b/reference/functional/function/op_not_equal.md @@ -14,7 +14,6 @@ namespace std { bool operator!=(nullptr_t, const function& f) noexcept; // (2) C++11 } ``` -* nullptr_t[link /reference/cstddef/nullptr_t.md] ## 概要 非等値比較する。 diff --git a/reference/functional/function_ref/op_call.md b/reference/functional/function_ref/op_call.md index b6efb183f4..7384477dba 100644 --- a/reference/functional/function_ref/op_call.md +++ b/reference/functional/function_ref/op_call.md @@ -23,7 +23,6 @@ return thunk-ptr(bound-entity, std::forward(args)...); ``` * thunk-ptr[italic] * bound-entity[italic] -* std::forward[link /reference/utility/forward.md] ## 戻り値 diff --git a/reference/functional/greater.md b/reference/functional/greater.md index 9a045336d9..449188cdd5 100644 --- a/reference/functional/greater.md +++ b/reference/functional/greater.md @@ -45,7 +45,6 @@ namespace std { } ``` * unspecified[italic] -* std::forward[link ../utility/forward.md] ## 概要 `greater`クラスは、左辺が右辺より大きいかの比較を行う関数オブジェクトである。 diff --git a/reference/functional/greater_equal.md b/reference/functional/greater_equal.md index 5987491d9a..1aee31791c 100644 --- a/reference/functional/greater_equal.md +++ b/reference/functional/greater_equal.md @@ -45,7 +45,6 @@ namespace std { } ``` * unspecified[italic] -* std::forward[link ../utility/forward.md] ## 概要 `greater_equal`クラスは、左辺が右辺以上かの比較を行う関数オブジェクトである。 diff --git a/reference/functional/invoke.md b/reference/functional/invoke.md index 40e9cddeee..d353ec9a12 100644 --- a/reference/functional/invoke.md +++ b/reference/functional/invoke.md @@ -15,7 +15,6 @@ namespace std { noexcept(is_nothrow_invocable_v); //C++20 } ``` -* invoke_result_t[link /reference/type_traits/invoke_result.md] * is_nothrow_invocable_v[link /reference/type_traits/is_nothrow_invocable.md] ## 概要 diff --git a/reference/functional/less.md b/reference/functional/less.md index 01754e240d..f611f9c33e 100644 --- a/reference/functional/less.md +++ b/reference/functional/less.md @@ -45,7 +45,6 @@ namespace std { } ``` * unspecified[italic] -* std::forward[link ../utility/forward.md] ## 概要 `less`クラスは、左辺が右辺より小さいかの比較を行う関数オブジェクトである。 diff --git a/reference/functional/less_equal.md b/reference/functional/less_equal.md index 7c641fab33..0393fa9297 100644 --- a/reference/functional/less_equal.md +++ b/reference/functional/less_equal.md @@ -45,7 +45,6 @@ namespace std { } ``` * unspecified[italic] -* std::forward[link ../utility/forward.md] ## 概要 `less_equal`クラスは、左辺が右辺以下かの比較を行う関数オブジェクトである。 diff --git a/reference/functional/logical_and.md b/reference/functional/logical_and.md index aedeea060c..01f433166a 100644 --- a/reference/functional/logical_and.md +++ b/reference/functional/logical_and.md @@ -45,7 +45,6 @@ namespace std { } ``` * unspecified[italic] -* std::forward[link ../utility/forward.md] ## 概要 `logical_and`クラスは、論理積(AND)を計算する関数オブジェクトである。 diff --git a/reference/functional/logical_not.md b/reference/functional/logical_not.md index 1f23ee56dc..96700b15a9 100644 --- a/reference/functional/logical_not.md +++ b/reference/functional/logical_not.md @@ -43,7 +43,6 @@ namespace std { } ``` * unspecified[italic] -* std::forward[link ../utility/forward.md] ## 概要 `logical_not`クラスは、論理否定(NOT)を計算する関数オブジェクトである。 diff --git a/reference/functional/logical_or.md b/reference/functional/logical_or.md index aa1bd06e8e..eef431f0d9 100644 --- a/reference/functional/logical_or.md +++ b/reference/functional/logical_or.md @@ -45,7 +45,6 @@ namespace std { } ``` * unspecified[italic] -* std::forward[link ../utility/forward.md] ## 概要 `logical_or`クラスは、論理和(OR)を計算する関数オブジェクトである。 diff --git a/reference/functional/minus.md b/reference/functional/minus.md index 5e56e8b9a2..97efc34985 100644 --- a/reference/functional/minus.md +++ b/reference/functional/minus.md @@ -45,7 +45,6 @@ namespace std { } ``` * unspecified[italic] -* std::forward[link ../utility/forward.md] ## 概要 `minus`クラスは、減算を行う関数オブジェクトである。 diff --git a/reference/functional/modulus.md b/reference/functional/modulus.md index ad84fc0b6f..6f35078097 100644 --- a/reference/functional/modulus.md +++ b/reference/functional/modulus.md @@ -45,7 +45,6 @@ namespace std { } ``` * unspecified[italic] -* std::forward[link ../utility/forward.md] ## 概要 `modulus`クラスは、剰余算を行う関数オブジェクトである。 diff --git a/reference/functional/move_only_function.md b/reference/functional/move_only_function.md index ab24a4fc69..8ebd6e675a 100644 --- a/reference/functional/move_only_function.md +++ b/reference/functional/move_only_function.md @@ -255,7 +255,6 @@ int main() ``` * std::move_only_function[color ff0000] * std::function[link /reference/functional/function.md] -* std::unique_ptr[link /reference/memory/unique_ptr.md] * std::make_unique[link /reference/memory/make_unique.md] * std::move[link /reference/utility/move.md] diff --git a/reference/functional/move_only_function/op_equal.md b/reference/functional/move_only_function/op_equal.md index f885652e71..d33228772d 100644 --- a/reference/functional/move_only_function/op_equal.md +++ b/reference/functional/move_only_function/op_equal.md @@ -11,7 +11,6 @@ friend bool operator==(const move_only_function& f, nullptr_t) noexcept; // (1) // (1)により、以下のオーバーロードが使用可能になる friend bool operator==(nullptr_t, const move_only_function& f) noexcept; // (2) ``` -* nullptr_t[link /reference/cstddef/nullptr_t.md] ## 概要 等値比較する。 diff --git a/reference/functional/move_only_function/op_not_equal.md b/reference/functional/move_only_function/op_not_equal.md index b1f6ba926e..83c93c710e 100644 --- a/reference/functional/move_only_function/op_not_equal.md +++ b/reference/functional/move_only_function/op_not_equal.md @@ -11,7 +11,6 @@ bool operator!=(const move_only_function& f, nullptr_t) noexcept; // (1) bool operator!=(nullptr_t, const move_only_function& f) noexcept; // (2) ``` -* nullptr_t[link /reference/cstddef/nullptr_t.md] ## 概要 非等値比較する。 diff --git a/reference/functional/multiplies.md b/reference/functional/multiplies.md index 93e23623fc..c24c69e374 100644 --- a/reference/functional/multiplies.md +++ b/reference/functional/multiplies.md @@ -45,7 +45,6 @@ namespace std { } ``` * unspecified[italic] -* std::forward[link ../utility/forward.md] ## 概要 `multiplies`クラスは、乗算を行う関数オブジェクトである。 diff --git a/reference/functional/negate.md b/reference/functional/negate.md index 92f0cafd73..2339a97ee6 100644 --- a/reference/functional/negate.md +++ b/reference/functional/negate.md @@ -44,7 +44,6 @@ namespace std { } ``` * unspecified[italic] -* std::forward[link ../utility/forward.md] ## 概要 `negate`クラスは、符号反転を行う関数オブジェクトである。 diff --git a/reference/functional/not_equal_to.md b/reference/functional/not_equal_to.md index f7340e312e..85b3aef8f6 100644 --- a/reference/functional/not_equal_to.md +++ b/reference/functional/not_equal_to.md @@ -45,7 +45,6 @@ namespace std { } ``` * unspecified[italic] -* std::forward[link ../utility/forward.md] ## 概要 `not_equal_to`クラスは、非等値比較を行う関数オブジェクトである。 diff --git a/reference/functional/not_fn.md b/reference/functional/not_fn.md index f63fe22bb1..ea7950ec67 100644 --- a/reference/functional/not_fn.md +++ b/reference/functional/not_fn.md @@ -63,9 +63,6 @@ private: FD fd; }; ``` -* decay_t[link /reference/type_traits/decay.md] -* declval[link /reference/utility/declval.md] -* invoke_result_t[link /reference/type_traits/invoke_result.md] このクラスのコンストラクタは、式`fd =` [`std::forward`](/reference/utility/forward.md)`(f)`を実行する。この式が例外を送出する可能性がある。 diff --git a/reference/functional/plus.md b/reference/functional/plus.md index c733683b93..a2eabaf9d9 100644 --- a/reference/functional/plus.md +++ b/reference/functional/plus.md @@ -45,7 +45,6 @@ namespace std { } ``` * unspecified[italic] -* std::forward[link ../utility/forward.md] ## 概要 `plus`クラスは、加算を行う関数オブジェクトである。 diff --git a/reference/future/async.md b/reference/future/async.md index e9c5fd0d7c..ab7eb2f97d 100644 --- a/reference/future/async.md +++ b/reference/future/async.md @@ -49,9 +49,7 @@ namespace std { * future[link future.md] * launch[link launch.md] * result_of[link /reference/type_traits/result_of.md] -* invoke_result_t[link /reference/type_traits/invoke_result.md] * decay[link /reference/type_traits/decay.md] -* decay_t[link /reference/type_traits/decay.md] ## 概要 関数を非同期実行する。 @@ -168,7 +166,6 @@ int main() * std::launch::async[link launch.md] * std::launch::deferred[link launch.md] * std::future[link future.md] -* std::this_thread::sleep_for[link /reference/thread/this_thread/sleep_for.md] * f.get()[link future/get.md] ### 出力 diff --git a/reference/future/make_error_condition.md b/reference/future/make_error_condition.md index 613424f25e..1236d616b0 100644 --- a/reference/future/make_error_condition.md +++ b/reference/future/make_error_condition.md @@ -45,7 +45,6 @@ int main() * ec.category()[link /reference/system_error/error_condition/category.md] * name()[link /reference/system_error/error_category/name.md] * ec.value()[link /reference/system_error/error_condition/value.md] -* ec.message()[link /reference/system_error/error_condition/message.md] ### 出力例 ``` diff --git a/reference/generator/generator/end.md b/reference/generator/generator/end.md index c7289fa6d8..d295a8b2c0 100644 --- a/reference/generator/generator/end.md +++ b/reference/generator/generator/end.md @@ -8,7 +8,6 @@ ```cpp default_sentinel_t end() const noexcept; ``` -* default_sentinel_t[link /reference/iterator/default_sentinel_t.md] ## 概要 ジェネレータコルーチンが生成するViewの番兵を取得する。 diff --git a/reference/generator/generator/iterator/op_equal.md b/reference/generator/generator/iterator/op_equal.md index fcb783956a..c0c3cde4ca 100644 --- a/reference/generator/generator/iterator/op_equal.md +++ b/reference/generator/generator/iterator/op_equal.md @@ -11,7 +11,6 @@ friend bool operator==(const iterator& i, default_sentinel_t); // operator==により、以下の演算子が使用可能になる friend bool operator!=(const iterator& i, default_sentinel_t); ``` -* default_sentinel_t[link /reference/iterator/default_sentinel_t.md] ## 概要 ジェネレータコルーチンのイテレータが終端まで到達したか否かを判定する。 diff --git a/reference/generator/generator/promise_type/op_new.md b/reference/generator/generator/promise_type/op_new.md index 19c0ffee44..85df4115a8 100644 --- a/reference/generator/generator/promise_type/op_new.md +++ b/reference/generator/generator/promise_type/op_new.md @@ -17,8 +17,6 @@ template requires same_as || convertible_to void* operator new(size_t size, const This&, allocator_arg_t, const Alloc& alloc, const Args&...); ``` -* default_initializable[link /reference/concepts/default_initializable.md] -* convertible_to[link /reference/concepts/convertible_to.md] * allocator_arg_t[link /reference/memory/allocator_arg_t.md] diff --git a/reference/generator/generator/promise_type/yield_value.md b/reference/generator/generator/promise_type/yield_value.md index ca95b2820a..22afd56604 100644 --- a/reference/generator/generator/promise_type/yield_value.md +++ b/reference/generator/generator/promise_type/yield_value.md @@ -26,10 +26,8 @@ auto yield_value(ranges::elements_of r) noexcept; // (4) * ranges::input_range[link /reference/ranges/input_range.md] * ranges::elements_of[link /reference/ranges/elements_of.md] * ranges::range_reference_t[link /reference/ranges/range_reference_t.md] -* remove_reference_t[link /reference/type_traits/remove_reference.md] * is_rvalue_reference_v[link /reference/type_traits/is_rvalue_reference.md] * constructible_from[link /reference/concepts/constructible_from.md] -* convertible_to[link /reference/concepts/convertible_to.md] ## 概要 @@ -48,7 +46,6 @@ auto yield_value(ranges::elements_of r) noexcept; // (4) value_ = addressof(val) ``` * value_[link ../promise_type.md] -* addressof[link /reference/memory/addressof.md] (4) : 以下と等価 ```cpp @@ -73,8 +70,6 @@ return yield_value(ranges::elements_of(nested( * ranges::elements_of[link /reference/ranges/elements_of.md] * r.range[link /reference/ranges/elements_of.md] * r.allocator[link /reference/ranges/elements_of.md] -* ranges::begin[link /reference/ranges/begin.md] -* ranges::end[link /reference/ranges/end.md] ## 戻り値 diff --git a/reference/initializer_list/initializer_list/end_free.md b/reference/initializer_list/initializer_list/end_free.md index cf0f08c158..b304f328d1 100644 --- a/reference/initializer_list/initializer_list/end_free.md +++ b/reference/initializer_list/initializer_list/end_free.md @@ -43,7 +43,6 @@ int main() } ``` * std::end[color ff0000] -* std::begin[link begin_free.md] ### 出力 ``` diff --git a/reference/ios/ios_base/setf.md b/reference/ios/ios_base/setf.md index 7b8ab15097..9737d3412e 100644 --- a/reference/ios/ios_base/setf.md +++ b/reference/ios/ios_base/setf.md @@ -54,7 +54,6 @@ int main() ``` * std::hex[link ../hex.md] * std::dec[link ../dec.md] -* std::boolalpha[link ../boolalpha.md] * std::noboolalpha[link ../noboolalpha.md] * std::ios_base[link ../ios_base.md] * setf[color ff0000] diff --git a/reference/ios/ios_base/type-fmtflags.md b/reference/ios/ios_base/type-fmtflags.md index 961545911b..f367166b45 100644 --- a/reference/ios/ios_base/type-fmtflags.md +++ b/reference/ios/ios_base/type-fmtflags.md @@ -63,7 +63,6 @@ int main() std::cout << true << ", " << false << "\n"; } ``` -* std::boolalpha[link ../boolalpha.md] * std::noboolalpha[link ../noboolalpha.md] * boolalpha[color ff0000] diff --git a/reference/ios/ios_base/type-iostate.md b/reference/ios/ios_base/type-iostate.md index c03dd199a1..d6ce6661d6 100644 --- a/reference/ios/ios_base/type-iostate.md +++ b/reference/ios/ios_base/type-iostate.md @@ -61,7 +61,6 @@ int main() printstate(iss.rdstate()); } ``` -* std::istringstream[link ../../sstream/basic_istringstream.md] * std::ios_base[link ../ios_base.md] * iostate[color ff0000] * badbit[color ff0000] diff --git a/reference/ios/ios_base/unsetf.md b/reference/ios/ios_base/unsetf.md index df86397c51..9ba3a64da4 100644 --- a/reference/ios/ios_base/unsetf.md +++ b/reference/ios/ios_base/unsetf.md @@ -61,7 +61,6 @@ int main() std::cout << std::defaultfloat << 123.456 << '\n'; // C++11 から } ``` -* std::boolalpha[link ../boolalpha.md] * std::noboolalpha[link ../noboolalpha.md] * std::scientific[link ../scientific.md] * std::fixed[link ../fixed.md] diff --git a/reference/ios/make_error_condition.md b/reference/ios/make_error_condition.md index e52c2b7c3a..555e917add 100644 --- a/reference/ios/make_error_condition.md +++ b/reference/ios/make_error_condition.md @@ -44,7 +44,6 @@ int main() * ec.category()[link /reference/system_error/error_code/category.md] * name()[link /reference/system_error/error_category/name.md] * ec.value()[link /reference/system_error/error_condition/value.md] -* ec.message()[link /reference/system_error/error_condition/message.md] ### 出力例 ``` diff --git a/reference/ios/noskipws.md b/reference/ios/noskipws.md index 0bf4f1744e..3fb7a38eb1 100644 --- a/reference/ios/noskipws.md +++ b/reference/ios/noskipws.md @@ -37,7 +37,6 @@ int main() } ``` * std::noskipws[color ff0000] -* std::istringstream[link /reference/sstream/basic_istringstream.md] * s.seekg[link /reference/istream/basic_istream/seekg.md] * std::ios_base[link ios_base.md] * beg[link ios_base/type-seekdir.md] diff --git a/reference/ios/skipws.md b/reference/ios/skipws.md index 9b65671476..5c87ae1363 100644 --- a/reference/ios/skipws.md +++ b/reference/ios/skipws.md @@ -38,7 +38,6 @@ int main() ``` * std::skipws[color ff0000] * std::noskipws[link noskipws.md] -* std::istringstream[link /reference/sstream/basic_istringstream.md] * s.seekg[link /reference/istream/basic_istream/seekg.md] * std::ios_base[link ios_base.md] * beg[link ios_base/type-seekdir.md] diff --git a/reference/istream/basic_istream/readsome.md b/reference/istream/basic_istream/readsome.md index 631d7ea0d7..8c19828a5d 100644 --- a/reference/istream/basic_istream/readsome.md +++ b/reference/istream/basic_istream/readsome.md @@ -42,7 +42,6 @@ int main() { } ``` * readsome[color ff0000] -* std::istringstream[link /reference/sstream/basic_istringstream.md] ### 出力 ``` diff --git a/reference/istream/basic_istream/seekg.md b/reference/istream/basic_istream/seekg.md index 4797bac576..035ab52c80 100644 --- a/reference/istream/basic_istream/seekg.md +++ b/reference/istream/basic_istream/seekg.md @@ -50,7 +50,6 @@ int main() { } ``` * seekg[color ff0000] -* std::istringstream[link /reference/sstream/basic_istringstream.md] * std::ios_base[link /reference/ios/ios_base.md] * beg[link /reference/ios/ios_base/type-seekdir.md] diff --git a/reference/istream/basic_istream/tellg.md b/reference/istream/basic_istream/tellg.md index cb1dfcb36e..dd8b2b9451 100644 --- a/reference/istream/basic_istream/tellg.md +++ b/reference/istream/basic_istream/tellg.md @@ -45,7 +45,6 @@ int main() { } ``` * tellg()[color ff0000] -* std::istringstream[link /reference/sstream/basic_istringstream.md] * seekg[link seekg.md] ### 出力 diff --git a/reference/istream/basic_istream/unget.md b/reference/istream/basic_istream/unget.md index d15f23f97c..a69cac2886 100644 --- a/reference/istream/basic_istream/unget.md +++ b/reference/istream/basic_istream/unget.md @@ -60,7 +60,6 @@ int main() { * std::isalpha[link /reference/locale/isalpha.md.nolink] * getloc()[link /reference/ios/ios_base/getloc.md] * push_back[link /reference/string/basic_string/push_back.md] -* std::istringstream[link /reference/sstream/basic_istringstream.md] * rdbuf()[link /reference/ios/basic_ios/rdbuf.md] ### 出力 diff --git a/reference/iterator/basic_const_iterator.md b/reference/iterator/basic_const_iterator.md index b73036e646..ef970ee8d1 100644 --- a/reference/iterator/basic_const_iterator.md +++ b/reference/iterator/basic_const_iterator.md @@ -10,7 +10,6 @@ namespace std { class basic_const_iterator; } ``` -* input_iterator[link ./input_iterator.md] ## 概要 diff --git a/reference/iterator/basic_const_iterator/common_type.md b/reference/iterator/basic_const_iterator/common_type.md index 3702dd0324..133aa1f185 100644 --- a/reference/iterator/basic_const_iterator/common_type.md +++ b/reference/iterator/basic_const_iterator/common_type.md @@ -28,10 +28,7 @@ namespace std { }; } ``` -* common_with[link /reference/concepts/common_with.md] -* input_iterator[link /reference/iterator/input_iterator.md] * common_type[link /reference/type_traits/common_type.md] -* common_type_t[link /reference/type_traits/common_type.md] ## 概要 diff --git a/reference/iterator/basic_const_iterator/iter_move.md b/reference/iterator/basic_const_iterator/iter_move.md index 8cb1348f2b..1614858ef7 100644 --- a/reference/iterator/basic_const_iterator/iter_move.md +++ b/reference/iterator/basic_const_iterator/iter_move.md @@ -26,7 +26,6 @@ using rvalue-reference = common_reference_t&&, iter ```cpp return static_cast(ranges::iter_move(i.current_)); ``` -* ranges::iter_move[link /reference/iterator/iter_move.md] ## 例外 @@ -63,7 +62,6 @@ int main() { } ``` * iter_move[color ff0000] -* ranges::iter_move[link /reference/iterator/iter_move.md] ### 出力 ``` diff --git a/reference/iterator/basic_const_iterator/op_arrow.md b/reference/iterator/basic_const_iterator/op_arrow.md index cd01a78f74..fff40dd19a 100644 --- a/reference/iterator/basic_const_iterator/op_arrow.md +++ b/reference/iterator/basic_const_iterator/op_arrow.md @@ -12,8 +12,6 @@ constexpr const auto* operator->() const ``` * is_lvalue_reference_v[link /reference/type_traits/is_lvalue_reference.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] -* same_as[link /reference/concepts/same_as.md] -* remove_cvref_t[link /reference/type_traits/remove_cvref.md] ## 概要 diff --git a/reference/iterator/basic_const_iterator/op_at.md b/reference/iterator/basic_const_iterator/op_at.md index 121d7e55b1..0611b0f746 100644 --- a/reference/iterator/basic_const_iterator/op_at.md +++ b/reference/iterator/basic_const_iterator/op_at.md @@ -9,7 +9,6 @@ constexpr reference operator[](difference_type n) const requires random_access_iterator; ``` -* random_access_iterator[link /reference/iterator/random_access_iterator.md] ## 概要 diff --git a/reference/iterator/basic_const_iterator/op_compare_3way.md b/reference/iterator/basic_const_iterator/op_compare_3way.md index 1af8a59ffb..4887a436b3 100644 --- a/reference/iterator/basic_const_iterator/op_compare_3way.md +++ b/reference/iterator/basic_const_iterator/op_compare_3way.md @@ -15,8 +15,6 @@ constexpr auto operator<=>(const I& y) const three_way_comparable_with; // (2) ``` * different-from[link /reference/ranges/different-from.md] -* random_access_iterator[link /reference/iterator/random_access_iterator.md] -* three_way_comparable[link /reference/compare/three_way_comparable.md] * totally_ordered_with[link /reference/concepts/totally_ordered.md] ## 概要 diff --git a/reference/iterator/basic_const_iterator/op_constructor.md b/reference/iterator/basic_const_iterator/op_constructor.md index 4a0e0688c8..251c2c5517 100644 --- a/reference/iterator/basic_const_iterator/op_constructor.md +++ b/reference/iterator/basic_const_iterator/op_constructor.md @@ -17,8 +17,6 @@ template T> requires convertible_to constexpr basic_const_iterator(T&& current); // (4) ``` -* default_initializable[link /reference/concepts/default_initializable.md] -* convertible_to[link /reference/concepts/convertible_to.md] * different-from[link /reference/ranges/different-from.md] ## 概要 diff --git a/reference/iterator/basic_const_iterator/op_decrement.md b/reference/iterator/basic_const_iterator/op_decrement.md index 635a410b9d..62bd962186 100644 --- a/reference/iterator/basic_const_iterator/op_decrement.md +++ b/reference/iterator/basic_const_iterator/op_decrement.md @@ -10,7 +10,6 @@ constexpr basic_const_iterator& operator--() requires bidirectional_iterator; // (2) ``` -* bidirectional_iterator[link /reference/iterator/bidirectional_iterator.md] ## 概要 diff --git a/reference/iterator/basic_const_iterator/op_equal.md b/reference/iterator/basic_const_iterator/op_equal.md index dc3b1a55c4..e03f6a37ca 100644 --- a/reference/iterator/basic_const_iterator/op_equal.md +++ b/reference/iterator/basic_const_iterator/op_equal.md @@ -9,7 +9,6 @@ template S> constexpr bool operator==(const S& s) const; ``` -* sentinel_for[link /reference/iterator/sentinel_for.md] ## 概要 diff --git a/reference/iterator/basic_const_iterator/op_greater.md b/reference/iterator/basic_const_iterator/op_greater.md index 1ab08feab8..ffe9d1ef61 100644 --- a/reference/iterator/basic_const_iterator/op_greater.md +++ b/reference/iterator/basic_const_iterator/op_greater.md @@ -17,7 +17,6 @@ template friend constexpr bool operator>(const I& x, const basic_const_iterator& y) requires random_access_iterator && totally_ordered_with; // (3) 非メンバ関数 ``` -* random_access_iterator[link /reference/iterator/random_access_iterator.md] * totally_ordered_with[link /reference/concepts/totally_ordered.md] * different-from[link /reference/ranges/different-from.md] diff --git a/reference/iterator/basic_const_iterator/op_greater_equal.md b/reference/iterator/basic_const_iterator/op_greater_equal.md index 36c64b3e4f..ef2b7a5e7b 100644 --- a/reference/iterator/basic_const_iterator/op_greater_equal.md +++ b/reference/iterator/basic_const_iterator/op_greater_equal.md @@ -17,7 +17,6 @@ template friend constexpr bool operator>=(const I& x, const basic_const_iterator& y) requires random_access_iterator && totally_ordered_with; // (3) 非メンバ関数 ``` -* random_access_iterator[link /reference/iterator/random_access_iterator.md] * totally_ordered_with[link /reference/concepts/totally_ordered.md] * different-from[link /reference/ranges/different-from.md] diff --git a/reference/iterator/basic_const_iterator/op_increment.md b/reference/iterator/basic_const_iterator/op_increment.md index 36ca5873f3..5f68154979 100644 --- a/reference/iterator/basic_const_iterator/op_increment.md +++ b/reference/iterator/basic_const_iterator/op_increment.md @@ -11,7 +11,6 @@ constexpr basic_const_iterator& operator++(); // (1) constexpr void operator++(int); // (2) constexpr basic_const_iterator operator++(int) requires forward_iterator; // (3) ``` -* forward_iterator[link /reference/iterator/forward_iterator.md] ## 概要 diff --git a/reference/iterator/basic_const_iterator/op_less.md b/reference/iterator/basic_const_iterator/op_less.md index d8da4d0b8f..3315a27a10 100644 --- a/reference/iterator/basic_const_iterator/op_less.md +++ b/reference/iterator/basic_const_iterator/op_less.md @@ -17,7 +17,6 @@ template friend constexpr bool operator<(const I& x, const basic_const_iterator& y) requires random_access_iterator && totally_ordered_with; // (3) 非メンバ関数 ``` -* random_access_iterator[link /reference/iterator/random_access_iterator.md] * totally_ordered_with[link /reference/concepts/totally_ordered.md] * different-from[link /reference/ranges/different-from.md] diff --git a/reference/iterator/basic_const_iterator/op_less_equal.md b/reference/iterator/basic_const_iterator/op_less_equal.md index 13fb1c0ff5..034673e0e6 100644 --- a/reference/iterator/basic_const_iterator/op_less_equal.md +++ b/reference/iterator/basic_const_iterator/op_less_equal.md @@ -17,7 +17,6 @@ template friend constexpr bool operator<=(const I& x, const basic_const_iterator& y) requires random_access_iterator && totally_ordered_with; // (3) 非メンバ関数 ``` -* random_access_iterator[link /reference/iterator/random_access_iterator.md] * totally_ordered_with[link /reference/concepts/totally_ordered.md] * different-from[link /reference/ranges/different-from.md] diff --git a/reference/iterator/basic_const_iterator/op_minus_assign.md b/reference/iterator/basic_const_iterator/op_minus_assign.md index 4e54866dd2..e541d90001 100644 --- a/reference/iterator/basic_const_iterator/op_minus_assign.md +++ b/reference/iterator/basic_const_iterator/op_minus_assign.md @@ -9,7 +9,6 @@ constexpr basic_const_iterator& operator-=(difference_type n) requires random_access_iterator; ``` -* random_access_iterator[link /reference/iterator/random_access_iterator.md] ## 概要 diff --git a/reference/iterator/basic_const_iterator/op_plus.md b/reference/iterator/basic_const_iterator/op_plus.md index a3b0c83245..7299195124 100644 --- a/reference/iterator/basic_const_iterator/op_plus.md +++ b/reference/iterator/basic_const_iterator/op_plus.md @@ -11,7 +11,6 @@ friend constexpr basic_const_iterator operator+(const basic_const_iterator& i, d friend constexpr basic_const_iterator operator+(difference_type n, const basic_const_iterator& i) // (2) ``` -* random_access_iterator[link /reference/iterator/random_access_iterator.md] ## 概要 diff --git a/reference/iterator/basic_const_iterator/op_plus_assign.md b/reference/iterator/basic_const_iterator/op_plus_assign.md index 741efcdb52..8a4b2da398 100644 --- a/reference/iterator/basic_const_iterator/op_plus_assign.md +++ b/reference/iterator/basic_const_iterator/op_plus_assign.md @@ -9,7 +9,6 @@ constexpr basic_const_iterator& operator+=(difference_type n) requires random_access_iterator; ``` -* random_access_iterator[link /reference/iterator/random_access_iterator.md] ## 概要 diff --git a/reference/iterator/basic_const_iterator/op_unary_minus.md b/reference/iterator/basic_const_iterator/op_unary_minus.md index 7b1f974788..83b3493d3a 100644 --- a/reference/iterator/basic_const_iterator/op_unary_minus.md +++ b/reference/iterator/basic_const_iterator/op_unary_minus.md @@ -9,7 +9,6 @@ friend constexpr basic_const_iterator operator-(const basic_const_iterator& i, difference_type n) requires random_access_iterator; ``` -* random_access_iterator[link /reference/iterator/random_access_iterator.md] ## 概要 diff --git a/reference/iterator/bidirectional_iterator.md b/reference/iterator/bidirectional_iterator.md index c604a34e72..02529f8e94 100644 --- a/reference/iterator/bidirectional_iterator.md +++ b/reference/iterator/bidirectional_iterator.md @@ -16,7 +16,6 @@ namespace std { }; } ``` -* forward_iterator[link forward_iterator.md] * derived_from[link /reference/concepts/derived_from.md] * ITER_CONCEPT[link /reference/iterator/input_iterator.md#iter_concept] * bidirectional_iterator_tag[link iterator_tag.md] diff --git a/reference/iterator/cbegin.md b/reference/iterator/cbegin.md index 1be42dc089..4d42d9fa50 100644 --- a/reference/iterator/cbegin.md +++ b/reference/iterator/cbegin.md @@ -12,7 +12,6 @@ namespace std { -> decltype(std::begin(c)); } ``` -* std::begin[link begin.md] ## 概要 範囲から先頭要素への読み取り専用イテレータを取得する。 diff --git a/reference/iterator/cend.md b/reference/iterator/cend.md index db2ff91cd6..f3e5c93f73 100644 --- a/reference/iterator/cend.md +++ b/reference/iterator/cend.md @@ -12,7 +12,6 @@ namespace std { -> decltype(std::end(c)); } ``` -* std::end[link end.md] ## 概要 範囲から、最後尾要素の次を指す読み取り専用イテレータを取得する。 diff --git a/reference/iterator/common_iterator.md b/reference/iterator/common_iterator.md index 3ed5352869..7287a48e7d 100644 --- a/reference/iterator/common_iterator.md +++ b/reference/iterator/common_iterator.md @@ -35,13 +35,9 @@ namespace std { ``` * see below[italic] * input_or_output_iterator[link /reference/iterator/input_or_output_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * copyable[link /reference/concepts/copyable.md] * variant[link /reference/variant/variant.md] * incrementable_traits[link /reference/iterator/incrementable_traits.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] -* iterator_traits[link /reference/iterator/iterator_traits.md] -* iter_value_t[link /reference/iterator/iter_value_t.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] ## 概要 @@ -116,10 +112,6 @@ int main() { * std::common_iterator[color ff0000] * views::iota[link /reference/ranges/iota_view.md] * views::take[link /reference/ranges/take_view.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* sentinel_t[link /reference/ranges/sentinel_t.md] -* ranges::begin[link /reference/ranges/begin.md] -* ranges::end[link /reference/ranges/end.md] ### 出力 diff --git a/reference/iterator/common_iterator/iter_move.md b/reference/iterator/common_iterator/iter_move.md index 3b111f3346..9fee37512a 100644 --- a/reference/iterator/common_iterator/iter_move.md +++ b/reference/iterator/common_iterator/iter_move.md @@ -17,9 +17,6 @@ namespace std { } ``` * input_or_output_iterator[link /reference/iterator/input_or_output_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* ranges::iter_move[link /reference/iterator/iter_move.md] -* input_iterator[link /reference/iterator/input_iterator.md] ## 概要 @@ -36,7 +33,6 @@ namespace std { ```cpp return ranges::iter_move(get(i.v_)); ``` -* ranges::iter_move[link /reference/iterator/iter_move.md] ## 備考 @@ -70,7 +66,6 @@ int main() { } ``` * iter_move[color ff0000] -* ranges::iter_move[link /reference/iterator/iter_move.md] ### 出力 ``` diff --git a/reference/iterator/common_iterator/iter_swap.md b/reference/iterator/common_iterator/iter_swap.md index d6c283432d..f3f103619d 100644 --- a/reference/iterator/common_iterator/iter_swap.md +++ b/reference/iterator/common_iterator/iter_swap.md @@ -17,8 +17,6 @@ namespace std { } ``` * input_or_output_iterator[link /reference/iterator/input_or_output_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* indirectly_swappable[link /reference/iterator/indirectly_swappable.md] ## 概要 @@ -35,7 +33,6 @@ namespace std { ```cpp return ranges::iter_swap(get(x.v_), get(y.v_)); ``` -* ranges::iter_swap[link /reference/iterator/iter_swap.md] ## 備考 @@ -80,7 +77,6 @@ int main() { } ``` * iter_swap[color ff0000] -* ranges::iter_swap[link /reference/iterator/iter_swap.md] ### 出力 ``` diff --git a/reference/iterator/common_iterator/op_arrow.md b/reference/iterator/common_iterator/op_arrow.md index 7ece47fc32..6e315bc108 100644 --- a/reference/iterator/common_iterator/op_arrow.md +++ b/reference/iterator/common_iterator/op_arrow.md @@ -27,7 +27,6 @@ indirectly_readable && * is_reference_v[link /reference/type_traits/is_reference.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] * constructible_from[link /reference/concepts/constructible_from.md] -* iter_value_t[link /reference/iterator/iter_value_t.md] ## 事前条件 @@ -44,7 +43,6 @@ indirectly_readable && auto&& tmp = *get(v_); return addressof(tmp); ``` - * addressof[link /reference/memory/addressof.md] - それ以外の場合 : `return proxy(*get(v_));` `proxy`は次のように定義される説明専用のクラス。 @@ -60,8 +58,6 @@ indirectly_readable && }; ``` * iter_reference_t[link /reference/iterator/iter_reference_t.md] - * iter_value_t[link /reference/iterator/iter_value_t.md] - * addressof[link /reference/memory/addressof.md] ## バージョン ### 言語 diff --git a/reference/iterator/common_iterator/op_assign.md b/reference/iterator/common_iterator/op_assign.md index b86eb379ca..c6dcc4cbde 100644 --- a/reference/iterator/common_iterator/op_assign.md +++ b/reference/iterator/common_iterator/op_assign.md @@ -12,7 +12,6 @@ template common_iterator& operator=(const common_iterator& x); ``` * assignable_from[link /reference/concepts/assignable_from.md] -* convertible_to[link /reference/concepts/convertible_to.md] ## 概要 diff --git a/reference/iterator/common_iterator/op_constructor.md b/reference/iterator/common_iterator/op_constructor.md index 6f470c8934..06d76b6d16 100644 --- a/reference/iterator/common_iterator/op_constructor.md +++ b/reference/iterator/common_iterator/op_constructor.md @@ -17,8 +17,6 @@ template convertible_to constexpr common_iterator(const common_iterator& x); // (4) ``` -* default_initializable[link /reference/concepts/default_initializable.md] -* convertible_to[link /reference/concepts/convertible_to.md] ## 概要 @@ -68,10 +66,6 @@ int main() { * std::common_iterator[color ff0000] * views::iota[link /reference/ranges/iota_view.md] * views::take[link /reference/ranges/take_view.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* sentinel_t[link /reference/ranges/sentinel_t.md] -* ranges::begin[link /reference/ranges/begin.md] -* ranges::end[link /reference/ranges/end.md] ### 出力 ``` diff --git a/reference/iterator/common_iterator/op_deref.md b/reference/iterator/common_iterator/op_deref.md index 5058f262bb..12713f9c64 100644 --- a/reference/iterator/common_iterator/op_deref.md +++ b/reference/iterator/common_iterator/op_deref.md @@ -48,9 +48,6 @@ int main() { * *ci[color ff0000] * views::iota[link /reference/ranges/iota_view.md] * views::take[link /reference/ranges/take_view.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* sentinel_t[link /reference/ranges/sentinel_t.md] -* ranges::begin[link /reference/ranges/begin.md] ### 出力 ``` diff --git a/reference/iterator/common_iterator/op_equal.md b/reference/iterator/common_iterator/op_equal.md index 67cae50ff1..e114474481 100644 --- a/reference/iterator/common_iterator/op_equal.md +++ b/reference/iterator/common_iterator/op_equal.md @@ -21,7 +21,6 @@ namespace std { } ``` * input_or_output_iterator[link /reference/iterator/input_or_output_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * equality_comparable_with[link /reference/concepts/equality_comparable.md] ## 概要 @@ -86,9 +85,6 @@ int main() { ``` * views::iota[link /reference/ranges/iota_view.md] * views::take[link /reference/ranges/take_view.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* sentinel_t[link /reference/ranges/sentinel_t.md] -* ranges::begin[link /reference/ranges/begin.md] ### 出力 ``` diff --git a/reference/iterator/common_iterator/op_increment.md b/reference/iterator/common_iterator/op_increment.md index 8706b1013f..78dc410494 100644 --- a/reference/iterator/common_iterator/op_increment.md +++ b/reference/iterator/common_iterator/op_increment.md @@ -65,9 +65,6 @@ int main() { * ++ci[color ff0000] * views::iota[link /reference/ranges/iota_view.md] * views::take[link /reference/ranges/take_view.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* sentinel_t[link /reference/ranges/sentinel_t.md] -* ranges::begin[link /reference/ranges/begin.md] ### 出力 ``` diff --git a/reference/iterator/common_iterator/op_minus.md b/reference/iterator/common_iterator/op_minus.md index b71ef55730..cb429e501b 100644 --- a/reference/iterator/common_iterator/op_minus.md +++ b/reference/iterator/common_iterator/op_minus.md @@ -17,9 +17,7 @@ namespace std { } ``` * input_or_output_iterator[link /reference/iterator/input_or_output_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] ## 概要 @@ -63,8 +61,6 @@ int main() { } ``` * counted_iterator[link /reference/iterator/counted_iterator.md] -* default_sentinel_t[link /reference/iterator/default_sentinel_t.md] -* default_sentinel[link /reference/iterator/default_sentinel_t.md] ### 出力 ``` diff --git a/reference/iterator/const_iterator.md b/reference/iterator/const_iterator.md index 7df5c7612a..2d42effce8 100644 --- a/reference/iterator/const_iterator.md +++ b/reference/iterator/const_iterator.md @@ -10,7 +10,6 @@ namespace std { using const_iterator = /*see below*/; } ``` -* input_iterator[link input_iterator.md] ## 概要 diff --git a/reference/iterator/constant-iterator.md b/reference/iterator/constant-iterator.md index 059ae0ca23..c0603449a1 100644 --- a/reference/iterator/constant-iterator.md +++ b/reference/iterator/constant-iterator.md @@ -1,29 +1,27 @@ -# constant-iterator -* iterator[meta header] -* std[meta namespace] -* concept[meta id-type] -* cpp23[meta cpp] - -```cpp -namespace std { - template - concept constant-iterator = - input_iterator && same_as, iter_reference_t>; -} -``` -* input_iterator[link /reference/iterator/input_iterator.md] -* same_as[link /reference/concepts/same_as.md] -* iter_const_reference_t[link /reference/iterator/iter_const_reference_t.md] -* iter_reference_t[link /reference/iterator/iter_reference_t.md] - -## 概要 - -`constant-iterator`はイテレータ型`It`が定数イテレータであることを表す説明専用のコンセプトである。定数イテレータは、間接参照を通してその要素を変更することができない。 - -## バージョン -### 言語 -- C++23 - -## 参照 - -- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) +# constant-iterator +* iterator[meta header] +* std[meta namespace] +* concept[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template + concept constant-iterator = + input_iterator && same_as, iter_reference_t>; +} +``` +* iter_const_reference_t[link /reference/iterator/iter_const_reference_t.md] +* iter_reference_t[link /reference/iterator/iter_reference_t.md] + +## 概要 + +`constant-iterator`はイテレータ型`It`が定数イテレータであることを表す説明専用のコンセプトである。定数イテレータは、間接参照を通してその要素を変更することができない。 + +## バージョン +### 言語 +- C++23 + +## 参照 + +- [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) diff --git a/reference/iterator/contiguous_iterator.md b/reference/iterator/contiguous_iterator.md index 64168c6598..9138e8adf9 100644 --- a/reference/iterator/contiguous_iterator.md +++ b/reference/iterator/contiguous_iterator.md @@ -17,13 +17,11 @@ namespace std { }; } ``` -* random_access_iterator[link /reference/iterator/random_access_iterator.md] * derived_from[link /reference/concepts/derived_from.md] * ITER_CONCEPT[link /reference/iterator/input_iterator.md#iter_concept] * contiguous_iterator_tag[link /reference/iterator/iterator_tag.md] * is_lvalue_reference_v[link /reference/type_traits/is_lvalue_reference.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] -* iter_value_t[link /reference/iterator/iter_value_t.md] * to_address[link /reference/memory/to_address.md] * add_pointer_t[link /reference/type_traits/add_pointer.md] diff --git a/reference/iterator/counted_iterator.md b/reference/iterator/counted_iterator.md index abfe1184ea..eae7337124 100644 --- a/reference/iterator/counted_iterator.md +++ b/reference/iterator/counted_iterator.md @@ -24,12 +24,8 @@ namespace std { } ``` * input_or_output_iterator[link /reference/iterator/input_or_output_iterator.md] -* input_iterator[link /reference/iterator/input_iterator.md] -* same_as[link /reference/concepts/same_as.md] * ITER_TRAITS[link /reference/iterator/input_iterator.md#iter_concept] -* iterator_traits[link /reference/iterator/iterator_traits.md] * conditional_t[link /reference/type_traits/conditional.md] -* contiguous_iterator[link /reference/iterator/contiguous_iterator.md] * add_pointer_t[link /reference/type_traits/add_pointer.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] @@ -114,8 +110,6 @@ int main() { } ``` * std::counted_iterator[color ff0000] -* ranges::begin[link /reference/ranges/begin.md] -* default_sentinel[link /reference/iterator/default_sentinel_t.md] * ranges::subrange[link /reference/ranges/subrange.md] ### 出力 diff --git a/reference/iterator/counted_iterator/base.md b/reference/iterator/counted_iterator/base.md index 27134d33a9..74f20d21af 100644 --- a/reference/iterator/counted_iterator/base.md +++ b/reference/iterator/counted_iterator/base.md @@ -40,7 +40,6 @@ int main() { } ``` * base[color ff0000] -* ranges::begin[link /reference/ranges/begin.md] ### 出力 diff --git a/reference/iterator/counted_iterator/count.md b/reference/iterator/counted_iterator/count.md index b5eaeae2df..cd8fc571d3 100644 --- a/reference/iterator/counted_iterator/count.md +++ b/reference/iterator/counted_iterator/count.md @@ -8,7 +8,6 @@ ```cpp constexpr iter_difference_t count() const noexcept; ``` -* iter_difference_t[link /reference/iterator/iter_difference_t.md] ## 概要 @@ -39,7 +38,6 @@ int main() { } ``` * count[color ff0000] -* ranges::begin[link /reference/ranges/begin.md] ### 出力 diff --git a/reference/iterator/counted_iterator/iter_move.md b/reference/iterator/counted_iterator/iter_move.md index 00ef58d829..fb6fc519fa 100644 --- a/reference/iterator/counted_iterator/iter_move.md +++ b/reference/iterator/counted_iterator/iter_move.md @@ -11,8 +11,6 @@ namespace std { requires input_iterator; } ``` -* ranges::iter_move[link /reference/iterator/iter_move.md] -* input_iterator[link /reference/iterator/input_iterator.md] ## 概要 @@ -31,7 +29,6 @@ namespace std { ```cpp return ranges::iter_move(i.current); ``` -* ranges::iter_move[link /reference/iterator/iter_move.md] ## 備考 @@ -62,7 +59,6 @@ int main() { } ``` * iter_move[color ff0000] -* ranges::iter_move[link /reference/iterator/iter_move.md] ### 出力 ``` diff --git a/reference/iterator/counted_iterator/iter_swap.md b/reference/iterator/counted_iterator/iter_swap.md index 3d0405be63..6d5f92c314 100644 --- a/reference/iterator/counted_iterator/iter_swap.md +++ b/reference/iterator/counted_iterator/iter_swap.md @@ -12,8 +12,6 @@ namespace std { noexcept(noexcept(ranges::iter_swap(x.current, y.current))); } ``` -* indirectly_swappable[link /reference/iterator/indirectly_swappable.md] -* ranges::iter_swap[link /reference/iterator/iter_swap.md] ## 概要 @@ -32,7 +30,6 @@ namespace std { ```cpp return ranges::iter_swap(x.current, y.current); ``` -* ranges::iter_swap[link /reference/iterator/iter_swap.md] ## 備考 @@ -68,7 +65,6 @@ int main() { ``` * iter_swap[color ff0000] -* ranges::iter_swap[link /reference/iterator/iter_swap.md] ### 出力 ``` diff --git a/reference/iterator/counted_iterator/op_arrow.md b/reference/iterator/counted_iterator/op_arrow.md index 4fcfcfeb70..3f57cbb203 100644 --- a/reference/iterator/counted_iterator/op_arrow.md +++ b/reference/iterator/counted_iterator/op_arrow.md @@ -9,7 +9,6 @@ constexpr auto operator->() const noexcept requires contiguous_iterator; ``` -* contiguous_iterator[link /reference/iterator/contiguous_iterator.md] ## 概要 イテレータを通して参照先の要素のメンバにアクセスする @@ -53,7 +52,6 @@ int main() { } ``` * ci->[color ff0000] -* ranges::begin[link /reference/ranges/begin.md] ### 出力 ``` diff --git a/reference/iterator/counted_iterator/op_at.md b/reference/iterator/counted_iterator/op_at.md index 07170721d0..1ab89a554c 100644 --- a/reference/iterator/counted_iterator/op_at.md +++ b/reference/iterator/counted_iterator/op_at.md @@ -9,8 +9,6 @@ constexpr decltype(auto) operator[](iter_difference_t n) const requires random_access_iterator; ``` -* iter_difference_t[link /reference/iterator/iter_difference_t.md] -* random_access_iterator[link /reference/iterator/random_access_iterator.md] ## 概要 任意の位置にランダムアクセスする。 @@ -45,7 +43,6 @@ int main() { } ``` * ci[1][color ff0000] -* ranges::begin[link /reference/ranges/begin.md] ### 出力 ``` diff --git a/reference/iterator/counted_iterator/op_compare_3way.md b/reference/iterator/counted_iterator/op_compare_3way.md index c505e5e391..8db542499c 100644 --- a/reference/iterator/counted_iterator/op_compare_3way.md +++ b/reference/iterator/counted_iterator/op_compare_3way.md @@ -8,8 +8,6 @@ template I2> friend constexpr strong_ordering operator<=>(const counted_iterator& x, const counted_iterator& y); ``` -* common_with[link /reference/concepts/common_with.md] -* strong_ordering[link /reference/compare/strong_ordering.md] ## 概要 2つの`counted_iterator`オブジェクトの三方比較を行う。 @@ -79,7 +77,6 @@ int main() { } ``` * <=>[color ff0000] -* ranges::begin[link /reference/ranges/begin.md] ### 出力 ``` diff --git a/reference/iterator/counted_iterator/op_constructor.md b/reference/iterator/counted_iterator/op_constructor.md index bf30c6bcce..f322490891 100644 --- a/reference/iterator/counted_iterator/op_constructor.md +++ b/reference/iterator/counted_iterator/op_constructor.md @@ -14,9 +14,6 @@ template requires convertible_to constexpr counted_iterator(const counted_iterator& x); // (3) ``` -* default_initializable[link /reference/concepts/default_initializable.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] -* convertible_to[link /reference/concepts/convertible_to.md] ## 概要 @@ -55,7 +52,6 @@ int main() { } ``` * std::counted_iterator[color ff0000] -* ranges::begin[link /reference/ranges/begin.md] ### 出力 ``` diff --git a/reference/iterator/counted_iterator/op_decrement.md b/reference/iterator/counted_iterator/op_decrement.md index 9b88f07d29..b0e9697a32 100644 --- a/reference/iterator/counted_iterator/op_decrement.md +++ b/reference/iterator/counted_iterator/op_decrement.md @@ -12,7 +12,6 @@ constexpr counted_iterator& operator--() constexpr counted_iterator operator--(int) requires bidirectional_iterator; // (2) ``` -* bidirectional_iterator[link /reference/iterator/bidirectional_iterator.md] ## 概要 @@ -67,7 +66,6 @@ int main() { ``` * --ci[color ff0000] * ci--[color ff0000] -* ranges::begin[link /reference/ranges/begin.md] ### 出力 ``` diff --git a/reference/iterator/counted_iterator/op_deref.md b/reference/iterator/counted_iterator/op_deref.md index 9d9bed5037..cc0c2f2c1e 100644 --- a/reference/iterator/counted_iterator/op_deref.md +++ b/reference/iterator/counted_iterator/op_deref.md @@ -46,7 +46,6 @@ int main() { } ``` * *ci[color ff0000] -* ranges::begin[link /reference/ranges/begin.md] ### 出力 ``` diff --git a/reference/iterator/counted_iterator/op_equal.md b/reference/iterator/counted_iterator/op_equal.md index a446c71c19..f4f822788e 100644 --- a/reference/iterator/counted_iterator/op_equal.md +++ b/reference/iterator/counted_iterator/op_equal.md @@ -10,8 +10,6 @@ friend constexpr bool operator==(const counted_iterator& x, const counted_iterat friend constexpr bool operator==(const counted_iterator& x, default_sentinel_t); // (2) ``` -* common_with[link /reference/concepts/common_with.md] -* default_sentinel_t[link /reference/iterator/default_sentinel_t.md] ## 概要 2つの`counted_iterator`オブジェクトが同じ要素を指しているかを判定する。 @@ -79,8 +77,6 @@ int main() { } ``` * ==[color ff0000] -* ranges::begin[link /reference/ranges/begin.md] -* default_sentinel[link /reference/iterator/default_sentinel_t.md] ### 出力 ``` diff --git a/reference/iterator/counted_iterator/op_increment.md b/reference/iterator/counted_iterator/op_increment.md index b09b70ca20..a84ecd032f 100644 --- a/reference/iterator/counted_iterator/op_increment.md +++ b/reference/iterator/counted_iterator/op_increment.md @@ -13,7 +13,6 @@ decltype(auto) operator++(int); // (2) constexpr counted_iterator operator++(int) requires forward_iterator; // (3) ``` -* forward_iterator[link /reference/iterator/forward_iterator.md] ## 概要 イテレータをインクリメントする。 @@ -79,7 +78,6 @@ int main() { ``` * ++ci[color ff0000] * ci++[color ff0000] -* ranges::begin[link /reference/ranges/begin.md] ### 出力 ``` diff --git a/reference/iterator/counted_iterator/op_minus.md b/reference/iterator/counted_iterator/op_minus.md index 772ef00e7d..5d2957bc55 100644 --- a/reference/iterator/counted_iterator/op_minus.md +++ b/reference/iterator/counted_iterator/op_minus.md @@ -15,8 +15,6 @@ friend constexpr iter_difference_t operator-( friend constexpr iter_difference_t operator-( default_sentinel_t, const counted_iterator& y); // (3) ``` -* iter_difference_t[link /reference/iterator/iter_difference_t.md] -* default_sentinel_t[link /reference/iterator/default_sentinel_t.md] ## 概要 @@ -66,7 +64,6 @@ int main() { std::cout << (std::default_sentinel - ci) << '\n'; } ``` -* ranges::begin[link /reference/ranges/begin.md] ### 出力 ``` diff --git a/reference/iterator/counted_iterator/op_minus_assign.md b/reference/iterator/counted_iterator/op_minus_assign.md index f3c68f284d..2932754fbd 100644 --- a/reference/iterator/counted_iterator/op_minus_assign.md +++ b/reference/iterator/counted_iterator/op_minus_assign.md @@ -8,8 +8,6 @@ ```cpp constexpr counted_iterator& operator-=(iter_difference_t n) requires random_access_iterator; ``` -* iter_difference_t[link /reference/iterator/iter_difference_t.md] -* random_access_iterator[link /reference/iterator/random_access_iterator.md] ## 概要 @@ -52,7 +50,6 @@ int main() { std::cout << *ci << '\n'; } ``` -* ranges::begin[link /reference/ranges/begin.md] ### 出力 ``` diff --git a/reference/iterator/counted_iterator/op_plus.md b/reference/iterator/counted_iterator/op_plus.md index 7cc74ad0f0..add80a9fa8 100644 --- a/reference/iterator/counted_iterator/op_plus.md +++ b/reference/iterator/counted_iterator/op_plus.md @@ -12,8 +12,6 @@ constexpr counted_iterator operator+(iter_difference_t n) const friend constexpr counted_iterator operator+(iter_difference_t n, const counted_iterator& x) requires random_access_iterator; // (2) ``` -* iter_difference_t[link /reference/iterator/iter_difference_t.md] -* random_access_iterator[link /reference/iterator/random_access_iterator.md] ## 概要 @@ -65,7 +63,6 @@ int main() { std::cout << *ci3 << '\n'; } ``` -* ranges::begin[link /reference/ranges/begin.md] ### 出力 ``` diff --git a/reference/iterator/counted_iterator/op_plus_assign.md b/reference/iterator/counted_iterator/op_plus_assign.md index 4ef840d422..821bfe1a2c 100644 --- a/reference/iterator/counted_iterator/op_plus_assign.md +++ b/reference/iterator/counted_iterator/op_plus_assign.md @@ -8,8 +8,6 @@ ```cpp constexpr counted_iterator& operator+=(iter_difference_t n) requires random_access_iterator; ``` -* iter_difference_t[link /reference/iterator/iter_difference_t.md] -* random_access_iterator[link /reference/iterator/random_access_iterator.md] ## 概要 @@ -51,7 +49,6 @@ int main() { std::cout << *ci << '\n'; } ``` -* ranges::begin[link /reference/ranges/begin.md] ### 出力 ``` diff --git a/reference/iterator/counted_iterator/op_unary_minus.md b/reference/iterator/counted_iterator/op_unary_minus.md index cf2ace4b04..d438a1ff2e 100644 --- a/reference/iterator/counted_iterator/op_unary_minus.md +++ b/reference/iterator/counted_iterator/op_unary_minus.md @@ -9,8 +9,6 @@ constexpr counted_iterator operator-(iter_difference_t n) const requires random_access_iterator; ``` -* iter_difference_t[link /reference/iterator/iter_difference_t.md] -* random_access_iterator[link /reference/iterator/random_access_iterator.md] ## 概要 @@ -47,7 +45,6 @@ int main() { std::cout << *ci2 << '\n'; } ``` -* ranges::begin[link /reference/ranges/begin.md] ### 出力 ``` diff --git a/reference/iterator/default_sentinel_t.md b/reference/iterator/default_sentinel_t.md index 3ad3e1c355..c1f3da2750 100644 --- a/reference/iterator/default_sentinel_t.md +++ b/reference/iterator/default_sentinel_t.md @@ -39,7 +39,6 @@ int main() { ``` * default_sentinel[color ff0000] * counted_iterator[link /reference/iterator/counted_iterator.md] -* ranges::begin[link /reference/ranges/begin.md] ### 出力 ``` diff --git a/reference/iterator/forward_iterator.md b/reference/iterator/forward_iterator.md index 7947edc144..0f1f813328 100644 --- a/reference/iterator/forward_iterator.md +++ b/reference/iterator/forward_iterator.md @@ -14,12 +14,10 @@ namespace std { sentinel_for; } ``` -* input_iterator[link /reference/iterator/input_iterator.md] * forward_iterator_tag[link /reference/iterator/iterator_tag.md] * derived_from[link /reference/concepts/derived_from.md] * ITER_CONCEPT[link /reference/iterator/input_iterator.md#iter_concept] * incrementable[link /reference/iterator/incrementable.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] ## 概要 diff --git a/reference/iterator/incrementable_traits.md b/reference/iterator/incrementable_traits.md index f899a91ce0..9e0515cc12 100644 --- a/reference/iterator/incrementable_traits.md +++ b/reference/iterator/incrementable_traits.md @@ -39,10 +39,8 @@ namespace std { }; } ``` -* is_object_v[link /reference/type_traits/is_object.md] * integral[link /reference/concepts/integral.md] * make_signed_t[link /reference/type_traits/make_signed.md] -* declval[link /reference/utility/declval.md] ## 概要 diff --git a/reference/iterator/indirect_binary_predicate.md b/reference/iterator/indirect_binary_predicate.md index 27cf796efb..f3bdf1bc1d 100644 --- a/reference/iterator/indirect_binary_predicate.md +++ b/reference/iterator/indirect_binary_predicate.md @@ -27,9 +27,7 @@ namespace std { } ``` * indirectly_readable[link /reference/iterator/indirectly_readable.md] -* copy_constructible[link /reference/concepts/copy_constructible.md] * predicate[link /reference/concepts/predicate.md] -* iter_value_t[link /reference/iterator/iter_value_t.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] * iter_common_reference_t[link /reference/iterator/iter_common_reference_t.md] diff --git a/reference/iterator/indirect_equivalence_relation.md b/reference/iterator/indirect_equivalence_relation.md index bce0748696..672e33a519 100644 --- a/reference/iterator/indirect_equivalence_relation.md +++ b/reference/iterator/indirect_equivalence_relation.md @@ -27,9 +27,7 @@ namespace std { } ``` * indirectly_readable[link /reference/iterator/indirectly_readable.md] -* copy_constructible[link /reference/concepts/copy_constructible.md] * equivalence_relation[link /reference/concepts/equivalence_relation.md] -* iter_value_t[link /reference/iterator/iter_value_t.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] * iter_common_reference_t[link /reference/iterator/iter_common_reference_t.md] diff --git a/reference/iterator/indirect_result_t.md b/reference/iterator/indirect_result_t.md index eaa48597a8..37aff10847 100644 --- a/reference/iterator/indirect_result_t.md +++ b/reference/iterator/indirect_result_t.md @@ -13,9 +13,7 @@ namespace std { } ``` * indirectly_readable[link /reference/iterator/indirectly_readable.md] -* invocable[link /reference/concepts/invocable.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] -* invoke_result_t[link /reference/type_traits/invoke_result.md] ## 概要 diff --git a/reference/iterator/indirect_strict_weak_order.md b/reference/iterator/indirect_strict_weak_order.md index 8279d3ae9b..b799b9944a 100644 --- a/reference/iterator/indirect_strict_weak_order.md +++ b/reference/iterator/indirect_strict_weak_order.md @@ -27,9 +27,7 @@ namespace std { } ``` * indirectly_readable[link /reference/iterator/indirectly_readable.md] -* copy_constructible[link /reference/concepts/copy_constructible.md] * strict_weak_order[link /reference/concepts/strict_weak_order.md] -* iter_value_t[link /reference/iterator/iter_value_t.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] * iter_common_reference_t[link /reference/iterator/iter_common_reference_t.md] diff --git a/reference/iterator/indirect_unary_predicate.md b/reference/iterator/indirect_unary_predicate.md index ca8f1a9c16..22cabd4375 100644 --- a/reference/iterator/indirect_unary_predicate.md +++ b/reference/iterator/indirect_unary_predicate.md @@ -23,9 +23,7 @@ namespace std { } ``` * indirectly_readable[link /reference/iterator/indirectly_readable.md] -* copy_constructible[link /reference/concepts/copy_constructible.md] * predicate[link /reference/concepts/predicate.md] -* iter_value_t[link /reference/iterator/iter_value_t.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] * iter_common_reference_t[link /reference/iterator/iter_common_reference_t.md] diff --git a/reference/iterator/indirectly_comparable.md b/reference/iterator/indirectly_comparable.md index 00edf09220..61eb471533 100644 --- a/reference/iterator/indirectly_comparable.md +++ b/reference/iterator/indirectly_comparable.md @@ -11,9 +11,6 @@ namespace std { indirect_binary_predicate, projected>; } ``` -* identity[link /reference/functional/identity.md] -* indirect_binary_predicate[link /reference/iterator/indirect_binary_predicate.md] -* projected[link /reference/iterator/projected.md] ## 概要 @@ -57,10 +54,8 @@ int main() { } ``` * std::indirectly_comparable[color ff0000] -* identity[link /reference/functional/identity.md] * less[link /reference/functional/less.md] * greater[link /reference/functional/greater.md] -* iterator_t[link /reference/ranges/iterator_t.md] ### 出力 ``` diff --git a/reference/iterator/indirectly_copyable_storable.md b/reference/iterator/indirectly_copyable_storable.md index 39f008c45c..066ab7d802 100644 --- a/reference/iterator/indirectly_copyable_storable.md +++ b/reference/iterator/indirectly_copyable_storable.md @@ -20,7 +20,6 @@ namespace std { ``` * indirectly_copyable[link /reference/iterator/indirectly_copyable.md] * indirectly_writable[link /reference/iterator/indirectly_writable.md] -* iter_value_t[link /reference/iterator/iter_value_t.md] * copyable[link /reference/concepts/copyable.md] * constructible_from[link /reference/concepts/constructible_from.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] diff --git a/reference/iterator/indirectly_movable.md b/reference/iterator/indirectly_movable.md index 4cb3a590e0..8d601a8fcb 100644 --- a/reference/iterator/indirectly_movable.md +++ b/reference/iterator/indirectly_movable.md @@ -14,7 +14,6 @@ namespace std { ``` * indirectly_readable[link /reference/iterator/indirectly_readable.md] * indirectly_writable[link /reference/iterator/indirectly_writable.md] -* iter_rvalue_reference_t[link /reference/iterator/iter_rvalue_reference_t.md] ## 概要 diff --git a/reference/iterator/indirectly_movable_storable.md b/reference/iterator/indirectly_movable_storable.md index e6c6bde6be..35c3a44a5a 100644 --- a/reference/iterator/indirectly_movable_storable.md +++ b/reference/iterator/indirectly_movable_storable.md @@ -17,10 +17,8 @@ namespace std { ``` * indirectly_movable[link /reference/iterator/indirectly_movable.md] * indirectly_writable[link /reference/iterator/indirectly_writable.md] -* iter_value_t[link /reference/iterator/iter_value_t.md] * movable[link /reference/concepts/movable.md] * constructible_from[link /reference/concepts/constructible_from.md] -* iter_rvalue_reference_t[link /reference/iterator/iter_rvalue_reference_t.md] * assignable_from[link /reference/concepts/assignable_from.md] ## 概要 diff --git a/reference/iterator/indirectly_readable.md b/reference/iterator/indirectly_readable.md index 7de3e01a84..ba6e005a3f 100644 --- a/reference/iterator/indirectly_readable.md +++ b/reference/iterator/indirectly_readable.md @@ -36,11 +36,8 @@ concept indirectly-readable-impl = common_reference_with&&, iter_rvalue_reference_t&&> && common_reference_with&&, const iter_value_t&>; ``` -* iter_value_t[link /reference/iterator/iter_value_t.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] -* iter_rvalue_reference_t[link /reference/iterator/iter_rvalue_reference_t.md] * iter_move[link /reference/iterator/iter_move.md] -* common_reference_with[link /reference/concepts/common_reference_with.md] `indirectly_readable`は以下のように定義される。 diff --git a/reference/iterator/indirectly_readable_traits.md b/reference/iterator/indirectly_readable_traits.md index f57b71e1c7..6bc6b22074 100644 --- a/reference/iterator/indirectly_readable_traits.md +++ b/reference/iterator/indirectly_readable_traits.md @@ -64,8 +64,6 @@ namespace std { : cond-value-type { }; } ``` -* is_object_v[link /reference/type_traits/is_object.md] -* remove_cv_t[link /reference/type_traits/remove_cv.md] * is_array_v[link /reference/type_traits/is_array.md] * remove_extent_t[link /reference/type_traits/remove_extent.md] diff --git a/reference/iterator/indirectly_unary_invocable.md b/reference/iterator/indirectly_unary_invocable.md index fd0bdc5808..75bbffa4c7 100644 --- a/reference/iterator/indirectly_unary_invocable.md +++ b/reference/iterator/indirectly_unary_invocable.md @@ -50,14 +50,8 @@ namespace std { } ``` * indirectly_readable[link /reference/iterator/indirectly_readable.md] -* copy_constructible[link /reference/concepts/copy_constructible.md] -* invocable[link /reference/concepts/invocable.md] -* iter_value_t[link /reference/iterator/iter_value_t.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] * iter_common_reference_t[link /reference/iterator/iter_common_reference_t.md] -* common_reference_with[link /reference/concepts/common_reference_with.md] -* invoke_result_t[link /reference/type_traits/invoke_result.md] -* regular_invocable[link /reference/concepts/invocable.md] ## 概要 diff --git a/reference/iterator/indirectly_writable.md b/reference/iterator/indirectly_writable.md index 5add5958b0..543bbe6f98 100644 --- a/reference/iterator/indirectly_writable.md +++ b/reference/iterator/indirectly_writable.md @@ -64,8 +64,6 @@ int main() indirectly_readable && same_as, decay_t> ``` * indirectly_readable[link indirectly_readable.md] -* iter_value_t[link /reference/iterator/iter_value_t.md] -* decay_t[link /reference/type_traits/decay.md] `E`の値カテゴリが*xvalue*の場合、上記式による出力後`E`のオブジェクトは有効だが未規定な状態となる diff --git a/reference/iterator/insert_iterator/op_constructor.md b/reference/iterator/insert_iterator/op_constructor.md index 683dfbe029..c015f8f4ba 100644 --- a/reference/iterator/insert_iterator/op_constructor.md +++ b/reference/iterator/insert_iterator/op_constructor.md @@ -8,7 +8,6 @@ insert_iterator(Container& x, typename Container::iterator i); // C++03 constexpr insert_iterator(Container& x, ranges::iterator_t i); // C++20 ``` -* iterator_t[link /reference/ranges/iterator_t.md] ## 概要 `insert_iterator`オブジェクトを構築する。 diff --git a/reference/iterator/is_integer_like.md b/reference/iterator/is_integer_like.md index ba4d9b2dde..afaa39b97d 100644 --- a/reference/iterator/is_integer_like.md +++ b/reference/iterator/is_integer_like.md @@ -73,7 +73,6 @@ concept _Signed_integer_like = _Integer_like<_Ty> && static_cast<_Ty>(-1) < stat ``` * is_integral_v[link /reference/type_traits/is_integral.md] * is_same_v[link /reference/type_traits/is_same.md] -* remove_cv_t[link /reference/type_traits/remove_cv.md] 上記の説明のうち構文的な要件を素直に実装している。MSVCでは、128ビット整数が*integer-class*型である。 diff --git a/reference/iterator/istream_iterator/op_constructor.md b/reference/iterator/istream_iterator/op_constructor.md index dee0ee8573..c071f09d6d 100644 --- a/reference/iterator/istream_iterator/op_constructor.md +++ b/reference/iterator/istream_iterator/op_constructor.md @@ -15,7 +15,6 @@ istream_iterator(istream_type& s); // (3) istream_iterator(const istream_iterator& x); // (4) C++03 istream_iterator(const istream_iterator& x) = default; // (4) C++11 ``` -* default_sentinel_t[link /reference/iterator/default_sentinel_t.md] ## 概要 - (1) : デフォルトコンストラクタ。メンバ変数として保持する入力ストリームへのポインタをヌル初期化する。デフォルトコンストラクタで構築された`istream_iterator`オブジェクトは、イテレータの終端値として使用できる。 diff --git a/reference/iterator/istreambuf_iterator/op_constructor.md b/reference/iterator/istreambuf_iterator/op_constructor.md index ca28d5b1e0..0797823dd6 100644 --- a/reference/iterator/istreambuf_iterator/op_constructor.md +++ b/reference/iterator/istreambuf_iterator/op_constructor.md @@ -21,7 +21,6 @@ istreambuf_iterator(streambuf_type* s) noexcept; // (5) C++11 istreambuf_iterator(const proxy& p) throw(); // (6) C++03 istreambuf_iterator(const proxy& p) noexcept; // (6) C++11 ``` -* default_sentinel_t[link /reference/iterator/default_sentinel_t.md] ## istreambuf_iteratorオブジェクトの構築 - (1) : デフォルトコンストラクタ。メンバ変数として保持する`streambuf`オブジェクトへのポインタをヌル初期化する。 diff --git a/reference/iterator/iter_common_reference_t.md b/reference/iterator/iter_common_reference_t.md index 07e5eb9288..5dec264b96 100644 --- a/reference/iterator/iter_common_reference_t.md +++ b/reference/iterator/iter_common_reference_t.md @@ -11,9 +11,7 @@ namespace std { } ``` * indirectly_readable[link /reference/iterator/indirectly_readable.md] -* common_reference_t[link /reference/type_traits/common_reference.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] -* iter_value_t[link /reference/iterator/iter_value_t.md] ## 概要 diff --git a/reference/iterator/iter_const_reference_t.md b/reference/iterator/iter_const_reference_t.md index 7429fd03ce..0edb170e48 100644 --- a/reference/iterator/iter_const_reference_t.md +++ b/reference/iterator/iter_const_reference_t.md @@ -11,8 +11,6 @@ namespace std { } ``` * indirectly_readable[link ./indirectly_readable.md] -* common_reference_t[link /reference/type_traits/common_reference.md] -* iter_value_t[link ./iter_value_t.md] * iter_reference_t[link ./iter_reference_t.md] ## 概要 diff --git a/reference/iterator/iter_reference_t.md b/reference/iterator/iter_reference_t.md index 36f3785b44..b84e065d20 100644 --- a/reference/iterator/iter_reference_t.md +++ b/reference/iterator/iter_reference_t.md @@ -11,7 +11,6 @@ namespace std { } ``` * dereferenceable[link /reference/iterator/dereferenceable.md] -* declval[link /reference/utility/declval.md] ## 概要 diff --git a/reference/iterator/iter_rvalue_reference_t.md b/reference/iterator/iter_rvalue_reference_t.md index 9cb24c447c..b45feb43b3 100644 --- a/reference/iterator/iter_rvalue_reference_t.md +++ b/reference/iterator/iter_rvalue_reference_t.md @@ -16,7 +16,6 @@ namespace std { * dereferenceable[link /reference/iterator/dereferenceable.md] * can-reference[link /reference/iterator/dereferenceable.md] * iter_move[link /reference/iterator/iter_move.md] -* declval[link /reference/utility/declval.md] ## 概要 diff --git a/reference/iterator/iter_swap.md b/reference/iterator/iter_swap.md index 41c720906e..21c71d3457 100644 --- a/reference/iterator/iter_swap.md +++ b/reference/iterator/iter_swap.md @@ -34,7 +34,6 @@ constexpr iter_value_t iter-exchange-move(X&& x, Y&& y) return old_value; } ``` -* iter_value_t[link /reference/iterator/iter_value_t.md] * iter_move[link /reference/iterator/iter_move.md] diff --git a/reference/iterator/iterator_traits.md b/reference/iterator/iterator_traits.md index 393499fff6..7dd15cde39 100644 --- a/reference/iterator/iterator_traits.md +++ b/reference/iterator/iterator_traits.md @@ -51,8 +51,6 @@ namespace std { ``` * ptrdiff_t[link /reference/cstddef/ptrdiff_t.md] * random_access_iterator_tag[link /reference/iterator/iterator_tag.md] -* remove_cv_t[link /reference/type_traits/remove_cv.md] -* is_object_v[link /reference/type_traits/is_object.md] * contiguous_iterator_tag[link /reference/iterator/iterator_tag.md] ## 概要 @@ -205,7 +203,6 @@ concept cpp17-random-access-iterator = * signed_integral[link /reference/concepts/signed_integral.md] * constructible_from[link /reference/concepts/constructible_from.md] * is_lvalue_reference_v[link /reference/type_traits/is_lvalue_reference.md] -* convertible_to[link /reference/concepts/convertible_to.md] * totally_ordered[link /reference/concepts/totally_ordered.md] ## 例 diff --git a/reference/iterator/make_const_iterator.md b/reference/iterator/make_const_iterator.md index 5c6a27cb6d..5e56586ec2 100644 --- a/reference/iterator/make_const_iterator.md +++ b/reference/iterator/make_const_iterator.md @@ -10,7 +10,6 @@ namespace std { constexpr const_iterator make_const_iterator(I it); } ``` -* input_iterator[link input_iterator.md] * const_iterator[link const_iterator.md] ## 概要 diff --git a/reference/iterator/mergeable.md b/reference/iterator/mergeable.md index caedb57780..0657b9faa6 100644 --- a/reference/iterator/mergeable.md +++ b/reference/iterator/mergeable.md @@ -18,12 +18,9 @@ namespace std { } ``` * less[link /reference/functional/less.md] -* identity[link /reference/functional/identity.md] -* input_iterator[link /reference/iterator/input_iterator.md] * weakly_incrementable[link /reference/iterator/weakly_incrementable.md] * indirectly_copyable[link /reference/iterator/indirectly_copyable.md] * indirect_strict_weak_order[link /reference/iterator/indirect_strict_weak_order.md] -* projected[link /reference/iterator/projected.md] ## 概要 diff --git a/reference/iterator/move_iterator/iter_move.md b/reference/iterator/move_iterator/iter_move.md index 2fd5c26f49..d7d80632c7 100644 --- a/reference/iterator/move_iterator/iter_move.md +++ b/reference/iterator/move_iterator/iter_move.md @@ -15,8 +15,6 @@ namespace std { } ``` * move_iterator[link /reference/iterator/move_iterator.md] -* iter_rvalue_reference_t[link /reference/iterator/iter_rvalue_reference_t.md] -* ranges::iter_move[link /reference/iterator/iter_move.md] ## 概要 @@ -29,7 +27,6 @@ namespace std { ```cpp return ranges::iter_move(i.current); ``` -* ranges::iter_move[link /reference/iterator/iter_move.md] ## 備考 @@ -59,7 +56,6 @@ int main() { } ``` * iter_move[color ff0000] -* ranges::iter_move[link /reference/iterator/iter_move.md] ### 出力 ``` diff --git a/reference/iterator/move_iterator/iter_swap.md b/reference/iterator/move_iterator/iter_swap.md index 7484433211..0d0ab0956e 100644 --- a/reference/iterator/move_iterator/iter_swap.md +++ b/reference/iterator/move_iterator/iter_swap.md @@ -17,7 +17,6 @@ namespace std { } ``` * move_iterator[link /reference/iterator/move_iterator.md] -* indirectly_swappable[link /reference/iterator/indirectly_swappable.md] ## 概要 @@ -30,7 +29,6 @@ namespace std { ```cpp ranges::iter_swap(x.current, y.current); ``` -* ranges::iter_swap[link /reference/iterator/iter_swap.md] ## 戻り値 @@ -78,7 +76,6 @@ int main() { } ``` * iter_swap[color ff0000] -* ranges::iter_swap[link /reference/iterator/iter_swap.md] ### 出力 ``` diff --git a/reference/iterator/move_iterator/op_equal.md b/reference/iterator/move_iterator/op_equal.md index 9447104c08..e402645036 100644 --- a/reference/iterator/move_iterator/op_equal.md +++ b/reference/iterator/move_iterator/op_equal.md @@ -29,7 +29,6 @@ namespace std { const move_iterator& y); // (3) C++17 } ``` -* sentinel_for[link /reference/iterator/sentinel_for.md] * move_sentinel[link /reference/iterator/move_sentinel.md] ## 概要 diff --git a/reference/iterator/move_iterator/op_minus.md b/reference/iterator/move_iterator/op_minus.md index c8430f9f48..4083df34bf 100644 --- a/reference/iterator/move_iterator/op_minus.md +++ b/reference/iterator/move_iterator/op_minus.md @@ -31,7 +31,6 @@ namespace std { ``` * base[link /reference/iterator/move_iterator/base.md] * sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] * move_sentinel[link /reference/iterator/move_sentinel.md] ## 概要 diff --git a/reference/iterator/move_iterator/op_plus.md b/reference/iterator/move_iterator/op_plus.md index 94bfe064c8..e2cbae1ca5 100644 --- a/reference/iterator/move_iterator/op_plus.md +++ b/reference/iterator/move_iterator/op_plus.md @@ -22,7 +22,6 @@ namespace std { const move_iterator& x); // C++20 } ``` -* iter_difference_t[link /reference/iterator/iter_difference_t.md] ## 概要 イテレータを`n`回進める。 diff --git a/reference/iterator/move_sentinel.md b/reference/iterator/move_sentinel.md index 28120c4ec7..dd504c9fdd 100644 --- a/reference/iterator/move_sentinel.md +++ b/reference/iterator/move_sentinel.md @@ -57,8 +57,6 @@ void move_if(I first, S last, O out, Pred pred) { } ``` * std::move_sentinel[color ff0000] -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * weakly_incrementable[link /reference/iterator/weakly_incrementable.md] * indirectly_movable[link /reference/iterator/indirectly_movable.md] * copy_if[link /reference/algorithm/copy_if.md] diff --git a/reference/iterator/move_sentinel/op_constructor.md b/reference/iterator/move_sentinel/op_constructor.md index 0e4c98537c..4ac43128e8 100644 --- a/reference/iterator/move_sentinel/op_constructor.md +++ b/reference/iterator/move_sentinel/op_constructor.md @@ -14,7 +14,6 @@ template requires convertible_to constexpr move_sentinel(const move_sentinel& s); // (3) ``` -* convertible_to[link /reference/concepts/convertible_to.md] ## 概要 diff --git a/reference/iterator/next.md b/reference/iterator/next.md index 255c293756..fe30f3b9d2 100644 --- a/reference/iterator/next.md +++ b/reference/iterator/next.md @@ -15,7 +15,6 @@ namespace std { typename std::iterator_traits::difference_type n = 1); // C++17 } ``` -* iterator_traits[link iterator_traits.md] ## 概要 `n`回前方に進めたイテレータを返す。 diff --git a/reference/iterator/permutable.md b/reference/iterator/permutable.md index 7d94b5f852..95d912d5d7 100644 --- a/reference/iterator/permutable.md +++ b/reference/iterator/permutable.md @@ -13,9 +13,7 @@ namespace std { indirectly_swappable; } ``` -* forward_iterator[link /reference/iterator/forward_iterator.md] * indirectly_movable_storable[link /reference/iterator/indirectly_movable_storable.md] -* indirectly_swappable[link /reference/iterator/indirectly_swappable.md] ## 概要 diff --git a/reference/iterator/prev.md b/reference/iterator/prev.md index 5d2cff7847..0cb243d7f7 100644 --- a/reference/iterator/prev.md +++ b/reference/iterator/prev.md @@ -15,7 +15,6 @@ namespace std { typename std::iterator_traits::difference_type n = 1); // C++17 } ``` -* iterator_traits[link iterator_traits.md] ## 概要 `n`回後方に進めたイテレータを返す。 diff --git a/reference/iterator/projected.md b/reference/iterator/projected.md index 85023e7ad7..de67022491 100644 --- a/reference/iterator/projected.md +++ b/reference/iterator/projected.md @@ -36,7 +36,6 @@ namespace std { * indirectly_regular_unary_invocable[link /reference/iterator/indirectly_unary_invocable.md] * indirect_result_t[link /reference/iterator/indirect_result_t.md] * incrementable_traits[link /reference/iterator/incrementable_traits.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] ## 概要 @@ -83,12 +82,8 @@ int main() { } ``` * std::projected[color ff0000] -* identity[link /reference/functional/identity.md] * indirectly_readable[link /reference/iterator/indirectly_readable.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] -* iter_value_t[link /reference/iterator/iter_value_t.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] -* iter_rvalue_reference_t[link /reference/iterator/iter_rvalue_reference_t.md] * iter_common_reference_t[link /reference/iterator/iter_common_reference_t.md] ### 出力 diff --git a/reference/iterator/random_access_iterator.md b/reference/iterator/random_access_iterator.md index d17132a3f3..c0d6775cba 100644 --- a/reference/iterator/random_access_iterator.md +++ b/reference/iterator/random_access_iterator.md @@ -22,13 +22,11 @@ namespace std { }; } ``` -* bidirectional_iterator[link /reference/iterator/bidirectional_iterator.md] * derived_from[link /reference/concepts/derived_from.md] * ITER_CONCEPT[link /reference/iterator/input_iterator.md#iter_concept] * random_access_iterator_tag[link /reference/iterator/iterator_tag.md] * totally_ordered[link /reference/concepts/totally_ordered.md] * sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] ## 概要 diff --git a/reference/iterator/ranges_advance.md b/reference/iterator/ranges_advance.md index d4a3403e48..7ebbfd3830 100644 --- a/reference/iterator/ranges_advance.md +++ b/reference/iterator/ranges_advance.md @@ -17,8 +17,6 @@ namespace std::ranges { } ``` * input_or_output_iterator[link /reference/iterator/input_or_output_iterator.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] ## 概要 @@ -102,8 +100,6 @@ int main() { } ``` * std::ranges::advance[color ff0000] -* std::begin[link /reference/iterator/begin.md] -* std::next[link /reference/iterator/next.md] ### 出力 ``` diff --git a/reference/iterator/ranges_distance.md b/reference/iterator/ranges_distance.md index be9ed8c213..2b861dff68 100644 --- a/reference/iterator/ranges_distance.md +++ b/reference/iterator/ranges_distance.md @@ -14,10 +14,6 @@ namespace std::ranges { } ``` * input_or_output_iterator[link /reference/iterator/input_or_output_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] -* range[link /reference/ranges/range.md] -* range_difference_t[link /reference/ranges/range_difference_t.md] ## 概要 @@ -77,8 +73,6 @@ int main() { } ``` * std::ranges::distance[color ff0000] -* std::begin[link /reference/iterator/begin.md] -* std::next[link /reference/iterator/next.md] ### 出力 ``` diff --git a/reference/iterator/ranges_next.md b/reference/iterator/ranges_next.md index 66c57e8af7..5ef79dfcb5 100644 --- a/reference/iterator/ranges_next.md +++ b/reference/iterator/ranges_next.md @@ -20,8 +20,6 @@ namespace std::ranges { } ``` * input_or_output_iterator[link /reference/iterator/input_or_output_iterator.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] ## 概要 @@ -115,7 +113,6 @@ int main() { } ``` * std::ranges::next[color ff0000] -* std::begin[link /reference/iterator/begin.md] ### 出力 ``` diff --git a/reference/iterator/ranges_prev.md b/reference/iterator/ranges_prev.md index 639f463298..22f92a33d4 100644 --- a/reference/iterator/ranges_prev.md +++ b/reference/iterator/ranges_prev.md @@ -16,8 +16,6 @@ namespace std::ranges { constexpr I prev(I x, iter_difference_t n, I bound); // (3) } ``` -* bidirectional_iterator[link /reference/iterator/bidirectional_iterator.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] ## 概要 diff --git a/reference/iterator/reverse_iterator.md b/reference/iterator/reverse_iterator.md index fa024206ba..cf31e3a34b 100644 --- a/reference/iterator/reverse_iterator.md +++ b/reference/iterator/reverse_iterator.md @@ -21,7 +21,6 @@ namespace std { } ``` * iterator[link /reference/iterator/iterator.md] -* iterator_traits[link /reference/iterator/iterator_traits.md] * sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] * disable_sized_sentinel_for[link /reference/iterator/disable_sized_sentinel_for.md] diff --git a/reference/iterator/reverse_iterator/iter_move.md b/reference/iterator/reverse_iterator/iter_move.md index 856b8e2f89..ed9367c3d3 100644 --- a/reference/iterator/reverse_iterator/iter_move.md +++ b/reference/iterator/reverse_iterator/iter_move.md @@ -16,7 +16,6 @@ namespace std { ``` * see below[italic] * reverse_iterator[link /reference/iterator/reverse_iterator.md] -* iter_rvalue_reference_t[link /reference/iterator/iter_rvalue_reference_t.md] ## 概要 @@ -31,7 +30,6 @@ auto tmp = i.base(); return ranges::iter_move(--tmp); ``` * base[link /reference/iterator/reverse_iterator/base.md] -* ranges::iter_move[link /reference/iterator/iter_move.md] ## 例外 @@ -42,7 +40,6 @@ is_nothrow_copy_constructible_v && noexcept(ranges::iter_move(--declval())) ``` * is_nothrow_copy_constructible_v[link /reference/type_traits/is_nothrow_copy_constructible.md] -* ranges::iter_move[link /reference/iterator/iter_move.md] ## 備考 @@ -72,7 +69,6 @@ int main() { } ``` * iter_move[color ff0000] -* ranges::iter_move[link /reference/iterator/iter_move.md] ### 出力 ``` diff --git a/reference/iterator/reverse_iterator/iter_swap.md b/reference/iterator/reverse_iterator/iter_swap.md index 699b86599f..4ff978e187 100644 --- a/reference/iterator/reverse_iterator/iter_swap.md +++ b/reference/iterator/reverse_iterator/iter_swap.md @@ -18,7 +18,6 @@ namespace std { ``` * see below[italic] * reverse_iterator[link /reference/iterator/reverse_iterator.md] -* indirectly_swappable[link /reference/iterator/indirectly_swappable.md] ## 概要 @@ -34,7 +33,6 @@ auto ytmp = y.base(); ranges::iter_swap(--xtmp, --ytmp); ``` * base[link /reference/iterator/reverse_iterator/base.md] -* ranges::iter_swap[link /reference/iterator/iter_swap.md] ## 例外 @@ -46,7 +44,6 @@ is_nothrow_copy_constructible_v && noexcept(ranges::iter_swap(--declval(), --declval())) ``` * is_nothrow_copy_constructible_v[link /reference/type_traits/is_nothrow_copy_constructible.md] -* ranges::iter_swap[link /reference/iterator/iter_swap.md] ## 備考 @@ -87,7 +84,6 @@ int main() { } ``` * iter_swap[color ff0000] -* ranges::iter_swap[link /reference/iterator/iter_swap.md] ### 出力 ``` diff --git a/reference/iterator/sized_sentinel_for.md b/reference/iterator/sized_sentinel_for.md index e276a0ad2b..02e9a969e1 100644 --- a/reference/iterator/sized_sentinel_for.md +++ b/reference/iterator/sized_sentinel_for.md @@ -16,10 +16,7 @@ namespace std { }; } ``` -* sentinel_for[link /reference/iterator/sentinel_for.md] * disable_sized_sentinel_for[link disable_sized_sentinel_for.md] -* remove_cv_t[link /reference/type_traits/remove_cv.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] ## 概要 diff --git a/reference/iterator/sortable.md b/reference/iterator/sortable.md index df8356c30c..eef918b35c 100644 --- a/reference/iterator/sortable.md +++ b/reference/iterator/sortable.md @@ -13,10 +13,8 @@ namespace std { } ``` * less[link /reference/functional/less.md] -* identity[link /reference/functional/identity.md] * permutable[link /reference/iterator/permutable.md] * indirect_strict_weak_order[link /reference/iterator/indirect_strict_weak_order.md] -* projected[link /reference/iterator/projected.md] ## 概要 diff --git a/reference/iterator/ssize.md b/reference/iterator/ssize.md index 24e2488d21..47dab83d46 100644 --- a/reference/iterator/ssize.md +++ b/reference/iterator/ssize.md @@ -14,7 +14,6 @@ namespace std { constexpr ptrdiff_t ssize(const T (&array)[N]) noexcept; // (2) } ``` -* common_type_t[link /reference/type_traits/common_type.md] * ptrdiff_t[link /reference/cstddef/ptrdiff_t.md] * make_signed_t[link /reference/type_traits/make_signed.md] diff --git a/reference/iterator/weakly_incrementable.md b/reference/iterator/weakly_incrementable.md index af15089187..b4167a1a19 100644 --- a/reference/iterator/weakly_incrementable.md +++ b/reference/iterator/weakly_incrementable.md @@ -18,7 +18,6 @@ namespace std { } ``` * movable[link /reference/concepts/movable.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] * is-signed-integer-like[link /reference/iterator/is_integer_like.md] ## 概要 diff --git a/reference/limits/numeric_limits/max_digits10.md b/reference/limits/numeric_limits/max_digits10.md index 0bc95e073f..4aa8ce8f5d 100644 --- a/reference/limits/numeric_limits/max_digits10.md +++ b/reference/limits/numeric_limits/max_digits10.md @@ -87,7 +87,6 @@ int main() * std::scientific[link /reference/ios/scientific.md] * s.str()[link /reference/sstream/basic_stringstream/str.md] * std::nextafter[link /reference/cmath/nextafter.md] -* std::uint32_t[link /reference/cstdint/uint32_t.md] ### 出力例 ``` diff --git a/reference/linalg/hermitian_matrix_product.md b/reference/linalg/hermitian_matrix_product.md index ab9ab2f33e..be2d90f371 100644 --- a/reference/linalg/hermitian_matrix_product.md +++ b/reference/linalg/hermitian_matrix_product.md @@ -302,13 +302,10 @@ int main() ``` * A.extent[link /reference/mdspan/extents/extent.md] * std::complex[link /reference/complex/complex.md] -* std::mdspan[link /reference/mdspan/mdspan.md] -* std::extents[link /reference/mdspan/extents.md] * std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] * std::linalg::upper_triangle_t[link /reference/linalg/upper_triangle_t.md] * std::linalg::row_major_t[link /reference/linalg/row_major_t.md] * std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] -* std::execution::par[link /reference/execution/execution/execution_policy.md] * std::linalg::hermitian_matrix_product[color ff0000] diff --git a/reference/linalg/hermitian_matrix_rank_1_update.md b/reference/linalg/hermitian_matrix_rank_1_update.md index 2211afe13e..323a7c3460 100644 --- a/reference/linalg/hermitian_matrix_rank_1_update.md +++ b/reference/linalg/hermitian_matrix_rank_1_update.md @@ -200,13 +200,10 @@ int main() * A.extent[link /reference/mdspan/extents/extent.md] * v.extent[link /reference/mdspan/extents/extent.md] * std::complex[link /reference/complex/complex.md] -* std::mdspan[link /reference/mdspan/mdspan.md] -* std::extents[link /reference/mdspan/extents.md] * std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] * std::linalg::upper_triangle_t[link /reference/linalg/upper_triangle_t.md] * std::linalg::row_major_t[link /reference/linalg/row_major_t.md] * std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] -* std::execution::par[link /reference/execution/execution/execution_policy.md] * std::linalg::hermitian_matrix_rank_1_update[color ff0000] diff --git a/reference/linalg/hermitian_matrix_rank_2_update.md b/reference/linalg/hermitian_matrix_rank_2_update.md index 514255df12..b08638416f 100644 --- a/reference/linalg/hermitian_matrix_rank_2_update.md +++ b/reference/linalg/hermitian_matrix_rank_2_update.md @@ -156,13 +156,10 @@ int main() * x.extent[link /reference/mdspan/extents/extent.md] * y.extent[link /reference/mdspan/extents/extent.md] * std::complex[link /reference/complex/complex.md] -* std::mdspan[link /reference/mdspan/mdspan.md] -* std::extents[link /reference/mdspan/extents.md] * std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] * std::linalg::upper_triangle_t[link /reference/linalg/upper_triangle_t.md] * std::linalg::row_major_t[link /reference/linalg/row_major_t.md] * std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] -* std::execution::par[link /reference/execution/execution/execution_policy.md] * std::linalg::hermitian_matrix_rank_2_update[color ff0000] diff --git a/reference/linalg/hermitian_matrix_rank_2k_update.md b/reference/linalg/hermitian_matrix_rank_2k_update.md index ff2f141aed..ee23b949aa 100644 --- a/reference/linalg/hermitian_matrix_rank_2k_update.md +++ b/reference/linalg/hermitian_matrix_rank_2k_update.md @@ -160,13 +160,10 @@ int main() ``` * A.extent[link /reference/mdspan/extents/extent.md] * std::complex[link /reference/complex/complex.md] -* std::mdspan[link /reference/mdspan/mdspan.md] -* std::extents[link /reference/mdspan/extents.md] * std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] * std::linalg::upper_triangle_t[link /reference/linalg/upper_triangle_t.md] * std::linalg::row_major_t[link /reference/linalg/row_major_t.md] * std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] -* std::execution::par[link /reference/execution/execution/execution_policy.md] * std::linalg::hermitian_matrix_rank_2k_update[color ff0000] diff --git a/reference/linalg/hermitian_matrix_rank_k_update.md b/reference/linalg/hermitian_matrix_rank_k_update.md index df5e810440..8e6847f08b 100644 --- a/reference/linalg/hermitian_matrix_rank_k_update.md +++ b/reference/linalg/hermitian_matrix_rank_k_update.md @@ -199,13 +199,10 @@ int main() ``` * A.extent[link /reference/mdspan/extents/extent.md] * std::complex[link /reference/complex/complex.md] -* std::mdspan[link /reference/mdspan/mdspan.md] -* std::extents[link /reference/mdspan/extents.md] * std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] * std::linalg::upper_triangle_t[link /reference/linalg/upper_triangle_t.md] * std::linalg::row_major_t[link /reference/linalg/row_major_t.md] * std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] -* std::execution::par[link /reference/execution/execution/execution_policy.md] * std::linalg::hermitian_matrix_rank_k_update[color ff0000] diff --git a/reference/linalg/hermitian_matrix_vector_product.md b/reference/linalg/hermitian_matrix_vector_product.md index 8b0f40f3c3..845339a7ea 100644 --- a/reference/linalg/hermitian_matrix_vector_product.md +++ b/reference/linalg/hermitian_matrix_vector_product.md @@ -189,13 +189,10 @@ int main() * x.extent[link /reference/mdspan/extents/extent.md] * y.extent[link /reference/mdspan/extents/extent.md] * std::complex[link /reference/complex/complex.md] -* std::mdspan[link /reference/mdspan/mdspan.md] -* std::extents[link /reference/mdspan/extents.md] * std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] * std::linalg::upper_triangle_t[link /reference/linalg/upper_triangle_t.md] * std::linalg::row_major_t[link /reference/linalg/row_major_t.md] * std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] -* std::execution::par[link /reference/execution/execution/execution_policy.md] * std::linalg::hermitian_matrix_vector_product[color ff0000] diff --git a/reference/linalg/layout_blas_packed.md b/reference/linalg/layout_blas_packed.md index a1be8da219..0f450d34ca 100644 --- a/reference/linalg/layout_blas_packed.md +++ b/reference/linalg/layout_blas_packed.md @@ -91,7 +91,6 @@ int main() * linalg::row_major_t[link row_major_t.md] * mat.extent[link /reference/mdspan/mdspan/extent.md] * std::print[link /reference/print/print.md] -* std::println[link /reference/print/println.md] ### 出力 ``` diff --git a/reference/linalg/layout_blas_packed/mapping.md b/reference/linalg/layout_blas_packed/mapping.md index 2074f2590e..f9bb6042d3 100644 --- a/reference/linalg/layout_blas_packed/mapping.md +++ b/reference/linalg/layout_blas_packed/mapping.md @@ -122,7 +122,6 @@ int main() * LayoutPacked::mapping[color ff0000] * mat.extent[link /reference/mdspan/mdspan/extent.md] * std::print[link /reference/print/print.md] -* std::println[link /reference/print/println.md] ### 出力 ``` diff --git a/reference/linalg/matrix_product.md b/reference/linalg/matrix_product.md index c285dd77c5..334f9a2e80 100644 --- a/reference/linalg/matrix_product.md +++ b/reference/linalg/matrix_product.md @@ -162,8 +162,6 @@ int main() ``` * A.extent[link /reference/mdspan/extents/extent.md] * B.extent[link /reference/mdspan/extents/extent.md] -* std::mdspan[link /reference/mdspan/mdspan.md] -* std::execution::par[link /reference/execution/execution/execution_policy.md] * std::linalg::matrix_product[color ff0000] diff --git a/reference/linalg/matrix_rank_1_update.md b/reference/linalg/matrix_rank_1_update.md index 6b0e3a98fb..3061a0dad9 100644 --- a/reference/linalg/matrix_rank_1_update.md +++ b/reference/linalg/matrix_rank_1_update.md @@ -136,8 +136,6 @@ int main() ``` * A.extent[link /reference/mdspan/extents/extent.md] * v.extent[link /reference/mdspan/extents/extent.md] -* std::mdspan[link /reference/mdspan/mdspan.md] -* std::execution::par[link /reference/execution/execution/execution_policy.md] * std::linalg::matrix_rank_1_update[color ff0000] diff --git a/reference/linalg/matrix_rank_1_update_c.md b/reference/linalg/matrix_rank_1_update_c.md index abe50c184f..7c58e8e701 100644 --- a/reference/linalg/matrix_rank_1_update_c.md +++ b/reference/linalg/matrix_rank_1_update_c.md @@ -143,8 +143,6 @@ int main() * v.extent[link /reference/mdspan/extents/extent.md] * y.extent[link /reference/mdspan/extents/extent.md] * std::complex[link /reference/complex/complex.md] -* std::mdspan[link /reference/mdspan/mdspan.md] -* std::execution::par[link /reference/execution/execution/execution_policy.md] * std::linalg::matrix_rank_1_update[color ff0000] diff --git a/reference/linalg/matrix_vector_product.md b/reference/linalg/matrix_vector_product.md index a8b6cb6dc0..25ffcd14cb 100644 --- a/reference/linalg/matrix_vector_product.md +++ b/reference/linalg/matrix_vector_product.md @@ -156,8 +156,6 @@ int main() * v.extent[link /reference/mdspan/extents/extent.md] * x.extent[link /reference/mdspan/extents/extent.md] * y.extent[link /reference/mdspan/extents/extent.md] -* std::mdspan[link /reference/mdspan/mdspan.md] -* std::execution::par[link /reference/execution/execution/execution_policy.md] * std::linalg::matrix_vector_product[color ff0000] diff --git a/reference/linalg/symmetric_matrix_product.md b/reference/linalg/symmetric_matrix_product.md index e71eb1d41d..fa33040615 100644 --- a/reference/linalg/symmetric_matrix_product.md +++ b/reference/linalg/symmetric_matrix_product.md @@ -299,13 +299,10 @@ int main() } ``` * A.extent[link /reference/mdspan/extents/extent.md] -* std::mdspan[link /reference/mdspan/mdspan.md] -* std::extents[link /reference/mdspan/extents.md] * std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] * std::linalg::upper_triangle_t[link /reference/linalg/upper_triangle_t.md] * std::linalg::row_major_t[link /reference/linalg/row_major_t.md] * std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] -* std::execution::par[link /reference/execution/execution/execution_policy.md] * std::linalg::symmetric_matrix_product[color ff0000] diff --git a/reference/linalg/symmetric_matrix_rank_1_update.md b/reference/linalg/symmetric_matrix_rank_1_update.md index a4d66f1fb3..d1a2f2a071 100644 --- a/reference/linalg/symmetric_matrix_rank_1_update.md +++ b/reference/linalg/symmetric_matrix_rank_1_update.md @@ -194,13 +194,10 @@ int main() ``` * A.extent[link /reference/mdspan/extents/extent.md] * v.extent[link /reference/mdspan/extents/extent.md] -* std::mdspan[link /reference/mdspan/mdspan.md] -* std::extents[link /reference/mdspan/extents.md] * std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] * std::linalg::upper_triangle_t[link /reference/linalg/upper_triangle_t.md] * std::linalg::row_major_t[link /reference/linalg/row_major_t.md] * std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] -* std::execution::par[link /reference/execution/execution/execution_policy.md] * std::linalg::symmetric_matrix_rank_1_update[color ff0000] diff --git a/reference/linalg/symmetric_matrix_rank_2_update.md b/reference/linalg/symmetric_matrix_rank_2_update.md index a00862056e..3151b428c5 100644 --- a/reference/linalg/symmetric_matrix_rank_2_update.md +++ b/reference/linalg/symmetric_matrix_rank_2_update.md @@ -150,13 +150,10 @@ int main() * A.extent[link /reference/mdspan/extents/extent.md] * x.extent[link /reference/mdspan/extents/extent.md] * y.extent[link /reference/mdspan/extents/extent.md] -* std::mdspan[link /reference/mdspan/mdspan.md] -* std::extents[link /reference/mdspan/extents.md] * std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] * std::linalg::upper_triangle_t[link /reference/linalg/upper_triangle_t.md] * std::linalg::row_major_t[link /reference/linalg/row_major_t.md] * std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] -* std::execution::par[link /reference/execution/execution/execution_policy.md] * std::linalg::symmetric_matrix_rank_2_update[color ff0000] diff --git a/reference/linalg/symmetric_matrix_rank_2k_update.md b/reference/linalg/symmetric_matrix_rank_2k_update.md index 4c04962c4e..054f19c504 100644 --- a/reference/linalg/symmetric_matrix_rank_2k_update.md +++ b/reference/linalg/symmetric_matrix_rank_2k_update.md @@ -154,13 +154,10 @@ int main() } ``` * A.extent[link /reference/mdspan/extents/extent.md] -* std::mdspan[link /reference/mdspan/mdspan.md] -* std::extents[link /reference/mdspan/extents.md] * std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] * std::linalg::upper_triangle_t[link /reference/linalg/upper_triangle_t.md] * std::linalg::row_major_t[link /reference/linalg/row_major_t.md] * std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] -* std::execution::par[link /reference/execution/execution/execution_policy.md] * std::linalg::symmetric_matrix_rank_2k_update[color ff0000] diff --git a/reference/linalg/symmetric_matrix_rank_k_update.md b/reference/linalg/symmetric_matrix_rank_k_update.md index 2aa7c86638..1d393bbad7 100644 --- a/reference/linalg/symmetric_matrix_rank_k_update.md +++ b/reference/linalg/symmetric_matrix_rank_k_update.md @@ -193,13 +193,10 @@ int main() } ``` * A.extent[link /reference/mdspan/extents/extent.md] -* std::mdspan[link /reference/mdspan/mdspan.md] -* std::extents[link /reference/mdspan/extents.md] * std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] * std::linalg::upper_triangle_t[link /reference/linalg/upper_triangle_t.md] * std::linalg::row_major_t[link /reference/linalg/row_major_t.md] * std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] -* std::execution::par[link /reference/execution/execution/execution_policy.md] * std::linalg::symmetric_matrix_rank_k_update[color ff0000] diff --git a/reference/linalg/symmetric_matrix_vector_product.md b/reference/linalg/symmetric_matrix_vector_product.md index 193260dfa8..3e7e76218f 100644 --- a/reference/linalg/symmetric_matrix_vector_product.md +++ b/reference/linalg/symmetric_matrix_vector_product.md @@ -180,13 +180,10 @@ int main() * A.extent[link /reference/mdspan/extents/extent.md] * v.extent[link /reference/mdspan/extents/extent.md] * x.extent[link /reference/mdspan/extents/extent.md] -* std::mdspan[link /reference/mdspan/mdspan.md] -* std::extents[link /reference/mdspan/extents.md] * std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] * std::linalg::upper_triangle_t[link /reference/linalg/upper_triangle_t.md] * std::linalg::row_major_t[link /reference/linalg/row_major_t.md] * std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] -* std::execution::par[link /reference/execution/execution/execution_policy.md] * std::linalg::symmetric_matrix_vector_product[color ff0000] diff --git a/reference/linalg/triangular_matrix_left_product.md b/reference/linalg/triangular_matrix_left_product.md index ad84636f72..e1cefa9c3e 100644 --- a/reference/linalg/triangular_matrix_left_product.md +++ b/reference/linalg/triangular_matrix_left_product.md @@ -152,14 +152,11 @@ int main() } ``` * A.extent[link /reference/mdspan/extents/extent.md] -* std::mdspan[link /reference/mdspan/mdspan.md] -* std::extents[link /reference/mdspan/extents.md] * std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] * std::linalg::upper_triangle_t[link /reference/linalg/upper_triangle_t.md] * std::linalg::row_major_t[link /reference/linalg/row_major_t.md] * std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] * std::linalg::implicit_unit_diagonal[link /reference/linalg/implicit_unit_diagonal_t.md] -* std::execution::par[link /reference/execution/execution/execution_policy.md] * std::linalg::triangular_matrix_left_product[color ff0000] diff --git a/reference/linalg/triangular_matrix_matrix_left_solve.md b/reference/linalg/triangular_matrix_matrix_left_solve.md index e5188a58d1..0c1e2836fc 100644 --- a/reference/linalg/triangular_matrix_matrix_left_solve.md +++ b/reference/linalg/triangular_matrix_matrix_left_solve.md @@ -324,14 +324,11 @@ int main() } ``` * A.extent[link /reference/mdspan/extents/extent.md] -* std::mdspan[link /reference/mdspan/mdspan.md] -* std::extents[link /reference/mdspan/extents.md] * std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] * std::linalg::upper_triangle_t[link /reference/linalg/upper_triangle_t.md] * std::linalg::row_major_t[link /reference/linalg/row_major_t.md] * std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] * std::linalg::implicit_unit_diagonal[link /reference/linalg/implicit_unit_diagonal_t.md] -* std::execution::par[link /reference/execution/execution/execution_policy.md] * std::linalg::triangular_matrix_matrix_left_solve[color ff0000] diff --git a/reference/linalg/triangular_matrix_matrix_right_solve.md b/reference/linalg/triangular_matrix_matrix_right_solve.md index d83dd71cdf..4a1f7e188f 100644 --- a/reference/linalg/triangular_matrix_matrix_right_solve.md +++ b/reference/linalg/triangular_matrix_matrix_right_solve.md @@ -324,14 +324,11 @@ int main() } ``` * A.extent[link /reference/mdspan/extents/extent.md] -* std::mdspan[link /reference/mdspan/mdspan.md] -* std::extents[link /reference/mdspan/extents.md] * std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] * std::linalg::upper_triangle_t[link /reference/linalg/upper_triangle_t.md] * std::linalg::row_major_t[link /reference/linalg/row_major_t.md] * std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] * std::linalg::implicit_unit_diagonal[link /reference/linalg/implicit_unit_diagonal_t.md] -* std::execution::par[link /reference/execution/execution/execution_policy.md] * std::linalg::triangular_matrix_matrix_right_solve[color ff0000] diff --git a/reference/linalg/triangular_matrix_product.md b/reference/linalg/triangular_matrix_product.md index ef75266e07..8048ec848e 100644 --- a/reference/linalg/triangular_matrix_product.md +++ b/reference/linalg/triangular_matrix_product.md @@ -364,14 +364,11 @@ int main() } ``` * A.extent[link /reference/mdspan/extents/extent.md] -* std::mdspan[link /reference/mdspan/mdspan.md] -* std::extents[link /reference/mdspan/extents.md] * std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] * std::linalg::upper_triangle_t[link /reference/linalg/upper_triangle_t.md] * std::linalg::row_major_t[link /reference/linalg/row_major_t.md] * std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] * std::linalg::implicit_unit_diagonal[link /reference/linalg/implicit_unit_diagonal_t.md] -* std::execution::par[link /reference/execution/execution/execution_policy.md] * std::linalg::triangular_matrix_product[color ff0000] diff --git a/reference/linalg/triangular_matrix_right_product.md b/reference/linalg/triangular_matrix_right_product.md index 6e84f7ee8c..d5f19ee85d 100644 --- a/reference/linalg/triangular_matrix_right_product.md +++ b/reference/linalg/triangular_matrix_right_product.md @@ -152,14 +152,11 @@ int main() } ``` * A.extent[link /reference/mdspan/extents/extent.md] -* std::mdspan[link /reference/mdspan/mdspan.md] -* std::extents[link /reference/mdspan/extents.md] * std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] * std::linalg::upper_triangle_t[link /reference/linalg/upper_triangle_t.md] * std::linalg::row_major_t[link /reference/linalg/row_major_t.md] * std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] * std::linalg::implicit_unit_diagonal[link /reference/linalg/implicit_unit_diagonal_t.md] -* std::execution::par[link /reference/execution/execution/execution_policy.md] * std::linalg::triangular_matrix_left_product[color ff0000] diff --git a/reference/linalg/triangular_matrix_vector_product.md b/reference/linalg/triangular_matrix_vector_product.md index 28df94dbec..090c7890bf 100644 --- a/reference/linalg/triangular_matrix_vector_product.md +++ b/reference/linalg/triangular_matrix_vector_product.md @@ -268,14 +268,11 @@ int main() ``` * A.extent[link /reference/mdspan/extents/extent.md] * v.extent[link /reference/mdspan/extents/extent.md] -* std::mdspan[link /reference/mdspan/mdspan.md] -* std::extents[link /reference/mdspan/extents.md] * std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] * std::linalg::upper_triangle_t[link /reference/linalg/upper_triangle_t.md] * std::linalg::row_major_t[link /reference/linalg/row_major_t.md] * std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] * std::linalg::implicit_unit_diagonal[link /reference/linalg/implicit_unit_diagonal_t.md] -* std::execution::par[link /reference/execution/execution/execution_policy.md] * std::linalg::triangular_matrix_vector_product[color ff0000] diff --git a/reference/linalg/triangular_matrix_vector_solve.md b/reference/linalg/triangular_matrix_vector_solve.md index 94b17c28bf..14530679e7 100644 --- a/reference/linalg/triangular_matrix_vector_solve.md +++ b/reference/linalg/triangular_matrix_vector_solve.md @@ -319,14 +319,11 @@ int main() ``` * A.extent[link /reference/mdspan/extents/extent.md] * v.extent[link /reference/mdspan/extents/extent.md] -* std::mdspan[link /reference/mdspan/mdspan.md] -* std::extents[link /reference/mdspan/extents.md] * std::linalg::layout_blas_packed[link /reference/linalg/layout_blas_packed.md] * std::linalg::upper_triangle_t[link /reference/linalg/upper_triangle_t.md] * std::linalg::row_major_t[link /reference/linalg/row_major_t.md] * std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] * std::linalg::implicit_unit_diagonal[link /reference/linalg/implicit_unit_diagonal_t.md] -* std::execution::par[link /reference/execution/execution/execution_policy.md] * std::linalg::triangular_matrix_vector_solve[color ff0000] diff --git a/reference/list/list/erase.md b/reference/list/list/erase.md index 536f400222..3520bf169d 100644 --- a/reference/list/list/erase.md +++ b/reference/list/list/erase.md @@ -70,7 +70,6 @@ int main() } ``` * erase[color ff0000] -* std::next[link /reference/iterator/next.md] * ls.begin()[link begin.md] * ls.end()[link end.md] diff --git a/reference/list/list/insert.md b/reference/list/list/insert.md index 70f3fb176c..804f8fa549 100644 --- a/reference/list/list/insert.md +++ b/reference/list/list/insert.md @@ -121,7 +121,6 @@ int main() ``` * insert[color ff0000] * ls.begin()[link begin.md] -* std::next[link /reference/iterator/next.md] ### 出力 ``` diff --git a/reference/list/list/op_constructor.md b/reference/list/list/op_constructor.md index 4a50e7dca4..3b8c119e0c 100644 --- a/reference/list/list/op_constructor.md +++ b/reference/list/list/op_constructor.md @@ -98,7 +98,6 @@ list オブジェクトの構築 } ``` * std::scoped_allocator_adaptor[link ../../scoped_allocator/scoped_allocator_adaptor.md] - * std::allocator[link ../../memory/allocator.md] * v.emplace_back[link /reference/vector/vector/emplace_back.md] diff --git a/reference/list/list/op_deduction_guide.md b/reference/list/list/op_deduction_guide.md index 0a82481b30..4a547b53c6 100644 --- a/reference/list/list/op_deduction_guide.md +++ b/reference/list/list/op_deduction_guide.md @@ -17,7 +17,6 @@ namespace std { -> list, Allocator>; // (2) C++23から } ``` -* iterator_traits[link /reference/iterator/iterator_traits.md] * ranges::input_range[link /reference/ranges/input_range.md] * allocator[link /reference/memory/allocator.md] * ranges::range_value_t[link /reference/ranges/range_value_t.md] diff --git a/reference/map/map.md b/reference/map/map.md index 75c8b0825f..d72cc475e5 100644 --- a/reference/map/map.md +++ b/reference/map/map.md @@ -22,7 +22,6 @@ namespace std { ``` * less[link ../functional/less.md] * allocator[link ../memory/allocator.md] -* pair[link /reference/utility/pair.md] * polymorphic_allocator[link /reference/memory_resource/polymorphic_allocator.md] ## 概要 @@ -264,7 +263,6 @@ int main() { std::cout << m2[Person{2, 30, "Bob"}] << std::endl; } ``` -* std::tie[link /reference/tuple/tie.md] #### 出力 ``` @@ -321,7 +319,6 @@ int main() { std::cout << m2[Person{2, 30, "Bob"}] << std::endl; } ``` -* std::tie[link /reference/tuple/tie.md] #### 出力 ``` diff --git a/reference/map/map/emplace.md b/reference/map/map/emplace.md index d3d7a013d2..4e8df268c8 100644 --- a/reference/map/map/emplace.md +++ b/reference/map/map/emplace.md @@ -9,7 +9,6 @@ template pair emplace(Args&&... args); ``` -* pair[link /reference/utility/pair.md] ## 概要 コンテナに新しい要素を挿入する。要素は直接構築される(コピーもムーブもされない)。要素のコンストラクタはこの関数に渡された引数を与えることによって呼ばれる。 @@ -131,7 +130,6 @@ int main() ``` * emplace[color ff0000] * std::piecewise_construct[link /reference/utility/piecewise_construct_t.md] -* std::forward_as_tuple[link /reference/tuple/forward_as_tuple.md] #### 出力 ``` diff --git a/reference/map/map/equal_range.md b/reference/map/map/equal_range.md index 2705fc06a1..17126d8e8d 100644 --- a/reference/map/map/equal_range.md +++ b/reference/map/map/equal_range.md @@ -17,7 +17,6 @@ template pair equal_range(const K& x) const; // (4) C++14 ``` -* pair[link /reference/utility/pair.md] ## 概要 コンテナ内の、`x` と等しいキー要素を全て含む範囲の境界を返す。`map` コンテナではキーの重複は無いため、この範囲は最大一つの要素を含む。 diff --git a/reference/map/map/insert.md b/reference/map/map/insert.md index 79c3619155..87145c9c44 100644 --- a/reference/map/map/insert.md +++ b/reference/map/map/insert.md @@ -28,7 +28,6 @@ void insert(initializer_list init); // (8) C++11 insert_return_type insert(node_type&& nh); // (9) C++17 iterator insert(const_iterator hint, node_type&& nh); // (10) C++17 ``` -* pair[link /reference/utility/pair.md] * initializer_list[link /reference/initializer_list/initializer_list.md] ## 概要 diff --git a/reference/map/map/insert_or_assign.md b/reference/map/map/insert_or_assign.md index a9e0b2b622..f29b967841 100644 --- a/reference/map/map/insert_or_assign.md +++ b/reference/map/map/insert_or_assign.md @@ -34,7 +34,6 @@ iterator K&& k, M&& obj); // (6) C++26 ``` -* pair[link /reference/utility/pair.md] ## 概要 引数 `k` で指定されたキーが存在しなければ対応する値を引数 `obj` の値として要素を挿入し(`insert`)、さもなければ(`or`)、そのキーに対応する値に引数 `obj` を代入する(`assign`)。 diff --git a/reference/map/map/op_compare_3way.md b/reference/map/map/op_compare_3way.md index 330b051d75..2575260976 100644 --- a/reference/map/map/op_compare_3way.md +++ b/reference/map/map/op_compare_3way.md @@ -12,7 +12,6 @@ namespace std { const map& y); // (1) C++20 } ``` -* pair[link /reference/utility/pair.md] ## 概要 `map`オブジェクトの三方比較を行う。 diff --git a/reference/map/map/op_constructor.md b/reference/map/map/op_constructor.md index e3f9c22a35..648874022d 100644 --- a/reference/map/map/op_constructor.md +++ b/reference/map/map/op_constructor.md @@ -115,7 +115,6 @@ map(from_range_t, R&& rg, } ``` * std::scoped_allocator_adaptor[link ../../scoped_allocator/scoped_allocator_adaptor.md] - * std::allocator[link ../../memory/allocator.md] * ls.emplace_back[link ../../list/list/emplace_back.md] なお、C++14 では同様の理由で (11) の形式も新たに追加されているが、こちらは存在しなくてもエラーとはならない。 diff --git a/reference/map/map/op_deduction_guide.md b/reference/map/map/op_deduction_guide.md index 68c7d66b6f..bfe6074397 100644 --- a/reference/map/map/op_deduction_guide.md +++ b/reference/map/map/op_deduction_guide.md @@ -48,8 +48,6 @@ namespace std { ``` * remove_const_t[link /reference/type_traits/remove_const.md] * add_const_t[link /reference/type_traits/add_const.md] -* pair[link /reference/utility/pair.md] -* iterator_traits[link /reference/iterator/iterator_traits.md] * less[link /reference/functional/less.md] * allocator[link /reference/memory/allocator.md] * initializer_list[link /reference/initializer_list/initializer_list.md] diff --git a/reference/map/map/try_emplace.md b/reference/map/map/try_emplace.md index 0659acc06d..6763461a7f 100644 --- a/reference/map/map/try_emplace.md +++ b/reference/map/map/try_emplace.md @@ -36,7 +36,6 @@ iterator K&& k, Args&&... args); // (6) C++26 ``` -* pair[link /reference/utility/pair.md] ## 概要 指定されたキーが存在しない場合のみ要素を直接構築で挿入する。 diff --git a/reference/map/multimap.md b/reference/map/multimap.md index e494b51b53..0db7e98868 100644 --- a/reference/map/multimap.md +++ b/reference/map/multimap.md @@ -22,7 +22,6 @@ namespace std { ``` * less[link /reference/functional/less.md] * allocator[link /reference/memory/allocator.md] -* pair[link /reference/utility/pair.md] * polymorphic_allocator[link /reference/memory_resource/polymorphic_allocator.md] `multimap` コンテナは 4 つのテンプレートパラメータを取る。 diff --git a/reference/map/multimap/emplace.md b/reference/map/multimap/emplace.md index 08636a76c3..d1dc23e09e 100644 --- a/reference/map/multimap/emplace.md +++ b/reference/map/multimap/emplace.md @@ -91,7 +91,6 @@ int main() ``` * emplace[color ff0000] * std::piecewise_construct[link /reference/utility/piecewise_construct_t.md] -* std::forward_as_tuple[link /reference/tuple/forward_as_tuple.md] #### 出力 ``` diff --git a/reference/map/multimap/equal_range.md b/reference/map/multimap/equal_range.md index 28fae09998..c05aa01bb7 100644 --- a/reference/map/multimap/equal_range.md +++ b/reference/map/multimap/equal_range.md @@ -17,7 +17,6 @@ template pair equal_range(const K& x) const; // (4) C++14 ``` -* pair[link /reference/utility/pair.md] ## 概要 コンテナ内の、`x` と等しい全てのキー要素を含む範囲の境界を返す。 diff --git a/reference/map/multimap/op_compare_3way.md b/reference/map/multimap/op_compare_3way.md index f73d868b70..dc5ddc220e 100644 --- a/reference/map/multimap/op_compare_3way.md +++ b/reference/map/multimap/op_compare_3way.md @@ -12,7 +12,6 @@ namespace std { const multimap& y); // (1) C++20 } ``` -* pair[link /reference/utility/pair.md] ## 概要 `multimap`オブジェクトの三方比較を行う。 diff --git a/reference/map/multimap/op_constructor.md b/reference/map/multimap/op_constructor.md index 8543c63cd9..60dbbc6cd0 100644 --- a/reference/map/multimap/op_constructor.md +++ b/reference/map/multimap/op_constructor.md @@ -118,7 +118,6 @@ multimap(from_range_t, R&& rg, } ``` * std::scoped_allocator_adaptor[link ../../scoped_allocator/scoped_allocator_adaptor.md] - * std::allocator[link ../../memory/allocator.md] * ls.emplace_back[link ../../list/list/emplace_back.md] なお、C++14 では同様の理由で (11) の形式も新たに追加されているが、こちらは存在しなくてもエラーとはならない。 diff --git a/reference/map/multimap/op_deduction_guide.md b/reference/map/multimap/op_deduction_guide.md index 03cb0ea04b..b03720968e 100644 --- a/reference/map/multimap/op_deduction_guide.md +++ b/reference/map/multimap/op_deduction_guide.md @@ -48,8 +48,6 @@ namespace std { ``` * remove_const_t[link /reference/type_traits/remove_const.md] * add_const_t[link /reference/type_traits/add_const.md] -* pair[link /reference/utility/pair.md] -* iterator_traits[link /reference/iterator/iterator_traits.md] * less[link /reference/functional/less.md] * allocator[link /reference/memory/allocator.md] * initializer_list[link /reference/initializer_list/initializer_list.md] diff --git a/reference/mdspan/full_extent_t.md b/reference/mdspan/full_extent_t.md index 78bf97479a..0de157de0f 100644 --- a/reference/mdspan/full_extent_t.md +++ b/reference/mdspan/full_extent_t.md @@ -53,7 +53,6 @@ int main() * std::submdspan[link submdspan.md] * extent[link mdspan/extent.md] * std::print[link /reference/print/print.md] -* std::println[link /reference/print/println.md] ### 出力 ``` diff --git a/reference/mdspan/index-pair-like.md b/reference/mdspan/index-pair-like.md index e4a34b71a3..b055196da8 100644 --- a/reference/mdspan/index-pair-like.md +++ b/reference/mdspan/index-pair-like.md @@ -11,7 +11,6 @@ concept index-pair-like = // exposition only convertible_to, IndexType>; ``` * pair-like[link /reference/tuple/pair-like.md] -* convertible_to[link /reference/concepts/convertible_to.md] ## 概要 `index-pair-like`は、インデクス値ペアと互換があることを表す説明専用コンセプトである。 diff --git a/reference/mdspan/mdspan/op_deduction_guide.md b/reference/mdspan/mdspan/op_deduction_guide.md index 93fdb4afed..32d8a168fc 100644 --- a/reference/mdspan/mdspan/op_deduction_guide.md +++ b/reference/mdspan/mdspan/op_deduction_guide.md @@ -64,7 +64,6 @@ namespace std { * extent_v[link /reference/type_traits/extent.md] * is_convertible_v[link /reference/type_traits/is_convertible.md] * remove_pointer_t[link /reference/type_traits/remove_pointer.md] -* remove_reference_t[link /reference/type_traits/remove_reference.md] * remove_all_extents_t[link /reference/type_traits/remove_all_extents.md] ## 概要 diff --git a/reference/mdspan/strided_slice.md b/reference/mdspan/strided_slice.md index 0636491d00..3b2e848d3e 100644 --- a/reference/mdspan/strided_slice.md +++ b/reference/mdspan/strided_slice.md @@ -84,7 +84,6 @@ int main() * std::strided_slice[color ff0000] * std::submdspan[link submdspan.md] * std::print[link /reference/print/print.md] -* std::println[link /reference/print/println.md] * std::ranges::iota[link /reference/numeric/ranges_iota.md] ### 出力 diff --git a/reference/mdspan/submdspan.md b/reference/mdspan/submdspan.md index 73d41e563c..5061e95348 100644 --- a/reference/mdspan/submdspan.md +++ b/reference/mdspan/submdspan.md @@ -152,7 +152,6 @@ int main() * std::full_extent[link full_extent_t.md] * std::strided_slice[link strided_slice.md] * std::print[link /reference/print/print.md] -* std::println[link /reference/print/println.md] * std::ranges::iota[link /reference/numeric/ranges_iota.md] #### 出力 @@ -215,7 +214,6 @@ int main() * std::strided_slice[link strided_slice.md] * std::integral_constant[link /reference/type_traits/integral_constant.md] * std::ranges::iota[link /reference/numeric/ranges_iota.md] -* std::println[link /reference/print/println.md] #### 出力 ``` diff --git a/reference/memory/allocate_shared.md b/reference/memory/allocate_shared.md index 9c2faaf86c..62aa625e2c 100644 --- a/reference/memory/allocate_shared.md +++ b/reference/memory/allocate_shared.md @@ -109,7 +109,6 @@ int main() { } ``` * std::allocate_shared[color ff0000] -* std::allocator[link allocator.md] ### 出力 ``` diff --git a/reference/memory/allocator_traits.md b/reference/memory/allocator_traits.md index 2eabf8b132..0dbfbf3c27 100644 --- a/reference/memory/allocator_traits.md +++ b/reference/memory/allocator_traits.md @@ -100,7 +100,6 @@ int main() } ``` * std::allocator_traits[color ff0000] -* std::allocator[link allocator.md] * traits::allocate[link allocator_traits/allocate.md] * traits::construct[link allocator_traits/construct.md] * traits::destroy[link allocator_traits/destroy.md] diff --git a/reference/memory/allocator_traits/allocate_at_least.md b/reference/memory/allocator_traits/allocate_at_least.md index ecb35b1e11..e27ee0a456 100644 --- a/reference/memory/allocator_traits/allocate_at_least.md +++ b/reference/memory/allocator_traits/allocate_at_least.md @@ -44,7 +44,6 @@ int main() { } ``` * allocate_at_least[color ff0000] -* std::allocator[link /reference/memory/allocator.md] * std::allocation_result[link /reference/memory/allocation_result.md] * alloc.deallocate[link /reference/memory/allocator/deallocate.md] diff --git a/reference/memory/assume_aligned.md b/reference/memory/assume_aligned.md index 01bd575d0c..5693b1367b 100644 --- a/reference/memory/assume_aligned.md +++ b/reference/memory/assume_aligned.md @@ -97,7 +97,6 @@ int main() } ``` * std::assume_aligned[color ff0000] -* std::uint64_t[link /reference/cstdint/uint64_t.md] #### 出力 diff --git a/reference/memory/construct_at.md b/reference/memory/construct_at.md index 93e22fd7fc..0103a80280 100644 --- a/reference/memory/construct_at.md +++ b/reference/memory/construct_at.md @@ -30,7 +30,6 @@ constexpr void* voidify(T& ptr) noexcept { return const_cast(static_cast(addressof(ptr))); } ``` -* addressof[link addressof.md] 以下と等価: @@ -41,7 +40,6 @@ if constexpr (is_array_v) else return ptr; ``` -* std::forward[link /reference/utility/forward.md] * is_array_v[link /reference/type_traits/is_array.md] * launder[link /reference/new/launder.md] diff --git a/reference/memory/destroy.md b/reference/memory/destroy.md index 3bf2f008c8..9ec3a317ef 100644 --- a/reference/memory/destroy.md +++ b/reference/memory/destroy.md @@ -40,7 +40,6 @@ for (; first!=last; ++first) destroy_at(addressof(*first)); ``` * destroy_at[link destroy_at.md] -* addressof[link addressof.md] ## 備考 diff --git a/reference/memory/destroy_n.md b/reference/memory/destroy_n.md index 5364002863..8458498285 100644 --- a/reference/memory/destroy_n.md +++ b/reference/memory/destroy_n.md @@ -41,7 +41,6 @@ for (; n > 0; (void)++first, --n) return first; ``` * destroy_at[link destroy_at.md] -* addressof[link addressof.md] ## 備考 diff --git a/reference/memory/get_temporary_buffer.md b/reference/memory/get_temporary_buffer.md index 85e435acf7..ddcb52a9bc 100644 --- a/reference/memory/get_temporary_buffer.md +++ b/reference/memory/get_temporary_buffer.md @@ -14,7 +14,6 @@ pair get_temporary_buffer(ptrdiff_t n); template pair get_temporary_buffer(ptrdiff_t n) noexcept; ``` -* pair[link /reference/utility/pair.md] * ptrdiff_t[link /reference/cstddef/ptrdiff_t.md] この機能は、C++17から非推奨となり、C++20で削除された。短期的な用途のメモリ領域確保には、[`alloca()`](https://web.archive.org/web/20230207110403/http://linuxjm.osdn.jp/html/LDP_man-pages/man3/alloca.3.html)のようなスタックからメモリを確保するなど、他の機能を使用すること。 @@ -86,7 +85,6 @@ int main() ``` * std::get_temporary_buffer[color ff0000] * std::ptrdiff_t[link /reference/cstddef/ptrdiff_t.md] -* std::allocator[link allocator.md] * std::allocator_traits[link allocator_traits.md] * traits::construct[link allocator_traits/construct.md] * traits::destroy[link allocator_traits/destroy.md] diff --git a/reference/memory/no-throw-forward-iterator.md b/reference/memory/no-throw-forward-iterator.md index 5fd5008733..d7589b2f5c 100644 --- a/reference/memory/no-throw-forward-iterator.md +++ b/reference/memory/no-throw-forward-iterator.md @@ -14,7 +14,6 @@ namespace std { } ``` * no-throw-input-iterator[link no-throw-input-iterator.md] -* forward_iterator[link /reference/iterator/forward_iterator.md] * no-throw-sentinel[link no-throw-sentinel.md] ## 概要 @@ -89,8 +88,6 @@ int main() { * std::remove_cvref_t[link /reference/type_traits/remove_cvref.md] * std::sentinel_for[link /reference/iterator/sentinel_for.md] * std::forward_iterator[link /reference/iterator/forward_iterator.md] -* std::forward_list[link /reference/forward_list/forward_list.md] -* std::list[link /reference/list/list.md] ### 出力 ``` diff --git a/reference/memory/no-throw-forward-range.md b/reference/memory/no-throw-forward-range.md index 04649db415..8b49d76c3e 100644 --- a/reference/memory/no-throw-forward-range.md +++ b/reference/memory/no-throw-forward-range.md @@ -14,7 +14,6 @@ namespace std { ``` * no-throw-input-range[link no-throw-input-range.md] * no-throw-forward-iterator[link no-throw-forward-iterator.md] -* iterator_t[link /reference/ranges/iterator_t.md] ## 概要 diff --git a/reference/memory/no-throw-input-iterator.md b/reference/memory/no-throw-input-iterator.md index f79ff1fa24..a7a619806a 100644 --- a/reference/memory/no-throw-input-iterator.md +++ b/reference/memory/no-throw-input-iterator.md @@ -13,10 +13,8 @@ namespace std { same_as>, iter_value_t>; } ``` -* input_iterator[link /reference/iterator/input_iterator.md] * is_lvalue_reference_v[link /reference/type_traits/is_lvalue_reference.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] -* iter_value_t[link /reference/iterator/iter_value_t.md] ## 概要 @@ -79,8 +77,6 @@ int main() { * std::iter_value_t[link /reference/iterator/iter_value_t.md] * std::same_as[link /reference/concepts/same_as.md] * std::remove_cvref_t[link /reference/type_traits/remove_cvref.md] -* std::forward_list[link /reference/forward_list/forward_list.md] -* std::list[link /reference/list/list.md] ### 出力 ``` diff --git a/reference/memory/no-throw-input-range.md b/reference/memory/no-throw-input-range.md index 55347cf015..268284b226 100644 --- a/reference/memory/no-throw-input-range.md +++ b/reference/memory/no-throw-input-range.md @@ -13,11 +13,8 @@ namespace std { no-throw-sentinel, iterator_t>; } ``` -* range[link /reference/ranges/range.md] * no-throw-input-iterator[link no-throw-input-iterator.md] * no-throw-sentinel[link no-throw-sentinel.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* sentinel_t[link /reference/ranges/sentinel_t.md] ## 概要 diff --git a/reference/memory/no-throw-sentinel.md b/reference/memory/no-throw-sentinel.md index 0ee7d68481..8d8542a9d8 100644 --- a/reference/memory/no-throw-sentinel.md +++ b/reference/memory/no-throw-sentinel.md @@ -10,7 +10,6 @@ namespace std { concept no-throw-sentinel = sentinel_for; } ``` -* sentinel_for[link /reference/iterator/sentinel_for.md] ## 概要 `no-throw-sentinel`は、以下の操作で例外を投げない、型`S`がイテレータ型`I`の番兵(*sentinel*)型であることを表す説明用コンセプトである。 diff --git a/reference/memory/ranges_construct_at.md b/reference/memory/ranges_construct_at.md index 6313908e72..5cf8afe240 100644 --- a/reference/memory/ranges_construct_at.md +++ b/reference/memory/ranges_construct_at.md @@ -30,7 +30,6 @@ constexpr void* voidify(T& ptr) noexcept { return const_cast(static_cast(addressof(ptr))); } ``` -* addressof[link addressof.md] 以下と等価: @@ -41,7 +40,6 @@ if constexpr (is_array_v) else return ptr; ``` -* std::forward[link /reference/utility/forward.md] * is_array_v[link /reference/type_traits/is_array.md] * launder[link /reference/new/launder.md] diff --git a/reference/memory/ranges_destroy.md b/reference/memory/ranges_destroy.md index d059054a45..075fcc299c 100644 --- a/reference/memory/ranges_destroy.md +++ b/reference/memory/ranges_destroy.md @@ -19,7 +19,6 @@ namespace std::ranges { * no-throw-sentinel[link no-throw-sentinel.md] * destructible[link /reference/concepts/destructible.md] * no-throw-input-range[link no-throw-input-range.md] -* range_value_t[link /reference/ranges/range_value_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 @@ -50,7 +49,6 @@ for (; first != last; ++first) return first; ``` * destroy_at[link ranges_destroy_at.md] -* addressof[link addressof.md] ## 例 @@ -86,7 +84,6 @@ int main() ``` * std::ranges::destroy[color ff0000] * std::ranges::uninitialized_default_construct[link ranges_uninitialized_default_construct.md] -* std::allocator[link allocator.md] * alloc.allocate[link allocator/allocate.md] * alloc.deallocate[link allocator/deallocate.md] diff --git a/reference/memory/ranges_destroy_n.md b/reference/memory/ranges_destroy_n.md index 95bcda180c..258acf0e1d 100644 --- a/reference/memory/ranges_destroy_n.md +++ b/reference/memory/ranges_destroy_n.md @@ -13,8 +13,6 @@ namespace std::ranges { ``` * no-throw-input-iterator[link no-throw-input-iterator.md] * destructible[link /reference/concepts/destructible.md] -* iter_value_t[link /reference/iterator/iter_value_t.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] ## 概要 イテレータ範囲`[first, first + n)`の各要素に対してデストラクタを呼び出す。 @@ -36,7 +34,6 @@ return destroy(counted_iterator(first, n), default_sentinel).base(); ``` * destroy[link ranges_destroy.md] * counted_iterator[link /reference/iterator/counted_iterator.md] -* default_sentinel[link /reference/iterator/default_sentinel_t.md] * base()[link /reference/iterator/counted_iterator/base.md] @@ -73,7 +70,6 @@ int main() ``` * std::ranges::destroy_n[color ff0000] * std::ranges::uninitialized_default_construct[link ranges_uninitialized_default_construct.md] -* std::allocator[link allocator.md] * alloc.allocate[link allocator/allocate.md] * alloc.deallocate[link allocator/deallocate.md] diff --git a/reference/memory/ranges_uninitialized_copy.md b/reference/memory/ranges_uninitialized_copy.md index 82bae40b89..6b1168ecd1 100644 --- a/reference/memory/ranges_uninitialized_copy.md +++ b/reference/memory/ranges_uninitialized_copy.md @@ -45,16 +45,11 @@ namespace std::ranges { } ``` * in_out_result[link /reference/algorithm/ranges_in_out_result.md] -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * no-throw-forward-iterator[link no-throw-forward-iterator.md] * no-throw-sentinel[link no-throw-sentinel.md] * constructible_from[link /reference/concepts/constructible_from.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] -* input_range[link /reference/ranges/input_range.md] * no-throw-forward-range[link no-throw-forward-range.md] -* range_value_t[link /reference/ranges/range_value_t.md] -* range_reference_t[link /reference/ranges/range_reference_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 @@ -91,7 +86,6 @@ constexpr void* voidify(T& obj) noexcept { return const_cast(static_cast(addressof(obj))); } ``` -* addressof[link addressof.md] 以下と等価である: @@ -102,7 +96,6 @@ for (; ifirst != ilast && ofirst != olast; ++ofirst, (void)++ifirst) { } return {std::move(ifirst), ofirst}; ``` -* remove_reference_t[link /reference/type_traits/remove_reference.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] * std::move[link /reference/utility/move.md] @@ -147,7 +140,6 @@ int main() ``` * std::ranges::uninitialized_copy[color ff0000] * std::ranges::subrange[link /reference/ranges/subrange.md] -* std::allocator[link allocator.md] * alloc.allocate[link allocator/allocate.md] * std::ranges::destroy[link ranges_destroy.md] * alloc.deallocate[link allocator/deallocate.md] diff --git a/reference/memory/ranges_uninitialized_copy_n.md b/reference/memory/ranges_uninitialized_copy_n.md index d66a32e2fd..6060168c45 100644 --- a/reference/memory/ranges_uninitialized_copy_n.md +++ b/reference/memory/ranges_uninitialized_copy_n.md @@ -34,12 +34,10 @@ namespace std::ranges { } ``` * in_out_result[link /reference/algorithm/ranges_in_out_result.md] -* input_iterator[link /reference/iterator/input_iterator.md] * no-throw-forward-iterator[link no-throw-forward-iterator.md] * no-throw-sentinel[link no-throw-sentinel.md] * constructible_from[link /reference/concepts/constructible_from.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] ## 概要 未初期化領域のイテレータ範囲`[ofirst, ofirst + n)`を配置`new`でイテレータ範囲`[ifirst, ifirst + n)`の対応する要素から初期化してコピー出力する。 @@ -71,7 +69,6 @@ return {std::move(t.in).base(), t.out}; * uninitialized_copy[link ranges_uninitialized_copy.md] * counted_iterator[link /reference/iterator/counted_iterator.md] * base()[link /reference/iterator/counted_iterator/base.md] -* default_sentinel[link /reference/iterator/default_sentinel_t.md] * std::move[link /reference/utility/move.md] ## 例外 @@ -114,7 +111,6 @@ int main() } ``` * std::ranges::uninitialized_copy_n[color ff0000] -* std::allocator[link allocator.md] * alloc.allocate[link allocator/allocate.md] * std::ranges::destroy_n[link ranges_destroy_n.md] * alloc.deallocate[link allocator/deallocate.md] diff --git a/reference/memory/ranges_uninitialized_default_construct.md b/reference/memory/ranges_uninitialized_default_construct.md index c9dc71e40b..2450c3fb17 100644 --- a/reference/memory/ranges_uninitialized_default_construct.md +++ b/reference/memory/ranges_uninitialized_default_construct.md @@ -27,10 +27,7 @@ namespace std::ranges { ``` * no-throw-forward-iterator[link no-throw-forward-iterator.md] * no-throw-sentinel[link no-throw-sentinel.md] -* default_initializable[link /reference/concepts/default_initializable.md] -* iter_value_t[link /reference/iterator/iter_value_t.md] * no-throw-forward-range[link no-throw-forward-range.md] -* range_value_t[link /reference/ranges/range_value_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 @@ -59,7 +56,6 @@ constexpr void* voidify(T& obj) noexcept { return const_cast(static_cast(addressof(obj))); } ``` -* addressof[link addressof.md] 以下と等価である: @@ -69,7 +65,6 @@ for (; first != last; ++first) ::new (voidify(*first)) remove_reference_t>; return first; ``` -* remove_reference_t[link /reference/type_traits/remove_reference.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] ## 例外 @@ -117,7 +112,6 @@ int main() ``` * std::ranges::uninitialized_default_construct[color ff0000] * std::ranges::subrange[link /reference/ranges/subrange.md] -* std::allocator[link allocator.md] * alloc.allocate[link allocator/allocate.md] * std::ranges::destroy[link ranges_destroy.md] * alloc.deallocate[link allocator/deallocate.md] diff --git a/reference/memory/ranges_uninitialized_default_construct_n.md b/reference/memory/ranges_uninitialized_default_construct_n.md index c9222a237a..3590484b13 100644 --- a/reference/memory/ranges_uninitialized_default_construct_n.md +++ b/reference/memory/ranges_uninitialized_default_construct_n.md @@ -19,9 +19,6 @@ namespace std::ranges { } ``` * no-throw-forward-iterator[link no-throw-forward-iterator.md] -* default_initializable[link /reference/concepts/default_initializable.md] -* iter_value_t[link /reference/iterator/iter_value_t.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] ## 概要 未初期化領域の範囲 (`[first, first + n)`) の各要素をデフォルト構築する。 @@ -42,7 +39,6 @@ return uninitialized_default_construct(counted_iterator(first, n), ``` * uninitialized_default_construct[link ranges_uninitialized_default_construct.md] * counted_iterator[link /reference/iterator/counted_iterator.md] -* default_sentinel[link /reference/iterator/default_sentinel_t.md] * base()[link /reference/iterator/counted_iterator/base.md] ## 例外 @@ -84,7 +80,6 @@ int main() } ``` * std::ranges::uninitialized_default_construct_n[color ff0000] -* std::allocator[link allocator.md] * alloc.allocate[link allocator/allocate.md] * std::ranges::destroy_n[link ranges_destroy_n.md] * alloc.deallocate[link allocator/deallocate.md] diff --git a/reference/memory/ranges_uninitialized_fill.md b/reference/memory/ranges_uninitialized_fill.md index 295ffe1ccd..a445b12e8b 100644 --- a/reference/memory/ranges_uninitialized_fill.md +++ b/reference/memory/ranges_uninitialized_fill.md @@ -32,9 +32,7 @@ namespace std::ranges { * no-throw-forward-iterator[link no-throw-forward-iterator.md] * no-throw-sentinel[link no-throw-sentinel.md] * constructible_from[link /reference/concepts/constructible_from.md] -* iter_value_t[link /reference/iterator/iter_value_t.md] * no-throw-forward-range[link no-throw-forward-range.md] -* range_value_t[link /reference/ranges/range_value_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 @@ -63,7 +61,6 @@ constexpr void* voidify(T& obj) noexcept { return const_cast(static_cast(addressof(obj))); } ``` -* addressof[link addressof.md] 以下と等価である: @@ -74,7 +71,6 @@ for (; first != last; ++first) { } return first; ``` -* remove_reference_t[link /reference/type_traits/remove_reference.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] ## 例外 @@ -113,7 +109,6 @@ int main() ``` * std::ranges::uninitialized_fill[color ff0000] * std::ranges::subrange[link /reference/ranges/subrange.md] -* std::allocator[link allocator.md] * alloc.allocate[link allocator/allocate.md] * std::ranges::destroy[link ranges_destroy.md] * alloc.deallocate[link allocator/deallocate.md] diff --git a/reference/memory/ranges_uninitialized_fill_n.md b/reference/memory/ranges_uninitialized_fill_n.md index 6b4c3b3cbf..31e6efbafe 100644 --- a/reference/memory/ranges_uninitialized_fill_n.md +++ b/reference/memory/ranges_uninitialized_fill_n.md @@ -22,8 +22,6 @@ namespace std::ranges { ``` * no-throw-forward-iterator[link no-throw-forward-iterator.md] * constructible_from[link /reference/concepts/constructible_from.md] -* iter_value_t[link /reference/iterator/iter_value_t.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] ## 概要 未初期化領域の範囲 (`[first, first + n)`) を、指定された値で配置`new`で初期化する。 @@ -43,7 +41,6 @@ return uninitialized_fill(counted_iterator(first, n), default_sentinel, x).base( ``` * uninitialized_fill[link ranges_uninitialized_fill.md] * counted_iterator[link /reference/iterator/counted_iterator.md] -* default_sentinel[link /reference/iterator/default_sentinel_t.md] * base()[link /reference/iterator/counted_iterator/base.md] ## 例外 @@ -81,7 +78,6 @@ int main() } ``` * std::ranges::uninitialized_fill_n[color ff0000] -* std::allocator[link allocator.md] * alloc.allocate[link allocator/allocate.md] * std::ranges::destroy_n[link ranges_destroy_n.md] * alloc.deallocate[link allocator/deallocate.md] diff --git a/reference/memory/ranges_uninitialized_move.md b/reference/memory/ranges_uninitialized_move.md index 500454ac28..bc0b4ba581 100644 --- a/reference/memory/ranges_uninitialized_move.md +++ b/reference/memory/ranges_uninitialized_move.md @@ -37,16 +37,10 @@ namespace std::ranges { } ``` * in_out_result[link /reference/algorithm/ranges_in_out_result.md] -* input_iterator[link /reference/iterator/input_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * no-throw-forward-iterator[link no-throw-forward-iterator.md] * no-throw-sentinel[link no-throw-sentinel.md] * constructible_from[link /reference/concepts/constructible_from.md] -* iter_rvalue_reference_t[link /reference/iterator/iter_rvalue_reference_t.md] -* input_range[link /reference/ranges/input_range.md] * no-throw-forward-range[link no-throw-forward-range.md] -* range_value_t[link /reference/ranges/range_value_t.md] -* range_rvalue_reference_t[link /reference/ranges/range_rvalue_reference_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 @@ -83,7 +77,6 @@ constexpr void* voidify(T& obj) noexcept { return const_cast(static_cast(addressof(obj))); } ``` -* addressof[link addressof.md] 以下と等価である: @@ -94,10 +87,8 @@ for (; ifirst != ilast && ofirst != olast; ++ofirst, (void)++ifirst) { } return {std::move(ifirst), ofirst}; ``` -* remove_reference_t[link /reference/type_traits/remove_reference.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] * std::move[link /reference/utility/move.md] -* ranges::iter_move[link /reference/iterator/iter_move.md] ## 例外 @@ -141,7 +132,6 @@ int main() ``` * std::ranges::uninitialized_move[color ff0000] * std::ranges::subrange[link /reference/ranges/subrange.md] -* std::allocator[link allocator.md] * alloc.allocate[link allocator/allocate.md] * std::ranges::destroy[link ranges_destroy.md] * alloc.deallocate[link allocator/deallocate.md] diff --git a/reference/memory/ranges_uninitialized_move_n.md b/reference/memory/ranges_uninitialized_move_n.md index 7d856577da..b5bec1bbd8 100644 --- a/reference/memory/ranges_uninitialized_move_n.md +++ b/reference/memory/ranges_uninitialized_move_n.md @@ -34,12 +34,9 @@ namespace std::ranges { } ``` * in_out_result[link /reference/algorithm/ranges_in_out_result.md] -* input_iterator[link /reference/iterator/input_iterator.md] * no-throw-forward-iterator[link no-throw-forward-iterator.md] * no-throw-sentinel[link no-throw-sentinel.md] * constructible_from[link /reference/concepts/constructible_from.md] -* iter_rvalue_reference_t[link /reference/iterator/iter_rvalue_reference_t.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] ## 概要 未初期化領域のイテレータ範囲`[ofirst, ofirst + n)`を配置`new`でイテレータ範囲`[ifirst, ifirst + n)`の対応する要素から初期化してムーブ出力する。 @@ -71,7 +68,6 @@ return {std::move(t.in).base(), t.out}; * uninitialized_move[link ranges_uninitialized_move.md] * counted_iterator[link /reference/iterator/counted_iterator.md] * base()[link /reference/iterator/counted_iterator/base.md] -* default_sentinel[link /reference/iterator/default_sentinel_t.md] * std::move[link /reference/utility/move.md] ## 例外 @@ -115,7 +111,6 @@ int main() } ``` * std::ranges::uninitialized_move_n[color ff0000] -* std::allocator[link allocator.md] * alloc.allocate[link allocator/allocate.md] * std::ranges::destroy_n[link ranges_destroy_n.md] * alloc.deallocate[link allocator/deallocate.md] diff --git a/reference/memory/ranges_uninitialized_value_construct.md b/reference/memory/ranges_uninitialized_value_construct.md index 8a751e7712..413c81d2b0 100644 --- a/reference/memory/ranges_uninitialized_value_construct.md +++ b/reference/memory/ranges_uninitialized_value_construct.md @@ -27,10 +27,7 @@ namespace std::ranges { ``` * no-throw-forward-iterator[link no-throw-forward-iterator.md] * no-throw-sentinel[link no-throw-sentinel.md] -* default_initializable[link /reference/concepts/default_initializable.md] -* iter_value_t[link /reference/iterator/iter_value_t.md] * no-throw-forward-range[link no-throw-forward-range.md] -* range_value_t[link /reference/ranges/range_value_t.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] ## 概要 @@ -59,7 +56,6 @@ constexpr void* voidify(T& obj) noexcept { return const_cast(static_cast(addressof(obj))); } ``` -* addressof[link addressof.md] 以下と等価である: @@ -69,7 +65,6 @@ for (; first != last; ++first) ::new (voidify(*first)) remove_reference_t>(); return first; ``` -* remove_reference_t[link /reference/type_traits/remove_reference.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] ## 例外 @@ -113,7 +108,6 @@ int main() ``` * std::ranges::uninitialized_value_construct[color ff0000] * std::ranges::subrange[link /reference/ranges/subrange.md] -* std::allocator[link allocator.md] * alloc.allocate[link allocator/allocate.md] * std::ranges::destroy[link ranges_destroy.md] * alloc.deallocate[link allocator/deallocate.md] diff --git a/reference/memory/ranges_uninitialized_value_construct_n.md b/reference/memory/ranges_uninitialized_value_construct_n.md index 8002e5e01f..346ee48145 100644 --- a/reference/memory/ranges_uninitialized_value_construct_n.md +++ b/reference/memory/ranges_uninitialized_value_construct_n.md @@ -19,9 +19,6 @@ namespace std::ranges { } ``` * no-throw-forward-iterator[link no-throw-forward-iterator.md] -* default_initializable[link /reference/concepts/default_initializable.md] -* iter_value_t[link /reference/iterator/iter_value_t.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] ## 概要 未初期化領域の範囲 (`[first, first + n)`) の各要素を値構築する。 @@ -42,7 +39,6 @@ return uninitialized_value_construct(counted_iterator(first, n), ``` * uninitialized_value_construct[link ranges_uninitialized_value_construct.md] * counted_iterator[link /reference/iterator/counted_iterator.md] -* default_sentinel[link /reference/iterator/default_sentinel_t.md] * base()[link /reference/iterator/counted_iterator/base.md] ## 例外 @@ -85,7 +81,6 @@ int main() } ``` * std::ranges::uninitialized_value_construct_n[color ff0000] -* std::allocator[link allocator.md] * alloc.allocate[link allocator/allocate.md] * std::ranges::destroy_n[link ranges_destroy_n.md] * alloc.deallocate[link allocator/deallocate.md] diff --git a/reference/memory/raw_storage_iterator.md b/reference/memory/raw_storage_iterator.md index 33db1827f7..60dab1da95 100644 --- a/reference/memory/raw_storage_iterator.md +++ b/reference/memory/raw_storage_iterator.md @@ -95,7 +95,6 @@ int main() } ``` * std::raw_storage_iterator[color ff0000] -* std::allocator[link allocator.md] * alloc.allocate[link allocator/allocate.md] * alloc.destroy[link allocator/destroy.md] * alloc.deallocate[link allocator/deallocate.md] diff --git a/reference/memory/return_temporary_buffer.md b/reference/memory/return_temporary_buffer.md index 89c5c75832..e5e6ecbefa 100644 --- a/reference/memory/return_temporary_buffer.md +++ b/reference/memory/return_temporary_buffer.md @@ -74,7 +74,6 @@ int main() * std::return_temporary_buffer[color ff0000] * std::get_temporary_buffer[link get_temporary_buffer.md] * std::ptrdiff_t[link /reference/cstddef/ptrdiff_t.md] -* std::allocator[link allocator.md] * std::allocator_traits[link allocator_traits.md] * traits::construct[link allocator_traits/construct.md] * traits::destroy[link allocator_traits/destroy.md] diff --git a/reference/memory/shared_ptr/op_compare_3way.md b/reference/memory/shared_ptr/op_compare_3way.md index b135169f6f..74e67ca5ad 100644 --- a/reference/memory/shared_ptr/op_compare_3way.md +++ b/reference/memory/shared_ptr/op_compare_3way.md @@ -17,7 +17,6 @@ namespace std { nullptr_t) noexcept; // (2) C++20 } ``` -* nullptr_t[link /reference/cstddef/nullptr_t.md] ## 概要 `shared_ptr`オブジェクトの三方比較を行う。 diff --git a/reference/memory/shared_ptr/op_constructor.md b/reference/memory/shared_ptr/op_constructor.md index 25a864be2f..c6790ee80e 100644 --- a/reference/memory/shared_ptr/op_constructor.md +++ b/reference/memory/shared_ptr/op_constructor.md @@ -57,7 +57,6 @@ constexpr shared_ptr(nullptr_t) noexcept; // (15) C++17 template shared_ptr(shared_ptr&& r, element_type* p) noexcept; // (16) C++20 ``` -* nullptr_t[link /reference/cstddef/nullptr_t.md] * weak_ptr[link /reference/memory/weak_ptr.md] * unique_ptr[link /reference/memory/unique_ptr.md] diff --git a/reference/memory/shared_ptr/op_equal.md b/reference/memory/shared_ptr/op_equal.md index 86efd1a163..6c848faf53 100644 --- a/reference/memory/shared_ptr/op_equal.md +++ b/reference/memory/shared_ptr/op_equal.md @@ -20,7 +20,6 @@ namespace std { const shared_ptr& x) noexcept; // (3) C++11 } ``` -* nullptr_t[link /reference/cstddef/nullptr_t.md] ## 概要 等値比較。 diff --git a/reference/memory/shared_ptr/op_greater.md b/reference/memory/shared_ptr/op_greater.md index b91470f192..b380d46459 100644 --- a/reference/memory/shared_ptr/op_greater.md +++ b/reference/memory/shared_ptr/op_greater.md @@ -20,7 +20,6 @@ namespace std { const shared_ptr& x) noexcept; // (3) C++11 } ``` -* nullptr_t[link /reference/cstddef/nullptr_t.md] ## 概要 `shared_ptr`において、左辺が右辺より大きいかを判定する。 diff --git a/reference/memory/shared_ptr/op_greater_equal.md b/reference/memory/shared_ptr/op_greater_equal.md index 3e8b17da22..490985e43e 100644 --- a/reference/memory/shared_ptr/op_greater_equal.md +++ b/reference/memory/shared_ptr/op_greater_equal.md @@ -20,7 +20,6 @@ namespace std { const shared_ptr& x) noexcept; // (3) C++11 } ``` -* nullptr_t[link /reference/cstddef/nullptr_t.md] ## 概要 `shared_ptr`において、左辺が右辺以上かを判定する。 diff --git a/reference/memory/shared_ptr/op_less.md b/reference/memory/shared_ptr/op_less.md index f0d025421d..3ed65ad637 100644 --- a/reference/memory/shared_ptr/op_less.md +++ b/reference/memory/shared_ptr/op_less.md @@ -20,7 +20,6 @@ namespace std { const shared_ptr& x) noexcept; // (3) C++11 } ``` -* nullptr_t[link /reference/cstddef/nullptr_t.md] ## 概要 `shared_ptr`において、左辺が右辺より小さいかを判定する。 diff --git a/reference/memory/shared_ptr/op_less_equal.md b/reference/memory/shared_ptr/op_less_equal.md index f6a658576b..f24b342915 100644 --- a/reference/memory/shared_ptr/op_less_equal.md +++ b/reference/memory/shared_ptr/op_less_equal.md @@ -20,7 +20,6 @@ namespace std { const shared_ptr& x) noexcept; // (3) C++11 } ``` -* nullptr_t[link /reference/cstddef/nullptr_t.md] ## 概要 `shared_ptr`において、左辺が右辺以下かを判定する。 diff --git a/reference/memory/shared_ptr/op_not_equal.md b/reference/memory/shared_ptr/op_not_equal.md index 3f1ee3e717..8b1e74cc3c 100644 --- a/reference/memory/shared_ptr/op_not_equal.md +++ b/reference/memory/shared_ptr/op_not_equal.md @@ -20,7 +20,6 @@ namespace std { const shared_ptr& x) noexcept; // (3) C++11 } ``` -* nullptr_t[link /reference/cstddef/nullptr_t.md] ## 概要 非等値比較。 diff --git a/reference/memory/shared_ptr/reinterpret_pointer_cast.md b/reference/memory/shared_ptr/reinterpret_pointer_cast.md index 84ec88f312..196418df40 100644 --- a/reference/memory/shared_ptr/reinterpret_pointer_cast.md +++ b/reference/memory/shared_ptr/reinterpret_pointer_cast.md @@ -61,8 +61,6 @@ int main() } ``` * std::reinterpret_pointer_cast[color ff0000] -* std::int8_t[link /reference/cstdint/int8_t.md] -* std::int32_t[link /reference/cstdint/int32_t.md] ### 出力 ``` diff --git a/reference/memory/uninitialized_copy.md b/reference/memory/uninitialized_copy.md index 5f3863130f..43f02a3439 100644 --- a/reference/memory/uninitialized_copy.md +++ b/reference/memory/uninitialized_copy.md @@ -41,7 +41,6 @@ namespace std { ::new (static_cast(&*result)) typename iterator_traits::value_type(*first); ``` - * iterator_traits[link /reference/iterator/iterator_traits.md] - C++17 : 以下と等価 ```cpp @@ -49,8 +48,6 @@ namespace std { ::new (static_cast(addressof(*result))) typename iterator_traits::value_type(*first); ``` - * iterator_traits[link /reference/iterator/iterator_traits.md] - * addressof[link addressof.md] ## 戻り値 @@ -98,7 +95,6 @@ int main() } ``` * std::uninitialized_copy[color ff0000] -* std::allocator[link allocator.md] * alloc.allocate[link allocator/allocate.md] * alloc.destroy[link allocator/destroy.md] * alloc.deallocate[link allocator/deallocate.md] diff --git a/reference/memory/uninitialized_copy_n.md b/reference/memory/uninitialized_copy_n.md index 54f76dcd34..91d6ff9ae3 100644 --- a/reference/memory/uninitialized_copy_n.md +++ b/reference/memory/uninitialized_copy_n.md @@ -50,7 +50,6 @@ namespace std { typename iterator_traits::value_type(*first); } ``` - * iterator_traits[link /reference/iterator/iterator_traits.md] - C++17 : 以下と等価 ```cpp @@ -59,8 +58,6 @@ namespace std { typename iterator_traits::value_type(*first); } ``` - * iterator_traits[link /reference/iterator/iterator_traits.md] - * addressof[link addressof.md] ## 戻り値 @@ -108,7 +105,6 @@ int main() } ``` * std::uninitialized_copy_n[color ff0000] -* std::allocator[link allocator.md] * alloc.allocate[link allocator/allocate.md] * alloc.destroy[link allocator/destroy.md] * alloc.deallocate[link allocator/deallocate.md] diff --git a/reference/memory/uninitialized_default_construct.md b/reference/memory/uninitialized_default_construct.md index af0a5a9e2f..950f3c0e9a 100644 --- a/reference/memory/uninitialized_default_construct.md +++ b/reference/memory/uninitialized_default_construct.md @@ -37,8 +37,6 @@ for (; first != last; ++first) ::new (static_cast(addressof(*first))) typename iterator_traits::value_type; ``` -* addressof[link addressof.md] -* iterator_traits[link /reference/iterator/iterator_traits.md] ## 戻り値 @@ -89,7 +87,6 @@ int main() } ``` * std::uninitialized_default_construct[color ff0000] -* std::allocator[link allocator.md] * alloc.allocate[link allocator/allocate.md] * alloc.deallocate[link allocator/deallocate.md] * std::destroy[link destroy.md] diff --git a/reference/memory/uninitialized_default_construct_n.md b/reference/memory/uninitialized_default_construct_n.md index 6797859c17..09c2d8fa7a 100644 --- a/reference/memory/uninitialized_default_construct_n.md +++ b/reference/memory/uninitialized_default_construct_n.md @@ -38,8 +38,6 @@ for (; n > 0; (void)++first, --n) typename iterator_traits::value_type; return first; ``` -* addressof[link addressof.md] -* iterator_traits[link /reference/iterator/iterator_traits.md] ## 例外 @@ -86,7 +84,6 @@ int main() } ``` * std::uninitialized_default_construct_n[color ff0000] -* std::allocator[link allocator.md] * alloc.allocate[link allocator/allocate.md] * alloc.deallocate[link allocator/deallocate.md] * std::destroy[link destroy.md] diff --git a/reference/memory/uninitialized_fill.md b/reference/memory/uninitialized_fill.md index 2d0d42871a..89b10d989e 100644 --- a/reference/memory/uninitialized_fill.md +++ b/reference/memory/uninitialized_fill.md @@ -38,7 +38,6 @@ namespace std { ::new (static_cast(&*first)) typename iterator_traits::value_type(x); ``` - * iterator_traits[link /reference/iterator/iterator_traits.md] - C++17 : 以下と等価 ```cpp @@ -46,8 +45,6 @@ namespace std { ::new (static_cast(addressof(*first))) typename iterator_traits::value_type(x); ``` - * iterator_traits[link /reference/iterator/iterator_traits.md] - * addressof[link addressof.md] ## 戻り値 @@ -90,7 +87,6 @@ int main() } ``` * std::uninitialized_fill[color ff0000] -* std::allocator[link allocator.md] * alloc.allocate[link allocator/allocate.md] * alloc.destroy[link allocator/destroy.md] * alloc.deallocate[link allocator/deallocate.md] diff --git a/reference/memory/uninitialized_fill_n.md b/reference/memory/uninitialized_fill_n.md index 4ca220cd2d..a0d05f426d 100644 --- a/reference/memory/uninitialized_fill_n.md +++ b/reference/memory/uninitialized_fill_n.md @@ -38,7 +38,6 @@ namespace std { ::new (static_cast(&*first)) typename iterator_traits::value_type(x); ``` - * iterator_traits[link /reference/iterator/iterator_traits.md] - C++17 : 以下と等価 ```cpp @@ -46,8 +45,6 @@ namespace std { ::new (static_cast(addressof(*first))) typename iterator_traits::value_type(x); ``` - * iterator_traits[link /reference/iterator/iterator_traits.md] - * addressof[link addressof.md] ## 戻り値 @@ -90,7 +87,6 @@ int main() } ``` * std::uninitialized_fill_n[color ff0000] -* std::allocator[link allocator.md] * alloc.allocate[link allocator/allocate.md] * alloc.destroy[link allocator/destroy.md] * alloc.deallocate[link allocator/deallocate.md] diff --git a/reference/memory/uninitialized_move.md b/reference/memory/uninitialized_move.md index c227b5f967..b200530c15 100644 --- a/reference/memory/uninitialized_move.md +++ b/reference/memory/uninitialized_move.md @@ -43,8 +43,6 @@ for (; first != last; ++result, ++first) ::new (static_cast(addressof(*result))) typename iterator_traits::value_type(std::move(*first)); ``` -* iterator_traits[link /reference/iterator/iterator_traits.md] -* addressof[link addressof.md] * std::move[link /reference/utility/move.md] @@ -92,7 +90,6 @@ int main() } ``` * std::uninitialized_move[color ff0000] -* std::allocator[link allocator.md] * alloc.allocate[link allocator/allocate.md] * alloc.destroy[link allocator/destroy.md] * alloc.deallocate[link allocator/deallocate.md] diff --git a/reference/memory/uninitialized_move_n.md b/reference/memory/uninitialized_move_n.md index 5f24b9ac81..0ef7d0d1b7 100644 --- a/reference/memory/uninitialized_move_n.md +++ b/reference/memory/uninitialized_move_n.md @@ -43,8 +43,6 @@ for (; n > 0; ++result, (void)++first, --n) ::new (static_cast(addressof(*result))) typename iterator_traits::value_type(std::move(*first)); ``` -* iterator_traits[link /reference/iterator/iterator_traits.md] -* addressof[link addressof.md] * std::move[link /reference/utility/move.md] @@ -92,7 +90,6 @@ int main() } ``` * std::uninitialized_move_n[color ff0000] -* std::allocator[link allocator.md] * alloc.allocate[link allocator/allocate.md] * std::destroy_at[link destroy_at.md] * alloc.deallocate[link allocator/deallocate.md] diff --git a/reference/memory/uninitialized_value_construct.md b/reference/memory/uninitialized_value_construct.md index 828ae8cb9d..0aa5770c29 100644 --- a/reference/memory/uninitialized_value_construct.md +++ b/reference/memory/uninitialized_value_construct.md @@ -37,8 +37,6 @@ for (; first != last; ++first) ::new (static_cast(addressof(*first))) typename iterator_traits::value_type(); ``` -* addressof[link addressof.md] -* iterator_traits[link /reference/iterator/iterator_traits.md] ## 戻り値 @@ -83,7 +81,6 @@ int main() } ``` * std::uninitialized_value_construct[color ff0000] -* std::allocator[link allocator.md] * alloc.allocate[link allocator/allocate.md] * alloc.deallocate[link allocator/deallocate.md] * std::destroy[link destroy.md] diff --git a/reference/memory/uninitialized_value_construct_n.md b/reference/memory/uninitialized_value_construct_n.md index 3c0dd5590e..82279e8cdf 100644 --- a/reference/memory/uninitialized_value_construct_n.md +++ b/reference/memory/uninitialized_value_construct_n.md @@ -38,8 +38,6 @@ for (; n > 0; (void)++first, --n) typename iterator_traits::value_type(); return first; ``` -* addressof[link addressof.md] -* iterator_traits[link /reference/iterator/iterator_traits.md] ## 例外 @@ -81,7 +79,6 @@ int main() } ``` * std::uninitialized_value_construct_n[color ff0000] -* std::allocator[link allocator.md] * alloc.allocate[link allocator/allocate.md] * alloc.deallocate[link allocator/deallocate.md] * std::destroy[link destroy.md] diff --git a/reference/memory/unique_ptr/op_assign.md b/reference/memory/unique_ptr/op_assign.md index 5cbe92b208..a9f2420464 100644 --- a/reference/memory/unique_ptr/op_assign.md +++ b/reference/memory/unique_ptr/op_assign.md @@ -20,7 +20,6 @@ constexpr unique_ptr& operator=(nullptr_t) noexcept; // (3) C++23 unique_ptr& operator=(const unique_ptr&) = delete; // (4) C++11 ``` -* nullptr_t[link /reference/cstddef/nullptr_t.md] ## 概要 - (1) : 自身が保持しているリソースを解放し、`u`から`*this`に所有権を譲渡する。 @@ -52,7 +51,6 @@ d_ = std::forward(u.get_deleter()); ``` * reset[link reset.md] * release[link release.md] -* std::forward[link /reference/utility/forward.md] * get_deleter()[link get_deleter.md] diff --git a/reference/memory/unique_ptr/op_compare_3way.md b/reference/memory/unique_ptr/op_compare_3way.md index 1fa1f245a0..43bc880884 100644 --- a/reference/memory/unique_ptr/op_compare_3way.md +++ b/reference/memory/unique_ptr/op_compare_3way.md @@ -26,7 +26,6 @@ namespace std { operator<=>(const unique_ptr& x, nullptr_t); // (2) C++23 } ``` -* nullptr_t[link /reference/cstddef/nullptr_t.md] ## 概要 `unique_ptr`オブジェクトの三方比較を行う。 diff --git a/reference/memory/unique_ptr/op_constructor.md b/reference/memory/unique_ptr/op_constructor.md index 48c6eb1bdd..079deb033b 100644 --- a/reference/memory/unique_ptr/op_constructor.md +++ b/reference/memory/unique_ptr/op_constructor.md @@ -46,7 +46,6 @@ unique_ptr(auto_ptr&& u) noexcept; // (8) 単一オブジェクト unique_ptr(const unique_ptr&) = delete; // (9) 単一オブジェクト、配列 ``` -* nullptr_t[link /reference/cstddef/nullptr_t.md] ## unique_ptrオブジェクトの構築 @@ -172,7 +171,6 @@ int main() } ``` * std::allocator_traits[link /reference/memory/allocator_traits.md] -* std::allocator[link /reference/memory/allocator.md] * destroy[link /reference/memory/allocator_traits/destroy.md] * deallocate[link /reference/memory/allocator_traits/deallocate.md] * allocate[link /reference/memory/allocator_traits/allocate.md] diff --git a/reference/memory/unique_ptr/op_equal.md b/reference/memory/unique_ptr/op_equal.md index c37169b64c..a44149466d 100644 --- a/reference/memory/unique_ptr/op_equal.md +++ b/reference/memory/unique_ptr/op_equal.md @@ -23,7 +23,6 @@ namespace std { constexpr bool operator==(nullptr_t, const unique_ptr& x) noexcept; // (3) C++23 } ``` -* nullptr_t[link /reference/cstddef/nullptr_t.md] ## 概要 等値比較。 diff --git a/reference/memory/unique_ptr/op_greater.md b/reference/memory/unique_ptr/op_greater.md index fde6c3f53b..25831b4530 100644 --- a/reference/memory/unique_ptr/op_greater.md +++ b/reference/memory/unique_ptr/op_greater.md @@ -20,7 +20,6 @@ namespace std { constexpr bool operator>(nullptr_t, const unique_ptr& x); // (3) C++23 } ``` -* nullptr_t[link /reference/cstddef/nullptr_t.md] ## 概要 `unique_ptr`において、左辺が右辺より大きいかを判定する。 diff --git a/reference/memory/unique_ptr/op_greater_equal.md b/reference/memory/unique_ptr/op_greater_equal.md index eedb1dfeb4..bb4c6e4747 100644 --- a/reference/memory/unique_ptr/op_greater_equal.md +++ b/reference/memory/unique_ptr/op_greater_equal.md @@ -20,7 +20,6 @@ namespace std { constexpr bool operator>=(nullptr_t, const unique_ptr& x); // (3) C++23 } ``` -* nullptr_t[link /reference/cstddef/nullptr_t.md] ## 概要 `unique_ptr`において、左辺が右辺以上かを判定する。 diff --git a/reference/memory/unique_ptr/op_less.md b/reference/memory/unique_ptr/op_less.md index b9fda1c5e1..2a2d161482 100644 --- a/reference/memory/unique_ptr/op_less.md +++ b/reference/memory/unique_ptr/op_less.md @@ -20,7 +20,6 @@ namespace std { constexpr bool operator<(nullptr_t, const unique_ptr& x); // (3) C++23 } ``` -* nullptr_t[link /reference/cstddef/nullptr_t.md] ## 概要 `unique_ptr`において、左辺が右辺より小さいかを判定する。 diff --git a/reference/memory/unique_ptr/op_less_equal.md b/reference/memory/unique_ptr/op_less_equal.md index 738c3e6541..44a69bd99a 100644 --- a/reference/memory/unique_ptr/op_less_equal.md +++ b/reference/memory/unique_ptr/op_less_equal.md @@ -20,7 +20,6 @@ namespace std { constexpr bool operator<=(nullptr_t, const unique_ptr& x); // (3) C++23 } ``` -* nullptr_t[link /reference/cstddef/nullptr_t.md] ## 概要 `unique_ptr`において、左辺が右辺以下かを判定する。 diff --git a/reference/memory/unique_ptr/op_not_equal.md b/reference/memory/unique_ptr/op_not_equal.md index 85c2dd109a..053a3ade20 100644 --- a/reference/memory/unique_ptr/op_not_equal.md +++ b/reference/memory/unique_ptr/op_not_equal.md @@ -23,7 +23,6 @@ namespace std { constexpr bool operator!=(nullptr_t, const unique_ptr& x) noexcept; // (3) C++23 } ``` -* nullptr_t[link /reference/cstddef/nullptr_t.md] ## 概要 非等値比較。 diff --git a/reference/memory/uses_allocator.md b/reference/memory/uses_allocator.md index 047f0b3f7d..479b81c6c1 100644 --- a/reference/memory/uses_allocator.md +++ b/reference/memory/uses_allocator.md @@ -79,7 +79,6 @@ int main() } ``` * std::uses_allocator[color ff0000] -* std::allocator[link allocator.md] * std::allocator_arg_t[link allocator_arg_t.md] ### 出力 diff --git a/reference/memory/uses_allocator_construction_args.md b/reference/memory/uses_allocator_construction_args.md index 1efdcafdc1..48cc7461bf 100644 --- a/reference/memory/uses_allocator_construction_args.md +++ b/reference/memory/uses_allocator_construction_args.md @@ -102,7 +102,6 @@ forward_as_tuple(std::forward(args)...) tuple( allocator_arg, alloc, std::forward(args)...) ``` -* tuple[link ../tuple/tuple/op_constructor.md] * allocator_arg_t[link allocator_arg_t.md] * allocator_arg[link allocator_arg_t.md] * forward[link ../utility/forward.md] @@ -131,7 +130,6 @@ make_tuple( alloc, std::forward(args2)...); }, std::forward(y))) ``` -* piecewise_construct[link ../utility/piecewise_construct_t.md] * forward[link ../utility/forward.md] * uses_allocator_construction_args[color ff0000] * apply[link ../tuple/apply.md] @@ -143,8 +141,6 @@ make_tuple( uses_allocator_construction_args(alloc, piecewise_construct, tuple<>{}, tuple<>{}) ``` -* piecewise_construct[link ../utility/piecewise_construct_t.md] -* tuple[link ../tuple/tuple/op_constructor.md] * uses_allocator_construction_args[color ff0000] - (4) : 以下と等価 @@ -154,7 +150,6 @@ uses_allocator_construction_args(alloc, piecewise_construct, forward_as_tuple(std::forward(u)), forward_as_tuple(std::forward(v))) ``` -* piecewise_construct[link ../utility/piecewise_construct_t.md] * forward_as_tuple[link ../tuple/forward_as_tuple.md] * forward[link ../utility/forward.md] * uses_allocator_construction_args[color ff0000] @@ -166,7 +161,6 @@ uses_allocator_construction_args(alloc, piecewise_construct, forward_as_tuple(pr.first), forward_as_tuple(pr.second)) ``` -* piecewise_construct[link ../utility/piecewise_construct_t.md] * forward_as_tuple[link ../tuple/forward_as_tuple.md] * uses_allocator_construction_args[color ff0000] @@ -177,7 +171,6 @@ uses_allocator_construction_args(alloc, piecewise_construct, forward_as_tuple(std::move(pr).first), forward_as_tuple(std::move(pr).second)) ``` -* piecewise_construct[link ../utility/piecewise_construct_t.md] * forward_as_tuple[link ../tuple/forward_as_tuple.md] * move[link ../utility/move.md] * uses_allocator_construction_args[color ff0000] @@ -189,7 +182,6 @@ return uses_allocator_construction_args(alloc, piecewise_construct, forward_as_tuple(get<0>(std::forward

(p))), forward_as_tuple(get<1>(std::forward

(p)))); ``` -* piecewise_construct[link ../utility/piecewise_construct_t.md] * forward_as_tuple[link ../tuple/forward_as_tuple.md] - (10) : 以下の説明用クラスを定義し、 diff --git a/reference/memory_resource/polymorphic_allocator/construct.md b/reference/memory_resource/polymorphic_allocator/construct.md index f226361eb1..c45a7860bc 100644 --- a/reference/memory_resource/polymorphic_allocator/construct.md +++ b/reference/memory_resource/polymorphic_allocator/construct.md @@ -25,9 +25,6 @@ void construct(pair* p, const pair& pr); //(5) C++17 まで template void construct(pair* p, pair&& pr); //(6) C++17 まで ``` -* pair[link /reference/utility/pair.md] -* tuple[link /reference/tuple/tuple.md] -* piecewise_construct_t[link /reference/utility/piecewise_construct_t.md] ## 概要 `p` で指定された領域に、`*this` と指定された引数で [uses-allocator 構築](/reference/memory/uses_allocator.md)を行う。 @@ -83,8 +80,6 @@ uninitialized_construct_using_allocator(p, *this, forward(args)...) ```cpp ::new(static_cast(p)) pair(piecewise_construct, xprime, yprime) ``` -* pair[link /reference/utility/pair.md] -* piecewise_construct[link /reference/utility/piecewise_construct_t.md] ここで、`xprime` は以下のルールに従って `x` から構築される [`tuple`](/reference/tuple/tuple.md) とする。(`yprime` も `y` から同様に構築されるものとする) @@ -100,8 +95,6 @@ uninitialized_construct_using_allocator(p, *this, forward(args)...) ```cpp construct(p, piecewise_construct, tuple<>(), tuple<>()); ``` -* piecewise_construct[link /reference/utility/piecewise_construct_t.md] -* tuple[link /reference/tuple/tuple.md] - (4) : 以下と等価、すなわち(2)に委譲 ```cpp @@ -109,7 +102,6 @@ construct(p, piecewise_construct, forward_as_tuple(forward(x)), forward_as_tuple(forward(y))); ``` -* piecewise_construct[link /reference/utility/piecewise_construct_t.md] * forward_as_tuple[link /reference/tuple/forward_as_tuple.md] * forward[link /reference/utility/forward.md] @@ -119,7 +111,6 @@ construct(p, piecewise_construct, forward_as_tuple(pr.first), forward_as_tuple(pr.second)); ``` -* piecewise_construct[link /reference/utility/piecewise_construct_t.md] * forward_as_tuple[link /reference/tuple/forward_as_tuple.md] - (6) : 以下と等価、すなわち(2)に委譲 @@ -128,7 +119,6 @@ construct(p, piecewise_construct, forward_as_tuple(forward(pr.first)), forward_as_tuple(forward(pr.second))); ``` -* piecewise_construct[link /reference/utility/piecewise_construct_t.md] * forward_as_tuple[link /reference/tuple/forward_as_tuple.md] * forward[link /reference/utility/forward.md] diff --git a/reference/mutex/adopt_lock.md b/reference/mutex/adopt_lock.md index f82c3ca121..fd1cc5f49b 100644 --- a/reference/mutex/adopt_lock.md +++ b/reference/mutex/adopt_lock.md @@ -39,7 +39,6 @@ int main() ``` * std::adopt_lock[color ff0000] * mtx.lock()[link mutex/lock.md] -* std::unique_lock[link unique_lock.md] ### 出力 ``` diff --git a/reference/mutex/defer_lock.md b/reference/mutex/defer_lock.md index dc94749c74..171a2f5211 100644 --- a/reference/mutex/defer_lock.md +++ b/reference/mutex/defer_lock.md @@ -36,7 +36,6 @@ int main() } ``` * std::defer_lock[color ff0000] -* std::unique_lock[link unique_lock.md] * lk.lock()[link unique_lock/lock.md] ### 出力 diff --git a/reference/mutex/lock.md b/reference/mutex/lock.md index af209a99bf..4306776f43 100644 --- a/reference/mutex/lock.md +++ b/reference/mutex/lock.md @@ -84,7 +84,6 @@ int main() * mtx1.unlock()[link mutex/unlock.md] * mtx2.unlock()[link mutex/unlock.md] * std::defer_lock[link defer_lock.md] -* std::unique_lock[link unique_lock.md] * lk2.lock()[link unique_lock/lock.md] * std::system_error[link /reference/system_error/system_error.md] * owns_lock()[link unique_lock/owns_lock.md] diff --git a/reference/mutex/try_lock.md b/reference/mutex/try_lock.md index 35801efd95..6e1f2036c5 100644 --- a/reference/mutex/try_lock.md +++ b/reference/mutex/try_lock.md @@ -90,7 +90,6 @@ int main() * std::recursive_mutex[link recursive_mutex.md] * mtx1.unlock()[link mutex/unlock.md] * mtx2.unlock()[link recursive_mutex/unlock.md] -* std::unique_lock[link unique_lock.md] * std::defer_lock[link defer_lock.md] * owns_lock()[link unique_lock/owns_lock.md] * th.join()[link /reference/thread/thread/join.md] diff --git a/reference/mutex/try_to_lock.md b/reference/mutex/try_to_lock.md index 3f88e3e6ed..9a4c5c7f01 100644 --- a/reference/mutex/try_to_lock.md +++ b/reference/mutex/try_to_lock.md @@ -40,7 +40,6 @@ int main() } ``` * std::try_to_lock[color ff0000] -* std::unique_lock[link unique_lock.md] * std::errc::device_or_resource_busy[link /reference/system_error/errc.md] * std::generic_category()[link /reference/system_error/generic_category.md] * std::system_error[link /reference/system_error/system_error.md] diff --git a/reference/new/op_new.md b/reference/new/op_new.md index 560c70bc2e..ae0e149ca6 100644 --- a/reference/new/op_new.md +++ b/reference/new/op_new.md @@ -155,7 +155,6 @@ int main() } } ``` -* [link /reference/new.md] * new[color ff0000] * std::complex[link /reference/complex/complex.md] * std::nothrow[link nothrow_t.md] diff --git a/reference/new/op_new[].md b/reference/new/op_new[].md index 6fa34217a3..93b2888954 100644 --- a/reference/new/op_new[].md +++ b/reference/new/op_new[].md @@ -155,7 +155,6 @@ int main() } } ``` -* [link /reference/new.md] * new[color ff0000] * std::complex[link /reference/complex/complex.md] * std::nothrow[link nothrow_t.md] diff --git a/reference/numeric/add_sat.md b/reference/numeric/add_sat.md index e1edb44ad8..8d5c53448b 100644 --- a/reference/numeric/add_sat.md +++ b/reference/numeric/add_sat.md @@ -49,7 +49,6 @@ int main() } ``` * std::add_sat[color ff0000] -* std::println[link /reference/print/println.md] ### 出力 ``` diff --git a/reference/numeric/div_sat.md b/reference/numeric/div_sat.md index fcba015647..0d82c9f02f 100644 --- a/reference/numeric/div_sat.md +++ b/reference/numeric/div_sat.md @@ -53,7 +53,6 @@ int main() } ``` * std::div_sat[color ff0000] -* std::println[link /reference/print/println.md] ### 出力 ``` diff --git a/reference/numeric/exclusive_scan.md b/reference/numeric/exclusive_scan.md index fa857c0e96..9861511ec5 100644 --- a/reference/numeric/exclusive_scan.md +++ b/reference/numeric/exclusive_scan.md @@ -100,7 +100,6 @@ namespace std { return exclusive_scan(std::forward(exec), first, last, result, init, plus<>()); ``` - * std::forward[link /reference/utility/forward.md] * plus[link /reference/functional/plus.md] diff --git a/reference/numeric/gcd.md b/reference/numeric/gcd.md index 3a57542323..c0a38b9a77 100644 --- a/reference/numeric/gcd.md +++ b/reference/numeric/gcd.md @@ -11,7 +11,6 @@ namespace std { constexpr common_type_t gcd(M m, N n); } ``` -* common_type_t[link /reference/type_traits/common_type.md] ## 概要 最大公約数 (greatest common divisor, gcd) を求める。 @@ -81,8 +80,6 @@ int main() { ``` * std::gcd[color ff0000] * min[link /reference/limits/numeric_limits/min.md] -* std::int32_t[link /reference/cstdint/int32_t.md] -* std::uint32_t[link /reference/cstdint/uint32_t.md] #### 出力例 ``` @@ -123,7 +120,6 @@ int main() { } ``` * std::gcd[color ff0000] -* std::accumulate[link accumulate.md] #### 出力 ``` diff --git a/reference/numeric/inclusive_scan.md b/reference/numeric/inclusive_scan.md index 71d96dfa39..09896718e0 100644 --- a/reference/numeric/inclusive_scan.md +++ b/reference/numeric/inclusive_scan.md @@ -127,7 +127,6 @@ namespace std { return inclusive_scan(std::forward(exec), first, last, result, plus<>()); ``` - * std::forward[link /reference/utility/forward.md] * plus[link /reference/functional/plus.md] diff --git a/reference/numeric/lcm.md b/reference/numeric/lcm.md index fbab46a02b..5dfbdba6f1 100644 --- a/reference/numeric/lcm.md +++ b/reference/numeric/lcm.md @@ -11,7 +11,6 @@ namespace std { constexpr common_type_t lcm(M m, N n); } ``` -* common_type_t[link /reference/type_traits/common_type.md] ## 概要 最小公倍数 (least common multiple) を求める。 @@ -84,7 +83,6 @@ int main() { } ``` * std::lcm[color ff0000] -* std::uint16_t[link /reference/cstdint/uint16_t.md] * std::gcd[link gcd.md] #### 出力例 @@ -127,7 +125,6 @@ int main() { } ``` * std::lcm[color ff0000] -* std::accumulate[link accumulate.md] #### 出力 ``` diff --git a/reference/numeric/mul_sat.md b/reference/numeric/mul_sat.md index c4bcb8d25f..e2ee030a48 100644 --- a/reference/numeric/mul_sat.md +++ b/reference/numeric/mul_sat.md @@ -49,7 +49,6 @@ int main() } ``` * std::mul_sat[color ff0000] -* std::println[link /reference/print/println.md] ### 出力 ``` diff --git a/reference/numeric/ranges_iota.md b/reference/numeric/ranges_iota.md index afd8ae3e7b..d1b6bcc282 100644 --- a/reference/numeric/ranges_iota.md +++ b/reference/numeric/ranges_iota.md @@ -17,10 +17,8 @@ namespace std::ranges { } ``` * input_or_output_iterator[link /reference/iterator/input_or_output_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * weakly_incrementable[link /reference/iterator/weakly_incrementable.md] * indirectly_writable[link /reference/iterator/indirectly_writable.md] -* output_range[link /reference/ranges/output_range.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] * iota_result[link /reference/algorithm/ranges_out_value_result.md] diff --git a/reference/numeric/reduce.md b/reference/numeric/reduce.md index bb573be8d0..341cbdff29 100644 --- a/reference/numeric/reduce.md +++ b/reference/numeric/reduce.md @@ -47,7 +47,6 @@ namespace std { BinaryOperation binary_op); // (6) C++17 } ``` -* iterator_traits[link /reference/iterator/iterator_traits.md] ## 概要 `reduce()`は、イテレータ範囲`[first, last)`を集計する関数である。[`accumulate()`](accumulate.md)関数は範囲の先頭から順に要素を集計するが、この関数は並列計算のために集計順を規定しない。 @@ -81,7 +80,6 @@ namespace std { return reduce(first, last, typename iterator_traits::value_type{}); ``` - * iterator_traits[link /reference/iterator/iterator_traits.md] - (2) : 以下と等価 ```cpp @@ -96,14 +94,11 @@ namespace std { return reduce(std::forward(exec), first, last, typename iterator_traits::value_type{}); ``` - * std::forward[link /reference/utility/forward.md] - * iterator_traits[link /reference/iterator/iterator_traits.md] - (5) : 以下と等価 ```cpp return reduce(std::forward(exec), first, last, init, plus<>()); ``` - * std::forward[link /reference/utility/forward.md] * plus[link /reference/functional/plus.md] diff --git a/reference/numeric/saturate_cast.md b/reference/numeric/saturate_cast.md index 68f26b6720..ff4c83c483 100644 --- a/reference/numeric/saturate_cast.md +++ b/reference/numeric/saturate_cast.md @@ -42,7 +42,6 @@ int main() } ``` * std::saturate_cast[color ff0000] -* std::println[link /reference/print/println.md] ### 出力 ``` diff --git a/reference/numeric/sub_sat.md b/reference/numeric/sub_sat.md index 1ff6a13a25..5c8111f48e 100644 --- a/reference/numeric/sub_sat.md +++ b/reference/numeric/sub_sat.md @@ -48,7 +48,6 @@ int main() } ``` * std::sub_sat[color ff0000] -* std::println[link /reference/print/println.md] ### 出力 ``` diff --git a/reference/numeric/transform_reduce.md b/reference/numeric/transform_reduce.md index 32c7cbcf7e..163a12ba78 100644 --- a/reference/numeric/transform_reduce.md +++ b/reference/numeric/transform_reduce.md @@ -134,7 +134,6 @@ namespace std { return transform_reduce(std::forward(exec), first1, last1, first2, init, plus<>(), multiplies<>()); ``` - * std::forward[link /reference/utility/forward.md] * plus[link /reference/functional/plus.md] * multiplies[link /reference/functional/multiplies.md] diff --git a/reference/optional/bad_optional_access.md b/reference/optional/bad_optional_access.md index 3950c409f7..842b246cb1 100644 --- a/reference/optional/bad_optional_access.md +++ b/reference/optional/bad_optional_access.md @@ -42,7 +42,6 @@ int main() } ``` * std::bad_optional_access[color ff0000] -* std::optional[link optional.md] * p.value()[link optional/value.md] ### 出力例 diff --git a/reference/optional/optional/and_then.md b/reference/optional/optional/and_then.md index 71f6ef5467..f3d85ecb72 100644 --- a/reference/optional/optional/and_then.md +++ b/reference/optional/optional/and_then.md @@ -49,7 +49,6 @@ class optional { } ``` * invoke[link /reference/functional/invoke.md] - * std::forward[link /reference/utility/forward.md] * value()[link value.md] - (2), (4) : 次と等価 @@ -62,7 +61,6 @@ class optional { } ``` * invoke[link /reference/functional/invoke.md] - * std::forward[link /reference/utility/forward.md] * std::move[link /reference/utility/move.md] * value()[link value.md] diff --git a/reference/optional/optional/op_constructor.md b/reference/optional/optional/op_constructor.md index 4d9a0d21a8..e867897a05 100644 --- a/reference/optional/optional/op_constructor.md +++ b/reference/optional/optional/op_constructor.md @@ -42,7 +42,6 @@ explicit(see below) constexpr optional(optional&& rhs); // (9) C++23 * see below[italic] * EXPLICIT[italic] * nullopt_t[link /reference/optional/nullopt_t.md] -* in_place_t[link /reference/utility/in_place_t.md] * initializer_list[link /reference/initializer_list/initializer_list.md] ## 概要 diff --git a/reference/optional/optional/or_else.md b/reference/optional/optional/or_else.md index f0a5d65bc9..9511b9ecc0 100644 --- a/reference/optional/optional/or_else.md +++ b/reference/optional/optional/or_else.md @@ -46,7 +46,6 @@ class optional { return std::forward(f)(); } ``` - * std::forward[link /reference/utility/forward.md] - (2) : 次と等価 @@ -58,7 +57,6 @@ class optional { } ``` * std::move[link /reference/utility/move.md] - * std::forward[link /reference/utility/forward.md] ## 備考 @@ -130,7 +128,6 @@ int main() ``` * or_else[color ff0000] * std::nullopt[link ../nullopt_t.md] -* std::string_view[link ../../string_view/basic_string_view.md] * std::from_chars[link ../../charconv/from_chars.md] * std::errc[link ../../system_error/errc.md] * prefix.empty()[link /reference/string_view/basic_string_view/empty.md] diff --git a/reference/optional/optional/value_or.md b/reference/optional/optional/value_or.md index 4ede16539c..e52f665683 100644 --- a/reference/optional/optional/value_or.md +++ b/reference/optional/optional/value_or.md @@ -29,7 +29,6 @@ return has_value() ? value() : static_cast(std::forward(v)); ``` * has_value()[link has_value.md] * value()[link value.md] -* std::forward[link /reference/utility/forward.md] ## 例 diff --git a/reference/ostream/basic_ostream/op_ostream.md b/reference/ostream/basic_ostream/op_ostream.md index 80d49ad68e..953a63e236 100644 --- a/reference/ostream/basic_ostream/op_ostream.md +++ b/reference/ostream/basic_ostream/op_ostream.md @@ -35,7 +35,6 @@ basic_ostream& operator<<(nullptr_t); // (19) C++17 // ストリームバッファの非書式化出力 basic_ostream& operator<<(basic_streambuf* sb); // (20) C++03 ``` -* nullptr_t[link /reference/cstddef/nullptr_t.md] * extended-floating-point-type[link /reference/stdfloat.md] ## 概要 diff --git a/reference/ostream/print.md b/reference/ostream/print.md index 6610e59ea7..284d3272e2 100644 --- a/reference/ostream/print.md +++ b/reference/ostream/print.md @@ -37,7 +37,6 @@ namespace std { * vprint_unicode[link vprint_unicode.md] * fmt.get()[link /reference/format/format_string/get.md.nolink] * make_format_args[link /reference/format/make_format_args.md] - * std::forward[link /reference/utility/forward.md] - そうでなければ、以下と等価: ```cpp @@ -46,7 +45,6 @@ namespace std { * vprint_nonunicode[link vprint_nonunicode.md] * fmt.get()[link /reference/format/format_string/get.md.nolink] * make_format_args[link /reference/format/make_format_args.md] - * std::forward[link /reference/utility/forward.md] ## 備考 diff --git a/reference/ostream/println.md b/reference/ostream/println.md index 1d1bcbe682..38cd74a69b 100644 --- a/reference/ostream/println.md +++ b/reference/ostream/println.md @@ -39,7 +39,6 @@ namespace std { ``` * print[link print.md] * format[link /reference/format/format.md] - * std::forward[link /reference/utility/forward.md] - (2) : 以下と等価: ```cpp diff --git a/reference/print/print.md b/reference/print/print.md index 73880f95ae..270fc93a5c 100644 --- a/reference/print/print.md +++ b/reference/print/print.md @@ -40,7 +40,6 @@ namespace std { print(stdout, fmt, std::forward(args)...); ``` * stdout[link /reference/cstdio/stdout.md] - * std::forward[link /reference/utility/forward.md] - (2) : - C++23 : @@ -51,7 +50,6 @@ namespace std { * vprint_unicode[link vprint_unicode.md] * fmt.get()[link /reference/format/format_string/get.md.nolink] * make_format_args[link /reference/format/make_format_args.md] - * std::forward[link /reference/utility/forward.md] - そうでなければ、以下と等価: ```cpp @@ -60,7 +58,6 @@ namespace std { * vprint_nonunicode[link vprint_nonunicode.md] * fmt.get()[link /reference/format/format_string/get.md.nolink] * make_format_args[link /reference/format/make_format_args.md] - * std::forward[link /reference/utility/forward.md] - C++26 : - 値として`(`[`enable_nonlocking_formatter_optimization`](/reference/format/enable_nonlocking_formatter_optimization.md)`<`[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`> && ...)`をもつ変数`locksafe`があるとして、 diff --git a/reference/print/println.md b/reference/print/println.md index 384f41deb8..55b7ef2872 100644 --- a/reference/print/println.md +++ b/reference/print/println.md @@ -46,7 +46,6 @@ namespace std { println(stdout, fmt, std::forward(args)...); ``` * stdout[link /reference/cstdio/stdout.md] - * std::forward[link /reference/utility/forward.md] - (2) : 以下と等価: ```cpp @@ -60,7 +59,6 @@ namespace std { ``` * print[link print.md] * format[link /reference/format/format.md] - * std::forward[link /reference/utility/forward.md] - (4) : 以下と等価: ```cpp diff --git a/reference/queue/priority_queue/op_deduction_guide.md b/reference/queue/priority_queue/op_deduction_guide.md index 90952debcf..332cfe2feb 100644 --- a/reference/queue/priority_queue/op_deduction_guide.md +++ b/reference/queue/priority_queue/op_deduction_guide.md @@ -57,7 +57,6 @@ template vector, Allocator>>; // (9) C++23から } ``` -* iterator_traits[link /reference/iterator/iterator_traits.md] * less[link /reference/functional/less.md] * vector[link /reference/vector/vector.md] * ranges::input_range[link /reference/ranges/input_range.md] diff --git a/reference/queue/queue/emplace.md b/reference/queue/queue/emplace.md index 35e94b1b2d..dca91c0adc 100644 --- a/reference/queue/queue/emplace.md +++ b/reference/queue/queue/emplace.md @@ -22,13 +22,11 @@ decltype(auto) emplace(Args&&... args); // C++17 から ```cpp c.emplace_back(std::forward(args)...); ``` -* std::forward[link /reference/utility/forward.md] - C++17 から ```cpp return c.emplace_back(std::forward(args)...); ``` -* std::forward[link /reference/utility/forward.md] ## 戻り値 diff --git a/reference/random.md b/reference/random.md index 4aa2ee9b2a..cc1efd3fd3 100644 --- a/reference/random.md +++ b/reference/random.md @@ -181,7 +181,6 @@ int main() } } ``` -* seed_gen()[link random/random_device/op_call.md] * std::uniform_real_distribution[link random/uniform_real_distribution.md] * std::normal_distribution[link random/normal_distribution.md] * std::ofstream[link fstream/basic_ofstream.md] diff --git a/reference/random/bernoulli_distribution.md b/reference/random/bernoulli_distribution.md index 127a27ec1b..ea0e8cfbe3 100644 --- a/reference/random/bernoulli_distribution.md +++ b/reference/random/bernoulli_distribution.md @@ -91,7 +91,6 @@ int main() } ``` * std::bernoulli_distribution[color ff0000] -* seed_gen()[link random_device/op_call.md] * std::ofstream[link /reference/fstream/basic_ofstream.md] * dist(engine)[link bernoulli_distribution/op_call.md] diff --git a/reference/random/default_random_engine.md b/reference/random/default_random_engine.md index 85355025e4..8445b08d64 100644 --- a/reference/random/default_random_engine.md +++ b/reference/random/default_random_engine.md @@ -45,7 +45,6 @@ int main() } ``` * std::default_random_engine[color ff0000] -* std::uniform_int_distribution[link uniform_int_distribution.md] * dist(engine)[link uniform_int_distribution/op_call.md] ### 出力例 diff --git a/reference/random/discard_block_engine/max.md b/reference/random/discard_block_engine/max.md index 238737c4f3..e0ca632a6d 100644 --- a/reference/random/discard_block_engine/max.md +++ b/reference/random/discard_block_engine/max.md @@ -34,7 +34,6 @@ int main() ``` * max()[color ff0000] * std::ranlux24[link /reference/random/ranlux24.md] -* std::uint32_t[link /reference/cstdint/uint32_t.md] ### 出力 ``` diff --git a/reference/random/discard_block_engine/min.md b/reference/random/discard_block_engine/min.md index a772cdf566..7df2478f49 100644 --- a/reference/random/discard_block_engine/min.md +++ b/reference/random/discard_block_engine/min.md @@ -34,7 +34,6 @@ int main() ``` * min()[color ff0000] * std::ranlux24[link /reference/random/ranlux24.md] -* std::uint32_t[link /reference/cstdint/uint32_t.md] ### 出力 ``` diff --git a/reference/random/discard_block_engine/op_call.md b/reference/random/discard_block_engine/op_call.md index ca660608ff..70844551ec 100644 --- a/reference/random/discard_block_engine/op_call.md +++ b/reference/random/discard_block_engine/op_call.md @@ -45,7 +45,6 @@ int main() ``` * engine()[color ff0000] * std::ranlux24[link /reference/random/ranlux24.md] -* std::uint32_t[link /reference/cstdint/uint32_t.md] ### 出力例 ``` diff --git a/reference/random/discard_block_engine/op_constructor.md b/reference/random/discard_block_engine/op_constructor.md index 6709715cc8..583d0dc753 100644 --- a/reference/random/discard_block_engine/op_constructor.md +++ b/reference/random/discard_block_engine/op_constructor.md @@ -93,7 +93,6 @@ int main() * std::ranlux24[link /reference/random/ranlux24.md] * std::ranlux24_base[link /reference/random/ranlux24_base.md] * std::seed_seq[link /reference/random/seed_seq.md] -* std::uint32_t[link /reference/cstdint/uint32_t.md] * seeds.begin()[link /reference/array/array/begin.md] * seeds.end()[link /reference/array/array/end.md] * std::move[link /reference/utility/move.md] diff --git a/reference/random/discard_block_engine/seed.md b/reference/random/discard_block_engine/seed.md index 8a059d374f..f5a5fb741e 100644 --- a/reference/random/discard_block_engine/seed.md +++ b/reference/random/discard_block_engine/seed.md @@ -92,7 +92,6 @@ int main() * std::seed_seq[link /reference/random/seed_seq.md] * seeds.begin()[link /reference/array/array/begin.md] * seeds.end()[link /reference/array/array/end.md] -* std::uint32_t[link /reference/cstdint/uint32_t.md] ### 出力 ``` diff --git a/reference/random/generate_random.md b/reference/random/generate_random.md index 254bb192a8..8f6c41a7e5 100644 --- a/reference/random/generate_random.md +++ b/reference/random/generate_random.md @@ -36,14 +36,8 @@ namespace std::ranges { generate_random(O first, S last, G&& g, D&& d); // (4) C++26 } ``` -* output_range[link /reference/ranges/output_range.md] * uniform_random_bit_generator[link uniform_random_bit_generator.md] -* invoke_result_t[link /reference/type_traits/invoke_result.md] -* remove_cvref_t[link /reference/type_traits/remove_cvref.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] -* output_iterator[link /reference/iterator/output_iterator.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] -* invocable[link /reference/concepts/invocable.md] ## 概要 乱数列を生成する。 @@ -74,7 +68,6 @@ for (auto& x : v) { x = dist(gen); } ``` -* std::uniform_int_distribution[link uniform_int_distribution.md] ## 効果 @@ -90,7 +83,6 @@ for (auto& x : v) { ```cpp return generate_random(subrange(std::move(first), last), g); ``` - * subrange[link /reference/ranges/subrange.md] * std::move[link /reference/utility/move.md] - (3) : @@ -105,7 +97,6 @@ for (auto& x : v) { ```cpp return generate_random(subrange(std::move(first), last), g, d); ``` - * subrange[link /reference/ranges/subrange.md] * std::move[link /reference/utility/move.md] @@ -114,7 +105,6 @@ for (auto& x : v) { ```cpp return ranges::end(r); ``` - * ranges::end[link /reference/ranges/end.md] ## 例 @@ -141,7 +131,6 @@ int main() } ``` * std::ranges::generate_random[color ff0000] -* std::uniform_int_distribution[link uniform_int_distribution.md] ### 出力例 ``` diff --git a/reference/random/independent_bits_engine.md b/reference/random/independent_bits_engine.md index ec8f86f93e..409f32022b 100644 --- a/reference/random/independent_bits_engine.md +++ b/reference/random/independent_bits_engine.md @@ -96,8 +96,6 @@ int main() } ``` * std::independent_bits_engine[color ff0000] -* std::mt19937[link mt19937.md] -* std::uint64_t[link /reference/cstdint/uint64_t.md] * engine()[link independent_bits_engine/op_call.md] ### 出力 diff --git a/reference/random/independent_bits_engine/base.md b/reference/random/independent_bits_engine/base.md index f4b5699d11..7a2e63056c 100644 --- a/reference/random/independent_bits_engine/base.md +++ b/reference/random/independent_bits_engine/base.md @@ -32,7 +32,6 @@ int main() } ``` * base()[color ff0000] -* std::uint64_t[link /reference/cstdint/uint64_t.md] ### 出力 ``` diff --git a/reference/random/independent_bits_engine/discard.md b/reference/random/independent_bits_engine/discard.md index 45b3628a4a..75a61b40c6 100644 --- a/reference/random/independent_bits_engine/discard.md +++ b/reference/random/independent_bits_engine/discard.md @@ -57,7 +57,6 @@ int main() } ``` * discard[color ff0000] -* std::uint64_t[link /reference/cstdint/uint64_t.md] * engine()[link op_call.md] * seed()[link seed.md] diff --git a/reference/random/independent_bits_engine/max.md b/reference/random/independent_bits_engine/max.md index 1d261f1650..24ba90e02e 100644 --- a/reference/random/independent_bits_engine/max.md +++ b/reference/random/independent_bits_engine/max.md @@ -35,7 +35,6 @@ int main() } ``` * max()[color ff0000] -* std::uint64_t[link /reference/cstdint/uint64_t.md] ### 出力 ``` diff --git a/reference/random/independent_bits_engine/min.md b/reference/random/independent_bits_engine/min.md index fb75890334..a6b7e72803 100644 --- a/reference/random/independent_bits_engine/min.md +++ b/reference/random/independent_bits_engine/min.md @@ -35,7 +35,6 @@ int main() } ``` * min()[color ff0000] -* std::uint64_t[link /reference/cstdint/uint64_t.md] ### 出力 ``` diff --git a/reference/random/independent_bits_engine/op_call.md b/reference/random/independent_bits_engine/op_call.md index 36b6157a81..3563a7d440 100644 --- a/reference/random/independent_bits_engine/op_call.md +++ b/reference/random/independent_bits_engine/op_call.md @@ -45,7 +45,6 @@ int main() } ``` * engine()[color ff0000] -* std::uint64_t[link /reference/cstdint/uint64_t.md] ### 出力例 ``` diff --git a/reference/random/independent_bits_engine/op_constructor.md b/reference/random/independent_bits_engine/op_constructor.md index e8e3750b1e..47fc9cf088 100644 --- a/reference/random/independent_bits_engine/op_constructor.md +++ b/reference/random/independent_bits_engine/op_constructor.md @@ -93,9 +93,7 @@ int main() } } ``` -* std::uint64_t[link /reference/cstdint/uint64_t.md] * std::seed_seq[link /reference/random/seed_seq.md] -* std::uint32_t[link /reference/cstdint/uint32_t.md] * std::move[link /reference/utility/move.md] * seeds.begin()[link /reference/array/array/begin.md] * seeds.end()[link /reference/array/array/end.md] diff --git a/reference/random/independent_bits_engine/op_equal.md b/reference/random/independent_bits_engine/op_equal.md index d13e70155a..b81e346f97 100644 --- a/reference/random/independent_bits_engine/op_equal.md +++ b/reference/random/independent_bits_engine/op_equal.md @@ -46,7 +46,6 @@ int main() } } ``` -* std::uint64_t[link /reference/cstdint/uint64_t.md] ### 出力 ``` diff --git a/reference/random/independent_bits_engine/op_istream.md b/reference/random/independent_bits_engine/op_istream.md index 319650cc61..e657f3fa6b 100644 --- a/reference/random/independent_bits_engine/op_istream.md +++ b/reference/random/independent_bits_engine/op_istream.md @@ -64,7 +64,6 @@ int main() } } ``` -* std::uint64_t[link /reference/cstdint/uint64_t.md] * std::stringstream[link /reference/sstream/basic_stringstream.md] * ss.str()[link /reference/sstream/basic_stringstream/str.md] diff --git a/reference/random/independent_bits_engine/op_not_equal.md b/reference/random/independent_bits_engine/op_not_equal.md index c040e8941e..d21c94f403 100644 --- a/reference/random/independent_bits_engine/op_not_equal.md +++ b/reference/random/independent_bits_engine/op_not_equal.md @@ -48,7 +48,6 @@ int main() } } ``` -* std::uint64_t[link /reference/cstdint/uint64_t.md] ### 出力 ``` diff --git a/reference/random/independent_bits_engine/op_ostream.md b/reference/random/independent_bits_engine/op_ostream.md index ea9b04b4e4..84c5bcf995 100644 --- a/reference/random/independent_bits_engine/op_ostream.md +++ b/reference/random/independent_bits_engine/op_ostream.md @@ -43,7 +43,6 @@ int main() std::cout << engine << std::endl; } ``` -* std::uint64_t[link /reference/cstdint/uint64_t.md] ### 出力例 ``` diff --git a/reference/random/independent_bits_engine/seed.md b/reference/random/independent_bits_engine/seed.md index 102bd50211..adccc5fee3 100644 --- a/reference/random/independent_bits_engine/seed.md +++ b/reference/random/independent_bits_engine/seed.md @@ -89,9 +89,7 @@ int main() * seed()[color ff0000] * seed(seed)[color ff0000] * seed(seq)[color ff0000] -* std::uint64_t[link /reference/cstdint/uint64_t.md] * std::seed_seq[link /reference/random/seed_seq.md] -* std::uint32_t[link /reference/cstdint/uint32_t.md] * seeds.begin()[link /reference/array/array/begin.md] * seeds.end()[link /reference/array/array/end.md] diff --git a/reference/random/knuth_b.md b/reference/random/knuth_b.md index 1c6d6ea388..01c52845be 100644 --- a/reference/random/knuth_b.md +++ b/reference/random/knuth_b.md @@ -70,7 +70,6 @@ int main() } ``` * std::knuth_b[color ff0000] -* std::uint64_t[link /reference/cstdint/uint64_t.md] ### 出力例 ``` diff --git a/reference/random/linear_congruential_engine.md b/reference/random/linear_congruential_engine.md index 3cfa8af5af..1178d1078f 100644 --- a/reference/random/linear_congruential_engine.md +++ b/reference/random/linear_congruential_engine.md @@ -119,7 +119,6 @@ int main() } ``` * std::minstd_rand[color ff0000] -* std::uint32_t[link /reference/cstdint/uint32_t.md] * engine()[link linear_congruential_engine/op_call.md] ### 出力 diff --git a/reference/random/linear_congruential_engine/max.md b/reference/random/linear_congruential_engine/max.md index 57ea8a8480..b7c8d8decc 100644 --- a/reference/random/linear_congruential_engine/max.md +++ b/reference/random/linear_congruential_engine/max.md @@ -34,7 +34,6 @@ int main() ``` * max()[color ff0000] * std::minstd_rand[link /reference/random/minstd_rand.md] -* std::uint32_t[link /reference/cstdint/uint32_t.md] ### 出力 ``` diff --git a/reference/random/linear_congruential_engine/min.md b/reference/random/linear_congruential_engine/min.md index dc9f873afd..ddf263818f 100644 --- a/reference/random/linear_congruential_engine/min.md +++ b/reference/random/linear_congruential_engine/min.md @@ -34,7 +34,6 @@ int main() ``` * min()[color ff0000] * std::minstd_rand[link /reference/random/minstd_rand.md] -* std::uint32_t[link /reference/cstdint/uint32_t.md] ### 出力 ``` diff --git a/reference/random/linear_congruential_engine/op_call.md b/reference/random/linear_congruential_engine/op_call.md index 439d1b40f3..e2adc968ce 100644 --- a/reference/random/linear_congruential_engine/op_call.md +++ b/reference/random/linear_congruential_engine/op_call.md @@ -45,7 +45,6 @@ int main() ``` * engine()[color ff0000] * std::minstd_rand[link /reference/random/minstd_rand.md] -* std::uint32_t[link /reference/cstdint/uint32_t.md] ### 出力例 ``` diff --git a/reference/random/linear_congruential_engine/op_constructor.md b/reference/random/linear_congruential_engine/op_constructor.md index 9aa822f6a2..6aaec9c7a9 100644 --- a/reference/random/linear_congruential_engine/op_constructor.md +++ b/reference/random/linear_congruential_engine/op_constructor.md @@ -79,7 +79,6 @@ int main() } ``` * std::minstd_rand[link /reference/random/minstd_rand.md] -* std::uint32_t[link /reference/cstdint/uint32_t.md] * seeds.begin()[link /reference/array/array/begin.md] * seeds.end()[link /reference/array/array/end.md] diff --git a/reference/random/linear_congruential_engine/seed.md b/reference/random/linear_congruential_engine/seed.md index 6d9ce25fd8..2a60e7f637 100644 --- a/reference/random/linear_congruential_engine/seed.md +++ b/reference/random/linear_congruential_engine/seed.md @@ -85,7 +85,6 @@ int main() * seed(seed)[color ff0000] * seed(seq)[color ff0000] * std::minstd_rand[link /reference/random/minstd_rand.md] -* std::uint32_t[link /reference/cstdint/uint32_t.md] * seeds.begin()[link /reference/array/array/begin.md] * seeds.end()[link /reference/array/array/end.md] diff --git a/reference/random/mersenne_twister_engine.md b/reference/random/mersenne_twister_engine.md index 9761383bf4..503a6668f7 100644 --- a/reference/random/mersenne_twister_engine.md +++ b/reference/random/mersenne_twister_engine.md @@ -143,7 +143,6 @@ int main() } } ``` -* std::uint32_t[link /reference/cstdint/uint32_t.md] * engine()[link mersenne_twister_engine/op_call.md] ### 出力例 diff --git a/reference/random/mersenne_twister_engine/max.md b/reference/random/mersenne_twister_engine/max.md index bc61342c1e..2e249ac510 100644 --- a/reference/random/mersenne_twister_engine/max.md +++ b/reference/random/mersenne_twister_engine/max.md @@ -33,7 +33,6 @@ int main() } ``` * max()[color ff0000] -* std::uint32_t[link /reference/cstdint/uint32_t.md] ### 出力 ``` diff --git a/reference/random/mersenne_twister_engine/min.md b/reference/random/mersenne_twister_engine/min.md index 40eb5899ac..d8f2628d2c 100644 --- a/reference/random/mersenne_twister_engine/min.md +++ b/reference/random/mersenne_twister_engine/min.md @@ -33,7 +33,6 @@ int main() } ``` * min()[color ff0000] -* std::uint32_t[link /reference/cstdint/uint32_t.md] ### 出力 ``` diff --git a/reference/random/mersenne_twister_engine/op_call.md b/reference/random/mersenne_twister_engine/op_call.md index 31b18f357c..56ccbc576a 100644 --- a/reference/random/mersenne_twister_engine/op_call.md +++ b/reference/random/mersenne_twister_engine/op_call.md @@ -44,7 +44,6 @@ int main() } ``` * engine()[color ff0000] -* std::uint32_t[link /reference/cstdint/uint32_t.md] ### 出力例 ``` diff --git a/reference/random/mersenne_twister_engine/op_constructor.md b/reference/random/mersenne_twister_engine/op_constructor.md index 316b358724..7759752741 100644 --- a/reference/random/mersenne_twister_engine/op_constructor.md +++ b/reference/random/mersenne_twister_engine/op_constructor.md @@ -80,7 +80,6 @@ int main() } ``` * engine()[link op_call.md] -* std::uint32_t[link /reference/cstdint/uint32_t.md] * std::seed_seq[link /reference/random/seed_seq.md] * seeds.begin()[link /reference/array/array/begin.md] * seeds.end()[link /reference/array/array/end.md] diff --git a/reference/random/mersenne_twister_engine/seed.md b/reference/random/mersenne_twister_engine/seed.md index d602a71d48..f1d9f6daa7 100644 --- a/reference/random/mersenne_twister_engine/seed.md +++ b/reference/random/mersenne_twister_engine/seed.md @@ -85,7 +85,6 @@ int main() * seed(seed)[color ff0000] * seed(seq)[color ff0000] * engine()[link op_call.md] -* std::uint32_t[link /reference/cstdint/uint32_t.md] * std::seed_seq[link /reference/random/seed_seq.md] * seeds.begin()[link /reference/array/array/begin.md] * seeds.end()[link /reference/array/array/end.md] diff --git a/reference/random/minstd_rand.md b/reference/random/minstd_rand.md index 8fce062f54..dd04f2b15f 100644 --- a/reference/random/minstd_rand.md +++ b/reference/random/minstd_rand.md @@ -83,7 +83,6 @@ int main() } ``` * std::minstd_rand[color ff0000] -* std::uint32_t[link /reference/cstdint/uint32_t.md] * engine()[link linear_congruential_engine/op_call.md] ### 出力例 diff --git a/reference/random/minstd_rand0.md b/reference/random/minstd_rand0.md index fff56cb265..35feebaec7 100644 --- a/reference/random/minstd_rand0.md +++ b/reference/random/minstd_rand0.md @@ -85,7 +85,6 @@ int main() } ``` * std::minstd_rand0[color ff0000] -* std::uint32_t[link /reference/cstdint/uint32_t.md] * engine()[link linear_congruential_engine/op_call.md] ### 出力例 diff --git a/reference/random/mt19937.md b/reference/random/mt19937.md index f2493a35bc..f3f68118e6 100644 --- a/reference/random/mt19937.md +++ b/reference/random/mt19937.md @@ -78,8 +78,6 @@ int main() } ``` * std::mt19937[color ff0000] -* std::random_device[link random_device.md] -* seed_gen()[link random_device/op_call.md] * engine()[link mersenne_twister_engine/op_call.md] ### 出力例 diff --git a/reference/random/mt19937_64.md b/reference/random/mt19937_64.md index 6c577c1aaf..02984a56eb 100644 --- a/reference/random/mt19937_64.md +++ b/reference/random/mt19937_64.md @@ -76,7 +76,6 @@ int main() } ``` * std::mt19937_64[color ff0000] -* std::uint64_t[link /reference/cstdint/uint64_t.md] * engine()[link mersenne_twister_engine/op_call.md] ### 出力例 diff --git a/reference/random/philox4x32.md b/reference/random/philox4x32.md index b0df428ac4..04bf3a41ca 100644 --- a/reference/random/philox4x32.md +++ b/reference/random/philox4x32.md @@ -55,8 +55,6 @@ int main() } ``` * std::philox4x32[color ff0000] -* std::random_device[link random_device.md] -* seed_gen()[link random_device/op_call.md] * engine()[link philox_engine/op_call.md] ### 出力例 diff --git a/reference/random/philox4x64.md b/reference/random/philox4x64.md index 5ca75d3076..37375e8344 100644 --- a/reference/random/philox4x64.md +++ b/reference/random/philox4x64.md @@ -55,8 +55,6 @@ int main() } ``` * std::philox4x64[color ff0000] -* std::random_device[link random_device.md] -* seed_gen()[link random_device/op_call.md] * engine()[link philox_engine/op_call.md] ### 出力例 diff --git a/reference/random/philox_engine.md b/reference/random/philox_engine.md index e664d1dc17..b2f32377a1 100644 --- a/reference/random/philox_engine.md +++ b/reference/random/philox_engine.md @@ -183,7 +183,6 @@ int main() } ``` * std::philox4x32[link philox4x32.md] -* std::uint32_t[link /reference/cstdint/uint32_t.md] * engine()[link philox_engine/op_call.md] #### 出力例 @@ -237,7 +236,6 @@ int main() * std::philox4x32[link philox4x32.md] * engine.set_counter[link philox_engine/set_counter.md] * uniform_real_distribution[link /reference/random/uniform_real_distribution.md] -* std::uint32_t[link /reference/cstdint/uint32_t.md] * dist(engine)[link /reference/random/uniform_real_distribution/op_call.md] #### 出力例 diff --git a/reference/random/philox_engine/max.md b/reference/random/philox_engine/max.md index c3140111b6..0b12fc1c37 100644 --- a/reference/random/philox_engine/max.md +++ b/reference/random/philox_engine/max.md @@ -33,7 +33,6 @@ int main() } ``` * max()[color ff0000] -* std::uint32_t[link /reference/cstdint/uint32_t.md] ### 出力 ``` diff --git a/reference/random/philox_engine/min.md b/reference/random/philox_engine/min.md index 5521bda44b..11e3cce273 100644 --- a/reference/random/philox_engine/min.md +++ b/reference/random/philox_engine/min.md @@ -33,7 +33,6 @@ int main() } ``` * min()[color ff0000] -* std::uint32_t[link /reference/cstdint/uint32_t.md] ### 出力 ``` diff --git a/reference/random/philox_engine/op_call.md b/reference/random/philox_engine/op_call.md index 06682dfd20..c9bf8d440c 100644 --- a/reference/random/philox_engine/op_call.md +++ b/reference/random/philox_engine/op_call.md @@ -43,7 +43,6 @@ int main() } ``` * engine()[color ff0000] -* std::uint32_t[link /reference/cstdint/uint32_t.md] ### 出力例 ``` diff --git a/reference/random/philox_engine/op_constructor.md b/reference/random/philox_engine/op_constructor.md index 8f5d50f50a..567efc488e 100644 --- a/reference/random/philox_engine/op_constructor.md +++ b/reference/random/philox_engine/op_constructor.md @@ -92,7 +92,6 @@ int main() } ``` * engine()[link op_call.md] -* std::uint32_t[link /reference/cstdint/uint32_t.md] * std::seed_seq[link /reference/random/seed_seq.md] * seeds.begin()[link /reference/array/array/begin.md] * seeds.end()[link /reference/array/array/end.md] diff --git a/reference/random/philox_engine/seed.md b/reference/random/philox_engine/seed.md index 5c3fef7b81..1b666e8d19 100644 --- a/reference/random/philox_engine/seed.md +++ b/reference/random/philox_engine/seed.md @@ -85,7 +85,6 @@ int main() * seed(seed)[color ff0000] * seed(seq)[color ff0000] * engine()[link op_call.md] -* std::uint32_t[link /reference/cstdint/uint32_t.md] * std::seed_seq[link /reference/random/seed_seq.md] * seeds.begin()[link /reference/array/array/begin.md] * seeds.end()[link /reference/array/array/end.md] diff --git a/reference/random/philox_engine/set_counter.md b/reference/random/philox_engine/set_counter.md index ac662971a5..b096b603f8 100644 --- a/reference/random/philox_engine/set_counter.md +++ b/reference/random/philox_engine/set_counter.md @@ -100,7 +100,6 @@ int main() * set_counter[color ff0000] * engine.seed[link seed.md] * uniform_real_distribution[link /reference/random/uniform_real_distribution.md] -* std::uint32_t[link /reference/cstdint/uint32_t.md] ### 出力例 ``` diff --git a/reference/random/random_device.md b/reference/random/random_device.md index c34bca9db6..9d3862957e 100644 --- a/reference/random/random_device.md +++ b/reference/random/random_device.md @@ -314,7 +314,6 @@ int main() * std::generate[link /reference/algorithm/generate.md] * std::ref[link /reference/functional/ref.md] * std::seed_seq[link /reference/random/seed_seq.md] -* std::uniform_int_distribution[link /reference/random/uniform_int_distribution.md] * dist(engine)[link /reference/random/uniform_int_distribution/op_call.md] * sed_v.begin()[link /reference/array/array/begin.md] * sed_v.end()[link /reference/array/array/end.md] diff --git a/reference/random/ranlux24.md b/reference/random/ranlux24.md index d19935ba16..fd880f71d7 100644 --- a/reference/random/ranlux24.md +++ b/reference/random/ranlux24.md @@ -69,9 +69,6 @@ int main() } ``` * std::ranlux24[color ff0000] -* std::random_device[link random_device.md] -* seed_gen()[link random_device/op_call.md] -* std::uint32_t[link /reference/cstdint/uint32_t.md] * engine()[link discard_block_engine/op_call.md] ### 出力例 diff --git a/reference/random/ranlux48.md b/reference/random/ranlux48.md index c082a775e6..5b9d982511 100644 --- a/reference/random/ranlux48.md +++ b/reference/random/ranlux48.md @@ -69,9 +69,6 @@ int main() } ``` * std::ranlux48[color ff0000] -* std::random_device[link random_device.md] -* seed_gen()[link random_device/op_call.md] -* std::uint64_t[link /reference/cstdint/uint64_t.md] * engine()[link discard_block_engine/op_call.md] ### 出力例 diff --git a/reference/random/seed_seq.md b/reference/random/seed_seq.md index 89b47c8e2e..c4b0f60a7c 100644 --- a/reference/random/seed_seq.md +++ b/reference/random/seed_seq.md @@ -85,13 +85,10 @@ int main() } ``` * std::seed_seq[color ff0000] -* std::mt19937[link mt19937.md] -* std::random_device[link random_device.md] * std::generate[link /reference/algorithm/generate.md] * seed_data.begin()[link /reference/array/array/begin.md] * seed_data.end()[link /reference/array/array/end.md] * std::ref[link /reference/functional/ref.md] -* std::uint32_t[link /reference/cstdint/uint32_t.md] * engine()[link mersenne_twister_engine/op_call.md] ### 出力例 diff --git a/reference/random/seed_seq/generate.md b/reference/random/seed_seq/generate.md index 9d2533f978..1c490fb419 100644 --- a/reference/random/seed_seq/generate.md +++ b/reference/random/seed_seq/generate.md @@ -83,7 +83,6 @@ int main() * generate[color ff0000] * seeds.begin()[link /reference/vector/vector/begin.md] * seeds.end()[link /reference/vector/vector/end.md] -* std::uint32_t[link /reference/cstdint/uint32_t.md] ### 出力 ``` diff --git a/reference/random/seed_seq/op_constructor.md b/reference/random/seed_seq/op_constructor.md index c478b41100..9fc5e8fccd 100644 --- a/reference/random/seed_seq/op_constructor.md +++ b/reference/random/seed_seq/op_constructor.md @@ -37,8 +37,6 @@ seed_seq(const seed_seq&) = delete; // (4) ```cpp seed_seq(il.begin(), il.end()); ``` - * il.begin()[link /reference/initializer_list/initializer_list/begin.md] - * il.end()[link /reference/initializer_list/initializer_list/end.md] - (3) : 以下のアルゴリズムで、シード列を構築する。 @@ -114,9 +112,7 @@ int main() } } ``` -* std::uint32_t[link /reference/cstdint/uint32_t.md] * seq.param[link param.md] -* std::uint64_t[link /reference/cstdint/uint64_t.md] * max()[link /reference/limits/numeric_limits/max.md] * seed_data.begin()[link /reference/vector/vector/begin.md] * seed_data.end()[link /reference/vector/vector/end.md] diff --git a/reference/random/seed_seq/param.md b/reference/random/seed_seq/param.md index 5315f0b4f1..3db7443984 100644 --- a/reference/random/seed_seq/param.md +++ b/reference/random/seed_seq/param.md @@ -61,7 +61,6 @@ int main() } } ``` -* std::uint64_t[link /reference/cstdint/uint64_t.md] * max()[link /reference/limits/numeric_limits/max.md] * seed_data.begin()[link /reference/vector/vector/begin.md] * seed_data.end()[link /reference/vector/vector/end.md] diff --git a/reference/random/shuffle_order_engine/max.md b/reference/random/shuffle_order_engine/max.md index 57edfc396e..f14355a512 100644 --- a/reference/random/shuffle_order_engine/max.md +++ b/reference/random/shuffle_order_engine/max.md @@ -34,7 +34,6 @@ int main() ``` * max()[color ff0000] * std::knuth_b[link /reference/random/knuth_b.md] -* std::uint32_t[link /reference/cstdint/uint32_t.md] ### 出力 ``` diff --git a/reference/random/shuffle_order_engine/min.md b/reference/random/shuffle_order_engine/min.md index 04e1f8103e..77700761b2 100644 --- a/reference/random/shuffle_order_engine/min.md +++ b/reference/random/shuffle_order_engine/min.md @@ -34,7 +34,6 @@ int main() ``` * min()[color ff0000] * std::knuth_b[link /reference/random/knuth_b.md] -* std::uint32_t[link /reference/cstdint/uint32_t.md] ### 出力 ``` diff --git a/reference/random/shuffle_order_engine/op_call.md b/reference/random/shuffle_order_engine/op_call.md index dacaada0f0..3149904201 100644 --- a/reference/random/shuffle_order_engine/op_call.md +++ b/reference/random/shuffle_order_engine/op_call.md @@ -45,7 +45,6 @@ int main() ``` * engine()[color ff0000] * std::knuth_b[link /reference/random/knuth_b.md] -* std::uint32_t[link /reference/cstdint/uint32_t.md] ### 出力例 ``` diff --git a/reference/random/shuffle_order_engine/op_constructor.md b/reference/random/shuffle_order_engine/op_constructor.md index abe0ff202a..b03aa5cdcc 100644 --- a/reference/random/shuffle_order_engine/op_constructor.md +++ b/reference/random/shuffle_order_engine/op_constructor.md @@ -96,7 +96,6 @@ int main() * seeds.begin()[link /reference/array/array/begin.md] * seeds.end()[link /reference/array/array/end.md] * std::move[link /reference/utility/move.md] -* std::uint32_t[link /reference/cstdint/uint32_t.md] ### 出力例 ``` diff --git a/reference/random/shuffle_order_engine/seed.md b/reference/random/shuffle_order_engine/seed.md index 28236133d6..cbf83f22c3 100644 --- a/reference/random/shuffle_order_engine/seed.md +++ b/reference/random/shuffle_order_engine/seed.md @@ -90,7 +90,6 @@ int main() * seed(seq)[color ff0000] * std::knuth_b[link /reference/random/knuth_b.md] * std::seed_seq[link /reference/random/seed_seq.md] -* std::uint32_t[link /reference/cstdint/uint32_t.md] * seeds.begin()[link /reference/array/array/begin.md] * seeds.end()[link /reference/array/array/end.md] diff --git a/reference/random/subtract_with_carry_engine.md b/reference/random/subtract_with_carry_engine.md index e431324628..5964ca321a 100644 --- a/reference/random/subtract_with_carry_engine.md +++ b/reference/random/subtract_with_carry_engine.md @@ -119,7 +119,6 @@ int main() } ``` * std::ranlux24_base[color ff0000] -* std::uint32_t[link /reference/cstdint/uint32_t.md] * engine()[link subtract_with_carry_engine/op_call.md] ### 出力 diff --git a/reference/random/subtract_with_carry_engine/max.md b/reference/random/subtract_with_carry_engine/max.md index b3154d230c..b86b4f363b 100644 --- a/reference/random/subtract_with_carry_engine/max.md +++ b/reference/random/subtract_with_carry_engine/max.md @@ -35,7 +35,6 @@ int main() ``` * max()[color ff0000] * std::ranlux24_base[link /reference/random/ranlux24_base.md] -* std::uint32_t[link /reference/cstdint/uint32_t.md] ### 出力 ``` diff --git a/reference/random/subtract_with_carry_engine/min.md b/reference/random/subtract_with_carry_engine/min.md index 94b4118cd3..65d15734e9 100644 --- a/reference/random/subtract_with_carry_engine/min.md +++ b/reference/random/subtract_with_carry_engine/min.md @@ -35,7 +35,6 @@ int main() ``` * min()[color ff0000] * std::ranlux24_base[link /reference/random/ranlux24_base.md] -* std::uint32_t[link /reference/cstdint/uint32_t.md] ### 出力 ``` diff --git a/reference/random/subtract_with_carry_engine/op_call.md b/reference/random/subtract_with_carry_engine/op_call.md index 4c2530f7f7..7ba00d2385 100644 --- a/reference/random/subtract_with_carry_engine/op_call.md +++ b/reference/random/subtract_with_carry_engine/op_call.md @@ -46,7 +46,6 @@ int main() ``` * engine()[color ff0000] * std::ranlux24_base[link /reference/random/ranlux24_base.md] -* std::uint32_t[link /reference/cstdint/uint32_t.md] ### 出力 ``` diff --git a/reference/random/subtract_with_carry_engine/op_constructor.md b/reference/random/subtract_with_carry_engine/op_constructor.md index cadd3aaf40..adc5ab33a6 100644 --- a/reference/random/subtract_with_carry_engine/op_constructor.md +++ b/reference/random/subtract_with_carry_engine/op_constructor.md @@ -86,7 +86,6 @@ int main() } ``` * std::ranlux24_base[link /reference/random/ranlux24_base.md] -* std::uint32_t[link /reference/cstdint/uint32_t.md] * std::seed_seq[link /reference/random/seed_seq.md] * seeds.begin()[link /reference/array/array/begin.md] * seeds.end()[link /reference/array/array/end.md] diff --git a/reference/random/subtract_with_carry_engine/seed.md b/reference/random/subtract_with_carry_engine/seed.md index 8b01bdd5ed..feac39b096 100644 --- a/reference/random/subtract_with_carry_engine/seed.md +++ b/reference/random/subtract_with_carry_engine/seed.md @@ -88,7 +88,6 @@ int main() * seed(seed)[color ff0000] * seed(seq)[color ff0000] * std::ranlux24_base[link /reference/random/ranlux24_base.md] -* std::uint32_t[link /reference/cstdint/uint32_t.md] * seeds.begin()[link /reference/array/array/begin.md] * seeds.end()[link /reference/array/array/end.md] diff --git a/reference/random/uniform_random_bit_generator.md b/reference/random/uniform_random_bit_generator.md index cecbc707c6..6f851b75f2 100644 --- a/reference/random/uniform_random_bit_generator.md +++ b/reference/random/uniform_random_bit_generator.md @@ -16,9 +16,7 @@ namespace std { }; } ``` -* invocable[link /reference/concepts/invocable.md] * unsigned_integral[link /reference/concepts/unsigned_integral.md] -* invoke_result_t[link /reference/type_traits/invoke_result.md] * bool_constant[link /reference/type_traits/bool_constant.md] ## 概要 diff --git a/reference/ranges/adjacent_transform_view/size.md b/reference/ranges/adjacent_transform_view/size.md index b9ac49e06e..13007293b6 100644 --- a/reference/ranges/adjacent_transform_view/size.md +++ b/reference/ranges/adjacent_transform_view/size.md @@ -12,7 +12,6 @@ constexpr auto size() constexpr auto size() const requires sized_range; // (2) C++23 ``` -* sized_range[link ../sized_range.md] ## 概要 diff --git a/reference/ranges/all.md b/reference/ranges/all.md index d26702c6cb..c698e2e85b 100644 --- a/reference/ranges/all.md +++ b/reference/ranges/all.md @@ -12,8 +12,6 @@ namespace std::ranges::views { using all_t = decltype(all(declval())); // (2) } ``` -* viewable_range[link viewable_range.md] -* declval[link /reference/utility/declval.md] ## 概要 - (1): Rangeへの参照として振る舞う[`view`](view.md)を生成するRangeアダプタクロージャオブジェクト diff --git a/reference/ranges/as_const_view.md b/reference/ranges/as_const_view.md index 68310616e9..3edb84f60a 100644 --- a/reference/ranges/as_const_view.md +++ b/reference/ranges/as_const_view.md @@ -15,9 +15,6 @@ namespace std::ranges { } } ``` -* input_range[link input_range.md] -* view[link view.md] -* view_interface[link view_interface.md] ## 概要 - (1): 各要素を定数化したRangeとして振る舞う[`view`](view.md) diff --git a/reference/ranges/as_const_view/base.md b/reference/ranges/as_const_view/base.md index cd2d89fa70..9d33283fa9 100644 --- a/reference/ranges/as_const_view/base.md +++ b/reference/ranges/as_const_view/base.md @@ -9,7 +9,6 @@ constexpr V base() const & requires copy_constructible; // (1) constexpr V base() &&; // (2) ``` -* copy_constructible[link /reference/concepts/copy_constructible.md] ## 概要 @@ -49,8 +48,6 @@ int main() { } ``` * base[color ff0000] -* same_as[link /reference/concepts/same_as.md] -* ref_view[link /reference/ranges/ref_view.md] ### 出力 diff --git a/reference/ranges/as_const_view/begin.md b/reference/ranges/as_const_view/begin.md index 0cd45667b9..d7128cb8e4 100644 --- a/reference/ranges/as_const_view/begin.md +++ b/reference/ranges/as_const_view/begin.md @@ -10,7 +10,6 @@ constexpr auto begin() requires (!simple-view); // (1) constexpr auto begin() const requires range; // (2) ``` * simple-view[link /reference/ranges/simple-view.md] -* range[link /reference/ranges/range.md] ## 概要 diff --git a/reference/ranges/as_const_view/end.md b/reference/ranges/as_const_view/end.md index b1c953ed11..3c3ffe3bec 100644 --- a/reference/ranges/as_const_view/end.md +++ b/reference/ranges/as_const_view/end.md @@ -10,7 +10,6 @@ constexpr auto end() requires (!simple-view); // (1) constexpr auto end() const requires range; // (2) ``` * simple-view[link /reference/ranges/simple-view.md] -* range[link /reference/ranges/range.md] ## 概要 diff --git a/reference/ranges/as_const_view/op_constructor.md b/reference/ranges/as_const_view/op_constructor.md index 072c233cc9..370fed2a92 100644 --- a/reference/ranges/as_const_view/op_constructor.md +++ b/reference/ranges/as_const_view/op_constructor.md @@ -10,7 +10,6 @@ as_const_view() requires default_initializable = default; // (1) constexpr explicit as_const_view(V base); // (2) ``` -* default_initializable[link /reference/concepts/default_initializable.md] ## 概要 diff --git a/reference/ranges/as_const_view/op_deduction_guide.md b/reference/ranges/as_const_view/op_deduction_guide.md index fecbc42808..4b0ee8707b 100644 --- a/reference/ranges/as_const_view/op_deduction_guide.md +++ b/reference/ranges/as_const_view/op_deduction_guide.md @@ -12,7 +12,6 @@ namespace std::ranges { } ``` * as_const_view[link ../as_const_view.md] -* all_t[link /reference/ranges/all.md] ## 概要 @@ -42,7 +41,6 @@ int main() { >); } ``` -* ref_view[link /reference/ranges/ref_view.md] * owning_view[link /reference/ranges/owning_view.md] ### 出力 diff --git a/reference/ranges/as_const_view/size.md b/reference/ranges/as_const_view/size.md index 0ddeace6e0..575ecd32da 100644 --- a/reference/ranges/as_const_view/size.md +++ b/reference/ranges/as_const_view/size.md @@ -9,7 +9,6 @@ constexpr auto size() requires sized_range; // (1) constexpr auto size() const requires sized_range; // (2) ``` -* sized_range[link /reference/ranges/sized_range.md] ## 概要 diff --git a/reference/ranges/as_rvalue_view.md b/reference/ranges/as_rvalue_view.md index 1be96bc0d1..5cc35e8368 100644 --- a/reference/ranges/as_rvalue_view.md +++ b/reference/ranges/as_rvalue_view.md @@ -15,9 +15,6 @@ namespace std::ranges { } } ``` -* view[link view.md] -* view_interface[link view_interface.md] -* input_range[link input_range.md] ## 概要 @@ -155,17 +152,8 @@ namespace std::ranges { constexpr explicit as_rvalue_view(V base); ``` -* view[link view.md] -* view_interface[link view_interface.md] -* common_range[link common_range.md] -* sized_range[link sized_range.md] * simple-view[link simple-view.md] -* default_initializable[link /reference/concepts/default_initializable.md] -* copy_constructible[link /reference/concepts/copy_constructible.md] * move_iterator[link /reference/iterator/move_iterator.md] -* ranges::begin[link begin.md] -* ranges::end[link end.md] -* ranges::size[link size.md] * views::all_t[link all.md] ## バージョン diff --git a/reference/ranges/as_rvalue_view/base.md b/reference/ranges/as_rvalue_view/base.md index 17106ff0e6..8f1a7642f2 100644 --- a/reference/ranges/as_rvalue_view/base.md +++ b/reference/ranges/as_rvalue_view/base.md @@ -54,7 +54,6 @@ int main() { } ``` * r.base()[color ff0000] -* std::ranges::ref_view[link /reference/ranges/ref_view.md] * base.base()[link /reference/ranges/ref_view/base.md] ### 出力 diff --git a/reference/ranges/as_rvalue_view/begin.md b/reference/ranges/as_rvalue_view/begin.md index 1c20185184..c235b9c093 100644 --- a/reference/ranges/as_rvalue_view/begin.md +++ b/reference/ranges/as_rvalue_view/begin.md @@ -22,7 +22,6 @@ constexpr auto begin() const ```cpp return std::move_iterator(ranges::begin(*base_)); ``` -* ranges::begin[link /reference/ranges/begin.md] ## 例 diff --git a/reference/ranges/as_rvalue_view/end.md b/reference/ranges/as_rvalue_view/end.md index 3e01d7821d..a1f18a9ac9 100644 --- a/reference/ranges/as_rvalue_view/end.md +++ b/reference/ranges/as_rvalue_view/end.md @@ -29,7 +29,6 @@ else { return std::move_sentinel(ranges::end(base_)); } ``` -* ranges::end[link /reference/ranges/end.md] ## 例 diff --git a/reference/ranges/as_rvalue_view/size.md b/reference/ranges/as_rvalue_view/size.md index 657d05de96..02a4ac3582 100644 --- a/reference/ranges/as_rvalue_view/size.md +++ b/reference/ranges/as_rvalue_view/size.md @@ -24,7 +24,6 @@ constexpr auto size() const ```cpp return ranges::size(base_); ``` -* ranges::size[link /reference/ranges/size.md] ## 例 diff --git a/reference/ranges/basic_istream_view.md b/reference/ranges/basic_istream_view.md index ee8f80af0e..824d23f5da 100644 --- a/reference/ranges/basic_istream_view.md +++ b/reference/ranges/basic_istream_view.md @@ -27,8 +27,6 @@ namespace std::ranges { } ``` * movable[link /reference/concepts/movable.md] -* default_initializable[link /reference/concepts/default_initializable.md] -* view_interface[link view_interface.md] * stream-extractable[italic] ## 概要 @@ -176,11 +174,7 @@ namespace std::ranges { } ``` * movable[link /reference/concepts/movable.md] -* default_initializable[link /reference/concepts/default_initializable.md] -* view_interface[link view_interface.md] * input_iterator_tag[link /reference/iterator/iterator_tag.md] -* addressof[link /reference/memory/addressof.md] -* default_sentinel_t[link /reference/iterator/default_sentinel_t.md] * basic_istream[link /reference/istream/basic_istream.md] * char_traits[link /reference/string/char_traits.md] diff --git a/reference/ranges/bidirectional_range.md b/reference/ranges/bidirectional_range.md index 8d79e74f0a..57d99b0e22 100644 --- a/reference/ranges/bidirectional_range.md +++ b/reference/ranges/bidirectional_range.md @@ -10,9 +10,6 @@ namespace std::ranges { concept bidirectional_range = forward_range && bidirectional_iterator>; } ``` -* forward_range[link forward_range.md] -* bidirectional_iterator[link /reference/iterator/bidirectional_iterator.md] -* iterator_t[link iterator_t.md] ## 概要 `bidirectional_range`は、イテレータが[`bidirectional_iterator`](/reference/iterator/bidirectional_iterator.md)であるRangeを表すコンセプトである。 diff --git a/reference/ranges/borrowed_iterator_t.md b/reference/ranges/borrowed_iterator_t.md index b475184bcb..5c9b1d5cd5 100644 --- a/reference/ranges/borrowed_iterator_t.md +++ b/reference/ranges/borrowed_iterator_t.md @@ -10,10 +10,7 @@ namespace std::ranges { using borrowed_iterator_t = conditional_t, iterator_t, dangling>; } ``` -* range[link range.md] * conditional_t[link /reference/type_traits/conditional.md] -* borrowed_range[link borrowed_range.md] -* iterator_t[link iterator_t.md] * dangling[link dangling.md] ## 概要 @@ -58,12 +55,9 @@ int main() { ``` * ranges::borrowed_iterator_t[color ff0000] * ranges::range[link range.md] -* ranges::begin[link begin.md] -* ranges::end[link end.md] * ranges::range_value_t[link range_value_t.md] * ranges::dangling[link dangling.md] * ranges::subrange[link subrange.md] -* borrowed_range[link borrowed_range.md] ### 出力 ``` diff --git a/reference/ranges/borrowed_range.md b/reference/ranges/borrowed_range.md index 2903e02baf..e248d100c0 100644 --- a/reference/ranges/borrowed_range.md +++ b/reference/ranges/borrowed_range.md @@ -10,7 +10,6 @@ namespace std::ranges { concept borrowed_range = range && (is_lvalue_reference_v || enable_borrowed_range>); } ``` -* range[link range.md] * is_lvalue_reference_v[link /reference/type_traits/is_lvalue_reference.md] * enable_borrowed_range[link enable_borrowed_range.md] diff --git a/reference/ranges/borrowed_subrange_t.md b/reference/ranges/borrowed_subrange_t.md index 0668d29e6b..0526b44ef3 100644 --- a/reference/ranges/borrowed_subrange_t.md +++ b/reference/ranges/borrowed_subrange_t.md @@ -10,11 +10,7 @@ namespace std::ranges { using borrowed_subrange_t = conditional_t, subrange>, dangling>; } ``` -* range[link range.md] * conditional_t[link /reference/type_traits/conditional.md] -* borrowed_range[link borrowed_range.md] -* subrange[link subrange.md] -* iterator_t[link iterator_t.md] * dangling[link dangling.md] ## 概要 @@ -55,11 +51,8 @@ int main() { ``` * ranges::borrowed_subrange_t[color ff0000] * ranges::range[link range.md] -* ranges::begin[link begin.md] -* ranges::end[link end.md] * ranges::dangling[link dangling.md] * ranges::subrange[link subrange.md] -* borrowed_range[link borrowed_range.md] ### 出力 ``` diff --git a/reference/ranges/chunk_view/size.md b/reference/ranges/chunk_view/size.md index c810321d97..898378f1df 100644 --- a/reference/ranges/chunk_view/size.md +++ b/reference/ranges/chunk_view/size.md @@ -10,7 +10,6 @@ constexpr auto size() requires sized_range; // (1) C++23 constexpr auto size() const requires sized_range; // (2) C++23 ``` -* sized_range[link ../sized_range.md] ## 概要 diff --git a/reference/ranges/common_range.md b/reference/ranges/common_range.md index 1bff945a90..b3c34bf297 100644 --- a/reference/ranges/common_range.md +++ b/reference/ranges/common_range.md @@ -10,9 +10,6 @@ namespace std::ranges { concept common_range = range && same_as, sentinel_t>; } ``` -* range[link range.md] -* iterator_t[link iterator_t.md] -* sentinel_t[link sentinel_t.md] ## 概要 `common_range`は、イテレータと番兵の型が等しいRangeを表すコンセプトである。 diff --git a/reference/ranges/common_view.md b/reference/ranges/common_view.md index d9051b9bfe..1dd81ac731 100644 --- a/reference/ranges/common_view.md +++ b/reference/ranges/common_view.md @@ -15,11 +15,7 @@ namespace std::ranges { } } ``` -* view[link view.md] -* view_interface[link view_interface.md] -* common_range[link common_range.md] * copyable[link /reference/concepts/copyable.md] -* iterator_t[link iterator_t.md] ## 概要 - (1): 任意のRangeを[`common_range`](common_range.md)にする[`view`](view.md) @@ -160,20 +156,7 @@ namespace std::ranges { common_view(R&&) -> common_view>; } ``` -* view[link view.md] -* view_interface[link view_interface.md] -* common_range[link common_range.md] -* random_access_range[link random_access_range.md] -* sized_range[link sized_range.md] * copyable[link /reference/concepts/copyable.md] -* default_initializable[link /reference/concepts/default_initializable.md] -* copy_constructible[link /reference/concepts/copy_constructible.md] -* common_iterator[link /reference/iterator/common_iterator.md] -* iterator_t[link iterator_t.md] -* sentinel_t[link sentinel_t.md] -* ranges::begin[link begin.md] -* ranges::end[link end.md] -* ranges::size[link size.md] * views::all_t[link all.md] ## バージョン diff --git a/reference/ranges/common_view/base.md b/reference/ranges/common_view/base.md index 83015d999b..77fdadea67 100644 --- a/reference/ranges/common_view/base.md +++ b/reference/ranges/common_view/base.md @@ -11,7 +11,6 @@ constexpr V base() const & constexpr V base() &&; // (2) C++20 ``` -* copy_constructible[link /reference/concepts/copy_constructible.md] ## 概要 @@ -54,7 +53,6 @@ int main() { * std::ranges::common_view[link ../common_view.md] * std::views::take[link ../take_view.md] * std::ranges::take_view[link ../take_view.md] -* std::ranges::ref_view[link ../ref_view.md] ### 出力 ``` diff --git a/reference/ranges/common_view/begin.md b/reference/ranges/common_view/begin.md index 0127b7ac4e..38b5d0d52c 100644 --- a/reference/ranges/common_view/begin.md +++ b/reference/ranges/common_view/begin.md @@ -9,7 +9,6 @@ constexpr auto begin(); // (1) constexpr auto begin() const requires range; // (2) ``` -* range[link ../range.md] ## 概要 diff --git a/reference/ranges/common_view/end.md b/reference/ranges/common_view/end.md index 0ff35e598c..9e6002c46f 100644 --- a/reference/ranges/common_view/end.md +++ b/reference/ranges/common_view/end.md @@ -10,7 +10,6 @@ constexpr auto end(); // (1) C++20 constexpr auto end() const requires range; // (2) C++20 ``` -* range[link ../range.md] ## 概要 diff --git a/reference/ranges/common_view/op_constructor.md b/reference/ranges/common_view/op_constructor.md index ecf659172e..bec4546ac4 100644 --- a/reference/ranges/common_view/op_constructor.md +++ b/reference/ranges/common_view/op_constructor.md @@ -12,7 +12,6 @@ common_view() constexpr explicit common_view(V r); // (2) C++20 ``` -* default_initializable[link /reference/concepts/default_initializable.md] ## 概要 diff --git a/reference/ranges/common_view/op_deduction_guide.md b/reference/ranges/common_view/op_deduction_guide.md index 79e8b2107d..b252ab63b6 100644 --- a/reference/ranges/common_view/op_deduction_guide.md +++ b/reference/ranges/common_view/op_deduction_guide.md @@ -41,7 +41,6 @@ int main() { * std::ranges::common_view[color ff0000] * std::views::take[link ../take_view.md] * std::ranges::take_view[link ../take_view.md] -* std::ranges::ref_view[link ../ref_view.md] ### 出力 ``` diff --git a/reference/ranges/common_view/size.md b/reference/ranges/common_view/size.md index 73eaf1dac6..77b4a73fa7 100644 --- a/reference/ranges/common_view/size.md +++ b/reference/ranges/common_view/size.md @@ -11,7 +11,6 @@ constexpr auto size() constexpr auto size() const requires sized_range; // (2) C++20 ``` -* sized_range[link ../sized_range.md] ## 概要 diff --git a/reference/ranges/const_iterator_t.md b/reference/ranges/const_iterator_t.md index a69c00ed18..6472910a07 100644 --- a/reference/ranges/const_iterator_t.md +++ b/reference/ranges/const_iterator_t.md @@ -10,9 +10,7 @@ namespace std::ranges { using const_iterator_t = decltype(ranges::cbegin(declval())); } ``` -* range[link range.md] * cbegin[link cbegin.md] -* declval[link /reference/utility/declval.md] ## 概要 diff --git a/reference/ranges/const_sentinel_t.md b/reference/ranges/const_sentinel_t.md index 7fe2311787..8f87e8f2ac 100644 --- a/reference/ranges/const_sentinel_t.md +++ b/reference/ranges/const_sentinel_t.md @@ -10,9 +10,7 @@ namespace std::ranges { using const_sentinel_t = decltype(ranges::cend(declval())); } ``` -* range[link range.md] * cend[link cend.md] -* declval[link /reference/utility/declval.md] ## 概要 diff --git a/reference/ranges/constant_range.md b/reference/ranges/constant_range.md index f621a0cd16..b025457450 100644 --- a/reference/ranges/constant_range.md +++ b/reference/ranges/constant_range.md @@ -10,9 +10,7 @@ namespace std::ranges { concept constant_range = input_range && constant-iterator>; } ``` -* input_range[link input_range.md] * constant-iterator[link /reference/iterator/constant-iterator.md] -* iterator_t[link iterator_t.md] ## 概要 diff --git a/reference/ranges/contiguous_range.md b/reference/ranges/contiguous_range.md index 686b1e1307..b19edd5ff1 100644 --- a/reference/ranges/contiguous_range.md +++ b/reference/ranges/contiguous_range.md @@ -13,12 +13,8 @@ namespace std::ranges { }; } ``` -* random_access_range[link random_access_range.md] -* contiguous_iterator[link /reference/iterator/contiguous_iterator.md] -* iterator_t[link iterator_t.md] * ranges::data[link data.md] * add_pointer_t[link /reference/type_traits/add_pointer.md] -* range_reference_t[link range_reference_t.md] ## 概要 `contiguous_range`は、イテレータが[`contiguous_iterator`](/reference/iterator/contiguous_iterator.md)であるRangeを表すコンセプトである。 diff --git a/reference/ranges/copyable_box.md b/reference/ranges/copyable_box.md index 98e937cd7b..f323cf7bbc 100644 --- a/reference/ranges/copyable_box.md +++ b/reference/ranges/copyable_box.md @@ -27,7 +27,6 @@ constexpr copyable-box& operator=(const copyable-box& that) noexcept(is_nothrow_ ``` * copyable-box[italic] * is_nothrow_copy_constructible_v[link /reference/type_traits/is_nothrow_copy_constructible.md] -* addressof[link /reference/memory/addressof.md] * emplace[link /reference/optional/optional/emplace.md] * reset[link /reference/optional/optional/reset.md] @@ -45,7 +44,6 @@ constexpr copyable-box& operator=(copyable-box&& that) noexcept(is_nothrow_move_ ``` * copyable-box[italic] * is_nothrow_move_constructible_v[link /reference/type_traits/is_nothrow_move_constructible.md] -* addressof[link /reference/memory/addressof.md] * emplace[link /reference/optional/optional/emplace.md] * reset[link /reference/optional/optional/reset.md] diff --git a/reference/ranges/dangling.md b/reference/ranges/dangling.md index 3205939ca2..d2e78a7c25 100644 --- a/reference/ranges/dangling.md +++ b/reference/ranges/dangling.md @@ -59,7 +59,6 @@ int main() * ranges::dangling[color ff0000] * ranges::find[link /reference/algorithm/ranges_find.md] * ranges::subrange[link subrange.md] -* borrowed_range[link borrowed_range.md] ### 出力 ``` diff --git a/reference/ranges/different-from.md b/reference/ranges/different-from.md index d821b67cc9..5b0b28e225 100644 --- a/reference/ranges/different-from.md +++ b/reference/ranges/different-from.md @@ -8,8 +8,6 @@ template concept different-from = // 説明専用コンセプト !same_as, remove_cvref_t>; ``` -* same_as[link /reference/concepts/same_as.md] -* remove_cvref_t[link /reference/type_traits/remove_cvref.md] ## 概要 `different-from`は、型`T`、`U`について`const`/`volatile`修飾を無視して、同じ型でないことを表す説明専用コンセプトである。 diff --git a/reference/ranges/drop_view.md b/reference/ranges/drop_view.md index 56a88433f3..f16eee274d 100644 --- a/reference/ranges/drop_view.md +++ b/reference/ranges/drop_view.md @@ -14,8 +14,6 @@ namespace std::ranges { } } ``` -* view[link view.md] -* view_interface[link view_interface.md] ## 概要 - (1): 元のRangeの先頭から指定した個数の値を除去したRangeとして振る舞う[`view`](view.md) diff --git a/reference/ranges/drop_while_view.md b/reference/ranges/drop_while_view.md index 6230260000..34652be4f0 100644 --- a/reference/ranges/drop_while_view.md +++ b/reference/ranges/drop_while_view.md @@ -15,12 +15,6 @@ namespace std::ranges { } } ``` -* view[link view.md] -* input_range[link input_range.md] -* is_object_v[link /reference/type_traits/is_object.md] -* indirect_unary_predicate[link /reference/iterator/indirect_unary_predicate.md] -* iterator_t[link iterator_t.md] -* view_interface[link view_interface.md] ## 概要 - (1): 元のRangeの先頭から指定した条件を連続して満たす範囲を除外する[`view`](view.md) diff --git a/reference/ranges/elements_view.md b/reference/ranges/elements_view.md index 78372d9d80..d68ae5715d 100644 --- a/reference/ranges/elements_view.md +++ b/reference/ranges/elements_view.md @@ -70,7 +70,6 @@ concept has-tuple-element = * tuple_size[link /reference/tuple/tuple_size.md] * tuple_element_t[link /reference/tuple/tuple_element.md] * get[link /reference/tuple/tuple/get.md] -* convertible_to[link /reference/concepts/convertible_to.md] * tuple-like[link /reference/tuple/tuple-like.md] * tuple_size_v[link /reference/tuple/tuple_size.md] diff --git a/reference/ranges/elements_view/op_deduction_guide.md b/reference/ranges/elements_view/op_deduction_guide.md index b2980122ec..0c10444d53 100644 --- a/reference/ranges/elements_view/op_deduction_guide.md +++ b/reference/ranges/elements_view/op_deduction_guide.md @@ -50,7 +50,6 @@ int main() { ``` * std::ranges::elements_view[color ff0000] * std::views::all_t[link ../all.md] -* std::ranges::ref_view[link ../ref_view.md] ### 出力 ``` diff --git a/reference/ranges/empty_view.md b/reference/ranges/empty_view.md index 72e702eb47..9ffb376e51 100644 --- a/reference/ranges/empty_view.md +++ b/reference/ranges/empty_view.md @@ -16,8 +16,6 @@ namespace std::ranges { } } ``` -* is_object_v[link /reference/type_traits/is_object.md] -* view_interface[link view_interface.md] ## 概要 `empty_view`は、空のRangeを表す[`view`](view.md)。 diff --git a/reference/ranges/enumerate_view.md b/reference/ranges/enumerate_view.md index c91b79d113..98534eaa31 100644 --- a/reference/ranges/enumerate_view.md +++ b/reference/ranges/enumerate_view.md @@ -15,7 +15,6 @@ namespace std::ranges { } } ``` -* range-with-movable-references[link range-with-movable-references.md] ## 概要 diff --git a/reference/ranges/filter_view/end.md b/reference/ranges/filter_view/end.md index 5a9f716e17..dc564514ec 100644 --- a/reference/ranges/filter_view/end.md +++ b/reference/ranges/filter_view/end.md @@ -13,7 +13,6 @@ constexpr auto end() { return sentinel{*this}; } ``` -* ranges::end[link ../end.md] * iterator[link iterator.md] * sentinel[link sentinel.md] diff --git a/reference/ranges/filter_view/iterator/op_increment.md b/reference/ranges/filter_view/iterator/op_increment.md index f7985e01dd..f891251cff 100644 --- a/reference/ranges/filter_view/iterator/op_increment.md +++ b/reference/ranges/filter_view/iterator/op_increment.md @@ -27,7 +27,6 @@ current_ = ranges::find_if( return *this; ``` * ranges::find_if[link /reference/algorithm/ranges_find_if.md] -* ranges::end[link /reference/ranges/end.md] * ref[link /reference/functional/ref.md] と等しい。 diff --git a/reference/ranges/filter_view/op_deduction_guide.md b/reference/ranges/filter_view/op_deduction_guide.md index 66fb6f189e..c98cb920e8 100644 --- a/reference/ranges/filter_view/op_deduction_guide.md +++ b/reference/ranges/filter_view/op_deduction_guide.md @@ -45,7 +45,6 @@ int main() { >); } ``` -* ref_view[link /reference/ranges/ref_view.md] * owning_view[link /reference/ranges/owning_view.md] * filter_view[link ../filter_view.md] diff --git a/reference/ranges/forward_range.md b/reference/ranges/forward_range.md index e9597bc280..7c4eeefe3c 100644 --- a/reference/ranges/forward_range.md +++ b/reference/ranges/forward_range.md @@ -10,9 +10,6 @@ namespace std::ranges { concept forward_range = input_range && forward_iterator>; } ``` -* input_range[link input_range.md] -* forward_iterator[link /reference/iterator/forward_iterator.md] -* iterator_t[link iterator_t.md] ## 概要 `forward_range`は、イテレータが[`forward_iterator`](/reference/iterator/forward_iterator.md)であるRangeを表すコンセプトである。 diff --git a/reference/ranges/has-arrow.md b/reference/ranges/has-arrow.md index fbb4ec5f50..52d4d9a842 100644 --- a/reference/ranges/has-arrow.md +++ b/reference/ranges/has-arrow.md @@ -8,7 +8,6 @@ template concept has-arrow = // 説明専用コンセプト input_iterator && (is_pointer_v || requires(I i) { i.operator->(); }); ``` -* input_iterator[link /reference/iterator/input_iterator.md] * is_pointer_v[link /reference/type_traits/is_pointer.md] ## 概要 diff --git a/reference/ranges/input_range.md b/reference/ranges/input_range.md index 4de98643ec..19ff4cbbca 100644 --- a/reference/ranges/input_range.md +++ b/reference/ranges/input_range.md @@ -10,9 +10,6 @@ namespace std::ranges { concept input_range = range && input_iterator>; } ``` -* range[link range.md] -* input_iterator[link /reference/iterator/input_iterator.md] -* iterator_t[link iterator_t.md] ## 概要 `input_range`は、イテレータが[`input_iterator`](/reference/iterator/input_iterator.md)であるRangeを表すコンセプトである。 diff --git a/reference/ranges/iota_view.md b/reference/ranges/iota_view.md index 8e1373da5d..5974097250 100644 --- a/reference/ranges/iota_view.md +++ b/reference/ranges/iota_view.md @@ -17,9 +17,7 @@ namespace std::ranges { ``` * weakly_incrementable[link /reference/iterator/weakly_incrementable.md] * copyable[link /reference/concepts/copyable.md] -* unreachable_sentinel_t[link /reference/iterator/unreachable_sentinel_t.md] * weakly-equality-comparable-with[link /reference/concepts/equality_comparable.md] -* view_interface[link view_interface.md] ## 概要 - (1): インクリメント演算子によって生成される、有限長または無限長の単調増加列を表す[`view`](view.md) diff --git a/reference/ranges/iota_view/end.md b/reference/ranges/iota_view/end.md index 617d10113a..f302682f28 100644 --- a/reference/ranges/iota_view/end.md +++ b/reference/ranges/iota_view/end.md @@ -26,7 +26,6 @@ else // (2) return iterator{bound_}; ``` -* unreachable_sentinel_t[link /reference/iterator/unreachable_sentinel_t.md] * unreachable_sentinel[link /reference/iterator/unreachable_sentinel_t.md] * sentinel[link sentinel.md] * iterator[link iterator.md] diff --git a/reference/ranges/iota_view/iota_diff_t.md b/reference/ranges/iota_view/iota_diff_t.md index d8fc02712c..e229b58f1b 100644 --- a/reference/ranges/iota_view/iota_diff_t.md +++ b/reference/ranges/iota_view/iota_diff_t.md @@ -30,7 +30,6 @@ using _Iota_diff_t = conditional_t, ``` * conditional_t[link /reference/type_traits/conditional.md] * is_integral_v[link /reference/type_traits/is_integral.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] ## バージョン ### 言語 diff --git a/reference/ranges/iota_view/iterator.md b/reference/ranges/iota_view/iterator.md index 8c93dd333f..1bbe963b88 100644 --- a/reference/ranges/iota_view/iterator.md +++ b/reference/ranges/iota_view/iterator.md @@ -189,7 +189,6 @@ namespace std::ranges { * incrementable[link /reference/iterator/incrementable.md] * semiregular[link /reference/concepts/semiregular.md] * totally_ordered[link /reference/concepts/totally_ordered.md] -* three_way_comparable[link /reference/compare/three_way_comparable.md] * is_nothrow_copy_constructible_v[link /reference/type_traits/is_nothrow_copy_constructible.md] * weakly-equality-comparable-with[link /reference/concepts/equality_comparable.md] diff --git a/reference/ranges/iota_view/sentinel.md b/reference/ranges/iota_view/sentinel.md index cc1e10536a..2abb930c9c 100644 --- a/reference/ranges/iota_view/sentinel.md +++ b/reference/ranges/iota_view/sentinel.md @@ -49,7 +49,6 @@ namespace std::ranges { * iota_view[link ../iota_view.md] * weakly_incrementable[link /reference/iterator/weakly_incrementable.md] * sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] * semiregular[link /reference/concepts/semiregular.md] * weakly-equality-comparable-with[link /reference/concepts/equality_comparable.md] diff --git a/reference/ranges/iterator_t.md b/reference/ranges/iterator_t.md index b5a4b27645..b457e0b649 100644 --- a/reference/ranges/iterator_t.md +++ b/reference/ranges/iterator_t.md @@ -10,8 +10,6 @@ namespace std::ranges { using iterator_t = decltype(ranges::begin(declval())); } ``` -* declval[link /reference/utility/declval.md] -* ranges::begin[link begin.md] ## 概要 diff --git a/reference/ranges/join_view.md b/reference/ranges/join_view.md index c1ad22bc18..37ac449aa2 100644 --- a/reference/ranges/join_view.md +++ b/reference/ranges/join_view.md @@ -15,9 +15,6 @@ namespace std::ranges { } } ``` -* input_range[link input_range.md] -* view[link view.md] -* range_reference_t[link range_reference_t.md] ## 概要 diff --git a/reference/ranges/lazy_split_view.md b/reference/ranges/lazy_split_view.md index 34115a424d..34d88ded56 100644 --- a/reference/ranges/lazy_split_view.md +++ b/reference/ranges/lazy_split_view.md @@ -18,12 +18,6 @@ namespace std::ranges { } } ``` -* input_range[link input_range.md] -* forward_range[link forward_range.md] -* view[link view.md] -* iterator_t[link iterator_t.md] -* indirectly_comparable[link /reference/iterator/indirectly_comparable.md] -* ranges::equal_to[link /reference/functional/equal_to.md] * tiny-range[italic] ## 概要 @@ -61,7 +55,6 @@ concept tiny-range = sized_range && ``` * require-constant[italic] * tiny-range[italic] -* remove_reference_t[link /reference/type_traits/remove_reference.md] これを用いて、 diff --git a/reference/ranges/lazy_split_view/op_deduction_guide.md b/reference/ranges/lazy_split_view/op_deduction_guide.md index 111e10d7fb..55b4f9bf6d 100644 --- a/reference/ranges/lazy_split_view/op_deduction_guide.md +++ b/reference/ranges/lazy_split_view/op_deduction_guide.md @@ -22,7 +22,6 @@ namespace std::ranges { >; // (2) C++20 } ``` -* single_view[link /reference/ranges/single_view.md] ## 概要 diff --git a/reference/ranges/movable_box.md b/reference/ranges/movable_box.md index e2152b63b0..83d23d18f0 100644 --- a/reference/ranges/movable_box.md +++ b/reference/ranges/movable_box.md @@ -26,7 +26,6 @@ constexpr movable-box& operator=(const movable-box& that) noexcept(is_nothrow_co ``` * movable-box[italic] * is_nothrow_copy_constructible_v[link /reference/type_traits/is_nothrow_copy_constructible.md] -* addressof[link /reference/memory/addressof.md] * emplace[link /reference/optional/optional/emplace.md] * reset[link /reference/optional/optional/reset.md] @@ -44,7 +43,6 @@ constexpr movable-box& operator=(movable-box&& that) noexcept(is_nothrow_move_co ``` * movable-box[italic] * is_nothrow_move_constructible_v[link /reference/type_traits/is_nothrow_move_constructible.md] -* addressof[link /reference/memory/addressof.md] * emplace[link /reference/optional/optional/emplace.md] * reset[link /reference/optional/optional/reset.md] diff --git a/reference/ranges/output_range.md b/reference/ranges/output_range.md index 77bceeaebc..0f22bdcf5f 100644 --- a/reference/ranges/output_range.md +++ b/reference/ranges/output_range.md @@ -10,9 +10,6 @@ namespace std::ranges { concept output_range = range && output_iterator, T>; } ``` -* range[link range.md] -* output_iterator[link /reference/iterator/output_iterator.md] -* iterator_t[link iterator_t.md] ## 概要 `output_range`は、イテレータが[`output_iterator`](/reference/iterator/output_iterator.md)であるRangeを表すコンセプトである。 diff --git a/reference/ranges/owning_view.md b/reference/ranges/owning_view.md index 6dbbc04529..74488a13d1 100644 --- a/reference/ranges/owning_view.md +++ b/reference/ranges/owning_view.md @@ -11,10 +11,8 @@ namespace std::ranges { class owning_view : public view_interface> { …… }; } ``` -* range[link range.md] * movable[link /reference/concepts/movable.md] * is-initializer-list[italic] -* view_interface[link view_interface.md] ## 概要 Rangeの右辺値をムーブして所有する[`view`](view.md)。このクラスのオブジェクトは、Rangeアダプタ[`all`](all.md)によって生成される。 @@ -141,18 +139,8 @@ namespace std::ranges { } ``` * is-initializer-list[italic] -* range[link range.md] -* default_initializable[link /reference/concepts/default_initializable.md] -* iterator_t[link iterator_t.md] -* sentinel_t[link sentinel_t.md] -* ranges::begin[link begin.md] -* ranges::end[link end.md] * ranges::empty[link empty.md] -* ranges::size[link size.md] * ranges::data[link data.md] -* sized_range[link sized_range.md] -* contiguous_range[link contiguous_range.md] -* view_interface[link view_interface.md] ## バージョン ### 言語 diff --git a/reference/ranges/owning_view/data.md b/reference/ranges/owning_view/data.md index 22d0f34470..3fdfc36216 100644 --- a/reference/ranges/owning_view/data.md +++ b/reference/ranges/owning_view/data.md @@ -12,7 +12,6 @@ constexpr auto data() constexpr auto data() const requires contiguous_range; // (2) C++20 ``` -* contiguous_range[link ../contiguous_range.md] ## 概要 diff --git a/reference/ranges/possibly-const-range.md b/reference/ranges/possibly-const-range.md index 5911d11bfc..053b2a1053 100644 --- a/reference/ranges/possibly-const-range.md +++ b/reference/ranges/possibly-const-range.md @@ -16,8 +16,6 @@ namespace std::ranges { } } ``` -* input_range[link /reference/ranges/input_range.md] -* constant_range[link /reference/ranges/constant_range.md] ## 概要 diff --git a/reference/ranges/random_access_range.md b/reference/ranges/random_access_range.md index 793f1f7ed0..e86f9e1bcd 100644 --- a/reference/ranges/random_access_range.md +++ b/reference/ranges/random_access_range.md @@ -10,9 +10,6 @@ namespace std::ranges { concept random_access_range = bidirectional_range && random_access_iterator>; } ``` -* bidirectional_range[link bidirectional_range.md] -* random_access_iterator[link /reference/iterator/random_access_iterator.md] -* iterator_t[link iterator_t.md] ## 概要 `random_access_range`は、イテレータが[`random_access_iterator`](/reference/iterator/random_access_iterator.md)であるRangeを表すコンセプトである。 diff --git a/reference/ranges/range.md b/reference/ranges/range.md index 6b319a387a..c484d15b7a 100644 --- a/reference/ranges/range.md +++ b/reference/ranges/range.md @@ -13,8 +13,6 @@ namespace std::ranges { }; } ``` -* ranges::begin[link begin.md] -* ranges::end[link end.md] ## 概要 要素の範囲を表すイテレータと番兵を取得でき、それらによって要素をイテレートできる型を表す、Rangeの最も基本的なコンセプト。 diff --git a/reference/ranges/range_const_reference_t.md b/reference/ranges/range_const_reference_t.md index c169356d49..0694960fcd 100644 --- a/reference/ranges/range_const_reference_t.md +++ b/reference/ranges/range_const_reference_t.md @@ -10,9 +10,7 @@ namespace std::ranges { using range_const_reference_t = iter_const_reference_t>; } ``` -* range[link range.md] * iter_const_reference_t[link /reference/iterator/iter_const_reference_t.md] -* iterator_t[link iterator_t.md] ## 概要 diff --git a/reference/ranges/range_difference_t.md b/reference/ranges/range_difference_t.md index 6bcbb61759..aaab78228c 100644 --- a/reference/ranges/range_difference_t.md +++ b/reference/ranges/range_difference_t.md @@ -10,9 +10,6 @@ namespace std::ranges { using range_difference_t = iter_difference_t>; } ``` -* range[link range.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] -* iterator_t[link iterator_t.md] ## 概要 diff --git a/reference/ranges/range_reference_t.md b/reference/ranges/range_reference_t.md index e0ae7ec67d..cd68179c5a 100644 --- a/reference/ranges/range_reference_t.md +++ b/reference/ranges/range_reference_t.md @@ -10,9 +10,7 @@ namespace std::ranges { using range_reference_t = iter_reference_t>; } ``` -* range[link range.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] -* iterator_t[link iterator_t.md] ## 概要 diff --git a/reference/ranges/range_rvalue_reference_t.md b/reference/ranges/range_rvalue_reference_t.md index 975e272bac..87d9ce6dcf 100644 --- a/reference/ranges/range_rvalue_reference_t.md +++ b/reference/ranges/range_rvalue_reference_t.md @@ -10,9 +10,6 @@ namespace std::ranges { using range_rvalue_reference_t = iter_rvalue_reference_t>; } ``` -* range[link range.md] -* iter_rvalue_reference_t[link /reference/iterator/iter_rvalue_reference_t.md] -* iterator_t[link iterator_t.md] ## 概要 diff --git a/reference/ranges/range_size_t.md b/reference/ranges/range_size_t.md index a7784a2e6e..2475aa7082 100644 --- a/reference/ranges/range_size_t.md +++ b/reference/ranges/range_size_t.md @@ -10,9 +10,6 @@ namespace std::ranges { using range_size_t = decltype(ranges::size(declval())); } ``` -* range[link range.md] -* declval[link /reference/utility/declval.md] -* ranges::size[link size.md] ## 概要 diff --git a/reference/ranges/range_value_t.md b/reference/ranges/range_value_t.md index f7febe687f..9defd5fe1e 100644 --- a/reference/ranges/range_value_t.md +++ b/reference/ranges/range_value_t.md @@ -10,9 +10,6 @@ namespace std::ranges { using range_value_t = iter_value_t>; } ``` -* range[link range.md] -* iter_value_t[link /reference/iterator/iter_value_t.md] -* iterator_t[link iterator_t.md] ## 概要 diff --git a/reference/ranges/ref_view.md b/reference/ranges/ref_view.md index 73c0212b16..557d5bb9ff 100644 --- a/reference/ranges/ref_view.md +++ b/reference/ranges/ref_view.md @@ -11,9 +11,6 @@ namespace std::ranges { class ref_view : public view_interface> { …… }; } ``` -* range[link range.md] -* is_object_v[link /reference/type_traits/is_object.md] -* view_interface[link view_interface.md] ## 概要 @@ -125,22 +122,8 @@ namespace std::ranges { ref_view(R&) -> ref_view; } ``` -* range[link range.md] -* is_object_v[link /reference/type_traits/is_object.md] -* convertible_to[link /reference/concepts/convertible_to.md] -* declval[link /reference/utility/declval.md] -* std::forward[link /reference/utility/forward.md] -* addressof[link /reference/memory/addressof.md] -* iterator_t[link iterator_t.md] -* sentinel_t[link sentinel_t.md] -* ranges::begin[link begin.md] -* ranges::end[link end.md] * ranges::empty[link empty.md] -* ranges::size[link size.md] * ranges::data[link data.md] -* sized_range[link sized_range.md] -* contiguous_range[link contiguous_range.md] -* view_interface[link view_interface.md] ## バージョン ### 言語 diff --git a/reference/ranges/ref_view/begin.md b/reference/ranges/ref_view/begin.md index 93b7a4f55b..3183422f35 100644 --- a/reference/ranges/ref_view/begin.md +++ b/reference/ranges/ref_view/begin.md @@ -18,7 +18,6 @@ constexpr iterator_t begin() const; // (1) C++20 ```cpp return ranges::begin(*r_); ``` -* ranges::begin[link /reference/ranges/begin.md] ## 例 diff --git a/reference/ranges/ref_view/end.md b/reference/ranges/ref_view/end.md index 2c9d4c7e18..e43c0b6012 100644 --- a/reference/ranges/ref_view/end.md +++ b/reference/ranges/ref_view/end.md @@ -20,7 +20,6 @@ constexpr sentinel_t end() const; // (1) C++20 ```cpp ranges::end(*r_); ``` -* ranges::end[link /reference/ranges/end.md] diff --git a/reference/ranges/ref_view/size.md b/reference/ranges/ref_view/size.md index 62dd20500c..f7646e2627 100644 --- a/reference/ranges/ref_view/size.md +++ b/reference/ranges/ref_view/size.md @@ -25,7 +25,6 @@ constexpr auto size() const ```cpp return ranges::size(*r_); ``` -* ranges::size[link /reference/ranges/size.md] ## 例 diff --git a/reference/ranges/repeat_view.md b/reference/ranges/repeat_view.md index 8f32a3c8c4..e20a352bec 100644 --- a/reference/ranges/repeat_view.md +++ b/reference/ranges/repeat_view.md @@ -16,14 +16,8 @@ namespace std::ranges { } } ``` -* move_constructible[link /reference/concepts/move_constructible.md] * semiregular[link /reference/concepts/semiregular.md] -* unreachable_sentinel_t[link /reference/iterator/unreachable_sentinel_t.md] -* is_object_v[link /reference/type_traits/is_object.md] -* same_as[link /reference/concepts/same_as.md] -* remove_cv_t[link /reference/type_traits/remove_cv.md] * is-integer-like[link /reference/iterator/is_integer_like.md] -* view_interface[link view_interface.md] ## 概要 - (1): 指定した値を指定回数繰り返す[`view`](view.md) diff --git a/reference/ranges/repeat_view/iterator.md b/reference/ranges/repeat_view/iterator.md index 950dadf8f5..9306dfb4e0 100644 --- a/reference/ranges/repeat_view/iterator.md +++ b/reference/ranges/repeat_view/iterator.md @@ -105,12 +105,7 @@ namespace std::ranges { }; } ``` -* move_constructible[link /reference/concepts/move_constructible.md] * semiregular[link /reference/concepts/semiregular.md] -* unreachable_sentinel_t[link /reference/iterator/unreachable_sentinel_t.md] -* is_object_v[link /reference/type_traits/is_object.md] -* same_as[link /reference/concepts/same_as.md] -* remove_cv_t[link /reference/type_traits/remove_cv.md] * is-integer-like[link /reference/iterator/is_integer_like.md] * repeat_view[link ../repeat_view.md] * conditional_t[link /reference/type_traits/conditional.md] diff --git a/reference/ranges/reverse_view.md b/reference/ranges/reverse_view.md index d86c4196a5..fe830f44a8 100644 --- a/reference/ranges/reverse_view.md +++ b/reference/ranges/reverse_view.md @@ -15,9 +15,6 @@ namespace std::ranges { } } ``` -* view[link view.md] -* bidirectional_range[link bidirectional_range.md] -* view_interface[link view_interface.md] ## 概要 - (1): 任意の[`bidirectional_range`](bidirectional_range.md)を逆順にする[`view`](view.md) @@ -155,20 +152,9 @@ namespace std::ranges { reverse_view(R&&) -> reverse_view>; } ``` -* view[link view.md] -* bidirectional_range[link bidirectional_range.md] -* view_interface[link view_interface.md] -* common_range[link common_range.md] -* sized_range[link sized_range.md] -* default_initializable[link /reference/concepts/default_initializable.md] -* copy_constructible[link /reference/concepts/copy_constructible.md] * reverse_iterator[link /reference/iterator/reverse_iterator.md] * make_reverse_iterator[link /reference/iterator/make_reverse_iterator.md] -* iterator_t[link iterator_t.md] * ranges::next[link /reference/iterator/ranges_next.md] -* ranges::begin[link begin.md] -* ranges::end[link end.md] -* ranges::size[link size.md] ## バージョン diff --git a/reference/ranges/sentinel_t.md b/reference/ranges/sentinel_t.md index 30a8b813d9..4420eb5ba9 100644 --- a/reference/ranges/sentinel_t.md +++ b/reference/ranges/sentinel_t.md @@ -10,9 +10,6 @@ namespace std::ranges { using sentinel_t = decltype(ranges::end(declval())); } ``` -* range[link range.md] -* declval[link /reference/utility/declval.md] -* ranges::end[link end.md] ## 概要 diff --git a/reference/ranges/simple-view.md b/reference/ranges/simple-view.md index b3c0e4cb53..13ae87ec88 100644 --- a/reference/ranges/simple-view.md +++ b/reference/ranges/simple-view.md @@ -10,11 +10,6 @@ template same_as, iterator_t> && same_as, sentinel_t>; ``` -* same_as[link /reference/concepts/same_as.md] -* view[link view.md] -* range[link range.md] -* iterator_t[link iterator_t.md] -* sentinel_t[link sentinel_t.md] ## 概要 `simple-view`は型`R`が単純(`R`は`const`であっても Range である(`const-iterable`である)上で、`R`が使用するイテレータ/センチネルと読み取り専用のイテレータ/センチネルが同じ型である)となるビューな Range を表す説明専用コンセプトである。 diff --git a/reference/ranges/single_view.md b/reference/ranges/single_view.md index f23b329b2f..acf9ae5739 100644 --- a/reference/ranges/single_view.md +++ b/reference/ranges/single_view.md @@ -145,11 +145,7 @@ namespace std::ranges { single_view(T) -> single_view; } ``` -* copy_constructible[link /reference/concepts/copy_constructible.md] -* default_initializable[link /reference/concepts/default_initializable.md] * constructible_from[link /reference/concepts/constructible_from.md] -* is_object_v[link /reference/type_traits/is_object.md] -* view_interface[link view_interface.md] * copyable-box[link copyable_box.md] ## バージョン diff --git a/reference/ranges/single_view/op_deduction_guide.md b/reference/ranges/single_view/op_deduction_guide.md index 4055c1f250..8f39e80b33 100644 --- a/reference/ranges/single_view/op_deduction_guide.md +++ b/reference/ranges/single_view/op_deduction_guide.md @@ -11,7 +11,6 @@ namespace std::ranges { single_view(T) -> single_view; } ``` -* single_view[link ../single_view.md] ## 概要 diff --git a/reference/ranges/sized_range.md b/reference/ranges/sized_range.md index c296a9af89..a159534d28 100644 --- a/reference/ranges/sized_range.md +++ b/reference/ranges/sized_range.md @@ -10,8 +10,6 @@ namespace std::ranges { concept sized_range = range && requires(T& t) { ranges::size(t); }; } ``` -* range[link range.md] -* ranges::size[link size.md] ## 概要 `sized_range`は、大きさを償却定数時間で求めることができるRangeを表すコンセプトである。 diff --git a/reference/ranges/split_view.md b/reference/ranges/split_view.md index bd478450de..8cadb2f050 100644 --- a/reference/ranges/split_view.md +++ b/reference/ranges/split_view.md @@ -17,11 +17,6 @@ namespace std::ranges { } } ``` -* forward_range[link forward_range.md] -* view[link view.md] -* iterator_t[link iterator_t.md] -* indirectly_comparable[link /reference/iterator/indirectly_comparable.md] -* ranges::equal_to[link /reference/functional/equal_to.md] ## 概要 diff --git a/reference/ranges/stride_view/op_deduction_guide.md b/reference/ranges/stride_view/op_deduction_guide.md index 8e073b4400..5288e8575a 100644 --- a/reference/ranges/stride_view/op_deduction_guide.md +++ b/reference/ranges/stride_view/op_deduction_guide.md @@ -35,7 +35,6 @@ int main() { } ``` * std::ranges::stride_view[color ff0000] -* std::ranges::ref_view[link ../ref_view.md] ### 出力 ``` diff --git a/reference/ranges/subrange.md b/reference/ranges/subrange.md index 7742b21a61..8c68985f6b 100644 --- a/reference/ranges/subrange.md +++ b/reference/ranges/subrange.md @@ -13,9 +13,7 @@ namespace std::ranges { ``` * input_or_output_iterator[link /reference/iterator/input_or_output_iterator.md] * sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * subrange_kind[link subrange_kind.md] -* view_interface[link view_interface.md] ## 概要 `subrange`は、イテレータ`i`と番兵`s`が表すイテレータ範囲`[i, s)`をRangeとして扱うクラステンプレート。 diff --git a/reference/ranges/subrange/advance.md b/reference/ranges/subrange/advance.md index f4e069ac62..c1e64a5c47 100644 --- a/reference/ranges/subrange/advance.md +++ b/reference/ranges/subrange/advance.md @@ -8,8 +8,6 @@ ```cpp constexpr subrange& advance(iter_difference_t n); ``` -* iter_difference_t[link /reference/iterator/iter_difference_t.md] -* subrange[link ../subrange.md] ## 概要 部分Rangeの先頭を前進または後退させる。引数が負の時は後退する。 diff --git a/reference/ranges/subrange/convertible-to-non-slicing.md b/reference/ranges/subrange/convertible-to-non-slicing.md index 2b7b386983..e257fe1c2a 100644 --- a/reference/ranges/subrange/convertible-to-non-slicing.md +++ b/reference/ranges/subrange/convertible-to-non-slicing.md @@ -12,9 +12,7 @@ namespace std::ranges { !uses-nonqualification-pointer-conversion, decay_t>; } ``` -* convertible_to[link /reference/concepts/convertible_to.md] * uses-nonqualification-pointer-conversion[link uses-nonqualification-pointer-conversion.md] -* decay_t[link /reference/type_traits/decay.md] * convertible-to-non-slicing[italic] * uses-nonqualification-pointer-conversion[italic] diff --git a/reference/ranges/subrange/enable_borrowed_range.md b/reference/ranges/subrange/enable_borrowed_range.md index 63eedce175..4ed87fa904 100644 --- a/reference/ranges/subrange/enable_borrowed_range.md +++ b/reference/ranges/subrange/enable_borrowed_range.md @@ -10,7 +10,6 @@ namespace std::ranges { inline constexpr bool enable_borrowed_range> = true; } ``` -* subrange[link ../subrange.md] ## 概要 diff --git a/reference/ranges/subrange/get.md b/reference/ranges/subrange/get.md index 1ee89a0bbf..5638aa83d5 100644 --- a/reference/ranges/subrange/get.md +++ b/reference/ranges/subrange/get.md @@ -19,7 +19,6 @@ namespace std { using ranges::get; } ``` -* subrange[link ../subrange.md] * subrange_kind[link ../subrange_kind.md] ## 概要 diff --git a/reference/ranges/subrange/next.md b/reference/ranges/subrange/next.md index 9d9118a7af..c66402dc7b 100644 --- a/reference/ranges/subrange/next.md +++ b/reference/ranges/subrange/next.md @@ -21,9 +21,6 @@ constexpr subrange next(iter_difference_t n = 1) &&; // (2) C++26 ``` * nodiscard[link /lang/cpp17/nodiscard.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] -* forward_iterator[link /reference/iterator/forward_iterator.md] -* subrange[link ../subrange.md] ## 概要 先頭を前進させた`subrange`を得る。 diff --git a/reference/ranges/subrange/op_constructor.md b/reference/ranges/subrange/op_constructor.md index 401aef5496..bb9620ac67 100644 --- a/reference/ranges/subrange/op_constructor.md +++ b/reference/ranges/subrange/op_constructor.md @@ -27,12 +27,7 @@ template constexpr subrange(R&& r, make-unsigned-like-t> n) requires (K == subrange_kind::sized) : subrange{ranges::begin(r), ranges::end(r), n} {} ``` -* subrange[link ../subrange.md] * subrange_kind[link /reference/ranges/subrange_kind.md] -* borrowed_range[link /reference/ranges/borrowed_range.md] -* sized_range[link /reference/ranges/sized_range.md] -* convertible_to[link /reference/concepts/convertible_to.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] * different-from[link ../different-from.md] * convertible-to-non-slicing[link convertible-to-non-slicing.md] * make-unsigned-like-t[link /reference/type_traits/make_unsigned.md] diff --git a/reference/ranges/subrange/op_deduction_guide.md b/reference/ranges/subrange/op_deduction_guide.md index 5eb1911868..ac64cd567e 100644 --- a/reference/ranges/subrange/op_deduction_guide.md +++ b/reference/ranges/subrange/op_deduction_guide.md @@ -23,16 +23,9 @@ namespace std::ranges { subrange, sentinel_t, subrange_kind::sized>; } ``` -* subrange[link ../subrange.md] * subrange_kind[link /reference/ranges/subrange_kind.md] * input_or_output_iterator[link /reference/iterator/input_or_output_iterator.md] -* borrowed_range[link /reference/ranges/borrowed_range.md] -* iterator_t[link /reference/ranges/iterator_t.md] -* sentinel_t[link /reference/ranges/sentinel_t.md] -* sized_range[link /reference/ranges/sized_range.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] * sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] -* sentinel_for[link /reference/iterator/sentinel_for.md] * make-unsigned-like-t[link /reference/type_traits/make_unsigned.md] ## 概要 diff --git a/reference/ranges/subrange/pair-like-convertible-from.md b/reference/ranges/subrange/pair-like-convertible-from.md index a700da03a0..6d15d2fd9e 100644 --- a/reference/ranges/subrange/pair-like-convertible-from.md +++ b/reference/ranges/subrange/pair-like-convertible-from.md @@ -23,11 +23,9 @@ namespace std::ranges { convertible_to>; } ``` -* range[link ../range.md] * pair-like[link /reference/tuple/pair-like.md] * convertible-to-non-slicing[link convertible-to-non-slicing.md] * constructible_from[link /reference/concepts/constructible_from.md] -* convertible_to[link /reference/concepts/convertible_to.md] * tuple_element_t[link /reference/tuple/tuple_element.md] * is_reference_v[link /reference/type_traits/is_reference.md] * convertible-to-non-slicing[italic] diff --git a/reference/ranges/subrange/prev.md b/reference/ranges/subrange/prev.md index 18274abc07..97d5f95bd9 100644 --- a/reference/ranges/subrange/prev.md +++ b/reference/ranges/subrange/prev.md @@ -15,9 +15,6 @@ constexpr subrange requires bidirectional_iterator; // (1) C++26 ``` * nodiscard[link /lang/cpp17/nodiscard.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] -* bidirectional_iterator[link /reference/iterator/bidirectional_iterator.md] -* subrange[link ../subrange.md] ## 概要 先頭を後退させた`subrange`を得る。 diff --git a/reference/ranges/subrange/size.md b/reference/ranges/subrange/size.md index 4eddd9763c..16462f72b3 100644 --- a/reference/ranges/subrange/size.md +++ b/reference/ranges/subrange/size.md @@ -10,7 +10,6 @@ constexpr make-unsigned-like-t> size() const requires (K == subrange_kind::sized); ``` * make-unsigned-like-t[italic][link /reference/type_traits/make_unsigned.md] -* iter_difference_t[link /reference/iterator/iter_difference_t.md] * subrange_kind[link /reference/ranges/subrange_kind.md] ## 概要 diff --git a/reference/ranges/subrange/uses-nonqualification-pointer-conversion.md b/reference/ranges/subrange/uses-nonqualification-pointer-conversion.md index 390f4236f3..7f1c3a6a29 100644 --- a/reference/ranges/subrange/uses-nonqualification-pointer-conversion.md +++ b/reference/ranges/subrange/uses-nonqualification-pointer-conversion.md @@ -12,7 +12,6 @@ namespace std::ranges { !convertible_to(*)[], remove_pointer_t(*)[]>; } ``` -* convertible_to[link /reference/concepts/convertible_to.md] * is_pointer_v[link /reference/type_traits/is_pointer.md] * remove_pointer_t[link /reference/type_traits/remove_pointer.md] * uses-nonqualification-pointer-conversion[italic] diff --git a/reference/ranges/take_view.md b/reference/ranges/take_view.md index 4be2cc4543..63f0b05a84 100644 --- a/reference/ranges/take_view.md +++ b/reference/ranges/take_view.md @@ -14,8 +14,6 @@ namespace std::ranges { } } ``` -* view[link view.md] -* view_interface[link view_interface.md] ## 概要 - (1): 元のRangeの先頭から指定した個数の値を取り出す[`view`](view.md) diff --git a/reference/ranges/take_while_view.md b/reference/ranges/take_while_view.md index 00eb02cc41..dabfcd3a5a 100644 --- a/reference/ranges/take_while_view.md +++ b/reference/ranges/take_while_view.md @@ -15,12 +15,6 @@ namespace std::ranges { } } ``` -* view[link view.md] -* input_range[link input_range.md] -* is_object_v[link /reference/type_traits/is_object.md] -* indirect_unary_predicate[link /reference/iterator/indirect_unary_predicate.md] -* iterator_t[link iterator_t.md] -* view_interface[link view_interface.md] ## 概要 - (1): 元のRangeの先頭から指定した条件を連続して満たす範囲を取り出す[`view`](view.md) diff --git a/reference/ranges/to.md b/reference/ranges/to.md index 7890d91670..d6a24d6370 100644 --- a/reference/ranges/to.md +++ b/reference/ranges/to.md @@ -60,7 +60,6 @@ if constexpr (sized_range && reservable-container) { } ranges::copy(r, container-inserter>(c)); ``` -* ranges::size[link /reference/ranges/size.md] * ranges::copy[link /reference/algorithm/ranges_copy.md] [`input_range`](input_range.md)`<`[`range_reference_t`](range_reference_t.md)`>`である場合: diff --git a/reference/ranges/to_input_view.md b/reference/ranges/to_input_view.md index 88459150b1..adeab0b5bc 100644 --- a/reference/ranges/to_input_view.md +++ b/reference/ranges/to_input_view.md @@ -15,8 +15,6 @@ namespace std::ranges { } } ``` -* view[link view.md] -* view_interface[link view_interface.md] ## 概要 - (1): [`input_range`](/reference/ranges/input_range.md)として振る舞う[`view`](view.md) diff --git a/reference/ranges/view.md b/reference/ranges/view.md index 2686333bb2..f1a826c394 100644 --- a/reference/ranges/view.md +++ b/reference/ranges/view.md @@ -10,7 +10,6 @@ namespace std::ranges { concept view = range && movable && enable_view; } ``` -* range[link range.md] * movable[link /reference/concepts/movable.md] * enable_view[link enable_view.md] @@ -57,7 +56,6 @@ int main() } ``` * std::ranges::view[color ff0000] -* std::span[link /reference/span/span.md] ### 出力 ``` diff --git a/reference/ranges/view_interface.md b/reference/ranges/view_interface.md index 4d39635ebb..83e2417098 100644 --- a/reference/ranges/view_interface.md +++ b/reference/ranges/view_interface.md @@ -11,8 +11,6 @@ namespace std::ranges { class view_interface { …… }; } ``` -* is_class_v[link /reference/type_traits/is_class.md] -* remove_cv_t[link /reference/type_traits/remove_cv.md] ## 概要 diff --git a/reference/ranges/view_interface/back.md b/reference/ranges/view_interface/back.md index 51a2d6d3b4..2f2f5761d5 100644 --- a/reference/ranges/view_interface/back.md +++ b/reference/ranges/view_interface/back.md @@ -12,8 +12,6 @@ constexpr decltype(auto) back() constexpr decltype(auto) back() const requires bidirectional_range && common_range; // (2) ``` -* bidirectional_range[link ../bidirectional_range.md] -* common_range[link ../common_range.md] ## 概要 Rangeの末尾の要素を取得する。 @@ -33,7 +31,6 @@ Rangeの末尾の要素を取得する。 ```cpp *ranges::prev(ranges::end(derived())) ``` -* ranges::end[link ../end.md] * ranges::prev[link /reference/iterator/ranges_prev.md] * derived[link derived.md] diff --git a/reference/ranges/view_interface/cbegin.md b/reference/ranges/view_interface/cbegin.md index f00bb033a1..b4317e36f2 100644 --- a/reference/ranges/view_interface/cbegin.md +++ b/reference/ranges/view_interface/cbegin.md @@ -12,7 +12,6 @@ constexpr auto cbegin() constexpr auto cbegin() const requires input_range; // (2) ``` -* input_range[link ../input_range.md] ## 概要 diff --git a/reference/ranges/view_interface/cend.md b/reference/ranges/view_interface/cend.md index 76fd620a14..cf1918cf03 100644 --- a/reference/ranges/view_interface/cend.md +++ b/reference/ranges/view_interface/cend.md @@ -12,7 +12,6 @@ constexpr auto cend() constexpr auto cend() const requires input_range; // (2) ``` -* input_range[link ../input_range.md] ## 概要 diff --git a/reference/ranges/view_interface/data.md b/reference/ranges/view_interface/data.md index 2ad22e1b39..69562319b7 100644 --- a/reference/ranges/view_interface/data.md +++ b/reference/ranges/view_interface/data.md @@ -12,9 +12,6 @@ constexpr auto data() constexpr auto data() const requires range && contiguous_iterator>; // (2) ``` -* contiguous_iterator[link /reference/iterator/contiguous_iterator.md] -* iterator_t[link ../iterator_t.md] -* range[link ../range.md] ## 概要 Rangeの要素へのポインタを取得する。 @@ -32,7 +29,6 @@ Rangeの要素へのポインタを取得する。 to_address(ranges::begin(derived())); ``` * to_address[link /reference/memory/to_address.md] -* ranges::begin[link ../begin.md] * derived[link derived.md] ## 計算量 diff --git a/reference/ranges/view_interface/empty.md b/reference/ranges/view_interface/empty.md index 2cdc27261a..53a68c42c6 100644 --- a/reference/ranges/view_interface/empty.md +++ b/reference/ranges/view_interface/empty.md @@ -12,8 +12,6 @@ constexpr bool empty() constexpr bool empty() const requires sized_range || forward_range; // (2) ``` -* forward_range[link ../forward_range.md] -* forward_range[link ../sized_range.md] ## 概要 Rangeが空かどうかを判定する。 @@ -30,8 +28,6 @@ Rangeが空かどうかを判定する。 ```cpp ranges::begin(derived()) == ranges::end(derived()) ``` -* ranges::begin[link ../begin.md] -* ranges::end[link ../end.md] * derived[link derived.md] ## 計算量 diff --git a/reference/ranges/view_interface/front.md b/reference/ranges/view_interface/front.md index 832ab5167f..00ba7cdfdb 100644 --- a/reference/ranges/view_interface/front.md +++ b/reference/ranges/view_interface/front.md @@ -12,7 +12,6 @@ constexpr decltype(auto) front() constexpr decltype(auto) front() const requires forward_range; // (2) ``` -* forward_range[link ../forward_range.md] ## 概要 Rangeの先頭の要素を取得する。 @@ -32,7 +31,6 @@ Rangeの先頭の要素を取得する。 ```cpp *ranges::begin(derived()) ``` -* ranges::begin[link ../begin.md] * derived[link derived.md] ## 計算量 diff --git a/reference/ranges/view_interface/op_at.md b/reference/ranges/view_interface/op_at.md index 00ef7c67ce..16707e7dfb 100644 --- a/reference/ranges/view_interface/op_at.md +++ b/reference/ranges/view_interface/op_at.md @@ -12,8 +12,6 @@ constexpr decltype(auto) operator[](range_difference_t n) // (1) template constexpr decltype(auto) operator[](range_difference_t n) const // (2) ``` -* random_access_range[link ../random_access_range.md] -* range_difference_t[link ../range_difference_t.md] ## 概要 Rangeの要素にアクセスする。 @@ -27,7 +25,6 @@ Rangeの要素にアクセスする。 ```cpp ranges::begin(derived())[n]; ``` -* ranges::begin[link ../begin.md] * derived[link derived.md] ## 計算量 diff --git a/reference/ranges/view_interface/size.md b/reference/ranges/view_interface/size.md index 33e356b7b9..76f71d23de 100644 --- a/reference/ranges/view_interface/size.md +++ b/reference/ranges/view_interface/size.md @@ -12,9 +12,6 @@ constexpr auto size() constexpr auto size() const requires forward_range && sized_sentinel_for, iterator_t>; // (2) ``` -* forward_range[link ../forward_range.md] -* sentinel_t[link ../sentinel_t.md] -* iterator_t[link ../iterator_t.md] * sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] ## 概要 @@ -32,8 +29,6 @@ Rangeの大きさを取得する。 ```cpp ranges::end(derived()) - ranges::begin(derived()); ``` -* ranges::begin[link ../begin.md] -* ranges::end[link ../end.md] * derived[link derived.md] ## 計算量 diff --git a/reference/ranges/viewable_range.md b/reference/ranges/viewable_range.md index 0c4d05d169..71bf36f393 100644 --- a/reference/ranges/viewable_range.md +++ b/reference/ranges/viewable_range.md @@ -14,12 +14,9 @@ namespace std::ranges { (is_lvalue_reference_v || (movable> && !is-initializer-list)))); } ``` -* range[link range.md] -* view[link view.md] * constructible_from[link /reference/concepts/constructible_from.md] * is_lvalue_reference_v[link /reference/type_traits/is_lvalue_reference.md] * movable[link /reference/concepts/movable.md] -* remove_reference_t[link /reference/type_traits/remove_reference.md] * is-initializer-list[italic] ## 概要 diff --git a/reference/ranges/zip_transform_view/begin.md b/reference/ranges/zip_transform_view/begin.md index 9b6a923369..a5b847c5c7 100644 --- a/reference/ranges/zip_transform_view/begin.md +++ b/reference/ranges/zip_transform_view/begin.md @@ -15,9 +15,6 @@ constexpr auto begin() const range_reference_t... >; // (2) C++23 ``` -* range[link ../range.md] -* regular_invocable[link /reference/concepts/invocable.md] -* range_reference_t[link ../range_reference_t.md] ## 概要 diff --git a/reference/ranges/zip_transform_view/end.md b/reference/ranges/zip_transform_view/end.md index 876c0c5594..b043251cb7 100644 --- a/reference/ranges/zip_transform_view/end.md +++ b/reference/ranges/zip_transform_view/end.md @@ -15,9 +15,6 @@ constexpr auto end() const range_reference_t... >; // (2) C++23 ``` -* range[link ../range.md] -* regular_invocable[link /reference/concepts/invocable.md] -* range_reference_t[link ../range_reference_t.md] ## 概要 diff --git a/reference/ranges/zip_transform_view/size.md b/reference/ranges/zip_transform_view/size.md index e29dbf6250..68c5bfa467 100644 --- a/reference/ranges/zip_transform_view/size.md +++ b/reference/ranges/zip_transform_view/size.md @@ -12,7 +12,6 @@ constexpr auto size() constexpr auto size() const requires sized_range; // (2) C++23 ``` -* sized_range[link ../sized_range.md] ## 概要 diff --git a/reference/regex/basic_regex/op_deduction_guide.md b/reference/regex/basic_regex/op_deduction_guide.md index 1e638cb323..831cb47d64 100644 --- a/reference/regex/basic_regex/op_deduction_guide.md +++ b/reference/regex/basic_regex/op_deduction_guide.md @@ -12,7 +12,6 @@ namespace std { -> basic_regex::value_type>; } ``` -* iterator_traits[link /reference/iterator/iterator_traits.md] * regex_constants[link /reference/regex/regex_constants.md] * syntax_option_type[link /reference/regex/regex_constants/syntax_option_type.md] * ECMAScript[link /reference/regex/regex_constants/syntax_option_type.md] diff --git a/reference/regex/regex_iterator.md b/reference/regex/regex_iterator.md index d1d80002a3..a00045aad1 100644 --- a/reference/regex/regex_iterator.md +++ b/reference/regex/regex_iterator.md @@ -17,7 +17,6 @@ namespace std { using wsregex_iterator = regex_iterator; } ``` -* iterator_traits[link /reference/iterator/iterator_traits.md] * regex_traits[link regex_traits.md] * string[link /reference/string/basic_string.md] * wstring[link /reference/string/basic_string.md] diff --git a/reference/regex/regex_token_iterator.md b/reference/regex/regex_token_iterator.md index d623b1d182..d91ae3d284 100644 --- a/reference/regex/regex_token_iterator.md +++ b/reference/regex/regex_token_iterator.md @@ -17,7 +17,6 @@ namespace std { using wsregex_token_iterator = regex_token_iterator; } ``` -* iterator_traits[link /reference/iterator/iterator_traits.md] * regex_traits[link regex_traits.md] * string[link /reference/string/basic_string.md] * wstring[link /reference/string/basic_string.md] diff --git a/reference/regex/sub_match.md b/reference/regex/sub_match.md index 29b00cab03..d7f59ebbf1 100644 --- a/reference/regex/sub_match.md +++ b/reference/regex/sub_match.md @@ -15,7 +15,6 @@ namespace std { using wssub_match = sub_match; } ``` -* pair[link ../utility/pair.md] ## 概要 クラステンプレート `sub_match` は、文字列が正規表現にマッチした際に、その正規表現がマッチした範囲、あるいは、その正規表現内のあるグループがマッチした範囲を表す。 diff --git a/reference/scoped_allocator/scoped_allocator_adaptor/construct.md b/reference/scoped_allocator/scoped_allocator_adaptor/construct.md index b7d8ee171e..023782103a 100644 --- a/reference/scoped_allocator/scoped_allocator_adaptor/construct.md +++ b/reference/scoped_allocator/scoped_allocator_adaptor/construct.md @@ -25,9 +25,6 @@ void construct(pair* p, const pair& x); // (5) C++17 ま template void construct(pair* p, pair&& x); // (6) C++17 まで ``` -* pair[link /reference/utility/pair.md] -* tuple[link /reference/tuple/tuple.md] -* piecewise_construct_t[link /reference/utility/piecewise_construct_t.md] ## 概要 `p` で指定された領域に、[`inner_allocator`](inner_allocator.md)`()` と指定された引数で [uses-allocator 構築](/reference/memory/uses_allocator.md)を行う。 @@ -211,8 +208,6 @@ int main() * alloc.destroy[link destroy.md] * alloc.deallocate[link deallocate.md] * std::piecewise_construct[link /reference/utility/piecewise_construct_t.md] -* std::forward_as_tuple[link /reference/tuple/forward_as_tuple.md] -* std::next[link /reference/iterator/next.md] ### 出力 ``` diff --git a/reference/set/multiset/emplace.md b/reference/set/multiset/emplace.md index ea18815dbf..8a0a9f4668 100644 --- a/reference/set/multiset/emplace.md +++ b/reference/set/multiset/emplace.md @@ -9,7 +9,6 @@ template pair emplace(Args&&... args); ``` -* pair[link ../../utility/pair.md] ## 概要 コンテナに新しい要素を挿入する。要素は直接構築される(コピーもムーブもされない)。要素のコンストラクタはこの関数に渡された引数を与えることによって呼ばれる。 diff --git a/reference/set/multiset/equal_range.md b/reference/set/multiset/equal_range.md index cb23a9521a..0d11139de6 100644 --- a/reference/set/multiset/equal_range.md +++ b/reference/set/multiset/equal_range.md @@ -17,7 +17,6 @@ template pair equal_range(const K& x) const; // (4) C++14 ``` -* pair[link /reference/utility/pair.md] ## 概要 コンテナ内の、`x` と等しい全てのキー要素を含む範囲の境界を返す。 diff --git a/reference/set/multiset/op_constructor.md b/reference/set/multiset/op_constructor.md index d4022a8a68..e5391ea88e 100644 --- a/reference/set/multiset/op_constructor.md +++ b/reference/set/multiset/op_constructor.md @@ -108,7 +108,6 @@ multiset(from_range_t, R&& rg, } ``` * std::scoped_allocator_adaptor[link ../../scoped_allocator/scoped_allocator_adaptor.md] - * std::allocator[link ../../memory/allocator.md] * ls.emplace_back[link ../../list/list/emplace_back.md] なお、C++14 では同様の理由で (11) の形式も新たに追加されているが、こちらは存在しなくてもエラーとはならない。 diff --git a/reference/set/multiset/op_deduction_guide.md b/reference/set/multiset/op_deduction_guide.md index 5b27246005..3ba38dc327 100644 --- a/reference/set/multiset/op_deduction_guide.md +++ b/reference/set/multiset/op_deduction_guide.md @@ -31,7 +31,6 @@ namespace std { } ``` * less[link /reference/functional/less.md] -* iterator_traits[link /reference/iterator/iterator_traits.md] * allocator[link /reference/memory/allocator.md] * initializer_list[link /reference/initializer_list/initializer_list.md] * ranges::input_range[link /reference/ranges/input_range.md] diff --git a/reference/set/set/emplace.md b/reference/set/set/emplace.md index 1e24244a85..dbf602e714 100644 --- a/reference/set/set/emplace.md +++ b/reference/set/set/emplace.md @@ -9,7 +9,6 @@ template pair emplace(Args&&... args); ``` -* pair[link ../../utility/pair.md] ## 概要 コンテナに新しい要素を挿入する。要素は直接構築される(コピーもムーブもされない)。要素のコンストラクタはこの関数に渡された引数を与えることによって呼ばれる。 diff --git a/reference/set/set/equal_range.md b/reference/set/set/equal_range.md index ee830d2228..b55e41f931 100644 --- a/reference/set/set/equal_range.md +++ b/reference/set/set/equal_range.md @@ -17,7 +17,6 @@ template pair equal_range(const K& x) const; // (4) C++14 ``` -* pair[link /reference/utility/pair.md] ## 概要 コンテナ内の、`x` と等しい全てのキー要素を含む範囲の境界を返す。`set` コンテナではキーの重複は無いため、この範囲は最大一つの要素を含む。 diff --git a/reference/set/set/insert.md b/reference/set/set/insert.md index 180fb3d7a5..6284243c07 100644 --- a/reference/set/set/insert.md +++ b/reference/set/set/insert.md @@ -27,7 +27,6 @@ void insert(initializer_list init); // (8) C++03 insert_return_type insert(node_type&& nh); // (9) C++17 iterator insert(const_iterator hint, node_type&& nh); // (10) C++17 ``` -* pair[link /reference/utility/pair.md] * initializer_list[link /reference/initializer_list/initializer_list.md] ## 概要 diff --git a/reference/set/set/op_constructor.md b/reference/set/set/op_constructor.md index 30ab3f2a00..798c0976e9 100644 --- a/reference/set/set/op_constructor.md +++ b/reference/set/set/op_constructor.md @@ -108,7 +108,6 @@ set(from_range_t, R&& rg, } ``` * std::scoped_allocator_adaptor[link ../../scoped_allocator/scoped_allocator_adaptor.md] - * std::allocator[link ../../memory/allocator.md] * ls.emplace_back[link ../../list/list/emplace_back.md] なお、C++14 では同様の理由で (11) の形式も新たに追加されているが、こちらは存在しなくてもエラーとはならない。 diff --git a/reference/set/set/op_deduction_guide.md b/reference/set/set/op_deduction_guide.md index 7a13e38008..0ed1fb77a0 100644 --- a/reference/set/set/op_deduction_guide.md +++ b/reference/set/set/op_deduction_guide.md @@ -31,7 +31,6 @@ namespace std { } ``` * less[link /reference/functional/less.md] -* iterator_traits[link /reference/iterator/iterator_traits.md] * allocator[link /reference/memory/allocator.md] * initializer_list[link /reference/initializer_list/initializer_list.md] * ranges::input_range[link /reference/ranges/input_range.md] diff --git a/reference/shared_mutex/shared_mutex.md b/reference/shared_mutex/shared_mutex.md index bd39450c15..ced29b2ea9 100644 --- a/reference/shared_mutex/shared_mutex.md +++ b/reference/shared_mutex/shared_mutex.md @@ -131,7 +131,6 @@ int main() ``` * std::shared_mutex[color ff0000] * std::shared_lock[link shared_lock.md] -* std::this_thread::sleep_for[link /reference/thread/this_thread/sleep_for.md] * join()[link /reference/thread/thread/join.md] ### 出力例 diff --git a/reference/shared_mutex/shared_timed_mutex.md b/reference/shared_mutex/shared_timed_mutex.md index c27d1dd1c5..2f337c2e1d 100644 --- a/reference/shared_mutex/shared_timed_mutex.md +++ b/reference/shared_mutex/shared_timed_mutex.md @@ -137,7 +137,6 @@ int main() ``` * std::shared_timed_mutex[color ff0000] * std::shared_lock[link shared_lock.md] -* std::this_thread::sleep_for[link /reference/thread/this_thread/sleep_for.md] * join()[link /reference/thread/thread/join.md] ### 出力例 diff --git a/reference/span/integral-constant-like.md b/reference/span/integral-constant-like.md index 3af0844898..64270d3766 100644 --- a/reference/span/integral-constant-like.md +++ b/reference/span/integral-constant-like.md @@ -17,7 +17,6 @@ concept integral-constant-like = // exposition only * is_same_v[link /reference/type_traits/is_same.md] * remove_const_t[link /reference/type_traits/remove_const.md] * bool_constant[link /reference/type_traits/bool_constant.md] -* convertible_to[link /reference/concepts/convertible_to.md] * equality_comparable_with[link /reference/concepts/equality_comparable.md] ## 概要 diff --git a/reference/span/span/begin.md b/reference/span/span/begin.md index 0b31fd74a9..6c2b38e16d 100644 --- a/reference/span/span/begin.md +++ b/reference/span/span/begin.md @@ -70,8 +70,6 @@ int main() std::cout << std::endl; } ``` -* std::begin[link /reference/iterator/begin.md] -* std::end[link /reference/iterator/end.md] * s.begin[color ff0000] * begin(s)[color ff0000] * s.end()[link end.md] diff --git a/reference/span/span/cend.md b/reference/span/span/cend.md index 2a538a2b05..e9da662440 100644 --- a/reference/span/span/cend.md +++ b/reference/span/span/cend.md @@ -55,7 +55,6 @@ int main() { } ``` * cend()[color ff0000] -* sentinel_for[link /reference/iterator/sentinel_for.md] ### 出力 ``` diff --git a/reference/span/span/crend.md b/reference/span/span/crend.md index 68c234eb1f..7bde9bd560 100644 --- a/reference/span/span/crend.md +++ b/reference/span/span/crend.md @@ -54,7 +54,6 @@ int main() { } ``` * crend()[color ff0000] -* sentinel_for[link /reference/iterator/sentinel_for.md] ### 出力 ``` diff --git a/reference/span/span/end.md b/reference/span/span/end.md index 99f192b295..2b9a8323b6 100644 --- a/reference/span/span/end.md +++ b/reference/span/span/end.md @@ -70,8 +70,6 @@ int main() std::cout << std::endl; } ``` -* std::begin[link /reference/iterator/begin.md] -* std::end[link /reference/iterator/end.md] * s.end[color ff0000] * end(s)[color ff0000] * s.begin()[link begin.md] diff --git a/reference/span/span/op_deduction_guide.md b/reference/span/span/op_deduction_guide.md index 5afd8ea6b8..868ea0ae13 100644 --- a/reference/span/span/op_deduction_guide.md +++ b/reference/span/span/op_deduction_guide.md @@ -30,7 +30,6 @@ namespace std { } ``` -* remove_reference_t[link /reference/type_traits/remove_reference.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] * maybe-static-ext[link /reference/span/maybe-static-ext.md] * array[link /reference/array/array.md] diff --git a/reference/sstream/basic_istringstream/view.md b/reference/sstream/basic_istringstream/view.md index d5ffef3e59..d44461b726 100644 --- a/reference/sstream/basic_istringstream/view.md +++ b/reference/sstream/basic_istringstream/view.md @@ -8,7 +8,6 @@ ```cpp basic_string_view view() const noexcept; ``` -* basic_string_view[link /reference/string_view/basic_string_view.md] ## 概要 文字列ビューオブジェクトの取得を行う。 diff --git a/reference/sstream/basic_ostringstream/view.md b/reference/sstream/basic_ostringstream/view.md index f956af85e4..fa8525ddb6 100644 --- a/reference/sstream/basic_ostringstream/view.md +++ b/reference/sstream/basic_ostringstream/view.md @@ -8,7 +8,6 @@ ```cpp basic_string_view view() const noexcept; ``` -* basic_string_view[link /reference/string_view/basic_string_view.md] ## 概要 文字列ビューオブジェクトの取得を行う。 diff --git a/reference/sstream/basic_stringbuf/view.md b/reference/sstream/basic_stringbuf/view.md index 521657fea5..a1a75d42dd 100644 --- a/reference/sstream/basic_stringbuf/view.md +++ b/reference/sstream/basic_stringbuf/view.md @@ -8,7 +8,6 @@ ```cpp basic_string_view view() const noexcept; ``` -* basic_string_view[link /reference/string_view/basic_string_view.md] ## 概要 文字列ビューオブジェクトの取得を行う。 diff --git a/reference/sstream/basic_stringstream/view.md b/reference/sstream/basic_stringstream/view.md index 767963f4ff..2f3520c295 100644 --- a/reference/sstream/basic_stringstream/view.md +++ b/reference/sstream/basic_stringstream/view.md @@ -8,7 +8,6 @@ ```cpp basic_string_view view() const noexcept; ``` -* basic_string_view[link /reference/string_view/basic_string_view.md] ## 概要 文字列ビューオブジェクトの取得を行う。 diff --git a/reference/stack/stack/emplace.md b/reference/stack/stack/emplace.md index 926aad9bf1..83694b65d3 100644 --- a/reference/stack/stack/emplace.md +++ b/reference/stack/stack/emplace.md @@ -22,13 +22,11 @@ decltype(auto) emplace(Args&&... args); // C++17 から ```cpp c.emplace_back(std::forward(args)...); ``` -* std::forward[link /reference/utility/forward.md] - C++17 から ```cpp return c.emplace_back(std::forward(args)...); ``` -* std::forward[link /reference/utility/forward.md] ## 戻り値 diff --git a/reference/stack/stack/op_deduction_guide.md b/reference/stack/stack/op_deduction_guide.md index 62c8ae8753..de51f5e9ba 100644 --- a/reference/stack/stack/op_deduction_guide.md +++ b/reference/stack/stack/op_deduction_guide.md @@ -36,7 +36,6 @@ namespace std { Allocator>>; // (6) C++23から } ``` -* iterator_traits[link /reference/iterator/iterator_traits.md] * deque[link /reference/deque/deque.md] * ranges::input_range[link /reference/ranges/input_range.md] * ranges::range_value_t[link /reference/ranges/range_value_t.md] diff --git a/reference/stop_token/stop_callback/op_destructor.md b/reference/stop_token/stop_callback/op_destructor.md index b366366edd..bf02d5d811 100644 --- a/reference/stop_token/stop_callback/op_destructor.md +++ b/reference/stop_token/stop_callback/op_destructor.md @@ -124,7 +124,6 @@ int main() * get_token()[link ../stop_source/get_token.md] * std::make_unique[link /reference/memory/make_unique.md] * std::function[link /reference/functional/function.md] -* std::this_thread::sleep_for[link /reference/thread/this_thread/sleep_for.md] ### 出力 ``` diff --git a/reference/stop_token/stop_source/request_stop.md b/reference/stop_token/stop_source/request_stop.md index 676f723a75..a15f8f32cb 100644 --- a/reference/stop_token/stop_source/request_stop.md +++ b/reference/stop_token/stop_source/request_stop.md @@ -117,7 +117,6 @@ int main() * get_token()[link get_token.md] * condition_variable_any[link /reference/condition_variable/condition_variable_any.md] * cv.wait[link /reference/condition_variable/condition_variable_any/wait.md] -* std::this_thread::sleep_for[link /reference/thread/this_thread/sleep_for.md] ### 出力 ``` diff --git a/reference/stop_token/stoppable_token.md b/reference/stop_token/stoppable_token.md index 9cbe407fc3..6143103d21 100644 --- a/reference/stop_token/stoppable_token.md +++ b/reference/stop_token/stoppable_token.md @@ -38,9 +38,7 @@ concept stoppable_token = equality_comparable && swappable; ``` -* same_as[link /reference/concepts/same_as.md] * copyable[link /reference/concepts/copyable.md] -* equality_comparable[link /reference/concepts/equality_comparable.md] * swappable[link /reference/concepts/swappable.md] @@ -67,7 +65,6 @@ concept stoppable-callback-for = requires { typename stop_callback_for_t; } && constructible_from, const Token&, Initializer>; ``` -* invocable[link /reference/concepts/invocable.md] * constructible_from[link /reference/concepts/constructible_from.md] * stop_callback_for_t[link stop_callback_for_t.md] diff --git a/reference/string/basic_string/append.md b/reference/string/basic_string/append.md index b1be83c9bd..a35d2d13e7 100644 --- a/reference/string/basic_string/append.md +++ b/reference/string/basic_string/append.md @@ -111,7 +111,6 @@ constexpr basic_string& basic_string_view sv = t; return append(sv.data(), sv.size()); ``` - * basic_string_view[link /reference/string_view/basic_string_view.md] - (9) 対象オブジェクトの末尾に、[`basic_string_view`](/reference/string_view/basic_string_view.md)``に変換可能な`t`の指定された範囲の文字列が追加される。 * 文字列の長さ `rlen` は、`n` と [`sv.size()`](/reference/string_view/basic_string_view/size.md)` - pos` の小さい方である。 @@ -120,7 +119,6 @@ constexpr basic_string& basic_string_view sv = t; return append(sv.substr(pos, n)); ``` - * basic_string_view[link /reference/string_view/basic_string_view.md] * substr[link /reference/string_view/basic_string_view/substr.md] diff --git a/reference/string/basic_string/assign.md b/reference/string/basic_string/assign.md index 342e2d797b..5fee95ee2d 100644 --- a/reference/string/basic_string/assign.md +++ b/reference/string/basic_string/assign.md @@ -103,7 +103,6 @@ constexpr basic_string& basic_string_view sv = t; return assign(sv.data(), sv.size()); ``` - * basic_string_view[link /reference/string_view/basic_string_view.md] - (10) : [`basic_string_view`](/reference/string_view/basic_string_view.md)``に変換可能な`t`が参照する文字列を範囲指定でコピーして、`basic_string`オブジェクトを構築する。 以下と等価。 @@ -111,7 +110,6 @@ constexpr basic_string& basic_string_view sv = t; return assign(sv.substr(pos, n)); ``` - * basic_string_view[link /reference/string_view/basic_string_view.md] * substr[link /reference/string_view/basic_string_view/substr.md] diff --git a/reference/string/basic_string/compare.md b/reference/string/basic_string/compare.md index 590f219603..b0b9bc62c2 100644 --- a/reference/string/basic_string/compare.md +++ b/reference/string/basic_string/compare.md @@ -131,7 +131,6 @@ constexpr int basic_string_view s = *this, sv = t; return s.substr(pos1, n1).compare(sv.substr(pos2, n2)); ``` - * basic_string_view[link /reference/string_view/basic_string_view.md] * substr[link /reference/string_view/basic_string_view/substr.md] * compare[link /reference/string_view/basic_string_view/compare.md] diff --git a/reference/string/basic_string/contains.md b/reference/string/basic_string/contains.md index ebb7a32871..93210cdb0f 100644 --- a/reference/string/basic_string/contains.md +++ b/reference/string/basic_string/contains.md @@ -10,7 +10,6 @@ constexpr bool contains(basic_string_view x) const noexcept; // ( constexpr bool contains(charT x) const noexcept; // (2) C++23 constexpr bool contains(const charT* x) const; // (3) C++23 ``` -* basic_string_view[link /reference/string_view/basic_string_view.md] ## 概要 指定の文字・文字列が含まれているかを判定する。 @@ -27,7 +26,6 @@ constexpr bool contains(const charT* x) const; // ( ```cpp return basic_string_view(data(), size()).contains(x); ``` - * basic_string_view[link /reference/string_view/basic_string_view.md] * contains[link /reference/string_view/basic_string_view/contains.md] * data()[link data.md] * size()[link size.md] diff --git a/reference/string/basic_string/find.md b/reference/string/basic_string/find.md index 2fd2c4437c..f960ef13ac 100644 --- a/reference/string/basic_string/find.md +++ b/reference/string/basic_string/find.md @@ -82,7 +82,6 @@ constexpr size_type is_nothrow_convertible_v> ``` * is_nothrow_convertible_v[link /reference/type_traits/is_nothrow_convertible.md] - * basic_string_view[link /reference/string_view/basic_string_view.md] ## 備考 diff --git a/reference/string/basic_string/find_first_not_of.md b/reference/string/basic_string/find_first_not_of.md index b9f1fe4203..223734932b 100644 --- a/reference/string/basic_string/find_first_not_of.md +++ b/reference/string/basic_string/find_first_not_of.md @@ -80,7 +80,6 @@ constexpr size_type is_nothrow_convertible_v> ``` * is_nothrow_convertible_v[link /reference/type_traits/is_nothrow_convertible.md] - * basic_string_view[link /reference/string_view/basic_string_view.md] ## 備考 diff --git a/reference/string/basic_string/find_first_of.md b/reference/string/basic_string/find_first_of.md index 2853865ff4..53f1424694 100644 --- a/reference/string/basic_string/find_first_of.md +++ b/reference/string/basic_string/find_first_of.md @@ -79,7 +79,6 @@ constexpr size_type is_nothrow_convertible_v> ``` * is_nothrow_convertible_v[link /reference/type_traits/is_nothrow_convertible.md] - * basic_string_view[link /reference/string_view/basic_string_view.md] ## 備考 diff --git a/reference/string/basic_string/find_last_not_of.md b/reference/string/basic_string/find_last_not_of.md index 6be710f9bf..8c49d502b4 100644 --- a/reference/string/basic_string/find_last_not_of.md +++ b/reference/string/basic_string/find_last_not_of.md @@ -81,7 +81,6 @@ constexpr size_type is_nothrow_convertible_v> ``` * is_nothrow_convertible_v[link /reference/type_traits/is_nothrow_convertible.md] - * basic_string_view[link /reference/string_view/basic_string_view.md] ## 備考 diff --git a/reference/string/basic_string/find_last_of.md b/reference/string/basic_string/find_last_of.md index 46549478fb..cc242c0af4 100644 --- a/reference/string/basic_string/find_last_of.md +++ b/reference/string/basic_string/find_last_of.md @@ -79,7 +79,6 @@ constexpr size_type is_nothrow_convertible_v> ``` * is_nothrow_convertible_v[link /reference/type_traits/is_nothrow_convertible.md] - * basic_string_view[link /reference/string_view/basic_string_view.md] ## 備考 diff --git a/reference/string/basic_string/insert.md b/reference/string/basic_string/insert.md index def1e70bba..bebfa273bd 100644 --- a/reference/string/basic_string/insert.md +++ b/reference/string/basic_string/insert.md @@ -122,14 +122,12 @@ constexpr basic_string& basic_string_view sv = t; return insert(pos1, sv.data(), sv.size()); ``` - * basic_string_view[link /reference/string_view/basic_string_view.md] - (11) : 以下と等価。 ```cpp basic_string_view sv = t; return insert(pos1, sv.substr(pos2, n)); ``` - * basic_string_view[link /reference/string_view/basic_string_view.md] * substr[link /reference/string_view/basic_string_view/substr.md] diff --git a/reference/string/basic_string/op_assign.md b/reference/string/basic_string/op_assign.md index 103089ce15..60b06327eb 100644 --- a/reference/string/basic_string/op_assign.md +++ b/reference/string/basic_string/op_assign.md @@ -46,7 +46,6 @@ basic_string& operator=(nullptr_t) = delete; // (7) C++23 basic_string_view sv = t; return assign(sv); ``` - * basic_string_view[link /reference/string_view/basic_string_view.md] * assign[link assign.md] diff --git a/reference/string/basic_string/op_basic_string_view.md b/reference/string/basic_string/op_basic_string_view.md index 4f91cd9bbe..c121104e33 100644 --- a/reference/string/basic_string/op_basic_string_view.md +++ b/reference/string/basic_string/op_basic_string_view.md @@ -9,7 +9,6 @@ operator basic_string_view() const noexcept; // (1) C++17 constexpr operator basic_string_view() const noexcept; // (1) C++20 ``` -* basic_string_view[link /reference/string_view/basic_string_view.md] ## 概要 [`std::basic_string_view`](/reference/string_view/basic_string_view.md)型に変換する。 diff --git a/reference/string/basic_string/op_compare_3way.md b/reference/string/basic_string/op_compare_3way.md index 127947a6df..7613848d9e 100644 --- a/reference/string/basic_string/op_compare_3way.md +++ b/reference/string/basic_string/op_compare_3way.md @@ -32,7 +32,6 @@ namespace std { ```cpp return basic_string_view(lhs) <=> basic_string_view(rhs); ``` -* basic_string_view[link /reference/string_view/basic_string_view.md] 戻り値の型は、`traits::comparison_category`が存在していればその型、そうでなければ[`weak_ordering`](/reference/compare/weak_ordering.md)となる。 diff --git a/reference/string/basic_string/op_deduction_guide.md b/reference/string/basic_string/op_deduction_guide.md index 5e23053fd0..c41e6de04a 100644 --- a/reference/string/basic_string/op_deduction_guide.md +++ b/reference/string/basic_string/op_deduction_guide.md @@ -38,9 +38,7 @@ namespace std { ``` * see below[italic] * allocator[link /reference/memory/allocator.md] -* iterator_traits[link /reference/iterator/iterator_traits.md] * char_traits[link /reference/string/char_traits.md] -* basic_string_view[link /reference/string_view/basic_string_view.md] * ranges::input_range[link /reference/ranges/input_range.md] * ranges::range_value_t[link /reference/ranges/range_value_t.md] * from_range_t[link /reference/ranges/from_range_t.md] diff --git a/reference/string/basic_string/op_plus_assign.md b/reference/string/basic_string/op_plus_assign.md index 970ee09efb..c8c721f05c 100644 --- a/reference/string/basic_string/op_plus_assign.md +++ b/reference/string/basic_string/op_plus_assign.md @@ -59,7 +59,6 @@ constexpr basic_string& operator+=(const T& t); // (5) C++20 basic_string_view sv = t; return append(sv); ``` - * basic_string_view[link /reference/string_view/basic_string_view.md] * append[link append.md] diff --git a/reference/string/basic_string/replace.md b/reference/string/basic_string/replace.md index 6aad3304ca..fb22d0451f 100644 --- a/reference/string/basic_string/replace.md +++ b/reference/string/basic_string/replace.md @@ -229,14 +229,12 @@ constexpr basic_string& basic_string_view sv = t; return replace(pos1, n1, sv.data(), sv.size()); ``` - * basic_string_view[link /reference/string_view/basic_string_view.md] - (13) : 以下と等価。 ```cpp basic_string_view sv = t; return replace(pos1, n1, sv.substr(pos2, n2)); ``` - * basic_string_view[link /reference/string_view/basic_string_view.md] * substr[link /reference/string_view/basic_string_view/substr.md] - (14) : 以下と等価。 @@ -244,7 +242,6 @@ constexpr basic_string& basic_string_view sv = t; return replace(i1 - begin(), i2 - i1, sv.data(), sv.size()); ``` - * basic_string_view[link /reference/string_view/basic_string_view.md] ## 戻り値 diff --git a/reference/string/basic_string/rfind.md b/reference/string/basic_string/rfind.md index baff9ae8d7..18e86d2ca1 100644 --- a/reference/string/basic_string/rfind.md +++ b/reference/string/basic_string/rfind.md @@ -78,7 +78,6 @@ constexpr size_type is_nothrow_convertible_v> ``` * is_nothrow_convertible_v[link /reference/type_traits/is_nothrow_convertible.md] - * basic_string_view[link /reference/string_view/basic_string_view.md] ## 備考 diff --git a/reference/string/char_traits.md b/reference/string/char_traits.md index 15f37ddf65..2843c92ac1 100644 --- a/reference/string/char_traits.md +++ b/reference/string/char_traits.md @@ -134,7 +134,6 @@ int main() } ``` * std::char_traits[color ff0000] -* std::basic_string[link basic_string.md] #### 出力 ``` diff --git a/reference/string_view/basic_string_view/op_constructor.md b/reference/string_view/basic_string_view/op_constructor.md index 0c849b8830..d66f484a80 100644 --- a/reference/string_view/basic_string_view/op_constructor.md +++ b/reference/string_view/basic_string_view/op_constructor.md @@ -147,8 +147,6 @@ int main() } } ``` -* sv.data()[link data.md] -* sv.size()[link size.md] * s.begin()[link /reference/string/basic_string/begin.md] ### 出力 diff --git a/reference/string_view/basic_string_view/op_deduction_guide.md b/reference/string_view/basic_string_view/op_deduction_guide.md index a199df4fe2..b0b6e64192 100644 --- a/reference/string_view/basic_string_view/op_deduction_guide.md +++ b/reference/string_view/basic_string_view/op_deduction_guide.md @@ -15,7 +15,6 @@ namespace std { -> basic_string_view>; // (2) C++23 } ``` -* iter_value_t[link /reference/iterator/iter_value_t.md] * ranges::range_value_t[link /reference/ranges/range_value_t.md] ## 概要 diff --git a/reference/system_error/error_code.md b/reference/system_error/error_code.md index 97fc793b57..0a3fb8681c 100644 --- a/reference/system_error/error_code.md +++ b/reference/system_error/error_code.md @@ -83,7 +83,6 @@ int main() * std::generic_category()[link generic_category.md] * std::system_error[link system_error.md] * ec.value()[link error_code/value.md] -* ec.message()[link error_code/message.md] ### 出力 ``` diff --git a/reference/system_error/error_code/default_error_condition.md b/reference/system_error/error_code/default_error_condition.md index 5e15eed4eb..64d0f94c34 100644 --- a/reference/system_error/error_code/default_error_condition.md +++ b/reference/system_error/error_code/default_error_condition.md @@ -61,7 +61,6 @@ int main() * std::error_condition[link /reference/system_error/error_condition.md] * ec.value()[link value.md] * ec.category()[link category.md] -* ec.message()[link message.md] * name()[link /reference/system_error/error_category/name.md] * ed.value()[link /reference/system_error/error_condition/value.md] * ed.category()[link /reference/system_error/error_condition/category.md] diff --git a/reference/system_error/error_code/op_constructor.md b/reference/system_error/error_code/op_constructor.md index a961148de4..80d1d9eab3 100644 --- a/reference/system_error/error_code/op_constructor.md +++ b/reference/system_error/error_code/op_constructor.md @@ -176,7 +176,6 @@ int main() { std::cout << ec.message() << std::endl; } ``` -* ec.message()[link message.md] * std::error_category[link /reference/system_error/error_category.md] #### 出力 diff --git a/reference/system_error/error_condition.md b/reference/system_error/error_condition.md index 92e95afa89..01cc5db2f7 100644 --- a/reference/system_error/error_condition.md +++ b/reference/system_error/error_condition.md @@ -81,7 +81,6 @@ int main() * std::errc::invalid_argument[link errc.md] * std::generic_category()[link generic_category.md] * std::system_error[link system_error.md] -* std::error_code[link error_code.md] * ec.default_error_condition()[link error_code/default_error_condition.md] * cond.value()[link error_condition/value.md] * cond.message()[link error_condition/message.md] diff --git a/reference/system_error/make_error_code.md b/reference/system_error/make_error_code.md index 421899bea5..c91bd2a19d 100644 --- a/reference/system_error/make_error_code.md +++ b/reference/system_error/make_error_code.md @@ -40,12 +40,10 @@ int main() } ``` * std::make_error_code[color ff0000] -* std::error_code[link error_code.md] * std::errc::invalid_argument[link errc.md] * ec.category()[link error_code/category.md] * name()[link error_category/name.md] * ec.value()[link error_code/value.md] -* ec.message()[link error_code/message.md] ### 出力 ``` diff --git a/reference/system_error/make_error_condition.md b/reference/system_error/make_error_condition.md index 025c694311..be522f67e2 100644 --- a/reference/system_error/make_error_condition.md +++ b/reference/system_error/make_error_condition.md @@ -45,7 +45,6 @@ int main() * ec.category()[link error_condition/category.md] * name()[link error_category/name.md] * ec.value()[link error_condition/value.md] -* ec.message()[link error_condition/message.md] ### 出力 ``` diff --git a/reference/system_error/op_equal.md b/reference/system_error/op_equal.md index fd18efcf18..900c51ff95 100644 --- a/reference/system_error/op_equal.md +++ b/reference/system_error/op_equal.md @@ -88,7 +88,6 @@ int main() } ``` -* std::error_code[link error_code.md] * std::make_error_code[link make_error_code.md] * std::errc::invalid_argument[link errc.md] * std::errc::permission_denied[link errc.md] diff --git a/reference/system_error/op_not_equal.md b/reference/system_error/op_not_equal.md index df61c70cdf..5fd62c453e 100644 --- a/reference/system_error/op_not_equal.md +++ b/reference/system_error/op_not_equal.md @@ -53,7 +53,6 @@ int main() } ``` -* std::error_code[link error_code.md] * std::make_error_code[link make_error_code.md] * std::errc::invalid_argument[link errc.md] * std::errc::permission_denied[link errc.md] diff --git a/reference/system_error/system_error.md b/reference/system_error/system_error.md index 83b40b7bcf..8e7e39cab6 100644 --- a/reference/system_error/system_error.md +++ b/reference/system_error/system_error.md @@ -47,7 +47,6 @@ int main() } ``` * std::system_error[color ff0000] -* std::error_code[link error_code.md] * std::errc::invalid_argument[link errc.md] * std::generic_category()[link generic_category.md] * ec.value()[link error_code/value.md] diff --git a/reference/thread/jthread.md b/reference/thread/jthread.md index bd9afa0050..e579e0fb1d 100644 --- a/reference/thread/jthread.md +++ b/reference/thread/jthread.md @@ -112,10 +112,8 @@ int main() std::cout << sum2 << std::endl; } ``` -* std::uint64_t[link /reference/cstdint/uint64_t.md] * std::stop_token[link /reference/stop_token/stop_token.md] * stoken.stop_requested()[link /reference/stop_token/stop_token/stop_requested.md] -* std::this_thread::sleep_for[link /reference/thread/this_thread/sleep_for.md] * t1.request_stop()[link jthread/request_stop.md] diff --git a/reference/thread/jthread/op_constructor.md b/reference/thread/jthread/op_constructor.md index 0ec9fa89f0..149178dcb5 100644 --- a/reference/thread/jthread/op_constructor.md +++ b/reference/thread/jthread/op_constructor.md @@ -48,7 +48,6 @@ jthread(jthread&&) noexcept; // (4) C++20 ``` * invoke[link /reference/functional/invoke.md] * decay-copy[link /reference/exposition-only/decay-copy.md] - * std::forward[link /reference/utility/forward.md] * get_stop_token()[link get_stop_token.md] - そうでなければ以下の式でスレッドを生成して実行する @@ -57,7 +56,6 @@ jthread(jthread&&) noexcept; // (4) C++20 ``` * invoke[link /reference/functional/invoke.md] * decay-copy[link /reference/exposition-only/decay-copy.md] - * std::forward[link /reference/utility/forward.md] - この呼び出しでの戻り値は無視される。この関数呼び出しが例外を送出する場合、呼び出し元スレッドで[`std::terminate`](/reference/exception/terminate.md)が呼び出される @@ -143,10 +141,8 @@ int main() std::cout << sum2 << std::endl; } ``` -* std::uint64_t[link /reference/cstdint/uint64_t.md] * std::stop_token[link /reference/stop_token/stop_token.md] * stoken.stop_requested()[link /reference/stop_token/stop_token/stop_requested.md] -* std::this_thread::sleep_for[link /reference/thread/this_thread/sleep_for.md] * t1.request_stop()[link request_stop.md] diff --git a/reference/thread/jthread/op_destructor.md b/reference/thread/jthread/op_destructor.md index 6c412f3771..b48d5f2f49 100644 --- a/reference/thread/jthread/op_destructor.md +++ b/reference/thread/jthread/op_destructor.md @@ -66,10 +66,8 @@ int main() std::cout << sum2 << std::endl; } ``` -* std::uint64_t[link /reference/cstdint/uint64_t.md] * std::stop_token[link /reference/stop_token/stop_token.md] * token.stop_requested()[link /reference/stop_token/stop_token/stop_requested.md] -* std::this_thread::sleep_for[link /reference/thread/this_thread/sleep_for.md] ### 出力例 ``` diff --git a/reference/thread/jthread/request_stop.md b/reference/thread/jthread/request_stop.md index b5116c7601..6afba0348d 100644 --- a/reference/thread/jthread/request_stop.md +++ b/reference/thread/jthread/request_stop.md @@ -53,7 +53,6 @@ int main() * request_stop()[color ff0000] * std::stop_token[link /reference/stop_token/stop_token.md] * stop_requested()[link /reference/stop_token/stop_token/stop_requested.md] -* t.join()[link join.md] ### 出力 ``` diff --git a/reference/tuple/apply.md b/reference/tuple/apply.md index fb7e104039..5989af552a 100644 --- a/reference/tuple/apply.md +++ b/reference/tuple/apply.md @@ -46,7 +46,6 @@ constexpr decltype(auto) apply-impl(F&& f, Tuple&& t, std::index_sequence) * std::get[link tuple/get.md] * std::index_sequence[link /reference/utility/index_sequence.md] * std::invoke[link /reference/functional/invoke.md] -* std::forward[link /reference/utility/forward.md] C++17 : 次と等価である。 ```cpp @@ -55,8 +54,6 @@ return apply-impl(std::forward(f), std::forward(t), ``` * std::tuple_size_v[link tuple_size.md] * std::make_index_sequence[link /reference/utility/make_index_sequence.md] -* std::forward[link /reference/utility/forward.md] -* std::decay_t[link /reference/type_traits/decay.md] C++20 : 次と等価である。 ```cpp @@ -65,7 +62,6 @@ return apply-impl(std::forward(f), std::forward(t), ``` * std::tuple_size_v[link tuple_size.md] * std::make_index_sequence[link /reference/utility/make_index_sequence.md] -* std::forward[link /reference/utility/forward.md] * std::remove_reference_t[link /reference/type_traits/remove_reference.md] diff --git a/reference/tuple/make_from_tuple.md b/reference/tuple/make_from_tuple.md index 93f7a68a6a..2f8d620bde 100644 --- a/reference/tuple/make_from_tuple.md +++ b/reference/tuple/make_from_tuple.md @@ -57,7 +57,6 @@ constexpr T make_from_tuple(Tuple&& t) { return make_from_tuple_impl(std::forward(t), std::make_index_sequence>>{}); } ``` -* std::forward[link /reference/utility/forward.md] * std::make_index_sequence[link /reference/utility/make_index_sequence.md] * std::index_sequence[link /reference/utility/index_sequence.md] diff --git a/reference/tuple/pair-like.md b/reference/tuple/pair-like.md index 3cf2baf921..144f304cec 100644 --- a/reference/tuple/pair-like.md +++ b/reference/tuple/pair-like.md @@ -32,8 +32,6 @@ namespace std { * is_reference_v[link /reference/type_traits/is_reference.md] * integral_constant[link /reference/type_traits/integral_constant.md] * remove_const_t[link /reference/type_traits/remove_const.md] -* remove_cvref_t[link /reference/type_traits/remove_cvref.md] -* convertible_to[link /reference/concepts/convertible_to.md] * tuple-like[link tuple-like.md] ## 概要 diff --git a/reference/tuple/tie.md b/reference/tuple/tie.md index 949b3494c6..aa16f6431f 100644 --- a/reference/tuple/tie.md +++ b/reference/tuple/tie.md @@ -13,7 +13,6 @@ namespace std { constexpr tuple tie(Types&...) noexcept; // C++14 } ``` -* tuple[link /reference/tuple/tuple.md] ## 概要 パラメータの参照からなる[`tuple`](../tuple.md)を生成する。 diff --git a/reference/tuple/tuple/get.md b/reference/tuple/tuple/get.md index a5a19b8b29..c00d7c7535 100644 --- a/reference/tuple/tuple/get.md +++ b/reference/tuple/tuple/get.md @@ -49,7 +49,6 @@ namespace std { ``` * tuple_element[link ../tuple_element.md] * tuple_element_t[link ../tuple_element.md] -* tuple[link ../tuple.md] * size_t[link /reference/cstddef/size_t.md] ## 概要 diff --git a/reference/tuple/tuple/op_assign.md b/reference/tuple/tuple/op_assign.md index b073fde732..4ee7c8ac2a 100644 --- a/reference/tuple/tuple/op_assign.md +++ b/reference/tuple/tuple/op_assign.md @@ -57,7 +57,6 @@ template constexpr const tuple& operator=(UTuple&&) const; // (14) C++23 ``` * see below[italic] -* pair[link /reference/utility/pair.md] * tuple-like[link ../tuple-like.md] ## 概要 diff --git a/reference/tuple/tuple/op_compare_3way.md b/reference/tuple/tuple/op_compare_3way.md index 8463292fbd..f9c308ce63 100644 --- a/reference/tuple/tuple/op_compare_3way.md +++ b/reference/tuple/tuple/op_compare_3way.md @@ -20,9 +20,7 @@ namespace std { // を表す。 } ``` -* tuple[link ../tuple.md] * common_comparison_category_t[link /reference/compare/common_comparison_category.md] -* synth-three-way-result[link /reference/exposition-only/synth-three-way-result.md] * tuple-like[link ../tuple-like.md] * tuple_element_t[link ../tuple_element.md] * tuple_size_v[link ../tuple_size.md] @@ -43,7 +41,6 @@ return t tail <=> u tail; ``` * tail[italic] * get[link get.md] -* synth-three-way[link /reference/exposition-only/synth-three-way-result.md] ここで`r`tailは、`r`の最初の要素以外のすべてを含む`tuple`である。 diff --git a/reference/tuple/tuple/op_constructor.md b/reference/tuple/tuple/op_constructor.md index 45fea3163b..e472358584 100644 --- a/reference/tuple/tuple/op_constructor.md +++ b/reference/tuple/tuple/op_constructor.md @@ -219,7 +219,6 @@ explicit(see below) constexpr ``` * see below[italic] * EXPLICIT[italic] -* pair[link /reference/utility/pair.md] * allocator_arg_t[link /reference/memory/allocator_arg_t.md] * tuple-like[link ../tuple-like.md] * see below[italic] diff --git a/reference/tuple/tuple/op_deduction_guide.md b/reference/tuple/tuple/op_deduction_guide.md index e71650e12c..e59b34c3ff 100644 --- a/reference/tuple/tuple/op_deduction_guide.md +++ b/reference/tuple/tuple/op_deduction_guide.md @@ -25,7 +25,6 @@ namespace std { -> tuple; // (5) } ``` -* pair[link /reference/utility/pair.md] * allocator_arg_t[link /reference/memory/allocator_arg_t.md] ## 概要 diff --git a/reference/tuple/tuple/op_equal.md b/reference/tuple/tuple/op_equal.md index fe541eb2ce..b996419320 100644 --- a/reference/tuple/tuple/op_equal.md +++ b/reference/tuple/tuple/op_equal.md @@ -19,7 +19,6 @@ namespace std { const UTuple& u); // (2) C++23 } ``` -* tuple[link ../tuple.md] * tuple-like[link ../tuple-like.md] ## 概要 diff --git a/reference/tuple/tuple/op_not_equal.md b/reference/tuple/tuple/op_not_equal.md index 10006f1fe1..3ee4b2fde7 100644 --- a/reference/tuple/tuple/op_not_equal.md +++ b/reference/tuple/tuple/op_not_equal.md @@ -16,7 +16,6 @@ namespace std { const tuple& u); // (1) C++14 } ``` -* tuple[link ../tuple.md] ## 概要 2つの`tuple`オブジェクトの非等値比較を行う。 diff --git a/reference/tuple/tuple/swap.md b/reference/tuple/tuple/swap.md index b11be51ba6..8692742cfd 100644 --- a/reference/tuple/tuple/swap.md +++ b/reference/tuple/tuple/swap.md @@ -12,7 +12,6 @@ constexpr void swap(tuple& rhs) noexcept(see below); // (1) C++20 constexpr void swap(const tuple& rhs) const noexcept(see below); // (2) C++23 ``` -* tuple[link ../tuple.md] * see below[italic] ## 概要 diff --git a/reference/tuple/tuple_cat.md b/reference/tuple/tuple_cat.md index f4fa33b6d9..f3d8afe2d4 100644 --- a/reference/tuple/tuple_cat.md +++ b/reference/tuple/tuple_cat.md @@ -16,7 +16,6 @@ namespace std { constexpr tuple tuple_cat(Tuples&&... tpls); // C++23 } ``` -* tuple[link tuple.md] * tuple-like[link tuple-like.md] ## 概要 diff --git a/reference/tuple/tuple_element.md b/reference/tuple/tuple_element.md index f9324b83cf..d8f649f864 100644 --- a/reference/tuple/tuple_element.md +++ b/reference/tuple/tuple_element.md @@ -31,7 +31,6 @@ namespace std { typename tuple_element::type; // (6) C++14 } ``` -* tuple[link tuple.md] ## 概要 `tuple_element`は、タプルとして見なせる型から、I番目の要素型を取得するためのクラスである。 diff --git a/reference/tuple/tuple_size.md b/reference/tuple/tuple_size.md index bc2159448b..f0a15c300b 100644 --- a/reference/tuple/tuple_size.md +++ b/reference/tuple/tuple_size.md @@ -29,7 +29,6 @@ namespace std { tuple_size::value; // (6) C++17 } ``` -* tuple[link tuple.md] * integral_constant[link /reference/type_traits/integral_constant.md] ## 概要 diff --git a/reference/type_traits/common_type.md b/reference/type_traits/common_type.md index 64cc114d00..b95c584e13 100644 --- a/reference/type_traits/common_type.md +++ b/reference/type_traits/common_type.md @@ -130,7 +130,6 @@ struct common_type { using type = typename common_type::type, V...>::type; }; ``` -* declval[link /reference/utility/declval.md] ## 定義(C++14) @@ -156,8 +155,6 @@ struct common_type { using type = common_type_t, V...>; }; ``` -* decay_t[link decay.md] -* declval[link /reference/utility/declval.md] ## バージョン ### 言語 diff --git a/reference/type_traits/invoke_result.md b/reference/type_traits/invoke_result.md index 9bd31fffca..f8ee93eff9 100644 --- a/reference/type_traits/invoke_result.md +++ b/reference/type_traits/invoke_result.md @@ -98,7 +98,6 @@ int main() } ``` * std::invoke_result[color ff0000] -* std::is_same[link is_same.md] ### 出力 ``` diff --git a/reference/type_traits/is_implicit_lifetime.md b/reference/type_traits/is_implicit_lifetime.md index 6dcbcfd97d..9f10ce6f58 100644 --- a/reference/type_traits/is_implicit_lifetime.md +++ b/reference/type_traits/is_implicit_lifetime.md @@ -64,7 +64,6 @@ int main() { } ``` * std::is_implicit_lifetime[color ff0000] -* std::pair[link /reference/utility/pair.md] ### 出力 ``` diff --git a/reference/type_traits/negation.md b/reference/type_traits/negation.md index 99355eaeaa..1dd3a7319c 100644 --- a/reference/type_traits/negation.md +++ b/reference/type_traits/negation.md @@ -51,7 +51,6 @@ int main() } ``` * std::negation[color ff0000] -* std::true_type[link true_type.md] * std::is_move_constructible[link is_move_constructible.md] * std::is_copy_constructible[link is_copy_constructible.md] * std::conjunction[link conjunction.md] diff --git a/reference/type_traits/remove_cvref.md b/reference/type_traits/remove_cvref.md index f2e95b9e1f..73c4480d14 100644 --- a/reference/type_traits/remove_cvref.md +++ b/reference/type_traits/remove_cvref.md @@ -15,8 +15,6 @@ namespace std { using remove_cvref_t = typename remove_cvref::type; } ``` -* remove_cv_t[link remove_cv.md] -* remove_reference_t[link remove_reference.md] ## 概要 型の`const-volatile`修飾と参照を除去する。 diff --git a/reference/type_traits/result_of.md b/reference/type_traits/result_of.md index ad960eecab..8445e4d61d 100644 --- a/reference/type_traits/result_of.md +++ b/reference/type_traits/result_of.md @@ -41,7 +41,6 @@ namespace std { ```cpp decltype(INVOKE(declval(), declval()...)) ``` -* declval[link /reference/utility/declval.md] * INVOKE[link /reference/concepts/Invoke.md] C++14以降では、上記メンバ型`type`の型定義が有効な式でない場合、メンバ型`type`は定義されない。 diff --git a/reference/type_traits/unwrap_ref_decay.md b/reference/type_traits/unwrap_ref_decay.md index 337f9c9188..090f417642 100644 --- a/reference/type_traits/unwrap_ref_decay.md +++ b/reference/type_traits/unwrap_ref_decay.md @@ -14,7 +14,6 @@ namespace std { } ``` * unwrap_reference[link unwrap_reference.md] -* decay_t[link /reference/type_traits/decay.md] ## 概要 [`reference_wrapper`](/reference/functional/reference_wrapper.md)``型を`T&`型に展開し、型推論規則による型変換を行う。 diff --git a/reference/unordered_map/unordered_map/emplace.md b/reference/unordered_map/unordered_map/emplace.md index bf2efefc94..27a530c7b4 100644 --- a/reference/unordered_map/unordered_map/emplace.md +++ b/reference/unordered_map/unordered_map/emplace.md @@ -9,7 +9,6 @@ template pair emplace(Args&&... args); ``` -* pair[link /reference/utility/pair.md] ## 概要 コンテナ内へ要素を直接構築する @@ -109,7 +108,6 @@ int main() * emplace[color ff0000] * std::complex[link /reference/complex/complex.md] * std::piecewise_construct[link /reference/utility/piecewise_construct_t.md] -* std::forward_as_tuple[link /reference/tuple/forward_as_tuple.md] * um.cbegin()[link cbegin.md] * um.cend()[link cend.md] diff --git a/reference/unordered_map/unordered_map/emplace_hint.md b/reference/unordered_map/unordered_map/emplace_hint.md index cb630248aa..3384880b4d 100644 --- a/reference/unordered_map/unordered_map/emplace_hint.md +++ b/reference/unordered_map/unordered_map/emplace_hint.md @@ -106,11 +106,9 @@ int main() ``` * emplace_hint[color ff0000] * std::complex[link /reference/complex/complex.md] -* std::next[link /reference/iterator/next.md] * um.cbegin()[link cbegin.md] * um.cend()[link cend.md] * std::piecewise_construct[link /reference/utility/piecewise_construct_t.md] -* std::forward_as_tuple[link /reference/tuple/forward_as_tuple.md] ### 出力 ``` diff --git a/reference/unordered_map/unordered_map/equal_range.md b/reference/unordered_map/unordered_map/equal_range.md index c3ba4e15b4..2d27455587 100644 --- a/reference/unordered_map/unordered_map/equal_range.md +++ b/reference/unordered_map/unordered_map/equal_range.md @@ -18,7 +18,6 @@ template pair equal_range(const K& k) const; // (4) C++20 ``` -* pair[link /reference/utility/pair.md] ## 概要 コンテナ内の、指定されたキーと等しい全てのキー要素を含む範囲の境界を返す。`unordered_map` コンテナではキーの重複は無いため、この範囲は最大一つの要素を含む。 diff --git a/reference/unordered_map/unordered_map/erase.md b/reference/unordered_map/unordered_map/erase.md index 066fdf4f74..7895f2c735 100644 --- a/reference/unordered_map/unordered_map/erase.md +++ b/reference/unordered_map/unordered_map/erase.md @@ -126,7 +126,6 @@ int main() ``` * erase[color ff0000] * std::ostream[link /reference/ostream/basic_ostream.md] -* std::next[link /reference/iterator/next.md] * cbegin()[link cbegin.md] * cend()[link cend.md] diff --git a/reference/unordered_map/unordered_map/insert.md b/reference/unordered_map/unordered_map/insert.md index c837beeee6..6149b4f857 100644 --- a/reference/unordered_map/unordered_map/insert.md +++ b/reference/unordered_map/unordered_map/insert.md @@ -26,7 +26,6 @@ void insert(initializer_list il); // (8) insert_return_type insert(node_type&& nh); // (9) C++17 iterator insert(const_iterator hint, node_type&& nh); // (10) C++17 ``` -* pair[link /reference/utility/pair.md] * initializer_list[link /reference/initializer_list/initializer_list.md] ## 概要 diff --git a/reference/unordered_map/unordered_map/insert_or_assign.md b/reference/unordered_map/unordered_map/insert_or_assign.md index 64a133fb19..18812d51df 100644 --- a/reference/unordered_map/unordered_map/insert_or_assign.md +++ b/reference/unordered_map/unordered_map/insert_or_assign.md @@ -39,7 +39,6 @@ iterator K&& k, M&& obj); // (6) C++26 ``` -* pair[link /reference/utility/pair.md] ## 概要 引数 `k` で指定されたキーが存在しなければ対応する値を引数 `obj` のキーとして要素を挿入し(`insert`)、さもなければ(`or`)、そのキーに対応する値に引数 `obj` を代入する(`assign`)。 diff --git a/reference/unordered_map/unordered_map/op_deduction_guide.md b/reference/unordered_map/unordered_map/op_deduction_guide.md index f31caaceeb..30210f0aa4 100644 --- a/reference/unordered_map/unordered_map/op_deduction_guide.md +++ b/reference/unordered_map/unordered_map/op_deduction_guide.md @@ -106,8 +106,6 @@ namespace std { * see below[italic] * remove_const_t[link /reference/type_traits/remove_const.md] * add_const_t[link /reference/type_traits/add_const.md] -* pair[link /reference/utility/pair.md] -* iterator_traits[link /reference/iterator/iterator_traits.md] * hash[link /reference/functional/hash.md] * equal_to[link /reference/functional/equal_to.md] * allocator[link /reference/memory/allocator.md] diff --git a/reference/unordered_map/unordered_map/try_emplace.md b/reference/unordered_map/unordered_map/try_emplace.md index 8ad001b14e..745b32dd22 100644 --- a/reference/unordered_map/unordered_map/try_emplace.md +++ b/reference/unordered_map/unordered_map/try_emplace.md @@ -39,7 +39,6 @@ iterator K&& k, Args&&... args); // (6) C++26 ``` -* pair[link /reference/utility/pair.md] ## 概要 引数 `k` と等価のキーを持つ要素が存在しない場合、コンテナに新しい要素を挿入する。要素は引数からコンテナ内に直接構築されるため、構築されたオブジェクトはコピーもムーブもされない。 diff --git a/reference/unordered_map/unordered_multimap/emplace_hint.md b/reference/unordered_map/unordered_multimap/emplace_hint.md index 6dd712fe9b..70a1059f59 100644 --- a/reference/unordered_map/unordered_multimap/emplace_hint.md +++ b/reference/unordered_map/unordered_multimap/emplace_hint.md @@ -124,7 +124,6 @@ int main() * um.cbegin[link cbegin.md] * um.cend[link cend.md] * um.equal_range[link equal_range.md] -* std::next[link /reference/iterator/next.md] ### 出力 - libstdc++ の出力例(4.7.3 現在) diff --git a/reference/unordered_map/unordered_multimap/equal_range.md b/reference/unordered_map/unordered_multimap/equal_range.md index a9bdc81801..6799c93684 100644 --- a/reference/unordered_map/unordered_multimap/equal_range.md +++ b/reference/unordered_map/unordered_multimap/equal_range.md @@ -18,7 +18,6 @@ template pair equal_range(const K& k) const; // (4) C++20 ``` -* pair[link /reference/utility/pair.md] ## 概要 コンテナ内の、指定されたキーと等しい全てのキー要素を含む範囲の境界を返す。 diff --git a/reference/unordered_map/unordered_multimap/erase.md b/reference/unordered_map/unordered_multimap/erase.md index fe33203ee6..617499fe15 100644 --- a/reference/unordered_map/unordered_multimap/erase.md +++ b/reference/unordered_map/unordered_multimap/erase.md @@ -127,7 +127,6 @@ int main() ``` * erase[color ff0000] * std::ostream[link /reference/ostream/basic_ostream.md] -* std::next[link /reference/iterator/next.md] * cbegin()[link cbegin.md] * cend()[link cend.md] diff --git a/reference/unordered_map/unordered_multimap/op_deduction_guide.md b/reference/unordered_map/unordered_multimap/op_deduction_guide.md index 78ec0c7e68..24e41595d0 100644 --- a/reference/unordered_map/unordered_multimap/op_deduction_guide.md +++ b/reference/unordered_map/unordered_multimap/op_deduction_guide.md @@ -106,8 +106,6 @@ namespace std { * see below[italic] * remove_const_t[link /reference/type_traits/remove_const.md] * add_const_t[link /reference/type_traits/add_const.md] -* pair[link /reference/utility/pair.md] -* iterator_traits[link /reference/iterator/iterator_traits.md] * hash[link /reference/functional/hash.md] * equal_to[link /reference/functional/equal_to.md] * allocator[link /reference/memory/allocator.md] diff --git a/reference/unordered_set/unordered_multiset/emplace_hint.md b/reference/unordered_set/unordered_multiset/emplace_hint.md index 3c706b81bf..59130ed8ca 100644 --- a/reference/unordered_set/unordered_multiset/emplace_hint.md +++ b/reference/unordered_set/unordered_multiset/emplace_hint.md @@ -138,7 +138,6 @@ int main() * ums.cbegin()[link cbegin.md] * ums.cend()[link cend.md] * ums.equal_range[link equal_range.md] -* std::next[link /reference/iterator/next.md] ### 出力 - libstdc++ の出力例(4.7.3 現在) diff --git a/reference/unordered_set/unordered_multiset/equal_range.md b/reference/unordered_set/unordered_multiset/equal_range.md index 8c54ff70ec..13003304c4 100644 --- a/reference/unordered_set/unordered_multiset/equal_range.md +++ b/reference/unordered_set/unordered_multiset/equal_range.md @@ -18,7 +18,6 @@ template pair equal_range(const K& k) const; // (4) C++20 ``` -* pair[link /reference/utility/pair.md] ## 概要 コンテナ内の、指定されたキーと等しい全てのキー要素を含む範囲の境界を返す。 diff --git a/reference/unordered_set/unordered_multiset/erase.md b/reference/unordered_set/unordered_multiset/erase.md index 3b593a23a0..bebafc5ed3 100644 --- a/reference/unordered_set/unordered_multiset/erase.md +++ b/reference/unordered_set/unordered_multiset/erase.md @@ -118,7 +118,6 @@ int main() ``` * erase[color ff0000] * std::ostream[link /reference/ostream/basic_ostream.md] -* std::next[link /reference/iterator/next.md] * ums.cbegin()[link cbegin.md] #### 出力例 diff --git a/reference/unordered_set/unordered_multiset/insert.md b/reference/unordered_set/unordered_multiset/insert.md index 40b564a3f5..37e09aecb6 100644 --- a/reference/unordered_set/unordered_multiset/insert.md +++ b/reference/unordered_set/unordered_multiset/insert.md @@ -218,8 +218,6 @@ inline void unordered_multiset::insert(std::initiali ``` * insert[color ff0000] * std::move[link /reference/utility/move.md] -* il.begin()[link /reference/initializer_list/initializer_list/begin.md] -* il.end()[link /reference/initializer_list/initializer_list/end.md] ## 関連項目 diff --git a/reference/unordered_set/unordered_multiset/op_deduction_guide.md b/reference/unordered_set/unordered_multiset/op_deduction_guide.md index 3e31c623aa..54e4fab210 100644 --- a/reference/unordered_set/unordered_multiset/op_deduction_guide.md +++ b/reference/unordered_set/unordered_multiset/op_deduction_guide.md @@ -74,7 +74,6 @@ namespace std { * see below[italic] * hash[link /reference/functional/hash.md] * equal_to[link /reference/functional/equal_to.md] -* iterator_traits[link /reference/iterator/iterator_traits.md] * allocator[link /reference/memory/allocator.md] * initializer_list[link /reference/initializer_list/initializer_list.md] * ranges::input_range[link /reference/ranges/input_range.md] diff --git a/reference/unordered_set/unordered_set/equal_range.md b/reference/unordered_set/unordered_set/equal_range.md index a49cae0082..db10feaf50 100644 --- a/reference/unordered_set/unordered_set/equal_range.md +++ b/reference/unordered_set/unordered_set/equal_range.md @@ -18,7 +18,6 @@ template pair equal_range(const K& k) const; // (4) C++20 ``` -* pair[link /reference/utility/pair.md] ## 概要 コンテナ内の、指定されたキーと等しい全てのキー要素を含む範囲の境界を返す。`unordered_set` コンテナではキーの重複は無いため、この範囲は最大一つの要素を含む。 diff --git a/reference/unordered_set/unordered_set/erase.md b/reference/unordered_set/unordered_set/erase.md index 29788a14d1..3ae19d3c54 100644 --- a/reference/unordered_set/unordered_set/erase.md +++ b/reference/unordered_set/unordered_set/erase.md @@ -117,7 +117,6 @@ int main() ``` * erase[color ff0000] * std::ostream[link /reference/ostream/basic_ostream.md] -* std::next[link /reference/iterator/next.md] * us.cbegin()[link cbegin.md] ### 出力例 diff --git a/reference/unordered_set/unordered_set/insert.md b/reference/unordered_set/unordered_set/insert.md index 072f428bb4..12c17d1d95 100644 --- a/reference/unordered_set/unordered_set/insert.md +++ b/reference/unordered_set/unordered_set/insert.md @@ -41,7 +41,6 @@ iterator insert(const_iterator hint, node_type&& nh); // (10) C++17 ``` -* pair[link /reference/utility/pair.md] * initializer_list[link /reference/initializer_list/initializer_list.md] ## 概要 @@ -264,8 +263,6 @@ inline void unordered_set::insert(initializer_list(new_val); return old_val; ``` * std::move[link move.md] -* std::forward[link forward.md] ## 戻り値 diff --git a/reference/utility/forward_like.md b/reference/utility/forward_like.md index dc1d9f25d2..3ecbe937b8 100644 --- a/reference/utility/forward_like.md +++ b/reference/utility/forward_like.md @@ -53,7 +53,6 @@ int main() } ``` * std::forward_like[color ff0000] -* std::is_same_v[link /reference/type_traits/is_same.md] #### 出力 ``` @@ -93,8 +92,6 @@ int main() ``` * std::forward_like[color ff0000] * std::invoke[link /reference/functional/invoke.md] -* std::forward[link /reference/utility/forward.md] -* std::decay_t[link /reference/type_traits/decay.md] #### 出力 ``` @@ -123,7 +120,6 @@ template * conditional_t[link /reference/type_traits/conditional.md] * is_const_v[link /reference/type_traits/is_const.md] * is_rvalue_reference_v[link /reference/type_traits/is_rvalue_reference.md] -* remove_reference_t[link /reference/type_traits/remove_reference.md] ## バージョン ### 言語 diff --git a/reference/utility/in_range.md b/reference/utility/in_range.md index 188b816357..9f21e65ff0 100644 --- a/reference/utility/in_range.md +++ b/reference/utility/in_range.md @@ -60,8 +60,6 @@ int main() { } ``` * std::in_range[color ff0000] -* std::uint8_t[link /reference/cstdint/uint8_t.md] -* std::int8_t[link /reference/cstdint/int8_t.md] ### 出力 ``` diff --git a/reference/utility/make_pair.md b/reference/utility/make_pair.md index 42d7a57ae9..dc2495d239 100644 --- a/reference/utility/make_pair.md +++ b/reference/utility/make_pair.md @@ -15,7 +15,6 @@ namespace std { constexpr pair make_pair(T1&& x, T2&& y); // C++14 } ``` -* pair[link /reference/utility/pair.md] ## 概要 pairクラスのオブジェクトを構築する。 @@ -36,7 +35,6 @@ pairクラスのオブジェクトを構築する。 ```cpp std::pair(std::forward(x), std::forward(y)); ``` -* std::forward[link forward.md] ## 例 diff --git a/reference/utility/pair/basic_common_reference.md b/reference/utility/pair/basic_common_reference.md index 47a9a594ac..068a924d88 100644 --- a/reference/utility/pair/basic_common_reference.md +++ b/reference/utility/pair/basic_common_reference.md @@ -15,8 +15,6 @@ namespace std { } ``` * basic_common_reference[link /reference/type_traits/basic_common_reference.md] -* pair[link ../pair.md] -* common_reference_t[link /reference/type_traits/common_reference.md] ## 概要 [`pair`](../pair.md)について、[`common_reference`](/reference/type_traits/common_reference.md)で共通の参照型を取得できるようにアダプトする[`basic_common_reference`](/reference/type_traits/common_reference.md)の特殊化である。 diff --git a/reference/utility/pair/common_type.md b/reference/utility/pair/common_type.md index 7257a45516..faca565c77 100644 --- a/reference/utility/pair/common_type.md +++ b/reference/utility/pair/common_type.md @@ -14,8 +14,6 @@ namespace std { } ``` * common_type[link /reference/type_traits/common_type.md] -* pair[link ../pair.md] -* common_type_t[link /reference/type_traits/common_type.md] ## 概要 [`pair`](../pair.md)について、どちらからも変換可能な共通の型を取得できるようにする[`common_type`](/reference/type_traits/common_type.md)の特殊化である。 diff --git a/reference/utility/pair/get.md b/reference/utility/pair/get.md index 4565cc5e6a..680c29664f 100644 --- a/reference/utility/pair/get.md +++ b/reference/utility/pair/get.md @@ -69,7 +69,6 @@ namespace std { ``` * tuple_element[link tuple_element.md] * tuple_element_t[link tuple_element.md] -* pair[link /reference/utility/pair.md] ## 概要 タプルと見なせる型から指定した位置の要素を取得する。 diff --git a/reference/utility/pair/op_constructor.md b/reference/utility/pair/op_constructor.md index 1d5f1127e0..88137dc1b6 100644 --- a/reference/utility/pair/op_constructor.md +++ b/reference/utility/pair/op_constructor.md @@ -66,8 +66,6 @@ constexpr pair(piecewise_construct_t, tuple second_args); // (11) C++20 ``` * EXPLICIT[italic] -* piecewise_construct_t[link /reference/utility/piecewise_construct_t.md] -* tuple[link /reference/tuple/tuple.md] * pair-like[link /reference/tuple/tuple-like.md] * see below[italic] diff --git a/reference/utility/pair/tuple_element.md b/reference/utility/pair/tuple_element.md index ce9d689681..38da4854ae 100644 --- a/reference/utility/pair/tuple_element.md +++ b/reference/utility/pair/tuple_element.md @@ -19,7 +19,6 @@ namespace std { }; } ``` -* pair[link ../pair.md] ## 概要 diff --git a/reference/valarray/gslice.md b/reference/valarray/gslice.md index f31f092d88..1b82ec9d02 100644 --- a/reference/valarray/gslice.md +++ b/reference/valarray/gslice.md @@ -68,9 +68,6 @@ auto main() } ``` * std::gslice[color ff0000] -* std::valarray[link valarray.md] -* std::begin[link valarray/begin_free.md] -* std::end[link valarray/end_free.md] ### 出力 ``` diff --git a/reference/valarray/gslice_array.md b/reference/valarray/gslice_array.md index e7f68d3bfb..65955519cf 100644 --- a/reference/valarray/gslice_array.md +++ b/reference/valarray/gslice_array.md @@ -102,7 +102,6 @@ int main() } ``` * std::gslice[color ff0000] -* std::valarray[link valarray.md] * std::setw[link /reference/iomanip/setw.md] ### 出力 diff --git a/reference/valarray/gslice_array/op_and_assign.md b/reference/valarray/gslice_array/op_and_assign.md index 623d910632..69c33ecdca 100644 --- a/reference/valarray/gslice_array/op_and_assign.md +++ b/reference/valarray/gslice_array/op_and_assign.md @@ -66,8 +66,6 @@ int main() } ``` * std::gslice[link /reference/valarray/gslice.md] -* std::begin[link /reference/valarray/valarray/begin_free.md] -* std::end[link /reference/valarray/valarray/end_free.md] * std::multiplies[link /reference/functional/multiplies.md] * to_string()[link /reference/bitset/bitset/to_string.md] diff --git a/reference/valarray/gslice_array/op_assign.md b/reference/valarray/gslice_array/op_assign.md index 1d7fc90bc0..a489b9d757 100644 --- a/reference/valarray/gslice_array/op_assign.md +++ b/reference/valarray/gslice_array/op_assign.md @@ -100,8 +100,6 @@ int main() } ``` * std::gslice[link /reference/valarray/gslice.md] -* std::begin[link /reference/valarray/valarray/begin_free.md] -* std::end[link /reference/valarray/valarray/end_free.md] * std::multiplies[link /reference/functional/multiplies.md] ### 出力 diff --git a/reference/valarray/gslice_array/op_divide_assign.md b/reference/valarray/gslice_array/op_divide_assign.md index dcc20574ed..944342d23e 100644 --- a/reference/valarray/gslice_array/op_divide_assign.md +++ b/reference/valarray/gslice_array/op_divide_assign.md @@ -61,8 +61,6 @@ int main() } ``` * std::gslice[link /reference/valarray/gslice.md] -* std::begin[link /reference/valarray/valarray/begin_free.md] -* std::end[link /reference/valarray/valarray/end_free.md] * std::multiplies[link /reference/functional/multiplies.md] ### 出力 diff --git a/reference/valarray/gslice_array/op_left_shift_assign.md b/reference/valarray/gslice_array/op_left_shift_assign.md index f4b043bb78..fd7c262f83 100644 --- a/reference/valarray/gslice_array/op_left_shift_assign.md +++ b/reference/valarray/gslice_array/op_left_shift_assign.md @@ -66,8 +66,6 @@ int main() } ``` * std::gslice[link /reference/valarray/gslice.md] -* std::begin[link /reference/valarray/valarray/begin_free.md] -* std::end[link /reference/valarray/valarray/end_free.md] * std::multiplies[link /reference/functional/multiplies.md] * to_string()[link /reference/bitset/bitset/to_string.md] diff --git a/reference/valarray/gslice_array/op_minus_assign.md b/reference/valarray/gslice_array/op_minus_assign.md index 509037519f..5bfdec29ce 100644 --- a/reference/valarray/gslice_array/op_minus_assign.md +++ b/reference/valarray/gslice_array/op_minus_assign.md @@ -62,8 +62,6 @@ int main() } ``` * std::gslice[link /reference/valarray/gslice.md] -* std::begin[link /reference/valarray/valarray/begin_free.md] -* std::end[link /reference/valarray/valarray/end_free.md] * std::multiplies[link /reference/functional/multiplies.md] ### 出力 diff --git a/reference/valarray/gslice_array/op_modulo_assign.md b/reference/valarray/gslice_array/op_modulo_assign.md index f7f6e77259..2c0743bcaa 100644 --- a/reference/valarray/gslice_array/op_modulo_assign.md +++ b/reference/valarray/gslice_array/op_modulo_assign.md @@ -61,8 +61,6 @@ int main() } ``` * std::gslice[link /reference/valarray/gslice.md] -* std::begin[link /reference/valarray/valarray/begin_free.md] -* std::end[link /reference/valarray/valarray/end_free.md] * std::multiplies[link /reference/functional/multiplies.md] ### 出力 diff --git a/reference/valarray/gslice_array/op_multiply_assign.md b/reference/valarray/gslice_array/op_multiply_assign.md index 8ec9bb85a8..bb4062eace 100644 --- a/reference/valarray/gslice_array/op_multiply_assign.md +++ b/reference/valarray/gslice_array/op_multiply_assign.md @@ -61,8 +61,6 @@ int main() } ``` * std::gslice[link /reference/valarray/gslice.md] -* std::begin[link /reference/valarray/valarray/begin_free.md] -* std::end[link /reference/valarray/valarray/end_free.md] * std::multiplies[link /reference/functional/multiplies.md] ### 出力 diff --git a/reference/valarray/gslice_array/op_or_assign.md b/reference/valarray/gslice_array/op_or_assign.md index ef16ae4ae2..0dee1d5c79 100644 --- a/reference/valarray/gslice_array/op_or_assign.md +++ b/reference/valarray/gslice_array/op_or_assign.md @@ -66,8 +66,6 @@ int main() } ``` * std::gslice[link /reference/valarray/gslice.md] -* std::begin[link /reference/valarray/valarray/begin_free.md] -* std::end[link /reference/valarray/valarray/end_free.md] * std::multiplies[link /reference/functional/multiplies.md] * to_string()[link /reference/bitset/bitset/to_string.md] diff --git a/reference/valarray/gslice_array/op_plus_assign.md b/reference/valarray/gslice_array/op_plus_assign.md index 97a6d3b048..ab62bbba14 100644 --- a/reference/valarray/gslice_array/op_plus_assign.md +++ b/reference/valarray/gslice_array/op_plus_assign.md @@ -61,8 +61,6 @@ int main() } ``` * std::gslice[link /reference/valarray/gslice.md] -* std::begin[link /reference/valarray/valarray/begin_free.md] -* std::end[link /reference/valarray/valarray/end_free.md] * std::multiplies[link /reference/functional/multiplies.md] ### 出力 diff --git a/reference/valarray/gslice_array/op_right_shift_assign.md b/reference/valarray/gslice_array/op_right_shift_assign.md index 1e9ad2f6be..f9c9af87a4 100644 --- a/reference/valarray/gslice_array/op_right_shift_assign.md +++ b/reference/valarray/gslice_array/op_right_shift_assign.md @@ -66,8 +66,6 @@ int main() } ``` * std::gslice[link /reference/valarray/gslice.md] -* std::begin[link /reference/valarray/valarray/begin_free.md] -* std::end[link /reference/valarray/valarray/end_free.md] * std::multiplies[link /reference/functional/multiplies.md] * to_string()[link /reference/bitset/bitset/to_string.md] diff --git a/reference/valarray/gslice_array/op_xor_assign.md b/reference/valarray/gslice_array/op_xor_assign.md index c0435b5740..5f15ae0d52 100644 --- a/reference/valarray/gslice_array/op_xor_assign.md +++ b/reference/valarray/gslice_array/op_xor_assign.md @@ -66,8 +66,6 @@ int main() } ``` * std::gslice[link /reference/valarray/gslice.md] -* std::begin[link /reference/valarray/valarray/begin_free.md] -* std::end[link /reference/valarray/valarray/end_free.md] * std::multiplies[link /reference/functional/multiplies.md] * to_string()[link /reference/bitset/bitset/to_string.md] diff --git a/reference/valarray/indirect_array.md b/reference/valarray/indirect_array.md index 2fbe035824..e04216c9bc 100644 --- a/reference/valarray/indirect_array.md +++ b/reference/valarray/indirect_array.md @@ -85,7 +85,6 @@ int main() } ``` * std::indirect_array[color ff0000] -* std::valarray[link valarray.md] * mask.size()[link valarray/size.md] ### 出力 diff --git a/reference/valarray/mask_array.md b/reference/valarray/mask_array.md index 29dceab736..43fb421833 100644 --- a/reference/valarray/mask_array.md +++ b/reference/valarray/mask_array.md @@ -86,7 +86,6 @@ int main() } ``` * std::mask_array[color ff0000] -* std::valarray[link valarray.md] ### 出力 ``` diff --git a/reference/valarray/slice.md b/reference/valarray/slice.md index 94cf8e3b87..3e603703d9 100644 --- a/reference/valarray/slice.md +++ b/reference/valarray/slice.md @@ -66,9 +66,6 @@ auto main() } ``` * std::slice[color ff0000] -* std::valarray[link valarray.md] -* std::begin[link valarray/begin_free.md] -* std::end[link valarray/end_free.md] ### 出力 ``` diff --git a/reference/valarray/slice_array.md b/reference/valarray/slice_array.md index 9b03e0dcfc..61d686f04a 100644 --- a/reference/valarray/slice_array.md +++ b/reference/valarray/slice_array.md @@ -87,7 +87,6 @@ int main() ``` * std::slice_array[color ff0000] * std::slice[link slice.md] -* std::valarray[link valarray.md] ### 出力 ``` diff --git a/reference/valarray/valarray/begin_free.md b/reference/valarray/valarray/begin_free.md index 4460703dd0..277b034789 100644 --- a/reference/valarray/valarray/begin_free.md +++ b/reference/valarray/valarray/begin_free.md @@ -40,7 +40,6 @@ namespace std { auto last = std::end(c); // std::valarrayにする必要がある ``` * std::begin[color ff0000] - * std::end[link end_free.md] これは、[`std::valarray`](../valarray.md)`` 型を返す関数(本リファレンスでは戻り値型を *`ValOrProxy`* と表記)は、式テンプレートによる最適化を考慮して、代理の型を返すことが許可されているが、`begin` と [`end`](end_free.md) はその代理の型を受け取りが可能であることを求められていないためである。 [``](../../valarray.md) の概要も参照のこと。 @@ -62,7 +61,6 @@ int main() } ``` * std::begin[color ff0000] -* std::end[link end_free.md] ### 出力 ``` diff --git a/reference/valarray/valarray/end_free.md b/reference/valarray/valarray/end_free.md index c233825323..66034dab0e 100644 --- a/reference/valarray/valarray/end_free.md +++ b/reference/valarray/valarray/end_free.md @@ -39,7 +39,6 @@ namespace std { auto first = std::begin(c); // 変数cの型をautoではなく、 auto last = std::end(c); // std::valarrayにする必要がある ``` - * std::begin[link begin_free.md] * std::end[color ff0000] これは、[`std::valarray`](../valarray.md)`` 型を返す関数(本リファレンスでは戻り値型を *`ValOrProxy`* と表記)は、式テンプレートによる最適化を考慮して、代理の型を返すことが許可されているが、[`begin`](begin_free.md) と `end` はその代理の型を受け取りが可能であることを求められていないためである。 @@ -62,7 +61,6 @@ int main() } ``` * std::end[color ff0000] -* std::begin[link begin_free.md] ### 出力 ``` diff --git a/reference/valarray/valarray/op_and.md b/reference/valarray/valarray/op_and.md index 00f8dcb346..dc111081e6 100644 --- a/reference/valarray/valarray/op_and.md +++ b/reference/valarray/valarray/op_and.md @@ -116,8 +116,6 @@ int main() } ``` * std::all_of[link /reference/algorithm/all_of.md] -* std::begin[link begin_free.md] -* std::end[link end_free.md] ### 出力 ``` diff --git a/reference/valarray/valarray/op_and_assign.md b/reference/valarray/valarray/op_and_assign.md index 825f772404..82c851e0f0 100644 --- a/reference/valarray/valarray/op_and_assign.md +++ b/reference/valarray/valarray/op_and_assign.md @@ -87,8 +87,6 @@ int main() } ``` * std::all_of[link /reference/algorithm/all_of.md] -* std::begin[link begin_free.md] -* std::end[link end_free.md] ### 出力 ``` diff --git a/reference/valarray/valarray/op_at.md b/reference/valarray/valarray/op_at.md index 187ce2bd39..6519f37062 100644 --- a/reference/valarray/valarray/op_at.md +++ b/reference/valarray/valarray/op_at.md @@ -260,8 +260,6 @@ int main() * std::slice_array[link /reference/valarray/slice_array.md] * std::gslice[link /reference/valarray/gslice.md] * std::gslice_array[link /reference/valarray/gslice_array.md] -* std::begin[link begin_free.md] -* std::end[link end_free.md] * std::mask_array[link /reference/valarray/mask_array.md] * std::indirect_array[link /reference/valarray/indirect_array.md] diff --git a/reference/valarray/valarray/op_equal.md b/reference/valarray/valarray/op_equal.md index 724d004a39..75b36e66d1 100644 --- a/reference/valarray/valarray/op_equal.md +++ b/reference/valarray/valarray/op_equal.md @@ -107,8 +107,6 @@ int main() } ``` * std::all_of[link /reference/algorithm/all_of.md] -* std::begin[link begin_free.md] -* std::end[link end_free.md] ### 出力 ``` diff --git a/reference/valarray/valarray/op_flip.md b/reference/valarray/valarray/op_flip.md index 0fbb0305ae..0ebe477e76 100644 --- a/reference/valarray/valarray/op_flip.md +++ b/reference/valarray/valarray/op_flip.md @@ -62,8 +62,6 @@ int main() } ``` * std::all_of[link /reference/algorithm/all_of.md] -* std::begin[link begin_free.md] -* std::end[link end_free.md] ### 出力 ``` diff --git a/reference/valarray/valarray/op_greater.md b/reference/valarray/valarray/op_greater.md index e2dd164d29..fc31f8ca76 100644 --- a/reference/valarray/valarray/op_greater.md +++ b/reference/valarray/valarray/op_greater.md @@ -108,8 +108,6 @@ int main() } ``` * std::all_of[link /reference/algorithm/all_of.md] -* std::begin[link begin_free.md] -* std::end[link end_free.md] ### 出力 ``` diff --git a/reference/valarray/valarray/op_greater_equal.md b/reference/valarray/valarray/op_greater_equal.md index c86094af40..6b69783321 100644 --- a/reference/valarray/valarray/op_greater_equal.md +++ b/reference/valarray/valarray/op_greater_equal.md @@ -108,8 +108,6 @@ int main() } ``` * std::all_of[link /reference/algorithm/all_of.md] -* std::begin[link begin_free.md] -* std::end[link end_free.md] ### 出力 ``` diff --git a/reference/valarray/valarray/op_left_shift.md b/reference/valarray/valarray/op_left_shift.md index f9207212ed..e2c3135a2a 100644 --- a/reference/valarray/valarray/op_left_shift.md +++ b/reference/valarray/valarray/op_left_shift.md @@ -114,8 +114,6 @@ int main() } ``` * std::all_of[link /reference/algorithm/all_of.md] -* std::begin[link begin_free.md] -* std::end[link end_free.md] ### 出力 ``` diff --git a/reference/valarray/valarray/op_left_shift_assign.md b/reference/valarray/valarray/op_left_shift_assign.md index 6108417b97..63e6ef71b3 100644 --- a/reference/valarray/valarray/op_left_shift_assign.md +++ b/reference/valarray/valarray/op_left_shift_assign.md @@ -89,8 +89,6 @@ int main() } ``` * std::all_of[link /reference/algorithm/all_of.md] -* std::begin[link begin_free.md] -* std::end[link end_free.md] ### 出力 ``` diff --git a/reference/valarray/valarray/op_less.md b/reference/valarray/valarray/op_less.md index 351793f2c6..88174690e2 100644 --- a/reference/valarray/valarray/op_less.md +++ b/reference/valarray/valarray/op_less.md @@ -108,8 +108,6 @@ int main() } ``` * std::all_of[link /reference/algorithm/all_of.md] -* std::begin[link begin_free.md] -* std::end[link end_free.md] ### 出力 ``` diff --git a/reference/valarray/valarray/op_less_equal.md b/reference/valarray/valarray/op_less_equal.md index 82c82c0263..31bd248370 100644 --- a/reference/valarray/valarray/op_less_equal.md +++ b/reference/valarray/valarray/op_less_equal.md @@ -108,8 +108,6 @@ int main() } ``` * std::all_of[link /reference/algorithm/all_of.md] -* std::begin[link begin_free.md] -* std::end[link end_free.md] ### 出力 ``` diff --git a/reference/valarray/valarray/op_not_equal.md b/reference/valarray/valarray/op_not_equal.md index 8d015d4121..fe4b67f3e5 100644 --- a/reference/valarray/valarray/op_not_equal.md +++ b/reference/valarray/valarray/op_not_equal.md @@ -107,8 +107,6 @@ int main() } ``` * std::all_of[link /reference/algorithm/all_of.md] -* std::begin[link begin_free.md] -* std::end[link end_free.md] ### 出力 ``` diff --git a/reference/valarray/valarray/op_or.md b/reference/valarray/valarray/op_or.md index 4c96a6c008..5668aae378 100644 --- a/reference/valarray/valarray/op_or.md +++ b/reference/valarray/valarray/op_or.md @@ -116,8 +116,6 @@ int main() } ``` * std::all_of[link /reference/algorithm/all_of.md] -* std::begin[link begin_free.md] -* std::end[link end_free.md] ### 出力 ``` diff --git a/reference/valarray/valarray/op_or_assign.md b/reference/valarray/valarray/op_or_assign.md index 7cebefbc0d..06697baa32 100644 --- a/reference/valarray/valarray/op_or_assign.md +++ b/reference/valarray/valarray/op_or_assign.md @@ -90,8 +90,6 @@ int main() } ``` * std::all_of[link /reference/algorithm/all_of.md] -* std::begin[link begin_free.md] -* std::end[link end_free.md] ### 出力 ``` diff --git a/reference/valarray/valarray/op_right_shift.md b/reference/valarray/valarray/op_right_shift.md index 16f23a3b45..bd97a567c5 100644 --- a/reference/valarray/valarray/op_right_shift.md +++ b/reference/valarray/valarray/op_right_shift.md @@ -114,8 +114,6 @@ int main() } ``` * std::all_of[link /reference/algorithm/all_of.md] -* std::begin[link begin_free.md] -* std::end[link end_free.md] ### 出力 ``` diff --git a/reference/valarray/valarray/op_right_shift_assign.md b/reference/valarray/valarray/op_right_shift_assign.md index b4972766af..ede0ee6cce 100644 --- a/reference/valarray/valarray/op_right_shift_assign.md +++ b/reference/valarray/valarray/op_right_shift_assign.md @@ -89,8 +89,6 @@ int main() } ``` * std::all_of[link /reference/algorithm/all_of.md] -* std::begin[link begin_free.md] -* std::end[link end_free.md] ### 出力 ``` diff --git a/reference/valarray/valarray/op_xor.md b/reference/valarray/valarray/op_xor.md index 70eb111d13..7afaeec59a 100644 --- a/reference/valarray/valarray/op_xor.md +++ b/reference/valarray/valarray/op_xor.md @@ -116,8 +116,6 @@ int main() } ``` * std::all_of[link /reference/algorithm/all_of.md] -* std::begin[link begin_free.md] -* std::end[link end_free.md] ### 出力 ``` diff --git a/reference/valarray/valarray/op_xor_assign.md b/reference/valarray/valarray/op_xor_assign.md index 2102a591bb..406918c3cc 100644 --- a/reference/valarray/valarray/op_xor_assign.md +++ b/reference/valarray/valarray/op_xor_assign.md @@ -89,8 +89,6 @@ int main() } ``` * std::all_of[link /reference/algorithm/all_of.md] -* std::begin[link begin_free.md] -* std::end[link end_free.md] ### 出力 ``` diff --git a/reference/variant/bad_variant_access.md b/reference/variant/bad_variant_access.md index 7108604fcf..4c047fe4a7 100644 --- a/reference/variant/bad_variant_access.md +++ b/reference/variant/bad_variant_access.md @@ -53,7 +53,6 @@ int main() } ``` * std::bad_variant_access[color ff0000] -* std::variant[link variant.md] * std::get[link variant/get.md] ### 出力例 diff --git a/reference/variant/monostate.md b/reference/variant/monostate.md index 5b34cbd903..6315597312 100644 --- a/reference/variant/monostate.md +++ b/reference/variant/monostate.md @@ -66,7 +66,6 @@ int main() } ``` * std::monostate[color ff0000] -* std::variant[link variant.md] * std::holds_alternative[link holds_alternative.md] ### 出力 diff --git a/reference/variant/variant/emplace.md b/reference/variant/variant/emplace.md index 0924c70bc5..957995a1a1 100644 --- a/reference/variant/variant/emplace.md +++ b/reference/variant/variant/emplace.md @@ -61,13 +61,11 @@ constexpr variant_alternative_t>& ```cpp return emplace(std::forward(args)...); ``` - * std::forward[link /reference/utility/forward.md] - (2) : `Types...`に含まれる型`T`のインデックスを`I`として、以下と等価: ```cpp return emplace(il, std::forward(args)...); ``` - * std::forward[link /reference/utility/forward.md] - (3) : - 値を保持している場合、破棄する diff --git a/reference/variant/variant_alternative.md b/reference/variant/variant_alternative.md index f20a57ec47..916b8a94f5 100644 --- a/reference/variant/variant_alternative.md +++ b/reference/variant/variant_alternative.md @@ -112,7 +112,6 @@ int main() ``` * std::variant_alternative[color ff0000] * std::variant_alternative_t[color ff0000] -* std::variant[link variant.md] ### 出力 ``` diff --git a/reference/variant/variant_size.md b/reference/variant/variant_size.md index d4685f01fa..dda059299f 100644 --- a/reference/variant/variant_size.md +++ b/reference/variant/variant_size.md @@ -75,7 +75,6 @@ int main() ``` * std::variant_size[color ff0000] * std::variant_size_v[color ff0000] -* std::variant[link variant.md] ### 出力 ``` diff --git a/reference/vector/vector/op_deduction_guide.md b/reference/vector/vector/op_deduction_guide.md index 1276d700c0..700e1a28b3 100644 --- a/reference/vector/vector/op_deduction_guide.md +++ b/reference/vector/vector/op_deduction_guide.md @@ -16,7 +16,6 @@ namespace std { vector(from_range_t, R&&, Allocator = Allocator()) -> vector, Allocator>; // (2) C++23から ``` -* iterator_traits[link /reference/iterator/iterator_traits.md] * ranges::input_range[link /reference/ranges/input_range.md] * allocator[link /reference/memory/allocator.md] * ranges::range_value_t[link /reference/ranges/range_value_t.md] @@ -58,9 +57,6 @@ int main() assert(v4.size() == 3); } ``` -* v1.begin()[link begin.md] -* v1.end()[link end.md] -* v3.size()[link size.md] * v4.size()[link size.md] ### 出力 From c9b57c17ab692aae365153a2fe682414a33539a2 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 9 Jul 2025 00:34:10 +0900 Subject: [PATCH 2138/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE?= =?UTF-8?q?=E9=A3=BE=E3=81=AE=E9=87=8D=E8=A4=87=E5=89=8A=E9=99=A4=E3=82=B9?= =?UTF-8?q?=E3=82=AF=E3=83=AA=E3=83=97=E3=83=88=20:=20=E7=B7=A8=E9=9B=86?= =?UTF-8?q?=E8=80=85=E5=90=91=E3=81=91=E3=83=89=E3=82=AD=E3=83=A5=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=88=E3=82=92=E5=AF=BE=E8=B1=A1=E5=A4=96=E3=81=AB?= =?UTF-8?q?=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/script/remove_duplicated_qualify.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/script/remove_duplicated_qualify.py b/.github/workflows/script/remove_duplicated_qualify.py index dcd253f3b3..b985dafe65 100644 --- a/.github/workflows/script/remove_duplicated_qualify.py +++ b/.github/workflows/script/remove_duplicated_qualify.py @@ -60,6 +60,9 @@ def main(): total_files = 0 for md_file in Path('.').rglob('*.md'): + if str(md_file).startswith("start_editing"): + continue + removed = process_file(md_file, pattern_regex) if removed > 0: processed_files += 1 From 3d6b7ce67d61e9148b1c7d37f07d153960ce827b Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 9 Jul 2025 01:20:28 +0900 Subject: [PATCH 2139/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE?= =?UTF-8?q?=E9=A3=BE=E3=81=AE=E9=87=8D=E8=A4=87=E5=89=8A=E9=99=A4=E3=82=B9?= =?UTF-8?q?=E3=82=AF=E3=83=AA=E3=83=97=E3=83=88=20:=20valarray=E3=81=AEbeg?= =?UTF-8?q?in/end=E3=82=92=E5=89=8A=E9=99=A4=E5=AF=BE=E8=B1=A1=E5=A4=96?= =?UTF-8?q?=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../script/remove_duplicated_qualify.py | 17 ++++++++++++++++- reference/valarray/gslice.md | 2 ++ reference/valarray/gslice_array.md | 2 ++ .../valarray/gslice_array/op_and_assign.md | 2 ++ reference/valarray/gslice_array/op_assign.md | 2 ++ .../valarray/gslice_array/op_divide_assign.md | 2 ++ .../gslice_array/op_left_shift_assign.md | 2 ++ .../valarray/gslice_array/op_minus_assign.md | 2 ++ .../valarray/gslice_array/op_modulo_assign.md | 2 ++ .../valarray/gslice_array/op_multiply_assign.md | 2 ++ reference/valarray/gslice_array/op_or_assign.md | 2 ++ .../valarray/gslice_array/op_plus_assign.md | 2 ++ .../gslice_array/op_right_shift_assign.md | 2 ++ .../valarray/gslice_array/op_xor_assign.md | 2 ++ reference/valarray/slice.md | 2 ++ reference/valarray/valarray/begin_free.md | 2 ++ reference/valarray/valarray/end_free.md | 2 ++ reference/valarray/valarray/op_and.md | 2 ++ reference/valarray/valarray/op_and_assign.md | 2 ++ reference/valarray/valarray/op_at.md | 2 ++ reference/valarray/valarray/op_equal.md | 2 ++ reference/valarray/valarray/op_flip.md | 2 ++ reference/valarray/valarray/op_greater.md | 2 ++ reference/valarray/valarray/op_greater_equal.md | 2 ++ reference/valarray/valarray/op_left_shift.md | 2 ++ .../valarray/valarray/op_left_shift_assign.md | 2 ++ reference/valarray/valarray/op_less.md | 2 ++ reference/valarray/valarray/op_less_equal.md | 2 ++ reference/valarray/valarray/op_not_equal.md | 2 ++ reference/valarray/valarray/op_or.md | 2 ++ reference/valarray/valarray/op_or_assign.md | 2 ++ reference/valarray/valarray/op_right_shift.md | 2 ++ .../valarray/valarray/op_right_shift_assign.md | 2 ++ reference/valarray/valarray/op_xor.md | 2 ++ reference/valarray/valarray/op_xor_assign.md | 2 ++ 35 files changed, 84 insertions(+), 1 deletion(-) diff --git a/.github/workflows/script/remove_duplicated_qualify.py b/.github/workflows/script/remove_duplicated_qualify.py index b985dafe65..4316a1c643 100644 --- a/.github/workflows/script/remove_duplicated_qualify.py +++ b/.github/workflows/script/remove_duplicated_qualify.py @@ -23,6 +23,21 @@ def load_global_qualify_patterns(): return re.compile(combined_pattern) return None +# 削除の対象外リスト +NOT_TARGET = [ + "* std::begin[link valarray/begin_free.md]", + "* std::end[link valarray/end_free.md]", + "* std::begin[link /reference/valarray/valarray/begin_free.md]", + "* std::end[link /reference/valarray/valarray/end_free.md]" +] + +def is_not_target_line(line): + stripped_line = line.strip() + for x in NOT_TARGET: + if stripped_line.startswith(x): + return True + return False + # ファイルを処理して、該当する行を削除 def process_file(file_path, pattern_regex): if pattern_regex is None: @@ -35,7 +50,7 @@ def process_file(file_path, pattern_regex): removed_count = 0 for line in lines: - if pattern_regex.search(line): + if pattern_regex.search(line) and not is_not_target_line(line): removed_count += 1 else: new_lines.append(line) diff --git a/reference/valarray/gslice.md b/reference/valarray/gslice.md index 1b82ec9d02..21f35cce69 100644 --- a/reference/valarray/gslice.md +++ b/reference/valarray/gslice.md @@ -68,6 +68,8 @@ auto main() } ``` * std::gslice[color ff0000] +* std::begin[link valarray/begin_free.md] +* std::end[link valarray/end_free.md] ### 出力 ``` diff --git a/reference/valarray/gslice_array.md b/reference/valarray/gslice_array.md index 65955519cf..9d825ee333 100644 --- a/reference/valarray/gslice_array.md +++ b/reference/valarray/gslice_array.md @@ -103,6 +103,8 @@ int main() ``` * std::gslice[color ff0000] * std::setw[link /reference/iomanip/setw.md] +* std::begin[link valarray/begin_free.md] +* std::end[link valarray/end_free.md] ### 出力 ``` diff --git a/reference/valarray/gslice_array/op_and_assign.md b/reference/valarray/gslice_array/op_and_assign.md index 69c33ecdca..623d910632 100644 --- a/reference/valarray/gslice_array/op_and_assign.md +++ b/reference/valarray/gslice_array/op_and_assign.md @@ -66,6 +66,8 @@ int main() } ``` * std::gslice[link /reference/valarray/gslice.md] +* std::begin[link /reference/valarray/valarray/begin_free.md] +* std::end[link /reference/valarray/valarray/end_free.md] * std::multiplies[link /reference/functional/multiplies.md] * to_string()[link /reference/bitset/bitset/to_string.md] diff --git a/reference/valarray/gslice_array/op_assign.md b/reference/valarray/gslice_array/op_assign.md index a489b9d757..1d7fc90bc0 100644 --- a/reference/valarray/gslice_array/op_assign.md +++ b/reference/valarray/gslice_array/op_assign.md @@ -100,6 +100,8 @@ int main() } ``` * std::gslice[link /reference/valarray/gslice.md] +* std::begin[link /reference/valarray/valarray/begin_free.md] +* std::end[link /reference/valarray/valarray/end_free.md] * std::multiplies[link /reference/functional/multiplies.md] ### 出力 diff --git a/reference/valarray/gslice_array/op_divide_assign.md b/reference/valarray/gslice_array/op_divide_assign.md index 944342d23e..dcc20574ed 100644 --- a/reference/valarray/gslice_array/op_divide_assign.md +++ b/reference/valarray/gslice_array/op_divide_assign.md @@ -61,6 +61,8 @@ int main() } ``` * std::gslice[link /reference/valarray/gslice.md] +* std::begin[link /reference/valarray/valarray/begin_free.md] +* std::end[link /reference/valarray/valarray/end_free.md] * std::multiplies[link /reference/functional/multiplies.md] ### 出力 diff --git a/reference/valarray/gslice_array/op_left_shift_assign.md b/reference/valarray/gslice_array/op_left_shift_assign.md index fd7c262f83..f4b043bb78 100644 --- a/reference/valarray/gslice_array/op_left_shift_assign.md +++ b/reference/valarray/gslice_array/op_left_shift_assign.md @@ -66,6 +66,8 @@ int main() } ``` * std::gslice[link /reference/valarray/gslice.md] +* std::begin[link /reference/valarray/valarray/begin_free.md] +* std::end[link /reference/valarray/valarray/end_free.md] * std::multiplies[link /reference/functional/multiplies.md] * to_string()[link /reference/bitset/bitset/to_string.md] diff --git a/reference/valarray/gslice_array/op_minus_assign.md b/reference/valarray/gslice_array/op_minus_assign.md index 5bfdec29ce..509037519f 100644 --- a/reference/valarray/gslice_array/op_minus_assign.md +++ b/reference/valarray/gslice_array/op_minus_assign.md @@ -62,6 +62,8 @@ int main() } ``` * std::gslice[link /reference/valarray/gslice.md] +* std::begin[link /reference/valarray/valarray/begin_free.md] +* std::end[link /reference/valarray/valarray/end_free.md] * std::multiplies[link /reference/functional/multiplies.md] ### 出力 diff --git a/reference/valarray/gslice_array/op_modulo_assign.md b/reference/valarray/gslice_array/op_modulo_assign.md index 2c0743bcaa..f7f6e77259 100644 --- a/reference/valarray/gslice_array/op_modulo_assign.md +++ b/reference/valarray/gslice_array/op_modulo_assign.md @@ -61,6 +61,8 @@ int main() } ``` * std::gslice[link /reference/valarray/gslice.md] +* std::begin[link /reference/valarray/valarray/begin_free.md] +* std::end[link /reference/valarray/valarray/end_free.md] * std::multiplies[link /reference/functional/multiplies.md] ### 出力 diff --git a/reference/valarray/gslice_array/op_multiply_assign.md b/reference/valarray/gslice_array/op_multiply_assign.md index bb4062eace..8ec9bb85a8 100644 --- a/reference/valarray/gslice_array/op_multiply_assign.md +++ b/reference/valarray/gslice_array/op_multiply_assign.md @@ -61,6 +61,8 @@ int main() } ``` * std::gslice[link /reference/valarray/gslice.md] +* std::begin[link /reference/valarray/valarray/begin_free.md] +* std::end[link /reference/valarray/valarray/end_free.md] * std::multiplies[link /reference/functional/multiplies.md] ### 出力 diff --git a/reference/valarray/gslice_array/op_or_assign.md b/reference/valarray/gslice_array/op_or_assign.md index 0dee1d5c79..ef16ae4ae2 100644 --- a/reference/valarray/gslice_array/op_or_assign.md +++ b/reference/valarray/gslice_array/op_or_assign.md @@ -66,6 +66,8 @@ int main() } ``` * std::gslice[link /reference/valarray/gslice.md] +* std::begin[link /reference/valarray/valarray/begin_free.md] +* std::end[link /reference/valarray/valarray/end_free.md] * std::multiplies[link /reference/functional/multiplies.md] * to_string()[link /reference/bitset/bitset/to_string.md] diff --git a/reference/valarray/gslice_array/op_plus_assign.md b/reference/valarray/gslice_array/op_plus_assign.md index ab62bbba14..97a6d3b048 100644 --- a/reference/valarray/gslice_array/op_plus_assign.md +++ b/reference/valarray/gslice_array/op_plus_assign.md @@ -61,6 +61,8 @@ int main() } ``` * std::gslice[link /reference/valarray/gslice.md] +* std::begin[link /reference/valarray/valarray/begin_free.md] +* std::end[link /reference/valarray/valarray/end_free.md] * std::multiplies[link /reference/functional/multiplies.md] ### 出力 diff --git a/reference/valarray/gslice_array/op_right_shift_assign.md b/reference/valarray/gslice_array/op_right_shift_assign.md index f9c9af87a4..1e9ad2f6be 100644 --- a/reference/valarray/gslice_array/op_right_shift_assign.md +++ b/reference/valarray/gslice_array/op_right_shift_assign.md @@ -66,6 +66,8 @@ int main() } ``` * std::gslice[link /reference/valarray/gslice.md] +* std::begin[link /reference/valarray/valarray/begin_free.md] +* std::end[link /reference/valarray/valarray/end_free.md] * std::multiplies[link /reference/functional/multiplies.md] * to_string()[link /reference/bitset/bitset/to_string.md] diff --git a/reference/valarray/gslice_array/op_xor_assign.md b/reference/valarray/gslice_array/op_xor_assign.md index 5f15ae0d52..c0435b5740 100644 --- a/reference/valarray/gslice_array/op_xor_assign.md +++ b/reference/valarray/gslice_array/op_xor_assign.md @@ -66,6 +66,8 @@ int main() } ``` * std::gslice[link /reference/valarray/gslice.md] +* std::begin[link /reference/valarray/valarray/begin_free.md] +* std::end[link /reference/valarray/valarray/end_free.md] * std::multiplies[link /reference/functional/multiplies.md] * to_string()[link /reference/bitset/bitset/to_string.md] diff --git a/reference/valarray/slice.md b/reference/valarray/slice.md index 3e603703d9..ff02f4d40e 100644 --- a/reference/valarray/slice.md +++ b/reference/valarray/slice.md @@ -66,6 +66,8 @@ auto main() } ``` * std::slice[color ff0000] +* std::begin[link valarray/begin_free.md] +* std::end[link valarray/end_free.md] ### 出力 ``` diff --git a/reference/valarray/valarray/begin_free.md b/reference/valarray/valarray/begin_free.md index 277b034789..226d030cdf 100644 --- a/reference/valarray/valarray/begin_free.md +++ b/reference/valarray/valarray/begin_free.md @@ -40,6 +40,7 @@ namespace std { auto last = std::end(c); // std::valarrayにする必要がある ``` * std::begin[color ff0000] + * std::end[link /reference/valarray/valarray/end_free.md] これは、[`std::valarray`](../valarray.md)`` 型を返す関数(本リファレンスでは戻り値型を *`ValOrProxy`* と表記)は、式テンプレートによる最適化を考慮して、代理の型を返すことが許可されているが、`begin` と [`end`](end_free.md) はその代理の型を受け取りが可能であることを求められていないためである。 [``](../../valarray.md) の概要も参照のこと。 @@ -61,6 +62,7 @@ int main() } ``` * std::begin[color ff0000] +* std::end[link /reference/valarray/valarray/end_free.md] ### 出力 ``` diff --git a/reference/valarray/valarray/end_free.md b/reference/valarray/valarray/end_free.md index 66034dab0e..61a91a36f5 100644 --- a/reference/valarray/valarray/end_free.md +++ b/reference/valarray/valarray/end_free.md @@ -40,6 +40,7 @@ namespace std { auto last = std::end(c); // std::valarrayにする必要がある ``` * std::end[color ff0000] + * std::begin[link /reference/valarray/valarray/begin_free.md] これは、[`std::valarray`](../valarray.md)`` 型を返す関数(本リファレンスでは戻り値型を *`ValOrProxy`* と表記)は、式テンプレートによる最適化を考慮して、代理の型を返すことが許可されているが、[`begin`](begin_free.md) と `end` はその代理の型を受け取りが可能であることを求められていないためである。 [``](../../valarray.md) の概要も参照のこと。 @@ -61,6 +62,7 @@ int main() } ``` * std::end[color ff0000] +* std::begin[link /reference/valarray/valarray/begin_free.md] ### 出力 ``` diff --git a/reference/valarray/valarray/op_and.md b/reference/valarray/valarray/op_and.md index dc111081e6..c357bbdd4a 100644 --- a/reference/valarray/valarray/op_and.md +++ b/reference/valarray/valarray/op_and.md @@ -116,6 +116,8 @@ int main() } ``` * std::all_of[link /reference/algorithm/all_of.md] +* std::begin[link /reference/valarray/valarray/begin_free.md] +* std::end[link /reference/valarray/valarray/end_free.md] ### 出力 ``` diff --git a/reference/valarray/valarray/op_and_assign.md b/reference/valarray/valarray/op_and_assign.md index 82c851e0f0..49c2a4209d 100644 --- a/reference/valarray/valarray/op_and_assign.md +++ b/reference/valarray/valarray/op_and_assign.md @@ -87,6 +87,8 @@ int main() } ``` * std::all_of[link /reference/algorithm/all_of.md] +* std::begin[link /reference/valarray/valarray/begin_free.md] +* std::end[link /reference/valarray/valarray/end_free.md] ### 出力 ``` diff --git a/reference/valarray/valarray/op_at.md b/reference/valarray/valarray/op_at.md index 6519f37062..a98878bd45 100644 --- a/reference/valarray/valarray/op_at.md +++ b/reference/valarray/valarray/op_at.md @@ -257,6 +257,8 @@ int main() } ``` * std::slice[link /reference/valarray/slice.md] +* std::begin[link /reference/valarray/valarray/begin_free.md] +* std::end[link /reference/valarray/valarray/end_free.md] * std::slice_array[link /reference/valarray/slice_array.md] * std::gslice[link /reference/valarray/gslice.md] * std::gslice_array[link /reference/valarray/gslice_array.md] diff --git a/reference/valarray/valarray/op_equal.md b/reference/valarray/valarray/op_equal.md index 75b36e66d1..03b19ee423 100644 --- a/reference/valarray/valarray/op_equal.md +++ b/reference/valarray/valarray/op_equal.md @@ -107,6 +107,8 @@ int main() } ``` * std::all_of[link /reference/algorithm/all_of.md] +* std::begin[link /reference/valarray/valarray/begin_free.md] +* std::end[link /reference/valarray/valarray/end_free.md] ### 出力 ``` diff --git a/reference/valarray/valarray/op_flip.md b/reference/valarray/valarray/op_flip.md index 0ebe477e76..1073ef7636 100644 --- a/reference/valarray/valarray/op_flip.md +++ b/reference/valarray/valarray/op_flip.md @@ -62,6 +62,8 @@ int main() } ``` * std::all_of[link /reference/algorithm/all_of.md] +* std::begin[link /reference/valarray/valarray/begin_free.md] +* std::end[link /reference/valarray/valarray/end_free.md] ### 出力 ``` diff --git a/reference/valarray/valarray/op_greater.md b/reference/valarray/valarray/op_greater.md index fc31f8ca76..9c31628475 100644 --- a/reference/valarray/valarray/op_greater.md +++ b/reference/valarray/valarray/op_greater.md @@ -108,6 +108,8 @@ int main() } ``` * std::all_of[link /reference/algorithm/all_of.md] +* std::begin[link /reference/valarray/valarray/begin_free.md] +* std::end[link /reference/valarray/valarray/end_free.md] ### 出力 ``` diff --git a/reference/valarray/valarray/op_greater_equal.md b/reference/valarray/valarray/op_greater_equal.md index 6b69783321..d88ff7f8f3 100644 --- a/reference/valarray/valarray/op_greater_equal.md +++ b/reference/valarray/valarray/op_greater_equal.md @@ -108,6 +108,8 @@ int main() } ``` * std::all_of[link /reference/algorithm/all_of.md] +* std::begin[link /reference/valarray/valarray/begin_free.md] +* std::end[link /reference/valarray/valarray/end_free.md] ### 出力 ``` diff --git a/reference/valarray/valarray/op_left_shift.md b/reference/valarray/valarray/op_left_shift.md index e2c3135a2a..a339976091 100644 --- a/reference/valarray/valarray/op_left_shift.md +++ b/reference/valarray/valarray/op_left_shift.md @@ -114,6 +114,8 @@ int main() } ``` * std::all_of[link /reference/algorithm/all_of.md] +* std::begin[link /reference/valarray/valarray/begin_free.md] +* std::end[link /reference/valarray/valarray/end_free.md] ### 出力 ``` diff --git a/reference/valarray/valarray/op_left_shift_assign.md b/reference/valarray/valarray/op_left_shift_assign.md index 63e6ef71b3..23f3f98f24 100644 --- a/reference/valarray/valarray/op_left_shift_assign.md +++ b/reference/valarray/valarray/op_left_shift_assign.md @@ -89,6 +89,8 @@ int main() } ``` * std::all_of[link /reference/algorithm/all_of.md] +* std::begin[link /reference/valarray/valarray/begin_free.md] +* std::end[link /reference/valarray/valarray/end_free.md] ### 出力 ``` diff --git a/reference/valarray/valarray/op_less.md b/reference/valarray/valarray/op_less.md index 88174690e2..92c500dd0c 100644 --- a/reference/valarray/valarray/op_less.md +++ b/reference/valarray/valarray/op_less.md @@ -108,6 +108,8 @@ int main() } ``` * std::all_of[link /reference/algorithm/all_of.md] +* std::begin[link /reference/valarray/valarray/begin_free.md] +* std::end[link /reference/valarray/valarray/end_free.md] ### 出力 ``` diff --git a/reference/valarray/valarray/op_less_equal.md b/reference/valarray/valarray/op_less_equal.md index 31bd248370..8cf301c397 100644 --- a/reference/valarray/valarray/op_less_equal.md +++ b/reference/valarray/valarray/op_less_equal.md @@ -108,6 +108,8 @@ int main() } ``` * std::all_of[link /reference/algorithm/all_of.md] +* std::begin[link /reference/valarray/valarray/begin_free.md] +* std::end[link /reference/valarray/valarray/end_free.md] ### 出力 ``` diff --git a/reference/valarray/valarray/op_not_equal.md b/reference/valarray/valarray/op_not_equal.md index fe4b67f3e5..981744c7cc 100644 --- a/reference/valarray/valarray/op_not_equal.md +++ b/reference/valarray/valarray/op_not_equal.md @@ -107,6 +107,8 @@ int main() } ``` * std::all_of[link /reference/algorithm/all_of.md] +* std::begin[link /reference/valarray/valarray/begin_free.md] +* std::end[link /reference/valarray/valarray/end_free.md] ### 出力 ``` diff --git a/reference/valarray/valarray/op_or.md b/reference/valarray/valarray/op_or.md index 5668aae378..11be44a3b9 100644 --- a/reference/valarray/valarray/op_or.md +++ b/reference/valarray/valarray/op_or.md @@ -116,6 +116,8 @@ int main() } ``` * std::all_of[link /reference/algorithm/all_of.md] +* std::begin[link /reference/valarray/valarray/begin_free.md] +* std::end[link /reference/valarray/valarray/end_free.md] ### 出力 ``` diff --git a/reference/valarray/valarray/op_or_assign.md b/reference/valarray/valarray/op_or_assign.md index 06697baa32..c543c4b676 100644 --- a/reference/valarray/valarray/op_or_assign.md +++ b/reference/valarray/valarray/op_or_assign.md @@ -90,6 +90,8 @@ int main() } ``` * std::all_of[link /reference/algorithm/all_of.md] +* std::begin[link /reference/valarray/valarray/begin_free.md] +* std::end[link /reference/valarray/valarray/end_free.md] ### 出力 ``` diff --git a/reference/valarray/valarray/op_right_shift.md b/reference/valarray/valarray/op_right_shift.md index bd97a567c5..d671de2132 100644 --- a/reference/valarray/valarray/op_right_shift.md +++ b/reference/valarray/valarray/op_right_shift.md @@ -114,6 +114,8 @@ int main() } ``` * std::all_of[link /reference/algorithm/all_of.md] +* std::begin[link /reference/valarray/valarray/begin_free.md] +* std::end[link /reference/valarray/valarray/end_free.md] ### 出力 ``` diff --git a/reference/valarray/valarray/op_right_shift_assign.md b/reference/valarray/valarray/op_right_shift_assign.md index ede0ee6cce..bce3f8a1bb 100644 --- a/reference/valarray/valarray/op_right_shift_assign.md +++ b/reference/valarray/valarray/op_right_shift_assign.md @@ -89,6 +89,8 @@ int main() } ``` * std::all_of[link /reference/algorithm/all_of.md] +* std::begin[link /reference/valarray/valarray/begin_free.md] +* std::end[link /reference/valarray/valarray/end_free.md] ### 出力 ``` diff --git a/reference/valarray/valarray/op_xor.md b/reference/valarray/valarray/op_xor.md index 7afaeec59a..d07af9e47e 100644 --- a/reference/valarray/valarray/op_xor.md +++ b/reference/valarray/valarray/op_xor.md @@ -116,6 +116,8 @@ int main() } ``` * std::all_of[link /reference/algorithm/all_of.md] +* std::begin[link /reference/valarray/valarray/begin_free.md] +* std::end[link /reference/valarray/valarray/end_free.md] ### 出力 ``` diff --git a/reference/valarray/valarray/op_xor_assign.md b/reference/valarray/valarray/op_xor_assign.md index 406918c3cc..eba44c9ff5 100644 --- a/reference/valarray/valarray/op_xor_assign.md +++ b/reference/valarray/valarray/op_xor_assign.md @@ -89,6 +89,8 @@ int main() } ``` * std::all_of[link /reference/algorithm/all_of.md] +* std::begin[link /reference/valarray/valarray/begin_free.md] +* std::end[link /reference/valarray/valarray/end_free.md] ### 出力 ``` From c01cef297550f5a31120690b318e0804e3b77e39 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Wed, 9 Jul 2025 09:48:06 +0900 Subject: [PATCH 2140/3948] new page: `fclose.md` --- reference/cstdio/fclose.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 reference/cstdio/fclose.md diff --git a/reference/cstdio/fclose.md b/reference/cstdio/fclose.md new file mode 100644 index 0000000000..581c4e0822 --- /dev/null +++ b/reference/cstdio/fclose.md @@ -0,0 +1,37 @@ +# fclose +* cstdio[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +int fclose(FILE* stream); +``` + +## 概要 +ファイルを閉じる。 + +原則、開かれたファイルはプロセスが終了する前にこれを呼び出すことが望ましい。 + +`fclose`によって閉じられたファイルストリームは無効になり、そのファイルストリームに対する以降の操作は未定義動作となる。 + +## 戻り値 +正常に実行されれば、`0`を返す。 + +バッファーのフラッシュ時にエラーが発生した場合、もしくはデータの出力時に障害が発生すると`EOF`を返す。 + +それ以外のエラーは処理系依存である。 + +## 例 +```cpp example +#include + +int main() { + FILE *fp = fopen("test.txt", "w"); + fclose(fp); +} +``` + +## 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? From 06970bf3dcce944252071d09dd16cf60b0d6ef22 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Wed, 9 Jul 2025 09:50:10 +0900 Subject: [PATCH 2141/3948] removed nolink --- reference/cstdio.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdio.md b/reference/cstdio.md index 047ca3ecae..0062b9e392 100644 --- a/reference/cstdio.md +++ b/reference/cstdio.md @@ -43,7 +43,7 @@ | [`rename`](/reference/cstdio/rename.md) | ファイル名を変更、ファイルを移動する | | | [`tmpfile`](/reference/cstdio/tmpfile.md) | 一時ファイルを生成する | | | [`tmpnam`](/reference/cstdio/tmpnam.md) | 一時ファイル名を生成する | | -| [`fclose`](/reference/cstdio/fclose.md.nolink) | ファイルを閉じる | | +| [`fclose`](/reference/cstdio/fclose.md) | ファイルを閉じる | | | [`fopen`](/reference/cstdio/fopen.md.nolink) | ファイルを開く | | | [`fflush`](/reference/cstdio/fflush.md.nolink) | ファイルをフラッシュする | | | [`fprintf`](/reference/cstdio/fprintf.md) | 書式を指定してファイルに出力する | | From 9098b9e46b6184a8c3a4f9d96e5499b97964a9eb Mon Sep 17 00:00:00 2001 From: rotarymars Date: Wed, 9 Jul 2025 09:52:56 +0900 Subject: [PATCH 2142/3948] new page: `fopen.md` and removed nolink --- reference/cstdio.md | 2 +- reference/cstdio/fopen.md | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 reference/cstdio/fopen.md diff --git a/reference/cstdio.md b/reference/cstdio.md index 0062b9e392..49d10d3e57 100644 --- a/reference/cstdio.md +++ b/reference/cstdio.md @@ -44,7 +44,7 @@ | [`tmpfile`](/reference/cstdio/tmpfile.md) | 一時ファイルを生成する | | | [`tmpnam`](/reference/cstdio/tmpnam.md) | 一時ファイル名を生成する | | | [`fclose`](/reference/cstdio/fclose.md) | ファイルを閉じる | | -| [`fopen`](/reference/cstdio/fopen.md.nolink) | ファイルを開く | | +| [`fopen`](/reference/cstdio/fopen.md) | ファイルを開く | | | [`fflush`](/reference/cstdio/fflush.md.nolink) | ファイルをフラッシュする | | | [`fprintf`](/reference/cstdio/fprintf.md) | 書式を指定してファイルに出力する | | | [`fscanf`](/reference/cstdio/fscanf.md) | 書式を指定してファイルから入力する | | diff --git a/reference/cstdio/fopen.md b/reference/cstdio/fopen.md new file mode 100644 index 0000000000..69c1e79fac --- /dev/null +++ b/reference/cstdio/fopen.md @@ -0,0 +1,38 @@ +# fopen +* cstdio[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +FILE* fopen(const char* filename, const char* mode); +``` + +## 概要 +ファイルを開く。 + +`mode`にはファイルのモードを指定する。 + +## 戻り値 +正常に実行されれば、ファイルストリームを返す。 + +ファイルの開き方に失敗した場合、`NULL`を返す。 + +## 例 +```cpp example +#include + +int main() { + FILE *fp = fopen("test.txt", "w"); + if (fp == NULL) { + printf("ファイルを開けませんでした\n"); + return 1; + } + fclose(fp); + return 0; +} +``` + +## 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? From 0e0d859af874c8d8a7310a595f1b4176f4f7be73 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Wed, 9 Jul 2025 09:55:11 +0900 Subject: [PATCH 2143/3948] added link for reference Maybe it's going to be deleted... --- reference/cstdio/fclose.md | 3 +++ reference/cstdio/fopen.md | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/reference/cstdio/fclose.md b/reference/cstdio/fclose.md index 581c4e0822..5e5a3f4463 100644 --- a/reference/cstdio/fclose.md +++ b/reference/cstdio/fclose.md @@ -30,6 +30,9 @@ int main() { fclose(fp); } ``` +* fclose[color ff0000] +* fopen[link /reference/cstdio/fopen.md] +* FILE[link /reference/cstdio/file.md] ## 処理系 - [Clang](/implementation.md#clang): ?? diff --git a/reference/cstdio/fopen.md b/reference/cstdio/fopen.md index 69c1e79fac..127db4b211 100644 --- a/reference/cstdio/fopen.md +++ b/reference/cstdio/fopen.md @@ -31,6 +31,10 @@ int main() { return 0; } ``` +* fopen[color ff0000] +* fclose[link /reference/cstdio/fclose.md] +* FILE[link /reference/cstdio/file.md] +* printf[link /reference/cstdio/printf.md] ## 処理系 - [Clang](/implementation.md#clang): ?? From cb399db4f07e2884467b82774701cf9f9d93f26d Mon Sep 17 00:00:00 2001 From: rotarymars Date: Wed, 9 Jul 2025 10:10:03 +0900 Subject: [PATCH 2144/3948] new page: fflush and removed nolink --- reference/cstdio.md | 2 +- reference/cstdio/fflush.md | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 reference/cstdio/fflush.md diff --git a/reference/cstdio.md b/reference/cstdio.md index 49d10d3e57..1739fe13c1 100644 --- a/reference/cstdio.md +++ b/reference/cstdio.md @@ -45,7 +45,7 @@ | [`tmpnam`](/reference/cstdio/tmpnam.md) | 一時ファイル名を生成する | | | [`fclose`](/reference/cstdio/fclose.md) | ファイルを閉じる | | | [`fopen`](/reference/cstdio/fopen.md) | ファイルを開く | | -| [`fflush`](/reference/cstdio/fflush.md.nolink) | ファイルをフラッシュする | | +| [`fflush`](/reference/cstdio/fflush.md) | ファイルをフラッシュする | | | [`fprintf`](/reference/cstdio/fprintf.md) | 書式を指定してファイルに出力する | | | [`fscanf`](/reference/cstdio/fscanf.md) | 書式を指定してファイルから入力する | | | [`vfprintf`](/reference/cstdio/vfprintf.md.nolink) | 可変引数リスト`va_list`を使用し、書式を指定してファイルに出力する | | diff --git a/reference/cstdio/fflush.md b/reference/cstdio/fflush.md new file mode 100644 index 0000000000..1f6776dc92 --- /dev/null +++ b/reference/cstdio/fflush.md @@ -0,0 +1,21 @@ +# fflush +* cstdio[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +int fflush(FILE* stream); +``` + +## 概要 +ファイルをフラッシュする。 + +## 戻り値 +正常に終了した場合、バッファーに何も書き込まれていない場合、読み取り専用で開かれている場合は`0`を返す。 + +それ以外では`EOF`を返す。 + +## 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file From 73a3b6d28fce5dd1ea0a61de23e2e47c0df04a10 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Wed, 9 Jul 2025 10:21:12 +0900 Subject: [PATCH 2145/3948] new page: fputs.md and removed nolink --- reference/cstdio.md | 2 +- reference/cstdio/fputs.md | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 reference/cstdio/fputs.md diff --git a/reference/cstdio.md b/reference/cstdio.md index 1739fe13c1..a93591a1f6 100644 --- a/reference/cstdio.md +++ b/reference/cstdio.md @@ -53,7 +53,7 @@ | [`fgetc`](/reference/cstdio/fgetc.md) | ファイルから1文字入力する | | | [`fgets`](/reference/cstdio/fgets.md) | ファイルからN文字入力する | | | [`fputc`](/reference/cstdio/fputc.md) | ファイルに1文字出力する | | -| [`fputs`](/reference/cstdio/fputs.md.nolink) | ファイルにN文字出力する | | +| [`fputs`](/reference/cstdio/fputs.md) | ファイルにN文字出力する | | | [`fread`](/reference/cstdio/fread.md.nolink) | ファイルからN文字読み込む | | | [`fwrite`](/reference/cstdio/fwrite.md.nolink) | ファイルにN文字書き込む | | | [`fgetpos`](/reference/cstdio/fgetpos.md.nolink) | ファイルの現在位置を取得する | | diff --git a/reference/cstdio/fputs.md b/reference/cstdio/fputs.md new file mode 100644 index 0000000000..b2f52bea8b --- /dev/null +++ b/reference/cstdio/fputs.md @@ -0,0 +1,29 @@ +# fputs.md +* cstdio[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +int fputs(const char* str, FILE* stream); +``` + +## 概要 +ファイルに渡された文字列を出力する。 + +## 戻り値 +正常終了した場合は`0`を、そうでなければ[`EOF`](/reference/cstdio/eof.md)を返す。 + +## 例 +```cpp example +#include + +int main() { + fputs("Hello, World!\n", stdout); + return 0; +} +``` + +## 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file From 08bd977a2a290326bf1f48c946bd7c6b8760348c Mon Sep 17 00:00:00 2001 From: rotarymars Date: Wed, 9 Jul 2025 11:17:31 +0900 Subject: [PATCH 2146/3948] new page: `feof.md` and removed nolink --- reference/cstdio.md | 2 +- reference/cstdio/feof.md | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 reference/cstdio/feof.md diff --git a/reference/cstdio.md b/reference/cstdio.md index a93591a1f6..e81130768a 100644 --- a/reference/cstdio.md +++ b/reference/cstdio.md @@ -62,7 +62,7 @@ | [`ftell`](/reference/cstdio/ftell.md.nolink) | ファイルの現在位置を取得する | | | [`rewind`](/reference/cstdio/rewind.md.nolink) | ファイルの現在位置を先頭に戻し、エラーや終端判定をクリアする | | | [`clearerr`](/reference/cstdio/clearerr.md.nolink) | エラーをクリアする | | -| [`feof`](/reference/cstdio/feof.md.nolink) | ファイルが終端に到達したか判定する | | +| [`feof`](/reference/cstdio/feof.md) | ファイルが終端に到達したか判定する | | | [`ferror`](/reference/cstdio/ferror.md.nolink) | ファイルストリームがエラー状態かを判定する | | | [`perror`](/reference/cstdio/perror.md.nolink) | システムエラーメッセージを出力する | | diff --git a/reference/cstdio/feof.md b/reference/cstdio/feof.md new file mode 100644 index 0000000000..1b3cab092a --- /dev/null +++ b/reference/cstdio/feof.md @@ -0,0 +1,19 @@ +# feof +* cstdio[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +int feof(FILE* stream); +``` + +## 概要 +ファイルの終端に達したかを判定する。 + +## 戻り値 +ファイルの終端に達した場合は`0`以外を、そうでなければ`0`を返す。 + +## 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file From d900425904cdb086949b4d4d9fc5a71898eeafbe Mon Sep 17 00:00:00 2001 From: rotarymars Date: Wed, 9 Jul 2025 11:19:38 +0900 Subject: [PATCH 2147/3948] fixed inner links --- reference/cstdio/fprintf.md | 4 ++-- reference/cstdio/fscanf.md | 4 ++-- reference/cstdio/tmpfile.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/reference/cstdio/fprintf.md b/reference/cstdio/fprintf.md index 70636d1ca9..8c3a0b67f1 100644 --- a/reference/cstdio/fprintf.md +++ b/reference/cstdio/fprintf.md @@ -24,8 +24,8 @@ int main() { } ``` * std::fprintf[color ff0000] -* std::fopen[link /reference/cstdio/fopen.md.nolink] -* std::fclose[link /reference/cstdio/fclose.md.nolink] +* std::fopen[link /reference/cstdio/fopen.md] +* std::fclose[link /reference/cstdio/fclose.md] * std::FILE[link /reference/cstdio/file.md] ### 出力 ``` diff --git a/reference/cstdio/fscanf.md b/reference/cstdio/fscanf.md index 1d7705e2e3..852599ef4f 100644 --- a/reference/cstdio/fscanf.md +++ b/reference/cstdio/fscanf.md @@ -24,8 +24,8 @@ int main() { } ``` * std::fscanf[color ff0000] -* std::fopen[link /reference/cstdio/fopen.md.nolink] -* std::fclose[link /reference/cstdio/fclose.md.nolink] +* std::fopen[link /reference/cstdio/fopen.md] +* std::fclose[link /reference/cstdio/fclose.md] * std::FILE[link /reference/cstdio/file.md] ### 出力(test.txtは以下参照) ``` diff --git a/reference/cstdio/tmpfile.md b/reference/cstdio/tmpfile.md index 807315c264..6ca0c6edba 100644 --- a/reference/cstdio/tmpfile.md +++ b/reference/cstdio/tmpfile.md @@ -10,7 +10,7 @@ std::FILE* tmpfile(); ## 概要 一時ファイルを生成する。 -[`std::fclose`](/reference/cstdio/fclose.md.nolink)関数を呼び出すと、一時ファイルは自動的に削除される。 +[`std::fclose`](/reference/cstdio/fclose.md)関数を呼び出すと、一時ファイルは自動的に削除される。 通常終了([`exit`](/reference/cstdlib/exit.md)関数や`main`関数のreturn文)時には、一時ファイルは自動的に削除される。 From fbe54bde61bf30121e2f8ba8410a4e7a0aaa081d Mon Sep 17 00:00:00 2001 From: rotarymars Date: Wed, 9 Jul 2025 11:21:04 +0900 Subject: [PATCH 2148/3948] fixed word --- reference/cstdio/fclose.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdio/fclose.md b/reference/cstdio/fclose.md index 5e5a3f4463..e9f07484f0 100644 --- a/reference/cstdio/fclose.md +++ b/reference/cstdio/fclose.md @@ -12,7 +12,7 @@ int fclose(FILE* stream); 原則、開かれたファイルはプロセスが終了する前にこれを呼び出すことが望ましい。 -`fclose`によって閉じられたファイルストリームは無効になり、そのファイルストリームに対する以降の操作は未定義動作となる。 +`fclose`によって閉じられたファイルストリームは無効になり、そのファイルストリームに対する以降の操作は未定義の動作となる。 ## 戻り値 正常に実行されれば、`0`を返す。 From fe03d64172bd4a07a2bb62d8605d005172e17d5b Mon Sep 17 00:00:00 2001 From: rotarymars Date: Wed, 9 Jul 2025 11:22:41 +0900 Subject: [PATCH 2149/3948] fixed inner link --- reference/cstdio/fopen.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdio/fopen.md b/reference/cstdio/fopen.md index 127db4b211..9c5c872c3e 100644 --- a/reference/cstdio/fopen.md +++ b/reference/cstdio/fopen.md @@ -34,7 +34,7 @@ int main() { * fopen[color ff0000] * fclose[link /reference/cstdio/fclose.md] * FILE[link /reference/cstdio/file.md] -* printf[link /reference/cstdio/printf.md] +* printf[link /reference/cstdio/printf.md.nolink] ## 処理系 - [Clang](/implementation.md#clang): ?? From f7a9b45a3cf2b23effbeffc93439f2056524eb1f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 9 Jul 2025 17:29:52 +0900 Subject: [PATCH 2150/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE?= =?UTF-8?q?=E9=A3=BE=E3=81=AE=E9=87=8D=E8=A4=87=E5=89=8A=E9=99=A4=E3=82=B9?= =?UTF-8?q?=E3=82=AF=E3=83=AA=E3=83=97=E3=83=88=20:=20chrono/common=5Ftype?= =?UTF-8?q?.md=E3=82=92=E5=89=8A=E9=99=A4=E5=AF=BE=E8=B1=A1=E5=A4=96?= =?UTF-8?q?=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/script/remove_duplicated_qualify.py | 3 ++- reference/chrono/clock_time_conversion.md | 1 + reference/chrono/duration/op_compare_3way.md | 1 + reference/chrono/duration/op_unary_minus.md | 1 + reference/chrono/duration/op_unary_plus.md | 1 + reference/chrono/gps_clock/from_utc.md | 2 ++ reference/chrono/gps_clock/to_utc.md | 2 ++ reference/chrono/tai_clock/from_utc.md | 2 ++ reference/chrono/tai_clock/to_utc.md | 2 ++ reference/chrono/time_zone/to_local.md | 1 + reference/chrono/time_zone/to_sys.md | 1 + reference/chrono/utc_clock/from_sys.md | 1 + reference/chrono/utc_clock/to_sys.md | 1 + reference/chrono/zoned_time/op_deduction_guide.md | 1 + 14 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/script/remove_duplicated_qualify.py b/.github/workflows/script/remove_duplicated_qualify.py index 4316a1c643..a4f9ae8daf 100644 --- a/.github/workflows/script/remove_duplicated_qualify.py +++ b/.github/workflows/script/remove_duplicated_qualify.py @@ -28,7 +28,8 @@ def load_global_qualify_patterns(): "* std::begin[link valarray/begin_free.md]", "* std::end[link valarray/end_free.md]", "* std::begin[link /reference/valarray/valarray/begin_free.md]", - "* std::end[link /reference/valarray/valarray/end_free.md]" + "* std::end[link /reference/valarray/valarray/end_free.md]", + "* common_type_t[link /reference/chrono/common_type.md]", ] def is_not_target_line(line): diff --git a/reference/chrono/clock_time_conversion.md b/reference/chrono/clock_time_conversion.md index f2c9aada11..afd38090fc 100644 --- a/reference/chrono/clock_time_conversion.md +++ b/reference/chrono/clock_time_conversion.md @@ -87,6 +87,7 @@ namespace std::chrono { * sys_time[link sys_time.md] * utc_clock[link utc_clock.md] * utc_time[link utc_time.md] +* common_type_t[link /reference/chrono/common_type.md] * time_point[link time_point.md] ## 概要 diff --git a/reference/chrono/duration/op_compare_3way.md b/reference/chrono/duration/op_compare_3way.md index 831791ac5d..8695ca874f 100644 --- a/reference/chrono/duration/op_compare_3way.md +++ b/reference/chrono/duration/op_compare_3way.md @@ -18,6 +18,7 @@ namespace std::chrono { const duration& rhs); // (1) C++20 } ``` +* common_type_t[link /reference/chrono/common_type.md] ## 概要 三方比較を行う diff --git a/reference/chrono/duration/op_unary_minus.md b/reference/chrono/duration/op_unary_minus.md index 4bdf26a960..dcc5ff4669 100644 --- a/reference/chrono/duration/op_unary_minus.md +++ b/reference/chrono/duration/op_unary_minus.md @@ -8,6 +8,7 @@ ```cpp constexpr common_type_t operator-() const; ``` +* common_type_t[link /reference/chrono/common_type.md] ## 概要 負の符号。 diff --git a/reference/chrono/duration/op_unary_plus.md b/reference/chrono/duration/op_unary_plus.md index 710e4205a1..989edfe59e 100644 --- a/reference/chrono/duration/op_unary_plus.md +++ b/reference/chrono/duration/op_unary_plus.md @@ -8,6 +8,7 @@ ```cpp constexpr common_type_t operator+() const; ``` +* common_type_t[link /reference/chrono/common_type.md] ## 概要 正の符号。 diff --git a/reference/chrono/gps_clock/from_utc.md b/reference/chrono/gps_clock/from_utc.md index 9580e8f392..472cec2792 100644 --- a/reference/chrono/gps_clock/from_utc.md +++ b/reference/chrono/gps_clock/from_utc.md @@ -12,6 +12,7 @@ static gps_time> ``` * gps_time[link /reference/chrono/gps_time.md] * utc_time[link /reference/chrono/utc_time.md] +* common_type_t[link /reference/chrono/common_type.md] ## 概要 UTC時間からGPS時間に変換する。 @@ -22,6 +23,7 @@ UTC時間からGPS時間に変換する。 return gps_time>{t.time_since_epoch()} - 315964809s; ``` * gps_time[link /reference/chrono/gps_time.md] +* common_type_t[link /reference/chrono/common_type.md] * t.time_since_epoch()[link /reference/chrono/time_point/time_since_epoch.md] * 315964809s[link /reference/chrono/duration/op_s.md] diff --git a/reference/chrono/gps_clock/to_utc.md b/reference/chrono/gps_clock/to_utc.md index 34f9ec8a79..1bc92cf475 100644 --- a/reference/chrono/gps_clock/to_utc.md +++ b/reference/chrono/gps_clock/to_utc.md @@ -12,6 +12,7 @@ static utc_time> ``` * gps_time[link /reference/chrono/gps_time.md] * utc_time[link /reference/chrono/utc_time.md] +* common_type_t[link /reference/chrono/common_type.md] ## 概要 GPS時間からUTC時間に変換する。 @@ -22,6 +23,7 @@ GPS時間からUTC時間に変換する。 return utc_time>{t.time_since_epoch()} + 315964809s; ``` * utc_time[link /reference/chrono/utc_time.md] +* common_type_t[link /reference/chrono/common_type.md] * t.time_since_epoch()[link /reference/chrono/time_point/time_since_epoch.md] * 315964809s[link /reference/chrono/duration/op_s.md] diff --git a/reference/chrono/tai_clock/from_utc.md b/reference/chrono/tai_clock/from_utc.md index a0409a4998..2422493956 100644 --- a/reference/chrono/tai_clock/from_utc.md +++ b/reference/chrono/tai_clock/from_utc.md @@ -12,6 +12,7 @@ static tai_time> ``` * tai_time[link /reference/chrono/tai_time.md] * utc_time[link /reference/chrono/utc_time.md] +* common_type_t[link /reference/chrono/common_type.md] ## 概要 UTC時間からTAI時間に変換する。 @@ -22,6 +23,7 @@ UTC時間からTAI時間に変換する。 return tai_time>{t.time_since_epoch()} + 378691210s; ``` * tai_time[link /reference/chrono/tai_time.md] +* common_type_t[link /reference/chrono/common_type.md] * t.time_since_epoch()[link /reference/chrono/time_point/time_since_epoch.md] * 378691210s[link /reference/chrono/duration/op_s.md] diff --git a/reference/chrono/tai_clock/to_utc.md b/reference/chrono/tai_clock/to_utc.md index 55ef1c4236..7a92545660 100644 --- a/reference/chrono/tai_clock/to_utc.md +++ b/reference/chrono/tai_clock/to_utc.md @@ -12,6 +12,7 @@ static utc_time> ``` * tai_time[link /reference/chrono/tai_time.md] * utc_time[link /reference/chrono/utc_time.md] +* common_type_t[link /reference/chrono/common_type.md] ## 概要 TAI時間からUTC時間に変換する。 @@ -22,6 +23,7 @@ TAI時間からUTC時間に変換する。 return utc_time>{t.time_since_epoch()} - 378691210s; ``` * utc_time[link /reference/chrono/utc_time.md] +* common_type_t[link /reference/chrono/common_type.md] * t.time_since_epoch()[link /reference/chrono/time_point/time_since_epoch.md] * 378691210s[link /reference/chrono/duration/op_s.md] diff --git a/reference/chrono/time_zone/to_local.md b/reference/chrono/time_zone/to_local.md index c641d20005..24301c0a26 100644 --- a/reference/chrono/time_zone/to_local.md +++ b/reference/chrono/time_zone/to_local.md @@ -12,6 +12,7 @@ local_time> ``` * sys_time[link /reference/chrono/sys_time.md] * local_time[link /reference/chrono/local_time.md] +* common_type_t[link /reference/chrono/common_type.md] ## 概要 システム時間からローカル時間に変換する。 diff --git a/reference/chrono/time_zone/to_sys.md b/reference/chrono/time_zone/to_sys.md index b0cde3de54..f5fa214333 100644 --- a/reference/chrono/time_zone/to_sys.md +++ b/reference/chrono/time_zone/to_sys.md @@ -16,6 +16,7 @@ sys_time> ``` * sys_time[link /reference/chrono/sys_time.md] * local_time[link /reference/chrono/local_time.md] +* common_type_t[link /reference/chrono/common_type.md] * choose[link /reference/chrono/choose.md] ## 概要 diff --git a/reference/chrono/utc_clock/from_sys.md b/reference/chrono/utc_clock/from_sys.md index eb7d6de106..0616566200 100644 --- a/reference/chrono/utc_clock/from_sys.md +++ b/reference/chrono/utc_clock/from_sys.md @@ -12,6 +12,7 @@ static utc_time> ``` * utc_time[link /reference/chrono/utc_time.md] * sys_time[link /reference/chrono/sys_time.md] +* common_type_t[link /reference/chrono/common_type.md] ## 概要 システム時間からUTC時間に変換する。 diff --git a/reference/chrono/utc_clock/to_sys.md b/reference/chrono/utc_clock/to_sys.md index 804eebafea..812678a093 100644 --- a/reference/chrono/utc_clock/to_sys.md +++ b/reference/chrono/utc_clock/to_sys.md @@ -12,6 +12,7 @@ static sys_time> ``` * sys_time[link /reference/chrono/sys_time.md] * utc_time[link /reference/chrono/utc_time.md] +* common_type_t[link /reference/chrono/common_type.md] ## 概要 UTC時間からシステム時間に変換する。 diff --git a/reference/chrono/zoned_time/op_deduction_guide.md b/reference/chrono/zoned_time/op_deduction_guide.md index 8bebe82400..94bdfbda3d 100644 --- a/reference/chrono/zoned_time/op_deduction_guide.md +++ b/reference/chrono/zoned_time/op_deduction_guide.md @@ -46,6 +46,7 @@ namespace std::chrono { } ``` * sys_time[link /reference/chrono/sys_time.md] +* common_type_t[link /reference/chrono/common_type.md] * local_time[link /reference/chrono/local_time.md] * choose[link /reference/chrono/choose.md] * conditional_t[link /reference/type_traits/conditional.md] From e8c9b487ea03fc7a8804f062c0364dfaa5167992 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 9 Jul 2025 17:42:08 +0900 Subject: [PATCH 2151/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE?= =?UTF-8?q?=E9=A3=BE=E3=81=AE=E8=A1=9D=E7=AA=81=E5=9B=9E=E9=81=BF=E3=81=AE?= =?UTF-8?q?=E3=81=9F=E3=82=81error=5Fcondition=E5=9E=8B=E3=81=AE=E5=A4=89?= =?UTF-8?q?=E6=95=B0=E5=90=8D=E3=82=92ec=20=E2=86=92=20econd=E3=81=AB?= =?UTF-8?q?=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/future/make_error_condition.md | 13 ++++---- reference/ios/make_error_condition.md | 12 ++++---- .../system_error/error_condition/assign.md | 14 ++++----- .../system_error/error_condition/category.md | 6 ++-- .../system_error/error_condition/clear.md | 16 +++++----- .../system_error/error_condition/message.md | 4 +-- .../system_error/error_condition/op_assign.md | 14 ++++----- .../error_condition/op_compare_3way.md | 10 +++---- .../error_condition/op_constructor.md | 30 +++++++++---------- .../system_error/error_condition/value.md | 6 ++-- .../system_error/make_error_condition.md | 13 ++++---- 11 files changed, 70 insertions(+), 68 deletions(-) diff --git a/reference/future/make_error_condition.md b/reference/future/make_error_condition.md index 1236d616b0..dc902870c8 100644 --- a/reference/future/make_error_condition.md +++ b/reference/future/make_error_condition.md @@ -32,19 +32,20 @@ namespace std { int main() { - std::error_condition ec = std::make_error_condition(std::future_errc::broken_promise); + std::error_condition econd = std::make_error_condition(std::future_errc::broken_promise); - std::cout << "category : " << ec.category().name() << std::endl; - std::cout << "value : " << ec.value() << std::endl; - std::cout << "message : " << ec.message() << std::endl; + std::cout << "category : " << econd.category().name() << std::endl; + std::cout << "value : " << econd.value() << std::endl; + std::cout << "message : " << econd.message() << std::endl; } ``` * std::make_error_condition[color ff0000] * std::error_condition[link /reference/system_error/error_condition.md] * std::future_errc::broken_promise[link future_errc.md] -* ec.category()[link /reference/system_error/error_condition/category.md] +* econd.category()[link /reference/system_error/error_condition/category.md] * name()[link /reference/system_error/error_category/name.md] -* ec.value()[link /reference/system_error/error_condition/value.md] +* econd.value()[link /reference/system_error/error_condition/value.md] +* econd.message()[link /reference/system_error/error_condition/message.md] ### 出力例 ``` diff --git a/reference/ios/make_error_condition.md b/reference/ios/make_error_condition.md index 555e917add..52cd91dd2a 100644 --- a/reference/ios/make_error_condition.md +++ b/reference/ios/make_error_condition.md @@ -31,19 +31,19 @@ namespace std { int main() { - std::error_condition ec = std::make_error_condition(std::io_errc::stream); + std::error_condition econd = std::make_error_condition(std::io_errc::stream); - std::cout << "category : " << ec.category().name() << std::endl; - std::cout << "value : " << ec.value() << std::endl; - std::cout << "message : " << ec.message() << std::endl; + std::cout << "category : " << econd.category().name() << std::endl; + std::cout << "value : " << econd.value() << std::endl; + std::cout << "message : " << econd.message() << std::endl; } ``` * std::make_error_condition[color ff0000] * std::io_errc::stream[link io_errc.md] * std::error_condition[link /reference/system_error/error_condition.md] -* ec.category()[link /reference/system_error/error_code/category.md] +* econd.category()[link /reference/system_error/error_code/category.md] * name()[link /reference/system_error/error_category/name.md] -* ec.value()[link /reference/system_error/error_condition/value.md] +* econd.value()[link /reference/system_error/error_condition/value.md] ### 出力例 ``` diff --git a/reference/system_error/error_condition/assign.md b/reference/system_error/error_condition/assign.md index e1a42c7ec0..1a01881dd8 100644 --- a/reference/system_error/error_condition/assign.md +++ b/reference/system_error/error_condition/assign.md @@ -33,26 +33,26 @@ void assign(int val, const error_category& cat) noexcept; int main() { - std::error_condition ec; + std::error_condition econd; - ec.assign(static_cast(std::errc::invalid_argument), std::generic_category()); + econd.assign(static_cast(std::errc::invalid_argument), std::generic_category()); - if (ec) { + if (econd) { std::cout << "error" << std::endl; } else { std::cout << "success" << std::endl; } - std::cout << ec.value() << std::endl; - std::cout << ec.category().name() << std::endl; + std::cout << econd.value() << std::endl; + std::cout << econd.category().name() << std::endl; } ``` * assign[color ff0000] * std::errc::invalid_argument[link /reference/system_error/errc.md] * std::generic_category()[link /reference/system_error/generic_category.md] -* ec.value()[link value.md] -* ec.category()[link category.md] +* econd.value()[link value.md] +* econd.category()[link category.md] * name()[link /reference/system_error/error_category/name.md] ### 出力 diff --git a/reference/system_error/error_condition/category.md b/reference/system_error/error_condition/category.md index 4c590dd39f..b0dfbd23f0 100644 --- a/reference/system_error/error_condition/category.md +++ b/reference/system_error/error_condition/category.md @@ -29,10 +29,10 @@ const error_category& category() const noexcept; int main() { - std::error_condition ec(static_cast(std::errc::invalid_argument), - std::generic_category()); + std::error_condition econd(static_cast(std::errc::invalid_argument), + std::generic_category()); - const std::error_category& cat = ec.category(); + const std::error_category& cat = econd.category(); std::cout << cat.name() << std::endl; } ``` diff --git a/reference/system_error/error_condition/clear.md b/reference/system_error/error_condition/clear.md index 28ba0a87a5..2cef69418a 100644 --- a/reference/system_error/error_condition/clear.md +++ b/reference/system_error/error_condition/clear.md @@ -32,27 +32,27 @@ void clear() noexcept; int main() { - std::error_condition ec(static_cast(std::errc::invalid_argument), - std::generic_category()); + std::error_condition econd(static_cast(std::errc::invalid_argument), + std::generic_category()); - ec.clear(); + econd.clear(); - if (ec) { + if (econd) { std::cout << "error" << std::endl; } else { std::cout << "success" << std::endl; } - std::cout << ec.value() << std::endl; - std::cout << ec.category().name() << std::endl; + std::cout << econd.value() << std::endl; + std::cout << econd.category().name() << std::endl; } ``` * clear()[color ff0000] * std::errc::invalid_argument[link /reference/system_error/errc.md] * std::generic_category()[link /reference/system_error/generic_category.md] -* ec.value()[link value.md] -* ec.category()[link category.md] +* econd.value()[link value.md] +* econd.category()[link category.md] * name()[link /reference/system_error/error_category/name.md] ### 出力 diff --git a/reference/system_error/error_condition/message.md b/reference/system_error/error_condition/message.md index 7400fabb7b..c9879b34df 100644 --- a/reference/system_error/error_condition/message.md +++ b/reference/system_error/error_condition/message.md @@ -31,8 +31,8 @@ category().message(value()) int main() { - std::error_condition ec(static_cast(std::errc::invalid_argument), - std::generic_category()); + std::error_condition econd(static_cast(std::errc::invalid_argument), + std::generic_category()); std::cout << ec.message() << std::endl; } diff --git a/reference/system_error/error_condition/op_assign.md b/reference/system_error/error_condition/op_assign.md index a435cc522d..f87ea08059 100644 --- a/reference/system_error/error_condition/op_assign.md +++ b/reference/system_error/error_condition/op_assign.md @@ -42,24 +42,24 @@ error_condition& operator=(ErrorConditionEnum e) noexcept; int main() { - std::error_condition ec; + std::error_condition econd; - ec = std::errc::invalid_argument; + econd = std::errc::invalid_argument; - if (ec) { + if (econd) { std::cout << "error" << std::endl; } else { std::cout << "success" << std::endl; } - std::cout << ec.value() << std::endl; - std::cout << ec.category().name() << std::endl; + std::cout << econd.value() << std::endl; + std::cout << econd.category().name() << std::endl; } ``` * std::errc::invalid_argument[link /reference/system_error/errc.md] -* ec.value()[link value.md] -* ec.category()[link category.md] +* econd.value()[link value.md] +* econd.category()[link category.md] * name()[link /reference/system_error/error_category/name.md] ### 出力 diff --git a/reference/system_error/error_condition/op_compare_3way.md b/reference/system_error/error_condition/op_compare_3way.md index da9ced458e..4d4c62b30e 100644 --- a/reference/system_error/error_condition/op_compare_3way.md +++ b/reference/system_error/error_condition/op_compare_3way.md @@ -47,12 +47,12 @@ return lhs.value() <=> rhs.value(); int main() { - std::error_condition ec1 = std::make_error_condition(std::errc::invalid_argument); - std::error_condition ec2 = std::make_error_condition(std::errc::invalid_argument); - std::error_condition ec3 = std::make_error_condition(std::errc::permission_denied); + std::error_condition econd1 = std::make_error_condition(std::errc::invalid_argument); + std::error_condition econd2 = std::make_error_condition(std::errc::invalid_argument); + std::error_condition econd3 = std::make_error_condition(std::errc::permission_denied); - assert((ec1 <=> ec2) == 0); - assert((ec1 <=> ec3) != 0); + assert((econd1 <=> econd2) == 0); + assert((econd1 <=> econd3) != 0); } ``` * std::make_error_condition[link /reference/system_error/make_error_condition.md] diff --git a/reference/system_error/error_condition/op_constructor.md b/reference/system_error/error_condition/op_constructor.md index 063a823dcf..5c22ee6530 100644 --- a/reference/system_error/error_condition/op_constructor.md +++ b/reference/system_error/error_condition/op_constructor.md @@ -44,55 +44,55 @@ int main() // デフォルトコンストラクタ std::cout << "default ctor" << std::endl; { - std::error_condition ec; + std::error_condition econd; - if (ec) { + if (econd) { std::cout << "error" << std::endl; } else { std::cout << "success" << std::endl; } - std::cout << ec.value() << std::endl; - std::cout << ec.category().name() << std::endl; + std::cout << econd.value() << std::endl; + std::cout << econd.category().name() << std::endl; } // エラー値とエラーカテゴリを受け取って構築 std::cout << std::endl << "value & category ctor" << std::endl; { - std::error_condition ec(static_cast(std::errc::invalid_argument), - std::generic_category()); + std::error_condition econd(static_cast(std::errc::invalid_argument), + std::generic_category()); - if (ec) { + if (econd) { std::cout << "error" << std::endl; } else { std::cout << "success" << std::endl; } - std::cout << ec.value() << std::endl; - std::cout << ec.category().name() << std::endl; + std::cout << econd.value() << std::endl; + std::cout << econd.category().name() << std::endl; } // is_error_condition_enumが特殊化された型のエラー値を受け取って構築 std::cout << std::endl << "ErrorConditionEnum ctor" << std::endl; { - std::error_condition ec(std::errc::invalid_argument); + std::error_condition econd(std::errc::invalid_argument); - if (ec) { + if (econd) { std::cout << "error" << std::endl; } else { std::cout << "success" << std::endl; } - std::cout << ec.value() << std::endl; - std::cout << ec.category().name() << std::endl; + std::cout << econd.value() << std::endl; + std::cout << econd.category().name() << std::endl; } } ``` -* ec.value()[link value.md] -* ec.category()[link category.md] +* econd.value()[link value.md] +* econd.category()[link category.md] * name()[link /reference/system_error/error_category/name.md] * std::errc::invalid_argument[link /reference/system_error/errc.md] * std::generic_category()[link /reference/system_error/generic_category.md] diff --git a/reference/system_error/error_condition/value.md b/reference/system_error/error_condition/value.md index dd87ec46e2..6dc6af243f 100644 --- a/reference/system_error/error_condition/value.md +++ b/reference/system_error/error_condition/value.md @@ -28,10 +28,10 @@ int value() const noexcept; int main() { - std::error_condition ec(static_cast(std::errc::invalid_argument), - std::generic_category()); + std::error_condition econd(static_cast(std::errc::invalid_argument), + std::generic_category()); - std::cout << ec.value() << std::endl; + std::cout << econd.value() << std::endl; } ``` * value()[color ff0000] diff --git a/reference/system_error/make_error_condition.md b/reference/system_error/make_error_condition.md index be522f67e2..722186b8fa 100644 --- a/reference/system_error/make_error_condition.md +++ b/reference/system_error/make_error_condition.md @@ -32,19 +32,20 @@ namespace std { int main() { - std::error_condition ec = std::make_error_condition(std::errc::invalid_argument); + std::error_condition econd = std::make_error_condition(std::errc::invalid_argument); - std::cout << "category : " << ec.category().name() << std::endl; - std::cout << "value : " << ec.value() << std::endl; - std::cout << "message : " << ec.message() << std::endl; + std::cout << "category : " << econd.category().name() << std::endl; + std::cout << "value : " << econd.value() << std::endl; + std::cout << "message : " << econd.message() << std::endl; } ``` * std::make_error_condition[color ff0000] * std::error_condition[link error_code.md] * std::errc::invalid_argument[link errc.md] -* ec.category()[link error_condition/category.md] +* econd.category()[link error_condition/category.md] * name()[link error_category/name.md] -* ec.value()[link error_condition/value.md] +* econd.value()[link error_condition/value.md] +* econd.message()[link error_condition/message.md] ### 出力 ``` From d9b26573f3f2d2e48cc49aec0c48873e282de7e4 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 9 Jul 2025 17:52:14 +0900 Subject: [PATCH 2152/3948] =?UTF-8?q?jthread=E3=81=AE=E5=A4=89=E6=95=B0?= =?UTF-8?q?=E5=90=8D=E3=82=92t=20=E2=86=92=20jt=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/execution/execution/run_loop/run.md | 2 +- reference/rcu/rcu_obj_base.md | 2 +- reference/rcu/rcu_retire.md | 2 +- reference/rcu/rcu_synchronize.md | 2 +- reference/thread/jthread.md | 14 +++++++------- reference/thread/jthread/detach.md | 6 +++--- reference/thread/jthread/get_id.md | 12 ++++++------ reference/thread/jthread/get_stop_source.md | 12 ++++++------ reference/thread/jthread/get_stop_token.md | 8 ++++---- reference/thread/jthread/join.md | 4 ++-- reference/thread/jthread/joinable.md | 8 ++++---- reference/thread/jthread/native_handle.md | 6 +++--- reference/thread/jthread/op_assign.md | 16 ++++++++-------- reference/thread/jthread/op_constructor.md | 8 ++++---- reference/thread/jthread/op_destructor.md | 4 ++-- reference/thread/jthread/request_stop.md | 11 ++++++----- reference/thread/jthread/swap.md | 8 ++++---- reference/thread/jthread/swap_free.md | 8 ++++---- 18 files changed, 67 insertions(+), 66 deletions(-) diff --git a/reference/execution/execution/run_loop/run.md b/reference/execution/execution/run_loop/run.md index 85f406acf7..c9a863bb10 100644 --- a/reference/execution/execution/run_loop/run.md +++ b/reference/execution/execution/run_loop/run.md @@ -75,7 +75,7 @@ int main() ex::run_loop loop; std::println("starting"); - std::jthread th([&]{ + std::jthread jt([&]{ // 2) 別スレッドからfinishを呼び出し std::println("finishing"); loop.finish(); diff --git a/reference/rcu/rcu_obj_base.md b/reference/rcu/rcu_obj_base.md index cd2d1639d3..f0495c3510 100644 --- a/reference/rcu/rcu_obj_base.md +++ b/reference/rcu/rcu_obj_base.md @@ -75,7 +75,7 @@ int main() data.store(newdata); // 共有データへ並行アクセス - std::jthread th{[] { + std::jthread jt{[] { for (int i = 0; i < 3; i++) { reader(); } diff --git a/reference/rcu/rcu_retire.md b/reference/rcu/rcu_retire.md index 80aa742f61..7ede34b34c 100644 --- a/reference/rcu/rcu_retire.md +++ b/reference/rcu/rcu_retire.md @@ -86,7 +86,7 @@ int main() data.store(newdata); // 共有データへ並行アクセス - std::jthread th{[] { + std::jthread jt{[] { for (int i = 0; i < 3; i++) { reader(); } diff --git a/reference/rcu/rcu_synchronize.md b/reference/rcu/rcu_synchronize.md index cbb1cf2df7..f961358ac1 100644 --- a/reference/rcu/rcu_synchronize.md +++ b/reference/rcu/rcu_synchronize.md @@ -77,7 +77,7 @@ int main() data.store(newdata); // 共有データへ並行アクセス - std::jthread th{[] { + std::jthread jt{[] { for (int i = 0; i < 3; i++) { reader(); } diff --git a/reference/thread/jthread.md b/reference/thread/jthread.md index e579e0fb1d..52cdf30adb 100644 --- a/reference/thread/jthread.md +++ b/reference/thread/jthread.md @@ -96,14 +96,14 @@ int main() { // 関数の第1引数がstd::stop_token型である場合、 // スレッドに中断リクエストを送れるようになる - std::jthread t1 {f1, 1'000'000}; + std::jthread jt1 {f1, 1'000'000}; std::this_thread::sleep_for(std::chrono::milliseconds{3}); - t1.request_stop(); // スレッドの中断要求を発行 + jt1.request_stop(); // スレッドの中断要求を発行 // スレッド実行する関数がstd::stop_tokenを受け取らない場合、 // 中断リクエストを使用せず、 // デストラクタで自動的にjoinするスレッドオブジェクトとして使用する - std::jthread t2 { + std::jthread jt2 { [] { f2(1'000'000); } }; } // jthreadのデストラクタでは、中断要求を発行し、スレッドの終了を待機する @@ -114,7 +114,7 @@ int main() ``` * std::stop_token[link /reference/stop_token/stop_token.md] * stoken.stop_requested()[link /reference/stop_token/stop_token/stop_requested.md] -* t1.request_stop()[link jthread/request_stop.md] +* jt1.request_stop()[link jthread/request_stop.md] #### 出力例 @@ -133,18 +133,18 @@ int main() { int x = 0, y = 0; - std::jthread t([&](std::stop_token st) { x++; }); + std::jthread jt([&](std::stop_token st) { x++; }); // スレッドに対する停止要求の作成に合わせて呼び出される // コールバックを定義する。 - std::stop_callback sc { t.get_stop_token(), [&] { y++; }}; + std::stop_callback sc { jt.get_stop_token(), [&] { y++; }}; assert(y == 0); // 明示的にjoin()を呼び出さずにtを上書きする。 // このとき、ムーブ代入演算子の呼び出しの中で、 // 自動で停止要求の作成とjoin()の呼び出しが行われる。 - t = std::jthread{}; + jt = std::jthread{}; assert(x == 1 && y == 1); diff --git a/reference/thread/jthread/detach.md b/reference/thread/jthread/detach.md index d4c1c3940f..be78b49328 100644 --- a/reference/thread/jthread/detach.md +++ b/reference/thread/jthread/detach.md @@ -50,11 +50,11 @@ std::future start_async(int x, int y) auto ftr = task.get_future(); // 新しいスレッド作成後にdetach操作 - std::jthread t(std::move(task)); - t.detach(); + std::jthread jt(std::move(task)); + jt.detach(); return ftr; - // 変数tにはスレッドが紐付いていないため破棄可能 + // 変数jtにはスレッドが紐付いていないため破棄可能 } int main() diff --git a/reference/thread/jthread/get_id.md b/reference/thread/jthread/get_id.md index 4b4856e262..59e40ace5a 100644 --- a/reference/thread/jthread/get_id.md +++ b/reference/thread/jthread/get_id.md @@ -32,14 +32,14 @@ id get_id() const noexcept; // (1) C++26 int main() { - std::jthread t1; - assert( t1.get_id() == std::jthread::id{} ); + std::jthread jt1; + assert( jt1.get_id() == std::jthread::id{} ); - std::jthread t2{ []{ /*...*/ } }; - assert( t2.get_id() != std::jthread::id{} ); + std::jthread jt2{ []{ /*...*/ } }; + assert( jt2.get_id() != std::jthread::id{} ); - std::cout << t1.get_id() << std::endl; - std::cout << t2.get_id() << std::endl; + std::cout << jt1.get_id() << std::endl; + std::cout << jt2.get_id() << std::endl; } ``` * get_id()[color ff0000] diff --git a/reference/thread/jthread/get_stop_source.md b/reference/thread/jthread/get_stop_source.md index db6c4080b8..303b755fc7 100644 --- a/reference/thread/jthread/get_stop_source.md +++ b/reference/thread/jthread/get_stop_source.md @@ -31,16 +31,16 @@ stop_source get_stop_source() noexcept; // (1) C++26 int main() { - std::jthread t1 { + std::jthread jt1 { [](std::stop_token stoken) { while (!stoken.stop_requested()) {} - std::cout << "exit t1 thread" << std::endl; + std::cout << "exit jt1 thread" << std::endl; } }; - // 別スレッドを立てて、そのスレッドからt1スレッドに停止要求を発行する - std::jthread t2 { - [ssource = t1.get_stop_source()]() { + // 別スレッドを立てて、そのスレッドからjt1スレッドに停止要求を発行する + std::jthread jt2 { + [ssource = jt1.get_stop_source()]() { ssource.request_stop(); } }; @@ -53,7 +53,7 @@ int main() ### 出力 ``` -exit t1 thread +exit jt1 thread ``` ## バージョン diff --git a/reference/thread/jthread/get_stop_token.md b/reference/thread/jthread/get_stop_token.md index 6c8cbe0bab..16f797634d 100644 --- a/reference/thread/jthread/get_stop_token.md +++ b/reference/thread/jthread/get_stop_token.md @@ -38,17 +38,17 @@ return ssource.get_token(); int main() { - std::jthread t { + std::jthread jt { [](std::stop_token stoken) { while (!stoken.stop_requested()) {} std::cout << "exit thread" << std::endl; } }; - t.request_stop(); + jt.request_stop(); // 停止要求が正しく発行されたか調べる - assert(t.get_stop_token().stop_requested()); + assert(jt.get_stop_token().stop_requested()); } ``` * get_stop_token()[color ff0000] @@ -58,7 +58,7 @@ int main() ### 出力 ``` -exit t thread +exit thread ``` ## バージョン diff --git a/reference/thread/jthread/join.md b/reference/thread/jthread/join.md index 7ee8ae32eb..e6c8b600b7 100644 --- a/reference/thread/jthread/join.md +++ b/reference/thread/jthread/join.md @@ -45,11 +45,11 @@ join操作に失敗した場合、[`system_error`](/reference/system_error/syste int main() { int x = 0; - std::jthread t([&]{ ++x; }); + std::jthread jt([&]{ ++x; }); // ここでxにアクセスするとdata raceにより未定義動作 - t.join(); + jt.join(); // 別スレッド上で行われた全処理が完了している assert(x == 1); diff --git a/reference/thread/jthread/joinable.md b/reference/thread/jthread/joinable.md index 3c269e0bfa..2f4aa3c809 100644 --- a/reference/thread/jthread/joinable.md +++ b/reference/thread/jthread/joinable.md @@ -33,11 +33,11 @@ return get_id() != id(); int main() { - std::jthread t([]{ /*...*/ }); - assert(t.joinable()); + std::jthread jt([]{ /*...*/ }); + assert(jt.joinable()); - t.join(); - assert(!t.joinable()); + jt.join(); + assert(!jt.joinable()); } ``` * joinable()[color ff0000] diff --git a/reference/thread/jthread/native_handle.md b/reference/thread/jthread/native_handle.md index 42dd99c96f..1a48b5cadc 100644 --- a/reference/thread/jthread/native_handle.md +++ b/reference/thread/jthread/native_handle.md @@ -39,9 +39,9 @@ void func() { } int main() { - std::jthread t{func}; - SetThreadPriority(t.native_handle(), THREAD_PRIORITY_IDLE); - t.join(); + std::jthread jt{func}; + SetThreadPriority(jt.native_handle(), THREAD_PRIORITY_IDLE); + jt.join(); } ``` * native_handle()[color ff0000] diff --git a/reference/thread/jthread/op_assign.md b/reference/thread/jthread/op_assign.md index 92c84fb547..50abeab349 100644 --- a/reference/thread/jthread/op_assign.md +++ b/reference/thread/jthread/op_assign.md @@ -39,18 +39,18 @@ jthread& operator=(jthread&& x) noexcept; // (2) C++20 int main() { - std::jthread t1([]{ /*...*/ }); - std::jthread t2; - assert(t1.joinable() && !t2.joinable()); + std::jthread jt1([]{ /*...*/ }); + std::jthread jt2; + assert(jt1.joinable() && !jt2.joinable()); - // t1からt2へムーブ代入 - t2 = std::move(t1); - assert(!t1.joinable() && t2.joinable()); + // jt1からjt2へムーブ代入 + jt2 = std::move(jt1); + assert(!jt1.joinable() && jt2.joinable()); - t2.join(); + jt2.join(); } ``` -* t2 = std::move(t1);[color ff0000] +* jt2 = std::move(jt1);[color ff0000] * joinable()[link joinable.md] ### 出力 diff --git a/reference/thread/jthread/op_constructor.md b/reference/thread/jthread/op_constructor.md index 149178dcb5..a43cb60e01 100644 --- a/reference/thread/jthread/op_constructor.md +++ b/reference/thread/jthread/op_constructor.md @@ -125,14 +125,14 @@ int main() { // 関数の第1引数がstd::stop_token型である場合、 // スレッドに中断リクエストを送れるようになる - std::jthread t1 {f1, 1'000'000}; + std::jthread jt1 {f1, 1'000'000}; std::this_thread::sleep_for(std::chrono::milliseconds{3}); - t1.request_stop(); // スレッドの中断要求を発行 + jt1.request_stop(); // スレッドの中断要求を発行 // スレッド実行する関数がstd::stop_tokenを受け取らない場合、 // 中断リクエストを使用せず、 // デストラクタで自動的にjoinするスレッドオブジェクトとして使用する - std::jthread t2 { + std::jthread jt2 { [] { f2(1'000'000); } }; } // jthreadのデストラクタでは、中断要求を発行し、スレッドの終了を待機する @@ -143,7 +143,7 @@ int main() ``` * std::stop_token[link /reference/stop_token/stop_token.md] * stoken.stop_requested()[link /reference/stop_token/stop_token/stop_requested.md] -* t1.request_stop()[link request_stop.md] +* jt1.request_stop()[link request_stop.md] ### 出力例 diff --git a/reference/thread/jthread/op_destructor.md b/reference/thread/jthread/op_destructor.md index b48d5f2f49..479140cc04 100644 --- a/reference/thread/jthread/op_destructor.md +++ b/reference/thread/jthread/op_destructor.md @@ -51,13 +51,13 @@ int main() { // 関数の第1引数がstd::stop_token型である場合、 // スレッドに中断リクエストを送れるようになる - std::jthread t1 {f1, 1'000'000}; + std::jthread jt1 {f1, 1'000'000}; std::this_thread::sleep_for(std::chrono::milliseconds{3}); // スレッド実行する関数がstd::stop_tokenを受け取らない場合、 // 中断リクエストを使用せず、 // デストラクタで自動的にjoinするスレッドオブジェクトとして使用する - std::jthread t2 { + std::jthread jt2 { [] { f2(1'000'000); } }; } // jthreadのデストラクタでは、中断要求を発行し、スレッドの終了を待機する diff --git a/reference/thread/jthread/request_stop.md b/reference/thread/jthread/request_stop.md index 6afba0348d..2597d996d0 100644 --- a/reference/thread/jthread/request_stop.md +++ b/reference/thread/jthread/request_stop.md @@ -36,27 +36,28 @@ return ssource.request_stop(); int main() { - std::jthread t { + std::jthread jt { [](std::stop_token stoken) { while (!stoken.stop_requested()) { // 停止要求がくるまで処理を継続する… } - std::cout << "exit t1 thread" << std::endl; + std::cout << "exit jt thread" << std::endl; } }; // 停止要求を作成する - t.request_stop(); - t.join(); + jt.request_stop(); + jt.join(); } ``` * request_stop()[color ff0000] * std::stop_token[link /reference/stop_token/stop_token.md] * stop_requested()[link /reference/stop_token/stop_token/stop_requested.md] +* jt.join()[link join.md] ### 出力 ``` -exit t1 thread +exit jt thread ``` ## バージョン diff --git a/reference/thread/jthread/swap.md b/reference/thread/jthread/swap.md index 5243d3fc59..52a55ea9e1 100644 --- a/reference/thread/jthread/swap.md +++ b/reference/thread/jthread/swap.md @@ -27,12 +27,12 @@ void swap(jthread& x) noexcept; int main() { - std::jthread t1([]{ /*...*/ }); - std::jthread t2; + std::jthread jt1([]{ /*...*/ }); + std::jthread jt2; - t1.swap(t2); + jt1.swap(jt2); - t2.join(); + jt2.join(); return 0; } diff --git a/reference/thread/jthread/swap_free.md b/reference/thread/jthread/swap_free.md index 20cc700088..9288efc3ac 100644 --- a/reference/thread/jthread/swap_free.md +++ b/reference/thread/jthread/swap_free.md @@ -34,12 +34,12 @@ x.swap(y); int main() { - std::jthread t1([]{ /*...*/ }); - std::jthread t2; + std::jthread jt1([]{ /*...*/ }); + std::jthread jt2; - swap(t1, t2); + swap(jt1, jt2); - t2.join(); + jt2.join(); return 0; } From 99df1d9d9f81375fb132501f20a1b17ec9937110 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 9 Jul 2025 17:55:53 +0900 Subject: [PATCH 2153/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE?= =?UTF-8?q?=E9=A3=BE=E3=81=AE=E9=87=8D=E8=A4=87=E5=89=8A=E9=99=A4=E3=82=B9?= =?UTF-8?q?=E3=82=AF=E3=83=AA=E3=83=97=E3=83=88=20:=20initializer=5Flist?= =?UTF-8?q?=E3=81=AEstd::begin/end=E3=82=92=E5=89=8A=E9=99=A4=E5=AF=BE?= =?UTF-8?q?=E8=B1=A1=E5=A4=96=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/script/remove_duplicated_qualify.py | 2 ++ reference/initializer_list/initializer_list/end_free.md | 1 + 2 files changed, 3 insertions(+) diff --git a/.github/workflows/script/remove_duplicated_qualify.py b/.github/workflows/script/remove_duplicated_qualify.py index a4f9ae8daf..67d529760b 100644 --- a/.github/workflows/script/remove_duplicated_qualify.py +++ b/.github/workflows/script/remove_duplicated_qualify.py @@ -29,6 +29,8 @@ def load_global_qualify_patterns(): "* std::end[link valarray/end_free.md]", "* std::begin[link /reference/valarray/valarray/begin_free.md]", "* std::end[link /reference/valarray/valarray/end_free.md]", + "* std::begin[link /reference/initializer_list/initializer_list/begin_free.md]", + "* std::end[link /reference/initializer_list/initializer_list/end_free.md]", "* common_type_t[link /reference/chrono/common_type.md]", ] diff --git a/reference/initializer_list/initializer_list/end_free.md b/reference/initializer_list/initializer_list/end_free.md index b304f328d1..10033751ba 100644 --- a/reference/initializer_list/initializer_list/end_free.md +++ b/reference/initializer_list/initializer_list/end_free.md @@ -43,6 +43,7 @@ int main() } ``` * std::end[color ff0000] +* std::begin[link /reference/initializer_list/initializer_list/begin_free.md] ### 出力 ``` From a244c924ba7cf4f9e7a0f2a5067987e07a06a27a Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 9 Jul 2025 18:03:47 +0900 Subject: [PATCH 2154/3948] =?UTF-8?q?cstdio=20:=20C++=E3=81=AEC=E4=BA=92?= =?UTF-8?q?=E6=8F=9B=E3=83=A9=E3=82=A4=E3=83=96=E3=83=A9=E3=83=AA=E3=81=AE?= =?UTF-8?q?=E9=96=A2=E6=95=B0=E3=81=AFstd=E5=90=8D=E5=89=8D=E7=A9=BA?= =?UTF-8?q?=E9=96=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdio/fclose.md | 4 +++- reference/cstdio/feof.md | 4 +++- reference/cstdio/fflush.md | 4 +++- reference/cstdio/fgetc.md | 4 +++- reference/cstdio/fgets.md | 4 +++- reference/cstdio/fopen.md | 4 +++- reference/cstdio/fprintf.md | 4 +++- reference/cstdio/fputc.md | 4 +++- reference/cstdio/fputs.md | 4 +++- reference/cstdio/fscanf.md | 4 +++- reference/cstdio/remove.md | 4 +++- reference/cstdio/rename.md | 4 +++- reference/cstdio/tmpfile.md | 4 +++- reference/cstdio/tmpnam.md | 4 +++- 14 files changed, 42 insertions(+), 14 deletions(-) diff --git a/reference/cstdio/fclose.md b/reference/cstdio/fclose.md index e9f07484f0..3f71ddac47 100644 --- a/reference/cstdio/fclose.md +++ b/reference/cstdio/fclose.md @@ -4,7 +4,9 @@ * function[meta id-type] ```cpp -int fclose(FILE* stream); +namespace std { + int fclose(FILE* stream); +} ``` ## 概要 diff --git a/reference/cstdio/feof.md b/reference/cstdio/feof.md index 1b3cab092a..feba458069 100644 --- a/reference/cstdio/feof.md +++ b/reference/cstdio/feof.md @@ -4,7 +4,9 @@ * function[meta id-type] ```cpp -int feof(FILE* stream); +namespace std { + int feof(FILE* stream); +} ``` ## 概要 diff --git a/reference/cstdio/fflush.md b/reference/cstdio/fflush.md index 1f6776dc92..3fefb2dbc8 100644 --- a/reference/cstdio/fflush.md +++ b/reference/cstdio/fflush.md @@ -4,7 +4,9 @@ * function[meta id-type] ```cpp -int fflush(FILE* stream); +namespace std { + int fflush(FILE* stream); +} ``` ## 概要 diff --git a/reference/cstdio/fgetc.md b/reference/cstdio/fgetc.md index 85a12b8a78..65abda0fcf 100644 --- a/reference/cstdio/fgetc.md +++ b/reference/cstdio/fgetc.md @@ -4,7 +4,9 @@ * function[meta id-type] ```cpp -int fgetc( FILE* stream ); +namespace std { + int fgetc( FILE* stream ); +} ``` ## 概要 diff --git a/reference/cstdio/fgets.md b/reference/cstdio/fgets.md index cb98ca8cb1..77869a8f5d 100644 --- a/reference/cstdio/fgets.md +++ b/reference/cstdio/fgets.md @@ -4,7 +4,9 @@ * function[meta id-type] ```cpp -char* fgets( char* restrict str, int count, FILE* restrict stream ); +namespace std { + char* fgets( char* restrict str, int count, FILE* restrict stream ); +} ``` ## 概要 diff --git a/reference/cstdio/fopen.md b/reference/cstdio/fopen.md index 9c5c872c3e..d25f07930f 100644 --- a/reference/cstdio/fopen.md +++ b/reference/cstdio/fopen.md @@ -4,7 +4,9 @@ * function[meta id-type] ```cpp -FILE* fopen(const char* filename, const char* mode); +namespace std { + FILE* fopen(const char* filename, const char* mode); +} ``` ## 概要 diff --git a/reference/cstdio/fprintf.md b/reference/cstdio/fprintf.md index 8c3a0b67f1..59ac1381e2 100644 --- a/reference/cstdio/fprintf.md +++ b/reference/cstdio/fprintf.md @@ -4,7 +4,9 @@ * function[meta id-type] ```cpp -int fprintf( FILE* restrict stream, const char* restrict format, ... ); +namespace std { + int fprintf( FILE* restrict stream, const char* restrict format, ... ); +} ``` ## 概要 diff --git a/reference/cstdio/fputc.md b/reference/cstdio/fputc.md index d775cfc7f7..e9a51ec147 100644 --- a/reference/cstdio/fputc.md +++ b/reference/cstdio/fputc.md @@ -4,7 +4,9 @@ * function[meta id-type] ```cpp -int fputc( int ch, FILE* stream ); +namespace std { + int fputc( int ch, FILE* stream ); +} ``` ## 概要 diff --git a/reference/cstdio/fputs.md b/reference/cstdio/fputs.md index b2f52bea8b..1b0c445fbb 100644 --- a/reference/cstdio/fputs.md +++ b/reference/cstdio/fputs.md @@ -4,7 +4,9 @@ * function[meta id-type] ```cpp -int fputs(const char* str, FILE* stream); +namespace std { + int fputs(const char* str, FILE* stream); +} ``` ## 概要 diff --git a/reference/cstdio/fscanf.md b/reference/cstdio/fscanf.md index 852599ef4f..56ba19c022 100644 --- a/reference/cstdio/fscanf.md +++ b/reference/cstdio/fscanf.md @@ -4,7 +4,9 @@ * function[meta id-type] ```cpp -int fscanf( FILE* restrict stream, const char* restrict format, ... ); +namespace std { + int fscanf( FILE* restrict stream, const char* restrict format, ... ); +} ``` ## 概要 diff --git a/reference/cstdio/remove.md b/reference/cstdio/remove.md index 51846b5464..803b50c29e 100644 --- a/reference/cstdio/remove.md +++ b/reference/cstdio/remove.md @@ -4,7 +4,9 @@ * function[meta id-type] ```cpp -int remove( const char* pathname ); +namespace std { + int remove( const char* pathname ); +} ``` ## 概要 diff --git a/reference/cstdio/rename.md b/reference/cstdio/rename.md index b45dff6680..67114d75dc 100644 --- a/reference/cstdio/rename.md +++ b/reference/cstdio/rename.md @@ -4,7 +4,9 @@ * function[meta id-type] ```cpp -int rename( const char* old_filename, const char* new_filename ); +namespace std { + int rename( const char* old_filename, const char* new_filename ); +} ``` ## 概要 diff --git a/reference/cstdio/tmpfile.md b/reference/cstdio/tmpfile.md index 6ca0c6edba..c01f298e74 100644 --- a/reference/cstdio/tmpfile.md +++ b/reference/cstdio/tmpfile.md @@ -4,7 +4,9 @@ * function[meta id-type] ```cpp -std::FILE* tmpfile(); +namespace std { + std::FILE* tmpfile(); +} ``` ## 概要 diff --git a/reference/cstdio/tmpnam.md b/reference/cstdio/tmpnam.md index ba97e0f2b0..95dd293699 100644 --- a/reference/cstdio/tmpnam.md +++ b/reference/cstdio/tmpnam.md @@ -4,7 +4,9 @@ * function[meta id-type] ```cpp -char* tmpnam( char* filename ); +namespace std { + char* tmpnam( char* filename ); +} ``` ## 概要 From ef4e148c12f41566e1a169eafb389a8927c7e56c Mon Sep 17 00:00:00 2001 From: suomesta Date: Wed, 9 Jul 2025 20:01:32 +0900 Subject: [PATCH 2155/3948] add throw() to bad_typeid functions in C++03 --- reference/typeinfo/bad_typeid/op_assign.md | 2 +- reference/typeinfo/bad_typeid/op_constructor.md | 4 ++-- reference/typeinfo/bad_typeid/what.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/typeinfo/bad_typeid/op_assign.md b/reference/typeinfo/bad_typeid/op_assign.md index 7b079b9cfc..2201791dbb 100644 --- a/reference/typeinfo/bad_typeid/op_assign.md +++ b/reference/typeinfo/bad_typeid/op_assign.md @@ -5,7 +5,7 @@ * function[meta id-type] ```cpp -bad_typeid& operator=(const bad_typeid&); // (1) C++03 +bad_typeid& operator=(const bad_typeid&) throw(); // (1) C++03 bad_typeid& operator=(const bad_typeid&) noexcept; // (1) C++11 constexpr bad_typeid& operator=(const bad_typeid&) noexcept; // (1) C++26 ``` diff --git a/reference/typeinfo/bad_typeid/op_constructor.md b/reference/typeinfo/bad_typeid/op_constructor.md index 57f93675b0..5267ac55d6 100644 --- a/reference/typeinfo/bad_typeid/op_constructor.md +++ b/reference/typeinfo/bad_typeid/op_constructor.md @@ -5,11 +5,11 @@ * function[meta id-type] ```cpp -bad_typeid(); // (1) C++03 +bad_typeid() throw(); // (1) C++03 bad_typeid() noexcept; // (1) C++11 constexpr bad_typeid() noexcept; // (1) C++26 -bad_typeid(const bad_typeid&); // (2) C++03 +bad_typeid(const bad_typeid&) throw(); // (2) C++03 bad_typeid(const bad_typeid&) noexcept; // (2) C++11 constexpr bad_typeid(const bad_typeid&) noexcept; // (2) C++26 ``` diff --git a/reference/typeinfo/bad_typeid/what.md b/reference/typeinfo/bad_typeid/what.md index d19231428d..7ed42d3335 100644 --- a/reference/typeinfo/bad_typeid/what.md +++ b/reference/typeinfo/bad_typeid/what.md @@ -5,7 +5,7 @@ * function[meta id-type] ```cpp -virtual const char* what() const; // (1) C++03 +virtual const char* what() const throw(); // (1) C++03 virtual const char* what() const noexcept; // (1) C++11 const char* what() const noexcept override; // (1) C++17 constexpr const char* what() const noexcept override; // (1) C++26 From 68aec4c8c9808ad6f7c83d0eaf4290930f2d93bf Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Wed, 9 Jul 2025 19:59:06 +0900 Subject: [PATCH 2156/3948] =?UTF-8?q?fix(reference/cstdlib/calloc):=20?= =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/calloc.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/reference/cstdlib/calloc.md b/reference/cstdlib/calloc.md index 8349851074..b87ab7a67c 100644 --- a/reference/cstdlib/calloc.md +++ b/reference/cstdlib/calloc.md @@ -25,7 +25,6 @@ namespace std { ## 備考 - `calloc`・`malloc`・`realloc` によって複数個の異なる領域が確保された場合、それらの連続性や順序は保証されない。 - - メモリリークを避けるため、この関数で確保したメモリは、`free`などを使い、メモリ解放するべきである。 ## 例 @@ -67,4 +66,4 @@ p2[3] == 0 ## 参照 --[7.20.3 Memory management functions]("https://www.dii.uchile.cl/~daespino/files/Iso_C_1999_definition.pdf") +- [7.20.3 Memory management functions](https://www.dii.uchile.cl/~daespino/files/Iso_C_1999_definition.pdf) [PDF] From fdf806422d0b92894586126d2d753b8005dffb50 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Wed, 9 Jul 2025 20:00:21 +0900 Subject: [PATCH 2157/3948] =?UTF-8?q?fix(reference/cstdlib/system):=20?= =?UTF-8?q?=E8=A8=B3=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/system.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/reference/cstdlib/system.md b/reference/cstdlib/system.md index 6fd9827354..e47491bc4f 100644 --- a/reference/cstdlib/system.md +++ b/reference/cstdlib/system.md @@ -11,15 +11,17 @@ namespace std { ## 概要 -ホスト環境のコマンド呼び出す。(e.g. `/bin/sh`, `cmd.exe`) +ホスト環境のコマンドを呼び出す。(e.g. `/bin/sh`, `cmd.exe`) -基本の返り値はコマンドの実行結果。 +処理系定義の値を返す。大抵は呼び出されたコマンドが返した終了ステータスになる。 -コマンドがヌルポインタの場合、ホスト環境にコマンドプロセッサが存在するか確認し、存在している場合のみに非ゼロ値を返す。 +コマンドがヌルポインタの場合、ホスト環境にコマンドプロセッサが存在するか確認し、存在している場合に非ゼロ値を返す。 ## 備考 -POSIXでは`WEXITSTATUS`と`WSTOPSIG`を使用、分解できる +POSIXではマクロ`WEXITSTATUS`と`WSTOPSIG`を使用して戻り値を分解できる。 +`WEXITSTATUS(戻り値)` は子プロセスが正常に終了した場合に非ゼロ値を返す。 +`WSTOPSIG(戻り値)` は子プロセスを停止したシグナル番号を評価する。 生成されるプロセスが画面の入出力を伴う場合、`std::system`を呼び出す前に、`std::cout`の明示的なフラッシュが必要になる場合がある。 @@ -32,12 +34,12 @@ POSIXでは`WEXITSTATUS`と`WSTOPSIG`を使用、分解できる int main() { - std::system("ls -l >test.txt");//"ls -l >test.txt"を実行 + std::system("ls -l >test.txt"); // "ls -l >test.txt"を実行 std::cout << std::ifstream("test.txt").rdbuf(); } ``` -## 出力結果 +## 出力例 ``` total 16 @@ -48,8 +50,6 @@ total 16 ## 関連項目 -| 名前 | 説明 | -|------|------| -|[`flush`](../ostream/flush.md)|バッファをフラッシュする| -| [`WEXITSTATUS`]() | 子プロセスが正常に終了した場合、非ゼロ値を返す | -| [`WSTOPSIG`]() | 子プロセスを停止したシグナル数を評価する | +| 名前 | 説明 | +|--------------------------------|--------------------------------------------------------| +| [`flush`](../ostream/flush.md) | バッファをフラッシュする | From 403a76f3a5f42fbc761befd081b5d57d9277f837 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Wed, 9 Jul 2025 20:16:19 +0900 Subject: [PATCH 2158/3948] =?UTF-8?q?fix(reference/cstdlib/{calloc,atoi,ma?= =?UTF-8?q?lloc}):=20=E5=8F=82=E7=85=A7=E6=96=87=E7=8C=AE=E5=90=8D?= =?UTF-8?q?=E3=81=AE=E6=98=8E=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/atoi_atol_atoll.md | 10 +++++----- reference/cstdlib/calloc.md | 2 +- reference/cstdlib/malloc.md | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/reference/cstdlib/atoi_atol_atoll.md b/reference/cstdlib/atoi_atol_atoll.md index 114b1c79f0..9161aaaf44 100644 --- a/reference/cstdlib/atoi_atol_atoll.md +++ b/reference/cstdlib/atoi_atol_atoll.md @@ -70,8 +70,8 @@ int main(void) それぞれ`std::string` および `std::wstring` に対応させたものと見なせる。 ## 参照 -- [7.22.1.2 The atoi, atol, and atoll functions](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3220.pdf) -- [7.22.1.2 The atoi, atol, and atoll functions (p: 249)](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2310.pdf) -- [7.22.1.2 The atoi, atol, and atoll functions (p: 341)](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1548.pdf) -- [7.20.1.2 The atoi, atol, and atoll functions (p: 307)](https://www.dii.uchile.cl/~daespino/files/Iso_C_1999_definition.pdf) -- [4.10.1.2 The atoi function](https://www.dii.uchile.cl/~daespino/files/Iso_C_1999_definition.pdf) +- [C N3220: 7.22.1.2 The atoi, atol, and atoll functions](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3220.pdf) +- [C N2310: 7.22.1.2 The atoi, atol, and atoll functions (p: 249)](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2310.pdf) +- [C N1548: 7.22.1.2 The atoi, atol, and atoll functions (p: 341)](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1548.pdf) +- [C99: 7.20.1.2 The atoi, atol, and atoll functions (p: 307)](https://www.dii.uchile.cl/~daespino/files/Iso_C_1999_definition.pdf) +- [C99: 4.10.1.2 The atoi function](https://www.dii.uchile.cl/~daespino/files/Iso_C_1999_definition.pdf) diff --git a/reference/cstdlib/calloc.md b/reference/cstdlib/calloc.md index b87ab7a67c..215d34994f 100644 --- a/reference/cstdlib/calloc.md +++ b/reference/cstdlib/calloc.md @@ -66,4 +66,4 @@ p2[3] == 0 ## 参照 -- [7.20.3 Memory management functions](https://www.dii.uchile.cl/~daespino/files/Iso_C_1999_definition.pdf) [PDF] +- [C99: 7.20.3 Memory management functions](https://www.dii.uchile.cl/~daespino/files/Iso_C_1999_definition.pdf) [PDF] diff --git a/reference/cstdlib/malloc.md b/reference/cstdlib/malloc.md index 6820bc78f5..21a7221dbb 100644 --- a/reference/cstdlib/malloc.md +++ b/reference/cstdlib/malloc.md @@ -74,4 +74,4 @@ p1[3] == 9 ## 参照 -- [7.22.3 Memory management functions](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2310.pdf) +- [C N2310: 7.22.3 Memory management functions](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2310.pdf) From 5e17cc545f07471f4c790b223d3aa7006c1e4d1b Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Wed, 9 Jul 2025 20:18:31 +0900 Subject: [PATCH 2159/3948] =?UTF-8?q?fix(reference/cstdlib/{calloc,atoi}):?= =?UTF-8?q?=20=E3=83=AA=E3=83=B3=E3=82=AF=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/atoi_atol_atoll.md | 4 ++-- reference/cstdlib/calloc.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/cstdlib/atoi_atol_atoll.md b/reference/cstdlib/atoi_atol_atoll.md index 9161aaaf44..8db513d2ea 100644 --- a/reference/cstdlib/atoi_atol_atoll.md +++ b/reference/cstdlib/atoi_atol_atoll.md @@ -73,5 +73,5 @@ int main(void) - [C N3220: 7.22.1.2 The atoi, atol, and atoll functions](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3220.pdf) - [C N2310: 7.22.1.2 The atoi, atol, and atoll functions (p: 249)](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2310.pdf) - [C N1548: 7.22.1.2 The atoi, atol, and atoll functions (p: 341)](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1548.pdf) -- [C99: 7.20.1.2 The atoi, atol, and atoll functions (p: 307)](https://www.dii.uchile.cl/~daespino/files/Iso_C_1999_definition.pdf) -- [C99: 4.10.1.2 The atoi function](https://www.dii.uchile.cl/~daespino/files/Iso_C_1999_definition.pdf) +- C99: 7.20.1.2 The atoi, atol, and atoll functions (p: 307) +- C99: 4.10.1.2 The atoi function diff --git a/reference/cstdlib/calloc.md b/reference/cstdlib/calloc.md index 215d34994f..eb60a7016d 100644 --- a/reference/cstdlib/calloc.md +++ b/reference/cstdlib/calloc.md @@ -66,4 +66,4 @@ p2[3] == 0 ## 参照 -- [C99: 7.20.3 Memory management functions](https://www.dii.uchile.cl/~daespino/files/Iso_C_1999_definition.pdf) [PDF] +- C99: 7.20.3 Memory management functions From a1063063b08fb020bfb98780f8f8a70c7b4bd864 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Wed, 9 Jul 2025 20:28:40 +0900 Subject: [PATCH 2160/3948] =?UTF-8?q?fix(reference/cstdlib/atoi):=20C99=20?= =?UTF-8?q?=E3=81=8C=E3=83=AA=E3=83=B3=E3=82=AF=E3=81=95=E3=82=8C=E3=81=A6?= =?UTF-8?q?=E3=81=84=E3=81=9F=E3=81=8C=204.10.1.2=20=E3=81=AF=20C90=20?= =?UTF-8?q?=E3=81=AE=E7=AF=80=E7=95=AA=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/atoi_atol_atoll.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdlib/atoi_atol_atoll.md b/reference/cstdlib/atoi_atol_atoll.md index 8db513d2ea..9e43b155f8 100644 --- a/reference/cstdlib/atoi_atol_atoll.md +++ b/reference/cstdlib/atoi_atol_atoll.md @@ -74,4 +74,4 @@ int main(void) - [C N2310: 7.22.1.2 The atoi, atol, and atoll functions (p: 249)](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2310.pdf) - [C N1548: 7.22.1.2 The atoi, atol, and atoll functions (p: 341)](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1548.pdf) - C99: 7.20.1.2 The atoi, atol, and atoll functions (p: 307) -- C99: 4.10.1.2 The atoi function +- C90: 4.10.1.2 The atoi function From b3bdbe326cedaa4e50584f0b88e594abf8f577e0 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Wed, 9 Jul 2025 20:30:38 +0900 Subject: [PATCH 2161/3948] =?UTF-8?q?style:=20"=E8=BF=94=E3=82=8A=E5=80=A4?= =?UTF-8?q?"=20=E2=86=92=20"=E6=88=BB=E3=82=8A=E5=80=A4"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26/contracts.md | 2 +- reference/cstdlib/atof.md | 2 +- reference/cstdlib/getenv.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lang/cpp26/contracts.md b/lang/cpp26/contracts.md index 0d82b64e65..e2e57725f6 100644 --- a/lang/cpp26/contracts.md +++ b/lang/cpp26/contracts.md @@ -78,7 +78,7 @@ int increment(int x) ``` ここでは、`increment`関数の戻り値が`x + 1`であることを事後条件として指定している。 -`post`では、返り値を`r`としてバインドし、条件式内で利用している。ここには、任意の変数名が使用できる。変数は定数(`const`)な左辺値参照である。 +`post`では、戻り値を`r`としてバインドし、条件式内で利用している。ここには、任意の変数名が使用できる。変数は定数(`const`)な左辺値参照である。 事後条件の結果名導入子(result-name-introducer)は省略可能である。特に、`void`を返す関数では、戻り値を参照する必要がない場合に省略できる。 diff --git a/reference/cstdlib/atof.md b/reference/cstdlib/atof.md index 8a2a2d64dd..4a54ad8b05 100644 --- a/reference/cstdlib/atof.md +++ b/reference/cstdlib/atof.md @@ -23,7 +23,7 @@ namespace std { - NAN(大小文字区別せず)はそれ以前の数値を返す。もし以前の数値がないなら、`nan`を返す。 -## 返り値 +## 戻り値 変換可能ならば変換後の数値。 diff --git a/reference/cstdlib/getenv.md b/reference/cstdlib/getenv.md index f99577bb66..971676c03a 100644 --- a/reference/cstdlib/getenv.md +++ b/reference/cstdlib/getenv.md @@ -13,7 +13,7 @@ namespace std { ホスト環境(OS)が提供する環境リストから、Cストリング`env_var`と一致する文字列を検索、一致したもののポインタを返す -## 返り値 +## 戻り値 一致したものがあれば環境変数を保持した文字列、なければヌルポインタを返す From 8f1f2246526ec4482bff42340c870a034c58df11 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Wed, 9 Jul 2025 18:30:21 +0900 Subject: [PATCH 2162/3948] =?UTF-8?q?chore(workflows/preview=5Flink):=20?= =?UTF-8?q?=E5=A4=89=E6=9B=B4=E4=B8=80=E8=A6=A7=E3=81=AE=E4=BB=B6=E6=95=B0?= =?UTF-8?q?=E3=82=92=E5=88=B6=E9=99=90=E3=81=97=E3=80=81=E5=A4=89=E6=9B=B4?= =?UTF-8?q?=E4=B8=80=E8=A6=A7=E3=83=9A=E3=83=BC=E3=82=B8=E3=82=92=E5=88=A5?= =?UTF-8?q?=E3=81=AB=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 30 +++++++++++++++ .github/workflows/check.yml | 31 ++++++++++++++- .github/workflows/script/build.sh | 63 +++++++++++++++++++++++++++++-- 3 files changed, 119 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 53df02f0ec..7f8794317f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -110,10 +110,40 @@ jobs: repository: ${{ github.event.pull_request.base.repo.full_name }} ref: gh-pages path: site_generator/cpprefjp/gh-pages + - name: "(Preview build) Collect GitHub context" + id: preview_vars + if: startsWith(inputs.arguments, '--pull ') + uses: actions/github-script@v7 + with: + script: | + const sha0 = context.payload.pull_request.base.sha; + const sha = context.payload.pull_request.head.sha; + const base_url = (() => { + const owner = context.payload.pull_request.base.repo.owner.login; + const repo = context.payload.pull_request.base.repo.name; + const pull = context.payload.number; + return `https://${owner}.github.io/${repo}/gen/pull/${pull}`; + })(); + const repo_full = context.payload.pull_request.base.repo.full_name; + const branch = context.payload.pull_request.head.ref; + + core.setOutput('sha0', sha0); + core.setOutput('sha', sha); + core.setOutput('base_url', base_url); + core.setOutput('repo_full', repo_full); + core.setOutput('ubranch', encodeURIComponent(branch)); # あとはスクリプトで頑張る - name: Run script build.sh run: ../.trusted/.github/workflows/script/build.sh ${{ inputs.arguments }} + env: + base_git_url: ${{ github.event.pull_request.base.repo.clone_url }} + base_git_ref: ${{ github.event.pull_request.base.ref }} + commit_base: ${{ steps.preview_vars.outputs.sha0 }} + commit_head: ${{ steps.preview_vars.outputs.sha }} + preview_base_url: ${{ steps.preview_vars.outputs.base_url }} + preview_repo_url: https://github.com/${{ steps.preview_vars.outputs.repo_full }} + preview_ubranch: ${{ steps.preview_vars.outputs.ubranch }} working-directory: site_generator # Preview 用 diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 7f77520fc3..9775adaa6f 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -116,11 +116,16 @@ jobs: core.setOutput('ubranch', encodeURIComponent(branch)); core.setOutput('time', time); - - id: file_list + - name: Run script to generate a Markdown list of changed files + id: file_list shell: bash run: | set -ex + # config + threshold_nitem=100 # コメントの変更ファイル一覧内の最大ファイル数 + threshold_details=20 #

を使って折りたたむ閾値 + git remote add base '${{ github.event.pull_request.base.repo.clone_url }}' git fetch base '${{ github.event.pull_request.base.ref }}' content=$( @@ -141,6 +146,30 @@ jobs: ' ) [[ $content ]] || content='- (内容変更された `.md` ファイルはありません)' + nitem=$(wc -l <<< "$content") + if ((nitem > threshold_nitem)); then + content=$nitem'件のファイルが変更されました。一部を表示しています。完全なリストについては[こちら](${{ steps.vars.outputs.base_url }}/PREVIEW.html)をご参照ください。 +
(変更ファイル一覧) + + '$(head -n "$((threshold_nitem-1))" <<< "$content")' + - … (以下省略) + +
' + + elif ((nitem > threshold_details)); then + content=$nitem'件のファイルが変更されました。 +
(変更ファイル一覧) + + '$content' + +
' + + else + content=$nitem'件のファイルが変更されました。 + + '$content + + fi echo 'content<> "$GITHUB_OUTPUT" echo "$content" >> "$GITHUB_OUTPUT" echo 'EOF' >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/script/build.sh b/.github/workflows/script/build.sh index a092f7da98..a723603517 100755 --- a/.github/workflows/script/build.sh +++ b/.github/workflows/script/build.sh @@ -38,7 +38,7 @@ if (($# == 0)); then pushd cpprefjp/cpprefjp.github.io # push するために ssh のリモートを追加する git remote add origin2 git@github.com:cpprefjp/cpprefjp.github.io.git - + git add ./ --all git config --global user.email "shigemasa7watanabe+cpprefjp@gmail.com" git config --global user.name "cpprefjp-autoupdate" @@ -47,8 +47,23 @@ if (($# == 0)); then popd elif [[ $1 == --pull ]]; then - if [[ ! $2 ]]; then - printf '%s\n' "build.sh: プルリクエスト番号が指定されていません" >&2 + if (($# < 2)); then + printf '%s\n' \ + 'build.sh: 引数の数が足りません。' \ + 'usage: build.sh --pull PR' \ + '引数' \ + ' PR プルリクエスト番号' \ + '' \ + '環境変数' \ + ' base_git_url: プルリクエスト先(基底)の fetch URL' \ + ' base_git_ref: プルリクエスト先(基底)のブランチ名参照' \ + ' commit_base プルリクエストの基底コミット' \ + ' commit_head プルリクエストの先端コミット' \ + ' preview_base_url プレビューの基底URL' \ + ' preview_repo_url 基底リポジトリの URL (https://github.com/cpprefjp/site 等)' \ + ' preview_ubranch URLエンコードされたブランチ名' \ + '' \ + >&2 exit 2 fi @@ -57,8 +72,48 @@ elif [[ $1 == --pull ]]; then mkdir -p "$target_directory" cp -r cpprefjp/cpprefjp.github.io/* "$target_directory"/ + # 変更ファイル一覧のページを作成する + ( + cd cpprefjp/site + pr=$2 + time=$(TZ=Asia/Tokyo date +'%F %T %Z') + + # 基底ブランチに新しいコミットがある場合のため、基底リポジトリから取り寄せる + git remote add base "$base_git_url" + git fetch base "$base_git_ref" + + echo "# PR [\#$pr]($preview_repo_url/pull/$pr) プレビュー" + echo "- ⌚ 更新時刻: $time" + echo "- 🔍 [プレビュー (HTML)]($preview_base_url)" + echo "- 📈 [プレビュー生成記録]($preview_repo_url/actions?query=event%3Apull_request_target+branch%3A$preview_ubranch)" + echo "- **⫯** ソースの変更: [\`${commit_base::7}..${commit_head::7}\`]($preview_repo_url/compare/$commit_base..$commit_head)" + echo + echo "## 変更記事一覧" + echo + content=$( + git diff --name-status --diff-filter=dr "$commit_base" "$commit_head" | + sed -n ' + # normalize the line format + s/^[[:space:]]*\([^[:space:]]\{1,\}\)[[:space:]]\{1,\}/\1 / + + # exclude filenames containing special characters that may break Markdown + /[][`()]/d + + # exclude README.md + /^[^[:space:]]* README\.md$/d + + # generate list items + s|^A \(.*\)\.md$|- \📝 [`\1`]('"$preview_base_url"'/\1.html) \✨|p + s|^[^[:space:]]* \(.*\)\.md$|- \📝 [`\1`]('"$preview_base_url"'/\1.html)|p + ' + ) + [[ $content ]] || content='- (内容変更された `.md` ファイルはありません)' + echo "$content" + + ) > "$target_directory"/PREVIEW.md + else printf '%s\n' "build.sh: コマンドライン引数が認識できません: $1" >&2 exit 2 - + fi From d32a312e043230b077387ab02febcde0b8bc8617 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Wed, 9 Jul 2025 22:42:59 +0900 Subject: [PATCH 2163/3948] =?UTF-8?q?chore(workflows/preview=5Flink):=20gi?= =?UTF-8?q?thub.event.pull=5Frequest.base=20=E3=81=8C=E7=A9=BA=E3=81=AE?= =?UTF-8?q?=E6=99=82=E3=81=AE=E5=AF=BE=E7=AD=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/script/build.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/script/build.sh b/.github/workflows/script/build.sh index a723603517..48f0ad9b01 100755 --- a/.github/workflows/script/build.sh +++ b/.github/workflows/script/build.sh @@ -79,8 +79,12 @@ elif [[ $1 == --pull ]]; then time=$(TZ=Asia/Tokyo date +'%F %T %Z') # 基底ブランチに新しいコミットがある場合のため、基底リポジトリから取り寄せる - git remote add base "$base_git_url" - git fetch base "$base_git_ref" + if [[ $base_git_url && $base_git_ref ]]; then + # 手動でトリガーした時は github.event.pull_request.base が空のことがある? + # なので非空の時にのみ実行 + git remote add base "$base_git_url" + git fetch base "$base_git_ref" + fi echo "# PR [\#$pr]($preview_repo_url/pull/$pr) プレビュー" echo "- ⌚ 更新時刻: $time" From 050022202bb8f76ba26617884b31537e3044c1d6 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Wed, 9 Jul 2025 23:05:13 +0900 Subject: [PATCH 2164/3948] =?UTF-8?q?chore(workflows/preview=5Flink):=20?= =?UTF-8?q?=E8=A1=A8=E7=A4=BA=E4=BB=B6=E6=95=B0=E4=B8=8A=E9=99=90=E3=82=92?= =?UTF-8?q?100=E3=81=8B=E3=82=8950=E3=81=AB=E5=89=8A=E6=B8=9B=E3=80=81?= =?UTF-8?q?=E4=BB=96=E4=BD=93=E8=A3=81=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/check.yml | 12 ++++++------ .github/workflows/script/build.sh | 18 ++++++++++-------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 9775adaa6f..37203b509b 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -123,7 +123,7 @@ jobs: set -ex # config - threshold_nitem=100 # コメントの変更ファイル一覧内の最大ファイル数 + threshold_nitem=50 # コメントの変更記事一覧内の最大ファイル数 threshold_details=20 #
を使って折りたたむ閾値 git remote add base '${{ github.event.pull_request.base.repo.clone_url }}' @@ -148,8 +148,8 @@ jobs: [[ $content ]] || content='- (内容変更された `.md` ファイルはありません)' nitem=$(wc -l <<< "$content") if ((nitem > threshold_nitem)); then - content=$nitem'件のファイルが変更されました。一部を表示しています。完全なリストについては[こちら](${{ steps.vars.outputs.base_url }}/PREVIEW.html)をご参照ください。 -
(変更ファイル一覧) + content=$nitem'件の記事が変更されました。一部を表示しています。完全なリストについては[こちら](${{ steps.vars.outputs.base_url }}/PREVIEW.html)をご参照ください。 +
(ファイル一覧) '$(head -n "$((threshold_nitem-1))" <<< "$content")' - … (以下省略) @@ -157,15 +157,15 @@ jobs:
' elif ((nitem > threshold_details)); then - content=$nitem'件のファイルが変更されました。 -
(変更ファイル一覧) + content=$nitem'件の記事が変更されました。 +
(ファイル一覧) '$content'
' else - content=$nitem'件のファイルが変更されました。 + content=$nitem'件の記事が変更されました。 '$content diff --git a/.github/workflows/script/build.sh b/.github/workflows/script/build.sh index 48f0ad9b01..5a568424fb 100755 --- a/.github/workflows/script/build.sh +++ b/.github/workflows/script/build.sh @@ -86,14 +86,6 @@ elif [[ $1 == --pull ]]; then git fetch base "$base_git_ref" fi - echo "# PR [\#$pr]($preview_repo_url/pull/$pr) プレビュー" - echo "- ⌚ 更新時刻: $time" - echo "- 🔍 [プレビュー (HTML)]($preview_base_url)" - echo "- 📈 [プレビュー生成記録]($preview_repo_url/actions?query=event%3Apull_request_target+branch%3A$preview_ubranch)" - echo "- **⫯** ソースの変更: [\`${commit_base::7}..${commit_head::7}\`]($preview_repo_url/compare/$commit_base..$commit_head)" - echo - echo "## 変更記事一覧" - echo content=$( git diff --name-status --diff-filter=dr "$commit_base" "$commit_head" | sed -n ' @@ -111,7 +103,17 @@ elif [[ $1 == --pull ]]; then s|^[^[:space:]]* \(.*\)\.md$|- \📝 [`\1`]('"$preview_base_url"'/\1.html)|p ' ) + nitem=$(wc -l <<< "$content") [[ $content ]] || content='- (内容変更された `.md` ファイルはありません)' + + echo "# PR [\#$pr]($preview_repo_url/pull/$pr) プレビュー" + echo "- ⌚ 更新時刻: $time" + echo "- 🔍 [プレビュー (HTML)]($preview_base_url)" + echo "- 📈 [プレビュー生成記録]($preview_repo_url/actions?query=event%3Apull_request_target+branch%3A$preview_ubranch)" + echo "- **⫯** ソースの変更: [\`${commit_base::7}..${commit_head::7}\`]($preview_repo_url/compare/$commit_base..$commit_head)" + echo + echo "## 変更記事一覧 (${nitem}件)" + echo echo "$content" ) > "$target_directory"/PREVIEW.md From 0c815fe5fd5d85c41f706d7b97b91542047dbe6d Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Wed, 9 Jul 2025 23:17:26 +0900 Subject: [PATCH 2165/3948] =?UTF-8?q?chore(workflows/preview=5Flink):=20CI?= =?UTF-8?q?=E3=83=AD=E3=82=B0=E3=82=92=E6=B1=9A=E3=81=95=E3=81=AA=E3=81=84?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB=E8=A1=A8=E7=A4=BA=E4=BB=B6=E6=95=B0?= =?UTF-8?q?=E3=82=92=E6=97=A9=E3=82=81=E3=81=AB=E5=88=B6=E9=99=90=20(?= =?UTF-8?q?=E4=B8=8A=E9=99=90=E3=81=AF100=E3=81=AB=E6=88=BB=E3=81=99)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 37203b509b..b09d4ddfbb 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -123,7 +123,7 @@ jobs: set -ex # config - threshold_nitem=50 # コメントの変更記事一覧内の最大ファイル数 + threshold_nitem=100 # コメントの変更記事一覧内の最大ファイル数 threshold_details=20 #
を使って折りたたむ閾値 git remote add base '${{ github.event.pull_request.base.repo.clone_url }}' @@ -143,7 +143,7 @@ jobs: # generate list items s|^A \(.*\)\.md$|- :memo: [`\1`](${{ steps.vars.outputs.base_url }}/\1.html) :sparkles:|p s|^[^[:space:]]* \(.*\)\.md$|- :memo: [`\1`](${{ steps.vars.outputs.base_url }}/\1.html)|p - ' + ' | head -n "$((threshold_nitem + 1))" ) [[ $content ]] || content='- (内容変更された `.md` ファイルはありません)' nitem=$(wc -l <<< "$content") From be1a7c316854fe0163d4a62ad55806b6847bf383 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Thu, 10 Jul 2025 00:07:47 +0900 Subject: [PATCH 2166/3948] =?UTF-8?q?chore(workflows/preview=5Flink):=20?= =?UTF-8?q?=E3=83=91=E3=82=A4=E3=83=97=E3=82=A8=E3=83=A9=E3=83=BC=E5=AF=BE?= =?UTF-8?q?=E7=AD=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/check.yml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index b09d4ddfbb..2fefb8d717 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -143,35 +143,39 @@ jobs: # generate list items s|^A \(.*\)\.md$|- :memo: [`\1`](${{ steps.vars.outputs.base_url }}/\1.html) :sparkles:|p s|^[^[:space:]]* \(.*\)\.md$|- :memo: [`\1`](${{ steps.vars.outputs.base_url }}/\1.html)|p - ' | head -n "$((threshold_nitem + 1))" + ' | awk 'NR <= '"$threshold_nitem"' {print} END {print "nitem=" NR}' ) - [[ $content ]] || content='- (内容変更された `.md` ファイルはありません)' - nitem=$(wc -l <<< "$content") + nitem=$(sed -n 's/^nitem=//p' <<< "$content") + content=$(grep -v '^nitem=' <<< "$content" || echo '- (内容変更された `.md` ファイルはありません)') if ((nitem > threshold_nitem)); then - content=$nitem'件の記事が変更されました。一部を表示しています。完全なリストについては[こちら](${{ steps.vars.outputs.base_url }}/PREVIEW.html)をご参照ください。 + content_prologue=$nitem'件の記事が変更されました。一部を表示しています。完全なリストについては[こちら](${{ steps.vars.outputs.base_url }}/PREVIEW.html)をご参照ください。
(ファイル一覧) - '$(head -n "$((threshold_nitem-1))" <<< "$content")' + ' + content_epilogue=' - … (以下省略)
' elif ((nitem > threshold_details)); then - content=$nitem'件の記事が変更されました。 + content_prologue=$nitem'件の記事が変更されました。
(ファイル一覧) - '$content' + ' + content_epilogue='
' else content=$nitem'件の記事が変更されました。 - '$content + ' + content_prologue= + content_epilogue= fi echo 'content<> "$GITHUB_OUTPUT" - echo "$content" >> "$GITHUB_OUTPUT" + echo "$content_prologue$content$content_epilogue" >> "$GITHUB_OUTPUT" echo 'EOF' >> "$GITHUB_OUTPUT" - uses: thollander/actions-comment-pull-request@v3 with: From 429ed48fc059e670eef44dbd104306cae49c8f75 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Thu, 10 Jul 2025 07:44:54 +0900 Subject: [PATCH 2167/3948] =?UTF-8?q?chore(workflows/preview=5Flink):=20?= =?UTF-8?q?=E3=82=B1=E3=82=A2=E3=83=AC=E3=82=B9=E3=83=9F=E3=82=B9=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/check.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 2fefb8d717..e86913449c 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -148,7 +148,7 @@ jobs: nitem=$(sed -n 's/^nitem=//p' <<< "$content") content=$(grep -v '^nitem=' <<< "$content" || echo '- (内容変更された `.md` ファイルはありません)') if ((nitem > threshold_nitem)); then - content_prologue=$nitem'件の記事が変更されました。一部を表示しています。完全なリストについては[こちら](${{ steps.vars.outputs.base_url }}/PREVIEW.html)をご参照ください。 + content_prologue=$nitem'件の記事が変更されました。多いため一部を表示しています。完全なリストについては[こちら](${{ steps.vars.outputs.base_url }}/PREVIEW.html)をご参照ください。
(ファイル一覧) ' @@ -167,10 +167,9 @@ jobs:
' else - content=$nitem'件の記事が変更されました。 + content_prologue=$nitem'件の記事が変更されました。 ' - content_prologue= content_epilogue= fi From b80b1170237156f9314b118dd7e6b72d3f9f8761 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Thu, 10 Jul 2025 12:13:02 +0900 Subject: [PATCH 2168/3948] created printf.md and removed nolink --- lang/cpp11/variadic_macros.md | 2 +- lang/cpp14/sized_deallocation.md | 2 +- reference/cstdio.md | 2 +- reference/cstdio/fopen.md | 2 +- reference/cstdio/printf.md | 33 ++++++++++++++++++++++++++++++++ reference/ostream/println.md | 2 +- reference/print/print.md | 2 +- reference/print/println.md | 2 +- 8 files changed, 40 insertions(+), 7 deletions(-) create mode 100644 reference/cstdio/printf.md diff --git a/lang/cpp11/variadic_macros.md b/lang/cpp11/variadic_macros.md index efd3507d40..c37b0e0e73 100644 --- a/lang/cpp11/variadic_macros.md +++ b/lang/cpp11/variadic_macros.md @@ -67,7 +67,7 @@ int main() f2(FORWARD_ARGS()); // 引数0個 } ``` -* std::printf[link /reference/cstdio/printf.md.nolink] +* std::printf[link /reference/cstdio/printf.md] ### 出力 ``` diff --git a/lang/cpp14/sized_deallocation.md b/lang/cpp14/sized_deallocation.md index e037c45afe..ca7e471354 100644 --- a/lang/cpp14/sized_deallocation.md +++ b/lang/cpp14/sized_deallocation.md @@ -84,7 +84,7 @@ int main() delete[] (new A[5]); } ``` -* std::printf[link /reference/cstdio/printf.md.nolink] +* std::printf[link /reference/cstdio/printf.md] * std::malloc[link /reference/cstdlib/malloc.md] diff --git a/reference/cstdio.md b/reference/cstdio.md index e81130768a..551f7ab704 100644 --- a/reference/cstdio.md +++ b/reference/cstdio.md @@ -71,7 +71,7 @@ | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`printf`](/reference/cstdio/printf.md.nolink) | 書式を指定して標準出力に出力する | | +| [`printf`](/reference/cstdio/printf.md) | 書式を指定して標準出力に出力する | | | [`scanf`](/reference/cstdio/scanf.md.nolink) | 書式を指定して標準入力から入力する | | | [`vprintf`](/reference/cstdio/vprintf.md.nolink) | 可変引数リスト`va_list`を使用し、書式を指定して標準出力に出力する | | | [`vscanf`](/reference/cstdio/vscanf.md.nolink) | 可変引数リスト`va_list`を使用し、書式を指定して標準入力から入力する | | diff --git a/reference/cstdio/fopen.md b/reference/cstdio/fopen.md index d25f07930f..d49135b103 100644 --- a/reference/cstdio/fopen.md +++ b/reference/cstdio/fopen.md @@ -36,7 +36,7 @@ int main() { * fopen[color ff0000] * fclose[link /reference/cstdio/fclose.md] * FILE[link /reference/cstdio/file.md] -* printf[link /reference/cstdio/printf.md.nolink] +* printf[link /reference/cstdio/printf.md] ## 処理系 - [Clang](/implementation.md#clang): ?? diff --git a/reference/cstdio/printf.md b/reference/cstdio/printf.md new file mode 100644 index 0000000000..a14a868330 --- /dev/null +++ b/reference/cstdio/printf.md @@ -0,0 +1,33 @@ +# fprintf +* cstdio[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +namespace std { + int printf(const char * restrict format, ...); +} +``` + +## 概要 +標準出力に、指定された書式文字列を使用してデータを出力する。 + +## 例 +```cpp example +#include + +int main() { + int n = 123; + std::printf("Hello, World!\n%d\n", n); +} +``` +* std::printf[color ff0000] +### 出力 +``` +Hello, World! +``` + +## 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ostream/println.md b/reference/ostream/println.md index 38cd74a69b..9bf22a36b0 100644 --- a/reference/ostream/println.md +++ b/reference/ostream/println.md @@ -22,7 +22,7 @@ namespace std { 書式は[`std::format()`](/reference/format/format.md)関数のページを参照。 -この関数は、[`std::printf()`](/reference/cstdio/printf.md.nolink)関数ライクな書式指定で引数を文字列化して出力する。 +この関数は、[`std::printf()`](/reference/cstdio/printf.md)関数ライクな書式指定で引数を文字列化して出力する。 - (1) : 指定した[`ostream`](basic_ostream.md)に、書式指定で出力する - (2) : 指定した[`ostream`](basic_ostream.md)に、改行コードを出力する diff --git a/reference/print/print.md b/reference/print/print.md index 270fc93a5c..87a021b7d3 100644 --- a/reference/print/print.md +++ b/reference/print/print.md @@ -24,7 +24,7 @@ namespace std { 書式は[`std::format()`](/reference/format/format.md)関数のページを参照。 -この関数は、[`std::printf()`](/reference/cstdio/printf.md.nolink)関数ライクな書式指定で引数を文字列化して出力する。 +この関数は、[`std::printf()`](/reference/cstdio/printf.md)関数ライクな書式指定で引数を文字列化して出力する。 - (1) : 標準出力に、書式指定で出力する - (2) : 指定された[`FILE`](/reference/cstdio/file.md)に、書式指定で出力する diff --git a/reference/print/println.md b/reference/print/println.md index 55b7ef2872..6bab7bc4f0 100644 --- a/reference/print/println.md +++ b/reference/print/println.md @@ -28,7 +28,7 @@ namespace std { 書式は[`std::format()`](/reference/format/format.md)関数のページを参照。 -この関数は、[`std::printf()`](/reference/cstdio/printf.md.nolink)関数ライクな書式指定で引数を文字列化して出力する。 +この関数は、[`std::printf()`](/reference/cstdio/printf.md)関数ライクな書式指定で引数を文字列化して出力する。 - (1) : 標準出力に、書式指定で出力する - (2) : 標準出力に改行コードを出力する From e1afb4c2c534585a9d28a40b3c69be97c72dc527 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Thu, 10 Jul 2025 12:15:26 +0900 Subject: [PATCH 2169/3948] created scanf.md and removed nolink --- lang/cpp17.md | 2 +- reference/cstdio.md | 2 +- reference/cstdio/scanf.md | 40 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 reference/cstdio/scanf.md diff --git a/lang/cpp17.md b/lang/cpp17.md index d2b6aeeae8..91978b7211 100644 --- a/lang/cpp17.md +++ b/lang/cpp17.md @@ -151,7 +151,7 @@ C++17以降、言語の策定にship train modelというリリース体制が - [``](/reference/cfloat.md)に、非正規化数の有無を判定するマクロ、10進数の桁数を表すマクロ、正の最小数を表すマクロを追加 - [``](/reference/cstdlib.md)に、[`aligned_alloc()`](/reference/cstdlib/aligned_alloc.md)関数を追加 - [``](/reference/ctime.md)に、[`TIME_UTC`](/reference/ctime/time_utc.md)マクロ, [`timespec`](/reference/ctime/timespec.md)構造体, [`timespec_get()`](/reference/ctime/timespec_get.md)関数を追加 - - [``](/reference/cstdio.md)に、[`vfscanf()`](/reference/cstdio/vfscanf.md.nolink)関数を追加 + - [``](/reference/cstdio.md)に、[`vfscanf()`](/reference/cstdio/vfscanf.md)関数を追加 - ``, ``, ``, ``を非推奨化 diff --git a/reference/cstdio.md b/reference/cstdio.md index 551f7ab704..5d22e0b124 100644 --- a/reference/cstdio.md +++ b/reference/cstdio.md @@ -72,7 +72,7 @@ | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`printf`](/reference/cstdio/printf.md) | 書式を指定して標準出力に出力する | | -| [`scanf`](/reference/cstdio/scanf.md.nolink) | 書式を指定して標準入力から入力する | | +| [`scanf`](/reference/cstdio/scanf.md) | 書式を指定して標準入力から入力する | | | [`vprintf`](/reference/cstdio/vprintf.md.nolink) | 可変引数リスト`va_list`を使用し、書式を指定して標準出力に出力する | | | [`vscanf`](/reference/cstdio/vscanf.md.nolink) | 可変引数リスト`va_list`を使用し、書式を指定して標準入力から入力する | | | [`getc`](/reference/cstdio/getc.md.nolink) | ストリームから1文字入力する | | diff --git a/reference/cstdio/scanf.md b/reference/cstdio/scanf.md new file mode 100644 index 0000000000..2da0fad7bc --- /dev/null +++ b/reference/cstdio/scanf.md @@ -0,0 +1,40 @@ +# fscanf +* cstdio[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +namespace std { + int scanf(const char * restrict format, ...); +} +``` + +## 概要 +標準入力から、指定された書式文字列を使用してデータを入力する。 + +## 例 +```cpp example +#include + +int main() { + int n; + std::scanf("%d", &n); + std::printf("%d\n", n); +} +``` +* std::scanf[color ff0000] +* std::printf[link /reference/cstdio/printf.md] +### 出力(test.txtは以下参照) +``` +123 +``` + +### ファイル内容(test.txt) +``` +123 +``` + +## 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? From f5be1db9b0813ffef629c2aac80fc0fe5ed450ae Mon Sep 17 00:00:00 2001 From: rotarymars Date: Thu, 10 Jul 2025 21:31:23 +0900 Subject: [PATCH 2170/3948] fixed nolink --- lang/cpp17.md | 2 +- reference/ostream/print.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/cpp17.md b/lang/cpp17.md index 91978b7211..d2b6aeeae8 100644 --- a/lang/cpp17.md +++ b/lang/cpp17.md @@ -151,7 +151,7 @@ C++17以降、言語の策定にship train modelというリリース体制が - [``](/reference/cfloat.md)に、非正規化数の有無を判定するマクロ、10進数の桁数を表すマクロ、正の最小数を表すマクロを追加 - [``](/reference/cstdlib.md)に、[`aligned_alloc()`](/reference/cstdlib/aligned_alloc.md)関数を追加 - [``](/reference/ctime.md)に、[`TIME_UTC`](/reference/ctime/time_utc.md)マクロ, [`timespec`](/reference/ctime/timespec.md)構造体, [`timespec_get()`](/reference/ctime/timespec_get.md)関数を追加 - - [``](/reference/cstdio.md)に、[`vfscanf()`](/reference/cstdio/vfscanf.md)関数を追加 + - [``](/reference/cstdio.md)に、[`vfscanf()`](/reference/cstdio/vfscanf.md.nolink)関数を追加 - ``, ``, ``, ``を非推奨化 diff --git a/reference/ostream/print.md b/reference/ostream/print.md index 284d3272e2..2be42adf95 100644 --- a/reference/ostream/print.md +++ b/reference/ostream/print.md @@ -20,7 +20,7 @@ namespace std { 書式は[`std::format()`](/reference/format/format.md)関数のページを参照。 -この関数は、[`std::printf()`](/reference/cstdio/printf.md.nolink)関数ライクな書式指定で引数を文字列化して出力する。 +この関数は、[`std::printf()`](/reference/cstdio/printf.md)関数ライクな書式指定で引数を文字列化して出力する。 - (1) : 指定した[`ostream`](basic_ostream.md)に、書式指定で出力する From cfe94b3db49ef8e621f0a93e09402fe8e61a400a Mon Sep 17 00:00:00 2001 From: rotarymars Date: Thu, 10 Jul 2025 21:35:37 +0900 Subject: [PATCH 2171/3948] fixed function declaration removed restrict --- reference/cstdio/fgets.md | 2 +- reference/cstdio/fprintf.md | 2 +- reference/cstdio/fscanf.md | 2 +- reference/cstdio/printf.md | 2 +- reference/cstdio/scanf.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/reference/cstdio/fgets.md b/reference/cstdio/fgets.md index 77869a8f5d..cead92e166 100644 --- a/reference/cstdio/fgets.md +++ b/reference/cstdio/fgets.md @@ -5,7 +5,7 @@ ```cpp namespace std { - char* fgets( char* restrict str, int count, FILE* restrict stream ); + char* fgets( char* str, int count, FILE* stream ); } ``` diff --git a/reference/cstdio/fprintf.md b/reference/cstdio/fprintf.md index 59ac1381e2..83f9e8b53c 100644 --- a/reference/cstdio/fprintf.md +++ b/reference/cstdio/fprintf.md @@ -5,7 +5,7 @@ ```cpp namespace std { - int fprintf( FILE* restrict stream, const char* restrict format, ... ); + int fprintf( FILE* stream, const char* format, ... ); } ``` diff --git a/reference/cstdio/fscanf.md b/reference/cstdio/fscanf.md index 56ba19c022..d1325c2f95 100644 --- a/reference/cstdio/fscanf.md +++ b/reference/cstdio/fscanf.md @@ -5,7 +5,7 @@ ```cpp namespace std { - int fscanf( FILE* restrict stream, const char* restrict format, ... ); + int fscanf( FILE* stream, const char* format, ... ); } ``` diff --git a/reference/cstdio/printf.md b/reference/cstdio/printf.md index a14a868330..5a7153fa37 100644 --- a/reference/cstdio/printf.md +++ b/reference/cstdio/printf.md @@ -5,7 +5,7 @@ ```cpp namespace std { - int printf(const char * restrict format, ...); + int printf(const char * format, ...); } ``` diff --git a/reference/cstdio/scanf.md b/reference/cstdio/scanf.md index 2da0fad7bc..0a3df69e36 100644 --- a/reference/cstdio/scanf.md +++ b/reference/cstdio/scanf.md @@ -5,7 +5,7 @@ ```cpp namespace std { - int scanf(const char * restrict format, ...); + int scanf(const char * format, ...); } ``` From 47758af343e4bf29797010301bb2233f3c2ce19c Mon Sep 17 00:00:00 2001 From: rotarymars Date: Thu, 10 Jul 2025 21:53:06 +0900 Subject: [PATCH 2172/3948] new page `getc.md` and removed nolink --- reference/cstdio.md | 2 +- reference/cstdio/fgetc.md | 2 +- reference/cstdio/getc.md | 45 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 reference/cstdio/getc.md diff --git a/reference/cstdio.md b/reference/cstdio.md index 5d22e0b124..0ae8290d2c 100644 --- a/reference/cstdio.md +++ b/reference/cstdio.md @@ -75,7 +75,7 @@ | [`scanf`](/reference/cstdio/scanf.md) | 書式を指定して標準入力から入力する | | | [`vprintf`](/reference/cstdio/vprintf.md.nolink) | 可変引数リスト`va_list`を使用し、書式を指定して標準出力に出力する | | | [`vscanf`](/reference/cstdio/vscanf.md.nolink) | 可変引数リスト`va_list`を使用し、書式を指定して標準入力から入力する | | -| [`getc`](/reference/cstdio/getc.md.nolink) | ストリームから1文字入力する | | +| [`getc`](/reference/cstdio/getc.md) | ストリームから1文字入力する | | | [`getchar`](/reference/cstdio/getchar.md.nolink) | 標準入力から1文字入力する | | | [`putc`](/reference/cstdio/putc.md.nolink) | ストリームに1文字出力する | | | [`putchar`](/reference/cstdio/putchar.md.nolink) | 標準出力に1文字出力する | | diff --git a/reference/cstdio/fgetc.md b/reference/cstdio/fgetc.md index 65abda0fcf..b5814e035b 100644 --- a/reference/cstdio/fgetc.md +++ b/reference/cstdio/fgetc.md @@ -12,7 +12,7 @@ namespace std { ## 概要 指定されたファイルストリームから1文字入力する。 -[`getc`][/reference/cstdio/getc.md.nolink]とは違い、関数として定義することが定められているため、引数は一度しか評価されないことが保証されている。 +[`getc`][/reference/cstdio/getc.md]とは違い、関数として定義することが定められているため、引数は一度しか評価されないことが保証されている。 ## 戻り値 入力された文字を返す。 diff --git a/reference/cstdio/getc.md b/reference/cstdio/getc.md new file mode 100644 index 0000000000..a2e07b9d8e --- /dev/null +++ b/reference/cstdio/getc.md @@ -0,0 +1,45 @@ +# getc +* cstdio[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +int getc(FILE* stream); +``` + +## 概要 +ストリームから一文字読み取る。 + +関数でもマクロでも定義してよいため、引数が一度しか評価されない保証はない。 + +## 戻り値 +読み取る文字があればその文字を、なければ[`EOF`](/reference/cstdio/eof.md)を返す。 + +## 例 +```cpp example +#include + +int main() { + int c; + while ((c = getc(stdin)) != EOF) { + putc(c, stdout); + } +} +``` +* getc[color ff0000] +* putc[link /reference/cstdio/putc.md.nolink] + +### 入力 +``` +abc +``` + +### 出力 +``` +abc +``` + +## 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? From 77d79aeac3064f0705a8e0bef1fc8b52e24196ff Mon Sep 17 00:00:00 2001 From: rotarymars Date: Thu, 10 Jul 2025 21:57:11 +0900 Subject: [PATCH 2173/3948] new page `puts.md` and removed nolink --- reference/cstdio.md | 2 +- reference/cstdio/eof.md | 2 +- reference/cstdio/fgets.md | 2 +- reference/cstdio/puts.md | 36 ++++++++++++++++++++++++++++++++++++ 4 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 reference/cstdio/puts.md diff --git a/reference/cstdio.md b/reference/cstdio.md index 0ae8290d2c..c9420bb11b 100644 --- a/reference/cstdio.md +++ b/reference/cstdio.md @@ -79,7 +79,7 @@ | [`getchar`](/reference/cstdio/getchar.md.nolink) | 標準入力から1文字入力する | | | [`putc`](/reference/cstdio/putc.md.nolink) | ストリームに1文字出力する | | | [`putchar`](/reference/cstdio/putchar.md.nolink) | 標準出力に1文字出力する | | -| [`puts`](/reference/cstdio/puts.md.nolink) | 標準出力に文字列を出力する | | +| [`puts`](/reference/cstdio/puts.md) | 標準出力に文字列を出力する | | | [`ungetc`](/reference/cstdio/ungetc.md.nolink) | 入力ストリームに1文字戻す | | diff --git a/reference/cstdio/eof.md b/reference/cstdio/eof.md index a6b3d269cd..1835a04e81 100644 --- a/reference/cstdio/eof.md +++ b/reference/cstdio/eof.md @@ -28,7 +28,7 @@ int main() { * EOF[color ff0000] * getchar[link /reference/cstdio/getchar.md.nolink] * putchar[link /reference/cstdio/putchar.md.nolink] -* puts[link /reference/cstdio/puts.md.nolink] +* puts[link /reference/cstdio/puts.md] ### 入力 ``` diff --git a/reference/cstdio/fgets.md b/reference/cstdio/fgets.md index cead92e166..712ef1ce2d 100644 --- a/reference/cstdio/fgets.md +++ b/reference/cstdio/fgets.md @@ -30,7 +30,7 @@ int main() { } ``` * fgets[color ff0000] -* puts[link /reference/cstdio/puts.md.nolink] +* puts[link /reference/cstdio/puts.md] ### 入力 ``` diff --git a/reference/cstdio/puts.md b/reference/cstdio/puts.md new file mode 100644 index 0000000000..f8c6d348cd --- /dev/null +++ b/reference/cstdio/puts.md @@ -0,0 +1,36 @@ +# puts +* cstdio[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +int puts(const char* str); +``` + +## 概要 +引数に渡されたヌル終端文字列を標準出力に出力する。 + +また、末尾には自動で改行がつく。 + +## 戻り値 +成功すれば[`EOF`](/reference/cstdio/eof.md)以外の値を返し、失敗すれば[`EOF`](/reference/cstdio/eof.md)を返す。 + +## 例 +```cpp example +#include + +int main() { + puts("Hello, World!"); +} +``` +* puts[color ff0000] + +### 出力 +``` +Hello, World! +``` + +## 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? From 03ea10cb096c04f15baf113681679407c3a27057 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Thu, 10 Jul 2025 22:02:34 +0900 Subject: [PATCH 2174/3948] new page `getchar.md` and removed nolink --- reference/cstdio.md | 2 +- reference/cstdio/eof.md | 2 +- reference/cstdio/getchar.md | 47 +++++++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 reference/cstdio/getchar.md diff --git a/reference/cstdio.md b/reference/cstdio.md index c9420bb11b..c38fe638e6 100644 --- a/reference/cstdio.md +++ b/reference/cstdio.md @@ -76,7 +76,7 @@ | [`vprintf`](/reference/cstdio/vprintf.md.nolink) | 可変引数リスト`va_list`を使用し、書式を指定して標準出力に出力する | | | [`vscanf`](/reference/cstdio/vscanf.md.nolink) | 可変引数リスト`va_list`を使用し、書式を指定して標準入力から入力する | | | [`getc`](/reference/cstdio/getc.md) | ストリームから1文字入力する | | -| [`getchar`](/reference/cstdio/getchar.md.nolink) | 標準入力から1文字入力する | | +| [`getchar`](/reference/cstdio/getchar.md) | 標準入力から1文字入力する | | | [`putc`](/reference/cstdio/putc.md.nolink) | ストリームに1文字出力する | | | [`putchar`](/reference/cstdio/putchar.md.nolink) | 標準出力に1文字出力する | | | [`puts`](/reference/cstdio/puts.md) | 標準出力に文字列を出力する | | diff --git a/reference/cstdio/eof.md b/reference/cstdio/eof.md index 1835a04e81..88b0f6aaae 100644 --- a/reference/cstdio/eof.md +++ b/reference/cstdio/eof.md @@ -26,7 +26,7 @@ int main() { ``` * EOF[color ff0000] -* getchar[link /reference/cstdio/getchar.md.nolink] +* getchar[link /reference/cstdio/getchar.md] * putchar[link /reference/cstdio/putchar.md.nolink] * puts[link /reference/cstdio/puts.md] diff --git a/reference/cstdio/getchar.md b/reference/cstdio/getchar.md new file mode 100644 index 0000000000..bc7ea3b8d0 --- /dev/null +++ b/reference/cstdio/getchar.md @@ -0,0 +1,47 @@ +# getchar +* cstdio[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +int getchar(); +``` + +## 概要 +標準入力から1文字入力する。 + +[`getc`][/reference/cstdio/getc.md]とは違い、関数として定義することが定められているため、引数は一度しか評価されないことが保証されている。 + +また、[`getc`](/reference/cstdio/getc.md)([`stdin`](/reference/cstdio/stdin.md))と等価である。 + +## 戻り値 +読み取る文字があればその文字を、なければ[`EOF`](/reference/cstdio/eof.md)を返す。 + +## 例 +```cpp example +#include +int main() { + int c; + while ((c = getchar()) != EOF) { + putchar(c); + } +} +``` +* getchar[color ff0000] +* putchar[link /reference/cstdio/putchar.md.nolink] +* EOF[link /reference/cstdio/eof.md] + +### 入力 +``` +abc +``` + +### 出力 +``` +abc +``` + +## 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? From 9113be660ff3eef8099e2eb706b5f3d361999b8d Mon Sep 17 00:00:00 2001 From: rotarymars Date: Thu, 10 Jul 2025 22:08:09 +0900 Subject: [PATCH 2175/3948] fixed wrong link format --- reference/cstdio/getchar.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdio/getchar.md b/reference/cstdio/getchar.md index bc7ea3b8d0..33d6e30b47 100644 --- a/reference/cstdio/getchar.md +++ b/reference/cstdio/getchar.md @@ -10,7 +10,7 @@ int getchar(); ## 概要 標準入力から1文字入力する。 -[`getc`][/reference/cstdio/getc.md]とは違い、関数として定義することが定められているため、引数は一度しか評価されないことが保証されている。 +[`getc`](/reference/cstdio/getc.md)とは違い、関数として定義することが定められているため、引数は一度しか評価されないことが保証されている。 また、[`getc`](/reference/cstdio/getc.md)([`stdin`](/reference/cstdio/stdin.md))と等価である。 From be3f3eb03959a37e9bdaf90ccd6932b8fdfc34f3 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 11 Jul 2025 08:31:57 +0900 Subject: [PATCH 2176/3948] new page `putc.md` and removed nolink --- reference/cstdio.md | 2 +- reference/cstdio/fgetc.md | 2 +- reference/cstdio/fputc.md | 2 +- reference/cstdio/getc.md | 2 +- reference/cstdio/putc.md | 40 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 reference/cstdio/putc.md diff --git a/reference/cstdio.md b/reference/cstdio.md index c38fe638e6..5dd666b441 100644 --- a/reference/cstdio.md +++ b/reference/cstdio.md @@ -77,7 +77,7 @@ | [`vscanf`](/reference/cstdio/vscanf.md.nolink) | 可変引数リスト`va_list`を使用し、書式を指定して標準入力から入力する | | | [`getc`](/reference/cstdio/getc.md) | ストリームから1文字入力する | | | [`getchar`](/reference/cstdio/getchar.md) | 標準入力から1文字入力する | | -| [`putc`](/reference/cstdio/putc.md.nolink) | ストリームに1文字出力する | | +| [`putc`](/reference/cstdio/putc.md) | ストリームに1文字出力する | | | [`putchar`](/reference/cstdio/putchar.md.nolink) | 標準出力に1文字出力する | | | [`puts`](/reference/cstdio/puts.md) | 標準出力に文字列を出力する | | | [`ungetc`](/reference/cstdio/ungetc.md.nolink) | 入力ストリームに1文字戻す | | diff --git a/reference/cstdio/fgetc.md b/reference/cstdio/fgetc.md index b5814e035b..339a6e005c 100644 --- a/reference/cstdio/fgetc.md +++ b/reference/cstdio/fgetc.md @@ -29,7 +29,7 @@ int main() { } ``` * fgetc[color ff0000] -* putc[link /reference/cstdio/putc.md.nolink] +* putc[link /reference/cstdio/putc.md] ### 入力 ``` diff --git a/reference/cstdio/fputc.md b/reference/cstdio/fputc.md index e9a51ec147..ffeea5614c 100644 --- a/reference/cstdio/fputc.md +++ b/reference/cstdio/fputc.md @@ -12,7 +12,7 @@ namespace std { ## 概要 指定されたファイルストリームに1文字出力する。 -[`putc`][/reference/cstdio/putc.md.nolink]とは違い、関数として定義することが定められているため、引数は一度しか評価されないことが保証されている。 +[`putc`][/reference/cstdio/putc.md]とは違い、関数として定義することが定められているため、引数は一度しか評価されないことが保証されている。 ## 戻り値 出力された文字を返す。 diff --git a/reference/cstdio/getc.md b/reference/cstdio/getc.md index a2e07b9d8e..fc5b1b0a07 100644 --- a/reference/cstdio/getc.md +++ b/reference/cstdio/getc.md @@ -27,7 +27,7 @@ int main() { } ``` * getc[color ff0000] -* putc[link /reference/cstdio/putc.md.nolink] +* putc[link /reference/cstdio/putc.md] ### 入力 ``` diff --git a/reference/cstdio/putc.md b/reference/cstdio/putc.md new file mode 100644 index 0000000000..568c7769e1 --- /dev/null +++ b/reference/cstdio/putc.md @@ -0,0 +1,40 @@ +# putc +* cstdio[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +int putc(int c, FILE* stream); +``` + +## 概要 +指定されたストリームに1文字出力する。 + +## 戻り値 +成功したら書き込んだ文字を、失敗すれば[`EOF`](/reference/cstdio/eof.md)を返す。 + +## 例 +```cpp example +#include + +int main() { + putc('H', stdout); + putc('e', stdout); + putc('l', stdout); + putc('l', stdout); + putc('o', stdout); + putc('\n', stdout); +} +``` +* putc[color ff0000] +* stdout[link /reference/cstdio/stdout.md] + +### 出力 +``` +Hello +``` + +## 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file From 64128e8c01d0ec1f2cb9c78933669d98bb8d7802 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 11 Jul 2025 09:01:29 +0900 Subject: [PATCH 2177/3948] new page `putchar.md` and removed nolink --- reference/cstdio.md | 2 +- reference/cstdio/eof.md | 2 +- reference/cstdio/getchar.md | 2 +- reference/cstdio/putchar.md | 0 4 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 reference/cstdio/putchar.md diff --git a/reference/cstdio.md b/reference/cstdio.md index 5dd666b441..c08453284c 100644 --- a/reference/cstdio.md +++ b/reference/cstdio.md @@ -78,7 +78,7 @@ | [`getc`](/reference/cstdio/getc.md) | ストリームから1文字入力する | | | [`getchar`](/reference/cstdio/getchar.md) | 標準入力から1文字入力する | | | [`putc`](/reference/cstdio/putc.md) | ストリームに1文字出力する | | -| [`putchar`](/reference/cstdio/putchar.md.nolink) | 標準出力に1文字出力する | | +| [`putchar`](/reference/cstdio/putchar.md) | 標準出力に1文字出力する | | | [`puts`](/reference/cstdio/puts.md) | 標準出力に文字列を出力する | | | [`ungetc`](/reference/cstdio/ungetc.md.nolink) | 入力ストリームに1文字戻す | | diff --git a/reference/cstdio/eof.md b/reference/cstdio/eof.md index 88b0f6aaae..c881bc945a 100644 --- a/reference/cstdio/eof.md +++ b/reference/cstdio/eof.md @@ -27,7 +27,7 @@ int main() { ``` * EOF[color ff0000] * getchar[link /reference/cstdio/getchar.md] -* putchar[link /reference/cstdio/putchar.md.nolink] +* putchar[link /reference/cstdio/putchar.md] * puts[link /reference/cstdio/puts.md] ### 入力 diff --git a/reference/cstdio/getchar.md b/reference/cstdio/getchar.md index 33d6e30b47..2024ff8cd0 100644 --- a/reference/cstdio/getchar.md +++ b/reference/cstdio/getchar.md @@ -28,7 +28,7 @@ int main() { } ``` * getchar[color ff0000] -* putchar[link /reference/cstdio/putchar.md.nolink] +* putchar[link /reference/cstdio/putchar.md] * EOF[link /reference/cstdio/eof.md] ### 入力 diff --git a/reference/cstdio/putchar.md b/reference/cstdio/putchar.md new file mode 100644 index 0000000000..e69de29bb2 From f0471332bcd85b1160b3e186c41c07473fc73534 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 11 Jul 2025 10:12:03 +0900 Subject: [PATCH 2178/3948] =?UTF-8?q?cstdlib/system:=20POISX=E8=A6=8F?= =?UTF-8?q?=E6=A0=BC=E3=81=B8=E3=81=AE=E5=8F=82=E7=85=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit マクロWEXITSTATUS, WSTOPSIGの出展 --- reference/cstdlib/system.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reference/cstdlib/system.md b/reference/cstdlib/system.md index e47491bc4f..76fc9db80b 100644 --- a/reference/cstdlib/system.md +++ b/reference/cstdlib/system.md @@ -53,3 +53,7 @@ total 16 | 名前 | 説明 | |--------------------------------|--------------------------------------------------------| | [`flush`](../ostream/flush.md) | バッファをフラッシュする | + +### 参照 + +- [POSIX(IEEE Std 1003.1-2024); wait, waitpid](https://pubs.opengroup.org/onlinepubs/9799919799.2024edition/functions/waitpid.html) From 07c43dc66a9e72ab39a61776c473a3ad135400cd Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 11 Jul 2025 11:21:44 +0900 Subject: [PATCH 2179/3948] forgot to save putchar.md --- reference/cstdio/putchar.md | 41 +++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/reference/cstdio/putchar.md b/reference/cstdio/putchar.md index e69de29bb2..b96fa54455 100644 --- a/reference/cstdio/putchar.md +++ b/reference/cstdio/putchar.md @@ -0,0 +1,41 @@ +# putchar +* cstdio[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +int putchar(int c); +``` + +## 概要 +標準出力に1文字出力する。 + +これは、[`putc`](/reference/cstdio/putc.md)(`c`, [`stdout`](/reference/cstdio/stdout.md))と等価である。 + +## 戻り値 +成功すれば書き込んだ文字を、失敗すれば[`EOF`](/reference/cstdio/eof.md)を返す。 + +## 例 +```cpp example +#include + +int main() { + putchar('H'); + putchar('e'); + putchar('l'); + putchar('l'); + putchar('o'); + putchar('\n'); +} +``` +* putchar[color ff0000] + +### 出力 +``` +Hello +``` + +## 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? From a51f736718341d8bc07c92b451985a8276754531 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 11 Jul 2025 11:42:04 +0900 Subject: [PATCH 2180/3948] new page `ungetc.md` and removed nolink --- reference/cstdio.md | 2 +- reference/cstdio/ungetc.md | 49 +++++++++++++++++++++++ reference/ios/ios_base/sync_with_stdio.md | 2 +- 3 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 reference/cstdio/ungetc.md diff --git a/reference/cstdio.md b/reference/cstdio.md index c08453284c..b081a1680b 100644 --- a/reference/cstdio.md +++ b/reference/cstdio.md @@ -80,7 +80,7 @@ | [`putc`](/reference/cstdio/putc.md) | ストリームに1文字出力する | | | [`putchar`](/reference/cstdio/putchar.md) | 標準出力に1文字出力する | | | [`puts`](/reference/cstdio/puts.md) | 標準出力に文字列を出力する | | -| [`ungetc`](/reference/cstdio/ungetc.md.nolink) | 入力ストリームに1文字戻す | | +| [`ungetc`](/reference/cstdio/ungetc.md) | 入力ストリームに1文字戻す | | ## 文字列入出力 diff --git a/reference/cstdio/ungetc.md b/reference/cstdio/ungetc.md new file mode 100644 index 0000000000..a767adc390 --- /dev/null +++ b/reference/cstdio/ungetc.md @@ -0,0 +1,49 @@ +# ungetc +* cstdio[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +int ungetc(int c, FILE *stream); +``` + +## 概要 +符号なしの文字`c`を入力ストリーム`stream`に戻す。 + +この関数は、連続してこの関数が呼び出される場合、入力ストリームへのプッシュ・バックを保証できる連続した文字は 1 つのみである。 + +また、`c`は[`EOF`](/reference/cstdio/eof.md)であってはならない。 + +この関数が呼び出されたのち、[`fseek`](/reference/cstdio/fseek.md.nolink)や[`fsetpos`](/reference/cstdio/fsetpos.md.nolink)、[`rewind`](/reference/cstdio/rewind.md.nolink)、[`fflush`](/reference/cstdio/fflush.md)を呼び出すと、その関数の呼び出しによって戻された文字は失われる。 + +## 戻り値 +成功したら挿入した`c`を、そうでなければ[`EOF`](/reference/cstdio/eof.md)を返す。 + +## 例 +```cpp example +#include + +int main() { + putchar(getchar()); + ungetc('A', stdin); + putchar(getchar()); +} +``` +* ungetc[color ff0000] +* getchar[link /reference/cstdio/getchar.md] +* putchar[link /reference/cstdio/putchar.md] + +### 入力 +``` +a +``` + +### 出力 +``` +aA +``` + +## 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file diff --git a/reference/ios/ios_base/sync_with_stdio.md b/reference/ios/ios_base/sync_with_stdio.md index 14491ef740..655e493133 100644 --- a/reference/ios/ios_base/sync_with_stdio.md +++ b/reference/ios/ios_base/sync_with_stdio.md @@ -27,7 +27,7 @@ static bool sync_with_stdio(bool sync = true); - 文字 `c` のストリームへの出力 [`fputc`](../../cstdio/fputc.md)`(f, c);` は `str.`[`rdbuf`](../basic_ios/rdbuf.md)`()->`[`sputc`](../../streambuf/basic_streambuf/sputc.md)`(c);` と等価であり、 - 文字 `c` のストリームからの入力 `c =` [`fgetc`](../../cstdio/fgetc.md)`(f);` は `c = str.`[`rdbuf`](../basic_ios/rdbuf.md)`()->`[`sbumpc`](../../streambuf/basic_streambuf/sbumpc.md)`();` と等価であり、 -- 文字 `c` のストリームへの戻し [`ungetc`](../../cstdio/ungetc.md.nolink)`(c, f)` は `str.`[`rdbuf`](../basic_ios/rdbuf.md)`()->`[`sputbackc`](../../streambuf/basic_streambuf/sputbackc.md)`(c);` と等価である。 +- 文字 `c` のストリームへの戻し [`ungetc`](../../cstdio/ungetc.md)`(c, f)` は `str.`[`rdbuf`](../basic_ios/rdbuf.md)`()->`[`sputbackc`](../../streambuf/basic_streambuf/sputbackc.md)`(c);` と等価である。 ## 例 From f11a9f1cd9f3b6a53879c10ba2d2cdae71337f5e Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 11 Jul 2025 11:43:43 +0900 Subject: [PATCH 2181/3948] fixed nolink --- reference/ios/ios_base/sync_with_stdio.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/ios/ios_base/sync_with_stdio.md b/reference/ios/ios_base/sync_with_stdio.md index 655e493133..1cd8540970 100644 --- a/reference/ios/ios_base/sync_with_stdio.md +++ b/reference/ios/ios_base/sync_with_stdio.md @@ -46,7 +46,7 @@ int main() ``` * sync_with_stdio[color ff0000] * std::ios_base[link ../ios_base.md] -* std::putchar[link ../../cstdio/putchar.md.nolink] +* std::putchar[link ../../cstdio/putchar.md] ### 出力例 ``` From f387fd311201aa27ab14cf85eeb5039e14e4c6f6 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 11 Jul 2025 11:55:57 +0900 Subject: [PATCH 2182/3948] new page `first.md` and removed nolink --- reference/algorithm/min_element.md | 2 +- reference/algorithm/minmax.md | 8 +++---- reference/algorithm/minmax_element.md | 4 ++-- reference/algorithm/mismatch.md | 2 +- reference/utility/pair.md | 4 ++-- reference/utility/pair/first.md | 34 +++++++++++++++++++++++++++ 6 files changed, 44 insertions(+), 10 deletions(-) create mode 100644 reference/utility/pair/first.md diff --git a/reference/algorithm/min_element.md b/reference/algorithm/min_element.md index 9f6e9e215d..28bbdc48eb 100644 --- a/reference/algorithm/min_element.md +++ b/reference/algorithm/min_element.md @@ -70,7 +70,7 @@ int main() } ``` * std::min_element[color ff0000] -* v2_min_element->first[link /reference/utility/pair/first.md.nolink] +* v2_min_element->first[link /reference/utility/pair/first.md] * v2_min_element->second[link /reference/utility/pair/second.md.nolink] ### 出力 diff --git a/reference/algorithm/minmax.md b/reference/algorithm/minmax.md index e1aca9fbf0..844e3f8942 100644 --- a/reference/algorithm/minmax.md +++ b/reference/algorithm/minmax.md @@ -95,13 +95,13 @@ int main() ``` * std::minmax[color ff0000] * std::greater[link /reference/functional/greater.md] -* result1.first[link /reference/utility/pair/first.md.nolink] +* result1.first[link /reference/utility/pair/first.md] * result1.second[link /reference/utility/pair/second.md.nolink] -* result2.first[link /reference/utility/pair/first.md.nolink] +* result2.first[link /reference/utility/pair/first.md] * result2.second[link /reference/utility/pair/second.md.nolink] -* result3.first[link /reference/utility/pair/first.md.nolink] +* result3.first[link /reference/utility/pair/first.md] * result3.second[link /reference/utility/pair/second.md.nolink] -* result4.first[link /reference/utility/pair/first.md.nolink] +* result4.first[link /reference/utility/pair/first.md] * result4.second[link /reference/utility/pair/second.md.nolink] ### 出力 ``` diff --git a/reference/algorithm/minmax_element.md b/reference/algorithm/minmax_element.md index 8a63e11007..b977a8c3d7 100644 --- a/reference/algorithm/minmax_element.md +++ b/reference/algorithm/minmax_element.md @@ -78,9 +78,9 @@ int main() } ``` * std::minmax_element[color ff0000] -* *i.first[link /reference/utility/pair/first.md.nolink] +* *i.first[link /reference/utility/pair/first.md] * *i.second[link /reference/utility/pair/second.md.nolink] -* *j.first[link /reference/utility/pair/first.md.nolink] +* *j.first[link /reference/utility/pair/first.md] * *j.second[link /reference/utility/pair/second.md.nolink] ### 出力 ``` diff --git a/reference/algorithm/mismatch.md b/reference/algorithm/mismatch.md index e31d996338..7ca72dc383 100644 --- a/reference/algorithm/mismatch.md +++ b/reference/algorithm/mismatch.md @@ -146,7 +146,7 @@ int main() { ``` * std::mismatch[color ff0000] * std::to_string[link /reference/string/to_string.md] -* *p.first[link /reference/utility/pair/first.md.nolink] +* *p.first[link /reference/utility/pair/first.md] * *p.second[link /reference/utility/pair/second.md.nolink] ### 出力 diff --git a/reference/utility/pair.md b/reference/utility/pair.md index 3310356283..9ab4bc1199 100644 --- a/reference/utility/pair.md +++ b/reference/utility/pair.md @@ -22,8 +22,8 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| `T1 first` | 1つめの要素 | | -| `T2 second` | 2つめの要素 | | +| [`first`](pair/first.md) | 1つめの要素 | | +| [`second`](pair/second.md.nolink) | 2つめの要素 | | ## メンバ関数 diff --git a/reference/utility/pair/first.md b/reference/utility/pair/first.md new file mode 100644 index 0000000000..4e7a02fe26 --- /dev/null +++ b/reference/utility/pair/first.md @@ -0,0 +1,34 @@ +# first +* pair[meta header] +* std[meta namespace] +* pair[meta class] +* variable[meta id-type] + +```cpp +T1 first; +``` + +## 概要 +[`pair`](/reference/utility/pair.md)クラスのメンバ変数で、1つめの要素を表す。 + +## 例 +```cpp example +#include + +int main() { + std::pair p(1, 2); + std::cout << p.first << std::endl; +} +``` +* std::pair[link /reference/utility/pair.md] +* p.first[color ff0000] + +### 出力 +``` +1 +``` + +## 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file From cf4d78f9a81a597021580dc2151e859b4a5bef5c Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 11 Jul 2025 11:59:14 +0900 Subject: [PATCH 2183/3948] new page `second.md` and removed nolink --- reference/algorithm/min_element.md | 2 +- reference/algorithm/minmax.md | 8 +++---- reference/algorithm/minmax_element.md | 4 ++-- reference/algorithm/mismatch.md | 2 +- reference/utility/pair.md | 2 +- reference/utility/pair/second.md | 34 +++++++++++++++++++++++++++ 6 files changed, 43 insertions(+), 9 deletions(-) create mode 100644 reference/utility/pair/second.md diff --git a/reference/algorithm/min_element.md b/reference/algorithm/min_element.md index 28bbdc48eb..988a553d98 100644 --- a/reference/algorithm/min_element.md +++ b/reference/algorithm/min_element.md @@ -71,7 +71,7 @@ int main() ``` * std::min_element[color ff0000] * v2_min_element->first[link /reference/utility/pair/first.md] -* v2_min_element->second[link /reference/utility/pair/second.md.nolink] +* v2_min_element->second[link /reference/utility/pair/second.md] ### 出力 ``` diff --git a/reference/algorithm/minmax.md b/reference/algorithm/minmax.md index 844e3f8942..147e651058 100644 --- a/reference/algorithm/minmax.md +++ b/reference/algorithm/minmax.md @@ -96,13 +96,13 @@ int main() * std::minmax[color ff0000] * std::greater[link /reference/functional/greater.md] * result1.first[link /reference/utility/pair/first.md] -* result1.second[link /reference/utility/pair/second.md.nolink] +* result1.second[link /reference/utility/pair/second.md] * result2.first[link /reference/utility/pair/first.md] -* result2.second[link /reference/utility/pair/second.md.nolink] +* result2.second[link /reference/utility/pair/second.md] * result3.first[link /reference/utility/pair/first.md] -* result3.second[link /reference/utility/pair/second.md.nolink] +* result3.second[link /reference/utility/pair/second.md] * result4.first[link /reference/utility/pair/first.md] -* result4.second[link /reference/utility/pair/second.md.nolink] +* result4.second[link /reference/utility/pair/second.md] ### 出力 ``` ``` diff --git a/reference/algorithm/minmax_element.md b/reference/algorithm/minmax_element.md index b977a8c3d7..7b655fbaea 100644 --- a/reference/algorithm/minmax_element.md +++ b/reference/algorithm/minmax_element.md @@ -79,9 +79,9 @@ int main() ``` * std::minmax_element[color ff0000] * *i.first[link /reference/utility/pair/first.md] -* *i.second[link /reference/utility/pair/second.md.nolink] +* *i.second[link /reference/utility/pair/second.md] * *j.first[link /reference/utility/pair/first.md] -* *j.second[link /reference/utility/pair/second.md.nolink] +* *j.second[link /reference/utility/pair/second.md] ### 出力 ``` ``` diff --git a/reference/algorithm/mismatch.md b/reference/algorithm/mismatch.md index 7ca72dc383..3e2634534a 100644 --- a/reference/algorithm/mismatch.md +++ b/reference/algorithm/mismatch.md @@ -147,7 +147,7 @@ int main() { * std::mismatch[color ff0000] * std::to_string[link /reference/string/to_string.md] * *p.first[link /reference/utility/pair/first.md] -* *p.second[link /reference/utility/pair/second.md.nolink] +* *p.second[link /reference/utility/pair/second.md] ### 出力 ``` diff --git a/reference/utility/pair.md b/reference/utility/pair.md index 9ab4bc1199..a401e880e3 100644 --- a/reference/utility/pair.md +++ b/reference/utility/pair.md @@ -23,7 +23,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`first`](pair/first.md) | 1つめの要素 | | -| [`second`](pair/second.md.nolink) | 2つめの要素 | | +| [`second`](pair/second.md) | 2つめの要素 | | ## メンバ関数 diff --git a/reference/utility/pair/second.md b/reference/utility/pair/second.md new file mode 100644 index 0000000000..9a48a6d25b --- /dev/null +++ b/reference/utility/pair/second.md @@ -0,0 +1,34 @@ +# second +* pair[meta header] +* std[meta namespace] +* pair[meta class] +* variable[meta id-type] + +```cpp +T2 second; +``` + +## 概要 +[`pair`](/reference/utility/pair.md)クラスのメンバ変数で、2つめの要素を表す。 + +## 例 +```cpp example +#include + +int main() { + std::pair p(1, 2); + std::cout << p.second << std::endl; +} +``` +* std::pair[link /reference/utility/pair.md] +* p.second[color ff0000] + +### 出力 +``` +2 +``` + +## 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file From 0ceee86d587c80436a21a61dd886694693655161 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 11 Jul 2025 12:00:31 +0900 Subject: [PATCH 2184/3948] fixed header for `first.md` and `second.md` --- reference/utility/pair/first.md | 2 +- reference/utility/pair/second.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/utility/pair/first.md b/reference/utility/pair/first.md index 4e7a02fe26..e92833f5b9 100644 --- a/reference/utility/pair/first.md +++ b/reference/utility/pair/first.md @@ -1,5 +1,5 @@ # first -* pair[meta header] +* utility[meta header] * std[meta namespace] * pair[meta class] * variable[meta id-type] diff --git a/reference/utility/pair/second.md b/reference/utility/pair/second.md index 9a48a6d25b..e90f2539d0 100644 --- a/reference/utility/pair/second.md +++ b/reference/utility/pair/second.md @@ -1,5 +1,5 @@ # second -* pair[meta header] +* utility[meta header] * std[meta namespace] * pair[meta class] * variable[meta id-type] From 54a31ae5524b53cfe37296b87e8556f8f0a3a576 Mon Sep 17 00:00:00 2001 From: suomesta Date: Fri, 11 Jul 2025 21:34:03 +0900 Subject: [PATCH 2185/3948] remove std:: from macro --- reference/cstdio/eof.md | 1 - reference/cstdio/filename_max.md | 1 - reference/cstdio/stderr.md | 1 - reference/cstdio/stdin.md | 1 - reference/cstdio/stdout.md | 1 - 5 files changed, 5 deletions(-) diff --git a/reference/cstdio/eof.md b/reference/cstdio/eof.md index c881bc945a..3d881e4e83 100644 --- a/reference/cstdio/eof.md +++ b/reference/cstdio/eof.md @@ -1,6 +1,5 @@ # EOF * cstdio[meta header] -* std[meta namespace] * macro[meta id-type] ```cpp diff --git a/reference/cstdio/filename_max.md b/reference/cstdio/filename_max.md index 83c07fb2c8..172e3013ed 100644 --- a/reference/cstdio/filename_max.md +++ b/reference/cstdio/filename_max.md @@ -1,6 +1,5 @@ # FILENAME_MAX * cstdio[meta header] -* std[meta namespace] * macro[meta id-type] ```cpp diff --git a/reference/cstdio/stderr.md b/reference/cstdio/stderr.md index 886da3ccf1..1909dbab28 100644 --- a/reference/cstdio/stderr.md +++ b/reference/cstdio/stderr.md @@ -1,6 +1,5 @@ # stderr * cstdio[meta header] -* std[meta namespace] * macro[meta id-type] ```cpp diff --git a/reference/cstdio/stdin.md b/reference/cstdio/stdin.md index 4310cb24f5..44a907f0a9 100644 --- a/reference/cstdio/stdin.md +++ b/reference/cstdio/stdin.md @@ -1,6 +1,5 @@ # stdin * cstdio[meta header] -* std[meta namespace] * macro[meta id-type] ```cpp diff --git a/reference/cstdio/stdout.md b/reference/cstdio/stdout.md index dec08c801b..e417835178 100644 --- a/reference/cstdio/stdout.md +++ b/reference/cstdio/stdout.md @@ -1,6 +1,5 @@ # stdout * cstdio[meta header] -* std[meta namespace] * macro[meta id-type] ```cpp From 61a0b4d9f0671da6e81b692074eac49b71ee9a12 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Thu, 10 Jul 2025 09:58:01 +0900 Subject: [PATCH 2186/3948] =?UTF-8?q?fix(reference/{cstdlib,streambuf}):?= =?UTF-8?q?=20C++=E3=81=A7=E3=81=AF=20main(void)=20=E3=81=A7=E3=81=AF?= =?UTF-8?q?=E3=81=AA=E3=81=8F=20main()=20=E3=81=A7=E8=89=AF=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit C++ では main(void) と書くのは一般的でない。C言語では main() と書くと 引数は何でも良いことになっているので、main(void) と書かいて引数がない ことを明示して引数のチェックを行う方が良かった。しかし C++ では、関数 の多重定義のため引数もリンク時の修飾名の一部なので省略できず、main() だけでC言語の main(void) と同じ意味になる。 --- reference/cstdlib/atoi_atol_atoll.md | 2 +- reference/cstdlib/calloc.md | 2 +- reference/cstdlib/free.md | 2 +- reference/cstdlib/malloc.md | 2 +- reference/streambuf/basic_streambuf/eback.md | 2 +- reference/streambuf/basic_streambuf/egptr.md | 2 +- reference/streambuf/basic_streambuf/epptr.md | 2 +- reference/streambuf/basic_streambuf/gbump.md | 2 +- reference/streambuf/basic_streambuf/gptr.md | 2 +- reference/streambuf/basic_streambuf/in_avail.md | 2 +- reference/streambuf/basic_streambuf/op_assign.md | 2 +- reference/streambuf/basic_streambuf/overflow.md | 2 +- reference/streambuf/basic_streambuf/pbackfail.md | 2 +- reference/streambuf/basic_streambuf/pbase.md | 2 +- reference/streambuf/basic_streambuf/pbump.md | 2 +- reference/streambuf/basic_streambuf/pptr.md | 2 +- reference/streambuf/basic_streambuf/sbumpc.md | 2 +- reference/streambuf/basic_streambuf/setg.md | 2 +- reference/streambuf/basic_streambuf/setp.md | 2 +- reference/streambuf/basic_streambuf/sgetc.md | 2 +- reference/streambuf/basic_streambuf/sgetn.md | 2 +- reference/streambuf/basic_streambuf/showmanyc.md | 2 +- reference/streambuf/basic_streambuf/snextc.md | 2 +- reference/streambuf/basic_streambuf/sputbackc.md | 2 +- reference/streambuf/basic_streambuf/sputc.md | 2 +- reference/streambuf/basic_streambuf/sputn.md | 2 +- reference/streambuf/basic_streambuf/sungetc.md | 2 +- reference/streambuf/basic_streambuf/swap.md | 2 +- reference/streambuf/basic_streambuf/sync.md | 2 +- reference/streambuf/basic_streambuf/uflow.md | 2 +- reference/streambuf/basic_streambuf/underflow.md | 2 +- reference/streambuf/basic_streambuf/xsgetn.md | 2 +- reference/streambuf/basic_streambuf/xsputn.md | 2 +- 33 files changed, 33 insertions(+), 33 deletions(-) diff --git a/reference/cstdlib/atoi_atol_atoll.md b/reference/cstdlib/atoi_atol_atoll.md index 9e43b155f8..96cd23389f 100644 --- a/reference/cstdlib/atoi_atol_atoll.md +++ b/reference/cstdlib/atoi_atol_atoll.md @@ -38,7 +38,7 @@ namespace std { #include #include -int main(void) +int main() { printf("%i\n", atoi(" -123junk")); printf("%i\n", atoi(" +321dust")); diff --git a/reference/cstdlib/calloc.md b/reference/cstdlib/calloc.md index eb60a7016d..d546f368c3 100644 --- a/reference/cstdlib/calloc.md +++ b/reference/cstdlib/calloc.md @@ -33,7 +33,7 @@ namespace std { #include #include -int main(void) +int main() { int* p1 = calloc(4, sizeof(int)); // 4個のint配列のポインタを確保、0に初期化 int* p2 = calloc(1, sizeof(int[4])); // 上と同じ diff --git a/reference/cstdlib/free.md b/reference/cstdlib/free.md index 5ebd2ff786..bd67dec954 100644 --- a/reference/cstdlib/free.md +++ b/reference/cstdlib/free.md @@ -23,7 +23,7 @@ namespace std { ## 実装例 ```cpp example -int main(void) +int main() { int *p1 = malloc(10*sizeof *p1); free(p1); // p1のメモリを解放 diff --git a/reference/cstdlib/malloc.md b/reference/cstdlib/malloc.md index 21a7221dbb..03cd570654 100644 --- a/reference/cstdlib/malloc.md +++ b/reference/cstdlib/malloc.md @@ -40,7 +40,7 @@ cppref より引用。 #include #include -int main(void) +int main() { int *p1 = malloc(4*sizeof(int)); // 4個のint型配列の目盛りを確保 int *p2 = malloc(sizeof(int[4])); // 上と同じ。 diff --git a/reference/streambuf/basic_streambuf/eback.md b/reference/streambuf/basic_streambuf/eback.md index 68fb80c20e..bd8df4bdff 100644 --- a/reference/streambuf/basic_streambuf/eback.md +++ b/reference/streambuf/basic_streambuf/eback.md @@ -41,7 +41,7 @@ public: } }; -int main(void) { +int main() { dummy_buf buf{}; std::cout << *buf.eback() << std::endl; // 先頭のポインタにアクセス } diff --git a/reference/streambuf/basic_streambuf/egptr.md b/reference/streambuf/basic_streambuf/egptr.md index 753d5f1ade..70fe6c41d3 100644 --- a/reference/streambuf/basic_streambuf/egptr.md +++ b/reference/streambuf/basic_streambuf/egptr.md @@ -41,7 +41,7 @@ public: } }; -int main(void) { +int main() { dummy_buf buf{}; std::cout << *(buf.egptr() - 10) << std::endl; // 末尾から逆算して先頭のポインタにアクセス } diff --git a/reference/streambuf/basic_streambuf/epptr.md b/reference/streambuf/basic_streambuf/epptr.md index 3739b24989..46743c87e6 100644 --- a/reference/streambuf/basic_streambuf/epptr.md +++ b/reference/streambuf/basic_streambuf/epptr.md @@ -40,7 +40,7 @@ public: } }; -int main(void) { +int main() { char space[10] = {}; dummy_buf buf{space, space + 10}; std::cout << buf.epptr() - space << std::endl; // epptr()の位置を確認 diff --git a/reference/streambuf/basic_streambuf/gbump.md b/reference/streambuf/basic_streambuf/gbump.md index ff11501679..b743858120 100644 --- a/reference/streambuf/basic_streambuf/gbump.md +++ b/reference/streambuf/basic_streambuf/gbump.md @@ -41,7 +41,7 @@ public: } }; -int main(void) { +int main() { dummy_buf buf{}; buf.gbump(2); // 現在位置を2つ進める std::cout << char(buf.sgetc()) << std::endl; diff --git a/reference/streambuf/basic_streambuf/gptr.md b/reference/streambuf/basic_streambuf/gptr.md index 394141c147..ba7c8e0f03 100644 --- a/reference/streambuf/basic_streambuf/gptr.md +++ b/reference/streambuf/basic_streambuf/gptr.md @@ -41,7 +41,7 @@ public: } }; -int main(void) { +int main() { dummy_buf buf{}; std::cout << *buf.gptr() << std::endl; // 現在位置のポインタにアクセス buf.snextc(); // 現在位置を1つ進める diff --git a/reference/streambuf/basic_streambuf/in_avail.md b/reference/streambuf/basic_streambuf/in_avail.md index d90e08113b..2f028a882b 100644 --- a/reference/streambuf/basic_streambuf/in_avail.md +++ b/reference/streambuf/basic_streambuf/in_avail.md @@ -39,7 +39,7 @@ public: } }; -int main(void) { +int main() { dummy_buf buf{}; std::cout << buf.in_avail() << std::endl; } diff --git a/reference/streambuf/basic_streambuf/op_assign.md b/reference/streambuf/basic_streambuf/op_assign.md index 4660c19aeb..16704f8d24 100644 --- a/reference/streambuf/basic_streambuf/op_assign.md +++ b/reference/streambuf/basic_streambuf/op_assign.md @@ -51,7 +51,7 @@ public: } }; -int main(void) { +int main() { dummy_buf buf1{}; dummy_buf buf2{}; std::cout << char(buf1.sbumpc()) << std::endl; diff --git a/reference/streambuf/basic_streambuf/overflow.md b/reference/streambuf/basic_streambuf/overflow.md index 770a7a80c6..b8bbd4d553 100644 --- a/reference/streambuf/basic_streambuf/overflow.md +++ b/reference/streambuf/basic_streambuf/overflow.md @@ -48,7 +48,7 @@ protected: } }; -int main(void) { +int main() { char space[10] = {}; dummy_buf buf{space, space + 2}; std::cout << buf.sputc('A') << std::endl; // 'A'を書き込む diff --git a/reference/streambuf/basic_streambuf/pbackfail.md b/reference/streambuf/basic_streambuf/pbackfail.md index 989643fadb..4265b78405 100644 --- a/reference/streambuf/basic_streambuf/pbackfail.md +++ b/reference/streambuf/basic_streambuf/pbackfail.md @@ -45,7 +45,7 @@ public: } }; -int main(void) { +int main() { dummy_buf buf{}; buf.sbumpc(); // 現在位置を1つ進める diff --git a/reference/streambuf/basic_streambuf/pbase.md b/reference/streambuf/basic_streambuf/pbase.md index a4064df668..e7937781f5 100644 --- a/reference/streambuf/basic_streambuf/pbase.md +++ b/reference/streambuf/basic_streambuf/pbase.md @@ -40,7 +40,7 @@ public: } }; -int main(void) { +int main() { char space[10] = {}; dummy_buf buf{space, space + 10}; std::cout << buf.pbase() - space << std::endl; // pbase()の位置を確認 diff --git a/reference/streambuf/basic_streambuf/pbump.md b/reference/streambuf/basic_streambuf/pbump.md index 266756bc28..5413248135 100644 --- a/reference/streambuf/basic_streambuf/pbump.md +++ b/reference/streambuf/basic_streambuf/pbump.md @@ -40,7 +40,7 @@ public: } }; -int main(void) { +int main() { char space[10] = {}; dummy_buf buf{space, space + 10}; buf.pbump(2); // 現在位置を2つ進める diff --git a/reference/streambuf/basic_streambuf/pptr.md b/reference/streambuf/basic_streambuf/pptr.md index 88c2f384f6..31ea21daeb 100644 --- a/reference/streambuf/basic_streambuf/pptr.md +++ b/reference/streambuf/basic_streambuf/pptr.md @@ -40,7 +40,7 @@ public: } }; -int main(void) { +int main() { char space[10] = {}; dummy_buf buf{space, space + 10}; std::cout << buf.pptr() - space << std::endl; // pptr()の位置を確認 diff --git a/reference/streambuf/basic_streambuf/sbumpc.md b/reference/streambuf/basic_streambuf/sbumpc.md index c2466208ad..48031b02ab 100644 --- a/reference/streambuf/basic_streambuf/sbumpc.md +++ b/reference/streambuf/basic_streambuf/sbumpc.md @@ -38,7 +38,7 @@ public: } }; -int main(void) { +int main() { dummy_buf buf{}; std::cout << buf.in_avail() << std::endl; std::cout << char(buf.sbumpc()) << std::endl; // 1文字目の’A'を読み取り、現在位置を1つ進める diff --git a/reference/streambuf/basic_streambuf/setg.md b/reference/streambuf/basic_streambuf/setg.md index 81d1b8f4e9..b6a9189fda 100644 --- a/reference/streambuf/basic_streambuf/setg.md +++ b/reference/streambuf/basic_streambuf/setg.md @@ -37,7 +37,7 @@ public: } }; -int main(void) { +int main() { dummy_buf buf{}; std::cout << char(buf.sgetc()) << std::endl; // 現在位置の文字を読み取る } diff --git a/reference/streambuf/basic_streambuf/setp.md b/reference/streambuf/basic_streambuf/setp.md index 7823f4bd52..3aac890d39 100644 --- a/reference/streambuf/basic_streambuf/setp.md +++ b/reference/streambuf/basic_streambuf/setp.md @@ -36,7 +36,7 @@ public: } }; -int main(void) { +int main() { char space[10] = {}; dummy_buf buf{space, space + 10}; buf.sputc('A'); // 3文字書き込む diff --git a/reference/streambuf/basic_streambuf/sgetc.md b/reference/streambuf/basic_streambuf/sgetc.md index 393f081891..29d2831779 100644 --- a/reference/streambuf/basic_streambuf/sgetc.md +++ b/reference/streambuf/basic_streambuf/sgetc.md @@ -38,7 +38,7 @@ public: } }; -int main(void) { +int main() { dummy_buf buf{}; std::cout << char(buf.sgetc()) << std::endl; // 現在位置の文字を読み取る } diff --git a/reference/streambuf/basic_streambuf/sgetn.md b/reference/streambuf/basic_streambuf/sgetn.md index 32f6bc9e83..35161c5aa6 100644 --- a/reference/streambuf/basic_streambuf/sgetn.md +++ b/reference/streambuf/basic_streambuf/sgetn.md @@ -38,7 +38,7 @@ public: } }; -int main(void) { +int main() { dummy_buf buf{}; char dump[4] = {}; diff --git a/reference/streambuf/basic_streambuf/showmanyc.md b/reference/streambuf/basic_streambuf/showmanyc.md index 212cbc7e9a..67000accfb 100644 --- a/reference/streambuf/basic_streambuf/showmanyc.md +++ b/reference/streambuf/basic_streambuf/showmanyc.md @@ -46,7 +46,7 @@ public: } }; -int main(void) { +int main() { dummy_buf buf{}; std::cout << buf.in_avail() << std::endl; // 残2文字 buf.sbumpc(); // 1文字進める diff --git a/reference/streambuf/basic_streambuf/snextc.md b/reference/streambuf/basic_streambuf/snextc.md index 3f86c4b5a3..7f89fb72b6 100644 --- a/reference/streambuf/basic_streambuf/snextc.md +++ b/reference/streambuf/basic_streambuf/snextc.md @@ -40,7 +40,7 @@ public: } }; -int main(void) { +int main() { dummy_buf buf{}; std::cout << buf.in_avail() << std::endl; std::cout << char(buf.snextc()) << std::endl; // 1文字目の’A'を捨て、次の’B'を読み取る diff --git a/reference/streambuf/basic_streambuf/sputbackc.md b/reference/streambuf/basic_streambuf/sputbackc.md index feec4de98a..b6b4ce7f63 100644 --- a/reference/streambuf/basic_streambuf/sputbackc.md +++ b/reference/streambuf/basic_streambuf/sputbackc.md @@ -42,7 +42,7 @@ public: } }; -int main(void) { +int main() { dummy_buf buf{}; buf.sbumpc(); // 現在位置を1つ進める diff --git a/reference/streambuf/basic_streambuf/sputc.md b/reference/streambuf/basic_streambuf/sputc.md index 8f793cfcb9..a35e9525e2 100644 --- a/reference/streambuf/basic_streambuf/sputc.md +++ b/reference/streambuf/basic_streambuf/sputc.md @@ -41,7 +41,7 @@ public: } }; -int main(void) { +int main() { char space[10] = {}; { dummy_buf buf{space, space}; // 空の領域を指定 diff --git a/reference/streambuf/basic_streambuf/sputn.md b/reference/streambuf/basic_streambuf/sputn.md index ee0bf4770e..5a07108d52 100644 --- a/reference/streambuf/basic_streambuf/sputn.md +++ b/reference/streambuf/basic_streambuf/sputn.md @@ -40,7 +40,7 @@ public: } }; -int main(void) { +int main() { char space[10] = {}; dummy_buf buf{space, space + 10}; std::cout << buf.sputn("ABCDE", 3) << std::endl; // 3文字書き込む diff --git a/reference/streambuf/basic_streambuf/sungetc.md b/reference/streambuf/basic_streambuf/sungetc.md index 024ab88c51..03cd3ce013 100644 --- a/reference/streambuf/basic_streambuf/sungetc.md +++ b/reference/streambuf/basic_streambuf/sungetc.md @@ -42,7 +42,7 @@ public: } }; -int main(void) { +int main() { dummy_buf buf{}; buf.sbumpc(); // 現在位置を1つ進める diff --git a/reference/streambuf/basic_streambuf/swap.md b/reference/streambuf/basic_streambuf/swap.md index 1616d7ba9f..84e71b0dfb 100644 --- a/reference/streambuf/basic_streambuf/swap.md +++ b/reference/streambuf/basic_streambuf/swap.md @@ -39,7 +39,7 @@ public: } }; -int main(void) { +int main() { dummy_buf buf1{}; dummy_buf buf2{}; std::cout << char(buf1.sbumpc()) << std::endl; diff --git a/reference/streambuf/basic_streambuf/sync.md b/reference/streambuf/basic_streambuf/sync.md index ea505041d7..29bdafa09b 100644 --- a/reference/streambuf/basic_streambuf/sync.md +++ b/reference/streambuf/basic_streambuf/sync.md @@ -43,7 +43,7 @@ protected: } }; -int main(void) { +int main() { dummy_buf buf; buf.pubsync(); // pubsync()を介してsync()を呼ぶ } diff --git a/reference/streambuf/basic_streambuf/uflow.md b/reference/streambuf/basic_streambuf/uflow.md index 6be8e58317..ef3c8b2961 100644 --- a/reference/streambuf/basic_streambuf/uflow.md +++ b/reference/streambuf/basic_streambuf/uflow.md @@ -51,7 +51,7 @@ protected: } }; -int main(void) { +int main() { dummy_buf buf{}; std::cout << buf.sbumpc() << std::endl; // 1文字目の’A'を読み取る std::cout << buf.sbumpc() << std::endl; // 2文字目の’B'を読み取る diff --git a/reference/streambuf/basic_streambuf/underflow.md b/reference/streambuf/basic_streambuf/underflow.md index f80807486d..19e0b9bfaa 100644 --- a/reference/streambuf/basic_streambuf/underflow.md +++ b/reference/streambuf/basic_streambuf/underflow.md @@ -49,7 +49,7 @@ protected: } }; -int main(void) { +int main() { dummy_buf buf{}; std::cout << buf.sgetc() << std::endl; // 1文字目の’A'を読み取る buf.sbumpc(); // 1文字進める diff --git a/reference/streambuf/basic_streambuf/xsgetn.md b/reference/streambuf/basic_streambuf/xsgetn.md index 12faef1b3c..feb9c33b26 100644 --- a/reference/streambuf/basic_streambuf/xsgetn.md +++ b/reference/streambuf/basic_streambuf/xsgetn.md @@ -45,7 +45,7 @@ public: } }; -int main(void) { +int main() { dummy_buf buf{}; char dump1[4] = {}; diff --git a/reference/streambuf/basic_streambuf/xsputn.md b/reference/streambuf/basic_streambuf/xsputn.md index 4d4fe9364f..a8d265a505 100644 --- a/reference/streambuf/basic_streambuf/xsputn.md +++ b/reference/streambuf/basic_streambuf/xsputn.md @@ -44,7 +44,7 @@ public: } }; -int main(void) { +int main() { char space[10] = {}; dummy_buf buf{space, space + 5}; std::cout << buf.xsputn("ABC", 3) << std::endl; // 3文字全て書き込む From b7e97a53b67edb9598df6ae6af3580e90e4ec4c6 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Thu, 10 Jul 2025 10:16:39 +0900 Subject: [PATCH 2187/3948] =?UTF-8?q?fix(reference/{cstdio,cstdlib}):=20C?= =?UTF-8?q?=E4=BA=92=E6=8F=9B=E3=83=98=E3=83=83=E3=83=80=E3=81=AE=E9=96=A2?= =?UTF-8?q?=E6=95=B0=E3=83=BB=E5=9E=8B=E3=81=AF=20std::=20=E3=82=92?= =?UTF-8?q?=E3=81=A4=E3=81=91=E3=81=AA=E3=81=8D=E3=82=83=E3=83=80=E3=83=A1?= =?UTF-8?q?!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdio/eof.md | 12 ++++++------ reference/cstdio/fclose.md | 10 +++++----- reference/cstdio/fgetc.md | 8 ++++---- reference/cstdio/fgets.md | 8 ++++---- reference/cstdio/file.md | 4 +++- reference/cstdio/fopen.md | 14 +++++++------- reference/cstdio/fputc.md | 4 ++-- reference/cstdio/fputs.md | 2 +- reference/cstdio/getc.md | 12 +++++++----- reference/cstdio/getchar.md | 12 +++++++----- reference/cstdio/putc.md | 18 ++++++++++-------- reference/cstdio/putchar.md | 18 ++++++++++-------- reference/cstdio/puts.md | 8 +++++--- reference/cstdio/ungetc.md | 16 +++++++++------- reference/cstdlib/atoi_atol_atoll.md | 14 +++++++------- reference/cstdlib/calloc.md | 14 +++++++------- reference/cstdlib/free.md | 12 ++++++------ reference/cstdlib/malloc.md | 14 +++++++------- 18 files changed, 107 insertions(+), 93 deletions(-) diff --git a/reference/cstdio/eof.md b/reference/cstdio/eof.md index 3d881e4e83..a309e99de5 100644 --- a/reference/cstdio/eof.md +++ b/reference/cstdio/eof.md @@ -16,18 +16,18 @@ #include int main() { int c; - while ((c = getchar()) != EOF) { - putchar(c); + while ((c = std::getchar()) != EOF) { + std::putchar(c); } if (c == EOF) - puts("REACHED END"); + std::puts("REACHED END"); } ``` * EOF[color ff0000] -* getchar[link /reference/cstdio/getchar.md] -* putchar[link /reference/cstdio/putchar.md] -* puts[link /reference/cstdio/puts.md] +* std::getchar[link /reference/cstdio/getchar.md] +* std::putchar[link /reference/cstdio/putchar.md] +* std::puts[link /reference/cstdio/puts.md] ### 入力 ``` diff --git a/reference/cstdio/fclose.md b/reference/cstdio/fclose.md index 3f71ddac47..d243e34fd3 100644 --- a/reference/cstdio/fclose.md +++ b/reference/cstdio/fclose.md @@ -28,13 +28,13 @@ namespace std { #include int main() { - FILE *fp = fopen("test.txt", "w"); - fclose(fp); + std::FILE *fp = std::fopen("test.txt", "w"); + std::fclose(fp); } ``` -* fclose[color ff0000] -* fopen[link /reference/cstdio/fopen.md] -* FILE[link /reference/cstdio/file.md] +* std::fclose[color ff0000] +* std::fopen[link /reference/cstdio/fopen.md] +* std::FILE[link /reference/cstdio/file.md] ## 処理系 - [Clang](/implementation.md#clang): ?? diff --git a/reference/cstdio/fgetc.md b/reference/cstdio/fgetc.md index 339a6e005c..ab874b65fd 100644 --- a/reference/cstdio/fgetc.md +++ b/reference/cstdio/fgetc.md @@ -23,13 +23,13 @@ namespace std { int main() { int c; - while ((c = fgetc(stdin)) != EOF) { - putc(c, stdout); + while ((c = std::fgetc(stdin)) != EOF) { + std::putc(c, stdout); } } ``` -* fgetc[color ff0000] -* putc[link /reference/cstdio/putc.md] +* std::fgetc[color ff0000] +* std::putc[link /reference/cstdio/putc.md] ### 入力 ``` diff --git a/reference/cstdio/fgets.md b/reference/cstdio/fgets.md index 712ef1ce2d..459603dd13 100644 --- a/reference/cstdio/fgets.md +++ b/reference/cstdio/fgets.md @@ -25,12 +25,12 @@ namespace std { int main() { char str[10]; - fgets(str, sizeof(str), stdin); - puts(str); + std::fgets(str, sizeof(str), stdin); + std::puts(str); } ``` -* fgets[color ff0000] -* puts[link /reference/cstdio/puts.md] +* std::fgets[color ff0000] +* std::puts[link /reference/cstdio/puts.md] ### 入力 ``` diff --git a/reference/cstdio/file.md b/reference/cstdio/file.md index d3fbc50c36..5791670be1 100644 --- a/reference/cstdio/file.md +++ b/reference/cstdio/file.md @@ -4,7 +4,9 @@ * class[meta id-type] ```cpp -typedef /* unspecified */ FILE; +namespace std { + typedef /* unspecified */ FILE; +} ``` ## 概要 diff --git a/reference/cstdio/fopen.md b/reference/cstdio/fopen.md index d49135b103..664b9078c4 100644 --- a/reference/cstdio/fopen.md +++ b/reference/cstdio/fopen.md @@ -24,19 +24,19 @@ namespace std { #include int main() { - FILE *fp = fopen("test.txt", "w"); + std::FILE *fp = std::fopen("test.txt", "w"); if (fp == NULL) { - printf("ファイルを開けませんでした\n"); + std::printf("ファイルを開けませんでした\n"); return 1; } - fclose(fp); + std::fclose(fp); return 0; } ``` -* fopen[color ff0000] -* fclose[link /reference/cstdio/fclose.md] -* FILE[link /reference/cstdio/file.md] -* printf[link /reference/cstdio/printf.md] +* std::fopen[color ff0000] +* std::fclose[link /reference/cstdio/fclose.md] +* std::FILE[link /reference/cstdio/file.md] +* std::printf[link /reference/cstdio/printf.md] ## 処理系 - [Clang](/implementation.md#clang): ?? diff --git a/reference/cstdio/fputc.md b/reference/cstdio/fputc.md index ffeea5614c..e8d38e7fd3 100644 --- a/reference/cstdio/fputc.md +++ b/reference/cstdio/fputc.md @@ -24,10 +24,10 @@ namespace std { #include int main() { - fputc('a', stdout); + std::fputc('a', stdout); } ``` -* fputc[color ff0000] +* std::fputc[color ff0000] * stdout[link /reference/cstdio/stdout.md] ### 出力 diff --git a/reference/cstdio/fputs.md b/reference/cstdio/fputs.md index 1b0c445fbb..2c999f159e 100644 --- a/reference/cstdio/fputs.md +++ b/reference/cstdio/fputs.md @@ -20,7 +20,7 @@ namespace std { #include int main() { - fputs("Hello, World!\n", stdout); + std::fputs("Hello, World!\n", stdout); return 0; } ``` diff --git a/reference/cstdio/getc.md b/reference/cstdio/getc.md index fc5b1b0a07..5a6ca5f959 100644 --- a/reference/cstdio/getc.md +++ b/reference/cstdio/getc.md @@ -4,7 +4,9 @@ * function[meta id-type] ```cpp -int getc(FILE* stream); +namespace std { + int getc(FILE* stream); +} ``` ## 概要 @@ -21,13 +23,13 @@ int getc(FILE* stream); int main() { int c; - while ((c = getc(stdin)) != EOF) { - putc(c, stdout); + while ((c = std::getc(stdin)) != EOF) { + std::putc(c, stdout); } } ``` -* getc[color ff0000] -* putc[link /reference/cstdio/putc.md] +* std::getc[color ff0000] +* std::putc[link /reference/cstdio/putc.md] ### 入力 ``` diff --git a/reference/cstdio/getchar.md b/reference/cstdio/getchar.md index 2024ff8cd0..025379e4ab 100644 --- a/reference/cstdio/getchar.md +++ b/reference/cstdio/getchar.md @@ -4,7 +4,9 @@ * function[meta id-type] ```cpp -int getchar(); +namespace std { + int getchar(); +} ``` ## 概要 @@ -22,13 +24,13 @@ int getchar(); #include int main() { int c; - while ((c = getchar()) != EOF) { - putchar(c); + while ((c = std::getchar()) != EOF) { + std::putchar(c); } } ``` -* getchar[color ff0000] -* putchar[link /reference/cstdio/putchar.md] +* std::getchar[color ff0000] +* std::putchar[link /reference/cstdio/putchar.md] * EOF[link /reference/cstdio/eof.md] ### 入力 diff --git a/reference/cstdio/putc.md b/reference/cstdio/putc.md index 568c7769e1..6179bf5ad5 100644 --- a/reference/cstdio/putc.md +++ b/reference/cstdio/putc.md @@ -4,7 +4,9 @@ * function[meta id-type] ```cpp -int putc(int c, FILE* stream); +namespace std { + int putc(int c, FILE* stream); +} ``` ## 概要 @@ -18,15 +20,15 @@ int putc(int c, FILE* stream); #include int main() { - putc('H', stdout); - putc('e', stdout); - putc('l', stdout); - putc('l', stdout); - putc('o', stdout); - putc('\n', stdout); + std::putc('H', stdout); + std::putc('e', stdout); + std::putc('l', stdout); + std::putc('l', stdout); + std::putc('o', stdout); + std::putc('\n', stdout); } ``` -* putc[color ff0000] +* std::putc[color ff0000] * stdout[link /reference/cstdio/stdout.md] ### 出力 diff --git a/reference/cstdio/putchar.md b/reference/cstdio/putchar.md index b96fa54455..02a129938f 100644 --- a/reference/cstdio/putchar.md +++ b/reference/cstdio/putchar.md @@ -4,7 +4,9 @@ * function[meta id-type] ```cpp -int putchar(int c); +namespace std { + int putchar(int c); +} ``` ## 概要 @@ -20,15 +22,15 @@ int putchar(int c); #include int main() { - putchar('H'); - putchar('e'); - putchar('l'); - putchar('l'); - putchar('o'); - putchar('\n'); + std::putchar('H'); + std::putchar('e'); + std::putchar('l'); + std::putchar('l'); + std::putchar('o'); + std::putchar('\n'); } ``` -* putchar[color ff0000] +* std::putchar[color ff0000] ### 出力 ``` diff --git a/reference/cstdio/puts.md b/reference/cstdio/puts.md index f8c6d348cd..3cc0b0faeb 100644 --- a/reference/cstdio/puts.md +++ b/reference/cstdio/puts.md @@ -4,7 +4,9 @@ * function[meta id-type] ```cpp -int puts(const char* str); +namespace std { + int puts(const char* str); +} ``` ## 概要 @@ -20,10 +22,10 @@ int puts(const char* str); #include int main() { - puts("Hello, World!"); + std::puts("Hello, World!"); } ``` -* puts[color ff0000] +* std::puts[color ff0000] ### 出力 ``` diff --git a/reference/cstdio/ungetc.md b/reference/cstdio/ungetc.md index a767adc390..e6de5582f9 100644 --- a/reference/cstdio/ungetc.md +++ b/reference/cstdio/ungetc.md @@ -4,7 +4,9 @@ * function[meta id-type] ```cpp -int ungetc(int c, FILE *stream); +namespace std { + int ungetc(int c, FILE *stream); +} ``` ## 概要 @@ -24,14 +26,14 @@ int ungetc(int c, FILE *stream); #include int main() { - putchar(getchar()); - ungetc('A', stdin); - putchar(getchar()); + std::putchar(std::getchar()); + std::ungetc('A', stdin); + std::putchar(std::getchar()); } ``` -* ungetc[color ff0000] -* getchar[link /reference/cstdio/getchar.md] -* putchar[link /reference/cstdio/putchar.md] +* std::ungetc[color ff0000] +* std::getchar[link /reference/cstdio/getchar.md] +* std::putchar[link /reference/cstdio/putchar.md] ### 入力 ``` diff --git a/reference/cstdlib/atoi_atol_atoll.md b/reference/cstdlib/atoi_atol_atoll.md index 96cd23389f..00e59ca879 100644 --- a/reference/cstdlib/atoi_atol_atoll.md +++ b/reference/cstdlib/atoi_atol_atoll.md @@ -40,13 +40,13 @@ namespace std { int main() { - printf("%i\n", atoi(" -123junk")); - printf("%i\n", atoi(" +321dust")); - printf("%i\n", atoi("0")); - printf("%i\n", atoi("0042")); // 先頭の0を含む10進数として変換 - printf("%i\n", atoi("0x2A")); // 0のみを変換、"x2A"は破棄される - printf("%i\n", atoi("junk")); // 変換不可 - printf("%i\n", atoi("2147483648")); //intの範囲外 + std::printf("%i\n", std::atoi(" -123junk")); + std::printf("%i\n", std::atoi(" +321dust")); + std::printf("%i\n", std::atoi("0")); + std::printf("%i\n", std::atoi("0042")); // 先頭の0を含む10進数として変換 + std::printf("%i\n", std::atoi("0x2A")); // 0のみを変換、"x2A"は破棄される + std::printf("%i\n", std::atoi("junk")); // 変換不可 + std::printf("%i\n", std::atoi("2147483648")); //intの範囲外 } ``` diff --git a/reference/cstdlib/calloc.md b/reference/cstdlib/calloc.md index d546f368c3..943cee76fd 100644 --- a/reference/cstdlib/calloc.md +++ b/reference/cstdlib/calloc.md @@ -35,19 +35,19 @@ namespace std { int main() { - int* p1 = calloc(4, sizeof(int)); // 4個のint配列のポインタを確保、0に初期化 - int* p2 = calloc(1, sizeof(int[4])); // 上と同じ - int* p3 = calloc(4, sizeof *p3); // 上と同じ + int* p1 = std::calloc(4, sizeof(int)); // 4個のint配列のポインタを確保、0に初期化 + int* p2 = std::calloc(1, sizeof(int[4])); // 上と同じ + int* p3 = std::calloc(4, sizeof *p3); // 上と同じ if (p2) { for (int n = 0; n < 4; ++n) - printf("p2[%d] == %d\n", n, p2[n]); + std::printf("p2[%d] == %d\n", n, p2[n]); } - free(p1); - free(p2); - free(p3); + std::free(p1); + std::free(p2); + std::free(p3); } ``` diff --git a/reference/cstdlib/free.md b/reference/cstdlib/free.md index bd67dec954..6d57030b0f 100644 --- a/reference/cstdlib/free.md +++ b/reference/cstdlib/free.md @@ -25,15 +25,15 @@ namespace std { ```cpp example int main() { - int *p1 = malloc(10*sizeof *p1); - free(p1); // p1のメモリを解放 + int *p1 = std::malloc(10*sizeof *p1); + std::free(p1); // p1のメモリを解放 - int *p2 = calloc(10, sizeof *p2); - int *p3 = realloc(p2, 1000*sizeof *p3); + int *p2 = std::calloc(10, sizeof *p2); + int *p3 = std::realloc(p2, 1000*sizeof *p3); if(p3) - free(p3); // realloc により新しい領域が確保された場合、それを解放 + std::free(p3); // realloc により新しい領域が確保された場合、それを解放 else - free(p2); // realloc が失敗した場合は元の領域を解放 + std::free(p2); // realloc が失敗した場合は元の領域を解放 } ``` ### 出力 diff --git a/reference/cstdlib/malloc.md b/reference/cstdlib/malloc.md index 03cd570654..2c89b4c842 100644 --- a/reference/cstdlib/malloc.md +++ b/reference/cstdlib/malloc.md @@ -42,20 +42,20 @@ cppref より引用。 int main() { - int *p1 = malloc(4*sizeof(int)); // 4個のint型配列の目盛りを確保 - int *p2 = malloc(sizeof(int[4])); // 上と同じ。 - int *p3 = malloc(4*sizeof *p3); // 上と同じ。 + int *p1 = std::malloc(4*sizeof(int)); // 4個のint型配列の目盛りを確保 + int *p2 = std::malloc(sizeof(int[4])); // 上と同じ。 + int *p3 = std::malloc(4*sizeof *p3); // 上と同じ。 if(p1) { for(int n=0; n<4; ++n) p1[n] = n*n; for(int n=0; n<4; ++n) - printf("p1[%d] == %d\n", n, p1[n]); + std::printf("p1[%d] == %d\n", n, p1[n]); } - free(p1);//メモリを解放 - free(p2); - free(p3); + std::free(p1);//メモリを解放 + std::free(p2); + std::free(p3); } ``` From 562668e59091462862029019ab93c5797f1bb525 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Thu, 10 Jul 2025 10:53:05 +0900 Subject: [PATCH 2188/3948] =?UTF-8?q?fix(reference/cstdlib):=20=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E4=BE=8B=E3=81=AE=E3=83=98=E3=83=83=E3=83=80?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/free.md | 2 ++ reference/cstdlib/malloc.md | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/reference/cstdlib/free.md b/reference/cstdlib/free.md index 6d57030b0f..57c64a7e80 100644 --- a/reference/cstdlib/free.md +++ b/reference/cstdlib/free.md @@ -23,6 +23,8 @@ namespace std { ## 実装例 ```cpp example +#include + int main() { int *p1 = std::malloc(10*sizeof *p1); diff --git a/reference/cstdlib/malloc.md b/reference/cstdlib/malloc.md index 2c89b4c842..5594c7f46b 100644 --- a/reference/cstdlib/malloc.md +++ b/reference/cstdlib/malloc.md @@ -37,7 +37,7 @@ namespace std { cppref より引用。 ```cpp example -#include +#include #include int main() From 74fec0c3ad1a686d937443531461c371e17b7ad6 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Thu, 10 Jul 2025 10:18:26 +0900 Subject: [PATCH 2189/3948] =?UTF-8?q?fix(reference/cstdio/fputs):=20?= =?UTF-8?q?=E8=A8=98=E4=BA=8B=E5=90=8D=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdio/fputs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdio/fputs.md b/reference/cstdio/fputs.md index 2c999f159e..518429041b 100644 --- a/reference/cstdio/fputs.md +++ b/reference/cstdio/fputs.md @@ -1,4 +1,4 @@ -# fputs.md +# fputs * cstdio[meta header] * std[meta namespace] * function[meta id-type] From 993c9f883180f753ad6c455c9460b1f9a6b2ed31 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Thu, 10 Jul 2025 10:26:30 +0900 Subject: [PATCH 2190/3948] =?UTF-8?q?style(*):=20=E3=83=95=E3=82=A1?= =?UTF-8?q?=E3=82=A4=E3=83=AB=E6=9C=AB=E5=B0=BE=E3=81=AB=E6=94=B9=E8=A1=8C?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 貢献ポイント備考: 手動で編集したわけではありません。以下のコマンドを使っ て一括変更したのち diff の目視確認をしました。 $ for file in $(tail -vc 1 $(find . -name \*.md) | awk 'NF==3{file=$2;next}!/^$/{print file}'); do echo >> $file; done --- lang/cpp11/alias_templates.md | 2 +- lang/cpp11/alignas.md | 2 +- lang/cpp11/alignof.md | 2 +- lang/cpp11/c99_predefined_macros.md | 2 +- lang/cpp11/char16_32.md | 2 +- lang/cpp11/delegating_constructors.md | 2 +- lang/cpp11/dependent_name_specifier_outside_of_templates.md | 2 +- lang/cpp11/deprecation_of_the_register_keyword.md | 2 +- lang/cpp11/earlier_declarated_array_bounds.md | 2 +- lang/cpp11/explicit_conversion_operator.md | 2 +- lang/cpp11/extend_friend_targets.md | 2 +- ...eof_to_apply_to_non_static_data_members_without_an_object.md | 2 +- lang/cpp11/extern_template.md | 2 +- lang/cpp11/feature_test_macros.md | 2 +- lang/cpp11/func.md | 2 +- lang/cpp11/global_scope_syntax_in_nested_name_specifier.md | 2 +- lang/cpp11/inheriting_constructors.md | 2 +- lang/cpp11/inline_namespaces.md | 2 +- lang/cpp11/local_and_unnamed_type_as_template_arguments.md | 2 +- lang/cpp11/noexcept.md | 2 +- lang/cpp11/non_static_data_member_initializers.md | 2 +- lang/cpp11/nullptr.md | 2 +- lang/cpp11/override_final.md | 2 +- lang/cpp11/pragma_operator.md | 2 +- lang/cpp11/predefined_macros.md | 2 +- lang/cpp11/range_based_for.md | 2 +- lang/cpp11/ref_qualifier_for_this.md | 2 +- lang/cpp11/reference_collapsing.md | 2 +- lang/cpp11/remove_export_templates.md | 2 +- lang/cpp11/reserved_namespaces_for_posix.md | 2 +- lang/cpp11/result_of_integer_division_and_modulo.md | 2 +- lang/cpp11/rvalue_ref_and_move_semantics.md | 2 +- lang/cpp11/sfinae_expressions.md | 2 +- lang/cpp11/static_initialization_thread_safely.md | 2 +- lang/cpp11/string_literal_concatenation.md | 2 +- lang/cpp11/thread_local_storage.md | 2 +- lang/cpp11/trailing_comma_following_enumerator_list.md | 2 +- lang/cpp11/trailing_return_types.md | 2 +- lang/cpp11/uniform_initialization.md | 2 +- lang/cpp11/user_defined_literals.md | 2 +- lang/cpp11/utf8_string_literals.md | 2 +- lang/cpp11/variadic_macros.md | 2 +- lang/cpp14/binary_literals.md | 2 +- lang/cpp14/brace_elision_in_array_temporary_initialization.md | 2 +- lang/cpp14/clarifying_memory_allocation.md | 2 +- lang/cpp14/decltype_auto.md | 2 +- lang/cpp14/deprecated_attr.md | 2 +- lang/cpp14/digit_separators.md | 2 +- lang/cpp14/generic_lambdas.md | 2 +- lang/cpp14/initialize_capture.md | 2 +- lang/cpp14/member_initializers_and_aggregates.md | 2 +- lang/cpp14/no_whitespace_literal_operators.md | 2 +- lang/cpp14/nontype_template_parameters_of_type_nullptr_t.md | 2 +- lang/cpp14/placeholder_type_in_trailing_return_type.md | 2 +- lang/cpp14/predefined_macros.md | 2 +- lang/cpp14/return_type_deduction_for_normal_functions.md | 2 +- lang/cpp14/sized_deallocation.md | 2 +- lang/cpp14/variable_templates.md | 2 +- ...w_constant_evaluation_for_all_non-type_template_arguments.md | 2 +- .../allow_default_template_arguments_of_variable_templates.md | 2 +- lang/cpp17/allow_typename_in_a_template_template_parameter.md | 2 +- lang/cpp17/attributes_for_namespaces_and_enumerators.md | 2 +- lang/cpp17/construction_enum_class_values.md | 2 +- lang/cpp17/declaring_non-type_template_arguments_with_auto.md | 2 +- lang/cpp17/dynamic_memory_allocation_for_over-aligned_data.md | 2 +- lang/cpp17/exception_spec_be_part_of_the_type_system.md | 2 +- lang/cpp17/expression_evaluation_order.md | 2 +- lang/cpp17/extending_static_assert.md | 2 +- lang/cpp17/extension_to_aggregate_initialization.md | 2 +- lang/cpp17/fallthrough.md | 2 +- lang/cpp17/has_include.md | 2 +- lang/cpp17/inline_variables.md | 2 +- lang/cpp17/lambda_capture_of_this_by_value.md | 2 +- lang/cpp17/lambda_to_noexcept_function_pointer.md | 2 +- lang/cpp17/maybe_unused.md | 2 +- lang/cpp17/nested_namespace.md | 2 +- lang/cpp17/nodiscard.md | 2 +- lang/cpp17/pack_expansions_in_using.md | 2 +- lang/cpp17/predefined_macros.md | 2 +- lang/cpp17/remove_deprecated_exception_specifications.md | 2 +- lang/cpp17/remove_deprecated_increment_of_bool.md | 2 +- lang/cpp17/remove_deprecated_use_of_the_register_keyword.md | 2 +- lang/cpp17/removing_trigraphs.md | 2 +- lang/cpp17/type_deduction_for_class_templates.md | 2 +- lang/cpp17/using_attribute_namespaces.md | 2 +- lang/cpp17/utf8_character_literals.md | 2 +- lang/cpp20/access_checking_on_specializations.md | 2 +- lang/cpp20/adl_and_function_templates_that_are_not_visible.md | 2 +- ...itializing_aggregates_from_a_parenthesized_list_of_values.md | 2 +- lang/cpp20/allow_lambda_capture_equal_this.md | 2 +- lang/cpp20/allow_pack_expansion_in_lambda_init_capture.md | 2 +- lang/cpp20/allow_structured_bindings_to_accessible_members.md | 2 +- .../allow_virtual_function_calls_in_constant_expressions.md | 2 +- lang/cpp20/array_size_deduction_in_new-expressions.md | 2 +- .../changing_the_active_member_of_a_union_inside_constexpr.md | 2 +- lang/cpp20/char8_t.md | 2 +- lang/cpp20/checking_for_abstract_class_types.md | 2 +- lang/cpp20/class_template_argument_deduction_for_aggregates.md | 2 +- .../class_template_argument_deduction_for_alias_templates.md | 2 +- lang/cpp20/constinit.md | 2 +- ...rting_from_pointer_to_bool_should_be_considered_narrowing.md | 2 +- .../default_constructible_and_assignable_stateless_lambdas.md | 2 +- lang/cpp20/default_member_initializers_for_bit_fields.md | 2 +- lang/cpp20/deprecate_arithmetic_conversion_on_enumerations.md | 2 +- lang/cpp20/deprecate_implicit_capture_of_this_via_defcopy.md | 2 +- lang/cpp20/deprecate_pod.md | 2 +- ...te_uses_of_the_comma_operator_in_subscripting_expressions.md | 2 +- lang/cpp20/deprecating_volatile.md | 2 +- lang/cpp20/designated_initialization.md | 2 +- lang/cpp20/down_with_typename.md | 2 +- ...itting_unevaluated_inline-assembly_in_constexpr_functions.md | 2 +- lang/cpp20/explicit_bool.md | 2 +- ...structured_bindings_to_be_more_like_variable_declarations.md | 2 +- lang/cpp20/familiar_template_syntax_for_generic_lambdas.md | 2 +- lang/cpp20/fixing_const_qualified_pointers_to_members.md | 2 +- lang/cpp20/function_templates_with_auto_parameters.md | 2 +- lang/cpp20/language_support_for_empty_objects.md | 2 +- lang/cpp20/less_eager_instantiation_of_constexpr_functions.md | 2 +- lang/cpp20/make_char16t_char32t_string_literals_be_utf16_32.md | 2 +- lang/cpp20/nested_inline_mamespaces.md | 2 +- lang/cpp20/nodiscard_should_have_a_reason.md | 2 +- lang/cpp20/permit_conversions_to_arrays_of_unknown_bound.md | 2 +- ...ting_trivial_default_initialization_in_constexpr_contexts.md | 2 +- lang/cpp20/predefined_macros.md | 2 +- .../prohibit_aggregates_with_user-declared_constructors.md | 2 +- lang/cpp20/range-based_for_statements_with_initializer.md | 2 +- lang/cpp20/reference_capture_of_structured_bindings.md | 2 +- ...xing_the_range_for_loop_customization_point_finding_rules.md | 2 +- ...the_structured_bindings_customization_point_finding_rules.md | 2 +- .../resolving_const_mismatch_with_defaulted_copy_constructor.md | 2 +- lang/cpp20/signed_integers_are_twos_complement.md | 2 +- lang/cpp20/simplifying_implicit_lambda_capture.md | 2 +- lang/cpp20/try-catch_blocks_in_constexpr_functions.md | 2 +- lang/cpp20/using_enum.md | 2 +- lang/cpp20/va_opt.md | 2 +- lang/cpp20/wording_for_lambdas_in_unevaluated_contexts.md | 2 +- lang/cpp23/attributes_on_lambda_expressions.md | 2 +- lang/cpp23/character_encoding_of_diagnostic_text.md | 2 +- lang/cpp23/class_template_argument_deduction_from_inherited.md | 2 +- lang/cpp23/consistent_character_literal_encoding.md | 2 +- lang/cpp23/delimited_escape_sequences.md | 2 +- lang/cpp23/down_with_lambda_parens.md | 2 +- lang/cpp23/extend_init_statement_to_allow_alias_declaration.md | 2 +- lang/cpp23/feature_test_macros.md | 2 +- lang/cpp23/generalized_wording_for_partial_specializations.md | 2 +- lang/cpp23/labels_at_the_end_of_compound_statements.md | 2 +- lang/cpp23/literal_suffix_for_signed_size_t.md | 2 +- lang/cpp23/make_declaration_order_layout_mandated.md | 2 +- lang/cpp23/meaningful_exports.md | 2 +- lang/cpp23/mixed_string_literal_concatenation.md | 2 +- lang/cpp23/multidimensional_subscript_operator.md | 2 +- lang/cpp23/narrowing_contextual_conversions_to_bool.md | 2 +- lang/cpp23/non_literal_variables_in_constexpr_functions.md | 2 +- ...mitting_static_constexpr_variables_in_constexpr_functions.md | 2 +- lang/cpp23/portable_assumptions.md | 2 +- lang/cpp23/predefined_macros.md | 2 +- lang/cpp23/simpler_implicit_move.md | 2 +- lang/cpp23/static_operator.md | 2 +- .../support_for_utf8_as_a_portable_source_file_encoding.md | 2 +- lang/cpp23/warning.md | 2 +- .../remove_deprecated_arithmetic_conversion_on_enumerations.md | 2 +- lang/cpp26/structured_bindings_can_introduce_a_pack.md | 2 +- lang/cpp26/user-generated_static_assert_messages.md | 2 +- lang/future/contract-based_programming.md | 2 +- reference/any/any_cast.md | 2 +- reference/cctype/isgraph.md | 2 +- reference/cctype/ispunct.md | 2 +- reference/contracts/contract_violation.md | 2 +- reference/contracts/contract_violation/comment.md | 2 +- reference/contracts/contract_violation/detection_mode.md | 2 +- reference/contracts/contract_violation/is_terminating.md | 2 +- reference/contracts/contract_violation/kind.md | 2 +- reference/contracts/contract_violation/semantic.md | 2 +- .../contracts/invoke_default_contract_violation_handler.md | 2 +- reference/cstdio/feof.md | 2 +- reference/cstdio/fflush.md | 2 +- reference/cstdio/fputs.md | 2 +- reference/cstdio/putc.md | 2 +- reference/cstdio/rename.md | 2 +- reference/cstdio/ungetc.md | 2 +- reference/execution/execution/read_env.md | 2 +- reference/fstream/basic_filebuf/native_handle.md | 2 +- reference/fstream/basic_fstream/native_handle.md | 2 +- reference/fstream/basic_ifstream/native_handle.md | 2 +- reference/fstream/basic_ofstream/native_handle.md | 2 +- reference/functional/bind_back.md | 2 +- reference/functional/bind_front.md | 2 +- reference/functional/invoke.md | 2 +- reference/functional/not_fn.md | 2 +- reference/functional/ref.md | 2 +- reference/iterator/common_iterator.md | 2 +- reference/iterator/contiguous_iterator.md | 2 +- reference/iterator/iter_common_reference_t.md | 2 +- reference/iterator/iter_reference_t.md | 2 +- reference/iterator/iter_rvalue_reference_t.md | 2 +- reference/linalg/setup_givens_rotation_result.md | 2 +- reference/memory/enable_shared_from_this/op_constructor.md | 2 +- reference/memory/enable_shared_from_this/op_destructor.md | 2 +- reference/memory_resource/get_default_resource.md | 2 +- reference/memory_resource/memory_resource/do_is_equal.md | 2 +- reference/memory_resource/memory_resource/is_equal.md | 2 +- reference/memory_resource/memory_resource/op_equal.md | 2 +- .../memory_resource/monotonic_buffer_resource/op_destructor.md | 2 +- reference/memory_resource/monotonic_buffer_resource/release.md | 2 +- .../monotonic_buffer_resource/upstream_resource.md | 2 +- reference/memory_resource/new_delete_resource.md | 2 +- .../memory_resource/polymorphic_allocator/op_constructor.md | 2 +- reference/memory_resource/polymorphic_allocator/op_equal.md | 2 +- reference/memory_resource/polymorphic_allocator/resource.md | 2 +- .../select_on_container_copy_construction.md | 2 +- reference/memory_resource/pool_resource/op_destructor.md | 2 +- reference/memory_resource/pool_resource/release.md | 2 +- reference/random/bernoulli_distribution/op_constructor.md | 2 +- reference/random/binomial_distribution/op_constructor.md | 2 +- reference/random/cauchy_distribution/op_constructor.md | 2 +- reference/random/chi_squared_distribution/op_constructor.md | 2 +- reference/random/exponential_distribution/op_constructor.md | 2 +- reference/random/extreme_value_distribution/op_constructor.md | 2 +- reference/random/fisher_f_distribution/op_constructor.md | 2 +- reference/random/gamma_distribution/op_constructor.md | 2 +- reference/random/geometric_distribution/op_constructor.md | 2 +- reference/random/linear_congruential_engine/op_constructor.md | 2 +- reference/random/lognormal_distribution/op_constructor.md | 2 +- reference/random/mersenne_twister_engine/op_constructor.md | 2 +- .../random/negative_binomial_distribution/op_constructor.md | 2 +- reference/random/normal_distribution/op_constructor.md | 2 +- reference/random/poisson_distribution/op_constructor.md | 2 +- reference/random/random_device/op_constructor.md | 2 +- reference/random/student_t_distribution/op_constructor.md | 2 +- reference/random/uniform_int_distribution/op_constructor.md | 2 +- reference/random/weibull_distribution/op_constructor.md | 2 +- reference/ranges/adjacent_transform_view/base.md | 2 +- reference/ranges/adjacent_transform_view/begin.md | 2 +- reference/ranges/adjacent_transform_view/end.md | 2 +- reference/ranges/adjacent_transform_view/op_constructor.md | 2 +- reference/ranges/adjacent_transform_view/size.md | 2 +- reference/ranges/adjacent_view/base.md | 2 +- reference/ranges/adjacent_view/begin.md | 2 +- reference/ranges/adjacent_view/end.md | 2 +- reference/ranges/adjacent_view/op_constructor.md | 2 +- reference/ranges/adjacent_view/size.md | 2 +- reference/ranges/cartesian_product_view/begin.md | 2 +- reference/ranges/cartesian_product_view/end.md | 2 +- reference/ranges/cartesian_product_view/op_constructor.md | 2 +- reference/ranges/cartesian_product_view/size.md | 2 +- reference/ranges/chunk_by_view/base.md | 2 +- reference/ranges/chunk_by_view/begin.md | 2 +- reference/ranges/chunk_by_view/end.md | 2 +- reference/ranges/chunk_by_view/op_constructor.md | 2 +- reference/ranges/chunk_by_view/pred.md | 2 +- reference/ranges/chunk_view/base.md | 2 +- reference/ranges/chunk_view/begin.md | 2 +- reference/ranges/chunk_view/end.md | 2 +- reference/ranges/chunk_view/op_constructor.md | 2 +- reference/ranges/chunk_view/size.md | 2 +- reference/ranges/common_view/base.md | 2 +- reference/ranges/common_view/begin.md | 2 +- reference/ranges/common_view/end.md | 2 +- reference/ranges/common_view/op_constructor.md | 2 +- reference/ranges/common_view/op_deduction_guide.md | 2 +- reference/ranges/common_view/size.md | 2 +- reference/ranges/drop_view/base.md | 2 +- reference/ranges/drop_view/begin.md | 2 +- reference/ranges/drop_view/end.md | 2 +- reference/ranges/drop_view/op_constructor.md | 2 +- reference/ranges/drop_view/op_deduction_guide.md | 2 +- reference/ranges/drop_view/size.md | 2 +- reference/ranges/drop_while_view/base.md | 2 +- reference/ranges/drop_while_view/begin.md | 2 +- reference/ranges/drop_while_view/end.md | 2 +- reference/ranges/drop_while_view/op_constructor.md | 2 +- reference/ranges/drop_while_view/op_deduction_guide.md | 2 +- reference/ranges/drop_while_view/pred.md | 2 +- reference/ranges/elements_view/base.md | 2 +- reference/ranges/elements_view/begin.md | 2 +- reference/ranges/elements_view/end.md | 2 +- reference/ranges/elements_view/op_constructor.md | 2 +- reference/ranges/elements_view/op_deduction_guide.md | 2 +- reference/ranges/elements_view/size.md | 2 +- reference/ranges/empty_view/enable_borrowed_range.md | 2 +- reference/ranges/enumerate_view/base.md | 2 +- reference/ranges/enumerate_view/begin.md | 2 +- reference/ranges/enumerate_view/end.md | 2 +- reference/ranges/enumerate_view/op_constructor.md | 2 +- reference/ranges/enumerate_view/size.md | 2 +- reference/ranges/join_view/base.md | 2 +- reference/ranges/join_view/begin.md | 2 +- reference/ranges/join_view/end.md | 2 +- reference/ranges/join_view/op_constructor.md | 2 +- reference/ranges/join_view/op_deduction_guide.md | 2 +- reference/ranges/join_with_view/base.md | 2 +- reference/ranges/join_with_view/begin.md | 2 +- reference/ranges/join_with_view/end.md | 2 +- reference/ranges/join_with_view/op_constructor.md | 2 +- reference/ranges/join_with_view/op_deduction_guide.md | 2 +- reference/ranges/lazy_split_view/base.md | 2 +- reference/ranges/lazy_split_view/begin.md | 2 +- reference/ranges/lazy_split_view/end.md | 2 +- reference/ranges/lazy_split_view/op_constructor.md | 2 +- reference/ranges/lazy_split_view/op_deduction_guide.md | 2 +- reference/ranges/reverse_view/base.md | 2 +- reference/ranges/reverse_view/begin.md | 2 +- reference/ranges/reverse_view/end.md | 2 +- reference/ranges/reverse_view/op_constructor.md | 2 +- reference/ranges/reverse_view/size.md | 2 +- reference/ranges/slide_view/base.md | 2 +- reference/ranges/slide_view/begin.md | 2 +- reference/ranges/slide_view/end.md | 2 +- reference/ranges/slide_view/op_constructor.md | 2 +- reference/ranges/slide_view/size.md | 2 +- reference/ranges/split_view/base.md | 2 +- reference/ranges/split_view/begin.md | 2 +- reference/ranges/split_view/end.md | 2 +- reference/ranges/split_view/op_constructor.md | 2 +- reference/ranges/split_view/op_deduction_guide.md | 2 +- reference/ranges/stride_view/base.md | 2 +- reference/ranges/stride_view/begin.md | 2 +- reference/ranges/stride_view/end.md | 2 +- reference/ranges/stride_view/op_constructor.md | 2 +- reference/ranges/stride_view/size.md | 2 +- reference/ranges/stride_view/stride.md | 2 +- reference/ranges/take_view.md | 2 +- reference/ranges/take_view/base.md | 2 +- reference/ranges/take_view/begin.md | 2 +- reference/ranges/take_view/end.md | 2 +- reference/ranges/take_view/op_constructor.md | 2 +- reference/ranges/take_view/op_deduction_guide.md | 2 +- reference/ranges/take_view/size.md | 2 +- reference/ranges/take_while_view/base.md | 2 +- reference/ranges/take_while_view/begin.md | 2 +- reference/ranges/take_while_view/end.md | 2 +- reference/ranges/take_while_view/op_constructor.md | 2 +- reference/ranges/take_while_view/op_deduction_guide.md | 2 +- reference/ranges/take_while_view/pred.md | 2 +- reference/ranges/to_input_view/base.md | 2 +- reference/ranges/to_input_view/begin.md | 2 +- reference/ranges/to_input_view/end.md | 2 +- reference/ranges/to_input_view/op_constructor.md | 2 +- reference/ranges/to_input_view/op_deduction_guide.md | 2 +- reference/ranges/to_input_view/size.md | 2 +- reference/ranges/zip_transform_view/begin.md | 2 +- reference/ranges/zip_transform_view/end.md | 2 +- reference/ranges/zip_transform_view/op_constructor.md | 2 +- reference/ranges/zip_transform_view/size.md | 2 +- reference/ranges/zip_view/begin.md | 2 +- reference/ranges/zip_view/end.md | 2 +- reference/ranges/zip_view/op_constructor.md | 2 +- reference/ranges/zip_view/size.md | 2 +- reference/source_location/source_location/file_name.md | 2 +- reference/source_location/source_location/function_name.md | 2 +- reference/sstream/basic_istringstream/op_assign.md | 2 +- reference/sstream/basic_istringstream/op_constructor.md | 2 +- reference/sstream/basic_istringstream/str.md | 2 +- reference/sstream/basic_istringstream/swap_free.md | 2 +- reference/sstream/basic_istringstream/view.md | 2 +- reference/sstream/basic_ostringstream/op_assign.md | 2 +- reference/sstream/basic_ostringstream/op_constructor.md | 2 +- reference/sstream/basic_ostringstream/str.md | 2 +- reference/sstream/basic_ostringstream/swap_free.md | 2 +- reference/sstream/basic_ostringstream/view.md | 2 +- reference/sstream/basic_stringbuf/get_allocator.md | 2 +- reference/sstream/basic_stringbuf/op_assign.md | 2 +- reference/sstream/basic_stringbuf/str.md | 2 +- reference/sstream/basic_stringbuf/swap_free.md | 2 +- reference/sstream/basic_stringstream/op_assign.md | 2 +- reference/sstream/basic_stringstream/view.md | 2 +- reference/utility/pair/first.md | 2 +- reference/utility/pair/second.md | 2 +- 368 files changed, 368 insertions(+), 368 deletions(-) diff --git a/lang/cpp11/alias_templates.md b/lang/cpp11/alias_templates.md index c2108cbf73..c264855152 100644 --- a/lang/cpp11/alias_templates.md +++ b/lang/cpp11/alias_templates.md @@ -107,4 +107,4 @@ typedef void_alloc::rebind::other int_alloc; - [N1451 A Case for Template Aliasing](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1451.html) - [N1489 Templates aliases for C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1489.pdf) - [N2112 Templates Aliases](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2112.pdf) -- [N2258 Templates Aliases](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf) \ No newline at end of file +- [N2258 Templates Aliases](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf) diff --git a/lang/cpp11/alignas.md b/lang/cpp11/alignas.md index a97dbd4a0d..fa86b3472a 100644 --- a/lang/cpp11/alignas.md +++ b/lang/cpp11/alignas.md @@ -115,4 +115,4 @@ N2341 からはわからない、恐らくないと思われる。 ## 参照 -- [N2341 Adding Alignment Support to the C++ Programming Language / Wording](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf) \ No newline at end of file +- [N2341 Adding Alignment Support to the C++ Programming Language / Wording](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf) diff --git a/lang/cpp11/alignof.md b/lang/cpp11/alignof.md index 08731ddf93..e42996a814 100644 --- a/lang/cpp11/alignof.md +++ b/lang/cpp11/alignof.md @@ -85,4 +85,4 @@ N2341 からはわからない、恐らくないと思われる。 ## 参照 -- [N2341 Adding Alignment Support to the C++ Programming Language / Wording](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf) \ No newline at end of file +- [N2341 Adding Alignment Support to the C++ Programming Language / Wording](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf) diff --git a/lang/cpp11/c99_predefined_macros.md b/lang/cpp11/c99_predefined_macros.md index c4060ebbb8..02728d6a64 100644 --- a/lang/cpp11/c99_predefined_macros.md +++ b/lang/cpp11/c99_predefined_macros.md @@ -25,4 +25,4 @@ ## 参照 - [N1653 Working draft changes for C99 preprocessor synchronization](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm) -- [CWG Issue 630. Equality of narrow and wide character values in the basic character set](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#630) \ No newline at end of file +- [CWG Issue 630. Equality of narrow and wide character values in the basic character set](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#630) diff --git a/lang/cpp11/char16_32.md b/lang/cpp11/char16_32.md index 4364f5d20f..98fbcd9d35 100644 --- a/lang/cpp11/char16_32.md +++ b/lang/cpp11/char16_32.md @@ -151,4 +151,4 @@ int main() - [N2018 New Character Types in C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2018.html) - [N2149 New Character Types in C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2149.html) - [N2249 New Character Types in C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2249.html) -- [N2170 Universal Character Names in Literals](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2170.html) \ No newline at end of file +- [N2170 Universal Character Names in Literals](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2170.html) diff --git a/lang/cpp11/delegating_constructors.md b/lang/cpp11/delegating_constructors.md index 8bf2fa178f..8a1fafcced 100644 --- a/lang/cpp11/delegating_constructors.md +++ b/lang/cpp11/delegating_constructors.md @@ -89,4 +89,4 @@ ECMA規格となっているC++/CLIには、この問題を解決するための - [N1581 Delegating Constructors](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1581.pdf) - [N1618 Delegating Constructors (revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1618.pdf) - [N1895 Delegating Constructors (revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1895.pdf) -- [N1986 Delegating Constructors (revision 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf) \ No newline at end of file +- [N1986 Delegating Constructors (revision 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf) diff --git a/lang/cpp11/dependent_name_specifier_outside_of_templates.md b/lang/cpp11/dependent_name_specifier_outside_of_templates.md index 96c2678447..63dda2aae3 100644 --- a/lang/cpp11/dependent_name_specifier_outside_of_templates.md +++ b/lang/cpp11/dependent_name_specifier_outside_of_templates.md @@ -45,4 +45,4 @@ int main() ## 参照 - [CWG Issue 382. Allow `typename` outside of templates](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#382) -- [CWG Issue 468. Allow `::template` outside of templates](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#468) \ No newline at end of file +- [CWG Issue 468. Allow `::template` outside of templates](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#468) diff --git a/lang/cpp11/deprecation_of_the_register_keyword.md b/lang/cpp11/deprecation_of_the_register_keyword.md index de0e1de6e9..dfe9da57d4 100644 --- a/lang/cpp11/deprecation_of_the_register_keyword.md +++ b/lang/cpp11/deprecation_of_the_register_keyword.md @@ -31,4 +31,4 @@ register int v = 42; ## 参照 -- [CWG Issue 809. Deprecation of the `register` keyword](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#809) \ No newline at end of file +- [CWG Issue 809. Deprecation of the `register` keyword](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#809) diff --git a/lang/cpp11/earlier_declarated_array_bounds.md b/lang/cpp11/earlier_declarated_array_bounds.md index 133f953271..c0f463b2a7 100644 --- a/lang/cpp11/earlier_declarated_array_bounds.md +++ b/lang/cpp11/earlier_declarated_array_bounds.md @@ -26,4 +26,4 @@ int S::y[]; // 要素数は10 ## 参照 -- [CWG Issue 619. Completeness of array types](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#619) \ No newline at end of file +- [CWG Issue 619. Completeness of array types](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#619) diff --git a/lang/cpp11/explicit_conversion_operator.md b/lang/cpp11/explicit_conversion_operator.md index 22d5b87b8e..7239d95dab 100644 --- a/lang/cpp11/explicit_conversion_operator.md +++ b/lang/cpp11/explicit_conversion_operator.md @@ -81,4 +81,4 @@ int main() - [N1592 Explicit Conversion Operators](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1592.pdf) - [N2223 Explicit Conversion Operator Draft Working Paper](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2223.pdf) - [N2333 Explicit Conversion Operator Draft Working Paper Revision 1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2333.html) -- [N2437 Explicit Conversion Operator Draft Working Paper (revision 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf) \ No newline at end of file +- [N2437 Explicit Conversion Operator Draft Working Paper (revision 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf) diff --git a/lang/cpp11/extend_friend_targets.md b/lang/cpp11/extend_friend_targets.md index 0a11daa113..a5357069ab 100644 --- a/lang/cpp11/extend_friend_targets.md +++ b/lang/cpp11/extend_friend_targets.md @@ -60,4 +60,4 @@ int main() - [N1520 Extended friend Declarations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1520.pdf) - [N1616 Extended friend Declarations (Rev. 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1616.pdf) - [N1722 Extended friend Declarations (Rev. 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1722.pdf) -- [N1791 Extended friend Declarations (Rev. 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1791.pdf) \ No newline at end of file +- [N1791 Extended friend Declarations (Rev. 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1791.pdf) diff --git a/lang/cpp11/extending_sizeof_to_apply_to_non_static_data_members_without_an_object.md b/lang/cpp11/extending_sizeof_to_apply_to_non_static_data_members_without_an_object.md index d13a9b3d04..a9776f1a43 100644 --- a/lang/cpp11/extending_sizeof_to_apply_to_non_static_data_members_without_an_object.md +++ b/lang/cpp11/extending_sizeof_to_apply_to_non_static_data_members_without_an_object.md @@ -33,4 +33,4 @@ int main() - [CWG Issue 198. Definition of "use" in local and nested classes](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#198) - [CWG Issue 613. Unevaluated uses of non-static class members](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#613) - [N2150 Extending sizeof to apply to non-static data members without an object](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2150.html) -- [N2253 Extending sizeof to apply to non-static data members without an object (revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2253.html) \ No newline at end of file +- [N2253 Extending sizeof to apply to non-static data members without an object (revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2253.html) diff --git a/lang/cpp11/extern_template.md b/lang/cpp11/extern_template.md index 7bedc9cd92..51475cd920 100644 --- a/lang/cpp11/extern_template.md +++ b/lang/cpp11/extern_template.md @@ -63,4 +63,4 @@ void user2() ## 参照 - [N1448 Controlling Implicit Template Instantiation](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1448.pdf) -- [N1987 Adding "extern template" (version 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1987.htm) \ No newline at end of file +- [N1987 Adding "extern template" (version 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1987.htm) diff --git a/lang/cpp11/feature_test_macros.md b/lang/cpp11/feature_test_macros.md index 82389f169d..91ce752abb 100644 --- a/lang/cpp11/feature_test_macros.md +++ b/lang/cpp11/feature_test_macros.md @@ -37,4 +37,4 @@ SD-6 は C++11 の機能について以下のテストマクロを定義する | `__has_cpp_attribute(noreturn)` | `200809` | [属性](attributes.md#noreturn) | predefined | ## 参照 -- [SD-6: SG10 Feature Test Recommendations: Standard C++](https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations#recs.cpp11) \ No newline at end of file +- [SD-6: SG10 Feature Test Recommendations: Standard C++](https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations#recs.cpp11) diff --git a/lang/cpp11/func.md b/lang/cpp11/func.md index e6a6baa91f..243021d94a 100644 --- a/lang/cpp11/func.md +++ b/lang/cpp11/func.md @@ -90,4 +90,4 @@ S::print() : print ## 参照 - [N1534 Proposed addition of `__func__` predefined identifier from C99](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1534.txt) - [5.41 Function Names as Strings - GCC](https://gcc.gnu.org/onlinedocs/gcc-3.3.5/gcc/Function-Names.html) -- [Predefined macros | Microsoft Docs](https://docs.microsoft.com/ja-JP/cpp/preprocessor/predefined-macros?view=vs-2019) \ No newline at end of file +- [Predefined macros | Microsoft Docs](https://docs.microsoft.com/ja-JP/cpp/preprocessor/predefined-macros?view=vs-2019) diff --git a/lang/cpp11/global_scope_syntax_in_nested_name_specifier.md b/lang/cpp11/global_scope_syntax_in_nested_name_specifier.md index 8787c5e7c0..63f356a276 100644 --- a/lang/cpp11/global_scope_syntax_in_nested_name_specifier.md +++ b/lang/cpp11/global_scope_syntax_in_nested_name_specifier.md @@ -44,4 +44,4 @@ nested-name-specifier: ## 参照 -- [CWG Issue 355. Global-scope `::` in nested-name-specifier](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#355) \ No newline at end of file +- [CWG Issue 355. Global-scope `::` in nested-name-specifier](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#355) diff --git a/lang/cpp11/inheriting_constructors.md b/lang/cpp11/inheriting_constructors.md index 10dda8705d..fcb6140bbc 100644 --- a/lang/cpp11/inheriting_constructors.md +++ b/lang/cpp11/inheriting_constructors.md @@ -102,4 +102,4 @@ struct Derived : Base { - [N2376 Inheriting Constructors (revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2376.html) - [N2438 Inheriting Constructors (revision 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2438.htm) - [N2512 Inheriting Constructors (revision 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2512.html) -- [N2540 Inheriting Constructors (revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2540.htm) \ No newline at end of file +- [N2540 Inheriting Constructors (revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2540.htm) diff --git a/lang/cpp11/inline_namespaces.md b/lang/cpp11/inline_namespaces.md index 36986907ac..81c6ad53c2 100644 --- a/lang/cpp11/inline_namespaces.md +++ b/lang/cpp11/inline_namespaces.md @@ -250,4 +250,4 @@ v2 - [7.9 Namespace Association - Using the GNU Compiler Collection (GCC)](https://gcc.gnu.org/onlinedocs/gcc-4.9.4/gcc/Namespace-Association.html) - [CWG Issue 812. Duplicate names in inline namespaces](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#812) - [CWG Issue 861. Unintended ambiguity in inline namespace lookup](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#861) -- [Inline namespaces and ambigous declarations - Stackoverflow](http://stackoverflow.com/questions/27252466/inline-namespaces-and-ambigous-declarations/) \ No newline at end of file +- [Inline namespaces and ambigous declarations - Stackoverflow](http://stackoverflow.com/questions/27252466/inline-namespaces-and-ambigous-declarations/) diff --git a/lang/cpp11/local_and_unnamed_type_as_template_arguments.md b/lang/cpp11/local_and_unnamed_type_as_template_arguments.md index 4b7096e83e..17d8743820 100644 --- a/lang/cpp11/local_and_unnamed_type_as_template_arguments.md +++ b/lang/cpp11/local_and_unnamed_type_as_template_arguments.md @@ -49,4 +49,4 @@ int main() - [N2187 Names, Linkage, and Templates (rev 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2187.pdf) - [N2402 Names, Linkage, and Templates (rev 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2402.pdf) - [N2635 Local and Unnamed Types as Template Arguments](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2635.html) -- [N2657 Local and Unnamed Types as Template Arguments](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm) \ No newline at end of file +- [N2657 Local and Unnamed Types as Template Arguments](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm) diff --git a/lang/cpp11/noexcept.md b/lang/cpp11/noexcept.md index 5bd496b725..461dedd5c0 100644 --- a/lang/cpp11/noexcept.md +++ b/lang/cpp11/noexcept.md @@ -196,4 +196,4 @@ int main() - [N3204 Deducing "`noexcept`" for destructors](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3204.htm) - [N3205 Delete operators default to `noexcept`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3205.htm) - [N3103 Security impact of `noexcept`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3103.pdf) -- [ムーブによるpop - Faith and Brave - C++で遊ぼう](http://faithandbrave.hateblo.jp/entry/20130604/1370327651) \ No newline at end of file +- [ムーブによるpop - Faith and Brave - C++で遊ぼう](http://faithandbrave.hateblo.jp/entry/20130604/1370327651) diff --git a/lang/cpp11/non_static_data_member_initializers.md b/lang/cpp11/non_static_data_member_initializers.md index 991ae8f0b5..3c43c34f49 100644 --- a/lang/cpp11/non_static_data_member_initializers.md +++ b/lang/cpp11/non_static_data_member_initializers.md @@ -71,4 +71,4 @@ int main() - [N2354 Class member initializers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2354.htm) - [N2426 Class member initializers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2426.htm) - [N2628 Non-static data member initializers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2628.html) -- [N2756 Non-static data member initializers](http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2008/n2756.htm) \ No newline at end of file +- [N2756 Non-static data member initializers](http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2008/n2756.htm) diff --git a/lang/cpp11/nullptr.md b/lang/cpp11/nullptr.md index 509336fc4a..aa7438102b 100644 --- a/lang/cpp11/nullptr.md +++ b/lang/cpp11/nullptr.md @@ -132,4 +132,4 @@ private: - [N1488 A name for the null pointer: `nullptr`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1488.pdf) - [N1601 A name for the null pointer: `nullptr` (revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1601.pdf) - [N2214 A name for the null pointer: `nullptr` (revision 3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2214.pdf) -- [N2431 A name for the null pointer: `nullptr` (revision 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf) \ No newline at end of file +- [N2431 A name for the null pointer: `nullptr` (revision 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf) diff --git a/lang/cpp11/override_final.md b/lang/cpp11/override_final.md index 17cc8b6629..bf899feab1 100644 --- a/lang/cpp11/override_final.md +++ b/lang/cpp11/override_final.md @@ -432,4 +432,4 @@ struct D explicit : B - [N3163 Override Control Using Contextual Keywords](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3163.pdf) - [N3206 Override control: Eliminating Attributes](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3206.htm) - [N3234 Remove explicit from class-head](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3234.pdf) -- [N3272 Follow-up on override control](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3272.htm) \ No newline at end of file +- [N3272 Follow-up on override control](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3272.htm) diff --git a/lang/cpp11/pragma_operator.md b/lang/cpp11/pragma_operator.md index 698fb535a4..0606ffbab2 100644 --- a/lang/cpp11/pragma_operator.md +++ b/lang/cpp11/pragma_operator.md @@ -73,4 +73,4 @@ int main() ``` ## 参照 -- [N1653 Working draft changes for C99 preprocessor synchronization](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm) \ No newline at end of file +- [N1653 Working draft changes for C99 preprocessor synchronization](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm) diff --git a/lang/cpp11/predefined_macros.md b/lang/cpp11/predefined_macros.md index 4595795b4a..b09a5dee8b 100644 --- a/lang/cpp11/predefined_macros.md +++ b/lang/cpp11/predefined_macros.md @@ -35,4 +35,4 @@ - [N2693 Requirements on programs and backwards compatibility](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2693.html) - [CWG Issue 1169. Missing feature macro for strict pointer safety](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1169) - [P2186R2 Removing Garbage Collection Support](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2186r2.html) - - C++23でのマクロ`__STDCPP_STRICT_POINTER_SAFETY__`削除 \ No newline at end of file + - C++23でのマクロ`__STDCPP_STRICT_POINTER_SAFETY__`削除 diff --git a/lang/cpp11/range_based_for.md b/lang/cpp11/range_based_for.md index 17a78d0757..c074f1ba62 100644 --- a/lang/cpp11/range_based_for.md +++ b/lang/cpp11/range_based_for.md @@ -374,4 +374,4 @@ int main() - [N2930 Range-Based For Loop Wording (Without Concepts)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2930.html) - [N3337 Working Draft, Standard for Programming Language C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3337.pdf) - [一時オブジェクトの寿命と右辺値参照、ムーブセマンティクスのお話 - Qiita](https://qiita.com/rinse_/items/ad0cc7e351e836595c94) -- [c++ - Safe to erase from map inside range based for? - Stack Overflow](https://stackoverflow.com/questions/25246937/safe-to-erase-from-map-inside-range-based-for) \ No newline at end of file +- [c++ - Safe to erase from map inside range based for? - Stack Overflow](https://stackoverflow.com/questions/25246937/safe-to-erase-from-map-inside-range-based-for) diff --git a/lang/cpp11/ref_qualifier_for_this.md b/lang/cpp11/ref_qualifier_for_this.md index aa174c9ce7..83ccfc5e0e 100644 --- a/lang/cpp11/ref_qualifier_for_this.md +++ b/lang/cpp11/ref_qualifier_for_this.md @@ -119,4 +119,4 @@ int main() - [N1784 A proposal to add l-value member function qualifier](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1784.htm) - [N1821 Extending Move Semantics To `*this` (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1821.htm) - [N2377 Extending move semantics to `*this` (revised wording)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2377.htm) -- [N2439 Extending move semantics to `*this` (revised wording)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2439.htm) \ No newline at end of file +- [N2439 Extending move semantics to `*this` (revised wording)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2439.htm) diff --git a/lang/cpp11/reference_collapsing.md b/lang/cpp11/reference_collapsing.md index 3afd95492c..fcba5498fc 100644 --- a/lang/cpp11/reference_collapsing.md +++ b/lang/cpp11/reference_collapsing.md @@ -53,4 +53,4 @@ int main() ## 参照 -- [CWG Issue 988. Reference-to-reference collapsing with decltype](https://wg21.cmeerw.net/cwg/issue988) \ No newline at end of file +- [CWG Issue 988. Reference-to-reference collapsing with decltype](https://wg21.cmeerw.net/cwg/issue988) diff --git a/lang/cpp11/remove_export_templates.md b/lang/cpp11/remove_export_templates.md index 6d4877a3bf..7886db87f8 100644 --- a/lang/cpp11/remove_export_templates.md +++ b/lang/cpp11/remove_export_templates.md @@ -40,4 +40,4 @@ EDGフロントエンドとそれを使用するコンパイラのComeauとICC - [N3065 Removing Export](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3065.html) - [CWG Issue 820. Deprecation of export](https://wg21.cmeerw.net/cwg/issue820) - [Using export keyword with templates - StackOverflow](http://stackoverflow.com/questions/5416872/using-export-keyword-with-templates) -- [N1426 Why We Can't Afford Export](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1426.pdf) \ No newline at end of file +- [N1426 Why We Can't Afford Export](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1426.pdf) diff --git a/lang/cpp11/reserved_namespaces_for_posix.md b/lang/cpp11/reserved_namespaces_for_posix.md index c2625e06c3..4bf42b9249 100644 --- a/lang/cpp11/reserved_namespaces_for_posix.md +++ b/lang/cpp11/reserved_namespaces_for_posix.md @@ -16,4 +16,4 @@ ## 参照 -- [N2542 Reserved namespaces for POSIX](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2542.htm) \ No newline at end of file +- [N2542 Reserved namespaces for POSIX](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2542.htm) diff --git a/lang/cpp11/result_of_integer_division_and_modulo.md b/lang/cpp11/result_of_integer_division_and_modulo.md index 3408e1c7b0..cbe521f7da 100644 --- a/lang/cpp11/result_of_integer_division_and_modulo.md +++ b/lang/cpp11/result_of_integer_division_and_modulo.md @@ -47,4 +47,4 @@ int main() - [N2707 Expedited core issues handling](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2707.html) - [N2730 Expedited core issues handling (revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2730.html) - [N2757 Expedited core issues handling (revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2757.htm) -- [C++ における整数型の怪と "移植性のある" オーバーフローチェッカー (第1回 : 整数型の怪と対策の不足)](http://qiita.com/a4lg/items/541c9d9dd5d874eeef2f) \ No newline at end of file +- [C++ における整数型の怪と "移植性のある" オーバーフローチェッカー (第1回 : 整数型の怪と対策の不足)](http://qiita.com/a4lg/items/541c9d9dd5d874eeef2f) diff --git a/lang/cpp11/rvalue_ref_and_move_semantics.md b/lang/cpp11/rvalue_ref_and_move_semantics.md index bcc992bbf6..d1b980e30c 100644 --- a/lang/cpp11/rvalue_ref_and_move_semantics.md +++ b/lang/cpp11/rvalue_ref_and_move_semantics.md @@ -409,4 +409,4 @@ C++11で非推奨となった`std::auto_ptr`で実現されていた。 - [N2983 Allowing Move Constructors to Throw](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2983.html) - ムーブコンストラクタから例外を送出することを許可した経緯 - [P0135R1 Wording for guaranteed copy elision through simplified value categories](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0135r1.html) - - C++17 値カテゴリの定義 \ No newline at end of file + - C++17 値カテゴリの定義 diff --git a/lang/cpp11/sfinae_expressions.md b/lang/cpp11/sfinae_expressions.md index ab49073964..3ec04a7ef9 100644 --- a/lang/cpp11/sfinae_expressions.md +++ b/lang/cpp11/sfinae_expressions.md @@ -284,4 +284,4 @@ int main() ## 参照 - [CWG Issue 339. Overload resolution in operand of `sizeof` in constant expression](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#339) -- [N2634 Solving the SFINAE problem for expressions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2634.html) \ No newline at end of file +- [N2634 Solving the SFINAE problem for expressions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2634.html) diff --git a/lang/cpp11/static_initialization_thread_safely.md b/lang/cpp11/static_initialization_thread_safely.md index cc7deff90a..bb030b8767 100644 --- a/lang/cpp11/static_initialization_thread_safely.md +++ b/lang/cpp11/static_initialization_thread_safely.md @@ -104,4 +104,4 @@ int main() - [N2444 Dynamic Initialization and Destruction with Concurrency](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2444.html) - [N2513 Dynamic Initialization and Destruction with Concurrency](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2513.html) - [N2660 Dynamic Initialization and Destruction with Concurrency](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2660.htm) -- [C++0x時代の Double-Checked Locking - yamasaのネタ帳](http://yamasa.hatenablog.jp/entry/20100128/1264693781) \ No newline at end of file +- [C++0x時代の Double-Checked Locking - yamasaのネタ帳](http://yamasa.hatenablog.jp/entry/20100128/1264693781) diff --git a/lang/cpp11/string_literal_concatenation.md b/lang/cpp11/string_literal_concatenation.md index dd9f678ef3..6d76c39161 100644 --- a/lang/cpp11/string_literal_concatenation.md +++ b/lang/cpp11/string_literal_concatenation.md @@ -40,4 +40,4 @@ hello world ## 参照 - [N1653 Working draft changes for C99 preprocessor synchronization](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm) -- [WG14/N951 String literals and concatenation](http://www.open-std.org/jtc1/sc22/wg14/www/docs/n951.htm) \ No newline at end of file +- [WG14/N951 String literals and concatenation](http://www.open-std.org/jtc1/sc22/wg14/www/docs/n951.htm) diff --git a/lang/cpp11/thread_local_storage.md b/lang/cpp11/thread_local_storage.md index b6cc681435..150793b3c1 100644 --- a/lang/cpp11/thread_local_storage.md +++ b/lang/cpp11/thread_local_storage.md @@ -121,4 +121,4 @@ thread2 : 4 - [N2545 Thread-Local Storage](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2545.html) - [N2659 Thread-Local Storage](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2659.htm) - [Why does Apple clang disallow C++11 `thread_local` when 'official' clang supports it - Stack Overflow](http://stackoverflow.com/a/29929949/463412) - - Apple実装のClang(Xcode 7以下に付属のもの)が`thread_local`機能をサポートしない理由 \ No newline at end of file + - Apple実装のClang(Xcode 7以下に付属のもの)が`thread_local`機能をサポートしない理由 diff --git a/lang/cpp11/trailing_comma_following_enumerator_list.md b/lang/cpp11/trailing_comma_following_enumerator_list.md index 1050fb2311..1819549522 100644 --- a/lang/cpp11/trailing_comma_following_enumerator_list.md +++ b/lang/cpp11/trailing_comma_following_enumerator_list.md @@ -48,4 +48,4 @@ int main() {} ## 参照 -- [CWG Issue 518. Trailing comma following enumerator-list](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#518) \ No newline at end of file +- [CWG Issue 518. Trailing comma following enumerator-list](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#518) diff --git a/lang/cpp11/trailing_return_types.md b/lang/cpp11/trailing_return_types.md index cb84e79bc6..d85b3b080a 100644 --- a/lang/cpp11/trailing_return_types.md +++ b/lang/cpp11/trailing_return_types.md @@ -120,4 +120,4 @@ auto f = [](int a, int b) -> int { return a + b; } - [N2927 New wording for C++0x Lambdas (rev. 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2927.pdf) - ラムダ式の仕様と合わせて「trailing-return-type」という言葉が使われるようになった - [N2931 Unified Function Syntax](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2931.html) -- [N2954 Unified Function Syntax](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2954.html) \ No newline at end of file +- [N2954 Unified Function Syntax](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2954.html) diff --git a/lang/cpp11/uniform_initialization.md b/lang/cpp11/uniform_initialization.md index bb09025941..f388b39317 100644 --- a/lang/cpp11/uniform_initialization.md +++ b/lang/cpp11/uniform_initialization.md @@ -207,4 +207,4 @@ int main() - [N2575 Initializer Lists - Alternative Mechanism and Rationale](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2575.pdf) - [N2640 Initializer Lists - Alternative Mechanism and Rationale (v. 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2640.pdf) - [N2672 Initializer List proposed wording](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm) -- [CWG Issue 1030. Evaluation order in initializer-lists used in aggregate initialization](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1030) \ No newline at end of file +- [CWG Issue 1030. Evaluation order in initializer-lists used in aggregate initialization](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1030) diff --git a/lang/cpp11/user_defined_literals.md b/lang/cpp11/user_defined_literals.md index 144f806afe..95f036779f 100644 --- a/lang/cpp11/user_defined_literals.md +++ b/lang/cpp11/user_defined_literals.md @@ -386,4 +386,4 @@ DecimalFloat f = 12.34df; - [N2750 User-defined Literals (aka. Extensible Literals (revision 4))](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2750.pdf) - [N2765 User-defined Literals (aka. Extensible Literals (revision 5))](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2765.pdf) - [CWG Issue 935. Missing overloads for character types for user-defined literals](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#935) -- [CWG Issue 1479. Literal operators and default arguments](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1479) \ No newline at end of file +- [CWG Issue 1479. Literal operators and default arguments](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1479) diff --git a/lang/cpp11/utf8_string_literals.md b/lang/cpp11/utf8_string_literals.md index 919685ca12..e478621f47 100644 --- a/lang/cpp11/utf8_string_literals.md +++ b/lang/cpp11/utf8_string_literals.md @@ -83,4 +83,4 @@ int main() - [N2209 UTF-8 String Literals](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2209.html) - [N2295 Raw and Unicode String Literals; Unified Proposal](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2295.html) - [N2384 Raw and Unicode String Literals; Unified Proposal (Rev. 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2384.html) -- [N2442 Raw and Unicode String Literals; Unified Proposal (Rev. 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm) \ No newline at end of file +- [N2442 Raw and Unicode String Literals; Unified Proposal (Rev. 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm) diff --git a/lang/cpp11/variadic_macros.md b/lang/cpp11/variadic_macros.md index c37b0e0e73..4f422ee64d 100644 --- a/lang/cpp11/variadic_macros.md +++ b/lang/cpp11/variadic_macros.md @@ -83,4 +83,4 @@ f2 ## 参照 -- [N1653 Working draft changes for C99 preprocessor synchronization](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm) \ No newline at end of file +- [N1653 Working draft changes for C99 preprocessor synchronization](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm) diff --git a/lang/cpp14/binary_literals.md b/lang/cpp14/binary_literals.md index b07e75791a..ed7846e1b3 100644 --- a/lang/cpp14/binary_literals.md +++ b/lang/cpp14/binary_literals.md @@ -69,4 +69,4 @@ int main() ## 参照 -- [N3472 - Binary Literals in the C++ Core Language](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3472.pdf) \ No newline at end of file +- [N3472 - Binary Literals in the C++ Core Language](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3472.pdf) diff --git a/lang/cpp14/brace_elision_in_array_temporary_initialization.md b/lang/cpp14/brace_elision_in_array_temporary_initialization.md index 7218dae71d..3d6501062f 100644 --- a/lang/cpp14/brace_elision_in_array_temporary_initialization.md +++ b/lang/cpp14/brace_elision_in_array_temporary_initialization.md @@ -42,4 +42,4 @@ int x[2][2] = {1, 2, 3, 4}; - [CWG Issue 1270. Brace elision in array temporary initialization](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1270) - [vector/arrayとUniform initialization+Initializer list - yohhoyの日記](http://d.hatena.ne.jp/yohhoy/20120724/p1) - [initializer-listによるaggregate初期化の制約緩和 - yohhoyの日記](http://d.hatena.ne.jp/yohhoy/20131116/p1) -- [N3653 - Member initializers and aggregates](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3653.html) \ No newline at end of file +- [N3653 - Member initializers and aggregates](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3653.html) diff --git a/lang/cpp14/clarifying_memory_allocation.md b/lang/cpp14/clarifying_memory_allocation.md index a023eda466..720fe2cbd6 100644 --- a/lang/cpp14/clarifying_memory_allocation.md +++ b/lang/cpp14/clarifying_memory_allocation.md @@ -165,4 +165,4 @@ C++11時点で既に、そのような最適化を行うメモリアロケータ ## 参照 - [N3664 Clarifying Memory Allocation](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3664.html) -- [C++14言語編 - slideshare](https://www.slideshare.net/kariya_mitsuru/c14-84084931) \ No newline at end of file +- [C++14言語編 - slideshare](https://www.slideshare.net/kariya_mitsuru/c14-84084931) diff --git a/lang/cpp14/decltype_auto.md b/lang/cpp14/decltype_auto.md index 3e5d131c2f..5d0a2532c5 100644 --- a/lang/cpp14/decltype_auto.md +++ b/lang/cpp14/decltype_auto.md @@ -73,4 +73,4 @@ int main() ## 関連項目 -- [C++14 通常関数の戻り値型推論](return_type_deduction_for_normal_functions.md) \ No newline at end of file +- [C++14 通常関数の戻り値型推論](return_type_deduction_for_normal_functions.md) diff --git a/lang/cpp14/deprecated_attr.md b/lang/cpp14/deprecated_attr.md index 0dfa33f04c..352adfda51 100644 --- a/lang/cpp14/deprecated_attr.md +++ b/lang/cpp14/deprecated_attr.md @@ -136,4 +136,4 @@ prog.cc:45:3: warning: 'class_templ' is deprecated: don't use class_templ関連項目 -- [C++14 通常関数の戻り値型推論](return_type_deduction_for_normal_functions.md) \ No newline at end of file +- [C++14 通常関数の戻り値型推論](return_type_deduction_for_normal_functions.md) diff --git a/lang/cpp14/predefined_macros.md b/lang/cpp14/predefined_macros.md index db52387e94..89680acf37 100644 --- a/lang/cpp14/predefined_macros.md +++ b/lang/cpp14/predefined_macros.md @@ -15,4 +15,4 @@ | マクロ名 | 値 | 説明 | |---------------|-----------|-------------------------| -| `__cplusplus` | `201402L` | C++のバージョン値を表す | \ No newline at end of file +| `__cplusplus` | `201402L` | C++のバージョン値を表す | diff --git a/lang/cpp14/return_type_deduction_for_normal_functions.md b/lang/cpp14/return_type_deduction_for_normal_functions.md index fe8dc74d55..6e44b36571 100644 --- a/lang/cpp14/return_type_deduction_for_normal_functions.md +++ b/lang/cpp14/return_type_deduction_for_normal_functions.md @@ -244,4 +244,4 @@ auto g(F f) { return f(); } - [N3582 Return type deduction for normal functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3582.html) - [N3638 Return type deduction for normal functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3638.html) - [CWG Issue 1048. `auto` deduction and lambda return type deduction.](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1048) -- [CWG Issue 1588. Deducing cv-qualified `auto`](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1588) \ No newline at end of file +- [CWG Issue 1588. Deducing cv-qualified `auto`](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1588) diff --git a/lang/cpp14/sized_deallocation.md b/lang/cpp14/sized_deallocation.md index ca7e471354..a59887556c 100644 --- a/lang/cpp14/sized_deallocation.md +++ b/lang/cpp14/sized_deallocation.md @@ -112,4 +112,4 @@ delete with two arguments, 13 - [N3536 C++ Sized Deallocation](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3536.html) - [N3663 C++ Sized Deallocation](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3663.html) - [N3778 C++ Sized Deallocation](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3778.html) -- [LWG Issue 2458. N3778 and new library deallocation signatures](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2458) \ No newline at end of file +- [LWG Issue 2458. N3778 and new library deallocation signatures](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2458) diff --git a/lang/cpp14/variable_templates.md b/lang/cpp14/variable_templates.md index 139b45ad00..2727997438 100644 --- a/lang/cpp14/variable_templates.md +++ b/lang/cpp14/variable_templates.md @@ -136,4 +136,4 @@ auto main() -> int ## 参照 - [N3651 Variable Templates (Revision 1)](http://open-std.org/JTC1/SC22/WG21/docs/papers/2013/n3651.pdf) - [Trip Report: ISO C++ Spring 2013 Meeting](https://isocpp.org/blog/2013/04/trip-report-iso-c-spring-2013-meeting) -- [変数テンプレートをラムダ式でキャプチャするときの注意 - Faith and Brave - C++で遊ぼう](http://faithandbrave.hateblo.jp/entry/2014/01/21/162701) \ No newline at end of file +- [変数テンプレートをラムダ式でキャプチャするときの注意 - Faith and Brave - C++で遊ぼう](http://faithandbrave.hateblo.jp/entry/2014/01/21/162701) diff --git a/lang/cpp17/allow_constant_evaluation_for_all_non-type_template_arguments.md b/lang/cpp17/allow_constant_evaluation_for_all_non-type_template_arguments.md index 6e348ae5f8..8b63d4df17 100644 --- a/lang/cpp17/allow_constant_evaluation_for_all_non-type_template_arguments.md +++ b/lang/cpp17/allow_constant_evaluation_for_all_non-type_template_arguments.md @@ -122,4 +122,4 @@ A c; // ok! ## 参照 - [N4198 Allow constant evaluation for all non-type template arguments](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4198.html) - [N4268 Allow constant evaluation for all non-type template arguments](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4268.html) -- [C++1z 全ての非型テンプレート引数の定数式評価を許可 - Faith and Brave - C++で遊ぼう](https://faithandbrave.hateblo.jp/entry/2016/10/27/180801) \ No newline at end of file +- [C++1z 全ての非型テンプレート引数の定数式評価を許可 - Faith and Brave - C++で遊ぼう](https://faithandbrave.hateblo.jp/entry/2016/10/27/180801) diff --git a/lang/cpp17/allow_default_template_arguments_of_variable_templates.md b/lang/cpp17/allow_default_template_arguments_of_variable_templates.md index 95f72144da..e2ef8e86ef 100644 --- a/lang/cpp17/allow_default_template_arguments_of_variable_templates.md +++ b/lang/cpp17/allow_default_template_arguments_of_variable_templates.md @@ -36,4 +36,4 @@ int main() ## 参照 -- [CWG Issue 2032. Default template-arguments of variable templates](https://wg21.cmeerw.net/cwg/issue2032) \ No newline at end of file +- [CWG Issue 2032. Default template-arguments of variable templates](https://wg21.cmeerw.net/cwg/issue2032) diff --git a/lang/cpp17/allow_typename_in_a_template_template_parameter.md b/lang/cpp17/allow_typename_in_a_template_template_parameter.md index b545de5d6c..4a28d72624 100644 --- a/lang/cpp17/allow_typename_in_a_template_template_parameter.md +++ b/lang/cpp17/allow_typename_in_a_template_template_parameter.md @@ -53,4 +53,4 @@ int main() ``` ## 参照 -- [N4051 Allow `typename` in a template template parameter](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4051.html) \ No newline at end of file +- [N4051 Allow `typename` in a template template parameter](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4051.html) diff --git a/lang/cpp17/attributes_for_namespaces_and_enumerators.md b/lang/cpp17/attributes_for_namespaces_and_enumerators.md index 88efd883fc..bdedd385c1 100644 --- a/lang/cpp17/attributes_for_namespaces_and_enumerators.md +++ b/lang/cpp17/attributes_for_namespaces_and_enumerators.md @@ -74,4 +74,4 @@ namespace [[deprecated]] bar { ## 参照 - [N4196 Attributes for namespaces and enumerators](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4196.html) -- [N4266 Attributes for namespaces and enumerators](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4266.html) \ No newline at end of file +- [N4266 Attributes for namespaces and enumerators](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4266.html) diff --git a/lang/cpp17/construction_enum_class_values.md b/lang/cpp17/construction_enum_class_values.md index c6da4770b1..75bcb5725b 100644 --- a/lang/cpp17/construction_enum_class_values.md +++ b/lang/cpp17/construction_enum_class_values.md @@ -109,4 +109,4 @@ C++17では[スコープを持つ列挙型](/lang/cpp11/scoped_enum.md)の初期 - [`std::byte`](/reference/cstddef/byte.md) ## 参照 -- [P0138R2 Construction Rules for enum class Values.](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0138r2.pdf) \ No newline at end of file +- [P0138R2 Construction Rules for enum class Values.](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0138r2.pdf) diff --git a/lang/cpp17/declaring_non-type_template_arguments_with_auto.md b/lang/cpp17/declaring_non-type_template_arguments_with_auto.md index 7b4d8e2b64..046baebd95 100644 --- a/lang/cpp17/declaring_non-type_template_arguments_with_auto.md +++ b/lang/cpp17/declaring_non-type_template_arguments_with_auto.md @@ -107,4 +107,4 @@ template struct S; // type of v is deduced ## 参照 - [P0127R1 Declaring non-type template arguments with auto](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0127r1.html) - [P0127R2 Declaring non-type template parameters with auto](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0127r2.html) -- [C++1z 非型テンプレートパラメータのauto宣言 - Faith and Brave - C++で遊ぼう](https://faithandbrave.hateblo.jp/entry/2016/10/26/180406) \ No newline at end of file +- [C++1z 非型テンプレートパラメータのauto宣言 - Faith and Brave - C++で遊ぼう](https://faithandbrave.hateblo.jp/entry/2016/10/26/180406) diff --git a/lang/cpp17/dynamic_memory_allocation_for_over-aligned_data.md b/lang/cpp17/dynamic_memory_allocation_for_over-aligned_data.md index 2aed473815..e878b712a0 100644 --- a/lang/cpp17/dynamic_memory_allocation_for_over-aligned_data.md +++ b/lang/cpp17/dynamic_memory_allocation_for_over-aligned_data.md @@ -53,4 +53,4 @@ void* operator new(std::size_t size, std::align_val_t alignment); ## 参照 - [P0035R4 Dynamic memory allocation for over-aligned data](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0035r4.html) -- [New `new()` - The C++17's Alignment Parameter for Operator `new()`](https://www.bfilipek.com/2019/08/newnew-align.html) \ No newline at end of file +- [New `new()` - The C++17's Alignment Parameter for Operator `new()`](https://www.bfilipek.com/2019/08/newnew-align.html) diff --git a/lang/cpp17/exception_spec_be_part_of_the_type_system.md b/lang/cpp17/exception_spec_be_part_of_the_type_system.md index 245cb7cc08..d98177a597 100644 --- a/lang/cpp17/exception_spec_be_part_of_the_type_system.md +++ b/lang/cpp17/exception_spec_be_part_of_the_type_system.md @@ -92,4 +92,4 @@ C++11で[`noexcept`](/lang/cpp11/noexcept.md)が導入されたことにより ## 参照 -- [P0012R1 Make exception specifications be part of the type system, version 5](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0012r1.html) \ No newline at end of file +- [P0012R1 Make exception specifications be part of the type system, version 5](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0012r1.html) diff --git a/lang/cpp17/expression_evaluation_order.md b/lang/cpp17/expression_evaluation_order.md index 048406bfd6..166c7da848 100644 --- a/lang/cpp17/expression_evaluation_order.md +++ b/lang/cpp17/expression_evaluation_order.md @@ -171,4 +171,4 @@ C++の既存のプログラムを壊すこと無く、なおかつ、 ## 参照 - [P0145R3 Refining Expression Evaluation Order for Idiomatic C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0145r3.pdf) -- [P0400R0 Wording for Order of Evaluation of Function Arguments](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0400r0.html) \ No newline at end of file +- [P0400R0 Wording for Order of Evaluation of Function Arguments](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0400r0.html) diff --git a/lang/cpp17/extending_static_assert.md b/lang/cpp17/extending_static_assert.md index 40eddc1bee..b0d6ac3386 100644 --- a/lang/cpp17/extending_static_assert.md +++ b/lang/cpp17/extending_static_assert.md @@ -78,4 +78,4 @@ example_static_assert.cpp:5:3: error: static_assert failed ## 参照 - [N3846 Extending `static_assert`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3846.pdf) -- [N3928 Extending `static_assert`, v2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3928.pdf) \ No newline at end of file +- [N3928 Extending `static_assert`, v2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3928.pdf) diff --git a/lang/cpp17/extension_to_aggregate_initialization.md b/lang/cpp17/extension_to_aggregate_initialization.md index 8e72218485..81f0b6e0f8 100644 --- a/lang/cpp17/extension_to_aggregate_initialization.md +++ b/lang/cpp17/extension_to_aggregate_initialization.md @@ -132,4 +132,4 @@ int main() ## 参照 -1. [P0017R1 Extension to aggregate initialization](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0017r1.html) \ No newline at end of file +1. [P0017R1 Extension to aggregate initialization](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0017r1.html) diff --git a/lang/cpp17/fallthrough.md b/lang/cpp17/fallthrough.md index 301ebec53f..5473f030f0 100644 --- a/lang/cpp17/fallthrough.md +++ b/lang/cpp17/fallthrough.md @@ -64,4 +64,4 @@ fallthrough.cpp:12:3: note: here ## 参照 - [P0068R0 Proposal of [[unused]], [[nodiscard]] and [[fallthrough]] attributes.](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0068r0.pdf) -- [P0188R1 Wording for [[fallthrough]] attribute.](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0188r1.pdf) \ No newline at end of file +- [P0188R1 Wording for [[fallthrough]] attribute.](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0188r1.pdf) diff --git a/lang/cpp17/has_include.md b/lang/cpp17/has_include.md index 2cfaaba58a..a5323d8216 100644 --- a/lang/cpp17/has_include.md +++ b/lang/cpp17/has_include.md @@ -103,4 +103,4 @@ has_include.cpp:23:4: warning: "fuga" is not found [-W#warnings] ``` ## 参照 -- [P0061R1 __has_include for C++17](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0061r1.html) \ No newline at end of file +- [P0061R1 __has_include for C++17](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0061r1.html) diff --git a/lang/cpp17/inline_variables.md b/lang/cpp17/inline_variables.md index 3afbdae0de..8cd3f941ce 100644 --- a/lang/cpp17/inline_variables.md +++ b/lang/cpp17/inline_variables.md @@ -291,4 +291,4 @@ func - [P0386R2 - Inline Variables](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0386r2.pdf), 2016-06-24 - [P0607R0 - Inline Variables for the Standard Library](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0607r0.html), 2017-02-27 - [C++1z インライン変数 - Faith and Brave - C++で遊ぼう](https://faithandbrave.hateblo.jp/entry/2016/11/11/172954) -- [インライン変数が翻訳単位毎に別々の実体となってしまう - Stackoverflow](https://ja.stackoverflow.com/questions/93046/) \ No newline at end of file +- [インライン変数が翻訳単位毎に別々の実体となってしまう - Stackoverflow](https://ja.stackoverflow.com/questions/93046/) diff --git a/lang/cpp17/lambda_capture_of_this_by_value.md b/lang/cpp17/lambda_capture_of_this_by_value.md index 027b4c9399..22ea2ef5ac 100644 --- a/lang/cpp17/lambda_capture_of_this_by_value.md +++ b/lang/cpp17/lambda_capture_of_this_by_value.md @@ -84,4 +84,4 @@ exit - [P0018R0 Lambda Capture of `*this` by Value](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0018r0.html) - [P0018R1 Lambda Capture of `*this` by Value](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0018r1.html) - [P0018R2 Lambda Capture of `*this` by Value](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0018r2.html) -- [P0018R3 Lambda Capture of `*this` by Value as `[=,*this]`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0018r3.html) \ No newline at end of file +- [P0018R3 Lambda Capture of `*this` by Value as `[=,*this]`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0018r3.html) diff --git a/lang/cpp17/lambda_to_noexcept_function_pointer.md b/lang/cpp17/lambda_to_noexcept_function_pointer.md index 0afb67e62d..3581e0360f 100644 --- a/lang/cpp17/lambda_to_noexcept_function_pointer.md +++ b/lang/cpp17/lambda_to_noexcept_function_pointer.md @@ -55,4 +55,4 @@ true ## 参照 -- [CWG Issue 1722. Should lambda to function pointer conversion function be `noexcept`?](https://wg21.cmeerw.net/cwg/issue1722) \ No newline at end of file +- [CWG Issue 1722. Should lambda to function pointer conversion function be `noexcept`?](https://wg21.cmeerw.net/cwg/issue1722) diff --git a/lang/cpp17/maybe_unused.md b/lang/cpp17/maybe_unused.md index 0bbbbc5e66..c8866788d8 100644 --- a/lang/cpp17/maybe_unused.md +++ b/lang/cpp17/maybe_unused.md @@ -126,4 +126,4 @@ P0068R0では`[[unused]]`という名前で提案されたが、いわゆる自 ## 参照 - [P0068R0 Proposal of [[unused]], [[nodiscard]] and [[fallthrough]] attributes.](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0068r0.pdf) -- [P0212R1 Wording for [[maybe_unused]] attribute.](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0212r1.pdf) \ No newline at end of file +- [P0212R1 Wording for [[maybe_unused]] attribute.](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0212r1.pdf) diff --git a/lang/cpp17/nested_namespace.md b/lang/cpp17/nested_namespace.md index d84c561c42..91be00ee6d 100644 --- a/lang/cpp17/nested_namespace.md +++ b/lang/cpp17/nested_namespace.md @@ -69,4 +69,4 @@ a legacy nested namespace definition is workded. - 言語仕様: §7.3.1 §A.6 - [N4230 Nested namespace definition (revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4230.html) - [N1524 Nested Namespace Definition Proposal](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1524.htm) - - [N2869 State of C++ Evolution (Post San Francisco 2008)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2869.html) \ No newline at end of file + - [N2869 State of C++ Evolution (Post San Francisco 2008)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2869.html) diff --git a/lang/cpp17/nodiscard.md b/lang/cpp17/nodiscard.md index a2d9bea3ba..2682e4cf94 100644 --- a/lang/cpp17/nodiscard.md +++ b/lang/cpp17/nodiscard.md @@ -66,4 +66,4 @@ nodiscard.cpp:11:3: warning: ignoring return value of function declared with 'no ## 参照 - [P0068R0 Proposal of [[unused]], [[nodiscard]] and [[fallthrough]] attributes.](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0068r0.pdf) -- [P0189R1 Wording for [[nodiscard]] attribute.](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0189r1.pdf) \ No newline at end of file +- [P0189R1 Wording for [[nodiscard]] attribute.](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0189r1.pdf) diff --git a/lang/cpp17/pack_expansions_in_using.md b/lang/cpp17/pack_expansions_in_using.md index 911ef2e1b9..049bc8ede3 100644 --- a/lang/cpp17/pack_expansions_in_using.md +++ b/lang/cpp17/pack_expansions_in_using.md @@ -186,4 +186,4 @@ ForString:hello2 - [可変引数テンプレート](/lang/cpp11/variadic_templates.md) ## 参照 -- [P0195R2 Pack expansions in using-declarations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0195r2.html) \ No newline at end of file +- [P0195R2 Pack expansions in using-declarations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0195r2.html) diff --git a/lang/cpp17/predefined_macros.md b/lang/cpp17/predefined_macros.md index aebe7b629b..7413aaef50 100644 --- a/lang/cpp17/predefined_macros.md +++ b/lang/cpp17/predefined_macros.md @@ -25,4 +25,4 @@ ## 関連項目 -- [C++17 アライメント指定されたデータの動的メモリ確保](dynamic_memory_allocation_for_over-aligned_data.md) \ No newline at end of file +- [C++17 アライメント指定されたデータの動的メモリ確保](dynamic_memory_allocation_for_over-aligned_data.md) diff --git a/lang/cpp17/remove_deprecated_exception_specifications.md b/lang/cpp17/remove_deprecated_exception_specifications.md index 9cbf8ee251..e7eb0bce46 100644 --- a/lang/cpp17/remove_deprecated_exception_specifications.md +++ b/lang/cpp17/remove_deprecated_exception_specifications.md @@ -69,4 +69,4 @@ C++でもJavaを含むこれらの問題は認識されており、動的例外 ## 参照 - [P0003R4 Removing Deprecated Exception Specifications from C++17](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0003r4.html) -- [P0003R5 Removing Deprecated Exception Specifications from C++17](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0003r5.html) \ No newline at end of file +- [P0003R5 Removing Deprecated Exception Specifications from C++17](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0003r5.html) diff --git a/lang/cpp17/remove_deprecated_increment_of_bool.md b/lang/cpp17/remove_deprecated_increment_of_bool.md index f0e2048d9e..a553b6e5bb 100644 --- a/lang/cpp17/remove_deprecated_increment_of_bool.md +++ b/lang/cpp17/remove_deprecated_increment_of_bool.md @@ -170,4 +170,4 @@ C++14で`std::exchange()`が導入されたことにより、唯一使いみち 1. [An Investigation of Therac-25 Accidents - I](http://web.archive.org/web/20171206153409/http://courses.cs.vt.edu/professionalism/Therac_25/Therac_1.html) 2. [Therac-25 - II](http://web.archive.org/web/20171212115910/http://courses.cs.vt.edu/professionalism/Therac_25/Therac_2.html) 3. [Therac-25 - III](http://web.archive.org/web/20170215125239/http://courses.cs.vt.edu/professionalism/Therac_25/Therac_3.html) -- [Therac-25 - Wikipedia](https://en.wikipedia.org/wiki/Therac-25) \ No newline at end of file +- [Therac-25 - Wikipedia](https://en.wikipedia.org/wiki/Therac-25) diff --git a/lang/cpp17/remove_deprecated_use_of_the_register_keyword.md b/lang/cpp17/remove_deprecated_use_of_the_register_keyword.md index e16ff1aa34..e99b4bfeb7 100644 --- a/lang/cpp17/remove_deprecated_use_of_the_register_keyword.md +++ b/lang/cpp17/remove_deprecated_use_of_the_register_keyword.md @@ -32,4 +32,4 @@ register int v = 42; ## 参照 - [P0001R1: Remove Deprecated Use of the register Keyword](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0001r1.html) -- [P0001R0: Remove Deprecated Use of the register Keyword](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0001r0.html) \ No newline at end of file +- [P0001R0: Remove Deprecated Use of the register Keyword](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0001r0.html) diff --git a/lang/cpp17/removing_trigraphs.md b/lang/cpp17/removing_trigraphs.md index ea8f27cc68..ccf75c4222 100644 --- a/lang/cpp17/removing_trigraphs.md +++ b/lang/cpp17/removing_trigraphs.md @@ -99,4 +99,4 @@ GCC などのコンパイラはデフォルトでトライグラフを無効に ## 参照 * [N3981 Removing trigraphs??!](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3981.html) -* [N4086 Removing trigraphs??!](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4086.html) \ No newline at end of file +* [N4086 Removing trigraphs??!](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4086.html) diff --git a/lang/cpp17/type_deduction_for_class_templates.md b/lang/cpp17/type_deduction_for_class_templates.md index 5f3edea731..4da28689cf 100644 --- a/lang/cpp17/type_deduction_for_class_templates.md +++ b/lang/cpp17/type_deduction_for_class_templates.md @@ -299,4 +299,4 @@ int main() - [P0620R0 Drafting for class template argument deduction issues](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0620r0.html) - [LWG Issue 2981. Remove redundant deduction guides from standard library](https://wg21.cmeerw.net/lwg/issue2981) - [P0702R1 Language support for Constructor Template Argument Deduction](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0702r1.html) -- [Class Template Argument Deduction - A New Abstraction - Zhihao Yuan - CppCon 2017](https://raw.githubusercontent.com/CppCon/CppCon2017/master/Presentations/Class%20Template%20Argument%20Deduction%20-%20A%20New%20Abstraction/Class%20Template%20Argument%20Deduction%20-%20A%20New%20Abstraction%20-%20Zhihao%20Yuan%20-%20CppCon%202017.pdf) \ No newline at end of file +- [Class Template Argument Deduction - A New Abstraction - Zhihao Yuan - CppCon 2017](https://raw.githubusercontent.com/CppCon/CppCon2017/master/Presentations/Class%20Template%20Argument%20Deduction%20-%20A%20New%20Abstraction/Class%20Template%20Argument%20Deduction%20-%20A%20New%20Abstraction%20-%20Zhihao%20Yuan%20-%20CppCon%202017.pdf) diff --git a/lang/cpp17/using_attribute_namespaces.md b/lang/cpp17/using_attribute_namespaces.md index a587e9b7f7..f95f6cd779 100644 --- a/lang/cpp17/using_attribute_namespaces.md +++ b/lang/cpp17/using_attribute_namespaces.md @@ -69,4 +69,4 @@ using_attribute_namespaces.cpp:13:13: error: attribute with scope specifier cann - [C++11 属性構文](/lang/cpp11/attributes.md) ## 参照 -- [P0028R4 Using attribute namespaces without repetition.](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0028r4.html) \ No newline at end of file +- [P0028R4 Using attribute namespaces without repetition.](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0028r4.html) diff --git a/lang/cpp17/utf8_character_literals.md b/lang/cpp17/utf8_character_literals.md index ca2bb8ce55..ce0a5e0d09 100644 --- a/lang/cpp17/utf8_character_literals.md +++ b/lang/cpp17/utf8_character_literals.md @@ -36,4 +36,4 @@ C++20ではUTF-8文字リテラルの型が[`char`ではなく`char8_t`になる ## 参照 - [N4267 Adding `u8` character literals](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4267.html) - [C0 Controls and Basic Latin - The Unicode Consortium](http://www.unicode.org/charts/PDF/U0000.pdf) -- [基本ラテン文字 (Unicodeのブロック) - Wikipedia](https://ja.wikipedia.org/wiki/%E5%9F%BA%E6%9C%AC%E3%83%A9%E3%83%86%E3%83%B3%E6%96%87%E5%AD%97_(Unicode%E3%81%AE%E3%83%96%E3%83%AD%E3%83%83%E3%82%AF)) \ No newline at end of file +- [基本ラテン文字 (Unicodeのブロック) - Wikipedia](https://ja.wikipedia.org/wiki/%E5%9F%BA%E6%9C%AC%E3%83%A9%E3%83%86%E3%83%B3%E6%96%87%E5%AD%97_(Unicode%E3%81%AE%E3%83%96%E3%83%AD%E3%83%83%E3%82%AF)) diff --git a/lang/cpp20/access_checking_on_specializations.md b/lang/cpp20/access_checking_on_specializations.md index 74dcccd32a..1481fae743 100644 --- a/lang/cpp20/access_checking_on_specializations.md +++ b/lang/cpp20/access_checking_on_specializations.md @@ -152,4 +152,4 @@ namespace option3 { ## 参照 -- [P0692R1 Access Checking on Specializations](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0692r1.html) \ No newline at end of file +- [P0692R1 Access Checking on Specializations](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0692r1.html) diff --git a/lang/cpp20/adl_and_function_templates_that_are_not_visible.md b/lang/cpp20/adl_and_function_templates_that_are_not_visible.md index 996c53ae40..489335e502 100644 --- a/lang/cpp20/adl_and_function_templates_that_are_not_visible.md +++ b/lang/cpp20/adl_and_function_templates_that_are_not_visible.md @@ -69,4 +69,4 @@ int main() { ``` ## 参照 -- [P0846R0 ADL and Function Templates that are not Visible](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0846r0.html) \ No newline at end of file +- [P0846R0 ADL and Function Templates that are not Visible](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0846r0.html) diff --git a/lang/cpp20/allow_initializing_aggregates_from_a_parenthesized_list_of_values.md b/lang/cpp20/allow_initializing_aggregates_from_a_parenthesized_list_of_values.md index 28a7025834..ea422bdd16 100644 --- a/lang/cpp20/allow_initializing_aggregates_from_a_parenthesized_list_of_values.md +++ b/lang/cpp20/allow_initializing_aggregates_from_a_parenthesized_list_of_values.md @@ -137,4 +137,4 @@ explicit A(T1 t1, … , Tk tk); ## 参照 - [P0960R3 Allow initializing aggregates from a parenthesized list of values](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0960r3.html) -- [C++ Core Guidelines ES.23: Prefer the {}-initializer syntax](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#es23-prefer-the--initializer-syntax) 常に波カッコで初期化することを推奨している。 \ No newline at end of file +- [C++ Core Guidelines ES.23: Prefer the {}-initializer syntax](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#es23-prefer-the--initializer-syntax) 常に波カッコで初期化することを推奨している。 diff --git a/lang/cpp20/allow_lambda_capture_equal_this.md b/lang/cpp20/allow_lambda_capture_equal_this.md index f125c03cba..d81d3cc6fd 100644 --- a/lang/cpp20/allow_lambda_capture_equal_this.md +++ b/lang/cpp20/allow_lambda_capture_equal_this.md @@ -48,4 +48,4 @@ int main() ## 参照 -- [P0409R2 Allow lambda capture `[=, this]`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0409r2.html) \ No newline at end of file +- [P0409R2 Allow lambda capture `[=, this]`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0409r2.html) diff --git a/lang/cpp20/allow_pack_expansion_in_lambda_init_capture.md b/lang/cpp20/allow_pack_expansion_in_lambda_init_capture.md index 300dd5820a..03f55c8452 100644 --- a/lang/cpp20/allow_pack_expansion_in_lambda_init_capture.md +++ b/lang/cpp20/allow_pack_expansion_in_lambda_init_capture.md @@ -145,4 +145,4 @@ auto f(Args... args) { ## 参照 - [P0780R2 Allow pack expansion in lambda init-capture](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0780r2.html) - [CWG 1760: Access of member corresponding to init-capture](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1760) -- [P2095R0 Resolve lambda init-capture pack grammar (CWG2378)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2095r0.html) \ No newline at end of file +- [P2095R0 Resolve lambda init-capture pack grammar (CWG2378)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2095r0.html) diff --git a/lang/cpp20/allow_structured_bindings_to_accessible_members.md b/lang/cpp20/allow_structured_bindings_to_accessible_members.md index 94a6b8f193..ed2167c799 100644 --- a/lang/cpp20/allow_structured_bindings_to_accessible_members.md +++ b/lang/cpp20/allow_structured_bindings_to_accessible_members.md @@ -56,4 +56,4 @@ int main() { ## 参照 -- [P0969R0 Allow structured bindings to accessible members](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0969r0.pdf) \ No newline at end of file +- [P0969R0 Allow structured bindings to accessible members](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0969r0.pdf) diff --git a/lang/cpp20/allow_virtual_function_calls_in_constant_expressions.md b/lang/cpp20/allow_virtual_function_calls_in_constant_expressions.md index 38fafeba35..1687732837 100644 --- a/lang/cpp20/allow_virtual_function_calls_in_constant_expressions.md +++ b/lang/cpp20/allow_virtual_function_calls_in_constant_expressions.md @@ -41,4 +41,4 @@ int main() ## 参照 -- [P1064R0 Allowing Virtual Function Calls in Constant Expressions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1064r0.html) \ No newline at end of file +- [P1064R0 Allowing Virtual Function Calls in Constant Expressions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1064r0.html) diff --git a/lang/cpp20/array_size_deduction_in_new-expressions.md b/lang/cpp20/array_size_deduction_in_new-expressions.md index cf15d21fc4..5ab20bdf07 100644 --- a/lang/cpp20/array_size_deduction_in_new-expressions.md +++ b/lang/cpp20/array_size_deduction_in_new-expressions.md @@ -76,4 +76,4 @@ double* p = new double[]{1,2,3} // エラー ## 参照 -* [P1009R2 Array size deduction in new-expressions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1009r2.pdf) \ No newline at end of file +* [P1009R2 Array size deduction in new-expressions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1009r2.pdf) diff --git a/lang/cpp20/changing_the_active_member_of_a_union_inside_constexpr.md b/lang/cpp20/changing_the_active_member_of_a_union_inside_constexpr.md index a3834055b8..2b99929045 100644 --- a/lang/cpp20/changing_the_active_member_of_a_union_inside_constexpr.md +++ b/lang/cpp20/changing_the_active_member_of_a_union_inside_constexpr.md @@ -50,4 +50,4 @@ int main() { - [P1330R0 Changing the active member of a union inside constexpr](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1330r0.pdf) - [P0980R1 Making std::string constexpr](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0980r1.pdf) -- [std::stringのSSO(Small-string optimization)がどうなっているか調べた - melpon/qiita](https://github.com/melpon/qiita/tree/master/items/stdstringのSSO(Small-string%20optimization)がどうなっているか調べた) \ No newline at end of file +- [std::stringのSSO(Small-string optimization)がどうなっているか調べた - melpon/qiita](https://github.com/melpon/qiita/tree/master/items/stdstringのSSO(Small-string%20optimization)がどうなっているか調べた) diff --git a/lang/cpp20/char8_t.md b/lang/cpp20/char8_t.md index 5cd00f1fec..f12af6147c 100644 --- a/lang/cpp20/char8_t.md +++ b/lang/cpp20/char8_t.md @@ -179,4 +179,4 @@ enum class char8_t : unsigned char {}; - [P1423R3: char8_t backward compatibility remediation](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1423r3.html) - [Proposal for a C/C++ language extension to support portable UTF-16](http://web.archive.org/web/20140701223639/http://www.unicode.org/~asmus/stdc-utf-16.txt) -- [char8_tによせて - なるせにっき](https://naruse.hateblo.jp/entry/2018/12/24/013446) \ No newline at end of file +- [char8_tによせて - なるせにっき](https://naruse.hateblo.jp/entry/2018/12/24/013446) diff --git a/lang/cpp20/checking_for_abstract_class_types.md b/lang/cpp20/checking_for_abstract_class_types.md index 41a1ff9f70..1e1b183833 100644 --- a/lang/cpp20/checking_for_abstract_class_types.md +++ b/lang/cpp20/checking_for_abstract_class_types.md @@ -28,4 +28,4 @@ C++20ではこれを適格とし、先行宣言と同様にクラスの完全性 ## 参照 -- [P0929R2 Checking for abstract class types](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0929r2.html) \ No newline at end of file +- [P0929R2 Checking for abstract class types](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0929r2.html) diff --git a/lang/cpp20/class_template_argument_deduction_for_aggregates.md b/lang/cpp20/class_template_argument_deduction_for_aggregates.md index d55445ee88..468bdd86fb 100644 --- a/lang/cpp20/class_template_argument_deduction_for_aggregates.md +++ b/lang/cpp20/class_template_argument_deduction_for_aggregates.md @@ -33,4 +33,4 @@ Point p1{3.0, 4.0}; // C++17:NG C++20:OK - [P1021R4 Filling holes in Class Template Argument Deduction](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1021r4.html) - 提案の元になった文書 - [P1816R0 Wording for class template argument deduction for aggregates](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1816r0.pdf) - - C++20に採択された提案文書 \ No newline at end of file + - C++20に採択された提案文書 diff --git a/lang/cpp20/class_template_argument_deduction_for_alias_templates.md b/lang/cpp20/class_template_argument_deduction_for_alias_templates.md index fbd29c5cb5..126c89bc59 100644 --- a/lang/cpp20/class_template_argument_deduction_for_alias_templates.md +++ b/lang/cpp20/class_template_argument_deduction_for_alias_templates.md @@ -75,4 +75,4 @@ B b2(&d, &d); // エラー! CからBを推論できない ## 参照 -- [P1814R0 Wording for Class Template Argument Deduction for Alias Templates](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1814r0.html) \ No newline at end of file +- [P1814R0 Wording for Class Template Argument Deduction for Alias Templates](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1814r0.html) diff --git a/lang/cpp20/constinit.md b/lang/cpp20/constinit.md index 5f49c34e86..9cf251ea9c 100644 --- a/lang/cpp20/constinit.md +++ b/lang/cpp20/constinit.md @@ -213,4 +213,4 @@ int main() {} - [P1143R2 Adding the `constinit` keyword](https://wg21.link/P1143) - [Constant initialization - Andrzej's C++ blog](https://akrzemi1.wordpress.com/2012/05/27/constant-initialization/) - [`mutex`のconstexprコンストラクタ - yohhoyの日記](https://yohhoy.hatenadiary.jp/entry/20120621/p1) -- [Static Initialization Order Fiasco - in neuro](https://yohhoy.hatenadiary.jp/entry/20120621/p1) \ No newline at end of file +- [Static Initialization Order Fiasco - in neuro](https://yohhoy.hatenadiary.jp/entry/20120621/p1) diff --git a/lang/cpp20/converting_from_pointer_to_bool_should_be_considered_narrowing.md b/lang/cpp20/converting_from_pointer_to_bool_should_be_considered_narrowing.md index 0a40c7441b..e53aa693c1 100644 --- a/lang/cpp20/converting_from_pointer_to_bool_should_be_considered_narrowing.md +++ b/lang/cpp20/converting_from_pointer_to_bool_should_be_considered_narrowing.md @@ -69,4 +69,4 @@ std::variant v = b[1]; // boolを保持して構築 - [P1957R2 Converting from `T*` to `bool` should be considered narrowing (re: US 212)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1957r2.html) - [LWG Issue 3228. Surprising `variant` construction](https://cplusplus.github.io/LWG/issue3228) -- [P0608R3 A sane `variant` converting constructor](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0608r3.html) \ No newline at end of file +- [P0608R3 A sane `variant` converting constructor](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0608r3.html) diff --git a/lang/cpp20/default_constructible_and_assignable_stateless_lambdas.md b/lang/cpp20/default_constructible_and_assignable_stateless_lambdas.md index 9ada4dbecd..107b1e7d72 100644 --- a/lang/cpp20/default_constructible_and_assignable_stateless_lambdas.md +++ b/lang/cpp20/default_constructible_and_assignable_stateless_lambdas.md @@ -167,4 +167,4 @@ C++20では同時に[評価されない文脈にラムダ式を書くことが - [評価されない文脈でのラムダ式](./wording_for_lambdas_in_unevaluated_contexts.md) ## 参照 -- [P0624R2 Default constructible and assignable stateless lambdas](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0624r2.pdf) \ No newline at end of file +- [P0624R2 Default constructible and assignable stateless lambdas](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0624r2.pdf) diff --git a/lang/cpp20/default_member_initializers_for_bit_fields.md b/lang/cpp20/default_member_initializers_for_bit_fields.md index 5715932113..9f48e4268f 100644 --- a/lang/cpp20/default_member_initializers_for_bit_fields.md +++ b/lang/cpp20/default_member_initializers_for_bit_fields.md @@ -83,4 +83,4 @@ int main() ## 参照 - [P0187R0 Proposal of Bitfield Default Member Initializers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0187r0.pdf) - [R0187R1 Proposal/Wording for Bit-field Default Member Initializer Syntax](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0187r1.pdf) -- [P0683R1 Default member initializers for bit-fields](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0683r1.html) \ No newline at end of file +- [P0683R1 Default member initializers for bit-fields](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0683r1.html) diff --git a/lang/cpp20/deprecate_arithmetic_conversion_on_enumerations.md b/lang/cpp20/deprecate_arithmetic_conversion_on_enumerations.md index 6d327bb60e..6032ebf36d 100644 --- a/lang/cpp20/deprecate_arithmetic_conversion_on_enumerations.md +++ b/lang/cpp20/deprecate_arithmetic_conversion_on_enumerations.md @@ -28,4 +28,4 @@ int x = +f - e; // OK ## 参照 -- [P1120R0 Consistency improvements for `<=>` and other comparison operators](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1120r0.html) \ No newline at end of file +- [P1120R0 Consistency improvements for `<=>` and other comparison operators](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1120r0.html) diff --git a/lang/cpp20/deprecate_implicit_capture_of_this_via_defcopy.md b/lang/cpp20/deprecate_implicit_capture_of_this_via_defcopy.md index 75358f7929..1392589337 100644 --- a/lang/cpp20/deprecate_implicit_capture_of_this_via_defcopy.md +++ b/lang/cpp20/deprecate_implicit_capture_of_this_via_defcopy.md @@ -52,4 +52,4 @@ int main() ## 参照 -- [P0806R2 Deprecate implicit capture of this via `[=]`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0806r2.html) \ No newline at end of file +- [P0806R2 Deprecate implicit capture of this via `[=]`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0806r2.html) diff --git a/lang/cpp20/deprecate_pod.md b/lang/cpp20/deprecate_pod.md index 8c0c1a2199..667a11e8b7 100644 --- a/lang/cpp20/deprecate_pod.md +++ b/lang/cpp20/deprecate_pod.md @@ -26,4 +26,4 @@ C++20では規格の文面に残っていた「POD」の使用をやめ、スタ - [P0767R1 Deprecate POD](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0767r1.html) - [N2342 POD's Revisited; Resolving Core Issue 568 (Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2342.htm) - [C++0x POD再考 - Faith and Brave - C++で遊ぼう](https://faithandbrave.hateblo.jp/entry/20081127/1227777378) - - C++11においてPODという用語が分割された文書 \ No newline at end of file + - C++11においてPODという用語が分割された文書 diff --git a/lang/cpp20/deprecate_uses_of_the_comma_operator_in_subscripting_expressions.md b/lang/cpp20/deprecate_uses_of_the_comma_operator_in_subscripting_expressions.md index 367b697eae..0fdffa6cde 100644 --- a/lang/cpp20/deprecate_uses_of_the_comma_operator_in_subscripting_expressions.md +++ b/lang/cpp20/deprecate_uses_of_the_comma_operator_in_subscripting_expressions.md @@ -27,4 +27,4 @@ ar[x, y] // C++17:OK, C++20:非推奨 - [C++23 添字演算子の多次元サポート](/lang/cpp23/multidimensional_subscript_operator.md) ## 参照 -- [P1161R3 Deprecate uses of the comma operator in subscripting expressions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1161r3.html) \ No newline at end of file +- [P1161R3 Deprecate uses of the comma operator in subscripting expressions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1161r3.html) diff --git a/lang/cpp20/deprecating_volatile.md b/lang/cpp20/deprecating_volatile.md index 30082b6f76..08a2ba6612 100644 --- a/lang/cpp20/deprecating_volatile.md +++ b/lang/cpp20/deprecating_volatile.md @@ -389,4 +389,4 @@ volatile device dev; - [P1831R0 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1831r0.html) - [P1831R1 Deprecating `volatile`: library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1831r1.html) - [P2327R1 De-deprecating volatile compound operations](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2327r1.pdf) -- [CWG Issue 2654. Un-deprecation of compound volatile assignments](https://cplusplus.github.io/CWG/issues/2654.html) \ No newline at end of file +- [CWG Issue 2654. Un-deprecation of compound volatile assignments](https://cplusplus.github.io/CWG/issues/2654.html) diff --git a/lang/cpp20/designated_initialization.md b/lang/cpp20/designated_initialization.md index 57e3f14918..a86b890ed4 100644 --- a/lang/cpp20/designated_initialization.md +++ b/lang/cpp20/designated_initialization.md @@ -115,4 +115,4 @@ struct A a = {.x = 1, 2}; // Cでは有効、C++20では無効 ## 参照 -* [P0329R4 Designated initialization](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0329r4.pdf) \ No newline at end of file +* [P0329R4 Designated initialization](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0329r4.pdf) diff --git a/lang/cpp20/down_with_typename.md b/lang/cpp20/down_with_typename.md index edb703848f..25c042ec83 100644 --- a/lang/cpp20/down_with_typename.md +++ b/lang/cpp20/down_with_typename.md @@ -90,4 +90,4 @@ struct Derived: T::Base // typename不要 ## 参照 -- [P0634R3 Down with `typename`!](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0634r3.html) \ No newline at end of file +- [P0634R3 Down with `typename`!](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0634r3.html) diff --git a/lang/cpp20/enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.md b/lang/cpp20/enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.md index 7e6af1ac6f..76b4fc0403 100644 --- a/lang/cpp20/enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.md +++ b/lang/cpp20/enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.md @@ -107,4 +107,4 @@ int main() { ## 参照 -- [P1668R1 Enabling constexpr Intrinsics By Permitting Unevaluated inline-assembly in constexpr Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1668r1.html) \ No newline at end of file +- [P1668R1 Enabling constexpr Intrinsics By Permitting Unevaluated inline-assembly in constexpr Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1668r1.html) diff --git a/lang/cpp20/explicit_bool.md b/lang/cpp20/explicit_bool.md index 3f744c5f73..7a65b0394a 100644 --- a/lang/cpp20/explicit_bool.md +++ b/lang/cpp20/explicit_bool.md @@ -172,4 +172,4 @@ struct pair { ## 参照 -- [P0892R2 explicit(bool)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0892r2.html) \ No newline at end of file +- [P0892R2 explicit(bool)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0892r2.html) diff --git a/lang/cpp20/extending_structured_bindings_to_be_more_like_variable_declarations.md b/lang/cpp20/extending_structured_bindings_to_be_more_like_variable_declarations.md index d3999893f7..9af69faba2 100644 --- a/lang/cpp20/extending_structured_bindings_to_be_more_like_variable_declarations.md +++ b/lang/cpp20/extending_structured_bindings_to_be_more_like_variable_declarations.md @@ -142,4 +142,4 @@ int main() - [P1091R0 Extending structured bindings to be more like variable declarations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1091r0.html) - [P1091R1 Extending structured bindings to be more like variable declarations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1091r1.html) - [P1091R2 Extending structured bindings to be more like variable declarations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1091r2.html) -- [P1091R3 Extending structured bindings to be more like variable declarations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1091r3.html) \ No newline at end of file +- [P1091R3 Extending structured bindings to be more like variable declarations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1091r3.html) diff --git a/lang/cpp20/familiar_template_syntax_for_generic_lambdas.md b/lang/cpp20/familiar_template_syntax_for_generic_lambdas.md index c742ee992d..86c4fd04b9 100644 --- a/lang/cpp20/familiar_template_syntax_for_generic_lambdas.md +++ b/lang/cpp20/familiar_template_syntax_for_generic_lambdas.md @@ -136,4 +136,4 @@ auto f = [](Args&&... args) { ## 参照 -- [P0428R2 Familiar template syntax for generic lambdas](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0428r2.pdf) \ No newline at end of file +- [P0428R2 Familiar template syntax for generic lambdas](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0428r2.pdf) diff --git a/lang/cpp20/fixing_const_qualified_pointers_to_members.md b/lang/cpp20/fixing_const_qualified_pointers_to_members.md index 054b5f288b..cb71462414 100644 --- a/lang/cpp20/fixing_const_qualified_pointers_to_members.md +++ b/lang/cpp20/fixing_const_qualified_pointers_to_members.md @@ -31,4 +31,4 @@ C++20ではこの式が許可され、仕様としては以下のように`const ## 参照 -- [P0704R1 Fixing const-qualified pointers to members](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0704r1.html) \ No newline at end of file +- [P0704R1 Fixing const-qualified pointers to members](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0704r1.html) diff --git a/lang/cpp20/function_templates_with_auto_parameters.md b/lang/cpp20/function_templates_with_auto_parameters.md index 4a41098250..4089034ba0 100644 --- a/lang/cpp20/function_templates_with_auto_parameters.md +++ b/lang/cpp20/function_templates_with_auto_parameters.md @@ -53,4 +53,4 @@ int main() ## 参照 -- [P1141R2 Yet another approach for constrained declarations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1141r2.html) \ No newline at end of file +- [P1141R2 Yet another approach for constrained declarations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1141r2.html) diff --git a/lang/cpp20/language_support_for_empty_objects.md b/lang/cpp20/language_support_for_empty_objects.md index d7556df214..5579a0fb24 100644 --- a/lang/cpp20/language_support_for_empty_objects.md +++ b/lang/cpp20/language_support_for_empty_objects.md @@ -132,4 +132,4 @@ int main() - [`is_empty`](/reference/type_traits/is_empty.md) ## 参照 -- [P0840R2 Language support for empty objects](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0840r2.html) \ No newline at end of file +- [P0840R2 Language support for empty objects](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0840r2.html) diff --git a/lang/cpp20/less_eager_instantiation_of_constexpr_functions.md b/lang/cpp20/less_eager_instantiation_of_constexpr_functions.md index a5b2da250d..eff318af35 100644 --- a/lang/cpp20/less_eager_instantiation_of_constexpr_functions.md +++ b/lang/cpp20/less_eager_instantiation_of_constexpr_functions.md @@ -38,4 +38,4 @@ int n = sizeof(short{duration(duration())}); ## 参照 - [CWG Issue 1581. When are constexpr member functions defined?](https://wg21.cmeerw.net/cwg/issue1581) -- [P0859R0: Core Issue 1581: When are constexpr member functions defined?](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0859r0.html) \ No newline at end of file +- [P0859R0: Core Issue 1581: When are constexpr member functions defined?](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0859r0.html) diff --git a/lang/cpp20/make_char16t_char32t_string_literals_be_utf16_32.md b/lang/cpp20/make_char16t_char32t_string_literals_be_utf16_32.md index 80f1e90cb5..075d33175f 100644 --- a/lang/cpp20/make_char16t_char32t_string_literals_be_utf16_32.md +++ b/lang/cpp20/make_char16t_char32t_string_literals_be_utf16_32.md @@ -37,4 +37,4 @@ C++20では、無条件にUTF-16とUTF-32であることが規定される。 ## 参照 -- [P1041R4 Make `char16_t`/`char32_t` string literals be UTF-16/32](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1041r4.html) \ No newline at end of file +- [P1041R4 Make `char16_t`/`char32_t` string literals be UTF-16/32](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1041r4.html) diff --git a/lang/cpp20/nested_inline_mamespaces.md b/lang/cpp20/nested_inline_mamespaces.md index 49c1dde459..b107c9048e 100644 --- a/lang/cpp20/nested_inline_mamespaces.md +++ b/lang/cpp20/nested_inline_mamespaces.md @@ -39,4 +39,4 @@ namespace ns3 { ## 参照 -- [P1094R2 Nested Inline Namespaces](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1094r2.html) \ No newline at end of file +- [P1094R2 Nested Inline Namespaces](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1094r2.html) diff --git a/lang/cpp20/nodiscard_should_have_a_reason.md b/lang/cpp20/nodiscard_should_have_a_reason.md index d50e28347a..5c491b9ba3 100644 --- a/lang/cpp20/nodiscard_should_have_a_reason.md +++ b/lang/cpp20/nodiscard_should_have_a_reason.md @@ -98,4 +98,4 @@ prog.cc:26:8: note: declared here ## 参照 -- [P1301R4 `[[nodiscard("should have a reason")]]`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1301r4.html) \ No newline at end of file +- [P1301R4 `[[nodiscard("should have a reason")]]`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1301r4.html) diff --git a/lang/cpp20/permit_conversions_to_arrays_of_unknown_bound.md b/lang/cpp20/permit_conversions_to_arrays_of_unknown_bound.md index 61e5cf72cd..5b8d3bc8d4 100644 --- a/lang/cpp20/permit_conversions_to_arrays_of_unknown_bound.md +++ b/lang/cpp20/permit_conversions_to_arrays_of_unknown_bound.md @@ -116,4 +116,4 @@ g(arr); // OK ## 参照 -* [P0388R4 Permit conversions to arrays of unknown bound](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0388r4.html) \ No newline at end of file +* [P0388R4 Permit conversions to arrays of unknown bound](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0388r4.html) diff --git a/lang/cpp20/permitting_trivial_default_initialization_in_constexpr_contexts.md b/lang/cpp20/permitting_trivial_default_initialization_in_constexpr_contexts.md index 2a6192d39d..473a425eb9 100644 --- a/lang/cpp20/permitting_trivial_default_initialization_in_constexpr_contexts.md +++ b/lang/cpp20/permitting_trivial_default_initialization_in_constexpr_contexts.md @@ -127,4 +127,4 @@ int main() { ## 参照 -- [P1331R2 Permitting trivial default initialization in constexpr contexts](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1331r2.pdf) \ No newline at end of file +- [P1331R2 Permitting trivial default initialization in constexpr contexts](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1331r2.pdf) diff --git a/lang/cpp20/predefined_macros.md b/lang/cpp20/predefined_macros.md index 698a7dc3d8..b98777b4cf 100644 --- a/lang/cpp20/predefined_macros.md +++ b/lang/cpp20/predefined_macros.md @@ -19,4 +19,4 @@ ## 参照 -- [N4859 Editors' Report -- Programming Languages -- C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/n4859.html) \ No newline at end of file +- [N4859 Editors' Report -- Programming Languages -- C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/n4859.html) diff --git a/lang/cpp20/prohibit_aggregates_with_user-declared_constructors.md b/lang/cpp20/prohibit_aggregates_with_user-declared_constructors.md index 2a995d1ff3..4e01b3e974 100644 --- a/lang/cpp20/prohibit_aggregates_with_user-declared_constructors.md +++ b/lang/cpp20/prohibit_aggregates_with_user-declared_constructors.md @@ -114,4 +114,4 @@ int main() { ## 参照 -- [P1008R1 Prohibit aggregates with user-declared constructors](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1008r1.pdf) \ No newline at end of file +- [P1008R1 Prohibit aggregates with user-declared constructors](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1008r1.pdf) diff --git a/lang/cpp20/range-based_for_statements_with_initializer.md b/lang/cpp20/range-based_for_statements_with_initializer.md index 02e7dcd7de..a4d0e77464 100644 --- a/lang/cpp20/range-based_for_statements_with_initializer.md +++ b/lang/cpp20/range-based_for_statements_with_initializer.md @@ -127,4 +127,4 @@ int main() ## 参照 -- [P0614R1 Range-based for statements with initializer](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0614r1.html) \ No newline at end of file +- [P0614R1 Range-based for statements with initializer](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0614r1.html) diff --git a/lang/cpp20/reference_capture_of_structured_bindings.md b/lang/cpp20/reference_capture_of_structured_bindings.md index 51656fbbe1..23bfe187da 100644 --- a/lang/cpp20/reference_capture_of_structured_bindings.md +++ b/lang/cpp20/reference_capture_of_structured_bindings.md @@ -43,4 +43,4 @@ int main() { ## 参照 -- [P1381R1 Reference capture of structured bindings](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1381r1.html) \ No newline at end of file +- [P1381R1 Reference capture of structured bindings](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1381r1.html) diff --git a/lang/cpp20/relaxing_the_range_for_loop_customization_point_finding_rules.md b/lang/cpp20/relaxing_the_range_for_loop_customization_point_finding_rules.md index f24a6e3009..3d4934fd94 100644 --- a/lang/cpp20/relaxing_the_range_for_loop_customization_point_finding_rules.md +++ b/lang/cpp20/relaxing_the_range_for_loop_customization_point_finding_rules.md @@ -69,4 +69,4 @@ o ## 参照 -- [P0962R1 Relaxing the range-for loop customization point finding rules](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0962r1.html) \ No newline at end of file +- [P0962R1 Relaxing the range-for loop customization point finding rules](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0962r1.html) diff --git a/lang/cpp20/relaxing_the_structured_bindings_customization_point_finding_rules.md b/lang/cpp20/relaxing_the_structured_bindings_customization_point_finding_rules.md index a9ff87a99b..b0782115e3 100644 --- a/lang/cpp20/relaxing_the_structured_bindings_customization_point_finding_rules.md +++ b/lang/cpp20/relaxing_the_structured_bindings_customization_point_finding_rules.md @@ -61,4 +61,4 @@ int main() ## 参照 -- [P0961R1 Relaxing the structured bindings customization point finding rules](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0961r1.html) \ No newline at end of file +- [P0961R1 Relaxing the structured bindings customization point finding rules](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0961r1.html) diff --git a/lang/cpp20/resolving_const_mismatch_with_defaulted_copy_constructor.md b/lang/cpp20/resolving_const_mismatch_with_defaulted_copy_constructor.md index 11ba585ac9..1a47c5daa2 100644 --- a/lang/cpp20/resolving_const_mismatch_with_defaulted_copy_constructor.md +++ b/lang/cpp20/resolving_const_mismatch_with_defaulted_copy_constructor.md @@ -46,4 +46,4 @@ C++20では、このコードを適格とする。 ## 参照 -- [P0641R2 Resolving Core Issue #1331 (`const` mismatch with defaulted copy constructor)](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0641r2.html) \ No newline at end of file +- [P0641R2 Resolving Core Issue #1331 (`const` mismatch with defaulted copy constructor)](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0641r2.html) diff --git a/lang/cpp20/signed_integers_are_twos_complement.md b/lang/cpp20/signed_integers_are_twos_complement.md index 1e4bc5d09e..89c1843c7b 100644 --- a/lang/cpp20/signed_integers_are_twos_complement.md +++ b/lang/cpp20/signed_integers_are_twos_complement.md @@ -143,4 +143,4 @@ C11規格は、2の補数のほかに、1の補数表現 (Ones' complement) と - [P0907R4 Signed Integers are Two's Complement](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0907r4.html) - 元になった提案文書 - [符号付き整数型の負数表現を 2 の補数と規定 (P1236R1) - cppmap](https://cppmap.github.io/standardization/cpp20/#2-p1236r1) -- [2の補数表現における演算](http://www.cc.kyoto-su.ac.jp/~kbys/kiso/number/int-op.html) \ No newline at end of file +- [2の補数表現における演算](http://www.cc.kyoto-su.ac.jp/~kbys/kiso/number/int-op.html) diff --git a/lang/cpp20/simplifying_implicit_lambda_capture.md b/lang/cpp20/simplifying_implicit_lambda_capture.md index 7470fc3714..8fbce21ed2 100644 --- a/lang/cpp20/simplifying_implicit_lambda_capture.md +++ b/lang/cpp20/simplifying_implicit_lambda_capture.md @@ -37,4 +37,4 @@ void f() { - [C++20 構造化束縛を拡張して通常の変数宣言のように使用できるようにする](extending_structured_bindings_to_be_more_like_variable_declarations.md) ## 参照 -- [P0588R1 Simplifying implicit lambda capture](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0588r1.html) \ No newline at end of file +- [P0588R1 Simplifying implicit lambda capture](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0588r1.html) diff --git a/lang/cpp20/try-catch_blocks_in_constexpr_functions.md b/lang/cpp20/try-catch_blocks_in_constexpr_functions.md index 82881aead4..3427b67170 100644 --- a/lang/cpp20/try-catch_blocks_in_constexpr_functions.md +++ b/lang/cpp20/try-catch_blocks_in_constexpr_functions.md @@ -34,4 +34,4 @@ constexpr int f(int x) { ## 参照 -- [P1002R1 Try-catch blocks in constexpr functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1002r1.pdf) \ No newline at end of file +- [P1002R1 Try-catch blocks in constexpr functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1002r1.pdf) diff --git a/lang/cpp20/using_enum.md b/lang/cpp20/using_enum.md index 72557915f1..a34c94d360 100644 --- a/lang/cpp20/using_enum.md +++ b/lang/cpp20/using_enum.md @@ -124,4 +124,4 @@ C言語形式の列挙型を改善するために[スコープを持つ列挙型 ## 参照 -- [P1099R5 Using Enum](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1099r5.html) \ No newline at end of file +- [P1099R5 Using Enum](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1099r5.html) diff --git a/lang/cpp20/va_opt.md b/lang/cpp20/va_opt.md index 96d19e56f2..ef1fc49271 100644 --- a/lang/cpp20/va_opt.md +++ b/lang/cpp20/va_opt.md @@ -58,4 +58,4 @@ int main() ## 参照 -- [P0306R4 Comma omission and comma deletion](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0306r4.html) \ No newline at end of file +- [P0306R4 Comma omission and comma deletion](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0306r4.html) diff --git a/lang/cpp20/wording_for_lambdas_in_unevaluated_contexts.md b/lang/cpp20/wording_for_lambdas_in_unevaluated_contexts.md index 4a220551d2..3c47193943 100644 --- a/lang/cpp20/wording_for_lambdas_in_unevaluated_contexts.md +++ b/lang/cpp20/wording_for_lambdas_in_unevaluated_contexts.md @@ -145,4 +145,4 @@ C++17までは、ラムダ式をSFINAEの文脈で用いて擬似的なコンセ - [P0315R0 Wording for lambdas in unevaluated contexts](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0315r0.pdf) - [P0315R4 Wording for lambdas in unevaluated contexts](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0315r4.pdf) - [CWG Issue.1607 Lambdas in template parameters](https://wg21.cmeerw.net/cwg/issue1607) -- [C++標準化委員会の文書: P0310R--P0319R0 - 本の虫](https://ezoeryou.github.io/blog/article/2016-07-27-cpp-P0310R0-P0319R0.html) \ No newline at end of file +- [C++標準化委員会の文書: P0310R--P0319R0 - 本の虫](https://ezoeryou.github.io/blog/article/2016-07-27-cpp-P0310R0-P0319R0.html) diff --git a/lang/cpp23/attributes_on_lambda_expressions.md b/lang/cpp23/attributes_on_lambda_expressions.md index 7ef22e2362..8a822bb802 100644 --- a/lang/cpp23/attributes_on_lambda_expressions.md +++ b/lang/cpp23/attributes_on_lambda_expressions.md @@ -55,4 +55,4 @@ int main() ## 参照 -- [P2173R1 Attributes on Lambda-Expressions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2173r1.pdf) \ No newline at end of file +- [P2173R1 Attributes on Lambda-Expressions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2173r1.pdf) diff --git a/lang/cpp23/character_encoding_of_diagnostic_text.md b/lang/cpp23/character_encoding_of_diagnostic_text.md index 07c4ded971..a3410cb5d1 100644 --- a/lang/cpp23/character_encoding_of_diagnostic_text.md +++ b/lang/cpp23/character_encoding_of_diagnostic_text.md @@ -23,4 +23,4 @@ C++20までは、「基本ソース文字集合に含まれない文字は出力 ## 参照 - [P2246R1 Character encoding of diagnostic text](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2246r1.pdf) -- [WG14 N2563 Character encoding of diagnostic text](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2563.pdf) \ No newline at end of file +- [WG14 N2563 Character encoding of diagnostic text](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2563.pdf) diff --git a/lang/cpp23/class_template_argument_deduction_from_inherited.md b/lang/cpp23/class_template_argument_deduction_from_inherited.md index 2e59fab64b..7821a439a5 100644 --- a/lang/cpp23/class_template_argument_deduction_from_inherited.md +++ b/lang/cpp23/class_template_argument_deduction_from_inherited.md @@ -67,4 +67,4 @@ G g(true, 'a', 1); // OK。Gに推論される ## 参照 -- [P2582R1 Wording for class template argument deduction from inherited constructors](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2582r1.pdf) \ No newline at end of file +- [P2582R1 Wording for class template argument deduction from inherited constructors](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2582r1.pdf) diff --git a/lang/cpp23/consistent_character_literal_encoding.md b/lang/cpp23/consistent_character_literal_encoding.md index 6e935b573c..37f82c5bb6 100644 --- a/lang/cpp23/consistent_character_literal_encoding.md +++ b/lang/cpp23/consistent_character_literal_encoding.md @@ -29,4 +29,4 @@ if ('A' == 0x41){} ## 参照 -- [P2316R2 Consistent character literal encoding](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2316r2.pdf) \ No newline at end of file +- [P2316R2 Consistent character literal encoding](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2316r2.pdf) diff --git a/lang/cpp23/delimited_escape_sequences.md b/lang/cpp23/delimited_escape_sequences.md index ce5ff8f594..1f0abfac5b 100644 --- a/lang/cpp23/delimited_escape_sequences.md +++ b/lang/cpp23/delimited_escape_sequences.md @@ -44,4 +44,4 @@ u8"\u{1F1F8}"; // C++23 : 5文字のコードポイントも記述できる ## 参照 -- [P2290R3 Delimited escape sequences](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2290r3.pdf) \ No newline at end of file +- [P2290R3 Delimited escape sequences](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2290r3.pdf) diff --git a/lang/cpp23/down_with_lambda_parens.md b/lang/cpp23/down_with_lambda_parens.md index d5b20422ff..348f99ba5c 100644 --- a/lang/cpp23/down_with_lambda_parens.md +++ b/lang/cpp23/down_with_lambda_parens.md @@ -38,4 +38,4 @@ auto f5 = [] constexpr mutable noexcept -> bool { return true; }; // C++23 OK ## 参照 -- [P1102R2 Down with `()`!](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1102r2.html) \ No newline at end of file +- [P1102R2 Down with `()`!](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1102r2.html) diff --git a/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md b/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md index fac0741179..ae9e5f11c7 100644 --- a/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md +++ b/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md @@ -52,4 +52,4 @@ int main() ## 参照 -- [P2360R0 Extend init-statement to allow alias-declaration](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2360r0.html) \ No newline at end of file +- [P2360R0 Extend init-statement to allow alias-declaration](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2360r0.html) diff --git a/lang/cpp23/feature_test_macros.md b/lang/cpp23/feature_test_macros.md index ec0ed18940..624b1247cc 100644 --- a/lang/cpp23/feature_test_macros.md +++ b/lang/cpp23/feature_test_macros.md @@ -101,4 +101,4 @@ ## 参照 -- [SD-FeatureTest: Feature-Test Macros and Policies - isocpp](https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations) \ No newline at end of file +- [SD-FeatureTest: Feature-Test Macros and Policies - isocpp](https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations) diff --git a/lang/cpp23/generalized_wording_for_partial_specializations.md b/lang/cpp23/generalized_wording_for_partial_specializations.md index 8a8bd8ffa7..fc367d7bae 100644 --- a/lang/cpp23/generalized_wording_for_partial_specializations.md +++ b/lang/cpp23/generalized_wording_for_partial_specializations.md @@ -45,4 +45,4 @@ int main() { ## 参照 -- [P2096R2 Generalized wording for partial specializations](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2096r2.html) \ No newline at end of file +- [P2096R2 Generalized wording for partial specializations](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2096r2.html) diff --git a/lang/cpp23/labels_at_the_end_of_compound_statements.md b/lang/cpp23/labels_at_the_end_of_compound_statements.md index f61bdd74b5..6b97801771 100644 --- a/lang/cpp23/labels_at_the_end_of_compound_statements.md +++ b/lang/cpp23/labels_at_the_end_of_compound_statements.md @@ -34,4 +34,4 @@ C++23でこの機能を導入することにより、gotoラベルを置ける ## 参照 - [P2324R2 Labels at the end of compound statements (C compatibility)](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2324r2.pdf) -- [C2X Proposal: WG14 N2508 Free Positioning of Labels Inside Compound Statements (updates N2496)](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2508.pdf) \ No newline at end of file +- [C2X Proposal: WG14 N2508 Free Positioning of Labels Inside Compound Statements (updates N2496)](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2508.pdf) diff --git a/lang/cpp23/literal_suffix_for_signed_size_t.md b/lang/cpp23/literal_suffix_for_signed_size_t.md index a18ee9fd81..2b99f48a50 100644 --- a/lang/cpp23/literal_suffix_for_signed_size_t.md +++ b/lang/cpp23/literal_suffix_for_signed_size_t.md @@ -66,4 +66,4 @@ case 2はC++23で導入する[`size_t`](/reference/cstddef/size_t.md)型リテ ## 参照 -- [P0330R8 Literal Suffix for (signed) `size_t`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p0330r8.html) \ No newline at end of file +- [P0330R8 Literal Suffix for (signed) `size_t`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p0330r8.html) diff --git a/lang/cpp23/make_declaration_order_layout_mandated.md b/lang/cpp23/make_declaration_order_layout_mandated.md index 1a663fa84a..6f60db1b66 100644 --- a/lang/cpp23/make_declaration_order_layout_mandated.md +++ b/lang/cpp23/make_declaration_order_layout_mandated.md @@ -28,4 +28,4 @@ public: ## 参照 -- [P1847R4 Make declaration order layout mandated](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1847r4.pdf) \ No newline at end of file +- [P1847R4 Make declaration order layout mandated](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1847r4.pdf) diff --git a/lang/cpp23/meaningful_exports.md b/lang/cpp23/meaningful_exports.md index b4961a5c26..6217a1c97d 100644 --- a/lang/cpp23/meaningful_exports.md +++ b/lang/cpp23/meaningful_exports.md @@ -35,4 +35,4 @@ C++23では、本来必要のない以下の宣言に対するexport宣言を禁 ## 参照 - [P2615R1 Meaningful exports](https://open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2615r1.html) -- [CWG Issue 2443. Meaningless template exports](https://wg21.cmeerw.net/cwg/issue2443) \ No newline at end of file +- [CWG Issue 2443. Meaningless template exports](https://wg21.cmeerw.net/cwg/issue2443) diff --git a/lang/cpp23/mixed_string_literal_concatenation.md b/lang/cpp23/mixed_string_literal_concatenation.md index 852d6d4ab4..84aafac7bd 100644 --- a/lang/cpp23/mixed_string_literal_concatenation.md +++ b/lang/cpp23/mixed_string_literal_concatenation.md @@ -39,4 +39,4 @@ void f() { ## 参照 -- [P2201R1: Mixed string literal concatenation](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2201r1.html) \ No newline at end of file +- [P2201R1: Mixed string literal concatenation](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2201r1.html) diff --git a/lang/cpp23/multidimensional_subscript_operator.md b/lang/cpp23/multidimensional_subscript_operator.md index 4d85b0a39b..bb462e7b12 100644 --- a/lang/cpp23/multidimensional_subscript_operator.md +++ b/lang/cpp23/multidimensional_subscript_operator.md @@ -55,4 +55,4 @@ int main() { ## 参照 -- [P2128R6 Multidimensional subscript operator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2128r6.pdf) \ No newline at end of file +- [P2128R6 Multidimensional subscript operator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2128r6.pdf) diff --git a/lang/cpp23/narrowing_contextual_conversions_to_bool.md b/lang/cpp23/narrowing_contextual_conversions_to_bool.md index 36e45e7129..6b0456f0e7 100644 --- a/lang/cpp23/narrowing_contextual_conversions_to_bool.md +++ b/lang/cpp23/narrowing_contextual_conversions_to_bool.md @@ -45,4 +45,4 @@ if constexpr (sizeof(int[2])) { … } // C++23:OK 縮小変換 ## 参照 -- [P1401R5 Narrowing contextual conversions to `bool`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1401r5.html) \ No newline at end of file +- [P1401R5 Narrowing contextual conversions to `bool`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1401r5.html) diff --git a/lang/cpp23/non_literal_variables_in_constexpr_functions.md b/lang/cpp23/non_literal_variables_in_constexpr_functions.md index e60b206085..17d97335c5 100644 --- a/lang/cpp23/non_literal_variables_in_constexpr_functions.md +++ b/lang/cpp23/non_literal_variables_in_constexpr_functions.md @@ -36,4 +36,4 @@ ## 参照 -- [P2242R3 - Non-literal variables (and labels and gotos) in constexpr functions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2242r3.html) \ No newline at end of file +- [P2242R3 - Non-literal variables (and labels and gotos) in constexpr functions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2242r3.html) diff --git a/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md b/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md index 86f3ac78ad..de46e9c55c 100644 --- a/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md +++ b/lang/cpp23/permitting_static_constexpr_variables_in_constexpr_functions.md @@ -31,4 +31,4 @@ C++20までは`constexpr`内で`static constexpr`変数を定義できなかっ - [C++23 定数式内での非リテラル変数、静的変数・スレッドローカル変数およびgotoとラベルの存在を許可する](/lang/cpp23/non_literal_variables_in_constexpr_functions.md) ## 参照 -- [P2647R1 Permitting `static constexpr` variables in `constexpr` functions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2647r1.html) \ No newline at end of file +- [P2647R1 Permitting `static constexpr` variables in `constexpr` functions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2647r1.html) diff --git a/lang/cpp23/portable_assumptions.md b/lang/cpp23/portable_assumptions.md index 7433e8ddc2..66c560d08b 100644 --- a/lang/cpp23/portable_assumptions.md +++ b/lang/cpp23/portable_assumptions.md @@ -71,4 +71,4 @@ int f(int y) ## 参照 - [Clang Builtin Functions `__builtin_assume`](https://clang.llvm.org/docs/LanguageExtensions.html) - [MSVC Compiler intrinsics `__assume`](https://learn.microsoft.com/en-us/cpp/intrinsics/assume) -- [P1774R8 Portable assumptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1774r8.pdf) \ No newline at end of file +- [P1774R8 Portable assumptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1774r8.pdf) diff --git a/lang/cpp23/predefined_macros.md b/lang/cpp23/predefined_macros.md index 1e18baedd8..823009f4d5 100644 --- a/lang/cpp23/predefined_macros.md +++ b/lang/cpp23/predefined_macros.md @@ -19,4 +19,4 @@ ## 参照 -- [N4951 Editors’ Report: Programming Languages — C++](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4951.html) \ No newline at end of file +- [N4951 Editors’ Report: Programming Languages — C++](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4951.html) diff --git a/lang/cpp23/simpler_implicit_move.md b/lang/cpp23/simpler_implicit_move.md index 71b40f5709..4f5d76b87e 100644 --- a/lang/cpp23/simpler_implicit_move.md +++ b/lang/cpp23/simpler_implicit_move.md @@ -348,4 +348,4 @@ auto g(Widget&& w) -> Widget&& { - [P2266R3 Simpler implicit move](https://wg21.link/p2266r3) - [The Complete Guide to `return x;` - Arthur O'Dwyer - [CppNow 2021] - YouTube](https://www.youtube.com/watch?v=OGKAJD7bmr8) -- [c++ - Does c++23 break unmove - Stack Overflow](https://stackoverflow.com/questions/76647046/does-c23-break-unmove) \ No newline at end of file +- [c++ - Does c++23 break unmove - Stack Overflow](https://stackoverflow.com/questions/76647046/does-c23-break-unmove) diff --git a/lang/cpp23/static_operator.md b/lang/cpp23/static_operator.md index d2a1b7262e..be4912e031 100644 --- a/lang/cpp23/static_operator.md +++ b/lang/cpp23/static_operator.md @@ -64,4 +64,4 @@ int main() ## 参照 - [P1169R4 `static operator()`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1169r4.html) -- [P2589R0 `static operator[]`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2589r0.pdf) \ No newline at end of file +- [P2589R0 `static operator[]`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2589r0.pdf) diff --git a/lang/cpp23/support_for_utf8_as_a_portable_source_file_encoding.md b/lang/cpp23/support_for_utf8_as_a_portable_source_file_encoding.md index 8457251863..9c04b2ec6e 100644 --- a/lang/cpp23/support_for_utf8_as_a_portable_source_file_encoding.md +++ b/lang/cpp23/support_for_utf8_as_a_portable_source_file_encoding.md @@ -16,4 +16,4 @@ C++20まで、ソースコードの文字集合は実装定義だったが、そ ## 参照 -- [P2295R6 Support for UTF-8 as a portable source file encoding](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2295r6.pdf) \ No newline at end of file +- [P2295R6 Support for UTF-8 as a portable source file encoding](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2295r6.pdf) diff --git a/lang/cpp23/warning.md b/lang/cpp23/warning.md index fdc8f98fa1..16ede68699 100644 --- a/lang/cpp23/warning.md +++ b/lang/cpp23/warning.md @@ -61,4 +61,4 @@ Hello ## 参照 -- [P2437R1 Support for `#warning`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2437r1.pdf) \ No newline at end of file +- [P2437R1 Support for `#warning`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2437r1.pdf) diff --git a/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md b/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md index 62b6c1f612..b78b14a77e 100644 --- a/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md +++ b/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md @@ -27,4 +27,4 @@ int x = +f - e; // OK ## 参照 -- [P2864R2 Remove Deprecated Arithmetic Conversion on Enumerations From C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2864r2.pdf) \ No newline at end of file +- [P2864R2 Remove Deprecated Arithmetic Conversion on Enumerations From C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2864r2.pdf) diff --git a/lang/cpp26/structured_bindings_can_introduce_a_pack.md b/lang/cpp26/structured_bindings_can_introduce_a_pack.md index f6debe55b9..0eef804d9e 100644 --- a/lang/cpp26/structured_bindings_can_introduce_a_pack.md +++ b/lang/cpp26/structured_bindings_can_introduce_a_pack.md @@ -105,4 +105,4 @@ auto dot_product(P p, Q q) { ## 参照 -- [P1061R10 Structured Bindings can introduce a Pack](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p1061r10.html) \ No newline at end of file +- [P1061R10 Structured Bindings can introduce a Pack](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p1061r10.html) diff --git a/lang/cpp26/user-generated_static_assert_messages.md b/lang/cpp26/user-generated_static_assert_messages.md index 89b2aa3cb1..1cf9ea1a28 100644 --- a/lang/cpp26/user-generated_static_assert_messages.md +++ b/lang/cpp26/user-generated_static_assert_messages.md @@ -56,4 +56,4 @@ static_assert(定数式, 診断メッセージ); ## 参照 -- [P2741R3 user-generated `static_assert` messages](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2741r3.pdf) \ No newline at end of file +- [P2741R3 user-generated `static_assert` messages](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2741r3.pdf) diff --git a/lang/future/contract-based_programming.md b/lang/future/contract-based_programming.md index 63857ab27f..e5bdd4e915 100644 --- a/lang/future/contract-based_programming.md +++ b/lang/future/contract-based_programming.md @@ -266,4 +266,4 @@ struct derived : base { ## 参照 - [P0542R5 Support for contract based programming in C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0542r5.html) -- [ET: Inheritance Inheritance and contracts - Eiffel.org](https://www.eiffel.org/doc/eiffel/ET-_Inheritance#Inheritance_and_contracts) \ No newline at end of file +- [ET: Inheritance Inheritance and contracts - Eiffel.org](https://www.eiffel.org/doc/eiffel/ET-_Inheritance#Inheritance_and_contracts) diff --git a/reference/any/any_cast.md b/reference/any/any_cast.md index f4c65910dd..3a7ecadab8 100644 --- a/reference/any/any_cast.md +++ b/reference/any/any_cast.md @@ -152,4 +152,4 @@ int main() ## 参照 -- [LWG Issue 3305. `any_cast`](https://cplusplus.github.io/LWG/issue3305) \ No newline at end of file +- [LWG Issue 3305. `any_cast`](https://cplusplus.github.io/LWG/issue3305) diff --git a/reference/cctype/isgraph.md b/reference/cctype/isgraph.md index 56dae2b16c..b039a913be 100644 --- a/reference/cctype/isgraph.md +++ b/reference/cctype/isgraph.md @@ -56,4 +56,4 @@ isgraph('0x0f') = 0 int isgraph(int ch) { return isprint(ch) && !isspace(ch); } -``` \ No newline at end of file +``` diff --git a/reference/cctype/ispunct.md b/reference/cctype/ispunct.md index aac33a38e0..0f3301c212 100644 --- a/reference/cctype/ispunct.md +++ b/reference/cctype/ispunct.md @@ -56,4 +56,4 @@ ispunct('0x0f') = 0 int ispunct(int ch) { return isprint(ch) && !isalnum(ch); } -``` \ No newline at end of file +``` diff --git a/reference/contracts/contract_violation.md b/reference/contracts/contract_violation.md index 8c82af079e..ce96a3a2b1 100644 --- a/reference/contracts/contract_violation.md +++ b/reference/contracts/contract_violation.md @@ -35,4 +35,4 @@ namespace std::contracts { | [`semantic`](contract_violation/semantic.md) | 契約の評価方法 | C++26| ## 参照 -- [Contracts for C++](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2900r14.pdf) \ No newline at end of file +- [Contracts for C++](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2900r14.pdf) diff --git a/reference/contracts/contract_violation/comment.md b/reference/contracts/contract_violation/comment.md index 2e71cf0a01..80b3643cf0 100644 --- a/reference/contracts/contract_violation/comment.md +++ b/reference/contracts/contract_violation/comment.md @@ -32,4 +32,4 @@ const char* comment() const noexcept; ## 参照 - [Contracts for C++](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2900r14.pdf) -- \ No newline at end of file +- diff --git a/reference/contracts/contract_violation/detection_mode.md b/reference/contracts/contract_violation/detection_mode.md index 0c01c411e2..17b51df921 100644 --- a/reference/contracts/contract_violation/detection_mode.md +++ b/reference/contracts/contract_violation/detection_mode.md @@ -28,4 +28,4 @@ contracts::detection_mode detection_mode() const noexcept; - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 -- [Contracts for C++](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2900r14.pdf) \ No newline at end of file +- [Contracts for C++](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2900r14.pdf) diff --git a/reference/contracts/contract_violation/is_terminating.md b/reference/contracts/contract_violation/is_terminating.md index 4c56ad323a..5703c78ffe 100644 --- a/reference/contracts/contract_violation/is_terminating.md +++ b/reference/contracts/contract_violation/is_terminating.md @@ -28,4 +28,4 @@ bool is_terminating() const noexcept; - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 -- [Contracts for C++](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2900r14.pdf) \ No newline at end of file +- [Contracts for C++](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2900r14.pdf) diff --git a/reference/contracts/contract_violation/kind.md b/reference/contracts/contract_violation/kind.md index b2a995aa93..e4d0341b12 100644 --- a/reference/contracts/contract_violation/kind.md +++ b/reference/contracts/contract_violation/kind.md @@ -28,4 +28,4 @@ assertion_kind kind() const noexcept; - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 -- [Contracts for C++](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2900r14.pdf) \ No newline at end of file +- [Contracts for C++](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2900r14.pdf) diff --git a/reference/contracts/contract_violation/semantic.md b/reference/contracts/contract_violation/semantic.md index 56abd9b989..b63e972038 100644 --- a/reference/contracts/contract_violation/semantic.md +++ b/reference/contracts/contract_violation/semantic.md @@ -27,4 +27,4 @@ evaluation_semantic semantic() const noexcept; - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 -- [Contracts for C++](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2900r14.pdf) \ No newline at end of file +- [Contracts for C++](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2900r14.pdf) diff --git a/reference/contracts/invoke_default_contract_violation_handler.md b/reference/contracts/invoke_default_contract_violation_handler.md index 844f318141..f9edf372d2 100644 --- a/reference/contracts/invoke_default_contract_violation_handler.md +++ b/reference/contracts/invoke_default_contract_violation_handler.md @@ -34,4 +34,4 @@ namespace std::contracts { - [`contract_violation`](contract_violation.md) ## 参照 -- [P2900R14 Contracts for C++](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2900r14.pdf) \ No newline at end of file +- [P2900R14 Contracts for C++](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2900r14.pdf) diff --git a/reference/cstdio/feof.md b/reference/cstdio/feof.md index feba458069..04811794d9 100644 --- a/reference/cstdio/feof.md +++ b/reference/cstdio/feof.md @@ -18,4 +18,4 @@ namespace std { ## 処理系 - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cstdio/fflush.md b/reference/cstdio/fflush.md index 3fefb2dbc8..5882932ecc 100644 --- a/reference/cstdio/fflush.md +++ b/reference/cstdio/fflush.md @@ -20,4 +20,4 @@ namespace std { ## 処理系 - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cstdio/fputs.md b/reference/cstdio/fputs.md index 518429041b..e00160f223 100644 --- a/reference/cstdio/fputs.md +++ b/reference/cstdio/fputs.md @@ -28,4 +28,4 @@ int main() { ## 処理系 - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cstdio/putc.md b/reference/cstdio/putc.md index 6179bf5ad5..4905d60a8c 100644 --- a/reference/cstdio/putc.md +++ b/reference/cstdio/putc.md @@ -39,4 +39,4 @@ Hello ## 処理系 - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cstdio/rename.md b/reference/cstdio/rename.md index 67114d75dc..e025c7de4e 100644 --- a/reference/cstdio/rename.md +++ b/reference/cstdio/rename.md @@ -23,4 +23,4 @@ namespace std { - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cstdio/ungetc.md b/reference/cstdio/ungetc.md index e6de5582f9..12b998a399 100644 --- a/reference/cstdio/ungetc.md +++ b/reference/cstdio/ungetc.md @@ -48,4 +48,4 @@ aA ## 処理系 - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/execution/execution/read_env.md b/reference/execution/execution/read_env.md index 9d278cfa3b..dd01a8ca6e 100644 --- a/reference/execution/execution/read_env.md +++ b/reference/execution/execution/read_env.md @@ -95,4 +95,4 @@ int main() ## 参照 -- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) \ No newline at end of file +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/fstream/basic_filebuf/native_handle.md b/reference/fstream/basic_filebuf/native_handle.md index 50c96b372e..a15f39ff50 100644 --- a/reference/fstream/basic_filebuf/native_handle.md +++ b/reference/fstream/basic_filebuf/native_handle.md @@ -76,4 +76,4 @@ Last modified: 2025-05-28 17:56:55 JST - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 -- [P1759R6 Native handles and file streams](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1759r6.html) \ No newline at end of file +- [P1759R6 Native handles and file streams](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1759r6.html) diff --git a/reference/fstream/basic_fstream/native_handle.md b/reference/fstream/basic_fstream/native_handle.md index 7e22f519a7..97bd121130 100644 --- a/reference/fstream/basic_fstream/native_handle.md +++ b/reference/fstream/basic_fstream/native_handle.md @@ -79,4 +79,4 @@ Last modified: 2025-05-28 17:56:55 JST - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 -- [P1759R6 Native handles and file streams](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1759r6.html) \ No newline at end of file +- [P1759R6 Native handles and file streams](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1759r6.html) diff --git a/reference/fstream/basic_ifstream/native_handle.md b/reference/fstream/basic_ifstream/native_handle.md index c110f4c961..0cd0b29af4 100644 --- a/reference/fstream/basic_ifstream/native_handle.md +++ b/reference/fstream/basic_ifstream/native_handle.md @@ -79,4 +79,4 @@ Last modified: 2025-05-28 17:56:55 JST - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 -- [P1759R6 Native handles and file streams](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1759r6.html) \ No newline at end of file +- [P1759R6 Native handles and file streams](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1759r6.html) diff --git a/reference/fstream/basic_ofstream/native_handle.md b/reference/fstream/basic_ofstream/native_handle.md index d1868a4ba4..bc70042251 100644 --- a/reference/fstream/basic_ofstream/native_handle.md +++ b/reference/fstream/basic_ofstream/native_handle.md @@ -79,4 +79,4 @@ Last modified: 2025-05-28 17:56:55 JST - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 -- [P1759R6 Native handles and file streams](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1759r6.html) \ No newline at end of file +- [P1759R6 Native handles and file streams](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1759r6.html) diff --git a/reference/functional/bind_back.md b/reference/functional/bind_back.md index 40a09549a3..938e33f7ba 100644 --- a/reference/functional/bind_back.md +++ b/reference/functional/bind_back.md @@ -151,4 +151,4 @@ int main() { - [P2387R3 Pipe support for user-defined range adaptors](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2387r3.html#nanorange) - [rangesのパイプにアダプトするには](https://onihusube.hatenablog.com/entry/2022/04/24/010041) - [P2714R1 Bind front and back to NTTP callables](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2714r1.html) - - C++26でオーバーロード(2)を追加 \ No newline at end of file + - C++26でオーバーロード(2)を追加 diff --git a/reference/functional/bind_front.md b/reference/functional/bind_front.md index 558ac6c550..f2158da71a 100644 --- a/reference/functional/bind_front.md +++ b/reference/functional/bind_front.md @@ -144,4 +144,4 @@ int main() { - [P0356R5 Simplified partial function application](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0356r5.html) - [P1651R0 `bind_front` should not unwrap `reference_wrapper`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1651r0.html) - [P2714R1 Bind front and back to NTTP callables](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2714r1.html) - - C++26でオーバーロード(2)を追加 \ No newline at end of file + - C++26でオーバーロード(2)を追加 diff --git a/reference/functional/invoke.md b/reference/functional/invoke.md index d353ec9a12..5561be02d8 100644 --- a/reference/functional/invoke.md +++ b/reference/functional/invoke.md @@ -138,4 +138,4 @@ int main() ## 参照 - [C++1z INVOKEコンセプトに従った関数呼び出しをするinvoke()関数 - Faith and Brave - C++で遊ぼう](https://faithandbrave.hateblo.jp/entry/2016/09/07/173344) - [N4169 A proposal to add invoke function template (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4169.html) -- [P1065R2 constexpr INVOKE](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1065r2.html) \ No newline at end of file +- [P1065R2 constexpr INVOKE](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1065r2.html) diff --git a/reference/functional/not_fn.md b/reference/functional/not_fn.md index ea7950ec67..e2a1684b2b 100644 --- a/reference/functional/not_fn.md +++ b/reference/functional/not_fn.md @@ -138,4 +138,4 @@ true - [P0356R5 Simplified partial function application](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0356r5.html) - [P1065R2 constexpr INVOKE](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1065r2.html) - [P2714R1 Bind front and back to NTTP callables](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2714r1.html) - - C++26でオーバーロード(2)を追加 \ No newline at end of file + - C++26でオーバーロード(2)を追加 diff --git a/reference/functional/ref.md b/reference/functional/ref.md index d5f907f748..2795efeb70 100644 --- a/reference/functional/ref.md +++ b/reference/functional/ref.md @@ -77,4 +77,4 @@ int main() ## 参照 - [P0357R3 reference_wrapper for incomplete types](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0357r3.html) - テンプレートパラメータ`T`に不完全型が許可された経緯 -- [P1065R2 constexpr INVOKE](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1065r2.html) \ No newline at end of file +- [P1065R2 constexpr INVOKE](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1065r2.html) diff --git a/reference/iterator/common_iterator.md b/reference/iterator/common_iterator.md index 7287a48e7d..f8788eb86e 100644 --- a/reference/iterator/common_iterator.md +++ b/reference/iterator/common_iterator.md @@ -140,4 +140,4 @@ int main() { ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) - [Hidden Friends - yohhoyの日記](https://yohhoy.hatenadiary.jp/entry/20190531/p1) -- [LWG Issue 3749. `common_iterator` should handle integer-class difference types](https://cplusplus.github.io/LWG/issue3749) \ No newline at end of file +- [LWG Issue 3749. `common_iterator` should handle integer-class difference types](https://cplusplus.github.io/LWG/issue3749) diff --git a/reference/iterator/contiguous_iterator.md b/reference/iterator/contiguous_iterator.md index 9138e8adf9..9d50db4ee7 100644 --- a/reference/iterator/contiguous_iterator.md +++ b/reference/iterator/contiguous_iterator.md @@ -113,4 +113,4 @@ std::ostream_iterator is not contiguous_iterator - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) - [P1474R1 Helpful pointers for `ContiguousIterator`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1474r1.pdf) -- [P3349R1 Converting contiguous iterators to pointers](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3349r1.html) \ No newline at end of file +- [P3349R1 Converting contiguous iterators to pointers](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3349r1.html) diff --git a/reference/iterator/iter_common_reference_t.md b/reference/iterator/iter_common_reference_t.md index 5dec264b96..140d2698fb 100644 --- a/reference/iterator/iter_common_reference_t.md +++ b/reference/iterator/iter_common_reference_t.md @@ -53,4 +53,4 @@ int main() { ## 参照 -- [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) \ No newline at end of file +- [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/iterator/iter_reference_t.md b/reference/iterator/iter_reference_t.md index b84e065d20..15fc7f779d 100644 --- a/reference/iterator/iter_reference_t.md +++ b/reference/iterator/iter_reference_t.md @@ -51,4 +51,4 @@ int main() { ## 参照 -- [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) \ No newline at end of file +- [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/iterator/iter_rvalue_reference_t.md b/reference/iterator/iter_rvalue_reference_t.md index b45feb43b3..23349c1b0a 100644 --- a/reference/iterator/iter_rvalue_reference_t.md +++ b/reference/iterator/iter_rvalue_reference_t.md @@ -56,4 +56,4 @@ int main() { ## 参照 -- [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) \ No newline at end of file +- [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) diff --git a/reference/linalg/setup_givens_rotation_result.md b/reference/linalg/setup_givens_rotation_result.md index 9ed2ff37a8..262a17d96f 100644 --- a/reference/linalg/setup_givens_rotation_result.md +++ b/reference/linalg/setup_givens_rotation_result.md @@ -53,4 +53,4 @@ namespace std::linalg { ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) -- [Numerics library](https://eel.is/c++draft/complex.numbers) \ No newline at end of file +- [Numerics library](https://eel.is/c++draft/complex.numbers) diff --git a/reference/memory/enable_shared_from_this/op_constructor.md b/reference/memory/enable_shared_from_this/op_constructor.md index 8629bc188a..114cb916f3 100644 --- a/reference/memory/enable_shared_from_this/op_constructor.md +++ b/reference/memory/enable_shared_from_this/op_constructor.md @@ -32,4 +32,4 @@ enable_shared_from_this(const enable_shared_from_this&) noexcept; // (2) ## 参照 - [P0033R0 Re-enabling `shared_from_this`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0033r0.html) -- [P0033R1 Re-enabling `shared_from_this` (revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0033r1.html) \ No newline at end of file +- [P0033R1 Re-enabling `shared_from_this` (revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0033r1.html) diff --git a/reference/memory/enable_shared_from_this/op_destructor.md b/reference/memory/enable_shared_from_this/op_destructor.md index fccbc4431c..356c1f7f4a 100644 --- a/reference/memory/enable_shared_from_this/op_destructor.md +++ b/reference/memory/enable_shared_from_this/op_destructor.md @@ -25,4 +25,4 @@ ## 参照 - [P0033R0 Re-enabling `shared_from_this`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0033r0.html) -- [P0033R1 Re-enabling `shared_from_this` (revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0033r1.html) \ No newline at end of file +- [P0033R1 Re-enabling `shared_from_this` (revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0033r1.html) diff --git a/reference/memory_resource/get_default_resource.md b/reference/memory_resource/get_default_resource.md index 995fa4c14f..0f62da26a3 100644 --- a/reference/memory_resource/get_default_resource.md +++ b/reference/memory_resource/get_default_resource.md @@ -59,4 +59,4 @@ true - [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 関連項目 -- [`memory_resource`](memory_resource.md) \ No newline at end of file +- [`memory_resource`](memory_resource.md) diff --git a/reference/memory_resource/memory_resource/do_is_equal.md b/reference/memory_resource/memory_resource/do_is_equal.md index 5e03e2d00e..ea53b1978b 100644 --- a/reference/memory_resource/memory_resource/do_is_equal.md +++ b/reference/memory_resource/memory_resource/do_is_equal.md @@ -32,4 +32,4 @@ virtual bool do_is_equal(const memory_resource& other) const noexcept = 0; - [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 関連項目 -- [`is_equal`](is_equal.md) \ No newline at end of file +- [`is_equal`](is_equal.md) diff --git a/reference/memory_resource/memory_resource/is_equal.md b/reference/memory_resource/memory_resource/is_equal.md index 8452ba2207..4d32a3c3ba 100644 --- a/reference/memory_resource/memory_resource/is_equal.md +++ b/reference/memory_resource/memory_resource/is_equal.md @@ -57,4 +57,4 @@ false - [Visual C++](/implementation.md#visual_cpp): 2017 update 6 [mark verified] ## 関連項目 -- [`do_is_equal`](do_is_equal.md) \ No newline at end of file +- [`do_is_equal`](do_is_equal.md) diff --git a/reference/memory_resource/memory_resource/op_equal.md b/reference/memory_resource/memory_resource/op_equal.md index 109769eecb..abb76ee986 100644 --- a/reference/memory_resource/memory_resource/op_equal.md +++ b/reference/memory_resource/memory_resource/op_equal.md @@ -65,4 +65,4 @@ false ## 関連項目 - [`is_equal`](is_equal.md) -- [`op_not_equal`](op_not_equal.md) \ No newline at end of file +- [`op_not_equal`](op_not_equal.md) diff --git a/reference/memory_resource/monotonic_buffer_resource/op_destructor.md b/reference/memory_resource/monotonic_buffer_resource/op_destructor.md index 7a4829db8f..0c938d8d6f 100644 --- a/reference/memory_resource/monotonic_buffer_resource/op_destructor.md +++ b/reference/memory_resource/monotonic_buffer_resource/op_destructor.md @@ -32,4 +32,4 @@ virtual ~monotonic_buffer_resource(); ## 参照 - [P0220R1 Adopt Library Fundamentals V1 TS Components for C++17 (R1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0220r1.html) - [P0337r0 | Delete operator= for polymorphic_allocator](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0337r0.html) -- [Working Draft, C++ Extensions for Library Fundamentals, Version 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4562.html#memory.resource.synop) \ No newline at end of file +- [Working Draft, C++ Extensions for Library Fundamentals, Version 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4562.html#memory.resource.synop) diff --git a/reference/memory_resource/monotonic_buffer_resource/release.md b/reference/memory_resource/monotonic_buffer_resource/release.md index 1591e9caeb..9398837c41 100644 --- a/reference/memory_resource/monotonic_buffer_resource/release.md +++ b/reference/memory_resource/monotonic_buffer_resource/release.md @@ -62,4 +62,4 @@ int main() { ## 参照 - [P0220R1 Adopt Library Fundamentals V1 TS Components for C++17 (R1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0220r1.html) - [P0337r0 | Delete operator= for polymorphic_allocator](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0337r0.html) -- [Working Draft, C++ Extensions for Library Fundamentals, Version 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4562.html#memory.resource.synop) \ No newline at end of file +- [Working Draft, C++ Extensions for Library Fundamentals, Version 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4562.html#memory.resource.synop) diff --git a/reference/memory_resource/monotonic_buffer_resource/upstream_resource.md b/reference/memory_resource/monotonic_buffer_resource/upstream_resource.md index 606b0e728b..946be15198 100644 --- a/reference/memory_resource/monotonic_buffer_resource/upstream_resource.md +++ b/reference/memory_resource/monotonic_buffer_resource/upstream_resource.md @@ -53,4 +53,4 @@ true ## 参照 - [P0220R1 Adopt Library Fundamentals V1 TS Components for C++17 (R1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0220r1.html) - [P0337r0 | Delete operator= for polymorphic_allocator](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0337r0.html) -- [Working Draft, C++ Extensions for Library Fundamentals, Version 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4562.html#memory.resource.synop) \ No newline at end of file +- [Working Draft, C++ Extensions for Library Fundamentals, Version 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4562.html#memory.resource.synop) diff --git a/reference/memory_resource/new_delete_resource.md b/reference/memory_resource/new_delete_resource.md index 44070eda85..bcdcc9f187 100644 --- a/reference/memory_resource/new_delete_resource.md +++ b/reference/memory_resource/new_delete_resource.md @@ -61,4 +61,4 @@ int main() ## 関連項目 - [`memory_resource`](memory_resource.md) - [`operator new`](/reference/new/op_new.md) -- [`operator delete`](/reference/new/op_delete.md) \ No newline at end of file +- [`operator delete`](/reference/new/op_delete.md) diff --git a/reference/memory_resource/polymorphic_allocator/op_constructor.md b/reference/memory_resource/polymorphic_allocator/op_constructor.md index 3d974e9ed3..e7493198f8 100644 --- a/reference/memory_resource/polymorphic_allocator/op_constructor.md +++ b/reference/memory_resource/polymorphic_allocator/op_constructor.md @@ -88,4 +88,4 @@ int main() { ## 参照 - [P0220R1 Adopt Library Fundamentals V1 TS Components for C++17 (R1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0220r1.html) - [P0337r0 | Delete operator= for polymorphic_allocator](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0337r0.html) -- [Working Draft, C++ Extensions for Library Fundamentals, Version 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4562.html#memory.resource.synop) \ No newline at end of file +- [Working Draft, C++ Extensions for Library Fundamentals, Version 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4562.html#memory.resource.synop) diff --git a/reference/memory_resource/polymorphic_allocator/op_equal.md b/reference/memory_resource/polymorphic_allocator/op_equal.md index ec93aa67c0..de145164eb 100644 --- a/reference/memory_resource/polymorphic_allocator/op_equal.md +++ b/reference/memory_resource/polymorphic_allocator/op_equal.md @@ -97,4 +97,4 @@ true ## 参照 -- [LWG Issue 3683. `operator==` for `polymorphic_allocator` cannot deduce template argument in common cases](https://cplusplus.github.io/LWG/issue3683) \ No newline at end of file +- [LWG Issue 3683. `operator==` for `polymorphic_allocator` cannot deduce template argument in common cases](https://cplusplus.github.io/LWG/issue3683) diff --git a/reference/memory_resource/polymorphic_allocator/resource.md b/reference/memory_resource/polymorphic_allocator/resource.md index 7352f24f93..997ca840f1 100644 --- a/reference/memory_resource/polymorphic_allocator/resource.md +++ b/reference/memory_resource/polymorphic_allocator/resource.md @@ -50,4 +50,4 @@ true ## 参照 - [P0220R1 Adopt Library Fundamentals V1 TS Components for C++17 (R1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0220r1.html) - [P0337r0 | Delete operator= for polymorphic_allocator](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0337r0.html) -- [Working Draft, C++ Extensions for Library Fundamentals, Version 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4562.html#memory.resource.synop) \ No newline at end of file +- [Working Draft, C++ Extensions for Library Fundamentals, Version 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4562.html#memory.resource.synop) diff --git a/reference/memory_resource/polymorphic_allocator/select_on_container_copy_construction.md b/reference/memory_resource/polymorphic_allocator/select_on_container_copy_construction.md index 03502a37a6..71dbaf895c 100644 --- a/reference/memory_resource/polymorphic_allocator/select_on_container_copy_construction.md +++ b/reference/memory_resource/polymorphic_allocator/select_on_container_copy_construction.md @@ -57,4 +57,4 @@ false ## 参照 - [P0220R1 Adopt Library Fundamentals V1 TS Components for C++17 (R1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0220r1.html) - [P0337r0 | Delete operator= for polymorphic_allocator](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0337r0.html) -- [Working Draft, C++ Extensions for Library Fundamentals, Version 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4562.html#memory.resource.synop) \ No newline at end of file +- [Working Draft, C++ Extensions for Library Fundamentals, Version 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4562.html#memory.resource.synop) diff --git a/reference/memory_resource/pool_resource/op_destructor.md b/reference/memory_resource/pool_resource/op_destructor.md index 80c701940e..f46285c8b5 100644 --- a/reference/memory_resource/pool_resource/op_destructor.md +++ b/reference/memory_resource/pool_resource/op_destructor.md @@ -34,4 +34,4 @@ virtual ~pool_resource(); ## 参照 - [P0220R1 Adopt Library Fundamentals V1 TS Components for C++17 (R1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0220r1.html) - [P0337r0 | Delete operator= for polymorphic_allocator](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0337r0.html) -- [Working Draft, C++ Extensions for Library Fundamentals, Version 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4562.html#memory.resource.synop) \ No newline at end of file +- [Working Draft, C++ Extensions for Library Fundamentals, Version 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4562.html#memory.resource.synop) diff --git a/reference/memory_resource/pool_resource/release.md b/reference/memory_resource/pool_resource/release.md index 082d31a23c..9f6e5cc8d4 100644 --- a/reference/memory_resource/pool_resource/release.md +++ b/reference/memory_resource/pool_resource/release.md @@ -61,4 +61,4 @@ int main() { ## 参照 - [P0220R1 Adopt Library Fundamentals V1 TS Components for C++17 (R1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0220r1.html) - [P0337r0 | Delete operator= for polymorphic_allocator](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0337r0.html) -- [Working Draft, C++ Extensions for Library Fundamentals, Version 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4562.html#memory.resource.synop) \ No newline at end of file +- [Working Draft, C++ Extensions for Library Fundamentals, Version 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4562.html#memory.resource.synop) diff --git a/reference/random/bernoulli_distribution/op_constructor.md b/reference/random/bernoulli_distribution/op_constructor.md index f7e8673f19..2ae007dad2 100644 --- a/reference/random/bernoulli_distribution/op_constructor.md +++ b/reference/random/bernoulli_distribution/op_constructor.md @@ -103,4 +103,4 @@ true ## 参照 -- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) \ No newline at end of file +- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) diff --git a/reference/random/binomial_distribution/op_constructor.md b/reference/random/binomial_distribution/op_constructor.md index c2fcf99dbd..9467f1d85a 100644 --- a/reference/random/binomial_distribution/op_constructor.md +++ b/reference/random/binomial_distribution/op_constructor.md @@ -81,4 +81,4 @@ int main() ## 参照 -- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) \ No newline at end of file +- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) diff --git a/reference/random/cauchy_distribution/op_constructor.md b/reference/random/cauchy_distribution/op_constructor.md index 92deedd227..6d1c3892aa 100644 --- a/reference/random/cauchy_distribution/op_constructor.md +++ b/reference/random/cauchy_distribution/op_constructor.md @@ -103,4 +103,4 @@ int main() ## 参照 -- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) \ No newline at end of file +- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) diff --git a/reference/random/chi_squared_distribution/op_constructor.md b/reference/random/chi_squared_distribution/op_constructor.md index f6b9664fb2..f81dbe44c6 100644 --- a/reference/random/chi_squared_distribution/op_constructor.md +++ b/reference/random/chi_squared_distribution/op_constructor.md @@ -102,4 +102,4 @@ int main() ## 参照 -- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) \ No newline at end of file +- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) diff --git a/reference/random/exponential_distribution/op_constructor.md b/reference/random/exponential_distribution/op_constructor.md index 9c8745954c..8c89345cef 100644 --- a/reference/random/exponential_distribution/op_constructor.md +++ b/reference/random/exponential_distribution/op_constructor.md @@ -80,4 +80,4 @@ int main() ## 参照 -- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) \ No newline at end of file +- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) diff --git a/reference/random/extreme_value_distribution/op_constructor.md b/reference/random/extreme_value_distribution/op_constructor.md index 8d31c0c2aa..e53b0f53e1 100644 --- a/reference/random/extreme_value_distribution/op_constructor.md +++ b/reference/random/extreme_value_distribution/op_constructor.md @@ -101,4 +101,4 @@ int main() ## 参照 -- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) \ No newline at end of file +- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) diff --git a/reference/random/fisher_f_distribution/op_constructor.md b/reference/random/fisher_f_distribution/op_constructor.md index c6b93b75ad..ebb5ddeaed 100644 --- a/reference/random/fisher_f_distribution/op_constructor.md +++ b/reference/random/fisher_f_distribution/op_constructor.md @@ -103,4 +103,4 @@ int main() ## 参照 -- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) \ No newline at end of file +- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) diff --git a/reference/random/gamma_distribution/op_constructor.md b/reference/random/gamma_distribution/op_constructor.md index 70ea1c2aa1..4adec7d13d 100644 --- a/reference/random/gamma_distribution/op_constructor.md +++ b/reference/random/gamma_distribution/op_constructor.md @@ -82,4 +82,4 @@ int main() ## 参照 -- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) \ No newline at end of file +- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) diff --git a/reference/random/geometric_distribution/op_constructor.md b/reference/random/geometric_distribution/op_constructor.md index 7cfcc47ba0..0b1a0dac9d 100644 --- a/reference/random/geometric_distribution/op_constructor.md +++ b/reference/random/geometric_distribution/op_constructor.md @@ -81,4 +81,4 @@ int main() ## 参照 -- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) \ No newline at end of file +- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) diff --git a/reference/random/linear_congruential_engine/op_constructor.md b/reference/random/linear_congruential_engine/op_constructor.md index 6aaec9c7a9..5390772508 100644 --- a/reference/random/linear_congruential_engine/op_constructor.md +++ b/reference/random/linear_congruential_engine/op_constructor.md @@ -102,4 +102,4 @@ int main() ## 参照 -- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) \ No newline at end of file +- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) diff --git a/reference/random/lognormal_distribution/op_constructor.md b/reference/random/lognormal_distribution/op_constructor.md index 99e650aaad..00bef3583a 100644 --- a/reference/random/lognormal_distribution/op_constructor.md +++ b/reference/random/lognormal_distribution/op_constructor.md @@ -103,4 +103,4 @@ int main() ## 参照 -- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) \ No newline at end of file +- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) diff --git a/reference/random/mersenne_twister_engine/op_constructor.md b/reference/random/mersenne_twister_engine/op_constructor.md index 7759752741..065b57f1f6 100644 --- a/reference/random/mersenne_twister_engine/op_constructor.md +++ b/reference/random/mersenne_twister_engine/op_constructor.md @@ -104,4 +104,4 @@ int main() ## 参照 -- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) \ No newline at end of file +- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) diff --git a/reference/random/negative_binomial_distribution/op_constructor.md b/reference/random/negative_binomial_distribution/op_constructor.md index d1dfca1531..9ca678e772 100644 --- a/reference/random/negative_binomial_distribution/op_constructor.md +++ b/reference/random/negative_binomial_distribution/op_constructor.md @@ -81,4 +81,4 @@ int main() ## 参照 -- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) \ No newline at end of file +- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) diff --git a/reference/random/normal_distribution/op_constructor.md b/reference/random/normal_distribution/op_constructor.md index 4a1260d992..88ed206e06 100644 --- a/reference/random/normal_distribution/op_constructor.md +++ b/reference/random/normal_distribution/op_constructor.md @@ -103,4 +103,4 @@ int main() ## 参照 -- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) \ No newline at end of file +- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) diff --git a/reference/random/poisson_distribution/op_constructor.md b/reference/random/poisson_distribution/op_constructor.md index d6b9445702..4ee93a1493 100644 --- a/reference/random/poisson_distribution/op_constructor.md +++ b/reference/random/poisson_distribution/op_constructor.md @@ -82,4 +82,4 @@ int main() ## 参照 -- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) \ No newline at end of file +- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) diff --git a/reference/random/random_device/op_constructor.md b/reference/random/random_device/op_constructor.md index f4efdfc36c..3116bbacf7 100644 --- a/reference/random/random_device/op_constructor.md +++ b/reference/random/random_device/op_constructor.md @@ -77,4 +77,4 @@ int main() ## 参照 -- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) \ No newline at end of file +- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) diff --git a/reference/random/student_t_distribution/op_constructor.md b/reference/random/student_t_distribution/op_constructor.md index c1962c39c4..387fbf4eb5 100644 --- a/reference/random/student_t_distribution/op_constructor.md +++ b/reference/random/student_t_distribution/op_constructor.md @@ -103,4 +103,4 @@ int main() ## 参照 -- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) \ No newline at end of file +- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) diff --git a/reference/random/uniform_int_distribution/op_constructor.md b/reference/random/uniform_int_distribution/op_constructor.md index c157377118..857ab82286 100644 --- a/reference/random/uniform_int_distribution/op_constructor.md +++ b/reference/random/uniform_int_distribution/op_constructor.md @@ -86,4 +86,4 @@ int main() ## 参照 -- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) \ No newline at end of file +- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) diff --git a/reference/random/weibull_distribution/op_constructor.md b/reference/random/weibull_distribution/op_constructor.md index 064cc65073..19cf0e5067 100644 --- a/reference/random/weibull_distribution/op_constructor.md +++ b/reference/random/weibull_distribution/op_constructor.md @@ -101,4 +101,4 @@ int main() ## 参照 -- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) \ No newline at end of file +- [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) diff --git a/reference/ranges/adjacent_transform_view/base.md b/reference/ranges/adjacent_transform_view/base.md index 27640b2f6f..543e60fa5e 100644 --- a/reference/ranges/adjacent_transform_view/base.md +++ b/reference/ranges/adjacent_transform_view/base.md @@ -68,4 +68,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] ## 参照 -- [N4950 26.7.28 Adjacent transform view](https://timsong-cpp.github.io/cppwp/n4950/range.adjacent.transform) \ No newline at end of file +- [N4950 26.7.28 Adjacent transform view](https://timsong-cpp.github.io/cppwp/n4950/range.adjacent.transform) diff --git a/reference/ranges/adjacent_transform_view/begin.md b/reference/ranges/adjacent_transform_view/begin.md index 0b1e5550bd..7ea8eddaad 100644 --- a/reference/ranges/adjacent_transform_view/begin.md +++ b/reference/ranges/adjacent_transform_view/begin.md @@ -69,4 +69,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] ## 参照 -- [N4950 26.7.28 Adjacent transform view](https://timsong-cpp.github.io/cppwp/n4950/range.adjacent.transform) \ No newline at end of file +- [N4950 26.7.28 Adjacent transform view](https://timsong-cpp.github.io/cppwp/n4950/range.adjacent.transform) diff --git a/reference/ranges/adjacent_transform_view/end.md b/reference/ranges/adjacent_transform_view/end.md index 259037cc1f..276557d8b6 100644 --- a/reference/ranges/adjacent_transform_view/end.md +++ b/reference/ranges/adjacent_transform_view/end.md @@ -76,4 +76,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] ## 参照 -- [N4950 26.7.28 Adjacent transform view](https://timsong-cpp.github.io/cppwp/n4950/range.adjacent.transform) \ No newline at end of file +- [N4950 26.7.28 Adjacent transform view](https://timsong-cpp.github.io/cppwp/n4950/range.adjacent.transform) diff --git a/reference/ranges/adjacent_transform_view/op_constructor.md b/reference/ranges/adjacent_transform_view/op_constructor.md index a3c26db745..f5b8d2f420 100644 --- a/reference/ranges/adjacent_transform_view/op_constructor.md +++ b/reference/ranges/adjacent_transform_view/op_constructor.md @@ -65,4 +65,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] ## 参照 -- [N4950 26.7.28 Adjacent transform view](https://timsong-cpp.github.io/cppwp/n4950/range.adjacent.transform) \ No newline at end of file +- [N4950 26.7.28 Adjacent transform view](https://timsong-cpp.github.io/cppwp/n4950/range.adjacent.transform) diff --git a/reference/ranges/adjacent_transform_view/size.md b/reference/ranges/adjacent_transform_view/size.md index 13007293b6..05a62d58e5 100644 --- a/reference/ranges/adjacent_transform_view/size.md +++ b/reference/ranges/adjacent_transform_view/size.md @@ -69,4 +69,4 @@ const size: 4 - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 -- [N4950 26.7.28 Adjacent transform view](https://timsong-cpp.github.io/cppwp/n4950/range.adjacent.transform) \ No newline at end of file +- [N4950 26.7.28 Adjacent transform view](https://timsong-cpp.github.io/cppwp/n4950/range.adjacent.transform) diff --git a/reference/ranges/adjacent_view/base.md b/reference/ranges/adjacent_view/base.md index 117b9bfc5c..6788e004e2 100644 --- a/reference/ranges/adjacent_view/base.md +++ b/reference/ranges/adjacent_view/base.md @@ -65,4 +65,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] ## 参照 -- [N4950 26.7.27 Adjacent view](https://timsong-cpp.github.io/cppwp/n4950/range.adjacent) \ No newline at end of file +- [N4950 26.7.27 Adjacent view](https://timsong-cpp.github.io/cppwp/n4950/range.adjacent) diff --git a/reference/ranges/adjacent_view/begin.md b/reference/ranges/adjacent_view/begin.md index c0c6951b3e..b40ed38966 100644 --- a/reference/ranges/adjacent_view/begin.md +++ b/reference/ranges/adjacent_view/begin.md @@ -65,4 +65,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] ## 参照 -- [N4950 26.7.27 Adjacent view](https://timsong-cpp.github.io/cppwp/n4950/range.adjacent) \ No newline at end of file +- [N4950 26.7.27 Adjacent view](https://timsong-cpp.github.io/cppwp/n4950/range.adjacent) diff --git a/reference/ranges/adjacent_view/end.md b/reference/ranges/adjacent_view/end.md index 7fca485b2e..5d22cbaaeb 100644 --- a/reference/ranges/adjacent_view/end.md +++ b/reference/ranges/adjacent_view/end.md @@ -72,4 +72,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] ## 参照 -- [N4950 26.7.27 Adjacent view](https://timsong-cpp.github.io/cppwp/n4950/range.adjacent) \ No newline at end of file +- [N4950 26.7.27 Adjacent view](https://timsong-cpp.github.io/cppwp/n4950/range.adjacent) diff --git a/reference/ranges/adjacent_view/op_constructor.md b/reference/ranges/adjacent_view/op_constructor.md index d198413457..9892ff8446 100644 --- a/reference/ranges/adjacent_view/op_constructor.md +++ b/reference/ranges/adjacent_view/op_constructor.md @@ -61,4 +61,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] ## 参照 -- [N4950 26.7.27 Adjacent view](https://timsong-cpp.github.io/cppwp/n4950/range.adjacent) \ No newline at end of file +- [N4950 26.7.27 Adjacent view](https://timsong-cpp.github.io/cppwp/n4950/range.adjacent) diff --git a/reference/ranges/adjacent_view/size.md b/reference/ranges/adjacent_view/size.md index afd9c8ae88..2d6475bdf9 100644 --- a/reference/ranges/adjacent_view/size.md +++ b/reference/ranges/adjacent_view/size.md @@ -70,4 +70,4 @@ small range size: 0 - [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] ## 参照 -- [N4950 26.7.27 Adjacent view](https://timsong-cpp.github.io/cppwp/n4950/range.adjacent) \ No newline at end of file +- [N4950 26.7.27 Adjacent view](https://timsong-cpp.github.io/cppwp/n4950/range.adjacent) diff --git a/reference/ranges/cartesian_product_view/begin.md b/reference/ranges/cartesian_product_view/begin.md index dffa7b6b5d..8b213caba5 100644 --- a/reference/ranges/cartesian_product_view/begin.md +++ b/reference/ranges/cartesian_product_view/begin.md @@ -62,4 +62,4 @@ first element: (1, 'a') - [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] ## 参照 -- [N4950 26.7.33 Cartesian product view](https://timsong-cpp.github.io/cppwp/n4950/range.cartesian) \ No newline at end of file +- [N4950 26.7.33 Cartesian product view](https://timsong-cpp.github.io/cppwp/n4950/range.cartesian) diff --git a/reference/ranges/cartesian_product_view/end.md b/reference/ranges/cartesian_product_view/end.md index 795d4996dd..cac4608a7a 100644 --- a/reference/ranges/cartesian_product_view/end.md +++ b/reference/ranges/cartesian_product_view/end.md @@ -80,4 +80,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] ## 参照 -- [N4950 26.7.33 Cartesian product view](https://timsong-cpp.github.io/cppwp/n4950/range.cartesian) \ No newline at end of file +- [N4950 26.7.33 Cartesian product view](https://timsong-cpp.github.io/cppwp/n4950/range.cartesian) diff --git a/reference/ranges/cartesian_product_view/op_constructor.md b/reference/ranges/cartesian_product_view/op_constructor.md index 0660cbce25..0753b10aa5 100644 --- a/reference/ranges/cartesian_product_view/op_constructor.md +++ b/reference/ranges/cartesian_product_view/op_constructor.md @@ -63,4 +63,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] ## 参照 -- [N4950 26.7.33 Cartesian product view](https://timsong-cpp.github.io/cppwp/n4950/range.cartesian) \ No newline at end of file +- [N4950 26.7.33 Cartesian product view](https://timsong-cpp.github.io/cppwp/n4950/range.cartesian) diff --git a/reference/ranges/cartesian_product_view/size.md b/reference/ranges/cartesian_product_view/size.md index 647f006cc0..b8d241ed0c 100644 --- a/reference/ranges/cartesian_product_view/size.md +++ b/reference/ranges/cartesian_product_view/size.md @@ -71,4 +71,4 @@ cartesian product size: 6 - [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] ## 参照 -- [N4950 26.7.33 Cartesian product view](https://timsong-cpp.github.io/cppwp/n4950/range.cartesian) \ No newline at end of file +- [N4950 26.7.33 Cartesian product view](https://timsong-cpp.github.io/cppwp/n4950/range.cartesian) diff --git a/reference/ranges/chunk_by_view/base.md b/reference/ranges/chunk_by_view/base.md index eed7407c31..49bc804816 100644 --- a/reference/ranges/chunk_by_view/base.md +++ b/reference/ranges/chunk_by_view/base.md @@ -58,4 +58,4 @@ moved base size: 8 - [Visual C++](/implementation.md#visual_cpp): 2022 Update 3 [mark verified] ## 参照 -- [N4950 26.7.30 Chunk by view](https://timsong-cpp.github.io/cppwp/n4950/range.chunk.by) \ No newline at end of file +- [N4950 26.7.30 Chunk by view](https://timsong-cpp.github.io/cppwp/n4950/range.chunk.by) diff --git a/reference/ranges/chunk_by_view/begin.md b/reference/ranges/chunk_by_view/begin.md index 9102a0fa65..75ab24852e 100644 --- a/reference/ranges/chunk_by_view/begin.md +++ b/reference/ranges/chunk_by_view/begin.md @@ -60,4 +60,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2022 Update 3 [mark verified] ## 参照 -- [N4950 26.7.30 Chunk by view](https://timsong-cpp.github.io/cppwp/n4950/range.chunk.by) \ No newline at end of file +- [N4950 26.7.30 Chunk by view](https://timsong-cpp.github.io/cppwp/n4950/range.chunk.by) diff --git a/reference/ranges/chunk_by_view/end.md b/reference/ranges/chunk_by_view/end.md index 193d1699bd..c50015cacc 100644 --- a/reference/ranges/chunk_by_view/end.md +++ b/reference/ranges/chunk_by_view/end.md @@ -59,4 +59,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2022 Update 3 [mark verified] ## 参照 -- [N4950 26.7.30 Chunk by view](https://timsong-cpp.github.io/cppwp/n4950/range.chunk.by) \ No newline at end of file +- [N4950 26.7.30 Chunk by view](https://timsong-cpp.github.io/cppwp/n4950/range.chunk.by) diff --git a/reference/ranges/chunk_by_view/op_constructor.md b/reference/ranges/chunk_by_view/op_constructor.md index ef69362fc9..f59ed25b88 100644 --- a/reference/ranges/chunk_by_view/op_constructor.md +++ b/reference/ranges/chunk_by_view/op_constructor.md @@ -64,4 +64,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2022 Update 3 [mark verified] ## 参照 -- [N4950 26.7.30 Chunk by view](https://timsong-cpp.github.io/cppwp/n4950/range.chunk.by) \ No newline at end of file +- [N4950 26.7.30 Chunk by view](https://timsong-cpp.github.io/cppwp/n4950/range.chunk.by) diff --git a/reference/ranges/chunk_by_view/pred.md b/reference/ranges/chunk_by_view/pred.md index e68b955fc1..90c3c6987f 100644 --- a/reference/ranges/chunk_by_view/pred.md +++ b/reference/ranges/chunk_by_view/pred.md @@ -55,4 +55,4 @@ predicate(3, 0): 0 - [Visual C++](/implementation.md#visual_cpp): 2022 Update 3 [mark verified] ## 参照 -- [N4950 26.7.30 Chunk by view](https://timsong-cpp.github.io/cppwp/n4950/range.chunk.by) \ No newline at end of file +- [N4950 26.7.30 Chunk by view](https://timsong-cpp.github.io/cppwp/n4950/range.chunk.by) diff --git a/reference/ranges/chunk_view/base.md b/reference/ranges/chunk_view/base.md index 2455cc23a1..e6ff46e7dc 100644 --- a/reference/ranges/chunk_view/base.md +++ b/reference/ranges/chunk_view/base.md @@ -59,4 +59,4 @@ moved base size: 6 - [Visual C++](/implementation.md#visual_cpp): 2022 Update 3 [mark verified] ## 参照 -- [N4950 26.7.29 Chunk view](https://timsong-cpp.github.io/cppwp/n4950/range.chunk) \ No newline at end of file +- [N4950 26.7.29 Chunk view](https://timsong-cpp.github.io/cppwp/n4950/range.chunk) diff --git a/reference/ranges/chunk_view/begin.md b/reference/ranges/chunk_view/begin.md index 5c4f2ccaf9..44e414ad9a 100644 --- a/reference/ranges/chunk_view/begin.md +++ b/reference/ranges/chunk_view/begin.md @@ -73,4 +73,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2022 Update 3 [mark verified] ## 参照 -- [N4950 26.7.29 Chunk view](https://timsong-cpp.github.io/cppwp/n4950/range.chunk) \ No newline at end of file +- [N4950 26.7.29 Chunk view](https://timsong-cpp.github.io/cppwp/n4950/range.chunk) diff --git a/reference/ranges/chunk_view/end.md b/reference/ranges/chunk_view/end.md index c92444c25f..5c9264a64f 100644 --- a/reference/ranges/chunk_view/end.md +++ b/reference/ranges/chunk_view/end.md @@ -76,4 +76,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2022 Update 3 [mark verified] ## 参照 -- [N4950 26.7.29 Chunk view](https://timsong-cpp.github.io/cppwp/n4950/range.chunk) \ No newline at end of file +- [N4950 26.7.29 Chunk view](https://timsong-cpp.github.io/cppwp/n4950/range.chunk) diff --git a/reference/ranges/chunk_view/op_constructor.md b/reference/ranges/chunk_view/op_constructor.md index 5a139fa237..3c890acbc9 100644 --- a/reference/ranges/chunk_view/op_constructor.md +++ b/reference/ranges/chunk_view/op_constructor.md @@ -66,4 +66,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2022 Update 3 [mark verified] ## 参照 -- [N4950 26.7.29 Chunk view](https://timsong-cpp.github.io/cppwp/n4950/range.chunk) \ No newline at end of file +- [N4950 26.7.29 Chunk view](https://timsong-cpp.github.io/cppwp/n4950/range.chunk) diff --git a/reference/ranges/chunk_view/size.md b/reference/ranges/chunk_view/size.md index 898378f1df..5de4c0d093 100644 --- a/reference/ranges/chunk_view/size.md +++ b/reference/ranges/chunk_view/size.md @@ -67,4 +67,4 @@ chunk_view(8 elements, chunk size 5): 2 chunks - [Visual C++](/implementation.md#visual_cpp): 2022 Update 3 [mark verified] ## 参照 -- [N4950 26.7.29 Chunk view](https://timsong-cpp.github.io/cppwp/n4950/range.chunk) \ No newline at end of file +- [N4950 26.7.29 Chunk view](https://timsong-cpp.github.io/cppwp/n4950/range.chunk) diff --git a/reference/ranges/common_view/base.md b/reference/ranges/common_view/base.md index 77fdadea67..bbd651c79c 100644 --- a/reference/ranges/common_view/base.md +++ b/reference/ranges/common_view/base.md @@ -70,4 +70,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 -- [N4861 24.7.5.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.common.view) \ No newline at end of file +- [N4861 24.7.5.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.common.view) diff --git a/reference/ranges/common_view/begin.md b/reference/ranges/common_view/begin.md index 38b5d0d52c..0cd45f4966 100644 --- a/reference/ranges/common_view/begin.md +++ b/reference/ranges/common_view/begin.md @@ -84,4 +84,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 -- [N4861 24.7.5.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.common.view) \ No newline at end of file +- [N4861 24.7.5.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.common.view) diff --git a/reference/ranges/common_view/end.md b/reference/ranges/common_view/end.md index 9e6002c46f..fd0432e745 100644 --- a/reference/ranges/common_view/end.md +++ b/reference/ranges/common_view/end.md @@ -83,4 +83,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 -- [N4861 24.7.5.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.common.view) \ No newline at end of file +- [N4861 24.7.5.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.common.view) diff --git a/reference/ranges/common_view/op_constructor.md b/reference/ranges/common_view/op_constructor.md index bec4546ac4..1d469d14b7 100644 --- a/reference/ranges/common_view/op_constructor.md +++ b/reference/ranges/common_view/op_constructor.md @@ -65,4 +65,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 -- [N4861 24.7.5.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.common.view) \ No newline at end of file +- [N4861 24.7.5.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.common.view) diff --git a/reference/ranges/common_view/op_deduction_guide.md b/reference/ranges/common_view/op_deduction_guide.md index b252ab63b6..c97b4a09c6 100644 --- a/reference/ranges/common_view/op_deduction_guide.md +++ b/reference/ranges/common_view/op_deduction_guide.md @@ -57,4 +57,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 関連項目 -- [`views::all`](../all.md) \ No newline at end of file +- [`views::all`](../all.md) diff --git a/reference/ranges/common_view/size.md b/reference/ranges/common_view/size.md index 77b4a73fa7..662faf840d 100644 --- a/reference/ranges/common_view/size.md +++ b/reference/ranges/common_view/size.md @@ -67,4 +67,4 @@ const size: 3 - [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 -- [N4861 24.7.5.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.common.view) \ No newline at end of file +- [N4861 24.7.5.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.common.view) diff --git a/reference/ranges/drop_view/base.md b/reference/ranges/drop_view/base.md index 933c36b6e9..241536fc7d 100644 --- a/reference/ranges/drop_view/base.md +++ b/reference/ranges/drop_view/base.md @@ -64,4 +64,4 @@ int main() { - [Clang](/implementation.md#clang): 13.0.0 [mark verified] - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/drop_view/begin.md b/reference/ranges/drop_view/begin.md index 0fe7e7feae..d3076e0508 100644 --- a/reference/ranges/drop_view/begin.md +++ b/reference/ranges/drop_view/begin.md @@ -67,4 +67,4 @@ int main() { - [Clang](/implementation.md#clang): 13.0.0 [mark verified] - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/drop_view/end.md b/reference/ranges/drop_view/end.md index 8a7872dda4..83eec5ea17 100644 --- a/reference/ranges/drop_view/end.md +++ b/reference/ranges/drop_view/end.md @@ -63,4 +63,4 @@ int main() { - [Clang](/implementation.md#clang): 13.0.0 [mark verified] - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/drop_view/op_constructor.md b/reference/ranges/drop_view/op_constructor.md index 7785416756..64244be72b 100644 --- a/reference/ranges/drop_view/op_constructor.md +++ b/reference/ranges/drop_view/op_constructor.md @@ -56,4 +56,4 @@ int main() { - [Clang](/implementation.md#clang): 13.0.0 [mark verified] - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/drop_view/op_deduction_guide.md b/reference/ranges/drop_view/op_deduction_guide.md index acbe9b2d02..a0efac6c64 100644 --- a/reference/ranges/drop_view/op_deduction_guide.md +++ b/reference/ranges/drop_view/op_deduction_guide.md @@ -53,4 +53,4 @@ int main() { - [Clang](/implementation.md#clang): 13.0.0 [mark verified] - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/drop_view/size.md b/reference/ranges/drop_view/size.md index 5860f5afd1..6de71accb5 100644 --- a/reference/ranges/drop_view/size.md +++ b/reference/ranges/drop_view/size.md @@ -56,4 +56,4 @@ int main() { - [Clang](/implementation.md#clang): 13.0.0 [mark verified] - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/drop_while_view/base.md b/reference/ranges/drop_while_view/base.md index 66dcfca3be..df60bdd8a7 100644 --- a/reference/ranges/drop_while_view/base.md +++ b/reference/ranges/drop_while_view/base.md @@ -64,4 +64,4 @@ int main() { - [Clang](/implementation.md#clang): 13.0.0 [mark verified] - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/drop_while_view/begin.md b/reference/ranges/drop_while_view/begin.md index d346ddcade..85282b277a 100644 --- a/reference/ranges/drop_while_view/begin.md +++ b/reference/ranges/drop_while_view/begin.md @@ -65,4 +65,4 @@ int main() { - [Clang](/implementation.md#clang): 13.0.0 [mark verified] - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/drop_while_view/end.md b/reference/ranges/drop_while_view/end.md index 4866fcacc4..1d7595a050 100644 --- a/reference/ranges/drop_while_view/end.md +++ b/reference/ranges/drop_while_view/end.md @@ -67,4 +67,4 @@ int main() { - [Clang](/implementation.md#clang): 13.0.0 [mark verified] - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/drop_while_view/op_constructor.md b/reference/ranges/drop_while_view/op_constructor.md index 9e06d2d067..d8209ea6a2 100644 --- a/reference/ranges/drop_while_view/op_constructor.md +++ b/reference/ranges/drop_while_view/op_constructor.md @@ -57,4 +57,4 @@ int main() { - [Clang](/implementation.md#clang): 13.0.0 [mark verified] - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/drop_while_view/op_deduction_guide.md b/reference/ranges/drop_while_view/op_deduction_guide.md index f46fc8a1b8..3ae81bdb1c 100644 --- a/reference/ranges/drop_while_view/op_deduction_guide.md +++ b/reference/ranges/drop_while_view/op_deduction_guide.md @@ -54,4 +54,4 @@ int main() { - [Clang](/implementation.md#clang): 13.0.0 [mark verified] - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/drop_while_view/pred.md b/reference/ranges/drop_while_view/pred.md index 3c864b1108..6fe0ed4fe5 100644 --- a/reference/ranges/drop_while_view/pred.md +++ b/reference/ranges/drop_while_view/pred.md @@ -55,4 +55,4 @@ int main() { - [Clang](/implementation.md#clang): 13.0.0 [mark verified] - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/elements_view/base.md b/reference/ranges/elements_view/base.md index 59772d0770..227bf33804 100644 --- a/reference/ranges/elements_view/base.md +++ b/reference/ranges/elements_view/base.md @@ -68,4 +68,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 -- [N4861 24.7.21.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.elements.view) \ No newline at end of file +- [N4861 24.7.21.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.elements.view) diff --git a/reference/ranges/elements_view/begin.md b/reference/ranges/elements_view/begin.md index fffa498577..b5410191f0 100644 --- a/reference/ranges/elements_view/begin.md +++ b/reference/ranges/elements_view/begin.md @@ -67,4 +67,4 @@ one - [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 -- [N4861 24.7.21.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.elements.view) \ No newline at end of file +- [N4861 24.7.21.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.elements.view) diff --git a/reference/ranges/elements_view/end.md b/reference/ranges/elements_view/end.md index 4e6fc0f415..60535a054c 100644 --- a/reference/ranges/elements_view/end.md +++ b/reference/ranges/elements_view/end.md @@ -80,4 +80,4 @@ one two three - [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 -- [N4861 24.7.21.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.elements.view) \ No newline at end of file +- [N4861 24.7.21.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.elements.view) diff --git a/reference/ranges/elements_view/op_constructor.md b/reference/ranges/elements_view/op_constructor.md index 2f53d40014..aaa1087d13 100644 --- a/reference/ranges/elements_view/op_constructor.md +++ b/reference/ranges/elements_view/op_constructor.md @@ -72,4 +72,4 @@ one two three - [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 -- [N4861 24.7.21.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.elements.view) \ No newline at end of file +- [N4861 24.7.21.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.elements.view) diff --git a/reference/ranges/elements_view/op_deduction_guide.md b/reference/ranges/elements_view/op_deduction_guide.md index 0c10444d53..8c3897b562 100644 --- a/reference/ranges/elements_view/op_deduction_guide.md +++ b/reference/ranges/elements_view/op_deduction_guide.md @@ -70,4 +70,4 @@ int main() { - [`views::all`](../all.md) ## 参照 -- [P2367R0 Remove misuses of list-initialization in Clause 24](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2367r0.html) \ No newline at end of file +- [P2367R0 Remove misuses of list-initialization in Clause 24](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2367r0.html) diff --git a/reference/ranges/elements_view/size.md b/reference/ranges/elements_view/size.md index 16cabefdf9..0bb8c7122e 100644 --- a/reference/ranges/elements_view/size.md +++ b/reference/ranges/elements_view/size.md @@ -65,4 +65,4 @@ const keys size: 3 - [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 -- [N4861 24.7.21.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.elements.view) \ No newline at end of file +- [N4861 24.7.21.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.elements.view) diff --git a/reference/ranges/empty_view/enable_borrowed_range.md b/reference/ranges/empty_view/enable_borrowed_range.md index 8bee873d09..60a9916d7f 100644 --- a/reference/ranges/empty_view/enable_borrowed_range.md +++ b/reference/ranges/empty_view/enable_borrowed_range.md @@ -52,4 +52,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 -- [N4861 24.7.8 Empty view](https://timsong-cpp.github.io/cppwp/n4861/range.empty) \ No newline at end of file +- [N4861 24.7.8 Empty view](https://timsong-cpp.github.io/cppwp/n4861/range.empty) diff --git a/reference/ranges/enumerate_view/base.md b/reference/ranges/enumerate_view/base.md index f74a5b13b4..1b645977df 100644 --- a/reference/ranges/enumerate_view/base.md +++ b/reference/ranges/enumerate_view/base.md @@ -66,4 +66,4 @@ a b c - [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 -- [N4950 26.7.23 Enumerate view](https://timsong-cpp.github.io/cppwp/n4950/range.enumerate) \ No newline at end of file +- [N4950 26.7.23 Enumerate view](https://timsong-cpp.github.io/cppwp/n4950/range.enumerate) diff --git a/reference/ranges/enumerate_view/begin.md b/reference/ranges/enumerate_view/begin.md index 0c8fcf02df..15fcf42829 100644 --- a/reference/ranges/enumerate_view/begin.md +++ b/reference/ranges/enumerate_view/begin.md @@ -65,4 +65,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] ## 参照 -- [N4950 26.7.23 Enumerate view](https://timsong-cpp.github.io/cppwp/n4950/range.enumerate) \ No newline at end of file +- [N4950 26.7.23 Enumerate view](https://timsong-cpp.github.io/cppwp/n4950/range.enumerate) diff --git a/reference/ranges/enumerate_view/end.md b/reference/ranges/enumerate_view/end.md index 8d4f32f71a..978540b069 100644 --- a/reference/ranges/enumerate_view/end.md +++ b/reference/ranges/enumerate_view/end.md @@ -72,4 +72,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] ## 参照 -- [N4950 26.7.23 Enumerate view](https://timsong-cpp.github.io/cppwp/n4950/range.enumerate) \ No newline at end of file +- [N4950 26.7.23 Enumerate view](https://timsong-cpp.github.io/cppwp/n4950/range.enumerate) diff --git a/reference/ranges/enumerate_view/op_constructor.md b/reference/ranges/enumerate_view/op_constructor.md index eeac2f3cbb..115a9c09ff 100644 --- a/reference/ranges/enumerate_view/op_constructor.md +++ b/reference/ranges/enumerate_view/op_constructor.md @@ -61,4 +61,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] ## 参照 -- [N4950 26.7.23 Enumerate view](https://timsong-cpp.github.io/cppwp/n4950/range.enumerate) \ No newline at end of file +- [N4950 26.7.23 Enumerate view](https://timsong-cpp.github.io/cppwp/n4950/range.enumerate) diff --git a/reference/ranges/enumerate_view/size.md b/reference/ranges/enumerate_view/size.md index 5d57af0da3..624ce0f96b 100644 --- a/reference/ranges/enumerate_view/size.md +++ b/reference/ranges/enumerate_view/size.md @@ -59,4 +59,4 @@ const size: 3 - [Visual C++](/implementation.md#visual_cpp): 2022 Update 7 [mark verified] ## 参照 -- [N4950 26.7.23 Enumerate view](https://timsong-cpp.github.io/cppwp/n4950/range.enumerate) \ No newline at end of file +- [N4950 26.7.23 Enumerate view](https://timsong-cpp.github.io/cppwp/n4950/range.enumerate) diff --git a/reference/ranges/join_view/base.md b/reference/ranges/join_view/base.md index 923fd03c68..d3b7a283e6 100644 --- a/reference/ranges/join_view/base.md +++ b/reference/ranges/join_view/base.md @@ -65,4 +65,4 @@ int main() { - [Clang](/implementation.md#clang): 13.0.0 [mark verified] - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/join_view/begin.md b/reference/ranges/join_view/begin.md index 7444fdef90..260ee82596 100644 --- a/reference/ranges/join_view/begin.md +++ b/reference/ranges/join_view/begin.md @@ -56,4 +56,4 @@ h - [Clang](/implementation.md#clang): 13.0.0 [mark verified] - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/join_view/end.md b/reference/ranges/join_view/end.md index f540b9003d..d3dbb0bc48 100644 --- a/reference/ranges/join_view/end.md +++ b/reference/ranges/join_view/end.md @@ -60,4 +60,4 @@ helloworldjoin - [Clang](/implementation.md#clang): 13.0.0 [mark verified] - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/join_view/op_constructor.md b/reference/ranges/join_view/op_constructor.md index 81f89d576b..20f73ddfac 100644 --- a/reference/ranges/join_view/op_constructor.md +++ b/reference/ranges/join_view/op_constructor.md @@ -56,4 +56,4 @@ helloworldjoin - [Clang](/implementation.md#clang): 13.0.0 [mark verified] - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/join_view/op_deduction_guide.md b/reference/ranges/join_view/op_deduction_guide.md index 5720d6c3f1..3be0fccd37 100644 --- a/reference/ranges/join_view/op_deduction_guide.md +++ b/reference/ranges/join_view/op_deduction_guide.md @@ -54,4 +54,4 @@ int main() { - [Clang](/implementation.md#clang): 13.0.0 [mark verified] - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/join_with_view/base.md b/reference/ranges/join_with_view/base.md index b1f4de3692..fccff4fc34 100644 --- a/reference/ranges/join_with_view/base.md +++ b/reference/ranges/join_with_view/base.md @@ -66,4 +66,4 @@ int main() { - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): 13.2 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ranges/join_with_view/begin.md b/reference/ranges/join_with_view/begin.md index 930cb18a02..5aea3a3dab 100644 --- a/reference/ranges/join_with_view/begin.md +++ b/reference/ranges/join_with_view/begin.md @@ -58,4 +58,4 @@ h - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): 13.2 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ranges/join_with_view/end.md b/reference/ranges/join_with_view/end.md index cc934046af..c1fc3ca13d 100644 --- a/reference/ranges/join_with_view/end.md +++ b/reference/ranges/join_with_view/end.md @@ -62,4 +62,4 @@ hello-world-join - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): 13.2 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ranges/join_with_view/op_constructor.md b/reference/ranges/join_with_view/op_constructor.md index bafc3d2b79..9cc3a41617 100644 --- a/reference/ranges/join_with_view/op_constructor.md +++ b/reference/ranges/join_with_view/op_constructor.md @@ -57,4 +57,4 @@ hello-world-join - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): 13.2 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ranges/join_with_view/op_deduction_guide.md b/reference/ranges/join_with_view/op_deduction_guide.md index 3921a11de4..e1f56d10d6 100644 --- a/reference/ranges/join_with_view/op_deduction_guide.md +++ b/reference/ranges/join_with_view/op_deduction_guide.md @@ -64,4 +64,4 @@ int main() { - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): 13.2 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/ranges/lazy_split_view/base.md b/reference/ranges/lazy_split_view/base.md index fc98d76478..779938e55d 100644 --- a/reference/ranges/lazy_split_view/base.md +++ b/reference/ranges/lazy_split_view/base.md @@ -65,4 +65,4 @@ int main() { - [Clang](/implementation.md#clang): 13.0.0 [mark verified] - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/lazy_split_view/begin.md b/reference/ranges/lazy_split_view/begin.md index a532da7c7a..854365f74e 100644 --- a/reference/ranges/lazy_split_view/begin.md +++ b/reference/ranges/lazy_split_view/begin.md @@ -60,4 +60,4 @@ int main() { - [Clang](/implementation.md#clang): 13.0.0 [mark verified] - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/lazy_split_view/end.md b/reference/ranges/lazy_split_view/end.md index 5ab73514d5..081c64f60f 100644 --- a/reference/ranges/lazy_split_view/end.md +++ b/reference/ranges/lazy_split_view/end.md @@ -63,4 +63,4 @@ int main() { - [Clang](/implementation.md#clang): 13.0.0 [mark verified] - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/lazy_split_view/op_constructor.md b/reference/ranges/lazy_split_view/op_constructor.md index 7492de4484..9b289e17af 100644 --- a/reference/ranges/lazy_split_view/op_constructor.md +++ b/reference/ranges/lazy_split_view/op_constructor.md @@ -71,4 +71,4 @@ int main() { - [Clang](/implementation.md#clang): 13.0.0 [mark verified] - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/lazy_split_view/op_deduction_guide.md b/reference/ranges/lazy_split_view/op_deduction_guide.md index 55b4f9bf6d..ba5554da18 100644 --- a/reference/ranges/lazy_split_view/op_deduction_guide.md +++ b/reference/ranges/lazy_split_view/op_deduction_guide.md @@ -75,4 +75,4 @@ int main() { - [Clang](/implementation.md#clang): 13.0.0 [mark verified] - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/reverse_view/base.md b/reference/ranges/reverse_view/base.md index 8cef2e99f0..1d13f86023 100644 --- a/reference/ranges/reverse_view/base.md +++ b/reference/ranges/reverse_view/base.md @@ -66,4 +66,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 -- [N4861 24.7.6.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.reverse.view) \ No newline at end of file +- [N4861 24.7.6.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.reverse.view) diff --git a/reference/ranges/reverse_view/begin.md b/reference/ranges/reverse_view/begin.md index f6345a87d1..6360f9476d 100644 --- a/reference/ranges/reverse_view/begin.md +++ b/reference/ranges/reverse_view/begin.md @@ -74,4 +74,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 -- [N4861 24.7.6.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.reverse.view) \ No newline at end of file +- [N4861 24.7.6.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.reverse.view) diff --git a/reference/ranges/reverse_view/end.md b/reference/ranges/reverse_view/end.md index 28fcdd5bda..e3127ded53 100644 --- a/reference/ranges/reverse_view/end.md +++ b/reference/ranges/reverse_view/end.md @@ -72,4 +72,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 -- [N4861 24.7.6.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.reverse.view) \ No newline at end of file +- [N4861 24.7.6.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.reverse.view) diff --git a/reference/ranges/reverse_view/op_constructor.md b/reference/ranges/reverse_view/op_constructor.md index 4369454a56..22fb6f3b69 100644 --- a/reference/ranges/reverse_view/op_constructor.md +++ b/reference/ranges/reverse_view/op_constructor.md @@ -62,4 +62,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 -- [N4861 24.7.6.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.reverse.view) \ No newline at end of file +- [N4861 24.7.6.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.reverse.view) diff --git a/reference/ranges/reverse_view/size.md b/reference/ranges/reverse_view/size.md index bc38982372..7bf003e31f 100644 --- a/reference/ranges/reverse_view/size.md +++ b/reference/ranges/reverse_view/size.md @@ -60,4 +60,4 @@ const size: 5 - [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 -- [N4861 24.7.6.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.reverse.view) \ No newline at end of file +- [N4861 24.7.6.1 Overview](https://timsong-cpp.github.io/cppwp/n4861/range.reverse.view) diff --git a/reference/ranges/slide_view/base.md b/reference/ranges/slide_view/base.md index 77e0c3002a..175d909963 100644 --- a/reference/ranges/slide_view/base.md +++ b/reference/ranges/slide_view/base.md @@ -59,4 +59,4 @@ moved base size: 6 - [Visual C++](/implementation.md#visual_cpp): 2022 Update 3 [mark verified] ## 参照 -- [N4950 26.7.31 Slide view](https://timsong-cpp.github.io/cppwp/n4950/range.slide) \ No newline at end of file +- [N4950 26.7.31 Slide view](https://timsong-cpp.github.io/cppwp/n4950/range.slide) diff --git a/reference/ranges/slide_view/begin.md b/reference/ranges/slide_view/begin.md index 6785092284..cb2daf0a4f 100644 --- a/reference/ranges/slide_view/begin.md +++ b/reference/ranges/slide_view/begin.md @@ -65,4 +65,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2022 Update 3 [mark verified] ## 参照 -- [N4950 26.7.31 Slide view](https://timsong-cpp.github.io/cppwp/n4950/range.slide) \ No newline at end of file +- [N4950 26.7.31 Slide view](https://timsong-cpp.github.io/cppwp/n4950/range.slide) diff --git a/reference/ranges/slide_view/end.md b/reference/ranges/slide_view/end.md index dc7dd1c64c..5e43b9d88d 100644 --- a/reference/ranges/slide_view/end.md +++ b/reference/ranges/slide_view/end.md @@ -71,4 +71,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2022 Update 3 [mark verified] ## 参照 -- [N4950 26.7.31 Slide view](https://timsong-cpp.github.io/cppwp/n4950/range.slide) \ No newline at end of file +- [N4950 26.7.31 Slide view](https://timsong-cpp.github.io/cppwp/n4950/range.slide) diff --git a/reference/ranges/slide_view/op_constructor.md b/reference/ranges/slide_view/op_constructor.md index b3fcfcae2d..2f4f777612 100644 --- a/reference/ranges/slide_view/op_constructor.md +++ b/reference/ranges/slide_view/op_constructor.md @@ -65,4 +65,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2022 Update 3 [mark verified] ## 参照 -- [N4950 26.7.31 Slide view](https://timsong-cpp.github.io/cppwp/n4950/range.slide) \ No newline at end of file +- [N4950 26.7.31 Slide view](https://timsong-cpp.github.io/cppwp/n4950/range.slide) diff --git a/reference/ranges/slide_view/size.md b/reference/ranges/slide_view/size.md index 9dd4cad864..1491557178 100644 --- a/reference/ranges/slide_view/size.md +++ b/reference/ranges/slide_view/size.md @@ -75,4 +75,4 @@ slide_view(6 elements, slide size 7): 0 slides - [Visual C++](/implementation.md#visual_cpp): 2022 Update 3 [mark verified] ## 参照 -- [N4950 26.7.31 Slide view](https://timsong-cpp.github.io/cppwp/n4950/range.slide) \ No newline at end of file +- [N4950 26.7.31 Slide view](https://timsong-cpp.github.io/cppwp/n4950/range.slide) diff --git a/reference/ranges/split_view/base.md b/reference/ranges/split_view/base.md index 8b08080c2c..dded81b8db 100644 --- a/reference/ranges/split_view/base.md +++ b/reference/ranges/split_view/base.md @@ -66,4 +66,4 @@ int main() { - [Clang](/implementation.md#clang): 13.0.0 [mark verified] - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/split_view/begin.md b/reference/ranges/split_view/begin.md index e2f2773f80..8a356186db 100644 --- a/reference/ranges/split_view/begin.md +++ b/reference/ranges/split_view/begin.md @@ -60,4 +60,4 @@ hello - [Clang](/implementation.md#clang): 13.0.0 [mark verified] - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/split_view/end.md b/reference/ranges/split_view/end.md index dcc5332f7f..7be2aa8a8a 100644 --- a/reference/ranges/split_view/end.md +++ b/reference/ranges/split_view/end.md @@ -64,4 +64,4 @@ split - [Clang](/implementation.md#clang): 13.0.0 [mark verified] - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/split_view/op_constructor.md b/reference/ranges/split_view/op_constructor.md index 86679fb979..afa8341f3d 100644 --- a/reference/ranges/split_view/op_constructor.md +++ b/reference/ranges/split_view/op_constructor.md @@ -63,4 +63,4 @@ split - [Clang](/implementation.md#clang): 13.0.0 [mark verified] - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/split_view/op_deduction_guide.md b/reference/ranges/split_view/op_deduction_guide.md index ce8a0b2cde..079ce5b1de 100644 --- a/reference/ranges/split_view/op_deduction_guide.md +++ b/reference/ranges/split_view/op_deduction_guide.md @@ -69,4 +69,4 @@ int main() { - [Clang](/implementation.md#clang): 13.0.0 [mark verified] - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/stride_view/base.md b/reference/ranges/stride_view/base.md index 39944edfe9..f42f965513 100644 --- a/reference/ranges/stride_view/base.md +++ b/reference/ranges/stride_view/base.md @@ -57,4 +57,4 @@ moved base size: 9 - [Visual C++](/implementation.md#visual_cpp): 2022 Update 4 [mark verified] ## 参照 -- [N4950 26.7.32 Stride view](https://timsong-cpp.github.io/cppwp/n4950/range.stride) \ No newline at end of file +- [N4950 26.7.32 Stride view](https://timsong-cpp.github.io/cppwp/n4950/range.stride) diff --git a/reference/ranges/stride_view/begin.md b/reference/ranges/stride_view/begin.md index e3b948c4a7..08e7fdd2bc 100644 --- a/reference/ranges/stride_view/begin.md +++ b/reference/ranges/stride_view/begin.md @@ -58,4 +58,4 @@ first element: 0 - [Visual C++](/implementation.md#visual_cpp): 2022 Update 4 [mark verified] ## 参照 -- [N4950 26.7.32 Stride view](https://timsong-cpp.github.io/cppwp/n4950/range.stride) \ No newline at end of file +- [N4950 26.7.32 Stride view](https://timsong-cpp.github.io/cppwp/n4950/range.stride) diff --git a/reference/ranges/stride_view/end.md b/reference/ranges/stride_view/end.md index 623737e030..6259d6672c 100644 --- a/reference/ranges/stride_view/end.md +++ b/reference/ranges/stride_view/end.md @@ -66,4 +66,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2022 Update 4 [mark verified] ## 参照 -- [N4950 26.7.32 Stride view](https://timsong-cpp.github.io/cppwp/n4950/range.stride) \ No newline at end of file +- [N4950 26.7.32 Stride view](https://timsong-cpp.github.io/cppwp/n4950/range.stride) diff --git a/reference/ranges/stride_view/op_constructor.md b/reference/ranges/stride_view/op_constructor.md index 1fbc17b890..b5a3388ccf 100644 --- a/reference/ranges/stride_view/op_constructor.md +++ b/reference/ranges/stride_view/op_constructor.md @@ -69,4 +69,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2022 Update 4 [mark verified] ## 参照 -- [N4950 26.7.32 Stride view](https://timsong-cpp.github.io/cppwp/n4950/range.stride) \ No newline at end of file +- [N4950 26.7.32 Stride view](https://timsong-cpp.github.io/cppwp/n4950/range.stride) diff --git a/reference/ranges/stride_view/size.md b/reference/ranges/stride_view/size.md index 0533d0d46e..604686013d 100644 --- a/reference/ranges/stride_view/size.md +++ b/reference/ranges/stride_view/size.md @@ -69,4 +69,4 @@ stride_view(9 elements, stride 4): 3 elements - [Visual C++](/implementation.md#visual_cpp): 2022 Update 4 [mark verified] ## 参照 -- [N4950 26.7.32 Stride view](https://timsong-cpp.github.io/cppwp/n4950/range.stride) \ No newline at end of file +- [N4950 26.7.32 Stride view](https://timsong-cpp.github.io/cppwp/n4950/range.stride) diff --git a/reference/ranges/stride_view/stride.md b/reference/ranges/stride_view/stride.md index ca4b776fbf..3ed51d9536 100644 --- a/reference/ranges/stride_view/stride.md +++ b/reference/ranges/stride_view/stride.md @@ -49,4 +49,4 @@ stride: 3 - [Visual C++](/implementation.md#visual_cpp): 2022 Update 4 [mark verified] ## 参照 -- [N4950 26.7.32 Stride view](https://timsong-cpp.github.io/cppwp/n4950/range.stride) \ No newline at end of file +- [N4950 26.7.32 Stride view](https://timsong-cpp.github.io/cppwp/n4950/range.stride) diff --git a/reference/ranges/take_view.md b/reference/ranges/take_view.md index 63f0b05a84..61f41b59c9 100644 --- a/reference/ranges/take_view.md +++ b/reference/ranges/take_view.md @@ -178,4 +178,4 @@ int main() { - [C++20 ranges](https://techbookfest.org/product/5134506308665344) - [P2367R0 Remove misuses of list-initialization from Clause 24](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2367r0.html) (本提案文書はC++20に遡って適用されている) - [P2406R2 Add `lazy_counted_iterator`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2406r2.html) -- [P2017R1 Conditionally borrowed ranges](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2017r1.html) \ No newline at end of file +- [P2017R1 Conditionally borrowed ranges](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2017r1.html) diff --git a/reference/ranges/take_view/base.md b/reference/ranges/take_view/base.md index b0303b718e..98a109d733 100644 --- a/reference/ranges/take_view/base.md +++ b/reference/ranges/take_view/base.md @@ -64,4 +64,4 @@ int main() { - [Clang](/implementation.md#clang): 13.0.0 [mark verified] - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/take_view/begin.md b/reference/ranges/take_view/begin.md index 4dd933fbd8..b376eaceff 100644 --- a/reference/ranges/take_view/begin.md +++ b/reference/ranges/take_view/begin.md @@ -59,4 +59,4 @@ int main() { - [Clang](/implementation.md#clang): 13.0.0 [mark verified] - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/take_view/end.md b/reference/ranges/take_view/end.md index 3fc578807b..6678fef49f 100644 --- a/reference/ranges/take_view/end.md +++ b/reference/ranges/take_view/end.md @@ -71,4 +71,4 @@ int main() { - [Clang](/implementation.md#clang): 13.0.0 [mark verified] - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/take_view/op_constructor.md b/reference/ranges/take_view/op_constructor.md index 1f371354a4..d9865ed1b3 100644 --- a/reference/ranges/take_view/op_constructor.md +++ b/reference/ranges/take_view/op_constructor.md @@ -60,4 +60,4 @@ int main() { ## 参照 - [N4861 24.7.10 Take view](https://timsong-cpp.github.io/cppwp/n4861/range.take) -- [N4950 26.7.14 Take view](https://timsong-cpp.github.io/cppwp/n4950/range.take) \ No newline at end of file +- [N4950 26.7.14 Take view](https://timsong-cpp.github.io/cppwp/n4950/range.take) diff --git a/reference/ranges/take_view/op_deduction_guide.md b/reference/ranges/take_view/op_deduction_guide.md index 4ddbaa8c09..d429e0f777 100644 --- a/reference/ranges/take_view/op_deduction_guide.md +++ b/reference/ranges/take_view/op_deduction_guide.md @@ -53,4 +53,4 @@ int main() { - [Clang](/implementation.md#clang): 13.0.0 [mark verified] - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/take_view/size.md b/reference/ranges/take_view/size.md index 97866e7500..7fbc4f949c 100644 --- a/reference/ranges/take_view/size.md +++ b/reference/ranges/take_view/size.md @@ -57,4 +57,4 @@ int main() { - [Clang](/implementation.md#clang): 13.0.0 [mark verified] - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/take_while_view/base.md b/reference/ranges/take_while_view/base.md index 18267e18de..0559c10cf4 100644 --- a/reference/ranges/take_while_view/base.md +++ b/reference/ranges/take_while_view/base.md @@ -64,4 +64,4 @@ int main() { - [Clang](/implementation.md#clang): 13.0.0 [mark verified] - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/take_while_view/begin.md b/reference/ranges/take_while_view/begin.md index 25c138e066..3c26168454 100644 --- a/reference/ranges/take_while_view/begin.md +++ b/reference/ranges/take_while_view/begin.md @@ -63,4 +63,4 @@ int main() { - [Clang](/implementation.md#clang): 13.0.0 [mark verified] - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/take_while_view/end.md b/reference/ranges/take_while_view/end.md index c01d6fc46c..e9bbfbfdbd 100644 --- a/reference/ranges/take_while_view/end.md +++ b/reference/ranges/take_while_view/end.md @@ -67,4 +67,4 @@ int main() { - [Clang](/implementation.md#clang): 13.0.0 [mark verified] - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/take_while_view/op_constructor.md b/reference/ranges/take_while_view/op_constructor.md index b1f3c10d4a..f2059227d5 100644 --- a/reference/ranges/take_while_view/op_constructor.md +++ b/reference/ranges/take_while_view/op_constructor.md @@ -57,4 +57,4 @@ int main() { - [Clang](/implementation.md#clang): 13.0.0 [mark verified] - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/take_while_view/op_deduction_guide.md b/reference/ranges/take_while_view/op_deduction_guide.md index badba1cc9b..cce33dae4f 100644 --- a/reference/ranges/take_while_view/op_deduction_guide.md +++ b/reference/ranges/take_while_view/op_deduction_guide.md @@ -54,4 +54,4 @@ int main() { - [Clang](/implementation.md#clang): 13.0.0 [mark verified] - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/take_while_view/pred.md b/reference/ranges/take_while_view/pred.md index e39dbd2c0a..3ca2707ea2 100644 --- a/reference/ranges/take_while_view/pred.md +++ b/reference/ranges/take_while_view/pred.md @@ -55,4 +55,4 @@ int main() { - [Clang](/implementation.md#clang): 13.0.0 [mark verified] - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] diff --git a/reference/ranges/to_input_view/base.md b/reference/ranges/to_input_view/base.md index b7073445d7..b21487121f 100644 --- a/reference/ranges/to_input_view/base.md +++ b/reference/ranges/to_input_view/base.md @@ -55,4 +55,4 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): 21 [mark verified] - [GCC](/implementation.md#gcc): 15.1 [mark verified] -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] diff --git a/reference/ranges/to_input_view/begin.md b/reference/ranges/to_input_view/begin.md index d6236644fc..2a92a94ef4 100644 --- a/reference/ranges/to_input_view/begin.md +++ b/reference/ranges/to_input_view/begin.md @@ -54,4 +54,4 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): 21 [mark verified] - [GCC](/implementation.md#gcc): 15.1 [mark verified] -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] diff --git a/reference/ranges/to_input_view/end.md b/reference/ranges/to_input_view/end.md index 1fc532852c..c2681f5971 100644 --- a/reference/ranges/to_input_view/end.md +++ b/reference/ranges/to_input_view/end.md @@ -63,4 +63,4 @@ size: 5 ### 処理系 - [Clang](/implementation.md#clang): 21 [mark verified] - [GCC](/implementation.md#gcc): 15.1 [mark verified] -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] diff --git a/reference/ranges/to_input_view/op_constructor.md b/reference/ranges/to_input_view/op_constructor.md index a6b41061a8..bc1080048d 100644 --- a/reference/ranges/to_input_view/op_constructor.md +++ b/reference/ranges/to_input_view/op_constructor.md @@ -50,4 +50,4 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): 21 [mark verified] - [GCC](/implementation.md#gcc): 15.1 [mark verified] -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] diff --git a/reference/ranges/to_input_view/op_deduction_guide.md b/reference/ranges/to_input_view/op_deduction_guide.md index 68f1b925b5..d6bf584fe3 100644 --- a/reference/ranges/to_input_view/op_deduction_guide.md +++ b/reference/ranges/to_input_view/op_deduction_guide.md @@ -45,4 +45,4 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): 21 [mark verified] - [GCC](/implementation.md#gcc): 15.1 [mark verified] -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] diff --git a/reference/ranges/to_input_view/size.md b/reference/ranges/to_input_view/size.md index 9f06c84128..9ae9b59cfe 100644 --- a/reference/ranges/to_input_view/size.md +++ b/reference/ranges/to_input_view/size.md @@ -51,4 +51,4 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): 21 [mark verified] - [GCC](/implementation.md#gcc): 15.1 [mark verified] -- [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] diff --git a/reference/ranges/zip_transform_view/begin.md b/reference/ranges/zip_transform_view/begin.md index a5b847c5c7..225519b946 100644 --- a/reference/ranges/zip_transform_view/begin.md +++ b/reference/ranges/zip_transform_view/begin.md @@ -71,4 +71,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 -- [N4950 26.7.26 Zip transform view](https://timsong-cpp.github.io/cppwp/n4950/range.zip.transform) \ No newline at end of file +- [N4950 26.7.26 Zip transform view](https://timsong-cpp.github.io/cppwp/n4950/range.zip.transform) diff --git a/reference/ranges/zip_transform_view/end.md b/reference/ranges/zip_transform_view/end.md index b043251cb7..608e03a50f 100644 --- a/reference/ranges/zip_transform_view/end.md +++ b/reference/ranges/zip_transform_view/end.md @@ -80,4 +80,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 -- [N4950 26.7.26 Zip transform view](https://timsong-cpp.github.io/cppwp/n4950/range.zip.transform) \ No newline at end of file +- [N4950 26.7.26 Zip transform view](https://timsong-cpp.github.io/cppwp/n4950/range.zip.transform) diff --git a/reference/ranges/zip_transform_view/op_constructor.md b/reference/ranges/zip_transform_view/op_constructor.md index 14590deed2..137cd1d265 100644 --- a/reference/ranges/zip_transform_view/op_constructor.md +++ b/reference/ranges/zip_transform_view/op_constructor.md @@ -68,4 +68,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 -- [N4950 26.7.26 Zip transform view](https://timsong-cpp.github.io/cppwp/n4950/range.zip.transform) \ No newline at end of file +- [N4950 26.7.26 Zip transform view](https://timsong-cpp.github.io/cppwp/n4950/range.zip.transform) diff --git a/reference/ranges/zip_transform_view/size.md b/reference/ranges/zip_transform_view/size.md index 68c5bfa467..9ee729be9b 100644 --- a/reference/ranges/zip_transform_view/size.md +++ b/reference/ranges/zip_transform_view/size.md @@ -68,4 +68,4 @@ const size: 3 - [Visual C++](/implementation.md#visual_cpp): 2022 Update 6 [mark verified] ## 参照 -- [N4950 26.7.26 Zip transform view](https://timsong-cpp.github.io/cppwp/n4950/range.zip.transform) \ No newline at end of file +- [N4950 26.7.26 Zip transform view](https://timsong-cpp.github.io/cppwp/n4950/range.zip.transform) diff --git a/reference/ranges/zip_view/begin.md b/reference/ranges/zip_view/begin.md index 18cf2caa4f..b1dd5fc3db 100644 --- a/reference/ranges/zip_view/begin.md +++ b/reference/ranges/zip_view/begin.md @@ -67,4 +67,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2022 Update 5 [mark verified] ## 参照 -- [N4950 26.7.25 Zip view](https://timsong-cpp.github.io/cppwp/n4950/range.zip) \ No newline at end of file +- [N4950 26.7.25 Zip view](https://timsong-cpp.github.io/cppwp/n4950/range.zip) diff --git a/reference/ranges/zip_view/end.md b/reference/ranges/zip_view/end.md index 307a467f29..755dce3b40 100644 --- a/reference/ranges/zip_view/end.md +++ b/reference/ranges/zip_view/end.md @@ -91,4 +91,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2022 Update 5 [mark verified] ## 参照 -- [N4950 26.7.25 Zip view](https://timsong-cpp.github.io/cppwp/n4950/range.zip) \ No newline at end of file +- [N4950 26.7.25 Zip view](https://timsong-cpp.github.io/cppwp/n4950/range.zip) diff --git a/reference/ranges/zip_view/op_constructor.md b/reference/ranges/zip_view/op_constructor.md index f1da464774..575f756505 100644 --- a/reference/ranges/zip_view/op_constructor.md +++ b/reference/ranges/zip_view/op_constructor.md @@ -63,4 +63,4 @@ int main() { - [Visual C++](/implementation.md#visual_cpp): 2022 Update 5 [mark verified] ## 参照 -- [N4950 26.7.25 Zip view](https://timsong-cpp.github.io/cppwp/n4950/range.zip) \ No newline at end of file +- [N4950 26.7.25 Zip view](https://timsong-cpp.github.io/cppwp/n4950/range.zip) diff --git a/reference/ranges/zip_view/size.md b/reference/ranges/zip_view/size.md index b84f1afeab..b3ca537f45 100644 --- a/reference/ranges/zip_view/size.md +++ b/reference/ranges/zip_view/size.md @@ -77,4 +77,4 @@ const size: 3 - [Visual C++](/implementation.md#visual_cpp): 2022 Update 5 [mark verified] ## 参照 -- [N4950 26.7.25 Zip view](https://timsong-cpp.github.io/cppwp/n4950/range.zip) \ No newline at end of file +- [N4950 26.7.25 Zip view](https://timsong-cpp.github.io/cppwp/n4950/range.zip) diff --git a/reference/source_location/source_location/file_name.md b/reference/source_location/source_location/file_name.md index 6614e7f887..d99600517c 100644 --- a/reference/source_location/source_location/file_name.md +++ b/reference/source_location/source_location/file_name.md @@ -38,4 +38,4 @@ constexpr const char* file_name() const noexcept { return file_name_; } ## 参照 -- [P1208R6 Adopt source_location for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1208r6.pdf) \ No newline at end of file +- [P1208R6 Adopt source_location for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1208r6.pdf) diff --git a/reference/source_location/source_location/function_name.md b/reference/source_location/source_location/function_name.md index 1567c63f3b..1714d7b5bc 100644 --- a/reference/source_location/source_location/function_name.md +++ b/reference/source_location/source_location/function_name.md @@ -38,4 +38,4 @@ constexpr const char* function_name() const noexcept { return function_name_; } ## 参照 -- [P1208R6 Adopt source_location for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1208r6.pdf) \ No newline at end of file +- [P1208R6 Adopt source_location for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1208r6.pdf) diff --git a/reference/sstream/basic_istringstream/op_assign.md b/reference/sstream/basic_istringstream/op_assign.md index d0c7dfb25b..a594233285 100644 --- a/reference/sstream/basic_istringstream/op_assign.md +++ b/reference/sstream/basic_istringstream/op_assign.md @@ -51,4 +51,4 @@ first ### 処理系 - [Clang](/implementation.md#clang): 3.0 [mark verified] - [GCC](/implementation.md#gcc): 5.1.0 [mark verified] -- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/sstream/basic_istringstream/op_constructor.md b/reference/sstream/basic_istringstream/op_constructor.md index f3910c37b0..bd6e183bd6 100644 --- a/reference/sstream/basic_istringstream/op_constructor.md +++ b/reference/sstream/basic_istringstream/op_constructor.md @@ -164,4 +164,4 @@ Hello ## 参照 - [P0408R7 Efficient Access to `basic_stringbuf`'s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) - [P2495R3 Interfacing stringstreams with `string_view`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2495r3.pdf) - - C++26で[`std::string_view`](/reference/string_view/basic_string_view.md)に対応した \ No newline at end of file + - C++26で[`std::string_view`](/reference/string_view/basic_string_view.md)に対応した diff --git a/reference/sstream/basic_istringstream/str.md b/reference/sstream/basic_istringstream/str.md index 8563b18e65..46f2ebb87e 100644 --- a/reference/sstream/basic_istringstream/str.md +++ b/reference/sstream/basic_istringstream/str.md @@ -152,4 +152,4 @@ set from string_view ## 参照 - [P0408R7 Efficient Access to `basic_stringbuf`'s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) - [P2495R3 Interfacing stringstreams with `string_view`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2495r3.pdf) - - C++26で[`std::string_view`](/reference/string_view/basic_string_view.md)に対応した \ No newline at end of file + - C++26で[`std::string_view`](/reference/string_view/basic_string_view.md)に対応した diff --git a/reference/sstream/basic_istringstream/swap_free.md b/reference/sstream/basic_istringstream/swap_free.md index eec17efd83..a6f2681dca 100644 --- a/reference/sstream/basic_istringstream/swap_free.md +++ b/reference/sstream/basic_istringstream/swap_free.md @@ -54,4 +54,4 @@ first - [Clang](/implementation.md#clang): 3.0 [mark verified] - [GCC](/implementation.md#gcc): 5.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/sstream/basic_istringstream/view.md b/reference/sstream/basic_istringstream/view.md index d44461b726..b543356c72 100644 --- a/reference/sstream/basic_istringstream/view.md +++ b/reference/sstream/basic_istringstream/view.md @@ -47,4 +47,4 @@ Hello - [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 -- [P0408R7 Efficient Access to `basic_stringbuf`'s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) \ No newline at end of file +- [P0408R7 Efficient Access to `basic_stringbuf`'s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) diff --git a/reference/sstream/basic_ostringstream/op_assign.md b/reference/sstream/basic_ostringstream/op_assign.md index 52fd35a1ce..c9020b2ecf 100644 --- a/reference/sstream/basic_ostringstream/op_assign.md +++ b/reference/sstream/basic_ostringstream/op_assign.md @@ -53,4 +53,4 @@ first - [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5.0 [mark verified], 3.6.0 [mark verified], 3.7.0 [mark verified], 3.8.0 [mark verified] - [GCC](/implementation.md#gcc): 5.1.0 [mark verified], 5.2.0 [mark verified], 6.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/sstream/basic_ostringstream/op_constructor.md b/reference/sstream/basic_ostringstream/op_constructor.md index 63472388b9..2df5099fbe 100644 --- a/reference/sstream/basic_ostringstream/op_constructor.md +++ b/reference/sstream/basic_ostringstream/op_constructor.md @@ -165,4 +165,4 @@ World? ## 参照 - [P0408R7 Efficient Access to `basic_stringbuf`'s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) - [P2495R3 Interfacing stringstreams with `string_view`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2495r3.pdf) - - C++26で[`std::string_view`](/reference/string_view/basic_string_view.md)に対応した \ No newline at end of file + - C++26で[`std::string_view`](/reference/string_view/basic_string_view.md)に対応した diff --git a/reference/sstream/basic_ostringstream/str.md b/reference/sstream/basic_ostringstream/str.md index 2becd6290d..bba81c213e 100644 --- a/reference/sstream/basic_ostringstream/str.md +++ b/reference/sstream/basic_ostringstream/str.md @@ -158,4 +158,4 @@ set from string_view test ## 参照 - [P0408R7 Efficient Access to `basic_stringbuf`'s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) - [P2495R3 Interfacing stringstreams with `string_view`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2495r3.pdf) - - C++26で[`std::string_view`](/reference/string_view/basic_string_view.md)に対応した \ No newline at end of file + - C++26で[`std::string_view`](/reference/string_view/basic_string_view.md)に対応した diff --git a/reference/sstream/basic_ostringstream/swap_free.md b/reference/sstream/basic_ostringstream/swap_free.md index 3d9fe4c1e5..46edcb531d 100644 --- a/reference/sstream/basic_ostringstream/swap_free.md +++ b/reference/sstream/basic_ostringstream/swap_free.md @@ -54,4 +54,4 @@ first - [Clang](/implementation.md#clang): 3.0 [mark verified] - [GCC](/implementation.md#gcc): 5.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/sstream/basic_ostringstream/view.md b/reference/sstream/basic_ostringstream/view.md index fa8525ddb6..477a185d1c 100644 --- a/reference/sstream/basic_ostringstream/view.md +++ b/reference/sstream/basic_ostringstream/view.md @@ -48,4 +48,4 @@ Hello - [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 -- [P0408R7 Efficient Access to `basic_stringbuf`'s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) \ No newline at end of file +- [P0408R7 Efficient Access to `basic_stringbuf`'s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) diff --git a/reference/sstream/basic_stringbuf/get_allocator.md b/reference/sstream/basic_stringbuf/get_allocator.md index 2c36d251a9..1c02010414 100644 --- a/reference/sstream/basic_stringbuf/get_allocator.md +++ b/reference/sstream/basic_stringbuf/get_allocator.md @@ -46,4 +46,4 @@ std::allocator - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 -- [P0408R7 Efficient Access to `basic_stringbuf`'s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) \ No newline at end of file +- [P0408R7 Efficient Access to `basic_stringbuf`'s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) diff --git a/reference/sstream/basic_stringbuf/op_assign.md b/reference/sstream/basic_stringbuf/op_assign.md index 9abfaf684d..e1ecb1e7bc 100644 --- a/reference/sstream/basic_stringbuf/op_assign.md +++ b/reference/sstream/basic_stringbuf/op_assign.md @@ -51,4 +51,4 @@ first - [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5.0 [mark verified], 3.6.0 [mark verified], 3.7.0 [mark verified], 3.8.0 [mark verified] - [GCC](/implementation.md#gcc): 5.1.0 [mark verified], 5.2.0 [mark verified], 6.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/sstream/basic_stringbuf/str.md b/reference/sstream/basic_stringbuf/str.md index 8ae0dade46..7424b49536 100644 --- a/reference/sstream/basic_stringbuf/str.md +++ b/reference/sstream/basic_stringbuf/str.md @@ -155,4 +155,4 @@ set from string_view ## 参照 - [P0408R7 Efficient Access to `basic_stringbuf`'s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) - [P2495R3 Interfacing stringstreams with `string_view`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2495r3.pdf) - - C++26で[`std::string_view`](/reference/string_view/basic_string_view.md)に対応した \ No newline at end of file + - C++26で[`std::string_view`](/reference/string_view/basic_string_view.md)に対応した diff --git a/reference/sstream/basic_stringbuf/swap_free.md b/reference/sstream/basic_stringbuf/swap_free.md index 6cf73ef46d..5362498679 100644 --- a/reference/sstream/basic_stringbuf/swap_free.md +++ b/reference/sstream/basic_stringbuf/swap_free.md @@ -51,4 +51,4 @@ first - [Clang](/implementation.md#clang): 3.0 [mark verified] - [GCC](/implementation.md#gcc): 5.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/sstream/basic_stringstream/op_assign.md b/reference/sstream/basic_stringstream/op_assign.md index 07460e7461..ff116b38e4 100644 --- a/reference/sstream/basic_stringstream/op_assign.md +++ b/reference/sstream/basic_stringstream/op_assign.md @@ -51,4 +51,4 @@ first - [Clang](/implementation.md#clang): 3.0 [mark verified], 3.1 [mark verified], 3.2 [mark verified], 3.3 [mark verified], 3.4 [mark verified], 3.5.0 [mark verified], 3.6.0 [mark verified], 3.7.0 [mark verified], 3.8.0 [mark verified] - [GCC](/implementation.md#gcc): 5.1.0 [mark verified], 5.2.0 [mark verified], 6.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/sstream/basic_stringstream/view.md b/reference/sstream/basic_stringstream/view.md index 2f3520c295..9918b280b4 100644 --- a/reference/sstream/basic_stringstream/view.md +++ b/reference/sstream/basic_stringstream/view.md @@ -47,4 +47,4 @@ Hello - [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] ## 参照 -- [P0408R7 Efficient Access to `basic_stringbuf`'s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) \ No newline at end of file +- [P0408R7 Efficient Access to `basic_stringbuf`'s Buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0408r7.pdf) diff --git a/reference/utility/pair/first.md b/reference/utility/pair/first.md index e92833f5b9..0e87ab3467 100644 --- a/reference/utility/pair/first.md +++ b/reference/utility/pair/first.md @@ -31,4 +31,4 @@ int main() { ## 処理系 - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/utility/pair/second.md b/reference/utility/pair/second.md index e90f2539d0..f58f062a57 100644 --- a/reference/utility/pair/second.md +++ b/reference/utility/pair/second.md @@ -31,4 +31,4 @@ int main() { ## 処理系 - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file +- [Visual C++](/implementation.md#visual_cpp): ?? From 612c75f36ce090737b33ff61def4c8f20ca872a1 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Thu, 10 Jul 2025 10:57:11 +0900 Subject: [PATCH 2191/3948] =?UTF-8?q?style(reference/{cstdio,cstdlib}):=20?= =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=87=E3=82=A3=E3=83=B3=E3=82=B0=E3=82=B9?= =?UTF-8?q?=E3=82=BF=E3=82=A4=E3=83=AB=E3=81=AE=E7=B5=B1=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdio/eof.md | 1 + reference/cstdio/getchar.md | 1 + reference/cstdlib/free.md | 6 +++--- reference/cstdlib/malloc.md | 18 +++++++++--------- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/reference/cstdio/eof.md b/reference/cstdio/eof.md index a309e99de5..d33119cf9f 100644 --- a/reference/cstdio/eof.md +++ b/reference/cstdio/eof.md @@ -14,6 +14,7 @@ ## 例 ```cpp example #include + int main() { int c; while ((c = std::getchar()) != EOF) { diff --git a/reference/cstdio/getchar.md b/reference/cstdio/getchar.md index 025379e4ab..96437eb4a7 100644 --- a/reference/cstdio/getchar.md +++ b/reference/cstdio/getchar.md @@ -22,6 +22,7 @@ namespace std { ## 例 ```cpp example #include + int main() { int c; while ((c = std::getchar()) != EOF) { diff --git a/reference/cstdlib/free.md b/reference/cstdlib/free.md index 57c64a7e80..b69cfbc968 100644 --- a/reference/cstdlib/free.md +++ b/reference/cstdlib/free.md @@ -27,12 +27,12 @@ namespace std { int main() { - int *p1 = std::malloc(10*sizeof *p1); + int *p1 = std::malloc(10 * sizeof *p1); std::free(p1); // p1のメモリを解放 int *p2 = std::calloc(10, sizeof *p2); - int *p3 = std::realloc(p2, 1000*sizeof *p3); - if(p3) + int *p3 = std::realloc(p2, 1000 * sizeof *p3); + if (p3) std::free(p3); // realloc により新しい領域が確保された場合、それを解放 else std::free(p2); // realloc が失敗した場合は元の領域を解放 diff --git a/reference/cstdlib/malloc.md b/reference/cstdlib/malloc.md index 5594c7f46b..16559c0fb9 100644 --- a/reference/cstdlib/malloc.md +++ b/reference/cstdlib/malloc.md @@ -42,18 +42,18 @@ cppref より引用。 int main() { - int *p1 = std::malloc(4*sizeof(int)); // 4個のint型配列の目盛りを確保 - int *p2 = std::malloc(sizeof(int[4])); // 上と同じ。 - int *p3 = std::malloc(4*sizeof *p3); // 上と同じ。 - - if(p1) { - for(int n=0; n<4; ++n) - p1[n] = n*n; - for(int n=0; n<4; ++n) + int *p1 = std::malloc(4 * sizeof(int)); // 4個のint型配列の目盛りを確保 + int *p2 = std::malloc(sizeof(int[4])); // 上と同じ。 + int *p3 = std::malloc(4 * sizeof *p3); // 上と同じ。 + + if (p1) { + for (int n = 0; n < 4; ++n) + p1[n] = n * n; + for (int n = 0; n < 4; ++n) std::printf("p1[%d] == %d\n", n, p1[n]); } - std::free(p1);//メモリを解放 + std::free(p1); // メモリを解放 std::free(p2); std::free(p3); } From ff932ef6e0003fa96ae8d608088e7a576837b6f3 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Thu, 10 Jul 2025 13:53:17 +0900 Subject: [PATCH 2192/3948] =?UTF-8?q?fix(reference/cstdio):=20=E5=A3=8A?= =?UTF-8?q?=E3=82=8C=E3=81=9F=E3=83=AA=E3=83=B3=E3=82=AF=E3=81=AE=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdio/fgetc.md | 2 +- reference/cstdio/fputc.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/cstdio/fgetc.md b/reference/cstdio/fgetc.md index ab874b65fd..5a3db25323 100644 --- a/reference/cstdio/fgetc.md +++ b/reference/cstdio/fgetc.md @@ -12,7 +12,7 @@ namespace std { ## 概要 指定されたファイルストリームから1文字入力する。 -[`getc`][/reference/cstdio/getc.md]とは違い、関数として定義することが定められているため、引数は一度しか評価されないことが保証されている。 +[`getc`](/reference/cstdio/getc.md)とは違い、関数として定義することが定められているため、引数は一度しか評価されないことが保証されている。 ## 戻り値 入力された文字を返す。 diff --git a/reference/cstdio/fputc.md b/reference/cstdio/fputc.md index e8d38e7fd3..87dc7436a9 100644 --- a/reference/cstdio/fputc.md +++ b/reference/cstdio/fputc.md @@ -12,7 +12,7 @@ namespace std { ## 概要 指定されたファイルストリームに1文字出力する。 -[`putc`][/reference/cstdio/putc.md]とは違い、関数として定義することが定められているため、引数は一度しか評価されないことが保証されている。 +[`putc`](/reference/cstdio/putc.md)とは違い、関数として定義することが定められているため、引数は一度しか評価されないことが保証されている。 ## 戻り値 出力された文字を返す。 From f66abcba766f52d578511a76cc5349b4fd47b056 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Thu, 10 Jul 2025 15:20:30 +0900 Subject: [PATCH 2193/3948] =?UTF-8?q?fix(reference/atomic/atomic=5Fref/add?= =?UTF-8?q?ress):=20=E5=A3=8A=E3=82=8C=E3=81=9F=E3=82=B3=E3=83=BC=E3=83=89?= =?UTF-8?q?=E4=BF=AE=E9=A3=BE=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/atomic/atomic_ref/address.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/atomic/atomic_ref/address.md b/reference/atomic/atomic_ref/address.md index 11afa684b0..dad2c19b6b 100644 --- a/reference/atomic/atomic_ref/address.md +++ b/reference/atomic/atomic_ref/address.md @@ -33,7 +33,7 @@ int fetch_add_idx(std::atomic_ref base, size_t i, int value) { return std::atomic_ref{*(p+i)}.fetch_add(value); } ``` -* fetch_add[link fetch_add.md +* fetch_add[link fetch_add.md] #### 必要なときにのみアトミックアクセスする 以下の例では、複数のスレッドが並行にメモリにアクセスし、カウンタをインクリメントすることでアクセス終了を知らせている。最後のスレッドはメモリにアクセスする余分な処理を実行する必要があるが、並行にメモリにアクセスするほかのスレッドがないため、これらのアクセスはアトミックである必要がない: From 5ccd04f39d30be21907e8c43556ff9a028e95cea Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Thu, 10 Jul 2025 15:32:13 +0900 Subject: [PATCH 2194/3948] =?UTF-8?q?fix(reference/cstdlib/malloc):=20?= =?UTF-8?q?=E3=82=BF=E3=82=A4=E3=83=9D=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/malloc.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdlib/malloc.md b/reference/cstdlib/malloc.md index 16559c0fb9..613a8f11ec 100644 --- a/reference/cstdlib/malloc.md +++ b/reference/cstdlib/malloc.md @@ -42,7 +42,7 @@ cppref より引用。 int main() { - int *p1 = std::malloc(4 * sizeof(int)); // 4個のint型配列の目盛りを確保 + int *p1 = std::malloc(4 * sizeof(int)); // 4個のint型配列のメモリ領域を確保 int *p2 = std::malloc(sizeof(int[4])); // 上と同じ。 int *p3 = std::malloc(4 * sizeof *p3); // 上と同じ。 From 62d8393dcdd0ed11b7c7cbb76206bd56a2f54abe Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Fri, 11 Jul 2025 20:54:50 +0900 Subject: [PATCH 2195/3948] =?UTF-8?q?fix(reference/cstdio/printf):=20?= =?UTF-8?q?=E5=87=BA=E5=8A=9B=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdio/printf.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/cstdio/printf.md b/reference/cstdio/printf.md index 5a7153fa37..4542dc2ea6 100644 --- a/reference/cstdio/printf.md +++ b/reference/cstdio/printf.md @@ -25,6 +25,7 @@ int main() { ### 出力 ``` Hello, World! +123 ``` ## 処理系 From 561be1bee9a0c34286b70338514ce4eb1399e731 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Sat, 12 Jul 2025 02:16:22 +0900 Subject: [PATCH 2196/3948] =?UTF-8?q?feat(reference/cstdio/fputs):=20?= =?UTF-8?q?=E5=87=BA=E5=8A=9B=E4=BE=8B=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdio/fputs.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reference/cstdio/fputs.md b/reference/cstdio/fputs.md index e00160f223..c00edfd847 100644 --- a/reference/cstdio/fputs.md +++ b/reference/cstdio/fputs.md @@ -24,6 +24,12 @@ int main() { return 0; } ``` +* std::fputs[color ff0000] + +### 出力 +``` +Hello, World! +``` ## 処理系 - [Clang](/implementation.md#clang): ?? From 76f8ad625e918c5155b45d2a75461c5bb28a7a89 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sat, 12 Jul 2025 14:50:52 +0900 Subject: [PATCH 2197/3948] =?UTF-8?q?=E5=9E=8B=E3=82=A8=E3=82=A4=E3=83=AA?= =?UTF-8?q?=E3=82=A2=E3=82=B9=E5=AE=9A=E7=BE=A9=E3=81=AE=E5=BE=8C=E3=81=AE?= =?UTF-8?q?=E3=82=BB=E3=83=9F=E3=82=B3=E3=83=AD=E3=83=B3=E5=BF=98=E3=82=8C?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/execution/execution/gather-signatures.md | 2 +- reference/linalg/layout_blas_packed/mapping/op_constructor.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/execution/execution/gather-signatures.md b/reference/execution/execution/gather-signatures.md index df0e52cc7f..f36a5e2b63 100644 --- a/reference/execution/execution/gather-signatures.md +++ b/reference/execution/execution/gather-signatures.md @@ -9,7 +9,7 @@ template class Tuple, template class Variant> -using gather-signatures = /*see below*/ +using gather-signatures = /*see below*/; ``` * valid-completion-signatures[link completion_signatures.md] * see below[italic] diff --git a/reference/linalg/layout_blas_packed/mapping/op_constructor.md b/reference/linalg/layout_blas_packed/mapping/op_constructor.md index 12c90f3e73..7e12c6efbc 100644 --- a/reference/linalg/layout_blas_packed/mapping/op_constructor.md +++ b/reference/linalg/layout_blas_packed/mapping/op_constructor.md @@ -56,7 +56,7 @@ constexpr explicit(!is_convertible_v) #include namespace linalg = std::linalg; -using LayoutPacked = linalg::layout_blas_packed +using LayoutPacked = linalg::layout_blas_packed; using Ext3x3 = std::extents; using ExtNxN = std::dextents; From aa2056f533ac1997fc167f2e72471c2cb9e9d7dc Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sat, 12 Jul 2025 14:51:22 +0900 Subject: [PATCH 2198/3948] =?UTF-8?q?=E3=82=BF=E3=82=A4=E3=83=88=E3=83=AB?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdio/printf.md | 2 +- reference/cstdio/scanf.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/cstdio/printf.md b/reference/cstdio/printf.md index 4542dc2ea6..d0c2418e09 100644 --- a/reference/cstdio/printf.md +++ b/reference/cstdio/printf.md @@ -1,4 +1,4 @@ -# fprintf +# printf * cstdio[meta header] * std[meta namespace] * function[meta id-type] diff --git a/reference/cstdio/scanf.md b/reference/cstdio/scanf.md index 0a3df69e36..e0203fba7e 100644 --- a/reference/cstdio/scanf.md +++ b/reference/cstdio/scanf.md @@ -1,4 +1,4 @@ -# fscanf +# scanf * cstdio[meta header] * std[meta namespace] * function[meta id-type] From 2d1d210df45fcd1a0028431b7aead8bffe7cb1e5 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sat, 12 Jul 2025 16:05:25 +0900 Subject: [PATCH 2199/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=B8=AD?= =?UTF-8?q?=E3=81=AE=E9=9D=9EASCII=E6=96=87=E5=AD=97=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp11/lambda_expressions.md | 4 ++-- lang/cpp20/down_with_typename.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lang/cpp11/lambda_expressions.md b/lang/cpp11/lambda_expressions.md index 75d47d4225..96261524a9 100644 --- a/lang/cpp11/lambda_expressions.md +++ b/lang/cpp11/lambda_expressions.md @@ -497,7 +497,7 @@ void f() ```cpp double array[] = { 1.0, 2.1, 3.3, 4.4 }; double sum = 0; int factor = 2; -for_each(array, array + 4, <>(double d ; &sum, factor) ( sum += factor ∗ d )); +for_each(array, array + 4, <>(double d ; &sum, factor) ( sum += factor * d )); ``` 参照キャプチャする場合は、変数名の先頭に`&`を付け、コピーキャプチャする場合は変数名のみを指定する。 @@ -507,7 +507,7 @@ for_each(array, array + 4, <>(double d ; &sum, factor) ( sum += factor ∗ d )); ```cpp double array[] = { 1.0, 2.1, 3.3, 4.4 }; double sum = 0; int factor = 2; -for_each(array, array + 4, <&>(double d) ( sum += factor ∗ d )); +for_each(array, array + 4, <&>(double d) ( sum += factor * d )); ``` ここでは、関数の本体に丸カッコを使用している。これは、関数の本体がひとつの式だけで成り立つ場合に使用する。2つ以上の式や文がある場合は、波カッコを使用する。 diff --git a/lang/cpp20/down_with_typename.md b/lang/cpp20/down_with_typename.md index 25c042ec83..05c90b9331 100644 --- a/lang/cpp20/down_with_typename.md +++ b/lang/cpp20/down_with_typename.md @@ -43,7 +43,7 @@ template struct S { T::R f(T::P p) { // OK, メンバ宣言、およびメンバ宣言における仮引数宣言 return static_cast(p); // OK, static_castの型名 } - auto g() -> S::Ptr;  // OK, 後置戻り値型 + auto g() -> S::Ptr; // OK, 後置戻り値型 }; template void f() { From dd16f316521008ef0b4271708a2386347fc14276 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sat, 12 Jul 2025 16:52:34 +0900 Subject: [PATCH 2200/3948] =?UTF-8?q?=E3=82=B0=E3=83=AD=E3=83=BC=E3=83=90?= =?UTF-8?q?=E3=83=AB=E4=BF=AE=E9=A3=BE=E3=81=AB=20=20=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 0c106e8455..4a385d99a5 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -29,6 +29,7 @@ * std::bitset[link /reference/bitset/bitset.md] * [link /reference/cassert.md] * assert[link /reference/cassert/assert.md] +* [link /reference/cctype.md] * [link /reference/cerrno.md] * [link /reference/cfenv.md] * [link /reference/cfloat.md] From 95459a75fcd9d29defe75a8dca70373cacd6bb3d Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sat, 12 Jul 2025 16:53:59 +0900 Subject: [PATCH 2201/3948] =?UTF-8?q?=E8=87=AA=E5=8B=95=E3=83=AA=E3=83=B3?= =?UTF-8?q?=E3=82=AF=E3=81=8C=E3=81=A4=E3=81=8F=E3=82=88=E3=81=86=E3=81=AB?= =?UTF-8?q?=E3=82=B9=E3=83=9A=E3=83=BC=E3=82=B9=E3=82=92=E6=8C=BF=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iomanip/resetiosflags.md | 4 ++-- reference/iomanip/setiosflags.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/iomanip/resetiosflags.md b/reference/iomanip/resetiosflags.md index b7c733638b..6f002d6908 100644 --- a/reference/iomanip/resetiosflags.md +++ b/reference/iomanip/resetiosflags.md @@ -30,8 +30,8 @@ void f(std::ios_base& str, std::ios_base::fmtflags mask) { ## 例 ```cpp example -#include -#include +#include +#include int main() { diff --git a/reference/iomanip/setiosflags.md b/reference/iomanip/setiosflags.md index c7706ba64b..b5de2269d8 100644 --- a/reference/iomanip/setiosflags.md +++ b/reference/iomanip/setiosflags.md @@ -30,8 +30,8 @@ void f(std::ios_base& str, std::ios_base::fmtflags mask) { ## 例 ```cpp example -#include -#include +#include +#include int main() { From ef9d91e67fea1280e7e576028be2132208f243f9 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Sat, 12 Jul 2025 02:16:44 +0900 Subject: [PATCH 2202/3948] =?UTF-8?q?style(*):=20=E4=BD=99=E5=88=86?= =?UTF-8?q?=E3=81=AE=E6=9C=AB=E5=B0=BE=E6=94=B9=E8=A1=8C=E3=82=92=E5=89=8A?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 貢献ポイント備考: これは機械的な変更です。以下のコマンドを新しい変更が 出なくなるまで繰り返してから commit したものです。 $ sed -i '${/^[[:space:]]*$/d;}' $(find . -name \*.md) $ git add -u --- README.md | 1 - article.md | 1 - article/lib/at_thread_exit.md | 1 - article/lib/dont_use_noexcept.md | 1 - article/lib/how_to_use_cv.md | 1 - edit_policy.md | 3 --- implementation-status.md | 1 - lang.md | 1 - lang/archive.md | 3 --- lang/cpp11.md | 1 - lang/cpp14.md | 1 - lang/cpp26.md | 1 - .../disallow_binding_a_returned_glvalue_to_a_temporary.md | 1 - lang/cpp26/module_declarations_shouldnt_be_macros.md | 1 - .../trivial_infinite_loops_are_not_undefined_behavior.md | 1 - lang/cpp26/variadic_friends.md | 1 - reference/algorithm/min.md | 1 - reference/algorithm/minmax.md | 1 - reference/algorithm/minmax_element.md | 1 - reference/algorithm/ranges_minmax.md | 1 - reference/array.md | 1 - reference/array/array.md | 2 -- reference/array/array/max_size.md | 1 - reference/array/array/op_deduction_guide.md | 1 - reference/array/array/op_initializer.md | 2 -- reference/array/array/size.md | 1 - reference/array/array/tuple_element.md | 1 - reference/array/array/tuple_size.md | 1 - reference/atomic.md | 1 - reference/atomic/atomic_flag.md | 1 - reference/atomic/atomic_ref/fetch_min.md | 1 - reference/bitset.md | 1 - reference/bitset/bitset/op_constructor.md | 1 - reference/bitset/bitset/op_flip.md | 1 - reference/bitset/bitset/op_istream.md | 1 - reference/bitset/bitset/op_ostream.md | 1 - reference/cassert.md | 1 - reference/cctype/islower.md | 1 - reference/cctype/isupper.md | 1 - reference/cctype/tolower.md | 1 - reference/cerrno.md | 1 - reference/cerrno/errno.md | 1 - reference/cfenv.md | 1 - reference/cfenv/fe_all_except.md | 2 -- reference/cfenv/fe_divbyzero.md | 2 -- reference/cfenv/fe_downward.md | 2 -- reference/cfenv/fe_inexact.md | 2 -- reference/cfenv/fe_invalid.md | 2 -- reference/cfenv/fe_overflow.md | 2 -- reference/cfenv/fe_tonearest.md | 2 -- reference/cfenv/fe_towardzero.md | 2 -- reference/cfenv/fe_underflow.md | 2 -- reference/cfenv/fe_upward.md | 2 -- reference/cfenv/feclearexcept.md | 2 -- reference/cfenv/fegetexceptflag.md | 2 -- reference/cfenv/fegetround.md | 1 - reference/cfenv/feraiseexcept.md | 2 -- reference/cfenv/fesetexceptflag.md | 2 -- reference/cfenv/fesetround.md | 1 - reference/cfenv/fetestexcept.md | 2 -- reference/cfenv/fexcept_t.md | 2 -- reference/chrono/duration/count.md | 1 - reference/chrono/duration/op_greater.md | 1 - reference/chrono/duration/op_greater_equal.md | 1 - reference/chrono/duration/op_h.md | 2 -- reference/chrono/duration/op_less.md | 1 - reference/chrono/duration/op_less_equal.md | 1 - reference/chrono/duration/op_min.md | 2 -- reference/chrono/duration/op_ms.md | 2 -- reference/chrono/duration/op_ns.md | 2 -- reference/chrono/duration/op_s.md | 2 -- reference/chrono/duration/op_us.md | 1 - reference/chrono/duration_aliases.md | 1 - reference/chrono/file_clock.md | 1 - reference/chrono/format.md | 1 - reference/chrono/gps_time.md | 1 - reference/chrono/hh_mm_ss.md | 1 - reference/chrono/hh_mm_ss/fractional_width.md | 1 - reference/chrono/hh_mm_ss/op_constructor.md | 1 - reference/chrono/hh_mm_ss/op_ostream.md | 1 - reference/chrono/high_resolution_clock.md | 1 - reference/chrono/is_clock.md | 1 - reference/chrono/local-time-format-t.md | 1 - reference/chrono/local-time-format-t/formatter.md | 1 - reference/chrono/local_info/formatter.md | 1 - reference/chrono/month/op_ostream.md | 1 - reference/chrono/month_constants.md | 1 - reference/chrono/month_day/op_ostream.md | 1 - reference/chrono/month_day_last/op_ostream.md | 1 - reference/chrono/month_weekday/op_ostream.md | 1 - reference/chrono/month_weekday_last/op_ostream.md | 1 - reference/chrono/steady_clock.md | 1 - reference/chrono/sys_info.md | 1 - reference/chrono/sys_info/formatter.md | 1 - reference/chrono/tai_time.md | 1 - reference/chrono/time_point/op_constructor.md | 1 - reference/chrono/time_point/op_greater.md | 1 - reference/chrono/time_point/op_greater_equal.md | 1 - reference/chrono/time_point/op_less.md | 1 - reference/chrono/time_point/op_less_equal.md | 1 - reference/chrono/time_point/op_minus.md | 1 - reference/chrono/time_point/op_plus.md | 1 - reference/chrono/time_point/time_since_epoch.md | 1 - reference/chrono/time_point_cast.md | 1 - reference/chrono/time_zone.md | 1 - reference/chrono/time_zone_link.md | 1 - reference/chrono/time_zone_link/name.md | 1 - reference/chrono/time_zone_link/op_equal.md | 1 - reference/chrono/time_zone_link/target.md | 1 - reference/chrono/tzdb.md | 1 - reference/chrono/tzdb_list.md | 1 - reference/chrono/tzdb_list/begin.md | 1 - reference/chrono/tzdb_list/cbegin.md | 1 - reference/chrono/tzdb_list/cend.md | 1 - reference/chrono/tzdb_list/end.md | 1 - reference/chrono/tzdb_list/erase_after.md | 1 - reference/chrono/tzdb_list/front.md | 1 - reference/chrono/utc_time.md | 1 - reference/chrono/weekday/op_ostream.md | 1 - reference/chrono/weekday_constants.md | 1 - reference/chrono/weekday_indexed/index.md | 1 - reference/chrono/weekday_indexed/ok.md | 1 - reference/chrono/weekday_indexed/op_ostream.md | 1 - reference/chrono/weekday_indexed/weekday.md | 1 - reference/chrono/weekday_last/ok.md | 1 - reference/chrono/weekday_last/op_ostream.md | 1 - reference/chrono/weekday_last/weekday.md | 1 - reference/chrono/year_month/op_ostream.md | 1 - reference/chrono/year_month_day_last/op_ostream.md | 1 - reference/chrono/year_month_weekday/op_ostream.md | 1 - reference/chrono/year_month_weekday/op_sys_days.md | 1 - reference/chrono/year_month_weekday_last/op_ostream.md | 1 - reference/chrono/zoned_time/formatter.md | 1 - reference/chrono/zoned_traits.md | 1 - reference/chrono/zoned_traits/default_zone.md | 1 - reference/chrono/zoned_traits/locate_zone.md | 1 - reference/climits.md | 1 - reference/cmath/assoc_legendre.md | 1 - reference/cmath/beta.md | 1 - reference/cmath/huge_val.md | 1 - reference/complex/complex/op_i.md | 1 - reference/complex/complex/op_if.md | 1 - reference/complex/complex/op_il.md | 1 - reference/complex/complex/op_istream.md | 1 - reference/complex/complex/op_ostream.md | 1 - reference/concepts/Callable.md | 1 - reference/concepts/LessThanComparable.md | 1 - reference/concepts/ValueSwappable.md | 1 - reference/concepts/default_initializable.md | 1 - reference/concepts/integral.md | 1 - reference/concepts/move_constructible.md | 3 --- reference/concepts/signed_integral.md | 1 - reference/concepts/swappable.md | 1 - reference/concepts/totally_ordered.md | 1 - reference/concepts/unsigned_integral.md | 1 - reference/condition_variable.md | 2 -- reference/condition_variable/condition_variable.md | 1 - .../condition_variable/condition_variable/native_handle.md | 2 -- .../condition_variable/condition_variable/notify_all.md | 2 -- .../condition_variable/notify_all_at_thread_exit.md | 1 - .../condition_variable/condition_variable/notify_one.md | 2 -- .../condition_variable/condition_variable/op_constructor.md | 2 -- .../condition_variable/condition_variable/op_destructor.md | 2 -- reference/condition_variable/condition_variable/wait.md | 1 - reference/condition_variable/condition_variable/wait_for.md | 2 -- .../condition_variable/condition_variable/wait_until.md | 1 - reference/condition_variable/condition_variable_any.md | 1 - .../condition_variable/condition_variable_any/notify_all.md | 2 -- .../condition_variable/condition_variable_any/notify_one.md | 2 -- .../condition_variable_any/op_constructor.md | 1 - .../condition_variable_any/op_destructor.md | 2 -- reference/condition_variable/cv_status.md | 2 -- reference/contracts/detection_mode.md | 1 - reference/cstddef.md | 2 -- reference/cstddef/offsetof.md | 2 -- reference/cstdint.md | 1 - reference/cstdint/int16_max.md | 1 - reference/cstdint/int16_min.md | 1 - reference/cstdint/int32_max.md | 1 - reference/cstdint/int32_min.md | 1 - reference/cstdint/int64_max.md | 1 - reference/cstdint/int64_min.md | 1 - reference/cstdint/int8_max.md | 1 - reference/cstdint/int8_min.md | 1 - reference/cstdint/intptr_max.md | 1 - reference/cstdint/intptr_min.md | 1 - reference/cstdint/sig_atomic_max.md | 1 - reference/cstdint/sig_atomic_min.md | 1 - reference/cstdint/size_max.md | 1 - reference/cstdint/uint16_max.md | 1 - reference/cstdint/uint32_max.md | 1 - reference/cstdint/uint64_max.md | 1 - reference/cstdint/uint8_max.md | 1 - reference/cstdint/uintptr_max.md | 1 - reference/cstdint/wchar_max.md | 1 - reference/cstdint/wchar_min.md | 1 - reference/cstdint/wint_max.md | 1 - reference/cstdint/wint_min.md | 1 - reference/cstdio/eof.md | 1 - reference/cstdio/tmpfile.md | 2 -- reference/cstdio/tmpnam.md | 1 - reference/cstdlib.md | 2 -- reference/cstdlib/abort.md | 2 -- reference/cstdlib/at_quick_exit.md | 1 - reference/cstdlib/atexit.md | 2 -- reference/cstdlib/div_t.md | 1 - reference/cstdlib/exit.md | 2 -- reference/cstdlib/exit_.md | 1 - reference/cstdlib/exit_failure.md | 2 -- reference/cstdlib/exit_success.md | 2 -- reference/cstdlib/getenv.md | 1 - reference/cstdlib/ldiv_t.md | 1 - reference/cstdlib/lldiv_t.md | 1 - reference/cstdlib/quick_exit.md | 1 - reference/deque/deque.md | 1 - reference/deque/deque/assign.md | 2 -- reference/deque/deque/at.md | 2 -- reference/deque/deque/back.md | 2 -- reference/deque/deque/begin.md | 2 -- reference/deque/deque/cbegin.md | 2 -- reference/deque/deque/cend.md | 2 -- reference/deque/deque/clear.md | 2 -- reference/deque/deque/crbegin.md | 2 -- reference/deque/deque/crend.md | 2 -- reference/deque/deque/emplace.md | 2 -- reference/deque/deque/end.md | 2 -- reference/deque/deque/erase.md | 1 - reference/deque/deque/front.md | 2 -- reference/deque/deque/get_allocator.md | 2 -- reference/deque/deque/insert.md | 1 - reference/deque/deque/max_size.md | 2 -- reference/deque/deque/op_assign.md | 1 - reference/deque/deque/op_at.md | 2 -- reference/deque/deque/op_deduction_guide.md | 1 - reference/deque/deque/pop_back.md | 2 -- reference/deque/deque/pop_front.md | 2 -- reference/deque/deque/push_back.md | 1 - reference/deque/deque/push_front.md | 1 - reference/deque/deque/rbegin.md | 2 -- reference/deque/deque/rend.md | 2 -- reference/deque/deque/resize.md | 2 -- reference/deque/deque/size.md | 2 -- reference/exception.md | 1 - reference/exception/bad_exception/op_assign.md | 1 - reference/exception/bad_exception/op_constructor.md | 1 - reference/exception/bad_exception/op_destructor.md | 1 - reference/exception/bad_exception/what.md | 1 - reference/exception/current_exception.md | 1 - reference/exception/exception/op_assign.md | 1 - reference/exception/exception/op_constructor.md | 1 - reference/exception/exception/op_destructor.md | 1 - reference/exception/exception/what.md | 1 - reference/exception/exception_ptr.md | 1 - reference/exception/get_terminate.md | 2 -- reference/exception/nested_exception.md | 1 - reference/exception/nested_exception/nested_ptr.md | 1 - reference/exception/nested_exception/op_assign.md | 1 - reference/exception/nested_exception/op_constructor.md | 1 - reference/exception/nested_exception/op_destructor.md | 1 - reference/exception/nested_exception/rethrow_nested.md | 1 - reference/exception/set_terminate.md | 2 -- reference/execution/execution/with_awaitable_senders.md | 2 -- reference/filesystem/path/append.md | 1 - reference/filesystem/path/op_append_assign.md | 1 - reference/flat_map/flat_map/begin.md | 2 -- reference/flat_map/flat_map/cbegin.md | 1 - reference/flat_map/flat_map/cend.md | 1 - reference/flat_map/flat_map/emplace.md | 1 - reference/flat_map/flat_map/emplace_hint.md | 1 - reference/flat_map/flat_map/empty.md | 1 - reference/flat_map/flat_map/equal_range.md | 1 - reference/flat_map/flat_map/erase.md | 1 - reference/flat_map/flat_map/erase_if_free.md | 1 - reference/flat_map/flat_map/find.md | 1 - reference/flat_map/flat_map/insert.md | 1 - reference/flat_map/flat_map/insert_or_assign.md | 1 - reference/flat_map/flat_map/insert_range.md | 1 - reference/flat_map/flat_map/key_equiv.md | 1 - reference/flat_map/flat_map/lower_bound.md | 1 - reference/flat_map/flat_map/max_size.md | 1 - reference/flat_map/flat_map/op_compare_3way.md | 1 - reference/flat_map/flat_map/op_equal.md | 1 - reference/flat_map/flat_map/rbegin.md | 1 - reference/flat_map/flat_map/rend.md | 1 - reference/flat_map/flat_map/swap.md | 1 - reference/flat_map/flat_map/try_emplace.md | 1 - reference/flat_map/flat_map/upper_bound.md | 1 - reference/flat_map/flat_multimap/cbegin.md | 1 - reference/flat_map/flat_multimap/cend.md | 1 - reference/flat_map/flat_multimap/empty.md | 1 - reference/flat_map/flat_multimap/equal_range.md | 1 - reference/flat_map/flat_multimap/erase.md | 1 - reference/flat_map/flat_multimap/erase_if_free.md | 1 - reference/flat_map/flat_multimap/key_equiv.md | 1 - reference/flat_map/flat_multimap/lower_bound.md | 1 - reference/flat_map/flat_multimap/max_size.md | 1 - reference/flat_map/flat_multimap/op_compare_3way.md | 1 - reference/flat_map/flat_multimap/op_equal.md | 1 - reference/flat_map/flat_multimap/rbegin.md | 1 - reference/flat_map/flat_multimap/rend.md | 1 - reference/flat_map/flat_multimap/swap.md | 1 - reference/flat_map/flat_multimap/upper_bound.md | 1 - reference/flat_map/sorted_equivalent_t.md | 1 - reference/flat_map/sorted_unique_t.md | 1 - reference/flat_set/flat_multiset/cend.md | 1 - reference/flat_set/flat_multiset/rbegin.md | 1 - reference/flat_set/flat_set/cend.md | 1 - reference/flat_set/flat_set/rbegin.md | 1 - reference/flat_set/sorted_equivalent_t.md | 1 - reference/flat_set/sorted_unique_t.md | 1 - reference/format/format_error/op_destructor.md | 1 - reference/format/format_to.md | 1 - reference/format/formatter/format.md | 1 - reference/format/formatter/parse.md | 1 - reference/format/range_formatter/format.md | 1 - reference/format/range_formatter/parse.md | 1 - reference/format/range_formatter/underlying.md | 1 - reference/forward_list/forward_list/assign.md | 2 -- reference/forward_list/forward_list/before_begin.md | 2 -- reference/forward_list/forward_list/begin.md | 2 -- reference/forward_list/forward_list/cbefore_begin.md | 2 -- reference/forward_list/forward_list/cbegin.md | 2 -- reference/forward_list/forward_list/cend.md | 2 -- reference/forward_list/forward_list/clear.md | 2 -- reference/forward_list/forward_list/emplace_after.md | 2 -- reference/forward_list/forward_list/end.md | 2 -- reference/forward_list/forward_list/erase_after.md | 2 -- reference/forward_list/forward_list/front.md | 2 -- reference/forward_list/forward_list/get_allocator.md | 2 -- reference/forward_list/forward_list/insert_after.md | 2 -- reference/forward_list/forward_list/max_size.md | 2 -- reference/forward_list/forward_list/merge.md | 1 - reference/forward_list/forward_list/op_compare_3way.md | 1 - reference/forward_list/forward_list/op_deduction_guide.md | 1 - reference/forward_list/forward_list/op_destructor.md | 2 -- reference/forward_list/forward_list/op_equal.md | 1 - reference/forward_list/forward_list/pop_front.md | 2 -- reference/forward_list/forward_list/push_front.md | 2 -- reference/forward_list/forward_list/resize.md | 2 -- reference/forward_list/forward_list/reverse.md | 2 -- reference/forward_list/forward_list/sort.md | 2 -- reference/fstream/basic_ifstream.md | 1 - reference/fstream/basic_ofstream.md | 1 - reference/functional/bad_function_call.md | 1 - reference/functional/copyable_function/swap.md | 1 - reference/functional/function/op_assign.md | 1 - reference/functional/function/op_bool.md | 1 - reference/functional/function/op_call.md | 1 - reference/functional/function/op_destructor.md | 1 - reference/functional/function/swap.md | 1 - reference/functional/function/swap_free.md | 1 - reference/functional/function/target.md | 1 - reference/functional/function/target_type.md | 1 - reference/functional/move_only_function/swap.md | 1 - reference/functional/reference_wrapper/get.md | 2 -- reference/functional/reference_wrapper/op_assign.md | 2 -- reference/functional/reference_wrapper/op_cast_ref_t.md | 2 -- reference/future.md | 1 - reference/future/future.md | 1 - reference/future/future/get.md | 1 - reference/future/future/op_assign.md | 2 -- reference/future/future/op_constructor.md | 2 -- reference/future/future/op_destructor.md | 2 -- reference/future/future/valid.md | 2 -- reference/future/future/wait.md | 2 -- reference/future/future/wait_for.md | 1 - reference/future/future/wait_until.md | 2 -- reference/future/future_category.md | 2 -- reference/future/future_errc.md | 1 - reference/future/future_error.md | 1 - reference/future/future_status.md | 2 -- reference/future/is_error_code_enum.md | 2 -- reference/future/launch.md | 1 - reference/future/make_error_code.md | 2 -- reference/future/make_error_condition.md | 2 -- reference/future/packaged_task.md | 1 - reference/future/packaged_task/get_future.md | 1 - reference/future/packaged_task/make_ready_at_thread_exit.md | 1 - reference/future/packaged_task/op_assign.md | 2 -- reference/future/packaged_task/op_call.md | 2 -- reference/future/packaged_task/op_deduction_guide.md | 1 - reference/future/packaged_task/op_destructor.md | 2 -- reference/future/packaged_task/reset.md | 2 -- reference/future/packaged_task/swap.md | 2 -- reference/future/packaged_task/swap_free.md | 2 -- reference/future/packaged_task/uses_allocator.md | 2 -- reference/future/packaged_task/valid.md | 2 -- reference/future/promise.md | 1 - reference/future/promise/get_future.md | 1 - reference/future/promise/op_assign.md | 2 -- reference/future/promise/op_constructor.md | 2 -- reference/future/promise/op_destructor.md | 2 -- reference/future/promise/set_exception.md | 2 -- reference/future/promise/set_exception_at_thread_exit.md | 2 -- reference/future/promise/set_value.md | 1 - reference/future/promise/set_value_at_thread_exit.md | 2 -- reference/future/promise/swap.md | 2 -- reference/future/promise/swap_free.md | 2 -- reference/future/promise/uses_allocator.md | 2 -- reference/future/shared_future.md | 1 - reference/future/shared_future/get.md | 2 -- reference/future/shared_future/op_assign.md | 2 -- reference/future/shared_future/op_constructor.md | 2 -- reference/future/shared_future/op_destructor.md | 1 - reference/future/shared_future/valid.md | 2 -- reference/future/shared_future/wait.md | 2 -- reference/future/shared_future/wait_for.md | 2 -- reference/future/shared_future/wait_until.md | 2 -- reference/initializer_list/initializer_list.md | 1 - reference/initializer_list/initializer_list/begin.md | 1 - reference/initializer_list/initializer_list/begin_free.md | 1 - reference/initializer_list/initializer_list/end.md | 1 - reference/initializer_list/initializer_list/end_free.md | 1 - .../initializer_list/initializer_list/op_constructor.md | 1 - reference/initializer_list/initializer_list/size.md | 1 - reference/iomanip.md | 2 -- reference/iomanip/put_time.md | 2 -- reference/iomanip/resetiosflags.md | 1 - reference/iomanip/setbase.md | 2 -- reference/iomanip/setfill.md | 1 - reference/iomanip/setiosflags.md | 1 - reference/iomanip/setprecision.md | 1 - reference/iomanip/setw.md | 1 - reference/ios/hexfloat.md | 1 - reference/ios/ios_base/xalloc.md | 1 - reference/ios/iostream_category.md | 1 - reference/ios/is_error_code_enum.md | 2 -- reference/ios/make_error_code.md | 1 - reference/ios/make_error_condition.md | 1 - reference/iterator/back_insert_iterator.md | 1 - reference/iterator/cbegin.md | 1 - reference/iterator/cend.md | 1 - reference/iterator/common_iterator/op_assign.md | 1 - reference/iterator/counted_iterator/op_assign.md | 1 - reference/iterator/crbegin.md | 1 - reference/iterator/crend.md | 1 - reference/iterator/front_insert_iterator/op_constructor.md | 1 - reference/iterator/incrementable.md | 1 - reference/iterator/istream_iterator.md | 2 -- reference/iterator/istream_iterator/op_arrow.md | 2 -- reference/iterator/istream_iterator/op_deref.md | 2 -- reference/iterator/istream_iterator/op_equal.md | 2 -- reference/iterator/istream_iterator/op_increment.md | 2 -- reference/iterator/istreambuf_iterator.md | 1 - reference/iterator/istreambuf_iterator/equal.md | 2 -- reference/iterator/istreambuf_iterator/op_arrow.md | 2 -- reference/iterator/istreambuf_iterator/op_constructor.md | 2 -- reference/iterator/istreambuf_iterator/op_deref.md | 2 -- reference/iterator/istreambuf_iterator/op_equal.md | 2 -- reference/iterator/istreambuf_iterator/op_increment.md | 2 -- reference/iterator/iterator_tag.md | 1 - reference/iterator/ostream_iterator.md | 1 - reference/iterator/sentinel_for.md | 1 - reference/limits.md | 1 - reference/limits/float_round_style.md | 2 -- reference/limits/numeric_limits/digits.md | 2 -- reference/limits/numeric_limits/digits10.md | 1 - reference/limits/numeric_limits/epsilon.md | 1 - reference/limits/numeric_limits/has_infinity.md | 2 -- reference/limits/numeric_limits/has_quiet_nan.md | 2 -- reference/limits/numeric_limits/has_signaling_nan.md | 2 -- reference/limits/numeric_limits/infinity.md | 2 -- reference/limits/numeric_limits/is_bounded.md | 2 -- reference/limits/numeric_limits/is_exact.md | 2 -- reference/limits/numeric_limits/is_iec559.md | 2 -- reference/limits/numeric_limits/is_integer.md | 2 -- reference/limits/numeric_limits/is_signed.md | 2 -- reference/limits/numeric_limits/lowest.md | 1 - reference/limits/numeric_limits/max_digits10.md | 2 -- reference/limits/numeric_limits/max_exponent.md | 2 -- reference/limits/numeric_limits/max_exponent10.md | 1 - reference/limits/numeric_limits/min_exponent.md | 1 - reference/limits/numeric_limits/min_exponent10.md | 1 - reference/limits/numeric_limits/quiet_nan.md | 1 - reference/limits/numeric_limits/radix.md | 2 -- reference/limits/numeric_limits/round_error.md | 2 -- reference/limits/numeric_limits/round_style.md | 2 -- reference/limits/numeric_limits/signaling_nan.md | 1 - reference/limits/numeric_limits/tinyness_before.md | 2 -- reference/limits/numeric_limits/traps.md | 2 -- reference/linalg/abs-if-needed.md | 1 - reference/linalg/add.md | 1 - reference/linalg/addable.md | 2 -- reference/linalg/dotc.md | 1 - reference/linalg/explicit_diagonal_t.md | 1 - reference/linalg/hermitian_matrix_rank_1_update.md | 1 - reference/linalg/hermitian_matrix_rank_2k_update.md | 1 - reference/linalg/hermitian_matrix_rank_k_update.md | 1 - reference/linalg/hermitian_matrix_vector_product.md | 1 - reference/linalg/imag-if-needed.md | 1 - reference/linalg/implicit_unit_diagonal_t.md | 1 - reference/linalg/is-mdspan.md | 1 - reference/linalg/lower_triangle_t.md | 1 - reference/linalg/matrix_frob_norm.md | 1 - reference/linalg/matrix_inf_norm.md | 1 - reference/linalg/matrix_one_norm.md | 1 - reference/linalg/matrix_rank_1_update.md | 1 - reference/linalg/matrix_rank_1_update_c.md | 1 - reference/linalg/matrix_vector_product.md | 1 - reference/linalg/multipliable.md | 2 -- reference/linalg/possibly-addable.md | 1 - reference/linalg/possibly-multipliable.md | 2 -- reference/linalg/real-if-needed.md | 1 - reference/linalg/scale.md | 1 - reference/linalg/swap_elements.md | 1 - reference/linalg/symmetric_matrix_rank_1_update.md | 1 - reference/linalg/symmetric_matrix_rank_2_update.md | 1 - reference/linalg/symmetric_matrix_rank_2k_update.md | 1 - reference/linalg/symmetric_matrix_rank_k_update.md | 1 - reference/linalg/symmetric_matrix_vector_product.md | 1 - reference/linalg/triangular_matrix_matrix_left_solve.md | 1 - reference/linalg/triangular_matrix_matrix_right_solve.md | 1 - reference/linalg/triangular_matrix_vector_product.md | 2 -- reference/linalg/upper_triangle_t.md | 1 - reference/linalg/vector_abs_sum.md | 1 - reference/linalg/vector_idx_abs_max.md | 2 -- reference/linalg/vector_two_norm.md | 1 - reference/list/list.md | 2 -- reference/list/list/assign.md | 1 - reference/list/list/back.md | 1 - reference/list/list/begin.md | 2 -- reference/list/list/cbegin.md | 2 -- reference/list/list/cend.md | 2 -- reference/list/list/clear.md | 1 - reference/list/list/crbegin.md | 2 -- reference/list/list/crend.md | 2 -- reference/list/list/emplace.md | 2 -- reference/list/list/end.md | 2 -- reference/list/list/front.md | 2 -- reference/list/list/insert.md | 1 - reference/list/list/max_size.md | 1 - reference/list/list/merge.md | 2 -- reference/list/list/op_deduction_guide.md | 1 - reference/list/list/op_destructor.md | 2 -- reference/list/list/pop_back.md | 2 -- reference/list/list/pop_front.md | 2 -- reference/list/list/push_back.md | 1 - reference/list/list/push_front.md | 2 -- reference/list/list/rbegin.md | 2 -- reference/list/list/rend.md | 2 -- reference/list/list/resize.md | 2 -- reference/list/list/reverse.md | 2 -- reference/list/list/size.md | 1 - reference/list/list/sort.md | 2 -- reference/locale.md | 3 --- reference/locale/locale/op_equal.md | 1 - reference/locale/numpunct.md | 1 - reference/locale/tolower.md | 2 -- reference/locale/toupper.md | 2 -- reference/map/map/begin.md | 2 -- reference/map/map/cbegin.md | 5 ----- reference/map/map/cend.md | 3 --- reference/map/map/clear.md | 3 --- reference/map/map/count.md | 1 - reference/map/map/emplace.md | 1 - reference/map/map/equal_range.md | 1 - reference/map/map/erase.md | 1 - reference/map/map/find.md | 1 - reference/map/map/insert.md | 1 - reference/map/map/lower_bound.md | 1 - reference/map/map/max_size.md | 2 -- reference/map/map/op_destructor.md | 2 -- reference/map/map/rbegin.md | 1 - reference/map/map/rend.md | 1 - reference/map/map/size.md | 2 -- reference/map/map/upper_bound.md | 1 - reference/map/multimap/begin.md | 2 -- reference/map/multimap/cbegin.md | 1 - reference/map/multimap/cend.md | 3 --- reference/map/multimap/clear.md | 3 --- reference/map/multimap/count.md | 1 - reference/map/multimap/crend.md | 1 - reference/map/multimap/emplace.md | 1 - reference/map/multimap/emplace_hint.md | 1 - reference/map/multimap/equal_range.md | 1 - reference/map/multimap/find.md | 1 - reference/map/multimap/key_comp.md | 2 -- reference/map/multimap/lower_bound.md | 1 - reference/map/multimap/max_size.md | 2 -- reference/map/multimap/op_destructor.md | 2 -- reference/map/multimap/rbegin.md | 1 - reference/map/multimap/rend.md | 1 - reference/map/multimap/size.md | 2 -- reference/map/multimap/upper_bound.md | 1 - reference/map/multimap/value_comp.md | 2 -- reference/memory/align.md | 1 - reference/memory/allocator_arg_t.md | 1 - reference/memory/bad_weak_ptr.md | 1 - reference/memory/enable_shared_from_this.md | 1 - reference/memory/pointer_traits.md | 1 - reference/memory/shared_ptr/get_deleter.md | 1 - reference/memory/shared_ptr/op_deduction_guide.md | 1 - reference/memory/shared_ptr/op_destructor.md | 1 - reference/memory/shared_ptr/op_ostream.md | 1 - reference/memory/unique_ptr.md | 1 - reference/memory/weak_ptr.md | 1 - reference/memory/weak_ptr/lock.md | 1 - reference/memory/weak_ptr/op_deduction_guide.md | 1 - .../memory_resource/polymorphic_allocator/delete_object.md | 1 - reference/mutex/call_once.md | 1 - reference/mutex/lock.md | 2 -- reference/mutex/lock_guard/op_constructor.md | 2 -- reference/mutex/lock_guard/op_destructor.md | 2 -- reference/mutex/mutex.md | 1 - reference/mutex/mutex/native_handle.md | 2 -- reference/mutex/mutex/op_constructor.md | 1 - reference/mutex/mutex/op_destructor.md | 2 -- reference/mutex/mutex/try_lock.md | 2 -- reference/mutex/mutex/unlock.md | 2 -- reference/mutex/once_flag.md | 1 - reference/mutex/once_flag/op_constructor.md | 2 -- reference/mutex/recursive_mutex.md | 1 - reference/mutex/recursive_mutex/native_handle.md | 2 -- reference/mutex/recursive_mutex/op_constructor.md | 2 -- reference/mutex/recursive_mutex/op_destructor.md | 2 -- reference/mutex/recursive_mutex/try_lock.md | 2 -- reference/mutex/recursive_mutex/unlock.md | 2 -- reference/mutex/recursive_timed_mutex.md | 1 - reference/mutex/recursive_timed_mutex/native_handle.md | 2 -- reference/mutex/recursive_timed_mutex/op_constructor.md | 2 -- reference/mutex/recursive_timed_mutex/op_destructor.md | 2 -- reference/mutex/recursive_timed_mutex/try_lock.md | 2 -- reference/mutex/recursive_timed_mutex/try_lock_for.md | 2 -- reference/mutex/recursive_timed_mutex/try_lock_until.md | 2 -- reference/mutex/recursive_timed_mutex/unlock.md | 2 -- reference/mutex/timed_mutex/native_handle.md | 2 -- reference/mutex/timed_mutex/op_constructor.md | 2 -- reference/mutex/timed_mutex/op_destructor.md | 2 -- reference/mutex/timed_mutex/try_lock.md | 2 -- reference/mutex/timed_mutex/try_lock_until.md | 2 -- reference/mutex/timed_mutex/unlock.md | 2 -- reference/mutex/try_lock.md | 2 -- reference/mutex/unique_lock.md | 1 - reference/mutex/unique_lock/lock.md | 2 -- reference/mutex/unique_lock/mutex.md | 2 -- reference/mutex/unique_lock/op_bool.md | 2 -- reference/mutex/unique_lock/op_constructor.md | 2 -- reference/mutex/unique_lock/op_destructor.md | 2 -- reference/mutex/unique_lock/owns_lock.md | 2 -- reference/mutex/unique_lock/release.md | 1 - reference/mutex/unique_lock/swap.md | 2 -- reference/mutex/unique_lock/swap_free.md | 2 -- reference/mutex/unique_lock/try_lock.md | 2 -- reference/mutex/unique_lock/try_lock_for.md | 2 -- reference/mutex/unique_lock/try_lock_until.md | 2 -- reference/mutex/unique_lock/unlock.md | 2 -- reference/new.md | 1 - reference/new/bad_alloc.md | 1 - reference/new/bad_alloc/op_assign.md | 1 - reference/new/bad_alloc/op_constructor.md | 1 - reference/new/bad_alloc/op_destructor.md | 1 - reference/new/bad_alloc/what.md | 1 - reference/new/bad_array_new_length/op_assign.md | 1 - reference/new/bad_array_new_length/op_constructor.md | 1 - reference/new/bad_array_new_length/op_destructor.md | 1 - reference/new/bad_array_new_length/what.md | 1 - reference/new/get_new_handler.md | 1 - reference/new/new_handler.md | 2 -- reference/new/set_new_handler.md | 1 - reference/node_handle.md | 2 -- reference/node_handle/node_handle.md | 1 - reference/numeric.md | 1 - reference/numeric/gcd.md | 1 - reference/numeric/lcm.md | 1 - reference/optional/bad_optional_access/op_destructor.md | 1 - reference/ostream.md | 1 - reference/queue/priority_queue/emplace.md | 2 -- reference/queue/priority_queue/op_deduction_guide.md | 1 - reference/queue/priority_queue/pop.md | 2 -- reference/queue/priority_queue/push.md | 2 -- reference/queue/priority_queue/size.md | 2 -- reference/queue/priority_queue/swap.md | 2 -- reference/queue/priority_queue/top.md | 2 -- reference/queue/queue.md | 2 -- reference/queue/queue/back.md | 2 -- reference/queue/queue/front.md | 1 - reference/queue/queue/op_equal.md | 2 -- reference/queue/queue/op_greater.md | 2 -- reference/queue/queue/op_greater_equal.md | 2 -- reference/queue/queue/op_less.md | 2 -- reference/queue/queue/op_less_equal.md | 2 -- reference/queue/queue/op_not_equal.md | 2 -- reference/queue/queue/pop.md | 1 - reference/queue/queue/push.md | 1 - reference/queue/queue/size.md | 2 -- reference/queue/queue/swap.md | 1 - reference/random/bernoulli_distribution.md | 1 - reference/random/bernoulli_distribution/max.md | 2 -- reference/random/bernoulli_distribution/min.md | 2 -- reference/random/bernoulli_distribution/op_equal.md | 2 -- reference/random/bernoulli_distribution/op_istream.md | 2 -- reference/random/bernoulli_distribution/op_not_equal.md | 2 -- reference/random/bernoulli_distribution/op_ostream.md | 2 -- reference/random/bernoulli_distribution/p.md | 2 -- reference/random/bernoulli_distribution/param.md | 2 -- reference/random/bernoulli_distribution/reset.md | 2 -- reference/random/binomial_distribution.md | 1 - reference/random/binomial_distribution/max.md | 2 -- reference/random/binomial_distribution/min.md | 2 -- reference/random/binomial_distribution/op_equal.md | 2 -- reference/random/binomial_distribution/op_istream.md | 2 -- reference/random/binomial_distribution/op_not_equal.md | 2 -- reference/random/binomial_distribution/op_ostream.md | 2 -- reference/random/binomial_distribution/p.md | 2 -- reference/random/binomial_distribution/param.md | 2 -- reference/random/binomial_distribution/reset.md | 2 -- reference/random/binomial_distribution/t.md | 2 -- reference/random/cauchy_distribution.md | 1 - reference/random/cauchy_distribution/a.md | 2 -- reference/random/cauchy_distribution/b.md | 2 -- reference/random/cauchy_distribution/max.md | 2 -- reference/random/cauchy_distribution/min.md | 2 -- reference/random/cauchy_distribution/op_equal.md | 2 -- reference/random/cauchy_distribution/op_istream.md | 2 -- reference/random/cauchy_distribution/op_not_equal.md | 2 -- reference/random/cauchy_distribution/op_ostream.md | 2 -- reference/random/cauchy_distribution/param.md | 2 -- reference/random/cauchy_distribution/reset.md | 2 -- reference/random/chi_squared_distribution.md | 1 - reference/random/chi_squared_distribution/max.md | 2 -- reference/random/chi_squared_distribution/min.md | 2 -- reference/random/chi_squared_distribution/n.md | 2 -- reference/random/chi_squared_distribution/op_equal.md | 2 -- reference/random/chi_squared_distribution/op_istream.md | 2 -- reference/random/chi_squared_distribution/op_not_equal.md | 2 -- reference/random/chi_squared_distribution/op_ostream.md | 2 -- reference/random/chi_squared_distribution/param.md | 2 -- reference/random/chi_squared_distribution/reset.md | 2 -- reference/random/default_random_engine.md | 1 - reference/random/discard_block_engine.md | 1 - reference/random/discard_block_engine/base.md | 2 -- reference/random/discard_block_engine/discard.md | 2 -- reference/random/discard_block_engine/max.md | 2 -- reference/random/discard_block_engine/min.md | 2 -- reference/random/discard_block_engine/op_call.md | 2 -- reference/random/discard_block_engine/op_constructor.md | 2 -- reference/random/discard_block_engine/op_equal.md | 2 -- reference/random/discard_block_engine/op_istream.md | 2 -- reference/random/discard_block_engine/op_not_equal.md | 2 -- reference/random/discard_block_engine/op_ostream.md | 2 -- reference/random/discard_block_engine/seed.md | 2 -- reference/random/discrete_distribution.md | 1 - reference/random/discrete_distribution/max.md | 2 -- reference/random/discrete_distribution/min.md | 2 -- reference/random/discrete_distribution/op_constructor.md | 2 -- reference/random/discrete_distribution/op_equal.md | 2 -- reference/random/discrete_distribution/op_istream.md | 2 -- reference/random/discrete_distribution/op_not_equal.md | 2 -- reference/random/discrete_distribution/op_ostream.md | 2 -- reference/random/discrete_distribution/param.md | 2 -- reference/random/discrete_distribution/probabilities.md | 2 -- reference/random/discrete_distribution/reset.md | 2 -- reference/random/exponential_distribution.md | 1 - reference/random/exponential_distribution/lambda.md | 2 -- reference/random/exponential_distribution/max.md | 2 -- reference/random/exponential_distribution/min.md | 2 -- reference/random/exponential_distribution/op_equal.md | 2 -- reference/random/exponential_distribution/op_istream.md | 2 -- reference/random/exponential_distribution/op_not_equal.md | 2 -- reference/random/exponential_distribution/op_ostream.md | 2 -- reference/random/exponential_distribution/param.md | 2 -- reference/random/exponential_distribution/reset.md | 2 -- reference/random/extreme_value_distribution.md | 1 - reference/random/extreme_value_distribution/a.md | 2 -- reference/random/extreme_value_distribution/b.md | 2 -- reference/random/extreme_value_distribution/max.md | 2 -- reference/random/extreme_value_distribution/min.md | 2 -- reference/random/extreme_value_distribution/op_equal.md | 2 -- reference/random/extreme_value_distribution/op_istream.md | 2 -- reference/random/extreme_value_distribution/op_not_equal.md | 2 -- reference/random/extreme_value_distribution/op_ostream.md | 2 -- reference/random/extreme_value_distribution/param.md | 2 -- reference/random/extreme_value_distribution/reset.md | 2 -- reference/random/fisher_f_distribution.md | 1 - reference/random/fisher_f_distribution/m.md | 2 -- reference/random/fisher_f_distribution/max.md | 2 -- reference/random/fisher_f_distribution/min.md | 2 -- reference/random/fisher_f_distribution/n.md | 2 -- reference/random/fisher_f_distribution/op_equal.md | 2 -- reference/random/fisher_f_distribution/op_istream.md | 2 -- reference/random/fisher_f_distribution/op_not_equal.md | 2 -- reference/random/fisher_f_distribution/op_ostream.md | 2 -- reference/random/fisher_f_distribution/param.md | 2 -- reference/random/fisher_f_distribution/reset.md | 2 -- reference/random/gamma_distribution.md | 1 - reference/random/gamma_distribution/alpha.md | 2 -- reference/random/gamma_distribution/beta.md | 2 -- reference/random/gamma_distribution/max.md | 2 -- reference/random/gamma_distribution/min.md | 2 -- reference/random/gamma_distribution/op_equal.md | 2 -- reference/random/gamma_distribution/op_istream.md | 2 -- reference/random/gamma_distribution/op_not_equal.md | 2 -- reference/random/gamma_distribution/op_ostream.md | 2 -- reference/random/gamma_distribution/param.md | 2 -- reference/random/gamma_distribution/reset.md | 2 -- reference/random/geometric_distribution.md | 1 - reference/random/geometric_distribution/max.md | 2 -- reference/random/geometric_distribution/min.md | 2 -- reference/random/geometric_distribution/op_equal.md | 2 -- reference/random/geometric_distribution/op_istream.md | 2 -- reference/random/geometric_distribution/op_not_equal.md | 2 -- reference/random/geometric_distribution/op_ostream.md | 2 -- reference/random/geometric_distribution/p.md | 2 -- reference/random/geometric_distribution/param.md | 2 -- reference/random/geometric_distribution/reset.md | 2 -- reference/random/independent_bits_engine.md | 1 - reference/random/independent_bits_engine/base.md | 2 -- reference/random/independent_bits_engine/discard.md | 2 -- reference/random/independent_bits_engine/max.md | 2 -- reference/random/independent_bits_engine/min.md | 2 -- reference/random/independent_bits_engine/op_call.md | 2 -- reference/random/independent_bits_engine/op_constructor.md | 2 -- reference/random/independent_bits_engine/op_equal.md | 2 -- reference/random/independent_bits_engine/op_istream.md | 2 -- reference/random/independent_bits_engine/op_not_equal.md | 2 -- reference/random/independent_bits_engine/op_ostream.md | 2 -- reference/random/independent_bits_engine/seed.md | 2 -- reference/random/knuth_b.md | 1 - reference/random/linear_congruential_engine/discard.md | 2 -- reference/random/linear_congruential_engine/max.md | 2 -- reference/random/linear_congruential_engine/min.md | 2 -- reference/random/linear_congruential_engine/op_call.md | 2 -- reference/random/linear_congruential_engine/op_equal.md | 2 -- reference/random/linear_congruential_engine/op_istream.md | 2 -- reference/random/linear_congruential_engine/op_not_equal.md | 2 -- reference/random/linear_congruential_engine/op_ostream.md | 2 -- reference/random/linear_congruential_engine/seed.md | 2 -- reference/random/lognormal_distribution/m.md | 2 -- reference/random/lognormal_distribution/max.md | 2 -- reference/random/lognormal_distribution/min.md | 2 -- reference/random/lognormal_distribution/op_equal.md | 2 -- reference/random/lognormal_distribution/op_istream.md | 2 -- reference/random/lognormal_distribution/op_not_equal.md | 2 -- reference/random/lognormal_distribution/op_ostream.md | 2 -- reference/random/lognormal_distribution/param.md | 2 -- reference/random/lognormal_distribution/reset.md | 2 -- reference/random/lognormal_distribution/s.md | 2 -- reference/random/mersenne_twister_engine.md | 1 - reference/random/mersenne_twister_engine/discard.md | 2 -- reference/random/mersenne_twister_engine/max.md | 2 -- reference/random/mersenne_twister_engine/min.md | 2 -- reference/random/mersenne_twister_engine/op_call.md | 2 -- reference/random/mersenne_twister_engine/op_equal.md | 2 -- reference/random/mersenne_twister_engine/op_istream.md | 2 -- reference/random/mersenne_twister_engine/op_not_equal.md | 2 -- reference/random/mersenne_twister_engine/op_ostream.md | 2 -- reference/random/mersenne_twister_engine/seed.md | 2 -- reference/random/minstd_rand.md | 1 - reference/random/minstd_rand0.md | 1 - reference/random/mt19937.md | 2 -- reference/random/mt19937_64.md | 2 -- reference/random/negative_binomial_distribution.md | 2 -- reference/random/negative_binomial_distribution/k.md | 2 -- reference/random/negative_binomial_distribution/max.md | 2 -- reference/random/negative_binomial_distribution/min.md | 2 -- reference/random/negative_binomial_distribution/op_equal.md | 2 -- .../random/negative_binomial_distribution/op_istream.md | 2 -- .../random/negative_binomial_distribution/op_not_equal.md | 2 -- .../random/negative_binomial_distribution/op_ostream.md | 2 -- reference/random/negative_binomial_distribution/p.md | 2 -- reference/random/negative_binomial_distribution/param.md | 2 -- reference/random/negative_binomial_distribution/reset.md | 2 -- reference/random/normal_distribution.md | 1 - reference/random/normal_distribution/max.md | 2 -- reference/random/normal_distribution/mean.md | 2 -- reference/random/normal_distribution/min.md | 2 -- reference/random/normal_distribution/op_equal.md | 2 -- reference/random/normal_distribution/op_istream.md | 2 -- reference/random/normal_distribution/op_not_equal.md | 2 -- reference/random/normal_distribution/op_ostream.md | 2 -- reference/random/normal_distribution/param.md | 2 -- reference/random/normal_distribution/reset.md | 2 -- reference/random/normal_distribution/stddev.md | 2 -- reference/random/philox_engine/discard.md | 1 - reference/random/philox_engine/op_equal.md | 1 - reference/random/philox_engine/op_istream.md | 1 - reference/random/philox_engine/op_ostream.md | 1 - reference/random/piecewise_constant_distribution.md | 2 -- .../random/piecewise_constant_distribution/densities.md | 2 -- .../random/piecewise_constant_distribution/intervals.md | 2 -- reference/random/piecewise_constant_distribution/max.md | 2 -- reference/random/piecewise_constant_distribution/min.md | 2 -- .../random/piecewise_constant_distribution/op_constructor.md | 2 -- reference/random/piecewise_constant_distribution/op_equal.md | 2 -- .../random/piecewise_constant_distribution/op_istream.md | 2 -- .../random/piecewise_constant_distribution/op_not_equal.md | 2 -- .../random/piecewise_constant_distribution/op_ostream.md | 2 -- reference/random/piecewise_constant_distribution/param.md | 2 -- reference/random/piecewise_constant_distribution/reset.md | 2 -- reference/random/piecewise_linear_distribution.md | 1 - reference/random/piecewise_linear_distribution/densities.md | 2 -- reference/random/piecewise_linear_distribution/intervals.md | 2 -- reference/random/piecewise_linear_distribution/max.md | 2 -- reference/random/piecewise_linear_distribution/min.md | 2 -- .../random/piecewise_linear_distribution/op_constructor.md | 2 -- reference/random/piecewise_linear_distribution/op_equal.md | 2 -- reference/random/piecewise_linear_distribution/op_istream.md | 2 -- .../random/piecewise_linear_distribution/op_not_equal.md | 2 -- reference/random/piecewise_linear_distribution/op_ostream.md | 2 -- reference/random/piecewise_linear_distribution/param.md | 2 -- reference/random/piecewise_linear_distribution/reset.md | 2 -- reference/random/poisson_distribution.md | 1 - reference/random/poisson_distribution/max.md | 2 -- reference/random/poisson_distribution/mean.md | 2 -- reference/random/poisson_distribution/min.md | 2 -- reference/random/poisson_distribution/op_equal.md | 2 -- reference/random/poisson_distribution/op_istream.md | 2 -- reference/random/poisson_distribution/op_not_equal.md | 2 -- reference/random/poisson_distribution/op_ostream.md | 2 -- reference/random/poisson_distribution/param.md | 2 -- reference/random/poisson_distribution/reset.md | 2 -- reference/random/random_device.md | 1 - reference/random/random_device/max.md | 2 -- reference/random/random_device/min.md | 2 -- reference/random/random_device/op_call.md | 2 -- reference/random/seed_seq.md | 1 - reference/random/seed_seq/generate.md | 2 -- reference/random/seed_seq/op_constructor.md | 1 - reference/random/seed_seq/param.md | 2 -- reference/random/seed_seq/size.md | 2 -- reference/random/shuffle_order_engine.md | 1 - reference/random/shuffle_order_engine/base.md | 2 -- reference/random/shuffle_order_engine/discard.md | 2 -- reference/random/shuffle_order_engine/max.md | 2 -- reference/random/shuffle_order_engine/min.md | 2 -- reference/random/shuffle_order_engine/op_call.md | 2 -- reference/random/shuffle_order_engine/op_constructor.md | 2 -- reference/random/shuffle_order_engine/op_equal.md | 2 -- reference/random/shuffle_order_engine/op_istream.md | 2 -- reference/random/shuffle_order_engine/op_not_equal.md | 2 -- reference/random/shuffle_order_engine/op_ostream.md | 2 -- reference/random/shuffle_order_engine/seed.md | 2 -- reference/random/student_t_distribution.md | 1 - reference/random/student_t_distribution/max.md | 2 -- reference/random/student_t_distribution/min.md | 2 -- reference/random/student_t_distribution/n.md | 2 -- reference/random/student_t_distribution/op_equal.md | 2 -- reference/random/student_t_distribution/op_istream.md | 2 -- reference/random/student_t_distribution/op_not_equal.md | 2 -- reference/random/student_t_distribution/op_ostream.md | 2 -- reference/random/student_t_distribution/param.md | 2 -- reference/random/student_t_distribution/reset.md | 2 -- reference/random/subtract_with_carry_engine/discard.md | 2 -- reference/random/subtract_with_carry_engine/max.md | 2 -- reference/random/subtract_with_carry_engine/min.md | 2 -- reference/random/subtract_with_carry_engine/op_call.md | 2 -- reference/random/subtract_with_carry_engine/op_equal.md | 2 -- reference/random/subtract_with_carry_engine/op_istream.md | 2 -- reference/random/subtract_with_carry_engine/op_not_equal.md | 2 -- reference/random/subtract_with_carry_engine/op_ostream.md | 2 -- reference/random/uniform_int_distribution/a.md | 2 -- reference/random/uniform_int_distribution/b.md | 2 -- reference/random/uniform_int_distribution/max.md | 2 -- reference/random/uniform_int_distribution/min.md | 2 -- reference/random/uniform_int_distribution/op_equal.md | 2 -- reference/random/uniform_int_distribution/op_istream.md | 2 -- reference/random/uniform_int_distribution/op_not_equal.md | 2 -- reference/random/uniform_int_distribution/op_ostream.md | 2 -- reference/random/uniform_int_distribution/param.md | 2 -- reference/random/uniform_int_distribution/reset.md | 2 -- reference/random/uniform_real_distribution.md | 4 ---- reference/random/uniform_real_distribution/a.md | 2 -- reference/random/uniform_real_distribution/b.md | 2 -- reference/random/uniform_real_distribution/max.md | 2 -- reference/random/uniform_real_distribution/min.md | 2 -- reference/random/uniform_real_distribution/op_equal.md | 2 -- reference/random/uniform_real_distribution/op_istream.md | 2 -- reference/random/uniform_real_distribution/op_not_equal.md | 2 -- reference/random/uniform_real_distribution/op_ostream.md | 2 -- reference/random/uniform_real_distribution/param.md | 2 -- reference/random/uniform_real_distribution/reset.md | 2 -- reference/random/weibull_distribution.md | 1 - reference/random/weibull_distribution/a.md | 2 -- reference/random/weibull_distribution/b.md | 2 -- reference/random/weibull_distribution/max.md | 2 -- reference/random/weibull_distribution/min.md | 2 -- reference/random/weibull_distribution/op_equal.md | 2 -- reference/random/weibull_distribution/op_istream.md | 2 -- reference/random/weibull_distribution/op_not_equal.md | 2 -- reference/random/weibull_distribution/op_ostream.md | 2 -- reference/random/weibull_distribution/param.md | 2 -- reference/random/weibull_distribution/reset.md | 2 -- reference/ranges/as_const_view/op_deduction_guide.md | 1 - reference/ranges/iota_view.md | 1 - reference/ranges/iota_view/op_deduction_guide.md | 1 - reference/ranges/simple-view.md | 1 - reference/ranges/subrange/convertible-to-non-slicing.md | 1 - reference/ranges/subrange/op_deduction_guide.md | 1 - reference/ratio/ratio.md | 2 -- reference/ratio/ratio_add.md | 2 -- reference/ratio/ratio_divide.md | 2 -- reference/ratio/ratio_multiply.md | 1 - reference/ratio/ratio_subtract.md | 2 -- reference/regex/basic_regex.md | 1 - reference/regex/basic_regex/assign.md | 1 - reference/regex/basic_regex/op_constructor.md | 1 - reference/regex/basic_regex/op_deduction_guide.md | 1 - reference/regex/regex_constants.md | 1 - reference/regex/regex_constants/error_type.md | 1 - reference/regex/regex_constants/match_flag_type.md | 1 - reference/regex/regex_error.md | 1 - reference/regex/regex_iterator/op_equal.md | 1 - reference/regex/regex_traits.md | 1 - reference/regex/regex_traits/getloc.md | 1 - reference/regex/regex_traits/imbue.md | 1 - reference/regex/regex_traits/isctype.md | 2 -- reference/regex/regex_traits/length.md | 1 - reference/regex/regex_traits/lookup_classname.md | 1 - reference/regex/regex_traits/lookup_collatename.md | 1 - reference/regex/regex_traits/op_constructor.md | 1 - reference/regex/regex_traits/transform_primary.md | 1 - reference/regex/regex_traits/translate.md | 1 - reference/regex/regex_traits/translate_nocase.md | 1 - reference/regex/regex_traits/value.md | 1 - reference/scoped_allocator.md | 1 - .../scoped_allocator_adaptor/op_deduction_guide.md | 1 - reference/set/multiset.md | 1 - reference/set/multiset/cbegin.md | 1 - reference/set/multiset/cend.md | 1 - reference/set/multiset/crbegin.md | 1 - reference/set/multiset/crend.md | 1 - reference/set/multiset/emplace.md | 1 - reference/set/multiset/emplace_hint.md | 1 - reference/set/multiset/end.md | 1 - reference/set/multiset/equal_range.md | 1 - reference/set/multiset/lower_bound.md | 1 - reference/set/multiset/op_constructor.md | 1 - reference/set/multiset/op_deduction_guide.md | 1 - reference/set/multiset/op_destructor.md | 2 -- reference/set/multiset/rbegin.md | 1 - reference/set/multiset/upper_bound.md | 1 - reference/set/set.md | 1 - reference/set/set/cbegin.md | 1 - reference/set/set/cend.md | 1 - reference/set/set/crbegin.md | 1 - reference/set/set/crend.md | 1 - reference/set/set/emplace.md | 1 - reference/set/set/emplace_hint.md | 1 - reference/set/set/end.md | 1 - reference/set/set/equal_range.md | 1 - reference/set/set/erase.md | 1 - reference/set/set/lower_bound.md | 1 - reference/set/set/op_constructor.md | 1 - reference/set/set/op_deduction_guide.md | 1 - reference/set/set/op_destructor.md | 2 -- reference/set/set/rbegin.md | 1 - reference/set/set/upper_bound.md | 1 - reference/shared_mutex.md | 1 - reference/shared_mutex/shared_lock.md | 2 -- reference/shared_mutex/shared_timed_mutex.md | 1 - reference/sstream.md | 2 -- reference/stack/stack.md | 2 -- reference/stack/stack/op_assign.md | 2 -- reference/stack/stack/op_destructor.md | 2 -- reference/stack/stack/op_equal.md | 2 -- reference/stack/stack/op_greater.md | 2 -- reference/stack/stack/op_greater_equal.md | 2 -- reference/stack/stack/op_less.md | 2 -- reference/stack/stack/op_less_equal.md | 2 -- reference/stack/stack/op_not_equal.md | 2 -- reference/stack/stack/pop.md | 1 - reference/stack/stack/push.md | 2 -- reference/stack/stack/size.md | 1 - reference/stack/stack/swap.md | 2 -- reference/stack/stack/swap_free.md | 1 - reference/stack/stack/top.md | 2 -- reference/stdfloat/bfloat16_t.md | 1 - reference/stdfloat/float128_t.md | 1 - reference/stdfloat/float16_t.md | 1 - reference/stdfloat/float32_t.md | 1 - reference/stdfloat/float64_t.md | 1 - reference/stop_token/nostopstate.md | 1 - reference/stop_token/stop_callback/op_deduction_guide.md | 1 - reference/stop_token/stop_source/op_assign.md | 1 - reference/stop_token/stop_source/op_constructor.md | 1 - reference/stop_token/stop_source/op_destructor.md | 1 - reference/stop_token/stop_source/op_not_equal.md | 1 - reference/stop_token/stop_source/swap.md | 4 ---- reference/stop_token/stop_source/swap_free.md | 1 - reference/stop_token/stop_token/op_assign.md | 1 - reference/stop_token/stop_token/op_constructor.md | 1 - reference/stop_token/stop_token/op_destructor.md | 1 - reference/stop_token/stop_token/op_not_equal.md | 1 - reference/stop_token/stop_token/swap.md | 1 - reference/string/basic_string/getline.md | 1 - reference/string/char_traits/eof.md | 1 - reference/string/char_traits/eq.md | 1 - reference/string/char_traits/eq_int_type.md | 1 - reference/string/char_traits/lt.md | 1 - reference/string/char_traits/not_eof.md | 1 - reference/string/char_traits/to_char_type.md | 1 - reference/string/char_traits/to_int_type.md | 1 - reference/system_error/error_category.md | 1 - reference/system_error/error_category/op_constructor.md | 1 - reference/system_error/error_category/op_destructor.md | 1 - reference/system_error/error_code.md | 1 - reference/system_error/error_code/message.md | 2 -- reference/system_error/error_code/op_assign.md | 2 -- reference/system_error/error_code/op_constructor.md | 2 -- reference/system_error/error_condition.md | 1 - reference/system_error/error_condition/op_constructor.md | 2 -- reference/system_error/make_error_code.md | 2 -- reference/system_error/make_error_condition.md | 2 -- reference/system_error/system_error.md | 2 -- reference/thread.md | 1 - reference/thread/this_thread/yield.md | 1 - reference/thread/thread.md | 2 -- reference/thread/thread/hardware_concurrency.md | 1 - reference/thread/thread/native_handle.md | 2 -- reference/thread/thread/op_assign.md | 2 -- reference/thread/thread/swap_free.md | 2 -- reference/tuple/tie.md | 1 - reference/tuple/tuple/op_deduction_guide.md | 1 - reference/type_traits/add_const.md | 1 - reference/type_traits/add_cv.md | 1 - reference/type_traits/add_lvalue_reference.md | 1 - reference/type_traits/add_pointer.md | 1 - reference/type_traits/add_rvalue_reference.md | 1 - reference/type_traits/add_volatile.md | 1 - reference/type_traits/conditional.md | 1 - reference/type_traits/decay.md | 1 - reference/type_traits/enable_if.md | 1 - reference/type_traits/integral_constant.md | 1 - reference/type_traits/is_scoped_enum.md | 1 - reference/type_traits/make_signed.md | 1 - reference/type_traits/make_unsigned.md | 1 - reference/type_traits/remove_all_extents.md | 1 - reference/type_traits/remove_const.md | 1 - reference/type_traits/remove_cv.md | 1 - reference/type_traits/remove_extent.md | 1 - reference/type_traits/remove_pointer.md | 1 - reference/type_traits/remove_reference.md | 1 - reference/type_traits/remove_volatile.md | 1 - reference/typeindex/type_index.md | 1 - reference/typeindex/type_index/hash_code.md | 1 - reference/typeindex/type_index/name.md | 1 - reference/typeindex/type_index/op_constructor.md | 1 - reference/typeindex/type_index/op_greater.md | 2 -- reference/typeindex/type_index/op_greater_equal.md | 2 -- reference/typeindex/type_index/op_less.md | 1 - reference/typeindex/type_index/op_less_equal.md | 2 -- reference/typeinfo.md | 1 - reference/typeinfo/bad_cast.md | 1 - reference/typeinfo/bad_cast/op_assign.md | 1 - reference/typeinfo/bad_cast/op_constructor.md | 1 - reference/typeinfo/bad_cast/op_destructor.md | 1 - reference/typeinfo/bad_cast/what.md | 1 - reference/typeinfo/bad_typeid.md | 1 - reference/typeinfo/bad_typeid/op_assign.md | 1 - reference/typeinfo/bad_typeid/op_constructor.md | 1 - reference/typeinfo/bad_typeid/op_destructor.md | 1 - reference/typeinfo/bad_typeid/what.md | 1 - reference/typeinfo/type_info.md | 1 - reference/typeinfo/type_info/hash_code.md | 2 -- reference/typeinfo/type_info/name.md | 2 -- reference/typeinfo/type_info/op_constructor.md | 1 - reference/typeinfo/type_info/op_destructor.md | 1 - reference/unordered_map/unordered_map.md | 1 - reference/unordered_map/unordered_map/begin-size_type.md | 1 - reference/unordered_map/unordered_map/begin.md | 1 - reference/unordered_map/unordered_map/bucket_count.md | 1 - reference/unordered_map/unordered_map/bucket_size.md | 1 - reference/unordered_map/unordered_map/cbegin-size_type.md | 1 - reference/unordered_map/unordered_map/cbegin.md | 1 - reference/unordered_map/unordered_map/cend-size_type.md | 1 - reference/unordered_map/unordered_map/cend.md | 2 -- reference/unordered_map/unordered_map/clear.md | 1 - reference/unordered_map/unordered_map/end-size_type.md | 1 - reference/unordered_map/unordered_map/end.md | 1 - reference/unordered_map/unordered_map/extract.md | 1 - reference/unordered_map/unordered_map/get_allocator.md | 2 -- reference/unordered_map/unordered_map/hash_function.md | 1 - reference/unordered_map/unordered_map/load_factor.md | 2 -- reference/unordered_map/unordered_map/max_bucket_count.md | 1 - reference/unordered_map/unordered_map/max_load_factor.md | 1 - reference/unordered_map/unordered_map/max_size.md | 2 -- reference/unordered_map/unordered_map/op_constructor.md | 1 - reference/unordered_map/unordered_map/op_destructor.md | 1 - reference/unordered_map/unordered_map/size.md | 1 - reference/unordered_map/unordered_multimap.md | 1 - .../unordered_map/unordered_multimap/begin-size_type.md | 1 - reference/unordered_map/unordered_multimap/begin.md | 1 - reference/unordered_map/unordered_multimap/bucket_count.md | 1 - reference/unordered_map/unordered_multimap/bucket_size.md | 1 - .../unordered_map/unordered_multimap/cbegin-size_type.md | 1 - reference/unordered_map/unordered_multimap/cbegin.md | 1 - reference/unordered_map/unordered_multimap/cend-size_type.md | 1 - reference/unordered_map/unordered_multimap/cend.md | 2 -- reference/unordered_map/unordered_multimap/clear.md | 1 - reference/unordered_map/unordered_multimap/end-size_type.md | 1 - reference/unordered_map/unordered_multimap/end.md | 1 - reference/unordered_map/unordered_multimap/extract.md | 1 - reference/unordered_map/unordered_multimap/get_allocator.md | 2 -- reference/unordered_map/unordered_multimap/hash_function.md | 1 - reference/unordered_map/unordered_multimap/key_eq.md | 1 - reference/unordered_map/unordered_multimap/load_factor.md | 2 -- .../unordered_map/unordered_multimap/max_bucket_count.md | 1 - .../unordered_map/unordered_multimap/max_load_factor.md | 1 - reference/unordered_map/unordered_multimap/max_size.md | 2 -- reference/unordered_map/unordered_multimap/op_constructor.md | 1 - reference/unordered_map/unordered_multimap/op_destructor.md | 1 - reference/unordered_map/unordered_multimap/size.md | 1 - reference/unordered_set/unordered_multiset.md | 1 - .../unordered_set/unordered_multiset/begin-size_type.md | 1 - reference/unordered_set/unordered_multiset/begin.md | 1 - reference/unordered_set/unordered_multiset/bucket_count.md | 1 - reference/unordered_set/unordered_multiset/bucket_size.md | 1 - .../unordered_set/unordered_multiset/cbegin-size_type.md | 1 - reference/unordered_set/unordered_multiset/cbegin.md | 1 - reference/unordered_set/unordered_multiset/cend-size_type.md | 1 - reference/unordered_set/unordered_multiset/cend.md | 1 - reference/unordered_set/unordered_multiset/clear.md | 1 - reference/unordered_set/unordered_multiset/emplace.md | 1 - reference/unordered_set/unordered_multiset/emplace_hint.md | 1 - reference/unordered_set/unordered_multiset/end-size_type.md | 1 - reference/unordered_set/unordered_multiset/end.md | 1 - reference/unordered_set/unordered_multiset/extract.md | 1 - reference/unordered_set/unordered_multiset/get_allocator.md | 1 - reference/unordered_set/unordered_multiset/hash_function.md | 1 - reference/unordered_set/unordered_multiset/key_eq.md | 1 - reference/unordered_set/unordered_multiset/load_factor.md | 1 - .../unordered_set/unordered_multiset/max_bucket_count.md | 1 - .../unordered_set/unordered_multiset/max_load_factor.md | 1 - reference/unordered_set/unordered_multiset/max_size.md | 1 - reference/unordered_set/unordered_multiset/op_constructor.md | 1 - .../unordered_set/unordered_multiset/op_deduction_guide.md | 1 - reference/unordered_set/unordered_multiset/op_destructor.md | 1 - reference/unordered_set/unordered_multiset/rehash.md | 1 - reference/unordered_set/unordered_multiset/reserve.md | 1 - reference/unordered_set/unordered_multiset/size.md | 1 - reference/unordered_set/unordered_set.md | 1 - reference/unordered_set/unordered_set/begin-size_type.md | 1 - reference/unordered_set/unordered_set/begin.md | 1 - reference/unordered_set/unordered_set/bucket_count.md | 1 - reference/unordered_set/unordered_set/bucket_size.md | 1 - reference/unordered_set/unordered_set/cbegin-size_type.md | 1 - reference/unordered_set/unordered_set/cbegin.md | 1 - reference/unordered_set/unordered_set/cend-size_type.md | 1 - reference/unordered_set/unordered_set/cend.md | 1 - reference/unordered_set/unordered_set/clear.md | 1 - reference/unordered_set/unordered_set/emplace.md | 1 - reference/unordered_set/unordered_set/emplace_hint.md | 1 - reference/unordered_set/unordered_set/end-size_type.md | 1 - reference/unordered_set/unordered_set/end.md | 1 - reference/unordered_set/unordered_set/extract.md | 1 - reference/unordered_set/unordered_set/get_allocator.md | 1 - reference/unordered_set/unordered_set/hash_function.md | 1 - reference/unordered_set/unordered_set/key_eq.md | 1 - reference/unordered_set/unordered_set/load_factor.md | 1 - reference/unordered_set/unordered_set/max_bucket_count.md | 1 - reference/unordered_set/unordered_set/max_load_factor.md | 1 - reference/unordered_set/unordered_set/max_size.md | 1 - reference/unordered_set/unordered_set/op_assign.md | 1 - reference/unordered_set/unordered_set/op_constructor.md | 1 - reference/unordered_set/unordered_set/op_deduction_guide.md | 1 - reference/unordered_set/unordered_set/op_destructor.md | 1 - reference/unordered_set/unordered_set/rehash.md | 1 - reference/unordered_set/unordered_set/reserve.md | 1 - reference/unordered_set/unordered_set/size.md | 1 - reference/utility/declval.md | 1 - reference/utility/forward.md | 2 -- reference/utility/index_sequence.md | 1 - reference/utility/index_sequence_for.md | 2 -- reference/utility/integer_sequence.md | 2 -- reference/utility/make_index_sequence.md | 2 -- reference/utility/make_integer_sequence.md | 2 -- reference/utility/move.md | 1 - reference/utility/move_if_noexcept.md | 2 -- reference/utility/pair/tuple_element.md | 1 - reference/utility/pair/tuple_size.md | 1 - reference/utility/piecewise_construct_t.md | 1 - reference/valarray/gslice/op_constructor.md | 1 - reference/valarray/gslice/start.md | 1 - reference/valarray/gslice/stride.md | 1 - reference/valarray/gslice_array.md | 2 -- reference/valarray/gslice_array/op_and_assign.md | 2 -- reference/valarray/gslice_array/op_assign.md | 2 -- reference/valarray/gslice_array/op_divide_assign.md | 2 -- reference/valarray/gslice_array/op_left_shift_assign.md | 2 -- reference/valarray/gslice_array/op_minus_assign.md | 2 -- reference/valarray/gslice_array/op_modulo_assign.md | 2 -- reference/valarray/gslice_array/op_multiply_assign.md | 2 -- reference/valarray/gslice_array/op_or_assign.md | 2 -- reference/valarray/gslice_array/op_plus_assign.md | 2 -- reference/valarray/gslice_array/op_right_shift_assign.md | 2 -- reference/valarray/gslice_array/op_xor_assign.md | 2 -- reference/valarray/indirect_array.md | 2 -- reference/valarray/indirect_array/op_and_assign.md | 2 -- reference/valarray/indirect_array/op_assign.md | 2 -- reference/valarray/indirect_array/op_divide_assign.md | 2 -- reference/valarray/indirect_array/op_left_shift_assign.md | 2 -- reference/valarray/indirect_array/op_minus_assign.md | 2 -- reference/valarray/indirect_array/op_modulo_assign.md | 2 -- reference/valarray/indirect_array/op_multiply_assign.md | 2 -- reference/valarray/indirect_array/op_or_assign.md | 2 -- reference/valarray/indirect_array/op_plus_assign.md | 2 -- reference/valarray/indirect_array/op_right_shift_assign.md | 2 -- reference/valarray/indirect_array/op_xor_assign.md | 2 -- reference/valarray/mask_array.md | 1 - reference/valarray/mask_array/op_and_assign.md | 2 -- reference/valarray/mask_array/op_assign.md | 2 -- reference/valarray/mask_array/op_divide_assign.md | 2 -- reference/valarray/mask_array/op_left_shift_assign.md | 2 -- reference/valarray/mask_array/op_minus_assign.md | 2 -- reference/valarray/mask_array/op_modulo_assign.md | 2 -- reference/valarray/mask_array/op_multiply_assign.md | 2 -- reference/valarray/mask_array/op_or_assign.md | 2 -- reference/valarray/mask_array/op_plus_assign.md | 2 -- reference/valarray/mask_array/op_right_shift_assign.md | 2 -- reference/valarray/mask_array/op_xor_assign.md | 2 -- reference/valarray/slice/op_constructor.md | 1 - reference/valarray/slice_array.md | 1 - reference/valarray/slice_array/op_and_assign.md | 2 -- reference/valarray/slice_array/op_assign.md | 2 -- reference/valarray/slice_array/op_divide_assign.md | 2 -- reference/valarray/slice_array/op_left_shift_assign.md | 2 -- reference/valarray/slice_array/op_minus_assign.md | 2 -- reference/valarray/slice_array/op_modulo_assign.md | 2 -- reference/valarray/slice_array/op_multiply_assign.md | 2 -- reference/valarray/slice_array/op_or_assign.md | 2 -- reference/valarray/slice_array/op_plus_assign.md | 2 -- reference/valarray/slice_array/op_right_shift_assign.md | 2 -- reference/valarray/slice_array/op_xor_assign.md | 2 -- reference/valarray/valarray.md | 2 -- reference/valarray/valarray/abs.md | 2 -- reference/valarray/valarray/acos.md | 2 -- reference/valarray/valarray/apply.md | 2 -- reference/valarray/valarray/asin.md | 2 -- reference/valarray/valarray/atan.md | 2 -- reference/valarray/valarray/cos.md | 2 -- reference/valarray/valarray/cosh.md | 2 -- reference/valarray/valarray/cshift.md | 1 - reference/valarray/valarray/exp.md | 2 -- reference/valarray/valarray/log.md | 2 -- reference/valarray/valarray/log10.md | 2 -- reference/valarray/valarray/max.md | 2 -- reference/valarray/valarray/min.md | 2 -- reference/valarray/valarray/op_and_assign.md | 2 -- reference/valarray/valarray/op_assign.md | 2 -- reference/valarray/valarray/op_at.md | 1 - reference/valarray/valarray/op_constructor.md | 1 - reference/valarray/valarray/op_deduction_guide.md | 1 - reference/valarray/valarray/op_destructor.md | 2 -- reference/valarray/valarray/op_divide_assign.md | 2 -- reference/valarray/valarray/op_flip.md | 2 -- reference/valarray/valarray/op_left_shift_assign.md | 2 -- reference/valarray/valarray/op_minus_assign.md | 2 -- reference/valarray/valarray/op_modulo_assign.md | 2 -- reference/valarray/valarray/op_multiply_assign.md | 2 -- reference/valarray/valarray/op_not.md | 2 -- reference/valarray/valarray/op_or_assign.md | 2 -- reference/valarray/valarray/op_plus_assign.md | 2 -- reference/valarray/valarray/op_right_shift_assign.md | 2 -- reference/valarray/valarray/op_unary_minus.md | 2 -- reference/valarray/valarray/op_unary_plus.md | 2 -- reference/valarray/valarray/op_xor_assign.md | 2 -- reference/valarray/valarray/resize.md | 1 - reference/valarray/valarray/shift.md | 2 -- reference/valarray/valarray/sin.md | 2 -- reference/valarray/valarray/sinh.md | 2 -- reference/valarray/valarray/size.md | 2 -- reference/valarray/valarray/sqrt.md | 2 -- reference/valarray/valarray/sum.md | 2 -- reference/valarray/valarray/swap.md | 2 -- reference/valarray/valarray/swap_free.md | 2 -- reference/valarray/valarray/tan.md | 2 -- reference/valarray/valarray/tanh.md | 2 -- reference/variant/bad_variant_access/op_destructor.md | 1 - reference/vector/vector/op_deduction_guide.md | 1 - reference/vector/vector/push_back.md | 1 - start_editing.md | 1 - start_editing/concept_template_page.md | 1 - start_editing/contribution_stats_2023.md | 2 -- start_editing/contribution_stats_2024.md | 1 - start_editing/directory_structure.md | 1 - start_editing/header_template_page.md | 1 - start_editing/lang_template_page.md | 1 - start_editing/markdown_cpprefjp.md | 1 - start_editing/module_template_page.md | 1 - start_editing/named_requirement_template_page.md | 1 - start_editing/random_figure.md | 1 - start_editing/type-type_template_page.md | 1 - 1382 files changed, 2061 deletions(-) diff --git a/README.md b/README.md index e9ac5309dd..0e5ea68ae6 100644 --- a/README.md +++ b/README.md @@ -33,4 +33,3 @@ Python 3系をインストールした状態で、以下を実行する: pip3 install requests python3 .github/workflows/script/link_check.py --check-inner-link ``` - diff --git a/article.md b/article.md index 8dcf6ed9e5..def0af1012 100644 --- a/article.md +++ b/article.md @@ -29,4 +29,3 @@ article階層にある記事は、以下の方針のもとに執筆していま - リファレンスページと二重管理になる記事はなるべく書かない - たとえば本サイトは正引きリファレンスを提供しているが、逆引きリファレンスをこの階層で提供することは二重管理になる。二重管理になると、ひとつの機能を解説するページを書くために多くの箇所を修正しなければならず、執筆やメンテナンスがむずかしくなってしまう。少なくとも執筆リソースが余るような状況でないうちは、二重管理はできる限り避ける方針とする - 「こういう記事を書きたいけど、cpprefjpに必要かわからない」という場合は、GitHubリポジトリのIssueで相談してほしい - diff --git a/article/lib/at_thread_exit.md b/article/lib/at_thread_exit.md index ca9b5f3863..bc76bd95e7 100644 --- a/article/lib/at_thread_exit.md +++ b/article/lib/at_thread_exit.md @@ -141,4 +141,3 @@ Hoge destructor ## 参考 - [futureとpromiseのあれこれ(理論編) - yohhoyの日記](http://d.hatena.ne.jp/yohhoy/20120131/p1) - [N3070 - Handling Detached Threads and thread_local Variables](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3070.html) - diff --git a/article/lib/dont_use_noexcept.md b/article/lib/dont_use_noexcept.md index 161e66d5e7..6788e9a6c5 100644 --- a/article/lib/dont_use_noexcept.md +++ b/article/lib/dont_use_noexcept.md @@ -22,4 +22,3 @@ C++11から、`throw`キーワードを使用した関数の例外指示が非 ## 参照元 この記事は、「[標準ライブラリにおける、関数にnoexceptを付けない条件 - Faith and Brave - C++で遊ぼう](http://d.hatena.ne.jp/faith_and_brave/20130620/1371715296)」のブログエントリから転載し、修正を行っている。 - diff --git a/article/lib/how_to_use_cv.md b/article/lib/how_to_use_cv.md index 427ff83acc..86b6f876b6 100644 --- a/article/lib/how_to_use_cv.md +++ b/article/lib/how_to_use_cv.md @@ -168,4 +168,3 @@ public: } }; ``` - diff --git a/edit_policy.md b/edit_policy.md index 688e7774cb..b8f2cb7afb 100644 --- a/edit_policy.md +++ b/edit_policy.md @@ -34,6 +34,3 @@ 本サイトの編集にあたって、編集者間の相談にはissueを使用してください。編集者間で直接やりとりしていただいてもかまいませんが、本サイトの記録として残したほうがよいやりとりであると判断した場合には、そのやりとりを本リポジトリのissueに貼り付けたり、リンクを貼ったりしていただければと思います。 ただし、編集者間の合意が必要あるものは、編集者間の直接のやりとりではなく、必ず本リポジトリのissueかpull requestで相談してください。オープンに議論できるものについては、管理者も同様です。 - - - diff --git a/implementation-status.md b/implementation-status.md index f4c7befdd6..bca80481ef 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -341,4 +341,3 @@ [icc]: ./implementation.md#icc [icx]: ./implementation.md#icc [msvc]: ./implementation.md#visual_cpp - diff --git a/lang.md b/lang.md index ae3ae7c778..c6b90647e0 100644 --- a/lang.md +++ b/lang.md @@ -18,4 +18,3 @@ - C++全体の言語機能を解説することは、当面の間、目指さない。 - バージョン更新に追従するのが大変であること、量が途方もなくなる、という理由から、できるところからやる。 - C++全体の言語解説を追加する場合には、このページの下に`general`階層を作って、そこで作業する。 - diff --git a/lang/archive.md b/lang/archive.md index 8299abb1b8..1004d2221f 100644 --- a/lang/archive.md +++ b/lang/archive.md @@ -4,6 +4,3 @@ ここでは、廃案になったが記録として残す価値のあるC++機能を紹介する。 ここで機能を紹介するかどうかは、個別に議論を行う。 - - - diff --git a/lang/cpp11.md b/lang/cpp11.md index aa26f219aa..5b69710f74 100644 --- a/lang/cpp11.md +++ b/lang/cpp11.md @@ -229,4 +229,3 @@ C++11では、参照するC言語の規格がC89からC99に変更となり、C9 ## 参照 - [C++11 Overview - Standard C++](https://isocpp.org/wiki/faq/cpp11) - diff --git a/lang/cpp14.md b/lang/cpp14.md index 7ab6c41a7d..f3de36c571 100644 --- a/lang/cpp14.md +++ b/lang/cpp14.md @@ -105,4 +105,3 @@ C++14とは、2014年12月に改訂され、ISO/IEC 14882:2014で標準規格化 ## 参照 - [C++14 Overview - Standard C++](https://isocpp.org/wiki/faq/cpp14) - diff --git a/lang/cpp26.md b/lang/cpp26.md index 102c08f7af..8f6954e268 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -477,4 +477,3 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [`std::atomic_compare_exchange_weak_explicit`](/reference/memory/shared_ptr/atomic_compare_exchange_weak_explicit.md) - [`std::atomic_compare_exchange_strong_explicit`](/reference/memory/shared_ptr/atomic_compare_exchange_strong_explicit.md) - C++23から非推奨となっていた、[`std::allocator`](/reference/memory/allocator.md)のメンバ型`is_always_equal`を削除 - diff --git a/lang/cpp26/disallow_binding_a_returned_glvalue_to_a_temporary.md b/lang/cpp26/disallow_binding_a_returned_glvalue_to_a_temporary.md index 433d0d9694..ef1af4ffc3 100644 --- a/lang/cpp26/disallow_binding_a_returned_glvalue_to_a_temporary.md +++ b/lang/cpp26/disallow_binding_a_returned_glvalue_to_a_temporary.md @@ -56,4 +56,3 @@ struct X { ## 参照 - [P2748R5 Disallow Binding a Returned Glvalue to a Temporary](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2748r5.html) - diff --git a/lang/cpp26/module_declarations_shouldnt_be_macros.md b/lang/cpp26/module_declarations_shouldnt_be_macros.md index b0f2cbcd69..f69d55f5cf 100644 --- a/lang/cpp26/module_declarations_shouldnt_be_macros.md +++ b/lang/cpp26/module_declarations_shouldnt_be_macros.md @@ -37,4 +37,3 @@ export module VERSION; // コンパイルエラー! ## 参照 - [P3034R1 Module Declarations Shouldn’t be Macros](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3034r1.html) - diff --git a/lang/cpp26/trivial_infinite_loops_are_not_undefined_behavior.md b/lang/cpp26/trivial_infinite_loops_are_not_undefined_behavior.md index 9475edbc85..a0cc8d9530 100644 --- a/lang/cpp26/trivial_infinite_loops_are_not_undefined_behavior.md +++ b/lang/cpp26/trivial_infinite_loops_are_not_undefined_behavior.md @@ -44,4 +44,3 @@ while (true) ## 参照 - [P2809R3 Trivial infinite loops are not Undefined Behavior](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2809r3.html) - diff --git a/lang/cpp26/variadic_friends.md b/lang/cpp26/variadic_friends.md index c98af4f3e2..67f3ccff15 100644 --- a/lang/cpp26/variadic_friends.md +++ b/lang/cpp26/variadic_friends.md @@ -110,4 +110,3 @@ private: ## 参照 - [P2893R3 Variadic friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2893r3.html) - diff --git a/reference/algorithm/min.md b/reference/algorithm/min.md index d4915042c0..a80955dabe 100644 --- a/reference/algorithm/min.md +++ b/reference/algorithm/min.md @@ -131,4 +131,3 @@ Windows環境においては、``をインクルードすると`min` - [N2551 A Variadic `std::min(T, ...)` for the C++ Standard Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2551.pdf) - [N2772 Variadic functions: Variadic templates or initializer lists? -- Revision 1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2772.pdf) - [LWG2350 - min, max, and minmax should be constexpr](http://cplusplus.github.io/LWG/lwg-defects.html#2350) - diff --git a/reference/algorithm/minmax.md b/reference/algorithm/minmax.md index 147e651058..245173fdbb 100644 --- a/reference/algorithm/minmax.md +++ b/reference/algorithm/minmax.md @@ -163,4 +163,3 @@ std::pair minmax(std::initializer_list init, Compare comp) - [N2551 A Variadic `std::min(T, ...)` for the C++ Standard Library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2551.pdf) - [N2772 Variadic functions: Variadic templates or initializer lists? -- Revision 1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2772.pdf) - [LWG2350 - min, max, and minmax should be constexpr](http://cplusplus.github.io/LWG/lwg-defects.html#2350) - diff --git a/reference/algorithm/minmax_element.md b/reference/algorithm/minmax_element.md index 7b655fbaea..f2edde4bc9 100644 --- a/reference/algorithm/minmax_element.md +++ b/reference/algorithm/minmax_element.md @@ -166,4 +166,3 @@ minmax_element(ForwardIterator first, ForwardIterator last) - [N1840 C++0x Proposal: Function template `std::minmax` and / or algorithm `std::minmax_element`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1840.pdf) - [N1990 Proposed Text for `minmax` (N1840)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1990.htm) - [LWG Issue 715. `minmax_element` complexity is too lax](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#715) - diff --git a/reference/algorithm/ranges_minmax.md b/reference/algorithm/ranges_minmax.md index 96d0dacf66..21a8fc127b 100644 --- a/reference/algorithm/ranges_minmax.md +++ b/reference/algorithm/ranges_minmax.md @@ -105,4 +105,3 @@ int main() ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) - diff --git a/reference/array.md b/reference/array.md index be7fa0bc4e..b2f236a9c4 100644 --- a/reference/array.md +++ b/reference/array.md @@ -20,4 +20,3 @@ ## 参照 - [N2930 Range-Based For Loop Wording (Without Concepts)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2930.html) - [P2051R0 C++ Standard Library Issues to be moved in Prague](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2051r0.html) - diff --git a/reference/array/array.md b/reference/array/array.md index e95c837ed5..ff8d6340fa 100644 --- a/reference/array/array.md +++ b/reference/array/array.md @@ -177,5 +177,3 @@ int main() ## 参照 - - diff --git a/reference/array/array/max_size.md b/reference/array/array/max_size.md index 0d19aa7772..a434850c2f 100644 --- a/reference/array/array/max_size.md +++ b/reference/array/array/max_size.md @@ -60,4 +60,3 @@ int main() ## 参照 - [N3669 Fixing constexpr member functions without const](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3669.pdf) - diff --git a/reference/array/array/op_deduction_guide.md b/reference/array/array/op_deduction_guide.md index e2c173a20b..a5f91faf4d 100644 --- a/reference/array/array/op_deduction_guide.md +++ b/reference/array/array/op_deduction_guide.md @@ -73,4 +73,3 @@ int main() ## 参照 - [P0433R2 Toward a resolution of US7 and US14: Integrating template deduction for class templates into the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0433r2.html) - diff --git a/reference/array/array/op_initializer.md b/reference/array/array/op_initializer.md index c61e36c44b..b849f22644 100644 --- a/reference/array/array/op_initializer.md +++ b/reference/array/array/op_initializer.md @@ -59,5 +59,3 @@ int main() - [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified] ## 参照 - - diff --git a/reference/array/array/size.md b/reference/array/array/size.md index 646a603817..226badb07c 100644 --- a/reference/array/array/size.md +++ b/reference/array/array/size.md @@ -60,4 +60,3 @@ int main() ## 参照 - [N3669 Fixing constexpr member functions without const](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3669.pdf) - diff --git a/reference/array/array/tuple_element.md b/reference/array/array/tuple_element.md index 94b4c2daaf..59ac356c21 100644 --- a/reference/array/array/tuple_element.md +++ b/reference/array/array/tuple_element.md @@ -67,4 +67,3 @@ GCC 4.7、およびVisual C++ 10.0の`array`に対する`tuple_element`の特殊 ## 参照 - diff --git a/reference/array/array/tuple_size.md b/reference/array/array/tuple_size.md index 2beb7cba60..f1d0d69393 100644 --- a/reference/array/array/tuple_size.md +++ b/reference/array/array/tuple_size.md @@ -60,4 +60,3 @@ int main() ## 参照 - [LWG Issue 2313. `tuple_size` should always derive from `integral_constant`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2313) - diff --git a/reference/atomic.md b/reference/atomic.md index a03bc8f60d..556f074d7a 100644 --- a/reference/atomic.md +++ b/reference/atomic.md @@ -137,4 +137,3 @@ - [N2047 An Atomic Operations Library for C++](http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2006/n2047.html) - [N2427 C++ Atomic Types and Operations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2427.html) - [Boost Atomic Library](http://www.boost.org/doc/libs/release/libs/atomic/) - diff --git a/reference/atomic/atomic_flag.md b/reference/atomic/atomic_flag.md index dac6e849eb..68d6f6a2ef 100644 --- a/reference/atomic/atomic_flag.md +++ b/reference/atomic/atomic_flag.md @@ -112,4 +112,3 @@ int main() ### 参照 - diff --git a/reference/atomic/atomic_ref/fetch_min.md b/reference/atomic/atomic_ref/fetch_min.md index b4fd996f92..2fb1c6d178 100644 --- a/reference/atomic/atomic_ref/fetch_min.md +++ b/reference/atomic/atomic_ref/fetch_min.md @@ -71,4 +71,3 @@ int main() ## 参照 - [P0493R5 Atomic minimum/maximum](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0493r5.pdf) - [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) - diff --git a/reference/bitset.md b/reference/bitset.md index 1879eafaac..48c7d002c0 100644 --- a/reference/bitset.md +++ b/reference/bitset.md @@ -14,4 +14,3 @@ | 名前 | 説明 | 対応バージョン | |-----------------------------|----------------------------|-------| | [`bitset`](bitset/bitset.md) | 固定長ビット配列(class template) | | - diff --git a/reference/bitset/bitset/op_constructor.md b/reference/bitset/bitset/op_constructor.md index 3cd4a189bc..994267db9c 100644 --- a/reference/bitset/bitset/op_constructor.md +++ b/reference/bitset/bitset/op_constructor.md @@ -163,4 +163,3 @@ int main() - [P2417R2 A more constexpr bitset](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2417r2.pdf) - [P2697R1 Interfacing `bitset` with `string_view`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2697r1.pdf) - C++26から`string_view`を受け取るコンストラクタが追加された - diff --git a/reference/bitset/bitset/op_flip.md b/reference/bitset/bitset/op_flip.md index 2ef56cb234..f4ad3c9c49 100644 --- a/reference/bitset/bitset/op_flip.md +++ b/reference/bitset/bitset/op_flip.md @@ -51,4 +51,3 @@ int main() ## 参照 - [P2417R2 A more constexpr bitset](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2417r2.pdf) - diff --git a/reference/bitset/bitset/op_istream.md b/reference/bitset/bitset/op_istream.md index aaf1b5b13d..9a10a8cfbc 100644 --- a/reference/bitset/bitset/op_istream.md +++ b/reference/bitset/bitset/op_istream.md @@ -53,4 +53,3 @@ int main() ## 参照 - diff --git a/reference/bitset/bitset/op_ostream.md b/reference/bitset/bitset/op_ostream.md index 6383cbc4d8..d74ce6c26d 100644 --- a/reference/bitset/bitset/op_ostream.md +++ b/reference/bitset/bitset/op_ostream.md @@ -51,4 +51,3 @@ int main() ## 参照 - diff --git a/reference/cassert.md b/reference/cassert.md index 79ecc3b623..a96e6103af 100644 --- a/reference/cassert.md +++ b/reference/cassert.md @@ -6,4 +6,3 @@ | 機能 | 説明 | 対応バージョン | |-------------------------------|-----------------------------------|----------------| | [`assert`](cassert/assert.md) | 式が真であることを表明する(macro) | | - diff --git a/reference/cctype/islower.md b/reference/cctype/islower.md index 8b59a88314..554f6ea036 100644 --- a/reference/cctype/islower.md +++ b/reference/cctype/islower.md @@ -57,4 +57,3 @@ int islower(int ch) { return ch >= 'a' && ch <= 'z'; } ``` - diff --git a/reference/cctype/isupper.md b/reference/cctype/isupper.md index 54f3607131..b4d6b360cd 100644 --- a/reference/cctype/isupper.md +++ b/reference/cctype/isupper.md @@ -57,4 +57,3 @@ int isupper(int ch) { return ch >= 'A' && ch <= 'Z'; } ``` - diff --git a/reference/cctype/tolower.md b/reference/cctype/tolower.md index b87aa22a59..c555f6e355 100644 --- a/reference/cctype/tolower.md +++ b/reference/cctype/tolower.md @@ -52,4 +52,3 @@ int tolower(int ch) { return ch; } ``` - diff --git a/reference/cerrno.md b/reference/cerrno.md index 3623490be5..a7a838b4c5 100644 --- a/reference/cerrno.md +++ b/reference/cerrno.md @@ -103,4 +103,3 @@ ## 関連項目 - [``](/reference/system_error.md) - diff --git a/reference/cerrno/errno.md b/reference/cerrno/errno.md index cf544dd6b9..d3badf597b 100644 --- a/reference/cerrno/errno.md +++ b/reference/cerrno/errno.md @@ -43,4 +43,3 @@ int main() ``` 定義域エラー ``` - diff --git a/reference/cfenv.md b/reference/cfenv.md index 55df58ca92..b0c0e2bb54 100644 --- a/reference/cfenv.md +++ b/reference/cfenv.md @@ -87,4 +87,3 @@ ## 関連項目 - [``](/reference/cmath.md) - diff --git a/reference/cfenv/fe_all_except.md b/reference/cfenv/fe_all_except.md index e01ee2303e..39b04f3739 100644 --- a/reference/cfenv/fe_all_except.md +++ b/reference/cfenv/fe_all_except.md @@ -52,5 +52,3 @@ zero divided - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] - コンパイルオプション`/fp:strict`または`#pragma fenv_access (on)`が必要。さもなくば、正しく動作しないおそれがある。 - - diff --git a/reference/cfenv/fe_divbyzero.md b/reference/cfenv/fe_divbyzero.md index 030ecfc51f..6bfc97a6bb 100644 --- a/reference/cfenv/fe_divbyzero.md +++ b/reference/cfenv/fe_divbyzero.md @@ -52,5 +52,3 @@ zero divided - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] - コンパイルオプション`/fp:strict`または`#pragma fenv_access (on)`が必要。さもなくば、正しく動作しないおそれがある。 - - diff --git a/reference/cfenv/fe_downward.md b/reference/cfenv/fe_downward.md index 831797391e..b326219290 100644 --- a/reference/cfenv/fe_downward.md +++ b/reference/cfenv/fe_downward.md @@ -62,5 +62,3 @@ int main() - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] - コンパイルオプション`/fp:strict`または`#pragma fenv_access (on)`が必要。さもなくば、正しく動作しないおそれがある。 - - diff --git a/reference/cfenv/fe_inexact.md b/reference/cfenv/fe_inexact.md index a1feecd2a6..d1f8b0f489 100644 --- a/reference/cfenv/fe_inexact.md +++ b/reference/cfenv/fe_inexact.md @@ -47,5 +47,3 @@ raised inexact - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] - コンパイルオプション`/fp:strict`または`#pragma fenv_access (on)`が必要。さもなくば、正しく動作しないおそれがある。 - - diff --git a/reference/cfenv/fe_invalid.md b/reference/cfenv/fe_invalid.md index 95fe60125a..fff8dfcb69 100644 --- a/reference/cfenv/fe_invalid.md +++ b/reference/cfenv/fe_invalid.md @@ -49,5 +49,3 @@ raised invalid - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] - コンパイルオプション`/fp:strict`または`#pragma fenv_access (on)`が必要。さもなくば、正しく動作しないおそれがある。 - - diff --git a/reference/cfenv/fe_overflow.md b/reference/cfenv/fe_overflow.md index aff8528be5..7489add0bf 100644 --- a/reference/cfenv/fe_overflow.md +++ b/reference/cfenv/fe_overflow.md @@ -49,5 +49,3 @@ raised overflow - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] - コンパイルオプション`/fp:strict`または`#pragma fenv_access (on)`が必要。さもなくば、正しく動作しないおそれがある。 - - diff --git a/reference/cfenv/fe_tonearest.md b/reference/cfenv/fe_tonearest.md index 975d77652d..0a3c8d1037 100644 --- a/reference/cfenv/fe_tonearest.md +++ b/reference/cfenv/fe_tonearest.md @@ -73,5 +73,3 @@ int main() - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] - コンパイルオプション`/fp:strict`または`#pragma fenv_access (on)`が必要。さもなくば、正しく動作しないおそれがある。 - - diff --git a/reference/cfenv/fe_towardzero.md b/reference/cfenv/fe_towardzero.md index aa4b0dc8ef..b847ec4431 100644 --- a/reference/cfenv/fe_towardzero.md +++ b/reference/cfenv/fe_towardzero.md @@ -62,5 +62,3 @@ int main() - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] - コンパイルオプション`/fp:strict`または`#pragma fenv_access (on)`が必要。さもなくば、正しく動作しないおそれがある。 - - diff --git a/reference/cfenv/fe_underflow.md b/reference/cfenv/fe_underflow.md index 8d4967252d..ce308cd4f0 100644 --- a/reference/cfenv/fe_underflow.md +++ b/reference/cfenv/fe_underflow.md @@ -48,5 +48,3 @@ raised underflow - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] - コンパイルオプション`/fp:strict`または`#pragma fenv_access (on)`が必要。さもなくば、正しく動作しないおそれがある。 - - diff --git a/reference/cfenv/fe_upward.md b/reference/cfenv/fe_upward.md index 7e9ef34f3b..71c7e2e863 100644 --- a/reference/cfenv/fe_upward.md +++ b/reference/cfenv/fe_upward.md @@ -62,5 +62,3 @@ int main() - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] - コンパイルオプション`/fp:strict`または`#pragma fenv_access (on)`が必要。さもなくば、正しく動作しないおそれがある。 - - diff --git a/reference/cfenv/feclearexcept.md b/reference/cfenv/feclearexcept.md index 04ebdd5da6..d95026142c 100644 --- a/reference/cfenv/feclearexcept.md +++ b/reference/cfenv/feclearexcept.md @@ -63,5 +63,3 @@ int main() - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] - コンパイルオプション`/fp:strict`または`#pragma fenv_access (on)`が必要。さもなくば、正しく動作しないおそれがある。 - - diff --git a/reference/cfenv/fegetexceptflag.md b/reference/cfenv/fegetexceptflag.md index 1f09411abc..7129e484b2 100644 --- a/reference/cfenv/fegetexceptflag.md +++ b/reference/cfenv/fegetexceptflag.md @@ -67,5 +67,3 @@ zero divided - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] - コンパイルオプション`/fp:strict`または`#pragma fenv_access (on)`が必要。さもなくば、正しく動作しないおそれがある。 - - diff --git a/reference/cfenv/fegetround.md b/reference/cfenv/fegetround.md index 042cc5e38d..2753a4955b 100644 --- a/reference/cfenv/fegetround.md +++ b/reference/cfenv/fegetround.md @@ -67,4 +67,3 @@ downward - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] - コンパイルオプション`/fp:strict`または`#pragma fenv_access (on)`が必要。さもなくば、正しく動作しないおそれがある。 - diff --git a/reference/cfenv/feraiseexcept.md b/reference/cfenv/feraiseexcept.md index 73881729fd..d5b4902a94 100644 --- a/reference/cfenv/feraiseexcept.md +++ b/reference/cfenv/feraiseexcept.md @@ -82,5 +82,3 @@ overflow - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] - コンパイルオプション`/fp:strict`または`#pragma fenv_access (on)`が必要。さもなくば、正しく動作しないおそれがある。 - - diff --git a/reference/cfenv/fesetexceptflag.md b/reference/cfenv/fesetexceptflag.md index a1cb6cb138..7f8dc502f9 100644 --- a/reference/cfenv/fesetexceptflag.md +++ b/reference/cfenv/fesetexceptflag.md @@ -76,5 +76,3 @@ int main() - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] - コンパイルオプション`/fp:strict`または`#pragma fenv_access (on)`が必要。さもなくば、正しく動作しないおそれがある。 - - diff --git a/reference/cfenv/fesetround.md b/reference/cfenv/fesetround.md index 43df639e5d..c163bbc3e7 100644 --- a/reference/cfenv/fesetround.md +++ b/reference/cfenv/fesetround.md @@ -104,4 +104,3 @@ upward ## 関連項目 - [`rint`](/reference/cmath/rint.md) - [`nearbyint`](/reference/cmath/nearbyint.md) - diff --git a/reference/cfenv/fetestexcept.md b/reference/cfenv/fetestexcept.md index 97838e5d07..c48cb8534e 100644 --- a/reference/cfenv/fetestexcept.md +++ b/reference/cfenv/fetestexcept.md @@ -97,5 +97,3 @@ overflow - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] - コンパイルオプション`/fp:strict`または`#pragma fenv_access (on)`が必要。さもなくば、正しく動作しないおそれがある。 - - diff --git a/reference/cfenv/fexcept_t.md b/reference/cfenv/fexcept_t.md index 657fde5344..2c5b4dcdfe 100644 --- a/reference/cfenv/fexcept_t.md +++ b/reference/cfenv/fexcept_t.md @@ -56,5 +56,3 @@ zero divided - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] - コンパイルオプション`/fp:strict`または`#pragma fenv_access (on)`が必要。さもなくば、正しく動作しないおそれがある。 - - diff --git a/reference/chrono/duration/count.md b/reference/chrono/duration/count.md index 6f2e47f1e9..4709c66468 100644 --- a/reference/chrono/duration/count.md +++ b/reference/chrono/duration/count.md @@ -47,4 +47,3 @@ int main() ### 処理系 - [GCC](/implementation.md#gcc): 4.5.1 [mark verified], 4.6.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - diff --git a/reference/chrono/duration/op_greater.md b/reference/chrono/duration/op_greater.md index 17bb85f76b..b6ff99568a 100644 --- a/reference/chrono/duration/op_greater.md +++ b/reference/chrono/duration/op_greater.md @@ -56,4 +56,3 @@ int main() ## 参照 - [N3469 Constexpr Library Additions: chrono, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3469.html) - diff --git a/reference/chrono/duration/op_greater_equal.md b/reference/chrono/duration/op_greater_equal.md index 97702fa836..ccb61ebf26 100644 --- a/reference/chrono/duration/op_greater_equal.md +++ b/reference/chrono/duration/op_greater_equal.md @@ -56,4 +56,3 @@ int main() ## 参照 - [N3469 Constexpr Library Additions: chrono, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3469.html) - diff --git a/reference/chrono/duration/op_h.md b/reference/chrono/duration/op_h.md index f8202ad8a3..7bef810a31 100644 --- a/reference/chrono/duration/op_h.md +++ b/reference/chrono/duration/op_h.md @@ -76,5 +76,3 @@ int main() ## 参照 - [N3642 User-defined Literals for Standard Library Types (part 1 - version 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3642.pdf) - [LWG Issue 2278. User-defined literals for Standard Library types](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2278) - - diff --git a/reference/chrono/duration/op_less.md b/reference/chrono/duration/op_less.md index 34a0f8d541..ad2df07374 100644 --- a/reference/chrono/duration/op_less.md +++ b/reference/chrono/duration/op_less.md @@ -57,4 +57,3 @@ int main() ## 参照 - [N3469 Constexpr Library Additions: chrono, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3469.html) - diff --git a/reference/chrono/duration/op_less_equal.md b/reference/chrono/duration/op_less_equal.md index 2750c36d92..ffaef848bc 100644 --- a/reference/chrono/duration/op_less_equal.md +++ b/reference/chrono/duration/op_less_equal.md @@ -57,4 +57,3 @@ int main() ## 参照 - [N3469 Constexpr Library Additions: chrono, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3469.html) - diff --git a/reference/chrono/duration/op_min.md b/reference/chrono/duration/op_min.md index 5d6fbc4058..0583ae52bc 100644 --- a/reference/chrono/duration/op_min.md +++ b/reference/chrono/duration/op_min.md @@ -76,5 +76,3 @@ int main() ## 参照 - [N3642 User-defined Literals for Standard Library Types (part 1 - version 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3642.pdf) - [LWG Issue 2278. User-defined literals for Standard Library types](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2278) - - diff --git a/reference/chrono/duration/op_ms.md b/reference/chrono/duration/op_ms.md index c4aa35cb8c..ce798af1ad 100644 --- a/reference/chrono/duration/op_ms.md +++ b/reference/chrono/duration/op_ms.md @@ -76,5 +76,3 @@ int main() ## 参照 - [N3642 User-defined Literals for Standard Library Types (part 1 - version 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3642.pdf) - [LWG Issue 2278. User-defined literals for Standard Library types](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2278) - - diff --git a/reference/chrono/duration/op_ns.md b/reference/chrono/duration/op_ns.md index 8be04be1e5..b9ff4e517b 100644 --- a/reference/chrono/duration/op_ns.md +++ b/reference/chrono/duration/op_ns.md @@ -76,5 +76,3 @@ int main() ## 参照 - [N3642 User-defined Literals for Standard Library Types (part 1 - version 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3642.pdf) - [LWG Issue 2278. User-defined literals for Standard Library types](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2278) - - diff --git a/reference/chrono/duration/op_s.md b/reference/chrono/duration/op_s.md index e9419e4639..48e9f32c8e 100644 --- a/reference/chrono/duration/op_s.md +++ b/reference/chrono/duration/op_s.md @@ -76,5 +76,3 @@ int main() ## 参照 - [N3642 User-defined Literals for Standard Library Types (part 1 - version 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3642.pdf) - [LWG Issue 2278. User-defined literals for Standard Library types](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2278) - - diff --git a/reference/chrono/duration/op_us.md b/reference/chrono/duration/op_us.md index 360b564900..af81a0be98 100644 --- a/reference/chrono/duration/op_us.md +++ b/reference/chrono/duration/op_us.md @@ -76,4 +76,3 @@ int main() ## 参照 - [N3642 User-defined Literals for Standard Library Types (part 1 - version 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3642.pdf) - [LWG Issue 2278. User-defined literals for Standard Library types](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2278) - diff --git a/reference/chrono/duration_aliases.md b/reference/chrono/duration_aliases.md index 447b4ea424..63dedb2e51 100644 --- a/reference/chrono/duration_aliases.md +++ b/reference/chrono/duration_aliases.md @@ -152,4 +152,3 @@ int main() ## 関連項目 - [`sleep_for`](/reference/thread/this_thread/sleep_for.md) - [`sleep_until`](/reference/thread/this_thread/sleep_until.md) - diff --git a/reference/chrono/file_clock.md b/reference/chrono/file_clock.md index 5ea084da99..a2384750aa 100644 --- a/reference/chrono/file_clock.md +++ b/reference/chrono/file_clock.md @@ -105,4 +105,3 @@ int main() ## 参照 - [`file_clock` breaks ABI for C++17 implementations](https://wg21.cmeerw.net/lwg/issue3145) - `file_clock`は当初、独立したクラスとして定義することを予定していたが、C++17のファイルシステムライブラリで定義される[`file_time_type`](/reference/filesystem/file_time_type.md)のABI互換性を破壊してしまうことがわかったため、実装定義されるクロックの別名として`file_clock`が定義されることになった - diff --git a/reference/chrono/format.md b/reference/chrono/format.md index f9ce419a6d..afb745343b 100644 --- a/reference/chrono/format.md +++ b/reference/chrono/format.md @@ -148,4 +148,3 @@ int main() - [LWG Issue 3272. `%I%p` should `parse`/`format` `duration` since midnight](https://wg21.cmeerw.net/lwg/issue3272) - [P2372R1 Fixing locale handling in chrono formatters](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2372r1.html) - この提案文書はC++20の策定後に採択されたが、実装が追いついていない時期の採択だったために、C++20の仕様として扱われる - diff --git a/reference/chrono/gps_time.md b/reference/chrono/gps_time.md index 4d765cffeb..c23684dcea 100644 --- a/reference/chrono/gps_time.md +++ b/reference/chrono/gps_time.md @@ -226,4 +226,3 @@ int main() ## 参照 - [P2372R1 Fixing locale handling in chrono formatters](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2372r1.html) - この提案文書はC++20の策定後に採択されたが、実装が追いついていない時期の採択だったために、C++20の仕様として扱われる - diff --git a/reference/chrono/hh_mm_ss.md b/reference/chrono/hh_mm_ss.md index 971ef88922..6a23be22cb 100644 --- a/reference/chrono/hh_mm_ss.md +++ b/reference/chrono/hh_mm_ss.md @@ -118,4 +118,3 @@ int main() - [Clang](/implementation.md#clang): 10.0 (出力ストリームなし) [mark verified] - [GCC](/implementation.md#gcc): 11.1 (出力ストリームなし) [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] - diff --git a/reference/chrono/hh_mm_ss/fractional_width.md b/reference/chrono/hh_mm_ss/fractional_width.md index 3fa1aa56f3..36ae48c339 100644 --- a/reference/chrono/hh_mm_ss/fractional_width.md +++ b/reference/chrono/hh_mm_ss/fractional_width.md @@ -78,4 +78,3 @@ int main() { - [Clang](/implementation.md#clang): 10.0 [mark verified] - [GCC](/implementation.md#gcc): 11.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] - diff --git a/reference/chrono/hh_mm_ss/op_constructor.md b/reference/chrono/hh_mm_ss/op_constructor.md index f493c429ca..2111390663 100644 --- a/reference/chrono/hh_mm_ss/op_constructor.md +++ b/reference/chrono/hh_mm_ss/op_constructor.md @@ -98,4 +98,3 @@ int main() - [Clang](/implementation.md#clang): 10.0 [mark verified] - [GCC](/implementation.md#gcc): 11.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] - diff --git a/reference/chrono/hh_mm_ss/op_ostream.md b/reference/chrono/hh_mm_ss/op_ostream.md index d2bd35dba5..915683021b 100644 --- a/reference/chrono/hh_mm_ss/op_ostream.md +++ b/reference/chrono/hh_mm_ss/op_ostream.md @@ -78,4 +78,3 @@ int main() - [LWG Issue 3262. Formatting of negative durations is not specified](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2117r0.html#3262) - [P2372R1 Fixing locale handling in chrono formatters](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2372r1.html) - この提案文書はC++20の策定後に採択されたが、実装が追いついていない時期の採択だったために、C++20の仕様として扱われる - diff --git a/reference/chrono/high_resolution_clock.md b/reference/chrono/high_resolution_clock.md index 7fbe9e92e2..eede748058 100644 --- a/reference/chrono/high_resolution_clock.md +++ b/reference/chrono/high_resolution_clock.md @@ -87,4 +87,3 @@ int main() ## 参照 - [N3469 Constexpr Library Additions: chrono, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3469.html) - diff --git a/reference/chrono/is_clock.md b/reference/chrono/is_clock.md index 01d3f72923..4d08cabac2 100644 --- a/reference/chrono/is_clock.md +++ b/reference/chrono/is_clock.md @@ -82,4 +82,3 @@ int main() - [Clang](/implementation.md#clang): 9.0 [mark noimpl] - [GCC](/implementation.md#gcc): 9.2 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] - diff --git a/reference/chrono/local-time-format-t.md b/reference/chrono/local-time-format-t.md index 1cd47c42ff..f23666dc1d 100644 --- a/reference/chrono/local-time-format-t.md +++ b/reference/chrono/local-time-format-t.md @@ -86,4 +86,3 @@ int main() - [Clang](/implementation.md#clang): 9.0 [mark noimpl] - [GCC](/implementation.md#gcc): 9.2 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] - diff --git a/reference/chrono/local-time-format-t/formatter.md b/reference/chrono/local-time-format-t/formatter.md index f4f16c8601..ed11489ae8 100644 --- a/reference/chrono/local-time-format-t/formatter.md +++ b/reference/chrono/local-time-format-t/formatter.md @@ -75,4 +75,3 @@ int main() - [Clang](/implementation.md#clang): 9.0 [mark noimpl] - [GCC](/implementation.md#gcc): 9.2 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] - diff --git a/reference/chrono/local_info/formatter.md b/reference/chrono/local_info/formatter.md index a0d9459418..927966478f 100644 --- a/reference/chrono/local_info/formatter.md +++ b/reference/chrono/local_info/formatter.md @@ -70,4 +70,3 @@ JST - [Clang](/implementation.md#clang): 9.0 [mark noimpl] - [GCC](/implementation.md#gcc): 9.2 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] - diff --git a/reference/chrono/month/op_ostream.md b/reference/chrono/month/op_ostream.md index 79224147e4..33c46c7e16 100644 --- a/reference/chrono/month/op_ostream.md +++ b/reference/chrono/month/op_ostream.md @@ -124,4 +124,3 @@ Dec ## 参照 - [P2372R1 Fixing locale handling in chrono formatters](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2372r1.html) - この提案文書はC++20の策定後に採択されたが、実装が追いついていない時期の採択だったために、C++20の仕様として扱われる - diff --git a/reference/chrono/month_constants.md b/reference/chrono/month_constants.md index 6a9d25dd8c..409eb9a583 100644 --- a/reference/chrono/month_constants.md +++ b/reference/chrono/month_constants.md @@ -75,4 +75,3 @@ Jun - [Clang](/implementation.md#clang): 9.0 (入出力ストリームなし) [mark verified] - [GCC](/implementation.md#gcc): 9.2 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] - diff --git a/reference/chrono/month_day/op_ostream.md b/reference/chrono/month_day/op_ostream.md index e3ee971059..9d0d5c1f91 100644 --- a/reference/chrono/month_day/op_ostream.md +++ b/reference/chrono/month_day/op_ostream.md @@ -65,4 +65,3 @@ Mar/01 ## 参照 - [P2372R1 Fixing locale handling in chrono formatters](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2372r1.html) - この提案文書はC++20の策定後に採択されたが、実装が追いついていない時期の採択だったために、C++20の仕様として扱われる - diff --git a/reference/chrono/month_day_last/op_ostream.md b/reference/chrono/month_day_last/op_ostream.md index 301d6d689d..420830838c 100644 --- a/reference/chrono/month_day_last/op_ostream.md +++ b/reference/chrono/month_day_last/op_ostream.md @@ -65,4 +65,3 @@ Mar/last ## 参照 - [P2372R1 Fixing locale handling in chrono formatters](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2372r1.html) - この提案文書はC++20の策定後に採択されたが、実装が追いついていない時期の採択だったために、C++20の仕様として扱われる - diff --git a/reference/chrono/month_weekday/op_ostream.md b/reference/chrono/month_weekday/op_ostream.md index b58def2027..1c8594be06 100644 --- a/reference/chrono/month_weekday/op_ostream.md +++ b/reference/chrono/month_weekday/op_ostream.md @@ -66,4 +66,3 @@ Mar/Sun[1] ## 参照 - [P2372R1 Fixing locale handling in chrono formatters](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2372r1.html) - この提案文書はC++20の策定後に採択されたが、実装が追いついていない時期の採択だったために、C++20の仕様として扱われる - diff --git a/reference/chrono/month_weekday_last/op_ostream.md b/reference/chrono/month_weekday_last/op_ostream.md index 5fda969ea7..828c2e2cdf 100644 --- a/reference/chrono/month_weekday_last/op_ostream.md +++ b/reference/chrono/month_weekday_last/op_ostream.md @@ -67,4 +67,3 @@ Mar/Sun[last] ## 参照 - [P2372R1 Fixing locale handling in chrono formatters](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2372r1.html) - この提案文書はC++20の策定後に採択されたが、実装が追いついていない時期の採択だったために、C++20の仕様として扱われる - diff --git a/reference/chrono/steady_clock.md b/reference/chrono/steady_clock.md index 6852946713..8c9c9f0575 100644 --- a/reference/chrono/steady_clock.md +++ b/reference/chrono/steady_clock.md @@ -93,4 +93,3 @@ int main() ## 参照 - [N3469 Constexpr Library Additions: chrono, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3469.html) - diff --git a/reference/chrono/sys_info.md b/reference/chrono/sys_info.md index e861eb9040..154ea1ab9a 100644 --- a/reference/chrono/sys_info.md +++ b/reference/chrono/sys_info.md @@ -89,4 +89,3 @@ JST - [Clang](/implementation.md#clang): 9.0 [mark noimpl] - [GCC](/implementation.md#gcc): 9.2 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] - diff --git a/reference/chrono/sys_info/formatter.md b/reference/chrono/sys_info/formatter.md index 97d7f976f8..ca5ecf0f15 100644 --- a/reference/chrono/sys_info/formatter.md +++ b/reference/chrono/sys_info/formatter.md @@ -67,4 +67,3 @@ JST - [Clang](/implementation.md#clang): 9.0 [mark noimpl] - [GCC](/implementation.md#gcc): 9.2 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] - diff --git a/reference/chrono/tai_time.md b/reference/chrono/tai_time.md index edb71db77d..52cd89d3fa 100644 --- a/reference/chrono/tai_time.md +++ b/reference/chrono/tai_time.md @@ -221,4 +221,3 @@ int main() ## 参照 - [P2372R1 Fixing locale handling in chrono formatters](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2372r1.html) - この提案文書はC++20の策定後に採択されたが、実装が追いついていない時期の採択だったために、C++20の仕様として扱われる - diff --git a/reference/chrono/time_point/op_constructor.md b/reference/chrono/time_point/op_constructor.md index 751397d7c8..d48cc5183c 100644 --- a/reference/chrono/time_point/op_constructor.md +++ b/reference/chrono/time_point/op_constructor.md @@ -70,4 +70,3 @@ int main() ## 参照 - [N3469 Constexpr Library Additions: chrono, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3469.html) - diff --git a/reference/chrono/time_point/op_greater.md b/reference/chrono/time_point/op_greater.md index 5e09984637..9ae32fd94b 100644 --- a/reference/chrono/time_point/op_greater.md +++ b/reference/chrono/time_point/op_greater.md @@ -61,4 +61,3 @@ int main() ## 参照 - [N3469 Constexpr Library Additions: chrono, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3469.html) - diff --git a/reference/chrono/time_point/op_greater_equal.md b/reference/chrono/time_point/op_greater_equal.md index 78cd5b250a..ba6fcf1eb0 100644 --- a/reference/chrono/time_point/op_greater_equal.md +++ b/reference/chrono/time_point/op_greater_equal.md @@ -62,4 +62,3 @@ int main() ## 参照 - [N3469 Constexpr Library Additions: chrono, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3469.html) - diff --git a/reference/chrono/time_point/op_less.md b/reference/chrono/time_point/op_less.md index 3a0849bb40..7e72335828 100644 --- a/reference/chrono/time_point/op_less.md +++ b/reference/chrono/time_point/op_less.md @@ -61,4 +61,3 @@ int main() ## 参照 - [N3469 Constexpr Library Additions: chrono, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3469.html) - diff --git a/reference/chrono/time_point/op_less_equal.md b/reference/chrono/time_point/op_less_equal.md index b85bf1bcfd..85196fe077 100644 --- a/reference/chrono/time_point/op_less_equal.md +++ b/reference/chrono/time_point/op_less_equal.md @@ -62,4 +62,3 @@ int main() ## 参照 - [N3469 Constexpr Library Additions: chrono, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3469.html) - diff --git a/reference/chrono/time_point/op_minus.md b/reference/chrono/time_point/op_minus.md index adefb2d5c0..53ab0bd16b 100644 --- a/reference/chrono/time_point/op_minus.md +++ b/reference/chrono/time_point/op_minus.md @@ -101,4 +101,3 @@ int main() ## 参照 - [N3469 Constexpr Library Additions: chrono, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3469.html) - diff --git a/reference/chrono/time_point/op_plus.md b/reference/chrono/time_point/op_plus.md index ba83128e0b..7759246909 100644 --- a/reference/chrono/time_point/op_plus.md +++ b/reference/chrono/time_point/op_plus.md @@ -91,4 +91,3 @@ int main() ## 参照 - [N3469 Constexpr Library Additions: chrono, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3469.html) - diff --git a/reference/chrono/time_point/time_since_epoch.md b/reference/chrono/time_point/time_since_epoch.md index 0e60e73b66..3007c9b230 100644 --- a/reference/chrono/time_point/time_since_epoch.md +++ b/reference/chrono/time_point/time_since_epoch.md @@ -53,4 +53,3 @@ int main() ## 参照 - [N3469 Constexpr Library Additions: chrono, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3469.html) - diff --git a/reference/chrono/time_point_cast.md b/reference/chrono/time_point_cast.md index accc1d3006..a181ed0fae 100644 --- a/reference/chrono/time_point_cast.md +++ b/reference/chrono/time_point_cast.md @@ -82,4 +82,3 @@ int main() ## 参照 - [N3469 Constexpr Library Additions: chrono, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3469.html) - diff --git a/reference/chrono/time_zone.md b/reference/chrono/time_zone.md index 354c5daaa0..2484a73191 100644 --- a/reference/chrono/time_zone.md +++ b/reference/chrono/time_zone.md @@ -100,4 +100,3 @@ int main() - [Clang](/implementation.md#clang): 9.0 [mark noimpl] - [GCC](/implementation.md#gcc): 9.2 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] - diff --git a/reference/chrono/time_zone_link.md b/reference/chrono/time_zone_link.md index 8d2a194c10..d73a4777f1 100644 --- a/reference/chrono/time_zone_link.md +++ b/reference/chrono/time_zone_link.md @@ -77,4 +77,3 @@ std::cout << linked_tz->name() << std::endl; // Asia/Nicosia ## 参照 - [P1982R0 Rename `link` to `time_zone_link`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1982r0.html) - C++20の策定中、National Body Commentとして`link`というクラス名は一般的すぎて説明的ではないと指摘があり、`time_zone_link`に名称変更された - diff --git a/reference/chrono/time_zone_link/name.md b/reference/chrono/time_zone_link/name.md index 6aa0043d87..c32502f8eb 100644 --- a/reference/chrono/time_zone_link/name.md +++ b/reference/chrono/time_zone_link/name.md @@ -29,4 +29,3 @@ std::string_view name() const noexcept; // (1) C++20 - [Clang](/implementation.md#clang): 9.0 [mark noimpl] - [GCC](/implementation.md#gcc): 9.2 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] - diff --git a/reference/chrono/time_zone_link/op_equal.md b/reference/chrono/time_zone_link/op_equal.md index 0aa6455313..ddeda2431b 100644 --- a/reference/chrono/time_zone_link/op_equal.md +++ b/reference/chrono/time_zone_link/op_equal.md @@ -37,4 +37,3 @@ return x.name() == y.name(); - [Clang](/implementation.md#clang): 9.0 [mark noimpl] - [GCC](/implementation.md#gcc): 9.2 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] - diff --git a/reference/chrono/time_zone_link/target.md b/reference/chrono/time_zone_link/target.md index b5c728df09..69b75fc550 100644 --- a/reference/chrono/time_zone_link/target.md +++ b/reference/chrono/time_zone_link/target.md @@ -29,4 +29,3 @@ std::string_view target() const noexcept; // (1) C++20 - [Clang](/implementation.md#clang): 9.0 [mark noimpl] - [GCC](/implementation.md#gcc): 9.2 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] - diff --git a/reference/chrono/tzdb.md b/reference/chrono/tzdb.md index 4d8143c098..a001859686 100644 --- a/reference/chrono/tzdb.md +++ b/reference/chrono/tzdb.md @@ -83,4 +83,3 @@ int main() - [Clang](/implementation.md#clang): 9.0 [mark noimpl] - [GCC](/implementation.md#gcc): 9.2 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] - diff --git a/reference/chrono/tzdb_list.md b/reference/chrono/tzdb_list.md index 3f927d7282..8de6b95569 100644 --- a/reference/chrono/tzdb_list.md +++ b/reference/chrono/tzdb_list.md @@ -99,4 +99,3 @@ Asia/Tokyo - [Clang](/implementation.md#clang): 9.0 [mark noimpl] - [GCC](/implementation.md#gcc): 9.2 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] - diff --git a/reference/chrono/tzdb_list/begin.md b/reference/chrono/tzdb_list/begin.md index 45ef0682a3..899fd74f28 100644 --- a/reference/chrono/tzdb_list/begin.md +++ b/reference/chrono/tzdb_list/begin.md @@ -59,4 +59,3 @@ int main() - [Clang](/implementation.md#clang): 9.0 [mark noimpl] - [GCC](/implementation.md#gcc): 9.2 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] - diff --git a/reference/chrono/tzdb_list/cbegin.md b/reference/chrono/tzdb_list/cbegin.md index 3c5959d6a5..8e41202716 100644 --- a/reference/chrono/tzdb_list/cbegin.md +++ b/reference/chrono/tzdb_list/cbegin.md @@ -62,4 +62,3 @@ int main() - [Clang](/implementation.md#clang): 9.0 [mark noimpl] - [GCC](/implementation.md#gcc): 9.2 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] - diff --git a/reference/chrono/tzdb_list/cend.md b/reference/chrono/tzdb_list/cend.md index f7360ac317..4fade2b7c0 100644 --- a/reference/chrono/tzdb_list/cend.md +++ b/reference/chrono/tzdb_list/cend.md @@ -62,4 +62,3 @@ int main() - [Clang](/implementation.md#clang): 9.0 [mark noimpl] - [GCC](/implementation.md#gcc): 9.2 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] - diff --git a/reference/chrono/tzdb_list/end.md b/reference/chrono/tzdb_list/end.md index 043241211f..7a1c15ae25 100644 --- a/reference/chrono/tzdb_list/end.md +++ b/reference/chrono/tzdb_list/end.md @@ -59,4 +59,3 @@ int main() - [Clang](/implementation.md#clang): 9.0 [mark noimpl] - [GCC](/implementation.md#gcc): 9.2 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] - diff --git a/reference/chrono/tzdb_list/erase_after.md b/reference/chrono/tzdb_list/erase_after.md index 66b3f8a1ad..fd37cfe9e3 100644 --- a/reference/chrono/tzdb_list/erase_after.md +++ b/reference/chrono/tzdb_list/erase_after.md @@ -39,4 +39,3 @@ const_iterator erase_after(const_iterator p); ## バージョン ### 言語 - C++20 - diff --git a/reference/chrono/tzdb_list/front.md b/reference/chrono/tzdb_list/front.md index 59a9aa47a2..21dad8a056 100644 --- a/reference/chrono/tzdb_list/front.md +++ b/reference/chrono/tzdb_list/front.md @@ -63,4 +63,3 @@ Asia/Tokyo - [Clang](/implementation.md#clang): 9.0 [mark noimpl] - [GCC](/implementation.md#gcc): 9.2 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] - diff --git a/reference/chrono/utc_time.md b/reference/chrono/utc_time.md index ac5a5abeca..59ccbf59b7 100644 --- a/reference/chrono/utc_time.md +++ b/reference/chrono/utc_time.md @@ -217,4 +217,3 @@ int main() - [LWG Issue 3359. `` leap second support should allow for negative leap seconds](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2117r0.html#3359) - [P2372R1 Fixing locale handling in chrono formatters](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2372r1.html) - この提案文書はC++20の策定後に採択されたが、実装が追いついていない時期の採択だったために、C++20の仕様として扱われる - diff --git a/reference/chrono/weekday/op_ostream.md b/reference/chrono/weekday/op_ostream.md index dee4369fa1..aa76858252 100644 --- a/reference/chrono/weekday/op_ostream.md +++ b/reference/chrono/weekday/op_ostream.md @@ -104,4 +104,3 @@ Sat ## 参照 - [P2372R1 Fixing locale handling in chrono formatters](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2372r1.html) - この提案文書はC++20の策定後に採択されたが、実装が追いついていない時期の採択だったために、C++20の仕様として扱われる - diff --git a/reference/chrono/weekday_constants.md b/reference/chrono/weekday_constants.md index dcf8e59716..b5305ec310 100644 --- a/reference/chrono/weekday_constants.md +++ b/reference/chrono/weekday_constants.md @@ -73,4 +73,3 @@ Sat - [Clang](/implementation.md#clang): 8.0 (入出力ストリームなし) [mark verified] - [GCC](/implementation.md#gcc): 9.2 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] - diff --git a/reference/chrono/weekday_indexed/index.md b/reference/chrono/weekday_indexed/index.md index 52651980de..45c45f4f3e 100644 --- a/reference/chrono/weekday_indexed/index.md +++ b/reference/chrono/weekday_indexed/index.md @@ -47,4 +47,3 @@ int main() - [Clang](/implementation.md#clang): 8.0 [mark verified] - [GCC](/implementation.md#gcc): 9.2 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] - diff --git a/reference/chrono/weekday_indexed/ok.md b/reference/chrono/weekday_indexed/ok.md index 144cb23a71..411cde882d 100644 --- a/reference/chrono/weekday_indexed/ok.md +++ b/reference/chrono/weekday_indexed/ok.md @@ -56,4 +56,3 @@ int main() - [Clang](/implementation.md#clang): 8.0 [mark verified] - [GCC](/implementation.md#gcc): 9.2 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] - diff --git a/reference/chrono/weekday_indexed/op_ostream.md b/reference/chrono/weekday_indexed/op_ostream.md index d7d9187e64..37214d9cfc 100644 --- a/reference/chrono/weekday_indexed/op_ostream.md +++ b/reference/chrono/weekday_indexed/op_ostream.md @@ -69,4 +69,3 @@ Sun[1] ## 参照 - [P2372R1 Fixing locale handling in chrono formatters](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2372r1.html) - この提案文書はC++20の策定後に採択されたが、実装が追いついていない時期の採択だったために、C++20の仕様として扱われる - diff --git a/reference/chrono/weekday_indexed/weekday.md b/reference/chrono/weekday_indexed/weekday.md index 5e451fd7ee..6fe133b1d8 100644 --- a/reference/chrono/weekday_indexed/weekday.md +++ b/reference/chrono/weekday_indexed/weekday.md @@ -49,4 +49,3 @@ int main() - [Clang](/implementation.md#clang): 8.0 [mark verified] - [GCC](/implementation.md#gcc): 9.2 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] - diff --git a/reference/chrono/weekday_last/ok.md b/reference/chrono/weekday_last/ok.md index 0458f134f0..0bfa755706 100644 --- a/reference/chrono/weekday_last/ok.md +++ b/reference/chrono/weekday_last/ok.md @@ -52,4 +52,3 @@ int main() - [Clang](/implementation.md#clang): 8.0 [mark verified] - [GCC](/implementation.md#gcc): 9.2 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] - diff --git a/reference/chrono/weekday_last/op_ostream.md b/reference/chrono/weekday_last/op_ostream.md index e1fa841b66..dc42674d49 100644 --- a/reference/chrono/weekday_last/op_ostream.md +++ b/reference/chrono/weekday_last/op_ostream.md @@ -65,4 +65,3 @@ Sun[last] ## 参照 - [P2372R1 Fixing locale handling in chrono formatters](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2372r1.html) - この提案文書はC++20の策定後に採択されたが、実装が追いついていない時期の採択だったために、C++20の仕様として扱われる - diff --git a/reference/chrono/weekday_last/weekday.md b/reference/chrono/weekday_last/weekday.md index d66065ecb9..224512d74f 100644 --- a/reference/chrono/weekday_last/weekday.md +++ b/reference/chrono/weekday_last/weekday.md @@ -50,4 +50,3 @@ int main() - [Clang](/implementation.md#clang): 8.0 [mark verified] - [GCC](/implementation.md#gcc): 9.2 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] - diff --git a/reference/chrono/year_month/op_ostream.md b/reference/chrono/year_month/op_ostream.md index eefe2f47b9..eb45968efb 100644 --- a/reference/chrono/year_month/op_ostream.md +++ b/reference/chrono/year_month/op_ostream.md @@ -69,4 +69,3 @@ int main() ## 参照 - [P2372R1 Fixing locale handling in chrono formatters](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2372r1.html) - この提案文書はC++20の策定後に採択されたが、実装が追いついていない時期の採択だったために、C++20の仕様として扱われる - diff --git a/reference/chrono/year_month_day_last/op_ostream.md b/reference/chrono/year_month_day_last/op_ostream.md index 4b69bb4fb2..83ea51e734 100644 --- a/reference/chrono/year_month_day_last/op_ostream.md +++ b/reference/chrono/year_month_day_last/op_ostream.md @@ -68,4 +68,3 @@ int main() ## 参照 - [P2372R1 Fixing locale handling in chrono formatters](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2372r1.html) - この提案文書はC++20の策定後に採択されたが、実装が追いついていない時期の採択だったために、C++20の仕様として扱われる - diff --git a/reference/chrono/year_month_weekday/op_ostream.md b/reference/chrono/year_month_weekday/op_ostream.md index d528a9e7f9..7573f90320 100644 --- a/reference/chrono/year_month_weekday/op_ostream.md +++ b/reference/chrono/year_month_weekday/op_ostream.md @@ -69,4 +69,3 @@ int main() ## 参照 - [P2372R1 Fixing locale handling in chrono formatters](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2372r1.html) - この提案文書はC++20の策定後に採択されたが、実装が追いついていない時期の採択だったために、C++20の仕様として扱われる - diff --git a/reference/chrono/year_month_weekday/op_sys_days.md b/reference/chrono/year_month_weekday/op_sys_days.md index e3e660cd0a..2bbaacf253 100644 --- a/reference/chrono/year_month_weekday/op_sys_days.md +++ b/reference/chrono/year_month_weekday/op_sys_days.md @@ -62,4 +62,3 @@ int main() - [Clang](/implementation.md#clang): 8.0 [mark verified] - [GCC](/implementation.md#gcc): 11.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] - diff --git a/reference/chrono/year_month_weekday_last/op_ostream.md b/reference/chrono/year_month_weekday_last/op_ostream.md index 7141302598..0fed8dfaa7 100644 --- a/reference/chrono/year_month_weekday_last/op_ostream.md +++ b/reference/chrono/year_month_weekday_last/op_ostream.md @@ -71,4 +71,3 @@ int main() ## 参照 - [P2372R1 Fixing locale handling in chrono formatters](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2372r1.html) - この提案文書はC++20の策定後に採択されたが、実装が追いついていない時期の採択だったために、C++20の仕様として扱われる - diff --git a/reference/chrono/zoned_time/formatter.md b/reference/chrono/zoned_time/formatter.md index d923b433e7..4ad843b46c 100644 --- a/reference/chrono/zoned_time/formatter.md +++ b/reference/chrono/zoned_time/formatter.md @@ -92,4 +92,3 @@ int main() - [Clang](/implementation.md#clang): 9.0 [mark noimpl] - [GCC](/implementation.md#gcc): 9.2 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] - diff --git a/reference/chrono/zoned_traits.md b/reference/chrono/zoned_traits.md index d42a46d3c3..71ccffd0c4 100644 --- a/reference/chrono/zoned_traits.md +++ b/reference/chrono/zoned_traits.md @@ -68,4 +68,3 @@ int main() - [Clang](/implementation.md#clang): 9.0 [mark noimpl] - [GCC](/implementation.md#gcc): 9.2 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] - diff --git a/reference/chrono/zoned_traits/default_zone.md b/reference/chrono/zoned_traits/default_zone.md index 4442ddd150..ae9bcac93c 100644 --- a/reference/chrono/zoned_traits/default_zone.md +++ b/reference/chrono/zoned_traits/default_zone.md @@ -51,4 +51,3 @@ int main() - [Clang](/implementation.md#clang): 9.0 [mark noimpl] - [GCC](/implementation.md#gcc): 9.2 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] - diff --git a/reference/chrono/zoned_traits/locate_zone.md b/reference/chrono/zoned_traits/locate_zone.md index 133a9f520f..44ca97eb35 100644 --- a/reference/chrono/zoned_traits/locate_zone.md +++ b/reference/chrono/zoned_traits/locate_zone.md @@ -50,4 +50,3 @@ int main() - [Clang](/implementation.md#clang): 9.0 [mark noimpl] - [GCC](/implementation.md#gcc): 9.2 [mark noimpl] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] - diff --git a/reference/climits.md b/reference/climits.md index 3c66f4c397..a09c191402 100644 --- a/reference/climits.md +++ b/reference/climits.md @@ -40,4 +40,3 @@ |-----------------------------------------|----------------------------|-------| | [`CHAR_BIT`](climits/char_bit.md) | 1バイトのビット数 | | | [`MB_LEN_MAX`](climits/mb_len_max.md) | マルチバイト文字のバイト数 | | - diff --git a/reference/cmath/assoc_legendre.md b/reference/cmath/assoc_legendre.md index 41ec51eb76..7497e9fa45 100644 --- a/reference/cmath/assoc_legendre.md +++ b/reference/cmath/assoc_legendre.md @@ -177,4 +177,3 @@ $$ - [ISO/IEC 29124:2010 Information technology -- Programming languages, their environments and system software interfaces -- Extensions to the C++ Library to support mathematical special functions](https://www.iso.org/standard/50511.html) - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした - diff --git a/reference/cmath/beta.md b/reference/cmath/beta.md index 226357579a..08b495321e 100644 --- a/reference/cmath/beta.md +++ b/reference/cmath/beta.md @@ -102,4 +102,3 @@ $ |\mathrm{B}(x, y)| = \exp(\ln |\Gamma(x) \Gamma(y) / \Gamma(x + y)|)) $ - [ISO/IEC 29124:2010 Information technology -- Programming languages, their environments and system software interfaces -- Extensions to the C++ Library to support mathematical special functions](https://www.iso.org/standard/50511.html) - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で導入された拡張浮動小数点数型への対応として、`float`、`double`、`long double`のオーバーロードを`floating-point-type`のオーバーロードに統合し、拡張浮動小数点数型も扱えるようにした - diff --git a/reference/cmath/huge_val.md b/reference/cmath/huge_val.md index ebbd0853d8..92450325d7 100644 --- a/reference/cmath/huge_val.md +++ b/reference/cmath/huge_val.md @@ -10,4 +10,3 @@ `double` 型の正の値の定数式。 `double` が無限大をサポートする場合、処理系によっては正の無限大となる。 - diff --git a/reference/complex/complex/op_i.md b/reference/complex/complex/op_i.md index 5f61a960b7..ece06a98fa 100644 --- a/reference/complex/complex/op_i.md +++ b/reference/complex/complex/op_i.md @@ -66,4 +66,3 @@ int main() | [`il`](op_il.md) | `complex`のリテラル | - [N3779 User-dened Literals for std::complex part 2 of UDL for Standard Library Types (version 5)](https://isocpp.org/files/papers/N3779.pdf) - diff --git a/reference/complex/complex/op_if.md b/reference/complex/complex/op_if.md index 31590b47d1..c8049f18bb 100644 --- a/reference/complex/complex/op_if.md +++ b/reference/complex/complex/op_if.md @@ -66,4 +66,3 @@ int main() | [`il`](op_il.md) | `complex`のリテラル | - [N3779 User-dened Literals for std::complex part 2 of UDL for Standard Library Types (version 5)](https://isocpp.org/files/papers/N3779.pdf) - diff --git a/reference/complex/complex/op_il.md b/reference/complex/complex/op_il.md index cb2d72b97e..665377a660 100644 --- a/reference/complex/complex/op_il.md +++ b/reference/complex/complex/op_il.md @@ -66,4 +66,3 @@ int main() | [`if`](op_if.md) | `complex`のリテラル | - [N3779 User-dened Literals for std::complex part 2 of UDL for Standard Library Types (version 5)](https://isocpp.org/files/papers/N3779.pdf) - diff --git a/reference/complex/complex/op_istream.md b/reference/complex/complex/op_istream.md index 45a311ca8c..41d73831e7 100644 --- a/reference/complex/complex/op_istream.md +++ b/reference/complex/complex/op_istream.md @@ -60,4 +60,3 @@ int main() | 名前 | 説明 | |-------------------------------|--------------------| | [`operator<<`](op_ostream.md) | ストリームへの出力 | - diff --git a/reference/complex/complex/op_ostream.md b/reference/complex/complex/op_ostream.md index 1141e965aa..5ab3701c3d 100644 --- a/reference/complex/complex/op_ostream.md +++ b/reference/complex/complex/op_ostream.md @@ -60,4 +60,3 @@ int main() | 名前 | 説明 | |-------------------------------|----------------------| | [`operator>>`](op_istream.md) | ストリームからの入力 | - diff --git a/reference/concepts/Callable.md b/reference/concepts/Callable.md index efdd422871..c079d1866c 100644 --- a/reference/concepts/Callable.md +++ b/reference/concepts/Callable.md @@ -62,4 +62,3 @@ int main() ### 出力 ``` ``` - diff --git a/reference/concepts/LessThanComparable.md b/reference/concepts/LessThanComparable.md index 4afa98c7a8..f9acd08a68 100644 --- a/reference/concepts/LessThanComparable.md +++ b/reference/concepts/LessThanComparable.md @@ -17,4 +17,3 @@ a < b - `a`と`b`は、任意の型`T`のオブジェクト - 上述した式の結果として、`bool`に変換可能な型が返ること - `<`は狭義の弱順序を持つこと - diff --git a/reference/concepts/ValueSwappable.md b/reference/concepts/ValueSwappable.md index f723b75a47..e654806bb6 100644 --- a/reference/concepts/ValueSwappable.md +++ b/reference/concepts/ValueSwappable.md @@ -9,4 +9,3 @@ ValueSwappableは、イテレータ要件を満たす型のオブジェクトが ## 要件 - イテレータの要件を満たす型`X`のオブジェクト`x`において、式`*x`によって得られるオブジェクトで[入れ替え可能](swappable.md)であること - diff --git a/reference/concepts/default_initializable.md b/reference/concepts/default_initializable.md index 9cf1c7f6d9..dc2da8d2d0 100644 --- a/reference/concepts/default_initializable.md +++ b/reference/concepts/default_initializable.md @@ -92,4 +92,3 @@ S is not default initializable - [P0898R3 Standard Library Concepts](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0898r3.pdf) - [P1754R1 Rename concepts to standard_case for C++20, while we still can](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1754r1.pdf) - [LWG Issue 3149. DefaultConstructible should require default initialization](https://wg21.cmeerw.net/lwg/issue3149) - diff --git a/reference/concepts/integral.md b/reference/concepts/integral.md index 24464dbf30..cb3a573324 100644 --- a/reference/concepts/integral.md +++ b/reference/concepts/integral.md @@ -81,4 +81,3 @@ std::integral_constant is not integral - [P0898R3 Standard Library Concepts](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0898r3.pdf) - [P1754R1 Rename concepts to standard_case for C++20, while we still can](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1754r1.pdf) - diff --git a/reference/concepts/move_constructible.md b/reference/concepts/move_constructible.md index 04498594b0..795a7030b2 100644 --- a/reference/concepts/move_constructible.md +++ b/reference/concepts/move_constructible.md @@ -85,6 +85,3 @@ M is move constructible - [P0898R3 Standard Library Concepts](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0898r3.pdf) - [P1754R1 Rename concepts to standard_case for C++20, while we still can](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1754r1.pdf) - - - diff --git a/reference/concepts/signed_integral.md b/reference/concepts/signed_integral.md index a4397033e3..5a1ea6c0e2 100644 --- a/reference/concepts/signed_integral.md +++ b/reference/concepts/signed_integral.md @@ -88,4 +88,3 @@ std::integral_constant is not signed_integral - [P0898R3 Standard Library Concepts](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0898r3.pdf) - [P1754R1 Rename concepts to standard_case for C++20, while we still can](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1754r1.pdf) - diff --git a/reference/concepts/swappable.md b/reference/concepts/swappable.md index 53a41dc3ba..67d2743d15 100644 --- a/reference/concepts/swappable.md +++ b/reference/concepts/swappable.md @@ -215,4 +215,3 @@ NS::S2 is not swappable with NS::S1 - [P0898R3 Standard Library Concepts](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0898r3.pdf) - [P1754R1 Rename concepts to standard_case for C++20, while we still can](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1754r1.pdf) - [LWG Issue 3175. The `CommonReference` requirement of concept `SwappableWith` is not satisfied in the example](https://wg21.cmeerw.net/lwg/issue3175) - diff --git a/reference/concepts/totally_ordered.md b/reference/concepts/totally_ordered.md index 8975853576..e9f34d82be 100644 --- a/reference/concepts/totally_ordered.md +++ b/reference/concepts/totally_ordered.md @@ -221,4 +221,3 @@ S2 is not totally ordered with int - [P1754R1 Rename concepts to standard_case for C++20, while we still can](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1754r1.pdf) - [LWG Issue 3329. `totally_ordered_with` both directly and indirectly requires `common_reference_with`](https://wg21.cmeerw.net/lwg/issue3329) - [LWG Issue 3331. Define `totally_ordered/_with` in terms of `partially-ordered-with`](https://wg21.cmeerw.net/lwg/issue3331) - diff --git a/reference/concepts/unsigned_integral.md b/reference/concepts/unsigned_integral.md index 764d82bb3f..b534f63e34 100644 --- a/reference/concepts/unsigned_integral.md +++ b/reference/concepts/unsigned_integral.md @@ -88,4 +88,3 @@ std::integral_constant is not unsigned_integral - [P0898R3 Standard Library Concepts](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0898r3.pdf) - [P1754R1 Rename concepts to standard_case for C++20, while we still can](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1754r1.pdf) - diff --git a/reference/condition_variable.md b/reference/condition_variable.md index 413cdb5958..d56a7e0465 100644 --- a/reference/condition_variable.md +++ b/reference/condition_variable.md @@ -15,5 +15,3 @@ ## バージョン ### 言語 - C++11 - - diff --git a/reference/condition_variable/condition_variable.md b/reference/condition_variable/condition_variable.md index c16402a1fa..f04ee62182 100644 --- a/reference/condition_variable/condition_variable.md +++ b/reference/condition_variable/condition_variable.md @@ -129,4 +129,3 @@ process data ## 参照 - [Condition Variables - Operating Systems: Three Easy Pieces](http://pages.cs.wisc.edu/~remzi/OSTEP/threads-cv.pdf) - diff --git a/reference/condition_variable/condition_variable/native_handle.md b/reference/condition_variable/condition_variable/native_handle.md index da463b0497..c0acd4218f 100644 --- a/reference/condition_variable/condition_variable/native_handle.md +++ b/reference/condition_variable/condition_variable/native_handle.md @@ -56,5 +56,3 @@ int main() - [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified] ## 参照 - - diff --git a/reference/condition_variable/condition_variable/notify_all.md b/reference/condition_variable/condition_variable/notify_all.md index 8cd8ef379a..d6b04f5de9 100644 --- a/reference/condition_variable/condition_variable/notify_all.md +++ b/reference/condition_variable/condition_variable/notify_all.md @@ -104,5 +104,3 @@ process data ## 参照 - - diff --git a/reference/condition_variable/condition_variable/notify_all_at_thread_exit.md b/reference/condition_variable/condition_variable/notify_all_at_thread_exit.md index 9f13e89fc7..1aebf43ecb 100644 --- a/reference/condition_variable/condition_variable/notify_all_at_thread_exit.md +++ b/reference/condition_variable/condition_variable/notify_all_at_thread_exit.md @@ -127,4 +127,3 @@ data is ready: true ## 参照 - [_at_thread_exit系の関数が存在している理由](/article/lib/at_thread_exit.md) - [N3070 - Handling Detached Threads and thread_local Variables](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3070.html) - diff --git a/reference/condition_variable/condition_variable/notify_one.md b/reference/condition_variable/condition_variable/notify_one.md index f59f2e8c24..c41ddb3387 100644 --- a/reference/condition_variable/condition_variable/notify_one.md +++ b/reference/condition_variable/condition_variable/notify_one.md @@ -101,5 +101,3 @@ process data ## 参照 - - diff --git a/reference/condition_variable/condition_variable/op_constructor.md b/reference/condition_variable/condition_variable/op_constructor.md index 98acafd486..a914cba0c0 100644 --- a/reference/condition_variable/condition_variable/op_constructor.md +++ b/reference/condition_variable/condition_variable/op_constructor.md @@ -47,5 +47,3 @@ int main() - 2012までは、delete宣言に対応していないため、代わりにprivateで宣言のみ行う手法で代用されている。 ## 参照 - - diff --git a/reference/condition_variable/condition_variable/op_destructor.md b/reference/condition_variable/condition_variable/op_destructor.md index 2ae9ee0b12..ee88010a6b 100644 --- a/reference/condition_variable/condition_variable/op_destructor.md +++ b/reference/condition_variable/condition_variable/op_destructor.md @@ -45,5 +45,3 @@ ## 参照 - - diff --git a/reference/condition_variable/condition_variable/wait.md b/reference/condition_variable/condition_variable/wait.md index 939314c11d..e58d656d6d 100644 --- a/reference/condition_variable/condition_variable/wait.md +++ b/reference/condition_variable/condition_variable/wait.md @@ -165,4 +165,3 @@ process data ## 参照 - [LWG Issue 2093. Throws clause of `condition_variable::wait` with predicate](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2093) - [LWG Issue 2135. Unclear requirement for exceptions thrown in `condition_variable::wait()`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2135) - diff --git a/reference/condition_variable/condition_variable/wait_for.md b/reference/condition_variable/condition_variable/wait_for.md index 84414c8159..d7098885a1 100644 --- a/reference/condition_variable/condition_variable/wait_for.md +++ b/reference/condition_variable/condition_variable/wait_for.md @@ -185,5 +185,3 @@ process data ## 参照 - [LWG Issue 2093. Throws clause of `condition_variable::wait` with predicate](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2093) - [LWG Issue 2135. Unclear requirement for exceptions thrown in `condition_variable::wait()`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2135) - - diff --git a/reference/condition_variable/condition_variable/wait_until.md b/reference/condition_variable/condition_variable/wait_until.md index 2f6a6c55e5..d67be55142 100644 --- a/reference/condition_variable/condition_variable/wait_until.md +++ b/reference/condition_variable/condition_variable/wait_until.md @@ -197,4 +197,3 @@ process data - [LWG Issue 2135. Unclear requirement for exceptions thrown in `condition_variable::wait()`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2135) - [Bug 41861 (DR887) - [DR 887][C++0x] `` does not use `monotonic_clock`](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41861) - GCC 10から`steady_clock`がサポートされた - diff --git a/reference/condition_variable/condition_variable_any.md b/reference/condition_variable/condition_variable_any.md index 0c8369217c..3fdb55dfe6 100644 --- a/reference/condition_variable/condition_variable_any.md +++ b/reference/condition_variable/condition_variable_any.md @@ -110,4 +110,3 @@ process data ## 参照 - diff --git a/reference/condition_variable/condition_variable_any/notify_all.md b/reference/condition_variable/condition_variable_any/notify_all.md index 29c1b229e8..a5f351490e 100644 --- a/reference/condition_variable/condition_variable_any/notify_all.md +++ b/reference/condition_variable/condition_variable_any/notify_all.md @@ -106,5 +106,3 @@ process data ## 参照 - - diff --git a/reference/condition_variable/condition_variable_any/notify_one.md b/reference/condition_variable/condition_variable_any/notify_one.md index dd0ad3ad74..3b26534a14 100644 --- a/reference/condition_variable/condition_variable_any/notify_one.md +++ b/reference/condition_variable/condition_variable_any/notify_one.md @@ -102,5 +102,3 @@ process data ## 参照 - - diff --git a/reference/condition_variable/condition_variable_any/op_constructor.md b/reference/condition_variable/condition_variable_any/op_constructor.md index 820e59296b..60c8d0ffa4 100644 --- a/reference/condition_variable/condition_variable_any/op_constructor.md +++ b/reference/condition_variable/condition_variable_any/op_constructor.md @@ -51,4 +51,3 @@ int main() ## 参照 - [LWG Issue 2092. Vague Wording for `condition_variable_any`] - C++11では`resource_unavailable_try_again`エラーの理由が「native handleの計算ができなかった」というものだった。しかし、このクラスはnative handleを持っていることがpublicインタフェースになっていないため、C++14で「制限により、非メモリリソースの初期化ができなかった」という表現に修正。 - diff --git a/reference/condition_variable/condition_variable_any/op_destructor.md b/reference/condition_variable/condition_variable_any/op_destructor.md index 14c65e85ed..c79c5db7ce 100644 --- a/reference/condition_variable/condition_variable_any/op_destructor.md +++ b/reference/condition_variable/condition_variable_any/op_destructor.md @@ -44,5 +44,3 @@ ## 参照 - - diff --git a/reference/condition_variable/cv_status.md b/reference/condition_variable/cv_status.md index b0dd31e004..585548ba9e 100644 --- a/reference/condition_variable/cv_status.md +++ b/reference/condition_variable/cv_status.md @@ -47,5 +47,3 @@ namespace std { ## 参照 - - diff --git a/reference/contracts/detection_mode.md b/reference/contracts/detection_mode.md index 31c740bb2c..42cb2b8dcb 100644 --- a/reference/contracts/detection_mode.md +++ b/reference/contracts/detection_mode.md @@ -38,4 +38,3 @@ namespace std::contracts { ## 参照 - [P0542R5 Support for contract based programming in C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0542r5.html) - diff --git a/reference/cstddef.md b/reference/cstddef.md index a964b9c167..d67a04642e 100644 --- a/reference/cstddef.md +++ b/reference/cstddef.md @@ -31,5 +31,3 @@ C言語においては、このヘッダは`wchar_t`型(ワイド文字型)の宣言もインクルードする。C++において`wchar_t`型は組み込み型であるため、いかなるヘッダもインクルードする必要がない。 - - diff --git a/reference/cstddef/offsetof.md b/reference/cstddef/offsetof.md index 5f4e96ed53..135436e46e 100644 --- a/reference/cstddef/offsetof.md +++ b/reference/cstddef/offsetof.md @@ -51,5 +51,3 @@ offsetof(mystruct,singlechar) is 0 offsetof(mystruct,arraymember) is 1 offsetof(mystruct,anotherchar) is 11 ``` - - diff --git a/reference/cstdint.md b/reference/cstdint.md index 272253aa29..ec90bd79f7 100644 --- a/reference/cstdint.md +++ b/reference/cstdint.md @@ -159,4 +159,3 @@ C99 の 7.18.3 `` についての脚注で、同ヘッダを C++ で ## 参照 - [N1568 Proposed additions to TR-1 to improve compatibility with C99](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1568.htm) - [N1835 `` for C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1835.pdf) - diff --git a/reference/cstdint/int16_max.md b/reference/cstdint/int16_max.md index 1572e6fffc..6b98d79755 100644 --- a/reference/cstdint/int16_max.md +++ b/reference/cstdint/int16_max.md @@ -44,4 +44,3 @@ int main() - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012以降、値の型は`short`となっており、標準規格に合致していないことに注意。 - diff --git a/reference/cstdint/int16_min.md b/reference/cstdint/int16_min.md index 801932b02b..1abee7c557 100644 --- a/reference/cstdint/int16_min.md +++ b/reference/cstdint/int16_min.md @@ -43,4 +43,3 @@ int main() - [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - diff --git a/reference/cstdint/int32_max.md b/reference/cstdint/int32_max.md index 518a3915d0..47ffe157c8 100644 --- a/reference/cstdint/int32_max.md +++ b/reference/cstdint/int32_max.md @@ -43,4 +43,3 @@ int main() - [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - diff --git a/reference/cstdint/int32_min.md b/reference/cstdint/int32_min.md index 68d08f2a7a..4a5fcf47aa 100644 --- a/reference/cstdint/int32_min.md +++ b/reference/cstdint/int32_min.md @@ -43,4 +43,3 @@ int main() - [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - diff --git a/reference/cstdint/int64_max.md b/reference/cstdint/int64_max.md index dff7a034f1..2c5d2ea531 100644 --- a/reference/cstdint/int64_max.md +++ b/reference/cstdint/int64_max.md @@ -43,4 +43,3 @@ int main() - [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - diff --git a/reference/cstdint/int64_min.md b/reference/cstdint/int64_min.md index cdd96d25a7..7ad38bc46a 100644 --- a/reference/cstdint/int64_min.md +++ b/reference/cstdint/int64_min.md @@ -43,4 +43,3 @@ int main() - [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - diff --git a/reference/cstdint/int8_max.md b/reference/cstdint/int8_max.md index 245af0668b..8e5e02c2b6 100644 --- a/reference/cstdint/int8_max.md +++ b/reference/cstdint/int8_max.md @@ -46,4 +46,3 @@ Visual C++では、`static_cast(INT8_MAX)`としないと、このとおり - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012以降、値の型は`char`となっており、標準規格に合致していないことに注意。 - diff --git a/reference/cstdint/int8_min.md b/reference/cstdint/int8_min.md index 338af512ac..07b2a8caeb 100644 --- a/reference/cstdint/int8_min.md +++ b/reference/cstdint/int8_min.md @@ -43,4 +43,3 @@ int main() - [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - diff --git a/reference/cstdint/intptr_max.md b/reference/cstdint/intptr_max.md index a4c67b1501..47d80b5a8c 100644 --- a/reference/cstdint/intptr_max.md +++ b/reference/cstdint/intptr_max.md @@ -42,4 +42,3 @@ int main() - [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/cstdint/intptr_min.md b/reference/cstdint/intptr_min.md index 66f373e33c..8d4f0da06f 100644 --- a/reference/cstdint/intptr_min.md +++ b/reference/cstdint/intptr_min.md @@ -42,4 +42,3 @@ int main() - [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/cstdint/sig_atomic_max.md b/reference/cstdint/sig_atomic_max.md index 44cf332d5a..42ceab4e0a 100644 --- a/reference/cstdint/sig_atomic_max.md +++ b/reference/cstdint/sig_atomic_max.md @@ -42,4 +42,3 @@ int main() - [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/cstdint/sig_atomic_min.md b/reference/cstdint/sig_atomic_min.md index 7ed0d464d5..2e0e41035e 100644 --- a/reference/cstdint/sig_atomic_min.md +++ b/reference/cstdint/sig_atomic_min.md @@ -42,4 +42,3 @@ int main() - [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/cstdint/size_max.md b/reference/cstdint/size_max.md index 13bac70b9d..5f18431b30 100644 --- a/reference/cstdint/size_max.md +++ b/reference/cstdint/size_max.md @@ -41,4 +41,3 @@ int main() - [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/cstdint/uint16_max.md b/reference/cstdint/uint16_max.md index bfb5cc98d8..79fb3b8cc9 100644 --- a/reference/cstdint/uint16_max.md +++ b/reference/cstdint/uint16_max.md @@ -44,4 +44,3 @@ int main() - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012以降、値の型は`unsigned short`となっており、標準規格に合致していないことに注意。 - diff --git a/reference/cstdint/uint32_max.md b/reference/cstdint/uint32_max.md index d5d954d245..b8bb282f89 100644 --- a/reference/cstdint/uint32_max.md +++ b/reference/cstdint/uint32_max.md @@ -43,4 +43,3 @@ int main() - [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - diff --git a/reference/cstdint/uint64_max.md b/reference/cstdint/uint64_max.md index fed5baefdb..b4d4a32000 100644 --- a/reference/cstdint/uint64_max.md +++ b/reference/cstdint/uint64_max.md @@ -43,4 +43,3 @@ int main() - [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - diff --git a/reference/cstdint/uint8_max.md b/reference/cstdint/uint8_max.md index 7491090d85..bd930cbc52 100644 --- a/reference/cstdint/uint8_max.md +++ b/reference/cstdint/uint8_max.md @@ -45,4 +45,3 @@ Visual C++では、`static_cast(UINT8_MAX)`としないと、このとお - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - 2012以降、値の型は`unsigned char`となっており、標準規格に合致していないことに注意。 - diff --git a/reference/cstdint/uintptr_max.md b/reference/cstdint/uintptr_max.md index 92c10c661b..9c4818d169 100644 --- a/reference/cstdint/uintptr_max.md +++ b/reference/cstdint/uintptr_max.md @@ -42,4 +42,3 @@ int main() - [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/cstdint/wchar_max.md b/reference/cstdint/wchar_max.md index 528969baa0..c45f4f9c4d 100644 --- a/reference/cstdint/wchar_max.md +++ b/reference/cstdint/wchar_max.md @@ -40,4 +40,3 @@ int main() - [GCC](/implementation.md#gcc): 4.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - diff --git a/reference/cstdint/wchar_min.md b/reference/cstdint/wchar_min.md index fac479e697..20258ff8ac 100644 --- a/reference/cstdint/wchar_min.md +++ b/reference/cstdint/wchar_min.md @@ -40,4 +40,3 @@ int main() - [GCC](/implementation.md#gcc): 4.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - diff --git a/reference/cstdint/wint_max.md b/reference/cstdint/wint_max.md index 785494ede4..ca96b6548c 100644 --- a/reference/cstdint/wint_max.md +++ b/reference/cstdint/wint_max.md @@ -41,4 +41,3 @@ int main() - [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - diff --git a/reference/cstdint/wint_min.md b/reference/cstdint/wint_min.md index 8c44958daa..e1f1feace1 100644 --- a/reference/cstdint/wint_min.md +++ b/reference/cstdint/wint_min.md @@ -41,4 +41,3 @@ int main() - [GCC](/implementation.md#gcc): 4.4 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - diff --git a/reference/cstdio/eof.md b/reference/cstdio/eof.md index d33119cf9f..231b8689a0 100644 --- a/reference/cstdio/eof.md +++ b/reference/cstdio/eof.md @@ -47,4 +47,3 @@ REACHED END - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/cstdio/tmpfile.md b/reference/cstdio/tmpfile.md index c01f298e74..5dfc0eda08 100644 --- a/reference/cstdio/tmpfile.md +++ b/reference/cstdio/tmpfile.md @@ -28,5 +28,3 @@ namespace std { - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - - diff --git a/reference/cstdio/tmpnam.md b/reference/cstdio/tmpnam.md index 95dd293699..ad26323a4f 100644 --- a/reference/cstdio/tmpnam.md +++ b/reference/cstdio/tmpnam.md @@ -46,4 +46,3 @@ int main() { - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/cstdlib.md b/reference/cstdlib.md index 560a7fc6da..b0cb420537 100644 --- a/reference/cstdlib.md +++ b/reference/cstdlib.md @@ -101,5 +101,3 @@ | `wctomb` | ワイド文字を、マルチバイト文字に変換する (function) | | | `mbstowcs` | マルチバイト文字列を、ワイド文字列に変換する (function) | | | `wcstombs` | ワイド文字列を、マルチバイト文字列に変換する (function) | | - - diff --git a/reference/cstdlib/abort.md b/reference/cstdlib/abort.md index 972f6214bb..5e301f80ff 100644 --- a/reference/cstdlib/abort.md +++ b/reference/cstdlib/abort.md @@ -47,5 +47,3 @@ int main() ``` Aborted ``` - - diff --git a/reference/cstdlib/at_quick_exit.md b/reference/cstdlib/at_quick_exit.md index b40a96bc60..85503f8336 100644 --- a/reference/cstdlib/at_quick_exit.md +++ b/reference/cstdlib/at_quick_exit.md @@ -69,4 +69,3 @@ on exit ## 参照 - [N2440 Abandoning a Process](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2440.htm) - diff --git a/reference/cstdlib/atexit.md b/reference/cstdlib/atexit.md index cbc3ea2b8d..d24103f229 100644 --- a/reference/cstdlib/atexit.md +++ b/reference/cstdlib/atexit.md @@ -66,5 +66,3 @@ on exit | 名前 | 説明 | |------|------| | [`exit`](exit.md) | プログラムを終了させる | - - diff --git a/reference/cstdlib/div_t.md b/reference/cstdlib/div_t.md index 799dad33ab..d6371fbf8e 100644 --- a/reference/cstdlib/div_t.md +++ b/reference/cstdlib/div_t.md @@ -38,4 +38,3 @@ int main() 2 1 ``` - diff --git a/reference/cstdlib/exit.md b/reference/cstdlib/exit.md index 6cab65e729..9d2ae8c241 100644 --- a/reference/cstdlib/exit.md +++ b/reference/cstdlib/exit.md @@ -67,5 +67,3 @@ int main() |------|------| | [`atexit`](atexit.md) | プログラムが通常の方法で終了するときに呼ばれる関数を登録する | | [`quick_exit`](quick_exit.md) | 後処理をせずに、プログラムを終了させる | - - diff --git a/reference/cstdlib/exit_.md b/reference/cstdlib/exit_.md index 49c03a2c61..7879a0406d 100644 --- a/reference/cstdlib/exit_.md +++ b/reference/cstdlib/exit_.md @@ -90,4 +90,3 @@ int main() ## 参照 - [N2440 Abandoning a Process](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2440.htm) - [detachスレッドとプログラム終了処理 - yohhoyの日記](http://d.hatena.ne.jp/yohhoy/20120512/p1) - diff --git a/reference/cstdlib/exit_failure.md b/reference/cstdlib/exit_failure.md index 4ae3346d8f..89cf01b669 100644 --- a/reference/cstdlib/exit_failure.md +++ b/reference/cstdlib/exit_failure.md @@ -29,5 +29,3 @@ int main() ## 出力 ``` ``` - - diff --git a/reference/cstdlib/exit_success.md b/reference/cstdlib/exit_success.md index e45254c1b1..292fc8170a 100644 --- a/reference/cstdlib/exit_success.md +++ b/reference/cstdlib/exit_success.md @@ -29,5 +29,3 @@ int main() ## 出力 ``` ``` - - diff --git a/reference/cstdlib/getenv.md b/reference/cstdlib/getenv.md index 971676c03a..b9d5aecaf6 100644 --- a/reference/cstdlib/getenv.md +++ b/reference/cstdlib/getenv.md @@ -39,4 +39,3 @@ int main() ``` Your PATH is: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games ``` - diff --git a/reference/cstdlib/ldiv_t.md b/reference/cstdlib/ldiv_t.md index a9de6511cd..1a3f454b04 100644 --- a/reference/cstdlib/ldiv_t.md +++ b/reference/cstdlib/ldiv_t.md @@ -38,4 +38,3 @@ int main() 2 1 ``` - diff --git a/reference/cstdlib/lldiv_t.md b/reference/cstdlib/lldiv_t.md index 4fc72ed076..07b24ae6d2 100644 --- a/reference/cstdlib/lldiv_t.md +++ b/reference/cstdlib/lldiv_t.md @@ -39,4 +39,3 @@ int main() 2 1 ``` - diff --git a/reference/cstdlib/quick_exit.md b/reference/cstdlib/quick_exit.md index 746c794472..444a76f440 100644 --- a/reference/cstdlib/quick_exit.md +++ b/reference/cstdlib/quick_exit.md @@ -78,4 +78,3 @@ int main() ## 参照 - [N2440 Abandoning a Process](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2440.htm) - [detachスレッドとプログラム終了処理 - yohhoyの日記](http://d.hatena.ne.jp/yohhoy/20120512/p1) - diff --git a/reference/deque/deque.md b/reference/deque/deque.md index bda4249d4e..774e9776f5 100644 --- a/reference/deque/deque.md +++ b/reference/deque/deque.md @@ -193,4 +193,3 @@ int main() ## 参照 - [N2669 Thread-Safety in the Standard Library (Rev 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2669.htm) - diff --git a/reference/deque/deque/assign.md b/reference/deque/deque/assign.md index e69c1c85fb..9ce80c50a6 100644 --- a/reference/deque/deque/assign.md +++ b/reference/deque/deque/assign.md @@ -73,5 +73,3 @@ c3 : {1 2 3 } ## 参照 - [N2679 Initializer Lists for Standard Containers(Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2679.pdf) - - diff --git a/reference/deque/deque/at.md b/reference/deque/deque/at.md index 080ff254f0..f3274d18d2 100644 --- a/reference/deque/deque/at.md +++ b/reference/deque/deque/at.md @@ -68,5 +68,3 @@ out of range! | 名前 | 説明 | |----------------------------|----------------------------------| | [`operator[]`](op_at.md) | 任意位置の要素への参照を取得する | - - diff --git a/reference/deque/deque/back.md b/reference/deque/deque/back.md index 14e87b9370..b606854ddf 100644 --- a/reference/deque/deque/back.md +++ b/reference/deque/deque/back.md @@ -53,5 +53,3 @@ int main() | [`front`](front.md) | 先頭要素への参照を取得する | | [`push_back`](push_back.md) | 末尾に要素を追加する | | [`pop_back`](pop_back.md) | 末尾要素を削除する | - - diff --git a/reference/deque/deque/begin.md b/reference/deque/deque/begin.md index 0c791f0fbd..d2dee08e17 100644 --- a/reference/deque/deque/begin.md +++ b/reference/deque/deque/begin.md @@ -63,5 +63,3 @@ int main() | [`cend`](cend.md) | 末尾要素を指す読み取り専用イテレータを取得する | | [`rbegin`](rbegin.md) | 末尾要素を指す逆イテレータを取得する | | [`rend`](rend.md) | 先頭要素の前を指す逆イテレータを取得する | - - diff --git a/reference/deque/deque/cbegin.md b/reference/deque/deque/cbegin.md index 06b5e2ee11..b1ebb85fec 100644 --- a/reference/deque/deque/cbegin.md +++ b/reference/deque/deque/cbegin.md @@ -67,5 +67,3 @@ int main() - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 - - diff --git a/reference/deque/deque/cend.md b/reference/deque/deque/cend.md index be536a3937..27f6c440c2 100644 --- a/reference/deque/deque/cend.md +++ b/reference/deque/deque/cend.md @@ -71,5 +71,3 @@ int main() ## 参照 - - diff --git a/reference/deque/deque/clear.md b/reference/deque/deque/clear.md index 39e0bf3403..14f361df62 100644 --- a/reference/deque/deque/clear.md +++ b/reference/deque/deque/clear.md @@ -72,5 +72,3 @@ int main() | [`pop_back`](pop_back.md) | 末尾要素を削除する | | [`pop_front`](pop_front.md) | 先頭要素を削除する | | [`empty`](empty.md) | コンテナが空であるかどうかを調べる | - - diff --git a/reference/deque/deque/crbegin.md b/reference/deque/deque/crbegin.md index 4f3387846e..c8b733ea59 100644 --- a/reference/deque/deque/crbegin.md +++ b/reference/deque/deque/crbegin.md @@ -67,5 +67,3 @@ int main() ## 参照 - - diff --git a/reference/deque/deque/crend.md b/reference/deque/deque/crend.md index c21941b5ae..67827fcc28 100644 --- a/reference/deque/deque/crend.md +++ b/reference/deque/deque/crend.md @@ -67,5 +67,3 @@ int main() ## 参照 - - diff --git a/reference/deque/deque/emplace.md b/reference/deque/deque/emplace.md index ca1870f334..8df8398677 100644 --- a/reference/deque/deque/emplace.md +++ b/reference/deque/deque/emplace.md @@ -85,5 +85,3 @@ int main() - [N2345 Placement Insert for Containers (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2345.pdf) - [LWG Issue 2252. Strong guarantee on `vector::push_back()` still broken with C++11?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2252) - 経緯の説明は、[`vector::push_back()`](/reference/vector/vector/push_back.md)ページを参照。 - - diff --git a/reference/deque/deque/end.md b/reference/deque/deque/end.md index 2369e4812b..245a33ef4d 100644 --- a/reference/deque/deque/end.md +++ b/reference/deque/deque/end.md @@ -80,5 +80,3 @@ int main() | [`cend`](cend.md) | 末尾要素の次を指す読み取り専用イテレータを取得する | | [`rbegin`](rbegin.md) | 末尾要素を指す逆イテレータを取得する | | [`rend`](rend.md) | 先頭要素の前を指す逆イテレータを取得する | - - diff --git a/reference/deque/deque/erase.md b/reference/deque/deque/erase.md index 8d31747777..4c4386632f 100644 --- a/reference/deque/deque/erase.md +++ b/reference/deque/deque/erase.md @@ -110,4 +110,3 @@ int main() ## 参照 - [N2350 Container insert/erase and iterator constness (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2350.pdf) - [LWG Issue 638. `deque` end invalidation during erase](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#638) - diff --git a/reference/deque/deque/front.md b/reference/deque/deque/front.md index 293e6791b9..b8a0bff709 100644 --- a/reference/deque/deque/front.md +++ b/reference/deque/deque/front.md @@ -53,5 +53,3 @@ int main() | [`back`](back.md) | 末尾要素への参照を取得する | | [`push_front`](push_front.md) | 先頭に要素を追加する | | [`pop_front`](pop_front.md) | 先頭要素を削除する | - - diff --git a/reference/deque/deque/get_allocator.md b/reference/deque/deque/get_allocator.md index 598d275b2f..c49b963d7d 100644 --- a/reference/deque/deque/get_allocator.md +++ b/reference/deque/deque/get_allocator.md @@ -70,5 +70,3 @@ int main () - 2015からは、`noexcept`が修飾されている。 ## 参照 - - diff --git a/reference/deque/deque/insert.md b/reference/deque/deque/insert.md index 57ad542bd9..bb3183637c 100644 --- a/reference/deque/deque/insert.md +++ b/reference/deque/deque/insert.md @@ -103,4 +103,3 @@ int main() - (5)の経緯となる提案文書 - [LWG Issue 2252. Strong guarantee on `vector::push_back()` still broken with C++11?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2252) - 経緯の説明は、[`vector::push_back()`](/reference/vector/vector/push_back.md)ページを参照。 - diff --git a/reference/deque/deque/max_size.md b/reference/deque/deque/max_size.md index 9bd2e6dabc..a115c015fd 100644 --- a/reference/deque/deque/max_size.md +++ b/reference/deque/deque/max_size.md @@ -51,5 +51,3 @@ int main() |-------------------------|------------------| | [`size`](size.md) | 要素数を取得する | | [`resize`](resize.md) | 要素数を変更する | - - diff --git a/reference/deque/deque/op_assign.md b/reference/deque/deque/op_assign.md index 0e214ced8a..ef7bfc1a87 100644 --- a/reference/deque/deque/op_assign.md +++ b/reference/deque/deque/op_assign.md @@ -85,4 +85,3 @@ c3 : {1 2 3 } - (3)の経緯となる提案文書 - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) - `noexcept` 追加の経緯となる提案文書 - diff --git a/reference/deque/deque/op_at.md b/reference/deque/deque/op_at.md index 855300610c..15c725c4d1 100644 --- a/reference/deque/deque/op_at.md +++ b/reference/deque/deque/op_at.md @@ -57,5 +57,3 @@ int main() | 名前 | 説明 | |-----------------|----------------------------------| | [`at`](at.md) | 任意位置の要素への参照を取得する | - - diff --git a/reference/deque/deque/op_deduction_guide.md b/reference/deque/deque/op_deduction_guide.md index 813dc555f6..08bd1657ab 100644 --- a/reference/deque/deque/op_deduction_guide.md +++ b/reference/deque/deque/op_deduction_guide.md @@ -84,4 +84,3 @@ int main() ## 参照 - [P0433R2 Toward a resolution of US7 and US14: Integrating template deduction for class templates into the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0433r2.html) - diff --git a/reference/deque/deque/pop_back.md b/reference/deque/deque/pop_back.md index a938ef0add..506d139ee7 100644 --- a/reference/deque/deque/pop_back.md +++ b/reference/deque/deque/pop_back.md @@ -58,5 +58,3 @@ int main() | [`pop_front`](pop_front.md) | 先頭要素を削除する | | [`push_back`](push_back.md) | 末尾に要素を追加する | | [`erase`](erase.md) | 指定した要素を削除する | - - diff --git a/reference/deque/deque/pop_front.md b/reference/deque/deque/pop_front.md index 9bfcd5e80e..aef49f01dd 100644 --- a/reference/deque/deque/pop_front.md +++ b/reference/deque/deque/pop_front.md @@ -54,5 +54,3 @@ int main() | [`pop_back`](pop_back.md) | 末尾要素を削除する | | [`push_front`](push_front.md) | 先頭に要素を追加する | | [`erase`](erase.md) | 指定した要素を削除する | - - diff --git a/reference/deque/deque/push_back.md b/reference/deque/deque/push_back.md index 0bb55bf002..d4e80868a3 100644 --- a/reference/deque/deque/push_back.md +++ b/reference/deque/deque/push_back.md @@ -72,4 +72,3 @@ world ## 参照 - [LWG Issue 2252. Strong guarantee on `vector::push_back()` still broken with C++11?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2252) - 経緯の説明は、[`vector::push_back()`](/reference/vector/vector/push_back.md)ページを参照。 - diff --git a/reference/deque/deque/push_front.md b/reference/deque/deque/push_front.md index 5b75b8fb72..bf7c50f849 100644 --- a/reference/deque/deque/push_front.md +++ b/reference/deque/deque/push_front.md @@ -72,4 +72,3 @@ world ## 参照 - [LWG Issue 2252. Strong guarantee on `vector::push_back()` still broken with C++11?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2252) - 経緯の説明は、[`vector::push_back()`](/reference/vector/vector/push_back.md)ページを参照。 - diff --git a/reference/deque/deque/rbegin.md b/reference/deque/deque/rbegin.md index 09ea8e44ef..ec0364b5c5 100644 --- a/reference/deque/deque/rbegin.md +++ b/reference/deque/deque/rbegin.md @@ -63,5 +63,3 @@ int main() | [`crend`](crend.md) | 先頭要素の前を指す読み取り専用逆イテレータを取得する | | [`begin`](begin.md) | 先頭要素を指すイテレータの取得する | | [`end`](end.md) | 末尾要素の次を指すイテレータを取得する | - - diff --git a/reference/deque/deque/rend.md b/reference/deque/deque/rend.md index 7e4b450fe4..c690d722e8 100644 --- a/reference/deque/deque/rend.md +++ b/reference/deque/deque/rend.md @@ -76,5 +76,3 @@ int main() | [`crend`](crend.md) | 先頭要素の前を指す読み取り専用逆イテレータを取得する | | [`begin`](begin.md) | 先頭要素を指すイテレータの取得する | | [`end`](end.md) | 末尾要素の次を指すイテレータを取得する | - - diff --git a/reference/deque/deque/resize.md b/reference/deque/deque/resize.md index 21eeaa3ea1..6f3626ed43 100644 --- a/reference/deque/deque/resize.md +++ b/reference/deque/deque/resize.md @@ -113,5 +113,3 @@ int main() | 名前 | 説明 | |---------------------|------------------| | [`size`](size.md) | 要素数を取得する | - - diff --git a/reference/deque/deque/size.md b/reference/deque/deque/size.md index ff0e527272..6f0dcf6015 100644 --- a/reference/deque/deque/size.md +++ b/reference/deque/deque/size.md @@ -51,5 +51,3 @@ int main() |-----------------------------|----------------------------------| | [`resize`](resize.md) | 要素数を変更する | | [`max_size`](max_size.md) | 格納可能な最大の要素数を取得する | - - diff --git a/reference/exception.md b/reference/exception.md index d0c4bf6c94..19faa4c8f4 100644 --- a/reference/exception.md +++ b/reference/exception.md @@ -24,4 +24,3 @@ | [`make_exception_ptr`](exception/make_exception_ptr.md) | 例外ポインタを作成する(function) | C++11 | | [`throw_with_nested`](exception/throw_with_nested.md) | 現在の例外を入れ子にした例外を送出する(function) | C++11 | | [`rethrow_if_nested`](exception/rethrow_if_nested.md) | 入れ子になった例外が存在する場合に、入れ子になった例外を送出する(function) | C++11 | - diff --git a/reference/exception/bad_exception/op_assign.md b/reference/exception/bad_exception/op_assign.md index 6ae172dd4d..5a4250132a 100644 --- a/reference/exception/bad_exception/op_assign.md +++ b/reference/exception/bad_exception/op_assign.md @@ -22,4 +22,3 @@ constexpr bad_exception& operator=(const bad_exception&) noexcept; // (1) C++26 ## 関連項目 - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) - diff --git a/reference/exception/bad_exception/op_constructor.md b/reference/exception/bad_exception/op_constructor.md index 648480bfa6..217d505b9d 100644 --- a/reference/exception/bad_exception/op_constructor.md +++ b/reference/exception/bad_exception/op_constructor.md @@ -27,4 +27,3 @@ constexpr bad_exception(const bad_exception&) noexcept; // (2) C++26 ## 関連項目 - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) - diff --git a/reference/exception/bad_exception/op_destructor.md b/reference/exception/bad_exception/op_destructor.md index 725619f7f4..8147f2a904 100644 --- a/reference/exception/bad_exception/op_destructor.md +++ b/reference/exception/bad_exception/op_destructor.md @@ -19,4 +19,3 @@ constexpr virtual ~bad_exception(); // (1) C++26 ## 関連項目 - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) - diff --git a/reference/exception/bad_exception/what.md b/reference/exception/bad_exception/what.md index 51fcaf3ea2..ed8fcd2894 100644 --- a/reference/exception/bad_exception/what.md +++ b/reference/exception/bad_exception/what.md @@ -21,4 +21,3 @@ constexpr const char* what() const noexcept override; // (1) C++26 ## 関連項目 - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) - diff --git a/reference/exception/current_exception.md b/reference/exception/current_exception.md index 5f1b3a222c..858e9b060c 100644 --- a/reference/exception/current_exception.md +++ b/reference/exception/current_exception.md @@ -93,4 +93,3 @@ terminate called after throwing an instance of 'std::runtime_error' ## 参照 - [N2179 Language Support for Transporting Exceptions between Threads](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html) - [Can I use `std::current_exception` during stack unwinding? - StackOverflow](http://stackoverflow.com/questions/28267484/can-i-use-stdcurrent-exception-during-stack-unwinding) - diff --git a/reference/exception/exception/op_assign.md b/reference/exception/exception/op_assign.md index 08cb854c05..20c758ab78 100644 --- a/reference/exception/exception/op_assign.md +++ b/reference/exception/exception/op_assign.md @@ -22,4 +22,3 @@ constexpr exception& operator=(const exception&) noexcept; // (1) C++26 ## 関連項目 - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) - diff --git a/reference/exception/exception/op_constructor.md b/reference/exception/exception/op_constructor.md index b8a5fcecac..74581e19a8 100644 --- a/reference/exception/exception/op_constructor.md +++ b/reference/exception/exception/op_constructor.md @@ -27,4 +27,3 @@ constexpr exception(const exception&) noexcept; // (2) C++26 ## 関連項目 - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) - diff --git a/reference/exception/exception/op_destructor.md b/reference/exception/exception/op_destructor.md index 09fde29cd4..ea6a557f27 100644 --- a/reference/exception/exception/op_destructor.md +++ b/reference/exception/exception/op_destructor.md @@ -19,4 +19,3 @@ constexpr virtual ~exception(); // (1) C++26 ## 関連項目 - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) - diff --git a/reference/exception/exception/what.md b/reference/exception/exception/what.md index d8656be8b7..de20dff6fa 100644 --- a/reference/exception/exception/what.md +++ b/reference/exception/exception/what.md @@ -21,4 +21,3 @@ constexpr const char* what() const noexcept override; // (1) C++26 ## 関連項目 - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) - diff --git a/reference/exception/exception_ptr.md b/reference/exception/exception_ptr.md index 72e9281ae4..cf5fbaef95 100644 --- a/reference/exception/exception_ptr.md +++ b/reference/exception/exception_ptr.md @@ -103,4 +103,3 @@ error! ## 参照 - [N2107 Exception Propagation across Threads](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2107.html) - [N2179 Language Support for Transporting Exceptions between Threads](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html) - diff --git a/reference/exception/get_terminate.md b/reference/exception/get_terminate.md index d4437ad433..e2668996c8 100644 --- a/reference/exception/get_terminate.md +++ b/reference/exception/get_terminate.md @@ -64,5 +64,3 @@ on terminate ## 参照 - - diff --git a/reference/exception/nested_exception.md b/reference/exception/nested_exception.md index 3710cbea32..d2435e31aa 100644 --- a/reference/exception/nested_exception.md +++ b/reference/exception/nested_exception.md @@ -80,4 +80,3 @@ int main() ## 参照 - [N2559 Nesting Exception Objects (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2559.htm) - diff --git a/reference/exception/nested_exception/nested_ptr.md b/reference/exception/nested_exception/nested_ptr.md index 6808bc832c..a419c9977c 100644 --- a/reference/exception/nested_exception/nested_ptr.md +++ b/reference/exception/nested_exception/nested_ptr.md @@ -76,4 +76,3 @@ int main() ## 関連項目 - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) - diff --git a/reference/exception/nested_exception/op_assign.md b/reference/exception/nested_exception/op_assign.md index a90f11e312..bad0ecdcdb 100644 --- a/reference/exception/nested_exception/op_assign.md +++ b/reference/exception/nested_exception/op_assign.md @@ -22,4 +22,3 @@ constexpr nested_exception& operator=(const nested_exception&) noexcept = defaul ## 関連項目 - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) - diff --git a/reference/exception/nested_exception/op_constructor.md b/reference/exception/nested_exception/op_constructor.md index 5c3f90464e..ef8ee8336c 100644 --- a/reference/exception/nested_exception/op_constructor.md +++ b/reference/exception/nested_exception/op_constructor.md @@ -68,4 +68,3 @@ int main() ## 関連項目 - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) - diff --git a/reference/exception/nested_exception/op_destructor.md b/reference/exception/nested_exception/op_destructor.md index 709fadec4d..34ade2ce8f 100644 --- a/reference/exception/nested_exception/op_destructor.md +++ b/reference/exception/nested_exception/op_destructor.md @@ -20,4 +20,3 @@ constexpr virtual ~nested_exception() = default; // (1) C++26 ## 関連項目 - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) - diff --git a/reference/exception/nested_exception/rethrow_nested.md b/reference/exception/nested_exception/rethrow_nested.md index e001a9b338..c095519b41 100644 --- a/reference/exception/nested_exception/rethrow_nested.md +++ b/reference/exception/nested_exception/rethrow_nested.md @@ -78,4 +78,3 @@ int main() ## 関連項目 - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) - diff --git a/reference/exception/set_terminate.md b/reference/exception/set_terminate.md index df7639e105..f44fc2194f 100644 --- a/reference/exception/set_terminate.md +++ b/reference/exception/set_terminate.md @@ -56,5 +56,3 @@ Please contact the application's support team for more information. ``` ## 参照 - - diff --git a/reference/execution/execution/with_awaitable_senders.md b/reference/execution/execution/with_awaitable_senders.md index fd0cabaa16..527594c187 100644 --- a/reference/execution/execution/with_awaitable_senders.md +++ b/reference/execution/execution/with_awaitable_senders.md @@ -179,5 +179,3 @@ value=42 ## 参照 - [P3325R5 A Utility for Creating Execution Environments](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3325r5.html) - - diff --git a/reference/filesystem/path/append.md b/reference/filesystem/path/append.md index f21ca56148..bcd4fae25e 100644 --- a/reference/filesystem/path/append.md +++ b/reference/filesystem/path/append.md @@ -176,4 +176,3 @@ h : "D:bar" ### 備考 - GCC 8.1 (SVN) の`operator/=`では、ルートディレクトリを持つパスを加算すると、左辺が削除されないバグがある - [Bug 84159 - `filesystem::path::operator/=` with has root directory path](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84159) - diff --git a/reference/filesystem/path/op_append_assign.md b/reference/filesystem/path/op_append_assign.md index b36afc3f07..b12201f572 100644 --- a/reference/filesystem/path/op_append_assign.md +++ b/reference/filesystem/path/op_append_assign.md @@ -180,4 +180,3 @@ h : "D:bar" ### 備考 - GCC 8.1 (SVN) の`operator/=`では、ルートディレクトリを持つパスを加算すると、左辺が削除されないバグがある - [Bug 84159 - `filesystem::path::operator/=` with has root directory path](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84159) - diff --git a/reference/flat_map/flat_map/begin.md b/reference/flat_map/flat_map/begin.md index 53f04ff970..1ef7421bb4 100644 --- a/reference/flat_map/flat_map/begin.md +++ b/reference/flat_map/flat_map/begin.md @@ -84,5 +84,3 @@ int main() | [`flat_map::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_map::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`flat_map::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | - - diff --git a/reference/flat_map/flat_map/cbegin.md b/reference/flat_map/flat_map/cbegin.md index a463d234ba..e377d86441 100644 --- a/reference/flat_map/flat_map/cbegin.md +++ b/reference/flat_map/flat_map/cbegin.md @@ -80,4 +80,3 @@ int main() | [`flat_map::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_map::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`flat_map::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | - diff --git a/reference/flat_map/flat_map/cend.md b/reference/flat_map/flat_map/cend.md index 7488d4b33d..c1240bcb31 100644 --- a/reference/flat_map/flat_map/cend.md +++ b/reference/flat_map/flat_map/cend.md @@ -83,4 +83,3 @@ int main() | [`flat_map::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_map::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`flat_map::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | - diff --git a/reference/flat_map/flat_map/emplace.md b/reference/flat_map/flat_map/emplace.md index 9addc18292..7370de6dfb 100644 --- a/reference/flat_map/flat_map/emplace.md +++ b/reference/flat_map/flat_map/emplace.md @@ -141,4 +141,3 @@ CCC : (1, 2) | [`flat_map::insert_or_assign`](insert_or_assign.md) | 要素を挿入、あるいは代入する | | [`flat_map::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | | [`flat_map::try_emplace`](try_emplace.md) | キーが存在しない場合のみ要素を直接構築する | - diff --git a/reference/flat_map/flat_map/emplace_hint.md b/reference/flat_map/flat_map/emplace_hint.md index de5263167d..d4fef9c464 100644 --- a/reference/flat_map/flat_map/emplace_hint.md +++ b/reference/flat_map/flat_map/emplace_hint.md @@ -80,4 +80,3 @@ int main() | [`flat_map::insert_or_assign`](insert_or_assign.md) | 要素を挿入、あるいは代入する | | [`flat_map::emplace`](emplace.md) | 要素を直接構築する | | [`flat_map::try_emplace`](try_emplace.md) | キーが存在しない場合のみ要素を直接構築する | - diff --git a/reference/flat_map/flat_map/empty.md b/reference/flat_map/flat_map/empty.md index 3e1f3fe6db..050a8af3c5 100644 --- a/reference/flat_map/flat_map/empty.md +++ b/reference/flat_map/flat_map/empty.md @@ -57,4 +57,3 @@ int main () - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/flat_map/flat_map/equal_range.md b/reference/flat_map/flat_map/equal_range.md index 3e9b4e03cd..4429ab2c60 100644 --- a/reference/flat_map/flat_map/equal_range.md +++ b/reference/flat_map/flat_map/equal_range.md @@ -81,4 +81,3 @@ B,1 | [`flat_map::lower_bound`](lower_bound.md) | 与えられた値より小さくない最初の要素へのイテレータを返す | | [`flat_map::upper_bound`](upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | | [`flat_map::find`](find.md) | 指定したキーで要素を探す | - diff --git a/reference/flat_map/flat_map/erase.md b/reference/flat_map/flat_map/erase.md index a0ef98afff..51014fc33d 100644 --- a/reference/flat_map/flat_map/erase.md +++ b/reference/flat_map/flat_map/erase.md @@ -145,4 +145,3 @@ int main() | [`flat_map::clear`](clear.md) | 全ての要素を削除する | | [`flat_map::insert`](insert.md) | 要素を挿入する | | [`flat_map::find`](find.md) | 指定したキーで要素を探す | - diff --git a/reference/flat_map/flat_map/erase_if_free.md b/reference/flat_map/flat_map/erase_if_free.md index f7736ce45d..8bc57c4bf4 100644 --- a/reference/flat_map/flat_map/erase_if_free.md +++ b/reference/flat_map/flat_map/erase_if_free.md @@ -77,4 +77,3 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/flat_map/flat_map/find.md b/reference/flat_map/flat_map/find.md index 5dcb21d11a..598fec6d72 100644 --- a/reference/flat_map/flat_map/find.md +++ b/reference/flat_map/flat_map/find.md @@ -105,4 +105,3 @@ int main() ## 関連項目 - [`contains()`](contains.md) - diff --git a/reference/flat_map/flat_map/insert.md b/reference/flat_map/flat_map/insert.md index 2347f5031e..e59a486019 100644 --- a/reference/flat_map/flat_map/insert.md +++ b/reference/flat_map/flat_map/insert.md @@ -264,4 +264,3 @@ int main() | [`flat_map::emplace`](emplace.md) | 要素を直接構築する | | [`flat_map::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | | [`flat_map::try_emplace`](try_emplace.md) | キーが存在しない場合のみ要素を直接構築する | - diff --git a/reference/flat_map/flat_map/insert_or_assign.md b/reference/flat_map/flat_map/insert_or_assign.md index b6f11c62e8..04916e47d9 100644 --- a/reference/flat_map/flat_map/insert_or_assign.md +++ b/reference/flat_map/flat_map/insert_or_assign.md @@ -147,4 +147,3 @@ int main() | [`flat_map::emplace`](emplace.md) | 要素を直接構築する | | [`flat_map::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | | [`flat_map::try_emplace`](try_emplace.md) | キーが存在しない場合のみ要素を直接構築する | - diff --git a/reference/flat_map/flat_map/insert_range.md b/reference/flat_map/flat_map/insert_range.md index 0f2bde9476..207bc7a8fc 100644 --- a/reference/flat_map/flat_map/insert_range.md +++ b/reference/flat_map/flat_map/insert_range.md @@ -117,4 +117,3 @@ int main() | [`flat_map::emplace`](emplace.md) | 要素を直接構築する | | [`flat_map::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | | [`flat_map::try_emplace`](try_emplace.md) | キーが存在しない場合のみ要素を直接構築する | - diff --git a/reference/flat_map/flat_map/key_equiv.md b/reference/flat_map/flat_map/key_equiv.md index 5e4e771f24..05188988da 100644 --- a/reference/flat_map/flat_map/key_equiv.md +++ b/reference/flat_map/flat_map/key_equiv.md @@ -29,4 +29,3 @@ struct key_equiv { - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/flat_map/flat_map/lower_bound.md b/reference/flat_map/flat_map/lower_bound.md index c8ecf0c493..84b7d2f220 100644 --- a/reference/flat_map/flat_map/lower_bound.md +++ b/reference/flat_map/flat_map/lower_bound.md @@ -116,4 +116,3 @@ D,5 | [`equal_range`](equal_range.md) | 指定したキーにマッチする要素範囲を返す | | [`find`](find.md) | 指定したキーで要素を探す | | [`count`](count.md) | 指定したキーにマッチする要素の数を返す | - diff --git a/reference/flat_map/flat_map/max_size.md b/reference/flat_map/flat_map/max_size.md index df57adf3c5..f0daa8b181 100644 --- a/reference/flat_map/flat_map/max_size.md +++ b/reference/flat_map/flat_map/max_size.md @@ -54,4 +54,3 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/flat_map/flat_map/op_compare_3way.md b/reference/flat_map/flat_map/op_compare_3way.md index 7223f7e551..d9864b9116 100644 --- a/reference/flat_map/flat_map/op_compare_3way.md +++ b/reference/flat_map/flat_map/op_compare_3way.md @@ -87,4 +87,3 @@ false - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/flat_map/flat_map/op_equal.md b/reference/flat_map/flat_map/op_equal.md index 4059c7b3eb..1a5538c3df 100644 --- a/reference/flat_map/flat_map/op_equal.md +++ b/reference/flat_map/flat_map/op_equal.md @@ -71,4 +71,3 @@ true - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/flat_map/flat_map/rbegin.md b/reference/flat_map/flat_map/rbegin.md index 983534d7a8..6f275316dd 100644 --- a/reference/flat_map/flat_map/rbegin.md +++ b/reference/flat_map/flat_map/rbegin.md @@ -79,4 +79,3 @@ int main() | [`flat_map::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_map::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`flat_map::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | - diff --git a/reference/flat_map/flat_map/rend.md b/reference/flat_map/flat_map/rend.md index 206000a683..ce633acd2b 100644 --- a/reference/flat_map/flat_map/rend.md +++ b/reference/flat_map/flat_map/rend.md @@ -72,4 +72,3 @@ int main() | [`flat_map::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | | [`flat_map::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`flat_map::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | - diff --git a/reference/flat_map/flat_map/swap.md b/reference/flat_map/flat_map/swap.md index 0abf4f15c5..e75cc45a73 100644 --- a/reference/flat_map/flat_map/swap.md +++ b/reference/flat_map/flat_map/swap.md @@ -79,4 +79,3 @@ fm2 : {[10,a], [20,b], [30,c]} - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/flat_map/flat_map/try_emplace.md b/reference/flat_map/flat_map/try_emplace.md index 966097865d..9a5febe3af 100644 --- a/reference/flat_map/flat_map/try_emplace.md +++ b/reference/flat_map/flat_map/try_emplace.md @@ -173,4 +173,3 @@ false, 114, false | [`flat_map::insert_or_assign`](insert_or_assign.md) | 要素を挿入、あるいは代入する | | [`flat_map::emplace`](emplace.md) | 要素を直接構築する | | [`flat_map::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | - diff --git a/reference/flat_map/flat_map/upper_bound.md b/reference/flat_map/flat_map/upper_bound.md index 011173b505..b3d2d63c91 100644 --- a/reference/flat_map/flat_map/upper_bound.md +++ b/reference/flat_map/flat_map/upper_bound.md @@ -116,4 +116,3 @@ D,5 | [`equal_range`](equal_range.md) | 指定したキーにマッチする要素範囲を返す | | [`find`](find.md) | 指定したキーで要素を探す | | [`count`](count.md) | 指定したキーにマッチする要素の数を返す | - diff --git a/reference/flat_map/flat_multimap/cbegin.md b/reference/flat_map/flat_multimap/cbegin.md index 2737ef889a..b668b771ab 100644 --- a/reference/flat_map/flat_multimap/cbegin.md +++ b/reference/flat_map/flat_multimap/cbegin.md @@ -73,4 +73,3 @@ int main() | [`flat_multimap::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_multimap::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`flat_multimap::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | - diff --git a/reference/flat_map/flat_multimap/cend.md b/reference/flat_map/flat_multimap/cend.md index d3ec1c40ae..3cbbb6a328 100644 --- a/reference/flat_map/flat_multimap/cend.md +++ b/reference/flat_map/flat_multimap/cend.md @@ -76,4 +76,3 @@ int main() | [`flat_multimap::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_multimap::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`flat_multimap::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | - diff --git a/reference/flat_map/flat_multimap/empty.md b/reference/flat_map/flat_multimap/empty.md index 8c8ca362a3..a8e1573ab0 100644 --- a/reference/flat_map/flat_multimap/empty.md +++ b/reference/flat_map/flat_multimap/empty.md @@ -57,4 +57,3 @@ int main () - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/flat_map/flat_multimap/equal_range.md b/reference/flat_map/flat_multimap/equal_range.md index 16475ee282..1d64f5a5ff 100644 --- a/reference/flat_map/flat_multimap/equal_range.md +++ b/reference/flat_map/flat_multimap/equal_range.md @@ -81,4 +81,3 @@ B, 4 | [`flat_multimap::lower_bound`](lower_bound.md) | 与えられた値より小さくない最初の要素へのイテレータを返す | | [`flat_multimap::upper_bound`](upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | | [`flat_multimap::find`](find.md) | 指定したキーで要素を探す | - diff --git a/reference/flat_map/flat_multimap/erase.md b/reference/flat_map/flat_multimap/erase.md index 7c1c5bf87a..71c21413f6 100644 --- a/reference/flat_map/flat_multimap/erase.md +++ b/reference/flat_map/flat_multimap/erase.md @@ -146,4 +146,3 @@ int main() | [`flat_multimap::clear`](clear.md) | 全ての要素を削除する | | [`flat_multimap::insert`](insert.md) | 要素を挿入する | | [`flat_multimap::find`](find.md) | 指定したキーで要素を探す | - diff --git a/reference/flat_map/flat_multimap/erase_if_free.md b/reference/flat_map/flat_multimap/erase_if_free.md index 4cc6051de1..7ddafb2786 100644 --- a/reference/flat_map/flat_multimap/erase_if_free.md +++ b/reference/flat_map/flat_multimap/erase_if_free.md @@ -84,4 +84,3 @@ C : 5 - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/flat_map/flat_multimap/key_equiv.md b/reference/flat_map/flat_multimap/key_equiv.md index 19e621bb0b..ef9b3a7650 100644 --- a/reference/flat_map/flat_multimap/key_equiv.md +++ b/reference/flat_map/flat_multimap/key_equiv.md @@ -29,4 +29,3 @@ struct key_equiv { - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/flat_map/flat_multimap/lower_bound.md b/reference/flat_map/flat_multimap/lower_bound.md index 949d284199..3b5fe85171 100644 --- a/reference/flat_map/flat_multimap/lower_bound.md +++ b/reference/flat_map/flat_multimap/lower_bound.md @@ -116,4 +116,3 @@ D,5 | [`equal_range`](equal_range.md) | 指定したキーにマッチする要素範囲を返す | | [`find`](find.md) | 指定したキーで要素を探す | | [`count`](count.md) | 指定したキーにマッチする要素の数を返す | - diff --git a/reference/flat_map/flat_multimap/max_size.md b/reference/flat_map/flat_multimap/max_size.md index 28e28d83a5..a2d09ba997 100644 --- a/reference/flat_map/flat_multimap/max_size.md +++ b/reference/flat_map/flat_multimap/max_size.md @@ -54,4 +54,3 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/flat_map/flat_multimap/op_compare_3way.md b/reference/flat_map/flat_multimap/op_compare_3way.md index bc01674f6e..3110df6da4 100644 --- a/reference/flat_map/flat_multimap/op_compare_3way.md +++ b/reference/flat_map/flat_multimap/op_compare_3way.md @@ -87,4 +87,3 @@ false - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/flat_map/flat_multimap/op_equal.md b/reference/flat_map/flat_multimap/op_equal.md index 2826035089..f987410bc5 100644 --- a/reference/flat_map/flat_multimap/op_equal.md +++ b/reference/flat_map/flat_multimap/op_equal.md @@ -71,4 +71,3 @@ true - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/flat_map/flat_multimap/rbegin.md b/reference/flat_map/flat_multimap/rbegin.md index 64d5f893b6..ec5ae422e1 100644 --- a/reference/flat_map/flat_multimap/rbegin.md +++ b/reference/flat_map/flat_multimap/rbegin.md @@ -77,4 +77,3 @@ int main() | [`flat_multimap::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_multimap::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`flat_multimap::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | - diff --git a/reference/flat_map/flat_multimap/rend.md b/reference/flat_map/flat_multimap/rend.md index 7a5034691e..1d15efc306 100644 --- a/reference/flat_map/flat_multimap/rend.md +++ b/reference/flat_map/flat_multimap/rend.md @@ -70,4 +70,3 @@ int main() | [`flat_multimap::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | | [`flat_multimap::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`flat_multimap::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | - diff --git a/reference/flat_map/flat_multimap/swap.md b/reference/flat_map/flat_multimap/swap.md index 319cdb9eca..44600a8e46 100644 --- a/reference/flat_map/flat_multimap/swap.md +++ b/reference/flat_map/flat_multimap/swap.md @@ -79,4 +79,3 @@ fm2 : {[10,a], [20,b], [30,c]} - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/flat_map/flat_multimap/upper_bound.md b/reference/flat_map/flat_multimap/upper_bound.md index 025c1e0bbc..768e42216a 100644 --- a/reference/flat_map/flat_multimap/upper_bound.md +++ b/reference/flat_map/flat_multimap/upper_bound.md @@ -116,4 +116,3 @@ D,5 | [`equal_range`](equal_range.md) | 指定したキーにマッチする要素範囲を返す | | [`find`](find.md) | 指定したキーで要素を探す | | [`count`](count.md) | 指定したキーにマッチする要素の数を返す | - diff --git a/reference/flat_map/sorted_equivalent_t.md b/reference/flat_map/sorted_equivalent_t.md index 7fe82d1d8f..8e3107a1a2 100644 --- a/reference/flat_map/sorted_equivalent_t.md +++ b/reference/flat_map/sorted_equivalent_t.md @@ -66,4 +66,3 @@ int main() ## 関連項目 - [`std::flat_multimap`](flat_multimap.md) - diff --git a/reference/flat_map/sorted_unique_t.md b/reference/flat_map/sorted_unique_t.md index 0c89b5cccc..d5ccd1a1a4 100644 --- a/reference/flat_map/sorted_unique_t.md +++ b/reference/flat_map/sorted_unique_t.md @@ -66,4 +66,3 @@ int main() ## 関連項目 - [`std::flat_map`](flat_map.md) - diff --git a/reference/flat_set/flat_multiset/cend.md b/reference/flat_set/flat_multiset/cend.md index cf1cf81a0b..da44495731 100644 --- a/reference/flat_set/flat_multiset/cend.md +++ b/reference/flat_set/flat_multiset/cend.md @@ -71,4 +71,3 @@ int main() | [`flat_multiset::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_multiset::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`flat_multiset::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | - diff --git a/reference/flat_set/flat_multiset/rbegin.md b/reference/flat_set/flat_multiset/rbegin.md index cead413c23..f1258edbeb 100644 --- a/reference/flat_set/flat_multiset/rbegin.md +++ b/reference/flat_set/flat_multiset/rbegin.md @@ -72,4 +72,3 @@ int main() | [`flat_multiset::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_multiset::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`flat_multiset::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | - diff --git a/reference/flat_set/flat_set/cend.md b/reference/flat_set/flat_set/cend.md index e78572c3f9..a2ad3527b5 100644 --- a/reference/flat_set/flat_set/cend.md +++ b/reference/flat_set/flat_set/cend.md @@ -70,4 +70,3 @@ int main() | [`flat_set::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_set::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`flat_set::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | - diff --git a/reference/flat_set/flat_set/rbegin.md b/reference/flat_set/flat_set/rbegin.md index 7be2403e2f..f35e2e8f7a 100644 --- a/reference/flat_set/flat_set/rbegin.md +++ b/reference/flat_set/flat_set/rbegin.md @@ -71,4 +71,3 @@ int main() | [`flat_set::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_set::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`flat_set::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | - diff --git a/reference/flat_set/sorted_equivalent_t.md b/reference/flat_set/sorted_equivalent_t.md index 17b8ff068c..b41c25a855 100644 --- a/reference/flat_set/sorted_equivalent_t.md +++ b/reference/flat_set/sorted_equivalent_t.md @@ -61,4 +61,3 @@ int main() ## 関連項目 - [`std::flat_multiset`](flat_multiset.md) - diff --git a/reference/flat_set/sorted_unique_t.md b/reference/flat_set/sorted_unique_t.md index 70cea5a3a9..c8b5bf9305 100644 --- a/reference/flat_set/sorted_unique_t.md +++ b/reference/flat_set/sorted_unique_t.md @@ -61,4 +61,3 @@ int main() ## 関連項目 - [`std::flat_set`](flat_set.md) - diff --git a/reference/format/format_error/op_destructor.md b/reference/format/format_error/op_destructor.md index 92f0837f85..a873310419 100644 --- a/reference/format/format_error/op_destructor.md +++ b/reference/format/format_error/op_destructor.md @@ -20,4 +20,3 @@ constexpr virtual ~format_error(); // (1) C++26 ## 関連項目 - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) - diff --git a/reference/format/format_to.md b/reference/format/format_to.md index 2cd9f2489f..a71fa82e92 100644 --- a/reference/format/format_to.md +++ b/reference/format/format_to.md @@ -159,4 +159,3 @@ wstring format_to(Out out, const locale& loc, wformat_string fmt, const * [P2216R3 std::format improvements](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2216r3.html) * [[C++] std::formatあるいは{fmt}のコンパイル時フォーマット文字列チェックの魔術 - 地面を見下ろす少年の足蹴にされる私](https://onihusube.hatenablog.com/entry/2021/07/01/195912) * [P2418R2 Add support for `std::generator`-like types to `std::format`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2418r2.html) - diff --git a/reference/format/formatter/format.md b/reference/format/formatter/format.md index 196158686e..6d7dece954 100644 --- a/reference/format/formatter/format.md +++ b/reference/format/formatter/format.md @@ -58,4 +58,3 @@ typename FormatContext::iterator - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): 13 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/format/formatter/parse.md b/reference/format/formatter/parse.md index 01e62c07d0..b17af5a0ed 100644 --- a/reference/format/formatter/parse.md +++ b/reference/format/formatter/parse.md @@ -50,4 +50,3 @@ constexpr typename ParseContext::iterator - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): 13 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/format/range_formatter/format.md b/reference/format/range_formatter/format.md index bb48a62254..b8857df948 100644 --- a/reference/format/range_formatter/format.md +++ b/reference/format/range_formatter/format.md @@ -44,4 +44,3 @@ typename FormatContext::iterator - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/format/range_formatter/parse.md b/reference/format/range_formatter/parse.md index 22b031b481..aa5685a29a 100644 --- a/reference/format/range_formatter/parse.md +++ b/reference/format/range_formatter/parse.md @@ -36,4 +36,3 @@ constexpr typename ParseContext::iterator - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/format/range_formatter/underlying.md b/reference/format/range_formatter/underlying.md index e8ea0a6603..8b11b80715 100644 --- a/reference/format/range_formatter/underlying.md +++ b/reference/format/range_formatter/underlying.md @@ -30,4 +30,3 @@ Rangeの要素型に対する[`formatter`](/reference/format/formatter.md)を取 - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/forward_list/forward_list/assign.md b/reference/forward_list/forward_list/assign.md index 53827c58c2..7fff11daa8 100644 --- a/reference/forward_list/forward_list/assign.md +++ b/reference/forward_list/forward_list/assign.md @@ -131,5 +131,3 @@ ls3 : 1 2 3 ## 参照 - [N2679 Initializer Lists for Standard Containers(Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2679.pdf) - (3)の経緯となる提案文書 - - diff --git a/reference/forward_list/forward_list/before_begin.md b/reference/forward_list/forward_list/before_begin.md index 0f40a3ba24..6fa17a554b 100644 --- a/reference/forward_list/forward_list/before_begin.md +++ b/reference/forward_list/forward_list/before_begin.md @@ -74,5 +74,3 @@ int main() ## 参照 - - diff --git a/reference/forward_list/forward_list/begin.md b/reference/forward_list/forward_list/begin.md index b602b378c6..2d327ecba4 100644 --- a/reference/forward_list/forward_list/begin.md +++ b/reference/forward_list/forward_list/begin.md @@ -60,5 +60,3 @@ int main() ## 参照 - - diff --git a/reference/forward_list/forward_list/cbefore_begin.md b/reference/forward_list/forward_list/cbefore_begin.md index e8d30da47c..72b2a618a6 100644 --- a/reference/forward_list/forward_list/cbefore_begin.md +++ b/reference/forward_list/forward_list/cbefore_begin.md @@ -74,5 +74,3 @@ int main() ## 参照 - - diff --git a/reference/forward_list/forward_list/cbegin.md b/reference/forward_list/forward_list/cbegin.md index f11c47d264..ccf14c466f 100644 --- a/reference/forward_list/forward_list/cbegin.md +++ b/reference/forward_list/forward_list/cbegin.md @@ -59,5 +59,3 @@ int main() ## 参照 - - diff --git a/reference/forward_list/forward_list/cend.md b/reference/forward_list/forward_list/cend.md index 47e6ade799..0762ff0b91 100644 --- a/reference/forward_list/forward_list/cend.md +++ b/reference/forward_list/forward_list/cend.md @@ -62,5 +62,3 @@ int main() ## 参照 - - diff --git a/reference/forward_list/forward_list/clear.md b/reference/forward_list/forward_list/clear.md index 9ed363e438..8044c95a6d 100644 --- a/reference/forward_list/forward_list/clear.md +++ b/reference/forward_list/forward_list/clear.md @@ -74,5 +74,3 @@ int main() ## 参照 - [LWG Issue 2231. DR 704 removes complexity guarantee for `clear()`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2231) - C++03までこの関数の効果は`erase(begin(), end())`だったため、それによって線形時間の計算量が保証されていたが、C++11で効果の表記が変わったために、保証がなくなってしまっていた。C++14であらためて保証を追加。 - - diff --git a/reference/forward_list/forward_list/emplace_after.md b/reference/forward_list/forward_list/emplace_after.md index 429e2c431a..12a49f3910 100644 --- a/reference/forward_list/forward_list/emplace_after.md +++ b/reference/forward_list/forward_list/emplace_after.md @@ -80,5 +80,3 @@ int main() ## 参照 - - diff --git a/reference/forward_list/forward_list/end.md b/reference/forward_list/forward_list/end.md index 2d27a22300..af43a934cd 100644 --- a/reference/forward_list/forward_list/end.md +++ b/reference/forward_list/forward_list/end.md @@ -76,5 +76,3 @@ int main() ## 参照 - - diff --git a/reference/forward_list/forward_list/erase_after.md b/reference/forward_list/forward_list/erase_after.md index fa2608addb..0bfefe65e5 100644 --- a/reference/forward_list/forward_list/erase_after.md +++ b/reference/forward_list/forward_list/erase_after.md @@ -138,5 +138,3 @@ int main() ## 参照 - - diff --git a/reference/forward_list/forward_list/front.md b/reference/forward_list/forward_list/front.md index 2554c3d597..cda1c14c77 100644 --- a/reference/forward_list/forward_list/front.md +++ b/reference/forward_list/forward_list/front.md @@ -54,5 +54,3 @@ int main() ## 参照 - - diff --git a/reference/forward_list/forward_list/get_allocator.md b/reference/forward_list/forward_list/get_allocator.md index 6a7e195627..c57e08528a 100644 --- a/reference/forward_list/forward_list/get_allocator.md +++ b/reference/forward_list/forward_list/get_allocator.md @@ -56,5 +56,3 @@ int main() ## 参照 - - diff --git a/reference/forward_list/forward_list/insert_after.md b/reference/forward_list/forward_list/insert_after.md index 3cb9dd869e..ef712000b9 100644 --- a/reference/forward_list/forward_list/insert_after.md +++ b/reference/forward_list/forward_list/insert_after.md @@ -140,5 +140,3 @@ insert initializer_list : 1 2 3 4 5 6 ## 参照 - [N2679 Initializer Lists for Standard Containers(Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2679.pdf) - (5)の経緯となる提案文書 - - diff --git a/reference/forward_list/forward_list/max_size.md b/reference/forward_list/forward_list/max_size.md index 767be51043..4187ac89b3 100644 --- a/reference/forward_list/forward_list/max_size.md +++ b/reference/forward_list/forward_list/max_size.md @@ -58,5 +58,3 @@ int main() ## 参照 - - diff --git a/reference/forward_list/forward_list/merge.md b/reference/forward_list/forward_list/merge.md index a793007192..8401d1f0ad 100644 --- a/reference/forward_list/forward_list/merge.md +++ b/reference/forward_list/forward_list/merge.md @@ -94,4 +94,3 @@ int main() - [LWG Issue 2045. `forward_list::merge` and `forward_list::splice_after` with unequal allocators](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2045) - [LWG Issue 2122. `merge()` stability for lists versus forward lists](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2122) - [LWG Issue 2123. `merge()` allocator requirements for lists versus forward lists](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2123) - diff --git a/reference/forward_list/forward_list/op_compare_3way.md b/reference/forward_list/forward_list/op_compare_3way.md index d6ddd2f5b0..ab8049991d 100644 --- a/reference/forward_list/forward_list/op_compare_3way.md +++ b/reference/forward_list/forward_list/op_compare_3way.md @@ -81,4 +81,3 @@ int main () ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 - diff --git a/reference/forward_list/forward_list/op_deduction_guide.md b/reference/forward_list/forward_list/op_deduction_guide.md index 1ad682aa34..435821d36f 100644 --- a/reference/forward_list/forward_list/op_deduction_guide.md +++ b/reference/forward_list/forward_list/op_deduction_guide.md @@ -79,4 +79,3 @@ int main() ## 参照 - [P0433R2 Toward a resolution of US7 and US14: Integrating template deduction for class templates into the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0433r2.html) - diff --git a/reference/forward_list/forward_list/op_destructor.md b/reference/forward_list/forward_list/op_destructor.md index 1876f6e24f..d050c8e7b6 100644 --- a/reference/forward_list/forward_list/op_destructor.md +++ b/reference/forward_list/forward_list/op_destructor.md @@ -33,5 +33,3 @@ ## 参照 - - diff --git a/reference/forward_list/forward_list/op_equal.md b/reference/forward_list/forward_list/op_equal.md index 8068b3c45d..2864b05c32 100644 --- a/reference/forward_list/forward_list/op_equal.md +++ b/reference/forward_list/forward_list/op_equal.md @@ -80,4 +80,3 @@ false ## 参照 - [LWG Issue 2257. Simplify container requirements with the new algorithms](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2257) - C++14から、2つ目のイテレータ範囲のendイテレータをとる`equal()`アルゴリズムを使用するようになった。 - diff --git a/reference/forward_list/forward_list/pop_front.md b/reference/forward_list/forward_list/pop_front.md index f98ce7122c..7630d08369 100644 --- a/reference/forward_list/forward_list/pop_front.md +++ b/reference/forward_list/forward_list/pop_front.md @@ -64,5 +64,3 @@ int main() ## 参照 - - diff --git a/reference/forward_list/forward_list/push_front.md b/reference/forward_list/forward_list/push_front.md index 91b73c17b5..2b3d46a407 100644 --- a/reference/forward_list/forward_list/push_front.md +++ b/reference/forward_list/forward_list/push_front.md @@ -67,5 +67,3 @@ world ## 参照 - - diff --git a/reference/forward_list/forward_list/resize.md b/reference/forward_list/forward_list/resize.md index 4c8695a37f..c96381f5d8 100644 --- a/reference/forward_list/forward_list/resize.md +++ b/reference/forward_list/forward_list/resize.md @@ -84,5 +84,3 @@ int main() - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 - - diff --git a/reference/forward_list/forward_list/reverse.md b/reference/forward_list/forward_list/reverse.md index bdcb38f4a4..d7db00bab5 100644 --- a/reference/forward_list/forward_list/reverse.md +++ b/reference/forward_list/forward_list/reverse.md @@ -66,5 +66,3 @@ int main() ## 参照 - - diff --git a/reference/forward_list/forward_list/sort.md b/reference/forward_list/forward_list/sort.md index f3eb88beb8..1f1e40f0a2 100644 --- a/reference/forward_list/forward_list/sort.md +++ b/reference/forward_list/forward_list/sort.md @@ -74,5 +74,3 @@ int main() ## 参照 - [LWG Issue 2122. `merge()` stability for lists versus forward lists](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2122) - - diff --git a/reference/fstream/basic_ifstream.md b/reference/fstream/basic_ifstream.md index 5e32930896..d0a9254a82 100644 --- a/reference/fstream/basic_ifstream.md +++ b/reference/fstream/basic_ifstream.md @@ -87,4 +87,3 @@ int main() { * ifs.is_open[link basic_ifstream/is_open.md] * ifs.close[link basic_ifstream/close.md] * std::getline[link /reference/string/basic_string/getline.md] - diff --git a/reference/fstream/basic_ofstream.md b/reference/fstream/basic_ofstream.md index 654cec44fb..fd3cabe46b 100644 --- a/reference/fstream/basic_ofstream.md +++ b/reference/fstream/basic_ofstream.md @@ -83,4 +83,3 @@ int main() { * std::ofstream[color ff0000] * ofs.is_open[link basic_ofstream/is_open.md] * ofs.close[link basic_ofstream/close.md] - diff --git a/reference/functional/bad_function_call.md b/reference/functional/bad_function_call.md index 4170a52ca1..779a6325c7 100644 --- a/reference/functional/bad_function_call.md +++ b/reference/functional/bad_function_call.md @@ -53,4 +53,3 @@ bad function call ### 参照 - diff --git a/reference/functional/copyable_function/swap.md b/reference/functional/copyable_function/swap.md index 1b78432bb6..d9d60278d7 100644 --- a/reference/functional/copyable_function/swap.md +++ b/reference/functional/copyable_function/swap.md @@ -69,4 +69,3 @@ int main() ## 参照 - [P2548R6 copyable_function](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2548r6.pdf) - diff --git a/reference/functional/function/op_assign.md b/reference/functional/function/op_assign.md index e8c55dc308..4c5f11bef1 100644 --- a/reference/functional/function/op_assign.md +++ b/reference/functional/function/op_assign.md @@ -78,4 +78,3 @@ int main() ## 参照 - [LWG Issue 2132. `std::function` ambiguity](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2132) - C++14から、(4)でシグニチャが合わない関数オブジェクトが渡された場合に、SFINAEされるようになった。 - diff --git a/reference/functional/function/op_bool.md b/reference/functional/function/op_bool.md index 4bafe051d2..7f0a224343 100644 --- a/reference/functional/function/op_bool.md +++ b/reference/functional/function/op_bool.md @@ -55,4 +55,3 @@ not empty ## 参照 - diff --git a/reference/functional/function/op_call.md b/reference/functional/function/op_call.md index 3e7e019702..e8e0bd2624 100644 --- a/reference/functional/function/op_call.md +++ b/reference/functional/function/op_call.md @@ -62,4 +62,3 @@ int main() ## 参照 - diff --git a/reference/functional/function/op_destructor.md b/reference/functional/function/op_destructor.md index 83fa383c38..2bdfbb51b5 100644 --- a/reference/functional/function/op_destructor.md +++ b/reference/functional/function/op_destructor.md @@ -29,4 +29,3 @@ ## 参照 - diff --git a/reference/functional/function/swap.md b/reference/functional/function/swap.md index 8181040030..79ff225611 100644 --- a/reference/functional/function/swap.md +++ b/reference/functional/function/swap.md @@ -68,4 +68,3 @@ int main() ## 参照 - diff --git a/reference/functional/function/swap_free.md b/reference/functional/function/swap_free.md index e79bdfe64e..d0c7b9d0b5 100644 --- a/reference/functional/function/swap_free.md +++ b/reference/functional/function/swap_free.md @@ -66,4 +66,3 @@ int main() ## 参照 - diff --git a/reference/functional/function/target.md b/reference/functional/function/target.md index dfc4448eef..5ad1e73077 100644 --- a/reference/functional/function/target.md +++ b/reference/functional/function/target.md @@ -84,4 +84,3 @@ int main() ## 参照 - diff --git a/reference/functional/function/target_type.md b/reference/functional/function/target_type.md index 3a75a1bf77..6ab724a8e3 100644 --- a/reference/functional/function/target_type.md +++ b/reference/functional/function/target_type.md @@ -60,4 +60,3 @@ f has ident ## 参照 - diff --git a/reference/functional/move_only_function/swap.md b/reference/functional/move_only_function/swap.md index 3bc3956208..da3e7ccdc9 100644 --- a/reference/functional/move_only_function/swap.md +++ b/reference/functional/move_only_function/swap.md @@ -69,4 +69,3 @@ int main() ## 参照 - [P0288R9 move_only_function](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0288r9.html) - diff --git a/reference/functional/reference_wrapper/get.md b/reference/functional/reference_wrapper/get.md index 3e6ee6963d..e71b070707 100644 --- a/reference/functional/reference_wrapper/get.md +++ b/reference/functional/reference_wrapper/get.md @@ -57,5 +57,3 @@ int main() - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 - - diff --git a/reference/functional/reference_wrapper/op_assign.md b/reference/functional/reference_wrapper/op_assign.md index 429d9c5f72..dfbaf5a30e 100644 --- a/reference/functional/reference_wrapper/op_assign.md +++ b/reference/functional/reference_wrapper/op_assign.md @@ -63,5 +63,3 @@ int main() ## 参照 - - diff --git a/reference/functional/reference_wrapper/op_cast_ref_t.md b/reference/functional/reference_wrapper/op_cast_ref_t.md index c6778ac42b..173a64fed0 100644 --- a/reference/functional/reference_wrapper/op_cast_ref_t.md +++ b/reference/functional/reference_wrapper/op_cast_ref_t.md @@ -57,5 +57,3 @@ int main() ## 参照 - - diff --git a/reference/future.md b/reference/future.md index 004e80b41d..4b91f52f5a 100644 --- a/reference/future.md +++ b/reference/future.md @@ -28,4 +28,3 @@ ## バージョン ### 言語 - C++11 - diff --git a/reference/future/future.md b/reference/future/future.md index cdfb01e64f..275d81e897 100644 --- a/reference/future/future.md +++ b/reference/future/future.md @@ -105,4 +105,3 @@ int main() ## 参照 - diff --git a/reference/future/future/get.md b/reference/future/future/get.md index 137c1f4033..e4a0414307 100644 --- a/reference/future/future/get.md +++ b/reference/future/future/get.md @@ -216,4 +216,3 @@ int main() ## 参照 - [LWG Issue 2096. Incorrect constraints of `future::get` in regard to `MoveAssignable`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2096) - C++14から、`future::get()`の戻り値が変更された。C++11では「ムーブ代入可能ならムーブで返し、そうでなければコピーで返す」となっていたが、これは現実的ではない制約だった。 - diff --git a/reference/future/future/op_assign.md b/reference/future/future/op_assign.md index 4711d38a43..58321d6983 100644 --- a/reference/future/future/op_assign.md +++ b/reference/future/future/op_assign.md @@ -61,5 +61,3 @@ int main() ## 参照 - - diff --git a/reference/future/future/op_constructor.md b/reference/future/future/op_constructor.md index 53dbfffa4d..d9e7d3a4cb 100644 --- a/reference/future/future/op_constructor.md +++ b/reference/future/future/op_constructor.md @@ -61,5 +61,3 @@ int main() ## 参照 - - diff --git a/reference/future/future/op_destructor.md b/reference/future/future/op_destructor.md index 8dcc12b5af..a84b2a1dbb 100644 --- a/reference/future/future/op_destructor.md +++ b/reference/future/future/op_destructor.md @@ -44,5 +44,3 @@ ## 参照 [async関数launch::asyncポリシーとfutureのちょっと特殊な動作 - yohhoyの日記](http://d.hatena.ne.jp/yohhoy/20120317/p1) [async関数launch::asyncポリシーとfutureのちょっと特殊な動作(続き) - yohhoyの日記](http://d.hatena.ne.jp/yohhoy/20121004/p1) - - diff --git a/reference/future/future/valid.md b/reference/future/future/valid.md index 9626f2b194..a0a77953f4 100644 --- a/reference/future/future/valid.md +++ b/reference/future/future/valid.md @@ -67,5 +67,3 @@ false ## 参照 - - diff --git a/reference/future/future/wait.md b/reference/future/future/wait.md index 397bb84366..48b9486839 100644 --- a/reference/future/future/wait.md +++ b/reference/future/future/wait.md @@ -79,5 +79,3 @@ int main() ## 参照 - - diff --git a/reference/future/future/wait_for.md b/reference/future/future/wait_for.md index f2dca8bbcd..f5e13ab998 100644 --- a/reference/future/future/wait_for.md +++ b/reference/future/future/wait_for.md @@ -138,4 +138,3 @@ true ## 参照 - [LWG Issue 2185. Missing throws clause for `future`/`shared_future::wait_for`/`wait_until`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2185) - diff --git a/reference/future/future/wait_until.md b/reference/future/future/wait_until.md index 2d61fe9f28..803c27ac2d 100644 --- a/reference/future/future/wait_until.md +++ b/reference/future/future/wait_until.md @@ -105,5 +105,3 @@ int main() ## 参照 - [LWG Issue 2185. Missing throws clause for `future`/`shared_future::wait_for`/`wait_until`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2185) - - diff --git a/reference/future/future_category.md b/reference/future/future_category.md index 9064dc494e..300ad75ece 100644 --- a/reference/future/future_category.md +++ b/reference/future/future_category.md @@ -68,5 +68,3 @@ Broken promise ## 参照 - - diff --git a/reference/future/future_errc.md b/reference/future/future_errc.md index 90c2c529ec..4ca4e8ee07 100644 --- a/reference/future/future_errc.md +++ b/reference/future/future_errc.md @@ -50,4 +50,3 @@ future操作に関するエラー値。 ## 参照 - [LWG2056 - future_errc enums start with value 0 (invalid value for broken_promise)](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2056) - C++11の`future_errc`は、開始値が0だった。[`error_code`](/reference/system_error/error_code.md)クラスの[`operator bool()`](/reference/system_error/error_code/op_bool.md)が0を正常値と見なしてしまうため、C++14では`future_errc`の値を実装定義とした。 - diff --git a/reference/future/future_error.md b/reference/future/future_error.md index 2c7c3cde7b..1e51fd9cf3 100644 --- a/reference/future/future_error.md +++ b/reference/future/future_error.md @@ -85,4 +85,3 @@ what:Promise already satisfied ## 参照 - [P0517r0 Make future_error Constructible](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0517r0.html) - diff --git a/reference/future/future_status.md b/reference/future/future_status.md index 7fe31e375b..8bb080645a 100644 --- a/reference/future/future_status.md +++ b/reference/future/future_status.md @@ -36,5 +36,3 @@ namespace std { ## 参照 - - diff --git a/reference/future/is_error_code_enum.md b/reference/future/is_error_code_enum.md index af6bb9b9a6..29a12c2be6 100644 --- a/reference/future/is_error_code_enum.md +++ b/reference/future/is_error_code_enum.md @@ -53,5 +53,3 @@ Broken promise ## 参照 - - diff --git a/reference/future/launch.md b/reference/future/launch.md index f0ea8f0db8..4e994ef4e5 100644 --- a/reference/future/launch.md +++ b/reference/future/launch.md @@ -41,4 +41,3 @@ namespace std { ## 参照 - [LWG Issue 2102. Why is `std::launch` an implementation-defined type?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2102) - diff --git a/reference/future/make_error_code.md b/reference/future/make_error_code.md index 98b00a7015..00f5b45662 100644 --- a/reference/future/make_error_code.md +++ b/reference/future/make_error_code.md @@ -64,5 +64,3 @@ message : Broken promise ## 参照 - - diff --git a/reference/future/make_error_condition.md b/reference/future/make_error_condition.md index dc902870c8..6a74f48ed4 100644 --- a/reference/future/make_error_condition.md +++ b/reference/future/make_error_condition.md @@ -66,5 +66,3 @@ message : Broken promise ## 参照 - - diff --git a/reference/future/packaged_task.md b/reference/future/packaged_task.md index 6324f7a8d0..42d13de2b6 100644 --- a/reference/future/packaged_task.md +++ b/reference/future/packaged_task.md @@ -130,4 +130,3 @@ int main() ## 参照 - diff --git a/reference/future/packaged_task/get_future.md b/reference/future/packaged_task/get_future.md index d5d45da8a0..0dd6ecb4e6 100644 --- a/reference/future/packaged_task/get_future.md +++ b/reference/future/packaged_task/get_future.md @@ -88,4 +88,3 @@ int main() ## 参照 - [LWG Issue 2412. `promise::set_value()` and `promise::get_future()` should not race](https://wg21.cmeerw.net/lwg/issue2412) - diff --git a/reference/future/packaged_task/make_ready_at_thread_exit.md b/reference/future/packaged_task/make_ready_at_thread_exit.md index b23a914253..83871dd45b 100644 --- a/reference/future/packaged_task/make_ready_at_thread_exit.md +++ b/reference/future/packaged_task/make_ready_at_thread_exit.md @@ -90,4 +90,3 @@ int main() ## 参照 - [_at_thread_exit系の関数が存在している理由](/article/lib/at_thread_exit.md) - diff --git a/reference/future/packaged_task/op_assign.md b/reference/future/packaged_task/op_assign.md index e324f583e9..e58d3cb6b0 100644 --- a/reference/future/packaged_task/op_assign.md +++ b/reference/future/packaged_task/op_assign.md @@ -77,5 +77,3 @@ int main() ## 参照 - [LWG Issue 2067. `packaged_task` should have deleted copy c'tor with const parameter](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2067) - - diff --git a/reference/future/packaged_task/op_call.md b/reference/future/packaged_task/op_call.md index 86e69853c3..fb0fbd6a86 100644 --- a/reference/future/packaged_task/op_call.md +++ b/reference/future/packaged_task/op_call.md @@ -104,5 +104,3 @@ error! ## 参照 - - diff --git a/reference/future/packaged_task/op_deduction_guide.md b/reference/future/packaged_task/op_deduction_guide.md index d99598b5fe..aa19ba7dc5 100644 --- a/reference/future/packaged_task/op_deduction_guide.md +++ b/reference/future/packaged_task/op_deduction_guide.md @@ -93,4 +93,3 @@ int main() ## 参照 - [P0433R2 Toward a resolution of US7 and US14: Integrating template deduction for class templates into the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0433r2.html) - diff --git a/reference/future/packaged_task/op_destructor.md b/reference/future/packaged_task/op_destructor.md index 83d5c8b3a6..5570912b3d 100644 --- a/reference/future/packaged_task/op_destructor.md +++ b/reference/future/packaged_task/op_destructor.md @@ -37,5 +37,3 @@ ## 参照 - - diff --git a/reference/future/packaged_task/reset.md b/reference/future/packaged_task/reset.md index dde088d1b0..9d1277343f 100644 --- a/reference/future/packaged_task/reset.md +++ b/reference/future/packaged_task/reset.md @@ -86,5 +86,3 @@ int main() ## 参照 - - diff --git a/reference/future/packaged_task/swap.md b/reference/future/packaged_task/swap.md index c50374b84d..044c926de7 100644 --- a/reference/future/packaged_task/swap.md +++ b/reference/future/packaged_task/swap.md @@ -73,5 +73,3 @@ int main() ## 参照 - - diff --git a/reference/future/packaged_task/swap_free.md b/reference/future/packaged_task/swap_free.md index 1686fac01a..ec78620dcf 100644 --- a/reference/future/packaged_task/swap_free.md +++ b/reference/future/packaged_task/swap_free.md @@ -75,5 +75,3 @@ int main() ## 参照 - - diff --git a/reference/future/packaged_task/uses_allocator.md b/reference/future/packaged_task/uses_allocator.md index 0ff4135eb0..1bb8c538e8 100644 --- a/reference/future/packaged_task/uses_allocator.md +++ b/reference/future/packaged_task/uses_allocator.md @@ -37,5 +37,3 @@ namespace std { ## 参照 - - diff --git a/reference/future/packaged_task/valid.md b/reference/future/packaged_task/valid.md index 92685815f5..1ee52ed167 100644 --- a/reference/future/packaged_task/valid.md +++ b/reference/future/packaged_task/valid.md @@ -61,5 +61,3 @@ true ## 参照 - - diff --git a/reference/future/promise.md b/reference/future/promise.md index 88be903588..3eae319a2b 100644 --- a/reference/future/promise.md +++ b/reference/future/promise.md @@ -124,4 +124,3 @@ int main() ## 参照 - diff --git a/reference/future/promise/get_future.md b/reference/future/promise/get_future.md index 4eee4e297a..167bd42dc6 100644 --- a/reference/future/promise/get_future.md +++ b/reference/future/promise/get_future.md @@ -101,4 +101,3 @@ int main() ## 参照 - [LWG Issue 2412. `promise::set_value()` and `promise::get_future()` should not race](https://wg21.cmeerw.net/lwg/issue2412) - diff --git a/reference/future/promise/op_assign.md b/reference/future/promise/op_assign.md index f9aea350f4..35d1935045 100644 --- a/reference/future/promise/op_assign.md +++ b/reference/future/promise/op_assign.md @@ -55,5 +55,3 @@ int main() ## 参照 - - diff --git a/reference/future/promise/op_constructor.md b/reference/future/promise/op_constructor.md index 7f10dc14c7..6c14dcd8f9 100644 --- a/reference/future/promise/op_constructor.md +++ b/reference/future/promise/op_constructor.md @@ -73,5 +73,3 @@ int main() ## 参照 - - diff --git a/reference/future/promise/op_destructor.md b/reference/future/promise/op_destructor.md index 4f919d0cd5..35a7c1897f 100644 --- a/reference/future/promise/op_destructor.md +++ b/reference/future/promise/op_destructor.md @@ -71,5 +71,3 @@ std::future_error: Broken promise ## 参照 - - diff --git a/reference/future/promise/set_exception.md b/reference/future/promise/set_exception.md index cab3d3183e..60177d251a 100644 --- a/reference/future/promise/set_exception.md +++ b/reference/future/promise/set_exception.md @@ -93,5 +93,3 @@ invalid argument! ## 参照 - - diff --git a/reference/future/promise/set_exception_at_thread_exit.md b/reference/future/promise/set_exception_at_thread_exit.md index cb7b114347..aff1274977 100644 --- a/reference/future/promise/set_exception_at_thread_exit.md +++ b/reference/future/promise/set_exception_at_thread_exit.md @@ -99,5 +99,3 @@ invalid argument! ## 参照 - [_at_thread_exit系の関数が存在している理由](/article/lib/at_thread_exit.md) - - diff --git a/reference/future/promise/set_value.md b/reference/future/promise/set_value.md index 9ce46eba6e..4de9785326 100644 --- a/reference/future/promise/set_value.md +++ b/reference/future/promise/set_value.md @@ -218,4 +218,3 @@ int main() ## 参照 - [LWG Issue 2098. Minor Inconsistency between `promise::set_value` and `promise::set_value_at_thread_exit`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2098) - diff --git a/reference/future/promise/set_value_at_thread_exit.md b/reference/future/promise/set_value_at_thread_exit.md index 528849ed85..520810326c 100644 --- a/reference/future/promise/set_value_at_thread_exit.md +++ b/reference/future/promise/set_value_at_thread_exit.md @@ -232,5 +232,3 @@ int main() ## 参照 - [_at_thread_exit系の関数が存在している理由](/article/lib/at_thread_exit.md) - [LWG Issue 2098. Minor Inconsistency between `promise::set_value` and `promise::set_value_at_thread_exit`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2098) - - diff --git a/reference/future/promise/swap.md b/reference/future/promise/swap.md index 0a9c0e48a1..bfbf2e7552 100644 --- a/reference/future/promise/swap.md +++ b/reference/future/promise/swap.md @@ -78,5 +78,3 @@ int main() ## 参照 - - diff --git a/reference/future/promise/swap_free.md b/reference/future/promise/swap_free.md index 6fda2951f1..706bf322e8 100644 --- a/reference/future/promise/swap_free.md +++ b/reference/future/promise/swap_free.md @@ -76,5 +76,3 @@ int main() ## 参照 - - diff --git a/reference/future/promise/uses_allocator.md b/reference/future/promise/uses_allocator.md index c0f5e354c0..4eed5135b5 100644 --- a/reference/future/promise/uses_allocator.md +++ b/reference/future/promise/uses_allocator.md @@ -37,5 +37,3 @@ namespace std { ## 参照 - - diff --git a/reference/future/shared_future.md b/reference/future/shared_future.md index d918ca0df0..9c11edd0f8 100644 --- a/reference/future/shared_future.md +++ b/reference/future/shared_future.md @@ -108,4 +108,3 @@ int main() ## 参照 - diff --git a/reference/future/shared_future/get.md b/reference/future/shared_future/get.md index 5f33047225..c2f6a56ddd 100644 --- a/reference/future/shared_future/get.md +++ b/reference/future/shared_future/get.md @@ -171,5 +171,3 @@ thread:1 sum:40 ## 参照 - - diff --git a/reference/future/shared_future/op_assign.md b/reference/future/shared_future/op_assign.md index 93002e6308..1440b27fd1 100644 --- a/reference/future/shared_future/op_assign.md +++ b/reference/future/shared_future/op_assign.md @@ -96,5 +96,3 @@ int main() ## 参照 - - diff --git a/reference/future/shared_future/op_constructor.md b/reference/future/shared_future/op_constructor.md index 0404ed859d..e97ea0ddfc 100644 --- a/reference/future/shared_future/op_constructor.md +++ b/reference/future/shared_future/op_constructor.md @@ -97,5 +97,3 @@ int main() ## 参照 - - diff --git a/reference/future/shared_future/op_destructor.md b/reference/future/shared_future/op_destructor.md index ea7c348157..6124086c2e 100644 --- a/reference/future/shared_future/op_destructor.md +++ b/reference/future/shared_future/op_destructor.md @@ -43,4 +43,3 @@ ## 参照 - [`async`関数`launch::async`ポリシーと`future`のちょっと特殊な動作 - yohhoyの日記](http://d.hatena.ne.jp/yohhoy/20120317/p1) - [`async`関数`launch::async`ポリシーと`future`のちょっと特殊な動作(続き) - yohhoyの日記](http://d.hatena.ne.jp/yohhoy/20121004/p1) - diff --git a/reference/future/shared_future/valid.md b/reference/future/shared_future/valid.md index 996faff6bb..5d831591b8 100644 --- a/reference/future/shared_future/valid.md +++ b/reference/future/shared_future/valid.md @@ -59,5 +59,3 @@ int main() ## 参照 - - diff --git a/reference/future/shared_future/wait.md b/reference/future/shared_future/wait.md index 37982656bc..2a1f1328ec 100644 --- a/reference/future/shared_future/wait.md +++ b/reference/future/shared_future/wait.md @@ -75,5 +75,3 @@ int main() ## 参照 - - diff --git a/reference/future/shared_future/wait_for.md b/reference/future/shared_future/wait_for.md index 1b355f86f7..ce2463a5b1 100644 --- a/reference/future/shared_future/wait_for.md +++ b/reference/future/shared_future/wait_for.md @@ -89,5 +89,3 @@ int main() ## 参照 - [LWG Issue 2185. Missing throws clause for `future`/`shared_future::wait_for`/`wait_until`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2185) - - diff --git a/reference/future/shared_future/wait_until.md b/reference/future/shared_future/wait_until.md index 24feae0cea..9c33c827bb 100644 --- a/reference/future/shared_future/wait_until.md +++ b/reference/future/shared_future/wait_until.md @@ -99,5 +99,3 @@ int main() ## 参照 - [LWG Issue 2185. Missing throws clause for `future`/`shared_future::wait_for`/`wait_until`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2185) - - diff --git a/reference/initializer_list/initializer_list.md b/reference/initializer_list/initializer_list.md index 4718fc8401..c655a09117 100644 --- a/reference/initializer_list/initializer_list.md +++ b/reference/initializer_list/initializer_list.md @@ -82,4 +82,3 @@ int main() ## 関連項目 - [C++11 初期化子リスト](/lang/cpp11/initializer_lists.md) - diff --git a/reference/initializer_list/initializer_list/begin.md b/reference/initializer_list/initializer_list/begin.md index 8854951930..8b59e120bb 100644 --- a/reference/initializer_list/initializer_list/begin.md +++ b/reference/initializer_list/initializer_list/begin.md @@ -57,4 +57,3 @@ int main() ## 参照 - [N3471 Constexpr Library Additions: utilities, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3471.html) - diff --git a/reference/initializer_list/initializer_list/begin_free.md b/reference/initializer_list/initializer_list/begin_free.md index cd6d4f9d91..87c424f4c2 100644 --- a/reference/initializer_list/initializer_list/begin_free.md +++ b/reference/initializer_list/initializer_list/begin_free.md @@ -61,4 +61,3 @@ int main() ## 参照 - [N3257 Range-based for statements and ADL](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3257.pdf) - [N3471 Constexpr Library Additions: utilities, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3471.html) - diff --git a/reference/initializer_list/initializer_list/end.md b/reference/initializer_list/initializer_list/end.md index 635339d2e1..aab873c6b2 100644 --- a/reference/initializer_list/initializer_list/end.md +++ b/reference/initializer_list/initializer_list/end.md @@ -62,4 +62,3 @@ int main() ## 参照 - [N3471 Constexpr Library Additions: utilities, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3471.html) - diff --git a/reference/initializer_list/initializer_list/end_free.md b/reference/initializer_list/initializer_list/end_free.md index 10033751ba..6c130fa3db 100644 --- a/reference/initializer_list/initializer_list/end_free.md +++ b/reference/initializer_list/initializer_list/end_free.md @@ -63,4 +63,3 @@ int main() ## 参照 - [N3257 Range-based for statements and ADL](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3257.pdf) - [N3471 Constexpr Library Additions: utilities, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3471.html) - diff --git a/reference/initializer_list/initializer_list/op_constructor.md b/reference/initializer_list/initializer_list/op_constructor.md index 592081ccd7..c23d84f7f8 100644 --- a/reference/initializer_list/initializer_list/op_constructor.md +++ b/reference/initializer_list/initializer_list/op_constructor.md @@ -43,4 +43,3 @@ int main() ## 参照 - [N3471 Constexpr Library Additions: utilities, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3471.html) - diff --git a/reference/initializer_list/initializer_list/size.md b/reference/initializer_list/initializer_list/size.md index 94646278cf..7afd866ee9 100644 --- a/reference/initializer_list/initializer_list/size.md +++ b/reference/initializer_list/initializer_list/size.md @@ -55,4 +55,3 @@ int main() ## 参照 - [N3471 Constexpr Library Additions: utilities, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3471.html) - diff --git a/reference/iomanip.md b/reference/iomanip.md index 077291749e..27137e3a65 100644 --- a/reference/iomanip.md +++ b/reference/iomanip.md @@ -18,5 +18,3 @@ | `get_time` | 日時書式から入力する (function template) | C++11 | | [`put_time`](iomanip/put_time.md) | 日時書式で出力する (function template) | C++11 | | [`quoted`](iomanip/quoted.md) | 囲み文字指定で入出力する (function template) | C++14 | - - diff --git a/reference/iomanip/put_time.md b/reference/iomanip/put_time.md index 6102db6697..cbce78e163 100644 --- a/reference/iomanip/put_time.md +++ b/reference/iomanip/put_time.md @@ -93,5 +93,3 @@ Thu Dec 25 15:12:30 2014 - [GCC](/implementation.md#gcc): 5.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - - diff --git a/reference/iomanip/resetiosflags.md b/reference/iomanip/resetiosflags.md index 6f002d6908..9260c85bdc 100644 --- a/reference/iomanip/resetiosflags.md +++ b/reference/iomanip/resetiosflags.md @@ -51,4 +51,3 @@ int main() 1.234568e+03 1234.57 ``` - diff --git a/reference/iomanip/setbase.md b/reference/iomanip/setbase.md index 80f1712a67..b24c4bd390 100644 --- a/reference/iomanip/setbase.md +++ b/reference/iomanip/setbase.md @@ -53,5 +53,3 @@ deadbeef 33653337357 3735928559 ``` - - diff --git a/reference/iomanip/setfill.md b/reference/iomanip/setfill.md index cfdb2cc4c9..66894be370 100644 --- a/reference/iomanip/setfill.md +++ b/reference/iomanip/setfill.md @@ -48,4 +48,3 @@ int main() 123 00123 ``` - diff --git a/reference/iomanip/setiosflags.md b/reference/iomanip/setiosflags.md index b5de2269d8..98fd134a71 100644 --- a/reference/iomanip/setiosflags.md +++ b/reference/iomanip/setiosflags.md @@ -49,4 +49,3 @@ int main() 1234.57 1.234568e+03 ``` - diff --git a/reference/iomanip/setprecision.md b/reference/iomanip/setprecision.md index 277bf6a02c..5c33358d82 100644 --- a/reference/iomanip/setprecision.md +++ b/reference/iomanip/setprecision.md @@ -77,4 +77,3 @@ int main() 3.15 3.146 ``` - diff --git a/reference/iomanip/setw.md b/reference/iomanip/setw.md index f289febcb5..38ab26ef8f 100644 --- a/reference/iomanip/setw.md +++ b/reference/iomanip/setw.md @@ -57,4 +57,3 @@ int main() 123 abc ``` - diff --git a/reference/ios/hexfloat.md b/reference/ios/hexfloat.md index 4be2088427..004fed2ed0 100644 --- a/reference/ios/hexfloat.md +++ b/reference/ios/hexfloat.md @@ -44,4 +44,3 @@ namespace std { - [`fixed`](fixed.md) - [`scientific`](scientific.md) - [N1503 Proposed Additions to TR-1 to Improve Compatibility with C99](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1503.htm) - diff --git a/reference/ios/ios_base/xalloc.md b/reference/ios/ios_base/xalloc.md index 41f7f70b38..1ce15a70c9 100644 --- a/reference/ios/ios_base/xalloc.md +++ b/reference/ios/ios_base/xalloc.md @@ -100,4 +100,3 @@ a ## 参照 - [LWG Issue 2143. `ios_base::xalloc` should be thread-safe](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2143) - C++14から、この関数は複数スレッドから呼び出しても安全になった。 - diff --git a/reference/ios/iostream_category.md b/reference/ios/iostream_category.md index 68f25c52a4..3a77477530 100644 --- a/reference/ios/iostream_category.md +++ b/reference/ios/iostream_category.md @@ -68,4 +68,3 @@ iostream stream error ## 参照 - [LWG Issue 2087. iostream_category() and noexcept](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2087) - diff --git a/reference/ios/is_error_code_enum.md b/reference/ios/is_error_code_enum.md index 78703ce4c7..c8e6c40858 100644 --- a/reference/ios/is_error_code_enum.md +++ b/reference/ios/is_error_code_enum.md @@ -51,5 +51,3 @@ iostream stream error ## 参照 - - diff --git a/reference/ios/make_error_code.md b/reference/ios/make_error_code.md index 228bd95712..19f4d1611c 100644 --- a/reference/ios/make_error_code.md +++ b/reference/ios/make_error_code.md @@ -65,4 +65,3 @@ message : iostream stream error ## 参照 - [LWG Issue 2087. iostream_category() and noexcept](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2087) - diff --git a/reference/ios/make_error_condition.md b/reference/ios/make_error_condition.md index 52cd91dd2a..12f97ebd52 100644 --- a/reference/ios/make_error_condition.md +++ b/reference/ios/make_error_condition.md @@ -65,4 +65,3 @@ message : iostream stream error ## 参照 - [LWG Issue 2087. iostream_category() and noexcept](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2087) - diff --git a/reference/iterator/back_insert_iterator.md b/reference/iterator/back_insert_iterator.md index 0e80717ec4..0de2811eb8 100644 --- a/reference/iterator/back_insert_iterator.md +++ b/reference/iterator/back_insert_iterator.md @@ -88,4 +88,3 @@ int main() ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) - diff --git a/reference/iterator/cbegin.md b/reference/iterator/cbegin.md index 4d42d9fa50..849fd6557a 100644 --- a/reference/iterator/cbegin.md +++ b/reference/iterator/cbegin.md @@ -67,4 +67,3 @@ int main() ## 参照 - [LWG Issue 2128. Absence of global functions `cbegin`/`cend`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2128) - diff --git a/reference/iterator/cend.md b/reference/iterator/cend.md index f3e5c93f73..ac7f5c7209 100644 --- a/reference/iterator/cend.md +++ b/reference/iterator/cend.md @@ -67,4 +67,3 @@ int main() ## 参照 - [LWG Issue 2128. Absence of global functions `cbegin`/`cend`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2128) - diff --git a/reference/iterator/common_iterator/op_assign.md b/reference/iterator/common_iterator/op_assign.md index c6dcc4cbde..e80de3743c 100644 --- a/reference/iterator/common_iterator/op_assign.md +++ b/reference/iterator/common_iterator/op_assign.md @@ -43,4 +43,3 @@ common_iterator& operator=(const common_iterator& x); ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) - diff --git a/reference/iterator/counted_iterator/op_assign.md b/reference/iterator/counted_iterator/op_assign.md index b22c79462b..34f7717cee 100644 --- a/reference/iterator/counted_iterator/op_assign.md +++ b/reference/iterator/counted_iterator/op_assign.md @@ -37,4 +37,3 @@ constexpr counted_iterator& operator=(const counted_iterator& x); ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) - diff --git a/reference/iterator/crbegin.md b/reference/iterator/crbegin.md index 1b3a8481a9..52901c357c 100644 --- a/reference/iterator/crbegin.md +++ b/reference/iterator/crbegin.md @@ -94,4 +94,3 @@ int main() ## 参照 - [LWG Issue 2128. Absence of global functions `cbegin`/`cend`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2128) - diff --git a/reference/iterator/crend.md b/reference/iterator/crend.md index 01db6bd29b..de627c147f 100644 --- a/reference/iterator/crend.md +++ b/reference/iterator/crend.md @@ -94,4 +94,3 @@ int main() ## 参照 - [LWG Issue 2128. Absence of global functions `cbegin`/`cend`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2128) - diff --git a/reference/iterator/front_insert_iterator/op_constructor.md b/reference/iterator/front_insert_iterator/op_constructor.md index 1ef1eb142e..7ca62ea6b7 100644 --- a/reference/iterator/front_insert_iterator/op_constructor.md +++ b/reference/iterator/front_insert_iterator/op_constructor.md @@ -26,4 +26,3 @@ explicit constexpr front_insert_iterator(Container& x); // C++20 - [P1032R1 Misc `constexpr` bits](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1032r1.html) - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) - [P2325R3 Views should not be required to be default constructible](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2325r3.html) - diff --git a/reference/iterator/incrementable.md b/reference/iterator/incrementable.md index ae957aaa37..3e509e92c0 100644 --- a/reference/iterator/incrementable.md +++ b/reference/iterator/incrementable.md @@ -113,4 +113,3 @@ sample_weak_incrementable is not incrementable ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) - diff --git a/reference/iterator/istream_iterator.md b/reference/iterator/istream_iterator.md index c325f3e274..1560476bee 100644 --- a/reference/iterator/istream_iterator.md +++ b/reference/iterator/istream_iterator.md @@ -95,5 +95,3 @@ int main() - [`basic_istream_view`](/reference/ranges/basic_istream_view.md): ストリームからデータを読み込むRange ### 参照 - - diff --git a/reference/iterator/istream_iterator/op_arrow.md b/reference/iterator/istream_iterator/op_arrow.md index bc9733d431..627dc52849 100644 --- a/reference/iterator/istream_iterator/op_arrow.md +++ b/reference/iterator/istream_iterator/op_arrow.md @@ -48,5 +48,3 @@ int main() ``` ## 参照 - - diff --git a/reference/iterator/istream_iterator/op_deref.md b/reference/iterator/istream_iterator/op_deref.md index a1899a556a..d10523b6c7 100644 --- a/reference/iterator/istream_iterator/op_deref.md +++ b/reference/iterator/istream_iterator/op_deref.md @@ -50,5 +50,3 @@ int main() ``` ## 参照 - - diff --git a/reference/iterator/istream_iterator/op_equal.md b/reference/iterator/istream_iterator/op_equal.md index 7e38e6da12..06cff122de 100644 --- a/reference/iterator/istream_iterator/op_equal.md +++ b/reference/iterator/istream_iterator/op_equal.md @@ -74,5 +74,3 @@ it1 == last : true ``` ## 参照 - - diff --git a/reference/iterator/istream_iterator/op_increment.md b/reference/iterator/istream_iterator/op_increment.md index d3d5b03a70..126905eeab 100644 --- a/reference/iterator/istream_iterator/op_increment.md +++ b/reference/iterator/istream_iterator/op_increment.md @@ -59,5 +59,3 @@ int main() ``` ## 参照 - - diff --git a/reference/iterator/istreambuf_iterator.md b/reference/iterator/istreambuf_iterator.md index c76d20f76d..3bff874159 100644 --- a/reference/iterator/istreambuf_iterator.md +++ b/reference/iterator/istreambuf_iterator.md @@ -91,4 +91,3 @@ int main() ## 関連項目 - [`basic_streambuf`](../streambuf/basic_streambuf.md) - diff --git a/reference/iterator/istreambuf_iterator/equal.md b/reference/iterator/istreambuf_iterator/equal.md index 9b6ba5fe5f..eb27830dcb 100644 --- a/reference/iterator/istreambuf_iterator/equal.md +++ b/reference/iterator/istreambuf_iterator/equal.md @@ -59,5 +59,3 @@ equal ``` ## 参照 - - diff --git a/reference/iterator/istreambuf_iterator/op_arrow.md b/reference/iterator/istreambuf_iterator/op_arrow.md index 3efec2c8df..b79c963510 100644 --- a/reference/iterator/istreambuf_iterator/op_arrow.md +++ b/reference/iterator/istreambuf_iterator/op_arrow.md @@ -41,5 +41,3 @@ pointer operator->() const; ## 参照 - - diff --git a/reference/iterator/istreambuf_iterator/op_constructor.md b/reference/iterator/istreambuf_iterator/op_constructor.md index 0797823dd6..3e9523557b 100644 --- a/reference/iterator/istreambuf_iterator/op_constructor.md +++ b/reference/iterator/istreambuf_iterator/op_constructor.md @@ -61,5 +61,3 @@ int main() ``` ## 参照 - - diff --git a/reference/iterator/istreambuf_iterator/op_deref.md b/reference/iterator/istreambuf_iterator/op_deref.md index 3c2f8a9939..46f45b5a51 100644 --- a/reference/iterator/istreambuf_iterator/op_deref.md +++ b/reference/iterator/istreambuf_iterator/op_deref.md @@ -41,5 +41,3 @@ int main() ``` ## 参照 - - diff --git a/reference/iterator/istreambuf_iterator/op_equal.md b/reference/iterator/istreambuf_iterator/op_equal.md index cfebc4f4d5..3448830ce1 100644 --- a/reference/iterator/istreambuf_iterator/op_equal.md +++ b/reference/iterator/istreambuf_iterator/op_equal.md @@ -77,5 +77,3 @@ equal ``` ## 参照 - - diff --git a/reference/iterator/istreambuf_iterator/op_increment.md b/reference/iterator/istreambuf_iterator/op_increment.md index a6db381d0b..c32dba6c2f 100644 --- a/reference/iterator/istreambuf_iterator/op_increment.md +++ b/reference/iterator/istreambuf_iterator/op_increment.md @@ -57,5 +57,3 @@ int main() ``` ## 参照 - - diff --git a/reference/iterator/iterator_tag.md b/reference/iterator/iterator_tag.md index e39e275075..79837d3e77 100644 --- a/reference/iterator/iterator_tag.md +++ b/reference/iterator/iterator_tag.md @@ -31,4 +31,3 @@ namespace std { これらのタグは、コンパイル時にイテレータの分類を判定し、イテレータごとの最適な実装を選択するために使用される。 使用例は、[`distance()`](/reference/iterator/distance.md)関数の実装例を参照。 - diff --git a/reference/iterator/ostream_iterator.md b/reference/iterator/ostream_iterator.md index 0a8e0a1a44..1891f3241a 100644 --- a/reference/iterator/ostream_iterator.md +++ b/reference/iterator/ostream_iterator.md @@ -66,4 +66,3 @@ int main() ``` ## 参照 - diff --git a/reference/iterator/sentinel_for.md b/reference/iterator/sentinel_for.md index 22a5dbfc01..69daeed997 100644 --- a/reference/iterator/sentinel_for.md +++ b/reference/iterator/sentinel_for.md @@ -108,4 +108,3 @@ int* is not sentinel for double* - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) - [LWG Issue 3453. Generic code cannot call `ranges::advance(i, s)`](https://cplusplus.github.io/LWG/issue3453) - diff --git a/reference/limits.md b/reference/limits.md index 1e09b5242b..87e20ce3aa 100644 --- a/reference/limits.md +++ b/reference/limits.md @@ -11,4 +11,3 @@ | [`numeric_limits`](limits/numeric_limits.md) | 算術型の性質(class template) | | | [`float_round_style`](limits/float_round_style.md) | 浮動小数点数の丸め形式に関する列挙値(enum) | | | [`float_denorm_style`](limits/float_denorm_style.md) | 非正規数のサポートに関する列挙値(enum) | C++23で非推奨 | - diff --git a/reference/limits/float_round_style.md b/reference/limits/float_round_style.md index 70b9e026af..9af46404d0 100644 --- a/reference/limits/float_round_style.md +++ b/reference/limits/float_round_style.md @@ -24,5 +24,3 @@ namespace std { | `round_to_nearest` | 最も近い表現可能な値に丸められる | | `round_toward_infinity` | 正の無限表現に向かって丸められる | | `round_toward_neg_infinity` | 負の無限表現に向かって丸められる | - - diff --git a/reference/limits/numeric_limits/digits.md b/reference/limits/numeric_limits/digits.md index a31713bcc9..7534f53f85 100644 --- a/reference/limits/numeric_limits/digits.md +++ b/reference/limits/numeric_limits/digits.md @@ -57,5 +57,3 @@ int main() 32 53 ``` - - diff --git a/reference/limits/numeric_limits/digits10.md b/reference/limits/numeric_limits/digits10.md index 5d57c87ff6..247ee63586 100644 --- a/reference/limits/numeric_limits/digits10.md +++ b/reference/limits/numeric_limits/digits10.md @@ -55,4 +55,3 @@ int main() ## 参照 - [N1822 A Proposal to add a max significant decimal digits value to the C++ Standard Library Numeric limits](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1822.pdf) - diff --git a/reference/limits/numeric_limits/epsilon.md b/reference/limits/numeric_limits/epsilon.md index 3af48f808e..9f6f61087f 100644 --- a/reference/limits/numeric_limits/epsilon.md +++ b/reference/limits/numeric_limits/epsilon.md @@ -60,4 +60,3 @@ equal - [C++ FAQ - Why doesn't my floating-point comparison work?](https://isocpp.org/wiki/faq/newbie#floating-point-arith) - [Comparing Floating Point Numbers, 2012 Edition](https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/) - [浮動小数比較の落とし穴 - trinoの走り書き](http://d.hatena.ne.jp/n-trino/20161101#p1) - diff --git a/reference/limits/numeric_limits/has_infinity.md b/reference/limits/numeric_limits/has_infinity.md index 59f88967d6..832c7d13ce 100644 --- a/reference/limits/numeric_limits/has_infinity.md +++ b/reference/limits/numeric_limits/has_infinity.md @@ -42,5 +42,3 @@ int : false float : true double : true ``` - - diff --git a/reference/limits/numeric_limits/has_quiet_nan.md b/reference/limits/numeric_limits/has_quiet_nan.md index 6799fed5dc..b61c89efe6 100644 --- a/reference/limits/numeric_limits/has_quiet_nan.md +++ b/reference/limits/numeric_limits/has_quiet_nan.md @@ -44,5 +44,3 @@ int : false float : true double : true ``` - - diff --git a/reference/limits/numeric_limits/has_signaling_nan.md b/reference/limits/numeric_limits/has_signaling_nan.md index 5c618722e0..c4e99489eb 100644 --- a/reference/limits/numeric_limits/has_signaling_nan.md +++ b/reference/limits/numeric_limits/has_signaling_nan.md @@ -42,5 +42,3 @@ int : false float : true double : true ``` - - diff --git a/reference/limits/numeric_limits/infinity.md b/reference/limits/numeric_limits/infinity.md index c27e6285bd..8694cf0029 100644 --- a/reference/limits/numeric_limits/infinity.md +++ b/reference/limits/numeric_limits/infinity.md @@ -56,5 +56,3 @@ double : 1.#INF ## 参照 * [`numeric_limits::has_infinity`](has_infinity.md) - - diff --git a/reference/limits/numeric_limits/is_bounded.md b/reference/limits/numeric_limits/is_bounded.md index 305be36a31..627b1db7b0 100644 --- a/reference/limits/numeric_limits/is_bounded.md +++ b/reference/limits/numeric_limits/is_bounded.md @@ -46,5 +46,3 @@ float : true double : true char : true ``` - - diff --git a/reference/limits/numeric_limits/is_exact.md b/reference/limits/numeric_limits/is_exact.md index 556693ee84..f475d8a274 100644 --- a/reference/limits/numeric_limits/is_exact.md +++ b/reference/limits/numeric_limits/is_exact.md @@ -37,5 +37,3 @@ int main() ### 出力 ``` ``` - - diff --git a/reference/limits/numeric_limits/is_iec559.md b/reference/limits/numeric_limits/is_iec559.md index b08d9d4cc8..2ae8514c41 100644 --- a/reference/limits/numeric_limits/is_iec559.md +++ b/reference/limits/numeric_limits/is_iec559.md @@ -39,5 +39,3 @@ int main() float : true double : true ``` - - diff --git a/reference/limits/numeric_limits/is_integer.md b/reference/limits/numeric_limits/is_integer.md index fbc6dbb7e8..a1059f19db 100644 --- a/reference/limits/numeric_limits/is_integer.md +++ b/reference/limits/numeric_limits/is_integer.md @@ -37,5 +37,3 @@ int main() ### 出力 ``` ``` - - diff --git a/reference/limits/numeric_limits/is_signed.md b/reference/limits/numeric_limits/is_signed.md index 68a83e071e..fe90303603 100644 --- a/reference/limits/numeric_limits/is_signed.md +++ b/reference/limits/numeric_limits/is_signed.md @@ -35,5 +35,3 @@ int main() ### 出力 ``` ``` - - diff --git a/reference/limits/numeric_limits/lowest.md b/reference/limits/numeric_limits/lowest.md index abd42846c1..22710e705d 100644 --- a/reference/limits/numeric_limits/lowest.md +++ b/reference/limits/numeric_limits/lowest.md @@ -71,4 +71,3 @@ int main() ## 参照 - [N1880 A proposal to extend `numeric_limits` for consistent range query (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1880.htm) - [N2348 Wording for `std::numeric_limits::lowest()`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2348.pdf) - diff --git a/reference/limits/numeric_limits/max_digits10.md b/reference/limits/numeric_limits/max_digits10.md index 4aa8ce8f5d..9ba4305ba0 100644 --- a/reference/limits/numeric_limits/max_digits10.md +++ b/reference/limits/numeric_limits/max_digits10.md @@ -116,5 +116,3 @@ float max_digits10 : 9 ### 参照 * [A Proposal to add a max significant decimal digits value to the C++ Standard Library Numeric limits](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1822.pdf) - - diff --git a/reference/limits/numeric_limits/max_exponent.md b/reference/limits/numeric_limits/max_exponent.md index 1661ac4c85..8a26bc891d 100644 --- a/reference/limits/numeric_limits/max_exponent.md +++ b/reference/limits/numeric_limits/max_exponent.md @@ -52,5 +52,3 @@ double : 1024 * [`numeric_limits::min_exponent`](min_exponent.md) * [`numeric_limits::min_exponent10`](min_exponent10.md) * [`numeric_limits::max_exponent10`](max_exponent10.md) - - diff --git a/reference/limits/numeric_limits/max_exponent10.md b/reference/limits/numeric_limits/max_exponent10.md index 4e32f8b2e2..b9cdb1cff5 100644 --- a/reference/limits/numeric_limits/max_exponent10.md +++ b/reference/limits/numeric_limits/max_exponent10.md @@ -52,4 +52,3 @@ double : 308 * [`numeric_limits::min_exponent`](min_exponent.md) * [`numeric_limits::min_exponent10`](min_exponent10.md) * [`numeric_limits::max_exponent`](max_exponent.md) - diff --git a/reference/limits/numeric_limits/min_exponent.md b/reference/limits/numeric_limits/min_exponent.md index abf4e2fcff..02195662e5 100644 --- a/reference/limits/numeric_limits/min_exponent.md +++ b/reference/limits/numeric_limits/min_exponent.md @@ -52,4 +52,3 @@ double : -1021 * [`numeric_limits::min_exponent10`](min_exponent10.md) * [`numeric_limits::max_exponent`](max_exponent.md) * [`numeric_limits::max_exponent10`](max_exponent10.md) - diff --git a/reference/limits/numeric_limits/min_exponent10.md b/reference/limits/numeric_limits/min_exponent10.md index 2e6fab6efe..2afc2bfd8b 100644 --- a/reference/limits/numeric_limits/min_exponent10.md +++ b/reference/limits/numeric_limits/min_exponent10.md @@ -52,4 +52,3 @@ double : -307 * [`numeric_limits::min_exponent`](min_exponent.md) * [`numeric_limits::max_exponent`](max_exponent.md) * [`numeric_limits::max_exponent10`](max_exponent10.md) - diff --git a/reference/limits/numeric_limits/quiet_nan.md b/reference/limits/numeric_limits/quiet_nan.md index 4e16529a87..8bafd91575 100644 --- a/reference/limits/numeric_limits/quiet_nan.md +++ b/reference/limits/numeric_limits/quiet_nan.md @@ -55,4 +55,3 @@ double : 1.#QNAN ## 参照 * [`numeric_limits::has_quiet_NaN`](has_quiet_nan.md) * [NANの定義について - ぴょぴょぴょ? - Linuxとかプログラミングの覚え書き](http://d.hatena.ne.jp/pyopyopyo/20100330/p1) - diff --git a/reference/limits/numeric_limits/radix.md b/reference/limits/numeric_limits/radix.md index 761187fe91..6a9cd5474e 100644 --- a/reference/limits/numeric_limits/radix.md +++ b/reference/limits/numeric_limits/radix.md @@ -40,5 +40,3 @@ int : 2 char : 2 double : 2 ``` - - diff --git a/reference/limits/numeric_limits/round_error.md b/reference/limits/numeric_limits/round_error.md index f5870d86da..7b4d08f67b 100644 --- a/reference/limits/numeric_limits/round_error.md +++ b/reference/limits/numeric_limits/round_error.md @@ -37,5 +37,3 @@ int main() 0.5 0.5 ``` - - diff --git a/reference/limits/numeric_limits/round_style.md b/reference/limits/numeric_limits/round_style.md index 9540072eb2..20085bafea 100644 --- a/reference/limits/numeric_limits/round_style.md +++ b/reference/limits/numeric_limits/round_style.md @@ -58,5 +58,3 @@ double : to nearest ## 参照 * [`float_round_style`](../float_round_style.md) - - diff --git a/reference/limits/numeric_limits/signaling_nan.md b/reference/limits/numeric_limits/signaling_nan.md index bc5488544e..a5ca6e55b8 100644 --- a/reference/limits/numeric_limits/signaling_nan.md +++ b/reference/limits/numeric_limits/signaling_nan.md @@ -53,4 +53,3 @@ double : 1.#QNAN ## 参照 * [`numeric_limits::has_quiet_NaN`](has_quiet_nan.md) * [NANの定義について - ぴょぴょぴょ? - Linuxとかプログラミングの覚え書き](http://d.hatena.ne.jp/pyopyopyo/20100330/p1) - diff --git a/reference/limits/numeric_limits/tinyness_before.md b/reference/limits/numeric_limits/tinyness_before.md index 7b8358b70a..6ed3f302e6 100644 --- a/reference/limits/numeric_limits/tinyness_before.md +++ b/reference/limits/numeric_limits/tinyness_before.md @@ -38,5 +38,3 @@ int main() float : false double : false ``` - - diff --git a/reference/limits/numeric_limits/traps.md b/reference/limits/numeric_limits/traps.md index 125c636ef8..75f8240569 100644 --- a/reference/limits/numeric_limits/traps.md +++ b/reference/limits/numeric_limits/traps.md @@ -44,5 +44,3 @@ char : true float : false double : false ``` - - diff --git a/reference/linalg/abs-if-needed.md b/reference/linalg/abs-if-needed.md index 9d95d9306a..f753c87cce 100644 --- a/reference/linalg/abs-if-needed.md +++ b/reference/linalg/abs-if-needed.md @@ -32,4 +32,3 @@ ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - diff --git a/reference/linalg/add.md b/reference/linalg/add.md index cd7cf031fa..63e6de2bc3 100644 --- a/reference/linalg/add.md +++ b/reference/linalg/add.md @@ -138,4 +138,3 @@ int main() ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - [`LAPACK: caxpy`](https://netlib.org/lapack/explore-html/d5/d4b/group__axpy_ga0b7bac1f4d42514074a48f14f5f9caa0.html#ga0b7bac1f4d42514074a48f14f5f9caa0) - diff --git a/reference/linalg/addable.md b/reference/linalg/addable.md index f6d296f51d..1daecc06a0 100644 --- a/reference/linalg/addable.md +++ b/reference/linalg/addable.md @@ -49,5 +49,3 @@ constexpr bool addable( ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - - diff --git a/reference/linalg/dotc.md b/reference/linalg/dotc.md index 49c77a8fcc..ac2605e640 100644 --- a/reference/linalg/dotc.md +++ b/reference/linalg/dotc.md @@ -144,4 +144,3 @@ int main() ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - [`LAPACK: cdotc`](https://netlib.org/lapack/explore-html/d1/dcc/group__dot_ga5c189335a4e6130a2206c190579b1571.html#ga5c189335a4e6130a2206c190579b1571) - diff --git a/reference/linalg/explicit_diagonal_t.md b/reference/linalg/explicit_diagonal_t.md index 2a5c343d85..01e63bca05 100644 --- a/reference/linalg/explicit_diagonal_t.md +++ b/reference/linalg/explicit_diagonal_t.md @@ -34,4 +34,3 @@ namespace std::linalg { ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - diff --git a/reference/linalg/hermitian_matrix_rank_1_update.md b/reference/linalg/hermitian_matrix_rank_1_update.md index 323a7c3460..ae3c034973 100644 --- a/reference/linalg/hermitian_matrix_rank_1_update.md +++ b/reference/linalg/hermitian_matrix_rank_1_update.md @@ -253,4 +253,3 @@ int main() ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - [LAPACK: {he,sy}r: Hermitian/symmetric rank-1 update](https://netlib.org/lapack/explore-html/dc/d82/group__her.html) - diff --git a/reference/linalg/hermitian_matrix_rank_2k_update.md b/reference/linalg/hermitian_matrix_rank_2k_update.md index ee23b949aa..b8d8f1adc1 100644 --- a/reference/linalg/hermitian_matrix_rank_2k_update.md +++ b/reference/linalg/hermitian_matrix_rank_2k_update.md @@ -199,4 +199,3 @@ int main() ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - [LAPACK: {he,sy}r2k: Hermitian/symmetric rank-2k update](https://netlib.org/lapack/explore-html/d8/d94/group__her2k.html) - diff --git a/reference/linalg/hermitian_matrix_rank_k_update.md b/reference/linalg/hermitian_matrix_rank_k_update.md index 8e6847f08b..167bb4cfd1 100644 --- a/reference/linalg/hermitian_matrix_rank_k_update.md +++ b/reference/linalg/hermitian_matrix_rank_k_update.md @@ -244,4 +244,3 @@ int main() ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - [LAPACK: {he,sy}rk: Hermitian/symmetric rank-k update](https://netlib.org/lapack/explore-html/d4/d6e/group__herk.html) - diff --git a/reference/linalg/hermitian_matrix_vector_product.md b/reference/linalg/hermitian_matrix_vector_product.md index 845339a7ea..fceac20ba7 100644 --- a/reference/linalg/hermitian_matrix_vector_product.md +++ b/reference/linalg/hermitian_matrix_vector_product.md @@ -242,4 +242,3 @@ z[3] = (11,-9) ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - [LAPACK: csymv](https://netlib.org/lapack/explore-html/db/d17/group__hemv_gab137e328e44dc1530ab0a93ff65c108a.html#gab137e328e44dc1530ab0a93ff65c108a) - diff --git a/reference/linalg/imag-if-needed.md b/reference/linalg/imag-if-needed.md index 8be49a2091..d147a6e190 100644 --- a/reference/linalg/imag-if-needed.md +++ b/reference/linalg/imag-if-needed.md @@ -30,4 +30,3 @@ ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - diff --git a/reference/linalg/implicit_unit_diagonal_t.md b/reference/linalg/implicit_unit_diagonal_t.md index 9ee3920995..8a13b5fb7d 100644 --- a/reference/linalg/implicit_unit_diagonal_t.md +++ b/reference/linalg/implicit_unit_diagonal_t.md @@ -34,4 +34,3 @@ namespace std::linalg { ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - diff --git a/reference/linalg/is-mdspan.md b/reference/linalg/is-mdspan.md index 3ffdf1d967..df437ebd9b 100644 --- a/reference/linalg/is-mdspan.md +++ b/reference/linalg/is-mdspan.md @@ -30,4 +30,3 @@ constexpr bool is-mdspan> = true; ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - diff --git a/reference/linalg/lower_triangle_t.md b/reference/linalg/lower_triangle_t.md index 2cb069b2b6..cb71b2d2b5 100644 --- a/reference/linalg/lower_triangle_t.md +++ b/reference/linalg/lower_triangle_t.md @@ -35,4 +35,3 @@ namespace std::linalg { ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - diff --git a/reference/linalg/matrix_frob_norm.md b/reference/linalg/matrix_frob_norm.md index 037509c9d5..883e697796 100644 --- a/reference/linalg/matrix_frob_norm.md +++ b/reference/linalg/matrix_frob_norm.md @@ -125,4 +125,3 @@ int main() ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - diff --git a/reference/linalg/matrix_inf_norm.md b/reference/linalg/matrix_inf_norm.md index 848b3eb5cc..165321cad9 100644 --- a/reference/linalg/matrix_inf_norm.md +++ b/reference/linalg/matrix_inf_norm.md @@ -128,4 +128,3 @@ int main() ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - diff --git a/reference/linalg/matrix_one_norm.md b/reference/linalg/matrix_one_norm.md index 84ef626726..4cd4157780 100644 --- a/reference/linalg/matrix_one_norm.md +++ b/reference/linalg/matrix_one_norm.md @@ -128,4 +128,3 @@ int main() ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - diff --git a/reference/linalg/matrix_rank_1_update.md b/reference/linalg/matrix_rank_1_update.md index 3061a0dad9..6845f75f34 100644 --- a/reference/linalg/matrix_rank_1_update.md +++ b/reference/linalg/matrix_rank_1_update.md @@ -174,4 +174,3 @@ int main() ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - [LAPACK: ger: general matrix rank-1 update](https://netlib.org/lapack/explore-html/d8/d75/group__ger.html) - diff --git a/reference/linalg/matrix_rank_1_update_c.md b/reference/linalg/matrix_rank_1_update_c.md index 7c58e8e701..21cfe3ae9e 100644 --- a/reference/linalg/matrix_rank_1_update_c.md +++ b/reference/linalg/matrix_rank_1_update_c.md @@ -181,4 +181,3 @@ int main() ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - [LAPACK: ger: general matrix rank-1 update](https://netlib.org/lapack/explore-html/d8/d75/group__ger.html) - diff --git a/reference/linalg/matrix_vector_product.md b/reference/linalg/matrix_vector_product.md index 25ffcd14cb..23a9c52ed9 100644 --- a/reference/linalg/matrix_vector_product.md +++ b/reference/linalg/matrix_vector_product.md @@ -203,4 +203,3 @@ z[3] = 602 ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - [LAPACK: cgemv](https://netlib.org/lapack/explore-html/d7/dda/group__gemv_ga44c85a0d7ecd60a6bc8ca27b222d7792.html#ga44c85a0d7ecd60a6bc8ca27b222d7792) - diff --git a/reference/linalg/multipliable.md b/reference/linalg/multipliable.md index 6aaf51d6f3..c334e2ad04 100644 --- a/reference/linalg/multipliable.md +++ b/reference/linalg/multipliable.md @@ -62,5 +62,3 @@ namespace std::linalg { ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - - diff --git a/reference/linalg/possibly-addable.md b/reference/linalg/possibly-addable.md index b27529d6f1..eef28e3ad6 100644 --- a/reference/linalg/possibly-addable.md +++ b/reference/linalg/possibly-addable.md @@ -51,4 +51,3 @@ namespace std::linalg { ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - diff --git a/reference/linalg/possibly-multipliable.md b/reference/linalg/possibly-multipliable.md index 6ea1a1bc9b..824b1a69a3 100644 --- a/reference/linalg/possibly-multipliable.md +++ b/reference/linalg/possibly-multipliable.md @@ -57,5 +57,3 @@ namespace std::linalg { ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - - diff --git a/reference/linalg/real-if-needed.md b/reference/linalg/real-if-needed.md index 864716fc8f..dd396d8b52 100644 --- a/reference/linalg/real-if-needed.md +++ b/reference/linalg/real-if-needed.md @@ -30,4 +30,3 @@ ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - diff --git a/reference/linalg/scale.md b/reference/linalg/scale.md index f1002df593..6622bafd6c 100644 --- a/reference/linalg/scale.md +++ b/reference/linalg/scale.md @@ -115,4 +115,3 @@ int main() ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - [`LAPACK: cscal`](https://netlib.org/lapack/explore-html/d2/de8/group__scal_gacce468103c83fa18bae078d5f49fefe2.html#gacce468103c83fa18bae078d5f49fefe2) - diff --git a/reference/linalg/swap_elements.md b/reference/linalg/swap_elements.md index 9748fcbd3e..f6a64ae78a 100644 --- a/reference/linalg/swap_elements.md +++ b/reference/linalg/swap_elements.md @@ -141,4 +141,3 @@ b ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - [`LAPACK: cswap`](https://netlib.org/lapack/explore-html/d7/d51/group__swap_ga1e8d1bbcbd0307e7a3839d0bd10e4118.html#ga1e8d1bbcbd0307e7a3839d0bd10e4118) - diff --git a/reference/linalg/symmetric_matrix_rank_1_update.md b/reference/linalg/symmetric_matrix_rank_1_update.md index d1a2f2a071..35fa0338c8 100644 --- a/reference/linalg/symmetric_matrix_rank_1_update.md +++ b/reference/linalg/symmetric_matrix_rank_1_update.md @@ -247,4 +247,3 @@ int main() ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - [LAPACK: {he,sy}r: Hermitian/symmetric rank-1 update](https://netlib.org/lapack/explore-html/dc/d82/group__her.html) - diff --git a/reference/linalg/symmetric_matrix_rank_2_update.md b/reference/linalg/symmetric_matrix_rank_2_update.md index 3151b428c5..abd5fbd300 100644 --- a/reference/linalg/symmetric_matrix_rank_2_update.md +++ b/reference/linalg/symmetric_matrix_rank_2_update.md @@ -193,4 +193,3 @@ int main() ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - [LAPACK: {he,sy}r: Hermitian/symmetric rank-2 update](https://netlib.org/lapack/explore-html/dd/de5/group__her2.html) - diff --git a/reference/linalg/symmetric_matrix_rank_2k_update.md b/reference/linalg/symmetric_matrix_rank_2k_update.md index 054f19c504..629ed23591 100644 --- a/reference/linalg/symmetric_matrix_rank_2k_update.md +++ b/reference/linalg/symmetric_matrix_rank_2k_update.md @@ -193,4 +193,3 @@ int main() ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - [LAPACK: {he,sy}r2k: Hermitian/symmetric rank-2k update](https://netlib.org/lapack/explore-html/d8/d94/group__her2k.html) - diff --git a/reference/linalg/symmetric_matrix_rank_k_update.md b/reference/linalg/symmetric_matrix_rank_k_update.md index 1d393bbad7..11c77dc599 100644 --- a/reference/linalg/symmetric_matrix_rank_k_update.md +++ b/reference/linalg/symmetric_matrix_rank_k_update.md @@ -238,4 +238,3 @@ int main() ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - [LAPACK: {he,sy}rk: Hermitian/symmetric rank-k update](https://netlib.org/lapack/explore-html/d4/d6e/group__herk.html) - diff --git a/reference/linalg/symmetric_matrix_vector_product.md b/reference/linalg/symmetric_matrix_vector_product.md index 3e7e76218f..8391e52677 100644 --- a/reference/linalg/symmetric_matrix_vector_product.md +++ b/reference/linalg/symmetric_matrix_vector_product.md @@ -233,4 +233,3 @@ z[3] = 71 ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - [LAPACK: csymv](https://netlib.org/lapack/explore-html/db/d17/group__hemv_gab137e328e44dc1530ab0a93ff65c108a.html#gab137e328e44dc1530ab0a93ff65c108a) - diff --git a/reference/linalg/triangular_matrix_matrix_left_solve.md b/reference/linalg/triangular_matrix_matrix_left_solve.md index 0c1e2836fc..a2102eb520 100644 --- a/reference/linalg/triangular_matrix_matrix_left_solve.md +++ b/reference/linalg/triangular_matrix_matrix_left_solve.md @@ -384,4 +384,3 @@ int main() ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - [LAPACK: trsm](https://netlib.org/lapack/explore-html/d9/de5/group__trsm.html) - diff --git a/reference/linalg/triangular_matrix_matrix_right_solve.md b/reference/linalg/triangular_matrix_matrix_right_solve.md index 4a1f7e188f..27a1aacecd 100644 --- a/reference/linalg/triangular_matrix_matrix_right_solve.md +++ b/reference/linalg/triangular_matrix_matrix_right_solve.md @@ -384,4 +384,3 @@ int main() ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - [LAPACK: trsm](https://netlib.org/lapack/explore-html/d9/de5/group__trsm.html) - diff --git a/reference/linalg/triangular_matrix_vector_product.md b/reference/linalg/triangular_matrix_vector_product.md index 090c7890bf..fc0cda1806 100644 --- a/reference/linalg/triangular_matrix_vector_product.md +++ b/reference/linalg/triangular_matrix_vector_product.md @@ -334,5 +334,3 @@ z[3] = 6 ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - [LAPACK: ctrmv](https://netlib.org/lapack/explore-html/d6/d1c/group__trmv_ga0adaf80ae1dfe117390bd7030fd865f1.html#ga0adaf80ae1dfe117390bd7030fd865f1) - - diff --git a/reference/linalg/upper_triangle_t.md b/reference/linalg/upper_triangle_t.md index f249816420..0fc11e2276 100644 --- a/reference/linalg/upper_triangle_t.md +++ b/reference/linalg/upper_triangle_t.md @@ -35,4 +35,3 @@ namespace std::linalg { ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - diff --git a/reference/linalg/vector_abs_sum.md b/reference/linalg/vector_abs_sum.md index eb7995f205..62aa4b72df 100644 --- a/reference/linalg/vector_abs_sum.md +++ b/reference/linalg/vector_abs_sum.md @@ -131,4 +131,3 @@ int main() ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - [LAPACK: dzasum](https://netlib.org/lapack/explore-html/d5/d72/group__asum_gaf23444d1c822b34db864558d7afc76dd.html#gaf23444d1c822b34db864558d7afc76dd) - diff --git a/reference/linalg/vector_idx_abs_max.md b/reference/linalg/vector_idx_abs_max.md index 5172a42fee..d2de7359cf 100644 --- a/reference/linalg/vector_idx_abs_max.md +++ b/reference/linalg/vector_idx_abs_max.md @@ -104,5 +104,3 @@ int main() ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - [LAPACK: icamax](https://netlib.org/lapack/explore-html/dd/d52/group__iamax_gafdf273dcc3f020e2aa5c716c1b3d7265.html#gafdf273dcc3f020e2aa5c716c1b3d7265) - - diff --git a/reference/linalg/vector_two_norm.md b/reference/linalg/vector_two_norm.md index 09a86d8ac5..d41c63f1d6 100644 --- a/reference/linalg/vector_two_norm.md +++ b/reference/linalg/vector_two_norm.md @@ -124,4 +124,3 @@ int main() ## 参照 - [P1673R13 A free function linear algebra interface based on the BLAS](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1673r13.html) - [LAPACK: dnrm2](https://netlib.org/lapack/explore-html/d1/d2a/group__nrm2_gab5393665c8f0e7d5de9bd1dd2ff0d9d0.html#gab5393665c8f0e7d5de9bd1dd2ff0d9d0) - diff --git a/reference/list/list.md b/reference/list/list.md index 947414504e..0eb326ec3d 100644 --- a/reference/list/list.md +++ b/reference/list/list.md @@ -306,5 +306,3 @@ root ## 参照 - [N2669 Thread-Safety in the Standard Library (Rev 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2669.htm) - [N4510 Minimal incomplete type support for standard containers, revision 4](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4510.html) - - diff --git a/reference/list/list/assign.md b/reference/list/list/assign.md index b860753218..0d29a514b5 100644 --- a/reference/list/list/assign.md +++ b/reference/list/list/assign.md @@ -119,4 +119,3 @@ ls3 : 1 2 3 ## 参照 - [N2679 Initializer Lists for Standard Containers(Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2679.pdf) - (3)の経緯となる提案文書 - diff --git a/reference/list/list/back.md b/reference/list/list/back.md index ffea6ed484..45c392b0bb 100644 --- a/reference/list/list/back.md +++ b/reference/list/list/back.md @@ -42,4 +42,3 @@ int main() ``` 4 ``` - diff --git a/reference/list/list/begin.md b/reference/list/list/begin.md index 3f1b78cc02..1ed00be3fe 100644 --- a/reference/list/list/begin.md +++ b/reference/list/list/begin.md @@ -49,5 +49,3 @@ int main() ``` ## 参照 - - diff --git a/reference/list/list/cbegin.md b/reference/list/list/cbegin.md index 843a33ac0e..823a35e6fa 100644 --- a/reference/list/list/cbegin.md +++ b/reference/list/list/cbegin.md @@ -59,5 +59,3 @@ int main() ## 参照 - - diff --git a/reference/list/list/cend.md b/reference/list/list/cend.md index a71f3067e3..1899bd3a73 100644 --- a/reference/list/list/cend.md +++ b/reference/list/list/cend.md @@ -63,5 +63,3 @@ int main() ## 参照 - - diff --git a/reference/list/list/clear.md b/reference/list/list/clear.md index db936aaf44..fadce81906 100644 --- a/reference/list/list/clear.md +++ b/reference/list/list/clear.md @@ -70,4 +70,3 @@ int main() ## 参照 - [LWG Issue 2231. DR 704 removes complexity guarantee for `clear()`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2231) - C++03までこの関数の効果は`erase(begin(), end())`だったため、それによって線形時間の計算量が保証されていたが、C++11で効果の表記が変わったために、保証がなくなってしまっていた。C++14であらためて保証を追加。 - diff --git a/reference/list/list/crbegin.md b/reference/list/list/crbegin.md index 60487764f5..3f3e0a9564 100644 --- a/reference/list/list/crbegin.md +++ b/reference/list/list/crbegin.md @@ -59,5 +59,3 @@ int main() ## 参照 - - diff --git a/reference/list/list/crend.md b/reference/list/list/crend.md index d8fbbf25f0..9457da5aa4 100644 --- a/reference/list/list/crend.md +++ b/reference/list/list/crend.md @@ -59,5 +59,3 @@ int main() ## 参照 - - diff --git a/reference/list/list/emplace.md b/reference/list/list/emplace.md index b681e0138a..9d7badbfc2 100644 --- a/reference/list/list/emplace.md +++ b/reference/list/list/emplace.md @@ -76,5 +76,3 @@ int main() ## 参照 - [N2345 Placement Insert for Containers (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2345.pdf) - - diff --git a/reference/list/list/end.md b/reference/list/list/end.md index f03e23edf4..6584b208d1 100644 --- a/reference/list/list/end.md +++ b/reference/list/list/end.md @@ -66,5 +66,3 @@ int main() ``` ## 参照 - - diff --git a/reference/list/list/front.md b/reference/list/list/front.md index 18153d4dbd..0fd9826dea 100644 --- a/reference/list/list/front.md +++ b/reference/list/list/front.md @@ -41,5 +41,3 @@ int main() ``` 3 ``` - - diff --git a/reference/list/list/insert.md b/reference/list/list/insert.md index 804f8fa549..8c368f7d1a 100644 --- a/reference/list/list/insert.md +++ b/reference/list/list/insert.md @@ -135,4 +135,3 @@ insert initializer_list : 1 2 3 4 5 6 - [N2350 Container insert/erase and iterator constness (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2350.pdf) - [N2679 Initializer Lists for Standard Containers(Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2679.pdf) - (5)の経緯となる提案文書 - diff --git a/reference/list/list/max_size.md b/reference/list/list/max_size.md index cb8f1de275..5672a5333e 100644 --- a/reference/list/list/max_size.md +++ b/reference/list/list/max_size.md @@ -45,4 +45,3 @@ int main() ``` 768614336404564650 ``` - diff --git a/reference/list/list/merge.md b/reference/list/list/merge.md index 6f60bb6480..3073b835bb 100644 --- a/reference/list/list/merge.md +++ b/reference/list/list/merge.md @@ -70,5 +70,3 @@ int main() 5 6 ``` - - diff --git a/reference/list/list/op_deduction_guide.md b/reference/list/list/op_deduction_guide.md index 4a547b53c6..355e6e672e 100644 --- a/reference/list/list/op_deduction_guide.md +++ b/reference/list/list/op_deduction_guide.md @@ -84,4 +84,3 @@ int main() ## 参照 - [P0433R2 Toward a resolution of US7 and US14: Integrating template deduction for class templates into the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0433r2.html) - diff --git a/reference/list/list/op_destructor.md b/reference/list/list/op_destructor.md index 1eae68743b..432863960f 100644 --- a/reference/list/list/op_destructor.md +++ b/reference/list/list/op_destructor.md @@ -21,5 +21,3 @@ ## 参照 - - diff --git a/reference/list/list/pop_back.md b/reference/list/list/pop_back.md index 2926f62a1b..e94b8172b8 100644 --- a/reference/list/list/pop_back.md +++ b/reference/list/list/pop_back.md @@ -47,5 +47,3 @@ int main() 1 2 ``` - - diff --git a/reference/list/list/pop_front.md b/reference/list/list/pop_front.md index e86879c186..3c3e1649b4 100644 --- a/reference/list/list/pop_front.md +++ b/reference/list/list/pop_front.md @@ -47,5 +47,3 @@ int main() 2 3 ``` - - diff --git a/reference/list/list/push_back.md b/reference/list/list/push_back.md index aa241c8591..5578aa071d 100644 --- a/reference/list/list/push_back.md +++ b/reference/list/list/push_back.md @@ -100,4 +100,3 @@ int main() 1 0 ``` - diff --git a/reference/list/list/push_front.md b/reference/list/list/push_front.md index f284caa190..19fdf683af 100644 --- a/reference/list/list/push_front.md +++ b/reference/list/list/push_front.md @@ -51,5 +51,3 @@ int main() hello world ``` - - diff --git a/reference/list/list/rbegin.md b/reference/list/list/rbegin.md index 164543f38e..ff23d05ce7 100644 --- a/reference/list/list/rbegin.md +++ b/reference/list/list/rbegin.md @@ -49,5 +49,3 @@ int main() ``` ## 参照 - - diff --git a/reference/list/list/rend.md b/reference/list/list/rend.md index 0a5ebd8b28..ffe6034f6f 100644 --- a/reference/list/list/rend.md +++ b/reference/list/list/rend.md @@ -62,5 +62,3 @@ int main() ``` ## 参照 - - diff --git a/reference/list/list/resize.md b/reference/list/list/resize.md index 7439c7fbe1..8538e152da 100644 --- a/reference/list/list/resize.md +++ b/reference/list/list/resize.md @@ -67,5 +67,3 @@ int main() 3 ``` - - diff --git a/reference/list/list/reverse.md b/reference/list/list/reverse.md index a862f7480e..8c00565488 100644 --- a/reference/list/list/reverse.md +++ b/reference/list/list/reverse.md @@ -53,5 +53,3 @@ int main() 2 1 ``` - - diff --git a/reference/list/list/size.md b/reference/list/list/size.md index e77b56c23f..e06b7f5df8 100644 --- a/reference/list/list/size.md +++ b/reference/list/list/size.md @@ -52,4 +52,3 @@ int main() ## 参照 - [N2909 Specifying the complexity of `size()`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2909.pdf) - [C++0x 標準コンテナのsize()の計算量を規定 - Faith and Brave - C++で遊ぼう](http://d.hatena.ne.jp/faith_and_brave/20090902/1251879571) - diff --git a/reference/list/list/sort.md b/reference/list/list/sort.md index a4ca09dbc8..5ed9f562fc 100644 --- a/reference/list/list/sort.md +++ b/reference/list/list/sort.md @@ -58,5 +58,3 @@ int main() 2 3 ``` - - diff --git a/reference/locale.md b/reference/locale.md index fba3c964ce..60b2d79658 100644 --- a/reference/locale.md +++ b/reference/locale.md @@ -87,6 +87,3 @@ | [`messages_base`](locale/messages_base.md) | メッセージ取得のための基底クラス(class) | | | [`messages`](locale/messages.md) | メッセージカタログから対応する翻訳メッセージの取得(class template) | | | [`messages_byname`](locale/messages_byname.md) | 名前による翻訳メッセージの取得(class template) | | - - - diff --git a/reference/locale/locale/op_equal.md b/reference/locale/locale/op_equal.md index c1ce55b1ac..3ab7bd4c5b 100644 --- a/reference/locale/locale/op_equal.md +++ b/reference/locale/locale/op_equal.md @@ -35,4 +35,3 @@ int main() ### 出力 ``` ``` - diff --git a/reference/locale/numpunct.md b/reference/locale/numpunct.md index 591352157e..49bb3667bf 100644 --- a/reference/locale/numpunct.md +++ b/reference/locale/numpunct.md @@ -104,4 +104,3 @@ German_Germany.1252 ``` ### 参照 - diff --git a/reference/locale/tolower.md b/reference/locale/tolower.md index 2bed21102c..0a50771c41 100644 --- a/reference/locale/tolower.md +++ b/reference/locale/tolower.md @@ -64,5 +64,3 @@ template charT toupper(charT c, const locale& loc) ``` ## 参照 - - diff --git a/reference/locale/toupper.md b/reference/locale/toupper.md index 2a1e4b0323..cee4604eec 100644 --- a/reference/locale/toupper.md +++ b/reference/locale/toupper.md @@ -63,5 +63,3 @@ template charT toupper(charT c, const locale& loc) ``` ## 参照 - - diff --git a/reference/map/map/begin.md b/reference/map/map/begin.md index 42ce65231a..773138d51f 100644 --- a/reference/map/map/begin.md +++ b/reference/map/map/begin.md @@ -88,5 +88,3 @@ int main() | [`map::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`map::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`map::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | - - diff --git a/reference/map/map/cbegin.md b/reference/map/map/cbegin.md index fef90ecddf..95907a1948 100644 --- a/reference/map/map/cbegin.md +++ b/reference/map/map/cbegin.md @@ -81,8 +81,3 @@ int main() | [`map::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`map::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`map::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | - - - - - diff --git a/reference/map/map/cend.md b/reference/map/map/cend.md index ed267a6c03..4b97a897c6 100644 --- a/reference/map/map/cend.md +++ b/reference/map/map/cend.md @@ -86,6 +86,3 @@ int main() | [`map::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`map::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`map::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | - - - diff --git a/reference/map/map/clear.md b/reference/map/map/clear.md index 089a965e11..4eb7dfbd77 100644 --- a/reference/map/map/clear.md +++ b/reference/map/map/clear.md @@ -68,6 +68,3 @@ int main() | [`map::erase`](erase.md) | 要素を削除する | | [`map::size`](size.md) | 要素数を取得する | | [`map::empty`](empty.md) | コンテナが空であるかどうかを調べる | - - - diff --git a/reference/map/map/count.md b/reference/map/map/count.md index 5f58cc5152..e069aa8e38 100644 --- a/reference/map/map/count.md +++ b/reference/map/map/count.md @@ -95,4 +95,3 @@ found ## 参照 - [N3657 Adding heterogeneous comparison lookup to associative containers (rev 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3657.htm) - diff --git a/reference/map/map/emplace.md b/reference/map/map/emplace.md index 4e8df268c8..171c38a253 100644 --- a/reference/map/map/emplace.md +++ b/reference/map/map/emplace.md @@ -161,4 +161,3 @@ CCC : (1, 2) ## 参照 - [N2680 Proposed Wording for Placement Insert (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2680.pdf) - diff --git a/reference/map/map/equal_range.md b/reference/map/map/equal_range.md index 17126d8e8d..ff26455b4b 100644 --- a/reference/map/map/equal_range.md +++ b/reference/map/map/equal_range.md @@ -84,4 +84,3 @@ B,1 ## 参照 - [N3657 Adding heterogeneous comparison lookup to associative containers (rev 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3657.htm) - diff --git a/reference/map/map/erase.md b/reference/map/map/erase.md index 88fd744986..fbe83e1b9d 100644 --- a/reference/map/map/erase.md +++ b/reference/map/map/erase.md @@ -189,4 +189,3 @@ int main() - C++17で、`erase(iterator)`を再追加 - [P2077R3 Heterogeneous erasure overloads for associative containers](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2077r3.html) - C++23で、`template erase(K&& x)`のオーバーロードが追加された - diff --git a/reference/map/map/find.md b/reference/map/map/find.md index fe6b545b2d..88261bb6e7 100644 --- a/reference/map/map/find.md +++ b/reference/map/map/find.md @@ -103,4 +103,3 @@ int main() ## 参照 - [N3657 Adding heterogeneous comparison lookup to associative containers (rev 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3657.htm) - [LWG Issue 2299. [CD] Effects of inaccessible `key_compare::is_transparent` type are not clear](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2299) - diff --git a/reference/map/map/insert.md b/reference/map/map/insert.md index 87145c9c44..4e5ef9dd3a 100644 --- a/reference/map/map/insert.md +++ b/reference/map/map/insert.md @@ -176,4 +176,3 @@ int main () - C++14から、(2)と(4)の仕様の書き方が、`unordered_map::insert()`のものと統一された。 - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) - (7), (8)経緯となる提案文書 - diff --git a/reference/map/map/lower_bound.md b/reference/map/map/lower_bound.md index 52298b0a41..86343e2323 100644 --- a/reference/map/map/lower_bound.md +++ b/reference/map/map/lower_bound.md @@ -119,4 +119,3 @@ D,5 ## 参照 - [N3657 Adding heterogeneous comparison lookup to associative containers (rev 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3657.htm) - diff --git a/reference/map/map/max_size.md b/reference/map/map/max_size.md index 74aea5418b..bd3d904a9e 100644 --- a/reference/map/map/max_size.md +++ b/reference/map/map/max_size.md @@ -55,5 +55,3 @@ int main () | 名前 | 説明 | |-----------------------------------------------------------------------------------|--------------------------| | [`size`](size.md) | 要素数を取得する | - - diff --git a/reference/map/map/op_destructor.md b/reference/map/map/op_destructor.md index 2c7e10cda0..386bdd6ad4 100644 --- a/reference/map/map/op_destructor.md +++ b/reference/map/map/op_destructor.md @@ -14,5 +14,3 @@ ## 計算量 [`size()`](size.md) に対して線形時間(デストラクタ呼び出し) - - diff --git a/reference/map/map/rbegin.md b/reference/map/map/rbegin.md index 528d7f85b5..0f7c4387f8 100644 --- a/reference/map/map/rbegin.md +++ b/reference/map/map/rbegin.md @@ -77,4 +77,3 @@ int main() | [`map::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`map::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`map::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | - diff --git a/reference/map/map/rend.md b/reference/map/map/rend.md index 48417195f4..f18e492169 100644 --- a/reference/map/map/rend.md +++ b/reference/map/map/rend.md @@ -71,4 +71,3 @@ int main() | [`map::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | | [`map::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`map::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | - diff --git a/reference/map/map/size.md b/reference/map/map/size.md index 9031553d9b..4effa4cbb8 100644 --- a/reference/map/map/size.md +++ b/reference/map/map/size.md @@ -69,5 +69,3 @@ int main () |-------------------------------------------------------------------------------------------|-----------------------------------------------------| | [`max_size`](max_size.md) | 格納可能な最大の要素数を取得する | | [`empty`](empty.md) | コンテナが空であるかどうかを調べる | - - diff --git a/reference/map/map/upper_bound.md b/reference/map/map/upper_bound.md index 6fa5b335d7..3dc23a0344 100644 --- a/reference/map/map/upper_bound.md +++ b/reference/map/map/upper_bound.md @@ -119,4 +119,3 @@ D,5 ## 参照 - [N3657 Adding heterogeneous comparison lookup to associative containers (rev 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3657.htm) - diff --git a/reference/map/multimap/begin.md b/reference/map/multimap/begin.md index 46e8832dbf..1708b1c07b 100644 --- a/reference/map/multimap/begin.md +++ b/reference/map/multimap/begin.md @@ -91,5 +91,3 @@ int main() | [`multimap::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`multimap::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`multimap::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | - - diff --git a/reference/map/multimap/cbegin.md b/reference/map/multimap/cbegin.md index 895761a30e..e994d7e924 100644 --- a/reference/map/multimap/cbegin.md +++ b/reference/map/multimap/cbegin.md @@ -83,4 +83,3 @@ int main() | [`multimap::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`multimap::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`multimap::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | - diff --git a/reference/map/multimap/cend.md b/reference/map/multimap/cend.md index 5d5447bf75..363c48347f 100644 --- a/reference/map/multimap/cend.md +++ b/reference/map/multimap/cend.md @@ -89,6 +89,3 @@ int main() | [`multimap::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`multimap::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`multimap::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | - - - diff --git a/reference/map/multimap/clear.md b/reference/map/multimap/clear.md index 3abc71a00f..ec97f3c360 100644 --- a/reference/map/multimap/clear.md +++ b/reference/map/multimap/clear.md @@ -69,6 +69,3 @@ int main() | [`multimap::erase`](erase.md) | 要素を削除する | | [`multimap::size`](size.md) | 要素数を取得する | | [`multimap::empty`](empty.md) | コンテナが空であるかどうかを調べる | - - - diff --git a/reference/map/multimap/count.md b/reference/map/multimap/count.md index 89861b3fe9..1cae65de68 100644 --- a/reference/map/multimap/count.md +++ b/reference/map/multimap/count.md @@ -89,4 +89,3 @@ int main() ## 参照 - [N3657 Adding heterogeneous comparison lookup to associative containers (rev 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3657.htm) - diff --git a/reference/map/multimap/crend.md b/reference/map/multimap/crend.md index d91b0ded1f..a4fcc0c0e7 100644 --- a/reference/map/multimap/crend.md +++ b/reference/map/multimap/crend.md @@ -73,4 +73,3 @@ int main() | [`multimap::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | | [`multimap::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`multimap::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | - diff --git a/reference/map/multimap/emplace.md b/reference/map/multimap/emplace.md index d1dc23e09e..60108f7e77 100644 --- a/reference/map/multimap/emplace.md +++ b/reference/map/multimap/emplace.md @@ -120,4 +120,3 @@ CCC : (1, 2) ## 参照 - [N2680 Proposed Wording for Placement Insert (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2680.pdf) - diff --git a/reference/map/multimap/emplace_hint.md b/reference/map/multimap/emplace_hint.md index 159c6949c8..26f17f10a4 100644 --- a/reference/map/multimap/emplace_hint.md +++ b/reference/map/multimap/emplace_hint.md @@ -87,4 +87,3 @@ int main() ## 参照 - [N2680 Proposed Wording for Placement Insert (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2680.pdf) - diff --git a/reference/map/multimap/equal_range.md b/reference/map/multimap/equal_range.md index c05aa01bb7..9af81c1900 100644 --- a/reference/map/multimap/equal_range.md +++ b/reference/map/multimap/equal_range.md @@ -89,4 +89,3 @@ B,2 ## 参照 - [N3657 Adding heterogeneous comparison lookup to associative containers (rev 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3657.htm) - diff --git a/reference/map/multimap/find.md b/reference/map/multimap/find.md index a5f3ee6c10..c531420864 100644 --- a/reference/map/multimap/find.md +++ b/reference/map/multimap/find.md @@ -105,4 +105,3 @@ int main() ## 参照 - [N3657 Adding heterogeneous comparison lookup to associative containers (rev 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3657.htm) - [LWG Issue 2299. [CD] Effects of inaccessible `key_compare::is_transparent` type are not clear](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2299) - diff --git a/reference/map/multimap/key_comp.md b/reference/map/multimap/key_comp.md index 969fc29942..eda97667ab 100644 --- a/reference/map/multimap/key_comp.md +++ b/reference/map/multimap/key_comp.md @@ -60,5 +60,3 @@ int main() | [`count`](count.md) | 指定したキーにマッチする要素の数を返す | | [`lower_bound`](lower_bound.md) | 与えられた値より小さく無い最初の要素へのイテレータを返す | | [`upper_bound`](upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | - - diff --git a/reference/map/multimap/lower_bound.md b/reference/map/multimap/lower_bound.md index b6d64904ac..0c1c7352fe 100644 --- a/reference/map/multimap/lower_bound.md +++ b/reference/map/multimap/lower_bound.md @@ -121,4 +121,3 @@ D,5 ## 参照 - [N3657 Adding heterogeneous comparison lookup to associative containers (rev 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3657.htm) - diff --git a/reference/map/multimap/max_size.md b/reference/map/multimap/max_size.md index 3a597c7495..29e1851169 100644 --- a/reference/map/multimap/max_size.md +++ b/reference/map/multimap/max_size.md @@ -55,5 +55,3 @@ int main () | 名前 | 説明 | |-----------------------------------------------------------------------------------|--------------------------| | [`size`](size.md) | 要素数を取得する | - - diff --git a/reference/map/multimap/op_destructor.md b/reference/map/multimap/op_destructor.md index 5857db5acf..5d5d1e911e 100644 --- a/reference/map/multimap/op_destructor.md +++ b/reference/map/multimap/op_destructor.md @@ -14,5 +14,3 @@ ## 計算量 [`size()`](size.md) に対して線形時間(デストラクタ呼び出し) - - diff --git a/reference/map/multimap/rbegin.md b/reference/map/multimap/rbegin.md index 6f6e815914..8cbc8a1662 100644 --- a/reference/map/multimap/rbegin.md +++ b/reference/map/multimap/rbegin.md @@ -78,4 +78,3 @@ int main() | [`multimap::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`multimap::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`multimap::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | - diff --git a/reference/map/multimap/rend.md b/reference/map/multimap/rend.md index 9d2bbe3fe1..a0aa668b66 100644 --- a/reference/map/multimap/rend.md +++ b/reference/map/multimap/rend.md @@ -72,4 +72,3 @@ int main() | [`multimap::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | | [`multimap::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`multimap::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | - diff --git a/reference/map/multimap/size.md b/reference/map/multimap/size.md index 5b97140055..3688eaf9cd 100644 --- a/reference/map/multimap/size.md +++ b/reference/map/multimap/size.md @@ -69,5 +69,3 @@ int main () |-------------------------------------------------------------------------------------------|-----------------------------------------------------| | [`max_size`](max_size.md) | 格納可能な最大の要素数を取得する | | [`empty`](empty.md) | コンテナが空であるかどうかを調べる | - - diff --git a/reference/map/multimap/upper_bound.md b/reference/map/multimap/upper_bound.md index c1457d2ccb..de9faf7498 100644 --- a/reference/map/multimap/upper_bound.md +++ b/reference/map/multimap/upper_bound.md @@ -121,4 +121,3 @@ D,5 ## 参照 - [N3657 Adding heterogeneous comparison lookup to associative containers (rev 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3657.htm) - diff --git a/reference/map/multimap/value_comp.md b/reference/map/multimap/value_comp.md index 4bc00450a4..2e774950eb 100644 --- a/reference/map/multimap/value_comp.md +++ b/reference/map/multimap/value_comp.md @@ -66,5 +66,3 @@ int main() | [`count`](count.md) | 指定したキーにマッチする要素の数を返す | | [`lower_bound`](lower_bound.md) | 与えられた値より小さくない最初の要素へのイテレータを返す | | [`upper_bound`](upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | - - diff --git a/reference/memory/align.md b/reference/memory/align.md index 910ef95479..b4e36b5e7c 100644 --- a/reference/memory/align.md +++ b/reference/memory/align.md @@ -66,4 +66,3 @@ int main() ## 参照 - diff --git a/reference/memory/allocator_arg_t.md b/reference/memory/allocator_arg_t.md index 468cee7014..2480d2d3e8 100644 --- a/reference/memory/allocator_arg_t.md +++ b/reference/memory/allocator_arg_t.md @@ -35,4 +35,3 @@ namespace std { - [`std::tuple`](/reference/tuple/tuple.md)クラス - [`std::promise`](/reference/future/promise.md)クラス - [`std::function`](/reference/functional/function.md)クラス - diff --git a/reference/memory/bad_weak_ptr.md b/reference/memory/bad_weak_ptr.md index f9d96d0584..46974d88ef 100644 --- a/reference/memory/bad_weak_ptr.md +++ b/reference/memory/bad_weak_ptr.md @@ -64,4 +64,3 @@ bad_weak_ptr - 2010までは`what()`が`"tr1::bad_weak_ptr"`を返す。 ## 参照 - diff --git a/reference/memory/enable_shared_from_this.md b/reference/memory/enable_shared_from_this.md index 2b372426cd..921ad0d399 100644 --- a/reference/memory/enable_shared_from_this.md +++ b/reference/memory/enable_shared_from_this.md @@ -101,4 +101,3 @@ int main() ## 参照 - [`enable_shared_from_this`クラステンプレート - yohhoyの日記](http://d.hatena.ne.jp/yohhoy/20120314/p1) - diff --git a/reference/memory/pointer_traits.md b/reference/memory/pointer_traits.md index 40a9892907..cb86d83b02 100644 --- a/reference/memory/pointer_traits.md +++ b/reference/memory/pointer_traits.md @@ -81,4 +81,3 @@ int main() ## 参照 - [N2982 Allocators post Removal of C++ Concepts (Rev 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2982.pdf) - [Why `pointer_traits` was introduced in C++11 - Doug Judd's Blog](https://web.archive.org/web/20190228022724/http://blog.nuggetwheat.org/index.php/2015/09/01/why-pointer_traits-was-introduced-in-c11/) - diff --git a/reference/memory/shared_ptr/get_deleter.md b/reference/memory/shared_ptr/get_deleter.md index c5a97e73d2..0bc4dbec70 100644 --- a/reference/memory/shared_ptr/get_deleter.md +++ b/reference/memory/shared_ptr/get_deleter.md @@ -64,4 +64,3 @@ int main() - [GCC](/implementation.md#gcc): 4.3.6 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2008 (TR1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] - diff --git a/reference/memory/shared_ptr/op_deduction_guide.md b/reference/memory/shared_ptr/op_deduction_guide.md index 77883c4b9f..e298c345a9 100644 --- a/reference/memory/shared_ptr/op_deduction_guide.md +++ b/reference/memory/shared_ptr/op_deduction_guide.md @@ -85,4 +85,3 @@ int main() ## 参照 - [P0433R2 Toward a resolution of US7 and US14: Integrating template deduction for class templates into the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0433r2.html) - diff --git a/reference/memory/shared_ptr/op_destructor.md b/reference/memory/shared_ptr/op_destructor.md index 3d2fdd94e4..5a50aae7fa 100644 --- a/reference/memory/shared_ptr/op_destructor.md +++ b/reference/memory/shared_ptr/op_destructor.md @@ -67,4 +67,3 @@ X dtor 1 Y dtor ``` - diff --git a/reference/memory/shared_ptr/op_ostream.md b/reference/memory/shared_ptr/op_ostream.md index a977b1f8bb..9d528ed2b6 100644 --- a/reference/memory/shared_ptr/op_ostream.md +++ b/reference/memory/shared_ptr/op_ostream.md @@ -59,4 +59,3 @@ int main() - [GCC](/implementation.md#gcc): 4.3.6 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2008 (TR1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] - diff --git a/reference/memory/unique_ptr.md b/reference/memory/unique_ptr.md index 1753359dd3..1a71f0bc67 100644 --- a/reference/memory/unique_ptr.md +++ b/reference/memory/unique_ptr.md @@ -148,4 +148,3 @@ hoge::~hoge() - `unique_ptr`を許可するために、インタフェースを改良した経緯 - [LWG Issue 762. `std::unique_ptr` requires complete type?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#762) - [N4089 Safe conversions in `unique_ptr`, revision 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4089.pdf) - diff --git a/reference/memory/weak_ptr.md b/reference/memory/weak_ptr.md index 40a554bce5..1af88326ac 100644 --- a/reference/memory/weak_ptr.md +++ b/reference/memory/weak_ptr.md @@ -112,4 +112,3 @@ shared_ptr managed object deleted. - [Visual C++](/implementation.md#visual_cpp): 2008 (TR1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 - diff --git a/reference/memory/weak_ptr/lock.md b/reference/memory/weak_ptr/lock.md index 78317deaf0..0be2fa8b15 100644 --- a/reference/memory/weak_ptr/lock.md +++ b/reference/memory/weak_ptr/lock.md @@ -96,4 +96,3 @@ int main() ## 参照 - [LWG 2316 - weak_ptr::lock() should be atomic](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#2316) - diff --git a/reference/memory/weak_ptr/op_deduction_guide.md b/reference/memory/weak_ptr/op_deduction_guide.md index f426ebfd22..4bddbdcafc 100644 --- a/reference/memory/weak_ptr/op_deduction_guide.md +++ b/reference/memory/weak_ptr/op_deduction_guide.md @@ -53,4 +53,3 @@ int main() ## 参照 - [P0433R2 Toward a resolution of US7 and US14: Integrating template deduction for class templates into the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0433r2.html) - diff --git a/reference/memory_resource/polymorphic_allocator/delete_object.md b/reference/memory_resource/polymorphic_allocator/delete_object.md index d99a0534eb..0033ffb1b8 100644 --- a/reference/memory_resource/polymorphic_allocator/delete_object.md +++ b/reference/memory_resource/polymorphic_allocator/delete_object.md @@ -100,4 +100,3 @@ address : 0x1a2b960 ## 参照 - [P0339R6 polymorphic_allocator<> as a vocabulary type](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0339r6.pdf) - [LWG Issue 3036. `polymorphic_allocator::destroy` is extraneous](https://cplusplus.github.io/LWG/issue3036) - diff --git a/reference/mutex/call_once.md b/reference/mutex/call_once.md index db64a4928d..85ee245be2 100644 --- a/reference/mutex/call_once.md +++ b/reference/mutex/call_once.md @@ -90,4 +90,3 @@ initialize ## 参照 - [LWG Issue 2080. Specify when `once_flag` becomes invalid](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2080) - C++11では、`once_flag`が無効(invalid)な場合に`system_error`が送出される仕様になっていた。実際には、`once_flag`が無効になる状況はないため、C++14でこの例外仕様が削除された。 - diff --git a/reference/mutex/lock.md b/reference/mutex/lock.md index 4306776f43..79396e9910 100644 --- a/reference/mutex/lock.md +++ b/reference/mutex/lock.md @@ -109,5 +109,3 @@ Visual C++ 11.0, 12.0では、このコードは正常に動作せず、1件目 ## 参照 - [lock非メンバ関数の使いどころ - yohhoyの日記](http://d.hatena.ne.jp/yohhoy/20120919/p1) - [Acquiring Multiple Locks Without Deadlock](https://www.justsoftwaresolutions.co.uk/threading/acquiring-multiple-locks-without-deadlock.html) - - diff --git a/reference/mutex/lock_guard/op_constructor.md b/reference/mutex/lock_guard/op_constructor.md index 77da0cdd16..a559d6745e 100644 --- a/reference/mutex/lock_guard/op_constructor.md +++ b/reference/mutex/lock_guard/op_constructor.md @@ -72,5 +72,3 @@ int main() ## 参照 - - diff --git a/reference/mutex/lock_guard/op_destructor.md b/reference/mutex/lock_guard/op_destructor.md index eb47cdbd22..fdf8bff4be 100644 --- a/reference/mutex/lock_guard/op_destructor.md +++ b/reference/mutex/lock_guard/op_destructor.md @@ -33,5 +33,3 @@ m.unlock(); ## 参照 - - diff --git a/reference/mutex/mutex.md b/reference/mutex/mutex.md index 636dfffe9d..7ed69bb700 100644 --- a/reference/mutex/mutex.md +++ b/reference/mutex/mutex.md @@ -94,4 +94,3 @@ int main() ## 参照 - diff --git a/reference/mutex/mutex/native_handle.md b/reference/mutex/mutex/native_handle.md index 93d5e7ebc7..557aad3139 100644 --- a/reference/mutex/mutex/native_handle.md +++ b/reference/mutex/mutex/native_handle.md @@ -64,5 +64,3 @@ int main() ## 参照 - - diff --git a/reference/mutex/mutex/op_constructor.md b/reference/mutex/mutex/op_constructor.md index 6f454ebfab..0afd32ef12 100644 --- a/reference/mutex/mutex/op_constructor.md +++ b/reference/mutex/mutex/op_constructor.md @@ -114,4 +114,3 @@ A - [Constant Initialization - 雑貨's tumblr](https://zakkas783-blog-blog.tumblr.com/post/25490513807/constant-initialization) - [mutexのconstexprコンストラクタ - yohhoyの日記](http://d.hatena.ne.jp/yohhoy/20120621/p1) - [なぜmutexオブジェクトはムーブできないか? - yohhoyの日記](http://d.hatena.ne.jp/yohhoy/20161106/p1) - diff --git a/reference/mutex/mutex/op_destructor.md b/reference/mutex/mutex/op_destructor.md index 98d1a4a85e..06f177988d 100644 --- a/reference/mutex/mutex/op_destructor.md +++ b/reference/mutex/mutex/op_destructor.md @@ -25,5 +25,3 @@ ## 参照 - - diff --git a/reference/mutex/mutex/try_lock.md b/reference/mutex/mutex/try_lock.md index 2ae1dce41a..8a8a46f890 100644 --- a/reference/mutex/mutex/try_lock.md +++ b/reference/mutex/mutex/try_lock.md @@ -89,5 +89,3 @@ int main() ## 参照 - - diff --git a/reference/mutex/mutex/unlock.md b/reference/mutex/mutex/unlock.md index 28863e64f7..55dfcae8ba 100644 --- a/reference/mutex/mutex/unlock.md +++ b/reference/mutex/mutex/unlock.md @@ -77,5 +77,3 @@ int main() ## 参照 - - diff --git a/reference/mutex/once_flag.md b/reference/mutex/once_flag.md index 69e201facf..8e13db9290 100644 --- a/reference/mutex/once_flag.md +++ b/reference/mutex/once_flag.md @@ -73,4 +73,3 @@ initialize ## 参照 - diff --git a/reference/mutex/once_flag/op_constructor.md b/reference/mutex/once_flag/op_constructor.md index d56eb1cdbf..73ed6b2dcc 100644 --- a/reference/mutex/once_flag/op_constructor.md +++ b/reference/mutex/once_flag/op_constructor.md @@ -42,5 +42,3 @@ int main() ## 参照 - - diff --git a/reference/mutex/recursive_mutex.md b/reference/mutex/recursive_mutex.md index 5bfb6069cd..de58532561 100644 --- a/reference/mutex/recursive_mutex.md +++ b/reference/mutex/recursive_mutex.md @@ -105,4 +105,3 @@ count == 2 ## 参照 - diff --git a/reference/mutex/recursive_mutex/native_handle.md b/reference/mutex/recursive_mutex/native_handle.md index 81e9d7e25f..b2ce798088 100644 --- a/reference/mutex/recursive_mutex/native_handle.md +++ b/reference/mutex/recursive_mutex/native_handle.md @@ -63,5 +63,3 @@ int main() ## 参照 - - diff --git a/reference/mutex/recursive_mutex/op_constructor.md b/reference/mutex/recursive_mutex/op_constructor.md index 58ca27f8f8..6e598d7a9a 100644 --- a/reference/mutex/recursive_mutex/op_constructor.md +++ b/reference/mutex/recursive_mutex/op_constructor.md @@ -56,5 +56,3 @@ int main() ## 参照 - - diff --git a/reference/mutex/recursive_mutex/op_destructor.md b/reference/mutex/recursive_mutex/op_destructor.md index 73f11c610a..38603d02ad 100644 --- a/reference/mutex/recursive_mutex/op_destructor.md +++ b/reference/mutex/recursive_mutex/op_destructor.md @@ -25,5 +25,3 @@ ## 参照 - - diff --git a/reference/mutex/recursive_mutex/try_lock.md b/reference/mutex/recursive_mutex/try_lock.md index 7544bc65a7..9d2e0dab75 100644 --- a/reference/mutex/recursive_mutex/try_lock.md +++ b/reference/mutex/recursive_mutex/try_lock.md @@ -112,5 +112,3 @@ count == 2 ## 参照 - - diff --git a/reference/mutex/recursive_mutex/unlock.md b/reference/mutex/recursive_mutex/unlock.md index 1afaef1d9c..01c043ff06 100644 --- a/reference/mutex/recursive_mutex/unlock.md +++ b/reference/mutex/recursive_mutex/unlock.md @@ -109,5 +109,3 @@ count == 2 ## 参照 - - diff --git a/reference/mutex/recursive_timed_mutex.md b/reference/mutex/recursive_timed_mutex.md index 44429ecb45..1cedf75eab 100644 --- a/reference/mutex/recursive_timed_mutex.md +++ b/reference/mutex/recursive_timed_mutex.md @@ -131,4 +131,3 @@ count == 2 - 2012, 2013は、(2)での実引数の受け渡しにムーブを使用しない問題がある。上記の例でも、`std::unique_ptr`の実引数でコンパイルエラーになる。 ## 参照 - diff --git a/reference/mutex/recursive_timed_mutex/native_handle.md b/reference/mutex/recursive_timed_mutex/native_handle.md index fd8b393407..48d04fc238 100644 --- a/reference/mutex/recursive_timed_mutex/native_handle.md +++ b/reference/mutex/recursive_timed_mutex/native_handle.md @@ -64,5 +64,3 @@ int main() ## 参照 - - diff --git a/reference/mutex/recursive_timed_mutex/op_constructor.md b/reference/mutex/recursive_timed_mutex/op_constructor.md index 803fc2a471..f1d4310321 100644 --- a/reference/mutex/recursive_timed_mutex/op_constructor.md +++ b/reference/mutex/recursive_timed_mutex/op_constructor.md @@ -56,5 +56,3 @@ int main() ## 参照 - - diff --git a/reference/mutex/recursive_timed_mutex/op_destructor.md b/reference/mutex/recursive_timed_mutex/op_destructor.md index 6ba2f78783..927b09ba06 100644 --- a/reference/mutex/recursive_timed_mutex/op_destructor.md +++ b/reference/mutex/recursive_timed_mutex/op_destructor.md @@ -25,5 +25,3 @@ ## 参照 - - diff --git a/reference/mutex/recursive_timed_mutex/try_lock.md b/reference/mutex/recursive_timed_mutex/try_lock.md index 0136e295b0..f62f3d470d 100644 --- a/reference/mutex/recursive_timed_mutex/try_lock.md +++ b/reference/mutex/recursive_timed_mutex/try_lock.md @@ -108,5 +108,3 @@ count == 2 ## 参照 - - diff --git a/reference/mutex/recursive_timed_mutex/try_lock_for.md b/reference/mutex/recursive_timed_mutex/try_lock_for.md index ad3d4f360c..dc242d26bb 100644 --- a/reference/mutex/recursive_timed_mutex/try_lock_for.md +++ b/reference/mutex/recursive_timed_mutex/try_lock_for.md @@ -98,5 +98,3 @@ int main() ## 参照 - [LWG Issue 2091. Misplaced effect in `m.try_lock_for()`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2091) - [LWG Issue 2093. Throws clause of `condition_variable::wait` with predicate](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2093) - - diff --git a/reference/mutex/recursive_timed_mutex/try_lock_until.md b/reference/mutex/recursive_timed_mutex/try_lock_until.md index b2a8604850..53414b3f9b 100644 --- a/reference/mutex/recursive_timed_mutex/try_lock_until.md +++ b/reference/mutex/recursive_timed_mutex/try_lock_until.md @@ -108,5 +108,3 @@ int main() ## 参照 - [LWG Issue 2093. Throws clause of `condition_variable::wait` with predicate](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2093) - - diff --git a/reference/mutex/recursive_timed_mutex/unlock.md b/reference/mutex/recursive_timed_mutex/unlock.md index 53914135e0..b1a9b1b130 100644 --- a/reference/mutex/recursive_timed_mutex/unlock.md +++ b/reference/mutex/recursive_timed_mutex/unlock.md @@ -102,5 +102,3 @@ count == 2 ## 参照 - - diff --git a/reference/mutex/timed_mutex/native_handle.md b/reference/mutex/timed_mutex/native_handle.md index 8abb7a5360..befaba55fe 100644 --- a/reference/mutex/timed_mutex/native_handle.md +++ b/reference/mutex/timed_mutex/native_handle.md @@ -63,5 +63,3 @@ int main() ## 参照 - - diff --git a/reference/mutex/timed_mutex/op_constructor.md b/reference/mutex/timed_mutex/op_constructor.md index 6e944edd3a..d6c68fa9e5 100644 --- a/reference/mutex/timed_mutex/op_constructor.md +++ b/reference/mutex/timed_mutex/op_constructor.md @@ -52,5 +52,3 @@ int main() ## 参照 - - diff --git a/reference/mutex/timed_mutex/op_destructor.md b/reference/mutex/timed_mutex/op_destructor.md index 2eca8d07bf..be83aa0df6 100644 --- a/reference/mutex/timed_mutex/op_destructor.md +++ b/reference/mutex/timed_mutex/op_destructor.md @@ -25,5 +25,3 @@ ## 参照 - - diff --git a/reference/mutex/timed_mutex/try_lock.md b/reference/mutex/timed_mutex/try_lock.md index f572ba07a3..3966da1680 100644 --- a/reference/mutex/timed_mutex/try_lock.md +++ b/reference/mutex/timed_mutex/try_lock.md @@ -91,5 +91,3 @@ int main() ## 参照 - - diff --git a/reference/mutex/timed_mutex/try_lock_until.md b/reference/mutex/timed_mutex/try_lock_until.md index d087e83b1b..2379206b03 100644 --- a/reference/mutex/timed_mutex/try_lock_until.md +++ b/reference/mutex/timed_mutex/try_lock_until.md @@ -112,5 +112,3 @@ int main() ## 参照 - [LWG Issue 2093. Throws clause of `condition_variable::wait` with predicate](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2093) - - diff --git a/reference/mutex/timed_mutex/unlock.md b/reference/mutex/timed_mutex/unlock.md index fc278c4318..66d4144060 100644 --- a/reference/mutex/timed_mutex/unlock.md +++ b/reference/mutex/timed_mutex/unlock.md @@ -78,5 +78,3 @@ int main() ## 参照 - - diff --git a/reference/mutex/try_lock.md b/reference/mutex/try_lock.md index 6e1f2036c5..5c0685912b 100644 --- a/reference/mutex/try_lock.md +++ b/reference/mutex/try_lock.md @@ -112,5 +112,3 @@ int main() ## 参照 - [lock非メンバ関数の使いどころ - yohhoyの日記](http://d.hatena.ne.jp/yohhoy/20120919/p1) - [Acquiring Multiple Locks Without Deadlock](https://www.justsoftwaresolutions.co.uk/threading/acquiring-multiple-locks-without-deadlock.html) - - diff --git a/reference/mutex/unique_lock.md b/reference/mutex/unique_lock.md index 9573285bb9..b62f650dcd 100644 --- a/reference/mutex/unique_lock.md +++ b/reference/mutex/unique_lock.md @@ -138,4 +138,3 @@ int main() ## 関連項目 - [`shared_lock`](/reference/shared_mutex/shared_lock.md) : 共有ミューテックスを自動的に手放す - diff --git a/reference/mutex/unique_lock/lock.md b/reference/mutex/unique_lock/lock.md index 3530342208..ee5e021a54 100644 --- a/reference/mutex/unique_lock/lock.md +++ b/reference/mutex/unique_lock/lock.md @@ -89,5 +89,3 @@ int main() ## 参照 - - diff --git a/reference/mutex/unique_lock/mutex.md b/reference/mutex/unique_lock/mutex.md index 176db7f6c9..e27ae78516 100644 --- a/reference/mutex/unique_lock/mutex.md +++ b/reference/mutex/unique_lock/mutex.md @@ -63,5 +63,3 @@ int main() ## 参照 - - diff --git a/reference/mutex/unique_lock/op_bool.md b/reference/mutex/unique_lock/op_bool.md index 0e4b4f06bf..15c6e1419c 100644 --- a/reference/mutex/unique_lock/op_bool.md +++ b/reference/mutex/unique_lock/op_bool.md @@ -88,5 +88,3 @@ locked ## 参照 - - diff --git a/reference/mutex/unique_lock/op_constructor.md b/reference/mutex/unique_lock/op_constructor.md index aff6cd4e47..273976799e 100644 --- a/reference/mutex/unique_lock/op_constructor.md +++ b/reference/mutex/unique_lock/op_constructor.md @@ -143,5 +143,3 @@ int main() - 2012はコピーコンストラクタのdeleteに対応していないため、代わりにprivateで宣言のみ行う手法で代用されている。 ## 参照 - - diff --git a/reference/mutex/unique_lock/op_destructor.md b/reference/mutex/unique_lock/op_destructor.md index 200586f169..5767944122 100644 --- a/reference/mutex/unique_lock/op_destructor.md +++ b/reference/mutex/unique_lock/op_destructor.md @@ -36,5 +36,3 @@ if (owns_lock()) { ## 参照 - - diff --git a/reference/mutex/unique_lock/owns_lock.md b/reference/mutex/unique_lock/owns_lock.md index 40a9b80f02..3578df60c6 100644 --- a/reference/mutex/unique_lock/owns_lock.md +++ b/reference/mutex/unique_lock/owns_lock.md @@ -70,5 +70,3 @@ int main() ## 参照 - - diff --git a/reference/mutex/unique_lock/release.md b/reference/mutex/unique_lock/release.md index 3d4a7c4490..e906c290e4 100644 --- a/reference/mutex/unique_lock/release.md +++ b/reference/mutex/unique_lock/release.md @@ -89,4 +89,3 @@ int main() ## 参照 - [what are the use cases for `std::unique_lock::release`? - StackOverflow](http://stackoverflow.com/questions/28491075/what-are-the-use-cases-for-stdunique-lockrelease) - diff --git a/reference/mutex/unique_lock/swap.md b/reference/mutex/unique_lock/swap.md index 5937aa10ac..23661f773e 100644 --- a/reference/mutex/unique_lock/swap.md +++ b/reference/mutex/unique_lock/swap.md @@ -60,5 +60,3 @@ int main() ## 参照 - - diff --git a/reference/mutex/unique_lock/swap_free.md b/reference/mutex/unique_lock/swap_free.md index 21e620c439..fcb5f793d7 100644 --- a/reference/mutex/unique_lock/swap_free.md +++ b/reference/mutex/unique_lock/swap_free.md @@ -65,5 +65,3 @@ int main() ## 参照 - - diff --git a/reference/mutex/unique_lock/try_lock.md b/reference/mutex/unique_lock/try_lock.md index 4290fa49b5..11d0288dc4 100644 --- a/reference/mutex/unique_lock/try_lock.md +++ b/reference/mutex/unique_lock/try_lock.md @@ -103,5 +103,3 @@ terminate called after throwing an instance of 'std::system_error' ## 参照 - - diff --git a/reference/mutex/unique_lock/try_lock_for.md b/reference/mutex/unique_lock/try_lock_for.md index 0807669fe0..451f76bec9 100644 --- a/reference/mutex/unique_lock/try_lock_for.md +++ b/reference/mutex/unique_lock/try_lock_for.md @@ -104,5 +104,3 @@ int main() ## 参照 - - diff --git a/reference/mutex/unique_lock/try_lock_until.md b/reference/mutex/unique_lock/try_lock_until.md index f3df32e226..a56f63ab8d 100644 --- a/reference/mutex/unique_lock/try_lock_until.md +++ b/reference/mutex/unique_lock/try_lock_until.md @@ -111,5 +111,3 @@ int main() ## 参照 - - diff --git a/reference/mutex/unique_lock/unlock.md b/reference/mutex/unique_lock/unlock.md index f3ca64b966..f67c15c5d6 100644 --- a/reference/mutex/unique_lock/unlock.md +++ b/reference/mutex/unique_lock/unlock.md @@ -86,5 +86,3 @@ int main() ## 参照 - - diff --git a/reference/new.md b/reference/new.md index 5fc6e7ec54..6873fb64ce 100644 --- a/reference/new.md +++ b/reference/new.md @@ -36,4 +36,3 @@ |------|------|----------------| | [`hardware_destructive_interference_size`](new/hardware_destructive_interference_size.md) | 2つのオブジェクトに並行アクセスする際に、パフォーマンス低下を避けられる最小アライメントサイズ (variable) | C++17 | | [`hardware_constructive_interference_size`](new/hardware_constructive_interference_size.md) | 2つのオブジェクトに一時局所的にアクセスできる最大サイズ (variable) | C++17 | - diff --git a/reference/new/bad_alloc.md b/reference/new/bad_alloc.md index 2a9afcf122..88d54d546d 100644 --- a/reference/new/bad_alloc.md +++ b/reference/new/bad_alloc.md @@ -42,4 +42,3 @@ int main() } ``` * std::bad_alloc[color ff0000] - diff --git a/reference/new/bad_alloc/op_assign.md b/reference/new/bad_alloc/op_assign.md index ed8ebd632d..074a6116c7 100644 --- a/reference/new/bad_alloc/op_assign.md +++ b/reference/new/bad_alloc/op_assign.md @@ -22,4 +22,3 @@ constexpr bad_alloc& operator=(const bad_alloc&) noexcept; // (1) C++26 ## 関連項目 - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) - diff --git a/reference/new/bad_alloc/op_constructor.md b/reference/new/bad_alloc/op_constructor.md index 165cbfb845..b127eb6c2e 100644 --- a/reference/new/bad_alloc/op_constructor.md +++ b/reference/new/bad_alloc/op_constructor.md @@ -27,4 +27,3 @@ constexpr bad_alloc(const bad_alloc&) noexcept; // (2) C++26 ## 関連項目 - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) - diff --git a/reference/new/bad_alloc/op_destructor.md b/reference/new/bad_alloc/op_destructor.md index 8dd32cc266..f5c4cc916b 100644 --- a/reference/new/bad_alloc/op_destructor.md +++ b/reference/new/bad_alloc/op_destructor.md @@ -19,4 +19,3 @@ constexpr virtual ~bad_alloc(); // (1) C++26 ## 関連項目 - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) - diff --git a/reference/new/bad_alloc/what.md b/reference/new/bad_alloc/what.md index c52e17f7df..4994fd31d1 100644 --- a/reference/new/bad_alloc/what.md +++ b/reference/new/bad_alloc/what.md @@ -21,4 +21,3 @@ constexpr const char* what() const noexcept override; // (1) C++26 ## 関連項目 - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) - diff --git a/reference/new/bad_array_new_length/op_assign.md b/reference/new/bad_array_new_length/op_assign.md index 844e728afa..2ea4a3d336 100644 --- a/reference/new/bad_array_new_length/op_assign.md +++ b/reference/new/bad_array_new_length/op_assign.md @@ -22,4 +22,3 @@ constexpr bad_array_new_length& operator=(const bad_array_new_length&) noexcept; ## 関連項目 - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) - diff --git a/reference/new/bad_array_new_length/op_constructor.md b/reference/new/bad_array_new_length/op_constructor.md index 580c58b0dc..f7d4e2de14 100644 --- a/reference/new/bad_array_new_length/op_constructor.md +++ b/reference/new/bad_array_new_length/op_constructor.md @@ -26,4 +26,3 @@ constexpr bad_array_new_length(const bad_array_new_length&) noexcept; // (2) C++ ## 関連項目 - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) - diff --git a/reference/new/bad_array_new_length/op_destructor.md b/reference/new/bad_array_new_length/op_destructor.md index cdbd5e299a..ccf1f1e915 100644 --- a/reference/new/bad_array_new_length/op_destructor.md +++ b/reference/new/bad_array_new_length/op_destructor.md @@ -20,4 +20,3 @@ constexpr virtual ~bad_array_new_length(); // (1) C++26 ## 関連項目 - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) - diff --git a/reference/new/bad_array_new_length/what.md b/reference/new/bad_array_new_length/what.md index 49eca9ee58..5754258d19 100644 --- a/reference/new/bad_array_new_length/what.md +++ b/reference/new/bad_array_new_length/what.md @@ -21,4 +21,3 @@ constexpr const char* what() const noexcept override; // (1) C++26 ## 関連項目 - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) - diff --git a/reference/new/get_new_handler.md b/reference/new/get_new_handler.md index e6121ffbe8..e3a416bab1 100644 --- a/reference/new/get_new_handler.md +++ b/reference/new/get_new_handler.md @@ -61,4 +61,3 @@ int main() - [GCC](/implementation.md#gcc): - [ICC](/implementation.md#icc): - [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified] - diff --git a/reference/new/new_handler.md b/reference/new/new_handler.md index 35b665e2e3..76fabfce48 100644 --- a/reference/new/new_handler.md +++ b/reference/new/new_handler.md @@ -56,5 +56,3 @@ int main() This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. ``` - - diff --git a/reference/new/set_new_handler.md b/reference/new/set_new_handler.md index b363f146c9..84341cddf1 100644 --- a/reference/new/set_new_handler.md +++ b/reference/new/set_new_handler.md @@ -59,4 +59,3 @@ int main() This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. ``` - diff --git a/reference/node_handle.md b/reference/node_handle.md index d20722a7ba..1b174887b7 100644 --- a/reference/node_handle.md +++ b/reference/node_handle.md @@ -4,5 +4,3 @@ このページでは、連想コンテナのsplice操作をサポートするための説明用の型について記載する。 ライブラリとして直接的に定義されている機能ではない。 - - diff --git a/reference/node_handle/node_handle.md b/reference/node_handle/node_handle.md index 3783fead42..f2fb7953cf 100644 --- a/reference/node_handle/node_handle.md +++ b/reference/node_handle/node_handle.md @@ -151,4 +151,3 @@ m2 : ## 参照 - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) - diff --git a/reference/numeric.md b/reference/numeric.md index 11c2378c39..d2e789ebd9 100644 --- a/reference/numeric.md +++ b/reference/numeric.md @@ -69,4 +69,3 @@ ## 関連項目 - [``](/reference/algorithm.md) - より汎用的なアルゴリズム - diff --git a/reference/numeric/gcd.md b/reference/numeric/gcd.md index c0a38b9a77..e2bbb81644 100644 --- a/reference/numeric/gcd.md +++ b/reference/numeric/gcd.md @@ -187,4 +187,3 @@ constexpr std::common_type_t gcd(M m, N n) { } ``` * abs[link /reference/cstdlib/abs.md] - diff --git a/reference/numeric/lcm.md b/reference/numeric/lcm.md index 5dfbdba6f1..de7e9e3fef 100644 --- a/reference/numeric/lcm.md +++ b/reference/numeric/lcm.md @@ -195,4 +195,3 @@ constexpr std::common_type_t lcm(M m, N n) { } ``` * abs[link /reference/cstdlib/abs.md] - diff --git a/reference/optional/bad_optional_access/op_destructor.md b/reference/optional/bad_optional_access/op_destructor.md index fc7d1c6561..10b6dbb94b 100644 --- a/reference/optional/bad_optional_access/op_destructor.md +++ b/reference/optional/bad_optional_access/op_destructor.md @@ -20,4 +20,3 @@ constexpr virtual ~bad_optional_access(); // (1) C++26 ## 関連項目 - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) - diff --git a/reference/ostream.md b/reference/ostream.md index 638dd6be11..6bf5b0dae2 100644 --- a/reference/ostream.md +++ b/reference/ostream.md @@ -34,4 +34,3 @@ ## バージョン ### 言語 - C++98 - diff --git a/reference/queue/priority_queue/emplace.md b/reference/queue/priority_queue/emplace.md index 16a617f1cd..0d9f8ce271 100644 --- a/reference/queue/priority_queue/emplace.md +++ b/reference/queue/priority_queue/emplace.md @@ -73,5 +73,3 @@ int main () ## 参照 - [N2680 Proposed Wording for Placement Insert (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2680.pdf) - - diff --git a/reference/queue/priority_queue/op_deduction_guide.md b/reference/queue/priority_queue/op_deduction_guide.md index 332cfe2feb..00006c654e 100644 --- a/reference/queue/priority_queue/op_deduction_guide.md +++ b/reference/queue/priority_queue/op_deduction_guide.md @@ -120,4 +120,3 @@ int main() ## 参照 - [P0433R2 Toward a resolution of US7 and US14: Integrating template deduction for class templates into the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0433r2.html) - diff --git a/reference/queue/priority_queue/pop.md b/reference/queue/priority_queue/pop.md index cba15793e5..5312921514 100644 --- a/reference/queue/priority_queue/pop.md +++ b/reference/queue/priority_queue/pop.md @@ -55,5 +55,3 @@ int main() ``` ## 参照 - - diff --git a/reference/queue/priority_queue/push.md b/reference/queue/priority_queue/push.md index b9191e89aa..22d1218015 100644 --- a/reference/queue/priority_queue/push.md +++ b/reference/queue/priority_queue/push.md @@ -76,5 +76,3 @@ int main() ## 参照 - - diff --git a/reference/queue/priority_queue/size.md b/reference/queue/priority_queue/size.md index 7bbf979b11..08f8d1a8fe 100644 --- a/reference/queue/priority_queue/size.md +++ b/reference/queue/priority_queue/size.md @@ -50,5 +50,3 @@ int main() ``` ## 参照 - - diff --git a/reference/queue/priority_queue/swap.md b/reference/queue/priority_queue/swap.md index f7a2e30fff..35f15b3d96 100644 --- a/reference/queue/priority_queue/swap.md +++ b/reference/queue/priority_queue/swap.md @@ -87,5 +87,3 @@ int main () ## 参照 - - diff --git a/reference/queue/priority_queue/top.md b/reference/queue/priority_queue/top.md index ec9dd3c1ec..99790ffd6d 100644 --- a/reference/queue/priority_queue/top.md +++ b/reference/queue/priority_queue/top.md @@ -53,5 +53,3 @@ int main() 3 1 ``` - - diff --git a/reference/queue/queue.md b/reference/queue/queue.md index d3ae68156b..246e26c866 100644 --- a/reference/queue/queue.md +++ b/reference/queue/queue.md @@ -121,5 +121,3 @@ int main() ``` ## 参照 - - diff --git a/reference/queue/queue/back.md b/reference/queue/queue/back.md index a5ce04366b..9315fb3106 100644 --- a/reference/queue/queue/back.md +++ b/reference/queue/queue/back.md @@ -58,5 +58,3 @@ int main() { value_type& back() { return c.back(); } const value_type& back() const { return c.back(); } ``` - - diff --git a/reference/queue/queue/front.md b/reference/queue/queue/front.md index acfae4fcd1..fa6f83769f 100644 --- a/reference/queue/queue/front.md +++ b/reference/queue/queue/front.md @@ -65,4 +65,3 @@ const value_type& front() const { return c.front(); } ``` ## 参照 - diff --git a/reference/queue/queue/op_equal.md b/reference/queue/queue/op_equal.md index 94139ce0d9..2056579194 100644 --- a/reference/queue/queue/op_equal.md +++ b/reference/queue/queue/op_equal.md @@ -49,5 +49,3 @@ true ``` ## 参照 - - diff --git a/reference/queue/queue/op_greater.md b/reference/queue/queue/op_greater.md index 1c3f0ad042..cf0cd1466e 100644 --- a/reference/queue/queue/op_greater.md +++ b/reference/queue/queue/op_greater.md @@ -49,5 +49,3 @@ true ``` ## 参照 - - diff --git a/reference/queue/queue/op_greater_equal.md b/reference/queue/queue/op_greater_equal.md index bae8465c97..a5a2a50fd5 100644 --- a/reference/queue/queue/op_greater_equal.md +++ b/reference/queue/queue/op_greater_equal.md @@ -49,5 +49,3 @@ true ``` ## 参照 - - diff --git a/reference/queue/queue/op_less.md b/reference/queue/queue/op_less.md index 899555cb3d..522d326142 100644 --- a/reference/queue/queue/op_less.md +++ b/reference/queue/queue/op_less.md @@ -49,5 +49,3 @@ true ``` ## 参照 - - diff --git a/reference/queue/queue/op_less_equal.md b/reference/queue/queue/op_less_equal.md index de15787e8a..54511ec113 100644 --- a/reference/queue/queue/op_less_equal.md +++ b/reference/queue/queue/op_less_equal.md @@ -49,5 +49,3 @@ true ``` ## 参照 - - diff --git a/reference/queue/queue/op_not_equal.md b/reference/queue/queue/op_not_equal.md index 0e830ceae2..09a27c8631 100644 --- a/reference/queue/queue/op_not_equal.md +++ b/reference/queue/queue/op_not_equal.md @@ -55,5 +55,3 @@ true ``` ## 参照 - - diff --git a/reference/queue/queue/pop.md b/reference/queue/queue/pop.md index a62ed8eeec..e05e95d995 100644 --- a/reference/queue/queue/pop.md +++ b/reference/queue/queue/pop.md @@ -54,4 +54,3 @@ void pop() { c.pop_front(); } ``` ## 参照 - diff --git a/reference/queue/queue/push.md b/reference/queue/queue/push.md index 17d0ebb922..87028e3be5 100644 --- a/reference/queue/queue/push.md +++ b/reference/queue/queue/push.md @@ -60,4 +60,3 @@ int main() ``` ## 参照 - diff --git a/reference/queue/queue/size.md b/reference/queue/queue/size.md index eb5cf37328..186894c5d4 100644 --- a/reference/queue/queue/size.md +++ b/reference/queue/queue/size.md @@ -59,5 +59,3 @@ int main() { ``` ## 参照 - - diff --git a/reference/queue/queue/swap.md b/reference/queue/queue/swap.md index f13775d98e..0043f2af26 100644 --- a/reference/queue/queue/swap.md +++ b/reference/queue/queue/swap.md @@ -82,4 +82,3 @@ int main () ## 参照 - diff --git a/reference/random/bernoulli_distribution.md b/reference/random/bernoulli_distribution.md index ea0e8cfbe3..be9e19f88a 100644 --- a/reference/random/bernoulli_distribution.md +++ b/reference/random/bernoulli_distribution.md @@ -117,4 +117,3 @@ int main() ## 参照 - [ベルヌーイ分布 - Wikipedia](https://ja.wikipedia.org/wiki/ベルヌーイ分布) - [ベルヌーイ分布(Bernoulli distribution) - NtRand](http://www.ntrand.com/jp/bernoulli-distribution/) - diff --git a/reference/random/bernoulli_distribution/max.md b/reference/random/bernoulli_distribution/max.md index acdb5f8ad7..4ef3910406 100644 --- a/reference/random/bernoulli_distribution/max.md +++ b/reference/random/bernoulli_distribution/max.md @@ -49,5 +49,3 @@ true ## 参照 - - diff --git a/reference/random/bernoulli_distribution/min.md b/reference/random/bernoulli_distribution/min.md index b8508c9e93..49287cbe9c 100644 --- a/reference/random/bernoulli_distribution/min.md +++ b/reference/random/bernoulli_distribution/min.md @@ -49,5 +49,3 @@ false ## 参照 - - diff --git a/reference/random/bernoulli_distribution/op_equal.md b/reference/random/bernoulli_distribution/op_equal.md index 5d6359cacd..806ca88db4 100644 --- a/reference/random/bernoulli_distribution/op_equal.md +++ b/reference/random/bernoulli_distribution/op_equal.md @@ -60,5 +60,3 @@ equal ## 参照 - - diff --git a/reference/random/bernoulli_distribution/op_istream.md b/reference/random/bernoulli_distribution/op_istream.md index 914bcee82d..47e27cbc97 100644 --- a/reference/random/bernoulli_distribution/op_istream.md +++ b/reference/random/bernoulli_distribution/op_istream.md @@ -79,5 +79,3 @@ int main() ## 参照 - - diff --git a/reference/random/bernoulli_distribution/op_not_equal.md b/reference/random/bernoulli_distribution/op_not_equal.md index 58da568ed0..0d3fbe15f6 100644 --- a/reference/random/bernoulli_distribution/op_not_equal.md +++ b/reference/random/bernoulli_distribution/op_not_equal.md @@ -60,5 +60,3 @@ not equal ## 参照 - - diff --git a/reference/random/bernoulli_distribution/op_ostream.md b/reference/random/bernoulli_distribution/op_ostream.md index 34d8e7eb39..5dabac3366 100644 --- a/reference/random/bernoulli_distribution/op_ostream.md +++ b/reference/random/bernoulli_distribution/op_ostream.md @@ -58,5 +58,3 @@ int main() ## 参照 - - diff --git a/reference/random/bernoulli_distribution/p.md b/reference/random/bernoulli_distribution/p.md index e3b51cb0bd..2a54b7b9d5 100644 --- a/reference/random/bernoulli_distribution/p.md +++ b/reference/random/bernoulli_distribution/p.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/bernoulli_distribution/param.md b/reference/random/bernoulli_distribution/param.md index ed3c1bb1f2..226955db85 100644 --- a/reference/random/bernoulli_distribution/param.md +++ b/reference/random/bernoulli_distribution/param.md @@ -57,5 +57,3 @@ int main() ## 参照 - - diff --git a/reference/random/bernoulli_distribution/reset.md b/reference/random/bernoulli_distribution/reset.md index ffac2b245c..2f716020b1 100644 --- a/reference/random/bernoulli_distribution/reset.md +++ b/reference/random/bernoulli_distribution/reset.md @@ -67,5 +67,3 @@ true ## 参照 - - diff --git a/reference/random/binomial_distribution.md b/reference/random/binomial_distribution.md index 62571d00d8..cebca14475 100644 --- a/reference/random/binomial_distribution.md +++ b/reference/random/binomial_distribution.md @@ -112,4 +112,3 @@ int main() ## 参照 - [二項分布 - Wikipedia](https://ja.wikipedia.org/wiki/二項分布) - diff --git a/reference/random/binomial_distribution/max.md b/reference/random/binomial_distribution/max.md index e10ea018c8..9c6067964d 100644 --- a/reference/random/binomial_distribution/max.md +++ b/reference/random/binomial_distribution/max.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/binomial_distribution/min.md b/reference/random/binomial_distribution/min.md index 19440aff8b..07470a1314 100644 --- a/reference/random/binomial_distribution/min.md +++ b/reference/random/binomial_distribution/min.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/binomial_distribution/op_equal.md b/reference/random/binomial_distribution/op_equal.md index 4488826185..7e6747d1d7 100644 --- a/reference/random/binomial_distribution/op_equal.md +++ b/reference/random/binomial_distribution/op_equal.md @@ -61,5 +61,3 @@ equal ## 参照 - - diff --git a/reference/random/binomial_distribution/op_istream.md b/reference/random/binomial_distribution/op_istream.md index 920f78cfba..71c79fb201 100644 --- a/reference/random/binomial_distribution/op_istream.md +++ b/reference/random/binomial_distribution/op_istream.md @@ -79,5 +79,3 @@ int main() ## 参照 - - diff --git a/reference/random/binomial_distribution/op_not_equal.md b/reference/random/binomial_distribution/op_not_equal.md index ae76a5ec85..da3dca8ea0 100644 --- a/reference/random/binomial_distribution/op_not_equal.md +++ b/reference/random/binomial_distribution/op_not_equal.md @@ -61,5 +61,3 @@ not equal ## 参照 - - diff --git a/reference/random/binomial_distribution/op_ostream.md b/reference/random/binomial_distribution/op_ostream.md index d39e609af9..019cae853f 100644 --- a/reference/random/binomial_distribution/op_ostream.md +++ b/reference/random/binomial_distribution/op_ostream.md @@ -58,5 +58,3 @@ int main() ## 参照 - - diff --git a/reference/random/binomial_distribution/p.md b/reference/random/binomial_distribution/p.md index cd13b98679..c7ffc19d94 100644 --- a/reference/random/binomial_distribution/p.md +++ b/reference/random/binomial_distribution/p.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/binomial_distribution/param.md b/reference/random/binomial_distribution/param.md index 0c28832d4a..3ce82349b8 100644 --- a/reference/random/binomial_distribution/param.md +++ b/reference/random/binomial_distribution/param.md @@ -57,5 +57,3 @@ int main() ## 参照 - - diff --git a/reference/random/binomial_distribution/reset.md b/reference/random/binomial_distribution/reset.md index 747ec78904..fd02099093 100644 --- a/reference/random/binomial_distribution/reset.md +++ b/reference/random/binomial_distribution/reset.md @@ -67,5 +67,3 @@ int main() ## 参照 - - diff --git a/reference/random/binomial_distribution/t.md b/reference/random/binomial_distribution/t.md index e4bf9c93ba..795419ce5c 100644 --- a/reference/random/binomial_distribution/t.md +++ b/reference/random/binomial_distribution/t.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/cauchy_distribution.md b/reference/random/cauchy_distribution.md index 3ae8835265..5d0eb491d8 100644 --- a/reference/random/cauchy_distribution.md +++ b/reference/random/cauchy_distribution.md @@ -124,4 +124,3 @@ int main() ### 参考 - [コーシー分布 - Wikipedia](https://ja.wikipedia.org/wiki/%E3%82%B3%E3%83%BC%E3%82%B7%E3%83%BC%E5%88%86%E5%B8%83) - [コーシー分布 - NtRand](http://www.ntrand.com/jp/cauchy-distribution/) - diff --git a/reference/random/cauchy_distribution/a.md b/reference/random/cauchy_distribution/a.md index b51b40b6fe..4d339bb1ea 100644 --- a/reference/random/cauchy_distribution/a.md +++ b/reference/random/cauchy_distribution/a.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/cauchy_distribution/b.md b/reference/random/cauchy_distribution/b.md index 362d4d0666..562bc56826 100644 --- a/reference/random/cauchy_distribution/b.md +++ b/reference/random/cauchy_distribution/b.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/cauchy_distribution/max.md b/reference/random/cauchy_distribution/max.md index d3e29d7ada..8f0f17997e 100644 --- a/reference/random/cauchy_distribution/max.md +++ b/reference/random/cauchy_distribution/max.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/cauchy_distribution/min.md b/reference/random/cauchy_distribution/min.md index 00580c46c1..48a1f13972 100644 --- a/reference/random/cauchy_distribution/min.md +++ b/reference/random/cauchy_distribution/min.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/cauchy_distribution/op_equal.md b/reference/random/cauchy_distribution/op_equal.md index 71c1f3333f..be78649087 100644 --- a/reference/random/cauchy_distribution/op_equal.md +++ b/reference/random/cauchy_distribution/op_equal.md @@ -61,5 +61,3 @@ equal ## 参照 - - diff --git a/reference/random/cauchy_distribution/op_istream.md b/reference/random/cauchy_distribution/op_istream.md index 581be55b09..64c21402a9 100644 --- a/reference/random/cauchy_distribution/op_istream.md +++ b/reference/random/cauchy_distribution/op_istream.md @@ -79,5 +79,3 @@ int main() ## 参照 - - diff --git a/reference/random/cauchy_distribution/op_not_equal.md b/reference/random/cauchy_distribution/op_not_equal.md index 47f2ffe50e..b913e15b97 100644 --- a/reference/random/cauchy_distribution/op_not_equal.md +++ b/reference/random/cauchy_distribution/op_not_equal.md @@ -61,5 +61,3 @@ not equal ## 参照 - - diff --git a/reference/random/cauchy_distribution/op_ostream.md b/reference/random/cauchy_distribution/op_ostream.md index 0a851d2750..c330dda7c7 100644 --- a/reference/random/cauchy_distribution/op_ostream.md +++ b/reference/random/cauchy_distribution/op_ostream.md @@ -58,5 +58,3 @@ int main() ## 参照 - - diff --git a/reference/random/cauchy_distribution/param.md b/reference/random/cauchy_distribution/param.md index 687345e4fb..cd583da064 100644 --- a/reference/random/cauchy_distribution/param.md +++ b/reference/random/cauchy_distribution/param.md @@ -57,5 +57,3 @@ int main() ## 参照 - - diff --git a/reference/random/cauchy_distribution/reset.md b/reference/random/cauchy_distribution/reset.md index b9a3068e57..7c3242f8ac 100644 --- a/reference/random/cauchy_distribution/reset.md +++ b/reference/random/cauchy_distribution/reset.md @@ -67,5 +67,3 @@ int main() ## 参照 - - diff --git a/reference/random/chi_squared_distribution.md b/reference/random/chi_squared_distribution.md index 1dd4952cf2..6c8d324ccd 100644 --- a/reference/random/chi_squared_distribution.md +++ b/reference/random/chi_squared_distribution.md @@ -126,4 +126,3 @@ int main() - [カイ二乗分布 - Wikipedia](https://ja.wikipedia.org/wiki/%E3%82%AB%E3%82%A4%E4%BA%8C%E4%B9%97%E5%88%86%E5%B8%83) - [χ2(カイ2乗)分布](https://web.archive.org/web/20211102213228/http://staff.aist.go.jp/t.ihara/chi2.html) - [カイ2乗分布とは](https://web.archive.org/web/20161213042559/http://ogawas.cerp.u-toyama.ac.jp/e-stat/kai.html) - diff --git a/reference/random/chi_squared_distribution/max.md b/reference/random/chi_squared_distribution/max.md index d8200484f7..6f02479064 100644 --- a/reference/random/chi_squared_distribution/max.md +++ b/reference/random/chi_squared_distribution/max.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/chi_squared_distribution/min.md b/reference/random/chi_squared_distribution/min.md index 82408af789..ffe6e52ef7 100644 --- a/reference/random/chi_squared_distribution/min.md +++ b/reference/random/chi_squared_distribution/min.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/chi_squared_distribution/n.md b/reference/random/chi_squared_distribution/n.md index bdb360846a..8afcc90c79 100644 --- a/reference/random/chi_squared_distribution/n.md +++ b/reference/random/chi_squared_distribution/n.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/chi_squared_distribution/op_equal.md b/reference/random/chi_squared_distribution/op_equal.md index 3919320ee9..34247d28b1 100644 --- a/reference/random/chi_squared_distribution/op_equal.md +++ b/reference/random/chi_squared_distribution/op_equal.md @@ -61,5 +61,3 @@ equal ## 参照 - - diff --git a/reference/random/chi_squared_distribution/op_istream.md b/reference/random/chi_squared_distribution/op_istream.md index 0804e9a21f..8053a7fbd7 100644 --- a/reference/random/chi_squared_distribution/op_istream.md +++ b/reference/random/chi_squared_distribution/op_istream.md @@ -79,5 +79,3 @@ int main() ## 参照 - - diff --git a/reference/random/chi_squared_distribution/op_not_equal.md b/reference/random/chi_squared_distribution/op_not_equal.md index 6ca5f9d6e7..7fcc4b5f8d 100644 --- a/reference/random/chi_squared_distribution/op_not_equal.md +++ b/reference/random/chi_squared_distribution/op_not_equal.md @@ -61,5 +61,3 @@ not equal ## 参照 - - diff --git a/reference/random/chi_squared_distribution/op_ostream.md b/reference/random/chi_squared_distribution/op_ostream.md index 8f74c030df..f34c977452 100644 --- a/reference/random/chi_squared_distribution/op_ostream.md +++ b/reference/random/chi_squared_distribution/op_ostream.md @@ -58,5 +58,3 @@ int main() ## 参照 - - diff --git a/reference/random/chi_squared_distribution/param.md b/reference/random/chi_squared_distribution/param.md index 20814f1845..d7cd1aab7f 100644 --- a/reference/random/chi_squared_distribution/param.md +++ b/reference/random/chi_squared_distribution/param.md @@ -57,5 +57,3 @@ int main() ## 参照 - - diff --git a/reference/random/chi_squared_distribution/reset.md b/reference/random/chi_squared_distribution/reset.md index 95d29e5098..1a9bb69052 100644 --- a/reference/random/chi_squared_distribution/reset.md +++ b/reference/random/chi_squared_distribution/reset.md @@ -67,5 +67,3 @@ int main() ## 参照 - - diff --git a/reference/random/default_random_engine.md b/reference/random/default_random_engine.md index 8445b08d64..ad88848573 100644 --- a/reference/random/default_random_engine.md +++ b/reference/random/default_random_engine.md @@ -63,4 +63,3 @@ int main() ## 参照 - [N2478 A Proposal to Add `typedef default_random_engine` to C++0X](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2478.pdf) - diff --git a/reference/random/discard_block_engine.md b/reference/random/discard_block_engine.md index f202a336eb..9960b3d159 100644 --- a/reference/random/discard_block_engine.md +++ b/reference/random/discard_block_engine.md @@ -157,4 +157,3 @@ int main() - [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): - [Visual C++](/implementation.md#visual_cpp): - diff --git a/reference/random/discard_block_engine/base.md b/reference/random/discard_block_engine/base.md index be34f1623a..b1c14f280d 100644 --- a/reference/random/discard_block_engine/base.md +++ b/reference/random/discard_block_engine/base.md @@ -50,5 +50,3 @@ int main() ## 参照 - - diff --git a/reference/random/discard_block_engine/discard.md b/reference/random/discard_block_engine/discard.md index a4731a32ef..160ee8ba43 100644 --- a/reference/random/discard_block_engine/discard.md +++ b/reference/random/discard_block_engine/discard.md @@ -77,5 +77,3 @@ int main() ## 参照 - - diff --git a/reference/random/discard_block_engine/max.md b/reference/random/discard_block_engine/max.md index e0ca632a6d..db669db6ff 100644 --- a/reference/random/discard_block_engine/max.md +++ b/reference/random/discard_block_engine/max.md @@ -52,5 +52,3 @@ int main() ## 参照 - - diff --git a/reference/random/discard_block_engine/min.md b/reference/random/discard_block_engine/min.md index 7df2478f49..fab97da8a9 100644 --- a/reference/random/discard_block_engine/min.md +++ b/reference/random/discard_block_engine/min.md @@ -52,5 +52,3 @@ int main() ## 参照 - - diff --git a/reference/random/discard_block_engine/op_call.md b/reference/random/discard_block_engine/op_call.md index 70844551ec..60d158487b 100644 --- a/reference/random/discard_block_engine/op_call.md +++ b/reference/random/discard_block_engine/op_call.md @@ -72,5 +72,3 @@ int main() ## 参照 - - diff --git a/reference/random/discard_block_engine/op_constructor.md b/reference/random/discard_block_engine/op_constructor.md index 583d0dc753..dbf21ac76f 100644 --- a/reference/random/discard_block_engine/op_constructor.md +++ b/reference/random/discard_block_engine/op_constructor.md @@ -118,5 +118,3 @@ int main() ## 参照 - - diff --git a/reference/random/discard_block_engine/op_equal.md b/reference/random/discard_block_engine/op_equal.md index ba06938a3f..d64be793f0 100644 --- a/reference/random/discard_block_engine/op_equal.md +++ b/reference/random/discard_block_engine/op_equal.md @@ -62,5 +62,3 @@ equal ## 参照 - - diff --git a/reference/random/discard_block_engine/op_istream.md b/reference/random/discard_block_engine/op_istream.md index dd59a61d6d..e0661d55d5 100644 --- a/reference/random/discard_block_engine/op_istream.md +++ b/reference/random/discard_block_engine/op_istream.md @@ -82,5 +82,3 @@ int main() ## 参照 - - diff --git a/reference/random/discard_block_engine/op_not_equal.md b/reference/random/discard_block_engine/op_not_equal.md index e2c679d066..c732a73d60 100644 --- a/reference/random/discard_block_engine/op_not_equal.md +++ b/reference/random/discard_block_engine/op_not_equal.md @@ -64,5 +64,3 @@ not equal ## 参照 - - diff --git a/reference/random/discard_block_engine/op_ostream.md b/reference/random/discard_block_engine/op_ostream.md index f15da3c84c..d12c855535 100644 --- a/reference/random/discard_block_engine/op_ostream.md +++ b/reference/random/discard_block_engine/op_ostream.md @@ -61,5 +61,3 @@ int main() ## 参照 - - diff --git a/reference/random/discard_block_engine/seed.md b/reference/random/discard_block_engine/seed.md index f5a5fb741e..581700be15 100644 --- a/reference/random/discard_block_engine/seed.md +++ b/reference/random/discard_block_engine/seed.md @@ -112,5 +112,3 @@ int main() ## 参照 - - diff --git a/reference/random/discrete_distribution.md b/reference/random/discrete_distribution.md index aae3510448..f182838ac2 100644 --- a/reference/random/discrete_distribution.md +++ b/reference/random/discrete_distribution.md @@ -136,4 +136,3 @@ int main() - [Pseudo-random number sampling - Wikipedia](https://en.wikipedia.org/wiki/Pseudo-random_number_sampling) - [Alias Method - Wikipedia](https://en.wikipedia.org/wiki/Alias_method) - [一般の離散分布の従う乱数の発生させる方法 - arupaka-_-arupakaの日記](http://d.hatena.ne.jp/arupaka-_-arupaka/20100508/1273319666) - diff --git a/reference/random/discrete_distribution/max.md b/reference/random/discrete_distribution/max.md index 3ecc8e4aed..2b94174d6e 100644 --- a/reference/random/discrete_distribution/max.md +++ b/reference/random/discrete_distribution/max.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/discrete_distribution/min.md b/reference/random/discrete_distribution/min.md index 87c3969c85..74860c9418 100644 --- a/reference/random/discrete_distribution/min.md +++ b/reference/random/discrete_distribution/min.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/discrete_distribution/op_constructor.md b/reference/random/discrete_distribution/op_constructor.md index e7e5b9531a..e013e2dc8c 100644 --- a/reference/random/discrete_distribution/op_constructor.md +++ b/reference/random/discrete_distribution/op_constructor.md @@ -141,5 +141,3 @@ parameter constructor : 2 ## 参照 - - diff --git a/reference/random/discrete_distribution/op_equal.md b/reference/random/discrete_distribution/op_equal.md index 766d41a1bb..8105b52395 100644 --- a/reference/random/discrete_distribution/op_equal.md +++ b/reference/random/discrete_distribution/op_equal.md @@ -61,5 +61,3 @@ equal ## 参照 - - diff --git a/reference/random/discrete_distribution/op_istream.md b/reference/random/discrete_distribution/op_istream.md index 2ddd28f9dd..7eaa2b86e7 100644 --- a/reference/random/discrete_distribution/op_istream.md +++ b/reference/random/discrete_distribution/op_istream.md @@ -79,5 +79,3 @@ int main() ## 参照 - - diff --git a/reference/random/discrete_distribution/op_not_equal.md b/reference/random/discrete_distribution/op_not_equal.md index 852718b3e8..b680b45f97 100644 --- a/reference/random/discrete_distribution/op_not_equal.md +++ b/reference/random/discrete_distribution/op_not_equal.md @@ -61,5 +61,3 @@ not equal ## 参照 - - diff --git a/reference/random/discrete_distribution/op_ostream.md b/reference/random/discrete_distribution/op_ostream.md index 07f3aaa8ff..5f31fb044e 100644 --- a/reference/random/discrete_distribution/op_ostream.md +++ b/reference/random/discrete_distribution/op_ostream.md @@ -58,5 +58,3 @@ int main() ## 参照 - - diff --git a/reference/random/discrete_distribution/param.md b/reference/random/discrete_distribution/param.md index f1aa642d01..8723fb8031 100644 --- a/reference/random/discrete_distribution/param.md +++ b/reference/random/discrete_distribution/param.md @@ -57,5 +57,3 @@ int main() ## 参照 - - diff --git a/reference/random/discrete_distribution/probabilities.md b/reference/random/discrete_distribution/probabilities.md index 82721a0646..0e8ef6a515 100644 --- a/reference/random/discrete_distribution/probabilities.md +++ b/reference/random/discrete_distribution/probabilities.md @@ -55,5 +55,3 @@ int main() ## 参照 - - diff --git a/reference/random/discrete_distribution/reset.md b/reference/random/discrete_distribution/reset.md index 343b8ec09b..fa7e4cdb47 100644 --- a/reference/random/discrete_distribution/reset.md +++ b/reference/random/discrete_distribution/reset.md @@ -65,5 +65,3 @@ int main() ## 参照 - - diff --git a/reference/random/exponential_distribution.md b/reference/random/exponential_distribution.md index 3382371064..7adbe2fb1c 100644 --- a/reference/random/exponential_distribution.md +++ b/reference/random/exponential_distribution.md @@ -189,4 +189,3 @@ Phone call after 2.60918 minute wait - [指数分布 - NtRand](http://www.ntrand.com/jp/exponential-distribution/) - [指数分布 - 統計学自習ノート](http://aoki2.si.gunma-u.ac.jp/lecture/Bunpu/exponential.html) - [指数分布とポアソン分布のいけない関係](http://www.slideshare.net/teramonagi/ss-11296227) - diff --git a/reference/random/exponential_distribution/lambda.md b/reference/random/exponential_distribution/lambda.md index cff3e4234a..7776ee7713 100644 --- a/reference/random/exponential_distribution/lambda.md +++ b/reference/random/exponential_distribution/lambda.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/exponential_distribution/max.md b/reference/random/exponential_distribution/max.md index 2a1ef5416f..0cd3d0a46e 100644 --- a/reference/random/exponential_distribution/max.md +++ b/reference/random/exponential_distribution/max.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/exponential_distribution/min.md b/reference/random/exponential_distribution/min.md index 00ece21ce9..5ff5bd298d 100644 --- a/reference/random/exponential_distribution/min.md +++ b/reference/random/exponential_distribution/min.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/exponential_distribution/op_equal.md b/reference/random/exponential_distribution/op_equal.md index 67899eb921..e0d771f61b 100644 --- a/reference/random/exponential_distribution/op_equal.md +++ b/reference/random/exponential_distribution/op_equal.md @@ -61,5 +61,3 @@ equal ## 参照 - - diff --git a/reference/random/exponential_distribution/op_istream.md b/reference/random/exponential_distribution/op_istream.md index 36cf601bba..abfbc97b9a 100644 --- a/reference/random/exponential_distribution/op_istream.md +++ b/reference/random/exponential_distribution/op_istream.md @@ -79,5 +79,3 @@ int main() ## 参照 - - diff --git a/reference/random/exponential_distribution/op_not_equal.md b/reference/random/exponential_distribution/op_not_equal.md index a02b57ea0d..c46b6158ad 100644 --- a/reference/random/exponential_distribution/op_not_equal.md +++ b/reference/random/exponential_distribution/op_not_equal.md @@ -61,5 +61,3 @@ not equal ## 参照 - - diff --git a/reference/random/exponential_distribution/op_ostream.md b/reference/random/exponential_distribution/op_ostream.md index 7e517d24c7..075863a877 100644 --- a/reference/random/exponential_distribution/op_ostream.md +++ b/reference/random/exponential_distribution/op_ostream.md @@ -58,5 +58,3 @@ int main() ## 参照 - - diff --git a/reference/random/exponential_distribution/param.md b/reference/random/exponential_distribution/param.md index 9e8c1a98c1..2efa67528a 100644 --- a/reference/random/exponential_distribution/param.md +++ b/reference/random/exponential_distribution/param.md @@ -57,5 +57,3 @@ int main() ## 参照 - - diff --git a/reference/random/exponential_distribution/reset.md b/reference/random/exponential_distribution/reset.md index 21ec39a9dc..51b6b97d67 100644 --- a/reference/random/exponential_distribution/reset.md +++ b/reference/random/exponential_distribution/reset.md @@ -67,5 +67,3 @@ int main() ## 参照 - - diff --git a/reference/random/extreme_value_distribution.md b/reference/random/extreme_value_distribution.md index a1bbe23d7b..3e2219e93b 100644 --- a/reference/random/extreme_value_distribution.md +++ b/reference/random/extreme_value_distribution.md @@ -127,4 +127,3 @@ int main() - [極値分布](https://ja.wikipedia.org/wiki/極値分布) - [一般化極値分布 - MATLAB & Simulink - MathWorks 日本](https://jp.mathworks.com/help/stats/generalized-extreme-value-distribution.html) - [極値分布とその応用に関する研究](http://www.seto.nanzan-u.ac.jp/msie/gr-thesis/ms/2005/osaki/02mm042.pdf) - diff --git a/reference/random/extreme_value_distribution/a.md b/reference/random/extreme_value_distribution/a.md index 3939199c22..4153f7ebb1 100644 --- a/reference/random/extreme_value_distribution/a.md +++ b/reference/random/extreme_value_distribution/a.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/extreme_value_distribution/b.md b/reference/random/extreme_value_distribution/b.md index 5d8ccceb34..b9494d5660 100644 --- a/reference/random/extreme_value_distribution/b.md +++ b/reference/random/extreme_value_distribution/b.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/extreme_value_distribution/max.md b/reference/random/extreme_value_distribution/max.md index 19aad6fb1b..bacc7fb2b2 100644 --- a/reference/random/extreme_value_distribution/max.md +++ b/reference/random/extreme_value_distribution/max.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/extreme_value_distribution/min.md b/reference/random/extreme_value_distribution/min.md index b1d659adbc..4cc7d99810 100644 --- a/reference/random/extreme_value_distribution/min.md +++ b/reference/random/extreme_value_distribution/min.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/extreme_value_distribution/op_equal.md b/reference/random/extreme_value_distribution/op_equal.md index ca59ba6036..6014fba2f5 100644 --- a/reference/random/extreme_value_distribution/op_equal.md +++ b/reference/random/extreme_value_distribution/op_equal.md @@ -61,5 +61,3 @@ equal ## 参照 - - diff --git a/reference/random/extreme_value_distribution/op_istream.md b/reference/random/extreme_value_distribution/op_istream.md index de3684172e..0cf7b4e489 100644 --- a/reference/random/extreme_value_distribution/op_istream.md +++ b/reference/random/extreme_value_distribution/op_istream.md @@ -79,5 +79,3 @@ int main() ## 参照 - - diff --git a/reference/random/extreme_value_distribution/op_not_equal.md b/reference/random/extreme_value_distribution/op_not_equal.md index 12325571b5..d6c74c4e45 100644 --- a/reference/random/extreme_value_distribution/op_not_equal.md +++ b/reference/random/extreme_value_distribution/op_not_equal.md @@ -61,5 +61,3 @@ not equal ## 参照 - - diff --git a/reference/random/extreme_value_distribution/op_ostream.md b/reference/random/extreme_value_distribution/op_ostream.md index b6f192003f..1299afbf20 100644 --- a/reference/random/extreme_value_distribution/op_ostream.md +++ b/reference/random/extreme_value_distribution/op_ostream.md @@ -58,5 +58,3 @@ int main() ## 参照 - - diff --git a/reference/random/extreme_value_distribution/param.md b/reference/random/extreme_value_distribution/param.md index 0688b3467c..2f6b2175ad 100644 --- a/reference/random/extreme_value_distribution/param.md +++ b/reference/random/extreme_value_distribution/param.md @@ -57,5 +57,3 @@ int main() ## 参照 - - diff --git a/reference/random/extreme_value_distribution/reset.md b/reference/random/extreme_value_distribution/reset.md index 6336a6c003..5acfaf50f9 100644 --- a/reference/random/extreme_value_distribution/reset.md +++ b/reference/random/extreme_value_distribution/reset.md @@ -67,5 +67,3 @@ int main() ## 参照 - - diff --git a/reference/random/fisher_f_distribution.md b/reference/random/fisher_f_distribution.md index fe65c52618..ebb73aa678 100644 --- a/reference/random/fisher_f_distribution.md +++ b/reference/random/fisher_f_distribution.md @@ -119,4 +119,3 @@ int main() ### 参考 - [F分布 - Wikipedia](https://ja.wikipedia.org/wiki/F%E5%88%86%E5%B8%83) - [第9回 カイ二乗分布とF分布](http://www.ipc.shimane-u.ac.jp/food/kobayasi/biometry9_2011.html) - diff --git a/reference/random/fisher_f_distribution/m.md b/reference/random/fisher_f_distribution/m.md index b8b482fe69..abaa2141b2 100644 --- a/reference/random/fisher_f_distribution/m.md +++ b/reference/random/fisher_f_distribution/m.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/fisher_f_distribution/max.md b/reference/random/fisher_f_distribution/max.md index 91524b02c4..81a688d22a 100644 --- a/reference/random/fisher_f_distribution/max.md +++ b/reference/random/fisher_f_distribution/max.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/fisher_f_distribution/min.md b/reference/random/fisher_f_distribution/min.md index 81263d10ea..c766ff745e 100644 --- a/reference/random/fisher_f_distribution/min.md +++ b/reference/random/fisher_f_distribution/min.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/fisher_f_distribution/n.md b/reference/random/fisher_f_distribution/n.md index 815ca72a47..7771ac50a5 100644 --- a/reference/random/fisher_f_distribution/n.md +++ b/reference/random/fisher_f_distribution/n.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/fisher_f_distribution/op_equal.md b/reference/random/fisher_f_distribution/op_equal.md index a529d5e43f..a48af34266 100644 --- a/reference/random/fisher_f_distribution/op_equal.md +++ b/reference/random/fisher_f_distribution/op_equal.md @@ -61,5 +61,3 @@ equal ## 参照 - - diff --git a/reference/random/fisher_f_distribution/op_istream.md b/reference/random/fisher_f_distribution/op_istream.md index de311e8881..9a88c057a4 100644 --- a/reference/random/fisher_f_distribution/op_istream.md +++ b/reference/random/fisher_f_distribution/op_istream.md @@ -79,5 +79,3 @@ int main() ## 参照 - - diff --git a/reference/random/fisher_f_distribution/op_not_equal.md b/reference/random/fisher_f_distribution/op_not_equal.md index aa9711cdc3..5bdf470ef6 100644 --- a/reference/random/fisher_f_distribution/op_not_equal.md +++ b/reference/random/fisher_f_distribution/op_not_equal.md @@ -61,5 +61,3 @@ not equal ## 参照 - - diff --git a/reference/random/fisher_f_distribution/op_ostream.md b/reference/random/fisher_f_distribution/op_ostream.md index fb7c23c1b7..c7a880f3ee 100644 --- a/reference/random/fisher_f_distribution/op_ostream.md +++ b/reference/random/fisher_f_distribution/op_ostream.md @@ -58,5 +58,3 @@ int main() ## 参照 - - diff --git a/reference/random/fisher_f_distribution/param.md b/reference/random/fisher_f_distribution/param.md index 7b44b207cc..2455057467 100644 --- a/reference/random/fisher_f_distribution/param.md +++ b/reference/random/fisher_f_distribution/param.md @@ -57,5 +57,3 @@ int main() ## 参照 - - diff --git a/reference/random/fisher_f_distribution/reset.md b/reference/random/fisher_f_distribution/reset.md index 0060b3b390..7f5ddeb87c 100644 --- a/reference/random/fisher_f_distribution/reset.md +++ b/reference/random/fisher_f_distribution/reset.md @@ -67,5 +67,3 @@ int main() ## 参照 - - diff --git a/reference/random/gamma_distribution.md b/reference/random/gamma_distribution.md index cbcf21a88c..24d7c11a1a 100644 --- a/reference/random/gamma_distribution.md +++ b/reference/random/gamma_distribution.md @@ -124,4 +124,3 @@ int main() ### 参考 - [ガンマ分布 - Wikipedia](https://ja.wikipedia.org/wiki/ガンマ分布) - diff --git a/reference/random/gamma_distribution/alpha.md b/reference/random/gamma_distribution/alpha.md index ff4d124760..fb82e4d41f 100644 --- a/reference/random/gamma_distribution/alpha.md +++ b/reference/random/gamma_distribution/alpha.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/gamma_distribution/beta.md b/reference/random/gamma_distribution/beta.md index 2db64bb55d..ad2abebfd2 100644 --- a/reference/random/gamma_distribution/beta.md +++ b/reference/random/gamma_distribution/beta.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/gamma_distribution/max.md b/reference/random/gamma_distribution/max.md index 85f14e1f51..e2b442df9c 100644 --- a/reference/random/gamma_distribution/max.md +++ b/reference/random/gamma_distribution/max.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/gamma_distribution/min.md b/reference/random/gamma_distribution/min.md index faeaece8d1..7c63a2d04b 100644 --- a/reference/random/gamma_distribution/min.md +++ b/reference/random/gamma_distribution/min.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/gamma_distribution/op_equal.md b/reference/random/gamma_distribution/op_equal.md index e53949b678..a8d29b3b18 100644 --- a/reference/random/gamma_distribution/op_equal.md +++ b/reference/random/gamma_distribution/op_equal.md @@ -61,5 +61,3 @@ equal ## 参照 - - diff --git a/reference/random/gamma_distribution/op_istream.md b/reference/random/gamma_distribution/op_istream.md index 018bbd53d0..06133ebe6d 100644 --- a/reference/random/gamma_distribution/op_istream.md +++ b/reference/random/gamma_distribution/op_istream.md @@ -79,5 +79,3 @@ int main() ## 参照 - - diff --git a/reference/random/gamma_distribution/op_not_equal.md b/reference/random/gamma_distribution/op_not_equal.md index eab9b304b4..d5ad6b5cac 100644 --- a/reference/random/gamma_distribution/op_not_equal.md +++ b/reference/random/gamma_distribution/op_not_equal.md @@ -61,5 +61,3 @@ not equal ## 参照 - - diff --git a/reference/random/gamma_distribution/op_ostream.md b/reference/random/gamma_distribution/op_ostream.md index bba51b012a..a24dac0db2 100644 --- a/reference/random/gamma_distribution/op_ostream.md +++ b/reference/random/gamma_distribution/op_ostream.md @@ -58,5 +58,3 @@ int main() ## 参照 - - diff --git a/reference/random/gamma_distribution/param.md b/reference/random/gamma_distribution/param.md index be41e703c7..ac1fcdb6dd 100644 --- a/reference/random/gamma_distribution/param.md +++ b/reference/random/gamma_distribution/param.md @@ -57,5 +57,3 @@ int main() ## 参照 - - diff --git a/reference/random/gamma_distribution/reset.md b/reference/random/gamma_distribution/reset.md index 0fdf47216d..7aae2df6c1 100644 --- a/reference/random/gamma_distribution/reset.md +++ b/reference/random/gamma_distribution/reset.md @@ -67,5 +67,3 @@ int main() ## 参照 - - diff --git a/reference/random/geometric_distribution.md b/reference/random/geometric_distribution.md index 9a95ab1a3b..54924377ad 100644 --- a/reference/random/geometric_distribution.md +++ b/reference/random/geometric_distribution.md @@ -114,4 +114,3 @@ int main() ## 参照 - [幾何分布 - Wikipedia](https://ja.wikipedia.org/wiki/幾何分布) - diff --git a/reference/random/geometric_distribution/max.md b/reference/random/geometric_distribution/max.md index 7ebea6c001..06713abae6 100644 --- a/reference/random/geometric_distribution/max.md +++ b/reference/random/geometric_distribution/max.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/geometric_distribution/min.md b/reference/random/geometric_distribution/min.md index d0873eb698..5cb0138121 100644 --- a/reference/random/geometric_distribution/min.md +++ b/reference/random/geometric_distribution/min.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/geometric_distribution/op_equal.md b/reference/random/geometric_distribution/op_equal.md index be52686f44..0203975461 100644 --- a/reference/random/geometric_distribution/op_equal.md +++ b/reference/random/geometric_distribution/op_equal.md @@ -61,5 +61,3 @@ equal ## 参照 - - diff --git a/reference/random/geometric_distribution/op_istream.md b/reference/random/geometric_distribution/op_istream.md index d97333b4f7..69488e2672 100644 --- a/reference/random/geometric_distribution/op_istream.md +++ b/reference/random/geometric_distribution/op_istream.md @@ -79,5 +79,3 @@ int main() ## 参照 - - diff --git a/reference/random/geometric_distribution/op_not_equal.md b/reference/random/geometric_distribution/op_not_equal.md index d5b8d212d5..ad60a3b878 100644 --- a/reference/random/geometric_distribution/op_not_equal.md +++ b/reference/random/geometric_distribution/op_not_equal.md @@ -61,5 +61,3 @@ not equal ## 参照 - - diff --git a/reference/random/geometric_distribution/op_ostream.md b/reference/random/geometric_distribution/op_ostream.md index 1c1f32d621..cc0eefa77a 100644 --- a/reference/random/geometric_distribution/op_ostream.md +++ b/reference/random/geometric_distribution/op_ostream.md @@ -58,5 +58,3 @@ int main() ## 参照 - - diff --git a/reference/random/geometric_distribution/p.md b/reference/random/geometric_distribution/p.md index cfa7e935ff..fde18bbf85 100644 --- a/reference/random/geometric_distribution/p.md +++ b/reference/random/geometric_distribution/p.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/geometric_distribution/param.md b/reference/random/geometric_distribution/param.md index ea774a3eea..094151f842 100644 --- a/reference/random/geometric_distribution/param.md +++ b/reference/random/geometric_distribution/param.md @@ -57,5 +57,3 @@ int main() ## 参照 - - diff --git a/reference/random/geometric_distribution/reset.md b/reference/random/geometric_distribution/reset.md index 59e031c108..1092dde648 100644 --- a/reference/random/geometric_distribution/reset.md +++ b/reference/random/geometric_distribution/reset.md @@ -67,5 +67,3 @@ int main() ## 参照 - - diff --git a/reference/random/independent_bits_engine.md b/reference/random/independent_bits_engine.md index 409f32022b..44a4bebcf9 100644 --- a/reference/random/independent_bits_engine.md +++ b/reference/random/independent_bits_engine.md @@ -121,4 +121,3 @@ int main() - [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): - [Visual C++](/implementation.md#visual_cpp): - diff --git a/reference/random/independent_bits_engine/base.md b/reference/random/independent_bits_engine/base.md index 7a2e63056c..7c85326bb8 100644 --- a/reference/random/independent_bits_engine/base.md +++ b/reference/random/independent_bits_engine/base.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/independent_bits_engine/discard.md b/reference/random/independent_bits_engine/discard.md index 75a61b40c6..dc910590d3 100644 --- a/reference/random/independent_bits_engine/discard.md +++ b/reference/random/independent_bits_engine/discard.md @@ -78,5 +78,3 @@ int main() ## 参照 - - diff --git a/reference/random/independent_bits_engine/max.md b/reference/random/independent_bits_engine/max.md index 24ba90e02e..2c77eec017 100644 --- a/reference/random/independent_bits_engine/max.md +++ b/reference/random/independent_bits_engine/max.md @@ -53,5 +53,3 @@ int main() ## 参照 - - diff --git a/reference/random/independent_bits_engine/min.md b/reference/random/independent_bits_engine/min.md index a6b7e72803..431eaf912c 100644 --- a/reference/random/independent_bits_engine/min.md +++ b/reference/random/independent_bits_engine/min.md @@ -53,5 +53,3 @@ int main() ## 参照 - - diff --git a/reference/random/independent_bits_engine/op_call.md b/reference/random/independent_bits_engine/op_call.md index 3563a7d440..718848f23a 100644 --- a/reference/random/independent_bits_engine/op_call.md +++ b/reference/random/independent_bits_engine/op_call.md @@ -72,5 +72,3 @@ int main() ## 参照 - - diff --git a/reference/random/independent_bits_engine/op_constructor.md b/reference/random/independent_bits_engine/op_constructor.md index 47fc9cf088..6c8fa75d42 100644 --- a/reference/random/independent_bits_engine/op_constructor.md +++ b/reference/random/independent_bits_engine/op_constructor.md @@ -119,5 +119,3 @@ int main() ## 参照 - - diff --git a/reference/random/independent_bits_engine/op_equal.md b/reference/random/independent_bits_engine/op_equal.md index b81e346f97..12b9cd40c6 100644 --- a/reference/random/independent_bits_engine/op_equal.md +++ b/reference/random/independent_bits_engine/op_equal.md @@ -64,5 +64,3 @@ equal ## 参照 - - diff --git a/reference/random/independent_bits_engine/op_istream.md b/reference/random/independent_bits_engine/op_istream.md index e657f3fa6b..6ad7e3b917 100644 --- a/reference/random/independent_bits_engine/op_istream.md +++ b/reference/random/independent_bits_engine/op_istream.md @@ -84,5 +84,3 @@ int main() ## 参照 - - diff --git a/reference/random/independent_bits_engine/op_not_equal.md b/reference/random/independent_bits_engine/op_not_equal.md index d21c94f403..67cfd71ada 100644 --- a/reference/random/independent_bits_engine/op_not_equal.md +++ b/reference/random/independent_bits_engine/op_not_equal.md @@ -66,5 +66,3 @@ not equal ## 参照 - - diff --git a/reference/random/independent_bits_engine/op_ostream.md b/reference/random/independent_bits_engine/op_ostream.md index 84c5bcf995..31710c1e00 100644 --- a/reference/random/independent_bits_engine/op_ostream.md +++ b/reference/random/independent_bits_engine/op_ostream.md @@ -61,5 +61,3 @@ int main() ## 参照 - - diff --git a/reference/random/independent_bits_engine/seed.md b/reference/random/independent_bits_engine/seed.md index adccc5fee3..3299c02c8f 100644 --- a/reference/random/independent_bits_engine/seed.md +++ b/reference/random/independent_bits_engine/seed.md @@ -112,5 +112,3 @@ int main() ## 参照 - - diff --git a/reference/random/knuth_b.md b/reference/random/knuth_b.md index 01c52845be..784b408adc 100644 --- a/reference/random/knuth_b.md +++ b/reference/random/knuth_b.md @@ -98,4 +98,3 @@ int main() ## 参照 - [N1933 Improvements to TR1's Facility for Random Number Generation](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1933.pdf) - diff --git a/reference/random/linear_congruential_engine/discard.md b/reference/random/linear_congruential_engine/discard.md index c4ab3fe416..219bb706cb 100644 --- a/reference/random/linear_congruential_engine/discard.md +++ b/reference/random/linear_congruential_engine/discard.md @@ -78,5 +78,3 @@ int main() ## 参照 - - diff --git a/reference/random/linear_congruential_engine/max.md b/reference/random/linear_congruential_engine/max.md index b7c8d8decc..2df0ab23d3 100644 --- a/reference/random/linear_congruential_engine/max.md +++ b/reference/random/linear_congruential_engine/max.md @@ -52,5 +52,3 @@ int main() ## 参照 - - diff --git a/reference/random/linear_congruential_engine/min.md b/reference/random/linear_congruential_engine/min.md index ddf263818f..26685b911c 100644 --- a/reference/random/linear_congruential_engine/min.md +++ b/reference/random/linear_congruential_engine/min.md @@ -52,5 +52,3 @@ int main() ## 参照 - - diff --git a/reference/random/linear_congruential_engine/op_call.md b/reference/random/linear_congruential_engine/op_call.md index e2adc968ce..0c0d2bd820 100644 --- a/reference/random/linear_congruential_engine/op_call.md +++ b/reference/random/linear_congruential_engine/op_call.md @@ -72,5 +72,3 @@ int main() ## 参照 - - diff --git a/reference/random/linear_congruential_engine/op_equal.md b/reference/random/linear_congruential_engine/op_equal.md index 02ab8d7aa4..32bc7e6ee3 100644 --- a/reference/random/linear_congruential_engine/op_equal.md +++ b/reference/random/linear_congruential_engine/op_equal.md @@ -62,5 +62,3 @@ equal ## 参照 - - diff --git a/reference/random/linear_congruential_engine/op_istream.md b/reference/random/linear_congruential_engine/op_istream.md index 5c9ba054c5..50660633a4 100644 --- a/reference/random/linear_congruential_engine/op_istream.md +++ b/reference/random/linear_congruential_engine/op_istream.md @@ -82,5 +82,3 @@ int main() ## 参照 - - diff --git a/reference/random/linear_congruential_engine/op_not_equal.md b/reference/random/linear_congruential_engine/op_not_equal.md index c13d6e8b04..20515079e1 100644 --- a/reference/random/linear_congruential_engine/op_not_equal.md +++ b/reference/random/linear_congruential_engine/op_not_equal.md @@ -64,5 +64,3 @@ not equal ## 参照 - - diff --git a/reference/random/linear_congruential_engine/op_ostream.md b/reference/random/linear_congruential_engine/op_ostream.md index b1b739763e..0c656ee3f7 100644 --- a/reference/random/linear_congruential_engine/op_ostream.md +++ b/reference/random/linear_congruential_engine/op_ostream.md @@ -61,5 +61,3 @@ int main() ## 参照 - - diff --git a/reference/random/linear_congruential_engine/seed.md b/reference/random/linear_congruential_engine/seed.md index 2a60e7f637..811b0535dc 100644 --- a/reference/random/linear_congruential_engine/seed.md +++ b/reference/random/linear_congruential_engine/seed.md @@ -107,5 +107,3 @@ int main() ## 参照 - - diff --git a/reference/random/lognormal_distribution/m.md b/reference/random/lognormal_distribution/m.md index 0d5dc6a1a6..17f4fce0ae 100644 --- a/reference/random/lognormal_distribution/m.md +++ b/reference/random/lognormal_distribution/m.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/lognormal_distribution/max.md b/reference/random/lognormal_distribution/max.md index 6a7ee893b5..64535b6fc3 100644 --- a/reference/random/lognormal_distribution/max.md +++ b/reference/random/lognormal_distribution/max.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/lognormal_distribution/min.md b/reference/random/lognormal_distribution/min.md index 1d45fddafc..d85a16d243 100644 --- a/reference/random/lognormal_distribution/min.md +++ b/reference/random/lognormal_distribution/min.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/lognormal_distribution/op_equal.md b/reference/random/lognormal_distribution/op_equal.md index 8e0c9ecb6f..7aa0a9bcc5 100644 --- a/reference/random/lognormal_distribution/op_equal.md +++ b/reference/random/lognormal_distribution/op_equal.md @@ -61,5 +61,3 @@ equal ## 参照 - - diff --git a/reference/random/lognormal_distribution/op_istream.md b/reference/random/lognormal_distribution/op_istream.md index 73a4be9083..3ca8f51de8 100644 --- a/reference/random/lognormal_distribution/op_istream.md +++ b/reference/random/lognormal_distribution/op_istream.md @@ -79,5 +79,3 @@ int main() ## 参照 - - diff --git a/reference/random/lognormal_distribution/op_not_equal.md b/reference/random/lognormal_distribution/op_not_equal.md index 40e739d5b0..aeaf29a474 100644 --- a/reference/random/lognormal_distribution/op_not_equal.md +++ b/reference/random/lognormal_distribution/op_not_equal.md @@ -61,5 +61,3 @@ not equal ## 参照 - - diff --git a/reference/random/lognormal_distribution/op_ostream.md b/reference/random/lognormal_distribution/op_ostream.md index 58ad07ef04..cb646edd27 100644 --- a/reference/random/lognormal_distribution/op_ostream.md +++ b/reference/random/lognormal_distribution/op_ostream.md @@ -58,5 +58,3 @@ int main() ## 参照 - - diff --git a/reference/random/lognormal_distribution/param.md b/reference/random/lognormal_distribution/param.md index ea0aaacc4a..8ab55ffdc3 100644 --- a/reference/random/lognormal_distribution/param.md +++ b/reference/random/lognormal_distribution/param.md @@ -57,5 +57,3 @@ int main() ## 参照 - - diff --git a/reference/random/lognormal_distribution/reset.md b/reference/random/lognormal_distribution/reset.md index 879fba35ea..20dd66b398 100644 --- a/reference/random/lognormal_distribution/reset.md +++ b/reference/random/lognormal_distribution/reset.md @@ -71,5 +71,3 @@ int main() ## 参照 - - diff --git a/reference/random/lognormal_distribution/s.md b/reference/random/lognormal_distribution/s.md index c938db0491..9a1a9058e3 100644 --- a/reference/random/lognormal_distribution/s.md +++ b/reference/random/lognormal_distribution/s.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/mersenne_twister_engine.md b/reference/random/mersenne_twister_engine.md index 503a6668f7..4f9fb71ade 100644 --- a/reference/random/mersenne_twister_engine.md +++ b/reference/random/mersenne_twister_engine.md @@ -173,4 +173,3 @@ int main() * [Mersenne Twister Home Page](http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/mt.html) * [メルセンヌ・ツイスタ - Wikipedia](https://ja.wikipedia.org/wiki/メルセンヌ・ツイスタ) * GCC(libstdc++) 4.8以降では、``ヘッダに、SSE最適化されたメルセンヌ・ツイスターである`simd_fast_mersenne_twister_engine`クラスが実装されている - diff --git a/reference/random/mersenne_twister_engine/discard.md b/reference/random/mersenne_twister_engine/discard.md index 8d8d888d28..884b929190 100644 --- a/reference/random/mersenne_twister_engine/discard.md +++ b/reference/random/mersenne_twister_engine/discard.md @@ -77,5 +77,3 @@ int main() ## 参照 - - diff --git a/reference/random/mersenne_twister_engine/max.md b/reference/random/mersenne_twister_engine/max.md index 2e249ac510..8c8e44d93a 100644 --- a/reference/random/mersenne_twister_engine/max.md +++ b/reference/random/mersenne_twister_engine/max.md @@ -51,5 +51,3 @@ int main() ## 参照 - - diff --git a/reference/random/mersenne_twister_engine/min.md b/reference/random/mersenne_twister_engine/min.md index d8f2628d2c..3c64fbf713 100644 --- a/reference/random/mersenne_twister_engine/min.md +++ b/reference/random/mersenne_twister_engine/min.md @@ -51,5 +51,3 @@ int main() ## 参照 - - diff --git a/reference/random/mersenne_twister_engine/op_call.md b/reference/random/mersenne_twister_engine/op_call.md index 56ccbc576a..a7fad493e7 100644 --- a/reference/random/mersenne_twister_engine/op_call.md +++ b/reference/random/mersenne_twister_engine/op_call.md @@ -71,5 +71,3 @@ int main() ## 参照 - - diff --git a/reference/random/mersenne_twister_engine/op_equal.md b/reference/random/mersenne_twister_engine/op_equal.md index eae86854df..252bedb3cd 100644 --- a/reference/random/mersenne_twister_engine/op_equal.md +++ b/reference/random/mersenne_twister_engine/op_equal.md @@ -64,5 +64,3 @@ equal ## 参照 - - diff --git a/reference/random/mersenne_twister_engine/op_istream.md b/reference/random/mersenne_twister_engine/op_istream.md index 4efe16d6fd..249173bcd9 100644 --- a/reference/random/mersenne_twister_engine/op_istream.md +++ b/reference/random/mersenne_twister_engine/op_istream.md @@ -84,5 +84,3 @@ int main() ## 参照 - - diff --git a/reference/random/mersenne_twister_engine/op_not_equal.md b/reference/random/mersenne_twister_engine/op_not_equal.md index e01606c65b..a1a9fff148 100644 --- a/reference/random/mersenne_twister_engine/op_not_equal.md +++ b/reference/random/mersenne_twister_engine/op_not_equal.md @@ -66,5 +66,3 @@ not equal ## 参照 - - diff --git a/reference/random/mersenne_twister_engine/op_ostream.md b/reference/random/mersenne_twister_engine/op_ostream.md index 5265f447a2..985a7c307c 100644 --- a/reference/random/mersenne_twister_engine/op_ostream.md +++ b/reference/random/mersenne_twister_engine/op_ostream.md @@ -66,5 +66,3 @@ GCC(libstdc++) では、出力が誤っている。(C++ 標準では状態の ## 参照 - - diff --git a/reference/random/mersenne_twister_engine/seed.md b/reference/random/mersenne_twister_engine/seed.md index f1d9f6daa7..49a3cc9baf 100644 --- a/reference/random/mersenne_twister_engine/seed.md +++ b/reference/random/mersenne_twister_engine/seed.md @@ -108,5 +108,3 @@ int main() ## 参照 - - diff --git a/reference/random/minstd_rand.md b/reference/random/minstd_rand.md index dd04f2b15f..45f85e5b0d 100644 --- a/reference/random/minstd_rand.md +++ b/reference/random/minstd_rand.md @@ -114,4 +114,3 @@ int main() - [Lehmer random number generator - Wikipedia](https://en.wikipedia.org/wiki/Lehmer_random_number_generator) - [MINSTD - Classical LSGs](https://web.archive.org/web/20181030204012/http://random.mat.sbg.ac.at/results/karl/server/node4.html#SECTION00042000000000000000) - "Random Number Generators: Good ones are hard to find", Stephen K. Park and Keith W. Miller, Communications of the ACM, Vol. 31, No. 10, October 1988, pp. 1192-1201 - diff --git a/reference/random/minstd_rand0.md b/reference/random/minstd_rand0.md index 35feebaec7..c0d216aa83 100644 --- a/reference/random/minstd_rand0.md +++ b/reference/random/minstd_rand0.md @@ -117,4 +117,3 @@ int main() - [Stephen K. Park and Keith W. Miller (1988). "Random Number Generators: Good Ones Are Hard To Find". Communications of the ACM 31 (10): 1192–1201. doi:10.1145/63039.63042.](http://www.firstpr.com.au/dsp/rand31/p1192-park.pdf) - [MINSTD - Classical LSGs](https://web.archive.org/web/20181030204012/http://random.mat.sbg.ac.at/results/karl/server/node4.html#SECTION00042000000000000000) - A pseudo-random number generator for the System/360, P.A. Lewis, A.S. Goodman, J.M. Miller, IBM Systems Journal, Vol. 8, No. 2, 1969, pp. 136-146 - diff --git a/reference/random/mt19937.md b/reference/random/mt19937.md index f3f68118e6..b685d83ee2 100644 --- a/reference/random/mt19937.md +++ b/reference/random/mt19937.md @@ -103,5 +103,3 @@ int main() - [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - - diff --git a/reference/random/mt19937_64.md b/reference/random/mt19937_64.md index 02984a56eb..ce1063161a 100644 --- a/reference/random/mt19937_64.md +++ b/reference/random/mt19937_64.md @@ -101,5 +101,3 @@ int main() - [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - - diff --git a/reference/random/negative_binomial_distribution.md b/reference/random/negative_binomial_distribution.md index 91516aafd0..6ce54bcded 100644 --- a/reference/random/negative_binomial_distribution.md +++ b/reference/random/negative_binomial_distribution.md @@ -110,5 +110,3 @@ int main() ## 参照 - [負の二項分布 - Wikipedia](https://ja.wikipedia.org/wiki/負の二項分布) - - diff --git a/reference/random/negative_binomial_distribution/k.md b/reference/random/negative_binomial_distribution/k.md index 098b68f494..ae54f1d846 100644 --- a/reference/random/negative_binomial_distribution/k.md +++ b/reference/random/negative_binomial_distribution/k.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/negative_binomial_distribution/max.md b/reference/random/negative_binomial_distribution/max.md index 488416e61d..9f603ba635 100644 --- a/reference/random/negative_binomial_distribution/max.md +++ b/reference/random/negative_binomial_distribution/max.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/negative_binomial_distribution/min.md b/reference/random/negative_binomial_distribution/min.md index 719a6671c0..3566a353d7 100644 --- a/reference/random/negative_binomial_distribution/min.md +++ b/reference/random/negative_binomial_distribution/min.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/negative_binomial_distribution/op_equal.md b/reference/random/negative_binomial_distribution/op_equal.md index e4277689ad..f5df333c7e 100644 --- a/reference/random/negative_binomial_distribution/op_equal.md +++ b/reference/random/negative_binomial_distribution/op_equal.md @@ -61,5 +61,3 @@ equal ## 参照 - - diff --git a/reference/random/negative_binomial_distribution/op_istream.md b/reference/random/negative_binomial_distribution/op_istream.md index b2eaee051b..b22be91133 100644 --- a/reference/random/negative_binomial_distribution/op_istream.md +++ b/reference/random/negative_binomial_distribution/op_istream.md @@ -79,5 +79,3 @@ int main() ## 参照 - - diff --git a/reference/random/negative_binomial_distribution/op_not_equal.md b/reference/random/negative_binomial_distribution/op_not_equal.md index 08be26431b..948eea3e45 100644 --- a/reference/random/negative_binomial_distribution/op_not_equal.md +++ b/reference/random/negative_binomial_distribution/op_not_equal.md @@ -61,5 +61,3 @@ not equal ## 参照 - - diff --git a/reference/random/negative_binomial_distribution/op_ostream.md b/reference/random/negative_binomial_distribution/op_ostream.md index 1c4429fffc..0930e8d846 100644 --- a/reference/random/negative_binomial_distribution/op_ostream.md +++ b/reference/random/negative_binomial_distribution/op_ostream.md @@ -58,5 +58,3 @@ int main() ## 参照 - - diff --git a/reference/random/negative_binomial_distribution/p.md b/reference/random/negative_binomial_distribution/p.md index 43f46fc255..d73b8968c8 100644 --- a/reference/random/negative_binomial_distribution/p.md +++ b/reference/random/negative_binomial_distribution/p.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/negative_binomial_distribution/param.md b/reference/random/negative_binomial_distribution/param.md index f8815a32fc..cc74e6647b 100644 --- a/reference/random/negative_binomial_distribution/param.md +++ b/reference/random/negative_binomial_distribution/param.md @@ -57,5 +57,3 @@ int main() ## 参照 - - diff --git a/reference/random/negative_binomial_distribution/reset.md b/reference/random/negative_binomial_distribution/reset.md index ff484332ec..675a4b3319 100644 --- a/reference/random/negative_binomial_distribution/reset.md +++ b/reference/random/negative_binomial_distribution/reset.md @@ -67,5 +67,3 @@ int main() ## 参照 - - diff --git a/reference/random/normal_distribution.md b/reference/random/normal_distribution.md index 47d04b4b1e..e53c7095ca 100644 --- a/reference/random/normal_distribution.md +++ b/reference/random/normal_distribution.md @@ -130,4 +130,3 @@ int main() - [Ziggurat sampling - Wikipedia](https://en.wikipedia.org/wiki/Ziggurat_algorithm) - Boost 1.56.0以降で、Boost.Randomの`normal_distribution`の実装に使われているアルゴリズム。 - ボックス=ミュラー法やPolar法など他の方式よりも、効率を大幅に改善しており、生成される乱数の精度も良い。 - diff --git a/reference/random/normal_distribution/max.md b/reference/random/normal_distribution/max.md index 471b052fb5..875f36fa5a 100644 --- a/reference/random/normal_distribution/max.md +++ b/reference/random/normal_distribution/max.md @@ -54,5 +54,3 @@ inf ## 参照 - - diff --git a/reference/random/normal_distribution/mean.md b/reference/random/normal_distribution/mean.md index 259e607fce..ea8cb100ac 100644 --- a/reference/random/normal_distribution/mean.md +++ b/reference/random/normal_distribution/mean.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/normal_distribution/min.md b/reference/random/normal_distribution/min.md index c897be9c46..14d62b9a8b 100644 --- a/reference/random/normal_distribution/min.md +++ b/reference/random/normal_distribution/min.md @@ -55,5 +55,3 @@ GCC 4.8.1時点でのlibstdc++の実装では、[`numeric_limits`](/reference/li ## 参照 - - diff --git a/reference/random/normal_distribution/op_equal.md b/reference/random/normal_distribution/op_equal.md index 3085667d8d..ca3684b2f0 100644 --- a/reference/random/normal_distribution/op_equal.md +++ b/reference/random/normal_distribution/op_equal.md @@ -61,5 +61,3 @@ equal ## 参照 - - diff --git a/reference/random/normal_distribution/op_istream.md b/reference/random/normal_distribution/op_istream.md index 83549cf4f7..6c070acc03 100644 --- a/reference/random/normal_distribution/op_istream.md +++ b/reference/random/normal_distribution/op_istream.md @@ -79,5 +79,3 @@ int main() ## 参照 - - diff --git a/reference/random/normal_distribution/op_not_equal.md b/reference/random/normal_distribution/op_not_equal.md index e0a4edfa54..3ccfee9f0c 100644 --- a/reference/random/normal_distribution/op_not_equal.md +++ b/reference/random/normal_distribution/op_not_equal.md @@ -61,5 +61,3 @@ not equal ## 参照 - - diff --git a/reference/random/normal_distribution/op_ostream.md b/reference/random/normal_distribution/op_ostream.md index 61ae6a8899..12289cd177 100644 --- a/reference/random/normal_distribution/op_ostream.md +++ b/reference/random/normal_distribution/op_ostream.md @@ -58,5 +58,3 @@ int main() ## 参照 - - diff --git a/reference/random/normal_distribution/param.md b/reference/random/normal_distribution/param.md index 772718b8a0..499149668b 100644 --- a/reference/random/normal_distribution/param.md +++ b/reference/random/normal_distribution/param.md @@ -57,5 +57,3 @@ int main() ## 参照 - - diff --git a/reference/random/normal_distribution/reset.md b/reference/random/normal_distribution/reset.md index c1f6ef0e8b..fb2771a7a1 100644 --- a/reference/random/normal_distribution/reset.md +++ b/reference/random/normal_distribution/reset.md @@ -71,5 +71,3 @@ int main() ## 参照 - - diff --git a/reference/random/normal_distribution/stddev.md b/reference/random/normal_distribution/stddev.md index 742cb22888..8714aee227 100644 --- a/reference/random/normal_distribution/stddev.md +++ b/reference/random/normal_distribution/stddev.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/philox_engine/discard.md b/reference/random/philox_engine/discard.md index 6a7efd962a..b29bcb9f10 100644 --- a/reference/random/philox_engine/discard.md +++ b/reference/random/philox_engine/discard.md @@ -74,4 +74,3 @@ int main() - [GCC](/implementation.md#gcc): 14 [mark noimpl] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/random/philox_engine/op_equal.md b/reference/random/philox_engine/op_equal.md index 3816b881dd..15d6e9cca5 100644 --- a/reference/random/philox_engine/op_equal.md +++ b/reference/random/philox_engine/op_equal.md @@ -49,4 +49,3 @@ int main() - [GCC](/implementation.md#gcc): 14 [mark noimpl] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/random/philox_engine/op_istream.md b/reference/random/philox_engine/op_istream.md index dae3941356..a72c687e08 100644 --- a/reference/random/philox_engine/op_istream.md +++ b/reference/random/philox_engine/op_istream.md @@ -75,4 +75,3 @@ int main() - [GCC](/implementation.md#gcc): 14 [mark noimpl] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/random/philox_engine/op_ostream.md b/reference/random/philox_engine/op_ostream.md index 3707bc9ef4..899becce8f 100644 --- a/reference/random/philox_engine/op_ostream.md +++ b/reference/random/philox_engine/op_ostream.md @@ -52,4 +52,3 @@ int main() - [GCC](/implementation.md#gcc): 14 [mark noimpl] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/random/piecewise_constant_distribution.md b/reference/random/piecewise_constant_distribution.md index c78ce1736e..8ce154306e 100644 --- a/reference/random/piecewise_constant_distribution.md +++ b/reference/random/piecewise_constant_distribution.md @@ -114,5 +114,3 @@ int main() - [GCC](/implementation.md#gcc): 4.5.3 [mark verified], 4.6.1 [mark verified] - [ICC](/implementation.md#icc): - [Visual C++](/implementation.md#visual_cpp): - - diff --git a/reference/random/piecewise_constant_distribution/densities.md b/reference/random/piecewise_constant_distribution/densities.md index 6d536f11bf..da0137c4cd 100644 --- a/reference/random/piecewise_constant_distribution/densities.md +++ b/reference/random/piecewise_constant_distribution/densities.md @@ -64,5 +64,3 @@ int main() ## 参照 - - diff --git a/reference/random/piecewise_constant_distribution/intervals.md b/reference/random/piecewise_constant_distribution/intervals.md index be218d42cf..8d5c2f07d9 100644 --- a/reference/random/piecewise_constant_distribution/intervals.md +++ b/reference/random/piecewise_constant_distribution/intervals.md @@ -65,5 +65,3 @@ int main() ## 参照 - - diff --git a/reference/random/piecewise_constant_distribution/max.md b/reference/random/piecewise_constant_distribution/max.md index ecddb22660..47b183d150 100644 --- a/reference/random/piecewise_constant_distribution/max.md +++ b/reference/random/piecewise_constant_distribution/max.md @@ -60,5 +60,3 @@ int main() ## 参照 - - diff --git a/reference/random/piecewise_constant_distribution/min.md b/reference/random/piecewise_constant_distribution/min.md index b85df2a6c9..bb99936772 100644 --- a/reference/random/piecewise_constant_distribution/min.md +++ b/reference/random/piecewise_constant_distribution/min.md @@ -60,5 +60,3 @@ int main() ## 参照 - - diff --git a/reference/random/piecewise_constant_distribution/op_constructor.md b/reference/random/piecewise_constant_distribution/op_constructor.md index 1492019dd6..57ae4d8265 100644 --- a/reference/random/piecewise_constant_distribution/op_constructor.md +++ b/reference/random/piecewise_constant_distribution/op_constructor.md @@ -147,5 +147,3 @@ parameter constructor : 0.49003 ## 参照 - - diff --git a/reference/random/piecewise_constant_distribution/op_equal.md b/reference/random/piecewise_constant_distribution/op_equal.md index 1c49ec310f..d6723be7f7 100644 --- a/reference/random/piecewise_constant_distribution/op_equal.md +++ b/reference/random/piecewise_constant_distribution/op_equal.md @@ -80,5 +80,3 @@ equal ## 参照 - - diff --git a/reference/random/piecewise_constant_distribution/op_istream.md b/reference/random/piecewise_constant_distribution/op_istream.md index 007a2da692..e8e38d226b 100644 --- a/reference/random/piecewise_constant_distribution/op_istream.md +++ b/reference/random/piecewise_constant_distribution/op_istream.md @@ -91,5 +91,3 @@ int main() ## 参照 - - diff --git a/reference/random/piecewise_constant_distribution/op_not_equal.md b/reference/random/piecewise_constant_distribution/op_not_equal.md index 786b170047..ca57a353e6 100644 --- a/reference/random/piecewise_constant_distribution/op_not_equal.md +++ b/reference/random/piecewise_constant_distribution/op_not_equal.md @@ -80,5 +80,3 @@ not equal ## 参照 - - diff --git a/reference/random/piecewise_constant_distribution/op_ostream.md b/reference/random/piecewise_constant_distribution/op_ostream.md index d9c1ff8267..a8d0cf494b 100644 --- a/reference/random/piecewise_constant_distribution/op_ostream.md +++ b/reference/random/piecewise_constant_distribution/op_ostream.md @@ -70,5 +70,3 @@ int main() ## 参照 - - diff --git a/reference/random/piecewise_constant_distribution/param.md b/reference/random/piecewise_constant_distribution/param.md index db3610bc7a..67e9aad86c 100644 --- a/reference/random/piecewise_constant_distribution/param.md +++ b/reference/random/piecewise_constant_distribution/param.md @@ -73,5 +73,3 @@ int main() ## 参照 - - diff --git a/reference/random/piecewise_constant_distribution/reset.md b/reference/random/piecewise_constant_distribution/reset.md index 9837caf0a5..ddd9c14c1d 100644 --- a/reference/random/piecewise_constant_distribution/reset.md +++ b/reference/random/piecewise_constant_distribution/reset.md @@ -76,5 +76,3 @@ int main() ## 参照 - - diff --git a/reference/random/piecewise_linear_distribution.md b/reference/random/piecewise_linear_distribution.md index d7c72de145..d42a6e4f30 100644 --- a/reference/random/piecewise_linear_distribution.md +++ b/reference/random/piecewise_linear_distribution.md @@ -114,4 +114,3 @@ int main() - [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): - [Visual C++](/implementation.md#visual_cpp): - diff --git a/reference/random/piecewise_linear_distribution/densities.md b/reference/random/piecewise_linear_distribution/densities.md index fb660c7222..410a90b050 100644 --- a/reference/random/piecewise_linear_distribution/densities.md +++ b/reference/random/piecewise_linear_distribution/densities.md @@ -65,5 +65,3 @@ int main() ## 参照 - - diff --git a/reference/random/piecewise_linear_distribution/intervals.md b/reference/random/piecewise_linear_distribution/intervals.md index 81eb4e7b3b..2c0175af99 100644 --- a/reference/random/piecewise_linear_distribution/intervals.md +++ b/reference/random/piecewise_linear_distribution/intervals.md @@ -65,5 +65,3 @@ int main() ## 参照 - - diff --git a/reference/random/piecewise_linear_distribution/max.md b/reference/random/piecewise_linear_distribution/max.md index b489dd6599..f6e89f2e99 100644 --- a/reference/random/piecewise_linear_distribution/max.md +++ b/reference/random/piecewise_linear_distribution/max.md @@ -60,5 +60,3 @@ int main() ## 参照 - - diff --git a/reference/random/piecewise_linear_distribution/min.md b/reference/random/piecewise_linear_distribution/min.md index dc4c940814..114682b9f9 100644 --- a/reference/random/piecewise_linear_distribution/min.md +++ b/reference/random/piecewise_linear_distribution/min.md @@ -60,5 +60,3 @@ int main() ## 参照 - - diff --git a/reference/random/piecewise_linear_distribution/op_constructor.md b/reference/random/piecewise_linear_distribution/op_constructor.md index 829ab519fb..c7fadeae3d 100644 --- a/reference/random/piecewise_linear_distribution/op_constructor.md +++ b/reference/random/piecewise_linear_distribution/op_constructor.md @@ -149,5 +149,3 @@ parameter constructor : 0.260002 ## 参照 - - diff --git a/reference/random/piecewise_linear_distribution/op_equal.md b/reference/random/piecewise_linear_distribution/op_equal.md index 499f65d11c..208762b72e 100644 --- a/reference/random/piecewise_linear_distribution/op_equal.md +++ b/reference/random/piecewise_linear_distribution/op_equal.md @@ -80,5 +80,3 @@ equal ## 参照 - - diff --git a/reference/random/piecewise_linear_distribution/op_istream.md b/reference/random/piecewise_linear_distribution/op_istream.md index 648fdd746b..abe1b49a41 100644 --- a/reference/random/piecewise_linear_distribution/op_istream.md +++ b/reference/random/piecewise_linear_distribution/op_istream.md @@ -91,5 +91,3 @@ int main() ## 参照 - - diff --git a/reference/random/piecewise_linear_distribution/op_not_equal.md b/reference/random/piecewise_linear_distribution/op_not_equal.md index c638b5cb9f..3c9811ee51 100644 --- a/reference/random/piecewise_linear_distribution/op_not_equal.md +++ b/reference/random/piecewise_linear_distribution/op_not_equal.md @@ -80,5 +80,3 @@ not equal ## 参照 - - diff --git a/reference/random/piecewise_linear_distribution/op_ostream.md b/reference/random/piecewise_linear_distribution/op_ostream.md index 99f3cb3f55..7848173987 100644 --- a/reference/random/piecewise_linear_distribution/op_ostream.md +++ b/reference/random/piecewise_linear_distribution/op_ostream.md @@ -70,5 +70,3 @@ int main() ## 参照 - - diff --git a/reference/random/piecewise_linear_distribution/param.md b/reference/random/piecewise_linear_distribution/param.md index 5f981e4b39..4967f5fec2 100644 --- a/reference/random/piecewise_linear_distribution/param.md +++ b/reference/random/piecewise_linear_distribution/param.md @@ -77,5 +77,3 @@ int main() ## 参照 - - diff --git a/reference/random/piecewise_linear_distribution/reset.md b/reference/random/piecewise_linear_distribution/reset.md index 1eb37982d8..3eaca4a595 100644 --- a/reference/random/piecewise_linear_distribution/reset.md +++ b/reference/random/piecewise_linear_distribution/reset.md @@ -76,5 +76,3 @@ int main() ## 参照 - - diff --git a/reference/random/poisson_distribution.md b/reference/random/poisson_distribution.md index d9c3c52223..c48cbdb5a3 100644 --- a/reference/random/poisson_distribution.md +++ b/reference/random/poisson_distribution.md @@ -167,4 +167,3 @@ Month 12: 1 earthquake(s) - [ポアソン分布 - 統計・データ解析](https://okumuralab.org/~okumura/stat/poisson.html) - [ポアソン分布 - NtRand](http://www.ntrand.com/jp/poisson-distribution/) - [[データ分析]ポアソン分布 ~ 100年に1人の天才は何人現れる?:やさしい確率分布 - @IT](https://atmarkit.itmedia.co.jp/ait/articles/2407/11/news002.html) - diff --git a/reference/random/poisson_distribution/max.md b/reference/random/poisson_distribution/max.md index 7734e9da11..f3d71d960f 100644 --- a/reference/random/poisson_distribution/max.md +++ b/reference/random/poisson_distribution/max.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/poisson_distribution/mean.md b/reference/random/poisson_distribution/mean.md index a0c0016c5c..2f7c822690 100644 --- a/reference/random/poisson_distribution/mean.md +++ b/reference/random/poisson_distribution/mean.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/poisson_distribution/min.md b/reference/random/poisson_distribution/min.md index 59e781c9d7..ead8d6c8dd 100644 --- a/reference/random/poisson_distribution/min.md +++ b/reference/random/poisson_distribution/min.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/poisson_distribution/op_equal.md b/reference/random/poisson_distribution/op_equal.md index 1c00c5b7e1..4d637bc3c0 100644 --- a/reference/random/poisson_distribution/op_equal.md +++ b/reference/random/poisson_distribution/op_equal.md @@ -61,5 +61,3 @@ equal ## 参照 - - diff --git a/reference/random/poisson_distribution/op_istream.md b/reference/random/poisson_distribution/op_istream.md index 6f986d2519..b4d18839f1 100644 --- a/reference/random/poisson_distribution/op_istream.md +++ b/reference/random/poisson_distribution/op_istream.md @@ -79,5 +79,3 @@ int main() ## 参照 - - diff --git a/reference/random/poisson_distribution/op_not_equal.md b/reference/random/poisson_distribution/op_not_equal.md index c4e4d8fbb6..1d80cef0f4 100644 --- a/reference/random/poisson_distribution/op_not_equal.md +++ b/reference/random/poisson_distribution/op_not_equal.md @@ -61,5 +61,3 @@ not equal ## 参照 - - diff --git a/reference/random/poisson_distribution/op_ostream.md b/reference/random/poisson_distribution/op_ostream.md index 211427f72d..fedc7bad41 100644 --- a/reference/random/poisson_distribution/op_ostream.md +++ b/reference/random/poisson_distribution/op_ostream.md @@ -58,5 +58,3 @@ int main() ## 参照 - - diff --git a/reference/random/poisson_distribution/param.md b/reference/random/poisson_distribution/param.md index 88608feaf6..be70fe8b6a 100644 --- a/reference/random/poisson_distribution/param.md +++ b/reference/random/poisson_distribution/param.md @@ -57,5 +57,3 @@ int main() ## 参照 - - diff --git a/reference/random/poisson_distribution/reset.md b/reference/random/poisson_distribution/reset.md index 97b9075c30..a46434ca27 100644 --- a/reference/random/poisson_distribution/reset.md +++ b/reference/random/poisson_distribution/reset.md @@ -67,5 +67,3 @@ int main() ## 参照 - - diff --git a/reference/random/random_device.md b/reference/random/random_device.md index 9d3862957e..e09ae65cf4 100644 --- a/reference/random/random_device.md +++ b/reference/random/random_device.md @@ -329,4 +329,3 @@ int main() - [gccをwindowsで使うならstd::random_deviceを使ってはいけない - Qiita](http://qiita.com/nanashi/items/f94b78398a6c79d939e1) - [MSC30-C. 擬似乱数の生成に rand() 関数を使用しない](https://www.jpcert.or.jp/sc-rules/c-msc30-c.html) - `CryptGenRandom`のエントロピー源(2005年時点): [Cryptographically Secure Random number on Windows without using CryptoAPI – Michael Howard's Web Log](https://blogs.msdn.microsoft.com/michael_howard/2005/01/14/cryptographically-secure-random-number-on-windows-without-using-cryptoapi/#div-comment-5543) - diff --git a/reference/random/random_device/max.md b/reference/random/random_device/max.md index c9afd1a423..5d3ec61e0e 100644 --- a/reference/random/random_device/max.md +++ b/reference/random/random_device/max.md @@ -51,5 +51,3 @@ int main() ## 参照 - - diff --git a/reference/random/random_device/min.md b/reference/random/random_device/min.md index f3e61b2123..5b010411a9 100644 --- a/reference/random/random_device/min.md +++ b/reference/random/random_device/min.md @@ -51,5 +51,3 @@ int main() ## 参照 - - diff --git a/reference/random/random_device/op_call.md b/reference/random/random_device/op_call.md index 2b43dc2f11..6773a503f0 100644 --- a/reference/random/random_device/op_call.md +++ b/reference/random/random_device/op_call.md @@ -67,5 +67,3 @@ int main() ## 参照 - - diff --git a/reference/random/seed_seq.md b/reference/random/seed_seq.md index c4b0f60a7c..863f7a0c9d 100644 --- a/reference/random/seed_seq.md +++ b/reference/random/seed_seq.md @@ -118,4 +118,3 @@ int main() ## 参照 * [Does std::mt19937 require warmup? - StackOverflow](http://stackoverflow.com/questions/15509270/does-stdmt19937-require-warmup) * [Mersenne twister warm up vs. reproducibility](http://stackoverflow.com/questions/16078794/mersenne-twister-warm-up-vs-reproducibility) - diff --git a/reference/random/seed_seq/generate.md b/reference/random/seed_seq/generate.md index 1c490fb419..a5398832bf 100644 --- a/reference/random/seed_seq/generate.md +++ b/reference/random/seed_seq/generate.md @@ -111,5 +111,3 @@ int main() ## 参照 - [LWG Issue 2180. Exceptions from `std::seed_seq` operations](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2180) - - diff --git a/reference/random/seed_seq/op_constructor.md b/reference/random/seed_seq/op_constructor.md index 9fc5e8fccd..759b9fe79e 100644 --- a/reference/random/seed_seq/op_constructor.md +++ b/reference/random/seed_seq/op_constructor.md @@ -137,4 +137,3 @@ int main() ## 参照 - [LWG Issue 2180. Exceptions from `std::seed_seq` operations](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2180) - diff --git a/reference/random/seed_seq/param.md b/reference/random/seed_seq/param.md index 3db7443984..46a12d41a3 100644 --- a/reference/random/seed_seq/param.md +++ b/reference/random/seed_seq/param.md @@ -85,5 +85,3 @@ int main() ## 参照 - [LWG Issue 2180. Exceptions from `std::seed_seq` operations](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2180) - - diff --git a/reference/random/seed_seq/size.md b/reference/random/seed_seq/size.md index 4899e62435..cd7f640095 100644 --- a/reference/random/seed_seq/size.md +++ b/reference/random/seed_seq/size.md @@ -54,5 +54,3 @@ int main() ## 参照 - [LWG Issue 2180. Exceptions from `std::seed_seq` operations](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2180) - - diff --git a/reference/random/shuffle_order_engine.md b/reference/random/shuffle_order_engine.md index 3f05337d2a..f6644153e8 100644 --- a/reference/random/shuffle_order_engine.md +++ b/reference/random/shuffle_order_engine.md @@ -162,4 +162,3 @@ int main() - [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): - [Visual C++](/implementation.md#visual_cpp): - diff --git a/reference/random/shuffle_order_engine/base.md b/reference/random/shuffle_order_engine/base.md index bf7aa2649c..37e0c1494d 100644 --- a/reference/random/shuffle_order_engine/base.md +++ b/reference/random/shuffle_order_engine/base.md @@ -50,5 +50,3 @@ int main() ## 参照 - - diff --git a/reference/random/shuffle_order_engine/discard.md b/reference/random/shuffle_order_engine/discard.md index 69f8c4cdc2..cf9971f333 100644 --- a/reference/random/shuffle_order_engine/discard.md +++ b/reference/random/shuffle_order_engine/discard.md @@ -78,5 +78,3 @@ int main() ## 参照 - - diff --git a/reference/random/shuffle_order_engine/max.md b/reference/random/shuffle_order_engine/max.md index f14355a512..d0e35aa2a7 100644 --- a/reference/random/shuffle_order_engine/max.md +++ b/reference/random/shuffle_order_engine/max.md @@ -52,5 +52,3 @@ int main() ## 参照 - - diff --git a/reference/random/shuffle_order_engine/min.md b/reference/random/shuffle_order_engine/min.md index 77700761b2..1d537b517b 100644 --- a/reference/random/shuffle_order_engine/min.md +++ b/reference/random/shuffle_order_engine/min.md @@ -52,5 +52,3 @@ int main() ## 参照 - - diff --git a/reference/random/shuffle_order_engine/op_call.md b/reference/random/shuffle_order_engine/op_call.md index 3149904201..7f583a77e6 100644 --- a/reference/random/shuffle_order_engine/op_call.md +++ b/reference/random/shuffle_order_engine/op_call.md @@ -72,5 +72,3 @@ int main() ## 参照 - - diff --git a/reference/random/shuffle_order_engine/op_constructor.md b/reference/random/shuffle_order_engine/op_constructor.md index b03aa5cdcc..64971bed2f 100644 --- a/reference/random/shuffle_order_engine/op_constructor.md +++ b/reference/random/shuffle_order_engine/op_constructor.md @@ -118,5 +118,3 @@ int main() ## 参照 - - diff --git a/reference/random/shuffle_order_engine/op_equal.md b/reference/random/shuffle_order_engine/op_equal.md index afb282a16d..c7ba57a21f 100644 --- a/reference/random/shuffle_order_engine/op_equal.md +++ b/reference/random/shuffle_order_engine/op_equal.md @@ -62,5 +62,3 @@ equal ## 参照 - - diff --git a/reference/random/shuffle_order_engine/op_istream.md b/reference/random/shuffle_order_engine/op_istream.md index 47617264f7..f8a6389a2c 100644 --- a/reference/random/shuffle_order_engine/op_istream.md +++ b/reference/random/shuffle_order_engine/op_istream.md @@ -82,5 +82,3 @@ int main() ## 参照 - - diff --git a/reference/random/shuffle_order_engine/op_not_equal.md b/reference/random/shuffle_order_engine/op_not_equal.md index b5483c6c89..7f949bdbe7 100644 --- a/reference/random/shuffle_order_engine/op_not_equal.md +++ b/reference/random/shuffle_order_engine/op_not_equal.md @@ -64,5 +64,3 @@ not equal ## 参照 - - diff --git a/reference/random/shuffle_order_engine/op_ostream.md b/reference/random/shuffle_order_engine/op_ostream.md index 62a3d08cea..0b159e18f4 100644 --- a/reference/random/shuffle_order_engine/op_ostream.md +++ b/reference/random/shuffle_order_engine/op_ostream.md @@ -61,5 +61,3 @@ int main() ## 参照 - - diff --git a/reference/random/shuffle_order_engine/seed.md b/reference/random/shuffle_order_engine/seed.md index cbf83f22c3..c52834241f 100644 --- a/reference/random/shuffle_order_engine/seed.md +++ b/reference/random/shuffle_order_engine/seed.md @@ -112,5 +112,3 @@ int main() ## 参照 - - diff --git a/reference/random/student_t_distribution.md b/reference/random/student_t_distribution.md index 18d3e39300..90265d1ac9 100644 --- a/reference/random/student_t_distribution.md +++ b/reference/random/student_t_distribution.md @@ -125,4 +125,3 @@ int main() - [t分布 - Wikipedia](https://ja.wikipedia.org/wiki/T%E5%88%86%E5%B8%83) - [t分布 統計学入門](http://www.tamagaki.com/math/Statistics402.html) - [第8回 t分布とt検定](http://www.ipc.shimane-u.ac.jp/food/kobayasi/biometry8_2011.html) - diff --git a/reference/random/student_t_distribution/max.md b/reference/random/student_t_distribution/max.md index b8a8fc6960..c03008f7ab 100644 --- a/reference/random/student_t_distribution/max.md +++ b/reference/random/student_t_distribution/max.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/student_t_distribution/min.md b/reference/random/student_t_distribution/min.md index 55752454a2..a2791c24ff 100644 --- a/reference/random/student_t_distribution/min.md +++ b/reference/random/student_t_distribution/min.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/student_t_distribution/n.md b/reference/random/student_t_distribution/n.md index bc0675fe33..2fe8ead0cd 100644 --- a/reference/random/student_t_distribution/n.md +++ b/reference/random/student_t_distribution/n.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/student_t_distribution/op_equal.md b/reference/random/student_t_distribution/op_equal.md index d9c9883bc7..a61cb59fd2 100644 --- a/reference/random/student_t_distribution/op_equal.md +++ b/reference/random/student_t_distribution/op_equal.md @@ -61,5 +61,3 @@ equal ## 参照 - - diff --git a/reference/random/student_t_distribution/op_istream.md b/reference/random/student_t_distribution/op_istream.md index 093f2ec5f0..31f65b64a6 100644 --- a/reference/random/student_t_distribution/op_istream.md +++ b/reference/random/student_t_distribution/op_istream.md @@ -79,5 +79,3 @@ int main() ## 参照 - - diff --git a/reference/random/student_t_distribution/op_not_equal.md b/reference/random/student_t_distribution/op_not_equal.md index fb6f605e12..39a394d9a8 100644 --- a/reference/random/student_t_distribution/op_not_equal.md +++ b/reference/random/student_t_distribution/op_not_equal.md @@ -61,5 +61,3 @@ not equal ## 参照 - - diff --git a/reference/random/student_t_distribution/op_ostream.md b/reference/random/student_t_distribution/op_ostream.md index 2c81fbe94c..5b69504879 100644 --- a/reference/random/student_t_distribution/op_ostream.md +++ b/reference/random/student_t_distribution/op_ostream.md @@ -58,5 +58,3 @@ int main() ## 参照 - - diff --git a/reference/random/student_t_distribution/param.md b/reference/random/student_t_distribution/param.md index daf5d4eeaa..dbf67f38a2 100644 --- a/reference/random/student_t_distribution/param.md +++ b/reference/random/student_t_distribution/param.md @@ -57,5 +57,3 @@ int main() ## 参照 - - diff --git a/reference/random/student_t_distribution/reset.md b/reference/random/student_t_distribution/reset.md index b96044c52e..9fa2a35d18 100644 --- a/reference/random/student_t_distribution/reset.md +++ b/reference/random/student_t_distribution/reset.md @@ -67,5 +67,3 @@ int main() ## 参照 - - diff --git a/reference/random/subtract_with_carry_engine/discard.md b/reference/random/subtract_with_carry_engine/discard.md index b65a4fe849..9e9797c09a 100644 --- a/reference/random/subtract_with_carry_engine/discard.md +++ b/reference/random/subtract_with_carry_engine/discard.md @@ -78,5 +78,3 @@ int main() ## 参照 - - diff --git a/reference/random/subtract_with_carry_engine/max.md b/reference/random/subtract_with_carry_engine/max.md index b86b4f363b..cd9de7f76a 100644 --- a/reference/random/subtract_with_carry_engine/max.md +++ b/reference/random/subtract_with_carry_engine/max.md @@ -53,5 +53,3 @@ int main() ## 参照 - - diff --git a/reference/random/subtract_with_carry_engine/min.md b/reference/random/subtract_with_carry_engine/min.md index 65d15734e9..7227813f7e 100644 --- a/reference/random/subtract_with_carry_engine/min.md +++ b/reference/random/subtract_with_carry_engine/min.md @@ -53,5 +53,3 @@ int main() ## 参照 - - diff --git a/reference/random/subtract_with_carry_engine/op_call.md b/reference/random/subtract_with_carry_engine/op_call.md index 7ba00d2385..a8660f85a8 100644 --- a/reference/random/subtract_with_carry_engine/op_call.md +++ b/reference/random/subtract_with_carry_engine/op_call.md @@ -73,5 +73,3 @@ int main() ## 参照 - - diff --git a/reference/random/subtract_with_carry_engine/op_equal.md b/reference/random/subtract_with_carry_engine/op_equal.md index 8a16ef2e5b..0fc8f1abe0 100644 --- a/reference/random/subtract_with_carry_engine/op_equal.md +++ b/reference/random/subtract_with_carry_engine/op_equal.md @@ -62,5 +62,3 @@ equal ## 参照 - - diff --git a/reference/random/subtract_with_carry_engine/op_istream.md b/reference/random/subtract_with_carry_engine/op_istream.md index 3b5a3aed5e..108ea3814d 100644 --- a/reference/random/subtract_with_carry_engine/op_istream.md +++ b/reference/random/subtract_with_carry_engine/op_istream.md @@ -82,5 +82,3 @@ int main() ## 参照 - - diff --git a/reference/random/subtract_with_carry_engine/op_not_equal.md b/reference/random/subtract_with_carry_engine/op_not_equal.md index 08d15e2df7..db2f0cfbfa 100644 --- a/reference/random/subtract_with_carry_engine/op_not_equal.md +++ b/reference/random/subtract_with_carry_engine/op_not_equal.md @@ -64,5 +64,3 @@ not equal ## 参照 - - diff --git a/reference/random/subtract_with_carry_engine/op_ostream.md b/reference/random/subtract_with_carry_engine/op_ostream.md index 7f47a98d76..ca141576e0 100644 --- a/reference/random/subtract_with_carry_engine/op_ostream.md +++ b/reference/random/subtract_with_carry_engine/op_ostream.md @@ -61,5 +61,3 @@ int main() ## 参照 - - diff --git a/reference/random/uniform_int_distribution/a.md b/reference/random/uniform_int_distribution/a.md index 8624377abe..daf953b2df 100644 --- a/reference/random/uniform_int_distribution/a.md +++ b/reference/random/uniform_int_distribution/a.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/uniform_int_distribution/b.md b/reference/random/uniform_int_distribution/b.md index 61399e267a..04b81c199e 100644 --- a/reference/random/uniform_int_distribution/b.md +++ b/reference/random/uniform_int_distribution/b.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/uniform_int_distribution/max.md b/reference/random/uniform_int_distribution/max.md index fe55fa090e..7a44a7ee04 100644 --- a/reference/random/uniform_int_distribution/max.md +++ b/reference/random/uniform_int_distribution/max.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/uniform_int_distribution/min.md b/reference/random/uniform_int_distribution/min.md index 4c16fa5be5..e6faad72cd 100644 --- a/reference/random/uniform_int_distribution/min.md +++ b/reference/random/uniform_int_distribution/min.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/uniform_int_distribution/op_equal.md b/reference/random/uniform_int_distribution/op_equal.md index 83c2765197..89f8a0cb4c 100644 --- a/reference/random/uniform_int_distribution/op_equal.md +++ b/reference/random/uniform_int_distribution/op_equal.md @@ -61,5 +61,3 @@ equal ## 参照 - - diff --git a/reference/random/uniform_int_distribution/op_istream.md b/reference/random/uniform_int_distribution/op_istream.md index bb34b8b44b..109a5ae8fe 100644 --- a/reference/random/uniform_int_distribution/op_istream.md +++ b/reference/random/uniform_int_distribution/op_istream.md @@ -79,5 +79,3 @@ int main() ## 参照 - - diff --git a/reference/random/uniform_int_distribution/op_not_equal.md b/reference/random/uniform_int_distribution/op_not_equal.md index 62702471e3..34bbf50b7d 100644 --- a/reference/random/uniform_int_distribution/op_not_equal.md +++ b/reference/random/uniform_int_distribution/op_not_equal.md @@ -61,5 +61,3 @@ not equal ## 参照 - - diff --git a/reference/random/uniform_int_distribution/op_ostream.md b/reference/random/uniform_int_distribution/op_ostream.md index 1737734d04..f06ad2e8f1 100644 --- a/reference/random/uniform_int_distribution/op_ostream.md +++ b/reference/random/uniform_int_distribution/op_ostream.md @@ -58,5 +58,3 @@ int main() ## 参照 - - diff --git a/reference/random/uniform_int_distribution/param.md b/reference/random/uniform_int_distribution/param.md index f7b3b8c3dd..0f777250e0 100644 --- a/reference/random/uniform_int_distribution/param.md +++ b/reference/random/uniform_int_distribution/param.md @@ -57,5 +57,3 @@ int main() ## 参照 - - diff --git a/reference/random/uniform_int_distribution/reset.md b/reference/random/uniform_int_distribution/reset.md index 18938fd659..9d8d7d2ce0 100644 --- a/reference/random/uniform_int_distribution/reset.md +++ b/reference/random/uniform_int_distribution/reset.md @@ -65,5 +65,3 @@ int main() ## 参照 - - diff --git a/reference/random/uniform_real_distribution.md b/reference/random/uniform_real_distribution.md index cccb1c74e6..cc3e5fe02a 100644 --- a/reference/random/uniform_real_distribution.md +++ b/reference/random/uniform_real_distribution.md @@ -114,7 +114,3 @@ int main() - [GCC](/implementation.md#gcc): 4.7.2 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - - - - diff --git a/reference/random/uniform_real_distribution/a.md b/reference/random/uniform_real_distribution/a.md index 859cb25f1c..29ec042e85 100644 --- a/reference/random/uniform_real_distribution/a.md +++ b/reference/random/uniform_real_distribution/a.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/uniform_real_distribution/b.md b/reference/random/uniform_real_distribution/b.md index ac7e56ea4d..162222d1fd 100644 --- a/reference/random/uniform_real_distribution/b.md +++ b/reference/random/uniform_real_distribution/b.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/uniform_real_distribution/max.md b/reference/random/uniform_real_distribution/max.md index d5df0a9b18..b374eb66a1 100644 --- a/reference/random/uniform_real_distribution/max.md +++ b/reference/random/uniform_real_distribution/max.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/uniform_real_distribution/min.md b/reference/random/uniform_real_distribution/min.md index e2dad07414..949893c437 100644 --- a/reference/random/uniform_real_distribution/min.md +++ b/reference/random/uniform_real_distribution/min.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/uniform_real_distribution/op_equal.md b/reference/random/uniform_real_distribution/op_equal.md index 83e190b036..4c5434e43a 100644 --- a/reference/random/uniform_real_distribution/op_equal.md +++ b/reference/random/uniform_real_distribution/op_equal.md @@ -61,5 +61,3 @@ equal ## 参照 - - diff --git a/reference/random/uniform_real_distribution/op_istream.md b/reference/random/uniform_real_distribution/op_istream.md index ca22f71e77..70b3c7c38f 100644 --- a/reference/random/uniform_real_distribution/op_istream.md +++ b/reference/random/uniform_real_distribution/op_istream.md @@ -79,5 +79,3 @@ int main() ## 参照 - - diff --git a/reference/random/uniform_real_distribution/op_not_equal.md b/reference/random/uniform_real_distribution/op_not_equal.md index bc017b67cd..82fcf1e1b0 100644 --- a/reference/random/uniform_real_distribution/op_not_equal.md +++ b/reference/random/uniform_real_distribution/op_not_equal.md @@ -61,5 +61,3 @@ not equal ## 参照 - - diff --git a/reference/random/uniform_real_distribution/op_ostream.md b/reference/random/uniform_real_distribution/op_ostream.md index 41aeb776c8..6022624cd0 100644 --- a/reference/random/uniform_real_distribution/op_ostream.md +++ b/reference/random/uniform_real_distribution/op_ostream.md @@ -58,5 +58,3 @@ int main() ## 参照 - - diff --git a/reference/random/uniform_real_distribution/param.md b/reference/random/uniform_real_distribution/param.md index fd7ff849ce..a72a035b81 100644 --- a/reference/random/uniform_real_distribution/param.md +++ b/reference/random/uniform_real_distribution/param.md @@ -57,5 +57,3 @@ int main() ## 参照 - - diff --git a/reference/random/uniform_real_distribution/reset.md b/reference/random/uniform_real_distribution/reset.md index 119fad1d53..28891c43e7 100644 --- a/reference/random/uniform_real_distribution/reset.md +++ b/reference/random/uniform_real_distribution/reset.md @@ -65,5 +65,3 @@ int main() ## 参照 - - diff --git a/reference/random/weibull_distribution.md b/reference/random/weibull_distribution.md index e920151b0e..bcf45ea958 100644 --- a/reference/random/weibull_distribution.md +++ b/reference/random/weibull_distribution.md @@ -129,4 +129,3 @@ int main() - [ワイブル分布 - Wikipedia](https://ja.wikipedia.org/wiki/ワイブル分布) - [ワイブル分布 = NtRand](http://www.ntrand.com/jp/weibull-distribution/) - [疲労や破壊現象とワイブル分布](http://web.archive.org/web/20220706102605/http://www.mogami.com/notes/weibull.html) - diff --git a/reference/random/weibull_distribution/a.md b/reference/random/weibull_distribution/a.md index abac8dd05b..09811e4239 100644 --- a/reference/random/weibull_distribution/a.md +++ b/reference/random/weibull_distribution/a.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/weibull_distribution/b.md b/reference/random/weibull_distribution/b.md index 42992de818..0782f86d81 100644 --- a/reference/random/weibull_distribution/b.md +++ b/reference/random/weibull_distribution/b.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/weibull_distribution/max.md b/reference/random/weibull_distribution/max.md index ad682e131d..d23fb13c0e 100644 --- a/reference/random/weibull_distribution/max.md +++ b/reference/random/weibull_distribution/max.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/weibull_distribution/min.md b/reference/random/weibull_distribution/min.md index 1a2c3dbfa8..85521f5306 100644 --- a/reference/random/weibull_distribution/min.md +++ b/reference/random/weibull_distribution/min.md @@ -49,5 +49,3 @@ int main() ## 参照 - - diff --git a/reference/random/weibull_distribution/op_equal.md b/reference/random/weibull_distribution/op_equal.md index 34d15f1933..9e4afff6a5 100644 --- a/reference/random/weibull_distribution/op_equal.md +++ b/reference/random/weibull_distribution/op_equal.md @@ -61,5 +61,3 @@ equal ## 参照 - - diff --git a/reference/random/weibull_distribution/op_istream.md b/reference/random/weibull_distribution/op_istream.md index 2f6c9365d9..0fa89d74ec 100644 --- a/reference/random/weibull_distribution/op_istream.md +++ b/reference/random/weibull_distribution/op_istream.md @@ -79,5 +79,3 @@ int main() ## 参照 - - diff --git a/reference/random/weibull_distribution/op_not_equal.md b/reference/random/weibull_distribution/op_not_equal.md index 88ad9fe668..c71962d54d 100644 --- a/reference/random/weibull_distribution/op_not_equal.md +++ b/reference/random/weibull_distribution/op_not_equal.md @@ -61,5 +61,3 @@ not equal ## 参照 - - diff --git a/reference/random/weibull_distribution/op_ostream.md b/reference/random/weibull_distribution/op_ostream.md index e9519683c9..de9783cd7b 100644 --- a/reference/random/weibull_distribution/op_ostream.md +++ b/reference/random/weibull_distribution/op_ostream.md @@ -58,5 +58,3 @@ int main() ## 参照 - - diff --git a/reference/random/weibull_distribution/param.md b/reference/random/weibull_distribution/param.md index 08050982ea..8d8c16aee0 100644 --- a/reference/random/weibull_distribution/param.md +++ b/reference/random/weibull_distribution/param.md @@ -57,5 +57,3 @@ int main() ## 参照 - - diff --git a/reference/random/weibull_distribution/reset.md b/reference/random/weibull_distribution/reset.md index a44c101c94..3a64f99107 100644 --- a/reference/random/weibull_distribution/reset.md +++ b/reference/random/weibull_distribution/reset.md @@ -67,5 +67,3 @@ int main() ## 参照 - - diff --git a/reference/ranges/as_const_view/op_deduction_guide.md b/reference/ranges/as_const_view/op_deduction_guide.md index 4b0ee8707b..40e4aa7659 100644 --- a/reference/ranges/as_const_view/op_deduction_guide.md +++ b/reference/ranges/as_const_view/op_deduction_guide.md @@ -59,4 +59,3 @@ int main() { ## 参照 - [P2278R4 `cbegin` should always return a constant iterator](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2278r4.html) - diff --git a/reference/ranges/iota_view.md b/reference/ranges/iota_view.md index 5974097250..6601767d1c 100644 --- a/reference/ranges/iota_view.md +++ b/reference/ranges/iota_view.md @@ -201,4 +201,3 @@ FizzBuzz - [P2325R3 Views should not be required to be default constructible](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2325r3.html) (本提案文書はC++20に遡って適用されている) - [P2367R0 Remove misuses of list-initialization from Clause 24](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2367r0.html) (本提案文書はC++20に遡って適用されている) - [LWG Issue 4001. `iota_view` should provide `empty`](https://cplusplus.github.io/LWG/issue4001) - diff --git a/reference/ranges/iota_view/op_deduction_guide.md b/reference/ranges/iota_view/op_deduction_guide.md index d992c19f8d..3de6b207c9 100644 --- a/reference/ranges/iota_view/op_deduction_guide.md +++ b/reference/ranges/iota_view/op_deduction_guide.md @@ -57,4 +57,3 @@ int main() ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) - [C++20 ranges](https://techbookfest.org/product/5134506308665344) - diff --git a/reference/ranges/simple-view.md b/reference/ranges/simple-view.md index 13ae87ec88..be96992ac2 100644 --- a/reference/ranges/simple-view.md +++ b/reference/ranges/simple-view.md @@ -30,4 +30,3 @@ template ## 参考 - [filter_viewがconst-iterableではない理由](https://zenn.dev/onihusube/scraps/40a95c8f769414) - diff --git a/reference/ranges/subrange/convertible-to-non-slicing.md b/reference/ranges/subrange/convertible-to-non-slicing.md index e257fe1c2a..d46fb555d0 100644 --- a/reference/ranges/subrange/convertible-to-non-slicing.md +++ b/reference/ranges/subrange/convertible-to-non-slicing.md @@ -40,4 +40,3 @@ namespace std::ranges { ## 参照 - [LWG 3282 `subrange` converting constructor should disallow derived to base conversions](https://cplusplus.github.io/LWG/issue3282) - [LWG 3470 `convertible-to-non-slicing` seems to reject valid case](https://cplusplus.github.io/LWG/issue3470) - diff --git a/reference/ranges/subrange/op_deduction_guide.md b/reference/ranges/subrange/op_deduction_guide.md index ac64cd567e..3882a20ae4 100644 --- a/reference/ranges/subrange/op_deduction_guide.md +++ b/reference/ranges/subrange/op_deduction_guide.md @@ -68,4 +68,3 @@ int main() ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) - [C++20 ranges](https://techbookfest.org/product/5134506308665344) - diff --git a/reference/ratio/ratio.md b/reference/ratio/ratio.md index d183d239fb..78d2c08e8d 100644 --- a/reference/ratio/ratio.md +++ b/reference/ratio/ratio.md @@ -55,5 +55,3 @@ int main() - [Clang](/implementation.md#clang): 3.0 [mark verified] - [GCC](/implementation.md#gcc): 4.4.7 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? - - diff --git a/reference/ratio/ratio_add.md b/reference/ratio/ratio_add.md index d153d65403..66846f715a 100644 --- a/reference/ratio/ratio_add.md +++ b/reference/ratio/ratio_add.md @@ -51,5 +51,3 @@ int main() - [Clang](/implementation.md#clang): 3.0 [mark verified] - [GCC](/implementation.md#gcc): 4.6.4 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? - - diff --git a/reference/ratio/ratio_divide.md b/reference/ratio/ratio_divide.md index 452d5ab1c9..2030da4f5d 100644 --- a/reference/ratio/ratio_divide.md +++ b/reference/ratio/ratio_divide.md @@ -51,5 +51,3 @@ int main() - [Clang](/implementation.md#clang): 3.0 [mark verified] - [GCC](/implementation.md#gcc): 4.6.4 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? - - diff --git a/reference/ratio/ratio_multiply.md b/reference/ratio/ratio_multiply.md index d640cba3b9..69c2b5b9ec 100644 --- a/reference/ratio/ratio_multiply.md +++ b/reference/ratio/ratio_multiply.md @@ -86,4 +86,3 @@ int main() ## 参照 - [What is the best way to form custom std::chrono::durations and std::ratios? - StackOverflow](http://stackoverflow.com/questions/27880393/what-is-the-best-way-to-form-custom-stdchronodurations-and-stdratios) - diff --git a/reference/ratio/ratio_subtract.md b/reference/ratio/ratio_subtract.md index 2a6285a905..851aa00688 100644 --- a/reference/ratio/ratio_subtract.md +++ b/reference/ratio/ratio_subtract.md @@ -51,5 +51,3 @@ int main() - [Clang](/implementation.md#clang): 3.0 [mark verified] - [GCC](/implementation.md#gcc): 4.6.4 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? - - diff --git a/reference/regex/basic_regex.md b/reference/regex/basic_regex.md index 5d7c9fdc55..5812d3d8a6 100644 --- a/reference/regex/basic_regex.md +++ b/reference/regex/basic_regex.md @@ -148,4 +148,3 @@ int main() - [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/regex/basic_regex/assign.md b/reference/regex/basic_regex/assign.md index eb2bf8bebc..7141c2a951 100644 --- a/reference/regex/basic_regex/assign.md +++ b/reference/regex/basic_regex/assign.md @@ -134,4 +134,3 @@ Clang バージョン 3.0 は [`initializer_list`](../../initializer_list.md) ## 参照 - [N2679 Initializer Lists for Standard Containers(Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2679.pdf) - (7)の経緯となる提案文書 - diff --git a/reference/regex/basic_regex/op_constructor.md b/reference/regex/basic_regex/op_constructor.md index 2b2e0b702a..03f0723b64 100644 --- a/reference/regex/basic_regex/op_constructor.md +++ b/reference/regex/basic_regex/op_constructor.md @@ -146,4 +146,3 @@ Clang バージョン 3.0 は [`initializer_list`](../../initializer_list.md) ## 参照 - [N2679 Initializer Lists for Standard Containers(Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2679.pdf) - (8)の経緯となる提案文書 - diff --git a/reference/regex/basic_regex/op_deduction_guide.md b/reference/regex/basic_regex/op_deduction_guide.md index 831cb47d64..a56a571009 100644 --- a/reference/regex/basic_regex/op_deduction_guide.md +++ b/reference/regex/basic_regex/op_deduction_guide.md @@ -63,4 +63,3 @@ int main() ## 参照 - [P0433R2 Toward a resolution of US7 and US14: Integrating template deduction for class templates into the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0433r2.html) - diff --git a/reference/regex/regex_constants.md b/reference/regex/regex_constants.md index 64f678dca8..e60da912a9 100644 --- a/reference/regex/regex_constants.md +++ b/reference/regex/regex_constants.md @@ -16,4 +16,3 @@ ## バージョン ### 言語 - C++11 - diff --git a/reference/regex/regex_constants/error_type.md b/reference/regex/regex_constants/error_type.md index afd8b85451..149dfb077f 100644 --- a/reference/regex/regex_constants/error_type.md +++ b/reference/regex/regex_constants/error_type.md @@ -77,4 +77,3 @@ namespace regex_constants { ## 参照 - [LWG Issue 2053. Errors in regex bitmask types](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2053) - 定数定義に不要な`static`が付いていたため、C++14で削除 - diff --git a/reference/regex/regex_constants/match_flag_type.md b/reference/regex/regex_constants/match_flag_type.md index 1233090d4a..47239384e0 100644 --- a/reference/regex/regex_constants/match_flag_type.md +++ b/reference/regex/regex_constants/match_flag_type.md @@ -79,4 +79,3 @@ namespace regex_constants{ - `match_default`と`format_default`の2つがデフォルト値`0`を持っているが、同じ値を持つビットマスク値が複数含まれていることはビットマスク型の要件と矛盾しているため、C++14でビットマスク型の要件を見なおした。 - [LWG Issue 2053. Errors in regex bitmask types](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2053) - 定数定義に不要な`static`が付いていたため、C++14で削除 - diff --git a/reference/regex/regex_error.md b/reference/regex/regex_error.md index c518689156..3dfd0191a0 100644 --- a/reference/regex/regex_error.md +++ b/reference/regex/regex_error.md @@ -99,4 +99,3 @@ The expression contained mismatched ( and ). - [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? - diff --git a/reference/regex/regex_iterator/op_equal.md b/reference/regex/regex_iterator/op_equal.md index 5a241a5cf5..c165fef39f 100644 --- a/reference/regex/regex_iterator/op_equal.md +++ b/reference/regex/regex_iterator/op_equal.md @@ -85,4 +85,3 @@ it2:'1'(3, 4) | 名前 | 説明 | |---------------------------------|------------| | [`operator!=`](op_not_equal.md) | 非等値比較 | - diff --git a/reference/regex/regex_traits.md b/reference/regex/regex_traits.md index fba5f7edcc..e243d62d73 100644 --- a/reference/regex/regex_traits.md +++ b/reference/regex/regex_traits.md @@ -102,4 +102,3 @@ int main() - [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/regex/regex_traits/getloc.md b/reference/regex/regex_traits/getloc.md index bb0bbde274..4bad6289f0 100644 --- a/reference/regex/regex_traits/getloc.md +++ b/reference/regex/regex_traits/getloc.md @@ -52,4 +52,3 @@ int main() - [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/regex/regex_traits/imbue.md b/reference/regex/regex_traits/imbue.md index 6cb4babbbf..311bede328 100644 --- a/reference/regex/regex_traits/imbue.md +++ b/reference/regex/regex_traits/imbue.md @@ -51,4 +51,3 @@ int main() - [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/regex/regex_traits/isctype.md b/reference/regex/regex_traits/isctype.md index 1c299d97cd..750a362d1b 100644 --- a/reference/regex/regex_traits/isctype.md +++ b/reference/regex/regex_traits/isctype.md @@ -66,5 +66,3 @@ int main() ## 参照 - [LWG Issue 2018. [CD] `regex_traits::isctype` Returns clause is wrong](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2018) - C++14から、戻り値の仕様文面が見直された。 - - diff --git a/reference/regex/regex_traits/length.md b/reference/regex/regex_traits/length.md index 9b803ceced..003670f3bd 100644 --- a/reference/regex/regex_traits/length.md +++ b/reference/regex/regex_traits/length.md @@ -50,4 +50,3 @@ int main() - [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/regex/regex_traits/lookup_classname.md b/reference/regex/regex_traits/lookup_classname.md index adcebf00cb..2f72728e8f 100644 --- a/reference/regex/regex_traits/lookup_classname.md +++ b/reference/regex/regex_traits/lookup_classname.md @@ -95,4 +95,3 @@ int main() ## 参照 - [LWG Issue 2018. [CD] `regex_traits::isctype` Returns clause is wrong](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2018) - C++14から、戻り値の仕様文面が見直された。 - diff --git a/reference/regex/regex_traits/lookup_collatename.md b/reference/regex/regex_traits/lookup_collatename.md index d2b7a366f8..d41eaf7406 100644 --- a/reference/regex/regex_traits/lookup_collatename.md +++ b/reference/regex/regex_traits/lookup_collatename.md @@ -56,4 +56,3 @@ int main() - [GCC](/implementation.md#gcc): 5.1.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/regex/regex_traits/op_constructor.md b/reference/regex/regex_traits/op_constructor.md index d5fafff3a2..07c671b9be 100644 --- a/reference/regex/regex_traits/op_constructor.md +++ b/reference/regex/regex_traits/op_constructor.md @@ -42,4 +42,3 @@ int main() - [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/regex/regex_traits/transform_primary.md b/reference/regex/regex_traits/transform_primary.md index dc4e45ba43..7dae6ab2bb 100644 --- a/reference/regex/regex_traits/transform_primary.md +++ b/reference/regex/regex_traits/transform_primary.md @@ -65,4 +65,3 @@ int main() - [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/regex/regex_traits/translate.md b/reference/regex/regex_traits/translate.md index 5a6f9737da..21a9f92000 100644 --- a/reference/regex/regex_traits/translate.md +++ b/reference/regex/regex_traits/translate.md @@ -50,4 +50,3 @@ A - [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/regex/regex_traits/translate_nocase.md b/reference/regex/regex_traits/translate_nocase.md index 7b9734d73c..db23e7e638 100644 --- a/reference/regex/regex_traits/translate_nocase.md +++ b/reference/regex/regex_traits/translate_nocase.md @@ -54,4 +54,3 @@ a - [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/regex/regex_traits/value.md b/reference/regex/regex_traits/value.md index 5b2d05d1e5..a683bc59ce 100644 --- a/reference/regex/regex_traits/value.md +++ b/reference/regex/regex_traits/value.md @@ -52,4 +52,3 @@ int main() - [GCC](/implementation.md#gcc): 4.9.0 [mark verified], 4.9.1 [mark verified], 4.9.2 [mark verified], 5.0.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/scoped_allocator.md b/reference/scoped_allocator.md index 87aa4cb5c2..797474012a 100644 --- a/reference/scoped_allocator.md +++ b/reference/scoped_allocator.md @@ -12,4 +12,3 @@ ## バージョン ### 言語 - C++11 - diff --git a/reference/scoped_allocator/scoped_allocator_adaptor/op_deduction_guide.md b/reference/scoped_allocator/scoped_allocator_adaptor/op_deduction_guide.md index 8c591cfbbd..2f47ea8e4c 100644 --- a/reference/scoped_allocator/scoped_allocator_adaptor/op_deduction_guide.md +++ b/reference/scoped_allocator/scoped_allocator_adaptor/op_deduction_guide.md @@ -57,4 +57,3 @@ int main() ## 参照 - [P0433R2 Toward a resolution of US7 and US14: Integrating template deduction for class templates into the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0433r2.html) - diff --git a/reference/set/multiset.md b/reference/set/multiset.md index 8afb5598ea..306693fe29 100644 --- a/reference/set/multiset.md +++ b/reference/set/multiset.md @@ -212,4 +212,3 @@ int main() 1 1 ``` - diff --git a/reference/set/multiset/cbegin.md b/reference/set/multiset/cbegin.md index 9c95d81fd3..c6a3d9ed4c 100644 --- a/reference/set/multiset/cbegin.md +++ b/reference/set/multiset/cbegin.md @@ -55,4 +55,3 @@ int main() | [`multiset::cend`](cend.md) | 末尾の次を指す読み取り専用イテレータを取得する | | [`multuset::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | | [`multiset::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | - diff --git a/reference/set/multiset/cend.md b/reference/set/multiset/cend.md index 2d776a64a8..9a68f756cf 100644 --- a/reference/set/multiset/cend.md +++ b/reference/set/multiset/cend.md @@ -60,4 +60,3 @@ int main() | [`cbegin`](cbegin.md) | 先頭を指す読み取り専用イテレータを取得する | | [`rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | | [`rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | - diff --git a/reference/set/multiset/crbegin.md b/reference/set/multiset/crbegin.md index f7d188d487..2d84f21464 100644 --- a/reference/set/multiset/crbegin.md +++ b/reference/set/multiset/crbegin.md @@ -57,4 +57,3 @@ int main() | [`crend`](crend.md) | 先頭の前を指す読み取り専用逆イテレータを取得する | | [`cbegin`](cbegin.md) | 先頭を指す読み取り専用イテレータを取得する | | [`cend`](cend.md) | 末尾の次を指す読み取り専用イテレータを取得する | - diff --git a/reference/set/multiset/crend.md b/reference/set/multiset/crend.md index 79111ca216..1753fc0250 100644 --- a/reference/set/multiset/crend.md +++ b/reference/set/multiset/crend.md @@ -53,4 +53,3 @@ int main() | [`crbegin`](crbegin.md) | 末尾を指す読み取り専用逆イテレータを返す | | [`cbegin`](cbegin.md) | 先頭を指す読み取り専用イテレータを返す | | [`cend`](cend.md) | 末尾の次を指す読み取り専用イテレータを返す | - diff --git a/reference/set/multiset/emplace.md b/reference/set/multiset/emplace.md index 8a0a9f4668..843f574a56 100644 --- a/reference/set/multiset/emplace.md +++ b/reference/set/multiset/emplace.md @@ -81,4 +81,3 @@ int main() ## 参照 - [N2680 Proposed Wording for Placement Insert (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2680.pdf) - diff --git a/reference/set/multiset/emplace_hint.md b/reference/set/multiset/emplace_hint.md index 0947a1647d..10ba5f7b91 100644 --- a/reference/set/multiset/emplace_hint.md +++ b/reference/set/multiset/emplace_hint.md @@ -87,4 +87,3 @@ int main() ## 参照 - [N2680 Proposed Wording for Placement Insert (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2680.pdf) - diff --git a/reference/set/multiset/end.md b/reference/set/multiset/end.md index 80fe4e6153..8b1f2daa2f 100644 --- a/reference/set/multiset/end.md +++ b/reference/set/multiset/end.md @@ -74,4 +74,3 @@ int main() | [`begin`](begin.md) | 先頭を指すイテレータを取得する | | [`rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | | [`rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | - diff --git a/reference/set/multiset/equal_range.md b/reference/set/multiset/equal_range.md index 0d11139de6..a3a9119898 100644 --- a/reference/set/multiset/equal_range.md +++ b/reference/set/multiset/equal_range.md @@ -77,4 +77,3 @@ B ## 参照 - [N3657 Adding heterogeneous comparison lookup to associative containers (rev 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3657.htm) - diff --git a/reference/set/multiset/lower_bound.md b/reference/set/multiset/lower_bound.md index c46a6fa533..04cd499954 100644 --- a/reference/set/multiset/lower_bound.md +++ b/reference/set/multiset/lower_bound.md @@ -109,4 +109,3 @@ D ## 参照 - [N3657 Adding heterogeneous comparison lookup to associative containers (rev 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3657.htm) - diff --git a/reference/set/multiset/op_constructor.md b/reference/set/multiset/op_constructor.md index e5391ea88e..030e04eaf6 100644 --- a/reference/set/multiset/op_constructor.md +++ b/reference/set/multiset/op_constructor.md @@ -153,4 +153,3 @@ Size of c2: 7 - [LWG 2210. Missing allocator-extended constructor for allocator-aware containers](http://cplusplus.github.io/LWG/lwg-defects.html#2210) (5), (11) を追加するきっかけとなったレポート なお、Discussion の例はアロケータの型が誤っているので注意 - diff --git a/reference/set/multiset/op_deduction_guide.md b/reference/set/multiset/op_deduction_guide.md index 3ba38dc327..9fe7e939b9 100644 --- a/reference/set/multiset/op_deduction_guide.md +++ b/reference/set/multiset/op_deduction_guide.md @@ -97,4 +97,3 @@ int main() ## 参照 - [P0433R2 Toward a resolution of US7 and US14: Integrating template deduction for class templates into the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0433r2.html) - diff --git a/reference/set/multiset/op_destructor.md b/reference/set/multiset/op_destructor.md index b263f159b2..937fe5b028 100644 --- a/reference/set/multiset/op_destructor.md +++ b/reference/set/multiset/op_destructor.md @@ -14,5 +14,3 @@ ## 計算量 [`size()`](size.md) に対して線形時間(デストラクタ呼び出し) - - diff --git a/reference/set/multiset/rbegin.md b/reference/set/multiset/rbegin.md index 715136a5f9..4b4c0d932e 100644 --- a/reference/set/multiset/rbegin.md +++ b/reference/set/multiset/rbegin.md @@ -69,4 +69,3 @@ int main() | [`rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`begin`](begin.md) | 先頭を指すイテレータを取得する | | [`end`](end.md) | 末尾の次を指すイテレータを取得する | - diff --git a/reference/set/multiset/upper_bound.md b/reference/set/multiset/upper_bound.md index 2b74359cce..f60cb6e902 100644 --- a/reference/set/multiset/upper_bound.md +++ b/reference/set/multiset/upper_bound.md @@ -109,4 +109,3 @@ D ## 参照 - [N3657 Adding heterogeneous comparison lookup to associative containers (rev 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3657.htm) - diff --git a/reference/set/set.md b/reference/set/set.md index c1b6460fb4..c5792666b7 100644 --- a/reference/set/set.md +++ b/reference/set/set.md @@ -213,4 +213,3 @@ int main() ``` 1 ``` - diff --git a/reference/set/set/cbegin.md b/reference/set/set/cbegin.md index f330017494..3231d92b05 100644 --- a/reference/set/set/cbegin.md +++ b/reference/set/set/cbegin.md @@ -55,4 +55,3 @@ int main() | [`set::cend`](cend.md) | 末尾の次を指す読み取り専用イテレータを取得する | | [`set::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | | [`set::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | - diff --git a/reference/set/set/cend.md b/reference/set/set/cend.md index 0e9bed668f..2a5fa8bb4a 100644 --- a/reference/set/set/cend.md +++ b/reference/set/set/cend.md @@ -60,4 +60,3 @@ int main() | [`cbegin`](cbegin.md) | 先頭を指す読み取り専用イテレータを取得する | | [`rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | | [`rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | - diff --git a/reference/set/set/crbegin.md b/reference/set/set/crbegin.md index fc1825d950..c600662616 100644 --- a/reference/set/set/crbegin.md +++ b/reference/set/set/crbegin.md @@ -57,4 +57,3 @@ int main() | [`crend`](crend.md) | 先頭の前を指す読み取り専用逆イテレータを取得する | | [`cbegin`](cbegin.md) | 先頭を指す読み取り専用イテレータを取得する | | [`cend`](cend.md) | 末尾の次を指す読み取り専用イテレータを取得する | - diff --git a/reference/set/set/crend.md b/reference/set/set/crend.md index c41a1bc06f..4a66c7f05c 100644 --- a/reference/set/set/crend.md +++ b/reference/set/set/crend.md @@ -53,4 +53,3 @@ int main() | [`crbegin`](crbegin.md) | 末尾を指す読み取り専用逆イテレータを返す | | [`cbegin`](cbegin.md) | 先頭を指す読み取り専用イテレータを返す | | [`cend`](cend.md) | 末尾の次を指す読み取り専用イテレータを返す | - diff --git a/reference/set/set/emplace.md b/reference/set/set/emplace.md index dbf602e714..6b3d642552 100644 --- a/reference/set/set/emplace.md +++ b/reference/set/set/emplace.md @@ -82,4 +82,3 @@ int main() ## 参照 - [N2680 Proposed Wording for Placement Insert (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2680.pdf) - diff --git a/reference/set/set/emplace_hint.md b/reference/set/set/emplace_hint.md index 40e0515a2c..d63bcaa591 100644 --- a/reference/set/set/emplace_hint.md +++ b/reference/set/set/emplace_hint.md @@ -87,4 +87,3 @@ int main() ## 参照 - [N2680 Proposed Wording for Placement Insert (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2680.pdf) - diff --git a/reference/set/set/end.md b/reference/set/set/end.md index ac654ae648..afa8ace6d6 100644 --- a/reference/set/set/end.md +++ b/reference/set/set/end.md @@ -74,4 +74,3 @@ int main() | [`begin`](begin.md) | 先頭を指すイテレータを取得する | | [`rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | | [`rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | - diff --git a/reference/set/set/equal_range.md b/reference/set/set/equal_range.md index b55e41f931..46d9991015 100644 --- a/reference/set/set/equal_range.md +++ b/reference/set/set/equal_range.md @@ -76,4 +76,3 @@ B ## 参照 - [N3657 Adding heterogeneous comparison lookup to associative containers (rev 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3657.htm) - diff --git a/reference/set/set/erase.md b/reference/set/set/erase.md index 385c77ac43..b085dcdefa 100644 --- a/reference/set/set/erase.md +++ b/reference/set/set/erase.md @@ -173,4 +173,3 @@ int main() - C++17で、`erase(iterator)`を再追加 - [P2077R3 Heterogeneous erasure overloads for associative containers](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2077r3.html) - C++23で、`template erase(K&& x)`のオーバーロードが追加された - diff --git a/reference/set/set/lower_bound.md b/reference/set/set/lower_bound.md index 6c5bc0c927..48e2f50d40 100644 --- a/reference/set/set/lower_bound.md +++ b/reference/set/set/lower_bound.md @@ -107,4 +107,3 @@ D ## 参照 - [N3657 Adding heterogeneous comparison lookup to associative containers (rev 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3657.htm) - diff --git a/reference/set/set/op_constructor.md b/reference/set/set/op_constructor.md index 798c0976e9..d45f8ca149 100644 --- a/reference/set/set/op_constructor.md +++ b/reference/set/set/op_constructor.md @@ -153,4 +153,3 @@ Size of c2: 6 - [LWG 2210. Missing allocator-extended constructor for allocator-aware containers](http://cplusplus.github.io/LWG/lwg-defects.html#2210) (5), (11) を追加するきっかけとなったレポート なお、Discussion の例はアロケータの型が誤っているので注意 - diff --git a/reference/set/set/op_deduction_guide.md b/reference/set/set/op_deduction_guide.md index 0ed1fb77a0..dfb60461ba 100644 --- a/reference/set/set/op_deduction_guide.md +++ b/reference/set/set/op_deduction_guide.md @@ -97,4 +97,3 @@ int main() ## 参照 - [P0433R2 Toward a resolution of US7 and US14: Integrating template deduction for class templates into the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0433r2.html) - diff --git a/reference/set/set/op_destructor.md b/reference/set/set/op_destructor.md index 47a28bbe83..4136f65db5 100644 --- a/reference/set/set/op_destructor.md +++ b/reference/set/set/op_destructor.md @@ -14,5 +14,3 @@ ## 計算量 [`size()`](size.md) に対して線形時間(デストラクタ呼び出し) - - diff --git a/reference/set/set/rbegin.md b/reference/set/set/rbegin.md index efb9239eb6..05e9ff5f0d 100644 --- a/reference/set/set/rbegin.md +++ b/reference/set/set/rbegin.md @@ -69,4 +69,3 @@ int main() | [`rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`begin`](begin.md) | 先頭を指すイテレータを取得する | | [`end`](end.md) | 末尾の次を指すイテレータを取得する | - diff --git a/reference/set/set/upper_bound.md b/reference/set/set/upper_bound.md index 6e4dad3e06..2d8fd61d1a 100644 --- a/reference/set/set/upper_bound.md +++ b/reference/set/set/upper_bound.md @@ -107,4 +107,3 @@ D ## 参照 - [N3657 Adding heterogeneous comparison lookup to associative containers (rev 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3657.htm) - diff --git a/reference/shared_mutex.md b/reference/shared_mutex.md index 3b0c628629..1ac16bdca7 100644 --- a/reference/shared_mutex.md +++ b/reference/shared_mutex.md @@ -15,4 +15,3 @@ ## バージョン ### 言語 - C++14 - diff --git a/reference/shared_mutex/shared_lock.md b/reference/shared_mutex/shared_lock.md index 46bf230d66..e536c18dbb 100644 --- a/reference/shared_mutex/shared_lock.md +++ b/reference/shared_mutex/shared_lock.md @@ -113,5 +113,3 @@ int main() - [`shared_timed_mutex`](shared_timed_mutex.md) : 共有ミューテックスクラス - [`lock_guard`](/reference/mutex/lock_guard.md) : 排他ロックを自動的に手放す - [`unique_lock`](/reference/mutex/unique_lock.md) : 排他ロックを自動的に手放す - - diff --git a/reference/shared_mutex/shared_timed_mutex.md b/reference/shared_mutex/shared_timed_mutex.md index 2f337c2e1d..854b1491f5 100644 --- a/reference/shared_mutex/shared_timed_mutex.md +++ b/reference/shared_mutex/shared_timed_mutex.md @@ -194,4 +194,3 @@ int main() - [N3568 Shared locking in C++ (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3568.html) - [N3659 Shared locking in C++ (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3659.html) - [N3891 A proposal to rename `shared_mutex` to `shared_timed_mutex`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3891.htm) - diff --git a/reference/sstream.md b/reference/sstream.md index ff32b3aac7..2d3bdb98e6 100644 --- a/reference/sstream.md +++ b/reference/sstream.md @@ -34,5 +34,3 @@ | [`basic_stringstream`](sstream/basic_stringstream.md) | 文字列入出力ストリーム(class template) | | | [`stringstream`](sstream/basic_stringstream.md) | `char`版の文字列入出力ストリーム(type-alias) | | | [`wstringstream`](sstream/basic_stringstream.md) | `wchar_t`版の文字列入出力ストリーム(type-alias) | | - - diff --git a/reference/stack/stack.md b/reference/stack/stack.md index 8707acab7c..38a907bb79 100644 --- a/reference/stack/stack.md +++ b/reference/stack/stack.md @@ -117,5 +117,3 @@ int main () ``` ### 参照 - - diff --git a/reference/stack/stack/op_assign.md b/reference/stack/stack/op_assign.md index fe197d3ee3..1906a194df 100644 --- a/reference/stack/stack/op_assign.md +++ b/reference/stack/stack/op_assign.md @@ -65,5 +65,3 @@ int main() | 名前 | 説明 | |--------------------------------------------------------------------------------------------|-----------------------------------------------------| | [`(constructor)`](op_constructor.md) | コンストラクタ | - - diff --git a/reference/stack/stack/op_destructor.md b/reference/stack/stack/op_destructor.md index f6ce54c578..f2fe2c9b58 100644 --- a/reference/stack/stack/op_destructor.md +++ b/reference/stack/stack/op_destructor.md @@ -14,5 +14,3 @@ stack コンテナアダプタのオブジェクトを破棄する。 ## 計算量 線形時間 O(n) (全要素のデストラクタ呼び出し) - - diff --git a/reference/stack/stack/op_equal.md b/reference/stack/stack/op_equal.md index f38b7a08c3..535570e10b 100644 --- a/reference/stack/stack/op_equal.md +++ b/reference/stack/stack/op_equal.md @@ -46,5 +46,3 @@ true ``` ## 参照 - - diff --git a/reference/stack/stack/op_greater.md b/reference/stack/stack/op_greater.md index 3011098bf2..58d7e002c4 100644 --- a/reference/stack/stack/op_greater.md +++ b/reference/stack/stack/op_greater.md @@ -46,5 +46,3 @@ false ``` ## 参照 - - diff --git a/reference/stack/stack/op_greater_equal.md b/reference/stack/stack/op_greater_equal.md index 8c081a4319..8b65ff5238 100644 --- a/reference/stack/stack/op_greater_equal.md +++ b/reference/stack/stack/op_greater_equal.md @@ -46,5 +46,3 @@ false ``` ## 参照 - - diff --git a/reference/stack/stack/op_less.md b/reference/stack/stack/op_less.md index 2806a40abe..34ee98ce25 100644 --- a/reference/stack/stack/op_less.md +++ b/reference/stack/stack/op_less.md @@ -46,5 +46,3 @@ true ``` ## 参照 - - diff --git a/reference/stack/stack/op_less_equal.md b/reference/stack/stack/op_less_equal.md index 89486e0a1a..cf11c43bb8 100644 --- a/reference/stack/stack/op_less_equal.md +++ b/reference/stack/stack/op_less_equal.md @@ -46,5 +46,3 @@ true ``` ## 参照 - - diff --git a/reference/stack/stack/op_not_equal.md b/reference/stack/stack/op_not_equal.md index 92d9ca3eb1..dd2ea49074 100644 --- a/reference/stack/stack/op_not_equal.md +++ b/reference/stack/stack/op_not_equal.md @@ -52,5 +52,3 @@ true ``` ## 参照 - - diff --git a/reference/stack/stack/pop.md b/reference/stack/stack/pop.md index dad13afba1..250fef22fa 100644 --- a/reference/stack/stack/pop.md +++ b/reference/stack/stack/pop.md @@ -59,4 +59,3 @@ Popping out elements... 4 3 2 1 0 ```cpp void pop() { c.pop_back(); } ``` - diff --git a/reference/stack/stack/push.md b/reference/stack/stack/push.md index f7c0500664..bbb16a832d 100644 --- a/reference/stack/stack/push.md +++ b/reference/stack/stack/push.md @@ -71,5 +71,3 @@ int main() void push(const value_type& x) { c.push_back(x); } void push(value_type&& x) { c.push_back(std::move(x)); } ``` - - diff --git a/reference/stack/stack/size.md b/reference/stack/stack/size.md index 2d0d963e0f..cc5094b419 100644 --- a/reference/stack/stack/size.md +++ b/reference/stack/stack/size.md @@ -69,4 +69,3 @@ size_type size() const { return c.size(); } | 名前 | 説明 | |-----------------------|--------------------------------| | [`empty`](empty.md) | コンテナが空であるかを確認する | - diff --git a/reference/stack/stack/swap.md b/reference/stack/stack/swap.md index ce95524211..0455cd7c6d 100644 --- a/reference/stack/stack/swap.md +++ b/reference/stack/stack/swap.md @@ -94,5 +94,3 @@ void swap(stack& s) noexcept(noexcept(swap(c, s.c))) ## 参照 - - diff --git a/reference/stack/stack/swap_free.md b/reference/stack/stack/swap_free.md index 96ee9ce468..8cc1970f6d 100644 --- a/reference/stack/stack/swap_free.md +++ b/reference/stack/stack/swap_free.md @@ -87,4 +87,3 @@ y : 4 1 3 - [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): - diff --git a/reference/stack/stack/top.md b/reference/stack/stack/top.md index a9aa5766e5..f9381f31b7 100644 --- a/reference/stack/stack/top.md +++ b/reference/stack/stack/top.md @@ -64,5 +64,3 @@ const_reference top() const { return c.back(); } |---------------------|------------| | [`push`](push.md) | 要素の追加 | | [`pop`](pop.md) | 要素の削除 | - - diff --git a/reference/stdfloat/bfloat16_t.md b/reference/stdfloat/bfloat16_t.md index a95b671e0e..bb58448891 100644 --- a/reference/stdfloat/bfloat16_t.md +++ b/reference/stdfloat/bfloat16_t.md @@ -182,4 +182,3 @@ int main() { ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - diff --git a/reference/stdfloat/float128_t.md b/reference/stdfloat/float128_t.md index 6ff96cea27..b606cf7835 100644 --- a/reference/stdfloat/float128_t.md +++ b/reference/stdfloat/float128_t.md @@ -181,4 +181,3 @@ int main() { ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - diff --git a/reference/stdfloat/float16_t.md b/reference/stdfloat/float16_t.md index c5aa48420e..21a81d872a 100644 --- a/reference/stdfloat/float16_t.md +++ b/reference/stdfloat/float16_t.md @@ -181,4 +181,3 @@ int main() { ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - diff --git a/reference/stdfloat/float32_t.md b/reference/stdfloat/float32_t.md index 7cafe5f138..5fb0bd084b 100644 --- a/reference/stdfloat/float32_t.md +++ b/reference/stdfloat/float32_t.md @@ -181,4 +181,3 @@ int main() { ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - diff --git a/reference/stdfloat/float64_t.md b/reference/stdfloat/float64_t.md index 4c33f3b61c..a5d121443e 100644 --- a/reference/stdfloat/float64_t.md +++ b/reference/stdfloat/float64_t.md @@ -181,4 +181,3 @@ int main() { ## 参照 - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - diff --git a/reference/stop_token/nostopstate.md b/reference/stop_token/nostopstate.md index 08d29b8c48..ab8d05b8a0 100644 --- a/reference/stop_token/nostopstate.md +++ b/reference/stop_token/nostopstate.md @@ -59,4 +59,3 @@ int main() - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/stop_token/stop_callback/op_deduction_guide.md b/reference/stop_token/stop_callback/op_deduction_guide.md index e708b172bf..32aa175967 100644 --- a/reference/stop_token/stop_callback/op_deduction_guide.md +++ b/reference/stop_token/stop_callback/op_deduction_guide.md @@ -53,4 +53,3 @@ int main() ## 関連項目 - [C++17 クラステンプレートのテンプレート引数推論](/lang/cpp17/type_deduction_for_class_templates.md) - diff --git a/reference/stop_token/stop_source/op_assign.md b/reference/stop_token/stop_source/op_assign.md index 4377686366..f2a3e8b4cb 100644 --- a/reference/stop_token/stop_source/op_assign.md +++ b/reference/stop_token/stop_source/op_assign.md @@ -79,4 +79,3 @@ int main() - [Clang](/implementation.md#clang): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/stop_token/stop_source/op_constructor.md b/reference/stop_token/stop_source/op_constructor.md index 72e7496eb7..967e74a913 100644 --- a/reference/stop_token/stop_source/op_constructor.md +++ b/reference/stop_token/stop_source/op_constructor.md @@ -72,4 +72,3 @@ int main() - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/stop_token/stop_source/op_destructor.md b/reference/stop_token/stop_source/op_destructor.md index 6d78872814..3eed9a4390 100644 --- a/reference/stop_token/stop_source/op_destructor.md +++ b/reference/stop_token/stop_source/op_destructor.md @@ -12,4 +12,3 @@ ## 効果 自身が共有している停止状態の所有権を手放す。 ほかに停止状態を共有しているオブジェクトがいない場合は、停止状態を扱うために確保したリソースを解放する。 - diff --git a/reference/stop_token/stop_source/op_not_equal.md b/reference/stop_token/stop_source/op_not_equal.md index c33df5168b..3e390cc306 100644 --- a/reference/stop_token/stop_source/op_not_equal.md +++ b/reference/stop_token/stop_source/op_not_equal.md @@ -54,4 +54,3 @@ int main() - [Clang](/implementation.md#clang): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/stop_token/stop_source/swap.md b/reference/stop_token/stop_source/swap.md index 93ee3b7660..fb211e4e43 100644 --- a/reference/stop_token/stop_source/swap.md +++ b/reference/stop_token/stop_source/swap.md @@ -58,7 +58,3 @@ int main() ## 参照 - - - - diff --git a/reference/stop_token/stop_source/swap_free.md b/reference/stop_token/stop_source/swap_free.md index 5cf0da98d7..530e28835d 100644 --- a/reference/stop_token/stop_source/swap_free.md +++ b/reference/stop_token/stop_source/swap_free.md @@ -67,4 +67,3 @@ int main() - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/stop_token/stop_token/op_assign.md b/reference/stop_token/stop_token/op_assign.md index 1f8b8c1f0a..e21059e3da 100644 --- a/reference/stop_token/stop_token/op_assign.md +++ b/reference/stop_token/stop_token/op_assign.md @@ -82,4 +82,3 @@ int main() - [Clang](/implementation.md#clang): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/stop_token/stop_token/op_constructor.md b/reference/stop_token/stop_token/op_constructor.md index 20b6a02b28..25be1dd050 100644 --- a/reference/stop_token/stop_token/op_constructor.md +++ b/reference/stop_token/stop_token/op_constructor.md @@ -78,4 +78,3 @@ int main() - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/stop_token/stop_token/op_destructor.md b/reference/stop_token/stop_token/op_destructor.md index 0b0f7852a7..335af009c5 100644 --- a/reference/stop_token/stop_token/op_destructor.md +++ b/reference/stop_token/stop_token/op_destructor.md @@ -13,4 +13,3 @@ 自身が所有している停止状態の所有権を手放す。 ほかに停止状態を共有しているオブジェクトがいない場合は、停止状態を扱うために確保したリソースを解放する。 - diff --git a/reference/stop_token/stop_token/op_not_equal.md b/reference/stop_token/stop_token/op_not_equal.md index c62e1facca..6798b72648 100644 --- a/reference/stop_token/stop_token/op_not_equal.md +++ b/reference/stop_token/stop_token/op_not_equal.md @@ -58,4 +58,3 @@ int main() - [Clang](/implementation.md#clang): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/stop_token/stop_token/swap.md b/reference/stop_token/stop_token/swap.md index 23aeee229f..0e22f7e1a8 100644 --- a/reference/stop_token/stop_token/swap.md +++ b/reference/stop_token/stop_token/swap.md @@ -57,4 +57,3 @@ int main() - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/string/basic_string/getline.md b/reference/string/basic_string/getline.md index c42ec4f635..5aee517dce 100644 --- a/reference/string/basic_string/getline.md +++ b/reference/string/basic_string/getline.md @@ -82,4 +82,3 @@ Haru wa akebono. | 名前 | 説明 | |-----------------------|--------------------------------| | [`std::basic_istream<>::getline`](../../istream/basic_istream/getline.md) | 文字の配列へ入力を行うもの | - diff --git a/reference/string/char_traits/eof.md b/reference/string/char_traits/eof.md index 90b94bda31..07d0672a55 100644 --- a/reference/string/char_traits/eof.md +++ b/reference/string/char_traits/eof.md @@ -48,4 +48,3 @@ int main() ``` ## 参照 - diff --git a/reference/string/char_traits/eq.md b/reference/string/char_traits/eq.md index 0adadf5caf..1f96832c40 100644 --- a/reference/string/char_traits/eq.md +++ b/reference/string/char_traits/eq.md @@ -44,4 +44,3 @@ equal ``` ## 参照 - diff --git a/reference/string/char_traits/eq_int_type.md b/reference/string/char_traits/eq_int_type.md index 29e98efa3d..c9522c8097 100644 --- a/reference/string/char_traits/eq_int_type.md +++ b/reference/string/char_traits/eq_int_type.md @@ -46,4 +46,3 @@ equal ``` ## 参照 - diff --git a/reference/string/char_traits/lt.md b/reference/string/char_traits/lt.md index 0a2acd32db..cef29352e3 100644 --- a/reference/string/char_traits/lt.md +++ b/reference/string/char_traits/lt.md @@ -44,4 +44,3 @@ less ``` ## 参照 - diff --git a/reference/string/char_traits/not_eof.md b/reference/string/char_traits/not_eof.md index b53c2f1d6d..83c261d5e6 100644 --- a/reference/string/char_traits/not_eof.md +++ b/reference/string/char_traits/not_eof.md @@ -59,4 +59,3 @@ true ``` ## 参照 - diff --git a/reference/string/char_traits/to_char_type.md b/reference/string/char_traits/to_char_type.md index d40694b5cb..315d2046de 100644 --- a/reference/string/char_traits/to_char_type.md +++ b/reference/string/char_traits/to_char_type.md @@ -40,4 +40,3 @@ A ``` ## 参照 - diff --git a/reference/string/char_traits/to_int_type.md b/reference/string/char_traits/to_int_type.md index 05b1504049..6a46ea546d 100644 --- a/reference/string/char_traits/to_int_type.md +++ b/reference/string/char_traits/to_int_type.md @@ -40,4 +40,3 @@ int main() ``` ## 参照 - diff --git a/reference/system_error/error_category.md b/reference/system_error/error_category.md index 6c3af9e7aa..e5c80445b9 100644 --- a/reference/system_error/error_category.md +++ b/reference/system_error/error_category.md @@ -97,4 +97,3 @@ user defined error ## 参照 - diff --git a/reference/system_error/error_category/op_constructor.md b/reference/system_error/error_category/op_constructor.md index 0a422cab26..218b74c613 100644 --- a/reference/system_error/error_category/op_constructor.md +++ b/reference/system_error/error_category/op_constructor.md @@ -66,4 +66,3 @@ user defined error ## 参照 - [LWG Issue 2145. `error_category` default constructor](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2145) - diff --git a/reference/system_error/error_category/op_destructor.md b/reference/system_error/error_category/op_destructor.md index 183bd04167..25b2e7c1c9 100644 --- a/reference/system_error/error_category/op_destructor.md +++ b/reference/system_error/error_category/op_destructor.md @@ -25,4 +25,3 @@ virtual ~error_category(); // C++14 ## 参照 - [LWG Issue 2145. `error_category` default constructor](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2145) - diff --git a/reference/system_error/error_code.md b/reference/system_error/error_code.md index 0a3fb8681c..6e6486ae1c 100644 --- a/reference/system_error/error_code.md +++ b/reference/system_error/error_code.md @@ -102,4 +102,3 @@ Invalid argument ## 参照 - diff --git a/reference/system_error/error_code/message.md b/reference/system_error/error_code/message.md index 89979ed7b4..688a603061 100644 --- a/reference/system_error/error_code/message.md +++ b/reference/system_error/error_code/message.md @@ -51,5 +51,3 @@ Invalid argument - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] ## 参照 - - diff --git a/reference/system_error/error_code/op_assign.md b/reference/system_error/error_code/op_assign.md index 4151abf962..4a3b180d15 100644 --- a/reference/system_error/error_code/op_assign.md +++ b/reference/system_error/error_code/op_assign.md @@ -88,5 +88,3 @@ generic ## 参照 - - diff --git a/reference/system_error/error_code/op_constructor.md b/reference/system_error/error_code/op_constructor.md index 80d1d9eab3..78b8d95f09 100644 --- a/reference/system_error/error_code/op_constructor.md +++ b/reference/system_error/error_code/op_constructor.md @@ -192,5 +192,3 @@ not found - [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2010 (enum class未対応のため、ErrorCodeEnumのコンストラクタは動作しない) [mark verified] - - diff --git a/reference/system_error/error_condition.md b/reference/system_error/error_condition.md index 01cc5db2f7..d0d6b650b8 100644 --- a/reference/system_error/error_condition.md +++ b/reference/system_error/error_condition.md @@ -103,4 +103,3 @@ Invalid argument ## 参照 - diff --git a/reference/system_error/error_condition/op_constructor.md b/reference/system_error/error_condition/op_constructor.md index 5c22ee6530..4d3424677c 100644 --- a/reference/system_error/error_condition/op_constructor.md +++ b/reference/system_error/error_condition/op_constructor.md @@ -127,5 +127,3 @@ generic ## 参照 - - diff --git a/reference/system_error/make_error_code.md b/reference/system_error/make_error_code.md index c91bd2a19d..ba3f71ad18 100644 --- a/reference/system_error/make_error_code.md +++ b/reference/system_error/make_error_code.md @@ -64,5 +64,3 @@ message : Invalid argument ## 参照 - - diff --git a/reference/system_error/make_error_condition.md b/reference/system_error/make_error_condition.md index 722186b8fa..caa1577460 100644 --- a/reference/system_error/make_error_condition.md +++ b/reference/system_error/make_error_condition.md @@ -66,5 +66,3 @@ message : Invalid argument ## 参照 - - diff --git a/reference/system_error/system_error.md b/reference/system_error/system_error.md index 8e7e39cab6..9b91ab4d60 100644 --- a/reference/system_error/system_error.md +++ b/reference/system_error/system_error.md @@ -66,5 +66,3 @@ system error!: Invalid argument - [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified] - - diff --git a/reference/thread.md b/reference/thread.md index 1f80006eb4..d48803ae59 100644 --- a/reference/thread.md +++ b/reference/thread.md @@ -30,4 +30,3 @@ - [The cpp-threads Archives](https://www.decadent.org.uk/pipermail/cpp-threads/) - C++11の策定時に、C++標準の言語とライブラリに並行プログラミングの提案を行うため使用されていたメーリングリストのアーカイブです。 - [P2051R0 C++ Standard Library Issues to be moved in Prague](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2051r0.html) - diff --git a/reference/thread/this_thread/yield.md b/reference/thread/this_thread/yield.md index edc07ef7f6..229e1ae7c3 100644 --- a/reference/thread/this_thread/yield.md +++ b/reference/thread/this_thread/yield.md @@ -80,4 +80,3 @@ result=42 ## 参照 - [thread::yield()の実装 - Faith and Brave - C++で遊ぼう](http://d.hatena.ne.jp/faith_and_brave/20120618/1340000626) - diff --git a/reference/thread/thread.md b/reference/thread/thread.md index 010f2f9f4f..1fff1b1038 100644 --- a/reference/thread/thread.md +++ b/reference/thread/thread.md @@ -106,5 +106,3 @@ int main() - 2012はメモリリークするバグあり [link](http://stackoverflow.com/questions/14238670/is-this-a-big-bug-of-microsofts-implementation-of-stdthread) ## 参照 - - diff --git a/reference/thread/thread/hardware_concurrency.md b/reference/thread/thread/hardware_concurrency.md index a588424403..5294ca4b52 100644 --- a/reference/thread/thread/hardware_concurrency.md +++ b/reference/thread/thread/hardware_concurrency.md @@ -54,4 +54,3 @@ concurrency=4 - [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 - diff --git a/reference/thread/thread/native_handle.md b/reference/thread/thread/native_handle.md index bff4585a3b..edc1c1a491 100644 --- a/reference/thread/thread/native_handle.md +++ b/reference/thread/thread/native_handle.md @@ -60,5 +60,3 @@ func - [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] ## 参照 - - diff --git a/reference/thread/thread/op_assign.md b/reference/thread/thread/op_assign.md index a039408daa..a4950815c4 100644 --- a/reference/thread/thread/op_assign.md +++ b/reference/thread/thread/op_assign.md @@ -68,5 +68,3 @@ int main() ## 参照 - - diff --git a/reference/thread/thread/swap_free.md b/reference/thread/thread/swap_free.md index 03e9c0065d..ce5ab5dea8 100644 --- a/reference/thread/thread/swap_free.md +++ b/reference/thread/thread/swap_free.md @@ -61,5 +61,3 @@ int main() ## 参照 - - diff --git a/reference/tuple/tie.md b/reference/tuple/tie.md index aa16f6431f..9b8de68aa9 100644 --- a/reference/tuple/tie.md +++ b/reference/tuple/tie.md @@ -160,4 +160,3 @@ text, b.txt ## 参照 - [LWG2301 Why is std::tie not constexpr?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#2301) - [P2968R2 Make `std::ignore` a first-class object](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2968r2.html) - diff --git a/reference/tuple/tuple/op_deduction_guide.md b/reference/tuple/tuple/op_deduction_guide.md index e59b34c3ff..051298d9a1 100644 --- a/reference/tuple/tuple/op_deduction_guide.md +++ b/reference/tuple/tuple/op_deduction_guide.md @@ -88,4 +88,3 @@ int main() ## 参照 - [P0433R2 Toward a resolution of US7 and US14: Integrating template deduction for class templates into the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0433r2.html) - diff --git a/reference/type_traits/add_const.md b/reference/type_traits/add_const.md index 1fbff3dbc5..db981965ab 100644 --- a/reference/type_traits/add_const.md +++ b/reference/type_traits/add_const.md @@ -56,4 +56,3 @@ int main() {} ## 参照 - [N3546 TransformationTraits Redux](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3546.pdf) - [N3655 TransformationTraits Redux, v2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3655.pdf) - diff --git a/reference/type_traits/add_cv.md b/reference/type_traits/add_cv.md index 47dd58d9dc..c4086923bc 100644 --- a/reference/type_traits/add_cv.md +++ b/reference/type_traits/add_cv.md @@ -75,4 +75,3 @@ int main() {} ## 参照 - [N3546 TransformationTraits Redux](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3546.pdf) - [N3655 TransformationTraits Redux, v2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3655.pdf) - diff --git a/reference/type_traits/add_lvalue_reference.md b/reference/type_traits/add_lvalue_reference.md index 0f42fca0d1..0b2f20236a 100644 --- a/reference/type_traits/add_lvalue_reference.md +++ b/reference/type_traits/add_lvalue_reference.md @@ -58,4 +58,3 @@ int main() {} ## 参照 - [N3546 TransformationTraits Redux](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3546.pdf) - [N3655 TransformationTraits Redux, v2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3655.pdf) - diff --git a/reference/type_traits/add_pointer.md b/reference/type_traits/add_pointer.md index 2897bed249..f3135a9d4c 100644 --- a/reference/type_traits/add_pointer.md +++ b/reference/type_traits/add_pointer.md @@ -55,4 +55,3 @@ int main() {} ## 参照 - [N3546 TransformationTraits Redux](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3546.pdf) - [N3655 TransformationTraits Redux, v2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3655.pdf) - diff --git a/reference/type_traits/add_rvalue_reference.md b/reference/type_traits/add_rvalue_reference.md index c7012aadb4..703bfcc91b 100644 --- a/reference/type_traits/add_rvalue_reference.md +++ b/reference/type_traits/add_rvalue_reference.md @@ -56,4 +56,3 @@ int main() {} ## 参照 - [N3546 TransformationTraits Redux](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3546.pdf) - [N3655 TransformationTraits Redux, v2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3655.pdf) - diff --git a/reference/type_traits/add_volatile.md b/reference/type_traits/add_volatile.md index 507a905290..6a810b9a64 100644 --- a/reference/type_traits/add_volatile.md +++ b/reference/type_traits/add_volatile.md @@ -56,4 +56,3 @@ int main() {} ## 参照 - [N3546 TransformationTraits Redux](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3546.pdf) - [N3655 TransformationTraits Redux, v2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3655.pdf) - diff --git a/reference/type_traits/conditional.md b/reference/type_traits/conditional.md index 042767a463..c8c515af0c 100644 --- a/reference/type_traits/conditional.md +++ b/reference/type_traits/conditional.md @@ -79,4 +79,3 @@ int main() {} - [N2240 Two missing traits: `enable_if` and `conditional`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2240.html) - [N3546 TransformationTraits Redux](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3546.pdf) - [N3655 TransformationTraits Redux, v2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3655.pdf) - diff --git a/reference/type_traits/decay.md b/reference/type_traits/decay.md index fd6cc48ad6..4d3b46e4e6 100644 --- a/reference/type_traits/decay.md +++ b/reference/type_traits/decay.md @@ -103,4 +103,3 @@ int main() - [What is std::decay and when it should be used? - StackOverflow](http://stackoverflow.com/questions/25732386/what-is-stddecay-and-when-it-should-be-used) - [N3546 TransformationTraits Redux](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3546.pdf) - [N3655 TransformationTraits Redux, v2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3655.pdf) - diff --git a/reference/type_traits/enable_if.md b/reference/type_traits/enable_if.md index 26311d3dd8..1580b33bf3 100644 --- a/reference/type_traits/enable_if.md +++ b/reference/type_traits/enable_if.md @@ -72,4 +72,3 @@ Tは整数型以外 - [N2240 Two missing traits: `enable_if` and `conditional`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2240.html) - [N3546 TransformationTraits Redux](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3546.pdf) - [N3655 TransformationTraits Redux, v2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3655.pdf) - diff --git a/reference/type_traits/integral_constant.md b/reference/type_traits/integral_constant.md index 009c864054..cb90a3f9a5 100644 --- a/reference/type_traits/integral_constant.md +++ b/reference/type_traits/integral_constant.md @@ -72,4 +72,3 @@ int main(){} - [N3545 An Incremental Improvement to `integral_constant`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3545.pdf) - [LWG defects 2346. `integral_constant`'s member functions should be marked `noexcept`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2346) - [N3669 Fixing constexpr member functions without const](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3669.pdf) - diff --git a/reference/type_traits/is_scoped_enum.md b/reference/type_traits/is_scoped_enum.md index d54fb327a3..6935adcba7 100644 --- a/reference/type_traits/is_scoped_enum.md +++ b/reference/type_traits/is_scoped_enum.md @@ -51,4 +51,3 @@ int main() { - [Clang](/implementation.md#clang): 12.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - diff --git a/reference/type_traits/make_signed.md b/reference/type_traits/make_signed.md index 56df3c296a..6b270bfa79 100644 --- a/reference/type_traits/make_signed.md +++ b/reference/type_traits/make_signed.md @@ -82,4 +82,3 @@ int main() {} ## 参照 - [N3546 TransformationTraits Redux](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3546.pdf) - [N3655 TransformationTraits Redux, v2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3655.pdf) - diff --git a/reference/type_traits/make_unsigned.md b/reference/type_traits/make_unsigned.md index 210ae1831d..64e715dcf5 100644 --- a/reference/type_traits/make_unsigned.md +++ b/reference/type_traits/make_unsigned.md @@ -82,4 +82,3 @@ int main() {} ## 参照 - [N3546 TransformationTraits Redux](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3546.pdf) - [N3655 TransformationTraits Redux, v2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3655.pdf) - diff --git a/reference/type_traits/remove_all_extents.md b/reference/type_traits/remove_all_extents.md index b1ab49f2de..0c81d34144 100644 --- a/reference/type_traits/remove_all_extents.md +++ b/reference/type_traits/remove_all_extents.md @@ -74,4 +74,3 @@ int main() {} ## 参照 - [N3546 TransformationTraits Redux](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3546.pdf) - [N3655 TransformationTraits Redux, v2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3655.pdf) - diff --git a/reference/type_traits/remove_const.md b/reference/type_traits/remove_const.md index 344b6bdd93..05e933f5dd 100644 --- a/reference/type_traits/remove_const.md +++ b/reference/type_traits/remove_const.md @@ -80,4 +80,3 @@ int main() {} ## 参照 - [N3546 TransformationTraits Redux](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3546.pdf) - [N3655 TransformationTraits Redux, v2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3655.pdf) - diff --git a/reference/type_traits/remove_cv.md b/reference/type_traits/remove_cv.md index 6e2f386740..ab11c3f3d3 100644 --- a/reference/type_traits/remove_cv.md +++ b/reference/type_traits/remove_cv.md @@ -80,4 +80,3 @@ int main() {} ## 参照 - [N3546 TransformationTraits Redux](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3546.pdf) - [N3655 TransformationTraits Redux, v2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3655.pdf) - diff --git a/reference/type_traits/remove_extent.md b/reference/type_traits/remove_extent.md index 32f157a61c..397e070832 100644 --- a/reference/type_traits/remove_extent.md +++ b/reference/type_traits/remove_extent.md @@ -74,4 +74,3 @@ int main() {} ## 参照 - [N3546 TransformationTraits Redux](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3546.pdf) - [N3655 TransformationTraits Redux, v2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3655.pdf) - diff --git a/reference/type_traits/remove_pointer.md b/reference/type_traits/remove_pointer.md index 6bd8bcd5c6..1e3f2b2f5b 100644 --- a/reference/type_traits/remove_pointer.md +++ b/reference/type_traits/remove_pointer.md @@ -56,4 +56,3 @@ int main() {} ## 参照 - [N3546 TransformationTraits Redux](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3546.pdf) - [N3655 TransformationTraits Redux, v2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3655.pdf) - diff --git a/reference/type_traits/remove_reference.md b/reference/type_traits/remove_reference.md index 3d16c6dc21..dd9570d34e 100644 --- a/reference/type_traits/remove_reference.md +++ b/reference/type_traits/remove_reference.md @@ -54,4 +54,3 @@ int main() {} ## 参照 - [N3546 TransformationTraits Redux](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3546.pdf) - [N3655 TransformationTraits Redux, v2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3655.pdf) - diff --git a/reference/type_traits/remove_volatile.md b/reference/type_traits/remove_volatile.md index 4617ebfeda..7ea92cc09b 100644 --- a/reference/type_traits/remove_volatile.md +++ b/reference/type_traits/remove_volatile.md @@ -74,4 +74,3 @@ int main() {} ## 参照 - [N3546 TransformationTraits Redux](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3546.pdf) - [N3655 TransformationTraits Redux, v2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3655.pdf) - diff --git a/reference/typeindex/type_index.md b/reference/typeindex/type_index.md index dd4072d16a..14a87265d5 100644 --- a/reference/typeindex/type_index.md +++ b/reference/typeindex/type_index.md @@ -80,4 +80,3 @@ int main() ## 参照 - [N2530 Making It Easier to Use `std::type_info` as an Index in an Associative Container](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2530.html) - diff --git a/reference/typeindex/type_index/hash_code.md b/reference/typeindex/type_index/hash_code.md index deba409a39..872a57768f 100644 --- a/reference/typeindex/type_index/hash_code.md +++ b/reference/typeindex/type_index/hash_code.md @@ -79,4 +79,3 @@ int main() ## 参照 - [LWG Issue 2144. Missing `noexcept` specification in `type_index`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2144) - diff --git a/reference/typeindex/type_index/name.md b/reference/typeindex/type_index/name.md index 93c06749f6..34c22ccef2 100644 --- a/reference/typeindex/type_index/name.md +++ b/reference/typeindex/type_index/name.md @@ -58,4 +58,3 @@ c ## 参照 - [LWG Issue 2144. Missing `noexcept` specification in `type_index`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2144) - diff --git a/reference/typeindex/type_index/op_constructor.md b/reference/typeindex/type_index/op_constructor.md index 0507875ac2..18a29d1be6 100644 --- a/reference/typeindex/type_index/op_constructor.md +++ b/reference/typeindex/type_index/op_constructor.md @@ -44,4 +44,3 @@ int main() - [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - diff --git a/reference/typeindex/type_index/op_greater.md b/reference/typeindex/type_index/op_greater.md index 82a4562b52..cdfb407ca1 100644 --- a/reference/typeindex/type_index/op_greater.md +++ b/reference/typeindex/type_index/op_greater.md @@ -74,5 +74,3 @@ char - [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - - diff --git a/reference/typeindex/type_index/op_greater_equal.md b/reference/typeindex/type_index/op_greater_equal.md index 747b9b7115..533afd4c77 100644 --- a/reference/typeindex/type_index/op_greater_equal.md +++ b/reference/typeindex/type_index/op_greater_equal.md @@ -74,5 +74,3 @@ char - [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - - diff --git a/reference/typeindex/type_index/op_less.md b/reference/typeindex/type_index/op_less.md index dab6aca886..0ce0997f8e 100644 --- a/reference/typeindex/type_index/op_less.md +++ b/reference/typeindex/type_index/op_less.md @@ -73,4 +73,3 @@ int - [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - diff --git a/reference/typeindex/type_index/op_less_equal.md b/reference/typeindex/type_index/op_less_equal.md index feb19fcffb..a102a1f3d8 100644 --- a/reference/typeindex/type_index/op_less_equal.md +++ b/reference/typeindex/type_index/op_less_equal.md @@ -74,5 +74,3 @@ int - [GCC](/implementation.md#gcc): 4.6.1 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - - diff --git a/reference/typeinfo.md b/reference/typeinfo.md index 0a4e8b9d8e..2ad35cdbc3 100644 --- a/reference/typeinfo.md +++ b/reference/typeinfo.md @@ -10,4 +10,3 @@ | [`type_info`](typeinfo/type_info.md) | 型情報型(class) | | | [`bad_cast`](typeinfo/bad_cast.md) | `dynamic_cast`失敗時に投げられる例外(class) | | | [`bad_typeid`](typeinfo/bad_typeid.md) | ヌルポインタへの`typeid`で投げられる例外(class) | | - diff --git a/reference/typeinfo/bad_cast.md b/reference/typeinfo/bad_cast.md index d539fc7df2..d3d7d4c4ee 100644 --- a/reference/typeinfo/bad_cast.md +++ b/reference/typeinfo/bad_cast.md @@ -51,4 +51,3 @@ std::bad_cast ``` ## 参照 - diff --git a/reference/typeinfo/bad_cast/op_assign.md b/reference/typeinfo/bad_cast/op_assign.md index cdb4ed975d..02295ea075 100644 --- a/reference/typeinfo/bad_cast/op_assign.md +++ b/reference/typeinfo/bad_cast/op_assign.md @@ -22,4 +22,3 @@ constexpr bad_cast& operator=(const bad_cast&) noexcept; // (1) C++26 ## 関連項目 - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) - diff --git a/reference/typeinfo/bad_cast/op_constructor.md b/reference/typeinfo/bad_cast/op_constructor.md index ee712b85ad..cd31f92e5a 100644 --- a/reference/typeinfo/bad_cast/op_constructor.md +++ b/reference/typeinfo/bad_cast/op_constructor.md @@ -27,4 +27,3 @@ constexpr bad_cast(const bad_cast&) noexcept; // (2) C++26 ## 関連項目 - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) - diff --git a/reference/typeinfo/bad_cast/op_destructor.md b/reference/typeinfo/bad_cast/op_destructor.md index a3bcd2c397..cfe56e56ee 100644 --- a/reference/typeinfo/bad_cast/op_destructor.md +++ b/reference/typeinfo/bad_cast/op_destructor.md @@ -19,4 +19,3 @@ constexpr virtual ~bad_cast(); // (1) C++26 ## 関連項目 - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) - diff --git a/reference/typeinfo/bad_cast/what.md b/reference/typeinfo/bad_cast/what.md index 05cbfa24f8..6a18ff4915 100644 --- a/reference/typeinfo/bad_cast/what.md +++ b/reference/typeinfo/bad_cast/what.md @@ -21,4 +21,3 @@ constexpr const char* what() const noexcept override; // (1) C++26 ## 関連項目 - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) - diff --git a/reference/typeinfo/bad_typeid.md b/reference/typeinfo/bad_typeid.md index 4d6857dcb2..0cbb6fc976 100644 --- a/reference/typeinfo/bad_typeid.md +++ b/reference/typeinfo/bad_typeid.md @@ -56,4 +56,3 @@ std::bad_typeid ``` ## 参照 - diff --git a/reference/typeinfo/bad_typeid/op_assign.md b/reference/typeinfo/bad_typeid/op_assign.md index 2201791dbb..93f97f4d85 100644 --- a/reference/typeinfo/bad_typeid/op_assign.md +++ b/reference/typeinfo/bad_typeid/op_assign.md @@ -22,4 +22,3 @@ constexpr bad_typeid& operator=(const bad_typeid&) noexcept; // (1) C++26 ## 関連項目 - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) - diff --git a/reference/typeinfo/bad_typeid/op_constructor.md b/reference/typeinfo/bad_typeid/op_constructor.md index 5267ac55d6..015ae60594 100644 --- a/reference/typeinfo/bad_typeid/op_constructor.md +++ b/reference/typeinfo/bad_typeid/op_constructor.md @@ -27,4 +27,3 @@ constexpr bad_typeid(const bad_typeid&) noexcept; // (2) C++26 ## 関連項目 - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) - diff --git a/reference/typeinfo/bad_typeid/op_destructor.md b/reference/typeinfo/bad_typeid/op_destructor.md index caa71a8933..6cd6214eb7 100644 --- a/reference/typeinfo/bad_typeid/op_destructor.md +++ b/reference/typeinfo/bad_typeid/op_destructor.md @@ -19,4 +19,3 @@ constexpr virtual ~bad_typeid(); // (1) C++26 ## 関連項目 - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) - diff --git a/reference/typeinfo/bad_typeid/what.md b/reference/typeinfo/bad_typeid/what.md index 7ed42d3335..1dfb47f7d1 100644 --- a/reference/typeinfo/bad_typeid/what.md +++ b/reference/typeinfo/bad_typeid/what.md @@ -21,4 +21,3 @@ constexpr const char* what() const noexcept override; // (1) C++26 ## 関連項目 - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) - diff --git a/reference/typeinfo/type_info.md b/reference/typeinfo/type_info.md index a7065706c7..a928c57aed 100644 --- a/reference/typeinfo/type_info.md +++ b/reference/typeinfo/type_info.md @@ -93,4 +93,3 @@ same type? true ``` ## 参照 - diff --git a/reference/typeinfo/type_info/hash_code.md b/reference/typeinfo/type_info/hash_code.md index fa9bb5bbb9..c0a0c80ef8 100644 --- a/reference/typeinfo/type_info/hash_code.md +++ b/reference/typeinfo/type_info/hash_code.md @@ -57,5 +57,3 @@ int main() ## 参照 - [N2530 Making It Easier to Use `std::type_info` as an Index in an Associative Container](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2530.html) - - diff --git a/reference/typeinfo/type_info/name.md b/reference/typeinfo/type_info/name.md index 70936afbc8..492876a3bb 100644 --- a/reference/typeinfo/type_info/name.md +++ b/reference/typeinfo/type_info/name.md @@ -48,5 +48,3 @@ c ``` ## 参照 - - diff --git a/reference/typeinfo/type_info/op_constructor.md b/reference/typeinfo/type_info/op_constructor.md index bcf5815a36..ab0a4f6563 100644 --- a/reference/typeinfo/type_info/op_constructor.md +++ b/reference/typeinfo/type_info/op_constructor.md @@ -36,4 +36,3 @@ int main() ``` ## 参照 - diff --git a/reference/typeinfo/type_info/op_destructor.md b/reference/typeinfo/type_info/op_destructor.md index f29782ab36..f45805640d 100644 --- a/reference/typeinfo/type_info/op_destructor.md +++ b/reference/typeinfo/type_info/op_destructor.md @@ -21,4 +21,3 @@ virtual ~type_info(); ``` ## 参照 - diff --git a/reference/unordered_map/unordered_map.md b/reference/unordered_map/unordered_map.md index cc119df6ba..b27d92e792 100644 --- a/reference/unordered_map/unordered_map.md +++ b/reference/unordered_map/unordered_map.md @@ -282,4 +282,3 @@ int main() ## 参照 - [Unordered associative containers do not use allocator_traits to define member types](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2050) (上記の `pointer`、`const_pointer`、`reference`、`const_reference` の問題に対する修正案) - [P0919R3 Heterogeneous lookup for unordered containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0919r3.html) - diff --git a/reference/unordered_map/unordered_map/begin-size_type.md b/reference/unordered_map/unordered_map/begin-size_type.md index c15b1d1f39..3c53e4b12b 100644 --- a/reference/unordered_map/unordered_map/begin-size_type.md +++ b/reference/unordered_map/unordered_map/begin-size_type.md @@ -99,4 +99,3 @@ bucket = 10, bucket_size = 1, keys = { A, } | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_map/unordered_map/begin.md b/reference/unordered_map/unordered_map/begin.md index 69a43cb569..0dfc05f138 100644 --- a/reference/unordered_map/unordered_map/begin.md +++ b/reference/unordered_map/unordered_map/begin.md @@ -87,4 +87,3 @@ int main() | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_map/unordered_map/bucket_count.md b/reference/unordered_map/unordered_map/bucket_count.md index cb7658b70b..06ec609649 100644 --- a/reference/unordered_map/unordered_map/bucket_count.md +++ b/reference/unordered_map/unordered_map/bucket_count.md @@ -72,4 +72,3 @@ bucket count is 11 | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_map/unordered_map/bucket_size.md b/reference/unordered_map/unordered_map/bucket_size.md index 05d99ed36c..00fcd58e03 100644 --- a/reference/unordered_map/unordered_map/bucket_size.md +++ b/reference/unordered_map/unordered_map/bucket_size.md @@ -99,4 +99,3 @@ bucket = 10, bucket_size = 1, keys = { A, } | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_map/unordered_map/cbegin-size_type.md b/reference/unordered_map/unordered_map/cbegin-size_type.md index fdbf603422..f627431445 100644 --- a/reference/unordered_map/unordered_map/cbegin-size_type.md +++ b/reference/unordered_map/unordered_map/cbegin-size_type.md @@ -98,4 +98,3 @@ bucket = 10, bucket_size = 1, keys = { A, } | [`begin(size_type)`](begin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指すイテレータを取得 | | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_map/unordered_map/cbegin.md b/reference/unordered_map/unordered_map/cbegin.md index e3efa4ab5a..09b5dbb821 100644 --- a/reference/unordered_map/unordered_map/cbegin.md +++ b/reference/unordered_map/unordered_map/cbegin.md @@ -78,4 +78,3 @@ int main() | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_map/unordered_map/cend-size_type.md b/reference/unordered_map/unordered_map/cend-size_type.md index f6738baf64..7a4133d725 100644 --- a/reference/unordered_map/unordered_map/cend-size_type.md +++ b/reference/unordered_map/unordered_map/cend-size_type.md @@ -98,4 +98,3 @@ bucket = 10, bucket_size = 1, keys = { A, } | [`begin(size_type)`](begin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指すイテレータを取得 | | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_map/unordered_map/cend.md b/reference/unordered_map/unordered_map/cend.md index 9cd78ca7df..f3548921ce 100644 --- a/reference/unordered_map/unordered_map/cend.md +++ b/reference/unordered_map/unordered_map/cend.md @@ -82,5 +82,3 @@ int main() | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | - - diff --git a/reference/unordered_map/unordered_map/clear.md b/reference/unordered_map/unordered_map/clear.md index 34eaefc58f..366152e203 100644 --- a/reference/unordered_map/unordered_map/clear.md +++ b/reference/unordered_map/unordered_map/clear.md @@ -99,4 +99,3 @@ true | [`insert`](insert.md) | 要素の追加 | | [`erase`](erase.md) | 要素の削除 | | [`swap`](swap.md) | 内容の交換 | - diff --git a/reference/unordered_map/unordered_map/end-size_type.md b/reference/unordered_map/unordered_map/end-size_type.md index 18bc6bb360..472bb9fec8 100644 --- a/reference/unordered_map/unordered_map/end-size_type.md +++ b/reference/unordered_map/unordered_map/end-size_type.md @@ -99,4 +99,3 @@ bucket = 10, bucket_size = 1, keys = { A, } | [`begin(size_type)`](begin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_map/unordered_map/end.md b/reference/unordered_map/unordered_map/end.md index 76b508131c..a4ee7158ce 100644 --- a/reference/unordered_map/unordered_map/end.md +++ b/reference/unordered_map/unordered_map/end.md @@ -89,4 +89,3 @@ int main() | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 - diff --git a/reference/unordered_map/unordered_map/extract.md b/reference/unordered_map/unordered_map/extract.md index 200425e7c9..21454290ed 100644 --- a/reference/unordered_map/unordered_map/extract.md +++ b/reference/unordered_map/unordered_map/extract.md @@ -95,4 +95,3 @@ m2 : ## 参照 - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) - diff --git a/reference/unordered_map/unordered_map/get_allocator.md b/reference/unordered_map/unordered_map/get_allocator.md index 5bdfe6ed86..96189bf35c 100644 --- a/reference/unordered_map/unordered_map/get_allocator.md +++ b/reference/unordered_map/unordered_map/get_allocator.md @@ -49,5 +49,3 @@ int main() - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - 2010は、`noexcept`が修飾されていない。 - 2012, 2013は、`noexcept`が実装されていないため、`throw()`が修飾されている。 - - diff --git a/reference/unordered_map/unordered_map/hash_function.md b/reference/unordered_map/unordered_map/hash_function.md index a2a00e68a6..8f0ff7ea72 100644 --- a/reference/unordered_map/unordered_map/hash_function.md +++ b/reference/unordered_map/unordered_map/hash_function.md @@ -79,4 +79,3 @@ hash("2nd") = 12978775524054262047 |-----------------------------------------|------------------------------------------------------| | [`hash`](/reference/functional/hash.md) | デフォルトのハッシュ関数オブジェクト(class template) | | [`key_eq`](key_eq.md) | キー比較用関数オブジェクトの取得 | - diff --git a/reference/unordered_map/unordered_map/load_factor.md b/reference/unordered_map/unordered_map/load_factor.md index f8ff477f5c..7f9648efd1 100644 --- a/reference/unordered_map/unordered_map/load_factor.md +++ b/reference/unordered_map/unordered_map/load_factor.md @@ -88,5 +88,3 @@ current load_factor: 0.5 | [`size`](size.md) | 要素数の取得 | | [`bucket_count`](bucket_count.md) | バケット数の取得 | | [`max_load_factor`](max_load_factor.md) | 負荷率の最大値を取得、設定 | - - diff --git a/reference/unordered_map/unordered_map/max_bucket_count.md b/reference/unordered_map/unordered_map/max_bucket_count.md index 5876c30bc3..1e85abe2ae 100644 --- a/reference/unordered_map/unordered_map/max_bucket_count.md +++ b/reference/unordered_map/unordered_map/max_bucket_count.md @@ -66,4 +66,3 @@ max bucket count is 576460752303423487 | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_map/unordered_map/max_load_factor.md b/reference/unordered_map/unordered_map/max_load_factor.md index 8b64fc6d44..10d9abdf06 100644 --- a/reference/unordered_map/unordered_map/max_load_factor.md +++ b/reference/unordered_map/unordered_map/max_load_factor.md @@ -139,4 +139,3 @@ new load_factor: 1.125 | [`size`](size.md) | 要素数の取得 | | [`bucket_count`](bucket_count.md) | バケット数の取得 | | [`clear`](clear.md) | 全要素の削除 | - diff --git a/reference/unordered_map/unordered_map/max_size.md b/reference/unordered_map/unordered_map/max_size.md index 55f6243fb6..ff55d71924 100644 --- a/reference/unordered_map/unordered_map/max_size.md +++ b/reference/unordered_map/unordered_map/max_size.md @@ -66,5 +66,3 @@ libstdc++ では、コンテナのアロケータ `allocator_type` にメンバ |-----------------------|----------------------------| | [`empty`](empty.md) | コンテナが空かどうかを判定 | | [`size`](size.md) | 要素数の取得 | - - diff --git a/reference/unordered_map/unordered_map/op_constructor.md b/reference/unordered_map/unordered_map/op_constructor.md index 52717ff235..ae219993bb 100644 --- a/reference/unordered_map/unordered_map/op_constructor.md +++ b/reference/unordered_map/unordered_map/op_constructor.md @@ -261,4 +261,3 @@ libstdc++ には 4.8.2 現在、(6), (7), (8)の形式はない。 - [LWG 2210. Missing allocator-extended constructor for allocator-aware containers](http://cplusplus.github.io/LWG/lwg-defects.html#2210) (10), (11), (12), (13), (14), (15) を追加するきっかけとなったレポート なお、Discussion の例はアロケータの型が誤っているので注意 - diff --git a/reference/unordered_map/unordered_map/op_destructor.md b/reference/unordered_map/unordered_map/op_destructor.md index 68fcbe72ab..89fbc8e0fc 100644 --- a/reference/unordered_map/unordered_map/op_destructor.md +++ b/reference/unordered_map/unordered_map/op_destructor.md @@ -37,4 +37,3 @@ |---------------------------------------|----------------| | [`(constructor)`](op_constructor.md) | コンストラクタ | | [`operator=`](op_assign.md) | 代入演算子 | - diff --git a/reference/unordered_map/unordered_map/size.md b/reference/unordered_map/unordered_map/size.md index bc5cc38f5e..6db820a97c 100644 --- a/reference/unordered_map/unordered_map/size.md +++ b/reference/unordered_map/unordered_map/size.md @@ -71,4 +71,3 @@ int main() | [`begin`](begin.md) | 先頭要素を指すイテレータの取得 | | [`end`](end.md) | 最終要素の次を指すイテレータの取得 | | [`distance`](/reference/iterator/distance.md) | イテレータ間の距離を求める | - diff --git a/reference/unordered_map/unordered_multimap.md b/reference/unordered_map/unordered_multimap.md index 3bcbf5adbb..e30b470349 100644 --- a/reference/unordered_map/unordered_multimap.md +++ b/reference/unordered_map/unordered_multimap.md @@ -260,4 +260,3 @@ int main() ## 参照 - [Unordered associative containers do not use allocator_traits to define member types](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2050) (上記の `pointer`、`const_pointer`、`reference`、`const_reference` の問題に対する修正案) - [P0919R3 Heterogeneous lookup for unordered containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0919r3.html) - diff --git a/reference/unordered_map/unordered_multimap/begin-size_type.md b/reference/unordered_map/unordered_multimap/begin-size_type.md index 1a41447750..f9382ae5d1 100644 --- a/reference/unordered_map/unordered_multimap/begin-size_type.md +++ b/reference/unordered_map/unordered_multimap/begin-size_type.md @@ -99,4 +99,3 @@ bucket = 10, bucket_size = 1, keys = { A, } | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_map/unordered_multimap/begin.md b/reference/unordered_map/unordered_multimap/begin.md index 475536af10..3adc360f8d 100644 --- a/reference/unordered_map/unordered_multimap/begin.md +++ b/reference/unordered_map/unordered_multimap/begin.md @@ -87,4 +87,3 @@ int main() | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_map/unordered_multimap/bucket_count.md b/reference/unordered_map/unordered_multimap/bucket_count.md index 29ee1ff44f..07f816186f 100644 --- a/reference/unordered_map/unordered_multimap/bucket_count.md +++ b/reference/unordered_map/unordered_multimap/bucket_count.md @@ -72,4 +72,3 @@ bucket count is 11 | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_map/unordered_multimap/bucket_size.md b/reference/unordered_map/unordered_multimap/bucket_size.md index d59bd03e51..cc36c77433 100644 --- a/reference/unordered_map/unordered_multimap/bucket_size.md +++ b/reference/unordered_map/unordered_multimap/bucket_size.md @@ -99,4 +99,3 @@ bucket = 10, bucket_size = 1, keys = { A, } | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_map/unordered_multimap/cbegin-size_type.md b/reference/unordered_map/unordered_multimap/cbegin-size_type.md index d1261fae4a..dee4c28034 100644 --- a/reference/unordered_map/unordered_multimap/cbegin-size_type.md +++ b/reference/unordered_map/unordered_multimap/cbegin-size_type.md @@ -98,4 +98,3 @@ bucket = 10, bucket_size = 1, keys = { A, } | [`begin(size_type)`](begin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指すイテレータを取得 | | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_map/unordered_multimap/cbegin.md b/reference/unordered_map/unordered_multimap/cbegin.md index c5cc22b90f..4d7ffc104c 100644 --- a/reference/unordered_map/unordered_multimap/cbegin.md +++ b/reference/unordered_map/unordered_multimap/cbegin.md @@ -78,4 +78,3 @@ int main() | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_map/unordered_multimap/cend-size_type.md b/reference/unordered_map/unordered_multimap/cend-size_type.md index 494ea0ce12..5af72e4b19 100644 --- a/reference/unordered_map/unordered_multimap/cend-size_type.md +++ b/reference/unordered_map/unordered_multimap/cend-size_type.md @@ -98,4 +98,3 @@ bucket = 10, bucket_size = 1, keys = { A, } | [`begin(size_type)`](begin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指すイテレータを取得 | | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_map/unordered_multimap/cend.md b/reference/unordered_map/unordered_multimap/cend.md index 4ed55af0fd..6439d2e1a4 100644 --- a/reference/unordered_map/unordered_multimap/cend.md +++ b/reference/unordered_map/unordered_multimap/cend.md @@ -82,5 +82,3 @@ int main() | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | - - diff --git a/reference/unordered_map/unordered_multimap/clear.md b/reference/unordered_map/unordered_multimap/clear.md index 9480119e06..2870682a99 100644 --- a/reference/unordered_map/unordered_multimap/clear.md +++ b/reference/unordered_map/unordered_multimap/clear.md @@ -99,4 +99,3 @@ true | [`insert`](insert.md) | 要素の追加 | | [`erase`](erase.md) | 要素の削除 | | [`swap`](swap.md) | 内容の交換 | - diff --git a/reference/unordered_map/unordered_multimap/end-size_type.md b/reference/unordered_map/unordered_multimap/end-size_type.md index a4c3deb1e5..d64967b78a 100644 --- a/reference/unordered_map/unordered_multimap/end-size_type.md +++ b/reference/unordered_map/unordered_multimap/end-size_type.md @@ -99,4 +99,3 @@ bucket = 10, bucket_size = 1, keys = { A, } | [`begin(size_type)`](begin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_map/unordered_multimap/end.md b/reference/unordered_map/unordered_multimap/end.md index 04e9bff607..7fb3083fb4 100644 --- a/reference/unordered_map/unordered_multimap/end.md +++ b/reference/unordered_map/unordered_multimap/end.md @@ -89,4 +89,3 @@ int main() | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 - diff --git a/reference/unordered_map/unordered_multimap/extract.md b/reference/unordered_map/unordered_multimap/extract.md index 2c4033978e..9c2bcd1661 100644 --- a/reference/unordered_map/unordered_multimap/extract.md +++ b/reference/unordered_map/unordered_multimap/extract.md @@ -95,4 +95,3 @@ m2 : ## 参照 - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) - diff --git a/reference/unordered_map/unordered_multimap/get_allocator.md b/reference/unordered_map/unordered_multimap/get_allocator.md index 745d784f58..2d51cacb04 100644 --- a/reference/unordered_map/unordered_multimap/get_allocator.md +++ b/reference/unordered_map/unordered_multimap/get_allocator.md @@ -49,5 +49,3 @@ int main() - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - 2010は、`noexcept`が修飾されていない。 - 2012, 2013は、`noexcept`が実装されていないため、`throw()`が修飾されている。 - - diff --git a/reference/unordered_map/unordered_multimap/hash_function.md b/reference/unordered_map/unordered_multimap/hash_function.md index 6d7e705b25..547bfbcb9d 100644 --- a/reference/unordered_map/unordered_multimap/hash_function.md +++ b/reference/unordered_map/unordered_multimap/hash_function.md @@ -79,4 +79,3 @@ hash("2nd") = 12978775524054262047 |-----------------------------------------|------------------------------------------------------| | [`hash`](/reference/functional/hash.md) | デフォルトのハッシュ関数オブジェクト(class template) | | [`key_eq`](key_eq.md) | キー比較用関数オブジェクトの取得 | - diff --git a/reference/unordered_map/unordered_multimap/key_eq.md b/reference/unordered_map/unordered_multimap/key_eq.md index 0843232d26..bb4d83fc2e 100644 --- a/reference/unordered_map/unordered_multimap/key_eq.md +++ b/reference/unordered_map/unordered_multimap/key_eq.md @@ -77,4 +77,3 @@ eq("1st", "2nd") = true |----------------------------------------------------|----------------------------------------------| | [`equal_to`](/reference/functional/equal_to.md) | 等値比較演算関数オブジェクト(class template) | | [`hash_function`](hash_function.md) | ハッシュ関数オブジェクトの取得 | - diff --git a/reference/unordered_map/unordered_multimap/load_factor.md b/reference/unordered_map/unordered_multimap/load_factor.md index 9a41c7905f..6f933d721b 100644 --- a/reference/unordered_map/unordered_multimap/load_factor.md +++ b/reference/unordered_map/unordered_multimap/load_factor.md @@ -89,5 +89,3 @@ current load_factor: 0.5 | [`size`](size.md) | 要素数の取得 | | [`bucket_count`](bucket_count.md) | バケット数の取得 | | [`max_load_factor`](max_load_factor.md) | 負荷率の最大値を取得、設定 | - - diff --git a/reference/unordered_map/unordered_multimap/max_bucket_count.md b/reference/unordered_map/unordered_multimap/max_bucket_count.md index ca3bc3d6aa..98182b12a1 100644 --- a/reference/unordered_map/unordered_multimap/max_bucket_count.md +++ b/reference/unordered_map/unordered_multimap/max_bucket_count.md @@ -66,4 +66,3 @@ max bucket count is 576460752303423487 | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_map/unordered_multimap/max_load_factor.md b/reference/unordered_map/unordered_multimap/max_load_factor.md index 7b587bc740..f9ec4b3bba 100644 --- a/reference/unordered_map/unordered_multimap/max_load_factor.md +++ b/reference/unordered_map/unordered_multimap/max_load_factor.md @@ -141,4 +141,3 @@ new load_factor: 1.125 | [`size`](size.md) | 要素数の取得 | | [`bucket_count`](bucket_count.md) | バケット数の取得 | | [`clear`](clear.md) | 全要素の削除 | - diff --git a/reference/unordered_map/unordered_multimap/max_size.md b/reference/unordered_map/unordered_multimap/max_size.md index 8db7d77893..add2a7b7f2 100644 --- a/reference/unordered_map/unordered_multimap/max_size.md +++ b/reference/unordered_map/unordered_multimap/max_size.md @@ -66,5 +66,3 @@ libstdc++ では、コンテナのアロケータ `allocator_type` にメンバ |-----------------------|----------------------------| | [`empty`](empty.md) | コンテナが空かどうかを判定 | | [`size`](size.md) | 要素数の取得 | - - diff --git a/reference/unordered_map/unordered_multimap/op_constructor.md b/reference/unordered_map/unordered_multimap/op_constructor.md index 677cf0816a..b3aedaa5d8 100644 --- a/reference/unordered_map/unordered_multimap/op_constructor.md +++ b/reference/unordered_map/unordered_multimap/op_constructor.md @@ -265,4 +265,3 @@ libstdc++ には 4.8.2 現在、(6), (7), (8)の形式はない。 - [LWG 2210. Missing allocator-extended constructor for allocator-aware containers](http://cplusplus.github.io/LWG/lwg-defects.html#2210) (10), (11), (12), (13), (14), (15) を追加するきっかけとなったレポート なお、Discussion の例はアロケータの型が誤っているので注意 - diff --git a/reference/unordered_map/unordered_multimap/op_destructor.md b/reference/unordered_map/unordered_multimap/op_destructor.md index 84018747fc..fb60b50d2f 100644 --- a/reference/unordered_map/unordered_multimap/op_destructor.md +++ b/reference/unordered_map/unordered_multimap/op_destructor.md @@ -37,4 +37,3 @@ |--------------------------------------------|----------------| | [`(constructor)`](op_constructor.md) | コンストラクタ | | [`operator=`](op_assign.md) | 代入演算子 | - diff --git a/reference/unordered_map/unordered_multimap/size.md b/reference/unordered_map/unordered_multimap/size.md index 40cab4e3b4..5b99081eb9 100644 --- a/reference/unordered_map/unordered_multimap/size.md +++ b/reference/unordered_map/unordered_multimap/size.md @@ -71,4 +71,3 @@ int main() | [`begin`](begin.md) | 先頭要素を指すイテレータの取得 | | [`end`](end.md) | 最終要素の次を指すイテレータの取得 | | [`distance`](/reference/iterator/distance.md) | イテレータ間の距離を求める | - diff --git a/reference/unordered_set/unordered_multiset.md b/reference/unordered_set/unordered_multiset.md index 5efc49c18b..811a4030cf 100644 --- a/reference/unordered_set/unordered_multiset.md +++ b/reference/unordered_set/unordered_multiset.md @@ -250,4 +250,3 @@ int main() ## 参照 - [Unordered associative containers do not use allocator_traits to define member types](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2050) (上記の `pointer`、`const_pointer`、`reference`、`const_reference` の問題に対する修正案) - [P0919R3 Heterogeneous lookup for unordered containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0919r3.html) - diff --git a/reference/unordered_set/unordered_multiset/begin-size_type.md b/reference/unordered_set/unordered_multiset/begin-size_type.md index f77ec85370..356976774b 100644 --- a/reference/unordered_set/unordered_multiset/begin-size_type.md +++ b/reference/unordered_set/unordered_multiset/begin-size_type.md @@ -99,4 +99,3 @@ bucket = 10, bucket_size = 0, keys = { } | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_set/unordered_multiset/begin.md b/reference/unordered_set/unordered_multiset/begin.md index c071882966..b0bd3d832a 100644 --- a/reference/unordered_set/unordered_multiset/begin.md +++ b/reference/unordered_set/unordered_multiset/begin.md @@ -86,4 +86,3 @@ int main() | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_set/unordered_multiset/bucket_count.md b/reference/unordered_set/unordered_multiset/bucket_count.md index 1622b10f87..761cbe0fa9 100644 --- a/reference/unordered_set/unordered_multiset/bucket_count.md +++ b/reference/unordered_set/unordered_multiset/bucket_count.md @@ -65,4 +65,3 @@ bucket count is 11 | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_set/unordered_multiset/bucket_size.md b/reference/unordered_set/unordered_multiset/bucket_size.md index 9a31becc56..161dec736e 100644 --- a/reference/unordered_set/unordered_multiset/bucket_size.md +++ b/reference/unordered_set/unordered_multiset/bucket_size.md @@ -90,4 +90,3 @@ bucket = 10, bucket_size = 0, keys = { } | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_set/unordered_multiset/cbegin-size_type.md b/reference/unordered_set/unordered_multiset/cbegin-size_type.md index 6859d72a6e..fb5ce0ff8e 100644 --- a/reference/unordered_set/unordered_multiset/cbegin-size_type.md +++ b/reference/unordered_set/unordered_multiset/cbegin-size_type.md @@ -92,4 +92,3 @@ bucket = 10, bucket_size = 0, keys = { } | [`begin(size_type)`](begin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指すイテレータを取得 | | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_set/unordered_multiset/cbegin.md b/reference/unordered_set/unordered_multiset/cbegin.md index e5c62c1553..3e533ede78 100644 --- a/reference/unordered_set/unordered_multiset/cbegin.md +++ b/reference/unordered_set/unordered_multiset/cbegin.md @@ -74,4 +74,3 @@ int main() | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_set/unordered_multiset/cend-size_type.md b/reference/unordered_set/unordered_multiset/cend-size_type.md index 870fb4ab80..e2e17b6339 100644 --- a/reference/unordered_set/unordered_multiset/cend-size_type.md +++ b/reference/unordered_set/unordered_multiset/cend-size_type.md @@ -92,4 +92,3 @@ bucket = 10, bucket_size = 0, keys = { } | [`begin(size_type)`](begin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指すイテレータを取得 | | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_set/unordered_multiset/cend.md b/reference/unordered_set/unordered_multiset/cend.md index 5c9233d2c8..0aeb59be98 100644 --- a/reference/unordered_set/unordered_multiset/cend.md +++ b/reference/unordered_set/unordered_multiset/cend.md @@ -74,4 +74,3 @@ int main() | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_set/unordered_multiset/clear.md b/reference/unordered_set/unordered_multiset/clear.md index f19039fd31..0f012bdd6a 100644 --- a/reference/unordered_set/unordered_multiset/clear.md +++ b/reference/unordered_set/unordered_multiset/clear.md @@ -99,4 +99,3 @@ true | [`insert`](insert.md) | 要素の追加 | | [`erase`](erase.md) | 要素の削除 | | [`swap`](swap.md) | 内容の交換 | - diff --git a/reference/unordered_set/unordered_multiset/emplace.md b/reference/unordered_set/unordered_multiset/emplace.md index 8b0d1a122e..485dc364d2 100644 --- a/reference/unordered_set/unordered_multiset/emplace.md +++ b/reference/unordered_set/unordered_multiset/emplace.md @@ -160,4 +160,3 @@ int main() ## 参照 - [N2680 Proposed Wording for Placement Insert (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2680.pdf) - diff --git a/reference/unordered_set/unordered_multiset/emplace_hint.md b/reference/unordered_set/unordered_multiset/emplace_hint.md index 59130ed8ca..e6e4f681b5 100644 --- a/reference/unordered_set/unordered_multiset/emplace_hint.md +++ b/reference/unordered_set/unordered_multiset/emplace_hint.md @@ -193,4 +193,3 @@ int main() ## 参照 - [N2680 Proposed Wording for Placement Insert (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2680.pdf) - diff --git a/reference/unordered_set/unordered_multiset/end-size_type.md b/reference/unordered_set/unordered_multiset/end-size_type.md index 0eb591e854..e69d99f5b8 100644 --- a/reference/unordered_set/unordered_multiset/end-size_type.md +++ b/reference/unordered_set/unordered_multiset/end-size_type.md @@ -99,4 +99,3 @@ bucket = 10, bucket_size = 0, keys = { } | [`begin(size_type)`](begin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_set/unordered_multiset/end.md b/reference/unordered_set/unordered_multiset/end.md index b16ed623e5..873156ec08 100644 --- a/reference/unordered_set/unordered_multiset/end.md +++ b/reference/unordered_set/unordered_multiset/end.md @@ -86,4 +86,3 @@ int main() | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_set/unordered_multiset/extract.md b/reference/unordered_set/unordered_multiset/extract.md index 50b21f1e56..3788267b37 100644 --- a/reference/unordered_set/unordered_multiset/extract.md +++ b/reference/unordered_set/unordered_multiset/extract.md @@ -136,4 +136,3 @@ s2 = { 3, 1 } ## 参照 - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) - diff --git a/reference/unordered_set/unordered_multiset/get_allocator.md b/reference/unordered_set/unordered_multiset/get_allocator.md index 6a86be685a..fe8d38cc95 100644 --- a/reference/unordered_set/unordered_multiset/get_allocator.md +++ b/reference/unordered_set/unordered_multiset/get_allocator.md @@ -117,4 +117,3 @@ libstdc++ の `unordered_multiset` では、アロケータの `select_on_contai | [`swap`](op_assign.md) | 内容の交換(非メンバ関数) | | [`allocator`](/reference/memory/allocator.md) | デフォルトのアロケータ | | [`allocator_traits`](/reference/memory/allocator_traits.md) | アロケータのトレイツ | - diff --git a/reference/unordered_set/unordered_multiset/hash_function.md b/reference/unordered_set/unordered_multiset/hash_function.md index 64a9e4f650..6513c2e7d9 100644 --- a/reference/unordered_set/unordered_multiset/hash_function.md +++ b/reference/unordered_set/unordered_multiset/hash_function.md @@ -74,4 +74,3 @@ hash(2) = 2 |-----------------------------------------|------------------------------------------------------| | [`hash`](/reference/functional/hash.md) | デフォルトのハッシュ関数オブジェクト(class template) | | [`key_eq`](key_eq.md) | キー比較用関数オブジェクトの取得 | - diff --git a/reference/unordered_set/unordered_multiset/key_eq.md b/reference/unordered_set/unordered_multiset/key_eq.md index dc640d569d..c30fd02ac7 100644 --- a/reference/unordered_set/unordered_multiset/key_eq.md +++ b/reference/unordered_set/unordered_multiset/key_eq.md @@ -72,4 +72,3 @@ eq(1, 1) = true |----------------------------------------------------|----------------------------------------------| | [`equal_to`](/reference/functional/equal_to.md) | 等値比較演算関数オブジェクト(class template) | | [`hash_function`](hash_function.md) | ハッシュ関数オブジェクトの取得 | - diff --git a/reference/unordered_set/unordered_multiset/load_factor.md b/reference/unordered_set/unordered_multiset/load_factor.md index 5514c82302..55a2171da9 100644 --- a/reference/unordered_set/unordered_multiset/load_factor.md +++ b/reference/unordered_set/unordered_multiset/load_factor.md @@ -93,4 +93,3 @@ size is 20, bucket_count is 23, load_factor is 0.869565 | [`max_load_factor`](max_load_factor.md) | 負荷率の最大値を取得、設定 | | [`rehash`](rehash.md) | 最小バケット数指定によるバケット数の調整 | | [`reserve`](reserve.md) | 最小要素数指定によるバケット数の調整 | - diff --git a/reference/unordered_set/unordered_multiset/max_bucket_count.md b/reference/unordered_set/unordered_multiset/max_bucket_count.md index 6b1a1eb045..c4d4ccf19a 100644 --- a/reference/unordered_set/unordered_multiset/max_bucket_count.md +++ b/reference/unordered_set/unordered_multiset/max_bucket_count.md @@ -65,4 +65,3 @@ max bucket count is 2305843009213693951 | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_set/unordered_multiset/max_load_factor.md b/reference/unordered_set/unordered_multiset/max_load_factor.md index 437cd640ba..ad26692c1d 100644 --- a/reference/unordered_set/unordered_multiset/max_load_factor.md +++ b/reference/unordered_set/unordered_multiset/max_load_factor.md @@ -183,4 +183,3 @@ size is 27, bucket_count is 29, load_factor is 0.931035, bucket_count * max_load | [`load_factor`](load_factor.md) | 現在の負荷率(バケットあたりの要素数の平均)を取得 | | [`rehash`](rehash.md) | 最小バケット数指定によるバケット数の調整 | | [`reserve`](reserve.md) | 最小要素数指定によるバケット数の調整 | - diff --git a/reference/unordered_set/unordered_multiset/max_size.md b/reference/unordered_set/unordered_multiset/max_size.md index 63210aa913..2f816d1d34 100644 --- a/reference/unordered_set/unordered_multiset/max_size.md +++ b/reference/unordered_set/unordered_multiset/max_size.md @@ -66,4 +66,3 @@ libstdc++ では、コンテナのアロケータ `allocator_type` にメンバ |-----------------------|----------------------------| | [`empty`](empty.md) | コンテナが空かどうかを判定 | | [`size`](size.md) | 要素数の取得 | - diff --git a/reference/unordered_set/unordered_multiset/op_constructor.md b/reference/unordered_set/unordered_multiset/op_constructor.md index fe3d5b79b0..3bd7bbed6f 100644 --- a/reference/unordered_set/unordered_multiset/op_constructor.md +++ b/reference/unordered_set/unordered_multiset/op_constructor.md @@ -266,4 +266,3 @@ libstdc++ には 4.8.2 現在、(6), (7), (8)の形式はない。 - [LWG 2210. Missing allocator-extended constructor for allocator-aware containers](http://cplusplus.github.io/LWG/lwg-defects.html#2210) (10), (11), (12), (13), (14), (15) を追加するきっかけとなったレポート なお、Discussion の例はアロケータの型が誤っているので注意 - diff --git a/reference/unordered_set/unordered_multiset/op_deduction_guide.md b/reference/unordered_set/unordered_multiset/op_deduction_guide.md index 54e4fab210..adae43ec34 100644 --- a/reference/unordered_set/unordered_multiset/op_deduction_guide.md +++ b/reference/unordered_set/unordered_multiset/op_deduction_guide.md @@ -149,4 +149,3 @@ int main() ## 参照 - [P0433R2 Toward a resolution of US7 and US14: Integrating template deduction for class templates into the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0433r2.html) - diff --git a/reference/unordered_set/unordered_multiset/op_destructor.md b/reference/unordered_set/unordered_multiset/op_destructor.md index b92b8cc89d..862734efbe 100644 --- a/reference/unordered_set/unordered_multiset/op_destructor.md +++ b/reference/unordered_set/unordered_multiset/op_destructor.md @@ -37,4 +37,3 @@ |--------------------------------------------|----------------| | [`(constructor)`](op_constructor.md) | コンストラクタ | | [`operator=`](op_assign.md) | 代入演算子 | - diff --git a/reference/unordered_set/unordered_multiset/rehash.md b/reference/unordered_set/unordered_multiset/rehash.md index 354edf18b8..c66bad51d8 100644 --- a/reference/unordered_set/unordered_multiset/rehash.md +++ b/reference/unordered_set/unordered_multiset/rehash.md @@ -98,4 +98,3 @@ bucket_count is 13 | [`load_factor`](load_factor.md) | 現在の負荷率(バケットあたりの要素数の平均)を取得 | | [`max_load_factor`](max_load_factor.md) | 負荷率の最大値を取得、設定 | | [`reserve`](reserve.md) | 最小要素数指定によるバケット数の調整 | - diff --git a/reference/unordered_set/unordered_multiset/reserve.md b/reference/unordered_set/unordered_multiset/reserve.md index 14596455a0..31d7f45003 100644 --- a/reference/unordered_set/unordered_multiset/reserve.md +++ b/reference/unordered_set/unordered_multiset/reserve.md @@ -104,4 +104,3 @@ bucket_count is 13 | [`insert`](insert.md) | 要素の追加 | | [`emplace`](emplace.md) | コンテナ内への要素の直接構築 | | [`emplace_hint`](emplace_hint.md) | 挿入位置のヒントを使用したコンテナ内への要素の直接構築 | - diff --git a/reference/unordered_set/unordered_multiset/size.md b/reference/unordered_set/unordered_multiset/size.md index 64391771c4..dba16be1bb 100644 --- a/reference/unordered_set/unordered_multiset/size.md +++ b/reference/unordered_set/unordered_multiset/size.md @@ -70,4 +70,3 @@ int main() | [`begin`](begin.md) | 先頭要素を指すイテレータの取得 | | [`end`](end.md) | 最終要素の次を指すイテレータの取得 | | [`distance`](/reference/iterator/distance.md) | イテレータ間の距離を求める | - diff --git a/reference/unordered_set/unordered_set.md b/reference/unordered_set/unordered_set.md index f66dc57141..6bf31d6ca3 100644 --- a/reference/unordered_set/unordered_set.md +++ b/reference/unordered_set/unordered_set.md @@ -258,4 +258,3 @@ int main() ## 参照 - [Unordered associative containers do not use allocator_traits to define member types](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2050) (上記の `pointer`、`const_pointer`、`reference`、`const_reference` の問題に対する修正案) - [P0919R3 Heterogeneous lookup for unordered containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0919r3.html) - diff --git a/reference/unordered_set/unordered_set/begin-size_type.md b/reference/unordered_set/unordered_set/begin-size_type.md index 2076654602..eb8e71811a 100644 --- a/reference/unordered_set/unordered_set/begin-size_type.md +++ b/reference/unordered_set/unordered_set/begin-size_type.md @@ -93,4 +93,3 @@ bucket = 4, bucket_size = 2, keys = { C, B, } | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_set/unordered_set/begin.md b/reference/unordered_set/unordered_set/begin.md index 672b8f4934..c8e71b91a7 100644 --- a/reference/unordered_set/unordered_set/begin.md +++ b/reference/unordered_set/unordered_set/begin.md @@ -87,4 +87,3 @@ int main() | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_set/unordered_set/bucket_count.md b/reference/unordered_set/unordered_set/bucket_count.md index c496ef7855..4d043bacb5 100644 --- a/reference/unordered_set/unordered_set/bucket_count.md +++ b/reference/unordered_set/unordered_set/bucket_count.md @@ -65,4 +65,3 @@ bucket count is 5 | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_set/unordered_set/bucket_size.md b/reference/unordered_set/unordered_set/bucket_size.md index 31bf37f81c..ea42655f41 100644 --- a/reference/unordered_set/unordered_set/bucket_size.md +++ b/reference/unordered_set/unordered_set/bucket_size.md @@ -84,4 +84,3 @@ bucket = 4, bucket_size = 2, keys = { C, B, } | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_set/unordered_set/cbegin-size_type.md b/reference/unordered_set/unordered_set/cbegin-size_type.md index 2ad2f5744d..1be7875716 100644 --- a/reference/unordered_set/unordered_set/cbegin-size_type.md +++ b/reference/unordered_set/unordered_set/cbegin-size_type.md @@ -86,4 +86,3 @@ bucket = 4, bucket_size = 2, keys = { C, B, } | [`begin(size_type)`](begin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指すイテレータを取得 | | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_set/unordered_set/cbegin.md b/reference/unordered_set/unordered_set/cbegin.md index b349917783..e47ebd7a92 100644 --- a/reference/unordered_set/unordered_set/cbegin.md +++ b/reference/unordered_set/unordered_set/cbegin.md @@ -74,4 +74,3 @@ int main() | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_set/unordered_set/cend-size_type.md b/reference/unordered_set/unordered_set/cend-size_type.md index 6971498d1c..74575bbec1 100644 --- a/reference/unordered_set/unordered_set/cend-size_type.md +++ b/reference/unordered_set/unordered_set/cend-size_type.md @@ -86,4 +86,3 @@ bucket = 4, bucket_size = 2, keys = { C, B, } | [`begin(size_type)`](begin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指すイテレータを取得 | | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_set/unordered_set/cend.md b/reference/unordered_set/unordered_set/cend.md index 8e48fcc5cd..bd28fd4ed4 100644 --- a/reference/unordered_set/unordered_set/cend.md +++ b/reference/unordered_set/unordered_set/cend.md @@ -74,4 +74,3 @@ int main() | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_set/unordered_set/clear.md b/reference/unordered_set/unordered_set/clear.md index 4aabb8fe94..eee1da28c5 100644 --- a/reference/unordered_set/unordered_set/clear.md +++ b/reference/unordered_set/unordered_set/clear.md @@ -99,4 +99,3 @@ true | [`insert`](insert.md) | 要素の追加 | | [`erase`](erase.md) | 要素の削除 | | [`swap`](swap.md) | 内容の交換 | - diff --git a/reference/unordered_set/unordered_set/emplace.md b/reference/unordered_set/unordered_set/emplace.md index 029f90af4c..7336a83429 100644 --- a/reference/unordered_set/unordered_set/emplace.md +++ b/reference/unordered_set/unordered_set/emplace.md @@ -175,4 +175,3 @@ int main() ## 参照 - [N2680 Proposed Wording for Placement Insert (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2680.pdf) - diff --git a/reference/unordered_set/unordered_set/emplace_hint.md b/reference/unordered_set/unordered_set/emplace_hint.md index ed32ac3ffb..8a4e2442e1 100644 --- a/reference/unordered_set/unordered_set/emplace_hint.md +++ b/reference/unordered_set/unordered_set/emplace_hint.md @@ -171,4 +171,3 @@ int main() ## 参照 - [N2680 Proposed Wording for Placement Insert (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2680.pdf) - diff --git a/reference/unordered_set/unordered_set/end-size_type.md b/reference/unordered_set/unordered_set/end-size_type.md index 0b2d98e0a9..2305a3af30 100644 --- a/reference/unordered_set/unordered_set/end-size_type.md +++ b/reference/unordered_set/unordered_set/end-size_type.md @@ -93,4 +93,3 @@ bucket = 4, bucket_size = 2, keys = { C, B, } | [`begin(size_type)`](begin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_set/unordered_set/end.md b/reference/unordered_set/unordered_set/end.md index 5d5de06c5c..5ea69f1cff 100644 --- a/reference/unordered_set/unordered_set/end.md +++ b/reference/unordered_set/unordered_set/end.md @@ -86,4 +86,3 @@ int main() | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_set/unordered_set/extract.md b/reference/unordered_set/unordered_set/extract.md index 7e902f5367..06a6126d77 100644 --- a/reference/unordered_set/unordered_set/extract.md +++ b/reference/unordered_set/unordered_set/extract.md @@ -136,4 +136,3 @@ s2 = { 3, 2 } ## 参照 - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) - diff --git a/reference/unordered_set/unordered_set/get_allocator.md b/reference/unordered_set/unordered_set/get_allocator.md index 36991575dc..c770af92d7 100644 --- a/reference/unordered_set/unordered_set/get_allocator.md +++ b/reference/unordered_set/unordered_set/get_allocator.md @@ -116,4 +116,3 @@ libstdc++ の `unordered_set` では、アロケータの `select_on_container_c | [`swap`](swap_free.md) | 内容の交換(非メンバ関数) | | [`allocator`](/reference/memory/allocator.md) | デフォルトのアロケータ | | [`allocator_traits`](/reference/memory/allocator_traits.md) | アロケータのトレイツ | - diff --git a/reference/unordered_set/unordered_set/hash_function.md b/reference/unordered_set/unordered_set/hash_function.md index a6b5bbf089..4512c57774 100644 --- a/reference/unordered_set/unordered_set/hash_function.md +++ b/reference/unordered_set/unordered_set/hash_function.md @@ -74,4 +74,3 @@ hash(2) = 2 |-----------------------------------------|------------------------------------------------------| | [`hash`](/reference/functional/hash.md) | デフォルトのハッシュ関数オブジェクト(class template) | | [`key_eq`](key_eq.md) | キー比較用関数オブジェクトの取得 | - diff --git a/reference/unordered_set/unordered_set/key_eq.md b/reference/unordered_set/unordered_set/key_eq.md index 8be0bf7fee..d5c80cdced 100644 --- a/reference/unordered_set/unordered_set/key_eq.md +++ b/reference/unordered_set/unordered_set/key_eq.md @@ -72,4 +72,3 @@ eq(1, 1) = true |----------------------------------------------------|----------------------------------------------| | [`equal_to`](/reference/functional/equal_to.md) | 等値比較演算関数オブジェクト(class template) | | [`hash_function`](hash_function.md) | ハッシュ関数オブジェクトの取得 | - diff --git a/reference/unordered_set/unordered_set/load_factor.md b/reference/unordered_set/unordered_set/load_factor.md index 7e755e4aae..a928d1c837 100644 --- a/reference/unordered_set/unordered_set/load_factor.md +++ b/reference/unordered_set/unordered_set/load_factor.md @@ -93,4 +93,3 @@ size is 10, bucket_count is 11, load_factor is 0.909091 | [`max_load_factor`](max_load_factor.md) | 負荷率の最大値を取得、設定 | | [`rehash`](rehash.md) | 最小バケット数指定によるバケット数の調整 | | [`reserve`](reserve.md) | 最小要素数指定によるバケット数の調整 | - diff --git a/reference/unordered_set/unordered_set/max_bucket_count.md b/reference/unordered_set/unordered_set/max_bucket_count.md index ce2f112476..759028262a 100644 --- a/reference/unordered_set/unordered_set/max_bucket_count.md +++ b/reference/unordered_set/unordered_set/max_bucket_count.md @@ -65,4 +65,3 @@ max bucket count is 2305843009213693951 | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | - diff --git a/reference/unordered_set/unordered_set/max_load_factor.md b/reference/unordered_set/unordered_set/max_load_factor.md index d222f45d88..3e6ea3cd99 100644 --- a/reference/unordered_set/unordered_set/max_load_factor.md +++ b/reference/unordered_set/unordered_set/max_load_factor.md @@ -183,4 +183,3 @@ size is 27, bucket_count is 29, load_factor is 0.931035, bucket_count * max_load | [`load_factor`](load_factor.md) | 現在の負荷率(バケットあたりの要素数の平均)を取得 | | [`rehash`](rehash.md) | 最小バケット数指定によるバケット数の調整 | | [`reserve`](reserve.md) | 最小要素数指定によるバケット数の調整 | - diff --git a/reference/unordered_set/unordered_set/max_size.md b/reference/unordered_set/unordered_set/max_size.md index 769203e9e1..eca44e32ad 100644 --- a/reference/unordered_set/unordered_set/max_size.md +++ b/reference/unordered_set/unordered_set/max_size.md @@ -67,4 +67,3 @@ C++11 ではアロケータにメンバ関数 `max_size` は必須ではない |-----------------------|----------------------------| | [`empty`](empty.md) | コンテナが空かどうかを判定 | | [`size`](size.md) | 要素数の取得 | - diff --git a/reference/unordered_set/unordered_set/op_assign.md b/reference/unordered_set/unordered_set/op_assign.md index aa5b94719c..64d8ce2ba6 100644 --- a/reference/unordered_set/unordered_set/op_assign.md +++ b/reference/unordered_set/unordered_set/op_assign.md @@ -90,4 +90,3 @@ unordered_set& operator=(initializer_list il); // (3) - (3)の経緯となる提案文書 - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) - `noexcept` 追加の経緯となる提案文書 - diff --git a/reference/unordered_set/unordered_set/op_constructor.md b/reference/unordered_set/unordered_set/op_constructor.md index 28886dd98d..a6048b8790 100644 --- a/reference/unordered_set/unordered_set/op_constructor.md +++ b/reference/unordered_set/unordered_set/op_constructor.md @@ -266,4 +266,3 @@ libstdc++ には 4.8.2 現在、(6), (7), (8)の形式はない。 - [LWG 2210. Missing allocator-extended constructor for allocator-aware containers](http://cplusplus.github.io/LWG/lwg-defects.html#2210) (10), (11), (12), (13), (14), (15) を追加するきっかけとなったレポート なお、Discussion の例はアロケータの型が誤っているので注意 - diff --git a/reference/unordered_set/unordered_set/op_deduction_guide.md b/reference/unordered_set/unordered_set/op_deduction_guide.md index 624bf573fa..66d040423b 100644 --- a/reference/unordered_set/unordered_set/op_deduction_guide.md +++ b/reference/unordered_set/unordered_set/op_deduction_guide.md @@ -145,4 +145,3 @@ int main() ## 参照 - [P0433R2 Toward a resolution of US7 and US14: Integrating template deduction for class templates into the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0433r2.html) - diff --git a/reference/unordered_set/unordered_set/op_destructor.md b/reference/unordered_set/unordered_set/op_destructor.md index 6865246bef..7fbe687cab 100644 --- a/reference/unordered_set/unordered_set/op_destructor.md +++ b/reference/unordered_set/unordered_set/op_destructor.md @@ -37,4 +37,3 @@ |----------------------------------------|----------------| | [`(constructor)`](op_constructor.md) | コンストラクタ | | [`operator=`](op_assign.md) | 代入演算子 | - diff --git a/reference/unordered_set/unordered_set/rehash.md b/reference/unordered_set/unordered_set/rehash.md index cbcb5d2724..e4fea065e5 100644 --- a/reference/unordered_set/unordered_set/rehash.md +++ b/reference/unordered_set/unordered_set/rehash.md @@ -98,4 +98,3 @@ bucket_count is 7 | [`load_factor`](load_factor.md) | 現在の負荷率(バケットあたりの要素数の平均)を取得 | | [`max_load_factor`](max_load_factor.md) | 負荷率の最大値を取得、設定 | | [`reserve`](reserve.md) | 最小要素数指定によるバケット数の調整 | - diff --git a/reference/unordered_set/unordered_set/reserve.md b/reference/unordered_set/unordered_set/reserve.md index 776c83ea35..0810b91b1b 100644 --- a/reference/unordered_set/unordered_set/reserve.md +++ b/reference/unordered_set/unordered_set/reserve.md @@ -104,4 +104,3 @@ bucket_count is 7 | [`insert`](insert.md) | 要素の追加 | | [`emplace`](emplace.md) | コンテナ内への要素の直接構築 | | [`emplace_hint`](emplace_hint.md) | 挿入位置のヒントを使用したコンテナ内への要素の直接構築 | - diff --git a/reference/unordered_set/unordered_set/size.md b/reference/unordered_set/unordered_set/size.md index 34403bc927..0a855b5f15 100644 --- a/reference/unordered_set/unordered_set/size.md +++ b/reference/unordered_set/unordered_set/size.md @@ -70,4 +70,3 @@ int main() | [`begin`](begin.md) | 先頭要素を指すイテレータの取得 | | [`end`](end.md) | 最終要素の次を指すイテレータの取得 | | [`distance`](/reference/iterator/distance.md) | イテレータ間の距離を求める | - diff --git a/reference/utility/declval.md b/reference/utility/declval.md index 66ac23be88..f46c295322 100644 --- a/reference/utility/declval.md +++ b/reference/utility/declval.md @@ -88,4 +88,3 @@ int main() ## 参照 - [LWG Issue 1255. `declval` should be added to the library](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#1255) - [N3276 US22/DE9 Revisited: Decltype and Call Expressions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3276.pdf) - diff --git a/reference/utility/forward.md b/reference/utility/forward.md index e5d0c95eae..85eb3eb8af 100644 --- a/reference/utility/forward.md +++ b/reference/utility/forward.md @@ -119,5 +119,3 @@ int main() - [N1385 The Forwarding Problem: Arguments](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2002/n1385.htm) - [N2027 A Brief Introduction to Rvalue References](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2027.html) - [N3471 Constexpr Library Additions: utilities, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3471.html) - - diff --git a/reference/utility/index_sequence.md b/reference/utility/index_sequence.md index 6054eb354a..adbd1c95b5 100644 --- a/reference/utility/index_sequence.md +++ b/reference/utility/index_sequence.md @@ -61,4 +61,3 @@ int main() ## 参照 - [N3658 Compile-time integer sequences](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3658.html) - diff --git a/reference/utility/index_sequence_for.md b/reference/utility/index_sequence_for.md index f8ff872e33..b4b8c66f2e 100644 --- a/reference/utility/index_sequence_for.md +++ b/reference/utility/index_sequence_for.md @@ -74,5 +74,3 @@ int main() ## 参照 - [N3658 Compile-time integer sequences](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3658.html) - - diff --git a/reference/utility/integer_sequence.md b/reference/utility/integer_sequence.md index 956178f389..3bea2e25d9 100644 --- a/reference/utility/integer_sequence.md +++ b/reference/utility/integer_sequence.md @@ -61,5 +61,3 @@ int main() ## 参照 - [N3658 Compile-time integer sequences](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3658.html) - - diff --git a/reference/utility/make_index_sequence.md b/reference/utility/make_index_sequence.md index c0d5fe789e..644afc4629 100644 --- a/reference/utility/make_index_sequence.md +++ b/reference/utility/make_index_sequence.md @@ -65,5 +65,3 @@ int main() ## 参照 - [N3658 Compile-time integer sequences](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3658.html) - - diff --git a/reference/utility/make_integer_sequence.md b/reference/utility/make_integer_sequence.md index f00c147619..d13dc8b576 100644 --- a/reference/utility/make_integer_sequence.md +++ b/reference/utility/make_integer_sequence.md @@ -69,5 +69,3 @@ int main() ## 参照 - [N3658 Compile-time integer sequences](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3658.html) - - diff --git a/reference/utility/move.md b/reference/utility/move.md index ade880c939..208ec1ba4f 100644 --- a/reference/utility/move.md +++ b/reference/utility/move.md @@ -89,4 +89,3 @@ move - [N1385 The Forwarding Problem: Arguments](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2002/n1385.htm) - [N2027 A Brief Introduction to Rvalue References](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2027.html) - [N3471 Constexpr Library Additions: utilities, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3471.html) - diff --git a/reference/utility/move_if_noexcept.md b/reference/utility/move_if_noexcept.md index 7bacc63f15..b9094c5ca1 100644 --- a/reference/utility/move_if_noexcept.md +++ b/reference/utility/move_if_noexcept.md @@ -104,5 +104,3 @@ copy - [C++11 右辺値参照・ムーブセマンティクス](/lang/cpp11/rvalue_ref_and_move_semantics.md) - [N2983 Allowing Move Constructors to Throw](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2983.html) - [N3471 Constexpr Library Additions: utilities, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3471.html) - - diff --git a/reference/utility/pair/tuple_element.md b/reference/utility/pair/tuple_element.md index 38da4854ae..f271b8d60f 100644 --- a/reference/utility/pair/tuple_element.md +++ b/reference/utility/pair/tuple_element.md @@ -63,4 +63,3 @@ int main() ## 参照 - [`tuple_element - `](/reference/tuple/tuple_element.md) - diff --git a/reference/utility/pair/tuple_size.md b/reference/utility/pair/tuple_size.md index 590f3bca89..116bbc24cc 100644 --- a/reference/utility/pair/tuple_size.md +++ b/reference/utility/pair/tuple_size.md @@ -56,4 +56,3 @@ int main() ## 参照 - [LWG Issue 2313. `tuple_size` should always derive from `integral_constant`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2313) - diff --git a/reference/utility/piecewise_construct_t.md b/reference/utility/piecewise_construct_t.md index cc7f347921..78d5e43280 100644 --- a/reference/utility/piecewise_construct_t.md +++ b/reference/utility/piecewise_construct_t.md @@ -69,4 +69,3 @@ int main() ## 参照 - [N3059 Proposal to Simplify `pair` (rev 5.2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3059.pdf) - [N3059 - togetter](https://togetter.com/li/17236) - diff --git a/reference/valarray/gslice/op_constructor.md b/reference/valarray/gslice/op_constructor.md index 83041d50d1..332a1c8f81 100644 --- a/reference/valarray/gslice/op_constructor.md +++ b/reference/valarray/gslice/op_constructor.md @@ -101,4 +101,3 @@ stride: 10 3 ## 参照 - [LWG Issue 543. `valarray` `slice` default constructor](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#543) - diff --git a/reference/valarray/gslice/start.md b/reference/valarray/gslice/start.md index 8c9a550f86..c71e6d2593 100644 --- a/reference/valarray/gslice/start.md +++ b/reference/valarray/gslice/start.md @@ -39,4 +39,3 @@ auto main() ``` 3 ``` - diff --git a/reference/valarray/gslice/stride.md b/reference/valarray/gslice/stride.md index 5e6db718a8..20af705a26 100644 --- a/reference/valarray/gslice/stride.md +++ b/reference/valarray/gslice/stride.md @@ -47,4 +47,3 @@ auto main() 10 3 ``` - diff --git a/reference/valarray/gslice_array.md b/reference/valarray/gslice_array.md index 9d825ee333..f8f8e9a378 100644 --- a/reference/valarray/gslice_array.md +++ b/reference/valarray/gslice_array.md @@ -113,5 +113,3 @@ int main() 8 99 99 11 12 99 99 15 ``` - - diff --git a/reference/valarray/gslice_array/op_and_assign.md b/reference/valarray/gslice_array/op_and_assign.md index 623d910632..bf76170338 100644 --- a/reference/valarray/gslice_array/op_and_assign.md +++ b/reference/valarray/gslice_array/op_and_assign.md @@ -77,5 +77,3 @@ int main() 00000010 00000001 ``` - - diff --git a/reference/valarray/gslice_array/op_assign.md b/reference/valarray/gslice_array/op_assign.md index 1d7fc90bc0..d0c14cbdf1 100644 --- a/reference/valarray/gslice_array/op_assign.md +++ b/reference/valarray/gslice_array/op_assign.md @@ -110,5 +110,3 @@ assign gslice_array : {2,4,6,4,5,6} assign valarray : {1,33,3,33,5,33} assign value : {1,55,3,55,5,55} ``` - - diff --git a/reference/valarray/gslice_array/op_divide_assign.md b/reference/valarray/gslice_array/op_divide_assign.md index dcc20574ed..2a8055b928 100644 --- a/reference/valarray/gslice_array/op_divide_assign.md +++ b/reference/valarray/gslice_array/op_divide_assign.md @@ -74,5 +74,3 @@ int main() 5 3 ``` - - diff --git a/reference/valarray/gslice_array/op_left_shift_assign.md b/reference/valarray/gslice_array/op_left_shift_assign.md index f4b043bb78..155452239d 100644 --- a/reference/valarray/gslice_array/op_left_shift_assign.md +++ b/reference/valarray/gslice_array/op_left_shift_assign.md @@ -77,5 +77,3 @@ int main() 10100000 01010000 ``` - - diff --git a/reference/valarray/gslice_array/op_minus_assign.md b/reference/valarray/gslice_array/op_minus_assign.md index 509037519f..4bc0d51f64 100644 --- a/reference/valarray/gslice_array/op_minus_assign.md +++ b/reference/valarray/gslice_array/op_minus_assign.md @@ -75,5 +75,3 @@ int main() 5 4 ``` - - diff --git a/reference/valarray/gslice_array/op_modulo_assign.md b/reference/valarray/gslice_array/op_modulo_assign.md index f7f6e77259..ec14e74cf1 100644 --- a/reference/valarray/gslice_array/op_modulo_assign.md +++ b/reference/valarray/gslice_array/op_modulo_assign.md @@ -74,5 +74,3 @@ int main() 5 0 ``` - - diff --git a/reference/valarray/gslice_array/op_multiply_assign.md b/reference/valarray/gslice_array/op_multiply_assign.md index 8ec9bb85a8..1595596ff9 100644 --- a/reference/valarray/gslice_array/op_multiply_assign.md +++ b/reference/valarray/gslice_array/op_multiply_assign.md @@ -74,5 +74,3 @@ int main() 5 12 ``` - - diff --git a/reference/valarray/gslice_array/op_or_assign.md b/reference/valarray/gslice_array/op_or_assign.md index ef16ae4ae2..04301dc763 100644 --- a/reference/valarray/gslice_array/op_or_assign.md +++ b/reference/valarray/gslice_array/op_or_assign.md @@ -77,5 +77,3 @@ int main() 00001011 00010111 ``` - - diff --git a/reference/valarray/gslice_array/op_plus_assign.md b/reference/valarray/gslice_array/op_plus_assign.md index 97a6d3b048..ebccdac120 100644 --- a/reference/valarray/gslice_array/op_plus_assign.md +++ b/reference/valarray/gslice_array/op_plus_assign.md @@ -74,5 +74,3 @@ int main() 5 8 ``` - - diff --git a/reference/valarray/gslice_array/op_right_shift_assign.md b/reference/valarray/gslice_array/op_right_shift_assign.md index 1e9ad2f6be..c1e924f8b9 100644 --- a/reference/valarray/gslice_array/op_right_shift_assign.md +++ b/reference/valarray/gslice_array/op_right_shift_assign.md @@ -77,5 +77,3 @@ int main() 00001010 00000101 ``` - - diff --git a/reference/valarray/gslice_array/op_xor_assign.md b/reference/valarray/gslice_array/op_xor_assign.md index c0435b5740..0f5c6afd99 100644 --- a/reference/valarray/gslice_array/op_xor_assign.md +++ b/reference/valarray/gslice_array/op_xor_assign.md @@ -77,5 +77,3 @@ int main() 00001001 00010110 ``` - - diff --git a/reference/valarray/indirect_array.md b/reference/valarray/indirect_array.md index e04216c9bc..f5de93f45e 100644 --- a/reference/valarray/indirect_array.md +++ b/reference/valarray/indirect_array.md @@ -96,5 +96,3 @@ int main() 5 12 ``` - - diff --git a/reference/valarray/indirect_array/op_and_assign.md b/reference/valarray/indirect_array/op_and_assign.md index 3622d53d56..489a6875c8 100644 --- a/reference/valarray/indirect_array/op_and_assign.md +++ b/reference/valarray/indirect_array/op_and_assign.md @@ -62,5 +62,3 @@ int main() 00000010 00000001 ``` - - diff --git a/reference/valarray/indirect_array/op_assign.md b/reference/valarray/indirect_array/op_assign.md index 7490b8ed00..c06d84101e 100644 --- a/reference/valarray/indirect_array/op_assign.md +++ b/reference/valarray/indirect_array/op_assign.md @@ -93,5 +93,3 @@ assign indirect_array : {2,4,6,4,5,6} assign valarray : {1,33,3,33,5,33} assign value : {1,55,3,55,5,55} ``` - - diff --git a/reference/valarray/indirect_array/op_divide_assign.md b/reference/valarray/indirect_array/op_divide_assign.md index 95a2759f63..1c96f559dc 100644 --- a/reference/valarray/indirect_array/op_divide_assign.md +++ b/reference/valarray/indirect_array/op_divide_assign.md @@ -58,5 +58,3 @@ int main() 5 3 ``` - - diff --git a/reference/valarray/indirect_array/op_left_shift_assign.md b/reference/valarray/indirect_array/op_left_shift_assign.md index a7826ef218..d76e1e80b4 100644 --- a/reference/valarray/indirect_array/op_left_shift_assign.md +++ b/reference/valarray/indirect_array/op_left_shift_assign.md @@ -62,5 +62,3 @@ int main() 10100000 01010000 ``` - - diff --git a/reference/valarray/indirect_array/op_minus_assign.md b/reference/valarray/indirect_array/op_minus_assign.md index 4bc4418876..32b1e776a9 100644 --- a/reference/valarray/indirect_array/op_minus_assign.md +++ b/reference/valarray/indirect_array/op_minus_assign.md @@ -58,5 +58,3 @@ int main() 5 4 ``` - - diff --git a/reference/valarray/indirect_array/op_modulo_assign.md b/reference/valarray/indirect_array/op_modulo_assign.md index 4d19c595bc..1d970e38fc 100644 --- a/reference/valarray/indirect_array/op_modulo_assign.md +++ b/reference/valarray/indirect_array/op_modulo_assign.md @@ -58,5 +58,3 @@ int main() 5 0 ``` - - diff --git a/reference/valarray/indirect_array/op_multiply_assign.md b/reference/valarray/indirect_array/op_multiply_assign.md index 23cb93b11b..ebd28f565e 100644 --- a/reference/valarray/indirect_array/op_multiply_assign.md +++ b/reference/valarray/indirect_array/op_multiply_assign.md @@ -58,5 +58,3 @@ int main() 5 12 ``` - - diff --git a/reference/valarray/indirect_array/op_or_assign.md b/reference/valarray/indirect_array/op_or_assign.md index 3ca28551b8..ae92d72c61 100644 --- a/reference/valarray/indirect_array/op_or_assign.md +++ b/reference/valarray/indirect_array/op_or_assign.md @@ -62,5 +62,3 @@ int main() 00001011 00010111 ``` - - diff --git a/reference/valarray/indirect_array/op_plus_assign.md b/reference/valarray/indirect_array/op_plus_assign.md index 5159d1e7f2..5614c24c42 100644 --- a/reference/valarray/indirect_array/op_plus_assign.md +++ b/reference/valarray/indirect_array/op_plus_assign.md @@ -58,5 +58,3 @@ int main() 5 8 ``` - - diff --git a/reference/valarray/indirect_array/op_right_shift_assign.md b/reference/valarray/indirect_array/op_right_shift_assign.md index d993fa1cac..e8e0f77fda 100644 --- a/reference/valarray/indirect_array/op_right_shift_assign.md +++ b/reference/valarray/indirect_array/op_right_shift_assign.md @@ -62,5 +62,3 @@ int main() 00001010 00000101 ``` - - diff --git a/reference/valarray/indirect_array/op_xor_assign.md b/reference/valarray/indirect_array/op_xor_assign.md index 1c4e651eb0..20eae1ac1e 100644 --- a/reference/valarray/indirect_array/op_xor_assign.md +++ b/reference/valarray/indirect_array/op_xor_assign.md @@ -62,5 +62,3 @@ int main() 00001001 00010110 ``` - - diff --git a/reference/valarray/mask_array.md b/reference/valarray/mask_array.md index 43fb421833..d74afeeb4d 100644 --- a/reference/valarray/mask_array.md +++ b/reference/valarray/mask_array.md @@ -96,4 +96,3 @@ int main() 5 12 ``` - diff --git a/reference/valarray/mask_array/op_and_assign.md b/reference/valarray/mask_array/op_and_assign.md index 3ec6c70ae1..dc39c93060 100644 --- a/reference/valarray/mask_array/op_and_assign.md +++ b/reference/valarray/mask_array/op_and_assign.md @@ -61,5 +61,3 @@ int main() 00000010 00000001 ``` - - diff --git a/reference/valarray/mask_array/op_assign.md b/reference/valarray/mask_array/op_assign.md index ffaa2d85b1..8fa61c5266 100644 --- a/reference/valarray/mask_array/op_assign.md +++ b/reference/valarray/mask_array/op_assign.md @@ -93,5 +93,3 @@ assign mask_array : {2,4,6,4,5,6} assign valarray : {1,33,3,33,5,33} assign value : {1,55,3,55,5,55} ``` - - diff --git a/reference/valarray/mask_array/op_divide_assign.md b/reference/valarray/mask_array/op_divide_assign.md index fe85523bfc..6d64b402d7 100644 --- a/reference/valarray/mask_array/op_divide_assign.md +++ b/reference/valarray/mask_array/op_divide_assign.md @@ -57,5 +57,3 @@ int main() 5 3 ``` - - diff --git a/reference/valarray/mask_array/op_left_shift_assign.md b/reference/valarray/mask_array/op_left_shift_assign.md index 4779d4dcfa..22aaa60765 100644 --- a/reference/valarray/mask_array/op_left_shift_assign.md +++ b/reference/valarray/mask_array/op_left_shift_assign.md @@ -61,5 +61,3 @@ int main() 10100000 01010000 ``` - - diff --git a/reference/valarray/mask_array/op_minus_assign.md b/reference/valarray/mask_array/op_minus_assign.md index 85be9f0b89..e1214465a1 100644 --- a/reference/valarray/mask_array/op_minus_assign.md +++ b/reference/valarray/mask_array/op_minus_assign.md @@ -58,5 +58,3 @@ int main() 5 4 ``` - - diff --git a/reference/valarray/mask_array/op_modulo_assign.md b/reference/valarray/mask_array/op_modulo_assign.md index b3d4b1f896..5b6cd624ae 100644 --- a/reference/valarray/mask_array/op_modulo_assign.md +++ b/reference/valarray/mask_array/op_modulo_assign.md @@ -57,5 +57,3 @@ int main() 5 0 ``` - - diff --git a/reference/valarray/mask_array/op_multiply_assign.md b/reference/valarray/mask_array/op_multiply_assign.md index b1c2692027..050796f257 100644 --- a/reference/valarray/mask_array/op_multiply_assign.md +++ b/reference/valarray/mask_array/op_multiply_assign.md @@ -57,5 +57,3 @@ int main() 5 12 ``` - - diff --git a/reference/valarray/mask_array/op_or_assign.md b/reference/valarray/mask_array/op_or_assign.md index 25562aabe0..da8d84ef53 100644 --- a/reference/valarray/mask_array/op_or_assign.md +++ b/reference/valarray/mask_array/op_or_assign.md @@ -61,5 +61,3 @@ int main() 00001011 00010111 ``` - - diff --git a/reference/valarray/mask_array/op_plus_assign.md b/reference/valarray/mask_array/op_plus_assign.md index 83a29ac100..6cd2b10cd4 100644 --- a/reference/valarray/mask_array/op_plus_assign.md +++ b/reference/valarray/mask_array/op_plus_assign.md @@ -57,5 +57,3 @@ int main() 5 8 ``` - - diff --git a/reference/valarray/mask_array/op_right_shift_assign.md b/reference/valarray/mask_array/op_right_shift_assign.md index d8b6080ab6..87400f7dda 100644 --- a/reference/valarray/mask_array/op_right_shift_assign.md +++ b/reference/valarray/mask_array/op_right_shift_assign.md @@ -61,5 +61,3 @@ int main() 00001010 00000101 ``` - - diff --git a/reference/valarray/mask_array/op_xor_assign.md b/reference/valarray/mask_array/op_xor_assign.md index a1127e8dc5..b48b43b75f 100644 --- a/reference/valarray/mask_array/op_xor_assign.md +++ b/reference/valarray/mask_array/op_xor_assign.md @@ -61,5 +61,3 @@ int main() 00001001 00010110 ``` - - diff --git a/reference/valarray/slice/op_constructor.md b/reference/valarray/slice/op_constructor.md index e2f75f8bd5..45f7fafb10 100644 --- a/reference/valarray/slice/op_constructor.md +++ b/reference/valarray/slice/op_constructor.md @@ -75,4 +75,3 @@ auto main() ## 参照 - [LWG Issue 543. `valarray` `slice` default constructor](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#543) - diff --git a/reference/valarray/slice_array.md b/reference/valarray/slice_array.md index 61d686f04a..89f7953fce 100644 --- a/reference/valarray/slice_array.md +++ b/reference/valarray/slice_array.md @@ -97,4 +97,3 @@ int main() 5 12 ``` - diff --git a/reference/valarray/slice_array/op_and_assign.md b/reference/valarray/slice_array/op_and_assign.md index b6a5cfe88d..5cd2f79d2c 100644 --- a/reference/valarray/slice_array/op_and_assign.md +++ b/reference/valarray/slice_array/op_and_assign.md @@ -64,5 +64,3 @@ int main() 00000010 00000001 ``` - - diff --git a/reference/valarray/slice_array/op_assign.md b/reference/valarray/slice_array/op_assign.md index 494a2f8b8f..11def569ab 100644 --- a/reference/valarray/slice_array/op_assign.md +++ b/reference/valarray/slice_array/op_assign.md @@ -100,5 +100,3 @@ assign value : {1,55,3,55,5,55} ### 備考 - Clang 3.3 + libc++で、(1)の実装に`return`文がなかった([Bug 20614](https://llvm.org/bugs/show_bug.cgi?id=20614)) - - diff --git a/reference/valarray/slice_array/op_divide_assign.md b/reference/valarray/slice_array/op_divide_assign.md index ca49fa0365..1ead681ba9 100644 --- a/reference/valarray/slice_array/op_divide_assign.md +++ b/reference/valarray/slice_array/op_divide_assign.md @@ -61,5 +61,3 @@ int main() 5 3 ``` - - diff --git a/reference/valarray/slice_array/op_left_shift_assign.md b/reference/valarray/slice_array/op_left_shift_assign.md index 21a3638df3..910dd16d96 100644 --- a/reference/valarray/slice_array/op_left_shift_assign.md +++ b/reference/valarray/slice_array/op_left_shift_assign.md @@ -64,5 +64,3 @@ int main() 10100000 01010000 ``` - - diff --git a/reference/valarray/slice_array/op_minus_assign.md b/reference/valarray/slice_array/op_minus_assign.md index b412b8aeb5..aa612c70e8 100644 --- a/reference/valarray/slice_array/op_minus_assign.md +++ b/reference/valarray/slice_array/op_minus_assign.md @@ -62,5 +62,3 @@ int main() 5 4 ``` - - diff --git a/reference/valarray/slice_array/op_modulo_assign.md b/reference/valarray/slice_array/op_modulo_assign.md index ac207a608b..d5d39a5bc0 100644 --- a/reference/valarray/slice_array/op_modulo_assign.md +++ b/reference/valarray/slice_array/op_modulo_assign.md @@ -61,5 +61,3 @@ int main() 5 0 ``` - - diff --git a/reference/valarray/slice_array/op_multiply_assign.md b/reference/valarray/slice_array/op_multiply_assign.md index 11bdf58331..3c05b54705 100644 --- a/reference/valarray/slice_array/op_multiply_assign.md +++ b/reference/valarray/slice_array/op_multiply_assign.md @@ -61,5 +61,3 @@ int main() 5 12 ``` - - diff --git a/reference/valarray/slice_array/op_or_assign.md b/reference/valarray/slice_array/op_or_assign.md index 5db8516e28..dac5b796fb 100644 --- a/reference/valarray/slice_array/op_or_assign.md +++ b/reference/valarray/slice_array/op_or_assign.md @@ -64,5 +64,3 @@ int main() 00001011 00010111 ``` - - diff --git a/reference/valarray/slice_array/op_plus_assign.md b/reference/valarray/slice_array/op_plus_assign.md index 57ca3e1e8a..9654055461 100644 --- a/reference/valarray/slice_array/op_plus_assign.md +++ b/reference/valarray/slice_array/op_plus_assign.md @@ -61,5 +61,3 @@ int main() 5 8 ``` - - diff --git a/reference/valarray/slice_array/op_right_shift_assign.md b/reference/valarray/slice_array/op_right_shift_assign.md index 2f5300e6ad..1b899e0d06 100644 --- a/reference/valarray/slice_array/op_right_shift_assign.md +++ b/reference/valarray/slice_array/op_right_shift_assign.md @@ -64,5 +64,3 @@ int main() 00001010 00000101 ``` - - diff --git a/reference/valarray/slice_array/op_xor_assign.md b/reference/valarray/slice_array/op_xor_assign.md index aa5ea12cf2..0cd05ebaf0 100644 --- a/reference/valarray/slice_array/op_xor_assign.md +++ b/reference/valarray/slice_array/op_xor_assign.md @@ -64,5 +64,3 @@ int main() 00001001 00010110 ``` - - diff --git a/reference/valarray/valarray.md b/reference/valarray/valarray.md index dcfa67bb36..0a2ad864d4 100644 --- a/reference/valarray/valarray.md +++ b/reference/valarray/valarray.md @@ -290,5 +290,3 @@ slice + multiply : {1,4,3,8,5,12} ## 参照 - [インテルの valarray の使用](https://www.xlsoft.com/jp/products/intel/compilers/ccw/12/ug/cref_cls/common/cppref_valarray_use.htm) - - diff --git a/reference/valarray/valarray/abs.md b/reference/valarray/valarray/abs.md index 6f5f9caa12..986b40cb92 100644 --- a/reference/valarray/valarray/abs.md +++ b/reference/valarray/valarray/abs.md @@ -54,5 +54,3 @@ int main() 3 4 ``` - - diff --git a/reference/valarray/valarray/acos.md b/reference/valarray/valarray/acos.md index 5675a98ddc..111fff42c3 100644 --- a/reference/valarray/valarray/acos.md +++ b/reference/valarray/valarray/acos.md @@ -53,5 +53,3 @@ int main() 1.36944 1.2661 ``` - - diff --git a/reference/valarray/valarray/apply.md b/reference/valarray/valarray/apply.md index f19c55500c..359a0937d9 100644 --- a/reference/valarray/valarray/apply.md +++ b/reference/valarray/valarray/apply.md @@ -50,5 +50,3 @@ int main() 3 4 ``` - - diff --git a/reference/valarray/valarray/asin.md b/reference/valarray/valarray/asin.md index 8c58ee12a7..8235a1e378 100644 --- a/reference/valarray/valarray/asin.md +++ b/reference/valarray/valarray/asin.md @@ -53,5 +53,3 @@ int main() 0.198669 0.29552 ``` - - diff --git a/reference/valarray/valarray/atan.md b/reference/valarray/valarray/atan.md index 7bc1d8053f..8daad2dc97 100644 --- a/reference/valarray/valarray/atan.md +++ b/reference/valarray/valarray/atan.md @@ -53,5 +53,3 @@ int main() 0.197396 0.291457 ``` - - diff --git a/reference/valarray/valarray/cos.md b/reference/valarray/valarray/cos.md index db16cbf1c5..f742c89c21 100644 --- a/reference/valarray/valarray/cos.md +++ b/reference/valarray/valarray/cos.md @@ -53,5 +53,3 @@ int main() 0.980067 0.955337 ``` - - diff --git a/reference/valarray/valarray/cosh.md b/reference/valarray/valarray/cosh.md index df9a583d44..2077d3b407 100644 --- a/reference/valarray/valarray/cosh.md +++ b/reference/valarray/valarray/cosh.md @@ -53,5 +53,3 @@ int main() 1.02007 1.04534 ``` - - diff --git a/reference/valarray/valarray/cshift.md b/reference/valarray/valarray/cshift.md index 8dea938939..7db05af57e 100644 --- a/reference/valarray/valarray/cshift.md +++ b/reference/valarray/valarray/cshift.md @@ -73,4 +73,3 @@ right_shift_result : {3,4,5,1,2} ## 参照 - [LWG Issue 618. `valarray::cshift()` effects on empty array](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#618) - 空の配列に対するこの関数の挙動が、C++11で明確になった - diff --git a/reference/valarray/valarray/exp.md b/reference/valarray/valarray/exp.md index 66d9359ddf..ed983b0604 100644 --- a/reference/valarray/valarray/exp.md +++ b/reference/valarray/valarray/exp.md @@ -53,5 +53,3 @@ int main() 1.2214 1.34986 ``` - - diff --git a/reference/valarray/valarray/log.md b/reference/valarray/valarray/log.md index 3564cc85ed..0d68c39368 100644 --- a/reference/valarray/valarray/log.md +++ b/reference/valarray/valarray/log.md @@ -73,5 +73,3 @@ int main() exp_result : {1.10517,1.2214,1.34986} log_result : {0.1,0.2,0.3} ``` - - diff --git a/reference/valarray/valarray/log10.md b/reference/valarray/valarray/log10.md index 907735db3d..071555e9c2 100644 --- a/reference/valarray/valarray/log10.md +++ b/reference/valarray/valarray/log10.md @@ -53,5 +53,3 @@ int main() 4 6 ``` - - diff --git a/reference/valarray/valarray/max.md b/reference/valarray/valarray/max.md index e52e18965f..33c486c8d7 100644 --- a/reference/valarray/valarray/max.md +++ b/reference/valarray/valarray/max.md @@ -39,5 +39,3 @@ int main() ``` 4 ``` - - diff --git a/reference/valarray/valarray/min.md b/reference/valarray/valarray/min.md index 0ead6f4dca..62eca539cd 100644 --- a/reference/valarray/valarray/min.md +++ b/reference/valarray/valarray/min.md @@ -39,5 +39,3 @@ int main() ``` 1 ``` - - diff --git a/reference/valarray/valarray/op_and_assign.md b/reference/valarray/valarray/op_and_assign.md index 49c2a4209d..c9434cef33 100644 --- a/reference/valarray/valarray/op_and_assign.md +++ b/reference/valarray/valarray/op_and_assign.md @@ -93,5 +93,3 @@ int main() ### 出力 ``` ``` - - diff --git a/reference/valarray/valarray/op_assign.md b/reference/valarray/valarray/op_assign.md index 3ff7bc854d..8cd3556405 100644 --- a/reference/valarray/valarray/op_assign.md +++ b/reference/valarray/valarray/op_assign.md @@ -148,5 +148,3 @@ va8 : {1,3,5} - (3)の経緯となる提案文書 - [LWG Issue 2071. `std::valarray` move-assignment](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2071) - C++11でムーブ代入の計算量を「定数時間」であると記載していたが、実際には全要素のデストラクタを呼び出すために「線形時間」が正しかった。C++14で文面を修正。 - - diff --git a/reference/valarray/valarray/op_at.md b/reference/valarray/valarray/op_at.md index a98878bd45..f28b2951bb 100644 --- a/reference/valarray/valarray/op_at.md +++ b/reference/valarray/valarray/op_at.md @@ -276,4 +276,3 @@ int main() ## 参照 - [LWG Issue 389. Const overload of `valarray::operator[]` returns by value](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#389) - (1)の戻り値の型が、C++03の`T`から、C++11の`const T&`に変更された経緯のレポート - diff --git a/reference/valarray/valarray/op_constructor.md b/reference/valarray/valarray/op_constructor.md index a17d58f2d5..f4eeb6e15a 100644 --- a/reference/valarray/valarray/op_constructor.md +++ b/reference/valarray/valarray/op_constructor.md @@ -172,4 +172,3 @@ va11 : {1,2,3} ## 参照 - [N2679 Initializer Lists for Standard Containers(Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2679.pdf) - (11)の経緯となる提案文書 - diff --git a/reference/valarray/valarray/op_deduction_guide.md b/reference/valarray/valarray/op_deduction_guide.md index 73a485edc9..c7acb5d0da 100644 --- a/reference/valarray/valarray/op_deduction_guide.md +++ b/reference/valarray/valarray/op_deduction_guide.md @@ -62,4 +62,3 @@ int main() ## 参照 - [P0433R2 Toward a resolution of US7 and US14: Integrating template deduction for class templates into the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0433r2.html) - diff --git a/reference/valarray/valarray/op_destructor.md b/reference/valarray/valarray/op_destructor.md index 9417d935bc..4c6bf69a31 100644 --- a/reference/valarray/valarray/op_destructor.md +++ b/reference/valarray/valarray/op_destructor.md @@ -14,5 +14,3 @@ ## 例外 投げない - - diff --git a/reference/valarray/valarray/op_divide_assign.md b/reference/valarray/valarray/op_divide_assign.md index f0b44c84f5..8677ea3de6 100644 --- a/reference/valarray/valarray/op_divide_assign.md +++ b/reference/valarray/valarray/op_divide_assign.md @@ -90,5 +90,3 @@ int main() valarray/=valarray : {4,2,2} valarray/=int : {2,2,3} ``` - - diff --git a/reference/valarray/valarray/op_flip.md b/reference/valarray/valarray/op_flip.md index 1073ef7636..d529dd076e 100644 --- a/reference/valarray/valarray/op_flip.md +++ b/reference/valarray/valarray/op_flip.md @@ -68,5 +68,3 @@ int main() ### 出力 ``` ``` - - diff --git a/reference/valarray/valarray/op_left_shift_assign.md b/reference/valarray/valarray/op_left_shift_assign.md index 23f3f98f24..d519ca57ec 100644 --- a/reference/valarray/valarray/op_left_shift_assign.md +++ b/reference/valarray/valarray/op_left_shift_assign.md @@ -95,5 +95,3 @@ int main() ### 出力 ``` ``` - - diff --git a/reference/valarray/valarray/op_minus_assign.md b/reference/valarray/valarray/op_minus_assign.md index a3a470557f..b6775f1ff3 100644 --- a/reference/valarray/valarray/op_minus_assign.md +++ b/reference/valarray/valarray/op_minus_assign.md @@ -90,5 +90,3 @@ int main() valarray-=valarray : {3,3,3} valarray-=int : {3,4,5} ``` - - diff --git a/reference/valarray/valarray/op_modulo_assign.md b/reference/valarray/valarray/op_modulo_assign.md index 92aa0eb815..ecc7839948 100644 --- a/reference/valarray/valarray/op_modulo_assign.md +++ b/reference/valarray/valarray/op_modulo_assign.md @@ -90,5 +90,3 @@ int main() valarray%=valarray : {0,1,0} valarray%=int : {0,1,0} ``` - - diff --git a/reference/valarray/valarray/op_multiply_assign.md b/reference/valarray/valarray/op_multiply_assign.md index 327d134678..05542bd17b 100644 --- a/reference/valarray/valarray/op_multiply_assign.md +++ b/reference/valarray/valarray/op_multiply_assign.md @@ -90,5 +90,3 @@ int main() valarray*=valarray : {4,10,18} valarray*=int : {8,10,12} ``` - - diff --git a/reference/valarray/valarray/op_not.md b/reference/valarray/valarray/op_not.md index 739dcc3d22..cda23c49c2 100644 --- a/reference/valarray/valarray/op_not.md +++ b/reference/valarray/valarray/op_not.md @@ -50,5 +50,3 @@ int main() ### 出力 ``` ``` - - diff --git a/reference/valarray/valarray/op_or_assign.md b/reference/valarray/valarray/op_or_assign.md index c543c4b676..37fe7ccffe 100644 --- a/reference/valarray/valarray/op_or_assign.md +++ b/reference/valarray/valarray/op_or_assign.md @@ -96,5 +96,3 @@ int main() ### 出力 ``` ``` - - diff --git a/reference/valarray/valarray/op_plus_assign.md b/reference/valarray/valarray/op_plus_assign.md index e5b646d5a0..acf24d326d 100644 --- a/reference/valarray/valarray/op_plus_assign.md +++ b/reference/valarray/valarray/op_plus_assign.md @@ -91,5 +91,3 @@ int main() valarray+=valarray : {5,7,9} valarray+=int : {5,6,7} ``` - - diff --git a/reference/valarray/valarray/op_right_shift_assign.md b/reference/valarray/valarray/op_right_shift_assign.md index bce3f8a1bb..b1114d10c9 100644 --- a/reference/valarray/valarray/op_right_shift_assign.md +++ b/reference/valarray/valarray/op_right_shift_assign.md @@ -95,5 +95,3 @@ int main() ### 出力 ``` ``` - - diff --git a/reference/valarray/valarray/op_unary_minus.md b/reference/valarray/valarray/op_unary_minus.md index e54e81607e..f67ba0624a 100644 --- a/reference/valarray/valarray/op_unary_minus.md +++ b/reference/valarray/valarray/op_unary_minus.md @@ -54,5 +54,3 @@ int main() 2 -3 ``` - - diff --git a/reference/valarray/valarray/op_unary_plus.md b/reference/valarray/valarray/op_unary_plus.md index 79d7bff930..2e2e5d508b 100644 --- a/reference/valarray/valarray/op_unary_plus.md +++ b/reference/valarray/valarray/op_unary_plus.md @@ -54,5 +54,3 @@ int main() -2 3 ``` - - diff --git a/reference/valarray/valarray/op_xor_assign.md b/reference/valarray/valarray/op_xor_assign.md index eba44c9ff5..8cb6ea15b7 100644 --- a/reference/valarray/valarray/op_xor_assign.md +++ b/reference/valarray/valarray/op_xor_assign.md @@ -95,5 +95,3 @@ int main() ### 出力 ``` ``` - - diff --git a/reference/valarray/valarray/resize.md b/reference/valarray/valarray/resize.md index 0c6541f1c5..e6208ab224 100644 --- a/reference/valarray/valarray/resize.md +++ b/reference/valarray/valarray/resize.md @@ -61,4 +61,3 @@ int main() 0, 0, 8, 8, 8, 8, 8, ``` - diff --git a/reference/valarray/valarray/shift.md b/reference/valarray/valarray/shift.md index d52ba959e0..4e63559bb2 100644 --- a/reference/valarray/valarray/shift.md +++ b/reference/valarray/valarray/shift.md @@ -66,5 +66,3 @@ int main() left_shift_result : {4,5,0,0,0} right_shift_result : {0,0,0,1,2} ``` - - diff --git a/reference/valarray/valarray/sin.md b/reference/valarray/valarray/sin.md index 18ce362039..5b0d4e44b8 100644 --- a/reference/valarray/valarray/sin.md +++ b/reference/valarray/valarray/sin.md @@ -53,5 +53,3 @@ int main() 0.198669 0.29552 ``` - - diff --git a/reference/valarray/valarray/sinh.md b/reference/valarray/valarray/sinh.md index 850f1d68a2..27eed90288 100644 --- a/reference/valarray/valarray/sinh.md +++ b/reference/valarray/valarray/sinh.md @@ -53,5 +53,3 @@ int main() 0.201336 0.30452 ``` - - diff --git a/reference/valarray/valarray/size.md b/reference/valarray/valarray/size.md index eed896c11f..854b69c730 100644 --- a/reference/valarray/valarray/size.md +++ b/reference/valarray/valarray/size.md @@ -39,5 +39,3 @@ int main() ``` 3 ``` - - diff --git a/reference/valarray/valarray/sqrt.md b/reference/valarray/valarray/sqrt.md index 01675e2cd8..2f68037179 100644 --- a/reference/valarray/valarray/sqrt.md +++ b/reference/valarray/valarray/sqrt.md @@ -53,5 +53,3 @@ int main() 1.41421 1.73205 ``` - - diff --git a/reference/valarray/valarray/sum.md b/reference/valarray/valarray/sum.md index ce888c43c5..210802bc6f 100644 --- a/reference/valarray/valarray/sum.md +++ b/reference/valarray/valarray/sum.md @@ -39,5 +39,3 @@ int main() ``` 15 ``` - - diff --git a/reference/valarray/valarray/swap.md b/reference/valarray/valarray/swap.md index 2b4a8ca2e7..67bcee9d65 100644 --- a/reference/valarray/valarray/swap.md +++ b/reference/valarray/valarray/swap.md @@ -73,5 +73,3 @@ b : {1,2,3} - [GCC](/implementation.md#gcc): 4.7.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - - diff --git a/reference/valarray/valarray/swap_free.md b/reference/valarray/valarray/swap_free.md index c998b7aec0..32e12b2f74 100644 --- a/reference/valarray/valarray/swap_free.md +++ b/reference/valarray/valarray/swap_free.md @@ -75,5 +75,3 @@ b : {1,2,3} - [GCC](/implementation.md#gcc): 4.7.3 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - - diff --git a/reference/valarray/valarray/tan.md b/reference/valarray/valarray/tan.md index 7e2b7b20bf..dee235ed5a 100644 --- a/reference/valarray/valarray/tan.md +++ b/reference/valarray/valarray/tan.md @@ -53,5 +53,3 @@ int main() 0.20271 0.309336 ``` - - diff --git a/reference/valarray/valarray/tanh.md b/reference/valarray/valarray/tanh.md index b514ec6f82..f9b6f692f4 100644 --- a/reference/valarray/valarray/tanh.md +++ b/reference/valarray/valarray/tanh.md @@ -53,5 +53,3 @@ int main() 0.197375 0.291313 ``` - - diff --git a/reference/variant/bad_variant_access/op_destructor.md b/reference/variant/bad_variant_access/op_destructor.md index 67b6da7d30..293550cfd2 100644 --- a/reference/variant/bad_variant_access/op_destructor.md +++ b/reference/variant/bad_variant_access/op_destructor.md @@ -20,4 +20,3 @@ constexpr virtual ~bad_variant_access(); // (1) C++26 ## 関連項目 - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) - diff --git a/reference/vector/vector/op_deduction_guide.md b/reference/vector/vector/op_deduction_guide.md index 700e1a28b3..ea36dc928a 100644 --- a/reference/vector/vector/op_deduction_guide.md +++ b/reference/vector/vector/op_deduction_guide.md @@ -80,4 +80,3 @@ int main() ## 参照 - [P0433R2 Toward a resolution of US7 and US14: Integrating template deduction for class templates into the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0433r2.html) - diff --git a/reference/vector/vector/push_back.md b/reference/vector/vector/push_back.md index b53c5b5642..5f9d4e9a98 100644 --- a/reference/vector/vector/push_back.md +++ b/reference/vector/vector/push_back.md @@ -96,4 +96,3 @@ world - `deque`の[`emplace_back()`](/reference/deque/deque/emplace_back.md)と[`emplace_front()`](/reference/deque/deque/emplace_front.md) (C++14から) - `deque`の両端へ単一要素を挿入する[`insert()`](/reference/deque/deque/insert.md)と[`emplace()`](/reference/deque/deque/emplace.md) (C++14) - [P1004R2 Making `std::vector` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1004r2.pdf) - diff --git a/start_editing.md b/start_editing.md index 2bd0b2352d..65ee4f8c96 100644 --- a/start_editing.md +++ b/start_editing.md @@ -380,4 +380,3 @@ CIスクリプト、site_generator、kunaiなど。 - [2023年](start_editing/contribution_stats_2023.md) - [2024年](start_editing/contribution_stats_2024.md) - diff --git a/start_editing/concept_template_page.md b/start_editing/concept_template_page.md index 23a2ba1bee..baca279221 100644 --- a/start_editing/concept_template_page.md +++ b/start_editing/concept_template_page.md @@ -131,4 +131,3 @@ int main() ## 参照 (ここには、そのコンセプトを理解するにあたっての参考資料や、関連する機能へのリンクを記述します。とくに必要がないと判断した場合、項目を削除してください。) - diff --git a/start_editing/contribution_stats_2023.md b/start_editing/contribution_stats_2023.md index beccbc0935..5bbdff1fad 100644 --- a/start_editing/contribution_stats_2023.md +++ b/start_editing/contribution_stats_2023.md @@ -573,5 +573,3 @@ | コミット | タグ | 説明 | |----------|------|------| | [commit cpprefjp/site, 7e37ab2] | cpprefjp/typo:1 | typo を修正: "スタンダードレイアウト型型" -> "スタンダードレイアウト型" | - - diff --git a/start_editing/contribution_stats_2024.md b/start_editing/contribution_stats_2024.md index 36de1bd9f5..b4ad4e94ed 100644 --- a/start_editing/contribution_stats_2024.md +++ b/start_editing/contribution_stats_2024.md @@ -631,4 +631,3 @@ | [commit boostjp/site, cb4363b] | boostjp/fixm:1 | C++11で追加されたスマートポインタへのリンクを追加 | | [commit boostjp/site, f75e7b5] | boostjp/fixm:1 | `std::thread`へのリンクを追加 | | [commit boostjp/site, cd17af6] | boostjp/fixm:1 | ``へのリンクを追加 | - diff --git a/start_editing/directory_structure.md b/start_editing/directory_structure.md index ff632e83c9..a5a2b6b74d 100644 --- a/start_editing/directory_structure.md +++ b/start_editing/directory_structure.md @@ -39,4 +39,3 @@ reference階層とmodule階層は上記以外は同じであるため、以下 - 名前空間の階層は基本的に導入しない。例外は以下: - [`std::this_thread`](/reference/thread/this_thread.md) - 名前空間に特殊な意味をもたせている - diff --git a/start_editing/header_template_page.md b/start_editing/header_template_page.md index 1c99026daf..1ca0e88012 100644 --- a/start_editing/header_template_page.md +++ b/start_editing/header_template_page.md @@ -63,4 +63,3 @@ ## 参照 (ここには、その関数・変数・定数を理解するにあたっての参考資料や、関連する機能へのリンクを記述します。とくに必要がないと判断した場合、項目を削除してください。) - diff --git a/start_editing/lang_template_page.md b/start_editing/lang_template_page.md index b704e2f492..9dad3f21f6 100644 --- a/start_editing/lang_template_page.md +++ b/start_editing/lang_template_page.md @@ -103,4 +103,3 @@ int main() ## 参照 (ここには、その言語機能を理解するにあたっての参考資料へのリンクを記述します。とくに必要がないと判断した場合、項目を削除してください。) - diff --git a/start_editing/markdown_cpprefjp.md b/start_editing/markdown_cpprefjp.md index 469aa5c78a..cc1d5d9422 100644 --- a/start_editing/markdown_cpprefjp.md +++ b/start_editing/markdown_cpprefjp.md @@ -362,4 +362,3 @@ p \log_{10}b&\text{もし $b$ が $10$ の累乗の場合}\\ \end{array} \right. $$ - diff --git a/start_editing/module_template_page.md b/start_editing/module_template_page.md index 612326b908..77a236834b 100644 --- a/start_editing/module_template_page.md +++ b/start_editing/module_template_page.md @@ -47,4 +47,3 @@ ## 参照 (ここには、その関数・変数・定数を理解するにあたっての参考資料や、関連する機能へのリンクを記述します。とくに必要がないと判断した場合、項目を削除してください。) - diff --git a/start_editing/named_requirement_template_page.md b/start_editing/named_requirement_template_page.md index 60eec0376b..3f7f13085a 100644 --- a/start_editing/named_requirement_template_page.md +++ b/start_editing/named_requirement_template_page.md @@ -80,4 +80,3 @@ int main() ## 参照 (ここには、その名前付き要件を理解するにあたっての参考資料や、関連する機能へのリンクを記述します。とくに必要がないと判断した場合、項目を削除してください。) - diff --git a/start_editing/random_figure.md b/start_editing/random_figure.md index df66dd0a7c..3fe1ec4d68 100644 --- a/start_editing/random_figure.md +++ b/start_editing/random_figure.md @@ -107,4 +107,3 @@ rscript random_stats.R ## 参考 * [とりあえずプロットする方法](http://cse.naro.affrc.go.jp/takezawa/r-tips/r/48.html) * [ヒストグラムをプロットする方法](http://cse.naro.affrc.go.jp/takezawa/r-tips/r/61.html) - diff --git a/start_editing/type-type_template_page.md b/start_editing/type-type_template_page.md index 09d721ea63..98a4455ce1 100644 --- a/start_editing/type-type_template_page.md +++ b/start_editing/type-type_template_page.md @@ -95,4 +95,3 @@ typedef origin_type new_type; ## 参照 (ここには、その関数・変数・定数を理解するにあたっての参考資料や、関連する機能へのリンクを記述します。とくに必要がないと判断した場合、項目を削除してください。) - From f2c2262c9441a1cd9637cbcc985132ac6fd0c8ac Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sat, 12 Jul 2025 17:54:55 +0900 Subject: [PATCH 2203/3948] new page `fpos_t.md` --- reference/cstdio.md | 2 +- reference/cstdio/fpos_t.md | 67 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 reference/cstdio/fpos_t.md diff --git a/reference/cstdio.md b/reference/cstdio.md index b081a1680b..c92ce3477b 100644 --- a/reference/cstdio.md +++ b/reference/cstdio.md @@ -10,7 +10,7 @@ |------|------|----------------| | [`size_t`](/reference/cstddef/size_t.md) | 符号なし整数型 | | | [`FILE`](/reference/cstdio/file.md) | ストリームの制御に必要な情報を持つオブジェクト型 | | -| [`fpos_t`](/reference/cstdio/fpos_t.md.nolink) | ファイルの全ての位置にアクセスするための配列以外の完全オブジェクト型 | | +| [`fpos_t`](/reference/cstdio/fpos_t.md) | ファイルの全ての位置にアクセスするための配列以外の完全オブジェクト型 | | ## マクロ diff --git a/reference/cstdio/fpos_t.md b/reference/cstdio/fpos_t.md new file mode 100644 index 0000000000..f0ee1e35d7 --- /dev/null +++ b/reference/cstdio/fpos_t.md @@ -0,0 +1,67 @@ +# fpos_t +* cstdio[meta header] +* type-alias[meta id-type] +* std[meta namespace] + +```cpp +namespace std { + typedef /* implementation-defined */ fpos_t; +} +``` + +## 概要 +ファイルの位置を保持するための型。 + +[`fseek()`](/reference/cstdio/fseek.md.nolink)関数や[`ftell()`](/reference/cstdio/ftell.md.nolink)関数とは違い、巨大なファイルやマルチバイトファイルに対しても適切に動作するすることを目的に設計された。 + +## 例 +```cpp example +#include + +int main() { + std::FILE *file = std::fopen("sample.txt", "r"); + if (!file) { + std::perror("ファイルを開けませんでした"); + return 1; + } + + std::fpos_t pos; + std::fgetpos(file, &pos); // ファイルの位置をposに保存する + + int c = std::fgetc(file); + std::printf("1文字目: %c\n", c); + + std::fsetpos(file, &pos); // ファイルの読み取り位置をposにする + + c = std::fgetc(file); + std::printf("もう一度1文字目: %c\n", c); + + std::fclose(file); + return 0; +} + +``` +* std::fpos_t[color ff0000] +* std::fgetpos()[link /reference/cstdio/fgetpos.md.nolink] +* std::fsetpos()[link /reference/cstdio/fsetpos.md.nolink] +* std::fopen()[link /reference/cstdio/fopen.md] +* std::fclose()[link /reference/cstdio/fclose.md] +* std::fgetc()[link /reference/cstdio/fgetc.md] +* std::printf()[link /reference/cstdio/printf.md] +* std::perror()[link /reference/cstdio/perror.md.nolink] + +### ファイル内容(sample.txt) +``` +Hello, World! +``` + +### 出力 +``` +1文字目: H +もう一度1文字目: H +``` + +## 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file From 3a5b8ac41d49280f400abad2e1058cb536d05f31 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sat, 12 Jul 2025 18:06:52 +0900 Subject: [PATCH 2204/3948] new page `fread.md` --- reference/cstdio.md | 2 +- reference/cstdio/fread.md | 80 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 reference/cstdio/fread.md diff --git a/reference/cstdio.md b/reference/cstdio.md index c92ce3477b..55905a7d32 100644 --- a/reference/cstdio.md +++ b/reference/cstdio.md @@ -54,7 +54,7 @@ | [`fgets`](/reference/cstdio/fgets.md) | ファイルからN文字入力する | | | [`fputc`](/reference/cstdio/fputc.md) | ファイルに1文字出力する | | | [`fputs`](/reference/cstdio/fputs.md) | ファイルにN文字出力する | | -| [`fread`](/reference/cstdio/fread.md.nolink) | ファイルからN文字読み込む | | +| [`fread`](/reference/cstdio/fread.md) | ファイルからN文字読み込む | | | [`fwrite`](/reference/cstdio/fwrite.md.nolink) | ファイルにN文字書き込む | | | [`fgetpos`](/reference/cstdio/fgetpos.md.nolink) | ファイルの現在位置を取得する | | | [`fseek`](/reference/cstdio/fseek.md.nolink) | ファイルの現在位置を移動する | | diff --git a/reference/cstdio/fread.md b/reference/cstdio/fread.md new file mode 100644 index 0000000000..e41c439dd7 --- /dev/null +++ b/reference/cstdio/fread.md @@ -0,0 +1,80 @@ +# fread +* cstdio[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +namespace std { + std::size_t fread(void *buffer, std::size_t size, std::size_t count, std::FILE *stream); +} +``` + +## 概要 +ファイルから`count`文字の`size`バイトのデータを読み込む。 + +ファイル内の位置は、読み取られたバイトだけ進む。 + +## 要件 +- `buffer`は有効なポインタであること。 +- `size`は0より大きいこと。 +- `count`は0より大きいこと。 +- `stream`は有効なファイルストリームであること。 + +## 戻り値 +正常に読み込むことのできた項目の数を返す。 + +`size`または`count`のいずれかが0だった場合、必ず`0`を返し、`buffer`は変更されない。 + +## 効果 +`stream`から`count`個の`size`バイトのデータを読み込む。 + +読み込んだデータは、`buffer`が指すメモリの先頭から順に格納される。 + +読み込んだデータの長さは、`count * size`バイトである。 + +## 例 +```cpp example +#include + +int main() { + std::FILE *file = std::fopen("sample.txt", "r"); + if (!file) { + std::perror("ファイルを開けませんでした"); + return 1; + } + + char buffer[100]; + /* + 厳密には、sizeof(char)は1バイトであることが保証されているため、 + sizeof(buffer) / sizeof(char)は、bufferの要素数と等しくなる。 + */ + std::size_t count = std::fread(buffer, sizeof(char), sizeof(buffer) / sizeof(char), file); + std::printf("読み込んだデータの長さ: %zu\n", count); + + std::fclose(file); + return 0; +} +``` +* std::fread()[color ff0000] +* std::fopen()[link /reference/cstdio/fopen.md] +* std::fclose()[link /reference/cstdio/fclose.md] +* std::perror()[link /reference/cstdio/perror.md.nolink] +* std::printf()[link /reference/cstdio/printf.md] + +### ファイル内容(sample.txt) +``` +Hello, World! +``` + +### 出力例 +``` +読み込んだデータの長さ: 14 +``` + +## 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [sizeof演算子にまつわるアレコレ](https://qiita.com/yohhoy/items/a2ab2900a2bd36c31879) \ No newline at end of file From 05c10176a683902f39bfb1bbf2762e1b99934cb4 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sat, 12 Jul 2025 18:22:13 +0900 Subject: [PATCH 2205/3948] removed brackets for function declaration --- reference/cstdio/fpos_t.md | 14 +++++++------- reference/cstdio/fread.md | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/reference/cstdio/fpos_t.md b/reference/cstdio/fpos_t.md index f0ee1e35d7..fb74effe6c 100644 --- a/reference/cstdio/fpos_t.md +++ b/reference/cstdio/fpos_t.md @@ -42,13 +42,13 @@ int main() { ``` * std::fpos_t[color ff0000] -* std::fgetpos()[link /reference/cstdio/fgetpos.md.nolink] -* std::fsetpos()[link /reference/cstdio/fsetpos.md.nolink] -* std::fopen()[link /reference/cstdio/fopen.md] -* std::fclose()[link /reference/cstdio/fclose.md] -* std::fgetc()[link /reference/cstdio/fgetc.md] -* std::printf()[link /reference/cstdio/printf.md] -* std::perror()[link /reference/cstdio/perror.md.nolink] +* std::fgetpos[link /reference/cstdio/fgetpos.md.nolink] +* std::fsetpos[link /reference/cstdio/fsetpos.md.nolink] +* std::fopen[link /reference/cstdio/fopen.md] +* std::fclose[link /reference/cstdio/fclose.md] +* std::fgetc[link /reference/cstdio/fgetc.md] +* std::printf[link /reference/cstdio/printf.md] +* std::perror[link /reference/cstdio/perror.md.nolink] ### ファイル内容(sample.txt) ``` diff --git a/reference/cstdio/fread.md b/reference/cstdio/fread.md index e41c439dd7..aaf6efa9c9 100644 --- a/reference/cstdio/fread.md +++ b/reference/cstdio/fread.md @@ -55,11 +55,11 @@ int main() { return 0; } ``` -* std::fread()[color ff0000] -* std::fopen()[link /reference/cstdio/fopen.md] -* std::fclose()[link /reference/cstdio/fclose.md] -* std::perror()[link /reference/cstdio/perror.md.nolink] -* std::printf()[link /reference/cstdio/printf.md] +* std::fread[color ff0000] +* std::fopen[link /reference/cstdio/fopen.md] +* std::fclose[link /reference/cstdio/fclose.md] +* std::perror[link /reference/cstdio/perror.md.nolink] +* std::printf[link /reference/cstdio/printf.md] ### ファイル内容(sample.txt) ``` From cf65ace52fa312858e5c28722d3aec8f63809829 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sun, 13 Jul 2025 10:43:07 +0900 Subject: [PATCH 2206/3948] new page `mb_cur_max` add path to `mb_cur_max` Add comment out and path --- reference/cstdlib.md | 2 +- reference/cstdlib/mb_cur_max.md | 51 +++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 reference/cstdlib/mb_cur_max.md diff --git a/reference/cstdlib.md b/reference/cstdlib.md index b0cb420537..674c822d03 100644 --- a/reference/cstdlib.md +++ b/reference/cstdlib.md @@ -95,7 +95,7 @@ | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| `MB_CUR_MAX` | マルチバイト文字列の最大サイズを表す整数値マクロ (macro) +| [`MB_CUR_MAX`](cstdlib/mb_cur_max.md) | マルチバイト文字列の最大サイズを表す整数値マクロ (macro) | `mblen` | マルチバイト文字の長さを取得する (function) | | | `mbtowc` | マルチバイト文字を、ワイド文字に変換する (function) | | | `wctomb` | ワイド文字を、マルチバイト文字に変換する (function) | | diff --git a/reference/cstdlib/mb_cur_max.md b/reference/cstdlib/mb_cur_max.md new file mode 100644 index 0000000000..6763a1c311 --- /dev/null +++ b/reference/cstdlib/mb_cur_max.md @@ -0,0 +1,51 @@ +# MB_CUR_MAX +* cstdlib[meta header] +* macro[meta id-type] + +```cpp +namespace std { + #define MB_CUR_MAX /* implementation defined */ +} +``` + +## 概要 +現在のロケールのマルチバイト文字の最大バイト数を示すマクロ。 + +この定数はコンパイル時定数ではなく、実行時に変化する可能性がある。 + +この値が`MB_LEN_MAX`を超えることはない。 + +## 結果型 +`size_t`型の正の整数値。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + //C ロケール(標準ASCII) + std::cout << "Locale: standard, MB_CUR_MAX: " << MB_CUR_MAX << std::endl; + + if (std::setlocale(LC_CTYPE, "ja_JP.UTF-8") == nullptr) { + std::cout << "Failed to set locale to: ja_JP.UTF-8" << std::endl; + } + std::setlocale(LC_CTYPE, "ja_JP.UTF-8");// + std::cout << "Locale: ja_JP.UTF-8, MB_CUR_MAX: " << MB_CUR_MAX << std::endl; + return 0; +} +``` + +### 出力例 +``` +Locale: standard(C), MB_CUR_MAX: 1 +Locale: ja_JP.UTF-8, MB_CUR_MAX: 6 +``` + +## 関連項目 +- [`MB_LEN_MAX`](/reference/climits/mb_len_max.md):全ロケールでのマルチバイト文字の最大バイト数 +- `setlocale`:ロケールを変更する + +## 参照 +- [mb_cur_max(3) - Linux man page](https://linux.die.net/man/3/mb_cur_max) From ed566fee71bc735e98ec3a05f732d36d3adb8f7d Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sun, 13 Jul 2025 11:10:25 +0900 Subject: [PATCH 2207/3948] =?UTF-8?q?=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88?= =?UTF-8?q?=E3=81=AE=E8=BF=BD=E5=8A=A0=E3=80=81=E3=83=86=E3=83=BC=E3=83=96?= =?UTF-8?q?=E3=83=AB=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib.md | 2 +- reference/cstdlib/mb_cur_max.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/cstdlib.md b/reference/cstdlib.md index 674c822d03..a188b26aa9 100644 --- a/reference/cstdlib.md +++ b/reference/cstdlib.md @@ -95,7 +95,7 @@ | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`MB_CUR_MAX`](cstdlib/mb_cur_max.md) | マルチバイト文字列の最大サイズを表す整数値マクロ (macro) +| [`MB_CUR_MAX`](cstdlib/mb_cur_max.md) | マルチバイト文字列の最大サイズを表す整数値マクロ (macro)| | `mblen` | マルチバイト文字の長さを取得する (function) | | | `mbtowc` | マルチバイト文字を、ワイド文字に変換する (function) | | | `wctomb` | ワイド文字を、マルチバイト文字に変換する (function) | | diff --git a/reference/cstdlib/mb_cur_max.md b/reference/cstdlib/mb_cur_max.md index 6763a1c311..21450cdb3d 100644 --- a/reference/cstdlib/mb_cur_max.md +++ b/reference/cstdlib/mb_cur_max.md @@ -31,7 +31,7 @@ int main() { if (std::setlocale(LC_CTYPE, "ja_JP.UTF-8") == nullptr) { std::cout << "Failed to set locale to: ja_JP.UTF-8" << std::endl; } - std::setlocale(LC_CTYPE, "ja_JP.UTF-8");// + std::setlocale(LC_CTYPE, "ja_JP.UTF-8");//ロケールを日本語UTF-8に変更 std::cout << "Locale: ja_JP.UTF-8, MB_CUR_MAX: " << MB_CUR_MAX << std::endl; return 0; } From cfe143235a01e9c082afc75a97b106af47d465ad Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sun, 13 Jul 2025 12:32:51 +0900 Subject: [PATCH 2208/3948] =?UTF-8?q?implementation=20defined=20=E3=82=92?= =?UTF-8?q?=20implementation-defined=20=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdio/eof.md | 2 +- reference/cstdio/filename_max.md | 2 +- reference/cstdlib/rand_max.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/cstdio/eof.md b/reference/cstdio/eof.md index 231b8689a0..b603c81a11 100644 --- a/reference/cstdio/eof.md +++ b/reference/cstdio/eof.md @@ -3,7 +3,7 @@ * macro[meta id-type] ```cpp -#define EOF /* implementation defined */ +#define EOF /* implementation-defined */ ``` ## 概要 diff --git a/reference/cstdio/filename_max.md b/reference/cstdio/filename_max.md index 172e3013ed..9e45023ca8 100644 --- a/reference/cstdio/filename_max.md +++ b/reference/cstdio/filename_max.md @@ -3,7 +3,7 @@ * macro[meta id-type] ```cpp -#define FILENAME_MAX /* implementation defined */ +#define FILENAME_MAX /* implementation-defined */ ``` ## 概要 diff --git a/reference/cstdlib/rand_max.md b/reference/cstdlib/rand_max.md index cbb6ba54bd..5566d9d52e 100644 --- a/reference/cstdlib/rand_max.md +++ b/reference/cstdlib/rand_max.md @@ -3,7 +3,7 @@ * macro[meta id-type] ```cpp -#define RAND_MAX /*implementation defined*/ +#define RAND_MAX /*implementation-defined*/ ``` ## 概要 From 121b46d1bbb9bec12ae566839d7fad7db2dcd921 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sun, 13 Jul 2025 14:58:31 +0900 Subject: [PATCH 2209/3948] chore: fixed script to detect broken code qualifiers using a raw string (#1469) --- .github/workflows/script/ngword_check.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/script/ngword_check.py b/.github/workflows/script/ngword_check.py index 9fd1ea29a5..f12eb522f1 100644 --- a/.github/workflows/script/ngword_check.py +++ b/.github/workflows/script/ngword_check.py @@ -49,7 +49,7 @@ ("", "括弧", "カッコ"), ("", "constepx", "constexpr"), ("", "wsting", "wstring"), - ("", "\[lin ", "[link "), # コード修飾ミス + ("", r"\[lin ", "[link "), # コード修飾ミス ("reference/chrono", "dulation", "duration"), ("reference/random", "施行", "試行"), ("reference/random", "疑似", "擬似"), From 97027751efae2646b33db854ddd79d62de0b8e43 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sun, 13 Jul 2025 22:43:14 +0900 Subject: [PATCH 2210/3948] fixed function declaration --- reference/cstdio/fread.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdio/fread.md b/reference/cstdio/fread.md index aaf6efa9c9..4e7788268e 100644 --- a/reference/cstdio/fread.md +++ b/reference/cstdio/fread.md @@ -5,7 +5,7 @@ ```cpp namespace std { - std::size_t fread(void *buffer, std::size_t size, std::size_t count, std::FILE *stream); + size_t fread(void *buffer, size_t size, size_t count, FILE *stream); } ``` From dd34ab27d4f7bef2e1a03db6983c110567ef5e4f Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sun, 13 Jul 2025 22:47:08 +0900 Subject: [PATCH 2211/3948] fixed explanation in fread.md --- reference/cstdio/fread.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/reference/cstdio/fread.md b/reference/cstdio/fread.md index 4e7788268e..8b51b5a885 100644 --- a/reference/cstdio/fread.md +++ b/reference/cstdio/fread.md @@ -16,8 +16,6 @@ namespace std { ## 要件 - `buffer`は有効なポインタであること。 -- `size`は0より大きいこと。 -- `count`は0より大きいこと。 - `stream`は有効なファイルストリームであること。 ## 戻り値 From d074e9f98e67391319267fe5e8e1e8bc62ce8502 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sun, 13 Jul 2025 22:50:59 +0900 Subject: [PATCH 2212/3948] Update reference/cstdio/fread.md Co-authored-by: Koichi Murase --- reference/cstdio/fread.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdio/fread.md b/reference/cstdio/fread.md index 8b51b5a885..a2918cf229 100644 --- a/reference/cstdio/fread.md +++ b/reference/cstdio/fread.md @@ -28,7 +28,7 @@ namespace std { 読み込んだデータは、`buffer`が指すメモリの先頭から順に格納される。 -読み込んだデータの長さは、`count * size`バイトである。 +読み取りエラーが生じなければ、読み込むデータの大きさは`count * size`バイトである。 ## 例 ```cpp example From 3f22e2215487cbad0bbf2a754aef1bffe84bf6c7 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sun, 13 Jul 2025 22:52:11 +0900 Subject: [PATCH 2213/3948] fixed declaration of fpos_t --- reference/cstdio/fpos_t.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdio/fpos_t.md b/reference/cstdio/fpos_t.md index fb74effe6c..c72b2604ad 100644 --- a/reference/cstdio/fpos_t.md +++ b/reference/cstdio/fpos_t.md @@ -5,7 +5,7 @@ ```cpp namespace std { - typedef /* implementation-defined */ fpos_t; + using fpos_t = /* implementation-defined */; } ``` From b645fd6b7d581bcd26ce2c71f08272db3e6a9862 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sun, 13 Jul 2025 22:52:11 +0900 Subject: [PATCH 2214/3948] fixed declaration of fpos_t --- reference/cstdio/fpos_t.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdio/fpos_t.md b/reference/cstdio/fpos_t.md index fb74effe6c..c72b2604ad 100644 --- a/reference/cstdio/fpos_t.md +++ b/reference/cstdio/fpos_t.md @@ -5,7 +5,7 @@ ```cpp namespace std { - typedef /* implementation-defined */ fpos_t; + using fpos_t = /* implementation-defined */; } ``` From 942ab1ab8586029cfdbf085a32694249e488b25d Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sun, 13 Jul 2025 22:56:02 +0900 Subject: [PATCH 2215/3948] fixed declaration of `file.md` --- reference/cstdio/file.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdio/file.md b/reference/cstdio/file.md index 5791670be1..243769defe 100644 --- a/reference/cstdio/file.md +++ b/reference/cstdio/file.md @@ -5,7 +5,7 @@ ```cpp namespace std { - typedef /* unspecified */ FILE; + using FILE = /* unspecified */; } ``` From c6a67d839658e27cb8afd9ca2cbd03b7e57ec02b Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sun, 13 Jul 2025 23:23:27 +0900 Subject: [PATCH 2216/3948] fixed inappropriate code --- reference/cstdio/eof.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/reference/cstdio/eof.md b/reference/cstdio/eof.md index b603c81a11..3cda36b5b1 100644 --- a/reference/cstdio/eof.md +++ b/reference/cstdio/eof.md @@ -20,8 +20,7 @@ int main() { while ((c = std::getchar()) != EOF) { std::putchar(c); } - if (c == EOF) - std::puts("REACHED END"); + std::puts("REACHED END"); } ``` From 116c20ad12e92ea2afe704367730ad60b281ca91 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sun, 13 Jul 2025 23:53:14 +0900 Subject: [PATCH 2217/3948] fixed inappropriate code in `tmpnam.md` --- reference/cstdio/tmpnam.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdio/tmpnam.md b/reference/cstdio/tmpnam.md index ad26323a4f..7adeb5faea 100644 --- a/reference/cstdio/tmpnam.md +++ b/reference/cstdio/tmpnam.md @@ -31,7 +31,7 @@ namespace std { #include int main() { - char filename[1000]; + char filename[L_tmpnam]; if (std::tmpnam(filename)) { std::cout << "Generated filename: " << filename << '\n'; // ここで fopen(filename, "w") とかして使う(が、あまり推奨されない) From 55f9df14fbb786eacb8aa54d1de6df1d82163878 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 14 Jul 2025 08:02:32 +0900 Subject: [PATCH 2218/3948] fixed explanation for tmpnam --- reference/cstdio/tmpnam.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/cstdio/tmpnam.md b/reference/cstdio/tmpnam.md index 7adeb5faea..1d293b29cd 100644 --- a/reference/cstdio/tmpnam.md +++ b/reference/cstdio/tmpnam.md @@ -14,7 +14,7 @@ namespace std { 渡した引数の中にファイル名が格納される。 -この関数はスレッドセーフではないため、マルチスレッド環境での使用は推奨されない。 +この関数は引数に`NULL`を渡した場合にスレッドセーフではないため、使用時には注意が必要である。 また、生成された名前が他のファイル名とかぶらないことは保証されていない(保証する必要があるならば[`tmpfile`](/reference/cstdio/tmpfile.md)を使用する)。 @@ -31,7 +31,7 @@ namespace std { #include int main() { - char filename[L_tmpnam]; + char filename[1000]; if (std::tmpnam(filename)) { std::cout << "Generated filename: " << filename << '\n'; // ここで fopen(filename, "w") とかして使う(が、あまり推奨されない) From af2a99dea80102f489a533c6cbc7df70dcdcfc97 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 14 Jul 2025 21:17:41 +0900 Subject: [PATCH 2219/3948] fixed index in tmpnam.md --- reference/cstdio/tmpnam.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdio/tmpnam.md b/reference/cstdio/tmpnam.md index 1d293b29cd..d25320e34f 100644 --- a/reference/cstdio/tmpnam.md +++ b/reference/cstdio/tmpnam.md @@ -31,7 +31,7 @@ namespace std { #include int main() { - char filename[1000]; + char filename[L_tmpnam]; if (std::tmpnam(filename)) { std::cout << "Generated filename: " << filename << '\n'; // ここで fopen(filename, "w") とかして使う(が、あまり推奨されない) From 5050bbe3aa50c9d5bee2e2911153043117adb2d6 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 14 Jul 2025 21:18:57 +0900 Subject: [PATCH 2220/3948] Update reference/cstdio/fpos_t.md Co-authored-by: Koichi Murase --- reference/cstdio/fpos_t.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdio/fpos_t.md b/reference/cstdio/fpos_t.md index c72b2604ad..314047f650 100644 --- a/reference/cstdio/fpos_t.md +++ b/reference/cstdio/fpos_t.md @@ -12,7 +12,7 @@ namespace std { ## 概要 ファイルの位置を保持するための型。 -[`fseek()`](/reference/cstdio/fseek.md.nolink)関数や[`ftell()`](/reference/cstdio/ftell.md.nolink)関数とは違い、巨大なファイルやマルチバイトファイルに対しても適切に動作するすることを目的に設計された。 +[`fgetpos()`](/reference/cstdio/fgetpos.md.nolink)関数や[`fsetpos()`](/reference/cstdio/fsetpos.md.nolink)関数で用いられる。これらの関数は[`fseek()`](/reference/cstdio/fseek.md.nolink)関数や[`ftell()`](/reference/cstdio/ftell.md.nolink)関数と違い、巨大なファイルやマルチバイトファイルに対しても適切に動作するすることを目的に設計された。 ## 例 ```cpp example From 3aec3d6e61bd539f145a5629412a95e7cb231fda Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 14 Jul 2025 21:19:05 +0900 Subject: [PATCH 2221/3948] Update reference/cstdio/fpos_t.md Co-authored-by: Koichi Murase --- reference/cstdio/fpos_t.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdio/fpos_t.md b/reference/cstdio/fpos_t.md index 314047f650..3303e37c03 100644 --- a/reference/cstdio/fpos_t.md +++ b/reference/cstdio/fpos_t.md @@ -5,7 +5,7 @@ ```cpp namespace std { - using fpos_t = /* implementation-defined */; + using fpos_t = implementation-defined; } ``` From be4f0ebf8933b9687adca36fd78b37acf25f4606 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 14 Jul 2025 21:57:01 +0900 Subject: [PATCH 2222/3948] removed /* */ for implementation-defined (#1473) --- reference/cstdio/stderr.md | 2 +- reference/cstdio/stdin.md | 2 +- reference/cstdio/stdout.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/cstdio/stderr.md b/reference/cstdio/stderr.md index 1909dbab28..d6d0ddf74d 100644 --- a/reference/cstdio/stderr.md +++ b/reference/cstdio/stderr.md @@ -3,7 +3,7 @@ * macro[meta id-type] ```cpp -#define stderr /* implementation-defined */ +#define stderr implementation-defined ``` ## 概要 diff --git a/reference/cstdio/stdin.md b/reference/cstdio/stdin.md index 44a907f0a9..2cb07e4ee2 100644 --- a/reference/cstdio/stdin.md +++ b/reference/cstdio/stdin.md @@ -3,7 +3,7 @@ * macro[meta id-type] ```cpp -#define stdin /* implementation-defined */ +#define stdin implementation-defined ``` ## 概要 diff --git a/reference/cstdio/stdout.md b/reference/cstdio/stdout.md index e417835178..d4d068a994 100644 --- a/reference/cstdio/stdout.md +++ b/reference/cstdio/stdout.md @@ -3,7 +3,7 @@ * macro[meta id-type] ```cpp -#define stdout /* implementation-defined */ +#define stdout implementation-defined ``` ## 概要 From 62352b3c4040d8534d037b42dc0aabfc152861b9 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Mon, 14 Jul 2025 22:07:06 +0900 Subject: [PATCH 2223/3948] =?UTF-8?q?`namespace=20std`=E3=81=AE=E5=89=8A?= =?UTF-8?q?=E9=99=A4=E3=80=81=E8=A1=A8=E8=A8=98=E3=81=AE=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #1470 --- reference/cstdlib/mb_cur_max.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/reference/cstdlib/mb_cur_max.md b/reference/cstdlib/mb_cur_max.md index 21450cdb3d..53908c1c03 100644 --- a/reference/cstdlib/mb_cur_max.md +++ b/reference/cstdlib/mb_cur_max.md @@ -3,9 +3,7 @@ * macro[meta id-type] ```cpp -namespace std { - #define MB_CUR_MAX /* implementation defined */ -} +#define MB_CUR_MAX implementation-defined ``` ## 概要 @@ -28,12 +26,12 @@ int main() { //C ロケール(標準ASCII) std::cout << "Locale: standard, MB_CUR_MAX: " << MB_CUR_MAX << std::endl; + //ロケールを日本(UTF-8)に変更 if (std::setlocale(LC_CTYPE, "ja_JP.UTF-8") == nullptr) { - std::cout << "Failed to set locale to: ja_JP.UTF-8" << std::endl; + std::cout << "Failed to set locale to: ja_JP.UTF-8" << std::endl; + } else { + std::cout << "Locale: ja_JP.UTF-8, MB_CUR_MAX: " << MB_CUR_MAX << std::endl; } - std::setlocale(LC_CTYPE, "ja_JP.UTF-8");//ロケールを日本語UTF-8に変更 - std::cout << "Locale: ja_JP.UTF-8, MB_CUR_MAX: " << MB_CUR_MAX << std::endl; - return 0; } ``` From 0b04c502696c36721996bdbfac776a80c8ee5ec6 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Mon, 14 Jul 2025 22:17:14 +0900 Subject: [PATCH 2224/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BE=8B?= =?UTF-8?q?=E5=A4=89=E6=9B=B4=E5=BE=8C=E3=80=81=E5=87=BA=E5=8A=9B=E4=BE=8B?= =?UTF-8?q?=E3=81=AE=E5=8F=8D=E6=98=A0=E3=81=97=E5=BF=98=E3=82=8C=E3=82=92?= =?UTF-8?q?=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/mb_cur_max.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdlib/mb_cur_max.md b/reference/cstdlib/mb_cur_max.md index 53908c1c03..fb5c43f0e0 100644 --- a/reference/cstdlib/mb_cur_max.md +++ b/reference/cstdlib/mb_cur_max.md @@ -37,7 +37,7 @@ int main() { ### 出力例 ``` -Locale: standard(C), MB_CUR_MAX: 1 +Locale: standard, MB_CUR_MAX: 1 Locale: ja_JP.UTF-8, MB_CUR_MAX: 6 ``` From fbe0ff2648113ba237bf7873e790402c1ebc4cd0 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Mon, 14 Jul 2025 22:22:41 +0900 Subject: [PATCH 2225/3948] =?UTF-8?q?:=E5=89=8A=E9=99=A4=E3=80=81:?= =?UTF-8?q?=E5=BE=8C=E3=81=AB=E3=82=B9=E3=83=9A=E3=83=BC=E3=82=B9=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/mb_cur_max.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/cstdlib/mb_cur_max.md b/reference/cstdlib/mb_cur_max.md index fb5c43f0e0..3872e41c31 100644 --- a/reference/cstdlib/mb_cur_max.md +++ b/reference/cstdlib/mb_cur_max.md @@ -28,7 +28,7 @@ int main() { //ロケールを日本(UTF-8)に変更 if (std::setlocale(LC_CTYPE, "ja_JP.UTF-8") == nullptr) { - std::cout << "Failed to set locale to: ja_JP.UTF-8" << std::endl; + std::cout << "Failed to set locale to ja_JP.UTF-8" << std::endl; } else { std::cout << "Locale: ja_JP.UTF-8, MB_CUR_MAX: " << MB_CUR_MAX << std::endl; } @@ -42,8 +42,8 @@ Locale: ja_JP.UTF-8, MB_CUR_MAX: 6 ``` ## 関連項目 -- [`MB_LEN_MAX`](/reference/climits/mb_len_max.md):全ロケールでのマルチバイト文字の最大バイト数 -- `setlocale`:ロケールを変更する +- [`MB_LEN_MAX`](/reference/climits/mb_len_max.md): 全ロケールでのマルチバイト文字の最大バイト数 +- `setlocale`: ロケールを変更する ## 参照 - [mb_cur_max(3) - Linux man page](https://linux.die.net/man/3/mb_cur_max) From 090865fe33d4085c229602076c1172479d519241 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Tue, 15 Jul 2025 00:43:09 +0900 Subject: [PATCH 2226/3948] new page `strtol.md` --- reference/cstdlib/strtol.md | 77 +++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 reference/cstdlib/strtol.md diff --git a/reference/cstdlib/strtol.md b/reference/cstdlib/strtol.md new file mode 100644 index 0000000000..01824776e0 --- /dev/null +++ b/reference/cstdlib/strtol.md @@ -0,0 +1,77 @@ +# strtol +* cstdlib[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +namespace std { + long int strtol(const char* nptr, char** endptr, int base); +} +``` + +## 概要 +文字列`nptr`を`long`型の整数に変換する。変換時には`base`で指定された基数に従って解釈される。 + +`endptr`が非`nullptr`の場合、変換が終了した位置の文字へのポインタがそこに格納される。 + +基数`base`は 2~36 または 0 の値を取る。 + +`base`が0の場合 +- 文字列の先頭が`0`の場合は8進数 +- 先頭が`0x`、`0X`は16進数 +- その他の場合は10進数として変換される。 + +変換は次のように行われる +- 先頭の空白文字は最初の非空白文字から変換される。 +- `+`または`-`が先頭にある場合は、符号として解釈される。 +- その後の文字列を、指定された`base`に基づいて整数値に変換する。 + + +## 戻り値 +- 変換可能ならば変換後の数値。 + +- 変換後の数値が`long`の範囲外の場合、`LONG_MAX`または `LONG_MIN`。 + +- 変換不可能なら`0`を返す。 + +## 備考 +この関数はスレッドセーフである。 + + + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + const char* str = " -0x2Fabc"; + + errno = 0; + long result1 = std::strtol(str, nullptr, 0); // 自動判別 + std::cout << "変換結果(基数0): " << result1 << std::endl; + + errno = 0; + long result2 = std::strtol(str, nullptr, 10); // 10進数として解釈 + std::cout << "変換結果(基数10): " << result2 << std::endl; + + errno = 0; + long result3 = std::strtol(str, nullptr, 36); // 36進数として解釈 + std::cout << "変換結果(基数36): " << result3 << std::endl; + + return 0; +} +``` +### 出力 +``` +変換結果(基数0): -195260 +変換結果(基数10): 0 +変換結果(基数36): -1999456248 +``` + +## 関連項目 +- [`strtoll`](strtoll.md.nolink): 文字列を、基数を指定して`long long`型に変換する +- [`strtoul`](strtoul.md.nolink): 文字列を、基数を指定して`unsigned long`型に変換する +- [`strtoull`](strtoull.md.nolink): 文字列を、基数を指定して`unsigned long long`型に変換する From 4124913983fd6155bb3be807d80267a28fabc443 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Tue, 15 Jul 2025 08:29:44 +0900 Subject: [PATCH 2227/3948] fixed declaration of `fpos_t` --- reference/cstdio/fpos_t.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdio/fpos_t.md b/reference/cstdio/fpos_t.md index 3303e37c03..058ef368ad 100644 --- a/reference/cstdio/fpos_t.md +++ b/reference/cstdio/fpos_t.md @@ -5,7 +5,7 @@ ```cpp namespace std { - using fpos_t = implementation-defined; + using fpos_t = object-type; } ``` From ea1f776f98e3fe96a7981dcfb142cee2bfb5bd52 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Tue, 15 Jul 2025 15:57:54 +0900 Subject: [PATCH 2228/3948] add path to `strto;.md` --- reference/cstdlib.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdlib.md b/reference/cstdlib.md index a188b26aa9..c43a91519d 100644 --- a/reference/cstdlib.md +++ b/reference/cstdlib.md @@ -17,7 +17,7 @@ | [`atol`](cstdlib/atoi_atol_atoll.md) | 文字列を`long`型に変換する (function) | | | [`atoll`](cstdlib/atoi_atol_atoll.md) | 文字列を`long long`型に変換する (function) | C++11 | | [`atof`](cstdlib/atof.md) | 文字列を`double`型に変換する (function) | | -| `strtol` | 文字列を、基数を指定して`long`型に変換する (function) | | +| [`strtol`](cstdlib/strtol.md) | 文字列を、基数を指定して`long`型に変換する (function) | | | `strtoll` | 文字列を、基数を指定して`long long`型に変換する (function) | C++11 | | `strtoul` | 文字列を、基数を指定して`unsigned long`型に変換する (function) | | | `strtoull` | 文字列を、基数を指定して`unsigned long long`型に変換する (function) | C++11 | From 503290d01dfebc9554f42be8f080d878999ef6c1 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 14 Jul 2025 23:06:22 +0900 Subject: [PATCH 2229/3948] =?UTF-8?q?chore:=20"see=20below"=20=E3=82=92=20?= =?UTF-8?q?GLOBAL=5FQUALIFY=5FLIST.txt=20=E3=81=AB=E7=99=BB=E9=8C=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/cpprefjp/site/issues/1464#issuecomment-3066610534 --- GLOBAL_QUALIFY_LIST.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 4a385d99a5..699747016c 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -4,6 +4,7 @@ * import std.compat;[link /module/std.compat.md] * thread_local[link /lang/cpp11/thread_local_storage.md] * decltype(auto)[link /lang/cpp14/decltype_auto.md] +* see below[italic] * synth-three-way-result[link /reference/exposition-only/synth-three-way-result.md] * synth-three-way[link /reference/exposition-only/synth-three-way-result.md] * [link /reference/algorithm.md] From 7b47559e6a2349beaf44f8a9952266bc709a4852 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 14 Jul 2025 23:04:00 +0900 Subject: [PATCH 2230/3948] =?UTF-8?q?chore:=20=E5=80=8B=E5=88=A5=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E3=83=96=E3=83=AD=E3=83=83=E3=82=AF=E3=81=AE?= =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE=E9=A3=BE=20"*=20see=20belo?= =?UTF-8?q?w[italic]"=20=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Note: これは手動ではなく機械的な変更です。 --- reference/atomic/atomic_flag_init.md | 1 - reference/atomic/atomic_var_init.md | 1 - reference/barrier/barrier.md | 1 - reference/charconv/from_chars.md | 1 - reference/charconv/to_chars.md | 1 - reference/chrono/file_clock.md | 3 --- reference/chrono/hh_mm_ss/fractional_width.md | 1 - reference/compare/three_way_comparable.md | 1 - reference/concepts/boolean-testable.md | 1 - reference/concepts/default_initializable.md | 1 - reference/concepts/equality_comparable.md | 1 - reference/concepts/same_as.md | 1 - reference/execution/execution/apply_sender.md | 1 - reference/execution/execution/as_awaitable.md | 2 -- reference/execution/execution/basic-operation.md | 3 --- reference/execution/execution/basic-sender.md | 2 -- reference/execution/execution/bulk.md | 2 -- reference/execution/execution/completion_signatures.md | 2 -- reference/execution/execution/default_domain/apply_sender.md | 1 - .../execution/execution/default_domain/transform_sender.md | 1 - reference/execution/execution/env/query.md | 1 - reference/execution/execution/gather-signatures.md | 1 - reference/execution/execution/impls-for.md | 1 - reference/execution/execution/into_variant.md | 1 - reference/execution/execution/let_value.md | 3 --- reference/execution/execution/make-sender.md | 1 - reference/execution/execution/on.md | 1 - reference/execution/execution/product-type.md | 2 -- reference/execution/execution/query-with-default.md | 1 - reference/execution/execution/schedule_from.md | 2 -- reference/execution/execution/single-sender-value-type.md | 1 - reference/execution/execution/split.md | 2 -- reference/execution/execution/tag_of_t.md | 1 - .../execution/execution/transform_completion_signatures.md | 1 - .../execution/execution/transform_completion_signatures_of.md | 1 - reference/execution/execution/transform_sender.md | 1 - reference/execution/execution/variant-or-empty.md | 1 - reference/execution/execution/when_all.md | 3 --- reference/execution/execution/with_awaitable_senders.md | 1 - reference/execution/execution/write-env.md | 1 - reference/expected/expected.void/op_assign.md | 1 - reference/expected/expected.void/op_constructor.md | 1 - reference/expected/expected.void/swap.md | 1 - reference/expected/expected/op_assign.md | 1 - reference/expected/expected/op_constructor.md | 1 - reference/expected/expected/swap.md | 1 - reference/format/format_kind.md | 1 - reference/functional/function_ref/op_deduction_guide.md | 1 - reference/functional/placeholders.md | 1 - reference/functional/reference_wrapper/op_constructor.md | 1 - reference/iterator/common_iterator.md | 1 - reference/iterator/common_iterator/op_arrow.md | 1 - reference/iterator/indirectly_readable.md | 1 - reference/iterator/is_integer_like.md | 1 - reference/iterator/iter_difference_t.md | 1 - reference/iterator/iter_value_t.md | 1 - reference/iterator/iterator_traits.md | 1 - reference/iterator/reverse_iterator/iter_move.md | 1 - reference/iterator/reverse_iterator/iter_swap.md | 1 - reference/mdspan/extents.md | 1 - reference/mdspan/extents/op_constructor.md | 1 - reference/mdspan/extents/op_deduction_guide.md | 1 - reference/mdspan/is-layout-left-padded-mapping-of.md | 1 - reference/mdspan/is-layout-right-padded-mapping-of.md | 1 - reference/mdspan/layout_left/mapping/submdspan_mapping.md | 1 - reference/mdspan/layout_left_padded/mapping/op_constructor.md | 1 - .../mdspan/layout_left_padded/mapping/submdspan_mapping.md | 1 - reference/mdspan/layout_right/mapping/submdspan_mapping.md | 1 - reference/mdspan/layout_right_padded/mapping/op_constructor.md | 1 - .../mdspan/layout_right_padded/mapping/submdspan_mapping.md | 1 - reference/mdspan/layout_stride/mapping/op_constructor.md | 1 - reference/mdspan/layout_stride/mapping/submdspan_mapping.md | 1 - reference/mdspan/mdspan/op_constructor.md | 1 - reference/mdspan/submdspan.md | 1 - reference/memory/uses_allocator_construction_args.md | 1 - reference/numbers/e.md | 1 - reference/numbers/egamma.md | 1 - reference/numbers/inv_pi.md | 1 - reference/numbers/inv_sqrt3.md | 1 - reference/numbers/inv_sqrtpi.md | 1 - reference/numbers/ln10.md | 1 - reference/numbers/ln2.md | 1 - reference/numbers/log10e.md | 1 - reference/numbers/log2e.md | 1 - reference/numbers/phi.md | 1 - reference/numbers/pi.md | 1 - reference/numbers/sqrt2.md | 1 - reference/numbers/sqrt3.md | 1 - reference/optional/make_optional.md | 1 - reference/optional/optional/op_assign.md | 1 - reference/optional/optional/op_constructor.md | 1 - reference/optional/optional/swap.md | 1 - reference/ranges/enable_view.md | 1 - reference/span/span/subspan.md | 1 - reference/string/basic_string/op_compare_3way.md | 1 - reference/string/basic_string/op_deduction_guide.md | 1 - reference/string_view/basic_string_view/op_compare_3way.md | 1 - reference/tuple/apply.md | 1 - reference/tuple/tuple/op_assign.md | 1 - reference/tuple/tuple/op_constructor.md | 2 -- reference/tuple/tuple/swap.md | 1 - reference/unordered_map/unordered_map/op_deduction_guide.md | 1 - .../unordered_map/unordered_multimap/op_deduction_guide.md | 1 - .../unordered_set/unordered_multiset/op_deduction_guide.md | 1 - reference/unordered_set/unordered_set/op_deduction_guide.md | 1 - reference/utility/exchange.md | 1 - reference/utility/pair/op_assign.md | 1 - reference/utility/pair/op_constructor.md | 1 - reference/utility/pair/swap.md | 1 - reference/utility/swap.md | 1 - reference/variant/variant/op_assign.md | 1 - reference/variant/variant/op_constructor.md | 1 - reference/variant/variant/swap.md | 1 - reference/variant/variant/swap_free.md | 1 - reference/variant/visit.md | 1 - 115 files changed, 131 deletions(-) diff --git a/reference/atomic/atomic_flag_init.md b/reference/atomic/atomic_flag_init.md index bced794a22..b34a7e92e5 100644 --- a/reference/atomic/atomic_flag_init.md +++ b/reference/atomic/atomic_flag_init.md @@ -7,7 +7,6 @@ ```cpp # define ATOMIC_FLAG_INIT see below ``` -* see below[italic] この機能はC++20で非推奨となった。[`std::atomic_flag`](atomic_flag.md)クラスのデフォルトコンストラクタが値初期化するようになったため、初期化のためにこの機能を使用する必要はない。 diff --git a/reference/atomic/atomic_var_init.md b/reference/atomic/atomic_var_init.md index 490b1131f8..0b7ec6dd0e 100644 --- a/reference/atomic/atomic_var_init.md +++ b/reference/atomic/atomic_var_init.md @@ -7,7 +7,6 @@ ```cpp # define ATOMIC_VAR_INIT(value) see below ``` -* see below[italic] この機能はC++20で非推奨となった。[`std::atomic`](atomic.md)クラスのデフォルトコンストラクタが値初期化するようになったため、初期化のためにこの機能を使用する必要はない。 diff --git a/reference/barrier/barrier.md b/reference/barrier/barrier.md index b69d2c5c64..e4c8dca897 100644 --- a/reference/barrier/barrier.md +++ b/reference/barrier/barrier.md @@ -10,7 +10,6 @@ namespace std { class barrier; } ``` -* see below[italic] ## 概要 `barrier`クラスは、複数スレッドにより並行実行される反復的なタスク制御に便利な、スレッド調整機構(同期プリミティブ)である。 diff --git a/reference/charconv/from_chars.md b/reference/charconv/from_chars.md index 065dd96b10..295a7eba1d 100644 --- a/reference/charconv/from_chars.md +++ b/reference/charconv/from_chars.md @@ -41,7 +41,6 @@ namespace std { chars_format fmt = chars_format::general); // (5) C++23 } ``` -* see below[italic] * integer-type[italic] * from_chars_result[link from_chars_result.md] diff --git a/reference/charconv/to_chars.md b/reference/charconv/to_chars.md index e3f2677877..d45eb57976 100644 --- a/reference/charconv/to_chars.md +++ b/reference/charconv/to_chars.md @@ -92,7 +92,6 @@ namespace std { int precision); // (13) C++23 } ``` -* see below[italic] * integer-type[italic] * to_chars_result[link to_chars_result.md] diff --git a/reference/chrono/file_clock.md b/reference/chrono/file_clock.md index a2384750aa..d282c9d8f0 100644 --- a/reference/chrono/file_clock.md +++ b/reference/chrono/file_clock.md @@ -9,7 +9,6 @@ namespace std::chrono { using file_clock = see below; } ``` -* see below[italic] ## 概要 `file_clock`は、ファイル時間を作るために使用されるクロックである。この時刻系は[``](/reference/filesystem.md)ライブラリにおいてファイル作成日時やファイル更新日時を表現する[`file_time_type`](/reference/filesystem/file_time_type.md)のために定義される。 @@ -32,7 +31,6 @@ template static file_time from_sys(const sys_time&); ``` -* see below[italic] * utc_clock[link utc_clock.md] * sys_time[link sys_time.md] * file_time[link file_time.md] @@ -49,7 +47,6 @@ template static file_time from_utc(const utc_time&); ``` -* see below[italic] * tai_clock[link tai_clock.md] * gps_clock[link gps_clock.md] * utc_time[link utc_time.md] diff --git a/reference/chrono/hh_mm_ss/fractional_width.md b/reference/chrono/hh_mm_ss/fractional_width.md index 36ae48c339..ee011532b2 100644 --- a/reference/chrono/hh_mm_ss/fractional_width.md +++ b/reference/chrono/hh_mm_ss/fractional_width.md @@ -14,7 +14,6 @@ namespace std::chrono { }; } ``` -* see below[italic] ## 概要 `precision`型によって表現される小数の小数桁数。 diff --git a/reference/compare/three_way_comparable.md b/reference/compare/three_way_comparable.md index 484bbd9ee1..ff2d789ed7 100644 --- a/reference/compare/three_way_comparable.md +++ b/reference/compare/three_way_comparable.md @@ -13,7 +13,6 @@ namespace std { concept three_way_comparable_with = /*see below*/; // (2) } ``` -* see below[italic] ## 概要 `three_way_comparable`及び`three_way_comparable_with`は、指定された型`T`もしくは`T, U`の間で`<=>`による三方比較を使用可能であり、その戻り値型が指定した[比較カテゴリ型](/reference/compare.md)`Cat`に変換可能であることを表すコンセプトである。 diff --git a/reference/concepts/boolean-testable.md b/reference/concepts/boolean-testable.md index 35ec8b320f..f300531ca9 100644 --- a/reference/concepts/boolean-testable.md +++ b/reference/concepts/boolean-testable.md @@ -10,7 +10,6 @@ namespace std { concept boolean-testable = /*see below*/; // 説明専用コンセプト } ``` -* see below[italic] ## 概要 diff --git a/reference/concepts/default_initializable.md b/reference/concepts/default_initializable.md index dc2da8d2d0..4d350da56b 100644 --- a/reference/concepts/default_initializable.md +++ b/reference/concepts/default_initializable.md @@ -10,7 +10,6 @@ namespace std { concept default_initializable = /*see below*/; } ``` -* see below[italic] ## 概要 diff --git a/reference/concepts/equality_comparable.md b/reference/concepts/equality_comparable.md index 4f94310232..17bdfa48fe 100644 --- a/reference/concepts/equality_comparable.md +++ b/reference/concepts/equality_comparable.md @@ -13,7 +13,6 @@ namespace std { concept equality_comparable_with = /*see below*/; // (2) } ``` -* see below[italic] ## 概要 `equality_comparable`及び`equality_comparable_with`は、指定された型`T`もしくは`T, U`の間で`==`演算子による同値比較が可能である事を表すコンセプトである。 diff --git a/reference/concepts/same_as.md b/reference/concepts/same_as.md index bb7ce99bd8..955ab8ead7 100644 --- a/reference/concepts/same_as.md +++ b/reference/concepts/same_as.md @@ -10,7 +10,6 @@ namespace std { concept same_as = /*see below*/; } ``` -* see below[italic] ## 概要 diff --git a/reference/execution/execution/apply_sender.md b/reference/execution/execution/apply_sender.md index 6fcd234204..e22cf24772 100644 --- a/reference/execution/execution/apply_sender.md +++ b/reference/execution/execution/apply_sender.md @@ -12,7 +12,6 @@ namespace std::execution { } ``` * sender[link sender.md] -* see below[italic] ## 概要 [実行ドメイン](default_domain.md)に応じてSenderアルゴリズムを適用する。 diff --git a/reference/execution/execution/as_awaitable.md b/reference/execution/execution/as_awaitable.md index 3261083df0..e5d61cb415 100644 --- a/reference/execution/execution/as_awaitable.md +++ b/reference/execution/execution/as_awaitable.md @@ -58,7 +58,6 @@ namespace std::execution { * env_of_t[link env_of_t.md] * sender_to[link sender_to.md] * coroutine_handle<>[link /reference/coroutine/coroutine_handle.md] -* see below[italic] ### クラステンプレート`sender-awaitable` ```cpp @@ -117,7 +116,6 @@ struct awaitable-receiver { * monostate[link /reference/variant/monostate.md] * exception_ptr[link /reference/exception/exception_ptr.md] * coroutine_handle[link /reference/coroutine/coroutine_handle.md] -* see below[italic] 説明用の式`rcvr`を`awaitable-receiver`型の右辺値、`crcvr`を`rcvr`をconst参照する左辺値、`vs`を式パック、`err`を`Err`型の式とする。このとき diff --git a/reference/execution/execution/basic-operation.md b/reference/execution/execution/basic-operation.md index 5151b2b2c0..44f7fa0834 100644 --- a/reference/execution/execution/basic-operation.md +++ b/reference/execution/execution/basic-operation.md @@ -41,7 +41,6 @@ namespace std::execution { * tag_of_t[link tag_of_t.md] * impls-for[link impls-for.md] * std::move[link /reference/utility/move.md] -* see below[italic] ## 概要 `basic-operation`および`basic-state`は、Senderアルゴリズム動作仕様定義で用いられる説明専用のクラステンプレートである。 @@ -109,7 +108,6 @@ using indices-for = remove_reference_t::indices-for; // exposition only * call-result-t[link /reference/functional/call-result-t.md] * impls-for[link impls-for.md] * tag_of_t[link tag_of_t.md] -* see below[italic] 説明専用の定数`connect-all`は、下記ラムダ式と等価な関数呼び出し可能なオブジェクトとして初期化される。 @@ -130,7 +128,6 @@ using indices-for = remove_reference_t::indices-for; // exposition only * connect[link connect.md] * basic-receiver[link basic-receiver.md] * integral_constant[link /reference/type_traits/integral_constant.md] -* see below[italic] - テンプレートパラメータ制約 : ラムダ式中の`return`文の式が適格であること。 - ラムダ式中の`return`文の式が例外送出する可能性がある場合は、`noexcept(false)`となる。そうでなければ、`noexcept(true)`となる。 diff --git a/reference/execution/execution/basic-sender.md b/reference/execution/execution/basic-sender.md index cf4d6e1c92..0496601258 100644 --- a/reference/execution/execution/basic-sender.md +++ b/reference/execution/execution/basic-sender.md @@ -39,7 +39,6 @@ namespace std::execution { * basic-operation[link basic-operation.md] * std::move[link /reference/utility/move.md] * this Self[link /lang/cpp23/deducing_this.md.nolink] -* see below[italic] ## 概要 `basic-sender`は、Senderアルゴリズム動作仕様定義で用いられる説明専用のクラステンプレートである。 @@ -69,7 +68,6 @@ is_nothrow_constructible_v, Self, Rcvr> template using completion-signatures-for = see below; // exposition only ``` -* see below[italic] 説明用の`sndr`を`decltype((sndr))`が`Sndr`型となる式、`rcvr`を[`sender_in`](sender_in.md)` == true`となる[環境](../queryable.md)`Env`に関連付けられた[`Receiver`](receiver.md)とする。 diff --git a/reference/execution/execution/bulk.md b/reference/execution/execution/bulk.md index 1b90ea800a..96ed1cf018 100644 --- a/reference/execution/execution/bulk.md +++ b/reference/execution/execution/bulk.md @@ -49,7 +49,6 @@ namespace std::execution { ``` * impls-for[link impls-for.md] * default-impls[link impls-for.md] -* see below[italic] `impls-for::complete`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 @@ -73,7 +72,6 @@ namespace std::execution { * set_value_t[link set_value.md] * TRY-EVAL[link set_value.md] * std::move[link /reference/utility/move.md] -* see below[italic] 型`Tag`が[`set_value_t`](set_value.md)以外の型であるとき、もしくは式`f(auto(shape), args...)`が適格なときに限って、上記ラムダ式のrequires節が満たされる。 diff --git a/reference/execution/execution/completion_signatures.md b/reference/execution/execution/completion_signatures.md index ac941e36cd..731f2795e4 100644 --- a/reference/execution/execution/completion_signatures.md +++ b/reference/execution/execution/completion_signatures.md @@ -20,7 +20,6 @@ namespace std::execution { template concept valid-completion-signatures = see below; ``` -* see below[italic] `Sigs`が[`completion_signatures`](completion_signatures.md)クラステンプレートの特殊化であるとき、`Sigs`は説明専用コンセプト`valid-completion-signatures`のモデルである。 @@ -32,7 +31,6 @@ concept valid-completion-signatures = see below; template concept completion-signature = see below; ``` -* see below[italic] 型`Fn`が下記いずれかを満たす関数型であるとき、`Fn`はコンセプト`completion-signature`を満たす。 - [`set_value_t`](set_value.md)`(Vs...)`(`Vs`はオブジェクト型または参照型のパック) diff --git a/reference/execution/execution/default_domain/apply_sender.md b/reference/execution/execution/default_domain/apply_sender.md index 60a31cec66..35298ced2f 100644 --- a/reference/execution/execution/default_domain/apply_sender.md +++ b/reference/execution/execution/default_domain/apply_sender.md @@ -11,7 +11,6 @@ constexpr decltype(auto) apply_sender(Tag, Sndr&& sndr, Args&&... args) noexcept(see below); ``` * sender[link ../sender.md] -* see below[italic] ## 概要 Senderアルゴリズム適用のデフォルト動作。 diff --git a/reference/execution/execution/default_domain/transform_sender.md b/reference/execution/execution/default_domain/transform_sender.md index 4886480afa..c808d3683c 100644 --- a/reference/execution/execution/default_domain/transform_sender.md +++ b/reference/execution/execution/default_domain/transform_sender.md @@ -13,7 +13,6 @@ constexpr sender decltype(auto) transform_sender(Sndr&& sndr, const Env&... env) ``` * sender[link ../sender.md] * queryable[link ../../queryable.md] -* see below[italic] ## 概要 Sender変換のデフォルト動作。 diff --git a/reference/execution/execution/env/query.md b/reference/execution/execution/env/query.md index 3a4620af3d..80e2800127 100644 --- a/reference/execution/execution/env/query.md +++ b/reference/execution/execution/env/query.md @@ -9,7 +9,6 @@ template constexpr decltype(auto) query(QueryTag q) const noexcept(see below); ``` -* see below[italic] ## 概要 [クエリオブジェクト](../../queryable.md)`q`をキーとして、対応する値を問い合わせる。 diff --git a/reference/execution/execution/gather-signatures.md b/reference/execution/execution/gather-signatures.md index f36a5e2b63..b37ea0cd75 100644 --- a/reference/execution/execution/gather-signatures.md +++ b/reference/execution/execution/gather-signatures.md @@ -12,7 +12,6 @@ template::get-state`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 diff --git a/reference/execution/execution/let_value.md b/reference/execution/execution/let_value.md index 105a327b18..226d1d486d 100644 --- a/reference/execution/execution/let_value.md +++ b/reference/execution/execution/let_value.md @@ -55,7 +55,6 @@ namespace std::execution { * default-impls[link impls-for.md] * decayed-typeof[link /reference/functional/decayed-typeof.md] * let-cpo[italic] -* see below[italic] `impls-for>::get-state`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 @@ -84,7 +83,6 @@ namespace std::execution { return state-type{std::forward_like(fn), let-env(child), {}, {}}; } ``` -* see below[italic] - 説明用のパック`Sigs`を[`completion_signatures_of_t`](completion_signatures_of_t.md)`<`[`child-type`](child-type.md)`,` [`env_of_t`](env_of_t.md)`>`による[`completion_signatures`](completion_signatures.md)特殊化のテンプレートパラメータとし、パック`LetSigs`を`Sigs`に含まれる型のうち戻り値型が[`decayed-typeof`](/reference/functional/decayed-typeof.md)``に等しいものと定義する。説明用のエイリアステンプレート`as-tuple`を[`decayed-tuple`](decayed-tuple.md)``と定義する。型`args_variant_t`は下記定義において重複削除した型となる。 @@ -206,7 +204,6 @@ namespace std::execution { * execution::set_error[link set_error.md] * execution::set_stopped[link set_stopped.md] * std::move[link /reference/utility/move.md] -* see below[italic] メンバ関数`receiver2::get_env`の呼び出しは、下記を満たすオブジェクト`e`を返す。 diff --git a/reference/execution/execution/make-sender.md b/reference/execution/execution/make-sender.md index 1e1b5c643d..d57037be03 100644 --- a/reference/execution/execution/make-sender.md +++ b/reference/execution/execution/make-sender.md @@ -8,7 +8,6 @@ template constexpr auto make-sender(Tag tag, Data&& data, Child&&... child); ``` -* see below[italic] ## 概要 `make-sender`は、Senderアルゴリズム動作仕様定義で用いられる説明専用の関数テンプレートである。 diff --git a/reference/execution/execution/on.md b/reference/execution/execution/on.md index 22906fc8b6..464753bafe 100644 --- a/reference/execution/execution/on.md +++ b/reference/execution/execution/on.md @@ -143,7 +143,6 @@ struct not-a-sender { }; ``` * sender_t[link sender.md] -* see below[italic] メンバ関数`get_completion_signatures`は[`completion_signatures`](completion_signatures.md)クラステンプレートの特殊化とは異なる型のオブジェクトを返す。 処理系(標準ライブラリ実装者)は、この型を用いてユーザにエラー理由を通知することが推奨される。 diff --git a/reference/execution/execution/product-type.md b/reference/execution/execution/product-type.md index ac23581b2d..741df2bbdd 100644 --- a/reference/execution/execution/product-type.md +++ b/reference/execution/execution/product-type.md @@ -21,7 +21,6 @@ struct product-type { // exposition only }; ``` * this Self[link /lang/cpp23/deducing_this.md.nolink] -* see below[italic] ## 概要 `product-type`は、Senderアルゴリズム動作仕様定義で用いられる説明専用のクラステンプレートである。 @@ -48,7 +47,6 @@ template constexpr decltype(auto) apply(this Self&& self, Fn&& fn) noexcept(see below); ``` * this Self[link /lang/cpp23/deducing_this.md.nolink] -* see below[italic] - テンプレートパラメータ制約 : 下記`return`文の式が適格であること。 - 効果 : 下記と等価 diff --git a/reference/execution/execution/query-with-default.md b/reference/execution/execution/query-with-default.md index 0df3e1fef6..8df81e402a 100644 --- a/reference/execution/execution/query-with-default.md +++ b/reference/execution/execution/query-with-default.md @@ -9,7 +9,6 @@ template constexpr decltype(auto) query-with-default( Tag, const Env& env, Default&& value) noexcept(see below); ``` -* see below[italic] ## 概要 `query-with-default`は、Senderアルゴリズム動作仕様定義で用いられる説明専用の関数テンプレートである。 diff --git a/reference/execution/execution/schedule_from.md b/reference/execution/execution/schedule_from.md index 7ca0c2e014..151fd20264 100644 --- a/reference/execution/execution/schedule_from.md +++ b/reference/execution/execution/schedule_from.md @@ -50,7 +50,6 @@ namespace std::execution { ``` * impls-for[link impls-for.md] * default-impls[link impls-for.md] -* see below[italic] `impls-for::get-attrs`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 @@ -97,7 +96,6 @@ namespace std::execution { * schedule_result_t[link schedule_result_t.md] * connect[link connect.md] * schedule[link schedule.md] -* see below[italic] - ローカルクラス`state-type`のオブジェクトは[構造化束縛](/lang/cpp17/structured_bindings.md)における初期化子として利用できる。 - 説明用のパック`Sigs`を[`completion_signatures_of_t`](completion_signatures_of_t.md)`<`[`child-type`](child-type.md)`,` [`env_of_t`](env_of_t.md)`>`による[`completion_signatures`](completion_signatures.md)特殊化のテンプレートパラメータと定義する。説明用のエイリアステンプレート`as-tuple`を[`decayed-tuple`](decayed-tuple.md)``と定義する。型`variant_t`は下記定義において重複削除した型となる。 diff --git a/reference/execution/execution/single-sender-value-type.md b/reference/execution/execution/single-sender-value-type.md index 38d30c9fb3..dcbd671382 100644 --- a/reference/execution/execution/single-sender-value-type.md +++ b/reference/execution/execution/single-sender-value-type.md @@ -8,7 +8,6 @@ template using single-sender-value-type = see below; // exposition only ``` -* see below[italic] ## 概要 `single-sender-value-type`は、実行制御ライブラリの仕様定義で用いられる説明専用のエイリアステンプレートである。 diff --git a/reference/execution/execution/split.md b/reference/execution/execution/split.md index 29ac7e4ff5..cbbfd30130 100644 --- a/reference/execution/execution/split.md +++ b/reference/execution/execution/split.md @@ -66,7 +66,6 @@ namespace std::execution { ``` * impls-for[link impls-for.md] * default-impls[link impls-for.md] -* see below[italic] `impls-for::get-state`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 @@ -274,7 +273,6 @@ namespace std::execution { * inplace_stop_source[link /reference/stop_token/inplace_stop_source.md] * atomic[link /reference/atomic/atomic.md] * connect_result_t[link connect_result_t.md] -* see below[italic] - 説明用のパック`Sigs`を[`completion_signatures_of_t`](completion_signatures_of_t.md)``による[`completion_signatures`](completion_signatures.md)特殊化のテンプレートパラメータと定義する。説明用の型`Tag`とパック`Args`に対して、説明用のエイリアステンプレート`as-tuple`を[`decayed-tuple`](decayed-tuple.md)``と定義する。型`variant-type`は下記定義において重複削除した型となる。 diff --git a/reference/execution/execution/tag_of_t.md b/reference/execution/execution/tag_of_t.md index 56ae80990a..955a92bf65 100644 --- a/reference/execution/execution/tag_of_t.md +++ b/reference/execution/execution/tag_of_t.md @@ -11,7 +11,6 @@ namespace std::execution { } ``` * sender[link sender.md] -* see below[italic] ## 概要 [Sender型](sender.md)`Sndr`のSenderアルゴリズムタグ型を取得する。 diff --git a/reference/execution/execution/transform_completion_signatures.md b/reference/execution/execution/transform_completion_signatures.md index 23fd1d7ab2..6f590e348b 100644 --- a/reference/execution/execution/transform_completion_signatures.md +++ b/reference/execution/execution/transform_completion_signatures.md @@ -18,7 +18,6 @@ namespace std::execution { * valid-completion-signatures[link completion_signatures.md] * completion_signatures[link completion_signatures.md] * set_stopped_t()[link set_stopped.md] -* see below[italic] ## 概要 [完了シグネチャ集合](completion_signatures.md)から別の完了シグネチャ集合へ変換するエイリアステンプレート。 diff --git a/reference/execution/execution/transform_completion_signatures_of.md b/reference/execution/execution/transform_completion_signatures_of.md index 9894aa959c..74f43325d2 100644 --- a/reference/execution/execution/transform_completion_signatures_of.md +++ b/reference/execution/execution/transform_completion_signatures_of.md @@ -28,7 +28,6 @@ namespace std::execution { * sender_in[link sender_in.md] * transform_completion_signatures[link transform_completion_signatures.md] * completion_signatures_of_t[link completion_signatures_of_t.md] -* see below[italic] ## 概要 [Sender型](sender.md)`Sndr`が[環境](../queryable.md)`Env`において非同期操作を作成できるとき、Senderの[完了シグネチャ集合](get_completion_signatures.md)から別の完了シグネチャ集合へ変換するエイリアステンプレート。 diff --git a/reference/execution/execution/transform_sender.md b/reference/execution/execution/transform_sender.md index 11065a82e1..245b8e47e5 100644 --- a/reference/execution/execution/transform_sender.md +++ b/reference/execution/execution/transform_sender.md @@ -14,7 +14,6 @@ namespace std::execution { ``` * sender[link sender.md] * queryable[link ../queryable.md] -* see below[italic] ## 概要 [実行ドメイン](default_domain.md)に応じて[Sender](sender.md)を変換する。 diff --git a/reference/execution/execution/variant-or-empty.md b/reference/execution/execution/variant-or-empty.md index c8efdb028b..e77014c3fe 100644 --- a/reference/execution/execution/variant-or-empty.md +++ b/reference/execution/execution/variant-or-empty.md @@ -10,7 +10,6 @@ namespace std::execution { using variant-or-empty = see below; // exposition only } ``` -* see below[italic] ## 概要 `variant-or-empty`は、型パラメータパック`Ts`から[decay](/reference/type_traits/decay.md)結果を要素型とする[`variant`](/reference/variant/variant.md)型を作成する説明専用のエイリアステンプレートである。 diff --git a/reference/execution/execution/when_all.md b/reference/execution/execution/when_all.md index f2475dd1be..0992cf2e97 100644 --- a/reference/execution/execution/when_all.md +++ b/reference/execution/execution/when_all.md @@ -58,7 +58,6 @@ namespace std::execution { ``` * impls-for[link impls-for.md] * default-impls[link impls-for.md] -* see below[italic] `impls-for::get-attrs`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 @@ -83,7 +82,6 @@ namespace std::execution { return see below; } ``` -* see below[italic] ラムダ式は下記を満たすオブジェクト`e`を返す。 @@ -250,7 +248,6 @@ struct make-state { * stop_callback[link /reference/stop_token/stop_token.md] * optional[link /reference/optional/optional.md] * nullopt[link /reference/optional/nullopt_t.md] -* see below[italic] 説明用の型`copy-fail`を、いずれかの子[Sender](sender.md)の値結果データのdecayコピーが潜在的に例外送出するならば[`exception_ptr`](/reference/exception/exception_ptr.md)とする。そうでなければ、未規定の空のクラス型`none-such`とする。 diff --git a/reference/execution/execution/with_awaitable_senders.md b/reference/execution/execution/with_awaitable_senders.md index 527594c187..2f85891c45 100644 --- a/reference/execution/execution/with_awaitable_senders.md +++ b/reference/execution/execution/with_awaitable_senders.md @@ -37,7 +37,6 @@ namespace std::execution { * terminate()[link /reference/exception/terminate.md] * coroutine_handle[link /reference/coroutine/coroutine_handle.md] * address()[link /reference/coroutine/coroutine_handle/address.md] -* see below[italic] ## 概要 `with_awaitable_senders`は、[コルーチンPromise型](/lang/cpp20/coroutines.md)の基底クラスとして利用することで、[Sender](sender.md)を`co_await`演算子でAwait可能とするクラステンプレートである。 diff --git a/reference/execution/execution/write-env.md b/reference/execution/execution/write-env.md index 3bfda3d391..f53008768a 100644 --- a/reference/execution/execution/write-env.md +++ b/reference/execution/execution/write-env.md @@ -38,7 +38,6 @@ struct impls-for : default-impls { ``` * impls-for[link impls-for.md] * default-impls[link impls-for.md] -* see below[italic] `impls-for::get-env`メンバの呼び出しは下記を満たすオブジェクト`e`を返す。 diff --git a/reference/expected/expected.void/op_assign.md b/reference/expected/expected.void/op_assign.md index 8bcc57acde..87ee8509b4 100644 --- a/reference/expected/expected.void/op_assign.md +++ b/reference/expected/expected.void/op_assign.md @@ -17,7 +17,6 @@ constexpr expected& operator=(const unexpected& e); // (3) template constexpr expected& operator=(unexpected&& e); // (4) ``` -* see below[italic] * unexpected[link ../unexpected.md] ## 概要 diff --git a/reference/expected/expected.void/op_constructor.md b/reference/expected/expected.void/op_constructor.md index 69163677cc..a69fb11a30 100644 --- a/reference/expected/expected.void/op_constructor.md +++ b/reference/expected/expected.void/op_constructor.md @@ -28,7 +28,6 @@ constexpr explicit expected(unexpect_t, Args&&... args); // (9) template constexpr explicit expected(unexpect_t, initializer_list il, Args&&... args); // (10) ``` -* see below[italic] * unexpected[link ../unexpected.md] * unexpect_t[link ../unexpect_t.md] * initializer_list[link /reference/initializer_list/initializer_list.md] diff --git a/reference/expected/expected.void/swap.md b/reference/expected/expected.void/swap.md index f57e0618f3..129ed170a7 100644 --- a/reference/expected/expected.void/swap.md +++ b/reference/expected/expected.void/swap.md @@ -9,7 +9,6 @@ // expected部分特殊化 constexpr void swap(expected& rhs) noexcept(see below); ``` -* see below[italic] ## 概要 他の`expected`オブジェクトとデータを入れ替える。 diff --git a/reference/expected/expected/op_assign.md b/reference/expected/expected/op_assign.md index a05f7ec1f0..cd1fdf24c4 100644 --- a/reference/expected/expected/op_assign.md +++ b/reference/expected/expected/op_assign.md @@ -19,7 +19,6 @@ constexpr expected& operator=(const unexpected& e); // (4) template constexpr expected& operator=(unexpected&& e); // (5) ``` -* see below[italic] * unexpected[link ../unexpected.md] ## 概要 diff --git a/reference/expected/expected/op_constructor.md b/reference/expected/expected/op_constructor.md index 9bc92cb407..e6639f605c 100644 --- a/reference/expected/expected/op_constructor.md +++ b/reference/expected/expected/op_constructor.md @@ -33,7 +33,6 @@ constexpr explicit expected(unexpect_t, Args&&... args); // (11) template constexpr explicit expected(unexpect_t, initializer_list il, Args&&... args); // (12) ``` -* see below[italic] * unexpected[link ../unexpected.md] * unexpect_t[link ../unexpect_t.md] * initializer_list[link /reference/initializer_list/initializer_list.md] diff --git a/reference/expected/expected/swap.md b/reference/expected/expected/swap.md index 8c6f5c8f3c..6786915ba3 100644 --- a/reference/expected/expected/swap.md +++ b/reference/expected/expected/swap.md @@ -8,7 +8,6 @@ ```cpp constexpr void swap(expected& rhs) noexcept(see below); ``` -* see below[italic] ## 概要 他の`expected`オブジェクトとデータを入れ替える。 diff --git a/reference/format/format_kind.md b/reference/format/format_kind.md index 3e11e64718..da5b09fcf4 100644 --- a/reference/format/format_kind.md +++ b/reference/format/format_kind.md @@ -15,7 +15,6 @@ namespace std { } ``` * unspecified[italic] -* see below[italic] * range_format[link range_format.md] * ranges::input_range[link /reference/ranges/input_range.md] diff --git a/reference/functional/function_ref/op_deduction_guide.md b/reference/functional/function_ref/op_deduction_guide.md index 4ad2b4c144..b9a246b5d5 100644 --- a/reference/functional/function_ref/op_deduction_guide.md +++ b/reference/functional/function_ref/op_deduction_guide.md @@ -17,7 +17,6 @@ namespace std { } ``` * nontype_t[link /reference/utility/nontype_t.md] -* see below[italic] ## 概要 diff --git a/reference/functional/placeholders.md b/reference/functional/placeholders.md index 9f21450a91..a5086d3708 100644 --- a/reference/functional/placeholders.md +++ b/reference/functional/placeholders.md @@ -13,7 +13,6 @@ namespace placeholders { /*see below*/ unspecified _N; }} ``` -* see below[italic] * unspecified[italic] ## 概要 diff --git a/reference/functional/reference_wrapper/op_constructor.md b/reference/functional/reference_wrapper/op_constructor.md index 1ce16282d0..d76dd11e4a 100644 --- a/reference/functional/reference_wrapper/op_constructor.md +++ b/reference/functional/reference_wrapper/op_constructor.md @@ -16,7 +16,6 @@ reference_wrapper(const reference_wrapper& x) noexcept; // (2) C++11 constexpr reference_wrapper(const reference_wrapper& x) noexcept; // (2) C++20 ``` -* see below[italic] ## 概要 与えられた参照で、参照オブジェクトを構築する。 diff --git a/reference/iterator/common_iterator.md b/reference/iterator/common_iterator.md index f8788eb86e..1fe6eb383e 100644 --- a/reference/iterator/common_iterator.md +++ b/reference/iterator/common_iterator.md @@ -33,7 +33,6 @@ namespace std { }; } ``` -* see below[italic] * input_or_output_iterator[link /reference/iterator/input_or_output_iterator.md] * copyable[link /reference/concepts/copyable.md] * variant[link /reference/variant/variant.md] diff --git a/reference/iterator/common_iterator/op_arrow.md b/reference/iterator/common_iterator/op_arrow.md index 6e315bc108..7513a0d323 100644 --- a/reference/iterator/common_iterator/op_arrow.md +++ b/reference/iterator/common_iterator/op_arrow.md @@ -8,7 +8,6 @@ ```cpp decltype(auto) operator->() const requires /*see below*/; ``` -* see below[italic] ## 概要 イテレータを間接参照する。 diff --git a/reference/iterator/indirectly_readable.md b/reference/iterator/indirectly_readable.md index ba6e005a3f..352808bf63 100644 --- a/reference/iterator/indirectly_readable.md +++ b/reference/iterator/indirectly_readable.md @@ -10,7 +10,6 @@ namespace std { concept indirectly_readable = /*see below*/; } ``` -* see below[italic] ## 概要 diff --git a/reference/iterator/is_integer_like.md b/reference/iterator/is_integer_like.md index afaa39b97d..3c7930bd5a 100644 --- a/reference/iterator/is_integer_like.md +++ b/reference/iterator/is_integer_like.md @@ -13,7 +13,6 @@ namespace std { inline constexpr bool is-signed-integer-like = /*see below*/; } ``` -* see below[italic] ## 概要 diff --git a/reference/iterator/iter_difference_t.md b/reference/iterator/iter_difference_t.md index c9bddbc3ad..565b1ef679 100644 --- a/reference/iterator/iter_difference_t.md +++ b/reference/iterator/iter_difference_t.md @@ -10,7 +10,6 @@ namespace std { using iter_difference_t = /*see below*/; } ``` -* see below[italic] ## 概要 diff --git a/reference/iterator/iter_value_t.md b/reference/iterator/iter_value_t.md index 693ffb7a23..39105e353d 100644 --- a/reference/iterator/iter_value_t.md +++ b/reference/iterator/iter_value_t.md @@ -10,7 +10,6 @@ namespace std { using iter_value_t = /*see below*/; } ``` -* see below[italic] ## 概要 diff --git a/reference/iterator/iterator_traits.md b/reference/iterator/iterator_traits.md index 7dd15cde39..4251e4505b 100644 --- a/reference/iterator/iterator_traits.md +++ b/reference/iterator/iterator_traits.md @@ -100,7 +100,6 @@ namespace std { using reference = /*see below*/; using iterator_category = /*see below*/; ``` - * see below[italic] * indirectly_readable_traits[link /reference/iterator/indirectly_readable_traits.md] * incrementable_traits[link /reference/iterator/incrementable_traits.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] diff --git a/reference/iterator/reverse_iterator/iter_move.md b/reference/iterator/reverse_iterator/iter_move.md index ed9367c3d3..b5073b7c54 100644 --- a/reference/iterator/reverse_iterator/iter_move.md +++ b/reference/iterator/reverse_iterator/iter_move.md @@ -14,7 +14,6 @@ namespace std { }; } ``` -* see below[italic] * reverse_iterator[link /reference/iterator/reverse_iterator.md] ## 概要 diff --git a/reference/iterator/reverse_iterator/iter_swap.md b/reference/iterator/reverse_iterator/iter_swap.md index 4ff978e187..9c63ea99b7 100644 --- a/reference/iterator/reverse_iterator/iter_swap.md +++ b/reference/iterator/reverse_iterator/iter_swap.md @@ -16,7 +16,6 @@ namespace std { }; } ``` -* see below[italic] * reverse_iterator[link /reference/iterator/reverse_iterator.md] ## 概要 diff --git a/reference/mdspan/extents.md b/reference/mdspan/extents.md index 930c8075e9..cfc4695537 100644 --- a/reference/mdspan/extents.md +++ b/reference/mdspan/extents.md @@ -16,7 +16,6 @@ namespace std { using dims = see below; // C++26以降 } ``` -* see below[italic] ## 概要 `extents`は、多次元配列の次元数(rank)と各次元の要素数(extent)を表現する。 diff --git a/reference/mdspan/extents/op_constructor.md b/reference/mdspan/extents/op_constructor.md index e35d311147..a0af10732d 100644 --- a/reference/mdspan/extents/op_constructor.md +++ b/reference/mdspan/extents/op_constructor.md @@ -23,7 +23,6 @@ template constexpr explicit(N != rank_dynamic()) extents(const array& exts) noexcept; // (5) ``` -* see below[italic] * rank_dynamic()[link rank_dynamic.md] * span[link /reference/span/span.md] * array[link /reference/array/array.md] diff --git a/reference/mdspan/extents/op_deduction_guide.md b/reference/mdspan/extents/op_deduction_guide.md index e18cb81f3d..53ad5c7128 100644 --- a/reference/mdspan/extents/op_deduction_guide.md +++ b/reference/mdspan/extents/op_deduction_guide.md @@ -10,7 +10,6 @@ namespace std { explicit extents(Integrals...) -> see below; } ``` -* see below[italic] ## 概要 `std::extents`クラステンプレートの型推論補助。多次元配列の動的要素数リストから[`std::dextents`](../extents.md)``型を推論する。 diff --git a/reference/mdspan/is-layout-left-padded-mapping-of.md b/reference/mdspan/is-layout-left-padded-mapping-of.md index e3b3bca459..1bd50f81e5 100644 --- a/reference/mdspan/is-layout-left-padded-mapping-of.md +++ b/reference/mdspan/is-layout-left-padded-mapping-of.md @@ -7,7 +7,6 @@ template constexpr bool is-layout-left-padded-mapping-of = see below; // exposition only ``` -* see below[italic] ## 概要 diff --git a/reference/mdspan/is-layout-right-padded-mapping-of.md b/reference/mdspan/is-layout-right-padded-mapping-of.md index 587e8d5cfe..de8a0f38a0 100644 --- a/reference/mdspan/is-layout-right-padded-mapping-of.md +++ b/reference/mdspan/is-layout-right-padded-mapping-of.md @@ -7,7 +7,6 @@ template constexpr bool is-layout-right-padded-mapping-of = see below; // exposition only ``` -* see below[italic] ## 概要 diff --git a/reference/mdspan/layout_left/mapping/submdspan_mapping.md b/reference/mdspan/layout_left/mapping/submdspan_mapping.md index e831b2de2a..34f9e515fb 100644 --- a/reference/mdspan/layout_left/mapping/submdspan_mapping.md +++ b/reference/mdspan/layout_left/mapping/submdspan_mapping.md @@ -17,7 +17,6 @@ friend constexpr auto submdspan_mapping( return src.submdspan-mapping-impl(slices...); } ``` -* see below[italic] * submdspan-mapping-impl[italic] ## 概要 diff --git a/reference/mdspan/layout_left_padded/mapping/op_constructor.md b/reference/mdspan/layout_left_padded/mapping/op_constructor.md index dad0d9a788..2401ec3ea5 100644 --- a/reference/mdspan/layout_left_padded/mapping/op_constructor.md +++ b/reference/mdspan/layout_left_padded/mapping/op_constructor.md @@ -35,7 +35,6 @@ constexpr explicit(see below) * rank()[link ../../extents/rank.md] * layout_left::mapping[link ../../layout_left/mapping.md] * layout_stride::mapping[link ../../layout_stride/mapping.md] -* see below[italic] ## 概要 - (1) : デフォルトコンストラクタ diff --git a/reference/mdspan/layout_left_padded/mapping/submdspan_mapping.md b/reference/mdspan/layout_left_padded/mapping/submdspan_mapping.md index 6b6cdb3b08..af428d90d6 100644 --- a/reference/mdspan/layout_left_padded/mapping/submdspan_mapping.md +++ b/reference/mdspan/layout_left_padded/mapping/submdspan_mapping.md @@ -17,7 +17,6 @@ friend constexpr auto submdspan_mapping( return src.submdspan-mapping-impl(slices...); } ``` -* see below[italic] * submdspan-mapping-impl[italic] ## 概要 diff --git a/reference/mdspan/layout_right/mapping/submdspan_mapping.md b/reference/mdspan/layout_right/mapping/submdspan_mapping.md index 627f6a57e2..74e8e945d3 100644 --- a/reference/mdspan/layout_right/mapping/submdspan_mapping.md +++ b/reference/mdspan/layout_right/mapping/submdspan_mapping.md @@ -17,7 +17,6 @@ friend constexpr auto submdspan_mapping( return src.submdspan-mapping-impl(slices...); } ``` -* see below[italic] * submdspan-mapping-impl[italic] ## 概要 diff --git a/reference/mdspan/layout_right_padded/mapping/op_constructor.md b/reference/mdspan/layout_right_padded/mapping/op_constructor.md index cebd642716..23616e698d 100644 --- a/reference/mdspan/layout_right_padded/mapping/op_constructor.md +++ b/reference/mdspan/layout_right_padded/mapping/op_constructor.md @@ -34,7 +34,6 @@ constexpr explicit(see below) * is_convertible_v[link /reference/type_traits/is_convertible.md] * layout_right::mapping[link ../../layout_right/mapping.md] * layout_stride::mapping[link ../../layout_stride/mapping.md] -* see below[italic] ## 概要 - (1) : デフォルトコンストラクタ diff --git a/reference/mdspan/layout_right_padded/mapping/submdspan_mapping.md b/reference/mdspan/layout_right_padded/mapping/submdspan_mapping.md index afb947788d..805c87c102 100644 --- a/reference/mdspan/layout_right_padded/mapping/submdspan_mapping.md +++ b/reference/mdspan/layout_right_padded/mapping/submdspan_mapping.md @@ -17,7 +17,6 @@ friend constexpr auto submdspan_mapping( return src.submdspan-mapping-impl(slices...); } ``` -* see below[italic] * submdspan-mapping-impl[italic] ## 概要 diff --git a/reference/mdspan/layout_stride/mapping/op_constructor.md b/reference/mdspan/layout_stride/mapping/op_constructor.md index df6009e6eb..4ba297161a 100644 --- a/reference/mdspan/layout_stride/mapping/op_constructor.md +++ b/reference/mdspan/layout_stride/mapping/op_constructor.md @@ -22,7 +22,6 @@ template * span[link /reference/span/span.md] * array[link /reference/array/array.md] * rank_[italic] -* see below[italic] ## 概要 - (1) : デフォルトコンストラクタ diff --git a/reference/mdspan/layout_stride/mapping/submdspan_mapping.md b/reference/mdspan/layout_stride/mapping/submdspan_mapping.md index de042c4ed0..d2a065238a 100644 --- a/reference/mdspan/layout_stride/mapping/submdspan_mapping.md +++ b/reference/mdspan/layout_stride/mapping/submdspan_mapping.md @@ -17,7 +17,6 @@ friend constexpr auto submdspan_mapping( return src.submdspan-mapping-impl(slices...); } ``` -* see below[italic] * submdspan-mapping-impl[italic] ## 概要 diff --git a/reference/mdspan/mdspan/op_constructor.md b/reference/mdspan/mdspan/op_constructor.md index 9c7913f8d6..ef7005bab3 100644 --- a/reference/mdspan/mdspan/op_constructor.md +++ b/reference/mdspan/mdspan/op_constructor.md @@ -45,7 +45,6 @@ template&& rhs); // (6) C++17 template constexpr optional& operator=(optional&& rhs); // (6) C++23 ``` -* see below[italic] * nullopt_t[link /reference/optional/nullopt_t.md] ## 概要 diff --git a/reference/optional/optional/op_constructor.md b/reference/optional/optional/op_constructor.md index e867897a05..3b5095f05c 100644 --- a/reference/optional/optional/op_constructor.md +++ b/reference/optional/optional/op_constructor.md @@ -39,7 +39,6 @@ explicit(see below) optional(optional&& rhs); // (9) C++20 template explicit(see below) constexpr optional(optional&& rhs); // (9) C++23 ``` -* see below[italic] * EXPLICIT[italic] * nullopt_t[link /reference/optional/nullopt_t.md] * initializer_list[link /reference/initializer_list/initializer_list.md] diff --git a/reference/optional/optional/swap.md b/reference/optional/optional/swap.md index 9f06cdc875..aff8a66415 100644 --- a/reference/optional/optional/swap.md +++ b/reference/optional/optional/swap.md @@ -9,7 +9,6 @@ void swap(optional& rhs) noexcept(see below); // C++17 constexpr void swap(optional& rhs) noexcept(see below); // C++23 ``` -* see below[italic] ## 概要 他の`optional`オブジェクトとデータを入れ替える。 diff --git a/reference/ranges/enable_view.md b/reference/ranges/enable_view.md index 888d827a62..d254f0ce83 100644 --- a/reference/ranges/enable_view.md +++ b/reference/ranges/enable_view.md @@ -29,7 +29,6 @@ namespace std::ranges { inline constexpr bool is-derived-from-view-interface = see below; // 説明専用 } ``` -* see below[italic] `is-derived-from-view-interface`は、`T`がある型`U`についてただ一つだけ`view_interface`を`public`な基底クラスに持ち、他の型`V`についての`view_interface`を基底クラスに持たない場合に`true`となる。 diff --git a/reference/span/span/subspan.md b/reference/span/span/subspan.md index 24af924a9c..3520ed591a 100644 --- a/reference/span/span/subspan.md +++ b/reference/span/span/subspan.md @@ -13,7 +13,6 @@ constexpr span constexpr span subspan(size_type offset, size_type count = dynamic_extent) const; // (2) ``` -* see below[italic] * dynamic_extent[link /reference/span/dynamic_extent.md] ## 概要 diff --git a/reference/string/basic_string/op_compare_3way.md b/reference/string/basic_string/op_compare_3way.md index 7613848d9e..bd547c956f 100644 --- a/reference/string/basic_string/op_compare_3way.md +++ b/reference/string/basic_string/op_compare_3way.md @@ -17,7 +17,6 @@ namespace std { const charT* rhs); // (2) C++20 } ``` -* see below[italic] ## 概要 `basic_string`オブジェクトの三方比較を行う。 diff --git a/reference/string/basic_string/op_deduction_guide.md b/reference/string/basic_string/op_deduction_guide.md index c41e6de04a..138cf80c95 100644 --- a/reference/string/basic_string/op_deduction_guide.md +++ b/reference/string/basic_string/op_deduction_guide.md @@ -36,7 +36,6 @@ namespace std { Allocator>; // (4) C++23 } ``` -* see below[italic] * allocator[link /reference/memory/allocator.md] * char_traits[link /reference/string/char_traits.md] * ranges::input_range[link /reference/ranges/input_range.md] diff --git a/reference/string_view/basic_string_view/op_compare_3way.md b/reference/string_view/basic_string_view/op_compare_3way.md index e22fe1cd5d..edd20d5254 100644 --- a/reference/string_view/basic_string_view/op_compare_3way.md +++ b/reference/string_view/basic_string_view/op_compare_3way.md @@ -12,7 +12,6 @@ namespace std { basic_string_view y) noexcept; // (1) C++20 } ``` -* see below[italic] ## 概要 `basic_string_view`オブジェクトの三方比較を行う。 diff --git a/reference/tuple/apply.md b/reference/tuple/apply.md index 5989af552a..c25e600dd4 100644 --- a/reference/tuple/apply.md +++ b/reference/tuple/apply.md @@ -17,7 +17,6 @@ namespace std { ``` * tuple-like[link tuple-like.md] * tuple-like[link tuple-like.md] -* see below[italic] ## 概要 タプルを展開し、関数の引数に適用してその関数を実行する。 diff --git a/reference/tuple/tuple/op_assign.md b/reference/tuple/tuple/op_assign.md index 4ee7c8ac2a..606593b6ab 100644 --- a/reference/tuple/tuple/op_assign.md +++ b/reference/tuple/tuple/op_assign.md @@ -56,7 +56,6 @@ constexpr tuple& operator=(UTuple&&); // (13) C++23 template constexpr const tuple& operator=(UTuple&&) const; // (14) C++23 ``` -* see below[italic] * tuple-like[link ../tuple-like.md] ## 概要 diff --git a/reference/tuple/tuple/op_constructor.md b/reference/tuple/tuple/op_constructor.md index e472358584..c7d02f1340 100644 --- a/reference/tuple/tuple/op_constructor.md +++ b/reference/tuple/tuple/op_constructor.md @@ -217,11 +217,9 @@ template explicit(see below) constexpr tuple(allocator_arg_t, const Alloc& a, UTuple&&); // (28) C++23 ``` -* see below[italic] * EXPLICIT[italic] * allocator_arg_t[link /reference/memory/allocator_arg_t.md] * tuple-like[link ../tuple-like.md] -* see below[italic] ## tupleオブジェクトの構築 - (1) : デフォルトコンストラクタ(すべての要素を初期化して構築) diff --git a/reference/tuple/tuple/swap.md b/reference/tuple/tuple/swap.md index 8692742cfd..304750f7c6 100644 --- a/reference/tuple/tuple/swap.md +++ b/reference/tuple/tuple/swap.md @@ -12,7 +12,6 @@ constexpr void swap(tuple& rhs) noexcept(see below); // (1) C++20 constexpr void swap(const tuple& rhs) const noexcept(see below); // (2) C++23 ``` -* see below[italic] ## 概要 - (1) : 他の[`tuple`](../tuple.md)オブジェクトと中身を入れ替える。 diff --git a/reference/unordered_map/unordered_map/op_deduction_guide.md b/reference/unordered_map/unordered_map/op_deduction_guide.md index 30210f0aa4..43d6a094d6 100644 --- a/reference/unordered_map/unordered_map/op_deduction_guide.md +++ b/reference/unordered_map/unordered_map/op_deduction_guide.md @@ -103,7 +103,6 @@ namespace std { equal_to>, Allocator>; // (12) C++23から } ``` -* see below[italic] * remove_const_t[link /reference/type_traits/remove_const.md] * add_const_t[link /reference/type_traits/add_const.md] * hash[link /reference/functional/hash.md] diff --git a/reference/unordered_map/unordered_multimap/op_deduction_guide.md b/reference/unordered_map/unordered_multimap/op_deduction_guide.md index 24e41595d0..fe6b8f36a0 100644 --- a/reference/unordered_map/unordered_multimap/op_deduction_guide.md +++ b/reference/unordered_map/unordered_multimap/op_deduction_guide.md @@ -103,7 +103,6 @@ namespace std { equal_to>, Allocator>; // (12) C++23から } ``` -* see below[italic] * remove_const_t[link /reference/type_traits/remove_const.md] * add_const_t[link /reference/type_traits/add_const.md] * hash[link /reference/functional/hash.md] diff --git a/reference/unordered_set/unordered_multiset/op_deduction_guide.md b/reference/unordered_set/unordered_multiset/op_deduction_guide.md index adae43ec34..1ac09c7dfa 100644 --- a/reference/unordered_set/unordered_multiset/op_deduction_guide.md +++ b/reference/unordered_set/unordered_multiset/op_deduction_guide.md @@ -71,7 +71,6 @@ namespace std { equal_to>, Allocator>; // (10) C++23から } ``` -* see below[italic] * hash[link /reference/functional/hash.md] * equal_to[link /reference/functional/equal_to.md] * allocator[link /reference/memory/allocator.md] diff --git a/reference/unordered_set/unordered_set/op_deduction_guide.md b/reference/unordered_set/unordered_set/op_deduction_guide.md index 66d040423b..41a189c92b 100644 --- a/reference/unordered_set/unordered_set/op_deduction_guide.md +++ b/reference/unordered_set/unordered_set/op_deduction_guide.md @@ -67,7 +67,6 @@ namespace std { equal_to>, Allocator>; // (10) C++23から } ``` -* see below[italic] * hash[link /reference/functional/hash.md] * equal_to[link /reference/functional/equal_to.md] * allocator[link /reference/memory/allocator.md] diff --git a/reference/utility/exchange.md b/reference/utility/exchange.md index ea4a1a3a17..155640aa85 100644 --- a/reference/utility/exchange.md +++ b/reference/utility/exchange.md @@ -17,7 +17,6 @@ namespace std { noexcept(see below); // (1) C++23 } ``` -* see below[italic] ## 概要 値を書き換え、書き換え前の値を返す。 diff --git a/reference/utility/pair/op_assign.md b/reference/utility/pair/op_assign.md index abd960fab0..170209e716 100644 --- a/reference/utility/pair/op_assign.md +++ b/reference/utility/pair/op_assign.md @@ -36,7 +36,6 @@ template template constexpr const pair& operator=(P&& p) const; // (10) C++23 ``` -* see below[italic] * pair-like[link /reference/tuple/pair-like.md] ## 概要 diff --git a/reference/utility/pair/op_constructor.md b/reference/utility/pair/op_constructor.md index 88137dc1b6..84f94e1882 100644 --- a/reference/utility/pair/op_constructor.md +++ b/reference/utility/pair/op_constructor.md @@ -67,7 +67,6 @@ constexpr pair(piecewise_construct_t, ``` * EXPLICIT[italic] * pair-like[link /reference/tuple/tuple-like.md] -* see below[italic] ## 概要 [`pair`](../pair.md)オブジェクトを構築する。 diff --git a/reference/utility/pair/swap.md b/reference/utility/pair/swap.md index 403b9a8ae4..a55d139750 100644 --- a/reference/utility/pair/swap.md +++ b/reference/utility/pair/swap.md @@ -9,7 +9,6 @@ void swap(pair& p) noexcept(see below); // (1) C++11 constexpr void swap(pair& p) noexcept(see below); // (1) C++20 ``` -* see below[italic] ## 概要 他の`pair`オブジェクトと値を入れ替える diff --git a/reference/utility/swap.md b/reference/utility/swap.md index df1b79acad..222f6202b4 100644 --- a/reference/utility/swap.md +++ b/reference/utility/swap.md @@ -24,7 +24,6 @@ namespace std { noexcept(noexcept(swap(*a, *b))); // (2) C++20 } ``` -* see below[italic] ## 概要 2つの値を入れ替える。 diff --git a/reference/variant/variant/op_assign.md b/reference/variant/variant/op_assign.md index 9c7962ed58..2345dfbbbb 100644 --- a/reference/variant/variant/op_assign.md +++ b/reference/variant/variant/op_assign.md @@ -14,7 +14,6 @@ variant& operator=(T&& rhs) noexcept(see below); // (3) C++17 template constexpr variant& operator=(T&& rhs) noexcept(see below); // (3) C++23 ``` -* see below[italic] ## 概要 `variant`オブジェクトもしくは候補型の値を代入する。 diff --git a/reference/variant/variant/op_constructor.md b/reference/variant/variant/op_constructor.md index 7b50d0ec46..8e71d4ad38 100644 --- a/reference/variant/variant/op_constructor.md +++ b/reference/variant/variant/op_constructor.md @@ -31,7 +31,6 @@ constexpr explicit variant(in_place_index_t, initializer_list il, Args&&... args); // (8) ``` -* see below[italic] * size_t[link /reference/cstddef/size_t.md] * initializer_list[link /reference/initializer_list/initializer_list.md] * in_place_type_t[link /reference/utility/in_place_type_t.md] diff --git a/reference/variant/variant/swap.md b/reference/variant/variant/swap.md index e5d3e8a90e..6583c41e8e 100644 --- a/reference/variant/variant/swap.md +++ b/reference/variant/variant/swap.md @@ -9,7 +9,6 @@ void swap(variant& rhs) noexcept(see below); // C++17 constexpr void swap(variant& rhs) noexcept(see below); // C++23 ``` -* see below[italic] ## 概要 他の`variant`オブジェクトとデータを入れ替える。 diff --git a/reference/variant/variant/swap_free.md b/reference/variant/variant/swap_free.md index f92262dbf5..e7eaca9bf6 100644 --- a/reference/variant/variant/swap_free.md +++ b/reference/variant/variant/swap_free.md @@ -12,7 +12,6 @@ namespace std { constexpr void swap(variant& x, variant& y) noexcept(see below); // C++23 } ``` -* see below[italic] ## 概要 同じ候補型をもつ2つの`variant`オブジェクトを入れ替える。 diff --git a/reference/variant/visit.md b/reference/variant/visit.md index 6599712d54..b805e90116 100644 --- a/reference/variant/visit.md +++ b/reference/variant/visit.md @@ -13,7 +13,6 @@ namespace std { constexpr R visit(Visitor&& vis, Variants&&... vars); // (2) C++20 } ``` -* see below[italic] ## 概要 `variant`オブジェクトが現在保持している型に対応する関数を呼び出す。 From f1add1cb6cc0fbda6dd8e357f671626443217997 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Sun, 13 Jul 2025 13:07:37 +0900 Subject: [PATCH 2231/3948] =?UTF-8?q?fix:=201d0cf2b=20=E3=81=AB=E3=82=88?= =?UTF-8?q?=E3=82=8B=E3=83=97=E3=83=AA=E3=83=97=E3=83=AD=E3=82=BB=E3=83=83?= =?UTF-8?q?=E3=82=B5=E3=83=87=E3=82=A3=E3=83=AC=E3=82=AF=E3=83=86=E3=82=A3?= =?UTF-8?q?=E3=83=96=E8=AA=A4=E7=88=86=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 貢献ポイント備考: これは機械的な置換の後に目視確認で該当するものだけ拾っ たものです。 https://github.com/cpprefjp/site/pull/1470#discussion_r2203135571 --- lang/cpp11/pragma_operator.md | 2 +- lang/cpp11/variadic_macros.md | 8 ++++---- reference/algorithm/equal.md | 4 ++-- reference/algorithm/fill_n.md | 10 +++++----- reference/algorithm/generate_n.md | 10 +++++----- reference/algorithm/is_permutation.md | 4 ++-- reference/atomic/atomic_flag_init.md | 2 +- reference/atomic/atomic_var_init.md | 4 ++-- reference/atomic/lock_free_property.md | 22 +++++++++++----------- reference/cassert/assert.md | 6 +++--- reference/cfenv/fe_all_except.md | 2 +- reference/cfenv/fe_divbyzero.md | 2 +- reference/cfenv/fe_downward.md | 2 +- reference/cfenv/fe_inexact.md | 2 +- reference/cfenv/fe_invalid.md | 2 +- reference/cfenv/fe_overflow.md | 2 +- reference/cfenv/fe_tonearest.md | 2 +- reference/cfenv/fe_towardzero.md | 2 +- reference/cfenv/fe_underflow.md | 2 +- reference/cfenv/fe_upward.md | 2 +- reference/cfloat/dbl_decimal_dig.md | 2 +- reference/cfloat/dbl_dig.md | 2 +- reference/cfloat/dbl_epsilon.md | 2 +- reference/cfloat/dbl_has_subnorm.md | 2 +- reference/cfloat/dbl_mant_dig.md | 2 +- reference/cfloat/dbl_max.md | 2 +- reference/cfloat/dbl_max_10_exp.md | 2 +- reference/cfloat/dbl_max_exp.md | 2 +- reference/cfloat/dbl_min.md | 2 +- reference/cfloat/dbl_min_10_exp.md | 2 +- reference/cfloat/dbl_min_exp.md | 2 +- reference/cfloat/dbl_true_min.md | 2 +- reference/cfloat/decimal_dig.md | 2 +- reference/cfloat/flt_decimal_dig.md | 2 +- reference/cfloat/flt_dig.md | 2 +- reference/cfloat/flt_epsilon.md | 2 +- reference/cfloat/flt_eval_method.md | 2 +- reference/cfloat/flt_has_subnorm.md | 2 +- reference/cfloat/flt_mant_dig.md | 2 +- reference/cfloat/flt_max.md | 2 +- reference/cfloat/flt_max_10_exp.md | 2 +- reference/cfloat/flt_max_exp.md | 2 +- reference/cfloat/flt_min.md | 2 +- reference/cfloat/flt_min_10_exp.md | 2 +- reference/cfloat/flt_min_exp.md | 2 +- reference/cfloat/flt_radix.md | 2 +- reference/cfloat/flt_rounds.md | 2 +- reference/cfloat/flt_true_min.md | 2 +- reference/cfloat/ldbl_decimal_dig.md | 2 +- reference/cfloat/ldbl_dig.md | 2 +- reference/cfloat/ldbl_epsilon.md | 2 +- reference/cfloat/ldbl_has_subnorm.md | 2 +- reference/cfloat/ldbl_mant_dig.md | 2 +- reference/cfloat/ldbl_max.md | 2 +- reference/cfloat/ldbl_max_10_exp.md | 2 +- reference/cfloat/ldbl_max_exp.md | 2 +- reference/cfloat/ldbl_min.md | 2 +- reference/cfloat/ldbl_min_10_exp.md | 2 +- reference/cfloat/ldbl_min_exp.md | 2 +- reference/cfloat/ldbl_true_min.md | 2 +- reference/chrono/duration.md | 6 +++--- reference/climits/char_bit.md | 2 +- reference/climits/char_max.md | 2 +- reference/climits/char_min.md | 2 +- reference/climits/int_max.md | 2 +- reference/climits/int_min.md | 2 +- reference/climits/llong_max.md | 2 +- reference/climits/llong_min.md | 2 +- reference/climits/long_max.md | 2 +- reference/climits/long_min.md | 2 +- reference/climits/mb_len_max.md | 2 +- reference/climits/schar_max.md | 2 +- reference/climits/schar_min.md | 2 +- reference/climits/shrt_max.md | 2 +- reference/climits/shrt_min.md | 2 +- reference/climits/uchar_max.md | 2 +- reference/climits/uint_max.md | 2 +- reference/climits/ullong_max.md | 2 +- reference/climits/ulong_max.md | 2 +- reference/climits/ushrt_max.md | 2 +- reference/cmath/fp_fast_fma.md | 2 +- reference/cmath/fp_fast_fmaf.md | 2 +- reference/cmath/fp_fast_fmal.md | 2 +- reference/cmath/fp_ilogb0.md | 2 +- reference/cmath/fp_ilogbnan.md | 2 +- reference/cmath/fp_infinite.md | 2 +- reference/cmath/fp_nan.md | 2 +- reference/cmath/fp_normal.md | 2 +- reference/cmath/fp_subnormal.md | 2 +- reference/cmath/fp_zero.md | 2 +- reference/cmath/huge_val.md | 2 +- reference/cmath/huge_valf.md | 2 +- reference/cmath/huge_vall.md | 2 +- reference/cmath/infinity.md | 2 +- reference/cmath/llrint.md | 18 +++++++++--------- reference/cmath/lrint.md | 18 +++++++++--------- reference/cmath/math_errexcept.md | 2 +- reference/cmath/math_errhandling.md | 2 +- reference/cmath/math_errno.md | 2 +- reference/cmath/modf.md | 8 ++++---- reference/cmath/nan.md | 2 +- reference/cmath/nearbyint.md | 18 +++++++++--------- reference/cmath/rint.md | 18 +++++++++--------- reference/cstddef/null.md | 2 +- reference/cstddef/offsetof.md | 2 +- reference/cstdint/int16_max.md | 2 +- reference/cstdint/int16_min.md | 2 +- reference/cstdint/int32_max.md | 2 +- reference/cstdint/int32_min.md | 2 +- reference/cstdint/int64_max.md | 2 +- reference/cstdint/int64_min.md | 2 +- reference/cstdint/int8_max.md | 2 +- reference/cstdint/int8_min.md | 2 +- reference/cstdint/int_fast16_max.md | 2 +- reference/cstdint/int_fast16_min.md | 2 +- reference/cstdint/int_fast32_max.md | 2 +- reference/cstdint/int_fast32_min.md | 2 +- reference/cstdint/int_fast64_max.md | 2 +- reference/cstdint/int_fast64_min.md | 2 +- reference/cstdint/int_fast8_max.md | 2 +- reference/cstdint/int_fast8_min.md | 2 +- reference/cstdint/int_least16_max.md | 2 +- reference/cstdint/int_least16_min.md | 2 +- reference/cstdint/int_least32_max.md | 2 +- reference/cstdint/int_least32_min.md | 2 +- reference/cstdint/int_least64_max.md | 2 +- reference/cstdint/int_least64_min.md | 2 +- reference/cstdint/int_least8_max.md | 2 +- reference/cstdint/int_least8_min.md | 2 +- reference/cstdint/intmax_max.md | 2 +- reference/cstdint/intmax_min.md | 2 +- reference/cstdint/intptr_max.md | 2 +- reference/cstdint/intptr_min.md | 2 +- reference/cstdint/ptrdiff_max.md | 2 +- reference/cstdint/ptrdiff_min.md | 2 +- reference/cstdint/sig_atomic_max.md | 2 +- reference/cstdint/sig_atomic_min.md | 2 +- reference/cstdint/size_max.md | 2 +- reference/cstdint/uint16_max.md | 2 +- reference/cstdint/uint32_max.md | 2 +- reference/cstdint/uint64_max.md | 2 +- reference/cstdint/uint8_max.md | 2 +- reference/cstdint/uint_fast16_max.md | 2 +- reference/cstdint/uint_fast32_max.md | 2 +- reference/cstdint/uint_fast64_max.md | 2 +- reference/cstdint/uint_fast8_max.md | 2 +- reference/cstdint/uint_least16_max.md | 2 +- reference/cstdint/uint_least32_max.md | 2 +- reference/cstdint/uint_least64_max.md | 2 +- reference/cstdint/uint_least8_max.md | 2 +- reference/cstdint/uintmax_max.md | 2 +- reference/cstdint/uintptr_max.md | 2 +- reference/cstdint/wchar_max.md | 2 +- reference/cstdint/wchar_min.md | 2 +- reference/cstdint/wint_max.md | 2 +- reference/cstdint/wint_min.md | 2 +- reference/cstdlib/exit_failure.md | 2 +- reference/cstdlib/exit_success.md | 2 +- reference/regex/basic_regex/flags.md | 2 +- 159 files changed, 222 insertions(+), 222 deletions(-) diff --git a/lang/cpp11/pragma_operator.md b/lang/cpp11/pragma_operator.md index 0606ffbab2..7294805cc0 100644 --- a/lang/cpp11/pragma_operator.md +++ b/lang/cpp11/pragma_operator.md @@ -39,7 +39,7 @@ _Pragma (文字列リテラル) #include // OpenMPの言語拡張を使用して、for文を並列実行する -# define OMP_PARALLEL_FOR _Pragma("omp parallel for") +#define OMP_PARALLEL_FOR _Pragma("omp parallel for") // 以下のように、Pragmaディレクティブでは書けない //#define OMP_PARALLEL_FOR #pragma omp parallel for diff --git a/lang/cpp11/variadic_macros.md b/lang/cpp11/variadic_macros.md index 4f422ee64d..6e8c084119 100644 --- a/lang/cpp11/variadic_macros.md +++ b/lang/cpp11/variadic_macros.md @@ -21,8 +21,8 @@ C99互換として、可変引数マクロ(variadic macros)が導入された。 可変引数マクロは、以下の構文を持つ: ``` -# define identifier ( ... ) replacement-list new-line -# define identifier ( identifier-list , ... ) replacement-list new-line +#define identifier ( ... ) replacement-list new-line +#define identifier ( identifier-list , ... ) replacement-list new-line ``` 1行目は、パラメータ全てを可変個受け取る場合。2行目は、先頭のいくつかのパラメータを名前付きで受け取り、それ以外に可変個のパラメータを受け取る場合。 @@ -43,11 +43,11 @@ C99互換として、可変引数マクロ(variadic macros)が導入された。 // 可変個のパラメータを受け取り、std::printf()関数の引数として転送する // 第1パラメータは必須。 // 第1パラメータのうしろにカンマがあるので、第2パラメータも必須。 -# define DEBUG_LOG(fmt, ...) std::printf(fmt, __VA_ARGS__) +#define DEBUG_LOG(fmt, ...) std::printf(fmt, __VA_ARGS__) // 受け取ったパラメータを展開する // 0個以上の、任意の個数のパラメータを受け取れる -# define FORWARD_ARGS(...) __VA_ARGS__ +#define FORWARD_ARGS(...) __VA_ARGS__ void f1(int a, int b, int c) { diff --git a/reference/algorithm/equal.md b/reference/algorithm/equal.md index 42aada54af..9723fa3137 100644 --- a/reference/algorithm/equal.md +++ b/reference/algorithm/equal.md @@ -166,7 +166,7 @@ bool equal(InputIterator1 first1, InputIterator1 last1, return true; } -# if __cplusplus >= 201402L +#if __cplusplus >= 201402L template inline bool equal_impl(RandomAccessIterator1 first1, RandomAccessIterator1 last1, @@ -202,7 +202,7 @@ inline bool equal(InputIterator1 first1, InputIterator1 last1, return std::equal(first1, last1, first2, last2, equal_to<>()); } -# endif +#endif ``` * equal_to[link ../functional/equal_to.md] diff --git a/reference/algorithm/fill_n.md b/reference/algorithm/fill_n.md index d79e725d8c..5eb8a5bd5b 100644 --- a/reference/algorithm/fill_n.md +++ b/reference/algorithm/fill_n.md @@ -146,17 +146,17 @@ int main() { ## 実装例 ```cpp template -# if __cplusplus >= 201103L +#if __cplusplus >= 201103L OutputIterator -# else +#else void -# endif +#endif fill_n(OutputIterator first, Size n, const T& value) { while (n-- > 0) *first++ = value; -# if __cplusplus >= 201103L +#if __cplusplus >= 201103L return first; -# endif +#endif } ``` diff --git a/reference/algorithm/generate_n.md b/reference/algorithm/generate_n.md index a858e03a9d..b911b527dd 100644 --- a/reference/algorithm/generate_n.md +++ b/reference/algorithm/generate_n.md @@ -85,17 +85,17 @@ int main() { ## 実装例 ```cpp template -# if __cplusplus >= 201103L +#if __cplusplus >= 201103L OutputIterator -# else +#else void -# endif +#endif generate_n(OutputIterator first, Size n, Generator gen) { while (n-- > 0) *first++ = gen(); -# if __cplusplus >= 201103L +#if __cplusplus >= 201103L return first; -# endif +#endif } ``` diff --git a/reference/algorithm/is_permutation.md b/reference/algorithm/is_permutation.md index 09edf068c5..62f24efd4c 100644 --- a/reference/algorithm/is_permutation.md +++ b/reference/algorithm/is_permutation.md @@ -144,7 +144,7 @@ bool is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, return true; } -# if __cplusplus >= 201402L +#if __cplusplus >= 201402L template bool is_permutation_impl(RandomAccessIterator1 first1, RandomAccessIterator1 last1, @@ -198,7 +198,7 @@ bool is_permutation(ForwardIterator1 first1, ForwardIterator1 last1, typename std::iterator_traits::iterator_category()); } -# endif +#endif ``` * std::mismatch[link mismatch.md] * std::count[link count.md] diff --git a/reference/atomic/atomic_flag_init.md b/reference/atomic/atomic_flag_init.md index bced794a22..9424266015 100644 --- a/reference/atomic/atomic_flag_init.md +++ b/reference/atomic/atomic_flag_init.md @@ -5,7 +5,7 @@ * cpp20deprecated[meta cpp] ```cpp -# define ATOMIC_FLAG_INIT see below +#define ATOMIC_FLAG_INIT see below ``` * see below[italic] diff --git a/reference/atomic/atomic_var_init.md b/reference/atomic/atomic_var_init.md index 490b1131f8..6ae92a43b2 100644 --- a/reference/atomic/atomic_var_init.md +++ b/reference/atomic/atomic_var_init.md @@ -5,7 +5,7 @@ * cpp20deprecated[meta cpp] ```cpp -# define ATOMIC_VAR_INIT(value) see below +#define ATOMIC_VAR_INIT(value) see below ``` * see below[italic] @@ -63,7 +63,7 @@ int main() ## 実装例 ```cpp -# define ATOMIC_VAR_INIT(value) { value } +#define ATOMIC_VAR_INIT(value) { value } ``` ## 参照 diff --git a/reference/atomic/lock_free_property.md b/reference/atomic/lock_free_property.md index 66b2af7a31..5157732004 100644 --- a/reference/atomic/lock_free_property.md +++ b/reference/atomic/lock_free_property.md @@ -4,17 +4,17 @@ * cpp11[meta cpp] ```cpp -# define ATOMIC_BOOL_LOCK_FREE unspecified // (1) -# define ATOMIC_CHAR_LOCK_FREE unspecified // (2) -# define ATOMIC_CHAR8_T_LOCK_FREE unspecified // (3) C++20から -# define ATOMIC_CHAR16_T_LOCK_FREE unspecified // (4) -# define ATOMIC_CHAR32_T_LOCK_FREE unspecified // (5) -# define ATOMIC_WCHAR_T_LOCK_FREE unspecified // (6) -# define ATOMIC_SHORT_LOCK_FREE unspecified // (7) -# define ATOMIC_INT_LOCK_FREE unspecified // (8) -# define ATOMIC_LONG_LOCK_FREE unspecified // (9) -# define ATOMIC_LLONG_LOCK_FREE unspecified // (10) -# define ATOMIC_POINTER_LOCK_FREE unspecified // (11) +#define ATOMIC_BOOL_LOCK_FREE unspecified // (1) +#define ATOMIC_CHAR_LOCK_FREE unspecified // (2) +#define ATOMIC_CHAR8_T_LOCK_FREE unspecified // (3) C++20から +#define ATOMIC_CHAR16_T_LOCK_FREE unspecified // (4) +#define ATOMIC_CHAR32_T_LOCK_FREE unspecified // (5) +#define ATOMIC_WCHAR_T_LOCK_FREE unspecified // (6) +#define ATOMIC_SHORT_LOCK_FREE unspecified // (7) +#define ATOMIC_INT_LOCK_FREE unspecified // (8) +#define ATOMIC_LONG_LOCK_FREE unspecified // (9) +#define ATOMIC_LLONG_LOCK_FREE unspecified // (10) +#define ATOMIC_POINTER_LOCK_FREE unspecified // (11) ``` * unspecified[italic] diff --git a/reference/cassert/assert.md b/reference/cassert/assert.md index d10ca3ce0e..0971cf000a 100644 --- a/reference/cassert/assert.md +++ b/reference/cassert/assert.md @@ -3,13 +3,13 @@ * macro[meta id-type] ```cpp -# if !defined(NDEBUG) +#if !defined(NDEBUG) #define assert(expr) implementation-defined // (1) C++03 #define assert(...) implementation-defined // (1) C++26 -# else +#else #define assert(ignore) ((void)0) // (2) C++03 #define assert(...) ((void)0) // (2) C++26 -# endif +#endif ``` ## 概要 diff --git a/reference/cfenv/fe_all_except.md b/reference/cfenv/fe_all_except.md index 39b04f3739..c7d4159b92 100644 --- a/reference/cfenv/fe_all_except.md +++ b/reference/cfenv/fe_all_except.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define FE_ALL_EXCEPT implementation-defined +#define FE_ALL_EXCEPT implementation-defined ``` ## 概要 diff --git a/reference/cfenv/fe_divbyzero.md b/reference/cfenv/fe_divbyzero.md index 6bfc97a6bb..97b2dd8a60 100644 --- a/reference/cfenv/fe_divbyzero.md +++ b/reference/cfenv/fe_divbyzero.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define FE_DIVBYZERO implementation-defined +#define FE_DIVBYZERO implementation-defined ``` ## 概要 diff --git a/reference/cfenv/fe_downward.md b/reference/cfenv/fe_downward.md index b326219290..8aa5169fc0 100644 --- a/reference/cfenv/fe_downward.md +++ b/reference/cfenv/fe_downward.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define FE_DOWNWARD implementation-defined +#define FE_DOWNWARD implementation-defined ``` ## 概要 diff --git a/reference/cfenv/fe_inexact.md b/reference/cfenv/fe_inexact.md index d1f8b0f489..6fbfdde5fe 100644 --- a/reference/cfenv/fe_inexact.md +++ b/reference/cfenv/fe_inexact.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define FE_INEXACT implementation-defined +#define FE_INEXACT implementation-defined ``` ## 概要 diff --git a/reference/cfenv/fe_invalid.md b/reference/cfenv/fe_invalid.md index fff8dfcb69..a015347a19 100644 --- a/reference/cfenv/fe_invalid.md +++ b/reference/cfenv/fe_invalid.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define FE_INVALID implementation-defined +#define FE_INVALID implementation-defined ``` ## 概要 diff --git a/reference/cfenv/fe_overflow.md b/reference/cfenv/fe_overflow.md index 7489add0bf..4ff0bdbd0e 100644 --- a/reference/cfenv/fe_overflow.md +++ b/reference/cfenv/fe_overflow.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define FE_OVERFLOW implementation-defined +#define FE_OVERFLOW implementation-defined ``` ## 概要 diff --git a/reference/cfenv/fe_tonearest.md b/reference/cfenv/fe_tonearest.md index 0a3c8d1037..1ce5fd2004 100644 --- a/reference/cfenv/fe_tonearest.md +++ b/reference/cfenv/fe_tonearest.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define FE_TONEAREST implementation-defined +#define FE_TONEAREST implementation-defined ``` ## 概要 diff --git a/reference/cfenv/fe_towardzero.md b/reference/cfenv/fe_towardzero.md index b847ec4431..3847072da2 100644 --- a/reference/cfenv/fe_towardzero.md +++ b/reference/cfenv/fe_towardzero.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define FE_TOWARDZERO implementation-defined +#define FE_TOWARDZERO implementation-defined ``` ## 概要 diff --git a/reference/cfenv/fe_underflow.md b/reference/cfenv/fe_underflow.md index ce308cd4f0..94660cdf30 100644 --- a/reference/cfenv/fe_underflow.md +++ b/reference/cfenv/fe_underflow.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define FE_UNDERFLOW implementation-defined +#define FE_UNDERFLOW implementation-defined ``` ## 概要 diff --git a/reference/cfenv/fe_upward.md b/reference/cfenv/fe_upward.md index 71c7e2e863..52f82e09e6 100644 --- a/reference/cfenv/fe_upward.md +++ b/reference/cfenv/fe_upward.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define FE_UPWARD implementation-defined +#define FE_UPWARD implementation-defined ``` ## 概要 diff --git a/reference/cfloat/dbl_decimal_dig.md b/reference/cfloat/dbl_decimal_dig.md index deea711523..28b7247783 100644 --- a/reference/cfloat/dbl_decimal_dig.md +++ b/reference/cfloat/dbl_decimal_dig.md @@ -5,7 +5,7 @@ * [mathjax enable] ```cpp -# define DBL_DECIMAL_DIG implementation-defined +#define DBL_DECIMAL_DIG implementation-defined ``` ## 概要 diff --git a/reference/cfloat/dbl_dig.md b/reference/cfloat/dbl_dig.md index 3bf9d9261c..7ab237cecb 100644 --- a/reference/cfloat/dbl_dig.md +++ b/reference/cfloat/dbl_dig.md @@ -4,7 +4,7 @@ * [mathjax enable] ```cpp -# define DBL_DIG implementation-defined +#define DBL_DIG implementation-defined ``` ## 概要 diff --git a/reference/cfloat/dbl_epsilon.md b/reference/cfloat/dbl_epsilon.md index 348fdb0d58..dd22b74538 100644 --- a/reference/cfloat/dbl_epsilon.md +++ b/reference/cfloat/dbl_epsilon.md @@ -4,7 +4,7 @@ * [mathjax enable] ```cpp -# define DBL_EPSILON implementation-defined +#define DBL_EPSILON implementation-defined ``` ## 概要 diff --git a/reference/cfloat/dbl_has_subnorm.md b/reference/cfloat/dbl_has_subnorm.md index 279f18e142..5f6b13c269 100644 --- a/reference/cfloat/dbl_has_subnorm.md +++ b/reference/cfloat/dbl_has_subnorm.md @@ -4,7 +4,7 @@ * cpp17[meta cpp] ```cpp -# define DBL_HAS_SUBNORM implementation-defined +#define DBL_HAS_SUBNORM implementation-defined ``` ## 概要 diff --git a/reference/cfloat/dbl_mant_dig.md b/reference/cfloat/dbl_mant_dig.md index bb07b0c5e7..399a7ab32a 100644 --- a/reference/cfloat/dbl_mant_dig.md +++ b/reference/cfloat/dbl_mant_dig.md @@ -4,7 +4,7 @@ * [mathjax enable] ```cpp -# define DBL_MANT_DIG implementation-defined +#define DBL_MANT_DIG implementation-defined ``` ## 概要 diff --git a/reference/cfloat/dbl_max.md b/reference/cfloat/dbl_max.md index 113a856a70..8508c9cd4b 100644 --- a/reference/cfloat/dbl_max.md +++ b/reference/cfloat/dbl_max.md @@ -4,7 +4,7 @@ * [mathjax enable] ```cpp -# define DBL_MAX implementation-defined +#define DBL_MAX implementation-defined ``` ## 概要 diff --git a/reference/cfloat/dbl_max_10_exp.md b/reference/cfloat/dbl_max_10_exp.md index e902456284..942864954a 100644 --- a/reference/cfloat/dbl_max_10_exp.md +++ b/reference/cfloat/dbl_max_10_exp.md @@ -4,7 +4,7 @@ * [mathjax enable] ```cpp -# define DBL_MAX_10_EXP implementation-defined +#define DBL_MAX_10_EXP implementation-defined ``` ## 概要 diff --git a/reference/cfloat/dbl_max_exp.md b/reference/cfloat/dbl_max_exp.md index 695ecc84bc..006e7d1e3a 100644 --- a/reference/cfloat/dbl_max_exp.md +++ b/reference/cfloat/dbl_max_exp.md @@ -4,7 +4,7 @@ * [mathjax enable] ```cpp -# define DBL_MAX_EXP implementation-defined +#define DBL_MAX_EXP implementation-defined ``` ## 概要 diff --git a/reference/cfloat/dbl_min.md b/reference/cfloat/dbl_min.md index 71b01434b2..2056c9a026 100644 --- a/reference/cfloat/dbl_min.md +++ b/reference/cfloat/dbl_min.md @@ -4,7 +4,7 @@ * [mathjax enable] ```cpp -# define DBL_MIN implementation-defined +#define DBL_MIN implementation-defined ``` ## 概要 diff --git a/reference/cfloat/dbl_min_10_exp.md b/reference/cfloat/dbl_min_10_exp.md index 07a219905d..602a0d074f 100644 --- a/reference/cfloat/dbl_min_10_exp.md +++ b/reference/cfloat/dbl_min_10_exp.md @@ -4,7 +4,7 @@ * [mathjax enable] ```cpp -# define DBL_MIN_10_EXP implementation-defined +#define DBL_MIN_10_EXP implementation-defined ``` ## 概要 diff --git a/reference/cfloat/dbl_min_exp.md b/reference/cfloat/dbl_min_exp.md index f4ad36f43f..26a92dff7a 100644 --- a/reference/cfloat/dbl_min_exp.md +++ b/reference/cfloat/dbl_min_exp.md @@ -4,7 +4,7 @@ * [mathjax enable] ```cpp -# define DBL_MIN_EXP implementation-defined +#define DBL_MIN_EXP implementation-defined ``` ## 概要 diff --git a/reference/cfloat/dbl_true_min.md b/reference/cfloat/dbl_true_min.md index 9d9138e8a2..bb8eafe213 100644 --- a/reference/cfloat/dbl_true_min.md +++ b/reference/cfloat/dbl_true_min.md @@ -5,7 +5,7 @@ * [mathjax enable] ```cpp -# define DBL_TRUE_MIN implementation-defined +#define DBL_TRUE_MIN implementation-defined ``` ## 概要 diff --git a/reference/cfloat/decimal_dig.md b/reference/cfloat/decimal_dig.md index 5adf80d54f..aa2c612393 100644 --- a/reference/cfloat/decimal_dig.md +++ b/reference/cfloat/decimal_dig.md @@ -5,7 +5,7 @@ * [mathjax enable] ```cpp -# define DECIMAL_DIG implementation-defined +#define DECIMAL_DIG implementation-defined ``` ## 概要 diff --git a/reference/cfloat/flt_decimal_dig.md b/reference/cfloat/flt_decimal_dig.md index e02e9e2d8b..65c844b58b 100644 --- a/reference/cfloat/flt_decimal_dig.md +++ b/reference/cfloat/flt_decimal_dig.md @@ -5,7 +5,7 @@ * [mathjax enable] ```cpp -# define FLT_DECIMAL_DIG implementation-defined +#define FLT_DECIMAL_DIG implementation-defined ``` ## 概要 diff --git a/reference/cfloat/flt_dig.md b/reference/cfloat/flt_dig.md index cabd5e0810..f3339301ff 100644 --- a/reference/cfloat/flt_dig.md +++ b/reference/cfloat/flt_dig.md @@ -4,7 +4,7 @@ * [mathjax enable] ```cpp -# define FLT_DIG implementation-defined +#define FLT_DIG implementation-defined ``` ## 概要 diff --git a/reference/cfloat/flt_epsilon.md b/reference/cfloat/flt_epsilon.md index fa5e040ff7..d5bcc8e189 100644 --- a/reference/cfloat/flt_epsilon.md +++ b/reference/cfloat/flt_epsilon.md @@ -4,7 +4,7 @@ * [mathjax enable] ```cpp -# define FLT_EPSILON implementation-defined +#define FLT_EPSILON implementation-defined ``` ## 概要 diff --git a/reference/cfloat/flt_eval_method.md b/reference/cfloat/flt_eval_method.md index 75665d4279..577f639ba6 100644 --- a/reference/cfloat/flt_eval_method.md +++ b/reference/cfloat/flt_eval_method.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define FLT_EVAL_METHOD implementation-defined +#define FLT_EVAL_METHOD implementation-defined ``` ## 概要 diff --git a/reference/cfloat/flt_has_subnorm.md b/reference/cfloat/flt_has_subnorm.md index 1467249db5..bdf471dd3c 100644 --- a/reference/cfloat/flt_has_subnorm.md +++ b/reference/cfloat/flt_has_subnorm.md @@ -4,7 +4,7 @@ * cpp17[meta cpp] ```cpp -# define FLT_HAS_SUBNORM implementation-defined +#define FLT_HAS_SUBNORM implementation-defined ``` ## 概要 diff --git a/reference/cfloat/flt_mant_dig.md b/reference/cfloat/flt_mant_dig.md index 27da7b7ec3..a4d4d8d89e 100644 --- a/reference/cfloat/flt_mant_dig.md +++ b/reference/cfloat/flt_mant_dig.md @@ -4,7 +4,7 @@ * [mathjax enable] ```cpp -# define FLT_MANT_DIG implementation-defined +#define FLT_MANT_DIG implementation-defined ``` ## 概要 diff --git a/reference/cfloat/flt_max.md b/reference/cfloat/flt_max.md index 8672c3ba77..f369e38b9f 100644 --- a/reference/cfloat/flt_max.md +++ b/reference/cfloat/flt_max.md @@ -4,7 +4,7 @@ * [mathjax enable] ```cpp -# define FLT_MAX implementation-defined +#define FLT_MAX implementation-defined ``` ## 概要 diff --git a/reference/cfloat/flt_max_10_exp.md b/reference/cfloat/flt_max_10_exp.md index 30e65c66a1..de93904594 100644 --- a/reference/cfloat/flt_max_10_exp.md +++ b/reference/cfloat/flt_max_10_exp.md @@ -4,7 +4,7 @@ * [mathjax enable] ```cpp -# define FLT_MAX_10_EXP implementation-defined +#define FLT_MAX_10_EXP implementation-defined ``` ## 概要 diff --git a/reference/cfloat/flt_max_exp.md b/reference/cfloat/flt_max_exp.md index 413800a03b..6b63fb5bee 100644 --- a/reference/cfloat/flt_max_exp.md +++ b/reference/cfloat/flt_max_exp.md @@ -4,7 +4,7 @@ * [mathjax enable] ```cpp -# define FLT_MAX_EXP implementation-defined +#define FLT_MAX_EXP implementation-defined ``` ## 概要 diff --git a/reference/cfloat/flt_min.md b/reference/cfloat/flt_min.md index 16c00f6726..2808125b1f 100644 --- a/reference/cfloat/flt_min.md +++ b/reference/cfloat/flt_min.md @@ -4,7 +4,7 @@ * [mathjax enable] ```cpp -# define FLT_MIN implementation-defined +#define FLT_MIN implementation-defined ``` ## 概要 diff --git a/reference/cfloat/flt_min_10_exp.md b/reference/cfloat/flt_min_10_exp.md index 0fb4376809..0964bc3806 100644 --- a/reference/cfloat/flt_min_10_exp.md +++ b/reference/cfloat/flt_min_10_exp.md @@ -4,7 +4,7 @@ * [mathjax enable] ```cpp -# define FLT_MIN_10_EXP implementation-defined +#define FLT_MIN_10_EXP implementation-defined ``` ## 概要 diff --git a/reference/cfloat/flt_min_exp.md b/reference/cfloat/flt_min_exp.md index eaefb0e84b..1fa7386948 100644 --- a/reference/cfloat/flt_min_exp.md +++ b/reference/cfloat/flt_min_exp.md @@ -4,7 +4,7 @@ * [mathjax enable] ```cpp -# define FLT_MIN_EXP implementation-defined +#define FLT_MIN_EXP implementation-defined ``` ## 概要 diff --git a/reference/cfloat/flt_radix.md b/reference/cfloat/flt_radix.md index 59a6cf4b64..d6d3ef16aa 100644 --- a/reference/cfloat/flt_radix.md +++ b/reference/cfloat/flt_radix.md @@ -3,7 +3,7 @@ * macro[meta id-type] ```cpp -# define FLT_RADIX implementation-defined +#define FLT_RADIX implementation-defined ``` diff --git a/reference/cfloat/flt_rounds.md b/reference/cfloat/flt_rounds.md index d125fcd94b..d2aff434a2 100644 --- a/reference/cfloat/flt_rounds.md +++ b/reference/cfloat/flt_rounds.md @@ -3,7 +3,7 @@ * macro[meta id-type] ```cpp -# define FLT_ROUNDS implementation-defined +#define FLT_ROUNDS implementation-defined ``` ## 概要 diff --git a/reference/cfloat/flt_true_min.md b/reference/cfloat/flt_true_min.md index d959c4c8df..5a715daf62 100644 --- a/reference/cfloat/flt_true_min.md +++ b/reference/cfloat/flt_true_min.md @@ -5,7 +5,7 @@ * [mathjax enable] ```cpp -# define FLT_TRUE_MIN implementation-defined +#define FLT_TRUE_MIN implementation-defined ``` ## 概要 diff --git a/reference/cfloat/ldbl_decimal_dig.md b/reference/cfloat/ldbl_decimal_dig.md index 8064f1c0e0..e598cdcda0 100644 --- a/reference/cfloat/ldbl_decimal_dig.md +++ b/reference/cfloat/ldbl_decimal_dig.md @@ -5,7 +5,7 @@ * [mathjax enable] ```cpp -# define LDBL_DECIMAL_DIG implementation-defined +#define LDBL_DECIMAL_DIG implementation-defined ``` ## 概要 diff --git a/reference/cfloat/ldbl_dig.md b/reference/cfloat/ldbl_dig.md index 654bec2991..e2e6f053d5 100644 --- a/reference/cfloat/ldbl_dig.md +++ b/reference/cfloat/ldbl_dig.md @@ -4,7 +4,7 @@ * [mathjax enable] ```cpp -# define LDBL_DIG implementation-defined +#define LDBL_DIG implementation-defined ``` ## 概要 diff --git a/reference/cfloat/ldbl_epsilon.md b/reference/cfloat/ldbl_epsilon.md index b5a0f4572a..787dadac1a 100644 --- a/reference/cfloat/ldbl_epsilon.md +++ b/reference/cfloat/ldbl_epsilon.md @@ -4,7 +4,7 @@ * [mathjax enable] ```cpp -# define LDBL_EPSILON implementation-defined +#define LDBL_EPSILON implementation-defined ``` ## 概要 diff --git a/reference/cfloat/ldbl_has_subnorm.md b/reference/cfloat/ldbl_has_subnorm.md index 649e0fc076..f837b06943 100644 --- a/reference/cfloat/ldbl_has_subnorm.md +++ b/reference/cfloat/ldbl_has_subnorm.md @@ -4,7 +4,7 @@ * cpp17[meta cpp] ```cpp -# define LDBL_HAS_SUBNORM implementation-defined +#define LDBL_HAS_SUBNORM implementation-defined ``` ## 概要 diff --git a/reference/cfloat/ldbl_mant_dig.md b/reference/cfloat/ldbl_mant_dig.md index 8bf81fdf3f..035a9f72c5 100644 --- a/reference/cfloat/ldbl_mant_dig.md +++ b/reference/cfloat/ldbl_mant_dig.md @@ -4,7 +4,7 @@ * [mathjax enable] ```cpp -# define LDBL_MANT_DIG implementation-defined +#define LDBL_MANT_DIG implementation-defined ``` ## 概要 diff --git a/reference/cfloat/ldbl_max.md b/reference/cfloat/ldbl_max.md index 242f51a1e7..a447e3d829 100644 --- a/reference/cfloat/ldbl_max.md +++ b/reference/cfloat/ldbl_max.md @@ -4,7 +4,7 @@ * [mathjax enable] ```cpp -# define LDBL_MAX implementation-defined +#define LDBL_MAX implementation-defined ``` ## 概要 diff --git a/reference/cfloat/ldbl_max_10_exp.md b/reference/cfloat/ldbl_max_10_exp.md index e7c9c69eea..3b76c05068 100644 --- a/reference/cfloat/ldbl_max_10_exp.md +++ b/reference/cfloat/ldbl_max_10_exp.md @@ -4,7 +4,7 @@ * [mathjax enable] ```cpp -# define LDBL_MAX_10_EXP implementation-defined +#define LDBL_MAX_10_EXP implementation-defined ``` ## 概要 diff --git a/reference/cfloat/ldbl_max_exp.md b/reference/cfloat/ldbl_max_exp.md index b116229907..ceedbd3893 100644 --- a/reference/cfloat/ldbl_max_exp.md +++ b/reference/cfloat/ldbl_max_exp.md @@ -4,7 +4,7 @@ * [mathjax enable] ```cpp -# define LDBL_MAX_EXP implementation-defined +#define LDBL_MAX_EXP implementation-defined ``` ## 概要 diff --git a/reference/cfloat/ldbl_min.md b/reference/cfloat/ldbl_min.md index f3aaa736b9..4296226487 100644 --- a/reference/cfloat/ldbl_min.md +++ b/reference/cfloat/ldbl_min.md @@ -4,7 +4,7 @@ * [mathjax enable] ```cpp -# define LDBL_MIN implementation-defined +#define LDBL_MIN implementation-defined ``` ## 概要 diff --git a/reference/cfloat/ldbl_min_10_exp.md b/reference/cfloat/ldbl_min_10_exp.md index 54f1916bd8..306d90f7ec 100644 --- a/reference/cfloat/ldbl_min_10_exp.md +++ b/reference/cfloat/ldbl_min_10_exp.md @@ -4,7 +4,7 @@ * [mathjax enable] ```cpp -# define LDBL_MIN_10_EXP implementation-defined +#define LDBL_MIN_10_EXP implementation-defined ``` ## 概要 diff --git a/reference/cfloat/ldbl_min_exp.md b/reference/cfloat/ldbl_min_exp.md index b050efe219..67f406f266 100644 --- a/reference/cfloat/ldbl_min_exp.md +++ b/reference/cfloat/ldbl_min_exp.md @@ -4,7 +4,7 @@ * [mathjax enable] ```cpp -# define LDBL_MIN_EXP implementation-defined +#define LDBL_MIN_EXP implementation-defined ``` ## 概要 diff --git a/reference/cfloat/ldbl_true_min.md b/reference/cfloat/ldbl_true_min.md index e22a749e50..07d02df6ef 100644 --- a/reference/cfloat/ldbl_true_min.md +++ b/reference/cfloat/ldbl_true_min.md @@ -5,7 +5,7 @@ * [mathjax enable] ```cpp -# define LDBL_TRUE_MIN implementation-defined +#define LDBL_TRUE_MIN implementation-defined ``` ## 概要 diff --git a/reference/chrono/duration.md b/reference/chrono/duration.md index 386f75d835..a5ae923437 100644 --- a/reference/chrono/duration.md +++ b/reference/chrono/duration.md @@ -180,13 +180,13 @@ void print(const system_clock::time_point& p) { std::time_t t = system_clock::to_time_t(p); char buf[26]; // 最低26バイトが必要 -# ifdef _MSC_VER +#ifdef _MSC_VER // Visual Studioではctime_s()が推奨されている。 ctime_s(buf, 26, &t); -# else +#else // ctime()のリエントラント版 ctime_r(&t, buf); -# endif +#endif // 出力された文字列には改行が含まれていることに注意 std::cout << buf; } diff --git a/reference/climits/char_bit.md b/reference/climits/char_bit.md index 0f852ff9e8..9a34b7ed55 100644 --- a/reference/climits/char_bit.md +++ b/reference/climits/char_bit.md @@ -3,7 +3,7 @@ * macro[meta id-type] ```cpp -# define CHAR_BIT implementation-defined +#define CHAR_BIT implementation-defined ``` ## 概要 diff --git a/reference/climits/char_max.md b/reference/climits/char_max.md index 83ab3efa04..548be7370d 100644 --- a/reference/climits/char_max.md +++ b/reference/climits/char_max.md @@ -3,7 +3,7 @@ * macro[meta id-type] ```cpp -# define CHAR_MAX implementation-defined +#define CHAR_MAX implementation-defined ``` ## 概要 diff --git a/reference/climits/char_min.md b/reference/climits/char_min.md index 599d9dff4e..a1b804a945 100644 --- a/reference/climits/char_min.md +++ b/reference/climits/char_min.md @@ -3,7 +3,7 @@ * macro[meta id-type] ```cpp -# define CHAR_MIN implementation-defined +#define CHAR_MIN implementation-defined ``` ## 概要 diff --git a/reference/climits/int_max.md b/reference/climits/int_max.md index ccdf2ed4ab..baa89290d0 100644 --- a/reference/climits/int_max.md +++ b/reference/climits/int_max.md @@ -3,7 +3,7 @@ * macro[meta id-type] ```cpp -# define INT_MAX implementation-defined +#define INT_MAX implementation-defined ``` ## 概要 diff --git a/reference/climits/int_min.md b/reference/climits/int_min.md index 20e473b62d..9c1a616205 100644 --- a/reference/climits/int_min.md +++ b/reference/climits/int_min.md @@ -3,7 +3,7 @@ * macro[meta id-type] ```cpp -# define INT_MIN implementation-defined +#define INT_MIN implementation-defined ``` ## 概要 diff --git a/reference/climits/llong_max.md b/reference/climits/llong_max.md index d40cbada68..487cbfaa7e 100644 --- a/reference/climits/llong_max.md +++ b/reference/climits/llong_max.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define LLONG_MAX implementation-defined +#define LLONG_MAX implementation-defined ``` ## 概要 diff --git a/reference/climits/llong_min.md b/reference/climits/llong_min.md index 908cfd5884..7059b869f6 100644 --- a/reference/climits/llong_min.md +++ b/reference/climits/llong_min.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define LLONG_MIN implementation-defined +#define LLONG_MIN implementation-defined ``` ## 概要 diff --git a/reference/climits/long_max.md b/reference/climits/long_max.md index 7a464e39b3..509bea494c 100644 --- a/reference/climits/long_max.md +++ b/reference/climits/long_max.md @@ -3,7 +3,7 @@ * macro[meta id-type] ```cpp -# define LONG_MAX implementation-defined +#define LONG_MAX implementation-defined ``` ## 概要 diff --git a/reference/climits/long_min.md b/reference/climits/long_min.md index bb9cefc28b..8d794434f9 100644 --- a/reference/climits/long_min.md +++ b/reference/climits/long_min.md @@ -3,7 +3,7 @@ * macro[meta id-type] ```cpp -# define LONG_MIN implementation-defined +#define LONG_MIN implementation-defined ``` ## 概要 diff --git a/reference/climits/mb_len_max.md b/reference/climits/mb_len_max.md index 9c5a7523c8..f1c4f10ec8 100644 --- a/reference/climits/mb_len_max.md +++ b/reference/climits/mb_len_max.md @@ -3,7 +3,7 @@ * macro[meta id-type] ```cpp -# define MB_LEN_MAX implementation-defined +#define MB_LEN_MAX implementation-defined ``` ## 概要 diff --git a/reference/climits/schar_max.md b/reference/climits/schar_max.md index 1ff5eab351..e3f5e85e0f 100644 --- a/reference/climits/schar_max.md +++ b/reference/climits/schar_max.md @@ -3,7 +3,7 @@ * macro[meta id-type] ```cpp -# define SCHAR_MAX implementation-defined +#define SCHAR_MAX implementation-defined ``` ## 概要 diff --git a/reference/climits/schar_min.md b/reference/climits/schar_min.md index bfb706bbbf..0b2f7478ee 100644 --- a/reference/climits/schar_min.md +++ b/reference/climits/schar_min.md @@ -3,7 +3,7 @@ * macro[meta id-type] ```cpp -# define SCHAR_MIN implementation-defined +#define SCHAR_MIN implementation-defined ``` ## 概要 diff --git a/reference/climits/shrt_max.md b/reference/climits/shrt_max.md index eaf7ba448f..1e6ac558c4 100644 --- a/reference/climits/shrt_max.md +++ b/reference/climits/shrt_max.md @@ -3,7 +3,7 @@ * macro[meta id-type] ```cpp -# define SHRT_MAX implementation-defined +#define SHRT_MAX implementation-defined ``` ## 概要 diff --git a/reference/climits/shrt_min.md b/reference/climits/shrt_min.md index 1d79b0b5e8..8a8068e220 100644 --- a/reference/climits/shrt_min.md +++ b/reference/climits/shrt_min.md @@ -3,7 +3,7 @@ * macro[meta id-type] ```cpp -# define SHRT_MIN implementation-defined +#define SHRT_MIN implementation-defined ``` ## 概要 diff --git a/reference/climits/uchar_max.md b/reference/climits/uchar_max.md index 6fad4a1db2..84dd3d7952 100644 --- a/reference/climits/uchar_max.md +++ b/reference/climits/uchar_max.md @@ -3,7 +3,7 @@ * macro[meta id-type] ```cpp -# define UCHAR_MAX implementation-defined +#define UCHAR_MAX implementation-defined ``` ## 概要 diff --git a/reference/climits/uint_max.md b/reference/climits/uint_max.md index a1ba8ae2c8..ddaa305a7f 100644 --- a/reference/climits/uint_max.md +++ b/reference/climits/uint_max.md @@ -3,7 +3,7 @@ * macro[meta id-type] ```cpp -# define UINT_MAX implementation-defined +#define UINT_MAX implementation-defined ``` ## 概要 diff --git a/reference/climits/ullong_max.md b/reference/climits/ullong_max.md index 6a5a2b7fec..84aeca3ea0 100644 --- a/reference/climits/ullong_max.md +++ b/reference/climits/ullong_max.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define ULLONG_MAX implementation-defined +#define ULLONG_MAX implementation-defined ``` ## 概要 diff --git a/reference/climits/ulong_max.md b/reference/climits/ulong_max.md index 41331caf65..4fa8f2270d 100644 --- a/reference/climits/ulong_max.md +++ b/reference/climits/ulong_max.md @@ -3,7 +3,7 @@ * macro[meta id-type] ```cpp -# define ULONG_MAX implementation-defined +#define ULONG_MAX implementation-defined ``` ## 概要 diff --git a/reference/climits/ushrt_max.md b/reference/climits/ushrt_max.md index 599ad0a128..c92a260522 100644 --- a/reference/climits/ushrt_max.md +++ b/reference/climits/ushrt_max.md @@ -3,7 +3,7 @@ * macro[meta id-type] ```cpp -# define USHRT_MAX implementation-defined +#define USHRT_MAX implementation-defined ``` ## 概要 diff --git a/reference/cmath/fp_fast_fma.md b/reference/cmath/fp_fast_fma.md index 8e3d0c8a6c..4e23d72289 100644 --- a/reference/cmath/fp_fast_fma.md +++ b/reference/cmath/fp_fast_fma.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define FP_FAST_FMA 1 +#define FP_FAST_FMA 1 ``` ## 概要 diff --git a/reference/cmath/fp_fast_fmaf.md b/reference/cmath/fp_fast_fmaf.md index 2ae0d22716..045ef8e008 100644 --- a/reference/cmath/fp_fast_fmaf.md +++ b/reference/cmath/fp_fast_fmaf.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define FP_FAST_FMAF 1 +#define FP_FAST_FMAF 1 ``` ## 概要 diff --git a/reference/cmath/fp_fast_fmal.md b/reference/cmath/fp_fast_fmal.md index 6cada06e51..819924966a 100644 --- a/reference/cmath/fp_fast_fmal.md +++ b/reference/cmath/fp_fast_fmal.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define FP_FAST_FMAL 1 +#define FP_FAST_FMAL 1 ``` ## 概要 diff --git a/reference/cmath/fp_ilogb0.md b/reference/cmath/fp_ilogb0.md index 98b04c263c..ea747b6219 100644 --- a/reference/cmath/fp_ilogb0.md +++ b/reference/cmath/fp_ilogb0.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define FP_ILOGB0 implementation_defined +#define FP_ILOGB0 implementation_defined ``` * implementation_defined[italic] diff --git a/reference/cmath/fp_ilogbnan.md b/reference/cmath/fp_ilogbnan.md index 1e45da9ec0..dac15985cc 100644 --- a/reference/cmath/fp_ilogbnan.md +++ b/reference/cmath/fp_ilogbnan.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define FP_ILOGBNAN implementation_defined +#define FP_ILOGBNAN implementation_defined ``` * implementation_defined[italic] diff --git a/reference/cmath/fp_infinite.md b/reference/cmath/fp_infinite.md index 69cf2580db..adfd5b925e 100644 --- a/reference/cmath/fp_infinite.md +++ b/reference/cmath/fp_infinite.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define FP_INFINITE integer_constant_expression +#define FP_INFINITE integer_constant_expression ``` * integer_constant_expression[italic] diff --git a/reference/cmath/fp_nan.md b/reference/cmath/fp_nan.md index 3387c9dc03..ac5bf9cc39 100644 --- a/reference/cmath/fp_nan.md +++ b/reference/cmath/fp_nan.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define FP_NAN integer_constant_expression +#define FP_NAN integer_constant_expression ``` * integer_constant_expression[italic] diff --git a/reference/cmath/fp_normal.md b/reference/cmath/fp_normal.md index 76ff1df7d0..5d91287811 100644 --- a/reference/cmath/fp_normal.md +++ b/reference/cmath/fp_normal.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define FP_NORMAL integer_constant_expression +#define FP_NORMAL integer_constant_expression ``` * integer_constant_expression[italic] diff --git a/reference/cmath/fp_subnormal.md b/reference/cmath/fp_subnormal.md index e815839120..c011449b64 100644 --- a/reference/cmath/fp_subnormal.md +++ b/reference/cmath/fp_subnormal.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define FP_SUBNORMAL integer_constant_expression +#define FP_SUBNORMAL integer_constant_expression ``` * integer_constant_expression[italic] diff --git a/reference/cmath/fp_zero.md b/reference/cmath/fp_zero.md index 3173874b97..bdcdcd0478 100644 --- a/reference/cmath/fp_zero.md +++ b/reference/cmath/fp_zero.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define FP_ZERO integer_constant_expression +#define FP_ZERO integer_constant_expression ``` * integer_constant_expression[italic] diff --git a/reference/cmath/huge_val.md b/reference/cmath/huge_val.md index 92450325d7..c2bccc8d9d 100644 --- a/reference/cmath/huge_val.md +++ b/reference/cmath/huge_val.md @@ -3,7 +3,7 @@ * macro[meta id-type] ```cpp -# define HUGE_VAL implementation-defined +#define HUGE_VAL implementation-defined ``` ## 概要 diff --git a/reference/cmath/huge_valf.md b/reference/cmath/huge_valf.md index 1ff20ddde8..c335721e97 100644 --- a/reference/cmath/huge_valf.md +++ b/reference/cmath/huge_valf.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define HUGE_VALF implementation-defined +#define HUGE_VALF implementation-defined ``` ## 概要 diff --git a/reference/cmath/huge_vall.md b/reference/cmath/huge_vall.md index 07889c1223..87974c6fe9 100644 --- a/reference/cmath/huge_vall.md +++ b/reference/cmath/huge_vall.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define HUGE_VALL implementation-defined +#define HUGE_VALL implementation-defined ``` ## 概要 diff --git a/reference/cmath/infinity.md b/reference/cmath/infinity.md index 52b823e860..c54fd23c83 100644 --- a/reference/cmath/infinity.md +++ b/reference/cmath/infinity.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define INFINITY some_expression +#define INFINITY some_expression ``` ## 概要 diff --git a/reference/cmath/llrint.md b/reference/cmath/llrint.md index 3508baf9bf..f9ce5d8aee 100644 --- a/reference/cmath/llrint.md +++ b/reference/cmath/llrint.md @@ -78,22 +78,22 @@ void test(const char* title, int round_mode) std::cout << '\n'; } -# define test(mode) test(#mode, mode) +#define test(mode) test(#mode, mode) int main() { -# ifdef FE_DOWNWARD +#ifdef FE_DOWNWARD test(FE_DOWNWARD); -# endif -# ifdef FE_TONEAREST +#endif +#ifdef FE_TONEAREST test(FE_TONEAREST); -# endif -# ifdef FE_TOWARDZERO +#endif +#ifdef FE_TOWARDZERO test(FE_TOWARDZERO); -# endif -# ifdef FE_UPWARD +#endif +#ifdef FE_UPWARD test(FE_UPWARD); -# endif +#endif } ``` * std::llrint[color ff0000] diff --git a/reference/cmath/lrint.md b/reference/cmath/lrint.md index 6733a4426c..275b9f3ae0 100644 --- a/reference/cmath/lrint.md +++ b/reference/cmath/lrint.md @@ -77,22 +77,22 @@ void test(const char* title, int round_mode) std::cout << '\n'; } -# define test(mode) test(#mode, mode) +#define test(mode) test(#mode, mode) int main() { -# ifdef FE_DOWNWARD +#ifdef FE_DOWNWARD test(FE_DOWNWARD); -# endif -# ifdef FE_TONEAREST +#endif +#ifdef FE_TONEAREST test(FE_TONEAREST); -# endif -# ifdef FE_TOWARDZERO +#endif +#ifdef FE_TOWARDZERO test(FE_TOWARDZERO); -# endif -# ifdef FE_UPWARD +#endif +#ifdef FE_UPWARD test(FE_UPWARD); -# endif +#endif } ``` * std::lrint[color ff0000] diff --git a/reference/cmath/math_errexcept.md b/reference/cmath/math_errexcept.md index 0b178f2b4c..fb37074761 100644 --- a/reference/cmath/math_errexcept.md +++ b/reference/cmath/math_errexcept.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define MATH_ERREXCEPT 2 +#define MATH_ERREXCEPT 2 ``` ## 概要 diff --git a/reference/cmath/math_errhandling.md b/reference/cmath/math_errhandling.md index b0cfd625a2..ef97f3557f 100644 --- a/reference/cmath/math_errhandling.md +++ b/reference/cmath/math_errhandling.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define math_errhandling implementation-defined +#define math_errhandling implementation-defined ``` ## 概要 diff --git a/reference/cmath/math_errno.md b/reference/cmath/math_errno.md index fc68c77bb2..f1578170d8 100644 --- a/reference/cmath/math_errno.md +++ b/reference/cmath/math_errno.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define MATH_ERRNO 1 +#define MATH_ERRNO 1 ``` ## 概要 diff --git a/reference/cmath/modf.md b/reference/cmath/modf.md index 3a271bac69..6eded038f5 100644 --- a/reference/cmath/modf.md +++ b/reference/cmath/modf.md @@ -142,16 +142,16 @@ namespace std { return copysign(isinf(value) ? 0.0L : value - (*iptr), value); } -# if __cplusplus >= 201103L +#if __cplusplus >= 201103L template typename enable_if::value, double>::type modf(T value, double* iptr) { return modf(static_cast(value), iptr); } -# endif +#endif -# if __cplusplus > 201402L +#if __cplusplus > 201402L float modff(float value, float* iptr) { return modf(value, iptr); @@ -161,7 +161,7 @@ namespace std { { return modf(value, iptr); } -# endif +#endif } ``` * nearbyint[link nearbyint.md] diff --git a/reference/cmath/nan.md b/reference/cmath/nan.md index b066e89e8e..f27fd5ebef 100644 --- a/reference/cmath/nan.md +++ b/reference/cmath/nan.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define NAN constant_expression +#define NAN constant_expression ``` * constant_expression[italic] diff --git a/reference/cmath/nearbyint.md b/reference/cmath/nearbyint.md index bc35556333..b12acb4598 100644 --- a/reference/cmath/nearbyint.md +++ b/reference/cmath/nearbyint.md @@ -65,22 +65,22 @@ void test(const char* title, int round_mode) std::cout << "FE_INEXACT = " << std::boolalpha << (std::fetestexcept(FE_INEXACT) != 0) << std::endl << std::endl; } -# define test(mode) test(#mode, mode) +#define test(mode) test(#mode, mode) int main() { -# ifdef FE_DOWNWARD +#ifdef FE_DOWNWARD test(FE_DOWNWARD); -# endif -# ifdef FE_TONEAREST +#endif +#ifdef FE_TONEAREST test(FE_TONEAREST); -# endif -# ifdef FE_TOWARDZERO +#endif +#ifdef FE_TOWARDZERO test(FE_TOWARDZERO); -# endif -# ifdef FE_UPWARD +#endif +#ifdef FE_UPWARD test(FE_UPWARD); -# endif +#endif } ``` * std::nearbyint[color ff0000] diff --git a/reference/cmath/rint.md b/reference/cmath/rint.md index 0d7122ea32..00fd095b23 100644 --- a/reference/cmath/rint.md +++ b/reference/cmath/rint.md @@ -66,22 +66,22 @@ void test(const char* title, int round_mode) std::cout << "FE_INEXACT = " << std::boolalpha << (std::fetestexcept(FE_INEXACT) != 0) << std::endl << std::endl; } -# define test(mode) test(#mode, mode) +#define test(mode) test(#mode, mode) int main() { -# ifdef FE_DOWNWARD +#ifdef FE_DOWNWARD test(FE_DOWNWARD); -# endif -# ifdef FE_TONEAREST +#endif +#ifdef FE_TONEAREST test(FE_TONEAREST); -# endif -# ifdef FE_TOWARDZERO +#endif +#ifdef FE_TOWARDZERO test(FE_TOWARDZERO); -# endif -# ifdef FE_UPWARD +#endif +#ifdef FE_UPWARD test(FE_UPWARD); -# endif +#endif } ``` * std::rint[color ff0000] diff --git a/reference/cstddef/null.md b/reference/cstddef/null.md index d7dc7f55f8..74776d1546 100644 --- a/reference/cstddef/null.md +++ b/reference/cstddef/null.md @@ -3,7 +3,7 @@ * macro[meta id-type] ```cpp -# define NULL implementation-defined +#define NULL implementation-defined ``` ## 概要 diff --git a/reference/cstddef/offsetof.md b/reference/cstddef/offsetof.md index 135436e46e..0f2c5e56b2 100644 --- a/reference/cstddef/offsetof.md +++ b/reference/cstddef/offsetof.md @@ -3,7 +3,7 @@ * macro[meta id-type] ```cpp -# define offsetof(type, member) see-below +#define offsetof(type, member) see-below ``` * see-below[italic] diff --git a/reference/cstdint/int16_max.md b/reference/cstdint/int16_max.md index 6b98d79755..cb8e98c6aa 100644 --- a/reference/cstdint/int16_max.md +++ b/reference/cstdint/int16_max.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define INT16_MAX implementation-defined +#define INT16_MAX implementation-defined ``` ## 概要 diff --git a/reference/cstdint/int16_min.md b/reference/cstdint/int16_min.md index 1abee7c557..6003555b97 100644 --- a/reference/cstdint/int16_min.md +++ b/reference/cstdint/int16_min.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define INT16_MIN implementation-defined +#define INT16_MIN implementation-defined ``` ## 概要 diff --git a/reference/cstdint/int32_max.md b/reference/cstdint/int32_max.md index 47ffe157c8..f4c86f4a32 100644 --- a/reference/cstdint/int32_max.md +++ b/reference/cstdint/int32_max.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define INT32_MAX implementation-defined +#define INT32_MAX implementation-defined ``` ## 概要 diff --git a/reference/cstdint/int32_min.md b/reference/cstdint/int32_min.md index 4a5fcf47aa..0de639832c 100644 --- a/reference/cstdint/int32_min.md +++ b/reference/cstdint/int32_min.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define INT32_MIN implementation-defined +#define INT32_MIN implementation-defined ``` ## 概要 diff --git a/reference/cstdint/int64_max.md b/reference/cstdint/int64_max.md index 2c5d2ea531..122f76ae61 100644 --- a/reference/cstdint/int64_max.md +++ b/reference/cstdint/int64_max.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define INT64_MAX implementation-defined +#define INT64_MAX implementation-defined ``` ## 概要 diff --git a/reference/cstdint/int64_min.md b/reference/cstdint/int64_min.md index 7ad38bc46a..b61d8ab4ec 100644 --- a/reference/cstdint/int64_min.md +++ b/reference/cstdint/int64_min.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define INT64_MIN implementation-defined +#define INT64_MIN implementation-defined ``` ## 概要 diff --git a/reference/cstdint/int8_max.md b/reference/cstdint/int8_max.md index 8e5e02c2b6..0b7bc7548b 100644 --- a/reference/cstdint/int8_max.md +++ b/reference/cstdint/int8_max.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define INT8_MAX implementation-defined +#define INT8_MAX implementation-defined ``` ## 概要 diff --git a/reference/cstdint/int8_min.md b/reference/cstdint/int8_min.md index 07b2a8caeb..b7f5e93610 100644 --- a/reference/cstdint/int8_min.md +++ b/reference/cstdint/int8_min.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define INT8_MIN implementation-defined +#define INT8_MIN implementation-defined ``` ## 概要 diff --git a/reference/cstdint/int_fast16_max.md b/reference/cstdint/int_fast16_max.md index fdd28e7d08..868dbb94e0 100644 --- a/reference/cstdint/int_fast16_max.md +++ b/reference/cstdint/int_fast16_max.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define INT_FAST16_MAX implementation-defined +#define INT_FAST16_MAX implementation-defined ``` ## 概要 diff --git a/reference/cstdint/int_fast16_min.md b/reference/cstdint/int_fast16_min.md index 5ed2a13bcd..09210fa892 100644 --- a/reference/cstdint/int_fast16_min.md +++ b/reference/cstdint/int_fast16_min.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define INT_FAST16_MIN implementation-defined +#define INT_FAST16_MIN implementation-defined ``` ## 概要 diff --git a/reference/cstdint/int_fast32_max.md b/reference/cstdint/int_fast32_max.md index 771414cc53..9f62c036ff 100644 --- a/reference/cstdint/int_fast32_max.md +++ b/reference/cstdint/int_fast32_max.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define INT_FAST32_MAX implementation-defined +#define INT_FAST32_MAX implementation-defined ``` ## 概要 diff --git a/reference/cstdint/int_fast32_min.md b/reference/cstdint/int_fast32_min.md index 60e4457d9b..624b382fe7 100644 --- a/reference/cstdint/int_fast32_min.md +++ b/reference/cstdint/int_fast32_min.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define INT_FAST32_MIN implementation-defined +#define INT_FAST32_MIN implementation-defined ``` ## 概要 diff --git a/reference/cstdint/int_fast64_max.md b/reference/cstdint/int_fast64_max.md index baf452a181..8991bae542 100644 --- a/reference/cstdint/int_fast64_max.md +++ b/reference/cstdint/int_fast64_max.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define INT_FAST64_MAX implementation-defined +#define INT_FAST64_MAX implementation-defined ``` ## 概要 diff --git a/reference/cstdint/int_fast64_min.md b/reference/cstdint/int_fast64_min.md index 54a8617176..b514ea7173 100644 --- a/reference/cstdint/int_fast64_min.md +++ b/reference/cstdint/int_fast64_min.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define INT_FAST64_MIN implementation-defined +#define INT_FAST64_MIN implementation-defined ``` ## 概要 diff --git a/reference/cstdint/int_fast8_max.md b/reference/cstdint/int_fast8_max.md index 973efcf3e1..cffb2f40b5 100644 --- a/reference/cstdint/int_fast8_max.md +++ b/reference/cstdint/int_fast8_max.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define INT_FAST8_MAX implementation-defined +#define INT_FAST8_MAX implementation-defined ``` ## 概要 diff --git a/reference/cstdint/int_fast8_min.md b/reference/cstdint/int_fast8_min.md index 8e7a278d3b..1079276468 100644 --- a/reference/cstdint/int_fast8_min.md +++ b/reference/cstdint/int_fast8_min.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define INT_FAST8_MIN implementation-defined +#define INT_FAST8_MIN implementation-defined ``` ## 概要 diff --git a/reference/cstdint/int_least16_max.md b/reference/cstdint/int_least16_max.md index edf45c06aa..b1dc138eab 100644 --- a/reference/cstdint/int_least16_max.md +++ b/reference/cstdint/int_least16_max.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define INT_LEAST16_MAX implementation-defined +#define INT_LEAST16_MAX implementation-defined ``` ## 概要 diff --git a/reference/cstdint/int_least16_min.md b/reference/cstdint/int_least16_min.md index 1322524c81..5e7234472c 100644 --- a/reference/cstdint/int_least16_min.md +++ b/reference/cstdint/int_least16_min.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define INT_LEAST16_MIN implementation-defined +#define INT_LEAST16_MIN implementation-defined ``` ## 概要 diff --git a/reference/cstdint/int_least32_max.md b/reference/cstdint/int_least32_max.md index e9b4e9eee3..57a0126712 100644 --- a/reference/cstdint/int_least32_max.md +++ b/reference/cstdint/int_least32_max.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define INT_LEAST32_MAX implementation-defined +#define INT_LEAST32_MAX implementation-defined ``` ## 概要 diff --git a/reference/cstdint/int_least32_min.md b/reference/cstdint/int_least32_min.md index 76e791f0c5..510ded01cb 100644 --- a/reference/cstdint/int_least32_min.md +++ b/reference/cstdint/int_least32_min.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define INT_LEAST32_MIN implementation-defined +#define INT_LEAST32_MIN implementation-defined ``` ## 概要 diff --git a/reference/cstdint/int_least64_max.md b/reference/cstdint/int_least64_max.md index 66297f5316..3db1b912f9 100644 --- a/reference/cstdint/int_least64_max.md +++ b/reference/cstdint/int_least64_max.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define INT_LEAST64_MAX implementation-defined +#define INT_LEAST64_MAX implementation-defined ``` ## 概要 diff --git a/reference/cstdint/int_least64_min.md b/reference/cstdint/int_least64_min.md index d5868cf165..65e183a22a 100644 --- a/reference/cstdint/int_least64_min.md +++ b/reference/cstdint/int_least64_min.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define INT_LEAST64_MIN implementation-defined +#define INT_LEAST64_MIN implementation-defined ``` ## 概要 diff --git a/reference/cstdint/int_least8_max.md b/reference/cstdint/int_least8_max.md index d18bffb7c6..fa442ddff7 100644 --- a/reference/cstdint/int_least8_max.md +++ b/reference/cstdint/int_least8_max.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define INT_LEAST8_MAX implementation-defined +#define INT_LEAST8_MAX implementation-defined ``` ## 概要 diff --git a/reference/cstdint/int_least8_min.md b/reference/cstdint/int_least8_min.md index 52d83d0fbd..68b1f059d9 100644 --- a/reference/cstdint/int_least8_min.md +++ b/reference/cstdint/int_least8_min.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define INT_LEAST8_MIN implementation-defined +#define INT_LEAST8_MIN implementation-defined ``` ## 概要 diff --git a/reference/cstdint/intmax_max.md b/reference/cstdint/intmax_max.md index ff6b558d2b..deb885d468 100644 --- a/reference/cstdint/intmax_max.md +++ b/reference/cstdint/intmax_max.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define INTMAX_MAX implementation-defined +#define INTMAX_MAX implementation-defined ``` ## 概要 diff --git a/reference/cstdint/intmax_min.md b/reference/cstdint/intmax_min.md index 80f772a196..68411d30e7 100644 --- a/reference/cstdint/intmax_min.md +++ b/reference/cstdint/intmax_min.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define INTMAX_MIN implementation-defined +#define INTMAX_MIN implementation-defined ``` ## 概要 diff --git a/reference/cstdint/intptr_max.md b/reference/cstdint/intptr_max.md index 47d80b5a8c..8b91b99a5a 100644 --- a/reference/cstdint/intptr_max.md +++ b/reference/cstdint/intptr_max.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define INTPTR_MAX implementation-defined +#define INTPTR_MAX implementation-defined ``` ## 概要 diff --git a/reference/cstdint/intptr_min.md b/reference/cstdint/intptr_min.md index 8d4f0da06f..0b6c1a2664 100644 --- a/reference/cstdint/intptr_min.md +++ b/reference/cstdint/intptr_min.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define INTPTR_MIN implementation-defined +#define INTPTR_MIN implementation-defined ``` ## 概要 diff --git a/reference/cstdint/ptrdiff_max.md b/reference/cstdint/ptrdiff_max.md index 9bbf244a2b..ce9d11781d 100644 --- a/reference/cstdint/ptrdiff_max.md +++ b/reference/cstdint/ptrdiff_max.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define PTRDIFF_MAX implementation-defined +#define PTRDIFF_MAX implementation-defined ``` ## 概要 diff --git a/reference/cstdint/ptrdiff_min.md b/reference/cstdint/ptrdiff_min.md index 2cb3ae8122..f0ab4244a5 100644 --- a/reference/cstdint/ptrdiff_min.md +++ b/reference/cstdint/ptrdiff_min.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define PTRDIFF_MIN implementation-defined +#define PTRDIFF_MIN implementation-defined ``` ## 概要 diff --git a/reference/cstdint/sig_atomic_max.md b/reference/cstdint/sig_atomic_max.md index 42ceab4e0a..0e3acd28af 100644 --- a/reference/cstdint/sig_atomic_max.md +++ b/reference/cstdint/sig_atomic_max.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define SIG_ATOMIC_MAX implementation-defined +#define SIG_ATOMIC_MAX implementation-defined ``` ## 概要 diff --git a/reference/cstdint/sig_atomic_min.md b/reference/cstdint/sig_atomic_min.md index 2e0e41035e..e8cbae3618 100644 --- a/reference/cstdint/sig_atomic_min.md +++ b/reference/cstdint/sig_atomic_min.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define SIG_ATOMIC_MIN implementation-defined +#define SIG_ATOMIC_MIN implementation-defined ``` ## 概要 diff --git a/reference/cstdint/size_max.md b/reference/cstdint/size_max.md index 5f18431b30..aef75e0d80 100644 --- a/reference/cstdint/size_max.md +++ b/reference/cstdint/size_max.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define SIZE_MAX implementation-defined +#define SIZE_MAX implementation-defined ``` ## 概要 diff --git a/reference/cstdint/uint16_max.md b/reference/cstdint/uint16_max.md index 79fb3b8cc9..f8f947c454 100644 --- a/reference/cstdint/uint16_max.md +++ b/reference/cstdint/uint16_max.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define UINT16_MAX implementation-defined +#define UINT16_MAX implementation-defined ``` ## 概要 diff --git a/reference/cstdint/uint32_max.md b/reference/cstdint/uint32_max.md index b8bb282f89..ec18469bc3 100644 --- a/reference/cstdint/uint32_max.md +++ b/reference/cstdint/uint32_max.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define UINT32_MAX implementation-defined +#define UINT32_MAX implementation-defined ``` ## 概要 diff --git a/reference/cstdint/uint64_max.md b/reference/cstdint/uint64_max.md index b4d4a32000..36a0e7ea6e 100644 --- a/reference/cstdint/uint64_max.md +++ b/reference/cstdint/uint64_max.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define UINT64_MAX implementation-defined +#define UINT64_MAX implementation-defined ``` ## 概要 diff --git a/reference/cstdint/uint8_max.md b/reference/cstdint/uint8_max.md index bd930cbc52..741b7aaa81 100644 --- a/reference/cstdint/uint8_max.md +++ b/reference/cstdint/uint8_max.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define UINT8_MAX implementation-defined +#define UINT8_MAX implementation-defined ``` ## 概要 diff --git a/reference/cstdint/uint_fast16_max.md b/reference/cstdint/uint_fast16_max.md index 0a6da25d9d..9e96780af6 100644 --- a/reference/cstdint/uint_fast16_max.md +++ b/reference/cstdint/uint_fast16_max.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define UINT_FAST16_MAX implementation-defined +#define UINT_FAST16_MAX implementation-defined ``` ## 概要 diff --git a/reference/cstdint/uint_fast32_max.md b/reference/cstdint/uint_fast32_max.md index 1486be9686..5aea52f7a8 100644 --- a/reference/cstdint/uint_fast32_max.md +++ b/reference/cstdint/uint_fast32_max.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define UINT_FAST32_MAX implementation-defined +#define UINT_FAST32_MAX implementation-defined ``` ## 概要 diff --git a/reference/cstdint/uint_fast64_max.md b/reference/cstdint/uint_fast64_max.md index e99ad21dab..926ddf6e14 100644 --- a/reference/cstdint/uint_fast64_max.md +++ b/reference/cstdint/uint_fast64_max.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define UINT_FAST64_MAX implementation-defined +#define UINT_FAST64_MAX implementation-defined ``` ## 概要 diff --git a/reference/cstdint/uint_fast8_max.md b/reference/cstdint/uint_fast8_max.md index e1eb4b1373..0e5d6d4103 100644 --- a/reference/cstdint/uint_fast8_max.md +++ b/reference/cstdint/uint_fast8_max.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define UINT_FAST8_MAX implementation-defined +#define UINT_FAST8_MAX implementation-defined ``` ## 概要 diff --git a/reference/cstdint/uint_least16_max.md b/reference/cstdint/uint_least16_max.md index 786d179b84..54dcabda9e 100644 --- a/reference/cstdint/uint_least16_max.md +++ b/reference/cstdint/uint_least16_max.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define UINT_LEAST16_MAX implementation-defined +#define UINT_LEAST16_MAX implementation-defined ``` ## 概要 diff --git a/reference/cstdint/uint_least32_max.md b/reference/cstdint/uint_least32_max.md index de0971649c..4a79425193 100644 --- a/reference/cstdint/uint_least32_max.md +++ b/reference/cstdint/uint_least32_max.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define UINT_LEAST32_MAX implementation-defined +#define UINT_LEAST32_MAX implementation-defined ``` ## 概要 diff --git a/reference/cstdint/uint_least64_max.md b/reference/cstdint/uint_least64_max.md index 25d63108da..3850babc73 100644 --- a/reference/cstdint/uint_least64_max.md +++ b/reference/cstdint/uint_least64_max.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define UINT_LEAST64_MAX implementation-defined +#define UINT_LEAST64_MAX implementation-defined ``` ## 概要 diff --git a/reference/cstdint/uint_least8_max.md b/reference/cstdint/uint_least8_max.md index fec8b8526f..fe6652044d 100644 --- a/reference/cstdint/uint_least8_max.md +++ b/reference/cstdint/uint_least8_max.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define UINT_LEAST8_MAX implementation-defined +#define UINT_LEAST8_MAX implementation-defined ``` ## 概要 diff --git a/reference/cstdint/uintmax_max.md b/reference/cstdint/uintmax_max.md index 4a3abc8426..e04e92e198 100644 --- a/reference/cstdint/uintmax_max.md +++ b/reference/cstdint/uintmax_max.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define UINTMAX_MAX implementation-defined +#define UINTMAX_MAX implementation-defined ``` ## 概要 diff --git a/reference/cstdint/uintptr_max.md b/reference/cstdint/uintptr_max.md index 9c4818d169..6f0f19e395 100644 --- a/reference/cstdint/uintptr_max.md +++ b/reference/cstdint/uintptr_max.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define UINTPTR_MAX implementation-defined +#define UINTPTR_MAX implementation-defined ``` ## 概要 diff --git a/reference/cstdint/wchar_max.md b/reference/cstdint/wchar_max.md index c45f4f9c4d..c1fe649f70 100644 --- a/reference/cstdint/wchar_max.md +++ b/reference/cstdint/wchar_max.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define WCHAR_MAX implementation-defined +#define WCHAR_MAX implementation-defined ``` ## 概要 diff --git a/reference/cstdint/wchar_min.md b/reference/cstdint/wchar_min.md index 20258ff8ac..a5cd455350 100644 --- a/reference/cstdint/wchar_min.md +++ b/reference/cstdint/wchar_min.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define WCHAR_MIN implementation-defined +#define WCHAR_MIN implementation-defined ``` ## 概要 diff --git a/reference/cstdint/wint_max.md b/reference/cstdint/wint_max.md index ca96b6548c..989add32e9 100644 --- a/reference/cstdint/wint_max.md +++ b/reference/cstdint/wint_max.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define WINT_MAX implementation-defined +#define WINT_MAX implementation-defined ``` ## 概要 diff --git a/reference/cstdint/wint_min.md b/reference/cstdint/wint_min.md index e1f1feace1..5ec223e853 100644 --- a/reference/cstdint/wint_min.md +++ b/reference/cstdint/wint_min.md @@ -4,7 +4,7 @@ * cpp11[meta cpp] ```cpp -# define WINT_MIN implementation-defined +#define WINT_MIN implementation-defined ``` ## 概要 diff --git a/reference/cstdlib/exit_failure.md b/reference/cstdlib/exit_failure.md index 89cf01b669..366c8e74ee 100644 --- a/reference/cstdlib/exit_failure.md +++ b/reference/cstdlib/exit_failure.md @@ -3,7 +3,7 @@ * macro[meta id-type] ```cpp -# define EXIT_FAILURE implementation-defined +#define EXIT_FAILURE implementation-defined ``` ## 概要 diff --git a/reference/cstdlib/exit_success.md b/reference/cstdlib/exit_success.md index 292fc8170a..6748ee8b57 100644 --- a/reference/cstdlib/exit_success.md +++ b/reference/cstdlib/exit_success.md @@ -3,7 +3,7 @@ * macro[meta id-type] ```cpp -# define EXIT_SUCCESS implementation-defined +#define EXIT_SUCCESS implementation-defined ``` ## 概要 diff --git a/reference/regex/basic_regex/flags.md b/reference/regex/basic_regex/flags.md index 1abb19e9f1..0011209dfd 100644 --- a/reference/regex/basic_regex/flags.md +++ b/reference/regex/basic_regex/flags.md @@ -26,7 +26,7 @@ flag_type flags() const; #include #include -# define PRINTFLAG(f, FLAG) (std::cout << #FLAG " is " << (f & std::regex_constants::FLAG ? "set" : "n +#define PRINTFLAG(f, FLAG) (std::cout << #FLAG " is " << (f & std::regex_constants::FLAG ? "set" : "n void print(std::regex_constants::syntax_option_type f) { From 3d433bb26bfedff4b177a4d403869e1dbfd775ae Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Sun, 13 Jul 2025 13:11:37 +0900 Subject: [PATCH 2232/3948] =?UTF-8?q?style(cstdlib,cstdio,format):=20?= =?UTF-8?q?=E3=83=A1=E3=82=BF=E8=AD=98=E5=88=A5=E5=AD=90=E3=81=AF=20/**/?= =?UTF-8?q?=20=E3=81=A7=E5=9B=B2=E3=81=BE=E3=81=AA=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/cpprefjp/site/pull/1470#discussion_r2203108845 * "/* implementation-defined */ => implementation-defined" の書き換え * "/* unspecified */ => unspecified" の書き換え --- reference/cstdio/eof.md | 2 +- reference/cstdio/file.md | 3 ++- reference/cstdio/filename_max.md | 2 +- reference/cstdlib/rand_max.md | 2 +- reference/format/formattable.md | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/reference/cstdio/eof.md b/reference/cstdio/eof.md index 3cda36b5b1..98152c4d0b 100644 --- a/reference/cstdio/eof.md +++ b/reference/cstdio/eof.md @@ -3,7 +3,7 @@ * macro[meta id-type] ```cpp -#define EOF /* implementation-defined */ +#define EOF implementation-defined ``` ## 概要 diff --git a/reference/cstdio/file.md b/reference/cstdio/file.md index 243769defe..37d2ac195d 100644 --- a/reference/cstdio/file.md +++ b/reference/cstdio/file.md @@ -5,9 +5,10 @@ ```cpp namespace std { - using FILE = /* unspecified */; + using FILE = unspecified; } ``` +* unspecified[italic] ## 概要 `FILE`型は、ストリームの制御に必要な情報を持つオブジェクト型である。 diff --git a/reference/cstdio/filename_max.md b/reference/cstdio/filename_max.md index 9e45023ca8..640d2278a7 100644 --- a/reference/cstdio/filename_max.md +++ b/reference/cstdio/filename_max.md @@ -3,7 +3,7 @@ * macro[meta id-type] ```cpp -#define FILENAME_MAX /* implementation-defined */ +#define FILENAME_MAX implementation-defined ``` ## 概要 diff --git a/reference/cstdlib/rand_max.md b/reference/cstdlib/rand_max.md index 5566d9d52e..48f9dd302a 100644 --- a/reference/cstdlib/rand_max.md +++ b/reference/cstdlib/rand_max.md @@ -3,7 +3,7 @@ * macro[meta id-type] ```cpp -#define RAND_MAX /*implementation-defined*/ +#define RAND_MAX implementation-defined ``` ## 概要 diff --git a/reference/format/formattable.md b/reference/format/formattable.md index 82eaaf4475..e040cd16fa 100644 --- a/reference/format/formattable.md +++ b/reference/format/formattable.md @@ -7,7 +7,7 @@ ```cpp namespace std { template - using fmt-iter-for = /* unspecified */; + using fmt-iter-for = unspecified; template concept formattable = From 99f1ebf8c771974bb862f36502174ff6247b48af Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Sun, 13 Jul 2025 14:39:17 +0900 Subject: [PATCH 2233/3948] =?UTF-8?q?fix(cpp11/variadic=5Fmacros):=20?= =?UTF-8?q?=E8=A8=80=E8=AA=9E=E6=8C=87=E5=AE=9A=20cpp=20=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=E3=83=BB=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE=E9=A3=BE?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 構文説明なので C++ としての着色は不要かもしれないが、着色しても問題な いような気がするので。 --- lang/cpp11/variadic_macros.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lang/cpp11/variadic_macros.md b/lang/cpp11/variadic_macros.md index 6e8c084119..3525940f02 100644 --- a/lang/cpp11/variadic_macros.md +++ b/lang/cpp11/variadic_macros.md @@ -20,10 +20,14 @@ C99互換として、可変引数マクロ(variadic macros)が導入された。 可変引数マクロは、以下の構文を持つ: -``` +```cpp #define identifier ( ... ) replacement-list new-line #define identifier ( identifier-list , ... ) replacement-list new-line ``` +* identifier-list[italic] +* identifier[italic] +* replacement-list[italic] +* new-line[italic] 1行目は、パラメータ全てを可変個受け取る場合。2行目は、先頭のいくつかのパラメータを名前付きで受け取り、それ以外に可変個のパラメータを受け取る場合。 From da83049f02494ae11e27bf3a0a74d0afc2acc029 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Sun, 13 Jul 2025 15:17:26 +0900 Subject: [PATCH 2234/3948] =?UTF-8?q?fix(c*):=20=E5=87=A6=E7=90=86?= =?UTF-8?q?=E7=B3=BB=E5=AE=9A=E7=BE=A9=E3=81=A7=E3=81=AA=E3=81=84=E3=81=AE?= =?UTF-8?q?=E3=81=AB=20implementation-defined=20=E3=81=AB=E3=81=AA?= =?UTF-8?q?=E3=81=A3=E3=81=A6=E3=81=84=E3=82=8B=E3=82=82=E3=81=AE=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * マクロ定数の式の種類についてC言語規格の記述を反映 * 型についてはC言語規格で言及されている型の種類を反映 * その他のものは unspecified に書き換え --- reference/cerrno/errno.md | 3 ++- reference/cfenv/fe_all_except.md | 3 ++- reference/cfenv/fe_divbyzero.md | 3 ++- reference/cfenv/fe_downward.md | 3 ++- reference/cfenv/fe_inexact.md | 3 ++- reference/cfenv/fe_invalid.md | 3 ++- reference/cfenv/fe_overflow.md | 3 ++- reference/cfenv/fe_tonearest.md | 3 ++- reference/cfenv/fe_towardzero.md | 3 ++- reference/cfenv/fe_underflow.md | 3 ++- reference/cfenv/fe_upward.md | 3 ++- reference/cfenv/fexcept_t.md | 3 ++- reference/cmath/double_t.md | 3 ++- reference/cmath/float_t.md | 3 ++- reference/cmath/fp_ilogb0.md | 4 ++-- reference/cmath/fp_ilogbnan.md | 4 ++-- reference/cmath/fp_infinite.md | 4 ++-- reference/cmath/fp_nan.md | 4 ++-- reference/cmath/fp_normal.md | 4 ++-- reference/cmath/fp_subnormal.md | 4 ++-- reference/cmath/fp_zero.md | 4 ++-- reference/cmath/huge_val.md | 3 ++- reference/cmath/huge_valf.md | 3 ++- reference/cmath/huge_vall.md | 3 ++- reference/cmath/infinity.md | 3 ++- reference/cmath/nan.md | 4 ++-- reference/cstddef/max_align_t.md | 3 ++- reference/cstddef/offsetof.md | 4 ++-- reference/cstddef/ptrdiff_t.md | 3 ++- reference/cstddef/size_t.md | 3 ++- reference/cstdlib/mb_cur_max.md | 3 ++- reference/ctime/time_t.md | 5 ++++- 32 files changed, 66 insertions(+), 41 deletions(-) diff --git a/reference/cerrno/errno.md b/reference/cerrno/errno.md index d3badf597b..8a0460665d 100644 --- a/reference/cerrno/errno.md +++ b/reference/cerrno/errno.md @@ -3,8 +3,9 @@ * macro[meta id-type] ```cpp -#define errno implementation-defined +#define errno unspecified ``` +* unspecified[italic] ## 概要 `errno` は、標準ライブラリのエラー状態を表すマクロである。 diff --git a/reference/cfenv/fe_all_except.md b/reference/cfenv/fe_all_except.md index c7d4159b92..93d2ac031f 100644 --- a/reference/cfenv/fe_all_except.md +++ b/reference/cfenv/fe_all_except.md @@ -4,8 +4,9 @@ * cpp11[meta cpp] ```cpp -#define FE_ALL_EXCEPT implementation-defined +#define FE_ALL_EXCEPT unspecified ``` +* unspecified[italic] ## 概要 全ての浮動小数点例外マクロをビットORでつなぐことによって実装で定義されるマクロ。 diff --git a/reference/cfenv/fe_divbyzero.md b/reference/cfenv/fe_divbyzero.md index 97b2dd8a60..c40429d2bb 100644 --- a/reference/cfenv/fe_divbyzero.md +++ b/reference/cfenv/fe_divbyzero.md @@ -4,8 +4,9 @@ * cpp11[meta cpp] ```cpp -#define FE_DIVBYZERO implementation-defined +#define FE_DIVBYZERO integer-constant-expression ``` +* integer-constant-expression[italic] ## 概要 浮動小数点数に対してゼロで除算されたことを表す浮動小数点例外の種類。 diff --git a/reference/cfenv/fe_downward.md b/reference/cfenv/fe_downward.md index 8aa5169fc0..3791056b63 100644 --- a/reference/cfenv/fe_downward.md +++ b/reference/cfenv/fe_downward.md @@ -4,8 +4,9 @@ * cpp11[meta cpp] ```cpp -#define FE_DOWNWARD implementation-defined +#define FE_DOWNWARD integer-constant-expression ``` +* integer-constant-expression[italic] ## 概要 浮動小数点数の丸め方式として、「負の無限大方向への丸め (切り下げ, floor, round down)」を表すマクロ。 diff --git a/reference/cfenv/fe_inexact.md b/reference/cfenv/fe_inexact.md index 6fbfdde5fe..214919104b 100644 --- a/reference/cfenv/fe_inexact.md +++ b/reference/cfenv/fe_inexact.md @@ -4,8 +4,9 @@ * cpp11[meta cpp] ```cpp -#define FE_INEXACT implementation-defined +#define FE_INEXACT integer-constant-expression ``` +* integer-constant-expression[italic] ## 概要 浮動小数点数の演算が不正確な結果となったことを表す浮動小数点例外の種類。 diff --git a/reference/cfenv/fe_invalid.md b/reference/cfenv/fe_invalid.md index a015347a19..1dd7ae231c 100644 --- a/reference/cfenv/fe_invalid.md +++ b/reference/cfenv/fe_invalid.md @@ -4,8 +4,9 @@ * cpp11[meta cpp] ```cpp -#define FE_INVALID implementation-defined +#define FE_INVALID integer-constant-expression ``` +* integer-constant-expression[italic] ## 概要 浮動小数点数に対して不正な操作を行ったことを表す浮動小数点例外の種類。 diff --git a/reference/cfenv/fe_overflow.md b/reference/cfenv/fe_overflow.md index 4ff0bdbd0e..87a621ef48 100644 --- a/reference/cfenv/fe_overflow.md +++ b/reference/cfenv/fe_overflow.md @@ -4,8 +4,9 @@ * cpp11[meta cpp] ```cpp -#define FE_OVERFLOW implementation-defined +#define FE_OVERFLOW integer-constant-expression ``` +* integer-constant-expression[italic] ## 概要 浮動小数点数の演算でオーバーフローが発生したことを表す浮動小数点例外の種類。 diff --git a/reference/cfenv/fe_tonearest.md b/reference/cfenv/fe_tonearest.md index 1ce5fd2004..039ab07030 100644 --- a/reference/cfenv/fe_tonearest.md +++ b/reference/cfenv/fe_tonearest.md @@ -4,8 +4,9 @@ * cpp11[meta cpp] ```cpp -#define FE_TONEAREST implementation-defined +#define FE_TONEAREST integer-constant-expression ``` +* integer-constant-expression[italic] ## 概要 浮動小数点数の丸め方式として、「最も近い値への丸め (round to nearest)」を表すマクロ。 diff --git a/reference/cfenv/fe_towardzero.md b/reference/cfenv/fe_towardzero.md index 3847072da2..59850140b8 100644 --- a/reference/cfenv/fe_towardzero.md +++ b/reference/cfenv/fe_towardzero.md @@ -4,8 +4,9 @@ * cpp11[meta cpp] ```cpp -#define FE_TOWARDZERO implementation-defined +#define FE_TOWARDZERO integer-constant-expression ``` +* integer-constant-expression[italic] ## 概要 浮動小数点数の丸め方式として、「ゼロ方向への丸め (切り捨て, trunc)」を表すマクロ。 diff --git a/reference/cfenv/fe_underflow.md b/reference/cfenv/fe_underflow.md index 94660cdf30..4fdc0ee462 100644 --- a/reference/cfenv/fe_underflow.md +++ b/reference/cfenv/fe_underflow.md @@ -4,8 +4,9 @@ * cpp11[meta cpp] ```cpp -#define FE_UNDERFLOW implementation-defined +#define FE_UNDERFLOW integer-constant-expression ``` +* integer-constant-expression[italic] ## 概要 浮動小数点数の演算でアンダーフローが発生したことを表す浮動小数点例外の種類。 diff --git a/reference/cfenv/fe_upward.md b/reference/cfenv/fe_upward.md index 52f82e09e6..24c867ba7e 100644 --- a/reference/cfenv/fe_upward.md +++ b/reference/cfenv/fe_upward.md @@ -4,8 +4,9 @@ * cpp11[meta cpp] ```cpp -#define FE_UPWARD implementation-defined +#define FE_UPWARD integer-constant-expression ``` +* integer-constant-expression[italic] ## 概要 浮動小数点数の丸め方式として、「正の無限大方向への丸め (切り上げ, ceil, round up)」を表すマクロ。 diff --git a/reference/cfenv/fexcept_t.md b/reference/cfenv/fexcept_t.md index 2c5b4dcdfe..7b579b8e0e 100644 --- a/reference/cfenv/fexcept_t.md +++ b/reference/cfenv/fexcept_t.md @@ -6,9 +6,10 @@ ```cpp namespace std { - using fexcept_t = implementation-defined; + using fexcept_t = unspecified; } ``` +* unspecified[italic] ## 概要 実装が持つ浮動小数点例外の状態フラグを表す型。 diff --git a/reference/cmath/double_t.md b/reference/cmath/double_t.md index 57ea716c51..f0b1441be7 100644 --- a/reference/cmath/double_t.md +++ b/reference/cmath/double_t.md @@ -6,9 +6,10 @@ ```cpp namespace std { - using double_t = implementation-defined; + using double_t = floating-type; } ``` +* floating-type[italic] ## 概要 `double` と同じかそれより広い範囲の値を持つ浮動小数点数型を表す。 diff --git a/reference/cmath/float_t.md b/reference/cmath/float_t.md index d05aa527b4..c63a8260ad 100644 --- a/reference/cmath/float_t.md +++ b/reference/cmath/float_t.md @@ -6,9 +6,10 @@ ```cpp namespace std { - using float_t = implementation-defined; + using float_t = floating-type; } ``` +* floating-type[italic] ## 概要 `float` と同じかそれより広い範囲の値を持つ浮動小数点数型を表す。 diff --git a/reference/cmath/fp_ilogb0.md b/reference/cmath/fp_ilogb0.md index ea747b6219..1c20eb7a11 100644 --- a/reference/cmath/fp_ilogb0.md +++ b/reference/cmath/fp_ilogb0.md @@ -4,9 +4,9 @@ * cpp11[meta cpp] ```cpp -#define FP_ILOGB0 implementation_defined +#define FP_ILOGB0 integer-constant-expression ``` -* implementation_defined[italic] +* integer-constant-expression[italic] ## 概要 `FP_ILOGB0` は、[`std::ilogb`](ilogb.md)`(0)` の戻り値を表す整数定数式である。 diff --git a/reference/cmath/fp_ilogbnan.md b/reference/cmath/fp_ilogbnan.md index dac15985cc..9f13217ea0 100644 --- a/reference/cmath/fp_ilogbnan.md +++ b/reference/cmath/fp_ilogbnan.md @@ -4,9 +4,9 @@ * cpp11[meta cpp] ```cpp -#define FP_ILOGBNAN implementation_defined +#define FP_ILOGBNAN integer-constant-expression ``` -* implementation_defined[italic] +* integer-constant-expression[italic] ## 概要 `FP_ILOGBNAN` は、[`std::ilogb()`](ilogb.md) に `NaN` を渡したときの戻り値を表す整数定数式である。 diff --git a/reference/cmath/fp_infinite.md b/reference/cmath/fp_infinite.md index adfd5b925e..755ac6bc1f 100644 --- a/reference/cmath/fp_infinite.md +++ b/reference/cmath/fp_infinite.md @@ -4,9 +4,9 @@ * cpp11[meta cpp] ```cpp -#define FP_INFINITE integer_constant_expression +#define FP_INFINITE integer-constant-expression ``` -* integer_constant_expression[italic] +* integer-constant-expression[italic] ## 概要 浮動小数点数が(正または負の)無限大であることを表す整数定数式。 diff --git a/reference/cmath/fp_nan.md b/reference/cmath/fp_nan.md index ac5bf9cc39..d681b3a44c 100644 --- a/reference/cmath/fp_nan.md +++ b/reference/cmath/fp_nan.md @@ -4,9 +4,9 @@ * cpp11[meta cpp] ```cpp -#define FP_NAN integer_constant_expression +#define FP_NAN integer-constant-expression ``` -* integer_constant_expression[italic] +* integer-constant-expression[italic] ## 概要 浮動小数点数が `NaN` であることを表すを表す整数定数式。 diff --git a/reference/cmath/fp_normal.md b/reference/cmath/fp_normal.md index 5d91287811..35f1621cbf 100644 --- a/reference/cmath/fp_normal.md +++ b/reference/cmath/fp_normal.md @@ -4,9 +4,9 @@ * cpp11[meta cpp] ```cpp -#define FP_NORMAL integer_constant_expression +#define FP_NORMAL integer-constant-expression ``` -* integer_constant_expression[italic] +* integer-constant-expression[italic] ## 概要 浮動小数点数が正規化数であることを表す整数定数式。 diff --git a/reference/cmath/fp_subnormal.md b/reference/cmath/fp_subnormal.md index c011449b64..e8ffdff3c5 100644 --- a/reference/cmath/fp_subnormal.md +++ b/reference/cmath/fp_subnormal.md @@ -4,9 +4,9 @@ * cpp11[meta cpp] ```cpp -#define FP_SUBNORMAL integer_constant_expression +#define FP_SUBNORMAL integer-constant-expression ``` -* integer_constant_expression[italic] +* integer-constant-expression[italic] ## 概要 浮動小数点数が非正規化数であることを表す整数定数式。 diff --git a/reference/cmath/fp_zero.md b/reference/cmath/fp_zero.md index bdcdcd0478..1bfc9d646b 100644 --- a/reference/cmath/fp_zero.md +++ b/reference/cmath/fp_zero.md @@ -4,9 +4,9 @@ * cpp11[meta cpp] ```cpp -#define FP_ZERO integer_constant_expression +#define FP_ZERO integer-constant-expression ``` -* integer_constant_expression[italic] +* integer-constant-expression[italic] ## 概要 浮動小数点数が(正または負の) 0 であることを表す整数定数式。 diff --git a/reference/cmath/huge_val.md b/reference/cmath/huge_val.md index c2bccc8d9d..ab97b18797 100644 --- a/reference/cmath/huge_val.md +++ b/reference/cmath/huge_val.md @@ -3,8 +3,9 @@ * macro[meta id-type] ```cpp -#define HUGE_VAL implementation-defined +#define HUGE_VAL constant-expression ``` +* constant-expression[italic] ## 概要 `double` 型の正の値の定数式。 diff --git a/reference/cmath/huge_valf.md b/reference/cmath/huge_valf.md index c335721e97..af0e691854 100644 --- a/reference/cmath/huge_valf.md +++ b/reference/cmath/huge_valf.md @@ -4,8 +4,9 @@ * cpp11[meta cpp] ```cpp -#define HUGE_VALF implementation-defined +#define HUGE_VALF constant-expression ``` +* constant-expression[italic] ## 概要 `float` 型の正の値の定数式。 diff --git a/reference/cmath/huge_vall.md b/reference/cmath/huge_vall.md index 87974c6fe9..edff3f4736 100644 --- a/reference/cmath/huge_vall.md +++ b/reference/cmath/huge_vall.md @@ -4,8 +4,9 @@ * cpp11[meta cpp] ```cpp -#define HUGE_VALL implementation-defined +#define HUGE_VALL constant-expression ``` +* constant-expression[italic] ## 概要 `long double` 型の正の値の定数式。 diff --git a/reference/cmath/infinity.md b/reference/cmath/infinity.md index c54fd23c83..56f223c8a5 100644 --- a/reference/cmath/infinity.md +++ b/reference/cmath/infinity.md @@ -4,8 +4,9 @@ * cpp11[meta cpp] ```cpp -#define INFINITY some_expression +#define INFINITY constant-expression ``` +* constant-expression[italic] ## 概要 `float` の無限大がサポートされる場合、`float` 型の正の無限大である。 diff --git a/reference/cmath/nan.md b/reference/cmath/nan.md index f27fd5ebef..7f5baa3be1 100644 --- a/reference/cmath/nan.md +++ b/reference/cmath/nan.md @@ -4,9 +4,9 @@ * cpp11[meta cpp] ```cpp -#define NAN constant_expression +#define NAN constant-expression ``` -* constant_expression[italic] +* constant-expression[italic] ## 概要 `NaN`(Not a Number, 非数) がサポートされる場合、`float` の `quiet NaN` の定数式に展開される。 diff --git a/reference/cstddef/max_align_t.md b/reference/cstddef/max_align_t.md index 0c04c6d608..be64e1a27f 100644 --- a/reference/cstddef/max_align_t.md +++ b/reference/cstddef/max_align_t.md @@ -6,9 +6,10 @@ ```cpp namespace std { - using max_align_t = implementation-defined; + using max_align_t = object-type; } ``` +* object-type[italic] ## 概要 `std::max_align_t`のアライメントサイズは、スカラー型の中の最も大きなアライメントサイズと同じかそれ以上である。 diff --git a/reference/cstddef/offsetof.md b/reference/cstddef/offsetof.md index 0f2c5e56b2..f8a757c7f6 100644 --- a/reference/cstddef/offsetof.md +++ b/reference/cstddef/offsetof.md @@ -3,9 +3,9 @@ * macro[meta id-type] ```cpp -#define offsetof(type, member) see-below +#define offsetof(type, member) integer-constant-expression ``` -* see-below[italic] +* integer-constant-expression[italic] ## 概要 このマクロ関数は、構造体型 `type` のメンバ `member` へのオフセット値をバイト数で返す。 diff --git a/reference/cstddef/ptrdiff_t.md b/reference/cstddef/ptrdiff_t.md index a61cb3231f..997f741828 100644 --- a/reference/cstddef/ptrdiff_t.md +++ b/reference/cstddef/ptrdiff_t.md @@ -5,9 +5,10 @@ ```cpp namespace std { - using ptrdiff_t = implementation-defined; + using ptrdiff_t = signed-integer-type; } ``` +* signed-integer-type[italic] ## 概要 `ptrdiff_t`は、2 つのポインタの減算の結果を示す型である。これは符号付き整数型であり、互換性のある単純データ型へキャストすることができる。 diff --git a/reference/cstddef/size_t.md b/reference/cstddef/size_t.md index 55cd26b59d..d2e450a918 100644 --- a/reference/cstddef/size_t.md +++ b/reference/cstddef/size_t.md @@ -5,9 +5,10 @@ ```cpp namespace std { - using size_t = implementation-defined; + using size_t = unsigned-integer-type; } ``` +* unsigned-integer-type[italic] ## 概要 `size_t`は、オブジェクトのバイト数を表現できる程度に十分に大きい符号なし整数型である。 diff --git a/reference/cstdlib/mb_cur_max.md b/reference/cstdlib/mb_cur_max.md index 3872e41c31..f3bb3fafa4 100644 --- a/reference/cstdlib/mb_cur_max.md +++ b/reference/cstdlib/mb_cur_max.md @@ -3,8 +3,9 @@ * macro[meta id-type] ```cpp -#define MB_CUR_MAX implementation-defined +#define MB_CUR_MAX positive-integer-expression ``` +* positive-integer-expression[italic] ## 概要 現在のロケールのマルチバイト文字の最大バイト数を示すマクロ。 diff --git a/reference/ctime/time_t.md b/reference/ctime/time_t.md index bcaf6ab18a..e979350586 100644 --- a/reference/ctime/time_t.md +++ b/reference/ctime/time_t.md @@ -5,9 +5,12 @@ ```cpp namespace std { - using time_t = implementation-defined; + using time_t = integer-type; // C++11 (C99) 以前 + using time_t = real-type; // C++14 (C11) 以降 } ``` +* integer-type[italic] +* real-type[italic] ## 概要 `time_t`は、1970年1月1日からの経過時間 (UNIX時間と呼ばれる) を表すための、算術型の別名である。 From 73c9263ea914a26ee06df0ada770e719fc84564d Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Sun, 13 Jul 2025 15:24:50 +0900 Subject: [PATCH 2235/3948] =?UTF-8?q?fix(cmath):=20=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E4=BB=98=E3=81=8D=E3=81=A7=E5=AE=9A=E7=BE=A9=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=82=8B=E3=83=9E=E3=82=AF=E3=83=AD=E3=81=AB=E3=81=A4=E3=81=84?= =?UTF-8?q?=E3=81=A6=20#undef=20=E3=81=AE=E5=A0=B4=E5=90=88=E3=82=82?= =?UTF-8?q?=E8=BF=BD=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cfenv/fe_divbyzero.md | 5 ++++- reference/cfenv/fe_downward.md | 5 ++++- reference/cfenv/fe_inexact.md | 5 ++++- reference/cfenv/fe_invalid.md | 5 ++++- reference/cfenv/fe_overflow.md | 5 ++++- reference/cfenv/fe_tonearest.md | 5 ++++- reference/cfenv/fe_towardzero.md | 5 ++++- reference/cfenv/fe_underflow.md | 5 ++++- reference/cfenv/fe_upward.md | 5 ++++- reference/cmath/fp_fast_fma.md | 2 ++ reference/cmath/fp_fast_fmaf.md | 2 ++ reference/cmath/fp_fast_fmal.md | 2 ++ reference/cmath/nan.md | 5 ++++- 13 files changed, 46 insertions(+), 10 deletions(-) diff --git a/reference/cfenv/fe_divbyzero.md b/reference/cfenv/fe_divbyzero.md index c40429d2bb..56bf1bf3e1 100644 --- a/reference/cfenv/fe_divbyzero.md +++ b/reference/cfenv/fe_divbyzero.md @@ -5,6 +5,8 @@ ```cpp #define FE_DIVBYZERO integer-constant-expression +// または +#undef FE_DIVBYZERO ``` * integer-constant-expression[italic] @@ -13,7 +15,8 @@ 「DIVBYZERO」は「divide-by-zero (ゼロによる除算)」の略称である。 -このマクロは、浮動小数点例外の状態を表すビット値である。他の浮動小数点例外マクロとAND (`&`) や OR (`|`)を使用して、複数のマクロを組み合わせて使用できる。 +処理系がこの浮動小数点例外に対応している場合にこのマクロが定義される。 +マクロが定義されるとき、このマクロは浮動小数点例外の状態を表すビット値である。他の浮動小数点例外マクロとAND (`&`) や OR (`|`)を使用して、複数のマクロを組み合わせて使用できる。 ## 例 ```cpp example diff --git a/reference/cfenv/fe_downward.md b/reference/cfenv/fe_downward.md index 3791056b63..d138e1b120 100644 --- a/reference/cfenv/fe_downward.md +++ b/reference/cfenv/fe_downward.md @@ -5,6 +5,8 @@ ```cpp #define FE_DOWNWARD integer-constant-expression +// または +#undef FE_DOWNWARD ``` * integer-constant-expression[italic] @@ -13,7 +15,8 @@ このマクロは、標準ライブラリの丸め処理で使用される丸め方式をユーザーが選択するために使用する。 -このマクロの値は、整数の定数式として定義され、非負の値を持つ。 +処理系がこの丸め方式に対応している場合にこのマクロが定義される。 +マクロが定義されるとき、このマクロの値は整数の定数式になり、非負の値を持つ。 ## 例 diff --git a/reference/cfenv/fe_inexact.md b/reference/cfenv/fe_inexact.md index 214919104b..fb1bd7cdbd 100644 --- a/reference/cfenv/fe_inexact.md +++ b/reference/cfenv/fe_inexact.md @@ -5,13 +5,16 @@ ```cpp #define FE_INEXACT integer-constant-expression +// または +#undef FE_INEXACT ``` * integer-constant-expression[italic] ## 概要 浮動小数点数の演算が不正確な結果となったことを表す浮動小数点例外の種類。 -このマクロは、浮動小数点例外の状態を表すビット値である。他の浮動小数点例外マクロとAND (`&`) や OR (`|`)を使用して、複数のマクロを組み合わせて使用できる。 +処理系がこの浮動小数点例外に対応している場合にこのマクロが定義される。 +マクロが定義されるとき、このマクロは浮動小数点例外の状態を表すビット値である。他の浮動小数点例外マクロとAND (`&`) や OR (`|`)を使用して、複数のマクロを組み合わせて使用できる。 ## 例 ```cpp example diff --git a/reference/cfenv/fe_invalid.md b/reference/cfenv/fe_invalid.md index 1dd7ae231c..88241b1802 100644 --- a/reference/cfenv/fe_invalid.md +++ b/reference/cfenv/fe_invalid.md @@ -5,13 +5,16 @@ ```cpp #define FE_INVALID integer-constant-expression +// または +#undef FE_INVALID ``` * integer-constant-expression[italic] ## 概要 浮動小数点数に対して不正な操作を行ったことを表す浮動小数点例外の種類。 -このマクロは、浮動小数点例外の状態を表すビット値である。他の浮動小数点例外マクロとAND (`&`) や OR (`|`)を使用して、複数のマクロを組み合わせて使用できる。 +処理系がこの浮動小数点例外に対応している場合にこのマクロが定義される。 +マクロが定義されるとき、このマクロは浮動小数点例外の状態を表すビット値である。他の浮動小数点例外マクロとAND (`&`) や OR (`|`)を使用して、複数のマクロを組み合わせて使用できる。 ## 例 ```cpp example diff --git a/reference/cfenv/fe_overflow.md b/reference/cfenv/fe_overflow.md index 87a621ef48..a9f0def585 100644 --- a/reference/cfenv/fe_overflow.md +++ b/reference/cfenv/fe_overflow.md @@ -5,13 +5,16 @@ ```cpp #define FE_OVERFLOW integer-constant-expression +// または +#undef FE_OVERFLOW ``` * integer-constant-expression[italic] ## 概要 浮動小数点数の演算でオーバーフローが発生したことを表す浮動小数点例外の種類。 -このマクロは、浮動小数点例外の状態を表すビット値である。他の浮動小数点例外マクロとAND (`&`) や OR (`|`)を使用して、複数のマクロを組み合わせて使用できる。 +処理系がこの浮動小数点例外に対応している場合にこのマクロが定義される。 +マクロが定義されるとき、このマクロは浮動小数点例外の状態を表すビット値である。他の浮動小数点例外マクロとAND (`&`) や OR (`|`)を使用して、複数のマクロを組み合わせて使用できる。 ## 例 ```cpp example diff --git a/reference/cfenv/fe_tonearest.md b/reference/cfenv/fe_tonearest.md index 039ab07030..baf9d47b59 100644 --- a/reference/cfenv/fe_tonearest.md +++ b/reference/cfenv/fe_tonearest.md @@ -5,6 +5,8 @@ ```cpp #define FE_TONEAREST integer-constant-expression +// または +#undef FE_TONEAREST ``` * integer-constant-expression[italic] @@ -15,7 +17,8 @@ このマクロは、標準ライブラリの丸め処理で使用される丸め方式をユーザーが選択するために使用する。 -このマクロの値は、整数の定数式として定義され、非負の値を持つ。 +処理系がこの丸め方式に対応している場合にこのマクロが定義される。 +マクロが定義されるとき、このマクロの値は整数の定数式になり、非負の値を持つ。 ## 備考 diff --git a/reference/cfenv/fe_towardzero.md b/reference/cfenv/fe_towardzero.md index 59850140b8..dfdae7884a 100644 --- a/reference/cfenv/fe_towardzero.md +++ b/reference/cfenv/fe_towardzero.md @@ -5,6 +5,8 @@ ```cpp #define FE_TOWARDZERO integer-constant-expression +// または +#undef FE_TOWARDZERO ``` * integer-constant-expression[italic] @@ -13,7 +15,8 @@ このマクロは、標準ライブラリの丸め処理で使用される丸め方式をユーザーが選択するために使用する。 -このマクロの値は、整数の定数式として定義され、非負の値を持つ。 +処理系がこの丸め方式に対応している場合にこのマクロが定義される。 +マクロが定義されるとき、このマクロの値は整数の定数式になり、非負の値を持つ。 ## 例 diff --git a/reference/cfenv/fe_underflow.md b/reference/cfenv/fe_underflow.md index 4fdc0ee462..821fedaede 100644 --- a/reference/cfenv/fe_underflow.md +++ b/reference/cfenv/fe_underflow.md @@ -5,13 +5,16 @@ ```cpp #define FE_UNDERFLOW integer-constant-expression +// または +#undef FE_UNDERFLOW ``` * integer-constant-expression[italic] ## 概要 浮動小数点数の演算でアンダーフローが発生したことを表す浮動小数点例外の種類。 -このマクロは、浮動小数点例外の状態を表すビット値である。他の浮動小数点例外マクロとAND (`&`) や OR (`|`)を使用して、複数のマクロを組み合わせて使用できる。 +処理系がこの浮動小数点例外に対応している場合にこのマクロが定義される。 +マクロが定義されるとき、このマクロは浮動小数点例外の状態を表すビット値である。他の浮動小数点例外マクロとAND (`&`) や OR (`|`)を使用して、複数のマクロを組み合わせて使用できる。 ## 例 ```cpp example diff --git a/reference/cfenv/fe_upward.md b/reference/cfenv/fe_upward.md index 24c867ba7e..718cd5bbd3 100644 --- a/reference/cfenv/fe_upward.md +++ b/reference/cfenv/fe_upward.md @@ -5,6 +5,8 @@ ```cpp #define FE_UPWARD integer-constant-expression +// または +#undef FE_UPWARD ``` * integer-constant-expression[italic] @@ -13,7 +15,8 @@ このマクロは、標準ライブラリの丸め処理で使用される丸め方式をユーザーが選択するために使用する。 -このマクロの値は、整数の定数式として定義され、非負の値を持つ。 +処理系がこの丸め方式に対応している場合にこのマクロが定義される。 +マクロが定義されるとき、このマクロの値は整数の定数式になり、非負の値を持つ。 ## 例 diff --git a/reference/cmath/fp_fast_fma.md b/reference/cmath/fp_fast_fma.md index 4e23d72289..87e592dd50 100644 --- a/reference/cmath/fp_fast_fma.md +++ b/reference/cmath/fp_fast_fma.md @@ -5,6 +5,8 @@ ```cpp #define FP_FAST_FMA 1 +// または +#undef FP_FAST_FMA ``` ## 概要 diff --git a/reference/cmath/fp_fast_fmaf.md b/reference/cmath/fp_fast_fmaf.md index 045ef8e008..74527dfe65 100644 --- a/reference/cmath/fp_fast_fmaf.md +++ b/reference/cmath/fp_fast_fmaf.md @@ -5,6 +5,8 @@ ```cpp #define FP_FAST_FMAF 1 +// または +#undef FP_FAST_FMAF ``` ## 概要 diff --git a/reference/cmath/fp_fast_fmal.md b/reference/cmath/fp_fast_fmal.md index 819924966a..37dd439229 100644 --- a/reference/cmath/fp_fast_fmal.md +++ b/reference/cmath/fp_fast_fmal.md @@ -5,6 +5,8 @@ ```cpp #define FP_FAST_FMAL 1 +// または +#undef FP_FAST_FMAL ``` ## 概要 diff --git a/reference/cmath/nan.md b/reference/cmath/nan.md index 7f5baa3be1..c623e65f3f 100644 --- a/reference/cmath/nan.md +++ b/reference/cmath/nan.md @@ -5,11 +5,14 @@ ```cpp #define NAN constant-expression +// または +#undef NAN ``` * constant-expression[italic] ## 概要 -`NaN`(Not a Number, 非数) がサポートされる場合、`float` の `quiet NaN` の定数式に展開される。 +処理系が `float` 型の quiet NaN (Not a Number, 非数) に対応している場合に定義される。 +`float` の quiet NaN の定数式に展開される。 ## バージョン From 2761b7cf19cfd565ed67008ee0f5ccce1d83e859 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 14 Jul 2025 20:54:35 +0900 Subject: [PATCH 2236/3948] =?UTF-8?q?fix(cmath,cfenv):=20=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E4=BF=AE=E9=A3=BE=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=E3=83=BB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cfenv/fexcept_t.md | 2 +- reference/cmath/double_t.md | 1 + reference/cmath/float_t.md | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/reference/cfenv/fexcept_t.md b/reference/cfenv/fexcept_t.md index 7b579b8e0e..153ffe274b 100644 --- a/reference/cfenv/fexcept_t.md +++ b/reference/cfenv/fexcept_t.md @@ -37,7 +37,7 @@ int main() } } ``` -* fexcept_t[color ff0000] +* std::fexcept_t[color ff0000] * std::fegetexceptflag[link fegetexceptflag.md] * FE_ALL_EXCEPT[link fe_all_except.md] diff --git a/reference/cmath/double_t.md b/reference/cmath/double_t.md index f0b1441be7..804f17b823 100644 --- a/reference/cmath/double_t.md +++ b/reference/cmath/double_t.md @@ -25,6 +25,7 @@ int main() { std::cout << num << std::endl; } ``` +* std::double_t[color ff0000] ## 出力例 ``` diff --git a/reference/cmath/float_t.md b/reference/cmath/float_t.md index c63a8260ad..dd6a4bd1ff 100644 --- a/reference/cmath/float_t.md +++ b/reference/cmath/float_t.md @@ -25,6 +25,8 @@ int main() { std::cout << num << std::endl; } ``` +* std::float_t[color ff0000] + ## 出力例 ``` 1.01 From f92deddede4f55c27ebd6be678617cca3c91c4aa Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 14 Jul 2025 20:58:53 +0900 Subject: [PATCH 2237/3948] =?UTF-8?q?style(algorithm,cmath):=20"##=20{?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=20=3D>=20}=E4=BE=8B"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_reverse_copy.md | 2 +- reference/algorithm/reverse_copy.md | 2 +- reference/cmath/double_t.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/algorithm/ranges_reverse_copy.md b/reference/algorithm/ranges_reverse_copy.md index 40cffaef98..c0370b15d2 100644 --- a/reference/algorithm/ranges_reverse_copy.md +++ b/reference/algorithm/ranges_reverse_copy.md @@ -51,7 +51,7 @@ namespace std::ranges { 正確に `last - first` 回代入する -## 使用例 +## 例 ```cpp example #include #include diff --git a/reference/algorithm/reverse_copy.md b/reference/algorithm/reverse_copy.md index 6c8a9f7c98..18dbbb6f95 100644 --- a/reference/algorithm/reverse_copy.md +++ b/reference/algorithm/reverse_copy.md @@ -46,7 +46,7 @@ namespace std { 正確に `last - first` 回代入する -## 使用例 +## 例 ```cpp example #include #include diff --git a/reference/cmath/double_t.md b/reference/cmath/double_t.md index 804f17b823..8086636d83 100644 --- a/reference/cmath/double_t.md +++ b/reference/cmath/double_t.md @@ -16,7 +16,7 @@ namespace std { [`FLT_EVAL_METHOD`](/reference/cfloat/flt_eval_method.md) が 0 または 1 のとき `double`, 2 のとき `long double`, それ以外の場合は実装依存。 -## 使用例 +## 例 ```cpp example #include #include From cbe4f356601c0cd5cd97d5239179914927df9354 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 14 Jul 2025 21:13:27 +0900 Subject: [PATCH 2238/3948] =?UTF-8?q?fix(filesystem):=20=E9=96=A2=E6=95=B0?= =?UTF-8?q?=E4=BB=95=E6=A7=98=E3=81=AE=E5=8D=98=E7=B4=94=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit エラーだったら ec を設定し、それ以外だったら ec.clear() にするのは既に status(p, ec), symlink_status(p, ec) が実施しているので、改めて呼び出 し元で設定する必要はないように思われる。 std::filesystem::exists に関しては status_known (つまり s.type() == std::filesystem::file_type::none) 以外の時は ec.clear() を実行すると規 格には書かれていたが、既存の説明だと ec が空の時しか ec.clear() を呼び 出さないようになっていた。これは記述の修正になる。 --- reference/filesystem/exists.md | 9 ++------- reference/filesystem/is_block_file.md | 11 ----------- reference/filesystem/is_character_file.md | 11 ----------- reference/filesystem/is_directory.md | 9 --------- reference/filesystem/is_fifo.md | 11 ----------- reference/filesystem/is_other.md | 5 ----- reference/filesystem/is_regular_file.md | 11 ----------- reference/filesystem/is_socket.md | 11 ----------- reference/filesystem/is_symlink.md | 11 ----------- 9 files changed, 2 insertions(+), 87 deletions(-) diff --git a/reference/filesystem/exists.md b/reference/filesystem/exists.md index 912e2253da..cf5d951c83 100644 --- a/reference/filesystem/exists.md +++ b/reference/filesystem/exists.md @@ -24,14 +24,9 @@ namespace std::filesystem { - (3) : ```cpp file_status s = status(p, ec); - if (ec) { - return false; + if (status_known(s)) { + ec.clear(); } - if (!status_known(s)) { - ec = implementation-defined; - return false; - } - ec.clear(); return exists(s); ``` * file_status[link file_status.md] diff --git a/reference/filesystem/is_block_file.md b/reference/filesystem/is_block_file.md index 8343461380..0839083d74 100644 --- a/reference/filesystem/is_block_file.md +++ b/reference/filesystem/is_block_file.md @@ -26,17 +26,6 @@ Linux環境においては、`/dev/disk0`、`/dev/sda`、`/dev/loop0`などが - (3) : ```cpp file_status s = status(p, ec); - if (ec) { - return false; - } - - // ファイルが見つからなかったらエラー - file_type type = s.type(); - if (type == file_type::none || file_type::not_found || file_type::unknown) { - ec = implementation-defined; - return false; - } - ec.clear(); return is_block_file(s); ``` * file_status[link file_status.md] diff --git a/reference/filesystem/is_character_file.md b/reference/filesystem/is_character_file.md index 40acbaea28..b018947e00 100644 --- a/reference/filesystem/is_character_file.md +++ b/reference/filesystem/is_character_file.md @@ -26,17 +26,6 @@ Linux環境においては、`/dev/null`、`/dev/urandom`、`/dev/zero`などが - (3) : ```cpp file_status s = status(p, ec); - if (ec) { - return false; - } - - // ファイルが見つからなかったらエラー - file_type type = s.type(); - if (type == file_type::none || file_type::not_found || file_type::unknown) { - ec = implementation-defined; - return false; - } - ec.clear(); return is_character_file(s); ``` * file_status[link file_status.md] diff --git a/reference/filesystem/is_directory.md b/reference/filesystem/is_directory.md index 90cc5e1399..8925b14632 100644 --- a/reference/filesystem/is_directory.md +++ b/reference/filesystem/is_directory.md @@ -24,15 +24,6 @@ namespace std::filesystem { - (3) : ```cpp file_status s = status(p, ec); - if (ec) { - return false; - } - - if (!status_known(s)) { - ec = implementation-defined; - return false; - } - ec.clear(); return is_directory(s); ``` * file_status[link file_status.md] diff --git a/reference/filesystem/is_fifo.md b/reference/filesystem/is_fifo.md index 3ddfd4df71..ffb2df2b5f 100644 --- a/reference/filesystem/is_fifo.md +++ b/reference/filesystem/is_fifo.md @@ -24,17 +24,6 @@ namespace std::filesystem { - (3) : ```cpp file_status s = status(p, ec); - if (ec) { - return false; - } - - // ファイルが見つからなかったらエラー - file_type type = s.type(); - if (type == file_type::none || file_type::not_found || file_type::unknown) { - ec = implementation-defined; - return false; - } - ec.clear(); return is_fifo(s); ``` * file_status[link file_status.md] diff --git a/reference/filesystem/is_other.md b/reference/filesystem/is_other.md index c08eb6cb6f..8a32fd937c 100644 --- a/reference/filesystem/is_other.md +++ b/reference/filesystem/is_other.md @@ -32,11 +32,6 @@ namespace std::filesystem { - (3) : ```cpp file_status s = status(p, ec); - if (ec) { - return false; - } - - ec.clear(); return is_other(s); ``` * file_status[link file_status.md] diff --git a/reference/filesystem/is_regular_file.md b/reference/filesystem/is_regular_file.md index 6260bb6d27..daaa004ad0 100644 --- a/reference/filesystem/is_regular_file.md +++ b/reference/filesystem/is_regular_file.md @@ -24,17 +24,6 @@ namespace std::filesystem { - (3) : ```cpp file_status s = status(p, ec); - if (ec) { - return false; - } - - // ファイルが見つからなかったらエラー - file_type type = s.type(); - if (type == file_type::none || file_type::not_found || file_type::unknown) { - ec = implementation-defined; - return false; - } - ec.clear(); return is_regular_file(s); ``` * file_status[link file_status.md] diff --git a/reference/filesystem/is_socket.md b/reference/filesystem/is_socket.md index 56f6b6a532..4a90737899 100644 --- a/reference/filesystem/is_socket.md +++ b/reference/filesystem/is_socket.md @@ -24,17 +24,6 @@ namespace std::filesystem { - (3) : ```cpp file_status s = status(p, ec); - if (ec) { - return false; - } - - // ファイルが見つからなかったらエラー - file_type type = s.type(); - if (type == file_type::none || file_type::not_found || file_type::unknown) { - ec = implementation-defined; - return false; - } - ec.clear(); return is_socket(s); ``` * file_status[link file_status.md] diff --git a/reference/filesystem/is_symlink.md b/reference/filesystem/is_symlink.md index 16f076dc03..ee0ed59965 100644 --- a/reference/filesystem/is_symlink.md +++ b/reference/filesystem/is_symlink.md @@ -24,17 +24,6 @@ namespace std::filesystem { - (3) : ```cpp file_status s = symlink_status(p, ec); - if (ec) { - return false; - } - - // ファイルが見つからなかったらエラー - file_type type = s.type(); - if (type == file_type::none || file_type::not_found || file_type::unknown) { - ec = implementation-defined; - return false; - } - ec.clear(); return is_symlink(s); ``` * file_status[link file_status.md] From a754d24553b1dcfe18948812dc075c770e95cfb7 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 14 Jul 2025 23:12:05 +0900 Subject: [PATCH 2239/3948] =?UTF-8?q?style:=20"/*see=20below*/=20=3D>=20se?= =?UTF-8?q?e=20below"=20=E3=81=AE=E6=9B=B8=E3=81=8D=E6=8F=9B=E3=81=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 備考: 機械的置換 + 手動でコメントの横位置を調整 --- reference/charconv/from_chars.md | 2 +- reference/charconv/to_chars.md | 2 +- reference/compare/three_way_comparable.md | 4 ++-- reference/concepts/boolean-testable.md | 2 +- reference/concepts/default_initializable.md | 2 +- reference/concepts/equality_comparable.md | 4 ++-- reference/concepts/same_as.md | 2 +- reference/execution/execution/gather-signatures.md | 2 +- reference/execution/is-awaitable.md | 2 +- reference/functional/reference_wrapper/op_constructor.md | 4 ++-- reference/iterator/basic_const_iterator/iter_move.md | 2 +- reference/iterator/common_iterator.md | 6 +++--- reference/iterator/common_iterator/op_arrow.md | 2 +- reference/iterator/const_iterator.md | 2 +- reference/iterator/const_sentinel.md | 2 +- reference/iterator/indirectly_readable.md | 2 +- reference/iterator/is_integer_like.md | 4 ++-- reference/iterator/iter_difference_t.md | 2 +- reference/iterator/iter_value_t.md | 2 +- reference/iterator/iterator_traits.md | 6 +++--- reference/iterator/reverse_iterator/iter_move.md | 2 +- reference/sstream/basic_istringstream/swap.md | 4 ++-- reference/sstream/basic_ostringstream/swap.md | 4 ++-- reference/sstream/basic_stringbuf/swap.md | 4 ++-- reference/sstream/basic_stringstream/swap.md | 4 ++-- reference/tuple/tuple-like.md | 2 +- 26 files changed, 38 insertions(+), 38 deletions(-) diff --git a/reference/charconv/from_chars.md b/reference/charconv/from_chars.md index 295a7eba1d..407346b19c 100644 --- a/reference/charconv/from_chars.md +++ b/reference/charconv/from_chars.md @@ -10,7 +10,7 @@ namespace std { from_chars_result from_chars(const char* first, const char* last, - /*see below*/& value, + see below& value, int base = 10); // (1) C++17 constexpr from_chars_result from_chars(const char* first, diff --git a/reference/charconv/to_chars.md b/reference/charconv/to_chars.md index d45eb57976..c19fb9de89 100644 --- a/reference/charconv/to_chars.md +++ b/reference/charconv/to_chars.md @@ -10,7 +10,7 @@ namespace std { to_chars_result to_chars(char* first, char* last, - /*see below*/ value, + see below value, int base = 10); // (1) C++17 constexpr to_chars_result to_chars(char* first, diff --git a/reference/compare/three_way_comparable.md b/reference/compare/three_way_comparable.md index ff2d789ed7..1ca6bf857c 100644 --- a/reference/compare/three_way_comparable.md +++ b/reference/compare/three_way_comparable.md @@ -7,10 +7,10 @@ ```cpp namespace std { template - concept three_way_comparable = /*see below*/; // (1) + concept three_way_comparable = see below; // (1) template - concept three_way_comparable_with = /*see below*/; // (2) + concept three_way_comparable_with = see below; // (2) } ``` diff --git a/reference/concepts/boolean-testable.md b/reference/concepts/boolean-testable.md index f300531ca9..ef567c5ace 100644 --- a/reference/concepts/boolean-testable.md +++ b/reference/concepts/boolean-testable.md @@ -7,7 +7,7 @@ ```cpp namespace std { template - concept boolean-testable = /*see below*/; // 説明専用コンセプト + concept boolean-testable = see below; // 説明専用コンセプト } ``` diff --git a/reference/concepts/default_initializable.md b/reference/concepts/default_initializable.md index 4d350da56b..08ef9a81ab 100644 --- a/reference/concepts/default_initializable.md +++ b/reference/concepts/default_initializable.md @@ -7,7 +7,7 @@ ```cpp namespace std { template - concept default_initializable = /*see below*/; + concept default_initializable = see below; } ``` diff --git a/reference/concepts/equality_comparable.md b/reference/concepts/equality_comparable.md index 17bdfa48fe..668b8078d1 100644 --- a/reference/concepts/equality_comparable.md +++ b/reference/concepts/equality_comparable.md @@ -7,10 +7,10 @@ ```cpp namespace std { template - concept equality_comparable = /*see below*/; // (1) + concept equality_comparable = see below; // (1) template - concept equality_comparable_with = /*see below*/; // (2) + concept equality_comparable_with = see below; // (2) } ``` diff --git a/reference/concepts/same_as.md b/reference/concepts/same_as.md index 955ab8ead7..79a4efe31f 100644 --- a/reference/concepts/same_as.md +++ b/reference/concepts/same_as.md @@ -7,7 +7,7 @@ ```cpp namespace std { template - concept same_as = /*see below*/; + concept same_as = see below; } ``` diff --git a/reference/execution/execution/gather-signatures.md b/reference/execution/execution/gather-signatures.md index b37ea0cd75..40a8ea3e94 100644 --- a/reference/execution/execution/gather-signatures.md +++ b/reference/execution/execution/gather-signatures.md @@ -9,7 +9,7 @@ template class Tuple, template class Variant> -using gather-signatures = /*see below*/; +using gather-signatures = see below; ``` * valid-completion-signatures[link completion_signatures.md] diff --git a/reference/execution/is-awaitable.md b/reference/execution/is-awaitable.md index c5cd3bec2f..a14bb68d8a 100644 --- a/reference/execution/is-awaitable.md +++ b/reference/execution/is-awaitable.md @@ -23,7 +23,7 @@ concept is-awaitable; ```cpp template -concept await-suspend-result = /*see below*/; +concept await-suspend-result = see below; template concept is-awaiter = diff --git a/reference/functional/reference_wrapper/op_constructor.md b/reference/functional/reference_wrapper/op_constructor.md index d76dd11e4a..99346aa132 100644 --- a/reference/functional/reference_wrapper/op_constructor.md +++ b/reference/functional/reference_wrapper/op_constructor.md @@ -7,10 +7,10 @@ ```cpp template -reference_wrapper(U&& u) noexcept(/*see below*/); // (1) C++11 +reference_wrapper(U&& u) noexcept(see below); // (1) C++11 template -constexpr reference_wrapper(U&& u) noexcept(/*see below*/); // (1) C++20 +constexpr reference_wrapper(U&& u) noexcept(see below); // (1) C++20 reference_wrapper(const reference_wrapper& x) noexcept; // (2) C++11 diff --git a/reference/iterator/basic_const_iterator/iter_move.md b/reference/iterator/basic_const_iterator/iter_move.md index 1614858ef7..30602aa33e 100644 --- a/reference/iterator/basic_const_iterator/iter_move.md +++ b/reference/iterator/basic_const_iterator/iter_move.md @@ -6,7 +6,7 @@ * cpp23[meta cpp] ```cpp -friend constexpr rvalue-reference iter_move(const basic_const_iterator& i) noexcept(/*see below*/); +friend constexpr rvalue-reference iter_move(const basic_const_iterator& i) noexcept(see below); ``` ## 概要 diff --git a/reference/iterator/common_iterator.md b/reference/iterator/common_iterator.md index 1fe6eb383e..9873ea8767 100644 --- a/reference/iterator/common_iterator.md +++ b/reference/iterator/common_iterator.md @@ -24,11 +24,11 @@ namespace std { // iterator_traitsにアダプトする template struct iterator_traits> { - using iterator_concept = /*see below*/; - using iterator_category = /*see below*/; // 定義されない場合がある + using iterator_concept = see below; + using iterator_category = see below; // 定義されない場合がある using value_type = iter_value_t; using difference_type = iter_difference_t; - using pointer = /*see below*/; + using pointer = see below; using reference = iter_reference_t; }; } diff --git a/reference/iterator/common_iterator/op_arrow.md b/reference/iterator/common_iterator/op_arrow.md index 7513a0d323..427bc86a5c 100644 --- a/reference/iterator/common_iterator/op_arrow.md +++ b/reference/iterator/common_iterator/op_arrow.md @@ -6,7 +6,7 @@ * cpp20[meta cpp] ```cpp -decltype(auto) operator->() const requires /*see below*/; +decltype(auto) operator->() const requires see below; ``` ## 概要 diff --git a/reference/iterator/const_iterator.md b/reference/iterator/const_iterator.md index 2d42effce8..36c561839b 100644 --- a/reference/iterator/const_iterator.md +++ b/reference/iterator/const_iterator.md @@ -7,7 +7,7 @@ ```cpp namespace std { template - using const_iterator = /*see below*/; + using const_iterator = see below; } ``` diff --git a/reference/iterator/const_sentinel.md b/reference/iterator/const_sentinel.md index c174d4bad1..82af81b7a6 100644 --- a/reference/iterator/const_sentinel.md +++ b/reference/iterator/const_sentinel.md @@ -7,7 +7,7 @@ ```cpp namespace std { template - using const_sentinel = /*see below*/; + using const_sentinel = see below; } ``` * semiregular[link /reference/concepts/semiregular.md] diff --git a/reference/iterator/indirectly_readable.md b/reference/iterator/indirectly_readable.md index 352808bf63..e39b14374f 100644 --- a/reference/iterator/indirectly_readable.md +++ b/reference/iterator/indirectly_readable.md @@ -7,7 +7,7 @@ ```cpp namespace std { template - concept indirectly_readable = /*see below*/; + concept indirectly_readable = see below; } ``` diff --git a/reference/iterator/is_integer_like.md b/reference/iterator/is_integer_like.md index 3c7930bd5a..6e914ca95f 100644 --- a/reference/iterator/is_integer_like.md +++ b/reference/iterator/is_integer_like.md @@ -7,10 +7,10 @@ ```cpp namespace std { template - inline constexpr bool is-integer-like = /*see below*/; + inline constexpr bool is-integer-like = see below; template - inline constexpr bool is-signed-integer-like = /*see below*/; + inline constexpr bool is-signed-integer-like = see below; } ``` diff --git a/reference/iterator/iter_difference_t.md b/reference/iterator/iter_difference_t.md index 565b1ef679..254ab018f8 100644 --- a/reference/iterator/iter_difference_t.md +++ b/reference/iterator/iter_difference_t.md @@ -7,7 +7,7 @@ ```cpp namespace std { template - using iter_difference_t = /*see below*/; + using iter_difference_t = see below; } ``` diff --git a/reference/iterator/iter_value_t.md b/reference/iterator/iter_value_t.md index 39105e353d..ee6daacc2f 100644 --- a/reference/iterator/iter_value_t.md +++ b/reference/iterator/iter_value_t.md @@ -7,7 +7,7 @@ ```cpp namespace std { template - using iter_value_t = /*see below*/; + using iter_value_t = see below; } ``` diff --git a/reference/iterator/iterator_traits.md b/reference/iterator/iterator_traits.md index 4251e4505b..7d40830413 100644 --- a/reference/iterator/iterator_traits.md +++ b/reference/iterator/iterator_traits.md @@ -96,9 +96,9 @@ namespace std { ```cpp using difference_type = typename incrementable_traits::difference_type; using value_type = typename indirectly_readable_traits::value_type; - using pointer = /*see below*/; - using reference = /*see below*/; - using iterator_category = /*see below*/; + using pointer = see below; + using reference = see below; + using iterator_category = see below; ``` * indirectly_readable_traits[link /reference/iterator/indirectly_readable_traits.md] * incrementable_traits[link /reference/iterator/incrementable_traits.md] diff --git a/reference/iterator/reverse_iterator/iter_move.md b/reference/iterator/reverse_iterator/iter_move.md index b5073b7c54..bd27a957d7 100644 --- a/reference/iterator/reverse_iterator/iter_move.md +++ b/reference/iterator/reverse_iterator/iter_move.md @@ -10,7 +10,7 @@ namespace std { class reverse_iterator { friend constexpr iter_rvalue_reference_t - iter_move(const reverse_iterator& i) noexcept(/*see below*/); + iter_move(const reverse_iterator& i) noexcept(see below); }; } ``` diff --git a/reference/sstream/basic_istringstream/swap.md b/reference/sstream/basic_istringstream/swap.md index 3857dbaff1..69cb5cb0bb 100644 --- a/reference/sstream/basic_istringstream/swap.md +++ b/reference/sstream/basic_istringstream/swap.md @@ -6,8 +6,8 @@ * cpp11[meta cpp] ```cpp -void swap(basic_istringstream& rhs); // (1) C++11 -void swap(basic_istringstream& rhs) noexcept(/*see below*/); // (1) C++17 +void swap(basic_istringstream& rhs); // (1) C++11 +void swap(basic_istringstream& rhs) noexcept(see below); // (1) C++17 ``` ## 概要 diff --git a/reference/sstream/basic_ostringstream/swap.md b/reference/sstream/basic_ostringstream/swap.md index cb7d94d5e0..047f1d44b2 100644 --- a/reference/sstream/basic_ostringstream/swap.md +++ b/reference/sstream/basic_ostringstream/swap.md @@ -6,8 +6,8 @@ * cpp11[meta cpp] ```cpp -void swap(basic_ostringstream& rhs); // (1) C++11 -void swap(basic_ostringstream& rhs) noexcept(/*see below*/); // (1) C++17 +void swap(basic_ostringstream& rhs); // (1) C++11 +void swap(basic_ostringstream& rhs) noexcept(see below); // (1) C++17 ``` ## 概要 diff --git a/reference/sstream/basic_stringbuf/swap.md b/reference/sstream/basic_stringbuf/swap.md index 89f1a7c5fc..2fefdcd330 100644 --- a/reference/sstream/basic_stringbuf/swap.md +++ b/reference/sstream/basic_stringbuf/swap.md @@ -6,8 +6,8 @@ * cpp11[meta cpp] ```cpp -void swap(basic_stringbuf& rhs); // (1) C++11 -void swap(basic_stringbuf& rhs) noexcept(/*see below*/); // (1) C++17 +void swap(basic_stringbuf& rhs); // (1) C++11 +void swap(basic_stringbuf& rhs) noexcept(see below); // (1) C++17 ``` ## 概要 diff --git a/reference/sstream/basic_stringstream/swap.md b/reference/sstream/basic_stringstream/swap.md index 915112f683..a62414d114 100644 --- a/reference/sstream/basic_stringstream/swap.md +++ b/reference/sstream/basic_stringstream/swap.md @@ -6,8 +6,8 @@ * cpp11[meta cpp] ```cpp -void swap(basic_stringstream& rhs); // (1) C++11 -void swap(basic_stringstream& rhs) noexcept(/*see below*/); // (1) C++17 +void swap(basic_stringstream& rhs); // (1) C++11 +void swap(basic_stringstream& rhs) noexcept(see below); // (1) C++17 ``` ## 概要 diff --git a/reference/tuple/tuple-like.md b/reference/tuple/tuple-like.md index 3728e0bba5..e4929c1c7f 100644 --- a/reference/tuple/tuple-like.md +++ b/reference/tuple/tuple-like.md @@ -7,7 +7,7 @@ ```cpp namespace std { template - concept tuple-like = /*see below*/; // 説明専用コンセプト + concept tuple-like = see below; // 説明専用コンセプト } ``` From 7e1ca38527be6c6902b09b1d87c429541c33dbcf Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 14 Jul 2025 23:14:09 +0900 Subject: [PATCH 2240/3948] =?UTF-8?q?style(utility,format):=20"see{[-=5F]?= =?UTF-8?q?=20=3D>=20=20}below"=20=E3=81=AE=E6=9B=B8=E3=81=8D=E6=8F=9B?= =?UTF-8?q?=E3=81=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/visit_format_arg.md | 3 +-- reference/utility/forward_like.md | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/reference/format/visit_format_arg.md b/reference/format/visit_format_arg.md index 70a514b1e2..917cfc8cfb 100644 --- a/reference/format/visit_format_arg.md +++ b/reference/format/visit_format_arg.md @@ -8,10 +8,9 @@ ```cpp namespace std { template - see_below visit_format_arg(Visitor&& vis, basic_format_arg arg); // (1) + see below visit_format_arg(Visitor&& vis, basic_format_arg arg); // (1) } ``` -* see_below[italic] * basic_format_arg[link /reference/format/basic_format_arg.md] ## 概要 diff --git a/reference/utility/forward_like.md b/reference/utility/forward_like.md index 3ecbe937b8..3c87bd84dd 100644 --- a/reference/utility/forward_like.md +++ b/reference/utility/forward_like.md @@ -8,12 +8,11 @@ namespace std { template [[nodiscard]] -constexpr auto forward_like(U&& x) noexcept -> see-below; // (1) C++23 +constexpr auto forward_like(U&& x) noexcept -> see below; // (1) C++23 template -constexpr auto forward_like(U&& x) noexcept -> see-below; // (1) C++26 +constexpr auto forward_like(U&& x) noexcept -> see below; // (1) C++26 } ``` -* see-below[italic] ## 概要 第一テンプレート引数の`const`性と参照修飾を用いて関数テンプレートの引数を転送する。 From fbcad902c7b263ce34c56398b8a2be511e68590a Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Tue, 15 Jul 2025 19:34:51 +0900 Subject: [PATCH 2241/3948] =?UTF-8?q?fix(functional):=20=E4=BD=99=E5=88=86?= =?UTF-8?q?=E3=81=AE=20/*see=20below*/=20=E3=81=AE=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/functional/placeholders.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/functional/placeholders.md b/reference/functional/placeholders.md index a5086d3708..f030794336 100644 --- a/reference/functional/placeholders.md +++ b/reference/functional/placeholders.md @@ -7,10 +7,10 @@ ```cpp namespace std { namespace placeholders { - /*see below*/ unspecified _1; - /*see below*/ unspecified _2; + unspecified _1; + unspecified _2; … - /*see below*/ unspecified _N; + unspecified _N; }} ``` * unspecified[italic] From a32b5ce89c7288668821504c2302eda916f675b9 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Wed, 16 Jul 2025 00:48:05 +0900 Subject: [PATCH 2242/3948] =?UTF-8?q?=E3=81=94=E6=8C=87=E6=91=98=E9=A0=82?= =?UTF-8?q?=E3=81=84=E3=81=9F=E7=82=B9=E3=82=92=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit add path to `strtol` --- reference/cstdlib/strtol.md | 66 +++++++++++++++++++++++-------------- reference/string/stoi.md | 2 +- 2 files changed, 42 insertions(+), 26 deletions(-) diff --git a/reference/cstdlib/strtol.md b/reference/cstdlib/strtol.md index 01824776e0..949d9f56a8 100644 --- a/reference/cstdlib/strtol.md +++ b/reference/cstdlib/strtol.md @@ -10,34 +10,31 @@ namespace std { ``` ## 概要 -文字列`nptr`を`long`型の整数に変換する。変換時には`base`で指定された基数に従って解釈される。 +文字列`nptr`を`long`型の整数に変換する。文字列は`base`で指定された基数に従って解釈される。 `endptr`が非`nullptr`の場合、変換が終了した位置の文字へのポインタがそこに格納される。 基数`base`は 2~36 または 0 の値を取る。 `base`が0の場合 +- 文字列の先頭が`0x`、`0X`は16進数 - 文字列の先頭が`0`の場合は8進数 -- 先頭が`0x`、`0X`は16進数 -- その他の場合は10進数として変換される。 +- その他の場合は10進数として変換する。 変換は次のように行われる -- 先頭の空白文字は最初の非空白文字から変換される。 +- 先頭が空白文字の場合、最初の非空白文字から変換される。 - `+`または`-`が先頭にある場合は、符号として解釈される。 +- 基数が 16 または 0 の場合`0x`または`0X`をスキップする - その後の文字列を、指定された`base`に基づいて整数値に変換する。 - +- 各桁は、`0`〜`9`をその値、`a`〜`z`および`A`〜`Z`を10〜35として扱う。 ## 戻り値 - 変換可能ならば変換後の数値。 - - 変換後の数値が`long`の範囲外の場合、`LONG_MAX`または `LONG_MIN`。 - - 変換不可能なら`0`を返す。 ## 備考 -この関数はスレッドセーフである。 - - +- 数値が `long` の範囲を超えるときは `errno` に `ERANGE` が設定される。 ## 例 ```cpp example @@ -46,32 +43,51 @@ namespace std { #include #include -int main() { - const char* str = " -0x2Fabc"; - - errno = 0; - long result1 = std::strtol(str, nullptr, 0); // 自動判別 - std::cout << "変換結果(基数0): " << result1 << std::endl; - +void convert_and_print(const char* str, int base) { errno = 0; - long result2 = std::strtol(str, nullptr, 10); // 10進数として解釈 - std::cout << "変換結果(基数10): " << result2 << std::endl; + char* end = nullptr; + long result = std::strtol(str, &end, base); + + std::cout << "基数" << base << "での変換結果: " << result << std::endl; + if (str == end) { + std::cout << "変換不可" << std::endl; + } else if (errno == ERANGE) { + std::cout << " → 変換結果が範囲外" << std::endl; + } + if (*end != '\0') { + std::cout << "未変換部分: \"" << end << "\"" << std::endl; + } + std::cout << std::endl; +} - errno = 0; - long result3 = std::strtol(str, nullptr, 36); // 36進数として解釈 - std::cout << "変換結果(基数36): " << result3 << std::endl; +int main() { + const char* str = " -0x2Fabc"; + convert_and_print(str, 0); // 自動判別 + std::cout << std::endl; + convert_and_print(str, 10); // 10進数 + convert_and_print(str, 36); // 36進数 return 0; } + ``` ### 出力 ``` -変換結果(基数0): -195260 -変換結果(基数10): 0 -変換結果(基数36): -1999456248 +基数0での変換結果: -195260 + +基数10での変換結果: 0 +未変換部分: "x2Fabc" + +基数36での変換結果: -1999456248 + ``` ## 関連項目 - [`strtoll`](strtoll.md.nolink): 文字列を、基数を指定して`long long`型に変換する - [`strtoul`](strtoul.md.nolink): 文字列を、基数を指定して`unsigned long`型に変換する - [`strtoull`](strtoull.md.nolink): 文字列を、基数を指定して`unsigned long long`型に変換する +- [`std::stol`](/reference/string/stol.md): 文字列から`long`型への変換 +- [`` ヘッダ](/reference/charconv.md): 高速な文字列 ⇔ 数値変換 + +## 参考文献 +- Qiita: [Cのstrtolの使い方とendptrの活用例(@yumetodo)](https://qiita.com/yumetodo/items/238751b879c09b56234b) diff --git a/reference/string/stoi.md b/reference/string/stoi.md index 657d5e1d8f..66b15defd3 100644 --- a/reference/string/stoi.md +++ b/reference/string/stoi.md @@ -235,7 +235,7 @@ int stoi(const std::wstring& str, std::size_t* idx = nullptr, int base = 10) { ## 関連リンク ### C標準ライブラリに由来する関数 - [`atoi`](/reference/cstdlib/atoi_atol_atoll.md): `stoi`は[`atoi`](/reference/cstdlib/atoi_atol_atoll.md)を`std::string`および`std::wstring`に対応させたものと見なせる。 -- `strtol`, `wcstol`: `stoi`は`strtol`および`wcstol`をそれぞれ`std::string`と`std::wstring`に対応させ、戻り値の型を`int`に変更したものと見なせる。 +- [`strtol`](/reference/cstdlib/strtol.md), `wcstol`: `stoi`は`strtol`および`wcstol`をそれぞれ`std::string`と`std::wstring`に対応させ、戻り値の型を`int`に変更したものと見なせる。 ### ファミリー - (`stoi`: この関数自身) From 3e711d8647425930cbf850999a04d86722293657 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Wed, 16 Jul 2025 00:52:34 +0900 Subject: [PATCH 2243/3948] add path to `strtol` --- reference/charconv.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/charconv.md b/reference/charconv.md index e8827dfee4..0e4316df0f 100644 --- a/reference/charconv.md +++ b/reference/charconv.md @@ -51,7 +51,7 @@ XMLやJSONに代表されるテキストベースのデータを利用するケ | `snprintf` | ロケール依存、フォーマットの動的解析 | | `sscanf` | ロケール依存、フォーマットの動的解析 | | [`atol`](/reference/cstdlib/atoi_atol_atoll.md) | ロケール依存、エラー報告の不足 | -| `strtol` | ロケール依存、先頭ホワイトスペースの無視、接頭辞(0x等)を考慮する | +| [`strtol`](/reference/cstdlib/strtol.md) | ロケール依存、先頭ホワイトスペースの無視、接頭辞(0x等)を考慮する | | `strstream` | ロケール依存、先頭ホワイトスペースの無視 | | `stringstream` | ロケール依存、先頭ホワイトスペースの無視、動的メモリ確保 | | `num_put / num_get facets` | ロケール依存、仮想関数 | From 2bc7cf686f3246662f93f2afa5705b70b1d143b6 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Tue, 15 Jul 2025 22:46:50 +0000 Subject: [PATCH 2244/3948] =?UTF-8?q?=E4=B8=8D=E8=A6=81=E3=81=AA=E8=A1=8C?= =?UTF-8?q?=E3=81=AE=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/strtol.md | 1 - 1 file changed, 1 deletion(-) diff --git a/reference/cstdlib/strtol.md b/reference/cstdlib/strtol.md index 949d9f56a8..08f2906906 100644 --- a/reference/cstdlib/strtol.md +++ b/reference/cstdlib/strtol.md @@ -63,7 +63,6 @@ void convert_and_print(const char* str, int base) { int main() { const char* str = " -0x2Fabc"; convert_and_print(str, 0); // 自動判別 - std::cout << std::endl; convert_and_print(str, 10); // 10進数 convert_and_print(str, 36); // 36進数 From c1261d33c05e1fba5c47baad89234a8d2f29bfbd Mon Sep 17 00:00:00 2001 From: rotarymars Date: Wed, 16 Jul 2025 10:21:38 +0900 Subject: [PATCH 2245/3948] Update reference/cstdio/fpos_t.md Co-authored-by: Koichi Murase --- reference/cstdio/fpos_t.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/cstdio/fpos_t.md b/reference/cstdio/fpos_t.md index 058ef368ad..cee012fd60 100644 --- a/reference/cstdio/fpos_t.md +++ b/reference/cstdio/fpos_t.md @@ -8,6 +8,7 @@ namespace std { using fpos_t = object-type; } ``` +* object-type[italic] ## 概要 ファイルの位置を保持するための型。 From be2e52d9b3eaab1c66c617dd4d8f517ca9013c22 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 16 Jul 2025 18:57:46 +0900 Subject: [PATCH 2246/3948] =?UTF-8?q?=E3=82=B0=E3=83=AD=E3=83=BC=E3=83=90?= =?UTF-8?q?=E3=83=AB=E4=BF=AE=E9=A3=BE=E3=83=AA=E3=82=B9=E3=83=88:=20?= =?UTF-8?q?=E7=8F=BE=E7=8A=B6=E3=81=AE=E7=99=BB=E9=8C=B2=E3=83=AB=E3=83=BC?= =?UTF-8?q?=E3=83=AB=E3=82=92=E8=A8=98=E8=BC=89=20(#1472)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 699747016c..833052c80e 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -1,3 +1,43 @@ +# グローバル修飾リスト +# +# 【概要】 +# このファイルは、Webサイト全体に適用されるコードブロック中の識別子への修飾である。 +# 各ページのコードブロックへの修飾のうしろに、このファイルの内容が追加され、適用される。 +# 個別ページで指定される修飾の方が優先順位が高くなるため、個別ページで指定されている修飾は上書きされない。 +# グローバル修飾リストは、ページ執筆者の作業負担を減らすための機能である。 +# コードブロックへの修飾の構文は、 /start_editing/markdown_cpprefjp.md を参照すること。 +# +# 【登録ルール】 +# 1. 識別子への修飾として頻出するものを登録する +# 1.1 頻出とは基本的にはヘッダを跨いでよく出てくるもの +# 1.2 ただし、ヘッダ内のサンプルコードや使用で頻出し、個別ページでの修飾が作業負担になる場合はその限りではない +# 2. 標準ライブラリのヘッダファイル、モジュールはすべて登録する +# 3. 登録順は、アルファベット順 +# 3.1 ライブラリ内でさらにアルファベット順 +# 3.2 ただし、同じ機能を名前空間なし・ありの両方を登録する場合、名前空間ありを先に登録すること。 +# 優先的にコード修飾を適用し、名前空間を含む完全名に対して部分的に修飾されないようにするため。例: +# * std::chrono::milliseconds[link …] +# * chrono::milliseconds[link …] +# * milliseconds[link …] +# 3.3 所属するライブラリに識別子を登録すること +# 3.4 ライブラリ内の識別子は、インデントさせること +# 3.5 インデントはグローバル修飾リストの読み込み時に自動的に削除されるため、インデント自体に構文的な意味はない +# 4. 名前空間は基本的につける (主にサンプルコード用) +# 4.1 ただし、宣言や仕様で頻出する場合には、名前空間なしのものも登録する +# 5. メンバ関数を登録する場合は、合意された衝突しない変数名を使用すること +# 5.1 std::vectorはv、v1、v2、v3 +# 5.2 std::initializer_listはil +# 5.3 std::valarrayはva +# 5.4 std::threadはt、t1、t2 +# 5.5 std::jthreadはjt +# 5.6 std::error_codeはec +# 5.7 std::error_conditionはecond +# 6. 名前空間の略称は、合意された衝突しない名前を使用すること +# 6.1 std::filesystemはfs +# 7. オーバーロードされている名前は、優先度の高いプライマリ宣言をグローバル修飾リストに登録する +# 7.1 ライブラリごとにオーバーロード・特殊化されているものはグローバル修飾リストに登録せず、個別ページで指定する +# (std::begin/std::end、std::common_typeなど) + * floating-point-type[italic] * implementation-defined[italic] * import std;[link /module/std.md] From 15541d7b9fc68d9eb591809461c7b6c4a0af2b9a Mon Sep 17 00:00:00 2001 From: OGAWA KenIchi Date: Wed, 16 Jul 2025 19:16:35 +0900 Subject: [PATCH 2247/3948] =?UTF-8?q?type=5Finfo=E3=81=B8=E3=81=AE?= =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=81=8C=E3=81=82=E3=81=A3=E3=81=A6?= =?UTF-8?q?=E3=81=BB=E3=81=97=E3=81=84=E3=81=A8=E6=80=9D=E3=81=A3=E3=81=9F?= =?UTF-8?q?=E3=81=AE=E3=81=A7=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/any/any/type.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/any/any/type.md b/reference/any/any/type.md index b0ba6b8660..cc67cdd939 100644 --- a/reference/any/any/type.md +++ b/reference/any/any/type.md @@ -8,6 +8,7 @@ ```cpp const type_info& type() const noexcept; ``` +* type_info[link /reference/typeinfo/type_info.md] ## 概要 保持している値の型情報を取得する。 From bb07e7c90e1f5d510ae07e6b02a9d1f66e0af757 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 16 Jul 2025 20:48:27 +0900 Subject: [PATCH 2248/3948] =?UTF-8?q?vformat,=20make=5Fformat=5Fargs=20:?= =?UTF-8?q?=20=E5=AE=9F=E8=A1=8C=E6=99=82=E6=96=87=E5=AD=97=E5=88=97?= =?UTF-8?q?=E3=81=AE=E3=83=95=E3=82=A9=E3=83=BC=E3=83=9E=E3=83=83=E3=83=88?= =?UTF-8?q?=E5=BC=95=E6=95=B0=E3=81=A7=E7=94=A8=E9=80=94=E3=81=8C=E3=81=82?= =?UTF-8?q?=E3=82=8B=E3=81=AE=E3=81=A7=E8=AA=AC=E6=98=8E=E3=81=A8=E4=BE=8B?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/make_format_args.md | 26 +++++++++++++++++++--- reference/format/vformat.md | 33 +++++++++++++++++++++++----- 2 files changed, 51 insertions(+), 8 deletions(-) diff --git a/reference/format/make_format_args.md b/reference/format/make_format_args.md index 3e4ffefad8..6b189c1dab 100644 --- a/reference/format/make_format_args.md +++ b/reference/format/make_format_args.md @@ -63,6 +63,27 @@ return make_format_args(args...); ``` * wformat_context[link /reference/format/basic_format_context.md] + +## 例 +```cpp example +#include +#include + +int main() { + std::string fmt = "0x{:x} 0b{:04b}"; + std::string s = std::vformat(fmt, std::make_format_args(10, 6)); + std::cout << s << std::endl; +} +``` +* std::make_format_args[color ff0000] +* std::vformat[link vformat.md] + +### 出力 +``` +0xa 0b0110 +``` + + ## 実装例 ```cpp namespace std { @@ -87,9 +108,8 @@ namespace std { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? -- [ICC](/implementation.md#icc): ?? +- [Clang](/implementation.md#clang): 17 +- [GCC](/implementation.md#gcc): 13 - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 diff --git a/reference/format/vformat.md b/reference/format/vformat.md index da0cfc5d2a..06b2389e4d 100644 --- a/reference/format/vformat.md +++ b/reference/format/vformat.md @@ -32,8 +32,12 @@ namespace std { * (3): マルチバイト文字列版 (ロケール指定あり) * (4): ワイド文字列版 (ロケール指定あり) -[`format`](format.md)のフォーマット引数を型消去したバージョンであり、内部的に使用される。文字列をフォーマットする目的で直接利用する必要はない。 -ただし、[`format`](format.md)のような関数を自作する場合は、`vformat`を使って実装すると便利である。 +[`std::format()`](format.md)関数のフォーマット引数を実行時文字列にしたバージョンであり、[`std::format()`](format.md)関数の内部で使用される。 + +[`std::format()`](format.md)のような関数を自作する場合にこの関数を使って実装すると便利であるほか、実行時文字列でフォーマット引数を構築したい場合にも利用できる。 + +C++26以降は、実行時文字列のフォーマット引数を使用したい場合は、[`std::runtime_format()`](runtime_format.md)関数を使用できる。 + ## 戻り値 @@ -43,6 +47,26 @@ namespace std { フォーマット実行時に失敗した場合、[`format_error`](format_error.md)を投げる。 +## 例 +```cpp example +#include +#include + +int main() { + std::string fmt = "0x{:x} 0b{:04b}"; + std::string s = std::vformat(fmt, std::make_format_args(10, 6)); + std::cout << s << std::endl; +} +``` +* std::vformat[color ff0000] +* std::make_format_args[link make_format_args.md] + +### 出力 +``` +0xa 0b0110 +``` + + ## 実装例 ```cpp @@ -84,9 +108,8 @@ string vformat(const locale& loc, wstring_view fmt, wformat_args args) { - C++20 ### 処理系 -- [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? -- [ICC](/implementation.md#icc): ?? +- [Clang](/implementation.md#clang): 17 +- [GCC](/implementation.md#gcc): 13 - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 From a3c4ce42e1367314524fb90a2ee4d9574d39693a Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Wed, 16 Jul 2025 23:18:01 +0900 Subject: [PATCH 2249/3948] =?UTF-8?q?strtol:=E8=A8=98=E8=BF=B0=E3=81=AE?= =?UTF-8?q?=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/strtol.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/cstdlib/strtol.md b/reference/cstdlib/strtol.md index 08f2906906..a8f808adc1 100644 --- a/reference/cstdlib/strtol.md +++ b/reference/cstdlib/strtol.md @@ -17,8 +17,8 @@ namespace std { 基数`base`は 2~36 または 0 の値を取る。 `base`が0の場合 -- 文字列の先頭が`0x`、`0X`は16進数 -- 文字列の先頭が`0`の場合は8進数 +- 文字列の先頭が`0x`または`0X`のときは16進数 +- 文字列の先頭が`0`のときは8進数 - その他の場合は10進数として変換する。 変換は次のように行われる From 5b1c95f1f3810b3211cb7ffdc214d3fbb94406c9 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Wed, 16 Jul 2025 23:56:02 +0900 Subject: [PATCH 2250/3948] =?UTF-8?q?strtol:=E8=A8=98=E8=BF=B0=E3=81=AE?= =?UTF-8?q?=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/strtol.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdlib/strtol.md b/reference/cstdlib/strtol.md index a8f808adc1..5b20b4df2b 100644 --- a/reference/cstdlib/strtol.md +++ b/reference/cstdlib/strtol.md @@ -19,7 +19,7 @@ namespace std { `base`が0の場合 - 文字列の先頭が`0x`または`0X`のときは16進数 - 文字列の先頭が`0`のときは8進数 -- その他の場合は10進数として変換する。 +- その他のときは10進数として変換する。 変換は次のように行われる - 先頭が空白文字の場合、最初の非空白文字から変換される。 From b0adf47e9c68abc8459ea70ce2252de8ea40a60d Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Thu, 17 Jul 2025 01:04:57 +0900 Subject: [PATCH 2251/3948] =?UTF-8?q?tempnam=20=E2=86=92=20tmpnam?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdio.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdio.md b/reference/cstdio.md index 55905a7d32..7747d11086 100644 --- a/reference/cstdio.md +++ b/reference/cstdio.md @@ -29,7 +29,7 @@ | [`SEEK_SET`](/reference/cstdio/seek_set.md.nolink) | ファイルの先頭位置を指定するための整数定数 | | | [`SEEK_CUR`](/reference/cstdio/seek_cur.md.nolink) | ファイルの現在位置を指定するための整数定数 | | | [`SEEK_END`](/reference/cstdio/seek_end.md.nolink) | ファイルの終端を指定するための整数定数 | | -| [`TMP_MAX`](/reference/cstdio/tmp_max.md.nolink) | `tempnam()`関数によって生成できる一時ファイル名の、実装が保証する最低限の数を表す整数定数 | | +| [`TMP_MAX`](/reference/cstdio/tmp_max.md.nolink) | `tmpnam()`関数によって生成できる一時ファイル名の、実装が保証する最低限の数を表す整数定数 | | | [`stderr`](/reference/cstdio/stderr.md) | 標準エラーを表す`FILE*`型の式 | | [`stdin`](/reference/cstdio/stdin.md) | 標準入力を表す`FILE*`型の式 | | [`stdout`](/reference/cstdio/stdout.md) | 標準出力を表す`FILE*`型の式 | From 63eebbda07077b87b8d1c9d201b0638a709864f5 Mon Sep 17 00:00:00 2001 From: yumetodo Date: Fri, 18 Jul 2025 20:16:56 +0900 Subject: [PATCH 2252/3948] =?UTF-8?q?fix:=20=E5=8F=82=E8=80=83=E3=81=AB?= =?UTF-8?q?=E3=81=97=E3=81=9F=E8=A8=98=E4=BA=8B=E3=81=AF=E3=82=82=E3=81=A8?= =?UTF-8?q?=E3=81=AE=E3=82=BF=E3=82=A4=E3=83=88=E3=83=AB=E3=82=92=E3=81=9D?= =?UTF-8?q?=E3=81=AE=E3=81=BE=E3=81=BE=E8=A8=98=E8=BF=B0=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=81=B9=E3=81=8D=20(#1475)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 誰が書いた記事かはここでは重要じゃないはずなのでそこも除去してます --- reference/cstdlib/strtol.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdlib/strtol.md b/reference/cstdlib/strtol.md index 5b20b4df2b..dedfa2cd58 100644 --- a/reference/cstdlib/strtol.md +++ b/reference/cstdlib/strtol.md @@ -89,4 +89,4 @@ int main() { - [`` ヘッダ](/reference/charconv.md): 高速な文字列 ⇔ 数値変換 ## 参考文献 -- Qiita: [Cのstrtolの使い方とendptrの活用例(@yumetodo)](https://qiita.com/yumetodo/items/238751b879c09b56234b) +- [C言語で安全に標準入力から数値を取得 #stdin - Qiita](https://qiita.com/yumetodo/items/238751b879c09b56234b): Cのstrtolの使い方とendptrの活用例 From cf58bef6d7904f7f3e26bfecdf310245fb3266b1 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sat, 19 Jul 2025 21:37:51 +0900 Subject: [PATCH 2253/3948] new page bufsiz.md --- reference/cstdio.md | 2 +- reference/cstdio/bufsiz.md | 52 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 reference/cstdio/bufsiz.md diff --git a/reference/cstdio.md b/reference/cstdio.md index 7747d11086..297863cfb8 100644 --- a/reference/cstdio.md +++ b/reference/cstdio.md @@ -21,7 +21,7 @@ | [`_IOFBF`](/reference/cstdio/iofbf.md.nolink) | 入出力を完全にバッファリングする指定のための整数定数 | | | [`_IOLBF`](/reference/cstdio/iolbf.md.nolink) | 入出力を行バッファリングする指定のための整数定数 | | | [`_IONBF`](/reference/cstdio/ionbf.md.nolink) | 入出力をバッファリングしない指定のための整数定数 | | -| [`BUFSIZ`](/reference/cstdio/bufsiz.md.nolink) | バッファサイズを表す整数定数 | | +| [`BUFSIZ`](/reference/cstdio/bufsiz.md) | バッファサイズを表す整数定数 | | | [`EOF`](/reference/cstdio/eof.md) | ファイルの終端であることを表す`int`型の整数定数 | | | [`FOPEN_MAX`](/reference/cstdio/fopen_max.md.nolink) | 実装によって保証されるファイルを開ける最低限の数を表す整数定数 | | | [`FILENAME_MAX`](/reference/cstdio/filename_max.md) | 実装によって保証されるファイル名の最大の長さを表す整数定数 | | diff --git a/reference/cstdio/bufsiz.md b/reference/cstdio/bufsiz.md new file mode 100644 index 0000000000..6fe47bd329 --- /dev/null +++ b/reference/cstdio/bufsiz.md @@ -0,0 +1,52 @@ +# BUFSIZ +* cstdio[meta header] +* macro[meta id-type] + +```cpp +#define BUFSIZ implementation-defined +``` + +## 概要 +標準入出力のバッファサイズを表すマクロ。 + +このマクロは、標準入出力関数で使用されるデフォルトのバッファサイズを定義する。値は実装依存であるが、一般的には512バイトや1024バイトなどの値が使用される。 + +## 例 +```cpp example +#include +#include + +int main() { + // BUFSIZの値を表示 + std::printf("BUFSIZ = %d\n", BUFSIZ); + + // バッファサイズを指定してファイルを開く + char buffer[BUFSIZ]; + std::FILE* file = std::fopen("test.txt", "w"); + if (file) { + // バッファを設定 + std::setbuf(file, buffer); + std::fprintf(file, "Hello, World!\n"); + std::fclose(file); + } + + return 0; +} +``` +* BUFSIZ[color ff0000] +* std::printf[link /reference/cstdio/printf.md] +* std::fopen[link /reference/cstdio/fopen.md] +* std::setbuf[link /reference/cstdio/setbuf.md.nolink] +* std::fprintf[link /reference/cstdio/fprintf.md] +* std::fclose[link /reference/cstdio/fclose.md] + +### 出力例 +``` +BUFSIZ = 1024 +``` + +## 処理系 + +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? From 8fa26539b40bfd81fd331c725b85b9cac56ad2bc Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sun, 20 Jul 2025 19:55:47 +0900 Subject: [PATCH 2254/3948] bufsiz.md implementation-defined -> unspecified --- reference/cstdio/bufsiz.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reference/cstdio/bufsiz.md b/reference/cstdio/bufsiz.md index 6fe47bd329..59c16b9be0 100644 --- a/reference/cstdio/bufsiz.md +++ b/reference/cstdio/bufsiz.md @@ -3,8 +3,9 @@ * macro[meta id-type] ```cpp -#define BUFSIZ implementation-defined +#define BUFSIZ unspecified ``` +* unspecified[italic] ## 概要 標準入出力のバッファサイズを表すマクロ。 From 6104a9a33b8c9f96367f6da619e27c7f9a7ae225 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sun, 20 Jul 2025 20:01:47 +0900 Subject: [PATCH 2255/3948] Update reference/cstdio/bufsiz.md Co-authored-by: Koichi Murase --- reference/cstdio/bufsiz.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdio/bufsiz.md b/reference/cstdio/bufsiz.md index 59c16b9be0..980dcba7a3 100644 --- a/reference/cstdio/bufsiz.md +++ b/reference/cstdio/bufsiz.md @@ -8,7 +8,7 @@ * unspecified[italic] ## 概要 -標準入出力のバッファサイズを表すマクロ。 +[`setbuf()`](/reference/cstdio/setbuf.md.nolink)関数で使われる標準入出力のバッファサイズを表すマクロ。 このマクロは、標準入出力関数で使用されるデフォルトのバッファサイズを定義する。値は実装依存であるが、一般的には512バイトや1024バイトなどの値が使用される。 From fd7a5076975f6e3ab7abe26b18f4467c9400a904 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sun, 20 Jul 2025 20:03:27 +0900 Subject: [PATCH 2256/3948] removed iostream from bufsiz --- reference/cstdio/bufsiz.md | 1 - 1 file changed, 1 deletion(-) diff --git a/reference/cstdio/bufsiz.md b/reference/cstdio/bufsiz.md index 980dcba7a3..8f1ff4180a 100644 --- a/reference/cstdio/bufsiz.md +++ b/reference/cstdio/bufsiz.md @@ -15,7 +15,6 @@ ## 例 ```cpp example #include -#include int main() { // BUFSIZの値を表示 From f78ec17cf2805e3c4339b680d370ea6ab09861da Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 22 Jul 2025 17:49:50 +0900 Subject: [PATCH 2257/3948] =?UTF-8?q?=E3=83=97=E3=83=A9=E3=82=A4=E3=83=9E?= =?UTF-8?q?=E3=83=AA=E5=AE=A3=E8=A8=80=E3=81=AE=E3=83=AA=E3=82=B9=E3=83=88?= =?UTF-8?q?=E3=82=92=E4=BD=9C=E6=88=90=E3=81=97=E3=80=81=E3=82=B0=E3=83=AD?= =?UTF-8?q?=E3=83=BC=E3=83=90=E3=83=AB=E4=BF=AE=E9=A3=BE=E3=83=AA=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=81=AB=E3=83=97=E3=83=A9=E3=82=A4=E3=83=9E=E3=83=AA?= =?UTF-8?q?=E3=81=A7=E3=81=AF=E3=81=AA=E3=81=84=E3=82=AA=E3=83=BC=E3=83=90?= =?UTF-8?q?=E3=83=BC=E3=83=AD=E3=83=BC=E3=83=89=E3=83=BB=E7=89=B9=E6=AE=8A?= =?UTF-8?q?=E5=8C=96=E3=81=8C=E7=99=BB=E9=8C=B2=E3=81=95=E3=82=8C=E3=81=9F?= =?UTF-8?q?=E3=82=89=E3=82=A8=E3=83=A9=E3=83=BC=E3=81=AB=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/check.yml | 1 + .../workflows/script/global_qualify_check.py | 49 ++++++ GLOBAL_QUALIFY_LIST.txt | 1 + PRIMARY_OVERLOAD_SPECIALIZATION.txt | 159 ++++++++++++++++++ start_editing.md | 41 ++--- 5 files changed, 232 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/script/global_qualify_check.py create mode 100644 PRIMARY_OVERLOAD_SPECIALIZATION.txt diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index e86913449c..e897f4bacf 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -9,6 +9,7 @@ jobs: matrix: item: - {name: code_qualify} + - {name: global_qualify} - {name: defined_word} - {name: display_error} - {name: meta_header} diff --git a/.github/workflows/script/global_qualify_check.py b/.github/workflows/script/global_qualify_check.py new file mode 100644 index 0000000000..6c4b9fea60 --- /dev/null +++ b/.github/workflows/script/global_qualify_check.py @@ -0,0 +1,49 @@ +# GLOBAL_QYALIFY_LIST.txtファイルについて、以下をチェックする: +# 1. プライマリ宣言ではないオーバーロード・特殊化がないこと + +import glob +import os +import sys +import re + +def convrert_qualify_list(qualify_list: str) -> list: + ls: list(str, str) = [] + for line in qualify_list.split("\n"): + stripped_line = line.strip() + if not stripped_line or stripped_line.startswith("#"): + continue + m = re.fullmatch(r'[\*-] (.*?)\[link(.*?)\]', stripped_line) + if m: + ls.append((m.group(1), m.group(2).strip())) + return ls + +def check(global_qualify_list_str: str, primary_overload_specialization_list_str: str) -> bool: + found_error: bool = False + + global_qualify_list = convrert_qualify_list(global_qualify_list_str) + primary_overload_specialization_list = convrert_qualify_list(primary_overload_specialization_list_str) + + for name, link in global_qualify_list: + for primary_name, primary_link in primary_overload_specialization_list: + if name == primary_name: + if not primary_link: + print(f"global_qualify_check: {name} is defined at GLOBAL_QUALIFY_LIST.txt, but the link doe's not have primary declaration.") + found_error = True + elif link != primary_link: + print(f"global_qualify_check: {name} is defined at GLOBAL_QUALIFY_LIST.txt, but the link is not for primary declaration.") + found_error = True + + return not found_error + +if __name__ == '__main__': + found_error = False + with open("GLOBAL_QUALIFY_LIST.txt") as f: + global_qualify_list = f.read() + with open("PRIMARY_OVERLOAD_SPECIALIZATION.txt") as f: + primary_overload_specialization_list = f.read() + + if not check(global_qualify_list, primary_overload_specialization_list): + found_error = True + + if found_error: + sys.exit(1) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 833052c80e..0389718a77 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -37,6 +37,7 @@ # 7. オーバーロードされている名前は、優先度の高いプライマリ宣言をグローバル修飾リストに登録する # 7.1 ライブラリごとにオーバーロード・特殊化されているものはグローバル修飾リストに登録せず、個別ページで指定する # (std::begin/std::end、std::common_typeなど) +# プライマリ宣言されている関数・クラスの一覧は、 PRIMARY_OVERLOAD_SPECIALIZATION.txt を参照 * floating-point-type[italic] * implementation-defined[italic] diff --git a/PRIMARY_OVERLOAD_SPECIALIZATION.txt b/PRIMARY_OVERLOAD_SPECIALIZATION.txt new file mode 100644 index 0000000000..c9a6a46557 --- /dev/null +++ b/PRIMARY_OVERLOAD_SPECIALIZATION.txt @@ -0,0 +1,159 @@ +# オーバーロード・特殊化されている関数・クラスのプライマリ宣言を列挙する。 +# これら識別子のうち、ここで定義されているリンク以外は、GLOBAL_QUALIFY_LIST.txtに登録してはならない。 +# このファイルへの登録ルールとしては、 +# 1. ヘッダごとにアルファベット順 +# 2. ただし、長い名前を優先して登録する +# 3. プライマリ宣言をどれかひとつに特定できない場合、[link]のように空リンクにする + +# +* std::erase_if[link /reference/algorithm/erase_if.md] + # dequeとflat_mapとflat_setとforward_listとlistとmapとsetとstringとunordered_mapとunordered_setとvectorでオーバーロードされている +* std::erase[link /reference/algorithm/erase.md] + # dequeとforward_listとlistとstringとvectorでオーバーロードされている +* std::iter_swap[link /reference/algorithm/iter_swap.md] + # iteratorにもある +* std::swap[link /reference/algorithm/swap.md] + +# +* std::atomic_compare_exchange_strong_explicit[link /reference/atomic/atomic_compare_exchange_strong_explicit.md] + # memoryでオーバーロードされている +* std::atomic_compare_exchange_strong[link /reference/atomic/atomic_compare_exchange_strong.md] + # memoryでオーバーロードされている +* std::atomic_compare_exchange_weak_explicit[link /reference/atomic/atomic_compare_exchange_weak_explicit.md] +* std::atomic_compare_exchange_weak[link /reference/atomic/atomic_compare_exchange_weak.md] +* std::atomic_exchange[link /reference/atomic/atomic_exchange.md] +* std::atomic_exchange_explicit[link /reference/atomic/atomic_exchange_explicit.md] +* std::atomic_is_lock_free[link /reference/atomic/atomic_is_lock_free.md] +* std::atomic_load_explicit[link /reference/atomic/atomic_load_explicit.md] +* std::atomic_load[link /reference/atomic/atomic_load.md] +* std::atomic_store_explicit[link /reference/atomic/atomic_store_explicit.md] +* std::atomic_store[link /reference/atomic/atomic_store.md] +* std::atomic[link /reference/atomic/atomic.md] + +# +* std::tolower[link /reference/cctype/tolower.md] +* std::toupper[link /reference/cctype/toupper.md] + +# +* std::acosh[link /reference/cmath/acosh.md] + # complexでオーバーロードされている +* std::acos[link /reference/cmath/acos.md] + # valarrayとcomplexでオーバーロードされている +* std::asinh[link /reference/cmath/asinh.md] + # complexでオーバーロードされている +* std::asin[link /reference/cmath/asin.md] + # valarrayとcomplexでオーバーロードされている +* std::atan2[link /reference/cmath/atan2.md] + # valarrayでオーバーロードされている +* std::atanh[link /reference/cmath/atanh.md] + # complexでオーバーロードされている +* std::atan (valarrayとcomplexでオーバーロードされている。プライマリはcmath) +* std::ceil[link /reference/cmath/ceil.md] + # chronoでオーバーロードされている +* std::cosh[link /reference/cmath/cosh.md] + # valarrayとcomplexでオーバーロードされている +* std::cos[link /reference/cmath/cos.md] + # valarrayとcomplexでオーバーロードされている +* std::exp[link /reference/cmath/exp.md] + # valarrayとcomplexでオーバーロードされている +* std::floor[link /reference/cmath/floor.md] + # chronoでオーバーロードされている +* std::log10[link /reference/cmath/log10.md] + # valarrayとcomplexでオーバーロードされている +* std::log[link /reference/cmath/log.md] + # valarrayとcomplexでオーバーロードされている +* std::pow[link /reference/cmath/pow.md] + # valarrayとcomplexでオーバーロードされている +* std::round[link /reference/cmath/round.md] + # chronoでオーバーロードされている +* std::sinh[link /reference/cmath/sinh.md] + # complexでオーバーロードされている +* std::sin[link /reference/cmath/sinh.md] + # valarrayとcomplexでオーバーロードされている +* std::sqrt[link /reference/cmath/sqrt.md] + # valarrayとcomplexでオーバーロードされている +* std::tanh[link /reference/cmath/tanh.md] + # valarrayとcomplexでオーバーロードされている +* std::tan[link /reference/cmath/tan.md] + # valarrayとcomplexでオーバーロードされている + +# +* std::remove[link /reference/cstdio/remove.md] + # algorithmでオーバーロードされている + +# +* std::abs[link /reference/cstdlib/abs.md] + # cmathとvalarrayとcomplexでオーバーロードされている + +# +* std::unexpected[link /reference/expected/unexpected.md] + # exceptionにもある。先に登録されたのはそちらだが、すでに機能削除されている + +# +* std::formatter (いろんなところで特殊化されている。プライマリはformat) +* std::enable_nonlocking_formatter_optimization (chronoで特殊化されている。プライマリはformat) + +# +* operator>>[link /reference/istream/basic_istream/op_istream_free.md] + * あちこちでオーバーロードされている + +# + * std::begin[link /reference/iterator/begin.md] + * std::end[link /reference/iterator/end.md] + +# +* std::uses_allocator[link /reference/memory/uses_allocator.md] + * flat_mapとflat_setとfutureで特殊化されている + +# +* operator<<[link /reference/ostream/basic_ostream/op_ostream_free.md] + * あちこちでオーバーロードされている + +# +* std::println[link /reference/print/println.md] + * ostreamでオーバーロードされている +* std::print[link /reference/print/print.md] + * ostreamでオーバーロードされている +* std::vprint_unicode[link /reference/print/vprint_unicode.md] + * ostreamでオーバーロードされている +* std::vprint_nonunicode[link /reference/print/vprint_nonunicode.md] + +# +* is_error_code_enum[link /reference/system_error/is_error_code_enum.md] + # futureで特殊化されている +* make_error_code[link /reference/system_error/make_error_code.md] + # futureでオーバーロードされている +* make_error_condition[link /reference/system_error/make_error_condition.md] + # futureでオーバーロードされている + +# +* std::tuple_size[link /reference/tuple/tuple_size.md] + # std::arrayとstd::complexが特殊化している +* std::tuple_element[link /reference/tuple/tuple_element.md] + # std::arrayとstd::complexが特殊化している +* std::get[link /reference/tuple/get.md] + # std::arrayとstd::complexとstd::variantがオーバーロードしている + +# +* std::basic_common_reference[link /reference/type_traits/basic_common_reference.md] + # tupleとutilityで特殊化されている +* std::common_type[link /reference/type_traits/common_type.md] + # chronoで特殊化されている + +# +* std::move[link /reference/utility/move.md] + + +* operator==[link] +* operator!=[link] +* operator<=>[link] +* operator<=[link] +* operator<[link] +* operator>=[link] +* operator>[link] +* std::sorted_equivalent_t[link] + # flat_mapとflat_setにある +* std::sorted_unique_t[link] + # flat_mapとflat_setにある +* std::this_thread[link] + # executionとthreadにある diff --git a/start_editing.md b/start_editing.md index 65ee4f8c96..1fd44f9fa9 100644 --- a/start_editing.md +++ b/start_editing.md @@ -38,11 +38,28 @@ buildアクションで、MarkdownからHTMLへの変換と、GitHub Pagesへの #### 自動テスト -- 禁止文字の検出 (detect forbidden charactersアクション) - - ソフトハイフンやゼロ幅スペースなどの禁止された文字が使用されている場合に、エラーが発生する -- 内部リンクの誤り検出 (inner link checkアクション) - - サイト内のリンクが存在しない、または存在しているのに.nolinkを指定している場合にエラーが発生する - - [GitHub Actionsの実行ログ](https://github.com/cpprefjp/site/actions/workflows/check.yml)で、どのページのどのリンクが不正かがわかるので、それを修正すること +- checkアクション + - 禁止文字の検出 (detect forbidden characters) + - ソフトハイフンやゼロ幅スペースなどの禁止された文字が使用されている場合に、エラーが発生する + - 内部リンクの誤り検出 (inner link check) + - サイト内のリンクが存在しない、または存在しているのに.nolinkを指定している場合にエラーが発生する + - [GitHub Actionsの実行ログ](https://github.com/cpprefjp/site/actions/workflows/check.yml)で、どのページのどのリンクが不正かがわかるので、それを修正すること + - コード修飾の誤り検出 (code qualify check) + - コードブロック中のコードを修飾しているのに、その修飾対象がない場合に、エラーが発生する + - [GitHub Actionsの実行ログ](https://github.com/cpprefjp/site/actions/workflows/check.yml)で、どのページのどのコード修飾が不正かがわかるので、それを修正すること + - グローバル修飾リストの誤り検出 (global qualify check) + - `GLOBAL_QUALIFY_LIST.txt`に登録されている識別子のうち、`PRIMARY_OVERLOAD_SPECIALIZATION_LIST.txt`に登録されているプライマリ宣言へのリンク以外が登録されている場合に、エラーが発生する + - 所属ヘッダメタ情報の誤り検出 (meta header check) + - `[meta header]`または`[meta module]`指定が誤っている(ディレクトリ階層と一致しない)場合に、エラーが発生する + - 導入経緯は [PR#1204](https://github.com/cpprefjp/site/issues/1204) を参照 + - NGワードの検出 (ngword check) + - 日本語入力環境における典型的な誤入力・誤変換をエラーとして検知する + - 具体的な対象ワードリストは[ngword_check.py](https://github.com/cpprefjp/site/blob/master/.github/workflows/script/ngword_check.py)を参照 + - 用語の誤った使い方を検出 (defined word check) + - 用語の許可した使い方、許可しない使い方を列挙し、許可した使い方以外の使われ方をエラーとして検出する + - 具体的な用語、許可した使い方、許可しない使い方は、[defined_word_check.py](https://github.com/cpprefjp/site/blob/master/.github/workflows/script/defined_word_check.py)を参照 + - 表示崩れする書き方を検出 (display error check) + - 箇条書きのインデントが4の倍数でない行をエラーとして検出する - 外部リンク切れを検出 (outer link checkアクション) - 日本時間で日曜日の23:30に実行される - 外部リンクのページにアクセスできない (ページが消滅したか、一時的にアクセスできない、などの理由) 場合にエラーとなる @@ -50,20 +67,6 @@ buildアクションで、MarkdownからHTMLへの変換と、GitHub Pagesへの - ページが消滅した場合は、代替となるものがあれば差し替え、なければInternet Archiveに変更する - 一時的にアクセスできない場合は、時間を置いてアクセスできるようになったらissueを閉じる - 海外からのアクセス (GitHub Actions) を拒否しているページもあるため、そのようなページは個別にチェックから外す ([link_check.py](https://github.com/cpprefjp/site/blob/master/.github/workflows/script/link_check.py)の`IGNORE_LIST`に追加する) -- コード修飾の誤り検出 (code qualify checkアクション) - - コードブロック中のコードを修飾しているのに、その修飾対象がない場合に、エラーが発生する - - [GitHub Actionsの実行ログ](https://github.com/cpprefjp/site/actions/workflows/check.yml)で、どのページのどのコード修飾が不正かがわかるので、それを修正すること -- 所属ヘッダメタ情報の誤り検出 (meta header checkアクション) - - `[meta header]`または`[meta module]`指定が誤っている(ディレクトリ階層と一致しない)場合に、エラーが発生する - - 導入経緯は [PR#1204](https://github.com/cpprefjp/site/issues/1204) を参照 -- NGワードの検出 (ngword checkアクション) - - 日本語入力環境における典型的な誤入力・誤変換をエラーとして検知する - - 具体的な対象ワードリストは[ngword_check.py](https://github.com/cpprefjp/site/blob/master/.github/workflows/script/ngword_check.py)を参照 -- 用語の誤った使い方を検出 (defined word checkアクション) - - 用語の許可した使い方、許可しない使い方を列挙し、許可した使い方以外の使われ方をエラーとして検出する - - 具体的な用語、許可した使い方、許可しない使い方は、[defined_word_check.py](https://github.com/cpprefjp/site/blob/master/.github/workflows/script/defined_word_check.py)を参照 -- 表示崩れする書き方を検出 (display error checkアクション) - - 箇条書きのインデントが4の倍数でない行をエラーとして検出する ### 自動反映ツール From 4b0e7ea7c835aefe4e7bc318783691ed1d366242 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 22 Jul 2025 18:39:16 +0900 Subject: [PATCH 2258/3948] =?UTF-8?q?node=5Fhandle=20:=20=E3=83=AA?= =?UTF-8?q?=E3=83=B3=E3=82=AF=E3=83=9F=E3=82=B9=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/node_handle/node_handle/swap.md | 2 +- reference/node_handle/node_handle/swap_free.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/node_handle/node_handle/swap.md b/reference/node_handle/node_handle/swap.md index c3f3741ac2..a2ba4f1dcd 100644 --- a/reference/node_handle/node_handle/swap.md +++ b/reference/node_handle/node_handle/swap.md @@ -64,7 +64,7 @@ int main() } ``` * swap[color ff0000] -* extract[link reference/map/map/extract.md.nolink] +* extract[link /reference/map/map/extract.md] * key[link key.md] * mapped[link mapped.md] diff --git a/reference/node_handle/node_handle/swap_free.md b/reference/node_handle/node_handle/swap_free.md index 676ddfe2b6..919a7f31a3 100644 --- a/reference/node_handle/node_handle/swap_free.md +++ b/reference/node_handle/node_handle/swap_free.md @@ -52,7 +52,7 @@ int main() } ``` * std::swap[color ff0000] -* extract[link reference/map/map/extract.md.nolink] +* extract[link /reference/map/map/extract.md] * key[link key.md] * mapped[link mapped.md] From 700975a36d656a697d230e166cb683cc684cd639 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Wed, 23 Jul 2025 21:00:41 +0900 Subject: [PATCH 2259/3948] =?UTF-8?q?=E5=90=8D=E5=89=8D=E7=A9=BA=E9=96=93?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3=20std::range=20=E2=86=92=20std::ran?= =?UTF-8?q?ges?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/subrange_kind.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/ranges/subrange_kind.md b/reference/ranges/subrange_kind.md index 88285aba6a..9b8c8cf097 100644 --- a/reference/ranges/subrange_kind.md +++ b/reference/ranges/subrange_kind.md @@ -1,6 +1,6 @@ # subrange_kind * ranges[meta header] -* std::range[meta namespace] +* std::ranges[meta namespace] * enum[meta id-type] * cpp20[meta cpp] From 24dc1089c1641f9fe2912a0f1478b68eb2d60cca Mon Sep 17 00:00:00 2001 From: rotarymars Date: Thu, 24 Jul 2025 21:29:45 +0900 Subject: [PATCH 2260/3948] added info for bufsiz.md --- reference/cstdio/bufsiz.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdio/bufsiz.md b/reference/cstdio/bufsiz.md index 8f1ff4180a..c8af3427c6 100644 --- a/reference/cstdio/bufsiz.md +++ b/reference/cstdio/bufsiz.md @@ -10,7 +10,7 @@ ## 概要 [`setbuf()`](/reference/cstdio/setbuf.md.nolink)関数で使われる標準入出力のバッファサイズを表すマクロ。 -このマクロは、標準入出力関数で使用されるデフォルトのバッファサイズを定義する。値は実装依存であるが、一般的には512バイトや1024バイトなどの値が使用される。 +このマクロは、標準入出力関数で使用されるデフォルトのバッファサイズを定義する。値は実装依存であり、256バイト以上であることは保証されているが、一般的には512バイトや1024バイトなどの値が使用される。 ## 例 ```cpp example From a24d77626e24507f94bc3ba95acb9b323985084a Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 25 Jul 2025 19:26:24 +0900 Subject: [PATCH 2261/3948] =?UTF-8?q?atomic/atomic=5Fflag:=20LWG3659?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://cplusplus.github.io/LWG/issue3659 ATOMIC_FLAG_INIT非推奨化を取消 --- lang/cpp20.md | 1 - reference/atomic.md | 2 +- reference/atomic/atomic_flag/op_constructor.md | 7 ++++--- reference/atomic/atomic_flag_init.md | 9 +++------ 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/lang/cpp20.md b/lang/cpp20.md index 3a630afe87..53140fef53 100644 --- a/lang/cpp20.md +++ b/lang/cpp20.md @@ -324,7 +324,6 @@ C++20とは、2020年中に改訂され、ISO/IEC 14882:2020で標準規格化 - [`std::atomic`](/reference/atomic/atomic.md)クラスと[`std::atomic_flag`](/reference/atomic/atomic_flag.md)クラスのデフォルトコンストラクタが値初期化するようになったため、不要になった以下のアトミックオブジェクトの初期化機能を非推奨化: - [`std::atomic_init()`](/reference/atomic/atomic_init.md)関数 - [`ATOMIC_VAR_INIT`](/reference/atomic/atomic_var_init.md)マクロ - - [`ATOMIC_FLAG_INIT`](/reference/atomic/atomic_flag_init.md)マクロ - [`std::shared_ptr`](/reference/memory/shared_ptr.md)の[`std::atomic`特殊化](/reference/memory/atomic.md)追加にともない、[`std::shared_ptr`](/reference/memory/shared_ptr.md)に対する以下のアトミック操作を非推奨化: - [`std::atomic_is_lock_free`](/reference/memory/shared_ptr/atomic_is_lock_free.md) - [`std::atomic_load`](/reference/memory/shared_ptr/atomic_load.md) diff --git a/reference/atomic.md b/reference/atomic.md index 556f074d7a..5a9e4a4236 100644 --- a/reference/atomic.md +++ b/reference/atomic.md @@ -113,7 +113,7 @@ | [`atomic_flag_wait_explicit`](atomic/atomic_flag_wait_explicit.md) | メモリオーダーを指定して起床されるまで待機する (function) | C++20 | | [`atomic_flag_notify_one`](atomic/atomic_flag_notify_one.md) | 待機しているスレッドをひとつ起床させる (function) | C++20 | | [`atomic_flag_notify_all`](atomic/atomic_flag_notify_all.md) | 待機している全てのスレッドを起床させる (function) | C++20 | -| [`ATOMIC_FLAG_INIT`](atomic/atomic_flag_init.md) | フラグ変数の初期化(define) | C++11
C++20から非推奨 | +| [`ATOMIC_FLAG_INIT`](atomic/atomic_flag_init.md) | フラグ変数の初期化(define) | C++11 | ## フェンス diff --git a/reference/atomic/atomic_flag/op_constructor.md b/reference/atomic/atomic_flag/op_constructor.md index f511c95f68..7d64b3bd34 100644 --- a/reference/atomic/atomic_flag/op_constructor.md +++ b/reference/atomic/atomic_flag/op_constructor.md @@ -13,14 +13,14 @@ atomic_flag(const atomic_flag&) = delete; // (2) C++11 atomic_flag(atomic_flag&&) = delete; // (3) C++11 atomic_flag(FOR_ATOMIC_FLAG_INIT); // (4) C++11 - // (4) C++20で非推奨 ``` +* FOR_ATOMIC_FLAG_INIT[italic] ## 概要 - (1) : デフォルトコンストラクタ - (2) : コピーコンストラクタ。コピー禁止 - (3) : ムーブコンストラクタ。ムーブ禁止 -- (4) : `ATOMIC_FLAG_INIT`マクロのための特別なコンストラクタ。フラグをクリアする。`atomic_flag`クラスのデフォルトコンストラクタはデフォルト定義されるため、デフォルト構築では未初期化状態となる。 +- (4) : [`ATOMIC_FLAG_INIT`](../atomic_flag_init.md)マクロでコピー初期化を行うための特別なコンストラクタ。フラグをクリアする。 ## 効果 @@ -29,7 +29,7 @@ atomic_flag(FOR_ATOMIC_FLAG_INIT); // (4) C++11 - C++14 : フラグを未規定の状態にする - C++20 : フラグをクリア状態にする - (4) : - - `ATOMIC_FLAG_INIT`マクロを使用することで、フラグがクリアされた状態となる + - コピー初期化形式で[`ATOMIC_FLAG_INIT`](../atomic_flag_init.md)マクロを使用することで、フラグがクリアされた状態となる - C++11 : このマクロを、静的な有効期間を持つ`atomic_flag`オブジェクトに使用した場合、その初期化は静的に行われる - C++14 : このマクロを、完全に静的な有効期間を持つ`atomic_flag`オブジェクトに使用した場合、その初期化は静的に行われる @@ -65,3 +65,4 @@ int main() ## 参照 - [LWG Issue 2159. `atomic_flag` initialization](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2159) - [P0883R2 Fixing Atomic Initialization, Rev2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0883r2.pdf) +- [LWG Issue 3659. Consider `ATOMIC_FLAG_INIT` undeprecation](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#3659) diff --git a/reference/atomic/atomic_flag_init.md b/reference/atomic/atomic_flag_init.md index 94db339aac..04d97c796b 100644 --- a/reference/atomic/atomic_flag_init.md +++ b/reference/atomic/atomic_flag_init.md @@ -2,22 +2,18 @@ * atomic[meta header] * macro[meta id-type] * cpp11[meta cpp] -* cpp20deprecated[meta cpp] ```cpp #define ATOMIC_FLAG_INIT see below ``` -この機能はC++20で非推奨となった。[`std::atomic_flag`](atomic_flag.md)クラスのデフォルトコンストラクタが値初期化するようになったため、初期化のためにこの機能を使用する必要はない。 - - ## 概要 -フラグを初期化する。 +フラグをクリア状態に初期化する。 このマクロは、[`atomic_flag`](atomic_flag.md)オブジェクトの初期化に使用し、フラグをクリア状態にする。静的オブジェクトに対しては、その初期化は静的に行われなければならない。 -## 非推奨の詳細 (C++20) +## 備考 C言語との互換性のために、`std::atomic_flag`クラスのデフォルトコンストラクタはトリビアルに定義され、初期値は未規定となっていた。そのためこの機能を介して`std::atomic_flag`オブジェクトを初期化する必要があったが、C++20からデフォルトコンストラクタが値初期化を行うようになったため、初期化のためにこの機能を使用する必要はなくなった。 @@ -59,3 +55,4 @@ false ## 参照 - [P0883R2 Fixing Atomic Initialization, Rev2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0883r2.pdf) +- [LWG Issue 3659. Consider `ATOMIC_FLAG_INIT` undeprecation](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#3659) From d6e259e9bb0c83020727691685afacf04e40b146 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 28 Jul 2025 17:50:17 +0900 Subject: [PATCH 2262/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=83=81?= =?UTF-8?q?=E3=82=A7=E3=83=83=E3=82=AFCI=20:=20=E3=82=B0=E3=83=AD=E3=83=BC?= =?UTF-8?q?=E3=83=90=E3=83=AB=E4=BF=AE=E9=A3=BE=E3=83=AA=E3=82=B9=E3=83=88?= =?UTF-8?q?=E3=81=AE=E3=83=AA=E3=83=B3=E3=82=AF=E3=82=82=E3=83=81=E3=82=A7?= =?UTF-8?q?=E3=83=83=E3=82=AF=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= =?UTF-8?q?=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/script/link_check.py | 13 ++++++++++--- PRIMARY_OVERLOAD_SPECIALIZATION.txt | 12 ++++++------ 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/workflows/script/link_check.py b/.github/workflows/script/link_check.py index 2787f1b7a4..1045438532 100644 --- a/.github/workflows/script/link_check.py +++ b/.github/workflows/script/link_check.py @@ -75,7 +75,7 @@ def is_ignore_link(link: str) -> bool: return False -def find_all_links(text: str) -> (list, set): +def find_all_links(text: str, is_global: bool) -> (list, set): inner_links = [] outer_links = set() @@ -115,6 +115,10 @@ def add_link(origin_link: str): add_link(link) for line in text.split("\n"): + # コメント + if is_global and line.startswith("#"): + continue + for m in re.finditer(r'[\*-] (.*?)\[link (.*?)\]', line): add_link(m.group(2)) @@ -144,12 +148,15 @@ def add_link(origin_link: str): current_dir = os.getcwd() outer_link_dict = dict() if len(args.url) <= 0: - for p in glob.glob("**/*.md", recursive=True): + path_list = [(p, False) for p in glob.glob("**/*.md", recursive=True)] + path_list.append(("GLOBAL_QUALIFY_LIST.txt", True)) + path_list.append(("PRIMARY_OVERLOAD_SPECIALIZATION.txt", True)) + for p, is_global in path_list: dirname = os.path.dirname(p) with open(p) as f: text = f.read() - inner_links, outer_links = find_all_links(text) + inner_links, outer_links = find_all_links(text, is_global) for link in outer_links: if link in outer_link_dict: outer_link_dict[link].append(p) diff --git a/PRIMARY_OVERLOAD_SPECIALIZATION.txt b/PRIMARY_OVERLOAD_SPECIALIZATION.txt index c9a6a46557..c3991a4358 100644 --- a/PRIMARY_OVERLOAD_SPECIALIZATION.txt +++ b/PRIMARY_OVERLOAD_SPECIALIZATION.txt @@ -6,13 +6,8 @@ # 3. プライマリ宣言をどれかひとつに特定できない場合、[link]のように空リンクにする # -* std::erase_if[link /reference/algorithm/erase_if.md] - # dequeとflat_mapとflat_setとforward_listとlistとmapとsetとstringとunordered_mapとunordered_setとvectorでオーバーロードされている -* std::erase[link /reference/algorithm/erase.md] - # dequeとforward_listとlistとstringとvectorでオーバーロードされている * std::iter_swap[link /reference/algorithm/iter_swap.md] # iteratorにもある -* std::swap[link /reference/algorithm/swap.md] # * std::atomic_compare_exchange_strong_explicit[link /reference/atomic/atomic_compare_exchange_strong_explicit.md] @@ -131,7 +126,7 @@ # std::arrayとstd::complexが特殊化している * std::tuple_element[link /reference/tuple/tuple_element.md] # std::arrayとstd::complexが特殊化している -* std::get[link /reference/tuple/get.md] +* std::get[link /reference/tuple/tuple/get.md] # std::arrayとstd::complexとstd::variantがオーバーロードしている # @@ -142,6 +137,7 @@ # * std::move[link /reference/utility/move.md] +* std::swap[link /reference/utility/swap.md] * operator==[link] @@ -151,6 +147,10 @@ * operator<[link] * operator>=[link] * operator>[link] +* std::erase_if[link] + # dequeとflat_mapとflat_setとforward_listとlistとmapとsetとstringとunordered_mapとunordered_setとvectorでオーバーロードされている +* std::erase[link] + # dequeとforward_listとlistとstringとvectorでオーバーロードされている * std::sorted_equivalent_t[link] # flat_mapとflat_setにある * std::sorted_unique_t[link] From 408e16d33104413f9c6e1cfacb79de4fc25e8d3e Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Tue, 29 Jul 2025 14:44:02 +0900 Subject: [PATCH 2263/3948] =?UTF-8?q?=E3=82=A4=E3=83=B3=E3=83=A9=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=82=B3=E3=83=BC=E3=83=89=E3=83=96=E3=83=AD=E3=83=83?= =?UTF-8?q?=E3=82=AF=E3=81=AE=E9=96=8B=E3=81=8D=E5=BF=98=E3=82=8C=E3=80=81?= =?UTF-8?q?=E9=96=89=E3=81=98=E5=BF=98=E3=82=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 以下の正規表現で絞り込みました。 ^([^`]*`[^`]+`)*[^`]*`[^`]*$ --- reference/execution/execution/single-sender-value-type.md | 2 +- reference/stdexcept.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/execution/execution/single-sender-value-type.md b/reference/execution/execution/single-sender-value-type.md index dcbd671382..4dcf2637e8 100644 --- a/reference/execution/execution/single-sender-value-type.md +++ b/reference/execution/execution/single-sender-value-type.md @@ -16,7 +16,7 @@ using single-sender-value-type = see below; // exposition only - [`value_types_of_t`](value_types_of_t.md)``が適格であるならば、その型。 - そうではなく、[`value_types_of_t`](value_types_of_t.md)``が`variant>`もしくは`variant<>`ならば、`void`型。 -- [`value_types_of_t`](value_types_of_t.md)``が適格であるならば、その型。 +- [`value_types_of_t`](value_types_of_t.md)``が適格であるならば、その型。 - そうでなければ、`single-sender-value-type`は不適格。 diff --git a/reference/stdexcept.md b/reference/stdexcept.md index 5c95958c80..2074a51a5f 100644 --- a/reference/stdexcept.md +++ b/reference/stdexcept.md @@ -44,7 +44,7 @@ | 名前 | 説明 | 対応バージョン | |--------------------|--------------------------------------------|-------| -| `explicit T(const` [`string`](/reference/string/basic_string.md)`& what_arg); // C++03`
`constexpr explicit T(const` [`string`](/reference/string/basic_string.md)`& what_arg); // C++26 | 指定したメッセージを持つ例外オブジェクトを生成する | | +| `explicit T(const` [`string`](/reference/string/basic_string.md)`& what_arg); // C++03`
`constexpr explicit T(const` [`string`](/reference/string/basic_string.md)`& what_arg); // C++26` | 指定したメッセージを持つ例外オブジェクトを生成する | | | `explicit T(const char* what_arg); // C++11`
`constexpr explicit T(const char* what_arg); // C++26` | 指定したメッセージを持つ例外オブジェクトを生成する | C++11 | | `virtual const char* what() const noexcept; // C++03`
`constexpr virtual const char* what() const noexcept; // C++26` | メッセージを取得する | | From 2798af6fb2cc9cfc931e58dfde42b797ae94259b Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 31 Jul 2025 21:34:14 +0900 Subject: [PATCH 2264/3948] execution/sender: LWG4202 --- reference/execution/execution/sender.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/reference/execution/execution/sender.md b/reference/execution/execution/sender.md index 216fea494b..12b11c6bee 100644 --- a/reference/execution/execution/sender.md +++ b/reference/execution/execution/sender.md @@ -10,6 +10,9 @@ namespace std::execution { concept sender; struct sender_t {}; // タグ型 + + template + inline constexpr bool enable_sender = see below; } ``` @@ -20,6 +23,7 @@ namespace std::execution { - 下記いずれかを満たす - `sender_t`をメンバ型`Sndr::sender_concept`として定義する + - `enable_sender`変数テンプレートを`true`で特殊化する - [コルーチンのAwaitable型](/lang/cpp20/coroutines.md) - [`get_env`](get_env.md)で[属性](../queryable.md)を取得できる - ムーブ可能 @@ -43,12 +47,19 @@ concept enable-sender = * env-promise[link env-promise.md] * env<>[link env.md] +`enable_sender`変数テンプレートを以下のように定義する。 + +```cpp +template +inline constexpr bool enable_sender = enable-sender; +``` + `sender`コンセプトは、以下のように定義される。 ```cpp template concept sender = - bool(enable-sender>) && + enable_sender>) && requires (const remove_cvref_t& sndr) { { get_env(sndr) } -> queryable; } && @@ -61,8 +72,7 @@ concept sender = ## 備考 -`sender`コンセプトの制約式に現れる第1項`bool(enable-sender<...>)`は[原子制約(atomic constraint)](/lang/cpp20/concepts.md)を構成する。 -これによりオーバーロード解決時の優先順比較において`enable-sender`コンセプトの`||`を単純なOR条件とみなせ、コンパイル時の複雑な包摂関係計算コストを抑制できる。 +プログラム定義型が`sender`コンセプトを満たす場合、ユーザは`enable_sender`変数テンプレートを`true`として特殊化してもよい。そのような特殊化は定数式で利用可能かつ`const bool`型をもつこと。 ## 例 @@ -103,3 +113,4 @@ int main() ## 参照 - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [LWG 4202. enable-sender should be a variable template](https://cplusplus.github.io/LWG/issue4202) From 222e1a3294067f833f4da783b882480891031967 Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 31 Jul 2025 21:40:08 +0900 Subject: [PATCH 2265/3948] execution/let_value: LWG4204, LWG4205 --- reference/execution/execution/let_value.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/reference/execution/execution/let_value.md b/reference/execution/execution/let_value.md index 226d1d486d..cbe8531ad9 100644 --- a/reference/execution/execution/let_value.md +++ b/reference/execution/execution/let_value.md @@ -95,7 +95,7 @@ namespace std::execution { - 説明用の型`Tag`とパック`Args`に対して、説明用のエイリアステンプレート`as-sndr2`を[`call-result-t`](/reference/functional/call-result-t.md)`&...>`と定義する。型`ops2_variant_t`は下記定義において重複削除した型となる。 ```cpp - variant, receiver2>...> + variant, receiver2>...> ``` * variant[link /reference/variant/variant.md] * monostate[link /reference/variant/monostate.md] @@ -125,7 +125,14 @@ namespace std::execution { 説明用の式`sndr`と`env`に対して、型`Sndr`を`decltype((sndr))`とする。[`sender-for`](sender-for.md)`> == false`のとき、式`let-cpo.transform_env(sndr, env)`は不適格となる。 -そうでなければ、式`let-cpo.transform_env(sndr, env)`は[`JOIN-ENV`](../queryable.md)`(let-env(sndr),` [`FWD-ENV`](../forwarding_query.md)`(env))`と等価。 +そうでなければ、式`let-cpo.transform_env(sndr, env)`は下記と等価。 + +```cpp +auto& [_, _, child] = sndr; +return JOIN-ENV(let-env(child), FWD-ENV(env)); +``` +* JOIN-ENV[link ../queryable.md] +* FWD-ENV[link ../forwarding_query.md] ## 説明専用エンティティ @@ -400,3 +407,5 @@ catch 0 - [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) - [P3396R1 std::execution wording fixes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3396r1.html) +- [LWG 4204. specification of `as-sndr2(Sig)` in [exec.let] is incomplete](https://cplusplus.github.io/LWG/issue4204) +- [LWG 4205. `let_[*].transform_env` is specified in terms of the `let_*` sender itself instead of its child](https://cplusplus.github.io/LWG/issue4205) From 46c87af7befb28566eb8c2206b1dfa3eb1001313 Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 31 Jul 2025 21:50:28 +0900 Subject: [PATCH 2266/3948] execution/connect: LWG4208 --- reference/execution/execution/connect.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reference/execution/execution/connect.md b/reference/execution/execution/connect.md index 1ca3d497b1..484c5208c8 100644 --- a/reference/execution/execution/connect.md +++ b/reference/execution/execution/connect.md @@ -32,7 +32,7 @@ transform_sender(decltype(get-domain-late(sndr, get_env(rcvr))){}, sndr, get_env * get-domain-late[link get-domain-late.md] * get_env[link get_env.md] -式`connect(sndr, rcvr)`は下記と等価であり、[`operation_state`](operation_state.md)を満たす型の値となる。 +式`connect(sndr, rcvr)`は`rcvr`が1回だけ評価されることを除いて、下記と等価。式の型は[`operation_state`](operation_state.md)を満たす。 - 適格であるならば、式`new_sndr.connect(rcvr)` - そうでなければ、式`connect-awaitable(new_sndr, rcvr)` @@ -238,3 +238,4 @@ int main() ## 参照 - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) - [P3396R1 std::execution wording fixes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3396r1.html) +- [LWG 4208. Wording needs to ensure that in `connect(sndr, rcvr)` that `rcvr` expression is only evaluated once](https://cplusplus.github.io/LWG/issue4208) From 86a0ae386967dff230e2d6f64a072ab802d22c6b Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 31 Jul 2025 21:53:21 +0900 Subject: [PATCH 2267/3948] execution/default_domain/transform_env: LWG4209 --- reference/execution/execution/default_domain/transform_env.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reference/execution/execution/default_domain/transform_env.md b/reference/execution/execution/default_domain/transform_env.md index cdc915cddd..ebab7fb39b 100644 --- a/reference/execution/execution/default_domain/transform_env.md +++ b/reference/execution/execution/default_domain/transform_env.md @@ -28,7 +28,7 @@ template 説明用の式`e`を次の通りとしたとき、`e`を返す。 - 適格であるならば、式[`tag_of_t`](../tag_of_t.md)`().transform_env(`[`std::forward`](/reference/utility/forward.md)`(sndr),` [`std::forward`](/reference/utility/forward.md)`(env))` -- そうでなければ、`static_cast(`[`std::forward`](/reference/utility/forward.md)`(env))` +- そうでなければ、[`FWD-ENV`](../../forwarding_query.md)`(`[`std::forward`](/reference/utility/forward.md)`(env))` ## 例外 @@ -53,3 +53,4 @@ template ## 参照 - [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [LWG 4209. `default_domain::transform_env` should be returning `FWD-ENV(env)`](https://cplusplus.github.io/LWG/issue4209) From 2aa170e38a92b594b09c4ff65b3375f28e3903aa Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 31 Jul 2025 21:59:01 +0900 Subject: [PATCH 2268/3948] execution/operation_state: LWG4200 --- reference/execution/execution/operation_state.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/execution/execution/operation_state.md b/reference/execution/execution/operation_state.md index ac0ea20c8d..06ebbf0740 100644 --- a/reference/execution/execution/operation_state.md +++ b/reference/execution/execution/operation_state.md @@ -9,9 +9,8 @@ namespace std::execution { template concept operation_state = derived_from && - is_object_v && requires (O& o) { - { start(o) } noexcept; + start(o); }; struct operation_state_t {}; // タグ型 @@ -25,8 +24,8 @@ namespace std::execution { 下記をみたすクラス型はOperation Stateとみなせる。 -- `operation_state_t`をメンバ型`O::operation_state_concept`として定義するクラス型 -- `O`型の左辺値`o`に対して[`execution::start`](start.md)`(o)`が有効な式かつ例外送出されないこと +- `operation_state_t`をメンバ型`O::operation_state_concept`として定義する +- `O`型の左辺値`o`に対して[`execution::start`](start.md)`(o)`が有効な式 非同期操作の生存期間中に`operation_state`オブジェクトが破棄されると、未定義の動作を引き起こす。 @@ -89,3 +88,4 @@ int main() ## 参照 - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [LWG 4200. The `operation_state` concept can be simplified](https://cplusplus.github.io/LWG/issue4200) From 0bf9ae6391387157cca3248ca664007b9dadf7ec Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 31 Jul 2025 22:01:29 +0900 Subject: [PATCH 2269/3948] execution/with-await-transform: LWG4201 --- reference/execution/execution/with-await-transform.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reference/execution/execution/with-await-transform.md b/reference/execution/execution/with-await-transform.md index ea25313480..39fbfe4967 100644 --- a/reference/execution/execution/with-await-transform.md +++ b/reference/execution/execution/with-await-transform.md @@ -20,8 +20,9 @@ namespace std::execution { } template T> - decltype(auto) await_transform(T&& value) + auto await_transform(T&& value) noexcept(noexcept(std::forward(value).as_awaitable(declval()))) + -> decltype(std::forward(value).as_awaitable(declval())) { return std::forward(value).as_awaitable(static_cast(*this)); } @@ -45,3 +46,4 @@ namespace std::execution { ## 参照 - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [LWG 4201. `with-await-transform::await_transform` should not use a deduced return type](https://cplusplus.github.io/LWG/issue4201) From 664d0699baa19a5c51b3b3ddea3af210899cd419 Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 31 Jul 2025 22:03:52 +0900 Subject: [PATCH 2270/3948] execution/when_all: LWG4227 --- reference/execution/execution/when_all.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reference/execution/execution/when_all.md b/reference/execution/execution/when_all.md index 0992cf2e97..ae02008c7a 100644 --- a/reference/execution/execution/when_all.md +++ b/reference/execution/execution/when_all.md @@ -92,7 +92,7 @@ namespace std::execution { `impls-for::get-state`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 ```cpp -[](Sndr&& sndr, Rcvr& rcvr) noexcept(e) -> decltype(e) { +[](Sndr&& sndr, Rcvr& rcvr) noexcept(noexcept(e)) -> decltype(e) { return e; } ``` @@ -477,3 +477,4 @@ error=-2 - [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) - [P3396R1 std::execution wording fixes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3396r1.html) +- [LWG 4227. Missing `noexcept` operator in [exec.when.all]](https://cplusplus.github.io/LWG/issue4227) From 9fee4b58d5d84e299877b0624cd66a30cee3bca5 Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 31 Jul 2025 22:41:23 +0900 Subject: [PATCH 2271/3948] executuon: LWG4203 --- reference/execution/execution/into_variant.md | 4 +++- reference/execution/execution/let_value.md | 5 +++-- reference/execution/execution/schedule_from.md | 6 ++++-- reference/execution/execution/stopped_as_optional.md | 7 +++++-- reference/execution/execution/when_all.md | 9 ++++++--- reference/execution/forwarding_query.md | 2 ++ 6 files changed, 23 insertions(+), 10 deletions(-) diff --git a/reference/execution/execution/into_variant.md b/reference/execution/execution/into_variant.md index 9907330d83..2e290b3ba4 100644 --- a/reference/execution/execution/into_variant.md +++ b/reference/execution/execution/into_variant.md @@ -52,13 +52,14 @@ namespace std::execution { ```cpp [](Sndr&& sndr, Rcvr& rcvr) noexcept - -> type_identity, env_of_t>> { + -> type_identity, FWD-ENV-T(env_of_t)>> { return {}; } ``` * type_identity[link /reference/type_traits/type_identity.md] * value_types_of_t[link value_types_of_t.md] * child-type[link child-type.md] +* FWD-ENV-T[link ../forwarding_query.md] * env_of_t[link env_of_t.md] `impls-for::complete`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 @@ -205,3 +206,4 @@ int main() ## 参照 - [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [LWG 4203. Constraints on `get-state` functions are incorrect](https://cplusplus.github.io/LWG/issue4203) diff --git a/reference/execution/execution/let_value.md b/reference/execution/execution/let_value.md index cbe8531ad9..90a4eb3184 100644 --- a/reference/execution/execution/let_value.md +++ b/reference/execution/execution/let_value.md @@ -84,7 +84,7 @@ namespace std::execution { } ``` -- 説明用のパック`Sigs`を[`completion_signatures_of_t`](completion_signatures_of_t.md)`<`[`child-type`](child-type.md)`,` [`env_of_t`](env_of_t.md)`>`による[`completion_signatures`](completion_signatures.md)特殊化のテンプレートパラメータとし、パック`LetSigs`を`Sigs`に含まれる型のうち戻り値型が[`decayed-typeof`](/reference/functional/decayed-typeof.md)``に等しいものと定義する。説明用のエイリアステンプレート`as-tuple`を[`decayed-tuple`](decayed-tuple.md)``と定義する。型`args_variant_t`は下記定義において重複削除した型となる。 +- 説明用のパック`Sigs`を[`completion_signatures_of_t`](completion_signatures_of_t.md)`<`[`child-type`](child-type.md)`,` [`FWD-ENV-T`](../forwarding_query.md)`(`[`env_of_t`](env_of_t.md)`)>`による[`completion_signatures`](completion_signatures.md)特殊化のテンプレートパラメータとし、パック`LetSigs`を`Sigs`に含まれる型のうち戻り値型が[`decayed-typeof`](/reference/functional/decayed-typeof.md)``に等しいものと定義する。説明用のエイリアステンプレート`as-tuple`を[`decayed-tuple`](decayed-tuple.md)``と定義する。型`args_variant_t`は下記定義において重複削除した型となる。 ```cpp variant...> @@ -215,7 +215,7 @@ namespace std::execution { メンバ関数`receiver2::get_env`の呼び出しは、下記を満たすオブジェクト`e`を返す。 - 型`decltype(e)`が[`queryable`](../queryable.md)のモデルであり、かつ -- 与えられた[クエリオブジェクト](../queryable.md)`q`に対して、式`e.query(q)`は式`env.query(q)`が有効ならばその式と等価。そうでなければ、式`e.query(q)`は[`get_env`](get_env.md)`(rcvr).query(q)`と等価。 +- 与えられた[クエリオブジェクト](../queryable.md)`q`に対して、式`e.query(q)`は式`env.query(q)`が有効ならばその式と等価。そうではなく、`q`の型が[`forwarding-query`](../forwarding-query.md)を満たすならば式`e.query(q)`は[`get_env`](get_env.md)`(rcvr).query(q)`と等価。そうでなければ、式`e.query(q)`は不適格となる。 ## カスタマイゼーションポイント @@ -407,5 +407,6 @@ catch 0 - [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) - [P3396R1 std::execution wording fixes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3396r1.html) +- [LWG 4203. Constraints on `get-state` functions are incorrect](https://cplusplus.github.io/LWG/issue4203) - [LWG 4204. specification of `as-sndr2(Sig)` in [exec.let] is incomplete](https://cplusplus.github.io/LWG/issue4204) - [LWG 4205. `let_[*].transform_env` is specified in terms of the `let_*` sender itself instead of its child](https://cplusplus.github.io/LWG/issue4205) diff --git a/reference/execution/execution/schedule_from.md b/reference/execution/execution/schedule_from.md index 151fd20264..8c221273ec 100644 --- a/reference/execution/execution/schedule_from.md +++ b/reference/execution/execution/schedule_from.md @@ -67,7 +67,7 @@ namespace std::execution { ```cpp [](Sndr&& sndr, Rcvr& rcvr) noexcept(see below) - requires sender_in, env_of_t> { + requires sender_in, FWD-ENV-T(env_of_t)> { auto& [_, sch, child] = sndr; @@ -91,6 +91,7 @@ namespace std::execution { ``` * sender_in[link sender_in.md] * child-type[link child-type.md] +* FWD-ENV-T[link ../forwarding_query.md] * env_of_t[link env_of_t.md] * connect_result_t[link connect_result_t.md] * schedule_result_t[link schedule_result_t.md] @@ -98,7 +99,7 @@ namespace std::execution { * schedule[link schedule.md] - ローカルクラス`state-type`のオブジェクトは[構造化束縛](/lang/cpp17/structured_bindings.md)における初期化子として利用できる。 -- 説明用のパック`Sigs`を[`completion_signatures_of_t`](completion_signatures_of_t.md)`<`[`child-type`](child-type.md)`,` [`env_of_t`](env_of_t.md)`>`による[`completion_signatures`](completion_signatures.md)特殊化のテンプレートパラメータと定義する。説明用のエイリアステンプレート`as-tuple`を[`decayed-tuple`](decayed-tuple.md)``と定義する。型`variant_t`は下記定義において重複削除した型となる。 +- 説明用のパック`Sigs`を[`completion_signatures_of_t`](completion_signatures_of_t.md)`<`[`child-type`](child-type.md)`,` [`FWD-ENV-T`](../forwarding_query.md)`(`[`env_of_t`](env_of_t.md)`)>`による[`completion_signatures`](completion_signatures.md)特殊化のテンプレートパラメータと定義する。説明用のエイリアステンプレート`as-tuple`を[`decayed-tuple`](decayed-tuple.md)``と定義する。型`variant_t`は下記定義において重複削除した型となる。 ```cpp variant...> @@ -211,3 +212,4 @@ Senderアルゴリズム構築時および[Receiver](receiver.md)接続時に、 - [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) - [P3396R1 std::execution wording fixes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3396r1.html) +- [LWG 4203. Constraints on `get-state` functions are incorrect](https://cplusplus.github.io/LWG/issue4203) diff --git a/reference/execution/execution/stopped_as_optional.md b/reference/execution/execution/stopped_as_optional.md index da13267d45..dc28ba07a4 100644 --- a/reference/execution/execution/stopped_as_optional.md +++ b/reference/execution/execution/stopped_as_optional.md @@ -30,13 +30,13 @@ transform_sender(get-domain-early(sndr), make-sender(stopped_as_optional, {}, sn ### Senderアルゴリズムタグ `stopped_as_optional` -説明用の式`sndr`と`env`に対して、型`Sndr`を`decltype((sndr))`、型`Env`を`decltype((env))`とする。[`sender-for`](sender-for.md)` == false`、もしくは[`single-sender-value-type`](single-sender-value-type.md)``が不適格または`void`のとき、式`stopped_as_optional.transform_sender(sndr, env)`は不適格となる。 +説明用の式`sndr`と`env`に対して、型`Sndr`を`decltype((sndr))`、型`Env`を`decltype((env))`とする。[`sender-for`](sender-for.md)` == false`、もしくは[`single-sender-value-type`](single-sender-value-type.md)`<`[`child-type`](child-type.md)`,` [`FWD-ENV-T`](../forwarding_query.md)`(Env)>`が不適格または`void`のとき、式`stopped_as_optional.transform_sender(sndr, env)`は不適格となる。 そうでなければ、式`stopped_as_optional.transform_sender(sndr, env)`は下記と等価。 ```cpp auto&& [_, _, child] = sndr; -using V = single-sender-value-type; +using V = single-sender-value-type, FWD-ENV-T(Env)>; return let_stopped( then(std::forward_like(child), [](Ts&&... ts) noexcept(is_nothrow_constructible_v) { @@ -45,6 +45,8 @@ return let_stopped( []() noexcept { return just(optional()); }); ``` * single-sender-value-type[link single-sender-value-type.md] +* child-type[link child-type.md] +* FWD-ENV-T[link ../forwarding_query.md] * let_stopped[link let_stopped.md] * then[link then.md] * just[link just.md] @@ -164,3 +166,4 @@ stopped ## 参照 - [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [LWG 4203. Constraints on `get-state` functions are incorrect](https://cplusplus.github.io/LWG/issue4203) diff --git a/reference/execution/execution/when_all.md b/reference/execution/execution/when_all.md index ae02008c7a..47fa9b2ec4 100644 --- a/reference/execution/execution/when_all.md +++ b/reference/execution/execution/when_all.md @@ -87,7 +87,7 @@ namespace std::execution { - `decltype(e)`が[`queryable`](../queryable.md)のモデル、かつ - 式`e.query(`[`get_stop_token`](../get_stop_token.md)`)`が`state.stop-src.`[`get_token()`](/reference/stop_token/inplace_stop_source/get_token.md)と等価、かつ -- [`get_stop_token`](../get_stop_token.md)以外の[クエリオブジェクト](../queryable.md)`q`に対して、式`e.query(q)`は[`get_env`](get_env.md)`(rcvr).query(q)`と等価。 +- [`get_stop_token`](../get_stop_token.md)以外かつ[`forwarding-query`](../forwarding-query.md)を満たす[クエリオブジェクト](../queryable.md)`q`に対して、式`e.query(q)`は[`get_env`](get_env.md)`(rcvr).query(q)`と等価。 `impls-for::get-state`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 @@ -212,7 +212,7 @@ enum class disposition { started, error, stopped }; // exposition only ```cpp template struct make-state { - template>... Sndrs> + template)>... Sndrs> auto operator()(auto, auto, Sndrs&&... sndrs) const { using values_tuple = see below; using errors_variant = see below; @@ -239,6 +239,7 @@ struct make-state { } }; ``` +* FWD-ENV-T[link ../forwarding_query.md] * env_of_t[link env_of_t.md] * stop_token_of_t[link ../stop_token_of_t.md] * on-stop-request[link on-stop-request.md] @@ -254,9 +255,10 @@ struct make-state { 型`values_tuple`は、適格であるならば下記の型とする。そうでなければ、[`tuple<>`](/reference/tuple/tuple.md)とする。 ```cpp -tuple, decayed-tuple, optional>...> +tuple), decayed-tuple, optional>...> ``` * value_types_of_t[link value_types_of_t.md] +* FWD-ENV-T[link ../forwarding_query.md] * env_of_t[link env_of_t.md] * decayed-tuple[link decayed-tuple.md] * optional[link /reference/optional/optional.md] @@ -477,4 +479,5 @@ error=-2 - [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) - [P3396R1 std::execution wording fixes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3396r1.html) +- [LWG 4203. Constraints on `get-state` functions are incorrect](https://cplusplus.github.io/LWG/issue4203) - [LWG 4227. Missing `noexcept` operator in [exec.when.all]](https://cplusplus.github.io/LWG/issue4227) diff --git a/reference/execution/forwarding_query.md b/reference/execution/forwarding_query.md index 3f973fabe6..8b5e23a845 100644 --- a/reference/execution/forwarding_query.md +++ b/reference/execution/forwarding_query.md @@ -22,6 +22,8 @@ namespace std { - `forwarding_query(q) == false`ならば、式`FWD-ENV(env).query(q, as...)`は不適格となる。 - そうでなければ、式`FWD-ENV(env)`は式`env.query(q, as...)`と等価であり、その型は[`queryable`](queryable.md)を満たす。 +また、説明専用の型`FWD-ENV-T(Env)`を`decltype(FWD-ENV(declval()))`と定義する。 + ## 効果 説明用の式`q`を`Q`型の[クエリオブジェクト](queryable.md)としたとき、呼び出し式`forwarding_query(q)`は下記と等価であり、`bool`型の値となる。 From 30b7ea69ca6bb4e84c07e08486a472e4c003c627 Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 31 Jul 2025 23:01:31 +0900 Subject: [PATCH 2272/3948] execution/schedule_from: LWG4198 --- reference/execution/execution/schedule_from.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/reference/execution/execution/schedule_from.md b/reference/execution/execution/schedule_from.md index 8c221273ec..7b07f0cfe5 100644 --- a/reference/execution/execution/schedule_from.md +++ b/reference/execution/execution/schedule_from.md @@ -99,10 +99,10 @@ namespace std::execution { * schedule[link schedule.md] - ローカルクラス`state-type`のオブジェクトは[構造化束縛](/lang/cpp17/structured_bindings.md)における初期化子として利用できる。 -- 説明用のパック`Sigs`を[`completion_signatures_of_t`](completion_signatures_of_t.md)`<`[`child-type`](child-type.md)`,` [`FWD-ENV-T`](../forwarding_query.md)`(`[`env_of_t`](env_of_t.md)`)>`による[`completion_signatures`](completion_signatures.md)特殊化のテンプレートパラメータと定義する。説明用のエイリアステンプレート`as-tuple`を[`decayed-tuple`](decayed-tuple.md)``と定義する。型`variant_t`は下記定義において重複削除した型となる。 +- 説明用のパック`Sigs`を[`completion_signatures_of_t`](completion_signatures_of_t.md)`<`[`child-type`](child-type.md)`,` [`FWD-ENV-T`](../forwarding_query.md)`(`[`env_of_t`](env_of_t.md)`)>`による[`completion_signatures`](completion_signatures.md)特殊化のテンプレートパラメータと定義する。説明用のエイリアステンプレート`as-tuple`を[`decayed-tuple`](decayed-tuple.md)``と定義し、説明用の変数テンプレート`is-nothrow-decay-copy-sig`を型`Args...`が全て例外送出せずdecayコピー可能ならば値`true`、そうでなければ`false`となる`bool const`型のコア定数式と定義する。説明用のパック`error-completion`を、`(is-nothrow-decay-copy-sig &&...)`が`false`ならば[`set_error_t`](set_error.md)`(`[`exception_ptr`](/reference/exception/exception_ptr.md)`)`、そうでなければ空のパックと定義する。型`variant_t`は下記定義において重複削除した型となる。 ```cpp - variant...> + variant..., error-completion...> ``` * variant[link /reference/variant/variant.md] * monostate[link /reference/variant/monostate.md] @@ -115,15 +115,13 @@ namespace std::execution { [](auto, auto& state, auto& rcvr, Tag, Args&&... args) noexcept -> void { using result_t = decayed-tuple; - constexpr bool nothrow = is_nothrow_constructible_v; + constexpr bool nothrow = (is_nothrow_constructible_v, Args> && ...); try { state.async-result.template emplace(Tag(), std::forward(args)...); } catch (...) { - if constexpr (!nothrow) { - set_error(std::move(rcvr), current_exception()); - return; - } + if constexpr (!nothrow) + state.async-result.template emplace>(set_error, current_exception()); } start(state.op-state); }; @@ -133,8 +131,9 @@ namespace std::execution { * start[link start.md] * is_nothrow_constructible_v[link /reference/type_traits/is_nothrow_constructible.md] * template emplace[link /reference/variant/variant/emplace.md] +* set_error_t[link set_error.md] +* exception_ptr[link /reference/exception/exception_ptr.md] * current_exception()[link /reference/exception/current_exception.md] -* std::move[link /reference/utility/move.md] ## 説明専用エンティティ @@ -212,4 +211,5 @@ Senderアルゴリズム構築時および[Receiver](receiver.md)接続時に、 - [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) - [P3396R1 std::execution wording fixes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3396r1.html) +- [LWG 4198. `schedule_from` isn't starting the schedule sender if decay-copying results throws](https://cplusplus.github.io/LWG/issue4198) - [LWG 4203. Constraints on `get-state` functions are incorrect](https://cplusplus.github.io/LWG/issue4203) From a37c00642a3b6858b26f9cbca1b9d813e2df1e5b Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 1 Aug 2025 14:19:15 +0900 Subject: [PATCH 2273/3948] =?UTF-8?q?Pull=20Request=E3=81=AECI=E3=81=A8?= =?UTF-8?q?=E5=90=8C=E7=AD=89=E3=81=AE=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF?= =?UTF-8?q?=E3=82=92=E3=83=AD=E3=83=BC=E3=82=AB=E3=83=AB=E3=81=A7=E4=B8=80?= =?UTF-8?q?=E5=BA=A6=E3=81=AB=E5=AE=9F=E8=A1=8C=E3=81=99=E3=82=8B=E3=82=B9?= =?UTF-8?q?=E3=82=AF=E3=83=AA=E3=83=97=E3=83=88=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/script/check.py | 29 ++++++++++ .../workflows/script/code_qualify_check.py | 7 ++- .../workflows/script/defined_word_check.py | 8 ++- .../workflows/script/display_error_check.py | 7 ++- .../workflows/script/global_qualify_check.py | 14 +++-- .github/workflows/script/link_check.py | 55 +++++++++++-------- .github/workflows/script/meta_header_check.py | 6 +- .github/workflows/script/ngword_check.py | 7 ++- README.md | 11 ++-- 9 files changed, 102 insertions(+), 42 deletions(-) create mode 100644 .github/workflows/script/check.py diff --git a/.github/workflows/script/check.py b/.github/workflows/script/check.py new file mode 100644 index 0000000000..7fd921db26 --- /dev/null +++ b/.github/workflows/script/check.py @@ -0,0 +1,29 @@ +import sys +import code_qualify_check +import display_error_check +import global_qualify_check +import link_check +import meta_header_check +import ngword_check + +if __name__ == '__main__': + if not code_qualify_check.check(): + print("code_qualify_check failed") + sys.exit(1) + if not display_error_check.check(): + print("display_error_check failed") + sys.exit(1) + if not global_qualify_check.check(): + print("global_qualify_check failed") + sys.exit(1) + if not link_check.check_inner_link(): + print("link_check failed") + sys.exit(1) + if not meta_header_check.check(): + print("meta_header_check failed") + sys.exit(1) + if not ngword_check.check(): + print("ngword_check failed") + sys.exit(1) + print("All checks passed successfully.") + diff --git a/.github/workflows/script/code_qualify_check.py b/.github/workflows/script/code_qualify_check.py index a544674432..18f383aa19 100644 --- a/.github/workflows/script/code_qualify_check.py +++ b/.github/workflows/script/code_qualify_check.py @@ -28,7 +28,7 @@ def check_exist_qualify_target(text: str, filename: str) -> bool: code = "" return not found_error -if __name__ == '__main__': +def check() -> bool: found_error = False current_dir = os.getcwd() outer_link_dict = dict() @@ -41,5 +41,8 @@ def check_exist_qualify_target(text: str, filename: str) -> bool: if not check_exist_qualify_target(text, p): found_error = True - if found_error: + return not found_error + +if __name__ == '__main__': + if not check(): sys.exit(1) diff --git a/.github/workflows/script/defined_word_check.py b/.github/workflows/script/defined_word_check.py index f44cc81878..b0134f6b34 100644 --- a/.github/workflows/script/defined_word_check.py +++ b/.github/workflows/script/defined_word_check.py @@ -65,8 +65,9 @@ def check_defined_word(text: str, filename: str) -> bool: return not found_error -if __name__ == '__main__': +def check() -> bool: found_error = False + current_dir = os.getcwd() for p in sorted(list(glob.glob("**/*.md", recursive=True))): if p.startswith("start_editing/"): continue @@ -77,5 +78,8 @@ def check_defined_word(text: str, filename: str) -> bool: if not check_defined_word(text, p): found_error = True - if found_error: + return not found_error + +if __name__ == '__main__': + if not check(): sys.exit(1) diff --git a/.github/workflows/script/display_error_check.py b/.github/workflows/script/display_error_check.py index 9a93e3b539..a1aeae9908 100644 --- a/.github/workflows/script/display_error_check.py +++ b/.github/workflows/script/display_error_check.py @@ -44,7 +44,7 @@ def check_display_error(text: str, filename: str) -> bool: return not found_error -if __name__ == '__main__': +def check() -> bool: found_error = False for p in sorted(list(glob.glob("**/*.md", recursive=True))): with open(p) as f: @@ -53,5 +53,8 @@ def check_display_error(text: str, filename: str) -> bool: if not check_display_error(text, p): found_error = True - if found_error: + return not found_error + +if __name__ == '__main__': + if not check(): sys.exit(1) diff --git a/.github/workflows/script/global_qualify_check.py b/.github/workflows/script/global_qualify_check.py index 6c4b9fea60..d7a819535d 100644 --- a/.github/workflows/script/global_qualify_check.py +++ b/.github/workflows/script/global_qualify_check.py @@ -17,7 +17,7 @@ def convrert_qualify_list(qualify_list: str) -> list: ls.append((m.group(1), m.group(2).strip())) return ls -def check(global_qualify_list_str: str, primary_overload_specialization_list_str: str) -> bool: +def check_link(global_qualify_list_str: str, primary_overload_specialization_list_str: str) -> bool: found_error: bool = False global_qualify_list = convrert_qualify_list(global_qualify_list_str) @@ -35,15 +35,21 @@ def check(global_qualify_list_str: str, primary_overload_specialization_list_str return not found_error -if __name__ == '__main__': +def check() -> bool: found_error = False + current_dir = os.getcwd() + outer_link_dict = dict() + with open("GLOBAL_QUALIFY_LIST.txt") as f: global_qualify_list = f.read() with open("PRIMARY_OVERLOAD_SPECIALIZATION.txt") as f: primary_overload_specialization_list = f.read() - if not check(global_qualify_list, primary_overload_specialization_list): + if not check_link(global_qualify_list, primary_overload_specialization_list): found_error = True - if found_error: + return not found_error + +if __name__ == '__main__': + if not check(): sys.exit(1) diff --git a/.github/workflows/script/link_check.py b/.github/workflows/script/link_check.py index 1045438532..f0b807d6dd 100644 --- a/.github/workflows/script/link_check.py +++ b/.github/workflows/script/link_check.py @@ -124,30 +124,15 @@ def add_link(origin_link: str): return inner_links, outer_links -if __name__ == '__main__': - argparser = argparse.ArgumentParser(description="") - argparser.add_argument("--check-inner-link", - dest='check_inner_link', - action='store_true', - default=False) - argparser.add_argument("--check-outer-link", - dest='check_outer_link', - action='store_true', - default=False) - argparser.add_argument("--url", - dest='url', - type=str, - default='') - args = argparser.parse_args() - - if not args.check_inner_link and not args.check_outer_link: +def check(check_inner_link: bool, check_outer_link: bool, url: str) -> bool: + if not check_inner_link and not check_outer_link: print("unchecked", file=sys.stderr) - sys.exit(1) + return False found_error = False current_dir = os.getcwd() outer_link_dict = dict() - if len(args.url) <= 0: + if len(url) <= 0: path_list = [(p, False) for p in glob.glob("**/*.md", recursive=True)] path_list.append(("GLOBAL_QUALIFY_LIST.txt", True)) path_list.append(("PRIMARY_OVERLOAD_SPECIALIZATION.txt", True)) @@ -163,7 +148,7 @@ def add_link(origin_link: str): else: outer_link_dict[link] = [p] - if args.check_inner_link: + if check_inner_link: for link in inner_links: rel_link = "" if link.startswith("/"): @@ -180,9 +165,9 @@ def add_link(origin_link: str): print("{} href {} not found.".format(p, link), file=sys.stderr) found_error = True - if args.check_outer_link: - if len(args.url) > 0: - outer_link_dict[args.url] = "" + if check_outer_link: + if len(url) > 0: + outer_link_dict[url] = "" for link, from_list in outer_link_dict.items(): exists, reason = check_url(link) @@ -190,5 +175,27 @@ def add_link(origin_link: str): print("URL {} not found. {} from:{}".format(link, reason, from_list), file=sys.stderr) found_error = True - if found_error: + return not found_error + +def check_inner_link() -> bool: + return check(True, False, '') + +if __name__ == '__main__': + argparser = argparse.ArgumentParser(description="") + argparser.add_argument("--check-inner-link", + dest='check_inner_link', + action='store_true', + default=False) + argparser.add_argument("--check-outer-link", + dest='check_outer_link', + action='store_true', + default=False) + argparser.add_argument("--url", + dest='url', + type=str, + default='') + args = argparser.parse_args() + + if not check(args.check_inner_link, args.check_outer_link, args.url): sys.exit(1) + diff --git a/.github/workflows/script/meta_header_check.py b/.github/workflows/script/meta_header_check.py index 7bbdf31cd8..9b6f3286e2 100644 --- a/.github/workflows/script/meta_header_check.py +++ b/.github/workflows/script/meta_header_check.py @@ -48,7 +48,7 @@ def check_header(text: str, filename: str) -> bool: return not found_error -if __name__ == '__main__': +def check() -> bool: found_error = False for p in sorted(list(glob.glob("**/*.md", recursive=True))): with open(p) as f: @@ -56,6 +56,8 @@ def check_header(text: str, filename: str) -> bool: if not check_header(text, p): found_error = True + return not found_error - if found_error: +if __name__ == '__main__': + if not check(): sys.exit(1) diff --git a/.github/workflows/script/ngword_check.py b/.github/workflows/script/ngword_check.py index f12eb522f1..2f700cb338 100644 --- a/.github/workflows/script/ngword_check.py +++ b/.github/workflows/script/ngword_check.py @@ -68,7 +68,7 @@ def check_ngword(text: str, filename: str) -> bool: found_error = True return not found_error -if __name__ == '__main__': +def check() -> bool: found_error = False for p in sorted(list(glob.glob("**/*.md", recursive=True))): if p.startswith("start_editing/"): @@ -80,5 +80,8 @@ def check_ngword(text: str, filename: str) -> bool: if not check_ngword(text, p): found_error = True - if found_error: + return not found_error + +if __name__ == '__main__': + if not check(): sys.exit(1) diff --git a/README.md b/README.md index 0e5ea68ae6..571996b263 100644 --- a/README.md +++ b/README.md @@ -25,11 +25,14 @@ cpprefjpは、以下のコアメンバが運営を行っています。 cpprefjpでは、C++の最新バージョンに随時対応しています。 -## 各種ツールの使用方法 -### 内部リンクのチェック -Python 3系をインストールした状態で、以下を実行する: +## ローカルでの各種チェックを実行するスクリプト +Python 3系をインストールした状態で、以下を実行します: ``` pip3 install requests -python3 .github/workflows/script/link_check.py --check-inner-link +python3 .github/workflows/script/check.py ``` + +これで、Pull RequestでのCI実行と同等のチェックがローカルで実行されます。 + +(外部リンクチェックだけは実行に時間がかかるので、ここでは実行されません。CIでも週に一回しか実行されません。) From 11888d8f4fc06abc8657bd00de4d38056c15e9e5 Mon Sep 17 00:00:00 2001 From: suomesta Date: Fri, 1 Aug 2025 19:07:49 +0900 Subject: [PATCH 2274/3948] fix typo in std::stod() --- reference/string/stod.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/string/stod.md b/reference/string/stod.md index cbf7ef2175..2d61a8c0cf 100644 --- a/reference/string/stod.md +++ b/reference/string/stod.md @@ -28,7 +28,7 @@ namespace std { ## 例外 - 数値への変換が行われなかった場合、[`std::invalid_argument`](/reference/stdexcept.md)が送出される。 - 以下の条件に合致した場合、[`std::out_of_range`](/reference/stdexcept.md)が送出される。 - - `std::strtoull()`関数が[`errno`](/reference/cerrno/errno.md)変数に[`ERANGE`](/reference/cerrno.md)を設定した場合 + - `std::strtod()`関数が[`errno`](/reference/cerrno/errno.md)変数に[`ERANGE`](/reference/cerrno.md)を設定した場合 - 結果が範囲外の値になった場合 (C++14) From 9ab033a00fd451a5b6ee0c785c8c7341f014d56f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 8 Aug 2025 11:43:18 +0900 Subject: [PATCH 2275/3948] =?UTF-8?q?=E3=82=B0=E3=83=AD=E3=83=BC=E3=83=90?= =?UTF-8?q?=E3=83=AB=E4=BF=AE=E9=A3=BE=E3=83=AA=E3=82=B9=E3=83=88=E3=81=AE?= =?UTF-8?q?=E8=87=AA=E5=8B=95=E3=82=BD=E3=83=BC=E3=83=88=E3=82=B9=E3=82=AF?= =?UTF-8?q?=E3=83=AA=E3=83=97=E3=83=88=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflows/script/sort_global_qualify.py | 148 ++++++++++++++++++ GLOBAL_QUALIFY_LIST.txt | 137 ++++++++-------- PRIMARY_OVERLOAD_SPECIALIZATION.txt | 58 +++---- 3 files changed, 246 insertions(+), 97 deletions(-) create mode 100644 .github/workflows/script/sort_global_qualify.py diff --git a/.github/workflows/script/sort_global_qualify.py b/.github/workflows/script/sort_global_qualify.py new file mode 100644 index 0000000000..6ef0fa3136 --- /dev/null +++ b/.github/workflows/script/sort_global_qualify.py @@ -0,0 +1,148 @@ +# グローバル修飾リストと、プライマリオーバーロード特殊化リストをソートするスクリプト +# トップディレクトリで以下を実行する: +# python3 .github/workflows/script/sort_global_qualify.py +# +# GLOBAL_QUALIFY_LIST.txtのソートルール: +# 1. コメントグループと修飾グループに分ける +# 2. コメントグループはそのままの順序で、修飾グループはヘッダの辞書順にソートする +# 3. 修飾グループ内では、以下のルールでソートする: +# 3.1. 名前空間が深い順にソートする (::の数が多い順) +# 3.2. 長い名前順にソートする ("abc"と"abcdef"では後者を優先) +# 3.3. 大文字・小文字を区別する +# +# PRIMARY_OVERLOAD_SPECIALIZATION.txtのソートルール: +# 1. 空行でグループを分ける +# 1.1. 先頭行が`# header`で始まらないグループはコメントグループとみなし、位置を維持する +# 1.2. そうではないグループは、修飾グループとみなす +# 2. 修飾グループ内では、GLOBAL_QUALIFY_LIST.txtと同様のルールでソートする + +from enum import Enum +import functools +import os + +class Group(Enum): + NONE = 0 + COMMENT = 1 + QUALIFY = 2 + +def flatten(arr: list[list[str]]) -> list[str]: + return sum(arr, []) + +def load_global_qualify_list() -> list[list[str]]: + ls: list[list[str]] = [] + with open('GLOBAL_QUALIFY_LIST.txt', 'r', encoding='utf-8') as f: + file = f.read() + group_type = Group.NONE + group: list[str] = [] + for line in file.split("\n"): + if not line: + continue + + if line.startswith("#"): + if group_type != Group.COMMENT: + group_type = Group.COMMENT + if len(group) > 0: + ls.append(group) + group = [] + group.append(line) + else: + if group_type != Group.QUALIFY: + group_type = Group.QUALIFY + if len(group) > 0: + ls.append(group) + group = [] + elif not line.startswith(" "): + if len(group) > 0: + ls.append(group) + group = [] + group.append(line) + + if len(group) > 0: + ls.append(group) + return ls + +def compare(a: str, b: str) -> int: + aa = a.startswith(" ") + bb = b.startswith(" ") + if aa != bb: + return aa - bb + + x = a.split("[")[0] + y = b.split("[")[0] + x_ns = x.split("::") + y_ns = y.split("::") + if len(x_ns) != len(y_ns): + return len(y_ns) - len(x_ns) + + for x_part, y_part in zip(x_ns, y_ns): + if x_part == y_part: + continue + + min_len = min(len(x_part), len(y_part)) + if x_part[:min_len] == y_part[:min_len]: + return len(y_part) - len(x_part) + + if x_part < y_part: + return -1 + else: + return 1 + + return 0 + +def sort_global_qualify_list(): + ls = load_global_qualify_list() + + outer_sorted = sorted(ls, key=lambda x: (not x[0].startswith("#"), x[0])) + inner_sorted = [] + for group in outer_sorted: + if group[0].startswith("#"): + inner_sorted.append(group) + else: + inner_sorted.append(sorted(group, key=functools.cmp_to_key(compare))) + return flatten(inner_sorted) + +def execute_sort_global_qualify_list(): + sorted_ls = sort_global_qualify_list() + with open('GLOBAL_QUALIFY_LIST.txt', 'w', encoding='utf-8') as f: + f.write("\n".join(sorted_ls)) + +def load_primary_list() -> list[list[str]]: + ls: list[list[str]] = [] + with open('PRIMARY_OVERLOAD_SPECIALIZATION.txt', 'r', encoding='utf-8') as f: + file = f.read() + group_type = Group.NONE + group: list[str] = [] + for line in file.split("\n"): + if not line: + if len(group) > 0: + ls.append(group) + group = [] + continue + + group.append(line) + + if len(group) > 0: + ls.append(group) + return ls + +def sort_primary_list(): + ls = load_primary_list() + + outer_sorted = sorted(ls, key=lambda x: (x[0].startswith("# header"), x[0])) + inner_sorted = [] + for group in outer_sorted: + if group[0].startswith("#"): + inner_sorted.append(group) + else: + inner_sorted.append(sorted(group, key=get_inner_sort_key)) + inner_sorted.append([""]) + return flatten(inner_sorted) + +def execute_sort_primary_list(): + sorted_ls = sort_primary_list() + with open('PRIMARY_OVERLOAD_SPECIALIZATION.txt', 'w', encoding='utf-8') as f: + f.write("\n".join(sorted_ls)) + +if __name__ == '__main__': + execute_sort_global_qualify_list() + execute_sort_primary_list() diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 0389718a77..737a526a84 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -38,23 +38,13 @@ # 7.1 ライブラリごとにオーバーロード・特殊化されているものはグローバル修飾リストに登録せず、個別ページで指定する # (std::begin/std::end、std::common_typeなど) # プライマリ宣言されている関数・クラスの一覧は、 PRIMARY_OVERLOAD_SPECIALIZATION.txt を参照 - -* floating-point-type[italic] -* implementation-defined[italic] -* import std;[link /module/std.md] -* import std.compat;[link /module/std.compat.md] -* thread_local[link /lang/cpp11/thread_local_storage.md] -* decltype(auto)[link /lang/cpp14/decltype_auto.md] -* see below[italic] -* synth-three-way-result[link /reference/exposition-only/synth-three-way-result.md] -* synth-three-way[link /reference/exposition-only/synth-three-way-result.md] * [link /reference/algorithm.md] - * ExecutionPolicy[link /reference/execution/execution/execution_policy.md] * ranges::find_if_not[link /reference/algorithm/ranges_find_if_not.md] - * std::copy[link /reference/algorithm/copy.md] * std::copy_n[link /reference/algorithm/copy_n.md] + * std::copy[link /reference/algorithm/copy.md] * std::for_each[link /reference/algorithm/for_each.md] * std::sort[link /reference/algorithm/sort.md] + * ExecutionPolicy[link /reference/execution/execution/execution_policy.md] * [link /reference/any.md] * [link /reference/array.md] * std::array[link /reference/array/array.md] @@ -86,8 +76,8 @@ * std::chrono::seconds[link /reference/chrono/duration_aliases.md] * std::chrono::years[link /reference/chrono/duration_aliases.md] * chrono::days[link /reference/chrono/duration_aliases.md] - * chrono::duration[link /reference/chrono/duration.md] * chrono::duration_cast[link /reference/chrono/duration_cast.md] + * chrono::duration[link /reference/chrono/duration.md] * chrono::hours[link /reference/chrono/duration_aliases.md] * chrono::microseconds[link /reference/chrono/duration_aliases.md] * chrono::milliseconds[link /reference/chrono/duration_aliases.md] @@ -98,8 +88,8 @@ * chrono::weeks[link /reference/chrono/duration_aliases.md] * chrono::years[link /reference/chrono/duration_aliases.md] * days[link /reference/chrono/duration_aliases.md] - * duration[link /reference/chrono/duration.md] * duration_cast[link /reference/chrono/duration_cast.md] + * duration[link /reference/chrono/duration.md] * hours[link /reference/chrono/duration_aliases.md] * microseconds[link /reference/chrono/duration_aliases.md] * milliseconds[link /reference/chrono/duration_aliases.md] @@ -110,14 +100,13 @@ * weeks[link /reference/chrono/duration_aliases.md] * years[link /reference/chrono/duration_aliases.md] * [link /reference/climits.md] +* [link /reference/cmath.md] +* [link /reference/codecvt.md] * [link /reference/compare.md] * compare_three_way_result_t[link /reference/compare/compare_three_way_result.md] * strong_ordering[link /reference/compare/strong_ordering.md] * three_way_comparable_with[link /reference/compare/three_way_comparable.md] * three_way_comparable[link /reference/compare/three_way_comparable.md] -* [link /reference/coroutine.md] -* [link /reference/cmath.md] -* [link /reference/codecvt.md] * [link /reference/complex.md] * [link /reference/concepts.md] * common_reference_with[link /reference/concepts/common_reference_with.md] @@ -132,19 +121,20 @@ * same_as[link /reference/concepts/same_as.md] * [link /reference/condition_variable.md] * std::condition_variable[link /reference/condition_variable/condition_variable.md] +* [link /reference/coroutine.md] * [link /reference/cstddef.md] - * nullptr_t[link /reference/cstddef/nullptr_t.md] * std::nullptr_t[link /reference/cstddef/nullptr_t.md] * std::size_t[link /reference/cstddef/size_t.md] + * nullptr_t[link /reference/cstddef/nullptr_t.md] * [link /reference/cstdint.md] - * std::uint8_t[link /reference/cstdint/uint8_t.md] - * std::uint16_t[link /reference/cstdint/uint16_t.md] - * std::uint32_t[link /reference/cstdint/uint32_t.md] - * std::uint64_t[link /reference/cstdint/uint64_t.md] - * std::int8_t[link /reference/cstdint/int8_t.md] * std::int16_t[link /reference/cstdint/int16_t.md] * std::int32_t[link /reference/cstdint/int32_t.md] * std::int64_t[link /reference/cstdint/int64_t.md] + * std::int8_t[link /reference/cstdint/int8_t.md] + * std::uint16_t[link /reference/cstdint/uint16_t.md] + * std::uint32_t[link /reference/cstdint/uint32_t.md] + * std::uint64_t[link /reference/cstdint/uint64_t.md] + * std::uint8_t[link /reference/cstdint/uint8_t.md] * [link /reference/cstdio.md] * [link /reference/cstdlib.md] * [link /reference/cstring.md] @@ -154,15 +144,15 @@ * std::deque[link /reference/deque/deque.md] * [link /reference/exception.md] * [link /reference/execution.md] - * std::execution::par[link /reference/execution/execution/execution_policy.md] * std::execution::par_unseq[link /reference/execution/execution/execution_policy.md] + * std::execution::par[link /reference/execution/execution/execution_policy.md] * std::execution::seq[link /reference/execution/execution/execution_policy.md] * [link /reference/expected.md] * std::expected[link /reference/expected/expected.md] * [link /reference/filesystem.md] - * fe.what()[link /reference/filesystem/filesystem_error/what.md] * fs::filesystem_error[link /reference/filesystem/filesystem_error.md] * fs::path[link /reference/filesystem/path.md] + * fe.what()[link /reference/filesystem/filesystem_error/what.md] * [link /reference/flat_map.md] * [link /reference/flat_set.md] * [link /reference/format.md] @@ -170,10 +160,10 @@ * std::forward_list[link /reference/forward_list/forward_list.md] * [link /reference/fstream.md] * [link /reference/functional.md] - * identity[link /reference/functional/identity.md] + * std::ranges::less_equal[link /reference/functional/ranges_less_equal.md] * ranges::equal_to[link /reference/functional/ranges_equal_to.md] * std::identity[link /reference/functional/identity.md] - * std::ranges::less_equal[link /reference/functional/ranges_less_equal.md] + * identity[link /reference/functional/identity.md] * [link /reference/future.md] * [link /reference/generator.md] * [link /reference/initializer_list.md] @@ -188,6 +178,17 @@ * [link /reference/istream.md] * std::basic_istream[link /reference/istream/basic_istream.md] * [link /reference/iterator.md] + * ranges::distance[link /reference/iterator/ranges_distance.md] + * ranges::iter_move[link /reference/iterator/iter_move.md] + * ranges::iter_swap[link /reference/iterator/iter_swap.md] + * std::back_inserter[link /reference/iterator/back_inserter.md] + * std::begin[link /reference/iterator/begin.md] + * std::distance[link /reference/iterator/distance.md] + * std::end[link /reference/iterator/end.md] + * std::move_iterator[link /reference/iterator/move_iterator.md] + * std::move_sentinel[link /reference/iterator/move_sentinel.md] + * std::next[link /reference/iterator/next.md] + * std::ostream_iterator[link /reference/iterator/ostream_iterator.md] * bidirectional_iterator[link /reference/iterator/bidirectional_iterator.md] * common_iterator[link /reference/iterator/common_iterator.md] * contiguous_iterator[link /reference/iterator/contiguous_iterator.md] @@ -199,26 +200,15 @@ * indirectly_comparable[link /reference/iterator/indirectly_comparable.md] * indirectly_swappable[link /reference/iterator/indirectly_swappable.md] * input_iterator[link /reference/iterator/input_iterator.md] - * iterator_traits[link /reference/iterator/iterator_traits.md] * iter_difference_t[link /reference/iterator/iter_difference_t.md] * iter_rvalue_reference_t[link /reference/iterator/iter_rvalue_reference_t.md] * iter_value_t[link /reference/iterator/iter_value_t.md] + * iterator_traits[link /reference/iterator/iterator_traits.md] * output_iterator[link /reference/iterator/output_iterator.md] - * projected[link /reference/iterator/projected.md] * projected_value_t[link /reference/iterator/projected_value_t.md] + * projected[link /reference/iterator/projected.md] * random_access_iterator[link /reference/iterator/random_access_iterator.md] - * ranges::distance[link /reference/iterator/ranges_distance.md] - * ranges::iter_move[link /reference/iterator/iter_move.md] - * ranges::iter_swap[link /reference/iterator/iter_swap.md] * sentinel_for[link /reference/iterator/sentinel_for.md] - * std::back_inserter[link /reference/iterator/back_inserter.md] - * std::begin[link /reference/iterator/begin.md] - * std::distance[link /reference/iterator/distance.md] - * std::end[link /reference/iterator/end.md] - * std::move_iterator[link /reference/iterator/move_iterator.md] - * std::move_sentinel[link /reference/iterator/move_sentinel.md] - * std::next[link /reference/iterator/next.md] - * std::ostream_iterator[link /reference/iterator/ostream_iterator.md] * unreachable_sentinel_t[link /reference/iterator/unreachable_sentinel_t.md] * [link /reference/latch.md] * [link /reference/limits.md] @@ -230,19 +220,19 @@ * [link /reference/map.md] * std::map[link /reference/map/map.md] * [link /reference/mdspan.md] - * std::extents[link /reference/mdspan/extents.md] * std::dextents[link /reference/mdspan/extents.md] + * std::extents[link /reference/mdspan/extents.md] * std::mdspan[link /reference/mdspan/mdspan.md] * [link /reference/memory.md] - * addressof[link /reference/memory/addressof.md] * std::allocator[link /reference/memory/allocator.md] * std::shared_ptr[link /reference/memory/shared_ptr.md] * std::unique_ptr[link /reference/memory/unique_ptr.md] + * addressof[link /reference/memory/addressof.md] * [link /reference/memory_resource.md] * [link /reference/mutex.md] * std::lock_guard[link /reference/mutex/lock_guard.md] - * std::unique_lock[link /reference/mutex/unique_lock.md] * std::mutex[link /reference/mutex/mutex.md] + * std::unique_lock[link /reference/mutex/unique_lock.md] * [link /reference/new.md] * [link /reference/numbers.md] * [link /reference/numeric.md] @@ -259,10 +249,16 @@ * [link /reference/random.md] * std::default_random_engine[link /reference/random/default_random_engine.md] * std::mt19937[link /reference/random/mt19937.md] - * std::uniform_int_distribution[link /reference/random/uniform_int_distribution.md] * std::random_device[link /reference/random/random_device.md] + * std::uniform_int_distribution[link /reference/random/uniform_int_distribution.md] * seed_gen()[link /reference/random/random_device/op_call.md] * [link /reference/ranges.md] + * std::ranges::owning_view[link /reference/ranges/owning_view.md] + * std::ranges::ref_view[link /reference/ranges/ref_view.md] + * std::ranges::single_view[link /reference/ranges/single_view.md] + * ranges::begin[link /reference/ranges/begin.md] + * ranges::end[link /reference/ranges/end.md] + * ranges::size[link /reference/ranges/size.md] * all_t[link /reference/ranges/all.md] * bidirectional_range[link /reference/ranges/bidirectional_range.md] * borrowed_range[link /reference/ranges/borrowed_range.md] @@ -279,27 +275,21 @@ * maybe-const[link /reference/ranges/maybe-const.md] * output_range[link /reference/ranges/output_range.md] * random_access_range[link /reference/ranges/random_access_range.md] + * range-with-movable-references[link /reference/ranges/range-with-movable-references.md] * range_difference_t[link /reference/ranges/range_difference_t.md] * range_reference_t[link /reference/ranges/range_reference_t.md] * range_rvalue_reference_t[link /reference/ranges/range_rvalue_reference_t.md] * range_size_t[link /reference/ranges/range_size_t.md] * range_value_t[link /reference/ranges/range_value_t.md] - * range-with-movable-references[link /reference/ranges/range-with-movable-references.md] * range[link /reference/ranges/range.md] - * ranges::begin[link /reference/ranges/begin.md] - * ranges::end[link /reference/ranges/end.md] - * ranges::size[link /reference/ranges/size.md] * ref_view[link /reference/ranges/ref_view.md] - * single_view[link /reference/ranges/single_view.md] * sentinel_t[link /reference/ranges/sentinel_t.md] + * single_view[link /reference/ranges/single_view.md] * sized_range[link /reference/ranges/sized_range.md] - * std::ranges::owning_view[link /reference/ranges/owning_view.md] - * std::ranges::ref_view[link /reference/ranges/ref_view.md] - * std::ranges::single_view[link /reference/ranges/single_view.md] * subrange[link /reference/ranges/subrange.md] * view_interface[link /reference/ranges/view_interface.md] - * view[link /reference/ranges/view.md] * viewable_range[link /reference/ranges/viewable_range.md] + * view[link /reference/ranges/view.md] * [link /reference/ratio.md] * [link /reference/rcu.md] * [link /reference/regex.md] @@ -310,8 +300,8 @@ * [link /reference/shared_mutex.md] * [link /reference/source_location.md] * [link /reference/span.md] - * std::span[link /reference/span/span.md] * std::dynamic_extent[link /reference/span/dynamic_extent.md] + * std::span[link /reference/span/span.md] * [link /reference/sstream.md] * std::istringstream[link /reference/sstream/basic_istringstream.md] * [link /reference/stack.md] @@ -332,32 +322,38 @@ * std::u32string[link /reference/string/basic_string.md] * std::wstring[link /reference/string/basic_string.md] * [link /reference/string_view.md] - * basic_string_view[link /reference/string_view/basic_string_view.md] * std::basic_string_view[link /reference/string_view/basic_string_view.md] * std::string_view[link /reference/string_view/basic_string_view.md] + * basic_string_view[link /reference/string_view/basic_string_view.md] * string_view[link /reference/string_view/basic_string_view.md] * sv.data()[link /reference/string_view/basic_string_view/data.md] * sv.size()[link /reference/string_view/basic_string_view/size.md] * [link /reference/syncstream.md] * [link /reference/system_error.md] - * ec.message()[link /reference/system_error/error_code/message.md] * std::error_code[link /reference/system_error/error_code.md] + * ec.message()[link /reference/system_error/error_code/message.md] * [link /reference/thread.md] - * std::thread[link /reference/thread/thread.md] + * std::this_thread::sleep_for[link /reference/thread/this_thread/sleep_for.md] * std::jthread[link /reference/thread/jthread.md] + * std::thread[link /reference/thread/thread.md] * t.join()[link /reference/thread/thread/join.md] * t1.join()[link /reference/thread/thread/join.md] * t2.join()[link /reference/thread/thread/join.md] * t3.join()[link /reference/thread/thread/join.md] - * std::this_thread::sleep_for[link /reference/thread/this_thread/sleep_for.md] * [link /reference/tuple.md] * std::forward_as_tuple[link /reference/tuple/forward_as_tuple.md] - * std::tuple[link /reference/tuple/tuple.md] * std::tie[link /reference/tuple/tie.md] + * std::tuple[link /reference/tuple/tuple.md] * tuple[link /reference/tuple/tuple.md] * [link /reference/type_traits.md] - * common_type_t[link /reference/type_traits/common_type.md] + * std::common_type_t[link /reference/type_traits/common_type.md] + * std::decay_t[link /reference/type_traits/decay.md] + * std::false_type[link /reference/type_traits/false_type.md] + * std::is_same_v[link /reference/type_traits/is_same.md] + * std::is_same[link /reference/type_traits/is_same.md] + * std::true_type[link /reference/type_traits/true_type.md] * common_reference_t[link /reference/type_traits/common_reference.md] + * common_type_t[link /reference/type_traits/common_type.md] * decay_t[link /reference/type_traits/decay.md] * invoke_result_t[link /reference/type_traits/invoke_result.md] * is_class_v[link /reference/type_traits/is_class.md] @@ -365,12 +361,6 @@ * remove_cv_t[link /reference/type_traits/remove_cv.md] * remove_cvref_t[link /reference/type_traits/remove_cvref.md] * remove_reference_t[link /reference/type_traits/remove_reference.md] - * std::common_type_t[link /reference/type_traits/common_type.md] - * std::decay_t[link /reference/type_traits/decay.md] - * std::false_type[link /reference/type_traits/false_type.md] - * std::is_same_v[link /reference/type_traits/is_same.md] - * std::is_same[link /reference/type_traits/is_same.md] - * std::true_type[link /reference/type_traits/true_type.md] * [link /reference/typeindex.md] * [link /reference/typeinfo.md] * [link /reference/unordered_map.md] @@ -378,14 +368,14 @@ * [link /reference/unordered_set.md] * std::unordered_set[link /reference/unordered_set/unordered_set.md] * [link /reference/utility.md] - * declval[link /reference/utility/declval.md] - * in_place_t[link /reference/utility/in_place_t.md] - * in_place[link /reference/utility/in_place_t.md] * std::exchange[link /reference/utility/exchange.md] * std::forward_like[link /reference/utility/forward_like.md] * std::forward[link /reference/utility/forward.md] * std::make_pair[link /reference/utility/make_pair.md] * std::pair[link /reference/utility/pair.md] + * declval[link /reference/utility/declval.md] + * in_place_t[link /reference/utility/in_place_t.md] + * in_place[link /reference/utility/in_place_t.md] * pair[link /reference/utility/pair.md] * piecewise_construct_t[link /reference/utility/piecewise_construct_t.md] * piecewise_construct[link /reference/utility/piecewise_construct_t.md] @@ -407,3 +397,12 @@ * v3.begin()[link /reference/vector/vector/begin.md] * v3.end()[link /reference/vector/vector/end.md] * v3.size()[link /reference/vector/vector/size.md] +* decltype(auto)[link /lang/cpp14/decltype_auto.md] +* floating-point-type[italic] +* implementation-defined[italic] +* import std.compat;[link /module/std.compat.md] +* import std;[link /module/std.md] +* see below[italic] +* synth-three-way-result[link /reference/exposition-only/synth-three-way-result.md] +* synth-three-way[link /reference/exposition-only/synth-three-way-result.md] +* thread_local[link /lang/cpp11/thread_local_storage.md] \ No newline at end of file diff --git a/PRIMARY_OVERLOAD_SPECIALIZATION.txt b/PRIMARY_OVERLOAD_SPECIALIZATION.txt index c3991a4358..b97505760e 100644 --- a/PRIMARY_OVERLOAD_SPECIALIZATION.txt +++ b/PRIMARY_OVERLOAD_SPECIALIZATION.txt @@ -5,11 +5,11 @@ # 2. ただし、長い名前を優先して登録する # 3. プライマリ宣言をどれかひとつに特定できない場合、[link]のように空リンクにする -# +# header * std::iter_swap[link /reference/algorithm/iter_swap.md] # iteratorにもある -# +# header * std::atomic_compare_exchange_strong_explicit[link /reference/atomic/atomic_compare_exchange_strong_explicit.md] # memoryでオーバーロードされている * std::atomic_compare_exchange_strong[link /reference/atomic/atomic_compare_exchange_strong.md] @@ -25,11 +25,11 @@ * std::atomic_store[link /reference/atomic/atomic_store.md] * std::atomic[link /reference/atomic/atomic.md] -# +# header * std::tolower[link /reference/cctype/tolower.md] * std::toupper[link /reference/cctype/toupper.md] -# +# header * std::acosh[link /reference/cmath/acosh.md] # complexでオーバーロードされている * std::acos[link /reference/cmath/acos.md] @@ -72,48 +72,50 @@ * std::tan[link /reference/cmath/tan.md] # valarrayとcomplexでオーバーロードされている -# +# header * std::remove[link /reference/cstdio/remove.md] # algorithmでオーバーロードされている -# +# header * std::abs[link /reference/cstdlib/abs.md] # cmathとvalarrayとcomplexでオーバーロードされている -# +# header * std::unexpected[link /reference/expected/unexpected.md] # exceptionにもある。先に登録されたのはそちらだが、すでに機能削除されている -# -* std::formatter (いろんなところで特殊化されている。プライマリはformat) -* std::enable_nonlocking_formatter_optimization (chronoで特殊化されている。プライマリはformat) +# header +* std::formatter[link] + # いろんなところで特殊化されている。プライマリはformat +* std::enable_nonlocking_formatter_optimization[link] + # chronoで特殊化されている。プライマリはformat -# +# header * operator>>[link /reference/istream/basic_istream/op_istream_free.md] - * あちこちでオーバーロードされている + # あちこちでオーバーロードされている -# - * std::begin[link /reference/iterator/begin.md] - * std::end[link /reference/iterator/end.md] +# header +* std::begin[link /reference/iterator/begin.md] +* std::end[link /reference/iterator/end.md] -# +# header * std::uses_allocator[link /reference/memory/uses_allocator.md] - * flat_mapとflat_setとfutureで特殊化されている + # flat_mapとflat_setとfutureで特殊化されている -# +# header * operator<<[link /reference/ostream/basic_ostream/op_ostream_free.md] - * あちこちでオーバーロードされている + # あちこちでオーバーロードされている -# +# header * std::println[link /reference/print/println.md] - * ostreamでオーバーロードされている + # ostreamでオーバーロードされている * std::print[link /reference/print/print.md] - * ostreamでオーバーロードされている + # ostreamでオーバーロードされている * std::vprint_unicode[link /reference/print/vprint_unicode.md] - * ostreamでオーバーロードされている + # ostreamでオーバーロードされている * std::vprint_nonunicode[link /reference/print/vprint_nonunicode.md] -# +# header * is_error_code_enum[link /reference/system_error/is_error_code_enum.md] # futureで特殊化されている * make_error_code[link /reference/system_error/make_error_code.md] @@ -121,7 +123,7 @@ * make_error_condition[link /reference/system_error/make_error_condition.md] # futureでオーバーロードされている -# +# header * std::tuple_size[link /reference/tuple/tuple_size.md] # std::arrayとstd::complexが特殊化している * std::tuple_element[link /reference/tuple/tuple_element.md] @@ -129,17 +131,17 @@ * std::get[link /reference/tuple/tuple/get.md] # std::arrayとstd::complexとstd::variantがオーバーロードしている -# +# header * std::basic_common_reference[link /reference/type_traits/basic_common_reference.md] # tupleとutilityで特殊化されている * std::common_type[link /reference/type_traits/common_type.md] # chronoで特殊化されている -# +# header * std::move[link /reference/utility/move.md] * std::swap[link /reference/utility/swap.md] - +# header none * operator==[link] * operator!=[link] * operator<=>[link] From 7e7cde1c8c2275deeec2333c3fb2f37ab0118951 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 8 Aug 2025 14:30:48 +0900 Subject: [PATCH 2276/3948] execution/upon_stopped: fix typo --- reference/execution/execution/upon_stopped.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/execution/execution/upon_stopped.md b/reference/execution/execution/upon_stopped.md index dc0698ae60..6e2a712f06 100644 --- a/reference/execution/execution/upon_stopped.md +++ b/reference/execution/execution/upon_stopped.md @@ -31,7 +31,7 @@ transform_sender(get-domain-early(sndr), make-sender(upon_stopped, f, sndr)) * make-sender[link make-sender.md] -### Senderアルゴリズムタグ `upon_error` +### Senderアルゴリズムタグ `upon_stopped` Senderアルゴリズム動作説明用のクラステンプレート[`impls-for`](impls-for.md)に対して、下記の特殊化が定義される。 ```cpp From 0f7b8bc4d3a5f7206ad82b85162098ebbd0e026c Mon Sep 17 00:00:00 2001 From: yoh Date: Sat, 9 Aug 2025 00:56:58 +0900 Subject: [PATCH 2277/3948] execution/split: P3682R0 remove split algorithm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit revert ae2af9069e2ce2af75afc1660f0568839fafbc13 (ノД`) --- reference/execution/execution.md | 2 +- .../execution/execution/on-stop-request.md | 1 - reference/execution/execution/split.md | 398 ------------------ 3 files changed, 1 insertion(+), 400 deletions(-) delete mode 100644 reference/execution/execution/split.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 352d5fec1a..634592a365 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -122,7 +122,6 @@ namespace std::execution { | [`execution::let_error`](execution/let_error.md) | エラー完了結果から入れ子の非同期操作へ変換 (customization point object) | C++26 | | [`execution::let_stopped`](execution/let_stopped.md) | 停止完了を入れ子の非同期操作へ変換 (customization point object) | C++26 | | [`execution::bulk`](execution/bulk.md) | インデクス空間上で指定関数を反復実行 (customization point object) | C++26 | -| [`execution::split`](execution/split.md) | 入力Senderの値を複製回送信可能とする (customization point object) | C++26 | | [`execution::when_all`](execution/when_all.md) | 全ての入力Sender完了を待機 (customization point object) | C++26 | | [`execution::when_all_with_variant`](execution/when_all_with_variant.md) | 複数の値完了シグネチャをもつ全ての入力Sender完了を待機 (customization point object) | C++26 | | [`execution::into_variant`](execution/into_variant.md) | 複数の値完了シグネチャを単一[`variant`](/reference/variant/variant.md)型の値完了シグネチャに変換 (customization point object) | C++26 | @@ -163,3 +162,4 @@ Senderコンシューマは名前空間 `std::this_thread` で定義される。 ## 参照 - [P0024R2 The Parallelism TS Should be Standardized](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0024r2.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3682R0 Remove `std::execution::split`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3682r0.pdf) diff --git a/reference/execution/execution/on-stop-request.md b/reference/execution/execution/on-stop-request.md index 447aa6986d..06ad7d68cb 100644 --- a/reference/execution/execution/on-stop-request.md +++ b/reference/execution/execution/on-stop-request.md @@ -24,7 +24,6 @@ struct on-stop-request { ## 関連項目 - [`execution::when_all`](when_all.md) -- [`execution::split`](split.md) ## 参照 diff --git a/reference/execution/execution/split.md b/reference/execution/execution/split.md deleted file mode 100644 index cbbfd30130..0000000000 --- a/reference/execution/execution/split.md +++ /dev/null @@ -1,398 +0,0 @@ -# split -* execution[meta header] -* cpo[meta id-type] -* std::execution[meta namespace] -* cpp26[meta cpp] - -```cpp -namespace std::execution { - struct split_t { unspecified }; - inline constexpr split_t split{}; -} -``` -* unspecified[italic] - -## 概要 -`split`は、任意の入力[Sender](sender.md)を複数回[接続(connect)](connect.md)可能とするSenderアダプタである。 - -`split`は[パイプ可能Senderアダプタオブジェクト](sender_adaptor_closure.md)であり、パイプライン記法をサポートする。 - - -## 効果 -説明用の型`split-env`を、インスタンス`env`に対して式[`get_stop_token`](../get_stop_token.md)`(env)`が適格かつ型[`inplace_stop_token`](/reference/stop_token/inplace_stop_token.md)をもつ型とする。 - -説明用の式`sndr`に対して、型`Sndr`を`decltype((sndr))`とする。[`sender_in`](sender_in.md)` == false`のとき、呼び出し式`split(sndr)`は不適格となる。 - -そうでなければ、呼び出し式`split(sndr)`は`sndr`が1回だけ評価されることを除いて、下記と等価。 - -```cpp -transform_sender(get-domain-early(sndr), make-sender(split, {}, sndr)) -``` -* transform_sender[link transform_sender.md] -* get-domain-early[link get-domain-early.md] -* make-sender[link make-sender.md] - - -### Senderアルゴリズムタグ `split` -説明用のSenderアルゴリズムタグ型`split-impl-tag`を空の型とする。説明用の式`sndr`に対して、式`split.transform_sender(sndr)`は下記と等価。 - -```cpp -auto&& [tag, _, child] = sndr; -auto* sh_state = new shared-state{std::forward_like(child)}; -return make-sender(split-impl-tag(), shared-wrapper{sh_state, tag}); -``` -* make-sender[link make-sender.md] - -説明用の型`shared-wrapper`は、`sh_state`が指す`shared-state`オブジェクトの参照カウントを管理するクラスである。 - -- `shared-wrapper`は[`copyable`](/reference/concepts/copyable.md)のモデルである。 -- ムーブ操作 : 移動済みオブジェクトをヌルとする。 -- コピー操作 : `sh_state->inc-ref()`を呼び出して参照カウントをインクリメントする。 -- 代入操作 : Copy-And-Swap操作を行う。 -- デストラクタ : `sh_state`がヌルのときは何もしない。そうでないとき、`sh_state->dec-ref()`を評価して参照カウントをデクリメントする。 - - -### Senderアルゴリズムタグ `split-impl-tag` -Senderアルゴリズム動作説明用のクラステンプレート[`impls-for`](impls-for.md)に対して、下記の特殊化が定義される。 - -```cpp -namespace std::execution { - template<> - struct impls-for : default-impls { - static constexpr auto get-state = see below; - static constexpr auto start = see below; - }; -} -``` -* impls-for[link impls-for.md] -* default-impls[link impls-for.md] - -`impls-for::get-state`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 - -```cpp -[](Sndr&& sndr, auto& rcvr) noexcept { - return local-state{std::forward(sndr), rcvr}; -} -``` - -`impls-for::start`メンバは、下記の関数呼び出し演算子をもつオブジェクトで初期化される。 - -```cpp -template -void operator()(local-state& state, Rcvr& rcvr) const noexcept; -``` - -効果 : `state.sh_state->completed == true`のとき、`state.notify()`を評価してリターンする。そうでなければ、下記を順番に行う。 - -- 以下を評価する。 - - ```cpp - state.on_stop.emplace( - get_stop_token(get_env(rcvr)), - on-stop-request{state.sh_state->stop_src}); - ``` - * emplace[link /reference/optional/optional/emplace.md] - * get_stop_token[link ../get_stop_token.md] - * get_env[link get_env.md] - * on-stop-request[link on-stop-request.md] - -- 下記をアトミックに行う。 - - `state.sh_state->completed`の値`c`を読み取り - - `c == false`のとき、`state.sh_state->waiting_state`に[`addressof`](/reference/memory/addressof.md)`(state)`を挿入する -- `c == true`ならば、`state.notify()`を呼び出してリターンする。 -- そうではなく、[`addressof`](/reference/memory/addressof.md)`(state)`が`state.sh_state->waiting_state`に最初に追加されるアイテムならば、`state.sh_state->start-op()`を評価する。 - - -## 説明専用エンティティ -### クラステンプレート`local-state` - -```cpp -namespace std::execution { - struct local-state-base { // exposition only - virtual ~local-state-base() = default; - virtual void notify() noexcept = 0; // exposition only - }; - - template - struct local-state : local-state-base { // exposition only - using on-stop-callback = // exposition only - stop_callback_for_t>, on-stop-request>; - - local-state(Sndr&& sndr, Rcvr& rcvr) noexcept; - ~local-state(); - - void notify() noexcept override; - - private: - optional on_stop; // exposition only - shared-state* sh_state; // exposition only - Rcvr* rcvr; // exposition only - }; -} -``` -* stop_callback_for_t[link /reference/stop_token/stop_callback_for_t.md] -* stop_token_of_t[link ../stop_token_of_t.md] -* env_of_t[link env_of_t.md] -* on-stop-request[link on-stop-request.md] -* optional[link /reference/optional/optional.md] - -```cpp -local-state(Sndr&& sndr, Rcvr& rcvr) noexcept; -``` - -- 効果 : 下記と等価。 - - ```cpp - auto& [_, data, _] = sndr; - this->sh_state = data.sh_state.get(); - this->sh_state->inc-ref(); - this->rcvr = addressof(rcvr); - ``` - -```cpp -~local-state(); -``` - -- 効果 : 下記と等価。 - - ```cpp - sh_state->dec-ref(); - ``` - -```cpp -void notify() noexcept override; -``` - -- 効果 : 下記と等価。 - - ```cpp - on_stop.reset(); - visit( - [this](const auto& tupl) noexcept -> void { - apply( - [this](auto tag, const auto&... args) noexcept -> void { - tag(std::move(*rcvr), args...); - }, - tupl); - }, - sh_state->result); - ``` - * reset()[link /reference/optional/optional/reset.md] - * visit[link /reference/variant/visit.md] - * apply[link /reference/tuple/apply.md] - * std::move[link /reference/utility/move.md] - -### クラステンプレート`split-receiver` - -```cpp -namespace std::execution { - template - struct split-receiver { // exposition only - using receiver_concept = receiver_t; - - template - void complete(Tag, Args&&... args) noexcept { // exposition only - using tuple_t = decayed-tuple; - try { - sh_state->result.template emplace(Tag(), std::forward(args)...); - } catch (...) { - using tuple_t = tuple; - sh_state->result.template emplace(set_error, current_exception()); - } - sh_state->notify(); - } - - template - void set_value(Args&&... args) && noexcept { - complete(execution::set_value, std::forward(args)...); - } - - template - void set_error(Error&& err) && noexcept { - complete(execution::set_error, std::forward(err)); - } - - void set_stopped() && noexcept { - complete(execution::set_stopped); - } - - struct env { // exposition only - shared-state* sh-state; // exposition only - - inplace_stop_token query(get_stop_token_t) const noexcept { - return sh-state->stop_src.get_token(); - } - }; - - env get_env() const noexcept { - return env{sh_state}; - } - - shared-state* sh_state; // exposition only - }; -} -``` -* receiver_t[link receiver.md] -* decayed-tuple[link decayed-tuple.md] -* template emplace[link /reference/variant/variant/emplace.md] -* set_error_t[link set_error.md] -* exception_ptr[link /reference/exception/exception_ptr.md] -* current_exception()[link /reference/exception/current_exception.md] -* execution::set_value[link set_value.md] -* execution::set_error[link set_error.md] -* execution::set_stopped[link set_stopped.md] -* inplace_stop_token[link /reference/stop_token/inplace_stop_token.md] -* get_stop_token_t[link ../get_stop_token.md] -* get_token()[link /reference/stop_token/inplace_stop_source/get_token.md] - -### クラステンプレート`shared-state` - -```cpp -namespace std::execution { - template - struct shared-state { - using variant-type = see below; // exposition only - using state-list-type = see below; // exposition only - - explicit shared-state(Sndr&& sndr); - - void start-op() noexcept; // exposition only - void notify() noexcept; // exposition only - void inc-ref() noexcept; // exposition only - void dec-ref() noexcept; // exposition only - - inplace_stop_source stop_src{}; // exposition only - variant-type result{}; // exposition only - state-list-type waiting_states; // exposition only - atomic completed{false}; // exposition only - atomic ref_count{1}; // exposition only - connect_result_t> op_state; // exposition only - }; -} -``` -* inplace_stop_source[link /reference/stop_token/inplace_stop_source.md] -* atomic[link /reference/atomic/atomic.md] -* connect_result_t[link connect_result_t.md] - -- 説明用のパック`Sigs`を[`completion_signatures_of_t`](completion_signatures_of_t.md)``による[`completion_signatures`](completion_signatures.md)特殊化のテンプレートパラメータと定義する。説明用の型`Tag`とパック`Args`に対して、説明用のエイリアステンプレート`as-tuple`を[`decayed-tuple`](decayed-tuple.md)``と定義する。型`variant-type`は下記定義において重複削除した型となる。 - - ```cpp - variant, tuple, as-tuple...> - ``` - * variant[link /reference/variant/variant.md] - * set_stopped_t[link set_stopped.md] - * set_error_t[link set_error.md] - * exception_ptr[link /reference/exception/exception_ptr.md] - -- 型`state-list-type`を、`local-state-base`オブジェクトへのポインタのリストを格納し、アトミックに要素挿入できる型とする。 - -```cpp -explicit shared-state(Sndr&& sndr); -``` - -- 効果 : `op_state`を[`connect`](connect.md)`(`[`std::forward`](/reference/utility/forward.md)`(sndr), split-receiver{this})`の結果で初期化する。 -- 事後条件 : `waiting_states`が空、かつ`completed == false` - -```cpp -void start-op() noexcept; -``` - -- 効果 : `inc-ref()`を評価する。`stop_src.`[`stop_requested()`](/reference/stop_token/inplace_stop_source/stop_requested.md) `== true`のとき`notify()`を評価する。そうでなければ、[`start`](start.md)`(op_state)`を評価する。 - -```cpp -void notify() noexcept; -``` - -- 効果 : 下記をアトミックに行い、ローカル変数`prior_states`の各ポインタ`p`に対して`p->notify()`を評価し、最後に`dec-ref()`を評価する。 - - `completed`に`true`を設定し、 - - `waiting_states`を空のリストと交換し、古い値をローカル変数`prior_states`に格納する。 - -```cpp -void inc-ref() noexcept; -``` - -- 効果 : `ref_count`をインクリメントする。 - -```cpp -void dec-ref() noexcept; -``` - -- 効果 : `ref_count`をデクリメントする。`ref_count`の新たな値が`0`のとき、`delete this`を呼び出す。 -- 同期操作 : `dec-ref()`の評価が`ref_count`を値`0`にデクリメントしないとき、`ref_count`を値`0`へデクリメントする`dec-ref()`の評価に対して同期する。 - - -## カスタマイゼーションポイント -Senderアルゴリズム構築時に、[Sender](sender.md)`sndr`に[関連付けられた実行ドメイン](get-domain-early.md)に対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 -[デフォルト実行ドメイン](default_domain.md)では`split.transform_sender(sndr)`が呼ばれ、前述仕様通りのSenderへと変換される。 - - -## 例 -```cpp example -#include -#include -namespace ex = std::execution; - -int main() -{ - { // 関数呼び出し - ex::sender auto snd0 = ex::just(21); - ex::sender auto snd1 = ex::then(snd0, [](int n) { - std::println("then"); - return 2 * n; - }); - ex::sender auto sndr = ex::split(snd1); - - auto [val1] = std::this_thread::sync_wait(sndr).value(); - std::println("{}", val1); - auto [val2] = std::this_thread::sync_wait(sndr).value(); - std::println("{}", val2); - } - - { // パイプライン記法 - ex::sender auto sndr = - ex::just(21) - | ex::then([](int n) { - std::println("then"); - return 2 * n; - }) - | ex::split(); - - auto [val1] = std::this_thread::sync_wait(sndr).value(); - std::println("{}", val1); - auto [val2] = std::this_thread::sync_wait(sndr).value(); - std::println("{}", val2); - } -} -``` -* ex::split[color ff0000] -* ex::sender[link sender.md] -* ex::just[link just.md] -* ex::then[link then.md] -* std::this_thread::sync_wait[link ../this_thread/sync_wait.md] -* value()[link /reference/optional/optional/value.md] - -### 出力 -``` -then -42 -42 -then -42 -42 -``` - - -## バージョン -### 言語 -- C++26 - -### 処理系 -- [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? -- [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? - - -## 参照 -- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) -- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) From 3747177934774b6f9f61f741cf829c48b81087cb Mon Sep 17 00:00:00 2001 From: suomesta Date: Sat, 9 Aug 2025 10:10:53 +0900 Subject: [PATCH 2278/3948] fix link to first/second of std::pair --- reference/unordered_set/unordered_multiset/equal_range.md | 4 ++-- reference/unordered_set/unordered_set/equal_range.md | 4 ++-- reference/unordered_set/unordered_set/insert.md | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/reference/unordered_set/unordered_multiset/equal_range.md b/reference/unordered_set/unordered_multiset/equal_range.md index 13003304c4..cd8db748b8 100644 --- a/reference/unordered_set/unordered_multiset/equal_range.md +++ b/reference/unordered_set/unordered_multiset/equal_range.md @@ -81,8 +81,8 @@ int main() * std::ostream[link /reference/ostream.md] * ums.begin()[link begin.md] * ums.end()[link end.md] -* first[link /reference/utility/pair.md] -* second[link /reference/utility/pair.md] +* first[link /reference/utility/pair/first.md] +* second[link /reference/utility/pair/second.md] ### 出力 ``` diff --git a/reference/unordered_set/unordered_set/equal_range.md b/reference/unordered_set/unordered_set/equal_range.md index db10feaf50..1bf6251e6b 100644 --- a/reference/unordered_set/unordered_set/equal_range.md +++ b/reference/unordered_set/unordered_set/equal_range.md @@ -83,8 +83,8 @@ int main() * std::ostream[link /reference/ostream.md] * us.begin()[link begin.md] * us.end()[link end.md] -* first[link /reference/utility/pair.md] -* second[link /reference/utility/pair.md] +* first[link /reference/utility/pair/first.md] +* second[link /reference/utility/pair/second.md] ### 出力 ``` diff --git a/reference/unordered_set/unordered_set/insert.md b/reference/unordered_set/unordered_set/insert.md index 12c17d1d95..598a102ee8 100644 --- a/reference/unordered_set/unordered_set/insert.md +++ b/reference/unordered_set/unordered_set/insert.md @@ -203,8 +203,8 @@ int main() * c.begin()[link begin.md] * c.end()[link end.md] * us.begin()[link begin.md] -* second[link /reference/utility/pair.md] -* first[link /reference/utility/pair.md] +* second[link /reference/utility/pair/second.md] +* first[link /reference/utility/pair/first.md] * fl.cbegin()[link /reference/forward_list/forward_list/cbegin.md] * fl.cend()[link /reference/forward_list/forward_list/cend.md] From c277769b065a5cb05a4f362e626b5dc6389855d9 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 11 Aug 2025 11:30:09 +0900 Subject: [PATCH 2279/3948] =?UTF-8?q?valarray:=20=E5=8F=82=E7=85=A7?= =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=81=8C=E6=B6=88=E6=BB=85=E3=81=97?= =?UTF-8?q?=E3=81=A6=E3=81=84=E3=81=9F=E3=81=AE=E3=81=A7Internet=20Archive?= =?UTF-8?q?=E3=81=AB=E5=B7=AE=E3=81=97=E6=9B=BF=E3=81=88=20#1486?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/valarray/valarray.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/valarray/valarray.md b/reference/valarray/valarray.md index 0a2ad864d4..c73e7165bb 100644 --- a/reference/valarray/valarray.md +++ b/reference/valarray/valarray.md @@ -289,4 +289,4 @@ slice + multiply : {1,4,3,8,5,12} ``` ## 参照 -- [インテルの valarray の使用](https://www.xlsoft.com/jp/products/intel/compilers/ccw/12/ug/cref_cls/common/cppref_valarray_use.htm) +- [インテルの valarray の使用](https://web.archive.org/web/20230203193903/https://www.xlsoft.com/jp/products/intel/compilers/ccw/12/ug/cref_cls/common/cppref_valarray_use.htm) From 077be88e442e70436ce882bb4c9ff06904304a47 Mon Sep 17 00:00:00 2001 From: suomesta Date: Mon, 11 Aug 2025 15:35:16 +0900 Subject: [PATCH 2280/3948] add library (#1051) --- GLOBAL_QUALIFY_LIST.txt | 1 + lang/cpp23.md | 2 +- lang/cpp23/feature_test_macros.md | 2 +- reference.md | 2 +- reference/spanstream.md | 51 ++++++++ reference/spanstream/basic_ispanstream.md | 92 ++++++++++++++ .../spanstream/basic_ispanstream/op_assign.md | 60 +++++++++ .../basic_ispanstream/op_constructor.md | 82 ++++++++++++ .../spanstream/basic_ispanstream/rdbuf.md | 60 +++++++++ .../spanstream/basic_ispanstream/span.md | 104 ++++++++++++++++ .../spanstream/basic_ispanstream/swap.md | 59 +++++++++ .../spanstream/basic_ispanstream/swap_free.md | 61 +++++++++ reference/spanstream/basic_ospanstream.md | 94 ++++++++++++++ .../spanstream/basic_ospanstream/op_assign.md | 60 +++++++++ .../basic_ospanstream/op_constructor.md | 73 +++++++++++ .../spanstream/basic_ospanstream/rdbuf.md | 62 ++++++++++ .../spanstream/basic_ospanstream/span.md | 82 ++++++++++++ .../spanstream/basic_ospanstream/swap.md | 59 +++++++++ .../spanstream/basic_ospanstream/swap_free.md | 61 +++++++++ reference/spanstream/basic_spanbuf.md | 117 ++++++++++++++++++ .../spanstream/basic_spanbuf/op_assign.md | 60 +++++++++ .../basic_spanbuf/op_constructor.md | 113 +++++++++++++++++ reference/spanstream/basic_spanbuf/span.md | 76 ++++++++++++ reference/spanstream/basic_spanbuf/swap.md | 58 +++++++++ .../spanstream/basic_spanbuf/swap_free.md | 61 +++++++++ reference/spanstream/basic_spanstream.md | 115 +++++++++++++++++ .../spanstream/basic_spanstream/op_assign.md | 60 +++++++++ .../basic_spanstream/op_constructor.md | 75 +++++++++++ .../spanstream/basic_spanstream/rdbuf.md | 63 ++++++++++ reference/spanstream/basic_spanstream/span.md | 82 ++++++++++++ reference/spanstream/basic_spanstream/swap.md | 58 +++++++++ .../spanstream/basic_spanstream/swap_free.md | 61 +++++++++ 32 files changed, 2063 insertions(+), 3 deletions(-) create mode 100644 reference/spanstream.md create mode 100644 reference/spanstream/basic_ispanstream.md create mode 100644 reference/spanstream/basic_ispanstream/op_assign.md create mode 100644 reference/spanstream/basic_ispanstream/op_constructor.md create mode 100644 reference/spanstream/basic_ispanstream/rdbuf.md create mode 100644 reference/spanstream/basic_ispanstream/span.md create mode 100644 reference/spanstream/basic_ispanstream/swap.md create mode 100644 reference/spanstream/basic_ispanstream/swap_free.md create mode 100644 reference/spanstream/basic_ospanstream.md create mode 100644 reference/spanstream/basic_ospanstream/op_assign.md create mode 100644 reference/spanstream/basic_ospanstream/op_constructor.md create mode 100644 reference/spanstream/basic_ospanstream/rdbuf.md create mode 100644 reference/spanstream/basic_ospanstream/span.md create mode 100644 reference/spanstream/basic_ospanstream/swap.md create mode 100644 reference/spanstream/basic_ospanstream/swap_free.md create mode 100644 reference/spanstream/basic_spanbuf.md create mode 100644 reference/spanstream/basic_spanbuf/op_assign.md create mode 100644 reference/spanstream/basic_spanbuf/op_constructor.md create mode 100644 reference/spanstream/basic_spanbuf/span.md create mode 100644 reference/spanstream/basic_spanbuf/swap.md create mode 100644 reference/spanstream/basic_spanbuf/swap_free.md create mode 100644 reference/spanstream/basic_spanstream.md create mode 100644 reference/spanstream/basic_spanstream/op_assign.md create mode 100644 reference/spanstream/basic_spanstream/op_constructor.md create mode 100644 reference/spanstream/basic_spanstream/rdbuf.md create mode 100644 reference/spanstream/basic_spanstream/span.md create mode 100644 reference/spanstream/basic_spanstream/swap.md create mode 100644 reference/spanstream/basic_spanstream/swap_free.md diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 0389718a77..0c4a1ab47d 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -312,6 +312,7 @@ * [link /reference/span.md] * std::span[link /reference/span/span.md] * std::dynamic_extent[link /reference/span/dynamic_extent.md] +* [link /reference/spanstream.md] * [link /reference/sstream.md] * std::istringstream[link /reference/sstream/basic_istringstream.md] * [link /reference/stack.md] diff --git a/lang/cpp23.md b/lang/cpp23.md index e4ba3ea5c4..3825638064 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -116,7 +116,7 @@ C++23とは、2023年中に改訂され、ISO/IEC 14882:2024で標準規格化 - C++標準ライブラリ全体のモジュールとして[`std`](/module/std.md)、C互換ライブラリ全体のモジュールとして[`std.compat`](/module/std.compat.md)を追加 - スタックトレースを取得するためのライブラリとして[``](/reference/stacktrace.md)を追加 - CとC++の間でのアトミック操作の相互運用のため、C互換ライブラリとして[``](/reference/stdatomic.h.md)を追加 -- 外部から提供されるメモリバッファでストリーム処理を行うライブラリとして[``](/reference/spanstream.md.nolink)を追加 +- 外部から提供されるメモリバッファでストリーム処理を行うライブラリとして[``](/reference/spanstream.md)を追加 - 正常値とエラー値のどちらかを持つクラスおよびライブラリとして[``](/reference/expected.md)を追加 - 多次元配列ビューのライブラリとして[``](/reference/mdspan.md)を追加 - ノードベースではないソート済みキーによる順序付き連想コンテナのライブラリとして、[``](/reference/flat_map.md)と[``](/reference/flat_set.md)を追加 diff --git a/lang/cpp23/feature_test_macros.md b/lang/cpp23/feature_test_macros.md index 624b1247cc..50a199eecc 100644 --- a/lang/cpp23/feature_test_macros.md +++ b/lang/cpp23/feature_test_macros.md @@ -87,7 +87,7 @@ |`__cpp_lib_ranges_zip`|`202110L`|[`std::ranges::zip_view`](/reference/ranges/zip_view.md)と[`std::ranges::zip_transform_view`](/reference/ranges/zip_transform_view.md)と[`std::ranges::adjacent_view`](/reference/ranges/adjacent_view.md)と[`std::ranges::adjacent_transform_view`](/reference/ranges/adjacent_transform_view.md)の追加|[``](/reference/ranges.md)
[``](/reference/tuple.md)
[``](/reference/utility.md)| |`__cpp_lib_reference_from_temporary`|`202202L`|[`std::reference_constructs_from_temporary`](/reference/type_traits/reference_constructs_from_temporary.md)と[`std::reference_converts_from_temporary`](/reference/type_traits/reference_converts_from_temporary.md)の追加|[``](/reference/type_traits.md)| |`__cpp_lib_shift`|`202202L`|[`std::ranges::shift_left()`](/reference/algorithm/ranges_shift_left.md)と[`std::ranges::shift_right()`](/reference/algorithm/ranges_shift_right.md)の追加|[``](/reference/algorithm.md)| -|`__cpp_lib_spanstream`|`202106L`|``の追加|``| +|`__cpp_lib_spanstream`|`202106L`|[``](/reference/spanstream.md)の追加|[``](/reference/spanstream.md)| |`__cpp_lib_stacktrace`|`202011L`|[``](/reference/stacktrace.md)の追加|[``](/reference/stacktrace.md)| |`__cpp_lib_start_lifetime_as`|`202207L`|[`std::start_lifetime_as()`](/reference/memory/start_lifetime_as.md)の追加|[``](/reference/memory.md)| |`__cpp_lib_stdatomic_h`|`202011L`|[``](/reference/stdatomic.h.md)の追加|[``](/reference/stdatomic.h.md)| diff --git a/reference.md b/reference.md index d466434046..d5a94adb21 100644 --- a/reference.md +++ b/reference.md @@ -177,7 +177,7 @@ | [``](/reference/fstream.md) | ファイルストリーム | | | [``](/reference/filesystem.md) | ファイルシステム | C++17 | | [``](/reference/syncstream.md) | 同期化出力ストリームラッパー | C++20 | -| [``](/reference/spanstream.md.nolink) | メモリバッファの所有権をもたないストリーム | C++23 | +| [``](/reference/spanstream.md) | メモリバッファの所有権をもたないストリーム | C++23 | | [``](/reference/print.md) | 書式指定による出力 | C++23 | diff --git a/reference/spanstream.md b/reference/spanstream.md new file mode 100644 index 0000000000..eefcd5a02b --- /dev/null +++ b/reference/spanstream.md @@ -0,0 +1,51 @@ +# spanstream +* spanstream[meta header] +* cpp23[meta cpp] + +``ヘッダでは、[`std::span`](/reference/span/span.md) を出力先・入力元として使用するストリームクラスを定義する。 + +固定長バッファを使うことができるストリームとして、古くから `std::strstream` があるが、`std::strstream` は非推奨のライブラリであった。 +C++20 で [`std::span`](/reference/span/span.md) が導入されたことに伴い、[`std::span`](/reference/span/span.md) を使用した固定長バッファストリームクラスが新たに追加された。 +(これにより、`` ライブラリはC++26で削除された。) + + +## ストリームバッファ + +| 名前 | 説明 | 対応バージョン | +|-----------------------|------------------------------------------------|----------------| +| [`basic_spanbuf`](spanstream/basic_spanbuf.md) | 固定長ストリームバッファ(class template) | C++23 | +| [`spanbuf`](spanstream/basic_spanbuf.md) | `char`版の固定長ストリームバッファ(type-alias) | C++23 | +| [`wspanbuf`](spanstream/basic_spanbuf.md) | `wchar_t`版の固定長ストリームバッファ(type-alias) | C++23 | + +## 入力ストリーム + +| 名前 | 説明 | 対応バージョン | +|-----------------------|------------------------------------------------|----------------| +| [`basic_ispanstream`](spanstream/basic_ispanstream.md) | 固定長バッファ入力ストリーム(class template) | C++23 | +| [`ispanstream`](spanstream/basic_ispanstream.md) | `char`版の固定長バッファ入力ストリーム(type-alias) | C++23 | +| [`wispanstream`](spanstream/basic_ispanstream.md) | `wchar_t`版の固定長バッファ入力ストリーム(type-alias) | C++23 | + +## 出力ストリーム + +| 名前 | 説明 | 対応バージョン | +|-----------------------|------------------------------------------------|----------------| +| [`basic_ospanstream`](spanstream/basic_ospanstream.md) | 固定長バッファ出力ストリーム(class template) | C++23 | +| [`ospanstream`](spanstream/basic_ospanstream.md) | `char`版の固定長バッファ出力ストリーム(type-alias) | C++23 | +| [`wospanstream`](spanstream/basic_ospanstream.md) | `wchar_t`版の固定長バッファ出力ストリーム(type-alias) | C++23 | + +## 入出力ストリーム + +| 名前 | 説明 | 対応バージョン | +|-----------------------|------------------------------------------------|----------------| +| [`basic_spanstream`](spanstream/basic_spanstream.md) | 固定長バッファ入出力ストリーム(class template) | C++23 | +| [`spanstream`](spanstream/basic_spanstream.md) | `char`版の固定長バッファ入出力ストリーム(type-alias) | C++23 | +| [`wspanstream`](spanstream/basic_spanstream.md) | `wchar_t`版の固定長バッファ入出力ストリーム(type-alias) | C++23 | + + +## バージョン +### 言語 +- C++23 + + +## 参照 +- [P0448R4 A strstream replacement using span<charT> as buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0448r4.pdf) diff --git a/reference/spanstream/basic_ispanstream.md b/reference/spanstream/basic_ispanstream.md new file mode 100644 index 0000000000..c16e727f13 --- /dev/null +++ b/reference/spanstream/basic_ispanstream.md @@ -0,0 +1,92 @@ +# basic_ispanstream +* spanstream[meta header] +* std[meta namespace] +* class template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template > + class basic_ispanstream : public basic_istream; + + using ispanstream = basic_ispanstream; + using wispanstream = basic_ispanstream; +} +``` +* char_traits[link /reference/string/char_traits.md] +* basic_istream[link /reference/istream/basic_istream.md] + +## 概要 +`std::basic_ospanstream`クラスは、[`std::span`](/reference/span/span.md) を使用した固定長ストリームバッファを入力元とする入力ストリームである。 + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|-------------------------------------|--------------------------------------------|----------------| +| [`(constructor)`](basic_ispanstream/op_constructor.md) | コンストラクタ | C++23 | +| [`operator=`](basic_ispanstream/op_assign.md) | ムーブ代入 | C++23 | +| [`swap`](basic_ispanstream/swap.md) | 値の交換 | C++23 | +| [`rdbuf`](basic_ispanstream/rdbuf.md) | ストリームバッファオブジェクトの設定・取得 | C++23 | +| [`span`](basic_ispanstream/span.md) | [`std::span`](/reference/span/span.md)オブジェクトの設定・取得 | C++23 | + + +## 非メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|--------|-------------------------------|----------------| +| [`swap`](basic_ispanstream/swap_free.md) | 2つのオブジェクトを入れ替える | C++11 | + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------------------|-------------------------------|----------------| +| `char_type` | テンプレート仮引数`CharT` | C++23 | +| `int_type` | `Traits::int_type` | C++23 | +| `pos_type` | `Traits::pos_type` | C++23 | +| `off_type` | `Traits::off_type` | C++23 | +| `traits_type` | テンプレート仮引数`Traits` | C++23 | + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + char abc[3] = {'A', 'B', 'C'}; + std::span span{abc}; + std::ispanstream iss(span); + + char c; + while (iss >> c) { + std::cout << c << ' '; + } + std::cout << std::endl; +} +``` +* std::ispanstream[color ff0000] +* std::span[link /reference/span/span.md] + +### 出力 +``` +A B C + +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0448R4 A strstream replacement using span<charT> as buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0448r4.pdf) diff --git a/reference/spanstream/basic_ispanstream/op_assign.md b/reference/spanstream/basic_ispanstream/op_assign.md new file mode 100644 index 0000000000..5e6b60ced0 --- /dev/null +++ b/reference/spanstream/basic_ispanstream/op_assign.md @@ -0,0 +1,60 @@ +# operator= +* spanstream[meta header] +* std[meta namespace] +* basic_ispanstream[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +basic_ispanstream& operator=(basic_ispanstream&& rhs); +basic_ispanstream& operator=(const basic_ispanstream&) = delete; +``` + +## 概要 +ムーブ代入を行う。 + +## 効果 +`basic_istream::operator=(std::move(rhs))`を呼び出し、`sb = std::move(rhs.sb)`を実行する。ここで`sb`は内部の`basic_spanbuf`オブジェクトである。 + +## 戻り値 +`*this` + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + char buf1[32] = "first"; + char buf2[32] = ""; + std::ispanstream iss1{std::span(buf1)}; + std::ispanstream iss2{std::span(buf2)}; + + // ムーブ代入 + iss2 = std::move(iss1); + + std::cout << iss2.span().data() << std::endl; +} +``` +* std::ispanstream[link /reference/spanstream/basic_ispanstream.md] +* std::span[link /reference/span/span.md] +* std::move[link /reference/utility/move.md] +* span()[link span.md] +* data()[link /reference/span/span/data.md] + +### 出力 +``` +first +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/spanstream/basic_ispanstream/op_constructor.md b/reference/spanstream/basic_ispanstream/op_constructor.md new file mode 100644 index 0000000000..1a248ba1c3 --- /dev/null +++ b/reference/spanstream/basic_ispanstream/op_constructor.md @@ -0,0 +1,82 @@ +# コンストラクタ +* spanstream[meta header] +* std[meta namespace] +* basic_ispanstream[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +explicit basic_ispanstream(std::span s, + ios_base::openmode which = ios_base::in); // (1) + +basic_ispanstream(const basic_ispanstream&) = delete; // (2) + +basic_ispanstream(basic_ispanstream&& rhs); // (3) + +template +explicit basic_ispanstream(ROS&& s); // (4) +``` +* ios_base[link /reference/ios/ios_base.md] +* std::span[link /reference/span/span.md] + +## 概要 +`basic_ispanstream`オブジェクトを構築する。 + +- (1) : 入力データとして[`std::span`](/reference/span/span.md)オブジェクト、およびモードを指定して構築する +- (2) : (削除) +- (3) : ムーブコンストラクタ +- (4) : `s` から [`std::span`](/reference/span/span.md) 型の固定長バッファを作成し、構築する + + +## テンプレートパラメータ制約 +- (4) : `ROS` が [`ranges​::​borrowed_range`](/reference/ranges/borrowed_range.md) の要求を満たすこと (`(!convertible_to>) && convertible_to>`が`true`であること)。 + +## 効果 +- (1) : 内部で保持している [`basic_spanbuf`](/reference/spanstream/basic_spanbuf.md) 型の固定長バッファを `sb` とすると、ベースクラスを `basic_istream(addressof(sb))` で構築し、さらに `sb` を `basic_spanbuf(s, which | ios_base​::​in)` で初期化する +- (2) : (削除) +- (3) : 内部で保持している [`basic_spanbuf`](/reference/spanstream/basic_spanbuf.md) 型の固定長バッファを `sb` とすると、ベースクラスを `std​::​move(rhs)` で構築し、さらに `sb` を `std​::​move(rhs.sb)` で初期化する。続いて、`basic_istream​::​set_rdbuf(addressof(sb))` を呼び、[`basic_spanbuf`](/reference/spanstream/basic_spanbuf.md) を設定する。 +- (4) : `std​::​span(std​::​forward(s))` を `sp` とした時、`basic_ispanstream(std::span(const_cast(sp.data()), sp.size()))` と同等 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + char buf[32] = "hello"; + std::span span{buf}; + + // (1) std::spanから構築 + std::ispanstream iss1{span}; + + std::cout << iss1.span().data() << std::endl; + + // (3) ムーブ構築 + std::ispanstream iss3{std::move(iss1)}; + + std::cout << iss3.span().data() << std::endl; +} +``` +* std::span[link /reference/span/span.md] +* span()[link span.md] +* data()[link /reference/span/span/data.md] +* std::move[link /reference/utility/move.md] + +### 出力 +``` +hello +hello +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/spanstream/basic_ispanstream/rdbuf.md b/reference/spanstream/basic_ispanstream/rdbuf.md new file mode 100644 index 0000000000..3c1640fa62 --- /dev/null +++ b/reference/spanstream/basic_ispanstream/rdbuf.md @@ -0,0 +1,60 @@ +# rdbuf +* spanstream[meta header] +* std[meta namespace] +* basic_ispanstream[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +basic_spanbuf* rdbuf() const noexcept; +``` +* basic_spanbuf[link /reference/spanstream/basic_spanbuf.md] + +## 概要 +固定長ストリームバッファオブジェクトを取得する。 + +## 戻り値 +内部の`basic_spanbuf`オブジェクトへのポインタ。 + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + char buf[32] = "test"; + std::ispanstream iss{std::span{buf}}; + + std::spanbuf* rd = iss.rdbuf(); + + // バッファから文字を読み取り + std::cout << static_cast(rd->sbumpc()) << std::endl; + std::cout << static_cast(rd->sbumpc()) << std::endl; + std::cout << static_cast(rd->sbumpc()) << std::endl; + std::cout << static_cast(rd->sbumpc()) << std::endl; +} +``` +* rdbuf()[color ff0000] +* std::span[link /reference/span/span.md] +* std::spanbuf[link /reference/spanstream/basic_spanbuf.md] +* sbumpc()[link /reference/streambuf/basic_streambuf/sbumpc.md] + +### 出力 +``` +t +e +s +t +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/spanstream/basic_ispanstream/span.md b/reference/spanstream/basic_ispanstream/span.md new file mode 100644 index 0000000000..117e3bcaeb --- /dev/null +++ b/reference/spanstream/basic_ispanstream/span.md @@ -0,0 +1,104 @@ +# span +* spanstream[meta header] +* std[meta namespace] +* basic_ispanstream[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +std::span span() const noexcept; // (1) + +void span(std::span s) noexcept; // (2) + +template +void span(ROS&& s) noexcept; // (3) +``` +* std::span[link /reference/span/span.md] + +## 概要 +固定長バッファの取得または設定をする。 +- (1) : [`std::span`](/reference/span/span.md) 型の固定長バッファを取得する +- (2) : [`std::span`](/reference/span/span.md) 型の固定長バッファ `s` を設定する +- (3) : `s` から [`std::span`](/reference/span/span.md) 型の固定長バッファを作成し、それを設定する + + +## テンプレートパラメータ制約 +- (3) : `ROS` が [`ranges​::​borrowed_range`](/reference/ranges/borrowed_range.md) の要求を満たすこと (`(!convertible_to>) && convertible_to>`が`true`であること)。 + + +## 効果 +- (1) : `return rdbuf()->span();` と同等 +- (2) : `rdbuf()->span(s)` と同等 +- (3) : `std​::​span(std​::​forward(s))` を `sp` とした時、`this->span(std::span(const_cast(sp.data()), sp.size()))` と同等 + +## 例 +```cpp example +#include +#include +#include +#include + +int main() +{ + char buf1[32] = "default"; + std::span span1{buf1}; + std::ispanstream iss{span1}; + + // (1) + std::span read = iss.span(); + + std::cout << "(1)" << std::endl; + std::cout << read.data() << std::endl; + std::cout << std::endl; + + char buf2[32] = "overwritten"; + std::span span2{buf2}; + + // (2) + iss.span(span2); + + std::cout << "(2)" << std::endl; + std::cout << iss.span().data() << std::endl; + std::cout << std::endl; + + std::array buf3 = {'l', 'a', 's', 't', '\0'}; + + // (3) + iss.span(buf3); + + std::cout << "(3)" << std::endl; + std::cout << iss.span().data() << std::endl; +} +``` +* iss.span();[color ff0000] +* iss.span(span2);[color ff0000] +* iss.span(buf3);[color ff0000] +* std::span[link /reference/span/span.md] +* std::span[link /reference/span/span.md] +* data()[link /reference/span/span/data.md] + +### 出力 +``` +(1) +default + +(2) +overwritten + +(3) +last +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`basic_spanbuf::span`](../basic_spanbuf/span.md) diff --git a/reference/spanstream/basic_ispanstream/swap.md b/reference/spanstream/basic_ispanstream/swap.md new file mode 100644 index 0000000000..7711f0529b --- /dev/null +++ b/reference/spanstream/basic_ispanstream/swap.md @@ -0,0 +1,59 @@ +# swap +* spanstream[meta header] +* std[meta namespace] +* basic_ispanstream[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +void swap(basic_ispanstream& rhs); +``` + +## 概要 +値を交換する。 + +## 効果 +`basic_istream::swap(rhs)`を呼び出し、`sb.swap(rhs.sb)`を実行する。ここで`sb`は内部の`basic_spanbuf`オブジェクトである。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + char buf1[32] = "first"; + char buf2[32] = "second"; + std::ispanstream iss1{std::span(buf1)}; + std::ispanstream iss2{std::span(buf2)}; + + // スワップ + iss1.swap(iss2); + + std::cout << iss1.span().data() << std::endl; + std::cout << iss2.span().data() << std::endl; +} +``` +* iss1.swap(iss2);[color ff0000] +* std::ispanstream[link /reference/spanstream/basic_ispanstream.md] +* std::span[link /reference/span/span.md] +* span()[link span.md] +* data()[link /reference/span/span/data.md] + +### 出力 +``` +second +first +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/spanstream/basic_ispanstream/swap_free.md b/reference/spanstream/basic_ispanstream/swap_free.md new file mode 100644 index 0000000000..d13bce5672 --- /dev/null +++ b/reference/spanstream/basic_ispanstream/swap_free.md @@ -0,0 +1,61 @@ +# swap (非メンバ関数) +* spanstream[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template + void swap(basic_ispanstream& x, + basic_ispanstream& y); +} +``` + +## 概要 +2つの`basic_ispanstream`オブジェクトを入れ替える。 + +## 効果 +`x.swap(y)` + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + char buf1[32] = "first"; + char buf2[32] = "second"; + std::ispanstream iss1{std::span(buf1)}; + std::ispanstream iss2{std::span(buf2)}; + + // スワップ + std::swap(iss1, iss2); + + std::cout << iss1.span().data() << std::endl; + std::cout << iss2.span().data() << std::endl; +} +``` +* std::swap(iss1, iss2);[color ff0000] +* std::ispanstream[link /reference/spanstream/basic_ispanstream.md] +* std::span[link /reference/span/span.md] +* span()[link span.md] +* data()[link /reference/span/span/data.md] + +### 出力 +``` +second +first +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/spanstream/basic_ospanstream.md b/reference/spanstream/basic_ospanstream.md new file mode 100644 index 0000000000..542da7cb69 --- /dev/null +++ b/reference/spanstream/basic_ospanstream.md @@ -0,0 +1,94 @@ +# basic_ospanstream +* spanstream[meta header] +* std[meta namespace] +* class template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template > + class basic_ospanstream : public basic_ostream; + + using ospanstream = basic_ospanstream; + using wospanstream = basic_ospanstream; +} +``` +* char_traits[link /reference/string/char_traits.md] +* basic_ostream[link /reference/ostream/basic_ostream.md] + +## 概要 +`std::basic_ospanstream`クラスは、[`std::span`](/reference/span/span.md) を使用した固定長ストリームバッファを出力先とする出力ストリームである。 + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|-------------------------------------|--------------------------------------------|----------------| +| [`(constructor)`](basic_ospanstream/op_constructor.md) | コンストラクタ | C++23 | +| [`operator=`](basic_ospanstream/op_assign.md) | ムーブ代入 | C++23 | +| [`swap`](basic_ospanstream/swap.md) | 値の交換 | C++23 | +| [`rdbuf`](basic_ospanstream/rdbuf.md) | ストリームバッファオブジェクトの設定・取得 | C++23 | +| [`span`](basic_ospanstream/span.md) | [`std::span`](/reference/span/span.md)オブジェクトの設定・取得 | C++23 | + + +## 非メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|--------|-------------------------------|----------------| +| [`swap`](basic_ospanstream/swap_free.md) | 2つのオブジェクトを入れ替える | C++23 | + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------------------|-------------------------------|----------------| +| `char_type` | テンプレート仮引数`CharT` | C++23 | +| `int_type` | `Traits::int_type` | C++23 | +| `pos_type` | `Traits::pos_type` | C++23 | +| `off_type` | `Traits::off_type` | C++23 | +| `traits_type` | テンプレート仮引数`Traits` | C++23 | + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + char buf[256] = {}; + std::span span{buf}; + std::ospanstream oss(span); + + // 数値や文字列を書き込む + oss << "The answer is " << 42 << " and pi is approximately " << 3.14; + + // 先頭から文字列出力 + const char* p = oss.span().data(); + std::cout << p << std::endl; +} +``` +* std::ospanstream[color ff0000] +* std::span[link /reference/span/span.md] +* span()[link /reference/spanstream/basic_ospanstream/span.md] +* data()[link /reference/span/span/data.md] + +### 出力 +``` +The answer is 42 and pi is approximately 3.14 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0448R4 A strstream replacement using span<charT> as buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0448r4.pdf) diff --git a/reference/spanstream/basic_ospanstream/op_assign.md b/reference/spanstream/basic_ospanstream/op_assign.md new file mode 100644 index 0000000000..ddc5e7167c --- /dev/null +++ b/reference/spanstream/basic_ospanstream/op_assign.md @@ -0,0 +1,60 @@ +# operator= +* spanstream[meta header] +* std[meta namespace] +* basic_ospanstream[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +basic_ospanstream& operator=(basic_ospanstream&& rhs); +basic_ospanstream& operator=(const basic_ospanstream&) = delete; +``` + +## 概要 +ムーブ代入を行う。 + +## 効果 +`basic_ostream::operator=(std::move(rhs))`を呼び出し、`sb = std::move(rhs.sb)`を実行する。ここで`sb`は内部の`basic_spanbuf`オブジェクトである。 + +## 戻り値 +`*this` + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + char buf1[32] = "first"; + char buf2[32] = ""; + std::ospanstream oss1{std::span(buf1)}; + std::ospanstream oss2{std::span(buf2)}; + + // ムーブ代入 + oss2 = std::move(oss1); + + std::cout << oss2.span().data() << std::endl; +} +``` +* std::ospanstream[link /reference/spanstream/basic_ospanstream.md] +* std::span[link /reference/span/span.md] +* std::move[link /reference/utility/move.md] +* span()[link span.md] +* data()[link /reference/span/span/data.md] + +### 出力 +``` +first +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/spanstream/basic_ospanstream/op_constructor.md b/reference/spanstream/basic_ospanstream/op_constructor.md new file mode 100644 index 0000000000..13d8a75a90 --- /dev/null +++ b/reference/spanstream/basic_ospanstream/op_constructor.md @@ -0,0 +1,73 @@ +# コンストラクタ +* spanstream[meta header] +* std[meta namespace] +* basic_ospanstream[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +explicit basic_ospanstream(std::span s, + ios_base::openmode which = ios_base::out); // (1) + +basic_ospanstream(const basic_ospanstream&) = delete; // (2) + +basic_ospanstream(basic_ospanstream&& rhs); // (3) +``` +* ios_base[link /reference/ios/ios_base.md] +* std::span[link /reference/span/span.md] + +## 概要 +`basic_ospanstream`オブジェクトを構築する。 + +- (1) : 入力データとして[`std::span`](/reference/span/span.md)オブジェクト、およびモードを指定して構築する +- (2) : (削除)コピーコンストラクタ +- (3) : ムーブコンストラクタ + +## 効果 +- (1) : 内部で保持している [`basic_spanbuf`](/reference/spanstream/basic_spanbuf.md) 型の固定長バッファを `sb` とすると、ベースクラスを `basic_ostream(addressof(sb))` で構築し、さらに `sb` を `basic_spanbuf(s, which | ios_base​::​out)` で初期化する +- (2) : (削除) +- (3) : 内部で保持している [`basic_spanbuf`](/reference/spanstream/basic_spanbuf.md) 型の固定長バッファを `sb` とすると、ベースクラスを `std​::​move(rhs)` で構築し、さらに `sb` を `std​::​move(rhs.sb)` で初期化する。続いて、`basic_ostream​::​set_rdbuf(addressof(sb))` を呼び、[`basic_spanbuf`](/reference/spanstream/basic_spanbuf.md) を設定する。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + char buf[32] = "hello"; + std::span span{buf}; + + // (1) std::spanから構築 + std::ospanstream oss1{span}; + + std::cout << oss1.span().data() << std::endl; + + // (3) ムーブ構築 + std::ospanstream oss3{std::move(oss1)}; + + std::cout << oss3.span().data() << std::endl; +} +``` +* std::span[link /reference/span/span.md] +* span()[link span.md] +* data()[link /reference/span/span/data.md] +* std::move[link /reference/utility/move.md] + +### 出力 +``` +hello +hello +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/spanstream/basic_ospanstream/rdbuf.md b/reference/spanstream/basic_ospanstream/rdbuf.md new file mode 100644 index 0000000000..d165464097 --- /dev/null +++ b/reference/spanstream/basic_ospanstream/rdbuf.md @@ -0,0 +1,62 @@ +# rdbuf +* spanstream[meta header] +* std[meta namespace] +* basic_ospanstream[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +basic_spanbuf* rdbuf() const noexcept; +``` +* basic_spanbuf[link /reference/spanstream/basic_spanbuf.md] + +## 概要 +固定長ストリームバッファオブジェクトを取得する。 + +## 戻り値 +内部の`basic_spanbuf`オブジェクトへのポインタ。 + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + char buf[32] = "test"; + std::ospanstream oss{std::span{buf}}; + + std::spanbuf* rd = oss.rdbuf(); + + rd->pubseekpos(4, std::ios_base::out); + rd->sputc('i'); + rd->sputc('n'); + rd->sputc('g'); + + // バッファから文字を読み取り + std::cout << oss.span().data() << std::endl; +} +``` +* rdbuf()[color ff0000] +* std::span[link /reference/span/span.md] +* std::spanbuf[link /reference/spanstream/basic_spanbuf.md] +* pubseekpos[link /reference/streambuf/basic_streambuf/pubseekpos.md] +* sputc[link /reference/streambuf/basic_streambuf/sputc.md] +* span()[link span.md] +* data()[link /reference/span/span/data.md] + +### 出力 +``` +testing +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/spanstream/basic_ospanstream/span.md b/reference/spanstream/basic_ospanstream/span.md new file mode 100644 index 0000000000..56ec1ab785 --- /dev/null +++ b/reference/spanstream/basic_ospanstream/span.md @@ -0,0 +1,82 @@ +# span +* spanstream[meta header] +* std[meta namespace] +* basic_ospanstream[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +std::span span() const noexcept; // (1) + +void span(std::span s) noexcept; // (2) +``` +* std::span[link /reference/span/span.md] + +## 概要 +固定長バッファの取得または設定をする。 +- (1) : [`std::span`](/reference/span/span.md) 型の固定長バッファを取得する +- (2) : [`std::span`](/reference/span/span.md) 型の固定長バッファ `s` を設定する + + +## 効果 +- (1) : `return rdbuf()->span();` と同等 +- (2) : `rdbuf()->span(s)` と同等 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + char buf1[32] = "default"; + std::span span1{buf1}; + std::ospanstream oss{span1}; + + // (1) + std::span read = oss.span(); + + std::cout << "(1)" << std::endl; + std::cout << read.data() << std::endl; + std::cout << std::endl; + + char buf2[32] = "overwritten"; + std::span span2{buf2}; + + // (2) + oss.span(span2); + + std::cout << "(2)" << std::endl; + std::cout << oss.span().data() << std::endl; + std::cout << std::endl; +} +``` +* oss.span();[color ff0000] +* oss.span(span2);[color ff0000] +* std::span[link /reference/span/span.md] +* data()[link /reference/span/span/data.md] + +### 出力 +``` +(1) +default + +(2) +overwritten +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`basic_spanbuf::span`](../basic_spanbuf/span.md) diff --git a/reference/spanstream/basic_ospanstream/swap.md b/reference/spanstream/basic_ospanstream/swap.md new file mode 100644 index 0000000000..f0c5150758 --- /dev/null +++ b/reference/spanstream/basic_ospanstream/swap.md @@ -0,0 +1,59 @@ +# swap +* spanstream[meta header] +* std[meta namespace] +* basic_ospanstream[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +void swap(basic_ospanstream& rhs); +``` + +## 概要 +値を交換する。 + +## 効果 +`basic_ostream::swap(rhs)`を呼び出し、`sb.swap(rhs.sb)`を実行する。ここで`sb`は内部の`basic_spanbuf`オブジェクトである。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + char buf1[32] = "first"; + char buf2[32] = "second"; + std::ospanstream oss1{std::span(buf1)}; + std::ospanstream oss2{std::span(buf2)}; + + // スワップ + oss1.swap(oss2); + + std::cout << oss1.span().data() << std::endl; + std::cout << oss2.span().data() << std::endl; +} +``` +* oss1.swap(oss2);[color ff0000] +* std::ospanstream[link /reference/spanstream/basic_ospanstream.md] +* std::span[link /reference/span/span.md] +* span()[link span.md] +* data()[link /reference/span/span/data.md] + +### 出力 +``` +second +first +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/spanstream/basic_ospanstream/swap_free.md b/reference/spanstream/basic_ospanstream/swap_free.md new file mode 100644 index 0000000000..70031da31d --- /dev/null +++ b/reference/spanstream/basic_ospanstream/swap_free.md @@ -0,0 +1,61 @@ +# swap (非メンバ関数) +* spanstream[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template + void swap(basic_ospanstream& x, + basic_ospanstream& y); +} +``` + +## 概要 +2つの`basic_ospanstream`オブジェクトを入れ替える。 + +## 効果 +`x.swap(y)` + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + char buf1[32] = "first"; + char buf2[32] = "second"; + std::ospanstream oss1{std::span(buf1)}; + std::ospanstream oss2{std::span(buf2)}; + + // スワップ + std::swap(oss1, oss2); + + std::cout << oss1.span().data() << std::endl; + std::cout << oss2.span().data() << std::endl; +} +``` +* std::swap(ioss1, oss2);[color ff0000] +* std::ispanstream[link /reference/spanstream/basic_ospanstream.md] +* std::span[link /reference/span/span.md] +* span()[link span.md] +* data()[link /reference/span/span/data.md] + +### 出力 +``` +second +first +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/spanstream/basic_spanbuf.md b/reference/spanstream/basic_spanbuf.md new file mode 100644 index 0000000000..4d095c2ef1 --- /dev/null +++ b/reference/spanstream/basic_spanbuf.md @@ -0,0 +1,117 @@ +# basic_spanbuf +* spanstream[meta header] +* std[meta namespace] +* class template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template > + class basic_spanbuf : public basic_streambuf; + + using spanbuf = basic_spanbuf; + using wspanbuf = basic_spanbuf; +} +``` +* char_traits[link /reference/string/char_traits.md] +* basic_streambuf[link /reference/streambuf/basic_streambuf.md] + +## 概要 +`std::basic_spanbuf`クラスは、[`std::span`](/reference/span/span.md) を使用した固定長ストリームバッファである。 + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|---------------------------------|--------------------------------------------|----------------| +| [`(constructor)`](basic_spanbuf/op_constructor.md) | コンストラクタ | C++23 | +| [`operator=`](basic_spanbuf/op_assign.md) | ムーブ代入 | C++23 | +| [`swap`](basic_spanbuf/swap.md) | 値の交換 | C++23 | +| [`span`](basic_spanbuf/span.md) | [`std::span`](/reference/span/span.md)オブジェクトの設定・取得 | C++23 | + + +## 非メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|--------|-------------------------------|----------------| +| [`swap`](basic_spanbuf/swap_free.md) | 2つのオブジェクトを入れ替える | C++23 | + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------------------|-------------------------------|----------------| +| `char_type` | テンプレート仮引数`CharT` | C++23 | +| `int_type` | `Traits::int_type` | C++23 | +| `pos_type` | `Traits::pos_type` | C++23 | +| `off_type` | `Traits::off_type` | C++23 | +| `traits_type` | テンプレート仮引数`Traits` | C++23 | + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + // basic_spanbufはストリームの内部バッファとして動作する + char buf[256] = {}; + std::span span{buf}; + std::spanbuf sb(span); + + // 書き込み: sputc()で1文字ずつ書き込む + sb.sputc('H'); + sb.sputc('e'); + sb.sputc('l'); + sb.sputc('l'); + sb.sputc('o'); + + // 文字列として取得 + std::cout << "Written: " << sb.span().data() << std::endl; + + char buf2[256] = "World"; + std::span span2{buf2}; + + // 新しい文字列を設定 + sb.span(span2); + + // 読み取り: sbumpc()で1文字ずつ読み取る + std::cout << "Read: "; + while (sb.in_avail() > 0) { + char c = sb.sbumpc(); + std::cout << c; + } + std::cout << std::endl; +} +``` +* std::spanbuf[color ff0000] +* std::span[link /reference/span/span.md] +* sputc[link /reference/streambuf/basic_streambuf/sputc.md] +* span()[link /reference/spanstream/basic_spanbuf/span.md] +* data()[link /reference/span/span/data.md] +* span(span2)[link /reference/spanstream/basic_spanbuf/span.md] +* sbumpc[link /reference/streambuf/basic_streambuf/sbumpc.md] +* in_avail[link /reference/streambuf/basic_streambuf/in_avail.md] + +### 出力 +``` +Written: Hello +Read: World +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0448R4 A strstream replacement using span<charT> as buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0448r4.pdf) diff --git a/reference/spanstream/basic_spanbuf/op_assign.md b/reference/spanstream/basic_spanbuf/op_assign.md new file mode 100644 index 0000000000..107d3e6483 --- /dev/null +++ b/reference/spanstream/basic_spanbuf/op_assign.md @@ -0,0 +1,60 @@ +# operator= +* spanstream[meta header] +* std[meta namespace] +* basic_spanbuf[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +basic_spanbuf& operator=(basic_spanbuf&& rhs); +basic_spanbuf& operator=(const basic_spanbuf&) = delete; +``` + +## 概要 +ムーブ代入を行う。 + +## 効果 +`basic_spanbuf tmp{std::move(rhs)};` として `tmp` を作成後、`this->swap(tmp);` を実行するのと同等。 + +## 戻り値 +`*this` + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + char buf1[32] = "first"; + char buf2[32] = ""; + std::spanbuf sb1{std::span(buf1)}; + std::spanbuf sb2{std::span(buf2)}; + + // ムーブ代入 + sb2 = std::move(sb1); + + std::cout << sb2.span().data() << std::endl; +} +``` +* std::spanbuf[link /reference/spanstream/basic_spanbuf.md] +* std::span[link /reference/span/span.md] +* std::move[link /reference/utility/move.md] +* span()[link span.md] +* data()[link /reference/span/span/data.md] + +### 出力 +``` +first +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/spanstream/basic_spanbuf/op_constructor.md b/reference/spanstream/basic_spanbuf/op_constructor.md new file mode 100644 index 0000000000..91c7eb40a9 --- /dev/null +++ b/reference/spanstream/basic_spanbuf/op_constructor.md @@ -0,0 +1,113 @@ +# コンストラクタ +* spanstream[meta header] +* std[meta namespace] +* basic_spanbuf[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +basic_spanbuf() : basic_spanbuf(ios_base::in | ios_base::out) {} // (1) + +explicit basic_spanbuf(ios_base::openmode which) + : basic_spanbuf(std::span(), which) {} // (2) + +explicit basic_spanbuf(std::span s, + ios_base::openmode which = ios_base::in | ios_base::out); // (3) + +basic_spanbuf(const basic_spanbuf&) = delete; // (4) + +basic_spanbuf(basic_spanbuf&& rhs); // (5) +``` +* ios_base[link /reference/ios/ios_base.md] +* std::span[link /reference/span/span.md] + +## 概要 +`basic_spanbuf`オブジェクトを構築する。 + +- (1) : デフォルトコンストラクタ +- (2) : 指定されたモードで構築する +- (3) : 入力データとして[`std::span`](/reference/span/span.md)オブジェクトと、指定されたモードで構築する +- (4) : (削除)コピーコンストラクタ +- (5) : ムーブコンストラクタ + + +## 効果 +- (1) : 内部のバッファを空にし、モードは`ios_base::in | ios_base::out`に設定する +- (2) : 内部のバッファを空にし、モードは`which`に設定する +- (3) : 内部のバッファを`s`に設定し、モードは`which`に設定する +- (4) : (削除) +- (5) : `rhs`から`basic_spanbuf`オブジェクトをムーブ構築する + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + // (1) + std::spanbuf sb1{}; + + std::cout << "(1)" << std::endl; + std::cout << " in_avail:" << sb1.in_avail() << std::endl; + std::cout << std::endl; + + // (3) + char buf[3] = {'A', 'B', 'C'}; + std::span span{buf}; + std::spanbuf sb3{span}; + + std::cout << "(3)" << std::endl; + std::cout << " in_avail:" << sb3.in_avail() << std::endl; + std::cout << " [0]:" << (char)sb3.sbumpc() << std::endl; + std::cout << " [1]:" << (char)sb3.sbumpc() << std::endl; + std::cout << " [2]:" << (char)sb3.sbumpc() << std::endl; + std::cout << std::endl; + + // (5) + sb3.pubseekpos(0); + std::spanbuf sb5{std::move(sb3)}; + + std::cout << "(5)" << std::endl; + std::cout << " in_avail:" << sb5.in_avail() << std::endl; + std::cout << " [0]:" << (char)sb5.sbumpc() << std::endl; + std::cout << " [1]:" << (char)sb5.sbumpc() << std::endl; + std::cout << " [2]:" << (char)sb5.sbumpc() << std::endl; + std::cout << std::endl; +} +``` +* std::span[link /reference/span/span.md] +* in_avail()[link /reference/streambuf/basic_streambuf/in_avail.md] +* sbumpc()[link /reference/streambuf/basic_streambuf/sbumpc.md] +* pubseekpos()[link /reference/streambuf/basic_streambuf/pubseekpos.md] +* std::move[link /reference/utility/move.md] + +### 出力 +``` +(1) + in_avail:0 + +(3) + in_avail:3 + [0]:A + [1]:B + [2]:C + +(5) + in_avail:3 + [0]:A + [1]:B + [2]:C +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/spanstream/basic_spanbuf/span.md b/reference/spanstream/basic_spanbuf/span.md new file mode 100644 index 0000000000..703c724a7c --- /dev/null +++ b/reference/spanstream/basic_spanbuf/span.md @@ -0,0 +1,76 @@ +# span +* spanstream[meta header] +* std[meta namespace] +* basic_spanbuf[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +std::span span() const noexcept; // (1) + +void span(std::span s) noexcept; // (2) +``` +* std::span[link /reference/span/span.md] + +## 概要 +固定長バッファの取得または設定をする。 + + +## 効果 +- (1) : [`std::span`](/reference/span/span.md) 型の固定長バッファを取得する +- (2) : [`std::span`](/reference/span/span.md) 型の固定長バッファ `s` を設定する + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + char buf1[32] = "default"; + std::span span1{buf1}; + std::spanbuf sb{span1}; + + // (1) + std::span read = sb.span(); + + std::cout << "(1)" << std::endl; + std::cout << read.data() << std::endl; + std::cout << std::endl; + + char buf2[32] = "overwritten"; + std::span span2{buf2}; + + // (2) + sb.span(span2); + + std::cout << "(2)" << std::endl; + std::cout << sb.span().data() << std::endl; +} +``` +* sb.span();[color ff0000] +* sb.span(span2);[color ff0000] +* std::span[link /reference/span/span.md] +* span()[link span.md] +* data()[link /reference/span/span/data.md] + +### 出力 +``` +(1) +default + +(2) +overwritten +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/spanstream/basic_spanbuf/swap.md b/reference/spanstream/basic_spanbuf/swap.md new file mode 100644 index 0000000000..28b82b4dd1 --- /dev/null +++ b/reference/spanstream/basic_spanbuf/swap.md @@ -0,0 +1,58 @@ +# swap +* spanstream[meta header] +* std[meta namespace] +* basic_spanbuf[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +void swap(basic_spanbuf& rhs); +``` + +## 概要 +値を交換する。 + +## 効果 +`basic_streambuf::swap(rhs)`を呼び出し、`mode`と内部の文字列バッファを`rhs`と交換する。 + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + char buf1[32] = "first"; + char buf2[32] = "second"; + std::spanbuf sb1{std::span(buf1)}; + std::spanbuf sb2{std::span(buf2)}; + + // スワップ + sb1.swap(sb2); + + std::cout << sb1.span().data() << std::endl; + std::cout << sb2.span().data() << std::endl; +} +``` +* sb1.swap(sb2);[color ff0000] +* std::spanbuf[link /reference/spanstream/basic_spanbuf.md] +* std::span[link /reference/span/span.md] +* span()[link span.md] +* data()[link /reference/span/span/data.md] + +### 出力 +``` +second +first +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/spanstream/basic_spanbuf/swap_free.md b/reference/spanstream/basic_spanbuf/swap_free.md new file mode 100644 index 0000000000..b2a6dfe81e --- /dev/null +++ b/reference/spanstream/basic_spanbuf/swap_free.md @@ -0,0 +1,61 @@ +# swap (非メンバ関数) +* spanstream[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template + void swap(basic_spanbuf& x, + basic_spanbuf& y); +} +``` + +## 概要 +2つの`basic_spanbuf`オブジェクトを入れ替える。 + +## 効果 +`x.swap(y)` + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + char buf1[32] = "first"; + char buf2[32] = "second"; + std::spanbuf sb1{std::span(buf1)}; + std::spanbuf sb2{std::span(buf2)}; + + // スワップ + std::swap(sb1, sb2); + + std::cout << sb1.span().data() << std::endl; + std::cout << sb2.span().data() << std::endl; +} +``` +* std::swap(sb1, sb2);[color ff0000] +* std::spanbuf[link /reference/spanstream/basic_spanbuf.md] +* std::span[link /reference/span/span.md] +* span()[link span.md] +* data()[link /reference/span/span/data.md] + +### 出力 +``` +second +first +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/spanstream/basic_spanstream.md b/reference/spanstream/basic_spanstream.md new file mode 100644 index 0000000000..745e17a617 --- /dev/null +++ b/reference/spanstream/basic_spanstream.md @@ -0,0 +1,115 @@ +# basic_spanstream +* spanstream[meta header] +* std[meta namespace] +* class template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { + template > + class basic_spanstream : public basic_iostream; + + using spanstream = basic_spanstream; + using wspanstream = basic_spanstream; +} +``` +* char_traits[link /reference/string/char_traits.md] +* basic_iostream[link /reference/istream/basic_iostream.md] + +## 概要 +`std::basic_spanstream`クラスは、[`std::span`](/reference/span/span.md) を使用した固定長ストリームバッファを出力先・入力元とするストリームであり、読み取りと書き込みの両方の操作ができる。 + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|-------------------------------------|--------------------------------------------|----------------| +| [`(constructor)`](basic_spanstream/op_constructor.md) | コンストラクタ | C++23 | +| [`operator=`](basic_spanstream/op_assign.md) | ムーブ代入 | C++23 | +| [`swap`](basic_spanstream/swap.md) | 値の交換 | C++23 | +| [`rdbuf`](basic_spanstream/rdbuf.md) | ストリームバッファオブジェクトの設定・取得 | C++23 | +| [`span`](basic_spanstream/span.md) | [`std::span`](/reference/span/span.md)オブジェクトの設定・取得 | C++23 | + + +## 非メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|--------|-------------------------------|----------------| +| [`swap`](basic_spanstream/swap_free.md) | 2つのオブジェクトを入れ替える | C++23 | + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------------------|-------------------------------|----------------| +| `char_type` | テンプレート仮引数`CharT` | C++23 | +| `int_type` | `Traits::int_type` | C++23 | +| `pos_type` | `Traits::pos_type` | C++23 | +| `off_type` | `Traits::off_type` | C++23 | +| `traits_type` | テンプレート仮引数`Traits` | C++23 | + +## 例 +```cpp example +#include +#include +#include +#include + +int main() +{ + // 読み取りと書き込みが可能なストリーム + char buf[256] = {}; + std::span span{buf}; + std::spanstream ss(span); + + // データを書き込む + ss << "Hello " << 123 << " World " << 45.67; + + // 先頭から文字列出力 + const char* p = ss.span().data(); + std::cout << p << std::endl; + + // 読み取り位置をリセット + ss.seekg(0); + + std::string word1, word2; + int num1; + double num2; + + // データを読み取る + ss >> word1 >> num1 >> word2 >> num2; + + // データを出力 + std::cout << std::endl + << "word1=\"" << word1 + << "\", num1=" << num1 + << ", word2=\"" << word2 + << "\", num2=" << num2 << std::endl; +} +``` +* std::spanstream[color ff0000] +* std::span[link /reference/span/span.md] +* span()[link /reference/spanstream/basic_spanstream/span.md] +* data()[link /reference/span/span/data.md] + +### 出力 +``` +Hello 123 World 45.67 + +word1=Hello, num1=123, word3=World, num2=45.67 +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P0448R4 A strstream replacement using span<charT> as buffer](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0448r4.pdf) diff --git a/reference/spanstream/basic_spanstream/op_assign.md b/reference/spanstream/basic_spanstream/op_assign.md new file mode 100644 index 0000000000..e701036e75 --- /dev/null +++ b/reference/spanstream/basic_spanstream/op_assign.md @@ -0,0 +1,60 @@ +# operator= +* spanstream[meta header] +* std[meta namespace] +* basic_spanstream[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +basic_spanstream& operator=(basic_spanstream&& rhs); +basic_spanstream& operator=(const basic_spanstream&) = delete; +``` + +## 概要 +ムーブ代入を行う。 + +## 効果 +`basic_iostream::operator=(std::move(rhs))`を呼び出し、`sb = std::move(rhs.sb)`を実行する。ここで`sb`は内部の`basic_spanbuf`オブジェクトである。 + +## 戻り値 +`*this` + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + char buf1[32] = "first"; + char buf2[32] = ""; + std::spanstream ss1{std::span(buf1)}; + std::spanstream ss2{std::span(buf2)}; + + // ムーブ代入 + ss2 = std::move(ss1); + + std::cout << ss2.span().data() << std::endl; +} +``` +* std::spanstream[link /reference/spanstream/basic_spanstream.md] +* std::span[link /reference/span/span.md] +* std::move[link /reference/utility/move.md] +* span()[link span.md] +* data()[link /reference/span/span/data.md] + +### 出力 +``` +first +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/spanstream/basic_spanstream/op_constructor.md b/reference/spanstream/basic_spanstream/op_constructor.md new file mode 100644 index 0000000000..e6240377b9 --- /dev/null +++ b/reference/spanstream/basic_spanstream/op_constructor.md @@ -0,0 +1,75 @@ +# コンストラクタ +* spanstream[meta header] +* std[meta namespace] +* basic_spanstream[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +explicit basic_spanstream(std::span s, + ios_base::openmode which = ios_base::out | ios_base::in); // (1) + +basic_spanstream(const basic_spanstream&) = delete; // (2) + +basic_spanstream(basic_spanstream&& rhs); // (3) +``` +* ios_base[link /reference/ios/ios_base.md] +* std::span[link /reference/span/span.md] + +## 概要 +`basic_spanstream`オブジェクトを構築する。 + +ここで、初期値としてデータは、既存のファイルを上書きモードで開くことに似ており、ストリームの初期位置が先頭のまま、ストリーム内容の文字列を設定するものである。 + +- (1) : 初期データとして[`std::span`](/reference/span/span.md)オブジェクトの設定して構築する +- (2) : (削除)コピーコンストラクタ +- (3) : ムーブコンストラクタ + +## 効果 +- (1) : 内部で保持している [`basic_spanbuf`](/reference/spanstream/basic_spanbuf.md) 型の固定長バッファを `sb` とすると、ベースクラスを `basic_iostream(addressof(sb))` で構築し、さらに `sb` を `basic_spanbuf(s, which)` で初期化する +- (2) : (削除) +- (3) : 内部で保持している [`basic_spanbuf`](/reference/spanstream/basic_spanbuf.md) 型の固定長バッファを `sb` とすると、ベースクラスを `std​::​move(rhs)` で構築し、さらに `sb` を `std​::​move(rhs.sb)` で初期化する。続いて、`basic_ostream​::​set_rdbuf(addressof(sb))` を呼び、[`basic_spanbuf`](/reference/spanstream/basic_spanbuf.md) を設定する。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + char buf[32] = "hello"; + std::span span{buf}; + + // (1) std::spanから構築 + std::spanstream ss1{span}; + + std::cout << ss1.span().data() << std::endl; + + // (3) ムーブ構築 + std::spanstream ss3{std::move(ss1)}; + + std::cout << ss3.span().data() << std::endl; +} +``` +* std::span[link /reference/span/span.md] +* span()[link span.md] +* data()[link /reference/span/span/data.md] +* std::move[link /reference/utility/move.md] + +### 出力 +``` +hello +hello +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/spanstream/basic_spanstream/rdbuf.md b/reference/spanstream/basic_spanstream/rdbuf.md new file mode 100644 index 0000000000..1f3d610dab --- /dev/null +++ b/reference/spanstream/basic_spanstream/rdbuf.md @@ -0,0 +1,63 @@ +# rdbuf +* spanstream[meta header] +* std[meta namespace] +* basic_spanstream[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +basic_spanbuf* rdbuf() const noexcept; +``` +* basic_spanbuf[link /reference/spanstream/basic_spanbuf.md] + +## 概要 +固定長ストリームバッファオブジェクトを取得する。 + +## 戻り値 +内部の`basic_spanbuf`オブジェクトへのポインタ。 + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + char buf[32] = "test"; + std::spanstream ss{std::span{buf}}; + + std::spanbuf* rd = ss.rdbuf(); + + // バッファから文字を読み取り + std::cout << static_cast(rd->sbumpc()) << std::endl; // 't' + + // バッファに文字を書き込み + rd->sputc('!'); + + std::cout << ss.span().data() << std::endl; +} +``` +* rdbuf()[color ff0000] +* std::span[link /reference/span/span.md] +* std::spanbuf[link /reference/spanstream/basic_spanbuf.md] +* sbumpc()[link /reference/streambuf/basic_streambuf/sbumpc.md] +* sputc[link /reference/streambuf/basic_streambuf/sputc.md] +* span()[link span.md] +* data()[link /reference/span/span/data.md] + +### 出力 +``` +t +est! +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/spanstream/basic_spanstream/span.md b/reference/spanstream/basic_spanstream/span.md new file mode 100644 index 0000000000..20c696a297 --- /dev/null +++ b/reference/spanstream/basic_spanstream/span.md @@ -0,0 +1,82 @@ +# span +* spanstream[meta header] +* std[meta namespace] +* basic_spanstream[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +std::span span() const noexcept; // (1) + +void span(std::span s) noexcept; // (2) +``` +* std::span[link /reference/span/span.md] + +## 概要 +固定長バッファの取得または設定をする。 +- (1) : [`std::span`](/reference/span/span.md) 型の固定長バッファを取得する +- (2) : [`std::span`](/reference/span/span.md) 型の固定長バッファ `s` を設定する + + +## 効果 +- (1) : `return rdbuf()->span();` と同等 +- (2) : `rdbuf()->span(s)` と同等 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + char buf1[32] = "default"; + std::span span1{buf1}; + std::spanstream ss{span1}; + + // (1) + std::span read = ss.span(); + + std::cout << "(1)" << std::endl; + std::cout << read.data() << std::endl; + std::cout << std::endl; + + char buf2[32] = "overwritten"; + std::span span2{buf2}; + + // (2) + ss.span(span2); + + std::cout << "(2)" << std::endl; + std::cout << ss.span().data() << std::endl; +} +``` +* ss.span();[color ff0000] +* ss.span(span2);[color ff0000] +* std::span[link /reference/span/span.md] +* span()[link span.md] +* data()[link /reference/span/span/data.md] + +### 出力 +``` +(1) +default + +(2) +overwritten +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`basic_spanbuf::span`](../basic_spanbuf/span.md) diff --git a/reference/spanstream/basic_spanstream/swap.md b/reference/spanstream/basic_spanstream/swap.md new file mode 100644 index 0000000000..aa253d58dd --- /dev/null +++ b/reference/spanstream/basic_spanstream/swap.md @@ -0,0 +1,58 @@ +# swap +* spanstream[meta header] +* std[meta namespace] +* basic_spanstream[meta class] +* function[meta id-type] +* cpp23[meta cpp] + +```cpp +void swap(basic_spanstream& rhs); +``` + +## 概要 +値を交換する。 + +## 効果 +`basic_iostream::swap(rhs)`を呼び出し、`sb.swap(rhs.sb)`を実行する。ここで`sb`は内部の`basic_spanbuf`オブジェクトである。 + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + char buf1[32] = "first"; + char buf2[32] = "second"; + std::spanstream ss1{std::span(buf1)}; + std::spanstream ss2{std::span(buf2)}; + + // スワップ + ss1.swap(ss2); + + std::cout << ss1.span().data() << std::endl; + std::cout << ss2.span().data() << std::endl; +} +``` +* ss1.swap(ss2);[color ff0000] +* std::spanstream[link /reference/spanstream/basic_spanstream.md] +* std::span[link /reference/span/span.md] +* span()[link span.md] +* data()[link /reference/span/span/data.md] + +### 出力 +``` +second +first +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/spanstream/basic_spanstream/swap_free.md b/reference/spanstream/basic_spanstream/swap_free.md new file mode 100644 index 0000000000..7c262f44a5 --- /dev/null +++ b/reference/spanstream/basic_spanstream/swap_free.md @@ -0,0 +1,61 @@ +# swap (非メンバ関数) +* spanstream[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp23[meta cpp] + +```cpp +namespace std { +template +void swap(basic_spanstream& x, + basic_spanstream& y); +} +``` + +## 概要 +2つの`basic_spanstream`オブジェクトを入れ替える。 + +## 効果 +`x.swap(y)` + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + char buf1[32] = "first"; + char buf2[32] = "second"; + std::spanstream ss1{std::span(buf1)}; + std::spanstream ss2{std::span(buf2)}; + + // スワップ + std::swap(ss1, ss2); + + std::cout << ss1.span().data() << std::endl; + std::cout << ss2.span().data() << std::endl; +} +``` +* std::swap(ss1, ss2);[color ff0000] +* std::spanstream[link /reference/spanstream/basic_spanstream.md] +* std::span[link /reference/span/span.md] +* span()[link span.md] +* data()[link /reference/span/span/data.md] + +### 出力 +``` +second +first +``` + + +## バージョン +### 言語 +- C++23 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? From 9402b83e34605fac386727aa0220390147b03ab5 Mon Sep 17 00:00:00 2001 From: suomesta Date: Mon, 11 Aug 2025 15:46:48 +0900 Subject: [PATCH 2281/3948] fix wrong link regarding (#1051) --- reference/spanstream/basic_ospanstream/swap_free.md | 4 ++-- reference/spanstream/basic_spanbuf/op_constructor.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/spanstream/basic_ospanstream/swap_free.md b/reference/spanstream/basic_ospanstream/swap_free.md index 70031da31d..84b886ec83 100644 --- a/reference/spanstream/basic_ospanstream/swap_free.md +++ b/reference/spanstream/basic_ospanstream/swap_free.md @@ -38,8 +38,8 @@ int main() std::cout << oss2.span().data() << std::endl; } ``` -* std::swap(ioss1, oss2);[color ff0000] -* std::ispanstream[link /reference/spanstream/basic_ospanstream.md] +* std::swap(oss1, oss2);[color ff0000] +* std::ospanstream[link /reference/spanstream/basic_ospanstream.md] * std::span[link /reference/span/span.md] * span()[link span.md] * data()[link /reference/span/span/data.md] diff --git a/reference/spanstream/basic_spanbuf/op_constructor.md b/reference/spanstream/basic_spanbuf/op_constructor.md index 91c7eb40a9..506915cb31 100644 --- a/reference/spanstream/basic_spanbuf/op_constructor.md +++ b/reference/spanstream/basic_spanbuf/op_constructor.md @@ -81,7 +81,7 @@ int main() * std::span[link /reference/span/span.md] * in_avail()[link /reference/streambuf/basic_streambuf/in_avail.md] * sbumpc()[link /reference/streambuf/basic_streambuf/sbumpc.md] -* pubseekpos()[link /reference/streambuf/basic_streambuf/pubseekpos.md] +* pubseekpos[link /reference/streambuf/basic_streambuf/pubseekpos.md] * std::move[link /reference/utility/move.md] ### 出力 From 5b26921c6cdb44111453041e52c8c2998fb904fd Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 11 Aug 2025 20:41:08 +0900 Subject: [PATCH 2282/3948] =?UTF-8?q?=E3=82=BC=E3=83=AD=E5=B9=85=E6=96=87?= =?UTF-8?q?=E5=AD=97=E3=82=92=E5=89=8A=E9=99=A4=E3=81=97=E3=80=81=E7=A6=81?= =?UTF-8?q?=E6=AD=A2=E6=96=87=E5=AD=97=E3=82=92=E3=83=81=E3=82=A7=E3=83=83?= =?UTF-8?q?=E3=82=AF=E3=83=BB=E5=89=8A=E9=99=A4=E3=81=99=E3=82=8B=E3=82=B9?= =?UTF-8?q?=E3=82=AF=E3=83=AA=E3=83=97=E3=83=88=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20#1487?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/script/check.py | 4 ++ .../script/forbidden_character_check.py | 37 +++++++++++++++++++ .../script/remove_forbidden_character.py | 37 +++++++++++++++++++ .../basic_ispanstream/op_constructor.md | 8 ++-- .../spanstream/basic_ispanstream/span.md | 4 +- .../basic_ospanstream/op_constructor.md | 4 +- .../basic_spanstream/op_constructor.md | 2 +- 7 files changed, 87 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/script/forbidden_character_check.py create mode 100644 .github/workflows/script/remove_forbidden_character.py diff --git a/.github/workflows/script/check.py b/.github/workflows/script/check.py index 7fd921db26..204322d5f1 100644 --- a/.github/workflows/script/check.py +++ b/.github/workflows/script/check.py @@ -1,6 +1,7 @@ import sys import code_qualify_check import display_error_check +import forbidden_character_check import global_qualify_check import link_check import meta_header_check @@ -13,6 +14,9 @@ if not display_error_check.check(): print("display_error_check failed") sys.exit(1) + if not forbidden_character_check.check(): + print("forbidden_character_check failed") + sys.exit(1) if not global_qualify_check.check(): print("global_qualify_check failed") sys.exit(1) diff --git a/.github/workflows/script/forbidden_character_check.py b/.github/workflows/script/forbidden_character_check.py new file mode 100644 index 0000000000..26ad9564dc --- /dev/null +++ b/.github/workflows/script/forbidden_character_check.py @@ -0,0 +1,37 @@ +import glob +import os +import sys +import re +import unicodedata + +FORBIDDEN_CHARACTERS = [ + '\u00ad', # Soft hyphen (ソフトハイフン) + '\u200b', # Zero width space (ゼロ幅スペース) +] + +def check_forbidden_character(text: str, filename: str) -> bool: + found_error: bool = False + + for char in FORBIDDEN_CHARACTERS: + m = re.search(char, text) + if m: + code_point = ord(char) + name = unicodedata.name(chr(code_point)) + print("{}: the file includes forbidden character \"U+{:X}\" ({}).".format(filename, code_point, name)) + found_error = True + return not found_error + +def check() -> bool: + found_error = False + for p in sorted(list(glob.glob("**/*.md", recursive=True))): + with open(p) as f: + text = f.read() + + if not check_forbidden_character(text, p): + found_error = True + + return not found_error + +if __name__ == '__main__': + if not check(): + sys.exit(1) diff --git a/.github/workflows/script/remove_forbidden_character.py b/.github/workflows/script/remove_forbidden_character.py new file mode 100644 index 0000000000..09cf9b6c71 --- /dev/null +++ b/.github/workflows/script/remove_forbidden_character.py @@ -0,0 +1,37 @@ +# 禁止された不可視文字を削除するスクリプト。 +# トップディレクトリで以下を実行する: +# python3 .github/workflows/script/remove_forbidden_character.py + +import os +import glob + +FORBIDDEN_CHARACTERS = [ + '\u00ad', # Soft hyphen (ソフトハイフン) + '\u200b', # Zero width space (ゼロ幅スペース) +] + +def remove_forbidden_characters(p) -> bool: + try: + with open(p, 'r', encoding='utf-8') as f: + content = f.read() + + original_content = content + for char in FORBIDDEN_CHARACTERS: + content = content.replace(char, '') + + if content != original_content: + with open(p, 'w', encoding='utf-8') as f: + f.write(content) + return True + + return False + + except Exception as e: + print(f"Error processing {file_path}: {e}") + return False + +if __name__ == '__main__': + for p in sorted(list(glob.glob("**/*.md", recursive=True))): + if remove_forbidden_characters(p): + print(f"{p} -> Modified") + diff --git a/reference/spanstream/basic_ispanstream/op_constructor.md b/reference/spanstream/basic_ispanstream/op_constructor.md index 1a248ba1c3..2584a9c6df 100644 --- a/reference/spanstream/basic_ispanstream/op_constructor.md +++ b/reference/spanstream/basic_ispanstream/op_constructor.md @@ -29,13 +29,13 @@ explicit basic_ispanstream(ROS&& s); // (4) ## テンプレートパラメータ制約 -- (4) : `ROS` が [`ranges​::​borrowed_range`](/reference/ranges/borrowed_range.md) の要求を満たすこと (`(!convertible_to>) && convertible_to>`が`true`であること)。 +- (4) : `ROS` が [`ranges::borrowed_range`](/reference/ranges/borrowed_range.md) の要求を満たすこと (`(!convertible_to>) && convertible_to>`が`true`であること)。 ## 効果 -- (1) : 内部で保持している [`basic_spanbuf`](/reference/spanstream/basic_spanbuf.md) 型の固定長バッファを `sb` とすると、ベースクラスを `basic_istream(addressof(sb))` で構築し、さらに `sb` を `basic_spanbuf(s, which | ios_base​::​in)` で初期化する +- (1) : 内部で保持している [`basic_spanbuf`](/reference/spanstream/basic_spanbuf.md) 型の固定長バッファを `sb` とすると、ベースクラスを `basic_istream(addressof(sb))` で構築し、さらに `sb` を `basic_spanbuf(s, which | ios_base::in)` で初期化する - (2) : (削除) -- (3) : 内部で保持している [`basic_spanbuf`](/reference/spanstream/basic_spanbuf.md) 型の固定長バッファを `sb` とすると、ベースクラスを `std​::​move(rhs)` で構築し、さらに `sb` を `std​::​move(rhs.sb)` で初期化する。続いて、`basic_istream​::​set_rdbuf(addressof(sb))` を呼び、[`basic_spanbuf`](/reference/spanstream/basic_spanbuf.md) を設定する。 -- (4) : `std​::​span(std​::​forward(s))` を `sp` とした時、`basic_ispanstream(std::span(const_cast(sp.data()), sp.size()))` と同等 +- (3) : 内部で保持している [`basic_spanbuf`](/reference/spanstream/basic_spanbuf.md) 型の固定長バッファを `sb` とすると、ベースクラスを `std::move(rhs)` で構築し、さらに `sb` を `std::move(rhs.sb)` で初期化する。続いて、`basic_istream::set_rdbuf(addressof(sb))` を呼び、[`basic_spanbuf`](/reference/spanstream/basic_spanbuf.md) を設定する。 +- (4) : `std::span(std::forward(s))` を `sp` とした時、`basic_ispanstream(std::span(const_cast(sp.data()), sp.size()))` と同等 ## 例 diff --git a/reference/spanstream/basic_ispanstream/span.md b/reference/spanstream/basic_ispanstream/span.md index 117e3bcaeb..fb8fc9eca5 100644 --- a/reference/spanstream/basic_ispanstream/span.md +++ b/reference/spanstream/basic_ispanstream/span.md @@ -23,13 +23,13 @@ void span(ROS&& s) noexcept; // (3) ## テンプレートパラメータ制約 -- (3) : `ROS` が [`ranges​::​borrowed_range`](/reference/ranges/borrowed_range.md) の要求を満たすこと (`(!convertible_to>) && convertible_to>`が`true`であること)。 +- (3) : `ROS` が [`ranges::borrowed_range`](/reference/ranges/borrowed_range.md) の要求を満たすこと (`(!convertible_to>) && convertible_to>`が`true`であること)。 ## 効果 - (1) : `return rdbuf()->span();` と同等 - (2) : `rdbuf()->span(s)` と同等 -- (3) : `std​::​span(std​::​forward(s))` を `sp` とした時、`this->span(std::span(const_cast(sp.data()), sp.size()))` と同等 +- (3) : `std::span(std::forward(s))` を `sp` とした時、`this->span(std::span(const_cast(sp.data()), sp.size()))` と同等 ## 例 ```cpp example diff --git a/reference/spanstream/basic_ospanstream/op_constructor.md b/reference/spanstream/basic_ospanstream/op_constructor.md index 13d8a75a90..67fa6a2fc3 100644 --- a/reference/spanstream/basic_ospanstream/op_constructor.md +++ b/reference/spanstream/basic_ospanstream/op_constructor.md @@ -24,9 +24,9 @@ basic_ospanstream(basic_ospanstream&& rhs); // (3) - (3) : ムーブコンストラクタ ## 効果 -- (1) : 内部で保持している [`basic_spanbuf`](/reference/spanstream/basic_spanbuf.md) 型の固定長バッファを `sb` とすると、ベースクラスを `basic_ostream(addressof(sb))` で構築し、さらに `sb` を `basic_spanbuf(s, which | ios_base​::​out)` で初期化する +- (1) : 内部で保持している [`basic_spanbuf`](/reference/spanstream/basic_spanbuf.md) 型の固定長バッファを `sb` とすると、ベースクラスを `basic_ostream(addressof(sb))` で構築し、さらに `sb` を `basic_spanbuf(s, which | ios_base::out)` で初期化する - (2) : (削除) -- (3) : 内部で保持している [`basic_spanbuf`](/reference/spanstream/basic_spanbuf.md) 型の固定長バッファを `sb` とすると、ベースクラスを `std​::​move(rhs)` で構築し、さらに `sb` を `std​::​move(rhs.sb)` で初期化する。続いて、`basic_ostream​::​set_rdbuf(addressof(sb))` を呼び、[`basic_spanbuf`](/reference/spanstream/basic_spanbuf.md) を設定する。 +- (3) : 内部で保持している [`basic_spanbuf`](/reference/spanstream/basic_spanbuf.md) 型の固定長バッファを `sb` とすると、ベースクラスを `std::move(rhs)` で構築し、さらに `sb` を `std::move(rhs.sb)` で初期化する。続いて、`basic_ostream::set_rdbuf(addressof(sb))` を呼び、[`basic_spanbuf`](/reference/spanstream/basic_spanbuf.md) を設定する。 ## 例 diff --git a/reference/spanstream/basic_spanstream/op_constructor.md b/reference/spanstream/basic_spanstream/op_constructor.md index e6240377b9..5d92317c00 100644 --- a/reference/spanstream/basic_spanstream/op_constructor.md +++ b/reference/spanstream/basic_spanstream/op_constructor.md @@ -28,7 +28,7 @@ basic_spanstream(basic_spanstream&& rhs); // (3) ## 効果 - (1) : 内部で保持している [`basic_spanbuf`](/reference/spanstream/basic_spanbuf.md) 型の固定長バッファを `sb` とすると、ベースクラスを `basic_iostream(addressof(sb))` で構築し、さらに `sb` を `basic_spanbuf(s, which)` で初期化する - (2) : (削除) -- (3) : 内部で保持している [`basic_spanbuf`](/reference/spanstream/basic_spanbuf.md) 型の固定長バッファを `sb` とすると、ベースクラスを `std​::​move(rhs)` で構築し、さらに `sb` を `std​::​move(rhs.sb)` で初期化する。続いて、`basic_ostream​::​set_rdbuf(addressof(sb))` を呼び、[`basic_spanbuf`](/reference/spanstream/basic_spanbuf.md) を設定する。 +- (3) : 内部で保持している [`basic_spanbuf`](/reference/spanstream/basic_spanbuf.md) 型の固定長バッファを `sb` とすると、ベースクラスを `std::move(rhs)` で構築し、さらに `sb` を `std::move(rhs.sb)` で初期化する。続いて、`basic_ostream::set_rdbuf(addressof(sb))` を呼び、[`basic_spanbuf`](/reference/spanstream/basic_spanbuf.md) を設定する。 ## 例 From d3227a734b455e06aec3830ab3aeb9a4b5724309 Mon Sep 17 00:00:00 2001 From: "Y.Moroto" Date: Wed, 13 Aug 2025 11:48:13 +0900 Subject: [PATCH 2283/3948] Add `assume` attributes to attributes.md --- lang/cpp11/attributes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/lang/cpp11/attributes.md b/lang/cpp11/attributes.md index 162f7330ad..84d3ad7b09 100644 --- a/lang/cpp11/attributes.md +++ b/lang/cpp11/attributes.md @@ -177,6 +177,7 @@ C++11で採用されたもの以外で検討された以下の機能は、属性 - [C++20 `[[likely]]`, `[[unlikely]]`属性](/lang/cpp20/likely_and_unlikely_attributes.md) - [C++20 属性の名前空間を予約](/lang/cpp20/reserving_attribute_namespaces_for_future_use.md) - [C++23 ラムダ式に対する属性](/lang/cpp23/attributes_on_lambda_expressions.md) +- [C++23 コード内容の仮定をコンパイラに伝える`assume`属性](/lang/cpp23/portable_assumptions.md) - [C++26 構造化束縛への属性を許可](/lang/cpp26/attributes_for_structured_bindings.md) - [C++26 未初期化変数の読み取りをエラー性動作とする (`[[indeterminate]]`属性)](/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md) From 5895eedd8280c661fcb3952589f442e8fe88f6de Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 13 Aug 2025 12:12:09 +0900 Subject: [PATCH 2284/3948] =?UTF-8?q?C++23=20assume=E5=B1=9E=E6=80=A7=20:?= =?UTF-8?q?=20C++11=E5=B1=9E=E6=80=A7=E6=A7=8B=E6=96=87=E3=81=B8=E3=81=AE?= =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=82=92=E9=96=A2=E9=80=A3=E9=A0=85?= =?UTF-8?q?=E7=9B=AE=E3=81=AB=E8=BF=BD=E5=8A=A0=20#1488?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23/portable_assumptions.md | 1 + 1 file changed, 1 insertion(+) diff --git a/lang/cpp23/portable_assumptions.md b/lang/cpp23/portable_assumptions.md index 66c560d08b..2a9a6ebbd8 100644 --- a/lang/cpp23/portable_assumptions.md +++ b/lang/cpp23/portable_assumptions.md @@ -65,6 +65,7 @@ int f(int y) ## 関連項目 +- [C++11 属性構文](/lang/cpp11/attributes.md) - [C++20 `[[likely]]`, `[[unlikely]]`属性](/lang/cpp20/likely_and_unlikely_attributes.md) From 6b2d8651f702d3e56a7e170b2400f2403c4eabc8 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 14 Aug 2025 13:38:40 +0900 Subject: [PATCH 2285/3948] =?UTF-8?q?=E8=A8=80=E8=AA=9E=E6=A9=9F=E8=83=BD?= =?UTF-8?q?=20:=20=E9=96=A2=E9=80=A3=E9=A0=85=E7=9B=AE=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp11/auto.md | 1 + lang/cpp17/constexpr_lambda.md | 3 +++ .../new_rules_for_auto_deduction_from_braced-init-list.md | 1 + lang/cpp20/try-catch_blocks_in_constexpr_functions.md | 1 + lang/cpp23/relaxing_some_constexpr_restrictions.md | 5 +++-- lang/cpp26/user-generated_static_assert_messages.md | 1 + 6 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lang/cpp11/auto.md b/lang/cpp11/auto.md index bf7a66bb43..fc234c6605 100644 --- a/lang/cpp11/auto.md +++ b/lang/cpp11/auto.md @@ -372,6 +372,7 @@ std::pair& p = foo(); - [C++14 `decltype(auto)`](../cpp14/decltype_auto.md) - [C++14 後置戻り値型をプレースホルダーにすることを許可](../cpp14/placeholder_type_in_trailing_return_type.md) - [C++14 通常関数の戻り値型推論(ユーザ定義変換関数の型推論を含む)](../cpp14/return_type_deduction_for_normal_functions.md) +- [C++17 単一要素の波カッコ初期化を非配列とする](../cpp17/new_rules_for_auto_deduction_from_braced-init-list.md) ## 参照 diff --git a/lang/cpp17/constexpr_lambda.md b/lang/cpp17/constexpr_lambda.md index e4d3a09e3f..066519ed9b 100644 --- a/lang/cpp17/constexpr_lambda.md +++ b/lang/cpp17/constexpr_lambda.md @@ -198,6 +198,9 @@ C++14まではラムダ式がコンパイル時に呼び出せないため、 (執筆中) +## 関連項目 +- [C++11 `constexpr`](/lang/cpp11/constexpr.md) + ## 参照 (執筆中) diff --git a/lang/cpp17/new_rules_for_auto_deduction_from_braced-init-list.md b/lang/cpp17/new_rules_for_auto_deduction_from_braced-init-list.md index 658b2b6e0a..d035423202 100644 --- a/lang/cpp17/new_rules_for_auto_deduction_from_braced-init-list.md +++ b/lang/cpp17/new_rules_for_auto_deduction_from_braced-init-list.md @@ -93,6 +93,7 @@ i ## 関連項目 +* [C++11 変数の型推論のための`auto`](/lang/cpp11/auto.md) * [C++11 初期化リスト](/lang/cpp11/initializer_lists.md) diff --git a/lang/cpp20/try-catch_blocks_in_constexpr_functions.md b/lang/cpp20/try-catch_blocks_in_constexpr_functions.md index 3427b67170..ca7103a88e 100644 --- a/lang/cpp20/try-catch_blocks_in_constexpr_functions.md +++ b/lang/cpp20/try-catch_blocks_in_constexpr_functions.md @@ -30,6 +30,7 @@ constexpr int f(int x) { ## 関連項目 +- [C++11 `constexpr`](/lang/cpp11/constexpr.md) - [C++20 可変サイズをもつコンテナの`constexpr`化](more_constexpr_containers.md) diff --git a/lang/cpp23/relaxing_some_constexpr_restrictions.md b/lang/cpp23/relaxing_some_constexpr_restrictions.md index cb4d14ba4d..a715c2943d 100644 --- a/lang/cpp23/relaxing_some_constexpr_restrictions.md +++ b/lang/cpp23/relaxing_some_constexpr_restrictions.md @@ -115,8 +115,9 @@ void f(std::optional& opt) ## 関連項目 -- [C++20 - constexpr関数内でのtry-catchブロックを許可](/lang/cpp20/try-catch_blocks_in_constexpr_functions.md) -- [C++20 - constexpr関数内で未評価のインラインアセンブリを許可することによる組み込み関数のconstexpr有効化](/lang/cpp20/enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.md) +- [C++11 `constexpr`](/lang/cpp11/constexpr.md) +- [C++20 `constexpr`関数内での`try-catch`ブロックを許可](/lang/cpp20/try-catch_blocks_in_constexpr_functions.md) +- [C++20 `constexpr`関数内で未評価のインラインアセンブリを許可することによる組み込み関数の`constexpr`有効化](/lang/cpp20/enabling_constexpr_intrinsics_by_permitting_unevaluated_inline-assembly_in_constexpr_functions.md) ## 参照 diff --git a/lang/cpp26/user-generated_static_assert_messages.md b/lang/cpp26/user-generated_static_assert_messages.md index 1cf9ea1a28..3e2bdefa70 100644 --- a/lang/cpp26/user-generated_static_assert_messages.md +++ b/lang/cpp26/user-generated_static_assert_messages.md @@ -53,6 +53,7 @@ static_assert(定数式, 診断メッセージ); ## 関連項目 - [C++11 コンパイル時アサート](/lang/cpp11/static_assert.md) +- [C++17 `static_assert`のメッセージ省略を許可](/lang/cpp17/extending_static_assert.md) ## 参照 From d29d225cd07cf1094a32f27d27e8283edc3abdd7 Mon Sep 17 00:00:00 2001 From: yoh Date: Sat, 16 Aug 2025 10:47:50 +0900 Subject: [PATCH 2286/3948] execution: P3557R3 remove transform_completion_signatures(_of) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit revert 4ae7b92cd7a2f7d38cc6c2a27ee3bf1136f08c62 (ノ∀`) --- reference/execution/execution.md | 3 +- .../execution/execution/gather-signatures.md | 1 - .../transform_completion_signatures.md | 86 ------------------- .../transform_completion_signatures_of.md | 53 ------------ reference/execution/execution/type-list.md | 1 - 5 files changed, 1 insertion(+), 143 deletions(-) delete mode 100644 reference/execution/execution/transform_completion_signatures.md delete mode 100644 reference/execution/execution/transform_completion_signatures_of.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 634592a365..a9eda1dc8a 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -142,8 +142,6 @@ Senderコンシューマは名前空間 `std::this_thread` で定義される。 | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`execution::completion_signatures`](execution/completion_signatures.md) | 完了シグネチャ集合を表現する型 (class template) | C++26 | -| [`execution::transform_completion_signatures`](execution/transform_completion_signatures.md) | 完了シグネチャ集合を変換 (alias template) | C++26 | -| [`execution::transform_completion_signatures_of`](execution/transform_completion_signatures_of.md) | Senderの完了シグネチャ集合を変換 (alias template) | C++26 | | [`execution::run_loop`](execution/run_loop.md) | 単一スレッド上でのループ実行 (class) | C++26 | ### コルーチンユーティリティ @@ -162,4 +160,5 @@ Senderコンシューマは名前空間 `std::this_thread` で定義される。 ## 参照 - [P0024R2 The Parallelism TS Should be Standardized](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0024r2.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) - [P3682R0 Remove `std::execution::split`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3682r0.pdf) diff --git a/reference/execution/execution/gather-signatures.md b/reference/execution/execution/gather-signatures.md index 40a8ea3e94..9d41f78b41 100644 --- a/reference/execution/execution/gather-signatures.md +++ b/reference/execution/execution/gather-signatures.md @@ -37,7 +37,6 @@ using gather-signatures = see below; - [`execution::value_types_of_t`](value_types_of_t.md) - [`execution::error_types_of_t`](error_types_of_t.md) - [`execution::sends_stopped`](sends_stopped.md) -- [`execution::transform_completion_signatures`](transform_completion_signatures.md) ## 参照 diff --git a/reference/execution/execution/transform_completion_signatures.md b/reference/execution/execution/transform_completion_signatures.md deleted file mode 100644 index 6f590e348b..0000000000 --- a/reference/execution/execution/transform_completion_signatures.md +++ /dev/null @@ -1,86 +0,0 @@ -# transform_completion_signatures -* execution[meta header] -* std::execution[meta namespace] -* type-alias[meta id-type] -* cpp26[meta cpp] - -```cpp -namespace std::execution { - template< - valid-completion-signatures InputSignatures, - valid-completion-signatures AdditionalSignatures = completion_signatures<>, - template class SetValue = default-set-value, - template class SetError = default-set-error, - valid-completion-signatures SetStopped = completion_signatures> - using transform_completion_signatures = completion_signatures; -} -``` -* valid-completion-signatures[link completion_signatures.md] -* completion_signatures[link completion_signatures.md] -* set_stopped_t()[link set_stopped.md] - -## 概要 -[完了シグネチャ集合](completion_signatures.md)から別の完了シグネチャ集合へ変換するエイリアステンプレート。 - -テンプレートパラメータとして完了シグネチャ集合と、各完了シグネチャに対して型変更を適用する複数のテンプレート引数をとり、[`completion_signatures`](completion_signatures.md)の新しい特殊化を生成する。 - -- `InputSignatures` : 変換元の入力完了シグネチャ集合 -- `AdditionalSignatures` : 追加される完了シグネチャ集合(下記3種の変換適用後に追加される) -- `SetValue` : [値完了シグネチャ](set_value.md)集合に適用する型変換メタ操作 -- `SetError` : [エラー完了シグネチャ](set_value.md)集合に適用する型変換メタ操作 -- `SetStopped` : [停止完了シグネチャ](set_stopped.md)を置換する完了シグネチャ集合 - - -### 詳細仕様 -説明専用のエイリアステンプレート`default-set-value`, `default-set-error`を次の通り定義する。 -```cpp -template -using default-set-value = - completion_signatures; - -template -using default-set-error = - completion_signatures; -``` -* completion_signatures[link completion_signatures.md] -* set_value_t[link set_value.md] -* set_error_t[link set_error.md] - -説明用のパック型`As`に対して、エイリアステンプレート`SetValue`を不適格、もしくは[`valid-completion-signatures`](completion_signatures.md)`>`を満たす型とする。 -説明用の型`Err`に対して、エイリアステンプレート`SetError`を不適格、もしくは[`valid-completion-signatures`](completion_signatures.md)`>`を満たす型とする。 - -説明用のパック`Vs`を、[`gather-signatures`](gather-signatures.md)`<`[`set_value_t`](set_value.md)`, InputSignatures, SetValue,` [`type-list`](type-list.md)`>`で得られる`type-list`の型パラメータパックとする。 - -説明用のパック`Es`を、[`gather-signatures`](gather-signatures.md)`<`[`set_error_t`](set_error.md)`, InputSignatures,` [`type_identity_t`](/reference/type_traits/type_identity.md)`, error-list>`で得られる[`type-list`](type-list.md)の型パラメータパックとする。ここでエイリアステンプレート`error-list`は`type-list...>`とする。 - -[`gather-signatures`](gather-signatures.md)`<`[`set_stopped_t`](set_stopped.md)`, InputSignatures, type-list, type-list>`が[`type-list<>`](type-list.md)となるならば、説明用のパック`Ss`を[`completion_signatures<>`](completion_signatures.md)とする。そうでなければ、`Ss`を`SetStopped`とする。 - -上記いずれかの型が不適格となる場合、下記は不適格となる。 - -```cpp -transform_completion_signatures< - InputSignatures, AdditionalSignatures, - SetValue, SetError, SetStopped> -``` - -そうでなければ、集合`AdditionalSignatures`, `Vs...`, `Es...`, `Ss`に含まれる[`completion_signatures`](completion_signatures.md)特殊化のテンプレート引数型の一意な集合を`Sig...`としたとき、`transform_completion_signatures`は[`completion_signatures`](completion_signatures.md)``のエイリアスとなる。 - - -## バージョン -### 言語 -- C++26 - -### 処理系 -- [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? -- [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? - - -## 関連項目 -- [`execution::completion_signatures`](completion_signatures.md) -- [`execution::transform_completion_signatures_of`](transform_completion_signatures_of.md) - - -## 参照 -- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/transform_completion_signatures_of.md b/reference/execution/execution/transform_completion_signatures_of.md deleted file mode 100644 index 74f43325d2..0000000000 --- a/reference/execution/execution/transform_completion_signatures_of.md +++ /dev/null @@ -1,53 +0,0 @@ -# transform_completion_signatures_of -* execution[meta header] -* std::execution[meta namespace] -* type-alias[meta id-type] -* cpp26[meta cpp] - -```cpp -namespace std::execution { - template< - sender Sndr, - class Env = env<>, - valid-completion-signatures AdditionalSignatures = completion_signatures<>, - template class SetValue = see below, - template class SetError = see below, - valid-completion-signatures SetStopped = completion_signatures> - requires sender_in - using transform_completion_signatures_of = - transform_completion_signatures< - completion_signatures_of_t, - AdditionalSignatures, SetValue, SetError, SetStopped>; -} -``` -* sender[link sender.md] -* env<>[link env.md] -* valid-completion-signatures[link completion_signatures.md] -* completion_signatures[link completion_signatures.md] -* set_stopped_t()[link set_stopped.md] -* sender_in[link sender_in.md] -* transform_completion_signatures[link transform_completion_signatures.md] -* completion_signatures_of_t[link completion_signatures_of_t.md] - -## 概要 -[Sender型](sender.md)`Sndr`が[環境](../queryable.md)`Env`において非同期操作を作成できるとき、Senderの[完了シグネチャ集合](get_completion_signatures.md)から別の完了シグネチャ集合へ変換するエイリアステンプレート。 - - -## バージョン -### 言語 -- C++26 - -### 処理系 -- [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? -- [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? - - -## 関連項目 -- [`execution::get_completion_signatures`](get_completion_signatures.md) -- [`execution::transform_completion_signatures`](transform_completion_signatures.md) - - -## 参照 -- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) diff --git a/reference/execution/execution/type-list.md b/reference/execution/execution/type-list.md index be6b38550c..d54a46203b 100644 --- a/reference/execution/execution/type-list.md +++ b/reference/execution/execution/type-list.md @@ -20,7 +20,6 @@ struct type-list; // exposition only ## 関連項目 - [`execution::sends_stopped`](sends_stopped.md) -- [`execution::transform_completion_signatures`](transform_completion_signatures.md) ## 参照 From acbbb7b62f1bec988cc011dbf6d90f43adce9138 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sat, 16 Aug 2025 20:26:58 +0900 Subject: [PATCH 2287/3948] =?UTF-8?q?=E3=82=B9=E3=82=AF=E3=83=AA=E3=83=97?= =?UTF-8?q?=E3=83=88=E3=81=AE=E5=A4=89=E6=95=B0=E5=90=8D=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/script/remove_forbidden_character.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/script/remove_forbidden_character.py b/.github/workflows/script/remove_forbidden_character.py index 09cf9b6c71..2a27e1a459 100644 --- a/.github/workflows/script/remove_forbidden_character.py +++ b/.github/workflows/script/remove_forbidden_character.py @@ -27,7 +27,7 @@ def remove_forbidden_characters(p) -> bool: return False except Exception as e: - print(f"Error processing {file_path}: {e}") + print(f"Error processing {p}: {e}") return False if __name__ == '__main__': From 0c54fa48adbc045fd96ce698149ee256aefae68a Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sat, 16 Aug 2025 20:27:35 +0900 Subject: [PATCH 2288/3948] =?UTF-8?q?=E3=82=B9=E3=82=AF=E3=83=AA=E3=83=97?= =?UTF-8?q?=E3=83=88=E3=81=AE=E5=9E=8B=E3=82=A2=E3=83=8E=E3=83=86=E3=83=BC?= =?UTF-8?q?=E3=82=B7=E3=83=A7=E3=83=B3=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/script/global_qualify_check.py | 2 +- .github/workflows/script/link_check.py | 4 ++-- .github/workflows/script/meta_header_check.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/script/global_qualify_check.py b/.github/workflows/script/global_qualify_check.py index d7a819535d..f5ed4cda38 100644 --- a/.github/workflows/script/global_qualify_check.py +++ b/.github/workflows/script/global_qualify_check.py @@ -7,7 +7,7 @@ import re def convrert_qualify_list(qualify_list: str) -> list: - ls: list(str, str) = [] + ls: list[tuple[str, str]] = [] for line in qualify_list.split("\n"): stripped_line = line.strip() if not stripped_line or stripped_line.startswith("#"): diff --git a/.github/workflows/script/link_check.py b/.github/workflows/script/link_check.py index f0b807d6dd..0bab733b4b 100644 --- a/.github/workflows/script/link_check.py +++ b/.github/workflows/script/link_check.py @@ -15,7 +15,7 @@ def retry_sleep(): sec = random.uniform(20, 30); time.sleep(sec) -def check_url(url: str, retry: int = 5) -> (bool, str): +def check_url(url: str, retry: int = 5) -> tuple[bool, str]: try: headers = {'User-agent': 'Mozilla/5.0'} res = requests.head(url, headers=headers, verify=False, timeout=60.0) @@ -75,7 +75,7 @@ def is_ignore_link(link: str) -> bool: return False -def find_all_links(text: str, is_global: bool) -> (list, set): +def find_all_links(text: str, is_global: bool) -> tuple[list, set[str]]: inner_links = [] outer_links = set() diff --git a/.github/workflows/script/meta_header_check.py b/.github/workflows/script/meta_header_check.py index 9b6f3286e2..b1635d2ade 100644 --- a/.github/workflows/script/meta_header_check.py +++ b/.github/workflows/script/meta_header_check.py @@ -3,7 +3,7 @@ import sys import re -def find_header_or_module(line: str) -> (re.Match, str): +def find_header_or_module(line: str) -> tuple[re.Match[str] | None, str]: m = re.fullmatch(r'[\*-] (.*?)\[meta header\]', line, re.MULTILINE) if m: return m, "header" From c1128ceedac0dd58735948c117fcb6f79f095490 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sat, 16 Aug 2025 20:34:00 +0900 Subject: [PATCH 2289/3948] =?UTF-8?q?=E3=82=B9=E3=82=AF=E3=83=AA=E3=83=97?= =?UTF-8?q?=E3=83=88=E3=81=AE=E4=B8=8D=E8=A6=81=E3=81=AA=E3=82=BB=E3=83=9F?= =?UTF-8?q?=E3=82=B3=E3=83=AD=E3=83=B3=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/script/create_github_issue_when_not_empty.py | 2 +- .github/workflows/script/link_check.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/script/create_github_issue_when_not_empty.py b/.github/workflows/script/create_github_issue_when_not_empty.py index fa159fedf7..7de6834ffa 100644 --- a/.github/workflows/script/create_github_issue_when_not_empty.py +++ b/.github/workflows/script/create_github_issue_when_not_empty.py @@ -23,7 +23,7 @@ def main(): } try: with open(file_name, 'r') as file: - data = file.read(); + data = file.read() if len(data) == 0: return body = f"The commit hash was: {commit_hash}\n\n" + data diff --git a/.github/workflows/script/link_check.py b/.github/workflows/script/link_check.py index 0bab733b4b..f5320e9fca 100644 --- a/.github/workflows/script/link_check.py +++ b/.github/workflows/script/link_check.py @@ -12,7 +12,7 @@ urllib3.disable_warnings() def retry_sleep(): - sec = random.uniform(20, 30); + sec = random.uniform(20, 30) time.sleep(sec) def check_url(url: str, retry: int = 5) -> tuple[bool, str]: From 2f35dc053621b8451d7609f46a7c01f34b47681b Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sun, 17 Aug 2025 22:50:58 +0900 Subject: [PATCH 2290/3948] new page: fwrite.md --- reference/cstdio.md | 2 +- reference/cstdio/fwrite.md | 73 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 reference/cstdio/fwrite.md diff --git a/reference/cstdio.md b/reference/cstdio.md index 297863cfb8..5510092ecd 100644 --- a/reference/cstdio.md +++ b/reference/cstdio.md @@ -55,7 +55,7 @@ | [`fputc`](/reference/cstdio/fputc.md) | ファイルに1文字出力する | | | [`fputs`](/reference/cstdio/fputs.md) | ファイルにN文字出力する | | | [`fread`](/reference/cstdio/fread.md) | ファイルからN文字読み込む | | -| [`fwrite`](/reference/cstdio/fwrite.md.nolink) | ファイルにN文字書き込む | | +| [`fwrite`](/reference/cstdio/fwrite.md) | ファイルにN文字書き込む | | | [`fgetpos`](/reference/cstdio/fgetpos.md.nolink) | ファイルの現在位置を取得する | | | [`fseek`](/reference/cstdio/fseek.md.nolink) | ファイルの現在位置を移動する | | | [`fsetpos`](/reference/cstdio/fsetpos.md.nolink) | ファイルの現在位置を設定する | | diff --git a/reference/cstdio/fwrite.md b/reference/cstdio/fwrite.md new file mode 100644 index 0000000000..fefe620bd9 --- /dev/null +++ b/reference/cstdio/fwrite.md @@ -0,0 +1,73 @@ +# fwrite +* cstdio[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +namespace std { + size_t fwrite(const void *buffer, size_t size, size_t count, FILE *stream); +} +``` + +## 概要 +ファイルに`count`個の`size`バイトのデータを書き込む。 + +ファイル内の位置は、書き込まれたバイトだけ進む。 + +## 要件 +- `buffer`は有効なポインタであること。 +- `stream`は有効なファイルストリームであること。 + +## 戻り値 +正常に書き込むことのできた項目の数を返す。 + +`size`または`count`のいずれかが0だった場合、必ず`0`を返し、`buffer`は変更されない。 + +## 効果 +`buffer`が指すメモリから`count`個の`size`バイトのデータを`stream`に書き込む。 + +書き込みエラーが生じなければ、書き込むデータの大きさは`count * size`バイトである。 + +## 例 +```cpp example +#include + +int main() { + std::FILE *file = std::fopen("output.txt", "w"); + if (!file) { + std::perror("ファイルを開けませんでした"); + return 1; + } + + const char data[] = "Hello, World!"; + /* + 厳密には、sizeof(char)は1バイトであることが保証されているため、 + sizeof(data) - 1は、文字列の長さ(ヌル終端文字を除く)と等しくなる。 + */ + std::size_t count = std::fwrite(data, sizeof(char), sizeof(data) - 1, file); + std::printf("書き込んだデータの長さ: %zu\n", count); + + std::fclose(file); + return 0; +} +``` +* std::fwrite[color ff0000] +* std::fopen[link /reference/cstdio/fopen.md] +* std::fclose[link /reference/cstdio/fclose.md] +* std::perror[link /reference/cstdio/perror.md.nolink] +* std::printf[link /reference/cstdio/printf.md] + +### 出力例 +``` +書き込んだデータの長さ: 13 +``` + +### ファイル出力(output.txt) +``` +Hello, World! +``` + +## 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? From 309420a9d3b169efecff7f01f40a11ca4f61641b Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 18 Aug 2025 17:39:28 +0900 Subject: [PATCH 2291/3948] =?UTF-8?q?typo=E4=BF=AE=E6=AD=A3=E3=81=A8NG?= =?UTF-8?q?=E3=83=AF=E3=83=BC=E3=83=89=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/script/ngword_check.py | 1 + lang/cpp20/feature_test_macros.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/script/ngword_check.py b/.github/workflows/script/ngword_check.py index 2f700cb338..6747603c9b 100644 --- a/.github/workflows/script/ngword_check.py +++ b/.github/workflows/script/ngword_check.py @@ -9,6 +9,7 @@ ("", "acccess", "access"), ("", "ALING", "ALIGN"), ("", "alloacte", "allocate"), + ("", "alocator", "allocator"), ("", "asssert", "assert"), ("", "asssume", "assume"), ("", "algined", "aligned"), diff --git a/lang/cpp20/feature_test_macros.md b/lang/cpp20/feature_test_macros.md index 76dcd41337..c88ed5a9a7 100644 --- a/lang/cpp20/feature_test_macros.md +++ b/lang/cpp20/feature_test_macros.md @@ -60,7 +60,7 @@ |`__cpp_lib_concepts`|`202002L`|[``](/reference/concepts.md)の追加|[``](/reference/concepts.md)| |`__cpp_lib_constexpr_algorithms`|`201806L`|多くのアルゴリズムに`constexpr`を追加|[``](/reference/algorithm.md)| |`__cpp_lib_constexpr_complex`|`201711L`|[`std::complex`](/reference/complex/complex.md)の`constexpr`対応|[``](/reference/complex.md)| -|`__cpp_lib_constexpr_dynamic_alloc`|`201907L`|[`std::destroy_at`](/reference/memory/destroy_at.md)ファミリと[`std::allocator`](/reference/memory/allocator.md)/[`std::alocator_traits`](/reference/memory/allocator_traits.md)の`constexpr`対応
[`std::construct_at`](/reference/memory/construct_at.md)|[``](/reference/memory.md)| +|`__cpp_lib_constexpr_dynamic_alloc`|`201907L`|[`std::destroy_at`](/reference/memory/destroy_at.md)ファミリと[`std::allocator`](/reference/memory/allocator.md)/[`std::allocator_traits`](/reference/memory/allocator_traits.md)の`constexpr`対応
[`std::construct_at`](/reference/memory/construct_at.md)|[``](/reference/memory.md)| |`__cpp_lib_constexpr_functional`|`201907L`|[`std::invoke`](/reference/functional/invoke.md)、[`std::reference_wrapper`](/reference/functional/reference_wrapper.md)、[`std::not_fn`](/reference/functional/not_fn.md)、[`std::bind_front`](/reference/functional/bind_front.md)、[`std::bind`](/reference/functional/bind.md)、[`std::mem_fn`](/reference/functional/mem_fn.md)の`constexpr`対応|[``](/reference/functional.md)| |`__cpp_lib_constexpr_iterator`|`201811L`|[`back_insert_iterator`](/reference/iterator/back_insert_iterator.md)、[`front_insert_iterator`](/reference/iterator/front_insert_iterator.md)、[`insert_iterator`](/reference/iterator/insert_iterator.md)の`constexpr`対応|[``](/reference/iterator.md)| |`__cpp_lib_constexpr_memory`|`201811L`|[`std::pointer_traits`](/reference/memory/pointer_traits.md)の`constexpr`対応|[``](/reference/memory.md)| From 5b73464290cf98e568330bb74e3ec68cbf393462 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 18 Aug 2025 18:48:42 +0900 Subject: [PATCH 2292/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp20/more_constexpr_containers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp20/more_constexpr_containers.md b/lang/cpp20/more_constexpr_containers.md index 36010cc6e6..f973b57465 100644 --- a/lang/cpp20/more_constexpr_containers.md +++ b/lang/cpp20/more_constexpr_containers.md @@ -164,7 +164,7 @@ constexpr void f() { `std::allocator/std::allocator_traits`では`new/delete`式とは異なり、メモリの確保・解放([`allocate`](/reference/memory/allocator/allocate.md)/[`deallocate`](/reference/memory/allocator/deallocate.md))とその領域へのオブジェクト構築・破棄([`construct`](/reference/memory/allocator_traits/construct.md)/[`destroy`](/reference/memory/allocator_traits/destroy.md))の操作が複合していない。オブジェクト構築・破棄においては*placement new*と*pseudo-destructor call*が必要となるが、*placement new*はポインタの再解釈が必要となることから許可されず、そのために不必要であるので*pseudo-destructor call*も許可されない。 -代わりに、*placement new*を行うライブラリ機能である[`construct_at`](/reference/memory/construct.md.nolink)を追加し、*pseudo-destructor call*を行う[`destroy_at`](/reference/memory/destroy_at.md)と共に`constexpr`を付加し定数式で使用可能とする。これらの関数は`void*`ではなく`T*`を取るため、これによってポインタ再解釈を回避しつつ*placement new*と*pseudo-destructor call*が定数式で使用可能となる。 +代わりに、*placement new*を行うライブラリ機能である[`construct_at`](/reference/memory/construct_at.md)を追加し、*pseudo-destructor call*を行う[`destroy_at`](/reference/memory/destroy_at.md)と共に`constexpr`を付加し定数式で使用可能とする。これらの関数は`void*`ではなく`T*`を取るため、これによってポインタ再解釈を回避しつつ*placement new*と*pseudo-destructor call*が定数式で使用可能となる。 そして、`std::allocator_traits`の`construct`と`destroy`は`construct_at/destroy_at`を呼び出して処理を行うように変更される。なお、これによって実行時の振る舞いが変化することはない。 From 68b6308db257aae186ed1c50143722248e06189e Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 18 Aug 2025 18:51:23 +0900 Subject: [PATCH 2293/3948] =?UTF-8?q?=E3=83=98=E3=83=83=E3=83=80=E3=81=AE?= =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp11/initializer_lists.md | 2 +- lang/cpp14/feature_test_macros.md | 2 +- reference/thread/jthread.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lang/cpp11/initializer_lists.md b/lang/cpp11/initializer_lists.md index 7b0c85cad6..8063a5ef6f 100644 --- a/lang/cpp11/initializer_lists.md +++ b/lang/cpp11/initializer_lists.md @@ -24,7 +24,7 @@ std::vector v2 {1, 2, 3}; v2 = {4, 5, 6}; ``` -ユーザー定義型に対してリスト初期化を許可するためには、[``](/reference/initializer_list/initializer_list.md)ヘッダで定義される[`std::initializer_list`](/reference/initializer_list/initializer_list.md)クラスのオブジェクトをパラメータとして、コンストラクタや代入演算子をオーバーロードする: +ユーザー定義型に対してリスト初期化を許可するためには、[``](/reference/initializer_list.md)ヘッダで定義される[`std::initializer_list`](/reference/initializer_list/initializer_list.md)クラスのオブジェクトをパラメータとして、コンストラクタや代入演算子をオーバーロードする: ```cpp example #include diff --git a/lang/cpp14/feature_test_macros.md b/lang/cpp14/feature_test_macros.md index dea42835af..9c17114fb5 100644 --- a/lang/cpp14/feature_test_macros.md +++ b/lang/cpp14/feature_test_macros.md @@ -30,7 +30,7 @@ SD-6 は C++14 の機能について以下のテストマクロを定義する | `__cpp_lib_is_final` | `201402` | [`std::is_final`](/reference/type_traits/is_final.md) | [``](/reference/type_traits.md) | | `__cpp_lib_is_null_pointer` | `201309` | [`std::is_null_pointer`](/reference/type_traits/is_null_pointer.md) | [``](/reference/type_traits.md) | | `__cpp_lib_make_reverse_iterator` | `201402` | [`std::make_reverse_iterator`](/reference/iterator/make_reverse_iterator.md) | [``](/reference/iterator.md) | -| `__cpp_lib_make_unique` | `201304` | [`std::make_unique`](/reference/memory/make_unique.md) | [``](/reference/memory/make_unique.md) +| `__cpp_lib_make_unique` | `201304` | [`std::make_unique`](/reference/memory/make_unique.md) | [``](/reference/memory.md) | `__cpp_lib_null_iterators` | `201304` | ヌル前方向イテレータ | [``](/reference/iterator.md) | | `__cpp_lib_quoted_string_io` | `201304` | [`std::quoted`](/reference/iomanip/quoted.md) | [``](/reference/iomanip.md) | `__cpp_lib_result_of_sfinae` | `201210` | [`std::result_of`](/reference/type_traits/result_of.md) と SFINAE | [``](/reference/type_traits.md) | diff --git a/reference/thread/jthread.md b/reference/thread/jthread.md index 52cdf30adb..ccbb51401e 100644 --- a/reference/thread/jthread.md +++ b/reference/thread/jthread.md @@ -15,7 +15,7 @@ namespace std { ## `thread`クラスとの違い -- 停止要求のサポート: `jthread`は自身と関連付けられたスレッドに対する停止要求を扱う仕組みを提供する。このために[``](/reference/stop_token/stop_token.md)ヘッダに定義されたクラスを利用する。 +- 停止要求のサポート: `jthread`は自身と関連付けられたスレッドに対する停止要求を扱う仕組みを提供する。このために[``](/reference/stop_token.md)ヘッダに定義されたクラスを利用する。 - 自動join機能: `jthread`はデストラクタやムーブ代入演算子が呼び出されたとき、もし自身に関連付けられたスレッドが存在する場合は、スレッドの停止要求を作成し、その後[`join()`](jthread/join.md)を呼び出してスレッドの終了を待機する。そのため`thread`クラスと異なり、[`joinable()`](jthread/joinable.md) `==` `true` であってもデストラクタやムーブ代入演算子を呼び出し可能であり、[`std::terminate()`](/reference/exception/terminate.md)は呼び出されない。 ## メンバ関数 From 35b31511e5d7f7d7436804fee54898662bbc962e Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 18 Aug 2025 18:53:17 +0900 Subject: [PATCH 2294/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=81=AE?= =?UTF-8?q?=E3=82=AB=E3=83=83=E3=82=B3=E3=81=AE=E9=96=89=E3=81=98=E5=BF=98?= =?UTF-8?q?=E3=82=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/mutex/defer_lock.md | 2 +- reference/mutex/try_to_lock.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/mutex/defer_lock.md b/reference/mutex/defer_lock.md index 171a2f5211..f159498bb7 100644 --- a/reference/mutex/defer_lock.md +++ b/reference/mutex/defer_lock.md @@ -55,4 +55,4 @@ int main() ## 参照 -- [LWG Issue 2510. Tag types should not be `DefaultConstructible`](https://cplusplus.github.io/LWG/issue2510 +- [LWG Issue 2510. Tag types should not be `DefaultConstructible`](https://cplusplus.github.io/LWG/issue2510) diff --git a/reference/mutex/try_to_lock.md b/reference/mutex/try_to_lock.md index 9a4c5c7f01..cb02a97fa7 100644 --- a/reference/mutex/try_to_lock.md +++ b/reference/mutex/try_to_lock.md @@ -61,4 +61,4 @@ int main() ## 参照 -- [LWG Issue 2510. Tag types should not be `DefaultConstructible`](https://cplusplus.github.io/LWG/issue2510 +- [LWG Issue 2510. Tag types should not be `DefaultConstructible`](https://cplusplus.github.io/LWG/issue2510) From 24df3e18e1187bb57136cc71008e5c8b59af32fa Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 18 Aug 2025 19:20:58 +0900 Subject: [PATCH 2295/3948] =?UTF-8?q?typo=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp17/feature_test_macros.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp17/feature_test_macros.md b/lang/cpp17/feature_test_macros.md index de1e956713..be3840df5f 100644 --- a/lang/cpp17/feature_test_macros.md +++ b/lang/cpp17/feature_test_macros.md @@ -57,7 +57,7 @@ SD-6 は C++17 の機能について以下のテストマクロを定義する | `__cpp_lib_any` | `201606` | [`std::any`](/reference/any/any.md) | [``](/reference/any.md) | | `__cpp_lib_variant` | `201606` | [`std::variant`](/reference/variant/variant.md) | [``](/reference/variant.md) | | `__cpp_lib_memory_resource` | `201603` | [`std::memory_resource`](/reference/memory_resource/memory_resource.md)と関連する機能 | [``](/reference/memory_resource.md) | -| `__cpp_lib_boyer_moore_searcher` | `201603` | [`std::boyer_morre_searcher`](/reference/functional/boyer_moore_searcher.md)と関連する機能 | [``](/reference/functional.md) | +| `__cpp_lib_boyer_moore_searcher` | `201603` | [`std::boyer_moore_searcher`](/reference/functional/boyer_moore_searcher.md)と関連する機能 | [``](/reference/functional.md) | | `__cpp_lib_string_view` | `201606` | [`std::string_view`](/reference/string_view/basic_string_view.md) | [``](/reference/string_view.md) | | `__cpp_lib_sample` | `201603` | [`std::sample()`](/reference/algorithm/sample.md) | [``](/reference/algorithm.md) | | `__cpp_lib_addressof_constexpr` | `201603` | [`std::addressof()`](/reference/memory/addressof.md) | [``](/reference/memory.md) | From 2c047fd2f80ce3bd8625491bb488e6b1a6e17c9a Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 18 Aug 2025 19:21:16 +0900 Subject: [PATCH 2296/3948] =?UTF-8?q?ranges::=20=E6=8A=9C=E3=81=91?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp23.md b/lang/cpp23.md index 3825638064..93717594fc 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -155,7 +155,7 @@ C++23とは、2023年中に改訂され、ISO/IEC 14882:2024で標準規格化 ### アルゴリズム -- [``](/reference/algorithm.md)に、範囲の先頭が指定した範囲と合致するかを判定する[`std::starts_with()`](/reference/algorithm/ranges_starts_with.md)、範囲の末尾が指定した範囲と合致するかを判定する[`std::ends_with()`](/reference/algorithm/ranges_ends_with.md)を追加 +- [``](/reference/algorithm.md)に、範囲の先頭が指定した範囲と合致するかを判定する[`std::ranges::starts_with()`](/reference/algorithm/ranges_starts_with.md)、範囲の末尾が指定した範囲と合致するかを判定する[`std::ranges::ends_with()`](/reference/algorithm/ranges_ends_with.md)を追加 - [``](/reference/algorithm.md)に、要素を左シフトさせるRangeアルゴリズム[`std::ranges::shift_left()`](/reference/algorithm/ranges_shift_left.md)、要素を右シフトさせるRangeアルゴリズム[`std::ranges::shift_right()`](/reference/algorithm/ranges_shift_right.md)を追加 - [``](/reference/algorithm.md)に、範囲の末尾から要素を検索する以下のアルゴリズムを追加: - [`std::ranges::find_last()`](/reference/algorithm/ranges_find_last.md) From 17a8b4eaef58a42094e82be935a9632d852b7f37 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 18 Aug 2025 21:06:00 +0900 Subject: [PATCH 2297/3948] =?UTF-8?q?typo=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/locale.md | 2 +- .../ranges/filter_view/iterator/type-iterator_category.md | 2 +- .../ranges/filter_view/iterator/type-iterator_concept.md | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/locale.md b/reference/locale.md index 60b2d79658..e1f29f4a6f 100644 --- a/reference/locale.md +++ b/reference/locale.md @@ -37,7 +37,7 @@ | [`ctype_byname`](locale/ctype_byname.md) | 名前による文字の分類(class template) | | | [`codecvt_base`](locale/codecvt_base.md) | 文字コード変換のための基底クラス(class) | | | [`codecvt`](locale/codecvt.md) | 文字コード変換(class template) | | -| [`codevt_byname`](locale/codecvt_byname.md) | 名前による文字コード変換(class template) | | +| [`codecvt_byname`](locale/codecvt_byname.md) | 名前による文字コード変換(class template) | | ## 数値 diff --git a/reference/ranges/filter_view/iterator/type-iterator_category.md b/reference/ranges/filter_view/iterator/type-iterator_category.md index df036f7fda..554d47e53c 100644 --- a/reference/ranges/filter_view/iterator/type-iterator_category.md +++ b/reference/ranges/filter_view/iterator/type-iterator_category.md @@ -12,7 +12,7 @@ using iterator_category = 以下参照; // (1) C++20 ## 概要 イテレータの分類を表す型。 -このメンバ型`iterator_concept`は、`V`が[`forward_ranges`](/reference/ranges/forward_range.md)コンセプトのモデルである場合にのみ、以下のように定義される。 +このメンバ型`iterator_concept`は、`V`が[`forward_range`](/reference/ranges/forward_range.md)コンセプトのモデルである場合にのみ、以下のように定義される。 - `C = iterator_traits>::iterator_category;`であるとして、 - `C`が[`derived_from`](/reference/concepts/derived_from.md)`<`[`bidirectional_iterator_tag`](/reference/iterator/iterator_tag.md)`>`のモデルである場合、`iterator_category`は[`bidirectional_iterator_tag`](/reference/iterator/iterator_tag.md)となる diff --git a/reference/ranges/filter_view/iterator/type-iterator_concept.md b/reference/ranges/filter_view/iterator/type-iterator_concept.md index 94bba0e365..9e458f6b86 100644 --- a/reference/ranges/filter_view/iterator/type-iterator_concept.md +++ b/reference/ranges/filter_view/iterator/type-iterator_concept.md @@ -12,8 +12,8 @@ using iterator_concept = 以下参照; // (1) C++20 ## 概要 イテレータコンセプトを表す型。 -- `V`が[`bidirectional_ranges`](/reference/ranges/bidirectional_range.md)コンセプトのモデルである場合、[`bidirectional_iterator_tag`](/reference/iterator/iterator_tag.md) -- `V`が[`forward_ranges`](/reference/ranges/forward_range.md)コンセプトのモデルである場合、[`forward_iterator_tag`](/reference/iterator/iterator_tag.md) +- `V`が[`bidirectional_range`](/reference/ranges/bidirectional_range.md)コンセプトのモデルである場合、[`bidirectional_iterator_tag`](/reference/iterator/iterator_tag.md) +- `V`が[`forward_range`](/reference/ranges/forward_range.md)コンセプトのモデルである場合、[`forward_iterator_tag`](/reference/iterator/iterator_tag.md) - そうでない場合、[`input_iterator_tag`](/reference/iterator/iterator_tag.md) From 05fca6c891d56c851551790ce6511d683c5ea69a Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 18 Aug 2025 21:06:08 +0900 Subject: [PATCH 2298/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/drop_view.md | 2 +- reference/ranges/iota_view/sentinel.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/ranges/drop_view.md b/reference/ranges/drop_view.md index f16eee274d..3ff0f4ddb9 100644 --- a/reference/ranges/drop_view.md +++ b/reference/ranges/drop_view.md @@ -38,7 +38,7 @@ namespace std::ranges { - (2): `E`および`F`を式、型`T`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`<`[`decltype`](/lang/cpp11/decltype.md)`((E))>`、型`D`を[`range_difference_t`](range_difference_t.md)`<`[`decltype`](/lang/cpp11/decltype.md)`((E))>`とする。式`views::drop(E, F)`の効果は以下の通り - [`decltype`](/lang/cpp11/decltype.md)`((F))`が[`convertible_to`](/reference/concepts/convertible_to.md)``のモデルでなければ、呼び出しは不適格 - `T`が[`ranges::empty_view`](empty_view.md)の特殊化であれば、`((void) F, `[`decay-copy`](/reference/exposition-only/decay-copy.md)`(E))`と等しい。ただし、`E`と`F`の評価順序は不定順で序列化(indeterminately sequenced)される - - `T`が[`random_access_range`](random_access_range.md)および[`sized_range`](sized_range.md)のモデルであり、かつ次のいずれかの特殊化であるとき、`T(`[`ranges::begin`](begin.md)`(E) + `[`min`](/reference/algorithm/min.md)`(`[`ranges::size`](size.md)`(E), F), `[`ranges::end`](begin.md)`(E))`と等しい。ただし、`E`は1度だけ評価される + - `T`が[`random_access_range`](random_access_range.md)および[`sized_range`](sized_range.md)のモデルであり、かつ次のいずれかの特殊化であるとき、`T(`[`ranges::begin`](begin.md)`(E) + `[`min`](/reference/algorithm/min.md)`(`[`ranges::size`](size.md)`(E), F), `[`ranges::end`](end.md)`(E))`と等しい。ただし、`E`は1度だけ評価される - [`span`](/reference/span/span.md) (ただし、`T::extent == `[`dynamic_extent`](/reference/span/dynamic_extent.md)であること) - [`basic_string_view`](/reference/string_view/basic_string_view.md) - [`ranges::iota_view`](iota_view.md) diff --git a/reference/ranges/iota_view/sentinel.md b/reference/ranges/iota_view/sentinel.md index 2abb930c9c..888da36bbf 100644 --- a/reference/ranges/iota_view/sentinel.md +++ b/reference/ranges/iota_view/sentinel.md @@ -13,7 +13,7 @@ このクラスの名前は規定されておらず、振る舞いのみが規定されている。 -このクラスの型を取得したい場合、[`sentinel_t`](../iterator_t.md)を使用できる。 +このクラスの型を取得したい場合、[`sentinel_t`](../sentinel_t.md)を使用できる。 なお、[`iota_view`](../iota_view.md)の番兵型は、無限長のときは[`unreachable_sentinel_t`](/reference/iterator/unreachable_sentinel_t.md)、有限長で[`common_range`](../common_range.md)のときは[`iterator`](iterator.md)である。 From f7662fecf1d9f87d46f8d951ab533adbbc2d1958 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 18 Aug 2025 23:46:35 +0900 Subject: [PATCH 2299/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/exit_.md | 2 +- reference/linalg/conjugated_accessor/op_constructor.md | 2 +- reference/linalg/scaled_accessor/op_constructor.md | 2 +- reference/ranges/size.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/cstdlib/exit_.md b/reference/cstdlib/exit_.md index 7879a0406d..fadfed5ba8 100644 --- a/reference/cstdlib/exit_.md +++ b/reference/cstdlib/exit_.md @@ -84,7 +84,7 @@ int main() | 名前 | 説明 | |------|------| | [`exit`](exit.md) | プログラムを終了させる | -| [`quick_exit`](exit.md) | 後処理をせずに、プログラムを終了させる | +| [`quick_exit`](quick_exit.md) | 後処理をせずに、プログラムを終了させる | ## 参照 diff --git a/reference/linalg/conjugated_accessor/op_constructor.md b/reference/linalg/conjugated_accessor/op_constructor.md index 2caccac95d..eb7278d3f0 100644 --- a/reference/linalg/conjugated_accessor/op_constructor.md +++ b/reference/linalg/conjugated_accessor/op_constructor.md @@ -25,7 +25,7 @@ constexpr conjugated_accessor(const NestedAccessor& acc); // (3) ## テンプレートパラメータ制約 -- (2) : [`is_constructible_v`](/reference/type_traits/is_convertible.md)` == true` +- (2) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true` ## 効果 diff --git a/reference/linalg/scaled_accessor/op_constructor.md b/reference/linalg/scaled_accessor/op_constructor.md index 6a3ee36d45..5b18007b08 100644 --- a/reference/linalg/scaled_accessor/op_constructor.md +++ b/reference/linalg/scaled_accessor/op_constructor.md @@ -25,7 +25,7 @@ constexpr scaled_accessor(const ScalingFactor& s, const NestedAccessor& a); // ( ## テンプレートパラメータ制約 -- (2) : [`is_constructible_v`](/reference/type_traits/is_convertible.md)` == true` +- (2) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true` ## 効果 diff --git a/reference/ranges/size.md b/reference/ranges/size.md index a16584c32f..48a6eca92b 100644 --- a/reference/ranges/size.md +++ b/reference/ranges/size.md @@ -21,7 +21,7 @@ Rangeの要素数を取得する関数オブジェクト。 1. `T`が配列型であれば、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(`[`extent_v`](/reference/type_traits/extent.md)`)`に等しい(expression‑equivalent)。ただし、要素数不明の配列であれば、呼び出しは不適格。 2. [`disable_sized_range`](disable_sized_range.md)`<`[`remove_cv_t`](/reference/type_traits/remove_cv.md)`>`が`false`、かつ[`decay-copy`](/reference/exposition-only/decay-copy.md)`(t.size())`が整数型(integer-like)の有効な式であれば、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(t.size())`と等しい。 3. `T`がクラス型または列挙体であって、[`disable_sized_range`](disable_sized_range.md)`<`[`remove_cv_t`](/reference/type_traits/remove_cv.md)`>`が`false`、かつ`size`がADLで見つかり、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(size(t))`が整数型の有効な式であれば、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(size(t))`と等しい。 -4. `to-unsigned-like(`[`ranges::end`](end.md)`(t) - `[`ranges::begin`](begin.md)`(t))`が有効な式で、[`ranges::begin`](begin.md)の型`I`、[`ranges::end`](end.md)の型`S`が[`sized_sentinel_for`](/reference/iterator/disable_sized_sentinel_for.md)``と[`forward_iterator`](/reference/iterator/forward_iterator.md)のモデルであれば、`to-unsigned-like(`[`ranges::end`](end.md)`(t) - `[`ranges::begin`](begin.md)`(t))`と等しい。 +4. `to-unsigned-like(`[`ranges::end`](end.md)`(t) - `[`ranges::begin`](begin.md)`(t))`が有効な式で、[`ranges::begin`](begin.md)の型`I`、[`ranges::end`](end.md)の型`S`が[`sized_sentinel_for`](/reference/iterator/sized_sentinel_for.md)``と[`forward_iterator`](/reference/iterator/forward_iterator.md)のモデルであれば、`to-unsigned-like(`[`ranges::end`](end.md)`(t) - `[`ranges::begin`](begin.md)`(t))`と等しい。 どれにも当てはまらないとき、呼び出しは不適格。 From 58451f0502e1105db7dfde36a2baba33b41af217 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Tue, 19 Aug 2025 00:07:29 +0900 Subject: [PATCH 2300/3948] =?UTF-8?q?typo=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp17.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp17.md b/lang/cpp17.md index d2b6aeeae8..0fadd4f75e 100644 --- a/lang/cpp17.md +++ b/lang/cpp17.md @@ -323,7 +323,7 @@ C++17以降、言語の策定にship train modelというリリース体制が - [`not1()`](/reference/functional/negators.md)関数 - [`not2()`](/reference/functional/negators.md)関数 - [`unary_negate`](/reference/functional/negators.md)クラス - - [`binary_nagate`](/reference/functional/negators.md)クラス + - [`binary_negate`](/reference/functional/negators.md)クラス - 標準関数オブジェクトの`result_type`、`argument_type`、`first_argument_type`、`second_argument_type`型 - デバッグ用途にしか使用しない、[`shared_ptr`](/reference/memory/shared_ptr.md)`::`[`unique()`](/reference/memory/shared_ptr/unique.md)を非推奨化 - [`result_of`](/reference/type_traits/result_of.md)を非推奨化。代わりに[`invoke_result`](/reference/type_traits/invoke_result.md)を使用すること From 563f48fd92e3baf269dbf65178c9385319985566 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 19 Aug 2025 00:16:19 +0900 Subject: [PATCH 2301/3948] =?UTF-8?q?=E3=83=97=E3=83=A9=E3=82=A4=E3=83=9E?= =?UTF-8?q?=E3=83=AA=E3=83=AA=E3=82=B9=E3=83=88=E3=81=AE=E3=82=BD=E3=83=BC?= =?UTF-8?q?=E3=83=88=E3=81=8C=E3=81=86=E3=81=BE=E3=81=8F=E5=8B=95=E3=81=84?= =?UTF-8?q?=E3=81=A6=E3=81=AA=E3=81=8B=E3=81=A3=E3=81=9F=E3=81=AE=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflows/script/sort_global_qualify.py | 53 ++++++++++++++----- PRIMARY_OVERLOAD_SPECIALIZATION.txt | 33 ++++++------ 2 files changed, 57 insertions(+), 29 deletions(-) diff --git a/.github/workflows/script/sort_global_qualify.py b/.github/workflows/script/sort_global_qualify.py index 6ef0fa3136..39dfb40d02 100644 --- a/.github/workflows/script/sort_global_qualify.py +++ b/.github/workflows/script/sort_global_qualify.py @@ -14,7 +14,8 @@ # 1. 空行でグループを分ける # 1.1. 先頭行が`# header`で始まらないグループはコメントグループとみなし、位置を維持する # 1.2. そうではないグループは、修飾グループとみなす -# 2. 修飾グループ内では、GLOBAL_QUALIFY_LIST.txtと同様のルールでソートする +# 2. 修飾グループ内では、以下を除いてGLOBAL_QUALIFY_LIST.txtと同様のルールでソートする +# 2.1. コメントは位置を維持する from enum import Enum import functools @@ -61,12 +62,7 @@ def load_global_qualify_list() -> list[list[str]]: ls.append(group) return ls -def compare(a: str, b: str) -> int: - aa = a.startswith(" ") - bb = b.startswith(" ") - if aa != bb: - return aa - bb - +def common_compare(a: str, b: str) -> int: x = a.split("[")[0] y = b.split("[")[0] x_ns = x.split("::") @@ -86,9 +82,22 @@ def compare(a: str, b: str) -> int: return -1 else: return 1 - return 0 +def compare_global_qualify_group(a: str, b: str) -> int: + aa = a.startswith(" ") + bb = b.startswith(" ") + if aa != bb: + return aa - bb + return common_compare(a, b) + +def compare_primary_group(a: str, b: str) -> int: + aa = a.startswith("# header") + bb = b.startswith("# header") + if aa != bb: + return bb - aa + return common_compare(a, b) + def sort_global_qualify_list(): ls = load_global_qualify_list() @@ -98,7 +107,7 @@ def sort_global_qualify_list(): if group[0].startswith("#"): inner_sorted.append(group) else: - inner_sorted.append(sorted(group, key=functools.cmp_to_key(compare))) + inner_sorted.append(sorted(group, key=functools.cmp_to_key(compare_global_qualify_group))) return flatten(inner_sorted) def execute_sort_global_qualify_list(): @@ -119,7 +128,10 @@ def load_primary_list() -> list[list[str]]: group = [] continue - group.append(line) + if line.startswith(" #"): + group[-1] += "!!!" + line + else: + group.append(line) if len(group) > 0: ls.append(group) @@ -127,19 +139,34 @@ def load_primary_list() -> list[list[str]]: def sort_primary_list(): ls = load_primary_list() + for group in ls: + print(group) outer_sorted = sorted(ls, key=lambda x: (x[0].startswith("# header"), x[0])) inner_sorted = [] for group in outer_sorted: - if group[0].startswith("#"): + if not group[0].startswith("# header"): inner_sorted.append(group) else: - inner_sorted.append(sorted(group, key=get_inner_sort_key)) + inner_sorted.append(sorted(group, key=functools.cmp_to_key(compare_primary_group))) inner_sorted.append([""]) - return flatten(inner_sorted) + + comment_restored = [] + for group in inner_sorted: + new_group = [] + for line in group: + if "!!!" in line: + target, comment = line.split("!!!") + new_group.append(target) + new_group.append(comment) + else: + new_group.append(line) + comment_restored.append(new_group) + return flatten(comment_restored) def execute_sort_primary_list(): sorted_ls = sort_primary_list() + print(sorted_ls) with open('PRIMARY_OVERLOAD_SPECIALIZATION.txt', 'w', encoding='utf-8') as f: f.write("\n".join(sorted_ls)) diff --git a/PRIMARY_OVERLOAD_SPECIALIZATION.txt b/PRIMARY_OVERLOAD_SPECIALIZATION.txt index b97505760e..97d04f147d 100644 --- a/PRIMARY_OVERLOAD_SPECIALIZATION.txt +++ b/PRIMARY_OVERLOAD_SPECIALIZATION.txt @@ -16,8 +16,8 @@ # memoryでオーバーロードされている * std::atomic_compare_exchange_weak_explicit[link /reference/atomic/atomic_compare_exchange_weak_explicit.md] * std::atomic_compare_exchange_weak[link /reference/atomic/atomic_compare_exchange_weak.md] -* std::atomic_exchange[link /reference/atomic/atomic_exchange.md] * std::atomic_exchange_explicit[link /reference/atomic/atomic_exchange_explicit.md] +* std::atomic_exchange[link /reference/atomic/atomic_exchange.md] * std::atomic_is_lock_free[link /reference/atomic/atomic_is_lock_free.md] * std::atomic_load_explicit[link /reference/atomic/atomic_load_explicit.md] * std::atomic_load[link /reference/atomic/atomic_load.md] @@ -42,7 +42,8 @@ # valarrayでオーバーロードされている * std::atanh[link /reference/cmath/atanh.md] # complexでオーバーロードされている -* std::atan (valarrayとcomplexでオーバーロードされている。プライマリはcmath) +* std::atan[link /reference/cmath/atan.md] + # valarrayとcomplexでオーバーロードされている * std::ceil[link /reference/cmath/ceil.md] # chronoでオーバーロードされている * std::cosh[link /reference/cmath/cosh.md] @@ -85,10 +86,10 @@ # exceptionにもある。先に登録されたのはそちらだが、すでに機能削除されている # header -* std::formatter[link] - # いろんなところで特殊化されている。プライマリはformat * std::enable_nonlocking_formatter_optimization[link] # chronoで特殊化されている。プライマリはformat +* std::formatter[link] + # いろんなところで特殊化されている。プライマリはformat # header * operator>>[link /reference/istream/basic_istream/op_istream_free.md] @@ -111,9 +112,9 @@ # ostreamでオーバーロードされている * std::print[link /reference/print/print.md] # ostreamでオーバーロードされている +* std::vprint_nonunicode[link /reference/print/vprint_nonunicode.md] * std::vprint_unicode[link /reference/print/vprint_unicode.md] # ostreamでオーバーロードされている -* std::vprint_nonunicode[link /reference/print/vprint_nonunicode.md] # header * is_error_code_enum[link /reference/system_error/is_error_code_enum.md] @@ -124,12 +125,12 @@ # futureでオーバーロードされている # header -* std::tuple_size[link /reference/tuple/tuple_size.md] - # std::arrayとstd::complexが特殊化している -* std::tuple_element[link /reference/tuple/tuple_element.md] - # std::arrayとstd::complexが特殊化している * std::get[link /reference/tuple/tuple/get.md] # std::arrayとstd::complexとstd::variantがオーバーロードしている +* std::tuple_element[link /reference/tuple/tuple_element.md] + # std::arrayとstd::complexが特殊化している +* std::tuple_size[link /reference/tuple/tuple_size.md] + # std::arrayとstd::complexが特殊化している # header * std::basic_common_reference[link /reference/type_traits/basic_common_reference.md] @@ -142,13 +143,6 @@ * std::swap[link /reference/utility/swap.md] # header none -* operator==[link] -* operator!=[link] -* operator<=>[link] -* operator<=[link] -* operator<[link] -* operator>=[link] -* operator>[link] * std::erase_if[link] # dequeとflat_mapとflat_setとforward_listとlistとmapとsetとstringとunordered_mapとunordered_setとvectorでオーバーロードされている * std::erase[link] @@ -159,3 +153,10 @@ # flat_mapとflat_setにある * std::this_thread[link] # executionとthreadにある +* operator!=[link] +* operator<=>[link] +* operator<=[link] +* operator<[link] +* operator==[link] +* operator>=[link] +* operator>[link] From 0712ced43f1c245d85b081c3130d68999456f790 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 19 Aug 2025 13:15:52 +0900 Subject: [PATCH 2302/3948] =?UTF-8?q?C++26=E3=81=AEWorking=20Draft?= =?UTF-8?q?=E3=82=92=E6=9B=B4=E6=96=B0=20#1491?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- international-standard.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/international-standard.md b/international-standard.md index 0d0c42fe6d..88827e832f 100644 --- a/international-standard.md +++ b/international-standard.md @@ -12,7 +12,7 @@ C++ の標準規格は、他にも各国の規格化団体によって国際標 | 通称†1 | 名称 | 参照する規格案†2 | 規格案・原案 | `__cplusplus` | |:--|:--|:--|:--|:--| -| [C++26](lang/cpp26.md) (C++2c) | ISO/IEC 14882:2026 (予定) | N5008([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/n5008.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/)) | N5008 N5001 N4993 N4986 N4981 N4971 N4964 N4958 | -- | +| [C++26](lang/cpp26.md) (C++2c) | ISO/IEC 14882:2026 (予定) | N5014([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/n5014.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/)) | N5014 N5008 N5001 N4993 N4986 N4981 N4971 N4964 N4958 | -- | | [C++23](lang/cpp23.md) (C++2b) | ISO/IEC 14882:2024 | N4950([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4950.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4950/)) | N4950 N4944 N4928 N4917 N4910 N4901 N4892 N4885 N4878
N4868 N4861 | `202302L` | | [C++20](lang/cpp20.md) (C++2a) | ISO/IEC 14882:2020 | N4861†3([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/n4861.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4861/)) | N4860 N4849 N4842 N4835 N4830
N4820 N4810 N4800 N4791 N4788†4
N4778 N4762 N4750 N4741 N4727
N4713 N4700 N4687 | `202002L` | | [C++17](lang/cpp17.md) (C++1z) | ISO/IEC 14882:2017 | N4659([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4659.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4659/)) | N4660 N4659 N4640 N4618 N4606
N4594 N4582 N4567 N4527 N4431
N4296 | `201703L` | From 63c44c02a889475441bab04904d1543be52f7ce5 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Tue, 19 Aug 2025 20:48:46 +0900 Subject: [PATCH 2303/3948] =?UTF-8?q?typo=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cfloat/decimal_dig.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cfloat/decimal_dig.md b/reference/cfloat/decimal_dig.md index aa2c612393..ab376685fe 100644 --- a/reference/cfloat/decimal_dig.md +++ b/reference/cfloat/decimal_dig.md @@ -33,7 +33,7 @@ $b$ や $p$ については [``](../cfloat.md) のモデルも参照。 - `DECIMAL_DIG` は DECIMAL DIGits(decimal:10進数、digit:桁)に由来する。 - 各型毎の桁数を示すマクロも定義されている - [`DBL_DECIMAL_DIG`](dbl_decimal_dig.md) - - [`FLT_DECILAL_DIG`](flt_decimal_dig.md) + - [`FLT_DECIMAL_DIG`](flt_decimal_dig.md) - [`LDBL_DECIMAL_DIG`](ldbl_decimal_dig.md) From 715c5f996ee4be5e568e0b28bd2b5edb4a4008a7 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Tue, 19 Aug 2025 20:49:01 +0900 Subject: [PATCH 2304/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/execution/execution/into_variant.md | 4 ++-- reference/mdspan/AccessorPolicy.md | 2 +- reference/mdspan/LayoutMapping.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/execution/execution/into_variant.md b/reference/execution/execution/into_variant.md index 2e290b3ba4..193dc66b44 100644 --- a/reference/execution/execution/into_variant.md +++ b/reference/execution/execution/into_variant.md @@ -48,7 +48,7 @@ namespace std::execution { `impls-for::get-state`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 -- 子[Sender](sender.md)の[値完了シグネチャを集約](value_types_of_t.md)した[`variant`](/reference/variant/variant.md)`<`[`tuple`](/reference/variant/variant.md)`<...>, ...>`型を[`type_identity`](/reference/type_traits/type_identity.md)クラステンプレートのパラメータに格納して返す。 +- 子[Sender](sender.md)の[値完了シグネチャを集約](value_types_of_t.md)した[`variant`](/reference/variant/variant.md)`<`[`tuple`](/reference/tuple/tuple.md)`<...>, ...>`型を[`type_identity`](/reference/type_traits/type_identity.md)クラステンプレートのパラメータに格納して返す。 ```cpp [](Sndr&& sndr, Rcvr& rcvr) noexcept @@ -64,7 +64,7 @@ namespace std::execution { `impls-for::complete`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 -- `State`として渡される前述`get-state`メンバ戻り値型([`type_identity`](/reference/type_traits/type_identity.md))から、`into_varinat`の送信値となる[`variant`](/reference/variant/variant.md)`<`[`tuple`](/reference/variant/variant.md)`<...>, ...>`型情報を取り出す。 +- `State`として渡される前述`get-state`メンバ戻り値型([`type_identity`](/reference/type_traits/type_identity.md))から、`into_varinat`の送信値となる[`variant`](/reference/variant/variant.md)`<`[`tuple`](/reference/tuple/tuple.md)`<...>, ...>`型情報を取り出す。 - [値完了](set_value.md)の場合、引数パック`args...`から送信値を構築して接続先[Receiver](receiver.md)の[値完了関数](set_value.md)を呼び出す。 - [エラー完了](set_error.md)または[停止完了](set_stopped.md)の場合、接続先[Receiver](receiver.md)の同種完了関数に全引数を転送する。 diff --git a/reference/mdspan/AccessorPolicy.md b/reference/mdspan/AccessorPolicy.md index d80e24e10b..ec904bd2ac 100644 --- a/reference/mdspan/AccessorPolicy.md +++ b/reference/mdspan/AccessorPolicy.md @@ -13,7 +13,7 @@ AccessorPolicyは、多次元配列ビュー[`mdspan`](mdspan.md)を介した要 AccessorPolicyを満たす型`A`は - `A`は[`copyable`](/reference/concepts/copyable.md)のモデルであり、かつ -- [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)``は`true`であり、かつ +- [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)``は`true`であり、かつ - [`is_nothrow_move_assignable_v`](/reference/type_traits/is_nothrow_move_assignable.md)``は`true`であり、かつ - [`is_nothrow_swappable_v`](/reference/type_traits/is_nothrow_swappable.md)``は`true`であること diff --git a/reference/mdspan/LayoutMapping.md b/reference/mdspan/LayoutMapping.md index 2b4266579b..49f5ebc01b 100644 --- a/reference/mdspan/LayoutMapping.md +++ b/reference/mdspan/LayoutMapping.md @@ -52,7 +52,7 @@ std::mdspan mat3x2{a}; LayoutMappingを満たす型`M`は - `M`は[`copyable`](/reference/concepts/copyable.md)および[`equality_comparable`](/reference/concepts/equality_comparable.md)のモデルであり、かつ -- [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)``は`true`であり、かつ +- [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)``は`true`であり、かつ - [`is_nothrow_move_assignable_v`](/reference/type_traits/is_nothrow_move_assignable.md)``は`true`であり、かつ - [`is_nothrow_swappable_v`](/reference/type_traits/is_nothrow_swappable.md)``は`true`であること From eb824e26f41a1c9550beb8a84781a1a07baf886c Mon Sep 17 00:00:00 2001 From: yoh Date: Sat, 16 Aug 2025 21:31:08 +0900 Subject: [PATCH 2305/3948] =?UTF-8?q?execution:=20C++26=20P3557R3=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - dependent_senderコンセプト追加 - dependent_sender_error例外クラス追加 - get_completion_signatures仕様変更(CPO→関数テンプレート) - Senderアルゴリズム仕様定義check-typesメンバ関数追加 - 各種Senderアルゴリズム仕様定義を修正 - 他修正, ページ構成再整理 --- reference/execution/execution.md | 6 +- .../execution/execution/basic-operation.md | 6 +- reference/execution/execution/basic-sender.md | 38 +++++++---- reference/execution/execution/bulk.md | 24 +++++++ reference/execution/execution/child-type.md | 3 + .../execution/completion_signatures.md | 17 ++++- .../execution/completion_signatures_of_t.md | 11 ++-- reference/execution/execution/connect.md | 9 ++- reference/execution/execution/data-type.md | 31 +++++++++ .../execution/decay-copyable-result-datums.md | 39 +++++++++++ .../execution/execution/dependent_sender.md | 53 +++++++++++++++ .../execution/dependent_sender_error.md | 34 ++++++++++ .../execution/get_completion_signatures.md | 60 +++++++++++------ reference/execution/execution/impls-for.md | 22 +++++++ reference/execution/execution/into_variant.md | 11 ++++ reference/execution/execution/let_value.md | 32 ++++++++++ reference/execution/execution/make-sender.md | 12 +++- reference/execution/execution/not-a-sender.md | 39 +++++++++++ reference/execution/execution/on.md | 18 +----- reference/execution/execution/overload-set.md | 30 +++++++++ reference/execution/execution/read_env.md | 7 ++ .../execution/run_loop/run-loop-sender.md | 3 +- .../execution/execution/schedule_from.md | 17 +++++ reference/execution/execution/scheduler.md | 23 +------ reference/execution/execution/sender-in-of.md | 63 ++++++++++++++++++ reference/execution/execution/sender_in.md | 23 ++++--- .../execution/single-sender-value-type.md | 15 +++-- .../execution/execution/single-sender.md | 7 +- .../execution/stopped_as_optional.md | 29 ++++++++- reference/execution/execution/then.md | 22 +++++++ reference/execution/execution/when_all.md | 64 +++++++++++++------ .../execution/when_all_with_variant.md | 5 +- reference/execution/execution/write-env.md | 17 ++++- reference/execution/is-awaitable.md | 15 +++-- reference/execution/this_thread/sync_wait.md | 6 +- .../this_thread/sync_wait_with_variant.md | 10 ++- 36 files changed, 673 insertions(+), 148 deletions(-) create mode 100644 reference/execution/execution/data-type.md create mode 100644 reference/execution/execution/decay-copyable-result-datums.md create mode 100644 reference/execution/execution/dependent_sender.md create mode 100644 reference/execution/execution/dependent_sender_error.md create mode 100644 reference/execution/execution/not-a-sender.md create mode 100644 reference/execution/execution/overload-set.md create mode 100644 reference/execution/execution/sender-in-of.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index a9eda1dc8a..48a57ff2e0 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -82,9 +82,8 @@ namespace std::execution { | [`execution::default_domain`](execution/default_domain.md) | デフォルト実行ドメイン (class) | C++26 | | [`execution::sender`](execution/sender.md) | Sender型 (concept) | C++26 | | [`execution::sender_in`](execution/sender_in.md) | 指定環境で有効なSender (concept) | C++26 | +| [`execution::dependent_sender`](execution/dependent_sender.md) | 依存Sender (concept) | C++26 | | [`execution::sender_to`](execution/sender_to.md) | 指定Receiverに接続可能なSender (concept) | C++26 | -| [`execution::get_completion_signatures`](execution/get_completion_signatures.md) | Senderの完了シグネチャ集合を取得 (customization point object) | C++26 | -| [`execution::completion_signatures_of_t`](execution/completion_signatures_of_t.md) | Senderの完了シグネチャ集合を取得 (alias template) | C++26 | | [`execution::value_types_of_t`](execution/value_types_of_t.md) | Senderの値完了シグネチャ集合から指定操作で型を生成 (alias template) | C++26 | | [`execution::error_types_of_t`](execution/error_types_of_t.md) | Senderのエラー完了シグネチャ集合から指定操作で型を生成 (alias template) | C++26 | | [`execution::sends_stopped`](execution/sends_stopped.md) | Senderが停止完了を送信しうるか否か (variable template) | C++26 | @@ -142,6 +141,9 @@ Senderコンシューマは名前空間 `std::this_thread` で定義される。 | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`execution::completion_signatures`](execution/completion_signatures.md) | 完了シグネチャ集合を表現する型 (class template) | C++26 | +| [`execution::dependent_sender_error`](execution/dependent_sender_error.md) | 依存Sender例外(class) | C++26 | +| [`execution::get_completion_signatures`](execution/get_completion_signatures.md) | Senderの完了シグネチャ集合を取得 (function template) | C++26 | +| [`execution::completion_signatures_of_t`](execution/completion_signatures_of_t.md) | Senderの完了シグネチャ集合を取得 (alias template) | C++26 | | [`execution::run_loop`](execution/run_loop.md) | 単一スレッド上でのループ実行 (class) | C++26 | ### コルーチンユーティリティ diff --git a/reference/execution/execution/basic-operation.md b/reference/execution/execution/basic-operation.md index 44f7fa0834..865e8143bf 100644 --- a/reference/execution/execution/basic-operation.md +++ b/reference/execution/execution/basic-operation.md @@ -39,6 +39,7 @@ namespace std::execution { ``` * operation_state_t[link operation_state.md] * tag_of_t[link tag_of_t.md] +* indices-for[link basic-sender.md] * impls-for[link impls-for.md] * std::move[link /reference/utility/move.md] @@ -60,6 +61,7 @@ is_nothrow_constructible_v, Self, Rcvr> && noexcept(connect-all(this, std::forward(sndr), indices-for())) ``` * is_nothrow_constructible_v[link /reference/type_traits/is_nothrow_constructible.md] +* indices-for[link basic-sender.md] `basic-state`コンストラクタ`noexcept`節の式は下記の通り。 @@ -101,13 +103,11 @@ constexpr auto connect-all = see below; // exposition only template using connect-all-result = call-result-t< // exposition only decltype(connect-all), basic-state*, Sndr, indices-for>; - -template -using indices-for = remove_reference_t::indices-for; // exposition only ``` * call-result-t[link /reference/functional/call-result-t.md] * impls-for[link impls-for.md] * tag_of_t[link tag_of_t.md] +* indices-for[link basic-sender.md] 説明専用の定数`connect-all`は、下記ラムダ式と等価な関数呼び出し可能なオブジェクトとして初期化される。 diff --git a/reference/execution/execution/basic-sender.md b/reference/execution/execution/basic-sender.md index 0496601258..4ddea44f69 100644 --- a/reference/execution/execution/basic-sender.md +++ b/reference/execution/execution/basic-sender.md @@ -22,11 +22,8 @@ namespace std::execution { return {std::forward(self), std::move(rcvr)}; } - template Self, class Env> - auto get_completion_signatures(this Self&& self, Env&& env) noexcept - -> completion-signatures-for { - return {}; - } + template Self, class... Env> + static constexpr auto get_completion_signatures(); }; } ``` @@ -62,19 +59,35 @@ is_nothrow_constructible_v, Self, Rcvr> * is_nothrow_constructible_v[link /reference/type_traits/is_nothrow_constructible.md] * basic-operation[link basic-operation.md] -説明専用のエイリアステンプレート`completion-signatures-for`は、下記の通り定義される。 +### `get_completion_signatures`メンバ関数 +```cpp +template +template +constexpr auto basic-sender::get_completion_signatures(); +``` + +型`E`をリスト`Env...,` [`env<>`](env.md)における先頭の型としたとき、[環境](../queryable.md)`E`をもつ[Receiver](receiver.md)型を`Rcvr`とする。式`CHECK-TYPE()`を[`impls-for`](impls-for.md)`::template check-types()`とし、型`CS`を下記の通り定義する。 + +- `CHECK-TYPE()`がコア定数式のとき、`op`を[`connect_result_t`](connect_result_t.md)``型の左辺値とする。`CS`は[`completion_signatures`](completion_signatures.md)の特殊化となり、そのテンプレート引数の集合は評価`op.`[`start()`](start.md)の結果結果として得られる完了操作の集合に対応する。 +- そうでなければ、`CS`は[`completion_signatures<>`](completion_signatures.md)となる。 + +テンプレートパラメータ制約 : 式`CHECK-TYPES()`が適格であること。 + +効果:下記と等価。 ```cpp -template -using completion-signatures-for = see below; // exposition only +CHECK-TYPES(); +return CS(); ``` -説明用の`sndr`を`decltype((sndr))`が`Sndr`型となる式、`rcvr`を[`sender_in`](sender_in.md)` == true`となる[環境](../queryable.md)`Env`に関連付けられた[`Receiver`](receiver.md)とする。 -`completion-signatures-for`は[`completion_signatures`](completion_signatures.md)の特殊化であり、そのテンプレート引数は `sndr`と`rcvr`との[接続(connect)](connect.md)結果[Operation State](operation_state.md)を[開始(start)](start.md)して得られる可能性のある結果の完了シグネチャ集合となる。 +## 説明専用エンティティ +説明専用のエイリアステンプレート`indices-for`を下記の通り定義する。 -[`sender_in`](sender_in.md)` == false`となる場合、`completion-signatures-for`は[`completion_signatures`](completion_signatures.md)の特殊化ではない別の型となる。 - 処理系(標準ライブラリ実装者)は、この型を用いてユーザにエラー理由を通知することが推奨される。 +```cpp +template +using indices-for = remove_reference_t::indices-for; // exposition only +``` ## バージョン @@ -91,3 +104,4 @@ using completion-signatures-for = see below; // exposition only ## 参照 - [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) diff --git a/reference/execution/execution/bulk.md b/reference/execution/execution/bulk.md index 96ed1cf018..fc2f1cad1e 100644 --- a/reference/execution/execution/bulk.md +++ b/reference/execution/execution/bulk.md @@ -44,6 +44,9 @@ namespace std::execution { template<> struct impls-for : default-impls { static constexpr auto complete = see below; + + template + static consteval void check-types(); }; } ``` @@ -75,6 +78,26 @@ namespace std::execution { 型`Tag`が[`set_value_t`](set_value.md)以外の型であるとき、もしくは式`f(auto(shape), args...)`が適格なときに限って、上記ラムダ式のrequires節が満たされる。 +メンバ関数`impls-for::check-types`の効果は下記の通り。 + +```cpp +auto cs = get_completion_signatures, FWD-ENV-T(Env)...>(); +auto fn = [](set_value_t(*)(Ts...)) { + if constexpr (!invocable>, Ts&...>) + throw unspecified-exception(); +}; +cs.for-each(overload-set{fn, [](auto){}}); +``` +* get_completion_signatures[link get_completion_signatures.md] +* child-type[link child-type.md] +* FWD-ENV-T[link ../forwarding_query.md] +* set_value_t[link set_value.md] +* data-type[link data-type.md] +* for-each[link completion_signatures.md] +* overload-set[link overload-set.md] + +`unspecified-exception`は[`exception`](/reference/exception/exception.md)から派生した型となる。 + ## カスタマイゼーションポイント Senderアルゴリズム構築時および[Receiver](receiver.md)接続時に、関連付けられた実行ドメインに対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 @@ -133,3 +156,4 @@ int main() ## 参照 - [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) diff --git a/reference/execution/execution/child-type.md b/reference/execution/execution/child-type.md index 07ed69cdbe..96124dc1dd 100644 --- a/reference/execution/execution/child-type.md +++ b/reference/execution/execution/child-type.md @@ -22,7 +22,10 @@ namespace std::execution { ## 関連項目 - [`execution::schedule_from`](schedule_from.md) +- [`execution::let_value`](let_value.md) - [`execution::into_variant`](into_variant.md) +- [`execution::stopped_as_optional`](stopped_as_optional.md) +- [`write-env`](write-env.md) ## 参照 diff --git a/reference/execution/execution/completion_signatures.md b/reference/execution/execution/completion_signatures.md index 731f2795e4..36c97e73e6 100644 --- a/reference/execution/execution/completion_signatures.md +++ b/reference/execution/execution/completion_signatures.md @@ -7,21 +7,31 @@ ```cpp namespace std::execution { template - struct completion_signatures {}; + struct completion_signatures { + template + static constexpr size_t count-of(Tag) { return see below; } + + template + static constexpr void for-each(Fn&& fn) { // exposition only + (std::forward(fn)(static_cast(nullptr)), ...); + } + }; } ``` ## 概要 `completion_signatures`クラステンプレートは、完了シグネチャの集合をテンプレートパラメータとして表現する。 -実行制御ライブラリ仕様定義では、説明専用のコンセプト`valid-completion-signatures`を利用する。 +式`tag`の[decayed](/reference/type_traits/decay.md)型を`Tag`としたとき、説明専用のメンバ関数`count-of`は`Fns`中の`Tag(Ts...)`形式で表される関数型の個数を返す。 + +### 説明専用のコンセプト `valid-completion-signatures` ```cpp template concept valid-completion-signatures = see below; ``` -`Sigs`が[`completion_signatures`](completion_signatures.md)クラステンプレートの特殊化であるとき、`Sigs`は説明専用コンセプト`valid-completion-signatures`のモデルである。 +`Sigs`が`completion_signatures`クラステンプレートの特殊化であるとき、`Sigs`は説明専用コンセプト`valid-completion-signatures`のモデルである。 ## テンプレートパラメータ制約 @@ -88,3 +98,4 @@ int main() ## 参照 - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) diff --git a/reference/execution/execution/completion_signatures_of_t.md b/reference/execution/execution/completion_signatures_of_t.md index 94616cf721..e1bae93965 100644 --- a/reference/execution/execution/completion_signatures_of_t.md +++ b/reference/execution/execution/completion_signatures_of_t.md @@ -6,15 +6,13 @@ ```cpp namespace std::execution { - template> - requires sender_in - using completion_signatures_of_t = call-result-t; + template + requires sender_in + using completion_signatures_of_t = decltype(get_completion_signatures()); } ``` -* env<>[link env.md] * sender_in[link sender_in.md] -* call-result-t[link /reference/functional/call-result-t.md] -* get_completion_signatures_t[link get_completion_signatures.md] +* get_completion_signatures[link get_completion_signatures.md] ## 概要 [Sender型](sender.md)`Sndr`から[環境](../queryable.md)`Env`における[完了シグネチャ集合](completion_signatures.md)を取得する。 @@ -37,3 +35,4 @@ namespace std::execution { ## 参照 - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) diff --git a/reference/execution/execution/connect.md b/reference/execution/execution/connect.md index 484c5208c8..5d4d768077 100644 --- a/reference/execution/execution/connect.md +++ b/reference/execution/execution/connect.md @@ -23,7 +23,6 @@ namespace std::execution { ## 効果 説明用の型`Sndr`を`decltype((sndr))`、型`Rcvr`を`decltype((rcvr))`とし、式`new_sndr`を次の通りとする。 -このとき[`sender`](sender.md)` &&` [`receiver`](receiver.md)` == true`であること。 ```cpp transform_sender(decltype(get-domain-late(sndr, get_env(rcvr))){}, sndr, get_env(rcvr)) @@ -37,6 +36,11 @@ transform_sender(decltype(get-domain-late(sndr, get_env(rcvr))){}, sndr, get_env - 適格であるならば、式`new_sndr.connect(rcvr)` - そうでなければ、式`connect-awaitable(new_sndr, rcvr)` +このとき下記が全て`true`であること。 + +- [`sender_in`](sender_in.md)`>` +- [`receiver_of`](receiver_of.md)`>>` + ### Awaitable接続用へルパ 説明用のクラス`connect-awaitable-promise`, `operation-state-task`をそれぞれ下記の通り定義する。 @@ -108,7 +112,7 @@ namespace std::execution { * destroy()[link /reference/coroutine/coroutine_handle/destroy.md] * resume()[link /reference/coroutine/coroutine_handle/resume.md] -`C`型の`c`と[コルーチンPromise型](/lang/cpp20/coroutines.md)の左辺値`p`に対して、`await-result-type`を`decltype(`[`GET-AWAITER`](../is-awaitable.md)`(c, p).`[`await_resume()`](/lang/cpp20/coroutines.md)`)`型とする。 +`C`型の`c`と[コルーチンPromise型](/lang/cpp20/coroutines.md)の左辺値`p`に対して、`await-result-type`を`decltype(`[`GET-AWAITER`](../is-awaitable.md)`(c, p).`[`await_resume()`](/lang/cpp20/coroutines.md)`)`型とし、`await-result-type`を`decltype(`[`GET-AWAITER`](../is-awaitable.md)`(c).`[`await_resume()`](/lang/cpp20/coroutines.md)`)`型とする。 型`V`を`await-result-type`とする。 [完了シグネチャ集合型](completion_signatures.md)`Sigs`を下記の通り定義する。 @@ -238,4 +242,5 @@ int main() ## 参照 - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) - [P3396R1 std::execution wording fixes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3396r1.html) +- [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) - [LWG 4208. Wording needs to ensure that in `connect(sndr, rcvr)` that `rcvr` expression is only evaluated once](https://cplusplus.github.io/LWG/issue4208) diff --git a/reference/execution/execution/data-type.md b/reference/execution/execution/data-type.md new file mode 100644 index 0000000000..2c1e44abe9 --- /dev/null +++ b/reference/execution/execution/data-type.md @@ -0,0 +1,31 @@ +# data-type +* execution[meta header] +* std::execution[meta namespace] +* type-alias[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template + using data-type = decltype(declval().template get<1>()); // exposition only +} +``` +* template get[link product-type.md] + +## 概要 +[Senderアルゴリズム型](basic-sender.md)`Sndr`のデータ型を取得する説明専用のエイリアステンプレート。 + + +## バージョン +### 言語 +- C++26 + +## 関連項目 +- [`execution::read_env`](read_env.md) +- [`execution::schedule_from`](schedule_from.md) +- [`write-env`](write-env.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) diff --git a/reference/execution/execution/decay-copyable-result-datums.md b/reference/execution/execution/decay-copyable-result-datums.md new file mode 100644 index 0000000000..ab88077488 --- /dev/null +++ b/reference/execution/execution/decay-copyable-result-datums.md @@ -0,0 +1,39 @@ +# decay-copyable-result-datums +* execution[meta header] +* function template[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +constexpr void decay-copyable-result-datums(auto cs) { + cs.for-each([](Tag(*)(Ts...)) { + if constexpr (!(is_constructible_v, Ts> &&...)) + throw unspecified-exception(); + }); +} +``` +* for-each[link completion_signatures.md] + +## 概要 +`decay-copyable-result-datums`は、Senderアルゴリズム動作仕様定義で用いられる説明専用の関数テンプレートである。 + +`unspecified-exception`は[`exception`](/reference/exception/exception.md)から派生した型となる。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::schedule_from`](schedule_from.md) + + +## 参照 +- [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) diff --git a/reference/execution/execution/dependent_sender.md b/reference/execution/execution/dependent_sender.md new file mode 100644 index 0000000000..0324296f08 --- /dev/null +++ b/reference/execution/execution/dependent_sender.md @@ -0,0 +1,53 @@ +# dependent_sender +* execution[meta header] +* concept[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template + concept dependent_sender = + sender && bool_constant()>::value; +} +``` +* sender[link sender.md] +* bool_constant[link /reference/type_traits/bool_constant.md] + +## 概要 +`dependent_sender`は、[Sender型](sender.md)`Sndr`が依存Senderであることを表すコンセプトである。 + +説明用の変数テンプレート`is-dependent-sender-helper`を下記の通り定義する。 + +```cpp +template +consteval bool is-dependent-sender-helper() try { // exposition only + get_completion_signatures(); + return false; +} catch (dependent_sender_error&) { + return true; +} +``` +* get_completion_signatures[link get_completion_signatures.md] +* dependent_sender_error[link dependent_sender_error.md] + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::sender`](sender.md) +- [`execution::get_completion_signatures`](get_completion_signatures.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) diff --git a/reference/execution/execution/dependent_sender_error.md b/reference/execution/execution/dependent_sender_error.md new file mode 100644 index 0000000000..ca1b4f329e --- /dev/null +++ b/reference/execution/execution/dependent_sender_error.md @@ -0,0 +1,34 @@ +# dependent_sender_error +* execution[meta header] +* class[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct dependent_sender_error : exception {}; +} +``` +* exception[link /reference/exception/exception.md] + +## 概要 +`dependent_sender_error`は、[依存Sender](dependent_sender.md)に対する[完了シグネチャ集合取得](get_completion_signatures.md)時に送出される例外クラスである。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::dependent_sender`](dependent_sender.md) +- [`execution::get_completion_signatures`](get_completion_signatures.md) + +## 参照 +- [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) diff --git a/reference/execution/execution/get_completion_signatures.md b/reference/execution/execution/get_completion_signatures.md index 1461fb2674..5fc96a34e4 100644 --- a/reference/execution/execution/get_completion_signatures.md +++ b/reference/execution/execution/get_completion_signatures.md @@ -1,35 +1,55 @@ # get_completion_signatures * execution[meta header] -* cpo[meta id-type] +* function template[meta id-type] * std::execution[meta namespace] * cpp26[meta cpp] ```cpp namespace std::execution { - struct get_completion_signatures_t; - inline constexpr get_completion_signatures_t get_completion_signatures{}; + template + consteval auto get_completion_signatures() -> valid-completion-signatures auto; } ``` +* valid-completion-signatures[link completion_signatures.md] ## 概要 -`get_completion_signatures`は、[Sender](sender.md)の[完了シグネチャ集合](completion_signatures.md)を取得するカスタマイゼーションポイントオブジェクトである。 +`get_completion_signatures`は、[Sender](sender.md)の[完了シグネチャ集合](completion_signatures.md)を取得する関数テンプレートである。 +説明用の式`except`を、[`move_constructible`](/reference/concepts/move_constructible.md)` &&` [`derived_from`](/reference/concepts/derived_from.md)``が`true`となる未規定なクラス`Except`の右辺値とする。`e`がコア定数式かつその型が[`valid-completion-signatures`](completion_signatures.md)を満たすならば、式`CHECKED-COMPLSIGS(e)`を`e`とする。そうでなければ下記の式となる。 -## 効果 -説明用の`sndr`を`decltype((sndr))`が`Sndr`型となる式、`env`を`decltype((env))`が`Env`型となる式とする。 -式`new_sndr`を[`transform_sender`](transform_sender.md)`(decltype(`[`get-domain-late`](get-domain-late.md)`(sndr, env)){}, sndr, env)`とし、型`NewSndr`を`decltype((new_sndr))`とする。 +```cpp +(e, throw except, completion_signatures()) +``` +* completion_signatures[link completion_signatures.md] + +説明用の式`get-complsigs()`を、[`remove_reference_t`](/reference/type_traits/remove_reference.md)`::template get_completion_signatures()`と等価な式とする。 -式`get_completion_signatures(sndr, env)`は、`void(sndr)`と`void(env)`が不定順で序列化(indeterminately sequenced)されることを除いて`(void(sndr), void(env), CS())`と等価である。 +`sizeof...(Env) == 0`が`true`ならば、説明用の型`NewSndr`を`Sndr`とする。そうでなければ、下記の通り定義される式`s`を用いて`decltype(s)`とする。 + +```cpp +transform_sender( + get-domain-late(declval(), declval()...), + declval(), + declval()...) +``` +* transform_sender[link transform_sender.md] +* get-domain-late[link get-domain-late.md] -ここで、説明用の型`CS`は下記の通り定義される。 -- 型が適格であるならば、`decltype(new_sndr.get_completion_signatures(env))` -- そうではなく、型が適格であるならば[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`::completion_signatures` -- そうではなく、[`is-awaitable`](../is-awaitable.md)`> == true`ならば +## テンプレートパラメータ制約 +`sizeof...(Env) <= 1` + + +## 効果 +下記の通り定義される式`e`を用いて、`return e;`と等価。 + +- 式`get-complsigs()`が適格であるならば、`CHECKED-COMPLSIGS(get-complsigs())` +- そうではなく、式`get-complsigs()`が適格であるならば、`CHECKED-COMPLSIGS(get-complsigs())` +- そうではなく、[`is-awaitable`](../is-awaitable.md)`...> == true`ならば ```cpp completion_signatures< - SET-VALUE-SIG(await-result-type>), + SET-VALUE-SIG(await-result-type...>), set_error_t(exception_ptr), set_stopped_t()> ``` @@ -41,12 +61,9 @@ namespace std::execution { * exception_ptr[link /reference/exception/exception_ptr.md] * set_stopped_t[link set_stopped.md] -- そうでなければ、`CS`は不適格となる。 - - -## カスタマイゼーションポイント -- Sender`sndr`[変換後](transform_sender.md)の`new_sndr`に対して、`new_sndr.get_completion_signatures(env)`が返す型。 -- 変換後Senderの型`NewSndr`に対して、メンバ型`NewSndr::completion_signatures` +- そうではなく、`sizeof...(Env) == 0`ならば、`(throw dependent-sender-error(),` [`completion_signatures()`](completion_signatures.md)`)` + - 型`dependent-sender-error`は、[`dependent_sender_error`](dependent_sender_error.md)もしくは`dependent_sender_error`から曖昧さなく公開派生された未規定の型とする。 +- そうでなければ、`(throw except,` [`completion_signatures()`](completion_signatures.md)`)` 説明用の式`rcvr`を[`receiver`](receiver.md)のモデルである型`Rcvr`の右辺値、型`Sndr`を[`sender_in`](sender_in.md)`> == true`となる型とする。 `Sigs...`を[`completion_signatures_of_t`](completion_signatures_of_t.md)`>`による[`completion_signatures`](completion_signatures.md)特殊化のテンプレートパラメータと定義する。 @@ -75,7 +92,7 @@ int main() ex::sender auto sndr = ex::just(42); // 値完了シグネチャ set_value_t(int) - auto sigs = ex::get_completion_signatures(sndr, ex::env<>{}); + auto sigs = ex::get_completion_signatures(sndr); static_assert(std::same_as>); } @@ -84,7 +101,6 @@ int main() * ex::sender[link sender.md] * ex::just[link just.md] * ex::completion_signatures[link completion_signatures.md] -* ex::env<>[link env.md] * ex::set_value_t[link set_value.md] ### 出力 @@ -105,7 +121,9 @@ int main() ## 関連項目 - [`execution::sender`](sender.md) +- [`execution::dependent_sender`](dependent_sender.md) ## 参照 - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) diff --git a/reference/execution/execution/impls-for.md b/reference/execution/execution/impls-for.md index ecc998fac6..f875fb8a35 100644 --- a/reference/execution/execution/impls-for.md +++ b/reference/execution/execution/impls-for.md @@ -15,6 +15,9 @@ namespace std::execution { static constexpr auto get-state = see below; // exposition only static constexpr auto start = see below; // exposition only static constexpr auto complete = see below; // exposition only + + template + static consteval void check-types(); }; } ``` @@ -111,6 +114,24 @@ namespace std::execution { * callable[link /reference/functional/callable.md] * std::move[link /reference/utility/move.md] +### `check-types`メンバ関数 + +```cpp +template +static consteval void default-impls::check-types(); +``` + +説明用のパック`Is`を、[`indices-for`](basic-sender.md)``で導入される[`integer_sequence`](/reference/utility/integer_sequence.md)クラス特殊化の整数テンプレート引数とする。 + +効果:下記と等価。 + +```cpp +(get_completion_signatures, FWD-ENV-T(Env)...>(), ...); +``` +* get_completion_signatures[link get_completion_signatures.md] +* child-type[link child-type.md] +* FWD-ENV-T[link ../forwarding_query.md] + ## バージョン ### 言語 @@ -125,3 +146,4 @@ namespace std::execution { ## 参照 - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) diff --git a/reference/execution/execution/into_variant.md b/reference/execution/execution/into_variant.md index 193dc66b44..1ca31e9c6d 100644 --- a/reference/execution/execution/into_variant.md +++ b/reference/execution/execution/into_variant.md @@ -40,11 +40,21 @@ namespace std::execution { struct impls-for : default-impls { static constexpr auto get-state = see below; static constexpr auto complete = see below; + + template + static consteval void check-types() { + auto cs = get_completion_signatures, FWD-ENV-T(Env)...>(); + decay-copyable-result-datums(cs); + } }; } ``` * impls-for[link impls-for.md] * default-impls[link impls-for.md] +* get_completion_signatures[link get_completion_signatures.md] +* child-type[link child-type.md] +* FWD-ENV-T[link ../forwarding_query.md] +* decay-copyable-result-datums[link decay-copyable-result-datums.md] `impls-for::get-state`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 @@ -206,4 +216,5 @@ int main() ## 参照 - [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) - [LWG 4203. Constraints on `get-state` functions are incorrect](https://cplusplus.github.io/LWG/issue4203) diff --git a/reference/execution/execution/let_value.md b/reference/execution/execution/let_value.md index 90a4eb3184..7ada68818d 100644 --- a/reference/execution/execution/let_value.md +++ b/reference/execution/execution/let_value.md @@ -48,6 +48,9 @@ namespace std::execution { struct impls-for> : default-impls { static constexpr auto get-state = see below; static constexpr auto complete = see below; + + template + static consteval void check-types(); }; } ``` @@ -123,6 +126,34 @@ namespace std::execution { * std::move[link /reference/utility/move.md] * set-cpo[italic] +メンバ関数`impls-for>::check-types`の効果は下記の通り。 + +```cpp +using LetFn = remove_cvref_t>; +auto cs = get_completion_signatures, FWD-ENV-T(Env)...>(); +auto fn = [](decayed-typeof(*)(Ts...)) { + if constexpr (!is-valid-let-sender)  // see below + throw unspecified-exception(); +}; +cs.for-each(overload-set(fn, [](auto){})); +``` +* data-type[link data-type.md] +* get_completion_signatures[link get_completion_signatures.md] +* child-type[link child-type.md] +* FWD-ENV-T[link ../forwarding_query.md] +* decayed-typeof[link /reference/functional/decayed-typeof.md] +* for-each[link completion_signatures.md] +* overload-set[link overload-set.md] +* set-cpo[italic] + +`unspecified-exception`は[`exception`](/reference/exception/exception.md)から派生した型となる。 +変数`is-valid-let-sender`は下記を全て満たす時に限って`true`となる。 + +- `(`[`constructible_from`](/reference/concepts/constructible_from.md)`, Ts> &&...)` +- `invocable&...>` +- [`sender`](sender.md)`&...>>` +- パック`env-t`を`decltype(let-cpo.transform_env(declval(), declval()))`としたとき、`sizeof...(Env) == 0 ||` [`sender_in`](sender_in.md)`&...>, env-t...>` + 説明用の式`sndr`と`env`に対して、型`Sndr`を`decltype((sndr))`とする。[`sender-for`](sender-for.md)`> == false`のとき、式`let-cpo.transform_env(sndr, env)`は不適格となる。 そうでなければ、式`let-cpo.transform_env(sndr, env)`は下記と等価。 @@ -407,6 +438,7 @@ catch 0 - [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) - [P3396R1 std::execution wording fixes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3396r1.html) +- [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) - [LWG 4203. Constraints on `get-state` functions are incorrect](https://cplusplus.github.io/LWG/issue4203) - [LWG 4204. specification of `as-sndr2(Sig)` in [exec.let] is incomplete](https://cplusplus.github.io/LWG/issue4204) - [LWG 4205. `let_[*].transform_env` is specified in terms of the `let_*` sender itself instead of its child](https://cplusplus.github.io/LWG/issue4205) diff --git a/reference/execution/execution/make-sender.md b/reference/execution/execution/make-sender.md index d57037be03..d0c93010a6 100644 --- a/reference/execution/execution/make-sender.md +++ b/reference/execution/execution/make-sender.md @@ -20,9 +20,12 @@ constexpr auto make-sender(Tag tag, Data&& data, Child&&... child); ## 適格要件 -- [`semiregular`](/reference/concepts/semiregular.md)` == true` -- [`movable-value`](../movable-value.md)` == true` -- `(`[`sender`](sender.md)` && ...) == true` +下記の式が全て`true`であること。 + +- [`semiregular`](/reference/concepts/semiregular.md)`` +- [`movable-value`](../movable-value.md)`` +- `(`[`sender`](sender.md)` && ...)` +- 型`Sndr`を[`basic-sender`](basic-sender.md)``としたとき、[`dependent_sender`](dependent_sender.md)` ||` [`sender_in`](sender_in.md)`` ## 戻り値 @@ -32,6 +35,8 @@ constexpr auto make-sender(Tag tag, Data&& data, Child&&... child); ## 備考 テンプレートパラメータ`Data`のデフォルト引数は、[`semiregular`](/reference/concepts/semiregular.md)のモデルである空のトリビアルにコピー可能な未規定なクラス型。 +[`sender_in`](sender_in.md)``の評価結果が[`get_completion_signatures`](get_completion_signatures.md)`()`から送出された例外の場合、処理系(標準ライブラリ実装者)はエラーメッセージにその例外に関する情報を含めることが推奨される。 + ## バージョン ### 言語 @@ -45,3 +50,4 @@ constexpr auto make-sender(Tag tag, Data&& data, Child&&... child); ## 参照 - [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) diff --git a/reference/execution/execution/not-a-sender.md b/reference/execution/execution/not-a-sender.md new file mode 100644 index 0000000000..78020fec35 --- /dev/null +++ b/reference/execution/execution/not-a-sender.md @@ -0,0 +1,39 @@ +# not-a-sender +* execution[meta header] +* class[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +struct not-a-sender { + using sender_concept = sender_t; + + template + static consteval auto get_completion_signatures() -> completion_signatures<> { + throw unspecified-exception(); + } +}; +``` +* sender_t[link sender.md] +* get_completion_signatures[link get_completion_signatures.md] +* completion_signatures[link completion_signatures.md] + +## 概要 +`not-a-sender`は、Senderアルゴリズム動作仕様定義で用いられる説明専用のクラスである。 + +`unspecified-exception`は[`exception`](/reference/exception/exception.md)から派生した型となる。 + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`execution::on`](on.md) +- [`execution::stopped_as_optional`](stopped_as_optional.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) diff --git a/reference/execution/execution/on.md b/reference/execution/execution/on.md index 464753bafe..41061fa9f5 100644 --- a/reference/execution/execution/on.md +++ b/reference/execution/execution/on.md @@ -127,25 +127,12 @@ transform_sender( * set_value_t[link set_value.md] * get_env[link get_env.md] * query-with-default[link query-with-default.md] + * not-a-sender[link not-a-sender.md] * write-env[link write-env.md] * SCHED-ENV[link scheduler.md] * std::move[link /reference/utility/move.md] -説明専用のクラス`not-a-scheduler`を未規定な空のクラス型、`not-a-sender`を下記の通り定義する。 - -```cpp -struct not-a-sender { - using sender_concept = sender_t; - - auto get_completion_signatures(auto&&) const { - return see below; - } -}; -``` -* sender_t[link sender.md] - -メンバ関数`get_completion_signatures`は[`completion_signatures`](completion_signatures.md)クラステンプレートの特殊化とは異なる型のオブジェクトを返す。 -処理系(標準ライブラリ実装者)は、この型を用いてユーザにエラー理由を通知することが推奨される。 +説明専用のクラス`not-a-scheduler`を未規定な空のクラス型とする。 ## カスタマイゼーションポイント @@ -328,3 +315,4 @@ val=42 ## 参照 - [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) diff --git a/reference/execution/execution/overload-set.md b/reference/execution/execution/overload-set.md new file mode 100644 index 0000000000..ae04ed5bd5 --- /dev/null +++ b/reference/execution/execution/overload-set.md @@ -0,0 +1,30 @@ +# overload-set +* execution[meta header] +* class template[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +template +struct overload-set : Fns... { + using Fns::operator()...; +}; +``` + +## 概要 +`overload-set`は、Senderアルゴリズム動作仕様定義で用いられる説明専用のクラステンプレートである。 + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`execution::then`](then.md) +- [`execution::let_value`](let_value.md) +- [`execution::bulk`](bulk.md) + + +## 参照 +- [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) diff --git a/reference/execution/execution/read_env.md b/reference/execution/execution/read_env.md index dd01a8ca6e..0f8bf78263 100644 --- a/reference/execution/execution/read_env.md +++ b/reference/execution/execution/read_env.md @@ -33,6 +33,9 @@ namespace std::execution { [](auto query, auto& rcvr) noexcept -> void { TRY-SET-VALUE(rcvr, query(get_env(rcvr))); }; + + template + static consteval void check-types(); }; } ``` @@ -42,6 +45,9 @@ namespace std::execution { * TRY-SET-VALUE[link set_value.md] * get_env[link get_env.md] +型`Q`を[`decay_t`](/reference/type_traits/decay.md)`<`[`data-type`](data-type.md)`>`とする。 +`Env`型の左辺値`env`に対して式`Q()(env)`が不適格もしくは`void`型をもつとき、メンバ関数`check-types`は[`exception`](/reference/exception/exception.md)から派生した未規定の型を例外として送出する。 + ## 備考 `read_env`の[Senderアルゴリズムタグ型](tag_of_t.md)は未規定とされる。 @@ -96,3 +102,4 @@ int main() ## 参照 - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) diff --git a/reference/execution/execution/run_loop/run-loop-sender.md b/reference/execution/execution/run_loop/run-loop-sender.md index 65937e3ef8..059a36fb99 100644 --- a/reference/execution/execution/run_loop/run-loop-sender.md +++ b/reference/execution/execution/run_loop/run-loop-sender.md @@ -14,7 +14,7 @@ class run-loop-sender; // exposition only ## クラス仕様 - `run-loop-sender`型は[`sender`](../sender.md)のモデルである。 -- 任意の型`Env`に対して、[`completion_signatures_of_t`](../completion_signatures_of_t.md)``は[`completion_signatures`](../completion_signatures.md)`<`[`set_value_t`](../set_value.md)`(),` [`set_error_t`](../set_error.md)`(`[`exception_ptr`](/reference/exception/exception_ptr.md)`),` [`set_stopped_t`](../set_stopped.md)`()>` +- [`completion_signatures_of_t`](../completion_signatures_of_t.md)``は[`completion_signatures`](../completion_signatures.md)`<`[`set_value_t`](../set_value.md)`(),` [`set_error_t`](../set_error.md)`(`[`exception_ptr`](/reference/exception/exception_ptr.md)`),` [`set_stopped_t`](../set_stopped.md)`()>` - `run-loop-sender`インスタンスは、関連付けられた[`run_loop`](../run_loop.md)インスタンスの生存期間(lifetime)終了まで有効。 - 説明用の式`sndr`の型を`run-loop-sender`、`CS`が上記[`completion_signatures`](../completion_signatures.md)の特殊化であるとき[`receiver_of`](../receiver_of.md)``が`true`となる式`rcvr`としたとき、 - 式[`connect`](../connect.md)`(sndr, rcvr)`の型は[`run-loop-opstate`](run-loop-opstate.md)`<`[`decay_t`](/reference/type_traits/decay.md)`>`であり、潜在的な例外送出(potentially-throwing)は式`(void(sndr), auto(rcvr))`に従う。 @@ -34,3 +34,4 @@ class run-loop-sender; // exposition only ## 参照 - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) diff --git a/reference/execution/execution/schedule_from.md b/reference/execution/execution/schedule_from.md index 7b07f0cfe5..b76689c3f9 100644 --- a/reference/execution/execution/schedule_from.md +++ b/reference/execution/execution/schedule_from.md @@ -45,6 +45,9 @@ namespace std::execution { static constexpr auto get-attrs = see below; static constexpr auto get-state = see below; static constexpr auto complete = see below; + + template + static consteval void check-types(); }; } ``` @@ -135,6 +138,19 @@ namespace std::execution { * exception_ptr[link /reference/exception/exception_ptr.md] * current_exception()[link /reference/exception/current_exception.md] +メンバ関数`impls-for::check-types`の効果は下記の通り。 + +```cpp +get_completion_signatures>, FWD-ENV-T(Env)...>(); +auto cs = get_completion_signatures, FWD-ENV-T(Env)...>(); +decay-copyable-result-datums(cs); +``` +* get_completion_signatures[link get_completion_signatures.md] +* schedule_result_t[link schedule_result_t.md] +* data-type[link data-type.md] +* FWD-ENV-T[link ../forwarding_query.md] +* decay-copyable-result-datums[link decay-copyable-result-datums.md] + ## 説明専用エンティティ 説明専用のクラス`receiver-type`を下記の通り定義する。 @@ -211,5 +227,6 @@ Senderアルゴリズム構築時および[Receiver](receiver.md)接続時に、 - [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) - [P3396R1 std::execution wording fixes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3396r1.html) +- [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) - [LWG 4198. `schedule_from` isn't starting the schedule sender if decay-copying results throws](https://cplusplus.github.io/LWG/issue4198) - [LWG 4203. Constraints on `get-state` functions are incorrect](https://cplusplus.github.io/LWG/issue4203) diff --git a/reference/execution/execution/scheduler.md b/reference/execution/execution/scheduler.md index b7f645accc..5c0fd70dc0 100644 --- a/reference/execution/execution/scheduler.md +++ b/reference/execution/execution/scheduler.md @@ -45,28 +45,7 @@ namespace std::execution { ## モデル -説明専用のエイリアステンプレート`value-signature`, コンセプト`sender-in-of`を下記の通り定義する。 - -```cpp -namespace std::execution { - template - using value-signature = set_value_t(As...); - - template - concept sender-in-of = - sender_in && - MATCHING-SIG( - set_value_t(Values...), - value_types_of_t); -} -``` -* set_value_t[link set_value.md] -* sender_in[link sender_in.md] -* MATCHING-SIG[link get_completion_signatures.md] -* value_types_of_t[link value_types_of_t.md] -* type_identity_t[link /reference/type_traits/true_type.md] - -型`Sch`を`scheduler`の型、型`Env`を[`sender_in`](sender_in.md)`<`[`schedule_result_t`](schedule_result_t.md)`, Env>`を満たす実行環境の型としたとき、`sender-in-of<`[`schedule_result_t`](schedule_result_t.md)`, Env>`のモデルとなること。 +型`Sch`を`scheduler`の型、型`Env`を[`sender_in`](sender_in.md)`<`[`schedule_result_t`](schedule_result_t.md)`, Env>`を満たす実行環境の型としたとき、[`sender-in-of`](sender-in-of.md)`<`[`schedule_result_t`](schedule_result_t.md)`, Env>`のモデルとなること。 [`copyable`](/reference/concepts/copyable.md)`>`および[`equality_comparable`](/reference/concepts/equality_comparable.md)`>`により要求される操作は、例外で終了してはならない。 これらの操作やScheduler型の[`schedule`](schedule.md)関数は、異なるスレッドから同時に操作を呼び出す可能性がある場合でも、データ競合を引き起こしてはならない。 diff --git a/reference/execution/execution/sender-in-of.md b/reference/execution/execution/sender-in-of.md new file mode 100644 index 0000000000..c80d82c587 --- /dev/null +++ b/reference/execution/execution/sender-in-of.md @@ -0,0 +1,63 @@ +# sender-in-of +* execution[meta header] +* concept[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template + concept sender-in-of = see below; + + template + concept sender-of = see below; +} +``` + +## 概要 +`sender-in-of`および`sender-of`は、実行制御ライブラリの仕様定義で用いられる説明専用のコンセプトである。 + +説明用のエイリアステンプレート`value-signature`, コンセプト`sender-in-of-impl`, `sender-in-of`, `sender-of`を下記の通り定義する。 + +```cpp +namespace std::execution { + template + using value-signature = set_value_t(As...); // exposition only + + template + concept sender-in-of-impl = // exposition only + sender_in && + MATCHING-SIG(SetValue, + gather-signatures, + value-signature, + type_identity_t>); + + template + concept sender-in-of = // exposition only + sender-in-of-impl; + + template + concept sender-of = // exposition only + sender-in-of-impl; +} +``` +* set_value_t[link set_value.md] +* sender_in[link sender_in.md] +* MATCHING-SIG[link get_completion_signatures.md] +* gather-signatures[link gather-signatures.md] +* completion_signatures_of_t[link completion_signatures_of_t.md] +* type_identity_t[link /reference/type_traits/true_type.md] + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`execution::scheduler`](scheduler.md) + + +## 参照 +- [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) diff --git a/reference/execution/execution/sender_in.md b/reference/execution/execution/sender_in.md index e587de2344..44c57fd8f1 100644 --- a/reference/execution/execution/sender_in.md +++ b/reference/execution/execution/sender_in.md @@ -6,25 +6,28 @@ ```cpp namespace std::execution { - template> + template concept sender_in = sender && - queryable && - requires (Sndr&& sndr, Env&& env) { - { get_completion_signatures(std::forward(sndr), std::forward(env)) } - -> valid-completion-signatures; - }; + (sizeof...(Env) <= 1) && + (queryable && ...) && + is-constant()>; } ``` -* env<>[link env.md] * sender[link sender.md] * queryable[link ../queryable.md] * get_completion_signatures[link get_completion_signatures.md] -* valid-completion-signatures[link completion_signatures.md] ## 概要 `sender_in`は、[Sender型](sender.md)`Sndr`が[環境](../queryable.md)`Env`において非同期操作を作成できることを表すコンセプトである。 +説明用のコンセプト`is-constant`を下記の通り定義する。 + +```cpp +template +concept is-constant = true; // exposition only +``` + ## モデル 説明用に`sndr`を`decltype((sndr))`が`Sndr`型となる式、`rcvr`を環境`Env`に関連付けられた[Receiver](receiver.md)とする。 @@ -42,13 +45,12 @@ namespace ex = std::execution; int main() { ex::sender auto sndr = ex::just(42); - static_assert(ex::sender_in>); + static_assert(ex::sender_in); } ``` * ex::sender_in[color ff0000] * ex::sender[link sender.md] * ex::just[link just.md] -* ex::env<>[link env.md] ### 出力 ``` @@ -73,3 +75,4 @@ int main() ## 参照 - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) diff --git a/reference/execution/execution/single-sender-value-type.md b/reference/execution/execution/single-sender-value-type.md index 4dcf2637e8..bf02548815 100644 --- a/reference/execution/execution/single-sender-value-type.md +++ b/reference/execution/execution/single-sender-value-type.md @@ -5,19 +5,21 @@ * cpp26[meta cpp] ```cpp -template +template using single-sender-value-type = see below; // exposition only ``` ## 概要 `single-sender-value-type`は、実行制御ライブラリの仕様定義で用いられる説明専用のエイリアステンプレートである。 -型`Sndr`と`Env`に対して、`single-sender-value-type`は下記のエイリアスとなる。 +型`Sndr`と型パック`Env`に対して、`CS`を[`completion_signatures_of_t`](completion_signatures_of_t.md)``とする。`CS`が不適格または`sizeof...(Env) > 1`のとき、`single-sender-value-type`は不適格となる。 -- [`value_types_of_t`](value_types_of_t.md)``が適格であるならば、その型。 -- そうではなく、[`value_types_of_t`](value_types_of_t.md)``が`variant>`もしくは`variant<>`ならば、`void`型。 -- [`value_types_of_t`](value_types_of_t.md)``が適格であるならば、その型。 -- そうでなければ、`single-sender-value-type`は不適格。 +そうでなければ、`single-sender-value-type`は下記のエイリアスとなる。 + +- [`gather-signatures`](gather-signatures.md)`<`[`set_value_t`](set_value.md)`, CS,` [`decay_t`](/reference/type_traits/decay.md)`,` [`type_identity_t`](/reference/type_traits/type_identity.md)`>`が適格であるならば、その型。 +- そうではなく、[`gather-signatures`](gather-signatures.md)`<`[`set_value_t`](set_value.md)`, CS,` [`tuple`](/reference/tuple/tuple.md)`,` [`variant`](/reference/variant/variant.md)`>`が`variant>`もしくは`variant<>`ならば、`void`型。 +- そうではなく、[`gather-signatures`](gather-signatures.md)`<`[`set_value_t`](set_value.md)`, CS,` [`decayed-tuple`](decayed-tuple.md)`,` [`type_identity_t`](/reference/type_traits/type_identity.md)`>`が適格であるならば、その型。 +- そうでなければ、`single-sender-value-type`は不適格。 ## バージョン @@ -32,3 +34,4 @@ using single-sender-value-type = see below; // exposition only ## 参照 - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) diff --git a/reference/execution/execution/single-sender.md b/reference/execution/execution/single-sender.md index b1e7242886..ce983b79ee 100644 --- a/reference/execution/execution/single-sender.md +++ b/reference/execution/execution/single-sender.md @@ -5,10 +5,10 @@ * cpp26[meta cpp] ```cpp -template -concept single-sender = sender_in && +template +concept single-sender = sender_in && requires { - typename single-sender-value-type; + typename single-sender-value-type; }; ``` * sender_in[link sender_in.md] @@ -29,3 +29,4 @@ concept single-sender = sender_in && ## 参照 - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) diff --git a/reference/execution/execution/stopped_as_optional.md b/reference/execution/execution/stopped_as_optional.md index dc28ba07a4..15fc81c4dc 100644 --- a/reference/execution/execution/stopped_as_optional.md +++ b/reference/execution/execution/stopped_as_optional.md @@ -30,7 +30,33 @@ transform_sender(get-domain-early(sndr), make-sender(stopped_as_optional, {}, sn ### Senderアルゴリズムタグ `stopped_as_optional` -説明用の式`sndr`と`env`に対して、型`Sndr`を`decltype((sndr))`、型`Env`を`decltype((env))`とする。[`sender-for`](sender-for.md)` == false`、もしくは[`single-sender-value-type`](single-sender-value-type.md)`<`[`child-type`](child-type.md)`,` [`FWD-ENV-T`](../forwarding_query.md)`(Env)>`が不適格または`void`のとき、式`stopped_as_optional.transform_sender(sndr, env)`は不適格となる。 +Senderアルゴリズム動作説明用のクラステンプレート[`impls-for`](impls-for.md)に対して、下記の特殊化が定義される。 + +```cpp +namespace std::execution { + template<> + struct impls-for : default-impls { + template + static consteval void check-types() { + default-impls::check-types(); + if constexpr (!requires { + requires (!same_as, FWD-ENV-T(Env)...>>); }) + throw unspecified-exception(); + } + }; +} +``` +* impls-for[link impls-for.md] +* default-impls[link impls-for.md] +* single-sender-value-type[link single-sender-value-type.md] +* child-type[link child-type.md] +* FWD-ENV-T[link ../forwarding_query.md] + +`unspecified-exception`は[`exception`](/reference/exception/exception.md)から派生した型となる。 + +説明用の式`sndr`と`env`に対して、型`Sndr`を`decltype((sndr))`、型`Env`を`decltype((env))`とする。[`sender-for`](sender-for.md)` == false`のとき、式`stopped_as_optional.transform_sender(sndr, env)`は不適格となる。 + +そうではなく、[`sender_in`](sender_in.md)`<`[`child-type`](child-type.md)`,` [`FWD-ENV-T`](../forwarding_query.md)`(Env)> == false`のとき、式`stopped_as_optional.transform_sender(sndr, env)`は[`not-a-sender()`](not-a-sender.md)と等価。 そうでなければ、式`stopped_as_optional.transform_sender(sndr, env)`は下記と等価。 @@ -166,4 +192,5 @@ stopped ## 参照 - [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) - [LWG 4203. Constraints on `get-state` functions are incorrect](https://cplusplus.github.io/LWG/issue4203) diff --git a/reference/execution/execution/then.md b/reference/execution/execution/then.md index 3ec21dcda2..5bc0f8c380 100644 --- a/reference/execution/execution/then.md +++ b/reference/execution/execution/then.md @@ -48,6 +48,9 @@ namespace std::execution { Tag()(std::move(rcvr), std::forward(args)...); } }; + + template + static consteval void check-types(); }; } ``` @@ -59,6 +62,24 @@ namespace std::execution { * invoke[link /reference/functional/invoke.md] * std::move[link /reference/utility/move.md] +メンバ関数`impls-for>::check-types`の効果は下記の通り。 + +```cpp +auto cs = get_completion_signatures, FWD-ENV-T(Env)...>(); +auto fn = [](set_value_t(*)(Ts...)) { + if constexpr (!invocable>, Ts...>) + throw unspecified-exception(); +}; +cs.for-each(overload-set{fn, [](auto){}}); +``` +* get_completion_signatures[link get_completion_signatures.md] +* child-type[link child-type.md] +* FWD-ENV-T[link ../forwarding_query.md] +* set_value_t[link set_value.md] +* data-type[link data-type.md] + +`unspecified-exception`は[`exception`](/reference/exception/exception.md)から派生した型となる。 + ## カスタマイゼーションポイント Senderアルゴリズム構築時および[Receiver](receiver.md)接続時に、関連付けられた実行ドメインに対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 @@ -130,3 +151,4 @@ C++ ## 参照 - [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) diff --git a/reference/execution/execution/when_all.md b/reference/execution/execution/when_all.md index 47fa9b2ec4..911622cfe1 100644 --- a/reference/execution/execution/when_all.md +++ b/reference/execution/execution/when_all.md @@ -24,7 +24,7 @@ namespace std::execution { ## 効果 -説明用のパック`sndrs`に対してパック`Sndrs`を`decltype((sndrs))...`としたとき、型`CD`を[`common_type_t`](/reference/type_traits/common_type.md)``とする。 +説明用のパック`sndrs`に対してパック`Sndrs`を`decltype((sndrs))...`としたとき、型`CD`を[`common_type_t`](/reference/type_traits/common_type.md)``とする。型`CD`が適格ならば型`CD2`を`CD`とし、そうでなければ[`default_domain`](default_domain.md)とする。 下記いずれかが`true`となるとき、呼び出し式`when_all(sndrs...)`は不適格となる。 @@ -35,7 +35,7 @@ namespace std::execution { そうでなければ、呼び出し式`when_all(sndrs...)`は下記と等価。 ```cpp -transform_sender(CD(), make-sender(when_all, {}, sndrs...)) +transform_sender(CD2(), make-sender(when_all, {}, sndrs...)) ``` * transform_sender[link transform_sender.md] * make-sender[link make-sender.md] @@ -53,6 +53,9 @@ namespace std::execution { static constexpr auto get-state = see below; static constexpr auto start = see below; static constexpr auto complete = see below; + + template + static consteval void check-types(); }; } ``` @@ -79,15 +82,10 @@ namespace std::execution { ```cpp [](auto&&, State& state, const Receiver& rcvr) noexcept { - return see below; + return make-when-all-env(state.stop-src, get_env(rcvr)) } ``` - -ラムダ式は下記を満たすオブジェクト`e`を返す。 - -- `decltype(e)`が[`queryable`](../queryable.md)のモデル、かつ -- 式`e.query(`[`get_stop_token`](../get_stop_token.md)`)`が`state.stop-src.`[`get_token()`](/reference/stop_token/inplace_stop_source/get_token.md)と等価、かつ -- [`get_stop_token`](../get_stop_token.md)以外かつ[`forwarding-query`](../forwarding-query.md)を満たす[クエリオブジェクト](../queryable.md)`q`に対して、式`e.query(q)`は[`get_env`](get_env.md)`(rcvr).query(q)`と等価。 +* get_env[link get_env.md] `impls-for::get-state`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 @@ -191,17 +189,47 @@ try { * emplace[link /reference/optional/optional/emplace.md] * current_exception()[link /reference/exception/current_exception.md] +メンバ関数`impls-for::check-types`の効果は下記の通り。 +説明用のパック`Is`を、[`indices-for`](basic-sender.md)``で導入される[`integer_sequence`](/reference/utility/integer_sequence.md)クラス特殊化の整数テンプレート引数とする。 + +```cpp +auto fn = []() { + auto cs = get_completion_signatures...>(); + if constexpr (cs.count-of(set_value) >= 2) + throw unspecified-exception(); + decay-copyable-result-datums(cs); +}; +(fn.template operator()>(), ...); +``` +* get_completion_signatures[link get_completion_signatures.md] +* count-of[link completion_signatures.md] +* set_value[link set_value.md] +* decay-copyable-result-datums[link decay-copyable-result-datums.md] +* child-type[link child-type.md] + +`unspecified-exception`は[`exception`](/reference/exception/exception.md)から派生した型となる。 +型`CD`が不適格な場合、[`exception`](/reference/exception/exception.md)から派生した未規定な型を例外として送出する。 + ## 説明専用エンティティ -### コンセプト`max-1-sender-in` +### 関数テンプレート`make-when-all-env` ```cpp -template -concept max-1-sender-in = sender_in && // exposition only - (tuple_size_v> <= 1); +template +constexpr auto make-when-all-env(inplace_stop_source& stop_src, // exposition only + Env&& env) noexcept { + return see below; +} ``` -* sender_in[link sender_in.md] -* value_types_of_t[link value_types_of_t.md] -* tuple_size_v[link /reference/tuple/tuple_size.md] +* inplace_stop_source[link /reference/stop_token/inplace_stop_source.md] + +下記を満たすオブジェクト`e`を返す。 + +- `decltype(e)`が[`queryable`](../queryable.md)のモデル、かつ +- 式`e.query(`[`get_stop_token`](../get_stop_token.md)`)`が`state.stop-src.`[`get_token()`](/reference/stop_token/inplace_stop_source/get_token.md)と等価、かつ +- [`get_stop_token`](../get_stop_token.md)以外かつ[`forwarding-query`](../forwarding-query.md)を満たす[クエリオブジェクト](../queryable.md)`q`に対して、式`e.query(q)`は[`get_env`](get_env.md)`(rcvr).query(q)`と等価。 + +### エイリアステンプレート`when-all-env` +`when-all-env`は`decltype(make-when-all-env(declval<`[`inplace_stop_source`](/reference/stop_token/inplace_stop_source.md)`&>(), declval()))`となる。 ### 列挙型`disposition` ```cpp @@ -212,7 +240,7 @@ enum class disposition { started, error, stopped }; // exposition only ```cpp template struct make-state { - template)>... Sndrs> + template auto operator()(auto, auto, Sndrs&&... sndrs) const { using values_tuple = see below; using errors_variant = see below; @@ -239,7 +267,6 @@ struct make-state { } }; ``` -* FWD-ENV-T[link ../forwarding_query.md] * env_of_t[link env_of_t.md] * stop_token_of_t[link ../stop_token_of_t.md] * on-stop-request[link on-stop-request.md] @@ -479,5 +506,6 @@ error=-2 - [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) - [P3396R1 std::execution wording fixes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3396r1.html) +- [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) - [LWG 4203. Constraints on `get-state` functions are incorrect](https://cplusplus.github.io/LWG/issue4203) - [LWG 4227. Missing `noexcept` operator in [exec.when.all]](https://cplusplus.github.io/LWG/issue4227) diff --git a/reference/execution/execution/when_all_with_variant.md b/reference/execution/execution/when_all_with_variant.md index 1329f52b62..5f7fcf041d 100644 --- a/reference/execution/execution/when_all_with_variant.md +++ b/reference/execution/execution/when_all_with_variant.md @@ -24,7 +24,7 @@ namespace std::execution { ## 効果 -説明用のパック`sndrs`に対してパック`Sndrs`を`decltype((sndrs))...`としたとき、型`CD`を[`common_type_t`](/reference/type_traits/common_type.md)``とする。 +説明用のパック`sndrs`に対してパック`Sndrs`を`decltype((sndrs))...`としたとき、型`CD`を[`common_type_t`](/reference/type_traits/common_type.md)``とする。型`CD`が適格ならば型`CD2`を`CD`とし、そうでなければ[`default_domain`](default_domain.md)とする。 下記いずれかが`true`となるとき、呼び出し式`when_all_with_variant(sndrs...)`は不適格となる。 @@ -35,7 +35,7 @@ namespace std::execution { そうでなければ、呼び出し式`when_all_with_variant(sndrs...)`は下記と等価。 ```cpp -transform_sender(CD(), make-sender(when_all_with_variant, {}, sndrs...)) +transform_sender(CD2(), make-sender(when_all_with_variant, {}, sndrs...)) ``` * transform_sender[link transform_sender.md] * make-sender[link make-sender.md] @@ -184,3 +184,4 @@ int main() ## 参照 - [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) diff --git a/reference/execution/execution/write-env.md b/reference/execution/execution/write-env.md index f53008768a..14d3765b0a 100644 --- a/reference/execution/execution/write-env.md +++ b/reference/execution/execution/write-env.md @@ -30,19 +30,29 @@ Senderアルゴリズム動作説明用のクラステンプレート[`impls-for ```cpp template<> struct impls-for : default-impls { + static constexpr auto join-env(const auto& state, const auto& env) noexcept { + return see below; + } + static constexpr auto get-env = [](auto, const auto& state, const auto& rcvr) noexcept { - return see below; + return join-env(state, FWD-ENV(get_env(rcvr))); }; + + template + static consteval void check-types(); }; ``` * impls-for[link impls-for.md] * default-impls[link impls-for.md] +* FWD-ENV[link ../forwarding_query.md] +* get_env[link get_env.md] -`impls-for::get-env`メンバの呼び出しは下記を満たすオブジェクト`e`を返す。 +`impls-for::join-env`メンバの呼び出しは下記を満たすオブジェクト`e`を返す。 - 型`decltype(e)`が[`queryable`](../queryable.md)のモデルであり、かつ -- 与えられた[クエリオブジェクト](../queryable.md)`q`に対して、式`e.query(q)`は式`state.query(q)`が有効ならばその式と等価。そうでなければ、式`e.query(q)`は[`get_env`](get_env.md)`(rcvr).query(q)`と等価。 +- 与えられた[クエリオブジェクト](../queryable.md)`q`に対して、式`e.query(q)`は式`state.query(q)`が有効ならばその式と等価。そうでなければ、式`e.query(q)`は`env.query(q)`と等価。 +- 型`Sndr`と型パック`Env`に対して、型`State`を[`data-type`](data-type.md)``とし、パック`JoinEnv`を`decltype(join-env(declval(),` [`FWD-ENV`](../forwarding_query.md)`(declval())))`とする。式`impls-for::check-types()`は[`get_completion_signatures`](get_completion_signatures.md)`<`[`child-type`](child-type.md)`, JoinEnv...>()`と等価。 ## バージョン @@ -57,3 +67,4 @@ struct impls-for : default-impls { ## 参照 - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) - [P3396R1 std::execution wording fixes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3396r1.html) +- [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) diff --git a/reference/execution/is-awaitable.md b/reference/execution/is-awaitable.md index a14bb68d8a..0db175a0b2 100644 --- a/reference/execution/is-awaitable.md +++ b/reference/execution/is-awaitable.md @@ -5,7 +5,7 @@ * cpp26[meta cpp] ```cpp -template +template concept is-awaitable; ``` @@ -19,15 +19,17 @@ concept is-awaitable; - (有効ならば)Promise型の`await_transform`メンバ関数を適用 - (有効ならば)`co_await`演算子オーバーロードを適用 +`await_transform`メンバ関数を持たず[`coroutine_handle`](/reference/coroutine/coroutine_handle.md)``が`coroutine_handle`と同様に振る舞う未規定の空のクラス`none-such`の左辺値`p`を用いて、説明用の式`GET-AWAITER(c)`は`GET-AWAITER(c, p)`と等価とする。 + また、説明用のコンセプト`await-suspend-result`, `is-awaiter`を以下のように定義する。 ```cpp template concept await-suspend-result = see below; -template +template concept is-awaiter = - requires (A& a, coroutine_handle h) { + requires (A& a, coroutine_handle h) { a.await_ready() ? 1 : 0; { a.await_suspend(h) } -> await-suspend-result; a.await_resume(); @@ -44,10 +46,10 @@ concept is-awaiter = `is-awaitable`コンセプトは、以下のように定義される。 ```cpp -template +template concept is-awaitable = - requires (C (*fc)() noexcept, Promise& p) { - { GET-AWAITER(fc(), p) } -> is-awaiter; + requires (C (*fc)() noexcept, Promise&... p) { + { GET-AWAITER(fc(), p...) } -> is-awaiter; }; ``` * GET-AWAITER[italic] @@ -64,3 +66,4 @@ concept is-awaitable = ## 参照 - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) diff --git a/reference/execution/this_thread/sync_wait.md b/reference/execution/this_thread/sync_wait.md index d80039fd18..06a2b6cd39 100644 --- a/reference/execution/this_thread/sync_wait.md +++ b/reference/execution/this_thread/sync_wait.md @@ -24,9 +24,7 @@ namespace std::this_thread { ## 効果 説明用の`sndr`を`decltype((sndr))`が`Sndr`型となる式とする。 -[`sender_in`](../execution/sender_in.md)` == false`のとき、呼び出し式`this_thread::sync_wait(sndr)`は不適格となる。 - -そうでなければ、呼び出し式`this_thread::sync_wait(sndr)`は`sndr`が1回だけ評価されることを除いて、下記と等価。 +呼び出し式`this_thread::sync_wait(sndr)`は`sndr`が1回だけ評価されることを除いて、下記と等価。 ```cpp apply_sender(get-domain-early(sndr), sync_wait, sndr) @@ -34,6 +32,7 @@ apply_sender(get-domain-early(sndr), sync_wait, sndr) * apply_sender[link ../execution/apply_sender.md] * get-domain-early[link ../execution/get-domain-early.md] +- [`sender_in`](../execution/sender_in.md)` == true`であること。 - 型`sync-wait-result-type`が適格であること。 - 上記の`apply_sender`式を`e`としたとき、[`same_as`](/reference/concepts/same_as.md)`> == true`であること。 @@ -145,3 +144,4 @@ result=(100, X) ## 参照 - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) diff --git a/reference/execution/this_thread/sync_wait_with_variant.md b/reference/execution/this_thread/sync_wait_with_variant.md index d23cf60182..d67ec43217 100644 --- a/reference/execution/this_thread/sync_wait_with_variant.md +++ b/reference/execution/this_thread/sync_wait_with_variant.md @@ -25,9 +25,7 @@ namespace std::this_thread { ## 効果 説明用の`sndr`を`decltype(`[`into_variant`](../execution/into_variant.md)`(sndr))`が`Sndr`型となる式とする。 -[`sender_in`](../execution/sender_in.md)` == false`のとき、呼び出し式`this_thread::sync_wait_with_variant(sndr)`は不適格となる。 - -そうでなければ、呼び出し式`this_thread::sync_wait_with_variant(sndr)`は`sndr`が1回だけ評価されることを除いて、下記と等価。 +呼び出し式`this_thread::sync_wait_with_variant(sndr)`は`sndr`が1回だけ評価されることを除いて、下記と等価。 ```cpp apply_sender(get-domain-early(sndr), sync_wait_with_variant, sndr) @@ -35,6 +33,7 @@ apply_sender(get-domain-early(sndr), sync_wait_with_variant, sndr) * apply_sender[link ../execution/apply_sender.md] * get-domain-early[link ../execution/get-domain-early.md] +- [`sender_in`](../execution/sender_in.md)` == true`であること。 - 型`sync-wait-with-variant-result-type`が適格であること。 - 上記の`apply_sender`式を`e`としたとき、[`same_as`](/reference/concepts/same_as.md)`> == true`であること。 @@ -58,9 +57,7 @@ namespace std::this_thread { ### Senderアルゴリズムタグ `sync_wait_with_variant` 説明用の`sndr`を`decltype(`[`into_variant`](../execution/into_variant.md)`(sndr))`が`Sndr`型となる式とする。 -[`callable`](/reference/functional/callable.md)`<`[`sync_wait_t`](sync_wait.md)`, Sndr> == false`のとき、式`sync_wait_with_variant.apply_sender(sndr)`は不適格となる。 - -そうでなければ、式`sync_wait_with_variant.apply_sender(sndr)`は下記と等価。 +式`sync_wait_with_variant.apply_sender(sndr)`は下記と等価。 ```cpp using result_type = sync-wait-with-variant-result-type; @@ -138,3 +135,4 @@ result=(100, 'X') ## 参照 - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) From 157a932f88b6387f24817b254ecfdd41b9273622 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 19 Aug 2025 20:31:32 +0900 Subject: [PATCH 2306/3948] =?UTF-8?q?execution/then,upon=5F{error,stopped}?= =?UTF-8?q?:=20=E5=8A=B9=E6=9E=9C=E8=AA=AC=E6=98=8E=E3=82=92then=E3=81=AB?= =?UTF-8?q?=E7=B5=B1=E5=90=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit メンテナンスコスト軽減のためC++26 WD仕様記述の構造に揃える。 --- reference/execution/execution/let_value.md | 2 +- reference/execution/execution/then.md | 29 +++++++---- reference/execution/execution/upon_error.md | 51 +----------------- reference/execution/execution/upon_stopped.md | 52 +------------------ 4 files changed, 21 insertions(+), 113 deletions(-) diff --git a/reference/execution/execution/let_value.md b/reference/execution/execution/let_value.md index 7ada68818d..823c2ef780 100644 --- a/reference/execution/execution/let_value.md +++ b/reference/execution/execution/let_value.md @@ -17,7 +17,7 @@ namespace std::execution { `let_value`は[パイプ可能Senderアダプタオブジェクト](sender_adaptor_closure.md)であり、パイプライン記法をサポートする。 -本ページにてSenderアルゴリズム`let_value`/[`let_error`](let_error.md)/[`let_stopped`](let_stopped.md)の動作仕様を包括的に説明するため、以降のセクションにおいては、`let-cpo`, `set-cpo`をそれぞれ下記の通りとする。 +本ページにてSenderアルゴリズム`let_value`/[`let_error`](let_error.md)/[`let_stopped`](let_stopped.md)の動作仕様を包括的に説明するため、以降のセクションにおいては`let-cpo`, `set-cpo`をそれぞれ下記の通りとする。 | `let-cpo` | `set-cpo` | |----|----| diff --git a/reference/execution/execution/then.md b/reference/execution/execution/then.md index 5bc0f8c380..b5590646ff 100644 --- a/reference/execution/execution/then.md +++ b/reference/execution/execution/then.md @@ -17,31 +17,39 @@ namespace std::execution { `then`は[パイプ可能Senderアダプタオブジェクト](sender_adaptor_closure.md)であり、パイプライン記法をサポートする。 +本ページにてSenderアルゴリズム`then`/[`upon_error`](upon_error.md)/[`upon_stopped`](upon_stopped.md)の動作仕様を包括的に説明するため、以降のセクションにおいては`then-cpo`, `set-cpo`をそれぞれ下記の通りとする。 + +| `then-cpo` | `set-cpo` | +|----|----| +| `then` | [`set_value`](set_value.md) | +| [`upon_error`](upon_error.md) | [`set_error`](set_error.md) | +| [`upon_stopped`](upon_stopped.md) | [`set_stopped`](set_stopped.md) | + ## 効果 -説明用の式`sndr`と`f`に対して、`decltype((sndr))`が[`sender`](sender.md)を満たさない、もしくは`decltype((f))`が[`movable-value`](../movable-value.md)を満たさないとき、呼び出し式`then(sndr, f)`は不適格となる。 +説明用の式`sndr`と`f`に対して、`decltype((sndr))`が[`sender`](sender.md)を満たさない、もしくは`decltype((f))`が[`movable-value`](../movable-value.md)を満たさないとき、呼び出し式`then-cpo(sndr, f)`は不適格となる。 -そうでなければ、呼び出し式`then(sndr, f)`は`sndr`が1回だけ評価されることを除いて、下記と等価。 +そうでなければ、呼び出し式`then-cpo(sndr, f)`は`sndr`が1回だけ評価されることを除いて、下記と等価。 ```cpp -transform_sender(get-domain-early(sndr), make-sender(then, f, sndr)) +transform_sender(get-domain-early(sndr), make-sender(then-cpo, f, sndr)) ``` * transform_sender[link transform_sender.md] * get-domain-early[link get-domain-early.md] * make-sender[link make-sender.md] -### Senderアルゴリズムタグ `then` +### Senderアルゴリズムタグ `then-cpo` Senderアルゴリズム動作説明用のクラステンプレート[`impls-for`](impls-for.md)に対して、下記の特殊化が定義される。 ```cpp namespace std::execution { template<> - struct impls-for> : default-impls { + struct impls-for> : default-impls { static constexpr auto complete = [] (auto, auto& fn, auto& rcvr, Tag, Args&&... args) noexcept -> void { - if constexpr (same_as>) { + if constexpr (same_as>) { TRY-SET-VALUE(rcvr, invoke(std::move(fn), std::forward(args)...)); } else { @@ -57,12 +65,11 @@ namespace std::execution { * decayed-typeof[link /reference/functional/decayed-typeof.md] * impls-for[link impls-for.md] * default-impls[link impls-for.md] -* set_value[link set_value.md] * TRY-SET-VALUE[link set_value.md] * invoke[link /reference/functional/invoke.md] * std::move[link /reference/utility/move.md] -メンバ関数`impls-for>::check-types`の効果は下記の通り。 +メンバ関数`impls-for>::check-types`の効果は下記の通り。 ```cpp auto cs = get_completion_signatures, FWD-ENV-T(Env)...>(); @@ -85,10 +92,10 @@ cs.for-each(overload-set{fn, [](auto){}}); Senderアルゴリズム構築時および[Receiver](receiver.md)接続時に、関連付けられた実行ドメインに対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 [デフォルト実行ドメイン](default_domain.md)では無変換。 -戻り値の[Sender](sender.md)`out_sndr`が下記を満たさない場合、呼び出し式`then(sndr, f)`の動作は未定義となる。 +戻り値の[Sender](sender.md)`out_sndr`が下記を満たさない場合、呼び出し式`then-cpo(sndr, f)`の動作は未定義となる。 -- `then`に対する`sndr`の値結果データで`f`またはそのコピーを呼び出し、`out_sndr`の値完了として`f`の結果値を用いること。 -- 他の完了操作では変更なしに転送すること。 +- `then-cpo`に対する`sndr`の`set-cpo`結果データで`f`またはそのコピーを呼び出し、`out_sndr`の値完了として`f`の結果値を用いること。 +- 上記以外の完了操作では変更なしに転送すること。 ## 例 diff --git a/reference/execution/execution/upon_error.md b/reference/execution/execution/upon_error.md index 0dce0ce7ed..7303d018e8 100644 --- a/reference/execution/execution/upon_error.md +++ b/reference/execution/execution/upon_error.md @@ -18,56 +18,7 @@ namespace std::execution { `upon_error`は[パイプ可能Senderアダプタオブジェクト](sender_adaptor_closure.md)であり、パイプライン記法をサポートする。 -## 効果 -説明用の式`sndr`と`f`に対して、`decltype((sndr))`が[`sender`](sender.md)を満たさない、もしくは`decltype((f))`が[`movable-value`](../movable-value.md)を満たさないとき、呼び出し式`upon_error(sndr, f)`は不適格となる。 - -そうでなければ、呼び出し式`upon_error(sndr, f)`は`sndr`が1回だけ評価されることを除いて、下記と等価。 - -```cpp -transform_sender(get-domain-early(sndr), make-sender(upon_error, f, sndr)) -``` -* transform_sender[link transform_sender.md] -* get-domain-early[link get-domain-early.md] -* make-sender[link make-sender.md] - - -### Senderアルゴリズムタグ `upon_error` -Senderアルゴリズム動作説明用のクラステンプレート[`impls-for`](impls-for.md)に対して、下記の特殊化が定義される。 - -```cpp -namespace std::execution { - template<> - struct impls-for> : default-impls { - static constexpr auto complete = - [] - (auto, auto& fn, auto& rcvr, Tag, Args&&... args) noexcept -> void { - if constexpr (same_as>) { - TRY-SET-VALUE(rcvr, - invoke(std::move(fn), std::forward(args)...)); - } else { - Tag()(std::move(rcvr), std::forward(args)...); - } - }; - }; -} -``` -* decayed-typeof[link /reference/functional/decayed-typeof.md] -* impls-for[link impls-for.md] -* default-impls[link impls-for.md] -* set_error[link set_error.md] -* TRY-SET-VALUE[link set_value.md] -* invoke[link /reference/functional/invoke.md] -* std::move[link /reference/utility/move.md] - - -## カスタマイゼーションポイント -Senderアルゴリズム構築時および[Receiver](receiver.md)接続時に、関連付けられた実行ドメインに対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 -[デフォルト実行ドメイン](default_domain.md)では無変換。 - -戻り値の[Sender](sender.md)`out_sndr`が下記を満たさない場合、呼び出し式`upon_error(sndr, f)`の動作は未定義となる。 - -- `upon_error`に対する`sndr`のエラー結果データで`f`またはそのコピーを呼び出し、`out_sndr`の値完了として`f`の結果値を用いること。 -- 他の完了操作では変更なしに転送すること。 +Senderアルゴリズム`upon_error`の仕様は、[`then`](then.md)ページを参照のこと。 ## 例 diff --git a/reference/execution/execution/upon_stopped.md b/reference/execution/execution/upon_stopped.md index 6e2a712f06..2dc21cde41 100644 --- a/reference/execution/execution/upon_stopped.md +++ b/reference/execution/execution/upon_stopped.md @@ -17,57 +17,7 @@ namespace std::execution { `upon_stopped`は[パイプ可能Senderアダプタオブジェクト](sender_adaptor_closure.md)であり、パイプライン記法をサポートする。 - -## 効果 -説明用の式`sndr`と`f`に対して、`decltype((sndr))`が[`sender`](sender.md)を満たさない、もしくは`decltype((f))`が[`movable-value`](../movable-value.md)を満たさないとき、呼び出し式`upon_stopped(sndr, f)`は不適格となる。 - -そうでなければ、呼び出し式`upon_stopped(sndr, f)`は`sndr`が1回だけ評価されることを除いて、下記と等価。 - -```cpp -transform_sender(get-domain-early(sndr), make-sender(upon_stopped, f, sndr)) -``` -* transform_sender[link transform_sender.md] -* get-domain-early[link get-domain-early.md] -* make-sender[link make-sender.md] - - -### Senderアルゴリズムタグ `upon_stopped` -Senderアルゴリズム動作説明用のクラステンプレート[`impls-for`](impls-for.md)に対して、下記の特殊化が定義される。 - -```cpp -namespace std::execution { - template<> - struct impls-for> : default-impls { - static constexpr auto complete = - [] - (auto, auto& fn, auto& rcvr, Tag, Args&&... args) noexcept -> void { - if constexpr (same_as>) { - TRY-SET-VALUE(rcvr, - invoke(std::move(fn), std::forward(args)...)); - } else { - Tag()(std::move(rcvr), std::forward(args)...); - } - }; - }; -} -``` -* decayed-typeof[link /reference/functional/decayed-typeof.md] -* impls-for[link impls-for.md] -* default-impls[link impls-for.md] -* set_stopped[link set_stopped.md] -* TRY-SET-VALUE[link set_value.md] -* invoke[link /reference/functional/invoke.md] -* std::move[link /reference/utility/move.md] - - -## カスタマイゼーションポイント -Senderアルゴリズム構築時および[Receiver](receiver.md)接続時に、関連付けられた実行ドメインに対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 -[デフォルト実行ドメイン](default_domain.md)では無変換。 - -戻り値の[Sender](sender.md)`out_sndr`が下記を満たさない場合、呼び出し式`upon_stopped(sndr, f)`の動作は未定義となる。 - -- `upon_stopped`に対する`sndr`の停止結果データで`f`またはそのコピーを呼び出し、`out_sndr`の値完了として`f`の結果値を用いること。 -- 他の完了操作では変更なしに転送すること。 +Senderアルゴリズム`upon_stopped`の仕様は、[`then`](then.md)ページを参照のこと。 ## 例 From 2121599ff8b2fb00a5ef1029f3d4bd257cec757e Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 20 Aug 2025 18:30:57 +0900 Subject: [PATCH 2307/3948] =?UTF-8?q?execution:=20C++26=20P3557R3=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C(cont.)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 非依存Senderの定義説明 - 仕様記述誤り修正 - 内部リンク付与 --- reference/execution/execution.md | 2 +- reference/execution/execution/basic-sender.md | 1 + .../execution/completion_signatures.md | 2 +- reference/execution/execution/data-type.md | 3 +++ .../execution/decay-copyable-result-datums.md | 3 +++ .../execution/execution/dependent_sender.md | 2 +- .../execution/dependent_sender_error.md | 3 ++- .../execution/get_completion_signatures.md | 19 ++++++++++++------- reference/execution/execution/let_value.md | 8 ++++---- .../execution/run_loop/get_scheduler.md | 6 +++--- reference/execution/execution/sender-in-of.md | 2 +- reference/execution/execution/then.md | 4 ++++ reference/execution/execution/when_all.md | 3 +-- .../execution/when_all_with_variant.md | 3 +-- 14 files changed, 38 insertions(+), 23 deletions(-) diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 48a57ff2e0..fed87792a7 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -141,7 +141,7 @@ Senderコンシューマは名前空間 `std::this_thread` で定義される。 | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`execution::completion_signatures`](execution/completion_signatures.md) | 完了シグネチャ集合を表現する型 (class template) | C++26 | -| [`execution::dependent_sender_error`](execution/dependent_sender_error.md) | 依存Sender例外(class) | C++26 | +| [`execution::dependent_sender_error`](execution/dependent_sender_error.md) | 依存Senderを表す例外クラス(class) | C++26 | | [`execution::get_completion_signatures`](execution/get_completion_signatures.md) | Senderの完了シグネチャ集合を取得 (function template) | C++26 | | [`execution::completion_signatures_of_t`](execution/completion_signatures_of_t.md) | Senderの完了シグネチャ集合を取得 (alias template) | C++26 | | [`execution::run_loop`](execution/run_loop.md) | 単一スレッド上でのループ実行 (class) | C++26 | diff --git a/reference/execution/execution/basic-sender.md b/reference/execution/execution/basic-sender.md index 4ddea44f69..fdc4fba0c1 100644 --- a/reference/execution/execution/basic-sender.md +++ b/reference/execution/execution/basic-sender.md @@ -97,6 +97,7 @@ using indices-for = remove_reference_t::indices-for; // exposition only ## 関連項目 - [`make-sender`](make-sender.md) +- [`impls-for`](impls-for.md) - [`basic-operation`](basic-operation.md) - [`execution::sender`](sender.md) diff --git a/reference/execution/execution/completion_signatures.md b/reference/execution/execution/completion_signatures.md index 36c97e73e6..3340499dd4 100644 --- a/reference/execution/execution/completion_signatures.md +++ b/reference/execution/execution/completion_signatures.md @@ -90,7 +90,7 @@ int main() ## 関連項目 -- [`execution::receiver`](receiver.md) +- [`execution::get_completion_signatures`](get_completion_signatures.md) - [`execution::set_value_t`](set_value.md) - [`execution::set_error_t`](set_error.md) - [`execution::set_stopped_t`](set_stopped.md) diff --git a/reference/execution/execution/data-type.md b/reference/execution/execution/data-type.md index 2c1e44abe9..1c88b695ad 100644 --- a/reference/execution/execution/data-type.md +++ b/reference/execution/execution/data-type.md @@ -23,6 +23,9 @@ namespace std::execution { ## 関連項目 - [`execution::read_env`](read_env.md) - [`execution::schedule_from`](schedule_from.md) +- [`execution::then`](then.md) +- [`execution::let_value`](let_value.md) +- [`execution::bulk`](bulk.md) - [`write-env`](write-env.md) diff --git a/reference/execution/execution/decay-copyable-result-datums.md b/reference/execution/execution/decay-copyable-result-datums.md index ab88077488..56d244f5f0 100644 --- a/reference/execution/execution/decay-copyable-result-datums.md +++ b/reference/execution/execution/decay-copyable-result-datums.md @@ -13,6 +13,7 @@ constexpr void decay-copyable-result-datums(auto cs) { } ``` * for-each[link completion_signatures.md] +* is_constructible_v[link /reference/type_traits/is_constructible.md] ## 概要 `decay-copyable-result-datums`は、Senderアルゴリズム動作仕様定義で用いられる説明専用の関数テンプレートである。 @@ -33,6 +34,8 @@ constexpr void decay-copyable-result-datums(auto cs) { ## 関連項目 - [`execution::schedule_from`](schedule_from.md) +- [`execution::when_all`](when_all.md) +- [`execution::into_variant`](into_variant.md) ## 参照 diff --git a/reference/execution/execution/dependent_sender.md b/reference/execution/execution/dependent_sender.md index 0324296f08..d1c0d04333 100644 --- a/reference/execution/execution/dependent_sender.md +++ b/reference/execution/execution/dependent_sender.md @@ -15,7 +15,7 @@ namespace std::execution { * bool_constant[link /reference/type_traits/bool_constant.md] ## 概要 -`dependent_sender`は、[Sender型](sender.md)`Sndr`が依存Senderであることを表すコンセプトである。 +`dependent_sender`は、[Sender型](sender.md)`Sndr`が[非依存Sender](get_completion_signatures.md)か否かを判定するコンセプトである。 説明用の変数テンプレート`is-dependent-sender-helper`を下記の通り定義する。 diff --git a/reference/execution/execution/dependent_sender_error.md b/reference/execution/execution/dependent_sender_error.md index ca1b4f329e..619ec920db 100644 --- a/reference/execution/execution/dependent_sender_error.md +++ b/reference/execution/execution/dependent_sender_error.md @@ -12,7 +12,7 @@ namespace std::execution { * exception[link /reference/exception/exception.md] ## 概要 -`dependent_sender_error`は、[依存Sender](dependent_sender.md)に対する[完了シグネチャ集合取得](get_completion_signatures.md)時に送出される例外クラスである。 +`dependent_sender_error`は、[依存Sender](dependent_sender.md)に対して[環境](../queryable.md)を指定せずに[完了シグネチャ集合取得](get_completion_signatures.md)を行った際に送出される例外クラスである。 ## バージョン @@ -30,5 +30,6 @@ namespace std::execution { - [`execution::dependent_sender`](dependent_sender.md) - [`execution::get_completion_signatures`](get_completion_signatures.md) + ## 参照 - [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) diff --git a/reference/execution/execution/get_completion_signatures.md b/reference/execution/execution/get_completion_signatures.md index 5fc96a34e4..9f68387ecf 100644 --- a/reference/execution/execution/get_completion_signatures.md +++ b/reference/execution/execution/get_completion_signatures.md @@ -15,6 +15,17 @@ namespace std::execution { ## 概要 `get_completion_signatures`は、[Sender](sender.md)の[完了シグネチャ集合](completion_signatures.md)を取得する関数テンプレートである。 +### 非依存Sender +[環境](../queryable.md)に依存することなく完了シグネチャ集合が決定するSenderは、非依存Sender(non-dependent sender)と呼ばれる。 + +型`Sndr`に対して[`sender`](sender.md)` == true`かつ[`dependent_sender`](dependent_sender.md)` == false`の場合、`Sndr`は非依存Senderである。 + + +## テンプレートパラメータ制約 +`sizeof...(Env) <= 1` + + +## 効果 説明用の式`except`を、[`move_constructible`](/reference/concepts/move_constructible.md)` &&` [`derived_from`](/reference/concepts/derived_from.md)``が`true`となる未規定なクラス`Except`の右辺値とする。`e`がコア定数式かつその型が[`valid-completion-signatures`](completion_signatures.md)を満たすならば、式`CHECKED-COMPLSIGS(e)`を`e`とする。そうでなければ下記の式となる。 ```cpp @@ -35,12 +46,6 @@ transform_sender( * transform_sender[link transform_sender.md] * get-domain-late[link get-domain-late.md] - -## テンプレートパラメータ制約 -`sizeof...(Env) <= 1` - - -## 効果 下記の通り定義される式`e`を用いて、`return e;`と等価。 - 式`get-complsigs()`が適格であるならば、`CHECKED-COMPLSIGS(get-complsigs())` @@ -92,7 +97,7 @@ int main() ex::sender auto sndr = ex::just(42); // 値完了シグネチャ set_value_t(int) - auto sigs = ex::get_completion_signatures(sndr); + auto sigs = ex::get_completion_signatures(); static_assert(std::same_as>); } diff --git a/reference/execution/execution/let_value.md b/reference/execution/execution/let_value.md index 823c2ef780..a92609bdc8 100644 --- a/reference/execution/execution/let_value.md +++ b/reference/execution/execution/let_value.md @@ -147,12 +147,12 @@ cs.for-each(overload-set(fn, [](auto){})); * set-cpo[italic] `unspecified-exception`は[`exception`](/reference/exception/exception.md)から派生した型となる。 -変数`is-valid-let-sender`は下記を全て満たす時に限って`true`となる。 +説明用の変数`is-valid-let-sender`は下記を全て満たす時に限って`true`となる。 - `(`[`constructible_from`](/reference/concepts/constructible_from.md)`, Ts> &&...)` -- `invocable&...>` -- [`sender`](sender.md)`&...>>` -- パック`env-t`を`decltype(let-cpo.transform_env(declval(), declval()))`としたとき、`sizeof...(Env) == 0 ||` [`sender_in`](sender_in.md)`&...>, env-t...>` +- [`invocable`](/reference/concepts/invocable.md)`&...>` +- [`sender`](sender.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`&...>>` +- パック`env-t`を`decltype(let-cpo.transform_env(declval(), declval()))`としたとき、`sizeof...(Env) == 0 ||` [`sender_in`](sender_in.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`&...>, env-t...>` 説明用の式`sndr`と`env`に対して、型`Sndr`を`decltype((sndr))`とする。[`sender-for`](sender-for.md)`> == false`のとき、式`let-cpo.transform_env(sndr, env)`は不適格となる。 diff --git a/reference/execution/execution/run_loop/get_scheduler.md b/reference/execution/execution/run_loop/get_scheduler.md index 17a4ca094f..cf45a16483 100644 --- a/reference/execution/execution/run_loop/get_scheduler.md +++ b/reference/execution/execution/run_loop/get_scheduler.md @@ -34,8 +34,8 @@ int main() ex::sender auto sndr = ex::schedule(sch); // スケジュールSenderの完了シグネチャ集合を確認 - auto sigs = ex::get_completion_signatures(sndr); - static_assert(std::same_as; + static_assert(std::same_as>); @@ -50,7 +50,7 @@ int main() * ex::scheduler[link ../scheduler.md] * ex::sender[link ../sender.md] * ex::schedule[link ../schedule.md] -* ex::get_completion_signatures[link ../get_completion_signatures.md] +* ex::completion_signatures_of_t[link ../completion_signatures_of_t.md] * ex::completion_signatures[link ../completion_signatures.md] * ex::set_value_t[link ../set_value.md] * ex::set_error_t[link ../set_error.md] diff --git a/reference/execution/execution/sender-in-of.md b/reference/execution/execution/sender-in-of.md index c80d82c587..50fbb1affa 100644 --- a/reference/execution/execution/sender-in-of.md +++ b/reference/execution/execution/sender-in-of.md @@ -26,7 +26,7 @@ namespace std::execution { template concept sender-in-of-impl = // exposition only - sender_in && + sender_in && MATCHING-SIG(SetValue, gather-signatures, diff --git a/reference/execution/execution/then.md b/reference/execution/execution/then.md index b5590646ff..9d2ed1c674 100644 --- a/reference/execution/execution/then.md +++ b/reference/execution/execution/then.md @@ -68,6 +68,8 @@ namespace std::execution { * TRY-SET-VALUE[link set_value.md] * invoke[link /reference/functional/invoke.md] * std::move[link /reference/utility/move.md] +* then-cpo[italic] +* set-cpo[italic] メンバ関数`impls-for>::check-types`の効果は下記の通り。 @@ -84,6 +86,8 @@ cs.for-each(overload-set{fn, [](auto){}}); * FWD-ENV-T[link ../forwarding_query.md] * set_value_t[link set_value.md] * data-type[link data-type.md] +* for-each[link completion_signatures.md] +* overload-set[link overload-set.md] `unspecified-exception`は[`exception`](/reference/exception/exception.md)から派生した型となる。 diff --git a/reference/execution/execution/when_all.md b/reference/execution/execution/when_all.md index 911622cfe1..5cc7c708c6 100644 --- a/reference/execution/execution/when_all.md +++ b/reference/execution/execution/when_all.md @@ -29,8 +29,7 @@ namespace std::execution { 下記いずれかが`true`となるとき、呼び出し式`when_all(sndrs...)`は不適格となる。 - `sizeof...(sndrs) == 0`、または -- `(`[`sender`](sender.md)` && ...) == false`、または -- 型`CD`が不適格 +- `(`[`sender`](sender.md)` && ...) == false` そうでなければ、呼び出し式`when_all(sndrs...)`は下記と等価。 diff --git a/reference/execution/execution/when_all_with_variant.md b/reference/execution/execution/when_all_with_variant.md index 5f7fcf041d..99a19fe5f3 100644 --- a/reference/execution/execution/when_all_with_variant.md +++ b/reference/execution/execution/when_all_with_variant.md @@ -29,8 +29,7 @@ namespace std::execution { 下記いずれかが`true`となるとき、呼び出し式`when_all_with_variant(sndrs...)`は不適格となる。 - `sizeof...(sndrs) == 0`、または -- `(`[`sender`](sender.md)` && ...) == false`、または -- 型`CD`が不適格 +- `(`[`sender`](sender.md)` && ...) == false` そうでなければ、呼び出し式`when_all_with_variant(sndrs...)`は下記と等価。 From 7b6fa9eb17daa9372e76934b7d84a5c2fd01ae94 Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 20 Aug 2025 18:48:11 +0900 Subject: [PATCH 2308/3948] =?UTF-8?q?execution:=20=E4=BE=8B=E7=A4=BA?= =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E3=82=92P3557R3=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 本来はget_completion_signaturesメンバ関数定義のみで必要十分であるが、 執筆時点でP3557対応ライブラリは存在せず動作確認困難となってしまうため、 P2300時点のcompletion_signaturesメンバ型定義との互換性を維持しておく。 --- reference/execution/execution/into_variant.md | 5 +++++ reference/execution/execution/stopped_as_error.md | 6 ++++++ reference/execution/execution/stopped_as_optional.md | 6 ++++++ reference/execution/execution/when_all.md | 6 ++++++ reference/execution/execution/when_all_with_variant.md | 6 ++++++ 5 files changed, 29 insertions(+) diff --git a/reference/execution/execution/into_variant.md b/reference/execution/execution/into_variant.md index 1ca31e9c6d..57c78e6c23 100644 --- a/reference/execution/execution/into_variant.md +++ b/reference/execution/execution/into_variant.md @@ -117,6 +117,11 @@ struct FizzBuzzSender { ex::set_value_t(int), ex::set_value_t(std::string) >; + template + static consteval auto get_completion_signatures() + { + return completion_signatures{}; + } // Operation State型 template diff --git a/reference/execution/execution/stopped_as_error.md b/reference/execution/execution/stopped_as_error.md index 92c680eee4..e48be987c1 100644 --- a/reference/execution/execution/stopped_as_error.md +++ b/reference/execution/execution/stopped_as_error.md @@ -70,10 +70,16 @@ namespace ex = std::execution; // 停止完了 set_stopped() struct MySender { using sender_concept = ex::sender_t; + using completion_signatures = ex::completion_signatures< ex::set_value_t(int), ex::set_stopped_t() >; + template + static consteval auto get_completion_signatures() + { + return completion_signatures{}; + } template struct state { diff --git a/reference/execution/execution/stopped_as_optional.md b/reference/execution/execution/stopped_as_optional.md index 15fc81c4dc..b47597b8f3 100644 --- a/reference/execution/execution/stopped_as_optional.md +++ b/reference/execution/execution/stopped_as_optional.md @@ -99,10 +99,16 @@ namespace ex = std::execution; // 停止完了 set_stopped() struct MySender { using sender_concept = ex::sender_t; + using completion_signatures = ex::completion_signatures< ex::set_value_t(int), ex::set_stopped_t() >; + template + static consteval auto get_completion_signatures() + { + return completion_signatures{}; + } template struct state { diff --git a/reference/execution/execution/when_all.md b/reference/execution/execution/when_all.md index 5cc7c708c6..77723717c2 100644 --- a/reference/execution/execution/when_all.md +++ b/reference/execution/execution/when_all.md @@ -398,11 +398,17 @@ namespace ex = std::execution; // 停止完了 set_stopped() struct MySender { using sender_concept = ex::sender_t; + using completion_signatures = ex::completion_signatures< ex::set_value_t(std::string), ex::set_error_t(int), ex::set_stopped_t() >; + template + static consteval auto get_completion_signatures() + { + return completion_signatures{}; + } template struct state { diff --git a/reference/execution/execution/when_all_with_variant.md b/reference/execution/execution/when_all_with_variant.md index 99a19fe5f3..92c0516f72 100644 --- a/reference/execution/execution/when_all_with_variant.md +++ b/reference/execution/execution/when_all_with_variant.md @@ -73,11 +73,17 @@ namespace ex = std::execution; // エラー完了 set_error(int) struct MySender { using sender_concept = ex::sender_t; + using completion_signatures = ex::completion_signatures< ex::set_value_t(int), ex::set_value_t(std::string), ex::set_error_t(int) >; + template + static consteval auto get_completion_signatures() + { + return completion_signatures{}; + } template struct state { From 48b1149ac066716f12b1068f4858b944f9115d38 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Wed, 20 Aug 2025 22:19:14 +0900 Subject: [PATCH 2309/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/limits/numeric_limits/max.md | 2 +- reference/limits/numeric_limits/min.md | 2 +- reference/unordered_set/unordered_multiset/get_allocator.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/limits/numeric_limits/max.md b/reference/limits/numeric_limits/max.md index 566839a822..cbf052b84b 100644 --- a/reference/limits/numeric_limits/max.md +++ b/reference/limits/numeric_limits/max.md @@ -72,7 +72,7 @@ C++03バージョンは`constexpr`ではないため、非定数式となる。 | [`ptrdiff_t`](/reference/cstddef/ptrdiff_t.md) | [`PTRDIFF_MAX`](/reference/cstdint/ptrdiff_max.md) | | `sig_atomic_t` | [`SIG_ATOMIC_MAX`](/reference/cstdint/sig_atomic_max.md) | | `wchar_t` | [`WCHAR_MAX`](/reference/cstdint/wchar_max.md) | -| `wint_t` | [`WINT_MAX`](/reference/cstdint/wchar_max.md) | +| `wint_t` | [`WINT_MAX`](/reference/cstdint/wint_max.md) | | [`size_t`](/reference/cstddef/size_t.md) | [`SIZE_MAX`](/reference/cstdint/size_max.md) | | `float` | [`FLT_MAX`](/reference/cfloat/flt_max.md) | | `double` | [`DBL_MAX`](/reference/cfloat/dbl_max.md) | diff --git a/reference/limits/numeric_limits/min.md b/reference/limits/numeric_limits/min.md index 0bb4645906..8a9ebcd3d5 100644 --- a/reference/limits/numeric_limits/min.md +++ b/reference/limits/numeric_limits/min.md @@ -41,7 +41,7 @@ static constexpr T min() noexcept; // C++11 | [`int_fast32_t`](/reference/cstdint/int_fast32_t.md) | [`INT_FAST32_MIN`](/reference/cstdint/int_fast32_min.md) | | [`int_fast64_t`](/reference/cstdint/int_fast64_t.md) | [`INT_FAST64_MIN`](/reference/cstdint/int_fast64_min.md) | | [`int_least8_t`](/reference/cstdint/int_least8_t.md) | [`INT_LEAST8_MIN`](/reference/cstdint/int_least8_min.md) | -| [`int_least16_t`](/reference/cstdint/int_least32_t.md) | [`INT_LEAST16_MIN`](/reference/cstdint/int_least16_min.md) | +| [`int_least16_t`](/reference/cstdint/int_least16_t.md) | [`INT_LEAST16_MIN`](/reference/cstdint/int_least16_min.md) | | [`int_least32_t`](/reference/cstdint/int_least32_t.md) | [`INT_LEAST32_MIN`](/reference/cstdint/int_least32_min.md) | | [`int_least64_t`](/reference/cstdint/int_least64_t.md) | [`INT_LEAST64_MIN`](/reference/cstdint/int_least64_min.md) | | [`intmax_t`](/reference/cstdint/intmax_t.md) | [`INTMAX_MIN`](/reference/cstdint/intmax_min.md) | diff --git a/reference/unordered_set/unordered_multiset/get_allocator.md b/reference/unordered_set/unordered_multiset/get_allocator.md index fe8d38cc95..188715c1e2 100644 --- a/reference/unordered_set/unordered_multiset/get_allocator.md +++ b/reference/unordered_set/unordered_multiset/get_allocator.md @@ -114,6 +114,6 @@ libstdc++ の `unordered_multiset` では、アロケータの `select_on_contai |----------------------------------------------------------|----------------| | [`(constructor)`](op_constructor.md) | コンストラクタ | | [`operator=`](op_assign.md) | 代入演算子 | -| [`swap`](op_assign.md) | 内容の交換(非メンバ関数) | +| [`swap`](swap_free.md) | 内容の交換(非メンバ関数) | | [`allocator`](/reference/memory/allocator.md) | デフォルトのアロケータ | | [`allocator_traits`](/reference/memory/allocator_traits.md) | アロケータのトレイツ | From 403ba99ec22c04bd1e522f565e99c42ba37537af Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 21 Aug 2025 20:27:10 +0900 Subject: [PATCH 2310/3948] execution: C++26 P3284R4 (#1501) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - write_envアダプタ (write-envから昇格) - unstoppableアダプタ --- reference/execution/execution.md | 3 ++ reference/execution/execution/child-type.md | 2 +- reference/execution/execution/data-type.md | 2 +- reference/execution/execution/on.md | 6 +-- reference/execution/execution/unstoppable.md | 39 +++++++++++++++++++ .../execution/{write-env.md => write_env.md} | 33 +++++++++------- 6 files changed, 67 insertions(+), 18 deletions(-) create mode 100644 reference/execution/execution/unstoppable.md rename reference/execution/execution/{write-env.md => write_env.md} (61%) diff --git a/reference/execution/execution.md b/reference/execution/execution.md index fed87792a7..176d497052 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -110,6 +110,8 @@ namespace std::execution { | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`execution::sender_adaptor_closure`](execution/sender_adaptor_closure.md) | パイプライン記法をサポートするSenderアダプタ実装補助 (class template) | C++26 | +| [`execution::write_env`](execution/write_env.md) | Receiver環境を書き換える (customization point object) | C++26 | +| [`execution::unstoppable`](execution/unstoppable.md) | 停止要求を遮断する (customization point object) | C++26 | | [`execution::starts_on`](execution/starts_on.md) | 指定Scheduler上で開始する (customization point object) | C++26 | | [`execution::continues_on`](execution/continues_on.md) | 指定Scheduler上で継続する (customization point object) | C++26 | | [`execution::on`](execution/on.md) | 指定Senderのみ別Scheduler上で実行する (customization point object) | C++26 | @@ -162,5 +164,6 @@ Senderコンシューマは名前空間 `std::this_thread` で定義される。 ## 参照 - [P0024R2 The Parallelism TS Should be Standardized](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0024r2.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3284R4 `write_env` and `unstoppable` Sender Adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3284r4.html) - [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) - [P3682R0 Remove `std::execution::split`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3682r0.pdf) diff --git a/reference/execution/execution/child-type.md b/reference/execution/execution/child-type.md index 96124dc1dd..c876ab739b 100644 --- a/reference/execution/execution/child-type.md +++ b/reference/execution/execution/child-type.md @@ -21,11 +21,11 @@ namespace std::execution { - C++26 ## 関連項目 +- [`execution::write_env`](write_env.md) - [`execution::schedule_from`](schedule_from.md) - [`execution::let_value`](let_value.md) - [`execution::into_variant`](into_variant.md) - [`execution::stopped_as_optional`](stopped_as_optional.md) -- [`write-env`](write-env.md) ## 参照 diff --git a/reference/execution/execution/data-type.md b/reference/execution/execution/data-type.md index 1c88b695ad..897641f984 100644 --- a/reference/execution/execution/data-type.md +++ b/reference/execution/execution/data-type.md @@ -22,11 +22,11 @@ namespace std::execution { ## 関連項目 - [`execution::read_env`](read_env.md) +- [`execution::write_env`](write_env.md) - [`execution::schedule_from`](schedule_from.md) - [`execution::then`](then.md) - [`execution::let_value`](let_value.md) - [`execution::bulk`](bulk.md) -- [`write-env`](write-env.md) ## 参照 diff --git a/reference/execution/execution/on.md b/reference/execution/execution/on.md index 41061fa9f5..a9bcbed9c5 100644 --- a/reference/execution/execution/on.md +++ b/reference/execution/execution/on.md @@ -108,11 +108,11 @@ transform_sender( if constexpr (same_as) { return not-a-sender{}; } else { - return write-env( + return write_env( continues_on( std::forward_like(closure)( continues_on( - write-env(std::forward_like(child), SCHED-ENV(orig_sch)), + write_env(std::forward_like(child), SCHED-ENV(orig_sch)), sch)), orig_sch), SCHED-ENV(sch)); @@ -128,7 +128,7 @@ transform_sender( * get_env[link get_env.md] * query-with-default[link query-with-default.md] * not-a-sender[link not-a-sender.md] - * write-env[link write-env.md] + * write_env[link write_env.md] * SCHED-ENV[link scheduler.md] * std::move[link /reference/utility/move.md] diff --git a/reference/execution/execution/unstoppable.md b/reference/execution/execution/unstoppable.md new file mode 100644 index 0000000000..d8322a6cb1 --- /dev/null +++ b/reference/execution/execution/unstoppable.md @@ -0,0 +1,39 @@ +# unstoppable +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + inline constexpr unspecified unstoppable{}; +} +``` +* unspecified[italic] + +## 概要 +`unstoppable`は、[`get_stop_token`](../get_stop_token.md)クエリオブジェクトが[`never_stop_token`](/reference/stop_token/never_stop_token.md)を返すよう書き換えて、内側[Sender](sender.md)と外側[Receiver](receiver.md)の[環境](../queryable.md)を接続するSenderアダプタである。 + + +## 効果 +説明用の式`sndr`に対して、呼び出し式`unstoppable(sndr)`は式[`write_env`](write_env.md)`(sndr,` [`prop`](prop.md)`(`[`get_stop_token`](../get_stop_token.md)`,` [`never_stop_token{}`](/reference/stop_token/never_stop_token.md)`))`と等価。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::write_env`](write_env.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3284R4 `write_env` and `unstoppable` Sender Adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3284r4.html) diff --git a/reference/execution/execution/write-env.md b/reference/execution/execution/write_env.md similarity index 61% rename from reference/execution/execution/write-env.md rename to reference/execution/execution/write_env.md index 14d3765b0a..a79b191fe4 100644 --- a/reference/execution/execution/write-env.md +++ b/reference/execution/execution/write_env.md @@ -1,30 +1,29 @@ -# write-env +# write_env * execution[meta header] -* function template[meta id-type] +* cpo[meta id-type] * std::execution[meta namespace] * cpp26[meta cpp] ```cpp -template -constexpr auto write-env(Sndr&& sndr, Env&& env); // exposition only +namespace std::execution { + inline constexpr unspecified write_env{}; +} ``` +* unspecified[italic] ## 概要 -`write-env`は、Senderアルゴリズム動作仕様定義で用いられる説明専用のSenderアダプタである。 +`write_env`は、入力[Sender](sender.md)と[クエリ可能オブジェクト](../queryable.md)を受け取り、[Receiver](receiver.md)`rcvr`と[接続(connect)](connect.md)される際に、クエリ可能オブジェクトと[`get_env`](get_env.md)`(rcvr)`を合成した環境に関連付けられたReceiverと接続されるSenderを生成するSenderアダプタである。 -[クエリ可能オブジェクト](../queryable.md)`env`と接続先[Receiver](receiver.md)の環境を合成した、新たなクエリ可能オブジェクトに関連付けれられたSenderを生成する。 +## 効果 +説明用の式`sndr`と`env`に対して、`decltype((sndr))`が[`sender`](sender.md)を満たさない、もしくは`decltype((env))`が[`queryable`](../queryable.md)を満たさないとき、呼び出し式`write_env(sndr, env)`は不適格となる。 -## 戻り値 -説明専用の`write-env-t`を空のクラスとしたとき、下記を返す。 - -```cpp -make-sender(write-env-t(), std::forward(env), std::forward(sndr)) -``` -* make-sender[link make-sender.md] +そうでなければ、呼び出し式`write_env(sndr, env)`は式[`make-sender`](make-sender.md)`(write_env, env, sndr)`と等価。 ### Senderアルゴリズムタグ +説明用の`write-env-t`を`decltype(auto(write_env))`とする。 + Senderアルゴリズム動作説明用のクラステンプレート[`impls-for`](impls-for.md)に対して、下記の特殊化が定義される。 ```cpp @@ -59,12 +58,20 @@ struct impls-for : default-impls { ### 言語 - C++26 +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + ## 関連項目 - [`execution::on`](on.md) +- [`execution::unstoppable`](unstoppable.md) ## 参照 - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) - [P3396R1 std::execution wording fixes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3396r1.html) - [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) +- [P3284R4 `write_env` and `unstoppable` Sender Adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3284r4.html) From 4715e9bb94211363ca13b15572ead400728a0c0a Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 21 Aug 2025 20:53:21 +0900 Subject: [PATCH 2311/3948] =?UTF-8?q?C++26:=202025-08=20mailing=E3=81=AB?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C=20(#1497)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 5 +++ lang/cpp26.md | 72 ++++++++++++++++++++++++++++++++++++++-- 2 files changed, 74 insertions(+), 3 deletions(-) diff --git a/implementation-status.md b/implementation-status.md index bca80481ef..33d7e86050 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -324,6 +324,11 @@ | P2841R7: [コンセプトと変数テンプレートにテンプレートテンプレートパラメータのサポートを追加](/lang/cpp26/concept_and_variable-template_template-parameters.md.nolink) | テンプレート引数をあとで指定するテンプレートテンプレートパラメータを、コンセプトと変数テンプレートでも使用できるようにする | | | | | | P2786R13: [トリビアルな再配置](/lang/cpp26/trivial_relocatability.md.nolink) | ムーブ構築と破棄のためにビット単位のコピーとデストラクタ評価が必要になる型のオブジェクトを再配置するメカニズムを導入する | | | | | | P1967R14: [ファイルを読み込む`#embed`命令を追加](/lang/cpp26/embed.md) | バイナリファイルをインクルードするメカニズム。`#include`とちがって読み出しサイズなどの柔軟な指定ができる | 15 | | | | +| P3618R0: [`main`関数をグローバルモジュールに含められるようにする](/lang/cpp26/allow_attaching_main_to_the_global_module.md.nolink) | `main`関数に`extern "C++"`を指定できるようにすることで名前付きモジュールに含められるようにする | 16 | 21 | | | | +| P2996R13: [静的リフレクション](/lang/cpp26/reflection.md.nolink) | リフレクション演算子`^^`と`std::meta::info`型によりコンパイル時にさまざまな情報を取得できる | | | | | +| P1306R5: [コンパイル時のタプルやリストを展開処理する`template for`文](/lang/cpp26/expansion_statements.md.nolink) | クラス・タプル・Range・パラメータパックなどを展開してすべての要素をコンパイル時の処理する`template for`文を追加 | 16 | | | | +| P3533R2: [`constexpr`仮想継承を許可](/lang/cpp26/constexpr_virtual_inheritance.md.nolink) | 定数式の文脈での仮想継承を許可 | 16 | | | | +| P2843R3: [プリプロセッサ仕様での「未定義動作」を不適格 (診断不要) に変更](/lang/cpp26/preprocessing_is_never_undefined.md.nolink) | プリプロセッサとレキサーの文脈での「未定義動作」用語を不適格 (診断不要) に変更 | 16 | | | | 各処理系のC++26実装状況ページ: diff --git a/lang/cpp26.md b/lang/cpp26.md index 8f6954e268..44f3e8b20a 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -75,11 +75,14 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| +| [静的リフレクション](/lang/cpp26/reflection.md.nolink) | リフレクション演算子`^^`と`std::meta::info`型によりコンパイル時にさまざまな情報を取得できる | +| [コンパイル時のタプルやリストを展開処理する`template for`文](/lang/cpp26/expansion_statements.md.nolink) | クラス・タプル・Range・パラメータパックなどを展開してすべての要素をコンパイル時の処理する`template for`文を追加 | | [定数式での`void*`からポインタ型へのキャストを許可](/lang/cpp26/constexpr_cast_from_voidptr.md) | 型消去のために`void*`からポインタ型へのキャストを許可する | | [`static_assert`の診断メッセージにユーザーが生成した文字列の指定を許可](/lang/cpp26/user-generated_static_assert_messages.md) | `constexpr`な`S.size()`と`S.data()`メンバ関数をもつオブジェクトをコンパイル時文字列として指定できるようにする | | [`constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md) | 定数式の文脈での配置`new`を許可 | | [`constexpr`構造化束縛の許可と、`constexpr`参照の制限緩和](/lang/cpp26/constexpr_structured_bindings_and_references_to_constexpr_variables.md) | 定数式に対する構造化束縛を許可し、関連して`constexpr`参照の制限を緩和して自動変数も参照できるようにする | | [定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) | 定数式の文脈での例外の送出と捕捉を許可 | +| [`constexpr`仮想継承を許可](/lang/cpp26/constexpr_virtual_inheritance.md.nolink) | 定数式の文脈での仮想継承を許可 | ### プリプロセッサ @@ -87,6 +90,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| | [ファイルを読み込む`#embed`命令を追加](/lang/cpp26/embed.md) | バイナリファイルをインクルードするメカニズム。`#include`とちがって読み出しサイズなどの柔軟な指定ができる | +| [プリプロセッサ仕様での「未定義動作」を不適格 (診断不要) に変更](/lang/cpp26/preprocessing_is_never_undefined.md.nolink) | プリプロセッサとレキサーの文脈での「未定義動作」用語を不適格 (診断不要) に変更 | ### ソースコード @@ -101,6 +105,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| | [モジュール宣言でのモジュール名のマクロ展開を禁止する](/lang/cpp26/module_declarations_shouldnt_be_macros.md) | `export module MACRO_NAME;`を禁止 | +| [`main`関数をグローバルモジュールに含められるようにする](/lang/cpp26/allow_attaching_main_to_the_global_module.md.nolink) | `main`関数に`extern "C++"`を指定できるようにすることで名前付きモジュールに含められるようにする | ### 機能の非推奨化 @@ -137,6 +142,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 ### コンテナ - [`std::mdspan`](/reference/mdspan/mdspan.md)から部分ビューを取り出す[`std::submdspan()`](/reference/mdspan/submdspan.md)を追加 +- [`std::mdspan`](/reference/mdspan/mdspan.md)に、インデックスを指定して要素を取り出す[`at()`](/reference/mdspan/mdspan/at.md.nolink)メンバ関数を追加 - [`std::mdspan`](/reference/mdspan/mdspan.md)に対する[`std::dextents`](/reference/mdspan/extents.md)指定の冗長さを解決する[`std::dims`](/reference/mdspan/extents.md)を追加 - [`std::mdspan`](/reference/mdspan/mdspan.md)のレイアウトとして、[`std::layout_left_padded`](/reference/mdspan/layout_left_padded.md)と[`std::layout_right_padded`](/reference/mdspan/layout_right_padded.md)を追加 - [``](/reference/mdspan.md)に、要素アクセスにアライメント保証を与える[`std::aligned_accessor`](/reference/mdspan/aligned_accessor.md)を追加 @@ -172,6 +178,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - 各viewクラスに`reserve_hint()`メンバ関数を追加 - [`std::ranges::reserve_hint()`](/reference/ranges/reserve_hint.md.nolink)関数を追加 - [`std::ranges::approximately_sized_range`](/reference/ranges/approximately_sized_range.md.nolink)コンセプトを追加 +- インデックス列を生成する[`std::views::indices`](/reference/ranges/indices.md.nolink)を追加 - 連続イテレータのコンセプト[`contiguous_iterator`](/reference/iterator/contiguous_iterator.md)に、ポインタに変換できることを要件として追加 - 以下のコンテナを`constexpr`に対応 - [`std::deque`](/reference/deque/deque.md) @@ -195,6 +202,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 ### アルゴリズム +- [``](/reference/algorithm.md)と[``](/reference/memory.md)のアルゴリズムを並列実行に対応 - [``](/reference/algorithm.md)の以下のアルゴリズムを`constexpr`に対応 - [`std::stable_sort()`](/reference/algorithm/stable_sort.md) / [`std::ranges::stable_sort()`](/reference/algorithm/ranges_stable_sort.md) - [`std::stable_partition()`](/reference/algorithm/stable_partition.md) / [`std::ranges::stable_partition()`](/reference/algorithm/ranges_stable_partition.md) @@ -255,6 +263,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - ポインタ出力のサポートを追加 - 幅と精度を動的に指定した場合でも型の検証がコンパイル時に行われるよう仕様を見直し - コンパイル時の書式文字列だけでなく、実行時の書式文字列を渡せるよう仕様修正 +- [`std::basic_string`](/reference/string/basic_string.md)クラスと[`std::basic_string_view`](/reference/string_view/basic_string_view.md)クラスに、部分文字列を[`std::basic_string_view`](/reference/string_view/basic_string_view.md)として取得するメンバ関数`subview()`を追加 - [`std::basic_string`](/reference/string/basic_string.md)と[`std::basic_string_view`](/reference/string_view/basic_string_view.md)を[`std::basic_string`](/reference/string/basic_string.md)として連結させる`operator+`を追加 @@ -262,18 +271,60 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - ファイルのネイティブハンドルを取得できるよう、[`std::basic_filebuf`](/reference/fstream/basic_filebuf.md)、[`std::basic_ifstream`](/reference/fstream/basic_ifstream.md)、[`std::basic_ofstream`](/reference/fstream/basic_ofstream.md)、[`std::basic_fstream`](/reference/fstream/basic_fstream.md)クラスに、以下のメンバを追加 - `native_handle_type`型 - `native_handle()` -- [`std::filesystem::path`](/reference/filesystem/path.md)に、文字列フォーマットのサポートを追加 +- [`std::filesystem::path`](/reference/filesystem/path.md)クラスに、文字列フォーマットのサポートを追加 +- [`std::filesystem::path`](/reference/filesystem/path.md)クラスに、出力用の文字列を取得するための、以下のメンバ関数を追加 + - [`display_string()`](/reference/filesystem/path/display_string.md.nolink) + - [`system_encoded_string()`](/reference/filesystem/path/system_encoded_string.md.nolink) + - [`generic_display_string()`](/reference/filesystem/path/generic_display_string.md.nolink) + - [`generic_system_encoded_string()`](/reference/filesystem/path/generic_system_encoded_string.md.nolink) ### 入出力 - [`std::print()`](/reference/print/print.md)と[`std::println()`](/reference/print/println.md)に、ロックを取得せず高速に書き出す最適化を許可 - [`std::println()`](/reference/print/println.md)に、改行のみを出力するオーバーロードを追加 - [`std::print()`](/reference/print/print.md)と[`std::println()`](/reference/print/println.md)をより高速にできる最適化が可能か判定する[`std::enable_nonlocking_formatter_optimization`](/reference/format/enable_nonlocking_formatter_optimization.md)を追加 +- [`std::basic_istream`](/reference/istream/basic_istream.md)`::`[`ignore()`](/reference/istream/basic_istream/ignore.md)メンバ関数に、区切り文字として`char`型をとるオーバーロードを追加 ### 並行・並列・非同期処理 - [``](/reference/execution.md)に汎用的な非同期実行を管理するフレームワークを追加 -- [`std::atomic`](/reference/atomic/atomic.md)オブジェクトに対する2つの値の最大値・最小値を取得する関数として、メンバ関数[`fetch_max()`](/reference/atomic/atomic/fetch_max.md)と[`fetch_min()`](/reference/atomic/atomic/fetch_min.md)、非メンバ関数として[`std::atomic_fetch_max`](/reference/atomic/atomic_fetch_max.md)、[`std::atomic_fetch_max_explicit`](/reference/atomic/atomic_fetch_max_explicit.md)、[`std::atomic_fetch_min`](/reference/atomic/atomic_fetch_min.md)、[`std::atomic_fetch_min_explicit`](/reference/atomic/atomic_fetch_min_explicit.md)を追加 +- [`std::atomic`](/reference/atomic/atomic.md)オブジェクトに対する2つの値の最大値・最小値を取得する関数として、以下を追加 + - メンバ関数 + - [`fetch_max()`](/reference/atomic/atomic/fetch_max.md) + - [`fetch_min()`](/reference/atomic/atomic/fetch_min.md) + - [`fetch_fmaximum()`](/reference/atomic/atomic/fetch_fmaximum.md.nolink) (浮動小数点数用) + - [`fetch_fminimum()`](/reference/atomic/atomic/fetch_fminimum.md.nolink) (浮動小数点数用) + - [`fetch_fmaximum_num()`](/reference/atomic/atomic/fetch_fmaximum_num.md.nolink) (浮動小数点数用) + - [`fetch_fminimum_num()`](/reference/atomic/atomic/fetch_fminimum_num.md.nolink) (浮動小数点数用) + - 非メンバ関数として + - [`std::atomic_fetch_max()`](/reference/atomic/atomic_fetch_max.md) + - [`std::atomic_fetch_max_explicit()`](/reference/atomic/atomic_fetch_max_explicit.md) + - [`std::atomic_fetch_min()`](/reference/atomic/atomic_fetch_min.md) + - [`std::atomic_fetch_min_explicit()`](/reference/atomic/atomic_fetch_min_explicit.md) +- [`std::atomic`](/reference/atomic/atomic.md)クラスと[`std::atomic_ref`](/reference/atomic/atomic_ref.md)クラスに、現在の値を読み込まず (fetchせず) に加算などをする高速な縮約用の操作として、以下を追加 + - メンバ関数 + - [`store_add()`](/reference/atomic/atomic/store_add.md.nolink) + - [`store_sub()`](/reference/atomic/atomic/store_sub.md.nolink) + - [`store_and()`](/reference/atomic/atomic/store_and.md.nolink) + - [`store_or()`](/reference/atomic/atomic/store_or.md.nolink) + - [`store_xor()`](/reference/atomic/atomic/store_xor.md.nolink) + - [`store_max()`](/reference/atomic/atomic/store_max.md.nolink) + - [`store_min()`](/reference/atomic/atomic/store_min.md.nolink) + - 非メンバ関数 + - [`std::atomic_store_add()`](/reference/atomic/atomic_store_add.md.nolink) + - [`std::atomic_store_add_explicit()`](/reference/atomic/atomic_store_add_explicit.md.nolink) + - [`std::atomic_store_sub()`](/reference/atomic/atomic_store_sub.md.nolink) + - [`std::atomic_store_sub_explicit()`](/reference/atomic/atomic_store_sub_explicit.md.nolink) + - [`std::atomic_store_and()`](/reference/atomic/atomic_store_and.md.nolink) + - [`std::atomic_store_and_explicit()`](/reference/atomic/atomic_store_and_explicit.md.nolink) + - [`std::atomic_store_or()`](/reference/atomic/atomic_store_or.md.nolink) + - [`std::atomic_store_or_explicit()`](/reference/atomic/atomic_store_or_explicit.md.nolink) + - [`std::atomic_store_xor()`](/reference/atomic/atomic_store_xor.md.nolink) + - [`std::atomic_store_xor_explicit()`](/reference/atomic/atomic_store_xor_explicit.md.nolink) + - [`std::atomic_store_max()`](/reference/atomic/atomic_store_max.md.nolink) + - [`std::atomic_store_max_explicit()`](/reference/atomic/atomic_store_max_explicit.md.nolink) + - [`std::atomic_store_min()`](/reference/atomic/atomic_store_min.md.nolink) + - [`std::atomic_store_min_explicit()`](/reference/atomic/atomic_store_min_explicit.md.nolink) - [`std::atomic_ref`](/reference/atomic/atomic_ref.md)クラスに、参照するオブジェクトのアドレスを取得する[`address()`](/reference/atomic/atomic_ref/address.md)メンバ関数を追加 - [`std::atomic`](/reference/atomic/atomic.md)クラスのテンプレートパラメータとしてCV修飾された型を禁止 - [`std::atomic_ref`](/reference/atomic/atomic_ref.md)クラスのテンプレートパラメータとして、CV修飾された型を受け取れるようにした (内部でCV修飾が外される) @@ -284,6 +335,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - 動的確保したオブジェクトに値の意味論をもたせてディープコピーさせるユーティリティクラスとして、[``](/reference/memory.md)に[`std::indirect`](/reference/memory/indirect.md.nolink)クラスと[`std::polymorphic`](/reference/memory/polymorphic.md.nolink)クラスを追加 - [`std::weak_ptr`](/reference/memory/weak_ptr.md)を非順序連想コンテナのキーとして使用できるよう、[``](/reference/memory.md)に所有権ベースのハッシュ値を取得する関数オブジェクト[`std::owner_hash`](/reference/memory/owner_hash.md.nolink)、および所有権ベースの等値比較を行う関数オブジェクト[`std::owner_equal`](/reference/memory/owner_equal.md.nolink)を追加 - 関連して、[`std::shared_ptr`](/reference/memory/shared_ptr.md)クラスと[`std::weak_ptr`](/reference/memory/weak_ptr.md)クラスのメンバ関数として、`owner_hash()`と`owner_equal()`を追加 +- [`std::shared_ptr`](/reference/memory/shared_ptr.md)クラスとその関連機能を`constexpr`対応 ### 日付・時間 @@ -385,6 +437,10 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - `const_iterator`型 - [`begin()`](/reference/optional/optional/begin.md.nolink)メンバ関数 - [`end()`](/reference/optional/optional/end.md.nolink)メンバ関数 +- [`std::optional`](/reference/optional/optional.md)に、参照を保持するための`T&`の部分特殊化を追加 +- [`std::tuple`](/reference/tuple/apply.md)の戻り値型推論をやめて、戻り値型用の[`std::apply_result`](/reference/tuple/apply_result.md.nolink)クラスを追加し、関連する以下の機能を追加 + - [`std::is_applicable`](/reference/type_traits/is_applicable.md.nolink)型特性 + - [`std::is_nothrow_applicable`](/reference/type_traits/is_nothrow_applicable.md.nolink)型特性 - [`std::ignore`](/reference/tuple/ignore.md)をファーストクラス・オブジェクトとして型を詳細に定義 - [`std::bitset`](/reference/bitset/bitset.md)に、[`std::basic_string_view`](/reference/string_view/basic_string_view.md)を受け取るコンストラクタを追加 - [``](/reference/ratio.md)に、新たなSI接頭辞として、以下を追加 @@ -428,7 +484,9 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [``](/reference/format.md)ヘッダの以下の機能 - [`std::format_error`](/reference/format/format_error.md) - [``](/reference/memory.md)に、ポインタのアライメントを判定する[`std::is_sufficiently_aligned()`](/reference/memory/is_sufficiently_aligned.md)関数を追加。 -- [``](/reference/utility.md)に、タイムトラベル最適化を抑止するための観測可能ポイントとして[`std::observable()`](/reference/utility/observable.md.nolink)を追加 +- [``](/reference/utility.md)に、タイムトラベル最適化を抑止するための観測可能ポイントとして[`std::observable_checkpoint()`](/reference/utility/observable_checkpoint.md.nolink)を追加 +- [`std::exception_ptr`](/reference/exception/exception_ptr.md)を指定した例外型にキャストする[`std::exception_ptr_cast()`](/reference/exception/exception_ptr_cast.md.nolink)関数を追加 +- [``](/reference/compare.md)に、型の順序を取得する[`std::type_order`](/reference/compare/type_order.md.nolink)クラスを追加 ### デバッグ @@ -438,6 +496,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 ### 型特性 - [``](/reference/type_traits.md)に、共用体の指定されたメンバがアクティブかを定数式で判定するための関数として[`std::is_within_lifetime()`](/reference/type_traits/is_within_lifetime.md)を追加 - [``](/reference/type_traits.md)に、仮想継承の関係を判定する[`std::is_virtual_base_of`](/reference/type_traits/is_virtual_base_of.md)を追加 +- [``](/reference/type_traits.md)に、[`std::integral_constant`](/reference/type_traits/integral_constant.md)クラスを置き換える定数ラッパーとして[`std::constant_wrapper`](/reference/type_traits/constant_wrapper.md.nolink)クラスを追加 ### 制約 @@ -454,6 +513,9 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [``](/reference/type_traits.md)の[`std::is_trivial`](/reference/type_traits/is_trivial.md)を非推奨化 - これは[`std::is_trivially_copyable`](/reference/type_traits/is_trivially_copyable.md)と[`std::is_trivially_default_constructible`](/reference/type_traits/is_trivially_default_constructible.md)の2つが合わさったものであるが、それらは異なる状況で必要になるものであった - [`std::memory_order::consume`](/reference/atomic/memory_order.md)と、それに関連して[`std::kill_dependency()`](/reference/atomic/kill_dependency.md)を非推奨化し、[`[[carries_dependency]]`](/lang/cpp11/attributes.md)属性を削除 +- [`std::filesystem::path`](/reference/filesystem/path.md)クラスの以下のメンバ関数を非推奨化 + - [`string()`](/reference/filesystem/path/string.md) + - [`generic_string()`](/reference/filesystem/path/generic_string.md) ### 非推奨の取り消し @@ -477,3 +539,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [`std::atomic_compare_exchange_weak_explicit`](/reference/memory/shared_ptr/atomic_compare_exchange_weak_explicit.md) - [`std::atomic_compare_exchange_strong_explicit`](/reference/memory/shared_ptr/atomic_compare_exchange_strong_explicit.md) - C++23から非推奨となっていた、[`std::allocator`](/reference/memory/allocator.md)のメンバ型`is_always_equal`を削除 + + +## 取り決め +- C言語の参照をC17からC23に更新 From b2562a3e85f09d5a15d8f7428fcd7f980381b58b Mon Sep 17 00:00:00 2001 From: Shunya Hara Date: Thu, 21 Aug 2025 22:06:01 +0900 Subject: [PATCH 2312/3948] =?UTF-8?q?fix:=20basic=5Fifstream::close?= =?UTF-8?q?=E3=81=AE=E8=AA=A4=E5=AD=97=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/fstream/basic_ifstream/close.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/fstream/basic_ifstream/close.md b/reference/fstream/basic_ifstream/close.md index e9eabef8de..bf0ecf6411 100644 --- a/reference/fstream/basic_ifstream/close.md +++ b/reference/fstream/basic_ifstream/close.md @@ -14,7 +14,7 @@ void close(); ## 効果 -[`rdbuf()->close()`](/reference/fstream/basic_filebuf/close.md)を呼び出す。その戻り値が戻り値がヌルポインタだった場合、[`setstate(failbit)`](/reference/ios/basic_ios/setstate.md)を呼び出す。 +[`rdbuf()->close()`](/reference/fstream/basic_filebuf/close.md)を呼び出す。その戻り値がヌルポインタだった場合、[`setstate(failbit)`](/reference/ios/basic_ios/setstate.md)を呼び出す。 ## 例 From a9711d6ded91d4b7e1749f5ca7e8d8b583c82708 Mon Sep 17 00:00:00 2001 From: Shunya Hara Date: Thu, 21 Aug 2025 22:08:02 +0900 Subject: [PATCH 2313/3948] =?UTF-8?q?=E5=90=8C=E6=A7=98=E3=81=AE=E8=AA=A4?= =?UTF-8?q?=E5=AD=97=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/fstream/basic_fstream/close.md | 2 +- reference/fstream/basic_ofstream/close.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/fstream/basic_fstream/close.md b/reference/fstream/basic_fstream/close.md index 64a0dc6075..c84a759260 100644 --- a/reference/fstream/basic_fstream/close.md +++ b/reference/fstream/basic_fstream/close.md @@ -14,7 +14,7 @@ void close(); ## 効果 -[`rdbuf()->close()`](/reference/fstream/basic_filebuf/close.md)を呼び出す。その戻り値が戻り値がヌルポインタだった場合、[`setstate(failbit)`](/reference/ios/basic_ios/setstate.md)を呼び出す。 +[`rdbuf()->close()`](/reference/fstream/basic_filebuf/close.md)を呼び出す。その戻り値がヌルポインタだった場合、[`setstate(failbit)`](/reference/ios/basic_ios/setstate.md)を呼び出す。 ## 例 diff --git a/reference/fstream/basic_ofstream/close.md b/reference/fstream/basic_ofstream/close.md index 30a146070b..64bad9b650 100644 --- a/reference/fstream/basic_ofstream/close.md +++ b/reference/fstream/basic_ofstream/close.md @@ -14,7 +14,7 @@ void close(); ## 効果 -[`rdbuf()->close()`](/reference/fstream/basic_filebuf/close.md)を呼び出す。その戻り値が戻り値がヌルポインタだった場合、[`setstate(failbit)`](/reference/ios/basic_ios/setstate.md)を呼び出す。 +[`rdbuf()->close()`](/reference/fstream/basic_filebuf/close.md)を呼び出す。その戻り値がヌルポインタだった場合、[`setstate(failbit)`](/reference/ios/basic_ios/setstate.md)を呼び出す。 ## 例 From 4ac817784650144e839da20adc5a10b984fdc4d5 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Thu, 21 Aug 2025 23:04:00 +0900 Subject: [PATCH 2314/3948] Update reference/cstdio/fwrite.md Co-authored-by: Koichi Murase --- reference/cstdio/fwrite.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/cstdio/fwrite.md b/reference/cstdio/fwrite.md index fefe620bd9..460a8c2822 100644 --- a/reference/cstdio/fwrite.md +++ b/reference/cstdio/fwrite.md @@ -10,9 +10,9 @@ namespace std { ``` ## 概要 -ファイルに`count`個の`size`バイトのデータを書き込む。 +ストリームに`count`個の`size`バイトのデータを書き込む。 -ファイル内の位置は、書き込まれたバイトだけ進む。 +ストリーム内の位置は、書き込まれたバイトだけ進む。 ## 要件 - `buffer`は有効なポインタであること。 From 8be421316ab3130e11f39a2acb9b50b42ecbcd68 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Thu, 21 Aug 2025 23:12:10 +0900 Subject: [PATCH 2315/3948] added precise description in fwrite --- reference/cstdio/fwrite.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reference/cstdio/fwrite.md b/reference/cstdio/fwrite.md index 460a8c2822..c5b1449e7d 100644 --- a/reference/cstdio/fwrite.md +++ b/reference/cstdio/fwrite.md @@ -14,6 +14,10 @@ namespace std { ストリーム内の位置は、書き込まれたバイトだけ進む。 +書き込み時にエラーが発生した場合、ストリーム内の位置は不定である。 + +また、書き込みには内部的に[`fputc`](/reference/cstdio/fputc.md)を使用する。 + ## 要件 - `buffer`は有効なポインタであること。 - `stream`は有効なファイルストリームであること。 From 28435a21ae4ade531d0a1b6cbe01796a61870391 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Thu, 21 Aug 2025 23:24:02 +0900 Subject: [PATCH 2316/3948] deleted extra information --- reference/cstdio/fwrite.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/reference/cstdio/fwrite.md b/reference/cstdio/fwrite.md index c5b1449e7d..5267294aa6 100644 --- a/reference/cstdio/fwrite.md +++ b/reference/cstdio/fwrite.md @@ -25,8 +25,6 @@ namespace std { ## 戻り値 正常に書き込むことのできた項目の数を返す。 -`size`または`count`のいずれかが0だった場合、必ず`0`を返し、`buffer`は変更されない。 - ## 効果 `buffer`が指すメモリから`count`個の`size`バイトのデータを`stream`に書き込む。 From 222f890ab68f8f6d78ad0332a3abef3751ce1d63 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Thu, 21 Aug 2025 23:39:47 +0900 Subject: [PATCH 2317/3948] unified expressions in fwrite --- reference/cstdio/fwrite.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/cstdio/fwrite.md b/reference/cstdio/fwrite.md index 5267294aa6..444b0f005e 100644 --- a/reference/cstdio/fwrite.md +++ b/reference/cstdio/fwrite.md @@ -10,7 +10,7 @@ namespace std { ``` ## 概要 -ストリームに`count`個の`size`バイトのデータを書き込む。 +ストリームに`count`個の`size`バイトの要素を書き込む。 ストリーム内の位置は、書き込まれたバイトだけ進む。 @@ -23,10 +23,10 @@ namespace std { - `stream`は有効なファイルストリームであること。 ## 戻り値 -正常に書き込むことのできた項目の数を返す。 +正常に書き込むことのできた要素の数を返す。 ## 効果 -`buffer`が指すメモリから`count`個の`size`バイトのデータを`stream`に書き込む。 +`buffer`が指すメモリから`count`個の`size`バイトの要素を`stream`に書き込む。 書き込みエラーが生じなければ、書き込むデータの大きさは`count * size`バイトである。 From f596c4c80a11d09c624780bc20fec2a91fb5463d Mon Sep 17 00:00:00 2001 From: rotarymars Date: Thu, 21 Aug 2025 23:51:20 +0900 Subject: [PATCH 2318/3948] added appropriate explanations for function with `restrict` --- reference/cstdio/fgets.md | 5 +++++ reference/cstdio/fputs.md | 5 +++++ reference/cstdio/fread.md | 1 + reference/cstdio/fwrite.md | 1 + 4 files changed, 12 insertions(+) diff --git a/reference/cstdio/fgets.md b/reference/cstdio/fgets.md index 459603dd13..354af131a3 100644 --- a/reference/cstdio/fgets.md +++ b/reference/cstdio/fgets.md @@ -16,6 +16,11 @@ namespace std { また、改行にたどり着くとそこで読み込みを終了する(末尾に改行文字を含める)。 +## 要件 +- `str`は有効なポインタであること。 +- `stream`は有効なファイルストリームであること。 +- `str`が指すメモリ領域と`stream`が指すファイルストリームの内部バッファが重複していないこと。 + ## 戻り値 成功すれば読み込まれた文字列を、そうでなければ`NULL`を返す。 diff --git a/reference/cstdio/fputs.md b/reference/cstdio/fputs.md index c00edfd847..7d79856ae2 100644 --- a/reference/cstdio/fputs.md +++ b/reference/cstdio/fputs.md @@ -12,6 +12,11 @@ namespace std { ## 概要 ファイルに渡された文字列を出力する。 +## 要件 +- `str`は有効なポインタであること。 +- `stream`は有効なファイルストリームであること。 +- `str`が指すメモリ領域と`stream`が指すファイルストリームの内部バッファが重複していないこと。 + ## 戻り値 正常終了した場合は`0`を、そうでなければ[`EOF`](/reference/cstdio/eof.md)を返す。 diff --git a/reference/cstdio/fread.md b/reference/cstdio/fread.md index a2918cf229..116b601c9b 100644 --- a/reference/cstdio/fread.md +++ b/reference/cstdio/fread.md @@ -17,6 +17,7 @@ namespace std { ## 要件 - `buffer`は有効なポインタであること。 - `stream`は有効なファイルストリームであること。 +- `buffer`が指すメモリ領域と`stream`が指すファイルストリームの内部バッファが重複していないこと。 ## 戻り値 正常に読み込むことのできた項目の数を返す。 diff --git a/reference/cstdio/fwrite.md b/reference/cstdio/fwrite.md index 444b0f005e..b07ad0c4ba 100644 --- a/reference/cstdio/fwrite.md +++ b/reference/cstdio/fwrite.md @@ -21,6 +21,7 @@ namespace std { ## 要件 - `buffer`は有効なポインタであること。 - `stream`は有効なファイルストリームであること。 +- `buffer`が指すメモリ領域と`stream`が指すファイルストリームの内部バッファが重複していないこと。 ## 戻り値 正常に書き込むことのできた要素の数を返す。 From 8cc1753c4e72f4ab7b0f439e8841654fa7ace689 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 22 Aug 2025 10:31:39 +0900 Subject: [PATCH 2319/3948] =?UTF-8?q?=E3=82=B9=E3=83=9D=E3=83=B3=E3=82=B5?= =?UTF-8?q?=E3=83=BC=E6=9B=B4=E6=96=B0=20#1524?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.md b/index.md index bacfcea5c6..dd61e1b09d 100644 --- a/index.md +++ b/index.md @@ -147,6 +147,8 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい [sponsor name:ぼっちマスター様, img:https://raw.githubusercontent.com/cpprefjp/image/master/sponsors/bocchi-master/my-icon.png, link:https://profile.bocchi-master.net/, size:320, fee:5, amount:12] +[sponsor name:甲斐智丈, fee:5, amount:12] + スポンサーシップについては、以下のページを参照ください。 From a7d284460700044384a139607f137a890b1db550 Mon Sep 17 00:00:00 2001 From: yoh Date: Sat, 23 Aug 2025 15:06:34 +0900 Subject: [PATCH 2320/3948] execution: C++26 P3570R2 (#1507) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit get_await_completion_adaptorクエリオブジェクト追加 --- reference/execution/execution.md | 2 + reference/execution/execution/as_awaitable.md | 24 ++++++++- .../execution/get_await_completion_adaptor.md | 53 +++++++++++++++++++ 3 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 reference/execution/execution/get_await_completion_adaptor.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 176d497052..de097fd928 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -45,6 +45,7 @@ namespace std::execution { | [`execution::forward_progress_guarantee`](execution/forward_progress_guarantee.md) | 前方進行保証 (enum) | C++26 | | [`execution::get_forward_progress_guarantee`](execution/get_forward_progress_guarantee.md) | 前方進行保証取得のクエリオブジェクト (customization point object) | C++26 | | [`execution::get_completion_scheduler`](execution/get_completion_scheduler.md) | 完了Scheduler取得のクエリオブジェクト (customization point object) | C++26 | +| [`execution::get_await_completion_adaptor`](execution/get_await_completion_adaptor.md) | Awaitable完了アダプタ取得のクエリオブジェクト (customization point object) | C++26 | | [`execution::get_env`](execution/get_env.md) | 環境取得のクエリオブジェクト (customization point object) | C++26 | | [`execution::env_of_t`](execution/env_of_t.md) | 指定型から環境型を取得 (alias template) | C++26 | | [`execution::prop`](execution/prop.md) | Key/Valueペアによる[クエリ可能オブジェクト](queryable.md) (class template) | C++26 | @@ -166,4 +167,5 @@ Senderコンシューマは名前空間 `std::this_thread` で定義される。 - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) - [P3284R4 `write_env` and `unstoppable` Sender Adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3284r4.html) - [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) +- [P3570R2 optional variants in sender/receiver](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3570r2.html) - [P3682R0 Remove `std::execution::split`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3682r0.pdf) diff --git a/reference/execution/execution/as_awaitable.md b/reference/execution/execution/as_awaitable.md index e5d61cb415..fdcf544921 100644 --- a/reference/execution/execution/as_awaitable.md +++ b/reference/execution/execution/as_awaitable.md @@ -18,7 +18,9 @@ namespace std::execution { Promise型`p`をもつコルーチンにおいて、Await式`co_await as_awaitable(expr, p)`は下記のように動作する。 - 式`expr.as_awaitable(p)`が有効ならば、同式が返すAwaitableオブジェクトに対してAwait式を実行する。 -- `expr`が[単一の値を送信するSender](single-sender.md)であり、Promise型が停止完了ハンドラを定義するならば、下記動作を行う。 +- `expr`が[Sender型](sender.md)かつ[`get_await_completion_adaptor`](get_await_completion_adaptor.md)問い合わせに対応する場合、同問い合わせが返すSenderアダプタを`expr`に適用した結果を`adapted-expr`とする。 + +- `expr`(または上記ステップの`adapted-expr`)が[単一の値を送信するSender](single-sender.md)であり、Promise型が停止完了ハンドラを定義するならば、下記動作を行う。 - Senderを[接続(connect)](connect.md)し、結果[Operation State](operation_state.md)をAwaitableオブジェクトに格納する。 - コルーチンを中断し、Operation Stateを[開始(start)](start.md)する。 - [クエリオブジェクト](../queryable.md)による[Receiver](receiver.md)環境への問い合わせは、Promise型に関連付けられた環境(`get_env`)へと転送される。 @@ -37,6 +39,7 @@ Promise型`p`をもつコルーチンにおいて、Await式`co_await as_awaitab - 適格要件 : 同式の型を`A`としたとき、[`is-awaitable`](../is-awaitable.md)` == true`であるべき。 - そうではなく、説明用の型`U`を`Promise`とは異なりかつ`await_transform`メンバ関数を持たない未規定の型としたとき、[`is-awaitable`](../is-awaitable.md)` == true`ならば、式`(void(p), expr)` - 事前条件 : [`is-awaitable`](../is-awaitable.md)` == true`、かつPromise型`U`のコルーチンにおける式`co_await expr`がPromise型`Promise`のコルーチンにおける同式と等しさを保持すること。 +- そうではなく、説明用の式`adapted-expr`を`expr`が1回だけ評価されることを除いて[`get_await_completion_adaptor`](get_await_completion_adaptor.md)`(`[`get_env`](get_env.md)`(expr))(expr)`としたとき、`has-queryable-await-completion-adaptor`と`awaitable-sender`が共に満たされるならば、式`sender-awaitable{adapted-expr, p}` - そうではなく、`awaitable-sender`ならば、式`sender-awaitable{expr, p}` - そうでなければ、式`(void(p), expr)` @@ -59,6 +62,21 @@ namespace std::execution { * sender_to[link sender_to.md] * coroutine_handle<>[link /reference/coroutine/coroutine_handle.md] +### コンセプト`has-queryable-await-completion-adaptor` +```cpp +namespace std::execution { + template + concept has-queryable-await-completion-adaptor = // exposition only + sender + && requires(Sndr&& sender) { + get_await_completion_adaptor(get_env(sender)); + }; +} +``` +* sender[link sender.md] +* get_await_completion_adaptor[link get_await_completion_adaptor.md] +* get_env[link get_env.md] + ### クラステンプレート`sender-awaitable` ```cpp namespace std::execution { @@ -196,6 +214,8 @@ value-type await_resume(); ## カスタマイゼーションポイント `expr`に対して、適格であるならば式`expr.as_awaitable(p)`が呼び出される。 +`expr`が[Sender型](sender.md)かつ関連付けられた[属性](../queryable.md)がクエリオブジェクト[`get_await_completion_adaptor`](get_await_completion_adaptor.md)に対応するとき、`expr`に対して同クエリオブジェクトが返すSenderアダプタを適用してからAwaitableオブジェクトへ変換する。 + ## バージョン ### 言語 @@ -210,9 +230,11 @@ value-type await_resume(); ## 関連項目 - [`execution::with_awaitable_senders`](with_awaitable_senders.md) +- [`execution::get_await_completion_adaptor`](get_await_completion_adaptor.md) - [C++20 コルーチン](/lang/cpp20/coroutines.md) ## 参照 - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) - [P3396R1 std::execution wording fixes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3396r1.html) +- [P3570R2 optional variants in sender/receiver](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3570r2.html) diff --git a/reference/execution/execution/get_await_completion_adaptor.md b/reference/execution/execution/get_await_completion_adaptor.md new file mode 100644 index 0000000000..cdf08b0b18 --- /dev/null +++ b/reference/execution/execution/get_await_completion_adaptor.md @@ -0,0 +1,53 @@ +# get_await_completion_adaptor +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct get_await_completion_adaptor_t { unspecified }; + inline constexpr get_await_completion_adaptor_t get_await_completion_adaptor{}; +} +``` +* unspecified[italic] + +## 概要 +`get_await_completion_adaptor`は、関連付けられたAwaitable完了アダプタを問い合わせる[クエリオブジェクト](../queryable.md)である。 + +コア定数式[`forwarding_query`](../forwarding_query.md)`(get_await_completion_adaptor)`は`true`値を返す。 + + +## 効果 +呼び出し式`get_await_completion_adaptor(env)`は下記と等価。 + +- 引数`env`がconst修飾された`cenv`を用いて、式`cenv.query(get_await_completion_adaptor)` + + +## 例外 +投げない + + +## カスタマイゼーションポイント +const修飾[クエリ可能オブジェクト](../queryable.md)`cenv`に対して式`cenv.query(get_await_completion_adaptor)`が呼び出される。 +このとき、`noexcept(cenv.query(get_await_completion_adaptor)) == true`であること。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::as_awaitable`](as_awaitable.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3570R2 optional variants in sender/receiver](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3570r2.html) From f8a8a06349c9b6ec87a1795cd171065689a1d9aa Mon Sep 17 00:00:00 2001 From: Shunya Date: Sat, 23 Aug 2025 17:41:29 +0900 Subject: [PATCH 2321/3948] =?UTF-8?q?=E3=81=84=E3=81=8F=E3=81=A4=E3=81=8B?= =?UTF-8?q?=E3=81=AE=E8=AA=A4=E5=AD=97=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/utility/pair/op_constructor.md | 2 +- reference/valarray/gslice_array/op_right_shift_assign.md | 2 +- reference/valarray/indirect_array/op_right_shift_assign.md | 2 +- reference/valarray/mask_array/op_right_shift_assign.md | 2 +- reference/valarray/slice_array/op_right_shift_assign.md | 2 +- reference/valarray/valarray/op_greater_equal.md | 2 +- reference/valarray/valarray/swap.md | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/reference/utility/pair/op_constructor.md b/reference/utility/pair/op_constructor.md index 84f94e1882..3b558b7fa5 100644 --- a/reference/utility/pair/op_constructor.md +++ b/reference/utility/pair/op_constructor.md @@ -94,7 +94,7 @@ constexpr pair(piecewise_construct_t, - [`is_constructible`](/reference/type_traits/is_constructible.md)`::value &&` [`is_constructible`](/reference/type_traits/is_constructible.md)`::value`であること - C++14まで : `U`が`first_type`に暗黙変換可能でない場合、もしくは`V`が`second_type`に暗黙変換可能でない場合、この関数はオーバーロード解決から除外される - (6)-(10) : - - C++23 : `FWD(u)`を`static_cast(u)`と定義して、[`is_constructible_v`](/reference/type_traits/is_constructible.md)`(FWD(p)))> &&` [`is_constructible_v`](/reference/type_traits/is_constructible.md)`(FWD(p)))>`であること + - C++23 : `FWD(u)`を`static_cast(u)`と定義して、[`is_constructible_v`](/reference/type_traits/is_constructible.md)`(FWD(p)))> &&` [`is_constructible_v`](/reference/type_traits/is_constructible.md)`(FWD(p)))>`であること - (7) : - [`is_constructible`](/reference/type_traits/is_constructible.md)`::value &&` [`is_constructible`](/reference/type_traits/is_constructible.md)`::value`であること - C++14まで : `const U&`が`first_type`に暗黙変換可能でない場合、もしくは`const V&`が`second_type`に暗黙変換可能でない場合、この関数はオーバーロード解決から除外される diff --git a/reference/valarray/gslice_array/op_right_shift_assign.md b/reference/valarray/gslice_array/op_right_shift_assign.md index c1e924f8b9..e4120f2ce4 100644 --- a/reference/valarray/gslice_array/op_right_shift_assign.md +++ b/reference/valarray/gslice_array/op_right_shift_assign.md @@ -14,7 +14,7 @@ void operator>>=(const ValOrProxy& xs) const; ## 効果 -元となる [`valarray`](../valarray.md) オブジェクトから参照によって抽出した各要素を、`xs` の各要素の値だけ左シフトする。 +元となる [`valarray`](../valarray.md) オブジェクトから参照によって抽出した各要素を、`xs` の各要素の値だけ右シフトする。 ## 戻り値 diff --git a/reference/valarray/indirect_array/op_right_shift_assign.md b/reference/valarray/indirect_array/op_right_shift_assign.md index e8e0f77fda..1a3f2d1c91 100644 --- a/reference/valarray/indirect_array/op_right_shift_assign.md +++ b/reference/valarray/indirect_array/op_right_shift_assign.md @@ -14,7 +14,7 @@ void operator>>=(const ValOrProxy& xs) const; ## 効果 -元となる [`valarray`](../valarray.md) オブジェクトから参照によって抽出した各要素を、`xs` の各要素の値だけ左シフトする。 +元となる [`valarray`](../valarray.md) オブジェクトから参照によって抽出した各要素を、`xs` の各要素の値だけ右シフトする。 ## 戻り値 diff --git a/reference/valarray/mask_array/op_right_shift_assign.md b/reference/valarray/mask_array/op_right_shift_assign.md index 87400f7dda..6a41061a1e 100644 --- a/reference/valarray/mask_array/op_right_shift_assign.md +++ b/reference/valarray/mask_array/op_right_shift_assign.md @@ -14,7 +14,7 @@ void operator>>=(const ValOrProxy& xs) const; ## 効果 -元となる [`valarray`](../valarray.md) オブジェクトから参照によって抽出した各要素を、`xs` の各要素の値だけ左シフトする。 +元となる [`valarray`](../valarray.md) オブジェクトから参照によって抽出した各要素を、`xs` の各要素の値だけ右シフトする。 ## 戻り値 diff --git a/reference/valarray/slice_array/op_right_shift_assign.md b/reference/valarray/slice_array/op_right_shift_assign.md index 1b899e0d06..80c3af5fca 100644 --- a/reference/valarray/slice_array/op_right_shift_assign.md +++ b/reference/valarray/slice_array/op_right_shift_assign.md @@ -14,7 +14,7 @@ void operator>>=(const ValOrProxy& xs) const; ## 効果 -元となる [`valarray`](../valarray.md) オブジェクトから参照によって抽出した各要素を、`xs` の各要素の値だけ左シフトする。 +元となる [`valarray`](../valarray.md) オブジェクトから参照によって抽出した各要素を、`xs` の各要素の値だけ右シフトする。 ## 戻り値 diff --git a/reference/valarray/valarray/op_greater_equal.md b/reference/valarray/valarray/op_greater_equal.md index d88ff7f8f3..cc8e1fc98a 100644 --- a/reference/valarray/valarray/op_greater_equal.md +++ b/reference/valarray/valarray/op_greater_equal.md @@ -27,7 +27,7 @@ namespace std { * ValOrProxy[italic] ## 概要 -`valarray`において、左辺が右辺以上を判定する。 +`valarray`において、左辺が右辺以上かを判定する。 - (1) : `xs`の各要素が、`ys`の各要素以上かを判定する。 - (2) : `xs`の各要素が、`y`以上かを判定する。 diff --git a/reference/valarray/valarray/swap.md b/reference/valarray/valarray/swap.md index 67bcee9d65..ea74562b4e 100644 --- a/reference/valarray/valarray/swap.md +++ b/reference/valarray/valarray/swap.md @@ -14,7 +14,7 @@ void swap(valarray& v) noexcept; ## 効果 -`*this`の内容を`x`と交換する。 +`*this`の内容を`v`と交換する。 ## 計算量 From bb595bcd173b64958f07e9f137726314ed94d989 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sun, 24 Aug 2025 00:23:52 +0900 Subject: [PATCH 2322/3948] =?UTF-8?q?typo=E4=BF=AE=E6=AD=A3=E3=81=A8NG?= =?UTF-8?q?=E3=83=AF=E3=83=BC=E3=83=89=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 直前のコミットで修正されたtypoと同じtypoが残っていたので修正して、NGワードに追加しました。 deccltype → decltype --- .github/workflows/script/ngword_check.py | 1 + reference/utility/pair/op_constructor.md | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/script/ngword_check.py b/.github/workflows/script/ngword_check.py index 6747603c9b..7ab3c47e91 100644 --- a/.github/workflows/script/ngword_check.py +++ b/.github/workflows/script/ngword_check.py @@ -17,6 +17,7 @@ ("", "condtion", "condition"), ("", "contraint", "constraint"), ("", "Dimentional", "Dimensional"), + ("", "deccltype", "decltype"), ("", "Doamin", "Domain"), ("", "eror", "error"), ("", "enumrate", "enumerate"), diff --git a/reference/utility/pair/op_constructor.md b/reference/utility/pair/op_constructor.md index 3b558b7fa5..37ee8980b7 100644 --- a/reference/utility/pair/op_constructor.md +++ b/reference/utility/pair/op_constructor.md @@ -110,7 +110,7 @@ constexpr pair(piecewise_construct_t, - (5) : [`reference_constructs_from_temporary_v`](/reference/type_traits/reference_constructs_from_temporary.md)` ||` [`reference_constructs_from_temporary_v`](/reference/type_traits/reference_constructs_from_temporary.md)``である場合、このコンストラクタは削除定義される - (6)-(10) : - - `FWD(u)`を`static_cast(u)`と定義して + - `FWD(u)`を`static_cast(u)`と定義して - [`reference_constructs_from_temporary_v`](/reference/type_traits/reference_constructs_from_temporary.md)`(FWD(p)))> ||` [`reference_constructs_from_temporary_v`](/reference/type_traits/reference_constructs_from_temporary.md)`(FWD(p)))>`である場合、このコンストラクタは削除定義される - (11) : 要素型(`T1, T2`のどちらかもしくは両方)が参照型であり、初期化によって一時オブジェクトを束縛することになる場合、このコンストラクタは削除定義される - 上記のコンストラクタと同様に、[`reference_constructs_from_temporary`](/reference/type_traits/reference_constructs_from_temporary.md)を使用して判定される @@ -124,7 +124,7 @@ constexpr pair(piecewise_construct_t, - (5) : - C++17 : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` || !`[`is_convertible_v`](/reference/type_traits/is_convertible.md)``である場合、`explicit`指定される - (6)-(10) : - - `FWD(u)`を`static_cast(u)`と定義して + - `FWD(u)`を`static_cast(u)`と定義して - C++23 : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`(FWD(p))), first_type> || !`[`is_convertible_v`](/reference/type_traits/is_convertible.md)`(FWD(p))), second_type>`である場合、`explicit`指定される - (7) : - C++17 : `!`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` || !`[`is_convertible_v`](/reference/type_traits/is_convertible.md)``である場合、`explicit`指定される From 3bb11d9b75a5adcf8e7a344f341993fe3b48184e Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sun, 24 Aug 2025 00:26:21 +0900 Subject: [PATCH 2323/3948] =?UTF-8?q?typo=E4=BF=AE=E6=AD=A3=E3=81=A8NG?= =?UTF-8?q?=E3=83=AF=E3=83=BC=E3=83=89=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit construcitble → constructible construtible → constructible poinetr → pointer --- .github/workflows/script/ngword_check.py | 3 +++ reference/functional/bind_back.md | 2 +- reference/functional/bind_front.md | 2 +- reference/functional/move_only_function/op_constructor.md | 4 ++-- reference/functional/not_fn.md | 2 +- reference/future/async.md | 2 +- 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/script/ngword_check.py b/.github/workflows/script/ngword_check.py index 7ab3c47e91..d4d1a16780 100644 --- a/.github/workflows/script/ngword_check.py +++ b/.github/workflows/script/ngword_check.py @@ -15,6 +15,8 @@ ("", "algined", "aligned"), ("", "concpet", "concept"), ("", "condtion", "condition"), + ("", "construcitble", "constructible"), + ("", "construtible", "constructible"), ("", "contraint", "constraint"), ("", "Dimentional", "Dimensional"), ("", "deccltype", "decltype"), @@ -33,6 +35,7 @@ ("", "opreator", "operator"), ("", "opton", "option"), ("", "Ohter", "Other"), + ("", "poinetr", "pointer"), ("", "protmise_type", "promise_type"), ("", "pvalue", "prvalue"), ("", "Recevier", "Receiver"), diff --git a/reference/functional/bind_back.md b/reference/functional/bind_back.md index 938e33f7ba..7cf6935536 100644 --- a/reference/functional/bind_back.md +++ b/reference/functional/bind_back.md @@ -37,7 +37,7 @@ namespace std { - (2) : `F`を`f`の型として - `(`[`is_constructible_v`](/reference/type_traits/is_constructible.md)` && ...)`が`true`、かつ - `(`[`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)` && ...)`が`true`、かつ - - もし[`is_poinetr_v`](/reference/type_traits/is_pointer.md)` ||` [`is_member_poinetr_v`](/reference/type_traits/is_member_pointer.md)``が`true`ならば、`f != nullptr`であること + - もし[`is_pointer_v`](/reference/type_traits/is_pointer.md)` ||` [`is_member_pointer_v`](/reference/type_traits/is_member_pointer.md)``が`true`ならば、`f != nullptr`であること ## 戻り値 diff --git a/reference/functional/bind_front.md b/reference/functional/bind_front.md index f2158da71a..0bfb6a2dc1 100644 --- a/reference/functional/bind_front.md +++ b/reference/functional/bind_front.md @@ -67,7 +67,7 @@ auto f3 = bind_front(&Strategy::process, Strategy{}); - (2) : `F`を`f`の型として - `(`[`is_constructible_v`](/reference/type_traits/is_constructible.md)` && ...)`が`true`、かつ - `(`[`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)` && ...)`が`true`、かつ - - もし[`is_poinetr_v`](/reference/type_traits/is_pointer.md)` ||` [`is_member_poinetr_v`](/reference/type_traits/is_member_pointer.md)``が`true`ならば、`f != nullptr`であること + - もし[`is_pointer_v`](/reference/type_traits/is_pointer.md)` ||` [`is_member_pointer_v`](/reference/type_traits/is_member_pointer.md)``が`true`ならば、`f != nullptr`であること ## 戻り値 diff --git a/reference/functional/move_only_function/op_constructor.md b/reference/functional/move_only_function/op_constructor.md index 78d76f7404..3ef14e738f 100644 --- a/reference/functional/move_only_function/op_constructor.md +++ b/reference/functional/move_only_function/op_constructor.md @@ -56,10 +56,10 @@ explicit move_only_function(in_place_type_t, initializer_list, Args&&...); ## 事前条件 - (4) : `VT`型を`decay_t`としたとき - `VT`がCpp17Destructible要件を満たすこと。 - - [`is_move_construtible_v`](/reference/type_traits/is_move_constructible.md)``が`true`の場合、`VT`がCpp17MoveConstructible要件を満たすこと。 + - [`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)``が`true`の場合、`VT`がCpp17MoveConstructible要件を満たすこと。 - (5), (6) : `VT`型を`decay_t`としたとき - `VT`がCpp17Destructible要件を満たすこと。 - - [`is_move_construtible_v`](/reference/type_traits/is_move_constructible.md)``が`true`の場合、`VT`がCpp17MoveConstructible要件を満たすこと。 + - [`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)``が`true`の場合、`VT`がCpp17MoveConstructible要件を満たすこと。 ## 効果 diff --git a/reference/functional/not_fn.md b/reference/functional/not_fn.md index e2a1684b2b..391149c770 100644 --- a/reference/functional/not_fn.md +++ b/reference/functional/not_fn.md @@ -29,7 +29,7 @@ namespace std { - (1) : [`decay_t`](/reference/type_traits/decay.md)``を適用した型を`FD`として、 - [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true`、かつ - [`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)``が`true`であること -- (2) : `F`を`f`の型として、もし[`is_poinetr_v`](/reference/type_traits/is_pointer.md)` ||` [`is_member_poinetr_v`](/reference/type_traits/is_member_pointer.md)``が`true`ならば、`f != nullptr`であること +- (2) : `F`を`f`の型として、もし[`is_pointer_v`](/reference/type_traits/is_pointer.md)` ||` [`is_member_pointer_v`](/reference/type_traits/is_member_pointer.md)``が`true`ならば、`f != nullptr`であること ## 効果(C++17) diff --git a/reference/future/async.md b/reference/future/async.md index ab7eb2f97d..e14f233a20 100644 --- a/reference/future/async.md +++ b/reference/future/async.md @@ -59,7 +59,7 @@ namespace std { 返された`future`オブジェクトの`get()`もしくは`wait()`を呼び出すことにより、非同期実行の完了を待機する。 ## 要件 -- 関数オブジェクト`F`および`Args...`の各型が、[`is_move_construcitble`](/reference/type_traits/is_move_constructible.md)`::value == true`であること。 +- 関数オブジェクト`F`および`Args...`の各型が、[`is_move_constructible`](/reference/type_traits/is_move_constructible.md)`::value == true`であること。 - [`INVOKE`](/reference/concepts/Invoke.md)`(DECAY_COPY(std::`[`forward`](/reference/utility/forward.md)`(f)), DECAY_COPY(std::`[`forward`](/reference/utility/forward.md)`(args))...)`が可能であること。 ## 効果 From 7b6b8791be8368d84bbbf9020d64df43e1772cd4 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sun, 24 Aug 2025 01:37:25 +0900 Subject: [PATCH 2324/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit リンクのテキストとアドレスが一致しないものを抽出し、リンクのテキストもしくはアドレスを修正しました。 --- reference/functional/hash.md | 4 ++-- reference/mdspan/extents/op_constructor.md | 4 ++-- reference/mdspan/mdspan.md | 2 +- reference/mdspan/mdspan/op_at.md | 4 ++-- reference/mdspan/mdspan/op_constructor.md | 4 ++-- reference/tuple/tuple/basic_common_reference.md | 2 +- reference/utility/pair/basic_common_reference.md | 2 +- reference/utility/pair/op_constructor.md | 4 ++-- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/reference/functional/hash.md b/reference/functional/hash.md index 7129a58c88..041e785e10 100644 --- a/reference/functional/hash.md +++ b/reference/functional/hash.md @@ -194,11 +194,11 @@ found : 3 | [``](/reference/filesystem.md) | [`std::filesystem::path`](/reference/filesystem/path.md) | | [``](/reference/optional.md) | [`std::optional`](/reference/optional/optional.md) | | [``](/reference/memory.md) | [`std::shared_ptr`](/reference/memory/shared_ptr.md), [`std::unique_ptr`](/reference/memory/unique_ptr.md) | -| [``](/reference/stacktrace.md) | [`std::basic_backtrace`](/reference/stacktrace/basic_stacktrace.md), [`std::stacktrace_entry`](/reference/stacktrace/stacktrace_entry.md) | +| [``](/reference/stacktrace.md) | [`std::basic_stacktrace`](/reference/stacktrace/basic_stacktrace.md), [`std::stacktrace_entry`](/reference/stacktrace/stacktrace_entry.md) | | [``](/reference/string.md) | `std::string`など | | [``](/reference/string_view.md) | `std::string_view`など | | [``](/reference/system_error.md) | [`std::error_code`](/reference/system_error/error_code.md), [`std::error_condition`](/reference/system_error/error_condition.md) | -| [``](/reference/thread.md) | [`std::thread:id`](/reference/thread/thread.md) | +| [``](/reference/thread.md) | [`std::thread::id`](/reference/thread/thread/id.md) | | [``](/reference/typeindex.md) | [`std::type_index`](/reference/typeindex/type_index.md) | | [``](/reference/variant.md) | [`std::variant`](/reference/variant/variant.md), [`std::monostate`](/reference/variant/monostate.md) | | [``](/reference/vector.md) | [`std::vector`](/reference/vector/vector.md) | diff --git a/reference/mdspan/extents/op_constructor.md b/reference/mdspan/extents/op_constructor.md index a0af10732d..4569a97bf7 100644 --- a/reference/mdspan/extents/op_constructor.md +++ b/reference/mdspan/extents/op_constructor.md @@ -41,11 +41,11 @@ constexpr explicit(N != rank_dynamic()) - `((OtherExtents == dynamic_extent || Extents == dynamic_extent || OtherExtents == Extents) && ...)`が`true`であること - (3) : `N`を`sizeof...(OtherIndexTypes)`、`exts_arr`を[`array`](/reference/array/array.md)`{static_cast(std::move(exts))...}`としたとき - `(`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` && ...)`が`true`、かつ - - `(`[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_convertible.md)` && ...)`が`true`、かつ + - `(`[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)` && ...)`が`true`、かつ - `N ==` [`rank_dynamic()`](rank_dynamic.md) `|| N ==` [`rank()`](rank.md)が`true`であること - (4), (5) : - `(`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` && ...)`が`true`、かつ - - `(`[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_convertible.md)` && ...)`が`true`、かつ + - `(`[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)` && ...)`が`true`、かつ - `N ==` [`rank_dynamic()`](rank_dynamic.md) `|| N ==` [`rank()`](rank.md)が`true`であること diff --git a/reference/mdspan/mdspan.md b/reference/mdspan/mdspan.md index 410c68a77b..3a0328a7e7 100644 --- a/reference/mdspan/mdspan.md +++ b/reference/mdspan/mdspan.md @@ -115,7 +115,7 @@ namespace std { | `accessor_type` | [アクセサポリシー型`AccessorPolicy`](AccessorPolicy.md) | C++23 | | `mapping_type` | [レイアウトマッピング型`LayoutPolicy::mapping`](LayoutMapping.md) | C++23 | | `element_type` | 要素型`ElementType` | C++23 | -| `value_type` | 要素の値型[`remove_cv_t`](/reference/type_traits/remove_cvref.md)`` | C++23 | +| `value_type` | 要素の値型[`remove_cv_t`](/reference/type_traits/remove_cv.md)`` | C++23 | | `size_type` | [`Extents::size_type`](extents.md) | C++23 | | `rank_type` | [`Extents::rank_type`](extents.md) | C++23 | | `pointer` | [`AccessorPolicy::pointer`](AccessorPolicy.md) | C++23 | diff --git a/reference/mdspan/mdspan/op_at.md b/reference/mdspan/mdspan/op_at.md index 3da007b870..a09f9ff6df 100644 --- a/reference/mdspan/mdspan/op_at.md +++ b/reference/mdspan/mdspan/op_at.md @@ -26,11 +26,11 @@ constexpr reference operator[](const array& indices) con ## テンプレートパラメータ制約 - (1) : - `(`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` && ...)`が`true`、かつ - - `(`[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_convertible.md)` && ...)`が`true`、かつ + - `(`[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)` && ...)`が`true`、かつ - `sizeof...(OtherIndexTypes) ==` [`rank()`](rank.md)が`true`であること - (2), (3) : - `(`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` && ...)`が`true`、かつ - - `(`[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_convertible.md)` && ...)`が`true`であること + - `(`[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)` && ...)`が`true`であること ## 事前条件 diff --git a/reference/mdspan/mdspan/op_constructor.md b/reference/mdspan/mdspan/op_constructor.md index ef7005bab3..2a1c926616 100644 --- a/reference/mdspan/mdspan/op_constructor.md +++ b/reference/mdspan/mdspan/op_constructor.md @@ -67,13 +67,13 @@ template`が`true` - (4) : `N`を`sizeof...(OtherIndexTypes)`としたとき - `(`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` && ...)`が`true` - - `(`[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_convertible.md)` && ...)`が`true` + - `(`[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)` && ...)`が`true` - `N ==` [`rank()`](rank.md) `|| N ==` [`rank_dynamic()`](rank_dynamic.md)が`true` - [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true` - [`is_default_constructible_v`](/reference/type_traits/is_default_constructible.md)``が`true` - (5), (6) : - `(`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` && ...)`が`true` - - `(`[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_convertible.md)` && ...)`が`true` + - `(`[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)` && ...)`が`true` - `N ==` [`rank()`](rank.md) `|| N ==` [`rank_dynamic()`](rank_dynamic.md)が`true` - [`is_constructible_v`](/reference/type_traits/is_constructible.md)``が`true` - [`is_default_constructible_v`](/reference/type_traits/is_default_constructible.md)``が`true` diff --git a/reference/tuple/tuple/basic_common_reference.md b/reference/tuple/tuple/basic_common_reference.md index 8d0fd167b3..705fa4e1ca 100644 --- a/reference/tuple/tuple/basic_common_reference.md +++ b/reference/tuple/tuple/basic_common_reference.md @@ -15,7 +15,7 @@ template(x)`のようにしてコンストラクタに渡される @@ -301,7 +301,7 @@ p8 : (X(1 2 3),Y(4 5)) - [P1951R1 Default Arguments for `pair`'s Forwarding Constructor](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1951r1.html) - C++23での`{}`完全転送への対応 - [P2165R4 Compatibility between `tuple`, `pair` and *tuple-like* objects](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2165r4.pdf) - - [`pair-like`](/reference/tuple/tuple-like.md)なオブジェクトからの構築 + - [`pair-like`](/reference/tuple/pair-like.md)なオブジェクトからの構築 - [P2255R2 A type trait to detect reference binding to temporary](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2255r2.html) - 参照型を要素に持つ場合にダングリング参照が容易に作成できていたのを不適格にする - [P2321R2 `zip`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2321r2.html#pair) From 5426d39757547d882af261263c69f36514a122a6 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sun, 24 Aug 2025 01:37:37 +0900 Subject: [PATCH 2325/3948] =?UTF-8?q?typo=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/type_traits/is_class.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/type_traits/is_class.md b/reference/type_traits/is_class.md index 90e661cf4d..8080ad1889 100644 --- a/reference/type_traits/is_class.md +++ b/reference/type_traits/is_class.md @@ -75,7 +75,7 @@ int main(){} - [Visual C++](/implementation.md#visual_cpp): 2008 (std::tr1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] #### 備考 -上の例でコンパイラによってはエラーになる。GCC 4.3.4, 4.5.3, Visual C++ 2010 は [`integral_constant`](integral_constant.md) が `operator bool()` を持っていないためエラーになる。また、GCC 4.3.4, Visual C++ 2010 は `enum class` に対応していたいためにエラーになる。 +上の例でコンパイラによってはエラーになる。GCC 4.3.4, 4.5.3, Visual C++ 2010 は [`integral_constant`](integral_constant.md) が `operator bool()` を持っていないためエラーになる。また、GCC 4.3.4, Visual C++ 2010 は `enum class` に対応していないためエラーになる。 ## 参照 From b0477cffc619e9fb7dc93c5821c4a70973054bc4 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sun, 24 Aug 2025 01:55:29 +0900 Subject: [PATCH 2326/3948] =?UTF-8?q?=E7=B9=B0=E3=82=8A=E8=BF=94=E3=81=97?= =?UTF-8?q?=E3=82=BF=E3=82=A4=E3=83=97=E3=81=AEtypo=E3=81=AE=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 「メンバ関数関数」のように言葉を繰り返しているtypoを対象としています。 正規表現 ([\u0080-\uffff]{2,})\1 で絞り込んだ結果を確認し、意味の通らないものを修正しました。 --- lang/cpp11.md | 2 +- lang/cpp11/noexcept.md | 2 +- reference/charconv/from_chars.md | 2 +- reference/cmath/fp_nan.md | 2 +- reference/cmath/llrint.md | 2 +- reference/cmath/lrint.md | 2 +- reference/cmath/nearbyint.md | 2 +- reference/cmath/rint.md | 2 +- reference/cstdio/fpos_t.md | 2 +- reference/filesystem/path/is_absolute.md | 2 +- reference/map.md | 2 +- reference/map/map.md | 2 +- reference/map/multimap.md | 2 +- reference/set.md | 2 +- reference/type_traits/make_signed.md | 2 +- reference/type_traits/make_unsigned.md | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lang/cpp11.md b/lang/cpp11.md index 5b69710f74..37efe43e9a 100644 --- a/lang/cpp11.md +++ b/lang/cpp11.md @@ -181,7 +181,7 @@ C++11では、参照するC言語の規格がC89からC99に変更となり、C9 - 関数ポインタと関数オブジェクトを統一的に扱えるクラス[`std::function`](/reference/functional/function.md)を追加 - 関数の引数を束縛して部分適用する関数[`std::bind()`](/reference/functional/bind.md)を追加 - メンバ関数ポインタを関数オブジェクトにアダプトする関数[`std::mem_fn()`](/reference/functional/mem_fn.md)を追加 -- テンプレートに、明示的に左辺値参照を渡すための渡すためのクラス[`std::reference_wrapper`](/reference/functional/reference_wrapper.md)と、そのヘルパ関数である[`std::ref()`](/reference/functional/ref.md)と[`std::cref()`](/reference/functional/cref.md)を追加 +- テンプレートに、明示的に左辺値参照を渡すためのクラス[`std::reference_wrapper`](/reference/functional/reference_wrapper.md)と、そのヘルパ関数である[`std::ref()`](/reference/functional/ref.md)と[`std::cref()`](/reference/functional/cref.md)を追加 - ハッシュ表コンテナの追加にともない、オブジェクトのハッシュ値を計算する関数オブジェクト[`std::hash`](/reference/functional/hash.md)クラスを追加 - ビット演算の関数オブジェクトとして、[`std::bit_and`](/reference/functional/bit_and.md)、[`std::bit_or`](/reference/functional/bit_or.md)、[`std::bit_xor`](/reference/functional/bit_xor.md)を追加 - 従来の関数オブジェクトアダプタ`std::unary_function`、`std::binary_function`、`std::mem_fun()`、`std::mem_fun_ref()`等を非推奨とする diff --git a/lang/cpp11/noexcept.md b/lang/cpp11/noexcept.md index 461dedd5c0..815ed6c7c5 100644 --- a/lang/cpp11/noexcept.md +++ b/lang/cpp11/noexcept.md @@ -83,7 +83,7 @@ struct X { int f() const noexcept; // noexcept例外仕様 // 外側はnoexcept例外仕様、内側はnoexcept演算子。 - // メンバ関数関数f()が例外を送出しない場合、関数g()もまた例外を送出しない + // メンバ関数f()が例外を送出しない場合、関数g()もまた例外を送出しない int g() const noexcept(noexcept(f())) { return f(); } }; diff --git a/reference/charconv/from_chars.md b/reference/charconv/from_chars.md index 407346b19c..dbdf192422 100644 --- a/reference/charconv/from_chars.md +++ b/reference/charconv/from_chars.md @@ -287,7 +287,7 @@ int main() const char str[] = "00000123456789 is decimal"; //(1) 10進数文字列からintへ変換 - //変換変換の成否判定に`operator bool`を使用 + //変換の成否判定に`operator bool`を使用 if (int value{}; std::from_chars(std::begin(str), std::end(str), value)) { std::cout << value << std::endl; } diff --git a/reference/cmath/fp_nan.md b/reference/cmath/fp_nan.md index d681b3a44c..ca001cc1d3 100644 --- a/reference/cmath/fp_nan.md +++ b/reference/cmath/fp_nan.md @@ -9,7 +9,7 @@ * integer-constant-expression[italic] ## 概要 -浮動小数点数が `NaN` であることを表すを表す整数定数式。 +浮動小数点数が `NaN` であることを表す整数定数式。 ## 備考 diff --git a/reference/cmath/llrint.md b/reference/cmath/llrint.md index f9ce5d8aee..fa84b63200 100644 --- a/reference/cmath/llrint.md +++ b/reference/cmath/llrint.md @@ -42,7 +42,7 @@ namespace std { - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 - 丸めの結果が `long long` で表現不可能な場合、無効演算の浮動小数点例外([`FE_INVALID`](../cfenv/fe_invalid.md))が発生する。 - 他の例外が発生しておらず、引数 `x` が戻り値と異なってる場合、不正確結果の浮動小数点例外([`FE_INEXACT`](../cfenv/fe_inexact.md))が発生する。 -- C99 では、丸めモードや浮動小数点例外へのアクセスには `#pragma STDC FENV_ACCESS ON` でなければなければならないと記載されているが、C++ には該当する記載を見つけることができなかった。 +- C99 では、丸めモードや浮動小数点例外へのアクセスには `#pragma STDC FENV_ACCESS ON` でなければならないと記載されているが、C++ には該当する記載を見つけることができなかった。 なお、C99 でも `FENV_ACCESS` のデフォルトは処理系定義である。 - 丸めモード [`FE_TONEAREST`](../cfenv/fe_tonearest.md) は四捨五入ではなく、最近接偶数への丸めであることに注意。(例を参照) 四捨五入が必要であれば、[`llround`](llround.md) を使用すること。(ただし、[`llround`](llround.md) は本関数と異なり、ISO IEC 60559 に準拠していても [`FE_INEXACT`](../cfenv/fe_inexact.md) が発生するか否かは処理系定義である) diff --git a/reference/cmath/lrint.md b/reference/cmath/lrint.md index 275b9f3ae0..62e4d6c0a0 100644 --- a/reference/cmath/lrint.md +++ b/reference/cmath/lrint.md @@ -41,7 +41,7 @@ namespace std { - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 - 丸めの結果が `long` で表現不可能な場合、無効演算の浮動小数点例外([`FE_INVALID`](../cfenv/fe_invalid.md))が発生する。 - 他の例外が発生しておらず、引数 `x` が戻り値と異なってる場合、不正確結果の浮動小数点例外([`FE_INEXACT`](../cfenv/fe_inexact.md))が発生する。 -- C99 では、丸めモードや浮動小数点例外へのアクセスには `#pragma STDC FENV_ACCESS ON` でなければなければならないと記載されているが、C++ には該当する記載を見つけることができなかった。 +- C99 では、丸めモードや浮動小数点例外へのアクセスには `#pragma STDC FENV_ACCESS ON` でなければならないと記載されているが、C++ には該当する記載を見つけることができなかった。 なお、C99 でも `FENV_ACCESS` のデフォルトは処理系定義である。 - 丸めモード [`FE_TONEAREST`](../cfenv/fe_tonearest.md) は単なる四捨五入ではないことに注意。 四捨五入が必要であれば、[`lround`](lround.md) を使用すること。(ただし、[`lround`](lround.md) は本関数と異なり、ISO IEC 60559 に準拠していても [`FE_INEXACT`](../cfenv/fe_inexact.md) が発生するか否かは処理系定義である) diff --git a/reference/cmath/nearbyint.md b/reference/cmath/nearbyint.md index b12acb4598..41a75a6e82 100644 --- a/reference/cmath/nearbyint.md +++ b/reference/cmath/nearbyint.md @@ -43,7 +43,7 @@ namespace std { - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 - `x = ±0` の場合、`±0` を返す。 - `x = ±∞` の場合、`±∞` を返す。 -- C99 では、丸めモードの設定時には `#pragma STDC FENV_ACCESS ON` でなければなければならないと記載されているが、C++ には該当する記載を見つけることができなかった。 +- C99 では、丸めモードの設定時には `#pragma STDC FENV_ACCESS ON` でなければならないと記載されているが、C++ には該当する記載を見つけることができなかった。 なお、C99 でも `FENV_ACCESS` のデフォルトは処理系定義である。 - 丸めモード [`FE_TONEAREST`](../cfenv/fe_tonearest.md) は単なる四捨五入ではないことに注意。 - C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された diff --git a/reference/cmath/rint.md b/reference/cmath/rint.md index 00fd095b23..74270d4fc3 100644 --- a/reference/cmath/rint.md +++ b/reference/cmath/rint.md @@ -44,7 +44,7 @@ namespace std { - `x = ±0` の場合、`±0` を返す。 - `x = ±∞` の場合、`±∞` を返す。 - 引数 `x` が戻り値と異なってる場合、[`FE_INEXACT`](../cfenv/fe_inexact.md) が発生する。 -- C99 では、丸めモードの設定時には `#pragma STDC FENV_ACCESS ON` でなければなければならないと記載されているが、C++ には該当する記載を見つけることができなかった。 +- C99 では、丸めモードの設定時には `#pragma STDC FENV_ACCESS ON` でなければならないと記載されているが、C++ には該当する記載を見つけることができなかった。 なお、C99 でも `FENV_ACCESS` のデフォルトは処理系定義である。 - 丸めモード [`FE_TONEAREST`](../cfenv/fe_tonearest.md) は単なる四捨五入ではないことに注意。 - C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された diff --git a/reference/cstdio/fpos_t.md b/reference/cstdio/fpos_t.md index cee012fd60..9c1a6e3561 100644 --- a/reference/cstdio/fpos_t.md +++ b/reference/cstdio/fpos_t.md @@ -13,7 +13,7 @@ namespace std { ## 概要 ファイルの位置を保持するための型。 -[`fgetpos()`](/reference/cstdio/fgetpos.md.nolink)関数や[`fsetpos()`](/reference/cstdio/fsetpos.md.nolink)関数で用いられる。これらの関数は[`fseek()`](/reference/cstdio/fseek.md.nolink)関数や[`ftell()`](/reference/cstdio/ftell.md.nolink)関数と違い、巨大なファイルやマルチバイトファイルに対しても適切に動作するすることを目的に設計された。 +[`fgetpos()`](/reference/cstdio/fgetpos.md.nolink)関数や[`fsetpos()`](/reference/cstdio/fsetpos.md.nolink)関数で用いられる。これらの関数は[`fseek()`](/reference/cstdio/fseek.md.nolink)関数や[`ftell()`](/reference/cstdio/ftell.md.nolink)関数と違い、巨大なファイルやマルチバイトファイルに対しても適切に動作することを目的に設計された。 ## 例 ```cpp example diff --git a/reference/filesystem/path/is_absolute.md b/reference/filesystem/path/is_absolute.md index d84d415e30..d3393e8301 100644 --- a/reference/filesystem/path/is_absolute.md +++ b/reference/filesystem/path/is_absolute.md @@ -12,7 +12,7 @@ bool is_absolute() const; ## 概要 パスが絶対パスかを判定する。 -絶対パスとは、追加の開始位置を必要とせずに、曖昧さなく特定の場所の場所を参照できるパスのことである。その定義はOSに依存する。 +絶対パスとは、追加の開始位置を必要とせずに、曖昧さなく特定の場所を参照できるパスのことである。その定義はOSに依存する。 ## 戻り値 パスが絶対パスであれば`true`、そうでなければ`false`を返す。 diff --git a/reference/map.md b/reference/map.md index a27e6de670..dfc4a6cbf9 100644 --- a/reference/map.md +++ b/reference/map.md @@ -3,7 +3,7 @@ `map`と`multimap`はユニークな要素を格納する連想コンテナの一種であり、キーとそれに対応する値を格納する。 `map`はキーの重複を許さず、`multimap`はキーの重複を許す。 -連想コンテナは特にそれらキーによる要素アクセスが効率的になるようよう設計されたコンテナである(要素への相対位置または絶対位置によるアクセスが効率的であるシーケンシャルコンテナとは異なる)。 +連想コンテナは特にそれらキーによる要素アクセスが効率的になるよう設計されたコンテナである(要素への相対位置または絶対位置によるアクセスが効率的であるシーケンシャルコンテナとは異なる)。 内部的には、`map` 内の要素は、コンテナの構築時に設定された[狭義の弱順序](/reference/algorithm.md#strict-weak-ordering)基準に従って小さいものから大きいものへとソートされる。 `map`と`multimap`は一般的に、二分木として実装される。従って、連想コンテナである `map`や`multimap` の主な特性は以下の通りである。 diff --git a/reference/map/map.md b/reference/map/map.md index d72cc475e5..bb61e0f660 100644 --- a/reference/map/map.md +++ b/reference/map/map.md @@ -27,7 +27,7 @@ namespace std { ## 概要 `map` はユニークな要素を格納する連想コンテナの一種であり、キーとそれに対応する値を格納する。 -連想コンテナは特にそれらキーによる要素アクセスが効率的になるようよう設計されたコンテナである(要素への相対位置または絶対位置によるアクセスが効率的であるシーケンシャルコンテナとは異なる)。 +連想コンテナは特にそれらキーによる要素アクセスが効率的になるよう設計されたコンテナである(要素への相対位置または絶対位置によるアクセスが効率的であるシーケンシャルコンテナとは異なる)。 内部的には、`map` 内の要素は、コンテナの構築時に設定された[狭義の弱順序](/reference/algorithm.md#strict-weak-ordering)基準に従って小さいものから大きいものへとソートされる。 diff --git a/reference/map/multimap.md b/reference/map/multimap.md index 0db7e98868..060cba1795 100644 --- a/reference/map/multimap.md +++ b/reference/map/multimap.md @@ -29,7 +29,7 @@ namespace std { ## 概要 `multimap` は同一キーの要素を複数格納できる連想コンテナの一種であり、キーとそれに対応する値を格納する。 -連想コンテナは特にそれらキーによる要素アクセスが効率的になるようよう設計されたコンテナである(要素への相対位置または絶対位置によるアクセスが効率的であるシーケンシャルコンテナとは異なる)。 +連想コンテナは特にそれらキーによる要素アクセスが効率的になるよう設計されたコンテナである(要素への相対位置または絶対位置によるアクセスが効率的であるシーケンシャルコンテナとは異なる)。 内部的には、`multimap` 内の要素は、コンテナの構築時に設定された[狭義の弱順序](/reference/algorithm.md#strict-weak-ordering)基準に従って小さいものから大きいものへとソートされる。 diff --git a/reference/set.md b/reference/set.md index 57d0d5ddf5..480f10c4d0 100644 --- a/reference/set.md +++ b/reference/set.md @@ -4,7 +4,7 @@ ``ヘッダは、集合を表す連想コンテナ、`set`と`multiset`を定義する。 `set`はキーの重複を許可しないが、`multiset`はキーの重複を許可する。 -連想コンテナは特にそれらキーによる要素アクセスが効率的になるようよう設計されたコンテナである(要素への相対位置または絶対位置によるアクセスが効率的であるシーケンシャルコンテナとは異なる)。 +連想コンテナは特にそれらキーによる要素アクセスが効率的になるよう設計されたコンテナである(要素への相対位置または絶対位置によるアクセスが効率的であるシーケンシャルコンテナとは異なる)。 内部的には、`set` 内の要素は、コンテナの構築時に設定された[狭義の弱順序](/reference/algorithm.md#strict-weak-ordering)基準に従って小さいものから大きいものへとソートされる。 `set`と`multiset`は一般的に、二分木として実装される。従って、連想コンテナである `set`や`multiset` の主な特性は以下の通りである。 diff --git a/reference/type_traits/make_signed.md b/reference/type_traits/make_signed.md index 6b270bfa79..add5caf5f0 100644 --- a/reference/type_traits/make_signed.md +++ b/reference/type_traits/make_signed.md @@ -75,7 +75,7 @@ int main() {} - [Clang](/implementation.md#clang): 3.0 [mark verified] - [GCC](/implementation.md#gcc): 4.4.7 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - - 2010は、cv修飾修飾されている型において、コンパイルエラーになるバグがある。 + - 2010は、cv修飾されている型において、コンパイルエラーになるバグがある。 - `make_signed_t`は2013から diff --git a/reference/type_traits/make_unsigned.md b/reference/type_traits/make_unsigned.md index 64e715dcf5..7ebfccc7d1 100644 --- a/reference/type_traits/make_unsigned.md +++ b/reference/type_traits/make_unsigned.md @@ -75,7 +75,7 @@ int main() {} - [Clang](/implementation.md#clang): 3.0 [mark verified] - [GCC](/implementation.md#gcc): 4.4.7 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] - - 2010は、cv修飾修飾されている型において、コンパイルエラーになるバグがある。 + - 2010は、cv修飾されている型において、コンパイルエラーになるバグがある。 - `make_unsigned_t`は2013から From c08b3efbd87e926a53e7b73047b5f957c0f0a2f8 Mon Sep 17 00:00:00 2001 From: yoh Date: Sun, 24 Aug 2025 17:32:25 +0900 Subject: [PATCH 2327/3948] execution: C++26 P3481R5 (#1508) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - bulkアルゴリズム 引数追加,仕様変更 - bulk_(un)chunkedアルゴリズム --- reference/execution/execution.md | 3 + reference/execution/execution/bulk.md | 104 ++++------- reference/execution/execution/bulk_chunked.md | 174 ++++++++++++++++++ .../execution/execution/bulk_unchunked.md | 149 +++++++++++++++ 4 files changed, 365 insertions(+), 65 deletions(-) create mode 100644 reference/execution/execution/bulk_chunked.md create mode 100644 reference/execution/execution/bulk_unchunked.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index de097fd928..f79288d409 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -124,6 +124,8 @@ namespace std::execution { | [`execution::let_error`](execution/let_error.md) | エラー完了結果から入れ子の非同期操作へ変換 (customization point object) | C++26 | | [`execution::let_stopped`](execution/let_stopped.md) | 停止完了を入れ子の非同期操作へ変換 (customization point object) | C++26 | | [`execution::bulk`](execution/bulk.md) | インデクス空間上で指定関数を反復実行 (customization point object) | C++26 | +| [`execution::bulk_chunked`](execution/bulk_chunked.md) | インデクス空間を分割チャンク単位で指定関数を反復実行 (customization point object) | C++26 | +| [`execution::bulk_unchunked`](execution/bulk_unchunked.md) | インデクス空間の各インデクス単位で指定関数を反復実行 (customization point object) | C++26 | | [`execution::when_all`](execution/when_all.md) | 全ての入力Sender完了を待機 (customization point object) | C++26 | | [`execution::when_all_with_variant`](execution/when_all_with_variant.md) | 複数の値完了シグネチャをもつ全ての入力Sender完了を待機 (customization point object) | C++26 | | [`execution::into_variant`](execution/into_variant.md) | 複数の値完了シグネチャを単一[`variant`](/reference/variant/variant.md)型の値完了シグネチャに変換 (customization point object) | C++26 | @@ -166,6 +168,7 @@ Senderコンシューマは名前空間 `std::this_thread` で定義される。 - [P0024R2 The Parallelism TS Should be Standardized](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0024r2.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) - [P3284R4 `write_env` and `unstoppable` Sender Adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3284r4.html) +- [P3481R5 `std::execution::bulk()` issues](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3481r5.html) - [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) - [P3570R2 optional variants in sender/receiver](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3570r2.html) - [P3682R0 Remove `std::execution::split`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3682r0.pdf) diff --git a/reference/execution/execution/bulk.md b/reference/execution/execution/bulk.md index fc2f1cad1e..89daedf6e8 100644 --- a/reference/execution/execution/bulk.md +++ b/reference/execution/execution/bulk.md @@ -19,98 +19,65 @@ namespace std::execution { ## 効果 -説明用の式`sndr`, `shape`, `f`に対して、型`Shape`を`decltype(auto(shape))`とする。下記いずれかの条件をみたすとき、呼び出し式`bulk(sndr, shape, f)`は不適格となる。 +説明用の式`sndr`, `policy`, `shape`, `f`に対して、型`Policy`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``、型`Shape`を`decltype(auto(shape))`、型`Func`を[`decay_t`](/reference/type_traits/decay.md)``とする。下記いずれかの条件をみたすとき、呼び出し式`bulk(sndr, policy, shape, f)`は不適格となる。 - `decltype((sndr))`が[`sender`](sender.md)を満たさない、もしくは +- [`is_execution_policy_v`](../is_execution_policy.md)` == false`、もしくは - `Shape`が[`integral`](/reference/concepts/integral.md)を満たさない、もしくは -- `decltype((f))`が[`movable-value`](../movable-value.md)を満たさないとき。 +- `Func`が[`copy_constructible`](/reference/concepts/copy_constructible.md)のモデルでないとき。 -そうでなければ、呼び出し式`bulk(sndr, shape, f)`は`sndr`が1回だけ評価されることを除いて、下記と等価。 +そうでなければ、呼び出し式`bulk(sndr, policy, shape, f)`は`sndr`が1回だけ評価されることを除いて、下記と等価。 ```cpp -transform_sender(get-domain-early(sndr), make-sender(bulk, product-type{shape, f}, sndr)) +transform_sender( + get-domain-early(sndr), + make-sender(bulk, product-type{policy, shape, f}, sndr)) ``` * transform_sender[link transform_sender.md] * get-domain-early[link get-domain-early.md] * make-sender[link make-sender.md] * product-type[link product-type.md] +`product-type`の第1テンプレート引数は、`Policy`が[`copy_constructible`](/reference/concepts/copy_constructible.md)のモデルであるとき`Policy`となる。そうでなければ、`const Policy&`となる。 -### Senderアルゴリズムタグ `bulk` -Senderアルゴリズム動作説明用のクラステンプレート[`impls-for`](impls-for.md)に対して、下記の特殊化が定義される。 -```cpp -namespace std::execution { - template<> - struct impls-for : default-impls { - static constexpr auto complete = see below; +### Senderアルゴリズムタグ `bulk_t` +説明用の式`sndr`と`env`に対して、型`Sndr`を`decltype((sndr))`とする。[`sender-for`](sender-for.md)` == false`のとき、式`bulk.transform_sender(sndr, env)`は不適格となる。 - template - static consteval void check-types(); - }; -} -``` -* impls-for[link impls-for.md] -* default-impls[link impls-for.md] - -`impls-for::complete`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 +そうでなければ、式`bulk.transform_sender(sndr, env)`は下記と等価。 ```cpp -[] - (Index, State& state, Rcvr& rcvr, Tag, Args&&... args) noexcept -> void requires see below { - if constexpr (same_as) { - auto& [shape, f] = state; - constexpr bool nothrow = noexcept(f(auto(shape), args...)); - TRY-EVAL(rcvr, [&]() noexcept(nothrow) { - for (decltype(auto(shape)) i = 0; i < shape; ++i) { - f(auto(i), args...); - } - Tag()(std::move(rcvr), std::forward(args)...); - }()); - } else { - Tag()(std::move(rcvr), std::forward(args)...); - } - } +auto [_, data, child] = sndr; +auto& [policy, shape, f] = data; +auto new_f = [func = std::move(f)](Shape begin, Shape end, auto&&... vs) + noexcept(noexcept(f(begin, vs...))) { + while (begin != end) func(begin++, vs...); +} +return bulk_chunked(std::move(child), policy, shape, std::move(new_f)); ``` -* set_value_t[link set_value.md] -* TRY-EVAL[link set_value.md] +* bulk_chunked[link bulk_chunked.md] * std::move[link /reference/utility/move.md] -型`Tag`が[`set_value_t`](set_value.md)以外の型であるとき、もしくは式`f(auto(shape), args...)`が適格なときに限って、上記ラムダ式のrequires節が満たされる。 - -メンバ関数`impls-for::check-types`の効果は下記の通り。 - -```cpp -auto cs = get_completion_signatures, FWD-ENV-T(Env)...>(); -auto fn = [](set_value_t(*)(Ts...)) { - if constexpr (!invocable>, Ts&...>) - throw unspecified-exception(); -}; -cs.for-each(overload-set{fn, [](auto){}}); -``` -* get_completion_signatures[link get_completion_signatures.md] -* child-type[link child-type.md] -* FWD-ENV-T[link ../forwarding_query.md] -* set_value_t[link set_value.md] -* data-type[link data-type.md] -* for-each[link completion_signatures.md] -* overload-set[link overload-set.md] - -`unspecified-exception`は[`exception`](/reference/exception/exception.md)から派生した型となる。 - ## カスタマイゼーションポイント Senderアルゴリズム構築時および[Receiver](receiver.md)接続時に、関連付けられた実行ドメインに対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 [デフォルト実行ドメイン](default_domain.md)では無変換。 -説明用の式`out_sndr`を`bulk(sndr, shape, f)`の戻り値[Sender](sender.md)とし、式`rcvr`を式[`connect`](connect.md)`(out_sndr, rcvr)`が適格となる[Receiver](receiver.md)とする。式[`connect`](connect.md)`(out_sndr, rcvr)`は[開始(start)](start.md)時に下記を満たす非同期操作を生成しない場合、動作は未定義となる。 +説明用の式`out_sndr`を`bulk(sndr, policy, shape, f)`の戻り値[Sender](sender.md)とし、式`rcvr`を式[`connect`](connect.md)`(out_sndr, rcvr)`が適格となる[Receiver](receiver.md)とする。式[`connect`](connect.md)`(out_sndr, rcvr)`は[開始(start)](start.md)時に下記を満たす非同期操作を生成しない場合、動作は未定義となる。 -- 値完了操作において、パック`args`を入力[Sender](sender.md)の値完了結果データを参照する左辺値式としたとき、型`Shape`の半開区間`[0, Shape)`における全ての`i`に対して`f(i, args...)`を呼び出すこと。 -- `sndr`により送信された全ての完了操作を伝搬すること。 +- 説明用の`args`を`sndr`の値完了結果を参照する左辺値式のパック、または[`copy_constructible`](/reference/concepts/copy_constructible.md)のモデルであるならばそれらの値のdecayコピーのパックとする。`sndr`が値完了したとき、 + - `out_sndr`もまた値完了するとき、`0`から`shape`までの型`Shape`の全ての`i`に対して`f(i, args...)`を呼び出す。 + - `out_sndr`が[`set_error`](set_error.md)`(rcvr, eptr)`で完了するとき、エラー完了ハンドラが呼び出される前に非同期操作は`f`呼び出しのサブセットを呼び出す可能性があり、`eptr`は下記いずれかを指す[`exception_ptr`](/reference/exception/exception_ptr.md)となる。 + - `f`呼び出しから送出された例外、または + - 処理系が要求リソースの確保に失敗したときは[`bad_alloc`](/reference/new/bad_alloc.md)例外、または + - [`runtime_error`](/reference/stdexcept.md)から派生された例外。 + - `out_sndr`が[`set_stopped`](set_stopped.md)`(rcvr)`で完了するとき、停止完了ハンドラが呼び出される前に非同期操作は`f`呼び出しのサブセットを呼び出す可能性がある。 +- `sndr`が[`set_value`](set_value.md)で完了しないとき、その完了操作は`recv`に転送される。 +- パラメータ`policy`は、アルゴリズムに対応した非同期操作の実行を並列化する方法、および`f`に適用する方法を規程する。並列アルゴリズム要素アクセス関数に対する権限と要件は`f`に適用される。 ## 備考 -非同期実行フレームワークで定義される[デフォルト実行ドメイン](default_domain.md)では、`bulk`に指定したタスク`f`は単一スレッド上で逐次実行される。 +`bulk`アルゴリズムを直接カスタマイズしない実行ドメインであっても、`bulk`の動作は[Receiver](receiver.md)接続時に変換される[`bulk_chunked`](bulk_chunked.md)へ委譲される。 ## 例 @@ -123,7 +90,7 @@ int main() { ex::sender auto sndr = ex::just() - | ex::bulk(3, [](int i) { + | ex::bulk(3, ex::seq, [](int i) { std::println("{}", i); }); std::this_thread::sync_wait(sndr); @@ -132,9 +99,10 @@ int main() * ex::bulk[color ff0000] * ex::sender[link sender.md] * ex::just[link just.md] +* ex::seq[link execution_policy.md] * std::this_thread::sync_wait[link ../this_thread/sync_wait.md] -### 出力例 +### 出力 ``` 0 1 @@ -153,7 +121,13 @@ int main() - [Visual C++](/implementation.md#visual_cpp): ?? +## 関連項目 +- [`execution::bulk_chunked`](bulk_chunked.md) +- [`execution::bulk_unchunked`](bulk_unchunked.md) + + ## 参照 - [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3481R5 `std::execution::bulk()` issues](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3481r5.html) - [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) diff --git a/reference/execution/execution/bulk_chunked.md b/reference/execution/execution/bulk_chunked.md new file mode 100644 index 0000000000..4f09c79434 --- /dev/null +++ b/reference/execution/execution/bulk_chunked.md @@ -0,0 +1,174 @@ +# bulk_chunked +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct bulk_chunked_t { unspecified }; + inline constexpr bulk_chunked_t bulk_chunked{}; +} +``` +* unspecified[italic] + +## 概要 +`bulk_chunked`は、インデクス空間を区間分割したチャンク単位でタスクを反復実行するSenderアダプタである。 + +`bulk_chunked`は[パイプ可能Senderアダプタオブジェクト](sender_adaptor_closure.md)であり、パイプライン記法をサポートする。 + + +## 効果 +説明用の式`sndr`, `policy`, `shape`, `f`に対して、型`Policy`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``、型`Shape`を`decltype(auto(shape))`、型`Func`を[`decay_t`](/reference/type_traits/decay.md)``とする。下記いずれかの条件をみたすとき、呼び出し式`bulk_chunked(sndr, policy, shape, f)`は不適格となる。 + +- `decltype((sndr))`が[`sender`](sender.md)を満たさない、もしくは +- [`is_execution_policy_v`](../is_execution_policy.md)` == false`、もしくは +- `Shape`が[`integral`](/reference/concepts/integral.md)を満たさない、もしくは +- `Func`が[`copy_constructible`](/reference/concepts/copy_constructible.md)のモデルでないとき。 + +そうでなければ、呼び出し式`bulk_chunked(sndr, policy, shape, f)`は`sndr`が1回だけ評価されることを除いて、下記と等価。 + +```cpp +transform_sender( + get-domain-early(sndr), + make-sender(bulk_chunked, product-type{policy, shape, f}, sndr)) +``` +* transform_sender[link transform_sender.md] +* get-domain-early[link get-domain-early.md] +* make-sender[link make-sender.md] +* product-type[link product-type.md] + +`product-type`の第1テンプレート引数は、`Policy`が[`copy_constructible`](/reference/concepts/copy_constructible.md)のモデルであるとき`Policy`となる。そうでなければ、`const Policy&`となる。 + + +### Senderアルゴリズムタグ `bulk_chunked_t` +Senderアルゴリズム動作説明用のクラステンプレート[`impls-for`](impls-for.md)に対して、下記の特殊化が定義される。 + +```cpp +namespace std::execution { + template<> + struct impls-for : default-impls { + static constexpr auto complete = see below; + + template + static consteval void check-types(); + }; +} +``` +* impls-for[link impls-for.md] +* default-impls[link impls-for.md] + +`impls-for::complete`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 + +```cpp +[] + (Index, State& state, Rcvr& rcvr, Tag, Args&&... args) noexcept + -> void requires see below { + if constexpr (same_as) { + auto& [policy, shape, f] = state; + constexpr bool nothrow = noexcept(f(auto(shape), auto(shape), args...)); + TRY-EVAL(rcvr, [&]() noexcept(nothrow) { + f(static_cast(0), auto(shape), args...); + Tag()(std::move(rcvr), std::forward(args)...); + }()); + } else { + Tag()(std::move(rcvr), std::forward(args)...); + } + } +``` +* set_value_t[link set_value.md] +* TRY-EVAL[link set_value.md] +* std::move[link /reference/utility/move.md] + +型`Tag`が[`set_value_t`](set_value.md)以外の型であるとき、もしくは式`f(auto(shape), auto(shape), args...)`が適格なときに限って、上記ラムダ式のrequires節が満たされる。 + +メンバ関数`impls-for::check-types`の効果は下記の通り。 + +```cpp +auto cs = get_completion_signatures, FWD-ENV-T(Env)...>(); +auto fn = [](set_value_t(*)(Ts...)) { + if constexpr (!invocable>, Ts&...>) + throw unspecified-exception(); +}; +cs.for-each(overload-set{fn, [](auto){}}); +``` +* get_completion_signatures[link get_completion_signatures.md] +* child-type[link child-type.md] +* FWD-ENV-T[link ../forwarding_query.md] +* set_value_t[link set_value.md] +* data-type[link data-type.md] +* for-each[link completion_signatures.md] +* overload-set[link overload-set.md] + +`unspecified-exception`は[`exception`](/reference/exception/exception.md)から派生した型となる。 + + +## カスタマイゼーションポイント +Senderアルゴリズム構築時および[Receiver](receiver.md)接続時に、関連付けられた実行ドメインに対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 +[デフォルト実行ドメイン](default_domain.md)では無変換。 + +説明用の式`out_sndr`を`bulk_chunked(sndr, policy, shape, f)`の戻り値[Sender](sender.md)とし、式`rcvr`を式[`connect`](connect.md)`(out_sndr, rcvr)`が適格となる[Receiver](receiver.md)とする。式[`connect`](connect.md)`(out_sndr, rcvr)`は[開始(start)](start.md)時に下記を満たす非同期操作を生成しない場合、動作は未定義となる。 + +- 説明用の`args`を`sndr`の値完了結果を参照する左辺値式のパック、または[`copy_constructible`](/reference/concepts/copy_constructible.md)のモデルであるならばそれらの値のdecayコピーのパックとする。`sndr`が値完了したとき、 + - `out_sndr`もまた値完了するとき、範囲`[0, shape]`にある型`Shape`の0個以上の`b`と`e`のペアに対して`f(b, e, args...)`を呼び出す。このとき`b < e`であり、かつ`0`から`shape`までの型`Shape`の全ての`i`において、`b`と`e`のペアに対して`i`が範囲`[b, e)`にあるような呼び出しが正確に1回だけ存在する。 + - `out_sndr`が[`set_error`](set_error.md)`(rcvr, eptr)`で完了するとき、エラー完了ハンドラが呼び出される前に非同期操作は`f`呼び出しのサブセットを呼び出す可能性があり、`eptr`は下記いずれかを指す[`exception_ptr`](/reference/exception/exception_ptr.md)となる。 + - `f`呼び出しから送出された例外、または + - 処理系が要求リソースの確保に失敗したときは[`bad_alloc`](/reference/new/bad_alloc.md)例外、または + - [`runtime_error`](/reference/stdexcept.md)から派生された例外。 + - `out_sndr`が[`set_stopped`](set_stopped.md)`(rcvr)`で完了するとき、停止完了ハンドラが呼び出される前に非同期操作は`f`呼び出しのサブセットを呼び出す可能性がある。 +- `sndr`が[`set_value`](set_value.md)で完了しないとき、その完了操作は`recv`に転送される。 +- パラメータ`policy`は、アルゴリズムに対応した非同期操作の実行を並列化する方法、および`f`に適用する方法を規程する。並列アルゴリズム要素アクセス関数に対する権限と要件は`f`に適用される。 + + + +## 例 +```cpp example +#include +#include +namespace ex = std::execution; + +int main() +{ + ex::sender auto sndr = + ex::just() + | ex::bulk_chunked(3, ex::seq, + [](int begin, int end) { + for (int i = begin; i < end; i++) { + std::println("{}", i); + } + }); + std::this_thread::sync_wait(sndr); +} +``` +* ex::bulk_chunked[color ff0000] +* ex::sender[link sender.md] +* ex::just[link just.md] +* ex::seq[link execution_policy.md] +* std::this_thread::sync_wait[link ../this_thread/sync_wait.md] + +### 出力 +``` +0 +1 +2 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::bulk`](bulk.md) +- [`execution::bulk_unchunked`](bulk_unchunked.md) + + +## 参照 +- [P3481R5 `std::execution::bulk()` issues](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3481r5.html) diff --git a/reference/execution/execution/bulk_unchunked.md b/reference/execution/execution/bulk_unchunked.md new file mode 100644 index 0000000000..72c19345d4 --- /dev/null +++ b/reference/execution/execution/bulk_unchunked.md @@ -0,0 +1,149 @@ +# bulk_unchunked +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct bulk_unchunked_t { unspecified }; + inline constexpr bulk_unchunked_t bulk_unchunked{}; +} +``` +* unspecified[italic] + +## 概要 +`bulk_unchunked`は、インデクス空間の各インデクスに対してタスクを反復実行するSenderアダプタである。 + +`bulk_unchunked`は[パイプ可能Senderアダプタオブジェクト](sender_adaptor_closure.md)であり、パイプライン記法をサポートする。 + + +## 効果 +説明用の式`sndr`, `policy`, `shape`, `f`に対して、型`Policy`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``、型`Shape`を`decltype(auto(shape))`、型`Func`を[`decay_t`](/reference/type_traits/decay.md)``とする。下記いずれかの条件をみたすとき、呼び出し式`bulk_unchunked(sndr, policy, shape, f)`は不適格となる。 + +- `decltype((sndr))`が[`sender`](sender.md)を満たさない、もしくは +- [`is_execution_policy_v`](../is_execution_policy.md)` == false`、もしくは +- `Shape`が[`integral`](/reference/concepts/integral.md)を満たさない、もしくは +- `Func`が[`copy_constructible`](/reference/concepts/copy_constructible.md)のモデルでないとき。 + +そうでなければ、呼び出し式`bulk_unchunked(sndr, policy, shape, f)`は`sndr`が1回だけ評価されることを除いて、下記と等価。 + +```cpp +transform_sender( + get-domain-early(sndr), + make-sender(bulk_unchunked, product-type{policy, shape, f}, sndr)) +``` +* transform_sender[link transform_sender.md] +* get-domain-early[link get-domain-early.md] +* make-sender[link make-sender.md] +* product-type[link product-type.md] + +`product-type`の第1テンプレート引数は、`Policy`が[`copy_constructible`](/reference/concepts/copy_constructible.md)のモデルであるとき`Policy`となる。そうでなければ、`const Policy&`となる。 + + +### Senderアルゴリズムタグ `bulk_unchunked_t` +Senderアルゴリズム動作説明用のクラステンプレート[`impls-for`](impls-for.md)に対して、下記の特殊化が定義される。 + +```cpp +namespace std::execution { + template<> + struct impls-for : default-impls { + static constexpr auto complete = see below; + }; +} +``` +* impls-for[link impls-for.md] +* default-impls[link impls-for.md] + +`impls-for::complete`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 + +```cpp +[] + (Index, State& state, Rcvr& rcvr, Tag, Args&&... args) noexcept + -> void requires see below { + if constexpr (same_as) { + auto& [shape, f] = state; + constexpr bool nothrow = noexcept(f(auto(shape), args...)); + TRY-EVAL(rcvr, [&]() noexcept(nothrow) { + for (decltype(auto(shape)) i = 0; i < shape; ++i) { + f(auto(i), args...); + } + Tag()(std::move(rcvr), std::forward(args)...); + }()); + } else { + Tag()(std::move(rcvr), std::forward(args)...); + } + } +``` +* set_value_t[link set_value.md] +* TRY-EVAL[link set_value.md] +* std::move[link /reference/utility/move.md] + +型`Tag`が[`set_value_t`](set_value.md)以外の型であるとき、もしくは式`f(auto(shape), args...)`が適格なときに限って、上記ラムダ式のrequires節が満たされる。 + + +## カスタマイゼーションポイント +Senderアルゴリズム構築時および[Receiver](receiver.md)接続時に、関連付けられた実行ドメインに対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 +[デフォルト実行ドメイン](default_domain.md)では無変換。 + +説明用の式`out_sndr`を`bulk_unchunked(sndr, policy, shape, f)`の戻り値[Sender](sender.md)とし、式`rcvr`を式[`connect`](connect.md)`(out_sndr, rcvr)`が適格となる[Receiver](receiver.md)とする。式[`connect`](connect.md)`(out_sndr, rcvr)`は[開始(start)](start.md)時に下記を満たす非同期操作を生成しない場合、動作は未定義となる。 + +- 説明用の`args`を`sndr`の値完了結果を参照する左辺値式のパック、または[`copy_constructible`](/reference/concepts/copy_constructible.md)のモデルであるならばそれらの値のdecayコピーのパックとする。`sndr`が値完了したとき、 + - `out_sndr`もまた値完了するとき、`0`から`shape`までの型`Shape`の全ての`i`に対して`f(i, args...)`を呼び出す。 + - `out_sndr`が[`set_error`](set_error.md)`(rcvr, eptr)`で完了するとき、エラー完了ハンドラが呼び出される前に非同期操作は`f`呼び出しのサブセットを呼び出す可能性があり、`eptr`は下記いずれかを指す[`exception_ptr`](/reference/exception/exception_ptr.md)となる。 + - `f`呼び出しから送出された例外、または + - 処理系が要求リソースの確保に失敗したときは[`bad_alloc`](/reference/new/bad_alloc.md)例外、または + - [`runtime_error`](/reference/stdexcept.md)から派生された例外。 + - `out_sndr`が[`set_stopped`](set_stopped.md)`(rcvr)`で完了するとき、停止完了ハンドラが呼び出される前に非同期操作は`f`呼び出しのサブセットを呼び出す可能性がある。 +- `sndr`が[`set_value`](set_value.md)で完了しないとき、その完了操作は`recv`に転送される。 +- パラメータ`policy`は、アルゴリズムに対応した非同期操作の実行を並列化する方法、および`f`に適用する方法を規程する。並列アルゴリズム要素アクセス関数に対する権限と要件は`f`に適用される。 + + +## 例 +```cpp example +#include +#include +namespace ex = std::execution; + +int main() +{ + ex::sender auto sndr = + ex::just() + | ex::bulk_unchunked(3, ex::seq, [](int i) { + std::println("{}", i); + }); + std::this_thread::sync_wait(sndr); +} +``` +* ex::bulk_unchunked[color ff0000] +* ex::sender[link sender.md] +* ex::just[link just.md] +* ex::seq[link execution_policy.md] +* std::this_thread::sync_wait[link ../this_thread/sync_wait.md] + +### 出力 +``` +0 +1 +2 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::bulk`](bulk.md) +- [`execution::bulk_chunked`](bulk_chunked.md) + + +## 参照 +- [P3481R5 `std::execution::bulk()` issues](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3481r5.html) From 377b4a45328416610750f94edb6960d49eafc720 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 25 Aug 2025 01:54:17 +0900 Subject: [PATCH 2328/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit リンクのテキストとアドレスが一致しないものを抽出し、リンクのテキストもしくはアドレスを修正しました。 --- lang/cpp26.md | 2 +- reference/cmath/nearbyint.md | 2 +- reference/cstddef/size_t.md | 2 +- reference/execution/execution/stopped_as_error.md | 2 +- reference/filesystem/proximate.md | 4 ++-- reference/initializer_list/initializer_list.md | 2 +- reference/iterator/move_iterator/op_increment.md | 2 +- reference/linalg/layout_blas_packed/mapping.md | 2 +- reference/memory/shared_ptr/atomic_load_explicit.md | 2 +- reference/mutex/timed_mutex.md | 2 +- reference/print.md | 2 +- reference/sstream/basic_stringbuf/view.md | 2 +- reference/string/basic_string/append.md | 2 +- reference/string/to_string.md | 2 +- reference/string_view/basic_string_view.md | 2 +- 15 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lang/cpp26.md b/lang/cpp26.md index 44f3e8b20a..d0922fb4de 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -438,7 +438,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [`begin()`](/reference/optional/optional/begin.md.nolink)メンバ関数 - [`end()`](/reference/optional/optional/end.md.nolink)メンバ関数 - [`std::optional`](/reference/optional/optional.md)に、参照を保持するための`T&`の部分特殊化を追加 -- [`std::tuple`](/reference/tuple/apply.md)の戻り値型推論をやめて、戻り値型用の[`std::apply_result`](/reference/tuple/apply_result.md.nolink)クラスを追加し、関連する以下の機能を追加 +- [`std::apply`](/reference/tuple/apply.md)の戻り値型推論をやめて、戻り値型用の[`std::apply_result`](/reference/tuple/apply_result.md.nolink)クラスを追加し、関連する以下の機能を追加 - [`std::is_applicable`](/reference/type_traits/is_applicable.md.nolink)型特性 - [`std::is_nothrow_applicable`](/reference/type_traits/is_nothrow_applicable.md.nolink)型特性 - [`std::ignore`](/reference/tuple/ignore.md)をファーストクラス・オブジェクトとして型を詳細に定義 diff --git a/reference/cmath/nearbyint.md b/reference/cmath/nearbyint.md index 41a75a6e82..4f47d9ab55 100644 --- a/reference/cmath/nearbyint.md +++ b/reference/cmath/nearbyint.md @@ -38,7 +38,7 @@ namespace std { ## 備考 -- 本関数と [`rint`](rint.md) は戻り値は同一であるが、本関数は引数 `x` が戻り値と異なっていても [`FE_INEXACT`](../cfenv/fe_invalid.md) は発生しないが、[`rint`](rint.md) は発生する可能性がある点のみ動作が異なる。 +- 本関数と [`rint`](rint.md) は戻り値は同一であるが、本関数は引数 `x` が戻り値と異なっていても [`FE_INEXACT`](../cfenv/fe_inexact.md) は発生しないが、[`rint`](rint.md) は発生する可能性がある点のみ動作が異なる。 - 本関数は、C99 の規格にある `nearbyint`(より正確には `math.h` ヘッダの `nearbyint`、`nearbyintf`、`nearbyintl` の 3 つ。それぞれ C++ の `double`、`float`、`long double` バージョンに相当)と等価である。 - C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 - `x = ±0` の場合、`±0` を返す。 diff --git a/reference/cstddef/size_t.md b/reference/cstddef/size_t.md index d2e450a918..f1f8dfc047 100644 --- a/reference/cstddef/size_t.md +++ b/reference/cstddef/size_t.md @@ -14,7 +14,7 @@ namespace std { `size_t`は、オブジェクトのバイト数を表現できる程度に十分に大きい符号なし整数型である。 C++03まではC言語と同じく「`sizeof`演算子によって返される符号なし整数型」と規定されていた。 -オブジェクトのバイト数(例えば[`malloc`](/reference/cstdlib.md)の引数)やコンテナの要素数(例えば[`std::size()`](/reference/iterator/size.md)の戻り値)を表現するために用いられる。 +オブジェクトのバイト数(例えば[`malloc`](/reference/cstdlib/malloc.md)の引数)やコンテナの要素数(例えば[`std::size()`](/reference/iterator/size.md)の戻り値)を表現するために用いられる。 ## 例 ```cpp example diff --git a/reference/execution/execution/stopped_as_error.md b/reference/execution/execution/stopped_as_error.md index e48be987c1..908ae52ab2 100644 --- a/reference/execution/execution/stopped_as_error.md +++ b/reference/execution/execution/stopped_as_error.md @@ -19,7 +19,7 @@ namespace std::execution { ## 効果 -説明用の式`sndr`と`err`に対して、型`Sndr`を`decltype((sndr))`、型`Err`を`decltype((err))`とする。`Sndr`が[`sender`](sender.md)を満たさない、もしくは`Err`が[`moveable-value`](../movable-value.md)を満たさないとき、呼び出し式`stopped_as_error(sndr, err)`は不適格となる。 +説明用の式`sndr`と`err`に対して、型`Sndr`を`decltype((sndr))`、型`Err`を`decltype((err))`とする。`Sndr`が[`sender`](sender.md)を満たさない、もしくは`Err`が[`movable-value`](../movable-value.md)を満たさないとき、呼び出し式`stopped_as_error(sndr, err)`は不適格となる。 そうでなければ、呼び出し式`stopped_as_error(sndr, err)`は`sndr`が1回だけ評価されることを除いて、下記と等価。 diff --git a/reference/filesystem/proximate.md b/reference/filesystem/proximate.md index 86623aea14..01a8205dfe 100644 --- a/reference/filesystem/proximate.md +++ b/reference/filesystem/proximate.md @@ -24,8 +24,8 @@ namespace std::filesystem { ## 戻り値 - (1) : `return proximate(p,` [`current_path()`](current_path.md)`, ec);` -- (2) : `return` [`weakly_canonical`](weakly_canonical.md)`(p).`[`lexically_proximate`](path/lexically_relative.md)`(`[`weakly_canonical`](weakly_canonical.md)`(base));` -- (3) : `return` [`weakly_canonical`](weakly_canonical.md)`(p, ec).`[`lexically_proximate`](path/lexically_relative.md)`(`[`weakly_canonical`](weakly_canonical.md)`(base, ec));` +- (2) : `return` [`weakly_canonical`](weakly_canonical.md)`(p).`[`lexically_proximate`](path/lexically_proximate.md)`(`[`weakly_canonical`](weakly_canonical.md)`(base));` +- (3) : `return` [`weakly_canonical`](weakly_canonical.md)`(p, ec).`[`lexically_proximate`](path/lexically_proximate.md)`(`[`weakly_canonical`](weakly_canonical.md)`(base, ec));` (1)と(3)でエラーが発生した場合、`ec`にエラー情報が書き込まれ、`path()`が返る。 diff --git a/reference/initializer_list/initializer_list.md b/reference/initializer_list/initializer_list.md index c655a09117..b68433652e 100644 --- a/reference/initializer_list/initializer_list.md +++ b/reference/initializer_list/initializer_list.md @@ -19,7 +19,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |--------------------------------|----------------|-------| -| [`constructor`](initializer_list/op_constructor.md) | コンストラクタ | C++11 | +| [`(constructor)`](initializer_list/op_constructor.md) | コンストラクタ | C++11 | | `~initializer_list() = default;` | デストラクタ | C++11 | | [`size`](initializer_list/size.md) | 要素数を取得する | C++11 | | [`begin`](initializer_list/begin.md) | 先頭要素へのポインタを取得する | C++11 | diff --git a/reference/iterator/move_iterator/op_increment.md b/reference/iterator/move_iterator/op_increment.md index 9526fcd2b0..d13e9f1583 100644 --- a/reference/iterator/move_iterator/op_increment.md +++ b/reference/iterator/move_iterator/op_increment.md @@ -28,7 +28,7 @@ return *this; * base[link base.md] - 後置インクリメント `operator++(int)`: - - `Iterator`が[`forward_iterator`](/reference/iterator/iterator_tag.md)のモデルとなる場合、以下と等価 + - `Iterator`が[`forward_iterator`](/reference/iterator/forward_iterator.md)のモデルとなる場合、以下と等価 ```cpp move_iterator tmp = *this; ++base(); diff --git a/reference/linalg/layout_blas_packed/mapping.md b/reference/linalg/layout_blas_packed/mapping.md index f9bb6042d3..8487fd439c 100644 --- a/reference/linalg/layout_blas_packed/mapping.md +++ b/reference/linalg/layout_blas_packed/mapping.md @@ -36,7 +36,7 @@ namespace std::linalg { - `extents_type::static_extent(0) ==` [`dynamic_extent`](/reference/span/dynamic_extent.md)または - `extents_type::static_extent(1) ==` [`dynamic_extent`](/reference/span/dynamic_extent.md)または - `extents_type::static_extent(0) == extents_type::static_extent(1)` -- [`Extents::rank_dynamic()`](/reference/mdspan/extents/rank.md) `== 0`のとき、`Ns`を[`Extents::static_extent`](/reference/mdspan/extents/static_extent.md)`(0)`としたとき値`Ns * (Ns + 1)`を`index_type`型で表現できること。 +- [`Extents::rank_dynamic()`](/reference/mdspan/extents/rank_dynamic.md) `== 0`のとき、`Ns`を[`Extents::static_extent`](/reference/mdspan/extents/static_extent.md)`(0)`としたとき値`Ns * (Ns + 1)`を`index_type`型で表現できること。 ## メンバ関数 diff --git a/reference/memory/shared_ptr/atomic_load_explicit.md b/reference/memory/shared_ptr/atomic_load_explicit.md index c53de7f97a..c36dd32458 100644 --- a/reference/memory/shared_ptr/atomic_load_explicit.md +++ b/reference/memory/shared_ptr/atomic_load_explicit.md @@ -87,7 +87,7 @@ int main() ## 参照 - [`atomic_load() - shared_ptr`](atomic_load.md) -- [`atomic_load_explicit() - `](/reference/atomic/atomic_load.md) +- [`atomic_load_explicit() - `](/reference/atomic/atomic_load_explicit.md) - [N2674 Shared_ptr atomic access, revision 1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2674.htm) - [C++0x Shared_ptr atomic access - Faith and Brave - C++で遊ぼう](http://faithandbrave.hateblo.jp/entry/20081015/1224066366) - [P0718R2 Revising `atomic_shared_ptr` for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0718r2.html) diff --git a/reference/mutex/timed_mutex.md b/reference/mutex/timed_mutex.md index b33cf4e22d..693f5e9ed9 100644 --- a/reference/mutex/timed_mutex.md +++ b/reference/mutex/timed_mutex.md @@ -13,7 +13,7 @@ namespace std { ## 概要 `timed_mutex`は、スレッド間で使用する共有リソースを排他制御するためのクラスであり、ロック取得のタイムアウト機能をサポートする。[`lock()`](timed_mutex/lock.md)メンバ関数によってリソースのロックを取得し、[`unlock()`](timed_mutex/unlock.md)メンバ関数でリソースのロックを手放す。 -このクラスのデストラクタは自動的に[`unlock()`](timed_mutex/op_destructor.md)メンバ関数を呼び出すことはないため、通常このクラスのメンバ関数は直接は呼び出さず、[`lock_guard`](/reference/mutex/lock_guard.md)や[`unique_lock`](/reference/mutex/unique_lock.md)といったロック管理クラスと併用する。 +このクラスのデストラクタは自動的に[`unlock()`](timed_mutex/unlock.md)メンバ関数を呼び出すことはないため、通常このクラスのメンバ関数は直接は呼び出さず、[`lock_guard`](/reference/mutex/lock_guard.md)や[`unique_lock`](/reference/mutex/unique_lock.md)といったロック管理クラスと併用する。 ## メンバ関数 diff --git a/reference/print.md b/reference/print.md index b2b96e9e09..707326aefa 100644 --- a/reference/print.md +++ b/reference/print.md @@ -12,7 +12,7 @@ | [`print`](print/print.md) | 書式指定で出力する (function template) | C++23 | | [`println`](print/println.md) | 書式指定で出力する。末尾改行付き (function template) | C++23 | | [`vprint_unicode`](print/vprint_unicode.md) | 書式指定でUnicode出力する (function) | C++23 | -| [`vprint_unicode_buffered`](print/vprint_nonunicode_buffered.md) | 確保した文字列バッファに書式指定の出力を作ってからUnicode出力する (function) | C++26 | +| [`vprint_unicode_buffered`](print/vprint_unicode_buffered.md) | 確保した文字列バッファに書式指定の出力を作ってからUnicode出力する (function) | C++26 | | [`vprint_nonunicode`](print/vprint_nonunicode.md) | 書式指定で非Unicode出力する (function) | C++23 | | [`vprint_nonunicode_buffered`](print/vprint_nonunicode_buffered.md) | 確保した文字列バッファに書式指定の出力を作ってから非Unicode出力する (function) | C++26 | diff --git a/reference/sstream/basic_stringbuf/view.md b/reference/sstream/basic_stringbuf/view.md index a1a75d42dd..d3c998f5e7 100644 --- a/reference/sstream/basic_stringbuf/view.md +++ b/reference/sstream/basic_stringbuf/view.md @@ -14,7 +14,7 @@ basic_string_view view() const noexcept; ## 戻り値 バッファが初期化されている場合、[`gptr()`](/reference/streambuf/basic_streambuf/gptr.md)と[`egptr()`](/reference/streambuf/basic_streambuf/egptr.md)の間の文字列を指す`basic_string_view`オブジェクトを返す。 -それ以外の場合、[`pbase()`](/reference/streambuf/basic_streambuf/pbase.md)と[`epptr()`](/reference/streambuf/basic_streambuf/pptr.md)の間の文字列を指す`basic_string_view`オブジェクトを返す。 +それ以外の場合、[`pbase()`](/reference/streambuf/basic_streambuf/pbase.md)と[`epptr()`](/reference/streambuf/basic_streambuf/epptr.md)の間の文字列を指す`basic_string_view`オブジェクトを返す。 ## 例 ```cpp example diff --git a/reference/string/basic_string/append.md b/reference/string/basic_string/append.md index a35d2d13e7..c606fc6bef 100644 --- a/reference/string/basic_string/append.md +++ b/reference/string/basic_string/append.md @@ -146,7 +146,7 @@ constexpr basic_string& - (6) C++03 まで:[`size`](size.md)`() >= npos -` [`distance`](/reference/iterator/distance.md)`(first, last)` の場合、`length_error` が送出される。 C++11 から:[`size`](size.md)`() +` [`distance`](/reference/iterator/distance.md)`(first, last) >` [`max_size`](max_size.md)`()` の場合、`length_error` が送出される。 -- (7) [`size`](size.md)`() + il.`[`size`](/reference/initializer_list/initializer_list.md)`() >` [`max_size`](max_size.md)`()` の場合、`length_error` が送出される。 +- (7) [`size`](size.md)`() + il.`[`size`](/reference/initializer_list/initializer_list/size.md)`() >` [`max_size`](max_size.md)`()` の場合、`length_error` が送出される。 ## 備考 diff --git a/reference/string/to_string.md b/reference/string/to_string.md index 0ee447df28..b7409a72d1 100644 --- a/reference/string/to_string.md +++ b/reference/string/to_string.md @@ -184,7 +184,7 @@ std::string to_string(long double val) | 名前 | 参照 | |---------------------------------|---------------------------| | [`to_wstring`](to_wstring.md) | 数値を`wstring`に変換する | -| [`to_chars`](/reference/charconv.md) | ロケール依存しない高速な変換 | +| [`to_chars`](/reference/charconv/to_chars.md) | ロケール依存しない高速な変換 | ## 参照 diff --git a/reference/string_view/basic_string_view.md b/reference/string_view/basic_string_view.md index 96b45116c1..a3c916a8b7 100644 --- a/reference/string_view/basic_string_view.md +++ b/reference/string_view/basic_string_view.md @@ -161,7 +161,7 @@ string_view hello = sv.substr(0, 5); // 先頭5文字を抽出する | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`(op_deduction_guide)`](basic_string_view/op_deduction_guide.md) | クラステンプレートの推論補助 | C++20 | +| [`(deduction_guide)`](basic_string_view/op_deduction_guide.md) | クラステンプレートの推論補助 | C++20 | ### リテラル From 9fbb233dc072dd2102904bd9dd6f365dfe6613ba Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 25 Aug 2025 16:10:00 +0900 Subject: [PATCH 2329/3948] =?UTF-8?q?pair::first,=20pair::second=20?= =?UTF-8?q?=E3=81=AE=E3=83=AA=E3=83=B3=E3=82=AF=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pair::first, pair::second それぞれの個別ページができたので、個別ページにリンクするよう修正しました。 --- reference/flat_map/flat_map/insert.md | 8 ++++---- reference/flat_map/flat_map/insert_range.md | 4 ++-- reference/flat_map/flat_multimap/insert.md | 8 ++++---- reference/flat_map/flat_multimap/insert_range.md | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/reference/flat_map/flat_map/insert.md b/reference/flat_map/flat_map/insert.md index e59a486019..29d235abb7 100644 --- a/reference/flat_map/flat_map/insert.md +++ b/reference/flat_map/flat_map/insert.md @@ -119,8 +119,8 @@ void insert(sorted_unique_t s, * end()[link /reference/vector/vector/end.md] * insert[link /reference/vector/vector/insert.md] * std::move[link /reference/utility/move.md] - * first[link /reference/utility/pair.md] - * second[link /reference/utility/pair.md] + * first[link /reference/utility/pair/first.md] + * second[link /reference/utility/pair/second.md] - 次に、新しく挿入された要素の範囲を`value_comp()`を基準にソートする - 次に、ソートされた結果の範囲と、既存の要素のソートされた範囲をひとつのソートされた範囲にマージする @@ -153,8 +153,8 @@ void insert(sorted_unique_t s, * end()[link /reference/vector/vector/end.md] * insert[link /reference/vector/vector/insert.md] * std::move[link /reference/utility/move.md] - * first[link /reference/utility/pair.md] - * second[link /reference/utility/pair.md] + * first[link /reference/utility/pair/first.md] + * second[link /reference/utility/pair/second.md] - 次に、ソートされた結果の範囲と、既存の要素のソートされた範囲をひとつのソートされた範囲にマージする - 最後に、重複する要素を以下のように削除する: diff --git a/reference/flat_map/flat_map/insert_range.md b/reference/flat_map/flat_map/insert_range.md index 207bc7a8fc..99a441d6a2 100644 --- a/reference/flat_map/flat_map/insert_range.md +++ b/reference/flat_map/flat_map/insert_range.md @@ -35,8 +35,8 @@ Rangeを挿入し、コンテナを拡張する。 * c.values[link containers.md] * end()[link /reference/vector/vector/end.md] * insert[link /reference/vector/vector/insert.md] - * first[link /reference/utility/pair.md] - * second[link /reference/utility/pair.md] + * first[link /reference/utility/pair/first.md] + * second[link /reference/utility/pair/second.md] - 次に、新しく挿入された要素の範囲を`value_comp()`を基準にソートする - 次に、ソートされた結果の範囲と、既存の要素のソートされた範囲をひとつのソートされた範囲にマージする diff --git a/reference/flat_map/flat_multimap/insert.md b/reference/flat_map/flat_multimap/insert.md index 4f8ebed9f0..db793d5aaa 100644 --- a/reference/flat_map/flat_multimap/insert.md +++ b/reference/flat_map/flat_multimap/insert.md @@ -115,8 +115,8 @@ void insert(sorted_equivalent_t, * end()[link /reference/vector/vector/end.md] * insert[link /reference/vector/vector/insert.md] * std::move[link /reference/utility/move.md] - * first[link /reference/utility/pair.md] - * second[link /reference/utility/pair.md] + * first[link /reference/utility/pair/first.md] + * second[link /reference/utility/pair/second.md] - 次に、新しく挿入された要素の範囲を`value_comp()`を基準にソートする - 次に、ソートされた結果の範囲と、既存の要素のソートされた範囲をひとつのソートされた範囲にマージする @@ -134,8 +134,8 @@ void insert(sorted_equivalent_t, * end()[link /reference/vector/vector/end.md] * insert[link /reference/vector/vector/insert.md] * std::move[link /reference/utility/move.md] - * first[link /reference/utility/pair.md] - * second[link /reference/utility/pair.md] + * first[link /reference/utility/pair/first.md] + * second[link /reference/utility/pair/second.md] - 次に、ソートされた結果の範囲と、既存の要素のソートされた範囲をひとつのソートされた範囲にマージする diff --git a/reference/flat_map/flat_multimap/insert_range.md b/reference/flat_map/flat_multimap/insert_range.md index 154da00c08..c5ec738166 100644 --- a/reference/flat_map/flat_multimap/insert_range.md +++ b/reference/flat_map/flat_multimap/insert_range.md @@ -31,8 +31,8 @@ Rangeを挿入し、コンテナを拡張する。 * c.values[link containers.md] * end()[link /reference/vector/vector/end.md] * insert[link /reference/vector/vector/insert.md] - * first[link /reference/utility/pair.md] - * second[link /reference/utility/pair.md] + * first[link /reference/utility/pair/first.md] + * second[link /reference/utility/pair/second.md] - 次に、新しく挿入された要素の範囲を`value_comp()`を基準にソートする - 次に、ソートされた結果の範囲と、既存の要素のソートされた範囲をひとつのソートされた範囲にマージする From 501a32511271c29c997a338945c249d41abea549 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 25 Aug 2025 18:54:02 +0900 Subject: [PATCH 2330/3948] =?UTF-8?q?=E3=83=A1=E3=83=B3=E3=83=90=E9=96=A2?= =?UTF-8?q?=E6=95=B0=E5=90=8D=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit try_emplace_hint というメンバ関数はありません。 提案文書では try_emplace_hint となっていますが、規格書では try_emplace に修正されています。 --- reference/flat_map/flat_map/insert_or_assign.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/flat_map/flat_map/insert_or_assign.md b/reference/flat_map/flat_map/insert_or_assign.md index 04916e47d9..498b84e1ad 100644 --- a/reference/flat_map/flat_map/insert_or_assign.md +++ b/reference/flat_map/flat_map/insert_or_assign.md @@ -84,9 +84,9 @@ iterator - `k`と等価なキーをもつ要素`e`が存在している場合、[`std::forward`](/reference/utility/forward.md)`(obj)`を`e.second`に代入する - そうでなければ、以下と等価: ```cpp - try_emplace_hint(hint, std::forward(k), std::forward(obj)); + try_emplace(hint, std::forward(k), std::forward(obj)); ``` - * try_emplace_hint[link try_emplace.md] + * try_emplace[link try_emplace.md] ## 戻り値 From a34f4268996ec81d3638d7a0dbdb75d866bc709c Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Tue, 26 Aug 2025 18:12:52 +0900 Subject: [PATCH 2331/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE?= =?UTF-8?q?=E9=A3=BE=E3=81=AE=E3=83=AA=E3=83=B3=E3=82=AF=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit コード修飾の対象とリンクアドレスが一致しないものを抽出し、修正しました。 --- reference/atomic/atomic_flag_wait_explicit.md | 4 ++-- reference/execution/execution/sender-in-of.md | 2 +- reference/execution/execution/upon_error.md | 2 +- reference/execution/execution/upon_stopped.md | 2 +- reference/expected/unexpect_t.md | 2 +- reference/format/basic_format_parse_context.md | 2 +- reference/format/format_to.md | 2 +- reference/forward_list/forward_list.md | 2 +- reference/ios/basic_ios/tie.md | 4 ++-- reference/istream/basic_istream/getline.md | 2 +- reference/mdspan/mdspan/op_constructor.md | 2 +- reference/mdspan/submdspan.md | 2 +- reference/memory/shared_ptr/atomic_exchange.md | 2 +- reference/ranges/iota_view/size.md | 2 +- reference/ranges/subrange/tuple_element.md | 2 +- reference/stop_token/stop_source/get_token.md | 2 +- reference/system_error/make_error_condition.md | 2 +- reference/utility/pair/op_constructor.md | 2 +- 18 files changed, 20 insertions(+), 20 deletions(-) diff --git a/reference/atomic/atomic_flag_wait_explicit.md b/reference/atomic/atomic_flag_wait_explicit.md index 7baa5cd5ff..bf2c1275aa 100644 --- a/reference/atomic/atomic_flag_wait_explicit.md +++ b/reference/atomic/atomic_flag_wait_explicit.md @@ -106,8 +106,8 @@ int main() } ``` * std::atomic_flag_wait_explicit[color ff0000] -* std::atomic_flag_test_and_set_explicit[link atomic_flag_test_and_set.md] -* std::atomic_flag_clear_explicit[link atomic_flag_clear.md] +* std::atomic_flag_test_and_set_explicit[link atomic_flag_test_and_set_explicit.md] +* std::atomic_flag_clear_explicit[link atomic_flag_clear_explicit.md] * std::atomic_flag_notify_one[link /reference/atomic/atomic_flag_notify_one.md] * ATOMIC_FLAG_INIT[link /reference/atomic/atomic_flag_init.md] * std::memory_order[link /reference/atomic/memory_order.md] diff --git a/reference/execution/execution/sender-in-of.md b/reference/execution/execution/sender-in-of.md index 50fbb1affa..72721a6a4b 100644 --- a/reference/execution/execution/sender-in-of.md +++ b/reference/execution/execution/sender-in-of.md @@ -47,7 +47,7 @@ namespace std::execution { * MATCHING-SIG[link get_completion_signatures.md] * gather-signatures[link gather-signatures.md] * completion_signatures_of_t[link completion_signatures_of_t.md] -* type_identity_t[link /reference/type_traits/true_type.md] +* type_identity_t[link /reference/type_traits/type_identity.md] ## バージョン diff --git a/reference/execution/execution/upon_error.md b/reference/execution/execution/upon_error.md index 7303d018e8..0bf0b74df7 100644 --- a/reference/execution/execution/upon_error.md +++ b/reference/execution/execution/upon_error.md @@ -50,7 +50,7 @@ int main() ``` * ex::upon_error[color ff0000] * ex::sender[link sender.md] -* ex::just_error[link just.md] +* ex::just_error[link just_error.md] * std::this_thread::sync_wait[link ../this_thread/sync_wait.md] * value()[link /reference/optional/optional/value.md] diff --git a/reference/execution/execution/upon_stopped.md b/reference/execution/execution/upon_stopped.md index 2dc21cde41..be0deec450 100644 --- a/reference/execution/execution/upon_stopped.md +++ b/reference/execution/execution/upon_stopped.md @@ -49,7 +49,7 @@ int main() ``` * ex::upon_stopped[color ff0000] * ex::sender[link sender.md] -* ex::just_stopped[link just.md] +* ex::just_stopped[link just_stopped.md] * std::this_thread::sync_wait[link ../this_thread/sync_wait.md] * value()[link /reference/optional/optional/value.md] diff --git a/reference/expected/unexpect_t.md b/reference/expected/unexpect_t.md index f64b2c48b6..698d436fb1 100644 --- a/reference/expected/unexpect_t.md +++ b/reference/expected/unexpect_t.md @@ -35,7 +35,7 @@ int main() } ``` * std::unexpect[color ff0000] -* ETIMEDOUT[link /reference/system_error/errc.md] +* ETIMEDOUT[link /reference/cerrno.md] ### 出力 ``` diff --git a/reference/format/basic_format_parse_context.md b/reference/format/basic_format_parse_context.md index 552f6ef5e0..e1211f92f3 100644 --- a/reference/format/basic_format_parse_context.md +++ b/reference/format/basic_format_parse_context.md @@ -110,7 +110,7 @@ namespace std { }; } ``` -* format_error[link /reference/string_view/basic_string_view.md] +* format_error[link /reference/format/format_error.md] ## バージョン ### 言語 diff --git a/reference/format/format_to.md b/reference/format/format_to.md index a71fa82e92..482c3af2fe 100644 --- a/reference/format/format_to.md +++ b/reference/format/format_to.md @@ -138,7 +138,7 @@ wstring format_to(Out out, const locale& loc, wformat_string fmt, const * wformat_string[link basic_format_string.md] * str[italic] * basic_format_context[link basic_format_context.md] -* vformat_to[link vformat.md] +* vformat_to[link vformat_to.md] * make_format_args[link make_format_args.md] * locale[link /reference/locale/locale.md] diff --git a/reference/forward_list/forward_list.md b/reference/forward_list/forward_list.md index 097248912e..0b7fdb8eea 100644 --- a/reference/forward_list/forward_list.md +++ b/reference/forward_list/forward_list.md @@ -193,7 +193,7 @@ int main() * ls.insert_after[link forward_list/insert_after.md] * ls.begin()[link forward_list/begin.md] * ls.cbegin()[link forward_list/cbegin.md] -* ls.cend()[link forward_list/end.md] +* ls.cend()[link forward_list/cend.md] #### 出力 ``` diff --git a/reference/ios/basic_ios/tie.md b/reference/ios/basic_ios/tie.md index 81b9c72e9c..84a466cad6 100644 --- a/reference/ios/basic_ios/tie.md +++ b/reference/ios/basic_ios/tie.md @@ -78,8 +78,8 @@ int main() ``` * tie[color ff0000] * std::istream[link ../../istream/basic_istream.md] -* std::ifstream[link ../../fstream/basic_ifilestream.md.nolink] -* std::ofstream[link ../../fstream/basic_ofilestream.md.nolink] +* std::ifstream[link ../../fstream/basic_ifstream.md] +* std::ofstream[link ../../fstream/basic_ofstream.md] * clear()[link clear.md] * rdstate[link rdstate.md] * std::ios_base[link ../ios_base.md] diff --git a/reference/istream/basic_istream/getline.md b/reference/istream/basic_istream/getline.md index 4175fd4e98..3431208e50 100644 --- a/reference/istream/basic_istream/getline.md +++ b/reference/istream/basic_istream/getline.md @@ -62,7 +62,7 @@ int main() { * fail()[link /reference/ios/basic_ios/fail.md] * clear[link /reference/ios/basic_ios/clear.md] * rdstate()[link /reference/ios/basic_ios/rdstate.md] -* std::ios_base[link /reference/ios/ios_base/type-iostate.md] +* std::ios_base::failbit[link /reference/ios/ios_base/type-iostate.md] 1度で1行すべての入力が行えなかった場合の処理を追いかけやすくするため、この例はわざと`buffer_size`を少なくしている。 diff --git a/reference/mdspan/mdspan/op_constructor.md b/reference/mdspan/mdspan/op_constructor.md index 2a1c926616..9b87d9e796 100644 --- a/reference/mdspan/mdspan/op_constructor.md +++ b/reference/mdspan/mdspan/op_constructor.md @@ -234,7 +234,7 @@ int main() * data_handle()[link data_handle.md] * mapping()[link mapping.md] * size()[link size.md] -* std::layout_stride::mapping[link ../layout_stride/mapping.md]] +* std::layout_stride::mapping[link ../layout_stride/mapping.md] * std::layout_stride[link ../layout_stride.md] * std::layout_left::mapping[link ../layout_left/mapping.md] * std::default_accessor[link ../default_accessor.md] diff --git a/reference/mdspan/submdspan.md b/reference/mdspan/submdspan.md index 8d8c4bd4b4..faeaf0c4a2 100644 --- a/reference/mdspan/submdspan.md +++ b/reference/mdspan/submdspan.md @@ -77,7 +77,7 @@ return mdspan(src.accessor().offset(src.data_handle(), sub_map_offset.offset), * mdspan[link mdspan.md] * sub_map_offset[link submdspan_mapping_result.md] * src.mapping()[link mdspan/mapping.md] -* src.data_handle()[link mdspan/mapping.md] +* src.data_handle()[link mdspan/data_handle.md] * src.accessor()[link mdspan/accessor.md] * AccessorPolicy::offset_policy[link AccessorPolicy.md] diff --git a/reference/memory/shared_ptr/atomic_exchange.md b/reference/memory/shared_ptr/atomic_exchange.md index 68a150dcd4..5d0ff1a899 100644 --- a/reference/memory/shared_ptr/atomic_exchange.md +++ b/reference/memory/shared_ptr/atomic_exchange.md @@ -27,7 +27,7 @@ namespace std { ```cpp atomic_exchange_explicit(p, r, memory_order_seq_cst) ``` -* atomic_exchange_explicit[link atomic_load_explicit.md] +* atomic_exchange_explicit[link atomic_exchange_explicit.md] * memory_order_seq_cst[link /reference/atomic/memory_order.md] diff --git a/reference/ranges/iota_view/size.md b/reference/ranges/iota_view/size.md index 9b7361f602..91090b89c3 100644 --- a/reference/ranges/iota_view/size.md +++ b/reference/ranges/iota_view/size.md @@ -9,7 +9,7 @@ constexpr auto size() const requires (same_as && advanceable) || (integral && integral) || sized_sentinel_for; ``` -* integral[link /reference/concepts/same_as.md] +* integral[link /reference/concepts/integral.md] * advanceable[italic][link iterator.md] * sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] diff --git a/reference/ranges/subrange/tuple_element.md b/reference/ranges/subrange/tuple_element.md index 4d692b184f..3397ee454a 100644 --- a/reference/ranges/subrange/tuple_element.md +++ b/reference/ranges/subrange/tuple_element.md @@ -52,7 +52,7 @@ int main() ``` * std::tuple_element_t[link /reference/tuple/tuple_element.md] * std::ranges::subrange[link /reference/ranges/subrange.md] -* std::same_as[link /reference/ranges/subrange.md] +* std::same_as[link /reference/concepts/same_as.md] * std::ranges::iterator_t[link /reference/ranges/iterator_t.md] * std::ranges::sentinel_t[link /reference/ranges/sentinel_t.md] * std::views::empty[link /reference/ranges/empty_view.md] diff --git a/reference/stop_token/stop_source/get_token.md b/reference/stop_token/stop_source/get_token.md index bfd0c76f19..f0066c1e94 100644 --- a/reference/stop_token/stop_source/get_token.md +++ b/reference/stop_token/stop_source/get_token.md @@ -41,7 +41,7 @@ int main() * std::stop_token[link ../stop_token.md] * std::stop_source[link ../stop_source.md] * std::nostopstate[link ../nostopstate.md] -* stop_possible()[link ../stop_token/stop_requested.md] +* stop_possible()[link ../stop_token/stop_possible.md] ### 出力 ``` diff --git a/reference/system_error/make_error_condition.md b/reference/system_error/make_error_condition.md index caa1577460..81032deedb 100644 --- a/reference/system_error/make_error_condition.md +++ b/reference/system_error/make_error_condition.md @@ -40,7 +40,7 @@ int main() } ``` * std::make_error_condition[color ff0000] -* std::error_condition[link error_code.md] +* std::error_condition[link error_condition.md] * std::errc::invalid_argument[link errc.md] * econd.category()[link error_condition/category.md] * name()[link error_category/name.md] diff --git a/reference/utility/pair/op_constructor.md b/reference/utility/pair/op_constructor.md index 418405e3af..f85c5c9fea 100644 --- a/reference/utility/pair/op_constructor.md +++ b/reference/utility/pair/op_constructor.md @@ -66,7 +66,7 @@ constexpr pair(piecewise_construct_t, tuple second_args); // (11) C++20 ``` * EXPLICIT[italic] -* pair-like[link /reference/tuple/tuple-like.md] +* pair-like[link /reference/tuple/pair-like.md] ## 概要 [`pair`](../pair.md)オブジェクトを構築する。 From 5d1f2cec413c8e7fa741924c35acc27dd9ca3561 Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 27 Aug 2025 01:08:52 +0900 Subject: [PATCH 2332/3948] =?UTF-8?q?execution/bulk(=5F(un)chunked):=20?= =?UTF-8?q?=E8=AA=BF=E6=95=B4=20(#1508)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/execution/execution/bulk.md | 8 +++++--- reference/execution/execution/bulk_chunked.md | 5 ++++- reference/execution/execution/bulk_unchunked.md | 5 ++++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/reference/execution/execution/bulk.md b/reference/execution/execution/bulk.md index 89daedf6e8..62552deb34 100644 --- a/reference/execution/execution/bulk.md +++ b/reference/execution/execution/bulk.md @@ -41,7 +41,7 @@ transform_sender( `product-type`の第1テンプレート引数は、`Policy`が[`copy_constructible`](/reference/concepts/copy_constructible.md)のモデルであるとき`Policy`となる。そうでなければ、`const Policy&`となる。 -### Senderアルゴリズムタグ `bulk_t` +### Senderアルゴリズムタグ `bulk` 説明用の式`sndr`と`env`に対して、型`Sndr`を`decltype((sndr))`とする。[`sender-for`](sender-for.md)` == false`のとき、式`bulk.transform_sender(sndr, env)`は不適格となる。 そうでなければ、式`bulk.transform_sender(sndr, env)`は下記と等価。 @@ -60,9 +60,12 @@ return bulk_chunked(std::move(child), policy, shape, std::move(new_f)); ## カスタマイゼーションポイント -Senderアルゴリズム構築時および[Receiver](receiver.md)接続時に、関連付けられた実行ドメインに対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 +Senderアルゴリズム構築時に、[Sender](sender.md)`sndr`に[関連付けられた実行ドメイン](get-domain-early.md)に対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 [デフォルト実行ドメイン](default_domain.md)では無変換。 +[Receiver](receiver.md)との[接続(connect)](connect.md)時に、[関連付けられた実行ドメイン](get-domain-late.md)に対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 +[デフォルト実行ドメイン](default_domain.md)では`bulk.transform_sender(out_sndr, env)`が呼ばれ、[`bulk_chunked`](bulk_chunked.md)Senderへと変換される。 + 説明用の式`out_sndr`を`bulk(sndr, policy, shape, f)`の戻り値[Sender](sender.md)とし、式`rcvr`を式[`connect`](connect.md)`(out_sndr, rcvr)`が適格となる[Receiver](receiver.md)とする。式[`connect`](connect.md)`(out_sndr, rcvr)`は[開始(start)](start.md)時に下記を満たす非同期操作を生成しない場合、動作は未定義となる。 - 説明用の`args`を`sndr`の値完了結果を参照する左辺値式のパック、または[`copy_constructible`](/reference/concepts/copy_constructible.md)のモデルであるならばそれらの値のdecayコピーのパックとする。`sndr`が値完了したとき、 @@ -130,4 +133,3 @@ int main() - [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) - [P3481R5 `std::execution::bulk()` issues](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3481r5.html) -- [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) diff --git a/reference/execution/execution/bulk_chunked.md b/reference/execution/execution/bulk_chunked.md index 4f09c79434..425801f6e4 100644 --- a/reference/execution/execution/bulk_chunked.md +++ b/reference/execution/execution/bulk_chunked.md @@ -41,7 +41,7 @@ transform_sender( `product-type`の第1テンプレート引数は、`Policy`が[`copy_constructible`](/reference/concepts/copy_constructible.md)のモデルであるとき`Policy`となる。そうでなければ、`const Policy&`となる。 -### Senderアルゴリズムタグ `bulk_chunked_t` +### Senderアルゴリズムタグ `bulk_chunked` Senderアルゴリズム動作説明用のクラステンプレート[`impls-for`](impls-for.md)に対して、下記の特殊化が定義される。 ```cpp @@ -171,4 +171,7 @@ int main() ## 参照 +- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) - [P3481R5 `std::execution::bulk()` issues](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3481r5.html) +- [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) diff --git a/reference/execution/execution/bulk_unchunked.md b/reference/execution/execution/bulk_unchunked.md index 72c19345d4..3bc388e082 100644 --- a/reference/execution/execution/bulk_unchunked.md +++ b/reference/execution/execution/bulk_unchunked.md @@ -41,7 +41,7 @@ transform_sender( `product-type`の第1テンプレート引数は、`Policy`が[`copy_constructible`](/reference/concepts/copy_constructible.md)のモデルであるとき`Policy`となる。そうでなければ、`const Policy&`となる。 -### Senderアルゴリズムタグ `bulk_unchunked_t` +### Senderアルゴリズムタグ `bulk_unchunked` Senderアルゴリズム動作説明用のクラステンプレート[`impls-for`](impls-for.md)に対して、下記の特殊化が定義される。 ```cpp @@ -90,6 +90,7 @@ Senderアルゴリズム構築時および[Receiver](receiver.md)接続時に、 - 説明用の`args`を`sndr`の値完了結果を参照する左辺値式のパック、または[`copy_constructible`](/reference/concepts/copy_constructible.md)のモデルであるならばそれらの値のdecayコピーのパックとする。`sndr`が値完了したとき、 - `out_sndr`もまた値完了するとき、`0`から`shape`までの型`Shape`の全ての`i`に対して`f(i, args...)`を呼び出す。 + - スケジューラ実装者は、各イテレーションを独立した実行エージェント上で実行することが推奨される。 - `out_sndr`が[`set_error`](set_error.md)`(rcvr, eptr)`で完了するとき、エラー完了ハンドラが呼び出される前に非同期操作は`f`呼び出しのサブセットを呼び出す可能性があり、`eptr`は下記いずれかを指す[`exception_ptr`](/reference/exception/exception_ptr.md)となる。 - `f`呼び出しから送出された例外、または - 処理系が要求リソースの確保に失敗したときは[`bad_alloc`](/reference/new/bad_alloc.md)例外、または @@ -146,4 +147,6 @@ int main() ## 参照 +- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) - [P3481R5 `std::execution::bulk()` issues](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3481r5.html) From 050f14d817d5c158ac93edbada550384292eca5d Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 27 Aug 2025 01:38:32 +0900 Subject: [PATCH 2333/3948] =?UTF-8?q?execution:=20P2079R10=20=E3=82=A8?= =?UTF-8?q?=E3=83=B3=E3=83=86=E3=82=A3=E3=83=86=E3=82=A3=E5=88=97=E6=8C=99?= =?UTF-8?q?=E3=81=AE=E3=81=BF=20(#1511)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/execution/execution.md | 9 ++++++ .../system_context_replaceability.md | 29 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 reference/execution/execution/system_context_replaceability.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index f79288d409..747d47c026 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -158,6 +158,14 @@ Senderコンシューマは名前空間 `std::this_thread` で定義される。 | [`execution::as_awaitable`](execution/as_awaitable.md) | Senderを[Awaitable型](/lang/cpp20/coroutines.md)へ変換 (customization point object) | C++26 | | [`execution::with_awaitable_senders`](execution/with_awaitable_senders.md) | [Promise型](/lang/cpp20/coroutines.md)の基底クラス (class template) | C++26 | +### 並列スケジューラ + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`execution::parallel_scheduler`](execution/parallel_scheduler.md.nolink) | 並列スケジューラ (class) | C++26 | +| [`execution::get_parallel_scheduler`](execution/get_parallel_scheduler.md.nolink) | 並列スケジューラを取得 (function) | C++26 | +| [`execution::system_context_replaceability`](execution/system_context_replaceability.md) | `parallel_scheduler`動作カスタマイズ用の名前空間 (namespace) | C++26 | + ## バージョン ### 言語 @@ -167,6 +175,7 @@ Senderコンシューマは名前空間 `std::this_thread` で定義される。 ## 参照 - [P0024R2 The Parallelism TS Should be Standardized](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0024r2.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P2079R10 Parallel scheduler](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2079r10.html) - [P3284R4 `write_env` and `unstoppable` Sender Adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3284r4.html) - [P3481R5 `std::execution::bulk()` issues](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3481r5.html) - [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) diff --git a/reference/execution/execution/system_context_replaceability.md b/reference/execution/execution/system_context_replaceability.md new file mode 100644 index 0000000000..927ded2d9a --- /dev/null +++ b/reference/execution/execution/system_context_replaceability.md @@ -0,0 +1,29 @@ +# system_context_replaceability +* execution[meta header] +* std::execution[meta namespace] +* namespace[meta id-type] +* cpp26[meta cpp] + +名前空間 `std::execution::system_context_replaceability` では、[実行制御ライブラリ](../execution.md)が提供する[並列スケジューラ](parallel_scheduler.md.nolink)動作をユーザ差し替え可能とするためのエンティティ群を定義する。 + +```cpp +namespace std::execution::system_context_replaceability { + … +} +``` + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`receiver_proxy`](system_context_replaceability/receiver_proxy.md.nolink) | バックエンド実装用のReceiverプロキシ (class) | C++26 | +| [`bulk_item_receiver_proxy`](system_context_replaceability/bulk_item_receiver_proxy.md.nolink) | バックエンド実装用のバルク処理Receiverプロキシ (class) | C++26 | +| [`parallel_scheduler_backend`](system_context_replaceability/parallel_scheduler_backend.md.nolink) | 並列スケジューラバックエンド (class) | C++26 | +| [`query_parallel_scheduler_backend`](system_context_replaceability/query_parallel_scheduler_backend.md.nolink) | 並列スケジューラバックエンドを問い合わせ (function) | C++26 | + + +## バージョン +### 言語 +- C++26 + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P2079R10 Parallel scheduler](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2079r10.html) From 61e00530569341cc0cfcff74b448918b5b024582 Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 28 Aug 2025 01:34:45 +0900 Subject: [PATCH 2334/3948] execution: P2079R10 User facing API (#1511) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - parallel_schedulerクラス - get_parallel_scheduler関数 --- reference/execution/execution.md | 12 +-- reference/execution/execution/bulk.md | 7 +- reference/execution/execution/bulk_chunked.md | 9 +- .../execution/execution/bulk_unchunked.md | 11 ++- .../execution/get_parallel_scheduler.md | 60 +++++++++++++ .../execution/execution/parallel_scheduler.md | 87 +++++++++++++++++++ .../execution/run_loop/get_scheduler.md | 2 +- reference/execution/execution/scheduler.md | 1 + .../system_context_replaceability.md | 11 ++- 9 files changed, 186 insertions(+), 14 deletions(-) create mode 100644 reference/execution/execution/get_parallel_scheduler.md create mode 100644 reference/execution/execution/parallel_scheduler.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 747d47c026..8c2b21edb6 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -123,9 +123,9 @@ namespace std::execution { | [`execution::let_value`](execution/let_value.md) | 値完了結果から入れ子の非同期操作へ変換 (customization point object) | C++26 | | [`execution::let_error`](execution/let_error.md) | エラー完了結果から入れ子の非同期操作へ変換 (customization point object) | C++26 | | [`execution::let_stopped`](execution/let_stopped.md) | 停止完了を入れ子の非同期操作へ変換 (customization point object) | C++26 | -| [`execution::bulk`](execution/bulk.md) | インデクス空間上で指定関数を反復実行 (customization point object) | C++26 | -| [`execution::bulk_chunked`](execution/bulk_chunked.md) | インデクス空間を分割チャンク単位で指定関数を反復実行 (customization point object) | C++26 | -| [`execution::bulk_unchunked`](execution/bulk_unchunked.md) | インデクス空間の各インデクス単位で指定関数を反復実行 (customization point object) | C++26 | +| [`execution::bulk`](execution/bulk.md) | インデクス空間上で指定関数を一括実行 (customization point object) | C++26 | +| [`execution::bulk_chunked`](execution/bulk_chunked.md) | インデクス空間を分割チャンク単位で指定関数を一括実行 (customization point object) | C++26 | +| [`execution::bulk_unchunked`](execution/bulk_unchunked.md) | インデクス空間の各インデクス単位で指定関数を一括実行 (customization point object) | C++26 | | [`execution::when_all`](execution/when_all.md) | 全ての入力Sender完了を待機 (customization point object) | C++26 | | [`execution::when_all_with_variant`](execution/when_all_with_variant.md) | 複数の値完了シグネチャをもつ全ての入力Sender完了を待機 (customization point object) | C++26 | | [`execution::into_variant`](execution/into_variant.md) | 複数の値完了シグネチャを単一[`variant`](/reference/variant/variant.md)型の値完了シグネチャに変換 (customization point object) | C++26 | @@ -158,12 +158,12 @@ Senderコンシューマは名前空間 `std::this_thread` で定義される。 | [`execution::as_awaitable`](execution/as_awaitable.md) | Senderを[Awaitable型](/lang/cpp20/coroutines.md)へ変換 (customization point object) | C++26 | | [`execution::with_awaitable_senders`](execution/with_awaitable_senders.md) | [Promise型](/lang/cpp20/coroutines.md)の基底クラス (class template) | C++26 | -### 並列スケジューラ +### 並列Scheduler | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`execution::parallel_scheduler`](execution/parallel_scheduler.md.nolink) | 並列スケジューラ (class) | C++26 | -| [`execution::get_parallel_scheduler`](execution/get_parallel_scheduler.md.nolink) | 並列スケジューラを取得 (function) | C++26 | +| [`execution::parallel_scheduler`](execution/parallel_scheduler.md) | 並列Scheduler (class) | C++26 | +| [`execution::get_parallel_scheduler`](execution/get_parallel_scheduler.md) | 並列Schedulerを取得 (function) | C++26 | | [`execution::system_context_replaceability`](execution/system_context_replaceability.md) | `parallel_scheduler`動作カスタマイズ用の名前空間 (namespace) | C++26 | diff --git a/reference/execution/execution/bulk.md b/reference/execution/execution/bulk.md index 62552deb34..c0a2d7c511 100644 --- a/reference/execution/execution/bulk.md +++ b/reference/execution/execution/bulk.md @@ -13,10 +13,15 @@ namespace std::execution { * unspecified[italic] ## 概要 -`bulk`は、インデクス空間の各インデクスに対してタスクを反復実行するSenderアダプタである。 +`bulk`は、インデクス空間の各インデクスに対してタスクを一括実行するSenderアダプタである。 `bulk`は[パイプ可能Senderアダプタオブジェクト](sender_adaptor_closure.md)であり、パイプライン記法をサポートする。 +実行制御ライブラリのデフォルト動作では、`bulk`は[`bulk_chukned`](bulk_chunked.md)に変換され、下記のように振る舞う。 + +- [並列Scheduler](parallel_scheduler.md)上では、インデクス空間を区間分割されたチャンク単位で並列実行される。 +- 明示的にカスタマイズされていなければ、各インデクスに対する処理は逐次実行される。 + ## 効果 説明用の式`sndr`, `policy`, `shape`, `f`に対して、型`Policy`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``、型`Shape`を`decltype(auto(shape))`、型`Func`を[`decay_t`](/reference/type_traits/decay.md)``とする。下記いずれかの条件をみたすとき、呼び出し式`bulk(sndr, policy, shape, f)`は不適格となる。 diff --git a/reference/execution/execution/bulk_chunked.md b/reference/execution/execution/bulk_chunked.md index 425801f6e4..33242087fa 100644 --- a/reference/execution/execution/bulk_chunked.md +++ b/reference/execution/execution/bulk_chunked.md @@ -13,10 +13,15 @@ namespace std::execution { * unspecified[italic] ## 概要 -`bulk_chunked`は、インデクス空間を区間分割したチャンク単位でタスクを反復実行するSenderアダプタである。 +`bulk_chunked`は、インデクス空間を区間分割したチャンク単位でタスクを一括実行するSenderアダプタである。 `bulk_chunked`は[パイプ可能Senderアダプタオブジェクト](sender_adaptor_closure.md)であり、パイプライン記法をサポートする。 +実行制御ライブラリのデフォルト動作では、下記のように振る舞う。 + +- [並列Scheduler](parallel_scheduler.md)上では、インデクス空間を区間分割されたチャンク単位で並列実行される。 +- 明示的にカスタマイズされていなければ、各インデクスに対する処理は逐次実行される。 + ## 効果 説明用の式`sndr`, `policy`, `shape`, `f`に対して、型`Policy`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``、型`Shape`を`decltype(auto(shape))`、型`Func`を[`decay_t`](/reference/type_traits/decay.md)``とする。下記いずれかの条件をみたすとき、呼び出し式`bulk_chunked(sndr, policy, shape, f)`は不適格となる。 @@ -168,10 +173,12 @@ int main() ## 関連項目 - [`execution::bulk`](bulk.md) - [`execution::bulk_unchunked`](bulk_unchunked.md) +- [`execution::parallel_scheduler`](parallel_scheduler.md) ## 参照 - [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P2079R10 Parallel scheduler](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2079r10.html) - [P3481R5 `std::execution::bulk()` issues](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3481r5.html) - [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) diff --git a/reference/execution/execution/bulk_unchunked.md b/reference/execution/execution/bulk_unchunked.md index 3bc388e082..a460e8c4e3 100644 --- a/reference/execution/execution/bulk_unchunked.md +++ b/reference/execution/execution/bulk_unchunked.md @@ -13,10 +13,15 @@ namespace std::execution { * unspecified[italic] ## 概要 -`bulk_unchunked`は、インデクス空間の各インデクスに対してタスクを反復実行するSenderアダプタである。 +`bulk_unchunked`は、インデクス空間の各インデクスに対してタスクを一括実行するSenderアダプタである。 `bulk_unchunked`は[パイプ可能Senderアダプタオブジェクト](sender_adaptor_closure.md)であり、パイプライン記法をサポートする。 +実行制御ライブラリのデフォルト動作では、下記のように振る舞う。 + +- [並列Scheduler](parallel_scheduler.md)上では、各インデクスに対する処理は個別の実行エージェント上で並列実行される。 +- 明示的にカスタマイズされていなければ、各インデクスに対する処理は逐次実行される。 + ## 効果 説明用の式`sndr`, `policy`, `shape`, `f`に対して、型`Policy`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``、型`Shape`を`decltype(auto(shape))`、型`Func`を[`decay_t`](/reference/type_traits/decay.md)``とする。下記いずれかの条件をみたすとき、呼び出し式`bulk_unchunked(sndr, policy, shape, f)`は不適格となる。 @@ -90,7 +95,7 @@ Senderアルゴリズム構築時および[Receiver](receiver.md)接続時に、 - 説明用の`args`を`sndr`の値完了結果を参照する左辺値式のパック、または[`copy_constructible`](/reference/concepts/copy_constructible.md)のモデルであるならばそれらの値のdecayコピーのパックとする。`sndr`が値完了したとき、 - `out_sndr`もまた値完了するとき、`0`から`shape`までの型`Shape`の全ての`i`に対して`f(i, args...)`を呼び出す。 - - スケジューラ実装者は、各イテレーションを独立した実行エージェント上で実行することが推奨される。 + - [Scheduler](scheduler.md)実装者は、各イテレーションを独立した実行エージェント上で実行することが推奨される。 - `out_sndr`が[`set_error`](set_error.md)`(rcvr, eptr)`で完了するとき、エラー完了ハンドラが呼び出される前に非同期操作は`f`呼び出しのサブセットを呼び出す可能性があり、`eptr`は下記いずれかを指す[`exception_ptr`](/reference/exception/exception_ptr.md)となる。 - `f`呼び出しから送出された例外、または - 処理系が要求リソースの確保に失敗したときは[`bad_alloc`](/reference/new/bad_alloc.md)例外、または @@ -144,9 +149,11 @@ int main() ## 関連項目 - [`execution::bulk`](bulk.md) - [`execution::bulk_chunked`](bulk_chunked.md) +- [`execution::parallel_scheduler`](parallel_scheduler.md) ## 参照 - [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P2079R10 Parallel scheduler](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2079r10.html) - [P3481R5 `std::execution::bulk()` issues](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3481r5.html) diff --git a/reference/execution/execution/get_parallel_scheduler.md b/reference/execution/execution/get_parallel_scheduler.md new file mode 100644 index 0000000000..af069b6869 --- /dev/null +++ b/reference/execution/execution/get_parallel_scheduler.md @@ -0,0 +1,60 @@ +# get_parallel_scheduler +* execution[meta header] +* function[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + parallel_scheduler get_parallel_scheduler(); +} +``` +* parallel_scheduler[link parallel_scheduler.md] + +## 概要 +システムの[並列Scheduler](parallel_scheduler.md)を取得する。 + + +## 効果 +説明用の`eb`を[`system_context_replaceability::query_parallel_scheduler_backend()`](system_context_replaceability/query_parallel_scheduler_backend.md.nolink)の結果とする。 + +もし`eb == nullptr`ならば、[`terminate`](/reference/exception/terminate.md)を呼び出す。そうでなければ、`eb`に関連付けられた[`parallel_scheduler`](parallel_scheduler.md)オブジェクトを返す。 + + +## 例 +```cpp example +#include +namespace ex = std::execution; + +int main() +{ + ex::scheduler auto sch = ex::get_parallel_scheduler(); +} +``` +* ex::get_parallel_scheduler[color ff0000] +* ex::scheduler[link scheduler.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::parallel_scheduler`](parallel_scheduler.md) +- [`execution::system_context_replaceability`](system_context_replaceability.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P2079R10 Parallel scheduler](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2079r10.html) diff --git a/reference/execution/execution/parallel_scheduler.md b/reference/execution/execution/parallel_scheduler.md new file mode 100644 index 0000000000..02f38a2a2b --- /dev/null +++ b/reference/execution/execution/parallel_scheduler.md @@ -0,0 +1,87 @@ +# parallel_scheduler +* execution[meta header] +* class[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + class parallel_scheduler { unspecified }; +} +``` +* unspecified[italic] + +## 概要 +`parallel_scheduler`は、実行制御ライブラリ上で並列処理を実現する並列Schedulerクラスである。 + +次のSenderアルゴリズムに対してカスタマイズ実装を提供することで、インデクス空間の各要素に対する処理を並列実行する。 + +- [`execution::bulk`](bulk.md) : 既定動作では`bulk_chunked`へ変換 +- [`execution::bulk_chunked`](bulk_chunked.md) : チャンク単位で並列実行 +- [`execution::bulk_unchunked`](bulk_unchunked.md) : 要素単位で並列実行 + + +## クラス仕様 +`parallel_scheduler`は[`scheduler`](scheduler.md)のモデルである。 + +説明用の`sch`を`parallel_scheduler`型のオブジェクト、`sch`が`ptr`と関連付けられるとき`BACKEND-OF(sch)`を`*ptr`とする。 + +式[`get_forward_progress_guarantee`](get_forward_progress_guarantee.md)`(sch)`は[`forward_progress_guarantee::parallel`](forward_progress_guarantee.md)を返す。 + +説明用の`sch2`を`parallel_scheduler`型のオブジェクトとしたとき、`BACKEND-OF(sch)`と`BACKEND-OF(sch2)`が同一オブジェクトを指す場合に限って、2つのオブジェクト`sch`と`sch2`は等しい。 + +`rcvr`を[Receiver](receiver.md)としたとき、基底`B`を持つ`rcvr`のプロキシ(proxy for `rcvr` with base `B`)は下記を満たす`B`型の左辺値`r`となる。 + +- `r.set_value()は、[`set_value`](set_value.md)`(std::move(rcvr))`と同じ効果。 +- `r.set_error(e)`は、`e`を[`exception_ptr`](/reference/exception/exception_ptr.md)として、[`set_error`](set_error.md)`(std::move(rcvr), std::move(e))`と同じ効果。 +- `r.set_stopped()`は、[`set_stopped`](set_stopped.md)`(std::move(rcvr))`と同じ効果。 + +プロキシ`r`に対する事前確保バックエンドストレージ(preallocated backend storage)は、[`span`](/reference/span/span.md)`<`[`byte`](/reference/cstddef.md)`>`型のオブジェクト`s`であり、`r`に対して[`set_value`](set_value.md)/[`set_error`](set_error.md)/[`set_stopped`](set_stopped.md)いずれかが呼び出されるまで範囲`s`は有効かつ上書き可能である。 + +呼び出し可能オブジェクト`f`と引数`arg`を持つ`rcvr`のバルクチャンク化プロキシ(bulk chunked proxy)は、基底 +[`system_context_replaceability::bulk_item_receiver_proxy`](system_context_replaceability/bulk_item_receiver_proxy.md.nolink)を持つ`rcvr`のプロキシ`r`であり、インデクス`i`, `j`に対する`r.execute(i, j)`は`f(i, j, args...)`と同じ効果を持つ。 + +呼び出し可能オブジェクト`f`と引数`arg`を持つ`rcvr`のバルク非チャンク化プロキシ(bulk unchunked proxy)は、基底 +[`system_context_replaceability::bulk_item_receiver_proxy`](system_context_replaceability/bulk_item_receiver_proxy.md.nolink)を持つ`rcvr`のプロキシ`r`であり、インデクス`i`に対する`r.execute(i, i + 1)`は`f(i, args...)`と同じ効果を持つ。 + +説明用の`b`を`BACKEND-OF(sch)`、`sndr`を[`schedule`](schedule.md)`(sch)`が返すオブジェクト、`rcvr`を[Receiver](receiver.md)とする。`rcvr`が`sndr`に[接続(connect)](connect.md)され、結果の[Operation State](operation_state.md)が[開始(start)](start.md)されたとき、 + +- `sndr`が値完了するならば、[`b.schedule`](system_context_replaceability/parallel_scheduler_backend/schedule.md.nolink)`(r, s)`が呼ばれる。このとき、 + - `r`は基底[`system_context_replaceability::receiver_proxy`](system_context_replaceability/receiver_proxy.md.nolink)を持つ`rcvr`のプロキシであり、かつ + - `s`は`r`に対する事前確保バックエンドストレージである。 +- 他の全ての完了操作は、変更なしに転送される。 + +`parallel_scheduler`は[`bulk_chunked`](bulk_chunked.md)アルゴリズムのカスタマイズ実装を提供する。[Receiver](receiver.md)`rcvr`が`bulk_chunked(sndr, pol, shape, f)`が返す[Sender](sender.md)に[接続(connect)](connect.md)され、結果の[Operation State](operation_state.md)が[開始(start)](start.md)されたとき、 + +- `sndr`が値`vals`で値完了するならば、`args`を`vals`を指す左辺値式のパックとして、[`b.schedule_bulk_chunked`](system_context_replaceability/parallel_scheduler_backend/schedule_bulk_chunked.md.nolink)`(shape, r, s)`が呼ばれる。このとき、 + - `r`は呼び出し可能オブジェクト`f`と引数`arg`を持つ`rcvr`のバルクチャンク化プロキシであり、かつ + - `s`は`r`に対する事前確保バックエンドストレージである。 +- 他の全ての完了操作は、変更なしに転送される。 + +`parallel_scheduler`は[`bulk_unchunked`](bulk_unchunked.md)アルゴリズムのカスタマイズ実装を提供する。[Receiver](receiver.md)`rcvr`が`bulk_unchunked(sndr, pol, shape, f)`が返す[Sender](sender.md)に[接続(connect)](connect.md)され、結果の[Operation State](operation_state.md)が[開始(start)](start.md)されたとき、 + +- `sndr`が値`vals`で値完了するならば、`args`を`vals`を指す左辺値式のパックとして、[`b.schedule_bulk_unchunked`](system_context_replaceability/parallel_scheduler_backend/schedule_bulk_unchunked.md.nolink)`(shape, r, s)`が呼ばれる。このとき、 + - `r`は呼び出し可能オブジェクト`f`と引数`arg`を持つ`rcvr`のバルク非チャンク化プロキシであり、かつ + - `s`は`r`に対する事前確保バックエンドストレージである。 +- 他の全ての完了操作は、変更なしに転送される。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::get_parallel_scheduler`](get_parallel_scheduler.md) +- [`execution::system_context_replaceability`](system_context_replaceability.md) + + +## 参照 +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P2079R10 Parallel scheduler](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2079r10.html) diff --git a/reference/execution/execution/run_loop/get_scheduler.md b/reference/execution/execution/run_loop/get_scheduler.md index cf45a16483..cde02aa025 100644 --- a/reference/execution/execution/run_loop/get_scheduler.md +++ b/reference/execution/execution/run_loop/get_scheduler.md @@ -40,7 +40,7 @@ int main() ex::set_error_t(std::exception_ptr), ex::set_stopped_t()>>); - // スケジュールSender属性の値完了スケジューラを確認 + // スケジュールSender属性の値完了Schedulerを確認 auto compl_sch = ex::get_completion_scheduler(ex::get_env(sndr)); assert(compl_sch == sch); } diff --git a/reference/execution/execution/scheduler.md b/reference/execution/execution/scheduler.md index 5c0fd70dc0..8b908529a7 100644 --- a/reference/execution/execution/scheduler.md +++ b/reference/execution/execution/scheduler.md @@ -107,6 +107,7 @@ int main() ## 関連項目 - [`execution::schedule`](schedule.md) - [`execution::get_completion_scheduler`](get_completion_scheduler.md) +- [`execution::get_parallel_scheduler`](get_parallel_scheduler.md) ## 参照 diff --git a/reference/execution/execution/system_context_replaceability.md b/reference/execution/execution/system_context_replaceability.md index 927ded2d9a..fe2402522a 100644 --- a/reference/execution/execution/system_context_replaceability.md +++ b/reference/execution/execution/system_context_replaceability.md @@ -4,7 +4,7 @@ * namespace[meta id-type] * cpp26[meta cpp] -名前空間 `std::execution::system_context_replaceability` では、[実行制御ライブラリ](../execution.md)が提供する[並列スケジューラ](parallel_scheduler.md.nolink)動作をユーザ差し替え可能とするためのエンティティ群を定義する。 +名前空間 `std::execution::system_context_replaceability` では、[並列Scheduler](parallel_scheduler.md)動作をユーザが差し替えるためのインタフェースを定義する。 ```cpp namespace std::execution::system_context_replaceability { @@ -16,14 +16,19 @@ namespace std::execution::system_context_replaceability { |------|------|----------------| | [`receiver_proxy`](system_context_replaceability/receiver_proxy.md.nolink) | バックエンド実装用のReceiverプロキシ (class) | C++26 | | [`bulk_item_receiver_proxy`](system_context_replaceability/bulk_item_receiver_proxy.md.nolink) | バックエンド実装用のバルク処理Receiverプロキシ (class) | C++26 | -| [`parallel_scheduler_backend`](system_context_replaceability/parallel_scheduler_backend.md.nolink) | 並列スケジューラバックエンド (class) | C++26 | -| [`query_parallel_scheduler_backend`](system_context_replaceability/query_parallel_scheduler_backend.md.nolink) | 並列スケジューラバックエンドを問い合わせ (function) | C++26 | +| [`parallel_scheduler_backend`](system_context_replaceability/parallel_scheduler_backend.md.nolink) | 並列Schedulerバックエンド (class) | C++26 | +| [`query_parallel_scheduler_backend`](system_context_replaceability/query_parallel_scheduler_backend.md.nolink) | 並列Schedulerバックエンドを問い合わせ (function) | C++26 | ## バージョン ### 言語 - C++26 + +## 関連項目 +- [`execution::parallel_scheduler`](parallel_scheduler.md) + + ## 参照 - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) - [P2079R10 Parallel scheduler](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2079r10.html) From d53cd4ce406463315760b17a7bb9b9058e2bc759 Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 28 Aug 2025 13:44:50 +0900 Subject: [PATCH 2335/3948] =?UTF-8?q?execution/forwarding=5Fquery:=20get?= =?UTF-8?q?=5Fawait=5Fcompletion=5Fadaptor=E8=BF=BD=E8=A8=98(#1507)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/execution/forwarding_query.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/execution/forwarding_query.md b/reference/execution/forwarding_query.md index 8b5e23a845..6a8735bdf9 100644 --- a/reference/execution/forwarding_query.md +++ b/reference/execution/forwarding_query.md @@ -49,6 +49,7 @@ namespace std { - [`execution::get_scheduler`](execution/get_scheduler.md) - [`execution::get_delegation_scheduler`](execution/get_delegation_scheduler.md) - [`execution::get_completion_scheduler`](execution/get_completion_scheduler.md) +- [`execution::get_await_completion_adaptor`](execution/get_await_completion_adaptor.md) 下記[クエリオブジェクト](queryable.md)に対する問い合わせは、`FWD-ENV`経由で転送されない。 From ab280be5a6bc2524c08105e2194e26bd05fa5c1a Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 28 Aug 2025 20:28:56 +0900 Subject: [PATCH 2336/3948] =?UTF-8?q?execution/parallel=5Fscheduler:=20?= =?UTF-8?q?=E8=AA=AC=E6=98=8E=E5=A2=97=E8=A3=9C(#1511)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../execution/execution/parallel_scheduler.md | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/reference/execution/execution/parallel_scheduler.md b/reference/execution/execution/parallel_scheduler.md index 02f38a2a2b..35c8b1396c 100644 --- a/reference/execution/execution/parallel_scheduler.md +++ b/reference/execution/execution/parallel_scheduler.md @@ -12,13 +12,17 @@ namespace std::execution { * unspecified[italic] ## 概要 -`parallel_scheduler`は、実行制御ライブラリ上で並列処理を実現する並列Schedulerクラスである。 +`parallel_scheduler`は、実行制御ライブラリ上でタスクの並列実行を可能とする並列[Scheduler](scheduler.md)である。 -次のSenderアルゴリズムに対してカスタマイズ実装を提供することで、インデクス空間の各要素に対する処理を並列実行する。 +`parallel_scheduler`はシステムグローバルなスレッドプール(実行リソース)に関連付けられ、[`schedule`](schedule.md)操作により得られる[Sender](sender.md)はスレッドプールに属する任意のスレッド(実行エージェント)上で実行される。 -- [`execution::bulk`](bulk.md) : 既定動作では`bulk_chunked`へ変換 -- [`execution::bulk_chunked`](bulk_chunked.md) : チャンク単位で並列実行 -- [`execution::bulk_unchunked`](bulk_unchunked.md) : 要素単位で並列実行 +下記のSenderアルゴリズムに対してカスタマイズ実装を提供することで、タスクの一括(bulk)実行をスレッドプールを利用したタスク並列(parallel)実行に変換する。 + +- [`execution::bulk`](bulk.md) : `bulk_chunked`に変換してタスク並列実行 +- [`execution::bulk_chunked`](bulk_chunked.md) : インデクス範囲をチャンク単位でタスク並列実行 +- [`execution::bulk_unchunked`](bulk_unchunked.md) : インデクス範囲を要素単位でタスク並列実行 + +[`execution::system_context_replaceability`](system_context_replaceability.md) 名前空間で定義されるインタフェースを介して、スレッドプール実装をユーザ定義の並列Schedulerバックエンドに置き換えることもできる。 ## クラス仕様 @@ -44,6 +48,8 @@ namespace std::execution { 呼び出し可能オブジェクト`f`と引数`arg`を持つ`rcvr`のバルク非チャンク化プロキシ(bulk unchunked proxy)は、基底 [`system_context_replaceability::bulk_item_receiver_proxy`](system_context_replaceability/bulk_item_receiver_proxy.md.nolink)を持つ`rcvr`のプロキシ`r`であり、インデクス`i`に対する`r.execute(i, i + 1)`は`f(i, args...)`と同じ効果を持つ。 + +### `schedule` ファクトリ 説明用の`b`を`BACKEND-OF(sch)`、`sndr`を[`schedule`](schedule.md)`(sch)`が返すオブジェクト、`rcvr`を[Receiver](receiver.md)とする。`rcvr`が`sndr`に[接続(connect)](connect.md)され、結果の[Operation State](operation_state.md)が[開始(start)](start.md)されたとき、 - `sndr`が値完了するならば、[`b.schedule`](system_context_replaceability/parallel_scheduler_backend/schedule.md.nolink)`(r, s)`が呼ばれる。このとき、 @@ -51,6 +57,8 @@ namespace std::execution { - `s`は`r`に対する事前確保バックエンドストレージである。 - 他の全ての完了操作は、変更なしに転送される。 + +### `bulk_chunked` アダプタ `parallel_scheduler`は[`bulk_chunked`](bulk_chunked.md)アルゴリズムのカスタマイズ実装を提供する。[Receiver](receiver.md)`rcvr`が`bulk_chunked(sndr, pol, shape, f)`が返す[Sender](sender.md)に[接続(connect)](connect.md)され、結果の[Operation State](operation_state.md)が[開始(start)](start.md)されたとき、 - `sndr`が値`vals`で値完了するならば、`args`を`vals`を指す左辺値式のパックとして、[`b.schedule_bulk_chunked`](system_context_replaceability/parallel_scheduler_backend/schedule_bulk_chunked.md.nolink)`(shape, r, s)`が呼ばれる。このとき、 @@ -58,6 +66,7 @@ namespace std::execution { - `s`は`r`に対する事前確保バックエンドストレージである。 - 他の全ての完了操作は、変更なしに転送される。 +### `bulk_unchunked` アダプタ `parallel_scheduler`は[`bulk_unchunked`](bulk_unchunked.md)アルゴリズムのカスタマイズ実装を提供する。[Receiver](receiver.md)`rcvr`が`bulk_unchunked(sndr, pol, shape, f)`が返す[Sender](sender.md)に[接続(connect)](connect.md)され、結果の[Operation State](operation_state.md)が[開始(start)](start.md)されたとき、 - `sndr`が値`vals`で値完了するならば、`args`を`vals`を指す左辺値式のパックとして、[`b.schedule_bulk_unchunked`](system_context_replaceability/parallel_scheduler_backend/schedule_bulk_unchunked.md.nolink)`(shape, r, s)`が呼ばれる。このとき、 From 17da529dc9bb49de597f1072a150f36d027a9978 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Thu, 28 Aug 2025 21:20:27 +0900 Subject: [PATCH 2337/3948] =?UTF-8?q?typo=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bulk_chukned → bulk_chunked --- reference/execution/execution/bulk.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/execution/execution/bulk.md b/reference/execution/execution/bulk.md index c0a2d7c511..1088bd6de7 100644 --- a/reference/execution/execution/bulk.md +++ b/reference/execution/execution/bulk.md @@ -17,7 +17,7 @@ namespace std::execution { `bulk`は[パイプ可能Senderアダプタオブジェクト](sender_adaptor_closure.md)であり、パイプライン記法をサポートする。 -実行制御ライブラリのデフォルト動作では、`bulk`は[`bulk_chukned`](bulk_chunked.md)に変換され、下記のように振る舞う。 +実行制御ライブラリのデフォルト動作では、`bulk`は[`bulk_chunked`](bulk_chunked.md)に変換され、下記のように振る舞う。 - [並列Scheduler](parallel_scheduler.md)上では、インデクス空間を区間分割されたチャンク単位で並列実行される。 - 明示的にカスタマイズされていなければ、各インデクスに対する処理は逐次実行される。 From a516717c5392b05f2c17baabf1fec0b8710f1762 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 29 Aug 2025 01:37:59 +0900 Subject: [PATCH 2338/3948] execution: P2079R10 Replaceability API (#1511) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - query_parallel_scheduler_backend関数 - parallel_scheduler_backendクラス --- .../execution/get_parallel_scheduler.md | 2 +- .../execution/execution/parallel_scheduler.md | 11 ++-- .../system_context_replaceability.md | 4 +- .../parallel_scheduler_backend.md | 44 ++++++++++++++ .../op_destructor.md | 28 +++++++++ .../parallel_scheduler_backend/schedule.md | 53 +++++++++++++++++ .../schedule_bulk_chunked.md | 58 +++++++++++++++++++ .../schedule_bulk_unchunked.md | 57 ++++++++++++++++++ .../query_parallel_scheduler_backend.md | 43 ++++++++++++++ 9 files changed, 292 insertions(+), 8 deletions(-) create mode 100644 reference/execution/execution/system_context_replaceability/parallel_scheduler_backend.md create mode 100644 reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/op_destructor.md create mode 100644 reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/schedule.md create mode 100644 reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/schedule_bulk_chunked.md create mode 100644 reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/schedule_bulk_unchunked.md create mode 100644 reference/execution/execution/system_context_replaceability/query_parallel_scheduler_backend.md diff --git a/reference/execution/execution/get_parallel_scheduler.md b/reference/execution/execution/get_parallel_scheduler.md index af069b6869..a29bd63aa9 100644 --- a/reference/execution/execution/get_parallel_scheduler.md +++ b/reference/execution/execution/get_parallel_scheduler.md @@ -16,7 +16,7 @@ namespace std::execution { ## 効果 -説明用の`eb`を[`system_context_replaceability::query_parallel_scheduler_backend()`](system_context_replaceability/query_parallel_scheduler_backend.md.nolink)の結果とする。 +説明用の`eb`を[`system_context_replaceability::query_parallel_scheduler_backend()`](system_context_replaceability/query_parallel_scheduler_backend.md)の結果とする。 もし`eb == nullptr`ならば、[`terminate`](/reference/exception/terminate.md)を呼び出す。そうでなければ、`eb`に関連付けられた[`parallel_scheduler`](parallel_scheduler.md)オブジェクトを返す。 diff --git a/reference/execution/execution/parallel_scheduler.md b/reference/execution/execution/parallel_scheduler.md index 35c8b1396c..4b87f2a1c6 100644 --- a/reference/execution/execution/parallel_scheduler.md +++ b/reference/execution/execution/parallel_scheduler.md @@ -36,11 +36,11 @@ namespace std::execution { `rcvr`を[Receiver](receiver.md)としたとき、基底`B`を持つ`rcvr`のプロキシ(proxy for `rcvr` with base `B`)は下記を満たす`B`型の左辺値`r`となる。 -- `r.set_value()は、[`set_value`](set_value.md)`(std::move(rcvr))`と同じ効果。 +- `r.set_value()`は、[`set_value`](set_value.md)`(std::move(rcvr))`と同じ効果。 - `r.set_error(e)`は、`e`を[`exception_ptr`](/reference/exception/exception_ptr.md)として、[`set_error`](set_error.md)`(std::move(rcvr), std::move(e))`と同じ効果。 - `r.set_stopped()`は、[`set_stopped`](set_stopped.md)`(std::move(rcvr))`と同じ効果。 -プロキシ`r`に対する事前確保バックエンドストレージ(preallocated backend storage)は、[`span`](/reference/span/span.md)`<`[`byte`](/reference/cstddef.md)`>`型のオブジェクト`s`であり、`r`に対して[`set_value`](set_value.md)/[`set_error`](set_error.md)/[`set_stopped`](set_stopped.md)いずれかが呼び出されるまで範囲`s`は有効かつ上書き可能である。 +プロキシ`r`に対する事前確保バックエンドストレージ(preallocated backend storage)は、[`span`](/reference/span/span.md)`<`[`byte`](/reference/cstddef/byte.md)`>`型のオブジェクト`s`であり、`r`に対して[`set_value`](set_value.md)/[`set_error`](set_error.md)/[`set_stopped`](set_stopped.md)いずれかが呼び出されるまで範囲`s`は有効かつ上書き可能である。 呼び出し可能オブジェクト`f`と引数`arg`を持つ`rcvr`のバルクチャンク化プロキシ(bulk chunked proxy)は、基底 [`system_context_replaceability::bulk_item_receiver_proxy`](system_context_replaceability/bulk_item_receiver_proxy.md.nolink)を持つ`rcvr`のプロキシ`r`であり、インデクス`i`, `j`に対する`r.execute(i, j)`は`f(i, j, args...)`と同じ効果を持つ。 @@ -52,7 +52,7 @@ namespace std::execution { ### `schedule` ファクトリ 説明用の`b`を`BACKEND-OF(sch)`、`sndr`を[`schedule`](schedule.md)`(sch)`が返すオブジェクト、`rcvr`を[Receiver](receiver.md)とする。`rcvr`が`sndr`に[接続(connect)](connect.md)され、結果の[Operation State](operation_state.md)が[開始(start)](start.md)されたとき、 -- `sndr`が値完了するならば、[`b.schedule`](system_context_replaceability/parallel_scheduler_backend/schedule.md.nolink)`(r, s)`が呼ばれる。このとき、 +- `sndr`が値完了するならば、[`b.schedule`](system_context_replaceability/parallel_scheduler_backend/schedule.md)`(r, s)`が呼ばれる。このとき、 - `r`は基底[`system_context_replaceability::receiver_proxy`](system_context_replaceability/receiver_proxy.md.nolink)を持つ`rcvr`のプロキシであり、かつ - `s`は`r`に対する事前確保バックエンドストレージである。 - 他の全ての完了操作は、変更なしに転送される。 @@ -61,15 +61,16 @@ namespace std::execution { ### `bulk_chunked` アダプタ `parallel_scheduler`は[`bulk_chunked`](bulk_chunked.md)アルゴリズムのカスタマイズ実装を提供する。[Receiver](receiver.md)`rcvr`が`bulk_chunked(sndr, pol, shape, f)`が返す[Sender](sender.md)に[接続(connect)](connect.md)され、結果の[Operation State](operation_state.md)が[開始(start)](start.md)されたとき、 -- `sndr`が値`vals`で値完了するならば、`args`を`vals`を指す左辺値式のパックとして、[`b.schedule_bulk_chunked`](system_context_replaceability/parallel_scheduler_backend/schedule_bulk_chunked.md.nolink)`(shape, r, s)`が呼ばれる。このとき、 +- `sndr`が値`vals`で値完了するならば、`args`を`vals`を指す左辺値式のパックとして、[`b.schedule_bulk_chunked`](system_context_replaceability/parallel_scheduler_backend/schedule_bulk_chunked.md)`(shape, r, s)`が呼ばれる。このとき、 - `r`は呼び出し可能オブジェクト`f`と引数`arg`を持つ`rcvr`のバルクチャンク化プロキシであり、かつ - `s`は`r`に対する事前確保バックエンドストレージである。 - 他の全ての完了操作は、変更なしに転送される。 + ### `bulk_unchunked` アダプタ `parallel_scheduler`は[`bulk_unchunked`](bulk_unchunked.md)アルゴリズムのカスタマイズ実装を提供する。[Receiver](receiver.md)`rcvr`が`bulk_unchunked(sndr, pol, shape, f)`が返す[Sender](sender.md)に[接続(connect)](connect.md)され、結果の[Operation State](operation_state.md)が[開始(start)](start.md)されたとき、 -- `sndr`が値`vals`で値完了するならば、`args`を`vals`を指す左辺値式のパックとして、[`b.schedule_bulk_unchunked`](system_context_replaceability/parallel_scheduler_backend/schedule_bulk_unchunked.md.nolink)`(shape, r, s)`が呼ばれる。このとき、 +- `sndr`が値`vals`で値完了するならば、`args`を`vals`を指す左辺値式のパックとして、[`b.schedule_bulk_unchunked`](system_context_replaceability/parallel_scheduler_backend/schedule_bulk_unchunked.md)`(shape, r, s)`が呼ばれる。このとき、 - `r`は呼び出し可能オブジェクト`f`と引数`arg`を持つ`rcvr`のバルク非チャンク化プロキシであり、かつ - `s`は`r`に対する事前確保バックエンドストレージである。 - 他の全ての完了操作は、変更なしに転送される。 diff --git a/reference/execution/execution/system_context_replaceability.md b/reference/execution/execution/system_context_replaceability.md index fe2402522a..c33fed812d 100644 --- a/reference/execution/execution/system_context_replaceability.md +++ b/reference/execution/execution/system_context_replaceability.md @@ -16,8 +16,8 @@ namespace std::execution::system_context_replaceability { |------|------|----------------| | [`receiver_proxy`](system_context_replaceability/receiver_proxy.md.nolink) | バックエンド実装用のReceiverプロキシ (class) | C++26 | | [`bulk_item_receiver_proxy`](system_context_replaceability/bulk_item_receiver_proxy.md.nolink) | バックエンド実装用のバルク処理Receiverプロキシ (class) | C++26 | -| [`parallel_scheduler_backend`](system_context_replaceability/parallel_scheduler_backend.md.nolink) | 並列Schedulerバックエンド (class) | C++26 | -| [`query_parallel_scheduler_backend`](system_context_replaceability/query_parallel_scheduler_backend.md.nolink) | 並列Schedulerバックエンドを問い合わせ (function) | C++26 | +| [`parallel_scheduler_backend`](system_context_replaceability/parallel_scheduler_backend.md) | 並列Schedulerバックエンド (class) | C++26 | +| [`query_parallel_scheduler_backend`](system_context_replaceability/query_parallel_scheduler_backend.md) | 並列Schedulerバックエンドを問い合わせ (function) | C++26 | ## バージョン diff --git a/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend.md b/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend.md new file mode 100644 index 0000000000..43097c515c --- /dev/null +++ b/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend.md @@ -0,0 +1,44 @@ +# parallel_scheduler_backend +* execution[meta header] +* class[meta id-type] +* std::execution::system_context_replaceability[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution::system_context_replaceability { + struct parallel_scheduler_backend; +} +``` + +## 概要 +[並列Scheduler](../parallel_scheduler.md)バックエンドのインタフェース(純粋仮想関数)を定義するクラス。 + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`(destructor)`](parallel_scheduler_backend/op_destructor.md) | デストラクタ | C++26 | +| [`schedule`](parallel_scheduler_backend/schedule.md) | [`schedule`](../schedule.md)アルゴリズム動作カスタマイズ | C++26 | +| [`schedule_bulk_chunked`](parallel_scheduler_backend/schedule_bulk_chunked.md) | [`bulk_chunked`](../bulk_chunked.md)アルゴリズム動作カスタマイズ | C++26 | +| [`schedule_bulk_unchunked`](parallel_scheduler_backend/schedule_bulk_unchunked.md) | [`bulk_unchunked`](../bulk_unchunked.md)アルゴリズム動作カスタマイズ | C++26 | + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::parallel_scheduler`](../parallel_scheduler.md) +- [`execution::system_context_replaceability::query_parallel_scheduler_backend`](query_parallel_scheduler_backend.md) + + +## 参照 +- [P2079R10 Parallel scheduler](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2079r10.html) diff --git a/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/op_destructor.md b/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/op_destructor.md new file mode 100644 index 0000000000..adeb126083 --- /dev/null +++ b/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/op_destructor.md @@ -0,0 +1,28 @@ +# デストラクタ +* execution[meta header] +* std::execution::system_context_replaceability[meta namespace] +* parallel_scheduler_backend[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +virtual ~parallel_scheduler_backend() = default; +``` + +## 概要 +`parallel_scheduler_backend`オブジェクトを破棄する。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P2079R10 Parallel scheduler](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2079r10.html) diff --git a/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/schedule.md b/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/schedule.md new file mode 100644 index 0000000000..dfae56c978 --- /dev/null +++ b/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/schedule.md @@ -0,0 +1,53 @@ +# schedule +* execution[meta header] +* std::execution::system_context_replaceability[meta namespace] +* parallel_scheduler_backend[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +virtual void schedule(receiver_proxy& r, span s) noexcept = 0; +``` +* receiver_proxy[link ../receiver_proxy.md.nolink] +* byte[link /reference/cstddef/byte.md] + +## 概要 +[`parallel_scheduler`](../../parallel_scheduler.md)による[`schedule`](../../schedule.md)アルゴリズムカスタマイズのバックエンド側を実装する。 + + +## 事前条件 +`*this`, `r`が参照するオブジェクト, `s`が参照するストレージの生存期間終了は、下記いずれか式の評価開始よりも後に発生(happen after)すること。 + + +## 効果 +派生クラスでは、この関数を下記のように実装すべきである。 + +- 下記いずれかの式が評価される + - エラーが発生せず作業が成功したとき、`r.set_value()` + - エラーが発生したとき、`eptr`を[`exception_ptr`](/reference/exception/exception_ptr.md)型のオブジェクトとして、`r.set_error(eptr)` + - 作業がキャンセルされたとき、`r.set_stopped()` +- 任意の`r.set_value()`呼び出しは、`*this`で表される実行コンテキストの実行エージェント上で発生する。 + + +## 備考 +`s`が参照するストレージは、この呼び出しによって開始された操作の実行期間中`*this`によって一時的なストレージとして使用される可能性がある。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::schedule`](../../schedule.md) +- [`execution::parallel_scheduler`](../../parallel_scheduler.md) + + +## 参照 +- [P2079R10 Parallel scheduler](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2079r10.html) diff --git a/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/schedule_bulk_chunked.md b/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/schedule_bulk_chunked.md new file mode 100644 index 0000000000..4ee6689e2e --- /dev/null +++ b/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/schedule_bulk_chunked.md @@ -0,0 +1,58 @@ +# schedule_bulk_chunked +* execution[meta header] +* std::execution::system_context_replaceability[meta namespace] +* parallel_scheduler_backend[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +virtual void schedule_bulk_chunked(size_t n, bulk_item_receiver_proxy& r, + span s) noexcept = 0; +``` +* bulk_item_receiver_proxy[link ../bulk_item_receiver_proxy.md.nolink] +* byte[link /reference/cstddef/byte.md] + +## 概要 +[`parallel_scheduler`](../../parallel_scheduler.md)による[`bulk_chunked`](../../bulk_chunked.md)アルゴリズムカスタマイズのバックエンド側を実装する。 + + +## 事前条件 +`*this`, `r`が参照するオブジェクト, `s`が参照するストレージの生存期間終了は、下記いずれか式の評価開始よりも後に発生(happen after)すること。 + + +## 効果 +派生クラスでは、この関数を下記のように実装すべきである。 + +- 下記いずれかの式が評価される + - エラーが発生せず作業が成功したとき、`r.set_value()` + - エラーが発生したとき、`eptr`を[`exception_ptr`](/reference/exception/exception_ptr.md)型のオブジェクトとして、`r.set_error(eptr)` + - 作業がキャンセルされたとき、`r.set_stopped()` +- `r.execute(b, e)`が呼ばれたとき、`b`と`e`は範囲`[0, n)`内かつ`b < e`である +- 範囲`[0, n)`の各`i`について、`i`が`[b, e)`の範囲内にある`r.execute(b, e)`の呼び出しが最大で1つだけ存在する。 +- `r.set_value()`が呼び出されたとき、`[0, n)`の各`i`に対して、`i`が`[b, e)`の範囲内となる`r.execute(b, e)`の呼び出しが正確に1つだけ存在する。 +- `r`上での全ての`execute`呼び出しは、`r`上での`set_value`/`set_error`/`set_stopped`いずれかの呼び出しよりも前に発生する。 +- `r`上での全ての`execute`および`set_value`呼び出しは、`*this`で表される実行コンテキストの実行エージェント上で行われる。 + + +## 備考 +`s`が参照するストレージは、この呼び出しによって開始された操作の実行期間中`*this`によって一時的なストレージとして使用される可能性がある。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::bulk_chunked`](../../bulk_chunked.md) +- [`execution::parallel_scheduler`](../../parallel_scheduler.md) + + +## 参照 +- [P2079R10 Parallel scheduler](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2079r10.html) diff --git a/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/schedule_bulk_unchunked.md b/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/schedule_bulk_unchunked.md new file mode 100644 index 0000000000..d78a582d03 --- /dev/null +++ b/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/schedule_bulk_unchunked.md @@ -0,0 +1,57 @@ +# schedule_bulk_unchunked +* execution[meta header] +* std::execution::system_context_replaceability[meta namespace] +* parallel_scheduler_backend[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +virtual void schedule_bulk_unchunked(size_t n, bulk_item_receiver_proxy& r, + span s) noexcept = 0; +``` +* bulk_item_receiver_proxy[link ../bulk_item_receiver_proxy.md.nolink] +* byte[link /reference/cstddef/byte.md] + +## 概要 +[`parallel_scheduler`](../../parallel_scheduler.md)による[`bulk_unchunked`](../../bulk_unchunked.md)アルゴリズムカスタマイズのバックエンド側を実装する。 + + +## 事前条件 +`*this`, `r`が参照するオブジェクト, `s`が参照するストレージの生存期間終了は、下記いずれか式の評価開始よりも後に発生(happen after)すること。 + + +## 効果 +派生クラスでは、この関数を下記のように実装すべきである。 + +- 下記いずれかの式が評価される + - エラーが発生せず作業が成功したとき、`r.set_value()` + - エラーが発生したとき、`eptr`を[`exception_ptr`](/reference/exception/exception_ptr.md)型のオブジェクトとして、`r.set_error(eptr)` + - 作業がキャンセルされたとき、`r.set_stopped()` +- `r.execute(b, e)`が呼ばれたとき、`b`は範囲`[0, n)`内かつ`e`は`b + 1`に等しい。`[0, n)`の各`i`について、`r.execute(i, i + 1)`の呼び出しが最大で1つだけ存在する。 +- `r.set_value()`が呼び出されたとき、`[0, n)`の各`i`に対して、`r.execute(i, i + 1)`の呼び出しが正確に1つだけ存在する。 +- `r`上での全ての`execute`呼び出しは、`r`上での`set_value`/`set_error`/`set_stopped`いずれかの呼び出しよりも前に発生する。 +- `r`上での全ての`execute`および`set_value`呼び出しは、`*this`で表される実行コンテキストの実行エージェント上で行われる。 + + +## 備考 +`s`が参照するストレージは、この呼び出しによって開始された操作の実行期間中`*this`によって一時的なストレージとして使用される可能性がある。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::bulk_unchunked`](../../bulk_unchunked.md) +- [`execution::parallel_scheduler`](../../parallel_scheduler.md) + + +## 参照 +- [P2079R10 Parallel scheduler](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2079r10.html) diff --git a/reference/execution/execution/system_context_replaceability/query_parallel_scheduler_backend.md b/reference/execution/execution/system_context_replaceability/query_parallel_scheduler_backend.md new file mode 100644 index 0000000000..767d18c884 --- /dev/null +++ b/reference/execution/execution/system_context_replaceability/query_parallel_scheduler_backend.md @@ -0,0 +1,43 @@ +# query_parallel_scheduler_backend +* execution[meta header] +* function[meta id-type] +* std::execution::system_context_replaceability[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution::system_context_replaceability { + shared_ptr query_parallel_scheduler_backend(); +} +``` +* parallel_scheduler_backend[link parallel_scheduler_backend.md] + +## 概要 +[並列Scheduler](../parallel_scheduler.md)の実装オブジェクトを返す。 + + +## 効果 +[`parallel_scheduler_backend`](parallel_scheduler_backend.md)インタフェースを実装したオブジェクトを指す非ヌル[`shared_ptr`](/reference/memory/shared_ptr.md)を返す。 + + +## 備考 +この関数は置換可能(replaceable)である。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::parallel_scheduler`](../parallel_scheduler.md) +- [`execution::system_context_replaceability::parallel_scheduler_backend`](parallel_scheduler_backend.md) + + +## 参照 +- [P2079R10 Parallel scheduler](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2079r10.html) From a4d3b95095cd98351e9844ca05c0a0dd3d65d562 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 29 Aug 2025 22:44:49 +0900 Subject: [PATCH 2339/3948] execution: P2079R10 Replaceability API (#1511) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - receiver_proxyクラス - bulk_item_receiver_proxyクラス --- .../execution/execution/parallel_scheduler.md | 14 ++--- .../system_context_replaceability.md | 4 +- .../bulk_item_receiver_proxy.md | 42 ++++++++++++++ .../parallel_scheduler_backend.md | 2 +- .../parallel_scheduler_backend/schedule.md | 9 +-- .../schedule_bulk_chunked.md | 18 +++--- .../schedule_bulk_unchunked.md | 16 +++--- .../receiver_proxy.md | 44 ++++++++++++++ .../receiver_proxy/try_query.md | 57 +++++++++++++++++++ 9 files changed, 177 insertions(+), 29 deletions(-) create mode 100644 reference/execution/execution/system_context_replaceability/bulk_item_receiver_proxy.md create mode 100644 reference/execution/execution/system_context_replaceability/receiver_proxy.md create mode 100644 reference/execution/execution/system_context_replaceability/receiver_proxy/try_query.md diff --git a/reference/execution/execution/parallel_scheduler.md b/reference/execution/execution/parallel_scheduler.md index 4b87f2a1c6..416c59a49e 100644 --- a/reference/execution/execution/parallel_scheduler.md +++ b/reference/execution/execution/parallel_scheduler.md @@ -34,7 +34,7 @@ namespace std::execution { 説明用の`sch2`を`parallel_scheduler`型のオブジェクトとしたとき、`BACKEND-OF(sch)`と`BACKEND-OF(sch2)`が同一オブジェクトを指す場合に限って、2つのオブジェクト`sch`と`sch2`は等しい。 -`rcvr`を[Receiver](receiver.md)としたとき、基底`B`を持つ`rcvr`のプロキシ(proxy for `rcvr` with base `B`)は下記を満たす`B`型の左辺値`r`となる。 +`rcvr`を[Receiver](receiver.md)としたとき、基底`B`を持つ`rcvr`のプロキシは下記を満たす`B`型の左辺値`r`となる。 - `r.set_value()`は、[`set_value`](set_value.md)`(std::move(rcvr))`と同じ効果。 - `r.set_error(e)`は、`e`を[`exception_ptr`](/reference/exception/exception_ptr.md)として、[`set_error`](set_error.md)`(std::move(rcvr), std::move(e))`と同じ効果。 @@ -43,22 +43,22 @@ namespace std::execution { プロキシ`r`に対する事前確保バックエンドストレージ(preallocated backend storage)は、[`span`](/reference/span/span.md)`<`[`byte`](/reference/cstddef/byte.md)`>`型のオブジェクト`s`であり、`r`に対して[`set_value`](set_value.md)/[`set_error`](set_error.md)/[`set_stopped`](set_stopped.md)いずれかが呼び出されるまで範囲`s`は有効かつ上書き可能である。 呼び出し可能オブジェクト`f`と引数`arg`を持つ`rcvr`のバルクチャンク化プロキシ(bulk chunked proxy)は、基底 -[`system_context_replaceability::bulk_item_receiver_proxy`](system_context_replaceability/bulk_item_receiver_proxy.md.nolink)を持つ`rcvr`のプロキシ`r`であり、インデクス`i`, `j`に対する`r.execute(i, j)`は`f(i, j, args...)`と同じ効果を持つ。 +[`system_context_replaceability::bulk_item_receiver_proxy`](system_context_replaceability/bulk_item_receiver_proxy.md)を持つ`rcvr`のプロキシ`r`であり、インデクス`i`, `j`に対する`r.execute(i, j)`は`f(i, j, args...)`と同じ効果を持つ。 呼び出し可能オブジェクト`f`と引数`arg`を持つ`rcvr`のバルク非チャンク化プロキシ(bulk unchunked proxy)は、基底 -[`system_context_replaceability::bulk_item_receiver_proxy`](system_context_replaceability/bulk_item_receiver_proxy.md.nolink)を持つ`rcvr`のプロキシ`r`であり、インデクス`i`に対する`r.execute(i, i + 1)`は`f(i, args...)`と同じ効果を持つ。 +[`system_context_replaceability::bulk_item_receiver_proxy`](system_context_replaceability/bulk_item_receiver_proxy.md)を持つ`rcvr`のプロキシ`r`であり、インデクス`i`に対する`r.execute(i, i + 1)`は`f(i, args...)`と同じ効果を持つ。 -### `schedule` ファクトリ +### `schedule`アルゴリズム 説明用の`b`を`BACKEND-OF(sch)`、`sndr`を[`schedule`](schedule.md)`(sch)`が返すオブジェクト、`rcvr`を[Receiver](receiver.md)とする。`rcvr`が`sndr`に[接続(connect)](connect.md)され、結果の[Operation State](operation_state.md)が[開始(start)](start.md)されたとき、 - `sndr`が値完了するならば、[`b.schedule`](system_context_replaceability/parallel_scheduler_backend/schedule.md)`(r, s)`が呼ばれる。このとき、 - - `r`は基底[`system_context_replaceability::receiver_proxy`](system_context_replaceability/receiver_proxy.md.nolink)を持つ`rcvr`のプロキシであり、かつ + - `r`は基底[`system_context_replaceability::receiver_proxy`](system_context_replaceability/receiver_proxy.md)を持つ`rcvr`のプロキシであり、かつ - `s`は`r`に対する事前確保バックエンドストレージである。 - 他の全ての完了操作は、変更なしに転送される。 -### `bulk_chunked` アダプタ +### `bulk_chunked`アルゴリズム `parallel_scheduler`は[`bulk_chunked`](bulk_chunked.md)アルゴリズムのカスタマイズ実装を提供する。[Receiver](receiver.md)`rcvr`が`bulk_chunked(sndr, pol, shape, f)`が返す[Sender](sender.md)に[接続(connect)](connect.md)され、結果の[Operation State](operation_state.md)が[開始(start)](start.md)されたとき、 - `sndr`が値`vals`で値完了するならば、`args`を`vals`を指す左辺値式のパックとして、[`b.schedule_bulk_chunked`](system_context_replaceability/parallel_scheduler_backend/schedule_bulk_chunked.md)`(shape, r, s)`が呼ばれる。このとき、 @@ -67,7 +67,7 @@ namespace std::execution { - 他の全ての完了操作は、変更なしに転送される。 -### `bulk_unchunked` アダプタ +### `bulk_unchunked`アルゴリズム `parallel_scheduler`は[`bulk_unchunked`](bulk_unchunked.md)アルゴリズムのカスタマイズ実装を提供する。[Receiver](receiver.md)`rcvr`が`bulk_unchunked(sndr, pol, shape, f)`が返す[Sender](sender.md)に[接続(connect)](connect.md)され、結果の[Operation State](operation_state.md)が[開始(start)](start.md)されたとき、 - `sndr`が値`vals`で値完了するならば、`args`を`vals`を指す左辺値式のパックとして、[`b.schedule_bulk_unchunked`](system_context_replaceability/parallel_scheduler_backend/schedule_bulk_unchunked.md)`(shape, r, s)`が呼ばれる。このとき、 diff --git a/reference/execution/execution/system_context_replaceability.md b/reference/execution/execution/system_context_replaceability.md index c33fed812d..66395c6fcd 100644 --- a/reference/execution/execution/system_context_replaceability.md +++ b/reference/execution/execution/system_context_replaceability.md @@ -14,8 +14,8 @@ namespace std::execution::system_context_replaceability { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`receiver_proxy`](system_context_replaceability/receiver_proxy.md.nolink) | バックエンド実装用のReceiverプロキシ (class) | C++26 | -| [`bulk_item_receiver_proxy`](system_context_replaceability/bulk_item_receiver_proxy.md.nolink) | バックエンド実装用のバルク処理Receiverプロキシ (class) | C++26 | +| [`receiver_proxy`](system_context_replaceability/receiver_proxy.md) | バックエンド実装用のReceiverプロキシ (class) | C++26 | +| [`bulk_item_receiver_proxy`](system_context_replaceability/bulk_item_receiver_proxy.md) | バックエンド実装用のバルク処理Receiverプロキシ (class) | C++26 | | [`parallel_scheduler_backend`](system_context_replaceability/parallel_scheduler_backend.md) | 並列Schedulerバックエンド (class) | C++26 | | [`query_parallel_scheduler_backend`](system_context_replaceability/query_parallel_scheduler_backend.md) | 並列Schedulerバックエンドを問い合わせ (function) | C++26 | diff --git a/reference/execution/execution/system_context_replaceability/bulk_item_receiver_proxy.md b/reference/execution/execution/system_context_replaceability/bulk_item_receiver_proxy.md new file mode 100644 index 0000000000..941bc85931 --- /dev/null +++ b/reference/execution/execution/system_context_replaceability/bulk_item_receiver_proxy.md @@ -0,0 +1,42 @@ +# bulk_item_receiver_proxy +* execution[meta header] +* class[meta id-type] +* std::execution::system_context_replaceability[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution::system_context_replaceability { + struct bulk_item_receiver_proxy : receiver_proxy { see below }; +} +``` +* receiver_proxy[link receiver_proxy.md] + +## 概要 +`bulk_item_receiver_proxy`は、[`receiver_proxy`](receiver_proxy.md)から派生したクラス。 +[`bulk_chunked`](../bulk_chunked.md)および[`bulk_unchunked`](../bulk_unchunked.md)のカスタマイズで用いられ、異なる反復に対応する[`parallel_scheduler_backend`](parallel_scheduler_backend.md)実装から通知も受信する。 + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `virtual void execute(size_t, size_t) noexcept = 0;` | 要素範囲の作業ハンドラ | C++26 | + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::parallel_scheduler`](../parallel_scheduler.md) + + +## 参照 +- [P2079R10 Parallel scheduler](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2079r10.html) diff --git a/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend.md b/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend.md index 43097c515c..20db9b7667 100644 --- a/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend.md +++ b/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend.md @@ -11,7 +11,7 @@ namespace std::execution::system_context_replaceability { ``` ## 概要 -[並列Scheduler](../parallel_scheduler.md)バックエンドのインタフェース(純粋仮想関数)を定義するクラス。 +`parallel_scheduler_backend`は、[並列Scheduler](../parallel_scheduler.md)バックエンド実装者向けのインタフェースを定義する。 ## メンバ関数 diff --git a/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/schedule.md b/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/schedule.md index dfae56c978..56b1a53f99 100644 --- a/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/schedule.md +++ b/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/schedule.md @@ -8,7 +8,8 @@ ```cpp virtual void schedule(receiver_proxy& r, span s) noexcept = 0; ``` -* receiver_proxy[link ../receiver_proxy.md.nolink] +* receiver_proxy[link ../receiver_proxy.md] +* span[link /reference/span/span.md] * byte[link /reference/cstddef/byte.md] ## 概要 @@ -23,9 +24,9 @@ virtual void schedule(receiver_proxy& r, span s) noexcept = 0; 派生クラスでは、この関数を下記のように実装すべきである。 - 下記いずれかの式が評価される - - エラーが発生せず作業が成功したとき、`r.set_value()` - - エラーが発生したとき、`eptr`を[`exception_ptr`](/reference/exception/exception_ptr.md)型のオブジェクトとして、`r.set_error(eptr)` - - 作業がキャンセルされたとき、`r.set_stopped()` + - エラーが発生せず作業が成功したとき、[`r.set_value()`](../receiver_proxy.md) + - エラーが発生したとき、`eptr`を[`exception_ptr`](/reference/exception/exception_ptr.md)型のオブジェクトとして、[`r.set_error`](../receiver_proxy.md)`(eptr)` + - 作業がキャンセルされたとき、[`r.set_stopped()`](../receiver_proxy.md) - 任意の`r.set_value()`呼び出しは、`*this`で表される実行コンテキストの実行エージェント上で発生する。 diff --git a/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/schedule_bulk_chunked.md b/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/schedule_bulk_chunked.md index 4ee6689e2e..809730d137 100644 --- a/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/schedule_bulk_chunked.md +++ b/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/schedule_bulk_chunked.md @@ -6,10 +6,12 @@ * cpp26[meta cpp] ```cpp -virtual void schedule_bulk_chunked(size_t n, bulk_item_receiver_proxy& r, +virtual void schedule_bulk_chunked(size_t n, + bulk_item_receiver_proxy& r, span s) noexcept = 0; ``` -* bulk_item_receiver_proxy[link ../bulk_item_receiver_proxy.md.nolink] +* bulk_item_receiver_proxy[link ../bulk_item_receiver_proxy.md] +* span[link /reference/span/span.md] * byte[link /reference/cstddef/byte.md] ## 概要 @@ -24,12 +26,12 @@ virtual void schedule_bulk_chunked(size_t n, bulk_item_receiver_proxy& r, 派生クラスでは、この関数を下記のように実装すべきである。 - 下記いずれかの式が評価される - - エラーが発生せず作業が成功したとき、`r.set_value()` - - エラーが発生したとき、`eptr`を[`exception_ptr`](/reference/exception/exception_ptr.md)型のオブジェクトとして、`r.set_error(eptr)` - - 作業がキャンセルされたとき、`r.set_stopped()` -- `r.execute(b, e)`が呼ばれたとき、`b`と`e`は範囲`[0, n)`内かつ`b < e`である -- 範囲`[0, n)`の各`i`について、`i`が`[b, e)`の範囲内にある`r.execute(b, e)`の呼び出しが最大で1つだけ存在する。 -- `r.set_value()`が呼び出されたとき、`[0, n)`の各`i`に対して、`i`が`[b, e)`の範囲内となる`r.execute(b, e)`の呼び出しが正確に1つだけ存在する。 + - エラーが発生せず作業が成功したとき、[`r.set_value()`](../receiver_proxy.md) + - エラーが発生したとき、`eptr`を[`exception_ptr`](/reference/exception/exception_ptr.md)型のオブジェクトとして、[`r.set_error`](../receiver_proxy.md)`(eptr)` + - 作業がキャンセルされたとき、[`r.set_stopped()`](../receiver_proxy.md) +- [`r.execute`](../bulk_item_receiver_proxy.md)`(b, e)`が呼ばれたとき、`b`と`e`は範囲`[0, n)`内かつ`b < e`である +- 範囲`[0, n)`の各`i`について、`i`が`[b, e)`の範囲内にある[`r.execute`](../bulk_item_receiver_proxy.md)`(b, e)`の呼び出しが最大で1つだけ存在する。 +- `r.set_value()`が呼び出されたとき、`[0, n)`の各`i`に対して、`i`が`[b, e)`の範囲内となる[`r.execute`](../bulk_item_receiver_proxy.md)`(b, e)`の呼び出しが正確に1つだけ存在する。 - `r`上での全ての`execute`呼び出しは、`r`上での`set_value`/`set_error`/`set_stopped`いずれかの呼び出しよりも前に発生する。 - `r`上での全ての`execute`および`set_value`呼び出しは、`*this`で表される実行コンテキストの実行エージェント上で行われる。 diff --git a/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/schedule_bulk_unchunked.md b/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/schedule_bulk_unchunked.md index d78a582d03..b85483f7d9 100644 --- a/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/schedule_bulk_unchunked.md +++ b/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/schedule_bulk_unchunked.md @@ -6,10 +6,12 @@ * cpp26[meta cpp] ```cpp -virtual void schedule_bulk_unchunked(size_t n, bulk_item_receiver_proxy& r, +virtual void schedule_bulk_unchunked(size_t n, + bulk_item_receiver_proxy& r, span s) noexcept = 0; ``` -* bulk_item_receiver_proxy[link ../bulk_item_receiver_proxy.md.nolink] +* bulk_item_receiver_proxy[link ../bulk_item_receiver_proxy.md] +* span[link /reference/span/span.md] * byte[link /reference/cstddef/byte.md] ## 概要 @@ -24,11 +26,11 @@ virtual void schedule_bulk_unchunked(size_t n, bulk_item_receiver_proxy& r, 派生クラスでは、この関数を下記のように実装すべきである。 - 下記いずれかの式が評価される - - エラーが発生せず作業が成功したとき、`r.set_value()` - - エラーが発生したとき、`eptr`を[`exception_ptr`](/reference/exception/exception_ptr.md)型のオブジェクトとして、`r.set_error(eptr)` - - 作業がキャンセルされたとき、`r.set_stopped()` -- `r.execute(b, e)`が呼ばれたとき、`b`は範囲`[0, n)`内かつ`e`は`b + 1`に等しい。`[0, n)`の各`i`について、`r.execute(i, i + 1)`の呼び出しが最大で1つだけ存在する。 -- `r.set_value()`が呼び出されたとき、`[0, n)`の各`i`に対して、`r.execute(i, i + 1)`の呼び出しが正確に1つだけ存在する。 + - エラーが発生せず作業が成功したとき、[`r.set_value()`](../receiver_proxy.md) + - エラーが発生したとき、`eptr`を[`exception_ptr`](/reference/exception/exception_ptr.md)型のオブジェクトとして、[`r.set_error`](../receiver_proxy.md)`(eptr)` + - 作業がキャンセルされたとき、[`r.set_stopped()`](../receiver_proxy.md) +- [`r.execute`](../bulk_item_receiver_proxy.md)`(b, e)`が呼ばれたとき、`b`は範囲`[0, n)`内かつ`e`は`b + 1`に等しい。`[0, n)`の各`i`について、[`r.execute`](../bulk_item_receiver_proxy.md)`(i, i + 1)`の呼び出しが最大で1つだけ存在する。 +- `r.set_value()`が呼び出されたとき、`[0, n)`の各`i`に対して、[`r.execute`](../bulk_item_receiver_proxy.md)`(i, i + 1)`の呼び出しが正確に1つだけ存在する。 - `r`上での全ての`execute`呼び出しは、`r`上での`set_value`/`set_error`/`set_stopped`いずれかの呼び出しよりも前に発生する。 - `r`上での全ての`execute`および`set_value`呼び出しは、`*this`で表される実行コンテキストの実行エージェント上で行われる。 diff --git a/reference/execution/execution/system_context_replaceability/receiver_proxy.md b/reference/execution/execution/system_context_replaceability/receiver_proxy.md new file mode 100644 index 0000000000..21ddce22f0 --- /dev/null +++ b/reference/execution/execution/system_context_replaceability/receiver_proxy.md @@ -0,0 +1,44 @@ +# receiver_proxy +* execution[meta header] +* class[meta id-type] +* std::execution::system_context_replaceability[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution::system_context_replaceability { + struct receiver_proxy; +} +``` + +## 概要 +`receiver_proxy`は、[`parallel_scheduler_backend`](parallel_scheduler_backend.md)実装から完了操作のトリガー通知を受け取る[`Receiver`](../receiver.md)を表現する。 + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `virtual ~receiver_proxy() = default;` | デストラクタ | C++26 | +| `virtual void set_value() noexcept = 0;` | 値完了ハンドラ | C++26 | +| `virtual void set_error(exception_ptr) noexcept = 0;` | エラー完了ハンドラ | C++26 | +| `virtual void set_stopped() noexcept = 0;` | 停止完了ハンドラ | C++26 | +| [`try_query`](receiver_proxy/try_query.md) | クエリオブジェクト問い合わせ | C++26 | + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::parallel_scheduler`](../parallel_scheduler.md) + + +## 参照 +- [P2079R10 Parallel scheduler](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2079r10.html) diff --git a/reference/execution/execution/system_context_replaceability/receiver_proxy/try_query.md b/reference/execution/execution/system_context_replaceability/receiver_proxy/try_query.md new file mode 100644 index 0000000000..b007d8fe1a --- /dev/null +++ b/reference/execution/execution/system_context_replaceability/receiver_proxy/try_query.md @@ -0,0 +1,57 @@ +# try_query +* execution[meta header] +* std::execution::system_context_replaceability[meta namespace] +* receiver_proxy[meta class] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +optional

try_query(Query q) noexcept; +``` +* class-type[link ../../../class-type.md] +* optional[link /reference/optional/optional.md] + +## 概要 +[`parallel_scheduler`](../../parallel_scheduler.md)バックエンド実装側から[Receiver](../../receiver.md)環境にアクセスするための補助関数。 + + +## 適格要件 +`P`はcv修飾された非配列オブジェクト型。 + + +## 戻り値 +説明用の`env`を`*this`が表現する[Receiver](../../receiver.md)の環境とする。 +下記を満たす場合は[`nullopt`](/reference/optional/nullopt_t.md)を返す。そうでなければ、`q(env)`を返す。 + +- `Query`が実装定義のサポートされたクエリ集合のメンバではない、または +- `P`が実装定義のサポートされた`Query`の結果型集合のメンバではない、または +- 式`q(env)`が適格でないか、cv修飾された`P`型を持たない。 + + +## 例外 +投げない + + +## 備考 +[`get_stop_token_t`](../../../get_stop_token.md)は実装定義のサポートされたクエリ集合に含まれ、[`inplace_stop_token`](/reference/stop_token/inplace_stop_token.md)は`get_stop_token_t`の実装定義のサポートされた結果型集合のメンバである。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::parallel_scheduler`](../../parallel_scheduler.md) +- [`execution::parallel_scheduler_backend::parallel_scheduler_backend`](../parallel_scheduler_backend.md) + + +## 参照 +- [P2079R10 Parallel scheduler](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2079r10.html) From bdd426b245b4df9048734349463769e794ad2b1e Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 29 Aug 2025 23:39:34 +0900 Subject: [PATCH 2340/3948] =?UTF-8?q?execution:=20P2079R10=20=E8=AA=BF?= =?UTF-8?q?=E6=95=B4(#1511)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../execution/execution/parallel_scheduler.md | 21 +++++++++++++++++++ .../system_context_replaceability.md | 6 ++++++ .../receiver_proxy/try_query.md | 8 +++---- 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/reference/execution/execution/parallel_scheduler.md b/reference/execution/execution/parallel_scheduler.md index 416c59a49e..47dc63b2ac 100644 --- a/reference/execution/execution/parallel_scheduler.md +++ b/reference/execution/execution/parallel_scheduler.md @@ -76,6 +76,27 @@ namespace std::execution { - 他の全ての完了操作は、変更なしに転送される。 +## 例 +```cpp example +#include +#include +namespace ex = std::execution; + +int main() +{ + ex::scheduler auto sch = ex::get_parallel_scheduler(); + static_assert(std::same_as); +} +``` +* ex::parallel_scheduler[color ff0000] +* ex::scheduler[link scheduler.md] +* ex::get_parallel_scheduler()[link get_parallel_scheduler.md] + +### 出力 +``` +``` + + ## バージョン ### 言語 - C++26 diff --git a/reference/execution/execution/system_context_replaceability.md b/reference/execution/execution/system_context_replaceability.md index 66395c6fcd..c52b84ff44 100644 --- a/reference/execution/execution/system_context_replaceability.md +++ b/reference/execution/execution/system_context_replaceability.md @@ -12,6 +12,12 @@ namespace std::execution::system_context_replaceability { } ``` +[並列Scheduler](parallel_scheduler.md)をユーザ実装で置き換える場合、下記が必要となる。 + +- [`system_context_replaceability::parallel_scheduler_backend`](system_context_replaceability/parallel_scheduler_backend.md)インターフェースをバックエンドにもつ並列Schedulerを実装する。 +- 処理系の手順に従って、[`system_context_replaceability::query_parallel_scheduler_backend`](system_context_replaceability/query_parallel_scheduler_backend.md)シンボルを自前バックエンド実装を返す関数で置き換える。 + + | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`receiver_proxy`](system_context_replaceability/receiver_proxy.md) | バックエンド実装用のReceiverプロキシ (class) | C++26 | diff --git a/reference/execution/execution/system_context_replaceability/receiver_proxy/try_query.md b/reference/execution/execution/system_context_replaceability/receiver_proxy/try_query.md index b007d8fe1a..e12337398f 100644 --- a/reference/execution/execution/system_context_replaceability/receiver_proxy/try_query.md +++ b/reference/execution/execution/system_context_replaceability/receiver_proxy/try_query.md @@ -24,8 +24,8 @@ optional

try_query(Query q) noexcept; 説明用の`env`を`*this`が表現する[Receiver](../../receiver.md)の環境とする。 下記を満たす場合は[`nullopt`](/reference/optional/nullopt_t.md)を返す。そうでなければ、`q(env)`を返す。 -- `Query`が実装定義のサポートされたクエリ集合のメンバではない、または -- `P`が実装定義のサポートされた`Query`の結果型集合のメンバではない、または +- `Query`が実装定義でサポートされるクエリ集合のメンバではない、または +- `P`が実装定義でサポートされる`Query`の結果型集合のメンバではない、または - 式`q(env)`が適格でないか、cv修飾された`P`型を持たない。 @@ -34,7 +34,7 @@ optional

try_query(Query q) noexcept; ## 備考 -[`get_stop_token_t`](../../../get_stop_token.md)は実装定義のサポートされたクエリ集合に含まれ、[`inplace_stop_token`](/reference/stop_token/inplace_stop_token.md)は`get_stop_token_t`の実装定義のサポートされた結果型集合のメンバである。 +[`get_stop_token_t`](../../../get_stop_token.md)は実装定義でサポートるクエリ集合に含まれ、[`inplace_stop_token`](/reference/stop_token/inplace_stop_token.md)は`get_stop_token_t`の実装定義でサポートされる結果型集合のメンバである。 ## バージョン @@ -50,7 +50,7 @@ optional

try_query(Query q) noexcept; ## 関連項目 - [`execution::parallel_scheduler`](../../parallel_scheduler.md) -- [`execution::parallel_scheduler_backend::parallel_scheduler_backend`](../parallel_scheduler_backend.md) +- [`execution::system_context_replaceability::parallel_scheduler_backend`](../parallel_scheduler_backend.md) ## 参照 From b11575f63626e1deb7184935d36a7a3de01bb47e Mon Sep 17 00:00:00 2001 From: yoh Date: Sat, 30 Aug 2025 00:37:44 +0900 Subject: [PATCH 2341/3948] execution: C++26 P3433R1 (#1509) --- .../execution/allocator-aware-forward.md | 42 +++++++++++++++++++ reference/execution/execution/impls-for.md | 4 +- reference/execution/execution/let_value.md | 5 ++- 3 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 reference/execution/execution/allocator-aware-forward.md diff --git a/reference/execution/execution/allocator-aware-forward.md b/reference/execution/execution/allocator-aware-forward.md new file mode 100644 index 0000000000..f446275691 --- /dev/null +++ b/reference/execution/execution/allocator-aware-forward.md @@ -0,0 +1,42 @@ +# allocator-aware-forward +* execution[meta header] +* function template[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +template +decltype(auto) allocator-aware-forward(T&& obj, Context&& context); +``` + +## 概要 +`allocator-aware-forward`は、Senderアルゴリズム動作仕様定義で用いられる説明専用の関数テンプレートである。 + +アロケータの利用可否に応じて、`obj`から`T`型の新規オブジェクトを作成するか、`obj`を転送する。 +`context`に関連付けられた[環境](../queryable.md)がアロケータを提供する(つまり、式[`get_allocator`](../get_allocator.md)`(`[`get_env`](get_env.md)`(context))`が有効である)とき、同式の結果を`alloc`、型`P`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``とする。 + + +## 戻り値 +- `alloc`が定義されなければ、[`std::forward`](/reference/utility/forward.md)`(obj)`を返す。 +- そうではなく、`P`が`product-type`の特殊化のときは、`obj`の要素を`e`としたとき各要素が次の通り初期化された`P`型のオブジェクトを返す。 + + ```cpp + make_obj_using_allocator(std::forward_like(e), alloc) + ``` + * make_obj_using_allocator[link /reference/memory/make_obj_using_allocator.md] + +- そうでなければ、[`make_obj_using_allocator`](/reference/memory/make_obj_using_allocator.md)`

(`[`std::forward`](/reference/utility/forward.md)`(e), alloc)`を返す。 + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`execution::impls-for`](impls-for.md) +- [`execution::let_value`](let_value.md) + + +## 参照 +- [P3433R1 Allocator Support for Operation States](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3433r1.pdf0) diff --git a/reference/execution/execution/impls-for.md b/reference/execution/execution/impls-for.md index f875fb8a35..13639a9400 100644 --- a/reference/execution/execution/impls-for.md +++ b/reference/execution/execution/impls-for.md @@ -75,9 +75,10 @@ namespace std::execution { ```cpp [](Sndr&& sndr, Rcvr& rcvr) noexcept -> decltype(auto) { auto& [_, data, ...child] = sndr; - return std::forward_like(data); + return allocator-aware-forward(std::forward_like(data), rcvr); } ``` +* allocator-aware-forward[link allocator-aware-forward.md] ### `start`メンバ `start`は、[`basic-operation`](basic-operation.md)実装における[開始(start)](start.md)のカスタマイゼーションポイントとして機能する。 @@ -146,4 +147,5 @@ static consteval void default-impls::check-types(); ## 参照 - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3433R1 Allocator Support for Operation States](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3433r1.pdf0) - [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) diff --git a/reference/execution/execution/let_value.md b/reference/execution/execution/let_value.md index a92609bdc8..04eb86aa87 100644 --- a/reference/execution/execution/let_value.md +++ b/reference/execution/execution/let_value.md @@ -83,9 +83,11 @@ namespace std::execution { args_variant_t args; // exposition only ops2_variant_t ops2; // exposition only }; - return state-type{std::forward_like(fn), let-env(child), {}, {}}; + return state-type{allocator-aware-forward(std::forward_like(fn), rcvr), + let-env(child), {}, {}}; } ``` +* allocator-aware-forward[link allocator-aware-forward.md] - 説明用のパック`Sigs`を[`completion_signatures_of_t`](completion_signatures_of_t.md)`<`[`child-type`](child-type.md)`,` [`FWD-ENV-T`](../forwarding_query.md)`(`[`env_of_t`](env_of_t.md)`)>`による[`completion_signatures`](completion_signatures.md)特殊化のテンプレートパラメータとし、パック`LetSigs`を`Sigs`に含まれる型のうち戻り値型が[`decayed-typeof`](/reference/functional/decayed-typeof.md)``に等しいものと定義する。説明用のエイリアステンプレート`as-tuple`を[`decayed-tuple`](decayed-tuple.md)``と定義する。型`args_variant_t`は下記定義において重複削除した型となる。 @@ -438,6 +440,7 @@ catch 0 - [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) - [P3396R1 std::execution wording fixes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3396r1.html) +- [P3433R1 Allocator Support for Operation States](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3433r1.pdf0) - [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) - [LWG 4203. Constraints on `get-state` functions are incorrect](https://cplusplus.github.io/LWG/issue4203) - [LWG 4204. specification of `as-sndr2(Sig)` in [exec.let] is incomplete](https://cplusplus.github.io/LWG/issue4204) From cd924cf4feb6256fc9ab05d086071dbcc8aacc6b Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sun, 31 Aug 2025 16:38:54 +0900 Subject: [PATCH 2342/3948] =?UTF-8?q?3=E7=82=B9=E3=83=AA=E3=83=BC=E3=83=80?= =?UTF-8?q?=E3=81=AE=E5=89=8D=E3=81=AB=E3=82=B9=E3=83=9A=E3=83=BC=E3=82=B9?= =?UTF-8?q?=E3=82=92=E6=8C=BF=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 一括変換しました。 --- reference/ranges/adjacent_view.md | 2 +- reference/ranges/cartesian_product_view.md | 2 +- reference/ranges/chunk_by_view.md | 2 +- reference/ranges/chunk_view.md | 2 +- reference/ranges/concat_view.md | 2 +- reference/ranges/slide_view.md | 2 +- reference/ranges/stride_view.md | 2 +- reference/ranges/zip_transform_view.md | 2 +- reference/ranges/zip_view.md | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/reference/ranges/adjacent_view.md b/reference/ranges/adjacent_view.md index 63b69d494b..f62fe46912 100644 --- a/reference/ranges/adjacent_view.md +++ b/reference/ranges/adjacent_view.md @@ -8,7 +8,7 @@ namespace std::ranges { template requires view && (N > 0) - class adjacent_view : public view_interface> {…… }; // (1) + class adjacent_view : public view_interface> { …… }; // (1) namespace views { template diff --git a/reference/ranges/cartesian_product_view.md b/reference/ranges/cartesian_product_view.md index f70ebf3ea7..f28ffec662 100644 --- a/reference/ranges/cartesian_product_view.md +++ b/reference/ranges/cartesian_product_view.md @@ -8,7 +8,7 @@ namespace std::ranges { template requires (view && ... && view) - class cartesian_product_view : public view_interface> {…… }; // (1) + class cartesian_product_view : public view_interface> { …… }; // (1) namespace views { inline constexpr /*unspecified*/ cartesian_product = /*unspecified*/; // (2) diff --git a/reference/ranges/chunk_by_view.md b/reference/ranges/chunk_by_view.md index 8b8d90632a..5bbe0f4d20 100644 --- a/reference/ranges/chunk_by_view.md +++ b/reference/ranges/chunk_by_view.md @@ -8,7 +8,7 @@ namespace std::ranges { template, iterator_t> Pred> requires view && is_object_v - class chunk_by_view : public view_interface> {…… }; // (1) + class chunk_by_view : public view_interface> { …… }; // (1) namespace views { inline constexpr /*unspecified*/ chunk_by = /*unspecified*/; // (2) diff --git a/reference/ranges/chunk_view.md b/reference/ranges/chunk_view.md index 1452c0e03a..0c837cb3a8 100644 --- a/reference/ranges/chunk_view.md +++ b/reference/ranges/chunk_view.md @@ -8,7 +8,7 @@ namespace std::ranges { template requires input_range - class chunk_view : public view_interface> {…… }; // (1) + class chunk_view : public view_interface> { …… }; // (1) namespace views { inline constexpr /*unspecified*/ chunk = /*unspecified*/; // (2) diff --git a/reference/ranges/concat_view.md b/reference/ranges/concat_view.md index 54b39fc32a..23109df856 100644 --- a/reference/ranges/concat_view.md +++ b/reference/ranges/concat_view.md @@ -8,7 +8,7 @@ namespace std::ranges { template requires (view && ...) && (sizeof...(Views) > 0) && concatable - class concat_view : public view_interface> {…… }; // (1) + class concat_view : public view_interface> { …… }; // (1) namespace views { inline constexpr /*unspecified*/ concat = /*unspecified*/; // (2) diff --git a/reference/ranges/slide_view.md b/reference/ranges/slide_view.md index 7f48717348..0eed5231b3 100644 --- a/reference/ranges/slide_view.md +++ b/reference/ranges/slide_view.md @@ -8,7 +8,7 @@ namespace std::ranges { template requires input_range - class slide_view : public view_interface> {…… }; // (1) + class slide_view : public view_interface> { …… }; // (1) namespace views { inline constexpr /*unspecified*/ slide = /*unspecified*/; // (2) diff --git a/reference/ranges/stride_view.md b/reference/ranges/stride_view.md index d14de81ecc..8c0d7dbb0f 100644 --- a/reference/ranges/stride_view.md +++ b/reference/ranges/stride_view.md @@ -8,7 +8,7 @@ namespace std::ranges { template requires view - class stride_view : public view_interface> {…… }; // (1) + class stride_view : public view_interface> { …… }; // (1) namespace views { inline constexpr /*unspecified*/ stride = /*unspecified*/; // (2) diff --git a/reference/ranges/zip_transform_view.md b/reference/ranges/zip_transform_view.md index cad05caf03..6da456b103 100644 --- a/reference/ranges/zip_transform_view.md +++ b/reference/ranges/zip_transform_view.md @@ -10,7 +10,7 @@ namespace std::ranges { requires (view && ...) && (sizeof...(Views) > 0) && is_object_v && regular_invocable...> && can-reference...>> - class zip_transform_view : public view_interface> {…… }; // (1) + class zip_transform_view : public view_interface> { …… }; // (1) namespace views { inline constexpr /*unspecified*/ zip_transform = /*unspecified*/; // (2) diff --git a/reference/ranges/zip_view.md b/reference/ranges/zip_view.md index 74720f2903..9b847f3652 100644 --- a/reference/ranges/zip_view.md +++ b/reference/ranges/zip_view.md @@ -8,7 +8,7 @@ namespace std::ranges { template requires (view && ...) && (sizeof...(Views) > 0) - class zip_view : public view_interface> {…… }; // (1) + class zip_view : public view_interface> { …… }; // (1) namespace views { inline constexpr /*unspecified*/ zip = /*unspecified*/; // (2) From b981b77147631a70af2ebb34be205e70770b196a Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sun, 31 Aug 2025 17:35:30 +0900 Subject: [PATCH 2343/3948] =?UTF-8?q?cpp20/coroutines:=20=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E4=B8=AD=E3=81=AE=E6=96=9C=E4=BD=93=E3=81=AE?= =?UTF-8?q?=E5=A4=89=E6=95=B0=E3=82=92=20=20=E3=81=A7=E4=BF=AE?= =?UTF-8?q?=E9=A3=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp20/coroutines.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lang/cpp20/coroutines.md b/lang/cpp20/coroutines.md index 6a380acd1f..c30f35ed2d 100644 --- a/lang/cpp20/coroutines.md +++ b/lang/cpp20/coroutines.md @@ -194,7 +194,7 @@ final-suspend : Promise型のスコープにおいて、非修飾な`return_void`および`return_value`の探索が行われる。両方が見つかった場合、プログラムは不適格となる。 -コルーチン呼び出しのglvalue結果またはprvalue結果オブジェクトを初期化するために、式 _promise_`.get_return_object()`が使われる。 +コルーチン呼び出しのglvalue結果またはprvalue結果オブジェクトを初期化するために、式 _promise_`.get_return_object()`が使われる。 `get_return_object`呼び出しは高々1回であり、`initial_suspend`呼び出しよりも前に順序付けられる。 中断状態にあるコルーチンは、そのコルーチンを指すコルーチンハンドルの再開メンバ関数呼び出しによって、継続実行を再開できる。 @@ -280,9 +280,9 @@ int main() { パラメータのコピーの生存期間は、パラメータPromiseオブジェクトの終了直後で終了する。 (コルーチンが参照渡しのパラメータを持つ場合、そのパラメータにより参照されるエンティティ生存期間終了後のコルーチン再開は未定義動作を引き起こしやすい。) -式 _promise_`.unhandled_exception()`の評価が例外で終了した場合、コルーチンは最終サスペンドポイントで中断したとみなされる。 +式 _promise_`.unhandled_exception()`の評価が例外で終了した場合、コルーチンは最終サスペンドポイントで中断したとみなされる。 -式 `co_await ` _promise_`.final_suspend()` は例外送出してはならない。 +式 `co_await` _promise_`.final_suspend()` は例外送出してはならない。 ### Await式 `co_await`式は、そのオペランド式で表される計算の完了を待機しているあいだ、コルーチン評価をサスペンド(中断)するために用いる。 @@ -303,7 +303,7 @@ Await式の評価では、次のような補助的な型、式、オブジェク - _p_ を同Await式を含むコルーチンのPromiseオブジェクトの左辺値名とし、`P`を同オブジェクトの型とする。 - _a_ (Awaitable) を下記のように定義する: - Await式がYield式または初期サスペンドポイントまたは最終サスペンドポイントにより暗黙に生成された場合、_a_ をその _cast-expression_ とする。 - - `P`のスコープで非修飾な`await_transform`の探索により一つ以上の名前がみつかった場合は、 _a_ を _p_`.await_transform(` _cast-expression_ `)`とする。 + - `P`のスコープで非修飾な`await_transform`の探索により一つ以上の名前がみつかった場合は、 _a_ を _p_`.await_transform(` _cast-expression_ `)`とする。 - それ以外では _a_ を _cast-expression_ とする。 - _o_ (Awaiter) を下記のように定義する。_o_ がprvalueの場合は[Temporary materialization conversion](https://cpprefjp.github.io/lang/cpp17/guaranteed_copy_elision.html)が行われる: - 実引数 _a_ に対して適用可能な`operator co_await`関数を列挙し、_o_ をオーバーロード解決により選択された関数呼び出しとする。 @@ -311,9 +311,9 @@ Await式の評価では、次のような補助的な型、式、オブジェク - オーバーロード解決が曖昧な場合、プログラムは不適格となる。 - _e_ を、_o_ の評価結果を参照する左辺値とする。 - _h_ を、同Await式を含むコルーチンを参照する[`std::coroutine_handle

`](/reference/coroutine/coroutine_handle.md)型のオブジェクトとする。 -- _await-ready_ を、`bool`に変換されうる式 _e_`.await_ready()`とする。 -- _await-suspend_ を、式 _e_`.await_suspend(` _h_ `)`とする。この式(の結果)は`void`であるか、`bool`または任意の型`Z`に対する[`std::coroutine_handle`](/reference/coroutine/coroutine_handle.md)型のprvalueであるべき。 -- _await-resume_ を、式 _e_`.await_resume()`とする。 +- _await-ready_ を、`bool`に変換されうる式 _e_`.await_ready()`とする。 +- _await-suspend_ を、式 _e_`.await_suspend(` _h_ `)`とする。この式(の結果)は`void`であるか、`bool`または任意の型`Z`に対する[`std::coroutine_handle`](/reference/coroutine/coroutine_handle.md)型のprvalueであるべき。 +- _await-resume_ を、式 _e_`.await_resume()`とする。 Await式は式 _await-resume_ と同じ型、同じ値カテゴリを持つ。 @@ -377,7 +377,7 @@ co_yield braced-init-list * braced-init-list[italic] Yield式は関数の中断コンテキストにのみ出現してよい。 -_e_ をYield式のオペランド、_p_ を同式を含むコルーチンのPromiseオブジェクトのlvalue名としたとき、Yield式は式`co_await` _p_`.yield_value(` _e_ `)`と等価である。 +_e_ をYield式のオペランド、_p_ を同式を含むコルーチンのPromiseオブジェクトのlvalue名としたとき、Yield式は式`co_await` _p_`.yield_value(` _e_ `)`と等価である。 ```cpp template @@ -441,10 +441,10 @@ _p_ をコルーチンPromiseオブジェクトのlvalue名とすると、`co_re ここで _final-suspend_ はコルーチン動作説明用の最終サスペンドポイントラベル名であり、_S_ は次の通り定義される: -- オペランドが _braced-init-list_ または非`void`型の式の場合、_S_ を _p_`.return_value(` _expr-or-braced-init-list_ `)`とする。式 _S_ は `void`型のprvalueであるべき。 -- そうでなければ、_S_ を複合文 `{` _expression_ _opt_ `;` _p_`.return_void(); }`とする。式 _p_`.return_void()`は`void`型のprvalueであるべき。 +- オペランドが _braced-init-list_ または非`void`型の式の場合、_S_ を _p_`.return_value(` _expr-or-braced-init-list_ `)`とする。式 _S_ は `void`型のprvalueであるべき。 +- そうでなければ、_S_ を複合文 `{` _expressionopt_ `;` _p_`.return_void(); }`とする。式 _p_`.return_void()`は`void`型のprvalueであるべき。 -_p_`.return_void()`が有効な式のとき、コルーチン本体の終端到達はオペランド無し`co_return`と等価である。 +_p_`.return_void()`が有効な式のとき、コルーチン本体の終端到達はオペランド無し`co_return`と等価である。 そうでなければ、コルーチン本体の終端到達は未定義の動作を引き起こす。 From e79ed6a21639cfc37a3a8f8cbf33e3fd8f402fe1 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sun, 31 Aug 2025 19:06:36 +0900 Subject: [PATCH 2344/3948] =?UTF-8?q?=E3=82=A4=E3=83=B3=E3=83=A9=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=82=B3=E3=83=BC=E3=83=89=E3=81=AE=E5=85=88=E9=A0=AD?= =?UTF-8?q?=E3=83=BB=E6=9C=AB=E5=B0=BE=E3=81=AE=E7=A9=BA=E7=99=BD=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ツールによる変換です。 / `\[`(?=\w)/ → "` [`" /\.md\)` / → ".md) `" cpprefjpではバッククォート内の両端に空白は使用できず、変換時に削除されます。 空白はバッククォートの外で使用すればコードとして連結されます。 しかし、空白をバッククォート内に含めてしまっているミスがいくつかありました。 これにより、カンマや return の後の空白がなくなるなど、インラインコードの見た目に影響していました。 該当箇所を、空白をバッククォートの外に出すことで修正しました。 --- reference/algorithm/ranges_adjacent_find.md | 2 +- reference/algorithm/ranges_all_of.md | 2 +- reference/algorithm/ranges_any_of.md | 2 +- reference/algorithm/ranges_count_if.md | 2 +- reference/algorithm/ranges_ends_with.md | 4 ++-- reference/algorithm/ranges_equal.md | 2 +- reference/algorithm/ranges_equal_range.md | 2 +- reference/algorithm/ranges_find_first_of.md | 2 +- reference/algorithm/ranges_find_if.md | 2 +- reference/algorithm/ranges_find_if_not.md | 2 +- reference/algorithm/ranges_find_last_if.md | 2 +- .../algorithm/ranges_find_last_if_not.md | 2 +- reference/algorithm/ranges_for_each.md | 2 +- reference/algorithm/ranges_for_each_n.md | 2 +- reference/algorithm/ranges_max.md | 2 +- reference/algorithm/ranges_max_element.md | 2 +- reference/algorithm/ranges_min.md | 2 +- reference/algorithm/ranges_min_element.md | 2 +- reference/algorithm/ranges_minmax.md | 2 +- reference/algorithm/ranges_minmax_element.md | 2 +- reference/algorithm/ranges_mismatch.md | 2 +- .../algorithm/ranges_next_permutation.md | 2 +- reference/algorithm/ranges_none_of.md | 2 +- .../algorithm/ranges_partial_sort_copy.md | 2 +- .../algorithm/ranges_prev_permutation.md | 2 +- reference/algorithm/ranges_remove_if.md | 2 +- reference/algorithm/ranges_search.md | 2 +- reference/algorithm/ranges_search_n.md | 2 +- reference/algorithm/ranges_starts_with.md | 2 +- reference/algorithm/ranges_swap_ranges.md | 2 +- reference/cmath/fabs.md | 2 +- reference/compare/strong_order.md | 2 +- reference/compare/weak_order.md | 4 ++-- reference/concepts/Invoke.md | 8 +++---- reference/concepts/assignable_from.md | 2 +- reference/concepts/common_reference_with.md | 2 +- reference/istream/basic_istream/read.md | 2 +- reference/iterator/bidirectional_iterator.md | 2 +- .../iterator/counted_iterator/op_increment.md | 2 +- reference/iterator/is_integer_like.md | 2 +- reference/iterator/ranges_distance.md | 2 +- .../memory/allocator_traits/construct.md | 4 ++-- reference/memory/unique_ptr/op_constructor.md | 4 ++-- reference/random/mersenne_twister_engine.md | 2 +- .../random/subtract_with_carry_engine.md | 2 +- reference/ranges/adjacent_transform_view.md | 4 ++-- reference/ranges/adjacent_view.md | 2 +- reference/ranges/as_rvalue_view.md | 2 +- reference/ranges/contiguous_range.md | 2 +- reference/ranges/copyable_box.md | 4 ++-- reference/ranges/counted.md | 2 +- reference/ranges/drop_view.md | 6 ++--- reference/ranges/drop_while_view.md | 2 +- reference/ranges/empty.md | 2 +- reference/ranges/end.md | 2 +- reference/ranges/enumerate_view.md | 2 +- reference/ranges/filter_view.md | 2 +- reference/ranges/filter_view/begin.md | 2 +- reference/ranges/movable_box.md | 4 ++-- reference/ranges/reverse_view.md | 2 +- reference/ranges/size.md | 2 +- reference/ranges/subrange/size.md | 2 +- reference/ranges/take_view.md | 6 ++--- reference/ranges/take_while_view.md | 2 +- reference/ranges/to.md | 22 +++++++++---------- reference/ranges/zip_transform_view.md | 2 +- reference/ranges/zip_view/end.md | 4 ++-- .../streambuf/basic_streambuf/in_avail.md | 2 +- reference/streambuf/basic_streambuf/setg.md | 2 +- reference/streambuf/basic_streambuf/setp.md | 2 +- reference/string/basic_string/append.md | 4 ++-- reference/string/basic_string/append_range.md | 2 +- reference/string/basic_string/assign.md | 2 +- reference/string/basic_string/assign_range.md | 2 +- reference/string/basic_string/compare.md | 2 +- reference/string/basic_string/insert.md | 2 +- reference/string/basic_string/insert_range.md | 2 +- reference/string/basic_string/op_assign.md | 2 +- .../string/basic_string/op_constructor.md | 4 ++-- .../string/basic_string/op_plus_assign.md | 2 +- reference/string/basic_string/replace.md | 2 +- .../basic_string/resize_and_overwrite.md | 4 ++-- .../tuple/tuple/basic_common_reference.md | 2 +- reference/vector/vector/at.md | 2 +- reference/vector/vector/op_at.md | 2 +- 85 files changed, 113 insertions(+), 113 deletions(-) diff --git a/reference/algorithm/ranges_adjacent_find.md b/reference/algorithm/ranges_adjacent_find.md index 4685f276c9..e9b81315ad 100644 --- a/reference/algorithm/ranges_adjacent_find.md +++ b/reference/algorithm/ranges_adjacent_find.md @@ -51,7 +51,7 @@ namespace std::ranges { ## 戻り値 -`[first,last)` 内にあるイテレータ i について、[`invoke`](/reference/functional/invoke.md)`(pred, `[`invoke`](/reference/functional/invoke.md)`(proj, *i), `[`invoke`](/reference/functional/invoke.md)`(proj, *(i + 1))) != false` であるような最初のイテレータを返す。 +`[first,last)` 内にあるイテレータ i について、[`invoke`](/reference/functional/invoke.md)`(pred,` [`invoke`](/reference/functional/invoke.md)`(proj, *i),` [`invoke`](/reference/functional/invoke.md)`(proj, *(i + 1))) != false` であるような最初のイテレータを返す。 もしそのようなイテレータが見つからなかった場合は `last` を返す。 diff --git a/reference/algorithm/ranges_all_of.md b/reference/algorithm/ranges_all_of.md index 09cb6a9a9a..861c19bff4 100644 --- a/reference/algorithm/ranges_all_of.md +++ b/reference/algorithm/ranges_all_of.md @@ -37,7 +37,7 @@ namespace std::ranges { - `Pred`は`R`のイテレータを`Proj`で射影した値を受け取る[単項述語](/reference/iterator/indirect_unary_predicate.md)である ## 戻り値 -`[first,last)` あるいは `r` が空であったり、その範囲内の全てのイテレータ `i` について [`invoke`](/reference/functional/invoke.md)`(pred, `[`invoke`](/reference/functional/invoke.md)`(proj, *i))` が `true` である場合は `true` を返し、そうでない場合は `false` を返す。 +`[first,last)` あるいは `r` が空であったり、その範囲内の全てのイテレータ `i` について [`invoke`](/reference/functional/invoke.md)`(pred,` [`invoke`](/reference/functional/invoke.md)`(proj, *i))` が `true` である場合は `true` を返し、そうでない場合は `false` を返す。 ## 計算量 最大で `last - first` 回 `proj` と `pred` を実行する。 diff --git a/reference/algorithm/ranges_any_of.md b/reference/algorithm/ranges_any_of.md index 77e2ffd1ee..25e3f53fb7 100644 --- a/reference/algorithm/ranges_any_of.md +++ b/reference/algorithm/ranges_any_of.md @@ -38,7 +38,7 @@ namespace std::ranges { ## 戻り値 -`[first,last)` あるいは `r` 内のイテレータ `i` について [`invoke`](/reference/functional/invoke.md)`(pred, `[`invoke`](/reference/functional/invoke.md)`(proj, *i))` が `true` になるような要素があれば`true`を返し、そうでなければ`false`を返す。 +`[first,last)` あるいは `r` 内のイテレータ `i` について [`invoke`](/reference/functional/invoke.md)`(pred,` [`invoke`](/reference/functional/invoke.md)`(proj, *i))` が `true` になるような要素があれば`true`を返し、そうでなければ`false`を返す。 `[first,last)` あるいは `r` の範囲が空の場合は`false`を返す。 ## 計算量 diff --git a/reference/algorithm/ranges_count_if.md b/reference/algorithm/ranges_count_if.md index e4881886a2..265ff9c5ae 100644 --- a/reference/algorithm/ranges_count_if.md +++ b/reference/algorithm/ranges_count_if.md @@ -39,7 +39,7 @@ namespace std::ranges { ## 戻り値 -`[first,last)` 内のイテレータ `i` について、[`invoke`](/reference/functional/invoke.md)`(pred, `[`invoke`](/reference/functional/invoke.md)`(proj, *i)) != false` であるイテレータの数を返す +`[first,last)` 内のイテレータ `i` について、[`invoke`](/reference/functional/invoke.md)`(pred,` [`invoke`](/reference/functional/invoke.md)`(proj, *i)) != false` であるイテレータの数を返す ## 計算量 diff --git a/reference/algorithm/ranges_ends_with.md b/reference/algorithm/ranges_ends_with.md index 2f32e02f3d..4b15e622c6 100644 --- a/reference/algorithm/ranges_ends_with.md +++ b/reference/algorithm/ranges_ends_with.md @@ -55,9 +55,9 @@ namespace std::ranges { * (1): * `N1 = last1 - first1`, `N2 = last2 - first2` とする。 * `N1 < N2` のとき、`false` - * それ以外のとき、[`ranges::equal`](ranges_equal.md)`(`[`std::move`](/reference/utility/move.md)`(first1) + (N1 - N2), last1, `[`std::move`](/reference/utility/move.md)`(first2), last2, pred, proj1, proj2)` + * それ以外のとき、[`ranges::equal`](ranges_equal.md)`(`[`std::move`](/reference/utility/move.md)`(first1) + (N1 - N2), last1,` [`std::move`](/reference/utility/move.md)`(first2), last2, pred, proj1, proj2)` * (2): - * `N1 = `[`ranges::distance`](/reference/iterator/ranges_distance.md)`(r1)`, `N2 = `[`ranges::distance`](/reference/iterator/ranges_distance.md)`(r2)` とする。 + * `N1 =` [`ranges::distance`](/reference/iterator/ranges_distance.md)`(r1)`, `N2 =` [`ranges::distance`](/reference/iterator/ranges_distance.md)`(r2)` とする。 * `N1 < N2` のとき、`false` * それ以外のとき、[`ranges::equal`](ranges_equal.md)`(`[`ranges::drop_view`](/reference/ranges/drop_view.md)`(`[`ranges::ref_view`](/reference/ranges/ref_view.md)`(r1), N1 - N2), r2, pred, proj1, proj2)` diff --git a/reference/algorithm/ranges_equal.md b/reference/algorithm/ranges_equal.md index e69f260082..d3a0c6d147 100644 --- a/reference/algorithm/ranges_equal.md +++ b/reference/algorithm/ranges_equal.md @@ -49,7 +49,7 @@ namespace std::ranges { ## 戻り値 2つの範囲の長さを定数時間で求められ、もし `last1 - first1 != last2 - first2` であれば、`false` を返す。 -そうでない場合、`[first1,last1)` 内のイテレータ `i` について、[`invoke`](/reference/functional/invoke.md)`(pred, `[`invoke`](/reference/functional/invoke.md)`(proj1, *i), `[`invoke`](/reference/functional/invoke.md)`(proj2, *(first2 + (i - first1)))) != false` が全てのイテレータ `i` について満たされているのであれば `true` を返す。 +そうでない場合、`[first1,last1)` 内のイテレータ `i` について、[`invoke`](/reference/functional/invoke.md)`(pred,` [`invoke`](/reference/functional/invoke.md)`(proj1, *i),` [`invoke`](/reference/functional/invoke.md)`(proj2, *(first2 + (i - first1)))) != false` が全てのイテレータ `i` について満たされているのであれば `true` を返す。 そうでない場合は `false` を返す。 ## 計算量 diff --git a/reference/algorithm/ranges_equal_range.md b/reference/algorithm/ranges_equal_range.md index 3b0e59e80c..d97ab1578a 100644 --- a/reference/algorithm/ranges_equal_range.md +++ b/reference/algorithm/ranges_equal_range.md @@ -79,7 +79,7 @@ namespace std::ranges { ## 戻り値 -`{`[`ranges::lower_bound`](ranges_lower_bound.md)`(first, last, value, comp, proj), `[`ranges::upper_bound`](ranges_upper_bound.md)`(first, last, value, comp, proj)}` +`{`[`ranges::lower_bound`](ranges_lower_bound.md)`(first, last, value, comp, proj),` [`ranges::upper_bound`](ranges_upper_bound.md)`(first, last, value, comp, proj)}` ## 計算量 diff --git a/reference/algorithm/ranges_find_first_of.md b/reference/algorithm/ranges_find_first_of.md index cf2c7a8052..b385eb8f34 100644 --- a/reference/algorithm/ranges_find_first_of.md +++ b/reference/algorithm/ranges_find_first_of.md @@ -47,7 +47,7 @@ namespace std::ranges { ## 戻り値 -`[first1,last1 - (last2 - first2))` 内のイテレータ `i` があるとき、`[first2,last2)` 内のイテレータ `j` について、どれかが [`invoke`](/reference/functional/invoke.md)`(pred, `[`invoke`](/reference/functional/invoke.md)`(proj1, *i), `[`invoke`](/reference/functional/invoke.md)`(proj2, *j)) == true` であるような最初のイテレータを返す。 +`[first1,last1 - (last2 - first2))` 内のイテレータ `i` があるとき、`[first2,last2)` 内のイテレータ `j` について、どれかが [`invoke`](/reference/functional/invoke.md)`(pred,` [`invoke`](/reference/functional/invoke.md)`(proj1, *i),` [`invoke`](/reference/functional/invoke.md)`(proj2, *j)) == true` であるような最初のイテレータを返す。 そのようなイテレータが見つからない、もしくは `[first2,last2)` が空である場合は `last1` を返す。 diff --git a/reference/algorithm/ranges_find_if.md b/reference/algorithm/ranges_find_if.md index 132209765f..e6cf396a7a 100644 --- a/reference/algorithm/ranges_find_if.md +++ b/reference/algorithm/ranges_find_if.md @@ -35,7 +35,7 @@ namespace std::ranges { ## 戻り値 -`[first,last)` あるいは `r` 内のイテレータ `i` について、[`invoke`](/reference/functional/invoke.md)`(pred, `[`invoke`](/reference/functional/invoke.md)`(proj, *i)) != false` である最初のイテレータを返す。そのようなイテレータが見つからなかった場合は `last` を返す。 +`[first,last)` あるいは `r` 内のイテレータ `i` について、[`invoke`](/reference/functional/invoke.md)`(pred,` [`invoke`](/reference/functional/invoke.md)`(proj, *i)) != false` である最初のイテレータを返す。そのようなイテレータが見つからなかった場合は `last` を返す。 ## 計算量 diff --git a/reference/algorithm/ranges_find_if_not.md b/reference/algorithm/ranges_find_if_not.md index e2b25e41c2..2506938225 100644 --- a/reference/algorithm/ranges_find_if_not.md +++ b/reference/algorithm/ranges_find_if_not.md @@ -35,7 +35,7 @@ namespace std::ranges { ## 戻り値 -`[first,last)` あるいは `r` 内のイテレータ `i` について、[`invoke`](/reference/functional/invoke.md)`(pred, `[`invoke`](/reference/functional/invoke.md)`(proj, *i)) == false` である最初のイテレータを返す。そのようなイテレータが見つからなかった場合は `last` を返す。 +`[first,last)` あるいは `r` 内のイテレータ `i` について、[`invoke`](/reference/functional/invoke.md)`(pred,` [`invoke`](/reference/functional/invoke.md)`(proj, *i)) == false` である最初のイテレータを返す。そのようなイテレータが見つからなかった場合は `last` を返す。 ## 計算量 diff --git a/reference/algorithm/ranges_find_last_if.md b/reference/algorithm/ranges_find_last_if.md index 33aa02e731..3364c92a82 100644 --- a/reference/algorithm/ranges_find_last_if.md +++ b/reference/algorithm/ranges_find_last_if.md @@ -34,7 +34,7 @@ namespace std::ranges { ## 戻り値 -`[first,last)` あるいは `r` 内のイテレータ `i` について、[`invoke`](/reference/functional/invoke.md)`(pred, `[`invoke`](/reference/functional/invoke.md)`(proj, *i)) != false` である最後のイテレータ `i` を `ranges::subrange{i, last}` として返す。そのようなイテレータが見つからなかった場合は `ranges::subrange{last, last}` を返す。 +`[first,last)` あるいは `r` 内のイテレータ `i` について、[`invoke`](/reference/functional/invoke.md)`(pred,` [`invoke`](/reference/functional/invoke.md)`(proj, *i)) != false` である最後のイテレータ `i` を `ranges::subrange{i, last}` として返す。そのようなイテレータが見つからなかった場合は `ranges::subrange{last, last}` を返す。 ## 計算量 diff --git a/reference/algorithm/ranges_find_last_if_not.md b/reference/algorithm/ranges_find_last_if_not.md index 1ffbed588e..fbbc83a074 100644 --- a/reference/algorithm/ranges_find_last_if_not.md +++ b/reference/algorithm/ranges_find_last_if_not.md @@ -34,7 +34,7 @@ namespace std::ranges { ## 戻り値 -`[first,last)` あるいは `r` 内のイテレータ `i` について、[`invoke`](/reference/functional/invoke.md)`(pred, `[`invoke`](/reference/functional/invoke.md)`(proj, *i)) == false` である最後のイテレータ `i` を `ranges::subrange{i, last}` として返す。そのようなイテレータが見つからなかった場合は `ranges::subrange{last, last}` を返す。 +`[first,last)` あるいは `r` 内のイテレータ `i` について、[`invoke`](/reference/functional/invoke.md)`(pred,` [`invoke`](/reference/functional/invoke.md)`(proj, *i)) == false` である最後のイテレータ `i` を `ranges::subrange{i, last}` として返す。そのようなイテレータが見つからなかった場合は `ranges::subrange{last, last}` を返す。 ## 計算量 diff --git a/reference/algorithm/ranges_for_each.md b/reference/algorithm/ranges_for_each.md index b68d9e5dcb..e9a3ef5a9c 100644 --- a/reference/algorithm/ranges_for_each.md +++ b/reference/algorithm/ranges_for_each.md @@ -48,7 +48,7 @@ namespace std::ranges { この他にFunは[`copy_constructible`](/reference/concepts/copy_constructible.md)のモデルであることが要求される。 ## 効果 -`[first,last)` 内の全てのイテレータ `i` に [`invoke`](/reference/functional/invoke.md)`(f, `[`invoke`](/reference/functional/invoke.md)`(proj, *i))` という操作を行う。`first` から順番に処理し、`last - 1` まで行う。 +`[first,last)` 内の全てのイテレータ `i` に [`invoke`](/reference/functional/invoke.md)`(f,` [`invoke`](/reference/functional/invoke.md)`(proj, *i))` という操作を行う。`first` から順番に処理し、`last - 1` まで行う。 このアルゴリズムはその他のアルゴリズムと違い、[`invoke`](/reference/functional/invoke.md)`(proj, *i)` が書き換え可能な参照であれば、関数 `f` の内部でその値を書き換えても構わない。 diff --git a/reference/algorithm/ranges_for_each_n.md b/reference/algorithm/ranges_for_each_n.md index d6eb16ba95..92b0e79c72 100644 --- a/reference/algorithm/ranges_for_each_n.md +++ b/reference/algorithm/ranges_for_each_n.md @@ -33,7 +33,7 @@ namespace std::ranges { `n >= 0` ## 効果 -イテレータ範囲`[first, first + n)` 内の全てのイテレータ `i` に [`invoke`](/reference/functional/invoke.md)`(f, `[`invoke`](/reference/functional/invoke.md)`(proj, *i))` という操作を行う。 +イテレータ範囲`[first, first + n)` 内の全てのイテレータ `i` に [`invoke`](/reference/functional/invoke.md)`(f,` [`invoke`](/reference/functional/invoke.md)`(proj, *i))` という操作を行う。 このアルゴリズムはその他のアルゴリズムと違い、[`invoke`](/reference/functional/invoke.md)`(proj, *i)` が書き換え可能な参照であれば、関数 `f` の内部でその値を書き換えても構わない。 diff --git a/reference/algorithm/ranges_max.md b/reference/algorithm/ranges_max.md index 862861ece3..32ca3a62fb 100644 --- a/reference/algorithm/ranges_max.md +++ b/reference/algorithm/ranges_max.md @@ -47,7 +47,7 @@ namespace std::ranges { ## 戻り値 -比較 [`invoke`](/reference/functional/invoke.md)`(comp, `[`invoke`](/reference/functional/invoke.md)`(proj, *i), `[`invoke`](/reference/functional/invoke.md)`(proj, *j))` によって最大と判断された最初の値 +比較 [`invoke`](/reference/functional/invoke.md)`(comp,` [`invoke`](/reference/functional/invoke.md)`(proj, *i),` [`invoke`](/reference/functional/invoke.md)`(proj, *j))` によって最大と判断された最初の値 ## 備考 - 等価な要素が 2 つ以上あった場合には、最も左の要素を返す。 diff --git a/reference/algorithm/ranges_max_element.md b/reference/algorithm/ranges_max_element.md index 9d00ee5d41..eebec0f04a 100644 --- a/reference/algorithm/ranges_max_element.md +++ b/reference/algorithm/ranges_max_element.md @@ -37,7 +37,7 @@ namespace std::ranges { ## 戻り値 -比較 [`invoke`](/reference/functional/invoke.md)`(comp, `[`invoke`](/reference/functional/invoke.md)`(proj, *i), `[`invoke`](/reference/functional/invoke.md)`(proj, *j))` によって最大と判断された最初の要素を指すイテレータ +比較 [`invoke`](/reference/functional/invoke.md)`(comp,` [`invoke`](/reference/functional/invoke.md)`(proj, *i),` [`invoke`](/reference/functional/invoke.md)`(proj, *j))` によって最大と判断された最初の要素を指すイテレータ ## 計算量 [`max`](max.md)`((last - first) - 1, 0)`回の比較を行う diff --git a/reference/algorithm/ranges_min.md b/reference/algorithm/ranges_min.md index 7282981d4d..f3ec69f0d4 100644 --- a/reference/algorithm/ranges_min.md +++ b/reference/algorithm/ranges_min.md @@ -47,7 +47,7 @@ namespace std::ranges { ## 戻り値 -比較 [`invoke`](/reference/functional/invoke.md)`(comp, `[`invoke`](/reference/functional/invoke.md)`(proj, *i), `[`invoke`](/reference/functional/invoke.md)`(proj, *j))` によって最小と判断された最初の値 +比較 [`invoke`](/reference/functional/invoke.md)`(comp,` [`invoke`](/reference/functional/invoke.md)`(proj, *i),` [`invoke`](/reference/functional/invoke.md)`(proj, *j))` によって最小と判断された最初の値 ## 備考 - 等価な要素が 2 つ以上あった場合には、最も左の要素を返す。 diff --git a/reference/algorithm/ranges_min_element.md b/reference/algorithm/ranges_min_element.md index c81c1e676d..e7c039f0ff 100644 --- a/reference/algorithm/ranges_min_element.md +++ b/reference/algorithm/ranges_min_element.md @@ -38,7 +38,7 @@ namespace std::ranges { ## 戻り値 -比較 [`invoke`](/reference/functional/invoke.md)`(comp, `[`invoke`](/reference/functional/invoke.md)`(proj, *i), `[`invoke`](/reference/functional/invoke.md)`(proj, *j))` によって最小と判断された最初の要素を指すイテレータ +比較 [`invoke`](/reference/functional/invoke.md)`(comp,` [`invoke`](/reference/functional/invoke.md)`(proj, *i),` [`invoke`](/reference/functional/invoke.md)`(proj, *j))` によって最小と判断された最初の要素を指すイテレータ ## 計算量 diff --git a/reference/algorithm/ranges_minmax.md b/reference/algorithm/ranges_minmax.md index 21a8fc127b..2f678c217e 100644 --- a/reference/algorithm/ranges_minmax.md +++ b/reference/algorithm/ranges_minmax.md @@ -56,7 +56,7 @@ minmax_result { ``` * minmax_result[link ranges_min_max_result.md] -それぞれ、比較 [`invoke`](/reference/functional/invoke.md)`(comp, `[`invoke`](/reference/functional/invoke.md)`(proj, *i), `[`invoke`](/reference/functional/invoke.md)`(proj, *j))` によって判断された最初の値となる。 +それぞれ、比較 [`invoke`](/reference/functional/invoke.md)`(comp,` [`invoke`](/reference/functional/invoke.md)`(proj, *i),` [`invoke`](/reference/functional/invoke.md)`(proj, *j))` によって判断された最初の値となる。 ## 計算量 - 2値比較バージョンは1操作。 diff --git a/reference/algorithm/ranges_minmax_element.md b/reference/algorithm/ranges_minmax_element.md index e7e170459a..a243db083e 100644 --- a/reference/algorithm/ranges_minmax_element.md +++ b/reference/algorithm/ranges_minmax_element.md @@ -47,7 +47,7 @@ minmax_element_result { ``` * minmax_element_result[link ranges_min_max_result.md] -それぞれ、比較 [`invoke`](/reference/functional/invoke.md)`(comp, `[`invoke`](/reference/functional/invoke.md)`(proj, *i), `[`invoke`](/reference/functional/invoke.md)`(proj, *j))` によって判断し、同じ値の要素が複数ある場合は、最小の要素は最初の要素、最大の要素は最後の要素となる。 +それぞれ、比較 [`invoke`](/reference/functional/invoke.md)`(comp,` [`invoke`](/reference/functional/invoke.md)`(proj, *i),` [`invoke`](/reference/functional/invoke.md)`(proj, *j))` によって判断し、同じ値の要素が複数ある場合は、最小の要素は最初の要素、最大の要素は最後の要素となる。 ## 計算量 `n` を範囲の要素数とする場合、[`max`](max.md)`(floor(3(n - 1) / 2), 0)` 回の述語適用を行う。 diff --git a/reference/algorithm/ranges_mismatch.md b/reference/algorithm/ranges_mismatch.md index f5aedb6f87..e45983580d 100644 --- a/reference/algorithm/ranges_mismatch.md +++ b/reference/algorithm/ranges_mismatch.md @@ -57,7 +57,7 @@ namespace std::ranges { - `j`が範囲`[first2, last2)`に含まれており、 - `!(*i == *j)` もしくは -- [`invoke`](/reference/functional/invoke.md)`(pred, `[`invoke`](/reference/functional/invoke.md)`(proj1, *i), `[`invoke`](/reference/functional/invoke.md)`(proj2, *j)) == false` であるような、最初のイテレータのペア [`mismatch_result`](ranges_in_in_result.md)`{ .in1 = i, .in2 = j }` を返す。 +- [`invoke`](/reference/functional/invoke.md)`(pred,` [`invoke`](/reference/functional/invoke.md)`(proj1, *i),` [`invoke`](/reference/functional/invoke.md)`(proj2, *j)) == false` であるような、最初のイテレータのペア [`mismatch_result`](ranges_in_in_result.md)`{ .in1 = i, .in2 = j }` を返す。 そのようなイテレータが見つからなかった場合は [`mismatch_result`](ranges_in_in_result.md)`{ .in1 = last1, .in2 = first2 + (last1 - first1)}` を返す。 diff --git a/reference/algorithm/ranges_next_permutation.md b/reference/algorithm/ranges_next_permutation.md index 0c18b0c5de..5ce95dbe55 100644 --- a/reference/algorithm/ranges_next_permutation.md +++ b/reference/algorithm/ranges_next_permutation.md @@ -41,7 +41,7 @@ namespace std::ranges { ## 効果 `[first, last)`の範囲を次の順列に変換する。 -比較 [`invoke`](/reference/functional/invoke.md)`(comp, `[`invoke`](/reference/functional/invoke.md)`(proj, *i), `[`invoke`](/reference/functional/invoke.md)`(proj, *j))` によって辞書順に並んでいる全ての順列の集合があると仮定すると、次の順列が発見される。 +比較 [`invoke`](/reference/functional/invoke.md)`(comp,` [`invoke`](/reference/functional/invoke.md)`(proj, *i),` [`invoke`](/reference/functional/invoke.md)`(proj, *j))` によって辞書順に並んでいる全ての順列の集合があると仮定すると、次の順列が発見される。 順列の辞書順とは、同じ長さ`N`の順列`a, b`があった時、その最上位の項から見た時に`ai != bi`となる最初の`i`番目の項について、`ai < bi`(もしくは`comp(ai, bi) == true`)となる時に`a < b`とするように定めた順序のことである。例えばこれは、各項(`ai, bi`)が`0 ~ 9`の数であるとすれば、それらをそのまま並べて構成した数の通常の大小関係に等しい。 diff --git a/reference/algorithm/ranges_none_of.md b/reference/algorithm/ranges_none_of.md index 6521578ba8..9d3bc4f7a6 100644 --- a/reference/algorithm/ranges_none_of.md +++ b/reference/algorithm/ranges_none_of.md @@ -42,7 +42,7 @@ namespace std::ranges { - `Pred`は`R`のイテレータを`Proj`で射影した値を受け取る[単項述語](/reference/iterator/indirect_unary_predicate.md)である ## 戻り値 -`[first,last)` あるいは `r` が空であったり、範囲内の全てのイテレータ `i` について [`invoke`](/reference/functional/invoke.md)`(pred, `[`invoke`](/reference/functional/invoke.md)`(proj, *i))` が `false` である場合は `true` を返し、そうでない場合は `false` を返す。 +`[first,last)` あるいは `r` が空であったり、範囲内の全てのイテレータ `i` について [`invoke`](/reference/functional/invoke.md)`(pred,` [`invoke`](/reference/functional/invoke.md)`(proj, *i))` が `false` である場合は `true` を返し、そうでない場合は `false` を返す。 ## 計算量 diff --git a/reference/algorithm/ranges_partial_sort_copy.md b/reference/algorithm/ranges_partial_sort_copy.md index 538b68a6a0..bb5a1dd34f 100644 --- a/reference/algorithm/ranges_partial_sort_copy.md +++ b/reference/algorithm/ranges_partial_sort_copy.md @@ -58,7 +58,7 @@ namespace std::ranges { - (2): Rangeを直接指定する ## 効果 -`N = `[`min`](/reference/algorithm/min.md)`(last - first, result_last - result_first)` とする。 +`N =` [`min`](/reference/algorithm/min.md)`(last - first, result_last - result_first)` とする。 `[first,last)` にある要素の中から、`N` 個の要素をソート済みの状態で `[result_first,result_first + N)` に配置する。 diff --git a/reference/algorithm/ranges_prev_permutation.md b/reference/algorithm/ranges_prev_permutation.md index 05d947f3a0..b22921f442 100644 --- a/reference/algorithm/ranges_prev_permutation.md +++ b/reference/algorithm/ranges_prev_permutation.md @@ -41,7 +41,7 @@ namespace std::ranges { ## 効果 `[first, last)`の範囲を前の順列に変換する。 -比較 [`invoke`](/reference/functional/invoke.md)`(comp, `[`invoke`](/reference/functional/invoke.md)`(proj, *i), `[`invoke`](/reference/functional/invoke.md)`(proj, *j))` によって辞書順に並んでいる全ての順列の集合があると仮定すると、前の順列が発見される。 +比較 [`invoke`](/reference/functional/invoke.md)`(comp,` [`invoke`](/reference/functional/invoke.md)`(proj, *i),` [`invoke`](/reference/functional/invoke.md)`(proj, *j))` によって辞書順に並んでいる全ての順列の集合があると仮定すると、前の順列が発見される。 ## 戻り値 ```cpp diff --git a/reference/algorithm/ranges_remove_if.md b/reference/algorithm/ranges_remove_if.md index 5d3b31601c..6ee0da6da1 100644 --- a/reference/algorithm/ranges_remove_if.md +++ b/reference/algorithm/ranges_remove_if.md @@ -37,7 +37,7 @@ namespace std::ranges { ## 効果 -`[first,last)` 内にあるイテレータ `i` について、[`invoke`](/reference/functional/invoke.md)`(pred, `[`invoke`](/reference/functional/invoke.md)`(proj, *i))` である要素を取り除き、有効な要素を範囲の前に寄せる。 +`[first,last)` 内にあるイテレータ `i` について、[`invoke`](/reference/functional/invoke.md)`(pred,` [`invoke`](/reference/functional/invoke.md)`(proj, *i))` である要素を取り除き、有効な要素を範囲の前に寄せる。 ## 戻り値 diff --git a/reference/algorithm/ranges_search.md b/reference/algorithm/ranges_search.md index 51a1b2d165..4ff7e480eb 100644 --- a/reference/algorithm/ranges_search.md +++ b/reference/algorithm/ranges_search.md @@ -46,7 +46,7 @@ namespace std::ranges { ## 戻り値 - (1) : - - `[first1,last1 - (last2 - first2))` 内のイテレータ `i` があるとき、0 以上 `last2 - first2` 未満の整数 `n` について、それぞれ [`invoke`](/reference/functional/invoke.md)`(pred, `[`invoke`](/reference/functional/invoke.md)`(proj1, *(i + n)), `[`invoke`](/reference/functional/invoke.md)`(proj2, *(first2 + n)))` であるようなサブシーケンスを探し、見つかった最初のサブシーケンスを返す。 + - `[first1,last1 - (last2 - first2))` 内のイテレータ `i` があるとき、0 以上 `last2 - first2` 未満の整数 `n` について、それぞれ [`invoke`](/reference/functional/invoke.md)`(pred,` [`invoke`](/reference/functional/invoke.md)`(proj1, *(i + n)),` [`invoke`](/reference/functional/invoke.md)`(proj2, *(first2 + n)))` であるようなサブシーケンスを探し、見つかった最初のサブシーケンスを返す。 - そのようなイテレータが見つからない場合は `{last1, last1}` を返し、`[first2,last2)` が空である場合には `{first1, first1}` を返す。 - (2): `first1 = begin(r1)`, `last1 = end(r1)`, `first2 = begin(r2)`, `last2 = end(r2)`の下で(1)と等しい。 diff --git a/reference/algorithm/ranges_search_n.md b/reference/algorithm/ranges_search_n.md index 52816a0f56..a14e481c4c 100644 --- a/reference/algorithm/ranges_search_n.md +++ b/reference/algorithm/ranges_search_n.md @@ -66,7 +66,7 @@ namespace std::ranges { - (2): Rangeを直接指定する ## 戻り値 -`[first,last-count)` 内のイテレータ `i` があるとき、0 以上 `count` 未満の整数 `n` について、それぞれ [`invoke`](/reference/functional/invoke.md)`(pred, `[`invoke`](/reference/functional/invoke.md)`(proj, *(i + n)), value)` であるようなサブシーケンスを探し、見つかった最初のサブシーケンスを返す。 +`[first,last-count)` 内のイテレータ `i` があるとき、0 以上 `count` 未満の整数 `n` について、それぞれ [`invoke`](/reference/functional/invoke.md)`(pred,` [`invoke`](/reference/functional/invoke.md)`(proj, *(i + n)), value)` であるようなサブシーケンスを探し、見つかった最初のサブシーケンスを返す。 そのようなイテレータが見つからない場合は `{last, last}` を返す。 diff --git a/reference/algorithm/ranges_starts_with.md b/reference/algorithm/ranges_starts_with.md index 3dae90c875..a3e605434e 100644 --- a/reference/algorithm/ranges_starts_with.md +++ b/reference/algorithm/ranges_starts_with.md @@ -47,7 +47,7 @@ namespace std::ranges { ## 戻り値 -[`ranges::mismatch`](ranges_mismatch.md)`(`[`std::move`](/reference/utility/move.md)`(first1), last1, `[`std::move`](/reference/utility/move.md)`(first2), last2, pred, proj1, proj2).in2 == last2` +[`ranges::mismatch`](ranges_mismatch.md)`(`[`std::move`](/reference/utility/move.md)`(first1), last1,` [`std::move`](/reference/utility/move.md)`(first2), last2, pred, proj1, proj2).in2 == last2` ## 計算量 最大で `min(last1 - first1, last2 - first2)` 回の対応する述語が適用される。 diff --git a/reference/algorithm/ranges_swap_ranges.md b/reference/algorithm/ranges_swap_ranges.md index 0b17e98b7d..eca99ff9a9 100644 --- a/reference/algorithm/ranges_swap_ranges.md +++ b/reference/algorithm/ranges_swap_ranges.md @@ -55,7 +55,7 @@ swap_ranges_result { ``` * swap_ranges_result[link ranges_in_in_result.md] -ただし、`M = `[`min`](ranges_min.md)`(last1 - first1, last2 - first2)` とする。 +ただし、`M =` [`min`](ranges_min.md)`(last1 - first1, last2 - first2)` とする。 ## 計算量 diff --git a/reference/cmath/fabs.md b/reference/cmath/fabs.md index 62bbf60f1f..80215e8ebb 100644 --- a/reference/cmath/fabs.md +++ b/reference/cmath/fabs.md @@ -51,7 +51,7 @@ namespace std { ## 備考 - $$ f(x) = | x | $$ -- C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)` != false`)、以下の規定が追加される。 +- C++11 以降では、処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md) `!= false`)、以下の規定が追加される。 - `value = ±0` の場合、戻り値は `+0` となる。 - `value = ±∞` の場合、戻り値は `+∞` となる。 - 戻り値は正確で、現在の丸め方式には依存しない。 diff --git a/reference/compare/strong_order.md b/reference/compare/strong_order.md index 686fcd8147..83c666685e 100644 --- a/reference/compare/strong_order.md +++ b/reference/compare/strong_order.md @@ -27,7 +27,7 @@ namespace std { 2. `std::strong_order`(本関数オブジェクト)の宣言を含まないコンテキストで、[`strong_ordering`](strong_ordering.md)`(strong_order(a, b))`が呼び出し可能ならば`strong_ordering(strong_order(a, b))` 3. [`decay`](/reference/type_traits/decay.md)を通した`a, b`の型`T`が浮動小数点型の場合、`T`の組み込みの比較演算子による順序と一貫する[`strong_ordering`](strong_ordering.md)の値を返す。 - さらに、[`numeric_limits::is_iec559`](/reference/limits/numeric_limits/is_iec559.md)` == true`の場合、その順序はISO/IEC/IEEE 60559の`totalOrder`による全順序と一致する。 + さらに、[`numeric_limits::is_iec559`](/reference/limits/numeric_limits/is_iec559.md) `== true`の場合、その順序はISO/IEC/IEEE 60559の`totalOrder`による全順序と一致する。 4. [`strong_ordering`](strong_ordering.md)`(a <=> b)`が呼び出し可能ならば`strong_ordering(a <=> b)` diff --git a/reference/compare/weak_order.md b/reference/compare/weak_order.md index cc44775a84..8af4f65958 100644 --- a/reference/compare/weak_order.md +++ b/reference/compare/weak_order.md @@ -28,7 +28,7 @@ namespace std { 2. `std::weak_order`(本関数オブジェクト)の宣言を含まないコンテキストで、[`weak_ordering`](weak_ordering.md)`(weak_order(a, b))`が呼び出し可能ならば`weak_ordering(weak_order(a, b))` 3. [`decay`](/reference/type_traits/decay.md)を通した`a, b`の型`T`が浮動小数点型の場合、`T`の組み込みの比較演算子および[`strong_order`](strong_order.md)による順序と一貫する[`weak_ordering`](weak_ordering.md)の値を返す。 - さらに、[`numeric_limits::is_iec559`](/reference/limits/numeric_limits/is_iec559.md)` == true`の場合、追加で以下の同値類の順序に従った順序付けを行う。 + さらに、[`numeric_limits::is_iec559`](/reference/limits/numeric_limits/is_iec559.md) `== true`の場合、追加で以下の同値類の順序に従った順序付けを行う。 1. 全ての`-NaN` 2. `-Inf` @@ -87,7 +87,7 @@ namespace std { ## 備考 -[`numeric_limits::is_iec559`](/reference/limits/numeric_limits/is_iec559.md)` == true`の場合の浮動小数点数の比較において、各同値類間の順序は以下のようになる。 +[`numeric_limits::is_iec559`](/reference/limits/numeric_limits/is_iec559.md) `== true`の場合の浮動小数点数の比較において、各同値類間の順序は以下のようになる。 {全ての`-NaN`} ` < ` {`-Inf`} ` < ` {負の正規化数} ` < ` {負の非正規化数} ` < ` {`±0.0`} ` < ` {正の非正規化数} ` < ` {正の正規化数} ` < ` {`+Inf`} ` < ` {全ての`+NaN`} diff --git a/reference/concepts/Invoke.md b/reference/concepts/Invoke.md index 29653b1dd8..7203d977b1 100644 --- a/reference/concepts/Invoke.md +++ b/reference/concepts/Invoke.md @@ -34,10 +34,10 @@ C++における関数呼び出しという性質を抽象化しまとめた、 ## 要件(C++17) 1. 仮想操作 *INVOKE*`(f, t1, t2, ..., tN)` を次のように定義する。 - - `f` が型 `T` のメンバ関数へのポインタであり、[`is_base_of_v`](/reference/type_traits/is_base_of.md)`> == true`(`t1` が `T` または `T` を継承した型のオブジェクト/参照)であるとき、 `(t1.*f)(t2, ..., tN)` と同じ効果を持つ。 + - `f` が型 `T` のメンバ関数へのポインタであり、[`is_base_of_v`](/reference/type_traits/is_base_of.md)`> == true`(`t1` が `T` または `T` を継承した型のオブジェクト/参照)であるとき、 `(t1.*f)(t2, ..., tN)` と同じ効果を持つ。 - `f` が型 `T` のメンバ関数へのポインタであり、[`decay_t`](/reference/type_traits/decay.md)``が[`reference_wrapper`](/reference/functional/reference_wrapper.md)(`t1`が[`reference_wrapper`](/reference/functional/reference_wrapper.md)の特殊化)であるとき、 `(t1.get().*f)(t2, ..., tN)` と同じ効果を持つ。 - `f` が型 `T` のメンバ関数へのポインタであり、 `t1` が上記の条件に当てはまらない場合(例えば、t1が`T`のポインタ)、`((*t1).*f)(t2, ..., tN)` と同じ効果を持つ。 - - `N == 1` で、`f` が型 `T` のメンバオブジェクトへのポインタであり、[`is_base_of_v`](/reference/type_traits/is_base_of.md)`> == true`(`t1` が `T` または `T` を継承した型のオブジェクト/参照)であるとき、 `t1.*f` と同じ効果を持つ。 + - `N == 1` で、`f` が型 `T` のメンバオブジェクトへのポインタであり、[`is_base_of_v`](/reference/type_traits/is_base_of.md)`> == true`(`t1` が `T` または `T` を継承した型のオブジェクト/参照)であるとき、 `t1.*f` と同じ効果を持つ。 - `N == 1` で、`f` が型 `T` のメンバオブジェクトへのポインタであり、[`decay_t`](/reference/type_traits/decay.md)``が[`reference_wrapper`](/reference/functional/reference_wrapper.md)(`t1`が[`reference_wrapper`](/reference/functional/reference_wrapper.md)の特殊化)であるとき、 `t1.get().*f` と同じ効果を持つ。 - `N == 1` で、`f` が型 `T` のメンバオブジェクトへのポインタであり、`t1` が上記の条件に当てはまらない場合(例えば、t1が`T`のポインタ)、 `(*t1).*f` と同じ効果を持つ。 - 上記の条件のどれにも当てはまらない場合、 `f(t1, t2, ..., tN)` と同じ効果を持つ。 @@ -48,10 +48,10 @@ C++における関数呼び出しという性質を抽象化しまとめた、 ## 要件(C++20) 1. 仮想操作 *INVOKE*`(f, t1, t2, ..., tN)` を次のように定義する。 - - `f` が型 `T` のメンバ関数へのポインタであり、[`is_base_of_v`](/reference/type_traits/is_base_of.md)`> == true`(`t1` が `T` または `T` を継承した型のオブジェクト/参照)であるとき、 `(t1.*f)(t2, ..., tN)` と同じ効果を持つ。 + - `f` が型 `T` のメンバ関数へのポインタであり、[`is_base_of_v`](/reference/type_traits/is_base_of.md)`> == true`(`t1` が `T` または `T` を継承した型のオブジェクト/参照)であるとき、 `(t1.*f)(t2, ..., tN)` と同じ効果を持つ。 - `f` が型 `T` のメンバ関数へのポインタであり、[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``が[`reference_wrapper`](/reference/functional/reference_wrapper.md)(`t1`が[`reference_wrapper`](/reference/functional/reference_wrapper.md)の特殊化)であるとき、 `(t1.get().*f)(t2, ..., tN)` と同じ効果を持つ。 - `f` が型 `T` のメンバ関数へのポインタであり、 `t1` が上記の条件に当てはまらない場合(例えば、t1が`T`のポインタ)、`((*t1).*f)(t2, ..., tN)` と同じ効果を持つ。 - - `N == 1` で、`f` が型 `T` のメンバオブジェクトへのポインタであり、[`is_base_of_v`](/reference/type_traits/is_base_of.md)`> == true`(`t1` が `T` または `T` を継承した型のオブジェクト/参照)であるとき、 `t1.*f` と同じ効果を持つ。 + - `N == 1` で、`f` が型 `T` のメンバオブジェクトへのポインタであり、[`is_base_of_v`](/reference/type_traits/is_base_of.md)`> == true`(`t1` が `T` または `T` を継承した型のオブジェクト/参照)であるとき、 `t1.*f` と同じ効果を持つ。 - `N == 1` で、`f` が型 `T` のメンバオブジェクトへのポインタであり、[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``が[`reference_wrapper`](/reference/functional/reference_wrapper.md)(`t1`が[`reference_wrapper`](/reference/functional/reference_wrapper.md)の特殊化)であるとき、 `t1.get().*f` と同じ効果を持つ。 - `N == 1` で、`f` が型 `T` のメンバオブジェクトへのポインタであり、`t1` が上記の条件に当てはまらない場合(例えば、t1が`T`のポインタ)、 `(*t1).*f` と同じ効果を持つ。 - 上記の条件のどれにも当てはまらない場合、 `f(t1, t2, ..., tN)` と同じ効果を持つ。 diff --git a/reference/concepts/assignable_from.md b/reference/concepts/assignable_from.md index 571b8fcae2..6bb0599092 100644 --- a/reference/concepts/assignable_from.md +++ b/reference/concepts/assignable_from.md @@ -27,7 +27,7 @@ namespace std { これらの`lhs, rhs, lcopy, rcopy`について、以下の条件を満たす場合に限って、型`LHS, RHS`は`assignable_from`のモデルである。 -- [`addressof`](/reference/memory/addressof.md)`(lhs = rhs) == `[`addressof`](/reference/memory/addressof.md)`(lcopy)`となる +- [`addressof`](/reference/memory/addressof.md)`(lhs = rhs) ==` [`addressof`](/reference/memory/addressof.md)`(lcopy)`となる - `lhs = rhs;`という式の評価の後で以下のことが成り立っている - `rhs`が`lcopy`を参照する非`const` *xvalue*でない(ムーブが起こる自己代入ではない)場合 - `lhs`は`rcopy`と等値である diff --git a/reference/concepts/common_reference_with.md b/reference/concepts/common_reference_with.md index b34c5de45a..75da3c5d19 100644 --- a/reference/concepts/common_reference_with.md +++ b/reference/concepts/common_reference_with.md @@ -20,7 +20,7 @@ namespace std { 2つの型`T, U`は以下の全ての条件を満たす場合にのみ、共通の参照型を持つ。 -- `C = `[`common_reference_t`](/reference/type_traits/common_reference.md)が有効な型である +- `C =` [`common_reference_t`](/reference/type_traits/common_reference.md)が有効な型である - 型`T, C`は、[`convertible_to`](/reference/concepts/convertible_to.md)のモデルである - 型`U, C`は、[`convertible_to`](/reference/concepts/convertible_to.md)のモデルである diff --git a/reference/istream/basic_istream/read.md b/reference/istream/basic_istream/read.md index ffd997e0e8..54546482c1 100644 --- a/reference/istream/basic_istream/read.md +++ b/reference/istream/basic_istream/read.md @@ -22,7 +22,7 @@ basic_istream& read(char_type* s, streamsize n); 1. [`good`](../../ios/basic_ios/good.md)`()`メンバ関数を呼び出して`false`であったら、[`setstate`](../../ios/basic_ios/setstate.md)`(`[`failbit`](../../ios/ios_base/type-iostate.md)`)`を呼び出して終了する。 1. 以下のいずれかを満たすまで、文字を入力して書き込む。 - 実引数で指定された`n`文字まで入力した。 - - EOFに達した。この場合、[`setstate`](../../ios/basic_ios/setstate.md)`(`[`failbit`](../../ios/ios_base/type-iostate.md)` | `[`eofbit`](../../ios/ios_base/type-iostate.md)`)`を呼び出す。 + - EOFに達した。この場合、[`setstate`](../../ios/basic_ios/setstate.md)`(`[`failbit`](../../ios/ios_base/type-iostate.md) `|` [`eofbit`](../../ios/ios_base/type-iostate.md)`)`を呼び出す。 ## 戻り値 `*this` diff --git a/reference/iterator/bidirectional_iterator.md b/reference/iterator/bidirectional_iterator.md index 02529f8e94..55ab587972 100644 --- a/reference/iterator/bidirectional_iterator.md +++ b/reference/iterator/bidirectional_iterator.md @@ -35,7 +35,7 @@ namespace std { 型`I`の等しい2つのオブジェクト(同じ要素を指すイテレータ)`a, b`について次の条件を満たす場合に限って、型`I`は`bidirectional_iterator`のモデルである。 - `a, b`がデクリメント可能ならば、次の4つの条件を全て満たす - - [`addressof`](/reference/memory/addressof.md)`(--a) == `[`addressof`](/reference/memory/addressof.md)`(a)` + - [`addressof`](/reference/memory/addressof.md)`(--a) ==` [`addressof`](/reference/memory/addressof.md)`(a)` - `bool(a-- == b)` - `a--, --b`の評価の後でも、`bool(a == b)`は`true`となる - `bool(++(--a) == b)` diff --git a/reference/iterator/counted_iterator/op_increment.md b/reference/iterator/counted_iterator/op_increment.md index a84ecd032f..7d04b481ba 100644 --- a/reference/iterator/counted_iterator/op_increment.md +++ b/reference/iterator/counted_iterator/op_increment.md @@ -22,7 +22,7 @@ constexpr counted_iterator operator++(int) ## 事前条件 -- (1), (2) : [`count()`](count.md)` > 0` +- (1), (2) : [`count()`](count.md) `> 0` ## 効果 diff --git a/reference/iterator/is_integer_like.md b/reference/iterator/is_integer_like.md index 6e914ca95f..4b245bce2f 100644 --- a/reference/iterator/is_integer_like.md +++ b/reference/iterator/is_integer_like.md @@ -47,7 +47,7 @@ namespace std { *integer-class*型`I`について[`numeric_limits`](/reference/limits/numeric_limits.md)の特殊化は次のような値を示す。 - `numeric_limits::is_specialized == true` -- [`numeric_limits::is_signed`](/reference/limits/numeric_limits/is_signed.md)` == true` +- [`numeric_limits::is_signed`](/reference/limits/numeric_limits/is_signed.md) `== true` - `I`が*signed-integer-class*型の場合のみ - [`numeric_limits::digits`](/reference/limits/numeric_limits/digits.md)は`I`の幅と等しい - [`numeric_limits::digits10`](/reference/limits/numeric_limits/digits10.md)は`static_cast(digits * log10(2))`と等しい diff --git a/reference/iterator/ranges_distance.md b/reference/iterator/ranges_distance.md index 2b861dff68..6c23e29c7c 100644 --- a/reference/iterator/ranges_distance.md +++ b/reference/iterator/ranges_distance.md @@ -38,7 +38,7 @@ namespace std::ranges { - それ以外の場合 : `first`から`last`に到達するのに必要なインクリメントの回数を返す。 - (2) : 次のいずれかによって、範囲の長さを求める。 - `R`が[`sized_range`](/reference/ranges/sized_range.md)``のモデルとなる : `return static_cast<`[`range_difference_t`](/reference/ranges/range_difference_t.md)`>(`[`ranges::size`](/reference/ranges/size.md)`(r));` - - それ以外の場合 : `return ranges::distance(`[`ranges::begin`](/reference/ranges/begin.md)`(r), `[`ranges::end`](/reference/ranges/end.md)`(r))` ((1)に委譲) + - それ以外の場合 : `return ranges::distance(`[`ranges::begin`](/reference/ranges/begin.md)`(r),` [`ranges::end`](/reference/ranges/end.md)`(r))` ((1)に委譲) ## 戻り値 diff --git a/reference/memory/allocator_traits/construct.md b/reference/memory/allocator_traits/construct.md index 4ba9b16bdf..10c4ff427e 100644 --- a/reference/memory/allocator_traits/construct.md +++ b/reference/memory/allocator_traits/construct.md @@ -18,9 +18,9 @@ static constexpr void construct(Alloc& a, T* p, Args&&... args); // C++20 か ## 効果 - C++17 まで - `a.construct(p, `[`forward`](/reference/utility/forward.md)`(args)...)` という式が有効ならそれを呼び出し、そうでなければデフォルト実装として `::new(static_cast(p)) T(`[`forward`](/reference/utility/forward.md)`(args)...)` を呼び出す。 + `a.construct(p,` [`forward`](/reference/utility/forward.md)`(args)...)` という式が有効ならそれを呼び出し、そうでなければデフォルト実装として `::new(static_cast(p)) T(`[`forward`](/reference/utility/forward.md)`(args)...)` を呼び出す。 - C++20 から - `a.construct(p, `[`forward`](/reference/utility/forward.md)`(args)...)` という式が有効ならそれを呼び出し、そうでなければデフォルト実装として [`construct_at`](../construct_at.md)`(p,` [`forward`](/reference/utility/forward.md)`(args)...)`を呼び出す。 + `a.construct(p,` [`forward`](/reference/utility/forward.md)`(args)...)` という式が有効ならそれを呼び出し、そうでなければデフォルト実装として [`construct_at`](../construct_at.md)`(p,` [`forward`](/reference/utility/forward.md)`(args)...)`を呼び出す。 ## 戻り値 diff --git a/reference/memory/unique_ptr/op_constructor.md b/reference/memory/unique_ptr/op_constructor.md index 079deb033b..edd997a381 100644 --- a/reference/memory/unique_ptr/op_constructor.md +++ b/reference/memory/unique_ptr/op_constructor.md @@ -72,9 +72,9 @@ unique_ptr(const unique_ptr&) = delete; // (9) 単一オブジェクト、 ### C++17 共通 - (1), (2), (6) : 以下のいずれかの条件を満たす場合、オーバーロード解決に参加しない。 - - [`is_pointer_v`](/reference/type_traits/is_pointer.md)` == true`である(デリータがポインタである) + - [`is_pointer_v`](/reference/type_traits/is_pointer.md) `== true`である(デリータがポインタである) - [`is_default_constructible_v`](/reference/type_traits/is_default_constructible.md) `== false`である(デリータがデフォルト構築できない) -- (3), (4) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true`の(`d`からコピー/ムーブ構築可能な)場合にのみオーバーロード解決に参加する。 +- (3), (4) : [`is_constructible_v`](/reference/type_traits/is_constructible.md) `== true`の(`d`からコピー/ムーブ構築可能な)場合にのみオーバーロード解決に参加する。 - (3), (4), (6) : [クラステンプレートの実引数推定](/lang/cpp17/type_deduction_for_class_templates.md)によってこれらのコンストラクタが選択される場合、コンパイルエラーとなる。 ### C++17 配列版 diff --git a/reference/random/mersenne_twister_engine.md b/reference/random/mersenne_twister_engine.md index 4f9fb71ade..be41226f49 100644 --- a/reference/random/mersenne_twister_engine.md +++ b/reference/random/mersenne_twister_engine.md @@ -51,7 +51,7 @@ namespace std { * `s <= w` * `t <= w` * `l <= w` -* `w <= `[`std::numeric_limits`](/reference/limits/numeric_limits.md)`::`[`digits`](/reference/limits/numeric_limits/digits.md) +* `w <=` [`std::numeric_limits`](/reference/limits/numeric_limits.md)`::`[`digits`](/reference/limits/numeric_limits/digits.md) * `a <= (1u << w) - 1u` * `b <= (1u << w) - 1u` * `c <= (1u << w) - 1u` diff --git a/reference/random/subtract_with_carry_engine.md b/reference/random/subtract_with_carry_engine.md index 5964ca321a..4f9d01b15e 100644 --- a/reference/random/subtract_with_carry_engine.md +++ b/reference/random/subtract_with_carry_engine.md @@ -26,7 +26,7 @@ namespace std { テンプレートパラメータの意味は以下の通り: * `UIntType`: 生成する符号なし整数の型。 -* `w`: ワードサイズ。`0 < w <= `[`std::numeric_limits`](/reference/limits/numeric_limits.md)`::`[`digits`](/reference/limits/numeric_limits/digits.md) でなければならない。 +* `w`: ワードサイズ。`0 < w <=` [`std::numeric_limits`](/reference/limits/numeric_limits.md)`::`[`digits`](/reference/limits/numeric_limits/digits.md) でなければならない。 * `s`: 短いラグ。`0 < s < r` でなければならない。 * `r`: 長いラグ。 diff --git a/reference/ranges/adjacent_transform_view.md b/reference/ranges/adjacent_transform_view.md index 96e0921348..51d29ffe17 100644 --- a/reference/ranges/adjacent_transform_view.md +++ b/reference/ranges/adjacent_transform_view.md @@ -43,8 +43,8 @@ namespace std::ranges { ## 効果 - (2): 式 `views::adjacent_transform(E, F)` の効果は以下の通り。 - - `N` > 0 のとき、`adjacent_transform_view<`[`views::all_t`](all.md)`, `[`decay_t`](/reference/type_traits/decay.md)`, N>(E, F)` と等しい - - `N` = 0 のとき、`((void)E, `[`views::zip_transform`](zip_transform_view.md)`(F))` と等しい(ただし`E`と`F`の評価順は不定) + - `N` > 0 のとき、`adjacent_transform_view<`[`views::all_t`](all.md)`,` [`decay_t`](/reference/type_traits/decay.md)`, N>(E, F)` と等しい + - `N` = 0 のとき、`((void)E,` [`views::zip_transform`](zip_transform_view.md)`(F))` と等しい(ただし`E`と`F`の評価順は不定) ## 備考 diff --git a/reference/ranges/adjacent_view.md b/reference/ranges/adjacent_view.md index f62fe46912..d9c9591b59 100644 --- a/reference/ranges/adjacent_view.md +++ b/reference/ranges/adjacent_view.md @@ -43,7 +43,7 @@ namespace std::ranges { - (2): 式`views::adjacent(E)`の効果は次の通り - `N` > 0 のとき、`adjacent_view<`[`views::all_t`](all.md)`, N>(E)` と等しい - - `N` = 0 のとき、`auto((void)E, `[`views::empty`](empty_view.md)`<`[`tuple`](/reference/tuple/tuple.md)`<>>))` と等しい + - `N` = 0 のとき、`auto((void)E,` [`views::empty`](empty_view.md)`<`[`tuple`](/reference/tuple/tuple.md)`<>>))` と等しい ## メンバ関数 diff --git a/reference/ranges/as_rvalue_view.md b/reference/ranges/as_rvalue_view.md index 5cc35e8368..46c94177d7 100644 --- a/reference/ranges/as_rvalue_view.md +++ b/reference/ranges/as_rvalue_view.md @@ -47,7 +47,7 @@ std::ranges::copy(words | views::as_rvalue, std::back_inserter(new_words)); ## 効果 - (2): 式`views::as_rvalue(E)`はRangeアダプタオブジェクトを表し、その効果は次の通り - - 要素がすでに右辺値参照であれば(`T = decltype((E))`として、[`same_as`](/reference/concepts/same_as.md)`<`[`range_rvalue_reference_t`](range_rvalue_reference_t.md)`, `[`range_reference_t`](range_reference_t.md)`>`)、[`views::all`](all.md)`(E)`と等しい + - 要素がすでに右辺値参照であれば(`T = decltype((E))`として、[`same_as`](/reference/concepts/same_as.md)`<`[`range_rvalue_reference_t`](range_rvalue_reference_t.md)`,` [`range_reference_t`](range_reference_t.md)`>`)、[`views::all`](all.md)`(E)`と等しい - それ以外のとき、`as_rvalue_view{E}`と等しい ## メンバ関数 diff --git a/reference/ranges/contiguous_range.md b/reference/ranges/contiguous_range.md index b19edd5ff1..4351bf023b 100644 --- a/reference/ranges/contiguous_range.md +++ b/reference/ranges/contiguous_range.md @@ -23,7 +23,7 @@ namespace std::ranges { ## モデル `decltype((t))`が`T&`であるような式`t`があるとする。 -`T`が`contiguous_range`のモデルとなるのは、[`to_address`](/reference/memory/to_address.md)`(`[`ranges::begin`](begin.md)`(t)) == `[`ranges::data`](data.md)`(t)`が`true`となる場合である。 +`T`が`contiguous_range`のモデルとなるのは、[`to_address`](/reference/memory/to_address.md)`(`[`ranges::begin`](begin.md)`(t)) ==` [`ranges::data`](data.md)`(t)`が`true`となる場合である。 ## 例 ```cpp example diff --git a/reference/ranges/copyable_box.md b/reference/ranges/copyable_box.md index f323cf7bbc..f75ffd342e 100644 --- a/reference/ranges/copyable_box.md +++ b/reference/ranges/copyable_box.md @@ -11,7 +11,7 @@ `copyable-box` は、[`std::optional`](/reference/optional/optional.md)``とほとんど同じであるものの、以下の差分がある。 ### 差分1 -テンプレートパラメーター制約 [`copy_constructible`](/reference/concepts/copy_constructible.md)` && `[`is_object_v`](/reference/type_traits/is_object.md)`` をもつ。 +テンプレートパラメーター制約 [`copy_constructible`](/reference/concepts/copy_constructible.md)` &&` [`is_object_v`](/reference/type_traits/is_object.md)`` をもつ。 ### 差分2 `T`が[`copyable`](/reference/concepts/copyable.md)のモデルでない場合、コピー代入演算子は以下のように定義される。 @@ -52,7 +52,7 @@ constexpr copyable-box& operator=(copyable-box&& that) noexcept(is_nothrow_move_ 以下のことが推奨される。 - [`copy_constructible`](/reference/concepts/copy_constructible.md)`` なら、`movable-box` は -`T` が [`copyable`](/reference/concepts/copyable.md)のモデルであるか、[`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)` && `[`is_nothrow_copy_constructible_v`](/reference/type_traits/is_nothrow_copy_constructible.md)``を満たす場合のみ値を保持する。 +`T` が [`copyable`](/reference/concepts/copyable.md)のモデルであるか、[`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)` &&` [`is_nothrow_copy_constructible_v`](/reference/type_traits/is_nothrow_copy_constructible.md)``を満たす場合のみ値を保持する。 ## 備考 diff --git a/reference/ranges/counted.md b/reference/ranges/counted.md index b4a84f7fe9..42d352c9ab 100644 --- a/reference/ranges/counted.md +++ b/reference/ranges/counted.md @@ -32,7 +32,7 @@ namespace std::ranges::views { - [`decltype`](/lang/cpp11/decltype.md)`((F))`が[`convertible_to`](/reference/concepts/convertible_to.md)``のモデルでなければ、呼び出しは不適格。 - `T`が[`contiguous_iterator`](/reference/iterator/contiguous_iterator.md)のモデルであれば、[`span`](/reference/span/span.md)`(`[`to_address`](/reference/memory/to_address.md)`(E), static_cast(F))`と等しい。 - `T`が[`random_access_iterator`](/reference/iterator/random_access_iterator.md)のモデルであれば、[`subrange`](subrange.md)`(E, E + static_cast(F))`と等しい。 -- それ以外のとき、[`subrange`](subrange.md)`(`[`counted_iterator`](/reference/iterator/counted_iterator.md)`(E, F), `[`default_sentinel`](/reference/iterator/default_sentinel_t.md)`)`と等しい。 +- それ以外のとき、[`subrange`](subrange.md)`(`[`counted_iterator`](/reference/iterator/counted_iterator.md)`(E, F),` [`default_sentinel`](/reference/iterator/default_sentinel_t.md)`)`と等しい。 ## 例 ```cpp example diff --git a/reference/ranges/drop_view.md b/reference/ranges/drop_view.md index 3ff0f4ddb9..e2187b6d32 100644 --- a/reference/ranges/drop_view.md +++ b/reference/ranges/drop_view.md @@ -37,9 +37,9 @@ namespace std::ranges { - (2): `E`および`F`を式、型`T`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`<`[`decltype`](/lang/cpp11/decltype.md)`((E))>`、型`D`を[`range_difference_t`](range_difference_t.md)`<`[`decltype`](/lang/cpp11/decltype.md)`((E))>`とする。式`views::drop(E, F)`の効果は以下の通り - [`decltype`](/lang/cpp11/decltype.md)`((F))`が[`convertible_to`](/reference/concepts/convertible_to.md)``のモデルでなければ、呼び出しは不適格 - - `T`が[`ranges::empty_view`](empty_view.md)の特殊化であれば、`((void) F, `[`decay-copy`](/reference/exposition-only/decay-copy.md)`(E))`と等しい。ただし、`E`と`F`の評価順序は不定順で序列化(indeterminately sequenced)される - - `T`が[`random_access_range`](random_access_range.md)および[`sized_range`](sized_range.md)のモデルであり、かつ次のいずれかの特殊化であるとき、`T(`[`ranges::begin`](begin.md)`(E) + `[`min`](/reference/algorithm/min.md)`(`[`ranges::size`](size.md)`(E), F), `[`ranges::end`](end.md)`(E))`と等しい。ただし、`E`は1度だけ評価される - - [`span`](/reference/span/span.md) (ただし、`T::extent == `[`dynamic_extent`](/reference/span/dynamic_extent.md)であること) + - `T`が[`ranges::empty_view`](empty_view.md)の特殊化であれば、`((void) F,` [`decay-copy`](/reference/exposition-only/decay-copy.md)`(E))`と等しい。ただし、`E`と`F`の評価順序は不定順で序列化(indeterminately sequenced)される + - `T`が[`random_access_range`](random_access_range.md)および[`sized_range`](sized_range.md)のモデルであり、かつ次のいずれかの特殊化であるとき、`T(`[`ranges::begin`](begin.md)`(E) +` [`min`](/reference/algorithm/min.md)`(`[`ranges::size`](size.md)`(E), F),` [`ranges::end`](end.md)`(E))`と等しい。ただし、`E`は1度だけ評価される + - [`span`](/reference/span/span.md) (ただし、`T::extent ==` [`dynamic_extent`](/reference/span/dynamic_extent.md)であること) - [`basic_string_view`](/reference/string_view/basic_string_view.md) - [`ranges::iota_view`](iota_view.md) - [`ranges::subrange`](subrange.md) diff --git a/reference/ranges/drop_while_view.md b/reference/ranges/drop_while_view.md index 34652be4f0..6c44b9c03d 100644 --- a/reference/ranges/drop_while_view.md +++ b/reference/ranges/drop_while_view.md @@ -33,7 +33,7 @@ namespace std::ranges { - [`view`](view.md)`` - [`input_range`](input_range.md)`` - [`is_object_v`](/reference/type_traits/is_object.md)`` -- [`indirect_unary_predicate`](/reference/iterator/indirect_unary_predicate.md)`>` +- [`indirect_unary_predicate`](/reference/iterator/indirect_unary_predicate.md)`>` ## 効果 diff --git a/reference/ranges/empty.md b/reference/ranges/empty.md index 6db3ae67d7..795c06473d 100644 --- a/reference/ranges/empty.md +++ b/reference/ranges/empty.md @@ -21,7 +21,7 @@ Rangeが空かどうかを判定する関数オブジェクト。 1. `T`が要素数不明の配列型であれば、呼び出しは不適格。 2. `bool(t.empty())`が有効な式であれば、`bool(t.empty())`と等しい。 3. [`ranges::size`](size.md)`(t) == 0`が有効な式であれば、`(`[`ranges::size`](size.md)`(t) == 0)`と等しい。 -4. `bool(`[`ranges::begin`](begin.md)`(t) == `[`ranges::end`](end.md)`(t))`が有効な式で、[`ranges::begin`](begin.md)`(t)`の型が[`forward_iterator`](/reference/iterator/forward_iterator.md)のモデルであれば、`bool(`[`ranges::begin`](begin.md)`(t) == `[`ranges::end`](end.md)`(t))`と等しい。 +4. `bool(`[`ranges::begin`](begin.md)`(t) ==` [`ranges::end`](end.md)`(t))`が有効な式で、[`ranges::begin`](begin.md)`(t)`の型が[`forward_iterator`](/reference/iterator/forward_iterator.md)のモデルであれば、`bool(`[`ranges::begin`](begin.md)`(t) ==` [`ranges::end`](end.md)`(t))`と等しい。 どれにも当てはまらないとき、呼び出しは不適格。 diff --git a/reference/ranges/end.md b/reference/ranges/end.md index 2c53473a13..9aa35f5462 100644 --- a/reference/ranges/end.md +++ b/reference/ranges/end.md @@ -20,7 +20,7 @@ Rangeから最後尾要素の次を指すイテレータもしくは番兵を取 このとき、式`ranges::begin(E)`の効果は以下の通り。 1. `E`がrvalueかつ[`enable_borrowed_range`](enable_borrowed_range.md)`<`[`remove_cv_t`](/reference/type_traits/remove_cv.md)`>`が`false`であれば、呼び出しは不適格。 -2. `T`が配列型であれば、`t + `[`extent_v`](/reference/type_traits/extent.md)``に等しい(expression‑equivalent)。ただし、要素数不明の配列か、[`remove_all_extents_t`](/reference/type_traits/remove_all_extents.md)``が不完全型であれば、呼び出しは不適格(診断不要)。 +2. `T`が配列型であれば、`t +` [`extent_v`](/reference/type_traits/extent.md)``に等しい(expression‑equivalent)。ただし、要素数不明の配列か、[`remove_all_extents_t`](/reference/type_traits/remove_all_extents.md)``が不完全型であれば、呼び出しは不適格(診断不要)。 3. [`decay-copy`](/reference/exposition-only/decay-copy.md)`(t.end())`が有効な式でその型が[`sentinel_for`](/reference/iterator/sentinel_for.md)`<`[`iterator_t`](iterator_t.md)`>`のモデルであれば、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(t.end())`と等しい。 4. `T`がクラス型または列挙体であって、`end`がADLで見つかり、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(end(t))`が有効な式でその型が[`sentinel_for`](/reference/iterator/sentinel_for.md)`<`[`iterator_t`](iterator_t.md)`>`のモデルであれば、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(end(t))`と等しい。 diff --git a/reference/ranges/enumerate_view.md b/reference/ranges/enumerate_view.md index 98534eaa31..536c9bf83f 100644 --- a/reference/ranges/enumerate_view.md +++ b/reference/ranges/enumerate_view.md @@ -20,7 +20,7 @@ namespace std::ranges { `enumerate_view`はインデックスを付ける[`view`](view.md)。 -`enumerate_view`の要素は、インデックスと元のRangeの要素からなる[`tuple`](/reference/tuple/tuple.md) ([`tuple`](/reference/tuple/tuple.md)`<`[`range_difference_t`](range_difference_t.md)`, `[`range_value_t`](range_value_t.md)`>`)である。 +`enumerate_view`の要素は、インデックスと元のRangeの要素からなる[`tuple`](/reference/tuple/tuple.md) ([`tuple`](/reference/tuple/tuple.md)`<`[`range_difference_t`](range_difference_t.md)`,` [`range_value_t`](range_value_t.md)`>`)である。 - (1): `enumerate_view`のクラス定義 - (2): `enumerate_view`を生成するRangeアダプタオブジェクト diff --git a/reference/ranges/filter_view.md b/reference/ranges/filter_view.md index 31d7da22f7..520a812888 100644 --- a/reference/ranges/filter_view.md +++ b/reference/ranges/filter_view.md @@ -44,7 +44,7 @@ namespace std::ranges { - [`input_range`](input_range.md)`` - [`view`](view.md)`` - [`is_object_v`](/reference/type_traits/is_object.md)`` -- [`indirect_unary_predicate`](/reference/iterator/indirect_unary_predicate.md)`>` +- [`indirect_unary_predicate`](/reference/iterator/indirect_unary_predicate.md)`>` ## 効果 diff --git a/reference/ranges/filter_view/begin.md b/reference/ranges/filter_view/begin.md index 37761a1b9d..d898a7d49c 100644 --- a/reference/ranges/filter_view/begin.md +++ b/reference/ranges/filter_view/begin.md @@ -20,7 +20,7 @@ constexpr iterator begin(); ## 戻り値 -`{*this, `[`ranges::find_if`](/reference/algorithm/ranges_find_if.md)`(base_, `[`ref`](/reference/functional/ref.md)`(*pred_))}` +`{*this,` [`ranges::find_if`](/reference/algorithm/ranges_find_if.md)`(base_,` [`ref`](/reference/functional/ref.md)`(*pred_))}` [`range`](../range.md)のモデルとなるためにはこの関数が償却定数時間で実行できなければならないため、値はキャッシュされる。 diff --git a/reference/ranges/movable_box.md b/reference/ranges/movable_box.md index 83d23d18f0..40a72fd5ac 100644 --- a/reference/ranges/movable_box.md +++ b/reference/ranges/movable_box.md @@ -10,7 +10,7 @@ `movable-box` は、[`std::optional`](/reference/optional/optional.md)``とほとんど同じであるが、以下の差分をもつ。 ### 差分1 -テンプレートパラメーター制約 [`move_constructible`](/reference/concepts/move_constructible.md)` && `[`is_object_v`](/reference/type_traits/is_object.md)`` をもつ。 +テンプレートパラメーター制約 [`move_constructible`](/reference/concepts/move_constructible.md)` &&` [`is_object_v`](/reference/type_traits/is_object.md)`` をもつ。 ### 差分2 `T`が[`copyable`](/reference/concepts/copyable.md)のモデルでない場合、コピー代入演算子は以下のように定義される。 @@ -51,7 +51,7 @@ constexpr movable-box& operator=(movable-box&& that) noexcept(is_nothrow_move_co 以下のことが推奨される。 - [`copy_constructible`](/reference/concepts/copy_constructible.md)`` なら、`movable-box` は -`T` が [`copyable`](/reference/concepts/copyable.md)のモデルであるか、[`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)` && `[`is_nothrow_copy_constructible_v`](/reference/type_traits/is_nothrow_copy_constructible.md)``を満たす場合のみ値を保持する。 +`T` が [`copyable`](/reference/concepts/copyable.md)のモデルであるか、[`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)` &&` [`is_nothrow_copy_constructible_v`](/reference/type_traits/is_nothrow_copy_constructible.md)``を満たす場合のみ値を保持する。 - そうでなければ、`movable-box` は `T` が [`movable`](/reference/concepts/movable.md)のモデルであるか、[`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)``を満たす場合のみ値を保持する。 diff --git a/reference/ranges/reverse_view.md b/reference/ranges/reverse_view.md index fe830f44a8..1245ac0801 100644 --- a/reference/ranges/reverse_view.md +++ b/reference/ranges/reverse_view.md @@ -37,7 +37,7 @@ namespace std::ranges { - (2): 式`views::reverse(E)`の効果は次の通り - `E`の型が`reverse_view`の特殊化であれば、`E.base()`と等しい (CV修飾されている場合を含む) - - イテレータ型`I`、[`subrange_kind`](subrange_kind.md)の値`K`に対し、`E`の型がCV修飾された[`subrange`](subrange.md)`<`[`reverse_iterator`](/reference/iterator/reverse_iterator.md)`, `[`reverse_iterator`](/reference/iterator/reverse_iterator.md)`, K>`であるとする。このとき、`E`は一度しか評価されないとして、 + - イテレータ型`I`、[`subrange_kind`](subrange_kind.md)の値`K`に対し、`E`の型がCV修飾された[`subrange`](subrange.md)`<`[`reverse_iterator`](/reference/iterator/reverse_iterator.md)`,` [`reverse_iterator`](/reference/iterator/reverse_iterator.md)`, K>`であるとする。このとき、`E`は一度しか評価されないとして、 - `K`が[`subrange_kind::sized`](subrange_kind.md)であれば、[`subrange`](subrange.md)`(E.end().base(), E.begin().base(), E.size())`と等しい - それ以外のとき、[`subrange`](subrange.md)`(E.end().base(), E.begin().base())`と等しい - それ以外のとき、`reverse_view{E}`と等しい diff --git a/reference/ranges/size.md b/reference/ranges/size.md index 48a6eca92b..1d051293d5 100644 --- a/reference/ranges/size.md +++ b/reference/ranges/size.md @@ -21,7 +21,7 @@ Rangeの要素数を取得する関数オブジェクト。 1. `T`が配列型であれば、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(`[`extent_v`](/reference/type_traits/extent.md)`)`に等しい(expression‑equivalent)。ただし、要素数不明の配列であれば、呼び出しは不適格。 2. [`disable_sized_range`](disable_sized_range.md)`<`[`remove_cv_t`](/reference/type_traits/remove_cv.md)`>`が`false`、かつ[`decay-copy`](/reference/exposition-only/decay-copy.md)`(t.size())`が整数型(integer-like)の有効な式であれば、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(t.size())`と等しい。 3. `T`がクラス型または列挙体であって、[`disable_sized_range`](disable_sized_range.md)`<`[`remove_cv_t`](/reference/type_traits/remove_cv.md)`>`が`false`、かつ`size`がADLで見つかり、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(size(t))`が整数型の有効な式であれば、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(size(t))`と等しい。 -4. `to-unsigned-like(`[`ranges::end`](end.md)`(t) - `[`ranges::begin`](begin.md)`(t))`が有効な式で、[`ranges::begin`](begin.md)の型`I`、[`ranges::end`](end.md)の型`S`が[`sized_sentinel_for`](/reference/iterator/sized_sentinel_for.md)``と[`forward_iterator`](/reference/iterator/forward_iterator.md)のモデルであれば、`to-unsigned-like(`[`ranges::end`](end.md)`(t) - `[`ranges::begin`](begin.md)`(t))`と等しい。 +4. `to-unsigned-like(`[`ranges::end`](end.md)`(t) -` [`ranges::begin`](begin.md)`(t))`が有効な式で、[`ranges::begin`](begin.md)の型`I`、[`ranges::end`](end.md)の型`S`が[`sized_sentinel_for`](/reference/iterator/sized_sentinel_for.md)``と[`forward_iterator`](/reference/iterator/forward_iterator.md)のモデルであれば、`to-unsigned-like(`[`ranges::end`](end.md)`(t) -` [`ranges::begin`](begin.md)`(t))`と等しい。 どれにも当てはまらないとき、呼び出しは不適格。 diff --git a/reference/ranges/subrange/size.md b/reference/ranges/subrange/size.md index 16462f72b3..21ad539339 100644 --- a/reference/ranges/subrange/size.md +++ b/reference/ranges/subrange/size.md @@ -20,7 +20,7 @@ constexpr make-unsigned-like-t> size() const ## 効果 - [`StoreSize`](op_constructor.md)が真のとき、 `return size_;` -- それ以外のとき、`return `[`to-unsigned-like`](/reference/type_traits/make_unsigned.md)`(end_ - begin_);` +- それ以外のとき、`return` [`to-unsigned-like`](/reference/type_traits/make_unsigned.md)`(end_ - begin_);` ## 例 ```cpp example diff --git a/reference/ranges/take_view.md b/reference/ranges/take_view.md index 61f41b59c9..2a4e3ff225 100644 --- a/reference/ranges/take_view.md +++ b/reference/ranges/take_view.md @@ -37,9 +37,9 @@ namespace std::ranges { - (2): `E`および`F`を式、型`T`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`<`[`decltype`](/lang/cpp11/decltype.md)`((E))>`、型`D`を[`range_difference_t`](range_difference_t.md)`<`[`decltype`](/lang/cpp11/decltype.md)`((E))>`とする。式`views::take(E, F)`の効果は以下の通り - [`decltype`](/lang/cpp11/decltype.md)`((F))`が[`convertible_to`](/reference/concepts/convertible_to.md)``のモデルでなければ、呼び出しは不適格 - - `T`が[`ranges::empty_view`](empty_view.md)の特殊化であれば、`((void) F, `[`decay-copy`](/reference/exposition-only/decay-copy.md)`(E))`と等しい。ただし、`E`と`F`の評価順序は不定順で序列化(indeterminately sequenced)される - - `T`が[`random_access_range`](random_access_range.md)および[`sized_range`](sized_range.md)のモデルであり、かつ次のいずれかの特殊化であるとき、`T(`[`ranges::begin`](begin.md)`(E), `[`ranges::begin`](begin.md)`(E) + `[`min`](/reference/algorithm/min.md)`(`[`ranges::size`](size.md)`(E), F))`と等しい。ただし、`E`は1度だけ評価される - - [`span`](/reference/span/span.md) (ただし、`T::extent == `[`dynamic_extent`](/reference/span/dynamic_extent.md)であること) + - `T`が[`ranges::empty_view`](empty_view.md)の特殊化であれば、`((void) F,` [`decay-copy`](/reference/exposition-only/decay-copy.md)`(E))`と等しい。ただし、`E`と`F`の評価順序は不定順で序列化(indeterminately sequenced)される + - `T`が[`random_access_range`](random_access_range.md)および[`sized_range`](sized_range.md)のモデルであり、かつ次のいずれかの特殊化であるとき、`T(`[`ranges::begin`](begin.md)`(E),` [`ranges::begin`](begin.md)`(E) +` [`min`](/reference/algorithm/min.md)`(`[`ranges::size`](size.md)`(E), F))`と等しい。ただし、`E`は1度だけ評価される + - [`span`](/reference/span/span.md) (ただし、`T::extent ==` [`dynamic_extent`](/reference/span/dynamic_extent.md)であること) - [`basic_string_view`](/reference/string_view/basic_string_view.md) - [`ranges::iota_view`](iota_view.md) - [`ranges::subrange`](subrange.md) diff --git a/reference/ranges/take_while_view.md b/reference/ranges/take_while_view.md index dabfcd3a5a..c12997094f 100644 --- a/reference/ranges/take_while_view.md +++ b/reference/ranges/take_while_view.md @@ -33,7 +33,7 @@ namespace std::ranges { - [`view`](view.md)`` - [`input_range`](input_range.md)`` - [`is_object_v`](/reference/type_traits/is_object.md)`` -- [`indirect_unary_predicate`](/reference/iterator/indirect_unary_predicate.md)`>` +- [`indirect_unary_predicate`](/reference/iterator/indirect_unary_predicate.md)`>` ## 効果 diff --git a/reference/ranges/to.md b/reference/ranges/to.md index d6a24d6370..a27db847b1 100644 --- a/reference/ranges/to.md +++ b/reference/ranges/to.md @@ -42,15 +42,15 @@ Rangeの各要素を要素とするコンテナを構築する。 (1) Rangeの各要素を要素とするコンテナCのオブジェクトを以下の通りに構築して返す。 -`C`が[`input_range`](input_range.md)ではないか、[`convertible_to`](/reference/concepts/convertible_to.md)`<`[`range_reference_t`](range_reference_t.md)`, `[`range_value_t`](range_value_t.md)`>` である(`R`の要素への参照が`C`の要素に変換できる)場合: +`C`が[`input_range`](input_range.md)ではないか、[`convertible_to`](/reference/concepts/convertible_to.md)`<`[`range_reference_t`](range_reference_t.md)`,` [`range_value_t`](range_value_t.md)`>` である(`R`の要素への参照が`C`の要素に変換できる)場合: 1. [`constructible_from`](/reference/concepts/constructible_from.md)``である(`C`が`R`と残りの引数で構築できる)場合 - - `C(`[`std::forward`](/reference/utility/forward.md)`(r), `[`std::forward`](/reference/utility/forward.md)`(args)...)` -2. [`constructible_from`](/reference/concepts/constructible_from.md)``である(`C`が[`from_range_t`](from_range_t.md)、`R`、残りの引数で構築できる)場合 - - `C(`[`from_range`](from_range_t.md)`, `[`std::forward`](/reference/utility/forward.md)`(r), `[`std::forward`](/reference/utility/forward.md)`(args)...)` -3. [`common_range`](common_range.md)``が`true`で、[`iterator_traits`](/reference/iterator/iterator_traits.md)`<`[`iterator_t`](iterator_t.md)`>::iterator_category`が `input_iterator_tag` から派生する有効な型であり、[`constructible_from`](/reference/concepts/constructible_from.md)`, `[`sentinel_t`](sentinel_t.md)`, Args...>`である(`C`が`R`のイテレータおよび番兵と残りの引数で構築できる)場合 - - `C(`[`ranges::begin(r)`](begin.md)`, `[`ranges::end(r)`](end.md)`, `[`std::forward`](/reference/utility/forward.md)`(args)...)` -4. [`constructible_from`](/reference/concepts/constructible_from.md)``が`true`で、`container-insertable>`が`true`である場合 + - `C(`[`std::forward`](/reference/utility/forward.md)`(r),` [`std::forward`](/reference/utility/forward.md)`(args)...)` +2. [`constructible_from`](/reference/concepts/constructible_from.md)``である(`C`が[`from_range_t`](from_range_t.md)、`R`、残りの引数で構築できる)場合 + - `C(`[`from_range`](from_range_t.md)`,` [`std::forward`](/reference/utility/forward.md)`(r),` [`std::forward`](/reference/utility/forward.md)`(args)...)` +3. [`common_range`](common_range.md)``が`true`で、[`iterator_traits`](/reference/iterator/iterator_traits.md)`<`[`iterator_t`](iterator_t.md)`>::iterator_category`が `input_iterator_tag` から派生する有効な型であり、[`constructible_from`](/reference/concepts/constructible_from.md)`,` [`sentinel_t`](sentinel_t.md)`, Args...>`である(`C`が`R`のイテレータおよび番兵と残りの引数で構築できる)場合 + - `C(`[`ranges::begin(r)`](begin.md)`,` [`ranges::end(r)`](end.md)`,` [`std::forward`](/reference/utility/forward.md)`(args)...)` +4. [`constructible_from`](/reference/concepts/constructible_from.md)``が`true`で、`container-insertable>`が`true`である場合 - 以下のコードで初期化する ```cpp @@ -95,12 +95,12 @@ struct input-iterator { また、`DEDUCE_EXPR` を次のように定義する。 -1. 有効な式ならば、`C(`[`declval`](/reference/utility/declval.md)`(), `[`declval`](/reference/utility/declval.md)`()...)` -2. 有効な式ならば、`C(`[`from_range`](from_range_t.md)`, `[`declval`](/reference/utility/declval.md)`(), `[`declval`](/reference/utility/declval.md)`()...)` -3. 有効な式ならば、`C(`[`declval`](/reference/utility/declval.md)`(), `[`declval`](/reference/utility/declval.md)`(), `[`declval`](/reference/utility/declval.md)`()...)` +1. 有効な式ならば、`C(`[`declval`](/reference/utility/declval.md)`(),` [`declval`](/reference/utility/declval.md)`()...)` +2. 有効な式ならば、`C(`[`from_range`](from_range_t.md)`,` [`declval`](/reference/utility/declval.md)`(),` [`declval`](/reference/utility/declval.md)`()...)` +3. 有効な式ならば、`C(`[`declval`](/reference/utility/declval.md)`(),` [`declval`](/reference/utility/declval.md)`(),` [`declval`](/reference/utility/declval.md)`()...)` 4. 1-3が有効でなければ、ill-formed -このとき、戻り値は `to<`[`decltype`](/lang/cpp11/decltype.md)`(DEDUCE_EXPR)>(`[`std::forward`](/reference/utility/forward.md)`(r), `[`std::forward`](/reference/utility/forward.md)`(args)...)` +このとき、戻り値は `to<`[`decltype`](/lang/cpp11/decltype.md)`(DEDUCE_EXPR)>(`[`std::forward`](/reference/utility/forward.md)`(r),` [`std::forward`](/reference/utility/forward.md)`(args)...)` (3), (4): 次の性質をもつ完全転送呼び出しラッパー(*perfect forwarding call wrapper*)であるようなRangeアダプタクロージャオブジェクト`f`を返す。 diff --git a/reference/ranges/zip_transform_view.md b/reference/ranges/zip_transform_view.md index 6da456b103..c6193d7479 100644 --- a/reference/ranges/zip_transform_view.md +++ b/reference/ranges/zip_transform_view.md @@ -44,7 +44,7 @@ zipするRangeのサイズが異なっている場合、`zip_transform_view`の - (2): `F`を部分式、`Es...`を部分式のパックとする。式 `views::zip_transform(F, Es...)` の効果は以下の通り。 - `Es` が空でないとき、`zip_transform_view(F, Es...)` と等しい - `Es` が空のとき、 `FD` を [`decay_t`](/reference/type_traits/decay.md)``として、`((void)F, auto(`[`views::empty`](empty_view.md)`<`[`decay_t`](/reference/type_traits/decay.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`>>))` と等しい - - ただし、 [`move_constructible`](/reference/concepts/move_constructible.md)` && `[`regular_invocable`](/reference/concepts/invocable.md)`` が `false`、または [`decay_t`](/reference/type_traits/decay.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`>` がオブジェクト型でないとき、ill-formed + - ただし、 [`move_constructible`](/reference/concepts/move_constructible.md)` &&` [`regular_invocable`](/reference/concepts/invocable.md)`` が `false`、または [`decay_t`](/reference/type_traits/decay.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`>` がオブジェクト型でないとき、ill-formed ## メンバ関数 diff --git a/reference/ranges/zip_view/end.md b/reference/ranges/zip_view/end.md index 755dce3b40..d1176b899a 100644 --- a/reference/ranges/zip_view/end.md +++ b/reference/ranges/zip_view/end.md @@ -30,11 +30,11 @@ constexpr auto end() const - `zip-is-common`が`false`の場合: - `return sentinel(tuple-transform(ranges::end, views_));` - `(random_access_range && ...) && (sized_range && ...)`が`true`の場合: - - `return begin() + `[`iter_difference_t`](/reference/iterator/iter_difference_t.md)`>(size());` + - `return begin() +` [`iter_difference_t`](/reference/iterator/iter_difference_t.md)`>(size());` - それ以外の場合: - `return iterator(tuple-transform(ranges::end, views_));` -- (2) : `return begin() + `[`iter_difference_t`](/reference/iterator/iter_difference_t.md)`>(size());` +- (2) : `return begin() +` [`iter_difference_t`](/reference/iterator/iter_difference_t.md)`>(size());` - (3) : ```cpp diff --git a/reference/streambuf/basic_streambuf/in_avail.md b/reference/streambuf/basic_streambuf/in_avail.md index 2f028a882b..5845ee82cd 100644 --- a/reference/streambuf/basic_streambuf/in_avail.md +++ b/reference/streambuf/basic_streambuf/in_avail.md @@ -21,7 +21,7 @@ namespace std { 現在の入力列の読み取り可能な文字数を返す。 ## 戻り値 -- 読み取り可能な文字列が存在する場合、[`egptr()`](egptr.md)` - `[`gptr()`](gptr.md)を返す。 +- 読み取り可能な文字列が存在する場合、[`egptr()`](egptr.md) `-` [`gptr()`](gptr.md)を返す。 - それ以外の場合、[`showmanyc()`](showmanyc.md)を返す。 ## 例 diff --git a/reference/streambuf/basic_streambuf/setg.md b/reference/streambuf/basic_streambuf/setg.md index b6a9189fda..746350477b 100644 --- a/reference/streambuf/basic_streambuf/setg.md +++ b/reference/streambuf/basic_streambuf/setg.md @@ -20,7 +20,7 @@ namespace std { 入力部分列の各ポインタを設定する。 ## 事後条件 -`gbeg == `[`eback()`](eback.md) および `gnext == `[`gptr()`](gptr.md) および `gend == `[`egptr()`](egptr.md)。 +`gbeg ==` [`eback()`](eback.md) および `gnext ==` [`gptr()`](gptr.md) および `gend ==` [`egptr()`](egptr.md)。 ## 例 ```cpp example diff --git a/reference/streambuf/basic_streambuf/setp.md b/reference/streambuf/basic_streambuf/setp.md index 3aac890d39..828f127a48 100644 --- a/reference/streambuf/basic_streambuf/setp.md +++ b/reference/streambuf/basic_streambuf/setp.md @@ -20,7 +20,7 @@ namespace std { 出力部分列の各ポインタを設定する。 ## 事後条件 -`pbeg == `[`pbase()`](pbase.md) および `pbeg == `[`pptr()`](pptr.md) および `pend == `[`epptr()`](epptr.md)。 +`pbeg ==` [`pbase()`](pbase.md) および `pbeg ==` [`pptr()`](pptr.md) および `pend ==` [`epptr()`](epptr.md)。 ## 例 ```cpp example diff --git a/reference/string/basic_string/append.md b/reference/string/basic_string/append.md index c606fc6bef..6f6d099892 100644 --- a/reference/string/basic_string/append.md +++ b/reference/string/basic_string/append.md @@ -69,7 +69,7 @@ constexpr basic_string& ## テンプレートパラメータ制約 - (8), (9) : 以下の両方を満たしていること - - [`is_convertible_v`](/reference/type_traits/is_convertible.md)`> == true` + - [`is_convertible_v`](/reference/type_traits/is_convertible.md)`> == true` - [`is_convertible_v`](/reference/type_traits/is_convertible.md)` == false` ## 要件 @@ -113,7 +113,7 @@ constexpr basic_string& ``` - (9) 対象オブジェクトの末尾に、[`basic_string_view`](/reference/string_view/basic_string_view.md)``に変換可能な`t`の指定された範囲の文字列が追加される。 - * 文字列の長さ `rlen` は、`n` と [`sv.size()`](/reference/string_view/basic_string_view/size.md)` - pos` の小さい方である。 + * 文字列の長さ `rlen` は、`n` と [`sv.size()`](/reference/string_view/basic_string_view/size.md) `- pos` の小さい方である。 以下と等価。 ```cpp basic_string_view sv = t; diff --git a/reference/string/basic_string/append_range.md b/reference/string/basic_string/append_range.md index 63f3b79794..698ae1e401 100644 --- a/reference/string/basic_string/append_range.md +++ b/reference/string/basic_string/append_range.md @@ -15,7 +15,7 @@ Rangeの要素を末尾へ追加する。 ## 効果 -[`append`](append.md)`(basic_string(`[`from_range`](../../ranges/from_range_t.md)`, `[`forward`](../../utility/forward.md)`(rg), `[`get_allocator()`](get_allocator.md)`));` +[`append`](append.md)`(basic_string(`[`from_range`](../../ranges/from_range_t.md)`,` [`forward`](../../utility/forward.md)`(rg),` [`get_allocator()`](get_allocator.md)`));` ## 例 diff --git a/reference/string/basic_string/assign.md b/reference/string/basic_string/assign.md index 5fee95ee2d..cc0cc9cfdd 100644 --- a/reference/string/basic_string/assign.md +++ b/reference/string/basic_string/assign.md @@ -72,7 +72,7 @@ constexpr basic_string& ## テンプレートパラメータ制約 - (9), (10) : 以下の両方を満たしていること - - [`is_convertible_v`](/reference/type_traits/is_convertible.md)`> == true` + - [`is_convertible_v`](/reference/type_traits/is_convertible.md)`> == true` - [`is_convertible_v`](/reference/type_traits/is_convertible.md)` == false` ## 要件 diff --git a/reference/string/basic_string/assign_range.md b/reference/string/basic_string/assign_range.md index 216a6f93a1..ed1d54e62b 100644 --- a/reference/string/basic_string/assign_range.md +++ b/reference/string/basic_string/assign_range.md @@ -15,7 +15,7 @@ Rangeの各要素を再代入する。 ## 効果 -`return ` [`assign`](assign.md)`(basic_string(`[`from_range`](../../ranges/from_range_t.md)`, `[`forward`](../../utility/forward.md)`(rg), `[`get_allocator()`](get_allocator.md)`));` +`return ` [`assign`](assign.md)`(basic_string(`[`from_range`](../../ranges/from_range_t.md)`,` [`forward`](../../utility/forward.md)`(rg),` [`get_allocator()`](get_allocator.md)`));` ## 戻り値 diff --git a/reference/string/basic_string/compare.md b/reference/string/basic_string/compare.md index b0b9bc62c2..7575e9a861 100644 --- a/reference/string/basic_string/compare.md +++ b/reference/string/basic_string/compare.md @@ -102,7 +102,7 @@ constexpr int ## テンプレートパラメータ制約 - (7), (8), (9) : 以下の両方を満たしていること - - [`is_convertible_v`](/reference/type_traits/is_convertible.md)`> == true` + - [`is_convertible_v`](/reference/type_traits/is_convertible.md)`> == true` - [`is_convertible_v`](/reference/type_traits/is_convertible.md)` == false` ## 効果 diff --git a/reference/string/basic_string/insert.md b/reference/string/basic_string/insert.md index bebfa273bd..5f5cc82d99 100644 --- a/reference/string/basic_string/insert.md +++ b/reference/string/basic_string/insert.md @@ -92,7 +92,7 @@ constexpr basic_string& ## テンプレートパラメータ制約 - (10), (11) : 以下の両方を満たしていること - - [`is_convertible_v`](/reference/type_traits/is_convertible.md)`> == true` + - [`is_convertible_v`](/reference/type_traits/is_convertible.md)`> == true` - [`is_convertible_v`](/reference/type_traits/is_convertible.md)` == false` ## 要件 diff --git a/reference/string/basic_string/insert_range.md b/reference/string/basic_string/insert_range.md index 6197d501ce..934479d334 100644 --- a/reference/string/basic_string/insert_range.md +++ b/reference/string/basic_string/insert_range.md @@ -15,7 +15,7 @@ Rangeの各要素を任意の位置に挿入する。 ## 効果 -`return ` [`insert`](insert.md)`(pos, basic_string(`[`from_range`](../../ranges/from_range_t.md)`, `[`forward`](../../utility/forward.md)`(rg), `[`get_allocator()`](get_allocator.md)`));` +`return ` [`insert`](insert.md)`(pos, basic_string(`[`from_range`](../../ranges/from_range_t.md)`,` [`forward`](../../utility/forward.md)`(rg),` [`get_allocator()`](get_allocator.md)`));` ## 戻り値 diff --git a/reference/string/basic_string/op_assign.md b/reference/string/basic_string/op_assign.md index 60b06327eb..dab2006d21 100644 --- a/reference/string/basic_string/op_assign.md +++ b/reference/string/basic_string/op_assign.md @@ -52,7 +52,7 @@ basic_string& operator=(nullptr_t) = delete; // (7) C++23 ## テンプレートパラメータ制約 - (6) : 以下の両方を満たしていること - - [`is_convertible_v`](/reference/type_traits/is_convertible.md)`> == true` + - [`is_convertible_v`](/reference/type_traits/is_convertible.md)`> == true` - [`is_convertible_v`](/reference/type_traits/is_convertible.md)` == false` ## 効果 diff --git a/reference/string/basic_string/op_constructor.md b/reference/string/basic_string/op_constructor.md index b0a95566dd..56a126b7d9 100644 --- a/reference/string/basic_string/op_constructor.md +++ b/reference/string/basic_string/op_constructor.md @@ -150,9 +150,9 @@ constexpr basic_string(from_range_t, R&& rg, ## テンプレートパラメータ制約 - (14) : 以下の両方を満たしていること - - [`is_convertible_v`](/reference/type_traits/is_convertible.md)`> == true` + - [`is_convertible_v`](/reference/type_traits/is_convertible.md)`> == true` - [`is_convertible_v`](/reference/type_traits/is_convertible.md)` == false` -- (15) : [`is_convertible_v`](/reference/type_traits/is_convertible.md)`> == true`であること +- (15) : [`is_convertible_v`](/reference/type_traits/is_convertible.md)`> == true`であること ## 要件 diff --git a/reference/string/basic_string/op_plus_assign.md b/reference/string/basic_string/op_plus_assign.md index c8c721f05c..a983c500f6 100644 --- a/reference/string/basic_string/op_plus_assign.md +++ b/reference/string/basic_string/op_plus_assign.md @@ -31,7 +31,7 @@ constexpr basic_string& operator+=(const T& t); // (5) C++20 ## テンプレートパラメータ制約 - (5) : 以下の両方を満たしていること - - [`is_convertible_v`](/reference/type_traits/is_convertible.md)`> == true` + - [`is_convertible_v`](/reference/type_traits/is_convertible.md)`> == true` - [`is_convertible_v`](/reference/type_traits/is_convertible.md)` == false` ## 要件 diff --git a/reference/string/basic_string/replace.md b/reference/string/basic_string/replace.md index fb22d0451f..6d9733f8bc 100644 --- a/reference/string/basic_string/replace.md +++ b/reference/string/basic_string/replace.md @@ -193,7 +193,7 @@ constexpr basic_string& ## テンプレートパラメータ制約 - (12), (13), (14) : 以下の両方を満たしていること - - [`is_convertible_v`](/reference/type_traits/is_convertible.md)`> == true` + - [`is_convertible_v`](/reference/type_traits/is_convertible.md)`> == true` - [`is_convertible_v`](/reference/type_traits/is_convertible.md)` == false` ## 要件 diff --git a/reference/string/basic_string/resize_and_overwrite.md b/reference/string/basic_string/resize_and_overwrite.md index d7e94a1ff7..210ccc8846 100644 --- a/reference/string/basic_string/resize_and_overwrite.md +++ b/reference/string/basic_string/resize_and_overwrite.md @@ -33,8 +33,8 @@ constexpr void resize_and_overwrite(size_type n, Operation op); // C++23 ## 効果 -1. 関数実行前に `[`[`data()`](data.md)`, `[`data()`](data.md)` + n)` が有効範囲でないなら、領域の確保が行われる([`reserve(n)`](reserve.md) 相当)。新たな領域は初期化されないことに注意。 -1. `std::move(op)(data(), n)` が呼ばれる。`op` 内では、`[`[`data()`](data.md)`, `[`data()`](data.md)` + n)` の範囲に対して任意の初期化を行う。 +1. 関数実行前に `[`[`data()`](data.md)`,` [`data()`](data.md) `+ n)` が有効範囲でないなら、領域の確保が行われる([`reserve(n)`](reserve.md) 相当)。新たな領域は初期化されないことに注意。 +1. `std::move(op)(data(), n)` が呼ばれる。`op` 内では、`[`[`data()`](data.md)`,` [`data()`](data.md) `+ n)` の範囲に対して任意の初期化を行う。 1. `op` の戻り値を `r` とすると、サイズを `r` に変更する。 diff --git a/reference/tuple/tuple/basic_common_reference.md b/reference/tuple/tuple/basic_common_reference.md index 705fa4e1ca..560cb05e59 100644 --- a/reference/tuple/tuple/basic_common_reference.md +++ b/reference/tuple/tuple/basic_common_reference.md @@ -26,7 +26,7 @@ template>`であること。 +- `TTuple`と`UTuple`のそれぞれについて、(次の`T`を置き換える形で)[`is_same_v`](/reference/type_traits/is_same.md)`>`であること。 - 実質的には`TTuple`と`Utuple`について、参照型ではなく、最上位の`const`/`volatile`修飾も持っていないこと要求する。 - `TTuple`と`UTuple`の要素数が一致していること。 - 具体的には、[`tuple_size_v`](../tuple_size.md)` ==` [`tuple_size_v`](../tuple_size.md)``であること。 diff --git a/reference/vector/vector/at.md b/reference/vector/vector/at.md index 64fe656e3a..f742f4e6d6 100644 --- a/reference/vector/vector/at.md +++ b/reference/vector/vector/at.md @@ -29,7 +29,7 @@ constexpr const_reference at(size_type n) const; // (2) C++20 ## 備考 -`at(n)` は `*(`[`begin()`](begin.md)` + n)` と同じ結果となるが、イテレータを使用したランダムアクセスや[`operator[]`](op_at.md)と違い、コンテナの要素数に対して境界チェックを行う。 +`at(n)` は `*(`[`begin()`](begin.md) `+ n)` と同じ結果となるが、イテレータを使用したランダムアクセスや[`operator[]`](op_at.md)と違い、コンテナの要素数に対して境界チェックを行う。 ## 例 diff --git a/reference/vector/vector/op_at.md b/reference/vector/vector/op_at.md index 0906270897..d17b913a37 100644 --- a/reference/vector/vector/op_at.md +++ b/reference/vector/vector/op_at.md @@ -25,7 +25,7 @@ constexpr const_reference operator[](size_type n) const; // (2) C++20 ## 備考 -- `vector`型のオブジェクト`v`に対して、`v[n]` と `*(v.`[`begin()`](begin.md)` + n)` は同じ結果になる +- `vector`型のオブジェクト`v`に対して、`v[n]` と `*(v.`[`begin()`](begin.md) `+ n)` は同じ結果になる - `n >=` [`size()`](size.md)の場合、未定義動作を引き起こす - この関数は、[`at()`](at.md)メンバ関数とちがって境界チェックを行うことが規定されない。標準ライブラリの実装によっては[`assert`](/reference/cassert/assert.md)`(n <` [`size()`](size.md)`)`による境界チェックが行われる場合がある From 1e9038544bfb2bbd89f296904c612cda771d58d4 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sun, 31 Aug 2025 19:13:56 +0900 Subject: [PATCH 2345/3948] =?UTF-8?q?=E7=A9=BA=E7=99=BD=E3=81=8C=E6=B6=88?= =?UTF-8?q?=E3=81=88=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=AB=E3=83=90?= =?UTF-8?q?=E3=83=83=E3=82=AF=E3=82=AF=E3=82=A9=E3=83=BC=E3=83=88=E3=82=92?= =?UTF-8?q?=20=20=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit バッククォート内の両端の空白は変換時に削除されます。 しかし、変更箇所は「区切り文字はカンマと空白の2文字である」という意味なので、空白が削除されると困ります。 そこで、 タグに変更して空白が残るようにしました。 --- reference/format/format.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/format/format.md b/reference/format/format.md index 6b01cd0e8a..c3801f9ab1 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -241,7 +241,7 @@ Range・シーケンスコンテナに対して使用できる標準のオプシ | m | `std::map`出力向けの書式 | 全体の囲み文字を`[ ]`の代わりに`{ }`とする。要素型にも`m`書式を適用する | C++23 | | s | 文字列として出力 | 要素型が文字型であること。エスケープ処理しない文字列として書式化する | C++23 | | ?s | デバッグ文字列として出力 | 要素型が文字型であること。エスケープした文字列として書式化する | C++23 | -| (なし) | デフォルト | 囲み文字を`[ ]`、区切り文字を`, `として書式化する | C++23 | +| (なし) | デフォルト | 囲み文字を`[ ]`、区切り文字を, として書式化する | C++23 | - `m`書式は、要素が[`std::pair`](/reference/utility/pair.md)とサイズ2の[`std::tuple`](/reference/tuple/tuple.md)の場合のみ指定できる - `?s`書式を指定した場合、`n`オプションと、`range-underlying-spec`は指定できない From 98dc272e1b8c7844bf248c5b3487b4ecf4e252c4 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sun, 31 Aug 2025 19:19:04 +0900 Subject: [PATCH 2346/3948] =?UTF-8?q?=20=E3=82=BF=E3=82=B0=E3=81=8C?= =?UTF-8?q?=E6=AD=A3=E3=81=97=E3=81=8F=E8=A1=A8=E7=A4=BA=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/random/independent_bits_engine/max.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/random/independent_bits_engine/max.md b/reference/random/independent_bits_engine/max.md index 2c77eec017..bb24d5e854 100644 --- a/reference/random/independent_bits_engine/max.md +++ b/reference/random/independent_bits_engine/max.md @@ -14,7 +14,7 @@ static constexpr result_type max(); ## 戻り値 -最大値である`2``w`` -1`を返す。 +最大値である2w - 1を返す。 ## 計算量 From b3855d825b0216806e95278d5f0048ed0c107035 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sun, 31 Aug 2025 21:06:16 +0900 Subject: [PATCH 2347/3948] =?UTF-8?q?=E6=AC=A0=E3=81=91=E3=81=9F=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 1d0cf2b で誤って削除されたようです。 --- reference/regex/basic_regex/flags.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/regex/basic_regex/flags.md b/reference/regex/basic_regex/flags.md index 0011209dfd..5e462ac12f 100644 --- a/reference/regex/basic_regex/flags.md +++ b/reference/regex/basic_regex/flags.md @@ -26,7 +26,7 @@ flag_type flags() const; #include #include -#define PRINTFLAG(f, FLAG) (std::cout << #FLAG " is " << (f & std::regex_constants::FLAG ? "set" : "n +#define PRINTFLAG(f, FLAG) (std::cout << #FLAG " is " << (f & std::regex_constants::FLAG ? "set" : "not set") << std::endl) void print(std::regex_constants::syntax_option_type f) { From 66b00196a36570e03c49c65359ada7fb1ff60599 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sun, 31 Aug 2025 21:36:04 +0900 Subject: [PATCH 2348/3948] =?UTF-8?q?=E5=AF=BE=E5=BF=9C=E3=81=97=E3=81=AA?= =?UTF-8?q?=E3=81=84=E4=B8=B8=E3=82=AB=E3=83=83=E3=82=B3=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_find_end.md | 2 +- reference/algorithm/ranges_remove_copy.md | 2 +- reference/algorithm/ranges_remove_copy_if.md | 2 +- reference/algorithm/remove_copy.md | 2 +- reference/algorithm/remove_copy_if.md | 2 +- reference/cassert/assert.md | 2 +- reference/chrono/format.md | 2 +- reference/chrono/system_clock.md | 4 ++-- reference/cmath/beta.md | 2 +- reference/compare/strong_ordering.md | 2 +- reference/cstdint.md | 2 +- reference/execution/execution/sender.md | 2 +- reference/functional/not_fn.md | 2 +- reference/generator/generator.md | 2 +- reference/mdspan/extents/op_deduction_guide.md | 2 +- reference/memory/make_shared.md | 2 +- reference/random/negative_binomial_distribution.md | 2 +- reference/ranges/adjacent_view.md | 2 +- reference/regex/match_results/op_equal.md | 2 +- reference/span/span/op_constructor.md | 2 +- reference/type_traits/invoke_result.md | 2 +- start_editing/comparison_operator_template_page.md | 2 +- start_editing/concept_template_page.md | 2 +- start_editing/cpo_template_page.md | 2 +- start_editing/function_template_page.md | 2 +- start_editing/header_template_page.md | 2 +- start_editing/lang_template_page.md | 2 +- start_editing/module_template_page.md | 2 +- start_editing/named_requirement_template_page.md | 2 +- start_editing/type-type_template_page.md | 2 +- 30 files changed, 31 insertions(+), 31 deletions(-) diff --git a/reference/algorithm/ranges_find_end.md b/reference/algorithm/ranges_find_end.md index ef0bc69de2..fb9caa8128 100644 --- a/reference/algorithm/ranges_find_end.md +++ b/reference/algorithm/ranges_find_end.md @@ -46,7 +46,7 @@ namespace std::ranges { ## 戻り値 -- (1): `[first1,last1 - (last2 - first2))` 内のイテレータ `i` があるとき、0 以上 `last2 - first2` 未満の全ての整数 `n` について、それぞれ `*(i + n) == *(first2 + n)` もしくは `invoke(pred, invoke(proj1, *(i + n)), invoke(proj2, *(first2 + n)))) != false` であるようなサブシーケンスを探し、見つかった **最後の** サブシーケンス`{i, i + (i == last1 ? 0 : last2 - first2)}`を返す。そのようなイテレータが見つからない、もしくは `[first2,last2)` が空である場合は `{last1, last1}` を返す。 +- (1): `[first1,last1 - (last2 - first2))` 内のイテレータ `i` があるとき、0 以上 `last2 - first2` 未満の全ての整数 `n` について、それぞれ `*(i + n) == *(first2 + n)` もしくは `invoke(pred, invoke(proj1, *(i + n)), invoke(proj2, *(first2 + n))) != false` であるようなサブシーケンスを探し、見つかった **最後の** サブシーケンス`{i, i + (i == last1 ? 0 : last2 - first2)}`を返す。そのようなイテレータが見つからない、もしくは `[first2,last2)` が空である場合は `{last1, last1}` を返す。 - (2): `first1 = begin(r1)`, `last1 = end(r1)`, `first2 = begin(r2)`, `last2 = end(r2)`の下で(1)と等しい。 ## 計算量 diff --git a/reference/algorithm/ranges_remove_copy.md b/reference/algorithm/ranges_remove_copy.md index 5766aa8f0e..68e13f9ee0 100644 --- a/reference/algorithm/ranges_remove_copy.md +++ b/reference/algorithm/ranges_remove_copy.md @@ -85,7 +85,7 @@ namespace std::ranges { - (2): Rangeを直接指定する ## 事前条件 -- `[first,last)` と `[result,result + (last - first)` は重なってはならない。 +- `[first,last)` と `[result,result + (last - first))` は重なってはならない。 ## 効果 `[first,last)` 内にあるイテレータ `i` について、[`invoke`](/reference/functional/invoke.md)`(proj, *i) == value` でない要素を `result` へコピーする diff --git a/reference/algorithm/ranges_remove_copy_if.md b/reference/algorithm/ranges_remove_copy_if.md index 810f918c20..2f0c10842a 100644 --- a/reference/algorithm/ranges_remove_copy_if.md +++ b/reference/algorithm/ranges_remove_copy_if.md @@ -43,7 +43,7 @@ namespace std::ranges { - (2): Rangeを直接指定する ## 事前条件 -- `[first,last)` と `[result,result + (last - first)` は重なってはならない。 +- `[first,last)` と `[result,result + (last - first))` は重なってはならない。 ## 効果 diff --git a/reference/algorithm/remove_copy.md b/reference/algorithm/remove_copy.md index a7d0807a7d..0d68759f16 100644 --- a/reference/algorithm/remove_copy.md +++ b/reference/algorithm/remove_copy.md @@ -62,7 +62,7 @@ namespace std { ## 事前条件 -- `[first,last)` と `[result,result + (last - first)` は重なってはならない。 +- `[first,last)` と `[result,result + (last - first))` は重なってはならない。 ## 効果 diff --git a/reference/algorithm/remove_copy_if.md b/reference/algorithm/remove_copy_if.md index aafd67fa68..02d1c216b0 100644 --- a/reference/algorithm/remove_copy_if.md +++ b/reference/algorithm/remove_copy_if.md @@ -39,7 +39,7 @@ namespace std { ## 事前条件 -- `[first,last)` と `[result,result + (last - first)` は重なってはならない +- `[first,last)` と `[result,result + (last - first))` は重なってはならない ## 効果 diff --git a/reference/cassert/assert.md b/reference/cassert/assert.md index 0971cf000a..edb1e91955 100644 --- a/reference/cassert/assert.md +++ b/reference/cassert/assert.md @@ -30,7 +30,7 @@ - C++03 : パラメータの式を評価し、 - C++26 : 可変引数パラメータ`__VA_ARGS__`を`bool`に変換し、 - 真に評価された場合は、なにもしない - - そうでない場合(`0`と等しい場合)、式をテキスト化したもの、([`std::source_location`](/reference/source_location/source_location.md)`::`[`current()`](/reference/source_location/source_location/current.md)で取得できるような) ソースファイル名、行番号、関数名を標準エラー出力に処理系定義の書式で書き込み、[`abort()`](/reference/cstdlib/abort.md)関数を呼び出してプログラムを異常終了させる + - そうでない場合(`0`と等しい場合)、式をテキスト化したもの、([`std::source_location`](/reference/source_location/source_location.md)`::`[`current()`](/reference/source_location/source_location/current.md)で取得できるような)ソースファイル名、行番号、関数名を標準エラー出力に処理系定義の書式で書き込み、[`abort()`](/reference/cstdlib/abort.md)関数を呼び出してプログラムを異常終了させる - 無効な場合: - パラメータの式は評価はされず、なにもしない diff --git a/reference/chrono/format.md b/reference/chrono/format.md index afb745343b..a630dc8395 100644 --- a/reference/chrono/format.md +++ b/reference/chrono/format.md @@ -45,7 +45,7 @@ chronoライブラリではこれに加え、たとえばデフォルトでは | `%b` | ロケール依存の月の略称。
値に有効な月が含まれていない場合、[`std::format_error`](/reference/format/format_error.md)例外を送出する | `"Apr"`, `"4月"` | | `%B` | ロケール依存の月の完全名。
値に有効な月が含まれていない場合、[`std::format_error`](/reference/format/format_error.md)例外を送出する | `"April"`, `"4月"` | | `%c` | ロケール依存の日付・時間の表現。改良コマンド`%Ec`を指定すると、異なる表現を出力する | `"Fri Apr 24 17:14:44 2020"`
`"2020年04月24日 17時14分44秒"` | -| `%C` | 100で切り下げ除算した年 (世紀)。結果が10進数で1桁の場合、先頭に`0`がつく。改良コマンド`%EC`を指定すると、ロケール依存の世紀の異なる表現を出力する | 2020年では`"20"`) | +| `%C` | 100で切り下げ除算した年 (世紀)。結果が10進数で1桁の場合、先頭に`0`がつく。改良コマンド`%EC`を指定すると、ロケール依存の世紀の異なる表現を出力する | 2020年では`"20"` | | `%d` | 10進数での月の日。結果が10進数で1桁の場合、先頭に`0`がつく。改良コマンド`%Od`を指定すると、ロケール依存の異なる表現を出力する | `"24"` | | `%D` | `%m/%d/%y`と等価 | `"04/24/20"` | | `%e` | 10進数での月の日。結果が10進数で1桁の場合、先頭にスペースがつく。改良コマンド`%Oe`を指定すると、ロケール依存の異なる表現を出力する | `" 1"` | diff --git a/reference/chrono/system_clock.md b/reference/chrono/system_clock.md index 5cd997425f..ec323b9c0b 100644 --- a/reference/chrono/system_clock.md +++ b/reference/chrono/system_clock.md @@ -22,8 +22,8 @@ namespace chrono { `system_clock`のエポックは、以下である: -- C++17 以前の場合、`system_clock` のエポックがどの時間を指しているかは未規定だが、ほとんどの処理系は UNIX 時間(1970年1月1日0時0分0秒)を指している -- C++20 以降の場合、`system_clock` のエポックは必ず UNIX 時間(1970年1月1日0時0分0秒)を指す +- C++17 以前の場合、`system_clock` のエポックがどの時間を指しているかは未規定だが、ほとんどの処理系は UNIX 時間(1970年1月1日0時0分0秒)を指している +- C++20 以降の場合、`system_clock` のエポックは必ず UNIX 時間(1970年1月1日0時0分0秒)を指す ### うるう秒の扱い diff --git a/reference/cmath/beta.md b/reference/cmath/beta.md index 08b495321e..ce97c597d2 100644 --- a/reference/cmath/beta.md +++ b/reference/cmath/beta.md @@ -91,7 +91,7 @@ beta(2, 4) = 0.05 ### 備考 #### GCC (libstdc++) GCC 7.1.0–8.0.0 では `beta` は [`exp`](exp.md) と [`lgamma`](lgamma.md) を用いて -$ |\mathrm{B}(x, y)| = \exp(\ln |\Gamma(x) \Gamma(y) / \Gamma(x + y)|)) $ +$ |\mathrm{B}(x, y)| = \exp(\ln |\Gamma(x) \Gamma(y) / \Gamma(x + y)|) $ を計算する。 `x < 0 || y < 0` でも定義域エラーを報告せずに値を返すが、戻り値は必ず正になる。 diff --git a/reference/compare/strong_ordering.md b/reference/compare/strong_ordering.md index f0a37196d6..ec99dda785 100644 --- a/reference/compare/strong_ordering.md +++ b/reference/compare/strong_ordering.md @@ -22,7 +22,7 @@ namespace std { //静的メンバ定数の定義(初期化している値は説明のためのもの) inline constexpr strong_ordering strong_ordering::less(-1); inline constexpr strong_ordering strong_ordering::equal(0); - inline constexpr strong_ordering strong_ordering::equivalent(0)); + inline constexpr strong_ordering strong_ordering::equivalent(0); inline constexpr strong_ordering strong_ordering::greater(1); } ``` diff --git a/reference/cstdint.md b/reference/cstdint.md index ec90bd79f7..f10abe212f 100644 --- a/reference/cstdint.md +++ b/reference/cstdint.md @@ -112,7 +112,7 @@ ## 符号付き整数型用の定数値マクロ 以下のマクロは、各整数型の定数値を表す関数マクロである。 -例:) `int8_t x = INT8_C(1);` +例: `int8_t x = INT8_C(1);` | マクロ | 説明 | 対応バージョン | |---------------|------------------------------------------|-------| diff --git a/reference/execution/execution/sender.md b/reference/execution/execution/sender.md index 12b11c6bee..e915cd2c33 100644 --- a/reference/execution/execution/sender.md +++ b/reference/execution/execution/sender.md @@ -59,7 +59,7 @@ inline constexpr bool enable_sender = enable-sender; ```cpp template concept sender = - enable_sender>) && + enable_sender> && requires (const remove_cvref_t& sndr) { { get_env(sndr) } -> queryable; } && diff --git a/reference/functional/not_fn.md b/reference/functional/not_fn.md index 391149c770..14ed76fd88 100644 --- a/reference/functional/not_fn.md +++ b/reference/functional/not_fn.md @@ -75,7 +75,7 @@ private: ## 戻り値(C++20) 結果オブジェクト`g`に対する関数呼び出し式の引数パック`call_args`としたとき -- (1) : `fd`を[`std::forward`](/reference/utility/forward.md)`(f))`で直接非リスト初期化した`FD`型のオブジェクトに対して +- (1) : `fd`を[`std::forward`](/reference/utility/forward.md)`(f)`で直接非リスト初期化した`FD`型のオブジェクトに対して - 関数呼び出し式の結果が`!`[`invoke`](invoke.md)`(fd, call_args...)`に等しい、完全転送呼び出しラッパー(perfect forwarding call wrapper)オブジェクトを返す。 - (2) : - 関数呼び出し式の結果が`!`[`invoke`](invoke.md)`(f, call_args...)`に等しい、状態を持たない完全転送呼び出しラッパー(perfect forwarding call wrapper)オブジェクトを返す。 diff --git a/reference/generator/generator.md b/reference/generator/generator.md index 236c8f103d..4ba98f5de2 100644 --- a/reference/generator/generator.md +++ b/reference/generator/generator.md @@ -204,7 +204,7 @@ std::generator ints() int main() { - for (int n : ints())) { + for (int n : ints()) { std::cout << n << ' '; } } diff --git a/reference/mdspan/extents/op_deduction_guide.md b/reference/mdspan/extents/op_deduction_guide.md index 53ad5c7128..1ba83d137a 100644 --- a/reference/mdspan/extents/op_deduction_guide.md +++ b/reference/mdspan/extents/op_deduction_guide.md @@ -16,7 +16,7 @@ namespace std { ## テンプレートパラメータ制約 -[`is_convertible_v`](/reference/type_traits/is_convertible.md)` && ...)`が`true`であること。 +`(`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` && ...)`が`true`であること。 ## 例 diff --git a/reference/memory/make_shared.md b/reference/memory/make_shared.md index 9be943d808..c391ef254b 100644 --- a/reference/memory/make_shared.md +++ b/reference/memory/make_shared.md @@ -40,7 +40,7 @@ namespace std { 配列タイプのオブジェクトがデフォルトの初期値を持つように指定されている場合、これはオブジェクトの各配列要素がデフォルトの初期値を持つ(値初期化される)ことを意味すると解釈される。 -非配列型`U`の(サブ)オブジェクトが、`v`または`U(l ...)`の初期値を持つように指定されている場合(`l...`はコンストラクタ引数のリスト)、`make_shared`は、式`::new (pv) U(v)`または`::new (pv) U(l...)`を使用して、この(サブ)オブジェクトを初期化する。ここで、`pv`の型は`void*`であり、型`U`のオブジェクトを保持するのに適したストレージを指す。 +非配列型`U`の(サブ)オブジェクトが、`v`または`U(l ...)`の初期値を持つように指定されている場合(`l...`はコンストラクタ引数のリスト)、`make_shared`は、式`::new (pv) U(v)`または`::new (pv) U(l...)`を使用して、この(サブ)オブジェクトを初期化する。ここで、`pv`の型は`void*`であり、型`U`のオブジェクトを保持するのに適したストレージを指す。 非配列型`U`の(サブ)オブジェクトがデフォルトの初期値を持つように指定されている場合、この関数は、式 `::new (pv) U()`を使用してこの(サブ)オブジェクトを初期化する。`void*`は型`U`のオブジェクトを保持するのに適したストレージを指す。 diff --git a/reference/random/negative_binomial_distribution.md b/reference/random/negative_binomial_distribution.md index 6ce54bcded..0157ccc871 100644 --- a/reference/random/negative_binomial_distribution.md +++ b/reference/random/negative_binomial_distribution.md @@ -13,7 +13,7 @@ namespace std { ## 概要 `negative_binomial_distribution`は、離散確率分布の一種である、負の二項分布を表すクラスである。 -二項分布([`binomial_distribution`](binomial_distribution.md)が「確率pで成功する事象をt回試行し、成功回数を取得する」のに対し、負の二項分布は「確率pで成功する事象がk回成功するまでに失敗した回数を取得する」ということを行う。 +二項分布([`binomial_distribution`](binomial_distribution.md))が「確率pで成功する事象をt回試行し、成功回数を取得する」のに対し、負の二項分布は「確率pで成功する事象がk回成功するまでに失敗した回数を取得する」ということを行う。 負の二項分布は、実装によって「k回成功するまでに試行した回数を取得する」ものと、「k回成功するまでに失敗した回数を取得する」もの、2つのバリエーションが存在する。`std::negative_binomial_distribution`クラスは後者である。 diff --git a/reference/ranges/adjacent_view.md b/reference/ranges/adjacent_view.md index d9c9591b59..a977bf0cdb 100644 --- a/reference/ranges/adjacent_view.md +++ b/reference/ranges/adjacent_view.md @@ -43,7 +43,7 @@ namespace std::ranges { - (2): 式`views::adjacent(E)`の効果は次の通り - `N` > 0 のとき、`adjacent_view<`[`views::all_t`](all.md)`, N>(E)` と等しい - - `N` = 0 のとき、`auto((void)E,` [`views::empty`](empty_view.md)`<`[`tuple`](/reference/tuple/tuple.md)`<>>))` と等しい + - `N` = 0 のとき、`auto((void)E,` [`views::empty`](empty_view.md)`<`[`tuple`](/reference/tuple/tuple.md)`<>>)` と等しい ## メンバ関数 diff --git a/reference/regex/match_results/op_equal.md b/reference/regex/match_results/op_equal.md index 0183158d8a..e116a19132 100644 --- a/reference/regex/match_results/op_equal.md +++ b/reference/regex/match_results/op_equal.md @@ -24,7 +24,7 @@ namespace std { - `m1.`[`empty`](empty.md)`() && m2.`[`empty`](empty.md)`()` である。 - `!m1.`[`empty`](empty.md)`() && !m2.`[`empty`](empty.md)`()`、かつ、以下の条件をすべて満たす。 - `m1.`[`prefix`](prefix.md)`() == m2.`[`prefix`](prefix.md)`()` - - `m1.`[`size`](size.md)`() == m2.`[`size`](size.md)`() &&` [`equal`](../../algorithm/equal.md)`(m1.`[`begin`](begin.md)`(), m1.`[`end`](end.md)`(), m2.`[`begin`](begin.md)`()` + - `m1.`[`size`](size.md)`() == m2.`[`size`](size.md)`() &&` [`equal`](../../algorithm/equal.md)`(m1.`[`begin`](begin.md)`(), m1.`[`end`](end.md)`(), m2.`[`begin`](begin.md)`())` - `m1.`[`suffix`](suffix.md)`() == m2.`[`suffix`](suffix.md)`()` diff --git a/reference/span/span/op_constructor.md b/reference/span/span/op_constructor.md index 5b084d70ee..c4481a62f2 100644 --- a/reference/span/span/op_constructor.md +++ b/reference/span/span/op_constructor.md @@ -79,7 +79,7 @@ constexpr explicit(extent != dynamic_extent) - [`std::is_convertible_v`](/reference/type_traits/is_convertible.md)`` が `false`であること - (4), (5), (6) : - `extent ==` [`dynamic_extent`](/reference/span/dynamic_extent.md) `|| N == extent`が`true`であること - - [`remove_pointer_t`](/reference/type_traits/remove_pointer.md)``を型`U`であるとして、 + - [`remove_pointer_t`](/reference/type_traits/remove_pointer.md)``を型`U`であるとして、 - [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true`であること (この制約の意図は、配列の要素型から`element_type`へ、修飾の変換のみを許可すること) - (7) : - 型 `U` を [`std::remove_reference_t`](/reference/type_traits/remove_reference.md)`<`[`std::iter_reference_t`](/reference/iterator/iter_reference_t.md)`>`とするとき diff --git a/reference/type_traits/invoke_result.md b/reference/type_traits/invoke_result.md index f8ee93eff9..f688189256 100644 --- a/reference/type_traits/invoke_result.md +++ b/reference/type_traits/invoke_result.md @@ -30,7 +30,7 @@ namespace std { メンバ型`type`が定義される場合、以下と同じ型となる: ```cpp -decltype(std::invoke(std::declval(), std::declval()...) +decltype(std::invoke(std::declval(), std::declval()...)) ``` ## 備考 diff --git a/start_editing/comparison_operator_template_page.md b/start_editing/comparison_operator_template_page.md index 8a134c590c..112993dbdb 100644 --- a/start_editing/comparison_operator_template_page.md +++ b/start_editing/comparison_operator_template_page.md @@ -1,4 +1,4 @@ -# page_title ((1行目の見出し1はページのタイトルです。修飾なしで記載してください) +# page_title (1行目の見出し1はページのタイトルです。修飾なしで記載してください) ([cpprefjpを編集するには](/start_editing.md) および [cpprefjpでのMarkdown記法の制限と拡張](markdown_cpprefjp.md) を先に読んで下さい。) diff --git a/start_editing/concept_template_page.md b/start_editing/concept_template_page.md index baca279221..7a21b80894 100644 --- a/start_editing/concept_template_page.md +++ b/start_editing/concept_template_page.md @@ -1,4 +1,4 @@ -# page_title ((1行目の見出し1はページのタイトルです。修飾なしで記載してください) +# page_title (1行目の見出し1はページのタイトルです。修飾なしで記載してください) ([cpprefjpを編集するには](/start_editing.md) および [cpprefjpでのMarkdown記法の制限と拡張](markdown_cpprefjp.md) を先に読んで下さい。) diff --git a/start_editing/cpo_template_page.md b/start_editing/cpo_template_page.md index 50f2eac098..b2cef3b058 100644 --- a/start_editing/cpo_template_page.md +++ b/start_editing/cpo_template_page.md @@ -1,4 +1,4 @@ -# page_title ((1行目の見出し1はページのタイトルです。修飾なしで記載してください) +# page_title (1行目の見出し1はページのタイトルです。修飾なしで記載してください) ([cpprefjpを編集するには](/start_editing.md) および [cpprefjpでのMarkdown記法の制限と拡張](markdown_cpprefjp.md) を先に読んで下さい。) diff --git a/start_editing/function_template_page.md b/start_editing/function_template_page.md index 6d08557e88..5f4de1fea0 100644 --- a/start_editing/function_template_page.md +++ b/start_editing/function_template_page.md @@ -1,4 +1,4 @@ -# page_title ((1行目の見出し1はページのタイトルです。修飾なしで記載してください) +# page_title (1行目の見出し1はページのタイトルです。修飾なしで記載してください) ([cpprefjpを編集するには](/start_editing.md) および [cpprefjpでのMarkdown記法の制限と拡張](markdown_cpprefjp.md) を先に読んで下さい。) diff --git a/start_editing/header_template_page.md b/start_editing/header_template_page.md index 1ca0e88012..a63be56b59 100644 --- a/start_editing/header_template_page.md +++ b/start_editing/header_template_page.md @@ -1,4 +1,4 @@ -# page_title ((1行目の見出し1はページのタイトルです。修飾なしで記載してください) +# page_title (1行目の見出し1はページのタイトルです。修飾なしで記載してください) ([cpprefjpを編集するには](/start_editing.md) および [cpprefjpでのMarkdown記法の制限と拡張](markdown_cpprefjp.md) を先に読んで下さい。) diff --git a/start_editing/lang_template_page.md b/start_editing/lang_template_page.md index 9dad3f21f6..6f41aad213 100644 --- a/start_editing/lang_template_page.md +++ b/start_editing/lang_template_page.md @@ -1,4 +1,4 @@ -# page_title ((1行目の見出し1はページのタイトルです。修飾なしで記載してください) +# page_title (1行目の見出し1はページのタイトルです。修飾なしで記載してください) ([cpprefjpを編集するには](/start_editing.md) および [cpprefjpでのMarkdown記法の制限と拡張](markdown_cpprefjp.md) を先に読んで下さい。) diff --git a/start_editing/module_template_page.md b/start_editing/module_template_page.md index 77a236834b..e2d87fd13f 100644 --- a/start_editing/module_template_page.md +++ b/start_editing/module_template_page.md @@ -1,4 +1,4 @@ -# page_title ((1行目の見出し1はページのタイトルです。修飾なしで記載してください) +# page_title (1行目の見出し1はページのタイトルです。修飾なしで記載してください) ([cpprefjpを編集するには](/start_editing.md) および [cpprefjpでのMarkdown記法の制限と拡張](markdown_cpprefjp.md) を先に読んで下さい。) diff --git a/start_editing/named_requirement_template_page.md b/start_editing/named_requirement_template_page.md index 3f7f13085a..fe39a9b0ea 100644 --- a/start_editing/named_requirement_template_page.md +++ b/start_editing/named_requirement_template_page.md @@ -1,4 +1,4 @@ -# page_title ((1行目の見出し1はページのタイトルです。修飾なしで記載してください) +# page_title (1行目の見出し1はページのタイトルです。修飾なしで記載してください) ([cpprefjpを編集するには](/start_editing.md) および [cpprefjpでのMarkdown記法の制限と拡張](markdown_cpprefjp.md) を先に読んで下さい。) diff --git a/start_editing/type-type_template_page.md b/start_editing/type-type_template_page.md index 98a4455ce1..b67913eb2a 100644 --- a/start_editing/type-type_template_page.md +++ b/start_editing/type-type_template_page.md @@ -1,4 +1,4 @@ -# page_title ((1行目の見出し1はページのタイトルです。修飾なしで記載してください) +# page_title (1行目の見出し1はページのタイトルです。修飾なしで記載してください) ([cpprefjpを編集するには](/start_editing.md) および [cpprefjpでのMarkdown記法の制限と拡張](markdown_cpprefjp.md) を先に読んで下さい。) From d5e5ead4e5d1f3cf958c4d472adb5f7dedc1d6cb Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sun, 31 Aug 2025 21:40:16 +0900 Subject: [PATCH 2349/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=B8=AD?= =?UTF-8?q?=E3=81=AE=E5=85=A8=E8=A7=92=E3=82=B9=E3=83=9A=E3=83=BC=E3=82=B9?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/execution/execution/let_value.md | 2 +- reference/execution/execution/parallel_scheduler.md | 2 +- reference/execution/execution/when_all.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/execution/execution/let_value.md b/reference/execution/execution/let_value.md index 04eb86aa87..5582e4a114 100644 --- a/reference/execution/execution/let_value.md +++ b/reference/execution/execution/let_value.md @@ -134,7 +134,7 @@ namespace std::execution { using LetFn = remove_cvref_t>; auto cs = get_completion_signatures, FWD-ENV-T(Env)...>(); auto fn = [](decayed-typeof(*)(Ts...)) { - if constexpr (!is-valid-let-sender)  // see below + if constexpr (!is-valid-let-sender) // see below throw unspecified-exception(); }; cs.for-each(overload-set(fn, [](auto){})); diff --git a/reference/execution/execution/parallel_scheduler.md b/reference/execution/execution/parallel_scheduler.md index 47dc63b2ac..b6f7f2361b 100644 --- a/reference/execution/execution/parallel_scheduler.md +++ b/reference/execution/execution/parallel_scheduler.md @@ -84,7 +84,7 @@ namespace ex = std::execution; int main() { - ex::scheduler auto sch = ex::get_parallel_scheduler(); + ex::scheduler auto sch = ex::get_parallel_scheduler(); static_assert(std::same_as); } ``` diff --git a/reference/execution/execution/when_all.md b/reference/execution/execution/when_all.md index 77723717c2..d61223b379 100644 --- a/reference/execution/execution/when_all.md +++ b/reference/execution/execution/when_all.md @@ -368,7 +368,7 @@ int main() // snd1,snd2両方の完了を待機するSender ex::sender auto sndr = ex::when_all(snd1, snd2); - auto result = std::this_thread::sync_wait(sndr); + auto result = std::this_thread::sync_wait(sndr); // result := optional>型 std::println("result={}", result.value()); } From b78f6ab9e1f491262de91af28beb2c36b0cc4c49 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sun, 31 Aug 2025 21:46:41 +0900 Subject: [PATCH 2350/3948] =?UTF-8?q?=E6=96=87=E7=AB=A0=E4=B8=AD=E3=82=84?= =?UTF-8?q?=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88=E3=81=AE=E5=85=A8=E8=A7=92?= =?UTF-8?q?=E3=82=B9=E3=83=9A=E3=83=BC=E3=82=B9=E3=82=92=E5=8D=8A=E8=A7=92?= =?UTF-8?q?=E3=82=B9=E3=83=9A=E3=83=BC=E3=82=B9=E3=81=AB=E7=BD=AE=E6=8F=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit リンクテキストを除いて全角スペースを半角スペースに置換しました。 --- lang/cpp17/declaring_non-type_template_arguments_with_auto.md | 2 +- reference/chrono/year_month_day.md | 2 +- reference/complex/complex/pow.md | 4 ++-- reference/concepts/equality_comparable.md | 2 +- reference/concepts/totally_ordered.md | 2 +- reference/cstdlib/atof.md | 2 +- reference/cstdlib/atoi_atol_atoll.md | 2 +- reference/flat_map/flat_map/rend.md | 2 +- reference/flat_map/flat_multimap/rend.md | 2 +- reference/flat_set/flat_multiset/rend.md | 2 +- reference/flat_set/flat_set/rend.md | 2 +- reference/ios/ios_base/type-event.md | 2 +- reference/ios/ios_base/type-event_callback.md | 2 +- reference/ios/ios_base/type-fmtflags.md | 2 +- reference/linalg/layout_transpose/mapping.md | 2 +- reference/map/map/rend.md | 2 +- reference/map/multimap/rend.md | 2 +- reference/mdspan/mdspan/op_deduction_guide.md | 2 +- reference/mdspan/submdspan.md | 2 +- reference/queue/queue.md | 2 +- reference/streambuf/basic_streambuf/showmanyc.md | 4 ++-- reference/unordered_map/unordered_multimap/swap.md | 2 +- reference/unordered_set/unordered_multiset/swap.md | 2 +- reference/unordered_set/unordered_set/swap.md | 2 +- 24 files changed, 26 insertions(+), 26 deletions(-) diff --git a/lang/cpp17/declaring_non-type_template_arguments_with_auto.md b/lang/cpp17/declaring_non-type_template_arguments_with_auto.md index 046baebd95..26de00e2a2 100644 --- a/lang/cpp17/declaring_non-type_template_arguments_with_auto.md +++ b/lang/cpp17/declaring_non-type_template_arguments_with_auto.md @@ -47,7 +47,7 @@ A<3.14>; // コンパイルエラー (浮動小数点数は渡せない) - オブジェクトへの左辺値参照または関数への左辺値参照 - メンバへのポインタ - [`std::nullptr_t`](/reference/cstddef/nullptr_t.md) -- プレースホルダ型を含む型 <-- この行が追加された +- プレースホルダ型を含む型 <-- この行が追加された なお、[temp.param]/4 は C++20 で変更予定である。[Working Draft, Standard](http://eel.is/c++draft/temp.param)を参照。 diff --git a/reference/chrono/year_month_day.md b/reference/chrono/year_month_day.md index 13001ffd7b..8615859ba5 100644 --- a/reference/chrono/year_month_day.md +++ b/reference/chrono/year_month_day.md @@ -226,7 +226,7 @@ chrono::year_month_day unix_time_to_ymd(std::time_t unixtime) { int main() { - // UNIX時間での現在日時を取得  + // UNIX時間での現在日時を取得 std::time_t now = std::time(nullptr); chrono::year_month_day date = unix_time_to_ymd(now); diff --git a/reference/complex/complex/pow.md b/reference/complex/complex/pow.md index 8135bf4e0c..92f483eaf9 100644 --- a/reference/complex/complex/pow.md +++ b/reference/complex/complex/pow.md @@ -120,8 +120,8 @@ pow( (1,2), (3,4) ) = (0.12901,0.0339241) ### 備考 - libstdc++ では、バージョンによって C++11 モードの挙動が異なる。 - - 4.3.6 では第 2 引数が `int` のオーバーロード (4) が無効化されていない。また、追加のオーバーロード (5) は `complex` でない方の引数の型が算術型でなくても、算術型への暗黙の型変換が可能であれば、適用されてしまう。さらに、追加のオーバーロード (5) の結果型は、引数の型が `complex` と整数型の場合、`complex` になってしまう。 - - 4.4.7、4.5.4 では、第 2 引数が `int` のオーバーロード (4) は無効化されているが、追加のオーバーロード (5) は `complex` でない方の引数の型が算術型でなくても、算術型への暗黙の型変換が可能であれば、適用されてしまう。さらに、追加のオーバーロード (5) の結果型は、引数の型が `complex` と整数型の場合、`complex` になってしまう。 + - 4.3.6 では第 2 引数が `int` のオーバーロード (4) が無効化されていない。また、追加のオーバーロード (5) は `complex` でない方の引数の型が算術型でなくても、算術型への暗黙の型変換が可能であれば、適用されてしまう。さらに、追加のオーバーロード (5) の結果型は、引数の型が `complex` と整数型の場合、`complex` になってしまう。 + - 4.4.7、4.5.4 では、第 2 引数が `int` のオーバーロード (4) は無効化されているが、追加のオーバーロード (5) は `complex` でない方の引数の型が算術型でなくても、算術型への暗黙の型変換が可能であれば、適用されてしまう。さらに、追加のオーバーロード (5) の結果型は、引数の型が `complex` と整数型の場合、`complex` になってしまう。 - 4.6.4 から 4.8.2 の間は第 2 引数が `int` のオーバーロード (4) は無効化されている。また、追加のオーバーロード (5) は、引数の型が `complex` と算術型でなければ適用されない。(最も規格に準拠した挙動である) - 4.9.0 では第 2 引数が `int` のオーバーロード (5) は無効化されていないが、追加のオーバーロード (5) は、引数の型が `complex` と算術型でなければ適用されない。 なお、いずれのバージョンでも C++03 モードでは追加のオーバーロード (5) は無効化されている。 diff --git a/reference/concepts/equality_comparable.md b/reference/concepts/equality_comparable.md index 668b8078d1..63fc1fde00 100644 --- a/reference/concepts/equality_comparable.md +++ b/reference/concepts/equality_comparable.md @@ -62,7 +62,7 @@ concept equality_comparable_with = - (1) : `T`のオブジェクト`a, b`について次の条件を満たす場合に限って、型`T`は`equality_comparable`のモデルである。 - `bool(a == b)`は`a, b`の値が等値である場合に`true`となり、それ以外の場合は`false`となる -- (2) : `const remove_reference_t, const remove_reference_t`型の左辺値`t, u`及び`C = common_reference_t&, const remove_reference_t&>`について次の条件を満たす場合に限って、型`T, U`は`equality_comparable_with`のモデルである。 +- (2) : `const remove_reference_t, const remove_reference_t`型の左辺値`t, u`及び`C = common_reference_t&, const remove_reference_t&>`について次の条件を満たす場合に限って、型`T, U`は`equality_comparable_with`のモデルである。 - `bool(t == u) == bool(C(t) == C(u))`が`true`であること - `weakly-equality-comparable-with` : `const remove_reference_t, const remove_reference_t`型の左辺値`t, u`について次の条件を満たす場合に限って、型`T, U`は`weakly-equality-comparable-with`のモデルである。 diff --git a/reference/concepts/totally_ordered.md b/reference/concepts/totally_ordered.md index e9f34d82be..fb64dfd411 100644 --- a/reference/concepts/totally_ordered.md +++ b/reference/concepts/totally_ordered.md @@ -36,7 +36,7 @@ namespace std { - `bool(a <= b) == !bool(b < a)`が`true`であること - `bool(a >= b) == !bool(a < b)`が`true`であること -- (2) : `const remove_reference_t, const remove_reference_t`型の左辺値`t, u`及び`C = common_reference_t&, const remove_reference_t&>`について次の条件を満たす場合に限って、型`T, U`は`totally_ordered_with`のモデルである。 +- (2) : `const remove_reference_t, const remove_reference_t`型の左辺値`t, u`及び`C = common_reference_t&, const remove_reference_t&>`について次の条件を満たす場合に限って、型`T, U`は`totally_ordered_with`のモデルである。 - `bool(t < u) == bool(C(t) < C(u))`が`true`であること - `bool(t > u) == bool(C(t) > C(u))`が`true`であること - `bool(t >= u) == bool(C(t) >= C(u))`が`true`であること diff --git a/reference/cstdlib/atof.md b/reference/cstdlib/atof.md index 4a54ad8b05..6adb2eaf8e 100644 --- a/reference/cstdlib/atof.md +++ b/reference/cstdlib/atof.md @@ -18,7 +18,7 @@ namespace std { - 空白文字から始まる場合、最初の非空白文字から変換する。 - `0x` または `0X` の場合、空白でない16進数として処理する。 - `e`または`E`は、それより前を基数、その後ろを指数として処理する。 -- \+ 、\-は変換後の符号に適用される。 +- \+ 、\-は変換後の符号に適用される。 - `INF`または`INFINITY`(大小文字区別せず)は`inf`を返す。 - NAN(大小文字区別せず)はそれ以前の数値を返す。もし以前の数値がないなら、`nan`を返す。 diff --git a/reference/cstdlib/atoi_atol_atoll.md b/reference/cstdlib/atoi_atol_atoll.md index 00e59ca879..c2420dab8f 100644 --- a/reference/cstdlib/atoi_atol_atoll.md +++ b/reference/cstdlib/atoi_atol_atoll.md @@ -21,7 +21,7 @@ namespace std { 空白文字から始まる場合、最初の非空白文字から変換する。 -\+ 、\-は変換後の符号に適用される。 +\+ 、\-は変換後の符号に適用される。 変換不可能ならば0を返す。 diff --git a/reference/flat_map/flat_map/rend.md b/reference/flat_map/flat_map/rend.md index ce633acd2b..f77850a43b 100644 --- a/reference/flat_map/flat_map/rend.md +++ b/reference/flat_map/flat_map/rend.md @@ -63,7 +63,7 @@ int main() ## 関連項目 -| 名前 | 説明 | +| 名前 | 説明 | |------------------------------|--------------------------------------------| | [`flat_map::begin`](begin.md) | 先頭を指すイテレータを取得する | | [`flat_map::end`](end.md) | 末尾の次を指すイテレータを取得する | diff --git a/reference/flat_map/flat_multimap/rend.md b/reference/flat_map/flat_multimap/rend.md index 1d15efc306..d9c3711006 100644 --- a/reference/flat_map/flat_multimap/rend.md +++ b/reference/flat_map/flat_multimap/rend.md @@ -61,7 +61,7 @@ int main() ## 関連項目 -| 名前 | 説明 | +| 名前 | 説明 | |----------------------------------------|--------------------------------------------| | [`flat_multimap::begin`](begin.md) | 先頭を指すイテレータを取得する | | [`flat_multimap::end`](end.md) | 末尾の次を指すイテレータを取得する | diff --git a/reference/flat_set/flat_multiset/rend.md b/reference/flat_set/flat_multiset/rend.md index d558a8e819..9e5d1f7449 100644 --- a/reference/flat_set/flat_multiset/rend.md +++ b/reference/flat_set/flat_multiset/rend.md @@ -56,7 +56,7 @@ int main() ## 関連項目 -| 名前 | 説明 | +| 名前 | 説明 | |-----------------------------------|-----------------------------| | [`flat_multiset::begin`](begin.md) | 先頭を指すイテレータを取得する | | [`flat_multiset::end`](end.md) | 末尾の次を指すイテレータを取得する | diff --git a/reference/flat_set/flat_set/rend.md b/reference/flat_set/flat_set/rend.md index 5980906ec8..6ba74bfb3a 100644 --- a/reference/flat_set/flat_set/rend.md +++ b/reference/flat_set/flat_set/rend.md @@ -55,7 +55,7 @@ int main() ## 関連項目 -| 名前 | 説明 | +| 名前 | 説明 | |-----------------------------------|-----------------------------| | [`flat_set::begin`](begin.md) | 先頭を指すイテレータを取得する | | [`flat_set::end`](end.md) | 末尾の次を指すイテレータを取得する | diff --git a/reference/ios/ios_base/type-event.md b/reference/ios/ios_base/type-event.md index 87cdf46f35..ca56907ac1 100644 --- a/reference/ios/ios_base/type-event.md +++ b/reference/ios/ios_base/type-event.md @@ -9,7 +9,7 @@ enum event { erase_event, imbue_event, copyfmt_event }; ``` ## 概要 -`event` は [`register_callback`](register_callback.md) で登録した [`event_callback`](type-event_callback.md) 型のコールバック関数を呼び出す際に、当該関数を呼び出すきっかけとなったイベントの種類を表すための列挙型である。 +`event` は [`register_callback`](register_callback.md) で登録した [`event_callback`](type-event_callback.md) 型のコールバック関数を呼び出す際に、当該関数を呼び出すきっかけとなったイベントの種類を表すための列挙型である。 `event` には以下の表のような列挙子値が存在する。 | 列挙子 | 発生したイベント | diff --git a/reference/ios/ios_base/type-event_callback.md b/reference/ios/ios_base/type-event_callback.md index 723f9a00bd..36c3148508 100644 --- a/reference/ios/ios_base/type-event_callback.md +++ b/reference/ios/ios_base/type-event_callback.md @@ -11,7 +11,7 @@ using event_callback = void(*)(event ev, ios_base& str, int index); * ios_base[link ../ios_base.md] ## 概要 -`event_callback` は [`register_callback`](register_callback.md) で登録するコールバック関数を表す型である。 +`event_callback` は [`register_callback`](register_callback.md) で登録するコールバック関数を表す型である。 イベントが発生して当該関数が呼ばれる際には、`ev` には発生したイベントの種類([`event`](type-event.md))が、`str` にはイベントが発生したストリームが、`index` には [`register_callback`](register_callback.md) での登録時に指定した値がそれぞれ渡される。 diff --git a/reference/ios/ios_base/type-fmtflags.md b/reference/ios/ios_base/type-fmtflags.md index f367166b45..b2e4f08a06 100644 --- a/reference/ios/ios_base/type-fmtflags.md +++ b/reference/ios/ios_base/type-fmtflags.md @@ -34,7 +34,7 @@ using fmtflags = T1; | `uppercase` | 特定の小文字の出力を大文字の出力にする。(`scientific` の `E` や hex | showbase の `0X` など) | -また、上記に加えて、[`setf`](setf.md)`()` の第 2 引数や [`unsetf`](unsetf.md)`()` の引数に使用するため、 以下のように組み合わせた定数も [`ios_base`](../ios_base.md) の静的メンバ定数として定義されている。 +また、上記に加えて、[`setf`](setf.md)`()` の第 2 引数や [`unsetf`](unsetf.md)`()` の引数に使用するため、 以下のように組み合わせた定数も [`ios_base`](../ios_base.md) の静的メンバ定数として定義されている。 | 定数 | 値 | |------|----------------------| diff --git a/reference/linalg/layout_transpose/mapping.md b/reference/linalg/layout_transpose/mapping.md index 7ee2cb39ce..10e1191f25 100644 --- a/reference/linalg/layout_transpose/mapping.md +++ b/reference/linalg/layout_transpose/mapping.md @@ -49,7 +49,7 @@ namespace std::linalg { | `extents` | 多次元配列のサイズ`extents_`を取得する | C++26 | | `required_span_size` | `nested-mapping_.required_span_size()` | C++26 | | [`operator()`](mapping/op_call.md) | 多次元配列インデクスから要素位置へ変換する | C++26 | -| `nested_mapping` | 入れ子レイアウトマッピング`nested-mapping_`を取得する | C++26 | +| `nested_mapping` | 入れ子レイアウトマッピング`nested-mapping_`を取得する | C++26 | | [`stride`](mapping/stride.md) | 指定次元のストライド幅を取得する | C++26 | | `is_unique` | `nested-mapping_.is_unique()` | C++26 | | `is_exhaustive` | `nested-mapping_.is_exhaustive()` | C++26 | diff --git a/reference/map/map/rend.md b/reference/map/map/rend.md index f18e492169..4c4c53ca7a 100644 --- a/reference/map/map/rend.md +++ b/reference/map/map/rend.md @@ -62,7 +62,7 @@ int main() ## 関連項目 -| 名前 | 説明 | +| 名前 | 説明 | |------------------------------|--------------------------------------------| | [`map::begin`](begin.md) | 先頭を指すイテレータを取得する | | [`map::end`](end.md) | 末尾の次を指すイテレータを取得する | diff --git a/reference/map/multimap/rend.md b/reference/map/multimap/rend.md index a0aa668b66..aa1eb7c50a 100644 --- a/reference/map/multimap/rend.md +++ b/reference/map/multimap/rend.md @@ -63,7 +63,7 @@ int main() ## 関連項目 -| 名前 | 説明 | +| 名前 | 説明 | |-----------------------------------|-------------------------------------------| | [`multimap::begin`](begin.md) | 先頭を指すイテレータを取得する | | [`multimap::end`](end.md) | 末尾の次を指すイテレータを取得する | diff --git a/reference/mdspan/mdspan/op_deduction_guide.md b/reference/mdspan/mdspan/op_deduction_guide.md index 32d8a168fc..9ecf050d6b 100644 --- a/reference/mdspan/mdspan/op_deduction_guide.md +++ b/reference/mdspan/mdspan/op_deduction_guide.md @@ -89,7 +89,7 @@ int main() { int arr[] = {1, 2, 3, 4, 5, 6}; - { // (1) : 1次元配列型から型推論 + { // (1) : 1次元配列型から型推論 std::mdspan m1{arr}; static_assert(m1.rank() == 1 && m1.rank_dynamic() == 0); static_assert(m1.static_extent(0) == 6); diff --git a/reference/mdspan/submdspan.md b/reference/mdspan/submdspan.md index faeaf0c4a2..8182673bae 100644 --- a/reference/mdspan/submdspan.md +++ b/reference/mdspan/submdspan.md @@ -235,7 +235,7 @@ int main() // 3 4 // 5 6 - // 行優先レイアウト std::layout_right を維持 + // 行優先レイアウト std::layout_right を維持 auto row0 = std::submdspan(mat, 0, std::full_extent); // 1 2 auto row12 = std::submdspan(mat, std::pair{1,3}, std::full_extent); diff --git a/reference/queue/queue.md b/reference/queue/queue.md index 246e26c866..19ef4b48c6 100644 --- a/reference/queue/queue.md +++ b/reference/queue/queue.md @@ -59,7 +59,7 @@ namespace std { ## メンバ型 -| 名前 | 説明 | 対応バージョン | +| 名前 | 説明 | 対応バージョン | |-------------------|------------------------------|-------| | `value_type` | `Container::value_type` | | | `reference` | `Container::reference` | C++11 | diff --git a/reference/streambuf/basic_streambuf/showmanyc.md b/reference/streambuf/basic_streambuf/showmanyc.md index 67000accfb..9cfdc7ee1b 100644 --- a/reference/streambuf/basic_streambuf/showmanyc.md +++ b/reference/streambuf/basic_streambuf/showmanyc.md @@ -49,8 +49,8 @@ public: int main() { dummy_buf buf{}; std::cout << buf.in_avail() << std::endl; // 残2文字 - buf.sbumpc(); // 1文字進める - buf.sbumpc(); // 1文字進める + buf.sbumpc(); // 1文字進める + buf.sbumpc(); // 1文字進める std::cout << buf.in_avail() << std::endl; // 残0文字。in_avail()からshowmanyc()が呼ばれる } ``` diff --git a/reference/unordered_map/unordered_multimap/swap.md b/reference/unordered_map/unordered_multimap/swap.md index 25502c9540..e34e8782a6 100644 --- a/reference/unordered_map/unordered_multimap/swap.md +++ b/reference/unordered_map/unordered_multimap/swap.md @@ -36,7 +36,7 @@ void swap(unordered_multimap& x) ## 例外 -コンテナの `key_equal` と `hasher` のオブジェクト(それぞれ [`key_eq`](key_eq.md)`()` と [`hash_function`](hash_function.md)`()` が返すオブジェクト)の [`swap`](/reference/utility/swap.md)`()` が例外を投げなければ、例外を投げない。 +コンテナの `key_equal` と `hasher` のオブジェクト(それぞれ [`key_eq`](key_eq.md)`()` と [`hash_function`](hash_function.md)`()` が返すオブジェクト)の [`swap`](/reference/utility/swap.md)`()` が例外を投げなければ、例外を投げない。 ## 計算量 diff --git a/reference/unordered_set/unordered_multiset/swap.md b/reference/unordered_set/unordered_multiset/swap.md index 7c0d78c931..a3343d264f 100644 --- a/reference/unordered_set/unordered_multiset/swap.md +++ b/reference/unordered_set/unordered_multiset/swap.md @@ -36,7 +36,7 @@ void swap(unordered_multiset& x) ## 例外 -コンテナの `key_equal` と `hasher` のオブジェクト(それぞれ [`key_eq`](key_eq.md)`()` と [`hash_function`](hash_function.md)`()` が返すオブジェクト)の [`swap`](/reference/utility/swap.md)`()` が例外を投げなければ、例外を投げない。 +コンテナの `key_equal` と `hasher` のオブジェクト(それぞれ [`key_eq`](key_eq.md)`()` と [`hash_function`](hash_function.md)`()` が返すオブジェクト)の [`swap`](/reference/utility/swap.md)`()` が例外を投げなければ、例外を投げない。 ## 計算量 diff --git a/reference/unordered_set/unordered_set/swap.md b/reference/unordered_set/unordered_set/swap.md index b1f0a38d3d..8289488590 100644 --- a/reference/unordered_set/unordered_set/swap.md +++ b/reference/unordered_set/unordered_set/swap.md @@ -36,7 +36,7 @@ void swap(unordered_set& x) ## 例外 -コンテナの `key_equal` と `hasher` のオブジェクト(それぞれ [`key_eq`](key_eq.md)`()` と [`hash_function`](hash_function.md)`()` が返すオブジェクト)の [`swap`](/reference/utility/swap.md)`()` が例外を投げなければ、例外を投げない。 +コンテナの `key_equal` と `hasher` のオブジェクト(それぞれ [`key_eq`](key_eq.md)`()` と [`hash_function`](hash_function.md)`()` が返すオブジェクト)の [`swap`](/reference/utility/swap.md)`()` が例外を投げなければ、例外を投げない。 ## 計算量 From 07c5ad841f0e4a14ea94bb101ed53b0da3a43e11 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 1 Sep 2025 17:56:30 +0900 Subject: [PATCH 2351/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=83=9F?= =?UTF-8?q?=E3=82=B9=E3=82=92=E4=BF=AE=E6=AD=A3=20(close=20#1526)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/execution/execution/allocator-aware-forward.md | 2 +- reference/execution/execution/impls-for.md | 2 +- reference/execution/execution/let_value.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/execution/execution/allocator-aware-forward.md b/reference/execution/execution/allocator-aware-forward.md index f446275691..4637c1d7d2 100644 --- a/reference/execution/execution/allocator-aware-forward.md +++ b/reference/execution/execution/allocator-aware-forward.md @@ -39,4 +39,4 @@ decltype(auto) allocator-aware-forward(T&& obj, Context&& context); ## 参照 -- [P3433R1 Allocator Support for Operation States](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3433r1.pdf0) +- [P3433R1 Allocator Support for Operation States](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3433r1.pdf) diff --git a/reference/execution/execution/impls-for.md b/reference/execution/execution/impls-for.md index 13639a9400..72f754f837 100644 --- a/reference/execution/execution/impls-for.md +++ b/reference/execution/execution/impls-for.md @@ -147,5 +147,5 @@ static consteval void default-impls::check-types(); ## 参照 - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) -- [P3433R1 Allocator Support for Operation States](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3433r1.pdf0) +- [P3433R1 Allocator Support for Operation States](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3433r1.pdf) - [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) diff --git a/reference/execution/execution/let_value.md b/reference/execution/execution/let_value.md index 5582e4a114..a21829bfaa 100644 --- a/reference/execution/execution/let_value.md +++ b/reference/execution/execution/let_value.md @@ -440,7 +440,7 @@ catch 0 - [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) - [P3396R1 std::execution wording fixes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3396r1.html) -- [P3433R1 Allocator Support for Operation States](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3433r1.pdf0) +- [P3433R1 Allocator Support for Operation States](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3433r1.pdf) - [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) - [LWG 4203. Constraints on `get-state` functions are incorrect](https://cplusplus.github.io/LWG/issue4203) - [LWG 4204. specification of `as-sndr2(Sig)` in [exec.let] is incomplete](https://cplusplus.github.io/LWG/issue4204) From d589652edd76685c8bf17184540cef3e0b8375f0 Mon Sep 17 00:00:00 2001 From: suomesta Date: Mon, 1 Sep 2025 19:42:00 +0900 Subject: [PATCH 2352/3948] fix typo about std::index_sequence --- reference/utility.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/utility.md b/reference/utility.md index 2c5df14f63..d9b0a2ed96 100644 --- a/reference/utility.md +++ b/reference/utility.md @@ -112,7 +112,7 @@ |------|------|----------------| | [`integer_sequence`](utility/integer_sequence.md) | 任意の整数型のシーケンス(class template) | C++14 | | [`make_integer_sequence`](utility/make_integer_sequence.md) | 要素数を指定して、0から始まる整数シーケンスを生成する(type-alias) | C++14 | -| [`index_sequence`](utility/index_sequence.md) | `size_t`型の整数シーケンス(class template) | C++14 | +| [`index_sequence`](utility/index_sequence.md) | `size_t`型の整数シーケンス(type-alias) | C++14 | | [`make_index_sequence`](utility/make_index_sequence.md) | 要素数を指定して、0から始まる`size_t`型整数シーケンスを生成する(type-alias) | C++14 | | [`index_sequence_for`](utility/index_sequence_for.md) | 型のシーケンスを、0から始まる`size_t`型整数シーケンスに変換する(type-alias) | C++14 | From a510758913f926956ab0c34fa98ee0db461f8678 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 2 Sep 2025 01:37:59 +0900 Subject: [PATCH 2353/3948] execution: P3149R11 scope_token(#1510) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - scope_tokenコンセプト - simple_counting_scopeクラス(概要のみ) - counting_scopeクラス(概要のみ) --- reference/execution/execution.md | 14 +- .../execution/execution/counting_scope.md | 57 +++++ reference/execution/execution/scope_token.md | 77 +++++++ .../execution/simple_counting_scope.md | 201 ++++++++++++++++++ working_style.md | 1 + 5 files changed, 349 insertions(+), 1 deletion(-) create mode 100644 reference/execution/execution/counting_scope.md create mode 100644 reference/execution/execution/scope_token.md create mode 100644 reference/execution/execution/simple_counting_scope.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 8c2b21edb6..dd27c311b3 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -131,6 +131,8 @@ namespace std::execution { | [`execution::into_variant`](execution/into_variant.md) | 複数の値完了シグネチャを単一[`variant`](/reference/variant/variant.md)型の値完了シグネチャに変換 (customization point object) | C++26 | | [`execution::stopped_as_optional`](execution/stopped_as_optional.md) | 入力Senderの停止完了を空の[`optional`](/reference/optional/optional.md)値完了に変換 (customization point object) | C++26 | | [`execution::stopped_as_error`](execution/stopped_as_error.md) | 入力Senderの停止完了をエラー完了に変換 (customization point object) | C++26 | +| [`execution::associate`](execution/associate.md.nolink) | 非同期スコープへの関連付け (customization point object) | C++26 | +| [`execution::spawn_future`](execution/spawn_future.md.nolink) | 非同期操作を早期開始 (customization point object) | C++26 | ### Senderコンシューマ @@ -138,8 +140,9 @@ namespace std::execution { |------|------|----------------| | [`this_thread::sync_wait`](this_thread/sync_wait.md) | 現在のスレッド上でSender完了を待機 (customization point object) | C++26 | | [`this_thread::sync_wait_with_variant`](this_thread/sync_wait_with_variant.md) | 現在のスレッド上でSender完了を待機 (customization point object) | C++26 | +| [`execution::spawn`](execution/spawn.md.nolink) | 非同期操作を早期開始 (customization point object) | C++26 | -Senderコンシューマは名前空間 `std::this_thread` で定義される。 +Senderコンシューマは名前空間 `std::this_thread` および名前空間 `std::execution` で定義される。 ### Sender/Receiverユーティリティ @@ -158,6 +161,14 @@ Senderコンシューマは名前空間 `std::this_thread` で定義される。 | [`execution::as_awaitable`](execution/as_awaitable.md) | Senderを[Awaitable型](/lang/cpp20/coroutines.md)へ変換 (customization point object) | C++26 | | [`execution::with_awaitable_senders`](execution/with_awaitable_senders.md) | [Promise型](/lang/cpp20/coroutines.md)の基底クラス (class template) | C++26 | +### 実行スコープユーティリティ + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`execution::scope_token`](execution/scope_token.md) | 非同期スコープトークン (concept) | C++26 | +| [`execution::simple_counting_scope`](execution/simple_counting_scope.md) | カウント式非同期スコープ (class) | C++26 | +| [`execution::counting_scope`](execution/counting_scope.md) | 停止要求可能なカウント式非同期スコープ (class) | C++26 | + ### 並列Scheduler | 名前 | 説明 | 対応バージョン | @@ -176,6 +187,7 @@ Senderコンシューマは名前空間 `std::this_thread` で定義される。 - [P0024R2 The Parallelism TS Should be Standardized](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0024r2.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) - [P2079R10 Parallel scheduler](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2079r10.html) +- [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) - [P3284R4 `write_env` and `unstoppable` Sender Adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3284r4.html) - [P3481R5 `std::execution::bulk()` issues](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3481r5.html) - [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) diff --git a/reference/execution/execution/counting_scope.md b/reference/execution/execution/counting_scope.md new file mode 100644 index 0000000000..4819fa15bb --- /dev/null +++ b/reference/execution/execution/counting_scope.md @@ -0,0 +1,57 @@ +# counting_scope +* execution[meta header] +* class[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + class counting_scope; +} +``` + +## 概要 +`counting_scope`は、停止要求を作成可能なカウント式の非同期スコープを表現する。 + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`(constructor)`](counting_scope/op_constructor.md.nolink) | コンストラクタ | C++26 | +| [`(destructor)`](counting_scope/op_destructor.md.nolink) | デストラクタ | C++26 | +| [`get_token`](counting_scope/get_token.md.nolink) | 非同期スコープトークンを取得 | C++26 | +| [`close`](counting_scope/close.md.nolink) | 非同期スコープを閉じる | C++26 | +| [`join`](counting_scope/join.md.nolink) | 非同期スコープを合流する[Sender](sender.md)取得 | C++26 | +| [`request_stop`](counting_scope/request_stop.md.nolink) | 停止要求を行う | C++26 | + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`token`](counting_scope/token.md.nolink) | 非同期スコープトークン型 | C++26 | + +## 静的メンバ変数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `constexpr size_t max_associations = implementation-defined;` | 関連付けの最大数 | C++26 | + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::simple_counting_scope`](simple_counting_scope.md) + + +## 参照 +- [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) diff --git a/reference/execution/execution/scope_token.md b/reference/execution/execution/scope_token.md new file mode 100644 index 0000000000..f44f23393e --- /dev/null +++ b/reference/execution/execution/scope_token.md @@ -0,0 +1,77 @@ +# scope_token +* execution[meta header] +* concept[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template + concept scope_token = + copyable && + requires(const Token token) { + { token.try_associate() } -> same_as; + { token.disassociate() } noexcept -> same_as; + { token.wrap(declval()) } -> sender_in; + }; +} +``` +* copyable[link /reference/concepts/copyable.md] +* sender_in[link sender_in.md] +* test-sender[italic] +* test-env[italic] + +## 概要 +`scope_token`コンセプトは、[Sender](sender.md)と非同期スコープ間の関連付けを作成するために利用できる型`Token`に対する要件を定義する。 + +`test-sender`と`test-env`は、[`sender_in`](sender_in.md)``のモデルである未規定の型とする。 + + +## モデル +型`Token`は、次のとき`scope_token`のモデルとなる。 + +- `Token`型オブジェクトのコピー構築、ムーブ構築、コピー代入、ムーブ代入から例外送出しない、かつ +- (const修飾の可能性のある)型`Token`の左辺値`token`が与えられたとき、型`decltype((sndr))`が[`sender`](sender.md)のモデルである全ての式`sndr`に対して、 + - `token.warp(sndr)`が有効な式、かつ + - `decltype(token.warp(sndr))`は[`sender`](sender.md)のモデルであり、かつ + - [`sender_in`](sender_in.md)``のモデルである全ての`E`型に対して、[`completion_signatures_of_t`](completion_signatures_of_t.md)``は[`completion_signatures_of_t`](completion_signatures_of_t.md)``と同一の完了シグネチャを含むこと。 + + +## 例 +```cpp example +#include +namespace ex = std::execution; + +int main() +{ + ex::counting_scope scope; + ex::scope_token auto token = scope.get_token(); +} +``` +* ex::scope_token[color ff0000] +* ex::counting_scope[link counting_scope.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::associate`](associate.md.nolink) +- [`execution::spawn_future`](spawn_future.md.nolink) +- [`execution::spawn`](spawn.md.nolink) + + +## 参照 +- [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) diff --git a/reference/execution/execution/simple_counting_scope.md b/reference/execution/execution/simple_counting_scope.md new file mode 100644 index 0000000000..6ca315a015 --- /dev/null +++ b/reference/execution/execution/simple_counting_scope.md @@ -0,0 +1,201 @@ +# simple_counting_scope +* execution[meta header] +* class[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + class simple_counting_scope; +} +``` + +## 概要 +`simple_counting_scope`は、カウント式の非同期スコープを表現する。 + + +## クラス仕様 +`simple_counting_scope`型と[`counting_scope`](counting_scope.md)型による非同期スコープは関連付けカウントを管理する。 + +クラス動作説明用のメンバ変数として下記を保持する。 + +- `count` : `size_t`型の関連付けカウント値 +- `state` : `scope-state-type`列挙型(後述)の状態 + + +### 状態遷移 +説明専用の各種エンティティを下記の通り定義する。 + +- `Scope`型 : `simple_counting_scope`または`counting_scope`のいずれか +- `scope`オブジェクト : `Scope`型のオブジェクト +- `tkn`オブジェクト : `scope.get_token()`が返す`Scope::token`型のオブジェクト +- `jsndr` : `scope.join()`が返す[Sender](sender.md) +- `op` : `jsndr`を[Receiver](receiver.md)と接続して得られる[Operation State](operation_state.md) + +```cpp +enum scope-state-type { // exposition only + unused, // exposition only + open, // exposition only + closed, // exposition only + open-and-joining, // exposition only + closed-and-joining, // exposition only + unused-and-closed, // exposition only + joined, // exposition only +}; +``` + +`scope`はその生存期間中にさまざまな状態をとり、各状態で許可される操作とその結果を決定する: + +- `unused` : 新しく構築されたオブジェクトは`unused`状態で開始する。 +- `open` : `scope`が`unused`状態にあるとき`tkn.try_associate()`が呼び出されると、`scope`は`open`状態に遷移する。 +- `open-and-joining` : `scope`が`unused`または`open`状態にあるとき[Operation State](operation_state.md)`op`が[開始(start)](start.md)されると、`scope`は`open-and-joining`状態に遷移する。 +- `closed` : `scope`が`open`状態にあるとき`scope.close()`が呼び出されると、`scope`は`closed`状態に遷移する。 +- `unused-and-closed` : `scope`が`unused`状態にあるとき`scope.close()`が呼び出されると、`scope`は`unused-and-closed`状態に遷移する。 +- `closed-and-joining` : `scope`が`open-and-joining`状態にあるとき`scope.close()`が呼び出される、もしくは`scope`が`closed`または`unused-and-closed`状態にあるとき[Operation State](operation_state.md)`op`が[開始(start)](start.md)されると、`scope`は`closed-and-joining`状態に遷移する。 +- `joined` : `scope`が`open-and-joining`または`closed-and-joining`状態にあるとき関連付けカウントがゼロに到達すると、`scope`は`joined`状態に遷移する。 + + +### Senderアルゴリズムタグ `scope-join-t` +説明専用の[Senderアルゴリズムタグ型](tag_of_t.md)`scope-join-t`を定義する。 + +```cpp +struct scope-join-t {}; // exposition only +``` + +Senderアルゴリズム動作説明用のクラステンプレート[`impls-for`](impls-for.md)に対して、下記の特殊化が定義される。 + +```cpp +namespace std::execution { + template<> + struct impls-for : default-impls { + template + struct state { // exposition only + struct rcvr-t { // exposition only + using receiver_concept = receiver_t; + + Rcvr& rcvr; // exposition only + + void set_value() && noexcept { + execution::set_value(std::move(rcvr)); + } + + template + void set_error(E&& e) && noexcept { + execution::set_error(std::move(rcvr), std::forward(e)); + } + + void set_stopped() && noexcept { + execution::set_stopped(std::move(rcvr)); + } + + decltype(auto) get_env() const noexcept { + return execution::get_env(rcvr); + } + }; + + using sched-sender = // exposition only + decltype(schedule(get_scheduler(get_env(declval())))); + using op-t = // exposition only + connect_result_t; + + Scope* scope; // exposition only + Rcvr& receiver; // exposition only + op-t op; // exposition only + + state(Scope* scope, Rcvr& rcvr) // exposition only + noexcept(nothrow-callable) + : scope(scope), + receiver(rcvr), + op(connect(schedule(get_scheduler(get_env(rcvr))), rcvr-t(rcvr))) {} + + void complete() noexcept { // exposition only + start(op); + } + + void complete-inline() noexcept { // exposition only + set_value(std::move(receiver)); + } + }; + + static constexpr auto get-state = // exposition only + [](auto&& sender, Rcvr& receiver) + noexcept(is_nothrow_constructible_v, data-type, Rcvr&>) { + auto[_, self] = sender; + return state(self, receiver); + }; + + static constexpr auto start = // exposition only + [](auto& s, auto&) noexcept { + if (s.scope->start-join-sender(s)) + s.complete-inline(); + }; + }; +} +``` +* impls-for[link impls-for.md] +* default-impls[link impls-for.md] +* receiver_t[link receiver.md] +* execution::set_value[link set_value.md] +* execution::set_error[link set_error.md] +* execution::set_stopped[link set_stopped.md] +* execution::get_env[link get_env.md] +* schedule[link schedule.md] +* get_scheduler[link get_scheduler.md] +* connect_result_t[link connect_result_t.md] +* connect_t[link connect.md] +* connect[link connect.md] +* start[link start.md] +* data-type[link data-type.md] +* nothrow-callable[link /reference/functional/nothrow-callable.md] +* is_nothrow_constructible_v[link /reference/type_traits/is_nothrow_constructible.md] +* std::move[link /reference/utility/move.md] + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`(constructor)`](simple_counting_scope/op_constructor.md.nolink) | コンストラクタ | C++26 | +| [`(destructor)`](simple_counting_scope/op_destructor.md.nolink) | デストラクタ | C++26 | +| [`get_token`](simple_counting_scope/get_token.md.nolink) | 非同期スコープトークンを取得 | C++26 | +| [`close`](simple_counting_scope/close.md.nolink) | 非同期スコープを閉じる | C++26 | +| [`join`](simple_counting_scope/join.md.nolink) | 非同期スコープを合流する[Sender](sender.md)取得 | C++26 | + +### 説明専用メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`try-associate`](simple_counting_scope/try-associate.md.nolink) | 関連付けを試行 | C++26 | +| [`disassociate`](simple_counting_scope/disassociate.md.nolink) | 関連付けを解除| C++26 | +| [`start-join-sender`](simple_counting_scope/start-join-sender.md.nolink) | 合流[Sender](sender.md)を開始 | C++26 | + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`token`](simple_counting_scope/token.md.nolink) | 非同期スコープトークン型 | C++26 | + +## 静的メンバ変数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `constexpr size_t max_associations = implementation-defined;` | 関連付けの最大数 | C++26 | + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::counting_scope`](counting_scope.md) + + +## 参照 +- [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) diff --git a/working_style.md b/working_style.md index 86ed8088d6..b0209396ba 100644 --- a/working_style.md +++ b/working_style.md @@ -68,6 +68,7 @@ C++11以降対応については対応バージョンを明記します。バー | arithmetic type | 算術型 | | associative container(s) | 連想コンテナ | | asynchronous operation | 非同期操作 | +| async scope | 非同期スコープ | | base class | 基底クラス | | bidirectional iterator | 双方向イテレータ | | bucket | バケット | From 171949a4d82b8d9b0f311d087b0bdf9dce336583 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 2 Sep 2025 12:04:06 +0900 Subject: [PATCH 2354/3948] =?UTF-8?q?execution/get-domain-{early,late}:=20?= =?UTF-8?q?=E9=96=A2=E9=80=A3=E9=A0=85=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/execution/execution/get-domain-early.md | 10 ++++++++++ reference/execution/execution/get-domain-late.md | 1 + 2 files changed, 11 insertions(+) diff --git a/reference/execution/execution/get-domain-early.md b/reference/execution/execution/get-domain-early.md index 8ca93cb864..57875cca84 100644 --- a/reference/execution/execution/get-domain-early.md +++ b/reference/execution/execution/get-domain-early.md @@ -37,6 +37,16 @@ constexpr auto get-domain-early(const Sndr& sndr) noexcept; ## 関連項目 +- [`execution::continues_on`](continues_on.md) +- [`execution::then`](then.md) +- [`execution::let_value`](let_value.md) +- [`execution::bulk`](bulk.md) +- [`execution::when_all`](when_all.md) +- [`execution::into_variant`](into_variant.md) +- [`execution::stopped_as_optional`](stopped_as_optional.md) +- [`execution::stopped_as_error`](stopped_as_error.md) +- [`execution::associate`](associate.md.nolink) +- [`execution::affine_on`](affine_on.md.nolink) - [`this_thread::sync_wait`](../this_thread/sync_wait.md) - [`this_thread::sync_wait_with_variant`](../this_thread/sync_wait_with_variant.md) diff --git a/reference/execution/execution/get-domain-late.md b/reference/execution/execution/get-domain-late.md index 877a17341b..20eb3fe6b5 100644 --- a/reference/execution/execution/get-domain-late.md +++ b/reference/execution/execution/get-domain-late.md @@ -61,6 +61,7 @@ Senderアダプタ[`continues_on`](continues_on.md)は[`schedule_from`](schedule ## 関連項目 - [`execution::connect`](connect.md) - [`execution::continues_on`](continues_on.md) +- [`execution::get_completion_signatures`](get_completion_signatures.md) ## 参照 From 957695995f2ea44d12c1bb54439a4a4982fcc22f Mon Sep 17 00:00:00 2001 From: ACUVE <601805+ACUVE@users.noreply.github.com> Date: Wed, 3 Sep 2025 23:44:58 +0900 Subject: [PATCH 2355/3948] =?UTF-8?q?P2865R6:=20=E3=82=B3=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=88=E3=81=AE=E8=A7=A3=E8=AA=AC=E3=81=AE=E8=AA=A4?= =?UTF-8?q?=E6=A4=8D=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26/remove_deprecated_array_comparisons.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp26/remove_deprecated_array_comparisons.md b/lang/cpp26/remove_deprecated_array_comparisons.md index 83fff0fd04..308150ca1d 100644 --- a/lang/cpp26/remove_deprecated_array_comparisons.md +++ b/lang/cpp26/remove_deprecated_array_comparisons.md @@ -18,7 +18,7 @@ C++20での[三方比較演算子](/lang/cpp20/consistent_comparison.md)の導 int arr1[5]; int arr2[5]; bool same = arr1 == arr2; // C++20: 非推奨、C++26: エラー。 - // &arr[0] == &arr[1]と同じ。 + // &arr1[0] == &arr2[0]と同じ。 // 配列の要素は比較されない auto cmp = arr1 <=> arr2; // エラー! ``` From 1db2ef444f24ef0c04765f530fe956756994a8bb Mon Sep 17 00:00:00 2001 From: ACUVE <601805+ACUVE@users.noreply.github.com> Date: Thu, 4 Sep 2025 00:04:45 +0900 Subject: [PATCH 2356/3948] =?UTF-8?q?P1120R0:=20=E3=82=B3=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=88=E3=81=AE=E8=A7=A3=E8=AA=AC=E3=81=AE=E8=AA=A4?= =?UTF-8?q?=E6=A4=8D=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp20/deprecate_array_comparisons.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp20/deprecate_array_comparisons.md b/lang/cpp20/deprecate_array_comparisons.md index 72be0f3590..cb0515bc5d 100644 --- a/lang/cpp20/deprecate_array_comparisons.md +++ b/lang/cpp20/deprecate_array_comparisons.md @@ -17,7 +17,7 @@ ```cpp int arr1[5]; int arr2[5]; -bool same = arr1 == arr2; // C++20で非推奨。&arr[0] == &arr[1]と同じ。 +bool same = arr1 == arr2; // C++20で非推奨。&arr1[0] == &arr2[0]と同じ。 // 配列の要素は比較されない auto cmp = arr1 <=> arr2; // エラー! ``` From 471007848c5bc30943898cdb6ee5136b5fc2cda0 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 5 Sep 2025 21:29:52 +0900 Subject: [PATCH 2357/3948] Added \n for fwrite.md --- reference/cstdio/fwrite.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdio/fwrite.md b/reference/cstdio/fwrite.md index b07ad0c4ba..c21f708aab 100644 --- a/reference/cstdio/fwrite.md +++ b/reference/cstdio/fwrite.md @@ -42,7 +42,7 @@ int main() { return 1; } - const char data[] = "Hello, World!"; + const char data[] = "Hello, World!\n"; /* 厳密には、sizeof(char)は1バイトであることが保証されているため、 sizeof(data) - 1は、文字列の長さ(ヌル終端文字を除く)と等しくなる。 From 2e2e084e92532875c8d35931ce7b3dd7b1a5e199 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sat, 6 Sep 2025 22:24:12 +0900 Subject: [PATCH 2358/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BE=8B?= =?UTF-8?q?=E3=81=AE=20include=20=E3=81=AE=E4=B8=8D=E8=B6=B3=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ..._dynamic_cast_polymorphic_typeid_in_constant_expressions.md | 3 +++ lang/cpp26/erroneous_behavior_for_uninitialized_reads.md | 1 + 2 files changed, 4 insertions(+) diff --git a/lang/cpp20/allowing_dynamic_cast_polymorphic_typeid_in_constant_expressions.md b/lang/cpp20/allowing_dynamic_cast_polymorphic_typeid_in_constant_expressions.md index 309c3d4fd7..ab04fc2aa8 100644 --- a/lang/cpp20/allowing_dynamic_cast_polymorphic_typeid_in_constant_expressions.md +++ b/lang/cpp20/allowing_dynamic_cast_polymorphic_typeid_in_constant_expressions.md @@ -17,6 +17,9 @@ C++20より、`constexpr`関数内(定数式)で`dynamic_cast`および多 ## 例 ```cpp example +#include +#include + struct base { virtual int f() const = 0; }; diff --git a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md index d3f5519aa9..777703aa8e 100644 --- a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md +++ b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md @@ -53,6 +53,7 @@ int main() { ```cpp example #include +#include int g(bool b) { unsigned char c; From 0f3c342985fb6f9148f27f354661ae661bb29eb1 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sun, 7 Sep 2025 14:40:09 +0900 Subject: [PATCH 2359/3948] =?UTF-8?q?=E5=AF=BE=E5=BF=9C=E3=81=97=E3=81=AA?= =?UTF-8?q?=E3=81=84=E8=A7=92=E3=82=AB=E3=83=83=E3=82=B3=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/memory/allocator/allocate_at_least.md | 2 +- reference/memory/allocator_traits/allocate_at_least.md | 2 +- start_editing/contribution_stats_2023.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/memory/allocator/allocate_at_least.md b/reference/memory/allocator/allocate_at_least.md index 750ed9c3d4..a110e03241 100644 --- a/reference/memory/allocator/allocate_at_least.md +++ b/reference/memory/allocator/allocate_at_least.md @@ -7,7 +7,7 @@ ```cpp namespace std { - [[nodiscard] constexpr allocation_result + [[nodiscard]] constexpr allocation_result allocate_at_least(size_t n); // (1) C++23 } ``` diff --git a/reference/memory/allocator_traits/allocate_at_least.md b/reference/memory/allocator_traits/allocate_at_least.md index e27ee0a456..64ca67a18e 100644 --- a/reference/memory/allocator_traits/allocate_at_least.md +++ b/reference/memory/allocator_traits/allocate_at_least.md @@ -6,7 +6,7 @@ * cpp23[meta cpp] ```cpp -[[nodiscard] +[[nodiscard]] static constexpr allocation_result allocate_at_least(Alloc& a, size_type n); // (1) C++23 diff --git a/start_editing/contribution_stats_2023.md b/start_editing/contribution_stats_2023.md index 5bbdff1fad..572bd3e5f5 100644 --- a/start_editing/contribution_stats_2023.md +++ b/start_editing/contribution_stats_2023.md @@ -389,7 +389,7 @@ | コミット | タグ | 説明 | |----------|------|------| -| [40638a6 | cpprefjp/typo:1 | fix typo in constexpr_lambda.md | +| [commit cpprefjp/site, 40638a6] | cpprefjp/typo:1 | fix typo in constexpr_lambda.md | ## [h-sao](https://github.com/h-sao) From a9216ac655dc2e79f922739b2d8214fe1c951dec Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sun, 7 Sep 2025 14:59:23 +0900 Subject: [PATCH 2360/3948] =?UTF-8?q?=E5=AF=BE=E5=BF=9C=E3=81=97=E3=81=AA?= =?UTF-8?q?=E3=81=84=E6=B3=A2=E3=82=AB=E3=83=83=E3=82=B3=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_replace_copy.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/algorithm/ranges_replace_copy.md b/reference/algorithm/ranges_replace_copy.md index a9ccb04432..6fe9ba293d 100644 --- a/reference/algorithm/ranges_replace_copy.md +++ b/reference/algorithm/ranges_replace_copy.md @@ -102,7 +102,7 @@ namespace std::ranges { ## 戻り値 -`{ .in = last, .out = result + (last - first)` +`{ .in = last, .out = result + (last - first) }` ## 計算量 From 0180bdc24e02883adf9e52d6e95b40db566f3fbb Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 10 Sep 2025 14:09:23 +0900 Subject: [PATCH 2361/3948] =?UTF-8?q?function=20:=20=E9=96=A2=E6=95=B0?= =?UTF-8?q?=E5=9E=8B=E3=81=AB=E3=83=91=E3=83=A9=E3=83=A1=E3=83=BC=E3=82=BF?= =?UTF-8?q?=E5=90=8D=E3=82=92=E6=8C=87=E5=AE=9A=E3=81=99=E3=82=8B=E3=81=93?= =?UTF-8?q?=E3=81=A8=E3=82=82=E3=81=A7=E3=81=8D=E3=82=8B=E3=81=93=E3=81=A8?= =?UTF-8?q?=E3=82=92=E5=82=99=E8=80=83=E3=81=A8=E3=81=97=E3=81=A6=E8=A8=98?= =?UTF-8?q?=E8=BC=89=20#1529?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/functional/function.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reference/functional/function.md b/reference/functional/function.md index 3ece42c406..d52a16cbd1 100644 --- a/reference/functional/function.md +++ b/reference/functional/function.md @@ -32,6 +32,10 @@ int result = f(1); // result == 2 `function`クラスは具体的な関数・関数オブジェクトの型には依存しない。シグニチャが一致していればあらゆる型の関数、関数オブジェクトを代入できる。 +## 備考 +- `function`のように、パラメータに名前を付けることもできるが、名前は単に無視される + + ## メンバ関数 From 76555be2403ff70e2daa8f28f7fa6cc5338c9a47 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 12 Sep 2025 10:46:45 +0900 Subject: [PATCH 2362/3948] =?UTF-8?q?cpp26/structured=5Fbindings=5Fcan=5Fi?= =?UTF-8?q?ntroduce=5Fa=5Fpack:=20=E3=83=86=E3=83=B3=E3=83=97=E3=83=AC?= =?UTF-8?q?=E3=83=BC=E3=83=88=E5=86=85=E3=81=A7=E3=81=AE=E3=81=BF=E6=9C=89?= =?UTF-8?q?=E5=8A=B9=20(#1376)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...tructured_bindings_can_introduce_a_pack.md | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/lang/cpp26/structured_bindings_can_introduce_a_pack.md b/lang/cpp26/structured_bindings_can_introduce_a_pack.md index 0eef804d9e..70def2ae18 100644 --- a/lang/cpp26/structured_bindings_can_introduce_a_pack.md +++ b/lang/cpp26/structured_bindings_can_introduce_a_pack.md @@ -10,17 +10,27 @@ ## 概要 -C++26では、構造化束縛でタプルを分解する際に、パックで受け取れるようになる。 +C++26では、構造化束縛でタプルを分解する際に、パックで受け取れるようになる。この記法はテンプレート内でのみ利用できる。 ```cpp std::tuple f(); -auto [x, y, z] = f(); // C++23: OK, C++26: OK -auto [...xs] = f(); // C++26: OK. パックxsは長さ3でX, Y, Zが含まれる -auto [x, ...rest] = f(); // C++26: OK. xはX、パックrestは長さ2でYとZが含まれる -auto [x, y, z, ...rest] = f(); // C++26: OK. restは空のパック -auto [x, ...rest, z] = f(); // C++26: OK. xはX、パックrestは長さ1でYに対応、zはZ -auto [...a, ...b] = f(); // NG: 複数のパックは指定できない +template +void g() +{ + auto [x, y, z] = f(); // C++23: OK, C++26: OK + auto [...xs] = f(); // C++26: OK. パックxsは長さ3でX, Y, Zが含まれる + auto [x, ...rest] = f(); // C++26: OK. xはX、パックrestは長さ2でYとZが含まれる + auto [x, y, z, ...rest] = f(); // C++26: OK. restは空のパック + auto [x, ...rest, z] = f(); // C++26: OK. xはX、パックrestは長さ1でYに対応、zはZ + auto [...a, ...b] = f(); // NG: 複数のパックは指定できない +} + +void h() +{ + auto [x, y, z] = f(); // C++23: OK, C++26: OK + auto [...xs] = f(); // NG: テンプレートの外では不適格となる +} ``` ### std::apply()の実装改善 From 59a1086764cbee5a1705a5fb9399421e20158405 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Thu, 18 Sep 2025 16:22:34 +0900 Subject: [PATCH 2363/3948] =?UTF-8?q?typename=20=E3=81=AE=E3=81=A4?= =?UTF-8?q?=E3=81=91=E5=BF=98=E3=82=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit T::value_type でエラーになるというコード例ですが、 T::type でもエラーになってしまっていたので、修正しました。 --- lang/cpp17/if_constexpr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp17/if_constexpr.md b/lang/cpp17/if_constexpr.md index 00be421c80..03655c56ea 100644 --- a/lang/cpp17/if_constexpr.md +++ b/lang/cpp17/if_constexpr.md @@ -161,7 +161,7 @@ struct Hoge { template void f() { - if constexpr (std::is_same_v || std::is_same_v) { + if constexpr (std::is_same_v || std::is_same_v) { std::cout << "is int" << std::endl; } } From 7accb42cd237ce6a9bf0b12ad9f64271d84979fc Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 18 Sep 2025 17:32:28 +0900 Subject: [PATCH 2364/3948] =?UTF-8?q?cmath:=20C++26=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=E3=81=A8=E3=81=97=E3=81=A6=E3=80=81f(max|min)imum[=5Fnum]?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20#1514?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 13 +++-- reference/cmath.md | 10 ++-- reference/cmath/fmax.md | 14 ++++- reference/cmath/fmaximum.md | 90 ++++++++++++++++++++++++++++++++ reference/cmath/fmaximum_num.md | 92 +++++++++++++++++++++++++++++++++ reference/cmath/fminimum.md | 90 ++++++++++++++++++++++++++++++++ reference/cmath/fminimum_num.md | 92 +++++++++++++++++++++++++++++++++ 7 files changed, 393 insertions(+), 8 deletions(-) create mode 100644 reference/cmath/fmaximum.md create mode 100644 reference/cmath/fmaximum_num.md create mode 100644 reference/cmath/fminimum.md create mode 100644 reference/cmath/fminimum_num.md diff --git a/lang/cpp26.md b/lang/cpp26.md index d0922fb4de..7fb2edb422 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -362,12 +362,21 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 ### 数値 +- [``](/reference/cmath.md)に、浮動小数点数の最大値・最小値を求める以下の関数を追加 + - [`std::fmaximum()`](/reference/cmath/fmaximum.md) (-0.0と+0.0では+0.0を返し、NaNと数値ではNaNを返す) + - [`std::fmaximum_num()`](/reference/cmath/fmaximum_num.md) (-0.0と+0.0では+0.0を返し、NaNと数値では数値を返す) + - [`std::fminimum()`](/reference/cmath/fminimum.md) (-0.0と+0.0では-0.0を返し、NaNと数値ではNaNを返す) + - [`std::fminimum_num()`](/reference/cmath/fminimum_num.md) (-0.0と-0.0では+0.0を返し、NaNと数値では数値を返す) - [``](/reference/numeric.md)に、飽和演算 (Saturation Arithmetic) として、型の表現可能な範囲で演算を行う以下の関数を追加 - [`std::add_sat()`](/reference/numeric/add_sat.md) - [`std::sub_sat()`](/reference/numeric/sub_sat.md) - [`std::mul_sat()`](/reference/numeric/mul_sat.md) - [`std::div_sat()`](/reference/numeric/div_sat.md) - [`std::saturate_cast()`](/reference/numeric/saturate_cast.md) +- [`std::complex`](/reference/complex/complex.md)を構造化束縛や、将来のパターンマッチで使用できるようタプルインタフェースの特殊化を追加 +- [``](/reference/random.md)の範囲`[0, 1)`の乱数を生成する[`std::generate_canonical()`](/reference/random/generate_canonical.md)を、望ましい統計的性質を保証するようアルゴリズムと制約を変更 +- [``](/reference/random.md)に、乱数列を生成する[`std::ranges::generate_random()`](/reference/random/generate_random.md)関数を追加 +- [``](/reference/random.md)に、乱数生成器は並列シミュレーションに効果的なカウンターベースのPhilox乱数生成器として、[`std::philox_engine`](/reference/random/philox_engine.md)クラス、およびその別名である[`std::philox4x32`](/reference/random/philox4x32.md)と[`std::philox4x64`](/reference/random/philox4x64.md)を追加 - [``](/reference/cmath.md)の以下の関数を、`constexpr`に対応 (特殊関数と、グローバルの丸めモードに依存する丸め関数以外の全て) - [`std::cos()`](/reference/cmath/cos.md) - [`std::sin()`](/reference/cmath/sin.md) @@ -423,10 +432,6 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [`std::conj()`](/reference/complex/complex/conj.md) (算術型オーバーロード) - [`std::imag()`](/reference/complex/complex/imag_free.md) (算術型オーバーロード) - [`std::real()`](/reference/complex/complex/real_free.md) (算術型オーバーロード) -- [`std::complex`](/reference/complex/complex.md)を構造化束縛や、将来のパターンマッチで使用できるようタプルインタフェースの特殊化を追加 -- [``](/reference/random.md)の範囲`[0, 1)`の乱数を生成する[`std::generate_canonical()`](/reference/random/generate_canonical.md)を、望ましい統計的性質を保証するようアルゴリズムと制約を変更 -- [``](/reference/random.md)に、乱数列を生成する[`std::ranges::generate_random()`](/reference/random/generate_random.md)関数を追加 -- [``](/reference/random.md)に、乱数生成器は並列シミュレーションに効果的なカウンターベースのPhilox乱数生成器として、[`std::philox_engine`](/reference/random/philox_engine.md)クラス、およびその別名である[`std::philox4x32`](/reference/random/philox4x32.md)と[`std::philox4x64`](/reference/random/philox4x64.md)を追加 ### ユーティリティ diff --git a/reference/cmath.md b/reference/cmath.md index 7088115a94..e2402db78b 100644 --- a/reference/cmath.md +++ b/reference/cmath.md @@ -367,9 +367,13 @@ NaN を返さなければならないが定義域エラーを報告してはな | 名前 | 説明 | 対応バージョン | |-------------------------|--------|----------------| -| [`fmax`](cmath/fmax.md) | 最大値 | C++11 | -| [`fmin`](cmath/fmin.md) | 最小値 | C++11 | -| [`fdim`](cmath/fdim.md) | 正の差 | C++11 | +| [`fmax`](cmath/fmax.md) | 最大値 (`-0.0`と`+0.0`では未規定、NaNと値では値を返す) | C++11 | +| [`fmin`](cmath/fmin.md) | 最小値 (`-0.0`と`+0.0`では未規定、NaNと値では値を返す) | C++11 | +| [`fmaximum`](cmath/fmaximum.md) | 最大値 (`-0.0`と`+0.0`では`+0.0`、NaNと値ではNaNを返す) | C++26 | +| [`fmaximum_num`](cmath/fmaximum_num.md) | 最大値 (`-0.0`と`+0.0`では`+0.0`、NaNと値では値を返す) | C++26 | +| [`fminimum`](cmath/fminimum.md) | 最小値 (`-0.0`と`+0.0`では`-0.0`、NaNと値ではNaNを返す) | C++26 | +| [`fminimum_num`](cmath/fminimum_num.md) | 最小値 (`-0.0`と`+0.0`では`-0.0`、NaNと値では値を返す) | C++26 | +| [`fdim`](cmath/fdim.md) | 正の差 | C++11 | ##
乗算-加算 diff --git a/reference/cmath/fmax.md b/reference/cmath/fmax.md index efb7214c54..0998d81d12 100644 --- a/reference/cmath/fmax.md +++ b/reference/cmath/fmax.md @@ -48,6 +48,13 @@ namespace std { - (6) : `float`型規定 - (7) : `long double`型規定 +同じ目的のほかの関数との比較は以下。 + +| 関数名 | -0.0 と +0.0 の比較 | NaN を含む場合の挙動 | +|---|---|---| +| [`fmax`](fmax.md) | 未規定 | NaN でない方を返す | +| [`fmaximum`](fmaximum.md) | +0.0 を返す | NaN を返す | +| [`fmaximum_num`](fmaximum_num.md) | +0.0 を返す | NaN でない方を返す | ## 戻り値 引数の最大値を返す。 @@ -57,7 +64,7 @@ namespace std { - 処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 - 引数の1つが NaN の場合 NaN でない方を返す。 - 引数が2つとも NaN の場合 NaN を返す。 -- 理想的には `fmax(-0.0, +0.0)` は `+0` を返す。 +- `-0.0`と`+0.0`の比較としてどちらが返されるかは未規定 - C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された @@ -135,6 +142,11 @@ namespace std { * std::common_type[link ../type_traits/common_type.md] +## 関連項目 +- [`fmaximum`](fmaximum.md) +- [`fmaximum_num`](fmaximum_num.md) + + ## 参照 - [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) - C++23での、一部関数の`constexpr`対応 diff --git a/reference/cmath/fmaximum.md b/reference/cmath/fmaximum.md new file mode 100644 index 0000000000..4bfe414e10 --- /dev/null +++ b/reference/cmath/fmaximum.md @@ -0,0 +1,90 @@ +# fmaximum +* cmath[meta header] +* std[meta namespace] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + constexpr floating-point-type + fmaximum(floating-point-type x, + floating-point-type y); // (1) C++26 + + constexpr Promoted + fmaximum(Arithmetic1 x, + Arithmetic2 y); // (2) C++26 +} +``` +* Promoted[italic] +* Arithmetic1[italic] +* Arithmetic2[italic] + +## 概要 +浮動小数点数型の最大値を求める。 + +- (1) : 浮動小数点数型に対するオーバーロード +- (2) : 算術型に対するオーバーロード (大きい精度にキャストして計算される。整数は`double`で計算される) + + +同じ目的のほかの関数との比較は以下。 + +| 関数名 | -0.0 と +0.0 の比較 | NaN を含む場合の挙動 | 備考 | +|---|---|---|---| +| [`fmax`](fmax.md) | 未規定 | NaN でない方を返す | | +| [`fmaximum`](fmaximum.md) | +0.0 を返す | NaN を返す | エラー伝播を優先 | +| [`fmaximum_num`](fmaximum_num.md) | +0.0 を返す | NaN でない方を返す | 数値を優先 | + + +## 戻り値 +引数の最大値を返す。 + + +## 備考 +- 戻り値は正確で、現在の丸めモードに依存しない。 +- 処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 + - 引数のいずれかが NaN の場合、 NaN を返す。 +- `-0.0`と`+0.0`の比較では、`+0.0`を返す。 + + +## 例 +```cpp example +#include +#include + +int main() { + std::println("fmaximum( 0.0, -1.0) = {:+}", std::fmaximum(0.0, -1.0)); + std::println("fmaximum(-0.0, +0.0) = {:+}", std::fmaximum(-0.0, +0.0)); + std::println("fmaximum( 0.0, +1.0) = {:+}", std::fmaximum(0.0, +1.0)); + std::println("fmaximum( 0.0, nan) = {:+}", std::fmaximum(0.0, std::nan(""))); + std::println("fmaximum( nan, nan) = {:+}", std::fmaximum(std::nan(""), std::nan(""))); +} +``` +* std::fmaximum[color ff0000] +* std::nan[link nanf.md] + +### 出力例 +``` +fmaximum( 0.0, -1.0) = +0 +fmaximum(-0.0, +0.0) = +0 +fmaximum( 0.0, +1.0) = +1 +fmaximum( 0.0, nan) = +nan +fmaximum( nan, nan) = +nan +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] + + +## 関連項目 +- [`fmax`](fmax.md) +- [`fmaximum_num`](fmaximum_num.md) + + +## 参照 +- [P3008R6 Atomic floating-point min/max](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3008r6.html) \ No newline at end of file diff --git a/reference/cmath/fmaximum_num.md b/reference/cmath/fmaximum_num.md new file mode 100644 index 0000000000..ecf93c5317 --- /dev/null +++ b/reference/cmath/fmaximum_num.md @@ -0,0 +1,92 @@ +# fmaximum_num +* cmath[meta header] +* std[meta namespace] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + constexpr floating-point-type + fmaximum_num(floating-point-type x, + floating-point-type y); // (1) C++26 + + constexpr Promoted + fmaximum_num(Arithmetic1 x, + Arithmetic2 y); // (2) C++26 +} +``` +* Promoted[italic] +* Arithmetic1[italic] +* Arithmetic2[italic] + +## 概要 +浮動小数点数型の最大値を求める。 + +- (1) : 浮動小数点数型に対するオーバーロード +- (2) : 算術型に対するオーバーロード (大きい精度にキャストして計算される。整数は`double`で計算される) + + +同じ目的のほかの関数との比較は以下。 + +| 関数名 | -0.0 と +0.0 の比較 | NaN を含む場合の挙動 | 備考 | +|---|---|---|---| +| [`fmax`](fmax.md) | 未規定 | NaN でない方を返す | | +| [`fmaximum`](fmaximum.md) | +0.0 を返す | NaN を返す | エラー伝播を優先 | +| [`fmaximum_num`](fmaximum_num.md) | +0.0 を返す | NaN でない方を返す | 数値を優先 | + + +## 戻り値 +引数の最大値を返す。 + + +## 備考 +- 戻り値は正確で、現在の丸めモードに依存しない。 +- 処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 + - 引数の1つが NaN の場合 NaN でない方を返す。 + - 引数が2つとも NaN の場合 NaN を返す。 +- `-0.0`と`+0.0`の比較では、`+0.0`を返す。 +- IEEE 754 の `maximumNum` に対応する。 + + +## 例 +```cpp example +#include +#include + +int main() { + std::println("fmaximum_num( 0.0, -1.0) = {:+}", std::fmaximum_num(0.0, -1.0)); + std::println("fmaximum_num(-0.0, +0.0) = {:+}", std::fmaximum_num(-0.0, +0.0)); + std::println("fmaximum_num( 0.0, +1.0) = {:+}", std::fmaximum_num(0.0, +1.0)); + std::println("fmaximum_num( 0.0, nan) = {:+}", std::fmaximum_num(0.0, std::nan(""))); + std::println("fmaximum_num( nan, nan) = {:+}", std::fmaximum_num(std::nan(""), std::nan(""))); +} +``` +* std::fmaximum_num[color ff0000] +* std::nan[link nanf.md] + +### 出力例 +``` +fmaximum_num( 0.0, -1.0) = +0 +fmaximum_num(-0.0, +0.0) = +0 +fmaximum_num( 0.0, +1.0) = +1 +fmaximum_num( 0.0, nan) = +0 +fmaximum_num( nan, nan) = +nan +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] + + +## 関連項目 +- [`fmax`](fmax.md) +- [`fmaximum`](fmaximum.md) + + +## 参照 +- [P3008R6 Atomic floating-point min/max](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3008r6.html) \ No newline at end of file diff --git a/reference/cmath/fminimum.md b/reference/cmath/fminimum.md new file mode 100644 index 0000000000..52a73adc10 --- /dev/null +++ b/reference/cmath/fminimum.md @@ -0,0 +1,90 @@ +# fminimum +* cmath[meta header] +* std[meta namespace] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + constexpr floating-point-type + fminimum(floating-point-type x, + floating-point-type y); // (1) C++26 + + constexpr Promoted + fminimum(Arithmetic1 x, + Arithmetic2 y); // (2) C++26 +} +``` +* Promoted[italic] +* Arithmetic1[italic] +* Arithmetic2[italic] + +## 概要 +浮動小数点数型の最小値を求める。 + +- (1) : 浮動小数点数型に対するオーバーロード +- (2) : 算術型に対するオーバーロード (大きい精度にキャストして計算される。整数は`double`で計算される) + + +同じ目的のほかの関数との比較は以下。 + +| 関数名 | -0.0 と +0.0 の比較 | NaN を含む場合の挙動 | 備考 | +|---|---|---|---| +| [`fmin`](fmin.md) | 未規定 | NaN でない方を返す | | +| [`fminimum`](fminimum.md) | -0.0 を返す | NaN を返す | エラー伝播を優先 | +| [`fminimum_num`](fmaximum_num.md) | -0.0 を返す | NaN でない方を返す | 数値を優先 | + + +## 戻り値 +引数の最小値を返す。 + + +## 備考 +- 戻り値は正確で、現在の丸めモードに依存しない。 +- 処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 + - 引数のいずれかが NaN の場合、 NaN を返す。 +- `-0.0`と`+0.0`の比較では、`-0.0`を返す。 + + +## 例 +```cpp example +#include +#include + +int main() { + std::println("fminimum( 0.0, -1.0) = {:+}", std::fminimum(0.0, -1.0)); + std::println("fminimum(-0.0, +0.0) = {:+}", std::fminimum(-0.0, +0.0)); + std::println("fminimum( 0.0, +1.0) = {:+}", std::fminimum(0.0, +1.0)); + std::println("fminimum( 0.0, nan) = {:+}", std::fminimum(0.0, std::nan(""))); + std::println("fminimum( nan, nan) = {:+}", std::fminimum(std::nan(""), std::nan(""))); +} +``` +* std::fminimum[color ff0000] +* std::nan[link nanf.md] + +### 出力例 +``` +fminimum( 0.0, -1.0) = -1 +fminimum(-0.0, +0.0) = -0 +fminimum( 0.0, +1.0) = +0 +fminimum( 0.0, nan) = +nan +fminimum( nan, nan) = +nan +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] + + +## 関連項目 +- [`fmin`](fmin.md) +- [`fminimum_num`](fminimum_num.md) + + +## 参照 +- [P3008R6 Atomic floating-point min/max](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3008r6.html) \ No newline at end of file diff --git a/reference/cmath/fminimum_num.md b/reference/cmath/fminimum_num.md new file mode 100644 index 0000000000..3b97c0d099 --- /dev/null +++ b/reference/cmath/fminimum_num.md @@ -0,0 +1,92 @@ +# fminimum_num +* cmath[meta header] +* std[meta namespace] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + constexpr floating-point-type + fminimum_num(floating-point-type x, + floating-point-type y); // (1) C++26 + + constexpr Promoted + fminimum_num(Arithmetic1 x, + Arithmetic2 y); // (2) C++26 +} +``` +* Promoted[italic] +* Arithmetic1[italic] +* Arithmetic2[italic] + +## 概要 +浮動小数点数型の最小値を求める。 + +- (1) : 浮動小数点数型に対するオーバーロード +- (2) : 算術型に対するオーバーロード (大きい精度にキャストして計算される。整数は`double`で計算される) + + +同じ目的のほかの関数との比較は以下。 + +| 関数名 | -0.0 と +0.0 の比較 | NaN を含む場合の挙動 | 備考 | +|---|---|---|---| +| [`fmin`](fmin.md) | 未規定 | NaN でない方を返す | | +| [`fminimum`](fminimum.md) | -0.0 を返す | NaN を返す | エラー伝播を優先 | +| [`fminimum_num`](fminimum_num.md) | -0.0 を返す | NaN でない方を返す | 数値を優先 | + + +## 戻り値 +引数の最小値を返す。 + + +## 備考 +- 戻り値は正確で、現在の丸めモードに依存しない。 +- 処理系が IEC 60559 に準拠している場合([`std::numeric_limits`](../limits/numeric_limits.md)`::`[`is_iec559`](../limits/numeric_limits/is_iec559.md)`() != false`)、以下の規定が追加される。 + - 引数の1つが NaN の場合 NaN でない方を返す。 + - 引数が2つとも NaN の場合 NaN を返す。 +- `-0.0`と`+0.0`の比較では、`-0.0`を返す。 +- IEEE 754 の `minimumNum` に対応する。 + + +## 例 +```cpp example +#include +#include + +int main() { + std::println("fminimum_num( 0.0, -1.0) = {:+}", std::fminimum_num(0.0, -1.0)); + std::println("fminimum_num(-0.0, +0.0) = {:+}", std::fminimum_num(-0.0, +0.0)); + std::println("fminimum_num( 0.0, +1.0) = {:+}", std::fminimum_num(0.0, +1.0)); + std::println("fminimum_num( 0.0, nan) = {:+}", std::fminimum_num(0.0, std::nan(""))); + std::println("fminimum_num( nan, nan) = {:+}", std::fminimum_num(std::nan(""), std::nan(""))); +} +``` +* std::fminimum_num[color ff0000] +* std::nan[link nanf.md] + +### 出力例 +``` +fminimum_num( 0.0, -1.0) = -1 +fminimum_num(-0.0, +0.0) = -0 +fminimum_num( 0.0, +1.0) = +0 +fminimum_num( 0.0, nan) = +0 +fminimum_num( nan, nan) = +nan +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21.0 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] + + +## 関連項目 +- [`fmin`](fmin.md) +- [`fminimum`](fminimum.md) + + +## 参照 +- [P3008R6 Atomic floating-point min/max](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3008r6.html) \ No newline at end of file From 1aa60a210f14f0a773e0d9320adb553f1f791320 Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 19 Sep 2025 10:14:52 +0900 Subject: [PATCH 2365/3948] execution: P3149R11 simple_counting_scope(#1510) --- .../execution/simple_counting_scope.md | 19 ++++---- .../execution/simple_counting_scope/close.md | 45 ++++++++++++++++++ .../simple_counting_scope/disassociate.md | 42 +++++++++++++++++ .../simple_counting_scope/get_token.md | 37 +++++++++++++++ .../execution/simple_counting_scope/join.md | 37 +++++++++++++++ .../simple_counting_scope/op_constructor.md | 38 +++++++++++++++ .../simple_counting_scope/op_destructor.md | 33 +++++++++++++ .../start-join-sender.md | 41 ++++++++++++++++ .../execution/simple_counting_scope/token.md | 47 +++++++++++++++++++ .../token/disassociate.md | 47 +++++++++++++++++++ .../token/try_associate.md | 47 +++++++++++++++++++ .../simple_counting_scope/token/wrap.md | 43 +++++++++++++++++ .../simple_counting_scope/try-associate.md | 46 ++++++++++++++++++ 13 files changed, 513 insertions(+), 9 deletions(-) create mode 100644 reference/execution/execution/simple_counting_scope/close.md create mode 100644 reference/execution/execution/simple_counting_scope/disassociate.md create mode 100644 reference/execution/execution/simple_counting_scope/get_token.md create mode 100644 reference/execution/execution/simple_counting_scope/join.md create mode 100644 reference/execution/execution/simple_counting_scope/op_constructor.md create mode 100644 reference/execution/execution/simple_counting_scope/op_destructor.md create mode 100644 reference/execution/execution/simple_counting_scope/start-join-sender.md create mode 100644 reference/execution/execution/simple_counting_scope/token.md create mode 100644 reference/execution/execution/simple_counting_scope/token/disassociate.md create mode 100644 reference/execution/execution/simple_counting_scope/token/try_associate.md create mode 100644 reference/execution/execution/simple_counting_scope/token/wrap.md create mode 100644 reference/execution/execution/simple_counting_scope/try-associate.md diff --git a/reference/execution/execution/simple_counting_scope.md b/reference/execution/execution/simple_counting_scope.md index 6ca315a015..5afaa2c60b 100644 --- a/reference/execution/execution/simple_counting_scope.md +++ b/reference/execution/execution/simple_counting_scope.md @@ -146,6 +146,7 @@ namespace std::execution { * connect[link connect.md] * start[link start.md] * data-type[link data-type.md] +* start-join-sender[link simple_counting_scope/start-join-sender.md] * nothrow-callable[link /reference/functional/nothrow-callable.md] * is_nothrow_constructible_v[link /reference/type_traits/is_nothrow_constructible.md] * std::move[link /reference/utility/move.md] @@ -155,25 +156,25 @@ namespace std::execution { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`(constructor)`](simple_counting_scope/op_constructor.md.nolink) | コンストラクタ | C++26 | -| [`(destructor)`](simple_counting_scope/op_destructor.md.nolink) | デストラクタ | C++26 | -| [`get_token`](simple_counting_scope/get_token.md.nolink) | 非同期スコープトークンを取得 | C++26 | -| [`close`](simple_counting_scope/close.md.nolink) | 非同期スコープを閉じる | C++26 | -| [`join`](simple_counting_scope/join.md.nolink) | 非同期スコープを合流する[Sender](sender.md)取得 | C++26 | +| [`(constructor)`](simple_counting_scope/op_constructor.md) | コンストラクタ | C++26 | +| [`(destructor)`](simple_counting_scope/op_destructor.md) | デストラクタ | C++26 | +| [`get_token`](simple_counting_scope/get_token.md) | 非同期スコープトークンを取得 | C++26 | +| [`close`](simple_counting_scope/close.md) | 非同期スコープを閉じる | C++26 | +| [`join`](simple_counting_scope/join.md) | 非同期スコープを合流する[Sender](sender.md)取得 | C++26 | ### 説明専用メンバ関数 | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`try-associate`](simple_counting_scope/try-associate.md.nolink) | 関連付けを試行 | C++26 | -| [`disassociate`](simple_counting_scope/disassociate.md.nolink) | 関連付けを解除| C++26 | -| [`start-join-sender`](simple_counting_scope/start-join-sender.md.nolink) | 合流[Sender](sender.md)を開始 | C++26 | +| [`try-associate`](simple_counting_scope/try-associate.md) | 関連付けを試行 | C++26 | +| [`disassociate`](simple_counting_scope/disassociate.md) | 関連付けを解除 | C++26 | +| [`start-join-sender`](simple_counting_scope/start-join-sender.md) | 合流[Sender](sender.md)を開始 | C++26 | ## メンバ型 | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`token`](simple_counting_scope/token.md.nolink) | 非同期スコープトークン型 | C++26 | +| [`token`](simple_counting_scope/token.md) | 非同期スコープトークン型 | C++26 | ## 静的メンバ変数 diff --git a/reference/execution/execution/simple_counting_scope/close.md b/reference/execution/execution/simple_counting_scope/close.md new file mode 100644 index 0000000000..e3635daccf --- /dev/null +++ b/reference/execution/execution/simple_counting_scope/close.md @@ -0,0 +1,45 @@ +# close +* execution[meta header] +* std::execution[meta namespace] +* simple_counting_scope[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +void close() noexcept; +``` + +## 概要 +非同期スコープを閉じる。 + + +## 効果 +説明用のメンバ変数`state`に応じて、 + +- `unused`のとき、`state`を`unused-and-closed`に変更する。 +- `open`のとき、`state`を`closed`に変更する。 +- `open-and-joining`のとき、`state`を`closed-and-joining`に変更する。 +- それ以外のとき、何もしない。 + + +## 事後条件 +`*this`に対する後続の[`try-associate`](try-associate.md)は`false`を返す。 + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) diff --git a/reference/execution/execution/simple_counting_scope/disassociate.md b/reference/execution/execution/simple_counting_scope/disassociate.md new file mode 100644 index 0000000000..8d8f73683c --- /dev/null +++ b/reference/execution/execution/simple_counting_scope/disassociate.md @@ -0,0 +1,42 @@ +# disassociate +* execution[meta header] +* std::execution[meta namespace] +* simple_counting_scope[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +void disassociate() noexcept; // exposition only +``` + +## 概要 +非同期スコープとの関連付けを解除する、説明専用のメンバ関数。 +非同期トークン型[`token`]の[`disassociate`](token/disassociate.md)メンバ動作を定義する。 + + +## 事前条件 +説明用のメンバ変数`count`は`0`より大きい。 + + +## 効果 +`count`をデクリメントする。 +デクリメント後の`count == 0`、かつ説明用のメンバ変数`state`が`open-and-joining`または`closed-and-joining`のとき、`state`を`joined`に変更し、`*this`に登録された全てのオブジェクトで`complete()`を呼び出す。 + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) diff --git a/reference/execution/execution/simple_counting_scope/get_token.md b/reference/execution/execution/simple_counting_scope/get_token.md new file mode 100644 index 0000000000..d3eaf0ad8e --- /dev/null +++ b/reference/execution/execution/simple_counting_scope/get_token.md @@ -0,0 +1,37 @@ +# get_token +* execution[meta header] +* std::execution[meta namespace] +* simple_counting_scope[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +token get_token() noexcept; +``` +* token[link token.md] + +## 概要 +非同期スコープの[非同期スコープトークン](token.md)を取得する。 + + +## 戻り値 +[`simple_counting_scope::token`](token.md)型で`t.scope == this`となるオブジェクト`t`を返す。 + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) diff --git a/reference/execution/execution/simple_counting_scope/join.md b/reference/execution/execution/simple_counting_scope/join.md new file mode 100644 index 0000000000..2ad069b098 --- /dev/null +++ b/reference/execution/execution/simple_counting_scope/join.md @@ -0,0 +1,37 @@ +# join +* execution[meta header] +* std::execution[meta namespace] +* simple_counting_scope[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +sender auto join() noexcept; +``` +* sender[link ../sender.md] + +## 概要 +非同期スコープを合流する[Sender](../sender.md)を取得する。 + + +## 戻り値 +[`make-sender`](../make-sender.md)`(`[`scope-join-t`](../simple_counting_scope.md)`(), this)` + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) diff --git a/reference/execution/execution/simple_counting_scope/op_constructor.md b/reference/execution/execution/simple_counting_scope/op_constructor.md new file mode 100644 index 0000000000..c23cdc50ca --- /dev/null +++ b/reference/execution/execution/simple_counting_scope/op_constructor.md @@ -0,0 +1,38 @@ +# コンストラクタ +* execution[meta header] +* std::execution[meta namespace] +* simple_counting_scope[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +simple_counting_scope() noexcept; // (1) +simple_counting_scope(simple_counting_scope&&) = delete; // (2) +``` + +## 概要 +- (1): デフォルトコンストラクタ +- (2): ムーブコンストラクタ。ムーブ不可 + + +## 事後条件 +(1) 説明用のメンバ変数`count`は`0`、`state`は`unused`となる。 + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) diff --git a/reference/execution/execution/simple_counting_scope/op_destructor.md b/reference/execution/execution/simple_counting_scope/op_destructor.md new file mode 100644 index 0000000000..1785f4d521 --- /dev/null +++ b/reference/execution/execution/simple_counting_scope/op_destructor.md @@ -0,0 +1,33 @@ +# デストラクタ +* execution[meta header] +* std::execution[meta namespace] +* simple_counting_scope[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +~simple_counting_scope(); +``` + +## 概要 +デストラクタ + + +## 効果 +説明用のメンバ変数`state`が`joined`, `unused`, `unused-and-closed`のいずれでもなければ、[`terminate`](/reference/exception/terminate.md)を呼び出す。 +そうでなければ、何もしない。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) diff --git a/reference/execution/execution/simple_counting_scope/start-join-sender.md b/reference/execution/execution/simple_counting_scope/start-join-sender.md new file mode 100644 index 0000000000..1b5b265b38 --- /dev/null +++ b/reference/execution/execution/simple_counting_scope/start-join-sender.md @@ -0,0 +1,41 @@ +# start-join-sender +* execution[meta header] +* std::execution[meta namespace] +* simple_counting_scope[meta class] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +bool start-join-sender(State& st) noexcept; // exposition only +``` + +## 概要 +合流[Sender](../sender.md)を開始する、説明専用のメンバ関数。 + + +## 効果 +説明用のメンバ変数`state`に応じて、 + +- `unused`, `unused-and-closed`, `joined`のとき、`state`を`joined`に変更して`true`を返す。 +- `open`, `open-and-joining`のとき、`state`を`open-and-joining`に変更し、`*this`で`st`を登録して`false`を返す。 +- `closed`, `closed-and-joingin`のとき、`state`を`closed-and-joining`に変更し、`*this`で`st`を登録して`false`を返す。 + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) diff --git a/reference/execution/execution/simple_counting_scope/token.md b/reference/execution/execution/simple_counting_scope/token.md new file mode 100644 index 0000000000..a32ff7d16c --- /dev/null +++ b/reference/execution/execution/simple_counting_scope/token.md @@ -0,0 +1,47 @@ +# token +* execution[meta header] +* std::execution[meta namespace] +* simple_counting_scope[meta class] +* class[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + class simple_counting_scope::token; +} +``` + +## 概要 +`simple_counting_scope::token`は、カウント式非同期スコープの[非同期トークン](../scope_token.md)である。 + +クラス動作説明用のメンバ変数として下記を保持する。 + +- `scope` : [`simple_counting_scope`](../simple_counting_scope.md)型の非同期スコープ + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`wrap`](token/wrap.md) | 非同期スコープと[Sender](../sender.md)関連付けたSenderを返す | C++26 | +| [`try_associate`](token/try_associate.md) | 非同期スコープとの関連付けを試行 | C++26 | +| [`disassociate`](token/disassociate.md) | 非同期スコープとの関連付けを解除 | C++26 | + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::scope_token`](../scope_token.md) + + +## 参照 +- [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) diff --git a/reference/execution/execution/simple_counting_scope/token/disassociate.md b/reference/execution/execution/simple_counting_scope/token/disassociate.md new file mode 100644 index 0000000000..1c9e3414ae --- /dev/null +++ b/reference/execution/execution/simple_counting_scope/token/disassociate.md @@ -0,0 +1,47 @@ +# disassociate +* execution[meta header] +* function[meta id-type] +* std::execution[meta namespace] +* simple_counting_scope::token[meta class] +* cpp26[meta cpp] + +```cpp +void disassociate() const noexcept; +``` + +## 概要 +非同期スコープとの関連付けを解除する。 + + +## 効果 +下記と等価。 + +```cpp +scope->disassociate() +``` +* disassociate[link ../disassociate.md] + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::associate`](../../associate.md.nolink) +- [`execution::spawn_future`](../../spawn_future.md.nolink) +- [`execution::spawn`](../../spawn.md.nolink) + + +## 参照 +- [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) diff --git a/reference/execution/execution/simple_counting_scope/token/try_associate.md b/reference/execution/execution/simple_counting_scope/token/try_associate.md new file mode 100644 index 0000000000..3784a30704 --- /dev/null +++ b/reference/execution/execution/simple_counting_scope/token/try_associate.md @@ -0,0 +1,47 @@ +# try_associate +* execution[meta header] +* function[meta id-type] +* std::execution[meta namespace] +* simple_counting_scope::token[meta class] +* cpp26[meta cpp] + +```cpp +bool try_associate() const noexcept; +``` + +## 概要 +非同期スコープとの関連付けを試行する。 + + +## 効果 +下記と等価。 + +```cpp +return scope->try-associate(); +``` +* try-associate[link ../try-associate.md] + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::associate`](../../associate.md.nolink) +- [`execution::spawn_future`](../../spawn_future.md.nolink) +- [`execution::spawn`](../../spawn.md.nolink) + + +## 参照 +- [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) diff --git a/reference/execution/execution/simple_counting_scope/token/wrap.md b/reference/execution/execution/simple_counting_scope/token/wrap.md new file mode 100644 index 0000000000..a873ba32c0 --- /dev/null +++ b/reference/execution/execution/simple_counting_scope/token/wrap.md @@ -0,0 +1,43 @@ +# wrap +* execution[meta header] +* function template[meta id-type] +* std::execution[meta namespace] +* simple_counting_scope::token[meta class] +* cpp26[meta cpp] + +```cpp +template +Sender&& wrap(Sender&& snd) const noexcept; +``` + +## 概要 +入力[Sender](../../sender.md)を非同期スコープに関連付けたSenderを返す。 + + +## 戻り値 +[`std::forward`](/reference/utility/forward.md)`(snd)` + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::associate`](../../associate.md.nolink) +- [`execution::spawn_future`](../../spawn_future.md.nolink) +- [`execution::spawn`](../../spawn.md.nolink) + + +## 参照 +- [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) diff --git a/reference/execution/execution/simple_counting_scope/try-associate.md b/reference/execution/execution/simple_counting_scope/try-associate.md new file mode 100644 index 0000000000..0166940cf0 --- /dev/null +++ b/reference/execution/execution/simple_counting_scope/try-associate.md @@ -0,0 +1,46 @@ +# try-associate +* execution[meta header] +* std::execution[meta namespace] +* simple_counting_scope[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +bool try-associate() noexcept; // exposition only +``` + +## 概要 +非同期スコープとの関連付けを試行する、説明専用のメンバ関数。 +非同期トークン型[`token`]の[`try_associate`](token/try_associate.md)メンバ動作を定義する。 + + +## 効果 +説明用のメンバ変数`count`が`max_associations`と等しいとき、何もしない。 +そうでなければ、説明用のメンバ変数`state`に応じて、 + +- `unused`のとき、`count`をインクリメントし、`state`を`open`に変更する。 +- `open`または`open-and-joining`のとき、`count`をインクリメントする。 +- それ以外のとき、何もしない。 + + +## 戻り値 +`count`がインクリメントされたとき、`true`を返す。それ以外のときは、`false`を返す。 + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) From b8e603cc707d19ec5dc6eccc3ced2c5d3564e658 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 19 Sep 2025 12:05:41 +0900 Subject: [PATCH 2366/3948] fix link --- reference/cmath/fminimum.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cmath/fminimum.md b/reference/cmath/fminimum.md index 52a73adc10..cc13ebfca6 100644 --- a/reference/cmath/fminimum.md +++ b/reference/cmath/fminimum.md @@ -32,7 +32,7 @@ namespace std { |---|---|---|---| | [`fmin`](fmin.md) | 未規定 | NaN でない方を返す | | | [`fminimum`](fminimum.md) | -0.0 を返す | NaN を返す | エラー伝播を優先 | -| [`fminimum_num`](fmaximum_num.md) | -0.0 を返す | NaN でない方を返す | 数値を優先 | +| [`fminimum_num`](fminimum_num.md) | -0.0 を返す | NaN でない方を返す | 数値を優先 | ## 戻り値 From 4fbde58e0fe9cf97d3bf8c510ea4cc0c5a4b1b86 Mon Sep 17 00:00:00 2001 From: yoh Date: Sat, 20 Sep 2025 10:37:34 +0900 Subject: [PATCH 2367/3948] stop_token/stoppable-source: fix typo --- reference/stop_token/stoppable-source.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/stop_token/stoppable-source.md b/reference/stop_token/stoppable-source.md index c258860e01..909dc19f54 100644 --- a/reference/stop_token/stoppable-source.md +++ b/reference/stop_token/stoppable-source.md @@ -5,7 +5,7 @@ * cpp26[meta cpp] ```cpp -mplate +template concept stoppable-source = requires (Source& src, const Source csrc) { { csrc.get_token() } -> stoppable_token; From a93a45196f5a34e1fadba9fa861b78070185977a Mon Sep 17 00:00:00 2001 From: yoh Date: Sat, 20 Sep 2025 11:23:38 +0900 Subject: [PATCH 2368/3948] execution: P3149R11 counting_scope(#1510) --- .../execution/execution/counting_scope.md | 21 +++++--- .../execution/counting_scope/close.md | 45 +++++++++++++++++ .../execution/counting_scope/disassociate.md | 42 ++++++++++++++++ .../execution/counting_scope/get_token.md | 37 ++++++++++++++ .../execution/counting_scope/join.md | 37 ++++++++++++++ .../counting_scope/op_constructor.md | 38 +++++++++++++++ .../execution/counting_scope/op_destructor.md | 33 +++++++++++++ .../execution/counting_scope/request_stop.md | 40 ++++++++++++++++ .../counting_scope/start-join-sender.md | 42 ++++++++++++++++ .../execution/counting_scope/token.md | 48 +++++++++++++++++++ .../counting_scope/token/disassociate.md | 47 ++++++++++++++++++ .../counting_scope/token/try_associate.md | 47 ++++++++++++++++++ .../execution/counting_scope/token/wrap.md | 48 +++++++++++++++++++ .../execution/counting_scope/try-associate.md | 46 ++++++++++++++++++ .../execution/simple_counting_scope.md | 10 ++-- .../simple_counting_scope/disassociate.md | 2 +- .../start-join-sender.md | 3 +- .../execution/simple_counting_scope/token.md | 3 +- .../simple_counting_scope/token/wrap.md | 1 + .../simple_counting_scope/try-associate.md | 2 +- 20 files changed, 576 insertions(+), 16 deletions(-) create mode 100644 reference/execution/execution/counting_scope/close.md create mode 100644 reference/execution/execution/counting_scope/disassociate.md create mode 100644 reference/execution/execution/counting_scope/get_token.md create mode 100644 reference/execution/execution/counting_scope/join.md create mode 100644 reference/execution/execution/counting_scope/op_constructor.md create mode 100644 reference/execution/execution/counting_scope/op_destructor.md create mode 100644 reference/execution/execution/counting_scope/request_stop.md create mode 100644 reference/execution/execution/counting_scope/start-join-sender.md create mode 100644 reference/execution/execution/counting_scope/token.md create mode 100644 reference/execution/execution/counting_scope/token/disassociate.md create mode 100644 reference/execution/execution/counting_scope/token/try_associate.md create mode 100644 reference/execution/execution/counting_scope/token/wrap.md create mode 100644 reference/execution/execution/counting_scope/try-associate.md diff --git a/reference/execution/execution/counting_scope.md b/reference/execution/execution/counting_scope.md index 4819fa15bb..986b5a422d 100644 --- a/reference/execution/execution/counting_scope.md +++ b/reference/execution/execution/counting_scope.md @@ -14,22 +14,29 @@ namespace std::execution { `counting_scope`は、停止要求を作成可能なカウント式の非同期スコープを表現する。 +クラス動作説明用のメンバ変数として下記を保持する。詳細仕様は[`simple_counting_scope`](simple_counting_scope.md)を参照。 + +- `count` : `size_t`型の関連付けカウント値 +- `state` : `scope-state-type`列挙型(後述)の状態 +- `s_source` : [`inplace_stop_source`](/reference/stop_token/inplace_stop_source.md)型の停止要求管理オブジェクト + + ## メンバ関数 | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`(constructor)`](counting_scope/op_constructor.md.nolink) | コンストラクタ | C++26 | -| [`(destructor)`](counting_scope/op_destructor.md.nolink) | デストラクタ | C++26 | -| [`get_token`](counting_scope/get_token.md.nolink) | 非同期スコープトークンを取得 | C++26 | -| [`close`](counting_scope/close.md.nolink) | 非同期スコープを閉じる | C++26 | -| [`join`](counting_scope/join.md.nolink) | 非同期スコープを合流する[Sender](sender.md)取得 | C++26 | -| [`request_stop`](counting_scope/request_stop.md.nolink) | 停止要求を行う | C++26 | +| [`(constructor)`](counting_scope/op_constructor.md) | コンストラクタ | C++26 | +| [`(destructor)`](counting_scope/op_destructor.md) | デストラクタ | C++26 | +| [`get_token`](counting_scope/get_token.md) | 非同期スコープトークンを取得 | C++26 | +| [`close`](counting_scope/close.md) | 非同期スコープを閉じる | C++26 | +| [`join`](counting_scope/join.md) | 非同期スコープを合流する[Sender](sender.md)取得 | C++26 | +| [`request_stop`](counting_scope/request_stop.md) | 停止要求を作成する | C++26 | ## メンバ型 | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`token`](counting_scope/token.md.nolink) | 非同期スコープトークン型 | C++26 | +| [`token`](counting_scope/token.md) | 非同期スコープトークン型 | C++26 | ## 静的メンバ変数 diff --git a/reference/execution/execution/counting_scope/close.md b/reference/execution/execution/counting_scope/close.md new file mode 100644 index 0000000000..ea3f53dd9a --- /dev/null +++ b/reference/execution/execution/counting_scope/close.md @@ -0,0 +1,45 @@ +# close +* execution[meta header] +* std::execution[meta namespace] +* counting_scope[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +void close() noexcept; +``` + +## 概要 +非同期スコープを閉じる。 + + +## 効果 +説明用のメンバ変数`state`に応じて、 + +- `unused`のとき、`state`を`unused-and-closed`に変更する。 +- `open`のとき、`state`を`closed`に変更する。 +- `open-and-joining`のとき、`state`を`closed-and-joining`に変更する。 +- それ以外のとき、何もしない。 + + +## 事後条件 +`*this`に対する後続の[`try-associate`](try-associate.md)は`false`を返す。 + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) diff --git a/reference/execution/execution/counting_scope/disassociate.md b/reference/execution/execution/counting_scope/disassociate.md new file mode 100644 index 0000000000..dcb449a868 --- /dev/null +++ b/reference/execution/execution/counting_scope/disassociate.md @@ -0,0 +1,42 @@ +# disassociate +* execution[meta header] +* std::execution[meta namespace] +* counting_scope[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +void disassociate() noexcept; // exposition only +``` + +## 概要 +非同期スコープとの関連付けを解除する、説明専用のメンバ関数。 +非同期トークン型[`token`](token.md)の[`disassociate`](token/disassociate.md)メンバ動作を定義する。 + + +## 事前条件 +説明用のメンバ変数`count`は`0`より大きい。 + + +## 効果 +`count`をデクリメントする。 +デクリメント後の`count == 0`、かつ説明用のメンバ変数`state`が`open-and-joining`または`closed-and-joining`のとき、`state`を`joined`に変更し、`*this`に登録された全てのオブジェクトで`complete()`を呼び出す。 + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) diff --git a/reference/execution/execution/counting_scope/get_token.md b/reference/execution/execution/counting_scope/get_token.md new file mode 100644 index 0000000000..b04a8f7336 --- /dev/null +++ b/reference/execution/execution/counting_scope/get_token.md @@ -0,0 +1,37 @@ +# get_token +* execution[meta header] +* std::execution[meta namespace] +* counting_scope[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +token get_token() noexcept; +``` +* token[link token.md] + +## 概要 +非同期スコープの[非同期スコープトークン](token.md)を取得する。 + + +## 戻り値 +[`counting_scope::token`](token.md)型で`t.scope == this`となるオブジェクト`t`を返す。 + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) diff --git a/reference/execution/execution/counting_scope/join.md b/reference/execution/execution/counting_scope/join.md new file mode 100644 index 0000000000..2ec82dfa51 --- /dev/null +++ b/reference/execution/execution/counting_scope/join.md @@ -0,0 +1,37 @@ +# join +* execution[meta header] +* std::execution[meta namespace] +* counting_scope[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +sender auto join() noexcept; +``` +* sender[link ../sender.md] + +## 概要 +非同期スコープを合流する[Sender](../sender.md)を取得する。 + + +## 戻り値 +[`make-sender`](../make-sender.md)`(`[`scope-join-t`](../simple_counting_scope.md)`(), this)` + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) diff --git a/reference/execution/execution/counting_scope/op_constructor.md b/reference/execution/execution/counting_scope/op_constructor.md new file mode 100644 index 0000000000..ca8067fb74 --- /dev/null +++ b/reference/execution/execution/counting_scope/op_constructor.md @@ -0,0 +1,38 @@ +# コンストラクタ +* execution[meta header] +* std::execution[meta namespace] +* counting_scope[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +counting_scope() noexcept; // (1) +counting_scope(counting_scope&&) = delete; // (2) +``` + +## 概要 +- (1): デフォルトコンストラクタ +- (2): ムーブコンストラクタ。ムーブ不可 + + +## 事後条件 +(1) 説明用のメンバ変数`count`は`0`、`state`は`unused`となる。 + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) diff --git a/reference/execution/execution/counting_scope/op_destructor.md b/reference/execution/execution/counting_scope/op_destructor.md new file mode 100644 index 0000000000..a6d00b46aa --- /dev/null +++ b/reference/execution/execution/counting_scope/op_destructor.md @@ -0,0 +1,33 @@ +# デストラクタ +* execution[meta header] +* std::execution[meta namespace] +* counting_scope[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +~counting_scope(); +``` + +## 概要 +デストラクタ + + +## 効果 +説明用のメンバ変数`state`が`joined`, `unused`, `unused-and-closed`のいずれでもなければ、[`terminate`](/reference/exception/terminate.md)を呼び出す。 +そうでなければ、何もしない。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) diff --git a/reference/execution/execution/counting_scope/request_stop.md b/reference/execution/execution/counting_scope/request_stop.md new file mode 100644 index 0000000000..c3cc6e7208 --- /dev/null +++ b/reference/execution/execution/counting_scope/request_stop.md @@ -0,0 +1,40 @@ +# request_stop +* execution[meta header] +* std::execution[meta namespace] +* counting_scope[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +void request_stop() noexcept; +``` + +## 概要 +非同期スコープ上で停止要求を作成する。 + + +## 効果 +`s_source.`[`request_stop()`](/reference/stop_token/inplace_stop_source/request_stop.md) + + +## 例外 +投げない + + +## 備考 +`request_stop`の呼び出しはデータ競合を引き起こさない。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) diff --git a/reference/execution/execution/counting_scope/start-join-sender.md b/reference/execution/execution/counting_scope/start-join-sender.md new file mode 100644 index 0000000000..9c63f0c071 --- /dev/null +++ b/reference/execution/execution/counting_scope/start-join-sender.md @@ -0,0 +1,42 @@ +# start-join-sender +* execution[meta header] +* std::execution[meta namespace] +* counting_scope[meta class] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +bool start-join-sender(State& st) noexcept; // exposition only +``` + +## 概要 +合流[Sender](../sender.md)を開始する、説明専用のメンバ関数。 +[`join`](join.md)メンバ関数が返す合流Sender動作を定義する。 + + +## 効果 +説明用のメンバ変数`state`に応じて、 + +- `unused`, `unused-and-closed`, `joined`のとき、`state`を`joined`に変更して`true`を返す。 +- `open`, `open-and-joining`のとき、`state`を`open-and-joining`に変更し、`*this`で`st`を登録して`false`を返す。 +- `closed`, `closed-and-joining`のとき、`state`を`closed-and-joining`に変更し、`*this`で`st`を登録して`false`を返す。 + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) diff --git a/reference/execution/execution/counting_scope/token.md b/reference/execution/execution/counting_scope/token.md new file mode 100644 index 0000000000..222650238e --- /dev/null +++ b/reference/execution/execution/counting_scope/token.md @@ -0,0 +1,48 @@ +# token +* execution[meta header] +* std::execution[meta namespace] +* counting_scope[meta class] +* class[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + class counting_scope::token; +} +``` + +## 概要 +`counting_scope::token`は、カウント式非同期スコープの[非同期トークン](../scope_token.md)である。 +非同期トークンは非同期スコープを参照する軽量ハンドラとして振る舞う。 + +クラス動作説明用のメンバ変数として下記を保持する。 + +- `scope` : [`counting_scope`](../counting_scope.md)型の非同期スコープ + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`wrap`](token/wrap.md) | 非同期スコープと[Sender](../sender.md)を関連付けたSenderを返す | C++26 | +| [`try_associate`](token/try_associate.md) | 非同期スコープとの関連付けを試行 | C++26 | +| [`disassociate`](token/disassociate.md) | 非同期スコープとの関連付けを解除 | C++26 | + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::scope_token`](../scope_token.md) + + +## 参照 +- [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) diff --git a/reference/execution/execution/counting_scope/token/disassociate.md b/reference/execution/execution/counting_scope/token/disassociate.md new file mode 100644 index 0000000000..164c4e12bd --- /dev/null +++ b/reference/execution/execution/counting_scope/token/disassociate.md @@ -0,0 +1,47 @@ +# disassociate +* execution[meta header] +* function[meta id-type] +* std::execution[meta namespace] +* counting_scope::token[meta class] +* cpp26[meta cpp] + +```cpp +void disassociate() const noexcept; +``` + +## 概要 +非同期スコープとの関連付けを解除する。 + + +## 効果 +下記と等価。 + +```cpp +scope->disassociate() +``` +* disassociate[link ../disassociate.md] + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::associate`](../../associate.md.nolink) +- [`execution::spawn_future`](../../spawn_future.md.nolink) +- [`execution::spawn`](../../spawn.md.nolink) + + +## 参照 +- [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) diff --git a/reference/execution/execution/counting_scope/token/try_associate.md b/reference/execution/execution/counting_scope/token/try_associate.md new file mode 100644 index 0000000000..0d4dc5a4b7 --- /dev/null +++ b/reference/execution/execution/counting_scope/token/try_associate.md @@ -0,0 +1,47 @@ +# try_associate +* execution[meta header] +* function[meta id-type] +* std::execution[meta namespace] +* counting_scope::token[meta class] +* cpp26[meta cpp] + +```cpp +bool try_associate() const noexcept; +``` + +## 概要 +非同期スコープとの関連付けを試行する。 + + +## 効果 +下記と等価。 + +```cpp +return scope->try-associate(); +``` +* try-associate[link ../try-associate.md] + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::associate`](../../associate.md.nolink) +- [`execution::spawn_future`](../../spawn_future.md.nolink) +- [`execution::spawn`](../../spawn.md.nolink) + + +## 参照 +- [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) diff --git a/reference/execution/execution/counting_scope/token/wrap.md b/reference/execution/execution/counting_scope/token/wrap.md new file mode 100644 index 0000000000..0dd93543d8 --- /dev/null +++ b/reference/execution/execution/counting_scope/token/wrap.md @@ -0,0 +1,48 @@ +# wrap +* execution[meta header] +* function template[meta id-type] +* std::execution[meta namespace] +* counting_scope::token[meta class] +* cpp26[meta cpp] + +```cpp +template +sender auto wrap(Sender&& snd) const + noexcept(is_nothrow_constructible_v, Sender>); +``` +* sender[link ../../sender.md] +* is_nothrow_constructible_v[link /reference/type_traits/is_nothrow_constructible.md] + +## 概要 +入力[Sender](../../sender.md)を非同期スコープに関連付けたSenderを返す。 + + +## 効果 +下記と等価。 + +```cpp +return stop-when(std::forward(snd), scope->s_source.get_token()); +``` +* stop-when[link stop-when.md.nolink] +* get_token()[link /reference/stop_token/stop_source/get_token.md] + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::associate`](../../associate.md.nolink) +- [`execution::spawn_future`](../../spawn_future.md.nolink) +- [`execution::spawn`](../../spawn.md.nolink) + + +## 参照 +- [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) diff --git a/reference/execution/execution/counting_scope/try-associate.md b/reference/execution/execution/counting_scope/try-associate.md new file mode 100644 index 0000000000..28f6a52762 --- /dev/null +++ b/reference/execution/execution/counting_scope/try-associate.md @@ -0,0 +1,46 @@ +# try-associate +* execution[meta header] +* std::execution[meta namespace] +* counting_scope[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +bool try-associate() noexcept; // exposition only +``` + +## 概要 +非同期スコープとの関連付けを試行する、説明専用のメンバ関数。 +非同期トークン型[`token`](token.md)の[`try_associate`](token/try_associate.md)メンバ動作を定義する。 + + +## 効果 +説明用のメンバ変数`count`が`max_associations`と等しいとき、何もしない。 +そうでなければ、説明用のメンバ変数`state`に応じて、 + +- `unused`のとき、`count`をインクリメントし、`state`を`open`に変更する。 +- `open`または`open-and-joining`のとき、`count`をインクリメントする。 +- それ以外のとき、何もしない。 + + +## 戻り値 +`count`がインクリメントされたとき、`true`を返す。それ以外のときは、`false`を返す。 + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) diff --git a/reference/execution/execution/simple_counting_scope.md b/reference/execution/execution/simple_counting_scope.md index 5afaa2c60b..5b90d5f38d 100644 --- a/reference/execution/execution/simple_counting_scope.md +++ b/reference/execution/execution/simple_counting_scope.md @@ -26,7 +26,7 @@ namespace std::execution { ### 状態遷移 説明専用の各種エンティティを下記の通り定義する。 -- `Scope`型 : `simple_counting_scope`または`counting_scope`のいずれか +- `Scope`型 : `simple_counting_scope`または[`counting_scope`](counting_scope.md)のいずれか - `scope`オブジェクト : `Scope`型のオブジェクト - `tkn`オブジェクト : `scope.get_token()`が返す`Scope::token`型のオブジェクト - `jsndr` : `scope.join()`が返す[Sender](sender.md) @@ -56,7 +56,7 @@ enum scope-state-type { // exposition only ### Senderアルゴリズムタグ `scope-join-t` -説明専用の[Senderアルゴリズムタグ型](tag_of_t.md)`scope-join-t`を定義する。 +[`join`](simple_counting_scope/join.md)メンバ関数が返す合流Sender動作仕様を記述するため、説明専用の[Senderアルゴリズムタグ型](tag_of_t.md)`scope-join-t`を定義する。 ```cpp struct scope-join-t {}; // exposition only @@ -80,9 +80,9 @@ namespace std::execution { } template - void set_error(E&& e) && noexcept { - execution::set_error(std::move(rcvr), std::forward(e)); - } + void set_error(E&& e) && noexcept { + execution::set_error(std::move(rcvr), std::forward(e)); + } void set_stopped() && noexcept { execution::set_stopped(std::move(rcvr)); diff --git a/reference/execution/execution/simple_counting_scope/disassociate.md b/reference/execution/execution/simple_counting_scope/disassociate.md index 8d8f73683c..52eeca3bc4 100644 --- a/reference/execution/execution/simple_counting_scope/disassociate.md +++ b/reference/execution/execution/simple_counting_scope/disassociate.md @@ -11,7 +11,7 @@ void disassociate() noexcept; // exposition only ## 概要 非同期スコープとの関連付けを解除する、説明専用のメンバ関数。 -非同期トークン型[`token`]の[`disassociate`](token/disassociate.md)メンバ動作を定義する。 +非同期トークン型[`token`](token.md)の[`disassociate`](token/disassociate.md)メンバ動作を定義する。 ## 事前条件 diff --git a/reference/execution/execution/simple_counting_scope/start-join-sender.md b/reference/execution/execution/simple_counting_scope/start-join-sender.md index 1b5b265b38..6adda69eb6 100644 --- a/reference/execution/execution/simple_counting_scope/start-join-sender.md +++ b/reference/execution/execution/simple_counting_scope/start-join-sender.md @@ -12,6 +12,7 @@ bool start-join-sender(State& st) noexcept; // exposition only ## 概要 合流[Sender](../sender.md)を開始する、説明専用のメンバ関数。 +[`join`](join.md)メンバ関数が返す合流Sender動作を定義する。 ## 効果 @@ -19,7 +20,7 @@ bool start-join-sender(State& st) noexcept; // exposition only - `unused`, `unused-and-closed`, `joined`のとき、`state`を`joined`に変更して`true`を返す。 - `open`, `open-and-joining`のとき、`state`を`open-and-joining`に変更し、`*this`で`st`を登録して`false`を返す。 -- `closed`, `closed-and-joingin`のとき、`state`を`closed-and-joining`に変更し、`*this`で`st`を登録して`false`を返す。 +- `closed`, `closed-and-joining`のとき、`state`を`closed-and-joining`に変更し、`*this`で`st`を登録して`false`を返す。 ## 例外 diff --git a/reference/execution/execution/simple_counting_scope/token.md b/reference/execution/execution/simple_counting_scope/token.md index a32ff7d16c..1542b149d8 100644 --- a/reference/execution/execution/simple_counting_scope/token.md +++ b/reference/execution/execution/simple_counting_scope/token.md @@ -13,6 +13,7 @@ namespace std::execution { ## 概要 `simple_counting_scope::token`は、カウント式非同期スコープの[非同期トークン](../scope_token.md)である。 +非同期トークンは非同期スコープを参照する軽量ハンドラとして振る舞う。 クラス動作説明用のメンバ変数として下記を保持する。 @@ -23,7 +24,7 @@ namespace std::execution { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`wrap`](token/wrap.md) | 非同期スコープと[Sender](../sender.md)関連付けたSenderを返す | C++26 | +| [`wrap`](token/wrap.md) | 非同期スコープと[Sender](../sender.md)を関連付けたSenderを返す | C++26 | | [`try_associate`](token/try_associate.md) | 非同期スコープとの関連付けを試行 | C++26 | | [`disassociate`](token/disassociate.md) | 非同期スコープとの関連付けを解除 | C++26 | diff --git a/reference/execution/execution/simple_counting_scope/token/wrap.md b/reference/execution/execution/simple_counting_scope/token/wrap.md index a873ba32c0..ce95016e51 100644 --- a/reference/execution/execution/simple_counting_scope/token/wrap.md +++ b/reference/execution/execution/simple_counting_scope/token/wrap.md @@ -9,6 +9,7 @@ template Sender&& wrap(Sender&& snd) const noexcept; ``` +* sender[link ../../sender.md] ## 概要 入力[Sender](../../sender.md)を非同期スコープに関連付けたSenderを返す。 diff --git a/reference/execution/execution/simple_counting_scope/try-associate.md b/reference/execution/execution/simple_counting_scope/try-associate.md index 0166940cf0..5f24afbbfd 100644 --- a/reference/execution/execution/simple_counting_scope/try-associate.md +++ b/reference/execution/execution/simple_counting_scope/try-associate.md @@ -11,7 +11,7 @@ bool try-associate() noexcept; // exposition only ## 概要 非同期スコープとの関連付けを試行する、説明専用のメンバ関数。 -非同期トークン型[`token`]の[`try_associate`](token/try_associate.md)メンバ動作を定義する。 +非同期トークン型[`token`](token.md)の[`try_associate`](token/try_associate.md)メンバ動作を定義する。 ## 効果 From 53db61c683f848626a88074adb080eb87a69b7c2 Mon Sep 17 00:00:00 2001 From: yoh Date: Sat, 20 Sep 2025 17:53:48 +0900 Subject: [PATCH 2369/3948] execution: P3149R11 stop-when(#1510) --- .../execution/execution/counting_scope.md | 2 +- .../execution/counting_scope/disassociate.md | 6 --- .../counting_scope/start-join-sender.md | 7 ---- .../execution/counting_scope/token/wrap.md | 2 +- .../execution/counting_scope/try-associate.md | 6 --- .../simple_counting_scope/disassociate.md | 6 --- .../start-join-sender.md | 6 --- .../simple_counting_scope/try-associate.md | 6 --- reference/execution/execution/stop-when.md | 41 +++++++++++++++++++ 9 files changed, 43 insertions(+), 39 deletions(-) create mode 100644 reference/execution/execution/stop-when.md diff --git a/reference/execution/execution/counting_scope.md b/reference/execution/execution/counting_scope.md index 986b5a422d..7e8d4fcb53 100644 --- a/reference/execution/execution/counting_scope.md +++ b/reference/execution/execution/counting_scope.md @@ -18,7 +18,7 @@ namespace std::execution { - `count` : `size_t`型の関連付けカウント値 - `state` : `scope-state-type`列挙型(後述)の状態 -- `s_source` : [`inplace_stop_source`](/reference/stop_token/inplace_stop_source.md)型の停止要求管理オブジェクト +- `s_source` : [`inplace_stop_source`](/reference/stop_token/inplace_stop_source.md)型の停止要求管理オブジェクト ## メンバ関数 diff --git a/reference/execution/execution/counting_scope/disassociate.md b/reference/execution/execution/counting_scope/disassociate.md index dcb449a868..8d94cfda63 100644 --- a/reference/execution/execution/counting_scope/disassociate.md +++ b/reference/execution/execution/counting_scope/disassociate.md @@ -31,12 +31,6 @@ void disassociate() noexcept; // exposition only ### 言語 - C++26 -### 処理系 -- [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? -- [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? - ## 参照 - [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) diff --git a/reference/execution/execution/counting_scope/start-join-sender.md b/reference/execution/execution/counting_scope/start-join-sender.md index 9c63f0c071..e011cf86c2 100644 --- a/reference/execution/execution/counting_scope/start-join-sender.md +++ b/reference/execution/execution/counting_scope/start-join-sender.md @@ -31,12 +31,5 @@ bool start-join-sender(State& st) noexcept; // exposition only ### 言語 - C++26 -### 処理系 -- [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? -- [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? - - ## 参照 - [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) diff --git a/reference/execution/execution/counting_scope/token/wrap.md b/reference/execution/execution/counting_scope/token/wrap.md index 0dd93543d8..6f76a6d95f 100644 --- a/reference/execution/execution/counting_scope/token/wrap.md +++ b/reference/execution/execution/counting_scope/token/wrap.md @@ -23,7 +23,7 @@ sender auto wrap(Sender&& snd) const ```cpp return stop-when(std::forward(snd), scope->s_source.get_token()); ``` -* stop-when[link stop-when.md.nolink] +* stop-when[link ../../stop-when.md] * get_token()[link /reference/stop_token/stop_source/get_token.md] diff --git a/reference/execution/execution/counting_scope/try-associate.md b/reference/execution/execution/counting_scope/try-associate.md index 28f6a52762..592fb90b96 100644 --- a/reference/execution/execution/counting_scope/try-associate.md +++ b/reference/execution/execution/counting_scope/try-associate.md @@ -35,12 +35,6 @@ bool try-associate() noexcept; // exposition only ### 言語 - C++26 -### 処理系 -- [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? -- [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? - ## 参照 - [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) diff --git a/reference/execution/execution/simple_counting_scope/disassociate.md b/reference/execution/execution/simple_counting_scope/disassociate.md index 52eeca3bc4..380f5e7af7 100644 --- a/reference/execution/execution/simple_counting_scope/disassociate.md +++ b/reference/execution/execution/simple_counting_scope/disassociate.md @@ -31,12 +31,6 @@ void disassociate() noexcept; // exposition only ### 言語 - C++26 -### 処理系 -- [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? -- [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? - ## 参照 - [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) diff --git a/reference/execution/execution/simple_counting_scope/start-join-sender.md b/reference/execution/execution/simple_counting_scope/start-join-sender.md index 6adda69eb6..cf58d30d93 100644 --- a/reference/execution/execution/simple_counting_scope/start-join-sender.md +++ b/reference/execution/execution/simple_counting_scope/start-join-sender.md @@ -31,12 +31,6 @@ bool start-join-sender(State& st) noexcept; // exposition only ### 言語 - C++26 -### 処理系 -- [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? -- [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? - ## 参照 - [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) diff --git a/reference/execution/execution/simple_counting_scope/try-associate.md b/reference/execution/execution/simple_counting_scope/try-associate.md index 5f24afbbfd..e297576f76 100644 --- a/reference/execution/execution/simple_counting_scope/try-associate.md +++ b/reference/execution/execution/simple_counting_scope/try-associate.md @@ -35,12 +35,6 @@ bool try-associate() noexcept; // exposition only ### 言語 - C++26 -### 処理系 -- [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? -- [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? - ## 参照 - [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) diff --git a/reference/execution/execution/stop-when.md b/reference/execution/execution/stop-when.md new file mode 100644 index 0000000000..9c0072e42d --- /dev/null +++ b/reference/execution/execution/stop-when.md @@ -0,0 +1,41 @@ +# stop-when +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + inline constexpr unspecified stop-when{}; +} +``` +* unspecified[italic] + +# 概要 +`stop-when`は、入力[Sender](sender.md)に追加の[停止トークン](/reference/stop_token/stop_token.md)を結合したSenderを返す、説明専用のSenderアダプタである。 + +説明用の式`sndr`と`token`に対して、 + +- `decltype((sndr))`が[`sender`](sender.md)を満たさない、もしくは[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``が[`stoppable_token`](/reference/stop_token/stoppable_token.md)を満たさないとき、式`stop-token(sndr, token)`は不適格となる。 +- そうでなく、[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``が[`unstoppable_token`](/reference/stop_token/unstoppable_token.md)のモデルであるとき、式`stop-token(sndr, token)`は`sndr`と等価となる。 +- そうでないとき、式`stop-token(sndr, token)`はSender`osndr`を返す。`osndr`が[Receiver](receiver.md)`r`と[接続(connect)](connect.md)されるとき、[`get_stop_token`](../get_stop_token.md)`(`[`get_env`](get_env.md)`(r))`の結果を`rtoken`とする。 + - `rtoken`の型が[`unstoppable_token`](/reference/stop_token/unstoppable_token.md)のモデルであるとき、`osdnr`と`r`との接続の効果は[`connect`](connect.md)`(`[`write_env`](write_env.md)`(sndr,` [`prop`](prop.md)`(`[`get_stop_token`](../get_stop_token.md)`, token)), r)`に等しい。 + - そうでないとき、下記のような説明専用の型`stoken-t`の`stoken`オブジェクトに対して、`osdnr`と`r`との接続の効果は[`connect`](connect.md)`(`[`write_env`](write_env.md)`(sndr,` [`prop`](prop.md)`(`[`get_stop_token`](../get_stop_token.md)`, stoken)), r)`に等しい。 + - `stoken-t`は[`stoppable_token`](/reference/stop_token/stoppable_token.md)のモデルである。 + - `stoken.stop_requested()`は`token.stop_requested() || rtoken.stop_requested()`を返す。 + - `stoken.stop_possible()`は`token.stop_possible() || rtoken.stop_possible()`を返す。 + - 説明用の型`Fn`と`Init`が[`invocable`](/reference/concepts/invocable.md)``および[`constructible_from`](/reference/concepts/constructible_from.md)``のモデルであるとき、`stoken-t::callback_type`は[`stoppable-callback-for`](/reference/stop_token/stoppable_token.md)のモデルである。 + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`execution::spawn_future`](spawn_future.md.nolink) +- [`execution::counting_scope::token::wrap`](counting_scope/token/wrap.md) + + +## 参照 +- [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) From df84025a1f04eee43286f32a2e937607244aba84 Mon Sep 17 00:00:00 2001 From: yoh Date: Sat, 20 Sep 2025 18:01:40 +0900 Subject: [PATCH 2370/3948] execution/stop-when: fix markup(#1510) --- reference/execution/execution/stop-when.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/execution/execution/stop-when.md b/reference/execution/execution/stop-when.md index 9c0072e42d..15505771c9 100644 --- a/reference/execution/execution/stop-when.md +++ b/reference/execution/execution/stop-when.md @@ -11,7 +11,7 @@ namespace std::execution { ``` * unspecified[italic] -# 概要 +## 概要 `stop-when`は、入力[Sender](sender.md)に追加の[停止トークン](/reference/stop_token/stop_token.md)を結合したSenderを返す、説明専用のSenderアダプタである。 説明用の式`sndr`と`token`に対して、 From b4f048f1c5c31f0cf4d36930d1bf0ec40bffe943 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sat, 20 Sep 2025 22:04:42 +0900 Subject: [PATCH 2371/3948] Create page: fopen_max (#1530) * Create page: fopen_max * Fixed wrong explanations in fopen_max --- reference/cstdio.md | 2 +- reference/cstdio/fopen_max.md | 85 +++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 reference/cstdio/fopen_max.md diff --git a/reference/cstdio.md b/reference/cstdio.md index 5510092ecd..def9b35f10 100644 --- a/reference/cstdio.md +++ b/reference/cstdio.md @@ -23,7 +23,7 @@ | [`_IONBF`](/reference/cstdio/ionbf.md.nolink) | 入出力をバッファリングしない指定のための整数定数 | | | [`BUFSIZ`](/reference/cstdio/bufsiz.md) | バッファサイズを表す整数定数 | | | [`EOF`](/reference/cstdio/eof.md) | ファイルの終端であることを表す`int`型の整数定数 | | -| [`FOPEN_MAX`](/reference/cstdio/fopen_max.md.nolink) | 実装によって保証されるファイルを開ける最低限の数を表す整数定数 | | +| [`FOPEN_MAX`](/reference/cstdio/fopen_max.md) | 実装によって保証されるファイルを開ける最低限の数を表す整数定数 | | | [`FILENAME_MAX`](/reference/cstdio/filename_max.md) | 実装によって保証されるファイル名の最大の長さを表す整数定数 | | | [`L_tmpnam`](/reference/cstdio/l_tmpnam.md.nolink) | `tmpnam()`関数によって作られた一時ファイル名を保持する似に必要な長さを表す整数定数 | | | [`SEEK_SET`](/reference/cstdio/seek_set.md.nolink) | ファイルの先頭位置を指定するための整数定数 | | diff --git a/reference/cstdio/fopen_max.md b/reference/cstdio/fopen_max.md new file mode 100644 index 0000000000..55241d20be --- /dev/null +++ b/reference/cstdio/fopen_max.md @@ -0,0 +1,85 @@ +# FOPEN_MAX +* cstdio[meta header] +* macro[meta id-type] + +```cpp +#define FOPEN_MAX unspecified +``` +* unspecified[italic] + +## 概要 +処理系によって保証されるファイルを同時に開ける最低限の数を表すマクロ。 + +このマクロは、プログラムが同時にオープンできるファイルの最低限の数を定義する。値は実装依存であり、最低でも8以上であることがC標準によって保証されている。実際の実装では、より大きな値(例:16、256など)が使用されることが多い。 + +また、`FOPEN_MAX`は[`TMP_MAX`](/reference/cstdio/tmp_max.md.nolink)と等しいかそれより大きいことが保証される。 + +## 備考 +- この値は最低限の保証値であり、実際にはより多くのファイルを開ける場合がある +- システムリソースやOS固有の制限により、この値未満しかファイルを開けない場合もある +- `FOPEN_MAX`で開けるファイルの数は、標準で開かれている3つのストリームも含むため、実際に新たに開けるファイルの数は`FOPEN_MAX - 3`個となる + +## 例 +```cpp example +#include +#include +#include +#include + +int main() { + // FOPEN_MAXの値を表示 + std::printf("FOPEN_MAX = %d\n", FOPEN_MAX); + + // 作業用ディレクトリを作成 + std::filesystem::path work_dir = "temp_fopen_test"; + std::filesystem::create_directory(work_dir); + + // 複数のファイルを開いてみる(標準ストリーム3つを除く) + std::vector files; + const int max_new_files = FOPEN_MAX - 3; // 標準ストリーム分を除く + + for (int i = 0; i < max_new_files; ++i) { + auto filepath = work_dir / std::format("temp{}.txt", i); + std::FILE* file = std::fopen(filepath.string().c_str(), "w"); + if (file) { + files.push_back(file); + std::fprintf(file, "File %d\n", i); + } else { + std::printf("Failed to open file %d\n", i); + break; + } + } + + std::printf("Successfully opened %zu files\n", files.size()); + + // ファイルを閉じる + for (std::FILE* file : files) { + std::fclose(file); + } + + // 作業用ディレクトリごと削除 + std::filesystem::remove_all(work_dir); + + return 0; +} +``` +* FOPEN_MAX[color ff0000] +* std::printf[link /reference/cstdio/printf.md] +* std::fopen[link /reference/cstdio/fopen.md] +* std::fprintf[link /reference/cstdio/fprintf.md] +* std::fclose[link /reference/cstdio/fclose.md] +* std::format[link /reference/format/format.md] +* std::filesystem::create_directory[link /reference/filesystem/create_directory.md] +* std::filesystem::remove_all[link /reference/filesystem/remove_all.md] + +### 出力例 +``` +FOPEN_MAX = 20 +Successfully opened 17 files +``` + +## 処理系 + +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? \ No newline at end of file From 5ee535663bd10487f16bca44cfce00cecebee232 Mon Sep 17 00:00:00 2001 From: yoh Date: Sun, 21 Sep 2025 01:19:24 +0900 Subject: [PATCH 2372/3948] execution: P3149R11 associate(#1510) --- reference/execution/execution.md | 2 +- reference/execution/execution/associate.md | 287 ++++++++++++++++++ .../counting_scope/token/disassociate.md | 2 +- .../counting_scope/token/try_associate.md | 2 +- .../execution/counting_scope/token/wrap.md | 2 +- .../execution/execution/get-domain-early.md | 2 +- reference/execution/execution/scope_token.md | 2 +- .../token/disassociate.md | 2 +- .../token/try_associate.md | 2 +- .../simple_counting_scope/token/wrap.md | 2 +- 10 files changed, 296 insertions(+), 9 deletions(-) create mode 100644 reference/execution/execution/associate.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index dd27c311b3..74cc78afc8 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -131,7 +131,7 @@ namespace std::execution { | [`execution::into_variant`](execution/into_variant.md) | 複数の値完了シグネチャを単一[`variant`](/reference/variant/variant.md)型の値完了シグネチャに変換 (customization point object) | C++26 | | [`execution::stopped_as_optional`](execution/stopped_as_optional.md) | 入力Senderの停止完了を空の[`optional`](/reference/optional/optional.md)値完了に変換 (customization point object) | C++26 | | [`execution::stopped_as_error`](execution/stopped_as_error.md) | 入力Senderの停止完了をエラー完了に変換 (customization point object) | C++26 | -| [`execution::associate`](execution/associate.md.nolink) | 非同期スコープへの関連付け (customization point object) | C++26 | +| [`execution::associate`](execution/associate.md) | 非同期スコープへの関連付け (customization point object) | C++26 | | [`execution::spawn_future`](execution/spawn_future.md.nolink) | 非同期操作を早期開始 (customization point object) | C++26 | ### Senderコンシューマ diff --git a/reference/execution/execution/associate.md b/reference/execution/execution/associate.md new file mode 100644 index 0000000000..e3dd9d8413 --- /dev/null +++ b/reference/execution/execution/associate.md @@ -0,0 +1,287 @@ +# associate +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct associate_t { unspecified }; + inline constexpr associate_t associate{}; +} +``` +* unspecified[italic] + +## 概要 +`associate`は、入力[Sender](sender.md)と非同期スコープとの関連付けを行うSenderアダプタである。 +関連付けられた非同期スコープは、Senderが作成した非同期操作の生存期間を追跡できる。 + +`associate`は[パイプ可能Senderアダプタオブジェクト](sender_adaptor_closure.md)であり、パイプライン記法をサポートする。 + + +## 効果 +説明用の式`sndr`と`token`に対して、`decltype((sndr))`が[`sender`](sender.md)を満たさない、もしくは[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``が[`scope_token`](scope_token.md)を満たさないとき、呼び出し式`associate(sndr, token)`は不適格となる。 + +そうでなければ、呼び出し式`associate(sndr, token)`は`sndr`が1回だけ評価されることを除いて、下記と等価。 + +```cpp +transform_sender(get-domain-early(sndr), + make-sender(associate, associate-data(token, sndr))) +``` +* transform_sender[link transform_sender.md] +* get-domain-early[link get-domain-early.md] +* make-sender[link make-sender.md] +* associate-data[italic] + +`associate(sndr, token)`の評価は、`token`に関連付けられた非同期スコープオブジェクトを介して観測可能な副作用を引き起こす可能性がある。 + + +### Senderアルゴリズムタグ `associate` +Senderアルゴリズム動作説明用のクラステンプレート[`impls-for`](impls-for.md)に対して、下記の特殊化が定義される。 + +```cpp +namespace std::execution { + template<> + struct impls-for : default-impls { + static constexpr auto get-state = see below; // exposition only + static constexpr auto start = see below; // exposition only + + template + static consteval void check-types() { // exposition only + using associate_data_t = remove_cvref_t>; + using child_type_t = typename associate_data_t::wrap-sender; + (void)get_completion_signatures(); + } + }; +} +``` +* impls-for[link impls-for.md] +* default-impls[link impls-for.md] +* data-type[link data-type.md] +* get_completion_signatures[link get_completion_signatures.md] +* FWD-ENV-T[link ../forwarding_query.md] + +`impls-for::get-state`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 + +```cpp +[](Sndr&& sndr, Rcvr& rcvr) noexcept(see below) { + auto [_, data] = std::forward(sndr); + auto dataParts = std::move(data).release(); + + using scope_tkn = decltype(dataParts->first); + using wrap_sender = decltype(dataParts->second); + using op_t = connect_result_t; + + struct op_state { + bool associated = false; // exposition only + union { + Rcvr* rcvr; // exposition only + struct { + scope_tkn token; // exposition only + op_t op; // exposition only + } assoc; // exposition only + }; + + explicit op_state(Rcvr& r) noexcept + : rcvr(addressof(r)) {} + + explicit op_state(scope_tkn tkn, wrap_sender&& sndr, Rcvr& r) try + : associated(true), + assoc(tkn, connect(std::move(sndr), std::move(r))) { + } + catch (...) { + tkn.disassociate(); + throw; + } + + op_state(op_state&&) = delete; + + ~op_state() { + if (associated) { + assoc.op.~op_t(); + assoc.token.disassociate(); + assoc.token.~scope_tkn(); + } + } + + void run() noexcept { // exposition only + if (associated) + start(assoc.op); + else + set_stopped(std::move(*rcvr)); + } + }; + + if (dataParts) + return op_state{std::move(dataParts->first), std::move(dataParts->second), rcvr}; + else + return op_state{rcvr}; +} +``` +* connect_result_t[link connect_result_t.md] +* connect[link connect.md] +* start[link start.md] +* set_stopped[link set_stopped.md] +* first[link /reference/utility/pair/first.md] +* second[link /reference/utility/pair/second.md] +* std::move[link /reference/utility/move.md] + +`impls-for::get-state`の`noexcept`節の式は下記の通り。 + +```cpp +is_nothrow_constructible_v, Sndr> && +is_nothrow_move_constructible_v && +nothrow-callable +``` +* is_nothrow_constructible_v[link /reference/type_traits/is_nothrow_constructible.md] +* is_nothrow_move_constructible_v[link /reference/type_traits/is_nothrow_move_constructible.md] +* connect_t[link connect.md] +* nothrow-callable[link /reference/functional/nothrow-callable.md] + +`impls-for::start`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 + +```cpp +[](auto& state, auto&) noexcept -> void { + state.run(); +} +``` + + +## 説明専用エンティティ +説明専用の`associate-data`クラスを下記の通り定義する。 + +```cpp +namespace std::execution { + template + struct associate-data { // exposition only + using wrap-sender = // exposition only + remove_cvref_t().wrap(declval()))>; + + explicit associate-data(Token t, Sender&& s) + : sndr(t.wrap(std::forward(s))), + token(t) { + if (!token.try_associate()) + sndr.reset(); + } + + associate-data(const associate-data& other) + noexcept(is_nothrow_copy_constructible_v && + noexcept(other.token.try_associate())); + + associate-data(associate-data&& other) + noexcept(is_nothrow_move_constructible_v); + + ~associate-data(); + + optional> + release() && noexcept(is_nothrow_move_constructible_v); + + private: + optional sndr; // exposition only + Token token; // exposition only + }; + + template + associate-data(Token, Sender&&) -> associate-data; +} +``` +* scope_token[link scope_token.md] +* sender[link sender.md] +* is_nothrow_copy_constructible_v[link /reference/type_traits/is_nothrow_copy_constructible.md] +* is_nothrow_move_constructible_v[link /reference/type_traits/is_nothrow_move_constructible.md] +* optional[link /reference/optional/optional.md] + +`associate-data`型のオブジェクト`a`に対して、関連付けが正常に行われかつ`a`により所有される場合に限って、`a.sndr.`[`has_value()`](/reference/optional/optional/has_value.md)は`true`となる。 + +```cpp +associate-data(const associate-data& other) + noexcept(is_nothrow_copy_constructible_v && + noexcept(other.token.try_associate())); +``` +* is_nothrow_copy_constructible_v[link /reference/type_traits/is_nothrow_copy_constructible.md] + +- テンプレートパラメータ制約 : [`copy_constructible`](/reference/concepts/copy_constructible.md)` == true` +- 効果 : `sndr`を値初期化し、`token`を`other.token`で初期化する。`other.sndr.`[`has_value()`](/reference/optional/optional/has_value.md) `== false`ならば、それ以上の効果を持たない。そうでなければ、`token.try_associate()`を呼び出し、戻り値が`true`ならば`sndr.`[`emplace`](/reference/optional/optional/emplace.md)`(*other.sndr)`を呼び出し、例外で終了するときは例外を伝播させる前に`token.disassociate()`を呼び出す。 + +```cpp +associate-data(associate-data&& other) + noexcept(is_nothrow_move_constructible_v); +``` +* is_nothrow_move_constructible_v[link /reference/type_traits/is_nothrow_move_constructible.md] + +- 効果 : `sndr`を[`std::move`](/reference/utility/move.md)`(other.sndr)`で、`token`を`std::move(otehr.token)`で初期化したのち、`other.sndr.`[`reset()`](/reference/optional/optional/reset.md)を呼び出す。 + +```cpp +~associate-data(); +``` + +- 効果 : `sndr.`[`has_value()`](/reference/optional/optional/has_value.md)が`false`を返すとき、何もしない。そうでなければ、`token.disassociate()`呼び出しの前に`sndr.`[`reset()`](/reference/optional/optional/reset.md)を呼び出す。 + +```cpp +optional> + release() && noexcept(is_nothrow_move_constructible_v); +``` +* optional[link /reference/optional/optional.md] +* is_nothrow_move_constructible_v[link /reference/type_traits/is_nothrow_move_constructible.md] + +- 効果 : `sndr.`[`has_value()`](/reference/optional/optional/has_value.md)が`false`を返すとき、値を保持しない[`optional`](/reference/optional/optional.md)を返す。そうでなければ、次のように[`pair`](/reference/utility/pair.md)``型の値を保持する`optional`を返す。 + + ```cpp + return optional(pair(token, std::move(*sndr))); + ``` + * optional[link /reference/optional/optional.md] + * std::move[link /reference/utility/move.md] + +- 事後条件 : `sndr`は値を保持しない。 + + +## カスタマイゼーションポイント +Senderアルゴリズム構築時および[Receiver](receiver.md)接続時に、関連付けられた実行ドメインに対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 +[デフォルト実行ドメイン](default_domain.md)では無変換。 + + +## 例 +```cpp example +#include +namespace ex = std::execution; + +int main() +{ + ex::counting_scope scope; + ex::sender auto sndr = + ex::just(42) + | ex::associate(scope.get_token()); + + std::this_thread::sync_wait(sndr); +} +``` +* ex::associate[color ff0000] +* ex::counting_scope[link counting_scope.md] +* ex::just[link just.md] +* ex::sender[link sender.md] +* std::this_thread::sync_wait[link ../this_thread/sync_wait.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::scope_token`](scope_token.md) + + +## 参照 +- [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) +- [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) diff --git a/reference/execution/execution/counting_scope/token/disassociate.md b/reference/execution/execution/counting_scope/token/disassociate.md index 164c4e12bd..fc09036bb7 100644 --- a/reference/execution/execution/counting_scope/token/disassociate.md +++ b/reference/execution/execution/counting_scope/token/disassociate.md @@ -38,7 +38,7 @@ scope->disassociate() ## 関連項目 -- [`execution::associate`](../../associate.md.nolink) +- [`execution::associate`](../../associate.md) - [`execution::spawn_future`](../../spawn_future.md.nolink) - [`execution::spawn`](../../spawn.md.nolink) diff --git a/reference/execution/execution/counting_scope/token/try_associate.md b/reference/execution/execution/counting_scope/token/try_associate.md index 0d4dc5a4b7..5bde327af6 100644 --- a/reference/execution/execution/counting_scope/token/try_associate.md +++ b/reference/execution/execution/counting_scope/token/try_associate.md @@ -38,7 +38,7 @@ return scope->try-associate(); ## 関連項目 -- [`execution::associate`](../../associate.md.nolink) +- [`execution::associate`](../../associate.md) - [`execution::spawn_future`](../../spawn_future.md.nolink) - [`execution::spawn`](../../spawn.md.nolink) diff --git a/reference/execution/execution/counting_scope/token/wrap.md b/reference/execution/execution/counting_scope/token/wrap.md index 6f76a6d95f..73588bf959 100644 --- a/reference/execution/execution/counting_scope/token/wrap.md +++ b/reference/execution/execution/counting_scope/token/wrap.md @@ -39,7 +39,7 @@ return stop-when(std::forward(snd), scope->s_source.get_token()); ## 関連項目 -- [`execution::associate`](../../associate.md.nolink) +- [`execution::associate`](../../associate.md) - [`execution::spawn_future`](../../spawn_future.md.nolink) - [`execution::spawn`](../../spawn.md.nolink) diff --git a/reference/execution/execution/get-domain-early.md b/reference/execution/execution/get-domain-early.md index 57875cca84..b0f50fc3a7 100644 --- a/reference/execution/execution/get-domain-early.md +++ b/reference/execution/execution/get-domain-early.md @@ -45,7 +45,7 @@ constexpr auto get-domain-early(const Sndr& sndr) noexcept; - [`execution::into_variant`](into_variant.md) - [`execution::stopped_as_optional`](stopped_as_optional.md) - [`execution::stopped_as_error`](stopped_as_error.md) -- [`execution::associate`](associate.md.nolink) +- [`execution::associate`](associate.md) - [`execution::affine_on`](affine_on.md.nolink) - [`this_thread::sync_wait`](../this_thread/sync_wait.md) - [`this_thread::sync_wait_with_variant`](../this_thread/sync_wait_with_variant.md) diff --git a/reference/execution/execution/scope_token.md b/reference/execution/execution/scope_token.md index f44f23393e..297e25d02a 100644 --- a/reference/execution/execution/scope_token.md +++ b/reference/execution/execution/scope_token.md @@ -68,7 +68,7 @@ int main() ## 関連項目 -- [`execution::associate`](associate.md.nolink) +- [`execution::associate`](associate.md) - [`execution::spawn_future`](spawn_future.md.nolink) - [`execution::spawn`](spawn.md.nolink) diff --git a/reference/execution/execution/simple_counting_scope/token/disassociate.md b/reference/execution/execution/simple_counting_scope/token/disassociate.md index 1c9e3414ae..6aa05a1772 100644 --- a/reference/execution/execution/simple_counting_scope/token/disassociate.md +++ b/reference/execution/execution/simple_counting_scope/token/disassociate.md @@ -38,7 +38,7 @@ scope->disassociate() ## 関連項目 -- [`execution::associate`](../../associate.md.nolink) +- [`execution::associate`](../../associate.md) - [`execution::spawn_future`](../../spawn_future.md.nolink) - [`execution::spawn`](../../spawn.md.nolink) diff --git a/reference/execution/execution/simple_counting_scope/token/try_associate.md b/reference/execution/execution/simple_counting_scope/token/try_associate.md index 3784a30704..5b0f184c46 100644 --- a/reference/execution/execution/simple_counting_scope/token/try_associate.md +++ b/reference/execution/execution/simple_counting_scope/token/try_associate.md @@ -38,7 +38,7 @@ return scope->try-associate(); ## 関連項目 -- [`execution::associate`](../../associate.md.nolink) +- [`execution::associate`](../../associate.md) - [`execution::spawn_future`](../../spawn_future.md.nolink) - [`execution::spawn`](../../spawn.md.nolink) diff --git a/reference/execution/execution/simple_counting_scope/token/wrap.md b/reference/execution/execution/simple_counting_scope/token/wrap.md index ce95016e51..495fa00758 100644 --- a/reference/execution/execution/simple_counting_scope/token/wrap.md +++ b/reference/execution/execution/simple_counting_scope/token/wrap.md @@ -35,7 +35,7 @@ Sender&& wrap(Sender&& snd) const noexcept; ## 関連項目 -- [`execution::associate`](../../associate.md.nolink) +- [`execution::associate`](../../associate.md) - [`execution::spawn_future`](../../spawn_future.md.nolink) - [`execution::spawn`](../../spawn.md.nolink) From e7aa9c880a4d36c0e299ceb3020901a7ed424f3c Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 22 Sep 2025 11:51:16 +0900 Subject: [PATCH 2373/3948] =?UTF-8?q?execution/associate:=20=E8=AA=AC?= =?UTF-8?q?=E6=98=8E=E5=A2=97=E8=A3=9C,=E4=BE=8B=E7=A4=BA=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20(#1510)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/execution/execution/associate.md | 46 +++++++++++++++++--- reference/execution/execution/scope_token.md | 1 + 2 files changed, 40 insertions(+), 7 deletions(-) diff --git a/reference/execution/execution/associate.md b/reference/execution/execution/associate.md index e3dd9d8413..34a4882116 100644 --- a/reference/execution/execution/associate.md +++ b/reference/execution/execution/associate.md @@ -18,6 +18,24 @@ namespace std::execution { `associate`は[パイプ可能Senderアダプタオブジェクト](sender_adaptor_closure.md)であり、パイプライン記法をサポートする。 +`associate`アルゴリズムが返す関連Sender(associate-sender)は、[非同期スコープトークン](scope_token.md)を介した関連付け試行(`try_associate`)の結果に応じてassociated/unassociatedいずれかの状態となり、入力Senderの動作を継承したうえで下記のように振る舞う。 + +- associated状態 + - 関連Senderは入力Senderと同じ完了シグネチャを持ち、関連Senderとの[接続(connect)](connect.md)や[開始(start)](start.md)によって入力Senderとの接続や開始が行われる。 + - 関連Senderオブジェクトが破棄、もしくは接続後の[Operation State](operation_state.md)が破棄されたとき、関連付けを解除する。 + - [非同期スコープトークン](scope_token.md)の`wrap`メンバ関数で追加される処理を行う。 +- unassociated状態 : + - 入力Senderは破棄され、[接続(connect)](connect.md)も[開始(start)](start.md)もされない。 + - 関連Senderは[set_stopped](set_stopped.md)のみで完了する。 + +associated状態の関連Senderに対する[接続(connect)](connect.md)操作は、下記いずれかの結果となる。 + +- 右辺値接続(rvalue connected)のとき、入力Senderとの関連付けは[Operation State](operation_state.md)へ移動する。 +- 左辺値接続(lvalue connected)のとき、[Operation State](operation_state.md)は非同期スコープとの新たな関連付けを必要とするため、[非同期スコープトークン](scope_token.md)の`try_associate`を呼び出して下記のいずれかの結果となる。 + - 新たな関連付けに成功する(戻り値が`true`)。 + - 関連付けに失敗し(戻り値が`false`)、[Operation State](operation_state.md)はunassociated状態の関連Senderから構築されたかのように振る舞う([開始(start)](start.md)操作により即時で[停止完了](set_stopped.md)する)。 + - 例外送出によって接続操作に失敗する。 + ## 効果 説明用の式`sndr`と`token`に対して、`decltype((sndr))`が[`sender`](sender.md)を満たさない、もしくは[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``が[`scope_token`](scope_token.md)を満たさないとき、呼び出し式`associate(sndr, token)`は不適格となる。 @@ -47,10 +65,10 @@ namespace std::execution { static constexpr auto start = see below; // exposition only template - static consteval void check-types() { // exposition only - using associate_data_t = remove_cvref_t>; - using child_type_t = typename associate_data_t::wrap-sender; - (void)get_completion_signatures(); + static consteval void check-types() { // exposition only + using associate_data_t = remove_cvref_t>; + using child_type_t = typename associate_data_t::wrap-sender; + (void)get_completion_signatures(); } }; } @@ -190,6 +208,7 @@ namespace std::execution { * is_nothrow_copy_constructible_v[link /reference/type_traits/is_nothrow_copy_constructible.md] * is_nothrow_move_constructible_v[link /reference/type_traits/is_nothrow_move_constructible.md] * optional[link /reference/optional/optional.md] +* reset()[link /reference/optional/optional/reset.md] `associate-data`型のオブジェクト`a`に対して、関連付けが正常に行われかつ`a`により所有される場合に限って、`a.sndr.`[`has_value()`](/reference/optional/optional/has_value.md)は`true`となる。 @@ -243,26 +262,39 @@ Senderアルゴリズム構築時および[Receiver](receiver.md)接続時に、 ## 例 ```cpp example #include +#include namespace ex = std::execution; int main() { + // 非同期スコープを定義 ex::counting_scope scope; + + // Senderと非同期スコープを関連付け ex::sender auto sndr = ex::just(42) | ex::associate(scope.get_token()); - std::this_thread::sync_wait(sndr); + // タスク開始と完了待機 + auto result = std::this_thread::sync_wait(std::move(sndr)); + std::println("value={}", *result); + + // 非同期スコープの合流待機 + std::this_thread::sync_wait(scope.join()); } ``` * ex::associate[color ff0000] -* ex::counting_scope[link counting_scope.md] -* ex::just[link just.md] * ex::sender[link sender.md] +* ex::just[link just.md] +* ex::counting_scope[link counting_scope.md] +* get_token()[link counting_scope/get_token.md] +* join()[link counting_scope/join.md] * std::this_thread::sync_wait[link ../this_thread/sync_wait.md] +* std::move[link /reference/utility/move.md] ### 出力 ``` +value=42 ``` diff --git a/reference/execution/execution/scope_token.md b/reference/execution/execution/scope_token.md index 297e25d02a..b486553837 100644 --- a/reference/execution/execution/scope_token.md +++ b/reference/execution/execution/scope_token.md @@ -50,6 +50,7 @@ int main() ``` * ex::scope_token[color ff0000] * ex::counting_scope[link counting_scope.md] +* get_token()[link counting_scope/get_token.md] ### 出力 ``` From eed390c6fd2ec57d1679f7219b657a07af23adee Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 22 Sep 2025 13:42:00 +0900 Subject: [PATCH 2374/3948] =?UTF-8?q?execution/associate:=20=E8=AA=BF?= =?UTF-8?q?=E6=95=B4=20(#1510)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/execution/execution/associate.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reference/execution/execution/associate.md b/reference/execution/execution/associate.md index 34a4882116..ff4ac5f41e 100644 --- a/reference/execution/execution/associate.md +++ b/reference/execution/execution/associate.md @@ -144,7 +144,7 @@ namespace std::execution { * second[link /reference/utility/pair/second.md] * std::move[link /reference/utility/move.md] -`impls-for::get-state`の`noexcept`節の式は下記の通り。 +`impls-for::get-state`の`noexcept`節の式は、型`wrap-sender`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`>::wrap-sender`としたとき、下記の通り。 ```cpp is_nothrow_constructible_v, Sndr> && @@ -277,7 +277,8 @@ int main() // タスク開始と完了待機 auto result = std::this_thread::sync_wait(std::move(sndr)); - std::println("value={}", *result); + auto [val] = result.value(); + std::println("value={}", val); // 非同期スコープの合流待機 std::this_thread::sync_wait(scope.join()); @@ -290,6 +291,7 @@ int main() * get_token()[link counting_scope/get_token.md] * join()[link counting_scope/join.md] * std::this_thread::sync_wait[link ../this_thread/sync_wait.md] +* value()[link /reference/optional/optional/value.md] * std::move[link /reference/utility/move.md] ### 出力 From 911f1dc2a25093dc7ba95c9b29fc69dca2862a2e Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 22 Sep 2025 17:17:37 +0900 Subject: [PATCH 2375/3948] =?UTF-8?q?execution/start:=20=E5=BE=AE=E8=AA=BF?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/execution/execution/start.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/execution/execution/start.md b/reference/execution/execution/start.md index ea0c3623e1..6081a38a35 100644 --- a/reference/execution/execution/start.md +++ b/reference/execution/execution/start.md @@ -19,13 +19,13 @@ namespace std::execution { 式`start(op)`は、`op`が右辺値の場合は不適格となる。 そうでなければ、`op.start()`と等価。 -`op.start()`が[Operation State](operation_state.md)に関連付けられた非同期操作を開始しない場合、式`start(op)`の動作は未定義となる。 - ## カスタマイゼーションポイント [Operation State](operation_state.md)`op`に対して式`op.start()`が呼び出される。 このとき`noexcept(op.start()) == true`であること。 +`op.start()`が[Operation State](operation_state.md)に関連付けられた非同期操作を開始しない場合、式`start(op)`の動作は未定義となる。 + ## 備考 `start`は[Sender](sender.md)内部実装から呼び出される想定であり、実行制御ライブラリ利用者が直接利用する必要はない。 From 8d46680d8b86f0c0e1cf6e743d449e2230936c1f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 22 Sep 2025 17:59:17 +0900 Subject: [PATCH 2376/3948] =?UTF-8?q?atomic(=5Fref)=20:=20C++26=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C=E3=81=A8=E3=81=97=E3=81=A6=E6=B5=AE=E5=8B=95=E5=B0=8F?= =?UTF-8?q?=E6=95=B0=E7=82=B9=E6=95=B0=E3=81=AEfmax=20/=20fmin=E9=96=A2?= =?UTF-8?q?=E9=80=A3=E3=82=92=E8=BF=BD=E5=8A=A0=20#1514?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 8 +-- reference/atomic/atomic.md | 22 +++--- reference/atomic/atomic/fetch_fmaximum.md | 71 ++++++++++++++++++ reference/atomic/atomic/fetch_fmaximum_num.md | 71 ++++++++++++++++++ reference/atomic/atomic/fetch_fminimum.md | 71 ++++++++++++++++++ reference/atomic/atomic/fetch_fminimum_num.md | 71 ++++++++++++++++++ reference/atomic/atomic/fetch_max.md | 27 ++++--- reference/atomic/atomic/fetch_min.md | 23 ++++-- reference/atomic/atomic_ref.md | 22 +++--- reference/atomic/atomic_ref/fetch_fmaximum.md | 72 +++++++++++++++++++ .../atomic/atomic_ref/fetch_fmaximum_num.md | 72 +++++++++++++++++++ reference/atomic/atomic_ref/fetch_fminimum.md | 72 +++++++++++++++++++ .../atomic/atomic_ref/fetch_fminimum_num.md | 72 +++++++++++++++++++ reference/atomic/atomic_ref/fetch_max.md | 25 ++++--- reference/atomic/atomic_ref/fetch_min.md | 14 ++-- 15 files changed, 665 insertions(+), 48 deletions(-) create mode 100644 reference/atomic/atomic/fetch_fmaximum.md create mode 100644 reference/atomic/atomic/fetch_fmaximum_num.md create mode 100644 reference/atomic/atomic/fetch_fminimum.md create mode 100644 reference/atomic/atomic/fetch_fminimum_num.md create mode 100644 reference/atomic/atomic_ref/fetch_fmaximum.md create mode 100644 reference/atomic/atomic_ref/fetch_fmaximum_num.md create mode 100644 reference/atomic/atomic_ref/fetch_fminimum.md create mode 100644 reference/atomic/atomic_ref/fetch_fminimum_num.md diff --git a/lang/cpp26.md b/lang/cpp26.md index 7fb2edb422..c3bc09312e 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -292,10 +292,10 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - メンバ関数 - [`fetch_max()`](/reference/atomic/atomic/fetch_max.md) - [`fetch_min()`](/reference/atomic/atomic/fetch_min.md) - - [`fetch_fmaximum()`](/reference/atomic/atomic/fetch_fmaximum.md.nolink) (浮動小数点数用) - - [`fetch_fminimum()`](/reference/atomic/atomic/fetch_fminimum.md.nolink) (浮動小数点数用) - - [`fetch_fmaximum_num()`](/reference/atomic/atomic/fetch_fmaximum_num.md.nolink) (浮動小数点数用) - - [`fetch_fminimum_num()`](/reference/atomic/atomic/fetch_fminimum_num.md.nolink) (浮動小数点数用) + - [`fetch_fmaximum()`](/reference/atomic/atomic/fetch_fmaximum.md) (浮動小数点数用) + - [`fetch_fminimum()`](/reference/atomic/atomic/fetch_fminimum.md) (浮動小数点数用) + - [`fetch_fmaximum_num()`](/reference/atomic/atomic/fetch_fmaximum_num.md) (浮動小数点数用) + - [`fetch_fminimum_num()`](/reference/atomic/atomic/fetch_fminimum_num.md) (浮動小数点数用) - 非メンバ関数として - [`std::atomic_fetch_max()`](/reference/atomic/atomic_fetch_max.md) - [`std::atomic_fetch_max_explicit()`](/reference/atomic/atomic_fetch_max_explicit.md) diff --git a/reference/atomic/atomic.md b/reference/atomic/atomic.md index 3b03104d2a..29626a1987 100644 --- a/reference/atomic/atomic.md +++ b/reference/atomic/atomic.md @@ -162,8 +162,8 @@ namespace std { | [`fetch_and`](atomic/fetch_and.md) | AND演算 | C++11 | | [`fetch_or`](atomic/fetch_or.md) | OR演算 | C++11 | | [`fetch_xor`](atomic/fetch_xor.md) | XOR演算 | C++11 | -| [`fetch_max`](atomic/fetch_max.md) | 最大値取得 | C++26 | -| [`fetch_min`](atomic/fetch_min.md) | 最小値取得 | C++26 | +| [`fetch_max`](atomic/fetch_max.md) | 最大値を設定・取得 | C++26 | +| [`fetch_min`](atomic/fetch_min.md) | 最小値を設定・取得 | C++26 | | [`operator++`](atomic/op_increment.md) | インクリメント | C++11 | | [`operator--`](atomic/op_decrement.md) | デクリメント | C++11 | | [`operator+=`](atomic/op_plus_assign.md) | 加算 | C++11 | @@ -184,10 +184,16 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`fetch_add`](atomic/fetch_add.md) | 加算 | C++20 | -| [`fetch_sub`](atomic/fetch_sub.md) | 減算 | C++20 | -| [`operator+=`](atomic/op_plus_assign.md) | 加算 | C++20 | -| [`operator-=`](atomic/op_minus_assign.md) | 減算 | C++20 | +| [`fetch_add`](atomic/fetch_add.md) | 加算 | C++20 | +| [`fetch_sub`](atomic/fetch_sub.md) | 減算 | C++20 | +| [`fetch_max`](atomic/fetch_max.md) | 最大値を設定・取得 | C++26 | +| [`fetch_min`](atomic/fetch_min.md) | 最小値を設定・取得 | C++26 | +| [`fetch_fmaximum`](atomic/fetch_fmaximum.md) | 最大値を設定・取得 (`-0.0`と`+0.0`では`+0.0`、NaNと値ではNaNを返す) | C++26 | +| [`fetch_fminimum`](atomic/fetch_fminimum.md) | 最小値を設定・取得 (`-0.0`と`+0.0`では`-0.0`、NaNと値ではNaNを返す) | C++26 | +| [`fetch_fmaximum_num`](atomic/fetch_fmaximum_num.md) | 最大値を設定・取得 (`-0.0`と`+0.0`では`+0.0`、NaNと値では数値を返す) | C++26 | +| [`fetch_fminimum_num`](atomic/fetch_fminimum_num.md) | 最小値を設定・取得 (`-0.0`と`+0.0`では`-0.0`、NaNと値では数値を返す) | C++26 | +| [`operator+=`](atomic/op_plus_assign.md) | 加算 | C++20 | +| [`operator-=`](atomic/op_minus_assign.md) | 減算 | C++20 | ### atomic<floating-point>専用メンバ型 @@ -203,8 +209,8 @@ namespace std { |------|------|----------------| | [`fetch_add`](atomic/fetch_add.md) | 加算 | C++11 | | [`fetch_sub`](atomic/fetch_sub.md) | 減算 | C++11 | -| [`fetch_max`](atomic/fetch_max.md) | 最大値取得 | C++26 | -| [`fetch_min`](atomic/fetch_min.md) | 最小値取得 | C++26 | +| [`fetch_max`](atomic/fetch_max.md) | 最大値を設定・取得 | C++26 | +| [`fetch_min`](atomic/fetch_min.md) | 最小値を設定・取得 | C++26 | | [`operator++`](atomic/op_increment.md) | インクリメント | C++11 | | [`operator--`](atomic/op_decrement.md) | デクリメント | C++11 | | [`operator+=`](atomic/op_plus_assign.md) | 加算 | C++11 | diff --git a/reference/atomic/atomic/fetch_fmaximum.md b/reference/atomic/atomic/fetch_fmaximum.md new file mode 100644 index 0000000000..447615226a --- /dev/null +++ b/reference/atomic/atomic/fetch_fmaximum.md @@ -0,0 +1,71 @@ +# fetch_fmaximum +* atomic[meta header] +* std[meta namespace] +* atomic[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr T + fetch_fmaximum(difference_type operand, + memory_order order = memory_order_seq_cst + ) const noexcept; // (1) C++26 +``` +* memory_order[link /reference/atomic/memory_order.md] +* memory_order_seq_cst[link /reference/atomic/memory_order.md] + +## 概要 +最大値を設定・取得する。 + +この関数は、`*this`が保持する値と`operand`の大きい方を求め、その値を`this`に保持させた上でその値を返す。 + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、`*this`が保持する値と`operand`の最大値を求めて、その値を`this`に保持させ、その値を返す + + +## 例外 +投げない + + +## 備考 +- この関数は、`atomic`クラスの浮動小数点数型に対する特殊化で定義される +- 浮動小数点数型 + - [`std::fmaximum()`](/reference/cmath/fmaximum.md)関数と同様の動作をする + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::atomic x(2); + + int ret = x.fetch_fmaximum(3); + + std::cout << ret << std::endl; + std::cout << x.load() << std::endl; +} +``` +* fetch_fmaximum[color ff0000] +* load()[link load.md] + +### 出力 +``` +3 +3 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] + + +## 参照 +- [P3008R6 Atomic floating-point min/max](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3008r6.html) \ No newline at end of file diff --git a/reference/atomic/atomic/fetch_fmaximum_num.md b/reference/atomic/atomic/fetch_fmaximum_num.md new file mode 100644 index 0000000000..c499fc0a17 --- /dev/null +++ b/reference/atomic/atomic/fetch_fmaximum_num.md @@ -0,0 +1,71 @@ +# fetch_fmaximum_num +* atomic[meta header] +* std[meta namespace] +* atomic[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr T + fetch_fmaximum_num(difference_type operand, + memory_order order = memory_order_seq_cst + ) const noexcept; // (1) C++26 +``` +* memory_order[link /reference/atomic/memory_order.md] +* memory_order_seq_cst[link /reference/atomic/memory_order.md] + +## 概要 +最大値を設定・取得する。 + +この関数は、`*this`が保持する値と`operand`の大きい方を求め、その値を`this`に保持させた上でその値を返す。 + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、`*this`が保持する値と`operand`の最大値を求めて、その値を`this`に保持させ、その値を返す + + +## 例外 +投げない + + +## 備考 +- この関数は、`atomic`クラスの浮動小数点数型に対する特殊化で定義される +- 浮動小数点数型 + - [`std::fmaximum_num()`](/reference/cmath/fmaximum_num.md)関数と同様の動作をする + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::atomic x(2); + + int ret = x.fetch_fmaximum_num(3); + + std::cout << ret << std::endl; + std::cout << x.load() << std::endl; +} +``` +* fetch_fmaximum_num[color ff0000] +* load()[link load.md] + +### 出力 +``` +3 +3 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] + + +## 参照 +- [P3008R6 Atomic floating-point min/max](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3008r6.html) \ No newline at end of file diff --git a/reference/atomic/atomic/fetch_fminimum.md b/reference/atomic/atomic/fetch_fminimum.md new file mode 100644 index 0000000000..86f37e0743 --- /dev/null +++ b/reference/atomic/atomic/fetch_fminimum.md @@ -0,0 +1,71 @@ +# fetch_fminimum +* atomic[meta header] +* std[meta namespace] +* atomic[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr T + fetch_fminimum(difference_type operand, + memory_order order = memory_order_seq_cst + ) const noexcept; // (1) C++26 +``` +* memory_order[link /reference/atomic/memory_order.md] +* memory_order_seq_cst[link /reference/atomic/memory_order.md] + +## 概要 +最小値を設定・取得する。 + +この関数は、`*this`が保持する値と`operand`の小さい方を求め、その値を`this`に保持させた上でその値を返す。 + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、`*this`が保持する値と`operand`の最小値を求めて、その値を`this`に保持させ、その値を返す + + +## 例外 +投げない + + +## 備考 +- この関数は、`atomic`クラスの浮動小数点数型に対する特殊化で定義される +- 浮動小数点数型 + - [`std::fminimum()`](/reference/cmath/fminimum.md)関数と同様の動作をする + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::atomic x(3); + + int ret = x.fetch_fminimum(2); + + std::cout << ret << std::endl; + std::cout << x.load() << std::endl; +} +``` +* fetch_fminimum[color ff0000] +* load()[link load.md] + +### 出力 +``` +2 +2 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] + + +## 参照 +- [P3008R6 Atomic floating-point min/max](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3008r6.html) \ No newline at end of file diff --git a/reference/atomic/atomic/fetch_fminimum_num.md b/reference/atomic/atomic/fetch_fminimum_num.md new file mode 100644 index 0000000000..e99f282afc --- /dev/null +++ b/reference/atomic/atomic/fetch_fminimum_num.md @@ -0,0 +1,71 @@ +# fetch_fminimum_num +* atomic[meta header] +* std[meta namespace] +* atomic[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr T + fetch_fminimum_num(difference_type operand, + memory_order order = memory_order_seq_cst + ) const noexcept; // (1) C++26 +``` +* memory_order[link /reference/atomic/memory_order.md] +* memory_order_seq_cst[link /reference/atomic/memory_order.md] + +## 概要 +最小値を設定・取得する。 + +この関数は、`*this`が保持する値と`operand`の小さい方を求め、その値を`this`に保持させた上でその値を返す。 + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、`*this`が保持する値と`operand`の最小値を求めて、その値を`this`に保持させ、その値を返す + + +## 例外 +投げない + + +## 備考 +- この関数は、`atomic`クラスの浮動小数点数型に対する特殊化で定義される +- 浮動小数点数型 + - [`std::fminimum_num()`](/reference/cmath/fminimum_num.md)関数と同様の動作をする + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::atomic x(3); + + int ret = x.fetch_fminimum_num(2); + + std::cout << ret << std::endl; + std::cout << x.load() << std::endl; +} +``` +* fetch_fminimum_num[color ff0000] +* load()[link load.md] + +### 出力 +``` +2 +2 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] + + +## 参照 +- [P3008R6 Atomic floating-point min/max](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3008r6.html) \ No newline at end of file diff --git a/reference/atomic/atomic/fetch_max.md b/reference/atomic/atomic/fetch_max.md index 117fb1640e..8d63dfd8d2 100644 --- a/reference/atomic/atomic/fetch_max.md +++ b/reference/atomic/atomic/fetch_max.md @@ -15,9 +15,9 @@ constexpr T * memory_order_seq_cst[link /reference/atomic/memory_order.md] ## 概要 -最大値を取得する。 +最大値を設定・取得する。 -この関数は、`*this`が保持する値と`operand`の大きい方を返す。 +この関数は、`*this`が保持する値と`operand`の大きい方を求め、その値を`this`に保持させた上でその値を返す。 ## テンプレートパラメータ制約 @@ -25,7 +25,7 @@ constexpr T ## 効果 -`order`で指定されたメモリオーダーにしたがって、[`std::max()`](/reference/algorithm/max.md)アルゴリズムのように`*this`が保持する値と`operand`の最大値を求めて返す +`order`で指定されたメモリオーダーにしたがって、[`std::max()`](/reference/algorithm/max.md)アルゴリズムのように`*this`が保持する値と`operand`の最大値を求めて、その値を`this`に保持させ、その値を返す ## 例外 @@ -33,7 +33,13 @@ constexpr T ## 備考 -- この関数は、`atomic`クラスの整数型、ポインタに対する特殊化で定義される (浮動小数点数型に対しては定義されない) +- この関数は、`atomic`クラスの整数型、浮動小数点数型、ポインタに対する特殊化で定義される +- 浮動小数点数型 + - [`std::fmaximum_num()`](/reference/cmath/fmaximum_num.md)関数と同様の動作をするが、以下の点で異なる: + - 両方のパラメータが`NaN`である場合、`this`が指す値は未規定のNaN値に置き換えられる + - 一方のパラメータだけが`NaN`である場合、`this`が指す値はもう一方のパラメータ、または未規定のNaN値に置き換えられるが、どちらに置き換えられるかは未規定 + - パラメータが異なる符号のゼロである場合、`this`が指す値がどちらに置き換えられるかは未規定 + - 処理系への推奨としては、負のゼロを正のゼロより小さいものとして扱うべきである - ポインタ型 - ポインタが異なる完全型オブジェクトを指している場合、`<`演算子による比較は狭義の弱順序を確立しない @@ -45,19 +51,21 @@ constexpr T int main() { - std::atomic x(3); + std::atomic x(2); - int ret = x.fetch_max(2); + int ret = x.fetch_max(3); std::cout << ret << std::endl; + std::cout << x.load() << std::endl; } ``` * fetch_max[color ff0000] - +* load()[link load.md] ### 出力 ``` 3 +3 ``` ## バージョン @@ -65,10 +73,11 @@ int main() - C++26 ### 処理系 -- [Clang](/implementation.md#clang): 19 [mark noimpl] -- [GCC](/implementation.md#gcc): 14 [mark noimpl] +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] ## 参照 - [P0493R5 Atomic minimum/maximum](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0493r5.pdf) - [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) +- [P3008R6 Atomic floating-point min/max](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3008r6.html) \ No newline at end of file diff --git a/reference/atomic/atomic/fetch_min.md b/reference/atomic/atomic/fetch_min.md index e813120f4b..adb6e69d15 100644 --- a/reference/atomic/atomic/fetch_min.md +++ b/reference/atomic/atomic/fetch_min.md @@ -15,9 +15,9 @@ constexpr T * memory_order_seq_cst[link /reference/atomic/memory_order.md] ## 概要 -最小値を取得する。 +最小値を設定・取得する。 -この関数は、`*this`が保持する値と`operand`の大きい方を返す。 +この関数は、`*this`が保持する値と`operand`の小さい方を求め、その値を`this`に保持させた上でその値を返す。 ## テンプレートパラメータ制約 @@ -25,7 +25,7 @@ constexpr T ## 効果 -`order`で指定されたメモリオーダーにしたがって、[`std::min()`](/reference/algorithm/min.md)アルゴリズムのように`*this`が保持する値と`operand`の最小値を求めて返す +`order`で指定されたメモリオーダーにしたがって、[`std::min()`](/reference/algorithm/min.md)アルゴリズムのように`*this`が保持する値と`operand`の最小値を求めて、その値を`this`に保持させ、その値を返す ## 例外 @@ -33,7 +33,13 @@ constexpr T ## 備考 -- この関数は、`atomic`クラスの整数型、ポインタに対する特殊化で定義される (浮動小数点数型に対しては定義されない) +- この関数は、`atomic`クラスの整数型、浮動小数点数型、ポインタに対する特殊化で定義される +- 浮動小数点数型 + - [`std::fminimum_num()`](/reference/cmath/fminimum_num.md)関数と同様の動作をするが、以下の点で異なる: + - 両方のパラメータが`NaN`である場合、`this`が指す値は未規定のNaN値に置き換えられる + - 一方のパラメータだけが`NaN`である場合、`this`が指す値はもう一方のパラメータ、または未規定のNaN値に置き換えられるが、どちらに置き換えられるかは未規定 + - パラメータが異なる符号のゼロである場合、`this`が指す値がどちらに置き換えられるかは未規定 + - 処理系への推奨としては、負のゼロを正のゼロより小さいものとして扱うべきである - ポインタ型 - ポインタが異なる完全型オブジェクトを指している場合、`<`演算子による比較は狭義の弱順序を確立しない @@ -50,14 +56,16 @@ int main() int ret = x.fetch_min(2); std::cout << ret << std::endl; + std::cout << x.load() << std::endl; } ``` * fetch_min[color ff0000] - +* load()[link load.md] ### 出力 ``` 2 +2 ``` ## バージョン @@ -65,10 +73,11 @@ int main() - C++26 ### 処理系 -- [Clang](/implementation.md#clang): 19 [mark noimpl] -- [GCC](/implementation.md#gcc): 14 [mark noimpl] +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] ## 参照 - [P0493R5 Atomic minimum/maximum](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0493r5.pdf) - [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) +- [P3008R6 Atomic floating-point min/max](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3008r6.html) \ No newline at end of file diff --git a/reference/atomic/atomic_ref.md b/reference/atomic/atomic_ref.md index 2323676da9..80d62575e7 100644 --- a/reference/atomic/atomic_ref.md +++ b/reference/atomic/atomic_ref.md @@ -90,8 +90,8 @@ C++26から、これらの特殊化はCV修飾された型に対しても行わ | [`fetch_and`](atomic_ref/fetch_and.md) | AND演算 | C++20 | | [`fetch_or`](atomic_ref/fetch_or.md) | OR演算 | C++20 | | [`fetch_xor`](atomic_ref/fetch_xor.md) | XOR演算 | C++20 | -| [`fetch_max`](atomic_ref/fetch_max.md) | 最大値取得 | C++26 | -| [`fetch_min`](atomic_ref/fetch_min.md) | 最小値取得 | C++26 | +| [`fetch_max`](atomic_ref/fetch_max.md) | 最大値を設定・取得 | C++26 | +| [`fetch_min`](atomic_ref/fetch_min.md) | 最小値を設定・取得 | C++26 | | [`operator++`](atomic_ref/op_increment.md) | インクリメント | C++20 | | [`operator--`](atomic_ref/op_decrement.md) | デクリメント | C++20 | | [`operator+=`](atomic_ref/op_plus_assign.md) | 加算 | C++20 | @@ -112,10 +112,16 @@ C++26から、これらの特殊化はCV修飾された型に対しても行わ | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`fetch_add`](atomic_ref/fetch_add.md) | 加算 | C++20 | -| [`fetch_sub`](atomic_ref/fetch_sub.md) | 減算 | C++20 | -| [`operator+=`](atomic_ref/op_plus_assign.md) | 加算 | C++20 | -| [`operator-=`](atomic_ref/op_minus_assign.md) | 減算 | C++20 | +| [`fetch_add`](atomic_ref/fetch_add.md) | 加算 | C++20 | +| [`fetch_sub`](atomic_ref/fetch_sub.md) | 減算 | C++20 | +| [`fetch_max`](atomic_ref/fetch_max.md) | 最大値を設定・取得 | C++26 | +| [`fetch_min`](atomic_ref/fetch_min.md) | 最小値を設定・取得 | C++26 | +| [`fetch_fmaximum`](atomic_ref/fetch_fmaximum.md) | 最大値を設定・取得 (`-0.0`と`+0.0`では`+0.0`、NaNと値ではNaNを返す) | C++26 | +| [`fetch_fminimum`](atomic_ref/fetch_fminimum.md) | 最小値を設定・取得 (`-0.0`と`+0.0`では`-0.0`、NaNと値ではNaNを返す) | C++26 | +| [`fetch_fmaximum_num`](atomic_ref/fetch_fmaximum_num.md) | 最大値を設定・取得 (`-0.0`と`+0.0`では`+0.0`、NaNと値では数値を返す) | C++26 | +| [`fetch_fminimum_num`](atomic_ref/fetch_fminimum_num.md) | 最小値を設定・取得 (`-0.0`と`+0.0`では`-0.0`、NaNと値では数値を返す) | C++26 | +| [`operator+=`](atomic_ref/op_plus_assign.md) | 加算 | C++20 | +| [`operator-=`](atomic_ref/op_minus_assign.md) | 減算 | C++20 | ### atomic_ref<floating-point>専用メンバ型 @@ -131,8 +137,8 @@ C++26から、これらの特殊化はCV修飾された型に対しても行わ |------|------|----------------| | [`fetch_add`](atomic_ref/fetch_add.md) | 加算 | C++20 | | [`fetch_sub`](atomic_ref/fetch_sub.md) | 減算 | C++20 | -| [`fetch_max`](atomic_ref/fetch_max.md) | 最大値取得 | C++26 | -| [`fetch_min`](atomic_ref/fetch_min.md) | 最小値取得 | C++26 | +| [`fetch_max`](atomic_ref/fetch_max.md) | 最大値を設定・取得 | C++26 | +| [`fetch_min`](atomic_ref/fetch_min.md) | 最小値を設定・取得 | C++26 | | [`operator++`](atomic_ref/op_increment.md) | インクリメント | C++20 | | [`operator--`](atomic_ref/op_decrement.md) | デクリメント | C++20 | | [`operator+=`](atomic_ref/op_plus_assign.md) | 加算 | C++20 | diff --git a/reference/atomic/atomic_ref/fetch_fmaximum.md b/reference/atomic/atomic_ref/fetch_fmaximum.md new file mode 100644 index 0000000000..06a9887e25 --- /dev/null +++ b/reference/atomic/atomic_ref/fetch_fmaximum.md @@ -0,0 +1,72 @@ +# fetch_fmaximum +* atomic[meta header] +* std[meta namespace] +* atomic_ref[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr T + fetch_fmaximum(difference_type operand, + memory_order order = memory_order_seq_cst + ) const noexcept; // (1) C++26 +``` +* memory_order[link /reference/atomic/memory_order.md] +* memory_order_seq_cst[link /reference/atomic/memory_order.md] + +## 概要 +最大値を設定・取得する。 + +この関数は、現在の値と`operand`の大きい方を求め、その値で現在の値を置き換え、その値を返す。 + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、現在の値と`operand`の最大値を求めて、その値で現在の値を置き換え、その値を返す + + +## 例外 +投げない + + +## 備考 +- この関数は、`atomic_ref`クラスの浮動小数点数型で定義される +- 浮動小数点数型 + - [`std::fmaximum()`](/reference/cmath/fmaximum.md)関数と同様の動作をする + + +## 例 +```cpp example +#include +#include + +int main() +{ + int x = 2; + int ret = std::atomic_ref{x}.fetch_fmaximum(3); + + std::cout << ret << std::endl; + std::cout << x << std::endl; +} +``` +* fetch_fmaximum[color ff0000] + + +### 出力 +``` +3 +3 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] + + +## 参照 +- [P0493R5 Atomic minimum/maximum](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0493r5.pdf) +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) +- [P3008R6 Atomic floating-point min/max](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3008r6.html) \ No newline at end of file diff --git a/reference/atomic/atomic_ref/fetch_fmaximum_num.md b/reference/atomic/atomic_ref/fetch_fmaximum_num.md new file mode 100644 index 0000000000..75029c914b --- /dev/null +++ b/reference/atomic/atomic_ref/fetch_fmaximum_num.md @@ -0,0 +1,72 @@ +# fetch_fmaximum_num +* atomic[meta header] +* std[meta namespace] +* atomic_ref[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr T + fetch_fmaximum_num(difference_type operand, + memory_order order = memory_order_seq_cst + ) const noexcept; // (1) C++26 +``` +* memory_order[link /reference/atomic/memory_order.md] +* memory_order_seq_cst[link /reference/atomic/memory_order.md] + +## 概要 +最大値を設定・取得する。 + +この関数は、現在の値と`operand`の大きい方を求め、その値で現在の値を置き換え、その値を返す。 + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、現在の値と`operand`の最大値を求めて、その値で現在の値を置き換え、その値を返す + + +## 例外 +投げない + + +## 備考 +- この関数は、`atomic_ref`クラスの浮動小数点数型で定義される +- 浮動小数点数型 + - [`std::fmaximum_num()`](/reference/cmath/fmaximum_num.md)関数と同様の動作をする + + +## 例 +```cpp example +#include +#include + +int main() +{ + int x = 2; + int ret = std::atomic_ref{x}.fetch_fmaximum_num(3); + + std::cout << ret << std::endl; + std::cout << x << std::endl; +} +``` +* fetch_fmaximum_num[color ff0000] + + +### 出力 +``` +3 +3 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] + + +## 参照 +- [P0493R5 Atomic minimum/maximum](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0493r5.pdf) +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) +- [P3008R6 Atomic floating-point min/max](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3008r6.html) \ No newline at end of file diff --git a/reference/atomic/atomic_ref/fetch_fminimum.md b/reference/atomic/atomic_ref/fetch_fminimum.md new file mode 100644 index 0000000000..03d8bb7e1f --- /dev/null +++ b/reference/atomic/atomic_ref/fetch_fminimum.md @@ -0,0 +1,72 @@ +# fetch_fminimum +* atomic[meta header] +* std[meta namespace] +* atomic_ref[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr T + fetch_fminimum(difference_type operand, + memory_order order = memory_order_seq_cst + ) const noexcept; // (1) C++26 +``` +* memory_order[link /reference/atomic/memory_order.md] +* memory_order_seq_cst[link /reference/atomic/memory_order.md] + +## 概要 +最小値を設定・取得する。 + +この関数は、現在の値と`operand`の小さい方を求め、その値で現在の値を置き換え、その値を返す。 + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、現在の値と`operand`の最小値を求めて、その値で現在の値を置き換え、その値を返す + + +## 例外 +投げない + + +## 備考 +- この関数は、`atomic_ref`クラスの浮動小数点数型で定義される +- 浮動小数点数型 + - [`std::fminimum()`](/reference/cmath/fminimum.md)関数と同様の動作をする + + +## 例 +```cpp example +#include +#include + +int main() +{ + int x = 3; + int ret = std::atomic_ref{x}.fetch_fminimum(2); + + std::cout << ret << std::endl; + std::cout << x << std::endl; +} +``` +* fetch_fminimum[color ff0000] + + +### 出力 +``` +2 +2 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] + + +## 参照 +- [P0493R5 Atomic minimum/maximum](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0493r5.pdf) +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) +- [P3008R6 Atomic floating-point min/max](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3008r6.html) \ No newline at end of file diff --git a/reference/atomic/atomic_ref/fetch_fminimum_num.md b/reference/atomic/atomic_ref/fetch_fminimum_num.md new file mode 100644 index 0000000000..e9d23e5afb --- /dev/null +++ b/reference/atomic/atomic_ref/fetch_fminimum_num.md @@ -0,0 +1,72 @@ +# fetch_fminimum_num +* atomic[meta header] +* std[meta namespace] +* atomic_ref[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr T + fetch_fminimum_num(difference_type operand, + memory_order order = memory_order_seq_cst + ) const noexcept; // (1) C++26 +``` +* memory_order[link /reference/atomic/memory_order.md] +* memory_order_seq_cst[link /reference/atomic/memory_order.md] + +## 概要 +最小値を設定・取得する。 + +この関数は、現在の値と`operand`の小さい方を求め、その値で現在の値を置き換え、その値を返す。 + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、現在の値と`operand`の最小値を求めて、その値で現在の値を置き換え、その値を返す + + +## 例外 +投げない + + +## 備考 +- この関数は、`atomic_ref`クラスの浮動小数点数型で定義される +- 浮動小数点数型 + - [`std::fminimum_num()`](/reference/cmath/fminimum.md)関数と同様の動作をする + + +## 例 +```cpp example +#include +#include + +int main() +{ + int x = 3; + int ret = std::atomic_ref{x}.fetch_fminimum(2); + + std::cout << ret << std::endl; + std::cout << x << std::endl; +} +``` +* fetch_fminimum[color ff0000] + + +### 出力 +``` +2 +2 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] + + +## 参照 +- [P0493R5 Atomic minimum/maximum](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0493r5.pdf) +- [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) +- [P3008R6 Atomic floating-point min/max](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3008r6.html) \ No newline at end of file diff --git a/reference/atomic/atomic_ref/fetch_max.md b/reference/atomic/atomic_ref/fetch_max.md index ab4bc9350e..35492ca9f5 100644 --- a/reference/atomic/atomic_ref/fetch_max.md +++ b/reference/atomic/atomic_ref/fetch_max.md @@ -15,9 +15,9 @@ constexpr T * memory_order_seq_cst[link /reference/atomic/memory_order.md] ## 概要 -最大値を取得する。 +最大値を設定・取得する。 -この関数は、`*this`が保持する値と`operand`の大きい方を返す。 +この関数は、現在の値と`operand`の大きい方を求め、その値で現在の値を置き換え、その値を返す。 ## テンプレートパラメータ制約 @@ -25,7 +25,7 @@ constexpr T ## 効果 -`order`で指定されたメモリオーダーにしたがって、[`std::max()`](/reference/algorithm/max.md)アルゴリズムのように`*this`が保持する値と`operand`の最大値を求めて返す +`order`で指定されたメモリオーダーにしたがって、[`std::max()`](/reference/algorithm/max.md)アルゴリズムのように現在の値と`operand`の最大値を求めて、その値で現在の値を置き換え、その値を返す ## 例外 @@ -33,7 +33,13 @@ constexpr T ## 備考 -- この関数は、`atomic`クラスの整数型、ポインタに対する特殊化で定義される (浮動小数点数型に対しては定義されない) +- この関数は、`atomic_ref`クラスの整数型、浮動小数点数型、ポインタに対する特殊化で定義される +- 浮動小数点数型 + - [`std::fmaximum_num()`](/reference/cmath/fmaximum_num.md)関数と同様の動作をするが、以下の点で異なる: + - 両方のパラメータが`NaN`である場合、現在の値は未規定のNaN値に置き換えられる + - 一方のパラメータだけが`NaN`である場合、現在の値はもう一方のパラメータ、または未規定のNaN値に置き換えられるが、どちらに置き換えられるかは未規定 + - パラメータが異なる符号のゼロである場合、現在の値がどちらに置き換えられるかは未規定 + - 処理系への推奨としては、負のゼロを正のゼロより小さいものとして扱うべきである - ポインタ型 - ポインタが異なる完全型オブジェクトを指している場合、`<`演算子による比較は狭義の弱順序を確立しない @@ -45,10 +51,11 @@ constexpr T int main() { - int x = 3; - int ret = std::atomic_ref{x}.fetch_max(2); + int x = 2; + int ret = std::atomic_ref{x}.fetch_max(3); std::cout << ret << std::endl; + std::cout << x << std::endl; } ``` * fetch_max[color ff0000] @@ -57,6 +64,7 @@ int main() ### 出力 ``` 3 +3 ``` ## バージョン @@ -64,10 +72,11 @@ int main() - C++26 ### 処理系 -- [Clang](/implementation.md#clang): 19 [mark noimpl] -- [GCC](/implementation.md#gcc): 14 [mark noimpl] +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] ## 参照 - [P0493R5 Atomic minimum/maximum](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0493r5.pdf) - [P3309R3 `constexpr atomic` and `atomic_ref`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html) +- [P3008R6 Atomic floating-point min/max](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3008r6.html) \ No newline at end of file diff --git a/reference/atomic/atomic_ref/fetch_min.md b/reference/atomic/atomic_ref/fetch_min.md index 2fb1c6d178..9d41c3c8ea 100644 --- a/reference/atomic/atomic_ref/fetch_min.md +++ b/reference/atomic/atomic_ref/fetch_min.md @@ -15,9 +15,9 @@ constexpr T * memory_order_seq_cst[link /reference/atomic/memory_order.md] ## 概要 -最小値を取得する。 +最小値を設定・取得する。 -この関数は、`*this`が保持する値と`operand`の大きい方を返す。 +この関数は、現在の値と`operand`の大きい方を求めて、その値で現在の値を置き換え、その値を返す。 ## テンプレートパラメータ制約 @@ -25,7 +25,7 @@ constexpr T ## 効果 -`order`で指定されたメモリオーダーにしたがって、[`std::min()`](/reference/algorithm/min.md)アルゴリズムのように`*this`が保持する値と`operand`の最小値を求めて返す +`order`で指定されたメモリオーダーにしたがって、[`std::min()`](/reference/algorithm/min.md)アルゴリズムのように現在の値と`operand`の最小値を求めて、その値で現在の値を置き換え、その値を返す ## 例外 @@ -33,7 +33,13 @@ constexpr T ## 備考 -- この関数は、`atomic`クラスの整数型、ポインタに対する特殊化で定義される (浮動小数点数型に対しては定義されない) +- この関数は、`atomic_ref`クラスの整数型、浮動小数点数型、ポインタに対する特殊化で定義される +- 浮動小数点数型 + - [`std::fminimum_num()`](/reference/cmath/fminimum_num.md)関数と同様の動作をするが、以下の点で異なる: + - 両方のパラメータが`NaN`である場合、現在の値は未規定のNaN値に置き換えられる + - 一方のパラメータだけが`NaN`である場合、現在の値はもう一方のパラメータ、または未規定のNaN値に置き換えられるが、どちらに置き換えられるかは未規定 + - パラメータが異なる符号のゼロである場合、現在の値がどちらに置き換えられるかは未規定 + - 処理系への推奨としては、負のゼロを正のゼロより小さいものとして扱うべきである - ポインタ型 - ポインタが異なる完全型オブジェクトを指している場合、`<`演算子による比較は狭義の弱順序を確立しない From 246b78543b81844cfd8a6b6e1fd8db2b1be2cd21 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Tue, 23 Sep 2025 01:00:50 +0900 Subject: [PATCH 2377/3948] =?UTF-8?q?=5Fnum=20=E3=81=AE=E6=8A=9C=E3=81=91?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/atomic/atomic_ref/fetch_fminimum_num.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/atomic/atomic_ref/fetch_fminimum_num.md b/reference/atomic/atomic_ref/fetch_fminimum_num.md index e9d23e5afb..b12560b8d6 100644 --- a/reference/atomic/atomic_ref/fetch_fminimum_num.md +++ b/reference/atomic/atomic_ref/fetch_fminimum_num.md @@ -31,7 +31,7 @@ constexpr T ## 備考 - この関数は、`atomic_ref`クラスの浮動小数点数型で定義される - 浮動小数点数型 - - [`std::fminimum_num()`](/reference/cmath/fminimum.md)関数と同様の動作をする + - [`std::fminimum_num()`](/reference/cmath/fminimum_num.md)関数と同様の動作をする ## 例 @@ -42,13 +42,13 @@ constexpr T int main() { int x = 3; - int ret = std::atomic_ref{x}.fetch_fminimum(2); + int ret = std::atomic_ref{x}.fetch_fminimum_num(2); std::cout << ret << std::endl; std::cout << x << std::endl; } ``` -* fetch_fminimum[color ff0000] +* fetch_fminimum_num[color ff0000] ### 出力 From 649d139b5b271d6f0215e62fea7922e61d8f1c64 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Tue, 23 Sep 2025 01:01:49 +0900 Subject: [PATCH 2378/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/execution/execution/when_all.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/execution/execution/when_all.md b/reference/execution/execution/when_all.md index d61223b379..a04fca4355 100644 --- a/reference/execution/execution/when_all.md +++ b/reference/execution/execution/when_all.md @@ -272,7 +272,7 @@ struct make-state { * atomic[link /reference/atomic/atomic.md] * stop_callback_for_t[link /reference/stop_token/stop_callback_for_t.md] * inplace_stop_source[link /reference/stop_token/inplace_stop_source.md] -* stop_callback[link /reference/stop_token/stop_token.md] +* stop_callback[link /reference/stop_token/stop_callback.md] * optional[link /reference/optional/optional.md] * nullopt[link /reference/optional/nullopt_t.md] From d5a10b5de5e50cca37d97fc16f7a5b690dbe8330 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Wed, 24 Sep 2025 15:16:18 +0900 Subject: [PATCH 2379/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BE=8B?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/linalg/triangular_matrix_right_product.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/linalg/triangular_matrix_right_product.md b/reference/linalg/triangular_matrix_right_product.md index d5f19ee85d..7873a47d45 100644 --- a/reference/linalg/triangular_matrix_right_product.md +++ b/reference/linalg/triangular_matrix_right_product.md @@ -130,7 +130,7 @@ int main() // (1) std::cout << "(1)\n"; - std::linalg::triangular_matrix_left_product( + std::linalg::triangular_matrix_right_product( A, std::linalg::upper_triangle, std::linalg::implicit_unit_diagonal, @@ -140,7 +140,7 @@ int main() // (2) init_mat(C); std::cout << "(2)\n"; - std::linalg::triangular_matrix_left_product( + std::linalg::triangular_matrix_right_product( std::execution::par, A, std::linalg::upper_triangle, @@ -157,7 +157,7 @@ int main() * std::linalg::row_major_t[link /reference/linalg/row_major_t.md] * std::linalg::upper_triangle[link /reference/linalg/upper_triangle_t.md] * std::linalg::implicit_unit_diagonal[link /reference/linalg/implicit_unit_diagonal_t.md] -* std::linalg::triangular_matrix_left_product[color ff0000] +* std::linalg::triangular_matrix_right_product[color ff0000] ### 出力 From 00f29aa30c3aa31fda81da54c776610716b808d7 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Wed, 24 Sep 2025 15:17:37 +0900 Subject: [PATCH 2380/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE?= =?UTF-8?q?=E9=A3=BE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [color ...] で修飾されているもののうち、タイトルと一致しないものを検索して修正しました。 --- reference/concepts/signed_integral.md | 2 +- reference/linalg/matrix_rank_1_update_c.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/concepts/signed_integral.md b/reference/concepts/signed_integral.md index 5a1ea6c0e2..b58ee3c109 100644 --- a/reference/concepts/signed_integral.md +++ b/reference/concepts/signed_integral.md @@ -54,7 +54,7 @@ int main() { f>("std::integral_constant"); } ``` -* std::integral[color ff0000] +* std::signed_integral[color ff0000] ### 出力 ``` diff --git a/reference/linalg/matrix_rank_1_update_c.md b/reference/linalg/matrix_rank_1_update_c.md index 21cfe3ae9e..0e24ef2af4 100644 --- a/reference/linalg/matrix_rank_1_update_c.md +++ b/reference/linalg/matrix_rank_1_update_c.md @@ -143,7 +143,7 @@ int main() * v.extent[link /reference/mdspan/extents/extent.md] * y.extent[link /reference/mdspan/extents/extent.md] * std::complex[link /reference/complex/complex.md] -* std::linalg::matrix_rank_1_update[color ff0000] +* std::linalg::matrix_rank_1_update_c[color ff0000] ### 出力 From 7ad59de510e3da98863afb01138a995fb679f272 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Wed, 24 Sep 2025 15:34:21 +0900 Subject: [PATCH 2381/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BE=8B?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit common_view の例で「common_rangeではないview」として take_view> が使われていましたが、これは common_range なのでエラーになっていました。 代わりに common_range でない take_while_view を使うように変更しました。 common_view::size() の例では sizeed_range かつ common_view でない view を用意する必要があったので、 views::counted() を使うように変更しました。 --- reference/ranges/common_view/base.md | 11 ++++++----- reference/ranges/common_view/begin.md | 4 ++-- reference/ranges/common_view/end.md | 4 ++-- reference/ranges/common_view/op_constructor.md | 4 ++-- reference/ranges/common_view/op_deduction_guide.md | 9 +++++---- reference/ranges/common_view/size.md | 8 ++++---- 6 files changed, 21 insertions(+), 19 deletions(-) diff --git a/reference/ranges/common_view/base.md b/reference/ranges/common_view/base.md index bbd651c79c..08a2cf5ba8 100644 --- a/reference/ranges/common_view/base.md +++ b/reference/ranges/common_view/base.md @@ -31,16 +31,17 @@ constexpr V base() &&; // (2) C++20 int main() { std::vector vec = {1, 2, 3, 4, 5}; - auto taken = vec | std::views::take(3); + auto pred = [](int x) { return x <= 3; }; + auto taken = vec | std::views::take_while(pred); std::ranges::common_view cv(taken); // (1) コピーして取得 auto base1 = cv.base(); - static_assert(std::same_as>>>); + static_assert(std::same_as>, decltype(pred)>>); // (2) ムーブして取得 auto base2 = std::move(cv).base(); - static_assert(std::same_as>>>); + static_assert(std::same_as>, decltype(pred)>>); // 取得したviewを使用 for (int n : base1) { @@ -51,8 +52,8 @@ int main() { ``` * base[color ff0000] * std::ranges::common_view[link ../common_view.md] -* std::views::take[link ../take_view.md] -* std::ranges::take_view[link ../take_view.md] +* std::views::take_while[link ../take_while_view.md] +* std::ranges::take_while_view[link ../take_while_view.md] ### 出力 ``` diff --git a/reference/ranges/common_view/begin.md b/reference/ranges/common_view/begin.md index 0cd45f4966..e70d880b9e 100644 --- a/reference/ranges/common_view/begin.md +++ b/reference/ranges/common_view/begin.md @@ -43,7 +43,7 @@ int main() { std::vector vec = {1, 2, 3, 4, 5}; // common_rangeではないviewを作成 - auto taken = vec | std::views::take(3); + auto taken = vec | std::views::take_while([](int x) { return x <= 3; }); static_assert(!std::ranges::common_range); // common_viewでラップ @@ -66,7 +66,7 @@ int main() { * end[link end.md] * std::ranges::common_range[link ../common_range.md] * std::ranges::common_view[link ../common_view.md] -* std::views::take[link ../take_view.md] +* std::views::take_while[link ../take_while_view.md] ### 出力 ``` diff --git a/reference/ranges/common_view/end.md b/reference/ranges/common_view/end.md index fd0432e745..23eac3589a 100644 --- a/reference/ranges/common_view/end.md +++ b/reference/ranges/common_view/end.md @@ -45,7 +45,7 @@ int main() { std::vector vec = {1, 2, 3, 4, 5}; // common_rangeではないviewを作成 - auto taken = vec | std::views::take(3); + auto taken = vec | std::views::take_while([](int x) { return x <= 3; }); // common_viewでラップ std::ranges::common_view cv(taken); @@ -65,7 +65,7 @@ int main() { * end[color ff0000] * begin[link begin.md] * std::ranges::common_view[link ../common_view.md] -* std::views::take[link ../take_view.md] +* std::views::take_while[link ../take_while_view.md] ### 出力 ``` diff --git a/reference/ranges/common_view/op_constructor.md b/reference/ranges/common_view/op_constructor.md index 1d469d14b7..083f4a11f8 100644 --- a/reference/ranges/common_view/op_constructor.md +++ b/reference/ranges/common_view/op_constructor.md @@ -36,7 +36,7 @@ int main() { std::ranges::common_view> cv1; // (2) 元となるRangeを受け取るコンストラクタ - auto taken = vec | std::views::take(3); + auto taken = vec | std::views::take_while([](int x) { return x <= 3; }); std::ranges::common_view cv2(taken); for (int n : cv2) { @@ -47,7 +47,7 @@ int main() { ``` * std::ranges::common_view[color ff0000] * std::ranges::empty_view[link ../empty_view.md] -* std::views::take[link ../take_view.md] +* std::views::take_while[link ../take_while_view.md] ### 出力 ``` diff --git a/reference/ranges/common_view/op_deduction_guide.md b/reference/ranges/common_view/op_deduction_guide.md index c97b4a09c6..74e82646e6 100644 --- a/reference/ranges/common_view/op_deduction_guide.md +++ b/reference/ranges/common_view/op_deduction_guide.md @@ -26,7 +26,8 @@ int main() { std::vector vec = {1, 2, 3, 4, 5}; // views::takeはcommon_rangeではない - auto taken = vec | std::views::take(3); + auto pred = [](int x) { return x <= 3; }; + auto taken = vec | std::views::take_while(pred); // common_viewの型を明示的に指定する必要がない std::ranges::common_view cv{taken}; @@ -34,13 +35,13 @@ int main() { // 推論された型を確認 static_assert(std::same_as< decltype(cv), - std::ranges::common_view>>> + std::ranges::common_view>, decltype(pred)>> >); } ``` * std::ranges::common_view[color ff0000] -* std::views::take[link ../take_view.md] -* std::ranges::take_view[link ../take_view.md] +* std::views::take_while[link ../take_while_view.md] +* std::ranges::take_while_view[link ../take_while_view.md] ### 出力 ``` diff --git a/reference/ranges/common_view/size.md b/reference/ranges/common_view/size.md index 662faf840d..10563bc150 100644 --- a/reference/ranges/common_view/size.md +++ b/reference/ranges/common_view/size.md @@ -24,14 +24,14 @@ constexpr auto size() const ## 例 ```cpp example #include -#include +#include #include int main() { - std::vector vec = {1, 2, 3, 4, 5}; + std::list ls = {1, 2, 3, 4, 5}; // sized_rangeなviewを作成 - auto taken = vec | std::views::take(3); + auto taken = std::views::counted(ls.begin(), 3); static_assert(std::ranges::sized_range); // common_viewでラップ @@ -48,7 +48,7 @@ int main() { * size[color ff0000] * std::ranges::sized_range[link ../sized_range.md] * std::ranges::common_view[link ../common_view.md] -* std::views::take[link ../take_view.md] +* std::views::counted[link ../counted.md] ### 出力 ``` From e970be3588e21243d967790a37deb8481dd0c0bf Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Wed, 24 Sep 2025 19:08:35 +0900 Subject: [PATCH 2382/3948] =?UTF-8?q?filter=5Fview::iterator=20=E3=81=AE?= =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E3=81=A8=E8=AA=AC=E6=98=8E=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit コードのエラーを修正しました。 デクリメント演算子のページに関しては説明にも誤りがあったので、修正しました。 --- .../filter_view/iterator/op_constructor.md | 11 +++++----- .../filter_view/iterator/op_decrement.md | 20 ++++++++++--------- .../ranges/filter_view/iterator/op_deref.md | 9 +++++---- .../filter_view/iterator/op_increment.md | 9 +++++---- 4 files changed, 27 insertions(+), 22 deletions(-) diff --git a/reference/ranges/filter_view/iterator/op_constructor.md b/reference/ranges/filter_view/iterator/op_constructor.md index 1a84cc040f..384af180fc 100644 --- a/reference/ranges/filter_view/iterator/op_constructor.md +++ b/reference/ranges/filter_view/iterator/op_constructor.md @@ -24,6 +24,7 @@ constexpr iterator(filter_view& parent, iterator_t current); // (2) ```cpp example #include #include +#include int main() { using std::ranges::filter_view; @@ -33,16 +34,16 @@ int main() { filter_view fv{vec, [](int x){ return x % 2 == 0; }}; - iterator_t i(fv, vec.begin()); + iterator_t i(fv, vec.begin()); - std::cout << *i << `\n`; + std::cout << *i << '\n'; i++; - std::cout << *i << `\n`; + std::cout << *i << '\n'; i++; - std::cout << *i << `\n`; + std::cout << *i << '\n'; } ``` -* iterator_t[color ff0000] +* iterator_t[color ff0000] ### 出力 ``` diff --git a/reference/ranges/filter_view/iterator/op_decrement.md b/reference/ranges/filter_view/iterator/op_decrement.md index 6d8d255359..841b5b38f0 100644 --- a/reference/ranges/filter_view/iterator/op_decrement.md +++ b/reference/ranges/filter_view/iterator/op_decrement.md @@ -6,13 +6,13 @@ * cpp20[meta cpp] ```cpp -constexpr iterator& operator++() requires bidirectional_range; // (1) +constexpr iterator& operator--() requires bidirectional_range; // (1) constexpr iterator operator--(int) requires bidirectional_range; // (2) ``` ## 概要 -イテレータを1つ進める。 +イテレータを1つ後方に進める。 ## 効果 @@ -28,7 +28,7 @@ return *this; と等しい。 -(3)は、 +(2)は、 ```cpp auto tmp = *this; --*this; @@ -41,6 +41,7 @@ return tmp; ```cpp example #include #include +#include int main() { using std::ranges::filter_view; @@ -50,21 +51,22 @@ int main() { filter_view fv{vec, [](int x){ return x % 2 == 0; }}; - iterator_t i(fv, vec.begin()); + iterator_t i(fv, vec.begin()); + std::advance(i, 2); - std::cout << *i << `\n`; + std::cout << *i << '\n'; i--; - std::cout << *i << `\n`; + std::cout << *i << '\n'; i--; - std::cout << *i << `\n`; + std::cout << *i << '\n'; } ``` ### 出力 ``` -0 -2 4 +2 +0 ``` ## バージョン diff --git a/reference/ranges/filter_view/iterator/op_deref.md b/reference/ranges/filter_view/iterator/op_deref.md index 22bf342e63..17f1797787 100644 --- a/reference/ranges/filter_view/iterator/op_deref.md +++ b/reference/ranges/filter_view/iterator/op_deref.md @@ -21,6 +21,7 @@ constexpr range_reference_t operator*() const; ```cpp example #include #include +#include int main() { using std::ranges::filter_view; @@ -30,13 +31,13 @@ int main() { filter_view fv{vec, [](int x){ return x % 2 == 0; }}; - iterator_t i(fv, vec.begin()); + iterator_t i(fv, vec.begin()); - std::cout << *i << `\n`; + std::cout << *i << '\n'; i++; - std::cout << *i << `\n`; + std::cout << *i << '\n'; i++; - std::cout << *i << `\n`; + std::cout << *i << '\n'; } ``` diff --git a/reference/ranges/filter_view/iterator/op_increment.md b/reference/ranges/filter_view/iterator/op_increment.md index f891251cff..942d555828 100644 --- a/reference/ranges/filter_view/iterator/op_increment.md +++ b/reference/ranges/filter_view/iterator/op_increment.md @@ -46,6 +46,7 @@ return tmp; ```cpp example #include #include +#include int main() { using std::ranges::filter_view; @@ -55,13 +56,13 @@ int main() { filter_view fv{vec, [](int x){ return x % 2 == 0; }}; - iterator_t i(fv, vec.begin()); + iterator_t i(fv, vec.begin()); - std::cout << *i << `\n`; + std::cout << *i << '\n'; i++; - std::cout << *i << `\n`; + std::cout << *i << '\n'; i++; - std::cout << *i << `\n`; + std::cout << *i << '\n'; } ``` From 2f524bf52a013316addf30bc263eabc61b03bd0e Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Thu, 25 Sep 2025 15:58:45 +0900 Subject: [PATCH 2383/3948] =?UTF-8?q?common=5Fview=20=E3=81=AE=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit empty_view は common_range なので common_view でラップするとエラーになります。 iota_view に変更しました。 --- reference/ranges/common_view/op_constructor.md | 4 ++-- reference/ranges/common_view/op_deduction_guide.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/ranges/common_view/op_constructor.md b/reference/ranges/common_view/op_constructor.md index 083f4a11f8..34abe284a2 100644 --- a/reference/ranges/common_view/op_constructor.md +++ b/reference/ranges/common_view/op_constructor.md @@ -33,7 +33,7 @@ int main() { std::vector vec = {1, 2, 3, 4, 5}; // (1) デフォルトコンストラクタ - std::ranges::common_view> cv1; + std::ranges::common_view> cv1; // (2) 元となるRangeを受け取るコンストラクタ auto taken = vec | std::views::take_while([](int x) { return x <= 3; }); @@ -46,7 +46,7 @@ int main() { } ``` * std::ranges::common_view[color ff0000] -* std::ranges::empty_view[link ../empty_view.md] +* std::ranges::iota_view[link ../iota_view.md] * std::views::take_while[link ../take_while_view.md] ### 出力 diff --git a/reference/ranges/common_view/op_deduction_guide.md b/reference/ranges/common_view/op_deduction_guide.md index 74e82646e6..720d658ded 100644 --- a/reference/ranges/common_view/op_deduction_guide.md +++ b/reference/ranges/common_view/op_deduction_guide.md @@ -25,7 +25,7 @@ namespace std::ranges { int main() { std::vector vec = {1, 2, 3, 4, 5}; - // views::takeはcommon_rangeではない + // views::take_whileはcommon_rangeではない auto pred = [](int x) { return x <= 3; }; auto taken = vec | std::views::take_while(pred); From e19a0590cf5acc450f33a8cb4f9456790af9761e Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Thu, 25 Sep 2025 21:31:50 +0900 Subject: [PATCH 2384/3948] =?UTF-8?q?split=5Fview::base()=20=E3=81=AE?= =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit string_view は view なので説明と合わずエラーになります。 代わりに string を使うように変更しました。 --- reference/ranges/split_view/base.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/reference/ranges/split_view/base.md b/reference/ranges/split_view/base.md index dded81b8db..a86c0cd953 100644 --- a/reference/ranges/split_view/base.md +++ b/reference/ranges/split_view/base.md @@ -27,15 +27,15 @@ constexpr V base() &&; // (2) C++20 ```cpp example #include -#include +#include #include int main() { using std::ranges::view; using namespace std::literals; - std::string_view text = "hello,world,split"; - std::string_view delimiter = ","; + std::string text = "hello,world,split"; + std::string delimiter = ","; std::ranges::split_view r{text, delimiter}; @@ -46,9 +46,9 @@ int main() { view auto b2 = std::move(r).base(); // 得られるのは元のRangeではなく、あくまでview - static_assert(not std::same_as); - static_assert( std::same_as>); - static_assert( std::same_as>); + static_assert(not std::same_as); + static_assert( std::same_as>); + static_assert( std::same_as>); } ``` * base[color ff0000] From 9a9e76000a80660ea2f39d95e78ef353ad181c64 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Thu, 25 Sep 2025 21:34:47 +0900 Subject: [PATCH 2385/3948] =?UTF-8?q?to=5Finput=5Fview::base()=20=E3=81=AE?= =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/to_input_view/base.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/ranges/to_input_view/base.md b/reference/ranges/to_input_view/base.md index b21487121f..7338fa6241 100644 --- a/reference/ranges/to_input_view/base.md +++ b/reference/ranges/to_input_view/base.md @@ -31,11 +31,11 @@ int main() { std::ranges::to_input_view view{vec}; // (1) コピーして取得 - std::vector v1 = view.base(); + std::ranges::ref_view> v1 = view.base(); // (2) ムーブして取得 std::ranges::to_input_view view2{vec}; - std::vector v2 = std::move(view2).base(); + std::ranges::ref_view> v2 = std::move(view2).base(); std::cout << v1.size() << std::endl; std::cout << v2.size() << std::endl; From 71fc974d837707ae7a33c228bf167308b3a72038 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Thu, 25 Sep 2025 21:35:12 +0900 Subject: [PATCH 2386/3948] =?UTF-8?q?=E4=BD=99=E5=88=86=E3=81=AA=20=5Fview?= =?UTF-8?q?=20=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/adjacent_transform_view.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/ranges/adjacent_transform_view.md b/reference/ranges/adjacent_transform_view.md index 51d29ffe17..ab29424099 100644 --- a/reference/ranges/adjacent_transform_view.md +++ b/reference/ranges/adjacent_transform_view.md @@ -13,7 +13,7 @@ namespace std::ranges { class adjacent_transform_view : public view_interface> { …… }; // (1) namespace views { - inline constexpr /*unspecified*/ adjacent_transform_view = /*unspecified*/; // (2) + inline constexpr /*unspecified*/ adjacent_transform = /*unspecified*/; // (2) } } ``` @@ -87,13 +87,13 @@ namespace std::ranges { int main() { // 隣接する要素間の差を計算する std::vector v = {9, 2, 5, 3, 6, 7}; - for (int x : v | std::views::adjacent_transform_view<2>( + for (int x : v | std::views::adjacent_transform<2>( [](auto x, auto y) { return y - x; })) { std::cout << x << std::endl; } } ``` -* std::views::adjacent_transform_view[color ff0000] +* std::views::adjacent_transform[color ff0000] ### 出力 ``` From ee5ed85af947118f460648c1cf65648b17577fa3 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Thu, 25 Sep 2025 21:43:29 +0900 Subject: [PATCH 2387/3948] =?UTF-8?q?to=5Finput=5Fview=20=E3=81=AE?= =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=82=B9=E3=83=88=E3=83=A9=E3=82=AF=E3=82=BF?= =?UTF-8?q?=E3=81=AE=E3=82=B3=E3=83=BC=E3=83=89=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit std::views::all_t&> はデフォルト構築不可能なのでエラーになります。 std::views::all_t> に変更しました。 --- reference/ranges/to_input_view/op_constructor.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/ranges/to_input_view/op_constructor.md b/reference/ranges/to_input_view/op_constructor.md index bc1080048d..fa743096e1 100644 --- a/reference/ranges/to_input_view/op_constructor.md +++ b/reference/ranges/to_input_view/op_constructor.md @@ -32,7 +32,7 @@ int main() { std::vector v = {1, 2, 3}; // (1) デフォルトコンストラクタ - std::ranges::to_input_view&>> view1{}; + std::ranges::to_input_view>> view1{}; // (2) ベースRangeを受け取るコンストラクタ std::ranges::to_input_view view2{v}; From 7d0aa6734c80d32a8ad5f21df897e698ed20926e Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Thu, 25 Sep 2025 22:04:30 +0900 Subject: [PATCH 2388/3948] =?UTF-8?q?=E3=81=84=E3=81=8F=E3=81=A4=E3=81=8B?= =?UTF-8?q?=E3=81=AE=E3=82=B3=E3=83=BC=E3=83=89=E4=BE=8B=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ostream/println.md | 4 ++-- reference/ranges/as_const_view/base.md | 2 +- reference/ranges/as_const_view/end.md | 3 ++- reference/ranges/chunk_view.md | 2 +- reference/ranges/filter_view/op_deduction_guide.md | 4 ++-- reference/regex/match_results/op_assign.md | 2 +- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/reference/ostream/println.md b/reference/ostream/println.md index 9bf22a36b0..bc67352379 100644 --- a/reference/ostream/println.md +++ b/reference/ostream/println.md @@ -90,9 +90,9 @@ Hello int main() { std::print(std::cout, "abc"); - std::println(std::cout, ); // 改行コードのみを出力する + std::println(std::cout); // 改行コードのみを出力する std::print(std::cout, "{}", 123); - std::println(std::cout, ); + std::println(std::cout); } ``` * std::print[link print.md] diff --git a/reference/ranges/as_const_view/base.md b/reference/ranges/as_const_view/base.md index 9d33283fa9..4fc69031ce 100644 --- a/reference/ranges/as_const_view/base.md +++ b/reference/ranges/as_const_view/base.md @@ -24,7 +24,7 @@ constexpr V base() &&; // (2) ## 例 ```cpp example -#include +#include #include #include diff --git a/reference/ranges/as_const_view/end.md b/reference/ranges/as_const_view/end.md index 3c3ffe3bec..11d4e16524 100644 --- a/reference/ranges/as_const_view/end.md +++ b/reference/ranges/as_const_view/end.md @@ -30,6 +30,7 @@ return ranges::cend(base_); #include #include #include +#include int main() { std::vector vec = {1, 2, 3, 4, 5}; @@ -43,7 +44,7 @@ int main() { --se; - std::cout << *se << '\n' + std::cout << *se << '\n'; } ``` * end[color ff0000] diff --git a/reference/ranges/chunk_view.md b/reference/ranges/chunk_view.md index 0c837cb3a8..0a647ab962 100644 --- a/reference/ranges/chunk_view.md +++ b/reference/ranges/chunk_view.md @@ -125,7 +125,7 @@ int main() { const auto table = std::views::istream(iss) | std::views::chunk(w) | std::views::take(h) - | std::ranges::to>(); + | std::ranges::to>>(); std::println("{}", table); } diff --git a/reference/ranges/filter_view/op_deduction_guide.md b/reference/ranges/filter_view/op_deduction_guide.md index c98cb920e8..779e60ed38 100644 --- a/reference/ranges/filter_view/op_deduction_guide.md +++ b/reference/ranges/filter_view/op_deduction_guide.md @@ -34,14 +34,14 @@ int main() { static_assert(std::same_as< decltype(v1), - std::ranges::filter_view>> + std::ranges::filter_view>, decltype(pred)> >); std::ranges::filter_view v2{std::vector{1, 2}, pred}; static_assert(std::same_as< decltype(v2), - std::ranges::filter_view>> + std::ranges::filter_view>, decltype(pred)> >); } ``` diff --git a/reference/regex/match_results/op_assign.md b/reference/regex/match_results/op_assign.md index 9b39f782f2..4191bb4a35 100644 --- a/reference/regex/match_results/op_assign.md +++ b/reference/regex/match_results/op_assign.md @@ -65,7 +65,7 @@ void print(const std::cmatch& m) for (std::size_t i = 0, n = m.size(); i < n; ++i) { std::cout << i << ":'" << m.str(i) << '\'' << std::endl; } -- std::cout << "suffix:'" << m.suffix() << '\'' << std::endl; + std::cout << "suffix:'" << m.suffix() << '\'' << std::endl; } std::cout << std::endl; } From 9b8ca475ec8130c95b83fbd7398cd33799ad5c97 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Thu, 25 Sep 2025 22:28:06 +0900 Subject: [PATCH 2389/3948] =?UTF-8?q?unordered=5Fmap::emplace=5Fhint()=20?= =?UTF-8?q?=E3=81=AE=E3=82=B3=E3=83=BC=E3=83=89=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit std::distance() で const_iterator と iterator の距離を求めようとしてエラーになっていました。 iterator に揃えました。 --- reference/unordered_map/unordered_map/emplace_hint.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/reference/unordered_map/unordered_map/emplace_hint.md b/reference/unordered_map/unordered_map/emplace_hint.md index 3384880b4d..a571d60b30 100644 --- a/reference/unordered_map/unordered_map/emplace_hint.md +++ b/reference/unordered_map/unordered_map/emplace_hint.md @@ -89,14 +89,14 @@ int main() std::cout << std::boolalpha; auto it1 = um.emplace_hint(um.cend(), "e", 2.718281828); - std::cout << '{' << it1->first << ',' << it1->second << "} at " << std::distance(um.cbegin(), it1) << '\n'; + std::cout << '{' << it1->first << ',' << it1->second << "} at " << std::distance(um.begin(), it1) << '\n'; auto it2 = um.emplace_hint(um.cbegin(), "pi", 3.14159265); - std::cout << '{' << it2->first << ',' << it2->second << "} at " << std::distance(um.cbegin(), it2) << '\n'; + std::cout << '{' << it2->first << ',' << it2->second << "} at " << std::distance(um.begin(), it2) << '\n'; auto it3 = um.emplace_hint(um.cbegin(), "pi", 3); - std::cout << '{' << it3->first << ',' << it3->second << "} at " << std::distance(um.cbegin(), it3) << '\n'; + std::cout << '{' << it3->first << ',' << it3->second << "} at " << std::distance(um.begin(), it3) << '\n'; auto it4 = um.emplace_hint(std::next(um.cbegin(), 1), std::piecewise_construct, std::forward_as_tuple("i"), std::forward_as_tuple(0, 1)); - std::cout << '{' << it4->first << ',' << it4->second << "} at " << std::distance(um.cbegin(), it4) << '\n'; + std::cout << '{' << it4->first << ',' << it4->second << "} at " << std::distance(um.begin(), it4) << '\n'; std::for_each(um.cbegin(), um.cend(), [](const decltype(um)::value_type& v) { std::cout << '{' << v.first << ',' << v.second << "}, "; @@ -106,6 +106,7 @@ int main() ``` * emplace_hint[color ff0000] * std::complex[link /reference/complex/complex.md] +* um.begin()[link begin.md] * um.cbegin()[link cbegin.md] * um.cend()[link cend.md] * std::piecewise_construct[link /reference/utility/piecewise_construct_t.md] From 2b5b392b64f11ab7a75053a562ce53c65acec8e6 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Fri, 26 Sep 2025 00:38:13 +0900 Subject: [PATCH 2390/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BE=8B?= =?UTF-8?q?=E3=81=AE=20include=20=E3=81=AE=E4=B8=8D=E8=B6=B3=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_copy_backward.md | 1 + reference/chrono/parse.md | 1 + reference/chrono/year_month_day/op_constructor.md | 1 + reference/chrono/zoned_time/get_info.md | 1 + reference/chrono/zoned_time/get_local_time.md | 1 + reference/chrono/zoned_time/op_constructor.md | 1 + reference/chrono/zoned_time/op_local_time.md | 1 + reference/iterator/const_iterator.md | 1 + reference/iterator/const_sentinel.md | 1 + reference/iterator/indirectly_readable.md | 1 + reference/memory/start_lifetime_as.md | 1 + reference/memory/start_lifetime_as_array.md | 1 + reference/tuple/tuple.md | 1 + reference/type_traits/is_trivially_copyable.md | 1 + reference/utility/pair/first.md | 1 + reference/utility/pair/second.md | 1 + 16 files changed, 16 insertions(+) diff --git a/reference/algorithm/ranges_copy_backward.md b/reference/algorithm/ranges_copy_backward.md index e8e20bdf7a..59dc02af34 100644 --- a/reference/algorithm/ranges_copy_backward.md +++ b/reference/algorithm/ranges_copy_backward.md @@ -63,6 +63,7 @@ copy_backward_result { #include #include #include +#include int main() { std::list ls = { 1,2,3,4,5 }; diff --git a/reference/chrono/parse.md b/reference/chrono/parse.md index d762cb0114..bde91face7 100644 --- a/reference/chrono/parse.md +++ b/reference/chrono/parse.md @@ -111,6 +111,7 @@ namespace std::chrono { ## 例 ```cpp example +#include #include #include diff --git a/reference/chrono/year_month_day/op_constructor.md b/reference/chrono/year_month_day/op_constructor.md index b7cbe5ccf2..187037df1b 100644 --- a/reference/chrono/year_month_day/op_constructor.md +++ b/reference/chrono/year_month_day/op_constructor.md @@ -62,6 +62,7 @@ year_month_day(year_month_day&&) = default; // (7) C++20 ### 例 ```cpp example #include +#include #include namespace chrono = std::chrono; diff --git a/reference/chrono/zoned_time/get_info.md b/reference/chrono/zoned_time/get_info.md index df45d1b04a..6595ebc272 100644 --- a/reference/chrono/zoned_time/get_info.md +++ b/reference/chrono/zoned_time/get_info.md @@ -26,6 +26,7 @@ return zone->get_info(tp); ## 例 ```cpp example #include +#include #include namespace chrono = std::chrono; diff --git a/reference/chrono/zoned_time/get_local_time.md b/reference/chrono/zoned_time/get_local_time.md index 87a7e37de8..58ddb82dfa 100644 --- a/reference/chrono/zoned_time/get_local_time.md +++ b/reference/chrono/zoned_time/get_local_time.md @@ -28,6 +28,7 @@ return zone->to_local(tp); ## 例 ```cpp example #include +#include #include namespace chrono = std::chrono; diff --git a/reference/chrono/zoned_time/op_constructor.md b/reference/chrono/zoned_time/op_constructor.md index fbb834025b..8b0ee3427b 100644 --- a/reference/chrono/zoned_time/op_constructor.md +++ b/reference/chrono/zoned_time/op_constructor.md @@ -116,6 +116,7 @@ zoned_time(string_view name, ### 例 ```cpp example +#include #include #include diff --git a/reference/chrono/zoned_time/op_local_time.md b/reference/chrono/zoned_time/op_local_time.md index d5825b12fb..b45229c92c 100644 --- a/reference/chrono/zoned_time/op_local_time.md +++ b/reference/chrono/zoned_time/op_local_time.md @@ -26,6 +26,7 @@ return get_local_time(); ## 例 ```cpp example #include +#include #include namespace chrono = std::chrono; diff --git a/reference/iterator/const_iterator.md b/reference/iterator/const_iterator.md index 36c561839b..246e542bf5 100644 --- a/reference/iterator/const_iterator.md +++ b/reference/iterator/const_iterator.md @@ -23,6 +23,7 @@ namespace std { ## 例 ```cpp example #include +#include int main() { static_assert(std::same_as, std::basic_const_iterator>); diff --git a/reference/iterator/const_sentinel.md b/reference/iterator/const_sentinel.md index 82af81b7a6..1925427773 100644 --- a/reference/iterator/const_sentinel.md +++ b/reference/iterator/const_sentinel.md @@ -24,6 +24,7 @@ namespace std { ## 例 ```cpp example #include +#include int main() { static_assert(std::same_as, std::basic_const_iterator>); diff --git a/reference/iterator/indirectly_readable.md b/reference/iterator/indirectly_readable.md index e39b14374f..f426d9d9b0 100644 --- a/reference/iterator/indirectly_readable.md +++ b/reference/iterator/indirectly_readable.md @@ -57,6 +57,7 @@ concept indirectly_readable = #include #include #include +#include template requires std::indirectly_readable diff --git a/reference/memory/start_lifetime_as.md b/reference/memory/start_lifetime_as.md index 13fd0d8744..03a41a5ba9 100644 --- a/reference/memory/start_lifetime_as.md +++ b/reference/memory/start_lifetime_as.md @@ -49,6 +49,7 @@ const volatile T* start_lifetime_as(const volatile void* p) noexcept; // (4) ```cpp example #include #include +#include int main() { float f = 3.14f; diff --git a/reference/memory/start_lifetime_as_array.md b/reference/memory/start_lifetime_as_array.md index 06e402dcbe..dbc34ce81d 100644 --- a/reference/memory/start_lifetime_as_array.md +++ b/reference/memory/start_lifetime_as_array.md @@ -50,6 +50,7 @@ const volatile T* start_lifetime_as_array(const volatile void* p, size_t n) noex ```cpp example #include #include +#include int main() { float f = 3.14f; diff --git a/reference/tuple/tuple.md b/reference/tuple/tuple.md index 8cf65409b3..950ca84a1f 100644 --- a/reference/tuple/tuple.md +++ b/reference/tuple/tuple.md @@ -153,6 +153,7 @@ C++23 で[`zip_view`](/reference/ranges/zip_view.md)などが追加されたこ #include #include #include +#include struct A { diff --git a/reference/type_traits/is_trivially_copyable.md b/reference/type_traits/is_trivially_copyable.md index 7b68c54d44..2ac339c1f9 100644 --- a/reference/type_traits/is_trivially_copyable.md +++ b/reference/type_traits/is_trivially_copyable.md @@ -60,6 +60,7 @@ CWG issue 1734は2013年8月9日に報告されている。つまりC++14に対 ```cpp example #include +#include template concept trivially_copy_constructible = std::is_trivially_copy_constructible_v; template diff --git a/reference/utility/pair/first.md b/reference/utility/pair/first.md index 0e87ab3467..91d495051f 100644 --- a/reference/utility/pair/first.md +++ b/reference/utility/pair/first.md @@ -14,6 +14,7 @@ T1 first; ## 例 ```cpp example #include +#include int main() { std::pair p(1, 2); diff --git a/reference/utility/pair/second.md b/reference/utility/pair/second.md index f58f062a57..ad9fb3fca7 100644 --- a/reference/utility/pair/second.md +++ b/reference/utility/pair/second.md @@ -14,6 +14,7 @@ T2 second; ## 例 ```cpp example #include +#include int main() { std::pair p(1, 2); From 0157304d946c7e04fe521135e68d5cdc760609db Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Fri, 26 Sep 2025 12:52:26 +0900 Subject: [PATCH 2391/3948] =?UTF-8?q?chrono::from=5Fstream()=20=E3=81=AE?= =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BE=8B=E3=81=AE=E5=BC=95=E6=95=B0?= =?UTF-8?q?=E3=81=AE=E9=A0=86=E5=BA=8F=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/chrono/day/from_stream.md | 4 ++-- reference/chrono/month/from_stream.md | 4 ++-- reference/chrono/month_day/from_stream.md | 4 ++-- reference/chrono/weekday/from_stream.md | 4 ++-- reference/chrono/year/from_stream.md | 4 ++-- reference/chrono/year_month/from_stream.md | 4 ++-- reference/chrono/year_month_day/from_stream.md | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/reference/chrono/day/from_stream.md b/reference/chrono/day/from_stream.md index 3ce5b90aec..c69bfe3998 100644 --- a/reference/chrono/day/from_stream.md +++ b/reference/chrono/day/from_stream.md @@ -46,7 +46,7 @@ int main() ss << "01"; chrono::day d; - chrono::from_stream(ss, d, "%d"); + chrono::from_stream(ss, "%d", d); assert(d == chrono::day{1}); } { @@ -54,7 +54,7 @@ int main() ss << "1"; chrono::day d; - chrono::from_stream(ss, d, "%2d"); + chrono::from_stream(ss, "%2d", d); assert(d == chrono::day{1}); } } diff --git a/reference/chrono/month/from_stream.md b/reference/chrono/month/from_stream.md index dda34a179d..c2f16f1357 100644 --- a/reference/chrono/month/from_stream.md +++ b/reference/chrono/month/from_stream.md @@ -46,7 +46,7 @@ int main() ss << "Jan"; chrono::month m; - chrono::from_stream(ss, m, "%b"); + chrono::from_stream(ss, "%b", m); assert(m == chrono::January); } { @@ -54,7 +54,7 @@ int main() ss << "January"; chrono::month m; - chrono::from_stream(ss, m, "%b"); + chrono::from_stream(ss, "%b", m); assert(m == chrono::January); } } diff --git a/reference/chrono/month_day/from_stream.md b/reference/chrono/month_day/from_stream.md index 622d536563..a01354fd19 100644 --- a/reference/chrono/month_day/from_stream.md +++ b/reference/chrono/month_day/from_stream.md @@ -46,7 +46,7 @@ int main() ss << "Mar/1"; // "Mar/01"や"March/1"でもOK chrono::month_day md; - chrono::from_stream(ss, md, "%b/%d"); + chrono::from_stream(ss, "%b/%d", md); assert(md == chrono::March/1); } { @@ -54,7 +54,7 @@ int main() ss << "3月1日"; chrono::month_day md; - chrono::from_stream(ss, md, "%m月%d日"); + chrono::from_stream(ss, "%m月%d日", md); assert(md == chrono::March/1); } } diff --git a/reference/chrono/weekday/from_stream.md b/reference/chrono/weekday/from_stream.md index ef492d9f77..a2d27f1934 100644 --- a/reference/chrono/weekday/from_stream.md +++ b/reference/chrono/weekday/from_stream.md @@ -46,7 +46,7 @@ int main() ss << "Sun"; chrono::weekday wd; - chrono::from_stream(ss, wd, "%a"); + chrono::from_stream(ss, "%a", wd); assert(wd == chrono::Sunday); } { @@ -54,7 +54,7 @@ int main() ss << "Sunday"; chrono::weekday wd; - chrono::from_stream(ss, wd, "%a"); + chrono::from_stream(ss, "%a", wd); assert(wd == chrono::Sunday); } } diff --git a/reference/chrono/year/from_stream.md b/reference/chrono/year/from_stream.md index 7569ad588b..789066a555 100644 --- a/reference/chrono/year/from_stream.md +++ b/reference/chrono/year/from_stream.md @@ -46,7 +46,7 @@ int main() ss << "2020"; chrono::year y; - chrono::from_stream(ss, y, "%y"); + chrono::from_stream(ss, "%y", y); assert(y == chrono::year{2020}); } { @@ -54,7 +54,7 @@ int main() ss << "0123"; chrono::year y; - chrono::from_stream(ss, y, "%4Y"); + chrono::from_stream(ss, "%4Y", y); assert(y == chrono::year{123}); } } diff --git a/reference/chrono/year_month/from_stream.md b/reference/chrono/year_month/from_stream.md index 3f8b698fea..64940080cc 100644 --- a/reference/chrono/year_month/from_stream.md +++ b/reference/chrono/year_month/from_stream.md @@ -47,7 +47,7 @@ int main() ss << "2020/Mar"; chrono::year_month ym; - chrono::from_stream(ss, ym, "%Y/%b"); + chrono::from_stream(ss, "%Y/%b", ym); assert(ym == 2020y/3); } { @@ -55,7 +55,7 @@ int main() ss << "2020/03"; chrono::year_month ym; - chrono::from_stream(ss, ym, "%Y/%m"); + chrono::from_stream(ss, "%Y/%m", ym); assert(ym == 2020y/3); } } diff --git a/reference/chrono/year_month_day/from_stream.md b/reference/chrono/year_month_day/from_stream.md index e77f989ff9..e0b7a5eb24 100644 --- a/reference/chrono/year_month_day/from_stream.md +++ b/reference/chrono/year_month_day/from_stream.md @@ -47,7 +47,7 @@ int main() ss << "2020-03-01"; chrono::year_month_day ymd; - chrono::from_stream(ss, ymd, "%F"); + chrono::from_stream(ss, "%F", ymd); assert(ymd == 2020y/3/1); } { @@ -55,7 +55,7 @@ int main() ss << "2020-03-01"; chrono::year_month_day ymd; - chrono::from_stream(ss, ymd, "%4F"); // 年の桁数を指定する + chrono::from_stream(ss, "%4F", ymd); // 年の桁数を指定する assert(ymd == 2020y/3/1); } } From b342e52edfe4bcc0dc483827db41737cdcbfaac6 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Fri, 26 Sep 2025 23:17:05 +0900 Subject: [PATCH 2392/3948] =?UTF-8?q?zoned=5Ftime=20=E3=81=AE=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E4=BE=8B=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit コンパイルエラーや assert のエラーを修正しました。 CTAD できていない箇所があったので、テンプレート引数を加えました。 日本時間は UTC+9 ですが、 -9 となっていたので修正しました。 local_time はローカル時間、つまり日本ではAsia/Tokyoタイムゾーンの時間なので、それに合わせて修正しました。 --- reference/chrono/zoned_time/get_local_time.md | 10 +++++----- reference/chrono/zoned_time/get_time_zone.md | 2 +- reference/chrono/zoned_time/op_assign.md | 13 +++++++------ reference/chrono/zoned_time/op_constructor.md | 4 ++-- reference/chrono/zoned_time/op_deduction_guide.md | 4 ++-- reference/chrono/zoned_time/op_local_time.md | 14 +++++++------- reference/chrono/zoned_time/op_sys_time.md | 15 ++++++++++----- 7 files changed, 34 insertions(+), 28 deletions(-) diff --git a/reference/chrono/zoned_time/get_local_time.md b/reference/chrono/zoned_time/get_local_time.md index 58ddb82dfa..01ad8ac3ff 100644 --- a/reference/chrono/zoned_time/get_local_time.md +++ b/reference/chrono/zoned_time/get_local_time.md @@ -38,15 +38,15 @@ int main() { auto now = chrono::system_clock::now(); chrono::local_time local_now{now.time_since_epoch()}; - chrono::local_time local_jst_now = now - chrono::hours{9}; + chrono::local_time local_jst_now = local_now + chrono::hours{9}; // UTCタイムゾーンのシステム時間から、Asia/Tokyoタイムゾーンのローカル時間に変換する chrono::zoned_time zt1{"Asia/Tokyo", now}; chrono::local_time lt1 = zt1.get_local_time(); assert(lt1 == local_jst_now); - // UTCタイムゾーンのローカル時間から、Asia/Tokyoタイムゾーンのローカル時間に変換する - chrono::zoned_time zt2{"Asia/Tokyo", local_now}; + // Asia/Tokyoタイムゾーンのローカル時間から、Asia/Tokyoタイムゾーンのローカル時間に変換する + chrono::zoned_time zt2{"Asia/Tokyo", local_jst_now}; chrono::local_time lt2 = zt2.get_local_time(); assert(lt2 == local_jst_now); @@ -54,7 +54,7 @@ int main() std::cout << "local now (UTC) : " << local_now << std::endl; std::cout << "local now (JST) : " << local_jst_now << std::endl; std::cout << "local now (JST) converted from system now (UTC) : " << lt1 << std::endl; - std::cout << "local now (JST) converted from local now (UTC) : " << lt2 << std::endl; + std::cout << "local now (JST) converted from local now (JST) : " << lt2 << std::endl; } ``` * get_local_time()[color ff0000] @@ -69,7 +69,7 @@ system now (UTC) : 2020-01-21 05:10:15 local now (UTC) : 2020-01-21 05:10:15 local now (JST) : 2020-01-21 14:10:15 local now (JST) converted from system now (UTC) : 2020-01-21 14:10:15 -local now (JST) converted from local now (UTC) : 2020-01-21 14:10:15 +local now (JST) converted from local now (JST) : 2020-01-21 14:10:15 ``` ## バージョン diff --git a/reference/chrono/zoned_time/get_time_zone.md b/reference/chrono/zoned_time/get_time_zone.md index 89dd839f85..ad3638ad46 100644 --- a/reference/chrono/zoned_time/get_time_zone.md +++ b/reference/chrono/zoned_time/get_time_zone.md @@ -29,7 +29,7 @@ int main() auto now = chrono::system_clock::now(); chrono::zoned_time zt1{"Asia/Tokyo", now}; - chrono::time_zone* tz = zt1.get_time_zone(); + const chrono::time_zone* tz = zt1.get_time_zone(); assert(tz == chrono::locate_zone("Asia/Tokyo")); chrono::zoned_time zt2{"UTC", now}; diff --git a/reference/chrono/zoned_time/op_assign.md b/reference/chrono/zoned_time/op_assign.md index 59c2bca354..42c5f5eb54 100644 --- a/reference/chrono/zoned_time/op_assign.md +++ b/reference/chrono/zoned_time/op_assign.md @@ -47,16 +47,17 @@ int main() { auto now = chrono::system_clock::now(); chrono::local_time local_now{now.time_since_epoch()}; + chrono::local_time local_jst_now = local_now + chrono::hours{9}; - chrono::zoned_time zt1{"Asia/Tokyo"}; + chrono::zoned_time zt1{"Asia/Tokyo"}; zt1 = now; assert(zt1.get_sys_time() == now); - assert(zt1.get_local_time() == local_now); + assert(zt1.get_local_time() == local_jst_now); - chrono::zoned_time zt2{"Asia/Tokyo"}; - zt2 = local_now; - assert(zt2.get_local_time() == local_now); - assert(zt2.get_sys_time() == sys_now); + chrono::zoned_time zt2{"Asia/Tokyo"}; + zt2 = local_jst_now; + assert(zt2.get_local_time() == local_jst_now); + assert(zt2.get_sys_time() == now); } ``` * chrono::system_clock[link /reference/chrono/system_clock.md] diff --git a/reference/chrono/zoned_time/op_constructor.md b/reference/chrono/zoned_time/op_constructor.md index 8b0ee3427b..2d85d10596 100644 --- a/reference/chrono/zoned_time/op_constructor.md +++ b/reference/chrono/zoned_time/op_constructor.md @@ -127,11 +127,11 @@ int main() auto now = chrono::system_clock::now(); auto now_sec = chrono::floor(now); chrono::local_time local_now{now.time_since_epoch()}; - chrono::local_time local_jst_now = local_now - chrono::hours{9}; + chrono::local_time local_jst_now = local_now + chrono::hours{9}; // デフォルト構築 chrono::zoned_time zt1{}; - assert(zt.get_time_zone() == chrono::locate_zone("UTC")); + assert(zt1.get_time_zone() == chrono::locate_zone("UTC")); // コピー構築 chrono::zoned_time zt2 = zt1; diff --git a/reference/chrono/zoned_time/op_deduction_guide.md b/reference/chrono/zoned_time/op_deduction_guide.md index 94bdfbda3d..f09c594833 100644 --- a/reference/chrono/zoned_time/op_deduction_guide.md +++ b/reference/chrono/zoned_time/op_deduction_guide.md @@ -117,11 +117,11 @@ int main() static_assert(std::is_same_v< decltype(z4), - chrono::zoned_time + chrono::zoned_time >); static_assert(std::is_same_v< decltype(z5), - chrono::zoned_time + chrono::zoned_time >); } ``` diff --git a/reference/chrono/zoned_time/op_local_time.md b/reference/chrono/zoned_time/op_local_time.md index b45229c92c..bca9485bd4 100644 --- a/reference/chrono/zoned_time/op_local_time.md +++ b/reference/chrono/zoned_time/op_local_time.md @@ -36,23 +36,23 @@ int main() { auto now = chrono::system_clock::now(); chrono::local_time local_now{now.time_since_epoch()}; - chrono::local_time local_jst_now = now - chrono::hours{9}; + chrono::local_time local_jst_now = local_now + chrono::hours{9}; // UTCタイムゾーンのシステム時間から、Asia/Tokyoタイムゾーンのローカル時間に変換する chrono::zoned_time zt1{"Asia/Tokyo", now}; - chrono::local_time lt1{zt1}; + chrono::local_time lt1{zt1}; assert(lt1 == local_jst_now); - // UTCタイムゾーンのローカル時間から、Asia/Tokyoタイムゾーンのローカル時間に変換する - chrono::zoned_time zt2{"Asia/Tokyo", local_now}; - chrono::local_time lt2{zt2}; + // Asia/Tokyoタイムゾーンのローカル時間から、Asia/Tokyoタイムゾーンのローカル時間に変換する + chrono::zoned_time zt2{"Asia/Tokyo", local_jst_now}; + chrono::local_time lt2{zt2}; assert(lt2 == local_jst_now); std::cout << "system now (UTC) : " << now << std::endl; std::cout << "local now (UTC) : " << local_now << std::endl; std::cout << "local now (JST) : " << local_jst_now << std::endl; std::cout << "local now (JST) converted from system now (UTC) : " << lt1 << std::endl; - std::cout << "local now (JST) converted from local now (UTC) : " << lt2 << std::endl; + std::cout << "local now (JST) converted from local now (JST) : " << lt2 << std::endl; } ``` * chrono::local_time[link /reference/chrono/local_time.md] @@ -66,7 +66,7 @@ system now (UTC) : 2020-01-21 05:10:15 local now (UTC) : 2020-01-21 05:10:15 local now (JST) : 2020-01-21 14:10:15 local now (JST) converted from system now (UTC) : 2020-01-21 14:10:15 -local now (JST) converted from local now (UTC) : 2020-01-21 14:10:15 +local now (JST) converted from local now (JST) : 2020-01-21 14:10:15 ``` ## バージョン diff --git a/reference/chrono/zoned_time/op_sys_time.md b/reference/chrono/zoned_time/op_sys_time.md index 822052b22e..d6bb75184e 100644 --- a/reference/chrono/zoned_time/op_sys_time.md +++ b/reference/chrono/zoned_time/op_sys_time.md @@ -33,17 +33,22 @@ int main() { auto now = chrono::system_clock::now(); chrono::local_time local_now{now.time_since_epoch()}; + chrono::local_time local_jst_now = local_now + chrono::hours{9}; chrono::zoned_time zt1{"Asia/Tokyo", now}; - assert(zt1 == now); + assert(zt1.get_sys_time() == now); - chrono::sys_time sys_now = zt1; - assert(sys_now == now); + chrono::sys_time sys_now1 = zt1; + assert(sys_now1 == now); - chrono::zoned_time zt2{"Asia/Tokyo", local_now}; - assert(zt2 == now); + chrono::zoned_time zt2{"Asia/Tokyo", local_jst_now}; + assert(zt2.get_sys_time() == now); + + chrono::sys_time sys_now2 = zt2; + assert(sys_now2 == now); } ``` +* get_sys_time()[link get_sys_time.md] * chrono::local_time[link /reference/chrono/local_time.md] * time_since_epoch()[link /reference/chrono/time_point/time_since_epoch.md] * chrono::system_clock[link /reference/chrono/system_clock.md] From 292600cd9dd79d2086b23bb9196d02d009cffca7 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sat, 27 Sep 2025 15:48:19 +0900 Subject: [PATCH 2393/3948] =?UTF-8?q?utc=5Fclock::to=5Fsys()=20=E3=81=AE?= =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BE=8B=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit from_sys(), to_sys() の戻り値型の duration は seconds との共通型になるので、この場合戻り値型は sys_seconds になります。 --- reference/chrono/utc_clock/to_sys.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/reference/chrono/utc_clock/to_sys.md b/reference/chrono/utc_clock/to_sys.md index 812678a093..36b95c5e4e 100644 --- a/reference/chrono/utc_clock/to_sys.md +++ b/reference/chrono/utc_clock/to_sys.md @@ -32,9 +32,9 @@ using namespace std::chrono; int main() { auto u = utc_clock::from_sys(sys_days{July/1/2015}); - sys_days t = utc_clock::to_sys(u); + sys_seconds t = utc_clock::to_sys(u); - auto leap_seconds = duration_cast(u.time_since_epoch() - t.time_since_epoch()); + auto leap_seconds = u.time_since_epoch() - t.time_since_epoch(); std::cout << u << std::endl; std::cout << t << std::endl; @@ -44,6 +44,7 @@ int main() * to_sys[color ff0000] * from_sys[link from_sys.md] * sys_days[link /reference/chrono/sys_time.md] +* sys_seconds[link /reference/chrono/sys_time.md] * July[link /reference/chrono/month_constants.md] * time_since_epoch()[link /reference/chrono/time_point/time_since_epoch.md] From ea3453a88889866dde3276a430e03ae7a9820329 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sat, 27 Sep 2025 16:11:47 +0900 Subject: [PATCH 2394/3948] =?UTF-8?q?leap=5Fsecond=20=E3=81=AE=E6=AF=94?= =?UTF-8?q?=E8=BC=83=E6=BC=94=E7=AE=97=E5=AD=90=E3=81=AE=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=89=E4=BE=8B=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit leap_second と year_month_day は直接比較できず、 year_month_day を sys_days に変換する必要があります。 --- reference/chrono/leap_second/op_equal.md | 6 ++++-- reference/chrono/leap_second/op_greater.md | 3 ++- reference/chrono/leap_second/op_greater_equal.md | 3 ++- reference/chrono/leap_second/op_less.md | 3 ++- reference/chrono/leap_second/op_less_equal.md | 3 ++- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/reference/chrono/leap_second/op_equal.md b/reference/chrono/leap_second/op_equal.md index f3e8cd5c55..7b1e22a5dc 100644 --- a/reference/chrono/leap_second/op_equal.md +++ b/reference/chrono/leap_second/op_equal.md @@ -55,8 +55,9 @@ using namespace std::chrono_literals; // うるう秒が挿入された日かを判定 bool is_leap_second_day(chrono::year_month_day ymd) { + chrono::sys_days days = ymd; for (const chrono::leap_second& x : chrono::get_tzdb().leap_seconds) { - if (x == ymd) { + if (x == days) { return true; } } @@ -70,8 +71,9 @@ int main() } } ``` -* x == ymd[color ff0000] +* x == days[color ff0000] * chrono::year_month_day[link /reference/chrono/year_month_day.md] +* chrono::sys_days[link /reference/chrono/sys_time.md] * chrono::get_tzdb()[link /reference/chrono/get_tzdb.md] * 1972y[link /reference/chrono/year/op_y.md] diff --git a/reference/chrono/leap_second/op_greater.md b/reference/chrono/leap_second/op_greater.md index 64c99f12cb..10bab8c6b0 100644 --- a/reference/chrono/leap_second/op_greater.md +++ b/reference/chrono/leap_second/op_greater.md @@ -53,12 +53,13 @@ int main() { // 2000年1月1日よりあとにうるう秒が挿入された日を列挙する for (const chrono::leap_second& date : chrono::get_tzdb().leap_seconds) { - if (date > 2000y/1/1) + if (date > chrono::sys_days{2000y/1/1}) std::cout << date.date() << std::endl; } } ``` * chrono::get_tzdb()[link /reference/chrono/get_tzdb.md] +* chrono::sys_days[link /reference/chrono/sys_time.md] * 2000y[link /reference/chrono/year/op_y.md] * date()[link date.md] diff --git a/reference/chrono/leap_second/op_greater_equal.md b/reference/chrono/leap_second/op_greater_equal.md index 21a4e79ff3..13e8ca7a36 100644 --- a/reference/chrono/leap_second/op_greater_equal.md +++ b/reference/chrono/leap_second/op_greater_equal.md @@ -53,12 +53,13 @@ int main() { // 2000年1月1日以降にうるう秒が挿入された日を列挙する for (const chrono::leap_second& date : chrono::get_tzdb().leap_seconds) { - if (date >= 2000y/1/1) + if (date >= chrono::sys_days{2000y/1/1}) std::cout << date.date() << std::endl; } } ``` * chrono::get_tzdb()[link /reference/chrono/get_tzdb.md] +* chrono::sys_days[link /reference/chrono/sys_time.md] * 2000y[link /reference/chrono/year/op_y.md] * date()[link date.md] diff --git a/reference/chrono/leap_second/op_less.md b/reference/chrono/leap_second/op_less.md index 3ba2b4cdb7..40ce082b91 100644 --- a/reference/chrono/leap_second/op_less.md +++ b/reference/chrono/leap_second/op_less.md @@ -67,12 +67,13 @@ int main() { // 2000年未満までにうるう秒が挿入された日を列挙する for (const chrono::leap_second& date : chrono::get_tzdb().leap_seconds) { - if (date < 2000y/1/1) + if (date < chrono::sys_days{2000y/1/1}) std::cout << date.date() << std::endl; } } ``` * chrono::get_tzdb()[link /reference/chrono/get_tzdb.md] +* chrono::sys_days[link /reference/chrono/sys_time.md] * 2000y[link /reference/chrono/year/op_y.md] * date()[link date.md] diff --git a/reference/chrono/leap_second/op_less_equal.md b/reference/chrono/leap_second/op_less_equal.md index d6dd5fe283..3eba5ad6fa 100644 --- a/reference/chrono/leap_second/op_less_equal.md +++ b/reference/chrono/leap_second/op_less_equal.md @@ -53,12 +53,13 @@ int main() { // 2000年以下までにうるう秒が挿入された日を列挙する for (const chrono::leap_second& date : chrono::get_tzdb().leap_seconds) { - if (date <= 2000y/1/1) + if (date <= chrono::sys_days{2000y/1/1}) std::cout << date.date() << std::endl; } } ``` * chrono::get_tzdb()[link /reference/chrono/get_tzdb.md] +* chrono::sys_days[link /reference/chrono/sys_time.md] * 2000y[link /reference/chrono/year/op_y.md] * date()[link date.md] From 50237d0bdcd651724a53812e88e5a6ad9cae20f3 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sat, 27 Sep 2025 16:21:06 +0900 Subject: [PATCH 2395/3948] =?UTF-8?q?chrono=20=E3=81=AE=E3=81=84=E3=81=8F?= =?UTF-8?q?=E3=81=A4=E3=81=8B=E3=81=AE=E3=82=B3=E3=83=BC=E3=83=89=E4=BE=8B?= =?UTF-8?q?=E3=81=AE=E3=82=B3=E3=83=B3=E3=83=91=E3=82=A4=E3=83=AB=E3=82=A8?= =?UTF-8?q?=E3=83=A9=E3=83=BC=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/chrono/choose.md | 4 ++-- reference/chrono/file_time.md | 2 +- reference/chrono/hh_mm_ss/op_ostream.md | 1 + reference/chrono/leap_second/date.md | 3 ++- reference/chrono/leap_second/value.md | 5 +++-- reference/chrono/local-time-format-t.md | 2 +- reference/chrono/local-time-format-t/formatter.md | 2 +- reference/chrono/local_time.md | 1 + reference/chrono/local_time_format.md | 2 +- reference/chrono/sys_time.md | 2 +- reference/chrono/tai_time.md | 2 +- reference/chrono/time_zone/to_sys.md | 4 ++-- reference/chrono/utc_time.md | 2 +- 13 files changed, 18 insertions(+), 14 deletions(-) diff --git a/reference/chrono/choose.md b/reference/chrono/choose.md index ba5913771f..da02d5e389 100644 --- a/reference/chrono/choose.md +++ b/reference/chrono/choose.md @@ -43,13 +43,13 @@ int main() // ここではlatestを指定することで、遅い時間 (06:30:00) を選択する chrono::local_time local_now = chrono::local_days{2016y/11/6} + 1h + 30min; - chrono::zoned_time zt{"America/New_York", local_now, choose::latest}; + chrono::zoned_time zt{"America/New_York", local_now, chrono::choose::latest}; chrono::sys_time st = zt.get_sys_time(); std::cout << st << std::endl; } ``` -* choose::latest[color ff0000] +* chrono::choose::latest[color ff0000] * chrono::local_days[link local_time.md] * chrono::local_time[link local_time.md] * 2016y[link year/op_y.md] diff --git a/reference/chrono/file_time.md b/reference/chrono/file_time.md index 78f642128b..10e3d7a868 100644 --- a/reference/chrono/file_time.md +++ b/reference/chrono/file_time.md @@ -184,7 +184,7 @@ int main() std::cout << std::format("5 : %F", tp) << std::endl; // 時間だけ出力 - std::cout << std::format("6 : %H時%M分%S秒", lt) << std::endl; + std::cout << std::format("6 : %H時%M分%S秒", tp) << std::endl; std::cout << std::format("7 : %T", tp) << std::endl; } ``` diff --git a/reference/chrono/hh_mm_ss/op_ostream.md b/reference/chrono/hh_mm_ss/op_ostream.md index 915683021b..98ca85a5fb 100644 --- a/reference/chrono/hh_mm_ss/op_ostream.md +++ b/reference/chrono/hh_mm_ss/op_ostream.md @@ -38,6 +38,7 @@ namespace std::chrono { #include #include +namespace chrono = std::chrono; using std::chrono::last; using namespace std::chrono_literals; diff --git a/reference/chrono/leap_second/date.md b/reference/chrono/leap_second/date.md index eab7f0d54e..70e7a67dd1 100644 --- a/reference/chrono/leap_second/date.md +++ b/reference/chrono/leap_second/date.md @@ -21,13 +21,14 @@ constexpr sys_seconds date() const noexcept; // (1) C++20 ## 例 ```cpp example #include +#include #include namespace chrono = std::chrono; int main() { - for (const chrono::leap_seconds date : chrono::get_tzdb().leap_seconds) { + for (const chrono::leap_second date : chrono::get_tzdb().leap_seconds) { chrono::sys_seconds s = date.date(); std::cout << s << std::endl; } diff --git a/reference/chrono/leap_second/value.md b/reference/chrono/leap_second/value.md index 9c16441bf6..ad7d56b99d 100644 --- a/reference/chrono/leap_second/value.md +++ b/reference/chrono/leap_second/value.md @@ -24,15 +24,16 @@ constexpr seconds value() const noexcept; // (1) C++20 ## 例 ```cpp example #include +#include #include namespace chrono = std::chrono; int main() { - for (const chrono::leap_seconds date : chrono::get_tzdb().leap_seconds) { + for (const chrono::leap_second date : chrono::get_tzdb().leap_seconds) { chrono::seconds value = date.value(); - std::cout << date.date() << << ": " << value << std::endl; + std::cout << date.date() << ": " << value << std::endl; } } ``` diff --git a/reference/chrono/local-time-format-t.md b/reference/chrono/local-time-format-t.md index f23666dc1d..6f49a0d7ad 100644 --- a/reference/chrono/local-time-format-t.md +++ b/reference/chrono/local-time-format-t.md @@ -55,7 +55,7 @@ int main() std::cout << std::format("{:%Y/%m/%d %H:%M:%S %Z}", ltf) << std::endl; } { - auto ltf = chrono::local_time_format(lt, "JST", &si.abbrev, &si.offset); + auto ltf = chrono::local_time_format(lt, &si.abbrev, &si.offset); std::cout << std::format("{:%Y/%m/%d %H:%M:%S %Z%z}", ltf) << std::endl; } } diff --git a/reference/chrono/local-time-format-t/formatter.md b/reference/chrono/local-time-format-t/formatter.md index ed11489ae8..251e5eb5a9 100644 --- a/reference/chrono/local-time-format-t/formatter.md +++ b/reference/chrono/local-time-format-t/formatter.md @@ -44,7 +44,7 @@ int main() std::cout << std::format("{:%Y/%m/%d %H:%M:%S %Z}", ltf) << std::endl; } { - auto ltf = chrono::local_time_format(lt, "JST", &si.abbrev, &si.offset); + auto ltf = chrono::local_time_format(lt, &si.abbrev, &si.offset); std::cout << std::format("{:%Y/%m/%d %H:%M:%S %Z%z}", ltf) << std::endl; } } diff --git a/reference/chrono/local_time.md b/reference/chrono/local_time.md index 3a6afb6ad6..d1c47231c2 100644 --- a/reference/chrono/local_time.md +++ b/reference/chrono/local_time.md @@ -81,6 +81,7 @@ namespace std { #include namespace chrono = std::chrono; +using namespace std::chrono_literals; int main() { diff --git a/reference/chrono/local_time_format.md b/reference/chrono/local_time_format.md index c9161d6827..153e7b7985 100644 --- a/reference/chrono/local_time_format.md +++ b/reference/chrono/local_time_format.md @@ -50,7 +50,7 @@ int main() std::cout << std::format("{:%Y/%m/%d %H:%M:%S %Z}", ltf) << std::endl; } { - auto ltf = chrono::local_time_format(lt, "JST", &si.abbrev, &si.offset); + auto ltf = chrono::local_time_format(lt, &si.abbrev, &si.offset); std::cout << std::format("{:%Y/%m/%d %H:%M:%S %Z%z}", ltf) << std::endl; } } diff --git a/reference/chrono/sys_time.md b/reference/chrono/sys_time.md index 002c44c81f..ccd499c6a5 100644 --- a/reference/chrono/sys_time.md +++ b/reference/chrono/sys_time.md @@ -217,7 +217,7 @@ namespace chrono = std::chrono; int main() { chrono::system_clock::time_point now = chrono::system_clock::now(); - chrono::sys_seconds now_sec = chrono::floor(tp); + chrono::sys_seconds now_sec = chrono::floor(now); // デフォルトフォーマット std::cout << std::format("1 : {}", now_sec) << std::endl; diff --git a/reference/chrono/tai_time.md b/reference/chrono/tai_time.md index 52cd89d3fa..d780963d25 100644 --- a/reference/chrono/tai_time.md +++ b/reference/chrono/tai_time.md @@ -167,7 +167,7 @@ namespace chrono = std::chrono; int main() { chrono::tai_clock::time_point now = chrono::tai_clock::now(); - chrono::tai_seconds now_sec = chrono::floor(tp); + chrono::tai_seconds now_sec = chrono::floor(now); // デフォルトフォーマット std::cout << std::format("1 : {}", now_sec) << std::endl; diff --git a/reference/chrono/time_zone/to_sys.md b/reference/chrono/time_zone/to_sys.md index f5fa214333..ef9ad6c7a8 100644 --- a/reference/chrono/time_zone/to_sys.md +++ b/reference/chrono/time_zone/to_sys.md @@ -87,7 +87,7 @@ int main() // chooseを指定した場合は、早い時間か遅い時間のどちらかを返す。 // ここではlatestを指定しているため、遅い方の時間を返す - chrono::sys_time edt_to_utc = edt->to_sys(edt_now, choose::latest); + chrono::sys_time edt_to_utc = edt->to_sys(edt_now, chrono::choose::latest); std::cout << edt_to_utc << std::endl; } ``` @@ -104,7 +104,7 @@ int main() * chrono::local_days[link /reference/chrono/local_time.md] * chrono::sys_time[link /reference/chrono/sys_time.md] * chrono::ambiguous_local_time[link /reference/chrono/ambiguous_local_time.md] -* choose::latest[link /reference/chrono/choose.md] +* chrono::choose::latest[link /reference/chrono/choose.md] * chrono::floor[link /reference/chrono/time_point/floor.md] ### 出力例 diff --git a/reference/chrono/utc_time.md b/reference/chrono/utc_time.md index 59ccbf59b7..2a16f9431b 100644 --- a/reference/chrono/utc_time.md +++ b/reference/chrono/utc_time.md @@ -162,7 +162,7 @@ namespace chrono = std::chrono; int main() { chrono::utc_clock::time_point now = chrono::utc_clock::now(); - chrono::utc_seconds now_sec = chrono::floor(tp); + chrono::utc_seconds now_sec = chrono::floor(now); // デフォルトフォーマット std::cout << std::format("1 : {}", now_sec) << std::endl; From 55d08282da0455603832a9a3937a2e3073cd36aa Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sat, 27 Sep 2025 16:35:26 +0900 Subject: [PATCH 2396/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BE=8B?= =?UTF-8?q?=E3=81=AE=E3=83=95=E3=82=A9=E3=83=BC=E3=83=9E=E3=83=83=E3=83=88?= =?UTF-8?q?=E6=96=87=E5=AD=97=E5=88=97=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit フォーマットフラグが波カッコで囲われていないものを修正しました。 以下の正規表現で一括変換しました。 std::format\(([^"][^,]*, )?"([^{%]*)(%[^"]+)" ↓ std::format($1"$2{:$3}" --- reference/chrono/file_time.md | 8 ++++---- reference/chrono/local_time.md | 8 ++++---- reference/chrono/sys_time.md | 8 ++++---- reference/chrono/tai_time.md | 8 ++++---- reference/chrono/utc_time.md | 8 ++++---- reference/chrono/zoned_time.md | 10 +++++----- reference/chrono/zoned_time/formatter.md | 10 +++++----- 7 files changed, 30 insertions(+), 30 deletions(-) diff --git a/reference/chrono/file_time.md b/reference/chrono/file_time.md index 10e3d7a868..fa2a1239bb 100644 --- a/reference/chrono/file_time.md +++ b/reference/chrono/file_time.md @@ -180,12 +180,12 @@ int main() std::cout << std::format("3 : {0:%Y/%m/%d %H:%M:%S}", tp) << std::endl; // 日付だけ出力 - std::cout << std::format("4 : %Y年%m月%d日", tp) << std::endl; - std::cout << std::format("5 : %F", tp) << std::endl; + std::cout << std::format("4 : {:%Y年%m月%d日}", tp) << std::endl; + std::cout << std::format("5 : {:%F}", tp) << std::endl; // 時間だけ出力 - std::cout << std::format("6 : %H時%M分%S秒", tp) << std::endl; - std::cout << std::format("7 : %T", tp) << std::endl; + std::cout << std::format("6 : {:%H時%M分%S秒}", tp) << std::endl; + std::cout << std::format("7 : {:%T}", tp) << std::endl; } ``` * fs::file_time_type[link /reference/filesystem/file_time_type.md] diff --git a/reference/chrono/local_time.md b/reference/chrono/local_time.md index d1c47231c2..868a3c5d05 100644 --- a/reference/chrono/local_time.md +++ b/reference/chrono/local_time.md @@ -196,12 +196,12 @@ int main() std::cout << std::format("3 : {0:%Y/%m/%d %H:%M:%S}", lt) << std::endl; // 日付だけ出力 - std::cout << std::format("4 : %Y年%m月%d日", lt) << std::endl; - std::cout << std::format("5 : %F", lt) << std::endl; + std::cout << std::format("4 : {:%Y年%m月%d日}", lt) << std::endl; + std::cout << std::format("5 : {:%F}", lt) << std::endl; // 時間だけ出力 - std::cout << std::format("6 : %H時%M分%S秒", lt) << std::endl; - std::cout << std::format("7 : %T", lt) << std::endl; + std::cout << std::format("6 : {:%H時%M分%S秒}", lt) << std::endl; + std::cout << std::format("7 : {:%T}", lt) << std::endl; // 12時間時計で出力 // (%pでロケール固有の「午前」「午後」を出力するには、日本のロケールを指定する必要がある) diff --git a/reference/chrono/sys_time.md b/reference/chrono/sys_time.md index ccd499c6a5..4002f85f0d 100644 --- a/reference/chrono/sys_time.md +++ b/reference/chrono/sys_time.md @@ -229,12 +229,12 @@ int main() std::cout << std::format("3 : {0:%Y/%m/%d %H:%M:%S %Z}", now_sec) << std::endl; // 日付だけ出力 - std::cout << std::format("4 : %Y年%m月%d日", now_sec) << std::endl; - std::cout << std::format("5 : %F", now_sec) << std::endl; + std::cout << std::format("4 : {:%Y年%m月%d日}", now_sec) << std::endl; + std::cout << std::format("5 : {:%F}", now_sec) << std::endl; // 時間だけ出力 - std::cout << std::format("6 : %H時%M分%S秒", now_sec) << std::endl; - std::cout << std::format("7 : %T", now_sec) << std::endl; + std::cout << std::format("6 : {:%H時%M分%S秒}", now_sec) << std::endl; + std::cout << std::format("7 : {:%T}", now_sec) << std::endl; } ``` * chrono::system_clock[link system_clock.md] diff --git a/reference/chrono/tai_time.md b/reference/chrono/tai_time.md index d780963d25..3dd6fe98bf 100644 --- a/reference/chrono/tai_time.md +++ b/reference/chrono/tai_time.md @@ -179,12 +179,12 @@ int main() std::cout << std::format("3 : {0:%Y/%m/%d %H:%M:%S %Z}", now_sec) << std::endl; // 日付だけ出力 - std::cout << std::format("4 : %Y年%m月%d日", now_sec) << std::endl; - std::cout << std::format("5 : %F", now_sec) << std::endl; + std::cout << std::format("4 : {:%Y年%m月%d日}", now_sec) << std::endl; + std::cout << std::format("5 : {:%F}", now_sec) << std::endl; // 時間だけ出力 - std::cout << std::format("6 : %H時%M分%S秒", now_sec) << std::endl; - std::cout << std::format("7 : %T", now_sec) << std::endl; + std::cout << std::format("6 : {:%H時%M分%S秒}", now_sec) << std::endl; + std::cout << std::format("7 : {:%T}", now_sec) << std::endl; } ``` * chrono::tai_clock[link tai_clock.md] diff --git a/reference/chrono/utc_time.md b/reference/chrono/utc_time.md index 2a16f9431b..e7e1b656ee 100644 --- a/reference/chrono/utc_time.md +++ b/reference/chrono/utc_time.md @@ -174,12 +174,12 @@ int main() std::cout << std::format("3 : {0:%Y/%m/%d %H:%M:%S %Z}", now_sec) << std::endl; // 日付だけ出力 - std::cout << std::format("4 : %Y年%m月%d日", now_sec) << std::endl; - std::cout << std::format("5 : %F", now_sec) << std::endl; + std::cout << std::format("4 : {:%Y年%m月%d日}", now_sec) << std::endl; + std::cout << std::format("5 : {:%F}", now_sec) << std::endl; // 時間だけ出力 - std::cout << std::format("6 : %H時%M分%S秒", now_sec) << std::endl; - std::cout << std::format("7 : %T", now_sec) << std::endl; + std::cout << std::format("6 : {:%H時%M分%S秒}", now_sec) << std::endl; + std::cout << std::format("7 : {:%T}", now_sec) << std::endl; } ``` * chrono::utc_clock[link utc_clock.md] diff --git a/reference/chrono/zoned_time.md b/reference/chrono/zoned_time.md index 6fd7254a28..23b9b3d503 100644 --- a/reference/chrono/zoned_time.md +++ b/reference/chrono/zoned_time.md @@ -176,16 +176,16 @@ int main() std::cout << std::format("4 : {0:%Y/%m/%d %H:%M:%S}", zt_sec) << std::endl; // 日付だけ出力 - std::cout << std::format("5 : %Y年%m月%d日", zt_sec) << std::endl; - std::cout << std::format("6 : %F", zt_sec) << std::endl; + std::cout << std::format("5 : {:%Y年%m月%d日}", zt_sec) << std::endl; + std::cout << std::format("6 : {:%F}", zt_sec) << std::endl; // 時間だけ出力 - std::cout << std::format("7 : %H時%M分%S秒", zt_sec) << std::endl; - std::cout << std::format("8 : %T", zt_sec) << std::endl; + std::cout << std::format("7 : {:%H時%M分%S秒}", zt_sec) << std::endl; + std::cout << std::format("8 : {:%T}", zt_sec) << std::endl; // 12時間時計で出力 // (%pでロケール固有の「午前」「午後」を出力するには、日本のロケールを指定する必要がある) - std::cout << std::format(std::locale("ja_JP.UTF-8"), "9 : %Y年%m月%d日 %p %I時%M分%S秒", zt_sec) << std::endl; + std::cout << std::format(std::locale("ja_JP.UTF-8"), "9 : {:%Y年%m月%d日 %p %I時%M分%S秒}", zt_sec) << std::endl; } ``` * chrono::zoned_time[color ff0000] diff --git a/reference/chrono/zoned_time/formatter.md b/reference/chrono/zoned_time/formatter.md index 4ad843b46c..92d6a2651e 100644 --- a/reference/chrono/zoned_time/formatter.md +++ b/reference/chrono/zoned_time/formatter.md @@ -52,16 +52,16 @@ int main() std::cout << std::format("4 : {0:%Y/%m/%d %H:%M:%S}", zt_sec) << std::endl; // 日付だけ出力 - std::cout << std::format("5 : %Y年%m月%d日", zt_sec) << std::endl; - std::cout << std::format("6 : %F", zt_sec) << std::endl; + std::cout << std::format("5 : {:%Y年%m月%d日}", zt_sec) << std::endl; + std::cout << std::format("6 : {:%F}", zt_sec) << std::endl; // 時間だけ出力 - std::cout << std::format("7 : %H時%M分%S秒", zt_sec) << std::endl; - std::cout << std::format("8 : %T", zt_sec) << std::endl; + std::cout << std::format("7 : {:%H時%M分%S秒}", zt_sec) << std::endl; + std::cout << std::format("8 : {:%T}", zt_sec) << std::endl; // 12時間時計で出力 // (%pでロケール固有の「午前」「午後」を出力するには、日本のロケールを指定する必要がある) - std::cout << std::format(std::locale("ja_JP.UTF-8"), "9 : %Y年%m月%d日 %p %I時%M分%S秒", zt_sec) << std::endl; + std::cout << std::format(std::locale("ja_JP.UTF-8"), "9 : {:%Y年%m月%d日 %p %I時%M分%S秒}", zt_sec) << std::endl; } ``` * chrono::system_clock[link /reference/chrono/system_clock.md] From 699900b1379738a30e89d6b7e44e8f90b4a45c1e Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sat, 27 Sep 2025 17:41:47 +0900 Subject: [PATCH 2397/3948] =?UTF-8?q?=E5=87=BA=E5=8A=9B=E4=BE=8B=E3=80=81?= =?UTF-8?q?=E5=87=A6=E7=90=86=E7=B3=BB=E3=81=AE=E8=A8=98=E8=BC=89=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/chrono/local_info/op_ostream.md | 5 ++--- reference/chrono/sys_info/op_ostream.md | 5 ++--- reference/chrono/time_zone/to_sys.md | 8 +++++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/reference/chrono/local_info/op_ostream.md b/reference/chrono/local_info/op_ostream.md index 0816a4bbe6..66e3087dcf 100644 --- a/reference/chrono/local_info/op_ostream.md +++ b/reference/chrono/local_info/op_ostream.md @@ -55,15 +55,14 @@ int main() ### 出力例 ``` +[[1951-09-08 15:00:00,32767-12-31 00:00:00,09:00:00,0min,JST]] ``` -(未検証) - ## バージョン ### 言語 - C++20 ### 処理系 - [Clang](/implementation.md#clang): 9.0 [mark noimpl] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 15.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/sys_info/op_ostream.md b/reference/chrono/sys_info/op_ostream.md index ac7239a1d2..b05b676bbd 100644 --- a/reference/chrono/sys_info/op_ostream.md +++ b/reference/chrono/sys_info/op_ostream.md @@ -52,15 +52,14 @@ int main() ### 出力例 ``` +[1951-09-08 15:00:00,32767-12-31 00:00:00,09:00:00,0min,JST] ``` -(未検証) - ## バージョン ### 言語 - C++20 ### 処理系 - [Clang](/implementation.md#clang): 9.0 [mark noimpl] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 15.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/time_zone/to_sys.md b/reference/chrono/time_zone/to_sys.md index ef9ad6c7a8..be513ff8d1 100644 --- a/reference/chrono/time_zone/to_sys.md +++ b/reference/chrono/time_zone/to_sys.md @@ -109,17 +109,19 @@ int main() ### 出力例 ``` +2016-11-06 01:30:00 is ambiguous. It could be +2016-11-06 01:30:00 EDT == 2016-11-06 05:30:00 UTC or +2016-11-06 01:30:00 EST == 2016-11-06 06:30:00 UTC +2016-11-06 06:30:00 ``` -(未検証) - ## バージョン ### 言語 - C++20 ### 処理系 - [Clang](/implementation.md#clang): 9.0 [mark noimpl] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 15.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] From da5a5dcfca300d5754ad3f4588870677053539b6 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sun, 28 Sep 2025 01:03:34 +0900 Subject: [PATCH 2398/3948] =?UTF-8?q?=E3=81=84=E3=81=8F=E3=81=A4=E3=81=8B?= =?UTF-8?q?=E3=81=AE=E3=82=B3=E3=83=BC=E3=83=89=E4=BE=8B=E3=81=AE=E3=82=B3?= =?UTF-8?q?=E3=83=B3=E3=83=91=E3=82=A4=E3=83=AB=E3=82=A8=E3=83=A9=E3=83=BC?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_count.md | 2 +- reference/algorithm/ranges_find_end.md | 7 ++++--- reference/algorithm/ranges_find_first_of.md | 4 +--- reference/algorithm/ranges_fold_right.md | 6 +++--- reference/algorithm/ranges_for_each.md | 2 +- reference/algorithm/ranges_for_each_n.md | 2 +- reference/algorithm/ranges_transform.md | 3 +-- reference/algorithm/transform.md | 3 +-- reference/limits/numeric_limits/max_digits10.md | 1 + reference/memory/declare_no_pointers.md | 2 +- reference/syncstream/basic_osyncstream/emit.md | 2 +- reference/syncstream/basic_osyncstream/rdbuf.md | 2 +- reference/syncstream/basic_syncbuf/get_wrapped.md | 2 +- reference/syncstream/basic_syncbuf/swap.md | 2 +- reference/syncstream/basic_syncbuf/swap_free.md | 2 +- reference/system_error/error_condition/message.md | 2 +- .../unordered_set/unordered_multiset/hash_function.md | 2 +- reference/unordered_set/unordered_multiset/key_eq.md | 2 +- reference/valarray/slice/op_equal.md | 6 +++--- 19 files changed, 26 insertions(+), 28 deletions(-) diff --git a/reference/algorithm/ranges_count.md b/reference/algorithm/ranges_count.md index 1863ea3121..4cea7f80fd 100644 --- a/reference/algorithm/ranges_count.md +++ b/reference/algorithm/ranges_count.md @@ -145,7 +145,7 @@ struct Item { }; int main() { - std::vector v = { + std::vector v = { {1, "foo"}, {3, "bar"}, {5, "foo"}, diff --git a/reference/algorithm/ranges_find_end.md b/reference/algorithm/ranges_find_end.md index fb9caa8128..6369dfd7ef 100644 --- a/reference/algorithm/ranges_find_end.md +++ b/reference/algorithm/ranges_find_end.md @@ -66,19 +66,20 @@ namespace std::ranges { #include #include #include +#include int main() { std::vector v = { 1,2,1,2,3 }; std::list ls = { 1,2 }; // 1,2 と連続している最後のシーケンスを探す - subrange it = std::ranges::find_end(v, ls); + std::ranges::subrange sr = std::ranges::find_end(v, ls); // v[2] の位置を指すイテレータが見つかる。 // v[0] の位置を指すイテレータではない。 - if (it == v.end()) { + if (sr.empty()) { std::cout << "not found" << std::endl; } else { - std::cout << "found: index==" << std::distance(v.begin(), it) << std::endl; + std::cout << "found: index==" << std::distance(v.begin(), sr.begin()) << std::endl; } } ``` diff --git a/reference/algorithm/ranges_find_first_of.md b/reference/algorithm/ranges_find_first_of.md index b385eb8f34..a4beb961ab 100644 --- a/reference/algorithm/ranges_find_first_of.md +++ b/reference/algorithm/ranges_find_first_of.md @@ -68,7 +68,7 @@ int main() { std::list ls = { 2,4,6,8 }; // 2,4,6,8 のどれかと一致する最初の要素を返す - auto it = std::ranges::find_first_of(v, ls.begin(), ls.end()); + auto it = std::ranges::find_first_of(v, ls); if (it == v.end()) { std::cout << "not found" << std::endl; } else { @@ -77,8 +77,6 @@ int main() { } ``` * std::ranges::find_first_of[color ff0000] -* ls.begin()[link /reference/list/list/begin.md] -* ls.end()[link /reference/list/list/end.md] ### 出力 ``` diff --git a/reference/algorithm/ranges_fold_right.md b/reference/algorithm/ranges_fold_right.md index 9d90cfa0ca..5611e23a16 100644 --- a/reference/algorithm/ranges_fold_right.md +++ b/reference/algorithm/ranges_fold_right.md @@ -160,7 +160,7 @@ return accum; #include #include #include -#include +#include #include using namespace std::ranges; @@ -206,7 +206,7 @@ int main() { #include #include #include -#include +#include #include using namespace std::ranges; @@ -253,7 +253,7 @@ init -> f -> e -> d -> c -> b -> a #include #include #include -#include +#include #include using namespace std::ranges; diff --git a/reference/algorithm/ranges_for_each.md b/reference/algorithm/ranges_for_each.md index e9a3ef5a9c..8638277ae9 100644 --- a/reference/algorithm/ranges_for_each.md +++ b/reference/algorithm/ranges_for_each.md @@ -79,7 +79,7 @@ for_each_result { #include int main() { - constexpr std::array v = { 3, 1, 4 }; + std::array v = { 3, 1, 4 }; // vの全ての要素にラムダ式を適用する std::ranges::for_each(v, [](int x) { std::cout << x << std::endl; }); diff --git a/reference/algorithm/ranges_for_each_n.md b/reference/algorithm/ranges_for_each_n.md index 92b0e79c72..7095a7aebb 100644 --- a/reference/algorithm/ranges_for_each_n.md +++ b/reference/algorithm/ranges_for_each_n.md @@ -62,7 +62,7 @@ void f(int& x) int main() { - constexpr std::array v = {3, 1, 4, 5, 2}; + std::array v = {3, 1, 4, 5, 2}; // コンテナvの先頭3要素に、関数f()を適用する。 // 関数f()は要素の変更を行う diff --git a/reference/algorithm/ranges_transform.md b/reference/algorithm/ranges_transform.md index 349d48de6e..6650810acb 100644 --- a/reference/algorithm/ranges_transform.md +++ b/reference/algorithm/ranges_transform.md @@ -172,7 +172,7 @@ int main() { std::vector result; // v1[n] の文字を v2[n] 回繰り返した文字列を返す - std::ranges::transform(v1, v2, std::back_inserter(result), [](char a, int b) { return std::to_string(b, a); }); + std::ranges::transform(v1, v2, std::back_inserter(result), [](char a, int b) { return std::string(b, a); }); for (const std::string& s : result) { std::cout << s << std::endl; @@ -180,7 +180,6 @@ int main() { } ``` * std::ranges::transform[color ff0000] -* std::to_string[link /reference/string/to_string.md] ### 出力 ``` diff --git a/reference/algorithm/transform.md b/reference/algorithm/transform.md index 3c49dc84c9..425eb20878 100644 --- a/reference/algorithm/transform.md +++ b/reference/algorithm/transform.md @@ -136,7 +136,7 @@ int main() { // v1[n] の文字を v2[n] 回繰り返した文字列を返す std::transform(v1.begin(), v1.end(), v2.begin(), std::back_inserter(result), - [](char a, int b) { return std::to_string(b, a); }); + [](char a, int b) { return std::string(b, a); }); std::for_each(result.begin(), result.end(), [](const std::string& s) { std::cout << s << std::endl; }); @@ -145,7 +145,6 @@ int main() { * std::transform[color ff0000] * result.begin()[link /reference/vector/vector/begin.md] * result.end()[link /reference/vector/vector/end.md] -* std::to_string[link /reference/string/to_string.md] ### 出力 ``` diff --git a/reference/limits/numeric_limits/max_digits10.md b/reference/limits/numeric_limits/max_digits10.md index 9ba4305ba0..10a2c46c6a 100644 --- a/reference/limits/numeric_limits/max_digits10.md +++ b/reference/limits/numeric_limits/max_digits10.md @@ -40,6 +40,7 @@ static constexpr int max_digits10; #include #include #include +#include std::string make_float_string(float f, int digits) { std::stringstream s; diff --git a/reference/memory/declare_no_pointers.md b/reference/memory/declare_no_pointers.md index 45a6d7f7be..fc49983ca2 100644 --- a/reference/memory/declare_no_pointers.md +++ b/reference/memory/declare_no_pointers.md @@ -55,7 +55,7 @@ namespace std { // GC負荷が大きい関数のダミー定義 void some_operation_that_cause_gc() {} -int* ptr = nullptr; +intptr_t* ptr = nullptr; int main() { diff --git a/reference/syncstream/basic_osyncstream/emit.md b/reference/syncstream/basic_osyncstream/emit.md index 59493c5283..2066cbbe3b 100644 --- a/reference/syncstream/basic_osyncstream/emit.md +++ b/reference/syncstream/basic_osyncstream/emit.md @@ -46,7 +46,7 @@ void emit(); int main() { - osyncstream bout(std::cout); + std::osyncstream bout(std::cout); bout << "Hello," << '\n'; // フラッシュしない bout.emit(); // 文字は転送される。std::cout はフラッシュしない bout << "World!" << std::endl; // フラッシュしない。std::cout はフラッシュしない diff --git a/reference/syncstream/basic_osyncstream/rdbuf.md b/reference/syncstream/basic_osyncstream/rdbuf.md index fbc0e01607..08d401319f 100644 --- a/reference/syncstream/basic_osyncstream/rdbuf.md +++ b/reference/syncstream/basic_osyncstream/rdbuf.md @@ -30,7 +30,7 @@ syncbuf_type* rdbuf() const noexcept; int main() { std::osyncstream bout(std::cout); - bout1 << "Hello, "; + bout << "Hello, "; auto syncbuf_ptr = bout.rdbuf(); syncbuf_ptr->emit(); // 文字が転送される diff --git a/reference/syncstream/basic_syncbuf/get_wrapped.md b/reference/syncstream/basic_syncbuf/get_wrapped.md index 7a56f6b90a..f88d3d3a52 100644 --- a/reference/syncstream/basic_syncbuf/get_wrapped.md +++ b/reference/syncstream/basic_syncbuf/get_wrapped.md @@ -30,7 +30,7 @@ streambuf_type* get_wrapped() const noexcept; int main() { std::osyncstream bout(std::cout); - bout1 << "Hello, "; + bout << "Hello, "; { // 通常、std::osyncstream::get_wrapped() から呼ばれる。 std::osyncstream(bout.get_wrapped()) << "Goodbye, " << "Planet!" << '\n'; diff --git a/reference/syncstream/basic_syncbuf/swap.md b/reference/syncstream/basic_syncbuf/swap.md index 4e3f50fc05..f18b2a8c4c 100644 --- a/reference/syncstream/basic_syncbuf/swap.md +++ b/reference/syncstream/basic_syncbuf/swap.md @@ -41,7 +41,7 @@ int main() std::osyncstream aout{std::cout}; aout << "Hello, "; - std::osyncstream bout; + std::osyncstream bout{std::cout}; bout << "World!"; aout.rdbuf()->swap(*bout.rdbuf()); diff --git a/reference/syncstream/basic_syncbuf/swap_free.md b/reference/syncstream/basic_syncbuf/swap_free.md index 1aaecf1f6f..e29f008e3a 100644 --- a/reference/syncstream/basic_syncbuf/swap_free.md +++ b/reference/syncstream/basic_syncbuf/swap_free.md @@ -40,7 +40,7 @@ int main() std::osyncstream aout{std::cout}; aout << "Hello, "; - std::osyncstream bout; + std::osyncstream bout{std::cout}; bout << "World!"; std::swap(*aout.rdbuf(), *bout.rdbuf()); diff --git a/reference/system_error/error_condition/message.md b/reference/system_error/error_condition/message.md index c9879b34df..51435eff67 100644 --- a/reference/system_error/error_condition/message.md +++ b/reference/system_error/error_condition/message.md @@ -34,7 +34,7 @@ int main() std::error_condition econd(static_cast(std::errc::invalid_argument), std::generic_category()); - std::cout << ec.message() << std::endl; + std::cout << econd.message() << std::endl; } ``` * message()[color ff0000] diff --git a/reference/unordered_set/unordered_multiset/hash_function.md b/reference/unordered_set/unordered_multiset/hash_function.md index 6513c2e7d9..f5c5335827 100644 --- a/reference/unordered_set/unordered_multiset/hash_function.md +++ b/reference/unordered_set/unordered_multiset/hash_function.md @@ -44,7 +44,7 @@ int main() { std::unordered_multiset ums{ 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, }; - decltype(um)::hasher hash{ ums.hash_function() }; + decltype(ums)::hasher hash{ ums.hash_function() }; std::cout << "hash(1) = " << hash(1) << std::endl; std::cout << "hash(2) = " << hash(2) << std::endl; diff --git a/reference/unordered_set/unordered_multiset/key_eq.md b/reference/unordered_set/unordered_multiset/key_eq.md index c30fd02ac7..c02bc41b9a 100644 --- a/reference/unordered_set/unordered_multiset/key_eq.md +++ b/reference/unordered_set/unordered_multiset/key_eq.md @@ -42,7 +42,7 @@ int main() std::unordered_multiset ums{ 1, 2, 3, 4, 5, 6, }; - decltype(um)::key_equal eq{ ums.key_eq() }; + decltype(ums)::key_equal eq{ ums.key_eq() }; std::cout << "eq(1, 2) = " << eq(1, 2) << std::endl; std::cout << "eq(1, 1) = " << eq(1, 1) << std::endl; diff --git a/reference/valarray/slice/op_equal.md b/reference/valarray/slice/op_equal.md index 6a3e79beaf..cceeee4711 100644 --- a/reference/valarray/slice/op_equal.md +++ b/reference/valarray/slice/op_equal.md @@ -37,9 +37,9 @@ return x.start() == y.start() && int main() { - std::slice s1{.start = 3, .length = 5, .stride = 7}; - std::slice s2{.start = 3, .length = 5, .stride = 7}; - std::slice s3{.start = 3, .length = 5, .stride = 6}; + std::slice s1{3, 5, 7}; + std::slice s2{3, 5, 7}; + std::slice s3{3, 5, 6}; assert(s1 == s2); assert(s1 != s3); From 5c792ff69e2d818f159ee83de3c41e6c87f16eea Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sun, 28 Sep 2025 20:38:10 +0900 Subject: [PATCH 2399/3948] =?UTF-8?q?range=5Fformatter=20=E3=81=AE?= =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BE=8B=E3=81=AE=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E3=81=A8=E5=8B=95=E4=BD=9C=E7=A2=BA=E8=AA=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/range_formatter.md | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/reference/format/range_formatter.md b/reference/format/range_formatter.md index f093eca863..44b66d3d00 100644 --- a/reference/format/range_formatter.md +++ b/reference/format/range_formatter.md @@ -48,7 +48,7 @@ class MyVector { public: using base_type = std::vector; using iterator = typename base_type::iterator; - using const_iterator = typename base_type::iterator; + using const_iterator = typename base_type::const_iterator; using value_type = typename base_type::value_type; using reference = typename base_type::reference; using const_reference = typename base_type::const_reference; @@ -57,11 +57,11 @@ public: MyVector(std::initializer_list init) : v_(init.begin(), init.end()) {} - iterator begin() { v_.begin(); } - const_iterator begin() const { v_.begin(); } + iterator begin() { return v_.begin(); } + const_iterator begin() const { return v_.begin(); } - iterator end() { v_.end(); } - const_iterator end() const { v_.end(); } + iterator end() { return v_.end(); } + const_iterator end() const { return v_.end(); } const std::vector& base() const { return v_; } }; @@ -70,14 +70,14 @@ template constexpr std::range_format std::format_kind> = std::range_format::sequence; template -class std::range_formatter> : public std::range_formatter> { +class std::formatter> : public std::range_formatter { bool is_colon = false; - using base_type = std::range_formatter>; + using base_type = std::range_formatter; public: // コンパイル時の書式文字列の解析があるため、 // constexprにする必要がある。 - // この関数に渡されるパラメータは、{:%j}の%以降。 + // この関数に渡されるパラメータは、{:c:02x}のc以降。 // 解析がおわった場所を指すイテレータを返す。 constexpr auto parse(std::format_parse_context& pctx) { auto it = pctx.begin(); @@ -105,7 +105,7 @@ public: ++out; } fctx.advance_to(out); - out = underlying().format(x, fctx); + out = this->underlying().format(x, fctx); } return out; } @@ -117,7 +117,7 @@ public: int main() { - std::vector v = {0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}; + MyVector v = {0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}; std::cout << std::format("{:c:02x}", v) << std::endl; } ``` @@ -136,15 +136,13 @@ int main() aa:bb:cc:dd:ee:ff ``` -(動作確認はできていない) - ## バージョン ### 言語 - C++23 ### 処理系 - [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? +- [GCC](/implementation.md#gcc): 15.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? From 994a1052c1471dda72f5ad2a5e26c8ee89b57cab Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sun, 28 Sep 2025 21:02:45 +0900 Subject: [PATCH 2400/3948] =?UTF-8?q?range=5Fformatter=20=E3=81=AE?= =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BE=8B=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit set_separator と set_brackets を使うと、元の例と同じものをより短く書けます。 元の例は underlying の使い方の参考になるので、元の例を残したまま新しい例を追加しました。 --- reference/format/range_formatter.md | 51 +++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/reference/format/range_formatter.md b/reference/format/range_formatter.md index 44b66d3d00..4c524edc8e 100644 --- a/reference/format/range_formatter.md +++ b/reference/format/range_formatter.md @@ -136,6 +136,57 @@ int main() aa:bb:cc:dd:ee:ff ``` + +### オリジナル書式を定義する例(`set_separator`と`set_brackets`を使う場合) +```cpp example +#include +#include +#include + +template +struct MyVector : std::vector { + using std::vector::vector; +}; + +template +constexpr std::range_format std::format_kind> = std::range_format::sequence; + +template +class std::formatter> : public std::range_formatter { + using base_type = std::range_formatter; +public: + constexpr auto parse(std::format_parse_context& pctx) { + auto it = pctx.begin(); + if (*it == 'c') { + this->set_separator(":"); // 区切り文字を「:」に設定 + this->set_brackets("", ""); // 囲み文字を空文字列に設定 + ++it; + } + pctx.advance_to(it); + return base_type::parse(pctx); + } +}; + +#include + +int main() +{ + MyVector v = {0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}; + std::cout << std::format("{:c:02x}", v) << std::endl; +} +``` +* std::format_parse_context[link basic_format_parse_context.md] +* pctx.begin()[link basic_format_parse_context/begin.md] +* pctx.advance_to[link basic_format_parse_context/advance_to.md] +* std::format[link format.md] + + +#### 出力 +``` +aa:bb:cc:dd:ee:ff +``` + + ## バージョン ### 言語 - C++23 From a6d4fdb2ba58044e9a2dd2cd2d2f1f18885358f5 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 29 Sep 2025 02:08:59 +0900 Subject: [PATCH 2401/3948] =?UTF-8?q?=E3=81=84=E3=81=8F=E3=81=A4=E3=81=8B?= =?UTF-8?q?=E3=81=AE=E3=82=B3=E3=83=BC=E3=83=89=E4=BE=8B=E3=81=AE=E3=82=B3?= =?UTF-8?q?=E3=83=B3=E3=83=91=E3=82=A4=E3=83=AB=E3=82=A8=E3=83=A9=E3=83=BC?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp11/alignas.md | 2 +- reference/atomic/atomic_flag_test_explicit.md | 4 ++-- reference/barrier/barrier/arrive_and_wait.md | 2 +- reference/fstream/basic_filebuf/close.md | 2 +- reference/functional/invoke_r.md | 2 +- .../iterator/basic_const_iterator/op_decrement.md | 1 + .../iterator/basic_const_iterator/op_increment.md | 1 + .../iterator/basic_const_iterator/op_minus_assign.md | 1 + .../iterator/basic_const_iterator/op_plus_assign.md | 1 + reference/map/map/op_constructor.md | 10 +++++----- reference/map/multimap/op_constructor.md | 2 +- reference/random/piecewise_constant_distribution.md | 2 +- 12 files changed, 17 insertions(+), 13 deletions(-) diff --git a/lang/cpp11/alignas.md b/lang/cpp11/alignas.md index fa86b3472a..1d06bfb500 100644 --- a/lang/cpp11/alignas.md +++ b/lang/cpp11/alignas.md @@ -59,7 +59,7 @@ struct test { int distance(void *a, void *b) { - return reinterpret_cast(a) - reinterpret_cast(b); + return reinterpret_cast(a) - reinterpret_cast(b); } int main() diff --git a/reference/atomic/atomic_flag_test_explicit.md b/reference/atomic/atomic_flag_test_explicit.md index d6e8d0b731..ba327e22f8 100644 --- a/reference/atomic/atomic_flag_test_explicit.md +++ b/reference/atomic/atomic_flag_test_explicit.md @@ -55,12 +55,12 @@ int main() std::atomic_flag x = ATOMIC_FLAG_INIT; std::cout << std::atomic_flag_test_explicit(&x, std::memory_order::acquire) << std::endl; - std::atomic_flag_test_and_set(&x, std::memory_order::release); + std::atomic_flag_test_and_set_explicit(&x, std::memory_order::release); std::cout << std::atomic_flag_test_explicit(&x, std::memory_order::acquire) << std::endl; } ``` * std::atomic_flag_test_explicit[color ff0000] -* std::atomic_flag_test_and_set[link atomic_flag_test_and_set.md] +* std::atomic_flag_test_and_set_explicit[link atomic_flag_test_and_set_explicit.md] * ATOMIC_FLAG_INIT[link /reference/atomic/atomic_flag_init.md] * memory_order[link /reference/atomic/memory_order.md] diff --git a/reference/barrier/barrier/arrive_and_wait.md b/reference/barrier/barrier/arrive_and_wait.md index 40920a753f..2e0b3c9152 100644 --- a/reference/barrier/barrier/arrive_and_wait.md +++ b/reference/barrier/barrier/arrive_and_wait.md @@ -55,7 +55,7 @@ int main() std::barrier<> sync{2}; // ワーカスレッド起動 - std::thread t1([&]{ + std::thread t([&]{ do_task("sub: phase-1"); sync.arrive_and_wait(); do_task("sub: phase-2"); diff --git a/reference/fstream/basic_filebuf/close.md b/reference/fstream/basic_filebuf/close.md index f97f54475f..7db7604b2f 100644 --- a/reference/fstream/basic_filebuf/close.md +++ b/reference/fstream/basic_filebuf/close.md @@ -40,7 +40,7 @@ put領域が存在する場合(ファイルを開いているなどして)、`ov int main() { - std::fstream fs(); + std::fstream fs; std::filebuf* buf = fs.rdbuf(); if (buf->open("foo", std::ios_base::out)) { diff --git a/reference/functional/invoke_r.md b/reference/functional/invoke_r.md index c5d679bde4..499543f035 100644 --- a/reference/functional/invoke_r.md +++ b/reference/functional/invoke_r.md @@ -36,7 +36,7 @@ int ch() { return 0x43; } int main() { - std::cout << std::invoke_r(ch()) << std::endl; + std::cout << std::invoke_r(ch) << std::endl; } ``` * std::invoke_r[color ff0000] diff --git a/reference/iterator/basic_const_iterator/op_decrement.md b/reference/iterator/basic_const_iterator/op_decrement.md index 62bd962186..d80c644784 100644 --- a/reference/iterator/basic_const_iterator/op_decrement.md +++ b/reference/iterator/basic_const_iterator/op_decrement.md @@ -38,6 +38,7 @@ constexpr basic_const_iterator operator--(int) requires bidirectional_iterator +#include #include int main() { diff --git a/reference/iterator/basic_const_iterator/op_increment.md b/reference/iterator/basic_const_iterator/op_increment.md index 5f68154979..d19824a5ed 100644 --- a/reference/iterator/basic_const_iterator/op_increment.md +++ b/reference/iterator/basic_const_iterator/op_increment.md @@ -41,6 +41,7 @@ constexpr basic_const_iterator operator++(int) requires forward_iterator +#include #include int main() { diff --git a/reference/iterator/basic_const_iterator/op_minus_assign.md b/reference/iterator/basic_const_iterator/op_minus_assign.md index e541d90001..e1f7004b12 100644 --- a/reference/iterator/basic_const_iterator/op_minus_assign.md +++ b/reference/iterator/basic_const_iterator/op_minus_assign.md @@ -30,6 +30,7 @@ return *this; ## 例 ```cpp example #include +#include #include int main() { diff --git a/reference/iterator/basic_const_iterator/op_plus_assign.md b/reference/iterator/basic_const_iterator/op_plus_assign.md index 8a4b2da398..a1d87da61a 100644 --- a/reference/iterator/basic_const_iterator/op_plus_assign.md +++ b/reference/iterator/basic_const_iterator/op_plus_assign.md @@ -31,6 +31,7 @@ return *this; ## 例 ```cpp example #include +#include #include int main() { diff --git a/reference/map/map/op_constructor.md b/reference/map/map/op_constructor.md index 648874022d..ab10b55cf7 100644 --- a/reference/map/map/op_constructor.md +++ b/reference/map/map/op_constructor.md @@ -130,18 +130,18 @@ int main() { std::pair values[] = { std::make_pair(1,'a'), std::make_pair(2,'b'), std::make_pair(2,'b') }; std::map m1(values, values + 3); - std::map m2(c1); + std::map m2(m1); - std::cout << "Size of c1: " << m1.size() << std::endl; - std::cout << "Size of c2: " << m2.size() << std::endl; + std::cout << "Size of m1: " << m1.size() << std::endl; + std::cout << "Size of m2: " << m2.size() << std::endl; } ``` * size()[link size.md] ### 出力 ``` -Size of c1: 2 -Size of c2: 2 +Size of m1: 2 +Size of m2: 2 ``` ### 処理系 diff --git a/reference/map/multimap/op_constructor.md b/reference/map/multimap/op_constructor.md index 60dbbc6cd0..4a4ce3067e 100644 --- a/reference/map/multimap/op_constructor.md +++ b/reference/map/multimap/op_constructor.md @@ -133,7 +133,7 @@ int main() { std::pair values[] = { std::make_pair(1,'a'), std::make_pair(2,'b'), std::make_pair(2,'b') }; std::multimap m1(values, values + 3); - std::multimap m2(c1); + std::multimap m2(m1); std::cout << "Size of m1: " << m1.size() << std::endl; std::cout << "Size of m2: " << m2.size() << std::endl; diff --git a/reference/random/piecewise_constant_distribution.md b/reference/random/piecewise_constant_distribution.md index 8ce154306e..cde6a68538 100644 --- a/reference/random/piecewise_constant_distribution.md +++ b/reference/random/piecewise_constant_distribution.md @@ -73,7 +73,7 @@ int main() // [0.0, 5.0)の値は、0.3の確率で出現する。 // [5.0, 10.0)の値は、0.5の確率で出現する。 - std::array intervals = {0.0, 5.0, 10.0}, + std::array intervals = {0.0, 5.0, 10.0}; std::array densities = {0.3, 0.5}; std::piecewise_constant_distribution<> dist( From 7e196a7a2a821780b84375546499a7f070061f96 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 29 Sep 2025 02:15:25 +0900 Subject: [PATCH 2402/3948] =?UTF-8?q?=E5=90=8D=E5=89=8D=E7=A9=BA=E9=96=93?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit meta とコードで名前空間が一致しないものを修正しました。 --- reference/algorithm/ranges_contains.md | 2 +- reference/execution/execution/run_loop.md | 2 +- reference/random/generate_random.md | 2 +- reference/tuple/forward_as_tuple.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/algorithm/ranges_contains.md b/reference/algorithm/ranges_contains.md index 2f3e2ded39..7610047983 100644 --- a/reference/algorithm/ranges_contains.md +++ b/reference/algorithm/ranges_contains.md @@ -5,7 +5,7 @@ * cpp23[meta cpp] ```cpp -namespace ranges { +namespace std::ranges { template S, class T, diff --git a/reference/execution/execution/run_loop.md b/reference/execution/execution/run_loop.md index df41151293..48b1f853c4 100644 --- a/reference/execution/execution/run_loop.md +++ b/reference/execution/execution/run_loop.md @@ -5,7 +5,7 @@ * cpp26[meta cpp] ```cpp -namespace std::execition { +namespace std::execution { class run_loop; } ``` diff --git a/reference/random/generate_random.md b/reference/random/generate_random.md index 8f6c41a7e5..6b711fce42 100644 --- a/reference/random/generate_random.md +++ b/reference/random/generate_random.md @@ -1,6 +1,6 @@ # generate_random * random[meta header] -* std[meta namespace] +* std::ranges[meta namespace] * function template[meta id-type] * cpp26[meta cpp] diff --git a/reference/tuple/forward_as_tuple.md b/reference/tuple/forward_as_tuple.md index f78e4365eb..8cb930eb01 100644 --- a/reference/tuple/forward_as_tuple.md +++ b/reference/tuple/forward_as_tuple.md @@ -5,7 +5,7 @@ * cpp11[meta cpp] ```cpp -namespace { +namespace std { template tuple forward_as_tuple(Types&&...) noexcept; // C++11 From d01bc0846d629899aefed6d163a9a437cec5c9c2 Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 29 Sep 2025 10:45:27 +0900 Subject: [PATCH 2403/3948] execution: P3149R11 spawn(#1510) --- reference/execution/execution.md | 2 +- .../counting_scope/token/disassociate.md | 2 +- .../counting_scope/token/try_associate.md | 2 +- .../execution/counting_scope/token/wrap.md | 2 +- reference/execution/execution/scope_token.md | 2 +- .../token/disassociate.md | 2 +- .../token/try_associate.md | 2 +- .../simple_counting_scope/token/wrap.md | 2 +- reference/execution/execution/spawn.md | 221 ++++++++++++++++++ 9 files changed, 229 insertions(+), 8 deletions(-) create mode 100644 reference/execution/execution/spawn.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 74cc78afc8..c4c0adc763 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -140,7 +140,7 @@ namespace std::execution { |------|------|----------------| | [`this_thread::sync_wait`](this_thread/sync_wait.md) | 現在のスレッド上でSender完了を待機 (customization point object) | C++26 | | [`this_thread::sync_wait_with_variant`](this_thread/sync_wait_with_variant.md) | 現在のスレッド上でSender完了を待機 (customization point object) | C++26 | -| [`execution::spawn`](execution/spawn.md.nolink) | 非同期操作を早期開始 (customization point object) | C++26 | +| [`execution::spawn`](execution/spawn.md) | 非同期操作を早期開始 (customization point object) | C++26 | Senderコンシューマは名前空間 `std::this_thread` および名前空間 `std::execution` で定義される。 diff --git a/reference/execution/execution/counting_scope/token/disassociate.md b/reference/execution/execution/counting_scope/token/disassociate.md index fc09036bb7..8ebf594ea6 100644 --- a/reference/execution/execution/counting_scope/token/disassociate.md +++ b/reference/execution/execution/counting_scope/token/disassociate.md @@ -40,7 +40,7 @@ scope->disassociate() ## 関連項目 - [`execution::associate`](../../associate.md) - [`execution::spawn_future`](../../spawn_future.md.nolink) -- [`execution::spawn`](../../spawn.md.nolink) +- [`execution::spawn`](../../spawn.md) ## 参照 diff --git a/reference/execution/execution/counting_scope/token/try_associate.md b/reference/execution/execution/counting_scope/token/try_associate.md index 5bde327af6..de9c2fd6c5 100644 --- a/reference/execution/execution/counting_scope/token/try_associate.md +++ b/reference/execution/execution/counting_scope/token/try_associate.md @@ -40,7 +40,7 @@ return scope->try-associate(); ## 関連項目 - [`execution::associate`](../../associate.md) - [`execution::spawn_future`](../../spawn_future.md.nolink) -- [`execution::spawn`](../../spawn.md.nolink) +- [`execution::spawn`](../../spawn.md) ## 参照 diff --git a/reference/execution/execution/counting_scope/token/wrap.md b/reference/execution/execution/counting_scope/token/wrap.md index 73588bf959..e69eef0d29 100644 --- a/reference/execution/execution/counting_scope/token/wrap.md +++ b/reference/execution/execution/counting_scope/token/wrap.md @@ -41,7 +41,7 @@ return stop-when(std::forward(snd), scope->s_source.get_token()); ## 関連項目 - [`execution::associate`](../../associate.md) - [`execution::spawn_future`](../../spawn_future.md.nolink) -- [`execution::spawn`](../../spawn.md.nolink) +- [`execution::spawn`](../../spawn.md) ## 参照 diff --git a/reference/execution/execution/scope_token.md b/reference/execution/execution/scope_token.md index b486553837..5aca3cc402 100644 --- a/reference/execution/execution/scope_token.md +++ b/reference/execution/execution/scope_token.md @@ -71,7 +71,7 @@ int main() ## 関連項目 - [`execution::associate`](associate.md) - [`execution::spawn_future`](spawn_future.md.nolink) -- [`execution::spawn`](spawn.md.nolink) +- [`execution::spawn`](spawn.md) ## 参照 diff --git a/reference/execution/execution/simple_counting_scope/token/disassociate.md b/reference/execution/execution/simple_counting_scope/token/disassociate.md index 6aa05a1772..9943b78825 100644 --- a/reference/execution/execution/simple_counting_scope/token/disassociate.md +++ b/reference/execution/execution/simple_counting_scope/token/disassociate.md @@ -40,7 +40,7 @@ scope->disassociate() ## 関連項目 - [`execution::associate`](../../associate.md) - [`execution::spawn_future`](../../spawn_future.md.nolink) -- [`execution::spawn`](../../spawn.md.nolink) +- [`execution::spawn`](../../spawn.md) ## 参照 diff --git a/reference/execution/execution/simple_counting_scope/token/try_associate.md b/reference/execution/execution/simple_counting_scope/token/try_associate.md index 5b0f184c46..43631ed3d6 100644 --- a/reference/execution/execution/simple_counting_scope/token/try_associate.md +++ b/reference/execution/execution/simple_counting_scope/token/try_associate.md @@ -40,7 +40,7 @@ return scope->try-associate(); ## 関連項目 - [`execution::associate`](../../associate.md) - [`execution::spawn_future`](../../spawn_future.md.nolink) -- [`execution::spawn`](../../spawn.md.nolink) +- [`execution::spawn`](../../spawn.md) ## 参照 diff --git a/reference/execution/execution/simple_counting_scope/token/wrap.md b/reference/execution/execution/simple_counting_scope/token/wrap.md index 495fa00758..e29f111188 100644 --- a/reference/execution/execution/simple_counting_scope/token/wrap.md +++ b/reference/execution/execution/simple_counting_scope/token/wrap.md @@ -37,7 +37,7 @@ Sender&& wrap(Sender&& snd) const noexcept; ## 関連項目 - [`execution::associate`](../../associate.md) - [`execution::spawn_future`](../../spawn_future.md.nolink) -- [`execution::spawn`](../../spawn.md.nolink) +- [`execution::spawn`](../../spawn.md) ## 参照 diff --git a/reference/execution/execution/spawn.md b/reference/execution/execution/spawn.md new file mode 100644 index 0000000000..60caee00aa --- /dev/null +++ b/reference/execution/execution/spawn.md @@ -0,0 +1,221 @@ +# spawn +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct spawn_t { unspecified }; + inline constexpr spawn_t spawn{}; +} +``` +* unspecified[italic] + +## 概要 +`spawn`は、入力[Sender](sender.md)に対して[非同期トークンスコープ](scope_token.md))への関連付けを試み、成功時に入力Senderを早期開始(eagerly start)させるSenderコンシューマである。 + + +## 効果 +説明用の式`sndr`, `token`, `env`に対して、下記の通り定義する。 + +- `Sndr`型を`decltype((sndr))`、 +- `Token`型を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``、 +- `Env`型を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``とする。 + +[`sender`](sender.md)``, [`scope_token`](scope_token.md)``, [`queryable`](../queryable.md)``のいずれかを満たさないとき、呼び出し式`spawn(sndr, token, env)`は不適格となる。 + +そうでなければ、呼び出し式`spawn(sndr, token, env)`に対して、説明用の式`new_sender`を[`token.wrap`](scope_token.md)`(sndr)`とし、`alloc`と`senv`を次の通りとする。 + +- 式[`get_allocator`](../get_allocator.md)`(env)`が適格なとき、`alloc`を[`get_allocator`](../get_allocator.md)`(env)`の結果、`senv`を式`env`とする。 +- そうでなはく、式[`get_allocator`](../get_allocator.md)`(`[`get_env`](get_env.md)`(new_sender))`が適格なとき、`alloc`を[`get_allocator`](../get_allocator.md)`(`[`get_env`](get_env.md)`(new_sender))`の結果、`senv`を式[`JOIN-ENV`](../queryable.md)`(`[`prop`](prop.md)`(`[`get_allocator`](../get_allocator.md)`, alloc), env)`とする。 +- そうではないとき、`alloc`を[`allocator`](/reference/memory/allocator.md)`()`、`senv`を式`env`とする。 + +呼び出し式`spawn(sndr, token, env)`は`void`型であり、次の効果をもつ。 + +- `alloc`を用いてメモリ確保し、`alloc`, [`write_env`](write_env.md)`(token.wrap(sndr), senv)`, `token`から特殊化された`spawn-state`型のオブジェクト`o`を構築し、`o.run()`を呼び出す。何らかのオブジェクト構築・破棄時に例外送出されたときは、確保されたメモリが解放される。 + +式`spawn(sndr, token)`は、式`spawn(sndr, token,` [`execution::env<>`](env.md)`())`と等価である。 + + +## 説明専用エンティティ +説明専用のクラス`spawn-state-base`を下記の通り定義する。 + +```cpp +namespace std::execution { + struct spawn-state-base { // exposition only + virtual void complete() noexcept = 0; // exposition only + }; +} +``` + +説明専用のクラス`spawn-receiver`を下記の通り定義する。 + +```cpp +namespace std::execution { + struct spawn-receiver { // exposition only + using receiver_concept = receiver_t; + + spawn-state-base* state; // exposition only + void set_value() && noexcept { state->complete(); } + void set_stopped() && noexcept { state->complete(); } + }; +} +``` +* receiver_t[link receiver.md] +* spawn-state-base[italic] + +説明専用のクラステンプレート`spawn-state`を下記の通り定義する。 + +```cpp +🔗 +namespace std::execution { + template + struct spawn-state : spawn-state-base { // exposition only + using op-t = connect_result_t; // exposition only + + spawn-state(Alloc alloc, Sender&& sndr, Token token); // exposition only + void complete() noexcept override; // exposition only + void run(); // exposition only + + private: + using alloc-t = // exposition only + typename allocator_traits::template rebind_alloc; + + alloc-t alloc; // exposition only + op-t op; // exposition only + Token token; // exposition only + + void destroy() noexcept; // exposition only + }; +} +``` +* scope_token[link scope_token.md] +* sender[link sender.md] +* connect_result_t[link connect_result_t.md] +* allocator_traits[link /reference/memory/allocator_traits.md] +* spawn-state-base[italic] +* spawn-receiver[italic] + +```cpp +spawn-state(Alloc alloc, Sender&& sndr, Token token); +``` + +- 効果 : メンバ変数`alloc`を引数`alloc`で、メンバ変数`token`を引数`token`で、`op`を下記で初期化する。 + + ```cpp + connect(std::move(sndr), spawn-receiver(this)) + ``` + * connect[link connect.md] + * std::move[link /reference/utility/move.md] + +```cpp +void run(); +``` + +- 効果 : 下記と等価 + + ```cpp + if (token.try_associate()) + start(op); + else + destroy(); + ``` + * start[link start.md] + +```cpp +void complete() noexcept override; +``` + +- 効果 : 下記と等価 + + ```cpp + auto token = std::move(this->token); + + destroy(); + token.disassociate(); + ``` + * std::move[link /reference/utility/move.md] + +```cpp +void destroy() noexcept; +``` + +- 効果 : 下記と等価 + + ```cpp + auto alloc = std::move(this->alloc); + + allocator_traits::destroy(alloc, this); + allocator_traits::deallocate(alloc, this, 1); + ``` + * allocator_traits[link /reference/memory/allocator_traits.md] + * destroy[link /reference/memory/allocator_traits/destroy.md] + * deallocate[link /reference/memory/allocator_traits/deallocate.md] + * std::move[link /reference/utility/move.md] + + +## 例 +```cpp example +#include +#include +namespace ex = std::execution; + +int main() +{ + // システムスレッドプール上の実行タスクを定義 + ex::scheduler auto sch = ex::get_parallel_scheduler(); + ex::sender auto sndr = + ex::schedule(sch) + | ex::then([](){ std::println("hello async"); }); + + // 非同期スコープを定義 + ex::counting_scope scope; + + // タスクを早期開始させる + std::println("spawn"); + ex::spawn(std::move(sndr), scope.get_token()); + + // 非同期スコープを合流 + std::println("sync_wait"); + std::this_thread::sync_wait(scope.join()); +} +``` +* ex::spawn[color ff0000] +* ex::scheduler[link scheduler.md] +* ex::get_parallel_scheduler()[link get_parallel_scheduler.md] +* ex::sender[link sender.md] +* ex::schedule[link schedule.md] +* ex::then[link then.md] +* ex::counting_scope[link counting_scope.md] +* get_token()[link counting_scope/get_token.md] +* join()[link counting_scope/join.md] +* std::this_thread::sync_wait[link ../this_thread/sync_wait.md] +* std::move[link /reference/utility/move.md] + +### 出力 +``` +spawn +hello async +sync_wait +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::scope_token`](scope_token.md) +- [`execution::spawn_future`](spawn_future.md.nolink) + + +## 参照 +- [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) From 9e1ab85cca54ead1770ff96999a7c3228d0fb273 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 29 Sep 2025 18:17:29 +0900 Subject: [PATCH 2404/3948] =?UTF-8?q?Typo=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/execution/execution/spawn.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/reference/execution/execution/spawn.md b/reference/execution/execution/spawn.md index 60caee00aa..4cba44ec75 100644 --- a/reference/execution/execution/spawn.md +++ b/reference/execution/execution/spawn.md @@ -13,7 +13,7 @@ namespace std::execution { * unspecified[italic] ## 概要 -`spawn`は、入力[Sender](sender.md)に対して[非同期トークンスコープ](scope_token.md))への関連付けを試み、成功時に入力Senderを早期開始(eagerly start)させるSenderコンシューマである。 +`spawn`は、入力[Sender](sender.md)に対して[非同期トークンスコープ](scope_token.md)への関連付けを試み、成功時に入力Senderを早期開始(eagerly start)させるSenderコンシューマである。 ## 効果 @@ -68,7 +68,6 @@ namespace std::execution { 説明専用のクラステンプレート`spawn-state`を下記の通り定義する。 ```cpp -🔗 namespace std::execution { template struct spawn-state : spawn-state-base { // exposition only From a14373f1ef279fa7a5e21cabd2089db253e379f2 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sat, 4 Oct 2025 18:20:22 +0900 Subject: [PATCH 2405/3948] =?UTF-8?q?cpp11removed=20=E3=81=AE=E8=AA=AC?= =?UTF-8?q?=E6=98=8E=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start_editing/class_template_page.md | 1 + start_editing/comparison_operator_template_page.md | 1 + start_editing/function_template_page.md | 1 + start_editing/header_template_page.md | 1 + start_editing/lang_template_page.md | 1 + start_editing/markdown_cpprefjp.md | 1 + start_editing/named_requirement_template_page.md | 1 + start_editing/type-type_template_page.md | 1 + 8 files changed, 8 insertions(+) diff --git a/start_editing/class_template_page.md b/start_editing/class_template_page.md index e20675b4a7..4b4e98ea2a 100644 --- a/start_editing/class_template_page.md +++ b/start_editing/class_template_page.md @@ -24,6 +24,7 @@ + diff --git a/start_editing/comparison_operator_template_page.md b/start_editing/comparison_operator_template_page.md index 112993dbdb..7adae91ffe 100644 --- a/start_editing/comparison_operator_template_page.md +++ b/start_editing/comparison_operator_template_page.md @@ -25,6 +25,7 @@ + diff --git a/start_editing/function_template_page.md b/start_editing/function_template_page.md index 5f4de1fea0..76400af2c4 100644 --- a/start_editing/function_template_page.md +++ b/start_editing/function_template_page.md @@ -25,6 +25,7 @@ + diff --git a/start_editing/header_template_page.md b/start_editing/header_template_page.md index a63be56b59..66c112c2b6 100644 --- a/start_editing/header_template_page.md +++ b/start_editing/header_template_page.md @@ -19,6 +19,7 @@ + diff --git a/start_editing/lang_template_page.md b/start_editing/lang_template_page.md index 6f41aad213..817d98009e 100644 --- a/start_editing/lang_template_page.md +++ b/start_editing/lang_template_page.md @@ -17,6 +17,7 @@ + diff --git a/start_editing/markdown_cpprefjp.md b/start_editing/markdown_cpprefjp.md index cc1d5d9422..19c1483c4d 100644 --- a/start_editing/markdown_cpprefjp.md +++ b/start_editing/markdown_cpprefjp.md @@ -306,6 +306,7 @@ Warning: [nolinked editors_doc/specialized.md] href "/reference/foobar.md.nolink * `* cpp20[meta cpp]` : C++20で追加された機能 * `* cpp23[meta cpp]` : C++23で追加された機能 * `* cpp11deprecated[meta cpp]` : C++11で非推奨になった機能 + * `* cpp11removed[meta cpp]` : C++11で削除された機能 * `* cpp14deprecated[meta cpp]` : C++14で非推奨になった機能 * `* cpp14removed[meta cpp]` : C++14で削除された機能 * `* cpp17deprecated[meta cpp]` : C++17で非推奨になった機能 diff --git a/start_editing/named_requirement_template_page.md b/start_editing/named_requirement_template_page.md index fe39a9b0ea..6688cb2e50 100644 --- a/start_editing/named_requirement_template_page.md +++ b/start_editing/named_requirement_template_page.md @@ -19,6 +19,7 @@ + diff --git a/start_editing/type-type_template_page.md b/start_editing/type-type_template_page.md index b67913eb2a..4054207ff2 100644 --- a/start_editing/type-type_template_page.md +++ b/start_editing/type-type_template_page.md @@ -25,6 +25,7 @@ + From 40fb86521438e97ebab138cbe47c891bdd778dae Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sat, 4 Oct 2025 18:21:15 +0900 Subject: [PATCH 2406/3948] =?UTF-8?q?basic=5Fios::operator=20void*()=20?= =?UTF-8?q?=E3=81=AB=20cpp11removed=20=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ios/basic_ios/op_voidptr.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/ios/basic_ios/op_voidptr.md b/reference/ios/basic_ios/op_voidptr.md index 44b8ae7b50..a0c3583579 100644 --- a/reference/ios/basic_ios/op_voidptr.md +++ b/reference/ios/basic_ios/op_voidptr.md @@ -3,6 +3,7 @@ * std[meta namespace] * basic_ios[meta class] * function[meta id-type] +* cpp11removed[meta cpp] ```cpp operator void*() const; From c71c86a308c29294f58155ebc5fd9428a0102c45 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 10 Oct 2025 13:00:13 +0900 Subject: [PATCH 2407/3948] =?UTF-8?q?atomic=E3=82=AF=E3=83=A9=E3=82=B9?= =?UTF-8?q?=E3=81=ABreduction=E9=96=A2=E4=BF=82=E3=81=AE=E3=83=A1=E3=83=B3?= =?UTF-8?q?=E3=83=90=E9=96=A2=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0=20(#1535?= =?UTF-8?q?)=20#1515?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 46 ++++--- reference/atomic.md | 29 +++- reference/atomic/atomic.md | 22 +++ reference/atomic/atomic/fetch_and.md | 2 - reference/atomic/atomic/fetch_fmaximum.md | 2 +- reference/atomic/atomic/fetch_fmaximum_num.md | 2 +- reference/atomic/atomic/fetch_fminimum.md | 2 +- reference/atomic/atomic/fetch_fminimum_num.md | 2 +- reference/atomic/atomic/fetch_max.md | 2 +- reference/atomic/atomic/fetch_min.md | 2 +- reference/atomic/atomic/fetch_or.md | 2 - reference/atomic/atomic/fetch_xor.md | 2 - reference/atomic/atomic/store_add.md | 125 ++++++++++++++++++ reference/atomic/atomic/store_and.md | 92 +++++++++++++ reference/atomic/atomic/store_fmaximum.md | 93 +++++++++++++ reference/atomic/atomic/store_fmaximum_num.md | 93 +++++++++++++ reference/atomic/atomic/store_fminimum.md | 93 +++++++++++++ reference/atomic/atomic/store_fminimum_num.md | 93 +++++++++++++ reference/atomic/atomic/store_max.md | 99 ++++++++++++++ reference/atomic/atomic/store_min.md | 99 ++++++++++++++ reference/atomic/atomic/store_or.md | 92 +++++++++++++ reference/atomic/atomic/store_sub.md | 125 ++++++++++++++++++ reference/atomic/atomic/store_xor.md | 92 +++++++++++++ reference/atomic/atomic_fetch_max.md | 8 +- reference/atomic/atomic_fetch_max_explicit.md | 2 +- reference/atomic/atomic_fetch_min.md | 6 +- reference/atomic/atomic_fetch_min_explicit.md | 2 +- reference/atomic/atomic_ref.md | 22 +++ reference/atomic/atomic_ref/store_add.md | 114 ++++++++++++++++ reference/atomic/atomic_ref/store_and.md | 81 ++++++++++++ reference/atomic/atomic_ref/store_fmaximum.md | 82 ++++++++++++ .../atomic/atomic_ref/store_fmaximum_num.md | 82 ++++++++++++ reference/atomic/atomic_ref/store_fminimum.md | 83 ++++++++++++ .../atomic/atomic_ref/store_fminimum_num.md | 82 ++++++++++++ reference/atomic/atomic_ref/store_max.md | 92 +++++++++++++ reference/atomic/atomic_ref/store_min.md | 92 +++++++++++++ reference/atomic/atomic_ref/store_or.md | 82 ++++++++++++ reference/atomic/atomic_ref/store_sub.md | 114 ++++++++++++++++ reference/atomic/atomic_ref/store_xor.md | 82 ++++++++++++ reference/atomic/atomic_store_add.md | 94 +++++++++++++ reference/atomic/atomic_store_add_explicit.md | 96 ++++++++++++++ reference/atomic/atomic_store_and.md | 94 +++++++++++++ reference/atomic/atomic_store_and_explicit.md | 96 ++++++++++++++ reference/atomic/atomic_store_max.md | 87 ++++++++++++ reference/atomic/atomic_store_max_explicit.md | 90 +++++++++++++ reference/atomic/atomic_store_min.md | 87 ++++++++++++ reference/atomic/atomic_store_min_explicit.md | 90 +++++++++++++ reference/atomic/atomic_store_or.md | 94 +++++++++++++ reference/atomic/atomic_store_or_explicit.md | 96 ++++++++++++++ reference/atomic/atomic_store_sub.md | 94 +++++++++++++ reference/atomic/atomic_store_sub_explicit.md | 96 ++++++++++++++ reference/atomic/atomic_store_xor.md | 94 +++++++++++++ reference/atomic/atomic_store_xor_explicit.md | 96 ++++++++++++++ 53 files changed, 3495 insertions(+), 46 deletions(-) create mode 100644 reference/atomic/atomic/store_add.md create mode 100644 reference/atomic/atomic/store_and.md create mode 100644 reference/atomic/atomic/store_fmaximum.md create mode 100644 reference/atomic/atomic/store_fmaximum_num.md create mode 100644 reference/atomic/atomic/store_fminimum.md create mode 100644 reference/atomic/atomic/store_fminimum_num.md create mode 100644 reference/atomic/atomic/store_max.md create mode 100644 reference/atomic/atomic/store_min.md create mode 100644 reference/atomic/atomic/store_or.md create mode 100644 reference/atomic/atomic/store_sub.md create mode 100644 reference/atomic/atomic/store_xor.md create mode 100644 reference/atomic/atomic_ref/store_add.md create mode 100644 reference/atomic/atomic_ref/store_and.md create mode 100644 reference/atomic/atomic_ref/store_fmaximum.md create mode 100644 reference/atomic/atomic_ref/store_fmaximum_num.md create mode 100644 reference/atomic/atomic_ref/store_fminimum.md create mode 100644 reference/atomic/atomic_ref/store_fminimum_num.md create mode 100644 reference/atomic/atomic_ref/store_max.md create mode 100644 reference/atomic/atomic_ref/store_min.md create mode 100644 reference/atomic/atomic_ref/store_or.md create mode 100644 reference/atomic/atomic_ref/store_sub.md create mode 100644 reference/atomic/atomic_ref/store_xor.md create mode 100644 reference/atomic/atomic_store_add.md create mode 100644 reference/atomic/atomic_store_add_explicit.md create mode 100644 reference/atomic/atomic_store_and.md create mode 100644 reference/atomic/atomic_store_and_explicit.md create mode 100644 reference/atomic/atomic_store_max.md create mode 100644 reference/atomic/atomic_store_max_explicit.md create mode 100644 reference/atomic/atomic_store_min.md create mode 100644 reference/atomic/atomic_store_min_explicit.md create mode 100644 reference/atomic/atomic_store_or.md create mode 100644 reference/atomic/atomic_store_or_explicit.md create mode 100644 reference/atomic/atomic_store_sub.md create mode 100644 reference/atomic/atomic_store_sub_explicit.md create mode 100644 reference/atomic/atomic_store_xor.md create mode 100644 reference/atomic/atomic_store_xor_explicit.md diff --git a/lang/cpp26.md b/lang/cpp26.md index c3bc09312e..85bf70da89 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -303,28 +303,32 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [`std::atomic_fetch_min_explicit()`](/reference/atomic/atomic_fetch_min_explicit.md) - [`std::atomic`](/reference/atomic/atomic.md)クラスと[`std::atomic_ref`](/reference/atomic/atomic_ref.md)クラスに、現在の値を読み込まず (fetchせず) に加算などをする高速な縮約用の操作として、以下を追加 - メンバ関数 - - [`store_add()`](/reference/atomic/atomic/store_add.md.nolink) - - [`store_sub()`](/reference/atomic/atomic/store_sub.md.nolink) - - [`store_and()`](/reference/atomic/atomic/store_and.md.nolink) - - [`store_or()`](/reference/atomic/atomic/store_or.md.nolink) - - [`store_xor()`](/reference/atomic/atomic/store_xor.md.nolink) - - [`store_max()`](/reference/atomic/atomic/store_max.md.nolink) - - [`store_min()`](/reference/atomic/atomic/store_min.md.nolink) + - [`store_add()`](/reference/atomic/atomic/store_add.md) + - [`store_sub()`](/reference/atomic/atomic/store_sub.md) + - [`store_and()`](/reference/atomic/atomic/store_and.md) + - [`store_or()`](/reference/atomic/atomic/store_or.md) + - [`store_xor()`](/reference/atomic/atomic/store_xor.md) + - [`store_max()`](/reference/atomic/atomic/store_max.md) + - [`store_min()`](/reference/atomic/atomic/store_min.md) + - [`store_fmaximum()`](/reference/atomic/atomic/store_fmaximum.md) (浮動小数点数用) + - [`store_fminimum()`](/reference/atomic/atomic/store_fminimum.md) (浮動小数点数用) + - [`store_fmaximum_num()`](/reference/atomic/atomic/store_fmaximum_num.md) (浮動小数点数用) + - [`store_fminimum_num()`](/reference/atomic/atomic/store_fminimum_num.md) (浮動小数点数用) - 非メンバ関数 - - [`std::atomic_store_add()`](/reference/atomic/atomic_store_add.md.nolink) - - [`std::atomic_store_add_explicit()`](/reference/atomic/atomic_store_add_explicit.md.nolink) - - [`std::atomic_store_sub()`](/reference/atomic/atomic_store_sub.md.nolink) - - [`std::atomic_store_sub_explicit()`](/reference/atomic/atomic_store_sub_explicit.md.nolink) - - [`std::atomic_store_and()`](/reference/atomic/atomic_store_and.md.nolink) - - [`std::atomic_store_and_explicit()`](/reference/atomic/atomic_store_and_explicit.md.nolink) - - [`std::atomic_store_or()`](/reference/atomic/atomic_store_or.md.nolink) - - [`std::atomic_store_or_explicit()`](/reference/atomic/atomic_store_or_explicit.md.nolink) - - [`std::atomic_store_xor()`](/reference/atomic/atomic_store_xor.md.nolink) - - [`std::atomic_store_xor_explicit()`](/reference/atomic/atomic_store_xor_explicit.md.nolink) - - [`std::atomic_store_max()`](/reference/atomic/atomic_store_max.md.nolink) - - [`std::atomic_store_max_explicit()`](/reference/atomic/atomic_store_max_explicit.md.nolink) - - [`std::atomic_store_min()`](/reference/atomic/atomic_store_min.md.nolink) - - [`std::atomic_store_min_explicit()`](/reference/atomic/atomic_store_min_explicit.md.nolink) + - [`std::atomic_store_add()`](/reference/atomic/atomic_store_add.md) + - [`std::atomic_store_add_explicit()`](/reference/atomic/atomic_store_add_explicit.md) + - [`std::atomic_store_sub()`](/reference/atomic/atomic_store_sub.md) + - [`std::atomic_store_sub_explicit()`](/reference/atomic/atomic_store_sub_explicit.md) + - [`std::atomic_store_and()`](/reference/atomic/atomic_store_and.md) + - [`std::atomic_store_and_explicit()`](/reference/atomic/atomic_store_and_explicit.md) + - [`std::atomic_store_or()`](/reference/atomic/atomic_store_or.md) + - [`std::atomic_store_or_explicit()`](/reference/atomic/atomic_store_or_explicit.md) + - [`std::atomic_store_xor()`](/reference/atomic/atomic_store_xor.md) + - [`std::atomic_store_xor_explicit()`](/reference/atomic/atomic_store_xor_explicit.md) + - [`std::atomic_store_max()`](/reference/atomic/atomic_store_max.md) + - [`std::atomic_store_max_explicit()`](/reference/atomic/atomic_store_max_explicit.md) + - [`std::atomic_store_min()`](/reference/atomic/atomic_store_min.md) + - [`std::atomic_store_min_explicit()`](/reference/atomic/atomic_store_min_explicit.md) - [`std::atomic_ref`](/reference/atomic/atomic_ref.md)クラスに、参照するオブジェクトのアドレスを取得する[`address()`](/reference/atomic/atomic_ref/address.md)メンバ関数を追加 - [`std::atomic`](/reference/atomic/atomic.md)クラスのテンプレートパラメータとしてCV修飾された型を禁止 - [`std::atomic_ref`](/reference/atomic/atomic_ref.md)クラスのテンプレートパラメータとして、CV修飾された型を受け取れるようにした (内部でCV修飾が外される) diff --git a/reference/atomic.md b/reference/atomic.md index 5a9e4a4236..140f3e5618 100644 --- a/reference/atomic.md +++ b/reference/atomic.md @@ -63,6 +63,8 @@ ## アトミック型に対する算術操作 +### 値を読み込んで算術操作 + | 名前 | 説明 | 対応バージョン | |----------------------------------------------------|-------------------------|-------| | [`atomic_fetch_add`](atomic/atomic_fetch_add.md) | 加算(function template) | C++11 | @@ -75,10 +77,29 @@ | [`atomic_fetch_or_explicit`](atomic/atomic_fetch_or_explicit.md) | メモリオーダーを指定してOR演算(function template) | C++11 | | [`atomic_fetch_xor`](atomic/atomic_fetch_xor.md) | XOR演算(function template) | C++11 | | [`atomic_fetch_xor_explicit`](atomic/atomic_fetch_xor_explicit.md) | メモリオーダーを指定してXOR演算(function template) | C++11 | -| [`atomic_fetch_max`](atomic/atomic_fetch_max.md) | 最大値取得(function template) | C++26 | -| [`atomic_fetch_max_explicit`](atomic/atomic_fetch_max_explicit.md) | メモリオーダーを指定して最大値取得(function template) | C++26 | -| [`atomic_fetch_min`](atomic/atomic_fetch_min.md) | 最小値取得(function template) | C++26 | -| [`atomic_fetch_min_explicit`](atomic/atomic_fetch_min_explicit.md) | メモリオーダーを指定して最小値取得(function template) | C++26 | +| [`atomic_fetch_max`](atomic/atomic_fetch_max.md) | 最大値を設定・取得(function template) | C++26 | +| [`atomic_fetch_max_explicit`](atomic/atomic_fetch_max_explicit.md) | メモリオーダーを指定して最大値を設定・取得(function template) | C++26 | +| [`atomic_fetch_min`](atomic/atomic_fetch_min.md) | 最小値を設定・取得(function template) | C++26 | +| [`atomic_fetch_min_explicit`](atomic/atomic_fetch_min_explicit.md) | メモリオーダーを指定して最小値を設定・取得(function template) | C++26 | + +### 値を読み込まずに算術操作 + +| 名前 | 説明 | 対応バージョン | +|----------------------------------------------------|-------------------------|-------| +| [`atomic_store_add`](atomic/atomic_store_add.md) | 値を読み込まずに加算(function template) | C++26 | +| [`atomic_store_add_explicit`](atomic/atomic_store_add_explicit.md) | メモリオーダーを指定して値を読み込まずに加算(function template) | C++26 | +| [`atomic_store_sub`](atomic/atomic_store_sub.md) | 値を読み込まずに減算(function template) | C++26 | +| [`atomic_store_sub_explicit`](atomic/atomic_store_sub_explicit.md) | メモリオーダーを指定して値を読み込まずに減算(function template) | C++26 | +| [`atomic_store_and`](atomic/atomic_store_and.md) | 値を読み込まずにAND演算(function template) | C++26 | +| [`atomic_store_and_explicit`](atomic/atomic_store_and_explicit.md) | メモリオーダーを指定して値を読み込まずにAND演算(function template) | C++26 | +| [`atomic_store_or`](atomic/atomic_store_or.md) | 値を読み込まずにOR演算(function template) | C++26 | +| [`atomic_store_or_explicit`](atomic/atomic_store_or_explicit.md) | メモリオーダーを指定して値を読み込まずにOR演算(function template) | C++26 | +| [`atomic_store_xor`](atomic/atomic_store_xor.md) | 値を読み込まずにXOR演算(function template) | C++26 | +| [`atomic_store_xor_explicit`](atomic/atomic_store_xor_explicit.md) | メモリオーダーを指定して値を読み込まずにXOR演算(function template) | C++26 | +| [`atomic_store_max`](atomic/atomic_store_max.md) | 値を読み込まずに最大値を設定(function template) | C++26 | +| [`atomic_store_max_explicit`](atomic/atomic_store_max_explicit.md) | メモリオーダーを指定して値を読み込まずに最大値を設定(function template) | C++26 | +| [`atomic_store_min`](atomic/atomic_store_min.md) | 値を読み込まずに最小値を設定(function template) | C++26 | +| [`atomic_store_min_explicit`](atomic/atomic_store_min_explicit.md) | メモリオーダーを指定して値を読み込まずに最小値を設定(function template) | C++26 | ## アトミック型に対するブロッキング同期操作 diff --git a/reference/atomic/atomic.md b/reference/atomic/atomic.md index 29626a1987..1f4b5b9597 100644 --- a/reference/atomic/atomic.md +++ b/reference/atomic/atomic.md @@ -164,6 +164,13 @@ namespace std { | [`fetch_xor`](atomic/fetch_xor.md) | XOR演算 | C++11 | | [`fetch_max`](atomic/fetch_max.md) | 最大値を設定・取得 | C++26 | | [`fetch_min`](atomic/fetch_min.md) | 最小値を設定・取得 | C++26 | +| [`store_add`](atomic/store_add.md) | 値を読み込まずに加算 | C++26 | +| [`store_sub`](atomic/store_sub.md) | 値を読み込まずに減算 | C++26 | +| [`store_and`](atomic/store_and.md) | 値を読み込まずにAND演算 | C++26 | +| [`store_or`](atomic/store_or.md) | 値を読み込まずにOR演算 | C++26 | +| [`store_xor`](atomic/store_xor.md) | 値を読み込まずにXOR演算 | C++26 | +| [`store_max`](atomic/store_max.md) | 値を読み込まずに最大値を設定 | C++26 | +| [`store_min`](atomic/store_min.md) | 値を読み込まずに最小値を設定 | C++26 | | [`operator++`](atomic/op_increment.md) | インクリメント | C++11 | | [`operator--`](atomic/op_decrement.md) | デクリメント | C++11 | | [`operator+=`](atomic/op_plus_assign.md) | 加算 | C++11 | @@ -192,6 +199,17 @@ namespace std { | [`fetch_fminimum`](atomic/fetch_fminimum.md) | 最小値を設定・取得 (`-0.0`と`+0.0`では`-0.0`、NaNと値ではNaNを返す) | C++26 | | [`fetch_fmaximum_num`](atomic/fetch_fmaximum_num.md) | 最大値を設定・取得 (`-0.0`と`+0.0`では`+0.0`、NaNと値では数値を返す) | C++26 | | [`fetch_fminimum_num`](atomic/fetch_fminimum_num.md) | 最小値を設定・取得 (`-0.0`と`+0.0`では`-0.0`、NaNと値では数値を返す) | C++26 | +| [`store_add`](atomic/store_add.md) | 値を読み込まずに加算 | C++26 | +| [`store_sub`](atomic/store_sub.md) | 値を読み込まずに減算 | C++26 | +| [`store_and`](atomic/store_and.md) | 値を読み込まずにAND演算 | C++26 | +| [`store_or`](atomic/store_or.md) | 値を読み込まずにOR演算 | C++26 | +| [`store_xor`](atomic/store_xor.md) | 値を読み込まずにXOR演算 | C++26 | +| [`store_max`](atomic/store_max.md) | 値を読み込まずに最大値を設定 | C++26 | +| [`store_min`](atomic/store_min.md) | 値を読み込まずに最小値を設定 | C++26 | +| [`store_fmaximum`](atomic/store_fmaximum.md) | 値を読み込まずに最大値を設定 (`-0.0`と`+0.0`では`+0.0`、NaNと値ではNaNを返す) | C++26 | +| [`store_fminimum`](atomic/store_fminimum.md) | 値を読み込まずに最小値を設定 (`-0.0`と`+0.0`では`-0.0`、NaNと値ではNaNを返す) | C++26 | +| [`store_fmaximum_num`](atomic/store_fmaximum_num.md) | | 値を読み込まずに最大値を設定 (`-0.0`と`+0.0`では`+0.0`、NaNと値では数値を返す) | C++26 | +| [`store_fminimum_num`](atomic/store_fminimum_num.md) | 値を読み込まずに最小値を設定 (`-0.0`と`+0.0`では`-0.0`、NaNと値では数値を返す) | C++26 | | [`operator+=`](atomic/op_plus_assign.md) | 加算 | C++20 | | [`operator-=`](atomic/op_minus_assign.md) | 減算 | C++20 | @@ -211,6 +229,10 @@ namespace std { | [`fetch_sub`](atomic/fetch_sub.md) | 減算 | C++11 | | [`fetch_max`](atomic/fetch_max.md) | 最大値を設定・取得 | C++26 | | [`fetch_min`](atomic/fetch_min.md) | 最小値を設定・取得 | C++26 | +| [`store_add`](atomic/store_add.md) | 値を読み込まずに加算 | C++26 | +| [`store_sub`](atomic/store_sub.md) | 値を読み込まずに減算 | C++26 | +| [`store_max`](atomic/store_max.md) | 値を読み込まずに最大値を設定 | C++26 | +| [`store_min`](atomic/store_min.md) | 値を読み込まずに最小値を設定 | C++26 | | [`operator++`](atomic/op_increment.md) | インクリメント | C++11 | | [`operator--`](atomic/op_decrement.md) | デクリメント | C++11 | | [`operator+=`](atomic/op_plus_assign.md) | 加算 | C++11 | diff --git a/reference/atomic/atomic/fetch_and.md b/reference/atomic/atomic/fetch_and.md index 8209763f8e..f9168a0055 100644 --- a/reference/atomic/atomic/fetch_and.md +++ b/reference/atomic/atomic/fetch_and.md @@ -28,8 +28,6 @@ AND演算を行う ## テンプレートパラメータ制約 -- (1), (2) : - - C++17 : `std::atomic`の場合、型`T`がオブジェクト型であること。型`T`が`void*`や関数ポインタであってはならない - (1) : - C++20 : `atomic::is_always_lock_free`が`true`であること diff --git a/reference/atomic/atomic/fetch_fmaximum.md b/reference/atomic/atomic/fetch_fmaximum.md index 447615226a..7f33a364f9 100644 --- a/reference/atomic/atomic/fetch_fmaximum.md +++ b/reference/atomic/atomic/fetch_fmaximum.md @@ -9,7 +9,7 @@ constexpr T fetch_fmaximum(difference_type operand, memory_order order = memory_order_seq_cst - ) const noexcept; // (1) C++26 + ) noexcept; // (1) C++26 ``` * memory_order[link /reference/atomic/memory_order.md] * memory_order_seq_cst[link /reference/atomic/memory_order.md] diff --git a/reference/atomic/atomic/fetch_fmaximum_num.md b/reference/atomic/atomic/fetch_fmaximum_num.md index c499fc0a17..1a3076a84e 100644 --- a/reference/atomic/atomic/fetch_fmaximum_num.md +++ b/reference/atomic/atomic/fetch_fmaximum_num.md @@ -9,7 +9,7 @@ constexpr T fetch_fmaximum_num(difference_type operand, memory_order order = memory_order_seq_cst - ) const noexcept; // (1) C++26 + ) noexcept; // (1) C++26 ``` * memory_order[link /reference/atomic/memory_order.md] * memory_order_seq_cst[link /reference/atomic/memory_order.md] diff --git a/reference/atomic/atomic/fetch_fminimum.md b/reference/atomic/atomic/fetch_fminimum.md index 86f37e0743..0d3968f985 100644 --- a/reference/atomic/atomic/fetch_fminimum.md +++ b/reference/atomic/atomic/fetch_fminimum.md @@ -9,7 +9,7 @@ constexpr T fetch_fminimum(difference_type operand, memory_order order = memory_order_seq_cst - ) const noexcept; // (1) C++26 + ) noexcept; // (1) C++26 ``` * memory_order[link /reference/atomic/memory_order.md] * memory_order_seq_cst[link /reference/atomic/memory_order.md] diff --git a/reference/atomic/atomic/fetch_fminimum_num.md b/reference/atomic/atomic/fetch_fminimum_num.md index e99f282afc..d03777a061 100644 --- a/reference/atomic/atomic/fetch_fminimum_num.md +++ b/reference/atomic/atomic/fetch_fminimum_num.md @@ -9,7 +9,7 @@ constexpr T fetch_fminimum_num(difference_type operand, memory_order order = memory_order_seq_cst - ) const noexcept; // (1) C++26 + ) noexcept; // (1) C++26 ``` * memory_order[link /reference/atomic/memory_order.md] * memory_order_seq_cst[link /reference/atomic/memory_order.md] diff --git a/reference/atomic/atomic/fetch_max.md b/reference/atomic/atomic/fetch_max.md index 8d63dfd8d2..6949780119 100644 --- a/reference/atomic/atomic/fetch_max.md +++ b/reference/atomic/atomic/fetch_max.md @@ -9,7 +9,7 @@ constexpr T fetch_max(difference_type operand, memory_order order = memory_order_seq_cst - ) const noexcept; // (1) C++26 + ) noexcept; // (1) C++26 ``` * memory_order[link /reference/atomic/memory_order.md] * memory_order_seq_cst[link /reference/atomic/memory_order.md] diff --git a/reference/atomic/atomic/fetch_min.md b/reference/atomic/atomic/fetch_min.md index adb6e69d15..b1fbe98750 100644 --- a/reference/atomic/atomic/fetch_min.md +++ b/reference/atomic/atomic/fetch_min.md @@ -9,7 +9,7 @@ constexpr T fetch_min(difference_type operand, memory_order order = memory_order_seq_cst - ) const noexcept; // (1) C++26 + ) noexcept; // (1) C++26 ``` * memory_order[link /reference/atomic/memory_order.md] * memory_order_seq_cst[link /reference/atomic/memory_order.md] diff --git a/reference/atomic/atomic/fetch_or.md b/reference/atomic/atomic/fetch_or.md index 9135670e25..f50fe5ccda 100644 --- a/reference/atomic/atomic/fetch_or.md +++ b/reference/atomic/atomic/fetch_or.md @@ -28,8 +28,6 @@ OR演算を行う ## テンプレートパラメータ制約 -- (1), (2) : - - C++17 : `std::atomic`の場合、型`T`がオブジェクト型であること。型`T`が`void*`や関数ポインタであってはならない - (1) : - C++20 : `atomic::is_always_lock_free`が`true`であること diff --git a/reference/atomic/atomic/fetch_xor.md b/reference/atomic/atomic/fetch_xor.md index 40e99fff16..00fd89bbf9 100644 --- a/reference/atomic/atomic/fetch_xor.md +++ b/reference/atomic/atomic/fetch_xor.md @@ -28,8 +28,6 @@ XOR演算を行う ## 要件 -- (1), (2) : - - C++17 : `std::atomic`の場合、型`T`がオブジェクト型であること。型`T`が`void*`や関数ポインタであってはならない - (1) : - C++20 : `atomic::is_always_lock_free`が`true`であること diff --git a/reference/atomic/atomic/store_add.md b/reference/atomic/atomic/store_add.md new file mode 100644 index 0000000000..158c380c16 --- /dev/null +++ b/reference/atomic/atomic/store_add.md @@ -0,0 +1,125 @@ +# store_add +* atomic[meta header] +* std[meta namespace] +* atomic[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +void + store_add(difference_type operand, + memory_order order = memory_order_seq_cst + ) volatile noexcept; // (1) C++26 + +constexpr void + store_add(difference_type operand, + memory_order order = memory_order_seq_cst + ) noexcept; // (2) C++26 +``` +* memory_order[link /reference/atomic/memory_order.md] +* memory_order_seq_cst[link /reference/atomic/memory_order.md] + +## 概要 +値を読み込まずに加算を行う。 + +この関数は、[`fetch_add()`](fetch_add.md)と異なり、現在の (古い) 値を読み込むことなく現在の値に演算を行うため、高速に動作する。ただし変更前の古い値は戻り値として取得できない。 + + +## テンプレートパラメータ制約 +- (1) : `atomic::is_always_lock_free`が`true`であること + + +## 事前条件 +- `order`は、以下のいずれかであること + - [`memory_order_relaxed`](/reference/atomic/memory_order.md) + - [`memory_order_release`](/reference/atomic/memory_order.md) + - [`memory_order_seq_cst`](/reference/atomic/memory_order.md) + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、現在の値に`operand`を加算した値でアトミックに置き換える + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 備考 +- この関数は、`atomic`クラスの整数型、浮動小数点数型、ポインタに対する特殊化で定義される +- 整数型 + - 符号付き整数型に対しては、符号なし整数型に変換されたかのようにしたあと演算が行われ、結果は符号付き整数型になる。未定義動作はない +- 浮動小数点数型 + - 演算結果が、その型で表現できない値であった場合、結果は未規定値になる。ただしその操作によって未定義動作は起こらない + - 浮動小数点数型に対する操作は[`std::numeric_limits`](/reference/limits/numeric_limits.md)``トレイトに準拠する + - 浮動小数点数型に対するアトミック操作の浮動小数点環境は、呼び出しスレッドの浮動小数点環境とは異なる可能性がある +- ポインタ型 + - 結果として未定義アドレスになる場合があるが、それ以外の未定義動作はない + + +## 例 +### 基本的な使い方 +```cpp example +#include +#include + +int main() +{ + std::atomic x(3); + + x.store_add(2); + + std::println("{}", x.load()); +} +``` +* store_add[color ff0000] +* x.load()[link load.md] + + +#### 出力 +``` +5 +``` + +### 並列に加算する例 +```cpp example +#include +#include +#include +#include + +int main() +{ + std::atomic x{0}; + std::vector v = {1, 2, 3, 4, 5}; + + std::for_each(std::execution::par_unseq, v.begin(), v.end(), [&](int n){ + x.store_add(n); + }); + + std::println("{}", x.load()); +} +``` +* store_add[color ff0000] +* x.load()[link load.md] + +#### 出力 +``` +15 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 13 [mark noimpl] + + +## 参照 +- [P3111R8 Atomic Reduction Operations](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3111r8.html) \ No newline at end of file diff --git a/reference/atomic/atomic/store_and.md b/reference/atomic/atomic/store_and.md new file mode 100644 index 0000000000..64616eec23 --- /dev/null +++ b/reference/atomic/atomic/store_and.md @@ -0,0 +1,92 @@ +# store_and +* atomic[meta header] +* std[meta namespace] +* atomic[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +void + store_and(difference_type operand, + memory_order order = memory_order_seq_cst + ) volatile noexcept; // (1) C++26 + +constexpr void + store_and(difference_type operand, + memory_order order = memory_order_seq_cst + ) noexcept; // (2) C++26 +``` +* memory_order[link /reference/atomic/memory_order.md] +* memory_order_seq_cst[link /reference/atomic/memory_order.md] + +## 概要 +値を読み込まずにAND演算を行う。 + +この関数は、[`fetch_and()`](fetch_and.md)と異なり、現在の (古い) 値を読み込むことなく現在の値に演算を行うため、高速に動作する。ただし変更前の古い値は戻り値として取得できない。 + + +## テンプレートパラメータ制約 +- (1) : `atomic::is_always_lock_free`が`true`であること + + +## 事前条件 +- `order`は、以下のいずれかであること + - [`memory_order_relaxed`](/reference/atomic/memory_order.md) + - [`memory_order_release`](/reference/atomic/memory_order.md) + - [`memory_order_seq_cst`](/reference/atomic/memory_order.md) + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、現在の値に`operand`をANDした値でアトミックに置き換える + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 備考 +- この関数は、`atomic`クラスの整数型に対する特殊化で定義される +- 符号付き整数型に対しては、符号なし整数型に変換されたかのようにしたあと演算が行われ、結果は符号付き整数型になる。未定義動作はない + + +## 例 +### 基本的な使い方 +```cpp example +#include +#include + +int main() +{ + std::atomic x(0b1001); + + x.store_and(0b0101); + + std::println("0b{:04b}", x.load()); +} +``` +* store_and[color ff0000] +* x.load()[link load.md] + + +#### 出力 +``` +0b0001 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 13 [mark noimpl] + + +## 参照 +- [P3111R8 Atomic Reduction Operations](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3111r8.html) \ No newline at end of file diff --git a/reference/atomic/atomic/store_fmaximum.md b/reference/atomic/atomic/store_fmaximum.md new file mode 100644 index 0000000000..9f0a53664f --- /dev/null +++ b/reference/atomic/atomic/store_fmaximum.md @@ -0,0 +1,93 @@ +# store_fmaximum +* atomic[meta header] +* std[meta namespace] +* atomic[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +void + store_fmaximum(difference_type operand, + memory_order order = memory_order_seq_cst + ) volatile noexcept; // (1) C++26 + +constexpr void + store_fmaximum(difference_type operand, + memory_order order = memory_order_seq_cst + ) noexcept; // (2) C++26 +``` +* memory_order[link /reference/atomic/memory_order.md] +* memory_order_seq_cst[link /reference/atomic/memory_order.md] + +## 概要 +値を読み込まずに最大値を設定する。 + +この関数は、`*this`が保持する値と`operand`の大きい方を求め、その値を`this`に保持させる。 + +この関数は、[`fetch_fmaximum()`](fetch_fmaximum.md)と異なり、現在の (古い) 値を読み込むことなく現在の値に演算を行うため、高速に動作する。ただし変更前の古い値は戻り値として取得できない。 + + +## テンプレートパラメータ制約 +- `std::atomic`の場合、型`T`がオブジェクト型であること。型`T`が`void*`や関数ポインタであってはならない +- (1) : `atomic::is_always_lock_free`が`true`であること + + +## 事前条件 +- `order`は、以下のいずれかであること + - [`memory_order_relaxed`](/reference/atomic/memory_order.md) + - [`memory_order_release`](/reference/atomic/memory_order.md) + - [`memory_order_seq_cst`](/reference/atomic/memory_order.md) + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、`*this`が保持する値と`operand`の最大値を求めて、その値でアトミックに置き換える + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 備考 +- この関数は、`atomic`クラスの浮動小数点数型に対する特殊化で定義される +- 浮動小数点数型 + - [`std::fmaximum()`](/reference/cmath/fmaximum.md)関数と同様の動作をする + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::atomic x(2); + + x.store_fmaximum(3); + + std::cout << x.load() << std::endl; +} +``` +* store_fmaximum[color ff0000] +* load()[link load.md] + +### 出力 +``` +3 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 13 [mark noimpl] + + +## 参照 +- [P3111R8 Atomic Reduction Operations](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3111r8.html) \ No newline at end of file diff --git a/reference/atomic/atomic/store_fmaximum_num.md b/reference/atomic/atomic/store_fmaximum_num.md new file mode 100644 index 0000000000..e84c41af49 --- /dev/null +++ b/reference/atomic/atomic/store_fmaximum_num.md @@ -0,0 +1,93 @@ +# store_fmaximum_num +* atomic[meta header] +* std[meta namespace] +* atomic[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +void + store_fmaximum_num(difference_type operand, + memory_order order = memory_order_seq_cst + ) volatile noexcept; // (1) C++26 + +constexpr void + store_fmaximum_num(difference_type operand, + memory_order order = memory_order_seq_cst + ) noexcept; // (2) C++26 +``` +* memory_order[link /reference/atomic/memory_order.md] +* memory_order_seq_cst[link /reference/atomic/memory_order.md] + +## 概要 +値を読み込まずに最大値を設定する。 + +この関数は、`*this`が保持する値と`operand`の大きい方を求め、その値を`this`に保持させる。 + +この関数は、[`fetch_fmaximum_num()`](fetch_fmaximum_num.md)と異なり、現在の (古い) 値を読み込むことなく現在の値に演算を行うため、高速に動作する。ただし変更前の古い値は戻り値として取得できない。 + + +## テンプレートパラメータ制約 +- `std::atomic`の場合、型`T`がオブジェクト型であること。型`T`が`void*`や関数ポインタであってはならない +- (1) : `atomic::is_always_lock_free`が`true`であること + + +## 事前条件 +- `order`は、以下のいずれかであること + - [`memory_order_relaxed`](/reference/atomic/memory_order.md) + - [`memory_order_release`](/reference/atomic/memory_order.md) + - [`memory_order_seq_cst`](/reference/atomic/memory_order.md) + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、`*this`が保持する値と`operand`の最大値を求めて、その値でアトミックに置き換える + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 備考 +- この関数は、`atomic`クラスの浮動小数点数型に対する特殊化で定義される +- 浮動小数点数型 + - [`std::fmaximum_num()`](/reference/cmath/fmaximum_num.md)関数と同様の動作をする + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::atomic x(2); + + x.store_fmaximum_num(3); + + std::cout << x.load() << std::endl; +} +``` +* store_fmaximum_num[color ff0000] +* load()[link load.md] + +### 出力 +``` +3 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 13 [mark noimpl] + + +## 参照 +- [P3111R8 Atomic Reduction Operations](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3111r8.html) \ No newline at end of file diff --git a/reference/atomic/atomic/store_fminimum.md b/reference/atomic/atomic/store_fminimum.md new file mode 100644 index 0000000000..53b3e471b8 --- /dev/null +++ b/reference/atomic/atomic/store_fminimum.md @@ -0,0 +1,93 @@ +# store_fminimum +* atomic[meta header] +* std[meta namespace] +* atomic[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +void + store_fminimum(difference_type operand, + memory_order order = memory_order_seq_cst + ) volatile noexcept; // (1) C++26 + +constexpr void + store_fminimum(difference_type operand, + memory_order order = memory_order_seq_cst + ) noexcept; // (2) C++26 +``` +* memory_order[link /reference/atomic/memory_order.md] +* memory_order_seq_cst[link /reference/atomic/memory_order.md] + +## 概要 +値を読み込まずに最小値を設定する。 + +この関数は、`*this`が保持する値と`operand`の小さい方を求め、その値を`this`に保持させる。 + +この関数は、[`fetch_fminimum()`](fetch_fminimum.md)と異なり、現在の (古い) 値を読み込むことなく現在の値に演算を行うため、高速に動作する。ただし変更前の古い値は戻り値として取得できない。 + + +## テンプレートパラメータ制約 +- `std::atomic`の場合、型`T`がオブジェクト型であること。型`T`が`void*`や関数ポインタであってはならない +- (1) : `atomic::is_always_lock_free`が`true`であること + + +## 事前条件 +- `order`は、以下のいずれかであること + - [`memory_order_relaxed`](/reference/atomic/memory_order.md) + - [`memory_order_release`](/reference/atomic/memory_order.md) + - [`memory_order_seq_cst`](/reference/atomic/memory_order.md) + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、`*this`が保持する値と`operand`の最小値を求めて、その値でアトミックに置き換える + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 備考 +- この関数は、`atomic`クラスの浮動小数点数型に対する特殊化で定義される +- 浮動小数点数型 + - [`std::fminimum()`](/reference/cmath/fminimum.md)関数と同様の動作をする + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::atomic x(2); + + x.store_fminimum(3); + + std::cout << x.load() << std::endl; +} +``` +* store_fminimum[color ff0000] +* load()[link load.md] + +### 出力 +``` +2 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 13 [mark noimpl] + + +## 参照 +- [P3111R8 Atomic Reduction Operations](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3111r8.html) \ No newline at end of file diff --git a/reference/atomic/atomic/store_fminimum_num.md b/reference/atomic/atomic/store_fminimum_num.md new file mode 100644 index 0000000000..d95cfec197 --- /dev/null +++ b/reference/atomic/atomic/store_fminimum_num.md @@ -0,0 +1,93 @@ +# store_fminimum_num +* atomic[meta header] +* std[meta namespace] +* atomic[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +void + store_fminimum_num(difference_type operand, + memory_order order = memory_order_seq_cst + ) volatile noexcept; // (1) C++26 + +constexpr void + store_fminimum_num(difference_type operand, + memory_order order = memory_order_seq_cst + ) noexcept; // (2) C++26 +``` +* memory_order[link /reference/atomic/memory_order.md] +* memory_order_seq_cst[link /reference/atomic/memory_order.md] + +## 概要 +値を読み込まずに最小値を設定する。 + +この関数は、`*this`が保持する値と`operand`の小さい方を求め、その値を`this`に保持させる。 + +この関数は、[`fetch_fminimum_num()`](fetch_fminimum_num.md)と異なり、現在の (古い) 値を読み込むことなく現在の値に演算を行うため、高速に動作する。ただし変更前の古い値は戻り値として取得できない。 + + +## テンプレートパラメータ制約 +- `std::atomic`の場合、型`T`がオブジェクト型であること。型`T`が`void*`や関数ポインタであってはならない +- (1) : `atomic::is_always_lock_free`が`true`であること + + +## 事前条件 +- `order`は、以下のいずれかであること + - [`memory_order_relaxed`](/reference/atomic/memory_order.md) + - [`memory_order_release`](/reference/atomic/memory_order.md) + - [`memory_order_seq_cst`](/reference/atomic/memory_order.md) + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、`*this`が保持する値と`operand`の最小値を求めて、その値でアトミックに置き換える + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 備考 +- この関数は、`atomic`クラスの浮動小数点数型に対する特殊化で定義される +- 浮動小数点数型 + - [`std::fminimum_num()`](/reference/cmath/fminimum_num.md)関数と同様の動作をする + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::atomic x(2); + + x.store_fminimum_num(3); + + std::cout << x.load() << std::endl; +} +``` +* store_fminimum_num[color ff0000] +* load()[link load.md] + +### 出力 +``` +2 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 13 [mark noimpl] + + +## 参照 +- [P3111R8 Atomic Reduction Operations](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3111r8.html) \ No newline at end of file diff --git a/reference/atomic/atomic/store_max.md b/reference/atomic/atomic/store_max.md new file mode 100644 index 0000000000..f96a3e2ab9 --- /dev/null +++ b/reference/atomic/atomic/store_max.md @@ -0,0 +1,99 @@ +# store_max +* atomic[meta header] +* std[meta namespace] +* atomic[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +void + store_max(difference_type operand, + memory_order order = memory_order_seq_cst + ) volatile noexcept; // (1) C++26 + +constexpr void + store_max(difference_type operand, + memory_order order = memory_order_seq_cst + ) noexcept; // (2) C++26 +``` +* memory_order[link /reference/atomic/memory_order.md] +* memory_order_seq_cst[link /reference/atomic/memory_order.md] + +## 概要 +値を読み込まずに最大値を設定する。 + +この関数は、`*this`が保持する値と`operand`の大きい方を求め、その値を`this`に保持させる。 + +この関数は、[`fetch_max()`](fetch_max.md)と異なり、現在の (古い) 値を読み込むことなく現在の値に演算を行うため、高速に動作する。ただし変更前の古い値は戻り値として取得できない。 + + +## テンプレートパラメータ制約 +- `std::atomic`の場合、型`T`がオブジェクト型であること。型`T`が`void*`や関数ポインタであってはならない +- (1) : `atomic::is_always_lock_free`が`true`であること + + +## 事前条件 +- `order`は、以下のいずれかであること + - [`memory_order_relaxed`](/reference/atomic/memory_order.md) + - [`memory_order_release`](/reference/atomic/memory_order.md) + - [`memory_order_seq_cst`](/reference/atomic/memory_order.md) + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、[`std::max()`](/reference/algorithm/max.md)アルゴリズムのように`*this`が保持する値と`operand`の最大値を求めて、その値でアトミックに置き換える + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 備考 +- この関数は、`atomic`クラスの整数型、浮動小数点数型、ポインタに対する特殊化で定義される +- 浮動小数点数型 + - [`std::fmaximum_num()`](/reference/cmath/fmaximum_num.md)関数と同様の動作をするが、以下の点で異なる: + - 両方のパラメータが`NaN`である場合、`this`が指す値は未規定のNaN値に置き換えられる + - 一方のパラメータだけが`NaN`である場合、`this`が指す値はもう一方のパラメータ、または未規定のNaN値に置き換えられるが、どちらに置き換えられるかは未規定 + - パラメータが異なる符号のゼロである場合、`this`が指す値がどちらに置き換えられるかは未規定 + - 処理系への推奨としては、負のゼロを正のゼロより小さいものとして扱うべきである +- ポインタ型 + - ポインタが異なる完全型オブジェクトを指している場合、`<`演算子による比較は狭義の弱順序を確立しない + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::atomic x(2); + + x.store_max(3); + + std::cout << x.load() << std::endl; +} +``` +* store_max[color ff0000] +* load()[link load.md] + +### 出力 +``` +3 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 13 [mark noimpl] + + +## 参照 +- [P3111R8 Atomic Reduction Operations](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3111r8.html) \ No newline at end of file diff --git a/reference/atomic/atomic/store_min.md b/reference/atomic/atomic/store_min.md new file mode 100644 index 0000000000..e0f6ca8d51 --- /dev/null +++ b/reference/atomic/atomic/store_min.md @@ -0,0 +1,99 @@ +# store_min +* atomic[meta header] +* std[meta namespace] +* atomic[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +void + store_min(difference_type operand, + memory_order order = memory_order_seq_cst + ) volatile noexcept; // (1) C++26 + +constexpr void + store_min(difference_type operand, + memory_order order = memory_order_seq_cst + ) noexcept; // (2) C++26 +``` +* memory_order[link /reference/atomic/memory_order.md] +* memory_order_seq_cst[link /reference/atomic/memory_order.md] + +## 概要 +値を読み込まずに最小値を設定する。 + +この関数は、`*this`が保持する値と`operand`の小さい方を求め、その値を`this`に保持させる。 + +この関数は、[`fetch_min()`](fetch_min.md)と異なり、現在の (古い) 値を読み込むことなく現在の値に演算を行うため、高速に動作する。ただし変更前の古い値は戻り値として取得できない。 + + +## テンプレートパラメータ制約 +- `std::atomic`の場合、型`T`がオブジェクト型であること。型`T`が`void*`や関数ポインタであってはならない +- (1) : `atomic::is_always_lock_free`が`true`であること + + +## 事前条件 +- `order`は、以下のいずれかであること + - [`memory_order_relaxed`](/reference/atomic/memory_order.md) + - [`memory_order_release`](/reference/atomic/memory_order.md) + - [`memory_order_seq_cst`](/reference/atomic/memory_order.md) + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、[`std::min()`](/reference/algorithm/min.md)アルゴリズムのように`*this`が保持する値と`operand`の最小値を求めて、その値でアトミックに置き換える + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 備考 +- この関数は、`atomic`クラスの整数型、浮動小数点数型、ポインタに対する特殊化で定義される +- 浮動小数点数型 + - [`std::fminimum_num()`](/reference/cmath/fminimum_num.md)関数と同様の動作をするが、以下の点で異なる: + - 両方のパラメータが`NaN`である場合、`this`が指す値は未規定のNaN値に置き換えられる + - 一方のパラメータだけが`NaN`である場合、`this`が指す値はもう一方のパラメータ、または未規定のNaN値に置き換えられるが、どちらに置き換えられるかは未規定 + - パラメータが異なる符号のゼロである場合、`this`が指す値がどちらに置き換えられるかは未規定 + - 処理系への推奨としては、負のゼロを正のゼロより小さいものとして扱うべきである +- ポインタ型 + - ポインタが異なる完全型オブジェクトを指している場合、`<`演算子による比較は狭義の弱順序を確立しない + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::atomic x(2); + + x.store_min(3); + + std::cout << x.load() << std::endl; +} +``` +* store_min[color ff0000] +* load()[link load.md] + +### 出力 +``` +2 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 13 [mark noimpl] + + +## 参照 +- [P3111R8 Atomic Reduction Operations](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3111r8.html) \ No newline at end of file diff --git a/reference/atomic/atomic/store_or.md b/reference/atomic/atomic/store_or.md new file mode 100644 index 0000000000..1f798560f7 --- /dev/null +++ b/reference/atomic/atomic/store_or.md @@ -0,0 +1,92 @@ +# store_or +* atomic[meta header] +* std[meta namespace] +* atomic[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +void + store_or(difference_type operand, + memory_order order = memory_order_seq_cst + ) volatile noexcept; // (1) C++26 + +constexpr void + store_or(difference_type operand, + memory_order order = memory_order_seq_cst + ) noexcept; // (2) C++26 +``` +* memory_order[link /reference/atomic/memory_order.md] +* memory_order_seq_cst[link /reference/atomic/memory_order.md] + +## 概要 +値を読み込まずにOR演算を行う。 + +この関数は、[`fetch_or()`](fetch_or.md)と異なり、現在の (古い) 値を読み込むことなく現在の値に演算を行うため、高速に動作する。ただし変更前の古い値は戻り値として取得できない。 + + +## テンプレートパラメータ制約 +- (1) : `atomic::is_always_lock_free`が`true`であること + + +## 事前条件 +- `order`は、以下のいずれかであること + - [`memory_order_relaxed`](/reference/atomic/memory_order.md) + - [`memory_order_release`](/reference/atomic/memory_order.md) + - [`memory_order_seq_cst`](/reference/atomic/memory_order.md) + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、現在の値に`operand`をORした値でアトミックに置き換える + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 備考 +- この関数は、`atomic`クラスの整数型に対する特殊化で定義される +- 符号付き整数型に対しては、符号なし整数型に変換されたかのようにしたあと演算が行われ、結果は符号付き整数型になる。未定義動作はない + + +## 例 +### 基本的な使い方 +```cpp example +#include +#include + +int main() +{ + std::atomic x(0b1001); + + x.store_or(0b0101); + + std::println("0b{:04b}", x.load()); +} +``` +* store_or[color ff0000] +* x.load()[link load.md] + + +#### 出力 +``` +0b1101 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 13 [mark noimpl] + + +## 参照 +- [P3111R8 Atomic Reduction Operations](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3111r8.html) \ No newline at end of file diff --git a/reference/atomic/atomic/store_sub.md b/reference/atomic/atomic/store_sub.md new file mode 100644 index 0000000000..5ed38ccce2 --- /dev/null +++ b/reference/atomic/atomic/store_sub.md @@ -0,0 +1,125 @@ +# store_sub +* atomic[meta header] +* std[meta namespace] +* atomic[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +void + store_sub(difference_type operand, + memory_order order = memory_order_seq_cst + ) volatile noexcept; // (1) C++26 + +constexpr void + store_sub(difference_type operand, + memory_order order = memory_order_seq_cst + ) noexcept; // (2) C++26 +``` +* memory_order[link /reference/atomic/memory_order.md] +* memory_order_seq_cst[link /reference/atomic/memory_order.md] + +## 概要 +値を読み込まずに減算を行う。 + +この関数は、[`fetch_sub()`](fetch_sub.md)と異なり、現在の (古い) 値を読み込むことなく現在の値に演算を行うため、高速に動作する。ただし変更前の古い値は戻り値として取得できない。 + + +## テンプレートパラメータ制約 +- (1) : `atomic::is_always_lock_free`が`true`であること + + +## 事前条件 +- `order`は、以下のいずれかであること + - [`memory_order_relaxed`](/reference/atomic/memory_order.md) + - [`memory_order_release`](/reference/atomic/memory_order.md) + - [`memory_order_seq_cst`](/reference/atomic/memory_order.md) + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、現在の値に`operand`を減算した値でアトミックに置き換える + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 備考 +- この関数は、`atomic`クラスの整数型、浮動小数点数型、ポインタに対する特殊化で定義される +- 整数型 + - 符号付き整数型に対しては、符号なし整数型に変換されたかのようにしたあと演算が行われ、結果は符号付き整数型になる。未定義動作はない +- 浮動小数点数型 + - 演算結果が、その型で表現できない値であった場合、結果は未規定値になる。ただしその操作によって未定義動作は起こらない + - 浮動小数点数型に対する操作は[`std::numeric_limits`](/reference/limits/numeric_limits.md)``トレイトに準拠する + - 浮動小数点数型に対するアトミック操作の浮動小数点環境は、呼び出しスレッドの浮動小数点環境とは異なる可能性がある +- ポインタ型 + - 結果として未定義アドレスになる場合があるが、それ以外の未定義動作はない + + +## 例 +### 基本的な使い方 +```cpp example +#include +#include + +int main() +{ + std::atomic x(3); + + x.store_sub(2); + + std::println("{}", x.load()); +} +``` +* store_sub[color ff0000] +* x.load()[link load.md] + + +#### 出力 +``` +1 +``` + +### 並列に減算する例 +```cpp example +#include +#include +#include +#include + +int main() +{ + std::atomic x{100}; + std::vector v = {1, 2, 3, 4, 5}; + + std::for_each(std::execution::par_unseq, v.begin(), v.end(), [&](int n){ + x.store_sub(n); + }); + + std::println("{}", x.load()); +} +``` +* store_sub[color ff0000] +* x.load()[link load.md] + +#### 出力 +``` +85 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 13 [mark noimpl] + + +## 参照 +- [P3111R8 Atomic Reduction Operations](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3111r8.html) \ No newline at end of file diff --git a/reference/atomic/atomic/store_xor.md b/reference/atomic/atomic/store_xor.md new file mode 100644 index 0000000000..c2e777ac51 --- /dev/null +++ b/reference/atomic/atomic/store_xor.md @@ -0,0 +1,92 @@ +# store_xor +* atomic[meta header] +* std[meta namespace] +* atomic[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +void + store_xor(difference_type operand, + memory_order order = memory_order_seq_cst + ) volatile noexcept; // (1) C++26 + +constexpr void + store_xor(difference_type operand, + memory_order order = memory_order_seq_cst + ) noexcept; // (2) C++26 +``` +* memory_order[link /reference/atomic/memory_order.md] +* memory_order_seq_cst[link /reference/atomic/memory_order.md] + +## 概要 +値を読み込まずにXOR演算を行う。 + +この関数は、[`fetch_xor()`](fetch_xor.md)と異なり、現在の (古い) 値を読み込むことなく現在の値に演算を行うため、高速に動作する。ただし変更前の古い値は戻り値として取得できない。 + + +## テンプレートパラメータ制約 +- (1) : `atomic::is_always_lock_free`が`true`であること + + +## 事前条件 +- `order`は、以下のいずれかであること + - [`memory_order_relaxed`](/reference/atomic/memory_order.md) + - [`memory_order_release`](/reference/atomic/memory_order.md) + - [`memory_order_seq_cst`](/reference/atomic/memory_order.md) + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、現在の値に`operand`をXORした値でアトミックに置き換える + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 備考 +- この関数は、`atomic`クラスの整数型に対する特殊化で定義される +- 符号付き整数型に対しては、符号なし整数型に変換されたかのようにしたあと演算が行われ、結果は符号付き整数型になる。未定義動作はない + + +## 例 +### 基本的な使い方 +```cpp example +#include +#include + +int main() +{ + std::atomic x(0b1001); + + x.store_xor(0b0101); + + std::println("0b{:04b}", x.load()); +} +``` +* store_xor[color ff0000] +* x.load()[link load.md] + + +#### 出力 +``` +0b1100 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 13 [mark noimpl] + + +## 参照 +- [P3111R8 Atomic Reduction Operations](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3111r8.html) \ No newline at end of file diff --git a/reference/atomic/atomic_fetch_max.md b/reference/atomic/atomic_fetch_max.md index b8cb690835..9ab914a4ad 100644 --- a/reference/atomic/atomic_fetch_max.md +++ b/reference/atomic/atomic_fetch_max.md @@ -6,12 +6,12 @@ ```cpp namespace std { - template + template T atomic_fetch_max(volatile atomic* object, typename atomic::value_type operand) noexcept; // (1) C++26 - template + template constexpr T atomic_fetch_max(atomic* object, typename atomic::value_type operand) noexcept; // (2) C++26 @@ -21,7 +21,7 @@ namespace std { ## 概要 -アトミックに最大値を取得する +アトミックに最大値を設定・取得する ## テンプレートパラメータ制約 @@ -30,7 +30,7 @@ namespace std { ## 効果 -[`memory_order_seq_cst`](memory_order.md)のメモリオーダーにしたがって、[`std::max()`](/reference/algorithm/max.md)アルゴリズムのように`*object`が保持する値と`operand`の最大値を求めて返す +[`memory_order_seq_cst`](memory_order.md)のメモリオーダーにしたがって、[`std::max()`](/reference/algorithm/max.md)アルゴリズムのように`*object`が保持する値と`operand`の最大値を求め、アトミックにその値で置き換えて返す ## 例外 diff --git a/reference/atomic/atomic_fetch_max_explicit.md b/reference/atomic/atomic_fetch_max_explicit.md index 0e088ba8aa..5778189550 100644 --- a/reference/atomic/atomic_fetch_max_explicit.md +++ b/reference/atomic/atomic_fetch_max_explicit.md @@ -34,7 +34,7 @@ namespace std { ## 効果 -`order`で指定されたメモリオーダーにしたがって、[`std::max()`](/reference/algorithm/max.md)アルゴリズムのように`*object`が保持する値と`operand`の最大値を求めて返す +`order`で指定されたメモリオーダーにしたがって、[`std::max()`](/reference/algorithm/max.md)アルゴリズムのように`*object`が保持する値と`operand`の最大値を求め、アトミックにその値で置き換えて返す ## 例外 diff --git a/reference/atomic/atomic_fetch_min.md b/reference/atomic/atomic_fetch_min.md index 26763e2a6c..84accc4b32 100644 --- a/reference/atomic/atomic_fetch_min.md +++ b/reference/atomic/atomic_fetch_min.md @@ -6,12 +6,12 @@ ```cpp namespace std { - template + template T atomic_fetch_min(volatile atomic* object, typename atomic::value_type operand) noexcept; // (1) C++26 - template + template constexpr T atomic_fetch_min(atomic* object, typename atomic::value_type operand) noexcept; // (2) C++26 @@ -30,7 +30,7 @@ namespace std { ## 効果 -[`memory_order_seq_cst`](memory_order.md)のメモリオーダーにしたがって、[`std::min()`](/reference/algorithm/min.md)アルゴリズムのように`*object`が保持する値と`operand`の最小値を求めて返す +[`memory_order_seq_cst`](memory_order.md)のメモリオーダーにしたがって、[`std::min()`](/reference/algorithm/min.md)アルゴリズムのように`*object`が保持する値と`operand`の最小値を求め、アトミックにその値で置き換えて返す ## 例外 diff --git a/reference/atomic/atomic_fetch_min_explicit.md b/reference/atomic/atomic_fetch_min_explicit.md index dd46f1a0c1..f0773bfa3f 100644 --- a/reference/atomic/atomic_fetch_min_explicit.md +++ b/reference/atomic/atomic_fetch_min_explicit.md @@ -34,7 +34,7 @@ namespace std { ## 効果 -`order`で指定されたメモリオーダーにしたがって、[`std::min()`](/reference/algorithm/min.md)アルゴリズムのように`*object`が保持する値と`operand`の最小値を求めて返す +`order`で指定されたメモリオーダーにしたがって、[`std::min()`](/reference/algorithm/min.md)アルゴリズムのように`*object`が保持する値と`operand`の最小値を求め、アトミックにその値で置き換えて返す ## 例外 diff --git a/reference/atomic/atomic_ref.md b/reference/atomic/atomic_ref.md index 80d62575e7..149f5b4a88 100644 --- a/reference/atomic/atomic_ref.md +++ b/reference/atomic/atomic_ref.md @@ -92,6 +92,13 @@ C++26から、これらの特殊化はCV修飾された型に対しても行わ | [`fetch_xor`](atomic_ref/fetch_xor.md) | XOR演算 | C++20 | | [`fetch_max`](atomic_ref/fetch_max.md) | 最大値を設定・取得 | C++26 | | [`fetch_min`](atomic_ref/fetch_min.md) | 最小値を設定・取得 | C++26 | +| [`store_add`](atomic_ref/store_add.md) | 値を読み込まずに加算 | C++26 | +| [`store_sub`](atomic_ref/store_sub.md) | 値を読み込まずに減算 | C++26 | +| [`store_and`](atomic_ref/store_and.md) | 値を読み込まずにAND演算 | C++26 | +| [`store_or`](atomic_ref/store_or.md) | 値を読み込まずにOR演算 | C++26 | +| [`store_xor`](atomic_ref/store_xor.md) | 値を読み込まずにXOR演算 | C++26 | +| [`store_max`](atomic_ref/store_max.md) | 値を読み込まずに最大値を設定 | C++26 | +| [`store_min`](atomic_ref/store_min.md) | 値を読み込まずに最小値を設定 | C++26 | | [`operator++`](atomic_ref/op_increment.md) | インクリメント | C++20 | | [`operator--`](atomic_ref/op_decrement.md) | デクリメント | C++20 | | [`operator+=`](atomic_ref/op_plus_assign.md) | 加算 | C++20 | @@ -120,6 +127,17 @@ C++26から、これらの特殊化はCV修飾された型に対しても行わ | [`fetch_fminimum`](atomic_ref/fetch_fminimum.md) | 最小値を設定・取得 (`-0.0`と`+0.0`では`-0.0`、NaNと値ではNaNを返す) | C++26 | | [`fetch_fmaximum_num`](atomic_ref/fetch_fmaximum_num.md) | 最大値を設定・取得 (`-0.0`と`+0.0`では`+0.0`、NaNと値では数値を返す) | C++26 | | [`fetch_fminimum_num`](atomic_ref/fetch_fminimum_num.md) | 最小値を設定・取得 (`-0.0`と`+0.0`では`-0.0`、NaNと値では数値を返す) | C++26 | +| [`store_add`](atomic_ref/store_add.md) | 値を読み込まずに加算 | C++26 | +| [`store_sub`](atomic_ref/store_sub.md) | 値を読み込まずに減算 | C++26 | +| [`store_and`](atomic_ref/store_and.md) | 値を読み込まずにAND演算 | C++26 | +| [`store_or`](atomic_ref/store_or.md) | 値を読み込まずにOR演算 | C++26 | +| [`store_xor`](atomic_ref/store_xor.md) | 値を読み込まずにXOR演算 | C++26 | +| [`store_max`](atomic_ref/store_max.md) | 値を読み込まずに最大値を設定 | C++26 | +| [`store_min`](atomic_ref/store_min.md) | 値を読み込まずに最小値を設定 | C++26 | +| [`store_fmaximum`](atomic_ref/store_fmaximum.md) | 値を読み込まずに最大値を設定 (`-0.0`と`+0.0`では`+0.0`、NaNと値ではNaNを返す) | C++26 | +| [`store_fminimum`](atomic_ref/store_fminimum.md) | 値を読み込まずに最小値を設定 (`-0.0`と`+0.0`では`-0.0`、NaNと値ではNaNを返す) | C++26 | +| [`store_fmaximum_num`](atomic_ref/store_fmaximum_num.md) | 値を読み込まずに最大値を設定 (`-0.0`と`+0.0`では`+0.0`、NaNと値では数値を返す) | C++26 | +| [`store_fminimum_num`](atomic_ref/store_fminimum_num.md) | 値を読み込まずに最小値を設定 (`-0.0`と`+0.0`では`-0.0`、NaNと値では数値を返す) | C++26 | | [`operator+=`](atomic_ref/op_plus_assign.md) | 加算 | C++20 | | [`operator-=`](atomic_ref/op_minus_assign.md) | 減算 | C++20 | @@ -139,6 +157,10 @@ C++26から、これらの特殊化はCV修飾された型に対しても行わ | [`fetch_sub`](atomic_ref/fetch_sub.md) | 減算 | C++20 | | [`fetch_max`](atomic_ref/fetch_max.md) | 最大値を設定・取得 | C++26 | | [`fetch_min`](atomic_ref/fetch_min.md) | 最小値を設定・取得 | C++26 | +| [`store_add`](atomic_ref/store_add.md) | 値を読み込まずに加算 | C++26 | +| [`store_sub`](atomic_ref/store_sub.md) | 値を読み込まずに減算 | C++26 | +| [`store_max`](atomic_ref/store_max.md) | 値を読み込まずに最大値を設定 | C++26 | +| [`store_min`](atomic_ref/store_min.md) | 値を読み込まずに最小値を設定 | C++26 | | [`operator++`](atomic_ref/op_increment.md) | インクリメント | C++20 | | [`operator--`](atomic_ref/op_decrement.md) | デクリメント | C++20 | | [`operator+=`](atomic_ref/op_plus_assign.md) | 加算 | C++20 | diff --git a/reference/atomic/atomic_ref/store_add.md b/reference/atomic/atomic_ref/store_add.md new file mode 100644 index 0000000000..4b7ff79b42 --- /dev/null +++ b/reference/atomic/atomic_ref/store_add.md @@ -0,0 +1,114 @@ +# store_add +* atomic[meta header] +* std[meta namespace] +* atomic_ref[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr void + store_add(difference_type operand, + memory_order order = memory_order_seq_cst + ) const noexcept; // (1) C++26 +``` +* memory_order[link /reference/atomic/memory_order.md] +* memory_order_seq_cst[link /reference/atomic/memory_order.md] + +## 概要 +値を読み込まずに加算を行う。 + +この関数は、[`fetch_add()`](fetch_add.md)と異なり、現在の (古い) 値を読み込むことなく現在の値に演算を行うため、高速に動作する。ただし変更前の古い値は戻り値として取得できない。 + + +## 事前条件 +- `order`は、以下のいずれかであること + - [`memory_order_relaxed`](/reference/atomic/memory_order.md) + - [`memory_order_release`](/reference/atomic/memory_order.md) + - [`memory_order_seq_cst`](/reference/atomic/memory_order.md) + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、現在の値に`operand`を加算した値でアトミックに置き換える + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 備考 +- この関数は、`atomic_ref`クラスの整数型、浮動小数点数型、ポインタに対する特殊化で定義される +- 整数型 + - 符号付き整数型に対しては、符号なし整数型に変換されたかのようにしたあと演算が行われ、結果は符号付き整数型になる。未定義動作はない +- 浮動小数点数型 + - 演算結果が、その型で表現できない値であった場合、結果は未規定値になる。ただしその操作によって未定義動作は起こらない + - 浮動小数点数型に対する操作は[`std::numeric_limits`](/reference/limits/numeric_limits.md)``トレイトに準拠する + - 浮動小数点数型に対するアトミック操作の浮動小数点環境は、呼び出しスレッドの浮動小数点環境とは異なる可能性がある +- ポインタ型 + - 結果として未定義アドレスになる場合があるが、それ以外の未定義動作はない + + +## 例 +### 基本的な使い方 +```cpp example +#include +#include + +int main() +{ + int value = 3; + + std::atomic_ref{value}.store_add(2); + + std::println("{}", value); +} +``` +* store_add[color ff0000] + + +#### 出力 +``` +5 +``` + +### 並列に加算する例 +```cpp example +#include +#include +#include +#include + +int main() +{ + int x = 0; + std::vector v = {1, 2, 3, 4, 5}; + + std::for_each(std::execution::par_unseq, v.begin(), v.end(), [&](int n){ + std::atomic_ref{x}.store_add(n); + }); + + std::println("{}", x); +} +``` +* store_add[color ff0000] + +#### 出力 +``` +15 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 13 [mark noimpl] + + +## 参照 +- [P3111R8 Atomic Reduction Operations](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3111r8.html) \ No newline at end of file diff --git a/reference/atomic/atomic_ref/store_and.md b/reference/atomic/atomic_ref/store_and.md new file mode 100644 index 0000000000..9c1aad88ba --- /dev/null +++ b/reference/atomic/atomic_ref/store_and.md @@ -0,0 +1,81 @@ +# store_and +* atomic[meta header] +* std[meta namespace] +* atomic_ref[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr void + store_and(difference_type operand, + memory_order order = memory_order_seq_cst + ) const noexcept; // (1) C++26 +``` +* memory_order[link /reference/atomic/memory_order.md] +* memory_order_seq_cst[link /reference/atomic/memory_order.md] + +## 概要 +値を読み込まずにAND演算を行う。 + +この関数は、[`fetch_and()`](fetch_and.md)と異なり、現在の (古い) 値を読み込むことなく現在の値に演算を行うため、高速に動作する。ただし変更前の古い値は戻り値として取得できない。 + + +## 事前条件 +- `order`は、以下のいずれかであること + - [`memory_order_relaxed`](/reference/atomic/memory_order.md) + - [`memory_order_release`](/reference/atomic/memory_order.md) + - [`memory_order_seq_cst`](/reference/atomic/memory_order.md) + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、現在の値に`operand`をANDした値でアトミックに置き換える + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 備考 +- この関数は、`atomic_ref`クラスの整数型に対する特殊化で定義される +- 符号付き整数型に対しては、符号なし整数型に変換されたかのようにしたあと演算が行われ、結果は符号付き整数型になる。未定義動作はない + + +## 例 +### 基本的な使い方 +```cpp example +#include +#include + +int main() +{ + int value = 0b1001; + + std::atomic_ref{value}.store_and(0b0101); + + std::println("0b{:04b}", value); +} +``` +* store_and[color ff0000] + +#### 出力 +``` +0b0001 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 13 [mark noimpl] + + +## 参照 +- [P3111R8 Atomic Reduction Operations](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3111r8.html) \ No newline at end of file diff --git a/reference/atomic/atomic_ref/store_fmaximum.md b/reference/atomic/atomic_ref/store_fmaximum.md new file mode 100644 index 0000000000..58b03dbcbc --- /dev/null +++ b/reference/atomic/atomic_ref/store_fmaximum.md @@ -0,0 +1,82 @@ +# store_fmaximum +* atomic[meta header] +* std[meta namespace] +* atomic_ref[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr void + store_fmaximum(difference_type operand, + memory_order order = memory_order_seq_cst + ) const noexcept; // (1) C++26 +``` +* memory_order[link /reference/atomic/memory_order.md] +* memory_order_seq_cst[link /reference/atomic/memory_order.md] + +## 概要 +値を読み込まずに最大値を設定する。 + +この関数は、`*this`が参照する値と`operand`の大きい方を求め、その値を`this`に参照させる。 + +この関数は、[`fetch_fmaximum()`](fetch_fmaximum.md)と異なり、現在の (古い) 値を読み込むことなく現在の値に演算を行うため、高速に動作する。ただし変更前の古い値は戻り値として取得できない。 + + +## 事前条件 +- `order`は、以下のいずれかであること + - [`memory_order_relaxed`](/reference/atomic/memory_order.md) + - [`memory_order_release`](/reference/atomic/memory_order.md) + - [`memory_order_seq_cst`](/reference/atomic/memory_order.md) + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、`*this`が参照する値と`operand`の最大値を求めて、その値でアトミックに置き換える + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 備考 +- この関数は、`atomic_ref`クラスの浮動小数点数型に対する特殊化で定義される +- 浮動小数点数型 + - [`std::fmaximum()`](/reference/cmath/fmaximum.md)関数と同様の動作をする + + +## 例 +```cpp example +#include +#include + +int main() +{ + int value = 2; + + std::atomic_ref{value}.store_fmaximum(3); + + std::cout << value << std::endl; +} +``` +* store_fmaximum[color ff0000] + +### 出力 +``` +3 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 13 [mark noimpl] + + +## 参照 +- [P3111R8 Atomic Reduction Operations](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3111r8.html) \ No newline at end of file diff --git a/reference/atomic/atomic_ref/store_fmaximum_num.md b/reference/atomic/atomic_ref/store_fmaximum_num.md new file mode 100644 index 0000000000..34a44cfb4d --- /dev/null +++ b/reference/atomic/atomic_ref/store_fmaximum_num.md @@ -0,0 +1,82 @@ +# store_fmaximum_num +* atomic[meta header] +* std[meta namespace] +* atomic_ref[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr void + store_fmaximum_num(difference_type operand, + memory_order order = memory_order_seq_cst + ) const noexcept; // (1) C++26 +``` +* memory_order[link /reference/atomic/memory_order.md] +* memory_order_seq_cst[link /reference/atomic/memory_order.md] + +## 概要 +値を読み込まずに最大値を設定する。 + +この関数は、`*this`が参照する値と`operand`の大きい方を求め、その値を`this`に参照させる。 + +この関数は、[`fetch_fmaximum_num()`](fetch_fmaximum_num.md)と異なり、現在の (古い) 値を読み込むことなく現在の値に演算を行うため、高速に動作する。ただし変更前の古い値は戻り値として取得できない。 + + +## 事前条件 +- `order`は、以下のいずれかであること + - [`memory_order_relaxed`](/reference/atomic/memory_order.md) + - [`memory_order_release`](/reference/atomic/memory_order.md) + - [`memory_order_seq_cst`](/reference/atomic/memory_order.md) + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、`*this`が参照する値と`operand`の最大値を求めて、その値でアトミックに置き換える + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 備考 +- この関数は、`atomic_ref`クラスの浮動小数点数型に対する特殊化で定義される +- 浮動小数点数型 + - [`std::fmaximum_num()`](/reference/cmath/fmaximum_num.md)関数と同様の動作をする + + +## 例 +```cpp example +#include +#include + +int main() +{ + int value = 2; + + std::atomic_ref{value}.store_fmaximum_num(3); + + std::cout << value << std::endl; +} +``` +* store_fmaximum_num[color ff0000] + +### 出力 +``` +3 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 13 [mark noimpl] + + +## 参照 +- [P3111R8 Atomic Reduction Operations](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3111r8.html) \ No newline at end of file diff --git a/reference/atomic/atomic_ref/store_fminimum.md b/reference/atomic/atomic_ref/store_fminimum.md new file mode 100644 index 0000000000..f3ed9f9651 --- /dev/null +++ b/reference/atomic/atomic_ref/store_fminimum.md @@ -0,0 +1,83 @@ +# store_fminimum +* atomic[meta header] +* std[meta namespace] +* atomic_ref[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr void + store_fminimum(difference_type operand, + memory_order order = memory_order_seq_cst + ) const noexcept; // (1) C++26 +``` +* memory_order[link /reference/atomic/memory_order.md] +* memory_order_seq_cst[link /reference/atomic/memory_order.md] + +## 概要 +値を読み込まずに最小値を設定する。 + +この関数は、`*this`が参照する値と`operand`の小さい方を求め、その値を`this`に参照させる。 + +この関数は、[`fetch_fminimum()`](fetch_fminimum.md)と異なり、現在の (古い) 値を読み込むことなく現在の値に演算を行うため、高速に動作する。ただし変更前の古い値は戻り値として取得できない。 + + +## 事前条件 +- `order`は、以下のいずれかであること + - [`memory_order_relaxed`](/reference/atomic/memory_order.md) + - [`memory_order_release`](/reference/atomic/memory_order.md) + - [`memory_order_seq_cst`](/reference/atomic/memory_order.md) + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、`*this`が参照する値と`operand`の最小値を求めて、その値でアトミックに置き換える + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 備考 +- この関数は、`atomic_ref`クラスの浮動小数点数型に対する特殊化で定義される +- 浮動小数点数型 + - [`std::fminimum()`](/reference/cmath/fminimum.md)関数と同様の動作をする + + +## 例 +```cpp example +#include +#include + +int main() +{ + int value = 2; + + std::atomic_ref{value}.store_fminimum(3); + + std::cout << value << std::endl; +} +``` +* store_fminimum[color ff0000] + +### 出力 +``` +2 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 13 [mark noimpl] + + +## 参照 +- [P3111R8 Atomic Reduction Operations](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3111r8.html) \ No newline at end of file diff --git a/reference/atomic/atomic_ref/store_fminimum_num.md b/reference/atomic/atomic_ref/store_fminimum_num.md new file mode 100644 index 0000000000..cad9007255 --- /dev/null +++ b/reference/atomic/atomic_ref/store_fminimum_num.md @@ -0,0 +1,82 @@ +# store_fminimum_num +* atomic[meta header] +* std[meta namespace] +* atomic_ref[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr void + store_fminimum_num(difference_type operand, + memory_order order = memory_order_seq_cst + ) const noexcept; // (1) C++26 +``` +* memory_order[link /reference/atomic/memory_order.md] +* memory_order_seq_cst[link /reference/atomic/memory_order.md] + +## 概要 +値を読み込まずに最小値を設定する。 + +この関数は、`*this`が参照する値と`operand`の小さい方を求め、その値を`this`に参照させる。 + +この関数は、[`fetch_fminimum_num()`](fetch_fminimum_num.md)と異なり、現在の (古い) 値を読み込むことなく現在の値に演算を行うため、高速に動作する。ただし変更前の古い値は戻り値として取得できない。 + + +## 事前条件 +- `order`は、以下のいずれかであること + - [`memory_order_relaxed`](/reference/atomic/memory_order.md) + - [`memory_order_release`](/reference/atomic/memory_order.md) + - [`memory_order_seq_cst`](/reference/atomic/memory_order.md) + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、`*this`が参照する値と`operand`の最小値を求めて、その値でアトミックに置き換える + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 備考 +- この関数は、`atomic_ref`クラスの浮動小数点数型に対する特殊化で定義される +- 浮動小数点数型 + - [`std::fminimum_num()`](/reference/cmath/fminimum_num.md)関数と同様の動作をする + + +## 例 +```cpp example +#include +#include + +int main() +{ + int value = 2; + + std::atomic_ref{value}.store_fminimum_num(3); + + std::cout << value << std::endl; +} +``` +* store_fminimum_num[color ff0000] + +### 出力 +``` +2 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 13 [mark noimpl] + + +## 参照 +- [P3111R8 Atomic Reduction Operations](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3111r8.html) \ No newline at end of file diff --git a/reference/atomic/atomic_ref/store_max.md b/reference/atomic/atomic_ref/store_max.md new file mode 100644 index 0000000000..da3c762694 --- /dev/null +++ b/reference/atomic/atomic_ref/store_max.md @@ -0,0 +1,92 @@ +# store_max +* atomic[meta header] +* std[meta namespace] +* atomic_ref[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr void + store_max(difference_type operand, + memory_order order = memory_order_seq_cst + ) const noexcept; // (1) C++26 +``` +* memory_order[link /reference/atomic/memory_order.md] +* memory_order_seq_cst[link /reference/atomic/memory_order.md] + +## 概要 +値を読み込まずに最大値を設定する。 + +この関数は、`*this`が参照する値と`operand`の大きい方を求め、その値を`this`に参照させる。 + +この関数は、[`fetch_max()`](fetch_max.md)と異なり、現在の (古い) 値を読み込むことなく現在の値に演算を行うため、高速に動作する。ただし変更前の古い値は戻り値として取得できない。 + + +## テンプレートパラメータ制約 +- (1) : `std::atomic`の場合、型`T`がオブジェクト型であること。型`T`が`void*`や関数ポインタであってはならない + + +## 事前条件 +- `order`は、以下のいずれかであること + - [`memory_order_relaxed`](/reference/atomic/memory_order.md) + - [`memory_order_release`](/reference/atomic/memory_order.md) + - [`memory_order_seq_cst`](/reference/atomic/memory_order.md) + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、[`std::max()`](/reference/algorithm/max.md)アルゴリズムのように`*this`が参照する値と`operand`の最大値を求めて、その値でアトミックに置き換える + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 備考 +- この関数は、`atomic_ref`クラスの整数型、浮動小数点数型、ポインタに対する特殊化で定義される +- 浮動小数点数型 + - [`std::fmaximum_num()`](/reference/cmath/fmaximum_num.md)関数と同様の動作をするが、以下の点で異なる: + - 両方のパラメータが`NaN`である場合、`this`が指す値は未規定のNaN値に置き換えられる + - 一方のパラメータだけが`NaN`である場合、`this`が指す値はもう一方のパラメータ、または未規定のNaN値に置き換えられるが、どちらに置き換えられるかは未規定 + - パラメータが異なる符号のゼロである場合、`this`が指す値がどちらに置き換えられるかは未規定 + - 処理系への推奨としては、負のゼロを正のゼロより小さいものとして扱うべきである +- ポインタ型 + - ポインタが異なる完全型オブジェクトを指している場合、`<`演算子による比較は狭義の弱順序を確立しない + + +## 例 +```cpp example +#include +#include + +int main() +{ + int value = 2; + + std::atomic_ref{value}.store_max(3); + + std::cout << value << std::endl; +} +``` +* store_max[color ff0000] + +### 出力 +``` +3 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 13 [mark noimpl] + + +## 参照 +- [P3111R8 Atomic Reduction Operations](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3111r8.html) \ No newline at end of file diff --git a/reference/atomic/atomic_ref/store_min.md b/reference/atomic/atomic_ref/store_min.md new file mode 100644 index 0000000000..ddf1daa2ea --- /dev/null +++ b/reference/atomic/atomic_ref/store_min.md @@ -0,0 +1,92 @@ +# store_min +* atomic[meta header] +* std[meta namespace] +* atomic_ref[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr void + store_min(difference_type operand, + memory_order order = memory_order_seq_cst + ) const noexcept; // (1) C++26 +``` +* memory_order[link /reference/atomic/memory_order.md] +* memory_order_seq_cst[link /reference/atomic/memory_order.md] + +## 概要 +値を読み込まずに最小値を設定する。 + +この関数は、`*this`が参照する値と`operand`の小さい方を求め、その値を`this`に参照させる。 + +この関数は、[`fetch_min()`](fetch_min.md)と異なり、現在の (古い) 値を読み込むことなく現在の値に演算を行うため、高速に動作する。ただし変更前の古い値は戻り値として取得できない。 + + +## テンプレートパラメータ制約 +- (1) : `std::atomic`の場合、型`T`がオブジェクト型であること。型`T`が`void*`や関数ポインタであってはならない + + +## 事前条件 +- `order`は、以下のいずれかであること + - [`memory_order_relaxed`](/reference/atomic/memory_order.md) + - [`memory_order_release`](/reference/atomic/memory_order.md) + - [`memory_order_seq_cst`](/reference/atomic/memory_order.md) + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、[`std::min()`](/reference/algorithm/min.md)アルゴリズムのように`*this`が参照する値と`operand`の最小値を求めて、その値でアトミックに置き換える + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 備考 +- この関数は、`atomic_ref`クラスの整数型、浮動小数点数型、ポインタに対する特殊化で定義される +- 浮動小数点数型 + - [`std::fminimum_num()`](/reference/cmath/fminimum_num.md)関数と同様の動作をするが、以下の点で異なる: + - 両方のパラメータが`NaN`である場合、`this`が指す値は未規定のNaN値に置き換えられる + - 一方のパラメータだけが`NaN`である場合、`this`が指す値はもう一方のパラメータ、または未規定のNaN値に置き換えられるが、どちらに置き換えられるかは未規定 + - パラメータが異なる符号のゼロである場合、`this`が指す値がどちらに置き換えられるかは未規定 + - 処理系への推奨としては、負のゼロを正のゼロより小さいものとして扱うべきである +- ポインタ型 + - ポインタが異なる完全型オブジェクトを指している場合、`<`演算子による比較は狭義の弱順序を確立しない + + +## 例 +```cpp example +#include +#include + +int main() +{ + int value = 2; + + std::atomic_ref{value}.store_min(3); + + std::cout << value << std::endl; +} +``` +* store_min[color ff0000] + +### 出力 +``` +2 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 13 [mark noimpl] + + +## 参照 +- [P3111R8 Atomic Reduction Operations](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3111r8.html) \ No newline at end of file diff --git a/reference/atomic/atomic_ref/store_or.md b/reference/atomic/atomic_ref/store_or.md new file mode 100644 index 0000000000..116a803653 --- /dev/null +++ b/reference/atomic/atomic_ref/store_or.md @@ -0,0 +1,82 @@ +# store_or +* atomic[meta header] +* std[meta namespace] +* atomic_ref[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr void + store_or(difference_type operand, + memory_order order = memory_order_seq_cst + ) const noexcept; // (1) C++26 +``` +* memory_order[link /reference/atomic/memory_order.md] +* memory_order_seq_cst[link /reference/atomic/memory_order.md] + +## 概要 +値を読み込まずにOR演算を行う。 + +この関数は、[`fetch_or()`](fetch_or.md)と異なり、現在の (古い) 値を読み込むことなく現在の値に演算を行うため、高速に動作する。ただし変更前の古い値は戻り値として取得できない。 + + +## 事前条件 +- `order`は、以下のいずれかであること + - [`memory_order_relaxed`](/reference/atomic/memory_order.md) + - [`memory_order_release`](/reference/atomic/memory_order.md) + - [`memory_order_seq_cst`](/reference/atomic/memory_order.md) + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、現在の値に`operand`をORした値でアトミックに置き換える + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 備考 +- この関数は、`atomic_ref`クラスの整数型に対する特殊化で定義される +- 符号付き整数型に対しては、符号なし整数型に変換されたかのようにしたあと演算が行われ、結果は符号付き整数型になる。未定義動作はない + + +## 例 +### 基本的な使い方 +```cpp example +#include +#include + +int main() +{ + int value = 0b1001; + + std::atomic_ref{value}.store_or(0b0101); + + std::println("0b{:04b}", value); +} +``` +* store_or[color ff0000] + + +#### 出力 +``` +0b1101 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 13 [mark noimpl] + + +## 参照 +- [P3111R8 Atomic Reduction Operations](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3111r8.html) \ No newline at end of file diff --git a/reference/atomic/atomic_ref/store_sub.md b/reference/atomic/atomic_ref/store_sub.md new file mode 100644 index 0000000000..121f975405 --- /dev/null +++ b/reference/atomic/atomic_ref/store_sub.md @@ -0,0 +1,114 @@ +# store_sub +* atomic[meta header] +* std[meta namespace] +* atomic_ref[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr void + store_sub(difference_type operand, + memory_order order = memory_order_seq_cst + ) const noexcept; // (1) C++26 +``` +* memory_order[link /reference/atomic/memory_order.md] +* memory_order_seq_cst[link /reference/atomic/memory_order.md] + +## 概要 +値を読み込まずに減算を行う。 + +この関数は、[`fetch_sub()`](fetch_sub.md)と異なり、現在の (古い) 値を読み込むことなく現在の値に演算を行うため、高速に動作する。ただし変更前の古い値は戻り値として取得できない。 + + +## 事前条件 +- `order`は、以下のいずれかであること + - [`memory_order_relaxed`](/reference/atomic/memory_order.md) + - [`memory_order_release`](/reference/atomic/memory_order.md) + - [`memory_order_seq_cst`](/reference/atomic/memory_order.md) + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、現在の値に`operand`を減算した値でアトミックに置き換える + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 備考 +- この関数は、`atomic_ref`クラスの整数型、浮動小数点数型、ポインタに対する特殊化で定義される +- 整数型 + - 符号付き整数型に対しては、符号なし整数型に変換されたかのようにしたあと演算が行われ、結果は符号付き整数型になる。未定義動作はない +- 浮動小数点数型 + - 演算結果が、その型で表現できない値であった場合、結果は未規定値になる。ただしその操作によって未定義動作は起こらない + - 浮動小数点数型に対する操作は[`std::numeric_limits`](/reference/limits/numeric_limits.md)``トレイトに準拠する + - 浮動小数点数型に対するアトミック操作の浮動小数点環境は、呼び出しスレッドの浮動小数点環境とは異なる可能性がある +- ポインタ型 + - 結果として未定義アドレスになる場合があるが、それ以外の未定義動作はない + + +## 例 +### 基本的な使い方 +```cpp example +#include +#include + +int main() +{ + int value = 3; + + std::atomic_ref{value}.store_sub(2); + + std::println("{}", value); +} +``` +* store_sub[color ff0000] + + +#### 出力 +``` +1 +``` + +### 並列に減算する例 +```cpp example +#include +#include +#include +#include + +int main() +{ + int x = 100; + std::vector v = {1, 2, 3, 4, 5}; + + std::for_each(std::execution::par_unseq, v.begin(), v.end(), [&](int n){ + std::atomic_ref{value}.store_sub(n); + }); + + std::println("{}", value); +} +``` +* store_sub[color ff0000] + +#### 出力 +``` +85 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 13 [mark noimpl] + + +## 参照 +- [P3111R8 Atomic Reduction Operations](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3111r8.html) \ No newline at end of file diff --git a/reference/atomic/atomic_ref/store_xor.md b/reference/atomic/atomic_ref/store_xor.md new file mode 100644 index 0000000000..883ad242d2 --- /dev/null +++ b/reference/atomic/atomic_ref/store_xor.md @@ -0,0 +1,82 @@ +# store_xor +* atomic[meta header] +* std[meta namespace] +* atomic_ref[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr void + store_xor(difference_type operand, + memory_order order = memory_order_seq_cst + ) const noexcept; // (1) C++26 +``` +* memory_order[link /reference/atomic/memory_order.md] +* memory_order_seq_cst[link /reference/atomic/memory_order.md] + +## 概要 +値を読み込まずにXOR演算を行う。 + +この関数は、[`fetch_xor()`](fetch_xor.md)と異なり、現在の (古い) 値を読み込むことなく現在の値に演算を行うため、高速に動作する。ただし変更前の古い値は戻り値として取得できない。 + + +## 事前条件 +- `order`は、以下のいずれかであること + - [`memory_order_relaxed`](/reference/atomic/memory_order.md) + - [`memory_order_release`](/reference/atomic/memory_order.md) + - [`memory_order_seq_cst`](/reference/atomic/memory_order.md) + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、現在の値に`operand`をXORした値でアトミックに置き換える + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 備考 +- この関数は、`atomic_ref`クラスの整数型に対する特殊化で定義される +- 符号付き整数型に対しては、符号なし整数型に変換されたかのようにしたあと演算が行われ、結果は符号付き整数型になる。未定義動作はない + + +## 例 +### 基本的な使い方 +```cpp example +#include +#include + +int main() +{ + int value = 0b1001; + + std::atomic_ref{value}.store_xor(0b0101); + + std::println("0b{:04b}", value); +} +``` +* store_xor[color ff0000] + + +#### 出力 +``` +0b1100 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 13 [mark noimpl] + + +## 参照 +- [P3111R8 Atomic Reduction Operations](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3111r8.html) \ No newline at end of file diff --git a/reference/atomic/atomic_store_add.md b/reference/atomic/atomic_store_add.md new file mode 100644 index 0000000000..cf7f0c8c80 --- /dev/null +++ b/reference/atomic/atomic_store_add.md @@ -0,0 +1,94 @@ +# atomic_store_add +* atomic[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + void + atomic_store_add( + volatile atomic* object, + typename atomic::difference_type operand) noexcept; // (1) C++26 + + template + constexpr void + atomic_store_add( + atomic* object, + typename atomic::difference_type operand) noexcept; // (2) C++26 +} +``` +* atomic[link /reference/atomic/atomic.md] + + +## 概要 +値を読み込まずにアトミックに値を加算する。 + +この関数は、[`atomic_fetch_add()`](atomic_fetch_add.md)と異なり、現在の (古い) 値を読み込むことなく現在の値に演算を行うため、高速に動作する。ただし変更前の古い値は戻り値として取得できない。 + + +## テンプレートパラメータ制約 +- 型`T`がオブジェクト型であること。型`T`が`void*`や関数ポインタであってはならない +- (1) : + - `atomic::is_always_lock_free`が`true`であること + + +## 事前条件 +- `order`は、以下のいずれかであること + - [`memory_order_relaxed`](/reference/atomic/memory_order.md) + - [`memory_order_release`](/reference/atomic/memory_order.md) + - [`memory_order_seq_cst`](/reference/atomic/memory_order.md) + + +## 効果 +[`memory_order_seq_cst`](memory_order.md)のメモリオーダーにしたがって、現在の値に`operand`を加算した値でアトミックに置き換える + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 備考 +符号付き整数型に対しては、2の補数表現による演算が行われ、未定義動作はない。アドレス型に関しては結果として未定義アドレスになる場合があるが、それ以外の未定義動作はない。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::atomic x(3); + + std::atomic_store_add(&x, 2); + + std::cout << x.load() << std::endl; +} +``` +* std::atomic_store_add[color ff0000] +* x.load()[link /reference/atomic/atomic/load.md] + +### 出力 +``` +5 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 13 [mark noimpl] + + +## 参照 +- [P3111R8 Atomic Reduction Operations](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3111r8.html) \ No newline at end of file diff --git a/reference/atomic/atomic_store_add_explicit.md b/reference/atomic/atomic_store_add_explicit.md new file mode 100644 index 0000000000..606b6fbc3d --- /dev/null +++ b/reference/atomic/atomic_store_add_explicit.md @@ -0,0 +1,96 @@ +# atomic_store_add_explicit +* atomic[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + void + atomic_store_add_explicit( + volatile atomic* object, + typename atomic::difference_type operand, + memory_order order) noexcept; // (1) C++26 + + template + constexpr void + atomic_store_add_explicit( + atomic* object, + typename atomic::difference_type operand, + memory_order order) noexcept; // (2) C++26 +} +``` +* atomic[link atomic.md] +* memory_order[link memory_order.md] + +## 概要 +値を読み込まずにアトミックに加算を行う。 + +この関数は、[`atomic_fetch_add_explicit()`](atomic_fetch_add_explicit.md)と異なり、現在の (古い) 値を読み込むことなく現在の値に演算を行うため、高速に動作する。ただし変更前の古い値は戻り値として取得できない。 + + +## テンプレートパラメータ制約 +- 型`T`がオブジェクト型であること。型`T`が`void*`や関数ポインタであってはならない +- (1) : + - `atomic::is_always_lock_free`が`true`であること + + +## 事前条件 +- `order`は、以下のいずれかであること + - [`memory_order_relaxed`](/reference/atomic/memory_order.md) + - [`memory_order_release`](/reference/atomic/memory_order.md) + - [`memory_order_seq_cst`](/reference/atomic/memory_order.md) + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、現在の値に`operand`を加算した値でアトミックに置き換える + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 備考 +符号付き整数型に対しては、2の補数表現による演算が行われ、未定義動作はない。アドレス型に関しては結果として未定義アドレスになる場合があるが、それ以外の未定義動作はない。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::atomic x(3); + + std::atomic_store_add_explicit(&x, 2, std::memory_order_seq_cst); + + std::cout << x.load() << std::endl; +} +``` +* std::atomic_store_add_explicit[color ff0000] +* x.load()[link /reference/atomic/atomic/load.md] + + +### 出力 +``` +5 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 13 [mark noimpl] + + +## 参照 +- [P3111R8 Atomic Reduction Operations](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3111r8.html) \ No newline at end of file diff --git a/reference/atomic/atomic_store_and.md b/reference/atomic/atomic_store_and.md new file mode 100644 index 0000000000..78dbb55ef0 --- /dev/null +++ b/reference/atomic/atomic_store_and.md @@ -0,0 +1,94 @@ +# atomic_store_and +* atomic[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + void + atomic_store_and( + volatile atomic* object, + typename atomic::difference_type operand) noexcept; // (1) C++26 + + template + constexpr void + atomic_store_and( + atomic* object, + typename atomic::difference_type operand) noexcept; // (2) C++26 +} +``` +* atomic[link /reference/atomic/atomic.md] + + +## 概要 +値を読み込まずにアトミックに値をANDする。 + +この関数は、[`atomic_fetch_and()`](atomic_fetch_and.md)と異なり、現在の (古い) 値を読み込むことなく現在の値に演算を行うため、高速に動作する。ただし変更前の古い値は戻り値として取得できない。 + + +## テンプレートパラメータ制約 +- 型`T`が整数型であること +- (1) : + - `atomic::is_always_lock_free`が`true`であること + + +## 事前条件 +- `order`は、以下のいずれかであること + - [`memory_order_relaxed`](/reference/atomic/memory_order.md) + - [`memory_order_release`](/reference/atomic/memory_order.md) + - [`memory_order_seq_cst`](/reference/atomic/memory_order.md) + + +## 効果 +[`memory_order_seq_cst`](memory_order.md)のメモリオーダーにしたがって、現在の値に`operand`をANDした値でアトミックに置き換える + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 備考 +- 符号付き整数型に対しては、符号なし整数型に変換されたかのようにしたあと演算が行われ、結果は符号付き整数型になる。未定義動作はない + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::atomic x(0b1001); + + std::atomic_store_and(&x, 0b0101); + + std::println("0b{:04b}", x.load()); +} +``` +* std::atomic_store_and[color ff0000] +* x.load()[link /reference/atomic/atomic/load.md] + +### 出力 +``` +0b0001 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 13 [mark noimpl] + + +## 参照 +- [P3111R8 Atomic Reduction Operations](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3111r8.html) \ No newline at end of file diff --git a/reference/atomic/atomic_store_and_explicit.md b/reference/atomic/atomic_store_and_explicit.md new file mode 100644 index 0000000000..5a0099eb48 --- /dev/null +++ b/reference/atomic/atomic_store_and_explicit.md @@ -0,0 +1,96 @@ +# atomic_store_and_explicit +* atomic[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + void + atomic_store_and_explicit( + volatile atomic* object, + typename atomic::difference_type operand, + memory_order order) noexcept; // (1) C++26 + + template + constexpr void + atomic_store_and_explicit( + atomic* object, + typename atomic::difference_type operand, + memory_order order) noexcept; // (2) C++26 +} +``` +* atomic[link atomic.md] +* memory_order[link memory_order.md] + +## 概要 +値を読み込まずにアトミックにANDを行う。 + +この関数は、[`atomic_fetch_and_explicit()`](atomic_fetch_and_explicit.md)と異なり、現在の (古い) 値を読み込むことなく現在の値に演算を行うため、高速に動作する。ただし変更前の古い値は戻り値として取得できない。 + + +## テンプレートパラメータ制約 +- 型`T`が整数型であること +- (1) : + - `atomic::is_always_lock_free`が`true`であること + + +## 事前条件 +- `order`は、以下のいずれかであること + - [`memory_order_relaxed`](/reference/atomic/memory_order.md) + - [`memory_order_release`](/reference/atomic/memory_order.md) + - [`memory_order_seq_cst`](/reference/atomic/memory_order.md) + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、現在の値に`operand`をANDした値でアトミックに置き換える + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 備考 +- 符号付き整数型に対しては、符号なし整数型に変換されたかのようにしたあと演算が行われ、結果は符号付き整数型になる。未定義動作はない + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::atomic x(0b1001); + + std::atomic_store_and_explicit(&x, 0b0101, std::memory_order_seq_cst); + + std::println("0b{:04b}", x.load()); +} +``` +* std::atomic_store_and_explicit[color ff0000] +* x.load()[link /reference/atomic/atomic/load.md] + + +### 出力 +``` +0b0001 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 13 [mark noimpl] + + +## 参照 +- [P3111R8 Atomic Reduction Operations](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3111r8.html) \ No newline at end of file diff --git a/reference/atomic/atomic_store_max.md b/reference/atomic/atomic_store_max.md new file mode 100644 index 0000000000..4b05a6b328 --- /dev/null +++ b/reference/atomic/atomic_store_max.md @@ -0,0 +1,87 @@ +# atomic_store_max +* atomic[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + void + atomic_store_max(volatile atomic* object, + typename atomic::value_type operand) noexcept; // (1) C++26 + + template + constexpr void + atomic_store_max(atomic* object, + typename atomic::value_type operand) noexcept; // (2) C++26 +} +``` +* atomic[link /reference/atomic/atomic.md] + + +## 概要 +値を読み込まずにアトミックに最大値を設定する。 + +この関数は、[`atomic_fetch_max()`](atomic_fetch_max.md)と異なり、現在の (古い) 値を読み込むことなく現在の値に演算を行うため、高速に動作する。ただし変更前の古い値は戻り値として取得できない。 + + +## テンプレートパラメータ制約 +- (1), (2) : 型`T`がオブジェクト型であること。型`T`が`void*`や関数ポインタであってはならない +- (1) : `atomic::is_always_lock_free`が`true`であること + + +## 事前条件 +- `order`は、以下のいずれかであること + - [`memory_order_relaxed`](/reference/atomic/memory_order.md) + - [`memory_order_release`](/reference/atomic/memory_order.md) + - [`memory_order_seq_cst`](/reference/atomic/memory_order.md) + + +## 効果 +[`memory_order_seq_cst`](memory_order.md)のメモリオーダーにしたがって、[`std::max()`](/reference/algorithm/max.md)アルゴリズムのように`*object`が保持する値と`operand`の最大値を求めて、その値でアトミックに置き換える + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::atomic x(3); + + std::atomic_store_max(&x, 2); + + std::cout << x.load() << std::endl; +} +``` +* std::atomic_store_max[color ff0000] +* x.load()[link /reference/atomic/atomic/load.md] + +### 出力 +``` +3 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 13 [mark noimpl] + + +## 参照 +- [P3111R8 Atomic Reduction Operations](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3111r8.html) \ No newline at end of file diff --git a/reference/atomic/atomic_store_max_explicit.md b/reference/atomic/atomic_store_max_explicit.md new file mode 100644 index 0000000000..6c4f9d13f5 --- /dev/null +++ b/reference/atomic/atomic_store_max_explicit.md @@ -0,0 +1,90 @@ +# atomic_store_max_explicit +* atomic[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + void + atomic_store_max_explicit( + volatile atomic* object, + typename atomic::value_type operand, + memory_order order) noexcept; // (1) C++26 + + template + constexpr void + atomic_store_max_explicit( + atomic* object, + typename atomic::value_type operand, + memory_order order) noexcept; // (2) C++26 +} +``` +* atomic[link atomic.md] +* memory_order[link memory_order.md] + +## 概要 +値を読み込まずにアトミックに最大値を設定する。アトミックに最大値を設定する。 + +この関数は、[`atomic_fetch_max_explicit()`](atomic_fetch_max_explicit.md)と異なり、現在の (古い) 値を読み込むことなく現在の値に演算を行うため、高速に動作する。ただし変更前の古い値は戻り値として取得できない。 + + +## テンプレートパラメータ制約 +- (1), (2) : 型`T`がオブジェクト型であること。型`T`が`void*`や関数ポインタであってはならない +- (1) : `atomic::is_always_lock_free`が`true`であること + + +## 事前条件 +- `order`は、以下のいずれかであること + - [`memory_order_relaxed`](/reference/atomic/memory_order.md) + - [`memory_order_release`](/reference/atomic/memory_order.md) + - [`memory_order_seq_cst`](/reference/atomic/memory_order.md) + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、[`std::max()`](/reference/algorithm/max.md)アルゴリズムのように`*object`が保持する値と`operand`の最大値を求め、アトミックにその値で置き換える + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::atomic x(3); + + std::atomic_store_max_explicit(&x, 2, std::memory_order_seq_cst); + std::cout << x.load() << std::endl; +} +``` +* std::atomic_store_max_explicit[color ff0000] +* x.load()[link /reference/atomic/atomic/load.md] + + +### 出力 +``` +3 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 13 [mark noimpl] + + +## 参照 +- [P3111R8 Atomic Reduction Operations](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3111r8.html) \ No newline at end of file diff --git a/reference/atomic/atomic_store_min.md b/reference/atomic/atomic_store_min.md new file mode 100644 index 0000000000..9d1d01fef9 --- /dev/null +++ b/reference/atomic/atomic_store_min.md @@ -0,0 +1,87 @@ +# atomic_store_min +* atomic[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + void + atomic_store_min(volatile atomic* object, + typename atomic::value_type operand) noexcept; // (1) C++26 + + template + constexpr void + atomic_store_min(atomic* object, + typename atomic::value_type operand) noexcept; // (2) C++26 +} +``` +* atomic[link /reference/atomic/atomic.md] + + +## 概要 +値を読み込まずにアトミックに最小値を設定する。 + +この関数は、[`atomic_fetch_min()`](atomic_fetch_min.md)と異なり、現在の (古い) 値を読み込むことなく現在の値に演算を行うため、高速に動作する。ただし変更前の古い値は戻り値として取得できない。 + + +## テンプレートパラメータ制約 +- (1), (2) : 型`T`がオブジェクト型であること。型`T`が`void*`や関数ポインタであってはならない +- (1) : `atomic::is_always_lock_free`が`true`であること + + +## 事前条件 +- `order`は、以下のいずれかであること + - [`memory_order_relaxed`](/reference/atomic/memory_order.md) + - [`memory_order_release`](/reference/atomic/memory_order.md) + - [`memory_order_seq_cst`](/reference/atomic/memory_order.md) + + +## 効果 +[`memory_order_seq_cst`](memory_order.md)のメモリオーダーにしたがって、[`std::min()`](/reference/algorithm/min.md)アルゴリズムのように`*object`が保持する値と`operand`の最小値を求めて、その値でアトミックに置き換える + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::atomic x(3); + + std::atomic_store_min(&x, 2); + + std::cout << x.load() << std::endl; +} +``` +* std::atomic_store_min[color ff0000] +* x.load()[link /reference/atomic/atomic/load.md] + +### 出力 +``` +2 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 13 [mark noimpl] + + +## 参照 +- [P3111R8 Atomic Reduction Operations](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3111r8.html) \ No newline at end of file diff --git a/reference/atomic/atomic_store_min_explicit.md b/reference/atomic/atomic_store_min_explicit.md new file mode 100644 index 0000000000..6f2e11f2f2 --- /dev/null +++ b/reference/atomic/atomic_store_min_explicit.md @@ -0,0 +1,90 @@ +# atomic_store_min_explicit +* atomic[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + void + atomic_store_min_explicit( + volatile atomic* object, + typename atomic::value_type operand, + memory_order order) noexcept; // (1) C++26 + + template + constexpr void + atomic_store_min_explicit( + atomic* object, + typename atomic::value_type operand, + memory_order order) noexcept; // (2) C++26 +} +``` +* atomic[link atomic.md] +* memory_order[link memory_order.md] + +## 概要 +値を読み込まずにアトミックに最小値を設定する。アトミックに最小値を設定する。 + +この関数は、[`atomic_fetch_min_explicit()`](atomic_fetch_min_explicit.md)と異なり、現在の (古い) 値を読み込むことなく現在の値に演算を行うため、高速に動作する。ただし変更前の古い値は戻り値として取得できない。 + + +## テンプレートパラメータ制約 +- (1), (2) : 型`T`がオブジェクト型であること。型`T`が`void*`や関数ポインタであってはならない +- (1) : `atomic::is_always_lock_free`が`true`であること + + +## 事前条件 +- `order`は、以下のいずれかであること + - [`memory_order_relaxed`](/reference/atomic/memory_order.md) + - [`memory_order_release`](/reference/atomic/memory_order.md) + - [`memory_order_seq_cst`](/reference/atomic/memory_order.md) + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、[`std::min()`](/reference/algorithm/min.md)アルゴリズムのように`*object`が保持する値と`operand`の最小値を求め、アトミックにその値で置き換える + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::atomic x(3); + + std::atomic_store_min_explicit(&x, 2, std::memory_order_seq_cst); + std::cout << x.load() << std::endl; +} +``` +* std::atomic_store_min_explicit[color ff0000] +* x.load()[link /reference/atomic/atomic/load.md] + + +### 出力 +``` +2 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 13 [mark noimpl] + + +## 参照 +- [P3111R8 Atomic Reduction Operations](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3111r8.html) \ No newline at end of file diff --git a/reference/atomic/atomic_store_or.md b/reference/atomic/atomic_store_or.md new file mode 100644 index 0000000000..44de359f86 --- /dev/null +++ b/reference/atomic/atomic_store_or.md @@ -0,0 +1,94 @@ +# atomic_store_or +* atomic[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + void + atomic_store_or( + volatile atomic* object, + typename atomic::difference_type operand) noexcept; // (1) C++26 + + template + constexpr void + atomic_store_or( + atomic* object, + typename atomic::difference_type operand) noexcept; // (2) C++26 +} +``` +* atomic[link /reference/atomic/atomic.md] + + +## 概要 +値を読み込まずにアトミックに値をORする。 + +この関数は、[`atomic_fetch_or()`](atomic_fetch_or.md)と異なり、現在の (古い) 値を読み込むことなく現在の値に演算を行うため、高速に動作する。ただし変更前の古い値は戻り値として取得できない。 + + +## テンプレートパラメータ制約 +- 型`T`が整数型であること +- (1) : + - `atomic::is_always_lock_free`が`true`であること + + +## 事前条件 +- `order`は、以下のいずれかであること + - [`memory_order_relaxed`](/reference/atomic/memory_order.md) + - [`memory_order_release`](/reference/atomic/memory_order.md) + - [`memory_order_seq_cst`](/reference/atomic/memory_order.md) + + +## 効果 +[`memory_order_seq_cst`](memory_order.md)のメモリオーダーにしたがって、現在の値に`operand`をORした値でアトミックに置き換える + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 備考 +- 符号付き整数型に対しては、符号なし整数型に変換されたかのようにしたあと演算が行われ、結果は符号付き整数型になる。未定義動作はない + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::atomic x(0b1001); + + std::atomic_store_or(&x, 0b0101); + + std::println("0b{:04b}", x.load()); +} +``` +* std::atomic_store_or[color ff0000] +* x.load()[link /reference/atomic/atomic/load.md] + +### 出力 +``` +0b0101 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 13 [mark noimpl] + + +## 参照 +- [P3111R8 Atomic Reduction Operations](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3111r8.html) \ No newline at end of file diff --git a/reference/atomic/atomic_store_or_explicit.md b/reference/atomic/atomic_store_or_explicit.md new file mode 100644 index 0000000000..613cd45ede --- /dev/null +++ b/reference/atomic/atomic_store_or_explicit.md @@ -0,0 +1,96 @@ +# atomic_store_or_explicit +* atomic[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + void + atomic_store_or_explicit( + volatile atomic* object, + typename atomic::difference_type operand, + memory_order order) noexcept; // (1) C++26 + + template + constexpr void + atomic_store_or_explicit( + atomic* object, + typename atomic::difference_type operand, + memory_order order) noexcept; // (2) C++26 +} +``` +* atomic[link atomic.md] +* memory_order[link memory_order.md] + +## 概要 +値を読み込まずにアトミックにORを行う。 + +この関数は、[`atomic_fetch_or_explicit()`](atomic_fetch_or_explicit.md)と異なり、現在の (古い) 値を読み込むことなく現在の値に演算を行うため、高速に動作する。ただし変更前の古い値は戻り値として取得できない。 + + +## テンプレートパラメータ制約 +- 型`T`が整数型であること +- (1) : + - `atomic::is_always_lock_free`が`true`であること + + +## 事前条件 +- `order`は、以下のいずれかであること + - [`memory_order_relaxed`](/reference/atomic/memory_order.md) + - [`memory_order_release`](/reference/atomic/memory_order.md) + - [`memory_order_seq_cst`](/reference/atomic/memory_order.md) + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、現在の値に`operand`をORした値でアトミックに置き換える + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 備考 +- 符号付き整数型に対しては、符号なし整数型に変換されたかのようにしたあと演算が行われ、結果は符号付き整数型になる。未定義動作はない + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::atomic x(0b1001); + + std::atomic_store_or_explicit(&x, 0b0101, std::memory_order_seq_cst); + + std::println("0b{:04b}", x.load()); +} +``` +* std::atomic_store_or_explicit[color ff0000] +* x.load()[link /reference/atomic/atomic/load.md] + + +### 出力 +``` +0b1101 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 13 [mark noimpl] + + +## 参照 +- [P3111R8 Atomic Reduction Operations](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3111r8.html) \ No newline at end of file diff --git a/reference/atomic/atomic_store_sub.md b/reference/atomic/atomic_store_sub.md new file mode 100644 index 0000000000..86cb0082c8 --- /dev/null +++ b/reference/atomic/atomic_store_sub.md @@ -0,0 +1,94 @@ +# atomic_store_sub +* atomic[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + void + atomic_store_sub( + volatile atomic* object, + typename atomic::difference_type operand) noexcept; // (1) C++26 + + template + constexpr void + atomic_store_sub( + atomic* object, + typename atomic::difference_type operand) noexcept; // (2) C++26 +} +``` +* atomic[link /reference/atomic/atomic.md] + + +## 概要 +値を読み込まずにアトミックに値を減算する。 + +この関数は、[`atomic_fetch_sub()`](atomic_fetch_sub.md)と異なり、現在の (古い) 値を読み込むことなく現在の値に演算を行うため、高速に動作する。ただし変更前の古い値は戻り値として取得できない。 + + +## テンプレートパラメータ制約 +- 型`T`がオブジェクト型であること。型`T`が`void*`や関数ポインタであってはならない +- (1) : + - `atomic::is_always_lock_free`が`true`であること + + +## 事前条件 +- `order`は、以下のいずれかであること + - [`memory_order_relaxed`](/reference/atomic/memory_order.md) + - [`memory_order_release`](/reference/atomic/memory_order.md) + - [`memory_order_seq_cst`](/reference/atomic/memory_order.md) + + +## 効果 +[`memory_order_seq_cst`](memory_order.md)のメモリオーダーにしたがって、現在の値に`operand`を減算した値でアトミックに置き換える + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 備考 +符号付き整数型に対しては、2の補数表現による演算が行われ、未定義動作はない。アドレス型に関しては結果として未定義アドレスになる場合があるが、それ以外の未定義動作はない。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::atomic x(3); + + std::atomic_store_sub(&x, 2); + + std::cout << x.load() << std::endl; +} +``` +* std::atomic_store_sub[color ff0000] +* x.load()[link /reference/atomic/atomic/load.md] + +### 出力 +``` +1 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 13 [mark noimpl] + + +## 参照 +- [P3111R8 Atomic Reduction Operations](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3111r8.html) \ No newline at end of file diff --git a/reference/atomic/atomic_store_sub_explicit.md b/reference/atomic/atomic_store_sub_explicit.md new file mode 100644 index 0000000000..1be669f1d1 --- /dev/null +++ b/reference/atomic/atomic_store_sub_explicit.md @@ -0,0 +1,96 @@ +# atomic_store_sub_explicit +* atomic[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + void + atomic_store_sub_explicit( + volatile atomic* object, + typename atomic::difference_type operand, + memory_order order) noexcept; // (1) C++26 + + template + constexpr void + atomic_store_sub_explicit( + atomic* object, + typename atomic::difference_type operand, + memory_order order) noexcept; // (2) C++26 +} +``` +* atomic[link atomic.md] +* memory_order[link memory_order.md] + +## 概要 +値を読み込まずにアトミックに減算を行う。 + +この関数は、[`atomic_fetch_sub_explicit()`](atomic_fetch_sub_explicit.md)と異なり、現在の (古い) 値を読み込むことなく現在の値に演算を行うため、高速に動作する。ただし変更前の古い値は戻り値として取得できない。 + + +## テンプレートパラメータ制約 +- 型`T`がオブジェクト型であること。型`T`が`void*`や関数ポインタであってはならない +- (1) : + - `atomic::is_always_lock_free`が`true`であること + + +## 事前条件 +- `order`は、以下のいずれかであること + - [`memory_order_relaxed`](/reference/atomic/memory_order.md) + - [`memory_order_release`](/reference/atomic/memory_order.md) + - [`memory_order_seq_cst`](/reference/atomic/memory_order.md) + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、現在の値に`operand`を減算した値でアトミックに置き換える + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 備考 +符号付き整数型に対しては、2の補数表現による演算が行われ、未定義動作はない。アドレス型に関しては結果として未定義アドレスになる場合があるが、それ以外の未定義動作はない。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::atomic x(3); + + std::atomic_store_sub_explicit(&x, 2, std::memory_order_seq_cst); + + std::cout << x.load() << std::endl; +} +``` +* std::atomic_store_sub_explicit[color ff0000] +* x.load()[link /reference/atomic/atomic/load.md] + + +### 出力 +``` +1 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 13 [mark noimpl] + + +## 参照 +- [P3111R8 Atomic Reduction Operations](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3111r8.html) \ No newline at end of file diff --git a/reference/atomic/atomic_store_xor.md b/reference/atomic/atomic_store_xor.md new file mode 100644 index 0000000000..2f92a37a63 --- /dev/null +++ b/reference/atomic/atomic_store_xor.md @@ -0,0 +1,94 @@ +# atomic_store_xor +* atomic[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + void + atomic_store_xor( + volatile atomic* object, + typename atomic::difference_type operand) noexcept; // (1) C++26 + + template + constexpr void + atomic_store_xor( + atomic* object, + typename atomic::difference_type operand) noexcept; // (2) C++26 +} +``` +* atomic[link /reference/atomic/atomic.md] + + +## 概要 +値を読み込まずにアトミックに値をXORする。 + +この関数は、[`atomic_fetch_xor()`](atomic_fetch_xor.md)と異なり、現在の (古い) 値を読み込むことなく現在の値に演算を行うため、高速に動作する。ただし変更前の古い値は戻り値として取得できない。 + + +## テンプレートパラメータ制約 +- 型`T`が整数型であること +- (1) : + - `atomic::is_always_lock_free`が`true`であること + + +## 事前条件 +- `order`は、以下のいずれかであること + - [`memory_order_relaxed`](/reference/atomic/memory_order.md) + - [`memory_order_release`](/reference/atomic/memory_order.md) + - [`memory_order_seq_cst`](/reference/atomic/memory_order.md) + + +## 効果 +[`memory_order_seq_cst`](memory_order.md)のメモリオーダーにしたがって、現在の値に`operand`をXORした値でアトミックに置き換える + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 備考 +- 符号付き整数型に対しては、符号なし整数型に変換されたかのようにしたあと演算が行われ、結果は符号付き整数型になる。未定義動作はない + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::atomic x(0b1001); + + std::atomic_store_xor(&x, 0b0101); + + std::println("0b{:04b}", x.load()); +} +``` +* std::atomic_store_xor[color ff0000] +* x.load()[link /reference/atomic/atomic/load.md] + +### 出力 +``` +0b1100 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 13 [mark noimpl] + + +## 参照 +- [P3111R8 Atomic Reduction Operations](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3111r8.html) \ No newline at end of file diff --git a/reference/atomic/atomic_store_xor_explicit.md b/reference/atomic/atomic_store_xor_explicit.md new file mode 100644 index 0000000000..5a0099eb48 --- /dev/null +++ b/reference/atomic/atomic_store_xor_explicit.md @@ -0,0 +1,96 @@ +# atomic_store_and_explicit +* atomic[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + void + atomic_store_and_explicit( + volatile atomic* object, + typename atomic::difference_type operand, + memory_order order) noexcept; // (1) C++26 + + template + constexpr void + atomic_store_and_explicit( + atomic* object, + typename atomic::difference_type operand, + memory_order order) noexcept; // (2) C++26 +} +``` +* atomic[link atomic.md] +* memory_order[link memory_order.md] + +## 概要 +値を読み込まずにアトミックにANDを行う。 + +この関数は、[`atomic_fetch_and_explicit()`](atomic_fetch_and_explicit.md)と異なり、現在の (古い) 値を読み込むことなく現在の値に演算を行うため、高速に動作する。ただし変更前の古い値は戻り値として取得できない。 + + +## テンプレートパラメータ制約 +- 型`T`が整数型であること +- (1) : + - `atomic::is_always_lock_free`が`true`であること + + +## 事前条件 +- `order`は、以下のいずれかであること + - [`memory_order_relaxed`](/reference/atomic/memory_order.md) + - [`memory_order_release`](/reference/atomic/memory_order.md) + - [`memory_order_seq_cst`](/reference/atomic/memory_order.md) + + +## 効果 +`order`で指定されたメモリオーダーにしたがって、現在の値に`operand`をANDした値でアトミックに置き換える + + +## 戻り値 +なし + + +## 例外 +投げない + + +## 備考 +- 符号付き整数型に対しては、符号なし整数型に変換されたかのようにしたあと演算が行われ、結果は符号付き整数型になる。未定義動作はない + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::atomic x(0b1001); + + std::atomic_store_and_explicit(&x, 0b0101, std::memory_order_seq_cst); + + std::println("0b{:04b}", x.load()); +} +``` +* std::atomic_store_and_explicit[color ff0000] +* x.load()[link /reference/atomic/atomic/load.md] + + +### 出力 +``` +0b0001 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 13 [mark noimpl] + + +## 参照 +- [P3111R8 Atomic Reduction Operations](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3111r8.html) \ No newline at end of file From 3c1eba532a8d1260a39626c01b69986796b17d70 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sat, 11 Oct 2025 12:33:07 +0900 Subject: [PATCH 2408/3948] fix typo in spanstream --- reference/spanstream/basic_spanstream.md | 2 +- reference/spanstream/basic_spanstream/op_constructor.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/spanstream/basic_spanstream.md b/reference/spanstream/basic_spanstream.md index 745e17a617..82b2a65488 100644 --- a/reference/spanstream/basic_spanstream.md +++ b/reference/spanstream/basic_spanstream.md @@ -97,7 +97,7 @@ int main() ``` Hello 123 World 45.67 -word1=Hello, num1=123, word3=World, num2=45.67 +word1="Hello", num1=123, word2="World", num2=45.67 ``` diff --git a/reference/spanstream/basic_spanstream/op_constructor.md b/reference/spanstream/basic_spanstream/op_constructor.md index 5d92317c00..e404538423 100644 --- a/reference/spanstream/basic_spanstream/op_constructor.md +++ b/reference/spanstream/basic_spanstream/op_constructor.md @@ -21,7 +21,7 @@ basic_spanstream(basic_spanstream&& rhs); // (3) ここで、初期値としてデータは、既存のファイルを上書きモードで開くことに似ており、ストリームの初期位置が先頭のまま、ストリーム内容の文字列を設定するものである。 -- (1) : 初期データとして[`std::span`](/reference/span/span.md)オブジェクトの設定して構築する +- (1) : 初期データとして[`std::span`](/reference/span/span.md)オブジェクトを指定して構築する - (2) : (削除)コピーコンストラクタ - (3) : ムーブコンストラクタ From 19dfdd71aa4a4804d2622963f30d6b58feda0e2b Mon Sep 17 00:00:00 2001 From: yoh Date: Sat, 11 Oct 2025 23:55:28 +0900 Subject: [PATCH 2409/3948] execution: P3149R11 spawn_future(#1510) --- reference/execution/execution.md | 2 +- .../counting_scope/token/disassociate.md | 2 +- .../counting_scope/token/try_associate.md | 2 +- .../execution/counting_scope/token/wrap.md | 2 +- reference/execution/execution/scope_token.md | 2 +- .../token/disassociate.md | 2 +- .../token/try_associate.md | 2 +- .../simple_counting_scope/token/wrap.md | 2 +- reference/execution/execution/spawn.md | 17 +- reference/execution/execution/spawn_future.md | 358 ++++++++++++++++++ reference/execution/execution/stop-when.md | 2 +- 11 files changed, 374 insertions(+), 19 deletions(-) create mode 100644 reference/execution/execution/spawn_future.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index c4c0adc763..4c1346b447 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -132,7 +132,7 @@ namespace std::execution { | [`execution::stopped_as_optional`](execution/stopped_as_optional.md) | 入力Senderの停止完了を空の[`optional`](/reference/optional/optional.md)値完了に変換 (customization point object) | C++26 | | [`execution::stopped_as_error`](execution/stopped_as_error.md) | 入力Senderの停止完了をエラー完了に変換 (customization point object) | C++26 | | [`execution::associate`](execution/associate.md) | 非同期スコープへの関連付け (customization point object) | C++26 | -| [`execution::spawn_future`](execution/spawn_future.md.nolink) | 非同期操作を早期開始 (customization point object) | C++26 | +| [`execution::spawn_future`](execution/spawn_future.md) | 非同期操作を早期開始 (customization point object) | C++26 | ### Senderコンシューマ diff --git a/reference/execution/execution/counting_scope/token/disassociate.md b/reference/execution/execution/counting_scope/token/disassociate.md index 8ebf594ea6..47f9b12a8c 100644 --- a/reference/execution/execution/counting_scope/token/disassociate.md +++ b/reference/execution/execution/counting_scope/token/disassociate.md @@ -39,7 +39,7 @@ scope->disassociate() ## 関連項目 - [`execution::associate`](../../associate.md) -- [`execution::spawn_future`](../../spawn_future.md.nolink) +- [`execution::spawn_future`](../../spawn_future.md) - [`execution::spawn`](../../spawn.md) diff --git a/reference/execution/execution/counting_scope/token/try_associate.md b/reference/execution/execution/counting_scope/token/try_associate.md index de9c2fd6c5..d57181cc08 100644 --- a/reference/execution/execution/counting_scope/token/try_associate.md +++ b/reference/execution/execution/counting_scope/token/try_associate.md @@ -39,7 +39,7 @@ return scope->try-associate(); ## 関連項目 - [`execution::associate`](../../associate.md) -- [`execution::spawn_future`](../../spawn_future.md.nolink) +- [`execution::spawn_future`](../../spawn_future.md) - [`execution::spawn`](../../spawn.md) diff --git a/reference/execution/execution/counting_scope/token/wrap.md b/reference/execution/execution/counting_scope/token/wrap.md index e69eef0d29..fee4f39019 100644 --- a/reference/execution/execution/counting_scope/token/wrap.md +++ b/reference/execution/execution/counting_scope/token/wrap.md @@ -40,7 +40,7 @@ return stop-when(std::forward(snd), scope->s_source.get_token()); ## 関連項目 - [`execution::associate`](../../associate.md) -- [`execution::spawn_future`](../../spawn_future.md.nolink) +- [`execution::spawn_future`](../../spawn_future.md) - [`execution::spawn`](../../spawn.md) diff --git a/reference/execution/execution/scope_token.md b/reference/execution/execution/scope_token.md index 5aca3cc402..1a47563f37 100644 --- a/reference/execution/execution/scope_token.md +++ b/reference/execution/execution/scope_token.md @@ -70,7 +70,7 @@ int main() ## 関連項目 - [`execution::associate`](associate.md) -- [`execution::spawn_future`](spawn_future.md.nolink) +- [`execution::spawn_future`](spawn_future.md) - [`execution::spawn`](spawn.md) diff --git a/reference/execution/execution/simple_counting_scope/token/disassociate.md b/reference/execution/execution/simple_counting_scope/token/disassociate.md index 9943b78825..e91a100c78 100644 --- a/reference/execution/execution/simple_counting_scope/token/disassociate.md +++ b/reference/execution/execution/simple_counting_scope/token/disassociate.md @@ -39,7 +39,7 @@ scope->disassociate() ## 関連項目 - [`execution::associate`](../../associate.md) -- [`execution::spawn_future`](../../spawn_future.md.nolink) +- [`execution::spawn_future`](../../spawn_future.md) - [`execution::spawn`](../../spawn.md) diff --git a/reference/execution/execution/simple_counting_scope/token/try_associate.md b/reference/execution/execution/simple_counting_scope/token/try_associate.md index 43631ed3d6..492633f611 100644 --- a/reference/execution/execution/simple_counting_scope/token/try_associate.md +++ b/reference/execution/execution/simple_counting_scope/token/try_associate.md @@ -39,7 +39,7 @@ return scope->try-associate(); ## 関連項目 - [`execution::associate`](../../associate.md) -- [`execution::spawn_future`](../../spawn_future.md.nolink) +- [`execution::spawn_future`](../../spawn_future.md) - [`execution::spawn`](../../spawn.md) diff --git a/reference/execution/execution/simple_counting_scope/token/wrap.md b/reference/execution/execution/simple_counting_scope/token/wrap.md index e29f111188..16b4d5053c 100644 --- a/reference/execution/execution/simple_counting_scope/token/wrap.md +++ b/reference/execution/execution/simple_counting_scope/token/wrap.md @@ -36,7 +36,7 @@ Sender&& wrap(Sender&& snd) const noexcept; ## 関連項目 - [`execution::associate`](../../associate.md) -- [`execution::spawn_future`](../../spawn_future.md.nolink) +- [`execution::spawn_future`](../../spawn_future.md) - [`execution::spawn`](../../spawn.md) diff --git a/reference/execution/execution/spawn.md b/reference/execution/execution/spawn.md index 4cba44ec75..51bc762ba6 100644 --- a/reference/execution/execution/spawn.md +++ b/reference/execution/execution/spawn.md @@ -17,7 +17,7 @@ namespace std::execution { ## 効果 -説明用の式`sndr`, `token`, `env`に対して、下記の通り定義する。 +説明用の式`sndr`, `token`, `env`を下記の通り定義する。 - `Sndr`型を`decltype((sndr))`、 - `Token`型を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``、 @@ -33,14 +33,13 @@ namespace std::execution { 呼び出し式`spawn(sndr, token, env)`は`void`型であり、次の効果をもつ。 -- `alloc`を用いてメモリ確保し、`alloc`, [`write_env`](write_env.md)`(token.wrap(sndr), senv)`, `token`から特殊化された`spawn-state`型のオブジェクト`o`を構築し、`o.run()`を呼び出す。何らかのオブジェクト構築・破棄時に例外送出されたときは、確保されたメモリが解放される。 +- `alloc`を用いてメモリ確保し、`alloc`, [`write_env`](write_env.md)`(token.wrap(sndr), senv)`, `token`から特殊化された`spawn-state`型のオブジェクト`o`を構築し、`o.run()`を呼び出す。いずれかのオブジェクト構築・破棄時に例外送出されたときは、確保されたメモリが解放される。 -式`spawn(sndr, token)`は、式`spawn(sndr, token,` [`execution::env<>`](env.md)`())`と等価である。 +呼び出し式`spawn(sndr, token)`は、式`spawn(sndr, token,` [`execution::env<>`](env.md)`())`と等価である。 ## 説明専用エンティティ -説明専用のクラス`spawn-state-base`を下記の通り定義する。 - +### クラス`spawn-state-base` ```cpp namespace std::execution { struct spawn-state-base { // exposition only @@ -49,8 +48,7 @@ namespace std::execution { } ``` -説明専用のクラス`spawn-receiver`を下記の通り定義する。 - +### クラス`spawn-receiver` ```cpp namespace std::execution { struct spawn-receiver { // exposition only @@ -65,8 +63,7 @@ namespace std::execution { * receiver_t[link receiver.md] * spawn-state-base[italic] -説明専用のクラステンプレート`spawn-state`を下記の通り定義する。 - +### クラステンプレート`spawn-state` ```cpp namespace std::execution { template @@ -213,7 +210,7 @@ sync_wait ## 関連項目 - [`execution::scope_token`](scope_token.md) -- [`execution::spawn_future`](spawn_future.md.nolink) +- [`execution::spawn_future`](spawn_future.md) ## 参照 diff --git a/reference/execution/execution/spawn_future.md b/reference/execution/execution/spawn_future.md new file mode 100644 index 0000000000..43d4e9c515 --- /dev/null +++ b/reference/execution/execution/spawn_future.md @@ -0,0 +1,358 @@ +# spawn_future +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct spawn_future_t { unspecified }; + inline constexpr spawn_future_t spawn_future{}; +} +``` +* unspecified[italic] + +## 概要 +`spawn_future`は、入力[Sender](sender.md)に対して[非同期トークンスコープ](scope_token.md)への関連付けを試み、成功時に入力Senderを早期開始(eagerly start)させるSenderアダプタである。 + +戻り値Senderの[接続(connect)](connect.md)および[開始(start)](start.md)により、早期開始した入力Senderの戻り値を用いて値完了、もしくは入力Senderが開始していなければ[`set_stopped`](set_stopped.md)で完了する。 + + +## 効果 +説明用の式`sndr`, `token`, `env`を下記の通り定義する。 + +- `Sndr`型を`decltype((sndr))`、 +- `Token`型を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``、 +- `Env`型を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``とする。 + +[`sender`](sender.md)``, [`scope_token`](scope_token.md)``, [`queryable`](../queryable.md)``のいずれかを満たさないとき、呼び出し式`spawn_future(sndr, token, env)`は不適格となる。 + +そうでなければ、呼び出し式`spawn_future(sndr, token, env)`に対して、説明用の式`new_sender`を[`token.wrap`](scope_token.md)`(sndr)`とし、`alloc`と`senv`を次の通りとする。 + +- 式[`get_allocator`](../get_allocator.md)`(env)`が適格なとき、`alloc`を[`get_allocator`](../get_allocator.md)`(env)`の結果、`senv`を式`env`とする。 +- そうでなはく、式[`get_allocator`](../get_allocator.md)`(`[`get_env`](get_env.md)`(new_sender))`が適格なとき、`alloc`を[`get_allocator`](../get_allocator.md)`(`[`get_env`](get_env.md)`(new_sender))`の結果、`senv`を式[`JOIN-ENV`](../queryable.md)`(`[`prop`](prop.md)`(`[`get_allocator`](../get_allocator.md)`, alloc), env)`とする。 +- そうではないとき、`alloc`を[`allocator`](/reference/memory/allocator.md)`()`、`senv`を式`env`とする。 + +呼び出し式`spawn_future(sndr, token, env)`は、次の効果をもつ。 + +- `alloc`を用いてメモリ確保し、`alloc`, `token.wrap(sndr)`, `token`, `senv`から特殊化された`spawn-future-state`型のオブジェクト`s`を構築する。いずれかのオブジェクト構築・破棄時に例外送出されたときは、確保されたメモリが解放される。 +- 下記を満たす[`unique_ptr`](/reference/memory/unique_ptr.md)の特殊化型のオブジェクト`u`を構築する。 + - `u.`[`get()`](/reference/memory/unique_ptr/get.md)は`s`のアドレスに等しく、かつ + - `u.`[`get_deleter()`](/reference/memory/unique_ptr/get_deleter.md)`(u.`[`release()`](/reference/memory/unique_ptr/release.md)`)`は`u.release()->abandon()`に等しい。 +- [`make-sender`](make-sender.md)`(spawn_future,` [`std::move`](/reference/utility/move.md)`(u))`を返す。 + +呼び出し式`spawn_future(sndr, token)`は、式`spawn_future(sndr, token,` [`execution::env<>`](env.md)`())`と等価である。 + + +### Senderアルゴリズムタグ `spawn_future` +Senderアルゴリズム動作説明用のクラステンプレート[`impls-for`](impls-for.md)に対して、下記の特殊化が定義される。 + +```cpp +namespace std::execution { + template<> + struct impls-for : default-impls { + static constexpr auto start = see below; // exposition only + }; +} +``` +* impls-for[link impls-for.md] +* default-impls[link impls-for.md] + +`impls-for::start`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 + +```cpp +[](auto& state, auto& rcvr) noexcept -> void { + state->consume(rcvr); +} +``` + + +## 説明専用エンティティ +### クラステンプレート`spawn-future-state-base` +```cpp +namespace std::execution { + template + struct spawn-future-state-base; // exposition only + + template + struct spawn-future-state-base> { // exposition only + using variant-t = see below; // exposition only + variant-t result; // exposition only + virtual void complete() noexcept = 0; // exposition only + }; +} +``` +* completion_signatures[link completion_signatures.md] + +説明用のパック`Sigs`を、クラステンプレート`spawn-future-state-base`のパラメータに指定する[`completion_signatures`](completion_signatures.md)特殊化の引数パックと定義する。説明用のエイリアステンプレート`as-tuple`を[`decayed-tuple`](decayed-tuple.md)``と定義する。 + +- `Sigs`に含まれる全ての完了シグニチャ`Tag(Args...)`における全てのパラメータパック`Args`の全ての型`Any`に対して[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)`<`[`decay_t`](/reference/type_traits/decay.md)`, Arg> == true`のとき、エイリアス`variant-t`は[`variant`](/reference/variant/variant.md)`<`[`monostate`](/reference/variant/monostate.md)`,` [`tuple`](/reference/tuple/tuple.md)`<`[`set_stopped_t`](set_stopped.md)`>, as-tuple...>`において重複削除した型となる。 +- そうではないとき、エイリアス`variant-t`は[`variant`](/reference/variant/variant.md)`<`[`monostate`](/reference/variant/monostate.md)`,` [`tuple`](/reference/tuple/tuple.md)`<`[`set_stopped_t`](set_stopped.md)`>, tuple<`[`set_error_t`](set_error.md)`,` [`exception_ptr`](/reference/exception/exception_ptr.md)`>, as-tuple...>`において重複削除した型となる。 + +### クラステンプレート`spawn-future-receiver` +```cpp +namespace std::execution { + template + struct spawn-future-receiver { // exposition only + using receiver_concept = receiver_t; + + spawn-future-state-base* state; // exposition only + + template + void set_value(T&&... t) && noexcept { + set-complete(std::forward(t)...); + } + + template + void set_error(E&& e) && noexcept { + set-complete(std::forward(e)); + } + + void set_stopped() && noexcept { + set-complete(); + } + + private: + template + void set-complete(T&&... t) noexcept { // exposition only + constexpr bool nothrow = (is_nothrow_constructible_v, T> && ...); + try { + state->result.template emplace>(CPO{}, + std::forward(t)...); + } + catch (...) { + if constexpr (!nothrow) { + using tuple_t = decayed-tuple; + state->result.template emplace(set_error_t{}, current_exception()); + } + } + state->complete(); + } + }; +} +``` +* receiver_t[link receiver.md] +* set_value_t[link set_value.md] +* set_error_t[link set_error.md] +* set_stopped_t[link set_stopped.md] +* decayed-tuple[link decayed-tuple.md] +* is_nothrow_constructible_v[link /reference/type_traits/is_nothrow_constructible.md] +* template emplace[link /reference/variant/variant/emplace.md] +* exception_ptr[link /reference/exception/exception_ptr.md] +* current_exception()[link /reference/exception/current_exception.md] + +型`ssource-t`を[`stoppabe-source`](/reference/stop_token/stoppable-source.md)のモデルである未規定の型、`ssource`を型`ssource-t`の左辺値とする。 +型`stoken-t`を`decltype(ssource.get_token())`とする。 + +### エイリアステンプレート `future-spawned-sender` + +```cpp +template +using future-spawned-sender = // exposition only + decltype(write_env(stop-when(declval(), declval()), declval())); +``` +* write_env[link write_env.md] +* stop-when[link stop-when.md] + +### クラステンプレート`spawn-future-state` + +```cpp +namespace std::execution { + template + struct spawn-future-state // exposition only + : spawn-future-state-base>> { + using sigs-t = // exposition only + completion_signatures_of_t>; + using receiver-t = // exposition only + spawn-future-receiver; + using op-t = // exposition only + connect_result_t, receiver-t>; + + spawn-future-state(Alloc alloc, Sender&& sndr, Token token, Env env) // exposition only + : alloc(std::move(alloc)), + op(connect( + write_env(stop-when(std::forward(sndr), ssource.get_token()), std::move(env)), + receiver-t(this))), + token(std::move(token)), + associated(token.try_associate()) { + if (associated) + start(op); + else + set_stopped(receiver-t(this)); + } + + void complete() noexcept override; // exposition only + void consume(receiver auto& rcvr) noexcept; // exposition only + void abandon() noexcept; // exposition only + + private: + using alloc-t = // exposition only + typename allocator_traits::template rebind_alloc; + + alloc-t alloc; // exposition only + ssource-t ssource; // exposition only + op-t op; // exposition only + Token token; // exposition only + bool associated; // exposition only + + void destroy() noexcept; // exposition only + }; +} +``` +* completion_signatures_of_t[link completion_signatures_of_t.md] +* connect_result_t[link connect_result_t.md] +* connect[link connect.md] +* write_env[link write_env.md] +* stop-when[link stop-when.md] +* start[link start.md] +* set_stopped[link set_stopped.md] +* allocator_traits[link /reference/memory/allocator_traits.md] +* std::move[link /reference/utility/move.md] + +データ競合の存在を判定する目的において、`complete`, `consume`, `abandon`はアトミック操作として振る舞う。 +`spawn-future-state`の特殊化である型の単一オブジェクトに対するこれらの操作は、単一の全順序で発生するように見える。 + +```cpp +void complete() noexcept; +``` + +- 効果 : + - `*this`に対するこの`complete`の呼び出しが`consume`もしくは`abandon`の呼び出しよりも前に発生するならば、効果を持たない。 + - そうではなく、`*this`に対する`consume`の呼び出しがこの`complete`の呼び出しよりも前に発生するならば、[Receiver](receiver.md)`rcvr`が登録され、そのReceiverは`consume(rcvr)`によって完了する。 + - そうではないとき、`destroy`が呼び出される。 + +```cpp +void consume(receiver auto& rcvr) noexcept; +``` +* receiver[link receiver.md] + +- 効果 : + - `*this`に対するこの`consume`の呼び出しが`complete`の呼び出しよりも前に発生するならば、`*this`に対してその後`complete`が呼び出されるとき`rcvr`が完了するよう登録される。 + - そうではないとき、下記のように`rcvr`が完了する : + + ```cpp + std::move(this->result).visit( + [&rcvr](auto&& tuple) noexcept { + if constexpr (!same_as, monostate>) { + apply([&rcvr](auto cpo, auto&&... vals) { + cpo(std::move(rcvr), std::move(vals)...); + }, std::move(tuple)); + } + }); + ``` + * visit[link /reference/variant/visit.md] + * monostate[link /reference/variant/monostate.md] + * apply[link /reference/tuple/apply.md] + * std::move[link /reference/utility/move.md] + +```cpp +void abandon() noexcept; +``` + +- 効果 : + - `*this`に対するこの`abandon`の呼び出しが`complete`の呼び出しより前に発生するならば、下記と等価。 + + ```cpp + ssource.request_stop(); + ``` + + - そうでなければ、`destroy`が呼び出される。 + +```cpp +void destroy() noexcept; +``` + +- 効果 : 下記と等価。 + + ```cpp + auto token = std::move(this->token); + bool associated = this->associated; + + { + auto alloc = std::move(this->alloc); + + allocator_traits::destroy(alloc, this); + allocator_traits::deallocate(alloc, this, 1); + } + + if (associated) + token.disassociate(); + ``` + * allocator_traits[link /reference/memory/allocator_traits.md] + * destroy[link /reference/memory/allocator_traits/destroy.md] + * deallocate[link /reference/memory/allocator_traits/deallocate.md] + * std::move[link /reference/utility/move.md] + + +## 例 +```cpp example +#include +#include +namespace ex = std::execution; + +int main() +{ + // システムスレッドプール上の実行タスクを定義 + ex::scheduler auto sch = ex::get_parallel_scheduler(); + ex::sender auto snd0 = + ex::schedule(sch) + | ex::then([]{ + // ワーカースレッド処理 + std::println("hello async"); + return 42; + }); + + // 非同期スコープを定義 + ex::counting_scope scope; + + // タスクを早期開始させる + std::println("spawn"); + ex::sender auto snd1 = ex::spawn_future(std::move(snd0), scope.get_token()); + + // (メインスレッド処理) + + // 非同期スコープを合流 + auto result = std::this_thread::sync_wait(ex::when_all(std::move(snd1), scope.join())); + auto [value] = *result; + std::println("value={}", value); +} +``` +* ex::spawn_future[color ff0000] +* ex::scheduler[link scheduler.md] +* ex::get_parallel_scheduler()[link get_parallel_scheduler.md] +* ex::sender[link sender.md] +* ex::schedule[link schedule.md] +* ex::then[link then.md] +* ex::counting_scope[link counting_scope.md] +* get_token()[link counting_scope/get_token.md] +* join()[link counting_scope/join.md] +* ex::when_all[link when_all.md] +* std::this_thread::sync_wait[link ../this_thread/sync_wait.md] +* std::move[link /reference/utility/move.md] + +### 出力 +``` +spawn +hello async +value=42 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::scope_token`](scope_token.md) +- [`execution::spawn`](spawn.md) + + +## 参照 +- [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) diff --git a/reference/execution/execution/stop-when.md b/reference/execution/execution/stop-when.md index 15505771c9..f1dcc62b24 100644 --- a/reference/execution/execution/stop-when.md +++ b/reference/execution/execution/stop-when.md @@ -33,7 +33,7 @@ namespace std::execution { ## 関連項目 -- [`execution::spawn_future`](spawn_future.md.nolink) +- [`execution::spawn_future`](spawn_future.md) - [`execution::counting_scope::token::wrap`](counting_scope/token/wrap.md) From d528d34d681aa3b5174facb7481553e753f2aa6d Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 13 Oct 2025 17:44:55 +0900 Subject: [PATCH 2410/3948] =?UTF-8?q?execution/spawn=5Ffuture:=20=E5=BE=AE?= =?UTF-8?q?=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/execution/execution/spawn_future.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reference/execution/execution/spawn_future.md b/reference/execution/execution/spawn_future.md index 43d4e9c515..c11c232dd3 100644 --- a/reference/execution/execution/spawn_future.md +++ b/reference/execution/execution/spawn_future.md @@ -199,7 +199,10 @@ namespace std::execution { }; } ``` +* scope_token[link /reference/stop_token/stop_token.md] +* sender[link sender.md] * completion_signatures_of_t[link completion_signatures_of_t.md] +* receiver[link receiver.md] * connect_result_t[link connect_result_t.md] * connect[link connect.md] * write_env[link write_env.md] From 751dd51cb8503e637c183452fe78c711441de3a4 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 14 Oct 2025 11:34:00 +0900 Subject: [PATCH 2411/3948] =?UTF-8?q?flat=5Fmap=20:=20=E9=80=9F=E5=BA=A6?= =?UTF-8?q?=E6=AF=94=E8=BC=83=E3=81=A8=E3=81=97=E3=81=A6=E6=A4=9C=E7=B4=A2?= =?UTF-8?q?=E3=81=8Cmap=E3=82=88=E3=82=8A=E9=81=85=E3=81=84=E3=81=A8?= =?UTF-8?q?=E6=9B=B8=E3=81=8B=E3=82=8C=E3=81=A6=E3=81=84=E3=81=9F=E3=81=AE?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3=20(#1533)=20#1531?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map.md | 8 +++++++- reference/flat_map/flat_multimap.md | 8 +++++++- reference/flat_set/flat_multiset.md | 8 +++++++- reference/flat_set/flat_set.md | 8 +++++++- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/reference/flat_map/flat_map.md b/reference/flat_map/flat_map.md index 287f7b9bbc..b63924ae8e 100644 --- a/reference/flat_map/flat_map.md +++ b/reference/flat_map/flat_map.md @@ -20,7 +20,13 @@ namespace std { ## 概要 `std::flat_map`は、重複しない要素を格納する連想コンテナの一種であり、キーとそれに対応する値を格納する。 -`std::flat_map`は、ノードベースで実装される[`std::map`](/reference/map/map.md)、ハッシュテーブルで実装される[`std::unordered_map`](/reference/unordered_map/unordered_map.md)とは異なり、ソート済み配列と二分探索の組み合わせで実装される。これはほかの実装と比較して、メモリ使用量と列挙速度において優位であり、一方で挿入速度と検索速度はほかの実装に劣る。 +`std::flat_map`は、ノードベースで実装される[`std::map`](/reference/map/map.md)、ハッシュテーブルで実装される[`std::unordered_map`](/reference/unordered_map/unordered_map.md)とは異なり、ソート済み配列と二分探索の組み合わせで実装される。 + +ほかの連想コンテナとの比較としては、 + +- メモリ使用量と列挙速度において優位 +- 挿入速度と削除速度はほかの実装に劣る +- 検索速度は、[`std::map`](/reference/map/map.md)より高速であることが期待できるが (計算量としては同じ対数時間だが、メモリアクセスが高速)、サイズが大きいときは[`std::unordered_map`](/reference/unordered_map/unordered_map.md)に劣る また、このクラスは分類としては[`std::queue`](/reference/queue/queue.md)や[`std::stack`](/reference/stack/stack.md)と同様のコンテナアダプタに分類され、キーの配列と値の配列の2つを内部で持ち、それを[`std::ranges::zip_view`](/reference/ranges/zip_view.md)で綴じあわせて扱う実装となっている。 diff --git a/reference/flat_map/flat_multimap.md b/reference/flat_map/flat_multimap.md index d3f017722c..f857ebef2e 100644 --- a/reference/flat_map/flat_multimap.md +++ b/reference/flat_map/flat_multimap.md @@ -20,7 +20,13 @@ namespace std { ## 概要 `flat_multimap` は同一キーの要素を複数格納できる連想コンテナの一種であり、キーとそれに対応する値を格納する。 -`std::flat_multimap`は、ノードベースで実装される[`std::multimap`](/reference/map/multimap.md)、ハッシュテーブルで実装される[`std::unordered_multimap`](/reference/unordered_map/unordered_multimap.md)とは異なり、ソート済み配列と二分探索の組み合わせで実装される。これはほかの実装と比較して、メモリ使用量と列挙速度において優位であり、一方で挿入速度と検索速度はほかの実装に劣る。 +`std::flat_multimap`は、ノードベースで実装される[`std::multimap`](/reference/map/multimap.md)、ハッシュテーブルで実装される[`std::unordered_multimap`](/reference/unordered_map/unordered_multimap.md)とは異なり、ソート済み配列と二分探索の組み合わせで実装される。 + +ほかの連想コンテナとの比較としては、 + +- メモリ使用量と列挙速度において優位 +- 挿入速度と削除速度はほかの実装に劣る +- 検索速度は、[`std::multimap`](/reference/map/multimap.md)より高速であることが期待できるが (計算量としては同じ対数時間だが、メモリアクセスが高速)、サイズが大きいときは[`std::unordered_multimap`](/reference/unordered_map/unordered_multimap.md)に劣る また、このクラスは分類としては[`std::queue`](/reference/queue/queue.md)や[`std::stack`](/reference/stack/stack.md)と同様のコンテナアダプタに分類され、キーの配列と値の配列の2つを内部で持ち、それを[`std::ranges::zip_view`](/reference/ranges/zip_view.md)で綴じあわせて扱う実装となっている。 diff --git a/reference/flat_set/flat_multiset.md b/reference/flat_set/flat_multiset.md index 7772514bb6..3c6c273bec 100644 --- a/reference/flat_set/flat_multiset.md +++ b/reference/flat_set/flat_multiset.md @@ -18,7 +18,13 @@ namespace std { ## 概要 `std::flat_multiset`は、重複する要素を許可する連想コンテナの一種であり、要素自身がキーとなる、集合を表すクラスである。 -`std::flat_multiset`は、ノードベースで実装される[`std::multiset`](/reference/set/multiset.md)、ハッシュテーブルで実装される[`std::unordered_multiset`](/reference/unordered_set/unordered_multiset.md)とは異なり、ソート済み配列と二分探索の組み合わせで実装される。これはほかの実装と比較して、メモリ使用量と列挙速度において優位であり、一方で挿入速度と検索速度はほかの実装に劣る。 +`std::flat_multiset`は、ノードベースで実装される[`std::multiset`](/reference/set/multiset.md)、ハッシュテーブルで実装される[`std::unordered_multiset`](/reference/unordered_set/unordered_multiset.md)とは異なり、ソート済み配列と二分探索の組み合わせで実装される。 + +ほかの連想コンテナとの比較としては、 + +- メモリ使用量と列挙速度において優位 +- 挿入速度と削除速度はほかの実装に劣る +- 検索速度は、[`std::multiset`](/reference/set/multiset.md)より高速であることが期待できるが (計算量としては同じ対数時間だが、メモリアクセスが高速)、サイズが大きいときは[`std::unordered_multiset`](/reference/unordered_set/unordered_multiset.md)に劣る また、このクラスは分類としては[`std::queue`](/reference/queue/queue.md)や[`std::stack`](/reference/stack/stack.md)と同様のコンテナアダプタに分類され、キーの配列をラップして扱う実装となっている。 diff --git a/reference/flat_set/flat_set.md b/reference/flat_set/flat_set.md index 70debad4d8..13d6dd0891 100644 --- a/reference/flat_set/flat_set.md +++ b/reference/flat_set/flat_set.md @@ -18,7 +18,13 @@ namespace std { ## 概要 `std::flat_set`は、重複しない要素を格納する連想コンテナの一種であり、要素自身がキーとなる、集合を表すクラスである。 -`std::flat_set`は、ノードベースで実装される[`std::set`](/reference/set/set.md)、ハッシュテーブルで実装される[`std::unordered_set`](/reference/unordered_set/unordered_set.md)とは異なり、ソート済み配列と二分探索の組み合わせで実装される。これはほかの実装と比較して、メモリ使用量と列挙速度において優位であり、一方で挿入速度と検索速度はほかの実装に劣る。 +`std::flat_set`は、ノードベースで実装される[`std::set`](/reference/set/set.md)、ハッシュテーブルで実装される[`std::unordered_set`](/reference/unordered_set/unordered_set.md)とは異なり、ソート済み配列と二分探索の組み合わせで実装される。 + +ほかの連想コンテナとの比較としては、 + +- メモリ使用量と列挙速度において優位 +- 挿入速度と削除速度はほかの実装に劣る +- 検索速度は、[`std::set`](/reference/set/set.md)より高速であることが期待できるが (計算量としては同じ対数時間だが、メモリアクセスが高速)、サイズが大きいときは[`std::unordered_set`](/reference/unordered_set/unordered_set.md)に劣る また、このクラスは分類としては[`std::queue`](/reference/queue/queue.md)や[`std::stack`](/reference/stack/stack.md)と同様のコンテナアダプタに分類され、キーの配列をラップして扱う実装となっている。 From 97c5f4bd841835d9f91a9fc657881c9f3230cbca Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 14 Oct 2025 14:41:25 +0900 Subject: [PATCH 2412/3948] =?UTF-8?q?C++26=E5=AF=BE=E5=BF=9C=E3=81=A8?= =?UTF-8?q?=E3=81=97=E3=81=A6shared=5Fptr=E9=96=A2=E9=80=A3=E3=82=92conste?= =?UTF-8?q?xpr=E5=AF=BE=E5=BF=9C=20#1500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/memory/allocate_shared.md | 37 +++++-- .../memory/allocate_shared_for_overwrite.md | 13 ++- reference/memory/atomic.md | 1 + reference/memory/bad_weak_ptr.md | 2 +- reference/memory/bad_weak_ptr/what.md | 23 ++++ .../enable_shared_from_this/op_assign.md | 9 +- .../enable_shared_from_this/op_constructor.md | 9 +- .../enable_shared_from_this/op_destructor.md | 6 +- .../shared_from_this.md | 12 ++- .../enable_shared_from_this/weak_from_this.md | 12 ++- reference/memory/inout_ptr.md | 7 +- .../memory/inout_ptr_t/op_constructor.md | 9 +- reference/memory/inout_ptr_t/op_destructor.md | 4 +- reference/memory/inout_ptr_t/op_pointer.md | 5 +- reference/memory/make_shared.md | 33 +++++- reference/memory/out_ptr.md | 7 +- reference/memory/out_ptr_t/op_constructor.md | 9 +- reference/memory/out_ptr_t/op_destructor.md | 4 +- reference/memory/out_ptr_t/op_pointer.md | 5 +- reference/memory/owner_less/op_call.md | 32 ++++++ .../memory/shared_ptr/const_pointer_cast.md | 13 ++- .../memory/shared_ptr/dynamic_pointer_cast.md | 13 ++- reference/memory/shared_ptr/get.md | 9 +- reference/memory/shared_ptr/get_deleter.md | 10 +- reference/memory/shared_ptr/op_arrow.md | 9 +- reference/memory/shared_ptr/op_assign.md | 36 +++++-- reference/memory/shared_ptr/op_at.md | 9 +- reference/memory/shared_ptr/op_bool.md | 6 +- .../memory/shared_ptr/op_compare_3way.md | 9 ++ reference/memory/shared_ptr/op_constructor.md | 100 ++++++++++++++---- reference/memory/shared_ptr/op_deref.md | 6 +- reference/memory/shared_ptr/op_destructor.md | 7 +- reference/memory/shared_ptr/op_equal.md | 28 +++-- reference/memory/shared_ptr/owner_before.md | 21 ++-- reference/memory/shared_ptr/reset.md | 47 ++++++-- .../memory/shared_ptr/static_pointer_cast.md | 13 ++- reference/memory/shared_ptr/swap.md | 9 +- reference/memory/shared_ptr/swap_free.md | 10 +- reference/memory/shared_ptr/use_count.md | 6 +- .../memory/unique_ptr/op_compare_3way.md | 10 +- reference/memory/unique_ptr/op_greater.md | 19 +++- .../memory/unique_ptr/op_greater_equal.md | 19 +++- reference/memory/unique_ptr/op_less.md | 19 +++- reference/memory/unique_ptr/op_less_equal.md | 19 +++- reference/memory/weak_ptr/expired.md | 9 +- reference/memory/weak_ptr/lock.md | 6 +- reference/memory/weak_ptr/op_assign.md | 29 ++++- reference/memory/weak_ptr/op_constructor.md | 24 ++++- reference/memory/weak_ptr/op_destructor.md | 7 +- reference/memory/weak_ptr/owner_before.md | 21 ++-- reference/memory/weak_ptr/reset.md | 9 +- reference/memory/weak_ptr/swap.md | 9 +- reference/memory/weak_ptr/swap_free.md | 10 +- reference/memory/weak_ptr/use_count.md | 9 +- 54 files changed, 675 insertions(+), 144 deletions(-) create mode 100644 reference/memory/bad_weak_ptr/what.md diff --git a/reference/memory/allocate_shared.md b/reference/memory/allocate_shared.md index 62aa625e2c..25e51ca626 100644 --- a/reference/memory/allocate_shared.md +++ b/reference/memory/allocate_shared.md @@ -7,21 +7,43 @@ ```cpp namespace std { template - shared_ptr allocate_shared(const Alloc& a, Args&&... args); // (1) + shared_ptr + allocate_shared(const Alloc& a, Args&&... args); // (1) C++11 + template + constexpr shared_ptr + allocate_shared(const Alloc& a, Args&&... args); // (1) C++26 template - shared_ptr allocate_shared(const A& a, size_t N); // (2) C++20 から + shared_ptr + allocate_shared(const A& a, size_t N); // (2) C++20 + template + constexpr shared_ptr + allocate_shared(const A& a, size_t N); // (2) C++26 template - shared_ptr allocate_shared(const A& a); // (3) C++20 から + shared_ptr + allocate_shared(const A& a); // (3) C++20 + template + constexpr shared_ptr + allocate_shared(const A& a); // (3) C++26 template - shared_ptr allocate_shared(const A& a, size_t N, - const remove_extent_t& u); // (4) C++20 から + shared_ptr + allocate_shared(const A& a, size_t N, + const remove_extent_t& u); // (4) C++20 + template + constexpr shared_ptr + allocate_shared(const A& a, size_t N, + const remove_extent_t& u); // (4) C++26 template - shared_ptr allocate_shared(const A& a, - const remove_extent_t& u); // (5) C++20 から + shared_ptr + allocate_shared(const A& a, + const remove_extent_t& u); // (5) C++20 + template + constexpr shared_ptr + allocate_shared(const A& a, + const remove_extent_t& u); // (5) C++26 } ``` * shared_ptr[link shared_ptr.md] @@ -135,3 +157,4 @@ int main() { ## 参照 - [P0674R1 Extending `make_shared` to support arrays](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0674r1.html) +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/allocate_shared_for_overwrite.md b/reference/memory/allocate_shared_for_overwrite.md index efc54ee6f8..e7f47f2b59 100644 --- a/reference/memory/allocate_shared_for_overwrite.md +++ b/reference/memory/allocate_shared_for_overwrite.md @@ -7,10 +7,18 @@ ```cpp namespace std { template - shared_ptr allocate_shared_for_overwrite(const A& a); // (1) + shared_ptr + allocate_shared_for_overwrite(const A& a); // (1) C++20 + template + constexpr shared_ptr + allocate_shared_for_overwrite(const A& a); // (1) C++26 template - shared_ptr allocate_shared_for_overwrite(const A& a, size_t N); // (2) + shared_ptr + allocate_shared_for_overwrite(const A& a, size_t N); // (2) C++20 + template + constexpr shared_ptr + allocate_shared_for_overwrite(const A& a, size_t N); // (2) C++26 } ``` * shared_ptr[link shared_ptr.md] @@ -98,3 +106,4 @@ int main() { ## 参照 - [P1020R1 Smart pointer creation with default initialization](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1020r1.html) - [P1973R1 Rename "_default_init" Functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1973r1.pdf) +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/atomic.md b/reference/memory/atomic.md index 9d97732a0b..9af6f75ae4 100644 --- a/reference/memory/atomic.md +++ b/reference/memory/atomic.md @@ -110,3 +110,4 @@ int main() - [P0718R2 Revising `atomic_shared_ptr` for C++20](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0718r2.html) - [cplusplus/draft #2824 - add forward declaration of `atomic` class for `atomic>` (P0718R2)](https://github.com/cplusplus/draft/pull/2824) - [P1644R0 Add wait/notify to `atomic>`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1644r0.html) +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/bad_weak_ptr.md b/reference/memory/bad_weak_ptr.md index 46974d88ef..8525fc4cfe 100644 --- a/reference/memory/bad_weak_ptr.md +++ b/reference/memory/bad_weak_ptr.md @@ -23,7 +23,7 @@ namespace std { | `bad_weak_ptr() noexcept;`
`bad_weak_ptr(const bad_weak_ptr&) noexcept;` | コンストラクタ | C++11 | | `virtual ~bad_weak_ptr() = default;` | デストラクタ | C++11 | | `bad_weak_ptr& operator=(const bad_weak_ptr&) noexcept;` | 代入演算子 | C++11 | -| `virtual const char* what() const noexcept;` | エラー内容を取得する。文字列`"bad_weak_ptr"`が返される | C++11 | +| [`what()`](bad_weak_ptr/what.md) | エラー内容を取得する。文字列`"bad_weak_ptr"`が返される | C++11 | ## 例 ```cpp example diff --git a/reference/memory/bad_weak_ptr/what.md b/reference/memory/bad_weak_ptr/what.md new file mode 100644 index 0000000000..75f2268721 --- /dev/null +++ b/reference/memory/bad_weak_ptr/what.md @@ -0,0 +1,23 @@ +# what +* memory[meta header] +* std[meta namespace] +* bad_weak_ptr[meta class] +* function[meta id-type] +* cpp11[meta cpp] + +```cpp +virtual const char* what() const noexcept; // (1) C++11 +const char* what() const noexcept override; // (1) C++17 +constexpr const char* what() const noexcept override; // (1) C++26 +``` + +## 概要 +エラー理由となる実装依存文字列を取得する。 + + +## 例外 +投げない + + +## 参照 +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/enable_shared_from_this/op_assign.md b/reference/memory/enable_shared_from_this/op_assign.md index 047c1b27ec..f54fb062fc 100644 --- a/reference/memory/enable_shared_from_this/op_assign.md +++ b/reference/memory/enable_shared_from_this/op_assign.md @@ -6,7 +6,10 @@ * cpp11[meta cpp] ```cpp -enable_shared_from_this& operator=(const enable_shared_from_this&) noexcept; +enable_shared_from_this& + operator=(const enable_shared_from_this&) noexcept; // (1) C++11 +constexpr enable_shared_from_this& + operator=(const enable_shared_from_this&) noexcept; // (1) C++26 ``` ## 概要 @@ -27,3 +30,7 @@ enable_shared_from_this& operator=(const enable_shared_from_this&) noexcept; - [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2008 (TR1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] + + +## 参照 +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/enable_shared_from_this/op_constructor.md b/reference/memory/enable_shared_from_this/op_constructor.md index 114cb916f3..938d67f5db 100644 --- a/reference/memory/enable_shared_from_this/op_constructor.md +++ b/reference/memory/enable_shared_from_this/op_constructor.md @@ -6,8 +6,12 @@ * cpp11[meta cpp] ```cpp -constexpr enable_shared_from_this() noexcept; // (1) -enable_shared_from_this(const enable_shared_from_this&) noexcept; // (2) +constexpr +enable_shared_from_this() noexcept; // (1) C++11 + +enable_shared_from_this(const enable_shared_from_this&) noexcept; // (2) C++11 +constexpr +enable_shared_from_this(const enable_shared_from_this&) noexcept; // (2) C++26 ``` ## enable_shared_from_thisオブジェクトの構築 @@ -33,3 +37,4 @@ enable_shared_from_this(const enable_shared_from_this&) noexcept; // (2) ## 参照 - [P0033R0 Re-enabling `shared_from_this`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0033r0.html) - [P0033R1 Re-enabling `shared_from_this` (revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0033r1.html) +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/enable_shared_from_this/op_destructor.md b/reference/memory/enable_shared_from_this/op_destructor.md index 356c1f7f4a..3e9aaf37b4 100644 --- a/reference/memory/enable_shared_from_this/op_destructor.md +++ b/reference/memory/enable_shared_from_this/op_destructor.md @@ -6,10 +6,11 @@ * cpp11[meta cpp] ```cpp -~enable_shared_from_this(); +~enable_shared_from_this(); // (1) C++11 +constexpr ~enable_shared_from_this(); // (1) C++26 ``` -## enable_shared_from_thisオブジェクトの破棄(C++11) +## 概要 `*this`を破棄する。 @@ -26,3 +27,4 @@ ## 参照 - [P0033R0 Re-enabling `shared_from_this`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0033r0.html) - [P0033R1 Re-enabling `shared_from_this` (revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0033r1.html) +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/enable_shared_from_this/shared_from_this.md b/reference/memory/enable_shared_from_this/shared_from_this.md index cdde92b543..f19ffb8b61 100644 --- a/reference/memory/enable_shared_from_this/shared_from_this.md +++ b/reference/memory/enable_shared_from_this/shared_from_this.md @@ -6,8 +6,15 @@ * cpp11[meta cpp] ```cpp -shared_ptr shared_from_this(); -shared_ptr shared_from_this() const; +shared_ptr + shared_from_this(); // (1) C++11 +constexpr shared_ptr + shared_from_this(); // (1) C++26 + +shared_ptr + shared_from_this() const; // (2) C++11 +constexpr shared_ptr + shared_from_this() const; // (2) C++26 ``` * shared_ptr[link /reference/memory/shared_ptr.md] @@ -80,3 +87,4 @@ int main() ## 参照 - [P0033R0 Re-enabling `shared_from_this`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0033r0.html) - [P0033R1 Re-enabling `shared_from_this` (revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0033r1.html) +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/enable_shared_from_this/weak_from_this.md b/reference/memory/enable_shared_from_this/weak_from_this.md index 3a552a4265..3035c55a0b 100644 --- a/reference/memory/enable_shared_from_this/weak_from_this.md +++ b/reference/memory/enable_shared_from_this/weak_from_this.md @@ -6,8 +6,15 @@ * cpp17[meta cpp] ```cpp -weak_ptr weak_from_this() noexcept; -weak_ptr weak_from_this() const noexcept; +weak_ptr + weak_from_this() noexcept; // (1) C++17 +constexpr weak_ptr + weak_from_this() noexcept; // (1) C++26 + +weak_ptr + weak_from_this() const noexcept; // (2) C++17 +constexpr weak_ptr + weak_from_this() const noexcept; // (2) C++26 ``` * weak_ptr[link /reference/memory/weak_ptr.md] @@ -64,3 +71,4 @@ int main() ## 参照 - [P0033R0 Re-enabling `shared_from_this`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0033r0.html) - [P0033R1 Re-enabling `shared_from_this` (revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0033r1.html) +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/inout_ptr.md b/reference/memory/inout_ptr.md index 21bce258d5..e8cea861a1 100644 --- a/reference/memory/inout_ptr.md +++ b/reference/memory/inout_ptr.md @@ -7,7 +7,11 @@ ```cpp namespace std { template - auto inout_ptr(Smart& s, Args&&... args); + auto + inout_ptr(Smart& s, Args&&... args); // (1) C++23 + template + constexpr auto + inout_ptr(Smart& s, Args&&... args); // (1) C++26 } ``` @@ -81,3 +85,4 @@ int main() { ## 参照 - [P1132R8 out_ptr - a scalable output pointer abstraction](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1132r8.html) +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/inout_ptr_t/op_constructor.md b/reference/memory/inout_ptr_t/op_constructor.md index 63978cd94c..8b7dcb5237 100644 --- a/reference/memory/inout_ptr_t/op_constructor.md +++ b/reference/memory/inout_ptr_t/op_constructor.md @@ -6,8 +6,12 @@ * cpp23[meta cpp] ```cpp -explicit inout_ptr_t(Smart& smart, Args... args); // (1) -inout_ptr_t(const inout_ptr_t&) = delete; // (2) +explicit +inout_ptr_t(Smart& smart, Args... args); // (1) C++23 +constexpr explicit +inout_ptr_t(Smart& smart, Args... args); // (1) C++26 + +inout_ptr_t(const inout_ptr_t&) = delete; // (2) C++23 ``` ## 概要 @@ -50,3 +54,4 @@ inout_ptr_t(const inout_ptr_t&) = delete; // (2) ## 参照 - [P1132R8 out_ptr - a scalable output pointer abstraction](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1132r8.html) +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/inout_ptr_t/op_destructor.md b/reference/memory/inout_ptr_t/op_destructor.md index e7428512a1..c555b3c309 100644 --- a/reference/memory/inout_ptr_t/op_destructor.md +++ b/reference/memory/inout_ptr_t/op_destructor.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -~inout_ptr_t(); +~inout_ptr_t(); // (1) C++23 +constexpr ~inout_ptr_t(); // (1) C++26 ``` ## 概要 @@ -84,3 +85,4 @@ ## 参照 - [P1132R8 out_ptr - a scalable output pointer abstraction](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1132r8.html) - [LWG Issue 3897. `inout_ptr` will not update raw pointer to 0](https://cplusplus.github.io/LWG/issue3897) +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/inout_ptr_t/op_pointer.md b/reference/memory/inout_ptr_t/op_pointer.md index f6ab1c1a48..11248a15e0 100644 --- a/reference/memory/inout_ptr_t/op_pointer.md +++ b/reference/memory/inout_ptr_t/op_pointer.md @@ -6,7 +6,9 @@ * cpp23[meta cpp] ```cpp -operator Pointer*() const noexcept; +operator Pointer*() const noexcept; // (1) C++23 +constexpr +operator Pointer*() const noexcept; // (1) C++26 ``` ## 概要 @@ -42,3 +44,4 @@ operator Pointer*() const noexcept; ## 参照 - [P1132R8 out_ptr - a scalable output pointer abstraction](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1132r8.html) +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/make_shared.md b/reference/memory/make_shared.md index c391ef254b..ef9d12e0d4 100644 --- a/reference/memory/make_shared.md +++ b/reference/memory/make_shared.md @@ -7,19 +7,41 @@ ```cpp namespace std { template - shared_ptr make_shared(Args&&... args); // (1) + shared_ptr + make_shared(Args&&... args); // (1) C++11 + template + constexpr shared_ptr + make_shared(Args&&... args); // (1) C++26 template - shared_ptr make_shared(size_t N); // (2) C++20 から + shared_ptr + make_shared(size_t N); // (2) C++20 + template + constexpr shared_ptr + make_shared(size_t N); // (2) C++26 template - shared_ptr make_shared(); // (3) C++20 から + shared_ptr + make_shared(); // (3) C++20 + template + constexpr shared_ptr + make_shared(); // (3) C++26 template - shared_ptr make_shared(size_t N, const remove_extent_t& u); // (4) C++20 から + shared_ptr + make_shared(size_t N, + const remove_extent_t& u); // (4) C++20 + template + constexpr shared_ptr + make_shared(size_t N, + const remove_extent_t& u); // (4) C++26 template - shared_ptr make_shared(const remove_extent_t& u); // (5) C++20 から + shared_ptr + make_shared(const remove_extent_t& u); // (5) C++20 + template + constexpr shared_ptr + make_shared(const remove_extent_t& u); // (5) C++26 } ``` * shared_ptr[link shared_ptr.md] @@ -122,3 +144,4 @@ int main() { - [N2351 Improving `shared_ptr` for C++0x, Revision 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2351.htm) - [std::make_shared から private コンストラクタを呼び出す - 野良C++erの雑記帳](http://d.hatena.ne.jp/gintenlabo/20131211/1386771626) - [P0674R1 Extending `make_shared` to support arrays](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0674r1.html) +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/out_ptr.md b/reference/memory/out_ptr.md index e613eec812..ebd0588e95 100644 --- a/reference/memory/out_ptr.md +++ b/reference/memory/out_ptr.md @@ -7,7 +7,11 @@ ```cpp namespace std { template - auto out_ptr(Smart& s, Args&&... args); + auto + out_ptr(Smart& s, Args&&... args); // (1) C++23 + template + constexpr auto + out_ptr(Smart& s, Args&&... args); // (1) C++26 } ``` @@ -78,3 +82,4 @@ int main() { ## 参照 - [P1132R8 out_ptr - a scalable output pointer abstraction](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1132r8.html) +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/out_ptr_t/op_constructor.md b/reference/memory/out_ptr_t/op_constructor.md index 76c09cfa7c..acc899e9a4 100644 --- a/reference/memory/out_ptr_t/op_constructor.md +++ b/reference/memory/out_ptr_t/op_constructor.md @@ -6,8 +6,12 @@ * cpp23[meta cpp] ```cpp -explicit out_ptr_t(Smart& smart, Args... args); // (1) -out_ptr_t(const out_ptr_t&) = delete; // (2) +explicit +out_ptr_t(Smart& smart, Args... args); // (1) C++23 +constexpr explicit +out_ptr_t(Smart& smart, Args... args); // (1) C++26 + +out_ptr_t(const out_ptr_t&) = delete; // (2) C++23 ``` ## 概要 @@ -43,3 +47,4 @@ out_ptr_t(const out_ptr_t&) = delete; // (2) ## 参照 - [P1132R8 out_ptr - a scalable output pointer abstraction](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1132r8.html) +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/out_ptr_t/op_destructor.md b/reference/memory/out_ptr_t/op_destructor.md index ff1fae12d0..0a336c8251 100644 --- a/reference/memory/out_ptr_t/op_destructor.md +++ b/reference/memory/out_ptr_t/op_destructor.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -~out_ptr_t(); +~out_ptr_t(); // (1) C++23 +constexpr ~out_ptr_t(); // (1) C++26 ``` ## 概要 @@ -73,3 +74,4 @@ ## 参照 - [P1132R8 out_ptr - a scalable output pointer abstraction](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1132r8.html) +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/out_ptr_t/op_pointer.md b/reference/memory/out_ptr_t/op_pointer.md index 3154decf66..f4063743f5 100644 --- a/reference/memory/out_ptr_t/op_pointer.md +++ b/reference/memory/out_ptr_t/op_pointer.md @@ -6,7 +6,9 @@ * cpp23[meta cpp] ```cpp -operator Pointer*() const noexcept; +operator Pointer*() const noexcept; // (1) C++23 +constexpr +operator Pointer*() const noexcept; // (1) C++26 ``` ## 概要 @@ -42,3 +44,4 @@ operator Pointer*() const noexcept; ## 参照 - [P1132R8 out_ptr - a scalable output pointer abstraction](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1132r8.html) +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/owner_less/op_call.md b/reference/memory/owner_less/op_call.md index a43ddd9c23..a6c8c55758 100644 --- a/reference/memory/owner_less/op_call.md +++ b/reference/memory/owner_less/op_call.md @@ -9,28 +9,59 @@ // shared_ptr特殊化版 bool operator()(const shared_ptr& a, const shared_ptr& b) const; // (1) C++11 bool operator()(const shared_ptr& a, const shared_ptr& b) const noexcept; // (1) C++17 +constexpr bool + operator()(const shared_ptr& a, const shared_ptr& b) const noexcept; // (1) C++26 + bool operator()(const shared_ptr& a, const weak_ptr& b) const; // (2) C++11 bool operator()(const shared_ptr& a, const weak_ptr& b) const noexcept; // (2) C++17 +constexpr bool + operator()(const shared_ptr& a, const weak_ptr& b) const noexcept; // (2) C++26 + bool operator()(const weak_ptr& a, const shared_ptr& b) const; // (3) C++11 bool operator()(const weak_ptr& a, const shared_ptr& b) const noexcept; // (3) C++17 +constexpr bool + operator()(const weak_ptr& a, const shared_ptr& b) const noexcept; // (3) C++26 // weak_ptr特殊化版 bool operator()(const weak_ptr& a, const weak_ptr& b) const; // (4) C++11 bool operator()(const weak_ptr& a, const weak_ptr& b) const noexcept; // (4) C++17 +constexpr bool + operator()(const weak_ptr& a, const weak_ptr& b) const noexcept; // (4) C++26 + bool operator()(const shared_ptr& a, const weak_ptr& b) const; // (5) C++11 bool operator()(const shared_ptr& a, const weak_ptr& b) const noexcept; // (5) C++17 +constexpr bool + operator()(const shared_ptr& a, const weak_ptr& b) const noexcept; // (5) C++26 + bool operator()(const weak_ptr& a, const shared_ptr& b) const; // (6) C++11 bool operator()(const weak_ptr& a, const shared_ptr& b) const noexcept; // (6) C++17 +constexpr bool + operator()(const weak_ptr& a, const shared_ptr& b) const noexcept; // (6) C++26 // void特殊化版 template bool operator()(const shared_ptr&, const shared_ptr&) const noexcept; // (7) C++17 +template +constexpr bool + operator()(const shared_ptr&, const shared_ptr&) const noexcept; // (7) C++26 + template bool operator()(const shared_ptr&, const weak_ptr&) const noexcept; // (8) C++17 +template +constexpr bool + operator()(const shared_ptr&, const weak_ptr&) const noexcept; // (8) C++26 + template bool operator()(const weak_ptr&, const shared_ptr&) const noexcept; // (9) C++17 +template +constexpr bool + operator()(const weak_ptr&, const shared_ptr&) const noexcept; // (9) C++26 + template bool operator()(const weak_ptr&, const weak_ptr&) const noexcept; // (10) C++17 +template +constexpr bool + operator()(const weak_ptr&, const weak_ptr&) const noexcept; // (10) C++26 ``` * shared_ptr[link /reference/memory/shared_ptr.md] * weak_ptr[link /reference/memory/weak_ptr.md] @@ -58,3 +89,4 @@ a.owner_before(b) ## 参照 - [LWG Issue 2873. Add `noexcept` to several `shared_ptr` related functions](https://wg21.cmeerw.net/lwg/issue2873) - [P0074R0 Making `std::owner_less` more flexible](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0074r0.html) +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/shared_ptr/const_pointer_cast.md b/reference/memory/shared_ptr/const_pointer_cast.md index 476a1696f9..5531922ea3 100644 --- a/reference/memory/shared_ptr/const_pointer_cast.md +++ b/reference/memory/shared_ptr/const_pointer_cast.md @@ -7,10 +7,18 @@ ```cpp namespace std { template - shared_ptr const_pointer_cast(const shared_ptr& r) noexcept; // (1) C++11 + shared_ptr + const_pointer_cast(const shared_ptr& r) noexcept; // (1) C++11 + template + constexpr shared_ptr + const_pointer_cast(const shared_ptr& r) noexcept; // (1) C++26 template - shared_ptr const_pointer_cast(shared_ptr&& r) noexcept; // (2) C++20 + shared_ptr + const_pointer_cast(shared_ptr&& r) noexcept; // (2) C++20 + template + constexpr shared_ptr + const_pointer_cast(shared_ptr&& r) noexcept; // (2) C++26 } ``` @@ -75,3 +83,4 @@ int main() ## 参照 - [LWG Issue 2996. Missing rvalue overloads for `shared_ptr` operations](https://wg21.cmeerw.net/lwg/issue2996) +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/shared_ptr/dynamic_pointer_cast.md b/reference/memory/shared_ptr/dynamic_pointer_cast.md index 3efeafe347..a65a5eaaa6 100644 --- a/reference/memory/shared_ptr/dynamic_pointer_cast.md +++ b/reference/memory/shared_ptr/dynamic_pointer_cast.md @@ -7,10 +7,18 @@ ```cpp namespace std { template - shared_ptr dynamic_pointer_cast(const shared_ptr& r) noexcept; // (1) C++11 + shared_ptr + dynamic_pointer_cast(const shared_ptr& r) noexcept; // (1) C++11 + template + constexpr shared_ptr + dynamic_pointer_cast(const shared_ptr& r) noexcept; // (1) C++26 template - shared_ptr dynamic_pointer_cast(shared_ptr&& r) noexcept; // (2) C++20 + shared_ptr + dynamic_pointer_cast(shared_ptr&& r) noexcept; // (2) C++20 + template + constexpr shared_ptr + dynamic_pointer_cast(shared_ptr&& r) noexcept; // (2) C++26 } ``` @@ -95,3 +103,4 @@ B::call() ## 参照 - [LWG Issue 2996. Missing rvalue overloads for `shared_ptr` operations](https://wg21.cmeerw.net/lwg/issue2996) +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/shared_ptr/get.md b/reference/memory/shared_ptr/get.md index 6c9c1af543..0868a48b37 100644 --- a/reference/memory/shared_ptr/get.md +++ b/reference/memory/shared_ptr/get.md @@ -6,8 +6,12 @@ * cpp11[meta cpp] ```cpp -T* get() const noexcept; // (1) C++11 -element_type* get() const noexcept; // (1) C++17 +T* + get() const noexcept; // (1) C++11 +element_type* + get() const noexcept; // (1) C++17 +constexpr element_type* + get() const noexcept; // (1) C++26 ``` ## 概要 @@ -56,3 +60,4 @@ int main() ## 参照 - [P0414R1 Merging `shared_ptr` changes from Library Fundamentals to C++17](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0414r1.html) +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/shared_ptr/get_deleter.md b/reference/memory/shared_ptr/get_deleter.md index 0bc4dbec70..c7545a477a 100644 --- a/reference/memory/shared_ptr/get_deleter.md +++ b/reference/memory/shared_ptr/get_deleter.md @@ -7,7 +7,11 @@ ```cpp namespace std { template - D* get_deleter(const shared_ptr& p) noexcept; + D* + get_deleter(const shared_ptr& p) noexcept; // (1) C++11 + template + constexpr D* + get_deleter(const shared_ptr& p) noexcept; // (1) C++26 } ``` @@ -64,3 +68,7 @@ int main() - [GCC](/implementation.md#gcc): 4.3.6 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2008 (TR1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] + + +## 参照 +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/shared_ptr/op_arrow.md b/reference/memory/shared_ptr/op_arrow.md index b6a41ea5fa..f4d40de2f4 100644 --- a/reference/memory/shared_ptr/op_arrow.md +++ b/reference/memory/shared_ptr/op_arrow.md @@ -7,7 +7,10 @@ ```cpp // 非配列版のみ -T* operator->() const noexcept; +T* + operator->() const noexcept; // (1) C++11 +constexpr T* + operator->() const noexcept; // (1) C++26 ``` ## 概要 @@ -58,3 +61,7 @@ hello - [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2008 (TR1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] + + +## 参照 +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/shared_ptr/op_assign.md b/reference/memory/shared_ptr/op_assign.md index cb15085fd3..443fea8842 100644 --- a/reference/memory/shared_ptr/op_assign.md +++ b/reference/memory/shared_ptr/op_assign.md @@ -6,23 +6,42 @@ * cpp11[meta cpp] ```cpp -shared_ptr& operator=(const shared_ptr& r) noexcept; // (1) +shared_ptr& + operator=(const shared_ptr& r) noexcept; // (1) C++11 +constexpr shared_ptr& + operator=(const shared_ptr& r) noexcept; // (1) C++26 template -shared_ptr& operator=(const shared_ptr& r) noexcept; // (2) +shared_ptr& + operator=(const shared_ptr& r) noexcept; // (2) C++11 +template +constexpr shared_ptr& + operator=(const shared_ptr& r) noexcept; // (2) C++26 -shared_ptr& operator=(shared_ptr&& r) noexcept; // (3) +shared_ptr& + operator=(shared_ptr&& r) noexcept; // (3) C++11 +constexpr shared_ptr& + operator=(shared_ptr&& r) noexcept; // (3) C++26 template -shared_ptr& operator=(shared_ptr&& r) noexcept; // (4) +shared_ptr& + operator=(shared_ptr&& r) noexcept; // (4) C++11 +template +constexpr shared_ptr& + operator=(shared_ptr&& r) noexcept; // (4) C++26 template -shared_ptr& operator=(auto_ptr&& r); // (5) - // C++11から非推奨 - // C++17で削除 +shared_ptr& + operator=(auto_ptr&& r); // (5) + // C++11から非推奨 + // C++17で削除 template -shared_ptr& operator=(unique_ptr&& r); // (6) +shared_ptr& + operator=(unique_ptr&& r); // (6) C++11 +template +constexpr shared_ptr& + operator=(unique_ptr&& r); // (6) C++26 ``` * unique_ptr[link /reference/memory/unique_ptr.md] @@ -141,3 +160,4 @@ int main() ## 参照 - [N4190 Removing `auto_ptr`, `random_shuffle()`, And Old `` Stuff](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4190.htm) +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/shared_ptr/op_at.md b/reference/memory/shared_ptr/op_at.md index 4669009460..1a453a8f1b 100644 --- a/reference/memory/shared_ptr/op_at.md +++ b/reference/memory/shared_ptr/op_at.md @@ -7,7 +7,10 @@ ```cpp // 配列版のみ -element_type& operator[](ptrdiff_t i) const; +element_type& + operator[](ptrdiff_t i) const; // (1) C++17 +constexpr element_type& + operator[](ptrdiff_t i) const; // (1) C++26 ``` * ptrdiff_t[link /reference/cstddef/ptrdiff_t.md] @@ -62,3 +65,7 @@ int main() - [GCC](/implementation.md#gcc): 7.2 [mark verified] - [Clang](/implementation.md#clang): - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/shared_ptr/op_bool.md b/reference/memory/shared_ptr/op_bool.md index 5dd1b2460c..0520130685 100644 --- a/reference/memory/shared_ptr/op_bool.md +++ b/reference/memory/shared_ptr/op_bool.md @@ -6,7 +6,10 @@ * cpp11[meta cpp] ```cpp -explicit operator bool() const noexcept; +explicit + operator bool() const noexcept; // (1) C++11 +constexpr explicit + operator bool() const noexcept; // (1) C++26 ``` ## 概要 @@ -58,3 +61,4 @@ p has resource ## 参照 - [N2435 Explicit bool for Smart Pointers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2435.htm) +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/shared_ptr/op_compare_3way.md b/reference/memory/shared_ptr/op_compare_3way.md index 74e67ca5ad..a6358bb539 100644 --- a/reference/memory/shared_ptr/op_compare_3way.md +++ b/reference/memory/shared_ptr/op_compare_3way.md @@ -10,11 +10,19 @@ namespace std { strong_ordering operator<=>(const shared_ptr& a, const shared_ptr& b) noexcept; // (1) C++20 + template + constexpr strong_ordering + operator<=>(const shared_ptr& a, + const shared_ptr& b) noexcept; // (1) C++26 template strong_ordering operator<=>(const shared_ptr& x, nullptr_t) noexcept; // (2) C++20 + template + constexpr strong_ordering + operator<=>(const shared_ptr& x, + nullptr_t) noexcept; // (2) C++26 } ``` @@ -90,3 +98,4 @@ p3 is nullptr ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/shared_ptr/op_constructor.md b/reference/memory/shared_ptr/op_constructor.md index c6790ee80e..4fae6d3fbf 100644 --- a/reference/memory/shared_ptr/op_constructor.md +++ b/reference/memory/shared_ptr/op_constructor.md @@ -6,56 +6,111 @@ * cpp11[meta cpp] ```cpp -constexpr shared_ptr() noexcept; // (1) +constexpr +shared_ptr() noexcept; // (1) C++11 template -explicit shared_ptr(Y* p); // (2) +explicit +shared_ptr(Y* p); // (2) C++11 +template +constexpr explicit +shared_ptr(Y* p); // (2) C++26 template -shared_ptr(Y* p, Deleter d); // (3) +shared_ptr(Y* p, + Deleter d); // (3) C++11 +template +constexpr +shared_ptr(Y* p, + Deleter d); // (3) C++26 template -shared_ptr(Y* p, Deleter d, Alloc a); // (4) +constexpr +shared_ptr(Y* p, + Deleter d, + Alloc a); // (4) C++11 +template +shared_ptr(Y* p, + Deleter d, + Alloc a); // (4) C++26 template -shared_ptr(nullptr_t p, Deleter d); // (5) +shared_ptr(nullptr_t p, + Deleter d); // (5) C++11 +template +constexpr +shared_ptr(nullptr_t p, + Deleter d); // (5) C++26 template -shared_ptr(nullptr_t p, Deleter d, Alloc a); // (6) +shared_ptr(nullptr_t p, + Deleter d, + Alloc a); // (6) C++11 +template +constexpr +shared_ptr(nullptr_t p, + Deleter d, + Alloc a); // (6) C++26 template -shared_ptr(const shared_ptr& r, T* p) noexcept; // (7) C++11 - +shared_ptr(const shared_ptr& r, + T* p) noexcept; // (7) C++11 +template +shared_ptr(const shared_ptr& r, + element_type* p) noexcept; // (7) C++17 template -shared_ptr(const shared_ptr& r, element_type* p) noexcept; // (7) C++17 +constexpr +shared_ptr(const shared_ptr& r, + element_type* p) noexcept; // (7) C++26 -shared_ptr(const shared_ptr& r) noexcept; // (8) +shared_ptr(const shared_ptr& r) noexcept; // (8) C++11 +constexpr +shared_ptr(const shared_ptr& r) noexcept; // (8) C++26 template -shared_ptr(const shared_ptr& r) noexcept; // (9) +shared_ptr(const shared_ptr& r) noexcept; // (9) C++11 +template +constexpr +shared_ptr(const shared_ptr& r) noexcept; // (9) C++26 -shared_ptr(shared_ptr&& r) noexcept; // (10) +shared_ptr(shared_ptr&& r) noexcept; // (10) C++11 +constexpr +shared_ptr(shared_ptr&& r) noexcept; // (10) C++26 template -shared_ptr(shared_ptr&& r) noexcept; // (11) +shared_ptr(shared_ptr&& r) noexcept; // (11) C++11 +template +constexpr +shared_ptr(shared_ptr&& r) noexcept; // (11) C++26 template -explicit shared_ptr(const weak_ptr& r); // (12) +explicit +shared_ptr(const weak_ptr& r); // (12) C++11 +template +constexpr explicit +shared_ptr(const weak_ptr& r); // (12) C++26 template -shared_ptr(auto_ptr&& r); // (13) - // C++11から非推奨 - // C++17で削除 +shared_ptr(auto_ptr&& r); // (13) + // C++11から非推奨 + // C++17で削除 template -shared_ptr(unique_ptr&& r); // (14) - -constexpr shared_ptr(nullptr_t); // (15) C++14 +shared_ptr(unique_ptr&& r); // (14) C++11 +template +constexpr +shared_ptr(unique_ptr&& r); // (14) C++26 -constexpr shared_ptr(nullptr_t) noexcept; // (15) C++17 +constexpr shared_ptr(nullptr_t); // (15) C++14 +constexpr shared_ptr(nullptr_t) noexcept; // (15) C++17 template -shared_ptr(shared_ptr&& r, element_type* p) noexcept; // (16) C++20 +shared_ptr(shared_ptr&& r, + element_type* p) noexcept; // (16) C++20 +template +constexpr +shared_ptr(shared_ptr&& r, + element_type* p) noexcept; // (16) C++26 ``` * weak_ptr[link /reference/memory/weak_ptr.md] * unique_ptr[link /reference/memory/unique_ptr.md] @@ -285,3 +340,4 @@ int main() - [P0497R0 Fixes to `shared_ptr` support for arrays](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0497r0.html) - [LWG Issue 2996. Missing rvalue overloads for `shared_ptr` operations](https://wg21.cmeerw.net/lwg/issue2996) - [LWG Issue 2365. Missing `noexcept` in `shared_ptr::shared_ptr(nullptr_t)`](https://wg21.cmeerw.net/lwg/issue2365) +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/shared_ptr/op_deref.md b/reference/memory/shared_ptr/op_deref.md index 5ab589c854..36812e14a8 100644 --- a/reference/memory/shared_ptr/op_deref.md +++ b/reference/memory/shared_ptr/op_deref.md @@ -7,7 +7,10 @@ ```cpp // 非配列版、非void版のみ -T& operator*() const noexcept; +T& + operator*() const noexcept; // (1) C++11 +constexpr T& + operator*() const noexcept; // (1) C++26 ``` ## 概要 @@ -64,3 +67,4 @@ int main() ## 参照 - [LWG Issue 2572. The remarks for `shared_ptr::operator*` should apply to cv-qualified void as well](https://wg21.cmeerw.net/lwg/issue2572) - [P0414R1 Merging `shared_ptr` changes from Library Fundamentals to C++17](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0414r1.html) +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/shared_ptr/op_destructor.md b/reference/memory/shared_ptr/op_destructor.md index 5a50aae7fa..ba7e8ade1f 100644 --- a/reference/memory/shared_ptr/op_destructor.md +++ b/reference/memory/shared_ptr/op_destructor.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -~shared_ptr(); +~shared_ptr(); // (1) C++11 +constexpr ~shared_ptr(); // (1) C++26 ``` ## `shared_ptr`オブジェクトの破棄 @@ -67,3 +68,7 @@ X dtor 1 Y dtor ``` + + +## 参照 +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/shared_ptr/op_equal.md b/reference/memory/shared_ptr/op_equal.md index 6c848faf53..66974b915c 100644 --- a/reference/memory/shared_ptr/op_equal.md +++ b/reference/memory/shared_ptr/op_equal.md @@ -7,17 +7,32 @@ ```cpp namespace std { template - bool operator==(const shared_ptr& a, - const shared_ptr& b) noexcept; // (1) C++11 + bool + operator==(const shared_ptr& a, + const shared_ptr& b) noexcept; // (1) C++11 + template + constexpr bool + operator==(const shared_ptr& a, + const shared_ptr& b) noexcept; // (1) C++26 template - bool operator==(const shared_ptr& x, - nullptr_t) noexcept; // (2) C++11 + bool + operator==(const shared_ptr& x, + nullptr_t) noexcept; // (2) C++11 + template + constexpr bool + operator==(const shared_ptr& x, + nullptr_t) noexcept; // (2) C++26 // (2)により、以下のオーバーロードが使用可能になる (C++20) template - bool operator==(nullptr_t, - const shared_ptr& x) noexcept; // (3) C++11 + bool + operator==(nullptr_t, + const shared_ptr& x) noexcept; // (3) C++11 + template + constexpr bool + operator==(nullptr_t, + const shared_ptr& x) noexcept; // (3) C++26 } ``` @@ -81,3 +96,4 @@ p3 is nullptr ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/shared_ptr/owner_before.md b/reference/memory/shared_ptr/owner_before.md index 06752b4fde..5ea30d205d 100644 --- a/reference/memory/shared_ptr/owner_before.md +++ b/reference/memory/shared_ptr/owner_before.md @@ -7,16 +7,24 @@ ```cpp template -bool owner_before(const shared_ptr& b) const; // (1) C++11 - +bool + owner_before(const shared_ptr& b) const; // (1) C++11 template -bool owner_before(const shared_ptr& b) const noexcept; // (1) C++17 - +bool + owner_before(const shared_ptr& b) const noexcept; // (1) C++17 template -bool owner_before(const weak_ptr& b) const; // (2) C++11 +constexpr bool + owner_before(const shared_ptr& b) const noexcept; // (1) C++26 template -bool owner_before(const weak_ptr& b) const noexcept; // (2) C++17 +bool + owner_before(const weak_ptr& b) const; // (2) C++11 +template +bool + owner_before(const weak_ptr& b) const noexcept; // (2) C++17 +template +constexpr bool + owner_before(const weak_ptr& b) const noexcept; // (2) C++26 ``` * weak_ptr[link /reference/memory/weak_ptr.md] @@ -106,3 +114,4 @@ false - [N2637 Revisiting std::shared_ptr comparison](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2637.pdf) - [LWG Issue 1406. Support hashing smart-pointers based on owner](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#1406) - [LWG Issue 2873. Add `noexcept` to several `shared_ptr` related functions](https://wg21.cmeerw.net/lwg/issue2873) +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/shared_ptr/reset.md b/reference/memory/shared_ptr/reset.md index a62c6e4852..cdf1fa2b1a 100644 --- a/reference/memory/shared_ptr/reset.md +++ b/reference/memory/shared_ptr/reset.md @@ -6,16 +6,43 @@ * cpp11[meta cpp] ```cpp -void reset() noexcept; // (1) +void + reset() noexcept; // (1) C++11 +constexpr void + reset() noexcept; // (1) C++26 template -void reset(Y* p); // (2) - -template -void reset(Y* p, Deleter d); // (3) - -template -void reset(Y* p, Deleter d, Allocator a); // (4) +void + reset(Y* p); // (2) C++11 +template +constexpr void + reset(Y* p); // (2) C++26 + +template +void + reset(Y* p, + Deleter d); // (3) C++11 +template +constexpr void + reset(Y* p, + Deleter d); // (3) C++26 + +template +void + reset(Y* p, + Deleter d, + Allocator a); // (4) C++11 +template +constexpr void + reset(Y* p, + Deleter d, + Allocator a); // (4) C++26 ``` ## 概要 @@ -71,3 +98,7 @@ int main() - [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2008 (TR1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] + + +## 参照 +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/shared_ptr/static_pointer_cast.md b/reference/memory/shared_ptr/static_pointer_cast.md index 453569fcdb..1107b896d1 100644 --- a/reference/memory/shared_ptr/static_pointer_cast.md +++ b/reference/memory/shared_ptr/static_pointer_cast.md @@ -7,10 +7,18 @@ ```cpp namespace std { template - shared_ptr static_pointer_cast(const shared_ptr& r) noexcept; // (1) C++11 + shared_ptr + static_pointer_cast(const shared_ptr& r) noexcept; // (1) C++11 + template + constexpr shared_ptr + static_pointer_cast(const shared_ptr& r) noexcept; // (1) C++26 template - shared_ptr static_pointer_cast(shared_ptr&& r) noexcept; // (2) C++20 + shared_ptr + static_pointer_cast(shared_ptr&& r) noexcept; // (2) C++20 + template + constexpr shared_ptr + static_pointer_cast(shared_ptr&& r) noexcept; // (2) C++26 } ``` @@ -87,3 +95,4 @@ B::call() ## 参照 - [LWG Issue 2996. Missing rvalue overloads for `shared_ptr` operations](https://wg21.cmeerw.net/lwg/issue2996) +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/shared_ptr/swap.md b/reference/memory/shared_ptr/swap.md index 81425942bb..ced73f433d 100644 --- a/reference/memory/shared_ptr/swap.md +++ b/reference/memory/shared_ptr/swap.md @@ -6,7 +6,10 @@ * cpp11[meta cpp] ```cpp -void swap(shared_ptr& x) noexcept; +void + swap(shared_ptr& x) noexcept; // (1) C++11 +constexpr void + swap(shared_ptr& x) noexcept; // (1) C++26 ``` ## 概要 @@ -64,3 +67,7 @@ int main() - [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2008 (TR1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] + + +## 参照 +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/shared_ptr/swap_free.md b/reference/memory/shared_ptr/swap_free.md index cba035670b..d054eb0ab2 100644 --- a/reference/memory/shared_ptr/swap_free.md +++ b/reference/memory/shared_ptr/swap_free.md @@ -7,7 +7,11 @@ ```cpp namespace std { template - void swap(shared_ptr& a, shared_ptr& b) noexcept; + void + swap(shared_ptr& a, shared_ptr& b) noexcept; // (1) C++11 + template + constexpr void + swap(shared_ptr& a, shared_ptr& b) noexcept; // (1) C++26 } ``` @@ -66,3 +70,7 @@ int main() - [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2008 (TR1) [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] + + +## 参照 +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/shared_ptr/use_count.md b/reference/memory/shared_ptr/use_count.md index 7da71ec8ec..82299a1a7f 100644 --- a/reference/memory/shared_ptr/use_count.md +++ b/reference/memory/shared_ptr/use_count.md @@ -6,7 +6,10 @@ * cpp11[meta cpp] ```cpp -long use_count() const noexcept; +long + use_count() const noexcept; // (1) C++11 +constexpr long + use_count() const noexcept; // (1) C++26 ``` ## 概要 @@ -61,3 +64,4 @@ int main() ## 参照 - [P0521R0 Proposed Resolution for CA 14 (`shared_ptr` `use_count`/`unique`)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0521r0.html) +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/unique_ptr/op_compare_3way.md b/reference/memory/unique_ptr/op_compare_3way.md index 43bc880884..d9233cf25a 100644 --- a/reference/memory/unique_ptr/op_compare_3way.md +++ b/reference/memory/unique_ptr/op_compare_3way.md @@ -14,12 +14,19 @@ namespace std { typename unique_ptr::pointer, typename unique_ptr::pointer> operator<=>(const unique_ptr& x, const unique_ptr& y); // (1) C++20 + template + requires three_way_comparable_with< + typename unique_ptr::pointer, + typename unique_ptr::pointer> + constexpr compare_three_way_result_t< + typename unique_ptr::pointer, + typename unique_ptr::pointer> + operator<=>(const unique_ptr& x, const unique_ptr& y); // (1) C++26 template requires three_way_comparable_with::pointer> compare_three_way_result_t::pointer> operator<=>(const unique_ptr& x, nullptr_t); // (2) C++20 - template requires three_way_comparable_with::pointer> constexpr compare_three_way_result_t::pointer> @@ -98,3 +105,4 @@ p2 is nullptr - C++20での三方比較演算子の追加と、関連する演算子の自動導出 - [LWG3426 `operator<=>(const unique_ptr&, nullptr_t)` can't get no satisfaction](https://cplusplus.github.io/LWG/issue3426) - [P2273R3 Making `std::unique_ptr` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2273r3.pdf) +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/unique_ptr/op_greater.md b/reference/memory/unique_ptr/op_greater.md index 25831b4530..f1a5f863fb 100644 --- a/reference/memory/unique_ptr/op_greater.md +++ b/reference/memory/unique_ptr/op_greater.md @@ -7,17 +7,25 @@ ```cpp namespace std { template - bool operator>(const unique_ptr& a, const unique_ptr& b); // (1) C++11 + bool + operator>(const unique_ptr& a, const unique_ptr& b); // (1) C++11 + template + constexpr bool + operator>(const unique_ptr& a, const unique_ptr& b); // (1) C++26 template - bool operator>(const unique_ptr& x, nullptr_t); // (2) C++11 + bool + operator>(const unique_ptr& x, nullptr_t); // (2) C++11 template - constexpr bool operator>(const unique_ptr& x, nullptr_t); // (2) C++23 + constexpr bool + operator>(const unique_ptr& x, nullptr_t); // (2) C++23 template - bool operator>(nullptr_t, const unique_ptr& x); // (3) C++11 + bool + operator>(nullptr_t, const unique_ptr& x); // (3) C++11 template - constexpr bool operator>(nullptr_t, const unique_ptr& x); // (3) C++23 + constexpr bool + operator>(nullptr_t, const unique_ptr& x); // (3) C++23 } ``` @@ -77,3 +85,4 @@ false ## 参照 - [P2273R3 Making `std::unique_ptr` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2273r3.pdf) +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/unique_ptr/op_greater_equal.md b/reference/memory/unique_ptr/op_greater_equal.md index bb4c6e4747..48306df50e 100644 --- a/reference/memory/unique_ptr/op_greater_equal.md +++ b/reference/memory/unique_ptr/op_greater_equal.md @@ -7,17 +7,25 @@ ```cpp namespace std { template - bool operator>=(const unique_ptr& a, const unique_ptr& b); // (1) C++11 + bool + operator>=(const unique_ptr& a, const unique_ptr& b); // (1) C++11 + template + constexpr bool + operator>=(const unique_ptr& a, const unique_ptr& b); // (1) C++26 template - bool operator>=(const unique_ptr& x, nullptr_t); // (2) C++11 + bool + operator>=(const unique_ptr& x, nullptr_t); // (2) C++11 template - constexpr bool operator>=(const unique_ptr& x, nullptr_t); // (2) C++23 + constexpr bool + operator>=(const unique_ptr& x, nullptr_t); // (2) C++26 template - bool operator>=(nullptr_t, const unique_ptr& x); // (3) C++11 + bool + operator>=(nullptr_t, const unique_ptr& x); // (3) C++11 template - constexpr bool operator>=(nullptr_t, const unique_ptr& x); // (3) C++23 + constexpr bool + operator>=(nullptr_t, const unique_ptr& x); // (3) C++23 } ``` @@ -77,3 +85,4 @@ false ## 参照 - [P2273R3 Making `std::unique_ptr` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2273r3.pdf) +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/unique_ptr/op_less.md b/reference/memory/unique_ptr/op_less.md index 2a2d161482..fb67e059c5 100644 --- a/reference/memory/unique_ptr/op_less.md +++ b/reference/memory/unique_ptr/op_less.md @@ -7,17 +7,25 @@ ```cpp namespace std { template - bool operator<(const unique_ptr& a, const unique_ptr& b); // (1) C++11 + bool + operator<(const unique_ptr& a, const unique_ptr& b); // (1) C++11 + template + constexpr bool + operator<(const unique_ptr& a, const unique_ptr& b); // (1) C++26 template - bool operator<(const unique_ptr& x, nullptr_t); // (2) C++11 + bool + operator<(const unique_ptr& x, nullptr_t); // (2) C++11 template - constexpr bool operator<(const unique_ptr& x, nullptr_t); // (2) C++23 + constexpr bool + operator<(const unique_ptr& x, nullptr_t); // (2) C++23 template - bool operator<(nullptr_t, const unique_ptr& x); // (3) C++11 + bool + operator<(nullptr_t, const unique_ptr& x); // (3) C++11 template - constexpr bool operator<(nullptr_t, const unique_ptr& x); // (3) C++23 + constexpr bool + operator<(nullptr_t, const unique_ptr& x); // (3) C++23 } ``` @@ -79,3 +87,4 @@ true ## 参照 - [P2273R3 Making `std::unique_ptr` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2273r3.pdf) +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/unique_ptr/op_less_equal.md b/reference/memory/unique_ptr/op_less_equal.md index 44a69bd99a..2e63dba6b1 100644 --- a/reference/memory/unique_ptr/op_less_equal.md +++ b/reference/memory/unique_ptr/op_less_equal.md @@ -7,17 +7,25 @@ ```cpp namespace std { template - bool operator<=(const unique_ptr& a, const unique_ptr& b); // (1) C++11 + bool + operator<=(const unique_ptr& a, const unique_ptr& b); // (1) C++11 + template + constexpr bool + operator<=(const unique_ptr& a, const unique_ptr& b); // (1) C++26 template - bool operator<=(const unique_ptr& x, nullptr_t); // (2) C++11 + bool + operator<=(const unique_ptr& x, nullptr_t); // (2) C++11 template - constexpr bool operator<=(const unique_ptr& x, nullptr_t); // (2) C++23 + constexpr bool + operator<=(const unique_ptr& x, nullptr_t); // (2) C++23 template - bool operator<=(nullptr_t, const unique_ptr& x); // (3) C++11 + bool + operator<=(nullptr_t, const unique_ptr& x); // (3) C++11 template - constexpr bool operator<=(nullptr_t, const unique_ptr& x); // (3) C++23 + constexpr bool + operator<=(nullptr_t, const unique_ptr& x); // (3) C++23 } ``` @@ -77,3 +85,4 @@ true ## 参照 - [P2273R3 Making `std::unique_ptr` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2273r3.pdf) +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/weak_ptr/expired.md b/reference/memory/weak_ptr/expired.md index 8d98c08d3e..7e9f5099e3 100644 --- a/reference/memory/weak_ptr/expired.md +++ b/reference/memory/weak_ptr/expired.md @@ -6,7 +6,10 @@ * cpp11[meta cpp] ```cpp -bool expired() const noexcept; +bool + expired() const noexcept; // (1) C++11 +constexpr bool + expired() const noexcept; // (1) C++26 ``` ## 概要 @@ -65,3 +68,7 @@ int main() - [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? + + +## 参照 +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/weak_ptr/lock.md b/reference/memory/weak_ptr/lock.md index 0be2fa8b15..f7b4712e77 100644 --- a/reference/memory/weak_ptr/lock.md +++ b/reference/memory/weak_ptr/lock.md @@ -6,7 +6,10 @@ * cpp11[meta cpp] ```cpp -shared_ptr lock() const noexcept; +shared_ptr + lock() const noexcept; // (1) C++11 +constexpr shared_ptr + lock() const noexcept; // (1) C++26 ``` * shared_ptr[link /reference/memory/shared_ptr.md] @@ -96,3 +99,4 @@ int main() ## 参照 - [LWG 2316 - weak_ptr::lock() should be atomic](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#2316) +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/weak_ptr/op_assign.md b/reference/memory/weak_ptr/op_assign.md index 18beef1d8a..9272c2554f 100644 --- a/reference/memory/weak_ptr/op_assign.md +++ b/reference/memory/weak_ptr/op_assign.md @@ -6,18 +6,36 @@ * cpp11[meta cpp] ```cpp -weak_ptr& operator=(const weak_ptr& r) noexcept; // (1) +weak_ptr& +operator=(const weak_ptr& r) noexcept; // (1) C++11 +constexpr weak_ptr& +operator=(const weak_ptr& r) noexcept; // (1) C++26 template -weak_ptr& operator=(const weak_ptr& r) noexcept; // (2) +weak_ptr& +operator=(const weak_ptr& r) noexcept; // (2) C++11 +template +constexpr weak_ptr& +operator=(const weak_ptr& r) noexcept; // (2) C++26 template -weak_ptr& operator=(const shared_ptr& r) noexcept; // (3) +weak_ptr& +operator=(const shared_ptr& r) noexcept; // (3) C++11 +template +constexpr weak_ptr& +operator=(const shared_ptr& r) noexcept; // (3) C++26 -weak_ptr& operator=(weak_ptr&& r) noexcept; // (4) C++14 +weak_ptr& +operator=(weak_ptr&& r) noexcept; // (4) C++14 +constexpr weak_ptr& +operator=(weak_ptr&& r) noexcept; // (4) C++26 template -weak_ptr& operator=(weak_ptr&& r) noexcept; // (5) C++14 +weak_ptr& +operator=(weak_ptr&& r) noexcept; // (5) C++14 +template +constexpr weak_ptr& +operator=(weak_ptr&& r) noexcept; // (5) C++26 ``` ## 概要 @@ -144,3 +162,4 @@ int main() ## 参照 - [LWG Issue 2315. `weak_ptr` should be movable](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2315) +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/weak_ptr/op_constructor.md b/reference/memory/weak_ptr/op_constructor.md index 1af17989e2..e19c3c5ec8 100644 --- a/reference/memory/weak_ptr/op_constructor.md +++ b/reference/memory/weak_ptr/op_constructor.md @@ -6,19 +6,34 @@ * cpp11[meta cpp] ```cpp -constexpr weak_ptr() noexcept; // (1) -weak_ptr(const weak_ptr& r) noexcept; // (2) +constexpr +weak_ptr() noexcept; // (1) C++11 +weak_ptr(const weak_ptr& r) noexcept; // (2) C++11 +constexpr +weak_ptr(const weak_ptr& r) noexcept; // (2) C++26 + +template +weak_ptr(const weak_ptr& r) noexcept; // (3) C++11 template -weak_ptr(const weak_ptr& r) noexcept; // (3) +constexpr +weak_ptr(const weak_ptr& r) noexcept; // (3) C++26 template -weak_ptr(const shared_ptr& r) noexcept; // (4) +weak_ptr(const shared_ptr& r) noexcept; // (4) C++11 +template +constexpr +weak_ptr(const shared_ptr& r) noexcept; // (4) C++26 weak_ptr(weak_ptr&& r) noexcept; // (5) C++14 +constexpr +weak_ptr(weak_ptr&& r) noexcept; // (5) C++26 template weak_ptr(weak_ptr&& r) noexcept; // (6) C++14 +template +constexpr +weak_ptr(weak_ptr&& r) noexcept; // (6) C++26 ``` * shared_ptr[link /reference/memory/shared_ptr.md] @@ -139,3 +154,4 @@ int main() ## 参照 - [LWG Issue 2315. `weak_ptr` should be movable](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2315) - [P0414R1 Merging `shared_ptr` changes from Library Fundamentals to C++17](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0414r1.html) +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/weak_ptr/op_destructor.md b/reference/memory/weak_ptr/op_destructor.md index ee7e69931a..b601f6ec7a 100644 --- a/reference/memory/weak_ptr/op_destructor.md +++ b/reference/memory/weak_ptr/op_destructor.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -~weak_ptr(); +~weak_ptr(); // (1) C++11 +constexpr ~weak_ptr(); // (1) C++26 ``` ## weak_ptrオブジェクトの破棄 @@ -22,3 +23,7 @@ - [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? + + +## 参照 +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/weak_ptr/owner_before.md b/reference/memory/weak_ptr/owner_before.md index 61798d25ab..e74e819bf1 100644 --- a/reference/memory/weak_ptr/owner_before.md +++ b/reference/memory/weak_ptr/owner_before.md @@ -7,16 +7,24 @@ ```cpp template -bool owner_before(const shared_ptr& b) const; // (1) C++11 - +bool + owner_before(const shared_ptr& b) const; // (1) C++11 template -bool owner_before(const shared_ptr& b) const noexcept; // (1) C++17 - +bool + owner_before(const shared_ptr& b) const noexcept; // (1) C++17 template -bool owner_before(const weak_ptr& b) const; // (2) C++11 +constexpr bool + owner_before(const shared_ptr& b) const noexcept; // (1) C++17 template -bool owner_before(const weak_ptr& b) const noexcept; // (2) C++17 +bool + owner_before(const weak_ptr& b) const; // (2) C++11 +template +bool + owner_before(const weak_ptr& b) const noexcept; // (2) C++17 +template +constexpr bool + owner_before(const weak_ptr& b) const noexcept; // (2) C++26 ``` * shared_ptr[link /reference/memory/shared_ptr.md] @@ -82,3 +90,4 @@ false - [N2637 Revisiting std::shared_ptr comparison](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2637.pdf) - [LWG Issue 1406. Support hashing smart-pointers based on owner](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#1406) - [LWG Issue 2873. Add `noexcept` to several `shared_ptr` related functions](https://wg21.cmeerw.net/lwg/issue2873) +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/weak_ptr/reset.md b/reference/memory/weak_ptr/reset.md index 7bd0645515..a786bb9b2c 100644 --- a/reference/memory/weak_ptr/reset.md +++ b/reference/memory/weak_ptr/reset.md @@ -6,7 +6,10 @@ * cpp11[meta cpp] ```cpp -void reset() noexcept; +void + reset() noexcept; // (1) C++11 +constexpr void + reset() noexcept; // (1) C++26 ``` ## 概要 @@ -54,3 +57,7 @@ int main() - [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? + + +## 参照 +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/weak_ptr/swap.md b/reference/memory/weak_ptr/swap.md index 8f21fbb4d3..2d49aafeee 100644 --- a/reference/memory/weak_ptr/swap.md +++ b/reference/memory/weak_ptr/swap.md @@ -6,7 +6,10 @@ * cpp11[meta cpp] ```cpp -void swap(weak_ptr& r) noexcept; +void + swap(weak_ptr& r) noexcept; // (1) C++11 +constexpr void + swap(weak_ptr& r) noexcept; // (1) C++26 ``` ## 概要 @@ -78,3 +81,7 @@ int main() - [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? + + +## 参照 +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/weak_ptr/swap_free.md b/reference/memory/weak_ptr/swap_free.md index f6e88b8234..55296eed84 100644 --- a/reference/memory/weak_ptr/swap_free.md +++ b/reference/memory/weak_ptr/swap_free.md @@ -7,7 +7,11 @@ ```cpp namespace std { template - void swap(weak_ptr& a, weak_ptr& b) noexcept; + void + swap(weak_ptr& a, weak_ptr& b) noexcept; // (1) C++11 + template + constexpr void + swap(weak_ptr& a, weak_ptr& b) noexcept; // (1) C++26 } ``` @@ -80,3 +84,7 @@ int main() - [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? + + +## 参照 +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file diff --git a/reference/memory/weak_ptr/use_count.md b/reference/memory/weak_ptr/use_count.md index d784d70ac1..c15a2b9f2d 100644 --- a/reference/memory/weak_ptr/use_count.md +++ b/reference/memory/weak_ptr/use_count.md @@ -6,7 +6,10 @@ * cpp11[meta cpp] ```cpp -long use_count() const noexcept; +long + use_count() const noexcept; // (1) C++11 +constexpr long + use_count() const noexcept; // (1) C++26 ``` ## 概要 @@ -56,3 +59,7 @@ int main() - [Clang](/implementation.md#clang): 3.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): ? + + +## 参照 +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file From 4e673b3e0c8b38e78c71560af53b492cb7727be6 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Tue, 14 Oct 2025 19:23:57 +0900 Subject: [PATCH 2413/3948] =?UTF-8?q?execution::spawn=5Ffuture=20:=20Typo?= =?UTF-8?q?=E3=80=81=E3=83=AA=E3=83=B3=E3=82=AF=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/execution/execution/spawn_future.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/execution/execution/spawn_future.md b/reference/execution/execution/spawn_future.md index c11c232dd3..d52b976294 100644 --- a/reference/execution/execution/spawn_future.md +++ b/reference/execution/execution/spawn_future.md @@ -141,7 +141,7 @@ namespace std::execution { * exception_ptr[link /reference/exception/exception_ptr.md] * current_exception()[link /reference/exception/current_exception.md] -型`ssource-t`を[`stoppabe-source`](/reference/stop_token/stoppable-source.md)のモデルである未規定の型、`ssource`を型`ssource-t`の左辺値とする。 +型`ssource-t`を[`stoppable-source`](/reference/stop_token/stoppable-source.md)のモデルである未規定の型、`ssource`を型`ssource-t`の左辺値とする。 型`stoken-t`を`decltype(ssource.get_token())`とする。 ### エイリアステンプレート `future-spawned-sender` @@ -199,7 +199,7 @@ namespace std::execution { }; } ``` -* scope_token[link /reference/stop_token/stop_token.md] +* scope_token[link scope_token.md] * sender[link sender.md] * completion_signatures_of_t[link completion_signatures_of_t.md] * receiver[link receiver.md] From 71fab6aa524f83154f1c7ad81ff3aff60d7fd44f Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Tue, 14 Oct 2025 19:29:40 +0900 Subject: [PATCH 2414/3948] =?UTF-8?q?=E5=8F=AF=E5=A4=89=E9=95=B7=E3=83=87?= =?UTF-8?q?=E3=83=BC=E3=82=BF=E3=82=92=E6=89=B1=E3=81=86=E3=82=AF=E3=83=A9?= =?UTF-8?q?=E3=82=B9=E3=81=AE=E5=8A=B9=E7=8E=87=E7=9A=84=E3=81=AAdelete=20?= =?UTF-8?q?:=20=E3=82=B3=E3=83=BC=E3=83=89=E4=BE=8B=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. std::string_view にヌル文字が含まれていたので、 .size() を領域のサイズから1引いたものとしました。 2. *p が破棄された後に p->length にアクセスしていたので、文の順序を変更しました。 3. char の領域とその後ろの未確保領域に対して inlined_fixed_string のデストラクタを呼ばれていたので、 char* にキャストし char のデストラクタが呼ばれるように修正しました。 --- .../efficient_sized_delete_for_variable_sized_classes.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md b/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md index 39a3118464..ed1d911308 100644 --- a/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md +++ b/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md @@ -202,7 +202,7 @@ public: inlined_fixed_string() = delete; auto size() const -> std::size_t { - return length; + return length - 1; } auto view() const -> std::string_view { @@ -232,12 +232,12 @@ public: // 末尾領域の長さを取得 const std::size_t full_size = sizeof(inlined_fixed_string) + p->length; + // char(トリビアルに破棄可能な)型はデストラクタ呼び出しを省略可能 + std::ranges::destroy(reinterpret_cast(p + 1), reinterpret_cast(p + 1) + p->length); + // デストラクタ呼び出し std::destroy_at(p); - // char(トリビアルに破棄可能な)型はデストラクタ呼び出しを省略可能 - std::ranges::destroy(p + 1, p + 1 + p->length + 1); - // メモリ解放 ::operator delete(p, full_size); From 85387aabaabf4946531c32e13023688627219473 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 14 Oct 2025 22:10:59 +0900 Subject: [PATCH 2415/3948] =?UTF-8?q?execution:=20P3552R3=20=E3=82=A8?= =?UTF-8?q?=E3=83=B3=E3=83=86=E3=82=A3=E3=83=86=E3=82=A3=E5=88=97=E6=8C=99?= =?UTF-8?q?=E3=81=AE=E3=81=BF=20(#1521)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/execution/execution.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 4c1346b447..b6af20ac83 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -160,6 +160,12 @@ Senderコンシューマは名前空間 `std::this_thread` および名前空間 |------|------|----------------| | [`execution::as_awaitable`](execution/as_awaitable.md) | Senderを[Awaitable型](/lang/cpp20/coroutines.md)へ変換 (customization point object) | C++26 | | [`execution::with_awaitable_senders`](execution/with_awaitable_senders.md) | [Promise型](/lang/cpp20/coroutines.md)の基底クラス (class template) | C++26 | +| [`execution::affine_on`](execution/affine_on.md.nolink) | (customization point object) | C++26 | +| [`execution::inline_scheduler`](execution/inline_scheduler.md.nolink) | インラインScheduler (class) | C++26 | +| [`execution::task_scheduler`](execution/task_scheduler.md.nolink) | 型消去タスクScheduler (class) | C++26 | +| [`execution::with_error`](execution/with_error.md.nolink) | コルーチンからのエラー完了 (class template) | C++26 | +| [`execution::change_coroutine_scheduler`](execution/change_coroutine_scheduler.md.nolink) | コルーチンのScheduler変更 (class template) | C++26 | +| [`execution::task`](execution/task.md.nolink) | 非同期タスクコルーチン戻り値型 (class template) | C++26 | ### 実行スコープユーティリティ @@ -190,6 +196,7 @@ Senderコンシューマは名前空間 `std::this_thread` および名前空間 - [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) - [P3284R4 `write_env` and `unstoppable` Sender Adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3284r4.html) - [P3481R5 `std::execution::bulk()` issues](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3481r5.html) +- [P3552R3 Add a Coroutine Task Type](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3552r3.html) - [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) - [P3570R2 optional variants in sender/receiver](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3570r2.html) - [P3682R0 Remove `std::execution::split`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3682r0.pdf) From c9ea77669c81a00563d989ccb759bd921326f714 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Fri, 17 Oct 2025 18:16:31 +0900 Subject: [PATCH 2416/3948] =?UTF-8?q?=E3=81=84=E3=81=8F=E3=81=A4=E3=81=8B?= =?UTF-8?q?=E3=81=AE=E3=82=B3=E3=83=BC=E3=83=89=E4=BE=8B=E3=81=AE=E5=87=BA?= =?UTF-8?q?=E5=8A=9B=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp17/constexpr_lambda.md | 1 - reference/ranges/cartesian_product_view.md | 2 +- reference/ranges/elements_view.md | 1 - reference/ranges/filter_view/pred.md | 4 ++-- reference/ranges/lazy_split_view.md | 2 ++ 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lang/cpp17/constexpr_lambda.md b/lang/cpp17/constexpr_lambda.md index 066519ed9b..69d1da520d 100644 --- a/lang/cpp17/constexpr_lambda.md +++ b/lang/cpp17/constexpr_lambda.md @@ -140,7 +140,6 @@ int main(){ ### 出力 ``` -0 ``` ## この機能が必要になった背景・経緯 diff --git a/reference/ranges/cartesian_product_view.md b/reference/ranges/cartesian_product_view.md index f28ffec662..b1f621fe3f 100644 --- a/reference/ranges/cartesian_product_view.md +++ b/reference/ranges/cartesian_product_view.md @@ -141,7 +141,7 @@ int main() { ### 出力 ``` [(1, 'a'), (1, 'b'), (1, 'c'), (2, 'a'), (2, 'b'), (2, 'c')] -[] +[()] ``` ## バージョン diff --git a/reference/ranges/elements_view.md b/reference/ranges/elements_view.md index d68ae5715d..48fda8af94 100644 --- a/reference/ranges/elements_view.md +++ b/reference/ranges/elements_view.md @@ -141,7 +141,6 @@ int main() { 1 2 3 - one two three diff --git a/reference/ranges/filter_view/pred.md b/reference/ranges/filter_view/pred.md index 6d3978c28a..0481d4890e 100644 --- a/reference/ranges/filter_view/pred.md +++ b/reference/ranges/filter_view/pred.md @@ -43,8 +43,8 @@ int main() { ### 出力 ``` -2 -3 +1 +0 ``` ## バージョン diff --git a/reference/ranges/lazy_split_view.md b/reference/ranges/lazy_split_view.md index 34d88ded56..1f7a6222fb 100644 --- a/reference/ranges/lazy_split_view.md +++ b/reference/ranges/lazy_split_view.md @@ -150,10 +150,12 @@ int main() { ### 出力 ``` + 23 456 78 9 + ``` ## バージョン From 8960e70b488f3aa21a8d74a8fe98f16c29b8f64c Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Fri, 17 Oct 2025 18:18:02 +0900 Subject: [PATCH 2417/3948] =?UTF-8?q?=E5=87=BA=E5=8A=9B=E3=81=AB=E5=90=88?= =?UTF-8?q?=E3=82=8F=E3=81=9B=E3=81=A6=E3=82=B3=E3=83=BC=E3=83=89=E4=BE=8B?= =?UTF-8?q?=E3=81=AB=20std::boolalpha=20=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/iota_view/empty.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/ranges/iota_view/empty.md b/reference/ranges/iota_view/empty.md index 13f2309acf..7d21ab1947 100644 --- a/reference/ranges/iota_view/empty.md +++ b/reference/ranges/iota_view/empty.md @@ -38,7 +38,7 @@ int main() { auto it = std::back_inserter(v); auto r = std::views::iota(it); - std::cout << r.empty() << "\n"; + std::cout << std::boolalpha << r.empty() << "\n"; } ``` From 4164601aae55645b332eef802cd034a2c14bfc63 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sat, 18 Oct 2025 18:50:25 +0900 Subject: [PATCH 2418/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BE=8B?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/unordered_map/unordered_map/key_eq.md | 4 ++-- reference/unordered_map/unordered_multimap/key_eq.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/unordered_map/unordered_map/key_eq.md b/reference/unordered_map/unordered_map/key_eq.md index 53fa6e33e0..d7a7fa7986 100644 --- a/reference/unordered_map/unordered_map/key_eq.md +++ b/reference/unordered_map/unordered_map/key_eq.md @@ -50,7 +50,7 @@ int main() decltype(um)::key_equal eq{ um.key_eq() }; std::cout << "eq(\"1st\", \"2nd\") = " << eq("1st", "2nd") << std::endl; - std::cout << "eq(\"1st\", \"2nd\") = " << eq("1st", "1st") << std::endl; + std::cout << "eq(\"1st\", \"1st\") = " << eq("1st", "1st") << std::endl; } ``` * key_eq()[color ff0000] @@ -58,7 +58,7 @@ int main() ### 出力 ``` eq("1st", "2nd") = false -eq("1st", "2nd") = true +eq("1st", "1st") = true ``` ## バージョン diff --git a/reference/unordered_map/unordered_multimap/key_eq.md b/reference/unordered_map/unordered_multimap/key_eq.md index bb4d83fc2e..c7d20c3d32 100644 --- a/reference/unordered_map/unordered_multimap/key_eq.md +++ b/reference/unordered_map/unordered_multimap/key_eq.md @@ -50,7 +50,7 @@ int main() decltype(um)::key_equal eq{ um.key_eq() }; std::cout << "eq(\"1st\", \"2nd\") = " << eq("1st", "2nd") << std::endl; - std::cout << "eq(\"1st\", \"2nd\") = " << eq("1st", "1st") << std::endl; + std::cout << "eq(\"1st\", \"1st\") = " << eq("1st", "1st") << std::endl; } ``` * key_eq()[color ff0000] @@ -58,7 +58,7 @@ int main() ### 出力 ``` eq("1st", "2nd") = false -eq("1st", "2nd") = true +eq("1st", "1st") = true ``` ## バージョン From 7727976b8c42ab20ebfa361f1f768fa1ab01d5a9 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sat, 18 Oct 2025 19:08:36 +0900 Subject: [PATCH 2419/3948] =?UTF-8?q?unordered=5F(multi)(set=20|=20map)=20?= =?UTF-8?q?:=20=E5=87=A6=E7=90=86=E7=B3=BB=E4=BE=9D=E5=AD=98=E3=81=AA?= =?UTF-8?q?=E3=80=8C=E5=87=BA=E5=8A=9B=E3=80=8D=E3=82=92=E3=80=8C=E5=87=BA?= =?UTF-8?q?=E5=8A=9B=E4=BE=8B=E3=80=8D=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit コード例の出力において、実行結果が処理系・実行環境によって異なる場合は、項目名を出力「例」にすることになっています。 unordered_ なコンテナの要素の順序やバケットのサイズなどは処理系によって異なります。 それらに依存する出力の項目名に「出力」と「出力例」が混在していたので、「出力例」に統一しました。 --- reference/unordered_map/unordered_map.md | 2 +- reference/unordered_map/unordered_map/cend.md | 2 +- reference/unordered_map/unordered_map/emplace.md | 2 +- reference/unordered_map/unordered_map/emplace_hint.md | 2 +- reference/unordered_map/unordered_map/end.md | 2 +- reference/unordered_map/unordered_map/equal_range.md | 2 +- reference/unordered_map/unordered_map/extract.md | 2 +- reference/unordered_map/unordered_map/insert.md | 2 +- reference/unordered_map/unordered_map/insert_range.md | 2 +- reference/unordered_map/unordered_map/merge.md | 2 +- reference/unordered_map/unordered_map/swap.md | 2 +- reference/unordered_map/unordered_map/swap_free.md | 2 +- reference/unordered_map/unordered_multimap.md | 2 +- reference/unordered_map/unordered_multimap/bucket.md | 2 +- reference/unordered_map/unordered_multimap/bucket_size.md | 2 +- reference/unordered_map/unordered_multimap/cbegin.md | 2 +- reference/unordered_map/unordered_multimap/emplace.md | 2 +- reference/unordered_map/unordered_multimap/emplace_hint.md | 2 +- reference/unordered_map/unordered_multimap/equal_range.md | 2 +- reference/unordered_map/unordered_multimap/extract.md | 3 ++- reference/unordered_map/unordered_multimap/insert.md | 2 +- reference/unordered_map/unordered_multimap/insert_range.md | 2 +- reference/unordered_map/unordered_multimap/merge.md | 2 +- reference/unordered_map/unordered_multimap/swap.md | 2 +- reference/unordered_map/unordered_multimap/swap_free.md | 2 +- reference/unordered_set/unordered_multiset.md | 2 +- reference/unordered_set/unordered_multiset/begin-size_type.md | 2 +- reference/unordered_set/unordered_multiset/bucket.md | 2 +- reference/unordered_set/unordered_multiset/bucket_size.md | 2 +- reference/unordered_set/unordered_multiset/cbegin-size_type.md | 2 +- reference/unordered_set/unordered_multiset/cbegin.md | 2 +- reference/unordered_set/unordered_multiset/cend-size_type.md | 2 +- reference/unordered_set/unordered_multiset/cend.md | 2 +- reference/unordered_set/unordered_multiset/count.md | 2 +- reference/unordered_set/unordered_multiset/emplace_hint.md | 2 +- reference/unordered_set/unordered_multiset/end-size_type.md | 2 +- reference/unordered_set/unordered_multiset/end.md | 2 +- reference/unordered_set/unordered_multiset/equal_range.md | 2 +- reference/unordered_set/unordered_multiset/extract.md | 2 +- reference/unordered_set/unordered_multiset/find.md | 2 +- reference/unordered_set/unordered_multiset/hash_function.md | 2 +- reference/unordered_set/unordered_multiset/insert.md | 2 +- reference/unordered_set/unordered_multiset/insert_range.md | 2 +- reference/unordered_set/unordered_multiset/load_factor.md | 2 +- reference/unordered_set/unordered_multiset/max_load_factor.md | 2 +- reference/unordered_set/unordered_multiset/merge.md | 2 +- reference/unordered_set/unordered_multiset/op_equal.md | 2 +- reference/unordered_set/unordered_multiset/op_not_equal.md | 2 +- reference/unordered_set/unordered_multiset/swap.md | 2 +- reference/unordered_set/unordered_multiset/swap_free.md | 2 +- reference/unordered_set/unordered_set.md | 2 +- reference/unordered_set/unordered_set/begin-size_type.md | 2 +- reference/unordered_set/unordered_set/begin.md | 2 +- reference/unordered_set/unordered_set/bucket.md | 2 +- reference/unordered_set/unordered_set/bucket_size.md | 2 +- reference/unordered_set/unordered_set/cbegin-size_type.md | 2 +- reference/unordered_set/unordered_set/cend-size_type.md | 2 +- reference/unordered_set/unordered_set/cend.md | 2 +- reference/unordered_set/unordered_set/count.md | 2 +- reference/unordered_set/unordered_set/emplace_hint.md | 2 +- reference/unordered_set/unordered_set/end-size_type.md | 2 +- reference/unordered_set/unordered_set/end.md | 2 +- reference/unordered_set/unordered_set/equal_range.md | 2 +- reference/unordered_set/unordered_set/extract.md | 2 +- reference/unordered_set/unordered_set/find.md | 2 +- reference/unordered_set/unordered_set/hash_function.md | 2 +- reference/unordered_set/unordered_set/insert.md | 2 +- reference/unordered_set/unordered_set/insert_range.md | 2 +- reference/unordered_set/unordered_set/load_factor.md | 2 +- reference/unordered_set/unordered_set/max_load_factor.md | 2 +- reference/unordered_set/unordered_set/merge.md | 2 +- reference/unordered_set/unordered_set/op_equal.md | 2 +- reference/unordered_set/unordered_set/op_not_equal.md | 2 +- reference/unordered_set/unordered_set/swap.md | 2 +- reference/unordered_set/unordered_set/swap_free.md | 2 +- 75 files changed, 76 insertions(+), 75 deletions(-) diff --git a/reference/unordered_map/unordered_map.md b/reference/unordered_map/unordered_map.md index b27d92e792..4c0fd21508 100644 --- a/reference/unordered_map/unordered_map.md +++ b/reference/unordered_map/unordered_map.md @@ -263,7 +263,7 @@ int main() * um["5th"][link unordered_map/op_at.md] -### 出力 +### 出力例 ``` {2nd,2}, {3rd,3}, {1st,1}, 3rd:3 diff --git a/reference/unordered_map/unordered_map/cend.md b/reference/unordered_map/unordered_map/cend.md index f3548921ce..29a7e04049 100644 --- a/reference/unordered_map/unordered_map/cend.md +++ b/reference/unordered_map/unordered_map/cend.md @@ -53,7 +53,7 @@ int main() * cend()[color ff0000] * cbegin()[link cbegin.md] -### 出力 +### 出力例 ``` {3rd,3}, {2nd,2}, {1st,1}, ``` diff --git a/reference/unordered_map/unordered_map/emplace.md b/reference/unordered_map/unordered_map/emplace.md index 27a530c7b4..29f2e2fba7 100644 --- a/reference/unordered_map/unordered_map/emplace.md +++ b/reference/unordered_map/unordered_map/emplace.md @@ -111,7 +111,7 @@ int main() * um.cbegin()[link cbegin.md] * um.cend()[link cend.md] -### 出力 +### 出力例 ``` {e,(2.71828,0)} true {pi,(3.14159,0)} true diff --git a/reference/unordered_map/unordered_map/emplace_hint.md b/reference/unordered_map/unordered_map/emplace_hint.md index a571d60b30..289478d662 100644 --- a/reference/unordered_map/unordered_map/emplace_hint.md +++ b/reference/unordered_map/unordered_map/emplace_hint.md @@ -111,7 +111,7 @@ int main() * um.cend()[link cend.md] * std::piecewise_construct[link /reference/utility/piecewise_construct_t.md] -### 出力 +### 出力例 ``` {e,(2.71828,0)} at 0 {pi,(3.14159,0)} at 0 diff --git a/reference/unordered_map/unordered_map/end.md b/reference/unordered_map/unordered_map/end.md index a4ee7158ce..97b7ba066e 100644 --- a/reference/unordered_map/unordered_map/end.md +++ b/reference/unordered_map/unordered_map/end.md @@ -59,7 +59,7 @@ int main() * end()[color ff0000] * begin()[link begin.md] -### 出力 +### 出力例 ``` {3rd,3}, {2nd,2}, {1st,1}, {3rd,3}, {2nd,2}, {1st,1}, diff --git a/reference/unordered_map/unordered_map/equal_range.md b/reference/unordered_map/unordered_map/equal_range.md index 2d27455587..04c3e72976 100644 --- a/reference/unordered_map/unordered_map/equal_range.md +++ b/reference/unordered_map/unordered_map/equal_range.md @@ -90,7 +90,7 @@ int main() * um.insert[link insert.md] * um.end()[link end.md] -### 出力 +### 出力例 ``` low: 3 c up: 4 d diff --git a/reference/unordered_map/unordered_map/extract.md b/reference/unordered_map/unordered_map/extract.md index 21454290ed..2f907d40ae 100644 --- a/reference/unordered_map/unordered_map/extract.md +++ b/reference/unordered_map/unordered_map/extract.md @@ -67,7 +67,7 @@ int main() * key[link /reference/node_handle/node_handle/key.md] -### 出力 +### 出力例 ``` m1 : [15, a] diff --git a/reference/unordered_map/unordered_map/insert.md b/reference/unordered_map/unordered_map/insert.md index 6149b4f857..e0283c3195 100644 --- a/reference/unordered_map/unordered_map/insert.md +++ b/reference/unordered_map/unordered_map/insert.md @@ -220,7 +220,7 @@ int main() * fl.cbegin()[link /reference/forward_list/forward_list/cbegin.md] * fl.cend()[link /reference/forward_list/forward_list/cend.md] -### 出力 +### 出力例 ``` true (6,6th) false (2,two) insert one element : (6,6th), (5,five), (4,four), (3,three), (2,two), (1,one), (0,zero), diff --git a/reference/unordered_map/unordered_map/insert_range.md b/reference/unordered_map/unordered_map/insert_range.md index 955631bfe9..00082d60e3 100644 --- a/reference/unordered_map/unordered_map/insert_range.md +++ b/reference/unordered_map/unordered_map/insert_range.md @@ -57,7 +57,7 @@ int main () ``` * insert_range[color ff0000] -### 出力 +### 出力例 ``` C 12 B 11 diff --git a/reference/unordered_map/unordered_map/merge.md b/reference/unordered_map/unordered_map/merge.md index 68c2de140c..7bbd0083e6 100644 --- a/reference/unordered_map/unordered_map/merge.md +++ b/reference/unordered_map/unordered_map/merge.md @@ -68,7 +68,7 @@ int main() ``` * merge[color ff0000] -### 出力 +### 出力例 ``` m1 : [10, a] diff --git a/reference/unordered_map/unordered_map/swap.md b/reference/unordered_map/unordered_map/swap.md index 00137baf23..80462716a3 100644 --- a/reference/unordered_map/unordered_map/swap.md +++ b/reference/unordered_map/unordered_map/swap.md @@ -83,7 +83,7 @@ int main() * c.cbegin()[link cbegin.md] * c.cend()[link cend.md] -### 出力 +### 出力例 ``` um1 before : (9th, 9), (7th, 7), (5th, 5), (3rd, 3), (1st, 1), um2 before : (8th, 8), (4th, 4), (6th, 6), (2nd, 2), (0th, 0), diff --git a/reference/unordered_map/unordered_map/swap_free.md b/reference/unordered_map/unordered_map/swap_free.md index 135fad75bb..198cc2f4c5 100644 --- a/reference/unordered_map/unordered_map/swap_free.md +++ b/reference/unordered_map/unordered_map/swap_free.md @@ -75,7 +75,7 @@ int main() * std::swap[color ff0000] * insert[link insert.md] -### 出力 +### 出力例 ``` um1 : {[5,d], [15,e], } um2 : {[10,a], [20,b], [30,c], } diff --git a/reference/unordered_map/unordered_multimap.md b/reference/unordered_map/unordered_multimap.md index e30b470349..4d24af986c 100644 --- a/reference/unordered_map/unordered_multimap.md +++ b/reference/unordered_map/unordered_multimap.md @@ -245,7 +245,7 @@ int main() * um.erase[link unordered_multimap/erase.md] -### 出力 +### 出力例 ``` {1st,1}, {3rd,3}, {2nd,2}, {4th,4}, {1st,1}, {3rd,3}, {2nd,2}, diff --git a/reference/unordered_map/unordered_multimap/bucket.md b/reference/unordered_map/unordered_multimap/bucket.md index a4e16b2616..245a20b5e4 100644 --- a/reference/unordered_map/unordered_multimap/bucket.md +++ b/reference/unordered_map/unordered_multimap/bucket.md @@ -83,7 +83,7 @@ int main() * um.bucket_count()[link bucket_count.md] * um.bucket_size[link bucket_size.md] -### 出力 +### 出力例 ``` bucket_count() = 11 key = E, bucket = 3, bucket_size = 1 diff --git a/reference/unordered_map/unordered_multimap/bucket_size.md b/reference/unordered_map/unordered_multimap/bucket_size.md index cc36c77433..5488d668a8 100644 --- a/reference/unordered_map/unordered_multimap/bucket_size.md +++ b/reference/unordered_map/unordered_multimap/bucket_size.md @@ -62,7 +62,7 @@ int main() * um.cbegin[link cbegin-size_type.md] * um.cend[link cend-size_type.md] -### 出力 +### 出力例 ``` bucket_count() = 11 bucket = 0, bucket_size = 1, keys = { B, } diff --git a/reference/unordered_map/unordered_multimap/cbegin.md b/reference/unordered_map/unordered_multimap/cbegin.md index 4d7ffc104c..1e74cab432 100644 --- a/reference/unordered_map/unordered_multimap/cbegin.md +++ b/reference/unordered_map/unordered_multimap/cbegin.md @@ -49,7 +49,7 @@ int main() * cbegin()[color ff0000] * cend()[link cend.md] -### 出力 +### 出力例 ``` {3rd,3}, {1st,1}, {2nd,2}, ``` diff --git a/reference/unordered_map/unordered_multimap/emplace.md b/reference/unordered_map/unordered_multimap/emplace.md index 3ebd5d241b..a82e8787c9 100644 --- a/reference/unordered_map/unordered_multimap/emplace.md +++ b/reference/unordered_map/unordered_multimap/emplace.md @@ -101,7 +101,7 @@ int main() * um.cbegin[link cbegin.md] * um.cend[link cend.md] -### 出力 +### 出力例 ``` (1,1st) (2,2nd) diff --git a/reference/unordered_map/unordered_multimap/emplace_hint.md b/reference/unordered_map/unordered_multimap/emplace_hint.md index 70a1059f59..22c0e95437 100644 --- a/reference/unordered_map/unordered_multimap/emplace_hint.md +++ b/reference/unordered_map/unordered_multimap/emplace_hint.md @@ -125,7 +125,7 @@ int main() * um.cend[link cend.md] * um.equal_range[link equal_range.md] -### 出力 +### 出力例 - libstdc++ の出力例(4.7.3 現在) 追加した要素 (1,4th) はヒントを無視して (1,2nd) と (1,1st) よりも前に追加されている。 diff --git a/reference/unordered_map/unordered_multimap/equal_range.md b/reference/unordered_map/unordered_multimap/equal_range.md index 6799c93684..605189fbb8 100644 --- a/reference/unordered_map/unordered_multimap/equal_range.md +++ b/reference/unordered_map/unordered_multimap/equal_range.md @@ -92,7 +92,7 @@ int main() * um.insert[link insert.md] * um.end()[link end.md] -### 出力 +### 出力例 ``` --- ret a diff --git a/reference/unordered_map/unordered_multimap/extract.md b/reference/unordered_map/unordered_multimap/extract.md index 9c2bcd1661..75a371680a 100644 --- a/reference/unordered_map/unordered_multimap/extract.md +++ b/reference/unordered_map/unordered_multimap/extract.md @@ -67,7 +67,7 @@ int main() * key[link /reference/node_handle/node_handle/key.md] -### 出力 +### 出力例 ``` m1 : [15, c] @@ -77,6 +77,7 @@ m2 : [10, a] ``` + ## バージョン ### 言語 - C++17 diff --git a/reference/unordered_map/unordered_multimap/insert.md b/reference/unordered_map/unordered_multimap/insert.md index fd2dd08f58..f537e665eb 100644 --- a/reference/unordered_map/unordered_multimap/insert.md +++ b/reference/unordered_map/unordered_multimap/insert.md @@ -209,7 +209,7 @@ int main() * fl.cbegin()[link /reference/forward_list/forward_list/cbegin.md] * fl.cend()[link /reference/forward_list/forward_list/cend.md] -### 出力 +### 出力例 ``` (6,6th) (2,2nd) insert one element : (6,6th), (5,five), (4,four), (3,three), (2,2nd), (2,two), (1,one), (0,zero), diff --git a/reference/unordered_map/unordered_multimap/insert_range.md b/reference/unordered_map/unordered_multimap/insert_range.md index b63190f407..3aacccda91 100644 --- a/reference/unordered_map/unordered_multimap/insert_range.md +++ b/reference/unordered_map/unordered_multimap/insert_range.md @@ -57,7 +57,7 @@ int main () ``` * insert_range[color ff0000] -### 出力 +### 出力例 ``` C 12 B 11 diff --git a/reference/unordered_map/unordered_multimap/merge.md b/reference/unordered_map/unordered_multimap/merge.md index 3e57d7b00f..35ff96846a 100644 --- a/reference/unordered_map/unordered_multimap/merge.md +++ b/reference/unordered_map/unordered_multimap/merge.md @@ -67,7 +67,7 @@ int main() ``` * merge[color ff0000] -### 出力 +### 出力例 ``` m1 : diff --git a/reference/unordered_map/unordered_multimap/swap.md b/reference/unordered_map/unordered_multimap/swap.md index e34e8782a6..509a43bf63 100644 --- a/reference/unordered_map/unordered_multimap/swap.md +++ b/reference/unordered_map/unordered_multimap/swap.md @@ -83,7 +83,7 @@ int main() * c.cbegin()[link cbegin.md] * c.cend()[link cend.md] -### 出力 +### 出力例 ``` um1 before : (7th, 7), (7th, 7), (5th, 5), (5th, 5), (9th, 9), (9th, 9), (3rd, 3), (3rd, 3), (1st, 1), (1st, 1), um2 before : (8th, 8), (8th, 8), (6th, 6), (6th, 6), (4th, 4), (4th, 4), (2nd, 2), (2nd, 2), (0th, 0), (0th, 0), diff --git a/reference/unordered_map/unordered_multimap/swap_free.md b/reference/unordered_map/unordered_multimap/swap_free.md index 0b088bdd5f..9ad6bc6fea 100644 --- a/reference/unordered_map/unordered_multimap/swap_free.md +++ b/reference/unordered_map/unordered_multimap/swap_free.md @@ -76,7 +76,7 @@ int main() * std::swap[color ff0000] * insert[link insert.md] -### 出力 +### 出力例 ``` um1 : {[5,d], [15,e], } um2 : {[10,a], [20,b], [30,c], [30,d], [30,e], } diff --git a/reference/unordered_set/unordered_multiset.md b/reference/unordered_set/unordered_multiset.md index 811a4030cf..7443af5038 100644 --- a/reference/unordered_set/unordered_multiset.md +++ b/reference/unordered_set/unordered_multiset.md @@ -236,7 +236,7 @@ int main() * ums.insert[link unordered_multiset/insert.md] * ums.erase[link unordered_multiset/erase.md] -### 出力 +### 出力例 ``` 3rd element, 1st element, 2nd element, 4th element, 3rd element, 1st element, 2nd element, 2nd element, diff --git a/reference/unordered_set/unordered_multiset/begin-size_type.md b/reference/unordered_set/unordered_multiset/begin-size_type.md index 356976774b..4c87c781ea 100644 --- a/reference/unordered_set/unordered_multiset/begin-size_type.md +++ b/reference/unordered_set/unordered_multiset/begin-size_type.md @@ -62,7 +62,7 @@ int main() * ums.bucket_size[link bucket_size.md] * end[link end-size_type.md] -### 出力 +### 出力例 ``` bucket_count() = 11 bucket = 0, bucket_size = 0, keys = { } diff --git a/reference/unordered_set/unordered_multiset/bucket.md b/reference/unordered_set/unordered_multiset/bucket.md index 165c9ec600..acb395f925 100644 --- a/reference/unordered_set/unordered_multiset/bucket.md +++ b/reference/unordered_set/unordered_multiset/bucket.md @@ -77,7 +77,7 @@ int main() * ums.bucket_count()[link bucket_count.md] * ums.bucket_size[link bucket_size.md] -### 出力 +### 出力例 ``` bucket_count() = 11 key = E, bucket = 6, bucket_size = 2 diff --git a/reference/unordered_set/unordered_multiset/bucket_size.md b/reference/unordered_set/unordered_multiset/bucket_size.md index 161dec736e..aa5c29e40f 100644 --- a/reference/unordered_set/unordered_multiset/bucket_size.md +++ b/reference/unordered_set/unordered_multiset/bucket_size.md @@ -53,7 +53,7 @@ int main() * ums.cbegin[link cbegin-size_type.md] * ums.cend[link cend-size_type.md] -### 出力 +### 出力例 ``` bucket_count() = 11 bucket = 0, bucket_size = 0, keys = { } diff --git a/reference/unordered_set/unordered_multiset/cbegin-size_type.md b/reference/unordered_set/unordered_multiset/cbegin-size_type.md index fb5ce0ff8e..a2fbc994b7 100644 --- a/reference/unordered_set/unordered_multiset/cbegin-size_type.md +++ b/reference/unordered_set/unordered_multiset/cbegin-size_type.md @@ -55,7 +55,7 @@ int main() * ums.bucket_size[link bucket_size.md] * ums.cend[link cend-size_type.md] -### 出力 +### 出力例 ``` bucket_count() = 11 bucket = 0, bucket_size = 0, keys = { } diff --git a/reference/unordered_set/unordered_multiset/cbegin.md b/reference/unordered_set/unordered_multiset/cbegin.md index 3e533ede78..b8965faeb1 100644 --- a/reference/unordered_set/unordered_multiset/cbegin.md +++ b/reference/unordered_set/unordered_multiset/cbegin.md @@ -45,7 +45,7 @@ int main() * cbegin()[color ff0000] * ums.cend()[link cend.md] -### 出力 +### 出力例 ``` 3 3 2 2 1 1 ``` diff --git a/reference/unordered_set/unordered_multiset/cend-size_type.md b/reference/unordered_set/unordered_multiset/cend-size_type.md index e2e17b6339..1ad1045aec 100644 --- a/reference/unordered_set/unordered_multiset/cend-size_type.md +++ b/reference/unordered_set/unordered_multiset/cend-size_type.md @@ -55,7 +55,7 @@ int main() * ums.bucket_size[link bucket_size.md] * ums.cbegin[link cbegin-size_type.md] -### 出力 +### 出力例 ``` bucket_count() = 11 bucket = 0, bucket_size = 0, keys = { } diff --git a/reference/unordered_set/unordered_multiset/cend.md b/reference/unordered_set/unordered_multiset/cend.md index 0aeb59be98..f35d69295c 100644 --- a/reference/unordered_set/unordered_multiset/cend.md +++ b/reference/unordered_set/unordered_multiset/cend.md @@ -45,7 +45,7 @@ int main() * cend()[color ff0000] * ums.cbegin()[link cbegin.md] -### 出力 +### 出力例 ``` 3 3 2 2 1 1 ``` diff --git a/reference/unordered_set/unordered_multiset/count.md b/reference/unordered_set/unordered_multiset/count.md index 84d7aeb983..3acc615510 100644 --- a/reference/unordered_set/unordered_multiset/count.md +++ b/reference/unordered_set/unordered_multiset/count.md @@ -67,7 +67,7 @@ int main() * ums.begin()[link begin.md] * ums.end()[link end.md] -### 出力 +### 出力例 ``` 9, 9, 7, 7, 5, 5, 3, 3, 1, 1, count of 5:2 diff --git a/reference/unordered_set/unordered_multiset/emplace_hint.md b/reference/unordered_set/unordered_multiset/emplace_hint.md index e6e4f681b5..4ec02bcea1 100644 --- a/reference/unordered_set/unordered_multiset/emplace_hint.md +++ b/reference/unordered_set/unordered_multiset/emplace_hint.md @@ -139,7 +139,7 @@ int main() * ums.cend()[link cend.md] * ums.equal_range[link equal_range.md] -### 出力 +### 出力例 - libstdc++ の出力例(4.7.3 現在) 追加した要素 (1,4th) はヒントを無視して (1,2nd) と (1,1st) よりも前に追加されている。 diff --git a/reference/unordered_set/unordered_multiset/end-size_type.md b/reference/unordered_set/unordered_multiset/end-size_type.md index e69d99f5b8..e29c963c15 100644 --- a/reference/unordered_set/unordered_multiset/end-size_type.md +++ b/reference/unordered_set/unordered_multiset/end-size_type.md @@ -62,7 +62,7 @@ int main() * ums.bucket_size[link bucket_size.md] * ums.begin[link begin-size_type.md] -### 出力 +### 出力例 ``` bucket_count() = 11 bucket = 0, bucket_size = 0, keys = { } diff --git a/reference/unordered_set/unordered_multiset/end.md b/reference/unordered_set/unordered_multiset/end.md index 873156ec08..7871a16ede 100644 --- a/reference/unordered_set/unordered_multiset/end.md +++ b/reference/unordered_set/unordered_multiset/end.md @@ -56,7 +56,7 @@ int main() * end()[color ff0000] * begin()[link begin.md] -### 出力 +### 出力例 ``` 3 3 2 2 1 1 1 1 2 2 3 3 diff --git a/reference/unordered_set/unordered_multiset/equal_range.md b/reference/unordered_set/unordered_multiset/equal_range.md index cd8db748b8..25651abb0d 100644 --- a/reference/unordered_set/unordered_multiset/equal_range.md +++ b/reference/unordered_set/unordered_multiset/equal_range.md @@ -84,7 +84,7 @@ int main() * first[link /reference/utility/pair/first.md] * second[link /reference/utility/pair/second.md] -### 出力 +### 出力例 ``` 9, 9, 7, 7, 5, 5, 1, 1, 3, 3, equal_range(5): [4, 6) diff --git a/reference/unordered_set/unordered_multiset/extract.md b/reference/unordered_set/unordered_multiset/extract.md index 3788267b37..8d97b5ae85 100644 --- a/reference/unordered_set/unordered_multiset/extract.md +++ b/reference/unordered_set/unordered_multiset/extract.md @@ -112,7 +112,7 @@ int main() * value[link /reference/node_handle/node_handle/value.md] -### 出力 +### 出力例 ``` s1 = { 15 } s2 = { 3, 1 } diff --git a/reference/unordered_set/unordered_multiset/find.md b/reference/unordered_set/unordered_multiset/find.md index 4c3809a4a0..92fbd7d2fa 100644 --- a/reference/unordered_set/unordered_multiset/find.md +++ b/reference/unordered_set/unordered_multiset/find.md @@ -77,7 +77,7 @@ int main() * ums.begin()[link begin.md] * ums.end()[link end.md] -### 出力 +### 出力例 ``` 9, 9, 7, 7, 5, 5, 1, 1, 3, 3, found 5 at 4 diff --git a/reference/unordered_set/unordered_multiset/hash_function.md b/reference/unordered_set/unordered_multiset/hash_function.md index f5c5335827..9728be4be8 100644 --- a/reference/unordered_set/unordered_multiset/hash_function.md +++ b/reference/unordered_set/unordered_multiset/hash_function.md @@ -52,7 +52,7 @@ int main() ``` * hash_function()[color ff0000] -### 出力 +### 出力例 ``` hash(1) = 1 hash(2) = 2 diff --git a/reference/unordered_set/unordered_multiset/insert.md b/reference/unordered_set/unordered_multiset/insert.md index 37e09aecb6..5abaf25734 100644 --- a/reference/unordered_set/unordered_multiset/insert.md +++ b/reference/unordered_set/unordered_multiset/insert.md @@ -163,7 +163,7 @@ int main() * fl.cbegin()[link /reference/forward_list/forward_list/cbegin.md] * fl.cend()[link /reference/forward_list/forward_list/cend.md] -### 出力 +### 出力例 ``` 6 2 insert one element : 6 5 5 4 4 3 3 2 2 2 1 1 0 0 diff --git a/reference/unordered_set/unordered_multiset/insert_range.md b/reference/unordered_set/unordered_multiset/insert_range.md index 4a194ac8ba..85efcb9536 100644 --- a/reference/unordered_set/unordered_multiset/insert_range.md +++ b/reference/unordered_set/unordered_multiset/insert_range.md @@ -57,7 +57,7 @@ int main () ``` * insert_range[color ff0000] -### 出力 +### 出力例 ``` 4 3 3 2 2 1 ``` diff --git a/reference/unordered_set/unordered_multiset/load_factor.md b/reference/unordered_set/unordered_multiset/load_factor.md index 55a2171da9..a40667b63e 100644 --- a/reference/unordered_set/unordered_multiset/load_factor.md +++ b/reference/unordered_set/unordered_multiset/load_factor.md @@ -64,7 +64,7 @@ int main() * c.bucket_count()[link bucket_count.md] * ums.insert[link insert.md] -### 出力 +### 出力例 ``` 9, 9, 7, 7, 5, 5, 1, 1, 3, 3, size is 10, bucket_count is 11, load_factor is 0.909091 diff --git a/reference/unordered_set/unordered_multiset/max_load_factor.md b/reference/unordered_set/unordered_multiset/max_load_factor.md index ad26692c1d..6ed4177f4f 100644 --- a/reference/unordered_set/unordered_multiset/max_load_factor.md +++ b/reference/unordered_set/unordered_multiset/max_load_factor.md @@ -103,7 +103,7 @@ int main() * load_factor()[link load_factor.md] * ums.emplace[link emplace.md] -### 出力 +### 出力例 libstdc++ の出力例(4.7.2 現在) - [`load_factor`](load_factor.md)`() > z` の場合に、`max_load_factor()` に `z` を設定して [`load_factor`](load_factor.md)`() < max_load_factor()` となるようにリハッシュされている。 diff --git a/reference/unordered_set/unordered_multiset/merge.md b/reference/unordered_set/unordered_multiset/merge.md index 2f8258fd48..ba160b79ef 100644 --- a/reference/unordered_set/unordered_multiset/merge.md +++ b/reference/unordered_set/unordered_multiset/merge.md @@ -65,7 +65,7 @@ int main() ``` * merge[color ff0000] -### 出力 +### 出力例 ``` s1 = {} s2 = { 10, 10, 20, 30 } diff --git a/reference/unordered_set/unordered_multiset/op_equal.md b/reference/unordered_set/unordered_multiset/op_equal.md index 3a3d2321df..a63e431e7c 100644 --- a/reference/unordered_set/unordered_multiset/op_equal.md +++ b/reference/unordered_set/unordered_multiset/op_equal.md @@ -76,7 +76,7 @@ int main() ``` * std::ostream[link /reference/ostream/basic_ostream.md] -### 出力 +### 出力例 ``` ums1:3, 3, 2, 2, 1, 1, ums2:6, 6, 5, 5, 4, 4, diff --git a/reference/unordered_set/unordered_multiset/op_not_equal.md b/reference/unordered_set/unordered_multiset/op_not_equal.md index 1e89a57ba2..48525fd556 100644 --- a/reference/unordered_set/unordered_multiset/op_not_equal.md +++ b/reference/unordered_set/unordered_multiset/op_not_equal.md @@ -77,7 +77,7 @@ int main() ``` * std::ostream[link /reference/ostream/basic_ostream.md] -### 出力 +### 出力例 ``` ums1:3, 3, 2, 2, 1, 1, ums2:6, 6, 5, 5, 4, 4, diff --git a/reference/unordered_set/unordered_multiset/swap.md b/reference/unordered_set/unordered_multiset/swap.md index a3343d264f..eff448a80d 100644 --- a/reference/unordered_set/unordered_multiset/swap.md +++ b/reference/unordered_set/unordered_multiset/swap.md @@ -80,7 +80,7 @@ int main() * swap[color ff0000] * std::ostream[link /reference/ostream/basic_ostream.md] -### 出力 +### 出力例 ``` ums1 before : 9 9 7 7 5 5 1 1 3 3 ums2 before : 8 8 6 6 4 4 0 0 2 2 diff --git a/reference/unordered_set/unordered_multiset/swap_free.md b/reference/unordered_set/unordered_multiset/swap_free.md index 9394b34181..24ec6eb72d 100644 --- a/reference/unordered_set/unordered_multiset/swap_free.md +++ b/reference/unordered_set/unordered_multiset/swap_free.md @@ -60,7 +60,7 @@ int main() * swap[color ff0000] * std::ostream[link /reference/ostream/basic_ostream.md] -### 出力 +### 出力例 ``` ums1 before:3, 3, 2, 2, 1, 1, ums2 before:6, 6, 5, 5, 4, 4, diff --git a/reference/unordered_set/unordered_set.md b/reference/unordered_set/unordered_set.md index 6bf31d6ca3..d4fcb8bb0c 100644 --- a/reference/unordered_set/unordered_set.md +++ b/reference/unordered_set/unordered_set.md @@ -244,7 +244,7 @@ int main() * us.emplace[link unordered_set/emplace.md] * us.erase[link unordered_set/erase.md] -### 出力 +### 出力例 ``` 3rd element, 2nd element, 1st element, 4th element, 3rd element, 2nd element, 1st element, diff --git a/reference/unordered_set/unordered_set/begin-size_type.md b/reference/unordered_set/unordered_set/begin-size_type.md index eb8e71811a..2a0f00a7ea 100644 --- a/reference/unordered_set/unordered_set/begin-size_type.md +++ b/reference/unordered_set/unordered_set/begin-size_type.md @@ -62,7 +62,7 @@ int main() * us.bucket_size[link bucket_size.md] * end[link end-size_type.md] -### 出力 +### 出力例 ``` bucket_count() = 5 bucket = 0, bucket_size = 1, keys = { E, } diff --git a/reference/unordered_set/unordered_set/begin.md b/reference/unordered_set/unordered_set/begin.md index c8e71b91a7..a0a5ea36f7 100644 --- a/reference/unordered_set/unordered_set/begin.md +++ b/reference/unordered_set/unordered_set/begin.md @@ -56,7 +56,7 @@ int main() * begin()[color ff0000] * end()[link end.md] -### 出力 +### 出力例 ``` 3, 2, 1, 1, 2, 3, diff --git a/reference/unordered_set/unordered_set/bucket.md b/reference/unordered_set/unordered_set/bucket.md index a7d2700cb2..31b1828818 100644 --- a/reference/unordered_set/unordered_set/bucket.md +++ b/reference/unordered_set/unordered_set/bucket.md @@ -77,7 +77,7 @@ int main() * us.bucket_count()[link bucket_count.md] * us.bucket_size[link bucket_size.md] -### 出力 +### 出力例 ``` bucket_count() = 5 key = E, bucket = 0, bucket_size = 1 diff --git a/reference/unordered_set/unordered_set/bucket_size.md b/reference/unordered_set/unordered_set/bucket_size.md index ea42655f41..8175673c52 100644 --- a/reference/unordered_set/unordered_set/bucket_size.md +++ b/reference/unordered_set/unordered_set/bucket_size.md @@ -53,7 +53,7 @@ int main() * us.cbegin[link cbegin-size_type.md] * us.cend[link cend-size_type.md] -### 出力 +### 出力例 ``` bucket_count() = 5 bucket = 0, bucket_size = 1, keys = { E, } diff --git a/reference/unordered_set/unordered_set/cbegin-size_type.md b/reference/unordered_set/unordered_set/cbegin-size_type.md index 1be7875716..9df15be329 100644 --- a/reference/unordered_set/unordered_set/cbegin-size_type.md +++ b/reference/unordered_set/unordered_set/cbegin-size_type.md @@ -55,7 +55,7 @@ int main() * us.bucket_size[link bucket_size.md] * us.cend[link cend-size_type.md] -### 出力 +### 出力例 ``` bucket_count() = 5 bucket = 0, bucket_size = 1, keys = { E, } diff --git a/reference/unordered_set/unordered_set/cend-size_type.md b/reference/unordered_set/unordered_set/cend-size_type.md index 74575bbec1..9586e16011 100644 --- a/reference/unordered_set/unordered_set/cend-size_type.md +++ b/reference/unordered_set/unordered_set/cend-size_type.md @@ -55,7 +55,7 @@ int main() * us.bucket_size[link bucket_size.md] * us.cbegin[link cbegin-size_type.md] -### 出力 +### 出力例 ``` bucket_count() = 5 bucket = 0, bucket_size = 1, keys = { E, } diff --git a/reference/unordered_set/unordered_set/cend.md b/reference/unordered_set/unordered_set/cend.md index bd28fd4ed4..7d73bafd15 100644 --- a/reference/unordered_set/unordered_set/cend.md +++ b/reference/unordered_set/unordered_set/cend.md @@ -45,7 +45,7 @@ int main() * cend()[color ff0000] * us.cbegin()[link cbegin.md] -### 出力 +### 出力例 ``` 3, 2, 1, ``` diff --git a/reference/unordered_set/unordered_set/count.md b/reference/unordered_set/unordered_set/count.md index 5374612fde..3e4c367ea4 100644 --- a/reference/unordered_set/unordered_set/count.md +++ b/reference/unordered_set/unordered_set/count.md @@ -67,7 +67,7 @@ int main() * us.begin()[link begin.md] * us.end()[link end.md] -### 出力 +### 出力例 ``` 9, 7, 5, 3, 1, count of 5:1 diff --git a/reference/unordered_set/unordered_set/emplace_hint.md b/reference/unordered_set/unordered_set/emplace_hint.md index 8a4e2442e1..1b5f329e7b 100644 --- a/reference/unordered_set/unordered_set/emplace_hint.md +++ b/reference/unordered_set/unordered_set/emplace_hint.md @@ -129,7 +129,7 @@ int main() * us.cbegin()[link cbegin.md] * us.cend()[link cend.md] -### 出力 +### 出力例 ``` (3,3rd), (2,2nd), (1,1st), (4,4th) diff --git a/reference/unordered_set/unordered_set/end-size_type.md b/reference/unordered_set/unordered_set/end-size_type.md index 2305a3af30..74ce0eeebd 100644 --- a/reference/unordered_set/unordered_set/end-size_type.md +++ b/reference/unordered_set/unordered_set/end-size_type.md @@ -62,7 +62,7 @@ int main() * us.bucket_size[link bucket_size.md] * us.begin[link begin-size_type.md] -### 出力 +### 出力例 ``` bucket_count() = 5 bucket = 0, bucket_size = 1, keys = { E, } diff --git a/reference/unordered_set/unordered_set/end.md b/reference/unordered_set/unordered_set/end.md index 5ea69f1cff..cd0a4e2688 100644 --- a/reference/unordered_set/unordered_set/end.md +++ b/reference/unordered_set/unordered_set/end.md @@ -56,7 +56,7 @@ int main() * end()[color ff0000] * begin()[link begin.md] -### 出力 +### 出力例 ``` 3, 2, 1, 1, 2, 3, diff --git a/reference/unordered_set/unordered_set/equal_range.md b/reference/unordered_set/unordered_set/equal_range.md index 1bf6251e6b..e1537e9bdc 100644 --- a/reference/unordered_set/unordered_set/equal_range.md +++ b/reference/unordered_set/unordered_set/equal_range.md @@ -86,7 +86,7 @@ int main() * first[link /reference/utility/pair/first.md] * second[link /reference/utility/pair/second.md] -### 出力 +### 出力例 ``` 9, 7, 5, 3, 1, equal_range(5): [2, 3) diff --git a/reference/unordered_set/unordered_set/extract.md b/reference/unordered_set/unordered_set/extract.md index 06a6126d77..344fbaee9b 100644 --- a/reference/unordered_set/unordered_set/extract.md +++ b/reference/unordered_set/unordered_set/extract.md @@ -112,7 +112,7 @@ int main() * value[link /reference/node_handle/node_handle/value.md] -### 出力 +### 出力例 ``` s1 = { 15 } s2 = { 3, 2 } diff --git a/reference/unordered_set/unordered_set/find.md b/reference/unordered_set/unordered_set/find.md index 50e36f60be..77923eee23 100644 --- a/reference/unordered_set/unordered_set/find.md +++ b/reference/unordered_set/unordered_set/find.md @@ -74,7 +74,7 @@ int main() * us.begin()[link begin.md] * us.end()[link end.md] -### 出力 +### 出力例 ``` 9, 7, 5, 3, 1, found 5 at 2 diff --git a/reference/unordered_set/unordered_set/hash_function.md b/reference/unordered_set/unordered_set/hash_function.md index 4512c57774..d3082b57d4 100644 --- a/reference/unordered_set/unordered_set/hash_function.md +++ b/reference/unordered_set/unordered_set/hash_function.md @@ -52,7 +52,7 @@ int main() ``` * hash_function()[color ff0000] -### 出力 +### 出力例 ``` hash(1) = 1 hash(2) = 2 diff --git a/reference/unordered_set/unordered_set/insert.md b/reference/unordered_set/unordered_set/insert.md index 598a102ee8..e59ee0e8aa 100644 --- a/reference/unordered_set/unordered_set/insert.md +++ b/reference/unordered_set/unordered_set/insert.md @@ -208,7 +208,7 @@ int main() * fl.cbegin()[link /reference/forward_list/forward_list/cbegin.md] * fl.cend()[link /reference/forward_list/forward_list/cend.md] -### 出力 +### 出力例 ``` true 6 false 2 insert one element : 6 5 4 3 2 1 0 diff --git a/reference/unordered_set/unordered_set/insert_range.md b/reference/unordered_set/unordered_set/insert_range.md index a91d5a9e03..133dbb95ef 100644 --- a/reference/unordered_set/unordered_set/insert_range.md +++ b/reference/unordered_set/unordered_set/insert_range.md @@ -57,7 +57,7 @@ int main () ``` * insert_range[color ff0000] -### 出力 +### 出力例 ``` 4 3 2 1 ``` diff --git a/reference/unordered_set/unordered_set/load_factor.md b/reference/unordered_set/unordered_set/load_factor.md index a928d1c837..17e22a12ad 100644 --- a/reference/unordered_set/unordered_set/load_factor.md +++ b/reference/unordered_set/unordered_set/load_factor.md @@ -64,7 +64,7 @@ int main() * c.bucket_count()[link bucket_count.md] * us.insert[link insert.md] -### 出力 +### 出力例 ``` 9, 7, 5, 3, 1, size is 5, bucket_count is 5, load_factor is 1 diff --git a/reference/unordered_set/unordered_set/max_load_factor.md b/reference/unordered_set/unordered_set/max_load_factor.md index 3e6ea3cd99..9bdd9508bb 100644 --- a/reference/unordered_set/unordered_set/max_load_factor.md +++ b/reference/unordered_set/unordered_set/max_load_factor.md @@ -103,7 +103,7 @@ int main() * load_factor()[link load_factor.md] * us.emplace[link emplace.md] -### 出力 +### 出力例 libstdc++ の出力例(4.7.2 時点) - [`load_factor`](load_factor.md)`() > z` の場合に、`max_load_factor()` に `z` を設定して [`load_factor`](load_factor.md)`() < max_load_factor()` となるようにリハッシュされている。 diff --git a/reference/unordered_set/unordered_set/merge.md b/reference/unordered_set/unordered_set/merge.md index 4ec3484c90..dfe1913e0d 100644 --- a/reference/unordered_set/unordered_set/merge.md +++ b/reference/unordered_set/unordered_set/merge.md @@ -66,7 +66,7 @@ int main() ``` * merge[color ff0000] -### 出力 +### 出力例 ``` s1 = { 10 } s2 = { 20, 30, 10 } diff --git a/reference/unordered_set/unordered_set/op_equal.md b/reference/unordered_set/unordered_set/op_equal.md index 2e2da83c7e..1c641c8374 100644 --- a/reference/unordered_set/unordered_set/op_equal.md +++ b/reference/unordered_set/unordered_set/op_equal.md @@ -73,7 +73,7 @@ int main() ``` * std::ostream[link /reference/ostream/basic_ostream.md] -### 出力 +### 出力例 ``` us1:3, 2, 1, us2:6, 5, 4, diff --git a/reference/unordered_set/unordered_set/op_not_equal.md b/reference/unordered_set/unordered_set/op_not_equal.md index 72f12373d1..af1f872abf 100644 --- a/reference/unordered_set/unordered_set/op_not_equal.md +++ b/reference/unordered_set/unordered_set/op_not_equal.md @@ -75,7 +75,7 @@ int main() ``` * std::ostream[link /reference/ostream/basic_ostream.md] -### 出力 +### 出力例 ``` us1:3, 2, 1, us2:6, 5, 4, diff --git a/reference/unordered_set/unordered_set/swap.md b/reference/unordered_set/unordered_set/swap.md index 8289488590..3a9132c4bf 100644 --- a/reference/unordered_set/unordered_set/swap.md +++ b/reference/unordered_set/unordered_set/swap.md @@ -80,7 +80,7 @@ int main() * swap[color ff0000] * std::ostream[link /reference/ostream/basic_ostream.md] -### 出力 +### 出力例 ``` us1 before : 9 7 5 3 1 us2 before : 8 6 4 2 0 diff --git a/reference/unordered_set/unordered_set/swap_free.md b/reference/unordered_set/unordered_set/swap_free.md index 708773b280..6626de7152 100644 --- a/reference/unordered_set/unordered_set/swap_free.md +++ b/reference/unordered_set/unordered_set/swap_free.md @@ -60,7 +60,7 @@ int main() * swap[color ff0000] * std::ostream[link /reference/ostream/basic_ostream.md] -### 出力 +### 出力例 ``` us1 before:3, 2, 1, us2 before:6, 5, 4, From 0d693ca347e4ec19fe788e4ea04e5a499662727a Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sat, 18 Oct 2025 19:18:33 +0900 Subject: [PATCH 2420/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BE=8B?= =?UTF-8?q?=E3=81=8B=E3=82=89=E4=B8=8D=E8=A6=81=E3=81=AA=E6=94=B9=E8=A1=8C?= =?UTF-8?q?=E3=81=AE=E5=87=BA=E5=8A=9B=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/memory/no-throw-forward-iterator.md | 2 -- reference/memory/no-throw-input-iterator.md | 2 -- 2 files changed, 4 deletions(-) diff --git a/reference/memory/no-throw-forward-iterator.md b/reference/memory/no-throw-forward-iterator.md index d7589b2f5c..6ed8ad4de1 100644 --- a/reference/memory/no-throw-forward-iterator.md +++ b/reference/memory/no-throw-forward-iterator.md @@ -75,8 +75,6 @@ int main() { f::iterator>("std::list::iterator"); f::iterator>("std::vector::iterator"); f::iterator>("std::vector::iterator"); - - std::cout << "\n"; } ``` * no_throw_forward_iterator[color ff0000] diff --git a/reference/memory/no-throw-input-iterator.md b/reference/memory/no-throw-input-iterator.md index a7a619806a..07f605762a 100644 --- a/reference/memory/no-throw-input-iterator.md +++ b/reference/memory/no-throw-input-iterator.md @@ -66,8 +66,6 @@ int main() { f::iterator>("std::list::iterator"); f::iterator>("std::vector::iterator"); f::iterator>("std::vector::iterator"); - - std::cout << "\n"; } ``` * no_throw_input_iterator[color ff0000] From ca5f1bd3d93939632bc73e8a2960abc838b86b32 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 20 Oct 2025 00:57:04 +0900 Subject: [PATCH 2421/3948] =?UTF-8?q?chrono::year=20:=20=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=89=E4=BE=8B=E3=82=92=E4=BF=AE=E6=AD=A3=E3=81=A8=E5=8B=95?= =?UTF-8?q?=E4=BD=9C=E7=A2=BA=E8=AA=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit コード中のtypoを修正し、修正したコードの動作を確認しました。 --- reference/chrono/year/max.md | 4 ++-- reference/chrono/year/min.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/chrono/year/max.md b/reference/chrono/year/max.md index 3c59569107..0265926f07 100644 --- a/reference/chrono/year/max.md +++ b/reference/chrono/year/max.md @@ -26,7 +26,7 @@ namespace chrono = std::chrono; int main() { - std::cout << chrono::years::max() << std::endl; + std::cout << chrono::year::max() << std::endl; } ``` * max()[color ff0000] @@ -43,5 +43,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): 8.0 [mark verified] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 15.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year/min.md b/reference/chrono/year/min.md index c6326033dc..d82d9f0116 100644 --- a/reference/chrono/year/min.md +++ b/reference/chrono/year/min.md @@ -26,7 +26,7 @@ namespace chrono = std::chrono; int main() { - std::cout << chrono::years::min() << std::endl; + std::cout << chrono::year::min() << std::endl; } ``` * min()[color ff0000] @@ -43,5 +43,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): 8.0 [mark verified] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 15.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] From 5ab35d5744e9292382d9aa78acfdafbefbc57c24 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 20 Oct 2025 01:07:56 +0900 Subject: [PATCH 2422/3948] =?UTF-8?q?chrono::from=5Fstream=20:=20=E5=8A=B9?= =?UTF-8?q?=E6=9E=9C=E3=81=AE=E8=AA=AC=E6=98=8E=E3=81=A8=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=89=E4=BE=8B=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 規格書を見ても「いずれのフラグも`duration`に影響しないものである場合、`d`には値ゼロが代入される」といった趣旨の記述は見つけられませんでした。 実際にGCC 15.1で動作確認を行うと`d`を読み込めない場合は`failbit`が立てられるといった挙動であり、規格書の記述とも一致することから、そちらに説明を変更しました。 また、コード例を修正、動作確認しました。 --- reference/chrono/duration/from_stream.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/reference/chrono/duration/from_stream.md b/reference/chrono/duration/from_stream.md index 52fabc2a87..68620da09d 100644 --- a/reference/chrono/duration/from_stream.md +++ b/reference/chrono/duration/from_stream.md @@ -22,8 +22,8 @@ namespace std::chrono { ## 効果 -- パラメータ`fmt`で指定されたフォーマットフラグを使用して、入力を解析し、`tp`に代入する -- いずれのフラグも`duration`に影響しないものである場合、`d`には値ゼロが代入される +- パラメータ`fmt`で指定されたフォーマットフラグを使用して、入力を解析し、`d`に代入する +- 有効な日付・時間の解析に失敗した場合、`is.`[`setstate`](/reference/ios/basic_ios/setstate.md)`(`[`ios_base::failbit`](/reference/ios/ios_base/type-iostate.md)`)`が呼び出され、パラメータ`d`は変更されない - タイムゾーンフォーマット`"%Z"`が指定され、解析が成功した場合、パラメータ`abbrev`が非ヌルである場合に`*abbrev`にタイムゾーン名が代入される - タイムゾーンとしてUTC時間からのオフセット時間 (日本なら`"+0900"`) を意味するフォーマット`"%z"`が指定され、解析が成功した場合、パラメータ`offset`が非ヌルである場合に`*offset`にその値が代入される @@ -55,12 +55,12 @@ int main() } { std::stringstream ss; - ss << "+0900 JST"; + ss << "0+0900 JST"; chrono::seconds sec{3}; std::string abbrev; chrono::minutes offset{0}; - chrono::from_stream(ss, "%S", sec, &abbrev, &offset); + chrono::from_stream(ss, "%S%z %Z", sec, &abbrev, &offset); std::cout << sec << std::endl; std::cout << abbrev << std::endl; @@ -85,7 +85,7 @@ JST ### 処理系 - [Clang](/implementation.md#clang): 9.0 [mark noimpl] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 15.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] From a7f9e6c676b686678ac8ef419489b163cd9b9be8 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 20 Oct 2025 01:57:23 +0900 Subject: [PATCH 2423/3948] =?UTF-8?q?chrono::parse,=20(sys=20|=20tai=20|?= =?UTF-8?q?=20utc=20|=20file)=5Ftime=20:=20=E3=82=B3=E3=83=BC=E3=83=89?= =?UTF-8?q?=E4=BE=8B=E3=81=A8=E5=87=BA=E5=8A=9B=E3=81=AE=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E3=80=81=E5=8B=95=E4=BD=9C=E7=A2=BA=E8=AA=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit parse や from_stream の %Z には「+」や数字も含められるので、「JST+0900」のような文字列が %Z にヒットします。 %Z と %z で分けて解析したい場合は空白を挟む必要があります。 上記を考慮しコード例を修正し、動作確認を行いました。 動作確認の際に発見したコードや出力の誤りも修正しています。 --- reference/chrono/file_time.md | 19 ++++++++++--------- reference/chrono/parse.md | 8 ++++---- reference/chrono/sys_time.md | 8 ++++---- reference/chrono/tai_time.md | 8 ++++---- reference/chrono/utc_time.md | 10 +++++----- 5 files changed, 27 insertions(+), 26 deletions(-) diff --git a/reference/chrono/file_time.md b/reference/chrono/file_time.md index fa2a1239bb..f8f7933a08 100644 --- a/reference/chrono/file_time.md +++ b/reference/chrono/file_time.md @@ -74,6 +74,7 @@ namespace std { ```cpp example #include #include +#include #include #include @@ -85,7 +86,7 @@ int main() std::ofstream{"regular.txt"}; // ファイルの最終更新日時を取得して出力 - fs::file_time_type tp = fs::last_write_time("regulat.txt"); + fs::file_time_type tp = fs::last_write_time("regular.txt"); std::cout << tp << std::endl; } ``` @@ -94,7 +95,7 @@ int main() #### 出力例 ``` -2019-10-24 11:15:10 UTC +2019-10-24 11:15:10 ``` ### 入力の例 @@ -128,12 +129,12 @@ int main() // タイムゾーンとオフセットを含む入力 { std::stringstream ss; - ss << "2019-10-24 20:15:10 UTC+0900"; + ss << "2019-10-24 20:15:10 UTC +0900"; fs::file_time_type tp; std::string abbrev; chrono::minutes offset{0}; - chrono::from_stream(ss, "%Y-%m-%d %H:%M:%S %Z%z", tp, &abbrev, &offset); + chrono::from_stream(ss, "%Y-%m-%d %H:%M:%S %Z %z", tp, &abbrev, &offset); std::cout << tp << std::endl; std::cout << abbrev << std::endl; @@ -146,8 +147,8 @@ int main() #### 出力例 ``` -2019-10-24 11:15:10 UTC -2019-10-24 11:15:10 UTC +2019-10-24 11:15:10 +2019-10-24 11:15:10 UTC 540 ``` @@ -168,7 +169,7 @@ int main() std::ofstream{"regular.txt"}; // ファイルの最終更新日時を取得して出力 - fs::file_time_type tp = fs::last_write_time("regulat.txt"); + fs::file_time_type tp = fs::last_write_time("regular.txt"); // デフォルトフォーマット std::cout << std::format("1 : {}", tp) << std::endl; @@ -194,7 +195,7 @@ int main() #### 出力例 ``` -1 : 2019-12-20 10:05:00 UTC +1 : 2019-12-20 10:05:00 2 : 2019年12月20日 10時05分05秒 3 : 2019/12/20 10:05:05 4 : 2019年12月20日 @@ -210,7 +211,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): 9.0 [mark noimpl] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 15.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/parse.md b/reference/chrono/parse.md index bde91face7..26b73be1aa 100644 --- a/reference/chrono/parse.md +++ b/reference/chrono/parse.md @@ -80,7 +80,7 @@ namespace std::chrono { | `%y` | 10進数での年のうしろ2桁。世紀が (`%C`などで) 指定されない場合、範囲`[69, 99]`は1969年から1999年を参照し、範囲`[00, 68]`は2000年から2068年を参照する。改良コマンド`%Ny` (Nは10進整数) によって読み込む最大の文字数を指定できる。Nを指定しない場合、デフォルトは2。先頭の0は許可されるが要求はされない。改良コマンド`%Ey`または`%Oy`はロケール依存の異なる表現になる。 | `"20"`
`%Ey`では (元号ベースの下2桁年) `"02"` | | `%Y` | 10進数での年。改良コマンド`%NY` (Nは10進整数) によって読み込む最大の文字数を指定できる。Nを指定しない場合、デフォルトは4。先頭の0は許可されるが要求はされない。改良コマンド`%EY`はロケール依存の異なる表現になる | `"2020"`
`%EY`では`"令和02年"` | | `%z` | `[+|-]hh[mm]`フォーマットでのUTCタイムゾーンからのオフセット時間 (`[ ]`カッコ内は省略可能)。例として`-0430`はUTCから4時間30分遅れていることを表す。 改良コマンド`%Ez`と`%Oz`は、時と分の間にコロン (`:`) が要求され、時の先頭のゼロは省略できる`[+|-]h[h][:mm]`フォーマットとなる。 | `"+0900"`
`%Ez`では`"9"` | -| `%Z` | タイムゾーンの略称。単一の単語を解析する。この単語に含めることができるのは、基本文字集合の英数字または`'_'`, `'/'`, `'-'`, `'+'`の文字のみ。 | `"JST"` | +| `%Z` | タイムゾーンの略称。単一の単語を解析する。この単語に含めることができるのは、基本文字集合の英数字または`'_'`, `'/'`, `'-'`, `'+'`の文字のみ。 | `"JST"`
`"JST+0900"` | | `%%` | 文字`%`を抽出する | `"%"` | @@ -138,12 +138,12 @@ int main() // タイムゾーン情報を含む日時の解析 { std::stringstream ss; - ss << "2019-10-24 20:15:10 JST+0900"; + ss << "2019-10-24 20:15:10 JST +0900"; chrono::sys_seconds tp; std::string abbrev; chrono::minutes offset; - ss >> chrono::parse("%Y-%m-%d %H:%M:%S %Z%z", tp, abbrev, offset); + ss >> chrono::parse("%Y-%m-%d %H:%M:%S %Z %z", tp, abbrev, offset); if (ss) { std::cout << tp << std::endl; @@ -174,7 +174,7 @@ JST ### 処理系 - [Clang](/implementation.md#clang): 9.0 [mark noimpl] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 15.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/sys_time.md b/reference/chrono/sys_time.md index 4002f85f0d..3545fd1406 100644 --- a/reference/chrono/sys_time.md +++ b/reference/chrono/sys_time.md @@ -182,12 +182,12 @@ int main() // タイムゾーンとオフセットを含む入力 { std::stringstream ss; - ss << "2019-10-24 20:15:10 JST+0900"; + ss << "2019-10-24 20:15:10 JST +0900"; chrono::sys_seconds tp; std::string abbrev; chrono::minutes offset{0}; - chrono::from_stream(ss, "%Y-%m-%d %H:%M:%S %Z%z", tp, &abbrev, &offset); + chrono::from_stream(ss, "%Y-%m-%d %H:%M:%S %Z %z", tp, &abbrev, &offset); std::cout << tp << std::endl; std::cout << abbrev << std::endl; @@ -244,7 +244,7 @@ int main() #### 出力例 ``` -1 : 2019-12-20 10:05:05 UTC +1 : 2019-12-20 10:05:05 2 : 2019年12月20日 10時05分05秒 3 : 2019/12/20 10:05:05 UTC 4 : 2019年12月20日 @@ -259,7 +259,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): 8.0 (入出力ストリームなし) [mark verified] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 15.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/tai_time.md b/reference/chrono/tai_time.md index 3dd6fe98bf..1430460a60 100644 --- a/reference/chrono/tai_time.md +++ b/reference/chrono/tai_time.md @@ -104,7 +104,7 @@ int main() #### 出力例 ``` -2019-10-24 11:15:37 TAI +2019-10-24 11:15:37 ``` ### 入力の例 @@ -140,7 +140,7 @@ int main() chrono::tai_seconds tp; std::string abbrev; - chrono::from_stream(ss, "%Y-%m-%d %H:%M:%S %Z%z", tp, &abbrev); + chrono::from_stream(ss, "%Y-%m-%d %H:%M:%S %Z", tp, &abbrev); std::cout << tp << std::endl; std::cout << abbrev << std::endl; @@ -194,7 +194,7 @@ int main() #### 出力例 ``` -1 : 2019-12-20 10:05:05 TAI +1 : 2019-12-20 10:05:05 2 : 2019年12月20日 10時05分05秒 3 : 2019/12/20 10:05:05 TAI 4 : 2019年12月20日 @@ -209,7 +209,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): 9.0 [mark noimpl] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 15.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/utc_time.md b/reference/chrono/utc_time.md index e7e1b656ee..3a108429b2 100644 --- a/reference/chrono/utc_time.md +++ b/reference/chrono/utc_time.md @@ -95,7 +95,7 @@ int main() #### 出力例 ``` -2019-10-24 11:15:10 UTC +2019-10-24 11:15:10 ``` ### 入力の例 @@ -127,12 +127,12 @@ int main() // タイムゾーンとオフセットを含む入力 { std::stringstream ss; - ss << "2019-10-24 20:15:10 UTC+0900"; + ss << "2019-10-24 20:15:10 UTC +0900"; chrono::utc_seconds tp; std::string abbrev; chrono::minutes offset{0}; - chrono::from_stream(ss, "%Y-%m-%d %H:%M:%S %Z%z", tp, &abbrev, &offset); + chrono::from_stream(ss, "%Y-%m-%d %H:%M:%S %Z %z", tp, &abbrev, &offset); std::cout << tp << std::endl; std::cout << abbrev << std::endl; @@ -189,7 +189,7 @@ int main() #### 出力例 ``` -1 : 2019-12-20 10:05:05 UTC +1 : 2019-12-20 10:05:05 2 : 2019年12月20日 10時05分05秒 3 : 2019/12/20 10:05:05 UTC 4 : 2019年12月20日 @@ -204,7 +204,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): 9.0 [mark noimpl] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 15.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] From 0161d80d33358bfc18ae68406cc1811cad547112 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 20 Oct 2025 02:05:17 +0900 Subject: [PATCH 2424/3948] =?UTF-8?q?chrono=20=E3=81=AE=E3=81=84=E3=81=8F?= =?UTF-8?q?=E3=81=A4=E3=81=8B=E3=81=AE=E5=87=BA=E5=8A=9B=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E3=80=81=E5=8B=95=E4=BD=9C=E7=A2=BA=E8=AA=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit コード例の動作確認を行い、記載されている出力と実際の出力が異なるものを修正しました。 --- reference/chrono/choose.md | 4 ++-- reference/chrono/gps_time.md | 6 +++--- reference/chrono/month_weekday.md | 4 ++-- reference/chrono/month_weekday_last.md | 4 ++-- reference/chrono/month_weekday_last/formatter.md | 4 ++-- reference/chrono/tai_clock/from_utc.md | 6 +++--- reference/chrono/tai_clock/to_utc.md | 6 +++--- reference/chrono/utc_clock/from_sys.md | 8 ++++---- reference/chrono/utc_clock/to_sys.md | 8 ++++---- reference/chrono/weekday/c_encoding.md | 16 ++++++++-------- reference/chrono/weekday/iso_encoding.md | 16 ++++++++-------- reference/chrono/year.md | 4 ++-- reference/chrono/year/op_y.md | 3 ++- reference/chrono/year_month_day/formatter.md | 4 ++-- reference/chrono/year_month_day/op_local_days.md | 8 ++++---- reference/chrono/year_month_day_last.md | 4 ++-- .../chrono/year_month_day_last/formatter.md | 4 ++-- .../chrono/year_month_day_last/op_local_days.md | 4 ++-- reference/chrono/year_month_weekday/formatter.md | 8 ++++---- .../chrono/year_month_weekday_last/formatter.md | 8 ++++---- 20 files changed, 65 insertions(+), 64 deletions(-) diff --git a/reference/chrono/choose.md b/reference/chrono/choose.md index da02d5e389..3fc8c3e1f6 100644 --- a/reference/chrono/choose.md +++ b/reference/chrono/choose.md @@ -61,7 +61,7 @@ int main() ### 出力 ``` -2016-11-06 06:30:00 UTC +2016-11-06 06:30:00 ``` ## バージョン @@ -70,7 +70,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): 9.0 [mark noimpl] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 15.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/gps_time.md b/reference/chrono/gps_time.md index c23684dcea..bfeffef1f4 100644 --- a/reference/chrono/gps_time.md +++ b/reference/chrono/gps_time.md @@ -155,8 +155,8 @@ int main() #### 出力 ``` -2019-10-24 20:15:45 -2019-10-24 20:15:45 +2019-10-24 20:15:27 +2019-10-24 20:15:27 GPS ``` @@ -214,7 +214,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): 9.0 [mark noimpl] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 14.1 [mark verified] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 14.1 [mark verified], 15.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month_weekday.md b/reference/chrono/month_weekday.md index 0dd2f1c443..4196c50945 100644 --- a/reference/chrono/month_weekday.md +++ b/reference/chrono/month_weekday.md @@ -132,7 +132,7 @@ Mar/Sun[1] Mar/Sun[1] Mar/Sun[1] Mar/Sun[1] -2020/03/01 +2020-03-01 ``` ## バージョン @@ -141,7 +141,7 @@ Mar/Sun[1] ### 処理系 - [Clang](/implementation.md#clang): 8.0 (出力ストリームなし) [mark verified] -- [GCC](/implementation.md#gcc): 11.1 (出力ストリームなし) [mark verified] +- [GCC](/implementation.md#gcc): 11.1 (出力ストリームなし) [mark verified], 15.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month_weekday_last.md b/reference/chrono/month_weekday_last.md index 0714a04445..32c0f1b587 100644 --- a/reference/chrono/month_weekday_last.md +++ b/reference/chrono/month_weekday_last.md @@ -132,7 +132,7 @@ Mar/Sun[last] Mar/Sun[last] Mar/Sun[last] Mar/Sun[last] -2020/03/29 +2020-03-29 ``` ## バージョン @@ -141,7 +141,7 @@ Mar/Sun[last] ### 処理系 - [Clang](/implementation.md#clang): 8.0 (出力ストリームなし) [mark verified] -- [GCC](/implementation.md#gcc): 11.1 (出力ストリームなし) [mark verified] +- [GCC](/implementation.md#gcc): 11.1 (出力ストリームなし) [mark verified], 15.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/month_weekday_last/formatter.md b/reference/chrono/month_weekday_last/formatter.md index f3e9e5a0e6..85154176e9 100644 --- a/reference/chrono/month_weekday_last/formatter.md +++ b/reference/chrono/month_weekday_last/formatter.md @@ -46,7 +46,7 @@ int main() { ### 出力 ``` -1 : Mar/Sun[1] +1 : Mar/Sun[last] 2 : March, Sunday 3 : 03, Sun 4 : 3月, 日 @@ -59,7 +59,7 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): 9.0 [mark noimpl] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 15.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/tai_clock/from_utc.md b/reference/chrono/tai_clock/from_utc.md index 2422493956..b5b55ab9e2 100644 --- a/reference/chrono/tai_clock/from_utc.md +++ b/reference/chrono/tai_clock/from_utc.md @@ -76,9 +76,9 @@ int main() ### 出力 ``` +2019-10-24 2019-10-24 00:00:00 -2019-10-24 00:00:00 UTC -2019-10-24 00:00:37 TAI +2019-10-24 00:00:37 27 ``` @@ -88,5 +88,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): 9.0 [mark noimpl] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 15.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/tai_clock/to_utc.md b/reference/chrono/tai_clock/to_utc.md index 7a92545660..109d3a95f3 100644 --- a/reference/chrono/tai_clock/to_utc.md +++ b/reference/chrono/tai_clock/to_utc.md @@ -72,8 +72,8 @@ int main() ### 出力 ``` -2019-10-24 00:00:37 TAI -2019-10-24 00:00:00 UTC +2019-10-24 00:00:37 +2019-10-24 00:00:00 27 ``` @@ -83,5 +83,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): 9.0 [mark noimpl] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 15.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/utc_clock/from_sys.md b/reference/chrono/utc_clock/from_sys.md index 0616566200..8727b9426e 100644 --- a/reference/chrono/utc_clock/from_sys.md +++ b/reference/chrono/utc_clock/from_sys.md @@ -55,9 +55,9 @@ int main() ### 出力 ``` -2015-01-01 -2015-01-01 00:00:00 UTC -26 +2015-07-01 +2015-07-01 00:00:00 +26s ``` ## バージョン @@ -66,7 +66,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): 9.0 [mark noimpl] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 15.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/utc_clock/to_sys.md b/reference/chrono/utc_clock/to_sys.md index 36b95c5e4e..f1205d53a0 100644 --- a/reference/chrono/utc_clock/to_sys.md +++ b/reference/chrono/utc_clock/to_sys.md @@ -50,9 +50,9 @@ int main() ### 出力 ``` -2015-01-01 00:00:00 UTC -2015-01-01 -26 +2015-07-01 00:00:00 +2015-07-01 00:00:00 +26s ``` ## バージョン @@ -61,7 +61,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): 9.0 [mark noimpl] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 15.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/weekday/c_encoding.md b/reference/chrono/weekday/c_encoding.md index b42ae5ba21..6f85e6f952 100644 --- a/reference/chrono/weekday/c_encoding.md +++ b/reference/chrono/weekday/c_encoding.md @@ -64,13 +64,13 @@ int main() ### 出力 ``` -Sunday : 0 -Monday : 1 -Tuesday : 2 -Wednesday : 3 -Thursday : 4 -Friday : 5 -Saturday : 6 +Sun : 0 +Mon : 1 +Tue : 2 +Wed : 3 +Thu : 4 +Fri : 5 +Sat : 6 ``` ## バージョン @@ -79,7 +79,7 @@ Saturday : 6 ### 処理系 - [Clang](/implementation.md#clang): 10.0 [mark verified] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 15.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/weekday/iso_encoding.md b/reference/chrono/weekday/iso_encoding.md index 1ebee10adb..e08a3fb6d4 100644 --- a/reference/chrono/weekday/iso_encoding.md +++ b/reference/chrono/weekday/iso_encoding.md @@ -60,13 +60,13 @@ int main() ### 出力 ``` -Monday : 1 -Tuesday : 2 -Wednesday : 3 -Thursday : 4 -Friday : 5 -Saturday : 6 -Sunday : 7 +Mon : 1 +Tue : 2 +Wed : 3 +Thu : 4 +Fri : 5 +Sat : 6 +Sun : 7 ``` ## バージョン @@ -75,7 +75,7 @@ Sunday : 7 ### 処理系 - [Clang](/implementation.md#clang): 10.0 [mark verified] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 15.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year.md b/reference/chrono/year.md index bbfbeffa84..4da20c306c 100644 --- a/reference/chrono/year.md +++ b/reference/chrono/year.md @@ -160,7 +160,7 @@ int main() ### 出力 ``` 2023 -2020/Mar/01 +2020-03-01 ``` ## バージョン @@ -169,7 +169,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): 8.0 (入出力ストリームなし) [mark verified] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 15.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year/op_y.md b/reference/chrono/year/op_y.md index 89fa5c1745..be3fdc8311 100644 --- a/reference/chrono/year/op_y.md +++ b/reference/chrono/year/op_y.md @@ -57,6 +57,7 @@ int main() ### 出力 ``` +2020 2020/Mar ``` @@ -66,5 +67,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): 8.0 [mark verified] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 15.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_day/formatter.md b/reference/chrono/year_month_day/formatter.md index beb8363cb1..3906913332 100644 --- a/reference/chrono/year_month_day/formatter.md +++ b/reference/chrono/year_month_day/formatter.md @@ -59,7 +59,7 @@ int main() { ### 出力 ``` 1 : 2020-03-01 -2 : Mar/01/2020 +2 : 03/01/20 3 : 2020-03-01 4 : 03/01/20 5 : 2020年03月01日 @@ -73,7 +73,7 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): 9.0 [mark noimpl] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 15.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_day/op_local_days.md b/reference/chrono/year_month_day/op_local_days.md index 3fe7688c3a..6d25c6696a 100644 --- a/reference/chrono/year_month_day/op_local_days.md +++ b/reference/chrono/year_month_day/op_local_days.md @@ -57,9 +57,9 @@ int main() ### 出力 ``` -2020-03-01 00:00:00 -2019-03-01 00:00:00 -2019-12-31 00:00:00 +2020-03-01 +2019-03-01 +2019-12-31 ``` ## バージョン @@ -68,7 +68,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): 8.0 [mark verified] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 15.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_day_last.md b/reference/chrono/year_month_day_last.md index d9a62f0332..e81628d03d 100644 --- a/reference/chrono/year_month_day_last.md +++ b/reference/chrono/year_month_day_last.md @@ -147,7 +147,7 @@ int main() ### 出力 ``` -2020/02/last +2020/Feb/last 29 2020-02-29 2020-02-29 @@ -160,7 +160,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): 8.0 (出力ストリームなし) [mark verified] -- [GCC](/implementation.md#gcc): 11.1 (出力ストリームなし) [mark verified] +- [GCC](/implementation.md#gcc): 11.1 (出力ストリームなし) [mark verified], 15.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_day_last/formatter.md b/reference/chrono/year_month_day_last/formatter.md index 60051c3ad9..27c5b05f09 100644 --- a/reference/chrono/year_month_day_last/formatter.md +++ b/reference/chrono/year_month_day_last/formatter.md @@ -59,7 +59,7 @@ int main() { ### 出力 ``` 1 : 2020/Feb/last -2 : Feb/29/2020 +2 : 02/29/20 3 : 2020-02-29 4 : 02/29/20 5 : 2020年02月29日 @@ -73,7 +73,7 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): 9.0 [mark noimpl] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 15.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_day_last/op_local_days.md b/reference/chrono/year_month_day_last/op_local_days.md index cab76090ac..ac68aa107a 100644 --- a/reference/chrono/year_month_day_last/op_local_days.md +++ b/reference/chrono/year_month_day_last/op_local_days.md @@ -43,7 +43,7 @@ int main() ### 出力 ``` -2020-02-29 00:00:00 +2020-02-29 ``` ## バージョン @@ -52,7 +52,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): 8.0 [mark verified] -- [GCC](/implementation.md#gcc): 11.1 [mark verified] +- [GCC](/implementation.md#gcc): 11.1 [mark verified], 15.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_weekday/formatter.md b/reference/chrono/year_month_weekday/formatter.md index ad8736f3cb..06b95c70dc 100644 --- a/reference/chrono/year_month_weekday/formatter.md +++ b/reference/chrono/year_month_weekday/formatter.md @@ -42,9 +42,9 @@ int main() { ### 出力 ``` -1 : 2020/Mar/Sun[2] -2 : 2020/Mar -3 : 2020年03月 +1 : 2020/Feb/Sun[2] +2 : 2020/Feb +3 : 2020年02月 ``` ## バージョン @@ -53,7 +53,7 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): 9.0 [mark noimpl] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 15.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/year_month_weekday_last/formatter.md b/reference/chrono/year_month_weekday_last/formatter.md index 054d5ba202..a62e1588c4 100644 --- a/reference/chrono/year_month_weekday_last/formatter.md +++ b/reference/chrono/year_month_weekday_last/formatter.md @@ -43,9 +43,9 @@ int main() { ### 出力 ``` -1 : 2020/Mar/Sun[last] -2 : 2020/Mar -3 : 2020年03月 +1 : 2020/Feb/Sun[last] +2 : 2020/Feb +3 : 2020年02月 ``` ## バージョン @@ -54,7 +54,7 @@ int main() { ### 処理系 - [Clang](/implementation.md#clang): 9.0 [mark noimpl] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 15.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] From e38c8478249f64b1171174ba5179f03948fc2e22 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 20 Oct 2025 15:49:39 +0900 Subject: [PATCH 2425/3948] =?UTF-8?q?chrono=20=E3=81=AE=E3=81=84=E3=81=8F?= =?UTF-8?q?=E3=81=A4=E3=81=8B=E3=81=AE=E5=87=BA=E5=8A=9B=E4=BE=8B=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit utc_time や tai_time の出力は "%F %T" ( "%Y-%m-%d %H:%M:%S" と等価)でフォーマットされた文字列であり、 "UTC" や "TAI" が後ろにつくことはありません。 --- reference/chrono/tai_time.md | 4 ++-- reference/chrono/utc_time.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/chrono/tai_time.md b/reference/chrono/tai_time.md index 1430460a60..960ee512d5 100644 --- a/reference/chrono/tai_time.md +++ b/reference/chrono/tai_time.md @@ -151,8 +151,8 @@ int main() #### 出力例 ``` -2019-10-24 11:15:37 TAI -2019-10-24 11:15:37 TAI +2019-10-24 11:15:37 +2019-10-24 11:15:37 TAI ``` diff --git a/reference/chrono/utc_time.md b/reference/chrono/utc_time.md index 3a108429b2..18e24c399a 100644 --- a/reference/chrono/utc_time.md +++ b/reference/chrono/utc_time.md @@ -145,8 +145,8 @@ int main() #### 出力例 ``` -2019-10-24 11:15:10 UTC -2019-10-24 11:15:10 UTC +2019-10-24 11:15:10 +2019-10-24 11:15:10 UTC 540 ``` From 4b231258ae355baf7f7aef5a8785389d90f0cb2d Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 20 Oct 2025 15:51:40 +0900 Subject: [PATCH 2426/3948] =?UTF-8?q?chrono=20=E3=81=AE=E3=81=84=E3=81=8F?= =?UTF-8?q?=E3=81=A4=E3=81=8B=E3=81=AE=E5=87=BA=E5=8A=9B=E4=BE=8B=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E3=80=81=E5=8B=95=E4=BD=9C=E7=A2=BA=E8=AA=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit utc_time や tai_time の出力は "%F %T" ( "%Y-%m-%d %H:%M:%S" と等価)でフォーマットされた文字列であり、 "UTC" や "TAI" が後ろにつくことはありません。 --- reference/chrono/clock_cast.md | 6 +++--- reference/chrono/clock_time_conversion.md | 8 ++++---- reference/chrono/tai_clock/now.md | 4 ++-- reference/chrono/utc_clock.md | 4 ++-- reference/chrono/utc_clock/now.md | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/reference/chrono/clock_cast.md b/reference/chrono/clock_cast.md index 4f69bd19b4..02a4dc6d77 100644 --- a/reference/chrono/clock_cast.md +++ b/reference/chrono/clock_cast.md @@ -118,9 +118,9 @@ int main() ### 出力例 ``` -2019-10-24 11:15:10 UTC 2019-10-24 11:15:10 -2019-10-24 11:15:37 TAI +2019-10-24 11:15:10 +2019-10-24 11:15:37 2019-10-24 11:15:10 ``` @@ -130,5 +130,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): 9.0 [mark noimpl] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 15.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/clock_time_conversion.md b/reference/chrono/clock_time_conversion.md index afd38090fc..c724d0d97c 100644 --- a/reference/chrono/clock_time_conversion.md +++ b/reference/chrono/clock_time_conversion.md @@ -206,10 +206,10 @@ int main() ### 出力例 ``` -2019-10-24 11:15:10 UTC 2019-10-24 11:15:10 -2019-10-24 11:15:37 TAI -2019-10-24 11:15:10 UTC +2019-10-24 11:15:10 +2019-10-24 11:15:37 +2019-10-24 11:15:10 ``` ## バージョン @@ -218,5 +218,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): 9.0 [mark noimpl] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 15.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/tai_clock/now.md b/reference/chrono/tai_clock/now.md index 32d3e5a282..c272b79db0 100644 --- a/reference/chrono/tai_clock/now.md +++ b/reference/chrono/tai_clock/now.md @@ -38,7 +38,7 @@ int main() ### 出力例 ``` -2019-10-24 11:15:47 TAI +2019-10-24 11:15:47 ``` ## バージョン @@ -47,5 +47,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): 9.0 [mark noimpl] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 15.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/utc_clock.md b/reference/chrono/utc_clock.md index 859ad70e5c..75b5dab1ca 100644 --- a/reference/chrono/utc_clock.md +++ b/reference/chrono/utc_clock.md @@ -72,7 +72,7 @@ int main() ### 出力例 ``` -2019-10-24 11:15:10 UTC +2019-10-24 11:15:10 ``` ## バージョン @@ -81,7 +81,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): 9.0 [mark noimpl] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 15.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] diff --git a/reference/chrono/utc_clock/now.md b/reference/chrono/utc_clock/now.md index 66210c725f..5bad326247 100644 --- a/reference/chrono/utc_clock/now.md +++ b/reference/chrono/utc_clock/now.md @@ -38,7 +38,7 @@ int main() ### 出力例 ``` -2019-10-24 11:15:10 UTC +2019-10-24 11:15:10 ``` ## バージョン @@ -47,5 +47,5 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): 9.0 [mark noimpl] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 15.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] From bcf9dc732f9273c031fa17bd509ae056e587b916 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 20 Oct 2025 15:53:05 +0900 Subject: [PATCH 2427/3948] =?UTF-8?q?chrono::duration=5Fvalues::min=20:=20?= =?UTF-8?q?=E5=87=BA=E5=8A=9B=E4=BE=8B=E3=82=92=E4=BF=AE=E6=AD=A3=E3=80=81?= =?UTF-8?q?=E5=8B=95=E4=BD=9C=E7=A2=BA=E8=AA=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 戻り値は負の値も含めた最小値です。 --- reference/chrono/duration_values/min.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/chrono/duration_values/min.md b/reference/chrono/duration_values/min.md index 849236c0ca..d673f9d766 100644 --- a/reference/chrono/duration_values/min.md +++ b/reference/chrono/duration_values/min.md @@ -45,7 +45,7 @@ int main() ``` -9223372036854775808 -2147483648 -2.22507e-308 +-1.79769e+308 ``` ## バージョン @@ -53,7 +53,7 @@ int main() - C++11 ### 処理系 -- [GCC](/implementation.md#gcc): 4.6.1 [mark verified] +- [GCC](/implementation.md#gcc): 4.6.1 [mark verified], 15.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2012 [mark verified], 2013 [mark verified], 2015 [mark verified] From 1cf611e51b303cc6313cda2824e7b2535b27286c Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 20 Oct 2025 15:55:32 +0900 Subject: [PATCH 2428/3948] =?UTF-8?q?chrono::year=5Fmonth=5Fday=20:=20?= =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BE=8B=E3=82=92=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E3=80=81=E5=8B=95=E4=BD=9C=E7=A2=BA=E8=AA=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit コメントや出力例にあうように修正しました。 --- reference/chrono/year_month_day.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/chrono/year_month_day.md b/reference/chrono/year_month_day.md index 8615859ba5..6c99a9778f 100644 --- a/reference/chrono/year_month_day.md +++ b/reference/chrono/year_month_day.md @@ -134,9 +134,9 @@ int main() // 年、月、月の最終日の組み合わせから、年、月、日に変換。 // 以下はすべて2020年2月29日を表す - chrono::year_month_day date10 = 2020y/3/chrono::last; - chrono::year_month_day date11 = 3/chrono::last/2020; - chrono::year_month_day date12 = chrono::last/3/2020; + chrono::year_month_day date10 = 2020y/2/chrono::last; + chrono::year_month_day date11 = 2/chrono::last/2020; + chrono::year_month_day date12 = chrono::last/2/2020; std::cout << date12 << std::endl; // 日単位のシステム時間に変換 @@ -317,7 +317,7 @@ int main() ### 処理系 - [Clang](/implementation.md#clang): 8.0 (入出力ストリームなし) [mark verified] -- [GCC](/implementation.md#gcc): 9.2 [mark noimpl] +- [GCC](/implementation.md#gcc): 9.2 [mark noimpl], 15.1 [mark verified] - [Visual C++](/implementation.md#visual_cpp): 2019 Update 3 [mark noimpl] From a312388ed6c11aa49150179dfd746b90d201cd98 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 20 Oct 2025 16:28:41 +0900 Subject: [PATCH 2429/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BE=8B?= =?UTF-8?q?=E3=82=84=E5=87=BA=E5=8A=9B=E3=81=AE=E4=B8=8D=E8=A6=81=E3=81=AA?= =?UTF-8?q?=E7=A9=BA=E8=A1=8C=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/indirectly_writable.md | 1 - reference/spanstream/basic_ispanstream.md | 1 - reference/sstream/basic_istringstream.md | 1 - reference/tuple/tuple.md | 2 -- reference/type_traits/reference_constructs_from_temporary.md | 2 -- reference/type_traits/reference_converts_from_temporary.md | 2 -- reference/utility/pair.md | 2 -- reference/vector/vector/at.md | 1 - 8 files changed, 12 deletions(-) diff --git a/reference/iterator/indirectly_writable.md b/reference/iterator/indirectly_writable.md index 543bbe6f98..5c412da7f4 100644 --- a/reference/iterator/indirectly_writable.md +++ b/reference/iterator/indirectly_writable.md @@ -182,7 +182,6 @@ int main() std::vector::iterator is indirectly writable bool ret_proxy_pair is indirectly writable std::pair> ret_proxy_tuple is indirectly writable std::tuple> - ``` diff --git a/reference/spanstream/basic_ispanstream.md b/reference/spanstream/basic_ispanstream.md index c16e727f13..3d5b18d988 100644 --- a/reference/spanstream/basic_ispanstream.md +++ b/reference/spanstream/basic_ispanstream.md @@ -74,7 +74,6 @@ int main() ### 出力 ``` A B C - ``` diff --git a/reference/sstream/basic_istringstream.md b/reference/sstream/basic_istringstream.md index ebbf02ec14..e96f37495b 100644 --- a/reference/sstream/basic_istringstream.md +++ b/reference/sstream/basic_istringstream.md @@ -72,7 +72,6 @@ int main() { ### 出力 ``` A B C D E F G - ``` ## 参照 diff --git a/reference/tuple/tuple.md b/reference/tuple/tuple.md index 950ca84a1f..327ca869b9 100644 --- a/reference/tuple/tuple.md +++ b/reference/tuple/tuple.md @@ -237,7 +237,6 @@ int main() print("after b", b); } } - ``` #### 出力 @@ -246,7 +245,6 @@ before a: i=0, d=0 before b: i=1, d=1 after a: i=1, d=1 after b: i=0, d=0 - ``` ## バージョン diff --git a/reference/type_traits/reference_constructs_from_temporary.md b/reference/type_traits/reference_constructs_from_temporary.md index c554fe12ac..230736c205 100644 --- a/reference/type_traits/reference_constructs_from_temporary.md +++ b/reference/type_traits/reference_constructs_from_temporary.md @@ -62,7 +62,6 @@ int main() { std::cout << "2" << std::endl; } - ``` ### 出力 @@ -71,7 +70,6 @@ int main() { S construct S destruct 2 - ``` ## 例 diff --git a/reference/type_traits/reference_converts_from_temporary.md b/reference/type_traits/reference_converts_from_temporary.md index 619b7afa45..f87ca3ae4a 100644 --- a/reference/type_traits/reference_converts_from_temporary.md +++ b/reference/type_traits/reference_converts_from_temporary.md @@ -58,7 +58,6 @@ int main() { std::cout << "2" << std::endl; } - ``` ### 出力 @@ -67,7 +66,6 @@ int main() { S construct S destruct 2 - ``` diff --git a/reference/utility/pair.md b/reference/utility/pair.md index a401e880e3..833be72ac8 100644 --- a/reference/utility/pair.md +++ b/reference/utility/pair.md @@ -242,7 +242,6 @@ int main() print("after b", b); } } - ``` #### 出力 @@ -251,7 +250,6 @@ before a: i=0, d=0 before b: i=1, d=1 after a: i=1, d=1 after b: i=0, d=0 - ``` diff --git a/reference/vector/vector/at.md b/reference/vector/vector/at.md index f742f4e6d6..2eea27de25 100644 --- a/reference/vector/vector/at.md +++ b/reference/vector/vector/at.md @@ -62,7 +62,6 @@ int main() ``` 4 out of range - ``` From e6ade2f4d229ee7d6ef9dc3c8350e11bea16f535 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 20 Oct 2025 16:34:57 +0900 Subject: [PATCH 2430/3948] =?UTF-8?q?=E5=87=BA=E5=8A=9B=E3=81=AB=E5=90=88?= =?UTF-8?q?=E3=81=86=E3=82=88=E3=81=86=E3=81=AB=E3=82=B3=E3=83=BC=E3=83=89?= =?UTF-8?q?=E4=BE=8B=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/concepts/invocable.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reference/concepts/invocable.md b/reference/concepts/invocable.md index 6a98cf9cdd..a19bbae04e 100644 --- a/reference/concepts/invocable.md +++ b/reference/concepts/invocable.md @@ -71,6 +71,8 @@ int main() { f("invocable(int)"); f("invocable(int***)"); + std::cout << "\n"; + // 内部状態を保ち、等しさを保持しない呼び出し可能な型 f("mut_lambda(int)"); f("std::mt19937()"); From f55a642a79ba26898612aae490a8f6dfe098e748 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Tue, 21 Oct 2025 00:24:54 +0900 Subject: [PATCH 2431/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BE=8B?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/complex/complex/tanh.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/complex/complex/tanh.md b/reference/complex/complex/tanh.md index f3697a90c5..4a147037b1 100644 --- a/reference/complex/complex/tanh.md +++ b/reference/complex/complex/tanh.md @@ -56,11 +56,11 @@ int main() { std::complex c(1.0, 2.0); - std::complex result = std::atanh(c); + std::complex result = std::tanh(c); std::cout << "tanh( " << c << " ) = " << result << std::endl; } ``` -* std::atanh[color ff0000] +* std::tanh[color ff0000] ### 出力 ``` From 04cdd8470a36733e1dc2570186fecd10f881e5c6 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Tue, 21 Oct 2025 00:25:40 +0900 Subject: [PATCH 2432/3948] =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BE=8B?= =?UTF-8?q?=E3=81=AE=E5=87=BA=E5=8A=9B=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_multimap/end.md | 14 ++++++-------- reference/tuple/tuple/op_compare_3way.md | 2 -- reference/valarray/valarray/asin.md | 6 +++--- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/reference/flat_map/flat_multimap/end.md b/reference/flat_map/flat_multimap/end.md index b3df377d97..142823285a 100644 --- a/reference/flat_map/flat_multimap/end.md +++ b/reference/flat_map/flat_multimap/end.md @@ -49,14 +49,12 @@ int main() ### 出力 ``` -1 A -2 B -3 C -4 D -5 E -6 F -7 G -8 H +10 A +10 a +11 B +11 b +12 C +12 c ``` ## バージョン diff --git a/reference/tuple/tuple/op_compare_3way.md b/reference/tuple/tuple/op_compare_3way.md index f9c308ce63..d8be7121c7 100644 --- a/reference/tuple/tuple/op_compare_3way.md +++ b/reference/tuple/tuple/op_compare_3way.md @@ -75,8 +75,6 @@ int main() ### 出力 ``` -true -false ``` ## バージョン diff --git a/reference/valarray/valarray/asin.md b/reference/valarray/valarray/asin.md index 8235a1e378..ab3264ad92 100644 --- a/reference/valarray/valarray/asin.md +++ b/reference/valarray/valarray/asin.md @@ -49,7 +49,7 @@ int main() ### 出力 ``` -0.0998334 -0.198669 -0.29552 +0.100167 +0.201358 +0.304693 ``` From 3c0b15ede843affa3ca726831b09a94085da3e6e Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Tue, 21 Oct 2025 00:26:11 +0900 Subject: [PATCH 2433/3948] =?UTF-8?q?=E8=A1=A8=E3=81=AE=E8=A1=A8=E7=A4=BA?= =?UTF-8?q?=E5=B4=A9=E3=82=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/system_error/error_condition.md | 1 - 1 file changed, 1 deletion(-) diff --git a/reference/system_error/error_condition.md b/reference/system_error/error_condition.md index d0d6b650b8..f247e8ac9c 100644 --- a/reference/system_error/error_condition.md +++ b/reference/system_error/error_condition.md @@ -46,7 +46,6 @@ Visual C++ 2010、GCC 4.6.1では[`generic_category()`](generic_category.md)と[ | `bool operator<=(const error_condition&, const error_condition&) noexcept;` | 左辺が右辺以下か判定する (`operator<=>`により使用可能) | C++20 | | `bool operator>(const error_condition&, const error_condition&) noexcept;` | 左辺が右辺より大きいか判定する (`operator<=>`により使用可能) | C++20 | | `bool operator>=(const error_condition&, const error_condition&) noexcept;` | 左辺が右辺以上か判定する (`operator<=>`により使用可能) | C++20 | - | [`make_error_condition`](make_error_condition.md) | `errc`から`error_condition`オブジェクトを生成する | C++11 | From 8d6bfc930234f1edaf7aae317631bcc84c35a927 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Tue, 21 Oct 2025 00:43:29 +0900 Subject: [PATCH 2434/3948] =?UTF-8?q?error=5Fcategory=20:=20=E5=87=BA?= =?UTF-8?q?=E5=8A=9B=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2つ目の出力について、 system_ec.default_error_condition() の内部で呼ばれる std::system_category().default_error_condition(ev) 仮想関数は、引数 ev がPOSIXの errno であった場合に error_condition(ev, generic_category()) を返します。 よってどちらも error_category は std::generic_category() になるので2つ目の出力は true になります。 --- reference/system_error/error_category/equivalent.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/system_error/error_category/equivalent.md b/reference/system_error/error_category/equivalent.md index 30fb7dd97e..4019fab84e 100644 --- a/reference/system_error/error_category/equivalent.md +++ b/reference/system_error/error_category/equivalent.md @@ -57,7 +57,7 @@ int main() ### 出力 ``` true -false +true true false ``` From 45eb8c111ab6158d1faa95d1689473b28b53ec2d Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Tue, 21 Oct 2025 15:28:50 +0900 Subject: [PATCH 2435/3948] =?UTF-8?q?stringbuf,=20spanbuf=20:=20=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E4=BE=8B=E3=82=84=E5=87=BA=E5=8A=9B=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit std::ios_base::app を指定しない限り、書き込み位置の初期値は先頭です。 --- reference/spanstream/basic_spanstream/rdbuf.md | 2 +- reference/sstream/basic_stringbuf/op_constructor.md | 5 ++++- reference/sstream/basic_stringbuf/str.md | 4 ++-- reference/sstream/basic_stringstream/op_constructor.md | 5 ++++- reference/sstream/basic_stringstream/rdbuf.md | 2 +- reference/sstream/basic_stringstream/str.md | 4 ++++ 6 files changed, 16 insertions(+), 6 deletions(-) diff --git a/reference/spanstream/basic_spanstream/rdbuf.md b/reference/spanstream/basic_spanstream/rdbuf.md index 1f3d610dab..5458b49cb7 100644 --- a/reference/spanstream/basic_spanstream/rdbuf.md +++ b/reference/spanstream/basic_spanstream/rdbuf.md @@ -49,7 +49,7 @@ int main() ### 出力 ``` t -est! +!est ``` diff --git a/reference/sstream/basic_stringbuf/op_constructor.md b/reference/sstream/basic_stringbuf/op_constructor.md index 4936f70c85..db0530c449 100644 --- a/reference/sstream/basic_stringbuf/op_constructor.md +++ b/reference/sstream/basic_stringbuf/op_constructor.md @@ -129,13 +129,16 @@ int main() std::cout << buf1.str() << std::endl; // (3) 文字列を指定して構築 - std::stringbuf buf2("initial"); + std::stringbuf buf2("initial", std::ios_base::out | std::ios_base::app); buf2.sputc('!'); std::cout << buf2.str() << std::endl; } ``` * sputc[link /reference/streambuf/basic_streambuf/sputc.md] * str()[link str.md] +* std::ios_base[link /reference/ios/ios_base.md] +* out[link /reference/ios/ios_base/type-openmode.md] +* app[link /reference/ios/ios_base/type-openmode.md] #### 出力 ``` diff --git a/reference/sstream/basic_stringbuf/str.md b/reference/sstream/basic_stringbuf/str.md index 7424b49536..b8dde7d0ea 100644 --- a/reference/sstream/basic_stringbuf/str.md +++ b/reference/sstream/basic_stringbuf/str.md @@ -78,7 +78,7 @@ int main() ch = buf.sbumpc(); // 'e' std::cout << "3: After reading 2 chars: " << buf.str() << std::endl; - // 書き込み(現在の位置から) + // 書き込み(読み取り位置と書き込み位置は別なので、先頭から書き込まれる) buf.sputc('X'); buf.sputc('Y'); std::cout << "4: After writing: " << buf.str() << std::endl; @@ -97,7 +97,7 @@ int main() 1: Hello, World! 2: New content 3: After reading 2 chars: Read/Write test -4: After writing: ReXY/Write test +4: After writing: XYad/Write test 5: Empty? yes ``` diff --git a/reference/sstream/basic_stringstream/op_constructor.md b/reference/sstream/basic_stringstream/op_constructor.md index 43a302aa19..68db07c9a5 100644 --- a/reference/sstream/basic_stringstream/op_constructor.md +++ b/reference/sstream/basic_stringstream/op_constructor.md @@ -121,12 +121,15 @@ int main() std::cout << s << std::endl; // (3) 文字列を指定して構築 - std::stringstream ss2("initial value"); + std::stringstream ss2("initial value", std::ios_base::out | std::ios_base::app); ss2 << " added"; std::cout << ss2.str() << std::endl; } ``` * str()[link str.md] +* std::ios_base[link /reference/ios/ios_base.md] +* out[link /reference/ios/ios_base/type-openmode.md] +* app[link /reference/ios/ios_base/type-openmode.md] #### 出力 ``` diff --git a/reference/sstream/basic_stringstream/rdbuf.md b/reference/sstream/basic_stringstream/rdbuf.md index c797602272..1683e7849c 100644 --- a/reference/sstream/basic_stringstream/rdbuf.md +++ b/reference/sstream/basic_stringstream/rdbuf.md @@ -42,5 +42,5 @@ int main() ### 出力 ``` t -est! +!est ``` diff --git a/reference/sstream/basic_stringstream/str.md b/reference/sstream/basic_stringstream/str.md index 9e62e17ef1..7f77ddcb4a 100644 --- a/reference/sstream/basic_stringstream/str.md +++ b/reference/sstream/basic_stringstream/str.md @@ -67,6 +67,7 @@ int main() std::cout << "1: " << ss.str() << std::endl; // ストリームに追記 + ss.seekp(0, std::ios_base::end); ss << " + added"; std::cout << "2: " << ss.str() << std::endl; @@ -85,6 +86,9 @@ int main() std::cout << "5: Empty? " << (ss.str().empty() ? "yes" : "no") << std::endl; } ``` +* seekp[link /reference/ostream/basic_ostream/seekp.md] +* std::ios_base[link /reference/ios/ios_base.md] +* end[link /reference/ios/ios_base/type-seekdir.md] #### 出力 ``` From 00f118737e1bddc536ec9c77175ce3f70e2a60c1 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Tue, 21 Oct 2025 15:32:00 +0900 Subject: [PATCH 2436/3948] =?UTF-8?q?stringbuf=20:=20=E3=82=AA=E3=83=BC?= =?UTF-8?q?=E3=83=90=E3=83=BC=E3=83=AD=E3=83=BC=E3=83=89=E3=81=AE=E7=95=AA?= =?UTF-8?q?=E5=8F=B7=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (2) が重複していたので、番号を1つずらして修正しました。 --- .../sstream/basic_stringbuf/op_constructor.md | 74 ++++++++++--------- 1 file changed, 38 insertions(+), 36 deletions(-) diff --git a/reference/sstream/basic_stringbuf/op_constructor.md b/reference/sstream/basic_stringbuf/op_constructor.md index db0530c449..ba24f7c55e 100644 --- a/reference/sstream/basic_stringbuf/op_constructor.md +++ b/reference/sstream/basic_stringbuf/op_constructor.md @@ -6,73 +6,73 @@ ```cpp basic_stringbuf() - : basic_stringbuf(ios_base::in | ios_base::out) {} // (1) C++11 + : basic_stringbuf(ios_base::in | ios_base::out) {} // (1) C++11 explicit basic_stringbuf( - ios_base::openmode which); // (2) C++11 + ios_base::openmode which); // (2) C++11 explicit basic_stringbuf( - ios_base::openmode which = ios_base::in | ios_base::out); // (1)+(2) C++03 + ios_base::openmode which = ios_base::in | ios_base::out); // (1)+(2) C++03 explicit basic_stringbuf( const basic_string& s, - ios_base::openmode which = ios_base::in | ios_base::out); // (2) C++03 + ios_base::openmode which = ios_base::in | ios_base::out); // (3) C++03 explicit basic_stringbuf( basic_string&& s, - ios_base::openmode which = ios_base::in | ios_base::out); // (3) C++20 + ios_base::openmode which = ios_base::in | ios_base::out); // (4) C++20 basic_stringbuf( ios_base::openmode which, - const Allocator& a); // (4) C++20 + const Allocator& a); // (5) C++20 explicit basic_stringbuf(const Allocator& a) - : basic_stringbuf(ios_base::in | ios_base::out, a) {} // (5) C++20 + : basic_stringbuf(ios_base::in | ios_base::out, a) {} // (6) C++20 explicit basic_stringbuf( const basic_string& s, const Allocator& a) - : basic_stringbuf(s, ios_base::in | ios_base::out, a) {} // (6) C++20 + : basic_stringbuf(s, ios_base::in | ios_base::out, a) {} // (7) C++20 explicit basic_stringbuf( const basic_string& s, ios_base::openmode which, - const Allocator& a); // (7) C++20 + const Allocator& a); // (8) C++20 template explicit basic_stringbuf( const basic_string& s, - ios_base::openmode which = ios_base::in | ios_base::out); // (8) C++20 + ios_base::openmode which = ios_base::in | ios_base::out); // (9) C++20 template basic_stringbuf( const basic_string& s, const Allocator& a) - : basic_stringbuf(s, ios_base::in | ios_base::out, a) {} // (9) C++20 + : basic_stringbuf(s, ios_base::in | ios_base::out, a) {} // (10) C++20 template basic_stringbuf( const basic_string& s, ios_base::openmode which, - const Allocator& a); // (10) C++20 + const Allocator& a); // (11) C++20 -basic_stringbuf(basic_stringbuf&& rhs); // (11) C++11 -basic_stringbuf(basic_stringbuf&& rhs, const Allocator& a); // (12) C++20 +basic_stringbuf(basic_stringbuf&& rhs); // (12) C++11 +basic_stringbuf(basic_stringbuf&& rhs, const Allocator& a); // (13) C++20 template explicit basic_stringbuf( const T& t, - ios_base::openmode which = ios_base::in | ios_base::out); // (13) C++26 + ios_base::openmode which = ios_base::in | ios_base::out); // (14) C++26 template basic_stringbuf( const T& t, - const Allocator& a); // (14) C++26 + const Allocator& a); // (15) C++26 template basic_stringbuf( const T& t, ios_base::openmode which, - const Allocator& a); // (15) C++26 + const Allocator& a); // (16) C++26 ``` * ios_base[link /reference/ios/ios_base.md] * basic_string[link /reference/string/basic_string.md] @@ -83,22 +83,23 @@ basic_stringbuf( - (1) : デフォルトコンストラクタ - (2) : 指定されたモードで構築する - (3) : 入力文字列として[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピーと、指定されたモードで構築する -- (4) : モードとアロケータを指定して構築する -- (5) : アロケータを指定して構築する -- (6) : 入力文字列として[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピーと、アロケータを指定して構築する -- (7) : 入力文字列として[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピー、モード、アロケータを指定して構築する -- (8) : 入力文字列として`Allocator`に変換可能なアロケータ型をもつ[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピーと、指定されたモードで構築する -- (9) : 入力文字列として`Allocator`に変換可能なアロケータ型をもつ[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピーと、アロケータを指定して構築する -- (10) : 入力文字列として`Allocator`に変換可能なアロケータ型をもつ[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピー、モード、アロケータを指定して構築する -- (11) : ムーブコンストラクタ -- (12) : ムーブコンストラクタでアロケータを指定して構築する -- (13) : 入力文字列として[`basic_string_view`](/reference/string_view/basic_string_view.md)に変換可能な文字列と、モードを設定する -- (14) : 入力文字列として[`basic_string_view`](/reference/string_view/basic_string_view.md)に変換可能な文字列と、アロケータを設定する -- (15) : 入力文字列として[`basic_string_view`](/reference/string_view/basic_string_view.md)に変換可能な文字列と、モードとアロケータを設定する +- (4) : 入力文字列として[`std::basic_string`](/reference/string/basic_string.md)オブジェクトの右辺値参照と、指定されたモードで構築する +- (5) : モードとアロケータを指定して構築する +- (6) : アロケータを指定して構築する +- (7) : 入力文字列として[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピーと、アロケータを指定して構築する +- (8) : 入力文字列として[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピー、モード、アロケータを指定して構築する +- (9) : 入力文字列として`Allocator`に変換可能なアロケータ型をもつ[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピーと、指定されたモードで構築する +- (10) : 入力文字列として`Allocator`に変換可能なアロケータ型をもつ[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピーと、アロケータを指定して構築する +- (11) : 入力文字列として`Allocator`に変換可能なアロケータ型をもつ[`std::basic_string`](/reference/string/basic_string.md)オブジェクトのコピー、モード、アロケータを指定して構築する +- (12) : ムーブコンストラクタ +- (13) : ムーブコンストラクタでアロケータを指定して構築する +- (14) : 入力文字列として[`basic_string_view`](/reference/string_view/basic_string_view.md)に変換可能な文字列と、モードを設定する +- (15) : 入力文字列として[`basic_string_view`](/reference/string_view/basic_string_view.md)に変換可能な文字列と、アロケータを設定する +- (16) : 入力文字列として[`basic_string_view`](/reference/string_view/basic_string_view.md)に変換可能な文字列と、モードとアロケータを設定する ## テンプレートパラメータ制約 -- (13), (14), (15) : `is_convertible_v>`が`true`であること +- (14), (15), (16) : `is_convertible_v>`が`true`であること ## 効果 @@ -107,12 +108,13 @@ basic_stringbuf( - (3) : 内部の文字列バッファを`s`のコピー、モードは`which`に設定する - (4) : 内部の文字列バッファを`std::move(s)`で、モードは`which`に設定する - (5) : 内部の文字列バッファを空にし、モードは`which`、アロケータは`a`に設定する -- (6), (7), (8), (9), (10) : 各引数は内部状態の初期化に使用される -- (11) : `rhs`から`basic_stringbuf`オブジェクトをムーブ構築する -- (12) : `rhs`から`basic_stringbuf`オブジェクトをムーブ構築し、アロケータは`a`を使用する -- (13) : `basic_string_view(t)`で文字列を初期化し、モードは`which`に設定する -- (14) : `basic_string_view(t)`で文字列を初期化し、モードは`ios_base::in | ios_base::out`、アロケータは`a`に設定する -- (15) : `basic_string_view(t)`で文字列を初期化し、モードは`which`、アロケータは`a`に設定する +- (6) : 内部の文字列バッファを空にし、モードは`ios_base::in | ios_base::out`、アロケータは`a`に設定する +- (7), (8), (9), (10), (11) : 各引数は内部状態の初期化に使用される +- (12) : `rhs`から`basic_stringbuf`オブジェクトをムーブ構築する +- (13) : `rhs`から`basic_stringbuf`オブジェクトをムーブ構築し、アロケータは`a`を使用する +- (14) : `basic_string_view(t)`で文字列を初期化し、モードは`which`に設定する +- (15) : `basic_string_view(t)`で文字列を初期化し、モードは`ios_base::in | ios_base::out`、アロケータは`a`に設定する +- (16) : `basic_string_view(t)`で文字列を初期化し、モードは`which`、アロケータは`a`に設定する ## 例 From c012fa32030b9a78f11cda6426d51a9235d7481a Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Tue, 21 Oct 2025 16:44:54 +0900 Subject: [PATCH 2437/3948] =?UTF-8?q?=E3=81=84=E3=81=8F=E3=81=A4=E3=81=8B?= =?UTF-8?q?=E3=81=AE=E3=82=B3=E3=83=BC=E3=83=89=E4=BE=8B=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/basic_const_iterator/op_plus.md | 2 +- reference/iterator/permutable.md | 1 + reference/stop_token/stop_token/stop_possible.md | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/reference/iterator/basic_const_iterator/op_plus.md b/reference/iterator/basic_const_iterator/op_plus.md index 7299195124..2ec77f4f7c 100644 --- a/reference/iterator/basic_const_iterator/op_plus.md +++ b/reference/iterator/basic_const_iterator/op_plus.md @@ -41,7 +41,7 @@ return basic_const_iterator(i.current_ + n); int main() { std::vector vec = {1, 2, 3, 4, 5}; - std::basic_const_iterator cit = vec.end(); + std::basic_const_iterator cit = vec.begin(); auto cit2 = cit + 3; auto cit3 = 4 + cit; diff --git a/reference/iterator/permutable.md b/reference/iterator/permutable.md index 95d912d5d7..1b20b1c70f 100644 --- a/reference/iterator/permutable.md +++ b/reference/iterator/permutable.md @@ -44,6 +44,7 @@ int main() { f::iterator>("std::forward_list::iterator"); f::iterator>("std::list::iterator"); f::iterator>("std::vector::iterator"); + f>::iterator>("std::vector>::iterator"); std::cout << "\n"; f("const int*"); diff --git a/reference/stop_token/stop_token/stop_possible.md b/reference/stop_token/stop_token/stop_possible.md index a9dcedc21d..f28bb13a96 100644 --- a/reference/stop_token/stop_token/stop_possible.md +++ b/reference/stop_token/stop_token/stop_possible.md @@ -62,7 +62,7 @@ int main() // 停止状態が停止要求を受け取った場合は、 // その後で stop_source が破棄されても stop_possible() == true のままになる assert(st1.stop_possible() == true); - assert(st2.stop_possible() == false); + assert(st2.stop_possible() == true); assert(st3.stop_possible() == false); } ``` From d707563ff7798e050aa616dc843d19c57d956a76 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Tue, 21 Oct 2025 16:45:27 +0900 Subject: [PATCH 2438/3948] =?UTF-8?q?=E3=81=84=E3=81=8F=E3=81=A4=E3=81=8B?= =?UTF-8?q?=E3=81=AE=E3=82=B3=E3=83=BC=E3=83=89=E4=BE=8B=E3=81=AE=E5=87=BA?= =?UTF-8?q?=E5=8A=9B=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_count.md | 2 +- reference/format/basic_format_string.md | 2 +- reference/format/format.md | 2 +- reference/functional/reference_wrapper.md | 1 - reference/functional/reference_wrapper/op_deduction_guide.md | 2 +- reference/initializer_list/initializer_list/end_free.md | 2 ++ reference/ios/ios_base/flags.md | 1 + reference/iterator/counted_iterator/op_minus_assign.md | 2 +- reference/iterator/weakly_incrementable.md | 4 ++-- reference/regex/regex_match.md | 2 +- reference/regex/regex_search.md | 2 +- 11 files changed, 12 insertions(+), 10 deletions(-) diff --git a/reference/algorithm/ranges_count.md b/reference/algorithm/ranges_count.md index 4cea7f80fd..58a13d5e8e 100644 --- a/reference/algorithm/ranges_count.md +++ b/reference/algorithm/ranges_count.md @@ -166,7 +166,7 @@ int main() { #### 出力 ``` count of label=="foo": 2 -count of id==1: 2 +count of id==1: 1 ``` diff --git a/reference/format/basic_format_string.md b/reference/format/basic_format_string.md index d6a534940a..7cb8ac258f 100644 --- a/reference/format/basic_format_string.md +++ b/reference/format/basic_format_string.md @@ -96,7 +96,7 @@ int main() ### 出力 ``` -2023-02-06 10:46:53: Hello 42 World +2023-02-06 10:46:53 JST: Hello 42 World ``` ## バージョン diff --git a/reference/format/format.md b/reference/format/format.md index c3801f9ab1..06f14bead1 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -479,7 +479,7 @@ int main() { #### 出力 ``` 0. [1, 2, 3] -1. ["abc", "bbb", "ccc"] +1. ["aaa", "bbb", "ccc"] 2. {1: "aaa", 2: "bbb"} 3. {1, 2, 3} 4. [1, 2, 3, 4] diff --git a/reference/functional/reference_wrapper.md b/reference/functional/reference_wrapper.md index 3ee9bfab0c..8a6811f0ea 100644 --- a/reference/functional/reference_wrapper.md +++ b/reference/functional/reference_wrapper.md @@ -132,7 +132,6 @@ my_struct& get_my_struct() ### 出力 ``` -0 ``` ## バージョン diff --git a/reference/functional/reference_wrapper/op_deduction_guide.md b/reference/functional/reference_wrapper/op_deduction_guide.md index 65d040c3b2..20bd44fde4 100644 --- a/reference/functional/reference_wrapper/op_deduction_guide.md +++ b/reference/functional/reference_wrapper/op_deduction_guide.md @@ -34,7 +34,7 @@ int main() ### 出力 ``` -4 +4 ``` ## バージョン diff --git a/reference/initializer_list/initializer_list/end_free.md b/reference/initializer_list/initializer_list/end_free.md index 6c130fa3db..a4b91264bc 100644 --- a/reference/initializer_list/initializer_list/end_free.md +++ b/reference/initializer_list/initializer_list/end_free.md @@ -48,6 +48,8 @@ int main() ### 出力 ``` 1 +2 +3 ``` diff --git a/reference/ios/ios_base/flags.md b/reference/ios/ios_base/flags.md index d51f00a3c3..1cd1385040 100644 --- a/reference/ios/ios_base/flags.md +++ b/reference/ios/ios_base/flags.md @@ -71,6 +71,7 @@ int main() ### 出力 ``` +100 64 100 64 diff --git a/reference/iterator/counted_iterator/op_minus_assign.md b/reference/iterator/counted_iterator/op_minus_assign.md index 2932754fbd..629a421309 100644 --- a/reference/iterator/counted_iterator/op_minus_assign.md +++ b/reference/iterator/counted_iterator/op_minus_assign.md @@ -53,7 +53,7 @@ int main() { ### 出力 ``` -5 +4 ``` ## バージョン diff --git a/reference/iterator/weakly_incrementable.md b/reference/iterator/weakly_incrementable.md index b4167a1a19..d068279c75 100644 --- a/reference/iterator/weakly_incrementable.md +++ b/reference/iterator/weakly_incrementable.md @@ -96,11 +96,11 @@ int* is weakly incrementable const int* is weakly incrementable std::vector::iterator is weakly incrementable std::ostream_iterator is weakly incrementable -sample_incrementable is weakly incrementable +sample_weak_incrementable is weakly incrementable int* const is not weakly incrementable std::unique_ptr is not weakly incrementable -sample_not_incrementable is not weakly incrementable +sample_not_weak_incrementable is not weakly incrementable ``` ## バージョン diff --git a/reference/regex/regex_match.md b/reference/regex/regex_match.md index b39d2ef565..fa1ca08446 100644 --- a/reference/regex/regex_match.md +++ b/reference/regex/regex_match.md @@ -178,7 +178,7 @@ int main() ### 出力 ``` -(1) = true +(1) true str = 'abc123def', position = 0 (2) true str = 'abc123def', position = 0 diff --git a/reference/regex/regex_search.md b/reference/regex/regex_search.md index cd0a109184..85350cd4bd 100644 --- a/reference/regex/regex_search.md +++ b/reference/regex/regex_search.md @@ -179,7 +179,7 @@ int main() ### 出力 ``` -(1) = true +(1) true str = '123', position = 3 (2) true str = '123', position = 3 From 69eec33c27598e1d5dec01851a4516a898de19df Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 23 Oct 2025 01:15:43 +0900 Subject: [PATCH 2439/3948] =?UTF-8?q?=E4=B9=B1=E6=95=B0=E3=81=AE=E3=82=B5?= =?UTF-8?q?=E3=83=B3=E3=83=97=E3=83=AB=E3=82=B3=E3=83=BC=E3=83=89=20:=20?= =?UTF-8?q?=E3=82=88=E3=82=8A=E8=AA=AC=E6=98=8E=E7=9A=84=E3=81=AA=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E3=81=AB=E3=81=99=E3=82=8B=E3=81=9F=E3=82=81?= =?UTF-8?q?=E3=81=AB=E4=B9=B1=E6=95=B0=E3=81=AE=E3=82=B7=E3=83=BC=E3=83=89?= =?UTF-8?q?=E3=82=92=E4=B8=80=E6=97=A6=E5=A4=89=E6=95=B0=E3=81=AB=E3=82=82?= =?UTF-8?q?=E3=81=A4=E3=82=88=E3=81=86=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 1 - lang/cpp11/thread_local_storage.md | 4 +++- reference/algorithm/ranges_shuffle.md | 8 ++++++-- reference/algorithm/shuffle.md | 8 ++++++-- reference/random.md | 4 +++- reference/random/bernoulli_distribution.md | 4 +++- reference/random/bernoulli_distribution/op_call.md | 4 +++- reference/random/bernoulli_distribution/op_constructor.md | 4 +++- reference/random/bernoulli_distribution/reset.md | 4 +++- reference/random/binomial_distribution.md | 4 +++- reference/random/binomial_distribution/op_call.md | 4 +++- reference/random/binomial_distribution/op_constructor.md | 4 +++- reference/random/binomial_distribution/reset.md | 4 +++- reference/random/cauchy_distribution.md | 4 +++- reference/random/cauchy_distribution/op_call.md | 4 +++- reference/random/cauchy_distribution/op_constructor.md | 4 +++- reference/random/cauchy_distribution/reset.md | 4 +++- reference/random/chi_squared_distribution.md | 4 +++- reference/random/chi_squared_distribution/op_call.md | 4 +++- .../random/chi_squared_distribution/op_constructor.md | 4 +++- reference/random/chi_squared_distribution/reset.md | 4 +++- reference/random/default_random_engine.md | 4 +++- reference/random/discrete_distribution.md | 4 +++- reference/random/discrete_distribution/op_call.md | 4 +++- reference/random/discrete_distribution/op_constructor.md | 4 +++- reference/random/discrete_distribution/reset.md | 4 +++- reference/random/exponential_distribution.md | 4 +++- reference/random/exponential_distribution/op_call.md | 4 +++- .../random/exponential_distribution/op_constructor.md | 4 +++- reference/random/exponential_distribution/reset.md | 4 +++- reference/random/extreme_value_distribution.md | 4 +++- reference/random/extreme_value_distribution/op_call.md | 4 +++- .../random/extreme_value_distribution/op_constructor.md | 4 +++- reference/random/extreme_value_distribution/reset.md | 4 +++- reference/random/fisher_f_distribution.md | 4 +++- reference/random/fisher_f_distribution/op_call.md | 4 +++- reference/random/fisher_f_distribution/op_constructor.md | 4 +++- reference/random/fisher_f_distribution/reset.md | 4 +++- reference/random/gamma_distribution.md | 4 +++- reference/random/gamma_distribution/op_call.md | 4 +++- reference/random/gamma_distribution/op_constructor.md | 4 +++- reference/random/gamma_distribution/reset.md | 4 +++- reference/random/generate_canonical.md | 4 +++- reference/random/generate_random.md | 4 +++- reference/random/geometric_distribution.md | 4 +++- reference/random/geometric_distribution/op_call.md | 4 +++- reference/random/geometric_distribution/op_constructor.md | 4 +++- reference/random/geometric_distribution/reset.md | 4 +++- reference/random/knuth_b.md | 4 +++- reference/random/linear_congruential_engine.md | 4 +++- reference/random/lognormal_distribution.md | 4 +++- reference/random/lognormal_distribution/op_call.md | 4 +++- reference/random/lognormal_distribution/op_constructor.md | 4 +++- reference/random/lognormal_distribution/reset.md | 4 +++- reference/random/mersenne_twister_engine.md | 4 +++- reference/random/minstd_rand.md | 4 +++- reference/random/minstd_rand0.md | 4 +++- reference/random/mt19937.md | 4 +++- reference/random/mt19937_64.md | 4 +++- reference/random/negative_binomial_distribution.md | 4 +++- .../random/negative_binomial_distribution/op_call.md | 4 +++- .../negative_binomial_distribution/op_constructor.md | 4 +++- reference/random/negative_binomial_distribution/reset.md | 4 +++- reference/random/normal_distribution.md | 4 +++- reference/random/normal_distribution/op_call.md | 4 +++- reference/random/normal_distribution/op_constructor.md | 4 +++- reference/random/normal_distribution/reset.md | 4 +++- reference/random/philox4x32.md | 4 +++- reference/random/philox4x64.md | 4 +++- reference/random/philox_engine.md | 4 +++- reference/random/piecewise_constant_distribution.md | 4 +++- .../random/piecewise_constant_distribution/op_call.md | 4 +++- .../piecewise_constant_distribution/op_constructor.md | 4 +++- reference/random/piecewise_constant_distribution/reset.md | 4 +++- reference/random/piecewise_linear_distribution.md | 4 +++- reference/random/piecewise_linear_distribution/op_call.md | 4 +++- .../piecewise_linear_distribution/op_constructor.md | 4 +++- reference/random/piecewise_linear_distribution/reset.md | 4 +++- reference/random/poisson_distribution.md | 4 +++- reference/random/poisson_distribution/op_call.md | 4 +++- reference/random/poisson_distribution/op_constructor.md | 4 +++- reference/random/poisson_distribution/reset.md | 4 +++- reference/random/ranlux24.md | 4 +++- reference/random/ranlux48.md | 4 +++- reference/random/student_t_distribution.md | 4 +++- reference/random/student_t_distribution/op_call.md | 4 +++- reference/random/student_t_distribution/op_constructor.md | 4 +++- reference/random/student_t_distribution/reset.md | 4 +++- reference/random/subtract_with_carry_engine.md | 3 ++- reference/random/uniform_int_distribution.md | 4 +++- reference/random/uniform_int_distribution/op_call.md | 4 +++- .../random/uniform_int_distribution/op_constructor.md | 4 +++- reference/random/uniform_int_distribution/reset.md | 4 +++- reference/random/uniform_real_distribution.md | 4 +++- reference/random/uniform_real_distribution/op_call.md | 4 +++- .../random/uniform_real_distribution/op_constructor.md | 4 +++- reference/random/uniform_real_distribution/reset.md | 4 +++- reference/random/weibull_distribution.md | 4 +++- reference/random/weibull_distribution/op_call.md | 4 +++- reference/random/weibull_distribution/op_constructor.md | 4 +++- reference/random/weibull_distribution/reset.md | 4 +++- start_editing/random_figure.md | 4 +++- 102 files changed, 308 insertions(+), 104 deletions(-) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index f6e68b3fa9..ac9611a03b 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -251,7 +251,6 @@ * std::mt19937[link /reference/random/mt19937.md] * std::random_device[link /reference/random/random_device.md] * std::uniform_int_distribution[link /reference/random/uniform_int_distribution.md] - * seed_gen()[link /reference/random/random_device/op_call.md] * [link /reference/ranges.md] * std::ranges::owning_view[link /reference/ranges/owning_view.md] * std::ranges::ref_view[link /reference/ranges/ref_view.md] diff --git a/lang/cpp11/thread_local_storage.md b/lang/cpp11/thread_local_storage.md index 150793b3c1..6fc63be014 100644 --- a/lang/cpp11/thread_local_storage.md +++ b/lang/cpp11/thread_local_storage.md @@ -51,13 +51,15 @@ t2.join(); #include #include #include +#include // 範囲[min_inclusive, max_inclusive]でランダム一様分布する整数を生成する。 // スレッドごとに乱数の状態を持つ。 int random_range(int min_inclusive, int max_inclusive) { std::random_device seed_gen; - thread_local std::mt19937 engine(seed_gen()); + std::uint32_t seed = seed_gen(); + thread_local std::mt19937 engine(seed); std::uniform_int_distribution dist(min_inclusive, max_inclusive); return dist(engine); } diff --git a/reference/algorithm/ranges_shuffle.md b/reference/algorithm/ranges_shuffle.md index 84858db080..4c5ef40ef4 100644 --- a/reference/algorithm/ranges_shuffle.md +++ b/reference/algorithm/ranges_shuffle.md @@ -58,6 +58,7 @@ namespace std::ranges { #include #include #include +#include int main() { std::vector v(10); @@ -69,7 +70,8 @@ int main() { // シャッフル std::random_device seed_gen; - std::mt19937 engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::mt19937 engine(seed); std::ranges::shuffle(v, engine); std::cout << " after: "; @@ -92,6 +94,7 @@ before: 0123456789 #include #include #include +#include int main() { std::string input = "0123456789abcdef"; @@ -100,7 +103,8 @@ int main() { // シャッフル std::random_device seed_gen; - std::mt19937 engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::mt19937 engine(seed); std::ranges::shuffle(input, engine); std::cout << " after: " << input << std::endl; diff --git a/reference/algorithm/shuffle.md b/reference/algorithm/shuffle.md index 48d2b0fb9a..73d432cbf5 100644 --- a/reference/algorithm/shuffle.md +++ b/reference/algorithm/shuffle.md @@ -43,6 +43,7 @@ namespace std { #include #include #include +#include int main() { std::vector v(10); @@ -54,7 +55,8 @@ int main() { // シャッフル std::random_device seed_gen; - std::mt19937 engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::mt19937 engine(seed); std::shuffle(v.begin(), v.end(), engine); std::cout << " after: "; @@ -76,6 +78,7 @@ before: 0123456789 #include #include #include +#include int main() { std::string input = "0123456789abcdef"; @@ -84,7 +87,8 @@ int main() { // シャッフル std::random_device seed_gen; - std::mt19937 engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::mt19937 engine(seed); std::shuffle(input.begin(), input.end(), engine); std::cout << " after: " << input << std::endl; diff --git a/reference/random.md b/reference/random.md index cc1efd3fd3..f09f5dc71d 100644 --- a/reference/random.md +++ b/reference/random.md @@ -155,13 +155,15 @@ ```cpp example #include #include +#include int main() { // メルセンヌ・ツイスター法による擬似乱数生成器を、 // ハードウェア乱数をシードにして初期化 std::random_device seed_gen; - std::mt19937 engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::mt19937 engine(seed); // 一様実数分布 // [-1.0f, 1.0f)の値の範囲で、等確率に実数を生成する diff --git a/reference/random/bernoulli_distribution.md b/reference/random/bernoulli_distribution.md index be9e19f88a..0571fa9f52 100644 --- a/reference/random/bernoulli_distribution.md +++ b/reference/random/bernoulli_distribution.md @@ -72,11 +72,13 @@ namespace std { ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // 確率0.7でtrueを生成し、確率0.3(1.0 - 0.7)でfalseを生成する std::bernoulli_distribution dist(0.7); diff --git a/reference/random/bernoulli_distribution/op_call.md b/reference/random/bernoulli_distribution/op_call.md index 9a19aaca66..e84b04dd1c 100644 --- a/reference/random/bernoulli_distribution/op_call.md +++ b/reference/random/bernoulli_distribution/op_call.md @@ -31,11 +31,13 @@ result_type operator()(URBG& g, const param_type& parm); // (2) ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::mt19937 engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::mt19937 engine(seed); std::cout << std::boolalpha; diff --git a/reference/random/bernoulli_distribution/op_constructor.md b/reference/random/bernoulli_distribution/op_constructor.md index 2ae007dad2..7d8208c123 100644 --- a/reference/random/bernoulli_distribution/op_constructor.md +++ b/reference/random/bernoulli_distribution/op_constructor.md @@ -31,11 +31,13 @@ explicit bernoulli_distribution(const param_type& parm); // (3) ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); std::cout << std::boolalpha; diff --git a/reference/random/bernoulli_distribution/reset.md b/reference/random/bernoulli_distribution/reset.md index 2f716020b1..aa40fad234 100644 --- a/reference/random/bernoulli_distribution/reset.md +++ b/reference/random/bernoulli_distribution/reset.md @@ -30,11 +30,13 @@ void reset(); ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); std::bernoulli_distribution dist(0.5); diff --git a/reference/random/binomial_distribution.md b/reference/random/binomial_distribution.md index cebca14475..d35b8b8a94 100644 --- a/reference/random/binomial_distribution.md +++ b/reference/random/binomial_distribution.md @@ -76,11 +76,13 @@ namespace std { ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // 成功確率0.5の事象を5回試行する std::binomial_distribution<> dist(5, 0.5); diff --git a/reference/random/binomial_distribution/op_call.md b/reference/random/binomial_distribution/op_call.md index 00c3bb046d..c3e536371a 100644 --- a/reference/random/binomial_distribution/op_call.md +++ b/reference/random/binomial_distribution/op_call.md @@ -30,11 +30,13 @@ result_type operator()(URBG& g, const param_type& parm); // (2) ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // (1) { diff --git a/reference/random/binomial_distribution/op_constructor.md b/reference/random/binomial_distribution/op_constructor.md index 9467f1d85a..2e5d16913d 100644 --- a/reference/random/binomial_distribution/op_constructor.md +++ b/reference/random/binomial_distribution/op_constructor.md @@ -31,11 +31,13 @@ explicit binomial_distribution(const param_type& parm); // (3) ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // パラメータを個別に指定する { diff --git a/reference/random/binomial_distribution/reset.md b/reference/random/binomial_distribution/reset.md index fd02099093..f37755729a 100644 --- a/reference/random/binomial_distribution/reset.md +++ b/reference/random/binomial_distribution/reset.md @@ -30,11 +30,13 @@ void reset(); ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); std::binomial_distribution<> dist(3, 0.5); diff --git a/reference/random/cauchy_distribution.md b/reference/random/cauchy_distribution.md index 5d0eb491d8..094c211178 100644 --- a/reference/random/cauchy_distribution.md +++ b/reference/random/cauchy_distribution.md @@ -82,11 +82,13 @@ $$ p(x \mid a, b) = \left( \pi b \left(1 + \left( \frac{x-a}{b} \right) ^2 \righ ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // 位置母数0.0、尺度母数1.0で分布させる std::cauchy_distribution<> dist(0.0, 1.0); diff --git a/reference/random/cauchy_distribution/op_call.md b/reference/random/cauchy_distribution/op_call.md index 9a4d080675..3da26c2d0c 100644 --- a/reference/random/cauchy_distribution/op_call.md +++ b/reference/random/cauchy_distribution/op_call.md @@ -30,11 +30,13 @@ result_type operator()(URBG& g, const param_type& parm); // (2) ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // (1) { diff --git a/reference/random/cauchy_distribution/op_constructor.md b/reference/random/cauchy_distribution/op_constructor.md index 6d1c3892aa..55d23852af 100644 --- a/reference/random/cauchy_distribution/op_constructor.md +++ b/reference/random/cauchy_distribution/op_constructor.md @@ -31,11 +31,13 @@ explicit cauchy_distribution(const param_type& parm); // (3) ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // パラメータを個別に指定する { diff --git a/reference/random/cauchy_distribution/reset.md b/reference/random/cauchy_distribution/reset.md index 7c3242f8ac..63e26824a2 100644 --- a/reference/random/cauchy_distribution/reset.md +++ b/reference/random/cauchy_distribution/reset.md @@ -30,11 +30,13 @@ void reset(); ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); std::cauchy_distribution<> dist(0.0, 1.0); diff --git a/reference/random/chi_squared_distribution.md b/reference/random/chi_squared_distribution.md index 6c8d324ccd..9eeab33a91 100644 --- a/reference/random/chi_squared_distribution.md +++ b/reference/random/chi_squared_distribution.md @@ -83,11 +83,13 @@ $$ p(x \mid n) = \frac{x^{n/2 - 1} \cdot e^{-x/2}}{\Gamma (n/2) \cdot 2^{n/2}} $ ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // 自由度1で分布させる std::chi_squared_distribution<> dist(1.0); diff --git a/reference/random/chi_squared_distribution/op_call.md b/reference/random/chi_squared_distribution/op_call.md index ba3520ca8b..acb3806ff0 100644 --- a/reference/random/chi_squared_distribution/op_call.md +++ b/reference/random/chi_squared_distribution/op_call.md @@ -30,11 +30,13 @@ result_type operator()(URBG& g, const param_type& parm); // (2) ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // (1) { diff --git a/reference/random/chi_squared_distribution/op_constructor.md b/reference/random/chi_squared_distribution/op_constructor.md index f81dbe44c6..8966058aca 100644 --- a/reference/random/chi_squared_distribution/op_constructor.md +++ b/reference/random/chi_squared_distribution/op_constructor.md @@ -31,11 +31,13 @@ explicit chi_squared_distribution(const param_type& parm); // (3) ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // パラメータを個別に指定する { diff --git a/reference/random/chi_squared_distribution/reset.md b/reference/random/chi_squared_distribution/reset.md index 1a9bb69052..481ea0e368 100644 --- a/reference/random/chi_squared_distribution/reset.md +++ b/reference/random/chi_squared_distribution/reset.md @@ -30,11 +30,13 @@ void reset(); ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); std::chi_squared_distribution<> dist(1.0); diff --git a/reference/random/default_random_engine.md b/reference/random/default_random_engine.md index ad88848573..d659f5ae7c 100644 --- a/reference/random/default_random_engine.md +++ b/reference/random/default_random_engine.md @@ -30,11 +30,13 @@ namespace std { ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); std::uniform_int_distribution<> dist(0, 3); diff --git a/reference/random/discrete_distribution.md b/reference/random/discrete_distribution.md index f182838ac2..2ab15341b0 100644 --- a/reference/random/discrete_distribution.md +++ b/reference/random/discrete_distribution.md @@ -71,11 +71,13 @@ namespace std { #include #include #include +#include int main() { std::random_device seed_gen; - std::mt19937 engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::mt19937 engine(seed); // 確率列を定義 // 浮動小数点数の範囲として定義する。合計値が1.0や10.0のような切りの良い数値である必要はない。 diff --git a/reference/random/discrete_distribution/op_call.md b/reference/random/discrete_distribution/op_call.md index 745d03593c..73e7111886 100644 --- a/reference/random/discrete_distribution/op_call.md +++ b/reference/random/discrete_distribution/op_call.md @@ -30,11 +30,13 @@ result_type operator()(URBG& g, const param_type& parm); // (2) ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::mt19937 engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::mt19937 engine(seed); // (1) { diff --git a/reference/random/discrete_distribution/op_constructor.md b/reference/random/discrete_distribution/op_constructor.md index e013e2dc8c..6f132b8254 100644 --- a/reference/random/discrete_distribution/op_constructor.md +++ b/reference/random/discrete_distribution/op_constructor.md @@ -49,11 +49,13 @@ explicit discrete_distribution(const param_type& parm); // (5) #include #include #include +#include int main() { std::random_device seed_gen; - std::mt19937 engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::mt19937 engine(seed); // (1) { diff --git a/reference/random/discrete_distribution/reset.md b/reference/random/discrete_distribution/reset.md index fa7e4cdb47..eb707a4ba2 100644 --- a/reference/random/discrete_distribution/reset.md +++ b/reference/random/discrete_distribution/reset.md @@ -28,11 +28,13 @@ void reset(); ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::mt19937 engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::mt19937 engine(seed); std::discrete_distribution<> dist = {0.1, 0.2, 0.3}; diff --git a/reference/random/exponential_distribution.md b/reference/random/exponential_distribution.md index 7adbe2fb1c..5475611b45 100644 --- a/reference/random/exponential_distribution.md +++ b/reference/random/exponential_distribution.md @@ -83,11 +83,13 @@ $$ p(x \mid \lambda) = \lambda e^{-\lambda x} $$ ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); std::exponential_distribution<> dist(1.0); diff --git a/reference/random/exponential_distribution/op_call.md b/reference/random/exponential_distribution/op_call.md index 2db55d534a..b0f0286089 100644 --- a/reference/random/exponential_distribution/op_call.md +++ b/reference/random/exponential_distribution/op_call.md @@ -30,11 +30,13 @@ result_type operator()(URBG& g, const param_type& parm); // (2) ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // (1) { diff --git a/reference/random/exponential_distribution/op_constructor.md b/reference/random/exponential_distribution/op_constructor.md index 8c89345cef..ab5d1a963c 100644 --- a/reference/random/exponential_distribution/op_constructor.md +++ b/reference/random/exponential_distribution/op_constructor.md @@ -31,11 +31,13 @@ explicit exponential_distribution(const param_type& parm); // (3) ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // (2) { diff --git a/reference/random/exponential_distribution/reset.md b/reference/random/exponential_distribution/reset.md index 51b6b97d67..1c63112ad8 100644 --- a/reference/random/exponential_distribution/reset.md +++ b/reference/random/exponential_distribution/reset.md @@ -30,11 +30,13 @@ void reset(); ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); std::exponential_distribution<> dist(1.0); diff --git a/reference/random/extreme_value_distribution.md b/reference/random/extreme_value_distribution.md index 3e2219e93b..d2a843602b 100644 --- a/reference/random/extreme_value_distribution.md +++ b/reference/random/extreme_value_distribution.md @@ -82,11 +82,13 @@ $$ p(x \mid a, b) = \frac{1}{b} \cdot \exp \left( \frac{a-x}{b} - \exp \left( \f ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // 位置パラメータ0.0、尺度パラメータ1.0で分布させる std::extreme_value_distribution<> dist(0.0, 1.0); diff --git a/reference/random/extreme_value_distribution/op_call.md b/reference/random/extreme_value_distribution/op_call.md index d5fbcbfc36..25eebd5c57 100644 --- a/reference/random/extreme_value_distribution/op_call.md +++ b/reference/random/extreme_value_distribution/op_call.md @@ -30,11 +30,13 @@ result_type operator()(URBG& g, const param_type& parm); // (2) ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // (1) { diff --git a/reference/random/extreme_value_distribution/op_constructor.md b/reference/random/extreme_value_distribution/op_constructor.md index e53b0f53e1..e89572b3dc 100644 --- a/reference/random/extreme_value_distribution/op_constructor.md +++ b/reference/random/extreme_value_distribution/op_constructor.md @@ -31,11 +31,13 @@ explicit extreme_value_distribution(const param_type& parm); // (3) ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // (2) パラメータを個別に指定する { diff --git a/reference/random/extreme_value_distribution/reset.md b/reference/random/extreme_value_distribution/reset.md index 5acfaf50f9..8f99d43113 100644 --- a/reference/random/extreme_value_distribution/reset.md +++ b/reference/random/extreme_value_distribution/reset.md @@ -30,11 +30,13 @@ void reset(); ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); std::extreme_value_distribution<> dist(0.0, 1.0); diff --git a/reference/random/fisher_f_distribution.md b/reference/random/fisher_f_distribution.md index ebb73aa678..e6c0f46d79 100644 --- a/reference/random/fisher_f_distribution.md +++ b/reference/random/fisher_f_distribution.md @@ -80,11 +80,13 @@ $$ p(x \mid m, n) = \frac{\Gamma ((m+n)/2)}{\Gamma (m/2) \Gamma (n/2)} \cdot \le ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // 自由度5と10で分布させる std::fisher_f_distribution<> dist(5, 10); diff --git a/reference/random/fisher_f_distribution/op_call.md b/reference/random/fisher_f_distribution/op_call.md index 13f62b1ad6..a73dca997f 100644 --- a/reference/random/fisher_f_distribution/op_call.md +++ b/reference/random/fisher_f_distribution/op_call.md @@ -30,11 +30,13 @@ result_type operator()(URBG& g, const param_type& parm); // (2) ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // (1) { diff --git a/reference/random/fisher_f_distribution/op_constructor.md b/reference/random/fisher_f_distribution/op_constructor.md index ebb5ddeaed..a2439e6d9e 100644 --- a/reference/random/fisher_f_distribution/op_constructor.md +++ b/reference/random/fisher_f_distribution/op_constructor.md @@ -31,11 +31,13 @@ explicit fisher_f_distribution(const param_type& parm); // (3) ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // パラメータを個別に指定する { diff --git a/reference/random/fisher_f_distribution/reset.md b/reference/random/fisher_f_distribution/reset.md index 7f5ddeb87c..231a6a1206 100644 --- a/reference/random/fisher_f_distribution/reset.md +++ b/reference/random/fisher_f_distribution/reset.md @@ -30,11 +30,13 @@ void reset(); ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); std::fisher_f_distribution<> dist(3.0, 4.0); diff --git a/reference/random/gamma_distribution.md b/reference/random/gamma_distribution.md index 24d7c11a1a..da51ffbb28 100644 --- a/reference/random/gamma_distribution.md +++ b/reference/random/gamma_distribution.md @@ -83,11 +83,13 @@ $$ p(x \mid \alpha, \beta) = \frac{e^{-x/\beta}}{\beta^{\alpha} \cdot \Gamma(\al ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // 形状母数1.0、尺度母数1.0で分布させる std::gamma_distribution<> dist(1.0, 1.0); diff --git a/reference/random/gamma_distribution/op_call.md b/reference/random/gamma_distribution/op_call.md index 2584cc71bd..62b1aced76 100644 --- a/reference/random/gamma_distribution/op_call.md +++ b/reference/random/gamma_distribution/op_call.md @@ -30,11 +30,13 @@ result_type operator()(URBG& g, const param_type& parm); // (2) ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // (1) { diff --git a/reference/random/gamma_distribution/op_constructor.md b/reference/random/gamma_distribution/op_constructor.md index 4adec7d13d..56ae964b91 100644 --- a/reference/random/gamma_distribution/op_constructor.md +++ b/reference/random/gamma_distribution/op_constructor.md @@ -31,11 +31,13 @@ explicit gamma_distribution(const param_type& parm); // (3) ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // (2) パラメータを個別に指定する { diff --git a/reference/random/gamma_distribution/reset.md b/reference/random/gamma_distribution/reset.md index 7aae2df6c1..cc42702942 100644 --- a/reference/random/gamma_distribution/reset.md +++ b/reference/random/gamma_distribution/reset.md @@ -30,11 +30,13 @@ void reset(); ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); std::gamma_distribution<> dist(1.0, 1.0); diff --git a/reference/random/generate_canonical.md b/reference/random/generate_canonical.md index 5ec3e4750f..f5da186716 100644 --- a/reference/random/generate_canonical.md +++ b/reference/random/generate_canonical.md @@ -33,11 +33,13 @@ namespace std { ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::mt19937 engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::mt19937 engine(seed); for(int i = 0; i < 10; ++i) { // floatの仮数部桁数で、範囲[0.0, 1.0)のランダムなfloat値を生成する diff --git a/reference/random/generate_random.md b/reference/random/generate_random.md index 6b711fce42..6329d6461b 100644 --- a/reference/random/generate_random.md +++ b/reference/random/generate_random.md @@ -112,11 +112,13 @@ for (auto& x : v) { #include #include #include +#include int main() { std::random_device seed_gen; - std::mt19937 engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::mt19937 engine(seed); std::uniform_int_distribution dist{0, 100}; std::vector v(10); diff --git a/reference/random/geometric_distribution.md b/reference/random/geometric_distribution.md index 54924377ad..afe37ff521 100644 --- a/reference/random/geometric_distribution.md +++ b/reference/random/geometric_distribution.md @@ -78,11 +78,13 @@ namespace std { ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // 成功確率0.5の事象を、成功するまで試行する std::geometric_distribution<> dist(0.5); diff --git a/reference/random/geometric_distribution/op_call.md b/reference/random/geometric_distribution/op_call.md index 1ea44060ac..f65b2a0f0a 100644 --- a/reference/random/geometric_distribution/op_call.md +++ b/reference/random/geometric_distribution/op_call.md @@ -30,11 +30,13 @@ result_type operator()(URBG& g, const param_type& parm); // (2) ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // (1) { diff --git a/reference/random/geometric_distribution/op_constructor.md b/reference/random/geometric_distribution/op_constructor.md index 0b1a0dac9d..6badc85ee2 100644 --- a/reference/random/geometric_distribution/op_constructor.md +++ b/reference/random/geometric_distribution/op_constructor.md @@ -31,11 +31,13 @@ explicit geometric_distribution(const param_type& parm); // (3) ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // (2) パラメータを個別に指定する { diff --git a/reference/random/geometric_distribution/reset.md b/reference/random/geometric_distribution/reset.md index 1092dde648..92a2fe1b37 100644 --- a/reference/random/geometric_distribution/reset.md +++ b/reference/random/geometric_distribution/reset.md @@ -30,11 +30,13 @@ void reset(); ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); std::geometric_distribution<> dist(0.5); diff --git a/reference/random/knuth_b.md b/reference/random/knuth_b.md index 784b408adc..182d6c66f4 100644 --- a/reference/random/knuth_b.md +++ b/reference/random/knuth_b.md @@ -57,11 +57,13 @@ Donald Knuth氏の著書『The Art of Computer Programming, Second Edition, Volu ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::knuth_b engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::knuth_b engine(seed); for (int i = 0; i < 10; ++i) { std::uint64_t result = engine(); diff --git a/reference/random/linear_congruential_engine.md b/reference/random/linear_congruential_engine.md index 1178d1078f..f189c0a4d9 100644 --- a/reference/random/linear_congruential_engine.md +++ b/reference/random/linear_congruential_engine.md @@ -101,14 +101,16 @@ C言語から引き継いだ標準ライブラリ関数[`std::rand()`](/referenc ```cpp example #include #include +#include int main() { std::random_device seed_gen; + std::uint32_t seed = seed_gen(); // linear_congruential_engineのパラメータ設定済み別名であるminstd_randを使用する。 // ランダムなシードを使用して初期化 - std::minstd_rand engine(seed_gen()); + std::minstd_rand engine(seed); for (int i = 0; i < 10; ++i) { // 乱数を生成 diff --git a/reference/random/lognormal_distribution.md b/reference/random/lognormal_distribution.md index ac717b74e1..c114f3cf57 100644 --- a/reference/random/lognormal_distribution.md +++ b/reference/random/lognormal_distribution.md @@ -82,11 +82,13 @@ $$ p(x \mid m, s) = \frac{1}{sx \sqrt{2 \pi} } \cdot \exp \left( - \frac{(\ln x ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // 平均3.141592、標準偏差1.0で分布させる std::lognormal_distribution<> dist(3.141592, 1.0); diff --git a/reference/random/lognormal_distribution/op_call.md b/reference/random/lognormal_distribution/op_call.md index 3940da958d..eb6a693f2f 100644 --- a/reference/random/lognormal_distribution/op_call.md +++ b/reference/random/lognormal_distribution/op_call.md @@ -30,11 +30,13 @@ result_type operator()(URBG& g, const param_type& parm); // (2) ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // (1) { diff --git a/reference/random/lognormal_distribution/op_constructor.md b/reference/random/lognormal_distribution/op_constructor.md index 00bef3583a..02c0328061 100644 --- a/reference/random/lognormal_distribution/op_constructor.md +++ b/reference/random/lognormal_distribution/op_constructor.md @@ -31,11 +31,13 @@ explicit lognormal_distribution(const param_type& param); // (3) ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // (2) パラメータを個別に指定する { diff --git a/reference/random/lognormal_distribution/reset.md b/reference/random/lognormal_distribution/reset.md index 20dd66b398..f1d25a2910 100644 --- a/reference/random/lognormal_distribution/reset.md +++ b/reference/random/lognormal_distribution/reset.md @@ -34,11 +34,13 @@ void reset(); ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); std::lognormal_distribution<> dist(0.0, 1.0); diff --git a/reference/random/mersenne_twister_engine.md b/reference/random/mersenne_twister_engine.md index be41226f49..ffcd867062 100644 --- a/reference/random/mersenne_twister_engine.md +++ b/reference/random/mersenne_twister_engine.md @@ -126,14 +126,16 @@ namespace std { ```cpp example #include #include +#include int main() { std::random_device seed_gen; + std::uint32_t seed = seed_gen(); // mersenne_twister_engineのパラメータ設定済み別名であるmt19937を使用する。 // ランダムなシードを使用して初期化 - std::mt19937 engine(seed_gen()); + std::mt19937 engine(seed); for (int i = 0; i < 10; ++i) { // 乱数を生成 diff --git a/reference/random/minstd_rand.md b/reference/random/minstd_rand.md index 45f85e5b0d..da65f6d303 100644 --- a/reference/random/minstd_rand.md +++ b/reference/random/minstd_rand.md @@ -70,11 +70,13 @@ sizeof(uint_fast32_t) ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::minstd_rand engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::minstd_rand engine(seed); for (int i = 0; i < 10; ++i) { std::uint32_t result = engine(); diff --git a/reference/random/minstd_rand0.md b/reference/random/minstd_rand0.md index c0d216aa83..918dd0ec63 100644 --- a/reference/random/minstd_rand0.md +++ b/reference/random/minstd_rand0.md @@ -72,11 +72,13 @@ sizeof(uint_fast32_t) ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::minstd_rand0 engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::minstd_rand0 engine(seed); for (int i = 0; i < 10; ++i) { std::uint32_t result = engine(); diff --git a/reference/random/mt19937.md b/reference/random/mt19937.md index b685d83ee2..71336b4438 100644 --- a/reference/random/mt19937.md +++ b/reference/random/mt19937.md @@ -65,11 +65,13 @@ namespace std { ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::mt19937 engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::mt19937 engine(seed); for (int i = 0; i < 10; ++i) { std::uint32_t result = engine(); diff --git a/reference/random/mt19937_64.md b/reference/random/mt19937_64.md index ce1063161a..edc018dae0 100644 --- a/reference/random/mt19937_64.md +++ b/reference/random/mt19937_64.md @@ -63,11 +63,13 @@ namespace std { ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::mt19937_64 engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::mt19937_64 engine(seed); for (int i = 0; i < 10; ++i) { std::uint64_t result = engine(); diff --git a/reference/random/negative_binomial_distribution.md b/reference/random/negative_binomial_distribution.md index 0157ccc871..55a8c1483b 100644 --- a/reference/random/negative_binomial_distribution.md +++ b/reference/random/negative_binomial_distribution.md @@ -74,11 +74,13 @@ namespace std { ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // 成功確率0.5の事象を5回成功させる std::negative_binomial_distribution<> dist(5, 0.5); diff --git a/reference/random/negative_binomial_distribution/op_call.md b/reference/random/negative_binomial_distribution/op_call.md index 42490ed1c2..9e895c190e 100644 --- a/reference/random/negative_binomial_distribution/op_call.md +++ b/reference/random/negative_binomial_distribution/op_call.md @@ -30,11 +30,13 @@ result_type operator()(URBG& g, const param_type& parm); // (2) ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // (1) { diff --git a/reference/random/negative_binomial_distribution/op_constructor.md b/reference/random/negative_binomial_distribution/op_constructor.md index 9ca678e772..fe22e624d5 100644 --- a/reference/random/negative_binomial_distribution/op_constructor.md +++ b/reference/random/negative_binomial_distribution/op_constructor.md @@ -31,11 +31,13 @@ explicit negative_binomial_distribution(const param_type& parm); // (3) ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // (2) パラメータを個別に指定する { diff --git a/reference/random/negative_binomial_distribution/reset.md b/reference/random/negative_binomial_distribution/reset.md index 675a4b3319..6af7b51a7d 100644 --- a/reference/random/negative_binomial_distribution/reset.md +++ b/reference/random/negative_binomial_distribution/reset.md @@ -30,11 +30,13 @@ void reset(); ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); std::negative_binomial_distribution<> dist(3, 0.5); diff --git a/reference/random/normal_distribution.md b/reference/random/normal_distribution.md index e53c7095ca..ef76f95f06 100644 --- a/reference/random/normal_distribution.md +++ b/reference/random/normal_distribution.md @@ -81,11 +81,13 @@ $$ p(x \mid \mu, \sigma ) = \frac{1}{\sigma \sqrt{2 \pi}} \exp \left( - \frac{(x ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // 平均0.0、標準偏差1.0で分布させる std::normal_distribution<> dist(0.0, 1.0); diff --git a/reference/random/normal_distribution/op_call.md b/reference/random/normal_distribution/op_call.md index a7116bf0e9..2904e048f3 100644 --- a/reference/random/normal_distribution/op_call.md +++ b/reference/random/normal_distribution/op_call.md @@ -30,11 +30,13 @@ result_type operator()(URBG& g, const param_type& parm); // (2) ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // (1) { diff --git a/reference/random/normal_distribution/op_constructor.md b/reference/random/normal_distribution/op_constructor.md index 88ed206e06..1a10598abb 100644 --- a/reference/random/normal_distribution/op_constructor.md +++ b/reference/random/normal_distribution/op_constructor.md @@ -31,11 +31,13 @@ explicit normal_distribution(const param_type& parm); // (3) ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // (2) パラメータを個別に指定する { diff --git a/reference/random/normal_distribution/reset.md b/reference/random/normal_distribution/reset.md index fb2771a7a1..324d19d347 100644 --- a/reference/random/normal_distribution/reset.md +++ b/reference/random/normal_distribution/reset.md @@ -34,11 +34,13 @@ void reset(); ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); std::normal_distribution<> dist(0.0, 1.0); diff --git a/reference/random/philox4x32.md b/reference/random/philox4x32.md index 04bf3a41ca..7aaa75eca4 100644 --- a/reference/random/philox4x32.md +++ b/reference/random/philox4x32.md @@ -42,11 +42,13 @@ namespace std { ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::philox4x32 engine{seed_gen()}; + std::uint32_t seed = seed_gen(); + std::philox4x32 engine{seed}; for (int i = 0; i < 10; ++i) { std::uint32_t result = engine(); diff --git a/reference/random/philox4x64.md b/reference/random/philox4x64.md index 37375e8344..6ee4157e67 100644 --- a/reference/random/philox4x64.md +++ b/reference/random/philox4x64.md @@ -42,11 +42,13 @@ namespace std { ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::philox4x64 engine{seed_gen()}; + std::uint32_t seed = seed_gen(); + std::philox4x64 engine{seed}; for (int i = 0; i < 10; ++i) { std::uint64_t result = engine(); diff --git a/reference/random/philox_engine.md b/reference/random/philox_engine.md index b2f32377a1..634dce1a19 100644 --- a/reference/random/philox_engine.md +++ b/reference/random/philox_engine.md @@ -166,14 +166,16 @@ $ r \cdot w $ ビット ```cpp example #include #include +#include int main() { std::random_device seed_gen; + std::uint32_t seed = seed_gen(); // philox_engineのパラメータ設定済み別名であるphilox4x32を使用する。 // ランダムなシードを使用して初期化 - std::philox4x32 engine{seed_gen()}; + std::philox4x32 engine{seed}; for (int i = 0; i < 10; ++i) { // 乱数を生成 diff --git a/reference/random/piecewise_constant_distribution.md b/reference/random/piecewise_constant_distribution.md index cde6a68538..52dcda07b4 100644 --- a/reference/random/piecewise_constant_distribution.md +++ b/reference/random/piecewise_constant_distribution.md @@ -65,11 +65,13 @@ namespace std { #include #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // [0.0, 5.0)の値は、0.3の確率で出現する。 // [5.0, 10.0)の値は、0.5の確率で出現する。 diff --git a/reference/random/piecewise_constant_distribution/op_call.md b/reference/random/piecewise_constant_distribution/op_call.md index b8c9cc1a2c..2fd694bd19 100644 --- a/reference/random/piecewise_constant_distribution/op_call.md +++ b/reference/random/piecewise_constant_distribution/op_call.md @@ -31,11 +31,13 @@ result_type operator()(URBG& g, const param_type& parm); // (2) #include #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // [0.0, 0.5)の値は、確率0.3で出現する。 // [0.5, 1.0)の値は、確率0.5で出現する。 diff --git a/reference/random/piecewise_constant_distribution/op_constructor.md b/reference/random/piecewise_constant_distribution/op_constructor.md index 57ae4d8265..4a92373154 100644 --- a/reference/random/piecewise_constant_distribution/op_constructor.md +++ b/reference/random/piecewise_constant_distribution/op_constructor.md @@ -54,6 +54,7 @@ explicit piecewise_constant_distribution(const param_type& parm); // (5) #include #include #include +#include double always_one(double) { return 1.0; } @@ -61,7 +62,8 @@ double always_one(double) int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // (1) { diff --git a/reference/random/piecewise_constant_distribution/reset.md b/reference/random/piecewise_constant_distribution/reset.md index ddd9c14c1d..c0e3b6994a 100644 --- a/reference/random/piecewise_constant_distribution/reset.md +++ b/reference/random/piecewise_constant_distribution/reset.md @@ -29,11 +29,13 @@ void reset(); #include #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); std::array intervals = {0.0, 0.5, 1.0}; std::array densities = {0.3, 0.5}; diff --git a/reference/random/piecewise_linear_distribution.md b/reference/random/piecewise_linear_distribution.md index d42a6e4f30..45612a6e0c 100644 --- a/reference/random/piecewise_linear_distribution.md +++ b/reference/random/piecewise_linear_distribution.md @@ -65,11 +65,13 @@ namespace std { #include #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // [0.0, 5.0)の値は、出現確率が0.0から0.5まで線形に上昇する。 // [5.0, 10.0)の値は、出現確率が0.5から0.1まで線形に減少する。 diff --git a/reference/random/piecewise_linear_distribution/op_call.md b/reference/random/piecewise_linear_distribution/op_call.md index e48a5ae88a..1fe8b58cb3 100644 --- a/reference/random/piecewise_linear_distribution/op_call.md +++ b/reference/random/piecewise_linear_distribution/op_call.md @@ -31,11 +31,13 @@ result_type operator()(URBG& g, const param_type& parm); // (2) #include #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // [0.0, 5.0)の値は、出現確率が0.0から0.5まで線形に上昇する。 // [5.0, 10.0)の値は、出現確率が0.5から0.1まで線形に減少する。 diff --git a/reference/random/piecewise_linear_distribution/op_constructor.md b/reference/random/piecewise_linear_distribution/op_constructor.md index c7fadeae3d..361b23e598 100644 --- a/reference/random/piecewise_linear_distribution/op_constructor.md +++ b/reference/random/piecewise_linear_distribution/op_constructor.md @@ -53,6 +53,7 @@ explicit piecewise_linear_distribution(const param_type& parm); // (5) #include #include #include +#include double always_one(double) { return 1.0; } @@ -60,7 +61,8 @@ double always_one(double) int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // (1) { diff --git a/reference/random/piecewise_linear_distribution/reset.md b/reference/random/piecewise_linear_distribution/reset.md index 3eaca4a595..568b2bd468 100644 --- a/reference/random/piecewise_linear_distribution/reset.md +++ b/reference/random/piecewise_linear_distribution/reset.md @@ -29,11 +29,13 @@ void reset(); #include #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); std::array intervals = {0.0, 0.5, 1.0}; std::array densities = {0.0, 0.5, 0.0}; diff --git a/reference/random/poisson_distribution.md b/reference/random/poisson_distribution.md index c48cbdb5a3..4cb74ce97e 100644 --- a/reference/random/poisson_distribution.md +++ b/reference/random/poisson_distribution.md @@ -84,11 +84,13 @@ $$ p(x \mid \mu) = \frac{e^{-\mu} \mu^x}{x!} $$ ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // 平均値4.0で分布させる std::poisson_distribution<> dist(4.0); diff --git a/reference/random/poisson_distribution/op_call.md b/reference/random/poisson_distribution/op_call.md index 6c3e9453f7..77fed00907 100644 --- a/reference/random/poisson_distribution/op_call.md +++ b/reference/random/poisson_distribution/op_call.md @@ -30,11 +30,13 @@ result_type operator()(URBG& g, const param_type& parm); // (2) ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // (1) { diff --git a/reference/random/poisson_distribution/op_constructor.md b/reference/random/poisson_distribution/op_constructor.md index 4ee93a1493..f1d2b24bb4 100644 --- a/reference/random/poisson_distribution/op_constructor.md +++ b/reference/random/poisson_distribution/op_constructor.md @@ -31,11 +31,13 @@ explicit poisson_distribution(const param_type& parm); // (3) ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // (2) パラメータを個別に指定する { diff --git a/reference/random/poisson_distribution/reset.md b/reference/random/poisson_distribution/reset.md index a46434ca27..0b3c0b1f8e 100644 --- a/reference/random/poisson_distribution/reset.md +++ b/reference/random/poisson_distribution/reset.md @@ -30,11 +30,13 @@ void reset(); ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); std::poisson_distribution<> dist(1.0); diff --git a/reference/random/ranlux24.md b/reference/random/ranlux24.md index fd880f71d7..b7ee359ad2 100644 --- a/reference/random/ranlux24.md +++ b/reference/random/ranlux24.md @@ -56,11 +56,13 @@ RANLUX法は、0から4までの贅沢さレベル(luxury level)が選択可能 ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::ranlux24 engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::ranlux24 engine(seed); for (int i = 0; i < 10; ++i) { std::uint32_t result = engine(); diff --git a/reference/random/ranlux48.md b/reference/random/ranlux48.md index 5b9d982511..2fb536e790 100644 --- a/reference/random/ranlux48.md +++ b/reference/random/ranlux48.md @@ -56,11 +56,13 @@ RANLUX法は、0から4までの贅沢さレベル(luxury level)が選択可能 ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::ranlux48 engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::ranlux48 engine(seed); for (int i = 0; i < 10; ++i) { std::uint64_t result = engine(); diff --git a/reference/random/student_t_distribution.md b/reference/random/student_t_distribution.md index 90265d1ac9..744d457ae9 100644 --- a/reference/random/student_t_distribution.md +++ b/reference/random/student_t_distribution.md @@ -81,11 +81,13 @@ $$ p(x \mid n) = \frac{1}{\sqrt{n \pi}} \cdot \frac{\Gamma((n+1)/2)}{\Gamma(n/2) ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // 自由度1.0で分布させる std::student_t_distribution<> dist(1.0); diff --git a/reference/random/student_t_distribution/op_call.md b/reference/random/student_t_distribution/op_call.md index 43d355b717..3137b6f410 100644 --- a/reference/random/student_t_distribution/op_call.md +++ b/reference/random/student_t_distribution/op_call.md @@ -30,11 +30,13 @@ result_type operator()(URBG& g, const param_type& parm); // (2) ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // (1) { diff --git a/reference/random/student_t_distribution/op_constructor.md b/reference/random/student_t_distribution/op_constructor.md index 387fbf4eb5..f0bb96c065 100644 --- a/reference/random/student_t_distribution/op_constructor.md +++ b/reference/random/student_t_distribution/op_constructor.md @@ -31,11 +31,13 @@ explicit student_t_distribution(const param_type& parm); // (3) ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // (2) パラメータを個別に指定する { diff --git a/reference/random/student_t_distribution/reset.md b/reference/random/student_t_distribution/reset.md index 9fa2a35d18..23eb27ecca 100644 --- a/reference/random/student_t_distribution/reset.md +++ b/reference/random/student_t_distribution/reset.md @@ -30,11 +30,13 @@ void reset(); ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); std::student_t_distribution<> dist(1.0); diff --git a/reference/random/subtract_with_carry_engine.md b/reference/random/subtract_with_carry_engine.md index 4f9d01b15e..d77c7e0f19 100644 --- a/reference/random/subtract_with_carry_engine.md +++ b/reference/random/subtract_with_carry_engine.md @@ -105,10 +105,11 @@ namespace std { int main() { std::random_device seed_gen; + std::uint32_t seed = seed_gen(); // subtract_with_carry_engineのパラメータ設定済み別名であるranlux24_baseを使用する。 // ランダムなシードを使用して初期化 - std::ranlux24_base engine(seed_gen()); + std::ranlux24_base engine(seed); for (int i = 0; i < 10; ++i) { // 乱数を生成 diff --git a/reference/random/uniform_int_distribution.md b/reference/random/uniform_int_distribution.md index 65110008c9..bc98e03ea7 100644 --- a/reference/random/uniform_int_distribution.md +++ b/reference/random/uniform_int_distribution.md @@ -77,11 +77,13 @@ namespace std { ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // 0以上9以下の値を等確率で発生させる std::uniform_int_distribution<> dist(0, 9); diff --git a/reference/random/uniform_int_distribution/op_call.md b/reference/random/uniform_int_distribution/op_call.md index 6eec7acff6..5e82595a0c 100644 --- a/reference/random/uniform_int_distribution/op_call.md +++ b/reference/random/uniform_int_distribution/op_call.md @@ -31,11 +31,13 @@ result_type operator()(URBG& g, const param_type& parm); // (2) ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::mt19937 engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::mt19937 engine(seed); // (1) { diff --git a/reference/random/uniform_int_distribution/op_constructor.md b/reference/random/uniform_int_distribution/op_constructor.md index 857ab82286..5207b3f1c8 100644 --- a/reference/random/uniform_int_distribution/op_constructor.md +++ b/reference/random/uniform_int_distribution/op_constructor.md @@ -35,11 +35,13 @@ explicit uniform_int_distribution(const param_type& parm); / ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // (2) 範囲を指定する { diff --git a/reference/random/uniform_int_distribution/reset.md b/reference/random/uniform_int_distribution/reset.md index 9d8d7d2ce0..a60f9f5ca2 100644 --- a/reference/random/uniform_int_distribution/reset.md +++ b/reference/random/uniform_int_distribution/reset.md @@ -28,11 +28,13 @@ void reset(); ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); std::uniform_int_distribution<> dist(0, 3); diff --git a/reference/random/uniform_real_distribution.md b/reference/random/uniform_real_distribution.md index cc3e5fe02a..8fc6e7cf42 100644 --- a/reference/random/uniform_real_distribution.md +++ b/reference/random/uniform_real_distribution.md @@ -70,11 +70,13 @@ namespace std { ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // 0.0以上1.0未満の値を等確率で発生させる std::uniform_real_distribution<> dist(0.0, 1.0); diff --git a/reference/random/uniform_real_distribution/op_call.md b/reference/random/uniform_real_distribution/op_call.md index 8ee256abe3..e2184ec92d 100644 --- a/reference/random/uniform_real_distribution/op_call.md +++ b/reference/random/uniform_real_distribution/op_call.md @@ -31,11 +31,13 @@ result_type operator()(URBG& g, const param_type& parm); // (2) ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::mt19937 engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::mt19937 engine(seed); // (1) { diff --git a/reference/random/uniform_real_distribution/op_constructor.md b/reference/random/uniform_real_distribution/op_constructor.md index 52da9ba0ff..1a51ad19a6 100644 --- a/reference/random/uniform_real_distribution/op_constructor.md +++ b/reference/random/uniform_real_distribution/op_constructor.md @@ -31,11 +31,13 @@ explicit uniform_real_distribution(const param_type& parm); // (3) ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // (2) 範囲を指定する { diff --git a/reference/random/uniform_real_distribution/reset.md b/reference/random/uniform_real_distribution/reset.md index 28891c43e7..304a8f1ebb 100644 --- a/reference/random/uniform_real_distribution/reset.md +++ b/reference/random/uniform_real_distribution/reset.md @@ -28,11 +28,13 @@ void reset(); ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); std::uniform_real_distribution<> dist(0.0, 1.0); diff --git a/reference/random/weibull_distribution.md b/reference/random/weibull_distribution.md index bcf45ea958..b47b886653 100644 --- a/reference/random/weibull_distribution.md +++ b/reference/random/weibull_distribution.md @@ -77,11 +77,13 @@ $$ p(x \mid a, b) = \frac{a}{b} \cdot \left( \frac{x}{b} \right)^{a-1} \cdot \ex ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // 形状パラメータ1.0、尺度パラメータ1.0で分布させる std::weibull_distribution<> dist1(1.0, 1.0); diff --git a/reference/random/weibull_distribution/op_call.md b/reference/random/weibull_distribution/op_call.md index d197c467a5..00aeee2419 100644 --- a/reference/random/weibull_distribution/op_call.md +++ b/reference/random/weibull_distribution/op_call.md @@ -30,11 +30,13 @@ result_type operator()(URBG& g, const param_type& parm); // (2) ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // (1) { diff --git a/reference/random/weibull_distribution/op_constructor.md b/reference/random/weibull_distribution/op_constructor.md index 19cf0e5067..ab2a426a44 100644 --- a/reference/random/weibull_distribution/op_constructor.md +++ b/reference/random/weibull_distribution/op_constructor.md @@ -31,11 +31,13 @@ explicit weibull_distribution(const param_type& parm); // (3) ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // (1) パラメータを個別に指定する { diff --git a/reference/random/weibull_distribution/reset.md b/reference/random/weibull_distribution/reset.md index 3a64f99107..14377d3b41 100644 --- a/reference/random/weibull_distribution/reset.md +++ b/reference/random/weibull_distribution/reset.md @@ -30,11 +30,13 @@ void reset(); ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); std::weibull_distribution<> dist(1.0, 1.0); diff --git a/start_editing/random_figure.md b/start_editing/random_figure.md index 3fe1ec4d68..b70989b53a 100644 --- a/start_editing/random_figure.md +++ b/start_editing/random_figure.md @@ -12,11 +12,13 @@ ```cpp example #include #include +#include int main() { std::random_device seed_gen; - std::default_random_engine engine(seed_gen()); + std::uint32_t seed = seed_gen(); + std::default_random_engine engine(seed); // 0以上9以下の値を等確率で発生させる std::uniform_int_distribution<> dist(0, 9); From 0abb645c91ed60aac74cd982c1462ddecae90bd6 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Sat, 1 Nov 2025 21:42:33 +0900 Subject: [PATCH 2440/3948] =?UTF-8?q?resize=5Fand=5Foverwrite=20:=20?= =?UTF-8?q?=E4=BA=8B=E5=89=8D=E6=9D=A1=E4=BB=B6=E3=81=AB=E5=BE=AE=E5=A6=99?= =?UTF-8?q?=E3=81=AB=E8=BF=BD=E8=A8=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/string/basic_string/resize_and_overwrite.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/string/basic_string/resize_and_overwrite.md b/reference/string/basic_string/resize_and_overwrite.md index 210ccc8846..9c5e3110dc 100644 --- a/reference/string/basic_string/resize_and_overwrite.md +++ b/reference/string/basic_string/resize_and_overwrite.md @@ -29,7 +29,7 @@ constexpr void resize_and_overwrite(size_type n, Operation op); // C++23 - 呼び出された `op` が例外を投げないこと。 - `op` の呼び出しで、第1引数・第2引数ともに変更されないこと。 - `r = std::move(op)(data(), n)` とすると、`0 <= r && r <= n` であること。 -- `[data(), data() + r)` の範囲に未初期化の要素がないこと。 +- `op`の呼び出し後、`[data(), data() + r)` の範囲に未初期化の要素がないこと。 ## 効果 From 63f0d13897c451ba1dad7dc5fe76124e5a6e2d10 Mon Sep 17 00:00:00 2001 From: suomesta Date: Wed, 5 Nov 2025 20:18:00 +0900 Subject: [PATCH 2441/3948] fix typo --- reference/string/basic_string/substr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/string/basic_string/substr.md b/reference/string/basic_string/substr.md index 44120e2a81..721573102b 100644 --- a/reference/string/basic_string/substr.md +++ b/reference/string/basic_string/substr.md @@ -107,7 +107,7 @@ int main() std::string result3 = std::string("hello").substr(5, 4); // C++20 : sから部分文字列のstringをコピーして作成、sは変更されない - // C++23 : sのリソースを再利用して部分文字列を保持するstringオブジェクトを作成、aは有効だが未規定な状態となる(C++23における動作変更) + // C++23 : sのリソースを再利用して部分文字列を保持するstringオブジェクトを作成、sは有効だが未規定な状態となる(C++23における動作変更) std::string result4 = std::move(s).substr(5, 4); } ``` From 4aac573e0beb4f68b6ddbf142806a4e40e7a66ea Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Sun, 9 Nov 2025 02:00:55 +0900 Subject: [PATCH 2442/3948] Fix typo in iterator traits documentation --- reference/iterator/input_iterator.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/iterator/input_iterator.md b/reference/iterator/input_iterator.md index 25d12448cc..fc2fc337d6 100644 --- a/reference/iterator/input_iterator.md +++ b/reference/iterator/input_iterator.md @@ -29,8 +29,8 @@ namespace std { 型`I`について、`std::iterator_traits`がプライマリテンプレートの特殊化となる場合、`ITER_TRAITS(I)`を`I`とする。それ以外の場合(`std::iterator_traits`の特殊化が存在する場合)、`ITER_TRAITS(I)`を`std::iterator_traits`とする。 -1. `ITER_TRAITS(I)::itertor_concept`が有効で型名を示す場合、`ITER_CONCEPT(I)`は`ITER_TRAITS(I)::itertor_concept` -2. `ITER_TRAITS(I)::itertor_category`が有効で型名を示す場合、`ITER_CONCEPT(I)`は`ITER_TRAITS(I)::itertor_category` +1. `ITER_TRAITS(I)::iterator_concept`が有効で型名を示す場合、`ITER_CONCEPT(I)`は`ITER_TRAITS(I)::iterator_concept` +2. `ITER_TRAITS(I)::iterator_category`が有効で型名を示す場合、`ITER_CONCEPT(I)`は`ITER_TRAITS(I)::iterator_category` 3. `std::iterator_traits`がプライマリテンプレートの特殊化となる場合、`ITER_CONCEPT(I)`は`random_access_iterator_tag` 4. 上記いずれにも当てはまらない場合、`ITER_CONCEPT(I)`は型名を示さない From b403dd0898f3d135bd1fae41157a9aee45ebe9b3 Mon Sep 17 00:00:00 2001 From: suomesta Date: Mon, 10 Nov 2025 22:21:07 +0900 Subject: [PATCH 2443/3948] add basic_string::subview() and basic_string_view::subview(). (#1503) --- reference/string/basic_string.md | 1 + reference/string/basic_string/subview.md | 90 +++++++++++++++++++ reference/string_view/basic_string_view.md | 1 + .../string_view/basic_string_view/substr.md | 4 + .../string_view/basic_string_view/subview.md | 80 +++++++++++++++++ 5 files changed, 176 insertions(+) create mode 100644 reference/string/basic_string/subview.md create mode 100644 reference/string_view/basic_string_view/subview.md diff --git a/reference/string/basic_string.md b/reference/string/basic_string.md index ba8e94fcc0..c4682fac5b 100644 --- a/reference/string/basic_string.md +++ b/reference/string/basic_string.md @@ -145,6 +145,7 @@ namespace std { | [`find_first_not_of`](basic_string/find_first_not_of.md) | 先頭から、指定文字が見つからない位置を検索する | | | [`find_last_not_of`](basic_string/find_last_not_of.md) | 末尾から、指定文字が見つからない位置を検索する | | | [`substr`](basic_string/substr.md) | 部分文字列を取得する | | +| [`subview`](basic_string/subview.md) | 部分文字列の[`std::basic_string_view`](/reference/string_view/basic_string_view.md)を構築する | C++26 | | [`compare`](basic_string/compare.md) | 他の文字列との比較を行う | | | [`starts_with`](basic_string/starts_with.md) | 指定の文字列で始まるかを判定する | C++20 | | [`ends_with`](basic_string/ends_with.md) | 指定の文字列で終わるかを判定する | C++20 | diff --git a/reference/string/basic_string/subview.md b/reference/string/basic_string/subview.md new file mode 100644 index 0000000000..364409e34a --- /dev/null +++ b/reference/string/basic_string/subview.md @@ -0,0 +1,90 @@ +# subview +* string[meta header] +* std[meta namespace] +* basic_string[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr basic_string_view + subview(size_type pos = 0, + size_type n = npos) const; +``` + +## 概要 +部分文字列の[`std::basic_string_view`](/reference/string_view/basic_string_view.md)を構築する。 +`pos`番目から`n`要素の[`std::basic_string_view`](/reference/string_view/basic_string_view.md)を返す。 +引数省略時は、先頭位置(`0`番目)から全要素(`npos`)の文字列を返す。 + + +## 要件 +`pos <=` [`size()`](size.md) + + +## 効果 +次と等価 : `return` [`basic_string_view`](/reference/string_view/basic_string_view.md)`(*this).`[`subview`](/reference/string_view/basic_string_view/subview.md)`(pos, n)`。 + + +## 注意 +本関数は使い方を誤ると、ぶら下がり参照が発生し得る。 +```cpp example +#include +#include +#include + +int main() { + // OK + std::string s(3, 'A'); + std::string_view sv = s.subview(); + std::println("{}", sv); + + // OK + std::println("{}", std::string(3, 'A').subview()); + + // NG! + std::string_view d = std::string(3, 'A').subview(); // ぶら下がり参照発生 + std::println("{}", d); // 不定動作 +} +``` + + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::string s = "Hello world!"; + + std::string_view sv = s.subview(6, 5); + + std::cout << sv; +} +``` +* subview[color ff0000] + +### 出力 +``` +world +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 + +- [P3044R2 sub-string_view from string](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3044r2.pdf) + + +## 関連項目 +- [`basic_string_view::subview`](/reference/string_view/basic_string_view/subview.md) diff --git a/reference/string_view/basic_string_view.md b/reference/string_view/basic_string_view.md index a3c916a8b7..ada82c5ce0 100644 --- a/reference/string_view/basic_string_view.md +++ b/reference/string_view/basic_string_view.md @@ -94,6 +94,7 @@ string_view hello = sv.substr(0, 5); // 先頭5文字を抽出する |------|------|----------------| | [`copy`](basic_string_view/copy.md) | 他の文字列に、自身の文字列をコピーする | C++17 | | [`substr`](basic_string_view/substr.md) | 部分文字列を取得する | C++17 | +| [`subview`](basic_string_view/subview.md) | 部分文字列を取得する | C++26 | | [`compare`](basic_string_view/compare.md) | 他の文字列との比較を行う | C++17 | | [`starts_with`](basic_string_view/starts_with.md) | 指定の文字列で始まるかを判定する | C++20 | | [`ends_with`](basic_string_view/ends_with.md) | 指定の文字列で終わるかを判定する | C++20 | diff --git a/reference/string_view/basic_string_view/substr.md b/reference/string_view/basic_string_view/substr.md index 2974a14df5..db451e9483 100644 --- a/reference/string_view/basic_string_view/substr.md +++ b/reference/string_view/basic_string_view/substr.md @@ -65,3 +65,7 @@ int main() - [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`subview`](subview.md) diff --git a/reference/string_view/basic_string_view/subview.md b/reference/string_view/basic_string_view/subview.md new file mode 100644 index 0000000000..6f098e061a --- /dev/null +++ b/reference/string_view/basic_string_view/subview.md @@ -0,0 +1,80 @@ +# subview +* string_view[meta header] +* std[meta namespace] +* basic_string_view[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr basic_string_view + subview(size_type pos = 0, + size_type n = npos) const; +``` + +## 概要 +部分文字列を取得する。 + +本関数は[`substr`](substr.md)と全く同じ動作である。[`std::string`](/reference/string/basic_string.md)とインターフェースを揃える目的で追加された。 + + +## 戻り値 +指定された位置`pos`から`n`文字からなる部分文字列を構築して返す。 + +[`size()`](size.md) `- pos`と`n`うち、小さい方を`rlen`とし、`basic_string_view(`[`data()`](data.md) `+ pos, rlen)`を返す。 + + +## 例外 +`pos >` [`size()`](size.md)の場合、[`std::out_of_range`](/reference/stdexcept.md)例外を送出する。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::string_view sv = "This is a pen"; + + std::string_view ret1 = sv.subview(5); // 5番目から最後までの文字列を取得 + std::string_view ret2 = sv.subview(5, 2); // 5番目から2文字の文字列を取得 + + std::cout << "1 : [" << ret1 << ']' << std::endl; + std::cout << "2 : [" << ret2 << ']' << std::endl; + + // subviewはデータを切り取るのではなく、参照位置と参照サイズを変更するだけなので、 + // 生ポインタを介せば全体の文字列を復元することはできる。 + const char* ret3 = ret1.data() - 5; + std::cout << "3 : [" << ret3 << ']' << std::endl; +} +``` +* subview[color ff0000] +* ret1.data()[link data.md] + +### 出力 +``` +1 : [is a pen] +2 : [is] +3 : [This is a pen] +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 + +- [P3044R2 sub-string_view from string](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3044r2.pdf) + + +## 関連項目 +- [`substr`](substr.md) +- [`basic_string::subview`](/reference/string/basic_string/subview.md) From ba21342e425dee870e198965930de266b607c7e1 Mon Sep 17 00:00:00 2001 From: suomesta Date: Wed, 12 Nov 2025 20:34:03 +0900 Subject: [PATCH 2444/3948] Add std::optional Range Support (#1431) --- reference/optional/optional.md | 19 +++++++++ reference/optional/optional/begin.md | 62 ++++++++++++++++++++++++++++ reference/optional/optional/end.md | 59 ++++++++++++++++++++++++++ 3 files changed, 140 insertions(+) create mode 100644 reference/optional/optional/begin.md create mode 100644 reference/optional/optional/end.md diff --git a/reference/optional/optional.md b/reference/optional/optional.md index 868f5cb868..08edd48c2e 100644 --- a/reference/optional/optional.md +++ b/reference/optional/optional.md @@ -8,6 +8,15 @@ namespace std { template class optional; + + + // viewコンセプトを有効化する (C++26) + template + constexpr bool ranges::enable_view> = true; + + // std::formatによるフォーマットを無効化する (C++26) + template + constexpr auto format_kind> = range_format::disabled; } ``` @@ -66,6 +75,14 @@ namespace std { | [`reset`](optional/reset.md) | 有効値を保持していない状態にする | C++17 | +### イテレータ + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`begin`](optional/begin.md) | `optional`をrangeとした時の先頭要素を指すイテレータを取得する | C++26 | +| [`end`](optional/end.md) | `optional`をrangeとした時の末尾要素の次を指すイテレータを取得する | C++26 | + + ### 値の観測 | 名前 | 説明 | 対応バージョン | @@ -92,6 +109,8 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| | `value_type` | 要素型`T` | C++17 | +| `iterator` | 実装定義のイテレータ型。[`contiguous_iterator`](/reference/iterator/contiguous_iterator.md)、[`random_access_iterator`](/reference/iterator/random_access_iterator.md)、constexprイテレータのモデルであり、コンテナのイテレータに対するすべての要件を満たす | C++26 | +| `const_iterator` | 実装定義の読み取り専用イテレータ型。[`contiguous_iterator`](/reference/iterator/contiguous_iterator.md)、[`random_access_iterator`](/reference/iterator/random_access_iterator.md)、constexprイテレータのモデルであり、コンテナのイテレータに対するすべての要件を満たす | C++26 | ## 非メンバ関数 diff --git a/reference/optional/optional/begin.md b/reference/optional/optional/begin.md new file mode 100644 index 0000000000..b2d0d3a7d7 --- /dev/null +++ b/reference/optional/optional/begin.md @@ -0,0 +1,62 @@ +# begin +* optional[meta header] +* std[meta namespace] +* optional[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr iterator begin() noexcept; // (1) +constexpr const_iterator begin() const noexcept; // (2) +``` + +## 概要 +`optional`をrangeとした時の先頭要素を指すイテレータを取得する。 + + +## 効果 +[`has_value()`](has_value.md) `== true`なら、保持している有効値を指すイテレータを返す。またこの時、[`distance`](/reference/iterator/distance.md)`(begin(),` [`end()`](end.md)`)` `== 1` となる。 + +[`has_value()`](has_value.md) `!= true`なら、末尾要素の次を指すイテレータを返す。この時、`begin() ==` [`end()`](end.md) である。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::optional p1 = 1; + for (auto i = p1.begin(); i != p1.end(); ++i) { + std::cout << *i; // 1度通る + } + + std::optional p2 = std::null_opt; + for (auto i = p2.begin(); i != p2.end(); ++i) { + std::cout << *i; // 1度も通らない + } +} +``` +* begin()[color ff0000] +* end()[link end.md] + +### 出力 +``` +1 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3168R2 Give std::optional Range Support](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3168r2.html) diff --git a/reference/optional/optional/end.md b/reference/optional/optional/end.md new file mode 100644 index 0000000000..3476e9e9a4 --- /dev/null +++ b/reference/optional/optional/end.md @@ -0,0 +1,59 @@ +# end +* optional[meta header] +* std[meta namespace] +* optional[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr iterator end() noexcept; // (1) +constexpr const_iterator end() const noexcept; // (2) +``` + +## 概要 +`optional`をrangeとした時の末尾要素の次を指すイテレータを取得する。 + + +## 効果 +[`begin()`](begin.md) `+` [`has_value()`](has_value.md) を返す。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::optional p = 1; + std::cout << std::distance(p.begin(), p.end()) << std::endl; + + p = std::null_opt; + std::cout << std::distance(p.begin(), p.end()) << std::endl; +} +``` +* end()[color ff0000] +* begin()[link begin.md] +* std::distance[link /reference/iterator/distance.md] + +### 出力 +``` +1 +0 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3168R2 Give std::optional Range Support](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3168r2.html) From 8d78d314a8a1e4d53ad28a905cf4231186328e8e Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 13 Nov 2025 15:41:58 +0900 Subject: [PATCH 2445/3948] =?UTF-8?q?nolink=E3=82=92=E8=A7=A3=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/cpp26.md b/lang/cpp26.md index 85bf70da89..24f5f528f1 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -444,8 +444,8 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [`std::optional`](/reference/optional/optional.md)クラスに、0もしくは1要素のRangeとして扱えるようにするための拡張として、イテレータインタフェースを追加 - `iterator`型 - `const_iterator`型 - - [`begin()`](/reference/optional/optional/begin.md.nolink)メンバ関数 - - [`end()`](/reference/optional/optional/end.md.nolink)メンバ関数 + - [`begin()`](/reference/optional/optional/begin.md)メンバ関数 + - [`end()`](/reference/optional/optional/end.md)メンバ関数 - [`std::optional`](/reference/optional/optional.md)に、参照を保持するための`T&`の部分特殊化を追加 - [`std::apply`](/reference/tuple/apply.md)の戻り値型推論をやめて、戻り値型用の[`std::apply_result`](/reference/tuple/apply_result.md.nolink)クラスを追加し、関連する以下の機能を追加 - [`std::is_applicable`](/reference/type_traits/is_applicable.md.nolink)型特性 From ea2968139416092204d3b893f40265b093e12d06 Mon Sep 17 00:00:00 2001 From: suomesta Date: Thu, 13 Nov 2025 20:39:17 +0900 Subject: [PATCH 2446/3948] fix typo of arguments name in std::optional::<=> --- reference/optional/optional/op_compare_3way.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/optional/optional/op_compare_3way.md b/reference/optional/optional/op_compare_3way.md index 0cd38a58ea..7dca3129ce 100644 --- a/reference/optional/optional/op_compare_3way.md +++ b/reference/optional/optional/op_compare_3way.md @@ -12,11 +12,11 @@ namespace std { template constexpr strong_ordering - operator<=>(const optional&, nullopt_t) noexcept; // (2) C++20 + operator<=>(const optional& x, nullopt_t) noexcept; // (2) C++20 template U> constexpr compare_three_way_result_t - operator<=>(const optional& x, const U& y); // (3) C++20 + operator<=>(const optional& x, const U& v); // (3) C++20 } ``` * nullopt_t[link /reference/optional/nullopt_t.md] From 8c34c7f0a4e98c1275327e31b9f7842bd44dadcf Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 18 Nov 2025 15:40:58 +0900 Subject: [PATCH 2447/3948] =?UTF-8?q?stop=5Fsource=E3=81=AE=E3=82=B3?= =?UTF-8?q?=E3=83=B3=E3=82=B9=E3=83=88=E3=83=A9=E3=82=AF=E3=82=BF=20:=20?= =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE=E9=A3=BE=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/stop_token/stop_source/op_constructor.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/stop_token/stop_source/op_constructor.md b/reference/stop_token/stop_source/op_constructor.md index 967e74a913..d0286e3f17 100644 --- a/reference/stop_token/stop_source/op_constructor.md +++ b/reference/stop_token/stop_source/op_constructor.md @@ -11,6 +11,7 @@ explicit stop_source(nostopstate_t) noexcept; // (2) stop_source(const stop_source& rhs) noexcept; // (3) stop_source(stop_source&& rhs) noexcept; // (4) ``` +* nostopstate_t[link ../nostopstate.md] ## 概要 - (1) : デフォルトコンストラクタ。停止状態を表すリソースを新たに確保して所有する。 From 69e0ab8414039815eade662cee420c947f654ab9 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 18 Nov 2025 15:51:48 +0900 Subject: [PATCH 2448/3948] =?UTF-8?q?stop=5Fsource=E3=81=AE=E3=82=B3?= =?UTF-8?q?=E3=83=B3=E3=82=B9=E3=83=88=E3=83=A9=E3=82=AF=E3=82=BF=20:=20?= =?UTF-8?q?=E3=81=95=E3=82=89=E3=81=AB=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE?= =?UTF-8?q?=E9=A3=BE=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/stop_token/stop_source/op_constructor.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/stop_token/stop_source/op_constructor.md b/reference/stop_token/stop_source/op_constructor.md index d0286e3f17..4ec0e0a4ab 100644 --- a/reference/stop_token/stop_source/op_constructor.md +++ b/reference/stop_token/stop_source/op_constructor.md @@ -57,6 +57,7 @@ int main() * std::move[link /reference/utility/move.md] * std::stop_source[link ../stop_source.md] * std::nostopstate[link ../nostopstate.md] +* stop_possible()[link stop_possible.md] * stop_requested()[link stop_requested.md] * request_stop()[link request_stop.md] From 7f588717e737c2fb13ddfe184fe7e65ffc0bf6d6 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 21 Nov 2025 16:52:00 +0900 Subject: [PATCH 2449/3948] =?UTF-8?q?partition=5Fcopy:=20=E3=83=AA?= =?UTF-8?q?=E3=83=B3=E3=82=AF=E3=83=9F=E3=82=B9=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/partition_copy.md | 1 - 1 file changed, 1 deletion(-) diff --git a/reference/algorithm/partition_copy.md b/reference/algorithm/partition_copy.md index 399627dcda..cdcac74000 100644 --- a/reference/algorithm/partition_copy.md +++ b/reference/algorithm/partition_copy.md @@ -106,7 +106,6 @@ int main() } ``` * std::partition_copy[color ff0000] -* is_even[link /reference/algorithm/is_partitioned.md] ### 出力 ``` From f0a54869040e6ea1b07bbfac70566f52c0c2bfdc Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 21 Nov 2025 17:33:39 +0900 Subject: [PATCH 2450/3948] =?UTF-8?q?algorithm=20:=20=E3=83=AA=E3=83=B3?= =?UTF-8?q?=E3=82=AF=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/count_if.md | 1 - .../algorithm/lexicographical_compare_three_way.md | 12 ++++++------ reference/algorithm/move.md | 1 - 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/reference/algorithm/count_if.md b/reference/algorithm/count_if.md index ee073c087a..1f3e8983e6 100644 --- a/reference/algorithm/count_if.md +++ b/reference/algorithm/count_if.md @@ -53,7 +53,6 @@ int main() { } ``` * std::count_if[color ff0000] -* std::count_if[link /reference/algorithm/count_if.md] ### 出力 ```cpp diff --git a/reference/algorithm/lexicographical_compare_three_way.md b/reference/algorithm/lexicographical_compare_three_way.md index af65f303d7..e90fa6bb4b 100644 --- a/reference/algorithm/lexicographical_compare_three_way.md +++ b/reference/algorithm/lexicographical_compare_three_way.md @@ -118,12 +118,12 @@ int main() { * std::isalpha[link /reference/cctype/isalpha.md] * std::tolower[link /reference/cctype/tolower.md] * weak_ordering[link /reference/compare/weak_ordering.md] -* str1.begin[link /reference/string/string/begin.md.nolink] -* str1.end[link /reference/string/string/end.md.nolink] -* str2.begin[link /reference/string/string/begin.md.nolink] -* str2.end[link /reference/string/string/end.md.nolink] -* str3.begin[link /reference/string/string/begin.md.nolink] -* str3.end[link /reference/string/string/end.md.nolink] +* str1.begin[link /reference/string/basic_string/begin.md] +* str1.end[link /reference/string/basic_string/end.md] +* str2.begin[link /reference/string/basic_string/begin.md] +* str2.end[link /reference/string/basic_string/end.md] +* str3.begin[link /reference/string/basic_string/begin.md] +* str3.end[link /reference/string/basic_string/end.md] ### 出力例 ``` diff --git a/reference/algorithm/move.md b/reference/algorithm/move.md index 5449dfe49f..a52904c38a 100644 --- a/reference/algorithm/move.md +++ b/reference/algorithm/move.md @@ -73,7 +73,6 @@ int main() { ``` * std::move[color ff0000] * v.emplace_back[link /reference/vector/vector/emplace_back.md] -* v.emplace_back[link /reference/vector/vector/emplace_back.md] ### 出力 ``` From 7d65995ca4836069fefdcb8401b4ccb90e294af4 Mon Sep 17 00:00:00 2001 From: suomesta Date: Mon, 24 Nov 2025 15:42:45 +0900 Subject: [PATCH 2451/3948] add feature test macros of C++26 --- lang/cpp26/feature_test_macros.md | 190 ++++++++++++++++++++++++++++++ reference/version.md | 1 + 2 files changed, 191 insertions(+) create mode 100755 lang/cpp26/feature_test_macros.md diff --git a/lang/cpp26/feature_test_macros.md b/lang/cpp26/feature_test_macros.md new file mode 100755 index 0000000000..017aa79272 --- /dev/null +++ b/lang/cpp26/feature_test_macros.md @@ -0,0 +1,190 @@ +# 機能テストマクロ +* cpp26[meta cpp] + + + +このページはC++26に採用された言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 + + + +## 概要 + +### 言語機能 + +| マクロ名 | 値 | 機能 | +|----------|----|------| +|`__cpp_constexpr`|`202406L`|[定数式での`void*`からポインタ型へのキャストを許可](/lang/cpp26/constexpr_cast_from_voidptr.md)
[`constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md)| +|`__cpp_constexpr_exceptions`|`202411L`|[定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md)| +|`__cpp_constexpr_virtual_inheritance`|`202506L`|`constexpr`仮想継承を許可| +|`__cpp_contracts`|`202502L`|[契約プログラミングをサポートする](/lang/cpp26/contracts.md)| +|`__cpp_deleted_function`|`202403L`|[関数宣言を削除する理由を指定できるようにする](/lang/cpp26/delete_reason.md)| +|`__cpp_expansion_statements`|`202506L`|[コンパイル時のタプルやリストを展開処理する`template for`文](/lang/cpp26/expansion_statements.md.nolink)| +|`__cpp_impl_reflection`|`202506L`|静的リフレクション| +|`__cpp_pack_indexing`|`202311L`|[パラメータパックへのインデックスアクセスを許可](/lang/cpp26/pack_indexing.md)| +|`__cpp_placeholder_variables`|`202306L`|[宣言のみで使用しない変数の名前として`_`をサポート](/lang/cpp26/nice_placeholder_with_no_name.md)| +|`__cpp_pp_embed`|`202502L`|[ファイルを読み込む`#embed`命令を追加](/lang/cpp26/embed.md)| +|`__cpp_static_assert`|`202306L`|[`static_assert`の診断メッセージにユーザーが生成した文字列の指定を許可](/lang/cpp26/user-generated_static_assert_messages.md)| +|`__cpp_structured_bindings`|`202411L`|[構造化束縛への属性を許可](/lang/cpp26/attributes_for_structured_bindings.md)
[構造化束縛でパックを導入できるようにする](/lang/cpp26/structured_bindings_can_introduce_a_pack.md)| +|`__cpp_template_parameters`|`202502L`|コンセプトと変数テンプレートにテンプレートテンプレートパラメータのサポートを追加| +|`__cpp_trivial_relocatability`|`202502L`|トリビアルな再配置| +|`__cpp_trivial_union`|`202502L`|共用体をトリビアルに未初期化できるようにする| +|`__cpp_variadic_friend`|`202403L`|[可変引数テンプレートで`friend`宣言をできるようにする](/lang/cpp26/variadic_friends.md)| + + +### ライブラリ + +ライブラリの機能テストマクロは全て[``](/reference/version.md)でも提供される。 + +| マクロ名 | 値 | 機能 | ヘッダ | +|----------|----|------|--------| +|`__cpp_lib_algorithm_default_value_type`|`202403L`|一部アルゴリズムに、値を波カッコ初期化で渡せるよう制約を追加|[``](/reference/algorithm.md), [``](/reference/ranges.md), [``](/reference/string.md), [``](/reference/deque.md), [``](/reference/list.md), [``](/reference/forward_list.md), [``](/reference/vector.md)| +|`__cpp_lib_aligned_accessor`|`202411L`|[``](/reference/mdspan.md)に、要素アクセスにアライメント保証を与える[`std::aligned_accessor`](/reference/mdspan/aligned_accessor.md)を追加|[``](/reference/mdspan.md)| +|`__cpp_lib_associative_heterogeneous_insertion`|`202306L`|連想コンテナの一部メンバ関数に、一時オブジェクト生成のコストを抑える拡張を追加|[``](/reference/map.md), [``](/reference/set.md), [``](/reference/unordered_map.md), [``](/reference/unordered_set.md)| +|`__cpp_lib_apply`|`202506L`| [`std::apply`](/reference/tuple/apply.md)の戻り値型推論をやめて、戻り値型用の[`std::apply_result`](/reference/tuple/apply_result.md.nolink)クラスを追加|[``](/reference/tuple.md), [``](/reference/type_traits.md)| +|`__cpp_lib_atomic_min_max`|`202506L`|[`std::atomic`](/reference/atomic/atomic.md)オブジェクトに対する2つの値の最大値・最小値を取得する関数を追加|[``](/reference/atomic.md)| +|`__cpp_lib_atomic_reductions`|`202506L`|[`std::atomic`](/reference/atomic/atomic.md)と[`std::atomic_ref`](/reference/atomic/atomic_ref.md)に高速な縮約用の操作を追加|[``](/reference/atomic.md)| +|`__cpp_lib_atomic_ref`|`202411L`|[`std::atomic_ref`](/reference/atomic/atomic_ref.md)に[`address()`](/reference/atomic/atomic_ref/address.md)メンバ関数を追加|[``](/reference/atomic.md)| +|`__cpp_lib_bind_back`|`202306L`|[`std::bind_back()`](/reference/functional/bind_back.md)に、非型テンプレート引数として関数を指定するオーバーロードを追加|[``](/reference/functional.md)| +|`__cpp_lib_bind_front`|`202306L`|[`std::bind_front()`](/reference/functional/bind_front.md)に、非型テンプレート引数として関数を指定するオーバーロードを追加|[``](/reference/functional.md)| +|`__cpp_lib_bitset`|`202306L`|[`std::bitset`](/reference/bitset/bitset.md)に、[`std::basic_string_view`](/reference/string_view/basic_string_view.md)を受け取るコンストラクタを追加|[``](/reference/bitset.md)| +|`__cpp_lib_chrono`|`202306L`|[``](/reference/chrono.md)のクラスに、ハッシュ値サポートとして[`std::hash`](/reference/functional/hash.md)の特殊化を追加|[``](/reference/chrono.md)| +|`__cpp_lib_constant_wrapper`|`202506L`|[``](/reference/type_traits.md)に[`std::constant_wrapper`](/reference/type_traits/constant_wrapper.md.nolink)を追加|[``](/reference/type_traits.md)| +|`__cpp_lib_constexpr_algorithms`|`202306L`|[`std::stable_sort()`](/reference/algorithm/stable_sort.md) / [`std::ranges::stable_sort()`](/reference/algorithm/ranges_stable_sort.md)を`constexpr`対応|[``](/reference/algorithm.md), [``](/reference/utility.md)| +|`__cpp_lib_constexpr_atomic`|`202411L`|[``](/reference/atomic.md)ライブラリのアトミック操作を`constexpr`対応|[``](/reference/atomic.md)| +|`__cpp_lib_constexpr_cmath`|`202306L`|[``](/reference/cmath.md)の関数 (特殊関数と丸めモードに依存する関数以外の全て) を`constexpr`対応|[``](/reference/cmath.md), [``](/reference/cstdlib.md)| +|`__cpp_lib_constexpr_complex`|`202306L`|[`std::complex`](/reference/complex/complex.md)の全関数を`constexpr`対応|[``](/reference/complex.md)| +|`__cpp_lib_constexpr_deque`|`202502L`|[`std::deque`](/reference/deque/deque.md)を`constexpr`対応|[``](/reference/deque.md)| +|`__cpp_lib_constexpr_exceptions`|`202502L`|[定数式での例外送出が許可されること](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md)にともない、例外クラスの関連機能を`constexpr`対応|[``](/reference/exception.md), [``](/reference/stdexcept.md), [``](/reference/expected.md), [``](/reference/optional.md), [``](/reference/variant.md), [``](/reference/format.md)| +|`__cpp_lib_constexpr_flat_map`|`202502L`|[`std::flat_map`](/reference/flat_map/flat_map.md) / [`std::flat_multimap`](/reference/flat_map/flat_multimap.md)を`constexpr`対応|[``](/reference/flat_map.md)| +|`__cpp_lib_constexpr_flat_set`|`202502L`|[`std::flat_set`](/reference/flat_set/flat_set.md) / [`std::flat_multiset`](/reference/flat_set/flat_multiset.md)を`constexpr`対応|[``](/reference/flat_set.md)| +|`__cpp_lib_constexpr_forward_list`|`202502L`|[`std::forward_list`](/reference/forward_list/forward_list.md)を`constexpr`対応|[``](/reference/forward_list.md)| +|`__cpp_lib_constexpr_inplace_vector`|`202502L`|[`std::inplace_vector`](/reference/inplace_vector/inplace_vector.md.nolink)を`constexpr`対応|[``](/reference/inplace_vector.md.nolink)| +|`__cpp_lib_constexpr_list`|`202502L`|[`std::list`](/reference/list/list.md)を`constexpr`対応|[``](/reference/list.md)| +|`__cpp_lib_constexpr_map`|`202502L`|[`std::map`](/reference/map/map.md) / [`std::multimap`](/reference/map/multimap.md)を`constexpr`対応|[``](/reference/map.md)| +|`__cpp_lib_constexpr_memory`|`202506L`|[`std::shared_ptr`](/reference/memory/shared_ptr.md)クラスとその関連機能を`constexpr`対応|[``](/reference/memory.md)| +|`__cpp_lib_constexpr_new`|`202406L`|[`constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md)|[``](/reference/new.md)| +|`__cpp_lib_constexpr_queue`|`202502L`|[`std::queue`](/reference/queue/queue.md) / [`std::priority_queue`](/reference/queue/priority_queue.md)を`constexpr`対応|[``](/reference/queue.md)| +|`__cpp_lib_constexpr_set`|`202502L`|[`std::set`](/reference/set/set.md) / [`std::multiset`](/reference/set/multiset.md)を`constexpr`対応|[``](/reference/set.md)| +|`__cpp_lib_constexpr_stack`|`202502L`|[`std::stack`](/reference/stack/stack.md)を`constexpr`対応|[``](/reference/stack.md)| +|`__cpp_lib_constexpr_unordered_map`|`202502L`|[`std::unordered_map`](/reference/unordered_map/unordered_map.md) / [`std::unordered_multimap`](/reference/unordered_map/unordered_multimap.md)を`constexpr`対応|[``](/reference/unordered_map.md)| +|`__cpp_lib_constexpr_unordered_set`|`202502L`|[`std::unordered_set`](/reference/unordered_set/unordered_set.md) / [`std::unordered_multiset`](/reference/unordered_set/unordered_multiset.md)を`constexpr`対応|[``](/reference/unordered_set.md)| +|`__cpp_lib_constrained_equality`|`202411L`|[`std::reference_wrapper`](/reference/functional/reference_wrapper.md)に、比較演算子[`==`](/reference/functional/reference_wrapper/op_equal.md)と[`<=>`](/reference/functional/reference_wrapper/op_compare_3way.md)を追加|[``](/reference/utility.md), [``](/reference/tuple.md), [``](/reference/optional.md), [``](/reference/variant.md), [``](/reference/expected.md)| +|`__cpp_lib_contracts`|`202502L`|[契約プログラミングをサポートする](/lang/cpp26/contracts.md)|[``](/reference/contracts.md)| +|`__cpp_lib_copyable_function`|`202306L`|[``](/reference/functional.md)に[`std::copyable_function`](/reference/functional/copyable_function.md)を追加|[``](/reference/functional.md)| +|`__cpp_lib_counting_scope`|`202506L`|[``](/reference/execution.md)に[`std::execution::spawn`](/reference/execution/execution/spawn.md)、[`std::execution::scope_token`](/reference/execution/execution/scope_token.md)などを追加|[``](/reference/execution.md)| +|`__cpp_lib_debugging`|`202403L`|デバッグサポートのライブラリとして[``](/reference/debugging.md)を追加|[``](/reference/debugging.md)| +|`__cpp_lib_define_static`|`202506L`||[``](/reference/meta.md.nolink)| +|`__cpp_lib_exception_ptr_cast`|`202506L`|[`std::exception_ptr`](/reference/exception/exception_ptr.md)を指定した例外型にキャストする[`std::exception_ptr_cast()`](/reference/exception/exception_ptr_cast.md.nolink)関数を追加|[``](/reference/exception.md)| +|`__cpp_lib_format`|`202311L`||[``](/reference/format.md)| +|`__cpp_lib_format_path`|`202506L`|[`std::filesystem::path`](/reference/filesystem/path.md)クラスに、文字列フォーマットのサポートを追加
[`std::filesystem::path`](/reference/filesystem/path.md)クラスに、出力用の文字列を取得するためのメンバ関数を追加|[``](/reference/filesystem.md)| +|`__cpp_lib_format_uchar`|`202311L`|[`std::format`](/reference/format/format.md)が`char`を数値出力する際は符号なしとして扱う|[``](/reference/format.md)| +|`__cpp_lib_freestanding_algorithm`|`202502L`||[``](/reference/algorithm.md)| +|`__cpp_lib_freestanding_array`|`202311L`||[``](/reference/array.md)| +|`__cpp_lib_freestanding_char_traits`|`202306L`||[``](/reference/string.md)| +|`__cpp_lib_freestanding_charconv`|`202306L`||[``](/reference/charconv.md)| +|`__cpp_lib_freestanding_cstdlib`|`202306L`||[``](/reference/cstdlib.md), [``](/reference/cmath.md)| +|`__cpp_lib_freestanding_cstring`|`202311L`||[``](/reference/cstring.md)| +|`__cpp_lib_freestanding_cwchar`|`202306L`||[``](/reference/cwchar.md.nolink)| +|`__cpp_lib_freestanding_errc`|`202306L`||[``](/reference/cerrno.md), [``](/reference/system_error.md)| +|`__cpp_lib_freestanding_execution`|`202502L`||[``](/reference/execution.md)| +|`__cpp_lib_freestanding_expected`|`202311L`||[``](/reference/expected.md)| +|`__cpp_lib_freestanding_feature_test_macros`|`202306L`||| +|`__cpp_lib_freestanding_functional`|`202306L`||[``](/reference/functional.md)| +|`__cpp_lib_freestanding_iterator`|`202306L`||[``](/reference/iterator.md)| +|`__cpp_lib_freestanding_mdspan`|`202311L`||[``](/reference/mdspan.md)| +|`__cpp_lib_freestanding_memory`|`202502L`||[``](/reference/memory.md)| +|`__cpp_lib_freestanding_numeric`|`202502L`||[``](/reference/numeric.md)| +|`__cpp_lib_freestanding_operator_new`|`202306L` or `0`||[``](/reference/new.md)| +|`__cpp_lib_freestanding_optional`|`202506L`||[``](/reference/optional.md)| +|`__cpp_lib_freestanding_random`|`202502L`||[``](/reference/random.md)| +|`__cpp_lib_freestanding_ranges`|`202306L`||[``](/reference/ranges.md)| +|`__cpp_lib_freestanding_ratio`|`202306L`||[``](/reference/ratio.md)| +|`__cpp_lib_freestanding_string_view`|`202311L`||[``](/reference/string_view.md)| +|`__cpp_lib_freestanding_tuple`|`202306L`||[``](/reference/tuple.md)| +|`__cpp_lib_freestanding_utility`|`202306L`||[``](/reference/utility.md)| +|`__cpp_lib_freestanding_variant`|`202311L`||[``](/reference/variant.md)| +|`__cpp_lib_fstream_native_handle`|`202306L`|[`std::basic_fstream`](/reference/fstream/basic_fstream.md)などのメンバに、ファイルのネイティブハンドルを追加|[``](/reference/fstream.md)| +|`__cpp_lib_function_ref`|`202306L`|[``](/reference/functional.md)に[`std::function_ref`](/reference/functional/function_ref.md)を追加|[``](/reference/functional.md)| +|`__cpp_lib_hazard_pointer`|`202306L`|ハザードポインタのライブラリ[``](/reference/hazard_pointer.md.nolink)を追加|[``](/reference/hazard_pointer.md.nolink)| +|`__cpp_lib_hive`|`202502L`|シーケンスコンテナのライブラリ[``](/reference/hive.md.nolink)を追加|[``](/reference/hive.md.nolink)| +|`__cpp_lib_indirect`|`202502L`|[``](/reference/memory.md)に[`std::indirect`](/reference/memory/indirect.md.nolink)と[`std::polymorphic`](/reference/memory/polymorphic.md.nolink)を追加|[``](/reference/memory.md)| +|`__cpp_lib_inplace_vector`|`202406L`|容量固定の可変長配列のライブラリ[``](/reference/inplace_vector.md.nolink)を追加|[``](/reference/inplace_vector.md.nolink)| +|`__cpp_lib_is_sufficiently_aligned`|`202411L`|[``](/reference/mdspan.md)に、要素アクセスにアライメント保証を与える[`std::aligned_accessor`](/reference/mdspan/aligned_accessor.md)を追加|[``](/reference/memory.md)| +|`__cpp_lib_is_virtual_base_of`|`202406L`|[``](/reference/type_traits.md)に[`std::is_virtual_base_of`](/reference/type_traits/is_virtual_base_of.md)を追加|[``](/reference/type_traits.md)| +|`__cpp_lib_is_within_lifetime`|`202306L`|[``](/reference/type_traits.md)に[`std::is_within_lifetime()`](/reference/type_traits/is_within_lifetime.md)を追加|[``](/reference/type_traits.md)| +|`__cpp_lib_linalg`|`202412L`|線形代数ライブラリとして[``](/reference/linalg.md)を追加|[``](/reference/linalg.md)| +|`__cpp_lib_mdspan`|`202406L`|[`std::mdspan`](/reference/mdspan/mdspan.md)に対する[`std::dextents`](/reference/mdspan/extents.md)指定の冗長さを解決する[`std::dims`](/reference/mdspan/extents.md)を追加|[``](/reference/mdspan.md)| +|`__cpp_lib_not_fn`|`202306L`|[`std::not_fn()`](/reference/functional/not_fn.md)に、非型テンプレート引数として関数を指定するオーバーロードを追加|[``](/reference/functional.md)| +|`__cpp_lib_observable_checkpoint`|`202506L`|[``](/reference/utility.md)に[`std::observable_checkpoint()`](/reference/utility/observable_checkpoint.md.nolink)を追加|[``](/reference/utility.md)| +|`__cpp_lib_optional`|`202506L`|[`std::optional`](/reference/optional/optional.md)に、参照を保持するための`T&`の部分特殊化を追加|[``](/reference/optional.md)| +|`__cpp_lib_optional_range_support`|`202406L`|[`std::optional`](/reference/optional/optional.md)にイテレータインタフェースを追加|[``](/reference/optional.md)| +|`__cpp_lib_out_ptr`|`202311L`||[``](/reference/memory.md)| +|`__cpp_lib_parallel_algorithm`|`202506L`|[``](/reference/algorithm.md)と[``](/reference/memory.md)のアルゴリズムを並列実行に対応|[``](/reference/algorithm.md), [``](/reference/numeric.md), [``](/reference/memory.md)| +|`__cpp_lib_parallel_scheduler`|`202506L`|[``](/reference/execution.md)に[`std::execution::parallel_scheduler`](/reference/execution/execution/parallel_scheduler.md)を追加|[``](/reference/execution.md)| +|`__cpp_lib_philox_engine`|`202406L`|[``](/reference/random.md)に[`std::philox_engine`](/reference/random/philox_engine.md)、[`std::philox4x32`](/reference/random/philox4x32.md)、[`std::philox4x64`](/reference/random/philox4x64.md)を追加|[``](/reference/random.md)| +|`__cpp_lib_polymorphic`|`202502L`|[``](/reference/memory.md)に[`std::indirect`](/reference/memory/indirect.md.nolink)と[`std::polymorphic`](/reference/memory/polymorphic.md.nolink)を追加|[``](/reference/memory.md)| +|`__cpp_lib_print`|`202406L`|[`std::print()`](/reference/print/print.md)と[`std::println()`](/reference/print/println.md)にロックを取得せず高速に書き出す最適化を許可
[`std::enable_nonlocking_formatter_optimization`](/reference/format/enable_nonlocking_formatter_optimization.md)を追加|[``](/reference/print.md), [``](/reference/ostream.md)| +|`__cpp_lib_ranges`|`202406L`|[`std::indirectly_unary_invocable`](/reference/iterator/indirectly_unary_invocable.md)などのコンセプトの共通参照要件を削除|[``](/reference/algorithm.md), [``](/reference/functional.md), [``](/reference/iterator.md), [``](/reference/memory.md), [``](/reference/ranges.md)| +|`__cpp_lib_ranges_as_const`|`202311L`|[`std::basic_const_iterator`](/reference/iterator/basic_const_iterator.md)を元の要素へのキャストを可能にする|[``](/reference/ranges.md)| +|`__cpp_lib_ranges_cache_latest`|`202411L`|[`std::views::cache_latest`](/reference/ranges/cache_latest.md.nolink)を追加|[``](/reference/ranges.md)| +|`__cpp_lib_ranges_concat`|`202403L`|[`std::views::concat`](/reference/ranges/concat_view.md)を追加|[``](/reference/ranges.md)| +|`__cpp_lib_ranges_generate_random`|`202403L`|[``](/reference/random.md)に、乱数列を生成する[`std::ranges::generate_random()`](/reference/random/generate_random.md)関数を追加|[``](/reference/random.md)| +|`__cpp_lib_ranges_indices`|`202506L`|インデックス列を生成する[`std::views::indices`](/reference/ranges/indices.md.nolink)を追加|[``](/reference/ranges.md)| +|`__cpp_lib_ranges_reserve_hint`|`202502L`|各viewクラスに`reserve_hint()`メンバ関数を追加
[`std::ranges::reserve_hint()`](/reference/ranges/reserve_hint.md.nolink)関数を追加
[`std::ranges::approximately_sized_range`](/reference/ranges/approximately_sized_range.md.nolink)コンセプトを追加|[``](/reference/ranges.md)| +|`__cpp_lib_ranges_to_input`|`202502L`|[`std::views::to_input`](/reference/ranges/to_input_view.md)を追加|[``](/reference/ranges.md)| +|`__cpp_lib_ratio`|`202306L`|[``](/reference/ratio.md)に、新たなSI接頭辞を追加|[``](/reference/ratio.md)| +|`__cpp_lib_raw_memory_algorithms`|`202411L`|[`std::uninitialized_default_construct()`](/reference/memory/uninitialized_default_construct.md)などの未初期化領域に対する操作を`constexpr`対応|[``](/reference/memory.md)| +|`__cpp_lib_rcu`|`202306L`|RCU (Read Copy Update) のライブラリとして[``](/reference/rcu.md)を追加|[``](/reference/rcu.md)| +|`__cpp_lib_reference_wrapper`|`202403L`|[`std::reference_wrapper`](/reference/functional/reference_wrapper.md)に、比較演算子[`==`](/reference/functional/reference_wrapper/op_equal.md)と[`<=>`](/reference/functional/reference_wrapper/op_compare_3way.md)を追加|[``](/reference/functional.md)| +|`__cpp_lib_reflection`|`202506L`||[``](/reference/meta.md.nolink)| +|`__cpp_lib_saturation_arithmetic`|`202311L`|[``](/reference/numeric.md)に飽和演算 (Saturation Arithmetic) として[`std::add_sat()`](/reference/numeric/add_sat.md)などの関数を追加|[``](/reference/numeric.md)| +|`__cpp_lib_senders`|`202506L`||[``](/reference/execution.md)| +|`__cpp_lib_simd`|`202506L`|データ並列ライブラリとして、[``](/reference/simd.md.nolink)を追加|[``](/reference/simd.md.nolink)| +|`__cpp_lib_simd_complex`|`202502L`|[``](/reference/simd.md.nolink)が[`std::complex`](/reference/complex/complex.md)をサポートする|[``](/reference/simd.md.nolink)| +|`__cpp_lib_simd_permutations`|`202506L`|[``](/reference/simd.md.nolink)に`permute()`などを追加する|[``](/reference/simd.md.nolink)| +|`__cpp_lib_smart_ptr_owner_equality`|`202306L`|[``](/reference/memory.md)に[`std::owner_hash`](/reference/memory/owner_hash.md.nolink)と[`std::owner_equal`](/reference/memory/owner_equal.md.nolink)を追加|[``](/reference/memory.md)| +|`__cpp_lib_span`|`202311L`|[`std::mdspan`](/reference/mdspan/mdspan.md)に[`at()`](/reference/mdspan/mdspan/at.md.nolink)メンバ関数を追加|[``](/reference/span.md)| +|`__cpp_lib_span_initializer_list`|`202311L`|[`std::span`](/reference/span/span.md)に[`std::initializer_list`](/reference/initializer_list/initializer_list.md)をとるコンストラクタを追加|[``](/reference/span.md)| +|`__cpp_lib_sstream_from_string_view`|`202306L`|[`std::basic_stringstream`](/reference/sstream/basic_stringstream.md)などが[`std::basic_string_view`](/reference/string_view/basic_string_view.md)から構築可能に|[``](/reference/sstream.md)| +|`__cpp_lib_string_subview`|`202506L`|[`std::basic_string`](/reference/string/basic_string.md)と[`std::basic_string_view`](/reference/string_view/basic_string_view.md)に`subview()`を追加|[``](/reference/string.md), [``](/reference/string_view.md)| +|`__cpp_lib_string_view`|`202403L`|[`std::basic_string`](/reference/string/basic_string.md)と[`std::basic_string_view`](/reference/string_view/basic_string_view.md)を連結させる`operator+`を追加|[``](/reference/string.md), [``](/reference/string_view.md)| +|`__cpp_lib_submdspan`|`202411L`|[`std::mdspan`](/reference/mdspan/mdspan.md)から部分ビューを取り出す[`std::submdspan()`](/reference/mdspan/submdspan.md)を追加|[``](/reference/mdspan.md)| +|`__cpp_lib_task`|`202506L`||[``](/reference/execution.md)| +|`__cpp_lib_text_encoding`|`202306L`|文字列エンコーディングを識別するライブラリ[``](/reference/text_encoding.md.nolink)を追加|[``](/reference/text_encoding.md.nolink)| +|`__cpp_lib_to_chars`|`202306L`|[`std::to_chars_result`](/reference/charconv/to_chars_result.md)と[`std::from_chars_result`](/reference/charconv/from_chars_result.md)に`operator bool`を追加|[``](/reference/charconv.md)| +|`__cpp_lib_to_string`|`202306L`|[`std::to_string`](/reference/string/to_string.md)の変換結果を`sprintf()`ベースから`std::format()`ベースに変更|[``](/reference/string.md)| +|`__cpp_lib_trivially_relocatable`|`202502L`|トリビアルな再配置|[``](/reference/memory.md), [``](/reference/type_traits.md)| +|`__cpp_lib_tuple_like`|`202311L`|[`std::complex`](/reference/complex/complex.md)にタプルインタフェースの特殊化を追加|[``](/reference/utility.md), [``](/reference/tuple.md), [``](/reference/map.md), [``](/reference/unordered_map.md)| +|`__cpp_lib_type_order`|`202506L`|[`std::type_info::before`](/reference/typeinfo/type_info/before.md)のconstexpr化|[``](/reference/compare.md)| +|`__cpp_lib_variant`|`202306L`|[`std::variant`](/reference/variant/variant.md)クラスに、メンバ関数版の[`visit()`](/reference/variant/variant/visit.md.nolink)を追加|[``](/reference/variant.md)| + +実装依存のマクロ。 + +| マクロ名 | 値 | 機能 | ヘッダ | +|----------|----|------|--------| +|`__cpp_lib_hardened_array`|`202502L`||[``](/reference/array.md)| +|`__cpp_lib_hardened_basic_stacktrace`|`202506L`||[``](/reference/stacktrace.md)| +|`__cpp_lib_hardened_basic_string`|`202502L`||[``](/reference/string.md)| +|`__cpp_lib_hardened_basic_string_view`|`202502L`||[``](/reference/string_view.md)| +|`__cpp_lib_hardened_bitset`|`202502L`||[``](/reference/bitset.md)| +|`__cpp_lib_hardened_common_iterator`|`202506L`||[``](/reference/iterator.md)| +|`__cpp_lib_hardened_counted_iterator`|`202506L`||[``](/reference/iterator.md)| +|`__cpp_lib_hardened_deque`|`202502L`||[``](/reference/deque.md)| +|`__cpp_lib_hardened_expected`|`202502L`||[``](/reference/expected.md)| +|`__cpp_lib_hardened_forward_list`|`202502L`||[``](/reference/forward_list.md)| +|`__cpp_lib_hardened_inplace_vector`|`202502L`||[``](/reference/inplace_vector.md.nolink)| +|`__cpp_lib_hardened_list`|`202502L`||[``](/reference/list.md)| +|`__cpp_lib_hardened_mdspan`|`202502L`||[``](/reference/mdspan.md)| +|`__cpp_lib_hardened_optional`|`202502L`||[``](/reference/optional.md)| +|`__cpp_lib_hardened_shared_ptr_array`|`202506L`||[``](/reference/memory.md)| +|`__cpp_lib_hardened_span`|`202502L`||[``](/reference/span.md)| +|`__cpp_lib_hardened_valarray`|`202502L`||[``](/reference/valarray.md)| +|`__cpp_lib_hardened_vector`|`202502L`||[``](/reference/vector.md)| +|`__cpp_lib_hardened_view_interface`|`202506L`||[``](/reference/ranges.md)| + + +## 参照 + +- [SD-FeatureTest: Feature-Test Macros and Policies - isocpp](https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations) diff --git a/reference/version.md b/reference/version.md index f937274186..b399d60fb6 100644 --- a/reference/version.md +++ b/reference/version.md @@ -14,6 +14,7 @@ - [C++17 機能テストマクロ](/lang/cpp17/feature_test_macros.md) - [C++20 機能テストマクロ](/lang/cpp20/feature_test_macros.md) - [C++23 機能テストマクロ](/lang/cpp23/feature_test_macros.md) +- [C++26 機能テストマクロ](/lang/cpp26/feature_test_macros.md) ## 参照 - [P0754R2 ``](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0754r2.pdf) From 29e9569989dee369f3593244c6e31b3c5768c9e5 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 25 Nov 2025 22:06:27 +0900 Subject: [PATCH 2452/3948] =?UTF-8?q?enable=5Fshared=5Ffrom=5Fthis:=20?= =?UTF-8?q?=E3=82=B5=E3=83=B3=E3=83=97=E3=83=AB=E3=82=B3=E3=83=BC=E3=83=89?= =?UTF-8?q?=E3=81=AB=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE=E9=A3=BE=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/memory/enable_shared_from_this.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/memory/enable_shared_from_this.md b/reference/memory/enable_shared_from_this.md index 921ad0d399..783d73f7fb 100644 --- a/reference/memory/enable_shared_from_this.md +++ b/reference/memory/enable_shared_from_this.md @@ -83,6 +83,7 @@ int main() } ``` * std::enable_shared_from_this[color ff0000] +* shared_from_this()[link enable_shared_from_this/shared_from_this.md] ### 出力 ``` From 7b52ba368b4cebf460f5cdb50da2661a34cca1c1 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 1 Dec 2025 10:13:02 +0900 Subject: [PATCH 2453/3948] =?UTF-8?q?[WIP]=202025=E5=B9=B4=E5=88=86?= =?UTF-8?q?=E3=81=AE=E8=B2=A2=E7=8C=AE=E3=83=9D=E3=82=A4=E3=83=B3=E3=83=88?= =?UTF-8?q?=E3=82=92=E9=9B=86=E8=A8=88=20(#1536)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 2025年分の貢献ポイントを集計 * 雑に統合 * wip * faithandbrave complete * rotarymars complete * yohhoy complete * Raclamusi complete * akinomyoga complete * K10-K10 complete * suomesta complete * math-hiyoko complete * onihusube complete * h-sao complete * y121516 complete * take-cheeze complete * Gumichocopengin8 complete * wx257osn2 complete * complete * 集計漏れを修正 * akinomyogaさんの貢献を調整 https://github.com/cpprefjp/site/pull/1536#issuecomment-3583805892 * Co-authorの貢献ポイント割り当て --- start_editing.md | 17 +- start_editing/contribution_stats_2025.md | 1218 ++++++++++++++++++++++ 2 files changed, 1231 insertions(+), 4 deletions(-) create mode 100644 start_editing/contribution_stats_2025.md diff --git a/start_editing.md b/start_editing.md index 1fd44f9fa9..513451a313 100644 --- a/start_editing.md +++ b/start_editing.md @@ -340,7 +340,7 @@ cpprefjpおよびboostjpでの作業は、以下のように貢献ポイント | cpprefjp/addlang | 20 | 言語機能を1ページ追加 | | cpprefjp/addpage | 20 | その他ページ追加 (articleや編集者向けページなど) | | cpprefjp/fixs | 2 | 既存ページへの修正 : small 軽微な修正、コード修飾追加 (ページ単位)、スクリプトによる一括修正 (スクリプトはtool系で別途評価) | -| cpprefjp/fixm | 5 | 既存ページへの修正 : medium 追加説明、サンプルコード追加、訳語追加 (訳語単位)、用語追加 (用語単位)。誤字・説明の言い換えの範囲を超える間違い修正。サンプルコードや仕様での変数名の間違い修正 (ページ単位) | +| cpprefjp/fixm | 5 | 既存ページへの修正 : medium 追加説明、サンプルコード追加、訳語追加 (訳語単位)、用語追加 (用語単位)。誤字・説明の言い換えの範囲を超える間違い修正。サンプルコードや仕様での変数名の間違い修正。サンプルコードでのコンパイル・実行に影響のある変更 (ページ単位) | | cpprefjp/fixl | 10 | 既存ページへの修正 : large 仕様変更への対応。仕様記述のバグ修正。関連項目ではない関数一覧の表に関数を足すことも対象。実装例の追加 (ページ単位) | | cpprefjp/compiler | 2 | 動作確認できたコンパイラバージョンの記載、および処理系のバージョン情報。ライブラリ機能はページ単位、言語機能は件数単位、処理系のバージョン情報は件数単位 | @@ -353,9 +353,9 @@ cpprefjpおよびboostjpでの作業は、以下のように貢献ポイント |-----|---------|------| | boostjp/typo | 1 | 誤字・脱字の修正 (ページ単位) | | boostjp/link | 2 | 関連項目・参照リンクなどの追加・修正、nolinkの解除 (ページ単位) | -| boostjp/releases | 5 | Boostリリースノート1件追加 small : maintenance workなどの軽微で小さなリリースノート | +| boostjp/releases | 5 | Boostリリースノート1件追加 small : maintenance workなどの軽微で小さなリリースノート。一件ごとのテスト済みコンパイラ | | boostjp/releasem | 10 | Boostリリースノート 1件追加 medium : タイトル含めず10行以下の中程度の大きさ。新ライブラリ。既知の問題 (ライブラリ単位) | -| boostjp/releasel | 20 | Boostリリースノート 1件追加 large : mediumを超える大きさ | +| boostjp/releasel | 20 | Boostリリースノート 1件追加 large : mediumを超える大きさ。テスト済みコンパイラの全記載 | | boostjp/fixs | 2 | 既存ページへの修正 : small 軽微な修正、コード修飾追加 (ページ単位) | | boostjp/fixm | 5 | 既存ページへの修正 : medium 追加説明、訳語追加 (ページ単位) | | boostjp/addrefs | 10 | Boost逆引きリファレンス : small (1例追加) | @@ -368,10 +368,11 @@ CIスクリプト、site_generator、kunaiなど。 | タグ | ポイント | 説明 | |-----|---------|------| | tool/fixbug | 30 | バグ修正 | -| tool/improves | 10 | コード改善 : small。typo検出テーブルへの追加 | +| tool/improves | 10 | コード改善 : small。typo検出テーブルへの追加。submodule更新 | | tool/improvem | 30 | コード改善 : medium。git submodule / npm moduleのリリース作業 (package.jsonの更新) | | tool/improvel | 50 | コード改善 : large | | tool/updatelib | 20 | 外部依存ライブラリのアップデート (直接使用のライブラリ単位) | +| tool/security | 50 | セキュリティアップデート (npm audit) | | tool/updatelang | 10 | 使用言語のアップデート : small (とくにコード変更なく更新できた) | | tool/updatelang | 30 | 使用言語のアップデート : medium (多少のコード修正で更新できた) | | tool/updatelang | 50 | 使用言語のアップデート : large (大きいまたはむずかしいコード修正をして更新できた) | @@ -379,7 +380,15 @@ CIスクリプト、site_generator、kunaiなど。 | tool/addm | 50 | 新たな仕組みの導入 medium | | tool/addl | 100 | 新たな仕組みの導入 large : キーワード自動リンク、相対リンク対応など | +### その他 + +| タグ | ポイント | 説明 | +|-----|---------|------| +| ignore | 0 | 貢献ポイントの対象外 (ほかのコミットと合算するときなど) | + + ### 貢献ポイントの集計ページ - [2023年](start_editing/contribution_stats_2023.md) - [2024年](start_editing/contribution_stats_2024.md) +- [2025年](start_editing/contribution_stats_2025.md) diff --git a/start_editing/contribution_stats_2025.md b/start_editing/contribution_stats_2025.md new file mode 100644 index 0000000000..502fd70b3d --- /dev/null +++ b/start_editing/contribution_stats_2025.md @@ -0,0 +1,1218 @@ +# 2025年 貢献ポイント +2024年12月から2025年11月を対象期間として、貢献ポイントを集計する。 + +## [faithandbrave](https://github.com/faithandbrave) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, d779088] | tool/improvem:1 | GLOBAL_DEFINED_WORDS: 適格要件の説明を改善 | +| [commit cpprefjp/site, 8d7953c] | cpprefjp/fixm:1 | 用語: 述語を追加 | +| [commit cpprefjp/site, 952bb04, be4af49, 2273c72] | cpprefjp/fixs:48, tool/addm:2 | 表示崩れチェックCI | +| [commit boostjp/site, c2e3992, 22d5473, bd1564c, 191d498] | boostjp/link:1, boostjp/releases:5, boostjp/releasem:20, boostjp/releasel:6 | 1.87.0 | +| [commit cpprefjp/site_generator, 39a6b5a] | tool/improves:1 | update submodule | +| [commit cpprefjp/site, b956b77] | cpprefjp/link:2 | C++11 属性構文 : indeterminate属性の解説ページにリンク | +| [commit cpprefjp/site, 073c4bc, 8cf3afd] | cpprefjp/fixs:3 | jthread: コード修飾ミスを修正 | +| [commit cpprefjp/site, 46badd1] | cpprefjp/fixm:1 | Markdown拡張: 「箇条書きの前に空行が必要」「コードブロックのあとに空行が必要」の制限がなくなったので削除 #1362 | +| [commit cpprefjp/site_generator, de3cf86] | tool/adds:1 | 表示崩れを事前修正するMarkdown拡張を追加 | +| [commit cpprefjp/markdown_to_html, e2af656] | tool/addm:1, tool/improvem:7 | 表示崩れを事前修正するMarkdown拡張を追加 (#8) | +| [commit cpprefjp/site, 8918e77] | cpprefjp/link:1 | `common_type_t`へのリンクミスを修正 | +| [commit cpprefjp/site, 5cc3b9e] | cpprefjp/fixm:2 | gcd, lcmの実装例 : 仕様に合わせて絶対値をとるよう修正 | +| [commit cpprefjp/site, 44b2409, 000cd8f, da031c5, 552254b, b329171, 5fcfad6, 7b0c554, 1648169, 59ca584, a628ac4] | cpprefjp/link:2, cpprefjp/addref:13 | `philox_engine` | +| [commit cpprefjp/site, 17ed872] | cpprefjp/fixl:3 | C++26: 2024-12 mailingの変更を記載 #1371 | +| [commit cpprefjp/site, 44635eb] | cpprefjp/fixm:1 | 用語: CV修飾を追加 | +| [commit cpprefjp/site, af91af8] | cpprefjp/fixl:1 | C++26 Working Draft更新 #1371 | +| [commit cpprefjp/site, 6f2372b] | cpprefjp/fixl:20 | C++26対応として、未初期化領域アルゴリズムをconstexpr対応 (close #1389) | +| [commit cpprefjp/site, 5142d43] | cpprefjp/link:1 | グローバル修飾: pairを追加 | +| [commit cpprefjp/site, 08aed17] | cpprefjp/link:7 | グローバル修飾: 固定幅の整数型を追加 | +| [commit cpprefjp/site, 5dbb07c] | cpprefjp/link:1 | グローバル修飾 : sleep_forを追加 | +| [commit cpprefjp/site, 258038b, 815f9db, a0fc868] | cpprefjp/fixm:1, cpprefjp/link:1 | `lock_guard`: サンプルコードを更新 | +| [commit cpprefjp/site, 27a5b41] | cpprefjp/link:3 | 構造化束縛とlock_guard系クラスのページから、C++26変数名`_`のページにリンク | +| [commit cpprefjp/site, 8def0da, d67d018] | cpprefjp/fixm:1 | C++26 宣言のみで使用しない変数の名前として`_`をサポート : ユースケースと仕様を追加 | +| [commit cpprefjp/site, fbc96a2] | cpprefjp/link:1, cpprefjp/fixl:25 | C++26対応として、`atomic`はCV修飾された型を禁止、`atomic_ref`はCV修飾された型を受け取れるようにした (close #1388) | +| [commit cpprefjp/site, 6477678] | cpprefjp/link:1, cpprefjp/fixl:1, cpprefjp/addref:1 | atomic_ref : C++26対応としてaddressメンバ関数を追加 | +| [commit cpprefjp/site, eef0639, d440b08] | cpprefjp/link:1, cpprefjp/fixl:3, cpprefjp/addref:8 | C++26対応としてatomic(_ref)にfetch_max/minを追加 | +| [commit cpprefjp/site, 4324757] | cpprefjp/fixl:96 | atomic : C++26のconstexpr対応 | +| [commit cpprefjp/site, c2e5e06] | cpprefjp/fixm:1 | `string_view::op_sv` : ヌル終端に関する説明がわかりにくかったので追記 #1398 | +| [commit cpprefjp/site, 0739bc9] | cpprefjp/fixl:2 | `is_trivial` : C++26で非推奨化 (close #1374) | +| [commit cpprefjp/kunai, 4d86cb7] | tool/improves:2 | crsearchを更新 | +| [commit cpprefjp/kunai, 6ada321] | | Revert "Revert "Local test fix"" | +| [commit cpprefjp/kunai, 1c8fe21] | | Revert "Revert "Embed instead"" | +| [commit cpprefjp/kunai, 9265a16] | | Revert "Revert "Update modules"" | +| [commit cpprefjp/kunai, a1a9693] | | Revert "Revert "Update actions"" | +| [commit cpprefjp/kunai, 18853bb] | | Revert "Update actions" | +| [commit cpprefjp/kunai, 26c993d] | | Revert "Update modules" | +| [commit cpprefjp/kunai, ae6dcb2] | | Revert "Embed instead" | +| [commit cpprefjp/kunai, 961af71] | | Revert "Local test fix" | +| [commit cpprefjp/site, 63e8626] | cpprefjp/link:1 | リンク切れを解消 #1403 | +| [commit cpprefjp/site, 7a572ea, 50250ae] | cpprefjp/fixs:7 | C++20 / C++23 : ページタイトルに提案文書の番号を追加 | +| [commit cpprefjp/site, cce034a] | cpprefjp/fixs:1 | 見出しの表示崩れを修正 | +| [commit cpprefjp/site, 15399ca] | cpprefjp/fixm:1, cpprefjp/link:1 | C++20 非型テンプレートパラメータとしてクラス型を許可する : プレースホルダー型とリテラル演算子の例を追加 | +| [commit cpprefjp/site, debf1bd] | cpprefjp/fixl:58 | C++26対応として、標準ライブラリのnodiscard指定を削除 (close #1386) | +| [commit cpprefjp/site, 94b8b36] | cpprefjp/fixl:4 | `expected` : C++26対応として比較演算子の適格要件をテンプレートパラメータ制約に変更 (close #1379) | +| [commit cpprefjp/site, 78f2291] | cpprefjp/fixl:1, cpprefjp/addref:1 | `path`: C++26対応としてformatterの特殊化を追加 (close #1336) | +| [commit cpprefjp/site, 1bd673d, 8c2de7c] | | スポンサー更新 #1411 | +| [commit cpprefjp/site, af40773] | cpprefjp/link:4 | `numeric_limits`: リンク切れしたページへの参照を削除 #1412 | +| [commit cpprefjp/site, 586e0ff] | cpprefjp/fixl:1 | 国際標準規格 : C++26 Working Draftを更新 #1415 | +| [commit cpprefjp/site, 5b55280, 0bbb13c, 518b6e2] | cpprefjp/fixl:2 | C++26: 2025-03 mailingのライブラリ機能を記載 #1415 | +| [commit cpprefjp/site, a19e427] | tool/fixbug:1 | buildアクション: git sumoduleのパラメータ間違いを修正 | +| [commit cpprefjp/site, 1813cc7] | cpprefjp/fixl:1, cpprefjp/addref:1, cpprefjp/link:1 | `type_traits`: C++26対応として`is_within_lifetime`を追加 (close #1195) | +| [commit cpprefjp/site, 7b99f1c] | cpprefjp/fixl:1, cpprefjp/addref:1, cpprefjp/link:1 | type_traits: C++26対応としてis_virtual_base_ofを追加 (close #1312) | +| [commit cpprefjp/site, cd443ea] | cpprefjp/link:1, cpprefjp/fixl:7, cpprefjp/addref:12 | `stdexcept`関係のconstexpr対応 (#1433) | +| [commit cpprefjp/site, 90e27bd] | cpprefjp/link:3, cpprefjp/addlang:1, cpprefjp/addref:26, cpprefjp/fixl:16 | C++26対応として定数式での例外送出を許可 (#1432) | +| [commit cpprefjp/site_generator, 7b54abb] | tool/fixbug:1 | README: git submoduleの存在しない初期化付きオプションを修正 | +| [commit boostjp/site, 0a35735] | tool/fixbug:1 | buildアクション: git submoduleの存在しない初期化付きオプションを修正 | +| [commit boostjp/site, fe72e30, b6f0bed, 5b0e991] | boostjp/releases:9, boostjp/releasem:8, boostjp/releasel:6 | 1.88.0のリリースノートを追加 | +| [commit cpprefjp/site, 97d288b, e897a16] | cpprefjp/link:2, cpprefjp/addlang:1 | C++26: 「文字列リテラルの文字エンコーディング失敗を不適格とする」を追加 (close #1173) | +| [commit cpprefjp/site, 43651f2, 57d9fce] | cpprefjp/link:3, cpprefjp/addlang:1 | C++26 モジュール宣言でのモジュール名のマクロ展開を禁止する | +| [commit cpprefjp/site, 349b492] | cpprefjp/link:2, cpprefjp/addlang:1 | C++26: 「空の無限ループは未定義動作ではないと規定」を追加 (close #1326) | +| [commit cpprefjp/site, ef98bb0, d7c766e] | cpprefjp/link:3, cpprefjp/addlang:1 | C++26: 「構造化束縛でパックを導入できるようにする」を追加 (close #1376) | +| [commit cpprefjp/site, 8b03a33] | tool/improves:1 | NGワードチェック: 以下のコミットのtypoを登録 | +| [commit cpprefjp/site, b4cf7e4] | cpprefjp/link:1 | Markdownの外部解説サイトへのリンクを削除 | +| [commit cpprefjp/site, 0c1871f] | cpprefjp/fixs:1 | C++26 embed: から → 空 | +| [commit cpprefjp/site, 3465a39, fe93837] | cpprefjp/link:2, cpprefjp/addlang:1 | C++26: 「先行するカンマのない省略記号を非推奨化」を追加 (close #1377) | +| [commit cpprefjp/site, f91ef86] | cpprefjp/link:4, cpprefjp/addlang:1 | C++26: 「属性の無視性を見直し」を追加 (close #1175) | +| [commit cpprefjp/site, 02e8675] | cpprefjp/link:1 | C++11 属性: 関連項目を追加 | +| [commit cpprefjp/site, 82b627c] | cpprefjp/link:3, cpprefjp/addlang:1 | C++26: 「std::initializer_listの配列を静的記憶域に配置する」を追加 (close #1171) | +| [commit, cpprefjp/site, 786b39a] | | C++26: 規格用語の整理だけだった「変換コンストラクタという用語を廃止する」を削除 | +| [commit cpprefjp/site, 6ab9b94, 4e37c0f] | cpprefjp/link:3, cpprefjp/addlang:2 | C++20 / C++26 : 組み込み配列の比較の非推奨・削除を追加 (close #1375) | +| [commit cpprefjp/site, 4bee12d] | | C++26: carries_dependency属性の削除を記載 | +| [commit cpprefjp/site, 09b3c3e, 3c7eee6] | cpprefjp/link:1 | fix link | +| [commit cpprefjp/site, c8a99ed] | cpprefjp/link:2, cpprefjp/addlang:1 | C++26: 「不完全型へのポインタに対するdeleteを不適格とする」を追加 (close #1306) | +| [commit cpprefjp/site, f1c0d5d] | tool/improves:1 | 外部リンクチェック : https://www.gnu.org/ を無視リストに登録 #1444 | +| [commit cpprefjp/site, 0de1d6d] | cpprefjp/fixl:1 | `is_clock` : Clock要件を記載 #1445 | +| [commit cpprefjp/site, a2c9f2f] | cpprefjp/typo:1 | fix typo: ディレクトティブ → ディレクティブ | +| [commit cpprefjp/site, 5d83fd5, 43da478] | cpprefjp/compiler:4 | コンパイラの実装状況 : Clang 20, GCC 15対応 | +| [commit cpprefjp/site, 41a9acd] | cpprefjp/link:2, cpprefjp/addlang:1 | C++26: 「返却された左辺値から暗黙変換された一時オブジェクトが参照に束縛されることを禁止する」を追加 (close #1322) | +| [commit cpprefjp/site, 2d43dab] | cpprefjp/link:1 | `construct_at` : 関連項目を追加 | +| [commit cpprefjp/site, ed90ef4] | cpprefjp/fixl:2, cpprefjp/addlang:1, cpprefjp/link:3 | C++26 : 「`constexpr`配置new」を追加 (close #1305) | +| [commit cpprefjp/site, 93e79ef] | cpprefjp/addlang:1, cpprefjp/link:2 | C++26 : 「要素数不明の配列を集成体初期化する規則を明確化」を追加 (close #1323) | +| [commit cpprefjp/site, c0bc234] | cpprefjp/fixs:1 | NGワード修正 | +| [commit cpprefjp/site, 8e8fa98] | cpprefjp/link:3, cpprefjp/addlang:1 | C++26 : 「パラメータパックへのインデックスアクセスを許可」を追加 (close #1230) | +| [commit cpprefjp/site, eb61e1a] | cpprefjp/link:4, cpprefjp/addlang:1 | C++26: 「constexpr構造化束縛の許可と、constexpr参照の制限緩和」を追加 #1372 | +| [commit cpprefjp/site, 70977b4] | cpprefjp/compiler:1 | コンパイラの実装状況 : GCC 15で「基本文字集合に@、$、\`を追加」は対応していた | +| [commit cpprefjp/site, aed6be4] | | コンパイラの実装状況 : GCC 15は「constexpr構造化束縛の許可と、定数式への参照を定数式とする」を実装していなかった | +| [commit cpprefjp/site, 40c3748] | cpprefjp/link:2 | コード修飾を追加 | +| [commit cpprefjp/site, f529f5d, bfed2f0, 8043d35] | cpprefjp/fixl:4 | `flat_set` / `flat_multiset` / `flat_map` / `flat_multimap` : 概要文章を追加 #1448 | +| [commit cpprefjp/site, fb9b7a8] | cpprefjp/fixs:2 | `set` / `multiset` : 「集合」という言葉がでてきていなかったので補足 | +| [commit cpprefjp/site, f5e7d44] | cpprefjp/fixs:2 | `map` / `multimap` : 概要の上にテンプレートパラメータの説明があったのを概要の下に移動 | +| [commit cpprefjp/site, 7ec528e] | cpprefjp/fixs:1 | multimap : ユニーク → 同一キーの要素を複数格納できる | +| [commit cpprefjp/site, 9c1556a, d26d535] | cpprefjp/compiler:6 | コンパイラの実装状況 : Visual Studio 2022 17.14に対応 | +| [commit cpprefjp/site, 302be0f] | cpprefjp/fixs:1, cpprefjp/fixl:1 | `map::insert_or_assign` : C++26の異種混合ルックアップに対応 #1189 | +| [commit cpprefjp/site, c057325, 3175722, 0036d1d] | cpprefjp/fixl:1 | `map::try_emplace` : C++26の異種混合ルックアップに対応 #1189 | +| [commit cpprefjp/site, c036064] | cpprefjp/fixl:2 | `map::operator[ ]`と`at` : C++26対応として異種混合ルックアップに対応 #1189 | +| [commit cpprefjp/site, 676aba0] | cpprefjp/fixl:1, cpprefjp/link:2 | `ignore` : C++26対応として詳細な定義を追加し、例を追加 (close #1315) | +| [commit cpprefjp/site, 2d81418] | cpprefjp/fixl:1 | `move_iterator::iterator_concept` : C++23対応 (close #1099) | +| [commit cpprefjp/site, c698466, b1ce436] | cpprefjp/fixl:1, cpprefjp/addref:5, cpprefjp/link:1 | move_iterator : メンバ型の表を整理してバージョン差異があるものは個別ページを用意した | +| [commit cpprefjp/site, 344ed2d] | cpprefjp/fixm:1 | 用語追加: コンテナアダプタ | +| [commit cpprefjp/site, 91f56d0] | cpprefjp/fixl:1 | `set::insert` : C++26の異種混合ルックアップに対応 #1189 | +| [commit cpprefjp/site, e8b37ef] | cpprefjp/fixl:1 | `unordered_map::try_emplace`: C++26の異種混合ルックアップに対応 #1189 | +| [commit cpprefjp/site, e36b137] | cpprefjp/fixl:5 | コンテナの`std::erase` : C++26の波カッコ初期化対応 #1311 | +| [commit cpprefjp/site, 80bd5f9] | cpprefjp/fixs:6 | `basic_string` : オーバーロードと説明の区切りを見直し | +| [commit cpprefjp/site, 2cca94f] | cpprefjp/fixs:1 | `charconv/to_chars` : 「(6)~(13)」を「(6)-(13)」に修正 | +| [commit cpprefjp/site, 2f17d2a] | cpprefjp/fixs:1 | `equal` : 「(1) (2)」を「(1), (2)」に修正 | +| [commit cpprefjp/site, 096b6d8] | cpprefjp/fixs:8 | 全体 : 「(1)〜(4)」 (波ダッシュ)、「(1)~(4)」 (全角チルダ) を「(1)-(4)」に修正 | +| [commit cpprefjp/site, 0436b33] | cpprefjp/fixs:1 | `basic_string::compare` : オーバーロードの区切りを見直し | +| [commit cpprefjp/site, 003bb89] | cpprefjp/fixs:13 | 全体: オーバーロード番号の列挙を「(1),(2)」になっているものから「(1), (2)」の形式に変更 #1451 | +| [commit cpprefjp/site, e34727d] | cpprefjp/fixs:108 | 全体: オーバーロード番号の区切りが「、」「, 」で表記揺れしていたため「, 」に統一 | +| [commit cpprefjp/site, 9bcd535] | cpprefjp/fixl:2 | `unordered_(multi)set::bucket` : C++26の異種混合ルックアップに対応 #1189 | +| [commit cpprefjp/site, e350c4d, b809dbc, 0ff1c70] | cpprefjp/fixm:1 | `unordered_set::insert` : オーバーロード番号を振り直し | +| [commit cpprefjp/site, 6216138] | cpprefjp/fixs:1, cpprefjp/fixl:1 | `unordered_set::insert` : C++26異種混合ルックアップに対応 #1189 | +| [commit cpprefjp/site, 4d246b6] | cpprefjp/fixl:1 | `unordered_multimap::bucket` : C++26異種混合ルックアップに対応 #1189 | +| [commit cpprefjp/site, 8378911, 567ae39] | cpprefjp/fixl:1 | `unordered_map::bucket` : オーバーロードの概要を記載 #1189 | +| [commit cpprefjp/site, bd07d857] | cpprefjp/fixl:3 | `unordered_map` : `at`と`operator[]`をC++26異種混合ルックアップに対応 | +| [commit cpprefjp/site, 6580bd9] | cpprefjp/fixl:1 | `unordered_map::insert_or_assign` : C++26の異種混合ルックアップに対応 #1189 | +| [commit cpprefjp/site, 6b1650a] | cpprefjp/fixm:1 | `map::insert_or_assign` : オーバーロード番号を振り直し #1189 | +| [commit cpprefjp/site, 047c55b] | cpprefjp/fixs:1 | 不可視文字を削除 | +| [commit cpprefjp/site, 0f3ab3a] | cpprefjp/link:2, cpprefjp/addref:4 | algorithm/`find` : C++26の波カッコ初期化対応 #1311 | +| [commit cpprefjp/site, 16a3e80] | cpprefjp/fixs:37 | 全体 : オーバーロード番号の列挙「(1)(2)」を「(1), (2)」に変換 | +| [commit cpprefjp/site, b810699] | cpprefjp/fixl:2 | algorithm/`remove` : C++26波カッコ初期化に対応 #1311 | +| [commit cpprefjp/site, e463c2f] | cpprefjp/fixl:2 | algorithm/`fill_n` : C++26波カッコ初期化に対応 #1311 | +| [commit cpprefjp/site, 319fdf9] | cpprefjp/fixl:2 | algorithm/`fill` : C++26波カッコ初期化に対応 #1311 | +| [commit cpprefjp/site, 4c8f465, a2bacbe, bd1ef79] | cpprefjp/fixl:3 | `replace_copy(_if)` : C++26波カッコ初期化に対応 #1311 | +| [commit cpprefjp/site, 6fd6be3, 06f6cd4, 977a82a] | cpprefjp/fixl:4 | `replace(_if)` : C++26波カッコ初期化に対応 #1311 | +| [commit cpprefjp/site, c3e940c, 1fe8918] | cpprefjp/fixl:2 | algorithm/`search_n` : C++26波カッコ初期化に対応 #1311 | +| [commit cpprefjp/site, f6a62c4] | cpprefjp/fixl:2 | `algorithm/count` : C++26波カッコ初期化に対応 #1311 | +| [commit cpprefjp/site, 18c5fd3, 9094beb] | cpprefjp/fixl:3 | `fold`関係 : C++26波カッコ初期化に対応 #1311 | +| [commit cpprefjp/site, 1f87d6a] | cpprefjp/fixm:3 | `ranges::count`, `equal_range`, `lower_bound` : 射影変換の例を追加 | +| [commit cpprefjp/site, 0dfcb84] | cpprefjp/fixm:1 | `ranges::find` : 射影変換の例を追加 | +| [commit cpprefjp/site, 1350ce7] | cpprefjp/fixl:2 | `find_last`, `contains` : C++26波カッコ初期化に対応 #1311 | +| [commit cpprefjp/site, 93b8c47] | cpprefjp/fixl:2 | `binary_search` : C++26波カッコ初期化に対応 #1311 | +| [commit cpprefjp/site, 1a1278c] | cpprefjp/fixl:2 | `equal_range` : C++26波カッコ初期化に対応 #1311 | +| [commit cpprefjp/site, 8eae9db] | cpprefjp/fixl:4 | `lower_bound` / `upper_bound` : C++26波カッコ初期化に対応 #1311 | +| [commit cpprefjp/site, 260bfc5] | cpprefjp/fixl:2 | algorithm/`remove_copy` : C++26波カッコ初期化に対応 #1311 | +| [commit cpprefjp/site, f462880, cdd2573, 16242c5, 8113c79] | cpprefjp/fixl:4, cpprefjp/addref:4 | fstream : C++26対応として`native_handle`を追加 (close #1196) | +| [commit cpprefjp/site, cdaf0f7] | cpprefjp/fixs:6 | fstream : サンプルコードのインデントを4 → 2スペースに修正 | +| [commit cpprefjp/site, 3a27b55, fa3dcb5] | cpprefjp/fixm:2 | `basic_ifstream`, `basic_ofstream` : サンプルコードを追加 | +| [commit cpprefjp/site, c3e97ea] | cpprefjp/fixl:1 | `allocator` : C++26対応として`is_always_equal`を削除 (close #1242) | +| [commit cpprefjp/site, 1fe3de6] | cpprefjp/fixl:1 | `projected` : C++26での不完全型への対策に対応 (close #1185) | +| [commit cpprefjp/site, c551d63] | cpprefjp/link:2, cpprefjp/addref:5 | `repeat_view` : メンバ関数を追加 #713 | +| [commit cpprefjp/site, d3f5ac2] | cpprefjp/fixm:1 | `filter_view` : バージョン指定ミスを修正 #713 | +| [commit cpprefjp/site, cb70d2c] | cpprefjp/fixl:1 | `filter_view` : emptyは継承してた #713 | +| [commit cpprefjp/site, 9df8a06] | cpprefjp/link:1 | グローバル修飾 : `in_place`を登録 | +| [commit cpprefjp/site, eb2177a] | cpprefjp/link:1, cpprefjp/addref:7 | `single_view` : メンバ関数を追加 #713 | +| [commit cpprefjp/site, 2c26002] | cpprefjp/fixl:1 | `empty_view` : 継承しているメンバ関数として不足していたものを追加 #713 | +| [commit cpprefjp/site, 2a23e4d] | cpprefjp/link:1, cpprefjp/addref:5 | `empty_view` : メンバ関数を追加 #713 | +| [commit cpprefjp/site, 38de7a5] | cpprefjp/link:1 | `empty_view` : コード修飾を追加 | +| [commit cpprefjp/site, 9e745c4] | cpprefjp/fixm:1 | `filter_view::iterator` : `value_type`と`difference_type`の説明を追加 #713 | +| [commit cpprefjp/site, b879741] | cpprefjp/link:2, cpprefjp/addref:2 | `filter_view::iterator` : `iter_move`と`iter_swap`を追加 #713 | +| [commit cpprefjp/site, 921ab26] | cpprefjp/link:1, cpprefjp/addref:2 | `filter_view::iterator` : `iterator_category`と`iterator_concept`を追加 #713 | +| [commit cpprefjp/site, d36b13a] | cpprefjp/fixm:1 | `transform_view` : メンバ型の概要だけ追加 #713 | +| [commit cpprefjp/site, 15c75ce] | cpprefjp/link:2, cpprefjp/addref:6 | `transform_view` : メンバ関数を追加 #713 | +| [commit cpprefjp/site, 8b6a865] | cpprefjp/fixs:1 | `filter_view::base` : 等しい → 等価 | +| [commit cpprefjp/site, fce3c6a] | cpprefjp/fixs:1 | `filter_view`のコンストラクタ : 改行調整 | +| [commit cpprefjp/site, fea94ab] | cpprefjp/link:2, cpprefjp/addref:6 | `as_rvalue_view` : メンバ関数を追加 #713 | +| [commit cpprefjp/site, 515f731] | cpprefjp/fixm:1 | `as_rvalue_view` : グローバル修飾が効くように`std::`をつけた #713 | +| [commit cpprefjp/site, d9e860a] | cpprefjp/link:2, cpprefjp/addref:8 | `ref_view` : メンバ関数を追加 #713 | +| [commit cpprefjp/site, 0d8274f] | cpprefjp/link:2, cpprefjp/addref:3 | `basic_istream_view` : メンバ関数を追加 #713 | +| [commit cpprefjp/site, 0c02cf4, 6df87c7, daf9779] | cpprefjp/link:2, cpprefjp/addref:6 | `common_view` : メンバ関数を追加 #713 | +| [commit cpprefjp/site, 3380084] | cpprefjp/fixm:1 | `common_view` : 概要文章がわかりにくかったので平易にした | +| [commit cpprefjp/site, e399f0d] | cpprefjp/fixm:1 | `common_range` : 例を追加 | +| [commit cpprefjp/site, f1ce7b6] | cpprefjp/link:1, cpprefjp/addref:5 | `concat_view` : メンバ関数を追加 #713 | +| [commit cpprefjp/site, 1ab7976] | cpprefjp/link:2, cpprefjp/addref:5 | `split_view` : メンバ関数を追加 #713 | +| [commit cpprefjp/site, 0f03a4a] | cpprefjp/link:2, cpprefjp/addref:5 | `lazy_split_view` : メンバ関数を追加 #713 | +| [commit cpprefjp/site, 30dd29c] | cpprefjp/link:1, cpprefjp/addref:5 | `join_with_view` : メンバ関数を追加 #713 | +| [commit cpprefjp/site, a5b62f3] | cpprefjp/link:1, cpprefjp/addref:5 | `join_view` : メンバ関数を追加 #713 | +| [commit cpprefjp/site, ff88ad3] | cpprefjp/link:2, cpprefjp/addref:6 | `drop_while_view` : メンバ関数を追加 #713 | +| [commit cpprefjp/site, 23b7fdf] | cpprefjp/link:1, cpprefjp/addref:6 | `drop_view` : メンバ関数を追加 #713 | +| [commit cpprefjp/site, 85980d0] | cpprefjp/link:1, cpprefjp/addref:6 | `take_while_view` : メンバ関数を追加 #713 | +| [commit cpprefjp/site, e1744f9] | cpprefjp/link:1, cpprefjp/addref:6 | `take_view` : メンバ関数を追加 #713 | +| [commit cpprefjp/site, 5bd194c, 2f6270f, 197166c] | cpprefjp/link:2, cpprefjp/fixl:1, cpprefjp/addref:7 | `to_input_view` #1423 | +| [commit cpprefjp/site, 0923d23] | cpprefjp/fixm:1 | `as_const_view` : 例のインクルード不足を修正 | +| [commit cpprefjp/site, 3aa3df8] | cpprefjp/fixl:1 | `uses_allocator_construction_args` : C++23対応 #1063 | +| [commit cpprefjp/site, a4199a4, 0405eaf] | cpprefjp/addref:1 | `empty_view` : `enable_borrowed_range`を追加 #713 | +| [commit cpprefjp/site, 76e1dab] | | `as_rvalue_view`, `slide_view` : C++23なのに継承メンバーがC++20になっていたのを修正 #713 | +| [commit cpprefjp/site, f69a490, 97e2c6f] | cpprefjp/link:1, cpprefjp/addref:6 | `slide_view` : メンバ関数を追加 #713 | +| [commit cpprefjp/site, 8d73664] | cpprefjp/link:1, cpprefjp/addref:5 | `zip_view` : メンバ関数を追加 #713 | +| [commit cpprefjp/site, 58911a3] | cpprefjp/link:1 | Range関係のコード修飾を追加 | +| [commit cpprefjp/site, 826d291] | cpprefjp/link:1, cpprefjp/addref:5 | `zip_transform_view` : メンバ関数を追加 #713 | +| [commit cpprefjp/site, d79c2be] | cpprefjp/link:1, cpprefjp/addref:7 | `stride_view` : メンバ関数を追加 #713 | +| [commit cpprefjp/site, 305a617] | cpprefjp/link:1, cpprefjp/addref:6 | `reverse_view` : メンバ関数を追加 #713 | +| [commit cpprefjp/site, a878933] | cpprefjp/link:1, cpprefjp/addref:8 | `owning_view` : メンバ関数を追加 #713 | +| [commit cpprefjp/site, 649a2ca] | cpprefjp/link:1, cpprefjp/addref:6 | `enumerate_view` : メンバ関数を追加 #713 | +| [commit cpprefjp/site, 8b59890] | cpprefjp/link:1, cpprefjp/addref:6 | `elements_view` : メンバ関数を追加 #713 | +| [commit cpprefjp/site, 5b1f4d4] | cpprefjp/link:1, cpprefjp/addref:6 | `chunk_view` : メンバ関数を追加 #713 | +| [commit cpprefjp/site, 2c71443] | cpprefjp/link:1, cpprefjp/addref:6 | `chunk_by_view` : メンバ関数を追加 #713 | +| [commit cpprefjp/site, 3aebb6e] | cpprefjp/link:1, cpprefjp/addref:5 | `certesian_product_view` : メンバ関数を追加 #713 | +| [commit cpprefjp/site, 4716074] | cpprefjp/link:1, cpprefjp/addref:6 | `adjacent_view` : メンバ関数を追加 #713 | +| [commit cpprefjp/site, 03cf02b] | cpprefjp/link:1, cpprefjp/addref:6 | `adjacent_transform_view` : メンバ関数を追加 #713 | +| [commit cpprefjp/site, 47a5703] | cpprefjp/fixm:7 | `sstream`: 不足していた例を追加 | +| [commit cpprefjp/site, 3dd6a8e] | | スポンサー更新 #1453 | +| [commit cpprefjp/site, 639c817] | cpprefjp/link:4, cpprefjp/addref:28, cpprefjp/fixm:4 | `sstream` : C++20時点のメンバ関数を追加 | +| [commit cpprefjp/site, 67160f5] | cpprefjp/fixs:1 | `ws` : サンプルコードのインデントを4→2に修正 | +| [commit cpprefjp/site, 0587fce] | cpprefjp/link:1 | リンク切れを修正 #1454 | +| [commit cpprefjp/site, 64398ea, 9ff68ed] | cpprefjp/fixl:8 | `[i|o]stringstream` : C++26 `string_view`の仕様に対応 #1186 | +| [commit cpprefjp/site, b30cc46] | cpprefjp/fixm:4 | `sstream` : 各クラスの概要を補強 | +| [commit cpprefjp/site, 03948a4] | | `ranges::find`, `lower_bound`, `equal_range` : 射影変換の例でコピーを抑止するよう修正 | +| [commit cpprefjp/site, 0844fd3] | tool/improves:1 | NGワードチェック : コード修飾ミスの検出を追加 | +| [commit cpprefjp/site, 30247c1] | cpprefjp/fixm:2 | `ranges::(stable_)partition` : 計算量のコピペミスで実行ポリシーの計算量が記載されてしまっていた問題を修正 #1458 | +| [commit cpprefjp/kunai, 6a74650] | tool/improvem:1 | `position`: stickyをposition: relativeに変更 | +| [commit cpprefjp/kunai, c0bcfce] | tool/improvem:1 | `-webkit-overflow-scrolling`: touchを削除 | +| [commit cpprefjp/kunai, 60a2f66] | tool/improvem:1 | DOM操作の最適化 - 大量要素の一括生成をバッチ処理(5-10要素ずつ)に変更 - 各バッチ間でブラウザに処理時間を与える | +| [commit cpprefjp/kunai, 5dd2bd0] | tool/improvem:1 | メモリリーク修正 - 無限ループの可能性を排除 - タイマーの確実なクリーンアップ - CodeMirrorインスタンスの有効性チェック追加 | +| [commit cpprefjp/kunai, 3146691] | tool/improvem:1 | `file://`プロトコル処理にtry-catchを追加 | +| [commit cpprefjp/kunai, 54530f1] | tool/improvem:1 | tooltipの最適化 - box-shadowを削除し、代わりにborderで視覚効果を維持 - 複雑なtransitionを簡略化(opacity以外のz-index transitionを削除) | +| [commit cpprefjp/kunai, 5d32465] | tool/improvem:1 | サイドバーの最適化 : inset box-shadowをborderに置き換え | +| [commit cpprefjp/kunai, f52f747] | tool/improvem:1 | layout.css : 大きな要素のbox-shadow無効化 - メインコンテナとヘッダーの大きなbox-shadowを無効化 - GPUメモリを大量に消費する原因となる大きな要素への影の適用 | +| [commit cpprefjp/site, 293579b] | | ライセンスのバージョンを更新 | +| [commit cpprefjp/site, bd7e5a8] | | LICENSEファイルを追加 (CC BY 4.0) | +| [commit cpprefjp/site, 7a4190f] | | スポンサー更新 #1460 | +| [commit cpprefjp/site, 52c95b6] | | スポンサー更新 #1460 | +| [commit cpprefjp/site, 020eed0] | cpprefjp/fixs:1 | `malloc`: 「関連リンク」 → 「関連項目」 | +| [commit cpprefjp/site, a17c2a6] | cpprefjp/fixm:2 | `atof`, `atoi`: C++98からある機能は、コンパイラのバージョン記載はとくになくてよい | +| [commit cpprefjp/site, 73818d3] | cpprefjp/fixm:1 | `getenv` : 見出しを「出力結果」 → 「出力例」に修正 | +| [commit cpprefjp/site, 5ad0b19] | cpprefjp/fixm:1 | `atof` : 出力例を追加 | +| [commit cpprefjp/site, 3edf110] | cpprefjp/typo:1 | `calloc` : fix typo | +| [commit cpprefjp/site, 52363fd] | cpprefjp/fixs:3 | メモリの文脈での「開放」を「解放」に修正 | +| [commit cpprefjp/site, e1018d0] | cpprefjp/fixm:1 | `rand` : 宣言を追加 | +| [commit cpprefjp/site, 9cb1ee8] | cpprefjp/fixm:7 | `cstdlib` : C++のC互換ライブラリはstd名前空間に属する | +| [commit cpprefjp/site, 2219858] | cpprefjp/fixs:8 | `cstdlib`のサンプルコード : インデントを4 → 2に修正 | +| [commit cpprefjp/site, 2a43c74] | cpprefjp/fixs:2 | `malloc`, `calloc` : 宣言を書く場所を移動 | +| [commit cpprefjp/site, aee1e25] | cpprefjp/link:1 | グローバル修飾リスト : `std::move`は`algorithm`と`utility`にあるので登録しない | +| [commit cpprefjp/site, 89af337, bada478] | cpprefjp/fixs:1 | `realloc`: 未定義 → 未規定 | +| [commit cpprefjp/site, 0c244fb] | cpprefjp/typo:1 | `realloc` : fix typo | +| [commit cpprefjp/site_generator, 1a2ff60] | tool/improvem:1 | `GLOBAL_QUALIFY_LIST`にコメントを書けるようにした | +| [commit cpprefjp/site, a244c92] | cpprefjp/fixm:14 | `cstdio` : C++のC互換ライブラリの関数はstd名前空間 | +| [commit cpprefjp/site, d1283b6, c9b57c1] | tool/addm:1 | コード修飾の重複を削除するスクリプトを追加 | +| [commit cpprefjp/site, 7bcebc8, 99df1d9, 3d6b7ce, f7a9b45] | cpprefjp/link:906 | 重複登録されたコード修飾リンクを削除 | +| [commit cpprefjp/site, e8c9b48] | cpprefjp/fixm:11 | コード修飾の衝突回避のため`error_condition`型の変数名を`ec` → `econd`に変更 | +| [commit cpprefjp/site, d9b2657] | cpprefjp/fixm:18 | `jthread`の変数名を`t` → `jt`に変更 | +| [commit cpprefjp/site, ec127b7] | cpprefjp/fixm:1 | `realloc` : 備考を整理 | +| [commit cpprefjp/site, 7f39905] | cpprefjp/fixm:1 | `realloc` : インデントのエラーを修正 | +| [commit cpprefjp/site, bb07e7c] | cpprefjp/fixm:2 | `vformat`, `make_format_args` : 実行時文字列のフォーマット引数で用途があるので説明と例を追加 | +| [commit cpprefjp/site, be2e52d] | cpprefjp/fixm:1 | グローバル修飾リスト: 現状の登録ルールを記載 (#1472) | +| [commit cpprefjp/site, 4b0e7ea] | cpprefjp/link:2 | `node_handle` : リンクミスを修正 | +| [commit cpprefjp/site, f78ec17] | tool/addm:2, tool/improvem:1, cpprefjp/fixm:2, cpprefjp/addpage:1 | プライマリ宣言のリストを作成し、グローバル修飾リストにプライマリではないオーバーロード・特殊化が登録されたらエラーにするようにした | +| [commit cpprefjp/site, d6e259e] | tool/improvem:1, ignore:1 | リンクチェックCI : グローバル修飾リストのリンクもチェックするようにした | +| [commit cpprefjp/site, a37c006] | tool/addm:1, tool/improvem:7, cpprefjp/fixm:1 | Pull RequestのCIと同等のチェックをローカルで一度に実行するスクリプトを追加 | +| [commit cpprefjp/site, 9ab033a] | tool/addm:1, ignore:2 | グローバル修飾リストの自動ソートスクリプトを追加 | +| [commit boostjp/site, 2401879, 09b1a40, 641c78c] | boostjp/releases:7, boostjp/releasem:20, boostjp/releasel:4, boostjp/link:1 | 1.89.0のリリースノートを追加 | +| [commit cpprefjp/site, 5b26921] | tool/addm:2, tool/improvem:1, cpprefjp/fixs:4 | ゼロ幅文字を削除し、禁止文字をチェック・削除するスクリプトを追加 #1487 | +| [commit cpprefjp/site, c277769] | cpprefjp/link:1 | valarray: 参照リンクが消滅していたのでInternet Archiveに差し替え #1486 | +| [commit cpprefjp/kunai, e0999c1] | tool/improvem:2 | iOS Safariでのクラッシュ対策として:isと:notのネストが深くならないよう修正 | +| [commit cpprefjp/kunai, 0fbeba7] | tool/improvem:1 | iOS Safariでのクラッシュ対策としてCSSのビルドオプションを調整し、複雑さを抑制した | +| [commit cpprefjp/site, 5895eed] | cpprefjp/link:1 | C++23 assume属性 : C++11属性構文へのリンクを関連項目に追加 #1488 | +| [commit cpprefjp/kunai, 4e72de3] | tool/improvem:1 | iOS 16/17 Safariでのページクラッシュを回避するために相対色のネストをやめた | +| [commit cpprefjp/site, 6b2d865] | cpprefjp/link:6 | 言語機能 : 関連項目を追加 | +| [commit cpprefjp/site, 0712ced] | cpprefjp/fixl:1 | C++26のWorking Draftを更新 #1491 | +| [commit cpprefjp/site, 563f48f] | ignore | プライマリリストのソートがうまく動いてなかったのを修正 | +| [commit cpprefjp/site, 4715e9b] | cpprefjp/fixl:2 | C++26: 2025-08 mailingに対応 (#1497) | +| [commit cpprefjp/site, 8cc1753] | ignore | スポンサー更新 #1524 | +| [commit cpprefjp/site, 07c5ad8] | cpprefjp/link:3 | リンクミスを修正 (close #1526) | +| [commit cpprefjp/site, 0180bdc] | cpprefjp/fixm:1 | `function` : 関数型にパラメータ名を指定することもできることを備考として記載 #1529 | +| [commit cpprefjp/site, 7accb42, b8e603c] | cpprefjp/link:1, cpprefjp/fixl:2, cpprefjp/addref:4 | cmath: C++26対応として、`f(max|min)imum[_num]`を追加 #1514 | +| [commit cpprefjp/site, 8d46680] | cpprefjp/link:1, cpprefjp/fixl:6, cpprefjp/addref:8 | `atomic(_ref)` : C++26対応として浮動小数点数の`fmax` / `fmin`関連を追加 #1514 | +| [commit cpprefjp/site_generator, 0c7e4e2] | tool/improves:1 | update submodule | +| [commit cpprefjp/site, c71c86a] | cpprefjp/link:1, cpprefjp/fixl:3, cpprefjp/addref:36, ignore:13 | atomicクラスにreduction関係のメンバ関数を追加 (#1535) #1515 | +| [commit cpprefjp/site, 97c5f4b] | cpprefjp/link:1, cpprefjp/addref:1, cpprefjp/fixl:52 | C++26対応として`shared_ptr`関連をconstexpr対応 #1500 | +| [commit cpprefjp/site, 751dd51] | cpprefjp/fixm:4 | `flat_map` : 速度比較として検索が`map`より遅いと書かれていたのを修正 (#1533) #1531 | +| [commit cpprefjp/site, 69eec33] | cpprefjp/fixm:102 | 乱数のサンプルコード : より説明的なコードにするために乱数のシードを一旦変数にもつようにした | +| [commit cpprefjp/site, 8d78d31] | cpprefjp/link:1 | nolinkを解除 | +| [commit cpprefjp/site, 7473d6a] | cpprefjp/addlang:1, cpprefjp/link:3 | C++26: 「定数式での`void*`からポインタ型へのキャストを許可」を追加 (close #1176) | +| [commit cpprefjp/site, f0a5486] | cpprefjp/link:3 | algorithm : リンク修正 | +| [commit cpprefjp/site, 8c34c7f, 69e0ab8] | cpprefjp/link:1 | `stop_source`のコンストラクタ : コード修飾を追加 | +| [commit cpprefjp/site, 786b39a] | ignore | C++26: 規格用語の整理だけだった「変換コンストラクタという用語を廃止する」を削除 | +| [commit cpprefjp/site, d5b2bb2] | cpprefjp/addlang:1, cpprefjp/link:3 | C++26: 「可変引数テンプレートでfriend宣言をできるようにする」を追加 (close #1329) | +| [commit cpprefjp/site, 29e9569] | cpprefjp/link:1 | `enable_shared_from_this`: サンプルコードにコード修飾を追加 | +| [commit cpprefjp/site, 7f58871] | cpprefjp/link:1 | `partition_copy`: リンクミスを修正 | +| [commit cpprefjp/site_generator, 278615b] | ignore | 貢献ポイント集計用のcommit構文を追加 | +| [commit cpprefjp/markdown_to_html, 46c8876] | ignore | 貢献ポイント集計用のcommit構文を追加 | +| [commit cpprefjp/site, 3d0a0ff, a56fca8] | ignore | 2024年貢献ポイントの集計作業 | +| [commit cpprefjp/site, 9cf9bee, 9e28f66, 66d4cad, 5922358, aa98a7f, a853243, 012035a, 2664a69, d1aad3e, 25b6ab8, 81895c5, 0fb2f7d, de60c55, 548cd3e, 184015b, 45939b2, 961e061, 125fe4f, c607ba2] | ignore | 2025年貢献ポイントの集計作業 | + + +## [rotarymars](https://github.com/rotarymars) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, 5b5cd37] | cpprefjp/fixm:2 | added a sample implementation for `gcd` and `lcm` function | +| [commit cpprefjp/site, dbd4b9d] | cpprefjp/fixm:1 | new sample code for `istringstream` | +| [commit cpprefjp/site, f579e2f, 11b63ee, 5090f49] | cpprefjp/fixs:1 | Added new documentation for P2169R4 | +| [commit cpprefjp/site, 21abedc] | cpprefjp/link:2, cpprefjp/addlang:1 | added sample program and explanation for `fstream` | +| [commit cpprefjp/site, d153991] | cpprefjp/compiler:1 | Added verified version | +| [commit cpprefjp/site, b4ff92e] | cpprefjp/compiler:1 | Added verified version | +| [commit cpprefjp/site, d65e6a9, e822b00] | cpprefjp/link:2, cpprefjp/addlang:1 | new page for embed #1422 | +| [commit cpprefjp/site, 2402f98] | cpprefjp/compiler:1 | Created version column for reference/algorithm/count.md | +| [commit cpprefjp/site, 0b980b4] | cpprefjp/compiler:1 | Created version column for reference/algorithm/count_if.md | +| [commit cpprefjp/site, ac45cea] | cpprefjp/compiler:1 | Created version column for reference/algorithm/copy.md | +| [commit cpprefjp/site, 112bd29] | cpprefjp/compiler:1 | Created version column for reference/algorithm/copy_backward.md | +| [commit cpprefjp/site, 1c1a876] | cpprefjp/compiler:1 | created version column for reference/algorithm/binary_search.md | +| [commit cpprefjp/site, 5df1ae7] | cpprefjp/compiler:1 | created version column for reference/algorithm/adjacent_find.md | +| [commit cpprefjp/site, bf61d03] | cpprefjp/compiler:1 | new clang version for reference/algorithm/ranges_all_of | +| [commit cpprefjp/site, 9d5321d, 7b55ccc, 148bb8c, 93cfae5] | cpprefjp/link:2, cpprefjp/addlang:1 | lang/cpp26.md,lang/cpp26/contracts.md,implementation-status.md: Created article | +| [commit cpprefjp/site, 28659ac, 586dfed] | cpprefjp/fixl:1 | reference/iterator/contiguous_iterator.md: Added information for contiguous_iterator | +| [commit cpprefjp/site, 06d798b] | cpprefjp/fixm:1 | reference/cstddef/null.md: Created sample program | +| [commit cpprefjp/site, 75705c0] | cpprefjp/fixm:1 | reference/cmath/float_t.md: Created sample program | +| [commit cpprefjp/site, dbd3566] | cpprefjp/fixm:1 | reference/cmath/double_t.md: New sample program | +| [commit cpprefjp/site, 84f50ba, d394778, d78efbc] | cpprefjp/fixl:2 | reference.md,reference/contracts.md: Aded contracts | +| [commit cpprefjp/site, 312fc42] | ignore | reference/contracts/contract_violation.md: Removed wrong file | +| [commit cpprefjp/site, f9d79b2, 3227e21, 398fa68] | cpprefjp/fixl:1 | reference/contracts/contract_violation.md: Fixed meta header | +| [commit cpprefjp/site, 0595a39] | ignore | reference/contracts.md: Added function | +| [commit cpprefjp/site, 3181330] | ignore | reference/contracts.md: Removed nolink | +| [commit cpprefjp/site, eaac109] | ignore | reference/contracts/contract_violation.md: Added reference column | +| [commit cpprefjp/site, c3aa7d4] | ignore | reference/contracts/contract_violation.md: Added function description | +| [commit cpprefjp/site, 8ece610] | ignore | reference/contracts.md: Fixed link typo | +| [commit cpprefjp/site, 6494e10] | ignore | reference/contracts/contract_violation.md: Fixed typo and description | +| [commit cpprefjp/site, 7d38e6e] | cpprefjp/addref:1 | new: Added page `evaluation_semantic` | +| [commit cpprefjp/site, d18dc84] | ignore | fix: Removed nolink | +| [commit cpprefjp/site, f82d563] | cpprefjp/addref:1 | new: Created page `assertion_kind` | +| [commit cpprefjp/site, 77d4a16] | ignore | fix: Added version for contract_violation | +| [commit cpprefjp/site, 91bc83e] | cpprefjp/addref:1 | new: New page `detection_mode` | +| [commit cpprefjp/site, 3c65924] | ignore | removed nolink | +| [commit cpprefjp/site, 7491d10] | cpprefjp/addref:1 | new page `invoke_default_contract_violation_handler.md` (#1419) | +| [commit cpprefjp/site, 0821052] | ignore | fixed path | +| [commit cpprefjp/site, a415706] | cpprefjp/addref:1 | new page `reference/contracts/contract_violation/semantic.md`(#1419) | +| [commit cpprefjp/site, 8769b40] | cpprefjp/addref:1 | new page `reference/contracts/contract_violation/location.md`(#1419) | +| [commit cpprefjp/site, 95dd140] | cpprefjp/addref:1 | new page `reference/contracts/contract_violation/kind.md`(#1419) | +| [commit cpprefjp/site, 6ae9144] | cpprefjp/addref:1 | new page `reference/contracts/contract_violation/is_terminating.md`(#1419) | +| [commit cpprefjp/site, 4cf5303] | cpprefjp/addref:1 | new page `reference/contracts/contract_violation/evaluation_exception.md`(#1419) | +| [commit cpprefjp/site, c867da9] | ignore | removed .nolink | +| [commit cpprefjp/site, a2f32bb] | cpprefjp/addref:1 | new page `reference/contracts/contract_violation/detection_mode.md`(#1419) | +| [commit cpprefjp/site, 766f58a, d909f26] | cpprefjp/addref:1 | new page `reference/contracts/contract_violation` (#1419) | +| [commit cpprefjp/site, 415b00e] | ignore | fixed link for contract_violation's member functions(#1419) | +| [commit cpprefjp/site, 31610ca, a50761f] | cpprefjp/link:1 | lang/future.md: Fixed typo | +| [commit cpprefjp/site, 28c1ed5] | cpprefjp/fixm:1 | reference/cstdint/int_fast64_t.md: Created sample program | +| [commit cpprefjp/site, c476d9c] | cpprefjp/fixm:1 | reference/cstdint/int_fast64_min.md: Created sample program | +| [commit cpprefjp/site, d571305] | cpprefjp/fixm:1 | reference/cstdint/int_fast64_max.md: Created sample program | +| [commit cpprefjp/site, 4bfaf75] | cpprefjp/fixm:1 | reference/cstdint/int_fast32_t.md: Added sample program | +| [commit cpprefjp/site, 4bc9af5] | cpprefjp/fixm:1 | reference/cstdint/int_fast32_min.md: Created sample program | +| [commit cpprefjp/site, 84b6c73] | cpprefjp/fixm:1 | reference/cstdint/int_fast32_max.md: Created sample program | +| [commit cpprefjp/site, 1f4ea48] | cpprefjp/fixm:1 | reference/cstdint/int_fast16_t.md: Create sample program | +| [commit cpprefjp/site, 62e7c2f] | ignore | reference/cstdint/int_fast16_max.md: Removed reference column | +| [commit cpprefjp/site, e5250dd] | ignore | reference/cstdint/int_fast16_max.md: Readded verified mark | +| [commit cpprefjp/site, 91b19c4] | cpprefjp/fixm:1 | reference/cstdint/int_fast8_max.md: Removed reference column | +| [commit cpprefjp/site, 06d8c88] | ignore | reference/cstdint/int_fast8_max.md: Fixed version specification | +| [commit cpprefjp/site, d2cbe38] | cpprefjp/fixm:1 | reference/cstdint/int_fast16_min.md: Created sample program | +| [commit cpprefjp/site, 6fcefb7] | cpprefjp/fixm:1 | reference/cstdint/int_fast16_max.md: Created sample program | +| [commit cpprefjp/site, 8dc908b] | cpprefjp/fixm:1 | reference/cstdint/int_fast8_min.md: Created sample program | +| [commit cpprefjp/site, 2a3d37a] | cpprefjp/fixm:1 | reference/cstdint/int_fast8_max.md: Created sample program | +| [commit cpprefjp/site, 9d7b142] | cpprefjp/fixm:1 | reference/cstdint/int_fast8_t.md: Created sample code | +| [commit cpprefjp/site, 665471d] | cpprefjp/fixm:1 | reference/cctype/toupper.md: Created sample implementation | +| [commit cpprefjp/site, 3b77b17] | cpprefjp/fixm:1 | reference/cctype/tolower.md: Created sample implementation | +| [commit cpprefjp/site, 365685e] | cpprefjp/fixm:1 | reference/cctype/isupper.md: Created sample implementation | +| [commit cpprefjp/site, 3527568, 2750049] | ignore | reference/cctype/isspace.md: Created sample implementation | +| [commit cpprefjp/site, 3ced67c] | cpprefjp/fixm:1 | reference/cctype/ispunct.md: Created sample implementation | +| [commit cpprefjp/site, 0b90e93] | cpprefjp/fixm:1 | reference/cctype/islower.md: Created sample implementation | +| [commit cpprefjp/site, 7f86fee] | cpprefjp/fixm:1 | reference/cctype/isgraph.md: Created sample implementation | +| [commit cpprefjp/site, b9ee460] | cpprefjp/fixm:1 | reference/cctype/isdigit.md: Created sample implementation | +| [commit cpprefjp/site, b4204ba] | cpprefjp/fixm:1 | reference/cctype/isblank.md: Added sample implementation | +| [commit cpprefjp/site, 523d036] | cpprefjp/fixm:1 | reference/cctype/isalpha.md: Added sample implementation | +| [commit cpprefjp/site, cd61c31] | cpprefjp/fixm:1 | reference/cctype/isalnum.md: Added sample implementation | +| [commit cpprefjp/site, 3fd522f] | cpprefjp/fixs:1 | reference/cctype/isalnum.md: Added extra info | +| [commit cpprefjp/site, b2f4405] | cpprefjp/fixm:1 | reference/barrier/barrier.md: Created sample program | +| [commit cpprefjp/site, ef7008f] | cpprefjp/fixs:1 | reference/algorithm/ranges_unique.md: Fixed format | +| [commit cpprefjp/site, 9e1eb89] | cpprefjp/fixm:1 | reference/algorithm/unique.md: Fixed format | +| [commit cpprefjp/site, 46a42fe] | ignore | fix: Added proper info for tolower and toupper | +| [commit cpprefjp/site, a094fce] | ignore | fix: Added information for isupper | +| [commit cpprefjp/site, 4097b49] | ignore | fix: Fixed wrong implementation code for `islower()` | +| [commit cpprefjp/site, f9534c2] | ignore | fix: Fixed compiler version | +| [commit cpprefjp/site, 1434e2d] | cpprefjp/compiler:1 | checked gcc version for `std::ssize()` | +| [commit cpprefjp/site, b069a5b, 8316547] | cpprefjp/addref:1, cpprefjp/link:2 | new page `reference/cstdio/fprintf.md` | +| [commit cpprefjp/site, 3f4fdd5] | cpprefjp/addref:1, cpprefjp/link:1 | new page `reference/cstdio/fscanf.md` | +| [commit cpprefjp/site, e1a0612] | cpprefjp/link:2 | fixed .nolink | +| [commit cpprefjp/site, aeafc9c, be1a625] | cpprefjp/addref:1, cpprefjp/link:1 | new page `reference/cstdio/stdout.md` | +| [commit cpprefjp/site, 3e084fb] | cpprefjp/addref:1, cpprefjp/link:1 | new page `reference/cstdio/stdin.md` | +| [commit cpprefjp/site, 196f954] | cpprefjp/addref:1, cpprefjp/link:1 | new page `reference/cstdio/stderr.md` | +| [commit cpprefjp/site, 48b9d77] | cpprefjp/link:5, ignore:3 | fixed a lot of .nolink | +| [commit cpprefjp/site, 7e71dfc] | ignore | remvoed wired words and added compiler column | +| [commit cpprefjp/site, 2a94b63] | ignore | fixed highlighting keyword | +| [commit cpprefjp/site, f266b0f] | cpprefjp/link:1, cpprefjp/addref:1 | new page `tmpnam.md` and fixed name for `cstdio.md` and removed nolink | +| [commit cpprefjp/site, 472ef70] | cpprefjp/link:2, cpprefjp/addref:1 | new page `tmpfile.md` and removed nolink | +| [commit cpprefjp/site, 84741e0] | cpprefjp/link:1, cpprefjp/addref:1 | new page `rename.md` and removed nolink | +| [commit cpprefjp/site, 62c038c] | cpprefjp/link:1, cpprefjp/addref:1 | new page `remove.md` and removed nolink | +| [commit cpprefjp/site, 09eb35e] | cpprefjp/link:1, cpprefjp/addref:1 | new page `filename_max.md` and removed nolink | +| [commit cpprefjp/site, 3b792ce] | cpprefjp/link:2, cpprefjp/addref:1 | new page `eof.md` and removed nolink | +| [commit cpprefjp/site, 3f7dfed, 3e6fdb5] | cpprefjp/addref:1, cpprefjp/link:9 | new page `file.md` and removed .nolink | +| [commit cpprefjp/site, b2b7126] | ignore | added nolink | +| [commit cpprefjp/site, 0470b06, 1a6ace7] | cpprefjp/link:2, cpprefjp/addref:1 | new page `fputc.md` and removed nolink | +| [commit cpprefjp/site, a2e9bfc] | cpprefjp/link:1, cpprefjp/addref:1 | new page `fgets.md` | +| [commit cpprefjp/site, 216a9c3] | cpprefjp/link:2, cpprefjp/addref:1 | new page `fgetc.md` and removed nolink | +| [commit cpprefjp/site, fdb1677, cb305c1] | ignore | added link for partition_copy.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, 2705884] | ignore | added link for all_of.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, 477ae69] | ignore | added link for all_of.md and any_of.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, 91e8c01] | ignore | added link for binary_search.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, d4d4623] | ignore | added link for clamp.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, f38c489] | ignore | added link for copy_n.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, 9a9bd35, 8194a2f] | ignore | added link for copy_backward.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, b2fbf78] | cpprefjp/link:1 | added link for copy_if.md | +| [commit cpprefjp/site, f9ef82c] | cpprefjp/link:1 | added link for copy.md | +| [commit cpprefjp/site, 00f3f8e] | ignore | added link for count_if.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, 83b2464] | ignore | added link for count.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, 484e4f4] | ignore | added link for equal_range.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, d169067] | ignore | added link for equal.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, 25b9153] | ignore | added link for fill_n.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, 0034664] | ignore | added link for fill.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, d129597] | ignore | added link for find_end.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, cbcfdb7] | ignore | fixed code_qualify error | +| [commit cpprefjp/site, e4bd888] | cpprefjp/link:1 | added link for find_first_of.md | +| [commit cpprefjp/site, 405e787] | ignore | added link for find_if_not.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, 95f352f] | ignore | added link for find_if.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, 85f63fe] | ignore | added link for find.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, 3d4a2ef] | ignore | added link for for_each_n.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, e3cd83c] | ignore | added link for for_each.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, e3bd4b7] | ignore | added link for generate_n.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, 7332210] | ignore | added link for generate.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, d0181e4] | ignore | added link for includes.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, ea3bac4] | ignore | added link for inplace_merge.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, c0dd5e6] | ignore | added link for is_heap_until.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, 9d3ab82] | ignore | added link for is_heap.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, 34b3a11] | ignore | added link for is_partitioned.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, f4b2f11] | ignore | added link for is_permutation.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, 8756781] | ignore | added link for is_sorted_until.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, a03646f] | ignore | added link for is_sorted.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, f1b24b5] | ignore | added link for iter_swap.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, 8ba9a70] | cpprefjp/link:1 | added link for lexicographical_compare_three_way.md | +| [commit cpprefjp/site, c668d08] | ignore | added link for lexicographical_compare.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, cf458c7] | ignore | added link for lower_bound.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, 29ef38b] | ignore | added link for make_heap.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, a262ea3] | ignore | added link for max_element.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, fe7d649] | ignore | added link for max.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, 339a6f6] | ignore | added link for merge.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, bffea50] | cpprefjp/link:1 | added link for min_element.md | +| [commit cpprefjp/site, 3bac8d4] | ignore | added link for min.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, 958aa28] | cpprefjp/link:1 | added link for minmax_element.md | +| [commit cpprefjp/site, a0201a2] | cpprefjp/link:1 | added link for minmax.md | +| [commit cpprefjp/site, 639493b] | cpprefjp/link:1 | added link for mismatch.md | +| [commit cpprefjp/site, e6d780c] | ignore | added link for move_backward.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, 4ec75f1] | ignore | added link for move.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, c174221] | ignore | added link for next_permutation (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, d4002e2] | ignore | added link for none_of.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, f304c11] | ignore | added link for nth_element (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, 2daaf8c] | ignore | added link for parital_sort_copy.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, 5488d97] | ignore | added link for partial_sort.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, 17a48cd] | ignore | added link for partition_point.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, 463ba06] | ignore | added link for partition.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, 12233d7] | ignore | added link for pop_heap.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, 1c54923] | ignore | added link for prev_permutation (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, fb0cc44] | ignore | added link for push_heap.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, f991a36] | ignore | added link for random_shuffle.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, 736f548] | ignore | added link for ranges_adjacent_find.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, c7a59d6] | ignore | added link for ranges_all_of.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, 155cbfc] | ignore | added link for ranges_any_of.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, fa9dc4a] | ignore | added link for ranges_binary_search.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, ee0aed9] | ignore | added link for ranges_clamp.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, 4d7a6b8] | ignore | added link for ranges_contains_subrange.md (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, 19f065b] | ignore | fixed code_qualify errors (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, ba2b72c] | ignore | fixed inner-link errors (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, 2b4608d, e4c1ff5] | ignore | added functions for any header at GLOBAL_QUALIFY_LIST.txt (取り消された) | +| [commit cpprefjp/site, a8b8808, 295b764] | ignore | defined items for `` at GLOBAL_QUALIFY_LIST (取り消された) | +| [commit cpprefjp/site, 53c2993, a61a9f3] | ignore | defined items in atomic at GLOBAL_QUALIFY_LIST (取り消された) | +| [commit cpprefjp/site, b23f7fd, e424b2a] | ignore | defined all functions for algorithm header at GLOBAL_QUALIFY_LIST.txt (取り消された) | +| [commit cpprefjp/site, 50c0e58, dfadaad] | ignore | defined items in cctype at GLOBAL_QUALIFY_LIST.txt (取り消された) | +| [commit cpprefjp/site, efff886, bcfccc6] | ignore | defined items in bit at GLOBAL_QUALIFY_LIST.txt (取り消された) | +| [commit cpprefjp/site, 9631cc2, 1234784] | ignore | defined items in barrier at GLOBAL_QUALIFY_LIST.txt (取り消された) | +| [commit cpprefjp/site, c46d1e8, 5600030] | ignore | defined items in cmath at GLOBAL_QUALIFY_LIST.txt (取り消された) | +| [commit cpprefjp/site, aabf375] | ignore | added link (重複登録の削除によってこの変更は取り消された) | +| [commit cpprefjp/site, fb36b7c] | ignore | fixed failing test (ほかの変更とポイント統合) | +| [commit cpprefjp/site, 850a54f] | ignore | added color for eof (ほかの変更とポイント統合) | +| [commit cpprefjp/site, 9098b9e, fe03d64] | cpprefjp/link:1, cpprefjp/addref:1 | new page: `fopen.md` and removed nolink | +| [commit cpprefjp/site, c01cef2, 06970bf, fbe54bd] | cpprefjp/link:1, cpprefjp/addref:1 | new page: `fclose.md` | +| [commit cpprefjp/site, 0e0d859] | ignore | added link for reference (ほかの変更とポイント統合) | +| [commit cpprefjp/site, cb399db] | cpprefjp/addref:1, cpprefjp/link:1 | new page: fflush and removed nolink | +| [commit cpprefjp/site, 73a3b6d] | cpprefjp/addref:1, cpprefjp/link:1 | new page: fputs.md and removed nolink | +| [commit cpprefjp/site, 08bd977] | cpprefjp/addref:1, cpprefjp/link:1 | new page: `feof.md` and removed nolink | +| [commit cpprefjp/site, d900425] | cpprefjp/link:3 | fixed inner links | +| [commit cpprefjp/site, 47758af] | cpprefjp/link:2, cpprefjp/addref:1 | new page `getc.md` and removed nolink | +| [commit cpprefjp/site, 77d79ae] | cpprefjp/link:3, cpprefjp/addref:1 | new page `puts.md` and removed nolink | +| [commit cpprefjp/site, 03ea10c, 9113be6] | cpprefjp/link:2, cpprefjp/addref:1 | new page `getchar.md` and removed nolink | +| [commit cpprefjp/site, b80b117] | cpprefjp/link:7, cpprefjp/addref:1 | created printf.md and removed nolink | +| [commit cpprefjp/site, e1afb4c] | cpprefjp/addref:1, cpprefjp/link:1, ignore:1 | created scanf.md and removed nolink | +| [commit cpprefjp/site, f5be1db] | cpprefjp/link:1, ignore:1 | fixed nolink | +| [commit cpprefjp/site, cfe94b3] | ignore | fixed function declaration | +| [commit cpprefjp/site, f387fd3] | cpprefjp/addref:1, cpprefjp/link:5 | new page `first.md` and removed nolink | +| [commit cpprefjp/site, cf4d78f] | cpprefjp/addref:1, cpprefjp/link:5 | new page `second.md` and removed nolink | +| [commit cpprefjp/site, 0ceee86] | ignore | fixed header for `first.md` and `second.md` | +| [commit cpprefjp/site, 64128e8, 07c43dc, f11a9f1] | cpprefjp/addref:1, cpprefjp/link:4 | new page `putchar.md` and removed nolink | +| [commit cpprefjp/site, 05c1017] | ignore | removed brackets for function declaration | +| [commit cpprefjp/site, a51f736] | cpprefjp/link:2, cpprefjp/addref:1 | new page `ungetc.md` and removed nolink | +| [commit cpprefjp/site, be3f3eb] | cpprefjp/addref:1, cpprefjp/link:4 | new page `putc.md` and removed nolink | +| [commit cpprefjp/site, 3a5b8ac] | cpprefjp/addref:1, cpprefjp/link:1 | new page `fread.md` | +| [commit cpprefjp/site, f2c2262, 3f22e22, b645fd6, 3aec3d6, 4124913, c1261d3, 5050bbe] | cpprefjp/addref:1, cpprefjp/link:1 | new page `fpos_t.md` | +| [commit cpprefjp/site, be4f0eb] | ignore | removed /* */ for implementation-defined (#1473) | +| [commit cpprefjp/site, 116c20a] | ignore | fixed inappropriate code in `tmpnam.md` | +| [commit cpprefjp/site, c6a67d8] | ignore | fixed inappropriate code | +| [commit cpprefjp/site, 942ab1a] | ignore | fixed declaration of `file.md` | +| [commit cpprefjp/site, af2a99d] | ignore | fixed index in tmpnam.md | +| [commit cpprefjp/site, 55f9df1] | ignore | fixed explanation for tmpnam | +| [commit cpprefjp/site, d074e9f] | ignore | Update reference/cstdio/fread.md | +| [commit cpprefjp/site, dd34ab2] | ignore | fixed explanation in fread.md | +| [commit cpprefjp/site, 9702775] | ignore | fixed function declaration | +| [commit cpprefjp/site, 121b46d] | tool/fixbug:1 | chore: fixed script to detect broken code qualifiers using a raw string (#1469) | +| [commit cpprefjp/site, cf58bef, fd7a507, 6104a9a, 8fa2653, 24dc108] | cpprefjp/link:1, cpprefjp/addref:1 | new page bufsiz.md | +| [commit cpprefjp/site, 2f35dc0, 222f890, 28435a2, 8be4213, 4ac8177, 4710078] | cpprefjp/addref:1, cpprefjp/link:1 | new page: fwrite.md | +| [commit cpprefjp/site, f596c4c] | ignore | added appropriate explanations for function with `restrict` | +| [commit cpprefjp/site_generator, de24d69] | tool/improvem:2 | feat: Remove paired grave accents from titles | +| [commit cpprefjp/site, b4f048f] | cpprefjp/addref:1, cpprefjp/link:1 | Create page: fopen_max (#1530) | + + +## [yohhoy](https://github.com/yohhoy) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, ae69e81] | cpprefjp/typo:1 | mdspan/AccessorPolicy: fix typo | +| [commit cpprefjp/site, 7675064] | cpprefjp/fixm:1, cpprefjp/fixl:4 | mdspan/layout_{left,right}(_padded): P3355R1対応 | +| [commit cpprefjp/site, 86f0c41] | cpprefjp/fixm:2 | chrono/{tai,gps}_clock: クラス説明を増補 | +| [commit cpprefjp/site, 9e72237] | cpprefjp/fixl:1 | linalg/conjugated: R3050R2対応(#1383) | +| [commit cpprefjp/site, abcc16f] | cpprefjp/fixl:1 | linalg/tranposed: P3222R0対応(#1382) | +| [commit cpprefjp/site, 10ebad2] | cpprefjp/fixm:1 | lang/cpp26: fix markup | +| [commit cpprefjp/site, 7d79a5d] | cpprefjp/fixl:6, cpprefjp/link:1 | mdspan: aligned_accessor概要 P2897R7(#1380) | +| [commit cpprefjp/site, b5dd43f] | cpprefjp/addref:1, cpprefjp/link:1 | memory: is_sufficiently_aligned P2897R7(#1380) | +| [commit cpprefjp/site, a4ffe7c] | cpprefjp/fixl:1, ignore:1 | memory: ヘッダ説明の微調整 | +| [commit cpprefjp/site, 0353f38] | cpprefjp/link:1, cpprefjp/addref:4 | mdspan/aligned_accessor: 全メンバ P2897R7(#1380) | +| [commit cpprefjp/site, afdc031] | cpprefjp/fixm:7 | atomic: wait系関数の事前条件を整理 | +| [commit cpprefjp/site, 1e87d12] | cpprefjp/link:2, cpprefjp/addref:1 | rcu: C++26 RCUヘッダ概要(#1183) | +| [commit cpprefjp/site, a4f1067] | cpprefjp/fixm:1 | cpp14/digit_separators: 言語仕様を補記 | +| [commit cpprefjp/site, eda1e0c] | cpprefjp/addref:9, cpprefjp/fixm:1, ignore:1 | rcu: rcu_domain, rcu_obj_base (#1183) | +| [commit cpprefjp/site, 9a152c2] | cpprefjp/addref:3, ignore:5 | rcu: 非メンバ関数群 (#1183) | +| [commit cpprefjp/site, c7a7c9d] | cpprefjp/link:1, ignore:5 | rcu: 微調整 (#1183) | +| [commit cpprefjp/site, 7ae4be4] | cpprefjp/fixl:3 | functional: C++26 P2714R1 (#1200) | +| [commit cpprefjp/site, 1dd1b04] | cpprefjp/fixl:8 | C++26 P3475R2 consume操作の非推奨化(#1420) | +| [commit cpprefjp/site, 7bf378e] | cpprefjp/fixl:1, cpprefjp/addref:1 | stop_token: (un)stoppable_token (#1384) | +| [commit cpprefjp/site, 4f805fa] | cpprefjp/fixl:1, cpprefjp/addref:1, ignore:2 | stop_token: never_stop_token (#1384) | +| [commit cpprefjp/site, fa3f23c] | ignore:2, cpprefjp/addref:2, cpprefjp/fixl:4 | stop_token: stop_callback_for_t (#1384) | +| [commit cpprefjp/site, 7c7167b] | ignore:1, cpprefjp/addref:2, cpprefjp/fixl:2 | stop_token: inplace_stop_source (#1384) | +| [commit cpprefjp/site, 3d75bda] | cpprefjp/addref:5, cpprefjp/fixl:1, ignore:2 | stop_token: inplace_stop_source全メンバ (#1384) | +| [commit cpprefjp/site, 3c66609] | ignore:4, cpprefjp/addref:6, cpprefjp/fixm:1, cpprefjp/fixl:2 | stop_token: inplace_stop_token全メンバ (#1384) | +| [commit cpprefjp/site, c75607b] | ignore:1, cpprefjp/addref:4, cpprefjp/fixm:2, cpprefjp/fixl:1, cpprefjp/link:1 | stop_token: inplace_stop_callback全メンバ (#1384) | +| [commit cpprefjp/site, 494c6d2] | cpprefjp/fixl:3, ignore:1, cpprefjp/fixm:3 | C++26 std::executionエンティティ一覧(#1384) | +| [commit cpprefjp/site, c190380] | cpprefjp/addref:3, ignore:1 | execution: sender,sender_in,sender_to (#1384) | +| [commit cpprefjp/site, efc1070] | ignore | execution/sender_*: 微調整 (#1384) | +| [commit cpprefjp/site, 3e8c7c7] | cpprefjp/addref:2, cpprefjp/fixm:1, ignore:3 | execution: receiver,receiver_of (#1384) | +| [commit cpprefjp/site, 2b4f515] | cpprefjp/addref:2, ignore:4 | execution: completion_signatures(_of_t) (#1384) | +| [commit cpprefjp/site, 23cf8aa] | cpprefjp/addref:1, cpprefjp/fixm:1, ignore:3 | execution: operation_state (#1384) | +| [commit cpprefjp/site, a7e53ae] | cpprefjp/addref:1, ignore:2 | execution: scheduler (#1384) | +| [commit cpprefjp/site, 4220eb1] | cpprefjp/addref:3, cpprefjp/fixm:2 | execution: set_value,set_error,set_stopped (#1384) | +| [commit cpprefjp/site, c22f556] | cpprefjp/addref:1 | execution: is-awaitable (#1384) | +| [commit cpprefjp/site, 92a7237] | ignore | execution/env: fix ngword | +| [commit cpprefjp/site, 2d92c9f, 6137b03, 659e33c] | cpprefjp/addref:4, cpprefjp/fixm:1 | execution: env,prop,queryable (#1384) | +| [commit cpprefjp/site, 38bbbb9] | cpprefjp/addref:2 | execution: get_env,env_of_t (#1384) | +| [commit cpprefjp/site, f156adb] | cpprefjp/addref:4 | execution: default_domain (#1384) | +| [commit cpprefjp/site, d516cba] | cpprefjp/addref:3 | execution: transform_{sender,env},apply_sender (#1384) | +| [commit cpprefjp/site, 252f026] | cpprefjp/addref:2 | execution: connect,connect_result_t (#1384) | +| [commit cpprefjp/site, 9bdfb06] | cpprefjp/addref:1 | execution: with-await-transform (#1384) | +| [commit cpprefjp/site, 9cd16e0] | cpprefjp/addref:2 | execution: get-domain-late,sender-for (#1384) | +| [commit cpprefjp/site, 60b2958] | cpprefjp/addref:2 | execution: get_completion_signatures (#1384) | +| [commit cpprefjp/site, 6f4510e] | ignore | execuion/connect: small fixes | +| [commit cpprefjp/site, 0ff48a6] | ignore | execution/default: remove forbid chars | +| [commit cpprefjp/site, e4ffb85, 20a8d5e] | cpprefjp/addref:1 | execution: start (#1384) | +| [commit cpprefjp/site, ac9fa1d] | ignore | execution/scheduler: refinement (#1384) | +| [commit cpprefjp/site, 7a43329] | ignore | execution/scheduler: fix inner link | +| [commit cpprefjp/site, 08365de] | cpprefjp/addref:1 | execution: schedule (#1384) | +| [commit cpprefjp/site, a4fbd16] | cpprefjp/addref:1 | execution: schedule_result_t (#1384) | +| [commit cpprefjp/site, 3785ecf] | cpprefjp/addref:1 | execution: get_completion_scheduler (#1384) | +| [commit cpprefjp/site, d512f5b] | cpprefjp/addref:2 | execution: get_stop_token,stop_token_of_t (#1384) | +| [commit cpprefjp/site, e57a099] | ignore | execution: vaild-completion-signatures説明を移動 | +| [commit cpprefjp/site, b74d3e8] | cpprefjp/addref:1 | execution: get_allocator (#1384) | +| [commit cpprefjp/site, ebdeeed] | cpprefjp/addref:3 | execution: get_domain,get_(delegation_)scheduler (#1384) | +| [commit cpprefjp/site, a285ffa] | cpprefjp/addref:4 | execution: value_type_of_t,error_type_of_t,sends_stopped (#1384) | +| [commit cpprefjp/site, 7a7c220] | cpprefjp/addref:6 | execution: run_loop/get_scheduler (#1384) | +| [commit cpprefjp/site, c1091ca] | cpprefjp/addref:1 | execution: get-completion-domain (#1384) | +| [commit cpprefjp/site, 88bcec6] | cpprefjp/addref:3 | execution: run_loop全メンバ (#1384) | +| [commit cpprefjp/site, e6b7e2c] | ignore | execution/run_loop: 微調整 (#1384) | +| [commit cpprefjp/site, 2a210a5, 7aa4a3a] | cpprefjp/addref:6 | execution: sync_wait(_with_variant) (#1384) | +| [commit cpprefjp/site, 5e7c6ee] | ignore | execution/basic-operation: fix inner links | +| [commit cpprefjp/site, 885f6ee] | cpprefjp/addref:5 | execution: just (#1384) | +| [commit cpprefjp/site, 9ea31e8] | cpprefjp/link:2 | GLOBAL_QUALIFY_LIST: std::memory_order_consume削除 (#1420) | +| [commit cpprefjp/site, 0e7abe9] | cpprefjp/link:3 | GLOBAL_QUALIFY_LIST: std::variant追加 | +| [commit cpprefjp/site, b7bf5a1] | cpprefjp/link:6 | GLOBAL_QUALIFY_LIST: std::jthread追加 | +| [commit cpprefjp/site, c629ec0] | ignore | execution/run_loop: fix typos | +| [commit cpprefjp/site, f1e2743] | cpprefjp/addref:1 | execution: tag_of_t (#1384) | +| [commit cpprefjp/site, ff009c0] | cpprefjp/addref:1 | execution: movable-value (#1384) | +| [commit cpprefjp/site, b653831] | cpprefjp/addref:1 | execution: product-type (#1384) | +| [commit cpprefjp/site, cef1c67] | cpprefjp/addref:3 | execution: decays-to,decayed-tuple,variant-or-empty (#1384) | +| [commit cpprefjp/site, 1cb82c9, 7baad01] | cpprefjp/addref:1 | execution: forwarding_query (#1384) | +| [commit cpprefjp/site, 628698f, 63b19a3] | cpprefjp/addref:2 | execution: then (#1384) | +| [commit cpprefjp/site, b8c7c50] | cpprefjp/addref:1 | execution: read_env (#1384) | +| [commit cpprefjp/site, e411c3d, 248c362, 1adf476] | cpprefjp/addref:2 | execution: into_variant (#1384) | +| [commit cpprefjp/site, 331cc4e] | cpprefjp/addref:1 | execution: starts_on (#1384) | +| [commit cpprefjp/site, 7160b82, fd7bea7] | cpprefjp/addref:2 | execution: let_value (#1384) | +| [commit cpprefjp/site, 034b8e6] | ignore | execution: 例示コードを改善 (#1384) | +| [commit cpprefjp/site, ed4cd68] | cpprefjp/addref:2 | execution: on (#1384) | +| [commit cpprefjp/site, b15f55f, ee11fa0] | cpprefjp/addref:1 | execution: 微調整 (#1384) | +| [commit cpprefjp/site, 3f41dc9] | cpprefjp/addref:2 | execution: continues_on,schedule_from (#1384) | +| [commit cpprefjp/site, 047e119] | cpprefjp/addref:2 | execution: when_all (#1384) | +| [commit cpprefjp/site, 78b4c31] | cpprefjp/addref:1 | execution: when_all_with_variant (#1384) | +| [commit cpprefjp/site, ae2af90] | cpprefjp/addref:1 | execution: split (#1384) | +| [commit cpprefjp/site, 876474c] | cpprefjp/addref:1 | execution: bulk (#1384) | +| [commit cpprefjp/site, d134ea8] | cpprefjp/addref:2 | execution: just_error,just_stopped (#1384) | +| [commit cpprefjp/site, 82881a7] | ignore | execution: 微調整 (#1384) | +| [commit cpprefjp/site, f27450b] | cpprefjp/addref:4 | functional: C++26 std::execution説明用エンティティ (#1384) | +| [commit cpprefjp/site, d6addf6] | cpprefjp/addref:1 | execution: sender_adaptor_closure (#1384) | +| [commit cpprefjp/site, b272152, c658129] | cpprefjp/addref:2 | execution: stopped_as_{error,optional} (#1384) | +| [commit cpprefjp/site, a6d6258, a1eaff0] | cpprefjp/addref:4 | execution: with_awaitable_senders (#1384) | +| [commit cpprefjp/site, 24f1d81] | cpprefjp/link:9 | GLOBAL_QUALIFY_LIST: std::exchange追加 | +| [commit cpprefjp/site, 2705e5a, 1a6cd9c] | cpprefjp/addref:4 | execution: as_awaitable (#1384) | +| [commit cpprefjp/site, deaaa16] | cpprefjp/addref:2 | execution: get_forward_progress_guarantee (#1384) | +| [commit cpprefjp/site, 8253efa] | ignore | execution: 説明専用エンティティ (#1384) | +| [commit cpprefjp/site, 4ae7b92, d4f0317] | cpprefjp/addref:3 | execution: transform_completion_signatures(_of) (#1384) | +| [commit cpprefjp/site, 4f5dd2a] | ignore | execution: fix spelling query-or-default (#1384) | +| [commit cpprefjp/site, aa4f065] | cpprefjp/addref:2 | execution: upon_error,upon_stopped (#1384) | +| [commit cpprefjp/site, 0141068] | cpprefjp/addref:2 | execution: let_error,let_stopped (#1384) | +| [commit cpprefjp/site, d512d56] | ignore | functional: 実行制御ライブラリへの内部リンク付与 (#1384) | +| [commit cpprefjp/site, 30c8531] | ignore | execution: 影響箇所へP3396R1参照追記 (#1384) | +| [commit cpprefjp/site, 1142f79] | cpprefjp/link:1 | iterator/projected_value_t: add inner link | +| [commit cpprefjp/site, 97ddfcb] | ignore | stop_token: fix inner links | +| [commit cpprefjp/site, 128604d] | cpprefjp/link:1 | execution/execution_policy: add inner link | +| [commit cpprefjp/site, 8d56403] | ignore | execution/read_env: 概要説明の微調整 | +| [commit cpprefjp/site, b7c5b24] | cpprefjp/fixl:5 | iterator: C++26 P2997R1対応(#1309) | +| [commit cpprefjp/site, 2930095] | cpprefjp/fixm:1 | cpp26/embed: remove redundant ';' | +| [commit cpprefjp/site, f047133] | cpprefjp/link:1 | cstdlib/system: POISX規格への参照 | +| [commit cpprefjp/site, a24d776] | cpprefjp/fixm:1, cpprefjp/fixl:3 | atomic/atomic_flag: LWG3659対応 | +| [commit cpprefjp/site, 30b7ea6] | cpprefjp/fixl:1 | execution/schedule_from: LWG4198 | +| [commit cpprefjp/site, 9fee4b5] | cpprefjp/fixl:6 | executuon: LWG4203 | +| [commit cpprefjp/site, 664d069] | cpprefjp/fixl:1 | execution/when_all: LWG4227 | +| [commit cpprefjp/site, 0bf9ae6] | cpprefjp/fixl:1 | execution/with-await-transform: LWG4201 | +| [commit cpprefjp/site, 2aa170e] | cpprefjp/fixl:1 | execution/operation_state: LWG4200 | +| [commit cpprefjp/site, 86a0ae3] | cpprefjp/fixl:1 | execution/default_domain/transform_env: LWG4209 | +| [commit cpprefjp/site, 46c87af] | cpprefjp/fixl:1 | execution/connect: LWG4208 | +| [commit cpprefjp/site, 222e1a3] | cpprefjp/fixl:1 | execution/let_value: LWG4204, LWG4205 | +| [commit cpprefjp/site, 2798af6] | cpprefjp/fixl:1 | execution/sender: LWG4202 | +| [commit cpprefjp/site, 7e7cde1] | ignore | execution/upon_stopped: fix typo | +| [commit cpprefjp/site, 0f7b8bc] | cpprefjp/link:1, cpprefjp/fixl:2 | execution/split: P3682R0 remove split algorithm | +| [commit cpprefjp/site, eb824e2, 7b6fa9e, 2121599] | cpprefjp/addref:7, cpprefjp/fixl:31 | execution: C++26 P3557R3対応 | +| [commit cpprefjp/site, d29d225] | cpprefjp/link:2, cpprefjp/fixl:3 | execution: P3557R3 remove transform_completion_signatures(_of) | +| [commit cpprefjp/site, 157a932] | ignore | execution/then,upon_{error,stopped}: 効果説明をthenに統合 | +| [commit cpprefjp/site, 403ba99] | cpprefjp/link:2, cpprefjp/addref:1, cpprefjp/fixl:3 | execution: C++26 P3284R4 (#1501) | +| [commit cpprefjp/site, a7d2844] | cpprefjp/fixl:2, cpprefjp/addref:1 | execution: C++26 P3570R2 (#1507) | +| [commit cpprefjp/site, c08b3ef, 5d1f2ce] | cpprefjp/fixl:2, cpprefjp/addref:2 | execution: C++26 P3481R5 (#1508) | +| [commit cpprefjp/site, 050f14d] | cpprefjp/fixl:1, cpprefjp/addref:1 | execution: P2079R10 (#1511) | +| [commit cpprefjp/site, 61e0053] | cpprefjp/fixl:5, cpprefjp/addref:2 | execution: P2079R10 User facing API (#1511) | +| [commit cpprefjp/site, ab280be] | ignore | execution/parallel_scheduler: 説明増補(#1511) | +| [commit cpprefjp/site, a516717] | cpprefjp/addref:6 | execution: P2079R10 Replaceability API (#1511) | +| [commit cpprefjp/site, a4d3b95] | cpprefjp/addref:3 | execution: P2079R10 Replaceability API (#1511) | +| [commit cpprefjp/site, bdd426b] | ignore | execution: P2079R10 調整(#1511) | +| [commit cpprefjp/site, d53cd4c] | cpprefjp/fixl:1 | execution/forwarding_query: get_await_completion_adaptor追記(#1507) | +| [commit cpprefjp/site, b11575f] | cpprefjp/fixl:2, cpprefjp/addref:1 | execution: C++26 P3433R1 (#1509) | +| [commit cpprefjp/site, 171949a] | ignore | execution/get-domain-{early,late}: 関連項目 | +| [commit cpprefjp/site, 76555be] | cpprefjp/fixm:1 | cpp26/structured_bindings_can_introduce_a_pack: テンプレート内でのみ有効 (#1376) | +| [commit cpprefjp/site, a510758] | cpprefjp/addref:3, cpprefjp/fixl:1, cpprefjp/fixm:1 | execution: P3149R11 scope_token(#1510) | +| [commit cpprefjp/site, 1aa60a2] | cpprefjp/addref:12 | execution: P3149R11 simple_counting_scope(#1510) | +| [commit cpprefjp/site, a93a451] | cpprefjp/addref:13 | execution: P3149R11 counting_scope(#1510) | +| [commit cpprefjp/site, 53db61c] | cpprefjp/addref:1 | execution: P3149R11 stop-when(#1510) | +| [commit cpprefjp/site, df84025] | ignore | execution/stop-when: fix markup(#1510) | +| [commit cpprefjp/site, 5ee5356] | cpprefjp/addref:1 | execution: P3149R11 associate(#1510) | +| [commit cpprefjp/site, e7aa9c8] | ignore | execution/associate: 説明増補,例示修正 (#1510) | +| [commit cpprefjp/site, eed390c] | ignore | execution/associate: 調整 (#1510) | +| [commit cpprefjp/site, d01bc08] | cpprefjp/addref:1 | execution: P3149R11 spawn(#1510) | +| [commit cpprefjp/site, 19dfdd7] | cpprefjp/addref:1 | execution: P3149R11 spawn_future(#1510) | +| [commit cpprefjp/site, d528d34] | ignore | execution/spawn_future: 微調整 | +| [commit cpprefjp/site, 4fbde58] | ignore | stop_token/stoppable-source: fix typo | +| [commit cpprefjp/site, 911f1dc] | ignore | execution/start: 微調整 | +| [commit cpprefjp/site, 85387aa] | cpprefjp/fixl:1 | execution: P3552R3 エンティティ列挙のみ (#1521) | +| [commit cpprefjp/site, c2e5e06] | cpprefjp/fixm:1 | string_view::op_sv : ヌル終端に関する説明がわかりにくかったので追記 #1398 (Co-author) | + + +## [Raclamusi](https://github.com/Raclamusi) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, c763f14] | cpprefjp/link:30 | リンクテキストとリンクアドレスの文書番号の不一致を修正 | +| [commit cpprefjp/site, 08bb4ea] | cpprefjp/link:1 | ヘッダのリンクのテキストとアドレスの不一致を修正 | +| [commit cpprefjp/kunai, 8f8263b] | tool/improvem:2 | ページ推移後にキーボードで画面スクロールできるようにした #75 | +| [commit cpprefjp/site, 1980594] | cpprefjp/link:1 | リンクを修正 | +| [commit cpprefjp/kunai, 97b6378] | tool/improvem:1 | PlaygroundのC++バージョンをC++2cに変更 #157 | +| [commit cpprefjp/kunai, 818d788] | tool/fixbug:6 | postcssの color() を生のCSSの記法に変更 | +| [commit boostjp/site, 7fa282f] | boostjp/typo:1 | Typo修正 | +| [commit cpprefjp/site, 2107107] | cpprefjp/typo:17 | いくつかのtypoを修正 | +| [commit cpprefjp/site, e5b2c4f] | cpprefjp/fixm:1 | C++26 属性の無視性を見直し : オブジェクトサイズの説明を修正 | +| [commit cpprefjp/site, eed2bbf] | cpprefjp/fixm:1 | C++26 未初期化変数の読み取り : 表現を修正 | +| [commit cpprefjp/site, e3e7d09] | cpprefjp/fixm:1 | C++26: 表を整理 | +| [commit cpprefjp/site, 4a750d8] | cpprefjp/typo:5, tool/improvem:1 | typo修正とNGワード追加 | +| [commit boostjp/site, a88eb41] | boostjp/link:2 | アンカーの修正 | +| [commit boostjp/site, 3340a14] | boostjp/link:1 | リンクの修正 | +| [commit boostjp/site, 428d1f1] | boostjp/typo:15 | Typo修正 | +| [commit boostjp/site, 3bee3b1] | boostjp/link:1 | リンクの修正 | +| [commit boostjp/site, e884e46] | boostjp/typo:1, boostjp/fixm:4 | Typo修正 | +| [commit cpprefjp/site, d7d9887] | cpprefjp/typo:4, tool/improvem:1 | typo修正とNGワード追加 | +| [commit cpprefjp/site, ece3ce9] | cpprefjp/fixm:13 | 対応しない波カッコを修正 | +| [commit cpprefjp/site, 919efc3] | cpprefjp/fixm:13 | クラス定義の後のセミコロン忘れを修正 | +| [commit cpprefjp/site, 6a95cca] | cpprefjp/link:1 | グローバル修飾のリンクを修正 | +| [commit cpprefjp/site, 64a6665] | cpprefjp/fixm:27 | C++ のコードブロックに cpp を追加 | +| [commit cpprefjp/site, c601a46] | cpprefjp/fixm:1 | `get(const tuple&&)` の C++ バージョンを修正 | +| [commit cpprefjp/site, 267a954] | cpprefjp/fixl:1 | `get()` に `const tuple&&` 版を追加 | +| [commit cpprefjp/site, 22f113e] | cpprefjp/fixm:1 | コード例のエラーを修正 #1456 | +| [commit cpprefjp/site, 1fb173f] | cpprefjp/link:2 | リンクを修正 | +| [commit cpprefjp/site, 7e8b52e] | cpprefjp/fixm:1, cpprefjp/link:1 | Typoを修正 | +| [commit cpprefjp/site, 0328c11] | cpprefjp/fixm:5 | クラス定義の後のセミコロン忘れを修正 | +| [commit cpprefjp/site, 7fe1357] | cpprefjp/fixm:16 | `[meta id-type]` を修正 | +| [commit cpprefjp/site, f5c719e] | cpprefjp/fixm:18 | `[meta class]` の抜けを修正 | +| [commit cpprefjp/site, 4f4fdfb] | cpprefjp/fixm:3 | タイトルの間違いを修正 | +| [commit cpprefjp/kunai, 010c092] | tool/fixbug:1 | 同じ名前のページに対するサイドバーの挙動を修正 | +| [commit cpprefjp/site, 87fe6ed] | cpprefjp/fixm:1 | 特殊化から `[meta class]` を削除 | +| [commit cpprefjp/site, a8797d0] | cpprefjp/fixm:2 | 代入演算子のタイトルを `operator=` で統一 | +| [commit cpprefjp/site, e579396] | cpprefjp/fixm:5 | タイトルと一致しないコードを修正 | +| [commit cpprefjp/site, a47d09f] | cpprefjp/link:2 | ファイル名を修正 | +| [commit cpprefjp/site, e408f41] | cpprefjp/fixm:1 | タイトルを修正 | +| [commit cpprefjp/site, e05f8b5] | cpprefjp/fixs:2 | `[meta ...]` の書き方を修正 | +| [commit cpprefjp/site_generator, fcdaac6] | tool/improvem:1 | type 判別のエラーメッセージに原因ファイルの情報を追加 | +| [commit cpprefjp/site, 95459a7] | cpprefjp/fixm:2 | 自動リンクがつくようにスペースを挿入 | +| [commit cpprefjp/site, dd16f31] | cpprefjp/link:1 | グローバル修飾に `` を追加 | +| [commit cpprefjp/site, 2d1d210] | cpprefjp/fixm:2 | コード中の非ASCII文字を修正 | +| [commit cpprefjp/site, aa2056f] | cpprefjp/fixm:2 | タイトルを修正 | +| [commit cpprefjp/site, 76f8ad6] | cpprefjp/fixm:2 | 型エイリアス定義の後のセミコロン忘れを修正 | +| [commit cpprefjp/site, cfe1432] | cpprefjp/fixm:3 | implementation defined を implementation-defined に変更 | +| [commit cpprefjp/site, b0adf47] | cpprefjp/fixm:1 | tempnam → tmpnam | +| [commit cpprefjp/site, 700975a] | cpprefjp/fixm:1 | 名前空間を修正 std::range → std::ranges | +| [commit cpprefjp/site, 408e16d] | cpprefjp/fixm:2 | インラインコードブロックの開き忘れ、閉じ忘れを修正 | +| [commit cpprefjp/site, c1128ce] | tool/improves:2 | スクリプトの不要なセミコロンを削除 | +| [commit cpprefjp/site, 0c54fa4] | tool/improvem:3 | スクリプトの型アノテーションを修正 | +| [commit cpprefjp/site, acbbb7b] | tool/fixbug:1 | スクリプトの変数名を修正 | +| [commit cpprefjp/site, f7662fe] | cpprefjp/link:4 | リンクを修正 | +| [commit cpprefjp/site, 05fca6c] | cpprefjp/link:2 | リンクを修正 | +| [commit cpprefjp/site, 17a8b4e] | cpprefjp/link:3 | typo修正 | +| [commit cpprefjp/site, 2c047fd] | cpprefjp/fixm:1 | ranges:: 抜けを修正 | +| [commit cpprefjp/site, 24df3e1] | cpprefjp/link:1 | typo修正 | +| [commit cpprefjp/site, 35b3151] | cpprefjp/link:2 | リンクのカッコの閉じ忘れを修正 | +| [commit cpprefjp/site, 68b6308] | cpprefjp/link:3 | ヘッダのリンクを修正 | +| [commit cpprefjp/site, 5b73464] | cpprefjp/link:1 | リンクを修正 | +| [commit cpprefjp/site, 309420a] | cpprefjp/typo:1, tool/improves:1 | typo修正とNGワード追加 | +| [commit cpprefjp/site, 715c5f9] | cpprefjp/link:3 | リンクを修正 | +| [commit cpprefjp/site, 63c44c0] | cpprefjp/typo:1 | typo修正 | +| [commit cpprefjp/site, 58451f0] | cpprefjp/typo:1 | typo修正 | +| [commit cpprefjp/site, 48b1149] | cpprefjp/link:3 | リンクを修正 | +| [commit cpprefjp/site, b0477cf] | cpprefjp/fixs:16 | 繰り返しタイプのtypoの修正 | +| [commit cpprefjp/site, 5426d39] | cpprefjp/typo:1 | typo修正 | +| [commit cpprefjp/site, 7b6b879] | cpprefjp/link:8 | リンクを修正 | +| [commit cpprefjp/site, 3bb11d9] | cpprefjp/typo:5, tool/improvem:1 | typo修正とNGワード追加 | +| [commit cpprefjp/site, bb595bc] | cpprefjp/typo:1, tool/improves:1 | typo修正とNGワード追加 | +| [commit cpprefjp/site, 501a325] | cpprefjp/fixm:1 | メンバ関数名を修正 | +| [commit cpprefjp/site, 9fbb233] | cpprefjp/link:4 | `pair::first`, `pair::second` のリンクを修正 | +| [commit cpprefjp/site, 377b4a4] | cpprefjp/link:15 | リンクを修正 | +| [commit cpprefjp/site, a34f426] | cpprefjp/link:18 | コード修飾のリンクを修正 | +| [commit cpprefjp/site, 17da529] | cpprefjp/typo:1 | typo修正 | +| [commit cpprefjp/site, b78f6ab] | cpprefjp/fixs:24 | 文章中やコメントの全角スペースを半角スペースに置換 | +| [commit cpprefjp/site, d5e5ead] | cpprefjp/fixm:3 | コード中の全角スペースを修正 | +| [commit cpprefjp/site, 66b0019] | cpprefjp/fixm:30 | 対応しない丸カッコを修正 | +| [commit cpprefjp/site, b3855d8] | cpprefjp/fixm:1 | 欠けたコードを修正 | +| [commit cpprefjp/site, 98dc272] | cpprefjp/fixm:1 | `` タグが正しく表示されるように修正 | +| [commit cpprefjp/site, 1e90385] | cpprefjp/fixm:1 | 空白が消えないようにバッククォートを `` に変更 | +| [commit cpprefjp/site, e79ed6a] | cpprefjp/fixs:85 | インラインコードの先頭・末尾の空白を修正 | +| [commit cpprefjp/site, b981b77] | cpprefjp/fixm:1 | cpp20/coroutines: コード中の斜体の変数を `` で修飾 | +| [commit cpprefjp/site, cd924cf] | cpprefjp/fixs:9 | 3点リーダの前にスペースを挿入 | +| [commit cpprefjp/site, 2e2e084] | cpprefjp/fixm:2 | コード例の include の不足を修正 | +| [commit cpprefjp/site, a9216ac] | cpprefjp/fixm:1 | 対応しない波カッコを修正 | +| [commit cpprefjp/site, 0f3c342] | cpprefjp/fixm:2 | 対応しない角カッコを修正 | +| [commit cpprefjp/site, 59a1086] | cpprefjp/fixm:1 | `typename` のつけ忘れを修正 | +| [commit cpprefjp/site, 649d139] | cpprefjp/link:1 | リンクを修正 | +| [commit cpprefjp/site, 246b785] | cpprefjp/fixm:1 | `_num` の抜けを修正 | +| [commit cpprefjp/site, e970be3] | cpprefjp/fixm:4 | `filter_view::iterator` のコードと説明を修正 | +| [commit cpprefjp/site, 7ad59de] | cpprefjp/fixm:6 | コード例を修正 | +| [commit cpprefjp/site, 00f29aa] | cpprefjp/link:1, cpprefjp/fixm:1 | コード修飾を修正 | +| [commit cpprefjp/site, d5a10b5] | cpprefjp/fixm:1 | コード例を修正 | +| [commit cpprefjp/site, 9b8ca47] | cpprefjp/fixm:1 | `unordered_map::emplace_hint()` のコードを修正 | +| [commit cpprefjp/site, 7d0aa67] | cpprefjp/fixm:6 | いくつかのコード例を修正 | +| [commit cpprefjp/site, ee5ed85] | cpprefjp/fixm:1 | `to_input_view` のコンストラクタのコードを修正 | +| [commit cpprefjp/site, 71fc974] | cpprefjp/fixm:1 | 余分な `_view` を削除 | +| [commit cpprefjp/site, 9a9e760] | cpprefjp/fixm:1 | `to_input_view::base()` のコードを修正 | +| [commit cpprefjp/site, e19a059] | cpprefjp/fixm:1 | `split_view::base()` のコードを修正 | +| [commit cpprefjp/site, 2f524bf] | cpprefjp/fixm:2 | `common_view` のコードを修正 | +| [commit cpprefjp/site, b342e52] | cpprefjp/fixm:7 | `zoned_time` のコード例を修正 | +| [commit cpprefjp/site, 0157304] | cpprefjp/fixm:7 | `chrono::from_stream()` のコード例の引数の順序を修正 | +| [commit cpprefjp/site, 2b5b392] | cpprefjp/fixm:16 | コード例の include の不足を修正 | +| [commit cpprefjp/site, 699900b] | cpprefjp/fixm:3 | 出力例、処理系の記載を追加 | +| [commit cpprefjp/site, 55d0828] | cpprefjp/fixm:7 | コード例のフォーマット文字列を修正 | +| [commit cpprefjp/site, 50237d0] | cpprefjp/fixm:13 | chrono のいくつかのコード例のコンパイルエラーを修正 | +| [commit cpprefjp/site, ea3453a] | cpprefjp/fixm:5 | `leap_second` の比較演算子のコード例を修正 | +| [commit cpprefjp/site, 292600c] | cpprefjp/fixm:1 | `utc_clock::to_sys()` のコード例を修正 | +| [commit cpprefjp/site, 994a105] | cpprefjp/fixm:1 | `range_formatter` のコード例を追加 | +| [commit cpprefjp/site, 5c792ff] | cpprefjp/fixm:1 | `range_formatter` のコード例の修正と動作確認 | +| [commit cpprefjp/site, da5a5dc] | cpprefjp/fixm:19 | いくつかのコード例のコンパイルエラーを修正 | +| [commit cpprefjp/site, 9e1ab85] | cpprefjp/typo:1 | Typo修正 | +| [commit cpprefjp/site, 7e196a7] | cpprefjp/fixm:4 | 名前空間を修正 | +| [commit cpprefjp/site, a6d4fdb] | cpprefjp/fixm:12 | いくつかのコード例のコンパイルエラーを修正 | +| [commit cpprefjp/site, 40fb865] | cpprefjp/fixl:1 | `basic_ios::operator void*()` に cpp11removed を追加 | +| [commit cpprefjp/site, a14373f] | cpprefjp/fixl:8 | cpp11removed の説明を追加 | +| [commit cpprefjp/markdown_to_html, 962b439] | tool/improvem:1 | C++バージョンのバッジに「C++11で削除」を追加 | +| [commit cpprefjp/markdown_to_html, 5603611] | tool/fixbug:1 | C++バージョンのバッジのtypoを修正 | +| [commit cpprefjp/site, 71fab6a] | cpprefjp/fixm:1 | 可変長データを扱うクラスの効率的なdelete : コード例を修正 | +| [commit cpprefjp/site, 4e673b3] | cpprefjp/link:1 | `execution::spawn_future` : Typo、リンクを修正 | +| [commit cpprefjp/site, 8960e70] | cpprefjp/fixm:1 | 出力に合わせてコード例に `std::boolalpha` を追加 | +| [commit cpprefjp/site, c9ea776] | cpprefjp/fixm:5 | いくつかのコード例の出力を修正 | +| [commit cpprefjp/site, 0d693ca] | cpprefjp/fixm:2 | コード例から不要な改行の出力を削除 | +| [commit cpprefjp/site, 7727976] | cpprefjp/fixm:75 | `unordered_(multi)(set | map)` : 処理系依存な「出力」を「出力例」に変更 | +| [commit cpprefjp/site, 4164601] | cpprefjp/fixm:2 | コード例を修正 | +| [commit cpprefjp/site, e6ade2f] | cpprefjp/fixm:1 | 出力に合うようにコード例を修正 | +| [commit cpprefjp/site, a312388] | cpprefjp/fixm:8 | コード例や出力の不要な空行を削除 | +| [commit cpprefjp/site, 1cf611e] | cpprefjp/fixm:1 | `chrono::year_month_day` : コード例を修正、動作確認 | +| [commit cpprefjp/site, bcf9dc7] | cpprefjp/fixm:1 | `chrono::duration_values::min` : 出力例を修正、動作確認 | +| [commit cpprefjp/site, 4b23125] | cpprefjp/fixm:5 | chrono のいくつかの出力例を修正、動作確認 | +| [commit cpprefjp/site, e38c847] | cpprefjp/fixm:2 | chrono のいくつかの出力例を修正 | +| [commit cpprefjp/site, 0161d80] | cpprefjp/fixm:20 | chrono のいくつかの出力を修正、動作確認 | +| [commit cpprefjp/site, a7f9e6c] | cpprefjp/fixm:5 | `chrono::parse`, `(sys | tai | utc | file)_time` : コード例と出力の修正、動作確認 | +| [commit cpprefjp/site, 5ab35d5] | cpprefjp/fixm:1 | `chrono::from_stream` : 効果の説明とコード例の修正 | +| [commit cpprefjp/site, ca5f1bd] | cpprefjp/fixm:2 | `chrono::year` : コード例を修正と動作確認 | +| [commit cpprefjp/site, d707563] | cpprefjp/fixm:11 | いくつかのコード例の出力を修正 | +| [commit cpprefjp/site, c012fa3] | cpprefjp/fixm:3 | いくつかのコード例を修正 | +| [commit cpprefjp/site, 00f1187] | cpprefjp/fixm:1 | `stringbuf` : オーバーロードの番号を修正 | +| [commit cpprefjp/site, 45eb8c1] | cpprefjp/fixm:6 | `stringbuf`, `spanbuf` : コード例や出力を修正 | +| [commit cpprefjp/site, 8d6bfc9] | cpprefjp/fixm:1 | `error_category` : 出力を修正 | +| [commit cpprefjp/site, 3c0b15e] | cpprefjp/fixm:1 | 表の表示崩れを修正 | +| [commit cpprefjp/site, 04cdd84] | cpprefjp/fixm:3 | コード例の出力を修正 | +| [commit cpprefjp/site, f55a642] | cpprefjp/fixm:1 | コード例を修正 | + + +## [akinomyoga](https://github.com/akinomyoga) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/crsearch, d5d194f] | tool/updatelib:1 | bump 3.0.24 | +| [commit cpprefjp/site, 600e913] | cpprefjp/fixm:2 | GLOBAL_DEFINED_WORDS: より一般的な語として「戻り値」「例外」も追加 | +| [commit cpprefjp/site, be5f53f] | cpprefjp/fixm:10 | GLOBAL_DEFINED_WORDS: 関数などの意味論要素を適格要件の他にも追加 | +| [commit cpprefjp/site, 50ed131] | cpprefjp/fixm:1 | cpp23/relaxing_some_constexpr_restrictions: 訳語表に基き "返り値" → "戻り値" に統一 | +| [commit cpprefjp/site, 91551a0, eaa3875, 501d680] | cpprefjp/fixm:1 | function_template_page: 日本語修正 | +| [commit cpprefjp/site, 116fbe8] | cpprefjp/fixm:3 | thread/this_thread: 「と同期しない」を定義語に一致するように書換 | +| [commit cpprefjp/site, d960d16] | cpprefjp/fixm:10 | GLOBAL_DEFINED_WORDS: よりも前に発生する (happens before) / と同期する (synchronizes with) を追加 | +| [commit cpprefjp/site, 8e59cd6] | cpprefjp/fixm:13 | GLOBAL_DEFINED_WORDS: 「同期操作」を追加・見出し「同期」を「同期操作」に変更 | +| [commit cpprefjp/site, 176b16e] | cpprefjp/fixm:5 | working_style: 同期・評価順序に関連する訳語を追加 | +| [commit cpprefjp/site, b609e21] | cpprefjp/fixm:9 | GLOBAL_DEFINED_WORDS: 表現を変更 "{と => に対して}同期する" | +| [commit cpprefjp/site, 1956c49] | cpprefjp/fixm:21 | markdown_to_html.html_attribute 変更に伴う修正 | +| [commit cpprefjp/site_generator, 8a9ca72] | tool/improves:1, tool/improvem:1 | markdown_to_html 更新 (html_attribute 修正) | +| [commit cpprefjp/site, ebf8c8f] | cpprefjp/link:7 | 誤ったコードブロック後のコード修飾を修正 | +| [commit cpprefjp/markdown_to_html, 941d376] | tool/improvem:1 | コード修飾の箇条書きは * であることを要請 | +| [commit cpprefjp/markdown_to_html, 4332fb9] | tool/improvel:1 | コードブロック後の修飾の抽出を厳密化 | +| [commit cpprefjp/site, 587d612] | cpprefjp/fixm:6 | 誤ったコードブロック後のコード修飾を修正 (v2) | +| [commit cpprefjp/site, 911478d, 2d8efa3] | cpprefjp/fixm:1 | GLOBAL_DEFINED_WORDS: ヌル終端を追加 | +| [commit cpprefjp/site, 5b1731b] | tool/improvel:8 | chore(workflows/check): 各種 CI check の統合 | +| [commit cpprefjp/site, dca7653] | tool/improvel:2 | chore(workflows/preview_build): PR の更新毎に gh-pages /gen/pull/`<番号>`/ にプレビューをアップロード | +| [commit cpprefjp/site, cb5159b] | tool/improvel:1 | chore(workflows/preview_link): PR にプレビューリンクをコメントする | +| [commit cpprefjp/site, 6fcc5a2] | tool/improvem:2 | chore(workflows/{build,outer_link_check}): Fork リポジトリでは定期実行しない | +| [commit cpprefjp/site, da059d7] | tool/improvem:1 | chore(workflows/build): 区別できるように各 checkout step に名前をつける | +| [commit cpprefjp/site, 82dd7b3] | tool/improvem:1 | chore(workflows/build): image の actions/checkout のバージョンを更新 | +| [commit cpprefjp/site, 534d2e5] | tool/improvem:1, tool/improvel:1 | chore(workflows/preview_clear): 古いプレビューを削除するワークフローを追加 | +| [commit cpprefjp/site, 81806fc] | tool/improvel:2 | README,start_editing: 更新 | +| [commit cpprefjp/site_generator, 7c8abda] | tool/improvem:1 | cpprefjp/robots.txt: Disallow /site/gen/ | +| [commit cpprefjp/site, 181e033] | ignore | chore(workflows/preview_link): URLミス修正の修正忘れ | +| [commit cpprefjp/site, 401c70d] | tool/improvem:1 | chore(workflows/preview_build): GitHub Pages デプロイを有効化 | +| [commit cpprefjp/site, 7aba20a] | ignore | chore(workflows/preview_link): URLミス修正 | +| [commit cpprefjp/site, baeb128] | ignore | chore(workflows/preview_link): ケアレスミス修正 | +| [commit cpprefjp/site, 437ae62] | ignore | chore(workflows/preview_link): 差分を取るために両リポジトリを fetch | +| [commit cpprefjp/site, a64d2ec] | tool/improvem:1 | chore(preview_build): "Author: github-actions[bot]" で gh-pages にコミット | +| [commit cpprefjp/site, f8a10e3] | tool/improvem:1 | chore(preview_clear): 全てのプレビューがなくなる時 gh-pages ブランチを削除 | +| [commit cpprefjp/crsearch, 77d6455] | tool/fixbug:1 | kunai-config: handle Marked v1.0.0 tokens | +| [commit cpprefjp/site, dc4de9c] | ignore | chore(preview_clear): filter-branch 終了ステータスの対処 | +| [commit cpprefjp/site, 70e3b76] | ignore | chore(preview_clear): gh-pages にダミーのコミットを残す | +| [commit cpprefjp/site, 04d3ab4] | cpprefjp/link:1 | コード修飾の修正 (fixup edf7962b6) | +| [commit cpprefjp/site, 5800b64] | cpprefjp/fixm:1 | cmath (`std::sph_legendre`): 球面調和関数と使い方について記述 | +| [commit cpprefjp/site, 7d498ef] | cpprefjp/fixm:1 | cmath (`std::sph_legendre`): C++20 円周率 `std::numbers::pi` を使用するように例を更新 | +| [commit cpprefjp/site, f4e42f3] | cpprefjp/fixm:1 | cmath (`std::assoc_legendre`): 負の `m` について計算する方法の記述 | +| [commit cpprefjp/site, 8f99cf0] | cpprefjp/fixm:1 | cmath (`std::legendre`): ルジャンドル多項式の範囲外エラーについて記述 | +| [commit cpprefjp/site, 9917280] | cpprefjp/fixm:1 | cmath (`std::tgamma`): ガンマ関数の定義式を追記 | +| [commit cpprefjp/site, 52a3f10] | cpprefjp/fixm:1, cpprefjp/link:1 | cmath (`std::{tgamma,lgamma}`): 相互リンク | +| [commit cpprefjp/site, 7f763a4] | cpprefjp/fixm:1 | cmath (`tgamma`): 階乗とガンマ関数の関係を式で明記 | +| [commit cpprefjp/site, 932634a] | cpprefjp/fixm:2 | cmath (`tgamma`): `lgamma` を使うべき場合について記述 | +| [commit cpprefjp/site, 785abde] | cpprefjp/fixm:1 | implementation: 製品バージョンの表記に対する註を追加 | +| [commit cpprefjp/site, dbd9016] | cpprefjp/link:10 | cmath: 類似の丸め関数との相互リンク | +| [commit cpprefjp/site, 2462479] | cpprefjp/fixm:1 | cmath: `std::comp_ellint_1`: 振り子周期のθの説明抜けを修正 | +| [commit cpprefjp/site, 0c815fe] | ignore | chore(workflows/preview_link): CIログを汚さないように表示件数を早めに制限 (上限は100に戻す) | +| [commit cpprefjp/site, 0500222] | ignore | chore(workflows/preview_link): 表示件数上限を100から50に削減、他体裁調整 | +| [commit cpprefjp/site, d32a312] | ignore | chore(workflows/preview_link): github.event.pull_request.base が空の時の対策 | +| [commit cpprefjp/site, 8f1f224] | ignore | chore(workflows/preview_link): 変更一覧の件数を制限し、変更一覧ページを別に生成 | +| [commit cpprefjp/site, b3bdbe3] | cpprefjp/fixm:3 | style: "返り値" → "戻り値" | +| [commit cpprefjp/site, a106306] | cpprefjp/link:1 | fix(reference/cstdlib/`atoi`): C99 がリンクされていたが 4.10.1.2 は C90 の節番号 | +| [commit cpprefjp/site, 5e17cc5] | cpprefjp/link:2 | fix(reference/cstdlib/{`calloc`,`atoi`}): リンク削除 | +| [commit cpprefjp/site, 403a76f] | cpprefjp/link:3 | fix(reference/cstdlib/{`calloc`,`atoi`,`malloc`}): 参照文献名の明示 | +| [commit cpprefjp/site, fdf8064] | cpprefjp/fixm:1 | fix(reference/cstdlib/`system`): 訳の修正 | +| [commit cpprefjp/site, 68aec4c] | cpprefjp/link:1 | fix(reference/cstdlib/`calloc`): リンク修正 | +| [commit cpprefjp/site, 5ccd04f] | cpprefjp/fixm:1 | fix(reference/cstdlib/`malloc`): タイポ修正 | +| [commit cpprefjp/site, f66abcb] | cpprefjp/link:1 | fix(reference/atomic/atomic_ref/address): 壊れたコード修飾の修正 | +| [commit cpprefjp/site, ff932ef] | cpprefjp/link:2 | fix(reference/cstdio): 壊れたリンクの修正 | +| [commit cpprefjp/site, 612c75f] | cpprefjp/fixs:4 | style(reference/{cstdio,cstdlib}): コーディングスタイルの統一 | +| [commit cpprefjp/site, 993c9f8] | cpprefjp/fixm:1 | style(*): ファイル末尾に改行を追加 (機械的作業ということで作業者からの希望で低めのポイントにしてある) | +| [commit cpprefjp/site, 74fec0c] | cpprefjp/fixm:1 | fix(reference/cstdio/fputs): 記事名の修正 | +| [commit cpprefjp/site, 562668e] | cpprefjp/fixm:1 | fix(reference/cstdlib): コード例のヘッダを修正 | +| [commit cpprefjp/site, b7e97a5] | cpprefjp/fixm:18 | fix(reference/{cstdio,cstdlib}): C互換ヘッダの関数・型は `std::` をつけなきゃダメ! | +| [commit cpprefjp/site, 61a0b4d] | cpprefjp/fixm:33 | fix(reference/{cstdlib,streambuf}): C++では main(void) ではなく main() で良い | +| [commit cpprefjp/site, 429ed48] | ignore | chore(workflows/preview_link): ケアレスミス修正 | +| [commit cpprefjp/site, be1a7c3] | ignore | chore(workflows/preview_link): パイプエラー対策 | +| [commit cpprefjp/site, 62d8393] | cpprefjp/fixm:1 | fix(reference/cstdio/printf): 出力の修正 | +| [commit cpprefjp/site, ef9d91e] | cpprefjp/fixm:1 | style(*): 余分の末尾改行を削除 (機械的作業ということで作業者からの希望で低めのポイントにしてある) | +| [commit cpprefjp/site, 561be1b] | cpprefjp/fixm:1 | feat(reference/cstdio/fputs): 出力例を追加 | +| [commit cpprefjp/site, 73c9263] | cpprefjp/fixm:13 | fix(cmath): 条件付きで定義されるマクロについて #undef の場合も追記 | +| [commit cpprefjp/site, da83049] | cpprefjp/fixm:32 | fix(c*): 処理系定義でないのに implementation-defined になっているものを修正 | +| [commit cpprefjp/site, 99f1ebf] | cpprefjp/fixm:1 | fix(cpp11/variadic_macros): 言語指定 cpp を追加・コード修飾を追加 | +| [commit cpprefjp/site, 3d433bb] | cpprefjp/fixm:5 | style(cstdlib,cstdio,format): メタ識別子は `/**/` で囲まない | +| [commit cpprefjp/site, f1add1c] | cpprefjp/fixm:1 | fix: [commit cpprefjp/site, 1d0cf2b] によるプリプロセッサディレクティブ誤爆の修正 (機械的作業ということで作業者からの希望で低めのポイントにしてある) | +| [commit cpprefjp/site, 7e1ca38] | cpprefjp/fixm:2 | style(utility,format): "see{[-_] => }below" の書き換え | +| [commit cpprefjp/site, a754d24] | cpprefjp/fixm:26 | style: "`/*see below*/` => `see below`" の書き換え | +| [commit cpprefjp/site, cbe4f35] | cpprefjp/fixm:9 | fix(filesystem): 関数仕様の単純化 | +| [commit cpprefjp/site, f92dedd] | cpprefjp/fixm:3 | style(algorithm,cmath): "## {使用 => }例" | +| [commit cpprefjp/site, 2761b7c] | cpprefjp/fixm:3 | fix(cmath,cfenv): コード修飾を追加・修正 | +| [commit cpprefjp/site, 7b47559] | cpprefjp/fixm:1 | chore: 個別コードブロックのコード修飾 "`* see below[italic]`" を削除 (機械的作業ということで作業者からの希望で低めのポイントにしてある) | +| [commit cpprefjp/site, 503290d] | cpprefjp/fixm:1 | chore: "see below" を GLOBAL_QUALIFY_LIST.txt に登録 | +| [commit cpprefjp/site, fbcad90] | cpprefjp/fixm:1 | fix(functional): 余分の /*see below*/ の削除 | +| [commit cpprefjp/site_generator, d2e350b] | tool/improvem:1 | 出力先ディレクトリが既に存在しても無視する | +| [commit cpprefjp/markdown_to_html, 66b84e4] | tool/fixbug:1 | html_attribute: markdown.searialiers の内部変数を一時的に変更して実体参照を適切に処理 | +| [commit cpprefjp/site, 4ac8177] | cpprefjp/fixm:1 | Update reference/cstdio/fwrite.md (Co-author) | +| [commit cpprefjp/site, 6104a9a] | cpprefjp/fixm:1 | Update reference/cstdio/bufsiz.md (Co-author) | +| [commit cpprefjp/site, c1261d3] | cpprefjp/fixm:1 | Update reference/cstdio/fpos_t.md (Co-author) | +| [commit cpprefjp/site, 3aec3d6] | cpprefjp/fixm:1 | Update reference/cstdio/fpos_t.md (Co-author) | +| [commit cpprefjp/site, 5050bbe] | cpprefjp/fixm:1 | Update reference/cstdio/fpos_t.md (Co-author) | +| [commit cpprefjp/site, d074e9f] | cpprefjp/fixm:1 | Update reference/cstdio/fread.md (Co-author) | +| [commit cpprefjp/site, 457602e] | cpprefjp/fixm:1 | Apply suggestions from code review (Co-author) | +| [commit cpprefjp/site, b13d269] | cpprefjp/fixm:1 | Apply suggestions from code review (Co-author) | +| [commit cpprefjp/site, bb0ffaf] | cpprefjp/fixm:1 | Apply suggestions from code review (Co-author) | +| [commit cpprefjp/site, f572dab] | cpprefjp/fixm:1 | Update reference/unordered_map/unordered_map/clear.md (Co-author) | + + +## [K10-K10](https://github.com/K10-K10) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, 78017b2] | cpprefjp/fixm:1 | reference_iostream_cin:出力例追加 | +| [commit cpprefjp/site, ca8e5ab, a56ee8c, e2a8fdd, c4eb917] | cpprefjp/addref:1, cpprefjp/link:2 | create page P2558R2 | +| [commit cpprefjp/site, c2781ec, 09de4c4, 54ee769, 2f9e3f4, fd567d5] | cpprefjp/addref:1, cpprefjp/link:1 | new page `cstdlib/system.md` | +| [commit cpprefjp/site, 52760d2, 84f93b2, 5d24dd2] | cpprefjp/addref:1, cpprefjp/link:1 | new page cstdlib/getenv | +| [commit cpprefjp/site, 7cd29af, f970e6f, 69f3c46, a086c7f, 19b6ba2, f7d4f26, e10856a, f93c17f] | cpprefjp/addref:1, cpprefjp/link:1 | new page `cstdlib/atoi_atol_atoll` | +| [commit cpprefjp/site, 60a1a63] | cpprefjp/link:1 | string/stoi.md: add path to atoi | +| [commit cpprefjp/site, e7e4334] | cpprefjp/link:1 | string/stol:add path to atol | +| [commit cpprefjp/site, fb60138] | cpprefjp/link:1 | string/stouol:add path to atol | +| [commit cpprefjp/site, 2742bc7] | cpprefjp/link:1 | string/stoll:add path to atoll | +| [commit cpprefjp/site, 3f1903d] | cpprefjp/link:1 | charconv:add path to atol | +| [commit cpprefjp/site, 1db6393, b6b5fd6, 8c6d8f1] | cpprefjp/addref:1, cpprefjp/link:1 | add new page `cstdlib/atof` | +| [commit cpprefjp/site, 9529b81, d3e0d43] | cpprefjp/addref:1, cpprefjp/link:1 | new page `cstdlib/srand` | +| [commit cpprefjp/site, 5c0e2cc, 31d07e7, 129dc5c] | cpprefjp/addref:1, cpprefjp/link:2 | new page `cstdlib/rand` and add path in `cstdlib.md` | +| [commit cpprefjp/site, 29f79cc] | cpprefjp/link:1 | delete `.nolink` in path to `cstdlib/rand` | +| [commit cpprefjp/site, 76d4ce8, ce18c98, e1b31f5] | cpprefjp/addref:1, cpprefjp/link:3 | new page `cstdlib/RAND_MAX` | +| [commit cpprefjp/site, 9e68ff5, a6b6cf7, 515cb5a, ff7570c, 1f5f23e, 5b0f8cb, b89a923, 443e16e, f115096, 28dcdfa] | cpprefjp/addref:1, cpprefjp/link:2 | new page `cstdlib/calloc` | +| [commit cpprefjp/site, 18a9e14] | ignore | add .nolink | +| [commit cpprefjp/site, a182dac] | cpprefjp/link:1 | add path to `cstdlib/aligined_alloc.md` | +| [commit cpprefjp/site, 2b759fa, fd6f46f] | cpprefjp/addref:1, cpprefjp/link:2 | new page `malloc` and add path in | +| [commit cpprefjp/site, 8233b0a, 272f47f, c57731f, 6eddf2f, f189c22, 6ba8c53, 1b8a7cd] | cpprefjp/addref:1, cpprefjp/link:2 | new page `cstdlib/free` | +| [commit cpprefjp/site, f522458, cbd69c8, 50d4d18, 56437ce] | cpprefjp/addref:1, cpprefjp/link:2 | new page `cstdlib/realloc` | +| [commit cpprefjp/site, cf65ace, ed566fe, 62352b3, 0b04c50, fbe0ff2] | cpprefjp/addref:1, cpprefjp/link:1 | new page `mb_cur_max` | +| [commit cpprefjp/site, 090865f, ea1f776, 2bc7cf6, a32b5ce, 3e711d8, a3c4ce4, 5b1c95f] | cpprefjp/addref:1, cpprefjp/link:2 | new page `strtol.md` | + + +## [suomesta](https://github.com/suomesta) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, 17433f4] | cpprefjp/fixm:3 | add meta cpp tag | +| [commit cpprefjp/site, abe921f] | cpprefjp/addref:1, cpprefjp/link:1 | add cstring top page | +| [commit cpprefjp/site, edf7962] | cpprefjp/addref:2, cpprefjp/fixm:1, cpprefjp/link:1 | add `extract()` and `replace()` to `flat_map` (#1078) | +| [commit cpprefjp/site, 9f13e4f] | cpprefjp/addref:1, cpprefjp/link:1 | `flat_map` : add `uses_allocator` (#1078) | +| [commit cpprefjp/site, ca2c47c] | cpprefjp/addref:1, cpprefjp/link:2 | `flat_map` : add constructor (#1078) | +| [commit cpprefjp/site, c00bf89] | cpprefjp/addref:1, cpprefjp/link:1 | `flat_map` : add `op_assign` and improve `op_constructor` (#1078) | +| [commit cpprefjp/site, 1854555] | cpprefjp/addref:3, cpprefjp/link:1 | `flat_map` : add `value_compare`, `key_comp()` and `value_comp()` (#1078) | +| [commit cpprefjp/site, 4fd9557] | cpprefjp/addref:2, cpprefjp/link:1 | `flat_map` : add `keys()` and `values()` (#1078) | +| [commit cpprefjp/site, 9730e9e] | ignore:2, cpprefjp/fixm:2 | small improvements in `flat_map` | +| [commit cpprefjp/site, 9ee90cb] | cpprefjp/addref:41, cpprefjp/fixm:7, cpprefjp/fixl:1, cpprefjp/link:1 | `flat_map` : add `flat_multimap` (#1078) | +| [commit cpprefjp/site, c135b44, 8f81c31, 871cb81] | cpprefjp/link:5, cpprefjp/addref:76 | create `flat_set` folder and files (#1079) | +| [commit cpprefjp/site, 0b23a69] | cpprefjp/fixm:1 | fix namespace `std::get` for `std::tuple` | +| [commit cpprefjp/site, a7d155c] | cpprefjp/fixm:1 | fix return value type in sample | +| [commit cpprefjp/site, 85e901d] | cpprefjp/link:1 | add `` to GLOBAL_QUALIFY_LIST | +| [commit cpprefjp/site, 6972631] | cpprefjp/fixm:4 | some small improvements in `flat_map` and `flat_set` | +| [commit cpprefjp/site, 51bc70d] | cpprefjp/fixm:2 | small improvements in `map` | +| [commit cpprefjp/site, 2a1427f] | ignore | fix wrong URL | +| [commit cpprefjp/site, f28cc8b] | cpprefjp/addref:2, cpprefjp/link:2 | add swap_free.md to `flat_map` (#1078) | +| [commit cpprefjp/site, 304f099] | cpprefjp/addref:2, cpprefjp/link:2 | add swap_free.md to `flat_set` (#1079) | +| [commit cpprefjp/site, c55d9f2] | cpprefjp/addref:2, cpprefjp/link:2 | add op_deduction_guide to `flat_map`. (#1078) | +| [commit cpprefjp/site, f7e7a97] | cpprefjp/addref:2, cpprefjp/link:2 | add op_deduction_guide to `flat_set`. (#1079) | +| [commit cpprefjp/site, e449113] | cpprefjp/link:1, cpprefjp/fixl:16 | add deduction guide with range to some containers. | +| [commit cpprefjp/site, 8168531] | ignore | fix sample in `flat_multiset` | +| [commit cpprefjp/site, 9b21060] | cpprefjp/fixl:1 | update `istream_iterator` constructor | +| [commit cpprefjp/site, aa69763, cd9dbc2] | cpprefjp/fixl:1 | update `istreambuf_iterator` constructor | +| [commit cpprefjp/site, 01eff31] | cpprefjp/addref:1, cpprefjp/fixl:1, cpprefjp/link:3 | add `is_implicit_lifetime` to `type_traits` | +| [commit cpprefjp/site, 05294b6] | cpprefjp/addref:2, cpprefjp/fixl:1, cpprefjp/link:3 | add `std::start_lifetime_as()` and `std::start_lifetime_as_array()`. (#1409) | +| [commit cpprefjp/site, 5907be1] | cpprefjp/fixm:1 | fix wrong numbers in `unordered_map::insert()` | +| [commit cpprefjp/site, d9fff1a] | cpprefjp/fixm:1 | fix typo in `basic_istream` | +| [commit cpprefjp/site, 1a53cfe] | cpprefjp/fixm:1 | add sample to `std::ws` | +| [commit cpprefjp/site, 8bd1a9a] | cpprefjp/fixm:1 | improve `chrono::format` | +| [commit cpprefjp/site, 10d6131] | cpprefjp/link:1 | improve `std::execution::read_env()` | +| [commit cpprefjp/site, a9d264c] | cpprefjp/fixm:1 | improve `std::move_only_function` | +| [commit cpprefjp/site, 6cc5b6b] | cpprefjp/typo:18 | fix some typo | +| [commit cpprefjp/site, 73ba330] | cpprefjp/fixm:10 | fix some versions | +| [commit cpprefjp/site, 4e12116] | cpprefjp/fixm:2, cpprefjp/link:11 | fix some links in code | +| [commit cpprefjp/site, 01869e0] | cpprefjp/fixm:5 | fix some versions | +| [commit cpprefjp/site, 88ba553] | cpprefjp/fixm:1 | improve `std::vector::shrink_to_fit()` | +| [commit cpprefjp/site, be3b143] | cpprefjp/compiler:3 | improve `` | +| [commit cpprefjp/site, 5dd8cd8] | cpprefjp/fixm:1 | improve `std::max_align_t` | +| [commit cpprefjp/site, 50d77b3] | cpprefjp/compiler:2, cpprefjp/link:1 | remove duplicate line | +| [commit cpprefjp/site, c0b01b0] | cpprefjp/fixm:1 | add meta version to flat_XXX `operator==` | +| [commit cpprefjp/site, 9b4133c] | cpprefjp/fixm:6 | fix some English description | +| [commit cpprefjp/site, 36ca2f5] | cpprefjp/fixm:2, cpprefjp/link:1 | fix some typo regarding to ranges | +| [commit cpprefjp/site, 3f31163] | cpprefjp/fixm:1 | improve `std::derived_from` | +| [commit cpprefjp/site, ef4e148] | cpprefjp/fixm:3 | add `throw()` to `bad_typeid` functions in C++03 | +| [commit cpprefjp/site, 54a31ae] | cpprefjp/fixm:5 | remove `std::` from macro | +| [commit cpprefjp/site, 11888d8] | cpprefjp/fixm:1 | fix typo in `std::stod()` | +| [commit cpprefjp/site, 3747177] | cpprefjp/link:3 | fix link to `first`/`second` of `std::pair` | +| [commit cpprefjp/site, 077be88, 9402b83, 3c1eba5] | cpprefjp/link:4, cpprefjp/addref:28 | add `` library (#1051) | +| [commit cpprefjp/site, d589652] | cpprefjp/fixm:1 | fix typo about `std::index_sequence` | +| [commit cpprefjp/site, 63f0d13] | cpprefjp/fixm:1 | fix typo | +| [commit cpprefjp/site, b403dd0] | cpprefjp/addref:2, cpprefjp/fixl:2, cpprefjp/link:1 | add `basic_string::subview()` and `basic_string_view::subview()`. (#1503) | +| [commit cpprefjp/site, ba21342] | cpprefjp/addref:2, cpprefjp/fixl:1 | Add `std::optional` Range Support (#1431) | +| [commit cpprefjp/site, ea29681] | cpprefjp/fixm:1 | fix typo of arguments name in `std::optional::<=>` | +| [commit cpprefjp/site, 7d65995] | cpprefjp/addlang:1, cpprefjp/fixl:1 | add feature test macros of C++26 | + + +## [math-hiyoko](https://github.com/math-hiyoko) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, 8e13685, 056967c, 26ded1a, 588262d, 6f51ec9, f572dab, b25ee37, 3bb29a2, bb0ffaf, e6690f0, 2a7fe57, af3a11d, 4c79551, bb394c1, 202823f, b13d269, 7f7b3ab, 349f117, 47cef6b, 457602e, b7bc91c, 0107d7b, 5079252] | cpprefjp/fixm:4 | enh: ハッシュテーブルのclearメソッドの備考追加 #1450 | + + +## [onihusube](https://github.com/onihusube) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, d609dd1] | cpprefjp/fixm:5 | 拡張浮動小数点数型の変換順位について修正と追記 | +| [commit cpprefjp/site, a4a704d] | cpprefjp/fixm:1 | ``: ハミルトニアン -> エルミート | +| [commit cpprefjp/site, 2f8d201, 81d50fd, 3025ea8, e25e0cd] | cpprefjp/link:2, cpprefjp/addlang:1 | P0848R3 #1106 | +| [commit cpprefjp/site, c4d5bec] | cpprefjp/fixm:1 | `unreachable_sentinel`: 説明を修正 | +| [commit cpprefjp/site, f3b78ac] | cpprefjp/fixm:4 | flat_xxx: `erase`の計算量修正 | +| [commit cpprefjp/site, 39b99d1] | cpprefjp/fixm:4 | flatなコンテナの`insert()`の計算量修正 | +| [commit cpprefjp/site, 42b481a] | cpprefjp/fixm:8 | flatなコンテナの`emplace`/`_hint`の計算量追記 | +| [commit cpprefjp/site, b7d05c0] | cpprefjp/fixm:1 | `deque::erase()`: イテレータと参照の無効化について微修正 | +| [commit cpprefjp/site, 0abb645] | cpprefjp/fixm:1 | `resize_and_overwrite` : 事前条件に微妙に追記 | +| [commit cpprefjp/site, 4aac573] | cpprefjp/typo:1 | Fix typo in iterator traits documentation | + + +## [h-sao](https://github.com/h-sao) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, 2ad32d5] | cpprefjp/compiler:2 | Update implementation-status for ICX | +| [commit cpprefjp/site, dbfde23] | cpprefjp/compiler:1 | Update implementation-status.md for ICC | +| [commit cpprefjp/site, 763ff88] | cpprefjp/compiler:2 | Update implementation-status for ICC | +| [commit cpprefjp/site, 883eeef] | cpprefjp/link:1 | Update implementation-status for MSVC ref link of C++23 | +| [commit cpprefjp/site, 1af6cd4] | cpprefjp/compiler:3 | Update implementation-status for MSVC ver17.12 and 17.13 | +| [commit cpprefjp/site, 3e6fab6] | cpprefjp/compiler:1 | Update implementation.md for checking of MSVC 17.13.2 | +| [commit cpprefjp/site, 679bbe5] | cpprefjp/compiler:1 | Update implementation-status.md for MSVC supporting C++23/ Added ref link | +| [commit cpprefjp/site, 77cc071] | cpprefjp/link:1 | Deleted unnecessary link for MSVC C++23 on implementation-status.md | +| [commit cpprefjp/site, ec441a2] | cpprefjp/compiler:3 | Update implementation-status.md for C++26 of GCC | +| [commit cpprefjp/site, eb770b5] | cpprefjp/compiler:2 | Update implementation-status.md for c++23 of Clang | + + + +## [y121516](https://github.com/y121516) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, cafe530] | cpprefjp/compiler:1 | implementation.mdにVisual Studio 2022 version 17.12.3の情報を追記 | +| [commit cpprefjp/site, 2f1a9df] | cpprefjp/compiler:1 | Visual Studio 2022 version 17.0.2の表記からUpdate 1を削除する | +| [commit cpprefjp/site, b84a227] | cpprefjp/typo:1 | タイポの修正 | +| [commit cpprefjp/site, 034c367] | cpprefjp/compiler:1 | Visual Studio 2022 Version 17.12.4 追加 | +| [commit cpprefjp/site, 8699511] | cpprefjp/compiler:1 | Visual Studio 2022 Version 17.13.0 追加 | +| [commit cpprefjp/site, 336d8aa, 0c3fe2f] | cpprefjp/fixm:1 | Visual Studio 2022についてversionをVersionに置き換える | +| [commit boostjp/site, dd6d909] | boostjp/link:1 | リンク先の修正 | + + +## [take-cheeze](https://github.com/take-cheeze) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/crsearch, 2805b96] | tool/security:1, tool/improvem:1 | npm audit fix | +| [commit cpprefjp/crsearch, 63740e0] | tool/addm:1 | Add minimum CI | +| [commit cpprefjp/crsearch, d68b712] | tool/updatelib:12, tool/improvel:4 | Update more | +| [commit cpprefjp/kunai, 1065351] | tool/improvem:1 | Update actions | +| [commit cpprefjp/kunai, f0544b9] | tool/updatelib:14, tool/improvel:1 | Update modules | +| [commit cpprefjp/kunai, a905031] | tool/updatelib:3, tool/improvel:2 | Embed instead | +| [commit cpprefjp/kunai, 0f3ba5e] | tool/updatelib:1, tool/improvel:1 | Local test fix | +| [commit cpprefjp/crsearch, 9ca8b1f] | tool/improvem:1 | Fix marked names | + + +## [Gumichocopengin8](https://github.com/Gumichocopengin8) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, 3fb56b8] | cpprefjp/fixm:1 | fix: remove unnecessary `std::move` in splice of `std::list` | +| [commit cpprefjp/site, 614432a] | cpprefjp/fixm:1 | fix: remove unnecessary `std::move` in splice of `std::forward_list` | +| [commit cpprefjp/site, 5cb7ad6] | tool/addm:1 | chore: add `.gitignore` file | +| [commit cpprefjp/site, eede276] | cpprefjp/fixm:4 | fix: use `replace with` instead of ` replace by` | +| [commit cpprefjp/site, 5c5c709] | cpprefjp/fixm:4 | fix: missing `#include ` in `std::barrier` | + + +## [wx257osn2](https://github.com/wx257osn2) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, 3bd8c4f] | cpprefjp/fixm:1 | add comment to clarify the state more | +| [commit cpprefjp/site, 2a7c46f] | cpprefjp/fixm:1 | add example to see difference between `wait_for(0s) == ready` and `valid()` | +| [commit cpprefjp/site, f1ae4bc] | cpprefjp/fixm:1 | add comment about SEGV on libc++ | +| [commit cpprefjp/site, eba553f] | cpprefjp/fixm:4 | add preconditions to member functions of `std::future` / remove UB from example | +| [commit cpprefjp/site, ba2b7c9] | cpprefjp/fixm:1 | fix statement position | + + +## [biobios](https://github.com/biobios) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, bb2acdf] | cpprefjp/fixm:1 | fix type | +| [commit cpprefjp/site, a983f3d] | cpprefjp/fixm:1 | 表記の統一 | +| [commit cpprefjp/site, 45569a7] | cpprefjp/link:1 | リンク: 定義の説明に用いられているコードにリンクを追加 | + + +## [ACUVE](https://github.com/ACUVE) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, 9576959] | cpprefjp/fixm:1 | P2865R6: コメントの解説の誤植を修正 | +| [commit cpprefjp/site, 1db2ef4] | cpprefjp/fixm:1 | P1120R0: コメントの解説の誤植を修正 | + + +## [hrjp](https://github.com/hrjp) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, b2562a3, a9711d6] | cpprefjp/typo:3 | fix: `basic_ifstream::close`の誤字修正 | +| [commit cpprefjp/site, f8a8a06] | cpprefjp/typo:2, cpprefjp/fixm:5 | いくつかの誤字を修正 | + + +## [yumetodo](https://github.com/yumetodo) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/kunai, 4569f72] | tool/improvem:1 | fix(ci): submodule初期化をactions/checkoutに行わせる | +| [commit cpprefjp/site, 63eebbd] | cpprefjp/link:1 | fix: 参考にした記事はもとのタイトルをそのまま記述するべき (#1475) | + + +## [0xbadfca11](https://github.com/0xbadfca11) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, 7e182d7] | cpprefjp/compiler:1 | P2564R3のMSVC対応を削除 | +| [commit cpprefjp/site, b394b14] | cpprefjp/fixm:1 | P2223R2の解説を修正 (#1405) | + + +## [TumoiYorozu](https://github.com/TumoiYorozu) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, d3227a7] | cpprefjp/link:1 | Add `assume` attributes to attributes.md | + + +## [kenichiice](https://github.com/kenichiice) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, 15541d7] | cpprefjp/link:1 | `type_info`へのリンクがあってほしいと思ったので追加 | + + +## [k_satoda](https://github.com/k_satoda) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, a122f15] | cpprefjp/fixm:1 | `start_lifetime_as`: 戻り値について不正な「ポインタの値は `p`」を削除 | + + +## [50c0019uy](https://github.com/50c0019uy) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, 8acf79c] | cpprefjp/fixm:1 | ページタイトルを修正 | + + +## [tshino](https://github.com/tshino) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, 9bd9653] | cpprefjp/typo:1 | 「定数とき」→「定数のとき」 | + + +## [tetsurom](https://github.com/tetsurom) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, f6f1289] | cpprefjp/fixm:1 | Update introduction of future.md | + + +## [dsugiyama](https://github.com/dsugiyama) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, c14bf1e] | cpprefjp/fixm:1 | std::format のポインタに対する書式 "P" の説明を修正 | + + +## [komori-n](https://github.com/komori-n) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, c312d2f] | cpprefjp/fixm:1 | `try_lock`のコード例のコンパイルが通らない問題を修正 | + + +## [Mugen2411](https://github.com/Mugen2411) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, deadc77] | cpprefjp/typo:1 | typo: constrexpr→constexpr | + + +## [reika727](https://github.com/reika727) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/site, 7bd2d3d] | cpprefjp/typo:1 | fix typo(面場 -> メンバ) | + + +## [zer0star.65535](https://github.com/zer0star.65535) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit cpprefjp/kunai, 9b421fa] | tool/improvem:1 | サイドバーの三角の角度を修正 | + + +## [RyuYamamoto](https://github.com/RyuYamamoto) + +| コミット | タグ | 説明 | +|----------|------|------| +| [commit boostjp/site, d27874c] | boostjp/typo:1 | fix typo | From 321497959fe6eff54770962976c529260b9517b0 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 1 Dec 2025 10:59:38 +0900 Subject: [PATCH 2454/3948] =?UTF-8?q?zer0-star=E3=81=95=E3=82=93=E3=81=AE?= =?UTF-8?q?=E3=82=A2=E3=82=AB=E3=82=A6=E3=83=B3=E3=83=88=E3=83=9F=E3=82=B9?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start_editing/contribution_stats_2025.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/start_editing/contribution_stats_2025.md b/start_editing/contribution_stats_2025.md index 502fd70b3d..5d0af08514 100644 --- a/start_editing/contribution_stats_2025.md +++ b/start_editing/contribution_stats_2025.md @@ -1204,7 +1204,7 @@ | [commit cpprefjp/site, 7bd2d3d] | cpprefjp/typo:1 | fix typo(面場 -> メンバ) | -## [zer0star.65535](https://github.com/zer0star.65535) +## [zer0-star](https://github.com/zer0-star) | コミット | タグ | 説明 | |----------|------|------| From 1ed3f7de944b0ad06ad1041fd17c563e6d00ebc3 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 1 Dec 2025 11:02:15 +0900 Subject: [PATCH 2455/3948] =?UTF-8?q?k-satoda=E3=81=95=E3=82=93=E3=81=AE?= =?UTF-8?q?=E3=82=A2=E3=82=AB=E3=82=A6=E3=83=B3=E3=83=88=E3=83=9F=E3=82=B9?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start_editing/contribution_stats_2025.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/start_editing/contribution_stats_2025.md b/start_editing/contribution_stats_2025.md index 5d0af08514..42d38b86d6 100644 --- a/start_editing/contribution_stats_2025.md +++ b/start_editing/contribution_stats_2025.md @@ -1148,7 +1148,7 @@ | [commit cpprefjp/site, 15541d7] | cpprefjp/link:1 | `type_info`へのリンクがあってほしいと思ったので追加 | -## [k_satoda](https://github.com/k_satoda) +## [k-satoda](https://github.com/k-satoda) | コミット | タグ | 説明 | |----------|------|------| From 6327f236f86d34c0df3633b871be6ba686273e87 Mon Sep 17 00:00:00 2001 From: Keita Nonaka Date: Sun, 30 Nov 2025 23:52:33 -0800 Subject: [PATCH 2456/3948] fix: add a relative page like for `[[likely]]/[[unlikely]]` page --- lang/cpp20/likely_and_unlikely_attributes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/lang/cpp20/likely_and_unlikely_attributes.md b/lang/cpp20/likely_and_unlikely_attributes.md index 9a818d36ef..85a5f83001 100644 --- a/lang/cpp20/likely_and_unlikely_attributes.md +++ b/lang/cpp20/likely_and_unlikely_attributes.md @@ -72,6 +72,7 @@ GCCやClangなど一部C++コンパイラでは独自拡張として同等機能 ## 関連項目 +- [C++11 属性構文](/lang/cpp11/attributes.md) - [C++23 `[[assume]]`属性](/lang/cpp23/portable_assumptions.md) From 8efeaf3eee317114ad567148cee77a759019d31d Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Tue, 2 Dec 2025 13:10:36 +0900 Subject: [PATCH 2457/3948] Add new post `cstdlib/mblen` --- reference/cstdlib/mblen.md | 41 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 reference/cstdlib/mblen.md diff --git a/reference/cstdlib/mblen.md b/reference/cstdlib/mblen.md new file mode 100644 index 0000000000..a9b9410fe9 --- /dev/null +++ b/reference/cstdlib/mblen.md @@ -0,0 +1,41 @@ +# mblen +* cstdlib[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +namespace std { + int mblen(const char* str, size_t n); +} +``` + +## 概要 +マルチバイト文字列の先頭の文字が占めるバイト数を返す。 + +この関数は現在のロケールに依存してマルチバイト文字を解釈する。 +n は解析に使用する最大バイト数を指定する。 + +## 戻り値 +- 正常に動作する場合、文字の占めるバイト数を返す。 +- `str`が`nullptr`の時、内部状態を初期化し`0`を返す。 +- 無効な文字列、または`n`が不足している場合、`-1`を返す。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::setlocale(LC_ALL, "ja_JP.UTF-8"); + const char *str = "こんにちは"; + int result = std::mblen(str, MB_CUR_MAX); + std::cout << result << std::endl; + return 0; +} +``` + +### 出力例 +``` +3 +``` From 62503c362f1310af7fecc9e4089134c0df44eb4f Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Tue, 2 Dec 2025 13:14:25 +0900 Subject: [PATCH 2458/3948] add path to `mblen` --- reference/cstdlib.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdlib.md b/reference/cstdlib.md index c43a91519d..a7af4c914f 100644 --- a/reference/cstdlib.md +++ b/reference/cstdlib.md @@ -96,7 +96,7 @@ | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`MB_CUR_MAX`](cstdlib/mb_cur_max.md) | マルチバイト文字列の最大サイズを表す整数値マクロ (macro)| -| `mblen` | マルチバイト文字の長さを取得する (function) | | +| [`mblen`](cstdlib/mblen.md) | マルチバイト文字の長さを取得する (function) | | | `mbtowc` | マルチバイト文字を、ワイド文字に変換する (function) | | | `wctomb` | ワイド文字を、マルチバイト文字に変換する (function) | | | `mbstowcs` | マルチバイト文字列を、ワイド文字列に変換する (function) | | From b76462c9dc26810a4715bb3f2f5eaed6cd6a30f5 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Wed, 3 Dec 2025 09:51:04 +0900 Subject: [PATCH 2459/3948] =?UTF-8?q?=E8=A8=98=E8=BF=B0=E3=80=81=E4=BE=8B?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/mblen.md | 42 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/reference/cstdlib/mblen.md b/reference/cstdlib/mblen.md index a9b9410fe9..3154cca3cd 100644 --- a/reference/cstdlib/mblen.md +++ b/reference/cstdlib/mblen.md @@ -12,8 +12,11 @@ namespace std { ## 概要 マルチバイト文字列の先頭の文字が占めるバイト数を返す。 +先頭以外の文字に関するバイト数は計算されない。 + この関数は現在のロケールに依存してマルチバイト文字を解釈する。 -n は解析に使用する最大バイト数を指定する。 + +`n`は解析に使用する最大バイト数を指定する。 ## 戻り値 - 正常に動作する場合、文字の占めるバイト数を返す。 @@ -21,6 +24,7 @@ n は解析に使用する最大バイト数を指定する。 - 無効な文字列、または`n`が不足している場合、`-1`を返す。 ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -35,7 +39,41 @@ int main() { } ``` -### 出力例 +#### 出力例 ``` 3 ``` + +### 文字列の文字数を計算する +```cpp example +#include +#include +#include + +int count_chars_mblen(const char* s) { + std::setlocale(LC_ALL, "ja_JP.UTF-8"); + int count = 0; + size_t i = 0; + while (s[i] != '\0') { + int len = std::mblen(&s[i], MB_CUR_MAX); + if (len < 0) { + len = 1; + } + i += len; + count++; + } + return count; +} + +int main() { + const char* str = "こんにちは世界"; + std::cout << "文字列: " << str << "\n"; + std::cout << "文字数: " << count_chars_mblen(str) << "\n"; +} +``` + +#### 出力例 +``` +文字列: こんにちは世界 +文字数: 7 +``` From f73e9f6b98d891f84a1ba174e5243e41ed2ac897 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 3 Dec 2025 10:11:02 +0900 Subject: [PATCH 2460/3948] =?UTF-8?q?mblen=20:=20=E3=82=A4=E3=83=B3?= =?UTF-8?q?=E3=83=87=E3=83=B3=E3=83=88=E3=82=924=E3=81=8B=E3=82=892?= =?UTF-8?q?=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/mblen.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/reference/cstdlib/mblen.md b/reference/cstdlib/mblen.md index 3154cca3cd..838ee668b0 100644 --- a/reference/cstdlib/mblen.md +++ b/reference/cstdlib/mblen.md @@ -51,24 +51,24 @@ int main() { #include int count_chars_mblen(const char* s) { - std::setlocale(LC_ALL, "ja_JP.UTF-8"); - int count = 0; - size_t i = 0; - while (s[i] != '\0') { - int len = std::mblen(&s[i], MB_CUR_MAX); - if (len < 0) { - len = 1; - } - i += len; - count++; + std::setlocale(LC_ALL, "ja_JP.UTF-8"); + int count = 0; + size_t i = 0; + while (s[i] != '\0') { + int len = std::mblen(&s[i], MB_CUR_MAX); + if (len < 0) { + len = 1; } - return count; + i += len; + count++; + } + return count; } int main() { - const char* str = "こんにちは世界"; - std::cout << "文字列: " << str << "\n"; - std::cout << "文字数: " << count_chars_mblen(str) << "\n"; + const char* str = "こんにちは世界"; + std::cout << "文字列: " << str << "\n"; + std::cout << "文字数: " << count_chars_mblen(str) << "\n"; } ``` From 0b61755bd12efe68418cb790b84cf00cd8667ea5 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 3 Dec 2025 10:11:53 +0900 Subject: [PATCH 2461/3948] =?UTF-8?q?mblen=E3=81=AE=E3=82=B5=E3=83=B3?= =?UTF-8?q?=E3=83=97=E3=83=AB=E3=82=B3=E3=83=BC=E3=83=89=20:=20=E3=83=AD?= =?UTF-8?q?=E3=82=B1=E3=83=BC=E3=83=AB=E3=82=92=E6=AF=8E=E5=9B=9E=E8=A8=AD?= =?UTF-8?q?=E5=AE=9A=E3=81=99=E3=82=8B=E3=81=A8=E9=87=8D=E3=81=84=E3=81=AE?= =?UTF-8?q?=E3=81=A7=E6=96=87=E5=AD=97=E6=95=B0=E8=A8=88=E7=AE=97=E3=81=AE?= =?UTF-8?q?=E5=A4=96=E3=81=AB=E3=81=A0=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/mblen.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reference/cstdlib/mblen.md b/reference/cstdlib/mblen.md index 838ee668b0..4cdcd924d0 100644 --- a/reference/cstdlib/mblen.md +++ b/reference/cstdlib/mblen.md @@ -51,7 +51,6 @@ int main() { #include int count_chars_mblen(const char* s) { - std::setlocale(LC_ALL, "ja_JP.UTF-8"); int count = 0; size_t i = 0; while (s[i] != '\0') { @@ -66,6 +65,8 @@ int count_chars_mblen(const char* s) { } int main() { + std::setlocale(LC_ALL, "ja_JP.UTF-8"); + const char* str = "こんにちは世界"; std::cout << "文字列: " << str << "\n"; std::cout << "文字数: " << count_chars_mblen(str) << "\n"; From 34aa9cdb170052977aed3c9671c4e4ea21436636 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Wed, 3 Dec 2025 21:38:13 +0900 Subject: [PATCH 2462/3948] =?UTF-8?q?clocale=20=E3=83=A9=E3=82=A4=E3=83=96?= =?UTF-8?q?=E3=83=A9=E3=83=AA=E3=83=9A=E3=83=BC=E3=82=B8=E3=81=AE=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/clocale.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 reference/clocale.md diff --git a/reference/clocale.md b/reference/clocale.md new file mode 100644 index 0000000000..63facbd3fa --- /dev/null +++ b/reference/clocale.md @@ -0,0 +1,35 @@ +# clocale +* clocale[meta header] + +``ヘッダでは、ローカライゼーション(地域化)に関するクラス・関数を定義する。 + +これらの機能は基本的には、`std`名前空間に属することを除いてC言語の標準ライブラリ``ヘッダと同じである。 + +## マクロ + +| 名前 | 説明 | 対応バージョン | +| ------------- | ----------------------------------------- | ------- | +| [`NULL`](/reference/cstddef/null.md) | ヌルポインタ定数に展開されるマクロ | | +| `LC_ALL` | すべてのロケールカテゴリを一括指定するための定数 | | +| `LC_COLLATE` | 文字列の照合(比較)規則に関するロケールカテゴリ | | +| `LC_CTYPE` | 文字分類(大文字/小文字、数字、空白など)やマルチバイト文字の扱いに関するカテゴリ | | +| `LC_MONETARY` | 通貨表記に関するロケールカテゴリ | | +| `LC_NUMERIC` | 数値表記に関するロケールカテゴリ(小数点記号など) | | +| `LC_TIME` | 日付および時刻表記に関するロケールカテゴリ | | + +## 構造体 +| 名前 | 説明 | 対応バージョン | +| ------------- | ----------------------------------------- | ------- | +| `lconv` | 数値・通貨表示の書式設定をまとめた型 | | + +## 関数 +| 名前 | 説明 | 対応バージョン | +| ------------- | ----------------------------------------- | ------- | +| `setlocale` | ロケールを変更、または現在のロケールを取得する。 | | +| `localeconv` | 現在のロケールに応じた数値・通貨表記情報を取得する。 | | + +## 関連項目 +- [`locale`](locale.md) + +## 参照 +[Synopses for the C library](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0175r1.html) From 195f008c45fdaf77c2fd10c18b8b09d2e72c083b Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Wed, 3 Dec 2025 21:42:40 +0900 Subject: [PATCH 2463/3948] =?UTF-8?q?reference:=20clocale=20=E3=81=B8?= =?UTF-8?q?=E3=81=AE=E3=83=91=E3=82=B9=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference.md b/reference.md index d5a94adb21..b052c1bf97 100644 --- a/reference.md +++ b/reference.md @@ -227,7 +227,7 @@ | `` | 固定精度整数のための書式指定マクロ | C++11 (C99) | | `` | `&&`に対する別名`and`のような、各種演算子に対するマクロを定義する。
ただしC++ではこれらの別名はキーワードとして定義されるため、このヘッダでは何も定義されない。 | C++20で削除 | | [``](/reference/climits.md) | 整数型の最小値、最大値を表すマクロ | | -| `` | ロケール | | +| [``](/reference/clocale.md) | ロケール | | | [``](/reference/cmath.md) | 数学関数 | | | `` | ジャンプ処理 | | | `` | シグナル | | From 4329bd56e985b0e9558c42622956319a3b788a78 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Wed, 3 Dec 2025 22:38:50 +0900 Subject: [PATCH 2464/3948] =?UTF-8?q?setlocale:=20=E9=96=A2=E6=95=B0?= =?UTF-8?q?=E3=83=9A=E3=83=BC=E3=82=B8=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/clocale/setlocale.md | 56 ++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 reference/clocale/setlocale.md diff --git a/reference/clocale/setlocale.md b/reference/clocale/setlocale.md new file mode 100644 index 0000000000..e2934913fa --- /dev/null +++ b/reference/clocale/setlocale.md @@ -0,0 +1,56 @@ +# setlocale +* clocale[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +namespace std { + char* setlocale(int category, const char* locale); +} +``` + +## 概要 +指定したカテゴリのロケールを設定、または現在のロケールを取得する。 + +指定できるロケール文字列は[以下のページ](/article/platform/locales.md)である。 + +## 引数 +- `category`:設定対象のカテゴリ。`LC_ALL`,`LC_CTYPE`などのマクロを使用。 +- `locale`: + * "C":標準のCロケール + * "":環境依存のデフォルトロケール + * `NULL`:現在のロケールを取得するだけ + +## 戻り値 +成功時は設定されたロケール名(文字列)、失敗時は`NULL`。 + +## 例 +```cpp example +#include +#include + +int main(){ + // 日本語ロケールに設定 + if (!std::setlocale(LC_ALL, "ja_JP.UTF-8")) { + std::cerr << "Failed to set locale\n"; + return 1; + } + + // 現在の全カテゴリのロケールを取得 + std::cout << "Current locale: " << std::setlocale(LC_ALL, NULL) << "\n"; + + // 数値カテゴリだけ確認 + std::cout << "Numeric locale: " << std::setlocale(LC_NUMERIC, NULL) << "\n"; +} + +``` + +### 出力 +``` +Current locale: ja_JP.UTF-8 +Numeric locale: ja_JP.UTF-8 +``` + +## 関連項目 +- [ ロケール文字一覧 ](/article/platform/locales.md) +- [ `std::locale` ](/reference/locale/locale.md) From 3da3fbcb87e30401583bf5ac3e11a6fbfb51f0c1 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Wed, 3 Dec 2025 22:42:25 +0900 Subject: [PATCH 2465/3948] =?UTF-8?q?setlocale=E3=81=B8=E3=81=AE=E3=83=91?= =?UTF-8?q?=E3=82=B9=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/clocale.md | 2 +- reference/cstdlib/mb_cur_max.md | 2 +- reference/string/stod.md | 2 +- reference/string/stof.md | 2 +- reference/string/stoi.md | 2 +- reference/string/stol.md | 2 +- reference/string/stold.md | 2 +- reference/string/stoll.md | 2 +- reference/string/stoul.md | 2 +- reference/string/stoull.md | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/reference/clocale.md b/reference/clocale.md index 63facbd3fa..32ef1dea4c 100644 --- a/reference/clocale.md +++ b/reference/clocale.md @@ -25,7 +25,7 @@ ## 関数 | 名前 | 説明 | 対応バージョン | | ------------- | ----------------------------------------- | ------- | -| `setlocale` | ロケールを変更、または現在のロケールを取得する。 | | +| [`setlocale`](/reference/clocale/setlocale.md) | ロケールを変更、または現在のロケールを取得する。 | | | `localeconv` | 現在のロケールに応じた数値・通貨表記情報を取得する。 | | ## 関連項目 diff --git a/reference/cstdlib/mb_cur_max.md b/reference/cstdlib/mb_cur_max.md index f3bb3fafa4..41738ed23c 100644 --- a/reference/cstdlib/mb_cur_max.md +++ b/reference/cstdlib/mb_cur_max.md @@ -44,7 +44,7 @@ Locale: ja_JP.UTF-8, MB_CUR_MAX: 6 ## 関連項目 - [`MB_LEN_MAX`](/reference/climits/mb_len_max.md): 全ロケールでのマルチバイト文字の最大バイト数 -- `setlocale`: ロケールを変更する +- [`setlocale`](/reference/clocale/setlocale.md): ロケールを変更する ## 参照 - [mb_cur_max(3) - Linux man page](https://linux.die.net/man/3/mb_cur_max) diff --git a/reference/string/stod.md b/reference/string/stod.md index 2d61a8c0cf..da23fcaa7e 100644 --- a/reference/string/stod.md +++ b/reference/string/stod.md @@ -38,7 +38,7 @@ namespace std { - Clang (libc++) 3.3では、この関数の呼び出し前後で`errno`の値は変化しない。 ### グローバルロケールの影響 -この関数は、`setlocale()`関数により挙動が変化する。 +この関数は、[`setlocale()`](/reference/clocale/setlocale.md)関数により挙動が変化する。 - `strtod()`関数での文字列先頭の空白を読み飛ばす処理に、``の`isspace()`関数が使用される。 - 小数点記号は`LC_NUMERIC`で指定されたものが使用される。 diff --git a/reference/string/stof.md b/reference/string/stof.md index 95ab2cb9cb..ff2594f6fd 100644 --- a/reference/string/stof.md +++ b/reference/string/stof.md @@ -38,7 +38,7 @@ namespace std { - Clang (libc++) 3.3では、この関数の呼び出し前後で`errno`の値は変化しない。 ### グローバルロケールの影響 -この関数は、`setlocale()`関数により挙動が変化する。 +この関数は、[`setlocale()`](/reference/clocale/setlocale.md)関数により挙動が変化する。 - `strtof()`関数での文字列先頭の空白を読み飛ばす処理に、``の`isspace()`関数が使用される。 - 小数点記号は`LC_NUMERIC`で指定されたものが使用される。 diff --git a/reference/string/stoi.md b/reference/string/stoi.md index 66b15defd3..fcd6b887f5 100644 --- a/reference/string/stoi.md +++ b/reference/string/stoi.md @@ -43,7 +43,7 @@ namespace std { - Clang (libc++) 3.3では、この関数の呼び出し前後で`errno`の値は変化しない。 ### グローバルロケールの影響 -この関数は、`setlocale()`関数により挙動が変化する。 +この関数は、[`setlocale()`](/reference/clocale/setlocale.md)関数により挙動が変化する。 `strtol()`関数での文字列先頭の空白を読み飛ばす処理に、``の`isspace()`関数が使用されるためである。 diff --git a/reference/string/stol.md b/reference/string/stol.md index 0b9401b257..6b270ba8a4 100644 --- a/reference/string/stol.md +++ b/reference/string/stol.md @@ -43,7 +43,7 @@ namespace std { - Clang (libc++) 3.3では、この関数の呼び出し前後で`errno`の値は変化しない。 ### グローバルロケールの影響 -この関数は、`setlocale()`関数により挙動が変化する。 +この関数は、[`setlocale()`](/reference/clocale/setlocale.md)関数により挙動が変化する。 `strtol()`関数での文字列先頭の空白を読み飛ばす処理に、``の`isspace()`関数が使用されるためである。 diff --git a/reference/string/stold.md b/reference/string/stold.md index 8481acdddc..aa4260c42e 100644 --- a/reference/string/stold.md +++ b/reference/string/stold.md @@ -38,7 +38,7 @@ namespace std { - Clang (libc++) 3.3では、この関数の呼び出し前後で`errno`の値は変化しない。 ### グローバルロケールの影響 -この関数は、`setlocale()`関数により挙動が変化する。 +この関数は、[`setlocale()`](/reference/clocale/setlocale.md)関数により挙動が変化する。 - `strtold()`関数での文字列先頭の空白を読み飛ばす処理に、``の`isspace()`関数が使用される。 - 小数点記号は`LC_NUMERIC`で指定されたものが使用される。 diff --git a/reference/string/stoll.md b/reference/string/stoll.md index e310cb6019..e606ca6100 100644 --- a/reference/string/stoll.md +++ b/reference/string/stoll.md @@ -48,7 +48,7 @@ namespace std { - Clang (libc++) 3.3では、この関数の呼び出し前後で`errno`の値は変化しない。 ### グローバルロケールの影響 -この関数は、`setlocale()`関数により挙動が変化する。 +この関数は、[`setlocale()`](/reference/clocale/setlocale.md)関数により挙動が変化する。 `strtoll()`関数での文字列先頭の空白を読み飛ばす処理に、``の`isspace()`関数が使用されるためである。 diff --git a/reference/string/stoul.md b/reference/string/stoul.md index 6c156599c3..32c29da686 100644 --- a/reference/string/stoul.md +++ b/reference/string/stoul.md @@ -48,7 +48,7 @@ namespace std { - Clang (libc++) 3.3では、この関数の呼び出し前後で`errno`の値は変化しない。 ### グローバルロケールの影響 -この関数は、`setlocale()`関数により挙動が変化する。 +この関数は、[`setlocale()`](/reference/clocale/setlocale.md)関数により挙動が変化する。 `strtoul()`関数での文字列先頭の空白を読み飛ばす処理に、``の`isspace()`関数が使用されるためである。 diff --git a/reference/string/stoull.md b/reference/string/stoull.md index 4396231668..b41860e0d5 100644 --- a/reference/string/stoull.md +++ b/reference/string/stoull.md @@ -48,7 +48,7 @@ namespace std { - Clang (libc++) 3.3では、この関数の呼び出し前後で`errno`の値は変化しない。 ### グローバルロケールの影響 -この関数は、`setlocale()`関数により挙動が変化する。 +この関数は、[`setlocale()`](/reference/clocale/setlocale.md)関数により挙動が変化する。 `strtoull()`関数での文字列先頭の空白を読み飛ばす処理に、``の`isspace()`関数が使用されるためである。 From 1cf31acb644fd3585d103572247dc2f8bbb36ef9 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Thu, 4 Dec 2025 00:13:16 +0900 Subject: [PATCH 2466/3948] =?UTF-8?q?=E6=8C=87=E6=91=98=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=81=9F=E7=82=B9=E3=82=92=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/clocale/setlocale.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/reference/clocale/setlocale.md b/reference/clocale/setlocale.md index e2934913fa..2fe7636c15 100644 --- a/reference/clocale/setlocale.md +++ b/reference/clocale/setlocale.md @@ -5,31 +5,35 @@ ```cpp namespace std { - char* setlocale(int category, const char* locale); + char* setlocale(int category, const char* locale); } ``` ## 概要 指定したカテゴリのロケールを設定、または現在のロケールを取得する。 -指定できるロケール文字列は[以下のページ](/article/platform/locales.md)である。 +指定できる処理系定義のロケール文字列は[使用できるロケール文字列](/article/platform/locales.md)を参照のこと。 ## 引数 - `category`:設定対象のカテゴリ。`LC_ALL`,`LC_CTYPE`などのマクロを使用。 - `locale`: - * "C":標準のCロケール - * "":環境依存のデフォルトロケール + * `"C"`:標準のCロケール + * `""`:環境依存のデフォルトロケール * `NULL`:現在のロケールを取得するだけ ## 戻り値 成功時は設定されたロケール名(文字列)、失敗時は`NULL`。 +返された文字列をプログラムで変更してはならない。 + +`setlocale()` を呼び出したスレッドが終了した後、もしくは更に次の `setlocale()` の呼び出しの後に返された文字列を使った時の動作は未定義である。 + ## 例 ```cpp example #include #include -int main(){ +int main() { // 日本語ロケールに設定 if (!std::setlocale(LC_ALL, "ja_JP.UTF-8")) { std::cerr << "Failed to set locale\n"; @@ -52,5 +56,5 @@ Numeric locale: ja_JP.UTF-8 ``` ## 関連項目 -- [ ロケール文字一覧 ](/article/platform/locales.md) +- [ ロケール文字列一覧 ](/article/platform/locales.md) - [ `std::locale` ](/reference/locale/locale.md) From cef2a2cc234b9556b2645a3688ea1ed78812bac6 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Wed, 3 Dec 2025 16:11:56 +0000 Subject: [PATCH 2467/3948] Update setlocale.md --- reference/clocale/setlocale.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reference/clocale/setlocale.md b/reference/clocale/setlocale.md index 2fe7636c15..724ec4420c 100644 --- a/reference/clocale/setlocale.md +++ b/reference/clocale/setlocale.md @@ -14,12 +14,17 @@ namespace std { 指定できる処理系定義のロケール文字列は[使用できるロケール文字列](/article/platform/locales.md)を参照のこと。 +この関数の呼び出しは他スレッドにおける `setlocale()` または現在のロケールを使用する他の関数の呼び出しとデータ競合の可能性がある。 + +プログラム開始時の現在のロケールは `std::setlocale(LC_ALL, "C");` が呼び出されたのと同じ状態に初期化される。 + ## 引数 - `category`:設定対象のカテゴリ。`LC_ALL`,`LC_CTYPE`などのマクロを使用。 - `locale`: * `"C"`:標準のCロケール * `""`:環境依存のデフォルトロケール * `NULL`:現在のロケールを取得するだけ + * 処置系定義の文字列 ## 戻り値 成功時は設定されたロケール名(文字列)、失敗時は`NULL`。 From 801c37f8708c6054ffe49561e7f02968abadc433 Mon Sep 17 00:00:00 2001 From: Ryoga <49950206+Ryoga-exe@users.noreply.github.com> Date: Fri, 5 Dec 2025 03:13:26 +0900 Subject: [PATCH 2468/3948] fix typo in `reference/algorithm/minmax_element.md` --- reference/algorithm/minmax_element.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/algorithm/minmax_element.md b/reference/algorithm/minmax_element.md index f2edde4bc9..b839bc566f 100644 --- a/reference/algorithm/minmax_element.md +++ b/reference/algorithm/minmax_element.md @@ -109,7 +109,7 @@ minmax_element(ForwardIterator first, ForwardIterator last, Compare comp) ForwardIterator prev = first; // 残りの要素が 1 個しか無かったら、.first と .second の両方の要素と比較して、 - // 必要に応じで結果を更新後、ループを抜ける + // 必要に応じて結果を更新後、ループを抜ける if (++first == last) { if (comp(*prev, *result.first)) result.first = prev; From a95fb44c81e1311b80e1eeeed9ef110743bbfca8 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sun, 7 Dec 2025 12:50:53 +0900 Subject: [PATCH 2469/3948] add link in cpp20.md --- lang/cpp20.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/cpp20.md b/lang/cpp20.md index 53140fef53..b8e08f2ac8 100644 --- a/lang/cpp20.md +++ b/lang/cpp20.md @@ -264,7 +264,7 @@ C++20とは、2020年中に改訂され、ISO/IEC 14882:2020で標準規格化 - [`operator>>`](/reference/istream/basic_istream/op_istream_free.md)`(basic_istream&, CharT*)`を`operator>>(basic_istream&, CharT (&)[N])`に修正 - [`operator<<`](/reference/ostream/basic_ostream/op_ostream_free.md)に、`wchar_t` (`char`版のみ)、`char8_t`、`char16_t`、`char32_t`のdelete宣言を追加 - [`std::istream_iterator`](/reference/iterator/istream_iterator.md)について、要件の書き方を整理し、振る舞いをより明確化 -- `std::basic_stringbuf`、`std::basic_istringstream`、`std::basic_ostringstream`クラスに、アロケータを伝播させるためのインタフェースを追加 +- [`std::basic_stringbuf`](/reference/sstream/basic_stringbuf.md)、[`std::basic_istringstream`](/reference/sstream/basic_istringstream.md)、[`std::basic_ostringstream`](/reference/sstream/basic_ostringstream.md)クラスに、アロケータを伝播させるためのインタフェースを追加 ### スマートポインタ From 57412ffbc6cf3346315154241a95c33606d6a96e Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Wed, 10 Dec 2025 23:07:12 +0900 Subject: [PATCH 2470/3948] =?UTF-8?q?=E5=8F=A3=E8=AA=BF=E3=81=AE=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdint/int_fast64_t.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/cstdint/int_fast64_t.md b/reference/cstdint/int_fast64_t.md index de6d1bee60..ad7f943f8f 100644 --- a/reference/cstdint/int_fast64_t.md +++ b/reference/cstdint/int_fast64_t.md @@ -63,7 +63,7 @@ int_fast64_t is the same as int64_t: 0 9000000000000000000 + 1000000000000000000 = -8446744073709551616 ``` -この出力例は特定の環境に依存しており、処理系によって異なる可能性があります。特に、`int_fast64_t`のサイズやオーバーフロー動作は処理系によって異なることがある。 +この出力例は特定の環境に依存しており、処理系によって異なる可能性がある。特に、`int_fast64_t`のサイズやオーバーフロー動作は処理系によって異なることがある。 ## バージョン ### 言語 From 7a709f016fb9836e7641d73efa2d651fe5b84c1b Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 12 Dec 2025 12:39:35 +0900 Subject: [PATCH 2471/3948] =?UTF-8?q?reference=20/=20lang=20:=20=E3=81=A7?= =?UTF-8?q?=E3=81=99=E3=81=BE=E3=81=99=E8=AA=BF=E3=82=92=E3=80=81=E3=81=A7?= =?UTF-8?q?=E3=81=82=E3=82=8B=E8=AA=BF=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26/contracts.md | 8 ++++---- reference/cstdint/int_fast16_t.md | 2 +- reference/cstdint/int_fast32_t.md | 2 +- reference/cstdint/int_fast8_t.md | 2 +- reference/expected/expected.void.md | 4 ++-- reference/thread.md | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lang/cpp26/contracts.md b/lang/cpp26/contracts.md index e2e57725f6..05c1613ff7 100644 --- a/lang/cpp26/contracts.md +++ b/lang/cpp26/contracts.md @@ -131,11 +131,11 @@ void return_negative(int value) - ignore: 契約のチェックを無視(ignore)する。 -- observe: 契約違反時にハンドラを呼び出し、プログラムの実行を続行します。 +- observe: 契約違反時にハンドラを呼び出し、プログラムの実行を続行する。 -- enforce: 契約違反時にハンドラを呼び出し、プログラムを終了します。 +- enforce: 契約違反時にハンドラを呼び出し、プログラムを終了する。 -- quick_enforce: 契約違反時にハンドラを呼び出さず、即座にプログラムを終了します。 +- quick_enforce: 契約違反時にハンドラを呼び出さず、即座にプログラムを終了する。 評価モードは、コンパイル時、もしくは実行時に指定できる。 @@ -146,7 +146,7 @@ g++ -std=c++26 -fcontracts -fcontract-semantic=observe main.cpp のように指定できる。 ### 契約違反ハンドラ -契約違反が発生した場合、`std::contracts::contract_violation`型の情報(<contracts>ヘッダー)がハンドラに渡されます。この情報には、違反の種類、発生場所、違反した条件式などが含まれます。 +契約違反が発生した場合、`std::contracts::contract_violation`型の情報(<contracts>ヘッダー)がハンドラに渡される。この情報には、違反の種類、発生場所、違反した条件式などが含まれる。 ### 使用上の注意 以下の操作は、気をつけなければならない。 diff --git a/reference/cstdint/int_fast16_t.md b/reference/cstdint/int_fast16_t.md index ca7bcb4650..9b45bff47a 100644 --- a/reference/cstdint/int_fast16_t.md +++ b/reference/cstdint/int_fast16_t.md @@ -63,7 +63,7 @@ int_fast16_t is the same as int16_t: 0 30000 + 10000 = -25536 ``` -この出力例は特定の環境に依存しており、処理系によって異なる可能性があります。特に、`int_fast16_t`のサイズやオーバーフロー動作は処理系によって異なることがある。 +この出力例は特定の環境に依存しており、処理系によって異なる可能性がある。特に、`int_fast16_t`のサイズやオーバーフロー動作は処理系によって異なることがある。 ## バージョン ### 言語 diff --git a/reference/cstdint/int_fast32_t.md b/reference/cstdint/int_fast32_t.md index d8893f6887..bd7dd68df4 100644 --- a/reference/cstdint/int_fast32_t.md +++ b/reference/cstdint/int_fast32_t.md @@ -63,7 +63,7 @@ int_fast32_t is the same as int32_t: 0 2000000000 + 1000000000 = -1294967296 ``` -この出力例は特定の環境に依存しており、処理系によって異なる可能性があります。特に、`int_fast32_t`のサイズやオーバーフロー動作は処理系によって異なることがある。 +この出力例は特定の環境に依存しており、処理系によって異なる可能性がある。特に、`int_fast32_t`のサイズやオーバーフロー動作は処理系によって異なることがある。 ## バージョン ### 言語 diff --git a/reference/cstdint/int_fast8_t.md b/reference/cstdint/int_fast8_t.md index 2ef6ea5880..027c08a4b7 100644 --- a/reference/cstdint/int_fast8_t.md +++ b/reference/cstdint/int_fast8_t.md @@ -63,7 +63,7 @@ int_fast8_t is the same as int8_t: 0 100 + 50 = -106 ``` -この出力例は特定の環境に依存しており、処理系によって異なる可能性があります。特に、`int_fast8_t`のサイズやオーバーフロー動作は処理系によって異なることがある。 +この出力例は特定の環境に依存しており、処理系によって異なる可能性がある。特に、`int_fast8_t`のサイズやオーバーフロー動作は処理系によって異なることがある。 ## バージョン ### 言語 diff --git a/reference/expected/expected.void.md b/reference/expected/expected.void.md index 0081c57287..b6c0a7e265 100644 --- a/reference/expected/expected.void.md +++ b/reference/expected/expected.void.md @@ -19,6 +19,6 @@ namespace std { * expected[link expected.md] * is_void_v[link /reference/type_traits/is_void.md] -このページは`expected`部分特殊化テンプレートに対応するプレースホルダです。 +このページは`expected`部分特殊化テンプレートに対応するプレースホルダである。 -`expected`クラスの説明は[`expected`プライマリテンプレート](expected.md)ページを参照してください。 +`expected`クラスの説明は[`expected`プライマリテンプレート](expected.md)ページを参照のこと。 diff --git a/reference/thread.md b/reference/thread.md index d48803ae59..ab3a9b54e7 100644 --- a/reference/thread.md +++ b/reference/thread.md @@ -28,5 +28,5 @@ ## 参照 - [The cpp-threads Archives](https://www.decadent.org.uk/pipermail/cpp-threads/) - - C++11の策定時に、C++標準の言語とライブラリに並行プログラミングの提案を行うため使用されていたメーリングリストのアーカイブです。 + - C++11の策定時に、C++標準の言語とライブラリに並行プログラミングの提案を行うため使用されていたメーリングリストのアーカイブである。 - [P2051R0 C++ Standard Library Issues to be moved in Prague](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2051r0.html) From baadf1ba8cbbf82fc7ece96596d119e0949b6b96 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Sun, 21 Dec 2025 19:10:56 +0900 Subject: [PATCH 2472/3948] =?UTF-8?q?regular=5Finvocable:=20=E6=84=8F?= =?UTF-8?q?=E5=91=B3=E8=AB=96=E8=A6=81=E4=BB=B6=E3=81=AB=E3=81=A4=E3=81=84?= =?UTF-8?q?=E3=81=A6=E8=BF=BD=E5=8A=A0=E3=81=A8=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Clarify the requirements for 'invocable' and 'regular_invocable' concepts regarding side effects and equality preservation. --- reference/concepts/invocable.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reference/concepts/invocable.md b/reference/concepts/invocable.md index a19bbae04e..7fa1ed1815 100644 --- a/reference/concepts/invocable.md +++ b/reference/concepts/invocable.md @@ -21,11 +21,13 @@ namespace std { `invocable`及び`regular_invocable`は、任意の関数呼び出し可能な型`F`が引数`Args...`によって関数呼び出し可能であることを表すコンセプトである。 +加えて、`regular_invocable`はその呼び出しが等しさを保持し、なおかつ関数オブジェクト(`F`のオブジェクト)も引数(`Args`オブジェクト)も変更しないものである必要がある。 + ## 等しさの保持 `invocable`コンセプトでは`F`の`Args...`による関数呼び出しが[等しさを保持](/reference/concepts.md)することを要求しない。従って、`invocable`コンセプトのモデルとなる型`F, Args...`は関数呼び出しに際して副作用があっても良く、その出力が内部状態や外部状態に依存していても構わない。 -対して、`regular_invocable`コンセプトのモデルとなる`F`の`Args...`による関数呼び出しには[等しさを保持](/reference/concepts.md)することが要求される。従って、`regular_invocable`コンセプトのモデルとなる型`F, Args...`は関数呼び出しに際して副作用を持ってはならず、出力は何かしらの状態に依存してはならない。ただし、このことは構文的に(コンパイル時に)チェックされるものではなく、純粋に意味論的な制約として要求・表明される。 +対して、`regular_invocable`コンセプトのモデルとなる`F`の`Args...`による関数呼び出しには[等しさを保持](/reference/concepts.md)することと引数を変更しないことが要求される。従って、`regular_invocable`コンセプトのモデルとなる型`F, Args...`は関数呼び出しに際して副作用を持ってはならず、出力は何かしらの状態に依存してはならない。ただし、このことは構文的に(コンパイル時に)チェックされるものではなく、純粋に意味論的な制約として要求・表明される。 例えば、[乱数・分布生成器](/reference/random.md)はその呼び出しに際して等しさを保持しない(内部に状態を保ち、出力はそれに依存する)ため、`regular_invocable`コンセプトのモデルにはならないが`invocable`コンセプトのモデルとなる。 From 5b4545770cf94c6ef9c3bc732b896065d763cfaa Mon Sep 17 00:00:00 2001 From: rotarymars Date: Tue, 23 Dec 2025 20:47:41 +0900 Subject: [PATCH 2473/3948] contracts: Adding contents(#1419) ## Sections to do - 3.4.5 Objects Passed and Returned in Registers - 3.4.6 Not Part of the Immediate Context - 3.4.7 Function-Template Specializations - 3.4.8 No Implicit Lambda Captures - 3.5.11 Mixed Mode - 3.6.1 Undefined Behavior During Contract Checking - 3.6.2 Invalid Data Member Access in Constructors and Destructors - 3.6.3 Friend Declarations Inside Templates - 3.6.4 Recursive Contract Violations - 3.6.5 Concurrent Contract Violations - 3.6.6 Throwing Violation Handlers (detailed version) - 3.6.7 Differences Between Contract Assertions and the assert Macro (complete version) --- lang/cpp26/contracts.md | 623 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 603 insertions(+), 20 deletions(-) diff --git a/lang/cpp26/contracts.md b/lang/cpp26/contracts.md index 05c1613ff7..ab3863f62c 100644 --- a/lang/cpp26/contracts.md +++ b/lang/cpp26/contracts.md @@ -18,9 +18,9 @@ C++26では、関数の正確な動作を明示的に指定でき、プログラ ## 仕様 ### キーワード -`pre`、`post`、`assert`は文脈依存キーワードである。これらは`override`や`final`と同様に、特定の文脈でのみ特別な意味を持つ。 +`pre`、`post`は文脈依存キーワードである。これらは`override`や`final`と同様に、特定の文脈でのみ特別な意味を持つ。`contract_assert`は完全なキーワードである。 -- 変数名や関数名として使用可能 +- `pre`と`post`は変数名や関数名として使用可能 ```cpp int pre = 42; // OK: 変数名として使用 void post() {} // OK: 関数名として使用 @@ -30,6 +30,12 @@ C++26では、関数の正確な動作を明示的に指定でき、プログラ void f() pre(true); // ここでは契約指定として機能 ``` +- `contract_assert`は既存の`assert`マクロとの衝突を避けるための完全なキーワード + ```cpp + void g() { + contract_assert(true); // アサーション文 + } + ``` ### 契約の種類 契約には以下の3種類が定められている。 @@ -102,60 +108,637 @@ public: #### アサーション(assert) 関数の実行中に満たされているべき条件を指定する。 ```cpp -void return_negative(int value) +int return_negative(int value) { contract_assert(value >= 0); return -value; } ``` -ここでは、`return_negative`関数のが引数として受け取っている`value`が0以上であることをアサーションとして指定している。 +ここでは、`return_negative`関数が引数として受け取っている`value`が0以上であることをアサーションとして指定している。 `contract_assert`は、関数の本体内で使用される。 また、これらの全ては、`[[ likely ]]`や`[[ unlikely ]]`、 `[[ maybe_unused ]]`属性を使用することができる。 ```cpp -void return_negative(int value) +int return_negative(int value) pre [[likely]] (value >= 0) post (r [[maybe_unused]] : r <= 0) { return -value; } ``` +### 構文上の制約 +契約プログラミングには、いくつかの構文上の制約がある。 + +#### 複数の宣言 +関数に複数の宣言がある場合、それらすべてに同じ契約指定子の並びを指定することも、一部の宣言にのみ指定することもできる。契約指定子の並びが指定されていない宣言は、他の宣言から契約アサーションを継承する。 + +```cpp +int f(int x) pre(x > 0); // 宣言 +int f(int x); // OK: 契約アサーションを継承 +int f(int x) pre(x > 0) { // OK: 定義でも同じ契約を指定 + return x * 2; +} +``` + +#### 仮想関数 +仮想関数に事前条件または事後条件の指定子を付けることは不適格(ill-formed)である。仮想関数への`pre`と`post`のサポートは、将来の拡張として提案される予定である。 + +```cpp +struct Base { + // エラー:仮想関数に契約指定子を適用できない + virtual int compute(int x) pre(x > 0) = 0; +}; +``` + +#### デフォルト化・削除された関数 +最初の宣言でデフォルト化(`= default`)された関数に事前条件または事後条件指定子を付けることは不適格(ill-formed)である。 + +```cpp +struct X { + X() pre(true) = default; // エラー: 最初の宣言でdefault化 + X(const X&) pre(true) = default; // エラー: 最初の宣言でdefault化 +}; +``` + +ただし、最初の宣言ではない宣言でデフォルト化する場合は契約指定子を付けることができる。 + +```cpp +struct Y { + Y() pre(true); // 最初の宣言に契約指定子 +}; +Y::Y() pre(true) = default; // OK: 最初の宣言ではない(pre(true)は省略可能) +``` + +また、明示的に削除(`= delete`)された関数に事前条件または事後条件指定子を付けることは不適格である。 + +```cpp +struct Z { + Z() pre(true) = delete; // エラー: 削除された関数 + Z& operator=(const Z&) pre(true) = delete; // エラー: 削除された関数 +}; +``` + +#### コンストラクタとデストラクタの制約 +コンストラクタの事前条件アサーションまたはデストラクタの事後条件アサーションの述語内で、クラスの非静的データメンバを`this->`なしで直接参照すると、プログラムは不適格となる。これは、オブジェクトの生存期間の開始前または終了後にメンバにアクセスする未定義動作のリスクを最小限に抑えるためである。 + +```cpp +struct X { + int i = 0; + bool f(); + + X() + pre(i == 0) // エラー: thisなしでメンバ参照 + pre(f()) // エラー: thisなしでメンバ関数呼び出し + pre(this->i == 0) // OK: thisを明示的に使用 + pre(this->f()) // OK + {} + + ~X() + pre(i == 0) // OK: デストラクタの事前条件 + post(i == 0) // エラー: デストラクタの事後条件でメンバ参照 + post(this->i == 0) // OK + {} +}; +``` + +#### await式とyield式 +コルーチン内の契約アサーションの述語に、そのコルーチンの中断コンテキスト内にある`await`式または`yield`式が含まれている場合、プログラムは不適格となる。 + +```cpp +std::generator f() { + contract_assert(((co_yield 1), true)); // エラー +} + +stdex::task g() { + contract_assert((co_await query_database()) > 0); // エラー +} +``` + +#### 関数へのポインタとメンバ関数へのポインタ +関数へのポインタやメンバ関数へのポインタに契約指定子を適用することはできない。 + +```cpp +typedef int (*fpt)(int) post(r: r != 0); // エラー + +int f(int x) post(r: r != 0); +int (*fp)(int) post(r: r != 0) = f; // エラー +``` + +ただし、契約アサーションは関数の型の一部ではないため、契約付きの関数のアドレスを通常の関数ポインタに代入できる。 + +```cpp +int f(int x) post(r: r != 0); +int (*fp)(int) = f; // OK +``` + +関数ポインタを通して関数を呼び出す場合でも、その関数の契約アサーションは通常通り評価される必要がある。 + +#### 関数型エイリアス +関数型エイリアスに契約指定子を適用することはできない。 + +```cpp +using ft = int(int) post(r: r != 0); // エラー +``` + +ただし、関数型エイリアスを使用する関数宣言には契約指定子を適用できる。 + +```cpp +using ft = int(int); +ft f post(r: r != 0); // OK +``` + +#### C言語の可変長引数パラメータの使用 +契約述語内で`va_start`マクロを使用すると、プログラムは不適格となる(診断不要)。 + +### 意味論 + +#### 名前探索とアクセス制御 +関数契約アサーションの述語に対する名前探索とアクセス制御のルールは、その関数の宣言の他の部分と同様に適用される。 + +- 非静的メンバ関数の宣言の一部として、`this`式が使用可能であり、関数の暗黙のオブジェクトパラメータを参照する。 +- メンバ関数の場合、述語はprivateメンバにアクセスできる。 +- 事後条件アサーションは結果バインディング(result binding)という新しい宣言をそのスコープに導入し、この名前は外側のスコープの他の名前を隠す。 + +```cpp +struct Y { + int i; +public: + void f() pre(i == 0); // OK + friend void g(Y* y) pre(y->i == 0); // OK +}; + +int r = 10; +int h() post(r : r != ::r); // OK: 結果バインディングのrは外側のrを隠す +``` + +#### 暗黙のconst性 +契約チェックは、プログラムの状態を変更するのではなく観察するものである。これを促進するために、契約述語内で参照される変数には暗黙的に`const`修飾が適用される。 + +```cpp +void f(int x) { + contract_assert(++x > 0); // エラー: xは暗黙的にconstとして扱われる +} +``` + +ただし、述語内で呼び出される関数は`constexpr`である必要はない。ロギングなどのデバッグ目的で副作用を持つ関数を呼び出すことは許可されるが、プログラムの正当性に影響を与える破壊的な副作用は避けるべきである。 + +#### 結果バインディング +事後条件の結果バインディングは、関数の戻り値オブジェクトを参照する。結果バインディングによって導入される変数は、定数(`const`)な左辺値参照である。 + +```cpp +int f(int i) + post(result: result >= i); // resultは戻り値への定数参照 +``` + +結果バインディングには、`[[maybe_unused]]`などの属性を適用できる。 + +```cpp +int g() + post(r [[maybe_unused]]: true); // OK +``` + +#### 事後条件における関数パラメータ +事後条件アサーションの述語内で関数パラメータを使用できる。ただし、配列パラメータをODR使用(One Definition Rule use)することは不適格である。 + +```cpp +int sum(int arr[], int n) + post(r: r >= 0); // OK: 配列パラメータを使用していない + +int process(int arr[], int n) + post(r: arr[0] > 0); // エラー: 配列パラメータをODR使用 +``` + ### 評価の順番 -契約式の評価順序に注意が必要である。 +契約アサーションの評価順序は以下の通りである。 + +#### 評価のタイミング +- **事前条件アサーション**: 関数パラメータの初期化後、関数本体の評価開始前に評価される。 +- **事後条件アサーション**: 戻り値の初期化後、return文によって抜けるスコープのローカル変数の破棄後、ただし**関数パラメータの破棄前**に評価される。 +- **アサーション文**: 制御フローがその文に到達した時点で実行される。 + +コンストラクタとデストラクタでの評価タイミングの詳細については、「コンストラクタとデストラクタの制約」および「レジスタで渡される・返されるオブジェクト」を参照のこと。 -事前条件は関数の引数が初期化された後に評価され、事後条件は関数の戻り値が初期化された後、ローカル変数の破棄前に評価される。この順序により、契約式は必要な変数や状態にアクセスできるようになっている。 +#### 複数の契約指定子の評価順序 +関数契約アサーションのシーケンス内に複数の事前条件または事後条件アサーションがある場合、それらは宣言された順序で評価される。 + +```cpp +void f() + pre(a()) + pre(b()) + post(c()) + post(d()) +{ + // 事前条件の評価順: a(), b() + // 事後条件の評価順: c(), d() +} +``` + +#### 戻り値のコピーとシーケンス +関数の戻り値の型がレジスタで渡される資格がある場合、コンパイラは戻り値オブジェクトの追加のトリビアルなコピーを作成することが許可されており、事後条件アサーションはそれらのコピーを参照する可能性がある。ただし、これらのコピーは事後条件アサーションの評価と順序付けられて行われなければならない。 + +したがって、すべての契約アサーションがチェックセマンティクスで正確に1回評価されるようにプログラムがビルドされている場合、以下の例では、`r`が同じオブジェクトを参照するかどうかに関わらず、両方の事後条件アサーションはtrueと評価されなければならない。 + +```cpp +int f() + post(r: ++const_cast(r) == 1) + post(r: ++const_cast(r) == 2) +{ + return 0; +} +``` + +#### 述語の評価 +契約アサーションの述語式が評価されるとき、それは`bool`に文脈的に変換される。述語式は完全式(full expression)であるため、述語の評価中に作成された一時オブジェクトは、その評価が完了したときに破棄される。 ### 契約の評価モード -契約の評価には、次の4つのモードが存在する。 +各契約アサーションの個別の評価は、特定の評価セマンティクスで実行される。提案されている4つの評価セマンティクスは以下の通りである。 -- ignore: 契約のチェックを無視(ignore)する。 +#### ignore(無視) +`ignore`セマンティクスは何も行わない。契約述語は評価されず、副作用も発生しない。これは非チェックセマンティクスである。 -- observe: 契約違反時にハンドラを呼び出し、プログラムの実行を続行する。 +#### observe(観察) +`observe`セマンティクスは述語を評価して契約違反を識別する。契約違反が発生した場合、契約違反ハンドラを呼び出す。ハンドラが正常に戻ると、プログラムの実行は続行される。これはチェックセマンティクスである。 -- enforce: 契約違反時にハンドラを呼び出し、プログラムを終了する。 +#### enforce(強制) +`enforce`セマンティクスは述語を評価して契約違反を識別する。契約違反が発生した場合、契約違反ハンドラを呼び出す。ハンドラが正常に戻ると、プログラムは実装定義の方法で終了する(通常は`std::terminate()`を呼び出すか、類似の方法)。これはチェックセマンティクスであり、終了セマンティクスでもある。 -- quick_enforce: 契約違反時にハンドラを呼び出さず、即座にプログラムを終了する。 +#### quick-enforce(高速強制) +`quick-enforce`セマンティクスは述語を評価して契約違反を識別する。契約違反が発生した場合、契約違反ハンドラを呼び出さずに、即座にプログラムを実装定義の方法で終了する。これはチェックセマンティクスであり、終了セマンティクスでもある。`quick-enforce`は、契約違反ハンドラのオーバーヘッドを避けるため、パフォーマンスが重要な状況で有用である。 -評価モードは、コンパイル時、もしくは実行時に指定できる。 +#### 評価セマンティクスの選択 +契約アサーションの個別の評価に対してどの評価セマンティクスが使用されるかを選択するメカニズムは実装定義である。コンパイル時オプション、実行時設定、またはその組み合わせで指定できる。 -GCCでは、 +GCCでの例: ```bash g++ -std=c++26 -fcontracts -fcontract-semantic=observe main.cpp ``` -のように指定できる。 + +#### 契約述語のチェック +チェックセマンティクス(`observe`、`enforce`、`quick-enforce`)では、述語が評価され、`bool`に文脈変換される。述語が`true`に評価されると、契約違反は識別されない。述語が`false`に評価されるか、述語の評価が例外で終了すると、契約違反が識別される。 + +述語の評価がスタックを通じて制御を返さない他の結果(終了、無限ループ、`longjmp`の呼び出しなど)が発生した場合、他のC++式の評価時と同様に処理される。 + +#### 省略、重複、順次評価 +実装は、契約アサーションの評価を省略、重複、または特定の順序で実行できる。ただし、副作用が正常に戻る場合にのみ省略できる。この柔軟性により、実装は最適化の機会を持つ。 + +#### 述語の副作用 +契約述語に副作用があることは推奨されないが、完全に禁止されているわけではない。述語に破壊的な副作用(プログラムの正当性に影響を与える副作用)がある場合、その動作は設計原則に違反する。ただし、ロギングやデバッグ目的の非破壊的な副作用は許可される。 + +#### 観察可能なチェックポイント +契約アサーションの評価は、観察可能なチェックポイントである。これは、コンパイラが契約アサーションの評価の前後でメモリアクセスの並べ替えを行わないことを意味する。 + +#### コルーチンのサポート +コルーチンには契約指定子を適用できる。事前条件アサーションはコルーチンの引数が初期化された後に評価され、事後条件アサーションはコルーチンが`co_return`で終了したときに評価される。 + +#### 定数評価 +契約アサーションは定数評価中にも評価できる。定数評価中、契約違反ハンドラは呼び出されない。代わりに、チェックセマンティクスで契約違反が識別されると、定数評価は失敗する。 ### 契約違反ハンドラ -契約違反が発生した場合、`std::contracts::contract_violation`型の情報(<contracts>ヘッダー)がハンドラに渡される。この情報には、違反の種類、発生場所、違反した条件式などが含まれる。 + +#### ハンドラの定義 +契約違反ハンドラは、ユーザーがリンク時にカスタム定義できる関数である。ハンドラの署名は以下の通り: + +```cpp +void handle_contract_violation(const std::contracts::contract_violation& violation); +``` + +この関数を定義することで、デフォルトの契約違反ハンドラをオーバーライドできる。 + +#### contract_violation情報 +`std::contracts::contract_violation`オブジェクトは、契約違反に関する以下の情報を提供する: + +- **違反の種類** (`assertion_kind`): 事前条件、事後条件、またはアサーション文のいずれか +- **評価セマンティクス** (`evaluation_semantic`): 違反を識別した評価セマンティクス +- **検出モード** (`detection_mode`): 契約違反がどのように検出されたか(述語が`false`に評価されたか、例外が発生したか) +- **ソースロケーション** (`location`): 違反した契約アサーションのソースファイル名、行番号、関数名 +- **終了判定** (`is_terminating`): この違反後にプログラムが終了するかどうか +- **評価例外** (`evaluation_exception`): 述語の評価中に例外が発生した場合、その例外オブジェクトへのアクセス + +#### ハンドラの動作 +契約違反が識別されると、`observe`または`enforce`セマンティクスの場合、契約違反ハンドラが呼び出される: + +1. **observeセマンティクス**: ハンドラが正常に戻ると、プログラムの実行は続行される。 +2. **enforceセマンティクス**: ハンドラが正常に戻ると、プログラムは実装定義の方法で終了する。 +3. **quick-enforceセマンティクス**: ハンドラは呼び出されず、即座にプログラムが終了する。 + +#### デフォルトハンドラ +ユーザーがカスタムハンドラを定義しない場合、実装が提供するデフォルトハンドラが使用される。デフォルトハンドラは、標準エラー出力に診断メッセージを出力することが期待される。 + +#### ハンドラ内での契約違反 +契約違反ハンドラの実行中に別の契約違反が発生した場合(再帰的契約違反)、動作は実装定義である。通常は、無限再帰を避けるために即座にプログラムを終了する。 + +#### 例外を投げるハンドラ +契約違反ハンドラから例外を投げることは許可されているが、推奨されない。ハンドラが例外で終了した場合、`std::terminate()`が呼び出される。 + +### 標準ライブラリAPI + +#### <contracts>ヘッダー +C++26では、契約プログラミングをサポートするために``ヘッダーが導入される。このヘッダーには以下の型と関数が含まれる。 + +#### 列挙型 + +##### assertion_kind +契約アサーションの種類を表す列挙型: + +```cpp +namespace std::contracts { + enum class assertion_kind { + precondition, // 事前条件アサーション + postcondition, // 事後条件アサーション + assertion // アサーション文 + }; +} +``` + +##### evaluation_semantic +契約アサーションの評価セマンティクスを表す列挙型: + +```cpp +namespace std::contracts { + enum class evaluation_semantic { + ignore, // 無視 + observe, // 観察 + enforce, // 強制 + quick_enforce // 高速強制 + }; +} +``` + +##### detection_mode +契約違反がどのように検出されたかを表す列挙型: + +```cpp +namespace std::contracts { + enum class detection_mode { + predicate_false, // 述語がfalseに評価された + evaluation_exception // 述語の評価中に例外が発生 + }; +} +``` + +#### contract_violationクラス +契約違反に関する情報を提供するクラス: + +```cpp +namespace std::contracts { + class contract_violation { + public: + assertion_kind kind() const noexcept; + evaluation_semantic semantic() const noexcept; + detection_mode detection() const noexcept; + source_location location() const noexcept; + string_view comment() const noexcept; + bool is_terminating() const noexcept; + exception_ptr evaluation_exception() const noexcept; + }; +} +``` + +主なメンバ関数: +- `kind()`: 違反した契約アサーションの種類を返す +- `semantic()`: 使用された評価セマンティクスを返す +- `detection()`: 違反の検出方法を返す +- `location()`: 契約アサーションのソースロケーションを返す +- `comment()`: ベンダー固有のコメント文字列を返す +- `is_terminating()`: 違反後にプログラムが終了するかどうかを返す +- `evaluation_exception()`: 述語の評価中に例外が発生した場合、その例外への`exception_ptr`を返す + +#### invoke_default_contract_violation_handler関数 +デフォルトの契約違反ハンドラを明示的に呼び出すための関数: + +```cpp +namespace std::contracts { + void invoke_default_contract_violation_handler( + const contract_violation& violation); +} +``` + +この関数は、カスタムハンドラ内でデフォルトの動作を呼び出したい場合に有用である。 ### 使用上の注意 -以下の操作は、気をつけなければならない。 -- 契約式内において副作用を要する式を記述した場合(グローバル変数の変更、`volatile`変数への参照、`constexpr`でない関数の呼び出しなど) -- 契約式内で例外を送出すると、std::terminate()が呼び出され、プログラムが終了する。 -- 通常の関数やメンバ関数には契約を適用できるが、特殊な関数(例えば`default`によって定義されたコピーコンストラクタやデストラクタ)には適用できない。適用すると、プログラムは不適格(ill-formed)となる。 +以下の操作には注意が必要である。 + +#### 副作用 +契約述語内で副作用を持つ式を記述することは可能だが、推奨されない。破壊的な副作用(グローバル変数の変更、`volatile`変数への参照など)は避けるべきである。ただし、ロギングなどの非破壊的な副作用は許可される。 + +```cpp +// 推奨されない例 +int global_counter = 0; +void f(int x) pre(++global_counter > 0); // 副作用あり + +// 許容される例(デバッグ目的) +void g(int x) pre(log_value(x), x > 0); // ロギングは許容 +``` + +#### 例外 +契約述語内で例外が送出されると、契約違反として扱われる。`observe`または`enforce`セマンティクスの場合、契約違反ハンドラが呼び出され、その後の動作はセマンティクスに依存する。 + +```cpp +bool might_throw(int x); + +void f(int x) pre(might_throw(x)); // 例外発生時は契約違反 +``` + +#### 特殊メンバ関数 +`= default`または`= delete`で定義された特殊メンバ関数に契約指定子を適用すると、プログラムは不適格となる。通常のコンストラクタ、デストラクタ、およびメンバ関数には契約を適用できる。 + +#### assert マクロとの違い +契約プログラミング機能と従来の`assert`マクロには以下の違いがある: + +- **キーワード vs マクロ**: `contract_assert`はキーワードであり、`assert`はマクロである +- **評価制御**: 契約の評価セマンティクスは実装定義の方法で選択されるが、`assert`は`NDEBUG`マクロの有無で制御される +- **事後条件**: 契約プログラミングは事後条件を簡潔に記述できるが、`assert`マクロでは困難 +- **標準化**: 契約プログラミングはC++標準の一部であり、`assert`はCから継承されたマクロである + +## 例 + +### 基本的な使用例 + +```cpp example +#include +#include + +// 事前条件と事後条件を持つ関数 +int safe_division(int numerator, int denominator) + pre(denominator != 0) + post(result: result * denominator == numerator) +{ + return numerator / denominator; +} + +// 複数の契約条件 +class BankAccount { + double balance = 0.0; + +public: + void deposit(double amount) + pre(amount > 0) + post(balance >= old_balance) // 注: old値の参照はC++26では未サポート + { + balance += amount; + } + + void withdraw(double amount) + pre(amount > 0) + pre(amount <= balance) // 複数の事前条件 + post(balance >= 0) + { + contract_assert(balance >= amount); // アサーション文 + balance -= amount; + } + + double get_balance() const + post(result: result >= 0) + { + return balance; + } +}; + +// ラムダ式での使用 +auto lambda_with_contract = [](int x) + pre(x > 0) + post(r: r > x) +{ + return x + 1; +}; + +int main() { + // 正常な使用 + int result = safe_division(10, 2); // OK: result = 5 + std::cout << result << '\n'; + + BankAccount account; + account.deposit(100.0); // OK + account.withdraw(50.0); // OK + + // 契約違反の例(実行時に検出される) + // safe_division(10, 0); // 事前条件違反 + // account.withdraw(200.0); // 事前条件違反 + + auto value = lambda_with_contract(5); // OK: value = 6 + + return 0; +} +``` + +### カスタム契約違反ハンドラの例 + +```cpp example +#include +#include +#include + +// カスタム契約違反ハンドラの定義 +void handle_contract_violation(const std::contracts::contract_violation& v) { + std::cerr << "契約違反が発生しました:\n"; + std::cerr << " 種類: "; + switch (v.kind()) { + case std::contracts::assertion_kind::precondition: + std::cerr << "事前条件\n"; + break; + case std::contracts::assertion_kind::postcondition: + std::cerr << "事後条件\n"; + break; + case std::contracts::assertion_kind::assertion: + std::cerr << "アサーション\n"; + break; + } + + std::cerr << " 場所: " << v.location().file_name() + << ":" << v.location().line() << '\n'; + std::cerr << " 関数: " << v.location().function_name() << '\n'; + + if (v.is_terminating()) { + std::cerr << "プログラムを終了します。\n"; + } + + // デフォルトハンドラも呼び出す + std::contracts::invoke_default_contract_violation_handler(v); +} + +int process(int x) + pre(x > 0) + post(r: r > x) +{ + return x + 1; +} + +int main() { + // 契約違反が発生すると、カスタムハンドラが呼び出される + // process(-1); // 事前条件違反 + + return 0; +} +``` + +### テンプレート関数での使用例 + +```cpp example +#include +#include +#include + +template +T increment(T value) + pre(value < std::numeric_limits::max()) + post(result: result == value + 1) +{ + return value + 1; +} + +template +class Stack { + std::vector data; + +public: + void push(const T& item) + post(size() == old_size + 1) // 注: old値の参照はC++26では未サポート + { + data.push_back(item); + } + + T pop() + pre(!empty()) + post(size() == old_size - 1) // 注: old値の参照はC++26では未サポート + { + T value = data.back(); + data.pop_back(); + return value; + } + + bool empty() const + post(result: result == (size() == 0)) + { + return data.empty(); + } + + std::size_t size() const + post(result: result <= data.capacity()) + { + return data.size(); + } +}; + +int main() { + auto value = increment(42); // OK + + Stack stack; + stack.push(10); + stack.push(20); + int top = stack.pop(); // OK: top = 20 + + return 0; +} +``` ## 関連項目 - [C++ 将来 契約に基づくプログラミング](/lang/future/contract-based_programming.md) +- [``ヘッダー](/reference/contracts.md) +- [`std::contracts::contract_violation`](/reference/contracts/contract_violation.md) +- [`std::contracts::assertion_kind`](/reference/contracts/assertion_kind.md) +- [`std::contracts::evaluation_semantic`](/reference/contracts/evaluation_semantic.md) +- [`std::contracts::detection_mode`](/reference/contracts/detection_mode.md) ## 参照 From e42919d3aca6a44a997591dffd1482e83c20d8f8 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Tue, 23 Dec 2025 21:07:41 +0900 Subject: [PATCH 2474/3948] standardizing to `const T& v` type declaration --- lang/cpp11/defaulted_and_deleted_functions.md | 2 +- .../cpp26/allowing_exception_throwing_in_constant-evaluation.md | 2 +- lang/cpp26/constexpr_cast_from_voidptr.md | 2 +- reference/map/map/at.md | 2 +- reference/set/multiset/extract.md | 2 +- reference/set/set/extract.md | 2 +- reference/tuple/ignore.md | 2 +- reference/unordered_map/unordered_map/at.md | 2 +- reference/unordered_set/unordered_multiset/extract.md | 2 +- reference/unordered_set/unordered_set/extract.md | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lang/cpp11/defaulted_and_deleted_functions.md b/lang/cpp11/defaulted_and_deleted_functions.md index 2d2455d3e8..d9777233ed 100644 --- a/lang/cpp11/defaulted_and_deleted_functions.md +++ b/lang/cpp11/defaulted_and_deleted_functions.md @@ -89,7 +89,7 @@ int main() sometype(); // デフォルト動作のコピーコンストラクタを使用する - sometype(const sometype &) = default; + sometype(const sometype&) = default; // デフォルト動作のデストラクタを使用する。 // ただし、このデストラクタは仮想関数とする。 diff --git a/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md b/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md index bf8b7f3c7c..d57fc92d18 100644 --- a/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md +++ b/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md @@ -28,7 +28,7 @@ const auto b = hello("Hana"); try { const auto c = hello(""); // C++26: 例外を捕捉 -} catch (const validation_error &) { +} catch (const validation_error&) { // everything is fine } diff --git a/lang/cpp26/constexpr_cast_from_voidptr.md b/lang/cpp26/constexpr_cast_from_voidptr.md index 21d55886b9..0b4f7ce91c 100644 --- a/lang/cpp26/constexpr_cast_from_voidptr.md +++ b/lang/cpp26/constexpr_cast_from_voidptr.md @@ -34,7 +34,7 @@ private: std::string_view (*speak_function)(const void*); public: template - constexpr AnimalView(const Animal &a) + constexpr AnimalView(const Animal& a) : animal{&a}, speak_function{[](const void* object) { return static_cast(object)->speak(); }} diff --git a/reference/map/map/at.md b/reference/map/map/at.md index dd0782d6ad..981838d6f1 100644 --- a/reference/map/map/at.md +++ b/reference/map/map/at.md @@ -7,7 +7,7 @@ ```cpp T& at(const key_type& x); // (1) C++11 -const T& at(const key_type & x) const; // (2) C++11 +const T& at(const key_type& x) const; // (2) C++11 template T& at(const K& x); // (3) C++26 diff --git a/reference/set/multiset/extract.md b/reference/set/multiset/extract.md index 9187b14ec1..35a130f573 100644 --- a/reference/set/multiset/extract.md +++ b/reference/set/multiset/extract.md @@ -56,7 +56,7 @@ struct my_struct // ムーブオンリーな型 int num = 0; static inline int count = 0; constexpr my_struct(int i) noexcept : value(i) { num = count++; }; - bool operator < (const my_struct &rhs) const noexcept {return this->value < rhs.value;} + bool operator < (const my_struct& rhs) const noexcept {return this->value < rhs.value;} }; int main() diff --git a/reference/set/set/extract.md b/reference/set/set/extract.md index 3637b42674..c045064d74 100644 --- a/reference/set/set/extract.md +++ b/reference/set/set/extract.md @@ -54,7 +54,7 @@ struct my_struct // ムーブオンリーな型 : private noncopyable { int value; constexpr explicit my_struct(int i) noexcept : value(i) {}; - bool operator < (const my_struct &rhs) const noexcept {return this->value < rhs.value;} + bool operator < (const my_struct& rhs) const noexcept {return this->value < rhs.value;} }; int main() diff --git a/reference/tuple/ignore.md b/reference/tuple/ignore.md index 8d3d8a3bcd..baf5f77dcb 100644 --- a/reference/tuple/ignore.md +++ b/reference/tuple/ignore.md @@ -8,7 +8,7 @@ namespace std { struct ignore-type { // 説明用の定義 (C++26) constexpr const ignore-type& - operator=(const auto &) const noexcept + operator=(const auto&) const noexcept { return *this; } }; diff --git a/reference/unordered_map/unordered_map/at.md b/reference/unordered_map/unordered_map/at.md index aa49034fdb..abe0c2d105 100644 --- a/reference/unordered_map/unordered_map/at.md +++ b/reference/unordered_map/unordered_map/at.md @@ -7,7 +7,7 @@ ```cpp T& at(const key_type& x); // (1) C++11 -const T& at(const key_type & x) const; // (2) C++11 +const T& at(const key_type& x) const; // (2) C++11 template T& at(const K& x); // (3) C++26 diff --git a/reference/unordered_set/unordered_multiset/extract.md b/reference/unordered_set/unordered_multiset/extract.md index 8d97b5ae85..d6de3b38a6 100644 --- a/reference/unordered_set/unordered_multiset/extract.md +++ b/reference/unordered_set/unordered_multiset/extract.md @@ -47,7 +47,7 @@ struct my_struct // ムーブオンリーな型 int num = 0; static inline int count = 0; constexpr my_struct(int i) noexcept : value(i) { num = count++; }; - bool operator == (const my_struct &rhs) const noexcept {return this->value == rhs.value;} + bool operator == (const my_struct& rhs) const noexcept {return this->value == rhs.value;} }; // ハッシュ関数 diff --git a/reference/unordered_set/unordered_set/extract.md b/reference/unordered_set/unordered_set/extract.md index 344fbaee9b..0bb7afefca 100644 --- a/reference/unordered_set/unordered_set/extract.md +++ b/reference/unordered_set/unordered_set/extract.md @@ -47,7 +47,7 @@ struct my_struct // ムーブオンリーな型 int num = 0; static inline int count = 0; constexpr my_struct(int i) noexcept : value(i) { num = count++; }; - bool operator == (const my_struct &rhs) const noexcept {return this->value == rhs.value;} + bool operator == (const my_struct& rhs) const noexcept {return this->value == rhs.value;} }; // ハッシュ関数 From 2587ab070f8da4eb9cfe7231b665d7664370aaf3 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 26 Dec 2025 17:14:06 +0900 Subject: [PATCH 2475/3948] updating library page for contracts(#1419) --- reference/contracts.md | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/reference/contracts.md b/reference/contracts.md index 388207bb0d..e04cca50fc 100644 --- a/reference/contracts.md +++ b/reference/contracts.md @@ -7,28 +7,50 @@ 契約プログラミングは、関数やクラスの前提条件、事後条件、およびアサーションを明示的に指定するプログラミング手法である。これらの条件が満たされない場合、プログラムは契約違反を報告する。 +このヘッダで提供される機能は、ユーザー定義の契約違反ハンドラ(`handle_contract_violation`関数)を記述するために使用することを主な目的としており、契約アサーション(`pre`、`post`、`contract_assert`)を記述するためにこのヘッダをインクルードする必要はない。 + +このヘッダのすべての宣言は名前空間`std::contracts`に属する。 + +## 列挙型 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`assertion_kind`](contracts/assertion_kind.md) | 契約アサーションの種類(enum) | C++26 | +| [`evaluation_semantic`](contracts/evaluation_semantic.md) | 契約アサーションの評価セマンティクス(enum) | C++26 | +| [`detection_mode`](contracts/detection_mode.md) | 契約違反の検出方法(enum) | C++26 | + +## クラス | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`assertion_kind`](contracts/assertion_kind.md) | アサーションの種類 (enum) | C++26 | -| [`evaluation_semantic`](contracts/evaluation_semantic.md) | アサーションの評価の種類(enum) | C++26 | -| [`detection_mode`](contracts/detection_mode.md) | 契約違反の検出モード(enum) | C++26 | | [`contract_violation`](contracts/contract_violation.md) | 契約違反に関する情報 (class) | C++26 | -| [`invoke_default_contract_violation_handler`](contracts/invoke_default_contract_violation_handler.md) | デフォルトcontract_violationハンドラー | C++26 | + +## 関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`invoke_default_contract_violation_handler`](contracts/invoke_default_contract_violation_handler.md) | デフォルトの契約違反ハンドラを呼び出す(function) | C++26 | + +## 機能テストマクロ + +| マクロ名 | 値 | 説明 | 対応バージョン | +|----------|-----|------|----------------| +| `__cpp_lib_contracts` | ??? | ``ヘッダが利用可能かを検出する | C++26 | + +言語機能(`pre`、`post`、`contract_assert`構文)の検出には`__cpp_contracts`マクロを使用する。ライブラリと言語機能は異なるベンダーから提供される可能性があるため、別々のマクロが用意されている。 ## バージョン ### 言語 - C++26 ### 処理系 -- [Clang](/implementation.md#clang): ? -- [GCC](/implementation.md#gcc): ? -- [ICC](/implementation.md#icc): ? -- [Visual C++](/implementation.md#visual_cpp): ? +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? ## 関連項目 - [契約に基づくプログラミング](/lang/future/contract-based_programming.md) - [契約プログラミング](/lang/cpp26/contracts.md) ## 参照 -- [P0542R5 Support for contract based programming in C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0542r5.html) +- [P2900R14 Contracts for C++](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2900r14.pdf) From 062f6d8fe66d3735f9559bd5383ae0f0007b60a0 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 26 Dec 2025 18:09:21 +0900 Subject: [PATCH 2476/3948] new info in evaluation_semantic.md(#1419) --- reference/contracts/evaluation_semantic.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/reference/contracts/evaluation_semantic.md b/reference/contracts/evaluation_semantic.md index de7316cd52..9a2a31956d 100644 --- a/reference/contracts/evaluation_semantic.md +++ b/reference/contracts/evaluation_semantic.md @@ -19,6 +19,17 @@ namespace std::contracts { ## 概要 契約違反をどのように評価するかを表す列挙型。 +これの他に、処理系定義のものを定めてもよい。 + +### 列挙子 + +| 列挙子 | 値 | 説明 | +|--------|-----|------| +| `ignore` | 1 | 述語を評価しない | +| `observe` | 2 | 述語を評価し、違反時にハンドラを呼ぶが、実行を継続する | +| `enforce` | 3 | 述語を評価し、違反時にハンドラを呼び、その後プログラムを終了する | +| `quick_enforce` | 4 | 述語を評価し、違反時にハンドラを呼ばずにプログラムを終了する | + ## バージョン ### 言語 - C++26 @@ -34,4 +45,4 @@ namespace std::contracts { - [契約プログラミング](/lang/cpp26/contracts.md) ## 参照 -- [P0542R5 Support for contract based programming in C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0542r5.html) +- [P2900R14 Contracts for C++](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2900r14.pdf) From cf0bc4e9eb436750a109a4a1f064aa999e6c79dc Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 26 Dec 2025 18:09:46 +0900 Subject: [PATCH 2477/3948] fixing doc links(#1419) --- reference/contracts/assertion_kind.md | 2 +- reference/contracts/detection_mode.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/contracts/assertion_kind.md b/reference/contracts/assertion_kind.md index 8b4d2768d5..0b0d620bf8 100644 --- a/reference/contracts/assertion_kind.md +++ b/reference/contracts/assertion_kind.md @@ -34,4 +34,4 @@ namespace std::contracts { - [契約プログラミング](/lang/cpp26/contracts.md) ## 参照 -- [P0542R5 Support for contract based programming in C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0542r5.html) +- [P2900R14 Contracts for C++](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2900r14.pdf) diff --git a/reference/contracts/detection_mode.md b/reference/contracts/detection_mode.md index 42cb2b8dcb..6abb059d3b 100644 --- a/reference/contracts/detection_mode.md +++ b/reference/contracts/detection_mode.md @@ -37,4 +37,4 @@ namespace std::contracts { - [契約プログラミング](/lang/cpp26/contracts.md) ## 参照 -- [P0542R5 Support for contract based programming in C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0542r5.html) +- [P2900R14 Contracts for C++](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2900r14.pdf) From 7f5682bb2ac39df43c03ba57243b70f2c499ecdd Mon Sep 17 00:00:00 2001 From: rotarymars Date: Fri, 26 Dec 2025 18:09:53 +0900 Subject: [PATCH 2478/3948] fixing enum --- reference/contracts/assertion_kind.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/contracts/assertion_kind.md b/reference/contracts/assertion_kind.md index 0b0d620bf8..db9485d85b 100644 --- a/reference/contracts/assertion_kind.md +++ b/reference/contracts/assertion_kind.md @@ -9,7 +9,7 @@ namespace std::contracts { enum class assertion_kind : unspecified { pre = 1, post = 2, - assertion = 3 + assert = 3 }; } ``` From 512662f7c1b7aef747793e35ad6b216a7a0df47d Mon Sep 17 00:00:00 2001 From: Akiko Kawai Date: Fri, 26 Dec 2025 20:05:59 +0900 Subject: [PATCH 2479/3948] Updated C++20 implementation status for Clang --- implementation-status.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/implementation-status.md b/implementation-status.md index 33d7e86050..05db2b5d70 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -171,18 +171,18 @@ | P0428R2: [ジェネリックラムダのテンプレート構文](/lang/cpp20/familiar_template_syntax_for_generic_lambdas.md) | ジェネリックラムダでテンプレートパラメータを定義できるようにする | 8 | 9.0 | 2021.4 | 2019 Update 2 | | P0704R1: [`const`修飾されたメンバポインタの制限を修正](/lang/cpp20/fixing_const_qualified_pointers_to_members.md) | `.*`演算子での左辺値の`const`メンバ関数呼び出しを許可する | 8 | 6.0 | 2021.4 | 2015 | | P0306R4: [可変引数が空でない場合のトークン置換](/lang/cpp20/va_opt.md) | プリプロセッサの置換で可変引数が空の場合に余計なカンマが付いてしまう問題に対処 | 8 (partial, `#__VA_OPT__`による文字列化が未サポート) | 6.0
9.0 ([p1042](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1042r1.html)) | 2021.4 | 2019 Update 5 | -| P0329R4: [指示付き初期化](/lang/cpp20/designated_initialization.md) | 波カッコによる集成体初期化でメンバ名を指定して初期化できるようにする | 8 | 6.0 (partial) | 2021.4 | 2019 Update 1 | -| P0734R0: [コンセプト](/lang/cpp20/concepts.md) | テンプレートパラメータに対する制約を行う | 10 | 10.0 (partial) | 2021.6 | 2019 Update 3 | +| P0329R4: [指示付き初期化](/lang/cpp20/designated_initialization.md) | 波カッコによる集成体初期化でメンバ名を指定して初期化できるようにする | 8 | 6.0 (partial)
10 | 2021.4 | 2019 Update 1 | +| P0734R0: [コンセプト](/lang/cpp20/concepts.md) | テンプレートパラメータに対する制約を行う | 10 | 10 | 2021.6 | 2019 Update 3 | | P0614R1: [初期化式をともなう範囲for文](/lang/cpp20/range-based_for_statements_with_initializer.md) | 範囲for文スコープで使用する変数の初期化のための構文を追加 | 9 | 8.0 | 2021.7 | 2019 Update 5 | | P0588R1: [暗黙のラムダキャプチャを簡略化](/lang/cpp20/simplifying_implicit_lambda_capture.md) | ラムダ式のキャプチャに関する仕様整理 | 8 | No | 2021.4 | 2019 Update 4 | | P0846R0: [関数テンプレートに明示的に型指定した場合にADLで見つからない問題を修正](/lang/cpp20/adl_and_function_templates_that_are_not_visible.md) | 名前空間内の関数テンプレートをテンプレート引数指定かつ非修飾・ADLで正しく呼び出せるよう修正 | 9 | 9.0 | 2021.4 | 2019 Update 1 | | P0641R2: [デフォルトのコピーコンストラクタと非`const`なコンストラクタが衝突する問題を修正](/lang/cpp20/resolving_const_mismatch_with_defaulted_copy_constructor.md) | 非`const`なオブジェクトをとるコンストラクタを定義すると、そのクラスをラップしたクラスのコピーコンストラクタが不適格になってしまう問題を修正 | 9 | 8.0 | 2021.4 | 2015 | | P0859R0: [評価されない文脈での定数式評価によって特殊メンバ関数がインスタンス化されることを規定](/lang/cpp20/less_eager_instantiation_of_constexpr_functions.md) | `sizeof`や`decltype`などの評価されない文脈において定数式評価を行った場合に、ムーブコンストラクタのような特殊メンバ関数が定義されることを規定 | 9 | 8 | | Partial in 2019 Update 7 | -| P0515R3: [`<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) | 三方比較演算子によって比較演算子の自動生成を行うようにする | 10 | 8.0 (partial) | 2021.4 | 2019 | -| P0692R1: [特殊化のアクセスチェック](/lang/cpp20/access_checking_on_specializations.md) | | Yes | partial | 2021.4 | 2019 Update 6 | +| P0515R3: [`<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) | 三方比較演算子によって比較演算子の自動生成を行うようにする | 10 | 8.0 (partial)
10 | 2021.4 | 2019 | +| P0692R1: [特殊化のアクセスチェック](/lang/cpp20/access_checking_on_specializations.md) | | Yes | 14 | 2021.4 | 2019 Update 6 | | P0624R2: [状態を持たないラムダ式を、デフォルト構築可能、代入可能とする](/lang/cpp20/default_constructible_and_assignable_stateless_lambdas.md) | キャプチャしていないラムダ式をデフォルト構築・代入可能にする | 9 | 8.0 | 2021.4 | 2019 Update 2 | | P0767R1: [PODを非推奨化](/lang/cpp20/deprecate_pod.md) | PODという用語を非推奨化する | | | 2021.4 | 2019 Update 5 | -| P0315R4: [評価されない文脈でのラムダ式](/lang/cpp20/wording_for_lambdas_in_unevaluated_contexts.md) | 評価されない文脈でもラムダ式を書くことができるようにする | 9 | Partial | 2024.0 | 2019 Update 8 | +| P0315R4: [評価されない文脈でのラムダ式](/lang/cpp20/wording_for_lambdas_in_unevaluated_contexts.md) | 評価されない文脈でもラムダ式を書くことができるようにする | 9 | 17 | 2024.0 | 2019 Update 8 | | P0840R2: [空オブジェクトを言語サポート](/lang/cpp20/language_support_for_empty_objects.md) | `[[no_unique_address]]`属性を導入し、空の型のオブジェクトをほかのオブジェクトと共有する最適化を許可する | 9 | 9.0 | 2021.4 | 2019 Update 9 †1 | | P0962R1: [範囲for文がカスタマイゼーションポイントを見つけるルールを緩和](/lang/cpp20/relaxing_the_range_for_loop_customization_point_finding_rules.md) | `begin()`/`end()`メンバ関数のどちらかが見つからなかった場合に非メンバ関数の`begin()`/`end()`を探しにいく | 8 | 8 | 2021.4 | 2019 Update 5 | | P0969R0: [friend指定された関数内から構造化束縛を使用して非公開メンバ変数にアクセスすることを許可](/lang/cpp20/allow_structured_bindings_to_accessible_members.md) | 構造化束縛の仕様として公開メンバ変数のみを取り出せるようになっていたが、friend指定された関数からは非公開メンバ変数にもアクセスできるようにする | 8 | 8.0 | 2021.4 | 2019 | @@ -191,7 +191,7 @@ | P0780R2: [ラムダ式の初期化キャプチャでのパック展開を許可](/lang/cpp20/allow_pack_expansion_in_lambda_init_capture.md) | `[...args = std::move(args)]`のようなキャプチャを許可 | 9
10 | 9.0 | 2021.7 | 2019 Update 2 | | P0479R5: [確率が高い分岐と低い分岐を伝える属性 `[[likely]]`, `[[unlikely]]`](/lang/cpp20/likely_and_unlikely_attributes.md) | 条件分岐の最適化ヒントを与える属性 | 9 (partial, `switch` 文のみ可能)
10 | 12.0 | 2021.7 | 2019 Update 6 | | P0929R2: [抽象型のチェック](/lang/cpp20/checking_for_abstract_class_types.md) | 関数の宣言段階では、パラメータおよび戻り値型が抽象型かどうかをチェックしないようにする | 11 | | | 2019 Update 5 | -| P0732R2: [非型テンプレートパラメータとしてクラス型を許可する](/lang/cpp20/class_types_in_non-type_template_parameters.md) | 定数式として使用できる型を広く非型テンプレートパラメータとして使用できるようにする | 9 | partial | 2022.2 Partial | 2019 Update 6 | +| P0732R2: [非型テンプレートパラメータとしてクラス型を許可する](/lang/cpp20/class_types_in_non-type_template_parameters.md) | 定数式として使用できる型を広く非型テンプレートパラメータとして使用できるようにする | 9 | 12 | 2022.2 Partial | 2019 Update 6 | | P0722R3: [可変長データを扱うクラスの効率的な`delete`](/lang/cpp20/efficient_sized_delete_for_variable_sized_classes.md) | クラスの`delete`演算子が呼び出される前にデストラクタが呼ばれないようにするオプションを追加 | 9 | 6.0 | 2023.0 | 2019 Update 7 | | P1064R0: [定数式からの仮想関数の呼び出しを許可](/lang/cpp20/allow_virtual_function_calls_in_constant_expressions.md) | 仮想関数に`constexpr`を付けられない制限を解除 | 9 | 9.0 | 2021.4 | 2019 Update 9 | | P1327R1: [定数式での`dynamic_cast`、多態的な`typeid`を許可](/lang/cpp20/allowing_dynamic_cast_polymorphic_typeid_in_constant_expressions.md) | 定数式での動的多態を許可 | 10 | 9.0 | 2021.4 | 2019 Update 9 | From 2898e8219ebb983fc071b3ea4e47e346bd91a624 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 26 Dec 2025 22:23:18 +0900 Subject: [PATCH 2480/3948] =?UTF-8?q?=E6=94=B9=E8=A1=8C=E3=81=AEHTML?= =?UTF-8?q?=E3=82=BF=E3=82=B0=E3=82=92=E4=BF=AE=E6=AD=A3=20(ngword=20check?= =?UTF-8?q?=E3=81=AECI=E3=81=AB=E5=BC=95=E3=81=A3=E3=81=8B=E3=81=8B?= =?UTF-8?q?=E3=81=A3=E3=81=A6=E3=81=9F)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/implementation-status.md b/implementation-status.md index 05db2b5d70..85d52055d3 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -171,14 +171,14 @@ | P0428R2: [ジェネリックラムダのテンプレート構文](/lang/cpp20/familiar_template_syntax_for_generic_lambdas.md) | ジェネリックラムダでテンプレートパラメータを定義できるようにする | 8 | 9.0 | 2021.4 | 2019 Update 2 | | P0704R1: [`const`修飾されたメンバポインタの制限を修正](/lang/cpp20/fixing_const_qualified_pointers_to_members.md) | `.*`演算子での左辺値の`const`メンバ関数呼び出しを許可する | 8 | 6.0 | 2021.4 | 2015 | | P0306R4: [可変引数が空でない場合のトークン置換](/lang/cpp20/va_opt.md) | プリプロセッサの置換で可変引数が空の場合に余計なカンマが付いてしまう問題に対処 | 8 (partial, `#__VA_OPT__`による文字列化が未サポート) | 6.0
9.0 ([p1042](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1042r1.html)) | 2021.4 | 2019 Update 5 | -| P0329R4: [指示付き初期化](/lang/cpp20/designated_initialization.md) | 波カッコによる集成体初期化でメンバ名を指定して初期化できるようにする | 8 | 6.0 (partial)
10 | 2021.4 | 2019 Update 1 | +| P0329R4: [指示付き初期化](/lang/cpp20/designated_initialization.md) | 波カッコによる集成体初期化でメンバ名を指定して初期化できるようにする | 8 | 6.0 (partial)
10 | 2021.4 | 2019 Update 1 | | P0734R0: [コンセプト](/lang/cpp20/concepts.md) | テンプレートパラメータに対する制約を行う | 10 | 10 | 2021.6 | 2019 Update 3 | | P0614R1: [初期化式をともなう範囲for文](/lang/cpp20/range-based_for_statements_with_initializer.md) | 範囲for文スコープで使用する変数の初期化のための構文を追加 | 9 | 8.0 | 2021.7 | 2019 Update 5 | | P0588R1: [暗黙のラムダキャプチャを簡略化](/lang/cpp20/simplifying_implicit_lambda_capture.md) | ラムダ式のキャプチャに関する仕様整理 | 8 | No | 2021.4 | 2019 Update 4 | | P0846R0: [関数テンプレートに明示的に型指定した場合にADLで見つからない問題を修正](/lang/cpp20/adl_and_function_templates_that_are_not_visible.md) | 名前空間内の関数テンプレートをテンプレート引数指定かつ非修飾・ADLで正しく呼び出せるよう修正 | 9 | 9.0 | 2021.4 | 2019 Update 1 | | P0641R2: [デフォルトのコピーコンストラクタと非`const`なコンストラクタが衝突する問題を修正](/lang/cpp20/resolving_const_mismatch_with_defaulted_copy_constructor.md) | 非`const`なオブジェクトをとるコンストラクタを定義すると、そのクラスをラップしたクラスのコピーコンストラクタが不適格になってしまう問題を修正 | 9 | 8.0 | 2021.4 | 2015 | | P0859R0: [評価されない文脈での定数式評価によって特殊メンバ関数がインスタンス化されることを規定](/lang/cpp20/less_eager_instantiation_of_constexpr_functions.md) | `sizeof`や`decltype`などの評価されない文脈において定数式評価を行った場合に、ムーブコンストラクタのような特殊メンバ関数が定義されることを規定 | 9 | 8 | | Partial in 2019 Update 7 | -| P0515R3: [`<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) | 三方比較演算子によって比較演算子の自動生成を行うようにする | 10 | 8.0 (partial)
10 | 2021.4 | 2019 | +| P0515R3: [`<=>`/`==`による比較演算子の自動定義](/lang/cpp20/consistent_comparison.md) | 三方比較演算子によって比較演算子の自動生成を行うようにする | 10 | 8.0 (partial)
10 | 2021.4 | 2019 | | P0692R1: [特殊化のアクセスチェック](/lang/cpp20/access_checking_on_specializations.md) | | Yes | 14 | 2021.4 | 2019 Update 6 | | P0624R2: [状態を持たないラムダ式を、デフォルト構築可能、代入可能とする](/lang/cpp20/default_constructible_and_assignable_stateless_lambdas.md) | キャプチャしていないラムダ式をデフォルト構築・代入可能にする | 9 | 8.0 | 2021.4 | 2019 Update 2 | | P0767R1: [PODを非推奨化](/lang/cpp20/deprecate_pod.md) | PODという用語を非推奨化する | | | 2021.4 | 2019 Update 5 | From 1bbb38fad62dc36577bb8e3fa55dc5f6ca9ed72c Mon Sep 17 00:00:00 2001 From: suomesta Date: Sat, 3 Jan 2026 11:55:23 +0900 Subject: [PATCH 2481/3948] fix swap()s in --- reference/sstream/basic_istringstream/swap.md | 8 +------- reference/sstream/basic_ostringstream/swap.md | 8 +------- reference/sstream/basic_stringbuf/swap.md | 7 ++++--- reference/sstream/basic_stringbuf/swap_free.md | 6 +++++- reference/sstream/basic_stringstream/swap.md | 6 +----- 5 files changed, 12 insertions(+), 23 deletions(-) diff --git a/reference/sstream/basic_istringstream/swap.md b/reference/sstream/basic_istringstream/swap.md index 69cb5cb0bb..216db52437 100644 --- a/reference/sstream/basic_istringstream/swap.md +++ b/reference/sstream/basic_istringstream/swap.md @@ -6,8 +6,7 @@ * cpp11[meta cpp] ```cpp -void swap(basic_istringstream& rhs); // (1) C++11 -void swap(basic_istringstream& rhs) noexcept(see below); // (1) C++17 +void swap(basic_istringstream& rhs); ``` ## 概要 @@ -16,11 +15,6 @@ void swap(basic_istringstream& rhs) noexcept(see below); // (1) C++17 ## 効果 `basic_istream::swap(rhs)`を呼び出し、`sb.swap(rhs.sb)`を実行する。ここで`sb`は内部の`basic_stringbuf`オブジェクトである。 - -## 例外 -- C++17 : 実装が例外を投げない場合、この関数は`noexcept`が指定される。 - - ## 例 ```cpp example #include diff --git a/reference/sstream/basic_ostringstream/swap.md b/reference/sstream/basic_ostringstream/swap.md index 047f1d44b2..48ab7fc621 100644 --- a/reference/sstream/basic_ostringstream/swap.md +++ b/reference/sstream/basic_ostringstream/swap.md @@ -6,8 +6,7 @@ * cpp11[meta cpp] ```cpp -void swap(basic_ostringstream& rhs); // (1) C++11 -void swap(basic_ostringstream& rhs) noexcept(see below); // (1) C++17 +void swap(basic_ostringstream& rhs); ``` ## 概要 @@ -16,11 +15,6 @@ void swap(basic_ostringstream& rhs) noexcept(see below); // (1) C++17 ## 効果 `basic_ostream::swap(rhs)`を呼び出し、`sb.swap(rhs.sb)`を実行する。ここで`sb`は内部の`basic_stringbuf`オブジェクトである。 - -## 例外 -- C++17 : 実装が例外を投げない場合、この関数は`noexcept`が指定される。 - - ## 例 ```cpp example #include diff --git a/reference/sstream/basic_stringbuf/swap.md b/reference/sstream/basic_stringbuf/swap.md index 2fefdcd330..f5a1cf32bc 100644 --- a/reference/sstream/basic_stringbuf/swap.md +++ b/reference/sstream/basic_stringbuf/swap.md @@ -6,8 +6,9 @@ * cpp11[meta cpp] ```cpp -void swap(basic_stringbuf& rhs); // (1) C++11 -void swap(basic_stringbuf& rhs) noexcept(see below); // (1) C++17 +void swap(basic_stringbuf& rhs); // (1) C++11 + +void swap(basic_stringbuf& rhs) noexcept(see below); // (1) C++20 ``` ## 概要 @@ -17,7 +18,7 @@ void swap(basic_stringbuf& rhs) noexcept(see below); // (1) C++17 `basic_streambuf::swap(rhs)`を呼び出し、`mode`と内部の文字列バッファを`rhs`と交換する。 ## 例外 -- C++17 : 実装が例外を投げない場合、この関数は`noexcept`が指定される。 +- C++20 : `noexcept(see below)` の `see below` は以下と等価である `allocator_­traits​::​propagate_­on_­container_­swap​::​value || allocator_­traits​::​is_­always_­equal​::​value`。 ## 例 ```cpp example diff --git a/reference/sstream/basic_stringbuf/swap_free.md b/reference/sstream/basic_stringbuf/swap_free.md index 5362498679..1a647c7305 100644 --- a/reference/sstream/basic_stringbuf/swap_free.md +++ b/reference/sstream/basic_stringbuf/swap_free.md @@ -8,7 +8,11 @@ namespace std { template void swap(basic_stringbuf& x, - basic_stringbuf& y); + basic_stringbuf& y); // (1) C++11 + + template + void swap(basic_stringbuf& x, + basic_stringbuf& y) noexcept(noexcept(x.swap(y))); // (1) C++20 } ``` diff --git a/reference/sstream/basic_stringstream/swap.md b/reference/sstream/basic_stringstream/swap.md index a62414d114..496d696617 100644 --- a/reference/sstream/basic_stringstream/swap.md +++ b/reference/sstream/basic_stringstream/swap.md @@ -6,8 +6,7 @@ * cpp11[meta cpp] ```cpp -void swap(basic_stringstream& rhs); // (1) C++11 -void swap(basic_stringstream& rhs) noexcept(see below); // (1) C++17 +void swap(basic_stringstream& rhs); ``` ## 概要 @@ -16,9 +15,6 @@ void swap(basic_stringstream& rhs) noexcept(see below); // (1) C++17 ## 効果 `basic_iostream::swap(rhs)`を呼び出し、`sb.swap(rhs.sb)`を実行する。ここで`sb`は内部の`basic_stringbuf`オブジェクトである。 -## 例外 -- C++17 : 実装が例外を投げない場合、この関数は`noexcept`が指定される。 - ## 例 ```cpp example #include From 3ff9e7a77808ada2a311b2e9aaf5ff1054615148 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sat, 3 Jan 2026 12:00:52 +0900 Subject: [PATCH 2482/3948] =?UTF-8?q?change=20=E5=87=BA=E5=8A=9B=20to=20?= =?UTF-8?q?=E5=87=BA=E5=8A=9B=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/compare/compare_three_way/op_call.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/compare/compare_three_way/op_call.md b/reference/compare/compare_three_way/op_call.md index d223cc3e68..6acefcb429 100644 --- a/reference/compare/compare_three_way/op_call.md +++ b/reference/compare/compare_three_way/op_call.md @@ -74,7 +74,7 @@ int main() { } ``` -### 出力 +### 出力例 ``` true false From d4ed6170a071faa53cccf13b63790d96c68c5b25 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sat, 3 Jan 2026 13:18:18 +0900 Subject: [PATCH 2483/3948] =?UTF-8?q?=E4=B8=8D=E5=8F=AF=E8=A6=96=E6=96=87?= =?UTF-8?q?=E5=AD=97=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit python3 .github/workflows/script/remove_forbidden_character.py --- reference/sstream/basic_stringbuf/swap.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/sstream/basic_stringbuf/swap.md b/reference/sstream/basic_stringbuf/swap.md index f5a1cf32bc..4f77963ecf 100644 --- a/reference/sstream/basic_stringbuf/swap.md +++ b/reference/sstream/basic_stringbuf/swap.md @@ -18,7 +18,7 @@ void swap(basic_stringbuf& rhs) noexcept(see below); // (1) C++20 `basic_streambuf::swap(rhs)`を呼び出し、`mode`と内部の文字列バッファを`rhs`と交換する。 ## 例外 -- C++20 : `noexcept(see below)` の `see below` は以下と等価である `allocator_­traits​::​propagate_­on_­container_­swap​::​value || allocator_­traits​::​is_­always_­equal​::​value`。 +- C++20 : `noexcept(see below)` の `see below` は以下と等価である `allocator_traits::propagate_on_container_swap::value || allocator_traits::is_always_equal::value`。 ## 例 ```cpp example From b591fdcdb07aa16da5aa8c377a078beab27549f3 Mon Sep 17 00:00:00 2001 From: teruyamato0731 <77840326+teruyamato0731@users.noreply.github.com> Date: Sun, 4 Jan 2026 19:23:44 +0900 Subject: [PATCH 2484/3948] =?UTF-8?q?feat(format/format=5Fto=5Fn):=20?= =?UTF-8?q?=E6=88=BB=E3=82=8A=E5=80=A4=E3=81=AE=E8=A8=98=E8=BF=B0=E3=82=92?= =?UTF-8?q?=E8=A9=B3=E7=B4=B0=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/format_to_n.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reference/format/format_to_n.md b/reference/format/format_to_n.md index 449fa4c879..b9c0e78ab6 100644 --- a/reference/format/format_to_n.md +++ b/reference/format/format_to_n.md @@ -83,6 +83,11 @@ cout << buffer; // The answer is 42. `format_to_n_result{out + M, N}` (ただし、`N` = `formatted_size(fmt, args...)` または `formatted_size(loc, fmt, args...)`、`M` = `min(max(n, 0), N)`) +戻り値のオブジェクトが保持するメンバ変数の意味は以下の通り: + +* `out` : 出力範囲の末尾(実際に書き込まれた最後の文字の次)を指す出力イテレータ。 +* `size` : 文字列表現全体を格納するのに必要だった文字数(切り捨てを考慮せず、[`formatted_size`](formatted_size.md)の結果と等しい)。 + ## 例外 フォーマット実行時に失敗した場合、[`format_error`](format_error.md)を投げる。 From 19e98da226c63e36350256d525b8b939ad12154c Mon Sep 17 00:00:00 2001 From: teruyamato0731 <77840326+teruyamato0731@users.noreply.github.com> Date: Sun, 4 Jan 2026 19:26:01 +0900 Subject: [PATCH 2485/3948] =?UTF-8?q?feat(format/format=5Fto=5Fn=5Fresult)?= =?UTF-8?q?:=20=E3=82=A4=E3=83=86=E3=83=AC=E3=83=BC=E3=82=BF=E3=83=BC=20->?= =?UTF-8?q?=20=E3=82=A4=E3=83=86=E3=83=AC=E3=83=BC=E3=82=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/format_to_n_result.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/format/format_to_n_result.md b/reference/format/format_to_n_result.md index 16c59dad4f..11591f716c 100644 --- a/reference/format/format_to_n_result.md +++ b/reference/format/format_to_n_result.md @@ -22,7 +22,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |-----------------|----------------------------------------------|----------------| -| out | 出力後の出力イテレーター | C++20 | +| out | 出力後の出力イテレータ | C++20 | | size | 文字列表現全体を格納するのに必要だった文字数 | C++20 | ## バージョン From 7dd6d3fd809f874b49d25c4c0ba500ad96904f4f Mon Sep 17 00:00:00 2001 From: teruyamato0731 <77840326+teruyamato0731@users.noreply.github.com> Date: Sun, 4 Jan 2026 19:27:48 +0900 Subject: [PATCH 2486/3948] =?UTF-8?q?feat(format/format=5Fto=5Fn):=20?= =?UTF-8?q?=E5=88=87=E3=82=8A=E6=8D=A8=E3=81=A6=E3=81=AE=E4=BE=8B=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/format_to_n.md | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/reference/format/format_to_n.md b/reference/format/format_to_n.md index b9c0e78ab6..5c974a4b77 100644 --- a/reference/format/format_to_n.md +++ b/reference/format/format_to_n.md @@ -104,16 +104,35 @@ cout << buffer; // The answer is 42. int main() { - char buffer[256]; - auto [end, n] = std::format_to_n(buffer, std::size(buffer)-1, "The answer is {}.", 42); - *end = '\0'; - std::cout << buffer << std::endl; + // 十分なバッファサイズがある場合 + { + char buffer[256]; + auto [out, size] = std::format_to_n(buffer, std::size(buffer)-1, "The answer is {}.", 42); + *out = '\0'; + std::cout << buffer << std::endl; + std::cout << "size: " << size << std::endl; + } + + // バッファサイズにより切り捨てられる場合 + { + char buffer[10]; // 小さいバッファ + // "The answer is 42." は17文字必要だが、バッファは9文字分(null文字分除く)しかない + auto [out, size] = std::format_to_n(buffer, std::size(buffer)-1, "The answer is {}.", 42); + *out = '\0'; + + std::cout << "truncated: " << buffer << std::endl; + // size は本来出力されるはずだった長さ (17) を返す + std::cout << "required: " << size << std::endl; + } } ``` ### 出力 ``` The answer is 42. +size: 17 +truncated: The answe +required: 17 ``` From c2a62f3a33185118898e505d826efa2d5e0ed405 Mon Sep 17 00:00:00 2001 From: teruyamato0731 <77840326+teruyamato0731@users.noreply.github.com> Date: Sun, 4 Jan 2026 19:29:48 +0900 Subject: [PATCH 2487/3948] =?UTF-8?q?style(format/format=5Fto=5Fn):=20=20?= =?UTF-8?q?=E4=BD=99=E5=88=86=E3=81=AAspace=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/format_to_n.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/format/format_to_n.md b/reference/format/format_to_n.md index 5c974a4b77..b9bc7d7881 100644 --- a/reference/format/format_to_n.md +++ b/reference/format/format_to_n.md @@ -144,7 +144,7 @@ class Wrapper { std::iter_difference_t count_ = 0; std::iter_difference_t max_count_; Out out_; - + public: using value_type = CharT; From 7394b32175181ab7ada3924d6b11d11b01bda6b1 Mon Sep 17 00:00:00 2001 From: KaiTomotake Date: Mon, 5 Jan 2026 11:22:56 +0900 Subject: [PATCH 2488/3948] =?UTF-8?q?logic=5Ferror=E3=82=AF=E3=83=A9?= =?UTF-8?q?=E3=82=B9=E3=81=AE=E8=AA=AC=E6=98=8E=E3=82=92=E8=A8=98=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - logic_errorクラスの説明を記述、ただしメンバ関数の専用ページはなし - stdexceptヘッダにlogic_errorクラスの説明ページへのリンクを追加 --- reference/stdexcept.md | 4 +-- reference/stdexcept/logic_error.md | 51 ++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 reference/stdexcept/logic_error.md diff --git a/reference/stdexcept.md b/reference/stdexcept.md index 2074a51a5f..6a75c204e2 100644 --- a/reference/stdexcept.md +++ b/reference/stdexcept.md @@ -13,7 +13,7 @@ | 名前 | 説明 | 対応バージョン | |--------------------|--------------------------------------------|-------| -| `logic_error` | プログラムの実行前に検出可能なエラー(論理エラー)を示す | | +| [`logic_error`](./stdexcept/logic_error.md) | プログラムの実行前に検出可能なエラー(論理エラー)を示す | | | `domain_error` | 定義域エラーを示す | | | `invalid_argument` | 不正な引数を示す | | | `length_error` | 長すぎるオブジェクトを作ろうとしたことを示す | | @@ -26,7 +26,7 @@ 例外クラスには継承関係があり、以下の箇条書きの階層構造で示す。 - [`exception`](/reference/exception/exception.md) - - `logic_error` + - [`logic_error`](./stdexcept/logic_error.md) - `domain_error` - `invalid_argument` - `length_error` diff --git a/reference/stdexcept/logic_error.md b/reference/stdexcept/logic_error.md new file mode 100644 index 0000000000..371d999e2e --- /dev/null +++ b/reference/stdexcept/logic_error.md @@ -0,0 +1,51 @@ +# logic_error + +* header_name[meta header] +* class[meta id-type] +* std[meta namespace] + +```cpp +namespace std { + class logic_error : public exception; +} +``` + +## 概要 + +`logic_error`クラスはプログラムの実行前に検出可能なエラー(論理エラー)を通知するためにスローされる例外クラス全般に対する基底クラスである。 + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +| --- | --- | --- | +| `(constructor)` | コンストラクタ | | +| `(destructor)` | デストラクタ | | +| `operator=` | 代入演算子 | | +| `what` | エラー理由を取得する | | + +## 例 + +```cpp example +#include +#include + +int square_root(int num) { + if (num < 0) { + throw std::invalid_argument("Cannot perform calculations with negative numbers!") + } + return num * num; +} + +int main() { + try { + square_root(-5); + } catch (const std::logic_error& e) { + std::cerr << "Error: " << e.what() << "\n"; + } +} +``` + +### 出力 + +``` +``` From aa780046c6fb0f1e254aeebd31a51f0a9b239256 Mon Sep 17 00:00:00 2001 From: KaiTomotake Date: Mon, 5 Jan 2026 11:25:30 +0900 Subject: [PATCH 2489/3948] =?UTF-8?q?=E3=82=A8=E3=83=A9=E3=83=BC=E5=80=8B?= =?UTF-8?q?=E6=89=80=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit header_nameなる存在しないヘッダを参照していたので、stdexceptに変更 --- reference/stdexcept/logic_error.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/stdexcept/logic_error.md b/reference/stdexcept/logic_error.md index 371d999e2e..8525d96148 100644 --- a/reference/stdexcept/logic_error.md +++ b/reference/stdexcept/logic_error.md @@ -1,6 +1,6 @@ # logic_error -* header_name[meta header] +* stdexcept[meta header] * class[meta id-type] * std[meta namespace] From 2c0c8cde2572bbfc112c0f38bf43c61005464940 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 5 Jan 2026 11:47:12 +0900 Subject: [PATCH 2490/3948] =?UTF-8?q?logic=5Ferror=20:=20=E3=81=BE?= =?UTF-8?q?=E3=81=A0=E4=BD=9C=E6=88=90=E3=81=95=E3=82=8C=E3=81=A6=E3=81=84?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=83=9A=E3=83=BC=E3=82=B8=E3=81=ABnolink?= =?UTF-8?q?=E4=BB=98=E3=81=8D=E3=81=A7=E3=83=AA=E3=83=B3=E3=82=AF=E3=82=92?= =?UTF-8?q?=E8=A8=98=E8=BC=89=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/stdexcept/logic_error.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/stdexcept/logic_error.md b/reference/stdexcept/logic_error.md index 8525d96148..c4e11228ac 100644 --- a/reference/stdexcept/logic_error.md +++ b/reference/stdexcept/logic_error.md @@ -18,10 +18,10 @@ namespace std { | 名前 | 説明 | 対応バージョン | | --- | --- | --- | -| `(constructor)` | コンストラクタ | | -| `(destructor)` | デストラクタ | | -| `operator=` | 代入演算子 | | -| `what` | エラー理由を取得する | | +| [`(constructor)`](logic_error/op_constructor.md.nolink) | コンストラクタ | | +| [`(destructor)`](logic_error/op_destructor.md.nolink) | デストラクタ | | +| [`operator=`](logic_error/op_assign.md.nolink) | 代入演算子 | | +| [`what`](logic_error/what.md.nolink) | エラー理由を取得する | | ## 例 From 7cd1a9fbadc359e45112f4324e363439f9ae1fbe Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 5 Jan 2026 11:48:07 +0900 Subject: [PATCH 2491/3948] =?UTF-8?q?logic=5Ferror=20:=20=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=83=87=E3=83=B3=E3=83=88=E3=82=924=20=E2=86=92=202?= =?UTF-8?q?=E3=82=B9=E3=83=9A=E3=83=BC=E3=82=B9=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/stdexcept/logic_error.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/reference/stdexcept/logic_error.md b/reference/stdexcept/logic_error.md index c4e11228ac..920220a7f3 100644 --- a/reference/stdexcept/logic_error.md +++ b/reference/stdexcept/logic_error.md @@ -30,18 +30,18 @@ namespace std { #include int square_root(int num) { - if (num < 0) { - throw std::invalid_argument("Cannot perform calculations with negative numbers!") - } - return num * num; + if (num < 0) { + throw std::invalid_argument("Cannot perform calculations with negative numbers!") + } + return num * num; } int main() { - try { - square_root(-5); - } catch (const std::logic_error& e) { - std::cerr << "Error: " << e.what() << "\n"; - } + try { + square_root(-5); + } catch (const std::logic_error& e) { + std::cerr << "Error: " << e.what() << "\n"; + } } ``` From 581ab3f846a777c6ac8c9481e0c439224c0f2806 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 5 Jan 2026 11:48:43 +0900 Subject: [PATCH 2492/3948] =?UTF-8?q?stdexcept=20:=20=E5=86=85=E9=83=A8?= =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=81=AB=20./=20=E3=82=92=E3=81=A4?= =?UTF-8?q?=E3=81=91=E3=82=8B=E3=81=AE=E3=82=92=E3=82=84=E3=82=81=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/stdexcept.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/stdexcept.md b/reference/stdexcept.md index 6a75c204e2..059b05cd33 100644 --- a/reference/stdexcept.md +++ b/reference/stdexcept.md @@ -13,7 +13,7 @@ | 名前 | 説明 | 対応バージョン | |--------------------|--------------------------------------------|-------| -| [`logic_error`](./stdexcept/logic_error.md) | プログラムの実行前に検出可能なエラー(論理エラー)を示す | | +| [`logic_error`](stdexcept/logic_error.md) | プログラムの実行前に検出可能なエラー(論理エラー)を示す | | | `domain_error` | 定義域エラーを示す | | | `invalid_argument` | 不正な引数を示す | | | `length_error` | 長すぎるオブジェクトを作ろうとしたことを示す | | @@ -26,7 +26,7 @@ 例外クラスには継承関係があり、以下の箇条書きの階層構造で示す。 - [`exception`](/reference/exception/exception.md) - - [`logic_error`](./stdexcept/logic_error.md) + - [`logic_error`](stdexcept/logic_error.md) - `domain_error` - `invalid_argument` - `length_error` From 10cc934710e966b8442947513aa2cf09beda4daf Mon Sep 17 00:00:00 2001 From: KaiTomotake Date: Mon, 5 Jan 2026 13:13:53 +0900 Subject: [PATCH 2493/3948] Update .gitignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit .github/workflows/scriptのスクリプトを実行すると場合によっては__pycache__フォルダが生成されるため、gitignoreに追加 --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 046e5ce7de..fb9cce4018 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ !.vscode/extensions.json .idea .DS_Store +__pycache__ From 4fc457fc20b9be14c4ae1be931f7e3b50204b13f Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 5 Jan 2026 17:10:15 +0900 Subject: [PATCH 2494/3948] =?UTF-8?q?chore(workflows/preview=5Flink):=20tr?= =?UTF-8?q?ee=20=E3=81=AE=E5=86=85=E5=AE=B9=E3=81=8C=E5=89=8A=E9=99=A4?= =?UTF-8?q?=E3=81=95=E3=82=8C=E3=81=AA=E3=81=84=E5=95=8F=E9=A1=8C=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 以下の Action にて Workflow "pages build and deployment" で行われてい る gh-pages の deploy に失敗している。 https://github.com/cpprefjp/site/actions/runs/20691846752 https://github.com/cpprefjp/site/actions/runs/20703373050 以下のエラーメッセージが出力されている。 System.IO.IOException: No space left on device : '/home/runner/actions-runner/cached/_diag/Worker_20260105-023359-utc.log' at System.IO.RandomAccess.WriteAtOffset(SafeFileHandle handle, ReadOnlySpan`1 buffer, Int64 fileOffset) at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder) at System.Diagnostics.TextWriterTraceListener.Flush() at GitHub.Runner.Common.HostTraceListener.WriteHeader(String source, TraceEventType eventType, Int32 id) at System.Diagnostics.TraceSource.TraceEvent(TraceEventType eventType, Int32 id, String message) at GitHub.Runner.Worker.Worker.RunAsync(String pipeIn, String pipeOut) at GitHub.Runner.Worker.Program.MainAsync(IHostContext context, String[] args) gh-pages の容量が大きくなったためだと考えて preview_clear を実行したが、 closed PR に対応するファイルたちが削除されない。preview_clear では filter-branch --commit-filter を使って commit を削除していたが、どうや ら --commit-filter は単に commit を snapshot として間引くだけで commit で行われた変更を drop する訳ではないようだ。つまり、単に commit が squash されてしまう。filter-branch --index-filter を用いて実際に各 commit でファイルを削除する必要があった。 この patch は --index-filter を用いるように preview_clear を修正する。 既にある squash されて肥大化した commit は手動で filter-branch して force-push した。 --- .github/workflows/preview_clear.yml | 43 +++++++++++++---------------- 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/.github/workflows/preview_clear.yml b/.github/workflows/preview_clear.yml index 392ef93d84..4fe939cf4f 100644 --- a/.github/workflows/preview_clear.yml +++ b/.github/workflows/preview_clear.yml @@ -22,33 +22,28 @@ jobs: # を超えるようならば、この数はもっと大きくする必要がある。 CPPREFJP_OPEN_PR_LIST=$(gh pr list --limit=999 --json number -q '.[].number' | tr '\n' ' ') CPPREFJP_OPEN_PR_LIST=${CPPREFJP_OPEN_PR_LIST% } - export CPPREFJP_OPEN_PR_LIST + + CPPREFJP_CLOSED_PR_LIST= + for dir in gen/pull/*; do + pr=${dir##*/} + case " $CPPREFJP_OPEN_PR_LIST " in + (*" $pr "*) + ;; + (*) + CPPREFJP_CLOSED_PR_LIST="$CPPREFJP_CLOSED_PR_LIST $pr" ;; + esac + done + if [ -z "$CPPREFJP_CLOSED_PR_LIST" ]; then + exit 0 + fi + export CPPREFJP_CLOSED_PR_LIST git config user.name 'github-actions[bot]' git config user.email '41898282+github-actions[bot]@users.noreply.github.com' - git filter-branch --commit-filter ' - commit_message=$(git log -n 1 --pretty=format:%s "$GIT_COMMIT") - if [ "$commit_message" = preview_clear ]; then - # drop a dummy commit by previous preview_clear - skip_commit "$@" - exit - fi - - pr=$(echo "$commit_message" | sed -n '\''s/^Preview PR \([0-9]\{1,\}\).*/\1/p'\'') - if [ -n "$pr" ]; then - case " $CPPREFJP_OPEN_PR_LIST " in - (*" $pr "*) - # preserve a commit for an open PR - git commit-tree "$@" ;; - (*) - # drop a commit for a closed PR - skip_commit "$@" ;; - esac - exit - fi - - # we preserve all the other commits - git commit-tree "$@" + git filter-branch --prune-empty -f --index-filter ' + for pr in $CPPREFJP_CLOSED_PR_LIST; do + git rm -rf "gen/pull/$pr" 2>/dev/null || true + done ' HEAD || true commit_count=$(git rev-list HEAD --count || true) From 792992117800ca9dafaf86841a63cd4dfaa66f7e Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 5 Jan 2026 17:47:19 +0900 Subject: [PATCH 2495/3948] =?UTF-8?q?chore(workflows/preview=5Fclear):=20?= =?UTF-8?q?=E8=B2=A0=E8=8D=B7=E8=BB=BD=E6=B8=9B=E3=81=AE=E3=81=9F=E3=82=81?= =?UTF-8?q?=20commit-filter=20=E3=82=92=E5=85=88=E3=81=AB=E5=AE=9F?= =?UTF-8?q?=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/preview_clear.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/preview_clear.yml b/.github/workflows/preview_clear.yml index 4fe939cf4f..8c44f9ecf6 100644 --- a/.github/workflows/preview_clear.yml +++ b/.github/workflows/preview_clear.yml @@ -23,6 +23,35 @@ jobs: CPPREFJP_OPEN_PR_LIST=$(gh pr list --limit=999 --json number -q '.[].number' | tr '\n' ' ') CPPREFJP_OPEN_PR_LIST=${CPPREFJP_OPEN_PR_LIST% } + # Note: 以下は closed PR に関する commit を squash する。原理的にはこ + # のステップは不要だが、後の --index-filter の処理コストを軽減するた + # めに commit 数を減らしておく。 + export CPPREFJP_OPEN_PR_LIST + git filter-branch --commit-filter ' + commit_message=$(git log -n 1 --pretty=format:%s "$GIT_COMMIT") + if [ "$commit_message" = preview_clear ]; then + # drop a dummy commit by previous preview_clear + skip_commit "$@" + exit + fi + + pr=$(echo "$commit_message" | sed -n '\''s/^Preview PR \([0-9]\{1,\}\).*/\1/p'\'') + if [ -n "$pr" ]; then + case " $CPPREFJP_OPEN_PR_LIST " in + (*" $pr "*) + # preserve a commit for an open PR + git_commit_non_empty_tree "$@" ;; + (*) + # drop a commit for a closed PR + skip_commit "$@" ;; + esac + exit + fi + + # we preserve all the other commits + git_commit_non_empty_tree "$@" + ' + CPPREFJP_CLOSED_PR_LIST= for dir in gen/pull/*; do pr=${dir##*/} From 34424d2dd03fe77a8a63a3e716a440cd20b16bc4 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Mon, 5 Jan 2026 17:09:29 +0800 Subject: [PATCH 2496/3948] =?UTF-8?q?fix:=20=E5=86=85=E9=83=A8=E3=83=AA?= =?UTF-8?q?=E3=83=B3=E3=82=AF=E3=81=AE=20./=20=E3=82=92=E5=89=8A=E9=99=A4?= =?UTF-8?q?=20(follow-up=20581ab3f8)=20(#1552)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp11/range_based_for.md | 4 ++-- .../cpp20/conditionally_trivial_special_member_functions.md | 2 +- ...efault_constructible_and_assignable_stateless_lambdas.md | 6 +++--- lang/cpp20/down_with_typename.md | 2 +- lang/cpp20/wording_for_lambdas_in_unevaluated_contexts.md | 2 +- reference/algorithm/ranges_fold_left.md | 2 +- reference/algorithm/ranges_fold_left_first.md | 2 +- reference/algorithm/ranges_fold_left_first_with_iter.md | 2 +- reference/algorithm/ranges_fold_left_with_iter.md | 2 +- reference/algorithm/ranges_fold_right.md | 4 ++-- reference/algorithm/ranges_fold_right_last.md | 4 ++-- reference/concepts/copyable.md | 2 +- reference/concepts/regular.md | 4 ++-- reference/concepts/semiregular.md | 4 ++-- reference/ranges/cbegin.md | 4 ++-- reference/ranges/cdata.md | 4 ++-- reference/ranges/cend.md | 4 ++-- reference/ranges/crbegin.md | 4 ++-- reference/ranges/crend.md | 4 ++-- 19 files changed, 31 insertions(+), 31 deletions(-) diff --git a/lang/cpp11/range_based_for.md b/lang/cpp11/range_based_for.md index c074f1ba62..1480b6fd6c 100644 --- a/lang/cpp11/range_based_for.md +++ b/lang/cpp11/range_based_for.md @@ -332,7 +332,7 @@ int main() } ``` -ただしこのバグはコンテナの参照を返すメンバ関数(上記では`get_vector`)に[左辺値修飾](./ref_qualifier_for_this.md)することで防げる場合もある +ただしこのバグはコンテナの参照を返すメンバ関数(上記では`get_vector`)に[左辺値修飾](ref_qualifier_for_this.md)することで防げる場合もある ```cpp example #include @@ -368,7 +368,7 @@ int main() - [C++17 範囲forの制限緩和 — `begin` と `end` の型が異なることを許可](/lang/cpp17/generalizing_the_range-based_for_loop.md) - [C++20 範囲for文がカスタマイゼーションポイントを見つけるルールを緩和](/lang/cpp20/relaxing_the_range_for_loop_customization_point_finding_rules.md) - [C++23 範囲for文が範囲初期化子内で生じた一時オブジェクトを延命することを規定](/lang/cpp23/lifetime_extension_in_range_based_for_loop.md) -- [メンバ関数の左辺値/右辺値修飾](./ref_qualifier_for_this.md) +- [メンバ関数の左辺値/右辺値修飾](ref_qualifier_for_this.md) ## 参照 - [N2930 Range-Based For Loop Wording (Without Concepts)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2930.html) diff --git a/lang/cpp20/conditionally_trivial_special_member_functions.md b/lang/cpp20/conditionally_trivial_special_member_functions.md index 07a2acce13..2aa5c48e9a 100644 --- a/lang/cpp20/conditionally_trivial_special_member_functions.md +++ b/lang/cpp20/conditionally_trivial_special_member_functions.md @@ -289,7 +289,7 @@ C++20のコンセプトの導入によって、コンセプトによって特殊 ## 関連項目 -- [コンセプト](./concepts.md) +- [コンセプト](concepts.md) ## 参照 diff --git a/lang/cpp20/default_constructible_and_assignable_stateless_lambdas.md b/lang/cpp20/default_constructible_and_assignable_stateless_lambdas.md index 107b1e7d72..26ef2b02e3 100644 --- a/lang/cpp20/default_constructible_and_assignable_stateless_lambdas.md +++ b/lang/cpp20/default_constructible_and_assignable_stateless_lambdas.md @@ -72,7 +72,7 @@ struct closure { ## 例 -以下の例では、「[評価されない文脈でのラムダ式](./wording_for_lambdas_in_unevaluated_contexts.md)」による仕様を同時に用いている。 +以下の例では、「[評価されない文脈でのラムダ式](wording_for_lambdas_in_unevaluated_contexts.md)」による仕様を同時に用いている。 ### 連想コンテナの比較をカスタマイズする @@ -161,10 +161,10 @@ set1 = set2; // C++17まではコンパイルエラー ラムダ式は関数オブジェクトを生成する糖衣構文であるが、これらのことは対応する関数オブジェクトを直接書いた場合と一貫しておらず不便であるため、状態を持たないラムダ式に限ってデフォルト構築と代入が可能になるように変更された。 -C++20では同時に[評価されない文脈にラムダ式を書くことができるようになった](./wording_for_lambdas_in_unevaluated_contexts.md)ため、この様な場合にラムダ式のクロージャ型を直接取得し渡すことができ、余計なコードをほとんど削減することができるようになる。 +C++20では同時に[評価されない文脈にラムダ式を書くことができるようになった](wording_for_lambdas_in_unevaluated_contexts.md)ため、この様な場合にラムダ式のクロージャ型を直接取得し渡すことができ、余計なコードをほとんど削減することができるようになる。 ## 関連項目 -- [評価されない文脈でのラムダ式](./wording_for_lambdas_in_unevaluated_contexts.md) +- [評価されない文脈でのラムダ式](wording_for_lambdas_in_unevaluated_contexts.md) ## 参照 - [P0624R2 Default constructible and assignable stateless lambdas](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0624r2.pdf) diff --git a/lang/cpp20/down_with_typename.md b/lang/cpp20/down_with_typename.md index 05c90b9331..711b86b6db 100644 --- a/lang/cpp20/down_with_typename.md +++ b/lang/cpp20/down_with_typename.md @@ -29,7 +29,7 @@ * メンバ宣言 * メンバ宣言の中の引数宣言(デフォルト引数に現れる場合を除く) * 識別子が修飾名である関数または関数テンプレートの引数宣言(デフォルト引数に現れる場合を除く) - * [ラムダ式](/lang/cpp11/lambda_expressions.md)または[requires式](./concepts.md)の引数宣言(デフォルト引数に現れる場合を除く) + * [ラムダ式](/lang/cpp11/lambda_expressions.md)または[requires式](concepts.md)の引数宣言(デフォルト引数に現れる場合を除く) * 非型テンプレートパラメーターの宣言 ```cpp diff --git a/lang/cpp20/wording_for_lambdas_in_unevaluated_contexts.md b/lang/cpp20/wording_for_lambdas_in_unevaluated_contexts.md index 3c47193943..fadae028c3 100644 --- a/lang/cpp20/wording_for_lambdas_in_unevaluated_contexts.md +++ b/lang/cpp20/wording_for_lambdas_in_unevaluated_contexts.md @@ -136,7 +136,7 @@ C++17までは、ラムダ式をSFINAEの文脈で用いて擬似的なコンセ この変更に伴う文言によってラムダ式を用いてSFINAEする事は完全に禁止され、評価されない文脈においてラムダ式の使用を制限する必要がなくなったため、C++20においてその制限を緩和することになった。 -ただし、ラムダ式が外部リンケージを持つエンティティのシグネチャに現れる事は相変わらず禁止されている。ラムダ式を用いてSFINAEするなど、そのような事がしたい場合には[コンセプト](./concepts.md)を用いる事でより容易に目的を達成できる。 +ただし、ラムダ式が外部リンケージを持つエンティティのシグネチャに現れる事は相変わらず禁止されている。ラムダ式を用いてSFINAEするなど、そのような事がしたい場合には[コンセプト](concepts.md)を用いる事でより容易に目的を達成できる。 ## 関連項目 - [状態を持たないラムダ式を、デフォルト構築可能、代入可能とする](/lang/cpp20/default_constructible_and_assignable_stateless_lambdas.md) diff --git a/reference/algorithm/ranges_fold_left.md b/reference/algorithm/ranges_fold_left.md index 6dcd4cd043..ff01c89d11 100644 --- a/reference/algorithm/ranges_fold_left.md +++ b/reference/algorithm/ranges_fold_left.md @@ -67,7 +67,7 @@ namespace std::ranges { 10 + 5 -> fold_left(rng, 0, +) ``` -[`fold_right`](./ranges_fold_right.md)に対しては、入力範囲の先頭から末尾に向かって処理を進めていく点が異なる。 +[`fold_right`](ranges_fold_right.md)に対しては、入力範囲の先頭から末尾に向かって処理を進めていく点が異なる。 ## 引数 diff --git a/reference/algorithm/ranges_fold_left_first.md b/reference/algorithm/ranges_fold_left_first.md index c9c9531caf..b1b87f89b5 100644 --- a/reference/algorithm/ranges_fold_left_first.md +++ b/reference/algorithm/ranges_fold_left_first.md @@ -23,7 +23,7 @@ namespace std::ranges { ## 概要 -初期値の指定を省略する[`fold_left`](./ranges_fold_left.md)。入力範囲の先頭要素が初期値として使用される。 +初期値の指定を省略する[`fold_left`](ranges_fold_left.md)。入力範囲の先頭要素が初期値として使用される。 - (1) : 入力としてイテレータ範囲をとるオーバーロード - (2) : 入力として範囲を直接とるオーバーロード diff --git a/reference/algorithm/ranges_fold_left_first_with_iter.md b/reference/algorithm/ranges_fold_left_first_with_iter.md index dce9fe282f..267d0e8c5c 100644 --- a/reference/algorithm/ranges_fold_left_first_with_iter.md +++ b/reference/algorithm/ranges_fold_left_first_with_iter.md @@ -23,7 +23,7 @@ namespace std::ranges { ## 概要 -処理の過程で得られた終端位置を指すイテレータを同時に返す[`fold_left_first`](./ranges_fold_left_first.md)。入力範囲の先頭要素が初期値として使用され、戻り値はイテレータと処理結果のペアとなる。 +処理の過程で得られた終端位置を指すイテレータを同時に返す[`fold_left_first`](ranges_fold_left_first.md)。入力範囲の先頭要素が初期値として使用され、戻り値はイテレータと処理結果のペアとなる。 - (1) : 入力としてイテレータ範囲をとるオーバーロード - (2) : 入力として範囲を直接とるオーバーロード diff --git a/reference/algorithm/ranges_fold_left_with_iter.md b/reference/algorithm/ranges_fold_left_with_iter.md index dd682d6c08..ced1da4cef 100644 --- a/reference/algorithm/ranges_fold_left_with_iter.md +++ b/reference/algorithm/ranges_fold_left_with_iter.md @@ -45,7 +45,7 @@ namespace std::ranges { ## 概要 -処理の過程で得られた終端位置を指すイテレータを同時に返す[`fold_left`](./ranges_fold_left.md)。戻り値はイテレータと処理結果のペアとなる。 +処理の過程で得られた終端位置を指すイテレータを同時に返す[`fold_left`](ranges_fold_left.md)。戻り値はイテレータと処理結果のペアとなる。 - (1) : 入力としてイテレータ範囲をとるオーバーロード - (2) : 入力として範囲を直接とるオーバーロード diff --git a/reference/algorithm/ranges_fold_right.md b/reference/algorithm/ranges_fold_right.md index 5611e23a16..3264562eb6 100644 --- a/reference/algorithm/ranges_fold_right.md +++ b/reference/algorithm/ranges_fold_right.md @@ -67,7 +67,7 @@ namespace std::ranges { 1 + 14 -> fold_right(rng, 0, +) ``` -[`fold_left`](./ranges_fold_left.md)に対しては、入力範囲の末尾から先頭に向かって処理を進めていく点が異なる。 +[`fold_left`](ranges_fold_left.md)に対しては、入力範囲の末尾から先頭に向かって処理を進めていく点が異なる。 ## 引数 @@ -104,7 +104,7 @@ public: }; ``` -すなわち、二項演算`F`の引数順が逆になることを除いて[`fold_left`](./ranges_fold_left.md)と同じ制約となる。 +すなわち、二項演算`F`の引数順が逆になることを除いて[`fold_left`](ranges_fold_left.md)と同じ制約となる。 ただし、`fold_right`はその処理の都合上、入力範囲に対して[`bidirectional_range`](/reference/ranges/bidirectional_range.md)であることを要求する(`fold_left`は[`input_range`](/reference/ranges/input_range.md))。 diff --git a/reference/algorithm/ranges_fold_right_last.md b/reference/algorithm/ranges_fold_right_last.md index 2e3d621ab1..aa58a681ff 100644 --- a/reference/algorithm/ranges_fold_right_last.md +++ b/reference/algorithm/ranges_fold_right_last.md @@ -23,7 +23,7 @@ namespace std::ranges { ## 概要 -初期値の指定を省略する[`fold_right`](./ranges_fold_right.md)。入力範囲の末尾要素が初期値として使用される。 +初期値の指定を省略する[`fold_right`](ranges_fold_right.md)。入力範囲の末尾要素が初期値として使用される。 - (1) : 入力としてイテレータ範囲をとるオーバーロード - (2) : 入力として範囲を直接とるオーバーロード @@ -41,7 +41,7 @@ namespace std::ranges { `indirectly-binary-right-foldable`は`F`の引数順が逆になることを除いて[`indirectly-binary-left-foldable`](ranges_fold_left.md)と同様の制約となる。 -`indirectly-binary-left-foldable`では、初期値の型`T`が戻り値型(積算値の型)`U`に変換可能であることが要求([`convertible_to`](/reference/concepts/convertible_to.md)``)されており、この関数では初期値の型を指定できない(`range_value_t`が使用される)ため戻り値型を大きく制御することが困難になる(例えば、[`fold_right`](./ranges_fold_right.md)の例にある入力範囲を反転させる例の様なことは素直にはできない)。 +`indirectly-binary-left-foldable`では、初期値の型`T`が戻り値型(積算値の型)`U`に変換可能であることが要求([`convertible_to`](/reference/concepts/convertible_to.md)``)されており、この関数では初期値の型を指定できない(`range_value_t`が使用される)ため戻り値型を大きく制御することが困難になる(例えば、[`fold_right`](ranges_fold_right.md)の例にある入力範囲を反転させる例の様なことは素直にはできない)。 ## 戻り値 diff --git a/reference/concepts/copyable.md b/reference/concepts/copyable.md index eed875cb2a..1dcb9c2aac 100644 --- a/reference/concepts/copyable.md +++ b/reference/concepts/copyable.md @@ -20,7 +20,7 @@ namespace std { ## 概要 -`copyable`は、任意の型`T`が[`movable`](./movable.md)コンセプトを満たし、それに加えてコピー構築・代入が可能であることを表すコンセプトである。 +`copyable`は、任意の型`T`が[`movable`](movable.md)コンセプトを満たし、それに加えてコピー構築・代入が可能であることを表すコンセプトである。 ## 例 ```cpp example diff --git a/reference/concepts/regular.md b/reference/concepts/regular.md index 4226df2454..8853d3b79f 100644 --- a/reference/concepts/regular.md +++ b/reference/concepts/regular.md @@ -14,7 +14,7 @@ namespace std { ## 概要 -`regular`は、任意の型`T`が[`semiregular`](./semiregular.md)コンセプトを満たし、それに加えて等値比較可能であることを表すコンセプトである。 +`regular`は、任意の型`T`が[`semiregular`](semiregular.md)コンセプトを満たし、それに加えて等値比較可能であることを表すコンセプトである。 ## 正則性 @@ -28,7 +28,7 @@ namespace std { このような正則な型とは、`int`型などの[基本型](/reference/type_traits/is_fundamental.md)の様に扱うことのできる型を表している。 -ここから等値比較可能という性質を弱めたものは、[半正則](./semiregular.md)な型と呼ばれる。 +ここから等値比較可能という性質を弱めたものは、[半正則](semiregular.md)な型と呼ばれる。 ## 例 ```cpp example diff --git a/reference/concepts/semiregular.md b/reference/concepts/semiregular.md index 329ecc6828..9424dff493 100644 --- a/reference/concepts/semiregular.md +++ b/reference/concepts/semiregular.md @@ -14,7 +14,7 @@ namespace std { ## 概要 -`semiregular`は、任意の型`T`が[`copyable`](./copyable.md)コンセプトを満たし、それに加えてデフォルト構築可能であることを表すコンセプトである。 +`semiregular`は、任意の型`T`が[`copyable`](copyable.md)コンセプトを満たし、それに加えてデフォルト構築可能であることを表すコンセプトである。 半正則(*semiregular*)な型とは`int`型などの[基本型](/reference/type_traits/is_fundamental.md)の様に扱うことができる型を表しているが、`==`による等値比較が必ずしも可能ではない。 @@ -83,7 +83,7 @@ copyable is not semiregular ## 関連項目 - [C++20 コンセプト](/lang/cpp20/concepts.md) -- [`regular`](./regular.md) +- [`regular`](regular.md) ## 参照 diff --git a/reference/ranges/cbegin.md b/reference/ranges/cbegin.md index 0438c68a52..ace719d33f 100644 --- a/reference/ranges/cbegin.md +++ b/reference/ranges/cbegin.md @@ -22,8 +22,8 @@ Rangeから先頭要素への読み取り専用イテレータを取得する関 1. `E`がlvalueであれば、[`ranges::begin`](begin.md)`(static_cast(E))` 2. それ以外の場合、[`ranges::begin`](begin.md)`(static_cast(E))` - C++23から - 1. `E`が右辺値であり、[`enable_borrowed_range`](./enable_borrowed_range.md)`>`が`false`となる場合、`ranges::cbegin(E)`は不適格 - 2. それ以外の場合、式`U`を[`ranges::begin`](begin.md)`(`[`possibly-const-range`](./possibly-const-range.md)`(t))`とすると、[`const_iterator`](/reference/iterator/const_iterator.md)`(U)` + 1. `E`が右辺値であり、[`enable_borrowed_range`](enable_borrowed_range.md)`>`が`false`となる場合、`ranges::cbegin(E)`は不適格 + 2. それ以外の場合、式`U`を[`ranges::begin`](begin.md)`(`[`possibly-const-range`](possibly-const-range.md)`(t))`とすると、[`const_iterator`](/reference/iterator/const_iterator.md)`(U)` ## 戻り値 先頭要素への読み取り専用イテレータ。 diff --git a/reference/ranges/cdata.md b/reference/ranges/cdata.md index dff8fd6db4..a159cd6ee7 100644 --- a/reference/ranges/cdata.md +++ b/reference/ranges/cdata.md @@ -22,8 +22,8 @@ Rangeの要素が格納されたメモリ領域へのポインタを取得する 1. `E`がlvalueであれば、[`ranges::data`](data.md)`(static_cast(E))` 2. それ以外の場合、[`ranges::data`](data.md)`(static_cast(E))` - C++23から - 1. `E`が右辺値であり、[`enable_borrowed_range`](./enable_borrowed_range.md)`>`が`false`となる場合、`ranges::cdata(E)`は不適格 - 2. それ以外の場合、`as-const-pointer(`[`ranges::data`](data.md)`(`[`possibly-const-range`](./possibly-const-range.md)`(t)))` + 1. `E`が右辺値であり、[`enable_borrowed_range`](enable_borrowed_range.md)`>`が`false`となる場合、`ranges::cdata(E)`は不適格 + 2. それ以外の場合、`as-const-pointer(`[`ranges::data`](data.md)`(`[`possibly-const-range`](possibly-const-range.md)`(t)))` - `as-const-pointer`は次のような説明専用関数テンプレートである ```cpp template diff --git a/reference/ranges/cend.md b/reference/ranges/cend.md index 39cae89367..e72447b16c 100644 --- a/reference/ranges/cend.md +++ b/reference/ranges/cend.md @@ -22,8 +22,8 @@ Rangeから、最後尾要素の次を指す読み取り専用イテレータも 1. `E`がlvalueであれば、[`ranges::end`](end.md)`(static_cast(E))` 2. それ以外の場合、[`ranges::end`](end.md)`(static_cast(E))` - C++23から - 1. `E`が右辺値であり、[`enable_borrowed_range`](./enable_borrowed_range.md)`>`が`false`となる場合、`ranges::cend(E)`は不適格 - 2. それ以外の場合、式`U`を[`ranges::end`](end.md)`(`[`possibly-const-range`](./possibly-const-range.md)`(t))`とすると、[`const_sentinel`](/reference/iterator/const_sentinel.md)`(U)` + 1. `E`が右辺値であり、[`enable_borrowed_range`](enable_borrowed_range.md)`>`が`false`となる場合、`ranges::cend(E)`は不適格 + 2. それ以外の場合、式`U`を[`ranges::end`](end.md)`(`[`possibly-const-range`](possibly-const-range.md)`(t))`とすると、[`const_sentinel`](/reference/iterator/const_sentinel.md)`(U)` ## 戻り値 最後尾要素の次を指す読み取り専用イテレータもしくは番兵。 diff --git a/reference/ranges/crbegin.md b/reference/ranges/crbegin.md index 0df83f406e..cfff365778 100644 --- a/reference/ranges/crbegin.md +++ b/reference/ranges/crbegin.md @@ -22,8 +22,8 @@ Rangeの末尾を指す読み取り専用逆イテレータを取得する関数 1. `E`がlvalueであれば、[`ranges::rbegin`](rbegin.md)`(static_cast(E))` 2. それ以外の場合、[`ranges::rbegin`](rbegin.md)`(static_cast(E))` - C++23から - 1. `E`が右辺値であり、[`enable_borrowed_range`](./enable_borrowed_range.md)`>`が`false`となる場合、`ranges::crbegin(E)`は不適格 - 2. それ以外の場合、式`U`を[`ranges::rbegin`](rbegin.md)`(`[`possibly-const-range`](./possibly-const-range.md)`(t))`とすると、[`const_iterator`](/reference/iterator/const_iterator.md)`(U)` + 1. `E`が右辺値であり、[`enable_borrowed_range`](enable_borrowed_range.md)`>`が`false`となる場合、`ranges::crbegin(E)`は不適格 + 2. それ以外の場合、式`U`を[`ranges::rbegin`](rbegin.md)`(`[`possibly-const-range`](possibly-const-range.md)`(t))`とすると、[`const_iterator`](/reference/iterator/const_iterator.md)`(U)` ## 戻り値 Rangeの末尾を指す読み取り専用逆イテレータ。 diff --git a/reference/ranges/crend.md b/reference/ranges/crend.md index 5e85208e05..2fb967a387 100644 --- a/reference/ranges/crend.md +++ b/reference/ranges/crend.md @@ -22,8 +22,8 @@ Rangeの先頭の前を指す、読み取り専用逆イテレータもしくは 1. `E`がlvalueであれば、[`ranges::rend`](rend.md)`(static_cast(E))` 2. それ以外の場合、[`ranges::rend`](rend.md)`(static_cast(E))` - C++23から - 1. `E`が右辺値であり、[`enable_borrowed_range`](./enable_borrowed_range.md)`>`が`false`となる場合、`ranges::crend(E)`は不適格 - 2. それ以外の場合、式`U`を[`ranges::rend`](rend.md)`(`[`possibly-const-range`](./possibly-const-range.md)`(t))`とすると、[`const_sentinel`](/reference/iterator/const_sentinel.md)`(U)` + 1. `E`が右辺値であり、[`enable_borrowed_range`](enable_borrowed_range.md)`>`が`false`となる場合、`ranges::crend(E)`は不適格 + 2. それ以外の場合、式`U`を[`ranges::rend`](rend.md)`(`[`possibly-const-range`](possibly-const-range.md)`(t))`とすると、[`const_sentinel`](/reference/iterator/const_sentinel.md)`(U)` ## 戻り値 Rangeの先頭の前を指す、読み取り専用逆イテレータもしくは番兵。 From c7bb02513affbd46591ea4af06a6861e0ad0deb2 Mon Sep 17 00:00:00 2001 From: teruyamato0731 <77840326+teruyamato0731@users.noreply.github.com> Date: Mon, 5 Jan 2026 18:18:02 +0900 Subject: [PATCH 2497/3948] =?UTF-8?q?fix:=20=E3=82=A4=E3=83=86=E3=83=AC?= =?UTF-8?q?=E3=83=BC=E3=82=BF=E3=83=BC=20->=20=E3=82=A4=E3=83=86=E3=83=AC?= =?UTF-8?q?=E3=83=BC=E3=82=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/concat_view.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/ranges/concat_view.md b/reference/ranges/concat_view.md index 23109df856..69bb438888 100644 --- a/reference/ranges/concat_view.md +++ b/reference/ranges/concat_view.md @@ -41,7 +41,7 @@ namespace std::ranges { - それらの要素に共通の値型`Cv`、参照型`Cr`、右辺値参照型`Crr` が存在し、 - `Cr&&`と`Cv&`、`Cr&&`と`Crr&&`、`Crr&&`と`Cv const&`にそれぞれ共通の参照型があり、 -- 連結するすべてのビューのイテレーター`it`について、 +- 連結するすべてのビューのイテレータ`it`について、 - `*it`が`Cr`に変換可能であり、 - `ranges::iter_move(it)`が`Crr`に変換可能であること。 From 5bd66aa52a21ba4d57f9b34b5294475dadfd2e42 Mon Sep 17 00:00:00 2001 From: teruyamato0731 <77840326+teruyamato0731@users.noreply.github.com> Date: Mon, 5 Jan 2026 18:19:29 +0900 Subject: [PATCH 2498/3948] =?UTF-8?q?feat(ngword=5Fcheck):=20=E8=A1=A8?= =?UTF-8?q?=E8=A8=98=E3=82=92=E3=82=A4=E3=83=86=E3=83=AC=E3=83=BC=E3=82=BF?= =?UTF-8?q?=E3=81=AB=E8=AA=98=E5=B0=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/script/ngword_check.py | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/script/ngword_check.py b/.github/workflows/script/ngword_check.py index d4d1a16780..4fe91139a4 100644 --- a/.github/workflows/script/ngword_check.py +++ b/.github/workflows/script/ngword_check.py @@ -48,6 +48,7 @@ ("", "voaltile", "volatile"), ("", "Updated upstream", ""), ("", "Stashed changes", ""), + ("", "イテレーター", "イテレータ"), ("", "子ルーチン", "コルーチン"), ("", "移譲", "委譲"), ("", r'型]\((.*?)\)型', "型](link)"), From 99a65d4ce6290a4636903d5ec0894e10ce135186 Mon Sep 17 00:00:00 2001 From: KaiTomotake Date: Tue, 6 Jan 2026 11:33:22 +0900 Subject: [PATCH 2499/3948] =?UTF-8?q?std::domain=5Ferror=E3=81=AE=E3=83=AA?= =?UTF-8?q?=E3=83=95=E3=82=A1=E3=83=AC=E3=83=B3=E3=82=B9=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/stdexcept/domain_error.md | 52 +++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 reference/stdexcept/domain_error.md diff --git a/reference/stdexcept/domain_error.md b/reference/stdexcept/domain_error.md new file mode 100644 index 0000000000..e23e1713b9 --- /dev/null +++ b/reference/stdexcept/domain_error.md @@ -0,0 +1,52 @@ +# domain_error + +* stdexcept[meta header] +* class[meta id-type] +* std[meta namespace] + +```cpp +namespace std { + class domain_error : public public_error; +} +``` + +## 概要 + +操作定義の範囲外の入力があった場合に送出されるすべての例外に対する基底クラスである。 +標準ライブラリのコンポーネントはこの例外をスローしない。 + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +| --- | --- | --- | +| [`(constructor)`](logic_error/op_constructor.md.nolink) | コンストラクタ | | +| [`(destructor)`](logic_error/op_destructor.md.nolink) | デストラクタ | | +| [`operator=`](logic_error/op_assign.md.nolink) | 代入演算子 | | +| [`what`](logic_error/what.md.nolink) | エラー理由を取得する | | + +## 例 + +```cpp example +#include +#include +#include + +double calc_sqrt(double num) { + if (num < 0) { + throw std::domain_error("Cannot calculate square root of a negative number."); + } + return std::sqrt(num); +} + +int main() { + try { + std::cout << calc_sqrt(-4.0) << "\n"; + } catch (const std::domain_error& e) { + std::cerr << e.what() << "\n"; + } +} +``` + +### 出力 +``` +``` From 3f7e9a647010749ea3e40012c8c32c0983bda6be Mon Sep 17 00:00:00 2001 From: KaiTomotake Date: Tue, 6 Jan 2026 11:34:19 +0900 Subject: [PATCH 2500/3948] =?UTF-8?q?stdexcept.md=E3=81=ABdomain=5Ferror?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/stdexcept.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/stdexcept.md b/reference/stdexcept.md index 059b05cd33..4ca74809b8 100644 --- a/reference/stdexcept.md +++ b/reference/stdexcept.md @@ -14,7 +14,7 @@ | 名前 | 説明 | 対応バージョン | |--------------------|--------------------------------------------|-------| | [`logic_error`](stdexcept/logic_error.md) | プログラムの実行前に検出可能なエラー(論理エラー)を示す | | -| `domain_error` | 定義域エラーを示す | | +| [`domain_error`](stdexcept/domain_error.md) | 定義域エラーを示す | | | `invalid_argument` | 不正な引数を示す | | | `length_error` | 長すぎるオブジェクトを作ろうとしたことを示す | | | `out_of_range` | 引数が許容範囲外であることを示す | | @@ -27,7 +27,7 @@ - [`exception`](/reference/exception/exception.md) - [`logic_error`](stdexcept/logic_error.md) - - `domain_error` + - [`domain_error`](stdexcept/domain_error.md) - `invalid_argument` - `length_error` - `out_of_range` From 4a23ec961f4ad1d33b11ed91b011b1312ba64e2d Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Tue, 6 Jan 2026 03:10:36 +0900 Subject: [PATCH 2501/3948] =?UTF-8?q?fix(basic=5Fstring::append):=20?= =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E4=BE=8B=E3=81=AE=E3=83=AA=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=83=AC=E3=83=99=E3=83=AB=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/string/basic_string/append.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/reference/string/basic_string/append.md b/reference/string/basic_string/append.md index 6f6d099892..d13997524f 100644 --- a/reference/string/basic_string/append.md +++ b/reference/string/basic_string/append.md @@ -113,8 +113,9 @@ constexpr basic_string& ``` - (9) 対象オブジェクトの末尾に、[`basic_string_view`](/reference/string_view/basic_string_view.md)``に変換可能な`t`の指定された範囲の文字列が追加される。 - * 文字列の長さ `rlen` は、`n` と [`sv.size()`](/reference/string_view/basic_string_view/size.md) `- pos` の小さい方である。 -以下と等価。 + * 文字列の長さ `rlen` は、`n` と [`sv.size()`](/reference/string_view/basic_string_view/size.md) `- pos` の小さい方である。 + + 以下と等価。 ```cpp basic_string_view sv = t; return append(sv.substr(pos, n)); From 41adfbf89a5c729dcbaa45a5b6bb6acc3106bf2e Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Tue, 6 Jan 2026 03:11:37 +0900 Subject: [PATCH 2502/3948] =?UTF-8?q?fix(ranges::in=5Fin=5Fout=5Fresult):?= =?UTF-8?q?=20=E3=83=AA=E3=82=B9=E3=83=88=E7=95=AA=E5=8F=B7=E3=81=AE?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_in_in_out_result.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/algorithm/ranges_in_in_out_result.md b/reference/algorithm/ranges_in_in_out_result.md index 0ae68f3334..0975afa3ef 100644 --- a/reference/algorithm/ranges_in_in_out_result.md +++ b/reference/algorithm/ranges_in_in_out_result.md @@ -57,10 +57,10 @@ namespace std::ranges { ## 概要 * (1): 3つのイテレータを格納する型 * (2): [`ranges::transform`](ranges_transform.md)で使用するエイリアス -* (2): [`ranges::merge`](ranges_merge.md)で使用するエイリアス -* (2): [`ranges::set_union`](ranges_set_union.md)で使用するエイリアス -* (2): [`ranges::set_intersection`](ranges_set_intersection.md)で使用するエイリアス -* (2): [`ranges::set_symmetric_difference`](ranges_set_symmetric_difference.md)で使用するエイリアス +* (3): [`ranges::merge`](ranges_merge.md)で使用するエイリアス +* (4): [`ranges::set_union`](ranges_set_union.md)で使用するエイリアス +* (5): [`ranges::set_intersection`](ranges_set_intersection.md)で使用するエイリアス +* (6): [`ranges::set_symmetric_difference`](ranges_set_symmetric_difference.md)で使用するエイリアス この型は、関数が2つの入力用の範囲と出力用の範囲を受け取る場合に、それぞれ処理した範囲の末尾を返すために使用される。 From c55f8076ed19181c7fa21929f826a35b7119cace Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Tue, 6 Jan 2026 12:07:04 +0900 Subject: [PATCH 2503/3948] =?UTF-8?q?fix(domain=5Ferror):=20=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E4=BE=8B=E3=81=AE=E3=82=A4=E3=83=B3=E3=83=87?= =?UTF-8?q?=E3=83=B3=E3=83=88=E3=82=924=E2=86=922=E3=81=AB=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cf 7cd1a9f, 2219858, 67160f5, and cdaf0f7 --- reference/stdexcept/domain_error.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/reference/stdexcept/domain_error.md b/reference/stdexcept/domain_error.md index e23e1713b9..8f79944faf 100644 --- a/reference/stdexcept/domain_error.md +++ b/reference/stdexcept/domain_error.md @@ -32,18 +32,18 @@ namespace std { #include double calc_sqrt(double num) { - if (num < 0) { - throw std::domain_error("Cannot calculate square root of a negative number."); - } - return std::sqrt(num); + if (num < 0) { + throw std::domain_error("Cannot calculate square root of a negative number."); + } + return std::sqrt(num); } int main() { - try { - std::cout << calc_sqrt(-4.0) << "\n"; - } catch (const std::domain_error& e) { - std::cerr << e.what() << "\n"; - } + try { + std::cout << calc_sqrt(-4.0) << "\n"; + } catch (const std::domain_error& e) { + std::cerr << e.what() << "\n"; + } } ``` From 4f86a27861111047aad838e574d5bd726f19bf6b Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Tue, 6 Jan 2026 12:07:44 +0900 Subject: [PATCH 2504/3948] =?UTF-8?q?fix({domain,logic}=5Ferror):=20?= =?UTF-8?q?=E3=82=A8=E3=83=A9=E3=83=BC=E5=87=BA=E5=8A=9B=E3=82=92=E5=87=BA?= =?UTF-8?q?=E5=8A=9B=E7=B5=90=E6=9E=9C=E3=81=AB=E5=8F=8D=E6=98=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 既存のページではエラー出力も出力に含めている。 https://github.com/cpprefjp/site/blob/3f7e9a647010749ea3e40012c8c32c0983bda6be/reference/print/print.md?plain=1#L129 https://github.com/cpprefjp/site/blob/3f7e9a647010749ea3e40012c8c32c0983bda6be/reference/print/println.md?plain=1#L90 もしくは節見出しを "出力 (標準エラー出力)" としている。 https://github.com/cpprefjp/site/blob/3f7e9a647010749ea3e40012c8c32c0983bda6be/reference/cstdio/stderr.md?plain=1#L26-L29 今回は後者に倣う。 fixup stderr --- reference/stdexcept/domain_error.md | 5 +++-- reference/stdexcept/logic_error.md | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/reference/stdexcept/domain_error.md b/reference/stdexcept/domain_error.md index 8f79944faf..5e0456f35b 100644 --- a/reference/stdexcept/domain_error.md +++ b/reference/stdexcept/domain_error.md @@ -33,7 +33,7 @@ namespace std { double calc_sqrt(double num) { if (num < 0) { - throw std::domain_error("Cannot calculate square root of a negative number."); + throw std::domain_error("Cannot calculate the square root of a negative number."); } return std::sqrt(num); } @@ -47,6 +47,7 @@ int main() { } ``` -### 出力 +### 出力 (標準エラー出力) ``` +Cannot calculate the square root of a negative number. ``` diff --git a/reference/stdexcept/logic_error.md b/reference/stdexcept/logic_error.md index 920220a7f3..f26bd2973c 100644 --- a/reference/stdexcept/logic_error.md +++ b/reference/stdexcept/logic_error.md @@ -45,7 +45,8 @@ int main() { } ``` -### 出力 +### 出力 (標準エラー出力) ``` +Error: Cannot perform calculations with negative numbers! ``` From 498653ba1b2192e2bc75e08d582d515fae8eccdd Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Tue, 6 Jan 2026 12:21:17 +0900 Subject: [PATCH 2505/3948] =?UTF-8?q?fix(domain=5Ferror):=20=E5=9F=BA?= =?UTF-8?q?=E5=BA=95=E3=82=AF=E3=83=A9=E3=82=B9=E3=82=92=20"{public=20=3D>?= =?UTF-8?q?=20logic}=5Ferror"=20=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/stdexcept/domain_error.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/stdexcept/domain_error.md b/reference/stdexcept/domain_error.md index 5e0456f35b..26b923db5a 100644 --- a/reference/stdexcept/domain_error.md +++ b/reference/stdexcept/domain_error.md @@ -6,7 +6,7 @@ ```cpp namespace std { - class domain_error : public public_error; + class domain_error : public logic_error; } ``` From 76d0141d40b5a0f0a681053e3db9514d7da2451f Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Tue, 6 Jan 2026 12:22:05 +0900 Subject: [PATCH 2506/3948] =?UTF-8?q?fix({domain,logic}=5Ferror):=20?= =?UTF-8?q?=E7=B6=99=E6=89=BF=E3=83=A1=E3=83=B3=E3=83=90=E3=81=B8=E3=81=AE?= =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/stdexcept/domain_error.md | 8 ++++---- reference/stdexcept/logic_error.md | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/reference/stdexcept/domain_error.md b/reference/stdexcept/domain_error.md index 26b923db5a..039fdfd78c 100644 --- a/reference/stdexcept/domain_error.md +++ b/reference/stdexcept/domain_error.md @@ -19,10 +19,10 @@ namespace std { | 名前 | 説明 | 対応バージョン | | --- | --- | --- | -| [`(constructor)`](logic_error/op_constructor.md.nolink) | コンストラクタ | | -| [`(destructor)`](logic_error/op_destructor.md.nolink) | デストラクタ | | -| [`operator=`](logic_error/op_assign.md.nolink) | 代入演算子 | | -| [`what`](logic_error/what.md.nolink) | エラー理由を取得する | | +| [`(constructor)`](domain_error/op_constructor.md.nolink) | コンストラクタ | | +| [`(destructor)`](domain_error/op_destructor.md.nolink) | デストラクタ | | +| [`operator=`](domain_error/op_assign.md.nolink) | 代入演算子 | | +| [`what`](exception/what.md.nolink) | エラー理由を取得する | | ## 例 diff --git a/reference/stdexcept/logic_error.md b/reference/stdexcept/logic_error.md index f26bd2973c..57925ad387 100644 --- a/reference/stdexcept/logic_error.md +++ b/reference/stdexcept/logic_error.md @@ -21,7 +21,7 @@ namespace std { | [`(constructor)`](logic_error/op_constructor.md.nolink) | コンストラクタ | | | [`(destructor)`](logic_error/op_destructor.md.nolink) | デストラクタ | | | [`operator=`](logic_error/op_assign.md.nolink) | 代入演算子 | | -| [`what`](logic_error/what.md.nolink) | エラー理由を取得する | | +| [`what`](exception/what.md.nolink) | エラー理由を取得する | | ## 例 From cc152831521a58127967057d58d436e7db595d37 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Tue, 6 Jan 2026 12:38:24 +0900 Subject: [PATCH 2507/3948] =?UTF-8?q?fix(domain=5Ferror):=20=E8=A6=8F?= =?UTF-8?q?=E6=A0=BC=E3=81=AE=E8=A8=98=E8=BF=B0=E3=82=92=E5=8F=8D=E6=98=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/stdexcept/domain_error.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/reference/stdexcept/domain_error.md b/reference/stdexcept/domain_error.md index 039fdfd78c..2d32011e28 100644 --- a/reference/stdexcept/domain_error.md +++ b/reference/stdexcept/domain_error.md @@ -12,8 +12,9 @@ namespace std { ## 概要 -操作定義の範囲外の入力があった場合に送出されるすべての例外に対する基底クラスである。 -標準ライブラリのコンポーネントはこの例外をスローしない。 +関数引数に定義域の外の値が指定された場合に処理系が送出する例外およびその基底クラスである。 +実際には標準ライブラリのコンポーネントはこの例外をスローせず、 +代わりにユーザーが使うことができる。 ## メンバ関数 From 1e0f1cc6b3b7a9774e7be497fd844f69e64c07c2 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Tue, 6 Jan 2026 12:47:59 +0900 Subject: [PATCH 2508/3948] =?UTF-8?q?style:=20=E7=94=A8=E8=AA=9E=E7=B5=B1?= =?UTF-8?q?=E4=B8=80=20"=E3=82=B9=E3=83=AD=E3=83=BC=20=3D>=20=E9=80=81?= =?UTF-8?q?=E5=87=BA"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 現状、「送出」が圧倒的に多い。「スロー」は一般の日本語としては定着して いないという点からも「送出」に統一するのが良いように思われる。 $ git grep '送出' | wc -l 710 $ git grep 'スロー' | wc -l 69 --- .github/workflows/script/ngword_check.py | 1 + lang/cpp20/coroutines.md | 2 +- reference/exception/current_exception.md | 2 +- reference/exception/rethrow_exception.md | 8 ++++---- reference/exception/uncaught_exception.md | 2 +- reference/exception/uncaught_exceptions.md | 2 +- reference/execution/execution/as_awaitable.md | 2 +- reference/expected/expected.void/swap.md | 2 +- reference/expected/expected.void/value.md | 4 ++-- reference/expected/expected/swap.md | 2 +- reference/expected/expected/value.md | 4 ++-- reference/map/map/merge.md | 2 +- reference/map/multimap/merge.md | 2 +- reference/memory/allocate_shared.md | 6 +++--- reference/memory/allocate_shared_for_overwrite.md | 6 +++--- reference/memory/make_shared.md | 6 +++--- reference/memory/make_shared_for_overwrite.md | 6 +++--- reference/memory/ranges_uninitialized_copy.md | 2 +- reference/memory/ranges_uninitialized_copy_n.md | 2 +- .../memory/ranges_uninitialized_default_construct.md | 2 +- .../ranges_uninitialized_default_construct_n.md | 2 +- reference/memory/ranges_uninitialized_fill.md | 2 +- reference/memory/ranges_uninitialized_fill_n.md | 2 +- reference/memory/ranges_uninitialized_move.md | 2 +- reference/memory/ranges_uninitialized_move_n.md | 2 +- .../memory/ranges_uninitialized_value_construct.md | 2 +- .../memory/ranges_uninitialized_value_construct_n.md | 2 +- reference/memory/uninitialized_copy.md | 2 +- reference/memory/uninitialized_copy_n.md | 2 +- reference/memory/uninitialized_default_construct.md | 2 +- .../memory/uninitialized_default_construct_n.md | 2 +- reference/memory/uninitialized_fill.md | 2 +- reference/memory/uninitialized_fill_n.md | 2 +- reference/memory/uninitialized_move.md | 2 +- reference/memory/uninitialized_move_n.md | 2 +- reference/memory/uninitialized_value_construct.md | 2 +- reference/memory/uninitialized_value_construct_n.md | 2 +- reference/new.md | 6 +++--- reference/new/nothrow_t.md | 2 +- reference/new/op_new.md | 12 ++++++------ reference/new/op_new[].md | 10 +++++----- reference/set/multiset/merge.md | 2 +- reference/set/set/merge.md | 2 +- reference/stdexcept/domain_error.md | 2 +- reference/stdexcept/logic_error.md | 2 +- reference/syncstream/basic_syncbuf/op_constructor.md | 2 +- 46 files changed, 70 insertions(+), 69 deletions(-) diff --git a/.github/workflows/script/ngword_check.py b/.github/workflows/script/ngword_check.py index 4fe91139a4..777cd6d1b1 100644 --- a/.github/workflows/script/ngword_check.py +++ b/.github/workflows/script/ngword_check.py @@ -53,6 +53,7 @@ ("", "移譲", "委譲"), ("", r'型]\((.*?)\)型', "型](link)"), ("", "括弧", "カッコ"), + ("", "スロー", "送出"), ("", "constepx", "constexpr"), ("", "wsting", "wstring"), ("", r"\[lin ", "[link "), # コード修飾ミス diff --git a/lang/cpp20/coroutines.md b/lang/cpp20/coroutines.md index c30f35ed2d..0f30232164 100644 --- a/lang/cpp20/coroutines.md +++ b/lang/cpp20/coroutines.md @@ -323,7 +323,7 @@ Await式は式 _o_ と式 _await-ready_ を評価し、続いて: - _await-suspend_ の型が[`std::coroutine_handle`](/reference/coroutine/coroutine_handle.md)の場合、_await-suspend_[`.resume()`](/reference/coroutine/coroutine_handle/resume.md)が評価される。 - そうではなく _await-suspend_ の型が`bool`の場合、_await-suspend_ が評価され、その結果が`false`であればコルーチンは再開する。 - それ以外の場合、_await-suspend_ が評価される。 -- _await-suspend_ の評価が例外で終了した場合、例外が捕捉されてコルーチンが再開し、その例外は即座に再スローされる。そうでなければ、スコープ終了をともなわずに現在のコルーチンの呼出元もしくは再開元へ制御フローを戻す。 +- _await-suspend_ の評価が例外で終了した場合、例外が捕捉されてコルーチンが再開し、その例外は即座に再送出される。そうでなければ、スコープ終了をともなわずに現在のコルーチンの呼出元もしくは再開元へ制御フローを戻す。 - _await-ready_ の結果が`true`またはコルーチンが再開した場合、_await-resume_ の評価結果がAwait式の結果となる。 ```cpp diff --git a/reference/exception/current_exception.md b/reference/exception/current_exception.md index 858e9b060c..82b8501848 100644 --- a/reference/exception/current_exception.md +++ b/reference/exception/current_exception.md @@ -55,7 +55,7 @@ int main() if (ep) { std::cout << "rethrow" << std::endl; - std::rethrow_exception(ep); // 再スロー + std::rethrow_exception(ep); // 再送出 } } ``` diff --git a/reference/exception/rethrow_exception.md b/reference/exception/rethrow_exception.md index b6baa3a13d..8ab2d8f1a2 100644 --- a/reference/exception/rethrow_exception.md +++ b/reference/exception/rethrow_exception.md @@ -11,7 +11,7 @@ * exception_ptr[link exception_ptr.md] ## 概要 -`exception_ptr`が指す例外オブジェクトを再スローする。 +`exception_ptr`が指す例外オブジェクトを再送出する。 ## 事前条件 @@ -22,8 +22,8 @@ 説明用の変数`u`を、`p`が指す例外オブジェクトもしくはそのコピーとする。 コピーが行われるか否か、コピー時にメモリ確保が行われるか否かは未規定とされる。 -- `u`用のメモリ確保に失敗した場合、[`bad_alloc`](/reference/new/bad_alloc.md)例外がスローされる。 -- そうでなければ、`p`が指す例外オブジェクトから`u`へのコピー時に例外スローされた場合、その例外がスローされる。 +- `u`用のメモリ確保に失敗した場合、[`bad_alloc`](/reference/new/bad_alloc.md)例外が送出される。 +- そうでなければ、`p`が指す例外オブジェクトから`u`へのコピー時に例外送出された場合、その例外が送出される。 - そうでなければ、`throw u;` @@ -51,7 +51,7 @@ int main() if (ep) { std::cout << "rethrow" << std::endl; - std::rethrow_exception(ep); // 再スロー + std::rethrow_exception(ep); // 再送出 } } ``` diff --git a/reference/exception/uncaught_exception.md b/reference/exception/uncaught_exception.md index f3097d432d..a0f8c485b2 100644 --- a/reference/exception/uncaught_exception.md +++ b/reference/exception/uncaught_exception.md @@ -19,7 +19,7 @@ namespace std { ## 戻り値 -例外オブジェクトが生成され、スローされてからキャッチするまでの間に`true`を返す。 +例外オブジェクトが生成され、送出されてからキャッチするまでの間に`true`を返す。 また、明示的に[`terminate()`](/reference/exception/terminate.md)を呼び出し、実際に呼び出されるまでの間に`true`を返す。 diff --git a/reference/exception/uncaught_exceptions.md b/reference/exception/uncaught_exceptions.md index 5e00ac035d..ae0d83f150 100644 --- a/reference/exception/uncaught_exceptions.md +++ b/reference/exception/uncaught_exceptions.md @@ -16,7 +16,7 @@ namespace std { ## 戻り値 -呼び出し時点の、そのスレッドにおいてスローされたがキャッチされていない例外オブジェクトの数を取得する。 +呼び出し時点の、そのスレッドにおいて送出されたがキャッチされていない例外オブジェクトの数を取得する。 具体的には、`try`ブロック中で作られたオブジェクトのデストラクタや、スタック巻き戻し(unwind)中のデストラクタで1以上になる。 diff --git a/reference/execution/execution/as_awaitable.md b/reference/execution/execution/as_awaitable.md index fdcf544921..0d039abede 100644 --- a/reference/execution/execution/as_awaitable.md +++ b/reference/execution/execution/as_awaitable.md @@ -25,7 +25,7 @@ Promise型`p`をもつコルーチンにおいて、Await式`co_await as_awaitab - コルーチンを中断し、Operation Stateを[開始(start)](start.md)する。 - [クエリオブジェクト](../queryable.md)による[Receiver](receiver.md)環境への問い合わせは、Promise型に関連付けられた環境(`get_env`)へと転送される。 - Senderが[値完了](set_value.md)した場合、送信値をAwait式の結果としてコルーチンを再開する。 - - Senderが[エラー完了](set_error.md)した場合、エラー値を例外としてコルーチンから再スローする。 + - Senderが[エラー完了](set_error.md)した場合、エラー値を例外としてコルーチンから再送出する。 - Senderが[停止完了](set_stopped.md)した場合、停止完了ハンドラ(`unhandled_stopped`)が返す別のコルーチンを再開させる。 - そうでなければ、式`expr`に対してAwait式を実行する。 diff --git a/reference/expected/expected.void/swap.md b/reference/expected/expected.void/swap.md index 129ed170a7..a28fda194e 100644 --- a/reference/expected/expected.void/swap.md +++ b/reference/expected/expected.void/swap.md @@ -53,7 +53,7 @@ noexcept例外指定は次の式に従う : [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)` &&` [`is_nothrow_swappable_v`](/reference/type_traits/is_nothrow_swappable.md)`` -noexcept例外指定が`false`の場合、上記の「効果」による処理からの例外がスローされる。 +noexcept例外指定が`false`の場合、上記の「効果」による処理からの例外が送出される。 ## 例 diff --git a/reference/expected/expected.void/value.md b/reference/expected/expected.void/value.md index cfd3689d5f..90860355ba 100644 --- a/reference/expected/expected.void/value.md +++ b/reference/expected/expected.void/value.md @@ -20,8 +20,8 @@ constexpr void value() &&; // (2) ## 例外 -- (1) : エラー値を保持していたら、例外[`bad_expected_access`](../bad_expected_access.md)`(`[`error()`](error.md)`)`をスローする -- (2) : エラー値を保持していたら、例外[`bad_expected_access`](../bad_expected_access.md)`(`[`std::move`](/reference/utility/move.md)`(`[`error()`](error.md)`))`をスローする +- (1) : エラー値を保持していたら、例外[`bad_expected_access`](../bad_expected_access.md)`(`[`error()`](error.md)`)`を送出する +- (2) : エラー値を保持していたら、例外[`bad_expected_access`](../bad_expected_access.md)`(`[`std::move`](/reference/utility/move.md)`(`[`error()`](error.md)`))`を送出する ## 例 diff --git a/reference/expected/expected/swap.md b/reference/expected/expected/swap.md index 6786915ba3..f453d7f42b 100644 --- a/reference/expected/expected/swap.md +++ b/reference/expected/expected/swap.md @@ -77,7 +77,7 @@ noexcept例外指定は次の式に従う : [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)` &&` [`is_nothrow_swappable_v`](/reference/type_traits/is_nothrow_swappable.md)` &&` [`is_nothrow_move_constructible_v`](/reference/type_traits/is_nothrow_move_constructible.md)` &&` [`is_nothrow_swappable_v`](/reference/type_traits/is_nothrow_swappable.md)`` -noexcept例外指定が`false`の場合、上記の「効果」による処理からの例外がスローされる。 +noexcept例外指定が`false`の場合、上記の「効果」による処理からの例外が送出される。 ## 例 diff --git a/reference/expected/expected/value.md b/reference/expected/expected/value.md index ede35fc45c..74e1296191 100644 --- a/reference/expected/expected/value.md +++ b/reference/expected/expected/value.md @@ -24,8 +24,8 @@ constexpr T&& value() &&; // (4) ## 例外 -- (1), (2) : エラー値を保持していたら、例外[`bad_expected_access`](../bad_expected_access.md)`(`[`error()`](error.md)`)`をスローする -- (3), (4) : エラー値を保持していたら、例外[`bad_expected_access`](../bad_expected_access.md)`(`[`std::move`](/reference/utility/move.md)`(`[`error()`](error.md)`))`をスローする +- (1), (2) : エラー値を保持していたら、例外[`bad_expected_access`](../bad_expected_access.md)`(`[`error()`](error.md)`)`を送出する +- (3), (4) : エラー値を保持していたら、例外[`bad_expected_access`](../bad_expected_access.md)`(`[`std::move`](/reference/utility/move.md)`(`[`error()`](error.md)`))`を送出する ## 例 diff --git a/reference/map/map/merge.md b/reference/map/map/merge.md index 425ff823fd..0b1c865e04 100644 --- a/reference/map/map/merge.md +++ b/reference/map/map/merge.md @@ -41,7 +41,7 @@ template ## 例外 -比較オブジェクトが例外をスローしない限り、例外をスローしない。 +比較オブジェクトが例外を送出しない限り、例外を送出しない。 ## 例 diff --git a/reference/map/multimap/merge.md b/reference/map/multimap/merge.md index 922be06c26..e229e9eee7 100644 --- a/reference/map/multimap/merge.md +++ b/reference/map/multimap/merge.md @@ -40,7 +40,7 @@ template ## 例外 -比較オブジェクトが例外をスローしない限り、例外をスローしない。 +比較オブジェクトが例外を送出しない限り、例外を送出しない。 ## 例 diff --git a/reference/memory/allocate_shared.md b/reference/memory/allocate_shared.md index 25e51ca626..c435d30a3f 100644 --- a/reference/memory/allocate_shared.md +++ b/reference/memory/allocate_shared.md @@ -71,7 +71,7 @@ namespace std { オブジェクトは、それぞれのオーバーロードで指定された引数から初期化される。 -例外がスローされた場合、関数は効果がない。 +例外が送出された場合、関数は効果がない。 配列型`U`のオブジェクトが(同じ型の)`u`の初期値を持つように指定されている場合、これは、オブジェクトの各配列要素が初期値として`u`からの対応する要素を持つことを意味すると解釈される。 @@ -89,7 +89,7 @@ namespace std { 配列要素は、アドレスの昇順で初期化される。 -戻り値によって管理されるオブジェクトの`lifetime`が終了するか、配列要素の初期化が例外をスローすると、初期化された要素は元の構造の逆の順序で破棄される。 +戻り値によって管理されるオブジェクトの`lifetime`が終了するか、配列要素の初期化が例外を送出すると、初期化された要素は元の構造の逆の順序で破棄される。 この関数によって初期化された非配列型`U`の(サブ)オブジェクトが破棄される場合、式`allocator_traits::destroy(a2, pv)`によって破棄される。`pv`はその型のオブジェクトを指す。`remove_cv_t`および型`A2`の`a2`は、`value_type`が`remove_cv_t`になるように`allocate_shared`に渡されるアロケーター`a`の再束縛されたコピーである。 @@ -108,7 +108,7 @@ namespace std { ## 例外 -`bad_alloc`、または`allocate`またはオブジェクトの初期化からスローされた例外。 +`bad_alloc`、または`allocate`またはオブジェクトの初期化から送出された例外。 ## 備考 diff --git a/reference/memory/allocate_shared_for_overwrite.md b/reference/memory/allocate_shared_for_overwrite.md index e7f47f2b59..5f758d72d2 100644 --- a/reference/memory/allocate_shared_for_overwrite.md +++ b/reference/memory/allocate_shared_for_overwrite.md @@ -36,13 +36,13 @@ namespace std { すべてのオーバーロードにおいて、確保された領域のオブジェクトはデフォルト構築される。 -例外がスローされた場合、関数は効果がない。 +例外が送出された場合、関数は効果がない。 非配列型`U`の(サブ)オブジェクトがこの関数によって初期化されるときは、式`::new(pv) U`によって初期化される。ここで、`pv`は型 `void *`を持ち、型`U`のオブジェクトを保持するための適切なストレージを指す。 配列要素は、アドレスの昇順で初期化される。 -戻り値によって管理されるオブジェクトの`lifetime`が終了するか、配列要素の初期化が例外をスローすると、初期化された要素は元の構造の逆の順序で破棄される。 +戻り値によって管理されるオブジェクトの`lifetime`が終了するか、配列要素の初期化が例外を送出すると、初期化された要素は元の構造の逆の順序で破棄される。 - (1) : このオーバーロードが選択されるとき、`T`は、不明な境界の配列ではない。`T`型のオブジェクトへの`shared_ptr`を返す。 - (2) : このオーバーロードが選択されるとき、`T`は、不明な境界の配列である。型`U[N]`のオブジェクトへの`shared_ptr`を返す。ここで、`U`は[`remove_extent_t`](/reference/type_traits/remove_extent.md)である。 @@ -56,7 +56,7 @@ namespace std { ## 例外 -`bad_alloc`、または`allocate`またはオブジェクトの初期化からスローされた例外。 +`bad_alloc`、または`allocate`またはオブジェクトの初期化から送出された例外。 ## 備考 diff --git a/reference/memory/make_shared.md b/reference/memory/make_shared.md index ef9d12e0d4..ad37714e96 100644 --- a/reference/memory/make_shared.md +++ b/reference/memory/make_shared.md @@ -56,7 +56,7 @@ namespace std { オブジェクトは、それぞれのオーバーロードで指定された引数から初期化される。 -例外がスローされた場合、関数は効果がない。 +例外が送出された場合、関数は効果がない。 配列型`U`のオブジェクトが(同じ型の)`u`の初期値を持つように指定されている場合、これは、オブジェクトの各配列要素が初期値として`u`からの対応する要素を持つことを意味すると解釈される。 @@ -68,7 +68,7 @@ namespace std { 配列要素は、アドレスの昇順で初期化される。 -戻り値によって管理されるオブジェクトの`lifetime`が終了するか、配列要素の初期化が例外をスローすると、初期化された要素は元の構造の逆の順序で破棄される。 +戻り値によって管理されるオブジェクトの`lifetime`が終了するか、配列要素の初期化が例外を送出すると、初期化された要素は元の構造の逆の順序で破棄される。 この関数によって初期化された非配列型`U`の(サブ)オブジェクトを破棄する場合、式`pv->~U()`によって破棄される。pvは型`U`のオブジェクトを指す。 @@ -88,7 +88,7 @@ namespace std { ## 例外 -`bad_alloc`、または`allocate`またはオブジェクトの初期化からスローされた例外。 +`bad_alloc`、または`allocate`またはオブジェクトの初期化から送出された例外。 ## 備考 diff --git a/reference/memory/make_shared_for_overwrite.md b/reference/memory/make_shared_for_overwrite.md index 1256852e0a..0fcf744cc3 100644 --- a/reference/memory/make_shared_for_overwrite.md +++ b/reference/memory/make_shared_for_overwrite.md @@ -24,13 +24,13 @@ namespace std { すべてのオーバーロードにおいて、確保された領域のオブジェクトはデフォルト構築される。 -例外がスローされた場合、関数は効果がない。 +例外が送出された場合、関数は効果がない。 非配列型`U`の(サブ)オブジェクトがこの関数によって初期化されるときは、式`::new(pv) U`によって初期化される。ここで、`pv`は型 `void *`を持ち、型`U`のオブジェクトを保持するための適切なストレージを指す。 配列要素は、アドレスの昇順で初期化される。 -戻り値によって管理されるオブジェクトの`lifetime`が終了するか、配列要素の初期化が例外をスローすると、初期化された要素は元の構造の逆の順序で破棄される。 +戻り値によって管理されるオブジェクトの`lifetime`が終了するか、配列要素の初期化が例外を送出すると、初期化された要素は元の構造の逆の順序で破棄される。 - (1) : このオーバーロードが選択されるとき、`T`は、不明な境界の配列ではない。`T`型のオブジェクトへの`shared_ptr`を返す。 - (2) : このオーバーロードが選択されるとき、`T`は、不明な境界の配列である。型`U[N]`のオブジェクトへの`shared_ptr`を返す。ここで、`U`は[`remove_extent_t`](/reference/type_traits/remove_extent.md)である。 @@ -44,7 +44,7 @@ namespace std { ## 例外 -`bad_alloc`、または`allocate`またはオブジェクトの初期化からスローされた例外。 +`bad_alloc`、または`allocate`またはオブジェクトの初期化から送出された例外。 ## 備考 diff --git a/reference/memory/ranges_uninitialized_copy.md b/reference/memory/ranges_uninitialized_copy.md index 6b1168ecd1..7e76fade95 100644 --- a/reference/memory/ranges_uninitialized_copy.md +++ b/reference/memory/ranges_uninitialized_copy.md @@ -101,7 +101,7 @@ return {std::move(ifirst), ofirst}; ## 例外 -呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 +呼び出すコンストラクタなどから例外が送出された場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外が送出された場合は初期化対象領域は未初期化のままとなる。 ## 例 diff --git a/reference/memory/ranges_uninitialized_copy_n.md b/reference/memory/ranges_uninitialized_copy_n.md index 6060168c45..fb409e56e4 100644 --- a/reference/memory/ranges_uninitialized_copy_n.md +++ b/reference/memory/ranges_uninitialized_copy_n.md @@ -73,7 +73,7 @@ return {std::move(t.in).base(), t.out}; ## 例外 -呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 +呼び出すコンストラクタなどから例外が送出された場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外が送出された場合は初期化対象領域は未初期化のままとなる。 ## 例 diff --git a/reference/memory/ranges_uninitialized_default_construct.md b/reference/memory/ranges_uninitialized_default_construct.md index 2450c3fb17..32812ee0c1 100644 --- a/reference/memory/ranges_uninitialized_default_construct.md +++ b/reference/memory/ranges_uninitialized_default_construct.md @@ -69,7 +69,7 @@ return first; ## 例外 -呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 +呼び出すコンストラクタなどから例外が送出された場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外が送出された場合は初期化対象領域は未初期化のままとなる。 ## 備考 - [`std::vector`](/reference/vector/vector.md)クラスの要素数を変更する操作は、要素を値構築するためゼロ初期化が行われる。その値初期化のコストが気になるような場合に、デフォルト構築することでプログラマの責任で必要な分だけ任意に初期化でき、パフォーマンス向上が期待できるようになる。 diff --git a/reference/memory/ranges_uninitialized_default_construct_n.md b/reference/memory/ranges_uninitialized_default_construct_n.md index 3590484b13..6e9cd283b4 100644 --- a/reference/memory/ranges_uninitialized_default_construct_n.md +++ b/reference/memory/ranges_uninitialized_default_construct_n.md @@ -43,7 +43,7 @@ return uninitialized_default_construct(counted_iterator(first, n), ## 例外 -呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 +呼び出すコンストラクタなどから例外が送出された場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外が送出された場合は初期化対象領域は未初期化のままとなる。 ## 例 ```cpp example diff --git a/reference/memory/ranges_uninitialized_fill.md b/reference/memory/ranges_uninitialized_fill.md index a445b12e8b..735aa3dfac 100644 --- a/reference/memory/ranges_uninitialized_fill.md +++ b/reference/memory/ranges_uninitialized_fill.md @@ -75,7 +75,7 @@ return first; ## 例外 -呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 +呼び出すコンストラクタなどから例外が送出された場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外が送出された場合は初期化対象領域は未初期化のままとなる。 ## 例 ```cpp example diff --git a/reference/memory/ranges_uninitialized_fill_n.md b/reference/memory/ranges_uninitialized_fill_n.md index 31e6efbafe..5c03777726 100644 --- a/reference/memory/ranges_uninitialized_fill_n.md +++ b/reference/memory/ranges_uninitialized_fill_n.md @@ -45,7 +45,7 @@ return uninitialized_fill(counted_iterator(first, n), default_sentinel, x).base( ## 例外 -呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 +呼び出すコンストラクタなどから例外が送出された場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外が送出された場合は初期化対象領域は未初期化のままとなる。 ## 例 ```cpp example diff --git a/reference/memory/ranges_uninitialized_move.md b/reference/memory/ranges_uninitialized_move.md index bc0b4ba581..2fca1ad0fe 100644 --- a/reference/memory/ranges_uninitialized_move.md +++ b/reference/memory/ranges_uninitialized_move.md @@ -92,7 +92,7 @@ return {std::move(ifirst), ofirst}; ## 例外 -呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 +呼び出すコンストラクタなどから例外が送出された場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外が送出された場合は初期化対象領域は未初期化のままとなる。 またその場合、`[ifirst, ilast)`内の一部のオブジェクトは有効だが未規定な状態として残される。 diff --git a/reference/memory/ranges_uninitialized_move_n.md b/reference/memory/ranges_uninitialized_move_n.md index b5bec1bbd8..044b99e9f7 100644 --- a/reference/memory/ranges_uninitialized_move_n.md +++ b/reference/memory/ranges_uninitialized_move_n.md @@ -72,7 +72,7 @@ return {std::move(t.in).base(), t.out}; ## 例外 -呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 +呼び出すコンストラクタなどから例外が送出された場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外が送出された場合は初期化対象領域は未初期化のままとなる。 またその場合、`[ifirst, ifirst + n)`内の一部のオブジェクトは有効だが未規定な状態として残される。 diff --git a/reference/memory/ranges_uninitialized_value_construct.md b/reference/memory/ranges_uninitialized_value_construct.md index 413c81d2b0..2e1d244235 100644 --- a/reference/memory/ranges_uninitialized_value_construct.md +++ b/reference/memory/ranges_uninitialized_value_construct.md @@ -69,7 +69,7 @@ return first; ## 例外 -呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 +呼び出すコンストラクタなどから例外が送出された場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外が送出された場合は初期化対象領域は未初期化のままとなる。 ## 例 diff --git a/reference/memory/ranges_uninitialized_value_construct_n.md b/reference/memory/ranges_uninitialized_value_construct_n.md index 346ee48145..be08059256 100644 --- a/reference/memory/ranges_uninitialized_value_construct_n.md +++ b/reference/memory/ranges_uninitialized_value_construct_n.md @@ -43,7 +43,7 @@ return uninitialized_value_construct(counted_iterator(first, n), ## 例外 -呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 +呼び出すコンストラクタなどから例外が送出された場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外が送出された場合は初期化対象領域は未初期化のままとなる。 ## 例 diff --git a/reference/memory/uninitialized_copy.md b/reference/memory/uninitialized_copy.md index 43f02a3439..d8fab7c639 100644 --- a/reference/memory/uninitialized_copy.md +++ b/reference/memory/uninitialized_copy.md @@ -55,7 +55,7 @@ namespace std { ## 例外 -呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 +呼び出すコンストラクタなどから例外が送出された場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外が送出された場合は初期化対象領域は未初期化のままとなる。 ### 例 diff --git a/reference/memory/uninitialized_copy_n.md b/reference/memory/uninitialized_copy_n.md index 91d6ff9ae3..7904726a94 100644 --- a/reference/memory/uninitialized_copy_n.md +++ b/reference/memory/uninitialized_copy_n.md @@ -65,7 +65,7 @@ namespace std { ## 例外 -呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 +呼び出すコンストラクタなどから例外が送出された場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外が送出された場合は初期化対象領域は未初期化のままとなる。 ### 例 diff --git a/reference/memory/uninitialized_default_construct.md b/reference/memory/uninitialized_default_construct.md index 950f3c0e9a..b5c2fae316 100644 --- a/reference/memory/uninitialized_default_construct.md +++ b/reference/memory/uninitialized_default_construct.md @@ -44,7 +44,7 @@ for (; first != last; ++first) ## 例外 -呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 +呼び出すコンストラクタなどから例外が送出された場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外が送出された場合は初期化対象領域は未初期化のままとなる。 ## 備考 - [`std::vector`](/reference/vector/vector.md)クラスの要素数を変更する操作は、要素を値構築するためゼロ初期化が行われる。その値初期化のコストが気になるような場合に、デフォルト構築することでプログラマの責任で必要な分だけ任意に初期化でき、パフォーマンス向上が期待できるようになる。 diff --git a/reference/memory/uninitialized_default_construct_n.md b/reference/memory/uninitialized_default_construct_n.md index 09c2d8fa7a..eac895b9c8 100644 --- a/reference/memory/uninitialized_default_construct_n.md +++ b/reference/memory/uninitialized_default_construct_n.md @@ -41,7 +41,7 @@ return first; ## 例外 -呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 +呼び出すコンストラクタなどから例外が送出された場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外が送出された場合は初期化対象領域は未初期化のままとなる。 ## 備考 - [`std::vector`](/reference/vector/vector.md)クラスの要素数を変更する操作は、要素を値構築するためゼロ初期化が行われる。その値初期化のコストが気になるような場合に、デフォルト構築することでプログラマの責任で必要な分だけ任意に初期化でき、パフォーマンス向上が期待できるようになる。 diff --git a/reference/memory/uninitialized_fill.md b/reference/memory/uninitialized_fill.md index 89b10d989e..c7f6879558 100644 --- a/reference/memory/uninitialized_fill.md +++ b/reference/memory/uninitialized_fill.md @@ -52,7 +52,7 @@ namespace std { ## 例外 -呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 +呼び出すコンストラクタなどから例外が送出された場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外が送出された場合は初期化対象領域は未初期化のままとなる。 ### 例 ```cpp example diff --git a/reference/memory/uninitialized_fill_n.md b/reference/memory/uninitialized_fill_n.md index a0d05f426d..578eea2423 100644 --- a/reference/memory/uninitialized_fill_n.md +++ b/reference/memory/uninitialized_fill_n.md @@ -52,7 +52,7 @@ namespace std { ## 例外 -呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 +呼び出すコンストラクタなどから例外が送出された場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外が送出された場合は初期化対象領域は未初期化のままとなる。 ### 例 ```cpp example diff --git a/reference/memory/uninitialized_move.md b/reference/memory/uninitialized_move.md index b200530c15..59c0077dc5 100644 --- a/reference/memory/uninitialized_move.md +++ b/reference/memory/uninitialized_move.md @@ -51,7 +51,7 @@ for (; first != last; ++result, ++first) ## 例外 -呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 +呼び出すコンストラクタなどから例外が送出された場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外が送出された場合は初期化対象領域は未初期化のままとなる。 ### 例 ```cpp example diff --git a/reference/memory/uninitialized_move_n.md b/reference/memory/uninitialized_move_n.md index 0ef7d0d1b7..3dbc29ac8f 100644 --- a/reference/memory/uninitialized_move_n.md +++ b/reference/memory/uninitialized_move_n.md @@ -51,7 +51,7 @@ for (; n > 0; ++result, (void)++first, --n) ## 例外 -呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 +呼び出すコンストラクタなどから例外が送出された場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外が送出された場合は初期化対象領域は未初期化のままとなる。 ### 例 ```cpp example diff --git a/reference/memory/uninitialized_value_construct.md b/reference/memory/uninitialized_value_construct.md index 0aa5770c29..6355940430 100644 --- a/reference/memory/uninitialized_value_construct.md +++ b/reference/memory/uninitialized_value_construct.md @@ -44,7 +44,7 @@ for (; first != last; ++first) ## 例外 -呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 +呼び出すコンストラクタなどから例外が送出された場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外が送出された場合は初期化対象領域は未初期化のままとなる。 ### 例 ```cpp example diff --git a/reference/memory/uninitialized_value_construct_n.md b/reference/memory/uninitialized_value_construct_n.md index 82279e8cdf..32bd77b77c 100644 --- a/reference/memory/uninitialized_value_construct_n.md +++ b/reference/memory/uninitialized_value_construct_n.md @@ -41,7 +41,7 @@ return first; ## 例外 -呼び出すコンストラクタなどから例外がスローされた場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外がスローされた場合は初期化対象領域は未初期化のままとなる。 +呼び出すコンストラクタなどから例外が送出された場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外が送出された場合は初期化対象領域は未初期化のままとなる。 ### 例 diff --git a/reference/new.md b/reference/new.md index 6873fb64ce..67e2929cdc 100644 --- a/reference/new.md +++ b/reference/new.md @@ -9,10 +9,10 @@ | 名前 | 説明 | 対応バージョン | |-----------------------------------|-------------------------------------------------|-------| -| [`bad_alloc`](new/bad_alloc.md) | 何らかの理由で記憶域の動的確保に失敗するなど、`get_new_handler()`が`nullptr`を返した場合にスローされる例外(class) | | -| [`bad_array_new_length`](new/bad_array_new_length.md) | 動的に記憶域を確保しようとする配列の長さが0未満または処理系の最大値以上の場合にスローされる例外(class) | C++11 | +| [`bad_alloc`](new/bad_alloc.md) | 何らかの理由で記憶域の動的確保に失敗するなど、`get_new_handler()`が`nullptr`を返した場合に送出される例外(class) | | +| [`bad_array_new_length`](new/bad_array_new_length.md) | 動的に記憶域を確保しようとする配列の長さが0未満または処理系の最大値以上の場合に送出される例外(class) | C++11 | | [`align_val_t`](new/align_val_t.md) | デフォルトよりも大きなアライメントを要求するとき、`new` に渡されるアライメント値の型 | C++17 | -| [`nothrow_t`](new/nothrow_t.md) | 例外をスローしないための`std::nothrow`の型 | | +| [`nothrow_t`](new/nothrow_t.md) | 例外を送出しないための`std::nothrow`の型 | | | [`new_handler`](new/new_handler.md) | `new`失敗時に呼ばれる関数の型 | | | [`destroying_delete_t`](new/destroying_delete_t.md) | *destroying operator delete*を定義するためのタグ型 | C++20 | diff --git a/reference/new/nothrow_t.md b/reference/new/nothrow_t.md index 12ed75df61..e88f37421b 100644 --- a/reference/new/nothrow_t.md +++ b/reference/new/nothrow_t.md @@ -35,7 +35,7 @@ int main() int* p = new(std::nothrow) int[3]; // ただし、オブジェクトのコンストラクタが例外を投げる場合は - // 例外がスローされることに注意 + // 例外が送出されることに注意 try { ThrowObj* obj = new(std::nothrow) ThrowObj(); diff --git a/reference/new/op_new.md b/reference/new/op_new.md index ae0e149ca6..ce4f884df0 100644 --- a/reference/new/op_new.md +++ b/reference/new/op_new.md @@ -100,17 +100,17 @@ constexpr void* operator new(std::size_t size, - `size` で指定したサイズ(バイト)の記憶域を確保しようとする。なお、記憶域の確保に C 互換ライブラリ関数 `malloc()` や [`aligned_alloc()`](/reference/cstdlib/aligned_alloc.md) を用いるか否かは規定されていない。 - もし、記憶域を確保できた場合、確保した先頭アドレスを返す。 - もし、確保できなかった場合、 - - 現在の [`new_handler`](new_handler.md) が ヌルポインタであれば、[`bad_alloc`](bad_alloc.md) 例外をスローする。 + - 現在の [`new_handler`](new_handler.md) が ヌルポインタであれば、[`bad_alloc`](bad_alloc.md) 例外を送出する。 - 現在の [`new_handler`](new_handler.md) が ヌルポインタでなければ、当該関数を呼び出した後、最初に戻って記憶域の確保から再試行する(ループする)。 - なお、[`new_handler`](new_handler.md) は [`bad_alloc`](bad_alloc.md) 例外をスローしたり、呼び出し元に戻らなかったりすることがあるので注意。 + なお、[`new_handler`](new_handler.md) は [`bad_alloc`](bad_alloc.md) 例外を送出したり、呼び出し元に戻らなかったりすることがあるので注意。 - (3) の形式の詳細な正確な挙動は、以下の通り C++03 までと C++11 以降で異なる。 - - C++03 までの場合、(1) の形式とほぼ同様の処理を行うが、記憶域が確保できなかったり、現在の [`new_handler`](new_handler.md) が[`bad_alloc`](bad_alloc.md) 例外をスローしたりした場合には、ヌルポインタを返す。 - - C++11 以降の場合、(1) の形式を呼び出し、[`bad_alloc`](bad_alloc.md) 例外がスローされた場合には、ヌルポインタを返す。 + - C++03 までの場合、(1) の形式とほぼ同様の処理を行うが、記憶域が確保できなかったり、現在の [`new_handler`](new_handler.md) が[`bad_alloc`](bad_alloc.md) 例外を送出したりした場合には、ヌルポインタを返す。 + - C++11 以降の場合、(1) の形式を呼び出し、[`bad_alloc`](bad_alloc.md) 例外が送出された場合には、ヌルポインタを返す。 この差は、利用者が `operator new` を置き換えていない場合には顕在化しないが、利用者が (1) の形式のみを置き換えた場合、C++03 までは (2) の形式を呼び出しても置き換えられたバージョンは呼び出されない。 - `new` 式と異なり、`delete` 式には配置構文が存在しないため、(3) の形式で確保した記憶域も通常の `delete` 式で解放することになる(コンストラクタで例外がスローされた場合を除く。[`operator delete`](op_delete.md)も参照)。 + `new` 式と異なり、`delete` 式には配置構文が存在しないため、(3) の形式で確保した記憶域も通常の `delete` 式で解放することになる(コンストラクタで例外が送出された場合を除く。[`operator delete`](op_delete.md)も参照)。 従って、C++03 までの場合、(1) の形式を利用者提供の関数で置き換える場合は、(3) の形式も (1) の形式と同様の記憶域確保を行う利用者提供の関数で置き換えるべきである。その場合、C++11 の (3) の形式のように、(1) を呼び出した上で例外ハンドリングする方法が安全確実な方法である。 なお、C++11 からは (3) の形式は (1) を呼び出すことになっているため、 (1) の形式のみを置き換えれば問題はないが、C++03 までのバージョンでも同様に動くようにするため、あるいは、標準ライブラリのバグで (3) の形式が (1) の形式を呼び出していない可能性もあるため、(3) の形式も提供した方が良いかもしれない。 @@ -119,7 +119,7 @@ constexpr void* operator new(std::size_t size, - `new` 式は `operator new` を呼び出すだけではない事に注意。 `new` 式は、`operator new` を呼び出した後、確保された記憶域上にオブジェクトを構築する(つまり、コンストラクタを呼び出す)。 - 特に、(3) の形式を使用するために `new` 式を `new(std::`[`nothrow`](nothrow_t.md)`)` のようにしても、依然としてコンストラクタが例外をスローする可能性はあるため、`new` 式が例外をスローしないとは限らない。 + 特に、(3) の形式を使用するために `new` 式を `new(std::`[`nothrow`](nothrow_t.md)`)` のようにしても、依然としてコンストラクタが例外を送出する可能性はあるため、`new` 式が例外を送出しないとは限らない。 ## 例 diff --git a/reference/new/op_new[].md b/reference/new/op_new[].md index 93b2888954..c06263c1ca 100644 --- a/reference/new/op_new[].md +++ b/reference/new/op_new[].md @@ -60,7 +60,7 @@ constexpr void* operator new[](std::size_t size, void* ptr) noexcept; // (5) - (1), (2) : [`operator new`](op_new.md)`(size)` を呼び出す。アライメントに関しては単一オブジェクト版と同様に動作する。 - (3), (4) : C++03 までと C++11 からで異なる。 - C++03 まで:[`operator new`](op_new.md)`(size, std::`[`nothrow`](nothrow_t.md)`)` を呼び出す。 - - C++11 から:(1) の形式を `operator new[](size)` で呼び出す。ただし、記憶域の確保に失敗しても例外をスローしない。 + - C++11 から:(1) の形式を `operator new[](size)` で呼び出す。ただし、記憶域の確保に失敗しても例外を送出しない。 - (5) : 何もしない。 @@ -68,7 +68,7 @@ constexpr void* operator new[](std::size_t size, void* ptr) noexcept; // (5) - (1), (2) : 確保した記憶域の先頭アドレスを指すポインタ([`operator new`](op_new.md)`(size)` の戻り値)。 - (3), (4) : 記憶域を確保できた場合、確保した記憶域の先頭アドレスを指すポインタ。確保できなかった場合、ヌルポインタ。 - C++03 まで:[`operator new`](op_new.md)`(size, std::`[`nothrow`](nothrow_t.md)`)` の戻り値 - - C++11 から:`operator new[](size)` の戻り値。ただし、`std::`[`bad_alloc`](bad_alloc.md) 例外がスローされた場合には、ヌルポインタ。 + - C++11 から:`operator new[](size)` の戻り値。ただし、`std::`[`bad_alloc`](bad_alloc.md) 例外が送出された場合には、ヌルポインタ。 - (5) : 引数 `ptr` @@ -89,7 +89,7 @@ constexpr void* operator new[](std::size_t size, void* ptr) noexcept; // (5) - (3) の形式の挙動の C++03 までと C++11 からの差は、利用者が [`operator new`](op_new.md)、あるいは `operator new[]` を置き換えていない場合には顕在化しない。 しかし、例えば利用者が (1) の形式のみを置き換えた場合、C++03 までは (3) の形式を呼び出しても置き換えられたバージョンは呼び出されずに、間接的に[`operator new`](op_new.md) の (3) の形式を呼び出す。 - `new` 式と異なり、`delete` 式には配置構文が存在しないため、(3) の形式で確保した記憶域も通常の `delete` 式で解放する事になる(コンストラクタで例外がスローされた場合を除く。[`operator delete[]`](op_delete[].md) も参照)。 + `new` 式と異なり、`delete` 式には配置構文が存在しないため、(3) の形式で確保した記憶域も通常の `delete` 式で解放する事になる(コンストラクタで例外が送出された場合を除く。[`operator delete[]`](op_delete[].md) も参照)。 従って、C++03 までの場合、(1) の形式を利用者提供の関数で置き換える場合は、(3) の形式も (1) の形式と同様の記憶域確保を行う利用者提供の関数で置き換えるべきである。その場合、C++11 の (3) の形式のように、(1) を呼び出した上で例外ハンドリングする方法が安全確実な方法である。 なお、C++11 からは (3) の形式は (1) を呼び出すことになっているため、 (1) の形式のみを置き換えれば問題はないが、C++03 までのバージョンでも同様に動くようにするため、あるいは、標準ライブラリのバグで (3) の形式が (1) の形式を呼び出していない可能性もあるため、(3) の形式も提供した方が良いかもしれない。 @@ -99,8 +99,8 @@ constexpr void* operator new[](std::size_t size, void* ptr) noexcept; // (5) - 配列版 `new` 式は `operator new[]` を呼び出すだけではない事に注意。 配列版 `new` 式は、`operator new[]` を呼び出した後、確保された記憶域上にオブジェクトを構築する(つまり、コンストラクタを呼び出す)。 - 特に、(3) の形式を使用するために `new` 式を `new(std::`[`nothrow`](nothrow_t.md)`)` のようにしても、依然としてコンストラクタが例外をスローする可能性はあるため、`new` 式が例外をスローしないとは限らない。 - また、配列版 `new` 式は、C++11 以降、配列の要素数の指定によっては `std::`[`bad_array_new_length`](bad_array_new_length.md) をスローする可能性もある。 + 特に、(3) の形式を使用するために `new` 式を `new(std::`[`nothrow`](nothrow_t.md)`)` のようにしても、依然としてコンストラクタが例外を送出する可能性はあるため、`new` 式が例外を送出しないとは限らない。 + また、配列版 `new` 式は、C++11 以降、配列の要素数の指定によっては `std::`[`bad_array_new_length`](bad_array_new_length.md) を送出する可能性もある。 - 引数 `size` は、配列版 `new` 式で指定されている配列の合計サイズより大きい可能性がある。 これは、配列版 `delete` 式を実行する際に、全要素に対してデストラクタを呼び出す等のために、配列要素そのもの以外の情報を格納することがあるためである。 diff --git a/reference/set/multiset/merge.md b/reference/set/multiset/merge.md index de1853859e..6ed8b10eda 100644 --- a/reference/set/multiset/merge.md +++ b/reference/set/multiset/merge.md @@ -40,7 +40,7 @@ template ## 例外 -比較オブジェクトが例外をスローしない限り、例外をスローしない。 +比較オブジェクトが例外を送出しない限り、例外を送出しない。 ## 例 diff --git a/reference/set/set/merge.md b/reference/set/set/merge.md index a36d471845..ca5bb9db26 100644 --- a/reference/set/set/merge.md +++ b/reference/set/set/merge.md @@ -41,7 +41,7 @@ template ## 例外 -比較オブジェクトが例外をスローしない限り、例外をスローしない。 +比較オブジェクトが例外を送出しない限り、例外を送出しない。 ## 例 diff --git a/reference/stdexcept/domain_error.md b/reference/stdexcept/domain_error.md index 2d32011e28..0045c78227 100644 --- a/reference/stdexcept/domain_error.md +++ b/reference/stdexcept/domain_error.md @@ -13,7 +13,7 @@ namespace std { ## 概要 関数引数に定義域の外の値が指定された場合に処理系が送出する例外およびその基底クラスである。 -実際には標準ライブラリのコンポーネントはこの例外をスローせず、 +実際には標準ライブラリのコンポーネントはこの例外を送出せず、 代わりにユーザーが使うことができる。 ## メンバ関数 diff --git a/reference/stdexcept/logic_error.md b/reference/stdexcept/logic_error.md index 57925ad387..fd4063680e 100644 --- a/reference/stdexcept/logic_error.md +++ b/reference/stdexcept/logic_error.md @@ -12,7 +12,7 @@ namespace std { ## 概要 -`logic_error`クラスはプログラムの実行前に検出可能なエラー(論理エラー)を通知するためにスローされる例外クラス全般に対する基底クラスである。 +`logic_error`クラスはプログラムの実行前に検出可能なエラー(論理エラー)を通知するために送出される例外クラス全般に対する基底クラスである。 ## メンバ関数 diff --git a/reference/syncstream/basic_syncbuf/op_constructor.md b/reference/syncstream/basic_syncbuf/op_constructor.md index 6bd4e1e356..a8eb87ea85 100644 --- a/reference/syncstream/basic_syncbuf/op_constructor.md +++ b/reference/syncstream/basic_syncbuf/op_constructor.md @@ -27,7 +27,7 @@ basic_syncbuf(basic_syncbuf&& other); // (3) ## 例外 -- (1), (2) : ミューテックスの構築から[`std::system_error`](../../system_error/system_error.md)、またはメモリ割り当てによって[`std::bad_alloc`](../../new/bad_alloc.md)例外がスローされる可能性がある。 +- (1), (2) : ミューテックスの構築から[`std::system_error`](../../system_error/system_error.md)、またはメモリ割り当てによって[`std::bad_alloc`](../../new/bad_alloc.md)例外が送出される可能性がある。 ## 事後条件 From b6af1b0755c70a6344c4f50a2a7fc467d2904963 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 7 Jan 2026 22:31:19 +0900 Subject: [PATCH 2509/3948] =?UTF-8?q?basic=5Fstring=20:=20=E6=A4=9C?= =?UTF-8?q?=E7=B4=A2=E3=82=A8=E3=83=B3=E3=82=B8=E3=83=B3=E7=94=A8=E3=81=AE?= =?UTF-8?q?=E3=83=9A=E3=83=BC=E3=82=B8=E5=88=A5=E5=90=8D=E3=82=92=E7=99=BB?= =?UTF-8?q?=E9=8C=B2=20#1545?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/string/basic_string.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/string/basic_string.md b/reference/string/basic_string.md index c4682fac5b..fc53cd9da6 100644 --- a/reference/string/basic_string.md +++ b/reference/string/basic_string.md @@ -2,6 +2,7 @@ * string[meta header] * std[meta namespace] * class template[meta id-type] +* string,u8string,u16string,u32string,wstring[meta alias] ```cpp namespace std { From 9cec653b345af51f952abf1c013b42dffe9a3f72 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 8 Jan 2026 11:02:17 +0900 Subject: [PATCH 2510/3948] =?UTF-8?q?C++26=E3=81=AEWorking=20Draft?= =?UTF-8?q?=E3=82=92=E6=9B=B4=E6=96=B0=20#1555?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- international-standard.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/international-standard.md b/international-standard.md index 88827e832f..e37ef4f151 100644 --- a/international-standard.md +++ b/international-standard.md @@ -12,7 +12,7 @@ C++ の標準規格は、他にも各国の規格化団体によって国際標 | 通称†1 | 名称 | 参照する規格案†2 | 規格案・原案 | `__cplusplus` | |:--|:--|:--|:--|:--| -| [C++26](lang/cpp26.md) (C++2c) | ISO/IEC 14882:2026 (予定) | N5014([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/n5014.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/)) | N5014 N5008 N5001 N4993 N4986 N4981 N4971 N4964 N4958 | -- | +| [C++26](lang/cpp26.md) (C++2c) | ISO/IEC 14882:2026 (予定) | N5032([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/n5032.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/)) | N5032 N5014 N5008 N5001 N4993 N4986 N4981 N4971 N4964 N4958 | -- | | [C++23](lang/cpp23.md) (C++2b) | ISO/IEC 14882:2024 | N4950([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4950.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4950/)) | N4950 N4944 N4928 N4917 N4910 N4901 N4892 N4885 N4878
N4868 N4861 | `202302L` | | [C++20](lang/cpp20.md) (C++2a) | ISO/IEC 14882:2020 | N4861†3([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/n4861.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4861/)) | N4860 N4849 N4842 N4835 N4830
N4820 N4810 N4800 N4791 N4788†4
N4778 N4762 N4750 N4741 N4727
N4713 N4700 N4687 | `202002L` | | [C++17](lang/cpp17.md) (C++1z) | ISO/IEC 14882:2017 | N4659([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4659.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4659/)) | N4660 N4659 N4640 N4618 N4606
N4594 N4582 N4567 N4527 N4431
N4296 | `201703L` | From a8d9c90a8acc1fdfb869f3dce18986c0fc583393 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 8 Jan 2026 11:41:47 +0900 Subject: [PATCH 2511/3948] =?UTF-8?q?=E3=82=AF=E3=83=A9=E3=82=B9=E3=81=AE?= =?UTF-8?q?=E9=9B=9B=E5=BD=A2=E3=83=9A=E3=83=BC=E3=82=B8=20:=20=E6=A4=9C?= =?UTF-8?q?=E7=B4=A2=E3=82=A8=E3=83=B3=E3=82=B8=E3=83=B3=E7=94=A8=E3=81=AB?= =?UTF-8?q?=E3=83=9A=E3=83=BC=E3=82=B8=E3=81=AE=E5=88=A5=E5=90=8D=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E7=99=BB=E9=8C=B2=E3=81=99=E3=82=8B=E3=83=A1?= =?UTF-8?q?=E3=82=BF=E6=83=85=E5=A0=B1=E3=82=92=E8=A8=98=E8=BC=89=20#1545?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ほかのページ種別でも使用できる --- start_editing/class_template_page.md | 1 + 1 file changed, 1 insertion(+) diff --git a/start_editing/class_template_page.md b/start_editing/class_template_page.md index 4b4e98ea2a..84a9d67b6b 100644 --- a/start_editing/class_template_page.md +++ b/start_editing/class_template_page.md @@ -37,6 +37,7 @@ + ```cpp namespace std { From aed41e217b72199f7da57f148473fde01b520dba Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 8 Jan 2026 11:58:15 +0900 Subject: [PATCH 2512/3948] =?UTF-8?q?C++26=20:=20=E3=83=88=E3=83=AA?= =?UTF-8?q?=E3=83=93=E3=82=A2=E3=83=AB=E3=81=AA=E5=86=8D=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E3=81=AFC++29=E3=81=AB=E5=85=88=E9=80=81=E3=82=8A=E3=81=AB?= =?UTF-8?q?=E3=81=AA=E3=81=A3=E3=81=9F=E3=81=AE=E3=81=A7=E5=89=8A=E9=99=A4?= =?UTF-8?q?=20#1421?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 1 - lang/cpp26.md | 1 - 2 files changed, 2 deletions(-) diff --git a/implementation-status.md b/implementation-status.md index 85d52055d3..0a52166cc5 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -322,7 +322,6 @@ | P3074R7: [共用体をトリビアルに未初期化できるようにする](/lang/cpp26/trivial_unions.md.nolink) | `constexpr`での`union U { T storage[N]; };`を許可し、未初期化にできるようにする | | | | | | P2900R14: [契約プログラミングをサポートする](/lang/cpp26/contracts.md) | 関数の事前条件、事後条件、不変条件を記述できるようにする | | | | | | P2841R7: [コンセプトと変数テンプレートにテンプレートテンプレートパラメータのサポートを追加](/lang/cpp26/concept_and_variable-template_template-parameters.md.nolink) | テンプレート引数をあとで指定するテンプレートテンプレートパラメータを、コンセプトと変数テンプレートでも使用できるようにする | | | | | -| P2786R13: [トリビアルな再配置](/lang/cpp26/trivial_relocatability.md.nolink) | ムーブ構築と破棄のためにビット単位のコピーとデストラクタ評価が必要になる型のオブジェクトを再配置するメカニズムを導入する | | | | | | P1967R14: [ファイルを読み込む`#embed`命令を追加](/lang/cpp26/embed.md) | バイナリファイルをインクルードするメカニズム。`#include`とちがって読み出しサイズなどの柔軟な指定ができる | 15 | | | | | P3618R0: [`main`関数をグローバルモジュールに含められるようにする](/lang/cpp26/allow_attaching_main_to_the_global_module.md.nolink) | `main`関数に`extern "C++"`を指定できるようにすることで名前付きモジュールに含められるようにする | 16 | 21 | | | | | P2996R13: [静的リフレクション](/lang/cpp26/reflection.md.nolink) | リフレクション演算子`^^`と`std::meta::info`型によりコンパイル時にさまざまな情報を取得できる | | | | | diff --git a/lang/cpp26.md b/lang/cpp26.md index 24f5f528f1..366d00be2b 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -50,7 +50,6 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| | [共用体をトリビアルに未初期化できるようにする](/lang/cpp26/trivial_unions.md.nolink) | `constexpr`での`union U { T storage[N]; };`を許可し、未初期化にできるようにする | -| [トリビアルな再配置](/lang/cpp26/trivial_relocatability.md.nolink) | ムーブ構築と破棄のためにビット単位のコピーとデストラクタ評価が必要になる型のオブジェクトを再配置するメカニズムを導入する | ### 属性 From 6626556b6354de7792b2e6490c7479380f44d189 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 8 Jan 2026 12:33:22 +0900 Subject: [PATCH 2513/3948] =?UTF-8?q?C++26:=202025-12=20mailing=E3=81=AE?= =?UTF-8?q?=E8=A8=80=E8=AA=9E=E6=A9=9F=E8=83=BD=E3=82=92=E8=A8=98=E8=BC=89?= =?UTF-8?q?=20#1555?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 1 + lang/cpp26.md | 1 + 2 files changed, 2 insertions(+) diff --git a/implementation-status.md b/implementation-status.md index 0a52166cc5..4afae86441 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -328,6 +328,7 @@ | P1306R5: [コンパイル時のタプルやリストを展開処理する`template for`文](/lang/cpp26/expansion_statements.md.nolink) | クラス・タプル・Range・パラメータパックなどを展開してすべての要素をコンパイル時の処理する`template for`文を追加 | 16 | | | | | P3533R2: [`constexpr`仮想継承を許可](/lang/cpp26/constexpr_virtual_inheritance.md.nolink) | 定数式の文脈での仮想継承を許可 | 16 | | | | | P2843R3: [プリプロセッサ仕様での「未定義動作」を不適格 (診断不要) に変更](/lang/cpp26/preprocessing_is_never_undefined.md.nolink) | プリプロセッサとレキサーの文脈での「未定義動作」用語を不適格 (診断不要) に変更 | 16 | | | | +| P3868R1: [モジュール宣言より前での`#line`ディレクティブの使用を許可する](/lang/cpp26/allow_line_before_module_declarations.md.nolink) | モジュール宣言より前での`#line`ディレクティブの使用を禁止していたのは過度な制限だった | | | | | 各処理系のC++26実装状況ページ: diff --git a/lang/cpp26.md b/lang/cpp26.md index 366d00be2b..b4fdc3d909 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -105,6 +105,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 |----------|------| | [モジュール宣言でのモジュール名のマクロ展開を禁止する](/lang/cpp26/module_declarations_shouldnt_be_macros.md) | `export module MACRO_NAME;`を禁止 | | [`main`関数をグローバルモジュールに含められるようにする](/lang/cpp26/allow_attaching_main_to_the_global_module.md.nolink) | `main`関数に`extern "C++"`を指定できるようにすることで名前付きモジュールに含められるようにする | +| [モジュール宣言より前での`#line`ディレクティブの使用を許可する](/lang/cpp26/allow_line_before_module_declarations.md.nolink) | モジュール宣言より前での`#line`ディレクティブの使用を禁止していたのは過度な制限だった | ### 機能の非推奨化 From cda81865e3fb7ea2c646438c130708bab3d11477 Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 8 Jan 2026 19:50:33 +0900 Subject: [PATCH 2514/3948] =?UTF-8?q?chrono/duration=5Faliases:=20meta=20a?= =?UTF-8?q?lias=E3=82=BF=E3=82=B0=E8=BF=BD=E5=8A=A0(#1545)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/chrono/duration_aliases.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/chrono/duration_aliases.md b/reference/chrono/duration_aliases.md index 63dedb2e51..629cb48276 100644 --- a/reference/chrono/duration_aliases.md +++ b/reference/chrono/duration_aliases.md @@ -3,6 +3,7 @@ * std::chrono[meta namespace] * type-alias[meta id-type] * cpp11[meta cpp] +* nanoseconds,microseconds,milliseconds,seconds,minutes,hours,days,weeks,years,months[meta alias] ```cpp namespace std { From 8f20b6bb2531287ef51af2d6c14c740f30bfb3ed Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 8 Jan 2026 19:58:01 +0900 Subject: [PATCH 2515/3948] =?UTF-8?q?chrono/*=5Ftime:=20meta=20alias?= =?UTF-8?q?=E3=82=BF=E3=82=B0=E8=BF=BD=E5=8A=A0(#1545)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/chrono/gps_time.md | 1 + reference/chrono/local_time.md | 1 + reference/chrono/sys_time.md | 1 + reference/chrono/tai_time.md | 1 + reference/chrono/utc_time.md | 1 + 5 files changed, 5 insertions(+) diff --git a/reference/chrono/gps_time.md b/reference/chrono/gps_time.md index bfeffef1f4..c879024d84 100644 --- a/reference/chrono/gps_time.md +++ b/reference/chrono/gps_time.md @@ -3,6 +3,7 @@ * std::chrono[meta namespace] * type-alias[meta id-type] * cpp20[meta cpp] +* gps_seconds[meta alias] ```cpp namespace std::chrono { diff --git a/reference/chrono/local_time.md b/reference/chrono/local_time.md index 868a3c5d05..7b12eb5b44 100644 --- a/reference/chrono/local_time.md +++ b/reference/chrono/local_time.md @@ -3,6 +3,7 @@ * std::chrono[meta namespace] * type-alias[meta id-type] * cpp20[meta cpp] +* local_seconds,local_days[meta alias] ```cpp namespace std::chrono { diff --git a/reference/chrono/sys_time.md b/reference/chrono/sys_time.md index 3545fd1406..3e9dc1f4e9 100644 --- a/reference/chrono/sys_time.md +++ b/reference/chrono/sys_time.md @@ -3,6 +3,7 @@ * std::chrono[meta namespace] * type-alias[meta id-type] * cpp20[meta cpp] +* sys_seconds,sys_days[meta alias] ```cpp namespace std::chrono { diff --git a/reference/chrono/tai_time.md b/reference/chrono/tai_time.md index 960ee512d5..86064b814a 100644 --- a/reference/chrono/tai_time.md +++ b/reference/chrono/tai_time.md @@ -3,6 +3,7 @@ * std::chrono[meta namespace] * type-alias[meta id-type] * cpp20[meta cpp] +* tai_seconds[meta alias] ```cpp namespace std::chrono { diff --git a/reference/chrono/utc_time.md b/reference/chrono/utc_time.md index 18e24c399a..0954faccf0 100644 --- a/reference/chrono/utc_time.md +++ b/reference/chrono/utc_time.md @@ -3,6 +3,7 @@ * std::chrono[meta namespace] * type-alias[meta id-type] * cpp20[meta cpp] +* utc_seconds[meta alias] ```cpp namespace std::chrono { From 5a2274413a24a3168ac8d7a41ac6a4982197606b Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 8 Jan 2026 20:06:09 +0900 Subject: [PATCH 2516/3948] =?UTF-8?q?mdspan/extents:=20meta=20alias?= =?UTF-8?q?=E3=82=BF=E3=82=B0=E8=BF=BD=E5=8A=A0(#1545)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/mdspan/extents.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/mdspan/extents.md b/reference/mdspan/extents.md index cfc4695537..089f6a75ac 100644 --- a/reference/mdspan/extents.md +++ b/reference/mdspan/extents.md @@ -3,6 +3,7 @@ * class template[meta id-type] * std[meta namespace] * cpp23[meta cpp] +* dextents,dims[meta alias] ```cpp namespace std { From f9f66da4cb5c876f67d07cc393c89d92412dba8a Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 8 Jan 2026 20:06:35 +0900 Subject: [PATCH 2517/3948] =?UTF-8?q?string=5Fview/basic=5Fstring=5Fview:?= =?UTF-8?q?=20meta=20alias=E3=82=BF=E3=82=B0=E8=BF=BD=E5=8A=A0(#1545)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/string_view/basic_string_view.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/string_view/basic_string_view.md b/reference/string_view/basic_string_view.md index ada82c5ce0..4774acf500 100644 --- a/reference/string_view/basic_string_view.md +++ b/reference/string_view/basic_string_view.md @@ -3,6 +3,7 @@ * std[meta namespace] * class template[meta id-type] * cpp17[meta cpp] +* string_view,u8string_view,u16string_view,u32string_view,wstring_view[meta alias] ```cpp namespace std { From 06def3a6b56deb56342d5c5c38f27e994f036bde Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 8 Jan 2026 20:16:38 +0900 Subject: [PATCH 2518/3948] =?UTF-8?q?regex/*:=20meta=20alias=E3=82=BF?= =?UTF-8?q?=E3=82=B0=E8=BF=BD=E5=8A=A0(#1545)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/regex/basic_regex.md | 2 +- reference/regex/match_results.md | 1 + reference/regex/regex_constants/error_type.md | 1 + reference/regex/regex_constants/match_flag_type.md | 1 + reference/regex/regex_constants/syntax_option_type.md | 1 + reference/regex/regex_iterator.md | 1 + reference/regex/regex_token_iterator.md | 1 + reference/regex/sub_match.md | 1 + 8 files changed, 8 insertions(+), 1 deletion(-) diff --git a/reference/regex/basic_regex.md b/reference/regex/basic_regex.md index 5812d3d8a6..18613adacb 100644 --- a/reference/regex/basic_regex.md +++ b/reference/regex/basic_regex.md @@ -3,7 +3,7 @@ * std[meta namespace] * class template[meta id-type] * cpp11[meta cpp] - +* regex,wregex[meta alias] ```cpp namespace std { diff --git a/reference/regex/match_results.md b/reference/regex/match_results.md index 9107ef03d9..7315fb4814 100644 --- a/reference/regex/match_results.md +++ b/reference/regex/match_results.md @@ -3,6 +3,7 @@ * std[meta namespace] * class template[meta id-type] * cpp11[meta cpp] +* cmatch,wcmatch,smatch,wsmatch[meta alias] ```cpp namespace std { diff --git a/reference/regex/regex_constants/error_type.md b/reference/regex/regex_constants/error_type.md index 149dfb077f..8dc43ecce5 100644 --- a/reference/regex/regex_constants/error_type.md +++ b/reference/regex/regex_constants/error_type.md @@ -3,6 +3,7 @@ * std::regex_constants[meta namespace] * enum[meta id-type] * cpp11[meta cpp] +* error_collate,error_ctype,error_escape,error_backref,error_brack,error_paren,error_brace,error_badbrace,error_range,error_space,error_badrepeat,error_complexity,error_stack[meta alias] ```cpp namespace std { diff --git a/reference/regex/regex_constants/match_flag_type.md b/reference/regex/regex_constants/match_flag_type.md index 47239384e0..af754278c9 100644 --- a/reference/regex/regex_constants/match_flag_type.md +++ b/reference/regex/regex_constants/match_flag_type.md @@ -3,6 +3,7 @@ * std::regex_constants[meta namespace] * type-alias[meta id-type] * cpp11[meta cpp] +* match_default,match_not_bol,match_not_eol,match_not_bow,match_not_eow,match_any,match_not_null,match_continuous,match_prev_avail,format_default,format_sed,format_no_copy,format_first_only[meta alias] ```cpp namespace std { diff --git a/reference/regex/regex_constants/syntax_option_type.md b/reference/regex/regex_constants/syntax_option_type.md index fd3eaa8405..64ead45968 100644 --- a/reference/regex/regex_constants/syntax_option_type.md +++ b/reference/regex/regex_constants/syntax_option_type.md @@ -3,6 +3,7 @@ * std::regex_constants[meta namespace] * type-alias[meta id-type] * cpp11[meta cpp] +* icase,nosubs,optimize,collate,ECMAScript,basic,extended,awk,grep,egrep[meta alias] ```cpp namespace std { diff --git a/reference/regex/regex_iterator.md b/reference/regex/regex_iterator.md index a00045aad1..bb5b622d15 100644 --- a/reference/regex/regex_iterator.md +++ b/reference/regex/regex_iterator.md @@ -3,6 +3,7 @@ * std[meta namespace] * class template[meta id-type] * cpp11[meta cpp] +* cregex_iterator,wcregex_iterator,sregex_iterator,wsregex_iterator[meta alias] ```cpp namespace std { diff --git a/reference/regex/regex_token_iterator.md b/reference/regex/regex_token_iterator.md index d91ae3d284..8d90735d87 100644 --- a/reference/regex/regex_token_iterator.md +++ b/reference/regex/regex_token_iterator.md @@ -3,6 +3,7 @@ * std[meta namespace] * class template[meta id-type] * cpp11[meta cpp] +* cregex_token_iterator,wcregex_token_iterator,sregex_token_iterator,wsregex_token_iterator[meta alias] ```cpp namespace std { diff --git a/reference/regex/sub_match.md b/reference/regex/sub_match.md index d7f59ebbf1..b0bac4d215 100644 --- a/reference/regex/sub_match.md +++ b/reference/regex/sub_match.md @@ -3,6 +3,7 @@ * std[meta namespace] * class template[meta id-type] * cpp11[meta cpp] +* csub_match,wcsub_match,ssub_match,wssub_match[meta alias] ```cpp namespace std { From 555fc5bdeceac2d3ccd16f6791650b04328eee2e Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 8 Jan 2026 20:17:46 +0900 Subject: [PATCH 2519/3948] =?UTF-8?q?stacktrace/basic=5Fstacktrace:=20meta?= =?UTF-8?q?=20alias=E3=82=BF=E3=82=B0=E8=BF=BD=E5=8A=A0(#1545)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/stacktrace/basic_stacktrace.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/stacktrace/basic_stacktrace.md b/reference/stacktrace/basic_stacktrace.md index fa1b3632ae..51abb4624a 100644 --- a/reference/stacktrace/basic_stacktrace.md +++ b/reference/stacktrace/basic_stacktrace.md @@ -3,6 +3,7 @@ * std[meta namespace] * class template[meta id-type] * cpp23[meta cpp] +* stacktrace[meta alias] ```cpp namespace std { From 409e69d74025e49ac0dfea88190c3ff48fa1d402 Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 8 Jan 2026 20:26:22 +0900 Subject: [PATCH 2520/3948] =?UTF-8?q?semaphore/counting=5Fsemaphore:=20met?= =?UTF-8?q?a=20alias=E3=82=BF=E3=82=B0=E8=BF=BD=E5=8A=A0(#1545)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/semaphore/counting_semaphore.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/semaphore/counting_semaphore.md b/reference/semaphore/counting_semaphore.md index 03558e00b1..d2cd7bb2cb 100644 --- a/reference/semaphore/counting_semaphore.md +++ b/reference/semaphore/counting_semaphore.md @@ -3,6 +3,7 @@ * class template[meta id-type] * std[meta namespace] * cpp20[meta cpp] +* binary_semaphore[meta alias] ```cpp namespace std { From 65847d221e5a83b166962a47ef6d18549a50c8e4 Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 8 Jan 2026 20:32:39 +0900 Subject: [PATCH 2521/3948] =?UTF-8?q?ranges/*:=20meta=20alias=E3=82=BF?= =?UTF-8?q?=E3=82=B0=E8=BF=BD=E5=8A=A0(#1545)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ranges/adjacent_view.md | 1 + reference/ranges/basic_istream_view.md | 1 + reference/ranges/elements_view.md | 1 + 3 files changed, 3 insertions(+) diff --git a/reference/ranges/adjacent_view.md b/reference/ranges/adjacent_view.md index a977bf0cdb..39dff28d64 100644 --- a/reference/ranges/adjacent_view.md +++ b/reference/ranges/adjacent_view.md @@ -3,6 +3,7 @@ * std::ranges[meta namespace] * class template[meta id-type] * cpp23[meta cpp] +* adjacent,pairwise[meta alias] ```cpp namespace std::ranges { diff --git a/reference/ranges/basic_istream_view.md b/reference/ranges/basic_istream_view.md index 824d23f5da..c7e6bbd878 100644 --- a/reference/ranges/basic_istream_view.md +++ b/reference/ranges/basic_istream_view.md @@ -3,6 +3,7 @@ * std::ranges[meta namespace] * class template[meta id-type] * cpp20[meta cpp] +* istream_view,wistream_view[meta alias] ```cpp namespace std::ranges { diff --git a/reference/ranges/elements_view.md b/reference/ranges/elements_view.md index 48fda8af94..f882c46f2c 100644 --- a/reference/ranges/elements_view.md +++ b/reference/ranges/elements_view.md @@ -3,6 +3,7 @@ * std::ranges[meta namespace] * class template[meta id-type] * cpp20[meta cpp] +* keys_view,values_view[meta alias] ```cpp namespace std::ranges { From 24f5f80a727f7fc83e76f202bd65ca5a27381fb3 Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 8 Jan 2026 20:44:37 +0900 Subject: [PATCH 2522/3948] =?UTF-8?q?format/*:=20meta=20alias=E3=82=BF?= =?UTF-8?q?=E3=82=B0=E8=BF=BD=E5=8A=A0(#1545)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/basic_format_args.md | 1 + reference/format/basic_format_context.md | 1 + reference/format/basic_format_parse_context.md | 1 + reference/format/basic_format_string.md | 1 + 4 files changed, 4 insertions(+) diff --git a/reference/format/basic_format_args.md b/reference/format/basic_format_args.md index 746edb5028..215d348c8c 100644 --- a/reference/format/basic_format_args.md +++ b/reference/format/basic_format_args.md @@ -3,6 +3,7 @@ * class template[meta id-type] * std[meta namespace] * cpp20[meta cpp] +* format_args,wformat_args[meta alias] ```cpp namespace std { diff --git a/reference/format/basic_format_context.md b/reference/format/basic_format_context.md index e3f5d4020d..24200cf8b7 100644 --- a/reference/format/basic_format_context.md +++ b/reference/format/basic_format_context.md @@ -4,6 +4,7 @@ * class template[meta id-type] * std[meta namespace] * cpp20[meta cpp] +* format_context,wformat_context[meta alias] ```cpp namespace std { diff --git a/reference/format/basic_format_parse_context.md b/reference/format/basic_format_parse_context.md index e1211f92f3..c0012399d9 100644 --- a/reference/format/basic_format_parse_context.md +++ b/reference/format/basic_format_parse_context.md @@ -4,6 +4,7 @@ * class template[meta id-type] * std[meta namespace] * cpp20[meta cpp] +* format_parse_context,wformat_parse_context[meta alias] ```cpp namespace std { diff --git a/reference/format/basic_format_string.md b/reference/format/basic_format_string.md index 7cb8ac258f..d5a64efe70 100644 --- a/reference/format/basic_format_string.md +++ b/reference/format/basic_format_string.md @@ -3,6 +3,7 @@ * class[meta id-type] * std[meta namespace] * cpp23[meta cpp] +* format_string,wformat_string[meta alias] ```cpp namespace std { From efa9584a4970de8240a39112925a26764da75bf3 Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 8 Jan 2026 20:45:05 +0900 Subject: [PATCH 2523/3948] =?UTF-8?q?{*stream,ios,streambuf}:=20meta=20ali?= =?UTF-8?q?as=E3=82=BF=E3=82=B0=E8=BF=BD=E5=8A=A0(#1545)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/fstream/basic_filebuf.md | 1 + reference/fstream/basic_fstream.md | 1 + reference/fstream/basic_ifstream.md | 1 + reference/fstream/basic_ofstream.md | 1 + reference/ios/basic_ios.md | 1 + reference/ostream/basic_ostream.md | 1 + reference/spanstream/basic_ispanstream.md | 1 + reference/spanstream/basic_ospanstream.md | 1 + reference/spanstream/basic_spanbuf.md | 1 + reference/spanstream/basic_spanstream.md | 1 + reference/sstream/basic_istringstream.md | 1 + reference/sstream/basic_ostringstream.md | 1 + reference/sstream/basic_stringbuf.md | 1 + reference/sstream/basic_stringstream.md | 1 + reference/streambuf/basic_streambuf.md | 1 + reference/syncstream/basic_osyncstream.md | 1 + reference/syncstream/basic_syncbuf.md | 1 + 17 files changed, 17 insertions(+) diff --git a/reference/fstream/basic_filebuf.md b/reference/fstream/basic_filebuf.md index 279610ecc9..615d679cd6 100644 --- a/reference/fstream/basic_filebuf.md +++ b/reference/fstream/basic_filebuf.md @@ -2,6 +2,7 @@ * fstream[meta header] * std[meta namespace] * class template[meta id-type] +* filebuf,wfilebuf[meta alias] ```cpp namespace std { diff --git a/reference/fstream/basic_fstream.md b/reference/fstream/basic_fstream.md index 6213e06747..6ff1f58193 100644 --- a/reference/fstream/basic_fstream.md +++ b/reference/fstream/basic_fstream.md @@ -2,6 +2,7 @@ * fstream[meta header] * std[meta namespace] * class template[meta id-type] +* fstream,wfstream[meta alias] ```cpp namespace std { diff --git a/reference/fstream/basic_ifstream.md b/reference/fstream/basic_ifstream.md index d0a9254a82..4cf4e821be 100644 --- a/reference/fstream/basic_ifstream.md +++ b/reference/fstream/basic_ifstream.md @@ -2,6 +2,7 @@ * fstream[meta header] * std[meta namespace] * class template[meta id-type] +* ifstream,wifstream[meta alias] ```cpp namespace std { diff --git a/reference/fstream/basic_ofstream.md b/reference/fstream/basic_ofstream.md index fd3cabe46b..102229d71c 100644 --- a/reference/fstream/basic_ofstream.md +++ b/reference/fstream/basic_ofstream.md @@ -2,6 +2,7 @@ * fstream[meta header] * std[meta namespace] * class template[meta id-type] +* ofstream,wofstream[meta alias] ```cpp namespace std { diff --git a/reference/ios/basic_ios.md b/reference/ios/basic_ios.md index fb5975abe2..652397efad 100644 --- a/reference/ios/basic_ios.md +++ b/reference/ios/basic_ios.md @@ -2,6 +2,7 @@ * ios[meta header] * std[meta namespace] * class template[meta id-type] +* ios,wios[meta alias] ```cpp namespace std { diff --git a/reference/ostream/basic_ostream.md b/reference/ostream/basic_ostream.md index 29334f54b0..7aa40f28cb 100644 --- a/reference/ostream/basic_ostream.md +++ b/reference/ostream/basic_ostream.md @@ -2,6 +2,7 @@ * ostream[meta header] * std[meta namespace] * class template[meta id-type] +* ostream,wostream[meta alias] ```cpp namespace std { diff --git a/reference/spanstream/basic_ispanstream.md b/reference/spanstream/basic_ispanstream.md index 3d5b18d988..5502a169e8 100644 --- a/reference/spanstream/basic_ispanstream.md +++ b/reference/spanstream/basic_ispanstream.md @@ -3,6 +3,7 @@ * std[meta namespace] * class template[meta id-type] * cpp23[meta cpp] +* ispanstream,wispanstream[meta alias] ```cpp namespace std { diff --git a/reference/spanstream/basic_ospanstream.md b/reference/spanstream/basic_ospanstream.md index 542da7cb69..e2717cc8aa 100644 --- a/reference/spanstream/basic_ospanstream.md +++ b/reference/spanstream/basic_ospanstream.md @@ -3,6 +3,7 @@ * std[meta namespace] * class template[meta id-type] * cpp23[meta cpp] +* ospanstream,wospanstream[meta alias] ```cpp namespace std { diff --git a/reference/spanstream/basic_spanbuf.md b/reference/spanstream/basic_spanbuf.md index 4d095c2ef1..f956eee277 100644 --- a/reference/spanstream/basic_spanbuf.md +++ b/reference/spanstream/basic_spanbuf.md @@ -3,6 +3,7 @@ * std[meta namespace] * class template[meta id-type] * cpp23[meta cpp] +* spanbuf,wspanbuf[meta alias] ```cpp namespace std { diff --git a/reference/spanstream/basic_spanstream.md b/reference/spanstream/basic_spanstream.md index 82b2a65488..ff10cf9189 100644 --- a/reference/spanstream/basic_spanstream.md +++ b/reference/spanstream/basic_spanstream.md @@ -3,6 +3,7 @@ * std[meta namespace] * class template[meta id-type] * cpp23[meta cpp] +* spanstream,wspanstream[meta alias] ```cpp namespace std { diff --git a/reference/sstream/basic_istringstream.md b/reference/sstream/basic_istringstream.md index e96f37495b..7fdec77ecd 100644 --- a/reference/sstream/basic_istringstream.md +++ b/reference/sstream/basic_istringstream.md @@ -2,6 +2,7 @@ * sstream[meta header] * std[meta namespace] * class template[meta id-type] +* istringstream,wistringstream[meta alias] ```cpp namespace std { diff --git a/reference/sstream/basic_ostringstream.md b/reference/sstream/basic_ostringstream.md index 3e70ab69c2..528ed6aea4 100644 --- a/reference/sstream/basic_ostringstream.md +++ b/reference/sstream/basic_ostringstream.md @@ -2,6 +2,7 @@ * sstream[meta header] * std[meta namespace] * class template[meta id-type] +* ostringstream,wostringstream[meta alias] ```cpp namespace std { diff --git a/reference/sstream/basic_stringbuf.md b/reference/sstream/basic_stringbuf.md index 64241ac577..a15c9ac8d8 100644 --- a/reference/sstream/basic_stringbuf.md +++ b/reference/sstream/basic_stringbuf.md @@ -2,6 +2,7 @@ * sstream[meta header] * std[meta namespace] * class template[meta id-type] +* stringbuf,wstringbuf[meta alias] ```cpp namespace std { diff --git a/reference/sstream/basic_stringstream.md b/reference/sstream/basic_stringstream.md index 399c3b3b10..de9f13deba 100644 --- a/reference/sstream/basic_stringstream.md +++ b/reference/sstream/basic_stringstream.md @@ -2,6 +2,7 @@ * sstream[meta header] * std[meta namespace] * class template[meta id-type] +* stringstream,wstringstream[meta alias] ```cpp namespace std { diff --git a/reference/streambuf/basic_streambuf.md b/reference/streambuf/basic_streambuf.md index 8104be504b..b330e77cff 100644 --- a/reference/streambuf/basic_streambuf.md +++ b/reference/streambuf/basic_streambuf.md @@ -2,6 +2,7 @@ * streambuf[meta header] * std[meta namespace] * class template[meta id-type] +* streambuf,wstreambuf[meta alias] ```cpp namespace std { diff --git a/reference/syncstream/basic_osyncstream.md b/reference/syncstream/basic_osyncstream.md index ed3bbe1284..07088d4f08 100644 --- a/reference/syncstream/basic_osyncstream.md +++ b/reference/syncstream/basic_osyncstream.md @@ -3,6 +3,7 @@ * std[meta namespace] * class template[meta id-type] * cpp20[meta cpp] +* osyncstream,wosyncstream[meta alias] ```cpp namespace std { diff --git a/reference/syncstream/basic_syncbuf.md b/reference/syncstream/basic_syncbuf.md index f9b3a26808..5512576604 100644 --- a/reference/syncstream/basic_syncbuf.md +++ b/reference/syncstream/basic_syncbuf.md @@ -3,6 +3,7 @@ * std[meta namespace] * class template[meta id-type] * cpp20[meta cpp] +* syncbuf,wsyncbuf[meta alias] ```cpp namespace std { From 542d90ba4fbe24a28f662ef04b61d573a0524527 Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 8 Jan 2026 20:50:50 +0900 Subject: [PATCH 2524/3948] =?UTF-8?q?ratio/si=5Fprefix:=20meta=20alias?= =?UTF-8?q?=E3=82=BF=E3=82=B0=E8=BF=BD=E5=8A=A0(#1545)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/ratio/si_prefix.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/ratio/si_prefix.md b/reference/ratio/si_prefix.md index a3fcae033a..371f765004 100644 --- a/reference/ratio/si_prefix.md +++ b/reference/ratio/si_prefix.md @@ -3,6 +3,7 @@ * std[meta namespace] * type-alias[meta id-type] * cpp11[meta cpp] +* quecto,ronto,yocto,zepto,atto,femto,pico,nano,micro,milli,centi,deci,deca,hecto,kilo,mega,giga,tera,peta,exa,zetta,yotta,ronna,quetta[meta alias] ```cpp namespace std { From 62d4905bc289539e412e9447f6d1284fed14f918 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Thu, 8 Jan 2026 21:52:39 +0900 Subject: [PATCH 2525/3948] =?UTF-8?q?logic=5Ferror=20:=20=E3=82=B3?= =?UTF-8?q?=E3=83=B3=E3=83=91=E3=82=A4=E3=83=AB=E3=82=A8=E3=83=A9=E3=83=BC?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/stdexcept/logic_error.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/stdexcept/logic_error.md b/reference/stdexcept/logic_error.md index fd4063680e..f63d0f1092 100644 --- a/reference/stdexcept/logic_error.md +++ b/reference/stdexcept/logic_error.md @@ -31,7 +31,7 @@ namespace std { int square_root(int num) { if (num < 0) { - throw std::invalid_argument("Cannot perform calculations with negative numbers!") + throw std::invalid_argument("Cannot perform calculations with negative numbers!"); } return num * num; } From 5168db12b7fe5c3f5ffbccc55d4616a3f159382b Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Tue, 6 Jan 2026 18:07:51 +0900 Subject: [PATCH 2526/3948] =?UTF-8?q?feat(C++=E5=9B=BD=E9=9A=9B=E6=A8=99?= =?UTF-8?q?=E6=BA=96=E8=A6=8F=E6=A0=BC):=20=E5=BC=95=E7=94=A8=E8=A6=8F?= =?UTF-8?q?=E6=A0=BC=E6=83=85=E5=A0=B1=E3=81=A8C=E8=A6=8F=E6=A0=BC?= =?UTF-8?q?=E3=81=AE=E8=A1=A8=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- international-standard.md | 59 +++++++++++++++++++++++++++++++-------- 1 file changed, 48 insertions(+), 11 deletions(-) diff --git a/international-standard.md b/international-standard.md index e37ef4f151..63fdefe814 100644 --- a/international-standard.md +++ b/international-standard.md @@ -10,16 +10,16 @@ C++ の標準規格は、他にも各国の規格化団体によって国際標 ## 国際標準規格の一覧 -| 通称†1 | 名称 | 参照する規格案†2 | 規格案・原案 | `__cplusplus` | -|:--|:--|:--|:--|:--| -| [C++26](lang/cpp26.md) (C++2c) | ISO/IEC 14882:2026 (予定) | N5032([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/n5032.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/)) | N5032 N5014 N5008 N5001 N4993 N4986 N4981 N4971 N4964 N4958 | -- | -| [C++23](lang/cpp23.md) (C++2b) | ISO/IEC 14882:2024 | N4950([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4950.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4950/)) | N4950 N4944 N4928 N4917 N4910 N4901 N4892 N4885 N4878
N4868 N4861 | `202302L` | -| [C++20](lang/cpp20.md) (C++2a) | ISO/IEC 14882:2020 | N4861†3([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/n4861.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4861/)) | N4860 N4849 N4842 N4835 N4830
N4820 N4810 N4800 N4791 N4788†4
N4778 N4762 N4750 N4741 N4727
N4713 N4700 N4687 | `202002L` | -| [C++17](lang/cpp17.md) (C++1z) | ISO/IEC 14882:2017 | N4659([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4659.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4659/)) | N4660 N4659 N4640 N4618 N4606
N4594 N4582 N4567 N4527 N4431
N4296 | `201703L` | -| [C++14](lang/cpp14.md) (C++1y) | ISO/IEC 14882:2014 | N4140([PDF](https://github.com/cplusplus/draft/blob/master/papers/n4140.pdf?raw=true)/[HTML](https://timsong-cpp.github.io/cppwp/n4140/)) | N4141 N4140 N3937 N3936 N3797
N3691 N3690 N3485 N3376 N3337 | `201402L` | -| [C++11](lang/cpp11.md) (C++0x) | ISO/IEC 14882:2011 | N3337†5([PDF](https://wg21.link/std11)/[HTML](https://timsong-cpp.github.io/cppwp/n3337/)) | N3291 N3290 N3242 N3225 N3126
N3090 N3035 N3000 N2960 N2914
N2857 N2798 N2723 N2691 N2606
N2588 N2521 N2461 N2369 N2315
N2284 N2134 N2009 N1905 N1804
N1733 N1655 | `201103L` | -| C++03 | ISO/IEC 14882:2003 | N1577 | N1577 ? | `199711L`
(C++98 と同じ) | -| C++98 | ISO/IEC 14882:1998 | ? | ? | `199711L` | +| 通称†1 | 名称 | 参照する規格案†2 | 規格案・原案 | `__cplusplus` | 引用規格†6 | +|:--|:--|:--|:--|:--|:--| +| [C++26](lang/cpp26.md) (C++2c) | ISO/IEC 14882:2026 (予定) | N5032([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/n5032.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/)) | N5032 N5014 N5008 N5001 N4993
N4986 N4981 N4971 N4964 N4958 | -- | C23, POSIX.1-2017
Unicode 15.1 | +| [C++23](lang/cpp23.md) (C++2b) | ISO/IEC 14882:2024 | N4950([PDF](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4950.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4950/)) | N4950 N4944 N4928 N4917 N4910
N4901 N4892 N4885 N4878 N4868
N4861 | `202302L` | C17, POSIX.1-2017,
Unicode latest | +| [C++20](lang/cpp20.md) (C++2a) | ISO/IEC 14882:2020 | N4861†3([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/n4861.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4861/)) | N4860 N4849 N4842 N4835 N4830
N4820 N4810 N4800 N4791 N4788†4
N4778 N4762 N4750 N4741 N4727
N4713 N4700 N4687 | `202002L` | C17, POSIX.1-2003,
UCS:1993, UCS:latest, UAX#29-35 | +| [C++17](lang/cpp17.md) (C++1z) | ISO/IEC 14882:2017 | N4659([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4659.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4659/)) | N4660 N4659 N4640 N4618 N4606
N4594 N4582 N4567 N4527 N4431
N4296 | `201703L` | C11:TC1, POSIX.1-2003,
UCS:1993 | +| [C++14](lang/cpp14.md) (C++1y) | ISO/IEC 14882:2014 | N4140([PDF](https://github.com/cplusplus/draft/blob/master/papers/n4140.pdf?raw=true)/[HTML](https://timsong-cpp.github.io/cppwp/n4140/)) | N4141 N4140 N3937 N3936 N3797
N3691 N3690 N3485 N3376 N3337 | `201402L` | C99:TC3, POSIX.1-2003,
UCS:1993 | +| [C++11](lang/cpp11.md) (C++0x) | ISO/IEC 14882:2011 | N3337†5([PDF](https://wg21.link/std11)/[HTML](https://timsong-cpp.github.io/cppwp/n3337/)) | N3291 N3290 N3242 N3225 N3126
N3090 N3035 N3000 N2960 N2914
N2857 N2798 N2723 N2691 N2606
N2588 N2521 N2461 N2369 N2315
N2284 N2134 N2009 N1905 N1804
N1733 N1655 | `201103L` | C99:TC3, POSIX.1-2003,
UCS:1993 | +| C++03 | ISO/IEC 14882:2003 | N1577 | N1577 ? | `199711L`
(C++98 と同じ) | C99, UCS:2000 | +| C++98 | ISO/IEC 14882:1998 | ? | ? | `199711L` | C95, UCS:1993 | 1. **^** カッコ内は策定時・標準化前に一時的に用いられた通称 2. **^** 最終国際規格案はPDFやHTMLなどの形で一般公開されていないため、それにほぼ同一の内容の規格案を参照する。 @@ -27,6 +27,21 @@ C++ の標準規格は、他にも各国の規格化団体によって国際標 4. **^** N4788 は政治的事情により撤回された (参照 N4792) 5. **^** N3337 は、C++11規格に対する編集レベルの修正のみが適用された仕様案であるため、事実上 N3337 が C++11 を参照する時に用いられる。C++11規格からN3337への変更点は、[N3338](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3338.html)を参照。 (それより前の公開されているC++11向け仕様案であるN3242からC++11規格に対しては、機能的な変更がいくつかあるため、C++11規格として参照するには適さない) +6. **^** 全ての**引用規格** (normative references) を載せているわけではない。特に引用規格のバージョン差異が重要なものを表中に載せている。 + - C規格に関しては[下の表](#list-of-iso-c)も参照のこと。 + ここでは C99:TC3 などの表記は C99 に加えて TC1 から TC3 までを取り入れたものを指すこととする。 + - POSIX規格については POSIX.1-2003 は ISO/IEC 9945:2003 (POSIX.1-2001 + TC1) で、 + POSIX.1-2017 は ISO/IEC/IEEE 9945:2009 に TC1 (ISO/IEC/IEEE 9945:2009/Cor 1:2013) と TC2 (ISO/IEC/IEEE 9945:2009/Cor 2:2017) を取り入れたものである。 + 長らく POSIX.1-2003 が参照されて来たが C++23 から POSIX.1-2017 を参照する様に変更された[[P2227R0](lang/cpp23/update_normative_reference_to_posix.md)]。 + - 国際符号化文字集合 (UCS; Universal Coded Character Set) / Unicode については、 + UCS は ISO/IEC 10646 の総称であり、ここでは UCS:1993 は ISO/IEC 10646-1:1993、UCS:2000 は ISO/IEC 10646-1:2000 を指すこととする。 + また UAX#29-35 は Unicode 12.0 の Unicode Standard Annex UAX #29 (revision 35) を指すこととする。 + 引用規格として長らく UCS:1993 が参照されてきたが、 + C++20 で UCS (最新) への参照が追加され [[P1025R1](lang/cpp20/update_the_reference_to_the_unicode_standard.md)]、 + C++23 で Unicode (最新) に切り替えられ [P2736R2([PDF](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2736r2.pdf))]、 + C++26 で Unicode 15.1 に切り替えられた [[CWG 2843](https://cplusplus.github.io/CWG/issues/2843.html)]。 + - C++11 以降は `` のために ECMAScript ECMA-262:1999 を引用する。 + - 他に基本語彙・日時・浮動小数点数・数学記号などのために他の規格を引用する。 最新のDraftのHTML版は以下で公開されている。 [Draft C++ Standard: Contents](https://timsong-cpp.github.io/cppwp/) @@ -34,6 +49,25 @@ C++ の標準規格は、他にも各国の規格化団体によって国際標 標準規格の文章はtexで書かれており、そのソースコードは以下で2011年8月16日以降のものについて(つまりN3291より後、N3337より前)公開されている。 [cplusplus/draft: C++ standards drafts](https://github.com/cplusplus/draft) +## C国際標準規格の一覧 + +以下、主な C 国際標準規格と C++ が参照する技術的正誤票 (TC) の一覧である。 + +| 通称 | 名称 | 参照する規格案 | `__STDC_VERSION__` | 引用元C++ | +|:--|:--|:--|:--|:--| +| C29 (C2Y) | ISO/IEC 9899:2029 (予定) | N3685([PDF](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3685.pdf)) (暫定) | ? | | +| **C23** (C2X) | ISO/IEC 9899:2024 | N3096([PDF](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3096.pdf)) | `202311L` | | +| **C17** (C18) | ISO/IEC 9899:2018 | N2176 | `201710L` | C++20, C++23 | +| C11 TC1 | ISO/IEC 9899:2011/Cor 1:2012 | ? | `201112L` | C++17 | +| **C11** (C1X) | ISO/IEC 9899:2011 | N1570([PDF](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf)) | `201112L` | C++17 | +| C99 TC3 | ISO/IEC 9899:1999/Cor.3:2007 | N1256([PDF](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf)) | `199901L` | C++11, C++14 | +| C99 TC2 | ISO/IEC 9899:1999/Cor.2:2004 | N1124([PDF](https://open-std.org/JTC1/SC22/WG14/www/docs/n1124.pdf)) | `199901L` | C++11, C++14 | +| C99 TC1 | ISO/IEC 9899:1999/Cor.1:2001 | ? | `199901L` | C++11, C++14 | +| **C99** (C9X) | ISO/IEC 9899:1999 | N843([HTML](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n843.htm)) | `199901L` | C++03, C++11, C++14 | +| C95 | ISO/IEC 9899/Amd.1:1995 | ? | `199409L` | C++98 | +| **C90** | ISO/IEC 9899:1990 | ? | -- | | +| **C89** | ANSI X3.159-1989 | ? | -- | | + ## 用語: 国際標準規格を定める組織 - **C++標準化委員会** (C++ Standards Committee): C++ の国際標準規格を策定する団体。 @@ -41,7 +75,9 @@ C++ の標準規格は、他にも各国の規格化団体によって国際標 **国際標準化機構** (ISO; international organization for standardization) および**国際電気標準会議** (IEC; International Electronics Commission) はそれぞれ様々な規格の標準化団体である。 **第一合同技術委員会** (JTC1; Joint Technical Committee 1) は ISO/IEC の下で情報技術の標準化を行う団体である。 下部組織の SC22 はプログラム言語の標準化を行う**副委員会** (SC; subcommittee) である。 - C++標準化委員会は WG21 という**作業グループ** (WG; working group) である。 + C++標準化委員会は **WG21** という**作業グループ** (WG; working group) である。 +- **C標準化委員会** (C Standards Committee): C言語の国際標準規格を策定する団体。 + C++標準化委員会と同じく ISO/IEC JTC1/SC22 の下に属する作業グループで、**WG14**になる。 - **CWG** (Core working group): C++標準化委員会の内、コア言語機能の策定を行う作業グループ - **LWG** (Library working group): C++標準化委員会の内、標準ライブラリ機能の策定を行う作業グループ - **NB** (national body) または**MB/NC** (member body/national committee): C++標準化委員会の正会員つまり各国から派遣される団体のこと。本来は member body は ISO での名称で、national committee は IEC での名称。 @@ -60,6 +96,7 @@ C++ の標準規格は、他にも各国の規格化団体によって国際標 - **DIS** (draft international standard): 国際規格案 - **FDIS** (final draft international standard): 最終国際規格案 - **IS** (international standard): 国際規格 +- **TC** (technical corrigendum): 技術的正誤票。用例: TC1 - **TR** (technical report): 技術報告書。用例: TR1 - **TS** (technical specifications): 技術仕様書。用例: Concepts TS From 328b0baa2a4df8343bd6415046ddb0253137a671 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Thu, 8 Jan 2026 20:14:11 +0900 Subject: [PATCH 2527/3948] =?UTF-8?q?fix(C++=E5=9B=BD=E9=9A=9B=E6=A8=99?= =?UTF-8?q?=E6=BA=96=E8=A6=8F=E6=A0=BC):=20=E6=97=A5=E6=9C=AC=E8=AA=9E?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E3=83=BB=E8=A1=A8=E8=A8=98=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=20(tex=20=3D>=20LaTeX)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- international-standard.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/international-standard.md b/international-standard.md index 63fdefe814..c4cdbbc7ee 100644 --- a/international-standard.md +++ b/international-standard.md @@ -43,10 +43,10 @@ C++ の標準規格は、他にも各国の規格化団体によって国際標 - C++11 以降は `` のために ECMAScript ECMA-262:1999 を引用する。 - 他に基本語彙・日時・浮動小数点数・数学記号などのために他の規格を引用する。 -最新のDraftのHTML版は以下で公開されている。 +最新の原案のHTML版は以下で公開されている。 [Draft C++ Standard: Contents](https://timsong-cpp.github.io/cppwp/) -標準規格の文章はtexで書かれており、そのソースコードは以下で2011年8月16日以降のものについて(つまりN3291より後、N3337より前)公開されている。 +標準規格の原案はLaTeXで書かれており、そのソースコードは以下で2011年8月16日以降のものについて(つまりN3291より後、N3337より前)公開されている。 [cplusplus/draft: C++ standards drafts](https://github.com/cplusplus/draft) ## C国際標準規格の一覧 From 8a387b94cc95585792ce317ce3670d58c47dd793 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Thu, 8 Jan 2026 20:17:26 +0900 Subject: [PATCH 2528/3948] =?UTF-8?q?fix(P2227R0):=20=E5=BC=95=E7=94=A8?= =?UTF-8?q?=E8=A6=8F=E6=A0=BC=20POSIX=20=E3=81=AE=E6=83=85=E5=A0=B1?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23/update_normative_reference_to_posix.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/cpp23/update_normative_reference_to_posix.md b/lang/cpp23/update_normative_reference_to_posix.md index fba43b1f19..d74744f46f 100644 --- a/lang/cpp23/update_normative_reference_to_posix.md +++ b/lang/cpp23/update_normative_reference_to_posix.md @@ -10,11 +10,11 @@ ## 概要 -C++20まではPOSIX規格としてISO/IEC 9945:2003 (別名POSIX.1-2001 aka The Single UNIX Specification, version 3) を参照していた。 +C++20まではPOSIX規格としてISO/IEC 9945:2003 (POSIX.1-2001 別名 The Single UNIX Specification, version 3 (SUSv3) の 2003 年修正版 (TC1)) を参照していた。 しかし、標準C++の一部の機能はより新しいPOSIX規格の機能を使用していたため、ISO/IEC 9945:2003への参照を削除した上で、以下の3つの規格を参照するよう変更する: -1. ISO/IEC/IEEE 9945:20032009, Information Technology — Portable Operating System Interface (POSIX) +1. ISO/IEC/IEEE 9945:2009, Information Technology — Portable Operating System Interface (POSIX) 2. ISO/IEC/IEEE 9945:2009/Cor 1:2013, Information Technology — Portable Operating System Interface (POSIX), Technical Corrigendum 1 3. ISO/IEC/IEEE 9945:2009/Cor 2:2017, Information Technology — Portable Operating System Interface (POSIX), Technical Corrigendum 2 From 3f1b6a186e49ff99be31d8c650d6eae8f3946933 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Thu, 8 Jan 2026 21:04:37 +0900 Subject: [PATCH 2529/3948] =?UTF-8?q?fix(C++=E5=9B=BD=E9=9A=9B=E6=A8=99?= =?UTF-8?q?=E6=BA=96=E8=A6=8F=E6=A0=BC):=20=E9=81=8E=E5=8E=BB=E3=81=AEC++?= =?UTF-8?q?=E3=81=AE=E5=8E=9F=E7=A8=BF=E7=95=AA=E5=8F=B7=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- international-standard.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/international-standard.md b/international-standard.md index c4cdbbc7ee..4350413027 100644 --- a/international-standard.md +++ b/international-standard.md @@ -17,9 +17,9 @@ C++ の標準規格は、他にも各国の規格化団体によって国際標 | [C++20](lang/cpp20.md) (C++2a) | ISO/IEC 14882:2020 | N4861†3([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/n4861.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4861/)) | N4860 N4849 N4842 N4835 N4830
N4820 N4810 N4800 N4791 N4788†4
N4778 N4762 N4750 N4741 N4727
N4713 N4700 N4687 | `202002L` | C17, POSIX.1-2003,
UCS:1993, UCS:latest, UAX#29-35 | | [C++17](lang/cpp17.md) (C++1z) | ISO/IEC 14882:2017 | N4659([PDF](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4659.pdf)/[HTML](https://timsong-cpp.github.io/cppwp/n4659/)) | N4660 N4659 N4640 N4618 N4606
N4594 N4582 N4567 N4527 N4431
N4296 | `201703L` | C11:TC1, POSIX.1-2003,
UCS:1993 | | [C++14](lang/cpp14.md) (C++1y) | ISO/IEC 14882:2014 | N4140([PDF](https://github.com/cplusplus/draft/blob/master/papers/n4140.pdf?raw=true)/[HTML](https://timsong-cpp.github.io/cppwp/n4140/)) | N4141 N4140 N3937 N3936 N3797
N3691 N3690 N3485 N3376 N3337 | `201402L` | C99:TC3, POSIX.1-2003,
UCS:1993 | -| [C++11](lang/cpp11.md) (C++0x) | ISO/IEC 14882:2011 | N3337†5([PDF](https://wg21.link/std11)/[HTML](https://timsong-cpp.github.io/cppwp/n3337/)) | N3291 N3290 N3242 N3225 N3126
N3090 N3035 N3000 N2960 N2914
N2857 N2798 N2723 N2691 N2606
N2588 N2521 N2461 N2369 N2315
N2284 N2134 N2009 N1905 N1804
N1733 N1655 | `201103L` | C99:TC3, POSIX.1-2003,
UCS:1993 | -| C++03 | ISO/IEC 14882:2003 | N1577 | N1577 ? | `199711L`
(C++98 と同じ) | C99, UCS:2000 | -| C++98 | ISO/IEC 14882:1998 | ? | ? | `199711L` | C95, UCS:1993 | +| [C++11](lang/cpp11.md) (C++0x) | ISO/IEC 14882:2011 | N3337†5([PDF](https://wg21.link/std11)/[HTML](https://timsong-cpp.github.io/cppwp/n3337/)) | N3291 N3290 N3242 N3225 N3126
N3090 N3035 N3000 N2960 N2914
N2857 N2798 N2723 N2691 N2606
N2588 N2521 N2461 N2369 N2315
N2284 N2134 N2009 N1905 N1804
N1733 N1655 N1638 | `201103L` | C99:TC3, POSIX.1-2003,
UCS:1993 | +| C++03 | ISO/IEC 14882:2003 | N1577 | N1577 N1344 N1316 | `199711L`
(C++98 と同じ) | C99,
UCS:2000 | +| C++98 | ISO/IEC 14882:1998 | N1146([複数PDF](https://open-std.org/jtc1/sc22/wg21/docs/wp/pdf/nov97-2/)) | N1146 N1117 N1037 N0996 N0926
N0836 N0785 N0691 N0687 N0629
... N0048 N0008 | `199711L` | C95,
UCS:1993 | 1. **^** カッコ内は策定時・標準化前に一時的に用いられた通称 2. **^** 最終国際規格案はPDFやHTMLなどの形で一般公開されていないため、それにほぼ同一の内容の規格案を参照する。 From c37ad49024bd7e893b2088dafd6f6a263ce1b141 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Fri, 9 Jan 2026 11:10:05 +0900 Subject: [PATCH 2530/3948] =?UTF-8?q?ranges::*=5Fresult=20:=20meta=20alias?= =?UTF-8?q?=20=E3=82=BF=E3=82=B0=E3=82=92=E8=BF=BD=E5=8A=A0=20#1545?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_in_found_result.md | 1 + reference/algorithm/ranges_in_fun_result.md | 1 + reference/algorithm/ranges_in_in_out_result.md | 1 + reference/algorithm/ranges_in_in_result.md | 1 + reference/algorithm/ranges_in_out_out_result.md | 1 + reference/algorithm/ranges_in_out_result.md | 1 + reference/algorithm/ranges_in_value_result.md | 1 + reference/algorithm/ranges_min_max_result.md | 1 + reference/algorithm/ranges_out_value_result.md | 1 + 9 files changed, 9 insertions(+) diff --git a/reference/algorithm/ranges_in_found_result.md b/reference/algorithm/ranges_in_found_result.md index bb0f493986..acff832f21 100644 --- a/reference/algorithm/ranges_in_found_result.md +++ b/reference/algorithm/ranges_in_found_result.md @@ -3,6 +3,7 @@ * std::ranges[meta namespace] * class template[meta id-type] * cpp20[meta cpp] +* next_permutation_result,prev_permutation_result[meta alias] ```cpp namespace std::ranges { diff --git a/reference/algorithm/ranges_in_fun_result.md b/reference/algorithm/ranges_in_fun_result.md index 66abce56d1..0b30f678ff 100644 --- a/reference/algorithm/ranges_in_fun_result.md +++ b/reference/algorithm/ranges_in_fun_result.md @@ -3,6 +3,7 @@ * std::ranges[meta namespace] * class template[meta id-type] * cpp20[meta cpp] +* for_each_result,for_each_n_result[meta alias] ```cpp namespace std::ranges { diff --git a/reference/algorithm/ranges_in_in_out_result.md b/reference/algorithm/ranges_in_in_out_result.md index 0975afa3ef..4939125fe3 100644 --- a/reference/algorithm/ranges_in_in_out_result.md +++ b/reference/algorithm/ranges_in_in_out_result.md @@ -3,6 +3,7 @@ * std::ranges[meta namespace] * class template[meta id-type] * cpp20[meta cpp] +* binary_transform_result,merge_result,set_union_result,set_intersection_result,set_symmetric_difference_result[meta alias] ```cpp namespace std::ranges { diff --git a/reference/algorithm/ranges_in_in_result.md b/reference/algorithm/ranges_in_in_result.md index d02409dc5c..67071593d1 100644 --- a/reference/algorithm/ranges_in_in_result.md +++ b/reference/algorithm/ranges_in_in_result.md @@ -3,6 +3,7 @@ * std::ranges[meta namespace] * class template[meta id-type] * cpp20[meta cpp] +* mismatch_result,swap_ranges_result[meta alias] ```cpp namespace std::ranges { diff --git a/reference/algorithm/ranges_in_out_out_result.md b/reference/algorithm/ranges_in_out_out_result.md index a35ed052d3..47a4c79373 100644 --- a/reference/algorithm/ranges_in_out_out_result.md +++ b/reference/algorithm/ranges_in_out_out_result.md @@ -3,6 +3,7 @@ * std::ranges[meta namespace] * class template[meta id-type] * cpp20[meta cpp] +* partition_copy_result[meta alias] ```cpp namespace std::ranges { diff --git a/reference/algorithm/ranges_in_out_result.md b/reference/algorithm/ranges_in_out_result.md index 97aa92f573..20ae2bf1a9 100644 --- a/reference/algorithm/ranges_in_out_result.md +++ b/reference/algorithm/ranges_in_out_result.md @@ -3,6 +3,7 @@ * std::ranges[meta namespace] * class template[meta id-type] * cpp20[meta cpp] +* copy_result,copy_n_result,copy_if_result,copy_backward_result,move_result,move_backward_result,unary_transform_result,replace_copy_result,replace_copy_if_result,remove_copy_result,remove_copy_if_result,unique_copy_result,reverse_copy_result,rotate_copy_result,partial_sort_copy_result,set_difference_result[meta alias] ```cpp namespace std::ranges { diff --git a/reference/algorithm/ranges_in_value_result.md b/reference/algorithm/ranges_in_value_result.md index 2755be246c..0dd7af19e7 100644 --- a/reference/algorithm/ranges_in_value_result.md +++ b/reference/algorithm/ranges_in_value_result.md @@ -3,6 +3,7 @@ * std::ranges[meta namespace] * class template[meta id-type] * cpp23[meta cpp] +* fold_left_with_iter_result,fold_left_first_with_iter_result[meta alias] ```cpp namespace std::ranges { diff --git a/reference/algorithm/ranges_min_max_result.md b/reference/algorithm/ranges_min_max_result.md index 11e3c00ec2..ef9c55233b 100644 --- a/reference/algorithm/ranges_min_max_result.md +++ b/reference/algorithm/ranges_min_max_result.md @@ -3,6 +3,7 @@ * std::ranges[meta namespace] * class template[meta id-type] * cpp20[meta cpp] +* minmax_result,minmax_element_result[meta alias] ```cpp namespace std::ranges { diff --git a/reference/algorithm/ranges_out_value_result.md b/reference/algorithm/ranges_out_value_result.md index 38f020b144..a239e0136d 100644 --- a/reference/algorithm/ranges_out_value_result.md +++ b/reference/algorithm/ranges_out_value_result.md @@ -3,6 +3,7 @@ * std::ranges[meta namespace] * class template[meta id-type] * cpp23[meta cpp] +* iota_result[meta alias] ```cpp namespace std::ranges { From f525844c0a96f0ca124154fdc49ac9499a107cdd Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Fri, 9 Jan 2026 11:21:58 +0900 Subject: [PATCH 2531/3948] =?UTF-8?q?=E3=83=AD=E3=83=83=E3=82=AF=E3=83=95?= =?UTF-8?q?=E3=83=AA=E3=83=BC=E3=83=97=E3=83=AD=E3=83=91=E3=83=86=E3=82=A3?= =?UTF-8?q?=20:=20meta=20alias=20=E3=82=BF=E3=82=B0=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=20#1545?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/atomic/lock_free_property.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/atomic/lock_free_property.md b/reference/atomic/lock_free_property.md index 5157732004..5be290b9a5 100644 --- a/reference/atomic/lock_free_property.md +++ b/reference/atomic/lock_free_property.md @@ -2,6 +2,7 @@ * atomic[meta header] * macro[meta id-type] * cpp11[meta cpp] +* ATOMIC_BOOL_LOCK_FREE,ATOMIC_CHAR_LOCK_FREE,ATOMIC_CHAR8_T_LOCK_FREE,ATOMIC_CHAR16_T_LOCK_FREE,ATOMIC_CHAR32_T_LOCK_FREE,ATOMIC_WCHAR_T_LOCK_FREE,ATOMIC_SHORT_LOCK_FREE,ATOMIC_INT_LOCK_FREE,ATOMIC_LONG_LOCK_FREE,ATOMIC_LLONG_LOCK_FREE,ATOMIC_POINTER_LOCK_FREE[meta alias] ```cpp #define ATOMIC_BOOL_LOCK_FREE unspecified // (1) From 05a2eadb95c9c85d0cdb805d02b29597b996804f Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Fri, 9 Jan 2026 11:23:20 +0900 Subject: [PATCH 2532/3948] =?UTF-8?q?=E6=9C=88=E3=83=BB=E6=9B=9C=E6=97=A5?= =?UTF-8?q?=E3=81=AE=E5=AE=9A=E6=95=B0=20:=20meta=20alias=20=E3=82=BF?= =?UTF-8?q?=E3=82=B0=E3=82=92=E8=BF=BD=E5=8A=A0=20#1545?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/chrono/month_constants.md | 1 + reference/chrono/weekday_constants.md | 1 + 2 files changed, 2 insertions(+) diff --git a/reference/chrono/month_constants.md b/reference/chrono/month_constants.md index 409eb9a583..87603986df 100644 --- a/reference/chrono/month_constants.md +++ b/reference/chrono/month_constants.md @@ -3,6 +3,7 @@ * std::chrono[meta namespace] * variable[meta id-type] * cpp20[meta cpp] +* January,February,March,April,May,June,July,August,September,October,November,December[meta alias] ```cpp namespace std::chrono { diff --git a/reference/chrono/weekday_constants.md b/reference/chrono/weekday_constants.md index b5305ec310..44d9b85477 100644 --- a/reference/chrono/weekday_constants.md +++ b/reference/chrono/weekday_constants.md @@ -3,6 +3,7 @@ * std::chrono[meta namespace] * variable[meta id-type] * cpp20[meta cpp] +* Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday[meta alias] ```cpp namespace std::chrono { From 8851e7462232bcf36492e856e70ee1752bff485e Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Fri, 9 Jan 2026 11:23:41 +0900 Subject: [PATCH 2533/3948] =?UTF-8?q?=E5=AE=9F=E8=A1=8C=E3=83=9D=E3=83=AA?= =?UTF-8?q?=E3=82=B7=E3=83=BC=20:=20meta=20alias=20=E3=82=BF=E3=82=B0?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20#1545?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/execution/execution/execution_policy.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/execution/execution/execution_policy.md b/reference/execution/execution/execution_policy.md index a9d078547e..514cb8cdae 100644 --- a/reference/execution/execution/execution_policy.md +++ b/reference/execution/execution/execution_policy.md @@ -3,6 +3,7 @@ * std::execution[meta namespace] * class[meta id-type] * cpp17[meta cpp] +* sequenced_policy,parallel_policy,parallel_unsequenced_policy,unsequenced_policy,seq,par,par_unseq,unseq[meta alias] ```cpp namespace std::execution { From d39c9aa8732432ba0f0161c4efcb9d8ba99c8d65 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Fri, 9 Jan 2026 11:23:58 +0900 Subject: [PATCH 2534/3948] =?UTF-8?q?=E8=AB=96=E7=90=86=E5=8F=8D=E8=BB=A2?= =?UTF-8?q?=E9=96=A2=E6=95=B0=E3=82=AA=E3=83=96=E3=82=B8=E3=82=A7=E3=82=AF?= =?UTF-8?q?=E3=83=88=20:=20meta=20alias=20=E3=82=BF=E3=82=B0=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20#1545?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/functional/negators.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/functional/negators.md b/reference/functional/negators.md index c5a7900599..3a9d5260a2 100644 --- a/reference/functional/negators.md +++ b/reference/functional/negators.md @@ -4,6 +4,7 @@ * class template[meta id-type] * cpp17deprecated[meta cpp] * cpp20removed[meta cpp] +* unary_negate,binary_negate,not1,not2[meta alias] ```cpp namespace std { From 9e852ec34b19927d01a793b25aff6bf0857705f7 Mon Sep 17 00:00:00 2001 From: KaiTomotake Date: Sun, 11 Jan 2026 11:45:58 +0900 Subject: [PATCH 2535/3948] create invalid_argument.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit std::invalid_argumentのリファレンスを作成 --- reference/stdexcept/invalid_argument.md | 55 +++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 reference/stdexcept/invalid_argument.md diff --git a/reference/stdexcept/invalid_argument.md b/reference/stdexcept/invalid_argument.md new file mode 100644 index 0000000000..53615c4f41 --- /dev/null +++ b/reference/stdexcept/invalid_argument.md @@ -0,0 +1,55 @@ +# invalid_argument + +* stdexcept[meta header] +* class[meta id-type] +* std[meta namespace] + +```cpp +namespace std { + class invalid_argument : public logic_error; +} +``` + +## 概要 + +関数などにおいて、引数に渡した値が不正であることを示す例外およびその基底クラスである。 +この例外は、`std::bitset::bitset`および`std::stoi`や`std::stof`系の関数によってスローされる。 + +## メンバ関数 + + +| 名前 | 説明 | 対応バージョン | +| --- | --- | --- | +| [`(constructor)`](invalid_argument/op_constructor.md.nolink) | コンストラクタ | | +| [`(destructor)`](invalid_argument/op_destructor.md.nolink) | デストラクタ | | +| [`operator=`](invalid_argument/op_assign.md.nolink) | 代入演算子 | | +| [`what`](exception/what.md.nolink) | エラー理由を取得する | | + +# 例 + +```cpp example +#include +#include +#include + +int parse_positive_integer(const std::string& s) { + int value = std::stoi(s); + if (value <= 0) { + throw std::invalid_argument("value must be positive"); + } + return value; +} + +int main() { + try { + parse_positive_integer("-10"); + } catch (const std::invalid_argument& e) { + std::cerr << e.what() << "\n"; + } +} +``` + +### 出力(標準エラー出力) +``` +value must be positive +``` From f8c48cd98a165e4e87f03f56dfdecc46638e31ac Mon Sep 17 00:00:00 2001 From: KaiTomotake Date: Sun, 11 Jan 2026 11:50:35 +0900 Subject: [PATCH 2536/3948] fix ngword MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit スローを送出に --- reference/stdexcept/invalid_argument.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/stdexcept/invalid_argument.md b/reference/stdexcept/invalid_argument.md index 53615c4f41..21eeff21ec 100644 --- a/reference/stdexcept/invalid_argument.md +++ b/reference/stdexcept/invalid_argument.md @@ -13,7 +13,7 @@ namespace std { ## 概要 関数などにおいて、引数に渡した値が不正であることを示す例外およびその基底クラスである。 -この例外は、`std::bitset::bitset`および`std::stoi`や`std::stof`系の関数によってスローされる。 +この例外は、`std::bitset::bitset`および`std::stoi`や`std::stof`系の関数によって送出される。 ## メンバ関数 From 01edba72875b56c7dbb55d7aab7458b9149b1848 Mon Sep 17 00:00:00 2001 From: yoh Date: Sun, 11 Jan 2026 22:22:31 +0900 Subject: [PATCH 2537/3948] execution: P3552R3 inline_scheduler(#1521) --- reference/execution/execution.md | 2 +- .../execution/execution/inline_scheduler.md | 106 ++++++++++++++++++ 2 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 reference/execution/execution/inline_scheduler.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index b6af20ac83..5c501efcb2 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -161,7 +161,7 @@ Senderコンシューマは名前空間 `std::this_thread` および名前空間 | [`execution::as_awaitable`](execution/as_awaitable.md) | Senderを[Awaitable型](/lang/cpp20/coroutines.md)へ変換 (customization point object) | C++26 | | [`execution::with_awaitable_senders`](execution/with_awaitable_senders.md) | [Promise型](/lang/cpp20/coroutines.md)の基底クラス (class template) | C++26 | | [`execution::affine_on`](execution/affine_on.md.nolink) | (customization point object) | C++26 | -| [`execution::inline_scheduler`](execution/inline_scheduler.md.nolink) | インラインScheduler (class) | C++26 | +| [`execution::inline_scheduler`](execution/inline_scheduler.md) | インラインScheduler (class) | C++26 | | [`execution::task_scheduler`](execution/task_scheduler.md.nolink) | 型消去タスクScheduler (class) | C++26 | | [`execution::with_error`](execution/with_error.md.nolink) | コルーチンからのエラー完了 (class template) | C++26 | | [`execution::change_coroutine_scheduler`](execution/change_coroutine_scheduler.md.nolink) | コルーチンのScheduler変更 (class template) | C++26 | diff --git a/reference/execution/execution/inline_scheduler.md b/reference/execution/execution/inline_scheduler.md new file mode 100644 index 0000000000..ae23f52859 --- /dev/null +++ b/reference/execution/execution/inline_scheduler.md @@ -0,0 +1,106 @@ +# inline_scheduler +* execution[meta header] +* class[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + class inline_scheduler { + class inline-sender; // exposition only + template + class inline-state; // exposition only + + public: + using scheduler_concept = scheduler_t; + + constexpr inline-sender schedule() noexcept { return {}; } + constexpr bool operator==(const inline_scheduler&) const noexcept = default; + }; +} +``` +* scheduler_t[link scheduler.md] +* inline-sender[italic] +* inline-state[italic] + +## 概要 +`inline_scheduler`は、インラインでタスクを実行する[Scheduler](scheduler.md)である。 + +[`schedule`](schedule.md)操作により得られる[Sender](sender.md)と[Receiver](receiver.md)を[接続(connect)](connect.md)した[OperationState](operation_state.md)は、[開始(start)](start.md)したスレッド上で即座に[値完了](set_value.md)する。 + +`inline_scheduler`型の全オブジェクトは等しい。 + + +## クラス仕様 +説明専用のクラス`inline-sender`は[`sender`](sender.md)を満たす。[`completion_signatures_of_t`](completion_signatures_of_t.md)``は、[`completion_signatures`](completion_signatures.md)`<`[`set_value_t`](set_value.md)`()>`となる。 + +説明用の`sndr`を`inline-sender`型の式とする。`CS`を[`completion_signatures`](completion_signatures.md)`<`[`set_value_t`](set_value.md)`()>`としたとき、`rcvr`を[`receiver_of`](receiver_of.md)``が`true`となる式とする。 + +- 式[`connect`](connect.md)`(sndr, rcvr)`の型は`line-state>`であり、式`((void)sndr, auto(rcvr))`が潜在的に例外送出(potentially-throwing)するときに限って潜在的に例外送出する。 +- 式[`get_completion_scheduler`](get_completion_scheduler.md)`<`[`set_value_t`](set_value.md)`>(`[`get_env`](get_env.md)`(sndr))`の型は`inline_scheduler`であり、式[`get_env`](get_env.md)`(sndr)`が潜在的に例外送出(potentially-throwing)するときに限って潜在的に例外送出する。 + +説明用の`o`を`inline-state`型の非const左辺値とし、`REC(o)`を`o`を返す[接続(connect)](connect.md)呼び出しへ渡した式`rcvr`で初期化された`Rcvr`型の非const左辺値参照とする。 + +- `REC(o)`が参照するオブジェクトは、`o`が参照するオブジェクトの生存期間(lifetime)で有効である。 +- 式[`start`](start.md)`(o)`は、[`set_value`](set_value.md)`(`[`std::move`](/reference/utility/move.md)`(REC(o)))`と等価。 + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `schedule` | `inline-sender`を返す | C++26 | + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `scheduler_concept` | [`scheduler_t`](scheduler.md) | C++26 | + + +## 例 +```cpp example +#include +#include +namespace ex = std::execution; + +int main() +{ + ex::scheduler auto sch = ex::inline_scheduler{}; + + std::this_thread::sync_wait( + ex::schedule(sch) + | ex::then([]{ std::println("task"); }) + ); +} +``` +* ex::inline_scheduler[color ff0000] +* ex::scheduler[link scheduler.md] +* ex::schedule[link schedule.md] +* ex::then[link then.md] +* std::this_thread::sync_wait[link ../this_thread/sync_wait.md] + +### 出力 +``` +task +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::scheduler`](scheduler.md) + + +## 参照 +- [P3552R3 Add a Coroutine Task Type](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3552r3.html) +- C++now 2025, [Getting The Lazy Task Done](https://schedule.cppnow.org/wp-content/uploads/2025/03/Getting_The_Lazy_Task_Done.pdf) From 54d6125be2d9f2cd9013f03950237d324b4b91af Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 12 Jan 2026 00:22:13 +0900 Subject: [PATCH 2538/3948] execution: P3552R3 task_scheduler(#1521) --- reference/execution/execution.md | 2 +- .../execution/execution/inline_scheduler.md | 3 +- .../execution/execution/task_scheduler.md | 86 +++++++++++++++ .../task_scheduler/op_constructor.md | 49 +++++++++ .../execution/task_scheduler/op_equal.md | 39 +++++++ .../execution/task_scheduler/schedule.md | 103 ++++++++++++++++++ 6 files changed, 280 insertions(+), 2 deletions(-) create mode 100644 reference/execution/execution/task_scheduler.md create mode 100644 reference/execution/execution/task_scheduler/op_constructor.md create mode 100644 reference/execution/execution/task_scheduler/op_equal.md create mode 100644 reference/execution/execution/task_scheduler/schedule.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 5c501efcb2..3536ff6d89 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -162,7 +162,7 @@ Senderコンシューマは名前空間 `std::this_thread` および名前空間 | [`execution::with_awaitable_senders`](execution/with_awaitable_senders.md) | [Promise型](/lang/cpp20/coroutines.md)の基底クラス (class template) | C++26 | | [`execution::affine_on`](execution/affine_on.md.nolink) | (customization point object) | C++26 | | [`execution::inline_scheduler`](execution/inline_scheduler.md) | インラインScheduler (class) | C++26 | -| [`execution::task_scheduler`](execution/task_scheduler.md.nolink) | 型消去タスクScheduler (class) | C++26 | +| [`execution::task_scheduler`](execution/task_scheduler.md) | 任意Scheduler型を保持するScheduler (class) | C++26 | | [`execution::with_error`](execution/with_error.md.nolink) | コルーチンからのエラー完了 (class template) | C++26 | | [`execution::change_coroutine_scheduler`](execution/change_coroutine_scheduler.md.nolink) | コルーチンのScheduler変更 (class template) | C++26 | | [`execution::task`](execution/task.md.nolink) | 非同期タスクコルーチン戻り値型 (class template) | C++26 | diff --git a/reference/execution/execution/inline_scheduler.md b/reference/execution/execution/inline_scheduler.md index ae23f52859..46cf807a65 100644 --- a/reference/execution/execution/inline_scheduler.md +++ b/reference/execution/execution/inline_scheduler.md @@ -20,6 +20,7 @@ namespace std::execution { } ``` * scheduler_t[link scheduler.md] +* receiver[link receiver.md] * inline-sender[italic] * inline-state[italic] @@ -49,7 +50,7 @@ namespace std::execution { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| `schedule` | `inline-sender`を返す | C++26 | +| `schedule` | [スケジュールSender](schedule.md)を返す | C++26 | ## メンバ型 diff --git a/reference/execution/execution/task_scheduler.md b/reference/execution/execution/task_scheduler.md new file mode 100644 index 0000000000..e71e830749 --- /dev/null +++ b/reference/execution/execution/task_scheduler.md @@ -0,0 +1,86 @@ +# task_scheduler +* execution[meta header] +* class[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + class task_scheduler; +} +``` + +## 概要 +`task_scheduler`は、任意の[Scheduler](scheduler.md)型を型消去して保持できるSchedulerである。 + +`task_scheduler`は[`scheduler`](scheduler.md)のモデルである。 + +`task_scheduler`クラスは、下記の説明専用メンバ変数を持つ。 + +- `sch_` : [`shared_ptr`](/reference/memory/shared_ptr.md)``型 + +`task_scheduler`型のオブジェクト`s`に対して、`SCHED(s)`を`s.sch_`により所有されるオブジェクトとする。 + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`(constructor)`](task_scheduler/op_constructor.md) | コンストラクタ | C++26 | +| `(destructor)` | デストラクタ | C++26 | +| [`schedule`](task_scheduler/schedule.md) | [スケジュールSender](schedule.md)を返す | C++26 | + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `scheduler_concept` | [`scheduler_t`](scheduler.md) | C++26 | + + +### 比較演算子 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`operator==`](task_scheduler/op_equal.md) | 等値比較 | C++26 | +| `operator!=` | 非等値比較 (`==`により使用可能) | C++26 | + + +## 例 +```cpp example +#include +#include +namespace ex = std::execution; + +int main() +{ + ex::task_scheduler sch1{ ex::get_parallel_scheduler() }; + ex::task_scheduler sch2{ ex::inline_scheduler{} }; + assert(sch1 != sch2); +} +``` +* ex::task_scheduler[color ff0000] +* ex::get_parallel_scheduler[link get_parallel_scheduler.md] +* ex::inline_scheduler[link inline_scheduler.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::scheduler`](scheduler.md) + + +## 参照 +- [P3552R3 Add a Coroutine Task Type](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3552r3.html) diff --git a/reference/execution/execution/task_scheduler/op_constructor.md b/reference/execution/execution/task_scheduler/op_constructor.md new file mode 100644 index 0000000000..6a38d98e73 --- /dev/null +++ b/reference/execution/execution/task_scheduler/op_constructor.md @@ -0,0 +1,49 @@ +# コンストラクタ +* execution[meta header] +* std::execution[meta namespace] +* task_scheduler[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +template > + requires(!same_as>) && scheduler +explicit task_scheduler(Sch&& sch, Allocator alloc = {}); +``` +* scheduler[link ../scheduler.md] + +## 概要 +[Scheduler](../scheduler.md)`sch`とアロケータ`alloc`を保持する`task_scheduler`オブジェクトを構築する。 + + +## テンプレートパラメータ制約 +`Sch`は`task_scheduler`ではなく、[`scheduler`](../scheduler.md)を満たす。 + + +## 効果 +説明専用のメンバ変数`sch_`を[`allocate_shared`](/reference/memory/allocate_shared.md)`<`[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`>(alloc,` [`std::forward`](/reference/utility/forward.md)`(sch))`で初期化する。 + + +## 備考 +処理系は小さなSchedulerオブジェクトに対して動的メモリ確保を避けることが推奨される。 + +`*this`上の呼び出しによってえられる[`sender`や`state`オブジェクト](schedule.md)の構築では、`alloc`のコピーを用いてメモリ確保が行われる。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::scheduler`](../scheduler.md) + + +## 参照 +- [P3552R3 Add a Coroutine Task Type](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3552r3.html) diff --git a/reference/execution/execution/task_scheduler/op_equal.md b/reference/execution/execution/task_scheduler/op_equal.md new file mode 100644 index 0000000000..439c67a562 --- /dev/null +++ b/reference/execution/execution/task_scheduler/op_equal.md @@ -0,0 +1,39 @@ +# operator== +* execution[meta header] +* std::execution[meta namespace] +* task_scheduler[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +friend bool operator== (const task_scheduler& lhs, const task_scheduler& rhs) noexcept; // (1) + +template + requires (!same_as) && scheduler +friend bool operator== (const task_scheduler& lhs, const Sch& rhs) noexcept; // (2) +``` +* task_scheduler[link ../task_scheduler.md] +* scheduler[link ../scheduler.md] + +## 概要 +等値比較を行う + + +## 戻り値 +- (1) : `lhs == SCHED(rhs)`を返す。 +- (2) : `SCHED(lhs)`の型が`Sch`でなければ`false`、そうでなければ`SCHED(lhs) == rhs`を返す。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3552R3 Add a Coroutine Task Type](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3552r3.html) diff --git a/reference/execution/execution/task_scheduler/schedule.md b/reference/execution/execution/task_scheduler/schedule.md new file mode 100644 index 0000000000..32771f8807 --- /dev/null +++ b/reference/execution/execution/task_scheduler/schedule.md @@ -0,0 +1,103 @@ +# schedule +* execution[meta header] +* std::execution[meta namespace] +* task_scheduler[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +sender schedule(); +``` +* sender[italic] + +## 概要 +保持中[Scheduler](../scheduler.md)の[スケジュールSender](../schedule.md)を返す。 + + +## 効果 +[`schedue`](../schedule.md)`(SCHED(*this))`で初期化された[Sender](../sender.md)を保持する、説明専用の`sender`型オブジェクトを返す。 + +### クラス`sender` +説明専用のクラス`task_scheduler::sender`は下記の通り定義される。 + +```cpp +class task_scheduler::sender { // exposition only +public: + using sender_concept = sender_t; + + template + state connect(R&& rcvr); +}; +``` +* sender_t[link ../sender.md] +* receiver[link ../receiver.md] +* state[italic] + +`sender`は[`sender`](../sender.md)のモデルであり、[`completion_signatures_of_t`](../completion_signatures_of_t.md)``は下記となる : + +```cpp +completion_signatures< + set_value_t(), + set_error_t(error_code), + set_error_t(exception_ptr), + set_stopped_t()> +``` +* completion_signatures[link ../completion_signatures.md] +* set_value_t[link ../set_value.md] +* set_error_t[link ../set_error.md] +* set_stopped_t[link ../set_stopped.md] +* error_code[link /reference/system_error/error_code.md] +* exception_ptr[link /reference/exception/exception_ptr.md] + +説明用の`sch`を`task_sender`型のオブジェクト、`sndr`を[`schedule`](../schedule.md)`(sch)`により得られる`sender`型のオブジェクトとする。[`get_completion_scheduler`](../get_completion_scheduler.md)`<`[`set_value_t`](../set_value.md)`>(`[`get_env`](../get_env.md)`(sndr)) == sch`は`true`となる。オブジェクト`SENDER(sndr)`は、`sndr`または同オブジェクトからムーブ構築された[Sender](../sender.md)オブジェクトとする。 + +```cpp +template +state connect(Rcvr&& rcvr); +``` +* state[italic] + +- 効果 : `r`を[`receiver`](../receiver.md)のモデルである型のオブジェクトとし、その完了ハンドラは +`rcvr`またはそのコピーに対応する完了ハンドラを呼び出すものとする。[`connect`](../connect.md)`(SENDER(*this),` [`std::move`](/reference/utility/move.md)`(r))`で初期化された[OperationState](../operation_state.md)オブジェクトを保持する`state`型のオブジェクトを返す。 + + +### クラステンプレート`state` +説明専用のクラステンプレート`task_scheduler::state`は下記の通り定義される。 + +```cpp +template +class task_scheduler::state { // exposition only +public: + using operation_state_concept = operation_state_t; + + void start() & noexcept; +}; +``` +* operation_state_t[link ../operation_state.md] + +`state`の特殊化は[`operation_state`](../operation_state.md)のモデルである。 + +```cpp +void start() & noexcept; +``` + +- 効果 : `s`を`*this`に含まれる[OperationState](../operation_state.md)オブジェクトとして、[`start`](../start.md)`(st)`と等価。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::schedule`](../schedule.md) + + +## 参照 +- [P3552R3 Add a Coroutine Task Type](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3552r3.html) From 48403c252deeb4fc1b3b718f0a1985f33acd5af3 Mon Sep 17 00:00:00 2001 From: teruyamato0731 <77840326+teruyamato0731@users.noreply.github.com> Date: Mon, 12 Jan 2026 12:53:40 +0900 Subject: [PATCH 2539/3948] =?UTF-8?q?feat(cmath):=20copysign=E3=82=84signb?= =?UTF-8?q?it=E3=81=ABinf=E3=82=84nan=E3=81=AE=E4=BE=8B=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=20(#1559)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(cmath/signbit): infやnanの実行例を追加 * feat(cmath/copysign): signbitに言及し、infやnanの実行例を追加 * fix(cmath/signbit): インデントの修正 Co-Authored-By: Koichi Murase <8982192+akinomyoga@users.noreply.github.com> * feat(cmath/copysign): 実行例のバリエーションを増やす --------- Co-authored-by: Koichi Murase <8982192+akinomyoga@users.noreply.github.com> --- reference/cmath/copysign.md | 33 +++++++++++++++++++++++------- reference/cmath/signbit.md | 40 +++++++++++++++++++++++++++---------- 2 files changed, 56 insertions(+), 17 deletions(-) diff --git a/reference/cmath/copysign.md b/reference/cmath/copysign.md index b4679ea14a..e31b2c84b3 100644 --- a/reference/cmath/copysign.md +++ b/reference/cmath/copysign.md @@ -64,6 +64,7 @@ namespace std { ## 備考 - 符号付きゼロを表現するが負のゼロを取り扱わない実装では、この関数はゼロを正と見なす。 +- 浮動小数点数の符号ビットを検出したい場合は、[`std::signbit`](/reference/cmath/signbit.md)を使用できる。`NaN`の符号を検出できる移植性のある方法はこの2つのみである。 - C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された @@ -71,22 +72,40 @@ namespace std { ```cpp example #include #include +#include int main() { - float result1 = std::copysign(1.0f, 2.0f); - float result2 = std::copysign(1.0f, -2.0f); - - std::cout << result1 << std::endl; - std::cout << result2 << std::endl; + // 通常の数値 + std::cout << "1.0f, 2.0f : " << std::copysign(1.0f, 2.0f) << std::endl; + std::cout << "0.0f, -2.0f : " << std::copysign(0.0f, -2.0f) << std::endl; + std::cout << "1.5f, -0.0f : " << std::copysign(1.5f, -0.0f) << std::endl; + + // 無限大 + const float inf = std::numeric_limits::infinity(); + std::cout << "-inf, 3.0f : " << std::copysign(-inf, 3.0f) << std::endl; + std::cout << "3.0f, -inf : " << std::copysign(3.0f, -inf) << std::endl; + + // NaN (Not a Number) + // NaNの符号もコピーされる。 + const float nan = std::numeric_limits::quiet_NaN(); + std::cout << " nan, -4.2f : " << std::copysign(nan, -4.2f) << std::endl; + std::cout << "4.2f, -nan : " << std::copysign(4.2f, -nan) << std::endl; } ``` * std::copysign[color ff0000] +* infinity()[link /reference/limits/numeric_limits/infinity.md] +* quiet_NaN()[link /reference/limits/numeric_limits/quiet_nan.md] ### 出力 ``` -1 --1 +1.0f, 2.0f : 1 +0.0f, -2.0f : -0 +1.5f, -0.0f : -1.5 +-inf, 3.0f : inf +3.0f, -inf : -3 + nan, -4.2f : -nan +4.2f, -nan : -4.2 ``` ### 備考 diff --git a/reference/cmath/signbit.md b/reference/cmath/signbit.md index 9689541eac..4b575c401f 100644 --- a/reference/cmath/signbit.md +++ b/reference/cmath/signbit.md @@ -45,26 +45,46 @@ namespace std { ## 例 ```cpp example -#include +#include #include +#include int main() { - assert(std::signbit(-1.0f)); - assert(std::signbit(-0.0f)); - - assert(!std::signbit(1.0f)); - assert(!std::signbit(0.0f)); - - constexpr float nan = std::numeric_limits::quiet_NaN(); - assert(!std::signbit(nan)); - assert(std::signbit(-nan)); + // 通常の数値 + std::cout << std::boolalpha; + std::cout << "-1.0f : " << std::signbit(-1.0f) << std::endl; + std::cout << "-0.0f : " << std::signbit(-0.0f) << std::endl; + + std::cout << "1.0f : " << std::signbit(1.0f) << std::endl; + std::cout << "0.0f : " << std::signbit(0.0f) << std::endl; + + // 無限大 + const double inf = std::numeric_limits::infinity(); + std::cout << "inf : " << std::signbit(inf) << std::endl; + std::cout << "-inf : " << std::signbit(-inf) << std::endl; + + // NaN (Not a Number) + // NaNの符号ビットも検出できる + const double nan = std::numeric_limits::quiet_NaN(); + std::cout << "nan : " << std::signbit(nan) << std::endl; + std::cout << "-nan : " << std::signbit(-nan) << std::endl; } ``` * std::signbit[color ff0000] +* infinity()[link /reference/limits/numeric_limits/infinity.md] +* quiet_NaN()[link /reference/limits/numeric_limits/quiet_nan.md] ### 出力 ``` +-1.0f : true +-0.0f : true +1.0f : false +0.0f : false +inf : false +-inf : true +nan : false +-nan : true ``` ### 備考 From 5e6fb6feed83ae51148e01d75c649ef4f7ec7fde Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 12 Jan 2026 21:36:59 +0900 Subject: [PATCH 2540/3948] execution: P3552R3 task(#1521) --- reference/execution/execution.md | 2 +- .../execution/execution/inline_scheduler.md | 4 +- reference/execution/execution/task.md | 119 ++++++++++++++++++ reference/execution/execution/task/connect.md | 49 ++++++++ .../execution/task/op_constructor.md | 36 ++++++ .../execution/execution/task/op_destructor.md | 38 ++++++ .../execution/execution/task_scheduler.md | 9 +- 7 files changed, 253 insertions(+), 4 deletions(-) create mode 100644 reference/execution/execution/task.md create mode 100644 reference/execution/execution/task/connect.md create mode 100644 reference/execution/execution/task/op_constructor.md create mode 100644 reference/execution/execution/task/op_destructor.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 3536ff6d89..7a51bf4512 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -165,7 +165,7 @@ Senderコンシューマは名前空間 `std::this_thread` および名前空間 | [`execution::task_scheduler`](execution/task_scheduler.md) | 任意Scheduler型を保持するScheduler (class) | C++26 | | [`execution::with_error`](execution/with_error.md.nolink) | コルーチンからのエラー完了 (class template) | C++26 | | [`execution::change_coroutine_scheduler`](execution/change_coroutine_scheduler.md.nolink) | コルーチンのScheduler変更 (class template) | C++26 | -| [`execution::task`](execution/task.md.nolink) | 非同期タスクコルーチン戻り値型 (class template) | C++26 | +| [`execution::task`](execution/task.md) | タスクコルーチン戻り値型 (class template) | C++26 | ### 実行スコープユーティリティ diff --git a/reference/execution/execution/inline_scheduler.md b/reference/execution/execution/inline_scheduler.md index 46cf807a65..5aa7c78b39 100644 --- a/reference/execution/execution/inline_scheduler.md +++ b/reference/execution/execution/inline_scheduler.md @@ -37,7 +37,7 @@ namespace std::execution { 説明用の`sndr`を`inline-sender`型の式とする。`CS`を[`completion_signatures`](completion_signatures.md)`<`[`set_value_t`](set_value.md)`()>`としたとき、`rcvr`を[`receiver_of`](receiver_of.md)``が`true`となる式とする。 -- 式[`connect`](connect.md)`(sndr, rcvr)`の型は`line-state>`であり、式`((void)sndr, auto(rcvr))`が潜在的に例外送出(potentially-throwing)するときに限って潜在的に例外送出する。 +- 式[`connect`](connect.md)`(sndr, rcvr)`の型は`inline-state<`[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`>`であり、式`((void)sndr, auto(rcvr))`が潜在的に例外送出(potentially-throwing)するときに限って潜在的に例外送出する。 - 式[`get_completion_scheduler`](get_completion_scheduler.md)`<`[`set_value_t`](set_value.md)`>(`[`get_env`](get_env.md)`(sndr))`の型は`inline_scheduler`であり、式[`get_env`](get_env.md)`(sndr)`が潜在的に例外送出(potentially-throwing)するときに限って潜在的に例外送出する。 説明用の`o`を`inline-state`型の非const左辺値とし、`REC(o)`を`o`を返す[接続(connect)](connect.md)呼び出しへ渡した式`rcvr`で初期化された`Rcvr`型の非const左辺値参照とする。 @@ -50,6 +50,8 @@ namespace std::execution { | 名前 | 説明 | 対応バージョン | |------|------|----------------| +| `(constructor)` | コンストラクタ | C++26 | +| `(destructor)` | デストラクタ | C++26 | | `schedule` | [スケジュールSender](schedule.md)を返す | C++26 | ## メンバ型 diff --git a/reference/execution/execution/task.md b/reference/execution/execution/task.md new file mode 100644 index 0000000000..4f251a6ad9 --- /dev/null +++ b/reference/execution/execution/task.md @@ -0,0 +1,119 @@ +# task +* execution[meta header] +* class template[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template + class task; +} +``` + +## 概要 +`task`クラステンプレートは、[コルーチン](/lang/cpp20/coroutines.md)の戻り値型として使用できる[Sender](sender.md)を表す。 + +- 第1テンプレートパラメータ`T`が`void`ではないとき、[値完了](set_value.md)のデータ型を定義する。そうでなければ、値完了はデータを持たない。`task`を返すコルーチン内部では、(もしあれば)`co_return`のオペランドは[`set_value`](set_value.md)の引数となる。 +- 第2テンプレートパラメータ`Environment`は、`task`の動作カスタマイズに用いられる。 + + +## クラス仕様 +`T`が`void`、参照型、cv修飾された非配列オブジェクト型であり、かつ`E`がクラス型であるとき、`task`は[`sender`](sender.md)のモデルである。そうでなければ、`task`の定義をインスタンス化するプログラムは不適格となる。 + +`task`テンプレート特殊化のネストした型は、`Environment`パラメータに基づいて決定される : + +- `allocator_type` : `Environment::allocator_type`が有効な型ならばその型、そうでなければ[`allocator`](/reference/memory/allocator.md)`` +- `scheduler_type` : `Environment::scheduler_type`が有効な型ならばその型、そうでなければ[`task_scheduler`](task_scheduler.md) +- `stop_source_type` : `Environment::stop_source_type`が有効な型ならばその型、そうでなければ[`inplace_stop_source`](/reference/stop_token/inplace_stop_source.md) +- `stop_token_type` : `decltype(`[`declval`](/reference/utility/declval.md)`().`[`get_token()`](/reference/stop_token/stoppable-source.md)`)` +- `error_types` : `Environment::error_types`が有効な型ならばその型、そうでなければ[`completion_signatures`](completion_signatures.md)`<`[`set_error_t`](set_error.md)`(`[`exception_ptr`](/reference/exception/exception_ptr.md)`)>` + +`error_types`が[`completion_signatures`](completion_signatures.md)``の特殊化ではない、もしくは`ErrorSigs`が[`set_error_t`](set_error.md)`(E)`が適格でない要素型`E`を含むとき、プログラムは不適格となる。 + +型エイリアス`completion_signatures`は、(未規定の順序で)次のテンプレート実引数をもつ[`execution::completion_signatures`](completion_signatures.md)の特殊化となる : + +- `T`が`void`のとき[`set_value_t`](set_value.md)`()`、そうでなければ`set_value_t(T)` +- `error_types`で表される[`execution::completion_signatures`](completion_signatures.md)の特殊化のテンプレート実引数(エラー型`Err`を持つ[`set_error_t`](set_error.md)`(Err)...`) +- [`set_stopped_t`](set_stopped.md) + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`(constructor)`](task/op_constructor.md) | コンストラクタ | C++26 | +| [`(destructor)`](task/op_destructor.md) | デストラクタ | C++26 | +| [`connect`](task/connect.md) | [Receiver](receiver.md)との接続操作 | C++26 | + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `sender_concept` | [`sender_t`](sender.md) | C++26 | +| `completion_signatures` | [完了シグネチャ集合](completion_signatures.md) | C++26 | +| `allocator_type` | コルーチンのアロケータ型 | C++26 | +| `scheduler_type` | コルーチンのScheduler型 | C++26 | +| `stop_source_type` | コルーチンの停止ソース型 | C++26 | +| `stop_token_type` | コルーチンの停止トークン型 | C++26 | +| `error_types` | コルーチンの[エラー完了](set_error.md)の結果型 | C++26 | +| [`state`](task/state.md.nolink) | タスクコルーチン動作の説明専用クラステンプレート | C++26 | +| [`promise_type`](task/promise_type.md.nolink) | タスクコルーチンの[Promise型](/lang/cpp20/coroutines.md) | C++26 | + + +## 例 +```cpp example +#include +#include +namespace ex = std::execution; + +// int型を返すタスクコルーチンを定義 +ex::task work(int n) +{ + // 他Senderの結果値を取得する + int m = co_await ex::just(3); + // タスクコルーチンから値を返す + co_return m * n * 7; +} + +int main() +{ + // タスクコルーチン呼び出しによりSenderを生成 + ex::sender auto sndr = work(2); + + // Sender(タスクコルーチン)を開始して結果取得 + auto [n] = std::this_thread::sync_wait(std::move(sndr)).value(); + assert(n == 42); +} +``` +* ex::task[color ff0000] +* ex::just[link just.md] +* ex::sender[link sender.md] +* std::this_thread::sync_wait[link ../this_thread/sync_wait.md] +* value()[link /reference/optional/optional/value.md] +* std::move[link /reference/utility/move.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::task_scheduler`](task_scheduler.md) + + +## 参照 +- [P3552R3 Add a Coroutine Task Type](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3552r3.html) +- C++now 2025, [Getting The Lazy Task Done](https://schedule.cppnow.org/wp-content/uploads/2025/03/Getting_The_Lazy_Task_Done.pdf) diff --git a/reference/execution/execution/task/connect.md b/reference/execution/execution/task/connect.md new file mode 100644 index 0000000000..2fb3068391 --- /dev/null +++ b/reference/execution/execution/task/connect.md @@ -0,0 +1,49 @@ +# connect +* execution[meta header] +* std::execution[meta namespace] +* task[meta class] +* template function[meta id-type] +* cpp26[meta cpp] + +```cpp +template +state connect(Rcvr&& recv) &&; +``` +* receiver[link ../receiver.md] +* state[italic] + +## 概要 +[Receiver](../receiver.md)と接続する。 + + +## 事前条件 +[`bool`](/reference/coroutine/coroutine_handle/op_bool.md)`(handle) == true` + + +## 効果 +以下と等価。 + +```cpp +return state(exchange(handle, {}), std::forward(recv)); +``` +* exchange[link /reference/utility/exchange.md] +* state[italic] + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::connect`](../connect.md) + + +## 参照 +- [P3552R3 Add a Coroutine Task Type](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3552r3.html) diff --git a/reference/execution/execution/task/op_constructor.md b/reference/execution/execution/task/op_constructor.md new file mode 100644 index 0000000000..5286cbe63a --- /dev/null +++ b/reference/execution/execution/task/op_constructor.md @@ -0,0 +1,36 @@ +# コンストラクタ +* execution[meta header] +* std::execution[meta namespace] +* task[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +task(task&& other) noexcept; +``` + +## 概要 +ムーブコンストラクタ + + +## 効果 +説明専用メンバ変数`handle`を[`exchange`](/reference/utility/exchange.md)`(other.handle, {})`で初期化する。 + + +## 備考 +`task`オブジェクトは、タスクコルーチンの呼び出しによってのみ構築される。ムーブのみ可能なため、コピーコンストラクタは提供されない。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3552R3 Add a Coroutine Task Type](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3552r3.html) diff --git a/reference/execution/execution/task/op_destructor.md b/reference/execution/execution/task/op_destructor.md new file mode 100644 index 0000000000..62e916d50a --- /dev/null +++ b/reference/execution/execution/task/op_destructor.md @@ -0,0 +1,38 @@ +# デストラクタ +* execution[meta header] +* std::execution[meta namespace] +* task[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +~task(); +``` + +## 概要 +デストラクタ + + +## 効果 +下記と等価。 + +```cpp +if (handle) + handle.destroy(); +``` +* destroy()[link /reference/coroutine/coroutine_handle/destroy.md] + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3552R3 Add a Coroutine Task Type](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3552r3.html) diff --git a/reference/execution/execution/task_scheduler.md b/reference/execution/execution/task_scheduler.md index e71e830749..96df8fa037 100644 --- a/reference/execution/execution/task_scheduler.md +++ b/reference/execution/execution/task_scheduler.md @@ -11,10 +11,14 @@ namespace std::execution { ``` ## 概要 -`task_scheduler`は、任意の[Scheduler](scheduler.md)型を型消去して保持できるSchedulerである。 +`task_scheduler`は、任意の[Scheduler](scheduler.md)型を型消去して保持するSchedulerである。 + +実行制御ライブラリのタスクコルーチン戻り値型[`task`](task.md)において、環境`E`のデフォルトScheduler型として利用される。 `task_scheduler`は[`scheduler`](scheduler.md)のモデルである。 + +## クラス仕様 `task_scheduler`クラスは、下記の説明専用メンバ変数を持つ。 - `sch_` : [`shared_ptr`](/reference/memory/shared_ptr.md)``型 @@ -30,13 +34,13 @@ namespace std::execution { | `(destructor)` | デストラクタ | C++26 | | [`schedule`](task_scheduler/schedule.md) | [スケジュールSender](schedule.md)を返す | C++26 | + ## メンバ型 | 名前 | 説明 | 対応バージョン | |------|------|----------------| | `scheduler_concept` | [`scheduler_t`](scheduler.md) | C++26 | - ### 比較演算子 | 名前 | 説明 | 対応バージョン | @@ -80,6 +84,7 @@ int main() ## 関連項目 - [`execution::scheduler`](scheduler.md) +- [`execution::task`](task.md) ## 参照 From 445cdf9947c6bcd388f3fee6752e5d45313c5a30 Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 12 Jan 2026 22:19:45 +0900 Subject: [PATCH 2541/3948] execution/task/connect: fix meta id-type --- reference/execution/execution/task/connect.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/execution/execution/task/connect.md b/reference/execution/execution/task/connect.md index 2fb3068391..e872a10292 100644 --- a/reference/execution/execution/task/connect.md +++ b/reference/execution/execution/task/connect.md @@ -2,7 +2,7 @@ * execution[meta header] * std::execution[meta namespace] * task[meta class] -* template function[meta id-type] +* function template[meta id-type] * cpp26[meta cpp] ```cpp From ca315ba7b089f5a8895fc1e0472c1e83c1ab3c07 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 13 Jan 2026 10:58:29 +0900 Subject: [PATCH 2542/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E5=88=87?= =?UTF-8?q?=E3=82=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/memory/allocator_traits.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/memory/allocator_traits.md b/reference/memory/allocator_traits.md index 0dbfbf3c27..0b4df91c71 100644 --- a/reference/memory/allocator_traits.md +++ b/reference/memory/allocator_traits.md @@ -208,7 +208,7 @@ int main() { ## 参照 - [Allocators@C++11 - Cryolite](http://www.slideshare.net/Cryolite/allocator11final) -- [A visitor’s guide to C++ allocators](https://rawgit.com/google/cxx-std-draft/allocator-paper/allocator_user_guide.html) +- [A visitor’s guide to C++ allocators](https://htmlpreview.github.io/?https://github.com/google/cxx-std-draft/blob/allocator-paper/allocator_user_guide.html) - [N2982 Allocators post Removal of C++ Concepts (Rev 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2982.pdf) - [AllocatorAwareContainer: Introduction and pitfalls of `propagate_on_container_XXX` defaults](https://www.foonathan.net/2015/10/allocatorawarecontainer-propagation-pitfalls/) - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) From c26fda2cbca0c142f99216dc0642820faa41d9d2 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 13 Jan 2026 11:19:13 +0900 Subject: [PATCH 2543/3948] =?UTF-8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E5=88=87?= =?UTF-8?q?=E3=82=8C=E3=82=92=E4=BF=AE=E6=AD=A3=20#1561?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/memory/allocator.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/memory/allocator.md b/reference/memory/allocator.md index 7d9970fe2d..b212595769 100644 --- a/reference/memory/allocator.md +++ b/reference/memory/allocator.md @@ -136,7 +136,7 @@ int main(int argc, char** argv) { - [Visual C++](/implementation.md#visual_cpp): 2012, 2013 ## 参照 -- [A visitor’s guide to C++ allocators](https://rawgit.com/google/cxx-std-draft/allocator-paper/allocator_user_guide.html) +- [A visitor’s guide to C++ allocators](https://htmlpreview.github.io/?https://github.com/google/cxx-std-draft/blob/allocator-paper/allocator_user_guide.html) - [LWG #2103 - `std::allocator_traits>::propagate_on_container_move_assignment`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2103) - [N2669 Thread-Safety in the Standard Library (Rev 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2669.htm) - [AllocatorAwareContainer: Introduction and pitfalls of `propagate_on_container_XXX` defaults](https://www.foonathan.net/2015/10/allocatorawarecontainer-propagation-pitfalls/) From edecb0a07384fea4a739699b4313ae9d92d14503 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 13 Jan 2026 11:52:53 +0900 Subject: [PATCH 2544/3948] execution: P3552R3 taski::state(#1521) --- reference/execution/execution/task.md | 6 +- reference/execution/execution/task/connect.md | 4 +- reference/execution/execution/task/state.md | 96 +++++++++++++++++++ 3 files changed, 101 insertions(+), 5 deletions(-) create mode 100644 reference/execution/execution/task/state.md diff --git a/reference/execution/execution/task.md b/reference/execution/execution/task.md index 4f251a6ad9..43060ee80f 100644 --- a/reference/execution/execution/task.md +++ b/reference/execution/execution/task.md @@ -34,8 +34,8 @@ namespace std::execution { 型エイリアス`completion_signatures`は、(未規定の順序で)次のテンプレート実引数をもつ[`execution::completion_signatures`](completion_signatures.md)の特殊化となる : - `T`が`void`のとき[`set_value_t`](set_value.md)`()`、そうでなければ`set_value_t(T)` -- `error_types`で表される[`execution::completion_signatures`](completion_signatures.md)の特殊化のテンプレート実引数(エラー型`Err`を持つ[`set_error_t`](set_error.md)`(Err)...`) -- [`set_stopped_t`](set_stopped.md) +- `error_types`で表される[`execution::completion_signatures`](completion_signatures.md)の特殊化のテンプレート実引数(エラー型`Err`を持つ[`set_error_t`](set_error.md)`(Err)`) +- [`set_stopped_t`](set_stopped.md)`()` ## メンバ関数 @@ -58,7 +58,7 @@ namespace std::execution { | `stop_source_type` | コルーチンの停止ソース型 | C++26 | | `stop_token_type` | コルーチンの停止トークン型 | C++26 | | `error_types` | コルーチンの[エラー完了](set_error.md)の結果型 | C++26 | -| [`state`](task/state.md.nolink) | タスクコルーチン動作の説明専用クラステンプレート | C++26 | +| [`state`](task/state.md) | タスクコルーチン動作の説明専用クラステンプレート | C++26 | | [`promise_type`](task/promise_type.md.nolink) | タスクコルーチンの[Promise型](/lang/cpp20/coroutines.md) | C++26 | diff --git a/reference/execution/execution/task/connect.md b/reference/execution/execution/task/connect.md index e872a10292..b8cb14498c 100644 --- a/reference/execution/execution/task/connect.md +++ b/reference/execution/execution/task/connect.md @@ -10,7 +10,7 @@ template state connect(Rcvr&& recv) &&; ``` * receiver[link ../receiver.md] -* state[italic] +* state[link state.md] ## 概要 [Receiver](../receiver.md)と接続する。 @@ -27,7 +27,7 @@ state connect(Rcvr&& recv) &&; return state(exchange(handle, {}), std::forward(recv)); ``` * exchange[link /reference/utility/exchange.md] -* state[italic] +* state[link state.md] ## バージョン diff --git a/reference/execution/execution/task/state.md b/reference/execution/execution/task/state.md new file mode 100644 index 0000000000..7c53c985c7 --- /dev/null +++ b/reference/execution/execution/task/state.md @@ -0,0 +1,96 @@ +# task::state +* execution[meta header] +* class template[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template + template + class task::state { // exposition only + public: + using operation_state_concept = operation_state_t; + + template + state(coroutine_handle h, Rcvr&& rr); + ~state(); + void start() & noexcept; + +private: + using own-env-t = see below; // exposition only + coroutine_handle handle; // exposition only + remove_cvref_t rcvr; // exposition only + own-env-t own-env; // exposition only + Environment environment; // exposition only + }; +} +``` +* receiver[link ../receiver.md] +* task[link ../task.md] +* operation_state_t[link ../operation_state.md] +* coroutine_handle[link /reference/coroutine/coroutine_handle.md] +* promise_type[link promise_type.md.nolink] +* own-env-t[italic] + +## 概要 +`task::state`は、[タスクコルーチン](../task.md)動作の説明専用クラステンプレートである。 + + +## クラス仕様 +説明専用の`own-env-t`は、有効な型ならば`Environment::`[`template env_type`](../task.md)`()))>`となる。そうでなければ[`env<>`](../env.md)となる。 + +```cpp +template +state(coroutine_handle h, Rcvr&& rr); +``` +* coroutine_handle[link /reference/coroutine/coroutine_handle.md] +* promise_type[link promise_type.md.nolink] + +- 効果 : + - `handle`を[`std::move`](/reference/utility/move.md)`(h);`で初期化する。 + - `rcvr`を[`std::forward`](/reference/utility/forward.md)`(rr)`で初期化する。 + - `own-env`を、式が有効ならば`own-env-t(`[`get_env`](../get_env.md)`(rcvr))`で、そうでなければ`own-env-t()`で初期化する。いずれの式も適格でなければ、プログラムは不適格となる。 + - `environment`を、式が有効ならば`Environment(own-env)`で、そうではなく式が有効ならば`Environment(`[`get_env`](../get_env.md)`(rcvr))`で、そうでなければ`Environment()`で初期化する。いずれの式も適格でなければ、プログラムは不適格となる。 + +```cpp +~state(); +``` + +- 効果 : 以下と等価。 + + ```cpp + if (handle) + handle.destroy(); + ``` + * destroy()[link /reference/coroutine/coroutine_handle/destroy.md] + +```cpp +void start() & noexcept; +``` + +- 効果 : 説明用の`prom`を`handle.`[`promise()`](/reference/coroutine/coroutine_handle/promise.md)オブジェクトとする。`*this`と関連する`STATE(prom)`、`RCVR(prom)`、`SCHED(prom)`を下記とする。 + - `STATE(prom)` : `*this` + - `RCVR(prom)` : `rcvr` + - `SCHED(prom)` : 式が有効ならば[`scheduler_type`](../task.md)`(`[`get_scheduler`](../get_scheduler.md)`(`[`get_env`](../get_env.md)`(rcvr)))`で初期化したオブジェクト、そうでなれば`scheduler_type()`。いずれの式も適格でなければ、プログラムは不適格となる。 + + 説明用の`st`を[`get_stop_token`](../../get_stop_token.md)`(`[`get_env`](../get_env.md)`(rcvr))`とする。`prom.token`と`prom.source`を下記のように初期化する。 + + - `prom.token.`[`stop_requested()`](/reference/stop_token/stoppable_token.md) : `st.stop_requested()`を返す。 + - `prom.token.`[`stop_possible()`](/reference/stop_token/stoppable_token.md) : `st.stop_possible()`を返す。 + ― 型`Fn`と型`Init`をそれぞれ[`invocalbe`](/reference/concepts/invocable.md)``と[`constructible_from`](/reference/concepts/constructible_from.md)``のモデルとしたとき、[`stop_token::callback_type`](/reference/stop_token/stoppable_token.md)``は[`stoppable-callback-for`](/reference/stop_token/stoppable_token.md)``のモデルである。 + + その後、`handle.`[`resume()`](/reference/coroutine/coroutine_handle/resume.md)を呼び出す。 + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`execution::task::promise_type`](promise_type.md.nolink) + + +## 参照 +- [P3552R3 Add a Coroutine Task Type](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3552r3.html) From bfd1134c469ab395e9cabe2be3b3311fbe3492c4 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 13 Jan 2026 16:52:34 +0900 Subject: [PATCH 2545/3948] =?UTF-8?q?boolean-testable=20:=20=E8=AA=AC?= =?UTF-8?q?=E6=98=8E=E5=B0=82=E7=94=A8=E3=81=A8=E3=81=97=E3=81=A6=E7=99=BB?= =?UTF-8?q?=E9=8C=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/concepts/boolean-testable.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/concepts/boolean-testable.md b/reference/concepts/boolean-testable.md index ef567c5ace..adfb878f92 100644 --- a/reference/concepts/boolean-testable.md +++ b/reference/concepts/boolean-testable.md @@ -1,4 +1,5 @@ # boolean-testable +* [meta exposition-only] * concepts[meta header] * std[meta namespace] * concept[meta id-type] From 246747527c9acf8f68ee7cf076247c9c742b74a8 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 13 Jan 2026 17:01:47 +0900 Subject: [PATCH 2546/3948] =?UTF-8?q?=E7=B7=A8=E9=9B=86=E8=80=85=E5=90=91?= =?UTF-8?q?=E3=81=91=E3=83=89=E3=82=AD=E3=83=A5=E3=83=A1=E3=83=B3=E3=83=88?= =?UTF-8?q?=20:=20=E8=AA=AC=E6=98=8E=E5=B0=82=E7=94=A8=E3=81=AE=E6=A9=9F?= =?UTF-8?q?=E8=83=BD=E3=81=AB=E3=81=A4=E3=81=91=E3=82=8B=E3=83=A1=E3=82=BF?= =?UTF-8?q?=E3=82=BF=E3=82=B0=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6=E8=A8=98?= =?UTF-8?q?=E8=BC=89=20#1558?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start_editing/class_template_page.md | 1 + start_editing/comparison_operator_template_page.md | 1 + start_editing/concept_template_page.md | 1 + start_editing/cpo_template_page.md | 1 + start_editing/function_template_page.md | 1 + start_editing/header_template_page.md | 1 + start_editing/module_template_page.md | 1 + start_editing/named_requirement_template_page.md | 2 ++ start_editing/type-type_template_page.md | 1 + 9 files changed, 10 insertions(+) diff --git a/start_editing/class_template_page.md b/start_editing/class_template_page.md index 84a9d67b6b..cbf720d661 100644 --- a/start_editing/class_template_page.md +++ b/start_editing/class_template_page.md @@ -12,6 +12,7 @@ * std[meta namespace] * cpp17[meta cpp] + diff --git a/start_editing/comparison_operator_template_page.md b/start_editing/comparison_operator_template_page.md index 7adae91ffe..5f2874ca45 100644 --- a/start_editing/comparison_operator_template_page.md +++ b/start_editing/comparison_operator_template_page.md @@ -13,6 +13,7 @@ * class_name[meta class] * cpp17[meta cpp] + diff --git a/start_editing/concept_template_page.md b/start_editing/concept_template_page.md index 7a21b80894..0c132bb3be 100644 --- a/start_editing/concept_template_page.md +++ b/start_editing/concept_template_page.md @@ -12,6 +12,7 @@ * std[meta namespace] * cpp20[meta cpp] + diff --git a/start_editing/cpo_template_page.md b/start_editing/cpo_template_page.md index b2cef3b058..df23b4f2f6 100644 --- a/start_editing/cpo_template_page.md +++ b/start_editing/cpo_template_page.md @@ -12,6 +12,7 @@ * std[meta namespace] * cpp20[meta cpp] + diff --git a/start_editing/function_template_page.md b/start_editing/function_template_page.md index 76400af2c4..e8f439b671 100644 --- a/start_editing/function_template_page.md +++ b/start_editing/function_template_page.md @@ -13,6 +13,7 @@ * class_name[meta class] * cpp17[meta cpp] + diff --git a/start_editing/header_template_page.md b/start_editing/header_template_page.md index 66c112c2b6..59350b0060 100644 --- a/start_editing/header_template_page.md +++ b/start_editing/header_template_page.md @@ -10,6 +10,7 @@ * header_name[meta header] * cpp17[meta cpp] + diff --git a/start_editing/module_template_page.md b/start_editing/module_template_page.md index e2d87fd13f..2c1f81f2b6 100644 --- a/start_editing/module_template_page.md +++ b/start_editing/module_template_page.md @@ -10,6 +10,7 @@ * module_name[meta module] * cpp26[meta cpp] + diff --git a/start_editing/named_requirement_template_page.md b/start_editing/named_requirement_template_page.md index 6688cb2e50..f8eba74938 100644 --- a/start_editing/named_requirement_template_page.md +++ b/start_editing/named_requirement_template_page.md @@ -7,9 +7,11 @@ その際拡張構文である`example`タグをルールに従って付け、コンパイル・実行可能にすることを検討してください。 ) +* [meta exposition-only] * named requirement[meta id-type] * cpp17[meta cpp] + diff --git a/start_editing/type-type_template_page.md b/start_editing/type-type_template_page.md index 4054207ff2..2ef93093f5 100644 --- a/start_editing/type-type_template_page.md +++ b/start_editing/type-type_template_page.md @@ -13,6 +13,7 @@ * class_name[meta class] * cpp17[meta cpp] + From c54cea58c25294bc6b65fce0cb0df7453e5e6bb0 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 13 Jan 2026 20:37:50 +0900 Subject: [PATCH 2547/3948] =?UTF-8?q?execution/task=5Fscheduler:=20?= =?UTF-8?q?=E8=AA=BF=E6=95=B4(#1521)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit LWG 4342, 4445, 4446適用 --- .../execution/execution/task_scheduler.md | 4 ++- .../execution/task_scheduler/op_assign.md | 30 +++++++++++++++++++ .../task_scheduler/op_constructor.md | 18 ++++++----- .../execution/task_scheduler/schedule.md | 26 +++++++++------- 4 files changed, 59 insertions(+), 19 deletions(-) create mode 100644 reference/execution/execution/task_scheduler/op_assign.md diff --git a/reference/execution/execution/task_scheduler.md b/reference/execution/execution/task_scheduler.md index 96df8fa037..971a126b5c 100644 --- a/reference/execution/execution/task_scheduler.md +++ b/reference/execution/execution/task_scheduler.md @@ -23,7 +23,7 @@ namespace std::execution { - `sch_` : [`shared_ptr`](/reference/memory/shared_ptr.md)``型 -`task_scheduler`型のオブジェクト`s`に対して、`SCHED(s)`を`s.sch_`により所有されるオブジェクトとする。 +`task_scheduler`型のオブジェクト`s`に対して、`SCHED(s)`を`s.sch_`が所有するポインタが指すオブジェクトとする。 ## メンバ関数 @@ -32,6 +32,7 @@ namespace std::execution { |------|------|----------------| | [`(constructor)`](task_scheduler/op_constructor.md) | コンストラクタ | C++26 | | `(destructor)` | デストラクタ | C++26 | +| [`operator=`](task_scheduler/op_assign.md) | 代入演算子 | C++26 | | [`schedule`](task_scheduler/schedule.md) | [スケジュールSender](schedule.md)を返す | C++26 | @@ -89,3 +90,4 @@ int main() ## 参照 - [P3552R3 Add a Coroutine Task Type](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3552r3.html) +- [LWG4446. Bad phrasing for `SCHED(s)`](https://cplusplus.github.io/LWG/issue4446) diff --git a/reference/execution/execution/task_scheduler/op_assign.md b/reference/execution/execution/task_scheduler/op_assign.md new file mode 100644 index 0000000000..c661b3b382 --- /dev/null +++ b/reference/execution/execution/task_scheduler/op_assign.md @@ -0,0 +1,30 @@ +# operator= +* execution[meta header] +* std::execution[meta namespace] +* task_scheduler[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +task_scheduler& operator=(const task_scheduler&) = default; +``` +* task_scheduler[link ../task_scheduler.md] + +## 概要 +ムーブ代入演算子 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3552R3 Add a Coroutine Task Type](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3552r3.html) +- [LWG4445. `sch_` must not be in moved-from state](https://cplusplus.github.io/LWG/issue4445) diff --git a/reference/execution/execution/task_scheduler/op_constructor.md b/reference/execution/execution/task_scheduler/op_constructor.md index 6a38d98e73..cf797bda93 100644 --- a/reference/execution/execution/task_scheduler/op_constructor.md +++ b/reference/execution/execution/task_scheduler/op_constructor.md @@ -8,26 +8,29 @@ ```cpp template > requires(!same_as>) && scheduler -explicit task_scheduler(Sch&& sch, Allocator alloc = {}); +explicit task_scheduler(Sch&& sch, Allocator alloc = {}); // (1) + +task_scheduler(const task_scheduler&) = default; // (2) ``` +* task_scheduler[link ../task_scheduler.md] * scheduler[link ../scheduler.md] ## 概要 -[Scheduler](../scheduler.md)`sch`とアロケータ`alloc`を保持する`task_scheduler`オブジェクトを構築する。 - +- (1) : [Scheduler](../scheduler.md)`sch`とアロケータ`alloc`を保持する`task_scheduler`オブジェクトを構築する。 +- (2) : ムーブコンストラクタ ## テンプレートパラメータ制約 -`Sch`は`task_scheduler`ではなく、[`scheduler`](../scheduler.md)を満たす。 +(1) : `Sch`は`task_scheduler`ではなく、[`scheduler`](../scheduler.md)を満たす。 ## 効果 -説明専用のメンバ変数`sch_`を[`allocate_shared`](/reference/memory/allocate_shared.md)`<`[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`>(alloc,` [`std::forward`](/reference/utility/forward.md)`(sch))`で初期化する。 +(1) 説明専用のメンバ変数`sch_`を[`allocate_shared`](/reference/memory/allocate_shared.md)`<`[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`>(alloc,` [`std::forward`](/reference/utility/forward.md)`(sch))`で初期化する。 ## 備考 -処理系は小さなSchedulerオブジェクトに対して動的メモリ確保を避けることが推奨される。 +(1) 処理系は小さなSchedulerオブジェクトに対して動的メモリ確保を避けることが推奨される。 -`*this`上の呼び出しによってえられる[`sender`や`state`オブジェクト](schedule.md)の構築では、`alloc`のコピーを用いてメモリ確保が行われる。 +`*this`上の呼び出しによってえられる[`ts-sender`や`state`オブジェクト](schedule.md)の構築では、`alloc`のコピーを用いてメモリ確保が行われる。 ## バージョン @@ -47,3 +50,4 @@ explicit task_scheduler(Sch&& sch, Allocator alloc = {}); ## 参照 - [P3552R3 Add a Coroutine Task Type](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3552r3.html) +- [LWG4445. `sch_` must not be in moved-from state](https://cplusplus.github.io/LWG/issue4445) diff --git a/reference/execution/execution/task_scheduler/schedule.md b/reference/execution/execution/task_scheduler/schedule.md index 32771f8807..5647fab8d6 100644 --- a/reference/execution/execution/task_scheduler/schedule.md +++ b/reference/execution/execution/task_scheduler/schedule.md @@ -6,22 +6,24 @@ * cpp26[meta cpp] ```cpp -sender schedule(); +ts-sender schedule(); ``` -* sender[italic] +* ts-sender[italic] ## 概要 保持中[Scheduler](../scheduler.md)の[スケジュールSender](../schedule.md)を返す。 ## 効果 -[`schedue`](../schedule.md)`(SCHED(*this))`で初期化された[Sender](../sender.md)を保持する、説明専用の`sender`型オブジェクトを返す。 +[`schedue`](../schedule.md)`(SCHED(*this))`で初期化された[Sender](../sender.md)を保持する、説明専用の`ts-sender`型オブジェクトを返す。 -### クラス`sender` -説明専用のクラス`task_scheduler::sender`は下記の通り定義される。 + +## 説明専用エンティティ +### クラス`ts-sender` +説明専用のクラス`task_scheduler::ts-sender`は下記の通り定義される。 ```cpp -class task_scheduler::sender { // exposition only +class task_scheduler::ts-sender { // exposition only public: using sender_concept = sender_t; @@ -33,7 +35,7 @@ public: * receiver[link ../receiver.md] * state[italic] -`sender`は[`sender`](../sender.md)のモデルであり、[`completion_signatures_of_t`](../completion_signatures_of_t.md)``は下記となる : +`ts-sender`は[`sender`](../sender.md)のモデルであり、[`completion_signatures_of_t`](../completion_signatures_of_t.md)``は下記となる : ```cpp completion_signatures< @@ -49,16 +51,16 @@ completion_signatures< * error_code[link /reference/system_error/error_code.md] * exception_ptr[link /reference/exception/exception_ptr.md] -説明用の`sch`を`task_sender`型のオブジェクト、`sndr`を[`schedule`](../schedule.md)`(sch)`により得られる`sender`型のオブジェクトとする。[`get_completion_scheduler`](../get_completion_scheduler.md)`<`[`set_value_t`](../set_value.md)`>(`[`get_env`](../get_env.md)`(sndr)) == sch`は`true`となる。オブジェクト`SENDER(sndr)`は、`sndr`または同オブジェクトからムーブ構築された[Sender](../sender.md)オブジェクトとする。 +説明用の`sch`を`task_sender`型のオブジェクト、`sndr`を[`schedule`](../schedule.md)`(sch)`により得られる`ts-sender`型のオブジェクトとする。[`get_completion_scheduler`](../get_completion_scheduler.md)`<`[`set_value_t`](../set_value.md)`>(`[`get_env`](../get_env.md)`(sndr)) == sch`は`true`となる。オブジェクト`SENDER(sndr)`は、`sndr`または同オブジェクトからムーブ構築された[Sender](../sender.md)オブジェクトとする。 ```cpp template -state connect(Rcvr&& rcvr); +state connect(Rcvr&& rcvr) &&; ``` * state[italic] - 効果 : `r`を[`receiver`](../receiver.md)のモデルである型のオブジェクトとし、その完了ハンドラは -`rcvr`またはそのコピーに対応する完了ハンドラを呼び出すものとする。[`connect`](../connect.md)`(SENDER(*this),` [`std::move`](/reference/utility/move.md)`(r))`で初期化された[OperationState](../operation_state.md)オブジェクトを保持する`state`型のオブジェクトを返す。 +`rcvr`またはそのコピーに対応する完了ハンドラを呼び出すものとする。[`connect`](../connect.md)`(SENDER(*this),` [`std::move`](/reference/utility/move.md)`(r))`で初期化された[Operation State](../operation_state.md)オブジェクトを保持する`state`型のオブジェクトを返す。 ### クラステンプレート`state` @@ -73,6 +75,7 @@ public: void start() & noexcept; }; ``` +* receiver[link ../receiver.md] * operation_state_t[link ../operation_state.md] `state`の特殊化は[`operation_state`](../operation_state.md)のモデルである。 @@ -81,7 +84,7 @@ public: void start() & noexcept; ``` -- 効果 : `s`を`*this`に含まれる[OperationState](../operation_state.md)オブジェクトとして、[`start`](../start.md)`(st)`と等価。 +- 効果 : `st`を`*this`に含まれる[Operation State](../operation_state.md)オブジェクトとして、[`start`](../start.md)`(st)`と等価。 ## バージョン @@ -101,3 +104,4 @@ void start() & noexcept; ## 参照 - [P3552R3 Add a Coroutine Task Type](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3552r3.html) +- [4342. Missing rvalue reference qualification for `task_scheduler::ts-sender::connect()`](https://cplusplus.github.io/LWG/issue4342) From e0b5a7343608c791ec423c7c914b05a715cdfc53 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 13 Jan 2026 20:50:45 +0900 Subject: [PATCH 2548/3948] =?UTF-8?q?execution/task:=20=E8=AA=BF=E6=95=B4(?= =?UTF-8?q?#1521)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit LWG 4341, 4343適用 --- reference/execution/execution/task.md | 4 +++- reference/execution/execution/task/connect.md | 1 + reference/execution/execution/task/state.md | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/reference/execution/execution/task.md b/reference/execution/execution/task.md index 43060ee80f..d0a862018e 100644 --- a/reference/execution/execution/task.md +++ b/reference/execution/execution/task.md @@ -6,10 +6,11 @@ ```cpp namespace std::execution { - template + template > class task; } ``` +* env<>[link env.md] ## 概要 `task`クラステンプレートは、[コルーチン](/lang/cpp20/coroutines.md)の戻り値型として使用できる[Sender](sender.md)を表す。 @@ -116,4 +117,5 @@ int main() ## 参照 - [P3552R3 Add a Coroutine Task Type](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3552r3.html) +- [LWG4343. Missing default template arguments for `task`](https://cplusplus.github.io/LWG/issue4343) - C++now 2025, [Getting The Lazy Task Done](https://schedule.cppnow.org/wp-content/uploads/2025/03/Getting_The_Lazy_Task_Done.pdf) diff --git a/reference/execution/execution/task/connect.md b/reference/execution/execution/task/connect.md index b8cb14498c..3b8eabb49a 100644 --- a/reference/execution/execution/task/connect.md +++ b/reference/execution/execution/task/connect.md @@ -47,3 +47,4 @@ return state(exchange(handle, {}), std::forward(recv)); ## 参照 - [P3552R3 Add a Coroutine Task Type](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3552r3.html) +- [LWG4341. Missing rvalue reference qualification for `task::connect()`](https://cplusplus.github.io/LWG/issue4341) diff --git a/reference/execution/execution/task/state.md b/reference/execution/execution/task/state.md index 7c53c985c7..c17485699c 100644 --- a/reference/execution/execution/task/state.md +++ b/reference/execution/execution/task/state.md @@ -17,7 +17,7 @@ namespace std::execution { ~state(); void start() & noexcept; -private: + private: using own-env-t = see below; // exposition only coroutine_handle handle; // exposition only remove_cvref_t rcvr; // exposition only From 20774a15f7926ec873fcb58ecf36dd589eb6583c Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Wed, 14 Jan 2026 13:53:47 +0900 Subject: [PATCH 2549/3948] =?UTF-8?q?=E8=AA=AC=E6=98=8E=E5=B0=82=E7=94=A8?= =?UTF-8?q?=E3=83=A9=E3=82=A4=E3=83=96=E3=83=A9=E3=83=AA=E3=81=AE=E3=83=9A?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E5=90=8D=E3=82=92=E3=83=98=E3=83=83=E3=83=80?= =?UTF-8?q?=E5=90=8D=E3=81=AB=E5=90=88=E3=82=8F=E3=81=9B=E3=81=A6=E7=B5=B1?= =?UTF-8?q?=E4=B8=80=20#1563?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/exposition-only.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/exposition-only.md b/reference/exposition-only.md index c1b75593a1..76cea6b301 100644 --- a/reference/exposition-only.md +++ b/reference/exposition-only.md @@ -1,4 +1,4 @@ -# 説明専用ライブラリ +# exposition-only * exposition-only[meta header] From bf58addc38c29dfea0b13be70d5439bb4c923e33 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 14 Jan 2026 15:25:38 +0900 Subject: [PATCH 2550/3948] =?UTF-8?q?C++26=20:=20=E3=83=A9=E3=82=A4?= =?UTF-8?q?=E3=83=96=E3=83=A9=E3=83=AA=E6=A6=82=E8=A6=81=E3=82=922025-12?= =?UTF-8?q?=20mailing=E3=81=AB=E5=AF=BE=E5=BF=9C=20(#1565)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #1555 --- lang/cpp26.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lang/cpp26.md b/lang/cpp26.md index b4fdc3d909..5d2520ad04 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -141,6 +141,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 ### コンテナ +- [`std::vector::reference`](/reference/vector/vector.md)のプロキシ操作として、`const`修飾付きの代入と`swap()`メンバ関数を追加 - [`std::mdspan`](/reference/mdspan/mdspan.md)から部分ビューを取り出す[`std::submdspan()`](/reference/mdspan/submdspan.md)を追加 - [`std::mdspan`](/reference/mdspan/mdspan.md)に、インデックスを指定して要素を取り出す[`at()`](/reference/mdspan/mdspan/at.md.nolink)メンバ関数を追加 - [`std::mdspan`](/reference/mdspan/mdspan.md)に対する[`std::dextents`](/reference/mdspan/extents.md)指定の冗長さを解決する[`std::dims`](/reference/mdspan/extents.md)を追加 @@ -180,6 +181,20 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [`std::ranges::approximately_sized_range`](/reference/ranges/approximately_sized_range.md.nolink)コンセプトを追加 - インデックス列を生成する[`std::views::indices`](/reference/ranges/indices.md.nolink)を追加 - 連続イテレータのコンセプト[`contiguous_iterator`](/reference/iterator/contiguous_iterator.md)に、ポインタに変換できることを要件として追加 +- [`std::initializer_list`](/reference/initializer_list/initializer_list.md)クラスを以下のように変更 + - 独自に定義されていた[`std::begin()`](/reference/initializer_list/initializer_list/begin_free.md) / [`std::end()`](/reference/initializer_list/initializer_list/end_free.md)のオーバーロードを削除 (`std::cbegin()`や`std::rend()`のようなオーバーロードがなかったため、ほかとの不整合があった) + - メンバ関数[`data()`](/reference/initializer_list/initializer_list/data.md.nolink)を追加 + - メンバ関数[`empty()`](/reference/initializer_list/initializer_list/empty.md.nolink)を追加 +- [`std::valarray`](/reference/valarray/valarray.md)クラスを以下のように変更 + - 独自に定義されていた[`std::begin()`](/reference/valarray/valarray/begin_free.md) / [`std::end()`](/reference/valarray/valarray/end_free.md)のオーバーロードを削除 (`std::cbegin()`や`std::rend()`のようなオーバーロードがなかったため、ほかとの不整合があった) + - メンバ型`iterator` / `const_iterator`を追加 + - メンバ関数[`begin()`](/reference/valarray/valarray/begin.md.nolink) / [`end()`](/reference/valarray/valarray/end.md.nolink)を追加 +- イテレータインタフェースの非メンバ関数[`std::begin()`](/reference/iterator/begin.md) / [`std::end()`](/reference/iterator/end.md) / [`std::cbegin()`](/reference/iterator/cbegin.md) / [`std::cend()`](/reference/iterator/cend.md) / [`std::rbegin()`](/reference/iterator/rbegin.md) / [`std::rend()`](/reference/iterator/rend.md) / [`std::crbegin()`](/reference/iterator/crbegin.md) / [`std::crend()`](/reference/iterator/crend.md) / [`std::size()`](/reference/iterator/size.md) / [`std::ssize()`](/reference/iterator/ssize.md) / [`std::empty()`](/reference/iterator/empty.md) / [`std::data()`](/reference/iterator/data.md)を以下のように変更 + - [`std::initializer_list`](/reference/initializer_list/initializer_list.md)型に対するオーバーロードを削除 (専用のオーバーロードを用意しなくても汎用オーバーロードが使用できるようになった) + - 条件付き`noexcept`指定を追加 +- Rangeインタフェースの非メンバ関数[`std::ranges::begin()`](/reference/ranges/begin.md) / [`std::ranges::end()`](/reference/ranges/end.md) / [`std::ranges::cbegin()`](/reference/ranges/cbegin.md) / [`std::ranges::cend()`](/reference/ranges/cend.md) / [`std::ranges::rbegin()`](/reference/ranges/rbegin.md) / [`std::ranges::rend()`](/reference/ranges/rend.md) / [`std::ranges::crbegin()`](/reference/ranges/crbegin.md) / [`std::ranges::crend()`](/reference/ranges/crend.md) / [`std::ranges::size()`](/reference/ranges/size.md) / [`std::ranges::ssize()`](/reference/ranges/ssize.md) / [`std::ranges::empty()`](/reference/ranges/empty.md) / [`std::ranges::data()`](/reference/ranges/data.md)を以下のように変更 + - [`std::initializer_list`](/reference/initializer_list/initializer_list.md)型に対するオーバーロードを削除 (専用のオーバーロードを用意しなくても汎用オーバーロードが使用できるようになった) + - 条件付き`noexcept`指定を追加 - 以下のコンテナを`constexpr`に対応 - [`std::deque`](/reference/deque/deque.md) - [`std::forward_list`](/reference/forward_list/forward_list.md) @@ -263,6 +278,8 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - ポインタ出力のサポートを追加 - 幅と精度を動的に指定した場合でも型の検証がコンパイル時に行われるよう仕様を見直し - コンパイル時の書式文字列だけでなく、実行時の書式文字列を渡せるよう仕様修正 + - `constexpr`に対応 +- [`std::to_string()`](/reference/string/to_string.md)と[`std::to_wstring()`](/reference/string/to_wstring.md)を`constexpr`に対応 - [`std::basic_string`](/reference/string/basic_string.md)クラスと[`std::basic_string_view`](/reference/string_view/basic_string_view.md)クラスに、部分文字列を[`std::basic_string_view`](/reference/string_view/basic_string_view.md)として取得するメンバ関数`subview()`を追加 - [`std::basic_string`](/reference/string/basic_string.md)と[`std::basic_string_view`](/reference/string_view/basic_string_view.md)を[`std::basic_string`](/reference/string/basic_string.md)として連結させる`operator+`を追加 @@ -506,6 +523,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [``](/reference/type_traits.md)に、共用体の指定されたメンバがアクティブかを定数式で判定するための関数として[`std::is_within_lifetime()`](/reference/type_traits/is_within_lifetime.md)を追加 - [``](/reference/type_traits.md)に、仮想継承の関係を判定する[`std::is_virtual_base_of`](/reference/type_traits/is_virtual_base_of.md)を追加 - [``](/reference/type_traits.md)に、[`std::integral_constant`](/reference/type_traits/integral_constant.md)クラスを置き換える定数ラッパーとして[`std::constant_wrapper`](/reference/type_traits/constant_wrapper.md.nolink)クラスを追加 +- [`std::index_sequence`](/reference/utility/index_sequence.md)クラスを[構造化束縛](/lang/cpp17/structured_bindings.md)と[template for文](/lang/cpp26/expansion_statements.md.nolink)で使用できるようにするため、タプルインタフェースの特殊化を追加 ### 制約 From 10763a37b9ee4ebd784ffa4c87790c7fa4f3ba70 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Wed, 14 Jan 2026 17:30:27 +0900 Subject: [PATCH 2551/3948] =?UTF-8?q?typo=E4=BF=AE=E6=AD=A3=E3=81=A8NG?= =?UTF-8?q?=E3=83=AF=E3=83=BC=E3=83=89=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit invocalbe → invocable schedue → schedule --- .github/workflows/script/ngword_check.py | 2 ++ reference/execution/execution/task/state.md | 2 +- reference/execution/execution/task_scheduler/schedule.md | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/script/ngword_check.py b/.github/workflows/script/ngword_check.py index 777cd6d1b1..db7f480aa1 100644 --- a/.github/workflows/script/ngword_check.py +++ b/.github/workflows/script/ngword_check.py @@ -29,6 +29,7 @@ ("", "functon", "function"), ("", "generetor", "generator"), ("", "greator", "greater"), + ("", "invocalbe", "invocable"), ("", "namespase", "namespace"), ("", "noexpcet", "noexcept"), ("", "oeprator", "operator"), @@ -42,6 +43,7 @@ ("", "reciever", "receiver"), ("", "refernce", "reference"), ("", "repear", "repeat"), + ("", "schedue", "schedule"), ("", "staitc", "static"), ("", "std::range::", "std::ranges::"), ("", "swtich", "switch"), diff --git a/reference/execution/execution/task/state.md b/reference/execution/execution/task/state.md index c17485699c..89baa10784 100644 --- a/reference/execution/execution/task/state.md +++ b/reference/execution/execution/task/state.md @@ -78,7 +78,7 @@ void start() & noexcept; - `prom.token.`[`stop_requested()`](/reference/stop_token/stoppable_token.md) : `st.stop_requested()`を返す。 - `prom.token.`[`stop_possible()`](/reference/stop_token/stoppable_token.md) : `st.stop_possible()`を返す。 - ― 型`Fn`と型`Init`をそれぞれ[`invocalbe`](/reference/concepts/invocable.md)``と[`constructible_from`](/reference/concepts/constructible_from.md)``のモデルとしたとき、[`stop_token::callback_type`](/reference/stop_token/stoppable_token.md)``は[`stoppable-callback-for`](/reference/stop_token/stoppable_token.md)``のモデルである。 + ― 型`Fn`と型`Init`をそれぞれ[`invocable`](/reference/concepts/invocable.md)``と[`constructible_from`](/reference/concepts/constructible_from.md)``のモデルとしたとき、[`stop_token::callback_type`](/reference/stop_token/stoppable_token.md)``は[`stoppable-callback-for`](/reference/stop_token/stoppable_token.md)``のモデルである。 その後、`handle.`[`resume()`](/reference/coroutine/coroutine_handle/resume.md)を呼び出す。 diff --git a/reference/execution/execution/task_scheduler/schedule.md b/reference/execution/execution/task_scheduler/schedule.md index 5647fab8d6..6d64352a51 100644 --- a/reference/execution/execution/task_scheduler/schedule.md +++ b/reference/execution/execution/task_scheduler/schedule.md @@ -15,7 +15,7 @@ ts-sender schedule(); ## 効果 -[`schedue`](../schedule.md)`(SCHED(*this))`で初期化された[Sender](../sender.md)を保持する、説明専用の`ts-sender`型オブジェクトを返す。 +[`schedule`](../schedule.md)`(SCHED(*this))`で初期化された[Sender](../sender.md)を保持する、説明専用の`ts-sender`型オブジェクトを返す。 ## 説明専用エンティティ From 0a2e15445a6681269f937d774648586267388c84 Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 15 Jan 2026 00:45:13 +0900 Subject: [PATCH 2552/3948] execution: P3552R3 task::promise_type(#1521) --- reference/execution/execution/task.md | 10 ++- .../execution/execution/task/promise_type.md | 79 +++++++++++++++++++ .../task/promise_type/await_transform.md | 57 +++++++++++++ .../task/promise_type/final_suspend.md | 41 ++++++++++ .../execution/task/promise_type/get_env.md | 45 +++++++++++ .../task/promise_type/get_return_object.md | 38 +++++++++ .../task/promise_type/initial_suspend.md | 39 +++++++++ .../task/promise_type/op_constructor.md | 43 ++++++++++ .../execution/task/promise_type/op_delete.md | 44 +++++++++++ .../execution/task/promise_type/op_new.md | 53 +++++++++++++ .../task/promise_type/return_value.md | 36 +++++++++ .../task/promise_type/return_void.md | 35 ++++++++ .../task/promise_type/unhandled_exception.md | 34 ++++++++ .../task/promise_type/unhandled_stopped.md | 42 ++++++++++ .../task/promise_type/yield_value.md | 43 ++++++++++ reference/execution/execution/task/state.md | 9 ++- 16 files changed, 642 insertions(+), 6 deletions(-) create mode 100644 reference/execution/execution/task/promise_type.md create mode 100644 reference/execution/execution/task/promise_type/await_transform.md create mode 100644 reference/execution/execution/task/promise_type/final_suspend.md create mode 100644 reference/execution/execution/task/promise_type/get_env.md create mode 100644 reference/execution/execution/task/promise_type/get_return_object.md create mode 100644 reference/execution/execution/task/promise_type/initial_suspend.md create mode 100644 reference/execution/execution/task/promise_type/op_constructor.md create mode 100644 reference/execution/execution/task/promise_type/op_delete.md create mode 100644 reference/execution/execution/task/promise_type/op_new.md create mode 100644 reference/execution/execution/task/promise_type/return_value.md create mode 100644 reference/execution/execution/task/promise_type/return_void.md create mode 100644 reference/execution/execution/task/promise_type/unhandled_exception.md create mode 100644 reference/execution/execution/task/promise_type/unhandled_stopped.md create mode 100644 reference/execution/execution/task/promise_type/yield_value.md diff --git a/reference/execution/execution/task.md b/reference/execution/execution/task.md index d0a862018e..29ccf96d64 100644 --- a/reference/execution/execution/task.md +++ b/reference/execution/execution/task.md @@ -20,7 +20,11 @@ namespace std::execution { ## クラス仕様 -`T`が`void`、参照型、cv修飾された非配列オブジェクト型であり、かつ`E`がクラス型であるとき、`task`は[`sender`](sender.md)のモデルである。そうでなければ、`task`の定義をインスタンス化するプログラムは不適格となる。 +`task`クラステンプレートは、下記の説明専用メンバ変数を持つ。 + +- `handle` : [`coroutine_handle`](/reference/coroutine/coroutine_handle.md)`<`[`promise_type`](task/promise_type.md)`>` + +`T`が`void`、参照型、cv修飾された非配列オブジェクト型のいずれかであり、かつ`E`がクラス型であるとき、`task`は[`sender`](sender.md)のモデルである。そうでなければ、`task`の定義をインスタンス化するプログラムは不適格となる。 `task`テンプレート特殊化のネストした型は、`Environment`パラメータに基づいて決定される : @@ -60,7 +64,7 @@ namespace std::execution { | `stop_token_type` | コルーチンの停止トークン型 | C++26 | | `error_types` | コルーチンの[エラー完了](set_error.md)の結果型 | C++26 | | [`state`](task/state.md) | タスクコルーチン動作の説明専用クラステンプレート | C++26 | -| [`promise_type`](task/promise_type.md.nolink) | タスクコルーチンの[Promise型](/lang/cpp20/coroutines.md) | C++26 | +| [`promise_type`](task/promise_type.md) | タスクコルーチンの[Promise型](/lang/cpp20/coroutines.md) | C++26 | ## 例 @@ -112,6 +116,8 @@ int main() ## 関連項目 +- [`execution::with_error`](with_error.md.nolink) +- [`execution::change_coroutine_scheduler`](change_coroutine_scheduler.md.nolink) - [`execution::task_scheduler`](task_scheduler.md) diff --git a/reference/execution/execution/task/promise_type.md b/reference/execution/execution/task/promise_type.md new file mode 100644 index 0000000000..e319cda622 --- /dev/null +++ b/reference/execution/execution/task/promise_type.md @@ -0,0 +1,79 @@ +# task::promise_type +* execution[meta header] +* class[meta id-type] +* std::execution[meta namespace] +* task[meta class] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template + class task::promise_type; +} +``` +* task[link ../task.md] + +## 概要 +タスクコルーチン動作を制御する[Promise型](/lang/cpp20/coroutines.md)。 +プログラマが本クラスを直接利用することは想定されていない。 + + +## クラス仕様 +説明用の`prom`を`promise_type`型のオブジェクト、`tsk`を`prom.`[`get_return_object()`](promise_type/get_return_object.md)で作成される[`task`](../task.md)型のオブジェクトとする。説明では[Receiver](../receiver.md)`Rcvr`に対して、`task::`[`state::start`](state.md)の評価中に`tsk`と関連付けられる`STATE(prom)`, `RCVR(prom)`, `SCHED(prom)`を用いる。 + +`task::promise_type`クラスの動作説明のため、以下の説明専用メンバを用いる。 + +- `alloc` : [`allocator_type`](../task.md)型のアロケータオブジェクト +- `source` : [`stop_source_type`](../task.md)型の停止ソースオブジェクト +- `token` : [`stop_token_type`](../task.md)型の停止トークンオブジェクト +- `result` : [`optional`](/reference/optional/optional.md)``型の結果値(`is_void_v == false`の時のみ存在する) +- `errors` : 下記`error-variant`型のエラー値 + +説明専用の`error-variant`型は、`E...`を[`error_types`](../task.md)で表現される[`execution::completion_signatures`](../completion_signatures.md)特殊化のテンプレート引数型としたとき、[`variant`](/reference/variant/variant.md)`<`[`monostate`](/reference/variant/monostate.md)`,` [`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`...>`において重複削除した型となる。 + + +## メンバ関数 +### 構築・破棄 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`(constructor)`](promise_type/op_constructor.md) | コンストラクタ | C++26 | +| `(destructor)` | デストラクタ | C++26 | + +### コルーチン制御 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`get_return_object`](promise_type/get_return_object.md) | [`task`](../task.md)戻り値の取得 | C++26 | +| [`initial_suspend`](promise_type/initial_suspend.md) | 初期サスペンドポイント動作の制御 | C++26 | +| [`final_suspend`](promise_type/final_suspend.md) | 最終サスペンドポイント動作の制御 | C++26 | +| [`unhandled_exception`](promise_type/unhandled_exception.md) | 未処理例外の制御 | C++26 | +| [`return_void`](promise_type/return_void.md) | co_return文動作の制御 | C++26 | +| [`return_value`](promise_type/return_value.md) | co_return文動作の制御 | C++26 | +| [`yield_value`](promise_type/yield_value.md) | co_yield式動作の制御 | C++26 | +| [`await_transform`](promise_type/await_transform.md) | co_await式動作の制御 | C++26 | +| [`operator new`](promise_type/op_new.md) | new演算子オーバーロード | C++26 | +| [`operator delete`](promise_type/op_delete.md) | delete演算子オーバーロード | C++26 | + +### 実行制御ライブラリ + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`unhandled_stopped`](promise_type/unhandled_stopped.md) | 停止完了の制御 | C++26 | +| [`get_env`](promise_type/get_env.md) | 環境取得 | C++26 | + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): +- [GCC](/implementation.md#gcc): +- [ICC](/implementation.md#icc): +- [Visual C++](/implementation.md#visual_cpp): + + +## 参照 +- [P3552R3 Add a Coroutine Task Type](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3552r3.html) +- [LWG4415. `task::promise_type::uncaught_exception` seems to be misnamed](https://cplusplus.github.io/LWG/issue4415) diff --git a/reference/execution/execution/task/promise_type/await_transform.md b/reference/execution/execution/task/promise_type/await_transform.md new file mode 100644 index 0000000000..477cd854c4 --- /dev/null +++ b/reference/execution/execution/task/promise_type/await_transform.md @@ -0,0 +1,57 @@ +# await_transform +* execution[meta header] +* std::execution[meta namespace] +* task::promise_type[meta class] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +auto await_transform(Sender&& sndr); // (1) + +template +auto await_transform(change_coroutine_scheduler sch); // (2) +``` +* sender[link ../../sender.md] +* change_coroutine_scheduler[link ../../change_coroutine_scheduler.md.nolink] + +# 概要 +タスクコルーチンにおける[co_await式](/lang/cpp20/coroutines.md)の動作を制御する。 +プログラマが本関数を直接利用することは想定されていない。 + + +## 効果 +- (1) : + - [`same_as`](/reference/concepts/same_as.md)`<`[`inline_scheduler`](../../inline_scheduler.md)`, `[`scheduler_type`](../../task.md)`> == true`ならば、[`as_awaitable`](../../as_awaitable.md)`(std::forward(sndr), *this)`を返す。 + - そうでなければ、[`as_awaitable`](../../as_awaitable.md)`(`[`affine_on`](../../affine_on.md.nolink)`(std::forward(sndr), SCHED(*this)), *this)`を返す。 +- (2) : 以下と等価 + + ```cpp + return await_transform(just(exchange(SCHED(*this), scheduler_type(sch.scheduler))), *this); + ``` + * just[link ../../just.md] + * scheduler_type[link ../../task.md] + * scheduler[link ../../change_coroutine_scheduler.md.nolink] + * exchange[link /reference/utility/exchange.md] + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::as_awaitable`](../../as_awaitable.md) +- [`execution::affine_on`](../../affine_on.md.nolink) +- [`execution::inline_scheduler`](../../inline_scheduler.md) +- [`execution::change_coroutine_scheduler`](../../change_coroutine_scheduler.md.nolink) + + +## 参照 +- [P3552R3 Add a Coroutine Task Type](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3552r3.html) diff --git a/reference/execution/execution/task/promise_type/final_suspend.md b/reference/execution/execution/task/promise_type/final_suspend.md new file mode 100644 index 0000000000..83bc2a6c0d --- /dev/null +++ b/reference/execution/execution/task/promise_type/final_suspend.md @@ -0,0 +1,41 @@ +# final_suspend +* execution[meta header] +* std::execution[meta namespace] +* task::promise_type[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +auto final_suspend() noexcept; +``` + +## 概要 +タスクコルーチンの[最終サスペンドポイント](/lang/cpp20/coroutines.md)を制御するAwaitableオブジェクトを返す。 +プログラマが本関数を直接利用することは想定されていない。 + + +## 戻り値 +`STATE(*this)`に関連付けられた非同期操作を下記呼び出しによって完了するメンバ関数を持つ、未規定のAwaitableオブジェクトを返す。 + +- `errors.`[`index()`](/reference/variant/variant/index.md)が`0`より大きいとき、`e`を`errors`が保持する値として[`set_error`](../../set_error.md)`(std::move(RCVR(*this)), std::move(e))`。そうでなければ、 +- [`is_void`](/reference/type_traits/is_void.md)``が`true`のとき、[`set_value`](../../set_value.md)`(std::move(RCVR(*this)))`。そうでなければ、 +- [`set_value`](../../set_value.md)`(std::move(RCVR(*this)), *result)` + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3552R3 Add a Coroutine Task Type](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3552r3.html) diff --git a/reference/execution/execution/task/promise_type/get_env.md b/reference/execution/execution/task/promise_type/get_env.md new file mode 100644 index 0000000000..fd30e21829 --- /dev/null +++ b/reference/execution/execution/task/promise_type/get_env.md @@ -0,0 +1,45 @@ +# get_env +* execution[meta header] +* std::execution[meta namespace] +* task::promise_type[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +unspecified get_env() const noexcept; +``` + +## 概要 +タスクコルーチンの[環境](../../../queryable.md)を取得する。 + + +## 戻り値 +問い合わせが以下のようい転送されるオブジェクト`env`を返す。 + +- `env.query(`[`get_scheduler`](../../get_scheduler.md)`)`は[`scheduler_type`](../../task.md)`(SCHED(*this))`を返す。 +- `env.query(`[`get_allocator`](../../../get_allocator.md)`)`は`alloc`を返す。 +- `env.query(`[`get_stop_token`](../../../get_stop_token.md)`)`は`token`を返す。 +- 上記以外の問い合わせ`q`と引数`a...`に対して、式が妥当かつ[`forwarding_query`](../../../forwarding_query.md)`(q)`が妥当で`true`となるとき、呼び出し`env.query(q, a...)`は`STATE(*this)`を返す。そうでなければ、`env.query(q, a...)`は不適格となる。 + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::get_env`](../../get_env.md) + + +## 参照 +- [P3552R3 Add a Coroutine Task Type](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3552r3.html) diff --git a/reference/execution/execution/task/promise_type/get_return_object.md b/reference/execution/execution/task/promise_type/get_return_object.md new file mode 100644 index 0000000000..8f551a96d8 --- /dev/null +++ b/reference/execution/execution/task/promise_type/get_return_object.md @@ -0,0 +1,38 @@ +# get_return_object +* execution[meta header] +* std::execution[meta namespace] +* task::promise_type[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +task get_return_object() noexcept; +``` +* task[link ../../task.md] + +## 概要 +タスク[コルーチン](/lang/cpp20/coroutines.md)の戻り値[`task`](../../task.md)オブジェクトを生成する。 +プログラマが本関数を直接利用することは想定されていない。 + + +## 戻り値 +説明専用の`handle`メンバ変数が[`coroutine_handle`](/reference/coroutine/coroutine_handle.md)`<`[`promise_type`](../promise_type.md)`>::`[`from_promise`](/reference/coroutine/coroutine_handle/from_promise.md)`(*this)`である[`task`](../../task.md)オブジェクト。 + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3552R3 Add a Coroutine Task Type](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3552r3.html) diff --git a/reference/execution/execution/task/promise_type/initial_suspend.md b/reference/execution/execution/task/promise_type/initial_suspend.md new file mode 100644 index 0000000000..336eaefa83 --- /dev/null +++ b/reference/execution/execution/task/promise_type/initial_suspend.md @@ -0,0 +1,39 @@ +# initial_suspend +* execution[meta header] +* std::execution[meta namespace] +* task::promise_type[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +static constexpr suspend_always initial_suspend() noexcept; +``` +* suspend_always[link /reference/coroutine/suspend_always.md] + +## 概要 +タスクコルーチンの[初期サスペンドポイント](/lang/cpp20/coroutines.md)を制御するAwaitableオブジェクトを返す。 +プログラマが本関数を直接利用することは想定されていない。 + + +## 戻り値 +[`suspend_always{}`](/reference/coroutine/suspend_always.md) + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3552R3 Add a Coroutine Task Type](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3552r3.html) +- [LWG4349. `task` is not actually started lazily](https://cplusplus.github.io/LWG/issue4349) diff --git a/reference/execution/execution/task/promise_type/op_constructor.md b/reference/execution/execution/task/promise_type/op_constructor.md new file mode 100644 index 0000000000..e9b8e613d5 --- /dev/null +++ b/reference/execution/execution/task/promise_type/op_constructor.md @@ -0,0 +1,43 @@ +# コンストラクタ +* execution[meta header] +* std::execution[meta namespace] +* task::promise_type[meta class] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +promise_type(const Args&... args); +``` + +# 概要 +タスクコルーチンの[Promise型](/lang/cpp20/coroutines.md)コンストラクタ。 +プログラマが本コンストラクタを直接利用することは想定されていない。 + + +## 適格要件 +(もしあれば)最初の[`allocator_arg_t`](/reference/memory/allocator_arg_t.md)型パラメータが最後のパラメータでないこと。 + + +## 効果 +`Args`が[`allocator_arg_t`](/reference/memory/allocator_arg_t.md)型の要素を含むとき、`alloc`を`args`の次の要素で初期化する。 +そうでなければ、`alloc`を[`allocator_type`](../../task.md)`()`で初期化する。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`operator new`](op_new.md) + + +## 参照 +- [P3552R3 Add a Coroutine Task Type](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3552r3.html) diff --git a/reference/execution/execution/task/promise_type/op_delete.md b/reference/execution/execution/task/promise_type/op_delete.md new file mode 100644 index 0000000000..0a4e327507 --- /dev/null +++ b/reference/execution/execution/task/promise_type/op_delete.md @@ -0,0 +1,44 @@ +# operator delete +* execution[meta header] +* std::execution[meta namespace] +* task::promise_type[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +void operator delete(void* pointer, size_t size) noexcept; +``` + +## 概要 +[`task::promise_type`](../promise_type.md)クラスのdelete演算子オーバーロード。 + + +## 事前条件 +`pointer`は同じ`size`の[`operator new`](op_new.md)演算子オーバーロードの呼び出しで返された値であること。 + + +## 効果 +メモリ確保で用いたものと同じアロケータを利用して、`pointer`が指すストレージを解放する。 + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`operator new`](op_new.md) + + +## 参照 +- [P3552R3 Add a Coroutine Task Type](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3552r3.html) diff --git a/reference/execution/execution/task/promise_type/op_new.md b/reference/execution/execution/task/promise_type/op_new.md new file mode 100644 index 0000000000..2f7c07665e --- /dev/null +++ b/reference/execution/execution/task/promise_type/op_new.md @@ -0,0 +1,53 @@ +# operator new +* execution[meta header] +* std::execution[meta namespace] +* task::promise_type[meta class] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +void* operator new(size_t size, const Args&... args); +``` + +## 概要 +[`task::promise_type`](../promise_type.md)クラスのnew演算子オーバーロード。 + +[`allocator_arg_t`](/reference/memory/allocator_arg_t.md)型のパラメータがなければ、`alloc`を[`allocator_type`](../../task.md)`()`で初期化する。そうでなければ、`arg_next`を最初の`allocator_arg_t`パラメータに続くパラメータとし、`alloc`を`allocator_type(arg_next)`とする。 + +`U`型をサイズおよびアライメントが[`__STDCPP_DEFAULT_NEW_ALIGNMENT__`](/lang/cpp17/predefined_macros.md)である未規定の型としたとき、説明用の`PAlloc`を[`allocator_traits`](/reference/memory/allocator_traits.md)`::template rebind_alloc`とする。 + + +## 適格要件 +- (もしあれば)最初の[`allocator_arg_t`](/reference/memory/allocator_arg_t.md)型パラメータが最後のパラメータではない。 +- [`allocator_arg_t`](/reference/memory/allocator_arg_t.md)型のパラメータが存在するとき、[`allocator_type`](../../task.md)`(arg_next)`が妥当な式である。 +- [`allocator_traits`](/reference/memory/allocator_traits.md)`::pointer`がポインタ型である。 + + +## 効果 +`PAlloc`型のアロケータ`palloc`を`alloc`で初期化する。 +サイズ`size`のコルーチンステートに十分なストレージとなる`U`の最小配列ストレージ、および[`operator delete`](op_delete.md)が後で`palloc`と等しいアロケータでこのメモリブロックを解放するのに必要となる未規定の追加ストレージの確保に`palloc`を用いる。 + + +## 戻り値 +確保したストレージへのポインタ + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`(constructor)`](op_constructor.md) +- [`operator delete`](op_delete.md) + + +## 参照 +- [P3552R3 Add a Coroutine Task Type](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3552r3.html) diff --git a/reference/execution/execution/task/promise_type/return_value.md b/reference/execution/execution/task/promise_type/return_value.md new file mode 100644 index 0000000000..1364540b6a --- /dev/null +++ b/reference/execution/execution/task/promise_type/return_value.md @@ -0,0 +1,36 @@ +# return_value +* execution[meta header] +* std::execution[meta namespace] +* task::promise_type[meta class] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +// is_void_v == false 時のみ存在 +template +void return_value(V&& v); +``` + +## 概要 +タスクコルーチンにおける[co_return文](/lang/cpp20/coroutines.md)の動作を制御する。 +プログラマが本関数を直接利用することは想定されていない。 + + +## 効果 +`result.`[`emplace`](/reference/optional/optional/emplace.md)`(`[`std::forward`](/reference/utility/forward.md)`(v))`と等価。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3552R3 Add a Coroutine Task Type](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3552r3.html) +- [LWG4346. `task::promise_type::return_void/value` lack a specification](https://cplusplus.github.io/LWG/issue4346) diff --git a/reference/execution/execution/task/promise_type/return_void.md b/reference/execution/execution/task/promise_type/return_void.md new file mode 100644 index 0000000000..cf4b9f4d68 --- /dev/null +++ b/reference/execution/execution/task/promise_type/return_void.md @@ -0,0 +1,35 @@ +# return_void +* execution[meta header] +* std::execution[meta namespace] +* task::promise_type[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +// is_void_v == true 時のみ存在 +void return_void(); +``` + +## 概要 +タスクコルーチンにおける[co_return文](/lang/cpp20/coroutines.md)の動作を制御する。 +プログラマが本関数を直接利用することは想定されていない。 + + +## 効果 +何もしない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3552R3 Add a Coroutine Task Type](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3552r3.html) +- [LWG4346. `task::promise_type::return_void/value` lack a specification](https://cplusplus.github.io/LWG/issue4346) diff --git a/reference/execution/execution/task/promise_type/unhandled_exception.md b/reference/execution/execution/task/promise_type/unhandled_exception.md new file mode 100644 index 0000000000..98da72666f --- /dev/null +++ b/reference/execution/execution/task/promise_type/unhandled_exception.md @@ -0,0 +1,34 @@ +# unhandled_exception +* execution[meta header] +* std::execution[meta namespace] +* task::promise_type[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +void unhandled_exception(); +``` + +## 概要 +タスクコルーチンから送出された例外を処理する。 +プログラマが本関数を直接利用することは想定されていない。 + + +## 効果 +完了シグネチャ[`set_error_t`](../../set_error.md)`(`[`exception_ptr`](/reference/exception/exception_ptr.md)`)`が[`error_types`](../../task.md)の要素でないとき、[`terminate()`](/reference/exception/terminate.md)を呼び出す。そうでなければ、`errors`に[`current_exception()`](/reference/exception/current_exception.md)を格納する。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3552R3 Add a Coroutine Task Type](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3552r3.html) +- [LWG4415. `task::promise_type::uncaught_exception` seems to be misnamed](https://cplusplus.github.io/LWG/issue4415) diff --git a/reference/execution/execution/task/promise_type/unhandled_stopped.md b/reference/execution/execution/task/promise_type/unhandled_stopped.md new file mode 100644 index 0000000000..5c9e7bd4b0 --- /dev/null +++ b/reference/execution/execution/task/promise_type/unhandled_stopped.md @@ -0,0 +1,42 @@ +# unhandled_stopped +* execution[meta header] +* std::execution[meta namespace] +* task::promise_type[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +coroutine_handle<> unhandled_stopped() noexcept; +``` +* coroutine_handle<>[link /reference/coroutine/coroutine_handle.md] + +## 概要 +タスクコルーチンの[停止完了](../../set_stopped.md)動作を制御する。 + + +## 効果 +[`set_stopped`](../../set_stopped.md)`(`[`std::move`](/reference/utility/move.md)`(RCVR(*this)))`を呼び出すことで、`STATE(*this)`に関連付けられた非同期操作を完了する。 + + +## 戻り値 +[`noop_coroutine()`](/reference/coroutine/noop_coroutine.md) + + +## 例外 +投げない + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3552R3 Add a Coroutine Task Type](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3552r3.html) +- [LWG4340. `task::promise_type::unhandled_stopped()` should be `noexcept`](https://cplusplus.github.io/LWG/issue4340) diff --git a/reference/execution/execution/task/promise_type/yield_value.md b/reference/execution/execution/task/promise_type/yield_value.md new file mode 100644 index 0000000000..1020495058 --- /dev/null +++ b/reference/execution/execution/task/promise_type/yield_value.md @@ -0,0 +1,43 @@ +# yield_value +* execution[meta header] +* std::execution[meta namespace] +* task::promise_type[meta class] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +auto yield_value(with_error err); +``` +* with_error[link ../../with_error.md.nolink] + +# 概要 +タスクコルーチンにおける[co_yield式](/lang/cpp20/coroutines.md)の動作を制御する。 +プログラマが本関数を直接利用することは想定されていない。 + + +## 適格要件 +[`std::move`](/reference/utility/move.md)`(err.error)`が、[`error_types`](../../task.md)の[`set_error_t`](../../set_error.md)引数型のうち正確に1つに変換可能であること。そのような型を`Cerr`とする。 + + +## 戻り値 +呼び出し元コルーチンをサスペンドし、[`set_error`](../../set_error.md)`(`[`std::move`](/reference/utility/move.md)`(RCVR(*this)), Cerr(`[`std::move`](/reference/utility/move.md)`(err.error)))`を呼び出すことで`STATE(*this)`に関連付けられた非同期操作を完了させるメンバ関数をもつ、未規定な型のAwaitableオブジェクトを返す。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::with_error`](../../with_error.md.nolink) + + +## 参照 +- [P3552R3 Add a Coroutine Task Type](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3552r3.html) diff --git a/reference/execution/execution/task/state.md b/reference/execution/execution/task/state.md index 89baa10784..f0d9ad975d 100644 --- a/reference/execution/execution/task/state.md +++ b/reference/execution/execution/task/state.md @@ -2,6 +2,7 @@ * execution[meta header] * class template[meta id-type] * std::execution[meta namespace] +* task[meta class] * cpp26[meta cpp] ```cpp @@ -30,7 +31,7 @@ namespace std::execution { * task[link ../task.md] * operation_state_t[link ../operation_state.md] * coroutine_handle[link /reference/coroutine/coroutine_handle.md] -* promise_type[link promise_type.md.nolink] +* promise_type[link promise_type.md] * own-env-t[italic] ## 概要 @@ -45,10 +46,10 @@ template state(coroutine_handle h, Rcvr&& rr); ``` * coroutine_handle[link /reference/coroutine/coroutine_handle.md] -* promise_type[link promise_type.md.nolink] +* promise_type[link promise_type.md] - 効果 : - - `handle`を[`std::move`](/reference/utility/move.md)`(h);`で初期化する。 + - `handle`を[`std::move`](/reference/utility/move.md)`(h)`で初期化する。 - `rcvr`を[`std::forward`](/reference/utility/forward.md)`(rr)`で初期化する。 - `own-env`を、式が有効ならば`own-env-t(`[`get_env`](../get_env.md)`(rcvr))`で、そうでなければ`own-env-t()`で初期化する。いずれの式も適格でなければ、プログラムは不適格となる。 - `environment`を、式が有効ならば`Environment(own-env)`で、そうではなく式が有効ならば`Environment(`[`get_env`](../get_env.md)`(rcvr))`で、そうでなければ`Environment()`で初期化する。いずれの式も適格でなければ、プログラムは不適格となる。 @@ -89,7 +90,7 @@ void start() & noexcept; ## 関連項目 -- [`execution::task::promise_type`](promise_type.md.nolink) +- [`execution::task::promise_type`](promise_type.md) ## 参照 From f4f82e5121dc4aecb00b505aed087ea2f68ba13f Mon Sep 17 00:00:00 2001 From: yoh Date: Thu, 15 Jan 2026 11:30:00 +0900 Subject: [PATCH 2553/3948] execution/task/promise_type: fix markup --- reference/execution/execution/task/promise_type.md | 2 +- .../execution/execution/task/promise_type/await_transform.md | 2 +- reference/execution/execution/task/promise_type/get_env.md | 2 +- .../execution/execution/task/promise_type/op_constructor.md | 2 +- reference/execution/execution/task/promise_type/yield_value.md | 2 +- reference/execution/execution/task/state.md | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/reference/execution/execution/task/promise_type.md b/reference/execution/execution/task/promise_type.md index e319cda622..543c2f5e3d 100644 --- a/reference/execution/execution/task/promise_type.md +++ b/reference/execution/execution/task/promise_type.md @@ -1,4 +1,4 @@ -# task::promise_type +# promise_type * execution[meta header] * class[meta id-type] * std::execution[meta namespace] diff --git a/reference/execution/execution/task/promise_type/await_transform.md b/reference/execution/execution/task/promise_type/await_transform.md index 477cd854c4..8b94fbf432 100644 --- a/reference/execution/execution/task/promise_type/await_transform.md +++ b/reference/execution/execution/task/promise_type/await_transform.md @@ -15,7 +15,7 @@ auto await_transform(change_coroutine_scheduler sch); // (2) * sender[link ../../sender.md] * change_coroutine_scheduler[link ../../change_coroutine_scheduler.md.nolink] -# 概要 +## 概要 タスクコルーチンにおける[co_await式](/lang/cpp20/coroutines.md)の動作を制御する。 プログラマが本関数を直接利用することは想定されていない。 diff --git a/reference/execution/execution/task/promise_type/get_env.md b/reference/execution/execution/task/promise_type/get_env.md index fd30e21829..cd174828b0 100644 --- a/reference/execution/execution/task/promise_type/get_env.md +++ b/reference/execution/execution/task/promise_type/get_env.md @@ -14,7 +14,7 @@ unspecified get_env() const noexcept; ## 戻り値 -問い合わせが以下のようい転送されるオブジェクト`env`を返す。 +問い合わせが以下のように転送されるオブジェクト`env`を返す。 - `env.query(`[`get_scheduler`](../../get_scheduler.md)`)`は[`scheduler_type`](../../task.md)`(SCHED(*this))`を返す。 - `env.query(`[`get_allocator`](../../../get_allocator.md)`)`は`alloc`を返す。 diff --git a/reference/execution/execution/task/promise_type/op_constructor.md b/reference/execution/execution/task/promise_type/op_constructor.md index e9b8e613d5..5ae4acded5 100644 --- a/reference/execution/execution/task/promise_type/op_constructor.md +++ b/reference/execution/execution/task/promise_type/op_constructor.md @@ -10,7 +10,7 @@ template promise_type(const Args&... args); ``` -# 概要 +## 概要 タスクコルーチンの[Promise型](/lang/cpp20/coroutines.md)コンストラクタ。 プログラマが本コンストラクタを直接利用することは想定されていない。 diff --git a/reference/execution/execution/task/promise_type/yield_value.md b/reference/execution/execution/task/promise_type/yield_value.md index 1020495058..edc24f5aa2 100644 --- a/reference/execution/execution/task/promise_type/yield_value.md +++ b/reference/execution/execution/task/promise_type/yield_value.md @@ -11,7 +11,7 @@ auto yield_value(with_error err); ``` * with_error[link ../../with_error.md.nolink] -# 概要 +## 概要 タスクコルーチンにおける[co_yield式](/lang/cpp20/coroutines.md)の動作を制御する。 プログラマが本関数を直接利用することは想定されていない。 diff --git a/reference/execution/execution/task/state.md b/reference/execution/execution/task/state.md index f0d9ad975d..6d4e38520b 100644 --- a/reference/execution/execution/task/state.md +++ b/reference/execution/execution/task/state.md @@ -1,4 +1,4 @@ -# task::state +# state * execution[meta header] * class template[meta id-type] * std::execution[meta namespace] From 086802a0fe15b519173ff1093db58c3b9b1174bb Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 16 Jan 2026 08:10:36 +0900 Subject: [PATCH 2554/3948] =?UTF-8?q?execution/task/promise=5Ftype:=20LWG4?= =?UTF-8?q?345=E9=81=A9=E7=94=A8(#1521)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../execution/execution/task/promise_type/return_value.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reference/execution/execution/task/promise_type/return_value.md b/reference/execution/execution/task/promise_type/return_value.md index 1364540b6a..a3b84244b0 100644 --- a/reference/execution/execution/task/promise_type/return_value.md +++ b/reference/execution/execution/task/promise_type/return_value.md @@ -7,7 +7,7 @@ ```cpp // is_void_v == false 時のみ存在 -template +template void return_value(V&& v); ``` @@ -33,4 +33,5 @@ void return_value(V&& v); ## 参照 - [P3552R3 Add a Coroutine Task Type](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3552r3.html) +- [LWG4345. `task::promise_type::return_value` default template parameter](https://cplusplus.github.io/LWG/issue4345) - [LWG4346. `task::promise_type::return_void/value` lack a specification](https://cplusplus.github.io/LWG/issue4346) From 7c22ac040d57ed74da85b181b292ddfd35bfc2bc Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 16 Jan 2026 09:10:38 +0900 Subject: [PATCH 2555/3948] execution: P3552R3 with_error(#1521) --- reference/execution/execution.md | 4 +- reference/execution/execution/task.md | 2 +- .../task/promise_type/yield_value.md | 4 +- reference/execution/execution/with_error.md | 88 +++++++++++++++++++ 4 files changed, 93 insertions(+), 5 deletions(-) create mode 100644 reference/execution/execution/with_error.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 7a51bf4512..364372be20 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -163,8 +163,8 @@ Senderコンシューマは名前空間 `std::this_thread` および名前空間 | [`execution::affine_on`](execution/affine_on.md.nolink) | (customization point object) | C++26 | | [`execution::inline_scheduler`](execution/inline_scheduler.md) | インラインScheduler (class) | C++26 | | [`execution::task_scheduler`](execution/task_scheduler.md) | 任意Scheduler型を保持するScheduler (class) | C++26 | -| [`execution::with_error`](execution/with_error.md.nolink) | コルーチンからのエラー完了 (class template) | C++26 | -| [`execution::change_coroutine_scheduler`](execution/change_coroutine_scheduler.md.nolink) | コルーチンのScheduler変更 (class template) | C++26 | +| [`execution::with_error`](execution/with_error.md) | タスクコルーチンからのエラー完了 (class template) | C++26 | +| [`execution::change_coroutine_scheduler`](execution/change_coroutine_scheduler.md.nolink) | タスクコルーチンのScheduler変更 (class template) | C++26 | | [`execution::task`](execution/task.md) | タスクコルーチン戻り値型 (class template) | C++26 | ### 実行スコープユーティリティ diff --git a/reference/execution/execution/task.md b/reference/execution/execution/task.md index 29ccf96d64..7c71b68915 100644 --- a/reference/execution/execution/task.md +++ b/reference/execution/execution/task.md @@ -116,7 +116,7 @@ int main() ## 関連項目 -- [`execution::with_error`](with_error.md.nolink) +- [`execution::with_error`](with_error.md) - [`execution::change_coroutine_scheduler`](change_coroutine_scheduler.md.nolink) - [`execution::task_scheduler`](task_scheduler.md) diff --git a/reference/execution/execution/task/promise_type/yield_value.md b/reference/execution/execution/task/promise_type/yield_value.md index edc24f5aa2..fa830ce9e3 100644 --- a/reference/execution/execution/task/promise_type/yield_value.md +++ b/reference/execution/execution/task/promise_type/yield_value.md @@ -9,7 +9,7 @@ template auto yield_value(with_error err); ``` -* with_error[link ../../with_error.md.nolink] +* with_error[link ../../with_error.md] ## 概要 タスクコルーチンにおける[co_yield式](/lang/cpp20/coroutines.md)の動作を制御する。 @@ -36,7 +36,7 @@ auto yield_value(with_error err); ## 関連項目 -- [`execution::with_error`](../../with_error.md.nolink) +- [`execution::with_error`](../../with_error.md) ## 参照 diff --git a/reference/execution/execution/with_error.md b/reference/execution/execution/with_error.md new file mode 100644 index 0000000000..155ecec11d --- /dev/null +++ b/reference/execution/execution/with_error.md @@ -0,0 +1,88 @@ +# with_error +* execution[meta header] +* class template[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template + struct with_error { + using type = remove_cvref_t; + type error; + }; + + template + with_error(E) -> with_error; +} +``` + +## 概要 +タスク[`execution::task`](task.md)を戻り値型とする[コルーチン](/lang/cpp20/coroutines.md)において、`co_yield`式で[エラー完了](set_error.md)すること表現するタグ型。 + +```cpp +co_yield with_error{err} +``` + +型`Err`のエラー完了シグネチャ[`set_error_t`](set_error.md)`(Err)`を持つタスクコルーチンにおいて、非同期操作を`Err`型のエラー値`err`によってエラー完了させる。この`co_yield`式が再開(resume)することは決していない。 + + +## 例 +```cpp example +#include +#include +namespace ex = std::execution; + +enum class MyErrCode { InvalidParam, OutOfMemory }; + +struct Context { + using error_types = ex::completion_signatures; +}; + +ex::task work(int arg) noexcept +{ + if (arg < 0) { + co_yield ex::with_error{MyErrCode::InvalidParam}; + } + co_return arg; +} + +int main() +{ + std::this_thread::sync_wait( + work(-1) + | ex::upon_error([](MyErrCode ec) { + std::println("error"); + }) + ); +} +``` +* ex::with_error[color ff0000] +* ex::completion_signatures[link completion_signatures.md] +* ex::set_error_t[link set_error.md] +* ex::task[link task.md] +* ex::upon_error[link upon_error.md] + +### 出力 +``` +error +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::task`](task.md) + + +## 参照 +- [P3552R3 Add a Coroutine Task Type](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3552r3.html) From 3a507f9df2b8e0be9d9f507a66ea85e7b395326d Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 16 Jan 2026 11:18:46 +0900 Subject: [PATCH 2556/3948] execution: P3552R3 change_coroutine_scheduler(#1521) --- reference/execution/execution.md | 2 +- .../execution/change_coroutine_scheduler.md | 104 ++++++++++++++++++ reference/execution/execution/task.md | 2 +- .../task/promise_type/await_transform.md | 6 +- reference/execution/execution/with_error.md | 5 +- 5 files changed, 113 insertions(+), 6 deletions(-) create mode 100644 reference/execution/execution/change_coroutine_scheduler.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 364372be20..2789282d17 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -164,7 +164,7 @@ Senderコンシューマは名前空間 `std::this_thread` および名前空間 | [`execution::inline_scheduler`](execution/inline_scheduler.md) | インラインScheduler (class) | C++26 | | [`execution::task_scheduler`](execution/task_scheduler.md) | 任意Scheduler型を保持するScheduler (class) | C++26 | | [`execution::with_error`](execution/with_error.md) | タスクコルーチンからのエラー完了 (class template) | C++26 | -| [`execution::change_coroutine_scheduler`](execution/change_coroutine_scheduler.md.nolink) | タスクコルーチンのScheduler変更 (class template) | C++26 | +| [`execution::change_coroutine_scheduler`](execution/change_coroutine_scheduler.md) | タスクコルーチンのScheduler変更 (class template) | C++26 | | [`execution::task`](execution/task.md) | タスクコルーチン戻り値型 (class template) | C++26 | ### 実行スコープユーティリティ diff --git a/reference/execution/execution/change_coroutine_scheduler.md b/reference/execution/execution/change_coroutine_scheduler.md new file mode 100644 index 0000000000..019b4d24e9 --- /dev/null +++ b/reference/execution/execution/change_coroutine_scheduler.md @@ -0,0 +1,104 @@ +# change_coroutine_scheduler +* execution[meta header] +* class template[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template + struct change_coroutine_scheduler { + using type = remove_cvref_t; + type scheduler; + }; + + template + change_coroutine_scheduler(Sch) -> change_coroutine_scheduler; +} +``` +* scheduler[link scheduler.md] + +## 概要 +タスク[`execution::task`](task.md)を戻り値型とする[コルーチン](/lang/cpp20/coroutines.md)において、`co_await`式でタスク[Scheduler](scheduler.md)変更を表現するタグ型。 + +```cpp +co_await change_coroutine_scheduler{sch} +``` + +タスクコルーチンにおいて後続の非同期処理を実行するタスク[Scheduler](scheduler.md)を`sch`に変更する。同`co_await`式は変更前のタスクSchedulerを返す。 + +詳細仕様は[`task::promise_type::await_transform`](./task/promise_type/await_transform.md)を参照のこと。 + + +## 例 +```cpp example +#include +#include +namespace ex = std::execution; + +ex::task<> work() +{ + // sch0 := 本コルーチン(Sender)を開始したScheduler + // shc1 := co_await式で利用する別Scheduler(並列Schedulerを利用) + std::println("run on Scheduler#0"); + ex::scheduler auto sch1 = ex::get_parallel_scheduler(); + + co_await (ex::schedule(sch1) | ex::then([]{ + // Scheduler sch1上で非同期処理を実行 + std::println("run on Scheduler#1"); + })); + // コルーチンタスクのデフォルト動作: + // co_await式はScheduler Affinityを維持するため + // コルーチン後続処理は元Scheduler上で実行される + std::println("run on Scheduler#0"); + + // 本コルーチンのタスクSchedulerをinline_schedulerへ変更 + co_await ex::change_coroutine_scheduler{ex::inline_scheduler{}}; + + co_await (ex::schedule(sch) | ex::then([]{ + // Scheduler sch1上で非同期処理を実行 + std::println("run on Scheduler#1"); + })); + // inline_scheduler動作: + // co_await式のScheduler Affinity維持を抑止するため + // 同式中で変更したScheduler上でコルーチン後続処理が実行される + std::println("run on Scheduler#1"); +} + +int main() +{ + std::this_thread::sync_wait(work()); +} +``` +* ex::change_coroutine_scheduler[color ff0000] +* ex::task[link task.md] +* ex::scheduler[link scheduler.md] +* ex::then[link then.md] +* ex::get_parallel_scheduler[link get_parallel_scheduler.md] +* ex::inline_scheduler[link inline_scheduler.md] +* std::this_thread::sync_wait[link ../this_thread/sync_wait.md] + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::task`](task.md) +- [`execution::inline_scheduler`](inline_scheduler.md) + + +## 参照 +- [P3552R3 Add a Coroutine Task Type](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3552r3.html) +- C++now 2025, [Getting The Lazy Task Done](https://schedule.cppnow.org/wp-content/uploads/2025/03/Getting_The_Lazy_Task_Done.pdf) diff --git a/reference/execution/execution/task.md b/reference/execution/execution/task.md index 7c71b68915..adec68bfe9 100644 --- a/reference/execution/execution/task.md +++ b/reference/execution/execution/task.md @@ -117,7 +117,7 @@ int main() ## 関連項目 - [`execution::with_error`](with_error.md) -- [`execution::change_coroutine_scheduler`](change_coroutine_scheduler.md.nolink) +- [`execution::change_coroutine_scheduler`](change_coroutine_scheduler.md) - [`execution::task_scheduler`](task_scheduler.md) diff --git a/reference/execution/execution/task/promise_type/await_transform.md b/reference/execution/execution/task/promise_type/await_transform.md index 8b94fbf432..5b473a780e 100644 --- a/reference/execution/execution/task/promise_type/await_transform.md +++ b/reference/execution/execution/task/promise_type/await_transform.md @@ -13,7 +13,7 @@ template auto await_transform(change_coroutine_scheduler sch); // (2) ``` * sender[link ../../sender.md] -* change_coroutine_scheduler[link ../../change_coroutine_scheduler.md.nolink] +* change_coroutine_scheduler[link ../../change_coroutine_scheduler.md] ## 概要 タスクコルーチンにおける[co_await式](/lang/cpp20/coroutines.md)の動作を制御する。 @@ -31,7 +31,7 @@ auto await_transform(change_coroutine_scheduler sch); // (2) ``` * just[link ../../just.md] * scheduler_type[link ../../task.md] - * scheduler[link ../../change_coroutine_scheduler.md.nolink] + * scheduler[link ../../change_coroutine_scheduler.md] * exchange[link /reference/utility/exchange.md] @@ -50,7 +50,7 @@ auto await_transform(change_coroutine_scheduler sch); // (2) - [`execution::as_awaitable`](../../as_awaitable.md) - [`execution::affine_on`](../../affine_on.md.nolink) - [`execution::inline_scheduler`](../../inline_scheduler.md) -- [`execution::change_coroutine_scheduler`](../../change_coroutine_scheduler.md.nolink) +- [`execution::change_coroutine_scheduler`](../../change_coroutine_scheduler.md) ## 参照 diff --git a/reference/execution/execution/with_error.md b/reference/execution/execution/with_error.md index 155ecec11d..95e9882ac8 100644 --- a/reference/execution/execution/with_error.md +++ b/reference/execution/execution/with_error.md @@ -24,7 +24,9 @@ namespace std::execution { co_yield with_error{err} ``` -型`Err`のエラー完了シグネチャ[`set_error_t`](set_error.md)`(Err)`を持つタスクコルーチンにおいて、非同期操作を`Err`型のエラー値`err`によってエラー完了させる。この`co_yield`式が再開(resume)することは決していない。 +型`Err`のエラー完了シグネチャ[`set_error_t`](set_error.md)`(Err)`を持つタスクコルーチンにおいて、非同期操作を`Err`型のエラー値`err`によってエラー完了させる。この`co_yield`式は決して再開(resume)されない。 + +詳細仕様は[`task::promise_type::yield_value`](./task/promise_type/yield_value.md)を参照のこと。 ## 例 @@ -62,6 +64,7 @@ int main() * ex::set_error_t[link set_error.md] * ex::task[link task.md] * ex::upon_error[link upon_error.md] +* std::this_thread::sync_wait[link ../this_thread/sync_wait.md] ### 出力 ``` From 5884c57c92e8815930ab1995e4822dae5ea85dda Mon Sep 17 00:00:00 2001 From: yoh Date: Fri, 16 Jan 2026 15:50:25 +0900 Subject: [PATCH 2557/3948] =?UTF-8?q?lang/cpp20/coroutines:=20meta=20alias?= =?UTF-8?q?=E3=82=BF=E3=82=B0=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp20/coroutines.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lang/cpp20/coroutines.md b/lang/cpp20/coroutines.md index 0f30232164..5a7597d9bb 100644 --- a/lang/cpp20/coroutines.md +++ b/lang/cpp20/coroutines.md @@ -1,5 +1,7 @@ # コルーチン [P0912R5] * cpp20[meta cpp] +* co_yield,co_await,co_return,promise_type,get_return_object,initial_suspend,final_suspend,yield_value,await_transform,return_value,return_void,unhandled_exception,get_return_object_on_allocation_failure,await_ready,await_suspend,await_resume[meta alias] + From 7786c2f4ada20a63c6f4b654b75603bab146898b Mon Sep 17 00:00:00 2001 From: KaiTomotake Date: Fri, 16 Jan 2026 18:50:10 +0900 Subject: [PATCH 2558/3948] fix logic_error.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit logic_errorのインデントを修正 --- reference/stdexcept/logic_error.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/stdexcept/logic_error.md b/reference/stdexcept/logic_error.md index f63d0f1092..2a3f313ebe 100644 --- a/reference/stdexcept/logic_error.md +++ b/reference/stdexcept/logic_error.md @@ -6,7 +6,7 @@ ```cpp namespace std { - class logic_error : public exception; + class logic_error : public exception; } ``` From a9f176508a00cd5873f5dae1b28a325d9ee8ce28 Mon Sep 17 00:00:00 2001 From: yoh Date: Sat, 17 Jan 2026 02:01:12 +0900 Subject: [PATCH 2559/3948] execution: P3552R3 affine_on(#1521) --- reference/execution/execution.md | 2 +- reference/execution/execution/affine_on.md | 91 +++++++++++++++++++ .../execution/execution/get-domain-early.md | 2 +- .../task/promise_type/await_transform.md | 6 +- 4 files changed, 96 insertions(+), 5 deletions(-) create mode 100644 reference/execution/execution/affine_on.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 2789282d17..2ab3e65ddf 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -160,7 +160,7 @@ Senderコンシューマは名前空間 `std::this_thread` および名前空間 |------|------|----------------| | [`execution::as_awaitable`](execution/as_awaitable.md) | Senderを[Awaitable型](/lang/cpp20/coroutines.md)へ変換 (customization point object) | C++26 | | [`execution::with_awaitable_senders`](execution/with_awaitable_senders.md) | [Promise型](/lang/cpp20/coroutines.md)の基底クラス (class template) | C++26 | -| [`execution::affine_on`](execution/affine_on.md.nolink) | (customization point object) | C++26 | +| [`execution::affine_on`](execution/affine_on.md) | タスクコルーチンのScheduler Affinityを実現 (customization point object) | C++26 | | [`execution::inline_scheduler`](execution/inline_scheduler.md) | インラインScheduler (class) | C++26 | | [`execution::task_scheduler`](execution/task_scheduler.md) | 任意Scheduler型を保持するScheduler (class) | C++26 | | [`execution::with_error`](execution/with_error.md) | タスクコルーチンからのエラー完了 (class template) | C++26 | diff --git a/reference/execution/execution/affine_on.md b/reference/execution/execution/affine_on.md new file mode 100644 index 0000000000..fb44e610d8 --- /dev/null +++ b/reference/execution/execution/affine_on.md @@ -0,0 +1,91 @@ +# affine_on +* execution[meta header] +* cpo[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + struct affine_on_t { unspecified }; + inline constexpr affine_on_t affine_on{}; +} +``` +* unspecified[italic] + +## 概要 +`affine_on`は、指定[Scheduler](scheduler.md)上で完了させるSenderアダプタである。 +アダプト対象Senderが正しいScheduler上で完了すると判断できるとき、アルゴリズムはスケジューリング操作を回避できる。 + +`affine_on`は[パイプ可能Senderアダプタオブジェクト](sender_adaptor_closure.md)であり、パイプライン記法をサポートする。 + + +## 効果 +説明用の式`sch`と`sndr`に対して、`decltype((sch))`が[`scheduler`](scheduler.md)を満たさない、もしくは`decltype((sndr))`が[`sender`](sender.md)を満たさないとき、呼び出し式`affine_on(sndr, sch)`は不適格となる。 + +そうでなければ、呼び出し式`affine_on(sndr, sch)`は`sndr`が1回だけ評価されることを除いて、下記と等価。 + +```cpp +transform_sender(get-domain-early(sndr), make-sender(affine_on, sch, sndr)) +``` +* transform_sender[link transform_sender.md] +* get-domain-early[link get-domain-early.md] +* make-sender[link make-sender.md] + + +### Senderアルゴリズムタグ `affine_on` +Senderアルゴリズム動作説明用のクラステンプレート[`impls-for`](impls-for.md)に対して、下記の特殊化が定義される。 + +```cpp +namespace std::execution { + template<> + struct impls-for : default-impls { + static constexpr auto get-attrs = + [](const auto& data, const auto& child) noexcept -> decltype(auto) { + return JOIN-ENV(SCHED-ATTRS(data), FWD-ENV(get_env(child))); + }; + }; +} +``` +* impls-for[link impls-for.md] +* default-impls[link impls-for.md] +* JOIN-ENV[link ../queryable.md] +* SCHED-ATTRS[link scheduler.md] +* FWD-ENV[link ../forwarding_query.md] +* get_env[link get_env.md] + + +## カスタマイゼーションポイント +Senderアルゴリズム構築時および[Receiver](receiver.md)接続時に、関連付けられた実行ドメインに対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 +[デフォルト実行ドメイン](default_domain.md)では無変換。 + +説明用の式`out_sndr`を`affine_on(sndr, sch)`の戻り値[Sender](sender.md)とし、型`OutSndr`を`decltype((out_sndr))`とする。式`out_rcvr`を[`sender_in`](sender_in.md)` == true`となる[環境](../queryable.md)`Env`に関連付けられた[Receiver](receiver.md)とする。`out_sndr`と`out_rcvr`との[接続(connect)](connect.md)結果[Operation State](operation_state.md)への左辺値参照を`op`としたとき、 + +- 呼び出し[`start`](start.md)`(op)`は、現在の実行エージェント上で入力[Sender](sender.md)`sndr`を開始し、[Scheduler](scheduler.md)`sch`に関連付けられた実行リソースに属する実行エージェント上で`out_rcvr`の完了操作が実行される。 +- 現在の実行リソースが`sch`に関連付けられた実行リソースと同一のとき、[`start`](start.md)`(op)`の完了よりも前に`out_rcvr`の完了操作が呼ばれる可能性がある。 +- `sch`上でのスケジューリングが失敗した場合、未規定の実行エージェント上で`out_rcvr`の[エラー完了](set_error.md)が行われるべき。 + + +## 備考 +`affine_on`アルゴリズムの動作は[`continues_on`](continues_on.md)と等価だが、処理系は不要なスケジューリング操作を省略(最適化)する可能性がある。 + +`affine_on`は[タスクコルーチン](task.md)のScheduler Affinity実現に用いられる。 +詳細仕様は[`task::promise::await_transform`](task/promise_type/await_transform.md)を参照のこと。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::task`](task.md) + + +## 参照 +- [P3552R3 Add a Coroutine Task Type](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3552r3.html) diff --git a/reference/execution/execution/get-domain-early.md b/reference/execution/execution/get-domain-early.md index b0f50fc3a7..bdcfebfa0e 100644 --- a/reference/execution/execution/get-domain-early.md +++ b/reference/execution/execution/get-domain-early.md @@ -46,7 +46,7 @@ constexpr auto get-domain-early(const Sndr& sndr) noexcept; - [`execution::stopped_as_optional`](stopped_as_optional.md) - [`execution::stopped_as_error`](stopped_as_error.md) - [`execution::associate`](associate.md) -- [`execution::affine_on`](affine_on.md.nolink) +- [`execution::affine_on`](affine_on.md) - [`this_thread::sync_wait`](../this_thread/sync_wait.md) - [`this_thread::sync_wait_with_variant`](../this_thread/sync_wait_with_variant.md) diff --git a/reference/execution/execution/task/promise_type/await_transform.md b/reference/execution/execution/task/promise_type/await_transform.md index 5b473a780e..a232bad3c9 100644 --- a/reference/execution/execution/task/promise_type/await_transform.md +++ b/reference/execution/execution/task/promise_type/await_transform.md @@ -22,8 +22,8 @@ auto await_transform(change_coroutine_scheduler sch); // (2) ## 効果 - (1) : - - [`same_as`](/reference/concepts/same_as.md)`<`[`inline_scheduler`](../../inline_scheduler.md)`, `[`scheduler_type`](../../task.md)`> == true`ならば、[`as_awaitable`](../../as_awaitable.md)`(std::forward(sndr), *this)`を返す。 - - そうでなければ、[`as_awaitable`](../../as_awaitable.md)`(`[`affine_on`](../../affine_on.md.nolink)`(std::forward(sndr), SCHED(*this)), *this)`を返す。 + - [`same_as`](/reference/concepts/same_as.md)`<`[`inline_scheduler`](../../inline_scheduler.md)`,` [`scheduler_type`](../../task.md)`> == true`ならば、[`as_awaitable`](../../as_awaitable.md)`(std::forward(sndr), *this)`を返す。 + - そうでなければ、[`as_awaitable`](../../as_awaitable.md)`(`[`affine_on`](../../affine_on.md)`(std::forward(sndr), SCHED(*this)), *this)`を返す。 - (2) : 以下と等価 ```cpp @@ -48,7 +48,7 @@ auto await_transform(change_coroutine_scheduler sch); // (2) ## 関連項目 - [`execution::as_awaitable`](../../as_awaitable.md) -- [`execution::affine_on`](../../affine_on.md.nolink) +- [`execution::affine_on`](../../affine_on.md) - [`execution::inline_scheduler`](../../inline_scheduler.md) - [`execution::change_coroutine_scheduler`](../../change_coroutine_scheduler.md) From 9abc7995a295d27e4487445f14875fdce957c5d9 Mon Sep 17 00:00:00 2001 From: yoh Date: Sat, 17 Jan 2026 02:13:36 +0900 Subject: [PATCH 2560/3948] =?UTF-8?q?lang/*:=20meta=20alias=E3=82=BF?= =?UTF-8?q?=E3=82=B0=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 追加キーワードから言語機能ページを引けるよう最小限対応 --- lang/cpp11/static_assert.md | 2 ++ lang/cpp11/thread_local_storage.md | 2 ++ lang/cpp20/concepts.md | 2 ++ lang/cpp20/modules.md | 2 ++ 4 files changed, 8 insertions(+) diff --git a/lang/cpp11/static_assert.md b/lang/cpp11/static_assert.md index c0d9d15ae5..be660e97d9 100644 --- a/lang/cpp11/static_assert.md +++ b/lang/cpp11/static_assert.md @@ -1,5 +1,7 @@ # コンパイル時アサート [N1720] * cpp11[meta cpp] +* static_assert[meta alias] + diff --git a/lang/cpp11/thread_local_storage.md b/lang/cpp11/thread_local_storage.md index 6fc63be014..a860b021f3 100644 --- a/lang/cpp11/thread_local_storage.md +++ b/lang/cpp11/thread_local_storage.md @@ -1,5 +1,7 @@ # スレッドローカルストレージ [N2659] * cpp11[meta cpp] +* thread_local[meta alias] + diff --git a/lang/cpp20/concepts.md b/lang/cpp20/concepts.md index e5963a0fa5..e5a1140568 100644 --- a/lang/cpp20/concepts.md +++ b/lang/cpp20/concepts.md @@ -1,5 +1,7 @@ # コンセプト [P0734R0] * cpp20[meta cpp] +* concept,requires[meta alias] + diff --git a/lang/cpp20/modules.md b/lang/cpp20/modules.md index cf7fafa84c..c8d0d51d13 100644 --- a/lang/cpp20/modules.md +++ b/lang/cpp20/modules.md @@ -1,5 +1,7 @@ # モジュール [P1103R3] * cpp20[meta cpp] +* module,export,import[meta alias] + From bb6cd1f1176e66f7c70b718ac2f479f3037dab0f Mon Sep 17 00:00:00 2001 From: yoh Date: Sat, 17 Jan 2026 02:37:38 +0900 Subject: [PATCH 2561/3948] =?UTF-8?q?exection/when=5Fall:=20P3887R1?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C=20(#1574)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/execution/execution/when_all.md | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/reference/execution/execution/when_all.md b/reference/execution/execution/when_all.md index a04fca4355..9f9f955f31 100644 --- a/reference/execution/execution/when_all.md +++ b/reference/execution/execution/when_all.md @@ -109,23 +109,14 @@ std::forward(sndr).apply(make-state()) state.on_stop.emplace( get_stop_token(get_env(rcvr)), on-stop-request{state.stop_src}); - if (state.stop_src.stop_requested()) { - state.on_stop.reset(); - set_stopped(std::move(rcvr)); - } else { - (start(ops), ...); - } + (start(ops), ...); } ``` * get_stop_token[link ../get_stop_token.md] * get_env[link get_env.md] * on-stop-request[link on-stop-request.md] -* set_stopped[link set_stopped.md] * start[link start.md] * emplace[link /reference/optional/optional/emplace.md] -* reset()[link /reference/optional/optional/reset.md] -* stop_requested()[link /reference/stop_token/inplace_stop_source/stop_requested.md] -* std::move[link /reference/utility/move.md] `impls-for::complete`メンバは、下記ラムダ式と等価な関数呼び出し可能なオブジェクトで初期化される。 @@ -337,13 +328,17 @@ variant - それ以外のとき、下記を評価する。 ```cpp - on_stop.reset(); - set_stopped(std::move(rcvr)); + if constexpr(sends-stopped) { + on_stop.reset(); + set_stopped(std::move(rcvr)); + } ``` * set_stopped[link set_stopped.md] * reset()[link /reference/optional/optional/reset.md] * std::move[link /reference/utility/move.md] + ここで、`Sndrs`の要素`S`において[`completion_signatures_of_t`](completion_signatures_of_t.md)`>`が[`set_stopped_t`](set_stopped.md)`()`を含む`S`が存在するときに限って`sends-stopped`は`true`に等しい。 + ## カスタマイゼーションポイント Senderアルゴリズム構築時および[Receiver](receiver.md)接続時に、関連付けられた実行ドメインに対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 @@ -512,5 +507,6 @@ error=-2 - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) - [P3396R1 std::execution wording fixes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3396r1.html) - [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) +- [P3887R1 Make `when_all` a Ronseal Algorithm](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3887r1.pdf) - [LWG 4203. Constraints on `get-state` functions are incorrect](https://cplusplus.github.io/LWG/issue4203) - [LWG 4227. Missing `noexcept` operator in [exec.when.all]](https://cplusplus.github.io/LWG/issue4227) From 5bff1a18e11a93da77bcdf1885e63575e7c0c933 Mon Sep 17 00:00:00 2001 From: yoh Date: Sat, 17 Jan 2026 02:51:25 +0900 Subject: [PATCH 2562/3948] =?UTF-8?q?execution/when=5Fall:=20LWG4438?= =?UTF-8?q?=E9=81=A9=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/execution/execution/when_all.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/reference/execution/execution/when_all.md b/reference/execution/execution/when_all.md index 9f9f955f31..ba361dff5d 100644 --- a/reference/execution/execution/when_all.md +++ b/reference/execution/execution/when_all.md @@ -206,17 +206,15 @@ auto fn = []() { ```cpp template constexpr auto make-when-all-env(inplace_stop_source& stop_src, // exposition only - Env&& env) noexcept { - return see below; -} + Env&& env) noexcept; ``` * inplace_stop_source[link /reference/stop_token/inplace_stop_source.md] 下記を満たすオブジェクト`e`を返す。 - `decltype(e)`が[`queryable`](../queryable.md)のモデル、かつ -- 式`e.query(`[`get_stop_token`](../get_stop_token.md)`)`が`state.stop-src.`[`get_token()`](/reference/stop_token/inplace_stop_source/get_token.md)と等価、かつ -- [`get_stop_token`](../get_stop_token.md)以外かつ[`forwarding-query`](../forwarding-query.md)を満たす[クエリオブジェクト](../queryable.md)`q`に対して、式`e.query(q)`は[`get_env`](get_env.md)`(rcvr).query(q)`と等価。 +- 式`e.query(`[`get_stop_token`](../get_stop_token.md)`)`が`stop_src.`[`get_token()`](/reference/stop_token/inplace_stop_source/get_token.md)と等価、かつ +- CV修飾された[`get_stop_token`](../get_stop_token.md)ではない[クエリオブジェクト](../queryable.md)`q`に対して、[`forwarding-query`](../forwarding-query.md)を満たすならば、式`e.query(q)`は`env.query(q)`と等価。そうでなければ不適格となる。 ### エイリアステンプレート`when-all-env` `when-all-env`は`decltype(make-when-all-env(declval<`[`inplace_stop_source`](/reference/stop_token/inplace_stop_source.md)`&>(), declval()))`となる。 @@ -510,3 +508,4 @@ error=-2 - [P3887R1 Make `when_all` a Ronseal Algorithm](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3887r1.pdf) - [LWG 4203. Constraints on `get-state` functions are incorrect](https://cplusplus.github.io/LWG/issue4203) - [LWG 4227. Missing `noexcept` operator in [exec.when.all]](https://cplusplus.github.io/LWG/issue4227) +- [LWG 4438. Bad expression in [exec.when.all]](https://cplusplus.github.io/LWG/issue4438) From cf6767c3100bdba1aa2af40b0cb12b8b555c42d3 Mon Sep 17 00:00:00 2001 From: KaiTomotake Date: Sat, 17 Jan 2026 14:31:14 +0900 Subject: [PATCH 2563/3948] add link to invalid_argument.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit stdexcept.mdにinvalid_argumentへのリンクを追加 --- reference/stdexcept.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/stdexcept.md b/reference/stdexcept.md index 4ca74809b8..d9f7d22f89 100644 --- a/reference/stdexcept.md +++ b/reference/stdexcept.md @@ -14,8 +14,8 @@ | 名前 | 説明 | 対応バージョン | |--------------------|--------------------------------------------|-------| | [`logic_error`](stdexcept/logic_error.md) | プログラムの実行前に検出可能なエラー(論理エラー)を示す | | -| [`domain_error`](stdexcept/domain_error.md) | 定義域エラーを示す | | -| `invalid_argument` | 不正な引数を示す | | +| [`domain_error`](stdexcept/domain_error.md) | 定義域エラーを示す | | +| [`invalid_argument`](stdexcept/invalid_argument.md) | 不正な引数を示す | | | `length_error` | 長すぎるオブジェクトを作ろうとしたことを示す | | | `out_of_range` | 引数が許容範囲外であることを示す | | | `runtime_error` | プログラム実行時にのみ検出可能なエラー(実行時エラー)を示す | | From d7a98a9358747cb2ba43fff8d14b878b05952054 Mon Sep 17 00:00:00 2001 From: yoh Date: Mon, 19 Jan 2026 12:03:20 +0900 Subject: [PATCH 2564/3948] =?UTF-8?q?exection:=20P3388R3=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=20(#1568)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/execution/execution/connect.md | 11 +++++++++++ reference/execution/execution/receiver.md | 7 +++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/reference/execution/execution/connect.md b/reference/execution/execution/connect.md index 5d4d768077..605110611a 100644 --- a/reference/execution/execution/connect.md +++ b/reference/execution/execution/connect.md @@ -41,6 +41,16 @@ transform_sender(decltype(get-domain-late(sndr, get_env(rcvr))){}, sndr, get_env - [`sender_in`](sender_in.md)`>` - [`receiver_of`](receiver_of.md)`>>` +下記を満たす右辺値式`rcvr2`が存在するとき、プログラムは不適格(診断不要)となる。 + +- `decltype(rcvr2)`は[`receiver`](receiver.md)のモデルである +- `noexcept(rcvr2)`が`true` +- [`is_same_v`](/reference/type_traits/is_same.md)``が`true` +- `noexcept(execution::connect(sndr, rcvr))`が`true` +- `noexcept(execution::connect(sndr, rcvr2))`が適格かつ`false`に評価される + +上記により[`get_completion_signatures`](get_completion_signatures.md)内部のように、環境のコンテキストのみから`connect`操作の例外送出有無を判断できるようになる。 + ### Awaitable接続用へルパ 説明用のクラス`connect-awaitable-promise`, `operation-state-task`をそれぞれ下記の通り定義する。 @@ -243,4 +253,5 @@ int main() - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) - [P3396R1 std::execution wording fixes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3396r1.html) - [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) +- [P3388R3 When Do You Know connect Doesn't Throw?](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3388r3.pdf) - [LWG 4208. Wording needs to ensure that in `connect(sndr, rcvr)` that `rcvr` expression is only evaluated once](https://cplusplus.github.io/LWG/issue4208) diff --git a/reference/execution/execution/receiver.md b/reference/execution/execution/receiver.md index 7ba8cee154..6cd1942c37 100644 --- a/reference/execution/execution/receiver.md +++ b/reference/execution/execution/receiver.md @@ -13,7 +13,8 @@ namespace std::execution { { get_env(rcvr) } -> queryable; } && move_constructible> && - constructible_from, Rcvr>; + constructible_from, Rcvr> && + is_nothrow_move_constructible_v>; struct receiver_t {}; // タグ型 } @@ -22,6 +23,7 @@ namespace std::execution { * queryable[link ../queryable.md] * derived_from[link /reference/concepts/derived_from.md] * constructible_from[link /reference/concepts/constructible_from.md] +* is_nothrow_move_constructible_v[link /reference/type_traits/is_nothrow_move_constructible.md] ## 概要 `receiver`は、型`Rcvr`がReceiver型の要件を満たすことを表すコンセプトである。 @@ -30,7 +32,7 @@ namespace std::execution { - `receiver_t`をメンバ型`Rcvr::receiver_concept`として定義する - [`get_env`](get_env.md)で[環境](../queryable.md)を取得できる -- ムーブ可能 +- 例外送出せずにムーブ構築可能 ## モデル @@ -79,3 +81,4 @@ int main() ## 参照 - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3388R3 When Do You Know connect Doesn't Throw?](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3388r3.pdf) From 1e94c0f6be73f6e2c5b7e3a853020cac04f8aaa9 Mon Sep 17 00:00:00 2001 From: KaiTomotake Date: Mon, 19 Jan 2026 14:19:13 +0900 Subject: [PATCH 2565/3948] add out_of_range.md --- reference/stdexcept/out_of_range.md | 47 +++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 reference/stdexcept/out_of_range.md diff --git a/reference/stdexcept/out_of_range.md b/reference/stdexcept/out_of_range.md new file mode 100644 index 0000000000..6f384bf1ab --- /dev/null +++ b/reference/stdexcept/out_of_range.md @@ -0,0 +1,47 @@ +# out_of_range + +* stdexcept[meta header] +* class[meta id-type] +* std[meta namespace] + +```cpp +namespace std { + class out_of_range : public logic_error; +} +``` + +# 概要 + +`out_of_range`は有効範囲外の引数を通知するためにスローされる例外及びそれに対する基底クラスである。 + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +| --- | --- | --- | +| [`(constructor)`](out_of_range/op_constructor.md.nolink) | コンストラクタ | | +| [`(destructor)`](out_of_range/op_destructor.md.nolink) | デストラクタ | | +| [`operator=`](out_of_range/op_assign.md.nolink) | 代入演算子 | | +| [`what`](exception/what.md.nolink) | エラー理由を取得する | | + +## 例 + +```cpp example +#include +#include +#include + +int main() { + std::vector vec = {1, 2, 3}; + try { + std::cout << vec.at(3) << "\n"; + } catch (const std::out_of_range& e) { + std::cerr << e.wnat() << "\n"; + } +} +``` + +### 出力(標準エラー出力) + +``` +vector::_M_range_check: __n (which is 3) >= this->size() (which is 3) +``` \ No newline at end of file From b769c719e9b0d55297a47082980121c3135779a4 Mon Sep 17 00:00:00 2001 From: KaiTomotake Date: Mon, 19 Jan 2026 14:22:32 +0900 Subject: [PATCH 2566/3948] add out_of_range page link --- reference/stdexcept.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/stdexcept.md b/reference/stdexcept.md index d9f7d22f89..66ffb68de6 100644 --- a/reference/stdexcept.md +++ b/reference/stdexcept.md @@ -17,7 +17,7 @@ | [`domain_error`](stdexcept/domain_error.md) | 定義域エラーを示す | | | [`invalid_argument`](stdexcept/invalid_argument.md) | 不正な引数を示す | | | `length_error` | 長すぎるオブジェクトを作ろうとしたことを示す | | -| `out_of_range` | 引数が許容範囲外であることを示す | | +| [`out_of_range`](stdexcept/out_of_range.md) | 引数が許容範囲外であることを示す | | | `runtime_error` | プログラム実行時にのみ検出可能なエラー(実行時エラー)を示す | | | `range_error` | 内部計算によって、値が範囲外になったことを示す(値域エラー) | | | `overflow_error` | 数値計算の結果がオーバーフローしたことを示す | | From fb3ec5ab18638c7b151905ed9f6e4fa75ebeb2db Mon Sep 17 00:00:00 2001 From: KaiTomotake Date: Mon, 19 Jan 2026 14:23:36 +0900 Subject: [PATCH 2567/3948] fix ngword --- reference/stdexcept/out_of_range.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/stdexcept/out_of_range.md b/reference/stdexcept/out_of_range.md index 6f384bf1ab..489cda5e07 100644 --- a/reference/stdexcept/out_of_range.md +++ b/reference/stdexcept/out_of_range.md @@ -12,7 +12,7 @@ namespace std { # 概要 -`out_of_range`は有効範囲外の引数を通知するためにスローされる例外及びそれに対する基底クラスである。 +`out_of_range`は有効範囲外の引数を通知するために送出される例外及びそれに対する基底クラスである。 ## メンバ関数 From 52f1c843c7d2c721778f19f438d33a89346bab12 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 19 Jan 2026 17:25:02 +0900 Subject: [PATCH 2568/3948] =?UTF-8?q?out=5Fof=5Frange=20:=20=E8=A6=8B?= =?UTF-8?q?=E5=87=BA=E3=81=97=E3=83=9F=E3=82=B9=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/stdexcept/out_of_range.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/stdexcept/out_of_range.md b/reference/stdexcept/out_of_range.md index 489cda5e07..fdfd76c2e0 100644 --- a/reference/stdexcept/out_of_range.md +++ b/reference/stdexcept/out_of_range.md @@ -10,7 +10,7 @@ namespace std { } ``` -# 概要 +## 概要 `out_of_range`は有効範囲外の引数を通知するために送出される例外及びそれに対する基底クラスである。 From e958f9c20963d1d0beda268ce0489c97238551b0 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 19 Jan 2026 17:26:39 +0900 Subject: [PATCH 2569/3948] =?UTF-8?q?out=5Fof=5Frange=20:=20=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E4=BF=AE=E9=A3=BE=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/stdexcept/out_of_range.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reference/stdexcept/out_of_range.md b/reference/stdexcept/out_of_range.md index fdfd76c2e0..f64247bedc 100644 --- a/reference/stdexcept/out_of_range.md +++ b/reference/stdexcept/out_of_range.md @@ -9,6 +9,7 @@ namespace std { class out_of_range : public logic_error; } ``` +* logic_error[link logic_error.md] ## 概要 @@ -39,6 +40,7 @@ int main() { } } ``` +* vec.at[link /reference/vector/vector/at.md] ### 出力(標準エラー出力) From f6454ce31e379cdc6d981011c58d662afb4b9a5c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 19 Jan 2026 17:27:40 +0900 Subject: [PATCH 2570/3948] =?UTF-8?q?domain=5Ferror=20/=20invalid=5Fargume?= =?UTF-8?q?nt=20:=20=E3=82=B3=E3=83=BC=E3=83=89=E4=BF=AE=E9=A3=BE=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/stdexcept/domain_error.md | 1 + reference/stdexcept/invalid_argument.md | 1 + 2 files changed, 2 insertions(+) diff --git a/reference/stdexcept/domain_error.md b/reference/stdexcept/domain_error.md index 0045c78227..7f6baf6af3 100644 --- a/reference/stdexcept/domain_error.md +++ b/reference/stdexcept/domain_error.md @@ -47,6 +47,7 @@ int main() { } } ``` +* std::sqrt[link /reference/cmath/sqrt.md] ### 出力 (標準エラー出力) ``` diff --git a/reference/stdexcept/invalid_argument.md b/reference/stdexcept/invalid_argument.md index 21eeff21ec..a266c682b7 100644 --- a/reference/stdexcept/invalid_argument.md +++ b/reference/stdexcept/invalid_argument.md @@ -48,6 +48,7 @@ int main() { } } ``` +* std::stoi[link /reference/string/stoi.md] ### 出力(標準エラー出力) ``` From e76ce0f6088c0bef306d19d0df4378f603dcfdc1 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 19 Jan 2026 18:33:38 +0900 Subject: [PATCH 2571/3948] =?UTF-8?q?stdexcept=20:=20=E5=AE=9F=E8=A1=8C?= =?UTF-8?q?=E7=92=B0=E5=A2=83=E3=81=AB=E3=82=88=E3=81=A3=E3=81=A6=E5=87=BA?= =?UTF-8?q?=E5=8A=9B=E3=81=8C=E7=95=B0=E3=81=AA=E3=82=8B=E5=A0=B4=E5=90=88?= =?UTF-8?q?=E3=81=AF=E5=87=BA=E5=8A=9B=E3=81=AE=E8=A6=8B=E5=87=BA=E3=81=97?= =?UTF-8?q?=E3=82=92=E3=80=8C=E5=87=BA=E5=8A=9B=E4=BE=8B=E3=80=8D=E3=81=AB?= =?UTF-8?q?=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/stdexcept/domain_error.md | 2 +- reference/stdexcept/invalid_argument.md | 2 +- reference/stdexcept/logic_error.md | 2 +- reference/stdexcept/out_of_range.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/stdexcept/domain_error.md b/reference/stdexcept/domain_error.md index 7f6baf6af3..6223ee79e9 100644 --- a/reference/stdexcept/domain_error.md +++ b/reference/stdexcept/domain_error.md @@ -49,7 +49,7 @@ int main() { ``` * std::sqrt[link /reference/cmath/sqrt.md] -### 出力 (標準エラー出力) +### 出力例 (標準エラー出力) ``` Cannot calculate the square root of a negative number. ``` diff --git a/reference/stdexcept/invalid_argument.md b/reference/stdexcept/invalid_argument.md index a266c682b7..50a660140e 100644 --- a/reference/stdexcept/invalid_argument.md +++ b/reference/stdexcept/invalid_argument.md @@ -50,7 +50,7 @@ int main() { ``` * std::stoi[link /reference/string/stoi.md] -### 出力(標準エラー出力) +### 出力例(標準エラー出力) ``` value must be positive ``` diff --git a/reference/stdexcept/logic_error.md b/reference/stdexcept/logic_error.md index 2a3f313ebe..6f84cd4192 100644 --- a/reference/stdexcept/logic_error.md +++ b/reference/stdexcept/logic_error.md @@ -45,7 +45,7 @@ int main() { } ``` -### 出力 (標準エラー出力) +### 出力例 (標準エラー出力) ``` Error: Cannot perform calculations with negative numbers! diff --git a/reference/stdexcept/out_of_range.md b/reference/stdexcept/out_of_range.md index f64247bedc..8ba8b233ad 100644 --- a/reference/stdexcept/out_of_range.md +++ b/reference/stdexcept/out_of_range.md @@ -42,7 +42,7 @@ int main() { ``` * vec.at[link /reference/vector/vector/at.md] -### 出力(標準エラー出力) +### 出力例(標準エラー出力) ``` vector::_M_range_check: __n (which is 3) >= this->size() (which is 3) From 9fac2fe358bde00961bccaba386a82b0d9ea232d Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sun, 18 Jan 2026 18:49:27 +0900 Subject: [PATCH 2572/3948] new library `csignal` --- reference.md | 2 +- reference/csignal.md | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 reference/csignal.md diff --git a/reference.md b/reference.md index b052c1bf97..369c75a62f 100644 --- a/reference.md +++ b/reference.md @@ -230,7 +230,7 @@ | [``](/reference/clocale.md) | ロケール | | | [``](/reference/cmath.md) | 数学関数 | | | `` | ジャンプ処理 | | -| `` | シグナル | | +| [``](reference/csignal.md) | シグナル | | | `` | アライメント操作のマクロ | C++17で非推奨
C++20で削除 | | `` | 可変引数操作 | | | [``](/reference/stdbit.h.md.nolink) | ビット操作 | C++26 | diff --git a/reference/csignal.md b/reference/csignal.md new file mode 100644 index 0000000000..2f0c717a2c --- /dev/null +++ b/reference/csignal.md @@ -0,0 +1,39 @@ +# csignal +* csignal[meta header] + +``ヘッダでは、シグナル操作のための機能を定義する。 +シグナルの集合、意味、及びデフォルトの処理は処理系定義である。 + +## 型 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`sig_atomic_t`](csignal/sig_atomic_t.md) | 非同期シグナルハンドラからアトミックなエンティティとしてアクセス可能な整数型 | | + +## マクロ + +### `signal`関数用のハンドラ指定子 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `SIG_DFL` | デフォルト動作を指定する | | | +| `SIG_ERR` | `signal`関数が失敗したことを示す戻り値 | | +| `SIG_IGN` | シグナルを無視する | | + +### シグナル番号を表すマクロ + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `SIGINT` | 割り込みを示すシグナル番号 | | +| `SIGILL` | 不正な命令を示すシグナル番号 | | +| `SIGABRT` | `abort`関数などによる異常終了を示すシグナル番号 | | +| `SIGFPE` | 算術演算エラーを示すシグナル番号 | | +| `SIGSEGV` | 記憶領域への不正アクセスを示すシグナル番号 | | +| `SIGTERM` | 終了要求を示すシグナル番号 | | + +## 関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`signal`](csignal/signal.md) | 特定のシグナルに対するシグナルハンドラを設定する | | +| [`raise`](csignal/raise.md) | プログラムにシグナルを送信する | | From 77b58d3b4388124e14258cf5a16d24d254384cfb Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sun, 18 Jan 2026 20:18:46 +0900 Subject: [PATCH 2573/3948] add new ref `csignal/raise` fix --- reference/csignal/raise.md | 49 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 reference/csignal/raise.md diff --git a/reference/csignal/raise.md b/reference/csignal/raise.md new file mode 100644 index 0000000000..997b66adb9 --- /dev/null +++ b/reference/csignal/raise.md @@ -0,0 +1,49 @@ +# raise +* csignal[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +namespace std { + int raise(int sig); +} +``` + +## 概要 +プログラムにシグナルを送信する。 + +## 引数 +- `sig`: 送信するシグナル番号 + +## 戻り値 +正常に終了した場合は0を返す。 +それ以外の場合は非ゼロの値を返す。 + +## 備考 +`signal`関数などにより、シグナルハンドラが呼び出された場合、それが終了するまでこの関数は戻らない。 + +## 例 +```cpp example +#include +#include + +volatile std::sig_atomic_t got_signal = 0; + +void signal_handler(int signum) { + got_signal = 1; +} + +int main (){ + std::signal(SIGABRT, signal_handler); + std::raise(SIGABRT); + if (got_signal) + std::cout << "SIGABRT" << std::endl; + return 0; +} +``` +* std::raise[color ff0000] + +### 出力例 +``` +SIGABRT +``` From 77db2dec0f1121161c4d6e127e176fbe43f06096 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Tue, 20 Jan 2026 01:02:54 +0900 Subject: [PATCH 2574/3948] add new ref `csignal/sig_atomic_t.md` --- reference/csignal/sig_atomic_t.md | 60 +++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 reference/csignal/sig_atomic_t.md diff --git a/reference/csignal/sig_atomic_t.md b/reference/csignal/sig_atomic_t.md new file mode 100644 index 0000000000..6e911df96a --- /dev/null +++ b/reference/csignal/sig_atomic_t.md @@ -0,0 +1,60 @@ +# sig_atomic_t +* csignal[meta header] +* std[meta namespace] +* type-alias[meta id-type] + +```cpp +namespace std { + using sig_atomic_t = integer-type; +} +``` + +* integer-type[italic] + +## 概要 +`sig_atomic_t`は、非同期シグナルハンドラと通常の実行コンテキストの間で、単純な読み書きを分断されずに行えることが保証された整数型である。 + +この型に対して保証されるのは単純な代入および読み出しのみであり、 +複合操作や算術演算は保証されない。 +実際の使用では通常`volatile`修飾子と組み合わせて用いられる。 + +具体的な型は処理系定義である。 + +## 備考 +最大値は`SIG_ATOMIC_MAX`、最小値は`SIG_ATOMIC_MIN`に定義されている。 + +## 例 +```cpp example +#include +#include + +volatile std::sig_atomic_t flag = 0; + +void signal_handler(int signum) +{ + flag = 1; +} + +int main () +{ + std::signal(SIGINT, signal_handler); + while(!flag){ + //処理 + } + if (flag){ + std::cout << "catch SIGINT" << std::endl; + } + return 0; +} +``` +* std::sig_atomic_t[color ff0000] + +### 出力例 +``` +catch SIGINT +``` +`Ctrl + c`などで割り込みが発生した場合。 + +## 関連項目 +- [`SIG_ATOMIC_MAX`](/reference/cstdint/sig_atomic_max.md) +- [`SIG_ATOMIC_MIN`](/reference/cstdint/sig_atomic_min.md) From 8198ec391d5ae752fd4b4412937e19a69c9d18c8 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 20 Jan 2026 11:35:12 +0900 Subject: [PATCH 2575/3948] =?UTF-8?q?to=5Fstring=20/=20to=5Fwstring=20:=20?= =?UTF-8?q?C++26=E3=81=A7=E6=95=B4=E6=95=B0=E3=82=AA=E3=83=BC=E3=83=90?= =?UTF-8?q?=E3=83=BC=E3=83=AD=E3=83=BC=E3=83=89=E3=82=92constexpr=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C=20#1576?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 2 +- reference/string/to_string.md | 32 +++++++++++++++++++++++--------- reference/string/to_wstring.md | 26 ++++++++++++++++++++------ 3 files changed, 44 insertions(+), 16 deletions(-) diff --git a/lang/cpp26.md b/lang/cpp26.md index 5d2520ad04..eeb5285fe3 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -279,7 +279,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - 幅と精度を動的に指定した場合でも型の検証がコンパイル時に行われるよう仕様を見直し - コンパイル時の書式文字列だけでなく、実行時の書式文字列を渡せるよう仕様修正 - `constexpr`に対応 -- [`std::to_string()`](/reference/string/to_string.md)と[`std::to_wstring()`](/reference/string/to_wstring.md)を`constexpr`に対応 +- [`std::to_string()`](/reference/string/to_string.md)と[`std::to_wstring()`](/reference/string/to_wstring.md)の整数オーバーロードが`constexpr`に対応 - [`std::basic_string`](/reference/string/basic_string.md)クラスと[`std::basic_string_view`](/reference/string_view/basic_string_view.md)クラスに、部分文字列を[`std::basic_string_view`](/reference/string_view/basic_string_view.md)として取得するメンバ関数`subview()`を追加 - [`std::basic_string`](/reference/string/basic_string.md)と[`std::basic_string_view`](/reference/string_view/basic_string_view.md)を[`std::basic_string`](/reference/string/basic_string.md)として連結させる`operator+`を追加 diff --git a/reference/string/to_string.md b/reference/string/to_string.md index b7409a72d1..2447be9fdf 100644 --- a/reference/string/to_string.md +++ b/reference/string/to_string.md @@ -6,15 +6,27 @@ ```cpp namespace std { - string to_string(int val); // (1) C++11 - string to_string(unsigned int val); // (2) C++11 - string to_string(long val); // (3) C++11 - string to_string(unsigned long val); // (4) C++11 - string to_string(long long val); // (5) C++11 - string to_string(unsigned long long val); // (6) C++11 - string to_string(float val); // (7) C++11 - string to_string(double val); // (8) C++11 - string to_string(long double val); // (9) C++11 + string to_string(int val); // (1) C++11 + constexpr string to_string(int val); // (1) C++26 + + string to_string(unsigned int val); // (2) C++11 + constexpr string to_string(unsigned int val); // (2) C++26 + + string to_string(long val); // (3) C++11 + constexpr string to_string(long val); // (3) C++26 + + string to_string(unsigned long val); // (4) C++11 + constexpr string to_string(unsigned long val); // (4) C++26 + + string to_string(long long val); // (5) C++11 + constexpr string to_string(long long val); // (5) C++26 + + string to_string(unsigned long long val); // (6) C++11 + constexpr string to_string(unsigned long long val); // (6) C++26 + + string to_string(float val); // (7) C++11 + string to_string(double val); // (8) C++11 + string to_string(long double val); // (9) C++11 } ``` * string[link basic_string.md] @@ -191,3 +203,5 @@ std::string to_string(long double val) - [N2408 Simple Numeric Access Revision 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2408.html) - [P2587R3 `to_string` or not `to_string`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2587r3.html) - C++26から`sprintf`ベースの仕様をやめて`std::format()`ベースの仕様になった +- [P3391R2 `constexpr std::format`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3391r2.html) + - C++26から整数バージョンが`constexpr`に対応した \ No newline at end of file diff --git a/reference/string/to_wstring.md b/reference/string/to_wstring.md index 37e49c9eeb..3a747fe3d2 100644 --- a/reference/string/to_wstring.md +++ b/reference/string/to_wstring.md @@ -6,12 +6,24 @@ ```cpp namespace std { - wstring to_wstring(int val); // (1) C++11 - wstring to_wstring(unsigned int val); // (2) C++11 - wstring to_wstring(long val); // (3) C++11 - wstring to_wstring(unsigned long val); // (4) C++11 - wstring to_wstring(long long val); // (5) C++11 - wstring to_wstring(unsigned long long val); // (6) C++11 + wstring to_wstring(int val); // (1) C++11 + constexpr wstring to_wstring(int val); // (1) C++26 + + wstring to_wstring(unsigned int val); // (2) C++11 + constexpr wstring to_wstring(unsigned int val); // (2) C++26 + + wstring to_wstring(long val); // (3) C++11 + constexpr wstring to_wstring(long val); // (3) C++26 + + wstring to_wstring(unsigned long val); // (4) C++11 + constexpr wstring to_wstring(unsigned long val); // (4) C++26 + + wstring to_wstring(long long val); // (5) C++11 + constexpr wstring to_wstring(long long val); // (5) C++26 + + wstring to_wstring(unsigned long long val); // (6) C++11 + constexpr wstring to_wstring(unsigned long long val); // (6) C++26 + wstring to_wstring(float val); // (7) C++11 wstring to_wstring(double val); // (8) C++11 wstring to_wstring(long double val); // (9) C++11 @@ -200,3 +212,5 @@ std::wstring to_wstring(long double val) - [N2408 Simple Numeric Access Revision 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2408.html) - [P2587R3 `to_string` or not `to_string`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2587r3.html) - C++26から`sprintf`ベースの仕様をやめて`std::format()`ベースの仕様になった +- [P3391R2 `constexpr std::format`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3391r2.html) + - C++26から整数バージョンが`constexpr`に対応した \ No newline at end of file From 94f5a4fc62ae5edb5e8494b1ca23955303200c9f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 20 Jan 2026 12:05:18 +0900 Subject: [PATCH 2576/3948] =?UTF-8?q?format=E9=96=A2=E9=80=A3=E3=82=92C++2?= =?UTF-8?q?6=E3=81=A7constexpr=E5=AF=BE=E5=BF=9C=20#1576?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 2 +- reference/format/basic_format_arg.md | 2 +- reference/format/basic_format_arg/op_bool.md | 33 ++++++++++++++ .../format/basic_format_arg/op_constructor.md | 14 ++++-- reference/format/basic_format_args/get.md | 10 +++-- .../basic_format_args/op_constructor.md | 13 ++++-- .../format/basic_format_context/advance_to.md | 5 ++- reference/format/basic_format_context/arg.md | 7 ++- reference/format/basic_format_context/out.md | 5 ++- .../basic_format_string/op_constructor.md | 5 ++- reference/format/format.md | 28 ++++++++++-- reference/format/format_to.md | 44 +++++++++++++++---- reference/format/format_to_n.md | 32 ++++++++++---- reference/format/formatted_size.md | 38 ++++++++++++---- reference/format/make_format_args.md | 12 ++++- reference/format/range-default-formatter.md | 2 + reference/format/range_formatter/format.md | 12 ++++- reference/format/runtime-format-string.md | 3 +- reference/format/runtime_format.md | 5 ++- reference/format/vformat.md | 36 +++++++++++---- reference/format/vformat_to.md | 38 +++++++++++++--- 21 files changed, 279 insertions(+), 67 deletions(-) create mode 100644 reference/format/basic_format_arg/op_bool.md diff --git a/lang/cpp26.md b/lang/cpp26.md index eeb5285fe3..bb2b78b8a0 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -278,7 +278,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - ポインタ出力のサポートを追加 - 幅と精度を動的に指定した場合でも型の検証がコンパイル時に行われるよう仕様を見直し - コンパイル時の書式文字列だけでなく、実行時の書式文字列を渡せるよう仕様修正 - - `constexpr`に対応 + - 非ロケール版を`constexpr`に対応 - [`std::to_string()`](/reference/string/to_string.md)と[`std::to_wstring()`](/reference/string/to_wstring.md)の整数オーバーロードが`constexpr`に対応 - [`std::basic_string`](/reference/string/basic_string.md)クラスと[`std::basic_string_view`](/reference/string_view/basic_string_view.md)クラスに、部分文字列を[`std::basic_string_view`](/reference/string_view/basic_string_view.md)として取得するメンバ関数`subview()`を追加 - [`std::basic_string`](/reference/string/basic_string.md)と[`std::basic_string_view`](/reference/string_view/basic_string_view.md)を[`std::basic_string`](/reference/string/basic_string.md)として連結させる`operator+`を追加 diff --git a/reference/format/basic_format_arg.md b/reference/format/basic_format_arg.md index 011923ec5a..7f3d8eecb5 100644 --- a/reference/format/basic_format_arg.md +++ b/reference/format/basic_format_arg.md @@ -56,7 +56,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |-----------------|-----------------------------------|----------------| -| `operator bool` | `bool`への変換演算子(空の時`false`) | C++20 | +| [`operator bool`](basic_format_arg/op_bool.md) | `bool`への変換演算子(空の時`false`) | C++20 | ## メンバ型 diff --git a/reference/format/basic_format_arg/op_bool.md b/reference/format/basic_format_arg/op_bool.md new file mode 100644 index 0000000000..e16667f42c --- /dev/null +++ b/reference/format/basic_format_arg/op_bool.md @@ -0,0 +1,33 @@ +# operator bool +* format[meta header] +* class[meta id-type] +* std[meta namespace] +* basic_format_arg[meta class] +* cpp20[meta cpp] + +```cpp +explicit operator bool() const noexcept; // (1) C++20 +constexpr explicit operator bool() const noexcept; // (1) C++26 +``` + +## 概要 +`bool`型への変換演算子。 + + +## 戻り値 +空でない場合に`true`を返す + + +## バージョン +### 言語 +- C++20 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P3391R2 `constexpr std::format`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3391r2.html) + - C++26から`constexpr`に対応した \ No newline at end of file diff --git a/reference/format/basic_format_arg/op_constructor.md b/reference/format/basic_format_arg/op_constructor.md index aec5476581..1d1958ca83 100644 --- a/reference/format/basic_format_arg/op_constructor.md +++ b/reference/format/basic_format_arg/op_constructor.md @@ -19,10 +19,16 @@ namespace std { const char_type*, basic_string_view, const void*, handle> value; // exposition only - template explicit basic_format_arg(T& v) noexcept; // (2) exposition only + template + explicit + basic_format_arg(T& v) noexcept; // (2) C++20 exposition only + template + constexpr explicit + basic_format_arg(T& v) noexcept; // (2) C++26 exposition only public: - basic_format_arg() noexcept; // (1) + basic_format_arg() noexcept; // (1) C++20 + constexpr basic_format_arg() noexcept; // (1) C++26 }; } ``` @@ -83,4 +89,6 @@ namespace std { ## 参照 -* [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) +- [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) +- [P3391R2 `constexpr std::format`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3391r2.html) + - C++26から`constexpr`に対応した \ No newline at end of file diff --git a/reference/format/basic_format_args/get.md b/reference/format/basic_format_args/get.md index 5194bf6cbb..04211fdd8d 100644 --- a/reference/format/basic_format_args/get.md +++ b/reference/format/basic_format_args/get.md @@ -7,7 +7,10 @@ * cpp20[meta cpp] ```cpp -basic_format_arg get(std::size_t i) const noexcept; +basic_format_arg + get(std::size_t i) const noexcept; // (1) C++20 +constexpr basic_format_arg + get(std::size_t i) const noexcept; // (1) C++26 ``` * basic_format_arg[link /reference/format/basic_format_arg.md] @@ -49,5 +52,6 @@ namespace std { - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 - -* [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) +- [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) +- [P3391R2 `constexpr std::format`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3391r2.html) + - C++26から`constexpr`に対応した \ No newline at end of file diff --git a/reference/format/basic_format_args/op_constructor.md b/reference/format/basic_format_args/op_constructor.md index dfce2d918f..5fbdb4f1ce 100644 --- a/reference/format/basic_format_args/op_constructor.md +++ b/reference/format/basic_format_args/op_constructor.md @@ -7,10 +7,15 @@ * cpp20[meta cpp] ```cpp -basic_format_args() noexcept; // (1) +basic_format_args() noexcept; // (1) C++20 template -basic_format_args(const format_arg_store& store) noexcept; // (2) +basic_format_args( + const format_arg_store& store) noexcept; // (2) C++20 +template +constexpr +basic_format_args( + const format_arg_store& store) noexcept; // (2) C++26 ``` * basic_format_args[link /reference/format/basic_format_args.md] * format_arg_store[italic] @@ -63,4 +68,6 @@ namespace std { ## 参照 -* [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) +- [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) +- [P3391R2 `constexpr std::format`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3391r2.html) + - C++26から`constexpr`に対応した \ No newline at end of file diff --git a/reference/format/basic_format_context/advance_to.md b/reference/format/basic_format_context/advance_to.md index 1c1be86218..ddb1b7ca1d 100644 --- a/reference/format/basic_format_context/advance_to.md +++ b/reference/format/basic_format_context/advance_to.md @@ -6,7 +6,8 @@ * cpp20[meta cpp] ```cpp -void advance_to(iterator it); +void advance_to(iterator it); // (1) C++20 +constexpr void advance_to(iterator it); // (1) C++26 ``` ## 概要 @@ -36,3 +37,5 @@ out_ = std::move(it); ## 参照 - [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) +- [P3391R2 `constexpr std::format`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3391r2.html) + - C++26から`constexpr`に対応した \ No newline at end of file diff --git a/reference/format/basic_format_context/arg.md b/reference/format/basic_format_context/arg.md index 6ad4b11557..128d008f1d 100644 --- a/reference/format/basic_format_context/arg.md +++ b/reference/format/basic_format_context/arg.md @@ -6,7 +6,10 @@ * cpp20[meta cpp] ```cpp -basic_format_arg arg(size_t id) const; +basic_format_arg + arg(size_t id) const; // (1) C++20 +constexpr basic_format_arg + arg(size_t id) const; // (1) C++26 ``` * basic_format_arg[link /reference/format/basic_format_arg.md] * basic_format_context[link /reference/format/basic_format_context.md] @@ -28,3 +31,5 @@ basic_format_arg arg(size_t id) const; ## 参照 - [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) +- [P3391R2 `constexpr std::format`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3391r2.html) + - C++26から`constexpr`に対応した \ No newline at end of file diff --git a/reference/format/basic_format_context/out.md b/reference/format/basic_format_context/out.md index 421f14a2e1..b3201f50dd 100644 --- a/reference/format/basic_format_context/out.md +++ b/reference/format/basic_format_context/out.md @@ -6,7 +6,8 @@ * cpp20[meta cpp] ```cpp -iterator out(); +iterator out(); // (1) C++20 +constexpr iterator out(); // (1) C++26 ``` ## 概要 @@ -36,3 +37,5 @@ return std::move(out_); ## 参照 - [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) +- [P3391R2 `constexpr std::format`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3391r2.html) + - C++26から`constexpr`に対応した \ No newline at end of file diff --git a/reference/format/basic_format_string/op_constructor.md b/reference/format/basic_format_string/op_constructor.md index 4092566455..bb9d2b3e6b 100644 --- a/reference/format/basic_format_string/op_constructor.md +++ b/reference/format/basic_format_string/op_constructor.md @@ -7,8 +7,10 @@ ```cpp template -consteval basic_format_string(const T& s); // (1) C++23 +consteval +basic_format_string(const T& s); // (1) C++23 +constexpr basic_format_string(runtime-format-string s) noexcept; // (2) C++26 ``` * runtime-format-string[link /reference/format/runtime-format-string.md] @@ -97,3 +99,4 @@ namespace std { ## 参照 - [P2216R3 `std::format` improvements](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2216r3.html) - [P2918R2 Runtime format strings II](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2918r2.html) +- [P3391R2 `constexpr std::format`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3391r2.html) diff --git a/reference/format/format.md b/reference/format/format.md index 06f14bead1..b4265b9d88 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -8,16 +8,34 @@ ```cpp namespace std { template - string format(format_string fmt, Args&&... args); // (1) + string + format(format_string fmt, + Args&&... args); // (1) C++20 + template + constexpr string + format(format_string fmt, + Args&&... args); // (1) C++26 template - wstring format(wformat_string fmt, Args&&... args); // (2) + wstring + format(wformat_string fmt, + Args&&... args); // (2) C++20 + template + constexpr wstring + format(wformat_string fmt, + Args&&... args); // (2) C++26 template - string format(const locale& loc, format_string fmt, Args&&... args); // (3) + string + format(const locale& loc, + format_string fmt, + Args&&... args); // (3) C++20 template - wstring format(const locale& loc, wformat_string fmt, Args&&... args); // (4) + wstring + format(const locale& loc, + wformat_string fmt, + Args&&... args); // (4) C++20 } ``` * string[link /reference/string/basic_string.md] @@ -719,3 +737,5 @@ wstring format(const locale& loc, wformat_string fmt, const Args&... ar - [P2418R2 Add support for `std::generator`-like types to `std::format`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2418r2.html) - [P2510R3 Formatting pointers](https://open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2510r3.pdf) - C++26から、ポインタ値を大文字で出力する`P`オプションが追加された +- [P3391R2 `constexpr std::format`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3391r2.html) + - C++26から非ロケール版が`constexpr`に対応した diff --git a/reference/format/format_to.md b/reference/format/format_to.md index 482c3af2fe..41a243504e 100644 --- a/reference/format/format_to.md +++ b/reference/format/format_to.md @@ -8,16 +8,40 @@ ```cpp namespace std { template - Out format_to(Out out, format_string fmt, Args&&... args); // (1) + Out + format_to(Out out, + format_string fmt, + Args&&... args); // (1) C++20 + template + constexpr Out + format_to(Out out, + format_string fmt, + Args&&... args); // (1) C++26 template - Out format_to(Out out, wformat_string fmt, Args&&... args); // (2) + Out + format_to(Out out, + wformat_string fmt, + Args&&... args); // (2) C++20 + template + constexpr Out + format_to(Out out, + wformat_string fmt, + Args&&... args); // (2) C++26 template - Out format_to(Out out, const locale& loc, format_string fmt, Args&&... args); // (3) + Out + format_to(Out out, + const locale& loc, + format_string fmt, + Args&&... args); // (3) C++20 template - Out format_to(Out out, const locale& loc, wformat_string fmt, Args&&... args); // (4) + Out + format_to(Out out, + const locale& loc, + wformat_string fmt, + Args&&... args); // (4) C++20 } ``` * format_string[link basic_format_string.md] @@ -154,8 +178,10 @@ wstring format_to(Out out, const locale& loc, wformat_string fmt, const ## 参照 -* [Working Draft, Standard for Programming Language C++ [format]](https://timsong-cpp.github.io/cppwp/format) -* [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) -* [P2216R3 std::format improvements](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2216r3.html) -* [[C++] std::formatあるいは{fmt}のコンパイル時フォーマット文字列チェックの魔術 - 地面を見下ろす少年の足蹴にされる私](https://onihusube.hatenablog.com/entry/2021/07/01/195912) -* [P2418R2 Add support for `std::generator`-like types to `std::format`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2418r2.html) +- [Working Draft, Standard for Programming Language C++ [format]](https://timsong-cpp.github.io/cppwp/format) +- [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) +- [P2216R3 std::format improvements](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2216r3.html) +- [[C++] std::formatあるいは{fmt}のコンパイル時フォーマット文字列チェックの魔術 - 地面を見下ろす少年の足蹴にされる私](https://onihusube.hatenablog.com/entry/2021/07/01/195912) +- [P2418R2 Add support for `std::generator`-like types to `std::format`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2418r2.html) +- [P3391R2 `constexpr std::format`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3391r2.html) + - C++26から非ロケール版が`constexpr`に対応した diff --git a/reference/format/format_to_n.md b/reference/format/format_to_n.md index b9bc7d7881..248a423185 100644 --- a/reference/format/format_to_n.md +++ b/reference/format/format_to_n.md @@ -12,14 +12,26 @@ namespace std { format_to_n(Out out, iter_difference_t n, format_string fmt, - Args&&... args); // (1) + Args&&... args); // (1) C++20 + template + constexpr format_to_n_result + format_to_n(Out out, + iter_difference_t n, + format_string fmt, + Args&&... args); // (1) C++26 template format_to_n_result format_to_n(Out out, iter_difference_t n, wformat_string fmt, - Args&&... args); // (2) + Args&&... args); // (2) C++20 + template + constexpr format_to_n_result + format_to_n(Out out, + iter_difference_t n, + wformat_string fmt, + Args&&... args); // (2) C++26 template format_to_n_result @@ -27,7 +39,7 @@ namespace std { iter_difference_t n, const locale& loc, format_string fmt, - Args&&... args); // (3) + Args&&... args); // (3) C++20 template format_to_n_result @@ -35,7 +47,7 @@ namespace std { iter_difference_t n, const locale& loc, wformat_string fmt, - Args&&... args); // (4) + Args&&... args); // (4) C++20 } ``` * format_string[link basic_format_string.md] @@ -214,8 +226,10 @@ format_to_n_result format_to_n(Out out, iter_difference_t n, const loc ## 参照 -* [Working Draft, Standard for Programming Language C++ [format]](https://timsong-cpp.github.io/cppwp/format) -* [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) -* [P2216R3 std::format improvements](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2216r3.html) -* [[C++] std::formatあるいは{fmt}のコンパイル時フォーマット文字列チェックの魔術 - 地面を見下ろす少年の足蹴にされる私](https://onihusube.hatenablog.com/entry/2021/07/01/195912) -* [P2418R2 Add support for `std::generator`-like types to `std::format`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2418r2.html) +- [Working Draft, Standard for Programming Language C++ [format]](https://timsong-cpp.github.io/cppwp/format) +- [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) +- [P2216R3 std::format improvements](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2216r3.html) +- [[C++] std::formatあるいは{fmt}のコンパイル時フォーマット文字列チェックの魔術 - 地面を見下ろす少年の足蹴にされる私](https://onihusube.hatenablog.com/entry/2021/07/01/195912) +- [P2418R2 Add support for `std::generator`-like types to `std::format`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2418r2.html) +- [P3391R2 `constexpr std::format`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3391r2.html) + - C++26から非ロケール版が`constexpr`に対応した diff --git a/reference/format/formatted_size.md b/reference/format/formatted_size.md index 5680ed13e2..96919e1ba5 100644 --- a/reference/format/formatted_size.md +++ b/reference/format/formatted_size.md @@ -8,16 +8,34 @@ ```cpp namespace std { template - size_t formatted_size(format_string fmt, Args&&... args); // (1) + size_t + formatted_size(format_string fmt, + Args&&... args); // (1) C++20 + template + constexpr size_t + formatted_size(format_string fmt, + Args&&... args); // (1) C++26 template - size_t formatted_size(wformat_string fmt, Args&&... args); // (2) + size_t + formatted_size(wformat_string fmt, + Args&&... args); // (2) C++20 + template + constexpr size_t + formatted_size(wformat_string fmt, + Args&&... args); // (2) C++26 template - size_t formatted_size(const locale& loc, format_string fmt, Args&&... args); // (3) + size_t + formatted_size(const locale& loc, + format_string fmt, + Args&&... args); // (3) C++20 template - size_t formatted_size(const locale& loc, wformat_string fmt, Args&&... args); // (4) + size_t + formatted_size(const locale& loc, + wformat_string fmt, + Args&&... args); // (4) C++20 } ``` * format_string[link basic_format_string.md] @@ -143,8 +161,10 @@ size_t formatted_size(const locale& loc, wformat_string fmt, const Args ## 参照 -* [Working Draft, Standard for Programming Language C++ [format]](https://timsong-cpp.github.io/cppwp/format) -* [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) -* [P2216R3 std::format improvements](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2216r3.html) -* [[C++] std::formatあるいは{fmt}のコンパイル時フォーマット文字列チェックの魔術 - 地面を見下ろす少年の足蹴にされる私](https://onihusube.hatenablog.com/entry/2021/07/01/195912) -* [P2418R2 Add support for `std::generator`-like types to `std::format`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2418r2.html) +- [Working Draft, Standard for Programming Language C++ [format]](https://timsong-cpp.github.io/cppwp/format) +- [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) +- [P2216R3 std::format improvements](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2216r3.html) +- [[C++] std::formatあるいは{fmt}のコンパイル時フォーマット文字列チェックの魔術 - 地面を見下ろす少年の足蹴にされる私](https://onihusube.hatenablog.com/entry/2021/07/01/195912) +- [P2418R2 Add support for `std::generator`-like types to `std::format`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2418r2.html) +- [P3391R2 `constexpr std::format`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3391r2.html) + - C++26から非ロケール版が`constexpr`に対応した diff --git a/reference/format/make_format_args.md b/reference/format/make_format_args.md index 6b189c1dab..4f4484a98a 100644 --- a/reference/format/make_format_args.md +++ b/reference/format/make_format_args.md @@ -8,10 +8,18 @@ ```cpp namespace std { template - format_arg_store make_format_args(Args&&... args); // (1) + format_arg_store + make_format_args(Args&&... args); // (1) C++20 + template + constexpr format_arg_store + make_format_args(Args&&... args); // (1) C++26 template - format_arg_store make_wformat_args(Args&&... args); // (2) + format_arg_store + make_wformat_args(Args&&... args); // (2) C++20 + template + constexpr format_arg_store + make_wformat_args(Args&&... args); // (2) C++26 } ``` * format_arg_store[italic] diff --git a/reference/format/range-default-formatter.md b/reference/format/range-default-formatter.md index 5b6a59c4f2..24ecc0f397 100644 --- a/reference/format/range-default-formatter.md +++ b/reference/format/range-default-formatter.md @@ -95,3 +95,5 @@ namespace std { - [P2286R8 Formatting Ranges](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2286r8.html) - [P2585R1 Improve default container formatting](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2585r1.html) - C++23から、Range・コンテナ、`pair`、`tuple`のフォーマット出力、および文字・文字列のデバッグ指定 (`"?"`) が追加された +- [P3391R2 `constexpr std::format`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3391r2.html) + - C++26から`constexpr`に対応した \ No newline at end of file diff --git a/reference/format/range_formatter/format.md b/reference/format/range_formatter/format.md index b8857df948..47d316b264 100644 --- a/reference/format/range_formatter/format.md +++ b/reference/format/range_formatter/format.md @@ -10,7 +10,12 @@ template requires formattable, charT> && same_as>, T> typename FormatContext::iterator - format(R&& r, FormatContext& ctx) const; // (1) + format(R&& r, FormatContext& ctx) const; // (1) C++23 +template + requires formattable, charT> && + same_as>, T> +constexpr typename FormatContext::iterator + format(R&& r, FormatContext& ctx) const; // (1) C++26 ``` * FormatContext[link /reference/format/basic_format_context.md] * ranges::input_range[link /reference/ranges/input_range.md] @@ -44,3 +49,8 @@ typename FormatContext::iterator - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3391R2 `constexpr std::format`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3391r2.html) + - C++26から`constexpr`に対応した \ No newline at end of file diff --git a/reference/format/runtime-format-string.md b/reference/format/runtime-format-string.md index cfbbcd18b4..6c15e789ba 100644 --- a/reference/format/runtime-format-string.md +++ b/reference/format/runtime-format-string.md @@ -13,7 +13,7 @@ private: basic_string_view str; // 説明用 public: - runtime-format-string(basic_string_view s) noexcept : str(s) {} + constexpr runtime-format-string(basic_string_view s) noexcept : str(s) {} runtime-format-string(const runtime-format-string&) = delete; const runtime-format-string& operator=(const runtime-format-string&) = delete; @@ -48,3 +48,4 @@ std::string s = std::format(std::runtime_format(fmt), "Hello"); ## 参照 - [P2918R2 Runtime format strings II](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2918r2.html) +- [P3391R2 `constexpr std::format`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3391r2.html) diff --git a/reference/format/runtime_format.md b/reference/format/runtime_format.md index 754b96924d..4d9af6758d 100644 --- a/reference/format/runtime_format.md +++ b/reference/format/runtime_format.md @@ -6,10 +6,10 @@ ```cpp namespace std { - runtime-format-string + constexpr runtime-format-string runtime_format(string_view fmt) noexcept; // (1) C++26 - runtime-format-string + constexpr runtime-format-string runtime_format(wstring_view fmt) noexcept; // (2) C++26 } ``` @@ -66,3 +66,4 @@ Hello ## 参照 - [P2918R2 Runtime format strings II](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2918r2.html) +- [P3391R2 `constexpr std::format`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3391r2.html) diff --git a/reference/format/vformat.md b/reference/format/vformat.md index 06b2389e4d..3ecbc595be 100644 --- a/reference/format/vformat.md +++ b/reference/format/vformat.md @@ -7,13 +7,29 @@ ```cpp namespace std { - string vformat(string_view fmt, format_args args); // (1) - - wstring vformat(wstring_view fmt, wformat_args args); // (2) - - string vformat(const locale& loc, string_view fmt, format_args args); // (3) - - wstring vformat(const locale& loc, wstring_view fmt, wformat_args args); // (4) + string + vformat(string_view fmt, + format_args args); // (1) C++20 + constexpr string + vformat(string_view fmt, + format_args args); // (1) C++26 + + wstring + vformat(wstring_view fmt, + wformat_args args); // (2) C++20 + constexpr wstring + vformat(wstring_view fmt, + wformat_args args); // (2) C++26 + + string + vformat(const locale& loc, + string_view fmt, + format_args args); // (3) C++20 + + wstring + vformat(const locale& loc, + wstring_view fmt, + wformat_args args); // (4) C++20 } ``` * string[link /reference/string/basic_string.md] @@ -114,5 +130,7 @@ string vformat(const locale& loc, wstring_view fmt, wformat_args args) { ## 参照 -* [Working Draft, Standard for Programming Language C++ [format]](https://timsong-cpp.github.io/cppwp/format) -* [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) +- [Working Draft, Standard for Programming Language C++ [format]](https://timsong-cpp.github.io/cppwp/format) +- [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) +- [P3391R2 `constexpr std::format`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3391r2.html) + - C++26から非ロケール版が`constexpr`に対応した diff --git a/reference/format/vformat_to.md b/reference/format/vformat_to.md index 75e3bb91ee..6225397727 100644 --- a/reference/format/vformat_to.md +++ b/reference/format/vformat_to.md @@ -8,16 +8,40 @@ ```cpp namespace std { template - Out vformat_to(Out out, string_view fmt, format_args args); // (1) + Out + vformat_to(Out out, + string_view fmt, + format_args args); // (1) C++20 + template + constexpr Out + vformat_to(Out out, + string_view fmt, + format_args args); // (1) C++26 template - Out vformat_to(Out out, wstring_view fmt, wformat_args args); // (2) + Out + vformat_to(Out out, + wstring_view fmt, + wformat_args args); // (2) C++20 + template + constexpr Out + vformat_to(Out out, + wstring_view fmt, + wformat_args args); // (2) C++26 template - Out vformat_to(Out out, const locale& loc, string_view fmt, format_args args); // (3) + Out + vformat_to(Out out, + const locale& loc, + string_view fmt, + format_args args); // (3) C++20 template - Out vformat_to(Out out, const locale& loc, wstring_view fmt, wformat_args args); // (4) + Out + vformat_to(Out out, + const locale& loc, + wstring_view fmt, + wformat_args args); // (4) C++20 } ``` * wstring_view[link /reference/string_view/basic_string_view.md] @@ -170,5 +194,7 @@ Out vformat_to(Out out, std::string_view fmt, std::basic_format_args ar ## 参照 -* [Working Draft, Standard for Programming Language C++ [format]](https://timsong-cpp.github.io/cppwp/format) -* [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) +- [Working Draft, Standard for Programming Language C++ [format]](https://timsong-cpp.github.io/cppwp/format) +- [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) +- [P3391R2 `constexpr std::format`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3391r2.html) + - C++26から非ロケール版が`constexpr`に対応した From 5c2a94897cbc69d72c7ccf9571fb2a5c2986c58d Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 20 Jan 2026 16:36:33 +0900 Subject: [PATCH 2577/3948] =?UTF-8?q?execution:=20P3815R1=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C=20(#1573)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/execution/execution.md | 2 + reference/execution/execution/associate.md | 130 +++++++++--------- .../execution/execution/association-t.md | 36 +++++ .../execution/execution/counting_scope.md | 2 + .../execution/counting_scope/disassociate.md | 4 +- .../execution/counting_scope/token.md | 2 +- .../counting_scope/token/disassociate.md | 47 ------- .../counting_scope/token/try_associate.md | 4 +- .../execution/counting_scope/try-associate.md | 7 +- .../execution/execution/scope_association.md | 59 ++++++++ reference/execution/execution/scope_token.md | 8 +- .../execution/simple_counting_scope.md | 2 + .../simple_counting_scope/disassociate.md | 4 +- .../execution/simple_counting_scope/token.md | 2 +- .../token/disassociate.md | 47 ------- .../token/try_associate.md | 4 +- .../simple_counting_scope/try-associate.md | 7 +- reference/execution/execution/spawn.md | 32 ++--- reference/execution/execution/spawn_future.md | 26 ++-- 19 files changed, 211 insertions(+), 214 deletions(-) create mode 100644 reference/execution/execution/association-t.md delete mode 100644 reference/execution/execution/counting_scope/token/disassociate.md create mode 100644 reference/execution/execution/scope_association.md delete mode 100644 reference/execution/execution/simple_counting_scope/token/disassociate.md diff --git a/reference/execution/execution.md b/reference/execution/execution.md index 2ab3e65ddf..01db84a7c0 100644 --- a/reference/execution/execution.md +++ b/reference/execution/execution.md @@ -171,6 +171,7 @@ Senderコンシューマは名前空間 `std::this_thread` および名前空間 | 名前 | 説明 | 対応バージョン | |------|------|----------------| +| [`execution::scope_association`](execution/scope_association.md) | 非同期スコープの関連付け (concept) | C++26 | | [`execution::scope_token`](execution/scope_token.md) | 非同期スコープトークン (concept) | C++26 | | [`execution::simple_counting_scope`](execution/simple_counting_scope.md) | カウント式非同期スコープ (class) | C++26 | | [`execution::counting_scope`](execution/counting_scope.md) | 停止要求可能なカウント式非同期スコープ (class) | C++26 | @@ -200,3 +201,4 @@ Senderコンシューマは名前空間 `std::this_thread` および名前空間 - [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) - [P3570R2 optional variants in sender/receiver](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3570r2.html) - [P3682R0 Remove `std::execution::split`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3682r0.pdf) +- [P3815R1 Add `scope_association` concept to P3149](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3815r1.html) diff --git a/reference/execution/execution/associate.md b/reference/execution/execution/associate.md index ff4ac5f41e..4a57dfec76 100644 --- a/reference/execution/execution/associate.md +++ b/reference/execution/execution/associate.md @@ -83,57 +83,53 @@ namespace std::execution { ```cpp [](Sndr&& sndr, Rcvr& rcvr) noexcept(see below) { - auto [_, data] = std::forward(sndr); - auto dataParts = std::move(data).release(); + auto&& [_, data] = std::forward(sndr); - using scope_tkn = decltype(dataParts->first); - using wrap_sender = decltype(dataParts->second); - using op_t = connect_result_t; + using associate_data_t = remove_cvref_t; + using assoc_t = associate_data_t::assoc-t; + using sender_ref_t = associate_data_t::sender-ref; + + using op_t = connect_result_t; struct op_state { - bool associated = false; // exposition only + assoc_t assoc; // exposition only union { Rcvr* rcvr; // exposition only - struct { - scope_tkn token; // exposition only - op_t op; // exposition only - } assoc; // exposition only + op_t op; // exposition only }; - explicit op_state(Rcvr& r) noexcept - : rcvr(addressof(r)) {} - - explicit op_state(scope_tkn tkn, wrap_sender&& sndr, Rcvr& r) try - : associated(true), - assoc(tkn, connect(std::move(sndr), std::move(r))) { - } - catch (...) { - tkn.disassociate(); - throw; + explicit op_state(pair parts, Rcvr& r) + : assoc(std::move(parts.first)) { + if (assoc) { + ::new (voidify(op)) op_t(connect(std::move(*parts.second), std::move(r))); + } else { + rcvr = addressof(r); + } } + explicit op_state(associate_data_t&& ad, Rcvr& r) + : op_state(std::move(ad).release(), r) {} + + explicit op_state(const associate_data_t& ad, Rcvr& r) + requires copy_constructible + : op_state(associate_data_t(ad).release(), r) {} + op_state(op_state&&) = delete; ~op_state() { - if (associated) { - assoc.op.~op_t(); - assoc.token.disassociate(); - assoc.token.~scope_tkn(); - } + if (assoc) + op.~op_t(); } void run() noexcept { // exposition only - if (associated) - start(assoc.op); + if (assoc) + start(op); else set_stopped(std::move(*rcvr)); } }; - if (dataParts) - return op_state{std::move(dataParts->first), std::move(dataParts->second), rcvr}; - else - return op_state{rcvr}; + return op_state{rcvr}; } ``` * connect_result_t[link connect_result_t.md] @@ -147,12 +143,12 @@ namespace std::execution { `impls-for::get-state`の`noexcept`節の式は、型`wrap-sender`を[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`>::wrap-sender`としたとき、下記の通り。 ```cpp -is_nothrow_constructible_v, Sndr> && -is_nothrow_move_constructible_v && +(is_same_v || + is_nothrow_constructible_v, Sndr>) && nothrow-callable ``` +* is_same_v[link /reference/type_traits/is_same.md] * is_nothrow_constructible_v[link /reference/type_traits/is_nothrow_constructible.md] -* is_nothrow_move_constructible_v[link /reference/type_traits/is_nothrow_move_constructible.md] * connect_t[link connect.md] * nothrow-callable[link /reference/functional/nothrow-callable.md] @@ -174,29 +170,40 @@ namespace std::execution { struct associate-data { // exposition only using wrap-sender = // exposition only remove_cvref_t().wrap(declval()))>; + using assoc-t = // exposition only + decltype(declval().try_associate()); + using sender-ref = // exposition only + unique_ptr; explicit associate-data(Token t, Sender&& s) : sndr(t.wrap(std::forward(s))), - token(t) { - if (!token.try_associate()) - sndr.reset(); - } + assoc([&] { + sender-ref guard{addressof(sndr)}; + auto assoc = t.try_associate(); + if (assoc) { + guard.release(); + } + return assoc; + }()) {} associate-data(const associate-data& other) noexcept(is_nothrow_copy_constructible_v && - noexcept(other.token.try_associate())); + noexcept(other.assoc.try_associate())); associate-data(associate-data&& other) - noexcept(is_nothrow_move_constructible_v); + noexcept(is_nothrow_move_constructible_v) + : associate-data(std::move(other).release()) {} ~associate-data(); - optional> - release() && noexcept(is_nothrow_move_constructible_v); + pair release() && noexcept; private: - optional sndr; // exposition only - Token token; // exposition only + associate-data(pair parts); // exposition only + union { + wrap-sender sndr; // exposition only + }; + assoc-t assoc; // exposition only }; template @@ -205,53 +212,39 @@ namespace std::execution { ``` * scope_token[link scope_token.md] * sender[link sender.md] +* destroy_at[link /reference/memory/destroy_at.md] * is_nothrow_copy_constructible_v[link /reference/type_traits/is_nothrow_copy_constructible.md] * is_nothrow_move_constructible_v[link /reference/type_traits/is_nothrow_move_constructible.md] -* optional[link /reference/optional/optional.md] -* reset()[link /reference/optional/optional/reset.md] -`associate-data`型のオブジェクト`a`に対して、関連付けが正常に行われかつ`a`により所有される場合に限って、`a.sndr.`[`has_value()`](/reference/optional/optional/has_value.md)は`true`となる。 +`associate-data`型のオブジェクト`a`に対して、関連付けが正常に行われかつ`a`により所有される場合に限って、`bool(a.assoc)`は`true`となる。 ```cpp associate-data(const associate-data& other) noexcept(is_nothrow_copy_constructible_v && - noexcept(other.token.try_associate())); + noexcept(other.assoc.try_associate())); ``` * is_nothrow_copy_constructible_v[link /reference/type_traits/is_nothrow_copy_constructible.md] -- テンプレートパラメータ制約 : [`copy_constructible`](/reference/concepts/copy_constructible.md)` == true` -- 効果 : `sndr`を値初期化し、`token`を`other.token`で初期化する。`other.sndr.`[`has_value()`](/reference/optional/optional/has_value.md) `== false`ならば、それ以上の効果を持たない。そうでなければ、`token.try_associate()`を呼び出し、戻り値が`true`ならば`sndr.`[`emplace`](/reference/optional/optional/emplace.md)`(*other.sndr)`を呼び出し、例外で終了するときは例外を伝播させる前に`token.disassociate()`を呼び出す。 +- テンプレートパラメータ制約 : `wrap-sender`は[`copy_constructible`](/reference/concepts/copy_constructible.md)のモデルである。 +- 効果 : `assoc`を`other.assoc.try_associate()`で初期化する。`bool(assoc)`が`true`ならば、`sndr`を`other.sndr`で初期化する。 ```cpp -associate-data(associate-data&& other) - noexcept(is_nothrow_move_constructible_v); +associate-data(pair parts); ``` -* is_nothrow_move_constructible_v[link /reference/type_traits/is_nothrow_move_constructible.md] -- 効果 : `sndr`を[`std::move`](/reference/utility/move.md)`(other.sndr)`で、`token`を`std::move(otehr.token)`で初期化したのち、`other.sndr.`[`reset()`](/reference/optional/optional/reset.md)を呼び出す。 +- 効果 : `assoc`を[`std::move`](/reference/utility/move.md)`(parts.first)`で初期化する。`bool(assoc)`が`true`ならば、`sndr`を`std::move(*parts.second)`で初期化する。 ```cpp ~associate-data(); ``` -- 効果 : `sndr.`[`has_value()`](/reference/optional/optional/has_value.md)が`false`を返すとき、何もしない。そうでなければ、`token.disassociate()`呼び出しの前に`sndr.`[`reset()`](/reference/optional/optional/reset.md)を呼び出す。 +- 効果 : `bool(assoc)`が`true`ならば、`sndr`を破棄する。 ```cpp -optional> - release() && noexcept(is_nothrow_move_constructible_v); +pair release() && noexcept; ``` -* optional[link /reference/optional/optional.md] -* is_nothrow_move_constructible_v[link /reference/type_traits/is_nothrow_move_constructible.md] - -- 効果 : `sndr.`[`has_value()`](/reference/optional/optional/has_value.md)が`false`を返すとき、値を保持しない[`optional`](/reference/optional/optional.md)を返す。そうでなければ、次のように[`pair`](/reference/utility/pair.md)``型の値を保持する`optional`を返す。 - - ```cpp - return optional(pair(token, std::move(*sndr))); - ``` - * optional[link /reference/optional/optional.md] - * std::move[link /reference/utility/move.md] -- 事後条件 : `sndr`は値を保持しない。 +- 効果 : `bool(assoc)`が`true`ならば[`addressof`](/reference/memory/addressof.md)`(sndr)`で、そうでなければ`nullptr`で初期化された`sender-ref`型のオブジェクト`u`を構築し、[`pair`](/reference/utility/pair.md)`{std::move(assoc), std::move(u)}`を返す。 ## カスタマイゼーションポイント @@ -319,3 +312,4 @@ value=42 - [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) - [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) +- [P3815R1 Add `scope_association` concept to P3149](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3815r1.html) diff --git a/reference/execution/execution/association-t.md b/reference/execution/execution/association-t.md new file mode 100644 index 0000000000..f7becb8b28 --- /dev/null +++ b/reference/execution/execution/association-t.md @@ -0,0 +1,36 @@ +# association-t +* execution[meta header] +* class template[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] +* [meta exposition-only] + +```cpp +template +struct association-t; +``` + +## 概要 +`association-t`は、実行制御ライブラリの仕様定義で用いられる説明専用のクラステンプレートである。 + +`association-t`の特殊化は[`scope_association`](scope_association.md)のモデルであり、`Scope*`型の説明専用メンバ`scope`を含む。クラス型`Scope`と`association-t`型のオブジェクト`assoc`に対して、 + +- `assoc.scope`は[関連スコープ](scope_association.md)を指す。 +- `assoc.scope != nullptr`のとき、`assoc`は有効(engaged)である。 +- `assoc`が有効(engaged)ならば、`assoc.try_associate()`は`assoc.scope->try-associate()`と等価である。 +- `assoc`により所有される関連は、`assoc.scope->disassociate()`呼び出しによって解放される。 + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`execution::scope_association`](scope_association.md) +- [`execution::simple_counting_scope`](simple_counting_scope.md) +- [`execution::counting_scope`](simple_counting_scope.md) + + +## 参照 +- [P3815R1 Add `scope_association` concept to P3149](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3815r1.html) diff --git a/reference/execution/execution/counting_scope.md b/reference/execution/execution/counting_scope.md index 7e8d4fcb53..bbabbdbf38 100644 --- a/reference/execution/execution/counting_scope.md +++ b/reference/execution/execution/counting_scope.md @@ -36,6 +36,7 @@ namespace std::execution { | 名前 | 説明 | 対応バージョン | |------|------|----------------| +| `assoc-t` | [`association-t`](association-t.md)``(説明専用) | C++26 | | [`token`](counting_scope/token.md) | 非同期スコープトークン型 | C++26 | ## 静的メンバ変数 @@ -62,3 +63,4 @@ namespace std::execution { ## 参照 - [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) +- [P3815R1 Add `scope_association` concept to P3149](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3815r1.html) diff --git a/reference/execution/execution/counting_scope/disassociate.md b/reference/execution/execution/counting_scope/disassociate.md index 8d94cfda63..4d84248a4d 100644 --- a/reference/execution/execution/counting_scope/disassociate.md +++ b/reference/execution/execution/counting_scope/disassociate.md @@ -4,14 +4,14 @@ * counting_scope[meta class] * function[meta id-type] * cpp26[meta cpp] +* [meta exposition-only] ```cpp -void disassociate() noexcept; // exposition only +void disassociate() noexcept; ``` ## 概要 非同期スコープとの関連付けを解除する、説明専用のメンバ関数。 -非同期トークン型[`token`](token.md)の[`disassociate`](token/disassociate.md)メンバ動作を定義する。 ## 事前条件 diff --git a/reference/execution/execution/counting_scope/token.md b/reference/execution/execution/counting_scope/token.md index 222650238e..25a987cba7 100644 --- a/reference/execution/execution/counting_scope/token.md +++ b/reference/execution/execution/counting_scope/token.md @@ -26,7 +26,6 @@ namespace std::execution { |------|------|----------------| | [`wrap`](token/wrap.md) | 非同期スコープと[Sender](../sender.md)を関連付けたSenderを返す | C++26 | | [`try_associate`](token/try_associate.md) | 非同期スコープとの関連付けを試行 | C++26 | -| [`disassociate`](token/disassociate.md) | 非同期スコープとの関連付けを解除 | C++26 | ## バージョン @@ -46,3 +45,4 @@ namespace std::execution { ## 参照 - [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) +- [P3815R1 Add `scope_association` concept to P3149](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3815r1.html) diff --git a/reference/execution/execution/counting_scope/token/disassociate.md b/reference/execution/execution/counting_scope/token/disassociate.md deleted file mode 100644 index 47f9b12a8c..0000000000 --- a/reference/execution/execution/counting_scope/token/disassociate.md +++ /dev/null @@ -1,47 +0,0 @@ -# disassociate -* execution[meta header] -* function[meta id-type] -* std::execution[meta namespace] -* counting_scope::token[meta class] -* cpp26[meta cpp] - -```cpp -void disassociate() const noexcept; -``` - -## 概要 -非同期スコープとの関連付けを解除する。 - - -## 効果 -下記と等価。 - -```cpp -scope->disassociate() -``` -* disassociate[link ../disassociate.md] - - -## 例外 -投げない - - -## バージョン -### 言語 -- C++26 - -### 処理系 -- [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? -- [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? - - -## 関連項目 -- [`execution::associate`](../../associate.md) -- [`execution::spawn_future`](../../spawn_future.md) -- [`execution::spawn`](../../spawn.md) - - -## 参照 -- [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) diff --git a/reference/execution/execution/counting_scope/token/try_associate.md b/reference/execution/execution/counting_scope/token/try_associate.md index d57181cc08..9f6d8a1131 100644 --- a/reference/execution/execution/counting_scope/token/try_associate.md +++ b/reference/execution/execution/counting_scope/token/try_associate.md @@ -6,8 +6,9 @@ * cpp26[meta cpp] ```cpp -bool try_associate() const noexcept; +assoc-t try_associate() const noexcept; ``` +* assoc-t[link ../../counting_scope.md] ## 概要 非同期スコープとの関連付けを試行する。 @@ -45,3 +46,4 @@ return scope->try-associate(); ## 参照 - [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) +- [P3815R1 Add `scope_association` concept to P3149](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3815r1.html) diff --git a/reference/execution/execution/counting_scope/try-associate.md b/reference/execution/execution/counting_scope/try-associate.md index 592fb90b96..e4cd788c47 100644 --- a/reference/execution/execution/counting_scope/try-associate.md +++ b/reference/execution/execution/counting_scope/try-associate.md @@ -4,10 +4,12 @@ * counting_scope[meta class] * function[meta id-type] * cpp26[meta cpp] +* [meta exposition-only] ```cpp -bool try-associate() noexcept; // exposition only +assoc-t try-associate() noexcept; // exposition only ``` +* assoc-t[link ../counting_scope.md] ## 概要 非同期スコープとの関連付けを試行する、説明専用のメンバ関数。 @@ -24,7 +26,7 @@ bool try-associate() noexcept; // exposition only ## 戻り値 -`count`がインクリメントされたとき、`true`を返す。それ以外のときは、`false`を返す。 +`count`がインクリメントされたとき、`*this`に関連付けられた有効(engaged)な[`assoc-t`](../counting_scope.md)型のオブジェクトを返す。それ以外のときは、`assoc-t()`を返す。 ## 例外 @@ -38,3 +40,4 @@ bool try-associate() noexcept; // exposition only ## 参照 - [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) +- [P3815R1 Add `scope_association` concept to P3149](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3815r1.html) diff --git a/reference/execution/execution/scope_association.md b/reference/execution/execution/scope_association.md new file mode 100644 index 0000000000..1cd6ea5962 --- /dev/null +++ b/reference/execution/execution/scope_association.md @@ -0,0 +1,59 @@ +# scope_association +* execution[meta header] +* concept[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::execution { + template + concept scope_association = + movable && + is_nothrow_move_constructible_v && + is_nothrow_move_assignable_v && + default_initializable && + requires(const Assoc assoc) { + { static_cast(assoc) } noexcept; + { assoc.try_associate() } -> same_as; + }; +} +``` +* movable[link /reference/concepts/movable.md] +* is_nothrow_move_constructible_v[link /reference/type_traits/is_nothrow_move_constructible.md] +* is_nothrow_move_assignable_v[link /reference/type_traits/is_nothrow_move_assignable.md] + +## 概要 +`scope_association`コンセプトは、型`Assoc`に対する要件を定義する。関連スコープ(associated scope)と呼ばれる非同期スコープとの関連付けを所有するときに限って、`Assoc`型のオブジェクトは有効(engaged)である。 + + +## モデル +型`Assoc`は、次のとき`scope_association`のモデルとなる。 + +- デフォルト構築された`Assoc`型オブジェクトは有効でない(not engaged)。 +- `Assoc`型のオブジェクト`assoc`に対して、`static_cast(assoc)`が`true`のときに限って`assoc`は有効(engaged)である。 +- 同一の関連付けを所有する`Assoc`型の2つのオブジェクトは存在しない。 +- `Assoc`型のオブジェクト`assoc`に対して、`assoc`の破棄は(もしあれば)`assoc`により所有される関連付けを解放する。 +- `Assoc`型のオブジェクト`assoc`に対して、ムーブ構築のソースオペランドとして使われた後、`assoc`は有効でない(not engaged)。 +- `Assoc`型の異なるオブジェクト`assoc1`と`assoc2`に対して、`assoc1 = std::move(assoc2)`を評価した後、(もしあれば)`assoc1`により所有される関連付けは解放され、`assoc2`は有効でない(not engaged)。 +- `Assoc`型の有効な(engaged)オブジェクト`assoc`に対して、`assoc.try_associate()`は有効でない(not engaged)オブジェクト、もしくは`assoc`の関連スコープとの新しい関連付けを取得して関連付けを所有する有効な(engaged)オブジェクトのいずれかを返す。 +- `Assoc`型の有効でない(not engaged)オブジェクト`assoc`に対して、`assoc.try_associate()`は有効でない(not engaged)オブジェクトを返す。 + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`execution::scope_token`](scope_token.md) + + +## 参照 +- [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) +- [P3815R1 Add `scope_association` concept to P3149](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3815r1.html) diff --git a/reference/execution/execution/scope_token.md b/reference/execution/execution/scope_token.md index 1a47563f37..761fea1fad 100644 --- a/reference/execution/execution/scope_token.md +++ b/reference/execution/execution/scope_token.md @@ -10,19 +10,20 @@ namespace std::execution { concept scope_token = copyable && requires(const Token token) { - { token.try_associate() } -> same_as; - { token.disassociate() } noexcept -> same_as; + { token.try_associate() } -> scope_association; { token.wrap(declval()) } -> sender_in; }; } ``` * copyable[link /reference/concepts/copyable.md] +* scope_association[link scope_association.md] * sender_in[link sender_in.md] * test-sender[italic] * test-env[italic] ## 概要 `scope_token`コンセプトは、[Sender](sender.md)と非同期スコープ間の関連付けを作成するために利用できる型`Token`に対する要件を定義する。 +`Token`型の各オブジェクトは、[関連スコープ](scope_association.md)と呼ばれる非同期スコープに関連付けられる。 `test-sender`と`test-env`は、[`sender_in`](sender_in.md)``のモデルである未規定の型とする。 @@ -31,6 +32,7 @@ namespace std::execution { 型`Token`は、次のとき`scope_token`のモデルとなる。 - `Token`型オブジェクトのコピー構築、ムーブ構築、コピー代入、ムーブ代入から例外送出しない、かつ +- `Token`型のオブジェクト`token`に対して、`token.try_associate()`は有効でない(not engaged)オブジェクト、もしくは`token`の関連スコープとの新しい関連付けを取得して関連付けを所有する[有効な(engaged)](scope_association.md)オブジェクトのいずれかを返す。 - (const修飾の可能性のある)型`Token`の左辺値`token`が与えられたとき、型`decltype((sndr))`が[`sender`](sender.md)のモデルである全ての式`sndr`に対して、 - `token.warp(sndr)`が有効な式、かつ - `decltype(token.warp(sndr))`は[`sender`](sender.md)のモデルであり、かつ @@ -72,7 +74,9 @@ int main() - [`execution::associate`](associate.md) - [`execution::spawn_future`](spawn_future.md) - [`execution::spawn`](spawn.md) +- [`execution::scope_association`](scope_association.md) ## 参照 - [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) +- [P3815R1 Add `scope_association` concept to P3149](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3815r1.html) diff --git a/reference/execution/execution/simple_counting_scope.md b/reference/execution/execution/simple_counting_scope.md index 5b90d5f38d..9d38de4746 100644 --- a/reference/execution/execution/simple_counting_scope.md +++ b/reference/execution/execution/simple_counting_scope.md @@ -174,6 +174,7 @@ namespace std::execution { | 名前 | 説明 | 対応バージョン | |------|------|----------------| +| `assoc-t` | [`association-t`](association-t.md)``(説明専用) | C++26 | | [`token`](simple_counting_scope/token.md) | 非同期スコープトークン型 | C++26 | ## 静的メンバ変数 @@ -200,3 +201,4 @@ namespace std::execution { ## 参照 - [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) +- [P3815R1 Add `scope_association` concept to P3149](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3815r1.html) diff --git a/reference/execution/execution/simple_counting_scope/disassociate.md b/reference/execution/execution/simple_counting_scope/disassociate.md index 380f5e7af7..8ccd58f501 100644 --- a/reference/execution/execution/simple_counting_scope/disassociate.md +++ b/reference/execution/execution/simple_counting_scope/disassociate.md @@ -4,14 +4,14 @@ * simple_counting_scope[meta class] * function[meta id-type] * cpp26[meta cpp] +* [meta exposition-only] ```cpp -void disassociate() noexcept; // exposition only +void disassociate() noexcept; ``` ## 概要 非同期スコープとの関連付けを解除する、説明専用のメンバ関数。 -非同期トークン型[`token`](token.md)の[`disassociate`](token/disassociate.md)メンバ動作を定義する。 ## 事前条件 diff --git a/reference/execution/execution/simple_counting_scope/token.md b/reference/execution/execution/simple_counting_scope/token.md index 1542b149d8..4a6b70e6ef 100644 --- a/reference/execution/execution/simple_counting_scope/token.md +++ b/reference/execution/execution/simple_counting_scope/token.md @@ -26,7 +26,6 @@ namespace std::execution { |------|------|----------------| | [`wrap`](token/wrap.md) | 非同期スコープと[Sender](../sender.md)を関連付けたSenderを返す | C++26 | | [`try_associate`](token/try_associate.md) | 非同期スコープとの関連付けを試行 | C++26 | -| [`disassociate`](token/disassociate.md) | 非同期スコープとの関連付けを解除 | C++26 | ## バージョン @@ -46,3 +45,4 @@ namespace std::execution { ## 参照 - [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) +- [P3815R1 Add `scope_association` concept to P3149](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3815r1.html) diff --git a/reference/execution/execution/simple_counting_scope/token/disassociate.md b/reference/execution/execution/simple_counting_scope/token/disassociate.md deleted file mode 100644 index e91a100c78..0000000000 --- a/reference/execution/execution/simple_counting_scope/token/disassociate.md +++ /dev/null @@ -1,47 +0,0 @@ -# disassociate -* execution[meta header] -* function[meta id-type] -* std::execution[meta namespace] -* simple_counting_scope::token[meta class] -* cpp26[meta cpp] - -```cpp -void disassociate() const noexcept; -``` - -## 概要 -非同期スコープとの関連付けを解除する。 - - -## 効果 -下記と等価。 - -```cpp -scope->disassociate() -``` -* disassociate[link ../disassociate.md] - - -## 例外 -投げない - - -## バージョン -### 言語 -- C++26 - -### 処理系 -- [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? -- [ICC](/implementation.md#icc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? - - -## 関連項目 -- [`execution::associate`](../../associate.md) -- [`execution::spawn_future`](../../spawn_future.md) -- [`execution::spawn`](../../spawn.md) - - -## 参照 -- [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) diff --git a/reference/execution/execution/simple_counting_scope/token/try_associate.md b/reference/execution/execution/simple_counting_scope/token/try_associate.md index 492633f611..4cca10c258 100644 --- a/reference/execution/execution/simple_counting_scope/token/try_associate.md +++ b/reference/execution/execution/simple_counting_scope/token/try_associate.md @@ -6,8 +6,9 @@ * cpp26[meta cpp] ```cpp -bool try_associate() const noexcept; +assoc-t try_associate() const noexcept; ``` +* assoc-t[link ../../simple_counting_scope.md] ## 概要 非同期スコープとの関連付けを試行する。 @@ -45,3 +46,4 @@ return scope->try-associate(); ## 参照 - [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) +- [P3815R1 Add `scope_association` concept to P3149](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3815r1.html) diff --git a/reference/execution/execution/simple_counting_scope/try-associate.md b/reference/execution/execution/simple_counting_scope/try-associate.md index e297576f76..b7f2d7806a 100644 --- a/reference/execution/execution/simple_counting_scope/try-associate.md +++ b/reference/execution/execution/simple_counting_scope/try-associate.md @@ -4,10 +4,12 @@ * simple_counting_scope[meta class] * function[meta id-type] * cpp26[meta cpp] +* [meta exposition-only] ```cpp -bool try-associate() noexcept; // exposition only +assoc-t try-associate() noexcept; // exposition only ``` +* assoc-t[link ../simple_counting_scope.md] ## 概要 非同期スコープとの関連付けを試行する、説明専用のメンバ関数。 @@ -24,7 +26,7 @@ bool try-associate() noexcept; // exposition only ## 戻り値 -`count`がインクリメントされたとき、`true`を返す。それ以外のときは、`false`を返す。 +`count`がインクリメントされたとき、`*this`に関連付けられた有効(engaged)な[`assoc-t`](../simple_counting_scope.md)型のオブジェクトを返す。それ以外のときは、`assoc-t()`を返す。 ## 例外 @@ -38,3 +40,4 @@ bool try-associate() noexcept; // exposition only ## 参照 - [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) +- [P3815R1 Add `scope_association` concept to P3149](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3815r1.html) diff --git a/reference/execution/execution/spawn.md b/reference/execution/execution/spawn.md index 51bc762ba6..71d20cf3a7 100644 --- a/reference/execution/execution/spawn.md +++ b/reference/execution/execution/spawn.md @@ -72,17 +72,17 @@ namespace std::execution { spawn-state(Alloc alloc, Sender&& sndr, Token token); // exposition only void complete() noexcept override; // exposition only - void run(); // exposition only + void run() noexcept; // exposition only private: using alloc-t = // exposition only typename allocator_traits::template rebind_alloc; + using assoc-t = // exposition only + remove_cvref_t().try_associate())>; alloc-t alloc; // exposition only op-t op; // exposition only - Token token; // exposition only - - void destroy() noexcept; // exposition only + assoc-t assoc; // exposition only }; } ``` @@ -97,7 +97,7 @@ namespace std::execution { spawn-state(Alloc alloc, Sender&& sndr, Token token); ``` -- 効果 : メンバ変数`alloc`を引数`alloc`で、メンバ変数`token`を引数`token`で、`op`を下記で初期化する。 +- 効果 : メンバ変数`alloc`を[`std::move`](/reference/utility/move.md)`(alloc)`で、メンバ変数`assoc`を`token.try_associate()`で、メンバ変数`op`を下記で初期化する。 ```cpp connect(std::move(sndr), spawn-receiver(this)) @@ -106,16 +106,16 @@ spawn-state(Alloc alloc, Sender&& sndr, Token token); * std::move[link /reference/utility/move.md] ```cpp -void run(); +void run() noexcept; ``` - 効果 : 下記と等価 ```cpp - if (token.try_associate()) + if (assoc) start(op); else - destroy(); + complete(); ``` * start[link start.md] @@ -123,23 +123,10 @@ void run(); void complete() noexcept override; ``` -- 効果 : 下記と等価 - - ```cpp - auto token = std::move(this->token); - - destroy(); - token.disassociate(); - ``` - * std::move[link /reference/utility/move.md] - -```cpp -void destroy() noexcept; -``` - - 効果 : 下記と等価 ```cpp + auto assoc = std::move(this->assoc); auto alloc = std::move(this->alloc); allocator_traits::destroy(alloc, this); @@ -215,3 +202,4 @@ sync_wait ## 参照 - [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) +- [P3815R1 Add `scope_association` concept to P3149](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3815r1.html) diff --git a/reference/execution/execution/spawn_future.md b/reference/execution/execution/spawn_future.md index d52b976294..e2ad235a03 100644 --- a/reference/execution/execution/spawn_future.md +++ b/reference/execution/execution/spawn_future.md @@ -173,9 +173,8 @@ namespace std::execution { op(connect( write_env(stop-when(std::forward(sndr), ssource.get_token()), std::move(env)), receiver-t(this))), - token(std::move(token)), - associated(token.try_associate()) { - if (associated) + assoc(token.try_associate()) { + if (assoc) start(op); else set_stopped(receiver-t(this)); @@ -188,12 +187,13 @@ namespace std::execution { private: using alloc-t = // exposition only typename allocator_traits::template rebind_alloc; + using assoc-t = // exposition only + remove_cvref_t().try_associate())>; alloc-t alloc; // exposition only ssource-t ssource; // exposition only op-t op; // exposition only - Token token; // exposition only - bool associated; // exposition only + assoc-t assoc; // exposition only void destroy() noexcept; // exposition only }; @@ -268,18 +268,11 @@ void destroy() noexcept; - 効果 : 下記と等価。 ```cpp - auto token = std::move(this->token); - bool associated = this->associated; + bool assoc = std::move(this->assoc); + auto alloc = std::move(this->alloc); - { - auto alloc = std::move(this->alloc); - - allocator_traits::destroy(alloc, this); - allocator_traits::deallocate(alloc, this, 1); - } - - if (associated) - token.disassociate(); + allocator_traits::destroy(alloc, this); + allocator_traits::deallocate(alloc, this, 1); ``` * allocator_traits[link /reference/memory/allocator_traits.md] * destroy[link /reference/memory/allocator_traits/destroy.md] @@ -359,3 +352,4 @@ value=42 ## 参照 - [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) +- [P3815R1 Add `scope_association` concept to P3149](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3815r1.html) From 493bccd46ba980de924ee3211efc1012128506ae Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 20 Jan 2026 18:16:30 +0900 Subject: [PATCH 2578/3948] =?UTF-8?q?execution/as=5Fawaitable:=20LWG4358,4?= =?UTF-8?q?360=E9=81=A9=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/execution/execution/as_awaitable.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/reference/execution/execution/as_awaitable.md b/reference/execution/execution/as_awaitable.md index 0d039abede..c64ac4db5d 100644 --- a/reference/execution/execution/as_awaitable.md +++ b/reference/execution/execution/as_awaitable.md @@ -37,8 +37,7 @@ Promise型`p`をもつコルーチンにおいて、Await式`co_await as_awaitab - 適格であるならば、式`expr.as_awaitable(p)` - 適格要件 : 同式の型を`A`としたとき、[`is-awaitable`](../is-awaitable.md)` == true`であるべき。 -- そうではなく、説明用の型`U`を`Promise`とは異なりかつ`await_transform`メンバ関数を持たない未規定の型としたとき、[`is-awaitable`](../is-awaitable.md)` == true`ならば、式`(void(p), expr)` - - 事前条件 : [`is-awaitable`](../is-awaitable.md)` == true`、かつPromise型`U`のコルーチンにおける式`co_await expr`がPromise型`Promise`のコルーチンにおける同式と等しさを保持すること。 +- そうではなく、`decltype(`[`GET-AWAITER`](../is-awaitable.md)`(expr))`が[`is-awaiter`](../is-awaitable.md)``を満たすならば、式`(void(p), expr)` - そうではなく、説明用の式`adapted-expr`を`expr`が1回だけ評価されることを除いて[`get_await_completion_adaptor`](get_await_completion_adaptor.md)`(`[`get_env`](get_env.md)`(expr))(expr)`としたとき、`has-queryable-await-completion-adaptor`と`awaitable-sender`が共に満たされるならば、式`sender-awaitable{adapted-expr, p}` - そうではなく、`awaitable-sender`ならば、式`sender-awaitable{expr, p}` - そうでなければ、式`(void(p), expr)` @@ -51,7 +50,7 @@ namespace std::execution { template concept awaitable-sender = single-sender> && - sender_to && // see below + sender_to::awaitable-receiver> && // see below requires (Promise& p) { { p.unhandled_stopped() } -> convertible_to>; }; @@ -238,3 +237,5 @@ value-type await_resume(); - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) - [P3396R1 std::execution wording fixes](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3396r1.html) - [P3570R2 optional variants in sender/receiver](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3570r2.html) +- [LWG4358 §[exec.as.awaitable] is using "Preconditions:" when it should probably be described in the constraint](https://cplusplus.github.io/LWG/issue4358) +- [LWG4360 `awaitable-sender` concept should qualify use of `awaitable-receiver` type](https://cplusplus.github.io/LWG/issue4360) From 3eec057fe5968d1c3841086de3d2c71d3196342a Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 20 Jan 2026 18:44:18 +0900 Subject: [PATCH 2579/3948] =?UTF-8?q?execution/stop-when:=20LWG4461?= =?UTF-8?q?=E9=81=A9=E7=94=A8+=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/execution/execution/stop-when.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/reference/execution/execution/stop-when.md b/reference/execution/execution/stop-when.md index f1dcc62b24..fbe73234f5 100644 --- a/reference/execution/execution/stop-when.md +++ b/reference/execution/execution/stop-when.md @@ -3,6 +3,7 @@ * cpo[meta id-type] * std::execution[meta namespace] * cpp26[meta cpp] +* [meta exposition-only] ```cpp namespace std::execution { @@ -16,9 +17,9 @@ namespace std::execution { 説明用の式`sndr`と`token`に対して、 -- `decltype((sndr))`が[`sender`](sender.md)を満たさない、もしくは[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``が[`stoppable_token`](/reference/stop_token/stoppable_token.md)を満たさないとき、式`stop-token(sndr, token)`は不適格となる。 -- そうでなく、[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``が[`unstoppable_token`](/reference/stop_token/unstoppable_token.md)のモデルであるとき、式`stop-token(sndr, token)`は`sndr`と等価となる。 -- そうでないとき、式`stop-token(sndr, token)`はSender`osndr`を返す。`osndr`が[Receiver](receiver.md)`r`と[接続(connect)](connect.md)されるとき、[`get_stop_token`](../get_stop_token.md)`(`[`get_env`](get_env.md)`(r))`の結果を`rtoken`とする。 +- `decltype((sndr))`が[`sender`](sender.md)を満たさない、もしくは[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``が[`stoppable_token`](/reference/stop_token/stoppable_token.md)を満たさないとき、式`stop-when(sndr, token)`は不適格となる。 +- そうでなく、[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``が[`unstoppable_token`](/reference/stop_token/unstoppable_token.md)のモデルであるとき、式`stop-when(sndr, token)`は、`token`と`sndr`が不定順で順序付けられることを除いて、`(void)token, sndr`と等価となる。 +- そうでないとき、式`stop-when(sndr, token)`はSender`osndr`を返す。`osndr`が[Receiver](receiver.md)`r`と[接続(connect)](connect.md)されるとき、[`get_stop_token`](../get_stop_token.md)`(`[`get_env`](get_env.md)`(r))`の結果を`rtoken`とする。 - `rtoken`の型が[`unstoppable_token`](/reference/stop_token/unstoppable_token.md)のモデルであるとき、`osdnr`と`r`との接続の効果は[`connect`](connect.md)`(`[`write_env`](write_env.md)`(sndr,` [`prop`](prop.md)`(`[`get_stop_token`](../get_stop_token.md)`, token)), r)`に等しい。 - そうでないとき、下記のような説明専用の型`stoken-t`の`stoken`オブジェクトに対して、`osdnr`と`r`との接続の効果は[`connect`](connect.md)`(`[`write_env`](write_env.md)`(sndr,` [`prop`](prop.md)`(`[`get_stop_token`](../get_stop_token.md)`, stoken)), r)`に等しい。 - `stoken-t`は[`stoppable_token`](/reference/stop_token/stoppable_token.md)のモデルである。 @@ -39,3 +40,4 @@ namespace std::execution { ## 参照 - [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) +- [LWG4461 `stop-when` needs to evaluate unstoppable tokens](https://cplusplus.github.io/LWG/issue4461) From 282ded36fb7a175086b88757a5f62c3e611d784b Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 20 Jan 2026 18:45:38 +0900 Subject: [PATCH 2580/3948] =?UTF-8?q?execution/then:=20LWG4369=E9=81=A9?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/execution/execution/then.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/reference/execution/execution/then.md b/reference/execution/execution/then.md index 9d2ed1c674..96220a2f3c 100644 --- a/reference/execution/execution/then.md +++ b/reference/execution/execution/then.md @@ -75,7 +75,7 @@ namespace std::execution { ```cpp auto cs = get_completion_signatures, FWD-ENV-T(Env)...>(); -auto fn = [](set_value_t(*)(Ts...)) { +auto fn = [](decayed-typeof(*)(Ts...)) { if constexpr (!invocable>, Ts...>) throw unspecified-exception(); }; @@ -84,10 +84,10 @@ cs.for-each(overload-set{fn, [](auto){}}); * get_completion_signatures[link get_completion_signatures.md] * child-type[link child-type.md] * FWD-ENV-T[link ../forwarding_query.md] -* set_value_t[link set_value.md] * data-type[link data-type.md] * for-each[link completion_signatures.md] * overload-set[link overload-set.md] +* set-cpo[italic] `unspecified-exception`は[`exception`](/reference/exception/exception.md)から派生した型となる。 @@ -163,3 +163,4 @@ C++ - [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) - [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) +- [LWG4369 `check-types` function for `upon_error` and `upon_stopped` is wrong](https://cplusplus.github.io/LWG/issue4369) From 4e312efd9499dce77b24254a115578ba6ee8fd40 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 20 Jan 2026 18:46:24 +0900 Subject: [PATCH 2581/3948] =?UTF-8?q?execution/completion=5Fsignatures:=20?= =?UTF-8?q?LWG4448=E9=81=A9=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/execution/execution/completion_signatures.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reference/execution/execution/completion_signatures.md b/reference/execution/execution/completion_signatures.md index 3340499dd4..315c58a66d 100644 --- a/reference/execution/execution/completion_signatures.md +++ b/reference/execution/execution/completion_signatures.md @@ -13,7 +13,7 @@ namespace std::execution { template static constexpr void for-each(Fn&& fn) { // exposition only - (std::forward(fn)(static_cast(nullptr)), ...); + (fn(static_cast(nullptr)), ...); } }; } @@ -99,3 +99,4 @@ int main() ## 参照 - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) - [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) +- [LWG4448 Do not forward `fn` in `completion_signatures`](https://cplusplus.github.io/LWG/issue4448) From 44cd4073f6fb5f064c1547bbcc658e24263baed4 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 20 Jan 2026 18:47:13 +0900 Subject: [PATCH 2582/3948] =?UTF-8?q?execution:=20LWG=204447,4455,4456,445?= =?UTF-8?q?9=E9=81=A9=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/execution/execution/basic-sender.md | 5 ++++- reference/execution/execution/impls-for.md | 3 ++- reference/execution/execution/make-sender.md | 4 +++- reference/execution/execution/single-sender-value-type.md | 6 ++++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/reference/execution/execution/basic-sender.md b/reference/execution/execution/basic-sender.md index fdc4fba0c1..040b32870e 100644 --- a/reference/execution/execution/basic-sender.md +++ b/reference/execution/execution/basic-sender.md @@ -3,6 +3,7 @@ * class template[meta id-type] * std::execution[meta namespace] * cpp26[meta cpp] +* [meta exposition-only] ```cpp namespace std::execution { @@ -62,9 +63,10 @@ is_nothrow_constructible_v, Self, Rcvr> ### `get_completion_signatures`メンバ関数 ```cpp template -template +template Sndr, class... Env> constexpr auto basic-sender::get_completion_signatures(); ``` +* decays-to[link ../decays-to.md] 型`E`をリスト`Env...,` [`env<>`](env.md)における先頭の型としたとき、[環境](../queryable.md)`E`をもつ[Receiver](receiver.md)型を`Rcvr`とする。式`CHECK-TYPE()`を[`impls-for`](impls-for.md)`::template check-types()`とし、型`CS`を下記の通り定義する。 @@ -106,3 +108,4 @@ using indices-for = remove_reference_t::indices-for; // exposition only - [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) - [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) +- [LWG4455 Add missing constraint to `basic-sender::get_completion_signatures` definition](https://cplusplus.github.io/LWG/issue4455) diff --git a/reference/execution/execution/impls-for.md b/reference/execution/execution/impls-for.md index 72f754f837..33c705a1b2 100644 --- a/reference/execution/execution/impls-for.md +++ b/reference/execution/execution/impls-for.md @@ -127,7 +127,7 @@ static consteval void default-impls::check-types(); 効果:下記と等価。 ```cpp -(get_completion_signatures, FWD-ENV-T(Env)...>(), ...); +((void)get_completion_signatures, FWD-ENV-T(Env)...>(), ...); ``` * get_completion_signatures[link get_completion_signatures.md] * child-type[link child-type.md] @@ -149,3 +149,4 @@ static consteval void default-impls::check-types(); - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) - [P3433R1 Allocator Support for Operation States](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3433r1.pdf) - [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) +- [LWG4459 Protect `get_completion_signatures` fold expression from overloaded commas](https://cplusplus.github.io/LWG/issue4459) diff --git a/reference/execution/execution/make-sender.md b/reference/execution/execution/make-sender.md index d0c93010a6..bb95422340 100644 --- a/reference/execution/execution/make-sender.md +++ b/reference/execution/execution/make-sender.md @@ -3,6 +3,7 @@ * function template[meta id-type] * std::execution[meta namespace] * cpp26[meta cpp] +* [meta exposition-only] ```cpp template @@ -25,7 +26,7 @@ constexpr auto make-sender(Tag tag, Data&& data, Child&&... child); - [`semiregular`](/reference/concepts/semiregular.md)`` - [`movable-value`](../movable-value.md)`` - `(`[`sender`](sender.md)` && ...)` -- 型`Sndr`を[`basic-sender`](basic-sender.md)``としたとき、[`dependent_sender`](dependent_sender.md)` ||` [`sender_in`](sender_in.md)`` +- 型`Sndr`を[`basic-sender`](basic-sender.md)`, decay_t...>`としたとき、[`dependent_sender`](dependent_sender.md)` ||` [`sender_in`](sender_in.md)`` ## 戻り値 @@ -51,3 +52,4 @@ constexpr auto make-sender(Tag tag, Data&& data, Child&&... child); - [P2999R3 Sender Algorithm Customization](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2999r3.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) - [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) +- [LWG4456 Decay `Data` and `Child` in `make-sender`](https://cplusplus.github.io/LWG/issue4456) diff --git a/reference/execution/execution/single-sender-value-type.md b/reference/execution/execution/single-sender-value-type.md index bf02548815..454ad9b16f 100644 --- a/reference/execution/execution/single-sender-value-type.md +++ b/reference/execution/execution/single-sender-value-type.md @@ -3,16 +3,17 @@ * type-alias[meta id-type] * std::execution[meta namespace] * cpp26[meta cpp] +* [meta exposition-only] ```cpp template -using single-sender-value-type = see below; // exposition only +using single-sender-value-type = see below; ``` ## 概要 `single-sender-value-type`は、実行制御ライブラリの仕様定義で用いられる説明専用のエイリアステンプレートである。 -型`Sndr`と型パック`Env`に対して、`CS`を[`completion_signatures_of_t`](completion_signatures_of_t.md)``とする。`CS`が不適格または`sizeof...(Env) > 1`のとき、`single-sender-value-type`は不適格となる。 +型`Sndr`と型パック`Env`に対して、`CS`を[`completion_signatures_of_t`](completion_signatures_of_t.md)``とする。`CS`が不適格なとき、`single-sender-value-type`は不適格となる。 そうでなければ、`single-sender-value-type`は下記のエイリアスとなる。 @@ -35,3 +36,4 @@ using single-sender-value-type = see below; // exposition only ## 参照 - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) - [P3557R3 High-Quality Sender Diagnostics with Constexpr Exceptions](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3557r3.html) +- [LWG4447 Remove unnecessary `sizeof...(Env) > 1` condition](https://cplusplus.github.io/LWG/issue4447) From 705ba616f84d10ca1dd9512ee8f1a08aa53f6b0b Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 20 Jan 2026 19:25:40 +0900 Subject: [PATCH 2583/3948] =?UTF-8?q?execution:=20P3914R0=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - US 209-332 - US 228-348 - US 263-396 - US 265-398 and US 266-399 --- reference/execution/execution/bulk_chunked.md | 3 +- .../execution/decay-copyable-result-datums.md | 4 +-- reference/execution/execution/let_value.md | 2 +- reference/execution/execution/not-a-sender.md | 4 +-- reference/execution/execution/read_env.md | 2 +- reference/execution/execution/spawn_future.md | 4 ++- .../execution/stopped_as_optional.md | 3 +- .../parallel_scheduler_backend/schedule.md | 3 +- .../schedule_bulk_chunked.md | 3 +- .../schedule_bulk_unchunked.md | 3 +- .../query_parallel_scheduler_backend.md | 4 ++- reference/execution/execution/then.md | 3 +- .../execution/unspecified-exception.md | 35 +++++++++++++++++++ reference/execution/execution/when_all.md | 4 +-- 14 files changed, 58 insertions(+), 19 deletions(-) create mode 100644 reference/execution/execution/unspecified-exception.md diff --git a/reference/execution/execution/bulk_chunked.md b/reference/execution/execution/bulk_chunked.md index 33242087fa..50c47ff400 100644 --- a/reference/execution/execution/bulk_chunked.md +++ b/reference/execution/execution/bulk_chunked.md @@ -102,11 +102,10 @@ cs.for-each(overload-set{fn, [](auto){}}); * FWD-ENV-T[link ../forwarding_query.md] * set_value_t[link set_value.md] * data-type[link data-type.md] +* unspecified-exception[link unspecified-exception.md] * for-each[link completion_signatures.md] * overload-set[link overload-set.md] -`unspecified-exception`は[`exception`](/reference/exception/exception.md)から派生した型となる。 - ## カスタマイゼーションポイント Senderアルゴリズム構築時および[Receiver](receiver.md)接続時に、関連付けられた実行ドメインに対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 diff --git a/reference/execution/execution/decay-copyable-result-datums.md b/reference/execution/execution/decay-copyable-result-datums.md index 56d244f5f0..c87d03c94e 100644 --- a/reference/execution/execution/decay-copyable-result-datums.md +++ b/reference/execution/execution/decay-copyable-result-datums.md @@ -3,6 +3,7 @@ * function template[meta id-type] * std::execution[meta namespace] * cpp26[meta cpp] +* [meta exposition-only] ```cpp constexpr void decay-copyable-result-datums(auto cs) { @@ -14,12 +15,11 @@ constexpr void decay-copyable-result-datums(auto cs) { ``` * for-each[link completion_signatures.md] * is_constructible_v[link /reference/type_traits/is_constructible.md] +* unspecified-exception[link unspecified-exception.md] ## 概要 `decay-copyable-result-datums`は、Senderアルゴリズム動作仕様定義で用いられる説明専用の関数テンプレートである。 -`unspecified-exception`は[`exception`](/reference/exception/exception.md)から派生した型となる。 - ## バージョン ### 言語 diff --git a/reference/execution/execution/let_value.md b/reference/execution/execution/let_value.md index a21829bfaa..0c6f775a02 100644 --- a/reference/execution/execution/let_value.md +++ b/reference/execution/execution/let_value.md @@ -144,11 +144,11 @@ cs.for-each(overload-set(fn, [](auto){})); * child-type[link child-type.md] * FWD-ENV-T[link ../forwarding_query.md] * decayed-typeof[link /reference/functional/decayed-typeof.md] +* unspecified-exception[link unspecified-exception.md] * for-each[link completion_signatures.md] * overload-set[link overload-set.md] * set-cpo[italic] -`unspecified-exception`は[`exception`](/reference/exception/exception.md)から派生した型となる。 説明用の変数`is-valid-let-sender`は下記を全て満たす時に限って`true`となる。 - `(`[`constructible_from`](/reference/concepts/constructible_from.md)`, Ts> &&...)` diff --git a/reference/execution/execution/not-a-sender.md b/reference/execution/execution/not-a-sender.md index 78020fec35..49f06ffe66 100644 --- a/reference/execution/execution/not-a-sender.md +++ b/reference/execution/execution/not-a-sender.md @@ -3,6 +3,7 @@ * class[meta id-type] * std::execution[meta namespace] * cpp26[meta cpp] +* [meta exposition-only] ```cpp struct not-a-sender { @@ -17,12 +18,11 @@ struct not-a-sender { * sender_t[link sender.md] * get_completion_signatures[link get_completion_signatures.md] * completion_signatures[link completion_signatures.md] +* unspecified-exception[link unspecified-exception.md] ## 概要 `not-a-sender`は、Senderアルゴリズム動作仕様定義で用いられる説明専用のクラスである。 -`unspecified-exception`は[`exception`](/reference/exception/exception.md)から派生した型となる。 - ## バージョン ### 言語 diff --git a/reference/execution/execution/read_env.md b/reference/execution/execution/read_env.md index 0f8bf78263..f97a4c2e41 100644 --- a/reference/execution/execution/read_env.md +++ b/reference/execution/execution/read_env.md @@ -46,7 +46,7 @@ namespace std::execution { * get_env[link get_env.md] 型`Q`を[`decay_t`](/reference/type_traits/decay.md)`<`[`data-type`](data-type.md)`>`とする。 -`Env`型の左辺値`env`に対して式`Q()(env)`が不適格もしくは`void`型をもつとき、メンバ関数`check-types`は[`exception`](/reference/exception/exception.md)から派生した未規定の型を例外として送出する。 +`Env`型の左辺値`env`に対して式`Q()(env)`が不適格もしくは`void`型をもつとき、メンバ関数`check-types`は[`unspecified-exception`](unspecified-exception.md)型の例外を送出する。 ## 備考 diff --git a/reference/execution/execution/spawn_future.md b/reference/execution/execution/spawn_future.md index e2ad235a03..14fb18c541 100644 --- a/reference/execution/execution/spawn_future.md +++ b/reference/execution/execution/spawn_future.md @@ -141,7 +141,8 @@ namespace std::execution { * exception_ptr[link /reference/exception/exception_ptr.md] * current_exception()[link /reference/exception/current_exception.md] -型`ssource-t`を[`stoppable-source`](/reference/stop_token/stoppable-source.md)のモデルである未規定の型、`ssource`を型`ssource-t`の左辺値とする。 +型`ssource-t`を[`stoppable-source`](/reference/stop_token/stoppable-source.md)および[`default_initializable`](/reference/concepts/default_initializable.md)のモデルである未規定の型とし、型`ssource-t`のデフォルト構築オブジェクトは関連付けられた停止状態を持つ。 +`ssource`を型`ssource-t`の左辺値とする。 型`stoken-t`を`decltype(ssource.get_token())`とする。 ### エイリアステンプレート `future-spawned-sender` @@ -353,3 +354,4 @@ value=42 ## 参照 - [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) - [P3815R1 Add `scope_association` concept to P3149](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3815r1.html) +- [P3914R0 Assorted NB comment resolutions for Kona 2025](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3914r0.html), US 228-348 diff --git a/reference/execution/execution/stopped_as_optional.md b/reference/execution/execution/stopped_as_optional.md index b47597b8f3..c834809fba 100644 --- a/reference/execution/execution/stopped_as_optional.md +++ b/reference/execution/execution/stopped_as_optional.md @@ -51,8 +51,7 @@ namespace std::execution { * single-sender-value-type[link single-sender-value-type.md] * child-type[link child-type.md] * FWD-ENV-T[link ../forwarding_query.md] - -`unspecified-exception`は[`exception`](/reference/exception/exception.md)から派生した型となる。 +* unspecified-exception[link unspecified-exception.md] 説明用の式`sndr`と`env`に対して、型`Sndr`を`decltype((sndr))`、型`Env`を`decltype((env))`とする。[`sender-for`](sender-for.md)` == false`のとき、式`stopped_as_optional.transform_sender(sndr, env)`は不適格となる。 diff --git a/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/schedule.md b/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/schedule.md index 56b1a53f99..de26de4c82 100644 --- a/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/schedule.md +++ b/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/schedule.md @@ -17,7 +17,7 @@ virtual void schedule(receiver_proxy& r, span s) noexcept = 0; ## 事前条件 -`*this`, `r`が参照するオブジェクト, `s`が参照するストレージの生存期間終了は、下記いずれか式の評価開始よりも後に発生(happen after)すること。 +`*this`、`r`が参照するオブジェクト、`s`が参照するストレージの生存期間終了は、`r`に対する[`set_value`](../../set_value.md)/[`set_error`](../../set_error.md)/[`set_stopped`](../../set_stopped.md)いずれかの呼び出しの評価開始よりも後に発生(happen after)すること。 ## 効果 @@ -52,3 +52,4 @@ virtual void schedule(receiver_proxy& r, span s) noexcept = 0; ## 参照 - [P2079R10 Parallel scheduler](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2079r10.html) +- [P3914R0 Assorted NB comment resolutions for Kona 2025](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3914r0.html), US 265-398, 266-399 diff --git a/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/schedule_bulk_chunked.md b/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/schedule_bulk_chunked.md index 809730d137..d5da8d4d01 100644 --- a/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/schedule_bulk_chunked.md +++ b/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/schedule_bulk_chunked.md @@ -19,7 +19,7 @@ virtual void schedule_bulk_chunked(size_t n, ## 事前条件 -`*this`, `r`が参照するオブジェクト, `s`が参照するストレージの生存期間終了は、下記いずれか式の評価開始よりも後に発生(happen after)すること。 +`*this`、`r`が参照するオブジェクト、`s`が参照するストレージの生存期間終了は、`r`に対する[`set_value`](../../set_value.md)/[`set_error`](../../set_error.md)/[`set_stopped`](../../set_stopped.md)いずれかの呼び出しの評価開始よりも後に発生(happen after)すること。 ## 効果 @@ -58,3 +58,4 @@ virtual void schedule_bulk_chunked(size_t n, ## 参照 - [P2079R10 Parallel scheduler](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2079r10.html) +- [P3914R0 Assorted NB comment resolutions for Kona 2025](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3914r0.html), US 265-398, 266-399 diff --git a/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/schedule_bulk_unchunked.md b/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/schedule_bulk_unchunked.md index b85483f7d9..65b572f1ad 100644 --- a/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/schedule_bulk_unchunked.md +++ b/reference/execution/execution/system_context_replaceability/parallel_scheduler_backend/schedule_bulk_unchunked.md @@ -19,7 +19,7 @@ virtual void schedule_bulk_unchunked(size_t n, ## 事前条件 -`*this`, `r`が参照するオブジェクト, `s`が参照するストレージの生存期間終了は、下記いずれか式の評価開始よりも後に発生(happen after)すること。 +`*this`、`r`が参照するオブジェクト、`s`が参照するストレージの生存期間終了は、`r`に対する[`set_value`](../../set_value.md)/[`set_error`](../../set_error.md)/[`set_stopped`](../../set_stopped.md)いずれかの呼び出しの評価開始よりも後に発生(happen after)すること。 ## 効果 @@ -57,3 +57,4 @@ virtual void schedule_bulk_unchunked(size_t n, ## 参照 - [P2079R10 Parallel scheduler](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2079r10.html) +- [P3914R0 Assorted NB comment resolutions for Kona 2025](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3914r0.html), US 265-398, 266-399 diff --git a/reference/execution/execution/system_context_replaceability/query_parallel_scheduler_backend.md b/reference/execution/execution/system_context_replaceability/query_parallel_scheduler_backend.md index 767d18c884..e146984940 100644 --- a/reference/execution/execution/system_context_replaceability/query_parallel_scheduler_backend.md +++ b/reference/execution/execution/system_context_replaceability/query_parallel_scheduler_backend.md @@ -16,7 +16,8 @@ namespace std::execution::system_context_replaceability { ## 効果 -[`parallel_scheduler_backend`](parallel_scheduler_backend.md)インタフェースを実装したオブジェクトを指す非ヌル[`shared_ptr`](/reference/memory/shared_ptr.md)を返す。 +オブジェクト`p`は、`p.get()`がその生存期間内に最派生オブジェクト`o`基底クラスの部分オブジェクトである[`parallel_scheduler_backend`](parallel_scheduler_backend.md)オブジェクトを指すものとする。 +その存続期間内に`q.`[`owner_equal`](/reference/memory/shared_ptr/owner_equal.md.nolink)`(p)`が`true`となる[`shared_ptr`](/reference/memory/shared_ptr.md)オブジェクト`q`が存在する限り、`o`の存続期間は終了しない。 ## 備考 @@ -41,3 +42,4 @@ namespace std::execution::system_context_replaceability { ## 参照 - [P2079R10 Parallel scheduler](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2079r10.html) +- [P3914R0 Assorted NB comment resolutions for Kona 2025](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3914r0.html), US 263-396 diff --git a/reference/execution/execution/then.md b/reference/execution/execution/then.md index 96220a2f3c..15240a0fbb 100644 --- a/reference/execution/execution/then.md +++ b/reference/execution/execution/then.md @@ -85,12 +85,11 @@ cs.for-each(overload-set{fn, [](auto){}}); * child-type[link child-type.md] * FWD-ENV-T[link ../forwarding_query.md] * data-type[link data-type.md] +* unspecified-exception[link unspecified-exception.md] * for-each[link completion_signatures.md] * overload-set[link overload-set.md] * set-cpo[italic] -`unspecified-exception`は[`exception`](/reference/exception/exception.md)から派生した型となる。 - ## カスタマイゼーションポイント Senderアルゴリズム構築時および[Receiver](receiver.md)接続時に、関連付けられた実行ドメインに対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 diff --git a/reference/execution/execution/unspecified-exception.md b/reference/execution/execution/unspecified-exception.md new file mode 100644 index 0000000000..23972caff8 --- /dev/null +++ b/reference/execution/execution/unspecified-exception.md @@ -0,0 +1,35 @@ +# unspecified-exception +* execution[meta header] +* class[meta id-type] +* std::execution[meta namespace] +* cpp26[meta cpp] +* [meta exposition-only] + +```cpp +class unspecified-exception; +``` + +## 概要 +`unspecified-exception`は、実行制御ライブラリの仕様定義で用いられる説明専用の例外型である。 + +例外オブジェクトは未規定の型をもち[`exception`](/reference/exception/exception.md)型の例外ハンドラにはマッチするが、[`dependent_sender_error`](dependent_sender_error.md)型のハンドラにはマッチしない。 + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`execution::read_env`](read_env.md) +- [`execution::then`](then.md) +- [`execution::let_value`](let_value.md) +- [`execution::bulk_chunked`](bulk_chunked.md) +- [`execution::when_all`](when_all.md) +- [`execution::stopped_as_optional`](stopped_as_optional.md) +- [`not-a-sender`](not-a-sender.md) +- [`decay-copyable-result-datums`](decay-copyable-result-datums.md) + + +## 参照 +- [P3914R0 Assorted NB comment resolutions for Kona 2025](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3914r0.html), US 209-332 diff --git a/reference/execution/execution/when_all.md b/reference/execution/execution/when_all.md index ba361dff5d..3af9660188 100644 --- a/reference/execution/execution/when_all.md +++ b/reference/execution/execution/when_all.md @@ -194,11 +194,11 @@ auto fn = []() { * get_completion_signatures[link get_completion_signatures.md] * count-of[link completion_signatures.md] * set_value[link set_value.md] +* unspecified-exception[link unspecified-exception.md] * decay-copyable-result-datums[link decay-copyable-result-datums.md] * child-type[link child-type.md] -`unspecified-exception`は[`exception`](/reference/exception/exception.md)から派生した型となる。 -型`CD`が不適格な場合、[`exception`](/reference/exception/exception.md)から派生した未規定な型を例外として送出する。 +型`CD`が不適格な場合、[`unspecified-exception`](unspecified-exception.md)型の例外を送出する。 ## 説明専用エンティティ From 038d6dce58e4cf9c4faf57fc9653e1d918658188 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 20 Jan 2026 20:10:28 +0900 Subject: [PATCH 2584/3948] =?UTF-8?q?execution:=20P3923R0=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - US 221-339 - US 227-346 and US 229-347 --- .../execution/execution/bulk_unchunked.md | 30 +++++++++++++++++++ reference/execution/execution/spawn.md | 18 +++++------ reference/execution/execution/spawn_future.md | 24 ++++++++------- 3 files changed, 53 insertions(+), 19 deletions(-) diff --git a/reference/execution/execution/bulk_unchunked.md b/reference/execution/execution/bulk_unchunked.md index a460e8c4e3..60a68cd6d0 100644 --- a/reference/execution/execution/bulk_unchunked.md +++ b/reference/execution/execution/bulk_unchunked.md @@ -54,6 +54,9 @@ namespace std::execution { template<> struct impls-for : default-impls { static constexpr auto complete = see below; + + template + static consteval void check-types(); }; } ``` @@ -86,6 +89,32 @@ namespace std::execution { 型`Tag`が[`set_value_t`](set_value.md)以外の型であるとき、もしくは式`f(auto(shape), args...)`が適格なときに限って、上記ラムダ式のrequires節が満たされる。 +```cpp +template +static consteval void check-types(); +``` + +効果 : 以下と等価 + + ```cpp + auto cs = get_completion_signatures, FWD-ENV-T(Env)...>(); + auto fn = [](set_value_t(*)(Ts...)) { + using data_type = data-type; + if constexpr (!invocable&, + remove_cvref_t>, Ts&...>) + throw unspecified-exception(); + }; + cs.for-each(overload-set(fn, [](auto){})); + ``` + * get_completion_signatures[link get_completion_signatures.md] + * child-type[link child-type.md] + * FWD-ENV-T[link ../forwarding_query.md] + * set_value_t[link set_value.md] + * data-type[link data-type.md] + * unspecified-exception[link unspecified-exception.md] + * for-each[link completion_signatures.md] + * overload-set[link overload-set.md] + ## カスタマイゼーションポイント Senderアルゴリズム構築時および[Receiver](receiver.md)接続時に、関連付けられた実行ドメインに対して[`execution::transform_sender`](transform_sender.md)経由でSender変換が行われる。 @@ -157,3 +186,4 @@ int main() - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) - [P2079R10 Parallel scheduler](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2079r10.html) - [P3481R5 `std::execution::bulk()` issues](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3481r5.html) +- [P3923R0 Additional NB comment resolutions for Kona 2025](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3923r0.html), US 221-339 diff --git a/reference/execution/execution/spawn.md b/reference/execution/execution/spawn.md index 71d20cf3a7..4e9ab7ce8c 100644 --- a/reference/execution/execution/spawn.md +++ b/reference/execution/execution/spawn.md @@ -33,7 +33,7 @@ namespace std::execution { 呼び出し式`spawn(sndr, token, env)`は`void`型であり、次の効果をもつ。 -- `alloc`を用いてメモリ確保し、`alloc`, [`write_env`](write_env.md)`(token.wrap(sndr), senv)`, `token`から特殊化された`spawn-state`型のオブジェクト`o`を構築し、`o.run()`を呼び出す。いずれかのオブジェクト構築・破棄時に例外送出されたときは、確保されたメモリが解放される。 +- `alloc`を用いてメモリ確保し、`alloc`, [`write_env`](write_env.md)`(token.wrap(sndr), senv)`, `token`から`decltype(spawn-state(alloc, write_env(token.wrap(sndr), senv), token))`型のオブジェクト`o`を構築し、`o.run()`を呼び出す。いずれかのオブジェクト構築・破棄時に例外送出されたときは、確保されたメモリが解放される。 呼び出し式`spawn(sndr, token)`は、式`spawn(sndr, token,` [`execution::env<>`](env.md)`())`と等価である。 @@ -75,12 +75,10 @@ namespace std::execution { void run() noexcept; // exposition only private: - using alloc-t = // exposition only - typename allocator_traits::template rebind_alloc; using assoc-t = // exposition only remove_cvref_t().try_associate())>; - alloc-t alloc; // exposition only + Alloc alloc; // exposition only op-t op; // exposition only assoc-t assoc; // exposition only }; @@ -89,7 +87,6 @@ namespace std::execution { * scope_token[link scope_token.md] * sender[link sender.md] * connect_result_t[link connect_result_t.md] -* allocator_traits[link /reference/memory/allocator_traits.md] * spawn-state-base[italic] * spawn-receiver[italic] @@ -127,10 +124,12 @@ void complete() noexcept override; ```cpp auto assoc = std::move(this->assoc); - auto alloc = std::move(this->alloc); - - allocator_traits::destroy(alloc, this); - allocator_traits::deallocate(alloc, this, 1); + { + using traits = allocator_traits::template rebind_traits; + typename traits::allocator_type alloc(this->alloc); + traits::destroy(alloc, this); + traits::deallocate(alloc, this, 1); + } ``` * allocator_traits[link /reference/memory/allocator_traits.md] * destroy[link /reference/memory/allocator_traits/destroy.md] @@ -203,3 +202,4 @@ sync_wait ## 参照 - [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) - [P3815R1 Add `scope_association` concept to P3149](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3815r1.html) +- [P3923R0 Additional NB comment resolutions for Kona 2025](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3923r0.html), US 227-346, 229-347 diff --git a/reference/execution/execution/spawn_future.md b/reference/execution/execution/spawn_future.md index 14fb18c541..df9ec183dd 100644 --- a/reference/execution/execution/spawn_future.md +++ b/reference/execution/execution/spawn_future.md @@ -35,7 +35,7 @@ namespace std::execution { 呼び出し式`spawn_future(sndr, token, env)`は、次の効果をもつ。 -- `alloc`を用いてメモリ確保し、`alloc`, `token.wrap(sndr)`, `token`, `senv`から特殊化された`spawn-future-state`型のオブジェクト`s`を構築する。いずれかのオブジェクト構築・破棄時に例外送出されたときは、確保されたメモリが解放される。 +- `alloc`を用いてメモリ確保し、`alloc`, `token.wrap(sndr)`, `token`, `senv`から`decltype(spawn-future-state(alloc, token.wrap(sndr), token, senv))`型のオブジェクト`s`を構築する。いずれかのオブジェクト構築・破棄時に例外送出されたときは、確保されたメモリが解放される。 - 下記を満たす[`unique_ptr`](/reference/memory/unique_ptr.md)の特殊化型のオブジェクト`u`を構築する。 - `u.`[`get()`](/reference/memory/unique_ptr/get.md)は`s`のアドレスに等しく、かつ - `u.`[`get_deleter()`](/reference/memory/unique_ptr/get_deleter.md)`(u.`[`release()`](/reference/memory/unique_ptr/release.md)`)`は`u.release()->abandon()`に等しい。 @@ -186,18 +186,20 @@ namespace std::execution { void abandon() noexcept; // exposition only private: - using alloc-t = // exposition only - typename allocator_traits::template rebind_alloc; using assoc-t = // exposition only remove_cvref_t().try_associate())>; - alloc-t alloc; // exposition only + Alloc alloc; // exposition only ssource-t ssource; // exposition only op-t op; // exposition only assoc-t assoc; // exposition only void destroy() noexcept; // exposition only }; + + template // exposition only + spawn-future-state(Alloc alloc, Sender&& sndr, Token token, Env env) + -> spawn-future-state; } ``` * scope_token[link scope_token.md] @@ -210,7 +212,6 @@ namespace std::execution { * stop-when[link stop-when.md] * start[link start.md] * set_stopped[link set_stopped.md] -* allocator_traits[link /reference/memory/allocator_traits.md] * std::move[link /reference/utility/move.md] データ競合の存在を判定する目的において、`complete`, `consume`, `abandon`はアトミック操作として振る舞う。 @@ -269,11 +270,13 @@ void destroy() noexcept; - 効果 : 下記と等価。 ```cpp - bool assoc = std::move(this->assoc); - auto alloc = std::move(this->alloc); - - allocator_traits::destroy(alloc, this); - allocator_traits::deallocate(alloc, this, 1); + auto associated = std::move(this->associated); + { + using traits = allocator_traits::template rebind_traits; + typename traits::allocator_type alloc(std::move(this->alloc)); + traits::destroy(alloc, this); + traits::deallocate(alloc, this, 1); + } ``` * allocator_traits[link /reference/memory/allocator_traits.md] * destroy[link /reference/memory/allocator_traits/destroy.md] @@ -355,3 +358,4 @@ value=42 - [P3149R11 `async_scope` - Creating scopes for non-sequential concurrency](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3149r11.html) - [P3815R1 Add `scope_association` concept to P3149](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3815r1.html) - [P3914R0 Assorted NB comment resolutions for Kona 2025](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3914r0.html), US 228-348 +- [P3923R0 Additional NB comment resolutions for Kona 2025](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3923r0.html), US 227-346, 229-347 From e37147a2a22c6d74a0e2327d3b478f2af61eb5bf Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 21 Jan 2026 22:43:46 +0900 Subject: [PATCH 2585/3948] =?UTF-8?q?mdspan:=20P3383R3=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=20(#1504)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 2 +- lang/cpp26/feature_test_macros.md | 2 +- reference/mdspan/mdspan.md | 3 ++ reference/mdspan/mdspan/at.md | 89 +++++++++++++++++++++++++++++++ reference/mdspan/mdspan/op_at.md | 5 +- 5 files changed, 97 insertions(+), 4 deletions(-) create mode 100644 reference/mdspan/mdspan/at.md diff --git a/lang/cpp26.md b/lang/cpp26.md index bb2b78b8a0..d201bff02c 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -143,7 +143,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 ### コンテナ - [`std::vector::reference`](/reference/vector/vector.md)のプロキシ操作として、`const`修飾付きの代入と`swap()`メンバ関数を追加 - [`std::mdspan`](/reference/mdspan/mdspan.md)から部分ビューを取り出す[`std::submdspan()`](/reference/mdspan/submdspan.md)を追加 -- [`std::mdspan`](/reference/mdspan/mdspan.md)に、インデックスを指定して要素を取り出す[`at()`](/reference/mdspan/mdspan/at.md.nolink)メンバ関数を追加 +- [`std::mdspan`](/reference/mdspan/mdspan.md)に、インデックスを指定して要素を取り出す[`at()`](/reference/mdspan/mdspan/at.md)メンバ関数を追加 - [`std::mdspan`](/reference/mdspan/mdspan.md)に対する[`std::dextents`](/reference/mdspan/extents.md)指定の冗長さを解決する[`std::dims`](/reference/mdspan/extents.md)を追加 - [`std::mdspan`](/reference/mdspan/mdspan.md)のレイアウトとして、[`std::layout_left_padded`](/reference/mdspan/layout_left_padded.md)と[`std::layout_right_padded`](/reference/mdspan/layout_right_padded.md)を追加 - [``](/reference/mdspan.md)に、要素アクセスにアライメント保証を与える[`std::aligned_accessor`](/reference/mdspan/aligned_accessor.md)を追加 diff --git a/lang/cpp26/feature_test_macros.md b/lang/cpp26/feature_test_macros.md index 017aa79272..e645447ca1 100755 --- a/lang/cpp26/feature_test_macros.md +++ b/lang/cpp26/feature_test_macros.md @@ -145,7 +145,7 @@ |`__cpp_lib_simd_complex`|`202502L`|[``](/reference/simd.md.nolink)が[`std::complex`](/reference/complex/complex.md)をサポートする|[``](/reference/simd.md.nolink)| |`__cpp_lib_simd_permutations`|`202506L`|[``](/reference/simd.md.nolink)に`permute()`などを追加する|[``](/reference/simd.md.nolink)| |`__cpp_lib_smart_ptr_owner_equality`|`202306L`|[``](/reference/memory.md)に[`std::owner_hash`](/reference/memory/owner_hash.md.nolink)と[`std::owner_equal`](/reference/memory/owner_equal.md.nolink)を追加|[``](/reference/memory.md)| -|`__cpp_lib_span`|`202311L`|[`std::mdspan`](/reference/mdspan/mdspan.md)に[`at()`](/reference/mdspan/mdspan/at.md.nolink)メンバ関数を追加|[``](/reference/span.md)| +|`__cpp_lib_span`|`202311L`|[`std::mdspan`](/reference/mdspan/mdspan.md)に[`at()`](/reference/mdspan/mdspan/at.md)メンバ関数を追加|[``](/reference/span.md)| |`__cpp_lib_span_initializer_list`|`202311L`|[`std::span`](/reference/span/span.md)に[`std::initializer_list`](/reference/initializer_list/initializer_list.md)をとるコンストラクタを追加|[``](/reference/span.md)| |`__cpp_lib_sstream_from_string_view`|`202306L`|[`std::basic_stringstream`](/reference/sstream/basic_stringstream.md)などが[`std::basic_string_view`](/reference/string_view/basic_string_view.md)から構築可能に|[``](/reference/sstream.md)| |`__cpp_lib_string_subview`|`202506L`|[`std::basic_string`](/reference/string/basic_string.md)と[`std::basic_string_view`](/reference/string_view/basic_string_view.md)に`subview()`を追加|[``](/reference/string.md), [``](/reference/string_view.md)| diff --git a/reference/mdspan/mdspan.md b/reference/mdspan/mdspan.md index 3a0328a7e7..4c73ca35e5 100644 --- a/reference/mdspan/mdspan.md +++ b/reference/mdspan/mdspan.md @@ -72,6 +72,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`operator[]`](mdspan/op_at.md) | 多次元配列の要素アクセス | C++23 | +| [`at`](mdspan/at.md) | 多次元配列の要素アクセス | C++26 | ### 多次元配列サイズ @@ -189,3 +190,5 @@ int main() - [P2599R2 `index_type` & `size_type` in `mdspan`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2599r2.pdf) - [P2604R0 `mdspan`: rename `pointer` and `contiguous`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2604r0.html) - [P2613R1 Add the missing `empty` to `mdspan`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2613r1.html) +- [P3383R3 mdspan.at()](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3383r3.html) + - C++26で`at`メンバ関数を追加 diff --git a/reference/mdspan/mdspan/at.md b/reference/mdspan/mdspan/at.md new file mode 100644 index 0000000000..cec008b1f1 --- /dev/null +++ b/reference/mdspan/mdspan/at.md @@ -0,0 +1,89 @@ +# at +* mdspan[meta header] +* function template[meta id-type] +* std[meta namespace] +* mdspan[meta class] +* cpp26[meta cpp] + +```cpp +template +constexpr reference at(OtherIndexTypes... indices) const; // (1) + +template +constexpr reference at(span indices) const; // (2) + +template +constexpr reference at(const array& indices) const; // (3) +``` +* rank()[link rank.md] +* span[link /reference/span/span.md] +* array[link /reference/array/array.md] + +## 概要 +多次元インデクスを用いて要素にアクセスする。 + + +## テンプレートパラメータ制約 +- (1) : + - `(`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` && ...)`が`true`、かつ + - `(`[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)` && ...)`が`true`、かつ + - `sizeof...(OtherIndexTypes) ==` [`rank()`](rank.md)が`true`であること +- (2), (3) : + - [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true`、かつ + - [`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)``が`true`であること + + +## 効果 +(1) : 説明用のパック`I`を[`extents_type::index_cast`](../extents/index-cast.md)`(std::move(indices))`として、[`(*this)[I...]`](op_at.md)を返す。 + +(2), (3) : 説明用のパラメータパック`P`が[`is_same_v`](/reference/type_traits/is_same.md)`<`[`make_index_sequence`](/reference/utility/make_index_sequence.md)`<`[`rank()`](rank.md)`>,` [`index_sequence`](/reference/utility/index_sequence.md)`> == true`となるとき、以下と等価 + +```cpp +return at(extents_type::index-cast(as_const(indices[P]))...); +``` +* extents_type::index-cast[link ../extents/index-cast.md] +* as_const[link /reference/utility/as_const.md] + + +## 例外 +(1) : 説明用のパック`I`を[`extents_type::index_cast`](../extents/index-cast.md)`(std::move(indices))`として、`I`が`extents()`の多次元インデクス値でなければ[`out_of_range`](/reference/stdexcept/out_of_range.md)を送出する。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + int arr[] = {1, 2, 3, 4, 5, 6}; + // 静的要素数 2x3 の2次元配列ビュー + std::mdspan> mat{arr}; + + assert(mat.at(0, 0) == 1); + assert(mat.at(1, 2) == 6); +} +``` + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`operator[]`](op_at.md) + + +## 参照 +- [P3383R3 mdspan.at()](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3383r3.html) diff --git a/reference/mdspan/mdspan/op_at.md b/reference/mdspan/mdspan/op_at.md index a09f9ff6df..937c9e8f7e 100644 --- a/reference/mdspan/mdspan/op_at.md +++ b/reference/mdspan/mdspan/op_at.md @@ -67,8 +67,8 @@ int main() // 静的要素数 2x3 の2次元配列ビュー std::mdspan> mat{arr}; - assert(map[0,0] == 1); - assert(map[1,2] == 6); + assert(mat[0,0] == 1); + assert(mat[1,2] == 6); } ``` @@ -90,6 +90,7 @@ int main() ## 関連項目 - C++23 [添字演算子の多次元サポート](/lang/cpp23/multidimensional_subscript_operator.md) +- [`at`](at.md) ## 参照 From fc22862fae620a7c26c4b5012ba6acc025330fc7 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sun, 25 Jan 2026 13:21:21 +0900 Subject: [PATCH 2586/3948] delete: future/contract-based_programming(#1419) --- lang/future/contract-based_programming.md | 269 ---------------------- 1 file changed, 269 deletions(-) delete mode 100644 lang/future/contract-based_programming.md diff --git a/lang/future/contract-based_programming.md b/lang/future/contract-based_programming.md deleted file mode 100644 index e5bdd4e915..0000000000 --- a/lang/future/contract-based_programming.md +++ /dev/null @@ -1,269 +0,0 @@ -# 契約に基づくプログラミング -* future[meta cpp] - -## 概要 -将来のC++では、いわゆる[契約プログラミング](https://ja.wikipedia.org/wiki/%E5%A5%91%E7%B4%84%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%9F%E3%83%B3%E3%82%B0)が検討されている。 - -この機能は一度はC++20のドラフトに取り込まれたが、実装が進む中で問題が見つかり最終的に取り除かれた。現在ではC++26以降を目標に議論されている。 - -以下の内容はC++20で予定されていた仕様に基づいており、最新の案とは異なる。 - -## 例 -```cpp example -#include -#include - -double sqrt_checked(double x) - [[expects: x > 0]] // 引数に対する事前条件 - [[ensures r: r > 0]] // 戻り値に対する事後条件 -{ - return std::sqrt(x); -} - -int main() -{ - double x; - std::cin >> x; - - [[assert: x > 0]]; // アサーション - - double y = sqrt_checked(x); - - std::cout << y << '\n'; -} -``` - -## 仕様 - -### 契約属性 - -契約は[属性](/lang/cpp11/attributes.md)として記述する。C++20では、次の3つの契約属性が導入された: - -* `[[expect: 述語]]`:関数に入る際に期待する事前条件を定義する。 -* `[[ensure: 述語]]`:関数から戻る際に期待する事後条件を定義する。 -* `[[assert: 述語]]`:アサーションを定義する。 - -expectおよびensure属性の述語は、関数の最初の式文と同じセマンティクスで評価される。 -より詳細に言えば、仮引数は見えるがローカル変数は見えない。 - -述語が例外を送出すると、[`std::terminate()`](/reference/exception/terminate.md)関数を呼び出してプログラムを終了させる。 - -述語が副作用を持つ場合、動作は未定義である。例えば、グローバル変数の変更、`volatile`変数の参照、変数を変更する可能性のある関数の呼び出しなどが該当する。 - -```cpp -// P0542R5より引用 -int x; -volatile int y; - -void f(int n) [[expects: n>x]]; // OK -void g(int n) [[expects: n>x++]]; // Undefined behavior -void h(int n) [[expects: n++>0]]; // Undefined behavior -void j() { - int n=3; - [[assert: ++n>3]]; // Undefined behavior - //... -} -void k() [[expects: y>0]]; // Undefined behavior -``` -* P0542R5[link http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0542r5.html] - -```cpp -// P0542R5より引用 -bool might_increment(int & x); - -void f(int n) [[expects: might_increment(n)]]; // Undefined behavior - -bool is_valid(int x) { - std::cerr << "checking x\n"; - return x>0; -} - -void g(int n) [[expects: is_valid(n)]]; // Undefined behavior -``` -* P0542R5[link http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0542r5.html] - -ただし、関数の中で閉じている局所的な副作用は問題ない。 - -```cpp -// P0542R5より引用 -bool is_valid(int x) { - int a=1; - while (a0]] - [[expects audit: is_prime(x)]]; -``` - -C++20では、プログラムのコンパイルは次の3つのうちどれかの**ビルドレベル**で行われる: - -* `off`: 契約はチェックされない。 -* `default`: 契約レベルが`default`の契約がチェックされる。ビルドレベルが明示されない場合は`default`となる。 -* `audit`: 契約レベルが`default`または`audit`の契約がチェックされる。 - -ビルドレベルを指定する方法は処理系定義である。ただし、ソースコード上で指定する方法は提供されない。 - -なお、契約がチェックされることと、評価されることは異なる。 - -* `constexpr`などの定数表現評価では、チェックされた契約のみが評価される。 -* チェックされない契約が評価されるかは未規定である。チェックされない契約が評価され、結果が`false`となった場合の動作は未定義である。 - -### 違反ハンドラーと違反継続モード - -違反ハンドラーは `void(const std::contract_violation&)` という型を持つ関数である(処理系によってはさらに`noexcept`が指定される)。 - -契約がチェックされ、しかも`false`に評価されたとき、違反ハンドラーが実行される。 - -プログラムは**違反継続モード**`off`または`on`でコンパイルされる。 - -* `off` (デフォルト): 違反ハンドラーの実行後、[`std::terminate()`](/reference/exception/terminate.md)関数を呼び出してプログラムを終了させる。 -* `on`: 違反ハンドラーの実行後、プログラムはそのまま続行する。 - -違反ハンドラーおよび違反継続モードを指定する方法は処理系定義である。 - -### expect属性 - -```cpp -[[expect: 述語]] -``` - -この属性は関数宣言の関数型に対して指定する。 - -述語では、関数の引数を参照できる。 - -```cpp -void f(int x) - [[expects: x>0]] -``` - -expect属性の述語は関数の本体を評価する直前に評価される。関数の本体には、関数tryブロックおよびコンストラクタのメンバ初期化子を含む。 - -1つの関数に複数のexpect属性がある場合、評価は記述した順になる。 - -### ensure属性 - -```cpp -[[ensure: 述語]] -[[ensure 識別子: 述語]] -``` - -この属性は関数宣言の関数型に対して指定する。 - -2番目の書式では、指定した識別子で関数の戻り値を参照できる。ただし、C++20の時点では[構造化束縛](/lang/cpp17/structured_bindings.md)はできない。 - -```cpp -// P0542R5より引用 -std::tuple f() - [[ensures [x,y]: x>0 && y.size()>0]]; // エラー -std::tuple f() - [[ensures r: get<0>(r)>0 && get<1>(r).size()>0]]; // OK -``` -* P0542R5[link http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0542r5.html] - -ensure属性の述語は関数から戻る直前に評価される。このとき、ローカル変数や一時オブジェクトの寿命はすでに尽きている。 - -1つの関数に複数のensure属性がある場合、評価は記述した順になる。 - -### assert属性 - -```cpp -[[assert: 述語]] -``` - -この属性は空文`;`に対して指定する。結果として、文のように書くことができる。 - -```cpp -[[assert: x > 0]]; -``` - -assert属性の述語は適用先の空文と共に評価される。 - -### 契約と継承 - Assertion Redeclaration rule - -あるクラス内で契約されている関数がそのクラスを継承した別のクラスでオーバーライドされる場合、オーバーライドした関数は少なくとも元の関数になされた契約を遵守しなければならない。より詳細には - -- 事前条件:継承元と同じかより弱い(緩い)ものである必要がある -- 事後条件:継承元と同じかより強い(厳しい)ものである必要がある - -これを満たしていない場合、オーバーライドした関数の利用は危険なものになる。 -この原則はAssertion Redeclaration ruleと呼ばれる。 - -C++における契約と継承においてもこの原則に従う。 -契約条件をもつ関数をオーバーライドするとき、オーバーライドした関数にはオーバーライドされた関数と同じ契約条件を指定しなければならない。 -(この時、その条件が異なっていたとしても対応する契約条件が同じ値(`true or false`)に評価されるならば、診断されない。) - -そのような契約条件の指定がされていない場合、オーバーライドされた関数が持つ契約条件が指定されているとみなされる。 - -すなわち、C++における契約の継承時はAssertion Redeclaration ruleを確実に満たすために常に同じ契約を派生先に要求する。 -事前条件を緩くしたり、事後条件を厳しくすることは認められない。 - -```cpp -struct base { - virtual double f(int n) - [[expects: n > 0]] - [[ensures r: r > 0.0]] = 0; - - virtual int g(int n) - [[expects: n < 0]] - [[ensures r: r < 0]] = 0; -}; - -struct derived : base { - //明示的にbase::f()と同じ契約をする - double f(int n) override - [[expects: n > 0]] - [[ensures r: r > 0.0]] - { - return 1; - } - - //暗黙的にbase::g()と同じ契約がされているとみなされる - int g(int n) override { - return -1; - } -}; -``` - -## この機能が必要になった背景・経緯 - -従来は実行時のアサーションとしては[`assert`マクロ](/reference/cassert/assert.md)があるのみだった。 -契約属性はアサーションを含む契約を記述する、マクロを用いない新たな方法として導入された。 - -特に、戻り値に対する契約は従来の[`assert`マクロ](/reference/cassert/assert.md)では簡潔に書くことができなかった。 - -なお、[`assert`マクロ](/reference/cassert/assert.md)は関数形式のマクロなので、`[[assert]]`属性を置換してしまうことはない。 - -## 関連項目 -- [C++11 属性構文](/lang/cpp11/attributes.md) -- [C++11 コンパイル時アサート](/lang/cpp11/static_assert.md) -- [`assert`マクロ](/reference/cassert/assert.md) - -## 参照 -- [P0542R5 Support for contract based programming in C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0542r5.html) -- [ET: Inheritance Inheritance and contracts - Eiffel.org](https://www.eiffel.org/doc/eiffel/ET-_Inheritance#Inheritance_and_contracts) From b54fd0fbeb4126dc47690947bcc9362cf592984c Mon Sep 17 00:00:00 2001 From: rotarymars Date: Sun, 25 Jan 2026 13:25:34 +0900 Subject: [PATCH 2587/3948] removed deleted href --- lang/cpp26/contracts.md | 1 - lang/future.md | 3 +-- reference/contracts.md | 1 - reference/contracts/assertion_kind.md | 1 - reference/contracts/detection_mode.md | 1 - reference/contracts/evaluation_semantic.md | 1 - .../contracts/invoke_default_contract_violation_handler.md | 1 - 7 files changed, 1 insertion(+), 8 deletions(-) diff --git a/lang/cpp26/contracts.md b/lang/cpp26/contracts.md index ab3863f62c..6a77eabb53 100644 --- a/lang/cpp26/contracts.md +++ b/lang/cpp26/contracts.md @@ -733,7 +733,6 @@ int main() { ``` ## 関連項目 -- [C++ 将来 契約に基づくプログラミング](/lang/future/contract-based_programming.md) - [``ヘッダー](/reference/contracts.md) - [`std::contracts::contract_violation`](/reference/contracts/contract_violation.md) - [`std::contracts::assertion_kind`](/reference/contracts/assertion_kind.md) diff --git a/lang/future.md b/lang/future.md index 5929d3d081..940afc2c82 100644 --- a/lang/future.md +++ b/lang/future.md @@ -13,11 +13,10 @@ cpprefjpでは基本的に[Working Draftに採択された機能のみを解説 | 言語機能 | 説明 | |----------|------| -| [契約に基づくプログラミング](future/contract-based_programming.md) | 事前条件、事後条件、表明を宣言する新たな属性構文を追加 | ## ライブラリ | ヘッダ | 説明 | |--------|------| -| [``](/reference/contracts.md) | 契約違反のハンドリング | + diff --git a/reference/contracts.md b/reference/contracts.md index e04cca50fc..9381996681 100644 --- a/reference/contracts.md +++ b/reference/contracts.md @@ -49,7 +49,6 @@ - [Visual C++](/implementation.md#visual_cpp): ?? ## 関連項目 -- [契約に基づくプログラミング](/lang/future/contract-based_programming.md) - [契約プログラミング](/lang/cpp26/contracts.md) ## 参照 diff --git a/reference/contracts/assertion_kind.md b/reference/contracts/assertion_kind.md index db9485d85b..20c549fd14 100644 --- a/reference/contracts/assertion_kind.md +++ b/reference/contracts/assertion_kind.md @@ -30,7 +30,6 @@ namespace std::contracts { - [Visual C++](/implementation.md#visual_cpp): ? ## 関連項目 -- [契約に基づくプログラミング](/lang/future/contract-based_programming.md) - [契約プログラミング](/lang/cpp26/contracts.md) ## 参照 diff --git a/reference/contracts/detection_mode.md b/reference/contracts/detection_mode.md index 6abb059d3b..b36a58c4fe 100644 --- a/reference/contracts/detection_mode.md +++ b/reference/contracts/detection_mode.md @@ -33,7 +33,6 @@ namespace std::contracts { - [Visual C++](/implementation.md#visual_cpp): ? ## 関連項目 -- [契約に基づくプログラミング](/lang/future/contract-based_programming.md) - [契約プログラミング](/lang/cpp26/contracts.md) ## 参照 diff --git a/reference/contracts/evaluation_semantic.md b/reference/contracts/evaluation_semantic.md index 9a2a31956d..381cc72d73 100644 --- a/reference/contracts/evaluation_semantic.md +++ b/reference/contracts/evaluation_semantic.md @@ -41,7 +41,6 @@ namespace std::contracts { - [Visual C++](/implementation.md#visual_cpp): ? ## 関連項目 -- [契約に基づくプログラミング](/lang/future/contract-based_programming.md) - [契約プログラミング](/lang/cpp26/contracts.md) ## 参照 diff --git a/reference/contracts/invoke_default_contract_violation_handler.md b/reference/contracts/invoke_default_contract_violation_handler.md index f9edf372d2..7bf326757f 100644 --- a/reference/contracts/invoke_default_contract_violation_handler.md +++ b/reference/contracts/invoke_default_contract_violation_handler.md @@ -29,7 +29,6 @@ namespace std::contracts { - [Visual C++](/implementation.md#visual_cpp): ? ## 関連項目 -- [契約に基づくプログラミング](/lang/future/contract-based_programming.md) - [契約プログラミング](/lang/cpp26/contracts.md) - [`contract_violation`](contract_violation.md) From a24cca57d1c5cbb9cc9135d27967c98d9e4dded9 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sun, 18 Jan 2026 22:49:07 +0900 Subject: [PATCH 2588/3948] add new ref `csignal/signal` fix code format --- reference/csignal/signal.md | 76 +++++++++++++++++++++++++++++++++++++ reference/cstdlib/abort.md | 2 +- 2 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 reference/csignal/signal.md diff --git a/reference/csignal/signal.md b/reference/csignal/signal.md new file mode 100644 index 0000000000..32fa11bc69 --- /dev/null +++ b/reference/csignal/signal.md @@ -0,0 +1,76 @@ +# signal +* csignal[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +namespace std { + extern "C" using signal-handler = void(int); // exposition only + signal-handler* signal(int sig, signal-handler* func); +} +``` + +## 概要 + +シグナル番号`sig`の受け取り後の処理を指定する。 +`func`の値が`SIG_DFL`の場合、そのシグナルに対するデフォルトの処理が行われる。 +`func`の値が`SIG_IGN`の場合、そのシグナルを無視する。 +それ以外の場合、関数`func`が実行される。 + +## 引数 + +- `sig`: シグナルハンドラを設定するシグナル番号 +- `func`: シグナルに対する処理。以下のいずれかを指定する。 + - `SIG_DFL`: そのシグナルに対するデフォルト処理を指定する。 + - `SIG_IGN`: そのシグナルを無視する。 + - `func`: シグナルハンドラにする関数へのポインタを示す。 + +### シグナルハンドラ関数の制約 +シグナルハンドラ関数は戻り値を持たず、`int`型の引数を持つ。 +この引数にはシグナル番号が格納される。 + +また、以下の処理以外の動作をシグナルハンドラ内で行うとき、その動作は未定義。 +- `volatile std::sig_atomic_t`への単純な読み書き +- `_Exit`関数と`abort`関数 + +## 戻り値 + +成功した場合、指定されたシグナルに対する直前のハンドラを返す。 +それ以外の場合は`SIG_ERR`を返す + +## 備考 + +マルチスレッド内でのこの関数の動作は未定義。 + +## 例 +```cpp example +#include +#include + +volatile std::sig_atomic_t flag = 0; + +void signal_handler(int sig) +{ + flag = 1; + // std::cout << "signal: " << sig << std::endl; 未定義動作 +} + +int main() +{ + std::signal(SIGINT, signal_handler); + while(!flag){ + //処理 + } + if(flag) + { + std::cout << "catch SIGINT" << std::endl; + } + return 0; +} +``` +* std::signal[color ff0000] + +### 出力例 +``` +catch SIGINT +``` diff --git a/reference/cstdlib/abort.md b/reference/cstdlib/abort.md index 5e301f80ff..c772799a37 100644 --- a/reference/cstdlib/abort.md +++ b/reference/cstdlib/abort.md @@ -24,7 +24,7 @@ namespace std { ```cpp raise(SIGABRT); ``` -* raise[link /reference/csignal/raise.md.nolink] +* raise[link /reference/csignal/raise.md] * SIGABRT[link /reference/csignal/sigabrt.md.nolink] From ef9e9b1dad7cd09bfc0816233ac591dacfd0ce0a Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Mon, 19 Jan 2026 22:24:22 +0900 Subject: [PATCH 2589/3948] =?UTF-8?q?=E3=81=94=E6=8C=87=E6=91=98=E9=A0=82?= =?UTF-8?q?=E3=81=84=E3=81=9F=E7=AE=87=E6=89=80=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/csignal/raise.md | 2 +- reference/csignal/sig_atomic_t.md | 15 +++++++-------- reference/csignal/signal.md | 21 +++++++++++++-------- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/reference/csignal/raise.md b/reference/csignal/raise.md index 997b66adb9..7139da2c95 100644 --- a/reference/csignal/raise.md +++ b/reference/csignal/raise.md @@ -10,7 +10,7 @@ namespace std { ``` ## 概要 -プログラムにシグナルを送信する。 +現在のプログラムにシグナルを送信する。 ## 引数 - `sig`: 送信するシグナル番号 diff --git a/reference/csignal/sig_atomic_t.md b/reference/csignal/sig_atomic_t.md index 6e911df96a..cd4f06b02a 100644 --- a/reference/csignal/sig_atomic_t.md +++ b/reference/csignal/sig_atomic_t.md @@ -8,7 +8,6 @@ namespace std { using sig_atomic_t = integer-type; } ``` - * integer-type[italic] ## 概要 @@ -38,20 +37,20 @@ void signal_handler(int signum) int main () { std::signal(SIGINT, signal_handler); - while(!flag){ + while (!flag) { //処理 - } - if (flag){ - std::cout << "catch SIGINT" << std::endl; - } - return 0; + } + if (flag) { + std::cout << "caught SIGINT" << std::endl; + } + return 0; } ``` * std::sig_atomic_t[color ff0000] ### 出力例 ``` -catch SIGINT +caught SIGINT ``` `Ctrl + c`などで割り込みが発生した場合。 diff --git a/reference/csignal/signal.md b/reference/csignal/signal.md index 32fa11bc69..590e8c1b92 100644 --- a/reference/csignal/signal.md +++ b/reference/csignal/signal.md @@ -9,6 +9,7 @@ namespace std { signal-handler* signal(int sig, signal-handler* func); } ``` +* signal-handler[italic] ## 概要 @@ -29,9 +30,14 @@ namespace std { シグナルハンドラ関数は戻り値を持たず、`int`型の引数を持つ。 この引数にはシグナル番号が格納される。 -また、以下の処理以外の動作をシグナルハンドラ内で行うとき、その動作は未定義。 -- `volatile std::sig_atomic_t`への単純な読み書き -- `_Exit`関数と`abort`関数 +シグナルハンドラ内で以下以外の処理を行うことは未定義動作である。 +- `volatile std::sig_atomic_t`オブジェクトへの代入 +- `abort`関数 +- `_Exit`関数 +- `quick_exit`関数 +- `atomic`引数がロックフリーである場合の``内の関数 +- 任意の`atomic`引数を持つ`atomic_is_lock_free`関数 +- `signal`関数(ただし、ハンドラを起こしたシグナル番号に対する呼び出しに限る) ## 戻り値 @@ -58,12 +64,11 @@ void signal_handler(int sig) int main() { std::signal(SIGINT, signal_handler); - while(!flag){ + while (!flag) { //処理 } - if(flag) - { - std::cout << "catch SIGINT" << std::endl; + if (flag) { + std::cout << "caught SIGINT" << std::endl; } return 0; } @@ -72,5 +77,5 @@ int main() ### 出力例 ``` -catch SIGINT +caught SIGINT ``` From af07750a57dfa99301cdf22375d215d07f9d74d4 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Mon, 19 Jan 2026 23:34:31 +0900 Subject: [PATCH 2590/3948] add 6 page defines signal types macro MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sig*のマクロの説明を変更 sig*: コードサンプルの修正 コードの修正 --- reference/csignal.md | 12 +++++----- reference/csignal/sig_atomic_t.md | 1 + reference/csignal/sigabrt.md | 35 +++++++++++++++++++++++++++ reference/csignal/sigfpe.md | 39 +++++++++++++++++++++++++++++++ reference/csignal/sigill.md | 34 +++++++++++++++++++++++++++ reference/csignal/sigint.md | 37 +++++++++++++++++++++++++++++ reference/csignal/signal.md | 1 + reference/csignal/sigsegv.md | 38 ++++++++++++++++++++++++++++++ reference/csignal/sigterm.md | 35 +++++++++++++++++++++++++++ reference/cstdlib/abort.md | 4 ++-- 10 files changed, 228 insertions(+), 8 deletions(-) create mode 100644 reference/csignal/sigabrt.md create mode 100644 reference/csignal/sigfpe.md create mode 100644 reference/csignal/sigill.md create mode 100644 reference/csignal/sigint.md create mode 100644 reference/csignal/sigsegv.md create mode 100644 reference/csignal/sigterm.md diff --git a/reference/csignal.md b/reference/csignal.md index 2f0c717a2c..e62085edb9 100644 --- a/reference/csignal.md +++ b/reference/csignal.md @@ -24,12 +24,12 @@ | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| `SIGINT` | 割り込みを示すシグナル番号 | | -| `SIGILL` | 不正な命令を示すシグナル番号 | | -| `SIGABRT` | `abort`関数などによる異常終了を示すシグナル番号 | | -| `SIGFPE` | 算術演算エラーを示すシグナル番号 | | -| `SIGSEGV` | 記憶領域への不正アクセスを示すシグナル番号 | | -| `SIGTERM` | 終了要求を示すシグナル番号 | | +| [`SIGINT`](csignal/sigint.md) | 割り込みを示すシグナル番号 | | +| [`SIGILL`](csignal/sigill.md) | 不正な命令を示すシグナル番号 | | +| [`SIGABRT`](csignal/sigabrt.md) | `abort`関数などによる異常終了を示すシグナル番号 | | +| [`SIGFPE`](csignal/sigfpe.md) | 算術演算エラーを示すシグナル番号 | | +| [`SIGSEGV`](csignal/sigsegv.md) | 無効なメモリアクセスを示すシグナル番号 | | +| [`SIGTERM`](csignal/sigterm.md) | 終了要求を示すシグナル番号 | | ## 関数 diff --git a/reference/csignal/sig_atomic_t.md b/reference/csignal/sig_atomic_t.md index cd4f06b02a..9d73d0f839 100644 --- a/reference/csignal/sig_atomic_t.md +++ b/reference/csignal/sig_atomic_t.md @@ -15,6 +15,7 @@ namespace std { この型に対して保証されるのは単純な代入および読み出しのみであり、 複合操作や算術演算は保証されない。 + 実際の使用では通常`volatile`修飾子と組み合わせて用いられる。 具体的な型は処理系定義である。 diff --git a/reference/csignal/sigabrt.md b/reference/csignal/sigabrt.md new file mode 100644 index 0000000000..8475ca2ed7 --- /dev/null +++ b/reference/csignal/sigabrt.md @@ -0,0 +1,35 @@ +# SIGABRT +* csignal[meta header] +* macro[meta id-type] + +```cpp +#define SIGABRT see below +``` + +## 概要 +`abort`関数などによる異常終了時に送られるシグナルの、シグナル番号を表すマクロ。 + +`int`型の正の整数の定数式に展開され、実際の値は未規定。 + +## 例 +```cpp example +#include +#include + +void handler(int) { + std::_Exit(0); +} + +int main() { + std::signal(SIGABRT, handler); + std::abort(); +} +``` +* SIGABRT[color ff0000] + +### 出力 +``` +``` + +## 関連項目 +- [`abort`](/reference/cstdlib/abort.md) diff --git a/reference/csignal/sigfpe.md b/reference/csignal/sigfpe.md new file mode 100644 index 0000000000..34e24396c4 --- /dev/null +++ b/reference/csignal/sigfpe.md @@ -0,0 +1,39 @@ +# SIGFPE +* csignal[meta header] +* macro[meta id-type] + +```cpp +#define SIGFPE see below +``` + +## 概要 +算術演算エラー(浮動小数点例外など)が発生した際に送られるシグナルの、シグナル番号を表すマクロ。 + +`int`型の正の整数の定数式に展開され、実際の値は未規定。 + +## 例 +```cpp example +#include +#include + +void handler(int) +{ + std::_Exit(0); +} + +int main() +{ + std::signal(SIGFPE, handler); + + volatile double x = 1.0; + volatile double y = 0.0; + // 浮動小数点の 0 除算。 + // SIGFPE が発生することもあるが、規格上は保証されない。 + x = x / y; +} +``` +* SIGFPE[color ff0000] + +### 出力 +``` +``` diff --git a/reference/csignal/sigill.md b/reference/csignal/sigill.md new file mode 100644 index 0000000000..7907a0c820 --- /dev/null +++ b/reference/csignal/sigill.md @@ -0,0 +1,34 @@ +# SIGILL +* csignal[meta header] +* macro[meta id-type] + +```cpp +#define SIGILL see below +``` + +## 概要 +無効な命令を実行しようとした際に送られるシグナルの、シグナル番号を表すマクロ。 + +`int`型の正の整数の定数式に展開され、実際の値は未規定。 + +## 例 +```cpp example +#include +#include + +void handler(int) +{ + std::_Exit(0); +} + +int main() +{ + std::signal(SIGILL, handler); + std::raise(SIGILL); +} +``` +* SIGILL[color ff0000] + +### 出力 +``` +``` diff --git a/reference/csignal/sigint.md b/reference/csignal/sigint.md new file mode 100644 index 0000000000..7424bd03d1 --- /dev/null +++ b/reference/csignal/sigint.md @@ -0,0 +1,37 @@ +# SIGINT +* csignal[meta header] +* macro[meta id-type] + +```cpp +#define SIGINT see below +``` + +## 概要 +外部割り込みが発生した際に送られるシグナルの、シグナル番号を表すマクロ。 + +`int`型の正の整数の定数式に展開され、実際の値は未規定。 + +## 例 +```cpp example +#include +#include + +volatile std::sig_atomic_t flag = 0; + +void handler(int) +{ + std::_Exit(0); +} + +int main() +{ + std::signal(SIGINT, handler); + std::raise(SIGINT); + return 0; +} +``` +* SIGINT[color ff0000] + +### 出力 +``` +``` diff --git a/reference/csignal/signal.md b/reference/csignal/signal.md index 590e8c1b92..09d085d7e0 100644 --- a/reference/csignal/signal.md +++ b/reference/csignal/signal.md @@ -14,6 +14,7 @@ namespace std { ## 概要 シグナル番号`sig`の受け取り後の処理を指定する。 + `func`の値が`SIG_DFL`の場合、そのシグナルに対するデフォルトの処理が行われる。 `func`の値が`SIG_IGN`の場合、そのシグナルを無視する。 それ以外の場合、関数`func`が実行される。 diff --git a/reference/csignal/sigsegv.md b/reference/csignal/sigsegv.md new file mode 100644 index 0000000000..893f40e991 --- /dev/null +++ b/reference/csignal/sigsegv.md @@ -0,0 +1,38 @@ +# SIGSEGV +* csignal[meta header] +* macro[meta id-type] + +```cpp +#define SIGSEGV see below +``` + +## 概要 +無効なメモリアクセス(不正なアドレス参照など)が発生した際に送られるシグナルの、シグナル番号を表すマクロ。 + +`int`型の正の整数の定数式に展開され、実際の値は未規定。 + +## 例 +```cpp example +#include +#include + +void signal_handler(int) +{ + std::_Exit(0); +} + +int main() +{ + std::signal(SIGSEGV, signal_handler); + + int *p = nullptr; + *p = 42; // 未定義動作。多くの処理系では SIGSEGV が発生するが、保証はない。 + + return 0; +} +``` +* SIGSEGV[color ff0000] + +### 出力 +``` +``` diff --git a/reference/csignal/sigterm.md b/reference/csignal/sigterm.md new file mode 100644 index 0000000000..01890575dd --- /dev/null +++ b/reference/csignal/sigterm.md @@ -0,0 +1,35 @@ +# SIGTERM +* csignal[meta header] +* macro[meta id-type] + +```cpp +#define SIGTERM see below +``` + +## 概要 +プロセスの終了を要求するために送られるシグナルの、シグナル番号を表すマクロ。 + +`int`型の正の整数の定数式に展開され、実際の値は未規定。 + +## 例 +```cpp example +#include +#include + +void handler(int) +{ + std::_Exit(0); +} + +int main() +{ + std::signal(SIGTERM, handler); + std::raise(SIGTERM); + return 0; +} +``` +* SIGTERM[color ff0000] + +### 出力 +``` +``` diff --git a/reference/cstdlib/abort.md b/reference/cstdlib/abort.md index c772799a37..cf3d5ac90b 100644 --- a/reference/cstdlib/abort.md +++ b/reference/cstdlib/abort.md @@ -13,7 +13,7 @@ namespace std { ## 概要 プログラムを異常終了させる。 -この関数は、シグナルハンドラでシグナル[`SIGABRT`](/reference/csignal/sigabrt.md.nolink)を捕捉しない限り、プログラムを異常終了させる。 +この関数は、シグナルハンドラでシグナル[`SIGABRT`](/reference/csignal/sigabrt.md)を捕捉しない限り、プログラムを異常終了させる。 この関数を呼び出したときに生存しているオブジェクトは、破棄されない。 @@ -25,7 +25,7 @@ namespace std { raise(SIGABRT); ``` * raise[link /reference/csignal/raise.md] -* SIGABRT[link /reference/csignal/sigabrt.md.nolink] +* SIGABRT[link /reference/csignal/sigabrt.md] ## 戻り値 From ec90ff9b199dfc02afc2e1d29f1515570081250f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 26 Jan 2026 13:47:54 +0900 Subject: [PATCH 2591/3948] =?UTF-8?q?SIGABRT=20:=20=E3=82=A4=E3=83=B3?= =?UTF-8?q?=E3=83=87=E3=83=B3=E3=83=88=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/csignal/sigabrt.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/csignal/sigabrt.md b/reference/csignal/sigabrt.md index 8475ca2ed7..01ac76a84d 100644 --- a/reference/csignal/sigabrt.md +++ b/reference/csignal/sigabrt.md @@ -17,12 +17,12 @@ #include void handler(int) { - std::_Exit(0); + std::_Exit(0); } int main() { - std::signal(SIGABRT, handler); - std::abort(); + std::signal(SIGABRT, handler); + std::abort(); } ``` * SIGABRT[color ff0000] From 3bd6c9198af463b5e26044536f619a040c5db1aa Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 27 Jan 2026 16:36:10 +0900 Subject: [PATCH 2592/3948] =?UTF-8?q?variant=20/=20basic=5Fformat=5Farg=20?= =?UTF-8?q?:=20C++26=E5=AF=BE=E5=BF=9C=E3=81=A8=E3=81=97=E3=81=A6=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=90=E9=96=A2=E6=95=B0=E7=89=88visit=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20#1194?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 2 +- lang/cpp26/feature_test_macros.md | 2 +- reference/format.md | 2 +- reference/format/basic_format_arg.md | 10 +- reference/format/basic_format_arg/visit.md | 50 ++++++ reference/format/visit_format_arg.md | 8 +- reference/variant/variant.md | 7 + reference/variant/variant/visit.md | 171 +++++++++++++++++++++ reference/variant/visit.md | 3 + 9 files changed, 249 insertions(+), 6 deletions(-) create mode 100644 reference/format/basic_format_arg/visit.md create mode 100644 reference/variant/variant/visit.md diff --git a/lang/cpp26.md b/lang/cpp26.md index d201bff02c..f2e6af6544 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -456,7 +456,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 ### ユーティリティ -- [`std::variant`](/reference/variant/variant.md)クラスに、メンバ関数版の[`visit()`](/reference/variant/variant/visit.md.nolink)を追加 +- [`std::variant`](/reference/variant/variant.md)クラスに、メンバ関数版の[`visit()`](/reference/variant/variant/visit.md)を追加 - `std::monostate`を[``](/reference/variant.md)から[``](/reference/utility.md)に移動 - [`std::optional`](/reference/optional/optional.md)クラスに、0もしくは1要素のRangeとして扱えるようにするための拡張として、イテレータインタフェースを追加 - `iterator`型 diff --git a/lang/cpp26/feature_test_macros.md b/lang/cpp26/feature_test_macros.md index e645447ca1..6cf56cbacb 100755 --- a/lang/cpp26/feature_test_macros.md +++ b/lang/cpp26/feature_test_macros.md @@ -158,7 +158,7 @@ |`__cpp_lib_trivially_relocatable`|`202502L`|トリビアルな再配置|[``](/reference/memory.md), [``](/reference/type_traits.md)| |`__cpp_lib_tuple_like`|`202311L`|[`std::complex`](/reference/complex/complex.md)にタプルインタフェースの特殊化を追加|[``](/reference/utility.md), [``](/reference/tuple.md), [``](/reference/map.md), [``](/reference/unordered_map.md)| |`__cpp_lib_type_order`|`202506L`|[`std::type_info::before`](/reference/typeinfo/type_info/before.md)のconstexpr化|[``](/reference/compare.md)| -|`__cpp_lib_variant`|`202306L`|[`std::variant`](/reference/variant/variant.md)クラスに、メンバ関数版の[`visit()`](/reference/variant/variant/visit.md.nolink)を追加|[``](/reference/variant.md)| +|`__cpp_lib_variant`|`202306L`|[`std::variant`](/reference/variant/variant.md)クラスに、メンバ関数版の[`visit()`](/reference/variant/variant/visit.md)を追加|[``](/reference/variant.md)| 実装依存のマクロ。 diff --git a/reference/format.md b/reference/format.md index 4c533bd1ea..555d1a1bb8 100644 --- a/reference/format.md +++ b/reference/format.md @@ -45,7 +45,7 @@ | 名前 | 説明 | 対応バージョン | |----------------------------------------------------|--------------------------------------------------------------------------------------------------|----------------| | [`basic_format_arg`](format/basic_format_arg.md) | 引数1つへのアクセスを提供する (class template) | C++20 | -| [`visit_format_arg`](format/visit_format_arg.md) | `basic_format_arg`オブジェクトが現在保持している型に対応する関数を呼び出す (function template) | C++20 | +| [`visit_format_arg`](format/visit_format_arg.md) | `basic_format_arg`オブジェクトが現在保持している型に対応する関数を呼び出す (function template) | C++20
C++26から非推奨 | | [`make_format_args`](format/make_format_args.md) | 可変長引数から`basic_format_arg`の列を構築する (function template) | C++20 | | [`make_wformat_args`](format/make_format_args.md) | `make_wformat_args`のワイド文字列版 (function template) | C++20 | | [`basic_format_args`](format/basic_format_args.md) | 引数列へのアクセスを提供する (class template) | C++20 | diff --git a/reference/format/basic_format_arg.md b/reference/format/basic_format_arg.md index 7f3d8eecb5..3c0f25ec71 100644 --- a/reference/format/basic_format_arg.md +++ b/reference/format/basic_format_arg.md @@ -34,6 +34,7 @@ namespace std { }; } ``` +* variant[link /reference/variant/variant.md] ## 概要 フォーマット引数1つを保持する型。 @@ -58,6 +59,13 @@ namespace std { |-----------------|-----------------------------------|----------------| | [`operator bool`](basic_format_arg/op_bool.md) | `bool`への変換演算子(空の時`false`) | C++20 | +### ビジター + +| 名前 | 説明 | 対応バージョン | +|-----------------|-----------------------------------|----------------| +| [`visit`](basic_format_arg/visit.md) | 現在保持している型に対応する関数を呼び出す | C++26 | + + ## メンバ型 | 名前 | 説明 | 対応バージョン | @@ -69,7 +77,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |-------------------------------------------|--------------------------------------------------------------------------------------------------|----------------| | [`make_format_args`](make_format_args.md) | `basic_format_arg`の列を構築する (function template) | C++20 | -| [`visit_format_arg`](visit_format_arg.md) | `basic_format_arg`オブジェクトが現在保持している型に対応する関数を呼び出す (function template) | C++20 | +| [`visit_format_arg`](visit_format_arg.md) | `basic_format_arg`オブジェクトが現在保持している型に対応する関数を呼び出す (function template) | C++20
C++26から非推奨 | ## バージョン ### 言語 diff --git a/reference/format/basic_format_arg/visit.md b/reference/format/basic_format_arg/visit.md new file mode 100644 index 0000000000..eff9911f55 --- /dev/null +++ b/reference/format/basic_format_arg/visit.md @@ -0,0 +1,50 @@ +# visit +* format[meta header] +* class[meta id-type] +* std[meta namespace] +* basic_format_arg[meta class] +* cpp26[meta cpp] + +```cpp +template +constexpr decltype(auto) + visit(this basic_format_arg arg, Visitor&& vis); // (1) C++26 + +template +constexpr R + visit(this basic_format_arg arg, Visitor&& vis); // (2) C++26 +``` + +## 概要 +現在保持している型に対応する関数を呼び出す。 + +- (1) : 現在保持している型に対応する関数を呼び出し、呼び出された関数の戻り値型で戻り値を返す +- (2) : 現在保持している型に対応する関数を呼び出し、指定された戻り値型`R`で戻り値を返す + + +## 効果 +- (1): 以下と等価 + ```cpp + return arg.value.visit(std::forward(vis)); + ``` + * visit[link /reference/variant/variant/visit.md] + +- (2): 以下と等価 + ```cpp + return arg.value.visit(std::forward(vis)); + ``` + * visit[link /reference/variant/variant/visit.md] + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P2637R3 Member `visit`](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2637r3.html) +- [P3391R2 `constexpr std::format`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3391r2.html) diff --git a/reference/format/visit_format_arg.md b/reference/format/visit_format_arg.md index 917cfc8cfb..5c801d337c 100644 --- a/reference/format/visit_format_arg.md +++ b/reference/format/visit_format_arg.md @@ -1,9 +1,9 @@ # visit_format_arg - * format[meta header] * function template[meta id-type] * std[meta namespace] * cpp20[meta cpp] +* cpp26deprecated[meta cpp] ```cpp namespace std { @@ -13,6 +13,8 @@ namespace std { ``` * basic_format_arg[link /reference/format/basic_format_arg.md] +この関数は、C++26から非推奨となった。代わりに[`std::basic_format_arg`](basic_format_arg.md)`::`[`visit()`](basic_format_arg/visit.md)メンバ関数を使用すること。 + ## 概要 * (1) : `basic_format_arg`オブジェクトが現在保持している型に対応する関数を呼び出し、呼び出された関数の戻り値型で戻り値を返す @@ -61,6 +63,7 @@ namespace std { * (1) : [`basic_format_arg`](/reference/format/basic_format_arg.md)オブジェクトが現在保持している型に対応する関数を呼び出した戻り値 + ## 実装例 ```cpp namespace std { @@ -90,4 +93,5 @@ namespace std { ## 参照 -* [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) +- [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) +- [P2637R3 Member `visit`](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2637r3.html) \ No newline at end of file diff --git a/reference/variant/variant.md b/reference/variant/variant.md index 9b61abcbba..35f4856e2b 100644 --- a/reference/variant/variant.md +++ b/reference/variant/variant.md @@ -91,6 +91,13 @@ std::visit([](auto& x) { | [`index`](variant/index.md) | 候補型の何番目の型が代入されているかを取得する | C++17 | +### ビジター + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`visit`](variant/visit.md) | `variant`オブジェクトが現在保持している型に対応する関数を呼び出す | C++26 | + + ## 非メンバ関数 ### 値の取得 diff --git a/reference/variant/variant/visit.md b/reference/variant/variant/visit.md new file mode 100644 index 0000000000..e1e6eb7595 --- /dev/null +++ b/reference/variant/variant/visit.md @@ -0,0 +1,171 @@ +# visit +* variant[meta header] +* std[meta namespace] +* variant[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +template +constexpr decltype(auto) + visit(this Self&&, Visitor&&); // (1) C++26 + +template +constexpr R + visit(this Self&&, Visitor&&); // (2) C++26 +``` + +## 概要 +`variant`オブジェクトが現在保持している型に対応する関数を呼び出す。 + +- (1) : `variant`オブジェクトが現在保持している型に対応する関数を呼び出し、呼び出された関数の戻り値型で戻り値を返す +- (2) : `variant`オブジェクトが現在保持している型に対応する関数を呼び出し、指定された戻り値型`R`で戻り値を返す + +この関数は、非メンバ関数版の[`std::visit()`](/reference/variant/visit.md)と同様の動作をするメンバ関数である。ただし、複数の`variant`オブジェクトから呼び出す関数を決定したい場合には、非メンバ関数版を使用する必要がある。 + + +### switch文の自動化/Visitorパターン +`variant`オブジェクトに代入される型は実行時に決定される。そのため、通常の方法では、以下のように`switch`文を使用して実行時に代入された型に応じた処理を行うことになる: + +```cpp +void f(T1); +void f(T2); +void f(T3); + +std::variant v; + +switch (v.index()) { + case 0: + f(std::get<0>(v)); + break; + + case 1: + f(std::get<1>(v)); + break; + + case 2: + f(std::get<2>(v)); + break; +} +``` +* v.index()[link index.md] +* std::get[link get.md] + +この`visit()`メンバ関数を使用することで、そのような分岐を内部で解決してくれる。これは、GoFのデザインパターンのひとつであるVisitorパターンに対応する機能である。 + +注意点としては、非メンバ関数のオーバーロードを各型に対応した関数として`visit()`メンバ関数に指定することはできないということである。引数の型が静的に決まらなければ関数ポインタを取得できないため、関数ポインタではオーバーロードの集合をまとめて`visit()`メンバ関数に渡すことができない。そのため、`visit()`メンバ関数に指定するオーバーロードの集合には、必然的に関数オブジェクトを使用することになる。 + +```cpp +struct Visitor { + void operator()(T1) {} + void operator()(T2) {} + void operator()(T3) {} +}; + +std::variant v; +v.visit(Visitor{}); // vに実行時に代入された型に応じた関数オーバーロードを呼び出す +``` + + +### 呼び出された関数から戻り値を返す +戻り値を返す場合は、それぞれの関数オーバーロードに単に戻り値の型を定義すればよいが、全てのオーバーロードで共通の型でなければならない。これは、`visit()`メンバ関数自体の戻り値の型は静的に決定されなければならないためである。 + +```cpp +struct Visitor { + int operator()(T1) { return 0; } + int operator()(T2) { return 1; } + int operator()(T3) { return 2; } +}; + +std::variant v; + +// vに実行時に代入された型に応じた関数オーバーロードを呼び出し、戻り値を受け取る +int result = v.visit(Visitor{}); +``` + + +### 全ての候補型で共通の操作を行う場合は、ジェネリックラムダを使用できる +代入される型ごとにオーバーロードを定義できることは有用だが、すでに操作が共通化されていたり、共通の操作にアダプトできる場合 (GoFのデザインパターンのひとつであるAdapterパターンなど)、使用するビジター関数オブジェクトとして、ジェネリックラムダを使用できる。 + +```cpp +std::variant v; + +// T1, T2, T3のいずれの型が代入されたとしても、処理内容は共通 +std::visit([](const auto& x) { + std::cout << x << std::endl; +}, v); +``` + +## 効果 +型`V`を以下のように定義する: + +```cpp +using V = OVERRIDE_REF(Self&&, COPY_CONST(remove_reference_t, variant)); +``` + +以下と等価である: + +- (1): + ```cpp + return std::visit(std::forward(vis), (V)self); + ``` + * std::visit[link /reference/variant/visit.md] + +- (2): + ```cpp + return std::visit(std::forward(vis), (V)self); + ``` + * std::visit[link /reference/variant/visit.md] + + +## 例 +```cpp example +#include +#include +#include + +// 2倍にする。 +// 整数だったら数値を2倍にし、 +// 文字列だったら同じ文字列を2回繰り返す +struct TimesTwoVisitor { + void operator()(int& n) + { + n *= 2; + } + + void operator()(std::string& s) + { + s += s; + } +}; + +int main() +{ + std::variant v = 2; + v.visit(TimesTwoVisitor{}); + v.visit([](const auto& x) { std::println("{}", x); }); + + v = std::string{"Hello"}; + v.visit(TimesTwoVisitor{}); + v.visit([](const auto& x) { std::println("{}", x); }); +} +``` +* visit[color ff0000] + +### 出力 +``` +4 +HelloHello +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark verified] +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] + +## 参照 +- [P2637R3 Member `visit`](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2637r3.html) diff --git a/reference/variant/visit.md b/reference/variant/visit.md index b805e90116..04dd4be0d2 100644 --- a/reference/variant/visit.md +++ b/reference/variant/visit.md @@ -193,6 +193,9 @@ HelloHello - [Visual C++](/implementation.md#visual_cpp): ?? +## 関連項目 +- [メンバ関数版`visit()`](variant/visit.md) + ## 参照 - [P0655R1 `visit`: Explicit Return Type for `visit`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0655r1.pdf) - [LWG Issue 2970. Return type of `std::visit` misspecified](https://wg21.cmeerw.net/lwg/issue2970) From 478f2428c5fffae0bc3846d3f5c7c18f85b693a8 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 28 Jan 2026 15:28:47 +0900 Subject: [PATCH 2593/3948] =?UTF-8?q?C++26=E5=AF=BE=E5=BF=9C=E3=81=A8?= =?UTF-8?q?=E3=81=97=E3=81=A6exception=5Fptr=5Fcast=E9=96=A2=E6=95=B0?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20#1505?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 2 +- lang/cpp26/feature_test_macros.md | 2 +- reference/exception.md | 1 + reference/exception/current_exception.md | 1 + reference/exception/exception_ptr_cast.md | 93 +++++++++++++++++++++++ reference/exception/rethrow_exception.md | 2 +- 6 files changed, 98 insertions(+), 3 deletions(-) create mode 100644 reference/exception/exception_ptr_cast.md diff --git a/lang/cpp26.md b/lang/cpp26.md index f2e6af6544..3b31acb84f 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -511,7 +511,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [`std::format_error`](/reference/format/format_error.md) - [``](/reference/memory.md)に、ポインタのアライメントを判定する[`std::is_sufficiently_aligned()`](/reference/memory/is_sufficiently_aligned.md)関数を追加。 - [``](/reference/utility.md)に、タイムトラベル最適化を抑止するための観測可能ポイントとして[`std::observable_checkpoint()`](/reference/utility/observable_checkpoint.md.nolink)を追加 -- [`std::exception_ptr`](/reference/exception/exception_ptr.md)を指定した例外型にキャストする[`std::exception_ptr_cast()`](/reference/exception/exception_ptr_cast.md.nolink)関数を追加 +- [`std::exception_ptr`](/reference/exception/exception_ptr.md)を指定した例外型にキャストする[`std::exception_ptr_cast()`](/reference/exception/exception_ptr_cast.md)関数を追加 - [``](/reference/compare.md)に、型の順序を取得する[`std::type_order`](/reference/compare/type_order.md.nolink)クラスを追加 diff --git a/lang/cpp26/feature_test_macros.md b/lang/cpp26/feature_test_macros.md index 6cf56cbacb..eaa6b780b6 100755 --- a/lang/cpp26/feature_test_macros.md +++ b/lang/cpp26/feature_test_macros.md @@ -76,7 +76,7 @@ |`__cpp_lib_counting_scope`|`202506L`|[``](/reference/execution.md)に[`std::execution::spawn`](/reference/execution/execution/spawn.md)、[`std::execution::scope_token`](/reference/execution/execution/scope_token.md)などを追加|[``](/reference/execution.md)| |`__cpp_lib_debugging`|`202403L`|デバッグサポートのライブラリとして[``](/reference/debugging.md)を追加|[``](/reference/debugging.md)| |`__cpp_lib_define_static`|`202506L`||[``](/reference/meta.md.nolink)| -|`__cpp_lib_exception_ptr_cast`|`202506L`|[`std::exception_ptr`](/reference/exception/exception_ptr.md)を指定した例外型にキャストする[`std::exception_ptr_cast()`](/reference/exception/exception_ptr_cast.md.nolink)関数を追加|[``](/reference/exception.md)| +|`__cpp_lib_exception_ptr_cast`|`202506L`|[`std::exception_ptr`](/reference/exception/exception_ptr.md)を指定した例外型にキャストする[`std::exception_ptr_cast()`](/reference/exception/exception_ptr_cast.md)関数を追加|[``](/reference/exception.md)| |`__cpp_lib_format`|`202311L`||[``](/reference/format.md)| |`__cpp_lib_format_path`|`202506L`|[`std::filesystem::path`](/reference/filesystem/path.md)クラスに、文字列フォーマットのサポートを追加
[`std::filesystem::path`](/reference/filesystem/path.md)クラスに、出力用の文字列を取得するためのメンバ関数を追加|[``](/reference/filesystem.md)| |`__cpp_lib_format_uchar`|`202311L`|[`std::format`](/reference/format/format.md)が`char`を数値出力する際は符号なしとして扱う|[``](/reference/format.md)| diff --git a/reference/exception.md b/reference/exception.md index 19faa4c8f4..6a9a1191bb 100644 --- a/reference/exception.md +++ b/reference/exception.md @@ -21,6 +21,7 @@ | [`exception_ptr`](exception/exception_ptr.md) | 例外格納用ポインタ(type-alias) | C++11 | | [`current_exception`](exception/current_exception.md) | 現在処理中の例外オブジェクトを指す例外ポインタを取得する(function) | C++11 | | [`rethrow_exception`](exception/rethrow_exception.md) | 例外ポインタが指す例外を送出する(function) | C++11 | +| [`exception_ptr_cast`](exception/exception_ptr_cast.md) | 例外ポインタを指定された例外型にキャストする(function) | C++26 | | [`make_exception_ptr`](exception/make_exception_ptr.md) | 例外ポインタを作成する(function) | C++11 | | [`throw_with_nested`](exception/throw_with_nested.md) | 現在の例外を入れ子にした例外を送出する(function) | C++11 | | [`rethrow_if_nested`](exception/rethrow_if_nested.md) | 入れ子になった例外が存在する場合に、入れ子になった例外を送出する(function) | C++11 | diff --git a/reference/exception/current_exception.md b/reference/exception/current_exception.md index 82b8501848..b081eaf993 100644 --- a/reference/exception/current_exception.md +++ b/reference/exception/current_exception.md @@ -88,6 +88,7 @@ terminate called after throwing an instance of 'std::runtime_error' ## 関連項目 - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) +- [`std::exception_ptr_cast()`](exception_ptr_cast.md) ## 参照 diff --git a/reference/exception/exception_ptr_cast.md b/reference/exception/exception_ptr_cast.md new file mode 100644 index 0000000000..33c371bacb --- /dev/null +++ b/reference/exception/exception_ptr_cast.md @@ -0,0 +1,93 @@ +# exception_ptr_cast +* exception[meta header] +* std[meta namespace] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + constexpr const E* + exception_ptr_cast(const exception_ptr& p) noexcept; // (1) C++26 + + template + void + exception_ptr_cast(const exception_ptr&&) = delete; // (2) C++26 +} +``` +* exception_ptr[link exception_ptr.md] + +## 概要 +例外ポインタを指定された例外型にキャストする。 + +この関数は、[`std::exception_ptr`](exception_ptr.md)オブジェクトに格納されている実際の例外型を取り出すために使用できる。[`std::rethrow_exception()`](rethrow_exception.md)関数でも同様のことはできるが、こちらの方が高速である可能性がある。 + +- (1): [`std::exception_ptr`](exception_ptr.md)オブジェクトを、指定された例外型`E`へのポインタに変換して返す +- (2): 右辺値の[`std::exception_ptr`](exception_ptr.md)オブジェクトを引数にするのは禁止されている + + +## 適格要件 +- 型`E`は完全型かつ[オブジェクト型](/reference/type_traits/is_object.md)であること +- 型`E`はCV修飾されていないこと +- 型`E`は配列型ではないこと +- 型`E`はポインタ型またはメンバポインタ型ではないこと + - 注: 型`E`がポインタ型またはメンバポインタを許可してしまう場合、以下のような問題が起きる + - 多重継承した派生型のポインタを例外送出して基底クラスのポインタ型で捕捉するような場合、`catch`節に渡ってくるのは送出された直接のポインタ値ではなく、基底クラスがどれなのかを算出するために調整されたポインタ値となり、元の例外送出された値には束縛されていないという状況になる + - この関数は、元となる例外オブジェクトそのものへのポインタを返すことを設計目的にしているため、上記のような問題を避けるために、ポインタ型およびメンバポインタ型は許可されていない + + +## 戻り値 +`p`がnullではなく、かつ型`const E&`のハンドラがその例外オブジェクトに対するマッチ条件を満たす場合、`p`が指す例外オブジェクトへのポインタを返す。そうでない場合は、`nullptr`を返す。 + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::exception_ptr ep; + + try { + throw std::runtime_error("error!"); + } + catch (...) { + std::println("catch"); + ep = std::current_exception(); // 処理中の例外ポインタを取得 + } + + if (const std::runtime_error* e = std::exception_ptr_cast(ep)) { + std::println("exception: {}", e->what()); + } +} +``` +* std::exception_ptr_cast[color ff0000] +* std::current_exception[link current_exception.md] +* std::exception_ptr[link exception_ptr.md] +* std::runtime_error[link /reference/stdexcept.md] + +### 出力例 +``` +catch +exception: erro! +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 22 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2022 Update 14 [mark noimpl] + + +## 参照 +- [P2927R3 Inspecting `exception_ptr`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2927r3.html) +- [P3748R0 Inspecting `exception_ptr` should be `constexpr`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3748r0.html) diff --git a/reference/exception/rethrow_exception.md b/reference/exception/rethrow_exception.md index 8ab2d8f1a2..eb5938c515 100644 --- a/reference/exception/rethrow_exception.md +++ b/reference/exception/rethrow_exception.md @@ -84,7 +84,7 @@ terminate called after throwing an instance of 'std::runtime_error' ## 関連項目 - [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) - +- [`std::exception_ptr_cast()`](exception_ptr_cast.md) ## 参照 - [N2179 Language Support for Transporting Exceptions between Threads](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html) From 65b5d046583a3dfa43156609a201b57860a05d22 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 28 Jan 2026 18:55:26 +0900 Subject: [PATCH 2594/3948] fix typo --- reference/exception/exception_ptr_cast.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/exception/exception_ptr_cast.md b/reference/exception/exception_ptr_cast.md index 33c371bacb..1bb1f9b474 100644 --- a/reference/exception/exception_ptr_cast.md +++ b/reference/exception/exception_ptr_cast.md @@ -75,7 +75,7 @@ int main() ### 出力例 ``` catch -exception: erro! +exception: error! ``` ## バージョン From d73f68dac029b1a43cd483ddff03ba6d3f170d98 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 29 Jan 2026 13:22:36 +0900 Subject: [PATCH 2595/3948] =?UTF-8?q?C++26=E5=AF=BE=E5=BF=9C=E3=81=A8?= =?UTF-8?q?=E3=81=97=E3=81=A6packaged=5Ftask=E3=81=AE=E3=82=A2=E3=83=AD?= =?UTF-8?q?=E3=82=B1=E3=83=BC=E3=82=BF=E6=8C=87=E5=AE=9A=E3=82=B3=E3=83=B3?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=83=A9=E3=82=AF=E3=82=BF=E3=82=92=E5=BE=A9?= =?UTF-8?q?=E6=B4=BB=20#1513?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../future/packaged_task/op_constructor.md | 4 ++- reference/future/packaged_task/reset.md | 29 ++++++++++++++----- reference/future/promise.md | 2 +- reference/future/promise/uses_allocator.md | 13 ++++----- 4 files changed, 30 insertions(+), 18 deletions(-) diff --git a/reference/future/packaged_task/op_constructor.md b/reference/future/packaged_task/op_constructor.md index dc60a0569d..3fc3d1d4dd 100644 --- a/reference/future/packaged_task/op_constructor.md +++ b/reference/future/packaged_task/op_constructor.md @@ -13,7 +13,7 @@ explicit packaged_task(F&& f); // (2) template explicit packaged_task(allocator_arg_t, - const Allocator& a, F&& f); // (3) C++17で削除 + const Allocator& a, F&& f); // (3) C++17で削除、C++26で再追加 packaged_task(packaged_task&) = delete; // (4) C++11 packaged_task(const packaged_task&) = delete; // (4) C++14 @@ -117,3 +117,5 @@ int main() - [LWG Issue 2921. `packaged_task` and type-erased allocators](https://wg21.cmeerw.net/lwg/issue2921) - [`std::function`のコンストラクタ](/reference/functional/function/op_constructor.md)と同様の理由により、アロケータを受け取るコンストラクタを削除 - [LWG Issue 3039. Unnecessary `decay` in `thread` and `packaged_task`](https://wg21.cmeerw.net/lwg/issue3039) +- [P3503R3 Make type-erased allocator use in `promise` and `packaged_task` consistent](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3503r3.html) + - C++26でアロケータを受け取るコンストラクタを再追加 diff --git a/reference/future/packaged_task/reset.md b/reference/future/packaged_task/reset.md index 9d1277343f..d58567819c 100644 --- a/reference/future/packaged_task/reset.md +++ b/reference/future/packaged_task/reset.md @@ -16,14 +16,26 @@ void reset(); ## 効果 -```cpp -*this = packaged_task(std::move(f)); -``` -* std::move[link /reference/utility/move.md] +メンバ変数として保持している、非同期実行する関数オブジェクトを`f`として、 + +- C++11: あたかも以下のように動作する + ```cpp + *this = packaged_task(std::move(f)); + ``` + * std::move[link /reference/utility/move.md] -によって、新たに共有状態を作成する。古い共有状態は放棄される(詳細は[`operator=`](op_assign.md)を参照)。 + - この操作によって、新たに共有状態を作成する。古い共有状態は放棄される(詳細は[`operator=`](op_assign.md)を参照)。 -`f`はメンバ変数として保持している、非同期実行する関数オブジェクト。 +- C++26: 以下と等価 + ```cpp + if (!valid()) + throw future_error(future_errc::no_state); + *this = packaged_task(allocator_arg, a, std::move(f)); + ``` + * valid[link valid.md] + * future_error[link ../future_error.md] + * allocator_arg[link /reference/memory/allocator_arg_t.md] + * std::move[link /reference/utility/move.md] ## 戻り値 @@ -33,8 +45,7 @@ void reset(); ## 例外 この関数は、以下の例外を送出する可能性がある: -- [`bad_alloc`](/reference/new/bad_alloc.md) : 新たな共有状態のアロケートに失敗 -- タスク`f`のムーブコンストラクタが送出するあらゆる例外 +- `package_task`のコンストラクタ、またはタスク`f`のムーブコンストラクタが送出するあらゆる例外 - [`future_error`](../future_error.md) : 共有状態を持っていない状態でこの関数を呼び出した場合、[`no_state`](../future_errc.md)をerror conditionにして送出する @@ -86,3 +97,5 @@ int main() ## 参照 +- [P3503R3 Make type-erased allocator use in `promise` and `packaged_task` consistent](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3503r3.html) + - C++26でアロケータを受け取るコンストラクタで再構築するよう変更された diff --git a/reference/future/promise.md b/reference/future/promise.md index 3eae319a2b..ecee0fb361 100644 --- a/reference/future/promise.md +++ b/reference/future/promise.md @@ -66,7 +66,7 @@ namespace std { | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`uses_allocator`](promise/uses_allocator.md) | `promise`による特殊化 | +| [`uses_allocator`](promise/uses_allocator.md) | `promise`による特殊化 | C++11
C++26で削除 | ## 例 diff --git a/reference/future/promise/uses_allocator.md b/reference/future/promise/uses_allocator.md index 4eed5135b5..91fabb6097 100644 --- a/reference/future/promise/uses_allocator.md +++ b/reference/future/promise/uses_allocator.md @@ -3,6 +3,7 @@ * std[meta namespace] * class template[meta id-type] * cpp11[meta cpp] +* cpp26removed[meta cpp] ```cpp namespace std { @@ -13,18 +14,12 @@ namespace std { ``` * true_type[link /reference/type_traits/true_type.md] +この特殊化はC++11で導入され、C++26で削除された。 + ## 概要 `uses_allocator`の、`promise`に対する特殊化。 -## 例 -```cpp -``` - -### 出力 -``` -``` - ## バージョン ### 言語 - C++11 @@ -37,3 +32,5 @@ namespace std { ## 参照 +- [P3503R3 Make type-erased allocator use in `promise` and `packaged_task` consistent](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3503r3.html) + - C++26でこの特殊化が削除された From bf831f72899662db93cb4bed43bf8e834fd8f6f4 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 29 Jan 2026 15:24:03 +0900 Subject: [PATCH 2596/3948] =?UTF-8?q?stdexcept=20:=20=E4=BD=9C=E6=88=90?= =?UTF-8?q?=E6=B8=88=E3=81=BF=E4=BE=8B=E5=A4=96=E3=83=9A=E3=83=BC=E3=82=B8?= =?UTF-8?q?=E3=81=B8=E3=81=AE=E3=83=AA=E3=83=B3=E3=82=AF=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=20#1549?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/stdexcept.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/stdexcept.md b/reference/stdexcept.md index 66ffb68de6..5d5caccd65 100644 --- a/reference/stdexcept.md +++ b/reference/stdexcept.md @@ -28,9 +28,9 @@ - [`exception`](/reference/exception/exception.md) - [`logic_error`](stdexcept/logic_error.md) - [`domain_error`](stdexcept/domain_error.md) - - `invalid_argument` + - [`invalid_argument`](stdexcept/invalid_argument.md) - `length_error` - - `out_of_range` + - [`out_of_range`](stdexcept/out_of_range.md) - `runtime_error` - `range_error` - `overflow_error` From d20bf1b0fcd19416d92c634a1af949944e44a568 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Wed, 3 Dec 2025 10:28:57 +0900 Subject: [PATCH 2597/3948] =?UTF-8?q?fix(mblen):=20=E8=AB=B8=E3=80=85?= =?UTF-8?q?=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * std::mblen の内部状態をクリアせずに使用しているのを修正 * size_t に対する std::size_t のつけ忘れを修正 * nullptr を指定した時の戻り値の記述を修正 * 関連するロカールカテゴリを明記 --- reference/cstdlib/mblen.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/reference/cstdlib/mblen.md b/reference/cstdlib/mblen.md index 4cdcd924d0..e205197371 100644 --- a/reference/cstdlib/mblen.md +++ b/reference/cstdlib/mblen.md @@ -14,13 +14,13 @@ namespace std { 先頭以外の文字に関するバイト数は計算されない。 -この関数は現在のロケールに依存してマルチバイト文字を解釈する。 +この関数は現在のロケールカテゴリー `LC_CTYPE` に依存してマルチバイト文字を解釈する。 `n`は解析に使用する最大バイト数を指定する。 ## 戻り値 - 正常に動作する場合、文字の占めるバイト数を返す。 -- `str`が`nullptr`の時、内部状態を初期化し`0`を返す。 +- `str`が`nullptr`の時、内部状態を初期化する。現在のエンコーディングが状態を持つ場合は非ゼロの値を返し、それ以外の場合は`0`を返す。 - 無効な文字列、または`n`が不足している場合、`-1`を返す。 ## 例 @@ -51,8 +51,11 @@ int main() { #include int count_chars_mblen(const char* s) { + // std::mblen 内部の std::mbstate_t を初期化する必要あり + std::mblen(nullptr, 0); + int count = 0; - size_t i = 0; + std::size_t i = 0; while (s[i] != '\0') { int len = std::mblen(&s[i], MB_CUR_MAX); if (len < 0) { From e709dd2f2f33ff6510a95175ae8360e207d74cf5 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Wed, 3 Dec 2025 11:01:35 +0900 Subject: [PATCH 2598/3948] =?UTF-8?q?fix(mblen):=20=E3=83=90=E3=83=83?= =?UTF-8?q?=E3=83=95=E3=82=A1=E3=82=AA=E3=83=BC=E3=83=90=E3=83=BC=E3=83=A9?= =?UTF-8?q?=E3=83=B3=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 残り MB_CUR_MAX バイトが読み取れることが保証されていないと未定義動作 Co-authored-by: Raclamusi --- reference/cstdlib/mblen.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/reference/cstdlib/mblen.md b/reference/cstdlib/mblen.md index e205197371..4bdf01934d 100644 --- a/reference/cstdlib/mblen.md +++ b/reference/cstdlib/mblen.md @@ -26,14 +26,15 @@ namespace std { ## 例 ### 基本的な使い方 ```cpp example -#include -#include #include +#include +#include +#include int main() { std::setlocale(LC_ALL, "ja_JP.UTF-8"); const char *str = "こんにちは"; - int result = std::mblen(str, MB_CUR_MAX); + int result = std::mblen(str, std::strlen(str)); std::cout << result << std::endl; return 0; } @@ -46,9 +47,10 @@ int main() { ### 文字列の文字数を計算する ```cpp example -#include -#include #include +#include +#include +#include int count_chars_mblen(const char* s) { // std::mblen 内部の std::mbstate_t を初期化する必要あり @@ -56,8 +58,9 @@ int count_chars_mblen(const char* s) { int count = 0; std::size_t i = 0; - while (s[i] != '\0') { - int len = std::mblen(&s[i], MB_CUR_MAX); + std::size_t bytes = std::strlen(s); + while (i < bytes) { + int len = std::mblen(&s[i], bytes - i); if (len < 0) { len = 1; } From bd71f1a96f73d1d54eaf6c57bac3680189d5b7de Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Wed, 3 Dec 2025 10:48:37 +0900 Subject: [PATCH 2599/3948] =?UTF-8?q?feat(mblen):=20=E5=86=85=E9=83=A8?= =?UTF-8?q?=E7=8A=B6=E6=85=8B=E3=81=A8=20std::mbrlen=20=E3=82=92=E8=A8=80?= =?UTF-8?q?=E5=8F=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/mblen.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/reference/cstdlib/mblen.md b/reference/cstdlib/mblen.md index 4bdf01934d..c38e3d3d84 100644 --- a/reference/cstdlib/mblen.md +++ b/reference/cstdlib/mblen.md @@ -18,6 +18,11 @@ namespace std { `n`は解析に使用する最大バイト数を指定する。 +この関数は `std::mbstate_t` に等価な静的記憶域の内部状態を保持し、前回の `mblen` 関数呼び出しの続きとして処理を行う。 +従って、この関数はスレッドセーフではない。 +スレッドセーフに処理する場合は、`std::mbstate_t` を受け取る [`std::mbrlen`](../cwchar/mbrlen.md.nolink) (``) を使い、呼び出し元でデコード状態の記録場所 `std::mbstate_t` を用意する必要がある。 +新しいコードでは、特に理由がない限り `std::mblen` ではなく `std::mbrlen` を用いるべきである。 + ## 戻り値 - 正常に動作する場合、文字の占めるバイト数を返す。 - `str`が`nullptr`の時、内部状態を初期化する。現在のエンコーディングが状態を持つ場合は非ゼロの値を返し、それ以外の場合は`0`を返す。 @@ -79,8 +84,15 @@ int main() { } ``` +注意: この例は飽くまで `std::mblen` を用いて文字数を数える関数の例であるが、実用上は `std::mbrlen` を用いた実装にするのが安全である。 +上の関数 `count_chars_mblen` はスレッドーセーフでない他、呼び出し元でも `std::mblen` を使っている場合にその振る舞いを破壊する可能性がある。 + #### 出力例 ``` 文字列: こんにちは世界 文字数: 7 ``` + +## 関連項目 + +- [`mbrlen`](../cwchar/mbrlen.md.nolink): `std::mbstate_t` を受け取るスレッドセーフなバージョン From 8489a5dfc901279ef50211262abb29f46d00e595 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Tue, 6 Jan 2026 14:35:23 +0900 Subject: [PATCH 2600/3948] =?UTF-8?q?feat(mblen):=20C=E8=A6=8F=E6=A0=BC?= =?UTF-8?q?=E3=81=AE=E5=86=85=E9=83=A8=E7=8A=B6=E6=85=8B=E3=81=AB=E9=96=A2?= =?UTF-8?q?=E3=81=99=E3=82=8B=E5=8F=96=E3=82=8A=E6=89=B1=E3=81=84=E5=A4=89?= =?UTF-8?q?=E6=9B=B4=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6=E8=A8=98=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/mblen.md | 47 ++++++++++++++++++++++++++++++++++---- 1 file changed, 43 insertions(+), 4 deletions(-) diff --git a/reference/cstdlib/mblen.md b/reference/cstdlib/mblen.md index c38e3d3d84..afb248e4b4 100644 --- a/reference/cstdlib/mblen.md +++ b/reference/cstdlib/mblen.md @@ -18,10 +18,42 @@ namespace std { `n`は解析に使用する最大バイト数を指定する。 -この関数は `std::mbstate_t` に等価な静的記憶域の内部状態を保持し、前回の `mblen` 関数呼び出しの続きとして処理を行う。 +エンコーディングの内部状態に関する振る舞いが最近の規格で変更されたことから、 +内部状態に依存するエンコーディングを考慮するならば、 +特に理由がない限り `std::mblen` ではなく `std::mbstate_t` を受け取る `std::mbrlen` を +新しいコードでは用いるべきである。 +以前の振る舞いではスレッドセーフではなく、 +現在の振る舞いではそもそも内部状態に依存する使い方ができない。 + +### C11, C++17, POSIX.1-2024 以降 + +この関数は以下の関数呼び出しに等価である。 + +```cpp +mbtowc((wchar_t *)0, (const char *)0, 0); +mbtowc((wchar_t *)0, str, n); +``` +* mbtowc[link mbtowc.md.nolink] + +つまり、関数 `mblen` はあたかも内部状態がないかのように振る舞い、 +現在のエンコーディングの初期状態を用いて `str` の先頭にある文字のバイト数を計算する。 + +### C99, C++14, POSIX.1-2017 以前 + +この関数は以下の関数呼び出しに等価である。 + +```cpp +mbtowc((wchar_t *)0, str, n); +``` +* mbtowc[link mbtowc.md.nolink] + +関数 `mblen` は `std::mbstate_t` に等価な静的記憶域の内部状態を保持し、前回の `mblen` 関数呼び出しの続きとして処理を行う。 従って、この関数はスレッドセーフではない。 -スレッドセーフに処理する場合は、`std::mbstate_t` を受け取る [`std::mbrlen`](../cwchar/mbrlen.md.nolink) (``) を使い、呼び出し元でデコード状態の記録場所 `std::mbstate_t` を用意する必要がある。 -新しいコードでは、特に理由がない限り `std::mblen` ではなく `std::mbrlen` を用いるべきである。 +また、この関数を用いる処理の途中で、この関数を用いる別の処理を行うこともできない。 +安全に処理するためには、この関数の代わりに `std::mbstate_t` を受け取る [`std::mbrlen`](../cwchar/mbrlen.md.nolink) (``) を使い、呼び出し元でデコード状態の記録場所 `std::mbstate_t` を用意する必要がある。 + +他の標準ライブラリ関数はあたかも`mblen`を呼び出さないように振る舞う。 +つまり、明示的に `mblen` を呼び出さない限り、その内部状態を変更しない。 ## 戻り値 - 正常に動作する場合、文字の占めるバイト数を返す。 @@ -58,8 +90,15 @@ int main() { #include int count_chars_mblen(const char* s) { - // std::mblen 内部の std::mbstate_t を初期化する必要あり +#if __cplusplus >= 201703L + if (std::mblen(nullptr, 0) != 0) { + std::cerr << "count_chars_mblen: State-dependent encoding is unsupported." << std::endl; + std::exit(1); + } +#else + // C++14 以前: std::mblen 内部の std::mbstate_t を初期化する必要あり std::mblen(nullptr, 0); +#endif int count = 0; std::size_t i = 0; From 2c1699c50258564e002b7f4ca4baa58307b85d49 Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Tue, 6 Jan 2026 15:37:48 +0900 Subject: [PATCH 2601/3948] =?UTF-8?q?feat(mblen):=20C=E8=A6=8F=E6=A0=BC?= =?UTF-8?q?=E5=A4=89=E6=9B=B4=E3=81=AE=E7=B5=8C=E7=B7=AF=E3=81=AB=E3=81=A4?= =?UTF-8?q?=E3=81=84=E3=81=A6=E3=81=AE=E9=96=A2=E9=80=A3=E9=A0=85=E7=9B=AE?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cstdlib/mblen.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/reference/cstdlib/mblen.md b/reference/cstdlib/mblen.md index afb248e4b4..dc6fa62bae 100644 --- a/reference/cstdlib/mblen.md +++ b/reference/cstdlib/mblen.md @@ -18,10 +18,10 @@ namespace std { `n`は解析に使用する最大バイト数を指定する。 -エンコーディングの内部状態に関する振る舞いが最近の規格で変更されたことから、 内部状態に依存するエンコーディングを考慮するならば、 特に理由がない限り `std::mblen` ではなく `std::mbstate_t` を受け取る `std::mbrlen` を 新しいコードでは用いるべきである。 +エンコーディングの内部状態に関する振る舞いが C11 で変更 (WG14 N1373) されたが、 以前の振る舞いではスレッドセーフではなく、 現在の振る舞いではそもそも内部状態に依存する使い方ができない。 @@ -135,3 +135,14 @@ int main() { ## 関連項目 - [`mbrlen`](../cwchar/mbrlen.md.nolink): `std::mbstate_t` を受け取るスレッドセーフなバージョン +- [WG14 N1373: Wording improvements for mblen, mbtowc, and c16rtomb](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1373.htm) + - C11 以降内部状態が最初に初期化されることになった。「表現の改善」としてこの破壊的な変更が実施されたように見える。 + - [musl のメーリングリスト - 2019-12-26](https://www.openwall.com/lists/musl/2019/12/26/7) にて Florian Weimer が以下のように指摘している: + "actual users of the interfaces with legacy charsets do not seem to be represented on the standards committee anymore (see the mblen behavioral change in C11 as evidence supporting this theory)." + 意訳: 「(C11 で入った mblen の振る舞い変更でも分かるように) C標準化委員会には古い文字コードを使っている人はもういないようだ。」 +- [WG14 N2037: mblen, mbtowc, and wctomb thread-safety](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2037.htm) + - [WG14 DR498: mblen, mbtowc, and wctomb thread-safety](https://www.open-std.org/jtc1/sc22/wg14/issues/c11c17/issue0498.html) + - [WG14 N2246: Make mblen, mbtowc, and wctomb thread-safe for encodings that are not state-dependent](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2246.htm) + - [WG14 N2281: Make mblen, mbtowc, and wctomb thread-safe for encodings that are not state-dependent](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2281.htm) + - [WG14 N2358: No internal state for mblen](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2358.htm) + - C11 以降もあたかも `mblen` が内部状態を持つかのような記述になっていたのが C23 で修正された。 From 8c372ac4c311708f8c1439e807595198767defe0 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sat, 31 Jan 2026 13:25:25 +0900 Subject: [PATCH 2602/3948] =?UTF-8?q?C++26=E5=AF=BE=E5=BF=9C=E3=81=A8?= =?UTF-8?q?=E3=81=97=E3=81=A6initializer=5Flist/valarray=E9=96=A2=E9=80=A3?= =?UTF-8?q?=E3=81=AE=E3=82=A4=E3=83=86=E3=83=AC=E3=83=BC=E3=82=BF=E3=81=AE?= =?UTF-8?q?=E4=B8=8D=E6=95=B4=E5=90=88=E3=82=92=E7=9B=B4=E3=81=99=E5=A4=89?= =?UTF-8?q?=E6=9B=B4=E3=82=92=E9=81=A9=E7=94=A8=20#1564?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 6 +- .../initializer_list/initializer_list.md | 12 ++-- .../initializer_list/begin_free.md | 8 ++- .../initializer_list/initializer_list/data.md | 60 ++++++++++++++++++ .../initializer_list/empty.md | 63 +++++++++++++++++++ .../initializer_list/end_free.md | 8 ++- reference/iterator/begin.md | 35 ++++++++--- reference/iterator/cbegin.md | 1 + reference/iterator/cend.md | 1 + reference/iterator/crbegin.md | 10 ++- reference/iterator/crend.md | 10 ++- reference/iterator/data.md | 25 ++++++-- reference/iterator/empty.md | 37 +++++++---- reference/iterator/end.md | 35 ++++++++--- reference/iterator/rbegin.md | 44 +++++++++---- reference/iterator/rend.md | 44 +++++++++---- reference/iterator/size.md | 13 +++- reference/iterator/ssize.md | 14 ++++- reference/valarray/valarray.md | 14 ++++- reference/valarray/valarray/begin.md | 63 +++++++++++++++++++ reference/valarray/valarray/begin_free.md | 8 ++- reference/valarray/valarray/end.md | 63 +++++++++++++++++++ reference/valarray/valarray/end_free.md | 8 ++- 23 files changed, 502 insertions(+), 80 deletions(-) create mode 100644 reference/initializer_list/initializer_list/data.md create mode 100644 reference/initializer_list/initializer_list/empty.md create mode 100644 reference/valarray/valarray/begin.md create mode 100644 reference/valarray/valarray/end.md diff --git a/lang/cpp26.md b/lang/cpp26.md index 3b31acb84f..ef7bc0dd38 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -183,12 +183,12 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - 連続イテレータのコンセプト[`contiguous_iterator`](/reference/iterator/contiguous_iterator.md)に、ポインタに変換できることを要件として追加 - [`std::initializer_list`](/reference/initializer_list/initializer_list.md)クラスを以下のように変更 - 独自に定義されていた[`std::begin()`](/reference/initializer_list/initializer_list/begin_free.md) / [`std::end()`](/reference/initializer_list/initializer_list/end_free.md)のオーバーロードを削除 (`std::cbegin()`や`std::rend()`のようなオーバーロードがなかったため、ほかとの不整合があった) - - メンバ関数[`data()`](/reference/initializer_list/initializer_list/data.md.nolink)を追加 - - メンバ関数[`empty()`](/reference/initializer_list/initializer_list/empty.md.nolink)を追加 + - メンバ関数[`data()`](/reference/initializer_list/initializer_list/data.md)を追加 + - メンバ関数[`empty()`](/reference/initializer_list/initializer_list/empty.md)を追加 - [`std::valarray`](/reference/valarray/valarray.md)クラスを以下のように変更 - 独自に定義されていた[`std::begin()`](/reference/valarray/valarray/begin_free.md) / [`std::end()`](/reference/valarray/valarray/end_free.md)のオーバーロードを削除 (`std::cbegin()`や`std::rend()`のようなオーバーロードがなかったため、ほかとの不整合があった) - メンバ型`iterator` / `const_iterator`を追加 - - メンバ関数[`begin()`](/reference/valarray/valarray/begin.md.nolink) / [`end()`](/reference/valarray/valarray/end.md.nolink)を追加 + - メンバ関数[`begin()`](/reference/valarray/valarray/begin.md) / [`end()`](/reference/valarray/valarray/end.md)を追加 - イテレータインタフェースの非メンバ関数[`std::begin()`](/reference/iterator/begin.md) / [`std::end()`](/reference/iterator/end.md) / [`std::cbegin()`](/reference/iterator/cbegin.md) / [`std::cend()`](/reference/iterator/cend.md) / [`std::rbegin()`](/reference/iterator/rbegin.md) / [`std::rend()`](/reference/iterator/rend.md) / [`std::crbegin()`](/reference/iterator/crbegin.md) / [`std::crend()`](/reference/iterator/crend.md) / [`std::size()`](/reference/iterator/size.md) / [`std::ssize()`](/reference/iterator/ssize.md) / [`std::empty()`](/reference/iterator/empty.md) / [`std::data()`](/reference/iterator/data.md)を以下のように変更 - [`std::initializer_list`](/reference/initializer_list/initializer_list.md)型に対するオーバーロードを削除 (専用のオーバーロードを用意しなくても汎用オーバーロードが使用できるようになった) - 条件付き`noexcept`指定を追加 diff --git a/reference/initializer_list/initializer_list.md b/reference/initializer_list/initializer_list.md index b68433652e..d4ba9087bf 100644 --- a/reference/initializer_list/initializer_list.md +++ b/reference/initializer_list/initializer_list.md @@ -21,9 +21,11 @@ namespace std { |--------------------------------|----------------|-------| | [`(constructor)`](initializer_list/op_constructor.md) | コンストラクタ | C++11 | | `~initializer_list() = default;` | デストラクタ | C++11 | -| [`size`](initializer_list/size.md) | 要素数を取得する | C++11 | -| [`begin`](initializer_list/begin.md) | 先頭要素へのポインタを取得する | C++11 | -| [`end`](initializer_list/end.md) | 最後尾要素の次を指すポインタを取得する | C++11 | +| [`size`](initializer_list/size.md) | 要素数を取得する | C++11 | +| [`begin`](initializer_list/begin.md) | 先頭要素へのポインタを取得する | C++11 | +| [`end`](initializer_list/end.md) | 最後尾要素の次を指すポインタを取得する | C++11 | +| [`data`](initializer_list/data.md) | 配列の先頭へのポインタを取得する | C++26 | +| [`empty`](initializer_list/empty.md) | 配列が空かどうかを判定する | C++26 | ## メンバ型 @@ -42,8 +44,8 @@ namespace std { | 名前 | 説明 | 対応バージョン | |-------------------|------------|-------| -| [`begin`](initializer_list/begin_free.md) | 先頭要素へのポインタを取得する | C++11 | -| [`end`](initializer_list/end_free.md) | 最後尾要素の次を指すポインタを取得する | C++11 | +| [`begin`](initializer_list/begin_free.md) | 先頭要素へのポインタを取得する | C++11
C++26で削除 | +| [`end`](initializer_list/end_free.md) | 最後尾要素の次を指すポインタを取得する | C++11
C++26で削除 | ## 例 diff --git a/reference/initializer_list/initializer_list/begin_free.md b/reference/initializer_list/initializer_list/begin_free.md index 87c424f4c2..7b38f0fea5 100644 --- a/reference/initializer_list/initializer_list/begin_free.md +++ b/reference/initializer_list/initializer_list/begin_free.md @@ -3,15 +3,18 @@ * std[meta namespace] * function template[meta id-type] * cpp11[meta cpp] +* cpp26removed[meta cpp] ```cpp template -const E* begin(initializer_list il) noexcept; // C++11 +const E* begin(initializer_list il) noexcept; // C++11、C++26で削除 template -constexpr const E* begin(initializer_list il) noexcept; // C++14 +constexpr const E* begin(initializer_list il) noexcept; // C++14、C++26で削除 ``` +この関数はC++26で削除された。代わりに[``](/reference/iterator.md)ヘッダで定義される[`std::begin()`](/reference/iterator/begin.md)関数を使用すること。[``](/reference/iterator.md)ヘッダの[`std::begin()`](/reference/iterator/begin.md)関数経由でメンバ関数の[`begin()`](begin.md)を呼び出せるため不要である。 + ## 概要 先頭要素を指すポインタを取得する。 @@ -61,3 +64,4 @@ int main() ## 参照 - [N3257 Range-based for statements and ADL](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3257.pdf) - [N3471 Constexpr Library Additions: utilities, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3471.html) +- [P3016R6 Resolve inconsistencies in `begin`/`end` for `valarray` and `braced-initializer-list`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3016r6.html) diff --git a/reference/initializer_list/initializer_list/data.md b/reference/initializer_list/initializer_list/data.md new file mode 100644 index 0000000000..c3a71e8f37 --- /dev/null +++ b/reference/initializer_list/initializer_list/data.md @@ -0,0 +1,60 @@ +# data +* initializer_list[meta header] +* std[meta namespace] +* initializer_list[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr const E* data() const noexcept; // (1) C++26 +``` + +## 概要 +配列の先頭へのポインタを取得する。 + + +## 戻り値 +配列の先頭要素を指すポインタを返す。 + +配列の要素数が空である場合、[`begin()`](begin.md)と同じ未規定のポインタ値を返す。 + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::initializer_list init = {1, 2, 3}; + + const int* p = init.data(); + + std::cout << *p << std::endl; +} +``` +* init.data()[color ff0000] + +### 出力 +``` +1 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3016R6 Resolve inconsistencies in `begin`/`end` for `valarray` and `braced-initializer-list`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3016r6.html) diff --git a/reference/initializer_list/initializer_list/empty.md b/reference/initializer_list/initializer_list/empty.md new file mode 100644 index 0000000000..f9e1b9f151 --- /dev/null +++ b/reference/initializer_list/initializer_list/empty.md @@ -0,0 +1,63 @@ +# empty +* initializer_list[meta header] +* std[meta namespace] +* initializer_list[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr bool empty() const noexcept; // (1) C++26 +``` + +## 概要 +配列が空かどうかを判定する。 + + +## 戻り値 +```cpp +size() == 0 +``` +* size()[link size.md] + + +## 例外 +投げない + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::initializer_list init = {1, 2, 3}; + std::initializer_list empty_init = {}; + + std::cout << std::boolalpha; + std::cout << init.empty() << std::endl; + std::cout << empty_init.empty() << std::endl; +} +``` +* empty()[color ff0000] + +### 出力 +``` +false +true +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3016R6 Resolve inconsistencies in `begin`/`end` for `valarray` and `braced-initializer-list`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3016r6.html) diff --git a/reference/initializer_list/initializer_list/end_free.md b/reference/initializer_list/initializer_list/end_free.md index a4b91264bc..b250398a9f 100644 --- a/reference/initializer_list/initializer_list/end_free.md +++ b/reference/initializer_list/initializer_list/end_free.md @@ -3,15 +3,18 @@ * std[meta namespace] * function template[meta id-type] * cpp11[meta cpp] +* cpp26removed[meta cpp] ```cpp template -const E* end(initializer_list il) noexcept; // C++11 +const E* end(initializer_list il) noexcept; // C++11、C++26で削除 template -constexpr const E* end(initializer_list il) noexcept; // C++14 +constexpr const E* end(initializer_list il) noexcept; // C++14、C++26で削除 ``` +この関数はC++26で削除された。代わりに[``](/reference/iterator.md)ヘッダで定義される[`std::end()`](/reference/iterator/end.md)関数を使用すること。[``](/reference/iterator.md)ヘッダの[`std::end()`](/reference/iterator/end.md)関数経由でメンバ関数の[`end()`](end.md)を呼び出せるため不要である。 + ## 概要 最後尾要素の次を指すポインタを取得する。 @@ -65,3 +68,4 @@ int main() ## 参照 - [N3257 Range-based for statements and ADL](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3257.pdf) - [N3471 Constexpr Library Additions: utilities, v3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3471.html) +- [P3016R6 Resolve inconsistencies in `begin`/`end` for `valarray` and `braced-initializer-list`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3016r6.html) diff --git a/reference/iterator/begin.md b/reference/iterator/begin.md index 9bb8652b16..22689d2ac2 100644 --- a/reference/iterator/begin.md +++ b/reference/iterator/begin.md @@ -7,22 +7,40 @@ ```cpp namespace std { template - auto begin(C& c) -> decltype(c.begin()); // (1) C++11 - + auto + begin(C& c) + -> decltype(c.begin()); // (1) C++11 + template + constexpr auto + begin(C& c) + -> decltype(c.begin()); // (1) C++17 template - constexpr auto begin(C& c) -> decltype(c.begin()); // (1) C++17 + constexpr auto + begin(C& c) + noexcept(noexcept(c.begin())) + -> decltype(c.begin()); // (1) C++26 template - auto begin(const C& c) -> decltype(c.begin()); // (2) C++11 + auto + begin(const C& c) + -> decltype(c.begin()); // (2) C++11 template - constexpr auto begin(const C& c) -> decltype(c.begin()); // (2) C++17 + constexpr auto + begin(const C& c) + -> decltype(c.begin()); // (2) C++17 + template + constexpr auto + begin(const C& c) + noexcept(noexcept(c.begin())) + -> decltype(c.begin()); // (2) C++26 template - T* begin(T (&array)[N]); // (3) C++11 - + T* + begin(T (&array)[N]); // (3) C++11 template - constexpr T* begin(T (&array)[N]) noexcept; // (3) C++14 + constexpr T* + begin(T (&array)[N]) noexcept; // (3) C++14 } ``` @@ -106,3 +124,4 @@ int main() - [boost::begin() - Boost Range Library](http://www.boost.org/doc/libs/release/libs/range/doc/html/range/reference/concept_implementation/semantics/functions.html) - [LWG2280 - begin/end for arrays should be constexpr and noexcept](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#2280) - [P0031R0 A Proposal to Add Constexpr Modifiers to `reverse_iterator`, `move_iterator`, `array` and Range Access](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0031r0.html) +- [P3016R6 Resolve inconsistencies in `begin`/`end` for `valarray` and `braced-initializer-list`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3016r6.html) diff --git a/reference/iterator/cbegin.md b/reference/iterator/cbegin.md index 849fd6557a..2173ba7591 100644 --- a/reference/iterator/cbegin.md +++ b/reference/iterator/cbegin.md @@ -67,3 +67,4 @@ int main() ## 参照 - [LWG Issue 2128. Absence of global functions `cbegin`/`cend`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2128) +- [P3016R6 Resolve inconsistencies in `begin`/`end` for `valarray` and `braced-initializer-list`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3016r6.html) diff --git a/reference/iterator/cend.md b/reference/iterator/cend.md index ac7f5c7209..91837eb2df 100644 --- a/reference/iterator/cend.md +++ b/reference/iterator/cend.md @@ -67,3 +67,4 @@ int main() ## 参照 - [LWG Issue 2128. Absence of global functions `cbegin`/`cend`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2128) +- [P3016R6 Resolve inconsistencies in `begin`/`end` for `valarray` and `braced-initializer-list`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3016r6.html) diff --git a/reference/iterator/crbegin.md b/reference/iterator/crbegin.md index 52901c357c..7445f88728 100644 --- a/reference/iterator/crbegin.md +++ b/reference/iterator/crbegin.md @@ -7,7 +7,14 @@ ```cpp namespace std { template - auto crbegin(const C& c) -> decltype(std::rbegin(c)); + auto + crbegin(const C& c) + -> decltype(std::rbegin(c)); // (1) C++14 + template + constexpr auto + crbegin(const C& c) + noexcept(noexcept(std::rbegin(c))) + -> decltype(std::rbegin(c)); // (1) C++26 } ``` * std::rbegin[link rbegin.md] @@ -94,3 +101,4 @@ int main() ## 参照 - [LWG Issue 2128. Absence of global functions `cbegin`/`cend`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2128) +- [P3016R6 Resolve inconsistencies in `begin`/`end` for `valarray` and `braced-initializer-list`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3016r6.html) diff --git a/reference/iterator/crend.md b/reference/iterator/crend.md index de627c147f..6201900b89 100644 --- a/reference/iterator/crend.md +++ b/reference/iterator/crend.md @@ -7,7 +7,14 @@ ```cpp namespace std { template - auto crend(const C& c) -> decltype(std::rend(c)); + auto + crend(const C& c) + -> decltype(std::rend(c)); // (1) C++14 + template + constexpr auto + crend(const C& c) + noexcept(noexcept(std::rend(c))) + -> decltype(std::rend(c)); // (1) C++26 } ``` * std::rend[link rend.md] @@ -94,3 +101,4 @@ int main() ## 参照 - [LWG Issue 2128. Absence of global functions `cbegin`/`cend`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2128) +- [P3016R6 Resolve inconsistencies in `begin`/`end` for `valarray` and `braced-initializer-list`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3016r6.html) diff --git a/reference/iterator/data.md b/reference/iterator/data.md index f4a8964c5e..fc00782f82 100644 --- a/reference/iterator/data.md +++ b/reference/iterator/data.md @@ -7,20 +7,36 @@ ```cpp namespace std { template - constexpr auto data(C& c) -> decltype(c.data()); // (1) C++17 + constexpr + auto data(C& c) + -> decltype(c.data()); // (1) C++17 + template + constexpr auto data(C& c) + noexcept(noexcept(c.data())) + -> decltype(c.data()); // (1) C++26 template - constexpr auto data(const C& c) -> decltype(c.data()); // (2) C++17 + constexpr auto + data(const C& c) + -> decltype(c.data()); // (2) C++17 + template + constexpr auto data(const C& c) + noexcept(noexcept(c.data())) + -> decltype(c.data()); // (2) C++26 template - constexpr T* data(T (&array)[N]) noexcept; // (3) C++17 + constexpr T* + data(T (&array)[N]) noexcept; // (3) C++17 template - constexpr const E* data(initializer_list il) noexcept; // (4) C++17 + constexpr const E* + data(initializer_list il) noexcept; // (4) C++17、C++26で削除 } ``` * initializer_list[link /reference/initializer_list/initializer_list.md] +(4)はC++26で削除された。[`std::initializer_list`](/reference/initializer_list/initializer_list.md)に、メンバ関数版の[`data()`](/reference/initializer_list/initializer_list/data.md)が追加されたため、このオーバーフローは不要になった。使い方としてはこれまで通りに使用できる。 + ## 概要 コンテナの要素が格納されたメモリ領域へのポインタを取得する。 @@ -89,3 +105,4 @@ array size:1 at 0x22e42b0 ## 参照 - [N4280: Non-member `data()` and more (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4280.pdf) - [LWG Issue 3009. Including `` doesn't provide `std::size/empty/data`](https://wg21.cmeerw.net/lwg/issue3009) +- [P3016R6 Resolve inconsistencies in `begin`/`end` for `valarray` and `braced-initializer-list`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3016r6.html) diff --git a/reference/iterator/empty.md b/reference/iterator/empty.md index f7d983b584..8f0010614a 100644 --- a/reference/iterator/empty.md +++ b/reference/iterator/empty.md @@ -7,37 +7,51 @@ ```cpp namespace std { template - constexpr auto empty(const C& c) -> decltype(c.empty()); // (1) C++17 + constexpr auto + empty(const C& c) + -> decltype(c.empty()); // (1) C++17 template - [[nodiscard]] constexpr auto empty(const C& c) -> decltype(c.empty()); // (1) C++20 + [[nodiscard]] constexpr auto + empty(const C& c) + -> decltype(c.empty()); // (1) C++20 template - constexpr auto empty(const C& c) -> decltype(c.empty()); // (1) C++26 + constexpr auto + empty(const C& c) + noexcept(noexcept(c.empty())) + -> decltype(c.empty()); // (1) C++26 template - constexpr bool empty(const T (&array)[N]) noexcept; // (2) C++17 + constexpr bool + empty(const T (&array)[N]) noexcept; // (2) C++17 template - [[nodiscard]] constexpr bool empty(const T (&array)[N]) noexcept; // (2) C++20 + [[nodiscard]] constexpr bool + empty(const T (&array)[N]) noexcept; // (2) C++20 template - constexpr bool empty(const T (&array)[N]) noexcept; // (2) C++26 + constexpr bool + empty(const T (&array)[N]) noexcept; // (2) C++26 template - constexpr bool empty(initializer_list il) noexcept; // (3) C++17 + constexpr bool + empty(initializer_list il) noexcept; // (3) C++17、C++26で削除 template - [[nodiscard]] constexpr bool empty(initializer_list il) noexcept; // (3) C++20 - template - constexpr bool empty(initializer_list il) noexcept; // (3) C++26 + [[nodiscard]] constexpr bool + empty(initializer_list il) noexcept; // (3) C++20、C++26で削除 } ``` * initializer_list[link /reference/initializer_list/initializer_list.md] +(3)はC++26で削除された。[`std::initializer_list`](/reference/initializer_list/initializer_list.md)に、メンバ関数版の[`empty()`](/reference/initializer_list/initializer_list/empty.md)が追加されたため、このオーバーフローは不要になった。使い方としてはこれまで通りに使用できる。 + ## 概要 コンテナが空かどうかを判定する。 +- (3) : C++26で削除。汎用オーバーロード(1)を使用すること。 + ## 戻り値 - (1) : `return c.empty();` - (2) : `return false;` -- (3) : `return il.size() == 0;` +- (3) : `return il.size() == 0;` (C++26で削除) ## 備考 @@ -109,3 +123,4 @@ false - [LWG Issue 3009. Including `` doesn't provide `std::size/empty/data`](https://wg21.cmeerw.net/lwg/issue3009) - [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) - C++26で`[[nodiscard]]`指定が削除された +- [P3016R6 Resolve inconsistencies in `begin`/`end` for `valarray` and `braced-initializer-list`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3016r6.html) diff --git a/reference/iterator/end.md b/reference/iterator/end.md index 9ce6ab36f4..4720c3146c 100644 --- a/reference/iterator/end.md +++ b/reference/iterator/end.md @@ -7,22 +7,40 @@ ```cpp namespace std { template - auto end(C& c) -> decltype(c.end()); // (1) C++11 - + auto + end(C& c) + -> decltype(c.end()); // (1) C++11 template - constexpr auto end(C& c) -> decltype(c.end()); // (1) C++17 - + constexpr auto + end(C& c) + -> decltype(c.end()); // (1) C++17 template - auto end(const C& c) -> decltype(c.end()); // (2) C++11 + constexpr auto + end(C& c) + noexcept(noexcept(c.end())) + -> decltype(c.end()); // (1) C++26 template - constexpr auto end(const C& c) -> decltype(c.end()); // (2) C++17 + auto + end(const C& c) + -> decltype(c.end()); // (2) C++11 + template + constexpr auto + end(const C& c) + -> decltype(c.end()); // (2) C++17 + template + constexpr auto + end(const C& c) + noexcept(noexcept(c.end())) + -> decltype(c.end()); // (2) C++26 template - T* end(T (&array)[N]); // (3) C++11 + T* + end(T (&array)[N]); // (3) C++11 template - constexpr T* end(T (&array)[N]) noexcept; // (3) C++14 + constexpr T* + end(T (&array)[N]) noexcept; // (3) C++14 } ``` @@ -105,3 +123,4 @@ int main() - [N2930 Range-Based For Loop Wording (Without Concepts)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2930.html) - [LWG2280 - begin/end for arrays should be constexpr and noexcept](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#2280) - [P0031R0 A Proposal to Add Constexpr Modifiers to `reverse_iterator`, `move_iterator`, `array` and Range Access](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0031r0.html) +- [P3016R6 Resolve inconsistencies in `begin`/`end` for `valarray` and `braced-initializer-list`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3016r6.html) diff --git a/reference/iterator/rbegin.md b/reference/iterator/rbegin.md index 173f6b21ab..7acdbca091 100644 --- a/reference/iterator/rbegin.md +++ b/reference/iterator/rbegin.md @@ -7,28 +7,47 @@ ```cpp namespace std { template - auto rbegin(C& c) -> decltype(c.rbegin()); // (1) C++14 - + auto + rbegin(C& c) + -> decltype(c.rbegin()); // (1) C++14 template - constexpr auto rbegin(C& c) -> decltype(c.rbegin()); // (1) C++17 - + constexpr auto + rbegin(C& c) + -> decltype(c.rbegin()); // (1) C++17 template - auto rbegin(const C& c) -> decltype(c.rbegin()); // (2) C++14 + constexpr auto + rbegin(C& c) + noexcept(noexcept(c.rbegin())) + -> decltype(c.rbegin()); // (1) C++26 template - constexpr auto rbegin(const C& c) -> decltype(c.rbegin()); // (2) C++17 + auto + rbegin(const C& c) + -> decltype(c.rbegin()); // (2) C++14 + template + constexpr auto + rbegin(const C& c) + -> decltype(c.rbegin()); // (2) C++17 + template + constexpr auto + rbegin(const C& c) + noexcept(noexcept(c.rbegin())) + -> decltype(c.rbegin()); // (2) C++26 template - reverse_iterator rbegin(T (&array)[N]); // (3) C++14 - + reverse_iterator + rbegin(T (&array)[N]); // (3) C++14 template - constexpr reverse_iterator rbegin(T (&array)[N]); // (3) C++17 + constexpr reverse_iterator + rbegin(T (&array)[N]) noexcept; // (3) C++17 template - reverse_iterator rbegin(initializer_list il); // (4) C++14 + reverse_iterator + rbegin(initializer_list il); // (4) C++14 template - constexpr reverse_iterator rbegin(initializer_list il); // (4) C++17 + constexpr reverse_iterator + rbegin(initializer_list il); // (4) C++17 } ``` * reverse_iterator[link reverse_iterator.md] @@ -40,7 +59,7 @@ namespace std { - (1) : コンテナの`rbegin()`メンバ関数で、範囲の末尾を指す、逆イテレータを返す。 - (2) : コンテナの`rbegin()`メンバ関数で、範囲の末尾を指す、読み取り専用逆イテレータを返す。 - (3) : 組み込み配列の末尾を指す、逆イテレータを返す。 -- (4) : `initializer_list`オブジェクトの末尾を指す、読み取り専用逆イテレータを返す。 +- (4) : `initializer_list`オブジェクトの末尾を指す、読み取り専用逆イテレータを返す。C++26で削除。 ## 戻り値 @@ -122,3 +141,4 @@ int main() ## 参照 - [LWG Issue 2128. Absence of global functions `cbegin`/`cend`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2128) - [P0031R0 A Proposal to Add Constexpr Modifiers to `reverse_iterator`, `move_iterator`, `array` and Range Access](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0031r0.html) +- [P3016R6 Resolve inconsistencies in `begin`/`end` for `valarray` and `braced-initializer-list`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3016r6.html) diff --git a/reference/iterator/rend.md b/reference/iterator/rend.md index e4c6643627..e485f0baff 100644 --- a/reference/iterator/rend.md +++ b/reference/iterator/rend.md @@ -7,28 +7,47 @@ ```cpp namespace std { template - auto rend(C& c) -> decltype(c.rend()); // (1) C++14 - + auto + rend(C& c) + -> decltype(c.rend()); // (1) C++14 template - constexpr auto rend(C& c) -> decltype(c.rend()); // (1) C++17 - + constexpr auto + rend(C& c) + -> decltype(c.rend()); // (1) C++17 template - auto rend(const C& c) -> decltype(c.rend()); // (2) C++14 + constexpr auto + rend(C& c) + noexcept(noexcept(c.rend())) + -> decltype(c.rend()); // (1) C++26 template - constexpr auto rend(const C& c) -> decltype(c.rend()); // (2) C++17 + auto + rend(const C& c) + -> decltype(c.rend()); // (2) C++14 + template + constexpr auto + rend(const C& c) + -> decltype(c.rend()); // (2) C++17 + template + constexpr auto + rend(const C& c) + noexcept(noexcept(c.rend())) + -> decltype(c.rend()); // (2) C++26 template - reverse_iterator rend(T (&array)[N]); // (3) C++14 - + reverse_iterator + rend(T (&array)[N]); // (3) C++14 template - constexpr reverse_iterator rend(T (&array)[N]); // (3) C++17 + constexpr reverse_iterator + rend(T (&array)[N]) noexcept; // (3) C++17 template - reverse_iterator rend(initializer_list il); // (4) C++14 + reverse_iterator + rend(initializer_list il); // (4) C++14 template - constexpr reverse_iterator rend(initializer_list il); // (4) C++17 + constexpr reverse_iterator + rend(initializer_list il); // (4) C++17 } ``` * reverse_iterator[link reverse_iterator.md] @@ -40,7 +59,7 @@ namespace std { - (1) : コンテナの`rend()`メンバ関数で、範囲の先頭の前を指す、逆イテレータを返す。 - (2) : コンテナの`rend()`メンバ関数で、範囲の先頭の前を指す、読み取り専用逆イテレータを返す。 - (3) : 組み込み配列の先頭の前を指す、逆イテレータを返す。 -- (4) : `initializer_list`オブジェクトの先頭の前を指す、読み取り専用逆イテレータを返す。 +- (4) : `initializer_list`オブジェクトの先頭の前を指す、読み取り専用逆イテレータを返す。C++26で削除。 ## 戻り値 @@ -122,3 +141,4 @@ int main() ## 参照 - [LWG Issue 2128. Absence of global functions `cbegin`/`cend`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2128) - [P0031R0 A Proposal to Add Constexpr Modifiers to `reverse_iterator`, `move_iterator`, `array` and Range Access](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0031r0.html) +- [P3016R6 Resolve inconsistencies in `begin`/`end` for `valarray` and `braced-initializer-list`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3016r6.html) diff --git a/reference/iterator/size.md b/reference/iterator/size.md index 21906c4d58..e5eff625bc 100644 --- a/reference/iterator/size.md +++ b/reference/iterator/size.md @@ -7,10 +7,18 @@ ```cpp namespace std { template - constexpr auto size(const C& c) -> decltype(c.size()); // (1) + constexpr auto + size(const C& c) + -> decltype(c.size()); // (1) C++17 + template + constexpr auto + size(const C& c) + noexcept(noexcept(c.size())) + -> decltype(c.size()); // (1) C++26 template - constexpr std::size_t size(const T (&array)[N]) noexcept; // (2) + constexpr std::size_t + size(const T (&array)[N]) noexcept; // (2) C++17 } ``` @@ -101,3 +109,4 @@ int main() - [`boost::size()` - Boost Range Library](http://www.boost.org/doc/libs/release/libs/range/doc/html/range/reference/concept_implementation/semantics/functions.html) - [N4280: Non-member `size()` and more (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4280.pdf) - [LWG Issue 3009. Including `` doesn't provide `std::size/empty/data`](https://wg21.cmeerw.net/lwg/issue3009) +- [P3016R6 Resolve inconsistencies in `begin`/`end` for `valarray` and `braced-initializer-list`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3016r6.html) diff --git a/reference/iterator/ssize.md b/reference/iterator/ssize.md index 47dab83d46..c7d45bfa7b 100644 --- a/reference/iterator/ssize.md +++ b/reference/iterator/ssize.md @@ -7,11 +7,18 @@ ```cpp namespace std { template - constexpr auto ssize(const C& c) - -> common_type_t>; // (1) + constexpr auto + ssize(const C& c) + -> common_type_t>; // (1) C++20 + template + constexpr auto + ssize(const C& c) + noexcept(noexcept(c.size())) + -> common_type_t>; // (1) C++26 template - constexpr ptrdiff_t ssize(const T (&array)[N]) noexcept; // (2) + constexpr ptrdiff_t + ssize(const T (&array)[N]) noexcept; // (2) C++20 } ``` * ptrdiff_t[link /reference/cstddef/ptrdiff_t.md] @@ -75,3 +82,4 @@ int main() ## 参照 - [P1227: Signed `ssize()` functions, unsigned `size()` functions (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1227r2.html) +- [P3016R6 Resolve inconsistencies in `begin`/`end` for `valarray` and `braced-initializer-list`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3016r6.html) diff --git a/reference/valarray/valarray.md b/reference/valarray/valarray.md index c73e7165bb..4c78146856 100644 --- a/reference/valarray/valarray.md +++ b/reference/valarray/valarray.md @@ -87,6 +87,14 @@ valarray c = a + b; | [`operator>>=`](valarray/op_right_shift_assign.md) | 右シフトの複合代入 | | +### イテレータ + +| 名前 | 説明 | 対応バージョン | +|--------------------------------|--------------------------------------|-------| +| [`begin`](valarray/begin.md) | 先頭の要素を指すイテレータを取得する | C++26 | +| [`end`](valarray/end.md) | 末尾の次を指すイテレータを取得する | C++26 | + + ### その他メンバ関数 | 名前 | 説明 | 対応バージョン | @@ -108,6 +116,8 @@ valarray c = a + b; | 名前 | 説明 | 対応バージョン | |--------------|-----------|----------------| | `value_type` | 要素型`T` | | +| `iterator` | イテレータ型 (具体的な型は未規定) | C++26 | +| `const_iterator` | 読み取り専用イテレータ型 (具体的な型は未規定) | C++26 | ## 非メンバ関数 @@ -123,8 +133,8 @@ valarray c = a + b; | 名前 | 説明 | 対応バージョン | |--------------------------------|--------------------------------------|-------| -| [`begin`](valarray/begin_free.md) | 先頭の要素を指すイテレータを取得する | C++11 | -| [`end`](valarray/end_free.md) | 末尾の次を指すイテレータを取得する | C++11 | +| [`begin`](valarray/begin_free.md) | 先頭の要素を指すイテレータを取得する | C++11
C++26で削除 | +| [`end`](valarray/end_free.md) | 末尾の次を指すイテレータを取得する | C++11
C++26で削除 | ### 四則演算 diff --git a/reference/valarray/valarray/begin.md b/reference/valarray/valarray/begin.md new file mode 100644 index 0000000000..ced1bb49c8 --- /dev/null +++ b/reference/valarray/valarray/begin.md @@ -0,0 +1,63 @@ +# begin +* valarray[meta header] +* std[meta namespace] +* valarray[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +iterator begin(); // (1) C++26 +const_iterator begin() const; // (2) C++26 +``` + +## 概要 +先頭の要素を指すイテレータを取得する。 + + +## 戻り値 +先頭要素を指すイテレータを返す。 + + +## 備考 +- この関数によって返されるイテレータは、[`resize()`](resize.md)メンバ関数が呼び出されると無効になる + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::valarray va = {1, 2, 3}; + + std::for_each(va.begin(), va.end(), [](int x) { + std::cout << x << std::endl; + }); +} +``` +* va.begin()[color ff0000] +* va.end()[link end.md] + +### 出力 +``` +1 +2 +3 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3016R6 Resolve inconsistencies in `begin`/`end` for `valarray` and `braced-initializer-list`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3016r6.html) diff --git a/reference/valarray/valarray/begin_free.md b/reference/valarray/valarray/begin_free.md index 226d030cdf..10ed0f699b 100644 --- a/reference/valarray/valarray/begin_free.md +++ b/reference/valarray/valarray/begin_free.md @@ -3,19 +3,22 @@ * std[meta namespace] * function template[meta id-type] * cpp11[meta cpp] +* cpp26removed[meta cpp] ```cpp namespace std { template - unspecified1 begin(valarray& va); // (1) + unspecified1 begin(valarray& va); // (1) C++11、C++26で削除 template - unspecified2 begin(const valarray& va); // (2) + unspecified2 begin(const valarray& va); // (2) C++11、C++26で削除 } ``` * unspecified1[italic] * unspecified2[italic] +この関数はC++26で削除された。代わりにメンバ関数版の[`begin()`](begin.md)および、[``](/reference/iterator.md)ヘッダで定義される[`std::begin()`](/reference/iterator/begin.md)関数を使用すること。 + ## 概要 先頭の要素を指すイテレータを取得する。 @@ -86,3 +89,4 @@ int main() ## 参照 - [N2930 Range-Based For Loop Wording (Without Concepts)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2930.html) - [LWG2058. valarray and begin/end](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2058) +- [P3016R6 Resolve inconsistencies in `begin`/`end` for `valarray` and `braced-initializer-list`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3016r6.html) diff --git a/reference/valarray/valarray/end.md b/reference/valarray/valarray/end.md new file mode 100644 index 0000000000..0636bd5537 --- /dev/null +++ b/reference/valarray/valarray/end.md @@ -0,0 +1,63 @@ +# end +* valarray[meta header] +* std[meta namespace] +* valarray[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +iterator end(); // (1) C++26 +const_iterator end() const; // (2) C++26 +``` + +## 概要 +末尾の次を指すイテレータを取得する。 + + +## 戻り値 +末尾の次を指すイテレータを返す。 + + +## 備考 +- この関数によって返されるイテレータは、[`resize()`](resize.md)メンバ関数が呼び出されると無効になる + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::valarray va = {1, 2, 3}; + + std::for_each(va.begin(), va.end(), [](int x) { + std::cout << x << std::endl; + }); +} +``` +* va.end()[color ff0000] +* va.begin()[link begin.md] + +### 出力 +``` +1 +2 +3 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3016R6 Resolve inconsistencies in `begin`/`end` for `valarray` and `braced-initializer-list`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3016r6.html) diff --git a/reference/valarray/valarray/end_free.md b/reference/valarray/valarray/end_free.md index 61a91a36f5..41dc9e1290 100644 --- a/reference/valarray/valarray/end_free.md +++ b/reference/valarray/valarray/end_free.md @@ -3,19 +3,22 @@ * std[meta namespace] * function template[meta id-type] * cpp11[meta cpp] +* cpp26removed[meta cpp] ```cpp namespace std { template - unspecified1 end(valarray& va); // (1) + unspecified1 end(valarray& va); // (1) C++11、C++26で削除 template - unspecified2 end(const valarray& va); // (2) + unspecified2 end(const valarray& va); // (2) C++11、C++26で削除 } ``` * unspecified1[italic] * unspecified2[italic] +この関数はC++26で削除された。代わりにメンバ関数版の[`end()`](end.md)および、[``](/reference/iterator.md)ヘッダで定義される[`std::end()`](/reference/iterator/end.md)関数を使用すること。 + ## 概要 末尾の次を指すイテレータを取得する。 @@ -86,3 +89,4 @@ int main() ## 参照 - [N2930 Range-Based For Loop Wording (Without Concepts)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2930.html) - [LWG2058. valarray and begin/end](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2058) +- [P3016R6 Resolve inconsistencies in `begin`/`end` for `valarray` and `braced-initializer-list`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3016r6.html) From fb7390f3b3db3edb315cf55792e6c79a35b001ee Mon Sep 17 00:00:00 2001 From: suomesta Date: Tue, 3 Feb 2026 20:11:20 +0900 Subject: [PATCH 2603/3948] fix link --- reference/condition_variable/condition_variable_any/wait.md | 2 +- .../condition_variable/condition_variable_any/wait_until.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/condition_variable/condition_variable_any/wait.md b/reference/condition_variable/condition_variable_any/wait.md index 32a3965798..00b11ff365 100644 --- a/reference/condition_variable/condition_variable_any/wait.md +++ b/reference/condition_variable/condition_variable_any/wait.md @@ -57,7 +57,7 @@ while (!stoken.stop_requested()) { } return pred(); ``` -* stop_requested()[link /reference/stop_token/stop_source/stop_requested.md] +* stop_requested()[link /reference/stop_token/stop_token/stop_requested.md] ## 事後条件 diff --git a/reference/condition_variable/condition_variable_any/wait_until.md b/reference/condition_variable/condition_variable_any/wait_until.md index b319626c9c..50d998e089 100644 --- a/reference/condition_variable/condition_variable_any/wait_until.md +++ b/reference/condition_variable/condition_variable_any/wait_until.md @@ -70,7 +70,7 @@ while (!stoken.stop_requested()) { } return pred(); ``` -* stop_requested()[link /reference/stop_token/stop_source/stop_requested.md] +* stop_requested()[link /reference/stop_token/stop_token/stop_requested.md] * cv_status::timeout[link /reference/condition_variable/cv_status.md] From b20232b36796b5173e693fd7778e7b563ec3d021 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 5 Feb 2026 13:53:18 +0900 Subject: [PATCH 2604/3948] =?UTF-8?q?C++26=E5=AF=BE=E5=BF=9C=E3=81=A8?= =?UTF-8?q?=E3=81=97=E3=81=A6=E4=B8=A6=E5=88=97Range=E3=82=A2=E3=83=AB?= =?UTF-8?q?=E3=82=B4=E3=83=AA=E3=82=BA=E3=83=A0=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20#1502?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/algorithm/ranges_adjacent_find.md | 61 ++++++++- reference/algorithm/ranges_all_of.md | 55 +++++++- reference/algorithm/ranges_any_of.md | 55 +++++++- reference/algorithm/ranges_contains.md | 63 +++++++++ .../algorithm/ranges_contains_subrange.md | 55 +++++++- reference/algorithm/ranges_copy.md | 59 +++++++- reference/algorithm/ranges_copy_if.md | 66 +++++++++ reference/algorithm/ranges_copy_n.md | 48 ++++++- reference/algorithm/ranges_count.md | 53 ++++++++ reference/algorithm/ranges_count_if.md | 55 +++++++- reference/algorithm/ranges_ends_with.md | 68 +++++++++- reference/algorithm/ranges_equal.md | 67 +++++++++- reference/algorithm/ranges_fill.md | 61 ++++++++- reference/algorithm/ranges_fill_n.md | 46 ++++++- reference/algorithm/ranges_find.md | 53 ++++++++ reference/algorithm/ranges_find_end.md | 71 +++++++++- reference/algorithm/ranges_find_first_of.md | 76 ++++++++++- reference/algorithm/ranges_find_if.md | 62 ++++++++- reference/algorithm/ranges_find_if_not.md | 58 +++++++- reference/algorithm/ranges_find_last.md | 66 +++++++++ reference/algorithm/ranges_find_last_if.md | 64 ++++++++- .../algorithm/ranges_find_last_if_not.md | 60 ++++++++- reference/algorithm/ranges_for_each.md | 76 +++++++++-- reference/algorithm/ranges_for_each_n.md | 61 ++++++++- reference/algorithm/ranges_generate.md | 57 +++++++- reference/algorithm/ranges_generate_n.md | 45 +++++++ .../algorithm/ranges_in_in_out_result.md | 14 +- reference/algorithm/ranges_includes.md | 74 ++++++++++ reference/algorithm/ranges_inplace_merge.md | 62 +++++++++ reference/algorithm/ranges_is_heap.md | 60 +++++++++ reference/algorithm/ranges_is_heap_until.md | 59 +++++++- reference/algorithm/ranges_is_partitioned.md | 55 ++++++++ reference/algorithm/ranges_is_sorted.md | 58 ++++++++ reference/algorithm/ranges_is_sorted_until.md | 56 ++++++++ .../ranges_lexicographical_compare.md | 74 ++++++++++ reference/algorithm/ranges_max.md | 38 ++++++ reference/algorithm/ranges_max_element.md | 53 ++++++++ reference/algorithm/ranges_merge.md | 81 +++++++++++ reference/algorithm/ranges_min.md | 38 ++++++ reference/algorithm/ranges_min_element.md | 53 ++++++++ reference/algorithm/ranges_minmax.md | 38 ++++++ reference/algorithm/ranges_minmax_element.md | 56 ++++++++ reference/algorithm/ranges_mismatch.md | 76 ++++++++++- reference/algorithm/ranges_move.md | 62 ++++++++- reference/algorithm/ranges_move_backward.md | 59 +++++++- reference/algorithm/ranges_none_of.md | 55 +++++++- reference/algorithm/ranges_nth_element.md | 63 +++++++++ reference/algorithm/ranges_partial_sort.md | 60 +++++++++ .../algorithm/ranges_partial_sort_copy.md | 78 +++++++++++ reference/algorithm/ranges_partition.md | 67 ++++++++++ reference/algorithm/ranges_partition_copy.md | 84 ++++++++++++ reference/algorithm/ranges_remove.md | 69 ++++++++++ reference/algorithm/ranges_remove_copy.md | 74 ++++++++++ reference/algorithm/ranges_remove_copy_if.md | 66 +++++++++ reference/algorithm/ranges_remove_if.md | 61 +++++++++ reference/algorithm/ranges_replace.md | 70 ++++++++++ reference/algorithm/ranges_replace_copy.md | 87 +++++++++++- reference/algorithm/ranges_replace_copy_if.md | 78 ++++++++++- reference/algorithm/ranges_replace_if.md | 66 ++++++++- reference/algorithm/ranges_reverse.md | 50 +++++++ reference/algorithm/ranges_reverse_copy.md | 64 ++++++++- reference/algorithm/ranges_rotate.md | 53 ++++++++ reference/algorithm/ranges_rotate_copy.md | 67 +++++++++- reference/algorithm/ranges_search.md | 69 ++++++++++ reference/algorithm/ranges_set_difference.md | 82 ++++++++++++ .../algorithm/ranges_set_intersection.md | 86 ++++++++++++ .../ranges_set_symmetric_difference.md | 87 +++++++++++- reference/algorithm/ranges_set_union.md | 88 ++++++++++++ reference/algorithm/ranges_shift_left.md | 52 ++++++++ reference/algorithm/ranges_shift_right.md | 52 ++++++++ reference/algorithm/ranges_sort.md | 56 ++++++++ .../algorithm/ranges_stable_partition.md | 59 ++++++++ reference/algorithm/ranges_stable_sort.md | 57 ++++++++ reference/algorithm/ranges_starts_with.md | 69 +++++++++- reference/algorithm/ranges_swap_ranges.md | 71 +++++++++- reference/algorithm/ranges_transform.md | 126 +++++++++++++++++- reference/algorithm/ranges_unique.md | 60 +++++++++ reference/algorithm/ranges_unique_copy.md | 65 +++++++++ reference/execution.md | 2 + reference/execution/execution-policy.md | 31 +++++ reference/memory/ranges_destroy.md | 48 +++++++ reference/memory/ranges_destroy_n.md | 41 ++++++ reference/memory/ranges_uninitialized_copy.md | 66 ++++++++- .../memory/ranges_uninitialized_copy_n.md | 53 ++++++++ .../ranges_uninitialized_default_construct.md | 48 +++++++ ...anges_uninitialized_default_construct_n.md | 41 ++++++ reference/memory/ranges_uninitialized_fill.md | 57 +++++++- .../memory/ranges_uninitialized_fill_n.md | 46 +++++++ reference/memory/ranges_uninitialized_move.md | 62 +++++++++ .../memory/ranges_uninitialized_move_n.md | 54 ++++++++ .../ranges_uninitialized_value_construct.md | 52 ++++++++ .../ranges_uninitialized_value_construct_n.md | 45 +++++++ reference/ranges.md | 1 + reference/ranges/sized-random-access-range.md | 27 ++++ 94 files changed, 5515 insertions(+), 77 deletions(-) create mode 100644 reference/execution/execution-policy.md create mode 100644 reference/ranges/sized-random-access-range.md diff --git a/reference/algorithm/ranges_adjacent_find.md b/reference/algorithm/ranges_adjacent_find.md index e9b81315ad..72ce400c5b 100644 --- a/reference/algorithm/ranges_adjacent_find.md +++ b/reference/algorithm/ranges_adjacent_find.md @@ -20,9 +20,36 @@ namespace std::ranges { projected, Proj>> Pred = ranges::equal_to> constexpr borrowed_iterator_t adjacent_find(R&& r, Pred pred = {}, Proj proj = {}); // (2) C++20 + + template S, + class Proj = identity, + indirect_binary_predicate, + projected> Pred = ranges::equal_to> + I adjacent_find(Ep&& exec, + I first, + S last, + Pred pred = {}, + Proj proj = {}); // (3) C++26 + + template , Proj>, + projected, Proj>> Pred = ranges::equal_to> + borrowed_iterator_t + adjacent_find(Ep&& exec, + R&& r, + Pred pred = {}, + Proj proj = {}); // (4) C++26 } ``` * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 @@ -30,6 +57,8 @@ namespace std::ranges { - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する このアルゴリズムは、範囲の先頭から1つづつ進みながら隣接するペアに対して条件を満たすかをチェックし、その条件を満たす最初の要素へのイテレータを返す。指定された条件を満たしているかをチェックされるのは、現在位置にある要素とその次の位置にある要素の2つについてであり、1つの要素は最大2回参照される。 @@ -61,6 +90,7 @@ namespace std::ranges { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -83,13 +113,13 @@ int main() { * std::ranges::distance[link /reference/iterator/ranges_distance.md] * std::ranges::adjacent_find[color ff0000] -### 出力 +#### 出力 ``` found: index==2 *it == *(it+1): true ``` -### 動作イメージ +#### 動作イメージ ``` |0 1 2 3 4 5 6| : index @@ -102,6 +132,32 @@ found: index==2 [2, 2] ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 4, 3, 3, 1, 2, 2}; + + // 並列に同じ値が連続している最初の要素を検索する + auto it = std::ranges::adjacent_find(std::execution::par, v); + if (it == v.end()) { + std::cout << "not found" << std::endl; + } else { + std::cout << "found: index==" << std::distance(v.begin(), it) << std::endl; + } +} +``` +* std::ranges::adjacent_find[color ff0000] + +#### 出力 +``` +found: index==2 +``` + ## 実装例 ```cpp struct adjacent_find_impl { @@ -144,3 +200,4 @@ inline constexpr adjacent_find_impl adjacent_find; ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_all_of.md b/reference/algorithm/ranges_all_of.md index 861c19bff4..d04dd5edf5 100644 --- a/reference/algorithm/ranges_all_of.md +++ b/reference/algorithm/ranges_all_of.md @@ -18,14 +18,40 @@ namespace std::ranges { indirect_unary_predicate, Proj>> Pred> constexpr bool all_of(R&& r, Pred pred, Proj proj = {}); // (2) C++20 + + template S, + class Proj = identity, + indirect_unary_predicate> Pred> + bool all_of(Ep&& exec, + I first, + S last, + Pred pred, + Proj proj = {}); // (3) C++26 + + template , Proj>> Pred> + bool all_of(Ep&& exec, + R&& r, + Pred pred, + Proj proj = {}); // (4) C++26 } ``` +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 範囲の全ての要素が条件を満たすかを判定する。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## テンプレートパラメータ制約 - (1): @@ -43,6 +69,7 @@ namespace std::ranges { 最大で `last - first` 回 `proj` と `pred` を実行する。 ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -64,12 +91,37 @@ int main() { ``` * std::ranges::all_of[color ff0000] -### 出力 +#### 出力 ``` true false ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {2, 4, 6, 8, 10}; + + std::cout << std::boolalpha; + + // 並列に全ての要素が偶数であるかを判定 + bool result = std::ranges::all_of(std::execution::par, v, + [](int x) { return x % 2 == 0; }); + std::cout << result << std::endl; +} +``` +* std::ranges::all_of[color ff0000] + +#### 出力 +``` +true +``` + ## 実装例 ```cpp struct all_of_impl { @@ -111,3 +163,4 @@ inline constexpr all_of_impl all_of; ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_any_of.md b/reference/algorithm/ranges_any_of.md index 25e3f53fb7..4802baf5cc 100644 --- a/reference/algorithm/ranges_any_of.md +++ b/reference/algorithm/ranges_any_of.md @@ -18,14 +18,40 @@ namespace std::ranges { indirect_unary_predicate, Proj>> Pred> constexpr bool any_of(R&& r, Pred pred, Proj proj = {}); // (2) C++20 + + template S, + class Proj = identity, + indirect_unary_predicate> Pred> + bool any_of(Ep&& exec, + I first, + S last, + Pred pred, + Proj proj = {}); // (3) C++26 + + template , Proj>> Pred> + bool any_of(Ep&& exec, + R&& r, + Pred pred, + Proj proj = {}); // (4) C++26 } ``` +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 範囲のいずれかの要素が条件を満たすかを判定する。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## テンプレートパラメータ制約 - (1): @@ -45,6 +71,7 @@ namespace std::ranges { 最大で `last - first` 回 `pred` を実行する。 ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -66,12 +93,37 @@ int main() { ``` * std::ranges::any_of[color ff0000] -### 出力 +#### 出力 ``` false true ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 3, 5, 7, 8}; + + std::cout << std::boolalpha; + + // 並列にいずれかの要素が偶数であるかを判定 + bool result = std::ranges::any_of(std::execution::par, v, + [](int x) { return x % 2 == 0; }); + std::cout << result << std::endl; +} +``` +* std::ranges::any_of[color ff0000] + +#### 出力 +``` +true +``` + ## 実装例 ```cpp struct any_of_impl { @@ -114,3 +166,4 @@ inline constexpr any_of_impl any_of; ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_contains.md b/reference/algorithm/ranges_contains.md index 7610047983..ec958c6c13 100644 --- a/reference/algorithm/ranges_contains.md +++ b/reference/algorithm/ranges_contains.md @@ -59,14 +59,52 @@ namespace std::ranges { contains(R&& r, const T& value, Proj proj = {}); // (2) C++26 + + template S, + class Proj = identity, + class T = projected_value_t> + requires indirect_binary_predicate< + ranges::equal_to, + projected, + const T* + > + bool + contains(Ep&& exec, + I first, + S last, + const T& value, + Proj proj = {}); // (3) C++26 + + template , Proj>> + requires indirect_binary_predicate< + ranges::equal_to, + projected, Proj>, + const T* + > + bool + contains(Ep&& exec, + R&& r, + const T& value, + Proj proj = {}); // (4) C++26 } ``` +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 指定された値が含まれるか調べる。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 戻り値 @@ -148,6 +186,30 @@ found ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {3, 1, 4, 1, 5}; + + std::cout << std::boolalpha; + + // 並列に値が含まれるかを判定 + bool result = std::ranges::contains(std::execution::par, v, 4); + std::cout << result << std::endl; +} +``` +* std::ranges::contains[color ff0000] + +#### 出力 +``` +true +``` + ## 実装例 ```cpp struct contains_impl { @@ -182,3 +244,4 @@ inline constexpr contains_impl contains; - [N4950 27 Algorithms library](https://timsong-cpp.github.io/cppwp/n4950/algorithms) - [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) - C++26で波カッコ初期化 (リスト初期化) に対応した +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_contains_subrange.md b/reference/algorithm/ranges_contains_subrange.md index 9be4d01fe9..55bbe2a5b9 100644 --- a/reference/algorithm/ranges_contains_subrange.md +++ b/reference/algorithm/ranges_contains_subrange.md @@ -6,7 +6,7 @@ ```cpp namespace std::ranges { - // (1) + // (1) C++23 template S1, forward_iterator I2, sentinel_for S2, class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> @@ -14,20 +14,43 @@ namespace std::ranges { constexpr bool ranges::contains_subrange(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); - // (2) + // (2) C++23 template requires indirectly_comparable, iterator_t, Pred, Proj1, Proj2> constexpr bool ranges::contains_subrange(R1&& r1, R2&& r2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); + + // (3) C++26 + template S1, + random_access_iterator I2, sized_sentinel_for S2, + class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> + requires indirectly_comparable + bool ranges::contains_subrange(Ep&& exec, I1 first1, S1 last1, I2 first2, S2 last2, + Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); + + // (4) C++26 + template + requires indirectly_comparable, iterator_t, Pred, Proj1, Proj2> + bool ranges::contains_subrange(Ep&& exec, R1&& r1, R2&& r2, Pred pred = {}, + Proj1 proj1 = {}, Proj2 proj2 = {}); } ``` +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 あるシーケンスの中に、特定のサブシーケンスが含まれるか調べる。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する サブシーケンスが空の場合は、常に`true`を返す。 @@ -40,6 +63,7 @@ first2 == last2 || !ranges::search(first1, last1, first2, last2, pred, proj1, pr 最大で `(last1 - first1) * (last2 - first2)` 回の、対応する比較もしくは述語が適用される ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -64,6 +88,32 @@ int main() { found ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5}; + std::vector sub = {2, 3, 4}; + + std::cout << std::boolalpha; + + // 並列にサブ範囲が含まれるかを判定 + bool result = std::ranges::contains_subrange( + std::execution::par, v, sub); + std::cout << result << std::endl; +} +``` +* std::ranges::contains_subrange[color ff0000] + +#### 出力 +``` +true +``` + ## 実装例 ```cpp @@ -101,3 +151,4 @@ inline constexpr contains_subrange_impl contains_subrange; ## 参照 - [N4950 27 Algorithms library](https://timsong-cpp.github.io/cppwp/n4950/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_copy.md b/reference/algorithm/ranges_copy.md index 7e13c6f733..d2579c96f4 100644 --- a/reference/algorithm/ranges_copy.md +++ b/reference/algorithm/ranges_copy.md @@ -18,18 +18,46 @@ namespace std::ranges { requires indirectly_copyable, O> constexpr copy_result, O> copy(R&& r, O result); // (2) C++20 + + template S, + random_access_iterator O, + sized_sentinel_for OutS> + requires indirectly_copyable + copy_result + copy(Ep&& exec, + I first, + S last, + O result, + OutS result_last); // (3) C++26 + + template + requires indirectly_copyable, iterator_t> + copy_result, borrowed_iterator_t> + copy(Ep&& exec, + R&& r, + OutR&& result_r); // (4) C++26 } ``` * copy_result[link ranges_in_out_result.md] * weakly_incrementable[link /reference/iterator/weakly_incrementable.md] * indirectly_copyable[link /reference/iterator/indirectly_copyable.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 指定された範囲の要素をコピーする。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定し、出力範囲の終端も指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 事前条件 @@ -57,6 +85,7 @@ copy_result { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -83,11 +112,38 @@ int main() { ``` * std::ranges::copy[color ff0000] -### 出力 +#### 出力 ``` 3,1,2, ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector src = {1, 2, 3, 4, 5}; + std::vector dst(src.size()); + + // 並列にコピーする + std::ranges::copy(std::execution::par, src, dst); + + for (int x : dst) { + std::cout << x << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::copy[color ff0000] + +#### 出力 +``` +1 2 3 4 5 +``` + ## バージョン ### 言語 - C++20 @@ -100,3 +156,4 @@ int main() { ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_copy_if.md b/reference/algorithm/ranges_copy_if.md index 978a8b995d..faf63d7368 100644 --- a/reference/algorithm/ranges_copy_if.md +++ b/reference/algorithm/ranges_copy_if.md @@ -22,18 +22,54 @@ namespace std::ranges { requires indirectly_copyable, O> constexpr copy_if_result, O> copy_if(R&& r, O result, Pred pred, Proj proj = {}); // (2) C++20 + + template S, + random_access_iterator O, + sized_sentinel_for OutS, + class Proj = identity, + indirect_unary_predicate> Pred> + requires indirectly_copyable + copy_if_result + copy_if(Ep&& exec, + I first, + S last, + O result, + OutS result_last, + Pred pred, + Proj proj = {}); // (3) C++26 + + template , Proj>> Pred> + requires indirectly_copyable, iterator_t> + copy_if_result, borrowed_iterator_t> + copy_if(Ep&& exec, + R&& r, + OutR&& result_r, + Pred pred, + Proj proj = {}); // (4) C++26 } ``` * copy_if_result[link ranges_in_out_result.md] * weakly_incrementable[link /reference/iterator/weakly_incrementable.md] * indirectly_copyable[link /reference/iterator/indirectly_copyable.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 条件を満たす要素のみをコピーする。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定し、出力範囲の終端も指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 事前条件 @@ -60,6 +96,7 @@ copy_if_result { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -91,6 +128,34 @@ int main() { 3,1,1,5,9,5, ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector src = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + std::vector dst(src.size()); + + // 並列に偶数のみをコピーする + auto result = std::ranges::copy_if(std::execution::par, src, dst, + [](int x) { return x % 2 == 0; }); + + for (auto it = dst.begin(); it != result.out; ++it) { + std::cout << *it << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::copy_if[color ff0000] + +#### 出力 +``` +2 4 6 8 10 +``` + ## バージョン ### 言語 - C++20 @@ -103,3 +168,4 @@ int main() { ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_copy_n.md b/reference/algorithm/ranges_copy_n.md index 34cb49ca28..2bb46e2877 100644 --- a/reference/algorithm/ranges_copy_n.md +++ b/reference/algorithm/ranges_copy_n.md @@ -13,17 +13,33 @@ namespace std::ranges { constexpr copy_n_result copy_n(I first, iter_difference_t n, - O result); // (1) C++20 + O result); // (1) C++20 + + template OutS> + requires indirectly_copyable + copy_n_result + copy_n(Ep&& exec, + I first, + iter_difference_t n, + O result, + OutS result_last); // (2) C++26 } ``` * copy_n_result[link ranges_in_out_result.md] * weakly_incrementable[link /reference/iterator/weakly_incrementable.md] * indirectly_copyable[link /reference/iterator/indirectly_copyable.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] ## 概要 指定された数の要素をコピーする。 - (1): イテレータ範囲を指定する +- (2): (1)の並列アルゴリズム版。実行ポリシーを指定し、出力範囲の終端も指定する ## 効果 @@ -45,6 +61,7 @@ copy_n_result { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -67,6 +84,34 @@ int main() { 4 ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector src = {1, 2, 3, 4, 5}; + std::vector dst(5); + + // 並列に先頭3要素をコピー + std::ranges::copy_n(std::execution::par, src.begin(), 3, + dst.begin(), dst.begin() + 3); + + for (int x : dst) { + std::cout << x << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::copy_n[color ff0000] + +#### 出力 +``` +1 2 3 0 0 +``` + ## バージョン ### 言語 - C++20 @@ -79,3 +124,4 @@ int main() { ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_count.md b/reference/algorithm/ranges_count.md index 58a13d5e8e..05e78aae0e 100644 --- a/reference/algorithm/ranges_count.md +++ b/reference/algorithm/ranges_count.md @@ -43,14 +43,44 @@ namespace std::ranges { count(R&& r, const T& value, Proj proj = {}); // (2) C++26 + + template S, + class Proj = identity, + class T = projected_value_t> + requires indirect_binary_predicate, const T*> + iter_difference_t + count(Ep&& exec, + I first, + S last, + const T& value, + Proj proj = {}); // (3) C++26 + + template , Proj>> + requires indirect_binary_predicate, Proj>, const T*> + range_difference_t + count(Ep&& exec, + R&& r, + const T& value, + Proj proj = {}); // (4) C++26 } ``` +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 指定された値と等値な要素の数を数える。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## テンプレートパラメータ制約 - (1): @@ -170,6 +200,28 @@ count of id==1: 1 ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 4, 3, 3, 1, 2, 2, 1}; + + // 並列に値が 1 の要素がいくつあるかを数える + auto n = std::ranges::count(std::execution::par, v, 1); + std::cout << "count of 1: " << n << std::endl; +} +``` +* std::ranges::count[color ff0000] + +#### 出力 +``` +count of 1: 3 +``` + ## 実装例 ```cpp struct count_impl { @@ -210,3 +262,4 @@ inline constexpr count_impl count; - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) - [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) - C++26で波カッコ初期化 (リスト初期化) に対応した +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_count_if.md b/reference/algorithm/ranges_count_if.md index 265ff9c5ae..3aa760e14f 100644 --- a/reference/algorithm/ranges_count_if.md +++ b/reference/algorithm/ranges_count_if.md @@ -18,8 +18,34 @@ namespace std::ranges { indirect_unary_predicate, Proj>> Pred> constexpr range_difference_t count_if(R&& r, Pred pred, Proj proj = {}); // (2) C++20 + + template S, + class Proj = identity, + indirect_unary_predicate> Pred> + iter_difference_t + count_if(Ep&& exec, + I first, + S last, + Pred pred, + Proj proj = {}); // (3) C++26 + + template , Proj>> Pred> + range_difference_t + count_if(Ep&& exec, + R&& r, + Pred pred, + Proj proj = {}); // (4) C++26 } ``` +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 @@ -27,6 +53,8 @@ namespace std::ranges { - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## テンプレートパラメータ制約 - (1): @@ -47,6 +75,7 @@ namespace std::ranges { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -62,12 +91,35 @@ int main() { ``` * std::ranges::count_if[color ff0000] -### 出力 +#### 出力 ```cpp count of 1 or 3: 5 ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 4, 3, 3, 1, 2, 2, 1}; + + // 並列に値が偶数の要素がいくつあるかを数える + auto n = std::ranges::count_if(std::execution::par, v, + [](int x) { return x % 2 == 0; }); + std::cout << "count of even: " << n << std::endl; +} +``` +* std::ranges::count_if[color ff0000] + +#### 出力 +``` +count of even: 3 +``` + ## 実装例 ```cpp struct count_if_impl { @@ -104,3 +156,4 @@ inline constexpr count_if_impl count_if; ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_ends_with.md b/reference/algorithm/ranges_ends_with.md index 4b15e622c6..a5e321787a 100644 --- a/reference/algorithm/ranges_ends_with.md +++ b/reference/algorithm/ranges_ends_with.md @@ -39,9 +39,46 @@ namespace std::ranges { Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // (2) C++23 + + template S1, + random_access_iterator I2, + sized_sentinel_for S2, + class Pred = ranges::equal_to, + class Proj1 = identity, + class Proj2 = identity> + requires indirectly_comparable + bool + ends_with(Ep&& exec, + I1 first1, + S1 last1, + I2 first2, + S2 last2, + Pred pred = {}, + Proj1 proj1 = {}, + Proj2 proj2 = {}); // (3) C++26 + + template + requires indirectly_comparable, iterator_t, Pred, Proj1, Proj2> + bool + ends_with(Ep&& exec, + R1&& r1, + R2&& r2, + Pred pred = {}, + Proj1 proj1 = {}, + Proj2 proj2 = {}); // (4) C++26 } ``` * sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 @@ -49,6 +86,8 @@ namespace std::ranges { - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 戻り値 @@ -66,6 +105,7 @@ namespace std::ranges { 最大で `N2` 回の対応する述語が適用される。 ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -83,7 +123,7 @@ int main() { ``` * std::ranges::ends_with[color ff0000] -### 出力 +#### 出力 ``` 0 0 @@ -91,6 +131,31 @@ int main() { ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5, 6}; + std::vector suffix = {4, 5, 6}; + + std::cout << std::boolalpha; + + // 並列に末尾が一致するかを判定 + bool result = std::ranges::ends_with(std::execution::par, v, suffix); + std::cout << result << std::endl; +} +``` +* std::ranges::ends_with[color ff0000] + +#### 出力 +``` +true +``` + ## 実装例 ```cpp struct ends_with_impl { @@ -138,3 +203,4 @@ inline constexpr ends_with_impl ends_with; ## 参照 - [N4950 27 Algorithms library](https://timsong-cpp.github.io/cppwp/n4950/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_equal.md b/reference/algorithm/ranges_equal.md index d3a0c6d147..2493dbde18 100644 --- a/reference/algorithm/ranges_equal.md +++ b/reference/algorithm/ranges_equal.md @@ -35,14 +35,52 @@ namespace std::ranges { Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // (2) C++20 + + template S1, + random_access_iterator I2, + sized_sentinel_for S2, + class Pred = ranges::equal_to, + class Proj1 = identity, + class Proj2 = identity> + requires indirectly_comparable + bool equal(Ep&& exec, + I1 first1, + S1 last1, + I2 first2, + S2 last2, + Pred pred = {}, + Proj1 proj1 = {}, + Proj2 proj2 = {}); // (3) C++26 + + template + requires indirectly_comparable, iterator_t, Pred, Proj1, Proj2> + bool equal(Ep&& exec, + R1&& r1, + R2&& r2, + Pred pred = {}, + Proj1 proj1 = {}, + Proj2 proj2 = {}); // (4) C++26 } ``` +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 2つの範囲を等値比較する。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する 2つの範囲の要素数および各要素が等値であった場合、`true`を返す。 @@ -57,6 +95,7 @@ namespace std::ranges { 最大で `min(last1 - first1, last2 - first2)` 回の述語が適用される。ただし、2つの範囲の長さを定数時間で求められ、かつ、長さが異なる場合、1 度も述語は適用されない。 ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -79,13 +118,38 @@ int main() { ``` * std::ranges::equal[color ff0000] -### 出力 +#### 出力 ``` false true ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v1 = {1, 2, 3, 4, 5}; + std::vector v2 = {1, 2, 3, 4, 5}; + + std::cout << std::boolalpha; + + // 並列に2つの範囲が等しいかを判定 + bool result = std::ranges::equal(std::execution::par, v1, v2); + std::cout << result << std::endl; +} +``` +* std::ranges::equal[color ff0000] + +#### 出力 +``` +true +``` + ## 実装例 ```cpp @@ -130,3 +194,4 @@ inline constexpr equal_impl equal; ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_fill.md b/reference/algorithm/ranges_fill.md index 2c2985e6b0..3987beacde 100644 --- a/reference/algorithm/ranges_fill.md +++ b/reference/algorithm/ranges_fill.md @@ -10,32 +10,58 @@ namespace std::ranges { output_iterator O, sentinel_for S> constexpr O - fill(O first, S last, const T& value); // (1) C++20 + fill(O first, S last, const T& value); // (1) C++20 template S, class T = iter_value_t> requires output_iterator constexpr O - fill(O first, S last, const T& value); // (1) C++26 + fill(O first, S last, const T& value); // (1) C++26 template R> constexpr borrowed_iterator_t - fill(R&& r, const T& value); // (2) C++20 + fill(R&& r, const T& value); // (2) C++20 template > requires output_range constexpr borrowed_iterator_t - fill(R&& r, const T& value); // (2) C++26 + fill(R&& r, const T& value); // (2) C++26 + + template S, + class T> + requires indirectly_writable + O fill(Ep&& exec, + O first, + S last, + const T& value); // (3) C++26 + + template + requires indirectly_writable, const T&> + borrowed_iterator_t + fill(Ep&& exec, + R&& r, + const T& value); // (4) C++26 } ``` * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* indirectly_writable[link /reference/iterator/indirectly_writable.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 指定された値で出力の範囲に書き込む。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 効果 @@ -118,6 +144,32 @@ int main() { 1,2 ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v(10); + + // 並列に全要素を42で埋める + std::ranges::fill(std::execution::par, v, 42); + + for (int x : v) { + std::cout << x << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::fill[color ff0000] + +#### 出力 +``` +42 42 42 42 42 42 42 42 42 42 +``` + ## バージョン ### 言語 - C++20 @@ -132,3 +184,4 @@ int main() { - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) - [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) - C++26で波カッコ初期化 (リスト初期化) に対応した +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_fill_n.md b/reference/algorithm/ranges_fill_n.md index dfca5a816f..64bfa0c80e 100644 --- a/reference/algorithm/ranges_fill_n.md +++ b/reference/algorithm/ranges_fill_n.md @@ -11,20 +11,35 @@ namespace std::ranges { constexpr O fill_n(O first, iter_difference_t n, - const T& value); // (1) C++20 + const T& value); // (1) C++20 template > requires output_iterator constexpr O fill_n(O first, iter_difference_t n, - const T& value); // (1) C++26 + const T& value); // (1) C++26 + + template + requires indirectly_writable + O fill_n(Ep&& exec, + O first, + iter_difference_t n, + const T& value); // (2) C++26 } ``` +* indirectly_writable[link /reference/iterator/indirectly_writable.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] ## 概要 指定された値で出力の範囲に `n` 個を書き込む。 +- (1): イテレータ範囲を指定する +- (2): (1)の並列アルゴリズム版。実行ポリシーを指定する + ## 効果 `n` が 1 以上の場合は `[first,first + n)` 内の全ての要素に `value` を代入し、そうでない場合は何もしない。 @@ -102,6 +117,32 @@ int main() { ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v(5); + + // 並列に先頭3要素を42で埋める + std::ranges::fill_n(std::execution::par, v.begin(), 3, 42); + + for (int x : v) { + std::cout << x << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::fill_n[color ff0000] + +#### 出力 +``` +42 42 42 0 0 +``` + ## バージョン ### 言語 - C++20 @@ -116,3 +157,4 @@ int main() { - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) - [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) - C++26で波カッコ初期化 (リスト初期化) に対応した +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_find.md b/reference/algorithm/ranges_find.md index 8823240a02..67daa20d7f 100644 --- a/reference/algorithm/ranges_find.md +++ b/reference/algorithm/ranges_find.md @@ -43,15 +43,44 @@ namespace std::ranges { find(R&& r, const T& value, Proj proj = {}); // (2) C++26 + + template S, + class Proj = identity, + class T = projected_value_t> + requires indirect_binary_predicate, const T*> + I find(Ep&& exec, + I first, + S last, + const T& value, + Proj proj = {}); // (3) C++26 + + template , Proj>> + requires indirect_binary_predicate, Proj>, const T*> + borrowed_iterator_t + find(Ep&& exec, + R&& r, + const T& value, + Proj proj = {}); // (4) C++26 } ``` * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 指定された値を検索する。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 戻り値 @@ -186,6 +215,29 @@ int main() { found: 3,4 ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {3, 1, 4, 1, 5, 9, 2, 6}; + + // 並列に値を検索する + auto it = std::ranges::find(std::execution::par, v, 5); + if (it != v.end()) { + std::cout << "found: " << *it << std::endl; + } +} +``` +* std::ranges::find[color ff0000] + +#### 出力 +``` +found: 5 +``` ## 実装例 ```cpp @@ -226,3 +278,4 @@ inline constexpr find_impl find; - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) - [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) - C++26で波カッコ初期化 (リスト初期化) に対応した +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_find_end.md b/reference/algorithm/ranges_find_end.md index 6369dfd7ef..8d6310f309 100644 --- a/reference/algorithm/ranges_find_end.md +++ b/reference/algorithm/ranges_find_end.md @@ -35,14 +35,54 @@ namespace std::ranges { Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // (2) C++20 + + template S1, + random_access_iterator I2, + sized_sentinel_for S2, + class Pred = ranges::equal_to, + class Proj1 = identity, + class Proj2 = identity> + requires indirectly_comparable + subrange + find_end(Ep&& exec, + I1 first1, + S1 last1, + I2 first2, + S2 last2, + Pred pred = {}, + Proj1 proj1 = {}, + Proj2 proj2 = {}); // (3) C++26 + + template + requires indirectly_comparable, iterator_t, Pred, Proj1, Proj2> + borrowed_subrange_t + find_end(Ep&& exec, + R1&& r1, + R2&& r2, + Pred pred = {}, + Proj1 proj1 = {}, + Proj2 proj2 = {}); // (4) C++26 } ``` +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 範囲の中から、特定のサブシーケンスを検索する。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 戻り値 @@ -61,6 +101,7 @@ namespace std::ranges { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -85,12 +126,39 @@ int main() { ``` * std::ranges::find_end[color ff0000] -### 出力 +#### 出力 ``` found: index==2 ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2, 1, 2, 3}; + std::vector pattern = {1, 2}; + + // 並列にサブシーケンスを末尾から検索する + auto sr = std::ranges::find_end(std::execution::par, v, pattern); + if (sr.empty()) { + std::cout << "not found" << std::endl; + } else { + std::cout << "found: index==" << std::distance(v.begin(), sr.begin()) << std::endl; + } +} +``` +* std::ranges::find_end[color ff0000] + +#### 出力 +``` +found: index==2 +``` + ## 実装例 ```cpp struct find_end_impl { @@ -130,3 +198,4 @@ inline constexpr find_end_impl find_end; ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_find_first_of.md b/reference/algorithm/ranges_find_first_of.md index a4beb961ab..db300c21bf 100644 --- a/reference/algorithm/ranges_find_first_of.md +++ b/reference/algorithm/ranges_find_first_of.md @@ -35,15 +35,55 @@ namespace std::ranges { Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // (2) C++20 + + template S1, + random_access_iterator I2, + sized_sentinel_for S2, + class Pred = ranges::equal_to, + class Proj1 = identity, + class Proj2 = identity> + requires indirectly_comparable + I1 + find_first_of(Ep&& exec, + I1 first1, + S1 last1, + I2 first2, + S2 last2, + Pred pred = {}, + Proj1 proj1 = {}, + Proj2 proj2 = {}); // (3) C++26 + + template + requires indirectly_comparable, iterator_t, Pred, Proj1, Proj2> + borrowed_iterator_t + find_first_of(Ep&& exec, + R1&& r1, + R2&& r2, + Pred pred = {}, + Proj1 proj1 = {}, + Proj2 proj2 = {}); // (4) C++26 } ``` * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 ある集合の1つとマッチする最初の要素を検索する。 -* (1): イテレータ範囲を指定する -* (2): Rangeを直接指定する +- (1): イテレータ範囲を指定する +- (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 戻り値 @@ -57,6 +97,7 @@ namespace std::ranges { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -78,12 +119,40 @@ int main() { ``` * std::ranges::find_first_of[color ff0000] -### 出力 +#### 出力 ``` found: index==3, value==4 ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 3, 7, 4, 2}; + std::vector targets = {2, 4, 6, 8}; + + // 並列に targets のいずれかと一致する最初の要素を検索する + auto it = std::ranges::find_first_of(std::execution::par, v, targets); + if (it == v.end()) { + std::cout << "not found" << std::endl; + } else { + std::cout << "found: index==" << std::distance(v.begin(), it) + << ", value==" << *it << std::endl; + } +} +``` +* std::ranges::find_first_of[color ff0000] + +#### 出力 +``` +found: index==3, value==4 +``` + ## 実装例 ```cpp struct find_first_of_impl { @@ -124,3 +193,4 @@ inline constexpr find_first_of_impl find_first_of; ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_find_if.md b/reference/algorithm/ranges_find_if.md index e6cf396a7a..bd5d39c343 100644 --- a/reference/algorithm/ranges_find_if.md +++ b/reference/algorithm/ranges_find_if.md @@ -23,15 +23,42 @@ namespace std::ranges { find_if(R&& r, Pred pred, Proj proj = {}); // (2) C++20 + + template S, + class Proj = identity, + indirect_unary_predicate> Pred> + I find_if(Ep&& exec, + I first, + S last, + Pred pred, + Proj proj = {}); // (3) C++26 + + template , Proj>> Pred> + borrowed_iterator_t + find_if(Ep&& exec, + R&& r, + Pred pred, + Proj proj = {}); // (4) C++26 } ``` * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 範囲の中から、指定された条件を満たす最初の要素を検索する。 -* (1): イテレータ範囲を指定する -* (2): Rangeを直接指定する +- (1): イテレータ範囲を指定する +- (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 戻り値 @@ -43,6 +70,7 @@ namespace std::ranges { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -61,12 +89,39 @@ int main() { ``` * std::ranges::find_if[color ff0000] -### 出力 +#### 出力 ``` found: 1 ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {3, 1, 4, 1, 5, 9}; + + // 並列に5以上の最初の要素を検索する + auto result = std::ranges::find_if(std::execution::par, v, + [](int x) { return x >= 5; }); + if (result == v.end()) { + std::cout << "not found" << std::endl; + } else { + std::cout << "found: " << *result << std::endl; + } +} +``` +* std::ranges::find_if[color ff0000] + +#### 出力 +``` +found: 5 +``` + ## 実装例 ```cpp struct find_if_impl { @@ -103,3 +158,4 @@ inline constexpr find_if_impl find_if; ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_find_if_not.md b/reference/algorithm/ranges_find_if_not.md index 2506938225..edee510d5b 100644 --- a/reference/algorithm/ranges_find_if_not.md +++ b/reference/algorithm/ranges_find_if_not.md @@ -23,15 +23,42 @@ namespace std::ranges { find_if_not(R&& r, Pred pred, Proj proj = {}); // (2) C++20 + + template S, + class Proj = identity, + indirect_unary_predicate> Pred> + I find_if_not(Ep&& exec, + I first, + S last, + Pred pred, + Proj proj = {}); // (3) C++26 + + template , Proj>> Pred> + borrowed_iterator_t + find_if_not(Ep&& exec, + R&& r, + Pred pred, + Proj proj = {}); // (4) C++26 } ``` * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 範囲の中から、指定された条件を満たさない最初の要素を検索する。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 戻り値 @@ -43,6 +70,7 @@ namespace std::ranges { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -61,12 +89,39 @@ int main() { ``` * std::ranges::find_if_not[color ff0000] -### 出力 +#### 出力 ``` found: 1 ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {2, 4, 5, 6, 8}; + + // 並列に偶数でない最初の要素を検索する + auto result = std::ranges::find_if_not(std::execution::par, v, + [](int x) { return x % 2 == 0; }); + if (result == v.end()) { + std::cout << "not found" << std::endl; + } else { + std::cout << "found: " << *result << std::endl; + } +} +``` +* std::ranges::find_if_not[color ff0000] + +#### 出力 +``` +found: 5 +``` + ## 実装例 ```cpp struct find_if_not_impl { @@ -103,3 +158,4 @@ inline constexpr find_if_not_impl find_if_not; ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_find_last.md b/reference/algorithm/ranges_find_last.md index 228a6d65f6..41a33158ca 100644 --- a/reference/algorithm/ranges_find_last.md +++ b/reference/algorithm/ranges_find_last.md @@ -59,14 +59,52 @@ namespace std::ranges { find_last(R&& r, const T& value, Proj proj = {}); // (2) C++26 + + template S, + class Proj = identity, + class T = projected_value_t> + requires indirect_binary_predicate< + ranges::equal_to, + projected, + const T* + > + ranges::subrange + find_last(Ep&& exec, + I first, + S last, + const T& value, + Proj proj = {}); // (3) C++26 + + template , Proj>> + requires indirect_binary_predicate< + ranges::equal_to, + projected, Proj>, + const T* + > + ranges::borrowed_subrange_t + find_last(Ep&& exec, + R&& r, + const T& value, + Proj proj = {}); // (4) C++26 } ``` +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 指定された値を末尾から検索する。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 戻り値 @@ -153,6 +191,33 @@ found: 3,4 ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 3, 5, 3, 7}; + + // 並列に最後の3を検索 + auto result = std::ranges::find_last(std::execution::par, v, 3); + + if (!result.empty()) { + std::cout << "found: " << *result.begin() << std::endl; + std::cout << "position: " << (result.begin() - v.begin()) << std::endl; + } +} +``` +* std::ranges::find_last[color ff0000] + +#### 出力 +``` +found: 3 +position: 3 +``` + ## バージョン ### 言語 - C++23 @@ -169,3 +234,4 @@ found: 3,4 - C++26で波カッコ初期化 (リスト初期化) に対応した - 関連文書: - [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_find_last_if.md b/reference/algorithm/ranges_find_last_if.md index 3364c92a82..83e9417b72 100644 --- a/reference/algorithm/ranges_find_last_if.md +++ b/reference/algorithm/ranges_find_last_if.md @@ -23,14 +23,42 @@ namespace std::ranges { find_last_if(R&& r, Pred pred, Proj proj = {}); // (2) C++23 + + template S, + class Proj = identity, + indirect_unary_predicate> Pred> + ranges::subrange + find_last_if(Ep&& exec, + I first, + S last, + Pred pred, + Proj proj = {}); // (3) C++26 + + template , Proj>> Pred> + ranges::borrowed_subrange_t + find_last_if(Ep&& exec, + R&& r, + Pred pred, + Proj proj = {}); // (4) C++26 } ``` +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 範囲の中から、指定された条件を満たす最後の要素を検索する。 -* (1): イテレータ範囲を指定する -* (2): Rangeを直接指定する +- (1): イテレータ範囲を指定する +- (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 戻り値 @@ -42,6 +70,7 @@ namespace std::ranges { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -60,12 +89,40 @@ int main() { ``` * std::ranges::find_last_if[color ff0000] -### 出力 +#### 出力 ``` found: 1 pos: 3 ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 4, 3, 6, 5}; + + // 並列に最後の偶数を検索 + auto result = std::ranges::find_last_if(std::execution::par, v, + [](int x) { return x % 2 == 0; }); + + if (!result.empty()) { + std::cout << "found: " << *result.begin() << std::endl; + std::cout << "position: " << (result.begin() - v.begin()) << std::endl; + } +} +``` +* std::ranges::find_last_if[color ff0000] + +#### 出力 +``` +found: 6 +position: 3 +``` + ## バージョン ### 言語 - C++23 @@ -78,3 +135,4 @@ found: 1 ## 参照 - [P1223R5 find_last](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1223r5.pdf) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_find_last_if_not.md b/reference/algorithm/ranges_find_last_if_not.md index fbbc83a074..5d7e3e6891 100644 --- a/reference/algorithm/ranges_find_last_if_not.md +++ b/reference/algorithm/ranges_find_last_if_not.md @@ -23,14 +23,42 @@ namespace std::ranges { find_last_if_not(R&& r, Pred pred, Proj proj = {}); // (2) C++23 + + template S, + class Proj = identity, + indirect_unary_predicate> Pred> + ranges::subrange + find_last_if_not(Ep&& exec, + I first, + S last, + Pred pred, + Proj proj = {}); // (3) C++26 + + template , Proj>> Pred> + ranges::borrowed_subrange_t + find_last_if_not(Ep&& exec, + R&& r, + Pred pred, + Proj proj = {}); // (4) C++26 } ``` +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 範囲の中から、指定された条件を満たさない最後の要素を検索する。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 戻り値 @@ -42,6 +70,7 @@ namespace std::ranges { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -60,12 +89,40 @@ int main() { ``` * std::ranges::find_last_if_not[color ff0000] -### 出力 +#### 出力 ``` found: 1 pos: 3 ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {2, 4, 3, 6, 8}; + + // 並列に最後の偶数でない要素を検索 + auto result = std::ranges::find_last_if_not(std::execution::par, v, + [](int x) { return x % 2 == 0; }); + + if (!result.empty()) { + std::cout << "found: " << *result.begin() << std::endl; + std::cout << "position: " << (result.begin() - v.begin()) << std::endl; + } +} +``` +* std::ranges::find_last_if_not[color ff0000] + +#### 出力 +``` +found: 3 +position: 2 +``` + ## バージョン ### 言語 - C++23 @@ -78,3 +135,4 @@ found: 1 ## 参照 - [P1223R5 find_last](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1223r5.pdf) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_for_each.md b/reference/algorithm/ranges_for_each.md index 8638277ae9..8617440cf9 100644 --- a/reference/algorithm/ranges_for_each.md +++ b/reference/algorithm/ranges_for_each.md @@ -23,11 +23,36 @@ namespace std::ranges { for_each(R&& r, Fun f, Proj proj = {}); // (2) C++20 + + template S, + class Proj = identity, + indirectly_unary_invocable> Fun> + I for_each(Ep&& exec, + I first, + S last, + Fun f, + Proj proj = {}); // (3) C++26 + + template , Proj>> Fun> + borrowed_iterator_t + for_each(Ep&& exec, + R&& r, + Fun f, + Proj proj = {}); // (4) C++26 } ``` * indirectly_unary_invocable[link /reference/iterator/indirectly_unary_invocable.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] * for_each_result[link /reference/algorithm/ranges_in_fun_result.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 @@ -35,6 +60,8 @@ namespace std::ranges { * (1): イテレータ範囲を指定する * (2): Rangeを直接指定する +* (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +* (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## テンプレートパラメータ制約 - (1): @@ -54,14 +81,16 @@ namespace std::ranges { ## 戻り値 +- (1), (2): + ```cpp + for_each_result { + .in = last, + .fun = std::move(f), + } + ``` + * for_each_result[link /reference/algorithm/ranges_in_fun_result.md] -```cpp -for_each_result { - .in = last, - .fun = std::move(f), -} -``` -* for_each_result[link /reference/algorithm/ranges_in_fun_result.md] +- (3), (4): `last` ## 計算量 正確に `f` を `last - first` 回適用する @@ -72,7 +101,7 @@ for_each_result { ## 例 - +### 基本的な使い方 ```cpp example #include #include @@ -105,6 +134,35 @@ int main() { 6 ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5}; + + // 並列に全ての要素を2倍にする + std::ranges::for_each(std::execution::par, v, [](int& x) { x *= 2; }); + + for (int x : v) { + std::cout << x << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::for_each[color ff0000] + +#### 出力 +``` +2 4 6 8 10 +``` + +## バージョン +### 言語 +- C++20 ### 処理系 - [Clang](/implementation.md#clang): ?? @@ -112,7 +170,6 @@ int main() { - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] - ## 実装例 ```cpp struct for_each_impl { @@ -142,3 +199,4 @@ inline constexpr for_each_impl for_each; ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_for_each_n.md b/reference/algorithm/ranges_for_each_n.md index 7095a7aebb..241ab8d8a3 100644 --- a/reference/algorithm/ranges_for_each_n.md +++ b/reference/algorithm/ranges_for_each_n.md @@ -14,14 +14,29 @@ namespace std::ranges { iter_difference_t n, Fun f, Proj proj = {}); // (1) C++20 + + template > Fun> + I for_each_n(Ep&& exec, + I first, + iter_difference_t n, + Fun f, + Proj proj = {}); // (2) C++26 } ``` * indirectly_unary_invocable[link /reference/iterator/indirectly_unary_invocable.md] * for_each_n_result[link /reference/algorithm/ranges_in_fun_result.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] ## 概要 範囲の先頭N個の要素に、指定された関数を適用する。 +- (1): 通常版 +- (2): 並列アルゴリズム版。実行ポリシーを指定する + ## テンプレートパラメータ制約 - `I`が[`input_iterator`](/reference/iterator/input_iterator.md)である - `Fun`は`I`を`Proj`で射影した値を受け取る[1引数の`invocable`](/reference/iterator/indirectly_unary_invocable.md)である @@ -38,18 +53,22 @@ namespace std::ranges { このアルゴリズムはその他のアルゴリズムと違い、[`invoke`](/reference/functional/invoke.md)`(proj, *i)` が書き換え可能な参照であれば、関数 `f` の内部でその値を書き換えても構わない。 ## 戻り値 -```cpp -for_each_n_result { - .in = first + n, - .fun = std::move(f) -} -``` -* for_each_n_result[link /reference/algorithm/ranges_in_fun_result.md] +- (1): + ```cpp + for_each_n_result { + .in = first + n, + .fun = std::move(f) + } + ``` + * for_each_n_result[link /reference/algorithm/ranges_in_fun_result.md] + +- (2): `first + n` ## 備考 - 関数 `f` に戻り値がある場合、それは単に無視される ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -84,6 +103,33 @@ int main() ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5}; + + // 並列に先頭3要素を出力 + std::ranges::for_each_n(std::execution::par, v.begin(), 3, + [](int x) { std::cout << x << ' '; }); + std::cout << std::endl; +} +``` +* std::ranges::for_each_n[color ff0000] + +#### 出力例 +``` +1 2 3 +``` + +## バージョン +### 言語 +- C++20 + ### 処理系 - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] @@ -113,3 +159,4 @@ inline constexpr for_each_n_impl for_each_n; ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_generate.md b/reference/algorithm/ranges_generate.md index 45d70770d7..0ccfffdd46 100644 --- a/reference/algorithm/ranges_generate.md +++ b/reference/algorithm/ranges_generate.md @@ -13,25 +13,50 @@ namespace std::ranges { constexpr O generate(O first, S last, - F gen); // (1) C++20 + F gen); // (1) C++20 template requires invocable && output_range> constexpr borrowed_iterator_t generate(R&& r, - F gen); // (2) C++20 + F gen); // (2) C++20 + + template S, + copy_constructible F> + requires invocable && indirectly_writable> + O generate(Ep&& exec, + O first, + S last, + F gen); // (3) C++26 + + template + requires invocable && indirectly_writable, invoke_result_t> + borrowed_iterator_t + generate(Ep&& exec, + R&& r, + F gen); // (4) C++26 } ``` * input_or_output_iterator[link /reference/iterator/input_or_output_iterator.md] * indirectly_writable[link /reference/iterator/indirectly_writable.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 出力の範囲へ関数の結果を書き込む。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 効果 @@ -47,6 +72,7 @@ namespace std::ranges { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -71,6 +97,32 @@ int main() { 1,2,4,8,16,32,64,128,256,512, ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v(10); + + // 並列に全要素を99で埋める + std::ranges::generate(std::execution::par, v, [] { return 99; }); + + for (int x : v) { + std::cout << x << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::generate[color ff0000] + +#### 出力 +``` +99 99 99 99 99 99 99 99 99 99 +``` + ## バージョン ### 言語 - C++20 @@ -83,3 +135,4 @@ int main() { ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_generate_n.md b/reference/algorithm/ranges_generate_n.md index 6f06cec132..56f5f2c9d3 100644 --- a/reference/algorithm/ranges_generate_n.md +++ b/reference/algorithm/ranges_generate_n.md @@ -13,15 +13,29 @@ namespace std::ranges { generate_n(O first, iter_difference_t n, F gen); // (1) C++20 + + template + requires invocable && indirectly_writable> + O generate_n(Ep&& exec, + O first, + iter_difference_t n, + F gen); // (2) C++26 } ``` * input_or_output_iterator[link /reference/iterator/input_or_output_iterator.md] * indirectly_writable[link /reference/iterator/indirectly_writable.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] ## 概要 出力の範囲へ関数の結果を `n` 個書き込む。 +- (1): イテレータ範囲を指定する +- (2): (1)の並列アルゴリズム版。実行ポリシーを指定する + ## 効果 `n` が 1 以上の場合、`[first,last)` のそれぞれのイテレータについて関数オブジェクト `gen` を呼び出し、その戻り値を代入する。 @@ -41,6 +55,7 @@ namespace std::ranges { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -59,6 +74,35 @@ int main() { 1,2,4,8,16,32,64,128,256,512, ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include +#include + +int main() { + std::vector v(5); + + // 並列に値を生成して書き込む + std::atomic counter{0}; + std::ranges::generate_n(std::execution::par, v.begin(), 5, + [&counter] { return counter++; }); + + for (int x : v) { + std::cout << x << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::generate_n[color ff0000] + +#### 出力例 +``` +0 1 2 3 4 +``` + ## バージョン ### 言語 - C++20 @@ -71,3 +115,4 @@ int main() { ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_in_in_out_result.md b/reference/algorithm/ranges_in_in_out_result.md index 4939125fe3..095b4a90fd 100644 --- a/reference/algorithm/ranges_in_in_out_result.md +++ b/reference/algorithm/ranges_in_in_out_result.md @@ -3,7 +3,7 @@ * std::ranges[meta namespace] * class template[meta id-type] * cpp20[meta cpp] -* binary_transform_result,merge_result,set_union_result,set_intersection_result,set_symmetric_difference_result[meta alias] +* binary_transform_result,merge_result,set_union_result,set_intersection_result,set_symmetric_difference_result,reverse_copy_truncated_result,rotate_copy_truncated_result[meta alias] ```cpp namespace std::ranges { @@ -50,6 +50,14 @@ namespace std::ranges { // (6) template using set_symmetric_difference_result = in_in_out_result; + + // (7) C++26 + template + using reverse_copy_truncated_result = in_in_out_result; + + // (8) C++26 + template + using rotate_copy_truncated_result = in_in_out_result; } ``` * no_unique_address[link /lang/cpp20/language_support_for_empty_objects.md] @@ -62,6 +70,8 @@ namespace std::ranges { * (4): [`ranges::set_union`](ranges_set_union.md)で使用するエイリアス * (5): [`ranges::set_intersection`](ranges_set_intersection.md)で使用するエイリアス * (6): [`ranges::set_symmetric_difference`](ranges_set_symmetric_difference.md)で使用するエイリアス +* (7): [`ranges::reverse_copy`](ranges_reverse_copy.md)の並列アルゴリズム版で使用するエイリアス (C++26) +* (8): [`ranges::rotate_copy`](ranges_rotate_copy.md)の並列アルゴリズム版で使用するエイリアス (C++26) この型は、関数が2つの入力用の範囲と出力用の範囲を受け取る場合に、それぞれ処理した範囲の末尾を返すために使用される。 @@ -125,3 +135,5 @@ int main() { ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) +- [P3709R2 Reconsider parallel `ranges::rotate_copy` and `ranges::reverse_copy`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3709r2.html) diff --git a/reference/algorithm/ranges_includes.md b/reference/algorithm/ranges_includes.md index 41e5babb6d..403ec100f0 100644 --- a/reference/algorithm/ranges_includes.md +++ b/reference/algorithm/ranges_includes.md @@ -39,16 +39,60 @@ namespace std::ranges { Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // (2) C++20 + + template S1, + random_access_iterator I2, + sized_sentinel_for S2, + class Proj1 = identity, + class Proj2 = identity, + indirect_strict_weak_order< + projected, + projected + > Comp = ranges::less> + bool + includes(Ep&& exec, + I1 first1, + S1 last1, + I2 first2, + S2 last2, + Comp comp = {}, + Proj1 proj1 = {}, + Proj2 proj2 = {}); // (3) C++26 + + template , Proj1>, + projected, Proj2> + > Comp = ranges::less> + bool + includes(Ep&& exec, + R1&& r1, + R2&& r2, + Comp comp = {}, + Proj1 proj1 = {}, + Proj2 proj2 = {}); // (4) C++26 } ``` * indirect_strict_weak_order[link /reference/iterator/indirect_strict_weak_order.md] * ranges::less[link /reference/functional/ranges_less.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 2つのソート済み範囲において、一方の範囲の要素がもう一方の範囲に全て含まれているかを判定する。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 戻り値 `[first2,last2)` が `empty` であるか、`[first2,last2)` の全ての要素が `[first1,last1)` に含まれている場合は `true`、そうでない場合は `false` を返す。 @@ -59,6 +103,7 @@ namespace std::ranges { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -84,6 +129,34 @@ true false ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() +{ + std::vector a = {1, 2, 3, 4, 5, 6}; + std::vector b = {2, 4, 6}; + std::vector c = {2, 4, 7}; + + std::cout << std::boolalpha; + + // 並列にaがbの全要素を含むか判定する + std::cout << std::ranges::includes(std::execution::par, a, b) << std::endl; + std::cout << std::ranges::includes(std::execution::par, a, c) << std::endl; +} +``` +* std::ranges::includes[color ff0000] + +#### 出力 +``` +true +false +``` + ## バージョン ### 言語 - C++20 @@ -96,3 +169,4 @@ false ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_inplace_merge.md b/reference/algorithm/ranges_inplace_merge.md index 58cfe9bb48..5d12106d2f 100644 --- a/reference/algorithm/ranges_inplace_merge.md +++ b/reference/algorithm/ranges_inplace_merge.md @@ -47,17 +47,49 @@ namespace std::ranges { iterator_t middle, Comp comp = {}, Proj proj = {}); // (2) C++26 + + template S, + class Comp = ranges::less, + class Proj = identity> + requires sortable + I + inplace_merge(Ep&& exec, + I first, + I middle, + S last, + Comp comp = {}, + Proj proj = {}); // (3) C++26 + + template + requires sortable, Comp, Proj> + borrowed_iterator_t + inplace_merge(Ep&& exec, + R&& r, + iterator_t middle, + Comp comp = {}, + Proj proj = {}); // (4) C++26 } ``` * ranges::less[link /reference/functional/ranges_less.md] * sortable[link /reference/iterator/sortable.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 2つの連続したソート済み範囲をマージする。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 事前条件 - `[first,middle)` と `[middle,last)` の範囲はそれぞれソートされていること。 @@ -83,6 +115,7 @@ namespace std::ranges { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -112,6 +145,34 @@ int main() 6 ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 3, 5, 2, 4, 6}; + + // 並列にインプレースマージ + // [1,3,5) と [2,4,6) をマージ + std::ranges::inplace_merge(std::execution::par, + v, v.begin() + 3); + + for (int x : v) { + std::cout << x << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::inplace_merge[color ff0000] + +#### 出力 +``` +1 2 3 4 5 6 +``` + ## 実装例 - [`inplace_merge` を読んでみた](http://www.kmonos.net/wlog/115.html#_2300101215) @@ -129,3 +190,4 @@ int main() - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) - [P2562R1 `constexpr` Stable Sorting](https://open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2562r1.pdf) - C++26から`constexpr`に対応した +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_is_heap.md b/reference/algorithm/ranges_is_heap.md index 35abb8e9fa..394cfad5dd 100644 --- a/reference/algorithm/ranges_is_heap.md +++ b/reference/algorithm/ranges_is_heap.md @@ -23,16 +23,44 @@ namespace std::ranges { is_heap(R&& r, Comp comp = {}, Proj proj = {}); // (2) C++20 + + template S, + class Proj = identity, + indirect_strict_weak_order> Comp = ranges::less> + bool + is_heap(Ep&& exec, + I first, + S last, + Comp comp = {}, + Proj proj = {}); // (3) C++26 + + template , Proj>> Comp = ranges::less> + bool + is_heap(Ep&& exec, + R&& r, + Comp comp = {}, + Proj proj = {}); // (4) C++26 } ``` * ranges::less[link /reference/functional/ranges_less.md] * indirect_strict_weak_order[link /reference/iterator/indirect_strict_weak_order.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 範囲がヒープ化されているか判定する。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 効果 @@ -40,6 +68,7 @@ namespace std::ranges { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -68,6 +97,36 @@ before: is heap? false after: is heap? true ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() +{ + std::vector v = {3, 1, 4, 1, 5}; + + std::cout << std::boolalpha; + std::cout << "before: is heap? " + << std::ranges::is_heap(std::execution::par, v) << std::endl; + + std::ranges::make_heap(v); + + std::cout << " after: is heap? " + << std::ranges::is_heap(std::execution::par, v) << std::endl; +} +``` +* std::ranges::is_heap[color ff0000] +* std::ranges::make_heap[link ranges_make_heap.md] + +#### 出力 +``` +before: is heap? false + after: is heap? true +``` + ## バージョン ### 言語 - C++20 @@ -80,3 +139,4 @@ before: is heap? false ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_is_heap_until.md b/reference/algorithm/ranges_is_heap_until.md index d96bc5c22c..ae11489844 100644 --- a/reference/algorithm/ranges_is_heap_until.md +++ b/reference/algorithm/ranges_is_heap_until.md @@ -23,16 +23,44 @@ namespace std::ranges { is_heap_until(R&& r, Comp comp = {}, Proj proj = {}); // (2) C++20 + + template S, + class Proj = identity, + indirect_strict_weak_order> Comp = ranges::less> + I is_heap_until(Ep&& exec, + I first, + S last, + Comp comp = {}, + Proj proj = {}); // (3) C++26 + + template , Proj>> Comp = ranges::less> + borrowed_iterator_t + is_heap_until(Ep&& exec, + R&& r, + Comp comp = {}, + Proj proj = {}); // (4) C++26 } ``` * ranges::less[link /reference/functional/ranges_less.md] * indirect_strict_weak_order[link /reference/iterator/indirect_strict_weak_order.md] +* borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 範囲がヒープ化されているか判定し、ヒープ化されていない最初の要素を指すイテレータを取得する。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 戻り値 @@ -44,6 +72,7 @@ namespace std::ranges { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -66,12 +95,39 @@ int main() * std::ranges::is_heap_until[color ff0000] * std::ranges::make_heap[link ranges_make_heap.md] -### 出力 +#### 出力 ``` before: is heap? false after: is heap? true ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {9, 5, 7, 3, 1, 2, 4}; + + // 並列にヒープ条件を満たさなくなる位置を検索 + auto it = std::ranges::is_heap_until(std::execution::par, v); + + std::cout << "heap part: "; + for (auto i = v.begin(); i != it; ++i) { + std::cout << *i << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::is_heap_until[color ff0000] + +#### 出力 +``` +heap part: 9 5 7 3 1 2 4 +``` + ## バージョン ### 言語 - C++20 @@ -84,3 +140,4 @@ before: is heap? false ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_is_partitioned.md b/reference/algorithm/ranges_is_partitioned.md index ffff76a496..d620305c0a 100644 --- a/reference/algorithm/ranges_is_partitioned.md +++ b/reference/algorithm/ranges_is_partitioned.md @@ -23,14 +23,40 @@ namespace std::ranges { is_partitioned(R&& r, Pred pred, Proj proj = {}); // (2) C++20 + + template S, + class Proj = identity, + indirect_unary_predicate> Pred> + bool is_partitioned(Ep&& exec, + I first, + S last, + Pred pred, + Proj proj = {}); // (3) C++26 + + template , Proj>> Pred> + bool is_partitioned(Ep&& exec, + R&& r, + Pred pred, + Proj proj = {}); // (4) C++26 } ``` +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 与えられた範囲が条件によって[区分化](/reference/algorithm.md#sequence-is-partitioned)されているか判定する。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 戻り値 @@ -44,6 +70,7 @@ namespace std::ranges { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -84,6 +111,33 @@ int main() partitioned ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() +{ + std::vector v = {2, 4, 6, 1, 3, 5}; + + auto pred = [](int x) { return x % 2 == 0; }; + + // 並列に偶数グループと奇数グループに分かれているか判定する + std::cout << std::boolalpha; + std::cout << "is partitioned? " + << std::ranges::is_partitioned(std::execution::par, v, pred) + << std::endl; +} +``` +* std::ranges::is_partitioned[color ff0000] + +#### 出力 +``` +is partitioned? true +``` + ## バージョン ### 言語 - C++20 @@ -96,3 +150,4 @@ partitioned ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_is_sorted.md b/reference/algorithm/ranges_is_sorted.md index b5bf9efb07..cedf3488ae 100644 --- a/reference/algorithm/ranges_is_sorted.md +++ b/reference/algorithm/ranges_is_sorted.md @@ -23,16 +23,42 @@ namespace std::ranges { is_sorted(R&& r, Comp comp = {}, Proj proj = {}); // (2) C++20 + + template S, + class Proj = identity, + indirect_strict_weak_order> Comp = ranges::less> + bool is_sorted(Ep&& exec, + I first, + S last, + Comp comp = {}, + Proj proj = {}); // (3) C++26 + + template , Proj>> Comp = ranges::less> + bool is_sorted(Ep&& exec, + R&& r, + Comp comp = {}, + Proj proj = {}); // (4) C++26 } ``` * ranges::less[link /reference/functional/ranges_less.md] * indirect_strict_weak_order[link /reference/iterator/indirect_strict_weak_order.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 与えられた範囲がソート済みか判定する。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ### 戻り値 @@ -40,6 +66,7 @@ namespace std::ranges { - (2) : [`ranges::is_sorted_until`](/reference/algorithm/ranges_is_sorted_until.md)`(r, comp, proj) == last` ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -66,6 +93,36 @@ before: is sorted? false after: is sorted? true ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() +{ + std::vector v = {3, 1, 4, 1, 5, 9, 2, 6}; + + std::cout << std::boolalpha; + std::cout << "before: is sorted? " + << std::ranges::is_sorted(std::execution::par, v) << std::endl; + + std::ranges::sort(v); + + std::cout << " after: is sorted? " + << std::ranges::is_sorted(std::execution::par, v) << std::endl; +} +``` +* std::ranges::is_sorted[color ff0000] +* std::ranges::sort[link ranges_sort.md] + +#### 出力 +``` +before: is sorted? false + after: is sorted? true +``` + ## バージョン ### 言語 - C++20 @@ -78,3 +135,4 @@ before: is sorted? false ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_is_sorted_until.md b/reference/algorithm/ranges_is_sorted_until.md index d01cf16df7..b92c0af1ce 100644 --- a/reference/algorithm/ranges_is_sorted_until.md +++ b/reference/algorithm/ranges_is_sorted_until.md @@ -23,17 +23,44 @@ namespace std::ranges { is_sorted_until(R&& r, Comp comp = {}, Proj proj = {}); // (2) C++20 + + template S, + class Proj = identity, + indirect_strict_weak_order> Comp = ranges::less> + I is_sorted_until(Ep&& exec, + I first, + S last, + Comp comp = {}, + Proj proj = {}); // (3) C++26 + + template , Proj>> Comp = ranges::less> + borrowed_iterator_t + is_sorted_until(Ep&& exec, + R&& r, + Comp comp = {}, + Proj proj = {}); // (4) C++26 } ``` * ranges::less[link /reference/functional/ranges_less.md] * indirect_strict_weak_order[link /reference/iterator/indirect_strict_weak_order.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 ソート済みか判定し、ソートされていない位置のイテレータを取得する - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 戻り値 [`distance`](/reference/iterator/distance.md)`(first, last) < 2` なら `last` を返す。そうでない場合、`[first,last]` の中でソートされている範囲を `[first,i)` としたとき、そのイテレータ `i` を返す。 @@ -44,6 +71,7 @@ namespace std::ranges { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -72,6 +100,33 @@ before: is sorted? false ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() +{ + std::vector v = {1, 2, 3, 5, 4, 6}; + + // 並列にソート済み範囲の終端を取得する + auto it = std::ranges::is_sorted_until(std::execution::par, v); + + std::cout << "sorted until: " << *it << std::endl; + std::cout << "sorted range size: " << (it - v.begin()) << std::endl; +} +``` +* std::ranges::is_sorted_until[color ff0000] +* v.begin()[link /reference/vector/vector/begin.md] + +#### 出力 +``` +sorted until: 4 +sorted range size: 4 +``` + ## 実装例 ```cpp @@ -115,3 +170,4 @@ inline constexpr is_sorted_until_impl is_sorted_until; ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_lexicographical_compare.md b/reference/algorithm/ranges_lexicographical_compare.md index 80fb244482..059fcca8d1 100644 --- a/reference/algorithm/ranges_lexicographical_compare.md +++ b/reference/algorithm/ranges_lexicographical_compare.md @@ -40,16 +40,58 @@ namespace std::ranges { Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // (2) C++20 + + template S1, + random_access_iterator I2, + sized_sentinel_for S2, + class Proj1 = identity, + class Proj2 = identity, + indirect_strict_weak_order< + projected, + projected + > Comp = ranges::less> + bool lexicographical_compare(Ep&& exec, + I1 first1, + S1 last1, + I2 first2, + S2 last2, + Comp comp = {}, + Proj1 proj1 = {}, + Proj2 proj2 = {}); // (3) C++26 + + template , Proj1>, + projected, Proj2> + > Comp = ranges::less> + bool lexicographical_compare(Ep&& exec, + R1&& r1, + R2&& r2, + Comp comp = {}, + Proj1 proj1 = {}, + Proj2 proj2 = {}); // (4) C++26 } ``` * indirect_strict_weak_order[link /reference/iterator/indirect_strict_weak_order.md] * ranges::less[link /reference/functional/ranges_less.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 `[first1, last1)`および`[first2, last2)`の2つの範囲を辞書式順序で比較する。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 効果 ```cpp @@ -76,6 +118,7 @@ return first1 == last1 && first2 != last2; ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -136,6 +179,36 @@ x less than y x less than y ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() +{ + std::vector a = {1, 2, 3, 4, 5}; + std::vector b = {1, 2, 3, 4, 6}; + + // 並列に辞書式比較を行う + bool result = std::ranges::lexicographical_compare( + std::execution::par, + a, + b + ); + + std::cout << std::boolalpha; + std::cout << "a < b: " << result << std::endl; +} +``` +* std::ranges::lexicographical_compare[color ff0000] + +#### 出力 +``` +a < b: true +``` + ## バージョン ### 言語 - C++20 @@ -148,3 +221,4 @@ x less than y ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_max.md b/reference/algorithm/ranges_max.md index 32ca3a62fb..8fa065d48e 100644 --- a/reference/algorithm/ranges_max.md +++ b/reference/algorithm/ranges_max.md @@ -31,12 +31,25 @@ namespace std::ranges { max(R&& r, Comp comp = {}, Proj proj = {}); // (3) C++20 + + template , Proj>> Comp = ranges::less> + requires indirectly_copyable_storable, range_value_t*> + range_value_t + max(Ep&& exec, + R&& r, + Comp comp = {}, + Proj proj = {}); // (4) C++26 } ``` * indirect_strict_weak_order[link /reference/iterator/indirect_strict_weak_order.md] * ranges::less[link /reference/functional/ranges_less.md] * initializer_list[link /reference/initializer_list/initializer_list.md] * indirectly_copyable_storable[link /reference/iterator/indirectly_copyable_storable.md] +* execution-policy[link /reference/execution/execution-policy.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 同じ型の2つの値、もしくは範囲によるN個の値のうち、最大値を取得する。 @@ -44,6 +57,7 @@ namespace std::ranges { - (1): 2つの値を指定する - (2): 初期化子リストを指定する - (3): Rangeを指定する +- (4): (3)の並列アルゴリズム版。実行ポリシーを指定する ## 戻り値 @@ -53,6 +67,7 @@ namespace std::ranges { - 等価な要素が 2 つ以上あった場合には、最も左の要素を返す。 ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -90,6 +105,28 @@ Windows環境においては、``をインクルードすると`max` - ``をインクルードするまでに`#define NOMINMAX`を行う。これで`max`マクロが定義されなくなる。 - `std::ranges::max()`を呼び出す際に、`(std::ranges::max)(a, b);`のように関数名をカッコで囲んで使用する。これで、名前解決において`std::ranges::max()`関数が必ず使用される。 +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {3, 1, 4, 1, 5, 9, 2, 6}; + + // 並列に最大値を取得 + int result = std::ranges::max(std::execution::par, v); + std::cout << result << std::endl; +} +``` +* std::ranges::max[color ff0000] + +#### 出力 +``` +9 +``` + ## バージョン ### 言語 - C++20 @@ -102,3 +139,4 @@ Windows環境においては、``をインクルードすると`max` ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_max_element.md b/reference/algorithm/ranges_max_element.md index eebec0f04a..88e4a3e42d 100644 --- a/reference/algorithm/ranges_max_element.md +++ b/reference/algorithm/ranges_max_element.md @@ -23,17 +23,44 @@ namespace std::ranges { max_element(R&& r, Comp comp = {}, Proj proj = {}); // (2) C++20 + + template S, + class Proj = identity, + indirect_strict_weak_order> Comp = ranges::less> + I max_element(Ep&& exec, + I first, + S last, + Comp comp = {}, + Proj proj = {}); // (3) C++26 + + template , Proj>> Comp = ranges::less> + borrowed_iterator_t + max_element(Ep&& exec, + R&& r, + Comp comp = {}, + Proj proj = {}); // (4) C++26 } ``` * indirect_strict_weak_order[link /reference/iterator/indirect_strict_weak_order.md] * ranges::less[link /reference/functional/ranges_less.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 `[first, last)`の範囲において、最大要素を指す最初のイテレータを取得する。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 戻り値 @@ -43,6 +70,7 @@ namespace std::ranges { [`max`](max.md)`((last - first) - 1, 0)`回の比較を行う ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -70,6 +98,30 @@ int main() ``` ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() +{ + std::vector v = {3, 1, 4, 1, 5, 9, 2, 6}; + + // 並列に最大要素を検索する + auto it = std::ranges::max_element(std::execution::par, v); + + std::cout << "max: " << *it << std::endl; +} +``` +* std::ranges::max_element[color ff0000] + +#### 出力 +``` +max: 9 +``` + ## バージョン ### 言語 - C++20 @@ -82,3 +134,4 @@ int main() ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_merge.md b/reference/algorithm/ranges_merge.md index 739eace4ed..83440d5a85 100644 --- a/reference/algorithm/ranges_merge.md +++ b/reference/algorithm/ranges_merge.md @@ -43,6 +43,50 @@ namespace std::ranges { Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // (2) C++20 + + template S1, + random_access_iterator I2, + sized_sentinel_for S2, + random_access_iterator O, + sized_sentinel_for OutS, + class Comp = ranges::less, + class Proj1 = identity, + class Proj2 = identity> + requires mergeable + merge_result + merge(Ep&& exec, + I1 first1, + S1 last1, + I2 first2, + S2 last2, + O result, + OutS result_last, + Comp comp = {}, + Proj1 proj1 = {}, + Proj2 proj2 = {}); // (3) C++26 + + template + requires mergeable, iterator_t, iterator_t, Comp, Proj1, Proj2> + merge_result< + borrowed_iterator_t, + borrowed_iterator_t, + borrowed_iterator_t + > + merge(Ep&& exec, + R1&& r1, + R2&& r2, + OutR&& result_r, + Comp comp = {}, + Proj1 proj1 = {}, + Proj2 proj2 = {}); // (4) C++26 } ``` * merge_result[link ranges_in_in_out_result.md] @@ -50,12 +94,18 @@ namespace std::ranges { * ranges::less[link /reference/functional/ranges_less.md] * mergeable[link /reference/iterator/mergeable.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 2つのソート済み範囲をマージして、出力イテレータへ出力する。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 事前条件 @@ -85,6 +135,7 @@ merge_result { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -122,6 +173,35 @@ int main() 6 ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() +{ + std::vector a = {1, 3, 5, 7}; + std::vector b = {2, 4, 6, 8}; + std::vector result(a.size() + b.size()); + + // 並列に2つのソート済み範囲をマージする + std::ranges::merge(std::execution::par, a, b, result); + + for (int x : result) { + std::cout << x << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::merge[color ff0000] + +#### 出力 +``` +1 2 3 4 5 6 7 8 +``` + ## バージョン ### 言語 - C++20 @@ -134,3 +214,4 @@ int main() ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_min.md b/reference/algorithm/ranges_min.md index f3ec69f0d4..49775810a6 100644 --- a/reference/algorithm/ranges_min.md +++ b/reference/algorithm/ranges_min.md @@ -31,12 +31,25 @@ namespace std::ranges { min(R&& r, Comp comp = {}, Proj proj = {}); // (3) C++20 + + template , Proj>> Comp = ranges::less> + requires indirectly_copyable_storable, range_value_t*> + range_value_t + min(Ep&& exec, + R&& r, + Comp comp = {}, + Proj proj = {}); // (4) C++26 } ``` * indirect_strict_weak_order[link /reference/iterator/indirect_strict_weak_order.md] * ranges::less[link /reference/functional/ranges_less.md] * initializer_list[link /reference/initializer_list/initializer_list.md] * indirectly_copyable_storable[link /reference/iterator/indirectly_copyable_storable.md] +* execution-policy[link /reference/execution/execution-policy.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 同じ型の2つの値、もしくは範囲によるN個の値のうち、最小値を取得する。 @@ -44,6 +57,7 @@ namespace std::ranges { - (1): 2つの値を指定する - (2): 初期化子リストを指定する - (3): Rangeを指定する +- (4): (3)の並列アルゴリズム版。実行ポリシーを指定する ## 戻り値 @@ -54,6 +68,7 @@ namespace std::ranges { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -91,6 +106,28 @@ Windows環境においては、``をインクルードすると`min` - ``をインクルードするまでに`#define NOMINMAX`を行う。これで`min`マクロが定義されなくなる。 - `std::ranges::min()`を呼び出す際に、`(std::ranges::min)(a, b);`のように関数名をカッコで囲んで使用する。これで、名前解決において`std::ranges::min()`が必ず使用される。 +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {3, 1, 4, 1, 5, 9, 2, 6}; + + // 並列に最小値を取得 + int result = std::ranges::min(std::execution::par, v); + std::cout << result << std::endl; +} +``` +* std::ranges::min[color ff0000] + +#### 出力 +``` +1 +``` + ## バージョン ### 言語 - C++20 @@ -103,3 +140,4 @@ Windows環境においては、``をインクルードすると`min` ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_min_element.md b/reference/algorithm/ranges_min_element.md index e7c039f0ff..67b5dc891e 100644 --- a/reference/algorithm/ranges_min_element.md +++ b/reference/algorithm/ranges_min_element.md @@ -23,11 +23,36 @@ namespace std::ranges { min_element(R&& r, Comp comp = {}, Proj proj = {}); // (2) C++20 + + template S, + class Proj = identity, + indirect_strict_weak_order> Comp = ranges::less> + I min_element(Ep&& exec, + I first, + S last, + Comp comp = {}, + Proj proj = {}); // (3) C++26 + + template , Proj>> Comp = ranges::less> + borrowed_iterator_t + min_element(Ep&& exec, + R&& r, + Comp comp = {}, + Proj proj = {}); // (4) C++26 } ``` * indirect_strict_weak_order[link /reference/iterator/indirect_strict_weak_order.md] * ranges::less[link /reference/functional/ranges_less.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 @@ -35,6 +60,8 @@ namespace std::ranges { - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 戻り値 @@ -46,6 +73,7 @@ namespace std::ranges { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -73,6 +101,30 @@ int main() ``` ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() +{ + std::vector v = {3, 1, 4, 1, 5, 9, 2, 6}; + + // 並列に最小要素を検索する + auto it = std::ranges::min_element(std::execution::par, v); + + std::cout << "min: " << *it << std::endl; +} +``` +* std::ranges::min_element[color ff0000] + +#### 出力 +``` +min: 1 +``` + ## バージョン ### 言語 - C++20 @@ -85,3 +137,4 @@ int main() ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_minmax.md b/reference/algorithm/ranges_minmax.md index 2f678c217e..22b63c906a 100644 --- a/reference/algorithm/ranges_minmax.md +++ b/reference/algorithm/ranges_minmax.md @@ -31,6 +31,17 @@ namespace std::ranges { minmax(R&& r, Comp comp = {}, Proj proj = {}); // (3) C++20 + + template , Proj>> Comp = ranges::less> + requires indirectly_copyable_storable, range_value_t*> + minmax_result> + minmax(Ep&& exec, + R&& r, + Comp comp = {}, + Proj proj = {}); // (4) C++26 } ``` * minmax_result[link ranges_min_max_result.md] @@ -38,6 +49,8 @@ namespace std::ranges { * ranges::less[link /reference/functional/ranges_less.md] * initializer_list[link /reference/initializer_list/initializer_list.md] * indirectly_copyable_storable[link /reference/iterator/indirectly_copyable_storable.md] +* execution-policy[link /reference/execution/execution-policy.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 同じ型の2つの値、もしくは範囲によるN個の値のうち、最小値と最大値の組を取得する。 @@ -45,6 +58,7 @@ namespace std::ranges { - (1): 2つの値を指定する - (2): 初期化子リストを指定する - (3): Rangeを指定する +- (4): (3)の並列アルゴリズム版。実行ポリシーを指定する ## 戻り値 @@ -63,6 +77,7 @@ minmax_result { - 範囲バージョンは高々`(3/2) * t.size()`回の述語適用。 ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -93,6 +108,28 @@ int main() ``` ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {3, 1, 4, 1, 5, 9, 2, 6}; + + // 並列に最小値と最大値を取得 + auto [min_val, max_val] = std::ranges::minmax(std::execution::par, v); + std::cout << min_val << ", " << max_val << std::endl; +} +``` +* std::ranges::minmax[color ff0000] + +#### 出力 +``` +1, 9 +``` + ## バージョン ### 言語 - C++20 @@ -105,3 +142,4 @@ int main() ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_minmax_element.md b/reference/algorithm/ranges_minmax_element.md index a243db083e..332cc08d74 100644 --- a/reference/algorithm/ranges_minmax_element.md +++ b/reference/algorithm/ranges_minmax_element.md @@ -23,12 +23,38 @@ namespace std::ranges { minmax_element(R&& r, Comp comp = {}, Proj proj = {}); // (2) C++20 + + template S, + class Proj = identity, + indirect_strict_weak_order> Comp = ranges::less> + minmax_element_result + minmax_element(Ep&& exec, + I first, + S last, + Comp comp = {}, + Proj proj = {}); // (3) C++26 + + template , Proj>> Comp = ranges::less> + minmax_element_result> + minmax_element(Ep&& exec, + R&& r, + Comp comp = {}, + Proj proj = {}); // (4) C++26 } ``` * minmax_element_result[link ranges_min_max_result.md] * indirect_strict_weak_order[link /reference/iterator/indirect_strict_weak_order.md] * ranges::less[link /reference/functional/ranges_less.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 @@ -36,6 +62,8 @@ namespace std::ranges { - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 戻り値 @@ -53,6 +81,7 @@ minmax_element_result { `n` を範囲の要素数とする場合、[`max`](max.md)`(floor(3(n - 1) / 2), 0)` 回の述語適用を行う。 ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -77,6 +106,32 @@ int main() ``` ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() +{ + std::vector v = {3, 1, 4, 1, 5, 9, 2, 6}; + + // 並列に最小要素と最大要素を同時に検索する + auto [min_it, max_it] = std::ranges::minmax_element(std::execution::par, v); + + std::cout << "min: " << *min_it << std::endl; + std::cout << "max: " << *max_it << std::endl; +} +``` +* std::ranges::minmax_element[color ff0000] + +#### 出力 +``` +min: 1 +max: 9 +``` + ## バージョン ### 言語 - C++20 @@ -89,3 +144,4 @@ int main() ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_mismatch.md b/reference/algorithm/ranges_mismatch.md index e45983580d..0d062d1d15 100644 --- a/reference/algorithm/ranges_mismatch.md +++ b/reference/algorithm/ranges_mismatch.md @@ -38,10 +38,51 @@ namespace std::ranges { Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // (2) C++20 + + template S1, + random_access_iterator I2, + sized_sentinel_for S2, + class Pred = ranges::equal_to, + class Proj1 = identity, + class Proj2 = identity> + requires indirectly_comparable + mismatch_result + mismatch(Ep&& exec, + I1 first1, + S1 last1, + I2 first2, + S2 last2, + Pred pred = {}, + Proj1 proj1 = {}, + Proj2 proj2 = {}); // (3) C++26 + + template + requires indirectly_comparable, iterator_t, Pred, Proj1, Proj2> + mismatch_result< + borrowed_iterator_t, + borrowed_iterator_t + > + mismatch(Ep&& exec, + R1&& r1, + R2&& r2, + Pred pred = {}, + Proj1 proj1 = {}, + Proj2 proj2 = {}); // (4) C++26 } ``` * mismatch_result[link ranges_in_in_result.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 @@ -49,6 +90,8 @@ namespace std::ranges { - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 戻り値 @@ -66,6 +109,7 @@ namespace std::ranges { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -107,7 +151,7 @@ int main() { * std::ranges::mismatch[color ff0000] * std::to_string[link /reference/string/to_string.md] -### 出力 +#### 出力 ``` mismatch index: 2 mismatch value: (3,4) @@ -117,6 +161,35 @@ mismatch value: (end,2) ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v1 = {1, 2, 3, 4, 5}; + std::vector v2 = {1, 2, 4, 4, 5}; + + // 並列に2つのシーケンスが異なる場所を探す + auto [it1, it2] = std::ranges::mismatch(std::execution::par, v1, v2); + if (it1 == v1.end()) { + std::cout << "all match" << std::endl; + } else { + std::cout << "mismatch at index: " << std::distance(v1.begin(), it1) << std::endl; + std::cout << "values: " << *it1 << " vs " << *it2 << std::endl; + } +} +``` +* std::ranges::mismatch[color ff0000] + +#### 出力 +``` +mismatch at index: 2 +values: 3 vs 4 +``` + ## 実装例 ```cpp struct mismatch_impl { @@ -158,3 +231,4 @@ inline constexpr mismatch_impl mismatch; ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_move.md b/reference/algorithm/ranges_move.md index 08ab3cf3cd..f489ba6667 100644 --- a/reference/algorithm/ranges_move.md +++ b/reference/algorithm/ranges_move.md @@ -13,26 +13,54 @@ namespace std::ranges { constexpr move_result move(I first, S last, - O result); // (1) C++20 + O result); // (1) C++20 template requires indirectly_movable, O> constexpr move_result, O> move(R&& r, - O result); // (2) C++20 + O result); // (2) C++20 + + template S, + random_access_iterator O, + sized_sentinel_for OutS> + requires indirectly_movable + move_result + move(Ep&& exec, + I first, + S last, + O result, + OutS result_last); // (3) C++26 + + template + requires indirectly_movable, iterator_t> + move_result, borrowed_iterator_t> + move(Ep&& exec, + R&& r, + OutR&& result_r); // (4) C++26 } ``` * move_result[link ranges_in_out_result.md] * weakly_incrementable[link /reference/iterator/weakly_incrementable.md] * indirectly_movable[link /reference/iterator/indirectly_movable.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 指定された範囲の要素をムーブする。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定し、出力範囲の終端も指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 事前条件 @@ -59,6 +87,7 @@ move_result { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -93,6 +122,34 @@ int main() { 4 ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include +#include + +int main() { + std::vector src = {"hello", "world", "foo", "bar", "baz"}; + std::vector dst(src.size()); + + // 並列にムーブする + std::ranges::move(std::execution::par, src, dst); + + for (const auto& s : dst) { + std::cout << s << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::move[color ff0000] + +#### 出力 +``` +hello world foo bar baz +``` + ## バージョン ### 言語 - C++20 @@ -105,3 +162,4 @@ int main() { ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_move_backward.md b/reference/algorithm/ranges_move_backward.md index 4e6ab8bb61..059f1c1bc2 100644 --- a/reference/algorithm/ranges_move_backward.md +++ b/reference/algorithm/ranges_move_backward.md @@ -13,25 +13,51 @@ namespace std::ranges { constexpr move_backward_result move_backward(I1 first, S1 last, - I2 result); // (1) C++20 + I2 result); // (1) C++20 template requires indirectly_movable, I> constexpr move_backward_result, I> move_backward(R&& r, - I result); // (2) C++20 + I result); // (2) C++20 + + template S1, + random_access_iterator I2> + requires indirectly_movable + move_backward_result + move_backward(Ep&& exec, + I1 first, + S1 last, + I2 result); // (3) C++26 + + template + requires indirectly_movable, I> + move_backward_result, I> + move_backward(Ep&& exec, + R&& r, + I result); // (4) C++26 } ``` * move_backward_result[link ranges_in_out_result.md] * indirectly_movable[link /reference/iterator/indirectly_movable.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 指定された範囲の要素を後ろからムーブする。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 事前条件 `result` は `(first,last]` の範囲に含まれてはならない。 @@ -61,6 +87,7 @@ move_backward_result { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -104,6 +131,33 @@ int main() { 2 ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 0, 0}; + + // 並列に先頭3要素を後方へムーブ + std::ranges::move_backward(std::execution::par, + v.begin(), v.begin() + 3, v.end()); + + for (int x : v) { + std::cout << x << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::move_backward[color ff0000] + +#### 出力 +``` +1 2 1 2 3 +``` + ## バージョン ### 言語 - C++20 @@ -116,3 +170,4 @@ int main() { ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_none_of.md b/reference/algorithm/ranges_none_of.md index 9d3bc4f7a6..1a3c07c175 100644 --- a/reference/algorithm/ranges_none_of.md +++ b/reference/algorithm/ranges_none_of.md @@ -23,14 +23,40 @@ namespace std::ranges { none_of(R&& r, Pred pred, Proj proj = {}); // (2) C++20 + + template S, + class Proj = identity, + indirect_unary_predicate> Pred> + bool none_of(Ep&& exec, + I first, + S last, + Pred pred, + Proj proj = {}); // (3) C++26 + + template , Proj>> Pred> + bool none_of(Ep&& exec, + R&& r, + Pred pred, + Proj proj = {}); // (4) C++26 } ``` +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 範囲の全ての要素が条件を満たさないかを判定する。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## テンプレートパラメータ制約 - (1): @@ -62,6 +88,7 @@ all_of(first, last, not_fn(pred)); ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -83,12 +110,37 @@ int main() { ``` * std::ranges::none_of[color ff0000] -### 出力 +#### 出力 ``` false true ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 3, 5, 7, 9}; + + std::cout << std::boolalpha; + + // 並列に全ての要素が偶数でないかを判定 + bool result = std::ranges::none_of(std::execution::par, v, + [](int x) { return x % 2 == 0; }); + std::cout << result << std::endl; +} +``` +* std::ranges::none_of[color ff0000] + +#### 出力 +``` +true +``` + ## 実装例 ```cpp struct none_of_impl { @@ -131,3 +183,4 @@ inline constexpr none_of_impl none_of; ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_nth_element.md b/reference/algorithm/ranges_nth_element.md index 46e6a0f6e5..1ef170c401 100644 --- a/reference/algorithm/ranges_nth_element.md +++ b/reference/algorithm/ranges_nth_element.md @@ -27,11 +27,39 @@ namespace std::ranges { iterator_t nth, Comp comp = {}, Proj proj = {}); // (2) C++20 + + template S, + class Comp = ranges::less, + class Proj = identity> + requires sortable + I nth_element(Ep&& exec, + I first, + I nth, + S last, + Comp comp = {}, + Proj proj = {}); // (3) C++26 + + template + requires sortable, Comp, Proj> + borrowed_iterator_t + nth_element(Ep&& exec, + R&& r, + iterator_t nth, + Comp comp = {}, + Proj proj = {}); // (4) C++26 } ``` * ranges::less[link /reference/functional/ranges_less.md] * sortable[link /reference/iterator/sortable.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 @@ -39,6 +67,8 @@ namespace std::ranges { - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する この関数は範囲 `[first,last)` の並び替えを行うが、基準位置 `nth` のみが正しい要素、つまり仮に範囲 `[first,last)` 全体を並び替えた際に`nth`に位置すべき要素となる。前半の範囲 `[first,nth)` は関数呼び出し後の位置 `nth` にある要素よりも小さいことは保証されるが、その範囲 `[first,nth)` 内での要素並び順はなんら保証されない。 @@ -56,6 +86,7 @@ namespace std::ranges { 平均で線形時間 ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -88,6 +119,37 @@ int main() 10 ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() +{ + std::vector v = {5, 10, 4, 7, 1, 9, 8, 6, 2}; + + // 並列に4番目に小さい値より小さい値を前に集める + std::ranges::nth_element(std::execution::par, v, v.begin() + 3); + + std::cout << "4th element: " << v[3] << std::endl; + + for (int i : v) { + std::cout << i << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::nth_element[color ff0000] +* v.begin()[link /reference/vector/vector/begin.md] + +#### 出力例 +``` +4th element: 5 +2 1 4 5 7 6 8 9 10 +``` + ## バージョン ### 言語 - C++20 @@ -100,3 +162,4 @@ int main() ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_partial_sort.md b/reference/algorithm/ranges_partial_sort.md index e5e6cfcb84..fca20788b6 100644 --- a/reference/algorithm/ranges_partial_sort.md +++ b/reference/algorithm/ranges_partial_sort.md @@ -27,11 +27,39 @@ namespace std::ranges { iterator_t middle, Comp comp = {}, Proj proj = {}); // (2) C++20 + + template S, + class Comp = ranges::less, + class Proj = identity> + requires sortable + I partial_sort(Ep&& exec, + I first, + I middle, + S last, + Comp comp = {}, + Proj proj = {}); // (3) C++26 + + template + requires sortable, Comp, Proj> + borrowed_iterator_t + partial_sort(Ep&& exec, + R&& r, + iterator_t middle, + Comp comp = {}, + Proj proj = {}); // (4) C++26 } ``` * ranges::less[link /reference/functional/ranges_less.md] * sortable[link /reference/iterator/sortable.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 @@ -39,6 +67,8 @@ namespace std::ranges { - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する この関数は、「売り上げランキング トップ1位から10位まで」のように、全体ではなく最高順位から途中までの順位がわかればよい状況で、全体を並び替える[`sort()`](sort.md)関数の代わりに使用できる。 @@ -56,6 +86,7 @@ namespace std::ranges { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -81,6 +112,34 @@ int main() 12435 ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() +{ + std::vector v = {3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5}; + + // 並列に先頭3要素を並んだ状態にする + std::ranges::partial_sort(std::execution::par, v, v.begin() + 3); + + for (int i : v) { + std::cout << i << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::partial_sort[color ff0000] +* v.begin()[link /reference/vector/vector/begin.md] + +#### 出力例 +``` +1 1 2 4 5 9 3 6 5 3 5 +``` + ## バージョン ### 言語 - C++20 @@ -93,3 +152,4 @@ int main() ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_partial_sort_copy.md b/reference/algorithm/ranges_partial_sort_copy.md index bb5a1dd34f..6ba612c0aa 100644 --- a/reference/algorithm/ranges_partial_sort_copy.md +++ b/reference/algorithm/ranges_partial_sort_copy.md @@ -42,6 +42,48 @@ namespace std::ranges { Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // (2) C++20 + + template S1, + random_access_iterator I2, + sized_sentinel_for S2, + class Comp = ranges::less, + class Proj1 = identity, + class Proj2 = identity> + requires indirectly_copyable && + sortable && + indirect_strict_weak_order, projected> + partial_sort_copy_result + partial_sort_copy(Ep&& exec, + I1 first, + S1 last, + I2 result_first, + S2 result_last, + Comp comp = {}, + Proj1 proj1 = {}, + Proj2 proj2 = {}); // (3) C++26 + + template + requires indirectly_copyable, iterator_t> && + sortable, Comp, Proj2> && + indirect_strict_weak_order< + Comp, + projected, Proj1>, + projected, Proj2> + > + partial_sort_copy_result, borrowed_iterator_t> + partial_sort_copy(Ep&& exec, + R1&& r, + R2&& result_r, + Comp comp = {}, + Proj1 proj1 = {}, + Proj2 proj2 = {}); // (4) C++26 } ``` * partial_sort_copy_result[link ranges_in_out_result.md] @@ -50,12 +92,18 @@ namespace std::ranges { * indirect_strict_weak_order[link /reference/iterator/indirect_strict_weak_order.md] * sortable[link /reference/iterator/sortable.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 範囲を部分的にソートした結果を他の範囲にコピーする - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 効果 `N =` [`min`](/reference/algorithm/min.md)`(last - first, result_last - result_first)` とする。 @@ -78,6 +126,7 @@ partial_sort_copy_result { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -104,6 +153,34 @@ int main() 12 ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector src = {3, 1, 4, 1, 5, 9, 2, 6}; + std::vector dst(3); + + // 並列に上位3個の要素をソートしてコピー + std::ranges::partial_sort_copy(std::execution::par, + src, dst); + + for (int x : dst) { + std::cout << x << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::partial_sort_copy[color ff0000] + +#### 出力 +``` +1 1 2 +``` + ## バージョン ### 言語 - C++20 @@ -116,3 +193,4 @@ int main() ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_partition.md b/reference/algorithm/ranges_partition.md index 6d73b817e1..a87c9e0d11 100644 --- a/reference/algorithm/ranges_partition.md +++ b/reference/algorithm/ranges_partition.md @@ -24,15 +24,45 @@ namespace std::ranges { partition(R&& r, Pred pred, Proj proj = {}); // (2) C++20 + + template S, + class Proj = identity, + indirect_unary_predicate> Pred> + requires permutable + subrange + partition(Ep&& exec, + I first, + S last, + Pred pred, + Proj proj = {}); // (3) C++26 + + template , Proj>> Pred> + requires permutable> + borrowed_subrange_t + partition(Ep&& exec, + R&& r, + Pred pred, + Proj proj = {}); // (4) C++26 } ``` * permutable[link /reference/iterator/permutable.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 与えられた範囲を条件によって[区分化](/reference/algorithm.md#sequence-is-partitioned)する。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 効果 @@ -54,6 +84,7 @@ namespace std::ranges { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -93,6 +124,41 @@ int main() ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() +{ + std::vector v = {1, 2, 3, 4, 5, 6, 7, 8}; + + // 並列に偶数グループと奇数グループに分ける + auto boundary = std::ranges::partition(std::execution::par, v, [](int x) { return x % 2 == 0; }); + + std::cout << "even: "; + for (auto it = v.begin(); it != boundary.begin(); ++it) { + std::cout << *it << ' '; + } + std::cout << std::endl; + + std::cout << "odd: "; + for (int x : boundary) { + std::cout << x << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::partition[color ff0000] + +#### 出力例 +``` +even: 8 2 6 4 +odd: 5 3 7 1 +``` + ## バージョン ### 言語 - C++20 @@ -105,3 +171,4 @@ int main() ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_partition_copy.md b/reference/algorithm/ranges_partition_copy.md index 26ec256e38..0cf6d1f51b 100644 --- a/reference/algorithm/ranges_partition_copy.md +++ b/reference/algorithm/ranges_partition_copy.md @@ -33,12 +33,53 @@ namespace std::ranges { O2 out_false, Pred pred, Proj proj = {}); // (2) C++20 + + template S, + random_access_iterator O1, + sized_sentinel_for OutS1, + random_access_iterator O2, + sized_sentinel_for OutS2, + class Proj = identity, + indirect_unary_predicate> Pred> + requires indirectly_copyable && indirectly_copyable + partition_copy_result + partition_copy(Ep&& exec, + I first, + S last, + O1 out_true, + OutS1 out_true_last, + O2 out_false, + OutS2 out_false_last, + Pred pred, + Proj proj = {}); // (3) C++26 + + template , Proj>> Pred> + requires indirectly_copyable, iterator_t> && + indirectly_copyable, iterator_t> + partition_copy_result, borrowed_iterator_t, borrowed_iterator_t> + partition_copy(Ep&& exec, + R&& r, + OutR1&& out_true, + OutR2&& out_false, + Pred pred, + Proj proj = {}); // (4) C++26 } ``` * weakly_incrementable[link /reference/iterator/weakly_incrementable.md] * indirectly_copyable[link /reference/iterator/indirectly_copyable.md] * partition_copy_result[link ranges_in_out_out_result.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 @@ -46,6 +87,8 @@ namespace std::ranges { - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 事前条件 @@ -64,6 +107,7 @@ namespace std::ranges { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -105,6 +149,45 @@ evens : 2,4, odds : 1,3,5, ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5, 6, 7, 8}; + std::vector evens(8); + std::vector odds(8); + + // 並列に偶数と奇数に分類してコピー + auto [in_end, even_end, odd_end] = + std::ranges::partition_copy(std::execution::par, v, + evens, odds, + [](int x) { return x % 2 == 0; }); + + std::cout << "evens: "; + for (auto it = evens.begin(); it != even_end; ++it) { + std::cout << *it << ' '; + } + std::cout << std::endl; + + std::cout << "odds: "; + for (auto it = odds.begin(); it != odd_end; ++it) { + std::cout << *it << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::partition_copy[color ff0000] + +#### 出力 +``` +evens: 2 4 6 8 +odds: 1 3 5 7 +``` + ## バージョン ### 言語 - C++20 @@ -117,3 +200,4 @@ odds : 1,3,5, ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_remove.md b/reference/algorithm/ranges_remove.md index 046703e18a..0ce717b591 100644 --- a/reference/algorithm/ranges_remove.md +++ b/reference/algorithm/ranges_remove.md @@ -53,15 +53,55 @@ namespace std::ranges { remove(R&& r, const T& value, Proj proj = {}); // (2) C++26 + + template S, + class T, + class Proj = identity> + requires permutable && + indirect_binary_predicate< + ranges::equal_to, + projected, + const T* + > + subrange + remove(Ep&& exec, + I first, + S last, + const T& value, + Proj proj = {}); // (3) C++26 + + template + requires permutable> && + indirect_binary_predicate< + ranges::equal_to, + projected, Proj>, + const T* + > + borrowed_subrange_t + remove(Ep&& exec, + R&& r, + const T& value, + Proj proj = {}); // (4) C++26 } ``` * permutable[link /reference/iterator/permutable.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 指定された要素を取り除く。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 効果 @@ -172,6 +212,34 @@ int main() { 5,6 ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 2, 5, 2, 7}; + + // 並列に値2を除去する + auto result = std::ranges::remove(std::execution::par, v, 2); + v.erase(result.begin(), result.end()); + + for (int x : v) { + std::cout << x << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::remove[color ff0000] +* v.erase[link /reference/vector/vector/erase.md] + +#### 出力 +``` +1 3 5 7 +``` + ## バージョン ### 言語 - C++20 @@ -186,3 +254,4 @@ int main() { - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) - [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) - C++26で波カッコ初期化 (リスト初期化) に対応した +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_remove_copy.md b/reference/algorithm/ranges_remove_copy.md index 68e13f9ee0..b241f71f86 100644 --- a/reference/algorithm/ranges_remove_copy.md +++ b/reference/algorithm/ranges_remove_copy.md @@ -71,18 +71,64 @@ namespace std::ranges { O result, const T& value, Proj proj = {}); // (2) C++26 + + template S, + random_access_iterator O, + sized_sentinel_for OutS, + class T, + class Proj = identity> + requires indirectly_copyable && + indirect_binary_predicate< + ranges::equal_to, + projected, + const T* + > + remove_copy_result + remove_copy(Ep&& exec, + I first, + S last, + O result, + OutS result_last, + const T& value, + Proj proj = {}); // (3) C++26 + + template + requires indirectly_copyable, iterator_t> && + indirect_binary_predicate< + ranges::equal_to, + projected, Proj>, + const T* + > + remove_copy_result, borrowed_iterator_t> + remove_copy(Ep&& exec, + R&& r, + OutR&& result_r, + const T& value, + Proj proj = {}); // (4) C++26 } ``` * weakly_incrementable[link /reference/iterator/weakly_incrementable.md] * indirectly_copyable[link /reference/iterator/indirectly_copyable.md] * remove_copy_result[link ranges_in_out_result.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 指定された要素を除け、その結果を出力の範囲へコピーする。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 事前条件 - `[first,last)` と `[result,result + (last - first))` は重なってはならない。 @@ -174,6 +220,33 @@ int main() { ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector src = {1, 2, 3, 2, 5, 2, 7}; + std::vector dst(src.size()); + + // 並列に値2を除去してコピーする + auto result = std::ranges::remove_copy(std::execution::par, src, dst, 2); + + for (auto it = dst.begin(); it != result.out; ++it) { + std::cout << *it << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::remove_copy[color ff0000] + +#### 出力 +``` +1 3 5 7 +``` + ## バージョン ### 言語 - C++20 @@ -188,3 +261,4 @@ int main() { - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) - [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) - C++26で波カッコ初期化 (リスト初期化) に対応した +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_remove_copy_if.md b/reference/algorithm/ranges_remove_copy_if.md index 2f0c10842a..369cf096e0 100644 --- a/reference/algorithm/ranges_remove_copy_if.md +++ b/reference/algorithm/ranges_remove_copy_if.md @@ -29,18 +29,54 @@ namespace std::ranges { O result, Pred pred, Proj proj = {}); // (2) C++20 + + template S, + random_access_iterator O, + sized_sentinel_for OutS, + class Proj = identity, + indirect_unary_predicate> Pred> + requires indirectly_copyable + remove_copy_if_result + remove_copy_if(Ep&& exec, + I first, + S last, + O result, + OutS result_last, + Pred pred, + Proj proj = {}); // (3) C++26 + + template , Proj>> Pred> + requires indirectly_copyable, iterator_t> + remove_copy_if_result, borrowed_iterator_t> + remove_copy_if(Ep&& exec, + R&& r, + OutR&& result_r, + Pred pred, + Proj proj = {}); // (4) C++26 } ``` * weakly_incrementable[link /reference/iterator/weakly_incrementable.md] * indirectly_copyable[link /reference/iterator/indirectly_copyable.md] * remove_copy_if_result[link ranges_in_out_result.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 条件を満たす要素を除け、その結果を出力の範囲へコピーする。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 事前条件 - `[first,last)` と `[result,result + (last - first))` は重なってはならない。 @@ -63,6 +99,7 @@ namespace std::ranges { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -84,6 +121,34 @@ int main() { ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector src = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + std::vector dst(src.size()); + + // 並列に奇数を除去してコピーする + auto result = std::ranges::remove_copy_if(std::execution::par, src, dst, + [](int x) { return x % 2 != 0; }); + + for (auto it = dst.begin(); it != result.out; ++it) { + std::cout << *it << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::remove_copy_if[color ff0000] + +#### 出力 +``` +2 4 6 8 10 +``` + ## バージョン ### 言語 - C++20 @@ -96,3 +161,4 @@ int main() { ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_remove_if.md b/reference/algorithm/ranges_remove_if.md index 6ee0da6da1..b6c23a265f 100644 --- a/reference/algorithm/ranges_remove_if.md +++ b/reference/algorithm/ranges_remove_if.md @@ -24,9 +24,37 @@ namespace std::ranges { remove_if(R&& r, Pred pred, Proj proj = {}); // (2) C++20 + + template S, + class Proj = identity, + indirect_unary_predicate> Pred> + requires permutable + subrange + remove_if(Ep&& exec, + I first, + S last, + Pred pred, + Proj proj = {}); // (3) C++26 + + template , Proj>> Pred> + requires permutable> + borrowed_subrange_t + remove_if(Ep&& exec, + R&& r, + Pred pred, + Proj proj = {}); // (4) C++26 } ``` * permutable[link /reference/iterator/permutable.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 @@ -34,6 +62,8 @@ namespace std::ranges { - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 効果 @@ -59,6 +89,7 @@ namespace std::ranges { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -98,6 +129,35 @@ size before: 5 size after: 2 ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + + // 並列に奇数を除去する + auto result = std::ranges::remove_if(std::execution::par, v, + [](int x) { return x % 2 != 0; }); + v.erase(result.begin(), result.end()); + + for (int x : v) { + std::cout << x << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::remove_if[color ff0000] +* v.erase[link /reference/vector/vector/erase.md] + +#### 出力 +``` +2 4 6 8 10 +``` + ## バージョン ### 言語 - C++20 @@ -110,3 +170,4 @@ size after: 2 ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_replace.md b/reference/algorithm/ranges_replace.md index 9e208283a8..26bc41e47c 100644 --- a/reference/algorithm/ranges_replace.md +++ b/reference/algorithm/ranges_replace.md @@ -71,16 +71,59 @@ namespace std::ranges { const T1& old_value, const T2& new_value, Proj proj = {}); // (2) C++26 + + template S, + class T1, + class T2, + class Proj = identity> + requires indirectly_writable && + indirect_binary_predicate< + ranges::equal_to, + projected, + const T1* + > + I replace(Ep&& exec, + I first, + S last, + const T1& old_value, + const T2& new_value, + Proj proj = {}); // (3) C++26 + + template + requires indirectly_writable, const T2&> && + indirect_binary_predicate< + ranges::equal_to, + projected, Proj>, + const T1* + > + borrowed_iterator_t + replace(Ep&& exec, + R&& r, + const T1& old_value, + const T2& new_value, + Proj proj = {}); // (4) C++26 } ``` * indirectly_writable[link /reference/iterator/indirectly_writable.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 指定された値と一致する要素を指定された値に置き換える。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 効果 @@ -168,6 +211,32 @@ int main() { 9,9 ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 2, 5, 2, 7}; + + // 並列に値2を全て10に置き換える + std::ranges::replace(std::execution::par, v, 2, 10); + + for (int x : v) { + std::cout << x << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::replace[color ff0000] + +#### 出力 +``` +1 10 3 10 5 10 7 +``` + ## バージョン ### 言語 - C++20 @@ -182,3 +251,4 @@ int main() { - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) - [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) - C++26で波カッコ初期化 (リスト初期化) に対応した +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_replace_copy.md b/reference/algorithm/ranges_replace_copy.md index 6fe9ba293d..03ffe9d920 100644 --- a/reference/algorithm/ranges_replace_copy.md +++ b/reference/algorithm/ranges_replace_copy.md @@ -24,7 +24,7 @@ namespace std::ranges { O result, const T1& old_value, const T2& new_value, - Proj proj = {}); // (1) C++20 + Proj proj = {}); // (1) C++20 template S, class O, @@ -43,7 +43,7 @@ namespace std::ranges { O result, const T1& old_value, const T2& new_value, - Proj proj = {}); // (1) C++26 + Proj proj = {}); // (1) C++26 template S, + random_access_iterator O, + sized_sentinel_for OutS, + class T1, + class T2, + class Proj = identity> + requires indirectly_copyable && + indirect_binary_predicate< + ranges::equal_to, + projected, + const T1* + > + replace_copy_result + replace_copy(Ep&& exec, + I first, + S last, + O result, + OutS result_last, + const T1& old_value, + const T2& new_value, + Proj proj = {}); // (3) C++26 + + template + requires indirectly_copyable, iterator_t> && + indirect_binary_predicate< + ranges::equal_to, + projected, Proj>, + const T1* + > + replace_copy_result, borrowed_iterator_t> + replace_copy(Ep&& exec, + R&& r, + OutR&& result_r, + const T1& old_value, + const T2& new_value, + Proj proj = {}); // (4) C++26 } ``` * indirectly_copyable[link /reference/iterator/indirectly_copyable.md] * replace_copy_result[link ranges_in_out_result.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 指定された値を一致する要素を指定された値に置き換え、その結果を出力の範囲へコピーする。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定し、出力範囲の終端も指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 事前条件 - `[first,last)` と `[result,result + (last - first))` の範囲が重なっていてはならない。 @@ -185,6 +235,34 @@ int main() { 9,9 ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector src = {3, 1, 2, 1, 2}; + std::vector dst(src.size()); + + // 並列に1を10に置き換えてコピー + std::ranges::replace_copy(std::execution::par, + src, dst, 1, 10); + + for (int x : dst) { + std::cout << x << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::replace_copy[color ff0000] + +#### 出力 +``` +3 10 2 10 2 +``` + ## バージョン ### 言語 - C++20 @@ -199,3 +277,4 @@ int main() { - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) - [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) - C++26で波カッコ初期化 (リスト初期化) に対応した +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_replace_copy_if.md b/reference/algorithm/ranges_replace_copy_if.md index ef97b244c7..6dd2ba5c44 100644 --- a/reference/algorithm/ranges_replace_copy_if.md +++ b/reference/algorithm/ranges_replace_copy_if.md @@ -19,7 +19,7 @@ namespace std::ranges { O result, Pred pred, const T& new_value, - Proj proj = {}); // (1) C++20 + Proj proj = {}); // (1) C++20 template S, class O, @@ -35,7 +35,7 @@ namespace std::ranges { O result, Pred pred, const T& new_value, - Proj proj = {}); // (1) C++26 + Proj proj = {}); // (1) C++26 template , @@ -62,18 +62,58 @@ namespace std::ranges { O result, Pred pred, const T& new_value, - Proj proj = {}); // (2) C++26 + Proj proj = {}); // (2) C++26 + + template S, + random_access_iterator O, + sized_sentinel_for OutS, + class T, + class Proj = identity, + indirect_unary_predicate> Pred> + requires indirectly_copyable + replace_copy_if_result + replace_copy_if(Ep&& exec, + I first, + S last, + O result, + OutS result_last, + Pred pred, + const T& new_value, + Proj proj = {}); // (3) C++26 + + template , Proj>> Pred> + requires indirectly_copyable, iterator_t> + replace_copy_if_result, borrowed_iterator_t> + replace_copy_if(Ep&& exec, + R&& r, + OutR&& result_r, + Pred pred, + const T& new_value, + Proj proj = {}); // (4) C++26 } ``` * indirectly_copyable[link /reference/iterator/indirectly_copyable.md] * replace_copy_if_result[link ranges_in_out_result.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 条件を満たす要素を指定された値に置き換え、その結果を出力の範囲へコピーする。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定し、出力範囲の終端も指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 事前条件 - `[first,last)` と `[result,result + (last - first))` の範囲が重なっていてはならない。 @@ -172,6 +212,35 @@ int main() { 9,9 ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector src = {3, 1, 4, 1, 5}; + std::vector dst(src.size()); + + // 並列に奇数を0に置き換えてコピー + std::ranges::replace_copy_if(std::execution::par, + src, dst, + [](int x) { return x % 2 != 0; }, 0); + + for (int x : dst) { + std::cout << x << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::replace_copy_if[color ff0000] + +#### 出力 +``` +0 0 4 0 0 +``` + ## バージョン ### 言語 - C++20 @@ -186,3 +255,4 @@ int main() { - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) - [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) - C++26で波カッコ初期化 (リスト初期化) に対応した +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_replace_if.md b/reference/algorithm/ranges_replace_if.md index 21580be08c..6d8cd8f0dd 100644 --- a/reference/algorithm/ranges_replace_if.md +++ b/reference/algorithm/ranges_replace_if.md @@ -17,7 +17,7 @@ namespace std::ranges { S last, Pred pred, const T& new_value, - Proj proj = {}); // (1) C++20 + Proj proj = {}); // (1) C++20 template S, + class T, + class Proj = identity, + indirect_unary_predicate> Pred> + requires indirectly_writable + I replace_if(Ep&& exec, + I first, + S last, + Pred pred, + const T& new_value, + Proj proj = {}); // (3) C++26 + + template , Proj>> Pred> + requires indirectly_writable, const T&> + borrowed_iterator_t + replace_if(Ep&& exec, + R&& r, + Pred pred, + const T& new_value, + Proj proj = {}); // (4) C++26 } ``` * indirectly_writable[link /reference/iterator/indirectly_writable.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 条件を満たす要素を指定された値に置き換える。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 効果 @@ -64,6 +97,7 @@ namespace std::ranges { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -88,6 +122,33 @@ int main() { ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + + // 並列に奇数を全て0に置き換える + std::ranges::replace_if(std::execution::par, v, + [](int x) { return x % 2 != 0; }, 0); + + for (int x : v) { + std::cout << x << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::replace_if[color ff0000] + +#### 出力 +``` +0 2 0 4 0 6 0 8 0 10 +``` + ## バージョン ### 言語 - C++20 @@ -102,3 +163,4 @@ int main() { - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) - [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) - C++26で波カッコ初期化 (リスト初期化) に対応した +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_reverse.md b/reference/algorithm/ranges_reverse.md index d144567a34..be480a16a2 100644 --- a/reference/algorithm/ranges_reverse.md +++ b/reference/algorithm/ranges_reverse.md @@ -17,16 +17,37 @@ namespace std::ranges { requires permutable> constexpr borrowed_iterator_t reverse(R&& r); // (2) C++20 + + template S> + requires permutable + I reverse(Ep&& exec, + I first, + S last); // (3) C++26 + + template + requires permutable> + borrowed_iterator_t + reverse(Ep&& exec, + R&& r); // (4) C++26 } ``` * permutable[link /reference/iterator/permutable.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 要素の並びを逆にする。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 効果 @@ -42,6 +63,7 @@ namespace std::ranges { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -62,6 +84,33 @@ esrever ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() +{ + std::vector v = {1, 2, 3, 4, 5}; + + // 並列に要素の並びを逆にする + std::ranges::reverse(std::execution::par, v); + + for (int i : v) { + std::cout << i << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::reverse[color ff0000] + +#### 出力 +``` +5 4 3 2 1 +``` + ## バージョン ### 言語 - C++20 @@ -74,3 +123,4 @@ esrever ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_reverse_copy.md b/reference/algorithm/ranges_reverse_copy.md index c0370b15d2..879d2d72e4 100644 --- a/reference/algorithm/ranges_reverse_copy.md +++ b/reference/algorithm/ranges_reverse_copy.md @@ -21,18 +21,47 @@ namespace std::ranges { constexpr reverse_copy_result, O> reverse_copy(R&& r, O result); // (2) C++20 + + template S, + random_access_iterator O, + sized_sentinel_for OutS> + requires indirectly_copyable + reverse_copy_truncated_result + reverse_copy(Ep&& exec, + I first, + S last, + O result, + OutS result_last); // (3) C++26 + + template + requires indirectly_copyable, iterator_t> + reverse_copy_truncated_result, borrowed_iterator_t> + reverse_copy(Ep&& exec, + R&& r, + OutR&& result_r); // (4) C++26 } ``` * weakly_incrementable[link /reference/iterator/weakly_incrementable.md] * indirectly_copyable[link /reference/iterator/indirectly_copyable.md] * reverse_copy_result[link ranges_in_out_result.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] +* reverse_copy_truncated_result[link ranges_in_in_out_result.md] ## 概要 要素の並びを逆にし、その結果を出力の範囲へコピーする。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定し、出力範囲の終端も指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 事前条件 @@ -44,7 +73,8 @@ namespace std::ranges { ## 戻り値 -`{ .in = last, .out = result + (last - first) }` +- (1), (2): `{ .in = last, .out = result + (last - first) }` +- (3), (4): 出力範囲が入力範囲より短い場合、出力範囲の末尾まで書き込み、`in1`と`in2`で入力範囲のどこまで処理されたかを示す。`in1`は常に`last`と等しく、`in2`は入力範囲内の停止点を指す。出力範囲が十分な場合は`in2 == first`となる ## 計算量 @@ -52,6 +82,7 @@ namespace std::ranges { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -66,11 +97,38 @@ int main() { ``` * std::ranges::reverse_copy[color ff0000] -### 出力 +#### 出力 ``` esrever ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector src = {1, 2, 3, 4, 5}; + std::vector dst(src.size()); + + // 並列に逆順コピーする + auto result = std::ranges::reverse_copy(std::execution::par, src, dst); + + for (int x : dst) { + std::cout << x << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::reverse_copy[color ff0000] + +#### 出力 +``` +5 4 3 2 1 +``` + ## バージョン ### 言語 @@ -84,3 +142,5 @@ esrever ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) +- [P3709R2 Reconsider parallel `ranges::rotate_copy` and `ranges::reverse_copy`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3709r2.html) diff --git a/reference/algorithm/ranges_rotate.md b/reference/algorithm/ranges_rotate.md index a72fe1ebba..23a4eb07d5 100644 --- a/reference/algorithm/ranges_rotate.md +++ b/reference/algorithm/ranges_rotate.md @@ -18,15 +18,39 @@ namespace std::ranges { constexpr borrowed_subrange_t rotate(R&& r, iterator_t middle); // (2) C++20 + + template S> + requires permutable + subrange + rotate(Ep&& exec, + I first, + I middle, + S last); // (3) C++26 + + template + requires permutable> + borrowed_subrange_t + rotate(Ep&& exec, + R&& r, + iterator_t middle); // (4) C++26 } ``` * permutable[link /reference/iterator/permutable.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 `middle`の要素が先頭、`middle-1`の要素が末尾となるように、`[first,last)`の要素の並びを回転させる。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 事前条件 - `[first,middle)` と `[middle,last)` は有効な範囲である必要がある。 @@ -131,6 +155,34 @@ swapping 0x1806043(1) <-> 0x1806045(5) 234501 ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() +{ + std::vector v = {1, 2, 3, 4, 5}; + + // 並列に要素を回転させる (先頭から2つ目の要素が先頭に来る) + std::ranges::rotate(std::execution::par, v, v.begin() + 2); + + for (int i : v) { + std::cout << i << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::rotate[color ff0000] +* v.begin()[link /reference/vector/vector/begin.md] + +#### 出力 +``` +3 4 5 1 2 +``` + ## 実装例 - [std::rotate を読んでみた](http://www.kmonos.net/wlog/115.html#_0007101223) @@ -146,3 +198,4 @@ swapping 0x1806043(1) <-> 0x1806045(5) ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_rotate_copy.md b/reference/algorithm/ranges_rotate_copy.md index 6e2aa01a10..67725ea133 100644 --- a/reference/algorithm/ranges_rotate_copy.md +++ b/reference/algorithm/ranges_rotate_copy.md @@ -23,17 +23,48 @@ namespace std::ranges { rotate_copy(R&& r, iterator_t middle, O result); // (2) C++20 + + template S, + random_access_iterator O, + sized_sentinel_for OutS> + requires indirectly_copyable + rotate_copy_truncated_result + rotate_copy(Ep&& exec, + I first, + I middle, + S last, + O result, + OutS result_last); // (3) C++26 + + template + requires indirectly_copyable, iterator_t> + rotate_copy_truncated_result, borrowed_iterator_t> + rotate_copy(Ep&& exec, + R&& r, + iterator_t middle, + OutR&& result_r); // (4) C++26 } ``` * weakly_incrementable[link /reference/iterator/weakly_incrementable.md] * rotate_copy_result[link ranges_in_out_result.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] +* rotate_copy_truncated_result[link ranges_in_in_out_result.md] ## 概要 `middle`の要素が先頭、`middle-1`の要素が末尾となるように、`[first,last)`の要素の並びを回転させ、その結果を出力の範囲へコピーする。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定し、出力範囲の終端も指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 事前条件 @@ -45,7 +76,8 @@ namespace std::ranges { ## 戻り値 -回転前の先頭の要素を指すイテレータ`result + (last - first)` +- (1), (2): `{ .in = last, .out = result + (last - first) }` +- (3), (4): 出力範囲が入力範囲より短い場合、出力範囲の末尾まで書き込み、`in1`と`in2`で入力範囲のどこまで処理されたかを示す。`in1`は`[middle, last)`の範囲内の停止点、`in2`は`[first, middle)`の範囲内の停止点を指す。出力範囲が十分な場合は`in1 == last`かつ`in2 == middle`となる ## 計算量 @@ -53,6 +85,7 @@ namespace std::ranges { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -71,11 +104,39 @@ int main() { * std::ranges::rotate_copy[color ff0000] * str.begin()[link /reference/string/basic_string/begin.md] -### 出力 +#### 出力 ``` tatero ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector src = {1, 2, 3, 4, 5}; + std::vector dst(src.size()); + + // 並列に回転コピーする(3番目の要素が先頭になるように) + auto result = std::ranges::rotate_copy( + std::execution::par, src, src.begin() + 2, dst); + + for (int x : dst) { + std::cout << x << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::rotate_copy[color ff0000] + +#### 出力 +``` +3 4 5 1 2 +``` + ## バージョン ### 言語 - C++20 @@ -88,3 +149,5 @@ tatero ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) +- [P3709R2 Reconsider parallel `ranges::rotate_copy` and `ranges::reverse_copy`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3709r2.html) diff --git a/reference/algorithm/ranges_search.md b/reference/algorithm/ranges_search.md index 4ff7e480eb..ef8d610055 100644 --- a/reference/algorithm/ranges_search.md +++ b/reference/algorithm/ranges_search.md @@ -35,14 +35,54 @@ namespace std::ranges { Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // (2) C++20 + + template S1, + random_access_iterator I2, + sized_sentinel_for S2, + class Pred = ranges::equal_to, + class Proj1 = identity, + class Proj2 = identity> + requires indirectly_comparable + subrange + search(Ep&& exec, + I1 first1, + S1 last1, + I2 first2, + S2 last2, + Pred pred = {}, + Proj1 proj1 = {}, + Proj2 proj2 = {}); // (3) C++26 + + template + requires indirectly_comparable, iterator_t, Pred, Proj1, Proj2> + borrowed_subrange_t + search(Ep&& exec, + R1&& r1, + R2&& r2, + Pred pred = {}, + Proj1 proj1 = {}, + Proj2 proj2 = {}); // (4) C++26 } ``` +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 あるシーケンスの中から、特定のサブシーケンスを探す - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 戻り値 - (1) : @@ -54,6 +94,7 @@ namespace std::ranges { 最大で `(last1 - first1) * (last2 - first2)` 回の、対応する比較もしくは述語が適用される ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -83,6 +124,33 @@ found: index==0 ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5, 3, 4}; + std::vector pattern = {3, 4}; + + // 並列にサブシーケンスを検索する + auto sr = std::ranges::search(std::execution::par, v, pattern); + if (sr.empty()) { + std::cout << "not found" << std::endl; + } else { + std::cout << "found: index==" << std::distance(v.begin(), sr.begin()) << std::endl; + } +} +``` +* std::ranges::search[color ff0000] + +#### 出力 +``` +found: index==2 +``` + ## 実装例 ```cpp struct search_impl { @@ -128,3 +196,4 @@ inline constexpr search_impl search; ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_set_difference.md b/reference/algorithm/ranges_set_difference.md index 3cf8ab2d23..30a8b7c9b8 100644 --- a/reference/algorithm/ranges_set_difference.md +++ b/reference/algorithm/ranges_set_difference.md @@ -39,6 +39,46 @@ namespace std::ranges { Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // (2) C++20 + + template S1, + random_access_iterator I2, + sized_sentinel_for S2, + random_access_iterator O, + sized_sentinel_for OutS, + class Comp = ranges::less, + class Proj1 = identity, + class Proj2 = identity> + requires mergeable + set_difference_result + set_difference(Ep&& exec, + I1 first1, + S1 last1, + I2 first2, + S2 last2, + O result, + OutS result_last, + Comp comp = {}, + Proj1 proj1 = {}, + Proj2 proj2 = {}); // (3) C++26 + + template + requires mergeable, iterator_t, iterator_t, Comp, Proj1, Proj2> + set_difference_result, borrowed_iterator_t> + set_difference(Ep&& exec, + R1&& r1, + R2&& r2, + OutR&& result_r, + Comp comp = {}, + Proj1 proj1 = {}, + Proj2 proj2 = {}); // (4) C++26 } ``` * set_difference_result[link ranges_in_out_result.md] @@ -46,6 +86,10 @@ namespace std::ranges { * ranges::less[link /reference/functional/ranges_less.md] * mergeable[link /reference/iterator/mergeable.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 @@ -53,6 +97,8 @@ namespace std::ranges { - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 事前条件 結果の範囲は両方の入力の範囲と重なっていてはならない。 @@ -83,6 +129,7 @@ set_difference_result { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -115,6 +162,40 @@ int main() 6 ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() +{ + std::vector a = {1, 2, 3, 4, 5, 6}; + std::vector b = {2, 3, 4}; + std::vector result(a.size()); + + // 並列にa - bの差集合を作る + auto ret = std::ranges::set_difference( + std::execution::par, + a, + b, + result + ); + + for (auto it = result.begin(); it != ret.out; ++it) { + std::cout << *it << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::set_difference[color ff0000] + +#### 出力 +``` +1 5 6 +``` + ## バージョン ### 言語 - C++20 @@ -127,3 +208,4 @@ int main() ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_set_intersection.md b/reference/algorithm/ranges_set_intersection.md index 6ae748e665..f349845a73 100644 --- a/reference/algorithm/ranges_set_intersection.md +++ b/reference/algorithm/ranges_set_intersection.md @@ -43,6 +43,50 @@ namespace std::ranges { Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // (2) C++20 + + template S1, + random_access_iterator I2, + sized_sentinel_for S2, + random_access_iterator O, + sized_sentinel_for OutS, + class Comp = ranges::less, + class Proj1 = identity, + class Proj2 = identity> + requires mergeable + set_intersection_result + set_intersection(Ep&& exec, + I1 first1, + S1 last1, + I2 first2, + S2 last2, + O result, + OutS result_last, + Comp comp = {}, + Proj1 proj1 = {}, + Proj2 proj2 = {}); // (3) C++26 + + template + requires mergeable, iterator_t, iterator_t, Comp, Proj1, Proj2> + set_intersection_result< + borrowed_iterator_t, + borrowed_iterator_t, + borrowed_iterator_t + > + set_intersection(Ep&& exec, + R1&& r1, + R2&& r2, + OutR&& result_r, + Comp comp = {}, + Proj1 proj1 = {}, + Proj2 proj2 = {}); // (4) C++26 } ``` * set_intersection_result[link ranges_in_in_out_result.md] @@ -50,12 +94,18 @@ namespace std::ranges { * ranges::less[link /reference/functional/ranges_less.md] * mergeable[link /reference/iterator/mergeable.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 2つのソート済み範囲の積集合を得る - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 事前条件 @@ -89,6 +139,7 @@ set_intersection_result { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -119,6 +170,40 @@ int main() 4 ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() +{ + std::vector a = {1, 2, 3, 4}; + std::vector b = {2, 4, 5, 6}; + std::vector result(std::min(a.size(), b.size())); + + // 並列にaとbの積集合を作る + auto ret = std::ranges::set_intersection( + std::execution::par, + a, + b, + result + ); + + for (auto it = result.begin(); it != ret.out; ++it) { + std::cout << *it << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::set_intersection[color ff0000] + +#### 出力 +``` +2 4 +``` + ## バージョン ### 言語 - C++20 @@ -131,3 +216,4 @@ int main() ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_set_symmetric_difference.md b/reference/algorithm/ranges_set_symmetric_difference.md index b2c8fa3ce2..64836ea7ef 100644 --- a/reference/algorithm/ranges_set_symmetric_difference.md +++ b/reference/algorithm/ranges_set_symmetric_difference.md @@ -43,6 +43,50 @@ namespace std::ranges { Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // (2) C++20 + + template S1, + random_access_iterator I2, + sized_sentinel_for S2, + random_access_iterator O, + sized_sentinel_for OutS, + class Comp = ranges::less, + class Proj1 = identity, + class Proj2 = identity> + requires mergeable + set_symmetric_difference_result + set_symmetric_difference(Ep&& exec, + I1 first1, + S1 last1, + I2 first2, + S2 last2, + O result, + OutS result_last, + Comp comp = {}, + Proj1 proj1 = {}, + Proj2 proj2 = {}); // (3) C++26 + + template + requires mergeable, iterator_t, iterator_t, Comp, Proj1, Proj2> + set_symmetric_difference_result< + borrowed_iterator_t, + borrowed_iterator_t, + borrowed_iterator_t + > + set_symmetric_difference(Ep&& exec, + R1&& r1, + R2&& r2, + OutR&& result_r, + Comp comp = {}, + Proj1 proj1 = {}, + Proj2 proj2 = {}); // (4) C++26 } ``` * set_symmetric_difference_result[link ranges_in_in_out_result.md] @@ -50,12 +94,18 @@ namespace std::ranges { * ranges::less[link /reference/functional/ranges_less.md] * mergeable[link /reference/iterator/mergeable.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 2つのソート済み範囲の対称差集合、すなわち2つの範囲の共通しない要素からなる集合を得る。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 事前条件 @@ -91,6 +141,7 @@ set_symmetric_difference_result { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -116,7 +167,7 @@ int main() * end()[link /reference/set/set/end.md] * std::inserter[link /reference/iterator/inserter.md] -### 出力 +#### 出力 ``` 1 5 @@ -125,6 +176,39 @@ int main() 8 ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector a = {1, 2, 3, 4, 5}; + std::vector b = {2, 4, 6, 8}; + std::vector result(a.size() + b.size()); + + // 並列に対称差を求める + auto [in1, in2, out] = std::ranges::set_symmetric_difference( + std::execution::par, + a, + b, + result + ); + + for (auto it = result.begin(); it != out; ++it) { + std::cout << *it << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::set_symmetric_difference[color ff0000] + +#### 出力 +``` +1 3 5 6 8 +``` + ## バージョン ### 言語 - C++20 @@ -137,3 +221,4 @@ int main() ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_set_union.md b/reference/algorithm/ranges_set_union.md index e4f8a977f4..e650cf4902 100644 --- a/reference/algorithm/ranges_set_union.md +++ b/reference/algorithm/ranges_set_union.md @@ -45,6 +45,52 @@ namespace std::ranges { Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // (2) C++20 + + template S1, + random_access_iterator I2, + sized_sentinel_for S2, + random_access_iterator O, + sized_sentinel_for OutS, + class Comp = ranges::less, + class Proj1 = identity, + class Proj2 = identity> + requires mergeable + set_union_result + set_union(Ep&& exec, + I1 first1, + S1 last1, + I2 first2, + S2 last2, + O result, + OutS result_last, + Comp comp = {}, + Proj1 proj1 = {}, + Proj2 proj2 = {}); // (3) C++26 + + template + requires mergeable< + iterator_t, + iterator_t, + iterator_t, + Comp, + Proj1, + Proj2> + set_union_result, borrowed_iterator_t, borrowed_iterator_t> + set_union(Ep&& exec, + R1&& r1, + R2&& r2, + OutR&& result_r, + Comp comp = {}, + Proj1 proj1 = {}, + Proj2 proj2 = {}); // (4) C++26 } ``` * set_union_result[link ranges_in_in_out_result.md] @@ -52,12 +98,18 @@ namespace std::ranges { * ranges::less[link /reference/functional/ranges_less.md] * mergeable[link /reference/iterator/mergeable.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 2つのソート済み範囲の和集合を得る - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 事前条件 結果の範囲は両方の入力の範囲と重なっていてはならない。 @@ -83,6 +135,7 @@ set_union_result { 最大で `2 * ((last1 - first1) + (last2 - first2)) - 1` 回の比較を行う ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -121,6 +174,40 @@ int main() 6 ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() +{ + std::vector a = {1, 2, 3, 4}; + std::vector b = {2, 4, 5, 6}; + std::vector result(a.size() + b.size()); + + // 並列にaとbの和集合を作る + auto ret = std::ranges::set_union( + std::execution::par, + a, + b, + result + ); + + for (auto it = result.begin(); it != ret.out; ++it) { + std::cout << *it << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::set_union[color ff0000] + +#### 出力 +``` +1 2 3 4 5 6 +``` + ## バージョン ### 言語 - C++20 @@ -133,3 +220,4 @@ int main() ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_shift_left.md b/reference/algorithm/ranges_shift_left.md index 73310893b3..712f3cdbc0 100644 --- a/reference/algorithm/ranges_shift_left.md +++ b/reference/algorithm/ranges_shift_left.md @@ -18,15 +18,39 @@ namespace std::ranges { constexpr borrowed_subrange_t shift_left(R&& r, range_difference_t n); // (2) C++23 + + template S> + requires permutable + subrange + shift_left(Ep&& exec, + I first, + S last, + iter_difference_t n); // (3) C++26 + + template + requires permutable> + borrowed_subrange_t + shift_left(Ep&& exec, + R&& r, + range_difference_t n); // (4) C++26 } ``` * permutable[link /reference/iterator/permutable.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 範囲の要素をn個だけ左にシフトさせる。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する この関数に符号付き整数型のシフト数として、0および負数を指定した場合はなにもしない。 @@ -62,6 +86,7 @@ namespace std::ranges { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -86,6 +111,32 @@ int main() 3,4,5,4,5, ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5}; + + // 並列に2つ左シフト + auto result = std::ranges::shift_left(std::execution::par, v, 2); + + for (int x : result) { + std::cout << x << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::shift_left[color ff0000] + +#### 出力 +``` +3 4 5 +``` + ## バージョン ### 言語 - C++23 @@ -98,3 +149,4 @@ int main() ## 参照 - [N4901 25 Algorithms library](https://timsong-cpp.github.io/cppwp/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_shift_right.md b/reference/algorithm/ranges_shift_right.md index 1d90e77d20..ca8d29d5d6 100644 --- a/reference/algorithm/ranges_shift_right.md +++ b/reference/algorithm/ranges_shift_right.md @@ -18,9 +18,31 @@ namespace std::ranges { constexpr borrowed_subrange_t shift_right(R&& r, range_difference_t n); // (2) C++23 + + template S> + requires permutable + subrange + shift_right(Ep&& exec, + I first, + S last, + iter_difference_t n); // (3) C++26 + + template + requires permutable> + borrowed_subrange_t + shift_right(Ep&& exec, + R&& r, + range_difference_t n); // (4) C++26 } ``` * permutable[link /reference/iterator/permutable.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 @@ -28,6 +50,8 @@ namespace std::ranges { - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する この関数に符号付き整数型のシフト数として、0および負数を指定した場合はなにもしない。 @@ -63,6 +87,7 @@ namespace std::ranges { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -87,6 +112,32 @@ int main() 1,2,1,2,3, ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5}; + + // 並列に2つ右シフト + auto result = std::ranges::shift_right(std::execution::par, v, 2); + + for (int x : result) { + std::cout << x << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::shift_right[color ff0000] + +#### 出力 +``` +1 2 3 +``` + ## バージョン ### 言語 - C++23 @@ -99,3 +150,4 @@ int main() ## 参照 - [N4901 25 Algorithms library](https://timsong-cpp.github.io/cppwp/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_sort.md b/reference/algorithm/ranges_sort.md index 95bb2f9017..3fd99752cc 100644 --- a/reference/algorithm/ranges_sort.md +++ b/reference/algorithm/ranges_sort.md @@ -25,17 +25,45 @@ namespace std::ranges { sort(R&& r, Comp comp = {}, Proj proj = {}); // (2) C++20 + + template S, + class Comp = ranges::less, + class Proj = identity> + requires sortable + I sort(Ep&& exec, + I first, + S last, + Comp comp = {}, + Proj proj = {}); // (3) C++26 + + template + requires sortable, Comp, Proj> + borrowed_iterator_t + sort(Ep&& exec, + R&& r, + Comp comp = {}, + Proj proj = {}); // (4) C++26 } ``` * ranges::less[link /reference/functional/ranges_less.md] * sortable[link /reference/iterator/sortable.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 範囲を並べ替える - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 効果 `[first,last)` の範囲をソートする @@ -164,6 +192,33 @@ Carol Bob ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() +{ + std::vector v = {3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5}; + + // 並列ソート + std::ranges::sort(std::execution::par, v); + + for (int i : v) { + std::cout << i << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::sort[color ff0000] + +#### 出力 +``` +1 1 2 3 3 4 5 5 5 6 9 +``` + ## バージョン ### 言語 - C++20 @@ -176,3 +231,4 @@ Bob ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_stable_partition.md b/reference/algorithm/ranges_stable_partition.md index 872f5f7cc8..e425a0e815 100644 --- a/reference/algorithm/ranges_stable_partition.md +++ b/reference/algorithm/ranges_stable_partition.md @@ -43,9 +43,37 @@ namespace std::ranges { stable_partition(R&& r, Pred pred, Proj proj = {}); // (2) C++26 + + template S, + class Proj = identity, + indirect_unary_predicate> Pred> + requires permutable + subrange + stable_partition(Ep&& exec, + I first, + S last, + Pred pred, + Proj proj = {}); // (3) C++26 + + template , Proj>> Pred> + requires permutable> + borrowed_subrange_t + stable_partition(Ep&& exec, + R&& r, + Pred pred, + Proj proj = {}); // (4) C++26 } ``` * permutable[link /reference/iterator/permutable.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 @@ -53,6 +81,8 @@ namespace std::ranges { - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 効果 @@ -74,6 +104,7 @@ namespace std::ranges { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -102,6 +133,33 @@ int main() 5 ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() +{ + std::vector v = {1, 2, 3, 4, 5, 6, 7, 8}; + + // 並列に相対順序を保ちながら偶数グループと奇数グループに分ける + std::ranges::stable_partition(std::execution::par, v, [](int x) { return x % 2 == 0; }); + + for (int x : v) { + std::cout << x << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::stable_partition[color ff0000] + +#### 出力 +``` +2 4 6 8 1 3 5 7 +``` + ## バージョン ### 言語 - C++20 @@ -116,3 +174,4 @@ int main() - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) - [P2562R1 `constexpr` Stable Sorting](https://open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2562r1.pdf) - C++26から`constexpr`に対応した +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_stable_sort.md b/reference/algorithm/ranges_stable_sort.md index 8497fd89e3..94f35b9ca8 100644 --- a/reference/algorithm/ranges_stable_sort.md +++ b/reference/algorithm/ranges_stable_sort.md @@ -43,17 +43,45 @@ namespace std::ranges { stable_sort(R&& r, Comp comp = {}, Proj proj = {}); // (2) C++26 + + template S, + class Comp = ranges::less, + class Proj = identity> + requires sortable + I stable_sort(Ep&& exec, + I first, + S last, + Comp comp = {}, + Proj proj = {}); // (3) C++26 + + template + requires sortable, Comp, Proj> + borrowed_iterator_t + stable_sort(Ep&& exec, + R&& r, + Comp comp = {}, + Proj proj = {}); // (4) C++26 } ``` * ranges::less[link /reference/functional/ranges_less.md] * sortable[link /reference/iterator/sortable.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 範囲を安定ソートで並べ替える - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 効果 `[first,last)` の範囲をソートする @@ -72,6 +100,7 @@ namespace std::ranges { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -97,6 +126,33 @@ int main() 12345 ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() +{ + std::vector v = {3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5}; + + // 並列に安定ソートする + std::ranges::stable_sort(std::execution::par, v); + + for (int i : v) { + std::cout << i << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::stable_sort[color ff0000] + +#### 出力 +``` +1 1 2 3 3 4 5 5 5 6 9 +``` + ## バージョン ### 言語 - C++20 @@ -111,3 +167,4 @@ int main() - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) - [P2562R1 `constexpr` Stable Sorting](https://open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2562r1.pdf) - C++26から`constexpr`に対応した +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_starts_with.md b/reference/algorithm/ranges_starts_with.md index a3e605434e..d7ee0b1c02 100644 --- a/reference/algorithm/ranges_starts_with.md +++ b/reference/algorithm/ranges_starts_with.md @@ -35,8 +35,46 @@ namespace std::ranges { Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // (2) C++23 + + template S1, + random_access_iterator I2, + sized_sentinel_for S2, + class Pred = ranges::equal_to, + class Proj1 = identity, + class Proj2 = identity> + requires indirectly_comparable + bool + starts_with(Ep&& exec, + I1 first1, + S1 last1, + I2 first2, + S2 last2, + Pred pred = {}, + Proj1 proj1 = {}, + Proj2 proj2 = {}); // (3) C++26 + + template + requires indirectly_comparable, iterator_t, Pred, Proj1, Proj2> + bool + starts_with(Ep&& exec, + R1&& r1, + R2&& r2, + Pred pred = {}, + Proj1 proj1 = {}, + Proj2 proj2 = {}); // (4) C++26 } ``` +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 @@ -44,6 +82,8 @@ namespace std::ranges { - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 戻り値 @@ -54,6 +94,7 @@ namespace std::ranges { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -70,13 +111,38 @@ int main() { ``` * std::ranges::starts_with[color ff0000] -### 出力 +#### 出力 ``` 1 0 ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5, 6}; + std::vector prefix = {1, 2, 3}; + + std::cout << std::boolalpha; + + // 並列に先頭が一致するかを判定 + bool result = std::ranges::starts_with(std::execution::par, v, prefix); + std::cout << result << std::endl; +} +``` +* std::ranges::starts_with[color ff0000] + +#### 出力 +``` +true +``` + ## 実装例 ```cpp struct starts_with_impl { @@ -114,3 +180,4 @@ inline constexpr starts_with_impl starts_with; ## 参照 - [N4950 27 Algorithms library](https://timsong-cpp.github.io/cppwp/n4950/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_swap_ranges.md b/reference/algorithm/ranges_swap_ranges.md index eca99ff9a9..d851f7e21e 100644 --- a/reference/algorithm/ranges_swap_ranges.md +++ b/reference/algorithm/ranges_swap_ranges.md @@ -15,7 +15,7 @@ namespace std::ranges { swap_ranges(I1 first1, S1 last1, I2 first2, - S2 last2); // (1) C++20 + S2 last2); // (1) C++20 template @@ -24,17 +24,47 @@ namespace std::ranges { borrowed_iterator_t, borrowed_iterator_t> swap_ranges(R1&& r1, - R2&& r2); // (2) C++20 + R2&& r2); // (2) C++20 + + template S1, + random_access_iterator I2, + sized_sentinel_for S2> + requires indirectly_swappable + swap_ranges_result + swap_ranges(Ep&& exec, + I1 first1, + S1 last1, + I2 first2, + S2 last2); // (3) C++26 + + template + requires indirectly_swappable, iterator_t> + swap_ranges_result< + borrowed_iterator_t, + borrowed_iterator_t> + swap_ranges(Ep&& exec, + R1&& r1, + R2&& r2); // (4) C++26 } ``` * swap_ranges_result[link ranges_in_in_result.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 指定された2つの範囲同士を swap する。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 効果 @@ -63,6 +93,7 @@ swap_ranges_result { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -93,6 +124,41 @@ v1: 5,2,4, v2: 3,1,2,1,3, ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v1 = {1, 2, 3, 4, 5}; + std::vector v2 = {6, 7, 8, 9, 10}; + + // 並列に2つの範囲をswapする + std::ranges::swap_ranges(std::execution::par, v1, v2); + + std::cout << "v1: "; + for (int x : v1) { + std::cout << x << ' '; + } + std::cout << std::endl; + + std::cout << "v2: "; + for (int x : v2) { + std::cout << x << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::swap_ranges[color ff0000] + +#### 出力 +``` +v1: 6 7 8 9 10 +v2: 1 2 3 4 5 +``` + ## バージョン ### 言語 - C++20 @@ -105,3 +171,4 @@ v2: 3,1,2,1,3, ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_transform.md b/reference/algorithm/ranges_transform.md index 6650810acb..dabb5817b4 100644 --- a/reference/algorithm/ranges_transform.md +++ b/reference/algorithm/ranges_transform.md @@ -80,6 +80,93 @@ namespace std::ranges { F binary_op, Proj1 proj1 = {}, Proj2 proj2 = {}); // (4) C++20 + + template S, + random_access_iterator O, + sized_sentinel_for OutS, + copy_constructible F, + class Proj = identity> + requires indirectly_writable< + O, + indirect_result_t> + > + unary_transform_result + transform(Ep&& exec, + I first1, + S last1, + O result, + OutS result_last, + F op, + Proj proj = {}); // (5) C++26 + + template + requires indirectly_writable< + iterator_t, + indirect_result_t, Proj>> + > + unary_transform_result, borrowed_iterator_t> + transform(Ep&& exec, + R&& r, + OutR&& result_r, + F op, + Proj proj = {}); // (6) C++26 + + template S1, + random_access_iterator I2, + sized_sentinel_for S2, + random_access_iterator O, + sized_sentinel_for OutS, + copy_constructible F, + class Proj1 = identity, + class Proj2 = identity> + requires indirectly_writable< + O, + indirect_result_t, projected> + > + binary_transform_result + transform(Ep&& exec, + I1 first1, + S1 last1, + I2 first2, + S2 last2, + O result, + OutS result_last, + F binary_op, + Proj1 proj1 = {}, + Proj2 proj2 = {}); // (7) C++26 + + template + requires indirectly_writable< + iterator_t, + indirect_result_t, Proj1>, + projected, Proj2>> + > + binary_transform_result< + borrowed_iterator_t, + borrowed_iterator_t, + borrowed_iterator_t + > + transform(Ep&& exec, + R1&& r1, + R2&& r2, + OutR&& result_r, + F binary_op, + Proj1 proj1 = {}, + Proj2 proj2 = {}); // (8) C++26 } ``` * weakly_incrementable[link /reference/iterator/weakly_incrementable.md] @@ -88,6 +175,10 @@ namespace std::ranges { * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] * unary_transform_result[link ranges_in_out_result.md] * binary_transform_result[link ranges_in_in_out_result.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 @@ -95,6 +186,8 @@ namespace std::ranges { - (1), (2): 1つの範囲の要素に関数を適用し、結果を出力イテレータに出力する - (3), (4): 2つの範囲の要素を1つずつ取り出して関数を適用し、結果を出力イテレータに出力する +- (5), (6): (1), (2)の並列アルゴリズム版。実行ポリシーを指定する +- (7), (8): (3), (4)の並列アルゴリズム版。実行ポリシーを指定する - (1), (3): イテレータ範囲を指定する - (2), (4): Rangeを直接指定する @@ -127,7 +220,8 @@ namespace std::ranges { - (3), (4) : `result` は `first1` や `first2` と同じであっても構わない。 -## (1)の例 +## 例 +### (1)の例 ```cpp example #include #include @@ -158,7 +252,7 @@ int main() { ``` -## (2)の例 +### (2)の例 ```cpp example #include #include @@ -188,6 +282,33 @@ b cccc ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 2, 3, 4, 5}; + std::vector result(v.size()); + + // 並列に全ての要素を2乗する + std::ranges::transform(std::execution::par, v, result, [](int x) { return x * x; }); + + for (int x : result) { + std::cout << x << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::transform[color ff0000] + +#### 出力 +``` +1 4 9 16 25 +``` + ## バージョン ### 言語 - C++20 @@ -200,6 +321,7 @@ cccc ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) ## 関連項目 diff --git a/reference/algorithm/ranges_unique.md b/reference/algorithm/ranges_unique.md index 31f6880e65..04d0306714 100644 --- a/reference/algorithm/ranges_unique.md +++ b/reference/algorithm/ranges_unique.md @@ -24,10 +24,38 @@ namespace std::ranges { unique(R&& r, C comp = {}, Proj proj = {}); // (2) C++20 + + template S, + class Proj = identity, + indirect_equivalence_relation> C = ranges::equal_to> + requires permutable + subrange + unique(Ep&& exec, + I first, + S last, + C comp = {}, + Proj proj = {}); // (3) C++26 + + template , Proj>> C = ranges::equal_to> + requires permutable> + borrowed_subrange_t + unique(Ep&& exec, + R&& r, + C comp = {}, + Proj proj = {}); // (4) C++26 } ``` * permutable[link /reference/iterator/permutable.md] * indirect_equivalence_relation[link /reference/iterator/indirect_equivalence_relation.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 @@ -35,6 +63,8 @@ namespace std::ranges { - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する この関数は、隣り合った重複要素を除いた要素を、範囲の先頭に集める。この関数によってコンテナから直接要素が削除され、コンテナの要素数が減るようなことはない。コンテナから実際に要素を削除する場合は、この関数の戻り値として、先頭に集められた重複なし範囲の末尾の次を指すイテレータが返るため、そのイテレータを介してコンテナの`erase()`メンバ関数などを呼び出し、削除を行うこと。 @@ -59,6 +89,7 @@ namespace std::ranges { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -118,6 +149,34 @@ unsorted unique : 2,5,3,1,2,4,2,1,4,3 sorted unique : 1,2,3,4,5 ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector v = {1, 1, 2, 3, 3, 3, 4, 4, 5}; + + // 並列に隣り合った重複要素を除去する + auto result = std::ranges::unique(std::execution::par, v); + v.erase(result.begin(), result.end()); + + for (int x : v) { + std::cout << x << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::unique[color ff0000] +* v.erase[link /reference/vector/vector/erase.md] + +#### 出力 +``` +1 2 3 4 5 +``` + ## バージョン ### 言語 - C++20 @@ -130,3 +189,4 @@ sorted unique : 1,2,3,4,5 ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/algorithm/ranges_unique_copy.md b/reference/algorithm/ranges_unique_copy.md index eb7d537938..30c2fbe5e4 100644 --- a/reference/algorithm/ranges_unique_copy.md +++ b/reference/algorithm/ranges_unique_copy.md @@ -37,6 +37,36 @@ namespace std::ranges { O result, C comp = {}, Proj proj = {}); // (2) C++20 + + template S, + random_access_iterator O, + sized_sentinel_for OutS, + class Proj = identity, + indirect_equivalence_relation> C = ranges::equal_to> + requires indirectly_copyable + unique_copy_result + unique_copy(Ep&& exec, + I first, + S last, + O result, + OutS result_last, + C comp = {}, + Proj proj = {}); // (3) C++26 + + template , Proj>> C = ranges::equal_to> + requires indirectly_copyable, iterator_t> + unique_copy_result, borrowed_iterator_t> + unique_copy(Ep&& exec, + R&& r, + OutR&& result_r, + C comp = {}, + Proj proj = {}); // (4) C++26 } ``` * weakly_incrementable[link /reference/iterator/weakly_incrementable.md] @@ -45,12 +75,18 @@ namespace std::ranges { * indirectly_copyable_storable[link /reference/iterator/indirectly_copyable_storable.md] * unique_copy_result[link ranges_in_out_result.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 隣り合った重複要素を取り除き、その結果を出力の範囲へコピーする。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## 事前条件 - `[first,last)` と `[result,result + (last - first))` は重なっていてはならない @@ -73,6 +109,7 @@ namespace std::ranges { ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -129,6 +166,33 @@ unsorted unique : 2,5,3,1,2,4,2,1,4,3 sorted unique : 1,2,3,4,5 ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector src = {1, 1, 2, 3, 3, 3, 4, 4, 5}; + std::vector dst(src.size()); + + // 並列に隣り合った重複要素を除去してコピーする + auto result = std::ranges::unique_copy(std::execution::par, src, dst); + + for (auto it = dst.begin(); it != result.out; ++it) { + std::cout << *it << ' '; + } + std::cout << std::endl; +} +``` +* std::ranges::unique_copy[color ff0000] + +#### 出力 +``` +1 2 3 4 5 +``` + ## バージョン ### 言語 - C++20 @@ -141,3 +205,4 @@ sorted unique : 1,2,3,4,5 ## 参照 - [N4861 25 Algorithms library](https://timsong-cpp.github.io/cppwp/n4861/algorithms) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/execution.md b/reference/execution.md index c4fe506ba3..c0434ef1dd 100644 --- a/reference/execution.md +++ b/reference/execution.md @@ -11,6 +11,7 @@ |------|------|----------------| | [`execution`](execution/execution.md) | 実行ポリシー用の名前空間 (namespace) | C++17 | | [`is_execution_policy`](execution/is_execution_policy.md) | 型が実行ポリシーかを判定する (class template) | C++17 | +| [`execution-policy`](execution/execution-policy.md) | 型が実行ポリシーであることを表す (説明専用concept) | C++26 | ## 実行制御ライブラリ(C++26) @@ -29,3 +30,4 @@ ## 参照 - [P0024R2 The Parallelism TS Should be Standardized](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0024r2.html) - [P2300R10 `std::execution`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/execution/execution-policy.md b/reference/execution/execution-policy.md new file mode 100644 index 0000000000..635cbc8f08 --- /dev/null +++ b/reference/execution/execution-policy.md @@ -0,0 +1,31 @@ +# execution-policy +* execution[meta header] +* concept[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std { + template + concept execution-policy = is_execution_policy_v>; +} +``` +* is_execution_policy_v[link is_execution_policy.md] +* remove_cvref_t[link /reference/type_traits/remove_cvref.md] + +## 概要 +`execution-policy`は、型`T`が実行ポリシー型であることを表す説明専用のコンセプトである。 + +このコンセプトは、並列Rangeアルゴリズムのテンプレートパラメータ制約として使用される。 + +このコンセプトに合致する型は、以下のページを参照: + +- [実行ポリシー](execution/execution_policy.md) + + +## バージョン +### 言語 +- C++26 + +## 参照 +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/memory/ranges_destroy.md b/reference/memory/ranges_destroy.md index 075fcc299c..19d0f925d5 100644 --- a/reference/memory/ranges_destroy.md +++ b/reference/memory/ranges_destroy.md @@ -13,6 +13,17 @@ namespace std::ranges { template requires destructible> constexpr borrowed_iterator_t destroy(R&& r) noexcept; // (2) C++20 + + template S> + requires destructible> + I destroy(Ep&& exec, I first, S last) noexcept; // (3) C++26 + + template + requires destructible> + borrowed_iterator_t destroy(Ep&& exec, R&& r) noexcept; // (4) C++26 } ``` * no-throw-input-iterator[link no-throw-input-iterator.md] @@ -20,6 +31,10 @@ namespace std::ranges { * destructible[link /reference/concepts/destructible.md] * no-throw-input-range[link no-throw-input-range.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 デストラクタを呼び出す。 @@ -28,6 +43,8 @@ namespace std::ranges { - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## テンプレートパラメータ制約 @@ -52,6 +69,7 @@ return first; ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -94,6 +112,35 @@ int main() 0 ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::allocator alloc; + std::string* p = alloc.allocate(3); + + for (int i = 0; i < 3; ++i) { + std::construct_at(p + i, "hello"); + } + + // 並列に破棄 + std::ranges::destroy(std::execution::par, p, p + 3); + + alloc.deallocate(p, 3); + std::cout << "done" << std::endl; +} +``` +* std::ranges::destroy[color ff0000] + +#### 出力 +``` +done +``` + ## バージョン ### 言語 - C++20 @@ -109,3 +156,4 @@ int main() ## 参照 - [P0896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/memory/ranges_destroy_n.md b/reference/memory/ranges_destroy_n.md index 258acf0e1d..3d6da8eae2 100644 --- a/reference/memory/ranges_destroy_n.md +++ b/reference/memory/ranges_destroy_n.md @@ -9,16 +9,26 @@ namespace std::ranges { template requires destructible> constexpr I destroy_n(I first, iter_difference_t n) noexcept; // (1) C++20 + + template + requires destructible> + I destroy_n(Ep&& exec, I first, iter_difference_t n) noexcept; // (2) C++26 } ``` * no-throw-input-iterator[link no-throw-input-iterator.md] * destructible[link /reference/concepts/destructible.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] ## 概要 イテレータ範囲`[first, first + n)`の各要素に対してデストラクタを呼び出す。 この関数は、配置`new`で構築したオブジェクトを破棄するために使用する。 +- (1): イテレータ範囲を指定する +- (2): (1)の並列アルゴリズム版。実行ポリシーを指定する + ## テンプレートパラメータ制約 - (1): @@ -38,6 +48,7 @@ return destroy(counted_iterator(first, n), default_sentinel).base(); ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -80,6 +91,35 @@ int main() 0 ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::allocator alloc; + std::string* p = alloc.allocate(3); + + for (int i = 0; i < 3; ++i) { + std::construct_at(p + i, "hello"); + } + + // 並列にn個破棄 + std::ranges::destroy_n(std::execution::par, p, 3); + + alloc.deallocate(p, 3); + std::cout << "done" << std::endl; +} +``` +* std::ranges::destroy_n[color ff0000] + +#### 出力 +``` +done +``` + ## バージョン ### 言語 - C++20 @@ -95,3 +135,4 @@ int main() ## 参照 - [P0896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/memory/ranges_uninitialized_copy.md b/reference/memory/ranges_uninitialized_copy.md index 7e76fade95..35100d93d1 100644 --- a/reference/memory/ranges_uninitialized_copy.md +++ b/reference/memory/ranges_uninitialized_copy.md @@ -42,6 +42,29 @@ namespace std::ranges { > uninitialized_copy(IR&& in_range, OR&& out_range); // (2) C++26 + + template S1, + random_access_iterator O, sized_sentinel_for S2> + requires constructible_from, iter_reference_t> + uninitialized_copy_result + uninitialized_copy(Ep&& exec, + I ifirst, + S1 ilast, + O ofirst, + S2 olast); // (3) C++26 + + template + requires constructible_from, range_reference_t> + uninitialized_copy_result< + borrowed_iterator_t, + borrowed_iterator_t + > + uninitialized_copy(Ep&& exec, + IR&& in_range, + OR&& out_range); // (4) C++26 } ``` * in_out_result[link /reference/algorithm/ranges_in_out_result.md] @@ -51,12 +74,18 @@ namespace std::ranges { * iter_reference_t[link /reference/iterator/iter_reference_t.md] * no-throw-forward-range[link no-throw-forward-range.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 -未初期化領域のイテレータ範囲(`out_range`、`[ofirst, olast)`)を配置`new`で入力イテレータ範囲(`in_range`、`[ifirst, ilast)`)の対応する要素から初期化してムーブ出力する。 +未初期化領域のイテレータ範囲(`out_range`、`[ofirst, olast)`)を配置`new`で入力イテレータ範囲(`in_range`、`[ifirst, ilast)`)の対応する要素から初期化してコピー出力する。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## テンプレートパラメータ制約 @@ -105,6 +134,7 @@ return {std::move(ifirst), ofirst}; ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -152,6 +182,39 @@ int main() ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector src = {1, 2, 3}; + std::allocator alloc; + int* dst = alloc.allocate(3); + + // 並列に未初期化領域へコピー + std::ranges::uninitialized_copy( + std::execution::par, src, dst, dst + 3); + + for (int i = 0; i < 3; ++i) { + std::cout << dst[i] << ' '; + } + std::cout << std::endl; + + std::ranges::destroy(dst, dst + 3); + alloc.deallocate(dst, 3); +} +``` +* std::ranges::uninitialized_copy[color ff0000] + +#### 出力 +``` +1 2 3 +``` + + ## バージョン ### 言語 - C++20 @@ -169,3 +232,4 @@ int main() - [P0896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) - [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) - C++26から`constexpr`がついた +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/memory/ranges_uninitialized_copy_n.md b/reference/memory/ranges_uninitialized_copy_n.md index fb409e56e4..52380f451e 100644 --- a/reference/memory/ranges_uninitialized_copy_n.md +++ b/reference/memory/ranges_uninitialized_copy_n.md @@ -31,6 +31,20 @@ namespace std::ranges { O ofirst, S olast ); // (1) C++26 + + template S> + requires constructible_from, iter_reference_t> + uninitialized_copy_n_result + uninitialized_copy_n( + Ep&& exec, + I ifirst, + iter_difference_t n, + O ofirst, + S olast + ); // (2) C++26 } ``` * in_out_result[link /reference/algorithm/ranges_in_out_result.md] @@ -38,11 +52,15 @@ namespace std::ranges { * no-throw-sentinel[link no-throw-sentinel.md] * constructible_from[link /reference/concepts/constructible_from.md] * iter_reference_t[link /reference/iterator/iter_reference_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] ## 概要 未初期化領域のイテレータ範囲`[ofirst, ofirst + n)`を配置`new`でイテレータ範囲`[ifirst, ifirst + n)`の対応する要素から初期化してコピー出力する。 - (1): イテレータ範囲を指定する +- (2): (1)の並列アルゴリズム版。実行ポリシーを指定する ## テンプレートパラメータ制約 @@ -77,6 +95,7 @@ return {std::move(t.in).base(), t.out}; ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -123,6 +142,39 @@ int main() ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include + +int main() { + std::vector src = {1, 2, 3, 4, 5}; + std::allocator alloc; + int* dst = alloc.allocate(3); + + // 並列に3要素を未初期化領域へコピー + std::ranges::uninitialized_copy_n( + std::execution::par, src.begin(), 3, dst, dst + 3); + + for (int i = 0; i < 3; ++i) { + std::cout << dst[i] << ' '; + } + std::cout << std::endl; + + std::ranges::destroy(dst, dst + 3); + alloc.deallocate(dst, 3); +} +``` +* std::ranges::uninitialized_copy_n[color ff0000] + +#### 出力 +``` +1 2 3 +``` + + ## バージョン ### 言語 - C++20 @@ -140,3 +192,4 @@ int main() - [P0896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) - [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) - C++26から`constexpr`がついた +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/memory/ranges_uninitialized_default_construct.md b/reference/memory/ranges_uninitialized_default_construct.md index 32812ee0c1..9e0669a5e5 100644 --- a/reference/memory/ranges_uninitialized_default_construct.md +++ b/reference/memory/ranges_uninitialized_default_construct.md @@ -23,18 +23,38 @@ namespace std::ranges { requires default_initializable> constexpr borrowed_iterator_t uninitialized_default_construct(R&& r); // (2) C++26 + + template S> + requires default_initializable> + I + uninitialized_default_construct(Ep&& exec, + I first, S last); // (3) C++26 + + template + requires default_initializable> + borrowed_iterator_t + uninitialized_default_construct(Ep&& exec, R&& r); // (4) C++26 } ``` * no-throw-forward-iterator[link no-throw-forward-iterator.md] * no-throw-sentinel[link no-throw-sentinel.md] * no-throw-forward-range[link no-throw-forward-range.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 未初期化領域の範囲 (`r`、`[first, last)`) の各要素をデフォルト構築する。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## テンプレートパラメータ制約 @@ -77,6 +97,7 @@ return first; ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -124,6 +145,32 @@ int main() ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include + +int main() { + std::allocator alloc; + int* p = alloc.allocate(3); + + // 並列にデフォルト構築 + std::ranges::uninitialized_default_construct( + std::execution::par, p, p + 3); + + alloc.deallocate(p, 3); + std::cout << "done" << std::endl; +} +``` +* std::ranges::uninitialized_default_construct[color ff0000] + +#### 出力 +``` +done +``` + + ## バージョン ### 言語 - C++20 @@ -142,3 +189,4 @@ int main() - [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) - [P3369R0 `constexpr` for `uninitialized_default_construct`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3369r0.html) - 上記2文書で、C++26から`constexpr`がついた +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/memory/ranges_uninitialized_default_construct_n.md b/reference/memory/ranges_uninitialized_default_construct_n.md index 6e9cd283b4..f9ff6fdbc2 100644 --- a/reference/memory/ranges_uninitialized_default_construct_n.md +++ b/reference/memory/ranges_uninitialized_default_construct_n.md @@ -16,13 +16,26 @@ namespace std::ranges { constexpr I uninitialized_default_construct_n(I first, iter_difference_t n); // (1) C++26 + + template + requires default_initializable> + I + uninitialized_default_construct_n(Ep&& exec, + I first, + iter_difference_t n); // (2) C++26 } ``` * no-throw-forward-iterator[link no-throw-forward-iterator.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] ## 概要 未初期化領域の範囲 (`[first, first + n)`) の各要素をデフォルト構築する。 +- (1): イテレータ範囲を指定する +- (2): (1)の並列アルゴリズム版。実行ポリシーを指定する + ## テンプレートパラメータ制約 - (1): @@ -46,6 +59,7 @@ return uninitialized_default_construct(counted_iterator(first, n), 呼び出すコンストラクタなどから例外が送出された場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外が送出された場合は初期化対象領域は未初期化のままとなる。 ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -92,6 +106,32 @@ int main() ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include + +int main() { + std::allocator alloc; + int* p = alloc.allocate(3); + + // 並列にn個デフォルト構築 + std::ranges::uninitialized_default_construct_n( + std::execution::par, p, 3); + + alloc.deallocate(p, 3); + std::cout << "done" << std::endl; +} +``` +* std::ranges::uninitialized_default_construct_n[color ff0000] + +#### 出力 +``` +done +``` + + ## バージョン ### 言語 - C++20 @@ -110,3 +150,4 @@ int main() - [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) - [P3369R0 `constexpr` for `uninitialized_default_construct`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3369r0.html) - 上記2文書で、C++26から`constexpr`がついた +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/memory/ranges_uninitialized_fill.md b/reference/memory/ranges_uninitialized_fill.md index 735aa3dfac..4e2cd51e12 100644 --- a/reference/memory/ranges_uninitialized_fill.md +++ b/reference/memory/ranges_uninitialized_fill.md @@ -15,7 +15,8 @@ namespace std::ranges { no-throw-sentinel S, class T> requires constructible_from, const T&> - I uninitialized_fill(I first, S last, const T& x); // (1) C++26 + constexpr I + uninitialized_fill(I first, S last, const T& x); // (1) C++26 template @@ -27,6 +28,22 @@ namespace std::ranges { requires constructible_from, const T&> constexpr borrowed_iterator_t uninitialized_fill(R&& r, const T& x); // (2) C++26 + + template S, + class T> + requires constructible_from, const T&> + I uninitialized_fill(Ep&& exec, + I first, S last, const T& x); // (3) C++26 + + template + requires constructible_from, const T&> + borrowed_iterator_t + uninitialized_fill(Ep&& exec, + R&& r, const T& x); // (4) C++26 } ``` * no-throw-forward-iterator[link no-throw-forward-iterator.md] @@ -34,12 +51,18 @@ namespace std::ranges { * constructible_from[link /reference/concepts/constructible_from.md] * no-throw-forward-range[link no-throw-forward-range.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 未初期化領域の範囲 (`r`、`[first, last)`) を、指定された値で配置`new`で初期化する。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## テンプレートパラメータ制約 @@ -78,6 +101,7 @@ return first; 呼び出すコンストラクタなどから例外が送出された場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外が送出された場合は初期化対象領域は未初期化のままとなる。 ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -121,6 +145,36 @@ int main() ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include + +int main() { + std::allocator alloc; + int* p = alloc.allocate(3); + + // 並列に未初期化領域を42で埋める + std::ranges::uninitialized_fill( + std::execution::par, p, p + 3, 42); + + for (int i = 0; i < 3; ++i) { + std::cout << p[i] << ' '; + } + std::cout << std::endl; + + alloc.deallocate(p, 3); +} +``` +* std::ranges::uninitialized_fill[color ff0000] + +#### 出力 +``` +42 42 42 +``` + + ## バージョン ### 言語 - C++20 @@ -138,3 +192,4 @@ int main() - [P0896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) - [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) - C++26から`constexpr`がついた +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/memory/ranges_uninitialized_fill_n.md b/reference/memory/ranges_uninitialized_fill_n.md index 5c03777726..c90ee2a521 100644 --- a/reference/memory/ranges_uninitialized_fill_n.md +++ b/reference/memory/ranges_uninitialized_fill_n.md @@ -18,14 +18,28 @@ namespace std::ranges { uninitialized_fill_n(I first, iter_difference_t n, const T& x); // (1) C++26 + + template + requires constructible_from, const T&> + I + uninitialized_fill_n(Ep&& exec, + I first, + iter_difference_t n, + const T& x); // (2) C++26 } ``` * no-throw-forward-iterator[link no-throw-forward-iterator.md] * constructible_from[link /reference/concepts/constructible_from.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] ## 概要 未初期化領域の範囲 (`[first, first + n)`) を、指定された値で配置`new`で初期化する。 +- (1): イテレータ範囲を指定する +- (2): (1)の並列アルゴリズム版。実行ポリシーを指定する + ## テンプレートパラメータ制約 - (1): @@ -48,6 +62,7 @@ return uninitialized_fill(counted_iterator(first, n), default_sentinel, x).base( 呼び出すコンストラクタなどから例外が送出された場合、その例外がこの関数の外側に伝播される前に、その時点で構築済のオブジェクトは全て未規定の順序で破棄される。すなわち、例外が送出された場合は初期化対象領域は未初期化のままとなる。 ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -90,6 +105,36 @@ int main() ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include + +int main() { + std::allocator alloc; + int* p = alloc.allocate(3); + + // 並列にn個の未初期化領域を99で埋める + std::ranges::uninitialized_fill_n( + std::execution::par, p, 3, 99); + + for (int i = 0; i < 3; ++i) { + std::cout << p[i] << ' '; + } + std::cout << std::endl; + + alloc.deallocate(p, 3); +} +``` +* std::ranges::uninitialized_fill_n[color ff0000] + +#### 出力 +``` +99 99 99 +``` + + ## バージョン ### 言語 - C++20 @@ -107,3 +152,4 @@ int main() - [P0896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) - [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) - C++26から`constexpr`がついた +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/memory/ranges_uninitialized_move.md b/reference/memory/ranges_uninitialized_move.md index 2fca1ad0fe..2faf9699d7 100644 --- a/reference/memory/ranges_uninitialized_move.md +++ b/reference/memory/ranges_uninitialized_move.md @@ -34,6 +34,26 @@ namespace std::ranges { borrowed_iterator_t > uninitialized_move(IR&& in_range, OR&& out_range); // (2) C++26 + + template S1, + random_access_iterator O, sized_sentinel_for S2> + requires constructible_from, iter_rvalue_reference_t> + uninitialized_move_result + uninitialized_move(Ep&& exec, + I ifirst, S1 ilast, + O ofirst, S2 olast); // (3) C++26 + + template + requires constructible_from, range_rvalue_reference_t> + uninitialized_move_result< + borrowed_iterator_t, + borrowed_iterator_t + > + uninitialized_move(Ep&& exec, + IR&& in_range, OR&& out_range); // (4) C++26 } ``` * in_out_result[link /reference/algorithm/ranges_in_out_result.md] @@ -42,12 +62,18 @@ namespace std::ranges { * constructible_from[link /reference/concepts/constructible_from.md] * no-throw-forward-range[link no-throw-forward-range.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 未初期化領域の範囲(`out_range`、`[ofirst, olast)`)を配置`new`で入力範囲(`in_range`、`[ifirst, ilast)`)の対応する要素から初期化してムーブ出力する。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## テンプレートパラメータ制約 @@ -97,6 +123,7 @@ return {std::move(ifirst), ofirst}; またその場合、`[ifirst, ilast)`内の一部のオブジェクトは有効だが未規定な状態として残される。 ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -144,6 +171,40 @@ int main() ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include +#include + +int main() { + std::vector src = {"hello", "world", "test"}; + std::allocator alloc; + std::string* dst = alloc.allocate(3); + + // 並列に未初期化領域へムーブ + std::ranges::uninitialized_move( + std::execution::par, src, dst, dst + 3); + + for (int i = 0; i < 3; ++i) { + std::cout << dst[i] << ' '; + } + std::cout << std::endl; + + std::ranges::destroy(dst, dst + 3); + alloc.deallocate(dst, 3); +} +``` +* std::ranges::uninitialized_move[color ff0000] + +#### 出力 +``` +hello world test +``` + + ## バージョン ### 言語 - C++20 @@ -161,3 +222,4 @@ int main() - [P0896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) - [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) - C++26から`constexpr`がついた +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/memory/ranges_uninitialized_move_n.md b/reference/memory/ranges_uninitialized_move_n.md index 044b99e9f7..945884f492 100644 --- a/reference/memory/ranges_uninitialized_move_n.md +++ b/reference/memory/ranges_uninitialized_move_n.md @@ -31,17 +31,35 @@ namespace std::ranges { O ofirst, S olast ); // (1) C++26 + + template S> + requires constructible_from, iter_rvalue_reference_t> + uninitialized_move_n_result + uninitialized_move_n( + Ep&& exec, + I ifirst, + iter_difference_t n, + O ofirst, + S olast + ); // (2) C++26 } ``` * in_out_result[link /reference/algorithm/ranges_in_out_result.md] * no-throw-forward-iterator[link no-throw-forward-iterator.md] * no-throw-sentinel[link no-throw-sentinel.md] * constructible_from[link /reference/concepts/constructible_from.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] ## 概要 未初期化領域のイテレータ範囲`[ofirst, ofirst + n)`を配置`new`でイテレータ範囲`[ifirst, ifirst + n)`の対応する要素から初期化してムーブ出力する。 - (1): イテレータ範囲を指定する +- (2): (1)の並列アルゴリズム版。実行ポリシーを指定する ## テンプレートパラメータ制約 @@ -77,6 +95,7 @@ return {std::move(t.in).base(), t.out}; またその場合、`[ifirst, ifirst + n)`内の一部のオブジェクトは有効だが未規定な状態として残される。 ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -123,6 +142,40 @@ int main() ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include +#include +#include + +int main() { + std::vector src = {"hello", "world", "test"}; + std::allocator alloc; + std::string* dst = alloc.allocate(3); + + // 並列に3要素を未初期化領域へムーブ + std::ranges::uninitialized_move_n( + std::execution::par, src.begin(), 3, dst, dst + 3); + + for (int i = 0; i < 3; ++i) { + std::cout << dst[i] << ' '; + } + std::cout << std::endl; + + std::ranges::destroy(dst, dst + 3); + alloc.deallocate(dst, 3); +} +``` +* std::ranges::uninitialized_move_n[color ff0000] + +#### 出力 +``` +hello world test +``` + + ## バージョン ### 言語 - C++20 @@ -140,3 +193,4 @@ int main() - [P0896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) - [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) - C++26から`constexpr`がついた +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/memory/ranges_uninitialized_value_construct.md b/reference/memory/ranges_uninitialized_value_construct.md index 2e1d244235..587a6be874 100644 --- a/reference/memory/ranges_uninitialized_value_construct.md +++ b/reference/memory/ranges_uninitialized_value_construct.md @@ -23,18 +23,38 @@ namespace std::ranges { requires default_initializable> constexpr borrowed_iterator_t uninitialized_value_construct(R&& r); // (2) C++26 + + template S> + requires default_initializable> + I + uninitialized_value_construct(Ep&& exec, + I first, S last); // (3) C++26 + + template + requires default_initializable> + borrowed_iterator_t + uninitialized_value_construct(Ep&& exec, R&& r); // (4) C++26 } ``` * no-throw-forward-iterator[link no-throw-forward-iterator.md] * no-throw-sentinel[link no-throw-sentinel.md] * no-throw-forward-range[link no-throw-forward-range.md] * borrowed_iterator_t[link /reference/ranges/borrowed_iterator_t.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] +* sized_sentinel_for[link /reference/iterator/sized_sentinel_for.md] +* sized-random-access-range[link /reference/ranges/sized-random-access-range.md] ## 概要 未初期化領域の範囲 (`r`、`[first, last)`) の各要素を値構築する。 - (1): イテレータ範囲を指定する - (2): Rangeを直接指定する +- (3): (1)の並列アルゴリズム版。実行ポリシーを指定する +- (4): (2)の並列アルゴリズム版。実行ポリシーを指定する ## テンプレートパラメータ制約 @@ -73,6 +93,7 @@ return first; ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -120,6 +141,36 @@ int main() ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include + +int main() { + std::allocator alloc; + int* p = alloc.allocate(3); + + // 並列に値初期化 + std::ranges::uninitialized_value_construct( + std::execution::par, p, p + 3); + + for (int i = 0; i < 3; ++i) { + std::cout << p[i] << ' '; + } + std::cout << std::endl; + + alloc.deallocate(p, 3); +} +``` +* std::ranges::uninitialized_value_construct[color ff0000] + +#### 出力 +``` +0 0 0 +``` + + ## バージョン ### 言語 - C++20 @@ -137,3 +188,4 @@ int main() - [P0896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) - [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) - C++26から`constexpr`がついた +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/memory/ranges_uninitialized_value_construct_n.md b/reference/memory/ranges_uninitialized_value_construct_n.md index be08059256..03103a277b 100644 --- a/reference/memory/ranges_uninitialized_value_construct_n.md +++ b/reference/memory/ranges_uninitialized_value_construct_n.md @@ -16,13 +16,26 @@ namespace std::ranges { constexpr I uninitialized_value_construct_n(I first, iter_difference_t n); // (1) C++26 + + template + requires default_initializable> + I + uninitialized_value_construct_n(Ep&& exec, + I first, + iter_difference_t n); // (2) C++26 } ``` * no-throw-forward-iterator[link no-throw-forward-iterator.md] +* execution-policy[link /reference/execution/execution-policy.md] +* random_access_iterator[link /reference/iterator/random_access_iterator.md] ## 概要 未初期化領域の範囲 (`[first, first + n)`) の各要素を値構築する。 +- (1): イテレータ範囲を指定する +- (2): (1)の並列アルゴリズム版。実行ポリシーを指定する + ## テンプレートパラメータ制約 - (1): @@ -47,6 +60,7 @@ return uninitialized_value_construct(counted_iterator(first, n), ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -93,6 +107,36 @@ int main() ``` +### 並列アルゴリズムの例 (C++26) +```cpp example +#include +#include +#include + +int main() { + std::allocator alloc; + int* p = alloc.allocate(3); + + // 並列にn個値初期化 + std::ranges::uninitialized_value_construct_n( + std::execution::par, p, 3); + + for (int i = 0; i < 3; ++i) { + std::cout << p[i] << ' '; + } + std::cout << std::endl; + + alloc.deallocate(p, 3); +} +``` +* std::ranges::uninitialized_value_construct_n[color ff0000] + +#### 出力 +``` +0 0 0 +``` + + ## バージョン ### 言語 - C++20 @@ -110,3 +154,4 @@ int main() - [P0896R4 The One Ranges Proposal](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) - [P3508R0 Wording for "constexpr for specialized memory algorithms"](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3508r0.html) - C++26から`constexpr`がついた +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) diff --git a/reference/ranges.md b/reference/ranges.md index 6956f1b61c..395b20031a 100644 --- a/reference/ranges.md +++ b/reference/ranges.md @@ -91,6 +91,7 @@ C++20では関数によるカスタマイゼーションポイントの問題点 | [`common_range`](ranges/common_range.md) | イテレータと番兵の型が等しいRange (concept) | C++20 | | [`viewable_range`](ranges/viewable_range.md) | ビューに変換できるRange (concept) | C++20 | | [`constant_range`](ranges/constant_range.md) | 要素が定数なRange (concept) | C++23 | +| [`sized-random-access-range`](ranges/sized-random-access-range.md) | サイズ付きランダムアクセスRange (説明専用concept) | C++26 | ## カスタマイゼーションポイント diff --git a/reference/ranges/sized-random-access-range.md b/reference/ranges/sized-random-access-range.md new file mode 100644 index 0000000000..c6b5e78a65 --- /dev/null +++ b/reference/ranges/sized-random-access-range.md @@ -0,0 +1,27 @@ +# sized-random-access-range +* ranges[meta header] +* concept[meta id-type] +* std::ranges[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std::ranges { + template + concept sized-random-access-range = + random_access_range && sized_range; +} +``` +* random_access_range[link random_access_range.md] +* sized_range[link sized_range.md] + +## 概要 +`sized-random-access-range`は、範囲`R`が[`random_access_range`](random_access_range.md)かつ[`sized_range`](sized_range.md)であることを表す説明専用のコンセプトである。 + +このコンセプトは、並列Rangeアルゴリズムのテンプレートパラメータ制約として使用される。並列アルゴリズムでは、範囲のサイズが既知であり、かつランダムアクセスが可能である必要がある。 + +## バージョン +### 言語 +- C++26 + +## 参照 +- [P3179R9 C++ parallel range algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3179r9.html) From f38b7a017bab215aa8f6675bf5822873c6f149eb Mon Sep 17 00:00:00 2001 From: yoh Date: Sun, 8 Feb 2026 18:00:28 +0900 Subject: [PATCH 2605/3948] =?UTF-8?q?reference:=20meta=20exposition-only?= =?UTF-8?q?=E3=82=BF=E3=82=B0=E8=BF=BD=E5=8A=A0(#1558)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ハイフン(-)を含むファイル名列挙+人力フィルタ find reference -type f -regex ".*-.*" | xargs grep -L "meta exposition-only" --- reference/chrono/local-time-format-t.md | 1 + reference/execution/class-type.md | 1 + reference/execution/decays-to.md | 1 + reference/execution/execution-policy.md | 1 + reference/execution/execution/allocator-aware-forward.md | 1 + reference/execution/execution/association-t.md | 2 +- reference/execution/execution/basic-operation.md | 1 + reference/execution/execution/basic-receiver.md | 1 + reference/execution/execution/basic-sender.md | 2 +- reference/execution/execution/child-type.md | 1 + reference/execution/execution/completion-domain.md | 1 + .../execution/execution/counting_scope/start-join-sender.md | 1 + reference/execution/execution/counting_scope/try-associate.md | 2 +- reference/execution/execution/data-type.md | 1 + reference/execution/execution/decay-copyable-result-datums.md | 2 +- reference/execution/execution/decayed-tuple.md | 1 + reference/execution/execution/emplace-from.md | 1 + reference/execution/execution/env-promise.md | 1 + reference/execution/execution/gather-signatures.md | 1 + reference/execution/execution/get-domain-early.md | 1 + reference/execution/execution/get-domain-late.md | 1 + reference/execution/execution/impls-for.md | 1 + reference/execution/execution/make-sender.md | 2 +- reference/execution/execution/not-a-sender.md | 2 +- reference/execution/execution/on-stop-request.md | 1 + reference/execution/execution/overload-set.md | 1 + reference/execution/execution/product-type.md | 1 + reference/execution/execution/query-with-default.md | 1 + reference/execution/execution/run_loop/run-loop-opstate.md | 1 + reference/execution/execution/run_loop/run-loop-scheduler.md | 1 + reference/execution/execution/run_loop/run-loop-sender.md | 1 + reference/execution/execution/sender-for.md | 1 + reference/execution/execution/sender-in-of.md | 1 + .../execution/simple_counting_scope/start-join-sender.md | 1 + .../execution/execution/simple_counting_scope/try-associate.md | 2 +- reference/execution/execution/single-sender-value-type.md | 2 +- reference/execution/execution/single-sender.md | 1 + reference/execution/execution/stop-when.md | 2 +- reference/execution/execution/type-list.md | 1 + reference/execution/execution/unspecified-exception.md | 2 +- reference/execution/execution/variant-or-empty.md | 1 + reference/execution/execution/with-await-transform.md | 1 + reference/execution/forwarding-query.md | 1 + reference/execution/is-awaitable.md | 1 + reference/execution/movable-value.md | 1 + reference/execution/this_thread/sync-wait-env.md | 1 + reference/execution/this_thread/sync-wait-receiver.md | 1 + reference/exposition-only/container-compatible-range.md | 1 + reference/exposition-only/decay-copy.md | 1 + reference/exposition-only/synth-three-way-result.md | 1 + reference/format/const-formattable-range.md | 1 + reference/format/fmt-maybe-const.md | 1 + reference/format/range-default-formatter.md | 1 + reference/format/runtime-format-string.md | 1 + reference/functional/call-result-t.md | 1 + reference/functional/decayed-typeof.md | 1 + reference/functional/nothrow-callable.md | 1 + reference/iterator/constant-iterator.md | 1 + reference/linalg/abs-if-needed.md | 2 +- reference/linalg/compatible-static-extents.md | 1 + reference/linalg/conj-if-needed.md | 1 + reference/linalg/imag-if-needed.md | 2 +- reference/linalg/inout-matrix.md | 1 + reference/linalg/inout-object.md | 1 + reference/linalg/inout-vector.md | 1 + reference/linalg/is-mdspan.md | 1 + reference/linalg/layout_transpose/transpose-extents.md | 1 + reference/linalg/possibly-addable.md | 1 + reference/linalg/possibly-multipliable.md | 1 + reference/linalg/possibly-packed-inout-matrix.md | 1 + reference/linalg/real-if-needed.md | 2 +- reference/mdspan/de-ice.md | 1 + reference/mdspan/extents/index-cast.md | 1 + reference/mdspan/index-pair-like.md | 1 + reference/mdspan/is-layout-left-padded-mapping-of.md | 1 + reference/mdspan/is-layout-right-padded-mapping-of.md | 1 + reference/mdspan/is-mapping-of.md | 1 + reference/mdspan/layout_stride/mapping/layout-mapping-alike.md | 1 + reference/mdspan/src-indices.md | 1 + reference/memory/no-throw-forward-iterator.md | 1 + reference/memory/no-throw-forward-range.md | 1 + reference/memory/no-throw-input-iterator.md | 1 + reference/memory/no-throw-input-range.md | 1 + reference/memory/no-throw-sentinel.md | 1 + reference/ranges/all-bidirectional.md | 3 ++- reference/ranges/all-forward.md | 3 ++- reference/ranges/all-random-access.md | 3 ++- reference/ranges/as-lvalue.md | 1 + reference/ranges/different-from.md | 1 + reference/ranges/has-arrow.md | 1 + reference/ranges/maybe-const.md | 1 + reference/ranges/possibly-const-range.md | 1 + reference/ranges/range-with-movable-references.md | 1 + reference/ranges/simple-view.md | 1 + reference/ranges/sized-random-access-range.md | 1 + reference/ranges/subrange/convertible-to-non-slicing.md | 1 + reference/ranges/subrange/pair-like-convertible-from.md | 1 + .../subrange/uses-nonqualification-pointer-conversion.md | 1 + reference/ranges/tuple-for-each.md | 1 + reference/ranges/tuple-transform.md | 1 + reference/span/integral-constant-like.md | 1 + reference/span/maybe-static-ext.md | 1 + reference/stop_token/stoppable-source.md | 1 + reference/tuple/pair-like.md | 1 + reference/tuple/tuple-like.md | 1 + 105 files changed, 108 insertions(+), 16 deletions(-) diff --git a/reference/chrono/local-time-format-t.md b/reference/chrono/local-time-format-t.md index 6f49a0d7ad..94f08f356c 100644 --- a/reference/chrono/local-time-format-t.md +++ b/reference/chrono/local-time-format-t.md @@ -1,4 +1,5 @@ # local-time-format-t +* [meta exposition-only] * chrono[meta header] * std::chrono[meta namespace] * class[meta id-type] diff --git a/reference/execution/class-type.md b/reference/execution/class-type.md index 0793ba4f03..b3cb06e07b 100644 --- a/reference/execution/class-type.md +++ b/reference/execution/class-type.md @@ -1,4 +1,5 @@ # class-type +* [meta exposition-only] * execution[meta header] * concept[meta id-type] * std[meta namespace] diff --git a/reference/execution/decays-to.md b/reference/execution/decays-to.md index e0b208bdbd..05e9ef6714 100644 --- a/reference/execution/decays-to.md +++ b/reference/execution/decays-to.md @@ -1,4 +1,5 @@ # decays-to +* [meta exposition-only] * execution[meta header] * concept[meta id-type] * std[meta namespace] diff --git a/reference/execution/execution-policy.md b/reference/execution/execution-policy.md index 635cbc8f08..c85cb7e5bb 100644 --- a/reference/execution/execution-policy.md +++ b/reference/execution/execution-policy.md @@ -1,4 +1,5 @@ # execution-policy +* [meta exposition-only] * execution[meta header] * concept[meta id-type] * std[meta namespace] diff --git a/reference/execution/execution/allocator-aware-forward.md b/reference/execution/execution/allocator-aware-forward.md index 4637c1d7d2..7773fc1a10 100644 --- a/reference/execution/execution/allocator-aware-forward.md +++ b/reference/execution/execution/allocator-aware-forward.md @@ -1,4 +1,5 @@ # allocator-aware-forward +* [meta exposition-only] * execution[meta header] * function template[meta id-type] * std::execution[meta namespace] diff --git a/reference/execution/execution/association-t.md b/reference/execution/execution/association-t.md index f7becb8b28..a530bac42e 100644 --- a/reference/execution/execution/association-t.md +++ b/reference/execution/execution/association-t.md @@ -1,9 +1,9 @@ # association-t +* [meta exposition-only] * execution[meta header] * class template[meta id-type] * std::execution[meta namespace] * cpp26[meta cpp] -* [meta exposition-only] ```cpp template diff --git a/reference/execution/execution/basic-operation.md b/reference/execution/execution/basic-operation.md index 865e8143bf..0f7c1038ae 100644 --- a/reference/execution/execution/basic-operation.md +++ b/reference/execution/execution/basic-operation.md @@ -1,4 +1,5 @@ # basic-operation +* [meta exposition-only] * execution[meta header] * class template[meta id-type] * std::execution[meta namespace] diff --git a/reference/execution/execution/basic-receiver.md b/reference/execution/execution/basic-receiver.md index ceac2741d2..75181f9a51 100644 --- a/reference/execution/execution/basic-receiver.md +++ b/reference/execution/execution/basic-receiver.md @@ -1,4 +1,5 @@ # basic-receiver +* [meta exposition-only] * execution[meta header] * class template[meta id-type] * std::execution[meta namespace] diff --git a/reference/execution/execution/basic-sender.md b/reference/execution/execution/basic-sender.md index 040b32870e..247924c436 100644 --- a/reference/execution/execution/basic-sender.md +++ b/reference/execution/execution/basic-sender.md @@ -1,9 +1,9 @@ # basic-sender +* [meta exposition-only] * execution[meta header] * class template[meta id-type] * std::execution[meta namespace] * cpp26[meta cpp] -* [meta exposition-only] ```cpp namespace std::execution { diff --git a/reference/execution/execution/child-type.md b/reference/execution/execution/child-type.md index c876ab739b..3907b2d8c8 100644 --- a/reference/execution/execution/child-type.md +++ b/reference/execution/execution/child-type.md @@ -1,4 +1,5 @@ # child-type +* [meta exposition-only] * execution[meta header] * std::execution[meta namespace] * type-alias[meta id-type] diff --git a/reference/execution/execution/completion-domain.md b/reference/execution/execution/completion-domain.md index 2d83422caf..d0882c24eb 100644 --- a/reference/execution/execution/completion-domain.md +++ b/reference/execution/execution/completion-domain.md @@ -1,4 +1,5 @@ # completion-domain +* [meta exposition-only] * execution[meta header] * function template[meta id-type] * std::execution[meta namespace] diff --git a/reference/execution/execution/counting_scope/start-join-sender.md b/reference/execution/execution/counting_scope/start-join-sender.md index e011cf86c2..318420e842 100644 --- a/reference/execution/execution/counting_scope/start-join-sender.md +++ b/reference/execution/execution/counting_scope/start-join-sender.md @@ -1,4 +1,5 @@ # start-join-sender +* [meta exposition-only] * execution[meta header] * std::execution[meta namespace] * counting_scope[meta class] diff --git a/reference/execution/execution/counting_scope/try-associate.md b/reference/execution/execution/counting_scope/try-associate.md index e4cd788c47..c709d8df32 100644 --- a/reference/execution/execution/counting_scope/try-associate.md +++ b/reference/execution/execution/counting_scope/try-associate.md @@ -1,10 +1,10 @@ # try-associate +* [meta exposition-only] * execution[meta header] * std::execution[meta namespace] * counting_scope[meta class] * function[meta id-type] * cpp26[meta cpp] -* [meta exposition-only] ```cpp assoc-t try-associate() noexcept; // exposition only diff --git a/reference/execution/execution/data-type.md b/reference/execution/execution/data-type.md index 897641f984..d141f4e475 100644 --- a/reference/execution/execution/data-type.md +++ b/reference/execution/execution/data-type.md @@ -1,4 +1,5 @@ # data-type +* [meta exposition-only] * execution[meta header] * std::execution[meta namespace] * type-alias[meta id-type] diff --git a/reference/execution/execution/decay-copyable-result-datums.md b/reference/execution/execution/decay-copyable-result-datums.md index c87d03c94e..617fcbce5c 100644 --- a/reference/execution/execution/decay-copyable-result-datums.md +++ b/reference/execution/execution/decay-copyable-result-datums.md @@ -1,9 +1,9 @@ # decay-copyable-result-datums +* [meta exposition-only] * execution[meta header] * function template[meta id-type] * std::execution[meta namespace] * cpp26[meta cpp] -* [meta exposition-only] ```cpp constexpr void decay-copyable-result-datums(auto cs) { diff --git a/reference/execution/execution/decayed-tuple.md b/reference/execution/execution/decayed-tuple.md index bb71042659..ade063fb2e 100644 --- a/reference/execution/execution/decayed-tuple.md +++ b/reference/execution/execution/decayed-tuple.md @@ -1,4 +1,5 @@ # decayed-tuple +* [meta exposition-only] * execution[meta header] * std::execution[meta namespace] * type-alias[meta id-type] diff --git a/reference/execution/execution/emplace-from.md b/reference/execution/execution/emplace-from.md index b7eec63771..8fbe603ebf 100644 --- a/reference/execution/execution/emplace-from.md +++ b/reference/execution/execution/emplace-from.md @@ -1,4 +1,5 @@ # emplace-from +* [meta exposition-only] * execution[meta header] * std::execution[meta namespace] * class template[meta id-type] diff --git a/reference/execution/execution/env-promise.md b/reference/execution/execution/env-promise.md index dd745db64a..844786dcea 100644 --- a/reference/execution/execution/env-promise.md +++ b/reference/execution/execution/env-promise.md @@ -1,4 +1,5 @@ # env-promise +* [meta exposition-only] * execution[meta header] * class template[meta id-type] * std::execution[meta namespace] diff --git a/reference/execution/execution/gather-signatures.md b/reference/execution/execution/gather-signatures.md index 9d41f78b41..3dbee35898 100644 --- a/reference/execution/execution/gather-signatures.md +++ b/reference/execution/execution/gather-signatures.md @@ -1,4 +1,5 @@ # gather-signatures +* [meta exposition-only] * execution[meta header] * std::execution[meta namespace] * type-alias[meta id-type] diff --git a/reference/execution/execution/get-domain-early.md b/reference/execution/execution/get-domain-early.md index bdcfebfa0e..257327af61 100644 --- a/reference/execution/execution/get-domain-early.md +++ b/reference/execution/execution/get-domain-early.md @@ -1,4 +1,5 @@ # get-domain-early +* [meta exposition-only] * execution[meta header] * function template[meta id-type] * std::execution[meta namespace] diff --git a/reference/execution/execution/get-domain-late.md b/reference/execution/execution/get-domain-late.md index 20eb3fe6b5..5b54623859 100644 --- a/reference/execution/execution/get-domain-late.md +++ b/reference/execution/execution/get-domain-late.md @@ -1,4 +1,5 @@ # get-domain-late +* [meta exposition-only] * execution[meta header] * function template[meta id-type] * std::execution[meta namespace] diff --git a/reference/execution/execution/impls-for.md b/reference/execution/execution/impls-for.md index 33c705a1b2..5b10dbabb6 100644 --- a/reference/execution/execution/impls-for.md +++ b/reference/execution/execution/impls-for.md @@ -1,4 +1,5 @@ # impls-for +* [meta exposition-only] * execution[meta header] * class template[meta id-type] * std::execution[meta namespace] diff --git a/reference/execution/execution/make-sender.md b/reference/execution/execution/make-sender.md index bb95422340..f8e01ee94e 100644 --- a/reference/execution/execution/make-sender.md +++ b/reference/execution/execution/make-sender.md @@ -1,9 +1,9 @@ # make-sender +* [meta exposition-only] * execution[meta header] * function template[meta id-type] * std::execution[meta namespace] * cpp26[meta cpp] -* [meta exposition-only] ```cpp template diff --git a/reference/execution/execution/not-a-sender.md b/reference/execution/execution/not-a-sender.md index 49f06ffe66..4dd3284375 100644 --- a/reference/execution/execution/not-a-sender.md +++ b/reference/execution/execution/not-a-sender.md @@ -1,9 +1,9 @@ # not-a-sender +* [meta exposition-only] * execution[meta header] * class[meta id-type] * std::execution[meta namespace] * cpp26[meta cpp] -* [meta exposition-only] ```cpp struct not-a-sender { diff --git a/reference/execution/execution/on-stop-request.md b/reference/execution/execution/on-stop-request.md index 06ad7d68cb..c3a220a2d6 100644 --- a/reference/execution/execution/on-stop-request.md +++ b/reference/execution/execution/on-stop-request.md @@ -1,4 +1,5 @@ # on-stop-request +* [meta exposition-only] * execution[meta header] * class[meta id-type] * std::execution[meta namespace] diff --git a/reference/execution/execution/overload-set.md b/reference/execution/execution/overload-set.md index ae04ed5bd5..afcd1a45c0 100644 --- a/reference/execution/execution/overload-set.md +++ b/reference/execution/execution/overload-set.md @@ -1,4 +1,5 @@ # overload-set +* [meta exposition-only] * execution[meta header] * class template[meta id-type] * std::execution[meta namespace] diff --git a/reference/execution/execution/product-type.md b/reference/execution/execution/product-type.md index 741df2bbdd..4fa6bd3944 100644 --- a/reference/execution/execution/product-type.md +++ b/reference/execution/execution/product-type.md @@ -1,4 +1,5 @@ # product-type +* [meta exposition-only] * execution[meta header] * class template[meta id-type] * std::execution[meta namespace] diff --git a/reference/execution/execution/query-with-default.md b/reference/execution/execution/query-with-default.md index 8df81e402a..ce26e6a60b 100644 --- a/reference/execution/execution/query-with-default.md +++ b/reference/execution/execution/query-with-default.md @@ -1,4 +1,5 @@ # query-with-default +* [meta exposition-only] * execution[meta header] * function template[meta id-type] * std::execution[meta namespace] diff --git a/reference/execution/execution/run_loop/run-loop-opstate.md b/reference/execution/execution/run_loop/run-loop-opstate.md index 75a4389a17..8d5d921b63 100644 --- a/reference/execution/execution/run_loop/run-loop-opstate.md +++ b/reference/execution/execution/run_loop/run-loop-opstate.md @@ -1,4 +1,5 @@ # run-loop-opstate +* [meta exposition-only] * execution[meta header] * std::execution[meta namespace] * run_loop[meta class] diff --git a/reference/execution/execution/run_loop/run-loop-scheduler.md b/reference/execution/execution/run_loop/run-loop-scheduler.md index a1b154a041..25bbbf0169 100644 --- a/reference/execution/execution/run_loop/run-loop-scheduler.md +++ b/reference/execution/execution/run_loop/run-loop-scheduler.md @@ -1,4 +1,5 @@ # run-loop-scheduler +* [meta exposition-only] * execution[meta header] * std::execution[meta namespace] * run_loop[meta class] diff --git a/reference/execution/execution/run_loop/run-loop-sender.md b/reference/execution/execution/run_loop/run-loop-sender.md index 059a36fb99..c295aa5f8c 100644 --- a/reference/execution/execution/run_loop/run-loop-sender.md +++ b/reference/execution/execution/run_loop/run-loop-sender.md @@ -1,4 +1,5 @@ # run-loop-sender +* [meta exposition-only] * execution[meta header] * std::execution[meta namespace] * run_loop[meta class] diff --git a/reference/execution/execution/sender-for.md b/reference/execution/execution/sender-for.md index 1caf041e5d..04fde6ab15 100644 --- a/reference/execution/execution/sender-for.md +++ b/reference/execution/execution/sender-for.md @@ -1,4 +1,5 @@ # sender-for +* [meta exposition-only] * execution[meta header] * concept[meta id-type] * std::execution[meta namespace] diff --git a/reference/execution/execution/sender-in-of.md b/reference/execution/execution/sender-in-of.md index 72721a6a4b..51c3a8543a 100644 --- a/reference/execution/execution/sender-in-of.md +++ b/reference/execution/execution/sender-in-of.md @@ -1,4 +1,5 @@ # sender-in-of +* [meta exposition-only] * execution[meta header] * concept[meta id-type] * std::execution[meta namespace] diff --git a/reference/execution/execution/simple_counting_scope/start-join-sender.md b/reference/execution/execution/simple_counting_scope/start-join-sender.md index cf58d30d93..fc83c74a0b 100644 --- a/reference/execution/execution/simple_counting_scope/start-join-sender.md +++ b/reference/execution/execution/simple_counting_scope/start-join-sender.md @@ -1,4 +1,5 @@ # start-join-sender +* [meta exposition-only] * execution[meta header] * std::execution[meta namespace] * simple_counting_scope[meta class] diff --git a/reference/execution/execution/simple_counting_scope/try-associate.md b/reference/execution/execution/simple_counting_scope/try-associate.md index b7f2d7806a..eb2d8e16c3 100644 --- a/reference/execution/execution/simple_counting_scope/try-associate.md +++ b/reference/execution/execution/simple_counting_scope/try-associate.md @@ -1,10 +1,10 @@ # try-associate +* [meta exposition-only] * execution[meta header] * std::execution[meta namespace] * simple_counting_scope[meta class] * function[meta id-type] * cpp26[meta cpp] -* [meta exposition-only] ```cpp assoc-t try-associate() noexcept; // exposition only diff --git a/reference/execution/execution/single-sender-value-type.md b/reference/execution/execution/single-sender-value-type.md index 454ad9b16f..743a9e352c 100644 --- a/reference/execution/execution/single-sender-value-type.md +++ b/reference/execution/execution/single-sender-value-type.md @@ -1,9 +1,9 @@ # single-sender-value-type +* [meta exposition-only] * execution[meta header] * type-alias[meta id-type] * std::execution[meta namespace] * cpp26[meta cpp] -* [meta exposition-only] ```cpp template diff --git a/reference/execution/execution/single-sender.md b/reference/execution/execution/single-sender.md index ce983b79ee..d82ded1a73 100644 --- a/reference/execution/execution/single-sender.md +++ b/reference/execution/execution/single-sender.md @@ -1,4 +1,5 @@ # single-sender +* [meta exposition-only] * execution[meta header] * type-alias[meta id-type] * std::execution[meta namespace] diff --git a/reference/execution/execution/stop-when.md b/reference/execution/execution/stop-when.md index fbe73234f5..3c9d02629c 100644 --- a/reference/execution/execution/stop-when.md +++ b/reference/execution/execution/stop-when.md @@ -1,9 +1,9 @@ # stop-when +* [meta exposition-only] * execution[meta header] * cpo[meta id-type] * std::execution[meta namespace] * cpp26[meta cpp] -* [meta exposition-only] ```cpp namespace std::execution { diff --git a/reference/execution/execution/type-list.md b/reference/execution/execution/type-list.md index d54a46203b..fd69d8e600 100644 --- a/reference/execution/execution/type-list.md +++ b/reference/execution/execution/type-list.md @@ -1,4 +1,5 @@ # type-list +* [meta exposition-only] * execution[meta header] * class template[meta id-type] * std::execution[meta namespace] diff --git a/reference/execution/execution/unspecified-exception.md b/reference/execution/execution/unspecified-exception.md index 23972caff8..9a19f6c4e7 100644 --- a/reference/execution/execution/unspecified-exception.md +++ b/reference/execution/execution/unspecified-exception.md @@ -1,9 +1,9 @@ # unspecified-exception +* [meta exposition-only] * execution[meta header] * class[meta id-type] * std::execution[meta namespace] * cpp26[meta cpp] -* [meta exposition-only] ```cpp class unspecified-exception; diff --git a/reference/execution/execution/variant-or-empty.md b/reference/execution/execution/variant-or-empty.md index e77014c3fe..59ae5a7391 100644 --- a/reference/execution/execution/variant-or-empty.md +++ b/reference/execution/execution/variant-or-empty.md @@ -1,4 +1,5 @@ # variant-or-empty +* [meta exposition-only] * execution[meta header] * std::execution[meta namespace] * type-alias[meta id-type] diff --git a/reference/execution/execution/with-await-transform.md b/reference/execution/execution/with-await-transform.md index 39fbfe4967..70160141c0 100644 --- a/reference/execution/execution/with-await-transform.md +++ b/reference/execution/execution/with-await-transform.md @@ -1,4 +1,5 @@ # with-await-transform +* [meta exposition-only] * execution[meta header] * class template[meta id-type] * std::execution[meta namespace] diff --git a/reference/execution/forwarding-query.md b/reference/execution/forwarding-query.md index bc1f240df5..96c3649f6b 100644 --- a/reference/execution/forwarding-query.md +++ b/reference/execution/forwarding-query.md @@ -1,4 +1,5 @@ # forwarding-query +* [meta exposition-only] * execution[meta header] * concept[meta id-type] * std[meta namespace] diff --git a/reference/execution/is-awaitable.md b/reference/execution/is-awaitable.md index 0db175a0b2..f9d6ccf553 100644 --- a/reference/execution/is-awaitable.md +++ b/reference/execution/is-awaitable.md @@ -1,4 +1,5 @@ # is-awaitable +* [meta exposition-only] * execution[meta header] * concept[meta id-type] * std[meta namespace] diff --git a/reference/execution/movable-value.md b/reference/execution/movable-value.md index df9ad05345..fcda43c252 100644 --- a/reference/execution/movable-value.md +++ b/reference/execution/movable-value.md @@ -1,4 +1,5 @@ # movable-value +* [meta exposition-only] * execution[meta header] * concept[meta id-type] * std[meta namespace] diff --git a/reference/execution/this_thread/sync-wait-env.md b/reference/execution/this_thread/sync-wait-env.md index aa20456ceb..a5c950a89b 100644 --- a/reference/execution/this_thread/sync-wait-env.md +++ b/reference/execution/this_thread/sync-wait-env.md @@ -1,4 +1,5 @@ # sync-wait-env +* [meta exposition-only] * execution[meta header] * class template[meta id-type] * std::this_thread[meta namespace] diff --git a/reference/execution/this_thread/sync-wait-receiver.md b/reference/execution/this_thread/sync-wait-receiver.md index baa38762d4..ce539eae40 100644 --- a/reference/execution/this_thread/sync-wait-receiver.md +++ b/reference/execution/this_thread/sync-wait-receiver.md @@ -1,4 +1,5 @@ # sync-wait-receiver +* [meta exposition-only] * execution[meta header] * class template[meta id-type] * std::this_thread[meta namespace] diff --git a/reference/exposition-only/container-compatible-range.md b/reference/exposition-only/container-compatible-range.md index c2bb8c14f7..3d3ac1186b 100644 --- a/reference/exposition-only/container-compatible-range.md +++ b/reference/exposition-only/container-compatible-range.md @@ -1,4 +1,5 @@ # container-compatible-range +* [meta exposition-only] * exposition-only[meta header] * concept[meta id-type] * cpp23[meta cpp] diff --git a/reference/exposition-only/decay-copy.md b/reference/exposition-only/decay-copy.md index d8993b53e7..b9dc21221b 100644 --- a/reference/exposition-only/decay-copy.md +++ b/reference/exposition-only/decay-copy.md @@ -1,4 +1,5 @@ # decay-copy +* [meta exposition-only] * exposition-only[meta header] * function[meta id-type] * cpp20[meta cpp] diff --git a/reference/exposition-only/synth-three-way-result.md b/reference/exposition-only/synth-three-way-result.md index efdedf3592..540bcc8a2f 100644 --- a/reference/exposition-only/synth-three-way-result.md +++ b/reference/exposition-only/synth-three-way-result.md @@ -1,4 +1,5 @@ # synth-three-way-result +* [meta exposition-only] * exposition-only[meta header] * function[meta id-type] * cpp20[meta cpp] diff --git a/reference/format/const-formattable-range.md b/reference/format/const-formattable-range.md index 48ab057c20..da4ceaf89b 100644 --- a/reference/format/const-formattable-range.md +++ b/reference/format/const-formattable-range.md @@ -1,4 +1,5 @@ # const-formattable-range +* [meta exposition-only] * format[meta header] * concept[meta id-type] * std[meta namespace] diff --git a/reference/format/fmt-maybe-const.md b/reference/format/fmt-maybe-const.md index 83bb3e20de..122d6ed446 100644 --- a/reference/format/fmt-maybe-const.md +++ b/reference/format/fmt-maybe-const.md @@ -1,4 +1,5 @@ # fmt-maybe-const +* [meta exposition-only] * format[meta header] * concept[meta id-type] * std[meta namespace] diff --git a/reference/format/range-default-formatter.md b/reference/format/range-default-formatter.md index 24ecc0f397..32abc6dc61 100644 --- a/reference/format/range-default-formatter.md +++ b/reference/format/range-default-formatter.md @@ -1,4 +1,5 @@ # range-default-formatter +* [meta exposition-only] * format[meta header] * class template[meta id-type] * std[meta namespace] diff --git a/reference/format/runtime-format-string.md b/reference/format/runtime-format-string.md index 6c15e789ba..5ae03569b1 100644 --- a/reference/format/runtime-format-string.md +++ b/reference/format/runtime-format-string.md @@ -1,4 +1,5 @@ # runtime-format-string +* [meta exposition-only] * format[meta header] * class[meta id-type] * std[meta namespace] diff --git a/reference/functional/call-result-t.md b/reference/functional/call-result-t.md index bccac00510..28bc345e88 100644 --- a/reference/functional/call-result-t.md +++ b/reference/functional/call-result-t.md @@ -1,4 +1,5 @@ # call-result-t +* [meta exposition-only] * functional[meta header] * type-alias[meta id-type] * std[meta namespace] diff --git a/reference/functional/decayed-typeof.md b/reference/functional/decayed-typeof.md index 6c243dc425..a919d32199 100644 --- a/reference/functional/decayed-typeof.md +++ b/reference/functional/decayed-typeof.md @@ -1,4 +1,5 @@ # decayed-typeof +* [meta exposition-only] * functional[meta header] * type-alias[meta id-type] * std[meta namespace] diff --git a/reference/functional/nothrow-callable.md b/reference/functional/nothrow-callable.md index 836c61e12b..2351cee764 100644 --- a/reference/functional/nothrow-callable.md +++ b/reference/functional/nothrow-callable.md @@ -1,4 +1,5 @@ # nothrow-callable +* [meta exposition-only] * functional[meta header] * concept[meta id-type] * std[meta namespace] diff --git a/reference/iterator/constant-iterator.md b/reference/iterator/constant-iterator.md index c0603449a1..7e35526a4c 100644 --- a/reference/iterator/constant-iterator.md +++ b/reference/iterator/constant-iterator.md @@ -1,4 +1,5 @@ # constant-iterator +* [meta exposition-only] * iterator[meta header] * std[meta namespace] * concept[meta id-type] diff --git a/reference/linalg/abs-if-needed.md b/reference/linalg/abs-if-needed.md index f753c87cce..5eb5819f26 100644 --- a/reference/linalg/abs-if-needed.md +++ b/reference/linalg/abs-if-needed.md @@ -1,5 +1,5 @@ # abs-if-needed - +* [meta exposition-only] * linalg[meta header] * function[meta id-type] * std::linalg[meta namespace] diff --git a/reference/linalg/compatible-static-extents.md b/reference/linalg/compatible-static-extents.md index 229c80665b..ef0f633d40 100644 --- a/reference/linalg/compatible-static-extents.md +++ b/reference/linalg/compatible-static-extents.md @@ -1,4 +1,5 @@ # compatible-static-extents +* [meta exposition-only] * linalg[meta header] * function template[meta id-type] * std::linalg[meta namespace] diff --git a/reference/linalg/conj-if-needed.md b/reference/linalg/conj-if-needed.md index ca2011d3d0..5b0874d8d4 100644 --- a/reference/linalg/conj-if-needed.md +++ b/reference/linalg/conj-if-needed.md @@ -1,4 +1,5 @@ # conj-if-needed +* [meta exposition-only] * linalg[meta header] * function[meta id-type] * std::linalg[meta namespace] diff --git a/reference/linalg/imag-if-needed.md b/reference/linalg/imag-if-needed.md index d147a6e190..d3337550d7 100644 --- a/reference/linalg/imag-if-needed.md +++ b/reference/linalg/imag-if-needed.md @@ -1,5 +1,5 @@ # imag-if-needed - +* [meta exposition-only] * linalg[meta header] * function[meta id-type] * std::linalg[meta namespace] diff --git a/reference/linalg/inout-matrix.md b/reference/linalg/inout-matrix.md index 3d3e8ab980..13ddac0949 100644 --- a/reference/linalg/inout-matrix.md +++ b/reference/linalg/inout-matrix.md @@ -1,4 +1,5 @@ # in-matrix, out-matrix, inout-matrix +* [meta exposition-only] * linalg[meta header] * concept[meta id-type] * cpp26[meta cpp] diff --git a/reference/linalg/inout-object.md b/reference/linalg/inout-object.md index 679d7daf70..fd649f9ac8 100644 --- a/reference/linalg/inout-object.md +++ b/reference/linalg/inout-object.md @@ -1,4 +1,5 @@ # in-object, out-object, inout-object +* [meta exposition-only] * linalg[meta header] * concept[meta id-type] * cpp26[meta cpp] diff --git a/reference/linalg/inout-vector.md b/reference/linalg/inout-vector.md index 17837f2170..ab4f5ca58b 100644 --- a/reference/linalg/inout-vector.md +++ b/reference/linalg/inout-vector.md @@ -1,4 +1,5 @@ # in-vector, out-vector, inout-vector +* [meta exposition-only] * linalg[meta header] * concept[meta id-type] * cpp26[meta cpp] diff --git a/reference/linalg/is-mdspan.md b/reference/linalg/is-mdspan.md index df437ebd9b..4201b7ab44 100644 --- a/reference/linalg/is-mdspan.md +++ b/reference/linalg/is-mdspan.md @@ -1,4 +1,5 @@ # is-mdspan +* [meta exposition-only] * linalg[meta header] * variable[meta id-type] * cpp26[meta cpp] diff --git a/reference/linalg/layout_transpose/transpose-extents.md b/reference/linalg/layout_transpose/transpose-extents.md index 0ce6db8706..794746724f 100644 --- a/reference/linalg/layout_transpose/transpose-extents.md +++ b/reference/linalg/layout_transpose/transpose-extents.md @@ -1,4 +1,5 @@ # transpose-extents +* [meta exposition-only] * linalg[meta header] * function template[meta id-type] * std::linalg[meta namespace] diff --git a/reference/linalg/possibly-addable.md b/reference/linalg/possibly-addable.md index eef28e3ad6..4fd3d3a6a7 100644 --- a/reference/linalg/possibly-addable.md +++ b/reference/linalg/possibly-addable.md @@ -1,4 +1,5 @@ # possibly-addable +* [meta exposition-only] * linalg[meta header] * function template[meta id-type] * std::linalg[meta namespace] diff --git a/reference/linalg/possibly-multipliable.md b/reference/linalg/possibly-multipliable.md index 824b1a69a3..cdbc3422d4 100644 --- a/reference/linalg/possibly-multipliable.md +++ b/reference/linalg/possibly-multipliable.md @@ -1,4 +1,5 @@ # possibly-multipliable +* [meta exposition-only] * [mathjax enable] * linalg[meta header] * function template[meta id-type] diff --git a/reference/linalg/possibly-packed-inout-matrix.md b/reference/linalg/possibly-packed-inout-matrix.md index df39fe9d17..e999838dfa 100644 --- a/reference/linalg/possibly-packed-inout-matrix.md +++ b/reference/linalg/possibly-packed-inout-matrix.md @@ -1,4 +1,5 @@ # possibly-packed-inout-matrix +* [meta exposition-only] * linalg[meta header] * concept[meta id-type] * cpp26[meta cpp] diff --git a/reference/linalg/real-if-needed.md b/reference/linalg/real-if-needed.md index dd396d8b52..91eecc4935 100644 --- a/reference/linalg/real-if-needed.md +++ b/reference/linalg/real-if-needed.md @@ -1,5 +1,5 @@ # real-if-needed - +* [meta exposition-only] * linalg[meta header] * function[meta id-type] * std::linalg[meta namespace] diff --git a/reference/mdspan/de-ice.md b/reference/mdspan/de-ice.md index 9d555cf63d..7c1c853552 100644 --- a/reference/mdspan/de-ice.md +++ b/reference/mdspan/de-ice.md @@ -1,4 +1,5 @@ # de-ice +* [meta exposition-only] * mdspan[meta header] * function template[meta id-type] * cpp26[meta cpp] diff --git a/reference/mdspan/extents/index-cast.md b/reference/mdspan/extents/index-cast.md index c343517666..7ae05cdba8 100644 --- a/reference/mdspan/extents/index-cast.md +++ b/reference/mdspan/extents/index-cast.md @@ -1,4 +1,5 @@ # index-cast +* [meta exposition-only] * mdspan[meta header] * function template[meta id-type] * std[meta namespace] diff --git a/reference/mdspan/index-pair-like.md b/reference/mdspan/index-pair-like.md index b055196da8..ea500844e3 100644 --- a/reference/mdspan/index-pair-like.md +++ b/reference/mdspan/index-pair-like.md @@ -1,4 +1,5 @@ # index-pair-like +* [meta exposition-only] * mdspan[meta header] * concept[meta id-type] * cpp26[meta cpp] diff --git a/reference/mdspan/is-layout-left-padded-mapping-of.md b/reference/mdspan/is-layout-left-padded-mapping-of.md index 1bd50f81e5..eca79f4b34 100644 --- a/reference/mdspan/is-layout-left-padded-mapping-of.md +++ b/reference/mdspan/is-layout-left-padded-mapping-of.md @@ -1,4 +1,5 @@ # is-layout-left-padded-mapping-of +* [meta exposition-only] * mdspan[meta header] * variable[meta id-type] * cpp26[meta cpp] diff --git a/reference/mdspan/is-layout-right-padded-mapping-of.md b/reference/mdspan/is-layout-right-padded-mapping-of.md index de8a0f38a0..9592644d4d 100644 --- a/reference/mdspan/is-layout-right-padded-mapping-of.md +++ b/reference/mdspan/is-layout-right-padded-mapping-of.md @@ -1,4 +1,5 @@ # is-layout-right-padded-mapping-of +* [meta exposition-only] * mdspan[meta header] * variable[meta id-type] * cpp26[meta cpp] diff --git a/reference/mdspan/is-mapping-of.md b/reference/mdspan/is-mapping-of.md index 546ed40336..76e58e6c56 100644 --- a/reference/mdspan/is-mapping-of.md +++ b/reference/mdspan/is-mapping-of.md @@ -1,4 +1,5 @@ # is-mapping-of +* [meta exposition-only] * mdspan[meta header] * variable[meta id-type] * cpp23[meta cpp] diff --git a/reference/mdspan/layout_stride/mapping/layout-mapping-alike.md b/reference/mdspan/layout_stride/mapping/layout-mapping-alike.md index 4a6db282ea..d929675df5 100644 --- a/reference/mdspan/layout_stride/mapping/layout-mapping-alike.md +++ b/reference/mdspan/layout_stride/mapping/layout-mapping-alike.md @@ -1,4 +1,5 @@ # layout-mapping-alike +* [meta exposition-only] * mdspan[meta header] * concept[meta id-type] * std[meta namespace] diff --git a/reference/mdspan/src-indices.md b/reference/mdspan/src-indices.md index 55ace153e2..6e223978d8 100644 --- a/reference/mdspan/src-indices.md +++ b/reference/mdspan/src-indices.md @@ -1,4 +1,5 @@ # src-indices +* [meta exposition-only] * mdspan[meta header] * function template[meta id-type] * cpp26[meta cpp] diff --git a/reference/memory/no-throw-forward-iterator.md b/reference/memory/no-throw-forward-iterator.md index 6ed8ad4de1..23c3e147a3 100644 --- a/reference/memory/no-throw-forward-iterator.md +++ b/reference/memory/no-throw-forward-iterator.md @@ -1,4 +1,5 @@ # no-throw-forward-iterator +* [meta exposition-only] * memory[meta header] * std[meta namespace] * concept[meta id-type] diff --git a/reference/memory/no-throw-forward-range.md b/reference/memory/no-throw-forward-range.md index 8b49d76c3e..1d2303eccd 100644 --- a/reference/memory/no-throw-forward-range.md +++ b/reference/memory/no-throw-forward-range.md @@ -1,4 +1,5 @@ # no-throw-forward-range +* [meta exposition-only] * memory[meta header] * std[meta namespace] * concept[meta id-type] diff --git a/reference/memory/no-throw-input-iterator.md b/reference/memory/no-throw-input-iterator.md index 07f605762a..cb4d2f8b3f 100644 --- a/reference/memory/no-throw-input-iterator.md +++ b/reference/memory/no-throw-input-iterator.md @@ -1,4 +1,5 @@ # no-throw-input-iterator +* [meta exposition-only] * memory[meta header] * std[meta namespace] * concept[meta id-type] diff --git a/reference/memory/no-throw-input-range.md b/reference/memory/no-throw-input-range.md index 268284b226..fa6e0e476f 100644 --- a/reference/memory/no-throw-input-range.md +++ b/reference/memory/no-throw-input-range.md @@ -1,4 +1,5 @@ # no-throw-input-range +* [meta exposition-only] * memory[meta header] * std[meta namespace] * concept[meta id-type] diff --git a/reference/memory/no-throw-sentinel.md b/reference/memory/no-throw-sentinel.md index 8d8542a9d8..65bf8db9cc 100644 --- a/reference/memory/no-throw-sentinel.md +++ b/reference/memory/no-throw-sentinel.md @@ -1,4 +1,5 @@ # no-throw-sentinel +* [meta exposition-only] * memory[meta header] * std[meta namespace] * concept[meta id-type] diff --git a/reference/ranges/all-bidirectional.md b/reference/ranges/all-bidirectional.md index 488437f491..1c7f9568fa 100644 --- a/reference/ranges/all-bidirectional.md +++ b/reference/ranges/all-bidirectional.md @@ -1,4 +1,5 @@ # all-bidirectional +* [meta exposition-only] * ranges[meta header] * concept[meta id-type] * cpp26[meta cpp] @@ -12,7 +13,7 @@ namespace std::ranges { ## 概要 -`all-bidirectional` は、複数のビューに対し、それらすべてが [`bidirectional_range`](bidirectional_range.md) であることを表すコンセプトである。 +`all-bidirectional` は、複数のビューに対し、それらすべてが [`bidirectional_range`](bidirectional_range.md) であることを表す説明専用のコンセプトである。 ## バージョン ### 言語 diff --git a/reference/ranges/all-forward.md b/reference/ranges/all-forward.md index 549ecd75c6..927cdc518f 100644 --- a/reference/ranges/all-forward.md +++ b/reference/ranges/all-forward.md @@ -1,4 +1,5 @@ # all-forward +* [meta exposition-only] * ranges[meta header] * concept[meta id-type] * cpp26[meta cpp] @@ -12,7 +13,7 @@ namespace std::ranges { ## 概要 -`all-forward` は、複数のビューに対し、それらすべてが [`forward_range`](forward_range.md) であることを表すコンセプトである。 +`all-forward` は、複数のビューに対し、それらすべてが [`forward_range`](forward_range.md) であることを表す説明専用のコンセプトである。 ## バージョン ### 言語 diff --git a/reference/ranges/all-random-access.md b/reference/ranges/all-random-access.md index 2751fd6d4f..648b9e9e3d 100644 --- a/reference/ranges/all-random-access.md +++ b/reference/ranges/all-random-access.md @@ -1,4 +1,5 @@ # all-random-access +* [meta exposition-only] * ranges[meta header] * concept[meta id-type] * cpp26[meta cpp] @@ -12,7 +13,7 @@ namespace std::ranges { ## 概要 -`all-random-access` は、複数のビューに対し、それらすべてが [`random_access_range`](random_access_range.md) であることを表すコンセプトである。 +`all-random-access` は、複数のビューに対し、それらすべてが [`random_access_range`](random_access_range.md) であることを表す説明専用のコンセプトである。 ## バージョン ### 言語 diff --git a/reference/ranges/as-lvalue.md b/reference/ranges/as-lvalue.md index 380efc8dc0..c79ffa48c5 100644 --- a/reference/ranges/as-lvalue.md +++ b/reference/ranges/as-lvalue.md @@ -1,4 +1,5 @@ # as-lvalue +* [meta exposition-only] * ranges[meta header] * function template[meta id-type] * cpp23[meta cpp] diff --git a/reference/ranges/different-from.md b/reference/ranges/different-from.md index 5b0b28e225..8fb0d6af63 100644 --- a/reference/ranges/different-from.md +++ b/reference/ranges/different-from.md @@ -1,4 +1,5 @@ # different-from +* [meta exposition-only] * ranges[meta header] * concept[meta id-type] * cpp20[meta cpp] diff --git a/reference/ranges/has-arrow.md b/reference/ranges/has-arrow.md index 52d4d9a842..6613f2d50d 100644 --- a/reference/ranges/has-arrow.md +++ b/reference/ranges/has-arrow.md @@ -1,4 +1,5 @@ # has-arrow +* [meta exposition-only] * ranges[meta header] * concept[meta id-type] * cpp20[meta cpp] diff --git a/reference/ranges/maybe-const.md b/reference/ranges/maybe-const.md index 1acc3a80c5..bb7cc9dc2d 100644 --- a/reference/ranges/maybe-const.md +++ b/reference/ranges/maybe-const.md @@ -1,4 +1,5 @@ # maybe-const +* [meta exposition-only] * ranges[meta header] * type-alias[meta id-type] * cpp23[meta cpp] diff --git a/reference/ranges/possibly-const-range.md b/reference/ranges/possibly-const-range.md index 053b2a1053..e1ee948d98 100644 --- a/reference/ranges/possibly-const-range.md +++ b/reference/ranges/possibly-const-range.md @@ -1,4 +1,5 @@ # possibly-const-range +* [meta exposition-only] * ranges[meta header] * std::ranges[meta namespace] * function[meta id-type] diff --git a/reference/ranges/range-with-movable-references.md b/reference/ranges/range-with-movable-references.md index c068f0a479..61f557519e 100644 --- a/reference/ranges/range-with-movable-references.md +++ b/reference/ranges/range-with-movable-references.md @@ -1,4 +1,5 @@ # range-with-movable-references +* [meta exposition-only] * ranges[meta header] * concept[meta id-type] * cpp23[meta cpp] diff --git a/reference/ranges/simple-view.md b/reference/ranges/simple-view.md index be96992ac2..246a05391d 100644 --- a/reference/ranges/simple-view.md +++ b/reference/ranges/simple-view.md @@ -1,4 +1,5 @@ # simple-view +* [meta exposition-only] * ranges[meta header] * concept[meta id-type] * cpp20[meta cpp] diff --git a/reference/ranges/sized-random-access-range.md b/reference/ranges/sized-random-access-range.md index c6b5e78a65..1a51b2a226 100644 --- a/reference/ranges/sized-random-access-range.md +++ b/reference/ranges/sized-random-access-range.md @@ -1,4 +1,5 @@ # sized-random-access-range +* [meta exposition-only] * ranges[meta header] * concept[meta id-type] * std::ranges[meta namespace] diff --git a/reference/ranges/subrange/convertible-to-non-slicing.md b/reference/ranges/subrange/convertible-to-non-slicing.md index d46fb555d0..2d16d17b57 100644 --- a/reference/ranges/subrange/convertible-to-non-slicing.md +++ b/reference/ranges/subrange/convertible-to-non-slicing.md @@ -1,4 +1,5 @@ # convertible-to-non-slicing +* [meta exposition-only] * ranges[meta header] * concept[meta id-type] * std::ranges[meta namespace] diff --git a/reference/ranges/subrange/pair-like-convertible-from.md b/reference/ranges/subrange/pair-like-convertible-from.md index 6d15d2fd9e..25cee84ba9 100644 --- a/reference/ranges/subrange/pair-like-convertible-from.md +++ b/reference/ranges/subrange/pair-like-convertible-from.md @@ -1,4 +1,5 @@ # pair-like-convertible-from +* [meta exposition-only] * ranges[meta header] * concept[meta id-type] * std::ranges[meta namespace] diff --git a/reference/ranges/subrange/uses-nonqualification-pointer-conversion.md b/reference/ranges/subrange/uses-nonqualification-pointer-conversion.md index 7f1c3a6a29..85ee7f019c 100644 --- a/reference/ranges/subrange/uses-nonqualification-pointer-conversion.md +++ b/reference/ranges/subrange/uses-nonqualification-pointer-conversion.md @@ -1,4 +1,5 @@ # uses-nonqualification-pointer-conversion +* [meta exposition-only] * ranges[meta header] * concept[meta id-type] * std::ranges[meta namespace] diff --git a/reference/ranges/tuple-for-each.md b/reference/ranges/tuple-for-each.md index f4e570ca4e..5cc6ded762 100644 --- a/reference/ranges/tuple-for-each.md +++ b/reference/ranges/tuple-for-each.md @@ -1,4 +1,5 @@ # tuple-for-each +* [meta exposition-only] * ranges[meta header] * function template[meta id-type] * cpp23[meta cpp] diff --git a/reference/ranges/tuple-transform.md b/reference/ranges/tuple-transform.md index b8c00a3c27..fd4c6f55a1 100644 --- a/reference/ranges/tuple-transform.md +++ b/reference/ranges/tuple-transform.md @@ -1,4 +1,5 @@ # tuple-transform +* [meta exposition-only] * ranges[meta header] * function template[meta id-type] * cpp23[meta cpp] diff --git a/reference/span/integral-constant-like.md b/reference/span/integral-constant-like.md index 64270d3766..9f31b07eac 100644 --- a/reference/span/integral-constant-like.md +++ b/reference/span/integral-constant-like.md @@ -1,4 +1,5 @@ # integral-constant-like +* [meta exposition-only] * span[meta header] * concept[meta id-type] * cpp26[meta cpp] diff --git a/reference/span/maybe-static-ext.md b/reference/span/maybe-static-ext.md index 54c3d1d0b0..29bca20d75 100644 --- a/reference/span/maybe-static-ext.md +++ b/reference/span/maybe-static-ext.md @@ -1,4 +1,5 @@ # maybe-static-ext +* [meta exposition-only] * span[meta header] * variable[meta id-type] * cpp26[meta cpp] diff --git a/reference/stop_token/stoppable-source.md b/reference/stop_token/stoppable-source.md index 909dc19f54..40d742215a 100644 --- a/reference/stop_token/stoppable-source.md +++ b/reference/stop_token/stoppable-source.md @@ -1,4 +1,5 @@ # stoppable-source +* [meta exposition-only] * stop_token[meta header] * concept[meta id-type] * std[meta namespace] diff --git a/reference/tuple/pair-like.md b/reference/tuple/pair-like.md index 144f304cec..84d5037596 100644 --- a/reference/tuple/pair-like.md +++ b/reference/tuple/pair-like.md @@ -1,4 +1,5 @@ # pair-like +* [meta exposition-only] * tuple[meta header] * concept[meta id-type] * std[meta namespace] diff --git a/reference/tuple/tuple-like.md b/reference/tuple/tuple-like.md index e4929c1c7f..73b2af25c2 100644 --- a/reference/tuple/tuple-like.md +++ b/reference/tuple/tuple-like.md @@ -1,4 +1,5 @@ # tuple-like +* [meta exposition-only] * tuple[meta header] * concept[meta id-type] * std[meta namespace] From 66e82dbb7a6661030f8d3c423991029269fd587f Mon Sep 17 00:00:00 2001 From: yoh Date: Sun, 8 Feb 2026 18:20:19 +0900 Subject: [PATCH 2606/3948] =?UTF-8?q?reference:=20meta=20exposition-only?= =?UTF-8?q?=E3=82=BF=E3=82=B0=E8=BF=BD=E5=8A=A0(#1558)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 説明文から機械抽出+人力フィルタ find reference -name "*.md" | xargs grep -l -e "説明専用.*である。" | xargs grep -L "meta exposition"↲ --- reference/execution/execution/task/state.md | 1 + reference/execution/queryable.md | 1 + reference/functional/callable.md | 1 + reference/iterator/is_integer_like.md | 1 + reference/linalg/addable.md | 1 + reference/linalg/multipliable.md | 1 + reference/ranges/copyable_box.md | 1 + reference/ranges/movable_box.md | 1 + 8 files changed, 8 insertions(+) diff --git a/reference/execution/execution/task/state.md b/reference/execution/execution/task/state.md index 6d4e38520b..1f11d83072 100644 --- a/reference/execution/execution/task/state.md +++ b/reference/execution/execution/task/state.md @@ -1,4 +1,5 @@ # state +* [meta exposition-only] * execution[meta header] * class template[meta id-type] * std::execution[meta namespace] diff --git a/reference/execution/queryable.md b/reference/execution/queryable.md index 590a415b7e..a2bc7a73ea 100644 --- a/reference/execution/queryable.md +++ b/reference/execution/queryable.md @@ -1,4 +1,5 @@ # queryable +* [meta exposition-only] * execution[meta header] * concept[meta id-type] * std[meta namespace] diff --git a/reference/functional/callable.md b/reference/functional/callable.md index 29ca46abb4..217612955a 100644 --- a/reference/functional/callable.md +++ b/reference/functional/callable.md @@ -1,4 +1,5 @@ # callable +* [meta exposition-only] * functional[meta header] * concept[meta id-type] * std[meta namespace] diff --git a/reference/iterator/is_integer_like.md b/reference/iterator/is_integer_like.md index 4b245bce2f..f0c16dfc40 100644 --- a/reference/iterator/is_integer_like.md +++ b/reference/iterator/is_integer_like.md @@ -1,4 +1,5 @@ # is-integer-like +* [meta exposition-only] * iterator[meta header] * std[meta namespace] * variable[meta id-type] diff --git a/reference/linalg/addable.md b/reference/linalg/addable.md index 1daecc06a0..392a14c022 100644 --- a/reference/linalg/addable.md +++ b/reference/linalg/addable.md @@ -1,4 +1,5 @@ # addable +* [meta exposition-only] * linalg[meta header] * function template[meta id-type] * cpp26[meta cpp] diff --git a/reference/linalg/multipliable.md b/reference/linalg/multipliable.md index c334e2ad04..cefafe7bc2 100644 --- a/reference/linalg/multipliable.md +++ b/reference/linalg/multipliable.md @@ -1,4 +1,5 @@ # multipliable +* [meta exposition-only] * [mathjax enable] * linalg[meta header] * function template[meta id-type] diff --git a/reference/ranges/copyable_box.md b/reference/ranges/copyable_box.md index f75ffd342e..b1ed1da1e6 100644 --- a/reference/ranges/copyable_box.md +++ b/reference/ranges/copyable_box.md @@ -1,4 +1,5 @@ # copyable-box +* [meta exposition-only] * ranges[meta header] * class template[meta id-type] * cpp20[meta cpp] diff --git a/reference/ranges/movable_box.md b/reference/ranges/movable_box.md index 40a72fd5ac..f276171326 100644 --- a/reference/ranges/movable_box.md +++ b/reference/ranges/movable_box.md @@ -1,4 +1,5 @@ # movable-box +* [meta exposition-only] * ranges[meta header] * class template[meta id-type] * cpp23[meta cpp] From d6877028a2eb1fd10233377e67e72c13495dd696 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sun, 8 Feb 2026 19:05:51 +0900 Subject: [PATCH 2607/3948] =?UTF-8?q?dereferenceable=20:=20meta=20expositi?= =?UTF-8?q?on-only=20=E3=82=BF=E3=82=B0=E3=82=92=E8=BF=BD=E5=8A=A0=20(#155?= =?UTF-8?q?8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/dereferenceable.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/iterator/dereferenceable.md b/reference/iterator/dereferenceable.md index a2a73b4c8f..ed7bd63183 100644 --- a/reference/iterator/dereferenceable.md +++ b/reference/iterator/dereferenceable.md @@ -1,4 +1,5 @@ # dereferenceable +* [meta exposition-only] * iterator[meta header] * std[meta namespace] * concept[meta id-type] From 31e12f8cfd38f533dd53283b57bc7538c954af42 Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 11 Feb 2026 14:29:19 +0900 Subject: [PATCH 2608/3948] =?UTF-8?q?GLOBAL=5FQUALIFY=5FLIST:=20std::ostre?= =?UTF-8?q?am=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 1 + reference/ios/basic_ios/copyfmt.md | 1 - reference/ios/ios_base/iword.md | 1 - reference/ios/ios_base/pword.md | 1 - reference/ios/ios_base/xalloc.md | 1 - reference/memory/uses_allocator_construction_args.md | 1 - reference/unordered_map/unordered_map.md | 1 - reference/unordered_map/unordered_map/erase.md | 1 - reference/unordered_map/unordered_map/swap.md | 1 - reference/unordered_map/unordered_multimap.md | 1 - reference/unordered_map/unordered_multimap/emplace_hint.md | 1 - reference/unordered_map/unordered_multimap/erase.md | 1 - reference/unordered_map/unordered_multimap/swap.md | 1 - reference/unordered_set/unordered_multiset.md | 1 - reference/unordered_set/unordered_multiset/emplace.md | 1 - reference/unordered_set/unordered_multiset/emplace_hint.md | 2 +- reference/unordered_set/unordered_multiset/equal_range.md | 1 - reference/unordered_set/unordered_multiset/erase.md | 1 - reference/unordered_set/unordered_multiset/load_factor.md | 1 - reference/unordered_set/unordered_multiset/op_equal.md | 1 - reference/unordered_set/unordered_multiset/op_not_equal.md | 1 - reference/unordered_set/unordered_multiset/swap.md | 1 - reference/unordered_set/unordered_multiset/swap_free.md | 1 - reference/unordered_set/unordered_set.md | 1 - reference/unordered_set/unordered_set/emplace.md | 1 - reference/unordered_set/unordered_set/emplace_hint.md | 1 - reference/unordered_set/unordered_set/equal_range.md | 1 - reference/unordered_set/unordered_set/erase.md | 1 - reference/unordered_set/unordered_set/load_factor.md | 1 - reference/unordered_set/unordered_set/op_equal.md | 1 - reference/unordered_set/unordered_set/op_not_equal.md | 1 - reference/unordered_set/unordered_set/swap.md | 1 - reference/unordered_set/unordered_set/swap_free.md | 1 - reference/utility/pair/op_constructor.md | 1 - reference/utility/piecewise_construct_t.md | 1 - 35 files changed, 2 insertions(+), 34 deletions(-) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index ac9611a03b..9b62c2e2c0 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -242,6 +242,7 @@ * std::optional[link /reference/optional/optional.md] * [link /reference/ostream.md] * std::basic_ostream[link /reference/ostream/basic_ostream.md] + * std::ostream[link /reference/ostream/basic_ostream.md] * std::endl[link /reference/ostream/endl.md] * [link /reference/print.md] * std::println[link /reference/print/println.md] diff --git a/reference/ios/basic_ios/copyfmt.md b/reference/ios/basic_ios/copyfmt.md index a4dd8d4f1e..f4e189801d 100644 --- a/reference/ios/basic_ios/copyfmt.md +++ b/reference/ios/basic_ios/copyfmt.md @@ -58,7 +58,6 @@ int main() ``` * copyfmt[color ff0000] * NULL[link ../../cstddef/null.md] -* std::ostream[link ../../ostream/basic_ostream.md] * std::hex[link ../hex.md] * std::showbase[link ../showbase.md] * std::internal[link ../internal.md] diff --git a/reference/ios/ios_base/iword.md b/reference/ios/ios_base/iword.md index 38a08214f5..6e3cb3e266 100644 --- a/reference/ios/ios_base/iword.md +++ b/reference/ios/ios_base/iword.md @@ -96,7 +96,6 @@ int main() ``` * iword[color ff0000] * xalloc[link xalloc.md] -* std::ostream[link ../../ostream/basic_ostream.md] * std::stringstream[link ../../sstream/basic_stringstream.md] * std::ios_base[link ../ios_base.md] * insert[link ../../string/basic_string/insert.md] diff --git a/reference/ios/ios_base/pword.md b/reference/ios/ios_base/pword.md index f767722ac4..de072fa837 100644 --- a/reference/ios/ios_base/pword.md +++ b/reference/ios/ios_base/pword.md @@ -108,7 +108,6 @@ int main() ``` * pword[color ff0000] * xalloc()[link xalloc.md] -* std::ostream[link ../../ostream/basic_ostream.md] * std::stringstream[link ../../sstream/basic_stringstream.md] * std::ios_base[link ../ios_base.md] * bad()[link ../basic_ios/bad.md] diff --git a/reference/ios/ios_base/xalloc.md b/reference/ios/ios_base/xalloc.md index 1ce15a70c9..139103a11b 100644 --- a/reference/ios/ios_base/xalloc.md +++ b/reference/ios/ios_base/xalloc.md @@ -85,7 +85,6 @@ int main() } ``` * std::ios_base::xalloc()[color ff0000] -* std::ostream[link /reference/ostream/basic_ostream.md] * pword[link pword.md] * std::ostringstream[link /reference/sstream/basic_ostringstream.md] * std::hex[link /reference/ios/hex.md] diff --git a/reference/memory/uses_allocator_construction_args.md b/reference/memory/uses_allocator_construction_args.md index f62b78c56f..1071856635 100644 --- a/reference/memory/uses_allocator_construction_args.md +++ b/reference/memory/uses_allocator_construction_args.md @@ -285,7 +285,6 @@ int main() ``` * uses_allocator_construction_args[color ff0000] * std::allocator_arg_t[link allocator_arg_t.md] -* std::ostream[link ../ostream/basic_ostream.md] * std::piecewise_construct_t[link ../utility/piecewise_construct_t.md] * std::apply[link ../tuple/apply.md] diff --git a/reference/unordered_map/unordered_map.md b/reference/unordered_map/unordered_map.md index 4c0fd21508..05aa53c527 100644 --- a/reference/unordered_map/unordered_map.md +++ b/reference/unordered_map/unordered_map.md @@ -256,7 +256,6 @@ int main() } ``` * std::unordered_map[color ff0000] -* std::ostream[link /reference/ostream/basic_ostream.md] * um.at[link unordered_map/at.md] * um.emplace[link unordered_map/emplace.md] * um.erase[link unordered_map/erase.md] diff --git a/reference/unordered_map/unordered_map/erase.md b/reference/unordered_map/unordered_map/erase.md index 7895f2c735..c1ec6e9a0f 100644 --- a/reference/unordered_map/unordered_map/erase.md +++ b/reference/unordered_map/unordered_map/erase.md @@ -125,7 +125,6 @@ int main() } ``` * erase[color ff0000] -* std::ostream[link /reference/ostream/basic_ostream.md] * cbegin()[link cbegin.md] * cend()[link cend.md] diff --git a/reference/unordered_map/unordered_map/swap.md b/reference/unordered_map/unordered_map/swap.md index 80462716a3..ef254865d9 100644 --- a/reference/unordered_map/unordered_map/swap.md +++ b/reference/unordered_map/unordered_map/swap.md @@ -79,7 +79,6 @@ int main() } ``` * swap[color ff0000] -* std::ostream[link /reference/ostream.md] * c.cbegin()[link cbegin.md] * c.cend()[link cend.md] diff --git a/reference/unordered_map/unordered_multimap.md b/reference/unordered_map/unordered_multimap.md index 4d24af986c..e65fb5be3b 100644 --- a/reference/unordered_map/unordered_multimap.md +++ b/reference/unordered_map/unordered_multimap.md @@ -239,7 +239,6 @@ int main() } ``` * std::unordered_multimap[color ff0000] -* std::ostream[link /reference/ostream/basic_ostream.md] * um.emplace[link unordered_multimap/emplace.md] * um.insert[link unordered_multimap/insert.md] * um.erase[link unordered_multimap/erase.md] diff --git a/reference/unordered_map/unordered_multimap/emplace_hint.md b/reference/unordered_map/unordered_multimap/emplace_hint.md index 22c0e95437..cfdd45f73c 100644 --- a/reference/unordered_map/unordered_multimap/emplace_hint.md +++ b/reference/unordered_map/unordered_multimap/emplace_hint.md @@ -120,7 +120,6 @@ int main() } ``` * emplace_hint[color ff0000] -* std::ostream[link /reference/ostream/basic_ostream.md] * um.cbegin[link cbegin.md] * um.cend[link cend.md] * um.equal_range[link equal_range.md] diff --git a/reference/unordered_map/unordered_multimap/erase.md b/reference/unordered_map/unordered_multimap/erase.md index 617499fe15..770804ef19 100644 --- a/reference/unordered_map/unordered_multimap/erase.md +++ b/reference/unordered_map/unordered_multimap/erase.md @@ -126,7 +126,6 @@ int main() } ``` * erase[color ff0000] -* std::ostream[link /reference/ostream/basic_ostream.md] * cbegin()[link cbegin.md] * cend()[link cend.md] diff --git a/reference/unordered_map/unordered_multimap/swap.md b/reference/unordered_map/unordered_multimap/swap.md index 509a43bf63..7c63516753 100644 --- a/reference/unordered_map/unordered_multimap/swap.md +++ b/reference/unordered_map/unordered_multimap/swap.md @@ -79,7 +79,6 @@ int main() } ``` * swap[color ff0000] -* std::ostream[link /reference/ostream.md] * c.cbegin()[link cbegin.md] * c.cend()[link cend.md] diff --git a/reference/unordered_set/unordered_multiset.md b/reference/unordered_set/unordered_multiset.md index 7443af5038..3d6e529e17 100644 --- a/reference/unordered_set/unordered_multiset.md +++ b/reference/unordered_set/unordered_multiset.md @@ -232,7 +232,6 @@ int main() } ``` * std::unordered_multiset[color ff0000] -* std::ostream[link /reference/ostream.md] * ums.insert[link unordered_multiset/insert.md] * ums.erase[link unordered_multiset/erase.md] diff --git a/reference/unordered_set/unordered_multiset/emplace.md b/reference/unordered_set/unordered_multiset/emplace.md index 485dc364d2..3e57dd12b5 100644 --- a/reference/unordered_set/unordered_multiset/emplace.md +++ b/reference/unordered_set/unordered_multiset/emplace.md @@ -114,7 +114,6 @@ int main() ``` * emplace[color ff0000] * hash[link /reference/functional/hash.md] -* std::ostream[link /reference/ostream/basic_ostream.md] * ums.insert[link insert.md] * ums.cbegin()[link cbegin.md] * ums.cend()[link cend.md] diff --git a/reference/unordered_set/unordered_multiset/emplace_hint.md b/reference/unordered_set/unordered_multiset/emplace_hint.md index 4ec02bcea1..a9d2733116 100644 --- a/reference/unordered_set/unordered_multiset/emplace_hint.md +++ b/reference/unordered_set/unordered_multiset/emplace_hint.md @@ -134,7 +134,7 @@ int main() ``` * emplace_hint[color ff0000] * hash[link /reference/functional/hash.md] -* std::ostream[link /reference/ostream/basic_ostream.md] + * ums.cbegin()[link cbegin.md] * ums.cend()[link cend.md] * ums.equal_range[link equal_range.md] diff --git a/reference/unordered_set/unordered_multiset/equal_range.md b/reference/unordered_set/unordered_multiset/equal_range.md index 25651abb0d..e3e72b330d 100644 --- a/reference/unordered_set/unordered_multiset/equal_range.md +++ b/reference/unordered_set/unordered_multiset/equal_range.md @@ -78,7 +78,6 @@ int main() } ``` * equal_range[color ff0000] -* std::ostream[link /reference/ostream.md] * ums.begin()[link begin.md] * ums.end()[link end.md] * first[link /reference/utility/pair/first.md] diff --git a/reference/unordered_set/unordered_multiset/erase.md b/reference/unordered_set/unordered_multiset/erase.md index bebafc5ed3..77ac089067 100644 --- a/reference/unordered_set/unordered_multiset/erase.md +++ b/reference/unordered_set/unordered_multiset/erase.md @@ -117,7 +117,6 @@ int main() } ``` * erase[color ff0000] -* std::ostream[link /reference/ostream/basic_ostream.md] * ums.cbegin()[link cbegin.md] #### 出力例 diff --git a/reference/unordered_set/unordered_multiset/load_factor.md b/reference/unordered_set/unordered_multiset/load_factor.md index a40667b63e..1cb5eb2702 100644 --- a/reference/unordered_set/unordered_multiset/load_factor.md +++ b/reference/unordered_set/unordered_multiset/load_factor.md @@ -57,7 +57,6 @@ int main() } ``` * load_factor()[color ff0000] -* std::ostream[link /reference/ostream/basic_ostream.md] * c.begin()[link begin.md] * c.end()[link end.md] * c.size()[link size.md] diff --git a/reference/unordered_set/unordered_multiset/op_equal.md b/reference/unordered_set/unordered_multiset/op_equal.md index a63e431e7c..090f483c5a 100644 --- a/reference/unordered_set/unordered_multiset/op_equal.md +++ b/reference/unordered_set/unordered_multiset/op_equal.md @@ -74,7 +74,6 @@ int main() std::cout << "ums1 == ums3:" << (ums1 == ums3) << std::endl; } ``` -* std::ostream[link /reference/ostream/basic_ostream.md] ### 出力例 ``` diff --git a/reference/unordered_set/unordered_multiset/op_not_equal.md b/reference/unordered_set/unordered_multiset/op_not_equal.md index 48525fd556..6a9927edff 100644 --- a/reference/unordered_set/unordered_multiset/op_not_equal.md +++ b/reference/unordered_set/unordered_multiset/op_not_equal.md @@ -75,7 +75,6 @@ int main() std::cout << "ums1 != ums3:" << (ums1 != ums3) << std::endl; } ``` -* std::ostream[link /reference/ostream/basic_ostream.md] ### 出力例 ``` diff --git a/reference/unordered_set/unordered_multiset/swap.md b/reference/unordered_set/unordered_multiset/swap.md index eff448a80d..570d1b90d8 100644 --- a/reference/unordered_set/unordered_multiset/swap.md +++ b/reference/unordered_set/unordered_multiset/swap.md @@ -78,7 +78,6 @@ int main() } ``` * swap[color ff0000] -* std::ostream[link /reference/ostream/basic_ostream.md] ### 出力例 ``` diff --git a/reference/unordered_set/unordered_multiset/swap_free.md b/reference/unordered_set/unordered_multiset/swap_free.md index 24ec6eb72d..a0ae45e1d6 100644 --- a/reference/unordered_set/unordered_multiset/swap_free.md +++ b/reference/unordered_set/unordered_multiset/swap_free.md @@ -58,7 +58,6 @@ int main() } ``` * swap[color ff0000] -* std::ostream[link /reference/ostream/basic_ostream.md] ### 出力例 ``` diff --git a/reference/unordered_set/unordered_set.md b/reference/unordered_set/unordered_set.md index d4fcb8bb0c..0107b2016a 100644 --- a/reference/unordered_set/unordered_set.md +++ b/reference/unordered_set/unordered_set.md @@ -240,7 +240,6 @@ int main() } ``` * std::unordered_set[color ff0000] -* std::ostream[link /reference/ostream.md] * us.emplace[link unordered_set/emplace.md] * us.erase[link unordered_set/erase.md] diff --git a/reference/unordered_set/unordered_set/emplace.md b/reference/unordered_set/unordered_set/emplace.md index 7336a83429..71061c574e 100644 --- a/reference/unordered_set/unordered_set/emplace.md +++ b/reference/unordered_set/unordered_set/emplace.md @@ -129,7 +129,6 @@ int main() ``` * emplace[color ff0000] * hash[link /reference/functional/hash.md] -* std::ostream[link /reference/ostream/basic_ostream.md] * us.insert[link insert.md] * us.cbegin()[link cbegin.md] * us.cend()[link cend.md] diff --git a/reference/unordered_set/unordered_set/emplace_hint.md b/reference/unordered_set/unordered_set/emplace_hint.md index 1b5f329e7b..7acff85326 100644 --- a/reference/unordered_set/unordered_set/emplace_hint.md +++ b/reference/unordered_set/unordered_set/emplace_hint.md @@ -125,7 +125,6 @@ int main() ``` * emplace_hint[color ff0000] * hash[link /reference/functional/hash.md] -* std::ostream[link /reference/ostream/basic_ostream.md] * us.cbegin()[link cbegin.md] * us.cend()[link cend.md] diff --git a/reference/unordered_set/unordered_set/equal_range.md b/reference/unordered_set/unordered_set/equal_range.md index e1537e9bdc..e675e5b6ba 100644 --- a/reference/unordered_set/unordered_set/equal_range.md +++ b/reference/unordered_set/unordered_set/equal_range.md @@ -80,7 +80,6 @@ int main() } ``` * equal_range[color ff0000] -* std::ostream[link /reference/ostream.md] * us.begin()[link begin.md] * us.end()[link end.md] * first[link /reference/utility/pair/first.md] diff --git a/reference/unordered_set/unordered_set/erase.md b/reference/unordered_set/unordered_set/erase.md index 3ae19d3c54..f9d80f8753 100644 --- a/reference/unordered_set/unordered_set/erase.md +++ b/reference/unordered_set/unordered_set/erase.md @@ -116,7 +116,6 @@ int main() } ``` * erase[color ff0000] -* std::ostream[link /reference/ostream/basic_ostream.md] * us.cbegin()[link cbegin.md] ### 出力例 diff --git a/reference/unordered_set/unordered_set/load_factor.md b/reference/unordered_set/unordered_set/load_factor.md index 17e22a12ad..46c6dc735e 100644 --- a/reference/unordered_set/unordered_set/load_factor.md +++ b/reference/unordered_set/unordered_set/load_factor.md @@ -57,7 +57,6 @@ int main() } ``` * load_factor()[color ff0000] -* std::ostream[link /reference/ostream/basic_ostream.md] * c.begin()[link begin.md] * c.end()[link end.md] * c.size()[link size.md] diff --git a/reference/unordered_set/unordered_set/op_equal.md b/reference/unordered_set/unordered_set/op_equal.md index 1c641c8374..882fa77087 100644 --- a/reference/unordered_set/unordered_set/op_equal.md +++ b/reference/unordered_set/unordered_set/op_equal.md @@ -71,7 +71,6 @@ int main() std::cout << "us1 == us3:" << (us1 == us3) << std::endl; } ``` -* std::ostream[link /reference/ostream/basic_ostream.md] ### 出力例 ``` diff --git a/reference/unordered_set/unordered_set/op_not_equal.md b/reference/unordered_set/unordered_set/op_not_equal.md index af1f872abf..5c6fe89e99 100644 --- a/reference/unordered_set/unordered_set/op_not_equal.md +++ b/reference/unordered_set/unordered_set/op_not_equal.md @@ -73,7 +73,6 @@ int main() std::cout << "us1 != us3:" << (us1 != us3) << std::endl; } ``` -* std::ostream[link /reference/ostream/basic_ostream.md] ### 出力例 ``` diff --git a/reference/unordered_set/unordered_set/swap.md b/reference/unordered_set/unordered_set/swap.md index 3a9132c4bf..4c5e6d8a6f 100644 --- a/reference/unordered_set/unordered_set/swap.md +++ b/reference/unordered_set/unordered_set/swap.md @@ -78,7 +78,6 @@ int main() } ``` * swap[color ff0000] -* std::ostream[link /reference/ostream/basic_ostream.md] ### 出力例 ``` diff --git a/reference/unordered_set/unordered_set/swap_free.md b/reference/unordered_set/unordered_set/swap_free.md index 6626de7152..a941439f52 100644 --- a/reference/unordered_set/unordered_set/swap_free.md +++ b/reference/unordered_set/unordered_set/swap_free.md @@ -58,7 +58,6 @@ int main() } ``` * swap[color ff0000] -* std::ostream[link /reference/ostream/basic_ostream.md] ### 出力例 ``` diff --git a/reference/utility/pair/op_constructor.md b/reference/utility/pair/op_constructor.md index f85c5c9fea..6306b0ae55 100644 --- a/reference/utility/pair/op_constructor.md +++ b/reference/utility/pair/op_constructor.md @@ -254,7 +254,6 @@ int main() } } ``` -* std::ostream[link /reference/ostream/basic_ostream.md] * std::move[link /reference/utility/move.md] * std::piecewise_construct[link /reference/utility/piecewise_construct_t.md] * std::make_tuple[link /reference/tuple/make_tuple.md] diff --git a/reference/utility/piecewise_construct_t.md b/reference/utility/piecewise_construct_t.md index 78d5e43280..c6ccf8947d 100644 --- a/reference/utility/piecewise_construct_t.md +++ b/reference/utility/piecewise_construct_t.md @@ -47,7 +47,6 @@ int main() } ``` * std::piecewise_construct[color ff0000] -* std::ostream[link /reference/ostream/basic_ostream.md] * std::make_tuple[link /reference/tuple/make_tuple.md] ### 出力 From 3e16d097df838327193b45acccc7946647c2c478 Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 11 Feb 2026 15:05:02 +0900 Subject: [PATCH 2609/3948] =?UTF-8?q?functional/function=5Fref:=20P3774R1?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C=20(#1569)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/functional/function_ref.md | 7 ++++--- .../functional/function_ref/op_assign.md | 3 ++- .../functional/function_ref/op_constructor.md | 17 +++++++++-------- .../function_ref/op_deduction_guide.md | 17 +++++++++-------- reference/utility.md | 6 +++--- .../{nontype_t.md => constant_arg_t.md} | 19 ++++++++++--------- 6 files changed, 37 insertions(+), 32 deletions(-) rename reference/utility/{nontype_t.md => constant_arg_t.md} (58%) diff --git a/reference/functional/function_ref.md b/reference/functional/function_ref.md index 8d59b43741..c1f86340b7 100644 --- a/reference/functional/function_ref.md +++ b/reference/functional/function_ref.md @@ -33,7 +33,7 @@ namespace std { - ポインタ2個のオブジェクトサイズで実装可能。 - 構築時に必ず呼び出し対象を指定する必要がある。デフォルト構築不可。 - `operator bool`を提供しない。 -- メンバ関数・メンバ変数を参照する場合は、[`std::nontype`](/reference/utility/nontype_t.md)タグを利用する。 +- メンバ関数・メンバ変数を参照する場合は、[`std::constant_arg`](/reference/utility/constant_arg_t.md)タグを利用する。 - 対象オブジェクトの束縛タイミングは、構築時または呼び出し時のいずれもサポートする。 - ダングリング(dangling)参照を避けるため、左辺値(lvalue)のみを取り扱う。 @@ -86,11 +86,11 @@ int main() // オブジェクト束縛済みメンバ関数を指定 Calc obj{ 3 }; - std::cout << hof({std::nontype<&Calc::eval>, obj}) << std::endl; + std::cout << hof({std::constant_arg<&Calc::eval>, obj}) << std::endl; } ``` * std::function_ref[color ff0000] -* std::nontype[link /reference/utility/nontype_t.md] +* std::constant_arg[link /reference/utility/constant_arg_t.md] #### 出力 ``` @@ -118,3 +118,4 @@ int main() ## 参照 - [P0792R14 `function_ref`: a type-erased callable reference](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p0792r14.html) +- [P3774R1 Rename `std::nontype`, and make it broadly useful](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3774r1.html) diff --git a/reference/functional/function_ref/op_assign.md b/reference/functional/function_ref/op_assign.md index 2c9f3166d4..089778da8f 100644 --- a/reference/functional/function_ref/op_assign.md +++ b/reference/functional/function_ref/op_assign.md @@ -19,7 +19,7 @@ template function_ref& operator=(T) = delete; // (2) - (2) : 以下の制約をみたすとき、代入演算子はdelete宣言される - `T`が`function_ref`と同一型ではなく、かつ - [`is_pointer_v`](/reference/type_traits/is_pointer.md)``が`false`であり、かつ - - `T`が[`nontype_t`](/reference/utility/nontype_t.md)の特殊化でないこと + - `T`が[`constant_arg_t`](/reference/utility/constant_arg_t.md)の特殊化でないこと ## 効果 @@ -72,3 +72,4 @@ int main() ## 参照 - [P0792R14 `function_ref`: a type-erased callable reference](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p0792r14.html) +- [P3774R1 Rename `std::nontype`, and make it broadly useful](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3774r1.html) diff --git a/reference/functional/function_ref/op_constructor.md b/reference/functional/function_ref/op_constructor.md index 297237e90d..55801d20d3 100644 --- a/reference/functional/function_ref/op_constructor.md +++ b/reference/functional/function_ref/op_constructor.md @@ -12,15 +12,15 @@ template constexpr function_ref(F&& f) noexcept; // (2) template -constexpr function_ref(nontype_t) noexcept; // (3) +constexpr function_ref(constant_arg_t) noexcept; // (3) template -constexpr function_ref(nontype_t, U&& obj) noexcept; // (4) +constexpr function_ref(constant_arg_t, U&& obj) noexcept; // (4) template -constexpr function_ref(nontype_t, /*cv*/ T* obj) noexcept; // (5) +constexpr function_ref(constant_arg_t, /*cv*/ T* obj) noexcept; // (5) constexpr function_ref(const function_ref&) noexcept = default; // (6) ``` -* nontype_t[link /reference/utility/nontype_t.md] +* constant_arg_t[link /reference/utility/constant_arg_t.md] ## 概要 `function_ref`オブジェクトを構築する。 @@ -113,16 +113,16 @@ int main() } // (3) メンバ関数 { - std::function_ref f3 = std::nontype<&X::ident>; + std::function_ref f3 = std::constant_arg<&X::ident>; X obj; std::cout << "(3) : " << f3(obj, 3) << std::endl; } // (4), (5) メンバ関数+オブジェクト束縛 { X obj; - std::function_ref f4{std::nontype<&X::ident>, obj}; + std::function_ref f4{std::constant_arg<&X::ident>, obj}; std::cout << "(4) : " << f4(4) << std::endl; - std::function_ref f5{std::nontype<&X::ident>, &obj}; + std::function_ref f5{std::constant_arg<&X::ident>, &obj}; std::cout << "(5) : " << f5(5) << std::endl; } // (6) コピーコンストラクタ @@ -133,7 +133,7 @@ int main() } } ``` -* std::nontype[link /reference/utility/nontype_t.md] +* std::constant_arg[link /reference/utility/constant_arg_t.md] ### 出力 ``` @@ -159,3 +159,4 @@ int main() ## 参照 - [P0792R14 `function_ref`: a type-erased callable reference](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p0792r14.html) +- [P3774R1 Rename `std::nontype`, and make it broadly useful](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3774r1.html) diff --git a/reference/functional/function_ref/op_deduction_guide.md b/reference/functional/function_ref/op_deduction_guide.md index b9a246b5d5..605b74826e 100644 --- a/reference/functional/function_ref/op_deduction_guide.md +++ b/reference/functional/function_ref/op_deduction_guide.md @@ -10,13 +10,13 @@ namespace std { function_ref(F*) -> function_ref; // (1) template - function_ref(nontype_t) -> function_ref; // (2) + function_ref(constant_arg_t) -> function_ref; // (2) template - function_ref(nontype_t, T&&) -> function_ref; // (3) + function_ref(constant_arg_t, T&&) -> function_ref; // (3) } ``` -* nontype_t[link /reference/utility/nontype_t.md] +* constant_arg_t[link /reference/utility/constant_arg_t.md] ## 概要 @@ -58,19 +58,19 @@ int main() std::function_ref f1{&ident}; // (2) 関数ポインタ/NTTP - std::function_ref f2{std::nontype<&ident>}; + std::function_ref f2{std::constant_arg<&ident>}; // (3a) メンバ関数+オブジェクト束縛 X obj{42}; - std::function_ref f3a{std::nontype<&X::mf>, obj}; + std::function_ref f3a{std::constant_arg<&X::mf>, obj}; // (3b) メンバ変数+オブジェクト束縛 - std::function_ref f3b{std::nontype<&X::data>, obj}; + std::function_ref f3b{std::constant_arg<&X::data>, obj}; // (3c) 関数ポインタ+第1引数束縛 - std::function_ref f3c{std::nontype<&fun>, obj}; + std::function_ref f3c{std::constant_arg<&fun>, obj}; } ``` * std::function_ref[color ff0000] -* std::nontype[link /reference/utility/nontype_t.md] +* std::constant_arg[link /reference/utility/constant_arg_t.md] ### 出力 ``` @@ -90,3 +90,4 @@ int main() ## 参照 - [P0792R14 `function_ref`: a type-erased callable reference](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p0792r14.html) +- [P3774R1 Rename `std::nontype`, and make it broadly useful](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3774r1.html) diff --git a/reference/utility.md b/reference/utility.md index d9b0a2ed96..ec1742388b 100644 --- a/reference/utility.md +++ b/reference/utility.md @@ -98,12 +98,12 @@ | [`in_place_index`](utility/in_place_index_t.md) | 指定位置にある要素型のコンストラクタ引数を直接受け取って構築するためのタグ値 (constant variable) | C++17 | -## 非型引数 +## 定数引数 | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| [`nontype_t`](utility/nontype_t.md) | 非型引数を表現するためのタグ型 (class template) | C++26 | -| [`nontype`](utility/nontype_t.md) | 非型引数を表現するためのタグ値 (variable template) | C++26 | +| [`constant_arg_t`](utility/constant_arg_t.md) | 定数引数を表現するためのタグ型 (class template) | C++26 | +| [`constant_arg`](utility/constant_arg_t.md) | 定数引数を表現するためのタグ値 (variable template) | C++26 | ## コンパイル時の整数シーケンス diff --git a/reference/utility/nontype_t.md b/reference/utility/constant_arg_t.md similarity index 58% rename from reference/utility/nontype_t.md rename to reference/utility/constant_arg_t.md index 09211efc9f..56ca51d6cd 100644 --- a/reference/utility/nontype_t.md +++ b/reference/utility/constant_arg_t.md @@ -1,4 +1,4 @@ -# nontype_t +# constant_arg_t * utility[meta header] * std[meta namespace] * class template[meta id-type] @@ -7,22 +7,22 @@ ```cpp namespace std { template - struct nontype_t { - explicit nontype_t() = default; + struct constant_arg_t { + explicit constant_arg_t() = default; }; - template constexpr nontype_t nontype{}; + template constexpr constant_arg_t constant_arg{}; } ``` ## 概要 -`nontype_t`クラスは、オーバーロードのための空クラスである。 +`constant_arg_t`クラスは、オーバーロードのための空クラスである。 -標準ライブラリの特定機能において、非型引数をテンプレートパラメータとして受け取って構築するための関数オーバーロードを定義するためにある。 +標準ライブラリの特定機能において、定数引数をテンプレートパラメータとして受け取って構築するための関数オーバーロードを定義するためにある。 ## 備考 -デフォルトコンストラクタに`explicit`が付いているのは、`nontype_t x = {};`のように`=`付きの波カッコ初期化を禁止するためである。ユーザーは通常、`nontype_t`型の変数テンプレートとして事前定義されている`nontype`を使用すればよいので、問題にはならない。 +デフォルトコンストラクタに`explicit`が付いているのは、`constant_arg_t x = {};`のように`=`付きの波カッコ初期化を禁止するためである。ユーザーは通常、`constant_arg_t`型の変数テンプレートとして事前定義されている`constant_arg`を使用すればよいので、問題にはならない。 ## 例 @@ -43,10 +43,10 @@ struct Dog { int main() { Dog dog; - call({std::nontype<&Dog::cry>, dog}); + call({std::constant_arg<&Dog::cry>, dog}); } ``` -* std::nontype[color ff0000] +* std::constant_arg[color ff0000] * std::function_ref[link /reference/functional/function_ref.md] ### 出力 @@ -72,3 +72,4 @@ Bow-wow ## 参照 - [P0792R14 `function_ref`: a type-erased callable reference](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p0792r14.html) +- [P3774R1 Rename `std::nontype`, and make it broadly useful](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3774r1.html) From ebde68c411f604e2b07e91bea3d1debcf2a11df0 Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 11 Feb 2026 15:32:25 +0900 Subject: [PATCH 2610/3948] =?UTF-8?q?basic=5Fistream/ignore:=20P3223R2?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C=20(#1518)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/istream/basic_istream/ignore.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/reference/istream/basic_istream/ignore.md b/reference/istream/basic_istream/ignore.md index b31b96a0f5..62461e5e36 100644 --- a/reference/istream/basic_istream/ignore.md +++ b/reference/istream/basic_istream/ignore.md @@ -5,7 +5,9 @@ * function[meta id-type] ```cpp -basic_istream& ignore(streamsize n = 1, int_type delim = Traits::eof()); +basic_istream& ignore(streamsize n = 1, int_type delim = Traits::eof()); // (1) + +basic_istream& ignore(streamsize n, char_type delim); // (2) C++26 ``` ## 概要 @@ -19,9 +21,10 @@ basic_istream& ignore(streamsize n = 1, int_type delim = Traits:: - 2番目の仮引数`delim`を与えると、その文字が現れるまで入力して捨てる処理を実行する。この指定が不要なら、`Traits::eof()`を実引数に与える。 ## 効果 +(1) : 下記の動作を行う。 1. `sentry`オブジェクトを構築する。`sentry`オブジェクトが失敗を示した場合、何もしない。 -1. 以下のいずれかを満たすまで、`this`内のストリームバッファから文字を入力する(どこへも出力することなく捨てる)。 +2. 以下のいずれかを満たすまで、`this`内のストリームバッファから文字を入力する(どこへも出力することなく捨てる)。 - 実引数で指定された`n`文字まで入力した。 - `n == numeric_limits::max()`の場合、この条件は適用されない。 - EOFに達した。この場合、`setstate(eofbit)`を呼び出す。 @@ -29,6 +32,12 @@ basic_istream& ignore(streamsize n = 1, int_type delim = Traits:: - 次の文字を`c`として、`Traits::eq_int_type(Traits::to_int_type(c), delim)`が真の場合。 - `delim`が`Traits::eof()`である場合、この条件は適用されない。 +(2) : 下記と等価 +```cpp +return ignore(n, traits::to_int_type(delim)); +``` + + ## 戻り値 `*this` @@ -71,3 +80,5 @@ TBD - C++98 ## 参照 +- [P3223R2 Making std::istream::ignore less surprising](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3223r2.html) + - C++26からオーバーロード(2)が追加された From 676ccee955da11ed1f52a5af4ebc5bb4fbccc1a3 Mon Sep 17 00:00:00 2001 From: yoh Date: Wed, 11 Feb 2026 16:01:09 +0900 Subject: [PATCH 2611/3948] print: fix inner link --- reference/ostream/print.md | 4 ++-- reference/print/print.md | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/reference/ostream/print.md b/reference/ostream/print.md index 2be42adf95..0137c3753b 100644 --- a/reference/ostream/print.md +++ b/reference/ostream/print.md @@ -35,7 +35,7 @@ namespace std { vprint_unicode(os, fmt.get(), make_format_args(std::forward(args)...)); ``` * vprint_unicode[link vprint_unicode.md] - * fmt.get()[link /reference/format/format_string/get.md.nolink] + * fmt.get()[link /reference/format/basic_format_string/get.md] * make_format_args[link /reference/format/make_format_args.md] - そうでなければ、以下と等価: @@ -43,7 +43,7 @@ namespace std { vprint_nonunicode(os, fmt.get(), make_format_args(std::forward(args)...)); ``` * vprint_nonunicode[link vprint_nonunicode.md] - * fmt.get()[link /reference/format/format_string/get.md.nolink] + * fmt.get()[link /reference/format/basic_format_string/get.md] * make_format_args[link /reference/format/make_format_args.md] diff --git a/reference/print/print.md b/reference/print/print.md index 87a021b7d3..5af2848733 100644 --- a/reference/print/print.md +++ b/reference/print/print.md @@ -48,7 +48,7 @@ namespace std { vprint_unicode(stream, fmt.get(), make_format_args(std::forward(args)...)); ``` * vprint_unicode[link vprint_unicode.md] - * fmt.get()[link /reference/format/format_string/get.md.nolink] + * fmt.get()[link /reference/format/basic_format_string/get.md] * make_format_args[link /reference/format/make_format_args.md] - そうでなければ、以下と等価: @@ -56,7 +56,7 @@ namespace std { vprint_nonunicode(stream, fmt.get(), make_format_args(std::forward(args)...)); ``` * vprint_nonunicode[link vprint_nonunicode.md] - * fmt.get()[link /reference/format/format_string/get.md.nolink] + * fmt.get()[link /reference/format/basic_format_string/get.md] * make_format_args[link /reference/format/make_format_args.md] - C++26 : @@ -69,7 +69,7 @@ namespace std { ``` * vprint_unicode[link vprint_unicode.md] * vprint_unicode_buffered[link vprint_unicode_buffered.md] - * fmt.get()[link /reference/format/format_string/get.md.nolink] + * fmt.get()[link /reference/format/basic_format_string/get.md] * make_format_args[link /reference/format/make_format_args.md] - そうでなければ、以下と等価: @@ -80,7 +80,7 @@ namespace std { ``` * vprint_nonunicode[link vprint_nonunicode.md] * vprint_nonunicode_buffered[link vprint_nonunicode_buffered.md] - * fmt.get()[link /reference/format/format_string/get.md.nolink] + * fmt.get()[link /reference/format/basic_format_string/get.md] * make_format_args[link /reference/format/make_format_args.md] From 760b77527ea4fbab8125cfdb3ee965dce0857405 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 13 Feb 2026 17:56:17 +0900 Subject: [PATCH 2612/3948] =?UTF-8?q?C++26=E5=AF=BE=E5=BF=9C=E3=81=A8?= =?UTF-8?q?=E3=81=97=E3=81=A6=E3=80=81=E5=B0=8E=E5=85=A5=E4=BA=88=E5=AE=9A?= =?UTF-8?q?=E3=81=A0=E3=81=A3=E3=81=9Fcontract=5Fviolation=E3=82=AF?= =?UTF-8?q?=E3=83=A9=E3=82=B9=E3=81=AEevaluation=5Fexception=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=90=E9=96=A2=E6=95=B0=E3=82=92=E5=89=8A=E9=99=A4?= =?UTF-8?q?=20#1570?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26/contracts.md | 1 - reference/contracts/contract_violation.md | 23 ++++++------ .../evaluation_exception.md | 35 ------------------- 3 files changed, 12 insertions(+), 47 deletions(-) delete mode 100644 reference/contracts/contract_violation/evaluation_exception.md diff --git a/lang/cpp26/contracts.md b/lang/cpp26/contracts.md index 6a77eabb53..a663549aea 100644 --- a/lang/cpp26/contracts.md +++ b/lang/cpp26/contracts.md @@ -413,7 +413,6 @@ void handle_contract_violation(const std::contracts::contract_violation& violati - **検出モード** (`detection_mode`): 契約違反がどのように検出されたか(述語が`false`に評価されたか、例外が発生したか) - **ソースロケーション** (`location`): 違反した契約アサーションのソースファイル名、行番号、関数名 - **終了判定** (`is_terminating`): この違反後にプログラムが終了するかどうか -- **評価例外** (`evaluation_exception`): 述語の評価中に例外が発生した場合、その例外オブジェクトへのアクセス #### ハンドラの動作 契約違反が識別されると、`observe`または`enforce`セマンティクスの場合、契約違反ハンドラが呼び出される: diff --git a/reference/contracts/contract_violation.md b/reference/contracts/contract_violation.md index ce96a3a2b1..b4fec75833 100644 --- a/reference/contracts/contract_violation.md +++ b/reference/contracts/contract_violation.md @@ -6,16 +6,7 @@ ```cpp namespace std::contracts { - class contract_violation { - public: - const char* comment() const noexcept; - contracts::detection_mode detection_mode() const noexcept; - exception_ptr evaluation_exception() const noexcept; - bool is_terminating() const noexcept; - assertion_kind kind() const noexcept; - source_location location() const noexcept; - evaluation_semantic semantic() const noexcept; - }; + class contract_violation; } ``` @@ -28,11 +19,21 @@ namespace std::contracts { | ---- | ---- | ---- | | [`comment`](contract_violation/comment.md) | 契約違反の詳細を記録したchar列を返す | C++26 | | [`detection_mode`](contract_violation/detection_mode.md) | 契約違反が特定された方法を返す | C++26 | -| [`evaluation_exception`](contract_violation/evaluation_exception.md) | 契約が例外を飛ばしたことによって終了した場合の例外へのポインタ | C++26 | | [`is_terminating`](contract_violation/is_terminating.md) | 契約違反によってプログラムがターミネートされるかを返す | C++26| | [`kind`](contract_violation/kind.md) | 違反した契約の種類 | C++26| | [`location`](contract_violation/location.md) | 契約違反が発生したソースコードの位置 | C++26| | [`semantic`](contract_violation/semantic.md) | 契約の評価方法 | C++26| +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + ## 参照 - [Contracts for C++](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2900r14.pdf) +- [P3819R0 Remove `evaluation_exception()` from contract-violation handling](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3819r0.pdf) + - 導入予定だった`evaluation_exception()`メンバ関数を削除する提案 diff --git a/reference/contracts/contract_violation/evaluation_exception.md b/reference/contracts/contract_violation/evaluation_exception.md deleted file mode 100644 index 4d9cc3a7ec..0000000000 --- a/reference/contracts/contract_violation/evaluation_exception.md +++ /dev/null @@ -1,35 +0,0 @@ -# evaluation_exception -* contracts[meta header] -* std::contracts[meta namespace] -* function[meta id-type] -* cpp26[meta cpp] -* contract_violation[meta class] - -```cpp -exception_ptr evaluation_exception() const noexcept; -``` - -## 概要 -契約の判定時に例外が投げられた場合、その例外へのポインタを返す。 - -例外が飛ばなければ、空の`std::exception_ptr`を返す。 - -## 戻り値 -契約の判定時に例外が投げられた場合、その例外へのポインタを返す。 - -例外が飛ばなければ、空の`std::exception_ptr`を返す。 - -## 例外 -投げない - -## バージョン -### 言語 -- C++26 - -### 処理系 -- [Clang](/implementation.md#clang): ?? -- [GCC](/implementation.md#gcc): ?? -- [Visual C++](/implementation.md#visual_cpp): ?? - -## 参照 -- [Contracts for C++](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2900r14.pdf) From c3a3a49e88a9766d0f632c9d2e4561822a34e398 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 17 Feb 2026 12:19:01 +0900 Subject: [PATCH 2613/3948] =?UTF-8?q?C++23=E5=AF=BE=E5=BF=9C=E3=81=A8?= =?UTF-8?q?=E3=81=97=E3=81=A6=E3=82=B3=E3=83=B3=E3=83=86=E3=83=8A=E3=81=AE?= =?UTF-8?q?=E3=82=A2=E3=83=AD=E3=82=B1=E3=83=BC=E3=82=BF=E5=9E=8B=E3=81=AE?= =?UTF-8?q?=E6=8E=A8=E8=AB=96=E6=96=B9=E6=B3=95=E3=82=92=E8=A6=8B=E7=9B=B4?= =?UTF-8?q?=E3=81=97=20#1052?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp23.md | 2 +- reference/deque/deque/op_constructor.md | 14 ++++++++++++-- .../forward_list/op_constructor.md | 15 +++++++++++++-- reference/list/list/op_constructor.md | 14 ++++++++++++-- reference/map/map/op_constructor.md | 15 ++++++++++++--- reference/map/multimap/op_constructor.md | 16 +++++++++++++--- .../queue/priority_queue/op_deduction_guide.md | 12 ++++++++++++ reference/queue/queue/op_deduction_guide.md | 11 +++++++++++ reference/set/multiset/op_constructor.md | 15 +++++++++++++-- reference/set/set/op_constructor.md | 14 ++++++++++++-- reference/stack/stack/op_deduction_guide.md | 11 +++++++++++ .../unordered_map/op_constructor.md | 14 ++++++++++++-- .../unordered_multimap/op_constructor.md | 16 ++++++++++++++-- .../unordered_multiset/op_constructor.md | 16 ++++++++++++++-- .../unordered_set/op_constructor.md | 14 ++++++++++++-- reference/vector/vector/op_constructor.md | 18 ++++++++++++++---- 16 files changed, 188 insertions(+), 29 deletions(-) diff --git a/lang/cpp23.md b/lang/cpp23.md index 93717594fc..3211cfdff4 100644 --- a/lang/cpp23.md +++ b/lang/cpp23.md @@ -127,7 +127,7 @@ C++23とは、2023年中に改訂され、ISO/IEC 14882:2024で標準規格化 ### コンテナ - [`std::stack`](/reference/stack/stack.md)と[`std::queue`](/reference/queue/queue.md)に、イテレータのペアをとるコンストラクタを追加 -- `auto v = std::vector(v, alloc);`のようなアロケータ引数をともなう場合のクラステンプレートのテンプレート引数推論が動作しなかったため、各コンテナクラスのコンストラクタにおけるアロケータパラメータの型を`const Allocator&`から`const` [`std::type_identity_t`](/reference/type_traits/type_identity.md)`&`に修正 +- `auto v = std::vector(v, alloc);`のようなアロケータ引数をともなう場合のクラステンプレートのテンプレート引数推論が動作しなかったため、各コンテナクラスのコンストラクタにおけるアロケータパラメータの型を`const Allocator&`から`const` [`std::type_identity_t`](/reference/type_traits/type_identity.md)`&`に修正し、コンテナアダプタの推論補助の制約を修正 - N要素のメモリアロケート時にアロケータが実際にどれくらいのメモリを確保したかを得られるインタフェースとして、 - [`std::allocator`](/reference/memory/allocator.md)クラスに、[`allocate_at_least()`](/reference/memory/allocator/allocate_at_least.md)メンバ関数を追加 - [`std::allocator_traits`](/reference/memory/allocator_traits.md)クラスに、[`allocate_at_least()`](/reference/memory/allocator_traits/allocate_at_least.md)関数を追加 diff --git a/reference/deque/deque/op_constructor.md b/reference/deque/deque/op_constructor.md index 726534f06c..b86a698ed1 100644 --- a/reference/deque/deque/op_constructor.md +++ b/reference/deque/deque/op_constructor.md @@ -26,8 +26,12 @@ deque(InputIterator first, InputIterator last, deque(const deque& x); // (6) deque(deque&& y); // (7) C++11 から -deque(const deque& x, const Allocator& a); // (8) C++11 から -deque(deque&& y, const Allocator& a); // (9) C++11 から +deque(const deque& x, const Allocator& a); // (8) C++11 +deque(const deque& x, + const type_identity_t& a); // (8) C++23 + +deque(deque&& y, const Allocator& a); // (9) C++11 +deque(deque&& y, const type_identity_t& a); // (9) C++23 deque(initializer_list il, const Allocator& a = Allocator()); // (10) C++11 から @@ -36,6 +40,7 @@ template R> deque(from_range_t, R&& rg, const Allocator& a = Allocator()); // (11) C++23 から ``` +* type_identity_t[link /reference/type_traits/type_identity.md] * initializer_list[link /reference/initializer_list/initializer_list.md] * from_range_t[link ../../ranges/from_range_t.md] @@ -111,6 +116,9 @@ deque(from_range_t, R&& rg, * std::scoped_allocator_adaptor[link ../../scoped_allocator/scoped_allocator_adaptor.md] * emplace_back[link ../../list/list/emplace_back.md] +- C++23 では、(8) と (9) のアロケータパラメータの型が `const Allocator&` から `const type_identity_t&` に変更された。 + これは、クラステンプレートのテンプレート引数推論 (CTAD) の際に、コピー/ムーブ元の `deque` から推論される `Allocator` と、アロケータ引数から推論される型が異なる場合に推論が失敗する問題を修正するためである。[`type_identity_t`](/reference/type_traits/type_identity.md) で包むことで、アロケータ引数が非推論コンテキストとなり、アロケータの型はコピー/ムーブ元のみから推論されるようになる。 + ## 例 ```cpp example @@ -185,3 +193,5 @@ c7 : {1 2 3 } - [LWG 2210. Missing allocator-extended constructor for allocator-aware containers](http://cplusplus.github.io/LWG/lwg-defects.html#2210) `explicit deque(size_type n)` にアロケータ引数を追加するきっかけとなったレポート なお、Discussion の例はアロケータの型が誤っているので注意 +- [P1518R2 Stop Overconstraining Allocators in Container Deduction Guides](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1518r2.html) + - C++23でのアロケータ引数を`type_identity_t`で包む変更 diff --git a/reference/forward_list/forward_list/op_constructor.md b/reference/forward_list/forward_list/op_constructor.md index f606138eb8..4d6c1bd270 100644 --- a/reference/forward_list/forward_list/op_constructor.md +++ b/reference/forward_list/forward_list/op_constructor.md @@ -27,8 +27,13 @@ forward_list(InputIterator first, forward_list(const forward_list& x); // (6) C++11 forward_list(forward_list&& x); // (7) C++11 -forward_list(const forward_list& x, const Allocator& a); // (8) C++11 -forward_list(forward_list&& x, const Allocator& a); // (9) C++11 +forward_list(const forward_list& x, const Allocator& a); // (8) C++11 +forward_list(const forward_list& x, + const type_identity_t& a); // (8) C++23 + +forward_list(forward_list&& x, const Allocator& a); // (9) C++11 +forward_list(forward_list&& x, + const type_identity_t& a); // (9) C++23 forward_list(initializer_list il, const Allocator& a = Allocator()); // (10) C++11 @@ -37,6 +42,7 @@ template R> forward_list(from_range_t, R&& rg, const Allocator& a = Allocator()); // (11) C++23 ``` +* type_identity_t[link /reference/type_traits/type_identity.md] * initializer_list[link /reference/initializer_list/initializer_list.md] * from_range_t[link ../../ranges/from_range_t.md] @@ -104,6 +110,9 @@ forward_list(from_range_t, R&& rg, * std::scoped_allocator_adaptor[link ../../scoped_allocator/scoped_allocator_adaptor.md] * emplace_back[link ../../list/list/emplace_back.md] +- C++23 では、(8) と (9) のアロケータパラメータの型が `const Allocator&` から `const type_identity_t&` に変更された。 + これは、クラステンプレートのテンプレート引数推論 (CTAD) の際に、コピー/ムーブ元の `forward_list` から推論される `Allocator` と、アロケータ引数から推論される型が異なる場合に推論が失敗する問題を修正するためである。[`type_identity_t`](/reference/type_traits/type_identity.md) で包むことで、アロケータ引数が非推論コンテキストとなり、アロケータの型はコピー/ムーブ元のみから推論されるようになる。 + ## 例 ```cpp example @@ -191,3 +200,5 @@ ls7 : 1 2 3 - [LWG 2210. Missing allocator-extended constructor for allocator-aware containers](http://cplusplus.github.io/LWG/lwg-defects.html#2210) `explicit forward_list(size_type n)` にアロケータ引数を追加するきっかけとなったレポート なお、Discussion の例はアロケータの型が誤っているので注意 +- [P1518R2 Stop Overconstraining Allocators in Container Deduction Guides](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1518r2.html) + - C++23でのアロケータ引数を`type_identity_t`で包む変更 diff --git a/reference/list/list/op_constructor.md b/reference/list/list/op_constructor.md index 3b8c119e0c..1190ba23e2 100644 --- a/reference/list/list/op_constructor.md +++ b/reference/list/list/op_constructor.md @@ -24,8 +24,12 @@ list(InputIterator first, InputIterator last, list(const list& x); // (6) list(list&& x); // (7) C++11 から -list(const list& x, const Allocator& a); // (8) C++11 から -list(list&& x, const Allocator& a); // (9) C++11 から +list(const list& x, const Allocator& a); // (8) C++11 +list(const list& x, + const type_identity_t& a); // (8) C++23 + +list(list&& x, const Allocator& a); // (9) C++11 +list(list&& x, const type_identity_t& a); // (9) C++23 list(initializer_list il, const Allocator& a = Allocator()); // (10) C++11 から @@ -34,6 +38,7 @@ template R> list(from_range_t, R&& rg, const Allocator& a = Allocator()); // (11) C++23 から ``` +* type_identity_t[link /reference/type_traits/type_identity.md] * initializer_list[link /reference/initializer_list/initializer_list.md] * from_range_t[link /reference/ranges/from_range_t.md] @@ -100,6 +105,9 @@ list オブジェクトの構築 * std::scoped_allocator_adaptor[link ../../scoped_allocator/scoped_allocator_adaptor.md] * v.emplace_back[link /reference/vector/vector/emplace_back.md] +- C++23 では、(8) と (9) のアロケータパラメータの型が `const Allocator&` から `const type_identity_t&` に変更された。 + これは、クラステンプレートのテンプレート引数推論 (CTAD) の際に、コピー/ムーブ元の `list` から推論される `Allocator` と、アロケータ引数から推論される型が異なる場合に推論が失敗する問題を修正するためである。[`type_identity_t`](/reference/type_traits/type_identity.md) で包むことで、アロケータ引数が非推論コンテキストとなり、アロケータの型はコピー/ムーブ元のみから推論されるようになる。 + ## 例 ```cpp example @@ -173,3 +181,5 @@ ls7 : 1 2 3 - [LWG 2210. Missing allocator-extended constructor for allocator-aware containers](http://cplusplus.github.io/LWG/lwg-defects.html#2210) `explicit list(size_type n)` にアロケータ引数を追加するきっかけとなったレポート なお、Discussion の例はアロケータの型が誤っているので注意 +- [P1518R2 Stop Overconstraining Allocators in Container Deduction Guides](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1518r2.html) + - C++23でのアロケータ引数を`type_identity_t`で包む変更 diff --git a/reference/map/map/op_constructor.md b/reference/map/map/op_constructor.md index ab10b55cf7..cddd74bc36 100644 --- a/reference/map/map/op_constructor.md +++ b/reference/map/map/op_constructor.md @@ -28,11 +28,14 @@ map(InputIterator first, map(const map& x); // (6) -map(const map& x, const Allocator& alloc); // (7) C++11 から +map(const map& x, const Allocator& alloc); // (7) C++11 +map(const map& x, + const type_identity_t& alloc); // (7) C++23 -map(map&& y); // (8) C++11 から +map(map&& y); // (8) C++11 から -map(map&& y, const Allocator& alloc); // (9) C++11 から +map(map&& y, const Allocator& alloc); // (9) C++11 +map(map&& y, const type_identity_t& alloc); // (9) C++23 map(initializer_list init, const Compare& comp = Compare(), @@ -50,6 +53,7 @@ template R> map(from_range_t, R&& rg, const Allocator& alloc); // (13) C++23 から ``` +* type_identity_t[link /reference/type_traits/type_identity.md] * initializer_list[link ../../initializer_list.md] * from_range_t[link ../../ranges/from_range_t.md] @@ -120,6 +124,9 @@ map(from_range_t, R&& rg, なお、C++14 では同様の理由で (11) の形式も新たに追加されているが、こちらは存在しなくてもエラーとはならない。 (`map(init, alloc)` の形式の構築では、(11) の形式が無い場合でも (10) の形式を用いて `init` から一時 `map` が構築され、`alloc` と共に (9) の形式に引き渡される) +- C++23 では、(7) と (9) のアロケータパラメータの型が `const Allocator&` から `const type_identity_t&` に変更された。 + これは、クラステンプレートのテンプレート引数推論 (CTAD) の際に、コピー/ムーブ元の `map` から推論される `Allocator` と、アロケータ引数から推論される型が異なる場合に推論が失敗する問題を修正するためである。[`type_identity_t`](/reference/type_traits/type_identity.md) で包むことで、アロケータ引数が非推論コンテキストとなり、アロケータの型はコピー/ムーブ元のみから推論されるようになる。 + ## 例 ```cpp example #include @@ -167,3 +174,5 @@ Size of m2: 2 - [LWG 2210. Missing allocator-extended constructor for allocator-aware containers](http://cplusplus.github.io/LWG/lwg-defects.html#2210) (5), (11) を追加するきっかけとなったレポート なお、Discussion の例はアロケータの型が誤っているので注意 +- [P1518R2 Stop Overconstraining Allocators in Container Deduction Guides](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1518r2.html) + - C++23でのアロケータ引数を`type_identity_t`で包む変更 diff --git a/reference/map/multimap/op_constructor.md b/reference/map/multimap/op_constructor.md index 4a4ce3067e..f34c413561 100644 --- a/reference/map/multimap/op_constructor.md +++ b/reference/map/multimap/op_constructor.md @@ -29,12 +29,16 @@ multimap(InputIterator first, multimap(const multimap& x); // (6) multimap(const multimap& x, - const Allocator& alloc); // (7) C++11 から + const Allocator& alloc); // (7) C++11 +multimap(const multimap& x, + const type_identity_t& alloc); // (7) C++23 -multimap(multimap&& y); // (8) C++11 から +multimap(multimap&& y); // (8) C++11 から multimap(multimap&& y, - const Allocator& alloc); // (9) C++11 から + const Allocator& alloc); // (9) C++11 +multimap(multimap&& y, + const type_identity_t& alloc); // (9) C++23 multimap(initializer_list init, const Compare& comp = Compare(), @@ -52,6 +56,7 @@ template R> multimap(from_range_t, R&& rg, const Allocator& alloc); // (13) C++23 から ``` +* type_identity_t[link /reference/type_traits/type_identity.md] * initializer_list[link ../../initializer_list.md] * from_range_t[link ../../ranges/from_range_t.md] @@ -123,6 +128,9 @@ multimap(from_range_t, R&& rg, なお、C++14 では同様の理由で (11) の形式も新たに追加されているが、こちらは存在しなくてもエラーとはならない。 (`multimap(init, alloc)` の形式の構築では、(11) の形式が無い場合でも (10) の形式を用いて `init` から一時 `multimap` が構築され、`alloc` と共に (9) の形式に引き渡される) +- C++23 では、(7) と (9) のアロケータパラメータの型が `const Allocator&` から `const type_identity_t&` に変更された。 + これは、クラステンプレートのテンプレート引数推論 (CTAD) の際に、コピー/ムーブ元の `multimap` から推論される `Allocator` と、アロケータ引数から推論される型が異なる場合に推論が失敗する問題を修正するためである。[`type_identity_t`](/reference/type_traits/type_identity.md) で包むことで、アロケータ引数が非推論コンテキストとなり、アロケータの型はコピー/ムーブ元のみから推論されるようになる。 + ## 例 ```cpp example @@ -170,3 +178,5 @@ Size of m2: 3 - [LWG 2210. Missing allocator-extended constructor for allocator-aware containers](http://cplusplus.github.io/LWG/lwg-defects.html#2210) (5), (11) の形式を追加するきっかけとなったレポート なお、Discussion の例はアロケータの型が誤っているので注意 +- [P1518R2 Stop Overconstraining Allocators in Container Deduction Guides](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1518r2.html) + - C++23でのアロケータ引数を`type_identity_t`で包む変更 diff --git a/reference/queue/priority_queue/op_deduction_guide.md b/reference/queue/priority_queue/op_deduction_guide.md index 00006c654e..9b8f6e81a4 100644 --- a/reference/queue/priority_queue/op_deduction_guide.md +++ b/reference/queue/priority_queue/op_deduction_guide.md @@ -77,6 +77,16 @@ template - (9) : Rangeとアロケータから推論する +## 適格要件 +以下のいずれかの条件を満たす場合、コンテナアダプタの推論補助はオーバーロード解決に参加しない: + +- `InputIterator`テンプレートパラメータをもち、入力イテレータの要件を満たさない型が推論された場合 +- `Compare`テンプレートパラメータをもち、アロケータとして適格な型が推論された場合 (C++23) +- `Container`テンプレートパラメータをもち、アロケータとして適格な型が推論された場合 (C++23) +- `Container`テンプレートパラメータをもたず、`Allocator`テンプレートパラメータをもち、アロケータとして適格でない型が推論された場合 (C++23) +- `Container`と`Allocator`の両方のテンプレートパラメータをもち、[`uses_allocator_v`](/reference/memory/uses_allocator.md)``が`false`の場合 + + ## 例 ```cpp example #include @@ -120,3 +130,5 @@ int main() ## 参照 - [P0433R2 Toward a resolution of US7 and US14: Integrating template deduction for class templates into the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0433r2.html) +- [P1518R2 Stop Overconstraining Allocators in Container Deduction Guides](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1518r2.html) + - C++23での推論補助の制約についての変更 diff --git a/reference/queue/queue/op_deduction_guide.md b/reference/queue/queue/op_deduction_guide.md index fc38ce5143..ea07facef2 100644 --- a/reference/queue/queue/op_deduction_guide.md +++ b/reference/queue/queue/op_deduction_guide.md @@ -51,6 +51,15 @@ namespace std { - (6) : Rangeとアロケータからの推論する。 +## 適格要件 +以下のいずれかの条件を満たす場合、コンテナアダプタの推論補助はオーバーロード解決に参加しない: + +- `InputIterator`テンプレートパラメータをもち、入力イテレータの要件を満たさない型が推論された場合 +- `Container`テンプレートパラメータをもち、アロケータとして適格な型が推論された場合 (C++23) +- `Container`テンプレートパラメータをもたず、`Allocator`テンプレートパラメータをもち、アロケータとして適格でない型が推論された場合 (C++23) +- `Container`と`Allocator`の両方のテンプレートパラメータをもち、[`uses_allocator_v`](/reference/memory/uses_allocator.md)``が`false`の場合 + + ## 例 ```cpp example #include @@ -104,3 +113,5 @@ int main() - [P0433R2 Toward a resolution of US7 and US14: Integrating template deduction for class templates into the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0433r2.html) - [P1425R4 Iterators pair constructors for stack and queue](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1425r4.pdf) - C++23でのイテレータペアへの対応 +- [P1518R2 Stop Overconstraining Allocators in Container Deduction Guides](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1518r2.html) + - C++23での推論補助の制約についての変更 diff --git a/reference/set/multiset/op_constructor.md b/reference/set/multiset/op_constructor.md index 030e04eaf6..5f80bb239d 100644 --- a/reference/set/multiset/op_constructor.md +++ b/reference/set/multiset/op_constructor.md @@ -27,8 +27,13 @@ multiset(InputIterator first, InputIterator last, multiset(const set& x); // (6) C++03 multiset(set&& y); // (7) C++11 -multiset(const set& x, const Allocator& alloc); // (8) C++11 -multiset(set&& y, const Allocator& alloc); // (9) C++11 +multiset(const multiset& x, const Allocator& alloc); // (8) C++11 +multiset(const multiset& x, + const type_identity_t& alloc); // (8) C++23 + +multiset(multiset&& y, const Allocator& alloc); // (9) C++11 +multiset(multiset&& y, + const type_identity_t& alloc); // (9) C++23 multiset(initializer_list init, const Compare& comp = Compare(), @@ -46,6 +51,7 @@ template R> multiset(from_range_t, R&& rg, const Allocator& alloc); // (13) C++23 ``` +* type_identity_t[link /reference/type_traits/type_identity.md] * initializer_list[link ../../initializer_list.md] * from_range_t[link ../../ranges/from_range_t.md] @@ -113,6 +119,9 @@ multiset(from_range_t, R&& rg, なお、C++14 では同様の理由で (11) の形式も新たに追加されているが、こちらは存在しなくてもエラーとはならない。 (`multiset(init, alloc)` の形式の構築では、(11) の形式が無い場合でも (10) の形式を用いて `init` から一時 `multiset` が構築され、`alloc` と共に (9) の形式に引き渡される) +- C++23 では、(8) と (9) のアロケータパラメータの型が `const Allocator&` から `const type_identity_t&` に変更された。 + これは、クラステンプレートのテンプレート引数推論 (CTAD) の際に、コピー/ムーブ元の `multiset` から推論される `Allocator` と、アロケータ引数から推論される型が異なる場合に推論が失敗する問題を修正するためである。[`type_identity_t`](/reference/type_traits/type_identity.md) で包むことで、アロケータ引数が非推論コンテキストとなり、アロケータの型はコピー/ムーブ元のみから推論されるようになる。 + ## 例 ```cpp example @@ -153,3 +162,5 @@ Size of c2: 7 - [LWG 2210. Missing allocator-extended constructor for allocator-aware containers](http://cplusplus.github.io/LWG/lwg-defects.html#2210) (5), (11) を追加するきっかけとなったレポート なお、Discussion の例はアロケータの型が誤っているので注意 +- [P1518R2 Stop Overconstraining Allocators in Container Deduction Guides](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1518r2.html) + - C++23でのアロケータ引数を`type_identity_t`で包む変更 diff --git a/reference/set/set/op_constructor.md b/reference/set/set/op_constructor.md index d45f8ca149..51a2b731da 100644 --- a/reference/set/set/op_constructor.md +++ b/reference/set/set/op_constructor.md @@ -27,8 +27,12 @@ set(InputIterator first, InputIterator last, set(const set& x); // (6) C++03 set(set&& y); // (7) C++11 -set(const set& x, const Allocator& alloc); // (8) C++11 -set(set&& y, const Allocator& alloc); // (9) C++11 +set(const set& x, const Allocator& alloc); // (8) C++11 +set(const set& x, + const type_identity_t& alloc); // (8) C++23 + +set(set&& y, const Allocator& alloc); // (9) C++11 +set(set&& y, const type_identity_t& alloc); // (9) C++23 set(initializer_list init, const Compare& comp = Compare(), @@ -46,6 +50,7 @@ template R> set(from_range_t, R&& rg, const Allocator& alloc); // (13) C++23 ``` +* type_identity_t[link /reference/type_traits/type_identity.md] * initializer_list[link ../../initializer_list.md] * from_range_t[link ../../ranges/from_range_t.md] @@ -113,6 +118,9 @@ set(from_range_t, R&& rg, なお、C++14 では同様の理由で (11) の形式も新たに追加されているが、こちらは存在しなくてもエラーとはならない。 (`set(init, alloc)` の形式の構築では、(11) の形式が無い場合でも (10) の形式を用いて `init` から一時 `set` が構築され、`alloc` と共に (9) の形式に引き渡される) +- C++23 では、(8) と (9) のアロケータパラメータの型が `const Allocator&` から `const type_identity_t&` に変更された。 + これは、クラステンプレートのテンプレート引数推論 (CTAD) の際に、コピー/ムーブ元の `set` から推論される `Allocator` と、アロケータ引数から推論される型が異なる場合に推論が失敗する問題を修正するためである。[`type_identity_t`](/reference/type_traits/type_identity.md) で包むことで、アロケータ引数が非推論コンテキストとなり、アロケータの型はコピー/ムーブ元のみから推論されるようになる。 + ## 例 ```cpp example @@ -153,3 +161,5 @@ Size of c2: 6 - [LWG 2210. Missing allocator-extended constructor for allocator-aware containers](http://cplusplus.github.io/LWG/lwg-defects.html#2210) (5), (11) を追加するきっかけとなったレポート なお、Discussion の例はアロケータの型が誤っているので注意 +- [P1518R2 Stop Overconstraining Allocators in Container Deduction Guides](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1518r2.html) + - C++23でのアロケータ引数を`type_identity_t`で包む変更 diff --git a/reference/stack/stack/op_deduction_guide.md b/reference/stack/stack/op_deduction_guide.md index de51f5e9ba..bce23b2c7e 100644 --- a/reference/stack/stack/op_deduction_guide.md +++ b/reference/stack/stack/op_deduction_guide.md @@ -52,6 +52,15 @@ namespace std { - (6) : Rangeとアロケータからの推論する。 +## 適格要件 +以下のいずれかの条件を満たす場合、コンテナアダプタの推論補助はオーバーロード解決に参加しない: + +- `InputIterator`テンプレートパラメータをもち、入力イテレータの要件を満たさない型が推論された場合 +- `Container`テンプレートパラメータをもち、アロケータとして適格な型が推論された場合 (C++23) +- `Container`テンプレートパラメータをもたず、`Allocator`テンプレートパラメータをもち、アロケータとして適格でない型が推論された場合 (C++23) +- `Container`と`Allocator`の両方のテンプレートパラメータをもち、[`uses_allocator_v`](/reference/memory/uses_allocator.md)``が`false`の場合 + + ## 例 ```cpp example #include @@ -105,3 +114,5 @@ int main() - [P0433R2 Toward a resolution of US7 and US14: Integrating template deduction for class templates into the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0433r2.html) - [P1425R4 Iterators pair constructors for stack and queue](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1425r4.pdf) - C++23でのイテレータペアへの対応 +- [P1518R2 Stop Overconstraining Allocators in Container Deduction Guides](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1518r2.html) + - C++23での推論補助の制約についての変更 diff --git a/reference/unordered_map/unordered_map/op_constructor.md b/reference/unordered_map/unordered_map/op_constructor.md index ae219993bb..327e7af737 100644 --- a/reference/unordered_map/unordered_map/op_constructor.md +++ b/reference/unordered_map/unordered_map/op_constructor.md @@ -31,9 +31,13 @@ unordered_map(unordered_map&& rv); // (5) explicit unordered_map(const allocator_type& a); // (6) -unordered_map(const unordered_map& v, const allocator_type& a); // (7) +unordered_map(const unordered_map& v, const allocator_type& a); // (7) +unordered_map(const unordered_map& v, + const type_identity_t& a); // (7) C++23 -unordered_map(unordered_map&& rv, const allocator_type& a); // (8) +unordered_map(unordered_map&& rv, const allocator_type& a); // (8) +unordered_map(unordered_map&& rv, + const type_identity_t& a); // (8) C++23 unordered_map(initializer_list il, size_type n = 実装依存の既定値, @@ -86,6 +90,7 @@ unordered_map(std::from_range_t, R&& rg, const hasher& hf, const allocator_type& a); // (18) C++23 ``` +* type_identity_t[link /reference/type_traits/type_identity.md] * initializer_list[link /reference/initializer_list/initializer_list.md] * from_range_t[link ../../ranges/from_range_t.md] @@ -230,6 +235,9 @@ unordered_map(std::from_range_t, R&& rg, のようなコード(C++11 から導入された、コピーリスト初期化によるデフォルトコンストラクタ呼び出し)がエラーになってしまうためである。 +- C++23 では、(7) と (8) のアロケータパラメータの型が `const allocator_type&` から `const type_identity_t&` に変更された。 + これは、クラステンプレートのテンプレート引数推論 (CTAD) の際に、コピー/ムーブ元の `unordered_map` から推論される `Allocator` と、アロケータ引数から推論される型が異なる場合に推論が失敗する問題を修正するためである。[`type_identity_t`](/reference/type_traits/type_identity.md) で包むことで、アロケータ引数が非推論コンテキストとなり、アロケータの型はコピー/ムーブ元のみから推論されるようになる。 + ## バージョン ### 言語 @@ -261,3 +269,5 @@ libstdc++ には 4.8.2 現在、(6), (7), (8)の形式はない。 - [LWG 2210. Missing allocator-extended constructor for allocator-aware containers](http://cplusplus.github.io/LWG/lwg-defects.html#2210) (10), (11), (12), (13), (14), (15) を追加するきっかけとなったレポート なお、Discussion の例はアロケータの型が誤っているので注意 +- [P1518R2 Stop Overconstraining Allocators in Container Deduction Guides](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1518r2.html) + - C++23でのアロケータ引数を`type_identity_t`で包む変更 diff --git a/reference/unordered_map/unordered_multimap/op_constructor.md b/reference/unordered_map/unordered_multimap/op_constructor.md index b3aedaa5d8..02ab86d18f 100644 --- a/reference/unordered_map/unordered_multimap/op_constructor.md +++ b/reference/unordered_map/unordered_multimap/op_constructor.md @@ -31,9 +31,15 @@ unordered_multimap(unordered_multimap&& rv); // (5) explicit unordered_multimap(const allocator_type& a); // (6) -unordered_multimap(const unordered_multimap& v, const allocator_type& a); // (7) +unordered_multimap(const unordered_multimap& v, + const allocator_type& a); // (7) +unordered_multimap(const unordered_multimap& v, + const type_identity_t& a); // (7) C++23 -unordered_multimap(unordered_multimap&& rv, const allocator_type& a); // (8) +unordered_multimap(unordered_multimap&& rv, + const allocator_type& a); // (8) +unordered_multimap(unordered_multimap&& rv, + const type_identity_t& a); // (8) C++23 unordered_multimap(initializer_list il, size_type n = 実装依存の既定値, @@ -87,6 +93,7 @@ unordered_multimap(std::from_range_t, R&& rg, const hasher& hf, const allocator_type& a); // (18) C++23 ``` +* type_identity_t[link /reference/type_traits/type_identity.md] * initializer_list[link /reference/initializer_list/initializer_list.md] * from_range_t[link ../../ranges/from_range_t.md] @@ -234,6 +241,9 @@ unordered_multimap(std::from_range_t, R&& rg, のようなコード(C++11 から導入された、コピーリスト初期化によるデフォルトコンストラクタ呼び出し)がエラーになってしまうためである。 +- C++23 では、(7) と (8) のアロケータパラメータの型が `const allocator_type&` から `const type_identity_t&` に変更された。 + これは、クラステンプレートのテンプレート引数推論 (CTAD) の際に、コピー/ムーブ元の `unordered_multimap` から推論される `Allocator` と、アロケータ引数から推論される型が異なる場合に推論が失敗する問題を修正するためである。[`type_identity_t`](/reference/type_traits/type_identity.md) で包むことで、アロケータ引数が非推論コンテキストとなり、アロケータの型はコピー/ムーブ元のみから推論されるようになる。 + ## バージョン ### 言語 @@ -265,3 +275,5 @@ libstdc++ には 4.8.2 現在、(6), (7), (8)の形式はない。 - [LWG 2210. Missing allocator-extended constructor for allocator-aware containers](http://cplusplus.github.io/LWG/lwg-defects.html#2210) (10), (11), (12), (13), (14), (15) を追加するきっかけとなったレポート なお、Discussion の例はアロケータの型が誤っているので注意 +- [P1518R2 Stop Overconstraining Allocators in Container Deduction Guides](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1518r2.html) + - C++23でのアロケータ引数を`type_identity_t`で包む変更 diff --git a/reference/unordered_set/unordered_multiset/op_constructor.md b/reference/unordered_set/unordered_multiset/op_constructor.md index 3bd7bbed6f..8b7ca6561e 100644 --- a/reference/unordered_set/unordered_multiset/op_constructor.md +++ b/reference/unordered_set/unordered_multiset/op_constructor.md @@ -32,9 +32,15 @@ unordered_multiset(unordered_multiset&& rv); // (5) explicit unordered_multiset(const allocator_type& a); // (6) -unordered_multiset(const unordered_multiset& v, const allocator_type& a); // (7) +unordered_multiset(const unordered_multiset& v, + const allocator_type& a); // (7) +unordered_multiset(const unordered_multiset& v, + const type_identity_t& a); // (7) C++23 -unordered_multiset(unordered_multiset&& rv, const allocator_type& a); // (8) +unordered_multiset(unordered_multiset&& rv, + const allocator_type& a); // (8) +unordered_multiset(unordered_multiset&& rv, + const type_identity_t& a); // (8) C++23 unordered_multiset(initializer_list il, size_type n = 実装依存の既定値, @@ -88,6 +94,7 @@ unordered_multiset(std::from_range_t, R&& rg, const hasher& hf, const allocator_type& a); // (18) C++23 ``` +* type_identity_t[link /reference/type_traits/type_identity.md] * initializer_list[link /reference/initializer_list/initializer_list.md] * from_range_t[link ../../ranges/from_range_t.md] @@ -235,6 +242,9 @@ unordered_multiset(std::from_range_t, R&& rg, のようなコード(C++11 から導入された、コピーリスト初期化によるデフォルトコンストラクタ呼び出し)がエラーになってしまうためである。 +- C++23 では、(7) と (8) のアロケータパラメータの型が `const allocator_type&` から `const type_identity_t&` に変更された。 + これは、クラステンプレートのテンプレート引数推論 (CTAD) の際に、コピー/ムーブ元の `unordered_multiset` から推論される `Allocator` と、アロケータ引数から推論される型が異なる場合に推論が失敗する問題を修正するためである。[`type_identity_t`](/reference/type_traits/type_identity.md) で包むことで、アロケータ引数が非推論コンテキストとなり、アロケータの型はコピー/ムーブ元のみから推論されるようになる。 + ## バージョン ### 言語 @@ -266,3 +276,5 @@ libstdc++ には 4.8.2 現在、(6), (7), (8)の形式はない。 - [LWG 2210. Missing allocator-extended constructor for allocator-aware containers](http://cplusplus.github.io/LWG/lwg-defects.html#2210) (10), (11), (12), (13), (14), (15) を追加するきっかけとなったレポート なお、Discussion の例はアロケータの型が誤っているので注意 +- [P1518R2 Stop Overconstraining Allocators in Container Deduction Guides](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1518r2.html) + - C++23でのアロケータ引数を`type_identity_t`で包む変更 diff --git a/reference/unordered_set/unordered_set/op_constructor.md b/reference/unordered_set/unordered_set/op_constructor.md index a6048b8790..4ee4fba7a3 100644 --- a/reference/unordered_set/unordered_set/op_constructor.md +++ b/reference/unordered_set/unordered_set/op_constructor.md @@ -32,9 +32,13 @@ unordered_set(unordered_set&& rv); // (5) explicit unordered_set(const allocator_type& a); // (6) -unordered_set(const unordered_set& v, const allocator_type& a); // (7) +unordered_set(const unordered_set& v, const allocator_type& a); // (7) +unordered_set(const unordered_set& v, + const type_identity_t& a); // (7) C++23 -unordered_set(unordered_set&& rv, const allocator_type& a); // (8) +unordered_set(unordered_set&& rv, const allocator_type& a); // (8) +unordered_set(unordered_set&& rv, + const type_identity_t& a); // (8) C++23 unordered_set(initializer_list il, size_type n = 実装依存の既定値, @@ -88,6 +92,7 @@ unordered_set(std::from_range_t, R&& rg, const hasher& hf, const allocator_type& a); // (18) C++23 ``` +* type_identity_t[link /reference/type_traits/type_identity.md] * initializer_list[link /reference/initializer_list/initializer_list.md] * from_range_t[link ../../ranges/from_range_t.md] @@ -235,6 +240,9 @@ unordered_set(std::from_range_t, R&& rg, のようなコード(C++11 から導入された、コピーリスト初期化によるデフォルトコンストラクタ呼び出し)がエラーになってしまうためである。 +- C++23 では、(7) と (8) のアロケータパラメータの型が `const allocator_type&` から `const type_identity_t&` に変更された。 + これは、クラステンプレートのテンプレート引数推論 (CTAD) の際に、コピー/ムーブ元の `unordered_set` から推論される `Allocator` と、アロケータ引数から推論される型が異なる場合に推論が失敗する問題を修正するためである。[`type_identity_t`](/reference/type_traits/type_identity.md) で包むことで、アロケータ引数が非推論コンテキストとなり、アロケータの型はコピー/ムーブ元のみから推論されるようになる。 + ## バージョン ### 言語 @@ -266,3 +274,5 @@ libstdc++ には 4.8.2 現在、(6), (7), (8)の形式はない。 - [LWG 2210. Missing allocator-extended constructor for allocator-aware containers](http://cplusplus.github.io/LWG/lwg-defects.html#2210) (10), (11), (12), (13), (14), (15) を追加するきっかけとなったレポート なお、Discussion の例はアロケータの型が誤っているので注意 +- [P1518R2 Stop Overconstraining Allocators in Container Deduction Guides](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1518r2.html) + - C++23でのアロケータ引数を`type_identity_t`で包む変更 diff --git a/reference/vector/vector/op_constructor.md b/reference/vector/vector/op_constructor.md index 0e73477f47..9a353c82a0 100644 --- a/reference/vector/vector/op_constructor.md +++ b/reference/vector/vector/op_constructor.md @@ -46,11 +46,15 @@ vector(vector&& x); // (7) C++11 vector(vector&& x) noexcept; // (7) C++17 constexpr vector(vector&& x) noexcept; // (7) C++20 -vector(const vector& x, const Allocator& a); // (8) C++11 -constexpr vector(const vector& x, const Allocator& a); // (8) C++20 +vector(const vector& x, const Allocator& a); // (8) C++11 +constexpr vector(const vector& x, const Allocator& a); // (8) C++20 +constexpr vector(const vector& x, + const type_identity_t& a); // (8) C++23 -vector(vector&& x, const Allocator& a); // (9) C++11 -constexpr vector(vector&& x, const Allocator& a); // (9) C++20 +vector(vector&& x, const Allocator& a); // (9) C++11 +constexpr vector(vector&& x, const Allocator& a); // (9) C++20 +constexpr vector(vector&& x, + const type_identity_t& a); // (9) C++23 vector(initializer_list il, const Allocator& a = Allocator()); // (10) C++11 @@ -61,6 +65,7 @@ template R> constexpr vector(std::from_range_t, R&& rg, const Allocator& a = Allocator()); // (11) C++23 ``` +* type_identity_t[link /reference/type_traits/type_identity.md] * initializer_list[link /reference/initializer_list/initializer_list.md] * from_range_t[link ../../ranges/from_range_t.md] @@ -132,6 +137,9 @@ constexpr vector(std::from_range_t, R&& rg, * std::scoped_allocator_adaptor[link /reference/scoped_allocator/scoped_allocator_adaptor.md] * emplace_back[link /reference/list/list/emplace_back.md] +- C++23 では、(8) と (9) のアロケータパラメータの型が `const Allocator&` から `const type_identity_t&` に変更された。 + これは、クラステンプレートのテンプレート引数推論 (CTAD) の際に、コピー/ムーブ元の `vector` から推論される `Allocator` と、アロケータ引数から推論される型が異なる場合に推論が失敗する問題を修正するためである。[`type_identity_t`](/reference/type_traits/type_identity.md) で包むことで、アロケータ引数が非推論コンテキストとなり、アロケータの型はコピー/ムーブ元のみから推論されるようになる。 + ## 例 ```cpp example @@ -194,3 +202,5 @@ sixth : {1 2 3 } - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) - `noexcept` 追加の経緯となる提案文書 - [P1004R2 Making `std::vector` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1004r2.pdf) +- [P1518R2 Stop Overconstraining Allocators in Container Deduction Guides](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1518r2.html) + - C++23でのアロケータ引数を`type_identity_t`で包む変更 From 40c8ce3f4b0db391ecbfea8d690d01f27ef42225 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 17 Feb 2026 23:22:33 +0900 Subject: [PATCH 2614/3948] =?UTF-8?q?C++26=20vector=E3=81=A8string?= =?UTF-8?q?=E4=BB=A5=E5=A4=96=E3=81=AE=E3=82=B3=E3=83=B3=E3=83=86=E3=83=8A?= =?UTF-8?q?=E3=82=92constexpr=E5=AF=BE=E5=BF=9C=20=20(#1584)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/deque/deque/append_range.md | 10 +- reference/deque/deque/assign.md | 21 +- reference/deque/deque/assign_range.md | 10 +- reference/deque/deque/at.md | 15 +- reference/deque/deque/back.md | 15 +- reference/deque/deque/begin.md | 14 +- reference/deque/deque/cbegin.md | 4 +- reference/deque/deque/cend.md | 4 +- reference/deque/deque/clear.md | 16 +- reference/deque/deque/crbegin.md | 4 +- reference/deque/deque/crend.md | 4 +- reference/deque/deque/emplace.md | 5 +- reference/deque/deque/emplace_back.md | 8 +- reference/deque/deque/emplace_front.md | 8 +- reference/deque/deque/empty.md | 9 +- reference/deque/deque/end.md | 14 +- reference/deque/deque/erase.md | 7 +- reference/deque/deque/erase_free.md | 3 +- reference/deque/deque/erase_if_free.md | 7 +- reference/deque/deque/front.md | 11 +- reference/deque/deque/get_allocator.md | 6 +- reference/deque/deque/insert.md | 65 ++++- reference/deque/deque/insert_range.md | 8 +- reference/deque/deque/max_size.md | 9 +- reference/deque/deque/op_assign.md | 14 +- reference/deque/deque/op_at.md | 11 +- reference/deque/deque/op_compare_3way.md | 5 + reference/deque/deque/op_constructor.md | 74 +++-- reference/deque/deque/op_destructor.md | 7 +- reference/deque/deque/op_equal.md | 10 +- reference/deque/deque/op_greater.md | 10 +- reference/deque/deque/op_greater_equal.md | 10 +- reference/deque/deque/op_less.md | 10 +- reference/deque/deque/op_less_equal.md | 10 +- reference/deque/deque/op_not_equal.md | 10 +- reference/deque/deque/pop_back.md | 7 +- reference/deque/deque/pop_front.md | 7 +- reference/deque/deque/prepend_range.md | 10 +- reference/deque/deque/push_back.md | 8 +- reference/deque/deque/push_front.md | 8 +- reference/deque/deque/rbegin.md | 14 +- reference/deque/deque/rend.md | 14 +- reference/deque/deque/resize.md | 10 +- reference/deque/deque/shrink_to_fit.md | 4 +- reference/deque/deque/size.md | 9 +- reference/deque/deque/swap.md | 11 +- reference/deque/deque/swap_free.md | 17 +- reference/flat_map/flat_map/at.md | 26 +- reference/flat_map/flat_map/begin.md | 11 +- reference/flat_map/flat_map/cbegin.md | 7 +- reference/flat_map/flat_map/cend.md | 7 +- reference/flat_map/flat_map/clear.md | 7 +- reference/flat_map/flat_map/contains.md | 15 +- reference/flat_map/flat_map/count.md | 15 +- reference/flat_map/flat_map/crbegin.md | 7 +- reference/flat_map/flat_map/crend.md | 7 +- reference/flat_map/flat_map/emplace.md | 10 +- reference/flat_map/flat_map/emplace_hint.md | 12 +- reference/flat_map/flat_map/empty.md | 9 +- reference/flat_map/flat_map/end.md | 11 +- reference/flat_map/flat_map/equal_range.md | 24 +- reference/flat_map/flat_map/erase.md | 20 +- reference/flat_map/flat_map/erase_if_free.md | 15 +- reference/flat_map/flat_map/extract.md | 7 +- reference/flat_map/flat_map/find.md | 18 +- reference/flat_map/flat_map/insert.md | 87 ++++-- .../flat_map/flat_map/insert_or_assign.md | 43 ++- reference/flat_map/flat_map/insert_range.md | 8 +- reference/flat_map/flat_map/key_comp.md | 7 +- reference/flat_map/flat_map/key_equiv.md | 18 +- reference/flat_map/flat_map/keys.md | 7 +- reference/flat_map/flat_map/lower_bound.md | 18 +- reference/flat_map/flat_map/max_size.md | 7 +- reference/flat_map/flat_map/op_assign.md | 7 +- reference/flat_map/flat_map/op_at.md | 21 +- .../flat_map/flat_map/op_compare_3way.md | 7 + reference/flat_map/flat_map/op_constructor.md | 261 ++++++++++++++--- reference/flat_map/flat_map/op_equal.md | 7 +- reference/flat_map/flat_map/rbegin.md | 11 +- reference/flat_map/flat_map/rend.md | 11 +- reference/flat_map/flat_map/replace.md | 13 +- reference/flat_map/flat_map/size.md | 7 +- reference/flat_map/flat_map/swap.md | 7 +- reference/flat_map/flat_map/swap_free.md | 15 +- reference/flat_map/flat_map/try_emplace.md | 43 ++- reference/flat_map/flat_map/upper_bound.md | 18 +- reference/flat_map/flat_map/value_comp.md | 7 +- reference/flat_map/flat_map/values.md | 7 +- reference/flat_map/flat_multimap/begin.md | 11 +- reference/flat_map/flat_multimap/cbegin.md | 7 +- reference/flat_map/flat_multimap/cend.md | 7 +- reference/flat_map/flat_multimap/clear.md | 7 +- reference/flat_map/flat_multimap/contains.md | 15 +- reference/flat_map/flat_multimap/count.md | 15 +- reference/flat_map/flat_multimap/crbegin.md | 7 +- reference/flat_map/flat_multimap/crend.md | 7 +- reference/flat_map/flat_multimap/emplace.md | 10 +- .../flat_map/flat_multimap/emplace_hint.md | 12 +- reference/flat_map/flat_multimap/empty.md | 7 +- reference/flat_map/flat_multimap/end.md | 11 +- .../flat_map/flat_multimap/equal_range.md | 24 +- reference/flat_map/flat_multimap/erase.md | 20 +- .../flat_map/flat_multimap/erase_if_free.md | 15 +- reference/flat_map/flat_multimap/extract.md | 7 +- reference/flat_map/flat_multimap/find.md | 18 +- reference/flat_map/flat_multimap/insert.md | 71 +++-- .../flat_map/flat_multimap/insert_range.md | 8 +- reference/flat_map/flat_multimap/key_comp.md | 7 +- reference/flat_map/flat_multimap/key_equiv.md | 19 +- reference/flat_map/flat_multimap/keys.md | 7 +- .../flat_map/flat_multimap/lower_bound.md | 18 +- reference/flat_map/flat_multimap/max_size.md | 7 +- reference/flat_map/flat_multimap/op_assign.md | 7 +- .../flat_map/flat_multimap/op_compare_3way.md | 7 + .../flat_map/flat_multimap/op_constructor.md | 267 +++++++++++++++--- reference/flat_map/flat_multimap/op_equal.md | 7 +- reference/flat_map/flat_multimap/rbegin.md | 11 +- reference/flat_map/flat_multimap/rend.md | 11 +- reference/flat_map/flat_multimap/replace.md | 11 +- reference/flat_map/flat_multimap/size.md | 7 +- reference/flat_map/flat_multimap/swap.md | 7 +- reference/flat_map/flat_multimap/swap_free.md | 15 +- .../flat_map/flat_multimap/upper_bound.md | 18 +- .../flat_map/flat_multimap/value_comp.md | 7 +- reference/flat_map/flat_multimap/values.md | 7 +- reference/flat_set/flat_multiset/begin.md | 11 +- reference/flat_set/flat_multiset/cbegin.md | 7 +- reference/flat_set/flat_multiset/cend.md | 7 +- reference/flat_set/flat_multiset/clear.md | 7 +- reference/flat_set/flat_multiset/contains.md | 11 +- reference/flat_set/flat_multiset/count.md | 11 +- reference/flat_set/flat_multiset/crbegin.md | 7 +- reference/flat_set/flat_multiset/crend.md | 7 +- reference/flat_set/flat_multiset/emplace.md | 8 +- .../flat_set/flat_multiset/emplace_hint.md | 12 +- reference/flat_set/flat_multiset/empty.md | 7 +- reference/flat_set/flat_multiset/end.md | 11 +- .../flat_set/flat_multiset/equal_range.md | 24 +- reference/flat_set/flat_multiset/erase.md | 20 +- .../flat_set/flat_multiset/erase_if_free.md | 13 +- reference/flat_set/flat_multiset/extract.md | 7 +- reference/flat_set/flat_multiset/find.md | 18 +- reference/flat_set/flat_multiset/insert.md | 79 ++++-- .../flat_set/flat_multiset/insert_range.md | 8 +- reference/flat_set/flat_multiset/key_comp.md | 7 +- .../flat_set/flat_multiset/lower_bound.md | 18 +- reference/flat_set/flat_multiset/max_size.md | 7 +- reference/flat_set/flat_multiset/op_assign.md | 7 +- .../flat_set/flat_multiset/op_compare_3way.md | 7 + .../flat_set/flat_multiset/op_constructor.md | 252 ++++++++++++++--- reference/flat_set/flat_multiset/op_equal.md | 7 +- reference/flat_set/flat_multiset/rbegin.md | 11 +- reference/flat_set/flat_multiset/rend.md | 11 +- reference/flat_set/flat_multiset/replace.md | 7 +- reference/flat_set/flat_multiset/size.md | 7 +- reference/flat_set/flat_multiset/swap.md | 7 +- reference/flat_set/flat_multiset/swap_free.md | 13 +- .../flat_set/flat_multiset/upper_bound.md | 18 +- .../flat_set/flat_multiset/value_comp.md | 7 +- reference/flat_set/flat_set/begin.md | 11 +- reference/flat_set/flat_set/cbegin.md | 7 +- reference/flat_set/flat_set/cend.md | 7 +- reference/flat_set/flat_set/clear.md | 7 +- reference/flat_set/flat_set/contains.md | 11 +- reference/flat_set/flat_set/count.md | 11 +- reference/flat_set/flat_set/crbegin.md | 7 +- reference/flat_set/flat_set/crend.md | 7 +- reference/flat_set/flat_set/emplace.md | 8 +- reference/flat_set/flat_set/emplace_hint.md | 12 +- reference/flat_set/flat_set/empty.md | 7 +- reference/flat_set/flat_set/end.md | 11 +- reference/flat_set/flat_set/equal_range.md | 24 +- reference/flat_set/flat_set/erase.md | 20 +- reference/flat_set/flat_set/erase_if_free.md | 13 +- reference/flat_set/flat_set/extract.md | 7 +- reference/flat_set/flat_set/find.md | 18 +- reference/flat_set/flat_set/insert.md | 87 ++++-- reference/flat_set/flat_set/insert_range.md | 8 +- reference/flat_set/flat_set/key_comp.md | 7 +- reference/flat_set/flat_set/lower_bound.md | 18 +- reference/flat_set/flat_set/max_size.md | 7 +- reference/flat_set/flat_set/op_assign.md | 7 +- .../flat_set/flat_set/op_compare_3way.md | 7 + reference/flat_set/flat_set/op_constructor.md | 252 ++++++++++++++--- reference/flat_set/flat_set/op_equal.md | 7 +- reference/flat_set/flat_set/rbegin.md | 11 +- reference/flat_set/flat_set/rend.md | 11 +- reference/flat_set/flat_set/replace.md | 7 +- reference/flat_set/flat_set/size.md | 7 +- reference/flat_set/flat_set/swap.md | 7 +- reference/flat_set/flat_set/swap_free.md | 13 +- reference/flat_set/flat_set/upper_bound.md | 18 +- reference/flat_set/flat_set/value_comp.md | 7 +- reference/forward_list/forward_list/assign.md | 11 +- .../forward_list/forward_list/assign_range.md | 8 +- .../forward_list/forward_list/before_begin.md | 8 +- reference/forward_list/forward_list/begin.md | 8 +- .../forward_list/cbefore_begin.md | 4 +- reference/forward_list/forward_list/cbegin.md | 4 +- reference/forward_list/forward_list/cend.md | 4 +- reference/forward_list/forward_list/clear.md | 4 +- .../forward_list/emplace_after.md | 9 +- .../forward_list/emplace_front.md | 8 +- reference/forward_list/forward_list/empty.md | 7 +- reference/forward_list/forward_list/end.md | 8 +- .../forward_list/forward_list/erase_after.md | 15 +- .../forward_list/forward_list/erase_free.md | 3 +- .../forward_list/erase_if_free.md | 5 +- reference/forward_list/forward_list/front.md | 8 +- .../forward_list/get_allocator.md | 4 +- .../forward_list/forward_list/insert_after.md | 49 +++- .../forward_list/insert_range_after.md | 12 +- .../forward_list/forward_list/max_size.md | 4 +- reference/forward_list/forward_list/merge.md | 16 +- .../forward_list/forward_list/op_assign.md | 15 +- .../forward_list/op_compare_3way.md | 5 + .../forward_list/op_constructor.md | 74 +++-- .../forward_list/op_destructor.md | 4 +- .../forward_list/forward_list/op_equal.md | 4 + .../forward_list/forward_list/op_greater.md | 4 + .../forward_list/op_greater_equal.md | 4 + .../forward_list/forward_list/op_less.md | 4 + .../forward_list/op_less_equal.md | 4 + .../forward_list/forward_list/op_not_equal.md | 4 + .../forward_list/forward_list/pop_front.md | 4 +- .../forward_list/prepend_range.md | 8 +- .../forward_list/forward_list/push_front.md | 8 +- reference/forward_list/forward_list/remove.md | 6 +- .../forward_list/forward_list/remove_if.md | 8 +- reference/forward_list/forward_list/resize.md | 8 +- .../forward_list/forward_list/reverse.md | 4 +- reference/forward_list/forward_list/sort.md | 10 +- .../forward_list/forward_list/splice_after.md | 69 ++++- reference/forward_list/forward_list/swap.md | 19 +- .../forward_list/forward_list/swap_free.md | 19 +- reference/forward_list/forward_list/unique.md | 13 +- reference/list/list/append_range.md | 8 +- reference/list/list/assign.md | 12 +- reference/list/list/assign_range.md | 8 +- reference/list/list/back.md | 11 +- reference/list/list/begin.md | 12 +- reference/list/list/cbegin.md | 4 +- reference/list/list/cend.md | 4 +- reference/list/list/clear.md | 6 +- reference/list/list/crbegin.md | 4 +- reference/list/list/crend.md | 4 +- reference/list/list/emplace.md | 9 +- reference/list/list/emplace_back.md | 8 +- reference/list/list/emplace_front.md | 8 +- reference/list/list/empty.md | 9 +- reference/list/list/end.md | 12 +- reference/list/list/erase.md | 20 +- reference/list/list/erase_free.md | 3 +- reference/list/list/erase_if_free.md | 9 +- reference/list/list/front.md | 11 +- reference/list/list/get_allocator.md | 9 +- reference/list/list/insert.md | 68 +++-- reference/list/list/insert_range.md | 8 +- reference/list/list/max_size.md | 9 +- reference/list/list/merge.md | 27 +- reference/list/list/op_assign.md | 13 +- reference/list/list/op_compare_3way.md | 5 + reference/list/list/op_constructor.md | 75 +++-- reference/list/list/op_destructor.md | 4 +- reference/list/list/op_equal.md | 5 +- reference/list/list/op_greater.md | 4 + reference/list/list/op_greater_equal.md | 4 + reference/list/list/op_less.md | 4 + reference/list/list/op_less_equal.md | 4 + reference/list/list/op_not_equal.md | 4 + reference/list/list/pop_back.md | 7 +- reference/list/list/pop_front.md | 7 +- reference/list/list/prepend_range.md | 8 +- reference/list/list/push_back.md | 11 +- reference/list/list/push_front.md | 11 +- reference/list/list/rbegin.md | 12 +- reference/list/list/remove.md | 6 +- reference/list/list/remove_if.md | 8 +- reference/list/list/rend.md | 12 +- reference/list/list/resize.md | 14 +- reference/list/list/reverse.md | 9 +- reference/list/list/size.md | 6 +- reference/list/list/sort.md | 11 +- reference/list/list/splice.md | 76 +++-- reference/list/list/swap.md | 11 +- reference/list/list/swap_free.md | 17 +- reference/list/list/unique.md | 13 +- reference/map/map/at.md | 13 +- reference/map/map/begin.md | 14 +- reference/map/map/cbegin.md | 7 +- reference/map/map/cend.md | 7 +- reference/map/map/clear.md | 9 +- reference/map/map/contains.md | 8 +- reference/map/map/count.md | 8 +- reference/map/map/crbegin.md | 7 +- reference/map/map/crend.md | 7 +- reference/map/map/emplace.md | 5 +- reference/map/map/emplace_hint.md | 9 +- reference/map/map/empty.md | 9 +- reference/map/map/end.md | 14 +- reference/map/map/equal_range.md | 21 +- reference/map/map/erase.md | 21 +- reference/map/map/erase_if_free.md | 6 +- reference/map/map/extract.md | 11 +- reference/map/map/find.md | 15 +- reference/map/map/get_allocator.md | 9 +- reference/map/map/insert.md | 39 ++- reference/map/map/insert_or_assign.md | 40 ++- reference/map/map/insert_range.md | 8 +- reference/map/map/key_comp.md | 7 +- reference/map/map/lower_bound.md | 15 +- reference/map/map/max_size.md | 9 +- reference/map/map/merge.md | 20 +- reference/map/map/op_assign.md | 15 +- reference/map/map/op_at.md | 9 +- reference/map/map/op_compare_3way.md | 5 + reference/map/map/op_constructor.md | 69 ++++- reference/map/map/op_destructor.md | 7 +- reference/map/map/op_equal.md | 5 + reference/map/map/op_greater.md | 5 + reference/map/map/op_greater_equal.md | 7 +- reference/map/map/op_less.md | 5 + reference/map/map/op_less_equal.md | 5 + reference/map/map/op_not_equal.md | 5 + reference/map/map/rbegin.md | 14 +- reference/map/map/rend.md | 14 +- reference/map/map/size.md | 9 +- reference/map/map/swap.md | 15 +- reference/map/map/swap_free.md | 19 +- reference/map/map/try_emplace.md | 29 +- reference/map/map/upper_bound.md | 15 +- reference/map/map/value_comp.md | 7 +- reference/map/multimap/begin.md | 14 +- reference/map/multimap/cbegin.md | 7 +- reference/map/multimap/cend.md | 7 +- reference/map/multimap/clear.md | 9 +- reference/map/multimap/contains.md | 8 +- reference/map/multimap/count.md | 8 +- reference/map/multimap/crbegin.md | 7 +- reference/map/multimap/crend.md | 7 +- reference/map/multimap/emplace.md | 5 +- reference/map/multimap/emplace_hint.md | 9 +- reference/map/multimap/empty.md | 9 +- reference/map/multimap/end.md | 14 +- reference/map/multimap/equal_range.md | 21 +- reference/map/multimap/erase.md | 21 +- reference/map/multimap/erase_if_free.md | 6 +- reference/map/multimap/extract.md | 11 +- reference/map/multimap/find.md | 15 +- reference/map/multimap/get_allocator.md | 9 +- reference/map/multimap/insert.md | 38 ++- reference/map/multimap/insert_range.md | 8 +- reference/map/multimap/key_comp.md | 7 +- reference/map/multimap/lower_bound.md | 15 +- reference/map/multimap/max_size.md | 9 +- reference/map/multimap/merge.md | 20 +- reference/map/multimap/op_assign.md | 17 +- reference/map/multimap/op_compare_3way.md | 5 + reference/map/multimap/op_constructor.md | 82 ++++-- reference/map/multimap/op_destructor.md | 7 +- reference/map/multimap/op_equal.md | 5 + reference/map/multimap/op_greater.md | 5 + reference/map/multimap/op_greater_equal.md | 5 + reference/map/multimap/op_less.md | 5 + reference/map/multimap/op_less_equal.md | 5 + reference/map/multimap/op_not_equal.md | 5 + reference/map/multimap/rbegin.md | 14 +- reference/map/multimap/rend.md | 14 +- reference/map/multimap/size.md | 9 +- reference/map/multimap/swap.md | 15 +- reference/map/multimap/swap_free.md | 19 +- reference/map/multimap/upper_bound.md | 15 +- reference/map/multimap/value_comp.md | 7 +- reference/node_handle/node_handle/empty.md | 7 +- .../node_handle/node_handle/get_allocator.md | 4 +- reference/node_handle/node_handle/mapped.md | 4 +- .../node_handle/node_handle/op_assign.md | 4 +- reference/node_handle/node_handle/op_bool.md | 4 +- .../node_handle/node_handle/op_constructor.md | 8 +- .../node_handle/node_handle/op_destructor.md | 4 +- reference/node_handle/node_handle/swap.md | 10 +- .../node_handle/node_handle/swap_free.md | 8 +- reference/node_handle/node_handle/value.md | 4 +- reference/queue/priority_queue/emplace.md | 5 +- reference/queue/priority_queue/empty.md | 7 +- .../queue/priority_queue/op_constructor.md | 166 ++++++++--- reference/queue/priority_queue/pop.md | 4 +- reference/queue/priority_queue/push.md | 8 +- reference/queue/priority_queue/push_range.md | 8 +- reference/queue/priority_queue/size.md | 4 +- reference/queue/priority_queue/swap.md | 5 +- reference/queue/priority_queue/swap_free.md | 12 +- reference/queue/priority_queue/top.md | 7 +- reference/queue/queue/back.md | 11 +- reference/queue/queue/emplace.md | 8 +- reference/queue/queue/empty.md | 7 +- reference/queue/queue/front.md | 8 +- reference/queue/queue/op_compare_3way.md | 5 + reference/queue/queue/op_constructor.md | 59 +++- reference/queue/queue/op_equal.md | 5 +- reference/queue/queue/op_greater.md | 5 +- reference/queue/queue/op_greater_equal.md | 5 +- reference/queue/queue/op_less.md | 5 +- reference/queue/queue/op_less_equal.md | 5 +- reference/queue/queue/op_not_equal.md | 5 +- reference/queue/queue/pop.md | 4 +- reference/queue/queue/push.md | 8 +- reference/queue/queue/push_range.md | 8 +- reference/queue/queue/size.md | 4 +- reference/queue/queue/swap.md | 8 +- reference/queue/queue/swap_free.md | 11 +- reference/set/multiset/begin.md | 14 +- reference/set/multiset/cbegin.md | 7 +- reference/set/multiset/cend.md | 7 +- reference/set/multiset/clear.md | 9 +- reference/set/multiset/contains.md | 8 +- reference/set/multiset/count.md | 8 +- reference/set/multiset/crbegin.md | 7 +- reference/set/multiset/crend.md | 7 +- reference/set/multiset/emplace.md | 7 +- reference/set/multiset/emplace_hint.md | 5 +- reference/set/multiset/empty.md | 9 +- reference/set/multiset/end.md | 14 +- reference/set/multiset/equal_range.md | 21 +- reference/set/multiset/erase.md | 21 +- reference/set/multiset/erase_if_free.md | 6 +- reference/set/multiset/extract.md | 11 +- reference/set/multiset/find.md | 15 +- reference/set/multiset/get_allocator.md | 9 +- reference/set/multiset/insert.md | 30 +- reference/set/multiset/insert_range.md | 8 +- reference/set/multiset/key_comp.md | 7 +- reference/set/multiset/lower_bound.md | 15 +- reference/set/multiset/max_size.md | 9 +- reference/set/multiset/merge.md | 20 +- reference/set/multiset/op_assign.md | 16 +- reference/set/multiset/op_compare_3way.md | 5 + reference/set/multiset/op_constructor.md | 95 +++++-- reference/set/multiset/op_destructor.md | 7 +- reference/set/multiset/op_equal.md | 5 + reference/set/multiset/op_greater.md | 5 + reference/set/multiset/op_greater_equal.md | 5 + reference/set/multiset/op_less.md | 5 + reference/set/multiset/op_less_equal.md | 5 + reference/set/multiset/op_not_equal.md | 5 + reference/set/multiset/rbegin.md | 14 +- reference/set/multiset/rend.md | 14 +- reference/set/multiset/size.md | 9 +- reference/set/multiset/swap.md | 8 +- reference/set/multiset/swap_free.md | 19 +- reference/set/multiset/upper_bound.md | 15 +- reference/set/multiset/value_comp.md | 7 +- reference/set/set/begin.md | 14 +- reference/set/set/cbegin.md | 7 +- reference/set/set/cend.md | 7 +- reference/set/set/clear.md | 9 +- reference/set/set/contains.md | 8 +- reference/set/set/count.md | 8 +- reference/set/set/crbegin.md | 7 +- reference/set/set/crend.md | 7 +- reference/set/set/emplace.md | 5 +- reference/set/set/emplace_hint.md | 5 +- reference/set/set/empty.md | 9 +- reference/set/set/end.md | 14 +- reference/set/set/equal_range.md | 21 +- reference/set/set/erase.md | 21 +- reference/set/set/erase_if_free.md | 6 +- reference/set/set/extract.md | 11 +- reference/set/set/find.md | 15 +- reference/set/set/get_allocator.md | 9 +- reference/set/set/insert.md | 32 ++- reference/set/set/insert_range.md | 8 +- reference/set/set/key_comp.md | 7 +- reference/set/set/lower_bound.md | 15 +- reference/set/set/max_size.md | 9 +- reference/set/set/merge.md | 20 +- reference/set/set/op_assign.md | 14 +- reference/set/set/op_compare_3way.md | 5 + reference/set/set/op_constructor.md | 90 ++++-- reference/set/set/op_destructor.md | 7 +- reference/set/set/op_equal.md | 5 + reference/set/set/op_greater.md | 5 + reference/set/set/op_greater_equal.md | 5 + reference/set/set/op_less.md | 5 + reference/set/set/op_less_equal.md | 5 + reference/set/set/op_not_equal.md | 5 + reference/set/set/rbegin.md | 14 +- reference/set/set/rend.md | 14 +- reference/set/set/size.md | 9 +- reference/set/set/swap.md | 8 +- reference/set/set/swap_free.md | 19 +- reference/set/set/upper_bound.md | 15 +- reference/set/set/value_comp.md | 7 +- reference/stack/stack/emplace.md | 8 +- reference/stack/stack/empty.md | 7 +- reference/stack/stack/op_assign.md | 11 +- reference/stack/stack/op_compare_3way.md | 5 + reference/stack/stack/op_constructor.md | 54 +++- reference/stack/stack/op_destructor.md | 7 +- reference/stack/stack/op_equal.md | 5 +- reference/stack/stack/op_greater.md | 5 +- reference/stack/stack/op_greater_equal.md | 5 +- reference/stack/stack/op_less.md | 5 +- reference/stack/stack/op_less_equal.md | 5 +- reference/stack/stack/op_not_equal.md | 5 +- reference/stack/stack/pop.md | 7 +- reference/stack/stack/push.md | 11 +- reference/stack/stack/push_range.md | 8 +- reference/stack/stack/size.md | 7 +- reference/stack/stack/swap.md | 4 +- reference/stack/stack/swap_free.md | 14 +- reference/stack/stack/top.md | 11 +- reference/unordered_map/unordered_map/at.md | 13 +- .../unordered_map/begin-size_type.md | 11 +- .../unordered_map/unordered_map/begin.md | 11 +- .../unordered_map/unordered_map/bucket.md | 6 +- .../unordered_map/bucket_count.md | 7 +- .../unordered_map/bucket_size.md | 7 +- .../unordered_map/cbegin-size_type.md | 7 +- .../unordered_map/unordered_map/cbegin.md | 7 +- .../unordered_map/cend-size_type.md | 7 +- reference/unordered_map/unordered_map/cend.md | 7 +- .../unordered_map/unordered_map/clear.md | 7 +- .../unordered_map/unordered_map/contains.md | 8 +- .../unordered_map/unordered_map/count.md | 8 +- .../unordered_map/unordered_map/emplace.md | 5 +- .../unordered_map/emplace_hint.md | 5 +- .../unordered_map/unordered_map/empty.md | 7 +- .../unordered_map/end-size_type.md | 11 +- reference/unordered_map/unordered_map/end.md | 11 +- .../unordered_map/equal_range.md | 19 +- .../unordered_map/unordered_map/erase.md | 13 +- .../unordered_map/erase_if_free.md | 6 +- .../unordered_map/unordered_map/extract.md | 8 +- reference/unordered_map/unordered_map/find.md | 15 +- .../unordered_map/get_allocator.md | 7 +- .../unordered_map/hash_function.md | 7 +- .../unordered_map/unordered_map/insert.md | 37 ++- .../unordered_map/insert_or_assign.md | 35 ++- .../unordered_map/insert_range.md | 8 +- .../unordered_map/unordered_map/key_eq.md | 7 +- .../unordered_map/load_factor.md | 7 +- .../unordered_map/max_bucket_count.md | 7 +- .../unordered_map/max_load_factor.md | 11 +- .../unordered_map/unordered_map/max_size.md | 7 +- .../unordered_map/unordered_map/merge.md | 20 +- .../unordered_map/unordered_map/op_assign.md | 17 +- .../unordered_map/unordered_map/op_at.md | 9 +- .../unordered_map/op_constructor.md | 141 +++++++-- .../unordered_map/op_destructor.md | 7 +- .../unordered_map/unordered_map/op_equal.md | 4 + .../unordered_map/op_not_equal.md | 4 + .../unordered_map/unordered_map/rehash.md | 4 +- .../unordered_map/unordered_map/reserve.md | 4 +- reference/unordered_map/unordered_map/size.md | 7 +- reference/unordered_map/unordered_map/swap.md | 9 +- .../unordered_map/unordered_map/swap_free.md | 23 +- .../unordered_map/try_emplace.md | 35 ++- .../unordered_multimap/begin-size_type.md | 11 +- .../unordered_map/unordered_multimap/begin.md | 11 +- .../unordered_multimap/bucket.md | 5 +- .../unordered_multimap/bucket_count.md | 7 +- .../unordered_multimap/bucket_size.md | 7 +- .../unordered_multimap/cbegin-size_type.md | 7 +- .../unordered_multimap/cbegin.md | 7 +- .../unordered_multimap/cend-size_type.md | 7 +- .../unordered_map/unordered_multimap/cend.md | 7 +- .../unordered_map/unordered_multimap/clear.md | 7 +- .../unordered_multimap/contains.md | 8 +- .../unordered_map/unordered_multimap/count.md | 8 +- .../unordered_multimap/emplace.md | 5 +- .../unordered_multimap/emplace_hint.md | 5 +- .../unordered_map/unordered_multimap/empty.md | 7 +- .../unordered_multimap/end-size_type.md | 11 +- .../unordered_map/unordered_multimap/end.md | 11 +- .../unordered_multimap/equal_range.md | 19 +- .../unordered_map/unordered_multimap/erase.md | 13 +- .../unordered_multimap/erase_if_free.md | 6 +- .../unordered_multimap/extract.md | 8 +- .../unordered_map/unordered_multimap/find.md | 15 +- .../unordered_multimap/get_allocator.md | 7 +- .../unordered_multimap/hash_function.md | 7 +- .../unordered_multimap/insert.md | 37 ++- .../unordered_multimap/insert_range.md | 8 +- .../unordered_multimap/key_eq.md | 7 +- .../unordered_multimap/load_factor.md | 7 +- .../unordered_multimap/max_bucket_count.md | 7 +- .../unordered_multimap/max_load_factor.md | 11 +- .../unordered_multimap/max_size.md | 7 +- .../unordered_map/unordered_multimap/merge.md | 20 +- .../unordered_multimap/op_assign.md | 17 +- .../unordered_multimap/op_constructor.md | 142 +++++++--- .../unordered_multimap/op_destructor.md | 7 +- .../unordered_multimap/op_equal.md | 4 + .../unordered_multimap/op_not_equal.md | 4 + .../unordered_multimap/rehash.md | 4 +- .../unordered_multimap/reserve.md | 4 +- .../unordered_map/unordered_multimap/size.md | 7 +- .../unordered_map/unordered_multimap/swap.md | 9 +- .../unordered_multimap/swap_free.md | 23 +- .../unordered_multiset/begin-size_type.md | 11 +- .../unordered_set/unordered_multiset/begin.md | 11 +- .../unordered_multiset/bucket.md | 6 +- .../unordered_multiset/bucket_count.md | 7 +- .../unordered_multiset/bucket_size.md | 7 +- .../unordered_multiset/cbegin-size_type.md | 7 +- .../unordered_multiset/cbegin.md | 7 +- .../unordered_multiset/cend-size_type.md | 7 +- .../unordered_set/unordered_multiset/cend.md | 7 +- .../unordered_set/unordered_multiset/clear.md | 7 +- .../unordered_multiset/contains.md | 8 +- .../unordered_set/unordered_multiset/count.md | 8 +- .../unordered_multiset/emplace.md | 5 +- .../unordered_multiset/emplace_hint.md | 5 +- .../unordered_set/unordered_multiset/empty.md | 7 +- .../unordered_multiset/end-size_type.md | 11 +- .../unordered_set/unordered_multiset/end.md | 11 +- .../unordered_multiset/equal_range.md | 19 +- .../unordered_set/unordered_multiset/erase.md | 13 +- .../unordered_multiset/erase_if_free.md | 6 +- .../unordered_multiset/extract.md | 8 +- .../unordered_set/unordered_multiset/find.md | 15 +- .../unordered_multiset/get_allocator.md | 7 +- .../unordered_multiset/hash_function.md | 7 +- .../unordered_multiset/insert.md | 29 +- .../unordered_multiset/insert_range.md | 8 +- .../unordered_multiset/key_eq.md | 7 +- .../unordered_multiset/load_factor.md | 7 +- .../unordered_multiset/max_bucket_count.md | 7 +- .../unordered_multiset/max_load_factor.md | 11 +- .../unordered_multiset/max_size.md | 7 +- .../unordered_set/unordered_multiset/merge.md | 20 +- .../unordered_multiset/op_assign.md | 15 +- .../unordered_multiset/op_constructor.md | 152 +++++++--- .../unordered_multiset/op_destructor.md | 7 +- .../unordered_multiset/op_equal.md | 4 + .../unordered_multiset/op_not_equal.md | 4 + .../unordered_multiset/rehash.md | 7 +- .../unordered_multiset/reserve.md | 7 +- .../unordered_set/unordered_multiset/size.md | 7 +- .../unordered_set/unordered_multiset/swap.md | 9 +- .../unordered_multiset/swap_free.md | 19 +- .../unordered_set/begin-size_type.md | 11 +- .../unordered_set/unordered_set/begin.md | 11 +- .../unordered_set/unordered_set/bucket.md | 6 +- .../unordered_set/bucket_count.md | 7 +- .../unordered_set/bucket_size.md | 7 +- .../unordered_set/cbegin-size_type.md | 7 +- .../unordered_set/unordered_set/cbegin.md | 7 +- .../unordered_set/cend-size_type.md | 7 +- reference/unordered_set/unordered_set/cend.md | 7 +- .../unordered_set/unordered_set/clear.md | 7 +- .../unordered_set/unordered_set/contains.md | 8 +- .../unordered_set/unordered_set/count.md | 8 +- .../unordered_set/unordered_set/emplace.md | 5 +- .../unordered_set/emplace_hint.md | 5 +- .../unordered_set/unordered_set/empty.md | 7 +- .../unordered_set/end-size_type.md | 11 +- reference/unordered_set/unordered_set/end.md | 11 +- .../unordered_set/equal_range.md | 19 +- .../unordered_set/unordered_set/erase.md | 13 +- .../unordered_set/erase_if_free.md | 6 +- .../unordered_set/unordered_set/extract.md | 8 +- reference/unordered_set/unordered_set/find.md | 15 +- .../unordered_set/get_allocator.md | 7 +- .../unordered_set/hash_function.md | 7 +- .../unordered_set/unordered_set/insert.md | 49 +++- .../unordered_set/insert_range.md | 8 +- .../unordered_set/unordered_set/key_eq.md | 7 +- .../unordered_set/load_factor.md | 7 +- .../unordered_set/max_bucket_count.md | 7 +- .../unordered_set/max_load_factor.md | 11 +- .../unordered_set/unordered_set/max_size.md | 7 +- .../unordered_set/unordered_set/merge.md | 20 +- .../unordered_set/unordered_set/op_assign.md | 15 +- .../unordered_set/op_constructor.md | 152 +++++++--- .../unordered_set/op_destructor.md | 7 +- .../unordered_set/unordered_set/op_equal.md | 4 + .../unordered_set/op_not_equal.md | 4 + .../unordered_set/unordered_set/rehash.md | 7 +- .../unordered_set/unordered_set/reserve.md | 7 +- reference/unordered_set/unordered_set/size.md | 7 +- reference/unordered_set/unordered_set/swap.md | 9 +- .../unordered_set/unordered_set/swap_free.md | 10 +- 684 files changed, 7646 insertions(+), 1981 deletions(-) diff --git a/reference/deque/deque/append_range.md b/reference/deque/deque/append_range.md index 55c179eb6a..d52b9af8ca 100644 --- a/reference/deque/deque/append_range.md +++ b/reference/deque/deque/append_range.md @@ -7,7 +7,11 @@ ```cpp template R> -void append_range(R&& rg); // C++23 +void + append_range(R&& rg); // (1) C++23 +template R> +constexpr void + append_range(R&& rg); // (1) C++26 ``` ## 概要 @@ -63,3 +67,7 @@ int main() |-------------------------------------------|----------------------| | [`push_back`](push_back.md) | 末尾に要素を追加する | | [`emplace_back`](emplace_back.md) | 末尾に要素を直接構築で追加する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/assign.md b/reference/deque/deque/assign.md index 9ce80c50a6..a339584cf9 100644 --- a/reference/deque/deque/assign.md +++ b/reference/deque/deque/assign.md @@ -6,11 +6,21 @@ ```cpp template -void assign(InputIterator first, InputIterator last); // (1) - -void assign(size_type n, const T& t); // (2) - -void assign(initializer_list init); // (3) C++11 +void + assign(InputIterator first, InputIterator last); // (1) C++03 +template +constexpr void + assign(InputIterator first, InputIterator last); // (1) C++26 + +void + assign(size_type n, const T& t); // (2) C++03 +constexpr void + assign(size_type n, const T& t); // (2) C++26 + +void + assign(initializer_list init); // (3) C++11 +constexpr void + assign(initializer_list init); // (3) C++26 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -73,3 +83,4 @@ c3 : {1 2 3 } ## 参照 - [N2679 Initializer Lists for Standard Containers(Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2679.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/assign_range.md b/reference/deque/deque/assign_range.md index 195f38acd1..439a0fb2ce 100644 --- a/reference/deque/deque/assign_range.md +++ b/reference/deque/deque/assign_range.md @@ -7,7 +7,11 @@ ```cpp template R> -void assign_range(R&& rg); // C++23 +void + assign_range(R&& rg); // (1) C++23 +template R> +constexpr void + assign_range(R&& rg); // (1) C++26 ``` ## 概要 @@ -62,3 +66,7 @@ int main() | 名前 | 説明 | |-------------------------------------------|----------------------| | [`assign`](assign.md) | コンテナに値を代入する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/at.md b/reference/deque/deque/at.md index f3274d18d2..07f81c135b 100644 --- a/reference/deque/deque/at.md +++ b/reference/deque/deque/at.md @@ -5,8 +5,15 @@ * function[meta id-type] ```cpp -reference at(size_type n); -const_reference at(size_type n) const; +reference + at(size_type n); // (1) C++03 +constexpr + reference at(size_type n); // (1) C++26 + +const_reference + at(size_type n) const; // (2) C++03 +constexpr const_reference + at(size_type n) const; // (2) C++26 ``` ## 概要 @@ -68,3 +75,7 @@ out of range! | 名前 | 説明 | |----------------------------|----------------------------------| | [`operator[]`](op_at.md) | 任意位置の要素への参照を取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/back.md b/reference/deque/deque/back.md index b606854ddf..a8efffd1c9 100644 --- a/reference/deque/deque/back.md +++ b/reference/deque/deque/back.md @@ -5,8 +5,15 @@ * function[meta id-type] ```cpp -reference back(); -const_reference back() const; +reference + back(); // (1) C++03 +constexpr reference + back(); // (1) C++26 + +const_reference + back() const; // (2) C++03 +constexpr const_reference + back() const; // (2) C++26 ``` ## 概要 @@ -53,3 +60,7 @@ int main() | [`front`](front.md) | 先頭要素への参照を取得する | | [`push_back`](push_back.md) | 末尾に要素を追加する | | [`pop_back`](pop_back.md) | 末尾要素を削除する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/begin.md b/reference/deque/deque/begin.md index d2dee08e17..26047a3194 100644 --- a/reference/deque/deque/begin.md +++ b/reference/deque/deque/begin.md @@ -5,11 +5,13 @@ * function[meta id-type] ```cpp -iterator begin(); // (1) C++03 -iterator begin() noexcept; // (1) C++11 +iterator begin(); // (1) C++03 +iterator begin() noexcept; // (1) C++11 +constexpr iterator begin() noexcept; // (1) C++26 -const_iterator begin() const; // (2) C++03 -const_iterator begin() const noexcept; // (2) C++11 +const_iterator begin() const; // (2) C++03 +const_iterator begin() const noexcept; // (2) C++11 +constexpr const_iterator begin() const noexcept; // (2) C++26 ``` ## 概要 @@ -63,3 +65,7 @@ int main() | [`cend`](cend.md) | 末尾要素を指す読み取り専用イテレータを取得する | | [`rbegin`](rbegin.md) | 末尾要素を指す逆イテレータを取得する | | [`rend`](rend.md) | 先頭要素の前を指す逆イテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/cbegin.md b/reference/deque/deque/cbegin.md index b1ebb85fec..61cac5cc71 100644 --- a/reference/deque/deque/cbegin.md +++ b/reference/deque/deque/cbegin.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_iterator cbegin() const noexcept; +const_iterator cbegin() const noexcept; // (1) C++11 +constexpr const_iterator cbegin() const noexcept; // (1) C++26 ``` ## 概要 @@ -67,3 +68,4 @@ int main() - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified] ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/cend.md b/reference/deque/deque/cend.md index 27f6c440c2..2622af7442 100644 --- a/reference/deque/deque/cend.md +++ b/reference/deque/deque/cend.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_iterator cend() const noexcept; +const_iterator cend() const noexcept; // (1) C++11 +constexpr const_iterator cend() const noexcept; // (1) C++26 ``` ## 概要 @@ -71,3 +72,4 @@ int main() ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/clear.md b/reference/deque/deque/clear.md index 14f361df62..5ad9166694 100644 --- a/reference/deque/deque/clear.md +++ b/reference/deque/deque/clear.md @@ -5,8 +5,9 @@ * function[meta id-type] ```cpp -void clear(); // C++03 -void clear() noexcept; // C++11 +void clear(); // (1) C++03 +void clear() noexcept; // (1) C++11 +constexpr void clear() noexcept; // (1) C++26 ``` ## 概要 @@ -58,11 +59,6 @@ int main() ``` ``` -## 参照 -- [LWG Issue 2231. DR 704 removes complexity guarantee for `clear()`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2231) - - C++03までこの関数の効果は`erase(begin(), end())`だったため、それによって線形時間の計算量が保証されていたが、C++11で効果の表記が変わったために、保証がなくなってしまっていた。C++14であらためて保証を追加。 - - ## 関連項目 | 名前 | 説明 | @@ -72,3 +68,9 @@ int main() | [`pop_back`](pop_back.md) | 末尾要素を削除する | | [`pop_front`](pop_front.md) | 先頭要素を削除する | | [`empty`](empty.md) | コンテナが空であるかどうかを調べる | + + +## 参照 +- [LWG Issue 2231. DR 704 removes complexity guarantee for `clear()`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2231) + - C++03までこの関数の効果は`erase(begin(), end())`だったため、それによって線形時間の計算量が保証されていたが、C++11で効果の表記が変わったために、保証がなくなってしまっていた。C++14であらためて保証を追加。 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/crbegin.md b/reference/deque/deque/crbegin.md index c8b733ea59..79d9ad654e 100644 --- a/reference/deque/deque/crbegin.md +++ b/reference/deque/deque/crbegin.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_reverse_iterator crbegin() const noexcept; +const_reverse_iterator crbegin() const noexcept; // (1) C++11 +constexpr const_reverse_iterator crbegin() const noexcept; // (1) C++26 ``` ## 概要 @@ -67,3 +68,4 @@ int main() ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/crend.md b/reference/deque/deque/crend.md index 67827fcc28..55fed562fc 100644 --- a/reference/deque/deque/crend.md +++ b/reference/deque/deque/crend.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_reverse_iterator crend() const noexcept; +const_reverse_iterator crend() const noexcept; // (1) C++11 +constexpr const_reverse_iterator crend() const noexcept; // (1) C++26 ``` ## 概要 @@ -67,3 +68,4 @@ int main() ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/emplace.md b/reference/deque/deque/emplace.md index 8df8398677..d0ec578959 100644 --- a/reference/deque/deque/emplace.md +++ b/reference/deque/deque/emplace.md @@ -7,7 +7,9 @@ ```cpp template -iterator emplace(const_iterator position, Args&&... args); +iterator emplace(const_iterator position, Args&&... args); // (1) C++11 +template +constexpr iterator emplace(const_iterator position, Args&&... args); // (1) C++26 ``` ## 概要 @@ -85,3 +87,4 @@ int main() - [N2345 Placement Insert for Containers (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2345.pdf) - [LWG Issue 2252. Strong guarantee on `vector::push_back()` still broken with C++11?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2252) - 経緯の説明は、[`vector::push_back()`](/reference/vector/vector/push_back.md)ページを参照。 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/emplace_back.md b/reference/deque/deque/emplace_back.md index 8592139a5e..ca7bdb22f0 100644 --- a/reference/deque/deque/emplace_back.md +++ b/reference/deque/deque/emplace_back.md @@ -7,10 +7,11 @@ ```cpp template -void emplace_back(Args&&... args); // C++14 まで - +void emplace_back(Args&&... args); // (1) C++11 +template +reference emplace_back(Args&&... args); // (1) C++17 template -reference emplace_back(Args&&... args); // C++17 から +constexpr reference emplace_back(Args&&... args); // (1) C++26 ``` ## 概要 @@ -94,3 +95,4 @@ int main() - [P0084R0 Emplace Return Type](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0084r0.pdf) - [P0084R1 Emplace Return Type (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0084r1.pdf) - [P0084R2 Emplace Return Type (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0084r2.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/emplace_front.md b/reference/deque/deque/emplace_front.md index aff678682f..b13735086a 100644 --- a/reference/deque/deque/emplace_front.md +++ b/reference/deque/deque/emplace_front.md @@ -7,10 +7,11 @@ ```cpp template -void emplace_front(Args&&... args); // C++14 まで - +void emplace_front(Args&&... args); // (1) C++11 +template +reference emplace_front(Args&&... args); // (1) C++17 template -reference emplace_front(Args&&... args); // C++17 から +constexpr reference emplace_front(Args&&... args); // (1) C++26 ``` ## 概要 @@ -94,3 +95,4 @@ int main() - [P0084R0 Emplace Return Type](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0084r0.pdf) - [P0084R1 Emplace Return Type (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0084r1.pdf) - [P0084R2 Emplace Return Type (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0084r2.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/empty.md b/reference/deque/deque/empty.md index 7babfe8ab3..e1421e050d 100644 --- a/reference/deque/deque/empty.md +++ b/reference/deque/deque/empty.md @@ -5,10 +5,10 @@ * function[meta id-type] ```cpp -bool empty() const; // C++03 -bool empty() const noexcept; // C++11 -[[nodiscard]] bool empty() const noexcept; // C++20 -bool empty() const noexcept; // C++26 +bool empty() const; // (1) C++03 +bool empty() const noexcept; // (1) C++11 +[[nodiscard]] bool empty() const noexcept; // (1) C++20 +constexpr bool empty() const noexcept; // (1) C++26 ``` ## 概要 @@ -70,3 +70,4 @@ false - C++20で`[[nodiscard]]`が付加された - [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) - C++26で`[[nodiscard]]`指定が削除された +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/end.md b/reference/deque/deque/end.md index 245a33ef4d..b329000038 100644 --- a/reference/deque/deque/end.md +++ b/reference/deque/deque/end.md @@ -5,11 +5,13 @@ * function[meta id-type] ```cpp -iterator end(); // (1) C++03 -iterator end() noexcept; // (1) C++11 +iterator end(); // (1) C++03 +iterator end() noexcept; // (1) C++11 +constexpr iterator end() noexcept; // (1) C++26 -const_iterator end() const; // (2) C++03 -const_iterator end() const noexcept; // (2) C++11 +const_iterator end() const; // (2) C++03 +const_iterator end() const noexcept; // (2) C++11 +constexpr const_iterator end() const noexcept; // (2) C++26 ``` ## 概要 @@ -80,3 +82,7 @@ int main() | [`cend`](cend.md) | 末尾要素の次を指す読み取り専用イテレータを取得する | | [`rbegin`](rbegin.md) | 末尾要素を指す逆イテレータを取得する | | [`rend`](rend.md) | 先頭要素の前を指す逆イテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/erase.md b/reference/deque/deque/erase.md index 4c4386632f..327cae3623 100644 --- a/reference/deque/deque/erase.md +++ b/reference/deque/deque/erase.md @@ -7,9 +7,11 @@ ```cpp iterator erase(iterator position); // (1) C++03 iterator erase(const_iterator position); // (1) C++11 +constexpr iterator erase(const_iterator position); // (1) C++26 -iterator erase(iterator first, iterator last); // (2) C++03 -iterator erase(const_iterator first, const_iterator last); // (2) C++11 +iterator erase(iterator first, iterator last); // (2) C++03 +iterator erase(const_iterator first, const_iterator last); // (2) C++11 +constexpr iterator erase(const_iterator first, const_iterator last); // (2) C++26 ``` ## 概要 @@ -110,3 +112,4 @@ int main() ## 参照 - [N2350 Container insert/erase and iterator constness (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2350.pdf) - [LWG Issue 638. `deque` end invalidation during erase](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#638) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/erase_free.md b/reference/deque/deque/erase_free.md index de73078d4a..f3859d3455 100644 --- a/reference/deque/deque/erase_free.md +++ b/reference/deque/deque/erase_free.md @@ -10,7 +10,7 @@ namespace std { typename deque::size_type erase(deque& c, const U& value); // (1) C++20 template - typename deque::size_type + constexpr typename deque::size_type erase(deque& c, const U& value); // (1) C++26 } ``` @@ -117,3 +117,4 @@ int main() { - [R1115R3 Improving the Return Value of Erase-Like Algorithms II: Free `erase`/`erase_if`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1115r3.pdf) - [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) - C++26で波カッコ初期化 (リスト初期化) に対応した +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/erase_if_free.md b/reference/deque/deque/erase_if_free.md index 0e8e34c544..7913cfc71e 100644 --- a/reference/deque/deque/erase_if_free.md +++ b/reference/deque/deque/erase_if_free.md @@ -7,7 +7,11 @@ ```cpp namespace std { template - typename deque::size_type erase_if(deque& c, Predicate pred); + typename deque::size_type + erase_if(deque& c, Predicate pred); // (1) C++20 + template + constexpr typename deque::size_type + erase_if(deque& c, Predicate pred); // (1) C++26 } ``` @@ -74,3 +78,4 @@ int main() ## 参照 - [P1209R0 Adopt consistent container erasure from Library Fundamentals 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1209r0.html) - [R1115R3 Improving the Return Value of Erase-Like Algorithms II: Free `erase`/`erase_if`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1115r3.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/front.md b/reference/deque/deque/front.md index b8a0bff709..78b038eae9 100644 --- a/reference/deque/deque/front.md +++ b/reference/deque/deque/front.md @@ -5,8 +5,11 @@ * function[meta id-type] ```cpp -reference front(); -const_reference front() const; +reference front(); // (1) C++03 +constexpr reference front(); // (1) C++26 + +const_reference front() const; // (2) C++03 +constexpr const_reference front() const; // (2) C++26 ``` ## 概要 @@ -53,3 +56,7 @@ int main() | [`back`](back.md) | 末尾要素への参照を取得する | | [`push_front`](push_front.md) | 先頭に要素を追加する | | [`pop_front`](pop_front.md) | 先頭要素を削除する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/get_allocator.md b/reference/deque/deque/get_allocator.md index c49b963d7d..a29fb82635 100644 --- a/reference/deque/deque/get_allocator.md +++ b/reference/deque/deque/get_allocator.md @@ -5,8 +5,9 @@ * function[meta id-type] ```cpp -allocator_type get_allocator() const; // C++03 -allocator_type get_allocator() const noexcept; // C++11 +allocator_type get_allocator() const; // (1) C++03 +allocator_type get_allocator() const noexcept; // (1) C++11 +constexpr allocator_type get_allocator() const noexcept; // (1) C++26 ``` ## 概要 @@ -70,3 +71,4 @@ int main () - 2015からは、`noexcept`が修飾されている。 ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/insert.md b/reference/deque/deque/insert.md index bb3183637c..7f68c56274 100644 --- a/reference/deque/deque/insert.md +++ b/reference/deque/deque/insert.md @@ -5,24 +5,58 @@ * function[meta id-type] ```cpp -iterator insert(iterator position, const T& x); // (1) C++03 -iterator insert(const_iterator position, const T& x); // (1) C++11 - -iterator insert(const_iterator position, T&& y); // (2) C++11 - -void insert(iterator position, - size_type n, const T& x); // (3) C++03 -iterator insert(const_iterator position, - size_type n, const T& x); // (3) C++11 +iterator + insert(iterator position, + const T& x); // (1) C++03 +iterator + insert(const_iterator position, + const T& x); // (1) C++11 +constexpr iterator + insert(const_iterator position, + const T& x); // (1) C++26 + +iterator + insert(const_iterator position, + T&& y); // (2) C++11 +constexpr iterator + insert(const_iterator position, + T&& y); // (2) C++26 + +void + insert(iterator position, + size_type n, + const T& x); // (3) C++03 +iterator + insert(const_iterator position, + size_type n, + const T& x); // (3) C++11 +constexpr iterator + insert(const_iterator position, + size_type n, + const T& x); // (3) C++26 template -void insert(iterator position, - InputIterator first, InputIterator last); // (4) C++03 +void + insert(iterator position, + InputIterator first, + InputIterator last); // (4) C++03 template -iterator insert(const_iterator position, - InputIterator first, InputIterator last); // (4) C++11 - -iterator insert(const_iterator position, initializer_list init); // (5) C++11 +iterator + insert(const_iterator position, + InputIterator first, + InputIterator last); // (4) C++11 +template +constexpr iterator + insert(const_iterator position, + InputIterator first, + InputIterator last); // (4) C++26 + +iterator + insert(const_iterator position, + initializer_list init); // (5) C++11 +constexpr iterator + insert(const_iterator position, + initializer_list init); // (5) C++26 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -103,3 +137,4 @@ int main() - (5)の経緯となる提案文書 - [LWG Issue 2252. Strong guarantee on `vector::push_back()` still broken with C++11?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2252) - 経緯の説明は、[`vector::push_back()`](/reference/vector/vector/push_back.md)ページを参照。 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/insert_range.md b/reference/deque/deque/insert_range.md index 71de3fc2d0..deb5c47276 100644 --- a/reference/deque/deque/insert_range.md +++ b/reference/deque/deque/insert_range.md @@ -7,7 +7,9 @@ ```cpp template R> -iterator insert_range(const_iterator pos, R&& rg); // C++23 +iterator insert_range(const_iterator pos, R&& rg); // (1) C++23 +template R> +constexpr iterator insert_range(const_iterator pos, R&& rg); // (1) C++26 ``` ## 概要 @@ -60,3 +62,7 @@ int main() |-------------------------------------------|----------------------| | [`insert`](insert.md) | 任意の位置に要素を挿入する | | [`emplace`](emplace.md) | 任意の位置に要素を直接構築で挿入する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/max_size.md b/reference/deque/deque/max_size.md index a115c015fd..b7a5ac133b 100644 --- a/reference/deque/deque/max_size.md +++ b/reference/deque/deque/max_size.md @@ -5,8 +5,9 @@ * function[meta id-type] ```cpp -size_type max_size() const; // C++03 -size_type max_size() const noexcept; // C++11 +size_type max_size() const; // (1) C++03 +size_type max_size() const noexcept; // (2) C++11 +constexpr size_type max_size() const noexcept; // (3) C++26 ``` ## 概要 @@ -51,3 +52,7 @@ int main() |-------------------------|------------------| | [`size`](size.md) | 要素数を取得する | | [`resize`](resize.md) | 要素数を変更する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/op_assign.md b/reference/deque/deque/op_assign.md index ef7bfc1a87..625cc558e9 100644 --- a/reference/deque/deque/op_assign.md +++ b/reference/deque/deque/op_assign.md @@ -6,10 +6,17 @@ ```cpp deque& operator=(const deque& x); // (1) C++03 -deque& operator=(deque&& x); // (2) C++11 +constexpr deque& operator=(const deque& x); // (1) C++26 + +deque& operator=(deque&& x); // (2) C++11 deque& operator=(deque&& x) - noexcept(allocator_traits::is_always_equal::value); // (2) C++17 -deque& operator=(initializer_list init); // (3) C++11 + noexcept(allocator_traits::is_always_equal::value); // (2) C++17 +constexpr + deque& operator=(deque&& x) + noexcept(allocator_traits::is_always_equal::value); // (2) C++26 + +deque& operator=(initializer_list init); // (3) C++11 +constexpr deque& operator=(initializer_list init); // (3) C++26 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -85,3 +92,4 @@ c3 : {1 2 3 } - (3)の経緯となる提案文書 - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) - `noexcept` 追加の経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/op_at.md b/reference/deque/deque/op_at.md index 15c725c4d1..57edc93686 100644 --- a/reference/deque/deque/op_at.md +++ b/reference/deque/deque/op_at.md @@ -5,8 +5,11 @@ * function[meta id-type] ```cpp -reference operator[](size_type n); -const_reference operator[](size_type n) const; +reference operator[](size_type n); // (1) C++03 +constexpr reference operator[](size_type n); // (1) C++26 + +const_reference operator[](size_type n) const; // (2) C++03 +constexpr const_reference operator[](size_type n) const; // (2) C++26 ``` ## 概要 @@ -57,3 +60,7 @@ int main() | 名前 | 説明 | |-----------------|----------------------------------| | [`at`](at.md) | 任意位置の要素への参照を取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/op_compare_3way.md b/reference/deque/deque/op_compare_3way.md index 9103489576..783a910224 100644 --- a/reference/deque/deque/op_compare_3way.md +++ b/reference/deque/deque/op_compare_3way.md @@ -10,6 +10,10 @@ namespace std { synth-three-way-result operator<=>(const deque& x, const deque& y); // (1) C++20 + template + constexpr synth-three-way-result + operator<=>(const deque& x, + const deque& y); // (1) C++26 } ``` @@ -81,3 +85,4 @@ int main () ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/op_constructor.md b/reference/deque/deque/op_constructor.md index b86a698ed1..9d63882fa7 100644 --- a/reference/deque/deque/op_constructor.md +++ b/reference/deque/deque/op_constructor.md @@ -6,39 +6,80 @@ ```cpp deque(); // (1) C++14 から +constexpr deque(); // (1) C++26 + explicit deque(const Allocator& a); // (2) C++14 から -explicit deque(const Allocator& a = Allocator()); // (1), (2) : C++11 まで。C++14 で削除 +constexpr explicit deque(const Allocator& a); // (2) C++26 + +explicit deque(const Allocator& a = Allocator()); // (1)+(2) : C++11 まで。C++14 で削除 explicit deque(size_type n, const T& value = T(), const Allocator& a = Allocator()); // (3) C++03 まで。C++11 で削除 -deque(size_type n, const T& value, +deque(size_type n, + const T& value, const Allocator& a = Allocator()); // (3) C++11 から +constexpr + deque(size_type n, + const T& value, + const Allocator& a = Allocator()); // (3) C++26 explicit deque(size_type n); // (4) C++11。C++14 で削除 -explicit deque(size_type n, - const Allocator& a = Allocator()); // (4) C++14 から +explicit + deque(size_type n, + const Allocator& a = Allocator()); // (4) C++14 から +constexpr explicit + deque(size_type n, + const Allocator& a = Allocator()); // (4) C++26 template -deque(InputIterator first, InputIterator last, - const Allocator& a = Allocator()); // (5) +deque(InputIterator first, + InputIterator last, + const Allocator& a = Allocator()); // (5) C++03 +template +constexpr + deque(InputIterator first, + InputIterator last, + const Allocator& a = Allocator()); // (5) C++26 -deque(const deque& x); // (6) -deque(deque&& y); // (7) C++11 から -deque(const deque& x, const Allocator& a); // (8) C++11 -deque(const deque& x, - const type_identity_t& a); // (8) C++23 +deque(const deque& x); // (6) C++03 +constexpr deque(const deque& x); // (6) C++26 -deque(deque&& y, const Allocator& a); // (9) C++11 -deque(deque&& y, const type_identity_t& a); // (9) C++23 +deque(deque&& y); // (7) C++11 から +constexpr deque(deque&& y); // (7) C++26 + +deque(const deque& x, + const Allocator& a); // (8) C++11 +deque(const deque& x, + const type_identity_t& a); // (8) C++23 +constexpr + deque(const deque& x, + const type_identity_t& a); // (8) C++26 + +deque(deque&& y, + const Allocator& a); // (9) C++11 +deque(deque&& y, + const type_identity_t& a); // (9) C++23 +constexpr + deque(deque&& y, + const type_identity_t& a); // (9) C++26 deque(initializer_list il, - const Allocator& a = Allocator()); // (10) C++11 から + const Allocator& a = Allocator()); // (10) C++11 +constexpr + deque(initializer_list il, + const Allocator& a = Allocator()); // (10) C++26 template R> -deque(from_range_t, R&& rg, - const Allocator& a = Allocator()); // (11) C++23 から +deque(from_range_t, + R&& rg, + const Allocator& a = Allocator()); // (11) C++23 +template R> +constexpr + deque(from_range_t, + R&& rg, + const Allocator& a = Allocator()); // (11) C++26 ``` * type_identity_t[link /reference/type_traits/type_identity.md] * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -195,3 +236,4 @@ c7 : {1 2 3 } なお、Discussion の例はアロケータの型が誤っているので注意 - [P1518R2 Stop Overconstraining Allocators in Container Deduction Guides](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1518r2.html) - C++23でのアロケータ引数を`type_identity_t`で包む変更 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/op_destructor.md b/reference/deque/deque/op_destructor.md index 72e9aa39f3..d937d8c1a0 100644 --- a/reference/deque/deque/op_destructor.md +++ b/reference/deque/deque/op_destructor.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -~deque(); +~deque(); // (1) C++03 +constexpr ~deque(); // (1) C++26 ``` ## 概要 @@ -18,3 +19,7 @@ ## 計算量 線形時間 + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/op_equal.md b/reference/deque/deque/op_equal.md index f4310152c8..f569c1190f 100644 --- a/reference/deque/deque/op_equal.md +++ b/reference/deque/deque/op_equal.md @@ -6,8 +6,13 @@ ```cpp namespace std { template - bool operator==(const deque& x, - const deque& y); // (1) C++03 + bool + operator==(const deque& x, + const deque& y); // (1) C++03 + template + constexpr bool + operator==(const deque& x, + const deque& y); // (1) C++26 } ``` @@ -86,3 +91,4 @@ false - C++14から、2つ目のイテレータ範囲のendイテレータをとる`equal()`アルゴリズムを使用するようになった。 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/op_greater.md b/reference/deque/deque/op_greater.md index 609a42c2fe..079acc99ee 100644 --- a/reference/deque/deque/op_greater.md +++ b/reference/deque/deque/op_greater.md @@ -7,8 +7,13 @@ namespace std { // operator<=>により、以下の演算子が使用可能になる (C++20) template - bool operator>(const deque& x, - const deque& y); // (1) C++03 + bool + operator>(const deque& x, + const deque& y); // (1) C++03 + template + constexpr bool + operator>(const deque& x, + const deque& y); // (1) C++26 } ``` @@ -48,3 +53,4 @@ true ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/op_greater_equal.md b/reference/deque/deque/op_greater_equal.md index bcfc4e9830..c9d20068ed 100644 --- a/reference/deque/deque/op_greater_equal.md +++ b/reference/deque/deque/op_greater_equal.md @@ -7,8 +7,13 @@ namespace std { // operator<=>により、以下の演算子が使用可能になる (C++20) template - bool operator>=(const deque& x, - const deque& y); // (1) C++03 + bool + operator>=(const deque& x, + const deque& y); // (1) C++03 + template + constexpr bool + operator>=(const deque& x, + const deque& y); // (1) C++26 } ``` @@ -48,3 +53,4 @@ true ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/op_less.md b/reference/deque/deque/op_less.md index cb95bdce3a..091c604998 100644 --- a/reference/deque/deque/op_less.md +++ b/reference/deque/deque/op_less.md @@ -7,8 +7,13 @@ namespace std { // operator<=>により、以下の演算子が使用可能になる (C++20) template - bool operator<(const deque& x, - const deque& y); // (1) C++03 + bool + operator<(const deque& x, + const deque& y); // (1) C++03 + template + constexpr bool + operator<(const deque& x, + const deque& y); // (1) C++26 } ``` @@ -57,3 +62,4 @@ true ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/op_less_equal.md b/reference/deque/deque/op_less_equal.md index 5762b861ff..005ad3ecbc 100644 --- a/reference/deque/deque/op_less_equal.md +++ b/reference/deque/deque/op_less_equal.md @@ -7,8 +7,13 @@ namespace std { // operator<=>により、以下の演算子が使用可能になる (C++20) template - bool operator<=(const deque& x, - const deque& y); // (1) C++03 + bool + operator<=(const deque& x, + const deque& y); // (1) C++03 + template + constexpr bool + operator<=(const deque& x, + const deque& y); // (1) C++26 } ``` @@ -52,3 +57,4 @@ true ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/op_not_equal.md b/reference/deque/deque/op_not_equal.md index 4b725d1efb..b117e7dd37 100644 --- a/reference/deque/deque/op_not_equal.md +++ b/reference/deque/deque/op_not_equal.md @@ -7,8 +7,13 @@ namespace std { // operator==により、以下の演算子が使用可能になる (C++20) template - bool operator!=(const deque& x, - const deque& y); // (1) C++03 + bool + operator!=(const deque& x, + const deque& y); // (1) C++03 + template + constexpr bool + operator!=(const deque& x, + const deque& y); // (1) C++26 } ``` @@ -58,3 +63,4 @@ true ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/pop_back.md b/reference/deque/deque/pop_back.md index 506d139ee7..ed66804ae1 100644 --- a/reference/deque/deque/pop_back.md +++ b/reference/deque/deque/pop_back.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -void pop_back(); +void pop_back(); // (1) C++03 +constexpr void pop_back(); // (1) C++26 ``` ## 概要 @@ -58,3 +59,7 @@ int main() | [`pop_front`](pop_front.md) | 先頭要素を削除する | | [`push_back`](push_back.md) | 末尾に要素を追加する | | [`erase`](erase.md) | 指定した要素を削除する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/pop_front.md b/reference/deque/deque/pop_front.md index aef49f01dd..9f24965e02 100644 --- a/reference/deque/deque/pop_front.md +++ b/reference/deque/deque/pop_front.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -void pop_front(); +void pop_front(); // (1) C++03 +constexpr void pop_front(); // (1) C++26 ``` ## 概要 @@ -54,3 +55,7 @@ int main() | [`pop_back`](pop_back.md) | 末尾要素を削除する | | [`push_front`](push_front.md) | 先頭に要素を追加する | | [`erase`](erase.md) | 指定した要素を削除する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/prepend_range.md b/reference/deque/deque/prepend_range.md index a5c67622ea..30d80fd71c 100644 --- a/reference/deque/deque/prepend_range.md +++ b/reference/deque/deque/prepend_range.md @@ -7,7 +7,11 @@ ```cpp template R> -void prepend_range(R&& rg); // C++23 +void + prepend_range(R&& rg); // (1) C++23 +template R> +constexpr void + prepend_range(R&& rg); // (1) C++26 ``` ## 概要 @@ -63,3 +67,7 @@ int main() |-------------------------------------------|----------------------| | [`push_front`](push_front.md) | 先頭に要素を追加する | | [`emplace_front`](emplace_front.md) | 先頭に要素を直接構築で追加する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/push_back.md b/reference/deque/deque/push_back.md index d4e80868a3..50db7f1683 100644 --- a/reference/deque/deque/push_back.md +++ b/reference/deque/deque/push_back.md @@ -5,8 +5,11 @@ * function[meta id-type] ```cpp -void push_back(const T& x); // (1) -void push_back(T&& y); // (2) C++11 +void push_back(const T& x); // (1) C++03 +constexpr void push_back(const T& x); // (1) C++26 + +void push_back(T&& y); // (2) C++11 +constexpr void push_back(T&& y); // (2) C++26 ``` ## 概要 @@ -72,3 +75,4 @@ world ## 参照 - [LWG Issue 2252. Strong guarantee on `vector::push_back()` still broken with C++11?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2252) - 経緯の説明は、[`vector::push_back()`](/reference/vector/vector/push_back.md)ページを参照。 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/push_front.md b/reference/deque/deque/push_front.md index bf7c50f849..c9bff55a46 100644 --- a/reference/deque/deque/push_front.md +++ b/reference/deque/deque/push_front.md @@ -5,8 +5,11 @@ * function[meta id-type] ```cpp -void push_front(const T& x); // (1) -void push_front(T&& y); // (2) C++11 +void push_front(const T& x); // (1) C++03 +constexpr void push_front(const T& x); // (1) C++26 + +void push_front(T&& y); // (2) C++11 +constexpr void push_front(T&& y); // (2) C++26 ``` ## 概要 @@ -72,3 +75,4 @@ world ## 参照 - [LWG Issue 2252. Strong guarantee on `vector::push_back()` still broken with C++11?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2252) - 経緯の説明は、[`vector::push_back()`](/reference/vector/vector/push_back.md)ページを参照。 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/rbegin.md b/reference/deque/deque/rbegin.md index ec0364b5c5..60d5fd964c 100644 --- a/reference/deque/deque/rbegin.md +++ b/reference/deque/deque/rbegin.md @@ -5,11 +5,13 @@ * function[meta id-type] ```cpp -reverse_iterator rbegin(); // (1) C++03 -reverse_iterator rbegin() noexcept; // (1) C++11 +reverse_iterator rbegin(); // (1) C++03 +reverse_iterator rbegin() noexcept; // (1) C++11 +constexpr reverse_iterator rbegin() noexcept; // (1) C++26 -const_reverse_iterator rbegin() const; // (2) C++03 -const_reverse_iterator rbegin() const noexcept; // (2) C++11 +const_reverse_iterator rbegin() const; // (2) C++03 +const_reverse_iterator rbegin() const noexcept; // (2) C++11 +constexpr const_reverse_iterator rbegin() const noexcept; // (2) C++26 ``` ## 概要 @@ -63,3 +65,7 @@ int main() | [`crend`](crend.md) | 先頭要素の前を指す読み取り専用逆イテレータを取得する | | [`begin`](begin.md) | 先頭要素を指すイテレータの取得する | | [`end`](end.md) | 末尾要素の次を指すイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/rend.md b/reference/deque/deque/rend.md index c690d722e8..343d216750 100644 --- a/reference/deque/deque/rend.md +++ b/reference/deque/deque/rend.md @@ -5,11 +5,13 @@ * function[meta id-type] ```cpp -reverse_iterator rend(); // (1) C++03 -reverse_iterator rend() noexcept; // (1) C++11 +reverse_iterator rend(); // (1) C++03 +reverse_iterator rend() noexcept; // (1) C++11 +constexpr reverse_iterator rend() noexcept; // (1) C++26 -const_reverse_iterator rend() const; // (2) C++03 -const_reverse_iterator rend() const noexcept; // (2) C++11 +const_reverse_iterator rend() const; // (2) C++03 +const_reverse_iterator rend() const noexcept; // (2) C++11 +constexpr const_reverse_iterator rend() const noexcept; // (2) C++26 ``` ## 概要 @@ -76,3 +78,7 @@ int main() | [`crend`](crend.md) | 先頭要素の前を指す読み取り専用逆イテレータを取得する | | [`begin`](begin.md) | 先頭要素を指すイテレータの取得する | | [`end`](end.md) | 末尾要素の次を指すイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/resize.md b/reference/deque/deque/resize.md index 6f3626ed43..49a70248a6 100644 --- a/reference/deque/deque/resize.md +++ b/reference/deque/deque/resize.md @@ -5,10 +5,13 @@ * function[meta id-type] ```cpp -void resize(size_type sz); // (1) : C++11 -void resize(size_type sz, const T& c); // (2) : C++11 -void resize(size_type sz, const T& c = T()); // (1) + (2) : C++03 +void resize(size_type sz); // (1) C++11 +constexpr void resize(size_type sz); // (1) C++26 +void resize(size_type sz, const T& c); // (2) C++11 +constexpr void resize(size_type sz, const T& c); // (2) C++26 + +void resize(size_type sz, const T& c = T()); // (1) + (2) : C++03まで ``` ## 概要 @@ -106,6 +109,7 @@ int main() - [LWG Issue 2033. Preconditions of `reserve`, `shrink_to_fit`, and `resize` functions](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2033) - [LWG Issue 2323. `vector::resize(n, t)`'s specification should be simplified](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2323) - [LWG Issue 2160. Unintended destruction ordering-specification of `resize`](https://wg21.cmeerw.net/lwg/issue2160) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) ## 関連項目 diff --git a/reference/deque/deque/shrink_to_fit.md b/reference/deque/deque/shrink_to_fit.md index c010a1cb06..0207f3fefd 100644 --- a/reference/deque/deque/shrink_to_fit.md +++ b/reference/deque/deque/shrink_to_fit.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -void shrink_to_fit(); +void shrink_to_fit(); // (1) C++11 +constexpr void shrink_to_fit(); // (1) C++26 ``` ## 概要 @@ -56,3 +57,4 @@ void shrink_to_fit(); - [LWG Issue 850. Should `shrink_to_fit` apply to `std::deque`?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#850) - [LWG Issue 2033. Preconditions of `reserve`, `shrink_to_fit`, and `resize` functions](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2033) - [LWG Issue 2223. `shrink_to_fit` effect on iterator validity](https://wg21.cmeerw.net/lwg/issue2223) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/size.md b/reference/deque/deque/size.md index 6f0dcf6015..6d73c06b63 100644 --- a/reference/deque/deque/size.md +++ b/reference/deque/deque/size.md @@ -5,8 +5,9 @@ * function[meta id-type] ```cpp -size_type size() const; // C++03 -size_type size() const noexcept; // C++11 +size_type size() const; // (1) C++03 +size_type size() const noexcept; // (1) C++11 +constexpr size_type size() const noexcept; // (1) C++26 ``` ## 概要 @@ -51,3 +52,7 @@ int main() |-----------------------------|----------------------------------| | [`resize`](resize.md) | 要素数を変更する | | [`max_size`](max_size.md) | 格納可能な最大の要素数を取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/swap.md b/reference/deque/deque/swap.md index ca748c4bd7..fc43ef9f57 100644 --- a/reference/deque/deque/swap.md +++ b/reference/deque/deque/swap.md @@ -5,8 +5,14 @@ * function[meta id-type] ```cpp -void swap(deque& other); -void swap(deque& x) noexcept(allocator_traits::is_always_equal::value); // C++17 +void + swap(deque& other); // (1) C++03 +void + swap(deque& x) + noexcept(allocator_traits::is_always_equal::value); // (1) C++17 +constexpr void + swap(deque& x) + noexcept(allocator_traits::is_always_equal::value); // (1) C++26 ``` ## 概要 @@ -68,3 +74,4 @@ c2 : {1 2 3 } ## 参照 - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) - `noexcept` 追加の経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/deque/deque/swap_free.md b/reference/deque/deque/swap_free.md index 632d6228bc..5810d54a2e 100644 --- a/reference/deque/deque/swap_free.md +++ b/reference/deque/deque/swap_free.md @@ -6,11 +6,19 @@ ```cpp namespace std { template - void swap(deque& x, deque& y); - + void + swap(deque& x, + deque& y); // (1) C++03 + template + void + swap(deque& x, + deque& y) + noexcept(noexcept(x.swap(y))); // (1) C++17 template - void swap(deque& x, deque& y) - noexcept(noexcept(x.swap(y))); // C++17 + constexpr void + swap(deque& x, + deque& y) + noexcept(noexcept(x.swap(y))); // (1) C++26 } ``` @@ -65,3 +73,4 @@ c2 : {1 2 3 } ## 参照 - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) - `noexcept` 追加の経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/at.md b/reference/flat_map/flat_map/at.md index 17933b15bb..46781f3f50 100644 --- a/reference/flat_map/flat_map/at.md +++ b/reference/flat_map/flat_map/at.md @@ -6,15 +6,29 @@ * cpp23[meta cpp] ```cpp -mapped_type& at(const key_type& x); // (1) C++23 +mapped_type& + at(const key_type& x); // (1) C++23 +constexpr mapped_type& + at(const key_type& x); // (1) C++26 template -mapped_type& at(const K& x); // (2) C++23 +mapped_type& + at(const K& x); // (2) C++23 +template +constexpr mapped_type& + at(const K& x); // (2) C++26 -const mapped_type& at(const key_type& x) const; // (3) C++23 +const mapped_type& + at(const key_type& x) const; // (3) C++23 +constexpr const mapped_type& + at(const key_type& x) const; // (3) C++26 template -const mapped_type& at(const K& x) const; // (4) C++23 +const mapped_type& + at(const K& x) const; // (4) C++23 +template +constexpr const mapped_type& + at(const K& x) const; // (4) C++26 ``` ## 概要 @@ -96,3 +110,7 @@ exception std::out_of_range ## 関連項目 - [`operator[]`](op_at.md) - [`find()`](find.md) + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/begin.md b/reference/flat_map/flat_map/begin.md index 1ef7421bb4..963de9a99e 100644 --- a/reference/flat_map/flat_map/begin.md +++ b/reference/flat_map/flat_map/begin.md @@ -6,8 +6,11 @@ * cpp23[meta cpp] ```cpp -iterator begin() noexcept; -const_iterator begin() const noexcept; +iterator begin() noexcept; // (1) C++23 +constexpr iterator begin() noexcept; // (1) C++26 + +const_iterator begin() const noexcept; // (2) C++23 +constexpr const_iterator begin() const noexcept; // (2) C++26 ``` @@ -84,3 +87,7 @@ int main() | [`flat_map::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_map::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`flat_map::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/cbegin.md b/reference/flat_map/flat_map/cbegin.md index e377d86441..6b029073b0 100644 --- a/reference/flat_map/flat_map/cbegin.md +++ b/reference/flat_map/flat_map/cbegin.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -const_iterator cbegin() const noexcept; +const_iterator cbegin() const noexcept; // (1) C++23 +constexpr const_iterator cbegin() const noexcept; // (1) C++26 ``` @@ -80,3 +81,7 @@ int main() | [`flat_map::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_map::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`flat_map::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/cend.md b/reference/flat_map/flat_map/cend.md index c1240bcb31..4d412ee7cc 100644 --- a/reference/flat_map/flat_map/cend.md +++ b/reference/flat_map/flat_map/cend.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -const_iterator cend() const noexcept; +const_iterator cend() const noexcept; // (1) C++23 +constexpr const_iterator cend() const noexcept; // (1) C++26 ``` ## 概要 @@ -83,3 +84,7 @@ int main() | [`flat_map::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_map::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`flat_map::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/clear.md b/reference/flat_map/flat_map/clear.md index a9e14e962b..3bf20ec177 100644 --- a/reference/flat_map/flat_map/clear.md +++ b/reference/flat_map/flat_map/clear.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -void clear() noexcept; // (1) C++23 +void clear() noexcept; // (1) C++23 +constexpr void clear() noexcept; // (1) C++26 ``` ## 概要 @@ -59,3 +60,7 @@ int main () - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/contains.md b/reference/flat_map/flat_map/contains.md index 219733333c..5d5d5b0408 100644 --- a/reference/flat_map/flat_map/contains.md +++ b/reference/flat_map/flat_map/contains.md @@ -6,10 +6,17 @@ * cpp23[meta cpp] ```cpp -bool contains(const key_type& x) const; // (1) C++23 +bool + contains(const key_type& x) const; // (1) C++23 +constexpr bool + contains(const key_type& x) const; // (1) C++26 template -bool contains(const K& x) const; // (2) C++23 +bool + contains(const K& x) const; // (2) C++23 +template +constexpr bool + contains(const K& x) const; // (2) C++26 ``` @@ -82,3 +89,7 @@ contain - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/count.md b/reference/flat_map/flat_map/count.md index 139090da55..f8ff66c16d 100644 --- a/reference/flat_map/flat_map/count.md +++ b/reference/flat_map/flat_map/count.md @@ -6,10 +6,17 @@ * cpp23[meta cpp] ```cpp -size_type count(const key_type& x) const; // (1) C++23 +size_type + count(const key_type& x) const; // (1) C++23 +constexpr size_type + count(const key_type& x) const; // (1) C++26 template -size_type count(const K& x) const; // (2) C++23 +size_type + count(const K& x) const; // (2) C++23 +template +constexpr size_type + count(const K& x) const; // (2) C++26 ``` ## 概要 @@ -103,3 +110,7 @@ found ## 関連項目 - [`contains()`](contains.md) + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/crbegin.md b/reference/flat_map/flat_map/crbegin.md index a1d900a901..cca7b2c303 100644 --- a/reference/flat_map/flat_map/crbegin.md +++ b/reference/flat_map/flat_map/crbegin.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -const_reverse_iterator crbegin() const noexcept; +const_reverse_iterator crbegin() const noexcept; // (1) C++23 +constexpr const_reverse_iterator crbegin() const noexcept; // (1) C++26 ``` ## 概要 @@ -76,3 +77,7 @@ int main() | [`flat_map::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | | [`flat_map::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_map::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/crend.md b/reference/flat_map/flat_map/crend.md index 466666a994..7cc7777d1b 100644 --- a/reference/flat_map/flat_map/crend.md +++ b/reference/flat_map/flat_map/crend.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -const_reverse_iterator crend() const noexcept; +const_reverse_iterator crend() const noexcept; // (1) C++23 +constexpr const_reverse_iterator crend() const noexcept; // (1) C++26 ``` @@ -74,3 +75,7 @@ int main() | [`flat_map::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | | [`flat_map::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_map::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/emplace.md b/reference/flat_map/flat_map/emplace.md index 7370de6dfb..dd68da6a20 100644 --- a/reference/flat_map/flat_map/emplace.md +++ b/reference/flat_map/flat_map/emplace.md @@ -7,7 +7,11 @@ ```cpp template -pair emplace(Args&&... args); +pair + emplace(Args&&... args); // (1) C++23 +template +constexpr pair + emplace(Args&&... args); // (1) C++26 ``` ## 概要 @@ -141,3 +145,7 @@ CCC : (1, 2) | [`flat_map::insert_or_assign`](insert_or_assign.md) | 要素を挿入、あるいは代入する | | [`flat_map::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | | [`flat_map::try_emplace`](try_emplace.md) | キーが存在しない場合のみ要素を直接構築する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/emplace_hint.md b/reference/flat_map/flat_map/emplace_hint.md index d4fef9c464..54593be3e8 100644 --- a/reference/flat_map/flat_map/emplace_hint.md +++ b/reference/flat_map/flat_map/emplace_hint.md @@ -7,7 +7,13 @@ ```cpp template -iterator emplace_hint(const_iterator hint, Args&&... args); +iterator + emplace_hint(const_iterator hint, + Args&&... args); // (1) C++23 +template +constexpr iterator + emplace_hint(const_iterator hint, + Args&&... args); // (1) C++26 ``` ## 概要 @@ -80,3 +86,7 @@ int main() | [`flat_map::insert_or_assign`](insert_or_assign.md) | 要素を挿入、あるいは代入する | | [`flat_map::emplace`](emplace.md) | 要素を直接構築する | | [`flat_map::try_emplace`](try_emplace.md) | キーが存在しない場合のみ要素を直接構築する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/empty.md b/reference/flat_map/flat_map/empty.md index 050a8af3c5..3be76edd19 100644 --- a/reference/flat_map/flat_map/empty.md +++ b/reference/flat_map/flat_map/empty.md @@ -6,7 +6,10 @@ * cpp23[meta cpp] ```cpp -[[nodiscard]] bool empty() const noexcept; // (1) C++23 +[[nodiscard]] bool + empty() const noexcept; // (1) C++23 +[[nodiscard]] constexpr bool + empty() const noexcept; // (1) C++26 ``` ## 概要 @@ -57,3 +60,7 @@ int main () - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/end.md b/reference/flat_map/flat_map/end.md index c91a98c0e8..914c190958 100644 --- a/reference/flat_map/flat_map/end.md +++ b/reference/flat_map/flat_map/end.md @@ -6,8 +6,11 @@ * cpp23[meta cpp] ```cpp -iterator end() noexcept; -const_iterator end() const noexcept; +iterator end() noexcept; // (1) C++23 +constexpr iterator end() noexcept; // (1) C++26 + +const_iterator end() const noexcept; // (1) C++23 +constexpr const_iterator end() const noexcept; // (1) C++26 ``` ## 概要 @@ -85,3 +88,7 @@ int main() | [`flat_map::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_map::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`flat_map::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/equal_range.md b/reference/flat_map/flat_map/equal_range.md index 4429ab2c60..60181f28fb 100644 --- a/reference/flat_map/flat_map/equal_range.md +++ b/reference/flat_map/flat_map/equal_range.md @@ -6,17 +6,29 @@ * cpp23[meta cpp] ```cpp -pair equal_range(const key_type& x); // (1) C++23 +pair + equal_range(const key_type& x); // (1) C++23 +constexpr pair + equal_range(const key_type& x); // (1) C++26 template -pair equal_range(const K& x); // (2) C++23 +pair + equal_range(const K& x); // (2) C++23 +template +constexpr pair + equal_range(const K& x); // (2) C++26 pair - equal_range(const key_type& x) const; // (3) C++23 + equal_range(const key_type& x) const; // (3) C++23 +constexpr pair + equal_range(const key_type& x) const; // (3) C++26 template pair - equal_range(const K& x) const; // (4) C++23 + equal_range(const K& x) const; // (4) C++23 +template +constexpr pair + equal_range(const K& x) const; // (4) C++26 ``` ## 概要 @@ -81,3 +93,7 @@ B,1 | [`flat_map::lower_bound`](lower_bound.md) | 与えられた値より小さくない最初の要素へのイテレータを返す | | [`flat_map::upper_bound`](upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | | [`flat_map::find`](find.md) | 指定したキーで要素を探す | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/erase.md b/reference/flat_map/flat_map/erase.md index 51014fc33d..84afb49059 100644 --- a/reference/flat_map/flat_map/erase.md +++ b/reference/flat_map/flat_map/erase.md @@ -6,16 +6,22 @@ * cpp23[meta cpp] ```cpp -iterator erase(iterator position); // (1) C++23 +iterator erase(iterator position); // (1) C++23 +constexpr iterator erase(iterator position); // (1) C++26 -iterator erase(const_iterator position); // (2) C++23 +iterator erase(const_iterator position); // (2) C++23 +constexpr iterator erase(const_iterator position); // (2) C++26 -size_type erase(const key_type& x); // (3) C++23 +size_type erase(const key_type& x); // (3) C++23 +constexpr size_type erase(const key_type& x); // (3) C++26 template -size_type erase(K&& x); // (4) C++23 +size_type erase(K&& x); // (4) C++23 +template +constexpr size_type erase(K&& x); // (4) C++26 -iterator erase(const_iterator first, const_iterator last); // (5) C++23 +iterator erase(const_iterator first, const_iterator last); // (5) C++23 +constexpr iterator erase(const_iterator first, const_iterator last); // (5) C++26 ``` ## 概要 @@ -145,3 +151,7 @@ int main() | [`flat_map::clear`](clear.md) | 全ての要素を削除する | | [`flat_map::insert`](insert.md) | 要素を挿入する | | [`flat_map::find`](find.md) | 指定したキーで要素を探す | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/erase_if_free.md b/reference/flat_map/flat_map/erase_if_free.md index 8bc57c4bf4..b62b5ac771 100644 --- a/reference/flat_map/flat_map/erase_if_free.md +++ b/reference/flat_map/flat_map/erase_if_free.md @@ -14,7 +14,16 @@ namespace std { class Predicate> typename flat_map::size_type erase_if(flat_map& c, - Predicate pred); + Predicate pred); // (1) C++23 + template + constexpr typename flat_map::size_type + erase_if(flat_map& c, + Predicate pred); // (1) C++26 } ``` @@ -77,3 +86,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/extract.md b/reference/flat_map/flat_map/extract.md index 0aa1cbb9ee..2e77bd637d 100644 --- a/reference/flat_map/flat_map/extract.md +++ b/reference/flat_map/flat_map/extract.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -containers extract() &&; // C++23 +containers extract() &&; // (1) C++23 +constexpr containers extract() &&; // (1) C++26 ``` ## 概要 @@ -88,3 +89,7 @@ int main() ## 関連項目 - [`containers`](containers.md) + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/find.md b/reference/flat_map/flat_map/find.md index 598fec6d72..c5aa0dea22 100644 --- a/reference/flat_map/flat_map/find.md +++ b/reference/flat_map/flat_map/find.md @@ -6,15 +6,21 @@ * cpp23[meta cpp] ```cpp -iterator find(const key_type& x); // (1) C++23 +iterator find(const key_type& x); // (1) C++23 +constexpr iterator find(const key_type& x); // (1) C++26 template -iterator find(const K& x); // (2) C++23 +iterator find(const K& x); // (2) C++23 +template +constexpr iterator find(const K& x); // (2) C++26 -const_iterator find(const key_type& x) const; // (3) C++23 +const_iterator find(const key_type& x) const; // (3) C++23 +constexpr const_iterator find(const key_type& x) const; // (3) C++26 template -const_iterator find(const K& x) const; // (4) C++23 +const_iterator find(const K& x) const; // (4) C++23 +template +constexpr const_iterator find(const K& x) const; // (4) C++26 ``` ## 概要 @@ -105,3 +111,7 @@ int main() ## 関連項目 - [`contains()`](contains.md) + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/insert.md b/reference/flat_map/flat_map/insert.md index 29d235abb7..fb9a9a674f 100644 --- a/reference/flat_map/flat_map/insert.md +++ b/reference/flat_map/flat_map/insert.md @@ -6,34 +6,77 @@ * cpp23[meta cpp] ```cpp -pair insert(const value_type& x); // (1) C++23 -pair insert(value_type&& x); // (2) C++23 - -iterator insert(const_iterator position, - const value_type& x); // (3) C++23 -iterator insert(const_iterator position, - value_type&& x); // (4) C++23 +pair + insert(const value_type& x); // (1) C++23 +constexpr pair + insert(const value_type& x); // (1) C++26 + +pair + insert(value_type&& x); // (2) C++23 +constexpr pair + insert(value_type&& x); // (2) C++26 + +iterator + insert(const_iterator position, + const value_type& x); // (3) C++23 +constexpr iterator + insert(const_iterator position, + const value_type& x); // (3) C++26 + +iterator + insert(const_iterator position, + value_type&& x); // (4) C++23 +constexpr iterator + insert(const_iterator position, + value_type&& x); // (4) C++26 template -pair insert(P&& x); // (5) C++23 +pair + insert(P&& x); // (5) C++23 +template +constexpr pair + insert(P&& x); // (5) C++26 template -iterator insert(const_iterator position, - P&&); // (6) C++23 +iterator + insert(const_iterator position, + P&&); // (6) C++23 +template +constexpr iterator + insert(const_iterator position, + P&&); // (6) C++26 template -void insert(InputIterator first, - InputIterator last); // (7) C++23 - +void + insert(InputIterator first, + InputIterator last); // (7) C++23 template -void insert(sorted_unique_t, - InputIterator first, - InputIterator last); // (8) C++23 - -void insert(initializer_list il); // (9) C++23 +constexpr void + insert(InputIterator first, + InputIterator last); // (7) C++26 -void insert(sorted_unique_t s, - initializer_list il); // (10) C++23 +template +void + insert(sorted_unique_t, + InputIterator first, + InputIterator last); // (8) C++23 +template +constexpr void + insert(sorted_unique_t, + InputIterator first, + InputIterator last); // (8) C++26 + +void + insert(initializer_list il); // (9) C++23 +constexpr void + insert(initializer_list il); // (9) C++26 + +void + insert(sorted_unique_t s, + initializer_list il); // (10) C++23 +constexpr void + insert(sorted_unique_t s, + initializer_list il); // (10) C++26 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] * sorted_unique_t[link /reference/flat_map/sorted_unique_t.md] @@ -264,3 +307,7 @@ int main() | [`flat_map::emplace`](emplace.md) | 要素を直接構築する | | [`flat_map::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | | [`flat_map::try_emplace`](try_emplace.md) | キーが存在しない場合のみ要素を直接構築する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/insert_or_assign.md b/reference/flat_map/flat_map/insert_or_assign.md index 498b84e1ad..77a6fd764c 100644 --- a/reference/flat_map/flat_map/insert_or_assign.md +++ b/reference/flat_map/flat_map/insert_or_assign.md @@ -9,35 +9,62 @@ template pair insert_or_assign(const key_type& k, - M&& obj); // (1) C++23 + M&& obj); // (1) C++23 +template +constexpr pair + insert_or_assign(const key_type& k, + M&& obj); // (1) C++26 template pair insert_or_assign(key_type&& k, - M&& obj); // (2) C++23 + M&& obj); // (2) C++23 +template +constexpr pair + insert_or_assign(key_type&& k, + M&& obj); // (2) C++26 template pair insert_or_assign(K&& k, - M&& obj); // (3) C++23 + M&& obj); // (3) C++23 +template +constexpr pair + insert_or_assign(K&& k, + M&& obj); // (3) C++26 template iterator insert_or_assign(const_iterator hint, const key_type& k, - M&& obj); // (4) C++23 + M&& obj); // (4) C++23 +template +constexpr iterator + insert_or_assign(const_iterator hint, + const key_type& k, + M&& obj); // (4) C++26 template iterator insert_or_assign(const_iterator hint, key_type&& k, - M&& obj); // (5) C++23 + M&& obj); // (5) C++23 +template +constexpr iterator + insert_or_assign(const_iterator hint, + key_type&& k, + M&& obj); // (5) C++26 template iterator insert_or_assign(const_iterator hint, K&& k, - M&& obj); // (6) C++23 + M&& obj); // (6) C++23 +template +constexpr iterator + insert_or_assign(const_iterator hint, + K&& k, + M&& obj); // (6) C++26 ``` ## 概要 @@ -147,3 +174,7 @@ int main() | [`flat_map::emplace`](emplace.md) | 要素を直接構築する | | [`flat_map::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | | [`flat_map::try_emplace`](try_emplace.md) | キーが存在しない場合のみ要素を直接構築する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/insert_range.md b/reference/flat_map/flat_map/insert_range.md index 99a441d6a2..4862be3385 100644 --- a/reference/flat_map/flat_map/insert_range.md +++ b/reference/flat_map/flat_map/insert_range.md @@ -7,7 +7,9 @@ ```cpp template R> -void insert_range(R&& rg); // (1) C++23 +void insert_range(R&& rg); // (1) C++23 +template R> +constexpr void insert_range(R&& rg); // (1) C++26 ``` * container-compatible-range[link /reference/exposition-only/container-compatible-range.md] @@ -117,3 +119,7 @@ int main() | [`flat_map::emplace`](emplace.md) | 要素を直接構築する | | [`flat_map::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | | [`flat_map::try_emplace`](try_emplace.md) | キーが存在しない場合のみ要素を直接構築する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/key_comp.md b/reference/flat_map/flat_map/key_comp.md index 67578cf116..b8fdb17693 100644 --- a/reference/flat_map/flat_map/key_comp.md +++ b/reference/flat_map/flat_map/key_comp.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -key_compare key_comp() const; // C++23 +key_compare key_comp() const; // (1) C++23 +constexpr key_compare key_comp() const; // (1) C++26 ``` @@ -63,3 +64,7 @@ int main() |-------------------------------------|----------------------------------------------------------| | [`value_comp`](value_comp.md) | 要素比較用の関数オブジェクトを返す | | [`value_compare`](value_compare.md) | 要素値のキー部分で大小関係を判定する二項述語の型 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/key_equiv.md b/reference/flat_map/flat_map/key_equiv.md index 05188988da..e3a7f43c3c 100644 --- a/reference/flat_map/flat_map/key_equiv.md +++ b/reference/flat_map/flat_map/key_equiv.md @@ -7,11 +7,17 @@ ```cpp struct key_equiv { - key_equiv(key_compare c) : comp(c) { } + key_equiv(key_compare c) : comp(c) { } // (1) C++23 + constexpr key_equiv(key_compare c) : comp(c) { } // (1) C++26 - bool operator()(const_reference x, const_reference y) const { - return !comp(x.first, y.first) && !comp(y.first, x.first); - } + bool + operator()(const_reference x, const_reference y) const { // (2) C++23 + return !comp(x.first, y.first) && !comp(y.first, x.first); + } + constexpr bool + operator()(const_reference x, const_reference y) const { // (2) C++26 + return !comp(x.first, y.first) && !comp(y.first, x.first); + } key_compare comp; }; @@ -29,3 +35,7 @@ struct key_equiv { - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/keys.md b/reference/flat_map/flat_map/keys.md index fd3403c82e..cb536e6345 100644 --- a/reference/flat_map/flat_map/keys.md +++ b/reference/flat_map/flat_map/keys.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -const key_container_type& keys() const noexcept; // C++23 +const key_container_type& keys() const noexcept; // (1) C++23 +constexpr const key_container_type& keys() const noexcept; // (1) C++26 ``` ## 概要 @@ -66,3 +67,7 @@ int main() | 名前 | 説明 | |-----------------------------------|-------------------------------------------| | [`flat_map::values`](values.md) | 値のコンテナを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/lower_bound.md b/reference/flat_map/flat_map/lower_bound.md index 84b7d2f220..08bbee2073 100644 --- a/reference/flat_map/flat_map/lower_bound.md +++ b/reference/flat_map/flat_map/lower_bound.md @@ -6,15 +6,21 @@ * cpp23[meta cpp] ```cpp -iterator lower_bound(const key_type& x); // (1) C++23 +iterator lower_bound(const key_type& x); // (1) C++23 +constexpr iterator lower_bound(const key_type& x); // (1) C++26 template -iterator lower_bound(const K& x); // (2) C++23 +iterator lower_bound(const K& x); // (2) C++23 +template +constexpr iterator lower_bound(const K& x); // (2) C++26 -const_iterator lower_bound(const key_type& x) const; // (3) C++23 +const_iterator lower_bound(const key_type& x) const; // (3) C++23 +constexpr const_iterator lower_bound(const key_type& x) const; // (3) C++26 template -const_iterator lower_bound(const K& x) const; // (4) C++23 +const_iterator lower_bound(const K& x) const; // (4) C++23 +template +constexpr const_iterator lower_bound(const K& x) const; // (4) C++26 ``` ## 概要 @@ -116,3 +122,7 @@ D,5 | [`equal_range`](equal_range.md) | 指定したキーにマッチする要素範囲を返す | | [`find`](find.md) | 指定したキーで要素を探す | | [`count`](count.md) | 指定したキーにマッチする要素の数を返す | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/max_size.md b/reference/flat_map/flat_map/max_size.md index f0daa8b181..6ef9dc7dbe 100644 --- a/reference/flat_map/flat_map/max_size.md +++ b/reference/flat_map/flat_map/max_size.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -size_type max_size() const noexcept; // (1) C++23 +size_type max_size() const noexcept; // (1) C++23 +constexpr size_type max_size() const noexcept; // (1) C++26 ``` ## 概要 @@ -54,3 +55,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/op_assign.md b/reference/flat_map/flat_map/op_assign.md index bf845db8b2..ba5fea2798 100644 --- a/reference/flat_map/flat_map/op_assign.md +++ b/reference/flat_map/flat_map/op_assign.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -flat_map& operator=(initializer_list il); // C++23 +flat_map& operator=(initializer_list il); // (1) C++23 +constexpr flat_map& operator=(initializer_list il); // (1) C++26 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -73,3 +74,7 @@ int main() - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/op_at.md b/reference/flat_map/flat_map/op_at.md index 30ab910e6b..1f4c0d69a0 100644 --- a/reference/flat_map/flat_map/op_at.md +++ b/reference/flat_map/flat_map/op_at.md @@ -6,11 +6,22 @@ * cpp23[meta cpp] ```cpp -mapped_type& operator[](const key_type& x); // (1) C++23 -mapped_type& operator[](key_type&& x); // (2) C++23 +mapped_type& + operator[](const key_type& x); // (1) C++23 +constexpr mapped_type& + operator[](const key_type& x); // (1) C++26 +mapped_type& + operator[](key_type&& x); // (2) C++23 +constexpr mapped_type& + operator[](key_type&& x); // (2) C++26 + +template +mapped_type& + operator[](K&& x); // (3) C++23 template -mapped_type& operator[](K&& x); // (3) C++23 +constexpr mapped_type& + operator[](K&& x); // (3) C++26 ``` ## 概要 @@ -95,3 +106,7 @@ a ## 関連項目 - [`at()`](at.md) + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/op_compare_3way.md b/reference/flat_map/flat_map/op_compare_3way.md index d9864b9116..fba7c624f5 100644 --- a/reference/flat_map/flat_map/op_compare_3way.md +++ b/reference/flat_map/flat_map/op_compare_3way.md @@ -9,6 +9,9 @@ synth-three-way-result operator<=>(const flat_map& x, const flat_map& y); // (1) C++23 +constexpr synth-three-way-result + operator<=>(const flat_map& x, + const flat_map& y); // (1) C++26 ``` ## 概要 @@ -87,3 +90,7 @@ false - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/op_constructor.md b/reference/flat_map/flat_map/op_constructor.md index 102ea61d55..221de1338b 100644 --- a/reference/flat_map/flat_map/op_constructor.md +++ b/reference/flat_map/flat_map/op_constructor.md @@ -8,118 +8,297 @@ ```cpp // ____要素数ゼロのflat_mapを構築____ -flat_map() : flat_map(key_compare()) { } // (1) C++23 +flat_map() : flat_map(key_compare()) { } // (1) C++23 +constexpr + flat_map() : flat_map(key_compare()) { } // (1) C++26 -explicit flat_map(const key_compare& comp) // (2) C++23 +explicit + flat_map(const key_compare& comp) // (2) C++23 : c(), compare(comp) { } +constexpr explicit + flat_map(const key_compare& comp) // (2) C++26 + : c(), compare(comp) { } template -explicit flat_map(const Allocator& a); // (3) C++23 +explicit + flat_map(const Allocator& a); // (3) C++23 +template +constexpr explicit + flat_map(const Allocator& a); // (3) C++26 template -flat_map(const key_compare& comp, const Allocator& a); // (4) C++23 +flat_map(const key_compare& comp, + const Allocator& a); // (4) C++23 +template +constexpr + flat_map(const key_compare& comp, + const Allocator& a); // (4) C++26 // ____アロケータを伴うコピー&ムーブコンストラクタ____ template - flat_map(const flat_map& x, const Allocator& a); // (5) C++26 + constexpr + flat_map(const flat_map& x, + const Allocator& a); // (5) C++26 template - flat_map(flat_map&& x, const Allocator& a); // (6) C++26 + constexpr + flat_map(flat_map&& x, + const Allocator& a); // (6) C++26 // ____key_container_typeとmapped_container_typeから構築____ -flat_map(key_container_type key_cont, mapped_container_type mapped_cont, - const key_compare& comp = key_compare()); // (7) C++23 +flat_map(key_container_type key_cont, + mapped_container_type mapped_cont, + const key_compare& comp = key_compare()); // (7) C++23 +constexpr + flat_map(key_container_type key_cont, + mapped_container_type mapped_cont, + const key_compare& comp = key_compare()); // (7) C++26 template -flat_map(const key_container_type& key_cont, const mapped_container_type& mapped_cont, - const Allocator& a); // (8) C++23 +flat_map(const key_container_type& key_cont, + const mapped_container_type& mapped_cont, + const Allocator& a); // (8) C++23 +template +constexpr + flat_map(const key_container_type& key_cont, + const mapped_container_type& mapped_cont, + const Allocator& a); // (8) C++26 template -flat_map(const key_container_type& key_cont, const mapped_container_type& mapped_cont, - const key_compare& comp, const Allocator& a); // (9) C++23 +flat_map(const key_container_type& key_cont, + const mapped_container_type& mapped_cont, + const key_compare& comp, + const Allocator& a); // (9) C++23 +template +constexpr + flat_map(const key_container_type& key_cont, + const mapped_container_type& mapped_cont, + const key_compare& comp, + const Allocator& a); // (9) C++26 // ____key_container_typeとmapped_container_type(共にソート済み且つ重複なし)から構築____ -flat_map(sorted_unique_t, key_container_type key_cont, mapped_container_type mapped_cont, - const key_compare& comp = key_compare()); // (10) C++23 +flat_map(sorted_unique_t, + key_container_type key_cont, + mapped_container_type mapped_cont, + const key_compare& comp = key_compare()); // (10) C++23 +constexpr + flat_map(sorted_unique_t, + key_container_type key_cont, + mapped_container_type mapped_cont, + const key_compare& comp = key_compare()); // (10) C++26 template -flat_map(sorted_unique_t, const key_container_type& key_cont, - const mapped_container_type& mapped_cont, const Allocator& a); // (11) C++23 +flat_map(sorted_unique_t, + const key_container_type& key_cont, + const mapped_container_type& mapped_cont, + const Allocator& a); // (11) C++23 +template +constexpr + flat_map(sorted_unique_t, + const key_container_type& key_cont, + const mapped_container_type& mapped_cont, + const Allocator& a); // (11) C++26 template -flat_map(sorted_unique_t, const key_container_type& key_cont, +flat_map(sorted_unique_t, + const key_container_type& key_cont, const mapped_container_type& mapped_cont, - const key_compare& comp, const Allocator& a); // (12) C++23 + const key_compare& comp, + const Allocator& a); // (12) C++23 +template +constexpr + flat_map(sorted_unique_t, + const key_container_type& key_cont, + const mapped_container_type& mapped_cont, + const key_compare& comp, + const Allocator& a); // (12) C++26 // ____イテレータから構築____ template -flat_map(InputIterator first, InputIterator last, const key_compare& comp = key_compare()) // (13) C++23 +flat_map(InputIterator first, + InputIterator last, + const key_compare& comp = key_compare()) // (13) C++23 : c(), compare(comp) { insert(first, last); } +template +constexpr + flat_map(InputIterator first, + InputIterator last, + const key_compare& comp = key_compare()) // (13) C++26 + : c(), compare(comp) { insert(first, last); } template -flat_map(InputIterator first, InputIterator last, const Allocator& a); // (14) C++23 +flat_map(InputIterator first, + InputIterator last, + const Allocator& a); // (14) C++23 +template +constexpr + flat_map(InputIterator first, + InputIterator last, + const Allocator& a); // (14) C++26 template -flat_map(InputIterator first, InputIterator last, - const key_compare& comp, const Allocator& a); // (15) C++23 +flat_map(InputIterator first, + InputIterator last, + const key_compare& comp, + const Allocator& a); // (15) C++23 +template +constexpr + flat_map(InputIterator first, + InputIterator last, + const key_compare& comp, + const Allocator& a); // (15) C++26 // ____イテレータ(ソート済み且つ重複なし)から構築____ template -flat_map(sorted_unique_t s, InputIterator first, InputIterator last, - const key_compare& comp = key_compare()) // (16) C++23 +flat_map(sorted_unique_t s, + InputIterator first, + InputIterator last, + const key_compare& comp = key_compare()) // (16) C++23 : c(), compare(comp) { insert(s, first, last); } +template +constexpr + flat_map(sorted_unique_t s, + InputIterator first, + InputIterator last, + const key_compare& comp = key_compare()) // (16) C++26 + : c(), compare(comp) { insert(s, first, last); } template -flat_map(sorted_unique_t, InputIterator first, InputIterator last, const Allocator& a); // (17) C++23 +flat_map(sorted_unique_t, + InputIterator first, + InputIterator last, + const Allocator& a); // (17) C++23 +template +constexpr flat_map(sorted_unique_t, + InputIterator first, + InputIterator last, + const Allocator& a); // (17) C++26 template -flat_map(sorted_unique_t, InputIterator first, InputIterator last, - const key_compare& comp, const Allocator& a); // (18) C++23 +flat_map(sorted_unique_t, + InputIterator first, + InputIterator last, + const key_compare& comp, + const Allocator& a); // (18) C++23 +template +constexpr + flat_map(sorted_unique_t, + InputIterator first, + InputIterator last, + const key_compare& comp, + const Allocator& a); // (18) C++26 // ____Rangeから構築____ template R> -flat_map(from_range_t fr, R&& rg) // (19) C++23 +flat_map(from_range_t fr, + R&& rg) // (19) C++23 : flat_map(fr, forward(rg), key_compare()) { } +template R> +constexpr + flat_map(from_range_t fr, + R&& rg) // (19) C++26 + : flat_map(fr, forward(rg), key_compare()) { } template R> -flat_map(from_range_t, R&& rg, const key_compare& comp) // (20) C++23 +flat_map(from_range_t, + R&& rg, + const key_compare& comp) // (20) C++23 : flat_map(comp) { insert_range(forward(rg)); } +template R> +constexpr + flat_map(from_range_t, + R&& rg, + const key_compare& comp) // (20) C++26 + : flat_map(comp) { insert_range(forward(rg)); } template R, class Allocator> -flat_map(from_range_t, R&& rg, const Allocator& a); // (21) C++23 +flat_map(from_range_t, + R&& rg, + const Allocator& a); // (21) C++23 +template R, class Allocator> +constexpr + flat_map(from_range_t, + R&& rg, + const Allocator& a); // (21) C++26 template R, class Allocator> -flat_map(from_range_t, R&& rg, const key_compare& comp, const Allocator& a); // (22) C++23 +flat_map(from_range_t, + R&& rg, + const key_compare& comp, + const Allocator& a); // (22) C++23 +template R, class Allocator> +constexpr + flat_map(from_range_t, + R&& rg, + const key_compare& comp, + const Allocator& a); // (22) C++26 // ____initializer_listから構築____ -flat_map(initializer_list il, const key_compare& comp = key_compare()) // (23) C++23 +flat_map(initializer_list il, + const key_compare& comp = key_compare()) // (23) C++23 : flat_map(il.begin(), il.end(), comp) { } +constexpr + flat_map(initializer_list il, + const key_compare& comp = key_compare()) // (23) C++26 + : flat_map(il.begin(), il.end(), comp) { } template -flat_map(initializer_list il, const Allocator& a); // (24) C++23 +flat_map(initializer_list il, + const Allocator& a); // (24) C++23 +template +constexpr + flat_map(initializer_list il, + const Allocator& a); // (24) C++26 template -flat_map(initializer_list il, const key_compare& comp, const Allocator& a); // (25) C++23 +flat_map(initializer_list il, + const key_compare& comp, + const Allocator& a); // (25) C++23 +template +constexpr flat_map(initializer_list il, + const key_compare& comp, + const Allocator& a); // (25) C++26 // ____initializer_list(ソート済み且つ重複なし)から構築____ -flat_map(sorted_unique_t s, initializer_list il, - const key_compare& comp = key_compare()) // (26) C++23 +flat_map(sorted_unique_t s, + initializer_list il, + const key_compare& comp = key_compare()) // (26) C++23 : flat_map(s, il.begin(), il.end(), comp) { } +constexpr + flat_map(sorted_unique_t s, + initializer_list il, + const key_compare& comp = key_compare()) // (26) C++26 + : flat_map(s, il.begin(), il.end(), comp) { } template -flat_map(sorted_unique_t, initializer_list il, const Allocator& a); // (27) C++23 +flat_map(sorted_unique_t, + initializer_list il, + const Allocator& a); // (27) C++23 +template +constexpr + flat_map(sorted_unique_t, + initializer_list il, + const Allocator& a); // (27) C++26 template -flat_map(sorted_unique_t, initializer_list il, - const key_compare& comp, const Allocator& a); // (28) C++23 +flat_map(sorted_unique_t, + initializer_list il, + const key_compare& comp, + const Allocator& a); // (28) C++23 +template +constexpr + flat_map(sorted_unique_t, + initializer_list il, + const key_compare& comp, + const Allocator& a); // (28) C++26 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] * from_range_t[link ../../ranges/from_range_t.md] @@ -268,3 +447,7 @@ int main() | 名前 | 説明 | |---------------------------------------|--------------------------------------------| | [`uses_allocator`](uses_allocator.md) | 指定されたアロケータと合致するかをチェックする | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/op_equal.md b/reference/flat_map/flat_map/op_equal.md index 1a5538c3df..7fc6f22168 100644 --- a/reference/flat_map/flat_map/op_equal.md +++ b/reference/flat_map/flat_map/op_equal.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -friend bool operator==(const flat_map& x, const flat_map& y); +friend bool operator==(const flat_map& x, const flat_map& y); // (1) C++23 +constexpr friend bool operator==(const flat_map& x, const flat_map& y); // (1) C++26 ``` ## 概要 @@ -71,3 +72,7 @@ true - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/rbegin.md b/reference/flat_map/flat_map/rbegin.md index 6f275316dd..efd6814faf 100644 --- a/reference/flat_map/flat_map/rbegin.md +++ b/reference/flat_map/flat_map/rbegin.md @@ -6,8 +6,11 @@ * cpp23[meta cpp] ```cpp -reverse_iterator rbegin() noexcept; -const_reverse_iterator rbegin() const noexcept; +reverse_iterator rbegin() noexcept; // (1) C++23 +constexpr reverse_iterator rbegin() noexcept; // (1) C++26 + +const_reverse_iterator rbegin() const noexcept; // (2) C++23 +constexpr const_reverse_iterator rbegin() const noexcept; // (2) C++26 ``` ## 概要 @@ -79,3 +82,7 @@ int main() | [`flat_map::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_map::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`flat_map::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/rend.md b/reference/flat_map/flat_map/rend.md index f77850a43b..057dce4c8c 100644 --- a/reference/flat_map/flat_map/rend.md +++ b/reference/flat_map/flat_map/rend.md @@ -6,8 +6,11 @@ * cpp23[meta cpp] ```cpp -reverse_iterator rend() noexcept; -const_reverse_iterator rend() const noexcept; +reverse_iterator rend() noexcept; // (1) C++23 +constexpr reverse_iterator rend() noexcept; // (1) C++26 + +const_reverse_iterator rend() const noexcept; // (2) C++23 +constexpr const_reverse_iterator rend() const noexcept; // (2) C++26 ``` ## 概要 @@ -72,3 +75,7 @@ int main() | [`flat_map::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | | [`flat_map::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`flat_map::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/replace.md b/reference/flat_map/flat_map/replace.md index 07ff97fd70..26b9fb0256 100644 --- a/reference/flat_map/flat_map/replace.md +++ b/reference/flat_map/flat_map/replace.md @@ -6,7 +6,12 @@ * cpp23[meta cpp] ```cpp -void replace(key_container_type&& key_cont, mapped_container_type&& mapped_cont); // C++23 +void + replace(key_container_type&& key_cont, + mapped_container_type&& mapped_cont); // (1) C++23 +constexpr void + replace(key_container_type&& key_cont, + mapped_container_type&& mapped_cont); // (2) C++26 ``` ## 概要 @@ -17,7 +22,7 @@ void replace(key_container_type&& key_cont, mapped_container_type&& mapped_cont) `flat_map` クラスが内部で保持している [`containers`](containers.md) を `c` とすると、以下と等価。 ```cpp c.keys = std::move(key_cont); - c.values = std::move(mapped_cont) + c.values = std::move(mapped_cont); ``` @@ -92,3 +97,7 @@ int main() - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/size.md b/reference/flat_map/flat_map/size.md index 328270899d..62b79228e2 100644 --- a/reference/flat_map/flat_map/size.md +++ b/reference/flat_map/flat_map/size.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -size_type size() const noexcept; +size_type size() const noexcept; // (1) C++23 +constexpr size_type size() const noexcept; // (1) C++26 ``` ## 概要 @@ -67,3 +68,7 @@ int main () ## 関連項目 - [`empty()`](empty.md) + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/swap.md b/reference/flat_map/flat_map/swap.md index e75cc45a73..2936b8f8d7 100644 --- a/reference/flat_map/flat_map/swap.md +++ b/reference/flat_map/flat_map/swap.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -void swap(flat_map& y) noexcept; // (1) C++23 +void swap(flat_map& y) noexcept; // (1) C++23 +constexpr void swap(flat_map& y) noexcept; // (1) C++26 ``` ## 概要 @@ -79,3 +80,7 @@ fm2 : {[10,a], [20,b], [30,c]} - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/swap_free.md b/reference/flat_map/flat_map/swap_free.md index 8ac0a80c6c..2988842706 100644 --- a/reference/flat_map/flat_map/swap_free.md +++ b/reference/flat_map/flat_map/swap_free.md @@ -6,9 +6,14 @@ ```cpp namespace std { - template - void swap(flat_map& x, - flat_map& y); // (1) C++23 + template + void + swap(flat_map& x, + flat_map& y); // (1) C++23 + template + constexpr void + swap(flat_map& x, + flat_map& y); // (1) C++26 } ``` @@ -81,3 +86,7 @@ fm2 : {[10,a], [20,b], [30,c]} - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/try_emplace.md b/reference/flat_map/flat_map/try_emplace.md index 9a5febe3af..8da8cb7c46 100644 --- a/reference/flat_map/flat_map/try_emplace.md +++ b/reference/flat_map/flat_map/try_emplace.md @@ -9,35 +9,62 @@ template pair try_emplace(const key_type& k, - Args&&... args); // (1) C++23 + Args&&... args); // (1) C++23 +template +constexpr pair + try_emplace(const key_type& k, + Args&&... args); // (1) C++26 template pair try_emplace(key_type&& k, - Args&&... args); // (2) C++23 + Args&&... args); // (2) C++23 +template +constexpr pair + try_emplace(key_type&& k, + Args&&... args); // (2) C++26 template iterator try_emplace(const_iterator hint, const key_type& k, - Args&&... args); // (3) C++23 + Args&&... args); // (3) C++23 +template +constexpr iterator + try_emplace(const_iterator hint, + const key_type& k, + Args&&... args); // (3) C++26 template iterator try_emplace(const_iterator hint, key_type&& k, - Args&&... args); // (4) C++23 + Args&&... args); // (4) C++23 +template +constexpr iterator + try_emplace(const_iterator hint, + key_type&& k, + Args&&... args); // (4) C++26 template pair try_emplace(K&& k - Args&&... args); // (5) C++23 + Args&&... args); // (5) C++23 +template +constexpr pair + try_emplace(K&& k + Args&&... args); // (5) C++26 template iterator try_emplace(const_iterator hint, K&& k, - Args&&... args); // (6) C++23 + Args&&... args); // (6) C++23 +template +constexpr iterator + try_emplace(const_iterator hint, + K&& k, + Args&&... args); // (6) C++26 ``` ## 概要 @@ -173,3 +200,7 @@ false, 114, false | [`flat_map::insert_or_assign`](insert_or_assign.md) | 要素を挿入、あるいは代入する | | [`flat_map::emplace`](emplace.md) | 要素を直接構築する | | [`flat_map::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/upper_bound.md b/reference/flat_map/flat_map/upper_bound.md index b3d2d63c91..814cb2c000 100644 --- a/reference/flat_map/flat_map/upper_bound.md +++ b/reference/flat_map/flat_map/upper_bound.md @@ -6,15 +6,21 @@ * cpp23[meta cpp] ```cpp -iterator upper_bound(const key_type& x); // (1) C++23 +iterator upper_bound(const key_type& x); // (1) C++23 +constexpr iterator upper_bound(const key_type& x); // (1) C++26 template -iterator upper_bound(const K& x); // (2) C++23 +iterator upper_bound(const K& x); // (2) C++23 +template +constexpr iterator upper_bound(const K& x); // (2) C++26 -const_iterator upper_bound(const key_type& x) const; // (3) C++23 +const_iterator upper_bound(const key_type& x) const; // (3) C++23 +constexpr const_iterator upper_bound(const key_type& x) const; // (3) C++26 template -const_iterator upper_bound(const K& x) const; // (4) C++23 +const_iterator upper_bound(const K& x) const; // (4) C++23 +template +constexpr const_iterator upper_bound(const K& x) const; // (4) C++26 ``` ## 概要 @@ -116,3 +122,7 @@ D,5 | [`equal_range`](equal_range.md) | 指定したキーにマッチする要素範囲を返す | | [`find`](find.md) | 指定したキーで要素を探す | | [`count`](count.md) | 指定したキーにマッチする要素の数を返す | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/value_comp.md b/reference/flat_map/flat_map/value_comp.md index 9142b87da3..f60471d958 100644 --- a/reference/flat_map/flat_map/value_comp.md +++ b/reference/flat_map/flat_map/value_comp.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -value_compare value_comp() const; // C++23 +value_compare value_comp() const; // (1) C++23 +constexpr value_compare value_comp() const; // (1) C++26 ``` @@ -70,3 +71,7 @@ int main() |-------------------------------------|----------------------------------------------------------| | [`key_comp`](key_comp.md) | キー比較用の関数オブジェクトを取得する | | [`value_compare`](value_compare.md) | 要素値のキー部分で大小関係を判定する二項述語の型 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_map/values.md b/reference/flat_map/flat_map/values.md index 1db318e3c7..5b9f543daf 100644 --- a/reference/flat_map/flat_map/values.md +++ b/reference/flat_map/flat_map/values.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -const mapped_container_type& values() const noexcept; // C++23 +const mapped_container_type& values() const noexcept; // (1) C++23 +constexpr const mapped_container_type& values() const noexcept; // (1) C++26 ``` ## 概要 @@ -66,3 +67,7 @@ C | 名前 | 説明 | |-------------------------------|-------------------------------------------| | [`flat_map::keys`](keys.md) | キーのコンテナを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_multimap/begin.md b/reference/flat_map/flat_multimap/begin.md index 5efeb7caf1..838d316a3b 100644 --- a/reference/flat_map/flat_multimap/begin.md +++ b/reference/flat_map/flat_multimap/begin.md @@ -6,8 +6,11 @@ * cpp23[meta cpp] ```cpp -iterator begin() noexcept; -const_iterator begin() const noexcept; +iterator begin() noexcept; // (1) C++23 +constexpr iterator begin() noexcept; // (1) C++26 + +const_iterator begin() const noexcept; // (2) C++23 +constexpr const_iterator begin() const noexcept; // (2) C++26 ``` @@ -77,3 +80,7 @@ int main() | [`flat_multimap::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_multimap::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`flat_multimap::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_multimap/cbegin.md b/reference/flat_map/flat_multimap/cbegin.md index b668b771ab..596f6b051c 100644 --- a/reference/flat_map/flat_multimap/cbegin.md +++ b/reference/flat_map/flat_multimap/cbegin.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -const_iterator cbegin() const noexcept; +const_iterator cbegin() const noexcept; // (1) C++23 +constexpr const_iterator cbegin() const noexcept; // (1) C++26 ``` @@ -73,3 +74,7 @@ int main() | [`flat_multimap::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_multimap::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`flat_multimap::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_multimap/cend.md b/reference/flat_map/flat_multimap/cend.md index 3cbbb6a328..06013e304c 100644 --- a/reference/flat_map/flat_multimap/cend.md +++ b/reference/flat_map/flat_multimap/cend.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -const_iterator cend() const noexcept; +const_iterator cend() const noexcept; // (1) C++23 +constexpr const_iterator cend() const noexcept; // (1) C++26 ``` ## 概要 @@ -76,3 +77,7 @@ int main() | [`flat_multimap::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_multimap::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`flat_multimap::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_multimap/clear.md b/reference/flat_map/flat_multimap/clear.md index 9eabc66325..7ca4a20bc1 100644 --- a/reference/flat_map/flat_multimap/clear.md +++ b/reference/flat_map/flat_multimap/clear.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -void clear() noexcept; // (1) C++23 +void clear() noexcept; // (1) C++23 +constexpr void clear() noexcept; // (1) C++26 ``` ## 概要 @@ -58,3 +59,7 @@ int main () - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_multimap/contains.md b/reference/flat_map/flat_multimap/contains.md index 3f58809c47..1f68bad2cd 100644 --- a/reference/flat_map/flat_multimap/contains.md +++ b/reference/flat_map/flat_multimap/contains.md @@ -6,10 +6,17 @@ * cpp23[meta cpp] ```cpp -bool contains(const key_type& x) const; // (1) C++23 +bool + contains(const key_type& x) const; // (1) C++23 +constexpr bool + contains(const key_type& x) const; // (1) C++26 template -bool contains(const K& x) const; // (2) C++23 +bool + contains(const K& x) const; // (2) C++23 +template +constexpr bool + contains(const K& x) const; // (2) C++26 ``` @@ -82,3 +89,7 @@ contain - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_multimap/count.md b/reference/flat_map/flat_multimap/count.md index 1e59465e3b..d5de8b7357 100644 --- a/reference/flat_map/flat_multimap/count.md +++ b/reference/flat_map/flat_multimap/count.md @@ -6,10 +6,17 @@ * cpp23[meta cpp] ```cpp -size_type count(const key_type& x) const; // (1) C++23 +size_type + count(const key_type& x) const; // (1) C++23 +constexpr size_type + count(const key_type& x) const; // (1) C++26 template -size_type count(const K& x) const; // (2) C++23 +size_type + count(const K& x) const; // (2) C++23 +template +constexpr size_type + count(const K& x) const; // (2) C++26 ``` ## 概要 @@ -96,3 +103,7 @@ int main() ## 関連項目 - [`contains()`](contains.md) + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_multimap/crbegin.md b/reference/flat_map/flat_multimap/crbegin.md index f8d67ddb08..40ef9e147e 100644 --- a/reference/flat_map/flat_multimap/crbegin.md +++ b/reference/flat_map/flat_multimap/crbegin.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -const_reverse_iterator crbegin() const noexcept; +const_reverse_iterator crbegin() const noexcept; // (1) C++23 +constexpr const_reverse_iterator crbegin() const noexcept; // (1) C++26 ``` ## 概要 @@ -74,3 +75,7 @@ int main() | [`flat_multimap::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | | [`flat_multimap::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_multimap::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_multimap/crend.md b/reference/flat_map/flat_multimap/crend.md index 2a42c358c7..2d790bd1b2 100644 --- a/reference/flat_map/flat_multimap/crend.md +++ b/reference/flat_map/flat_multimap/crend.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -const_reverse_iterator crend() const noexcept; +const_reverse_iterator crend() const noexcept; // (1) C++23 +constexpr const_reverse_iterator crend() const noexcept; // (1) C++26 ``` @@ -72,3 +73,7 @@ int main() | [`flat_multimap::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | | [`flat_multimap::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_multimap::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_multimap/emplace.md b/reference/flat_map/flat_multimap/emplace.md index e9ac1748aa..5ac4762315 100644 --- a/reference/flat_map/flat_multimap/emplace.md +++ b/reference/flat_map/flat_multimap/emplace.md @@ -7,7 +7,11 @@ ```cpp template -iterator emplace(Args&&... args); +iterator + emplace(Args&&... args); // (1) C++23 +template +constexpr iterator + emplace(Args&&... args); // (1) C++26 ``` ## 概要 @@ -76,3 +80,7 @@ int main() | [`flat_multimap::insert`](insert.md) | 要素を挿入する | | [`flat_multimap::insert_range`](insert_range.md) | Rangeを挿入する | | [`flat_multimap::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_multimap/emplace_hint.md b/reference/flat_map/flat_multimap/emplace_hint.md index 019c1a2659..c3052a4f2b 100644 --- a/reference/flat_map/flat_multimap/emplace_hint.md +++ b/reference/flat_map/flat_multimap/emplace_hint.md @@ -7,7 +7,13 @@ ```cpp template -iterator emplace_hint(const_iterator hint, Args&&... args); +iterator + emplace_hint(const_iterator hint, + Args&&... args); // (1) C++23 +template +constexpr iterator + emplace_hint(const_iterator hint, + Args&&... args); // (1) C++26 ``` ## 概要 @@ -73,3 +79,7 @@ int main() | [`flat_multimap::insert`](insert.md) | 要素を挿入する | | [`flat_multimap::insert_range`](insert_range.md) | Rangeを挿入する | | [`flat_multimap::emplace`](emplace.md) | 要素を直接構築する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_multimap/empty.md b/reference/flat_map/flat_multimap/empty.md index a8e1573ab0..99f1119a38 100644 --- a/reference/flat_map/flat_multimap/empty.md +++ b/reference/flat_map/flat_multimap/empty.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -[[nodiscard]] bool empty() const noexcept; // (1) C++23 +[[nodiscard]] bool empty() const noexcept; // (1) C++23 +[[nodiscard]] constexpr bool empty() const noexcept; // (1) C++26 ``` ## 概要 @@ -57,3 +58,7 @@ int main () - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_multimap/end.md b/reference/flat_map/flat_multimap/end.md index 142823285a..662abed141 100644 --- a/reference/flat_map/flat_multimap/end.md +++ b/reference/flat_map/flat_multimap/end.md @@ -6,8 +6,11 @@ * cpp23[meta cpp] ```cpp -iterator end() noexcept; -const_iterator end() const noexcept; +iterator end() noexcept; // (1) C++23 +constexpr iterator end() noexcept; // (1) C++26 + +const_iterator end() const noexcept; // (2) C++23 +constexpr const_iterator end() const noexcept; // (2) C++26 ``` ## 概要 @@ -78,3 +81,7 @@ int main() | [`flat_multimap::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_multimap::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`flat_multimap::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_multimap/equal_range.md b/reference/flat_map/flat_multimap/equal_range.md index 1d64f5a5ff..cae2bfb496 100644 --- a/reference/flat_map/flat_multimap/equal_range.md +++ b/reference/flat_map/flat_multimap/equal_range.md @@ -6,17 +6,29 @@ * cpp23[meta cpp] ```cpp -pair equal_range(const key_type& x); // (1) C++23 +pair + equal_range(const key_type& x); // (1) C++23 +constexpr pair + equal_range(const key_type& x); // (1) C++26 template -pair equal_range(const K& x); // (2) C++23 +pair + equal_range(const K& x); // (2) C++23 +template +constexpr pair + equal_range(const K& x); // (2) C++26 pair - equal_range(const key_type& x) const; // (3) C++23 + equal_range(const key_type& x) const; // (3) C++23 +constexpr pair + equal_range(const key_type& x) const; // (3) C++26 template pair - equal_range(const K& x) const; // (4) C++23 + equal_range(const K& x) const; // (4) C++23 +template +constexpr pair + equal_range(const K& x) const; // (4) C++26 ``` ## 概要 @@ -81,3 +93,7 @@ B, 4 | [`flat_multimap::lower_bound`](lower_bound.md) | 与えられた値より小さくない最初の要素へのイテレータを返す | | [`flat_multimap::upper_bound`](upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | | [`flat_multimap::find`](find.md) | 指定したキーで要素を探す | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_multimap/erase.md b/reference/flat_map/flat_multimap/erase.md index 71c21413f6..9c96446c55 100644 --- a/reference/flat_map/flat_multimap/erase.md +++ b/reference/flat_map/flat_multimap/erase.md @@ -6,16 +6,22 @@ * cpp23[meta cpp] ```cpp -iterator erase(iterator position); // (1) C++23 +iterator erase(iterator position); // (1) C++23 +constexpr iterator erase(iterator position); // (1) C++26 -iterator erase(const_iterator position); // (2) C++23 +iterator erase(const_iterator position); // (2) C++23 +constexpr iterator erase(const_iterator position); // (2) C++26 -size_type erase(const key_type& x); // (3) C++23 +size_type erase(const key_type& x); // (3) C++23 +constexpr size_type erase(const key_type& x); // (3) C++26 template -size_type erase(K&& x); // (4) C++23 +size_type erase(K&& x); // (4) C++23 +template +constexpr size_type erase(K&& x); // (4) C++26 -iterator erase(const_iterator first, const_iterator last); // (5) C++23 +iterator erase(const_iterator first, const_iterator last); // (5) C++23 +constexpr iterator erase(const_iterator first, const_iterator last); // (5) C++26 ``` ## 概要 @@ -146,3 +152,7 @@ int main() | [`flat_multimap::clear`](clear.md) | 全ての要素を削除する | | [`flat_multimap::insert`](insert.md) | 要素を挿入する | | [`flat_multimap::find`](find.md) | 指定したキーで要素を探す | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_multimap/erase_if_free.md b/reference/flat_map/flat_multimap/erase_if_free.md index 7ddafb2786..8aabf84ce7 100644 --- a/reference/flat_map/flat_multimap/erase_if_free.md +++ b/reference/flat_map/flat_multimap/erase_if_free.md @@ -14,7 +14,16 @@ namespace std { class Predicate> typename flat_multimap::size_type erase_if(flat_multimap& c, - Predicate pred); + Predicate pred); // (1) C++23 + template + constexpr typename flat_multimap::size_type + erase_if(flat_multimap& c, + Predicate pred); // (1) C++26 } ``` @@ -84,3 +93,7 @@ C : 5 - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_multimap/extract.md b/reference/flat_map/flat_multimap/extract.md index 2ca6df2a4e..d07ed38f8a 100644 --- a/reference/flat_map/flat_multimap/extract.md +++ b/reference/flat_map/flat_multimap/extract.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -containers extract() &&; // C++23 +containers extract() &&; // (1) C++23 +constexpr containers extract() &&; // (1) C++26 ``` ## 概要 @@ -88,3 +89,7 @@ int main() ## 関連項目 - [`containers`](containers.md) + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_multimap/find.md b/reference/flat_map/flat_multimap/find.md index c5e14d6c59..400bd8d881 100644 --- a/reference/flat_map/flat_multimap/find.md +++ b/reference/flat_map/flat_multimap/find.md @@ -6,15 +6,21 @@ * cpp23[meta cpp] ```cpp -iterator find(const key_type& x); // (1) C++23 +iterator find(const key_type& x); // (1) C++23 +constexpr iterator find(const key_type& x); // (1) C++26 template -iterator find(const K& x); // (2) C++23 +iterator find(const K& x); // (2) C++23 +template +constexpr iterator find(const K& x); // (2) C++26 -const_iterator find(const key_type& x) const; // (3) C++23 +const_iterator find(const key_type& x) const; // (3) C++23 +constexpr const_iterator find(const key_type& x) const; // (3) C++26 template -const_iterator find(const K& x) const; // (4) C++23 +const_iterator find(const K& x) const; // (4) C++23 +template +constexpr const_iterator find(const K& x) const; // (4) C++26 ``` ## 概要 @@ -106,3 +112,7 @@ int main() ## 関連項目 - [`contains()`](contains.md) + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_multimap/insert.md b/reference/flat_map/flat_multimap/insert.md index db793d5aaa..1042663f49 100644 --- a/reference/flat_map/flat_multimap/insert.md +++ b/reference/flat_map/flat_multimap/insert.md @@ -6,34 +6,67 @@ * cpp23[meta cpp] ```cpp -iterator insert(const value_type& x); // (1) C++23 -iterator insert(value_type&& x); // (2) C++23 +iterator insert(const value_type& x); // (1) C++23 +constexpr iterator insert(const value_type& x); // (1) C++26 + +iterator insert(value_type&& x); // (2) C++23 +constexpr iterator insert(value_type&& x); // (2) C++26 iterator insert(const_iterator position, - const value_type& x); // (3) C++23 + const value_type& x); // (3) C++23 +constexpr iterator insert(const_iterator position, + const value_type& x); // (3) C++26 + iterator insert(const_iterator position, - value_type&& x); // (4) C++23 + value_type&& x); // (4) C++23 +constexpr iterator insert(const_iterator position, + value_type&& x); // (4) C++26 template -iterator insert(P&& x); // (5) C++23 +iterator insert(P&& x); // (5) C++23 +template +constexpr iterator insert(P&& x); // (5) C++26 template -iterator insert(const_iterator position, - P&&); // (6) C++23 +iterator + insert(const_iterator position, + P&&); // (6) C++23 +template +constexpr iterator + insert(const_iterator position, + P&&); // (6) C++26 template -void insert(InputIterator first, - InputIterator last); // (7) C++23 - +void + insert(InputIterator first, + InputIterator last); // (7) C++23 template -void insert(sorted_equivalent_t, - InputIterator first, - InputIterator last); // (8) C++23 +constexpr void + insert(InputIterator first, + InputIterator last); // (7) C++26 -void insert(initializer_list il); // (9) C++23 - -void insert(sorted_equivalent_t, - initializer_list il); // (10) C++23 +template +void + insert(sorted_equivalent_t, + InputIterator first, + InputIterator last); // (8) C++23 +template +constexpr void + insert(sorted_equivalent_t, + InputIterator first, + InputIterator last); // (8) C++26 + +void + insert(initializer_list il); // (9) C++23 +constexpr void + insert(initializer_list il); // (9) C++26 + +void + insert(sorted_equivalent_t, + initializer_list il); // (10) C++23 +constexpr void + insert(sorted_equivalent_t, + initializer_list il); // (10) C++26 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] * sorted_equivalent_t[link /reference/flat_map/sorted_equivalent_t.md] @@ -225,3 +258,7 @@ int main() | [`flat_multimap::insert_range`](insert_range.md) | Rangeを挿入する | | [`flat_multimap::emplace`](emplace.md) | 要素を直接構築する | | [`flat_multimap::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_multimap/insert_range.md b/reference/flat_map/flat_multimap/insert_range.md index c5ec738166..40801e5143 100644 --- a/reference/flat_map/flat_multimap/insert_range.md +++ b/reference/flat_map/flat_multimap/insert_range.md @@ -7,7 +7,9 @@ ```cpp template R> -void insert_range(R&& rg); // (1) C++23 +void insert_range(R&& rg); // (1) C++23 +template R> +constexpr void insert_range(R&& rg); // (1) C++26 ``` * container-compatible-range[link /reference/exposition-only/container-compatible-range.md] @@ -97,3 +99,7 @@ int main() | [`flat_multimap::insert`](insert.md) | 要素を挿入する | | [`flat_multimap::emplace`](emplace.md) | 要素を直接構築する | | [`flat_multimap::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_multimap/key_comp.md b/reference/flat_map/flat_multimap/key_comp.md index a2d1dec6a0..787959f30d 100644 --- a/reference/flat_map/flat_multimap/key_comp.md +++ b/reference/flat_map/flat_multimap/key_comp.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -key_compare key_comp() const; // C++23 +key_compare key_comp() const; // (1) C++23 +constexpr key_compare key_comp() const; // (1) C++26 ``` @@ -63,3 +64,7 @@ int main() |-------------------------------------|----------------------------------------------------------| | [`value_comp`](value_comp.md) | 要素比較用の関数オブジェクトを返す | | [`value_compare`](value_compare.md) | 要素値のキー部分で大小関係を判定する二項述語の型 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_multimap/key_equiv.md b/reference/flat_map/flat_multimap/key_equiv.md index ef9b3a7650..be86e5f1c6 100644 --- a/reference/flat_map/flat_multimap/key_equiv.md +++ b/reference/flat_map/flat_multimap/key_equiv.md @@ -7,11 +7,18 @@ ```cpp struct key_equiv { - key_equiv(key_compare c) : comp(c) { } + key_equiv(key_compare c) : comp(c) { } // (1) C++23 +constexpr + key_equiv(key_compare c) : comp(c) { } // (1) C++26 - bool operator()(const_reference x, const_reference y) const { - return !comp(x.first, y.first) && !comp(y.first, x.first); - } + bool + operator()(const_reference x, const_reference y) const { // (2) C++23 + return !comp(x.first, y.first) && !comp(y.first, x.first); + } + constexpr bool + operator()(const_reference x, const_reference y) const { // (2) C++26 + return !comp(x.first, y.first) && !comp(y.first, x.first); + } key_compare comp; }; @@ -29,3 +36,7 @@ struct key_equiv { - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_multimap/keys.md b/reference/flat_map/flat_multimap/keys.md index 5855b4c3d3..f367f12d17 100644 --- a/reference/flat_map/flat_multimap/keys.md +++ b/reference/flat_map/flat_multimap/keys.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -const key_container_type& keys() const noexcept; // C++23 +const key_container_type& keys() const noexcept; // (1) C++23 +constexpr const key_container_type& keys() const noexcept; // (1) C++26 ``` ## 概要 @@ -68,3 +69,7 @@ int main() | 名前 | 説明 | |----------------------------------------|-------------------------------------------| | [`flat_multimap::values`](values.md) | 値のコンテナを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_multimap/lower_bound.md b/reference/flat_map/flat_multimap/lower_bound.md index 3b5fe85171..c500443197 100644 --- a/reference/flat_map/flat_multimap/lower_bound.md +++ b/reference/flat_map/flat_multimap/lower_bound.md @@ -6,15 +6,21 @@ * cpp23[meta cpp] ```cpp -iterator lower_bound(const key_type& x); // (1) C++23 +iterator lower_bound(const key_type& x); // (1) C++23 +constexpr iterator lower_bound(const key_type& x); // (1) C++26 template -iterator lower_bound(const K& x); // (2) C++23 +iterator lower_bound(const K& x); // (2) C++23 +template +constexpr iterator lower_bound(const K& x); // (2) C++26 -const_iterator lower_bound(const key_type& x) const; // (3) C++23 +const_iterator lower_bound(const key_type& x) const; // (3) C++23 +constexpr const_iterator lower_bound(const key_type& x) const; // (3) C++26 template -const_iterator lower_bound(const K& x) const; // (4) C++23 +const_iterator lower_bound(const K& x) const; // (4) C++23 +template +constexpr const_iterator lower_bound(const K& x) const; // (4) C++26 ``` ## 概要 @@ -116,3 +122,7 @@ D,5 | [`equal_range`](equal_range.md) | 指定したキーにマッチする要素範囲を返す | | [`find`](find.md) | 指定したキーで要素を探す | | [`count`](count.md) | 指定したキーにマッチする要素の数を返す | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_multimap/max_size.md b/reference/flat_map/flat_multimap/max_size.md index a2d09ba997..42657b6200 100644 --- a/reference/flat_map/flat_multimap/max_size.md +++ b/reference/flat_map/flat_multimap/max_size.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -size_type max_size() const noexcept; // (1) C++23 +size_type max_size() const noexcept; // (1) C++23 +constexpr size_type max_size() const noexcept; // (1) C++26 ``` ## 概要 @@ -54,3 +55,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_multimap/op_assign.md b/reference/flat_map/flat_multimap/op_assign.md index 6d2075467d..643577f14e 100644 --- a/reference/flat_map/flat_multimap/op_assign.md +++ b/reference/flat_map/flat_multimap/op_assign.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -flat_multimap& operator=(initializer_list il); // C++23 +flat_multimap& operator=(initializer_list il); // (1) C++23 +constexpr flat_multimap& operator=(initializer_list il); // (1) C++26 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -74,3 +75,7 @@ int main() - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_multimap/op_compare_3way.md b/reference/flat_map/flat_multimap/op_compare_3way.md index 3110df6da4..84bd459222 100644 --- a/reference/flat_map/flat_multimap/op_compare_3way.md +++ b/reference/flat_map/flat_multimap/op_compare_3way.md @@ -9,6 +9,9 @@ synth-three-way-result operator<=>(const flat_multimap& x, const flat_multimap& y); // (1) C++23 +constexpr synth-three-way-result + operator<=>(const flat_multimap& x, + const flat_multimap& y); // (1) C++26 ``` ## 概要 @@ -87,3 +90,7 @@ false - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_multimap/op_constructor.md b/reference/flat_map/flat_multimap/op_constructor.md index dce58a13d1..caa19381ac 100644 --- a/reference/flat_map/flat_multimap/op_constructor.md +++ b/reference/flat_map/flat_multimap/op_constructor.md @@ -8,118 +8,291 @@ ```cpp // ____要素数ゼロのflat_multimapを構築____ -flat_multimap() : flat_multimap(key_compare()) { } // (1) C++23 +flat_multimap() + : flat_multimap(key_compare()) { } // (1) C++23 -explicit flat_multimap(const key_compare& comp) // (2) C++23 - : c(), compare(comp) { } +explicit + flat_multimap(const key_compare& comp) // (2) C++23 + : c(), compare(comp) { } +constexpr explicit + flat_multimap(const key_compare& comp) // (2) C++26 + : c(), compare(comp) { } template -explicit flat_multimap(const Allocator& a); // (3) C++23 +explicit + flat_multimap(const Allocator& a); // (3) C++23 +template +constexpr explicit + flat_multimap(const Allocator& a); // (3) C++26 template -flat_multimap(const key_compare& comp, const Allocator& a); // (4) C++23 +flat_multimap(const key_compare& comp, + const Allocator& a); // (4) C++23 +template +constexpr + flat_multimap(const key_compare& comp, + const Allocator& a); // (4) C++26 // ____アロケータを伴うコピー&ムーブコンストラクタ____ template - flat_multimap(const flat_multimap& x, const Allocator& a); // (5) C++26 + constexpr + flat_multimap(const flat_multimap& x, + const Allocator& a); // (5) C++26 template - flat_multimap(flat_multimap&& x, const Allocator& a); // (6) C++26 + constexpr + flat_multimap(flat_multimap&& x, + const Allocator& a); // (6) C++26 // ____key_container_typeとmapped_container_typeから構築____ -flat_multimap(key_container_type key_cont, mapped_container_type mapped_cont, - const key_compare& comp = key_compare()); // (7) C++23 +flat_multimap(key_container_type key_cont, + mapped_container_type mapped_cont, + const key_compare& comp = key_compare()); // (7) C++23 +constexpr + flat_multimap(key_container_type key_cont, + mapped_container_type mapped_cont, + const key_compare& comp = key_compare()); // (7) C++26 template -flat_multimap(const key_container_type& key_cont, const mapped_container_type& mapped_cont, - const Allocator& a); // (8) C++23 +flat_multimap(const key_container_type& key_cont, + const mapped_container_type& mapped_cont, + const Allocator& a); // (8) C++23 +template +constexpr + flat_multimap(const key_container_type& key_cont, + const mapped_container_type& mapped_cont, + const Allocator& a); // (8) C++26 template -flat_multimap(const key_container_type& key_cont, const mapped_container_type& mapped_cont, - const key_compare& comp, const Allocator& a); // (9) C++23 +flat_multimap(const key_container_type& key_cont, + const mapped_container_type& mapped_cont, + const key_compare& comp, + const Allocator& a); // (9) C++23 +template +constexpr + flat_multimap(const key_container_type& key_cont, + const mapped_container_type& mapped_cont, + const key_compare& comp, + const Allocator& a); // (9) C++26 // ____key_container_typeとmapped_container_type(共にソート済み)から構築____ -flat_multimap(sorted_equivalent_t, key_container_type key_cont, mapped_container_type mapped_cont, - const key_compare& comp = key_compare()); // (10) C++23 +flat_multimap(sorted_equivalent_t, + key_container_type key_cont, + mapped_container_type mapped_cont, + const key_compare& comp = key_compare()); // (10) C++23 +constexpr + flat_multimap(sorted_equivalent_t, + key_container_type key_cont, + mapped_container_type mapped_cont, + const key_compare& comp = key_compare()); // (10) C++26 template -flat_multimap(sorted_equivalent_t, const key_container_type& key_cont, - const mapped_container_type& mapped_cont, const Allocator& a); // (11) C++23 +flat_multimap(sorted_equivalent_t, + const key_container_type& key_cont, + const mapped_container_type& mapped_cont, + const Allocator& a); // (11) C++23 +template +constexpr + flat_multimap(sorted_equivalent_t, + const key_container_type& key_cont, + const mapped_container_type& mapped_cont, + const Allocator& a); // (11) C++26 template -flat_multimap(sorted_equivalent_t, const key_container_type& key_cont, +flat_multimap(sorted_equivalent_t, + const key_container_type& key_cont, const mapped_container_type& mapped_cont, - const key_compare& comp, const Allocator& a); // (12) C++23 + const key_compare& comp, + const Allocator& a); // (12) C++23 +template +constexpr + flat_multimap(sorted_equivalent_t, + const key_container_type& key_cont, + const mapped_container_type& mapped_cont, + const key_compare& comp, + const Allocator& a); // (12) C++26 // ____イテレータから構築____ - template -flat_multimap(InputIterator first, InputIterator last, const key_compare& comp = key_compare()) // (13) C++23 +flat_multimap(InputIterator first, + InputIterator last, + const key_compare& comp = key_compare()) // (13) C++23 : c(), compare(comp) { insert(first, last); } +template +constexpr + flat_multimap(InputIterator first, + InputIterator last, + const key_compare& comp = key_compare()) // (13) C++26 + : c(), compare(comp) { insert(first, last); } template -flat_multimap(InputIterator first, InputIterator last, const Allocator& a); // (14) C++23 +flat_multimap(InputIterator first, + InputIterator last, + const Allocator& a); // (14) C++23 +template +constexpr + flat_multimap(InputIterator first, + InputIterator last, + const Allocator& a); // (14) C++26 template -flat_multimap(InputIterator first, InputIterator last, - const key_compare& comp, const Allocator& a); // (15) C++23 +flat_multimap(InputIterator first, + InputIterator last, + const key_compare& comp, + const Allocator& a); // (15) C++23 +template +constexpr + flat_multimap(InputIterator first, + InputIterator last, + const key_compare& comp, + const Allocator& a); // (15) C++26 // ____イテレータ(ソート済み)から構築____ - template -flat_multimap(sorted_equivalent_t s, InputIterator first, InputIterator last, - const key_compare& comp = key_compare()) // (16) C++23 +flat_multimap(sorted_equivalent_t s, + InputIterator first, + InputIterator last, + const key_compare& comp = key_compare()) // (16) C++23 : c(), compare(comp) { insert(s, first, last); } +template +constexpr + flat_multimap(sorted_equivalent_t s, + InputIterator first, + InputIterator last, + const key_compare& comp = key_compare()) // (16) C++26 + : c(), compare(comp) { insert(s, first, last); } template -flat_multimap(sorted_equivalent_t, InputIterator first, InputIterator last, const Allocator& a); // (17) C++23 +flat_multimap(sorted_equivalent_t, + InputIterator first, + InputIterator last, + const Allocator& a); // (17) C++23 +template +constexpr + flat_multimap(sorted_equivalent_t, + InputIterator first, + InputIterator last, + const Allocator& a); // (17) C++26 template -flat_multimap(sorted_equivalent_t, InputIterator first, InputIterator last, - const key_compare& comp, const Allocator& a); // (18) C++23 +flat_multimap(sorted_equivalent_t, + InputIterator first, + InputIterator last, + const key_compare& comp, + const Allocator& a); // (18) C++23 + template +constexpr + flat_multimap(sorted_equivalent_t, + InputIterator first, + InputIterator last, + const key_compare& comp, + const Allocator& a); // (18) C++26 // ____Rangeから構築____ - template R> -flat_multimap(from_range_t fr, R&& rg) // (19) C++23 +flat_multimap(from_range_t fr, + R&& rg) // (19) C++23 : flat_multimap(fr, forward(rg), key_compare()) { } +template R> +constexpr + flat_multimap(from_range_t fr, + R&& rg) // (19) C++26 + : flat_multimap(fr, forward(rg), key_compare()) { } template R> -flat_multimap(from_range_t, R&& rg, const key_compare& comp) // (20) C++23 +flat_multimap(from_range_t, + R&& rg, + const key_compare& comp) // (20) C++23 : flat_multimap(comp) { insert_range(forward(rg)); } +template R> +constexpr + flat_multimap(from_range_t, + R&& rg, + const key_compare& comp) // (20) C++26 + : flat_multimap(comp) { insert_range(forward(rg)); } template R, class Allocator> -flat_multimap(from_range_t, R&& rg, const Allocator& a); // (21) C++23 +flat_multimap(from_range_t, + R&& rg, + const Allocator& a); // (21) C++23 +template R, class Allocator> +constexpr + flat_multimap(from_range_t, + R&& rg, + const Allocator& a); // (21) C++26 template R, class Allocator> -flat_multimap(from_range_t, R&& rg, const key_compare& comp, const Allocator& a); // (22) C++23 +flat_multimap(from_range_t, + R&& rg, + const key_compare& comp, + const Allocator& a); // (22) C++23 +template R, class Allocator> +constexpr + flat_multimap(from_range_t, + R&& rg, + const key_compare& comp, + const Allocator& a); // (22) C++26 // ____initializer_listから構築____ - -flat_multimap(initializer_list il, const key_compare& comp = key_compare()) // (23) C++23 +flat_multimap(initializer_list il, + const key_compare& comp = key_compare()) // (23) C++23 : flat_multimap(il.begin(), il.end(), comp) { } +constexpr + flat_multimap(initializer_list il, + const key_compare& comp = key_compare()) // (23) C++26 + : flat_multimap(il.begin(), il.end(), comp) { } template -flat_multimap(initializer_list il, const Allocator& a); // (24) C++23 +flat_multimap(initializer_list il, + const Allocator& a); // (24) C++23 +template +constexpr + flat_multimap(initializer_list il, + const Allocator& a); // (24) C++26 template -flat_multimap(initializer_list il, const key_compare& comp, const Allocator& a); // (25) C++23 +flat_multimap(initializer_list il, + const key_compare& comp, + const Allocator& a); // (25) C++23 +template +constexpr + flat_multimap(initializer_list il, + const key_compare& comp, + const Allocator& a); // (25) C++26 // ____initializer_list(ソート済み)から構築____ - -flat_multimap(sorted_equivalent_t s, initializer_list il, - const key_compare& comp = key_compare()) // (26) C++23 +flat_multimap(sorted_equivalent_t s, + initializer_list il, + const key_compare& comp = key_compare()) // (26) C++23 + : flat_multimap(s, il.begin(), il.end(), comp) { } +constexpr + flat_multimap(sorted_equivalent_t s, + initializer_list il, + const key_compare& comp = key_compare()) // (26) C++26 : flat_multimap(s, il.begin(), il.end(), comp) { } template -flat_multimap(sorted_equivalent_t, initializer_list il, const Allocator& a); // (27) C++23 +flat_multimap(sorted_equivalent_t, + initializer_list il, + const Allocator& a); // (27) C++23 +template +constexpr + flat_multimap(sorted_equivalent_t, + initializer_list il, + const Allocator& a); // (27) C++26 template -flat_multimap(sorted_equivalent_t, initializer_list il, - const key_compare& comp, const Allocator& a); // (28) C++23 +flat_multimap(sorted_equivalent_t, + initializer_list il, + const key_compare& comp, const Allocator& a); // (28) C++23 +template +constexpr + flat_multimap(sorted_equivalent_t, + initializer_list il, + const key_compare& comp, const Allocator& a); // (28) C++26 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] * from_range_t[link ../../ranges/from_range_t.md] @@ -269,3 +442,7 @@ int main() | 名前 | 説明 | |---------------------------------------|--------------------------------------------| | [`uses_allocator`](uses_allocator.md) | 指定されたアロケータと合致するかをチェックする | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_multimap/op_equal.md b/reference/flat_map/flat_multimap/op_equal.md index f987410bc5..67033bb19c 100644 --- a/reference/flat_map/flat_multimap/op_equal.md +++ b/reference/flat_map/flat_multimap/op_equal.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -friend bool operator==(const flat_multimap& x, const flat_multimap& y); +friend bool operator==(const flat_multimap& x, const flat_multimap& y); // (1) C++23 +constexpr friend bool operator==(const flat_multimap& x, const flat_multimap& y); // (1) C++26 ``` ## 概要 @@ -71,3 +72,7 @@ true - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_multimap/rbegin.md b/reference/flat_map/flat_multimap/rbegin.md index ec5ae422e1..e0f93247f5 100644 --- a/reference/flat_map/flat_multimap/rbegin.md +++ b/reference/flat_map/flat_multimap/rbegin.md @@ -6,8 +6,11 @@ * cpp23[meta cpp] ```cpp -reverse_iterator rbegin() noexcept; -const_reverse_iterator rbegin() const noexcept; +reverse_iterator rbegin() noexcept; // (1) C++23 +constexpr reverse_iterator rbegin() noexcept; // (1) C++26 + +const_reverse_iterator rbegin() const noexcept; // (2) C++23 +constexpr const_reverse_iterator rbegin() const noexcept; // (2) C++26 ``` ## 概要 @@ -77,3 +80,7 @@ int main() | [`flat_multimap::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_multimap::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`flat_multimap::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_multimap/rend.md b/reference/flat_map/flat_multimap/rend.md index d9c3711006..a6b53eccb2 100644 --- a/reference/flat_map/flat_multimap/rend.md +++ b/reference/flat_map/flat_multimap/rend.md @@ -6,8 +6,11 @@ * cpp23[meta cpp] ```cpp -reverse_iterator rend() noexcept; -const_reverse_iterator rend() const noexcept; +reverse_iterator rend() noexcept; // (1) C++23 +constexpr reverse_iterator rend() noexcept; // (1) C++26 + +const_reverse_iterator rend() const noexcept; // (2) C++23 +constexpr const_reverse_iterator rend() const noexcept; // (2) C++26 ``` ## 概要 @@ -70,3 +73,7 @@ int main() | [`flat_multimap::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | | [`flat_multimap::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`flat_multimap::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_multimap/replace.md b/reference/flat_map/flat_multimap/replace.md index 48b5889d81..0727199931 100644 --- a/reference/flat_map/flat_multimap/replace.md +++ b/reference/flat_map/flat_multimap/replace.md @@ -6,7 +6,12 @@ * cpp23[meta cpp] ```cpp -void replace(key_container_type&& key_cont, mapped_container_type&& mapped_cont); // C++23 +void + replace(key_container_type&& key_cont, + mapped_container_type&& mapped_cont); // (1) C++23 +constexpr void + replace(key_container_type&& key_cont, + mapped_container_type&& mapped_cont); // (1) C++26 ``` ## 概要 @@ -89,3 +94,7 @@ int main() - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_multimap/size.md b/reference/flat_map/flat_multimap/size.md index 4c3e67b877..177ef1bbb5 100644 --- a/reference/flat_map/flat_multimap/size.md +++ b/reference/flat_map/flat_multimap/size.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -size_type size() const noexcept; +size_type size() const noexcept; // (1) C++23 +constexpr size_type size() const noexcept; // (1) C++26 ``` ## 概要 @@ -67,3 +68,7 @@ int main () ## 関連項目 - [`empty()`](empty.md) + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_multimap/swap.md b/reference/flat_map/flat_multimap/swap.md index 44600a8e46..18f86609a2 100644 --- a/reference/flat_map/flat_multimap/swap.md +++ b/reference/flat_map/flat_multimap/swap.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -void swap(flat_multimap& y) noexcept; // (1) C++23 +void swap(flat_multimap& y) noexcept; // (1) C++23 +constexpr void swap(flat_multimap& y) noexcept; // (1) C++26 ``` ## 概要 @@ -79,3 +80,7 @@ fm2 : {[10,a], [20,b], [30,c]} - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_multimap/swap_free.md b/reference/flat_map/flat_multimap/swap_free.md index 84e6fba2d6..7dbc1bda72 100644 --- a/reference/flat_map/flat_multimap/swap_free.md +++ b/reference/flat_map/flat_multimap/swap_free.md @@ -6,9 +6,14 @@ ```cpp namespace std { - template - void swap(flat_multimap& x, - flat_multimap& y); // (1) C++23 + template + void + swap(flat_multimap& x, + flat_multimap& y); // (1) C++23 + template + constexpr void + swap(flat_multimap& x, + flat_multimap& y); // (1) C++26 } ``` @@ -81,3 +86,7 @@ fm2 : {[10,a], [20,b], [30,c]} - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_multimap/upper_bound.md b/reference/flat_map/flat_multimap/upper_bound.md index 768e42216a..7c7511fe6a 100644 --- a/reference/flat_map/flat_multimap/upper_bound.md +++ b/reference/flat_map/flat_multimap/upper_bound.md @@ -6,15 +6,21 @@ * cpp23[meta cpp] ```cpp -iterator upper_bound(const key_type& x); // (1) C++23 +iterator upper_bound(const key_type& x); // (1) C++23 +constexpr iterator upper_bound(const key_type& x); // (1) C++26 template -iterator upper_bound(const K& x); // (2) C++23 +iterator upper_bound(const K& x); // (2) C++23 +template +constexpr iterator upper_bound(const K& x); // (2) C++26 -const_iterator upper_bound(const key_type& x) const; // (3) C++23 +const_iterator upper_bound(const key_type& x) const; // (3) C++23 +constexpr const_iterator upper_bound(const key_type& x) const; // (3) C++26 template -const_iterator upper_bound(const K& x) const; // (4) C++23 +const_iterator upper_bound(const K& x) const; // (4) C++23 +template +constexpr const_iterator upper_bound(const K& x) const; // (4) C++26 ``` ## 概要 @@ -116,3 +122,7 @@ D,5 | [`equal_range`](equal_range.md) | 指定したキーにマッチする要素範囲を返す | | [`find`](find.md) | 指定したキーで要素を探す | | [`count`](count.md) | 指定したキーにマッチする要素の数を返す | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_multimap/value_comp.md b/reference/flat_map/flat_multimap/value_comp.md index 7894907123..943118136d 100644 --- a/reference/flat_map/flat_multimap/value_comp.md +++ b/reference/flat_map/flat_multimap/value_comp.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -value_compare value_comp() const; // C++23 +value_compare value_comp() const; // (1) C++23 +constexpr value_compare value_comp() const; // (1) C++26 ``` @@ -70,3 +71,7 @@ int main() |-------------------------------------|----------------------------------------------------------| | [`key_comp`](key_comp.md) | キー比較用の関数オブジェクトを取得する | | [`value_compare`](value_compare.md) | 要素値のキー部分で大小関係を判定する二項述語の型 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_map/flat_multimap/values.md b/reference/flat_map/flat_multimap/values.md index bb7ee26695..c03c3ab9d7 100644 --- a/reference/flat_map/flat_multimap/values.md +++ b/reference/flat_map/flat_multimap/values.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -const mapped_container_type& values() const noexcept; // C++23 +const mapped_container_type& values() const noexcept; // (1) C++23 +constexpr const mapped_container_type& values() const noexcept; // (1) C++26 ``` ## 概要 @@ -68,3 +69,7 @@ C | 名前 | 説明 | |-------------------------------|-------------------------------------------| | [`flat_multimap::keys`](keys.md) | キーのコンテナを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_multiset/begin.md b/reference/flat_set/flat_multiset/begin.md index 1db00e406d..c34dff3681 100644 --- a/reference/flat_set/flat_multiset/begin.md +++ b/reference/flat_set/flat_multiset/begin.md @@ -6,8 +6,11 @@ * cpp23[meta cpp] ```cpp -iterator begin() noexcept; -const_iterator begin() const noexcept; +iterator begin() noexcept; // (1) C++23 +constexpr iterator begin() noexcept; // (1) C++26 + +const_iterator begin() const noexcept; // (2) C++23 +constexpr const_iterator begin() const noexcept; // (2) C++26 ``` @@ -72,3 +75,7 @@ int main() | [`flat_multiset::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_multiset::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`flat_multiset::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_multiset/cbegin.md b/reference/flat_set/flat_multiset/cbegin.md index 31da02d40f..387135acfd 100644 --- a/reference/flat_set/flat_multiset/cbegin.md +++ b/reference/flat_set/flat_multiset/cbegin.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -const_iterator cbegin() const noexcept; +const_iterator cbegin() const noexcept; // (1) C++23 +constexpr const_iterator cbegin() const noexcept; // (1) C++26 ``` @@ -68,3 +69,7 @@ int main() | [`flat_multiset::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_multiset::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`flat_multiset::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_multiset/cend.md b/reference/flat_set/flat_multiset/cend.md index da44495731..0735dea041 100644 --- a/reference/flat_set/flat_multiset/cend.md +++ b/reference/flat_set/flat_multiset/cend.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -const_iterator cend() const noexcept; +const_iterator cend() const noexcept; // (1) C++23 +constexpr const_iterator cend() const noexcept; // (1) C++26 ``` ## 概要 @@ -71,3 +72,7 @@ int main() | [`flat_multiset::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_multiset::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`flat_multiset::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_multiset/clear.md b/reference/flat_set/flat_multiset/clear.md index d935fd497e..d636fb9ce2 100644 --- a/reference/flat_set/flat_multiset/clear.md +++ b/reference/flat_set/flat_multiset/clear.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -void clear() noexcept; // (1) C++23 +void clear() noexcept; // (1) C++23 +constexpr void clear() noexcept; // (1) C++26 ``` ## 概要 @@ -54,3 +55,7 @@ int main () - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_multiset/contains.md b/reference/flat_set/flat_multiset/contains.md index 3bc4296001..e8c821053c 100644 --- a/reference/flat_set/flat_multiset/contains.md +++ b/reference/flat_set/flat_multiset/contains.md @@ -6,10 +6,13 @@ * cpp23[meta cpp] ```cpp -bool contains(const key_type& x) const; // (1) C++23 +bool contains(const key_type& x) const; // (1) C++23 +constexpr bool contains(const key_type& x) const; // (1) C++26 template -bool contains(const K& x) const; // (2) C++23 +bool contains(const K& x) const; // (2) C++23 +template +constexpr bool contains(const K& x) const; // (2) C++26 ``` @@ -78,3 +81,7 @@ contain - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_multiset/count.md b/reference/flat_set/flat_multiset/count.md index c605ea333d..ad3a3dd88c 100644 --- a/reference/flat_set/flat_multiset/count.md +++ b/reference/flat_set/flat_multiset/count.md @@ -6,10 +6,13 @@ * cpp23[meta cpp] ```cpp -size_type count(const key_type& x) const; // (1) C++23 +size_type count(const key_type& x) const; // (1) C++23 +constexpr size_type count(const key_type& x) const; // (1) C++26 template -size_type count(const K& x) const; // (2) C++23 +size_type count(const K& x) const; // (2) C++23 +template +constexpr size_type count(const K& x) const; // (2) C++26 ``` ## 概要 @@ -88,3 +91,7 @@ int main() ## 関連項目 - [`contains()`](contains.md) + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_multiset/crbegin.md b/reference/flat_set/flat_multiset/crbegin.md index 769fb3b2d4..928edf122c 100644 --- a/reference/flat_set/flat_multiset/crbegin.md +++ b/reference/flat_set/flat_multiset/crbegin.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -const_reverse_iterator crbegin() const noexcept; +const_reverse_iterator crbegin() const noexcept; // (1) C++23 +constexpr const_reverse_iterator crbegin() const noexcept; // (1) C++26 ``` ## 概要 @@ -69,3 +70,7 @@ int main() | [`flat_multiset::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | | [`flat_multiset::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_multiset::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_multiset/crend.md b/reference/flat_set/flat_multiset/crend.md index 01cd3265be..e0d9df8206 100644 --- a/reference/flat_set/flat_multiset/crend.md +++ b/reference/flat_set/flat_multiset/crend.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -const_reverse_iterator crend() const noexcept; +const_reverse_iterator crend() const noexcept; // (1) C++23 +constexpr const_reverse_iterator crend() const noexcept; // (1) C++26 ``` @@ -67,3 +68,7 @@ int main() | [`flat_multiset::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | | [`flat_multiset::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_multiset::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_multiset/emplace.md b/reference/flat_set/flat_multiset/emplace.md index 49c04e5e44..65360bae56 100644 --- a/reference/flat_set/flat_multiset/emplace.md +++ b/reference/flat_set/flat_multiset/emplace.md @@ -7,7 +7,9 @@ ```cpp template -iterator emplace(Args&&... args); +iterator emplace(Args&&... args); // (1) C++23 +template +constexpr iterator emplace(Args&&... args); // (1) C++26 ``` ## 概要 @@ -108,3 +110,7 @@ CCCCC | [`flat_multiset::insert`](insert.md) | 要素を挿入する | | [`flat_multiset::insert_range`](insert_range.md) | Rangeを挿入する | | [`flat_multiset::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_multiset/emplace_hint.md b/reference/flat_set/flat_multiset/emplace_hint.md index 46e96497cf..ee98d6c214 100644 --- a/reference/flat_set/flat_multiset/emplace_hint.md +++ b/reference/flat_set/flat_multiset/emplace_hint.md @@ -7,7 +7,13 @@ ```cpp template -iterator emplace_hint(const_iterator hint, Args&&... args); +iterator + emplace_hint(const_iterator hint, + Args&&... args); // (1) C++23 +template +constexpr iterator + emplace_hint(const_iterator hint, + Args&&... args); // (1) C++26 ``` ## 概要 @@ -72,3 +78,7 @@ int main() | [`flat_multiset::insert`](insert.md) | 要素を挿入する | | [`flat_multiset::insert_range`](insert_range.md) | Rangeを挿入する | | [`flat_multiset::emplace`](emplace.md) | 要素を直接構築する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_multiset/empty.md b/reference/flat_set/flat_multiset/empty.md index df552ef67a..baee8668a0 100644 --- a/reference/flat_set/flat_multiset/empty.md +++ b/reference/flat_set/flat_multiset/empty.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -[[nodiscard]] bool empty() const noexcept; // (1) C++23 +[[nodiscard]] bool empty() const noexcept; // (1) C++23 +[[nodiscard]] constexpr bool empty() const noexcept; // (1) C++26 ``` ## 概要 @@ -57,3 +58,7 @@ int main () - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_multiset/end.md b/reference/flat_set/flat_multiset/end.md index 48ab910d61..df4c74e363 100644 --- a/reference/flat_set/flat_multiset/end.md +++ b/reference/flat_set/flat_multiset/end.md @@ -6,8 +6,11 @@ * cpp23[meta cpp] ```cpp -iterator end() noexcept; -const_iterator end() const noexcept; +iterator end() noexcept; // (1) C++23 +constexpr iterator end() noexcept; // (1) C++26 + +const_iterator end() const noexcept; // (2) C++23 +constexpr const_iterator end() const noexcept; // (2) C++26 ``` ## 概要 @@ -73,3 +76,7 @@ int main() | [`flat_multiset::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_multiset::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`flat_multiset::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_multiset/equal_range.md b/reference/flat_set/flat_multiset/equal_range.md index 9c7d4e6da8..5f03b65066 100644 --- a/reference/flat_set/flat_multiset/equal_range.md +++ b/reference/flat_set/flat_multiset/equal_range.md @@ -6,17 +6,29 @@ * cpp23[meta cpp] ```cpp -pair equal_range(const key_type& x); // (1) C++23 +pair + equal_range(const key_type& x); // (1) C++23 +constexpr pair + equal_range(const key_type& x); // (1) C++26 template -pair equal_range(const K& x); // (2) C++23 +pair + equal_range(const K& x); // (2) C++23 +template +constexpr pair + equal_range(const K& x); // (2) C++26 pair - equal_range(const key_type& x) const; // (3) C++23 + equal_range(const key_type& x) const; // (3) C++23 +constexpr pair + equal_range(const key_type& x) const; // (3) C++26 template pair - equal_range(const K& x) const; // (4) C++23 + equal_range(const K& x) const; // (4) C++23 +template +constexpr pair + equal_range(const K& x) const; // (4) C++26 ``` ## 概要 @@ -83,3 +95,7 @@ int main() | [`flat_multiset::lower_bound`](lower_bound.md) | 与えられた値より小さくない最初の要素へのイテレータを返す | | [`flat_multiset::upper_bound`](upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | | [`flat_multiset::find`](find.md) | 指定したキーで要素を探す | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_multiset/erase.md b/reference/flat_set/flat_multiset/erase.md index 44d0db376d..176f428e00 100644 --- a/reference/flat_set/flat_multiset/erase.md +++ b/reference/flat_set/flat_multiset/erase.md @@ -6,16 +6,22 @@ * cpp23[meta cpp] ```cpp -iterator erase(iterator position); // (1) C++23 +iterator erase(iterator position); // (1) C++23 +constexpr iterator erase(iterator position); // (1) C++26 -iterator erase(const_iterator position); // (2) C++23 +iterator erase(const_iterator position); // (2) C++23 +constexpr iterator erase(const_iterator position); // (2) C++26 -size_type erase(const key_type& x); // (3) C++23 +size_type erase(const key_type& x); // (3) C++23 +constexpr size_type erase(const key_type& x); // (3) C++26 template -size_type erase(K&& x); // (4) C++23 +size_type erase(K&& x); // (4) C++23 +template +constexpr size_type erase(K&& x); // (4) C++26 -iterator erase(const_iterator first, const_iterator last); // (5) C++23 +iterator erase(const_iterator first, const_iterator last); // (5) C++23 +constexpr iterator erase(const_iterator first, const_iterator last); // (5) C++26 ``` ## 概要 @@ -137,3 +143,7 @@ int main() | [`flat_multiset::clear`](clear.md) | 全ての要素を削除する | | [`flat_multiset::insert`](insert.md) | 要素を挿入する | | [`flat_multiset::find`](find.md) | 指定したキーで要素を探す | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_multiset/erase_if_free.md b/reference/flat_set/flat_multiset/erase_if_free.md index a35c1ddf0e..9d2d0c18f2 100644 --- a/reference/flat_set/flat_multiset/erase_if_free.md +++ b/reference/flat_set/flat_multiset/erase_if_free.md @@ -12,7 +12,14 @@ namespace std { class Predicate> typename flat_multiset::size_type erase_if(flat_multiset& c, - Predicate pred); + Predicate pred); // (1) C++23 + template + constexpr typename flat_multiset::size_type + erase_if(flat_multiset& c, + Predicate pred); // (1) C++26 } ``` @@ -75,3 +82,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_multiset/extract.md b/reference/flat_set/flat_multiset/extract.md index 43508c5fa9..08735e6466 100644 --- a/reference/flat_set/flat_multiset/extract.md +++ b/reference/flat_set/flat_multiset/extract.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -container_type extract() &&; // C++23 +container_type extract() &&; // (1) C++23 +constexpr container_type extract() &&; // (1) C++26 ``` ## 概要 @@ -76,3 +77,7 @@ int main() - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_multiset/find.md b/reference/flat_set/flat_multiset/find.md index 3d8b1ea920..96d94afec6 100644 --- a/reference/flat_set/flat_multiset/find.md +++ b/reference/flat_set/flat_multiset/find.md @@ -6,15 +6,21 @@ * cpp23[meta cpp] ```cpp -iterator find(const key_type& x); // (1) C++23 +iterator find(const key_type& x); // (1) C++23 +constexpr iterator find(const key_type& x); // (1) C++26 template -iterator find(const K& x); // (2) C++23 +iterator find(const K& x); // (2) C++23 +template +constexpr iterator find(const K& x); // (2) C++26 -const_iterator find(const key_type& x) const; // (3) C++23 +const_iterator find(const key_type& x) const; // (3) C++23 +constexpr const_iterator find(const key_type& x) const; // (3) C++26 template -const_iterator find(const K& x) const; // (4) C++23 +const_iterator find(const K& x) const; // (4) C++23 +template +constexpr const_iterator find(const K& x) const; // (4) C++26 ``` ## 概要 @@ -100,3 +106,7 @@ Bob ## 関連項目 - [`contains()`](contains.md) + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_multiset/insert.md b/reference/flat_set/flat_multiset/insert.md index 14294b61e2..4a10e439b8 100644 --- a/reference/flat_set/flat_multiset/insert.md +++ b/reference/flat_set/flat_multiset/insert.md @@ -6,34 +6,69 @@ * cpp23[meta cpp] ```cpp -iterator insert(const value_type& x); // (1) C++23 -iterator insert(value_type&& x); // (2) C++23 - -iterator insert(const_iterator position, - const value_type& x); // (3) C++23 -iterator insert(const_iterator position, - value_type&& x); // (4) C++23 +iterator insert(const value_type& x); // (1) C++23 +constexpr iterator insert(const value_type& x); // (1) C++26 + +iterator insert(value_type&& x); // (2) C++23 +constexpr iterator insert(value_type&& x); // (2) C++26 + +iterator + insert(const_iterator position, + const value_type& x); // (3) C++23 +constexpr iterator + insert(const_iterator position, + const value_type& x); // (3) C++26 + +iterator + insert(const_iterator position, + value_type&& x); // (4) C++23 +constexpr iterator + insert(const_iterator position, + value_type&& x); // (4) C++26 template -iterator insert(P&& x); // (5) C++23 +iterator insert(P&& x); // (5) C++23 +template +constexpr iterator insert(P&& x); // (5) C++26 template -iterator insert(const_iterator position, - P&&); // (6) C++23 +iterator + insert(const_iterator position, + P&& x); // (6) C++23 +template +constexpr iterator + insert(const_iterator position, + P&& x); // (6) C++26 template -void insert(InputIterator first, - InputIterator last); // (7) C++23 - +void + insert(InputIterator first, + InputIterator last); // (7) C++23 template -void insert(sorted_equivalent_t, - InputIterator first, - InputIterator last); // (8) C++23 - -void insert(initializer_list il); // (9) C++23 +constexpr void + insert(InputIterator first, + InputIterator last); // (7) C++26 -void insert(sorted_equivalent_t, - initializer_list il); // (10) C++23 +template +void + insert(sorted_equivalent_t, + InputIterator first, + InputIterator last); // (8) C++23 +template +constexpr void + insert(sorted_equivalent_t, + InputIterator first, + InputIterator last); // (8) C++26 + +void insert(initializer_list il); // (9) C++23 +constexpr void insert(initializer_list il); // (9) C++26 + +void + insert(sorted_equivalent_t, + initializer_list il); // (10) C++23 +constexpr void + insert(sorted_equivalent_t, + initializer_list il); // (10) C++26 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] * sorted_equivalent_t[link /reference/flat_set/sorted_equivalent_t.md] @@ -213,3 +248,7 @@ int main() | [`flat_multiset::insert_range`](insert_range.md) | Rangeを挿入する | | [`flat_multiset::emplace`](emplace.md) | 要素を直接構築する | | [`flat_multiset::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_multiset/insert_range.md b/reference/flat_set/flat_multiset/insert_range.md index 596ed6105f..93d22062d3 100644 --- a/reference/flat_set/flat_multiset/insert_range.md +++ b/reference/flat_set/flat_multiset/insert_range.md @@ -7,7 +7,9 @@ ```cpp template R> -void insert_range(R&& rg); // (1) C++23 +void insert_range(R&& rg); // (1) C++23 +template R> +constexpr void insert_range(R&& rg); // (1) C++26 ``` * container-compatible-range[link /reference/exposition-only/container-compatible-range.md] @@ -71,3 +73,7 @@ int main() | [`flat_multiset::insert`](insert.md) | 要素を挿入する | | [`flat_multiset::emplace`](emplace.md) | 要素を直接構築する | | [`flat_multiset::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_multiset/key_comp.md b/reference/flat_set/flat_multiset/key_comp.md index 01d8f6ebc4..6e7aa711ac 100644 --- a/reference/flat_set/flat_multiset/key_comp.md +++ b/reference/flat_set/flat_multiset/key_comp.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -key_compare key_comp() const; // C++23 +key_compare key_comp() const; // (1) C++23 +constexpr key_compare key_comp() const; // (1) C++26 ``` @@ -62,3 +63,7 @@ int main() | 名前 | 説明 | |-------------------------------------|----------------------------------------------------------| | [`value_comp`](value_comp.md) | 要素比較用の関数オブジェクトを返す | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_multiset/lower_bound.md b/reference/flat_set/flat_multiset/lower_bound.md index 6931de6d70..6ff8ba7040 100644 --- a/reference/flat_set/flat_multiset/lower_bound.md +++ b/reference/flat_set/flat_multiset/lower_bound.md @@ -6,15 +6,21 @@ * cpp23[meta cpp] ```cpp -iterator lower_bound(const key_type& x); // (1) C++23 +iterator lower_bound(const key_type& x); // (1) C++23 +constexpr iterator lower_bound(const key_type& x); // (1) C++26 template -iterator lower_bound(const K& x); // (2) C++23 +iterator lower_bound(const K& x); // (2) C++23 +template +constexpr iterator lower_bound(const K& x); // (2) C++26 -const_iterator lower_bound(const key_type& x) const; // (3) C++23 +const_iterator lower_bound(const key_type& x) const; // (3) C++23 +constexpr const_iterator lower_bound(const key_type& x) const; // (3) C++26 template -const_iterator lower_bound(const K& x) const; // (4) C++23 +const_iterator lower_bound(const K& x) const; // (4) C++23 +template +constexpr const_iterator lower_bound(const K& x) const; // (4) C++26 ``` ## 概要 @@ -119,3 +125,7 @@ David | [`flat_multiset::equal_range`](equal_range.md) | 指定したキーにマッチする要素範囲を返す | | [`flat_multiset::find`](find.md) | 指定したキーで要素を探す | | [`flat_multiset::count`](count.md) | 指定したキーにマッチする要素の数を返す | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_multiset/max_size.md b/reference/flat_set/flat_multiset/max_size.md index 2e73e75070..cd0a634aeb 100644 --- a/reference/flat_set/flat_multiset/max_size.md +++ b/reference/flat_set/flat_multiset/max_size.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -size_type max_size() const noexcept; // (1) C++23 +size_type max_size() const noexcept; // (1) C++23 +constexpr size_type max_size() const noexcept; // (1) C++26 ``` ## 概要 @@ -49,3 +50,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_multiset/op_assign.md b/reference/flat_set/flat_multiset/op_assign.md index d83fee63ab..37eeda2586 100644 --- a/reference/flat_set/flat_multiset/op_assign.md +++ b/reference/flat_set/flat_multiset/op_assign.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -flat_multiset& operator=(initializer_list il); // C++23 +flat_multiset& operator=(initializer_list il); // (1) C++23 +constexpr flat_multiset& operator=(initializer_list il); // (1) C++26 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -64,3 +65,7 @@ Carol - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_multiset/op_compare_3way.md b/reference/flat_set/flat_multiset/op_compare_3way.md index 2a7ca417df..e921ebb48e 100644 --- a/reference/flat_set/flat_multiset/op_compare_3way.md +++ b/reference/flat_set/flat_multiset/op_compare_3way.md @@ -9,6 +9,9 @@ synth-three-way-result operator<=>(const flat_multiset& x, const flat_multiset& y); // (1) C++23 +constexpr synth-three-way-result + operator<=>(const flat_multiset& x, + const flat_multiset& y); // (1) C++26 ``` ## 概要 @@ -81,3 +84,7 @@ false - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_multiset/op_constructor.md b/reference/flat_set/flat_multiset/op_constructor.md index ad03d33063..9d3be401a2 100644 --- a/reference/flat_set/flat_multiset/op_constructor.md +++ b/reference/flat_set/flat_multiset/op_constructor.md @@ -8,117 +8,281 @@ ```cpp // ____要素数ゼロのflat_multisetを構築____ -flat_multiset() : flat_multiset(key_compare()) { } // (1) C++23 +flat_multiset() + : flat_multiset(key_compare()) { } // (1) C++23 -explicit flat_multiset(const key_compare& comp) // (2) C++23 - : c(), compare(comp) { } +explicit + flat_multiset(const key_compare& comp) // (2) C++23 + : c(), compare(comp) { } +constexpr explicit + flat_multiset(const key_compare& comp) // (2) C++26 + : c(), compare(comp) { } template -explicit flat_multiset(const Allocator& a); // (3) C++23 +explicit + flat_multiset(const Allocator& a); // (3) C++23 +template +constexpr explicit + flat_multiset(const Allocator& a); // (3) C++26 template -flat_multiset(const key_compare& comp, const Allocator& a); // (4) C++23 +flat_multiset(const key_compare& comp, + const Allocator& a); // (4) C++23 +template +constexpr + flat_multiset(const key_compare& comp, + const Allocator& a); // (4) C++26 // ____アロケータを伴うコピー&ムーブコンストラクタ____ template - flat_multiset(const flat_multiset& x, const Allocator& a); // (5) C++26 + constexpr + flat_multiset(const flat_multiset& x, + const Allocator& a); // (5) C++26 template - flat_multiset(flat_multiset&& x, const Allocator& a); // (6) C++26 + constexpr + flat_multiset(flat_multiset&& x, + const Allocator& a); // (6) C++26 // ____container_typeから構築____ flat_multiset(container_type cont, - const key_compare& comp = key_compare()); // (7) C++23 + const key_compare& comp = key_compare()); // (7) C++23 +constexpr + flat_multiset(container_type cont, + const key_compare& comp = key_compare()); // (7) C++26 template flat_multiset(const container_type& cont, - const Allocator& a); // (8) C++23 + const Allocator& a); // (8) C++23 +template +constexpr + flat_multiset(const container_type& cont, + const Allocator& a); // (8) C++26 template flat_multiset(const container_type& cont, - const key_compare& comp, const Allocator& a); // (9) C++23 + const key_compare& comp, + const Allocator& a); // (9) C++23 +template +constexpr + flat_multiset(const container_type& cont, + const key_compare& comp, + const Allocator& a); // (9) C++26 // ____container_type(ソート済み)から構築____ -flat_multiset(sorted_equivalent_t, container_type cont, - const key_compare& comp = key_compare()); // (10) C++23 +flat_multiset(sorted_equivalent_t, + container_type cont, + const key_compare& comp = key_compare()); // (10) C++23 +constexpr + flat_multiset(sorted_equivalent_t, + container_type cont, + const key_compare& comp = key_compare()); // (10) C++26 template -flat_multiset(sorted_equivalent_t, const container_type& cont, - const Allocator& a); // (11) C++23 +flat_multiset(sorted_equivalent_t, + const container_type& cont, + const Allocator& a); // (11) C++23 +template +constexpr + flat_multiset(sorted_equivalent_t, + const container_type& cont, + const Allocator& a); // (11) C++26 template -flat_multiset(sorted_equivalent_t, const container_type& cont, - const key_compare& comp, const Allocator& a); // (12) C++23 +flat_multiset(sorted_equivalent_t, + const container_type& cont, + const key_compare& comp, + const Allocator& a); // (12) C++23 +template +constexpr + flat_multiset(sorted_equivalent_t, + const container_type& cont, + const key_compare& comp, + const Allocator& a); // (12) C++26 // ____イテレータから構築____ - template -flat_multiset(InputIterator first, InputIterator last, const key_compare& comp = key_compare()) // (13) C++23 +flat_multiset(InputIterator first, + InputIterator last, + const key_compare& comp = key_compare()) // (13) C++23 : c(), compare(comp) { insert(first, last); } +template +constexpr + flat_multiset(InputIterator first, + InputIterator last, + const key_compare& comp = key_compare()) // (13) C++26 + : c(), compare(comp) { insert(first, last); } template -flat_multiset(InputIterator first, InputIterator last, const Allocator& a); // (14) C++23 +flat_multiset(InputIterator first, + InputIterator last, + const Allocator& a); // (14) C++23 +template +constexpr + flat_multiset(InputIterator first, + InputIterator last, + const Allocator& a); // (14) C++26 template -flat_multiset(InputIterator first, InputIterator last, - const key_compare& comp, const Allocator& a); // (15) C++23 +flat_multiset(InputIterator first, + InputIterator last, + const key_compare& comp, + const Allocator& a); // (15) C++23 +template +constexpr + flat_multiset(InputIterator first, + InputIterator last, + const key_compare& comp, + const Allocator& a); // (15) C++26 // ____イテレータ(ソート済み)から構築____ - template -flat_multiset(sorted_equivalent_t s, InputIterator first, InputIterator last, - const key_compare& comp = key_compare()) // (16) C++23 +flat_multiset(sorted_equivalent_t s, + InputIterator first, + InputIterator last, + const key_compare& comp = key_compare()) // (16) C++23 : c(), compare(comp) { insert(s, first, last); } +template +constexpr + flat_multiset(sorted_equivalent_t s, + InputIterator first, + InputIterator last, + const key_compare& comp = key_compare()) // (16) C++26 + : c(), compare(comp) { insert(s, first, last); } template -flat_multiset(sorted_equivalent_t, InputIterator first, InputIterator last, const Allocator& a); // (17) C++23 +flat_multiset(sorted_equivalent_t, + InputIterator first, + InputIterator last, + const Allocator& a); // (17) C++23 +template +constexpr + flat_multiset(sorted_equivalent_t, + InputIterator first, + InputIterator last, + const Allocator& a); // (17) C++26 template -flat_multiset(sorted_equivalent_t, InputIterator first, InputIterator last, - const key_compare& comp, const Allocator& a); // (18) C++23 +flat_multiset(sorted_equivalent_t, + InputIterator first, + InputIterator last, + const key_compare& comp, + const Allocator& a); // (18) C++23 +template +constexpr + flat_multiset(sorted_equivalent_t, + InputIterator first, + InputIterator last, + const key_compare& comp, + const Allocator& a); // (18) C++26 // ____Rangeから構築____ - template R> -flat_multiset(from_range_t fr, R&& rg) // (19) C++23 +flat_multiset(from_range_t fr, + R&& rg) // (19) C++23 : flat_multiset(fr, forward(rg), key_compare()) { } +template R> +constexpr + flat_multiset(from_range_t fr, + R&& rg) // (19) C++26 + : flat_multiset(fr, forward(rg), key_compare()) { } template R> -flat_multiset(from_range_t, R&& rg, const key_compare& comp) // (20) C++23 +flat_multiset(from_range_t, + R&& rg, + const key_compare& comp) // (20) C++23 : flat_multiset(comp) { insert_range(forward(rg)); } +template R> +constexpr + flat_multiset(from_range_t, + R&& rg, + const key_compare& comp) // (20) C++26 + : flat_multiset(comp) { insert_range(forward(rg)); } template R, class Allocator> -flat_multiset(from_range_t, R&& rg, const Allocator& a); // (21) C++23 +flat_multiset(from_range_t, + R&& rg, + const Allocator& a); // (21) C++23 +template R, class Allocator> +constexpr + flat_multiset(from_range_t, + R&& rg, + const Allocator& a); // (21) C++26 template R, class Allocator> -flat_multiset(from_range_t, R&& rg, const key_compare& comp, const Allocator& a); // (22) C++23 +flat_multiset(from_range_t, + R&& rg, + const key_compare& comp, + const Allocator& a); // (22) C++23 +template R, class Allocator> +constexpr + flat_multiset(from_range_t, + R&& rg, + const key_compare& comp, + const Allocator& a); // (22) C++26 // ____initializer_listから構築____ - -flat_multiset(initializer_list il, const key_compare& comp = key_compare()) // (23) C++23 +flat_multiset(initializer_list il, + const key_compare& comp = key_compare()) // (23) C++23 : flat_multiset(il.begin(), il.end(), comp) { } +constexpr + flat_multiset(initializer_list il, + const key_compare& comp = key_compare()) // (23) C++26 + : flat_multiset(il.begin(), il.end(), comp) { } template -flat_multiset(initializer_list il, const Allocator& a); // (24) C++23 +flat_multiset(initializer_list il, + const Allocator& a); // (24) C++23 +template +constexpr + flat_multiset(initializer_list il, + const Allocator& a); // (24) C++26 template -flat_multiset(initializer_list il, const key_compare& comp, const Allocator& a); // (25) C++23 +flat_multiset(initializer_list il, + const key_compare& comp, + const Allocator& a); // (25) C++23 +template +constexpr + flat_multiset(initializer_list il, + const key_compare& comp, + const Allocator& a); // (25) C++26 // ____initializer_list(ソート済み)から構築____ - -flat_multiset(sorted_equivalent_t s, initializer_list il, - const key_compare& comp = key_compare()) // (26) C++23 +flat_multiset(sorted_equivalent_t s, + initializer_list il, + const key_compare& comp = key_compare()) // (26) C++23 + : flat_multiset(s, il.begin(), il.end(), comp) { } +constexpr + flat_multiset(sorted_equivalent_t s, + initializer_list il, + const key_compare& comp = key_compare()) // (26) C++26 : flat_multiset(s, il.begin(), il.end(), comp) { } template -flat_multiset(sorted_equivalent_t, initializer_list il, const Allocator& a); // (27) C++23 +flat_multiset(sorted_equivalent_t, + initializer_list il, + const Allocator& a); // (27) C++23 +template +constexpr + flat_multiset(sorted_equivalent_t, + initializer_list il, + const Allocator& a); // (27) C++26 template -flat_multiset(sorted_equivalent_t, initializer_list il, - const key_compare& comp, const Allocator& a); // (28) C++23 +flat_multiset(sorted_equivalent_t, + initializer_list il, + const key_compare& comp, + const Allocator& a); // (28) C++23 +template +constexpr + flat_multiset(sorted_equivalent_t, + initializer_list il, + const key_compare& comp, + const Allocator& a); // (28) C++26 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] * from_range_t[link ../../ranges/from_range_t.md] @@ -264,3 +428,7 @@ int main() | 名前 | 説明 | |---------------------------------------|--------------------------------------------| | [`uses_allocator`](uses_allocator.md) | 指定されたアロケータと合致するかをチェックする | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_multiset/op_equal.md b/reference/flat_set/flat_multiset/op_equal.md index a34524a175..b77dadb9d8 100644 --- a/reference/flat_set/flat_multiset/op_equal.md +++ b/reference/flat_set/flat_multiset/op_equal.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -friend bool operator==(const flat_multiset& x, const flat_multiset& y); +friend bool operator==(const flat_multiset& x, const flat_multiset& y); // (1) C++23 +constexpr friend bool operator==(const flat_multiset& x, const flat_multiset& y); // (1) C++26 ``` ## 概要 @@ -69,3 +70,7 @@ true - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_multiset/rbegin.md b/reference/flat_set/flat_multiset/rbegin.md index f1258edbeb..0e7bea2fd5 100644 --- a/reference/flat_set/flat_multiset/rbegin.md +++ b/reference/flat_set/flat_multiset/rbegin.md @@ -6,8 +6,11 @@ * cpp23[meta cpp] ```cpp -reverse_iterator rbegin() noexcept; -const_reverse_iterator rbegin() const noexcept; +reverse_iterator rbegin() noexcept; // (1) C++23 +constexpr reverse_iterator rbegin() noexcept; // (1) C++26 + +const_reverse_iterator rbegin() const noexcept; // (2) C++23 +constexpr const_reverse_iterator rbegin() const noexcept; // (2) C++26 ``` ## 概要 @@ -72,3 +75,7 @@ int main() | [`flat_multiset::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_multiset::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`flat_multiset::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_multiset/rend.md b/reference/flat_set/flat_multiset/rend.md index 9e5d1f7449..1adef50857 100644 --- a/reference/flat_set/flat_multiset/rend.md +++ b/reference/flat_set/flat_multiset/rend.md @@ -6,8 +6,11 @@ * cpp23[meta cpp] ```cpp -reverse_iterator rend() noexcept; -const_reverse_iterator rend() const noexcept; +reverse_iterator rend() noexcept; // (1) C++23 +constexpr reverse_iterator rend() noexcept; // (1) C++26 + +const_reverse_iterator rend() const noexcept; // (2) C++23 +constexpr const_reverse_iterator rend() const noexcept; // (2) C++26 ``` ## 概要 @@ -65,3 +68,7 @@ int main() | [`flat_multiset::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | | [`flat_multiset::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`flat_multiset::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_multiset/replace.md b/reference/flat_set/flat_multiset/replace.md index 99a8f02e2b..cafcfa590f 100644 --- a/reference/flat_set/flat_multiset/replace.md +++ b/reference/flat_set/flat_multiset/replace.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -void replace(container_type&& cont); // C++23 +void replace(container_type&& cont); // (1) C++23 +constexpr void replace(container_type&& cont); // (1) C++26 ``` ## 概要 @@ -88,3 +89,7 @@ int main() - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_multiset/size.md b/reference/flat_set/flat_multiset/size.md index 96cd7d9027..ea1fc2008b 100644 --- a/reference/flat_set/flat_multiset/size.md +++ b/reference/flat_set/flat_multiset/size.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -size_type size() const noexcept; +size_type size() const noexcept; // (1) C++23 +constexpr size_type size() const noexcept; // (1) C++26 ``` ## 概要 @@ -67,3 +68,7 @@ int main () ## 関連項目 - [`empty()`](empty.md) + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_multiset/swap.md b/reference/flat_set/flat_multiset/swap.md index 9b8a369d6d..7112799033 100644 --- a/reference/flat_set/flat_multiset/swap.md +++ b/reference/flat_set/flat_multiset/swap.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -void swap(flat_multiset& y) noexcept; // (1) C++23 +void swap(flat_multiset& y) noexcept; // (1) C++23 +constexpr void swap(flat_multiset& y) noexcept; // (1) C++26 ``` ## 概要 @@ -73,3 +74,7 @@ fs2 : {10, 20, 30} - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_multiset/swap_free.md b/reference/flat_set/flat_multiset/swap_free.md index f1e0c04ea3..0192721c2c 100644 --- a/reference/flat_set/flat_multiset/swap_free.md +++ b/reference/flat_set/flat_multiset/swap_free.md @@ -7,8 +7,13 @@ ```cpp namespace std { template - void swap(flat_multiset& x, - flat_multiset& y); // (1) C++23 + void + swap(flat_multiset& x, + flat_multiset& y); // (1) C++23 + template + constexpr void + swap(flat_multiset& x, + flat_multiset& y); // (1) C++26 } ``` @@ -74,3 +79,7 @@ fs2 : {10, 20, 30} - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_multiset/upper_bound.md b/reference/flat_set/flat_multiset/upper_bound.md index 880a11f82c..49344942c9 100644 --- a/reference/flat_set/flat_multiset/upper_bound.md +++ b/reference/flat_set/flat_multiset/upper_bound.md @@ -6,15 +6,21 @@ * cpp23[meta cpp] ```cpp -iterator upper_bound(const key_type& x); // (1) C++23 +iterator upper_bound(const key_type& x); // (1) C++23 +constexpr iterator upper_bound(const key_type& x); // (1) C++26 template -iterator upper_bound(const K& x); // (2) C++23 +iterator upper_bound(const K& x); // (2) C++23 +template +constexpr iterator upper_bound(const K& x); // (2) C++26 -const_iterator upper_bound(const key_type& x) const; // (3) C++23 +const_iterator upper_bound(const key_type& x) const; // (3) C++23 +constexpr const_iterator upper_bound(const key_type& x) const; // (3) C++26 template -const_iterator upper_bound(const K& x) const; // (4) C++23 +const_iterator upper_bound(const K& x) const; // (4) C++23 +template +constexpr const_iterator upper_bound(const K& x) const; // (4) C++26 ``` ## 概要 @@ -119,3 +125,7 @@ David | [`flat_multiset::equal_range`](equal_range.md) | 指定したキーにマッチする要素範囲を返す | | [`flat_multiset::find`](find.md) | 指定したキーで要素を探す | | [`flat_multiset::count`](count.md) | 指定したキーにマッチする要素の数を返す | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_multiset/value_comp.md b/reference/flat_set/flat_multiset/value_comp.md index f823b1c755..3af2dc5d31 100644 --- a/reference/flat_set/flat_multiset/value_comp.md +++ b/reference/flat_set/flat_multiset/value_comp.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -value_compare value_comp() const; // C++23 +value_compare value_comp() const; // (1) C++23 +constexpr value_compare value_comp() const; // (1) C++26 ``` @@ -63,3 +64,7 @@ int main() | 名前 | 説明 | |-------------------------------------|----------------------------------------------------------| | [`key_comp`](key_comp.md) | キー比較用の関数オブジェクトを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_set/begin.md b/reference/flat_set/flat_set/begin.md index 76cd50864d..2ee2b571a9 100644 --- a/reference/flat_set/flat_set/begin.md +++ b/reference/flat_set/flat_set/begin.md @@ -6,8 +6,11 @@ * cpp23[meta cpp] ```cpp -iterator begin() noexcept; -const_iterator begin() const noexcept; +iterator begin() noexcept; // (1) C++23 +constexpr iterator begin() noexcept; // (1) C++26 + +const_iterator begin() const noexcept; // (2) C++23 +constexpr const_iterator begin() const noexcept; // (2) C++26 ``` @@ -71,3 +74,7 @@ int main() | [`flat_set::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_set::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`flat_set::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_set/cbegin.md b/reference/flat_set/flat_set/cbegin.md index 6be52785bb..e331022d95 100644 --- a/reference/flat_set/flat_set/cbegin.md +++ b/reference/flat_set/flat_set/cbegin.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -const_iterator cbegin() const noexcept; +const_iterator cbegin() const noexcept; // (1) C++23 +constexpr const_iterator cbegin() const noexcept; // (1) C++26 ``` @@ -67,3 +68,7 @@ int main() | [`flat_set::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_set::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`flat_set::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_set/cend.md b/reference/flat_set/flat_set/cend.md index a2ad3527b5..881e6e8a51 100644 --- a/reference/flat_set/flat_set/cend.md +++ b/reference/flat_set/flat_set/cend.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -const_iterator cend() const noexcept; +const_iterator cend() const noexcept; // (1) C++23 +constexpr const_iterator cend() const noexcept; // (1) C++26 ``` ## 概要 @@ -70,3 +71,7 @@ int main() | [`flat_set::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_set::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`flat_set::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_set/clear.md b/reference/flat_set/flat_set/clear.md index 29bc4b37f1..d88a72e2a8 100644 --- a/reference/flat_set/flat_set/clear.md +++ b/reference/flat_set/flat_set/clear.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -void clear() noexcept; // (1) C++23 +void clear() noexcept; // (1) C++23 +constexpr void clear() noexcept; // (1) C++26 ``` ## 概要 @@ -54,3 +55,7 @@ int main () - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_set/contains.md b/reference/flat_set/flat_set/contains.md index 9d9e01d6cc..9a682abe0c 100644 --- a/reference/flat_set/flat_set/contains.md +++ b/reference/flat_set/flat_set/contains.md @@ -6,10 +6,13 @@ * cpp23[meta cpp] ```cpp -bool contains(const key_type& x) const; // (1) C++23 +bool contains(const key_type& x) const; // (1) C++23 +constexpr bool contains(const key_type& x) const; // (1) C++26 template -bool contains(const K& x) const; // (2) C++23 +bool contains(const K& x) const; // (2) C++23 +template +constexpr bool contains(const K& x) const; // (2) C++26 ``` @@ -78,3 +81,7 @@ contain - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_set/count.md b/reference/flat_set/flat_set/count.md index 4d6f18f86f..ad9512cee3 100644 --- a/reference/flat_set/flat_set/count.md +++ b/reference/flat_set/flat_set/count.md @@ -6,10 +6,13 @@ * cpp23[meta cpp] ```cpp -size_type count(const key_type& x) const; // (1) C++23 +size_type count(const key_type& x) const; // (1) C++23 +constexpr size_type count(const key_type& x) const; // (1) C++26 template -size_type count(const K& x) const; // (2) C++23 +size_type count(const K& x) const; // (2) C++23 +template +constexpr size_type count(const K& x) const; // (2) C++26 ``` ## 概要 @@ -95,3 +98,7 @@ found ## 関連項目 - [`contains()`](contains.md) + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_set/crbegin.md b/reference/flat_set/flat_set/crbegin.md index 966106f5b8..81f9842932 100644 --- a/reference/flat_set/flat_set/crbegin.md +++ b/reference/flat_set/flat_set/crbegin.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -const_reverse_iterator crbegin() const noexcept; +const_reverse_iterator crbegin() const noexcept; // (1) C++23 +constexpr const_reverse_iterator crbegin() const noexcept; // (1) C++26 ``` ## 概要 @@ -68,3 +69,7 @@ int main() | [`flat_set::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | | [`flat_set::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_set::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_set/crend.md b/reference/flat_set/flat_set/crend.md index 01a8136abe..7176bd7219 100644 --- a/reference/flat_set/flat_set/crend.md +++ b/reference/flat_set/flat_set/crend.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -const_reverse_iterator crend() const noexcept; +const_reverse_iterator crend() const noexcept; // (1) C++23 +constexpr const_reverse_iterator crend() const noexcept; // (1) C++26 ``` @@ -66,3 +67,7 @@ int main() | [`flat_set::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | | [`flat_set::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_set::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_set/emplace.md b/reference/flat_set/flat_set/emplace.md index 1c04c403c4..2c9ac1f998 100644 --- a/reference/flat_set/flat_set/emplace.md +++ b/reference/flat_set/flat_set/emplace.md @@ -7,7 +7,9 @@ ```cpp template -pair emplace(Args&&... args); +pair emplace(Args&&... args); // (1) C++23 +template +constexpr pair emplace(Args&&... args); // (1) C++26 ``` ## 概要 @@ -120,3 +122,7 @@ CCCCC | [`flat_set::insert`](insert.md) | 要素を挿入する | | [`flat_set::insert_range`](insert_range.md) | Rangeを挿入する | | [`flat_set::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_set/emplace_hint.md b/reference/flat_set/flat_set/emplace_hint.md index 46f6abed66..2d97e30210 100644 --- a/reference/flat_set/flat_set/emplace_hint.md +++ b/reference/flat_set/flat_set/emplace_hint.md @@ -7,7 +7,13 @@ ```cpp template -iterator emplace_hint(const_iterator hint, Args&&... args); +iterator + emplace_hint(const_iterator hint, + Args&&... args); // (1) C++23 +template +constexpr iterator + emplace_hint(const_iterator hint, + Args&&... args); // (1) C++26 ``` ## 概要 @@ -73,3 +79,7 @@ int main() | [`flat_set::insert`](insert.md) | 要素を挿入する | | [`flat_set::insert_range`](insert_range.md) | Rangeを挿入する | | [`flat_set::emplace`](emplace.md) | 要素を直接構築する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_set/empty.md b/reference/flat_set/flat_set/empty.md index 4b5a168160..1c424c7091 100644 --- a/reference/flat_set/flat_set/empty.md +++ b/reference/flat_set/flat_set/empty.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -[[nodiscard]] bool empty() const noexcept; // (1) C++23 +[[nodiscard]] bool empty() const noexcept; // (1) C++23 +[[nodiscard]] constexpr bool empty() const noexcept; // (1) C++26 ``` ## 概要 @@ -58,3 +59,7 @@ int main () - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_set/end.md b/reference/flat_set/flat_set/end.md index 0da6177328..6476d9cec2 100644 --- a/reference/flat_set/flat_set/end.md +++ b/reference/flat_set/flat_set/end.md @@ -6,8 +6,11 @@ * cpp23[meta cpp] ```cpp -iterator end() noexcept; -const_iterator end() const noexcept; +iterator end() noexcept; // (1) C++23 +constexpr iterator end() noexcept; // (1) C++26 + +const_iterator end() const noexcept; // (2) C++23 +constexpr const_iterator end() const noexcept; // (2) C++26 ``` ## 概要 @@ -72,3 +75,7 @@ int main() | [`flat_set::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_set::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`flat_set::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_set/equal_range.md b/reference/flat_set/flat_set/equal_range.md index f7d0551679..bc29ef3663 100644 --- a/reference/flat_set/flat_set/equal_range.md +++ b/reference/flat_set/flat_set/equal_range.md @@ -6,17 +6,29 @@ * cpp23[meta cpp] ```cpp -pair equal_range(const key_type& x); // (1) C++23 +pair + equal_range(const key_type& x); // (1) C++23 +constexpr pair + equal_range(const key_type& x); // (1) C++26 template -pair equal_range(const K& x); // (2) C++23 +pair + equal_range(const K& x); // (2) C++23 +template +constexpr pair + equal_range(const K& x); // (2) C++26 pair - equal_range(const key_type& x) const; // (3) C++23 + equal_range(const key_type& x) const; // (3) C++23 +constexpr pair + equal_range(const key_type& x) const; // (3) C++26 template pair - equal_range(const K& x) const; // (4) C++23 + equal_range(const K& x) const; // (4) C++23 +template +constexpr pair + equal_range(const K& x) const; // (4) C++26 ``` ## 概要 @@ -82,3 +94,7 @@ int main() | [`flat_set::lower_bound`](lower_bound.md) | 与えられた値より小さくない最初の要素へのイテレータを返す | | [`flat_set::upper_bound`](upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | | [`flat_set::find`](find.md) | 指定したキーで要素を探す | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_set/erase.md b/reference/flat_set/flat_set/erase.md index f700f70f81..76375802e9 100644 --- a/reference/flat_set/flat_set/erase.md +++ b/reference/flat_set/flat_set/erase.md @@ -6,16 +6,22 @@ * cpp23[meta cpp] ```cpp -iterator erase(iterator position); // (1) C++23 +iterator erase(iterator position); // (1) C++23 +constexpr iterator erase(iterator position); // (1) C++26 -iterator erase(const_iterator position); // (2) C++23 +iterator erase(const_iterator position); // (2) C++23 +constexpr iterator erase(const_iterator position); // (2) C++26 -size_type erase(const key_type& x); // (3) C++23 +size_type erase(const key_type& x); // (3) C++23 +constexpr size_type erase(const key_type& x); // (3) C++26 template -size_type erase(K&& x); // (4) C++23 +size_type erase(K&& x); // (4) C++23 +template +constexpr size_type erase(K&& x); // (4) C++26 -iterator erase(const_iterator first, const_iterator last); // (5) C++23 +iterator erase(const_iterator first, const_iterator last); // (5) C++23 +constexpr iterator erase(const_iterator first, const_iterator last); // (5) C++26 ``` ## 概要 @@ -137,3 +143,7 @@ int main() | [`flat_set::clear`](clear.md) | 全ての要素を削除する | | [`flat_set::insert`](insert.md) | 要素を挿入する | | [`flat_set::find`](find.md) | 指定したキーで要素を探す | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_set/erase_if_free.md b/reference/flat_set/flat_set/erase_if_free.md index 58646f1c29..8e6d7d2e44 100644 --- a/reference/flat_set/flat_set/erase_if_free.md +++ b/reference/flat_set/flat_set/erase_if_free.md @@ -12,7 +12,14 @@ namespace std { class Predicate> typename flat_set::size_type erase_if(flat_set& c, - Predicate pred); + Predicate pred); // (1) C++23 + template + constexpr typename flat_set::size_type + erase_if(flat_set& c, + Predicate pred); // (1) C++26 } ``` @@ -69,3 +76,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_set/extract.md b/reference/flat_set/flat_set/extract.md index dc2bbe200a..7be8b7cace 100644 --- a/reference/flat_set/flat_set/extract.md +++ b/reference/flat_set/flat_set/extract.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -container_type extract() &&; // C++23 +container_type extract() &&; // (1) C++23 +constexpr container_type extract() &&; // (1) C++26 ``` ## 概要 @@ -75,3 +76,7 @@ int main() - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_set/find.md b/reference/flat_set/flat_set/find.md index b4fba9c70c..3a94af9924 100644 --- a/reference/flat_set/flat_set/find.md +++ b/reference/flat_set/flat_set/find.md @@ -6,15 +6,21 @@ * cpp23[meta cpp] ```cpp -iterator find(const key_type& x); // (1) C++23 +iterator find(const key_type& x); // (1) C++23 +constexpr iterator find(const key_type& x); // (1) C++26 template -iterator find(const K& x); // (2) C++23 +iterator find(const K& x); // (2) C++23 +template +constexpr iterator find(const K& x); // (2) C++26 -const_iterator find(const key_type& x) const; // (3) C++23 +const_iterator find(const key_type& x) const; // (3) C++23 +constexpr const_iterator find(const key_type& x) const; // (3) C++26 template -const_iterator find(const K& x) const; // (4) C++23 +const_iterator find(const K& x) const; // (4) C++23 +template +constexpr const_iterator find(const K& x) const; // (4) C++26 ``` ## 概要 @@ -99,3 +105,7 @@ Bob ## 関連項目 - [`contains()`](contains.md) + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_set/insert.md b/reference/flat_set/flat_set/insert.md index 669f34497d..84c7ffbe79 100644 --- a/reference/flat_set/flat_set/insert.md +++ b/reference/flat_set/flat_set/insert.md @@ -6,34 +6,77 @@ * cpp23[meta cpp] ```cpp -pair insert(const value_type& x); // (1) C++23 -pair insert(value_type&& x); // (2) C++23 - -iterator insert(const_iterator position, - const value_type& x); // (3) C++23 -iterator insert(const_iterator position, - value_type&& x); // (4) C++23 +pair + insert(const value_type& x); // (1) C++23 +constexpr pair + insert(const value_type& x); // (1) C++26 + +pair + insert(value_type&& x); // (2) C++23 +constexpr pair + insert(value_type&& x); // (2) C++26 + +iterator + insert(const_iterator position, + const value_type& x); // (3) C++23 +constexpr iterator + insert(const_iterator position, + const value_type& x); // (3) C++26 + +iterator + insert(const_iterator position, + value_type&& x); // (4) C++23 +constexpr iterator + insert(const_iterator position, + value_type&& x); // (4) C++26 template -pair insert(P&& x); // (5) C++23 +pair + insert(P&& x); // (5) C++23 +template +constexpr pair + insert(P&& x); // (5) C++26 template -iterator insert(const_iterator position, - P&&); // (6) C++23 +iterator + insert(const_iterator position, + P&&); // (6) C++23 +template +constexpr iterator + insert(const_iterator position, + P&&); // (6) C++26 template -void insert(InputIterator first, - InputIterator last); // (7) C++23 - +void + insert(InputIterator first, + InputIterator last); // (7) C++23 template -void insert(sorted_unique_t, - InputIterator first, - InputIterator last); // (8) C++23 - -void insert(initializer_list il); // (9) C++23 +constexpr void + insert(InputIterator first, + InputIterator last); // (7) C++26 -void insert(sorted_unique_t s, - initializer_list il); // (10) C++23 +template +void + insert(sorted_unique_t, + InputIterator first, + InputIterator last); // (8) C++23 +template +constexpr void + insert(sorted_unique_t, + InputIterator first, + InputIterator last); // (8) C++26 + +void + insert(initializer_list il); // (9) C++23 +constexpr void + insert(initializer_list il); // (9) C++26 + +void + insert(sorted_unique_t s, + initializer_list il); // (10) C++23 +constexpr void + insert(sorted_unique_t s, + initializer_list il); // (10) C++26 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] * sorted_unique_t[link /reference/flat_set/sorted_unique_t.md] @@ -223,3 +266,7 @@ int main() | [`flat_set::insert_range`](insert_range.md) | Rangeを挿入する | | [`flat_set::emplace`](emplace.md) | 要素を直接構築する | | [`flat_set::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_set/insert_range.md b/reference/flat_set/flat_set/insert_range.md index 1e67de38f1..7a83eae38a 100644 --- a/reference/flat_set/flat_set/insert_range.md +++ b/reference/flat_set/flat_set/insert_range.md @@ -7,7 +7,9 @@ ```cpp template R> -void insert_range(R&& rg); // (1) C++23 +void insert_range(R&& rg); // (1) C++23 +template R> +constexpr void insert_range(R&& rg); // (1) C++26 ``` * container-compatible-range[link /reference/exposition-only/container-compatible-range.md] @@ -77,3 +79,7 @@ int main() | [`flat_set::insert`](insert.md) | 要素を挿入する | | [`flat_set::emplace`](emplace.md) | 要素を直接構築する | | [`flat_set::emplace_hint`](emplace_hint.md) | ヒントを使って要素を直接構築する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_set/key_comp.md b/reference/flat_set/flat_set/key_comp.md index af9fc68623..c919f4f7f6 100644 --- a/reference/flat_set/flat_set/key_comp.md +++ b/reference/flat_set/flat_set/key_comp.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -key_compare key_comp() const; // C++23 +key_compare key_comp() const; // (1) C++23 +constexpr key_compare key_comp() const; // (1) C++26 ``` @@ -62,3 +63,7 @@ int main() | 名前 | 説明 | |-------------------------------------|----------------------------------------------------------| | [`value_comp`](value_comp.md) | 要素比較用の関数オブジェクトを返す | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_set/lower_bound.md b/reference/flat_set/flat_set/lower_bound.md index fe99048550..1d1af01a91 100644 --- a/reference/flat_set/flat_set/lower_bound.md +++ b/reference/flat_set/flat_set/lower_bound.md @@ -6,15 +6,21 @@ * cpp23[meta cpp] ```cpp -iterator lower_bound(const key_type& x); // (1) C++23 +iterator lower_bound(const key_type& x); // (1) C++23 +constexpr iterator lower_bound(const key_type& x); // (1) C++26 template -iterator lower_bound(const K& x); // (2) C++23 +iterator lower_bound(const K& x); // (2) C++23 +template +constexpr iterator lower_bound(const K& x); // (2) C++26 -const_iterator lower_bound(const key_type& x) const; // (3) C++23 +const_iterator lower_bound(const key_type& x) const; // (3) C++23 +constexpr const_iterator lower_bound(const key_type& x) const; // (3) C++26 template -const_iterator lower_bound(const K& x) const; // (4) C++23 +const_iterator lower_bound(const K& x) const; // (4) C++23 +template +constexpr const_iterator lower_bound(const K& x) const; // (4) C++26 ``` ## 概要 @@ -119,3 +125,7 @@ David | [`flat_set::equal_range`](equal_range.md) | 指定したキーにマッチする要素範囲を返す | | [`flat_set::find`](find.md) | 指定したキーで要素を探す | | [`flat_set::count`](count.md) | 指定したキーにマッチする要素の数を返す | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_set/max_size.md b/reference/flat_set/flat_set/max_size.md index 4702090439..202945b73a 100644 --- a/reference/flat_set/flat_set/max_size.md +++ b/reference/flat_set/flat_set/max_size.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -size_type max_size() const noexcept; // (1) C++23 +size_type max_size() const noexcept; // (1) C++23 +constexpr size_type max_size() const noexcept; // (1) C++26 ``` ## 概要 @@ -49,3 +50,7 @@ int main() - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_set/op_assign.md b/reference/flat_set/flat_set/op_assign.md index 4999cee1e2..15a3c45896 100644 --- a/reference/flat_set/flat_set/op_assign.md +++ b/reference/flat_set/flat_set/op_assign.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -flat_set& operator=(initializer_list il); // C++23 +flat_set& operator=(initializer_list il); // (1) C++23 +constexpr flat_set& operator=(initializer_list il); // (1) C++26 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -63,3 +64,7 @@ Carol - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_set/op_compare_3way.md b/reference/flat_set/flat_set/op_compare_3way.md index a9c38f5a9d..f7eae7213f 100644 --- a/reference/flat_set/flat_set/op_compare_3way.md +++ b/reference/flat_set/flat_set/op_compare_3way.md @@ -9,6 +9,9 @@ synth-three-way-result operator<=>(const flat_set& x, const flat_set& y); // (1) C++23 +constexpr synth-three-way-result + operator<=>(const flat_set& x, + const flat_set& y); // (1) C++26 ``` ## 概要 @@ -80,3 +83,7 @@ false - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_set/op_constructor.md b/reference/flat_set/flat_set/op_constructor.md index 7a6fa5aafd..a46c4228f0 100644 --- a/reference/flat_set/flat_set/op_constructor.md +++ b/reference/flat_set/flat_set/op_constructor.md @@ -8,117 +8,281 @@ ```cpp // ____要素数ゼロのflat_setを構築____ -flat_set() : flat_set(key_compare()) { } // (1) C++23 +flat_set() + : flat_set(key_compare()) { } // (1) C++23 -explicit flat_set(const key_compare& comp) // (2) C++23 - : c(), compare(comp) { } +explicit + flat_set(const key_compare& comp) // (2) C++23 + : c(), compare(comp) { } +constexpr explicit + flat_set(const key_compare& comp) // (2) C++26 + : c(), compare(comp) { } template -explicit flat_set(const Allocator& a); // (3) C++23 +explicit + flat_set(const Allocator& a); // (3) C++23 +template +constexpr explicit + flat_set(const Allocator& a); // (3) C++26 template -flat_set(const key_compare& comp, const Allocator& a); // (4) C++23 +flat_set(const key_compare& comp, + const Allocator& a); // (4) C++23 +template +constexpr + flat_set(const key_compare& comp, + const Allocator& a); // (4) C++26 // ____アロケータを伴うコピー&ムーブコンストラクタ____ template - flat_set(const flat_set& x, const Allocator& a); // (5) C++26 + constexpr + flat_set(const flat_set& x, + const Allocator& a); // (5) C++26 template - flat_set(flat_set&& x, const Allocator& a); // (6) C++26 + constexpr + flat_set(flat_set&& x, + const Allocator& a); // (6) C++26 // ____container_typeから構築____ flat_set(container_type cont, - const key_compare& comp = key_compare()); // (7) C++23 + const key_compare& comp = key_compare()); // (7) C++23 +constexpr + flat_set(container_type cont, + const key_compare& comp = key_compare()); // (7) C++26 template flat_set(const container_type cont&, - const Allocator& a); // (8) C++23 + const Allocator& a); // (8) C++23 +template +constexpr + flat_set(const container_type cont&, + const Allocator& a); // (8) C++26 template flat_set(const container_type& cont, - const key_compare& comp, const Allocator& a); // (9) C++23 + const key_compare& comp, + const Allocator& a); // (9) C++23 +template +constexpr + flat_set(const container_type& cont, + const key_compare& comp, + const Allocator& a); // (9) C++26 // ____container_type(ソート済み且つ重複なし)から構築____ -flat_set(sorted_unique_t, container_type cont, - const key_compare& comp = key_compare()); // (10) C++23 +flat_set(sorted_unique_t, + container_type cont, + const key_compare& comp = key_compare()); // (10) C++23 +constexpr + flat_set(sorted_unique_t, + container_type cont, + const key_compare& comp = key_compare()); // (10) C++26 template -flat_set(sorted_unique_t, const container_type& cont, - const Allocator& a); // (11) C++23 +flat_set(sorted_unique_t, + const container_type& cont, + const Allocator& a); // (11) C++23 +template +constexpr + flat_set(sorted_unique_t, + const container_type& cont, + const Allocator& a); // (11) C++26 template -flat_set(sorted_unique_t, const container_type& cont, - const key_compare& comp, const Allocator& a); // (12) C++23 +flat_set(sorted_unique_t, + const container_type& cont, + const key_compare& comp, + const Allocator& a); // (12) C++23 +template +constexpr + flat_set(sorted_unique_t, + const container_type& cont, + const key_compare& comp, + const Allocator& a); // (12) C++26 // ____イテレータから構築____ - template -flat_set(InputIterator first, InputIterator last, const key_compare& comp = key_compare()) // (13) C++23 +flat_set(InputIterator first, + InputIterator last, + const key_compare& comp = key_compare()) // (13) C++23 : c(), compare(comp) { insert(first, last); } +template +constexpr + flat_set(InputIterator first, + InputIterator last, + const key_compare& comp = key_compare()) // (13) C++26 + : c(), compare(comp) { insert(first, last); } template -flat_set(InputIterator first, InputIterator last, const Allocator& a); // (14) C++23 +flat_set(InputIterator first, + InputIterator last, + const Allocator& a); // (14) C++23 +template +constexpr + flat_set(InputIterator first, + InputIterator last, + const Allocator& a); // (14) C++26 template -flat_set(InputIterator first, InputIterator last, - const key_compare& comp, const Allocator& a); // (15) C++23 +flat_set(InputIterator first, + InputIterator last, + const key_compare& comp, + const Allocator& a); // (15) C++23 +template +constexpr + flat_set(InputIterator first, + InputIterator last, + const key_compare& comp, + const Allocator& a); // (15) C++26 // ____イテレータ(ソート済み且つ重複なし)から構築____ - template -flat_set(sorted_unique_t s, InputIterator first, InputIterator last, - const key_compare& comp = key_compare()) // (16) C++23 +flat_set(sorted_unique_t s, + InputIterator first, + InputIterator last, + const key_compare& comp = key_compare()) // (16) C++23 : c(), compare(comp) { insert(s, first, last); } +template +constexpr + flat_set(sorted_unique_t s, + InputIterator first, + InputIterator last, + const key_compare& comp = key_compare()) // (16) C++26 + : c(), compare(comp) { insert(s, first, last); } template -flat_set(sorted_unique_t, InputIterator first, InputIterator last, const Allocator& a); // (17) C++23 +flat_set(sorted_unique_t, + InputIterator first, + InputIterator last, + const Allocator& a); // (17) C++23 +template +constexpr + flat_set(sorted_unique_t, + InputIterator first, + InputIterator last, + const Allocator& a); // (17) C++26 template -flat_set(sorted_unique_t, InputIterator first, InputIterator last, - const key_compare& comp, const Allocator& a); // (18) C++23 +flat_set(sorted_unique_t, + InputIterator first, + InputIterator last, + const key_compare& comp, + const Allocator& a); // (18) C++23 +template +constexpr + flat_set(sorted_unique_t, + InputIterator first, + InputIterator last, + const key_compare& comp, + const Allocator& a); // (18) C++26 // ____Rangeから構築____ - template R> -flat_set(from_range_t fr, R&& rg) // (19) C++23 +flat_set(from_range_t fr, + R&& rg) // (19) C++23 : flat_set(fr, forward(rg), key_compare()) { } +template R> +constexpr + flat_set(from_range_t fr, + R&& rg) // (19) C++26 + : flat_set(fr, forward(rg), key_compare()) { } template R> -flat_set(from_range_t, R&& rg, const key_compare& comp) // (20) C++23 +flat_set(from_range_t, + R&& rg, + const key_compare& comp) // (20) C++23 + : flat_set(comp) { insert_range(forward(rg)); } +template R> +constexpr + flat_set(from_range_t, + R&& rg, + const key_compare& comp) // (20) C++26 : flat_set(comp) { insert_range(forward(rg)); } template R, class Allocator> -flat_set(from_range_t, R&& rg, const Allocator& a); // (21) C++23 +flat_set(from_range_t, + R&& rg, + const Allocator& a); // (21) C++23 +template R, class Allocator> +constexpr + flat_set(from_range_t, + R&& rg, + const Allocator& a); // (21) C++26 template R, class Allocator> -flat_set(from_range_t, R&& rg, const key_compare& comp, const Allocator& a); // (22) C++23 +flat_set(from_range_t, + R&& rg, + const key_compare& comp, + const Allocator& a); // (22) C++23 +template R, class Allocator> +constexpr + flat_set(from_range_t, + R&& rg, + const key_compare& comp, + const Allocator& a); // (22) C++26 // ____initializer_listから構築____ - -flat_set(initializer_list il, const key_compare& comp = key_compare()) // (23) C++23 +flat_set(initializer_list il, + const key_compare& comp = key_compare()) // (23) C++23 : flat_set(il.begin(), il.end(), comp) { } +constexpr + flat_set(initializer_list il, + const key_compare& comp = key_compare()) // (23) C++26 + : flat_set(il.begin(), il.end(), comp) { } template -flat_set(initializer_list il, const Allocator& a); // (24) C++23 +flat_set(initializer_list il, + const Allocator& a); // (24) C++23 +template +constexpr + flat_set(initializer_list il, + const Allocator& a); // (24) C++26 template -flat_set(initializer_list il, const key_compare& comp, const Allocator& a); // (25) C++23 +flat_set(initializer_list il, + const key_compare& comp, + const Allocator& a); // (25) C++23 +template +constexpr + flat_set(initializer_list il, + const key_compare& comp, + const Allocator& a); // (25) C++26 // ____initializer_list(ソート済み且つ重複なし)から構築____ - -flat_set(sorted_unique_t s, initializer_list il, - const key_compare& comp = key_compare()) // (26) C++23 +flat_set(sorted_unique_t s, + initializer_list il, + const key_compare& comp = key_compare()) // (26) C++23 + : flat_set(s, il.begin(), il.end(), comp) { } +constexpr + flat_set(sorted_unique_t s, + initializer_list il, + const key_compare& comp = key_compare()) // (26) C++26 : flat_set(s, il.begin(), il.end(), comp) { } template -flat_set(sorted_unique_t, initializer_list il, const Allocator& a); // (27) C++23 +flat_set(sorted_unique_t, + initializer_list il, + const Allocator& a); // (27) C++23 +template +constexpr + flat_set(sorted_unique_t, + initializer_list il, + const Allocator& a); // (27) C++26 template -flat_set(sorted_unique_t, initializer_list il, - const key_compare& comp, const Allocator& a); // (28) C++23 +flat_set(sorted_unique_t, + initializer_list il, + const key_compare& comp, + const Allocator& a); // (28) C++23 +template +constexpr + flat_set(sorted_unique_t, + initializer_list il, + const key_compare& comp, + const Allocator& a); // (28) C++26 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] * from_range_t[link ../../ranges/from_range_t.md] @@ -265,3 +429,7 @@ int main() | 名前 | 説明 | |---------------------------------------|--------------------------------------------| | [`uses_allocator`](uses_allocator.md) | 指定されたアロケータと合致するかをチェックする | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_set/op_equal.md b/reference/flat_set/flat_set/op_equal.md index 83e8b60edf..5f282dac93 100644 --- a/reference/flat_set/flat_set/op_equal.md +++ b/reference/flat_set/flat_set/op_equal.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -friend bool operator==(const flat_set& x, const flat_set& y); +friend bool operator==(const flat_set& x, const flat_set& y); // (1) C++23 +constexpr friend bool operator==(const flat_set& x, const flat_set& y); // (1) C++26 ``` ## 概要 @@ -69,3 +70,7 @@ true - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_set/rbegin.md b/reference/flat_set/flat_set/rbegin.md index f35e2e8f7a..965b662619 100644 --- a/reference/flat_set/flat_set/rbegin.md +++ b/reference/flat_set/flat_set/rbegin.md @@ -6,8 +6,11 @@ * cpp23[meta cpp] ```cpp -reverse_iterator rbegin() noexcept; -const_reverse_iterator rbegin() const noexcept; +reverse_iterator rbegin() noexcept; // (1) C++23 +constexpr reverse_iterator rbegin() noexcept; // (1) C++26 + +const_reverse_iterator rbegin() const noexcept; // (2) C++23 +constexpr const_reverse_iterator rbegin() const noexcept; // (2) C++26 ``` ## 概要 @@ -71,3 +74,7 @@ int main() | [`flat_set::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`flat_set::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`flat_set::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_set/rend.md b/reference/flat_set/flat_set/rend.md index 6ba74bfb3a..b1cfaf4e92 100644 --- a/reference/flat_set/flat_set/rend.md +++ b/reference/flat_set/flat_set/rend.md @@ -6,8 +6,11 @@ * cpp23[meta cpp] ```cpp -reverse_iterator rend() noexcept; -const_reverse_iterator rend() const noexcept; +reverse_iterator rend() noexcept; // (1) C++23 +constexpr reverse_iterator rend() noexcept; // (1) C++26 + +const_reverse_iterator rend() const noexcept; // (2) C++23 +constexpr const_reverse_iterator rend() const noexcept; // (2) C++26 ``` ## 概要 @@ -64,3 +67,7 @@ int main() | [`flat_set::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | | [`flat_set::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`flat_set::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_set/replace.md b/reference/flat_set/flat_set/replace.md index 6f992f9135..544c8aa19a 100644 --- a/reference/flat_set/flat_set/replace.md +++ b/reference/flat_set/flat_set/replace.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -void replace(container_type&& cont); // C++23 +void replace(container_type&& cont); // (1) C++23 +constexpr void replace(container_type&& cont); // (1) C++26 ``` ## 概要 @@ -91,3 +92,7 @@ int main() - [GCC](/implementation.md#gcc): ?? - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_set/size.md b/reference/flat_set/flat_set/size.md index 43cd684b59..5fdfccbc5a 100644 --- a/reference/flat_set/flat_set/size.md +++ b/reference/flat_set/flat_set/size.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -size_type size() const noexcept; +size_type size() const noexcept; // (1) C++23 +constexpr size_type size() const noexcept; // (1) C++26 ``` ## 概要 @@ -67,3 +68,7 @@ int main () ## 関連項目 - [`empty()`](empty.md) + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_set/swap.md b/reference/flat_set/flat_set/swap.md index c0971d90f6..a7c466de95 100644 --- a/reference/flat_set/flat_set/swap.md +++ b/reference/flat_set/flat_set/swap.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -void swap(flat_set& y) noexcept; // (1) C++23 +void swap(flat_set& y) noexcept; // (1) C++23 +constexpr void swap(flat_set& y) noexcept; // (1) C++26 ``` ## 概要 @@ -73,3 +74,7 @@ fs2 : {10, 20, 30} - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_set/swap_free.md b/reference/flat_set/flat_set/swap_free.md index a9efa2d0e5..2c3b707d92 100644 --- a/reference/flat_set/flat_set/swap_free.md +++ b/reference/flat_set/flat_set/swap_free.md @@ -7,8 +7,13 @@ ```cpp namespace std { template - void swap(flat_set& x, - flat_set& y); // (1) C++23 + void + swap(flat_set& x, + flat_set& y); // (1) C++23 + template + constexpr void + swap(flat_set& x, + flat_set& y); // (1) C++26 } ``` @@ -74,3 +79,7 @@ fs2 : {10, 20, 30} - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_set/upper_bound.md b/reference/flat_set/flat_set/upper_bound.md index aaac5c6f4e..e398983352 100644 --- a/reference/flat_set/flat_set/upper_bound.md +++ b/reference/flat_set/flat_set/upper_bound.md @@ -6,15 +6,21 @@ * cpp23[meta cpp] ```cpp -iterator upper_bound(const key_type& x); // (1) C++23 +iterator upper_bound(const key_type& x); // (1) C++23 +constexpr iterator upper_bound(const key_type& x); // (1) C++26 template -iterator upper_bound(const K& x); // (2) C++23 +iterator upper_bound(const K& x); // (2) C++23 +template +constexpr iterator upper_bound(const K& x); // (2) C++26 -const_iterator upper_bound(const key_type& x) const; // (3) C++23 +const_iterator upper_bound(const key_type& x) const; // (3) C++23 +constexpr const_iterator upper_bound(const key_type& x) const; // (3) C++26 template -const_iterator upper_bound(const K& x) const; // (4) C++23 +const_iterator upper_bound(const K& x) const; // (4) C++23 +template +constexpr const_iterator upper_bound(const K& x) const; // (4) C++26 ``` ## 概要 @@ -119,3 +125,7 @@ David | [`flat_set::equal_range`](equal_range.md) | 指定したキーにマッチする要素範囲を返す | | [`flat_set::find`](find.md) | 指定したキーで要素を探す | | [`flat_set::count`](count.md) | 指定したキーにマッチする要素の数を返す | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/flat_set/flat_set/value_comp.md b/reference/flat_set/flat_set/value_comp.md index 5105617921..623e826fea 100644 --- a/reference/flat_set/flat_set/value_comp.md +++ b/reference/flat_set/flat_set/value_comp.md @@ -6,7 +6,8 @@ * cpp23[meta cpp] ```cpp -value_compare value_comp() const; // C++23 +value_compare value_comp() const; // (1) C++23 +constexpr value_compare value_comp() const; // (1) C++26 ``` @@ -63,3 +64,7 @@ int main() | 名前 | 説明 | |-------------------------------------|----------------------------------------------------------| | [`key_comp`](key_comp.md) | キー比較用の関数オブジェクトを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/assign.md b/reference/forward_list/forward_list/assign.md index 7fff11daa8..680b3dc735 100644 --- a/reference/forward_list/forward_list/assign.md +++ b/reference/forward_list/forward_list/assign.md @@ -7,11 +7,15 @@ ```cpp template -void assign(InputIterator first, InputIterator last); // (1) +void assign(InputIterator first, InputIterator last); // (1) C++11 +template +constexpr void assign(InputIterator first, InputIterator last); // (1) C++26 -void assign(size_type n, const T& t); // (2) +void assign(size_type n, const T& t); // (2) C++11 +constexpr void assign(size_type n, const T& t); // (2) C++26 -void assign(initializer_list init); // (3) +void assign(initializer_list init); // (3) C++11 +constexpr void assign(initializer_list init); // (3) C++26 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -131,3 +135,4 @@ ls3 : 1 2 3 ## 参照 - [N2679 Initializer Lists for Standard Containers(Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2679.pdf) - (3)の経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/assign_range.md b/reference/forward_list/forward_list/assign_range.md index bebec79a9c..62aab3fe2a 100644 --- a/reference/forward_list/forward_list/assign_range.md +++ b/reference/forward_list/forward_list/assign_range.md @@ -7,7 +7,9 @@ ```cpp template R> -void assign_range(R&& rg); // C++23 +void assign_range(R&& rg); // (1) C++23 +template R> +constexpr void assign_range(R&& rg); // (1) C++26 ``` ## 概要 @@ -62,3 +64,7 @@ int main() | 名前 | 説明 | |-------------------------------------------|----------------------| | [`assign`](assign.md) | コンテナに値を代入する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/before_begin.md b/reference/forward_list/forward_list/before_begin.md index 6fa17a554b..e228a58d2d 100644 --- a/reference/forward_list/forward_list/before_begin.md +++ b/reference/forward_list/forward_list/before_begin.md @@ -6,8 +6,11 @@ * cpp11[meta cpp] ```cpp -iterator before_begin() noexcept; -const_iterator before_begin() const noexcept; +iterator before_begin() noexcept; // (1) C++11 +constexpr iterator before_begin() noexcept; // (1) C++26 + +const_iterator before_begin() const noexcept; // (2) C++11 +constexpr const_iterator before_begin() const noexcept; // (2) C++26 ``` ## 概要 @@ -74,3 +77,4 @@ int main() ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/begin.md b/reference/forward_list/forward_list/begin.md index 2d327ecba4..ee842eab31 100644 --- a/reference/forward_list/forward_list/begin.md +++ b/reference/forward_list/forward_list/begin.md @@ -6,8 +6,11 @@ * cpp11[meta cpp] ```cpp -iterator begin() noexcept; -const_iterator begin() const noexcept; +iterator begin() noexcept; // (1) C++11 +constexpr iterator begin() noexcept; // (1) C++26 + +const_iterator begin() const noexcept; // (2) C++11 +constexpr const_iterator begin() const noexcept; // (2) C++26 ``` ## 概要 @@ -60,3 +63,4 @@ int main() ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/cbefore_begin.md b/reference/forward_list/forward_list/cbefore_begin.md index 72b2a618a6..67aa935528 100644 --- a/reference/forward_list/forward_list/cbefore_begin.md +++ b/reference/forward_list/forward_list/cbefore_begin.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_iterator cbefore_begin() const noexcept; +const_iterator cbefore_begin() const noexcept; // (1) C++11 +constexpr const_iterator cbefore_begin() const noexcept; // (1) C++26 ``` ## 概要 @@ -74,3 +75,4 @@ int main() ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/cbegin.md b/reference/forward_list/forward_list/cbegin.md index ccf14c466f..12a19d727e 100644 --- a/reference/forward_list/forward_list/cbegin.md +++ b/reference/forward_list/forward_list/cbegin.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_iterator cbegin() const noexcept; +const_iterator cbegin() const noexcept; // (1) C++11 +constexpr const_iterator cbegin() const noexcept; // (1) C++26 ``` ## 概要 @@ -59,3 +60,4 @@ int main() ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/cend.md b/reference/forward_list/forward_list/cend.md index 0762ff0b91..42ff6e4ede 100644 --- a/reference/forward_list/forward_list/cend.md +++ b/reference/forward_list/forward_list/cend.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_iterator cend() const noexcept; +const_iterator cend() const noexcept; // (1) C++11 +constexpr const_iterator cend() const noexcept; // (1) C++26 ``` ## 概要 @@ -62,3 +63,4 @@ int main() ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/clear.md b/reference/forward_list/forward_list/clear.md index 8044c95a6d..94c47aeeb4 100644 --- a/reference/forward_list/forward_list/clear.md +++ b/reference/forward_list/forward_list/clear.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -void clear() noexcept; +void clear() noexcept; // (1) C++11 +constexpr void clear() noexcept; // (1) C++26 ``` ## 概要 @@ -74,3 +75,4 @@ int main() ## 参照 - [LWG Issue 2231. DR 704 removes complexity guarantee for `clear()`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2231) - C++03までこの関数の効果は`erase(begin(), end())`だったため、それによって線形時間の計算量が保証されていたが、C++11で効果の表記が変わったために、保証がなくなってしまっていた。C++14であらためて保証を追加。 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/emplace_after.md b/reference/forward_list/forward_list/emplace_after.md index 12a49f3910..7560e9209c 100644 --- a/reference/forward_list/forward_list/emplace_after.md +++ b/reference/forward_list/forward_list/emplace_after.md @@ -7,7 +7,13 @@ ```cpp template -iterator emplace_after(const_iterator position, Args&&... args); +iterator + emplace_after(const_iterator position, + Args&&... args); // (1) C++11 +template +constexpr iterator + emplace_after(const_iterator position, + Args&&... args); // (1) C++26 ``` ## 概要 @@ -80,3 +86,4 @@ int main() ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/emplace_front.md b/reference/forward_list/forward_list/emplace_front.md index da5cac4fec..7d92e8ec9d 100644 --- a/reference/forward_list/forward_list/emplace_front.md +++ b/reference/forward_list/forward_list/emplace_front.md @@ -7,10 +7,11 @@ ```cpp template -void emplace_front(Args&&... args); // C++14 まで - +void emplace_front(Args&&... args); // (1) C++11 +template +reference emplace_front(Args&&... args); // (1) C++17 template -reference emplace_front(Args&&... args); // C++17 から +constexpr reference emplace_front(Args&&... args); // (1) C++26 ``` ## 概要 @@ -95,3 +96,4 @@ int main() - [P0084R0 Emplace Return Type](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0084r0.pdf) - [P0084R1 Emplace Return Type (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0084r1.pdf) - [P0084R2 Emplace Return Type (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0084r2.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/empty.md b/reference/forward_list/forward_list/empty.md index ec0f36196a..eae5483d6b 100644 --- a/reference/forward_list/forward_list/empty.md +++ b/reference/forward_list/forward_list/empty.md @@ -6,9 +6,9 @@ * cpp11[meta cpp] ```cpp -bool empty() const noexcept; // C++11 -[[nodiscard]] bool empty() const noexcept; // C++20 -bool empty() const noexcept; // C++26 +bool empty() const noexcept; // (1) C++11 +[[nodiscard]] bool empty() const noexcept; // (1) C++20 +constexpr bool empty() const noexcept; // (1) C++26 ``` ## 概要 @@ -72,3 +72,4 @@ false - C++20で`[[nodiscard]]`が付加された - [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) - C++26で`[[nodiscard]]`指定が削除された +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/end.md b/reference/forward_list/forward_list/end.md index af43a934cd..4746b59e3c 100644 --- a/reference/forward_list/forward_list/end.md +++ b/reference/forward_list/forward_list/end.md @@ -6,8 +6,11 @@ * cpp11[meta cpp] ```cpp -iterator end() noexcept; -const_iterator end() const noexcept; +iterator end() noexcept; // (1) C++11 +constexpr iterator end() noexcept; // (1) C++26 + +const_iterator end() const noexcept; // (2) C++11 +constexpr const_iterator end() const noexcept; // (2) C++26 ``` ## 概要 @@ -76,3 +79,4 @@ int main() ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/erase_after.md b/reference/forward_list/forward_list/erase_after.md index 0bfefe65e5..127ff9e18d 100644 --- a/reference/forward_list/forward_list/erase_after.md +++ b/reference/forward_list/forward_list/erase_after.md @@ -6,9 +6,17 @@ * cpp11[meta cpp] ```cpp -iterator erase_after(const_iterator position); // (1) -iterator erase_after(const_iterator position, - const_iterator last); // (2) +iterator + erase_after(const_iterator position); // (1) C++11 +constexpr iterator + erase_after(const_iterator position); // (1) C++26 + +iterator + erase_after(const_iterator position, + const_iterator last); // (2) C++11 +constexpr iterator + erase_after(const_iterator position, + const_iterator last); // (2) C++26 ``` ## 概要 @@ -138,3 +146,4 @@ int main() ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/erase_free.md b/reference/forward_list/forward_list/erase_free.md index 1e686e63bc..dcf9920f13 100644 --- a/reference/forward_list/forward_list/erase_free.md +++ b/reference/forward_list/forward_list/erase_free.md @@ -10,7 +10,7 @@ namespace std { typename forward_list::size_type erase(forward_list& c, const U& value); // (1) C++20 template - typename forward_list::size_type + constexpr typename forward_list::size_type erase(forward_list& c, const U& value); // (1) C++26 } ``` @@ -110,3 +110,4 @@ int main() { - [R1115R3 Improving the Return Value of Erase-Like Algorithms II: Free `erase`/`erase_if`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1115r3.pdf) - [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) - C++26で波カッコ初期化 (リスト初期化) に対応した +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/erase_if_free.md b/reference/forward_list/forward_list/erase_if_free.md index 85a1963d31..170448c115 100644 --- a/reference/forward_list/forward_list/erase_if_free.md +++ b/reference/forward_list/forward_list/erase_if_free.md @@ -7,7 +7,9 @@ ```cpp namespace std { template - typename forward_list::size_type erase_if(forward_list& c, Predicate pred); + typename forward_list::size_type erase_if(forward_list& c, Predicate pred); // (1) C++20 + template + constexpr typename forward_list::size_type erase_if(forward_list& c, Predicate pred); // (1) C++26 } ``` @@ -67,3 +69,4 @@ int main() ## 参照 - [P1209R0 Adopt consistent container erasure from Library Fundamentals 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1209r0.html) - [R1115R3 Improving the Return Value of Erase-Like Algorithms II: Free `erase`/`erase_if`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1115r3.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/front.md b/reference/forward_list/forward_list/front.md index cda1c14c77..817b8f4380 100644 --- a/reference/forward_list/forward_list/front.md +++ b/reference/forward_list/forward_list/front.md @@ -6,8 +6,11 @@ * cpp11[meta cpp] ```cpp -reference front(); -const_reference front() const; +reference front(); // (1) C++11 +constexpr reference front(); // (1) C++26 + +const_reference front() const; // (2) C++11 +constexpr const_reference front() const; // (2) C++26 ``` ## 概要 @@ -54,3 +57,4 @@ int main() ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/get_allocator.md b/reference/forward_list/forward_list/get_allocator.md index c57e08528a..98595d811d 100644 --- a/reference/forward_list/forward_list/get_allocator.md +++ b/reference/forward_list/forward_list/get_allocator.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -allocator_type get_allocator() const noexcept; +allocator_type get_allocator() const noexcept; // (1) C++11 +constexpr allocator_type get_allocator() const noexcept; // (1) C++26 ``` ## 概要 @@ -56,3 +57,4 @@ int main() ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/insert_after.md b/reference/forward_list/forward_list/insert_after.md index ef712000b9..88496c15bc 100644 --- a/reference/forward_list/forward_list/insert_after.md +++ b/reference/forward_list/forward_list/insert_after.md @@ -6,18 +6,46 @@ * cpp11[meta cpp] ```cpp -iterator insert_after(const_iterator position, const T& x); // (1) -iterator insert_after(const_iterator position, T&& x); // (2) -iterator insert_after(const_iterator position, size_type n, - const T& x); // (3) +iterator + insert_after(const_iterator position, + const T& x); // (1) C++11 +constexpr iterator + insert_after(const_iterator position, + const T& x); // (1) C++26 + +iterator + insert_after(const_iterator position, + T&& x); // (2) C++11 +constexpr iterator + insert_after(const_iterator position, + T&& x); // (2) C++26 + +iterator + insert_after(const_iterator position, + size_type n, + const T& x); // (3) C++11 +constexpr iterator + insert_after(const_iterator position, + size_type n, + const T& x); // (3) C++26 template -iterator insert_after(const_iterator position, - InputIterator first, - InputIterator last); // (4) - -iterator insert_after(const_iterator position, - initializer_list il); // (5) +iterator + insert_after(const_iterator position, + InputIterator first, + InputIterator last); // (4) C++11 +template +constexpr iterator + insert_after(const_iterator position, + InputIterator first, + InputIterator last); // (4) C++26 + +iterator + insert_after(const_iterator position, + initializer_list il); // (5) C++11 +constexpr iterator + insert_after(const_iterator position, + initializer_list il); // (5) C++26 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -140,3 +168,4 @@ insert initializer_list : 1 2 3 4 5 6 ## 参照 - [N2679 Initializer Lists for Standard Containers(Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2679.pdf) - (5)の経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/insert_range_after.md b/reference/forward_list/forward_list/insert_range_after.md index 150f9b3c16..1afff85d37 100644 --- a/reference/forward_list/forward_list/insert_range_after.md +++ b/reference/forward_list/forward_list/insert_range_after.md @@ -7,7 +7,13 @@ ```cpp template R> -iterator insert_range_after(const_iterator pos, R&& rg); // C++23 +iterator + insert_range_after(const_iterator pos, + R&& rg); // (1) C++23 +template R> +constexpr iterator + insert_range_after(const_iterator pos, + R&& rg); // (1) C++26 ``` ## 概要 @@ -59,3 +65,7 @@ int main() |-------------------------------------------|----------------------| | [`insert_after`](insert_after.md) | 任意の位置への要素挿入 | | [`emplace_after`](emplace_after.md) | 任意の位置への直接構築による要素挿入 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/max_size.md b/reference/forward_list/forward_list/max_size.md index 4187ac89b3..b82d2a6f59 100644 --- a/reference/forward_list/forward_list/max_size.md +++ b/reference/forward_list/forward_list/max_size.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -size_type max_size() const noexcept; +size_type max_size() const noexcept; // (1) C++11 +constexpr size_type max_size() const noexcept; // (1) C++26 ``` ## 概要 @@ -58,3 +59,4 @@ int main() ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/merge.md b/reference/forward_list/forward_list/merge.md index 8401d1f0ad..97230d0463 100644 --- a/reference/forward_list/forward_list/merge.md +++ b/reference/forward_list/forward_list/merge.md @@ -6,14 +6,21 @@ * cpp11[meta cpp] ```cpp -void merge(forward_list& x); // (1) -void merge(forward_list&& x); // (2) +void merge(forward_list& x); // (1) C++11 +constexpr void merge(forward_list& x); // (1) C++26 +void merge(forward_list&& x); // (2) C++11 +constexpr void merge(forward_list&& x); // (2) C++26 + +template +void merge(forward_list& x, Compare comp); // (3) C++11 template -void merge(forward_list& x, Compare comp); // (3) +constexpr void merge(forward_list& x, Compare comp); // (3) C++26 template -void merge(forward_list&& x, Compare comp); // (4) +void merge(forward_list&& x, Compare comp); // (4) C++11 +template +constexpr void merge(forward_list&& x, Compare comp); // (4) C++26 ``` ## 概要 @@ -94,3 +101,4 @@ int main() - [LWG Issue 2045. `forward_list::merge` and `forward_list::splice_after` with unequal allocators](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2045) - [LWG Issue 2122. `merge()` stability for lists versus forward lists](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2122) - [LWG Issue 2123. `merge()` allocator requirements for lists versus forward lists](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2123) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/op_assign.md b/reference/forward_list/forward_list/op_assign.md index f9668a31ed..2cf2351845 100644 --- a/reference/forward_list/forward_list/op_assign.md +++ b/reference/forward_list/forward_list/op_assign.md @@ -6,11 +6,17 @@ * cpp11[meta cpp] ```cpp -forward_list& operator=(const forward_list& x); // (1) -forward_list& operator=(forward_list&& x); // (2) +forward_list& operator=(const forward_list& x); // (1) C++11 +constexpr forward_list& operator=(const forward_list& x); // (1) C++26 + +forward_list& operator=(forward_list&& x); // (2) C++11 forward_list& operator=(forward_list&& x) - noexcept(allocator_traits::is_always_equal::value); // (2) C++ 17 -forward_list& operator=(initializer_list); // (3) + noexcept(allocator_traits::is_always_equal::value); // (2) C++17 +constexpr forward_list& operator=(forward_list&& x) + noexcept(allocator_traits::is_always_equal::value); // (2) C++26 + +forward_list& operator=(initializer_list); // (3) C++11 +constexpr forward_list& operator=(initializer_list); // (3) C++26 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -109,3 +115,4 @@ int main() - (3)の経緯となる提案文書 - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) - `noexcept` 追加の経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/op_compare_3way.md b/reference/forward_list/forward_list/op_compare_3way.md index ab8049991d..4bdb301320 100644 --- a/reference/forward_list/forward_list/op_compare_3way.md +++ b/reference/forward_list/forward_list/op_compare_3way.md @@ -10,6 +10,10 @@ namespace std { synth-three-way-result operator<=>(const forward_list& x, const forward_list& y); // (1) C++20 + template + constexpr synth-three-way-result + operator<=>(const forward_list& x, + const forward_list& y); // (1) C++26 } ``` @@ -81,3 +85,4 @@ int main () ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/op_constructor.md b/reference/forward_list/forward_list/op_constructor.md index 4d6c1bd270..38b877b81c 100644 --- a/reference/forward_list/forward_list/op_constructor.md +++ b/reference/forward_list/forward_list/op_constructor.md @@ -6,41 +6,78 @@ * cpp11[meta cpp] ```cpp -forward_list(); // (1) C++14 -explicit forward_list(const Allocator& a); // (2) C++14 +forward_list(); // (1) C++14 +constexpr forward_list(); // (1) C++26 -explicit forward_list(const Allocator& a = Allocator()); // (1) + (2) C++11 +explicit forward_list(const Allocator& a); // (2) C++14 +constexpr explicit forward_list(const Allocator& a); // (2) C++26 + +explicit forward_list(const Allocator& a = Allocator()); // (1) + (2) C++11まで forward_list(size_type n, const T& value, - const Allocator& a = Allocator()); // (3) C++11 - -explicit forward_list(size_type n); // (4) C++11 -explicit forward_list(size_type n, - const Allocator& a = Allocator()); // (4) C++14 + const Allocator& a = Allocator()); // (3) C++11 +constexpr + forward_list(size_type n, + const T& value, + const Allocator& a = Allocator()); // (3) C++26 + +explicit + forward_list(size_type n); // (4) C++11 +explicit + forward_list(size_type n, + const Allocator& a = Allocator()); // (4) C++14 +constexpr explicit + forward_list(size_type n, + const Allocator& a = Allocator()); // (4) C++26 template forward_list(InputIterator first, InputIterator last, - const Allocator& a = Allocator()); // (5) C++11 + const Allocator& a = Allocator()); // (5) C++11 +template +constexpr + forward_list(InputIterator first, + InputIterator last, + const Allocator& a = Allocator()); // (5) C++26 + +forward_list(const forward_list& x); // (6) C++11 +constexpr forward_list(const forward_list& x); // (6) C++26 -forward_list(const forward_list& x); // (6) C++11 -forward_list(forward_list&& x); // (7) C++11 +forward_list(forward_list&& x); // (7) C++11 +constexpr forward_list(forward_list&& x); // (7) C++26 -forward_list(const forward_list& x, const Allocator& a); // (8) C++11 forward_list(const forward_list& x, - const type_identity_t& a); // (8) C++23 + const Allocator& a); // (8) C++11 +forward_list(const forward_list& x, + const type_identity_t& a); // (8) C++23 +constexpr + forward_list(const forward_list& x, + const type_identity_t& a); // (8) C++26 -forward_list(forward_list&& x, const Allocator& a); // (9) C++11 forward_list(forward_list&& x, - const type_identity_t& a); // (9) C++23 + const Allocator& a); // (9) C++11 +forward_list(forward_list&& x, + const type_identity_t& a); // (9) C++23 +constexpr + forward_list(forward_list&& x, + const type_identity_t& a); // (9) C++26 forward_list(initializer_list il, - const Allocator& a = Allocator()); // (10) C++11 + const Allocator& a = Allocator()); // (10) C++11 +constexpr + forward_list(initializer_list il, + const Allocator& a = Allocator()); // (10) C++26 template R> -forward_list(from_range_t, R&& rg, - const Allocator& a = Allocator()); // (11) C++23 +forward_list(from_range_t, + R&& rg, + const Allocator& a = Allocator()); // (11) C++23 +template R> +constexpr + forward_list(from_range_t, + R&& rg, + const Allocator& a = Allocator()); // (11) C++26 ``` * type_identity_t[link /reference/type_traits/type_identity.md] * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -202,3 +239,4 @@ ls7 : 1 2 3 なお、Discussion の例はアロケータの型が誤っているので注意 - [P1518R2 Stop Overconstraining Allocators in Container Deduction Guides](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1518r2.html) - C++23でのアロケータ引数を`type_identity_t`で包む変更 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/op_destructor.md b/reference/forward_list/forward_list/op_destructor.md index d050c8e7b6..10cd1e6359 100644 --- a/reference/forward_list/forward_list/op_destructor.md +++ b/reference/forward_list/forward_list/op_destructor.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -~forward_list(); +~forward_list(); // (1) C++11 +constexpr ~forward_list(); // (1) C++26 ``` ## 概要 @@ -33,3 +34,4 @@ ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/op_equal.md b/reference/forward_list/forward_list/op_equal.md index 2864b05c32..0cb9ef571d 100644 --- a/reference/forward_list/forward_list/op_equal.md +++ b/reference/forward_list/forward_list/op_equal.md @@ -9,6 +9,9 @@ namespace std { template bool operator==(const forward_list& x, const forward_list& y); // (1) C++11 + template + constexpr bool operator==(const forward_list& x, + const forward_list& y); // (1) C++26 } ``` @@ -80,3 +83,4 @@ false ## 参照 - [LWG Issue 2257. Simplify container requirements with the new algorithms](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2257) - C++14から、2つ目のイテレータ範囲のendイテレータをとる`equal()`アルゴリズムを使用するようになった。 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/op_greater.md b/reference/forward_list/forward_list/op_greater.md index b1a193aa33..0396a4333c 100644 --- a/reference/forward_list/forward_list/op_greater.md +++ b/reference/forward_list/forward_list/op_greater.md @@ -10,6 +10,9 @@ namespace std { template bool operator>(const forward_list& x, const forward_list& y); // (1) C++11 + template + constexpr bool operator>(const forward_list& x, + const forward_list& y); // (1) C++26 } ``` @@ -61,3 +64,4 @@ true ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/op_greater_equal.md b/reference/forward_list/forward_list/op_greater_equal.md index 8454428fbf..2034b291ad 100644 --- a/reference/forward_list/forward_list/op_greater_equal.md +++ b/reference/forward_list/forward_list/op_greater_equal.md @@ -10,6 +10,9 @@ namespace std { template bool operator>=(const forward_list& x, const forward_list& y); // (1) C++11 + template + constexpr bool operator>=(const forward_list& x, + const forward_list& y); // (1) C++26 } ``` @@ -61,3 +64,4 @@ true ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/op_less.md b/reference/forward_list/forward_list/op_less.md index c89361bfdf..75d3f134e3 100644 --- a/reference/forward_list/forward_list/op_less.md +++ b/reference/forward_list/forward_list/op_less.md @@ -10,6 +10,9 @@ namespace std { template bool operator<(const forward_list& x, const forward_list& y); // (1) C++11 + template + constexpr bool operator<(const forward_list& x, + const forward_list& y); // (1) C++26 } ``` @@ -71,3 +74,4 @@ true ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/op_less_equal.md b/reference/forward_list/forward_list/op_less_equal.md index 806877e6dd..6df1005e45 100644 --- a/reference/forward_list/forward_list/op_less_equal.md +++ b/reference/forward_list/forward_list/op_less_equal.md @@ -10,6 +10,9 @@ namespace std { template bool operator<=(const forward_list& x, const forward_list& y); // (1) C++11 + template + constexpr bool operator<=(const forward_list& x, + const forward_list& y); // (1) C++26 } ``` @@ -62,3 +65,4 @@ true ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/op_not_equal.md b/reference/forward_list/forward_list/op_not_equal.md index c4cf3cdc2e..7883e0c317 100644 --- a/reference/forward_list/forward_list/op_not_equal.md +++ b/reference/forward_list/forward_list/op_not_equal.md @@ -10,6 +10,9 @@ namespace std { template bool operator!=(const forward_list& x, const forward_list& y); // (1) C++11 + template + constexpr bool operator!=(const forward_list& x, + const forward_list& y); // (1) C++26 } ``` @@ -71,3 +74,4 @@ true ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/pop_front.md b/reference/forward_list/forward_list/pop_front.md index 7630d08369..4ad84bd918 100644 --- a/reference/forward_list/forward_list/pop_front.md +++ b/reference/forward_list/forward_list/pop_front.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -void pop_front(); +void pop_front(); // (1) C++11 +constexpr void pop_front(); // (1) C++26 ``` ## 概要 @@ -64,3 +65,4 @@ int main() ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/prepend_range.md b/reference/forward_list/forward_list/prepend_range.md index 9f714fb704..c09efcc85b 100644 --- a/reference/forward_list/forward_list/prepend_range.md +++ b/reference/forward_list/forward_list/prepend_range.md @@ -7,7 +7,9 @@ ```cpp template R> -void prepend_range(R&& rg); // C++23 +void prepend_range(R&& rg); // (1) C++23 +template R> +constexpr void prepend_range(R&& rg); // (1) C++26 ``` ## 概要 @@ -55,3 +57,7 @@ int main() |-------------------------------------------|----------------------| | [`push_front`](push_front.md) | 先頭に要素を追加する | | [`emplace_front`](emplace_front.md) | 先頭に要素を直接構築で追加する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/push_front.md b/reference/forward_list/forward_list/push_front.md index 2b3d46a407..3d50a5c2f6 100644 --- a/reference/forward_list/forward_list/push_front.md +++ b/reference/forward_list/forward_list/push_front.md @@ -6,8 +6,11 @@ * cpp11[meta cpp] ```cpp -void push_front(const T& x); -void push_front(T&& x); +void push_front(const T& x); // (1) C++11 +constexpr void push_front(const T& x); // (1) C++26 + +void push_front(T&& x); // (2) C++11 +constexpr void push_front(T&& x); // (2) C++26 ``` ## 概要 @@ -67,3 +70,4 @@ world ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/remove.md b/reference/forward_list/forward_list/remove.md index 582523dcc9..8ecfe974e8 100644 --- a/reference/forward_list/forward_list/remove.md +++ b/reference/forward_list/forward_list/remove.md @@ -6,8 +6,9 @@ * cpp11[meta cpp] ```cpp -void remove(const T& value); // (1) C++11 -size_type remove(const T& value); // (1) C++20 +void remove(const T& value); // (1) C++11 +size_type remove(const T& value); // (1) C++20 +constexpr size_type remove(const T& value); // (1) C++26 ``` ## 概要 @@ -70,3 +71,4 @@ int main() ## 参照 - [P0646R1 Improving the Return Value of Erase-Like Algorithms I: list/forward list](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0646r1.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/remove_if.md b/reference/forward_list/forward_list/remove_if.md index bb72b799ff..dee94a9029 100644 --- a/reference/forward_list/forward_list/remove_if.md +++ b/reference/forward_list/forward_list/remove_if.md @@ -7,10 +7,11 @@ ```cpp template -void remove_if(Predicate pred); // (1) C++11 - +void remove_if(Predicate pred); // (1) C++11 +template +size_type remove_if(Predicate pred); // (1) C++20 template -size_type remove_if(Predicate pred); // (1) C++20 +constexpr size_type remove_if(Predicate pred); // (1) C++26 ``` ## 概要 @@ -73,3 +74,4 @@ int main() ## 参照 - [P0646R1 Improving the Return Value of Erase-Like Algorithms I: list/forward list](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0646r1.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/resize.md b/reference/forward_list/forward_list/resize.md index c96381f5d8..9abc6a05a5 100644 --- a/reference/forward_list/forward_list/resize.md +++ b/reference/forward_list/forward_list/resize.md @@ -6,8 +6,11 @@ * cpp11[meta cpp] ```cpp -void resize(size_type sz); // (1) -void resize(size_type sz, const value_type& c); // (2) +void resize(size_type sz); // (1) C++11 +constexpr void resize(size_type sz); // (1) C++26 + +void resize(size_type sz, const value_type& c); // (2) C++11 +constexpr void resize(size_type sz, const value_type& c); // (2) C++26 ``` ## 概要 @@ -84,3 +87,4 @@ int main() - [Visual C++](/implementation.md#visual_cpp): ?? ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/reverse.md b/reference/forward_list/forward_list/reverse.md index d7db00bab5..3d60f12a8f 100644 --- a/reference/forward_list/forward_list/reverse.md +++ b/reference/forward_list/forward_list/reverse.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -void reverse() noexcept; +void reverse() noexcept; // (1) C++11 +constexpr void reverse() noexcept; // (1) C++26 ``` ## 概要 @@ -66,3 +67,4 @@ int main() ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/sort.md b/reference/forward_list/forward_list/sort.md index 1f1e40f0a2..6c51f58d1f 100644 --- a/reference/forward_list/forward_list/sort.md +++ b/reference/forward_list/forward_list/sort.md @@ -6,8 +6,13 @@ * cpp11[meta cpp] ```cpp -void sort(); -template void sort(Compare comp); +void sort(); // (1) C++11 +constexpr void sort(); // (1) C++26 + +template +void sort(Compare comp); // (2) C++11 +template +constexpr void sort(Compare comp); // (2) C++26 ``` ## 概要 @@ -74,3 +79,4 @@ int main() ## 参照 - [LWG Issue 2122. `merge()` stability for lists versus forward lists](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2122) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/splice_after.md b/reference/forward_list/forward_list/splice_after.md index 7e328b50e0..b9b2108474 100644 --- a/reference/forward_list/forward_list/splice_after.md +++ b/reference/forward_list/forward_list/splice_after.md @@ -6,21 +6,59 @@ * cpp11[meta cpp] ```cpp -void splice_after(const_iterator position, forward_list& x); // (1) -void splice_after(const_iterator position, forward_list&& x); // (2) - -void splice_after(const_iterator position, forward_list& x, - const_iterator i); // (3) - -void splice_after(const_iterator position, forward_list&& x, - const_iterator i); // (4) - -void splice_after(const_iterator position, forward_list& x, - const_iterator first, const_iterator last); // (5) - -void splice_after(const_iterator position, forward_list&& x, - const_iterator first, const_iterator last); // (6) - +void + splice_after(const_iterator position, + forward_list& x); // (1) C++11 +constexpr void + splice_after(const_iterator position, + forward_list& x); // (1) C++26 + +void + splice_after(const_iterator position, + forward_list&& x); // (2) C++11 +constexpr void + splice_after(const_iterator position, + forward_list&& x); // (2) C++26 + +void + splice_after(const_iterator position, + forward_list& x, + const_iterator i); // (3) C++11 +constexpr void + splice_after(const_iterator position, + forward_list& x, + const_iterator i); // (3) C++26 + +void + splice_after(const_iterator position, + forward_list&& x, + const_iterator i); // (4) C++11 +constexpr void + splice_after(const_iterator position, + forward_list&& x, + const_iterator i); // (4) C++26 + +void + splice_after(const_iterator position, + forward_list& x, + const_iterator first, + const_iterator last); // (5) C++11 +constexpr void + splice_after(const_iterator position, + forward_list& x, + const_iterator first, + const_iterator last); // (5) C++26 + +void + splice_after(const_iterator position, + forward_list&& x, + const_iterator first, + const_iterator last); // (6) C++11 +constexpr void + splice_after(const_iterator position, + forward_list&& x, + const_iterator first, + const_iterator last); // (6) C++26 ``` ## 概要 @@ -133,3 +171,4 @@ int main() - [LWG Issue 2222. Inconsistency in description of `forward_list::splice_after` single-element overload](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2222) - (3)と(4)のオーバーロードについて、有効性が継続される対象が、`*i`となっていたが、`*++i`の間違いであったため、C++14で修正された。 - [LWG Issue 3017. `list` `splice` functions should use `addressof`](https://wg21.cmeerw.net/lwg/issue3017) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/swap.md b/reference/forward_list/forward_list/swap.md index 8db3d4c4b2..5084d1824d 100644 --- a/reference/forward_list/forward_list/swap.md +++ b/reference/forward_list/forward_list/swap.md @@ -6,12 +6,18 @@ * cpp11[meta cpp] ```cpp -void swap(forward_list& x); // (1) C++11 - -void swap(forward_list& x) - noexcept( - allocator_traits::is_always_equal::value - ); // (1) C++17 +void + swap(forward_list& x); // (1) C++11 +void + swap(forward_list& x) + noexcept( + allocator_traits::is_always_equal::value + ); // (1) C++17 +constexpr void + swap(forward_list& x) + noexcept( + allocator_traits::is_always_equal::value + ); // (1) C++26 ``` * allocator_traits[link /reference/memory/allocator_traits.md] @@ -84,3 +90,4 @@ int main() ## 参照 - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) - `noexcept` 追加の経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/swap_free.md b/reference/forward_list/forward_list/swap_free.md index 93a7f90c09..16206ff9e9 100644 --- a/reference/forward_list/forward_list/swap_free.md +++ b/reference/forward_list/forward_list/swap_free.md @@ -7,13 +7,19 @@ ```cpp namespace std { template - void swap(forward_list& x, - forward_list& y); // (1) C++11 - + void + swap(forward_list& x, + forward_list& y); // (1) C++11 + template + void + swap(forward_list& x, + forward_list& y) + noexcept(noexcept(x.swap(y))); // (1) C++17 template - void swap(forward_list& x, - forward_list& y) - noexcept(noexcept(x.swap(y))); // (1) C++17 + constexpr void + swap(forward_list& x, + forward_list& y) + noexcept(noexcept(x.swap(y))); // (1) C++26 } ``` @@ -79,3 +85,4 @@ ls2 : {4 5 6 } ## 参照 - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) - `noexcept` 追加の経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/forward_list/forward_list/unique.md b/reference/forward_list/forward_list/unique.md index e1e6b520a8..06bb3ec9c5 100644 --- a/reference/forward_list/forward_list/unique.md +++ b/reference/forward_list/forward_list/unique.md @@ -6,14 +6,16 @@ * cpp11[meta cpp] ```cpp -void unique(); // (1) C++11 -size_type unique(); // (1) C++20 +void unique(); // (1) C++11 +size_type unique(); // (1) C++20 +constexpr size_type unique(); // (1) C++26 template -void unique(BinaryPredicate pred); // (2) C++11 - +void unique(BinaryPredicate pred); // (2) C++11 +template +size_type unique(BinaryPredicate pred); // (2) C++20 template -size_type unique(BinaryPredicate pred); // (2) C++20 +constexpr size_type unique(BinaryPredicate pred); // (2) C++26 ``` ## 概要 @@ -89,3 +91,4 @@ int main() ## 参照 - [P0646R1 Improving the Return Value of Erase-Like Algorithms I: list/forward list](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0646r1.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/append_range.md b/reference/list/list/append_range.md index 9fd2512697..b577a253ae 100644 --- a/reference/list/list/append_range.md +++ b/reference/list/list/append_range.md @@ -7,7 +7,9 @@ ```cpp template R> -void append_range(R&& rg); // C++23 +void append_range(R&& rg); // (1) C++23 +template R> +constexpr void append_range(R&& rg); // (1) C++26 ``` ## 概要 @@ -63,3 +65,7 @@ int main() |-------------------------------------------|----------------------| | [`push_back`](push_back.md) | 末尾に要素を追加する | | [`emplace_back`](emplace_back.md) | 末尾に要素を直接構築で追加する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/assign.md b/reference/list/list/assign.md index 0d29a514b5..bb84635288 100644 --- a/reference/list/list/assign.md +++ b/reference/list/list/assign.md @@ -6,10 +6,15 @@ ```cpp template -void assign(InputIterator first, InputIterator last); // (1) +void assign(InputIterator first, InputIterator last); // (1) C++03 +template +constexpr void assign(InputIterator first, InputIterator last); // (1) C++26 + +void assign(size_type n, const T& t); // (2) C++03 +constexpr void assign(size_type n, const T& t); // (2) C++26 -void assign(size_type n, const T& t); // (2) -void assign(initializer_list init); // (3) C++11 +void assign(initializer_list init); // (3) C++11 +constexpr void assign(initializer_list init); // (3) C++26 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -119,3 +124,4 @@ ls3 : 1 2 3 ## 参照 - [N2679 Initializer Lists for Standard Containers(Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2679.pdf) - (3)の経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/assign_range.md b/reference/list/list/assign_range.md index 6a73d61c4d..c5a3bb8aa6 100644 --- a/reference/list/list/assign_range.md +++ b/reference/list/list/assign_range.md @@ -7,7 +7,9 @@ ```cpp template R> -void assign_range(R&& rg); // C++23 +void assign_range(R&& rg); // (1) C++23 +template R> +constexpr void assign_range(R&& rg); // (1) C++26 ``` ## 概要 @@ -62,3 +64,7 @@ int main() | 名前 | 説明 | |-------------------------------------------|----------------------| | [`assign`](assign.md) | コンテナに値を代入する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/back.md b/reference/list/list/back.md index 45c392b0bb..2068b94027 100644 --- a/reference/list/list/back.md +++ b/reference/list/list/back.md @@ -5,8 +5,11 @@ * function[meta id-type] ```cpp -reference back(); // (1) -const_reference back() const; // (2) +reference back(); // (1) C++03 +constexpr reference back(); // (1) C++26 + +const_reference back() const; // (2) C++03 +constexpr const_reference back() const; // (2) C++26 ``` ## 概要 @@ -42,3 +45,7 @@ int main() ``` 4 ``` + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/begin.md b/reference/list/list/begin.md index 1ed00be3fe..022771b4f7 100644 --- a/reference/list/list/begin.md +++ b/reference/list/list/begin.md @@ -5,10 +5,13 @@ * function[meta id-type] ```cpp -iterator begin(); // (1) C++03 -iterator begin() noexcept; // (1) C++11 -const_iterator begin() const; // (2) C++03 -const_iterator begin() const noexcept; // (2) C++11 +iterator begin(); // (1) C++03 +iterator begin() noexcept; // (1) C++11 +constexpr iterator begin() noexcept; // (1) C++26 + +const_iterator begin() const; // (2) C++03 +const_iterator begin() const noexcept; // (2) C++11 +constexpr const_iterator begin() const noexcept; // (2) C++26 ``` ## 概要 @@ -49,3 +52,4 @@ int main() ``` ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/cbegin.md b/reference/list/list/cbegin.md index 823a35e6fa..65d864cd06 100644 --- a/reference/list/list/cbegin.md +++ b/reference/list/list/cbegin.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_iterator cbegin() const noexcept; +const_iterator cbegin() const noexcept; // (1) C++11 +constexpr const_iterator cbegin() const noexcept; // (1) C++26 ``` ## 概要 @@ -59,3 +60,4 @@ int main() ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/cend.md b/reference/list/list/cend.md index 1899bd3a73..a6e5abbb92 100644 --- a/reference/list/list/cend.md +++ b/reference/list/list/cend.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_iterator cend() const noexcept; +const_iterator cend() const noexcept; // (1) C++11 +constexpr const_iterator cend() const noexcept; // (1) C++26 ``` ## 概要 @@ -63,3 +64,4 @@ int main() ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/clear.md b/reference/list/list/clear.md index fadce81906..e22b3d5624 100644 --- a/reference/list/list/clear.md +++ b/reference/list/list/clear.md @@ -5,8 +5,9 @@ * function[meta id-type] ```cpp -void clear(); // C++03 -void clear() noexcept; // C++11 +void clear(); // (1) C++03 +void clear() noexcept; // (1) C++11 +constexpr void clear() noexcept; // (1) C++26 ``` ## 概要 @@ -70,3 +71,4 @@ int main() ## 参照 - [LWG Issue 2231. DR 704 removes complexity guarantee for `clear()`](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2231) - C++03までこの関数の効果は`erase(begin(), end())`だったため、それによって線形時間の計算量が保証されていたが、C++11で効果の表記が変わったために、保証がなくなってしまっていた。C++14であらためて保証を追加。 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/crbegin.md b/reference/list/list/crbegin.md index 3f3e0a9564..984d4528e5 100644 --- a/reference/list/list/crbegin.md +++ b/reference/list/list/crbegin.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_reverse_iterator crbegin() const noexcept; +const_reverse_iterator crbegin() const noexcept; // (1) C++11 +constexpr const_reverse_iterator crbegin() const noexcept; // (1) C++26 ``` ## 概要 @@ -59,3 +60,4 @@ int main() ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/crend.md b/reference/list/list/crend.md index 9457da5aa4..43f8b887ce 100644 --- a/reference/list/list/crend.md +++ b/reference/list/list/crend.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_reverse_iterator crend() const noexcept; +const_reverse_iterator crend() const noexcept; // (1) C++11 +constexpr const_reverse_iterator crend() const noexcept; // (1) C++26 ``` ## 概要 @@ -59,3 +60,4 @@ int main() ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/emplace.md b/reference/list/list/emplace.md index 9d7badbfc2..4d8475d6dd 100644 --- a/reference/list/list/emplace.md +++ b/reference/list/list/emplace.md @@ -7,7 +7,13 @@ ```cpp template -iterator emplace(const_iterator position, Args&&... args); +iterator + emplace(const_iterator position, + Args&&... args); // (1) C++11 +template +constexpr iterator + emplace(const_iterator position, + Args&&... args); // (1) C++26 ``` ## 概要 @@ -76,3 +82,4 @@ int main() ## 参照 - [N2345 Placement Insert for Containers (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2345.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/emplace_back.md b/reference/list/list/emplace_back.md index 1ffa5206b0..10c3d77f90 100644 --- a/reference/list/list/emplace_back.md +++ b/reference/list/list/emplace_back.md @@ -7,10 +7,11 @@ ```cpp template -void emplace_back(Args&&... args); // C++14 まで - +void emplace_back(Args&&... args); // (1) C++11 +template +reference emplace_back(Args&&... args); // (1) C++17 template -reference emplace_back(Args&&... args); // C++17 から +constexpr reference emplace_back(Args&&... args); // (1) C++26 ``` ## 概要 @@ -92,3 +93,4 @@ int main() - [P0084R0 Emplace Return Type](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0084r0.pdf) - [P0084R1 Emplace Return Type (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0084r1.pdf) - [P0084R2 Emplace Return Type (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0084r2.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/emplace_front.md b/reference/list/list/emplace_front.md index 599ee0e5ea..a64ff49ddc 100644 --- a/reference/list/list/emplace_front.md +++ b/reference/list/list/emplace_front.md @@ -7,10 +7,11 @@ ```cpp template -void emplace_front(Args&&... args); // C++14 まで - +void emplace_front(Args&&... args); // (1) C++11 +template +reference emplace_front(Args&&... args); // (1) C++17 template -reference emplace_front(Args&&... args); // C++17 から +constexpr reference emplace_front(Args&&... args); // (1) C++26 ``` ## 概要 @@ -92,3 +93,4 @@ int main() - [P0084R0 Emplace Return Type](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0084r0.pdf) - [P0084R1 Emplace Return Type (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0084r1.pdf) - [P0084R2 Emplace Return Type (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0084r2.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/empty.md b/reference/list/list/empty.md index bb873c82d9..ee888bf304 100644 --- a/reference/list/list/empty.md +++ b/reference/list/list/empty.md @@ -5,10 +5,10 @@ * function[meta id-type] ```cpp -bool empty() const; // C++03 -bool empty() const noexcept; // C++11 -[[nodiscard]] bool empty() const noexcept; // C++20 -bool empty() const noexcept; // C++26 +bool empty() const; // (1) C++03 +bool empty() const noexcept; // (1) C++11 +[[nodiscard]] bool empty() const noexcept; // (1) C++20 +constexpr bool empty() const noexcept; // (1) C++26 ``` ## 概要 @@ -61,3 +61,4 @@ false - C++20で`[[nodiscard]]`が付加された - [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) - C++26で`[[nodiscard]]`指定が削除された +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/end.md b/reference/list/list/end.md index 6584b208d1..ffb098f0a1 100644 --- a/reference/list/list/end.md +++ b/reference/list/list/end.md @@ -5,10 +5,13 @@ * function[meta id-type] ```cpp -iterator end(); // (1) C++03 -iterator end() noexcept; // (1) C++11 -const_iterator end() const; // (2) C++03 -const_iterator end() const noexcept; // (2) C++11 +iterator end(); // (1) C++03 +iterator end() noexcept; // (1) C++11 +constexpr iterator end() noexcept; // (1) C++26 + +const_iterator end() const; // (2) C++03 +const_iterator end() const noexcept; // (2) C++11 +constexpr const_iterator end() const noexcept; // (2) C++26 ``` ## 概要 @@ -66,3 +69,4 @@ int main() ``` ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/erase.md b/reference/list/list/erase.md index 3520bf169d..445db738c8 100644 --- a/reference/list/list/erase.md +++ b/reference/list/list/erase.md @@ -5,12 +5,19 @@ * function[meta id-type] ```cpp -iterator erase(iterator position); // (1) C++03 -iterator erase(const_iterator position); // (1) C++11 -iterator erase(iterator position, - iterator last); // (2) C++03 -iterator erase(const_iterator position, - const_iterator last); // (2) C++11 +iterator erase(iterator position); // (1) C++03 +iterator erase(const_iterator position); // (1) C++11 +constexpr iterator erase(const_iterator position); // (1) C++26 + +iterator + erase(iterator position, + iterator last); // (2) C++03 +iterator + erase(const_iterator position, + const_iterator last); // (2) C++11 +constexpr iterator + erase(const_iterator position, + const_iterator last); // (2) C++26 ``` ## 概要 @@ -117,3 +124,4 @@ int main() ## 参照 - [N2350 Container insert/erase and iterator constness (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2350.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/erase_free.md b/reference/list/list/erase_free.md index 0eb2535cfb..93a62cf61c 100644 --- a/reference/list/list/erase_free.md +++ b/reference/list/list/erase_free.md @@ -10,7 +10,7 @@ namespace std { typename list::size_type erase(list& c, const U& value); // (1) C++20 template - typename list::size_type + constexpr typename list::size_type erase(list& c, const U& value); // (1) C++26 } ``` @@ -110,3 +110,4 @@ int main() { - [R1115R3 Improving the Return Value of Erase-Like Algorithms II: Free `erase`/`erase_if`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1115r3.pdf) - [P2248R8 Enabling list-initialization for algorithms](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2248r8.html) - C++26で波カッコ初期化 (リスト初期化) に対応した +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/erase_if_free.md b/reference/list/list/erase_if_free.md index 1ffc7304bc..ada23ba00e 100644 --- a/reference/list/list/erase_if_free.md +++ b/reference/list/list/erase_if_free.md @@ -7,7 +7,13 @@ ```cpp namespace std { template - typename list::size_type erase_if(list& c, Predicate pred); + typename list::size_type + erase_if(list& c, + Predicate pred); // (1) C++20 + template + constexpr typename list::size_type + erase_if(list& c, + Predicate pred); // (1) C++26 } ``` @@ -67,3 +73,4 @@ int main() ## 参照 - [P1209R0 Adopt consistent container erasure from Library Fundamentals 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1209r0.html) - [R1115R3 Improving the Return Value of Erase-Like Algorithms II: Free `erase`/`erase_if`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1115r3.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/front.md b/reference/list/list/front.md index 0fd9826dea..3963c09036 100644 --- a/reference/list/list/front.md +++ b/reference/list/list/front.md @@ -5,8 +5,11 @@ * function[meta id-type] ```cpp -reference front(); // (1) -const_reference front() const; // (2) +reference front(); // (1) C++03 +constexpr reference front(); // (1) C++26 + +const_reference front() const; // (2) C++03 +constexpr const_reference front() const; // (2) C++26 ``` ## 概要 @@ -41,3 +44,7 @@ int main() ``` 3 ``` + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/get_allocator.md b/reference/list/list/get_allocator.md index 3806188bf0..e935f27616 100644 --- a/reference/list/list/get_allocator.md +++ b/reference/list/list/get_allocator.md @@ -5,8 +5,9 @@ * function[meta id-type] ```cpp -allocator_type get_allocator() const; // C++03 -allocator_type get_allocator() const noexcept; // C++11 +allocator_type get_allocator() const; // (1) C++03 +allocator_type get_allocator() const noexcept; // (1) C++11 +constexpr allocator_type get_allocator() const noexcept; // (1) C++26 ``` ## 概要 @@ -55,3 +56,7 @@ int main() - [Visual C++](/implementation.md#visual_cpp): 2002 [mark verified], 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - 2012, 2013は、`noexcept`が実装されていないため、`throw()`が修飾されている。 - 2015からは、`noexcept`が修飾されている。 + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/insert.md b/reference/list/list/insert.md index 8c368f7d1a..68f9647c58 100644 --- a/reference/list/list/insert.md +++ b/reference/list/list/insert.md @@ -5,27 +5,58 @@ * function[meta id-type] ```cpp -// C++03 -iterator insert(iterator position, const T& x); // (1) C++03 -iterator insert(const_iterator position, const T& x); // (1) C++11 -iterator insert(const_iterator position, T&& x); // (2) C++11 - -void insert(iterator position, - size_type n, const T& x); // (3) C++03 -iterator insert(const_iterator position, - size_type n, const T& x); // (3) C++11 +iterator + insert(iterator position, + const T& x); // (1) C++03 +iterator + insert(const_iterator position, + const T& x); // (1) C++11 +constexpr iterator + insert(const_iterator position, + const T& x); // (1) C++26 + +iterator + insert(const_iterator position, + T&& x); // (2) C++11 +constexpr iterator + insert(const_iterator position, + T&& x); // (2) C++26 + +void + insert(iterator position, + size_type n, + const T& x); // (3) C++03 +iterator + insert(const_iterator position, + size_type n, + const T& x); // (3) C++11 +constexpr iterator + insert(const_iterator position, + size_type n, + const T& x); // (3) C++26 template -void insert(iterator position, - InputIterator first, - InputIterator last); // (4) C++03 +void + insert(iterator position, + InputIterator first, + InputIterator last); // (4) C++03 template -iterator insert(const_iterator position, - InputIterator first, - InputIterator last); // (4) C++11 - -iterator insert(const_iterator position, - initializer_list il); // (5) C++11 +iterator + insert(const_iterator position, + InputIterator first, + InputIterator last); // (4) C++11 +template +constexpr iterator + insert(const_iterator position, + InputIterator first, + InputIterator last); // (4) C++26 + +iterator + insert(const_iterator position, + initializer_list il); // (5) C++11 +constexpr iterator + insert(const_iterator position, + initializer_list il); // (5) C++26 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -135,3 +166,4 @@ insert initializer_list : 1 2 3 4 5 6 - [N2350 Container insert/erase and iterator constness (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2350.pdf) - [N2679 Initializer Lists for Standard Containers(Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2679.pdf) - (5)の経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/insert_range.md b/reference/list/list/insert_range.md index 9e8f272a6e..12b3db00bf 100644 --- a/reference/list/list/insert_range.md +++ b/reference/list/list/insert_range.md @@ -7,7 +7,9 @@ ```cpp template R> -iterator insert_range(const_iterator pos, R&& rg); // C++23 +iterator insert_range(const_iterator pos, R&& rg); // (1) C++23 +template R> +constexpr iterator insert_range(const_iterator pos, R&& rg); // (1) C++26 ``` ## 概要 @@ -60,3 +62,7 @@ int main() |-------------------------------------------|----------------------| | [`insert`](insert.md) | 任意の位置に要素を挿入する | | [`emplace`](emplace.md) | 任意の位置に要素を直接構築で挿入する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/max_size.md b/reference/list/list/max_size.md index 5672a5333e..a9d4de2392 100644 --- a/reference/list/list/max_size.md +++ b/reference/list/list/max_size.md @@ -5,8 +5,9 @@ * function[meta id-type] ```cpp -size_type max_size() const; // C++03 -size_type max_size() const noexcept; // C++11 +size_type max_size() const; // (1) C++03 +size_type max_size() const noexcept; // (1) C++11 +constexpr size_type max_size() const noexcept; // (1) C++26 ``` ## 概要 @@ -45,3 +46,7 @@ int main() ``` 768614336404564650 ``` + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/merge.md b/reference/list/list/merge.md index 3073b835bb..be40615109 100644 --- a/reference/list/list/merge.md +++ b/reference/list/list/merge.md @@ -5,10 +5,25 @@ * function[meta id-type] ```cpp -void merge(list& x); // (1) -void merge(list&& x); // (2) C++11 -template void merge(list& x, Compare comp); // (3) -template void merge(list&& x, Compare comp); // (4) C++11 +void merge(list& x); // (1) C++03 +constexpr void merge(list& x); // (1) C++26 + +void merge(list&& x); // (2) C++11 +constexpr void merge(list&& x); // (2) C++26 + +template +void + merge(list& x, Compare comp); // (3) C++03 +template +constexpr void + merge(list& x, Compare comp); // (3) C++26 + +template +void + merge(list&& x, Compare comp); // (4) C++11 +template +constexpr void + merge(list&& x, Compare comp); // (4) C++26 ``` ## 概要 @@ -70,3 +85,7 @@ int main() 5 6 ``` + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/op_assign.md b/reference/list/list/op_assign.md index 99e2009c1e..734501fd5f 100644 --- a/reference/list/list/op_assign.md +++ b/reference/list/list/op_assign.md @@ -5,11 +5,17 @@ * function[meta id-type] ```cpp -list& operator=(const list& x); // (1) -list& operator=(list&& x); // (2) C++11 +list& operator=(const list& x); // (1) C++03 +constexpr list& operator=(const list& x); // (1) C++26 + +list& operator=(list&& x); // (2) C++11 list& operator=(list&& x) noexcept(allocator_traits::is_always_equal::value); // (2) C++17 -list& operator=(initializer_list x); // (3) C++11 +constexpr list& operator=(list&& x) + noexcept(allocator_traits::is_always_equal::value); // (2) C++26 + +list& operator=(initializer_list x); // (3) C++11 +constexpr list& operator=(initializer_list x); // (3) C++26 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -91,3 +97,4 @@ int main () - (3)の経緯となる提案文書 - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) - `noexcept` 追加の経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/op_compare_3way.md b/reference/list/list/op_compare_3way.md index eb0d6c7cb8..6bbacd30c3 100644 --- a/reference/list/list/op_compare_3way.md +++ b/reference/list/list/op_compare_3way.md @@ -10,6 +10,10 @@ namespace std { synth-three-way-result operator<=>(const list& x, const list& y); // (1) C++20 + template + constexpr synth-three-way-result + operator<=>(const list& x, + const list& y); // (1) C++26 } ``` @@ -72,3 +76,4 @@ int main () ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/op_constructor.md b/reference/list/list/op_constructor.md index 1190ba23e2..3ccf45d334 100644 --- a/reference/list/list/op_constructor.md +++ b/reference/list/list/op_constructor.md @@ -5,38 +5,76 @@ * function[meta id-type] ```cpp -list(); // (1) C++14 から -list(const Allocator& a); // (2) C++14 から +list(); // (1) C++14 +constexpr list(); // (1) C++26 + +list(const Allocator& a); // (2) C++14 +constexpr list(const Allocator& a); // (2) C++26 + explicit list(const Allocator& a = Allocator()); // (1), (2) C++11 まで。C++14 で削除 explicit list(size_type n, const T& value = T(), - const Allocator& a = Allocator()); // (3) C++03 まで。C++11 で削除 + const Allocator& a = Allocator()); // (3) C++03 まで。C++11 で削除 list(size_type n, const T& value, const Allocator& a = Allocator()); // (3) C++11 から - -explicit list(size_type n); // (4) C++11。C++14 で削除 -explicit list(size_type n, - const Allocator& a = Allocator()); // (4) C++14 から +constexpr + list(size_type n, const T& value, + const Allocator& a = Allocator()); // (3) C++26 + +explicit + list(size_type n); // (4) C++11。C++14 で削除 +explicit + list(size_type n, + const Allocator& a = Allocator()); // (4) C++14 から +constexpr explicit + list(size_type n, + const Allocator& a = Allocator()); // (4) C++26 template -list(InputIterator first, InputIterator last, - const Allocator& a = Allocator()); // (5) +list(InputIterator first, + InputIterator last, + const Allocator& a = Allocator()); // (5) C++03 +template +constexpr + list(InputIterator first, + InputIterator last, + const Allocator& a = Allocator()); // (5) C++26 -list(const list& x); // (6) -list(list&& x); // (7) C++11 から -list(const list& x, const Allocator& a); // (8) C++11 -list(const list& x, - const type_identity_t& a); // (8) C++23 +list(const list& x); // (6) C++03 +constexpr list(const list& x); // (6) C++26 -list(list&& x, const Allocator& a); // (9) C++11 -list(list&& x, const type_identity_t& a); // (9) C++23 +list(list&& x); // (7) C++11 +constexpr list(list&& x); // (7) C++26 + +list(const list& x, + const Allocator& a); // (8) C++11 +list(const list& x, + const type_identity_t& a); // (8) C++23 +constexpr + list(const list& x, + const type_identity_t& a); // (8) C++26 + +list(list&& x, + const Allocator& a); // (9) C++11 +list(list&& x, + const type_identity_t& a); // (9) C++23 +constexpr + list(list&& x, + const type_identity_t& a); // (9) C++26 list(initializer_list il, - const Allocator& a = Allocator()); // (10) C++11 から + const Allocator& a = Allocator()); // (10) C++11 +constexpr + list(initializer_list il, + const Allocator& a = Allocator()); // (10) C++26 template R> list(from_range_t, R&& rg, - const Allocator& a = Allocator()); // (11) C++23 から + const Allocator& a = Allocator()); // (11) C++23 +template R> +constexpr + list(from_range_t, R&& rg, + const Allocator& a = Allocator()); // (11) C++26 ``` * type_identity_t[link /reference/type_traits/type_identity.md] * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -183,3 +221,4 @@ ls7 : 1 2 3 なお、Discussion の例はアロケータの型が誤っているので注意 - [P1518R2 Stop Overconstraining Allocators in Container Deduction Guides](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1518r2.html) - C++23でのアロケータ引数を`type_identity_t`で包む変更 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/op_destructor.md b/reference/list/list/op_destructor.md index 432863960f..5ffc43b481 100644 --- a/reference/list/list/op_destructor.md +++ b/reference/list/list/op_destructor.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -~list(); +~list(); // (1) C++03 +constexpr ~list(); // (1) C++26 ``` ## 概要 @@ -21,3 +22,4 @@ ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/op_equal.md b/reference/list/list/op_equal.md index 5da792d087..bef3a9ec40 100644 --- a/reference/list/list/op_equal.md +++ b/reference/list/list/op_equal.md @@ -6,7 +6,9 @@ ```cpp namespace std { template - bool operator==(const list& x, const list& y); + bool operator==(const list& x, const list& y); // (1) C++03 + template + constexpr bool operator==(const list& x, const list& y); // (1) C++26 } ``` @@ -70,3 +72,4 @@ false - C++14から、2つ目のイテレータ範囲のendイテレータをとる`equal()`アルゴリズムを使用するようになった。 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/op_greater.md b/reference/list/list/op_greater.md index bdb18a43a3..1a9b76931a 100644 --- a/reference/list/list/op_greater.md +++ b/reference/list/list/op_greater.md @@ -9,6 +9,9 @@ namespace std { template bool operator>(const list& x, const list& y); // (1) C++03 + template + constexpr bool operator>(const list& x, + const list& y); // (1) C++26 } ``` @@ -50,3 +53,4 @@ true ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/op_greater_equal.md b/reference/list/list/op_greater_equal.md index 9484428b97..f099e303fa 100644 --- a/reference/list/list/op_greater_equal.md +++ b/reference/list/list/op_greater_equal.md @@ -9,6 +9,9 @@ namespace std { template bool operator>=(const list& x, const list& y); // (1) C++03 + template + constexpr bool operator>=(const list& x, + const list& y); // (1) C++26 } ``` @@ -50,3 +53,4 @@ true ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/op_less.md b/reference/list/list/op_less.md index 370cb2a386..12b085afeb 100644 --- a/reference/list/list/op_less.md +++ b/reference/list/list/op_less.md @@ -9,6 +9,9 @@ namespace std { template bool operator<(const list& x, const list& y); // (1) C++03 + template + constexpr bool operator<(const list& x, + const list& y); // (1) C++26 } ``` @@ -60,3 +63,4 @@ true ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/op_less_equal.md b/reference/list/list/op_less_equal.md index 0a723e13fb..739271ddd9 100644 --- a/reference/list/list/op_less_equal.md +++ b/reference/list/list/op_less_equal.md @@ -9,6 +9,9 @@ namespace std { template bool operator<=(const list& x, const list& y); // (1) C++03 + template + constexpr bool operator<=(const list& x, + const list& y); // (1) C++26 } ``` @@ -49,3 +52,4 @@ true ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/op_not_equal.md b/reference/list/list/op_not_equal.md index 42390ed4d1..9333a0d850 100644 --- a/reference/list/list/op_not_equal.md +++ b/reference/list/list/op_not_equal.md @@ -9,6 +9,9 @@ namespace std { template bool operator!=(const list& x, const list& y); // (1) C++03 + template + constexpr bool operator!=(const list& x, + const list& y); // (1) C++26 } ``` @@ -59,3 +62,4 @@ true ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/pop_back.md b/reference/list/list/pop_back.md index e94b8172b8..85fe2215cf 100644 --- a/reference/list/list/pop_back.md +++ b/reference/list/list/pop_back.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -void pop_back(); +void pop_back(); // (1) C++03 +constexpr void pop_back(); // (1) C++26 ``` ## 概要 @@ -47,3 +48,7 @@ int main() 1 2 ``` + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/pop_front.md b/reference/list/list/pop_front.md index 3c3e1649b4..482ac1497e 100644 --- a/reference/list/list/pop_front.md +++ b/reference/list/list/pop_front.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -void pop_front(); +void pop_front(); // (1) C++03 +constexpr void pop_front(); // (1) C++26 ``` ## 概要 @@ -47,3 +48,7 @@ int main() 2 3 ``` + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/prepend_range.md b/reference/list/list/prepend_range.md index 6dca97b946..76b7a15235 100644 --- a/reference/list/list/prepend_range.md +++ b/reference/list/list/prepend_range.md @@ -7,7 +7,9 @@ ```cpp template R> -void prepend_range(R&& rg); // C++23 +void prepend_range(R&& rg); // (1) C++23 +template R> +constexpr void prepend_range(R&& rg); // (1) C++26 ``` ## 概要 @@ -63,3 +65,7 @@ int main() |-------------------------------------------|----------------------| | [`push_front`](push_front.md) | 先頭に要素を追加する | | [`emplace_front`](emplace_front.md) | 先頭に要素を直接構築で追加する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/push_back.md b/reference/list/list/push_back.md index 5578aa071d..cee39f98e8 100644 --- a/reference/list/list/push_back.md +++ b/reference/list/list/push_back.md @@ -5,8 +5,11 @@ * function[meta id-type] ```cpp -void push_back(const T& x); // (1) -void push_back(T&& x); // (2) C++11 +void push_back(const T& x); // (1) C++03 +constexpr void push_back(const T& x); // (1) C++26 + +void push_back(T&& x); // (2) C++11 +constexpr void push_back(T&& x); // (2) C++26 ``` ## 概要 @@ -100,3 +103,7 @@ int main() 1 0 ``` + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/push_front.md b/reference/list/list/push_front.md index 19fdf683af..4db1b436b0 100644 --- a/reference/list/list/push_front.md +++ b/reference/list/list/push_front.md @@ -5,8 +5,11 @@ * function[meta id-type] ```cpp -void push_front(const T& x); // (1) -void push_front(T&& x); // (2) C++11 +void push_front(const T& x); // (1) C++03 +constexpr void push_front(const T& x); // (1) C++26 + +void push_front(T&& x); // (2) C++11 +constexpr void push_front(T&& x); // (2) C++26 ``` ## 概要 @@ -51,3 +54,7 @@ int main() hello world ``` + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/rbegin.md b/reference/list/list/rbegin.md index ff23d05ce7..1b1ec5d0e3 100644 --- a/reference/list/list/rbegin.md +++ b/reference/list/list/rbegin.md @@ -5,10 +5,13 @@ * function[meta id-type] ```cpp -reverse_iterator rbegin(); // (1) C++03 -reverse_iterator rbegin() noexcept; // (1) C++11 -const_reverse_iterator rbegin() const; // (2) C++03 -const_reverse_iterator rbegin() const noexcept; // (2) C++11 +reverse_iterator rbegin(); // (1) C++03 +reverse_iterator rbegin() noexcept; // (1) C++11 +constexpr reverse_iterator rbegin() noexcept; // (1) C++26 + +const_reverse_iterator rbegin() const; // (2) C++03 +const_reverse_iterator rbegin() const noexcept; // (2) C++11 +constexpr const_reverse_iterator rbegin() const noexcept; // (2) C++26 ``` ## 概要 @@ -49,3 +52,4 @@ int main() ``` ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/remove.md b/reference/list/list/remove.md index 2d2a70a5c1..93714d695e 100644 --- a/reference/list/list/remove.md +++ b/reference/list/list/remove.md @@ -5,8 +5,9 @@ * function[meta id-type] ```cpp -void remove(const T& value); // (1) C++03 -size_type remove(const T& value); // (1) C++20 +void remove(const T& value); // (1) C++03 +size_type remove(const T& value); // (1) C++20 +constexpr size_type remove(const T& value); // (1) C++26 ``` ## 概要 @@ -58,3 +59,4 @@ int main() ## 参照 - [P0646R1 Improving the Return Value of Erase-Like Algorithms I: list/forward list](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0646r1.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/remove_if.md b/reference/list/list/remove_if.md index 12ce40889b..3ac6558db3 100644 --- a/reference/list/list/remove_if.md +++ b/reference/list/list/remove_if.md @@ -6,10 +6,11 @@ ```cpp template -void remove_if(Predicate pred); // (1) C++03 - +void remove_if(Predicate pred); // (1) C++03 +template +size_type remove_if(Predicate pred); // (1) C++20 template -size_type remove_if(Predicate pred); // (1) C++20 +constexpr size_type remove_if(Predicate pred); // (1) C++26 ``` ## 概要 @@ -61,3 +62,4 @@ int main() ## 参照 - [P0646R1 Improving the Return Value of Erase-Like Algorithms I: list/forward list](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0646r1.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/rend.md b/reference/list/list/rend.md index ffe6034f6f..977ddf7be6 100644 --- a/reference/list/list/rend.md +++ b/reference/list/list/rend.md @@ -5,10 +5,13 @@ * function[meta id-type] ```cpp -reverse_iterator rend(); // (1) C++03 -reverse_iterator rend() noexcept; // (1) C++11 -const_reverse_iterator rend() const; // (2) C++03 -const_reverse_iterator rend() const noexcept; // (2) C++11 +reverse_iterator rend(); // (1) C++03 +reverse_iterator rend() noexcept; // (1) C++11 +constexpr reverse_iterator rend() noexcept; // (1) C++26 + +const_reverse_iterator rend() const; // (2) C++03 +const_reverse_iterator rend() const noexcept; // (2) C++11 +constexpr const_reverse_iterator rend() const noexcept; // (2) C++26 ``` ## 概要 @@ -62,3 +65,4 @@ int main() ``` ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/resize.md b/reference/list/list/resize.md index 8538e152da..86ba5f2706 100644 --- a/reference/list/list/resize.md +++ b/reference/list/list/resize.md @@ -5,9 +5,13 @@ * function[meta id-type] ```cpp -void resize(size_type sz); // (1) C++11 -void resize(size_type sz, const value_type& c); // (2) C++11 -void resize(size_type sz, T c = T()); // (1), (2) C++03。C++11で削除 +void resize(size_type sz); // (1) C++11 +constexpr void resize(size_type sz); // (1) C++26 + +void resize(size_type sz, const value_type& c); // (2) C++11 +constexpr void resize(size_type sz, const value_type& c); // (2) C++26 + +void resize(size_type sz, T c = T()); // (1) + (2) C++03。C++11で削除 ``` ## 概要 @@ -67,3 +71,7 @@ int main() 3 ``` + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/reverse.md b/reference/list/list/reverse.md index 8c00565488..e11def9f7c 100644 --- a/reference/list/list/reverse.md +++ b/reference/list/list/reverse.md @@ -5,8 +5,9 @@ * function[meta id-type] ```cpp -void reverse(); // C++03 -void reverse() noexcept; // C++11 +void reverse(); // (1) C++03 +void reverse() noexcept; // (1) C++11 +constexpr void reverse() noexcept; // (1) C++26 ``` ## 概要 @@ -53,3 +54,7 @@ int main() 2 1 ``` + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/size.md b/reference/list/list/size.md index e06b7f5df8..b09739d55f 100644 --- a/reference/list/list/size.md +++ b/reference/list/list/size.md @@ -5,8 +5,9 @@ * function[meta id-type] ```cpp -size_type size() const; // C++03 -size_type size() const noexcept; // C++11 +size_type size() const; // (1) C++03 +size_type size() const noexcept; // (1) C++11 +constexpr size_type size() const noexcept; // (1) C++26 ``` ## 概要 @@ -52,3 +53,4 @@ int main() ## 参照 - [N2909 Specifying the complexity of `size()`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2909.pdf) - [C++0x 標準コンテナのsize()の計算量を規定 - Faith and Brave - C++で遊ぼう](http://d.hatena.ne.jp/faith_and_brave/20090902/1251879571) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/sort.md b/reference/list/list/sort.md index 5ed9f562fc..e1f97b98a4 100644 --- a/reference/list/list/sort.md +++ b/reference/list/list/sort.md @@ -5,10 +5,13 @@ * function[meta id-type] ```cpp -void sort(); // (1) +void sort(); // (1) C++03 +constexpr void sort(); // (1) C++26 template -void sort(Compare comp); // (2) +void sort(Compare comp); // (2) C++03 +template +constexpr void sort(Compare comp); // (2) C++26 ``` ## 概要 @@ -58,3 +61,7 @@ int main() 2 3 ``` + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/splice.md b/reference/list/list/splice.md index 1ef73e11bc..f6ba6dd54a 100644 --- a/reference/list/list/splice.md +++ b/reference/list/list/splice.md @@ -5,26 +5,61 @@ * function[meta id-type] ```cpp -void splice(iterator position, list& x); // (1) C++03 -void splice(const_iterator position, list& x); // (1) C++11 - -void splice(const_iterator position, list&& x); // (2) C++11 - -void splice(iterator position, list& x, - iterator i); // (3) C++03 -void splice(const_iterator position, list& x, - const_iterator i); // (3) C++11 - -void splice(const_iterator position, list&& x, - const_iterator i); // (4) C++11 - -void splice(iterator position, list& x, - iterator first, iterator last); // (5) C++03 -void splice(const_iterator position, list& x, - const_iterator first, const_iterator last); // (5) C++11 - -void splice(const_iterator position, list&& x, - const_iterator first, const_iterator last); // (6) C++11 +void splice(iterator position, list& x); // (1) C++03 +void splice(const_iterator position, list& x); // (1) C++11 +constexpr void splice(const_iterator position, list& x); // (1) C++26 + +void splice(const_iterator position, list&& x); // (2) C++11 +constexpr void splice(const_iterator position, list&& x); // (2) C++26 + +void + splice(iterator position, + list& x, + iterator i); // (3) C++03 +void + splice(const_iterator + position, list& x, + const_iterator i); // (3) C++11 +constexpr void + splice(const_iterator position, + list& x, + const_iterator i); // (3) C++26 + +void + splice(const_iterator position, + list&& x, + const_iterator i); // (4) C++11 +constexpr void + splice(const_iterator position, + list&& x, + const_iterator i); // (4) C++26 + +void + splice(iterator position, + list& x, + iterator first, + iterator last); // (5) C++03 +void + splice(const_iterator position, + list& x, + const_iterator first, + const_iterator last); // (5) C++11 +constexpr void + splice(const_iterator position, + list& x, + const_iterator first, + const_iterator last); // (5) C++26 + +void + splice(const_iterator position, + list&& x, + const_iterator first, + const_iterator last); // (6) C++11 +constexpr void + splice(const_iterator position, + list&& x, + const_iterator first, + const_iterator last); // (6) C++26 ``` ## 概要 @@ -139,3 +174,4 @@ int main() - [N2350 Container insert/erase and iterator constness (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2350.pdf) - [LWG Issue 3017. `list` `splice` functions should use `addressof`](https://wg21.cmeerw.net/lwg/issue3017) - [LWG Issue 3087. One final `&x` in §[list.ops]](https://wg21.cmeerw.net/lwg/issue3087) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/swap.md b/reference/list/list/swap.md index ef388d3b7b..a034467fad 100644 --- a/reference/list/list/swap.md +++ b/reference/list/list/swap.md @@ -5,8 +5,14 @@ * function[meta id-type] ```cpp -void swap(list& x); -void swap(list& x) noexcept(allocator_traits::is_always_equal::value); // C++17 +void + swap(list& x); // (1) C++03 +void + swap(list& x) + noexcept(allocator_traits::is_always_equal::value); // (1) C++17 +constexpr void + swap(list& x) + noexcept(allocator_traits::is_always_equal::value); // (1) C++26 ``` ## 概要 @@ -64,3 +70,4 @@ int main() ## 参照 - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) - `noexcept` 追加の経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/swap_free.md b/reference/list/list/swap_free.md index 820ec6d5b5..dde7b68d05 100644 --- a/reference/list/list/swap_free.md +++ b/reference/list/list/swap_free.md @@ -6,11 +6,19 @@ ```cpp namespace std { template - void swap(list& x, list& y); - + void + swap(list& x, + list& y); // (1) C++03 + template + void + swap(list& x, + list& y) + noexcept(noexcept(x.swap(y))); // (1) C++17 template - void swap(list& x, list& y) - noexcept(noexcept(x.swap(y))); // C++17 + constexpr void + swap(list& x, + list& y) + noexcept(noexcept(x.swap(y))); // (1) C++26 } ``` @@ -66,3 +74,4 @@ ls2 : {4 5 6 } ## 参照 - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) - `noexcept` 追加の経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/list/list/unique.md b/reference/list/list/unique.md index 3384c7698f..83ad15a264 100644 --- a/reference/list/list/unique.md +++ b/reference/list/list/unique.md @@ -5,14 +5,16 @@ * function[meta id-type] ```cpp -void unique(); // (1) C++03 -size_type unique(); // (1) C++20 +void unique(); // (1) C++03 +size_type unique(); // (1) C++20 +constexpr size_type unique(); // (1) C++26 template -void unique(BinaryPredicate pred); // (2) C++03 - +void unique(BinaryPredicate pred); // (2) C++03 +template +size_type unique(BinaryPredicate pred); // (2) C++20 template -size_type unique(BinaryPredicate pred); // (2) C++20 +constexpr size_type unique(BinaryPredicate pred); // (2) C++26 ``` ## 概要 @@ -77,3 +79,4 @@ int main() ## 参照 - [P0646R1 Improving the Return Value of Erase-Like Algorithms I: list/forward list](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0646r1.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/at.md b/reference/map/map/at.md index 981838d6f1..c1e5b3f60a 100644 --- a/reference/map/map/at.md +++ b/reference/map/map/at.md @@ -6,13 +6,17 @@ * cpp11[meta cpp] ```cpp -T& at(const key_type& x); // (1) C++11 -const T& at(const key_type& x) const; // (2) C++11 +T& at(const key_type& x); // (1) C++11 +constexpr T& at(const key_type& x); // (1) C++26 + +const T& at(const key_type& x) const; // (2) C++11 +constexpr const T& at(const key_type& x) const; // (2) C++26 template -T& at(const K& x); // (3) C++26 +constexpr T& at(const K& x); // (3) C++26 + template -const T& at(const K& x) const; // (4) C++26 +constexpr const T& at(const K& x) const; // (4) C++26 ``` ## 概要 @@ -106,3 +110,4 @@ exception std::out_of_range - [LWG Issue 464. Suggestion for new member functions in standard containers](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#464) - [P2363R5 Extending associative containers with the remaining heterogeneous overloads](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2363r5.html) - C++26で`template `のバージョンが追加された +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/begin.md b/reference/map/map/begin.md index 773138d51f..e688d605b7 100644 --- a/reference/map/map/begin.md +++ b/reference/map/map/begin.md @@ -5,11 +5,13 @@ * function[meta id-type] ```cpp -iterator begin(); // (1) C++03 -iterator begin() noexcept; // (1) C++11 +iterator begin(); // (1) C++03 +iterator begin() noexcept; // (1) C++11 +constexpr iterator begin() noexcept; // (1) C++26 -const_iterator begin() const; // (2) C++03 -const_iterator begin() const noexcept; // (2) C++11 +const_iterator begin() const; // (2) C++03 +const_iterator begin() const noexcept; // (2) C++11 +constexpr const_iterator begin() const noexcept; // (2) C++26 ``` @@ -88,3 +90,7 @@ int main() | [`map::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`map::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`map::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/cbegin.md b/reference/map/map/cbegin.md index 95907a1948..86bde1b4e7 100644 --- a/reference/map/map/cbegin.md +++ b/reference/map/map/cbegin.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_iterator cbegin() const noexcept; +const_iterator cbegin() const noexcept; // (1) C++11 +constexpr const_iterator cbegin() const noexcept; // (1) C++26 ``` @@ -81,3 +82,7 @@ int main() | [`map::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`map::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`map::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/cend.md b/reference/map/map/cend.md index 4b97a897c6..17db0d9632 100644 --- a/reference/map/map/cend.md +++ b/reference/map/map/cend.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_iterator cend() const noexcept; +const_iterator cend() const noexcept; // (1) C++11 +constexpr const_iterator cend() const noexcept; // (1) C++26 ``` ## 概要 @@ -86,3 +87,7 @@ int main() | [`map::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`map::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`map::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/clear.md b/reference/map/map/clear.md index 4eb7dfbd77..98287e93cf 100644 --- a/reference/map/map/clear.md +++ b/reference/map/map/clear.md @@ -5,8 +5,9 @@ * function[meta id-type] ```cpp -void clear(); // C++03 -void clear() noexcept; // C++11 +void clear(); // (1) C++03 +void clear() noexcept; // (1) C++11 +constexpr void clear() noexcept; // (1) C++26 ``` ## 概要 @@ -68,3 +69,7 @@ int main() | [`map::erase`](erase.md) | 要素を削除する | | [`map::size`](size.md) | 要素数を取得する | | [`map::empty`](empty.md) | コンテナが空であるかどうかを調べる | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/contains.md b/reference/map/map/contains.md index 7974dba342..ba522b795e 100644 --- a/reference/map/map/contains.md +++ b/reference/map/map/contains.md @@ -6,10 +6,13 @@ * cpp20[meta cpp] ```cpp -bool contains(const key_type& x) const; // (1) +bool contains(const key_type& x) const; // (1) C++20 +constexpr bool contains(const key_type& x) const; // (1) C++26 template -bool contains(const K& x) const; // (2) +bool contains(const K& x) const; // (2) C++20 +template +constexpr bool contains(const K& x) const; // (2) C++26 ``` @@ -75,3 +78,4 @@ contain ## 参照 - [P0458R2 Checking for Existence of an Element in Associative Containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0458r2.html) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/count.md b/reference/map/map/count.md index e069aa8e38..b004e6c998 100644 --- a/reference/map/map/count.md +++ b/reference/map/map/count.md @@ -5,10 +5,13 @@ * function[meta id-type] ```cpp -size_type count(const key_type& x) const; // (1) +size_type count(const key_type& x) const; // (1) C++03 +constexpr size_type count(const key_type& x) const; // (1) C++26 template -size_type count(const K& x) const; // (2) C++14 +size_type count(const K& x) const; // (2) C++14 +template +constexpr size_type count(const K& x) const; // (2) C++26 ``` ## 概要 @@ -95,3 +98,4 @@ found ## 参照 - [N3657 Adding heterogeneous comparison lookup to associative containers (rev 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3657.htm) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/crbegin.md b/reference/map/map/crbegin.md index 2a159e8908..e0665a2c9e 100644 --- a/reference/map/map/crbegin.md +++ b/reference/map/map/crbegin.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_reverse_iterator crbegin() const noexcept; +const_reverse_iterator crbegin() const noexcept; // (1) C++11 +constexpr const_reverse_iterator crbegin() const noexcept; // (1) C++26 ``` ## 概要 @@ -74,3 +75,7 @@ int main() | [`map::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | | [`map::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`map::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/crend.md b/reference/map/map/crend.md index 56969981c0..cf75a56ce9 100644 --- a/reference/map/map/crend.md +++ b/reference/map/map/crend.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_reverse_iterator crend() const noexcept; +const_reverse_iterator crend() const noexcept; // (1) C++11 +constexpr const_reverse_iterator crend() const noexcept; // (1) C++26 ``` @@ -72,3 +73,7 @@ int main() | [`map::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | | [`map::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`map::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/emplace.md b/reference/map/map/emplace.md index 171c38a253..6913c37eda 100644 --- a/reference/map/map/emplace.md +++ b/reference/map/map/emplace.md @@ -7,7 +7,9 @@ ```cpp template -pair emplace(Args&&... args); +pair emplace(Args&&... args); // (1) C++11 +template +constexpr pair emplace(Args&&... args); // (1) C++26 ``` ## 概要 @@ -161,3 +163,4 @@ CCC : (1, 2) ## 参照 - [N2680 Proposed Wording for Placement Insert (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2680.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/emplace_hint.md b/reference/map/map/emplace_hint.md index e1a3e1de1a..cbcebf0dab 100644 --- a/reference/map/map/emplace_hint.md +++ b/reference/map/map/emplace_hint.md @@ -7,7 +7,13 @@ ```cpp template -iterator emplace_hint(const_iterator hint, Args&&... args); +iterator + emplace_hint(const_iterator hint, + Args&&... args); // (1) C++11 +template +constexpr iterator + emplace_hint(const_iterator hint, + Args&&... args); // (1) C++26 ``` ## 概要 @@ -90,3 +96,4 @@ int main() ## 参照 - [N2680 Proposed Wording for Placement Insert (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2680.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/empty.md b/reference/map/map/empty.md index 3783b07107..e3495d175a 100644 --- a/reference/map/map/empty.md +++ b/reference/map/map/empty.md @@ -5,10 +5,10 @@ * function[meta id-type] ```cpp -bool empty() const; // C++03 -bool empty() const noexcept; // C++11 -[[nodiscard]] bool empty() const noexcept; // C++20 -bool empty() const noexcept; // C++26 +bool empty() const; // (1) C++03 +bool empty() const noexcept; // (1) C++11 +[[nodiscard]] bool empty() const noexcept; // (1) C++20 +constexpr bool empty() const noexcept; // (1) C++26 ``` ## 概要 @@ -66,3 +66,4 @@ int main () - C++20で`[[nodiscard]]`が付加された - [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) - C++26で`[[nodiscard]]`指定が削除された +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/end.md b/reference/map/map/end.md index 24a465a391..102cb617b3 100644 --- a/reference/map/map/end.md +++ b/reference/map/map/end.md @@ -5,11 +5,13 @@ * function[meta id-type] ```cpp -iterator end(); // (1) C++03 -iterator end() noexcept; // (1) C++11 +iterator end(); // (1) C++03 +iterator end() noexcept; // (1) C++11 +constexpr iterator end() noexcept; // (1) C++26 -const_iterator end() const; // (2) C++03 -const_iterator end() const noexcept; // (2) C++11 +const_iterator end() const; // (2) C++03 +const_iterator end() const noexcept; // (2) C++11 +constexpr const_iterator end() const noexcept; // (2) C++26 ``` ## 概要 @@ -90,3 +92,7 @@ int main() | [`map::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`map::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`map::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/equal_range.md b/reference/map/map/equal_range.md index ff26455b4b..4de48054ef 100644 --- a/reference/map/map/equal_range.md +++ b/reference/map/map/equal_range.md @@ -5,17 +5,29 @@ * function[meta id-type] ```cpp -pair equal_range(const key_type& x); // (1) +pair + equal_range(const key_type& x); // (1) C++03 +constexpr pair + equal_range(const key_type& x); // (1) C++26 template -pair equal_range(const K& x); // (2) C++14 +pair + equal_range(const K& x); // (2) C++14 +template +constexpr pair + equal_range(const K& x); // (2) C++26 pair - equal_range(const key_type& x) const; // (3) + equal_range(const key_type& x) const; // (3) C++03 +constexpr pair + equal_range(const key_type& x) const; // (3) C++26 template pair - equal_range(const K& x) const; // (4) C++14 + equal_range(const K& x) const; // (4) C++14 +template +constexpr pair + equal_range(const K& x) const; // (4) C++26 ``` ## 概要 @@ -84,3 +96,4 @@ B,1 ## 参照 - [N3657 Adding heterogeneous comparison lookup to associative containers (rev 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3657.htm) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/erase.md b/reference/map/map/erase.md index fbe83e1b9d..3fe29bf14b 100644 --- a/reference/map/map/erase.md +++ b/reference/map/map/erase.md @@ -5,18 +5,24 @@ * function[meta id-type] ```cpp -void erase(iterator position); // (1) C++03 (C++11で一旦削除) -iterator erase(iterator position); // (1) C++17 +void erase(iterator position); // (1) C++03 (C++11で一旦削除) +iterator erase(iterator position); // (1) C++17 +constexpr iterator erase(iterator position); // (1) C++26 -iterator erase(const_iterator position); // (2) C++11 +iterator erase(const_iterator position); // (2) C++11 +constexpr iterator erase(const_iterator position); // (2) C++26 -size_type erase(const key_type& x); // (3) C++03 +size_type erase(const key_type& x); // (3) C++03 +constexpr size_type erase(const key_type& x); // (3) C++26 template -size_type erase(K&& x); // (4) C++23 +size_type erase(K&& x); // (4) C++23 +template +constexpr size_type erase(K&& x); // (4) C++26 -void erase(iterator first, iterator last); // (5) C++03 -iterator erase(const_iterator first, const_iterator last); // (5) C++11 +void erase(iterator first, iterator last); // (5) C++03 +iterator erase(const_iterator first, const_iterator last); // (5) C++11 +constexpr iterator erase(const_iterator first, const_iterator last); // (5) C++26 ``` ## 概要 @@ -189,3 +195,4 @@ int main() - C++17で、`erase(iterator)`を再追加 - [P2077R3 Heterogeneous erasure overloads for associative containers](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2077r3.html) - C++23で、`template erase(K&& x)`のオーバーロードが追加された +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/erase_if_free.md b/reference/map/map/erase_if_free.md index cdd23088c0..e555fecc81 100644 --- a/reference/map/map/erase_if_free.md +++ b/reference/map/map/erase_if_free.md @@ -8,7 +8,10 @@ namespace std { template typename map::size_type - erase_if(map& c, Predicate pred); + erase_if(map& c, Predicate pred); // (1) C++20 + template + constexpr typename map::size_type + erase_if(map& c, Predicate pred); // (1) C++26 } ``` @@ -84,3 +87,4 @@ int main() ## 参照 - [P1209R0 Adopt consistent container erasure from Library Fundamentals 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1209r0.html) - [R1115R3 Improving the Return Value of Erase-Like Algorithms II: Free `erase`/`erase_if`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1115r3.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/extract.md b/reference/map/map/extract.md index 9083621c15..65eb14e71a 100644 --- a/reference/map/map/extract.md +++ b/reference/map/map/extract.md @@ -6,12 +6,16 @@ * cpp17[meta cpp] ```cpp -node_type extract(const_iterator position); // (1) C++17 +node_type extract(const_iterator position); // (1) C++17 +constexpr node_type extract(const_iterator position); // (1) C++26 -node_type extract(const key_type& x); // (2) C++17 +node_type extract(const key_type& x); // (2) C++17 +constexpr node_type extract(const key_type& x); // (2) C++26 template -node_type extract(K&& x); // (3) C++23 +node_type extract(K&& x); // (3) C++23 +template +constexpr node_type extract(K&& x); // (3) C++26 ``` ## 概要 @@ -105,3 +109,4 @@ m2 : - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) - [P2077R3 Heterogeneous erasure overloads for associative containers](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2077r3.html) - C++23で、`template extract(K&& x)`のオーバーロードが追加された +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/find.md b/reference/map/map/find.md index 88261bb6e7..ca15ecfffb 100644 --- a/reference/map/map/find.md +++ b/reference/map/map/find.md @@ -5,15 +5,21 @@ * function[meta id-type] ```cpp -iterator find(const key_type& x); // (1) +iterator find(const key_type& x); // (1) C++03 +constexpr iterator find(const key_type& x); // (1) C++26 template -iterator find(const K& x); // (2) C++14 +iterator find(const K& x); // (2) C++14 +template +constexpr iterator find(const K& x); // (2) C++26 -const_iterator find(const key_type& x) const; // (3) +const_iterator find(const key_type& x) const; // (3) C++03 +constexpr const_iterator find(const key_type& x) const; // (3) C++26 template -const_iterator find(const K& x) const; // (4) C++14 +const_iterator find(const K& x) const; // (4) C++14 +template +constexpr const_iterator find(const K& x) const; // (4) C++26 ``` ## 概要 @@ -103,3 +109,4 @@ int main() ## 参照 - [N3657 Adding heterogeneous comparison lookup to associative containers (rev 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3657.htm) - [LWG Issue 2299. [CD] Effects of inaccessible `key_compare::is_transparent` type are not clear](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2299) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/get_allocator.md b/reference/map/map/get_allocator.md index b738036e04..e6a0975ec2 100644 --- a/reference/map/map/get_allocator.md +++ b/reference/map/map/get_allocator.md @@ -5,8 +5,9 @@ * function[meta id-type] ```cpp -allocator_type get_allocator() const; // C++03 -allocator_type get_allocator() const noexcept; // C++11 +allocator_type get_allocator() const; // (1) C++03 +allocator_type get_allocator() const noexcept; // (1) C++11 +constexpr allocator_type get_allocator() const noexcept; // (1) C++26 ``` ## 概要 @@ -70,3 +71,7 @@ b - [Visual C++](/implementation.md#visual_cpp): 2002 [mark verified], 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - 2012, 2013は、`noexcept`が実装されていないため、`throw()`が修飾されている。 - 2015からは、`noexcept`が修飾されている。 + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/insert.md b/reference/map/map/insert.md index 4e5ef9dd3a..18926db061 100644 --- a/reference/map/map/insert.md +++ b/reference/map/map/insert.md @@ -5,28 +5,44 @@ * function[meta id-type] ```cpp -pair insert(const value_type& x); // (1) +pair insert(const value_type& x); // (1) C++03 +constexpr pair insert(const value_type& x); // (1) C++26 template -pair insert(P&& x); // (2) C++11 +pair insert(P&& x); // (2) C++11 +template +constexpr pair insert(P&& x); // (2) C++26 -pair insert(value_type&& x); // (3) C++17 +pair insert(value_type&& x); // (3) C++17 +constexpr pair insert(value_type&& x); // (3) C++26 -iterator insert(iterator position, const value_type& x); // (4) C++03まで -iterator insert(const_iterator position, const value_type& x); // (4) C++11から +iterator insert(iterator position, const value_type& x); // (4) C++03 +iterator insert(const_iterator position, const value_type& x); // (4) C++11 +constexpr iterator insert(const_iterator position, const value_type& x); // (4) C++26 template -iterator insert(const_iterator position, P&& x); // (5) C++11 +iterator insert(const_iterator position, P&& x); // (5) C++11 +template +constexpr iterator insert(const_iterator position, P&& x); // (5) C++26 -iterator insert(const_iterator position, value_type&& x); // (6) C++17 +iterator insert(const_iterator position, value_type&& x); // (6) C++17 +constexpr iterator insert(const_iterator position, value_type&& x); // (6) C++26 template -void insert(InputIterator first, InputIterator last); // (7) +void insert(InputIterator first, InputIterator last); // (7) C++03 +template +constexpr void insert(InputIterator first, InputIterator last); // (7) C++26 + +void insert(initializer_list init); // (8) C++11 +constexpr void insert(initializer_list init); // (8) C++26 -void insert(initializer_list init); // (8) C++11 +insert_return_type insert(node_type&& nh); // (9) C++17 +constexpr insert_return_type insert(node_type&& nh); // (9) C++26 -insert_return_type insert(node_type&& nh); // (9) C++17 -iterator insert(const_iterator hint, node_type&& nh); // (10) C++17 +iterator + insert(const_iterator hint, node_type&& nh); // (10) C++17 +constexpr iterator + insert(const_iterator hint, node_type&& nh); // (10) C++26 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -176,3 +192,4 @@ int main () - C++14から、(2)と(4)の仕様の書き方が、`unordered_map::insert()`のものと統一された。 - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) - (7), (8)経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/insert_or_assign.md b/reference/map/map/insert_or_assign.md index f29b967841..f5fb75b166 100644 --- a/reference/map/map/insert_or_assign.md +++ b/reference/map/map/insert_or_assign.md @@ -9,30 +9,53 @@ template pair insert_or_assign(const key_type& k, - M&& obj); // (1) C++17 + M&& obj); // (1) C++17 +template +constexpr pair + insert_or_assign(const key_type& k, + M&& obj); // (1) C++26 + template pair insert_or_assign(key_type&& k, - M&& obj); // (2) C++17 + M&& obj); // (2) C++17 +template +constexpr pair + insert_or_assign(key_type&& k, + M&& obj); // (2) C++26 + template -pair +constexpr pair insert_or_assign(K&& k, - M&& obj); // (3) C++26 + M&& obj); // (3) C++26 + template iterator insert_or_assign(const_iterator hint, const key_type& k, - M&& obj); // (4) C++17 + M&& obj); // (4) C++17 +template +constexpr iterator + insert_or_assign(const_iterator hint, + const key_type& k, + M&& obj); // (4) C++26 + template iterator insert_or_assign(const_iterator hint, key_type&& k, - M&& obj); // (5) C++17 + M&& obj); // (5) C++17 +template +constexpr iterator + insert_or_assign(const_iterator hint, + key_type&& k, + M&& obj); // (5) C++26 + template -iterator +constexpr iterator insert_or_assign(const_iterator hint, K&& k, - M&& obj); // (6) C++26 + M&& obj); // (6) C++26 ``` ## 概要 @@ -137,3 +160,4 @@ int main() - [N4279 Improved insertion interface for unique-key maps (Revision 2.3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4279.html) - [P2363R5 Extending associative containers with the remaining heterogeneous overloads](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2363r5.html) - C++26で`template `のバージョンが追加された +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/insert_range.md b/reference/map/map/insert_range.md index 8a04f8c6d6..ce651fa4b3 100644 --- a/reference/map/map/insert_range.md +++ b/reference/map/map/insert_range.md @@ -7,7 +7,9 @@ ```cpp template R> -void insert_range(R&& rg); // C++23 +void insert_range(R&& rg); // (1) C++23 +template R> +constexpr void insert_range(R&& rg); // (1) C++26 ``` ## 概要 @@ -79,3 +81,7 @@ C 12 |------------------------------------------------|--------------------------------------------| | [`map::insert`](insert.md) | 要素を挿入する | | [`map::insert_or_assign`](insert_or_assign.md) | 要素を挿入、あるいは代入する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/key_comp.md b/reference/map/map/key_comp.md index d752ac16d2..5d45358779 100644 --- a/reference/map/map/key_comp.md +++ b/reference/map/map/key_comp.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -key_compare key_comp() const; +key_compare key_comp() const; // (1) C++03 +constexpr key_compare key_comp() const; // (1) C++26 ``` ## 概要 @@ -58,3 +59,7 @@ int main() | [`count`](count.md) | 指定したキーにマッチする要素の数を返す | | [`lower_bound`](lower_bound.md) | 与えられた値より小さく無い最初の要素へのイテレータを返す | | [`upper_bound`](upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/lower_bound.md b/reference/map/map/lower_bound.md index 86343e2323..19ed957e2b 100644 --- a/reference/map/map/lower_bound.md +++ b/reference/map/map/lower_bound.md @@ -5,15 +5,21 @@ * function[meta id-type] ```cpp -iterator lower_bound(const key_type& x); // (1) +iterator lower_bound(const key_type& x); // (1) C++03 +constexpr iterator lower_bound(const key_type& x); // (1) C++26 template -iterator lower_bound(const K& x); // (2) C++14 +iterator lower_bound(const K& x); // (2) C++14 +template +constexpr iterator lower_bound(const K& x); // (2) C++26 -const_iterator lower_bound(const key_type& x) const; // (3) +const_iterator lower_bound(const key_type& x) const; // (3) C++03 +constexpr const_iterator lower_bound(const key_type& x) const; // (3) C++26 template -const_iterator lower_bound(const K& x) const; // (4) C++14 +const_iterator lower_bound(const K& x) const; // (4) C++14 +template +constexpr const_iterator lower_bound(const K& x) const; // (4) C++26 ``` ## 概要 @@ -119,3 +125,4 @@ D,5 ## 参照 - [N3657 Adding heterogeneous comparison lookup to associative containers (rev 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3657.htm) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/max_size.md b/reference/map/map/max_size.md index bd3d904a9e..944c431eda 100644 --- a/reference/map/map/max_size.md +++ b/reference/map/map/max_size.md @@ -5,8 +5,9 @@ * function[meta id-type] ```cpp -size_type max_size() const; // C++03 -size_type max_size() const noexcept; // C++11 +size_type max_size() const; // (1) C++03 +size_type max_size() const noexcept; // (1) C++11 +constexpr size_type max_size() const noexcept; // (1) C++26 ``` ## 概要 @@ -55,3 +56,7 @@ int main () | 名前 | 説明 | |-----------------------------------------------------------------------------------|--------------------------| | [`size`](size.md) | 要素数を取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/merge.md b/reference/map/map/merge.md index 0b1c865e04..796ceeb336 100644 --- a/reference/map/map/merge.md +++ b/reference/map/map/merge.md @@ -7,13 +7,24 @@ ```cpp template - void merge(map& source); // (1) +void merge(map& source); // (1) C++17 template - void merge(map&& source); // (2) +constexpr void merge(map& source); // (1) C++26 + +template +void merge(map&& source); // (2) C++17 +template +constexpr void merge(map&& source); // (2) C++26 + +template +void merge(multimap& source); // (3) C++17 +template +constexpr void merge(multimap& source); // (3) C++26 + template - void merge(multimap& source); // (3) +void merge(multimap&& source); // (4) C++17 template - void merge(multimap&& source); // (4) +constexpr void merge(multimap&& source); // (4) C++26 ``` ## 概要 @@ -99,3 +110,4 @@ m2 : ## 参照 - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/op_assign.md b/reference/map/map/op_assign.md index 0ba7ea7340..96917aa196 100644 --- a/reference/map/map/op_assign.md +++ b/reference/map/map/op_assign.md @@ -5,12 +5,14 @@ * function[meta id-type] ```cpp -map& operator=(const map& x); // (1) C++03 -map& operator=(map&& x); // (2) C++11 -map& operator=(map&& x) - noexcept(allocator_traits::is_always_equal::value - && is_nothrow_move_assignable::value); (2) // C++17 -map& operator=(initializer_list init); // (3) C++11 +map& operator=(const map& x); // (1) C++03 +constexpr map& operator=(const map& x); // (1) C++26 + +map& operator=(map&& x); // (2) C++11 +constexpr map& operator=(map&& x); // (2) C++26 + +map& operator=(initializer_list init); // (3) C++11 +constexpr map& operator=(initializer_list init); // (3) C++26 ``` ## 概要 @@ -96,3 +98,4 @@ Size of m2: 5 - (3)の経緯となる提案文書 - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) - `noexcept` 追加の経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/op_at.md b/reference/map/map/op_at.md index eb7b29d3c8..c5543b4865 100644 --- a/reference/map/map/op_at.md +++ b/reference/map/map/op_at.md @@ -5,12 +5,14 @@ * function[meta id-type] ```cpp -T& operator[](const key_type& x); // (1) C++03 +T& operator[](const key_type& x); // (1) C++03 +constexpr T& operator[](const key_type& x); // (1) C++26 -T& operator[](key_type&& x); // (2) C++11 +T& operator[](key_type&& x); // (2) C++11 +constexpr T& operator[](key_type&& x); // (2) C++26 template -T& operator[](K&& x); // (3) C++26 +constexpr T& operator[](K&& x); // (3) C++26 ``` ## 概要 @@ -76,3 +78,4 @@ a ## 参照 - [P2363R5 Extending associative containers with the remaining heterogeneous overloads](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2363r5.html) - C++26で`template `のバージョンが追加された +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/op_compare_3way.md b/reference/map/map/op_compare_3way.md index 2575260976..99b25180ed 100644 --- a/reference/map/map/op_compare_3way.md +++ b/reference/map/map/op_compare_3way.md @@ -10,6 +10,10 @@ namespace std { synth-three-way-result> operator<=>(const map& x, const map& y); // (1) C++20 + template + constexpr synth-three-way-result> + operator<=>(const map& x, + const map& y); // (1) C++26 } ``` @@ -84,3 +88,4 @@ int main() ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/op_constructor.md b/reference/map/map/op_constructor.md index cddd74bc36..30c80e02eb 100644 --- a/reference/map/map/op_constructor.md +++ b/reference/map/map/op_constructor.md @@ -5,53 +5,93 @@ * function[meta id-type] ```cpp -map(); // (1) C++14 から +map(); // (1) C++14 から +constexpr map(); // (1) C++26 explicit map(const Compare& comp, - const Allocator& alloc = Allocator()); // (2) C++14 から + const Allocator& alloc = Allocator()); // (2) C++14 から +constexpr explicit + map(const Compare& comp, + const Allocator& alloc = Allocator()); // (2) C++26 explicit map(const Compare& comp = Compare(), - const Allocator& alloc = Allocator()); // (1) + (2) C++11 まで + const Allocator& alloc = Allocator()); // (1) + (2) C++11 まで -explicit map(const Allocator& alloc); // (3) C++11 から +explicit map(const Allocator& alloc); // (3) C++11 から +constexpr explicit map(const Allocator& alloc); // (3) C++26 template map(InputIterator first, InputIterator last, const Compare& comp = Compare(), - const Allocator& alloc = Allocator()); // (4) + const Allocator& alloc = Allocator()); // (4) C++03 +template +constexpr + map(InputIterator first, + InputIterator last, + const Compare& comp = Compare(), + const Allocator& alloc = Allocator()); // (4) C++26 template map(InputIterator first, InputIterator last, - const Allocator& alloc); // (5) C++14 から + const Allocator& alloc); // (5) C++14 +template +constexpr + map(InputIterator first, + InputIterator last, + const Allocator& alloc); // (5) C++26 -map(const map& x); // (6) +map(const map& x); // (6) C++03 +constexpr map(const map& x); // (6) C++26 -map(const map& x, const Allocator& alloc); // (7) C++11 +map(const map& x, const Allocator& alloc); // (7) C++11 map(const map& x, - const type_identity_t& alloc); // (7) C++23 + const type_identity_t& alloc); // (7) C++23 +constexpr + map(const map& x, + const type_identity_t& alloc); // (7) C++26 -map(map&& y); // (8) C++11 から +map(map&& y); // (8) C++11 +constexpr map(map&& y); // (8) C++26 map(map&& y, const Allocator& alloc); // (9) C++11 map(map&& y, const type_identity_t& alloc); // (9) C++23 +constexpr + map(map&& y, + const type_identity_t& alloc); // (9) C++26 map(initializer_list init, const Compare& comp = Compare(), - const Allocator& alloc = Allocator()); // (10) C++11 から + const Allocator& alloc = Allocator()); // (10) C++11 +constexpr + map(initializer_list init, + const Compare& comp = Compare(), + const Allocator& alloc = Allocator()); // (10) C++26 map(initializer_list init, - const Allocator& alloc); // (11) C++14 から + const Allocator& alloc); // (11) C++14 +constexpr + map(initializer_list init, + const Allocator& alloc); // (11) C++26 template R> map(from_range_t, R&& rg, const Compare& comp = Compare(), - const Allocator& alloc = Allocator()); // (12) C++23 から + const Allocator& alloc = Allocator()); // (12) C++23 +template R> +constexpr + map(from_range_t, R&& rg, + const Compare& comp = Compare(), + const Allocator& alloc = Allocator()); // (12) C++26 template R> map(from_range_t, R&& rg, - const Allocator& alloc); // (13) C++23 から + const Allocator& alloc); // (13) C++23 +template R> +constexpr + map(from_range_t, R&& rg, + const Allocator& alloc); // (13) C++26 ``` * type_identity_t[link /reference/type_traits/type_identity.md] * initializer_list[link ../../initializer_list.md] @@ -176,3 +216,4 @@ Size of m2: 2 なお、Discussion の例はアロケータの型が誤っているので注意 - [P1518R2 Stop Overconstraining Allocators in Container Deduction Guides](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1518r2.html) - C++23でのアロケータ引数を`type_identity_t`で包む変更 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/op_destructor.md b/reference/map/map/op_destructor.md index 386bdd6ad4..271a9abc0a 100644 --- a/reference/map/map/op_destructor.md +++ b/reference/map/map/op_destructor.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -~map(); +~map(); // (1) C++03 +constexpr ~map(); // (1) C++26 ``` ## 概要 @@ -14,3 +15,7 @@ ## 計算量 [`size()`](size.md) に対して線形時間(デストラクタ呼び出し) + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/op_equal.md b/reference/map/map/op_equal.md index 3b1729ec33..2295d541e2 100644 --- a/reference/map/map/op_equal.md +++ b/reference/map/map/op_equal.md @@ -9,6 +9,10 @@ namespace std { bool operator==(const map& x, const map& y); // (1) C++03 + template + constexpr bool + operator==(const map& x, + const map& y); // (1) C++26 } ``` @@ -70,3 +74,4 @@ int main() - C++14から、2つ目のイテレータ範囲のendイテレータをとる`equal()`アルゴリズムを使用するようになった。 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/op_greater.md b/reference/map/map/op_greater.md index e370347afb..9ac94b37fc 100644 --- a/reference/map/map/op_greater.md +++ b/reference/map/map/op_greater.md @@ -10,6 +10,10 @@ namespace std { bool operator>(const map& x, const map& y); // (1) C++03 + template + constexpr bool + operator>(const map& x, + const map& y); // (1) C++26 } ``` @@ -71,3 +75,4 @@ int main() ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/op_greater_equal.md b/reference/map/map/op_greater_equal.md index d5b1df4b9a..c118d6b020 100644 --- a/reference/map/map/op_greater_equal.md +++ b/reference/map/map/op_greater_equal.md @@ -9,7 +9,11 @@ namespace std { template bool operator>=(const map& x, - const map& y); + const map& y); // (1) C++03 + template + constexpr bool + operator>=(const map& x, + const map& y); // (1) C++26 } ``` @@ -64,3 +68,4 @@ int main() ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/op_less.md b/reference/map/map/op_less.md index e3d2883901..5a6307ec52 100644 --- a/reference/map/map/op_less.md +++ b/reference/map/map/op_less.md @@ -10,6 +10,10 @@ namespace std { bool operator<(const map& x, const map& y); // (1) C++03 + template + constexpr bool + operator<(const map& x, + const map& y); // (1) C++26 } ``` @@ -75,3 +79,4 @@ int main() ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/op_less_equal.md b/reference/map/map/op_less_equal.md index 4c21a10abc..ad7322cdcc 100644 --- a/reference/map/map/op_less_equal.md +++ b/reference/map/map/op_less_equal.md @@ -10,6 +10,10 @@ namespace std { bool operator<=(const map& x, const map& y); // (1) C++03 + template + constexpr bool + operator<=(const map& x, + const map& y); // (1) C++26 } ``` @@ -64,3 +68,4 @@ int main() ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/op_not_equal.md b/reference/map/map/op_not_equal.md index b30d6da0a7..7ec44659c8 100644 --- a/reference/map/map/op_not_equal.md +++ b/reference/map/map/op_not_equal.md @@ -10,6 +10,10 @@ namespace std { bool operator!=(const map& x, const map& y); // (1) C++03 + template + constexpr bool + operator!=(const map& x, + const map& y); // (1) C++26 } ``` @@ -70,3 +74,4 @@ int main() ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/rbegin.md b/reference/map/map/rbegin.md index 0f7c4387f8..98aab9ac54 100644 --- a/reference/map/map/rbegin.md +++ b/reference/map/map/rbegin.md @@ -5,11 +5,13 @@ * function[meta id-type] ```cpp -reverse_iterator rbegin(); // (1) C++03 -reverse_iterator rbegin() noexcept; // (1) C++11 +reverse_iterator rbegin(); // (1) C++03 +reverse_iterator rbegin() noexcept; // (1) C++11 +constexpr reverse_iterator rbegin() noexcept; // (1) C++26 -const_reverse_iterator rbegin() const; // (2) C++03 -const_reverse_iterator rbegin() const noexcept; // (2) C++11 +const_reverse_iterator rbegin() const; // (2) C++03 +const_reverse_iterator rbegin() const noexcept; // (2) C++11 +constexpr const_reverse_iterator rbegin() const noexcept; // (2) C++26 ``` ## 概要 @@ -77,3 +79,7 @@ int main() | [`map::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`map::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`map::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/rend.md b/reference/map/map/rend.md index 4c4c53ca7a..f273a708a3 100644 --- a/reference/map/map/rend.md +++ b/reference/map/map/rend.md @@ -5,11 +5,13 @@ * function[meta id-type] ```cpp -reverse_iterator rend(); // (1) C++03 -reverse_iterator rend() noexcept; // (1) C++11 +reverse_iterator rend(); // (1) C++03 +reverse_iterator rend() noexcept; // (1) C++11 +constexpr reverse_iterator rend() noexcept; // (1) C++26 -const_reverse_iterator rend() const; // (2) C++03 -const_reverse_iterator rend() const noexcept; // (2) C++11 +const_reverse_iterator rend() const; // (2) C++03 +const_reverse_iterator rend() const noexcept; // (2) C++11 +constexpr const_reverse_iterator rend() const noexcept; // (2) C++26 ``` ## 概要 @@ -71,3 +73,7 @@ int main() | [`map::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | | [`map::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`map::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/size.md b/reference/map/map/size.md index 4effa4cbb8..cf0e6cb096 100644 --- a/reference/map/map/size.md +++ b/reference/map/map/size.md @@ -5,8 +5,9 @@ * function[meta id-type] ```cpp -size_type size() const; // C++03 -size_type size() const noexcept; // C++11 +size_type size() const; // (1) C++03 +size_type size() const noexcept; // (1) C++11 +constexpr size_type size() const noexcept; // (1) C++26 ``` ## 概要 @@ -69,3 +70,7 @@ int main () |-------------------------------------------------------------------------------------------|-----------------------------------------------------| | [`max_size`](max_size.md) | 格納可能な最大の要素数を取得する | | [`empty`](empty.md) | コンテナが空であるかどうかを調べる | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/swap.md b/reference/map/map/swap.md index 06962518d7..51387a65aa 100644 --- a/reference/map/map/swap.md +++ b/reference/map/map/swap.md @@ -5,10 +5,16 @@ * function[meta id-type] ```cpp -void swap(map& st); -void swap(map& x) - noexcept(allocator_traits::is_always_equal::value - && noexcept(swap(declval(),declval()))); // C++17 +void + swap(map& st); // (1) C++03 +void + swap(map& x) + noexcept(allocator_traits::is_always_equal::value + && noexcept(swap(declval(),declval()))); // (1) C++17 +constexpr void + swap(map& x) + noexcept(allocator_traits::is_always_equal::value + && noexcept(swap(declval(),declval()))); // (1) C++26 ``` ## 概要 @@ -80,3 +86,4 @@ m2 : {[10,a], [20,b], [30,c], } ## 参照 - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) - `noexcept` 追加の経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/swap_free.md b/reference/map/map/swap_free.md index c0777215c3..722fee6407 100644 --- a/reference/map/map/swap_free.md +++ b/reference/map/map/swap_free.md @@ -6,13 +6,19 @@ ```cpp namespace std { template - void swap(map& x, - map& y); - + void + swap(map& x, + map& y); // (1) C++03 + template + void + swap(map& x, + map& y) + noexcept(noexcept(x.swap(y))); // (1) C++17 template - void swap(map& x, - map& y) - noexcept(noexcept(x.swap(y))); // C++17 + constexpr void + swap(map& x, + map& y) + noexcept(noexcept(x.swap(y))); // (1) C++26 } ``` @@ -90,3 +96,4 @@ m2 : {[10,a], [20,b], [30,c], } ## 参照 - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) - `noexcept` 追加の経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/try_emplace.md b/reference/map/map/try_emplace.md index 6763461a7f..8b75cadd28 100644 --- a/reference/map/map/try_emplace.md +++ b/reference/map/map/try_emplace.md @@ -9,32 +9,48 @@ template pair try_emplace(const key_type& k, Args&&... args); // (1) C++17 +template +constexpr pair + try_emplace(const key_type& k, Args&&... args); // (1) C++26 template pair - try_emplace(key_type&& k, Args&&... args); // (2) C++17 + try_emplace(key_type&& k, Args&&... args); // (2) C++17 +template +constexpr pair + try_emplace(key_type&& k, Args&&... args); // (2) C++26 template iterator try_emplace(const_iterator hint, const key_type& k, - Args&&... args); // (3) C++17 + Args&&... args); // (3) C++17 +template +constexpr iterator + try_emplace(const_iterator hint, + const key_type& k, + Args&&... args); // (3) C++26 template iterator try_emplace(const_iterator hint, key_type&& k, - Args&&... args); // (4) C++17 + Args&&... args); // (4) C++17 +template +constexpr iterator + try_emplace(const_iterator hint, + key_type&& k, + Args&&... args); // (4) C++26 template -pair +constexpr pair try_emplace(K&& k, Args&&... args); // (5) C++26 template -iterator +constexpr iterator try_emplace(const_iterator hint, K&& k, - Args&&... args); // (6) C++26 + Args&&... args); // (6) C++26 ``` ## 概要 @@ -150,3 +166,4 @@ false, 114, false - [N4279 Improved insertion interface for unique-key maps (Revision 2.3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4279.html) - [P2363R5: Extending associative containers with the remaining heterogeneous overloads](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2363r5.html) - C++26で`template `のバージョンが追加された +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/upper_bound.md b/reference/map/map/upper_bound.md index 3dc23a0344..65b1a09b9d 100644 --- a/reference/map/map/upper_bound.md +++ b/reference/map/map/upper_bound.md @@ -5,15 +5,21 @@ * function[meta id-type] ```cpp -iterator upper_bound(const key_type& x); // (1) +iterator upper_bound(const key_type& x); // (1) C++03 +constexpr iterator upper_bound(const key_type& x); // (1) C++26 template -iterator upper_bound(const K& x); // (2) C++14 +iterator upper_bound(const K& x); // (2) C++14 +template +constexpr iterator upper_bound(const K& x); // (2) C++26 -const_iterator upper_bound(const key_type& x) const; // (3) +const_iterator upper_bound(const key_type& x) const; // (3) C++03 +constexpr const_iterator upper_bound(const key_type& x) const; // (3) C++26 template -const_iterator upper_bound(const K& x) const; // (4) C++14 +const_iterator upper_bound(const K& x) const; // (4) C++14 +template +constexpr const_iterator upper_bound(const K& x) const; // (4) C++26 ``` ## 概要 @@ -119,3 +125,4 @@ D,5 ## 参照 - [N3657 Adding heterogeneous comparison lookup to associative containers (rev 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3657.htm) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/map/value_comp.md b/reference/map/map/value_comp.md index 41311abb3b..14a732841b 100644 --- a/reference/map/map/value_comp.md +++ b/reference/map/map/value_comp.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -value_compare value_comp() const; +value_compare value_comp() const; // (1) C++03 +constexpr value_compare value_comp() const; // (1) C++26 ``` ## 概要 @@ -65,3 +66,7 @@ int main() | [`count`](count.md) | 指定したキーにマッチする要素の数を返す | | [`lower_bound`](lower_bound.md) | 与えられた値より小さくない最初の要素へのイテレータを返す | | [`upper_bound`](upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/begin.md b/reference/map/multimap/begin.md index 1708b1c07b..b1a3fa2fbe 100644 --- a/reference/map/multimap/begin.md +++ b/reference/map/multimap/begin.md @@ -5,11 +5,13 @@ * function[meta id-type] ```cpp -iterator begin(); // (1) C++03 -iterator begin() noexcept; // (1) C++11 +iterator begin(); // (1) C++03 +iterator begin() noexcept; // (1) C++11 +constexpr iterator begin() noexcept; // (1) C++26 -const_iterator begin() const; // (2) C++03 -const_iterator begin() const noexcept; // (2) C++11 +const_iterator begin() const; // (2) C++03 +const_iterator begin() const noexcept; // (2) C++11 +constexpr const_iterator begin() const noexcept; // (2) C++26 ``` @@ -91,3 +93,7 @@ int main() | [`multimap::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`multimap::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`multimap::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/cbegin.md b/reference/map/multimap/cbegin.md index e994d7e924..dea8b2ec85 100644 --- a/reference/map/multimap/cbegin.md +++ b/reference/map/multimap/cbegin.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_iterator cbegin() const noexcept; +const_iterator cbegin() const noexcept; // (1) C++11 +constexpr const_iterator cbegin() const noexcept; // (1) C++26 ``` ## 概要 @@ -83,3 +84,7 @@ int main() | [`multimap::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`multimap::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`multimap::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/cend.md b/reference/map/multimap/cend.md index 363c48347f..8d66b10d22 100644 --- a/reference/map/multimap/cend.md +++ b/reference/map/multimap/cend.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_iterator cend() const noexcept; +const_iterator cend() const noexcept; // (1) C++11 +constexpr const_iterator cend() const noexcept; // (1) C++26 ``` ## 概要 @@ -89,3 +90,7 @@ int main() | [`multimap::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`multimap::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`multimap::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/clear.md b/reference/map/multimap/clear.md index ec97f3c360..7916dbb3b9 100644 --- a/reference/map/multimap/clear.md +++ b/reference/map/multimap/clear.md @@ -5,8 +5,9 @@ * function[meta id-type] ```cpp -void clear(); // C++03 -void clear() noexcept; // C++11 +void clear(); // (1) C++03 +void clear() noexcept; // (1) C++11 +constexpr void clear() noexcept; // (1) C++26 ``` ## 概要 @@ -69,3 +70,7 @@ int main() | [`multimap::erase`](erase.md) | 要素を削除する | | [`multimap::size`](size.md) | 要素数を取得する | | [`multimap::empty`](empty.md) | コンテナが空であるかどうかを調べる | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/contains.md b/reference/map/multimap/contains.md index c13b617750..97849403b9 100644 --- a/reference/map/multimap/contains.md +++ b/reference/map/multimap/contains.md @@ -6,10 +6,13 @@ * cpp20[meta cpp] ```cpp -bool contains(const key_type& x) const; // (1) +bool contains(const key_type& x) const; // (1) C++20 +constexpr bool contains(const key_type& x) const; // (1) C++26 template -bool contains(const K& x) const; // (2) +bool contains(const K& x) const; // (2) C++20 +template +constexpr bool contains(const K& x) const; // (2) C++26 ``` @@ -75,3 +78,4 @@ contain ## 参照 - [P0458R2 Checking for Existence of an Element in Associative Containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0458r2.html) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/count.md b/reference/map/multimap/count.md index 1cae65de68..4b159f12af 100644 --- a/reference/map/multimap/count.md +++ b/reference/map/multimap/count.md @@ -5,10 +5,13 @@ * function[meta id-type] ```cpp -size_type count(const key_type& x) const; // (1) +size_type count(const key_type& x) const; // (1) C++03 +constexpr size_type count(const key_type& x) const; // (1) C++26 template -size_type count(const K& x) const; // (2) C++14 +size_type count(const K& x) const; // (2) C++14 +template +constexpr size_type count(const K& x) const; // (2) C++26 ``` ## 概要 @@ -89,3 +92,4 @@ int main() ## 参照 - [N3657 Adding heterogeneous comparison lookup to associative containers (rev 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3657.htm) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/crbegin.md b/reference/map/multimap/crbegin.md index 4c93666f82..f17389b009 100644 --- a/reference/map/multimap/crbegin.md +++ b/reference/map/multimap/crbegin.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_reverse_iterator crbegin() const noexcept; +const_reverse_iterator crbegin() const noexcept; // (1) C++11 +constexpr const_reverse_iterator crbegin() const noexcept; // (1) C++26 ``` ## 概要 @@ -75,3 +76,7 @@ int main() | [`multimap::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | | [`multimap::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`multimap::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/crend.md b/reference/map/multimap/crend.md index a4fcc0c0e7..03688ca9c9 100644 --- a/reference/map/multimap/crend.md +++ b/reference/map/multimap/crend.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_reverse_iterator crend() const noexcept; +const_reverse_iterator crend() const noexcept; // (1) C++11 +constexpr const_reverse_iterator crend() const noexcept; // (1) C++26 ``` @@ -73,3 +74,7 @@ int main() | [`multimap::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | | [`multimap::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`multimap::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/emplace.md b/reference/map/multimap/emplace.md index 60108f7e77..2d450975b7 100644 --- a/reference/map/multimap/emplace.md +++ b/reference/map/multimap/emplace.md @@ -7,7 +7,9 @@ ```cpp template -iterator emplace(Args&&... args); +iterator emplace(Args&&... args); // (1) C++11 +template +constexpr iterator emplace(Args&&... args); // (1) C++26 ``` ## 概要 @@ -120,3 +122,4 @@ CCC : (1, 2) ## 参照 - [N2680 Proposed Wording for Placement Insert (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2680.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/emplace_hint.md b/reference/map/multimap/emplace_hint.md index 26f17f10a4..c9880fc1d8 100644 --- a/reference/map/multimap/emplace_hint.md +++ b/reference/map/multimap/emplace_hint.md @@ -7,7 +7,13 @@ ```cpp template -iterator emplace_hint(const_iterator hint, Args&&... args); +iterator + emplace_hint(const_iterator hint, + Args&&... args); // (1) C++11 +template +constexpr iterator + emplace_hint(const_iterator hint, + Args&&... args); // (1) C++26 ``` ## 概要 @@ -87,3 +93,4 @@ int main() ## 参照 - [N2680 Proposed Wording for Placement Insert (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2680.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/empty.md b/reference/map/multimap/empty.md index 529615da1f..3774649e03 100644 --- a/reference/map/multimap/empty.md +++ b/reference/map/multimap/empty.md @@ -5,10 +5,10 @@ * function[meta id-type] ```cpp -bool empty() const; // C++03 -bool empty() const noexcept; // C++11 -[[nodiscard]] bool empty() const noexcept; // C++20 -bool empty() const noexcept; // C++26 +bool empty() const; // (1) C++03 +bool empty() const noexcept; // (1) C++11 +[[nodiscard]] bool empty() const noexcept; // (1) C++20 +constexpr bool empty() const noexcept; // (1) C++26 ``` ## 概要 @@ -66,3 +66,4 @@ int main () - C++20で`[[nodiscard]]`が付加された - [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) - C++26で`[[nodiscard]]`指定が削除された +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/end.md b/reference/map/multimap/end.md index 826c870306..ef2ea86a45 100644 --- a/reference/map/multimap/end.md +++ b/reference/map/multimap/end.md @@ -5,11 +5,13 @@ * function[meta id-type] ```cpp -iterator end(); // (1) C++03 -iterator end() noexcept; // (1) C++11 +iterator end(); // (1) C++03 +iterator end() noexcept; // (1) C++11 +constexpr iterator end() noexcept; // (1) C++26 -const_iterator end() const; // (2) C++03 -const_iterator end() const noexcept; // (2) C++11 +const_iterator end() const; // (2) C++03 +const_iterator end() const noexcept; // (2) C++11 +constexpr const_iterator end() const noexcept; // (2) C++26 ``` ## 概要 @@ -93,3 +95,7 @@ int main() | [`multimap::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`multimap::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`multimap::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/equal_range.md b/reference/map/multimap/equal_range.md index 9af81c1900..1e6fcf848f 100644 --- a/reference/map/multimap/equal_range.md +++ b/reference/map/multimap/equal_range.md @@ -5,17 +5,29 @@ * function[meta id-type] ```cpp -pair equal_range(const key_type& x); // (1) +pair + equal_range(const key_type& x); // (1) C++03 +constexpr pair + equal_range(const key_type& x); // (1) C++26 template -pair equal_range(const K& x); // (2) C++14 +pair + equal_range(const K& x); // (2) C++14 +template +constexpr pair + equal_range(const K& x); // (2) C++26 pair - equal_range(const key_type& x) const; // (3) + equal_range(const key_type& x) const; // (3) C++03 +constexpr pair + equal_range(const key_type& x) const; // (3) C++26 template pair - equal_range(const K& x) const; // (4) C++14 + equal_range(const K& x) const; // (4) C++14 +template +constexpr pair + equal_range(const K& x) const; // (4) C++26 ``` ## 概要 @@ -89,3 +101,4 @@ B,2 ## 参照 - [N3657 Adding heterogeneous comparison lookup to associative containers (rev 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3657.htm) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/erase.md b/reference/map/multimap/erase.md index aea7de4822..0483bc9d7c 100644 --- a/reference/map/multimap/erase.md +++ b/reference/map/multimap/erase.md @@ -5,18 +5,24 @@ * function[meta id-type] ```cpp -void erase(iterator position); // (1) C++03 (C++11で一旦削除) -iterator erase(iterator position); // (1) C++17 +void erase(iterator position); // (1) C++03 (C++11で一旦削除) +iterator erase(iterator position); // (1) C++17 +constexpr iterator erase(iterator position); // (1) C++26 -iterator erase(const_iterator position); // (2) C++11 +iterator erase(const_iterator position); // (2) C++11 +constexpr iterator erase(const_iterator position); // (2) C++26 -size_type erase(const key_type& x); // (3) C++03 +size_type erase(const key_type& x); // (3) C++03 +constexpr size_type erase(const key_type& x); // (3) C++26 template -size_type erase(K&& x); // (4) C++23 +size_type erase(K&& x); // (4) C++23 +template +constexpr size_type erase(K&& x); // (4) C++26 -void erase(iterator first, iterator last); // (5) C++03 -iterator erase(const_iterator first, const_iterator last); // (5) C++11 +void erase(iterator first, iterator last); // (5) C++03 +iterator erase(const_iterator first, const_iterator last); // (5) C++11 +constexpr iterator erase(const_iterator first, const_iterator last); // (5) C++26 ``` @@ -178,3 +184,4 @@ int main() - C++17で、`erase(iterator)`を再追加 - [P2077R3 Heterogeneous erasure overloads for associative containers](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2077r3.html) - C++23で、`template erase(K&& x)`のオーバーロードが追加された +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/erase_if_free.md b/reference/map/multimap/erase_if_free.md index 59458a3a42..7f118d43b5 100644 --- a/reference/map/multimap/erase_if_free.md +++ b/reference/map/multimap/erase_if_free.md @@ -8,7 +8,10 @@ namespace std { template typename multimap::size_type - erase_if(multimap& c, Predicate pred); + erase_if(multimap& c, Predicate pred); // (1) C++20 + template + constexpr typename multimap::size_type + erase_if(multimap& c, Predicate pred); // (1) C++26 } ``` @@ -84,3 +87,4 @@ int main() ## 参照 - [P1209R0 Adopt consistent container erasure from Library Fundamentals 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1209r0.html) - [R1115R3 Improving the Return Value of Erase-Like Algorithms II: Free `erase`/`erase_if`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1115r3.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/extract.md b/reference/map/multimap/extract.md index 0a15458ddd..97d3d6be6f 100644 --- a/reference/map/multimap/extract.md +++ b/reference/map/multimap/extract.md @@ -6,12 +6,16 @@ * cpp17[meta cpp] ```cpp -node_type extract(const_iterator position); // (1) C++17 +node_type extract(const_iterator position); // (1) C++17 +constexpr node_type extract(const_iterator position); // (1) C++26 -node_type extract(const key_type& x); // (2) C++17 +node_type extract(const key_type& x); // (2) C++17 +constexpr node_type extract(const key_type& x); // (2) C++26 template -node_type extract(K&& x); // (3) C++23 +node_type extract(K&& x); // (3) C++23 +template +constexpr node_type extract(K&& x); // (3) C++26 ``` ## 概要 @@ -105,3 +109,4 @@ m2 : - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) - [P2077R3 Heterogeneous erasure overloads for associative containers](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2077r3.html) - C++23で、`template extract(K&& x)`のオーバーロードが追加された +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/find.md b/reference/map/multimap/find.md index c531420864..87a1f3c1eb 100644 --- a/reference/map/multimap/find.md +++ b/reference/map/multimap/find.md @@ -5,15 +5,21 @@ * function[meta id-type] ```cpp -iterator find(const key_type& x); // (1) +iterator find(const key_type& x); // (1) C++03 +constexpr iterator find(const key_type& x); // (1) C++26 template -iterator find(const K& x); // (2) C++14 +iterator find(const K& x); // (2) C++14 +template +constexpr iterator find(const K& x); // (2) C++26 -const_iterator find(const key_type& x) const; // (3) +const_iterator find(const key_type& x) const; // (3) C++03 +constexpr const_iterator find(const key_type& x) const; // (3) C++26 template -const_iterator find(const K& x) const; // (4) C++14 +const_iterator find(const K& x) const; // (4) C++14 +template +constexpr const_iterator find(const K& x) const; // (4) C++26 ``` ## 概要 @@ -105,3 +111,4 @@ int main() ## 参照 - [N3657 Adding heterogeneous comparison lookup to associative containers (rev 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3657.htm) - [LWG Issue 2299. [CD] Effects of inaccessible `key_compare::is_transparent` type are not clear](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2299) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/get_allocator.md b/reference/map/multimap/get_allocator.md index a96bc5a414..1c9019801e 100644 --- a/reference/map/multimap/get_allocator.md +++ b/reference/map/multimap/get_allocator.md @@ -5,8 +5,9 @@ * function[meta id-type] ```cpp -allocator_type get_allocator() const; // C++03 -allocator_type get_allocator() const noexcept; // C++11 +allocator_type get_allocator() const; // (1) C++03 +allocator_type get_allocator() const noexcept; // (1) C++11 +constexpr allocator_type get_allocator() const noexcept; // (1) C++26 ``` ## 概要 @@ -69,3 +70,7 @@ b - [Visual C++](/implementation.md#visual_cpp): 2002 [mark verified], 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - 2012, 2013は、`noexcept`が実装されていないため、`throw()`が修飾されている。 - 2015からは、`noexcept`が修飾されている。 + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/insert.md b/reference/map/multimap/insert.md index a073847669..70009aa8f2 100644 --- a/reference/map/multimap/insert.md +++ b/reference/map/multimap/insert.md @@ -5,27 +5,42 @@ * function[meta id-type] ```cpp -iterator insert(const value_type& x); // (1) -iterator insert(value_type&& y); // (2) C++17 +iterator insert(const value_type& x); // (1) C++03 +constexpr iterator insert(const value_type& x); // (1) C++26 +iterator insert(value_type&& y); // (2) C++17 +constexpr iterator insert(value_type&& y); // (2) C++26 + +template +iterator insert(P&& x); // (3) C++11 template -iterator insert(P&& x); // (3) C++11 +constexpr iterator insert(P&& x); // (3) C++26 -iterator insert(iterator position, const value_type& x); // (4) C++03 -iterator insert(const_iterator position, const value_type& x); // (4) C++11 +iterator insert(iterator position, const value_type& x); // (4) C++03 +iterator insert(const_iterator position, const value_type& x); // (4) C++11 +constexpr iterator insert(const_iterator position, const value_type& x); // (4) C++26 -iterator insert(const_iterator position, value_type&& y); // (5) C++17 +iterator insert(const_iterator position, value_type&& y); // (5) C++17 +constexpr iterator insert(const_iterator position, value_type&& y); // (5) C++26 template -iterator insert(const_iterator position, P&& x); // (6) C++11 +iterator insert(const_iterator position, P&& x); // (6) C++11 +template +constexpr iterator insert(const_iterator position, P&& x); // (6) C++26 template -void insert(InputIterator first, InputIterator last); // (7) +void insert(InputIterator first, InputIterator last); // (7) C++03 +template +constexpr void insert(InputIterator first, InputIterator last); // (7) C++26 + +void insert(initializer_list init); // (8) C++11 +constexpr void insert(initializer_list init); // (8) C++26 -void insert(initializer_list init); // (8) C++11 +iterator insert(node_type&& nh); // (9) C++17 +constexpr iterator insert(node_type&& nh); // (9) C++26 -iterator insert(node_type&& nh); // (9) C++17 -iterator insert(const_iterator hint, node_type&& nh); // (10) C++17 +iterator insert(const_iterator hint, node_type&& nh); // (10) C++17 +constexpr iterator insert(const_iterator hint, node_type&& nh); // (10) C++26 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -136,3 +151,4 @@ int main () - C++14から、(3)と(6)の仕様の書き方が、`unordered_map::insert()`のものと統一された。 - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) - (9), (10)経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/insert_range.md b/reference/map/multimap/insert_range.md index 6e0baca7c6..09a66f54cb 100644 --- a/reference/map/multimap/insert_range.md +++ b/reference/map/multimap/insert_range.md @@ -7,7 +7,9 @@ ```cpp template R> -void insert_range(R&& rg); // C++23 +void insert_range(R&& rg); // (1) C++23 +template R> +constexpr void insert_range(R&& rg); // (1) C++26 ``` ## 概要 @@ -76,3 +78,7 @@ C 12 | 名前 | 説明 | |------------------------------------------------|--------------------------------------------| | [`multimap::insert`](insert.md) | 要素を挿入する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/key_comp.md b/reference/map/multimap/key_comp.md index eda97667ab..0bc86a3493 100644 --- a/reference/map/multimap/key_comp.md +++ b/reference/map/multimap/key_comp.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -key_compare key_comp() const; +key_compare key_comp() const; // (1) C++03 +constexpr key_compare key_comp() const; // (1) C++26 ``` ## 概要 @@ -60,3 +61,7 @@ int main() | [`count`](count.md) | 指定したキーにマッチする要素の数を返す | | [`lower_bound`](lower_bound.md) | 与えられた値より小さく無い最初の要素へのイテレータを返す | | [`upper_bound`](upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/lower_bound.md b/reference/map/multimap/lower_bound.md index 0c1c7352fe..0571b722d6 100644 --- a/reference/map/multimap/lower_bound.md +++ b/reference/map/multimap/lower_bound.md @@ -5,15 +5,21 @@ * function[meta id-type] ```cpp -iterator lower_bound(const key_type& x); // (1) +iterator lower_bound(const key_type& x); // (1) C++03 +constexpr iterator lower_bound(const key_type& x); // (1) C++26 template -iterator lower_bound(const K& x); // (2) C++14 +iterator lower_bound(const K& x); // (2) C++14 +template +constexpr iterator lower_bound(const K& x); // (2) C++26 -const_iterator lower_bound(const key_type& x) const; // (3) +const_iterator lower_bound(const key_type& x) const; // (3) C++03 +constexpr const_iterator lower_bound(const key_type& x) const; // (3) C++26 template -const_iterator lower_bound(const K& x) const; // (4) C++14 +const_iterator lower_bound(const K& x) const; // (4) C++14 +template +constexpr const_iterator lower_bound(const K& x) const; // (4) C++26 ``` ## 概要 @@ -121,3 +127,4 @@ D,5 ## 参照 - [N3657 Adding heterogeneous comparison lookup to associative containers (rev 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3657.htm) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/max_size.md b/reference/map/multimap/max_size.md index 29e1851169..8c10e11a11 100644 --- a/reference/map/multimap/max_size.md +++ b/reference/map/multimap/max_size.md @@ -5,8 +5,9 @@ * function[meta id-type] ```cpp -size_type max_size() const; // C++03 -size_type max_size() const noexcept; // C++11 +size_type max_size() const; // (1) C++03 +size_type max_size() const noexcept; // (1) C++11 +constexpr size_type max_size() const noexcept; // (1) C++26 ``` ## 概要 @@ -55,3 +56,7 @@ int main () | 名前 | 説明 | |-----------------------------------------------------------------------------------|--------------------------| | [`size`](size.md) | 要素数を取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/merge.md b/reference/map/multimap/merge.md index e229e9eee7..15fd806aa1 100644 --- a/reference/map/multimap/merge.md +++ b/reference/map/multimap/merge.md @@ -7,13 +7,24 @@ ```cpp template - void merge(map& source); // (1) +void merge(map& source); // (1) C++17 template - void merge(map&& source); // (2) +constexpr void merge(map& source); // (1) C++26 + +template +void merge(map&& source); // (2) C++17 +template +constexpr void merge(map&& source); // (2) C++26 + +template +void merge(multimap& source); // (3) C++17 +template +constexpr void merge(multimap& source); // (3) C++26 + template - void merge(multimap& source); // (3) +void merge(multimap&& source); // (4) C++17 template - void merge(multimap&& source); // (4) +constexpr void merge(multimap&& source); // (4) C++26 ``` ## 概要 @@ -98,3 +109,4 @@ m2 : ## 参照 - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/op_assign.md b/reference/map/multimap/op_assign.md index ef804fa1f9..0e9ffabd1d 100644 --- a/reference/map/multimap/op_assign.md +++ b/reference/map/multimap/op_assign.md @@ -5,12 +5,20 @@ * function[meta id-type] ```cpp -multimap& operator=(const multimap& x); // (1) C++03 -multimap& operator=(multimap&& x); // (2) C++11 +multimap& operator=(const multimap& x); // (1) C++03 +constexpr multimap& operator=(const multimap& x); // (1) C++26 + +multimap& operator=(multimap&& x); // (2) C++11 multimap& operator=(multimap&& x) noexcept(allocator_traits::is_always_equal::value - && is_nothrow_move_assignable::value) // (2) C++17 -multimap& operator=(initializer_list init); // (3) C++11 + && is_nothrow_move_assignable::value) // (2) C++17 +constexpr multimap& + operator=(multimap&& x) + noexcept(allocator_traits::is_always_equal::value + && is_nothrow_move_assignable::value) // (2) C++26 + +multimap& operator=(initializer_list init); // (3) C++11 +constexpr multimap& operator=(initializer_list init); // (3) C++26 ``` ## 概要 @@ -96,3 +104,4 @@ Size of m2: 6 - (3)の経緯となる提案文書 - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) - `noexcept` 追加の経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/op_compare_3way.md b/reference/map/multimap/op_compare_3way.md index dc5ddc220e..5377baf6d3 100644 --- a/reference/map/multimap/op_compare_3way.md +++ b/reference/map/multimap/op_compare_3way.md @@ -10,6 +10,10 @@ namespace std { synth-three-way-result> operator<=>(const multimap& x, const multimap& y); // (1) C++20 + template + constexpr synth-three-way-result> + operator<=>(const multimap& x, + const multimap& y); // (1) C++26 } ``` @@ -83,3 +87,4 @@ int main() ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/op_constructor.md b/reference/map/multimap/op_constructor.md index f34c413561..3b0f26e05f 100644 --- a/reference/map/multimap/op_constructor.md +++ b/reference/map/multimap/op_constructor.md @@ -5,56 +5,101 @@ * function[meta id-type] ```cpp -multimap(); // (1) C++14 から +multimap(); // (1) C++14 +constexpr multimap(); // (1) C++26 -explicit multimap(const Compare& comp, - const Allocator& alloc = Allocator()); // (2) C++14 まで +explicit + multimap(const Compare& comp, + const Allocator& alloc = Allocator()); // (2) C++14 +constexpr explicit + multimap(const Compare& comp, + const Allocator& alloc = Allocator()); // (2) C++26 explicit multimap(const Compare& comp = Compare(), const Allocator& alloc = Allocator()); // (1) + (2) C++11 まで -explicit multimap(const Allocator& alloc); // (3) C++11 から +explicit multimap(const Allocator& alloc); // (3) C++11 +constexpr explicit multimap(const Allocator& alloc); // (3) C++26 template multimap(InputIterator first, InputIterator last, const Compare& comp = Compare(), - const Allocator& alloc = Allocator()); // (4) + const Allocator& alloc = Allocator()); // (4) C++03 +template +constexpr + multimap(InputIterator first, + InputIterator last, + const Compare& comp = Compare(), + const Allocator& alloc = Allocator()); // (4) C++26 template multimap(InputIterator first, InputIterator last, - const Allocator& alloc); // (5) C++14 から + const Allocator& alloc); // (5) C++14 +template +constexpr + multimap(InputIterator first, + InputIterator last, + const Allocator& alloc); // (5) C++26 -multimap(const multimap& x); // (6) +multimap(const multimap& x); // (6) C++03 +constexpr multimap(const multimap& x); // (6) C++26 multimap(const multimap& x, - const Allocator& alloc); // (7) C++11 + const Allocator& alloc); // (7) C++11 multimap(const multimap& x, - const type_identity_t& alloc); // (7) C++23 + const type_identity_t& alloc); // (7) C++23 +constexpr + multimap(const multimap& x, + const type_identity_t& alloc); // (7) C++26 -multimap(multimap&& y); // (8) C++11 から +multimap(multimap&& y); // (8) C++11 +constexpr multimap(multimap&& y); // (8) C++26 multimap(multimap&& y, - const Allocator& alloc); // (9) C++11 + const Allocator& alloc); // (9) C++11 multimap(multimap&& y, - const type_identity_t& alloc); // (9) C++23 + const type_identity_t& alloc); // (9) C++23 +constexpr + multimap(multimap&& y, + const type_identity_t& alloc); // (9) C++26 multimap(initializer_list init, const Compare& comp = Compare(), - const Allocator& alloc = Allocator()); // (10) C++11 から + const Allocator& alloc = Allocator()); // (10) C++11 +constexpr + multimap(initializer_list init, + const Compare& comp = Compare(), + const Allocator& alloc = Allocator()); // (10) C++26 multimap(initializer_list init, - const Allocator& alloc); // (11) C++14 から + const Allocator& alloc); // (11) C++14 +constexpr + multimap(initializer_list init, + const Allocator& alloc); // (11) C++26 template R> -multimap(from_range_t, R&& rg, +multimap(from_range_t, + R&& rg, const Compare& comp = Compare(), - const Allocator& alloc = Allocator()); // (12) C++23 から + const Allocator& alloc = Allocator()); // (12) C++23 +template R> +constexpr + multimap(from_range_t, + R&& rg, + const Compare& comp = Compare(), + const Allocator& alloc = Allocator()); // (12) C++26 template R> -multimap(from_range_t, R&& rg, - const Allocator& alloc); // (13) C++23 から +multimap(from_range_t, + R&& rg, + const Allocator& alloc); // (13) C++23 +template R> +constexpr + multimap(from_range_t, + R&& rg, + const Allocator& alloc); // (13) C++26 ``` * type_identity_t[link /reference/type_traits/type_identity.md] * initializer_list[link ../../initializer_list.md] @@ -180,3 +225,4 @@ Size of m2: 3 なお、Discussion の例はアロケータの型が誤っているので注意 - [P1518R2 Stop Overconstraining Allocators in Container Deduction Guides](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1518r2.html) - C++23でのアロケータ引数を`type_identity_t`で包む変更 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/op_destructor.md b/reference/map/multimap/op_destructor.md index 5d5d1e911e..79209f4d84 100644 --- a/reference/map/multimap/op_destructor.md +++ b/reference/map/multimap/op_destructor.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -~multimap(); +~multimap(); // (1) C++03 +constexpr ~multimap(); // (1) C++26 ``` ## 概要 @@ -14,3 +15,7 @@ ## 計算量 [`size()`](size.md) に対して線形時間(デストラクタ呼び出し) + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/op_equal.md b/reference/map/multimap/op_equal.md index f8f925e41f..97d1500c3c 100644 --- a/reference/map/multimap/op_equal.md +++ b/reference/map/multimap/op_equal.md @@ -9,6 +9,10 @@ namespace std { bool operator==(const multimap& x, const multimap& y); // (1) C++03 + template + constexpr bool + operator==(const multimap& x, + const multimap& y); // (1) C++26 } ``` @@ -71,3 +75,4 @@ int main() - C++14から、2つ目のイテレータ範囲のendイテレータをとる`equal()`アルゴリズムを使用するようになった。 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/op_greater.md b/reference/map/multimap/op_greater.md index 2cb7f0affb..26ab76de32 100644 --- a/reference/map/multimap/op_greater.md +++ b/reference/map/multimap/op_greater.md @@ -10,6 +10,10 @@ namespace std { bool operator>(const multimap& x, const multimap& y); // (1) C++03 + template + constexpr bool + operator>(const multimap& x, + const multimap& y); // (1) C++26 } ``` @@ -71,3 +75,4 @@ int main() ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/op_greater_equal.md b/reference/map/multimap/op_greater_equal.md index 14dfafbe9a..6011331187 100644 --- a/reference/map/multimap/op_greater_equal.md +++ b/reference/map/multimap/op_greater_equal.md @@ -10,6 +10,10 @@ namespace std { bool operator>=(const multimap& x, const multimap& y); // (1) C++03 + template + constexpr bool + operator>=(const multimap& x, + const multimap& y); // (1) C++26 } ``` @@ -64,3 +68,4 @@ int main() ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/op_less.md b/reference/map/multimap/op_less.md index 62b80c81ba..585c114f67 100644 --- a/reference/map/multimap/op_less.md +++ b/reference/map/multimap/op_less.md @@ -10,6 +10,10 @@ namespace std { bool operator<(const multimap& x, const multimap& y); // (1) C++03 + template + constexpr bool + operator<(const multimap& x, + const multimap& y); // (1) C++26 } ``` @@ -75,3 +79,4 @@ int main() ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/op_less_equal.md b/reference/map/multimap/op_less_equal.md index c3bfc02055..7aad0e15eb 100644 --- a/reference/map/multimap/op_less_equal.md +++ b/reference/map/multimap/op_less_equal.md @@ -10,6 +10,10 @@ namespace std { bool operator<=(const multimap& x, const multimap& y); // (1) C++03 + template + constexpr bool + operator<=(const multimap& x, + const multimap& y); // (1) C++26 } ``` @@ -64,3 +68,4 @@ int main() ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/op_not_equal.md b/reference/map/multimap/op_not_equal.md index 06603a51bd..038e6fd7c4 100644 --- a/reference/map/multimap/op_not_equal.md +++ b/reference/map/multimap/op_not_equal.md @@ -10,6 +10,10 @@ namespace std { bool operator!=(const multimap& x, const multimap& y); // (1) C++03 + template + constexpr bool + operator!=(const multimap& x, + const multimap& y); // (1) C++26 } ``` @@ -69,3 +73,4 @@ int main() ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/rbegin.md b/reference/map/multimap/rbegin.md index 8cbc8a1662..ff1d5cc272 100644 --- a/reference/map/multimap/rbegin.md +++ b/reference/map/multimap/rbegin.md @@ -5,11 +5,13 @@ * function[meta id-type] ```cpp -reverse_iterator rbegin(); // (1) C++03 -reverse_iterator rbegin() noexcept; // (1) C++11 +reverse_iterator rbegin(); // (1) C++03 +reverse_iterator rbegin() noexcept; // (1) C++11 +constexpr reverse_iterator rbegin() noexcept; // (1) C++26 -const_reverse_iterator rbegin() const; // (2) C++03 -const_reverse_iterator rbegin() const noexcept; // (2) C++11 +const_reverse_iterator rbegin() const; // (2) C++03 +const_reverse_iterator rbegin() const noexcept; // (2) C++11 +constexpr const_reverse_iterator rbegin() const noexcept; // (2) C++26 ``` ## 概要 @@ -78,3 +80,7 @@ int main() | [`multimap::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`multimap::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`multimap::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/rend.md b/reference/map/multimap/rend.md index aa1eb7c50a..aa06f4f32a 100644 --- a/reference/map/multimap/rend.md +++ b/reference/map/multimap/rend.md @@ -5,11 +5,13 @@ * function[meta id-type] ```cpp -reverse_iterator rend(); // (1) C++03 -reverse_iterator rend() noexcept; // (1) C++11 +reverse_iterator rend(); // (1) C++03 +reverse_iterator rend() noexcept; // (1) C++11 +constexpr reverse_iterator rend() noexcept; // (1) C++26 -const_reverse_iterator rend() const; // (2) C++03 -const_reverse_iterator rend() const noexcept; // (2) C++11 +const_reverse_iterator rend() const; // (2) C++03 +const_reverse_iterator rend() const noexcept; // (2) C++11 +constexpr const_reverse_iterator rend() const noexcept; // (2) C++26 ``` ## 概要 @@ -72,3 +74,7 @@ int main() | [`multimap::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | | [`multimap::crbegin`](crbegin.md) | 末尾を指す逆constイテレータを取得する | | [`multimap::crend`](crend.md) | 先頭の前を指す逆constイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/size.md b/reference/map/multimap/size.md index 3688eaf9cd..bfb9fee597 100644 --- a/reference/map/multimap/size.md +++ b/reference/map/multimap/size.md @@ -5,8 +5,9 @@ * function[meta id-type] ```cpp -size_type size() const; // C++03 -size_type size() const noexcept; // C++11 +size_type size() const; // (1) C++03 +size_type size() const noexcept; // (1) C++11 +constexpr size_type size() const noexcept; // (1) C++26 ``` ## 概要 @@ -69,3 +70,7 @@ int main () |-------------------------------------------------------------------------------------------|-----------------------------------------------------| | [`max_size`](max_size.md) | 格納可能な最大の要素数を取得する | | [`empty`](empty.md) | コンテナが空であるかどうかを調べる | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/swap.md b/reference/map/multimap/swap.md index c46cb7728b..df7863e8fa 100644 --- a/reference/map/multimap/swap.md +++ b/reference/map/multimap/swap.md @@ -5,10 +5,16 @@ * function[meta id-type] ```cpp -void swap(multimap& st); -void swap(multimap& x) - noexcept(allocator_traits::is_always_equal::value - && noexcept(swap(declval(),declval()))); // C++17 +void + swap(multimap& st); // (1) C++03 +void + swap(multimap& x) + noexcept(allocator_traits::is_always_equal::value + && noexcept(swap(declval(),declval()))); // (1) C++17 +constexpr void + swap(multimap& x) + noexcept(allocator_traits::is_always_equal::value + && noexcept(swap(declval(),declval()))); // (1) C++26 ``` ## 概要 @@ -80,3 +86,4 @@ m2 : {[10,a], [20,b], [30,c], } ## 参照 - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) - `noexcept` 追加の経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/swap_free.md b/reference/map/multimap/swap_free.md index 3550b7f042..3d803225b9 100644 --- a/reference/map/multimap/swap_free.md +++ b/reference/map/multimap/swap_free.md @@ -6,13 +6,19 @@ ```cpp namespace std { template - void swap(multimap& x, - multimap& y); - + void + swap(multimap& x, + multimap& y); // (1) C++03 + template + void + swap(multimap& x, + multimap& y) + noexcept(noexcept(x.swap(y))); // (1) C++17 template - void swap(multimap& x, - multimap& y) - noexcept(noexcept(x.swap(y))); // C++17 + constexpr void + swap(multimap& x, + multimap& y) + noexcept(noexcept(x.swap(y))); // (1) C++26 } ``` @@ -89,3 +95,4 @@ m2 : {[10,a], [20,b], [30,c], } ## 参照 - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) - `noexcept` 追加の経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/upper_bound.md b/reference/map/multimap/upper_bound.md index de9faf7498..daffa94905 100644 --- a/reference/map/multimap/upper_bound.md +++ b/reference/map/multimap/upper_bound.md @@ -5,15 +5,21 @@ * function[meta id-type] ```cpp -iterator upper_bound(const key_type& x); // (1) +iterator upper_bound(const key_type& x); // (1) C++03 +constexpr iterator upper_bound(const key_type& x); // (1) C++26 template -iterator upper_bound(const K& x); // (2) C++14 +iterator upper_bound(const K& x); // (2) C++14 +template +constexpr iterator upper_bound(const K& x); // (2) C++26 -const_iterator upper_bound(const key_type& x) const; // (3) +const_iterator upper_bound(const key_type& x) const; // (3) C++03 +constexpr const_iterator upper_bound(const key_type& x) const; // (3) C++26 template -const_iterator upper_bound(const K& x) const; // (4) C++14 +const_iterator upper_bound(const K& x) const; // (4) C++14 +template +constexpr const_iterator upper_bound(const K& x) const; // (4) C++26 ``` ## 概要 @@ -121,3 +127,4 @@ D,5 ## 参照 - [N3657 Adding heterogeneous comparison lookup to associative containers (rev 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3657.htm) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/map/multimap/value_comp.md b/reference/map/multimap/value_comp.md index 2e774950eb..73e5d81e00 100644 --- a/reference/map/multimap/value_comp.md +++ b/reference/map/multimap/value_comp.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -value_compare value_comp() const; +value_compare value_comp() const; // (1) C++03 +constexpr value_compare value_comp() const; // (1) C++26 ``` ## 概要 @@ -66,3 +67,7 @@ int main() | [`count`](count.md) | 指定したキーにマッチする要素の数を返す | | [`lower_bound`](lower_bound.md) | 与えられた値より小さくない最初の要素へのイテレータを返す | | [`upper_bound`](upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/node_handle/node_handle/empty.md b/reference/node_handle/node_handle/empty.md index e544cb4dcb..deca155fc9 100644 --- a/reference/node_handle/node_handle/empty.md +++ b/reference/node_handle/node_handle/empty.md @@ -6,9 +6,9 @@ * [meta namespace] ```cpp -bool empty() const noexcept; -[[nodiscard]] bool empty() const noexcept; // C++20 -bool empty() const noexcept; // C++26 +bool empty() const noexcept; // (1) C++17 +[[nodiscard]] bool empty() const noexcept; // (1) C++20 +constexpr bool empty() const noexcept; // (1) C++26 ``` ## 概要 @@ -50,3 +50,4 @@ true - C++20で`[[nodiscard]]`が付加された - [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) - C++26で`[[nodiscard]]`指定が削除された +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/node_handle/node_handle/get_allocator.md b/reference/node_handle/node_handle/get_allocator.md index d860f39f24..b775c44b4d 100644 --- a/reference/node_handle/node_handle/get_allocator.md +++ b/reference/node_handle/node_handle/get_allocator.md @@ -6,7 +6,8 @@ * [meta namespace] ```cpp -allocator_type get_allocator() const; +allocator_type get_allocator() const; // (1) C++17 +constexpr allocator_type get_allocator() const; // (1) C++26 ``` ## 概要 @@ -56,3 +57,4 @@ int main() ## 参照 - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/node_handle/node_handle/mapped.md b/reference/node_handle/node_handle/mapped.md index c5909723e2..9204127967 100644 --- a/reference/node_handle/node_handle/mapped.md +++ b/reference/node_handle/node_handle/mapped.md @@ -6,7 +6,8 @@ * [meta namespace] ```cpp -mapped_type& mapped() const; // set コンテナには存在ない +mapped_type& mapped() const; // (1) C++17 : set コンテナには存在ない +constexpr mapped_type& mapped() const; // (1) C++26 : set コンテナには存在ない ``` ## 概要 @@ -64,3 +65,4 @@ nya ## 参照 - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/node_handle/node_handle/op_assign.md b/reference/node_handle/node_handle/op_assign.md index efa67a46f9..8d768d4402 100644 --- a/reference/node_handle/node_handle/op_assign.md +++ b/reference/node_handle/node_handle/op_assign.md @@ -6,7 +6,8 @@ * [meta namespace] ```cpp -node_handle& operator=(node_handle&& nh); +node_handle& operator=(node_handle&& nh); // (1) C++17 +constexpr node_handle& operator=(node_handle&& nh); // (1) C++26 ``` ## 概要 @@ -68,3 +69,4 @@ int main() ## 参照 - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/node_handle/node_handle/op_bool.md b/reference/node_handle/node_handle/op_bool.md index d5b3ef3e35..d0777aff03 100644 --- a/reference/node_handle/node_handle/op_bool.md +++ b/reference/node_handle/node_handle/op_bool.md @@ -6,7 +6,8 @@ * [meta namespace] ```cpp -explicit operator bool() const noexcept; +explicit operator bool() const noexcept; // (1) C++17 +constexpr explicit operator bool() const noexcept; // (1) C++26 ``` ## 概要 @@ -47,3 +48,4 @@ false ## 参照 - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/node_handle/node_handle/op_constructor.md b/reference/node_handle/node_handle/op_constructor.md index 46562e8055..45194fa363 100644 --- a/reference/node_handle/node_handle/op_constructor.md +++ b/reference/node_handle/node_handle/op_constructor.md @@ -6,8 +6,11 @@ * [meta namespace] ```cpp -constexpr node_handle() noexcept : ptr_(), alloc_() {} // (1) -node_handle(node_handle&& nh) noexcept; // (2) +node_handle() noexcept : ptr_(), alloc_() {} // (1) C++17 +constexpr node_handle() noexcept : ptr_(), alloc_() {} // (1) C++26 + +node_handle(node_handle&& nh) noexcept; // (2) C++17 +constexpr node_handle(node_handle&& nh) noexcept; // (2) C++26 ``` ## 概要 @@ -57,3 +60,4 @@ int main() ## 参照 - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/node_handle/node_handle/op_destructor.md b/reference/node_handle/node_handle/op_destructor.md index 3db26cae4b..6da11e0577 100644 --- a/reference/node_handle/node_handle/op_destructor.md +++ b/reference/node_handle/node_handle/op_destructor.md @@ -6,7 +6,8 @@ * [meta namespace] ```cpp -~node_handle(); +~node_handle(); // (1) C++17 +constexpr ~node_handle(); // (1) C++26 ``` ## 概要 @@ -48,3 +49,4 @@ int main() ## 参照 - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/node_handle/node_handle/swap.md b/reference/node_handle/node_handle/swap.md index a2ba4f1dcd..8d1d2a3a5a 100644 --- a/reference/node_handle/node_handle/swap.md +++ b/reference/node_handle/node_handle/swap.md @@ -6,9 +6,14 @@ * [meta namespace] ```cpp -void swap(node_handle&) +void + swap(node_handle&) noexcept(ator_traits::propagate_on_container_swap::value || - ator_traits::is_always_equal::value); + ator_traits::is_always_equal::value); // (1) C++17 +constexpr void + swap(node_handle&) + noexcept(ator_traits::propagate_on_container_swap::value || + ator_traits::is_always_equal::value); // (1) C++26 ``` ## 概要 @@ -92,3 +97,4 @@ node2 : [10, a] ## 参照 - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/node_handle/node_handle/swap_free.md b/reference/node_handle/node_handle/swap_free.md index 919a7f31a3..40638e52f8 100644 --- a/reference/node_handle/node_handle/swap_free.md +++ b/reference/node_handle/node_handle/swap_free.md @@ -5,7 +5,12 @@ * [meta namespace] ```cpp -friend void swap(node_handle& x, node_handle& y) noexcept(noexcept(x.swap(y))); +friend void + swap(node_handle& x, node_handle& y) + noexcept(noexcept(x.swap(y))); // (1) C++17 +constexpr friend void + swap(node_handle& x, node_handle& y) + noexcept(noexcept(x.swap(y))); // (1) C++26 ``` ## 概要 @@ -80,3 +85,4 @@ node2 : [10, a] ## 参照 - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/node_handle/node_handle/value.md b/reference/node_handle/node_handle/value.md index 455d15d147..3b9f389b82 100644 --- a/reference/node_handle/node_handle/value.md +++ b/reference/node_handle/node_handle/value.md @@ -6,7 +6,8 @@ * [meta namespace] ```cpp -value_type& value() const; // map コンテナには存在ない +value_type& value() const; // (1) C++17 : map コンテナには存在ない +constexpr value_type& value() const; // (1) C++26 : map コンテナには存在ない ``` ## 概要 @@ -58,3 +59,4 @@ int main() ## 参照 - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/queue/priority_queue/emplace.md b/reference/queue/priority_queue/emplace.md index 0d9f8ce271..f2a93f99f5 100644 --- a/reference/queue/priority_queue/emplace.md +++ b/reference/queue/priority_queue/emplace.md @@ -7,7 +7,9 @@ ```cpp template -void emplace(Args&&... args); +void emplace(Args&&... args); // (1) C++11 +template +constexpr void emplace(Args&&... args); // (1) C++26 ``` ## 概要 @@ -73,3 +75,4 @@ int main () ## 参照 - [N2680 Proposed Wording for Placement Insert (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2680.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/queue/priority_queue/empty.md b/reference/queue/priority_queue/empty.md index 267d9a5a5c..86a5e1c4aa 100644 --- a/reference/queue/priority_queue/empty.md +++ b/reference/queue/priority_queue/empty.md @@ -5,9 +5,9 @@ * function[meta id-type] ```cpp -bool empty() const; // C++03 -[[nodiscard]] bool empty() const; // C++20 -bool empty() const; // C++26 +bool empty() const; // (1) C++03 +[[nodiscard]] bool empty() const; // (1) C++20 +constexpr bool empty() const; // (1) C++26 ``` ## 概要 @@ -71,3 +71,4 @@ non_empty_que is not empty - C++20で`[[nodiscard]]`が付加された - [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) - C++26で`[[nodiscard]]`指定が削除された +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/queue/priority_queue/op_constructor.md b/reference/queue/priority_queue/op_constructor.md index ef3ff162e8..62c1ae5841 100644 --- a/reference/queue/priority_queue/op_constructor.md +++ b/reference/queue/priority_queue/op_constructor.md @@ -5,93 +5,182 @@ * function[meta id-type] ```cpp -explicit priority_queue( - const Compare& x = Compare(), - const Container& other = Container()); // (1) C++03 - -explicit priority_queue(const Compare& x = Compare(), - Container&& y = Container()); // (1) C++11 - -priority_queue() : priority_queue(Compare()) {} // (1) C++20 - -explicit priority_queue(const Compare& x) - : priority_queue(x, Container()) {} // (2) C++20 - -priority_queue(const Compare& x, const Container& other); // (3) C++11 - -priority_queue(const priority_queue&); // (4) C++03 -priority_queue(const priority_queue&) = default; // (4) C++11 +explicit + priority_queue(const Compare& x = Compare(), + const Container& other = Container()); // (1) C++03 +explicit + priority_queue(const Compare& x = Compare(), + Container&& y = Container()); // (1) C++11 +priority_queue() + : priority_queue(Compare()) {} // (1) C++20 +constexpr + priority_queue() + : priority_queue(Compare()) {} // (1) C++26 + +explicit + priority_queue(const Compare& x) + : priority_queue(x, Container()) {} // (2) C++20 +constexpr explicit + priority_queue(const Compare& x) + : priority_queue(x, Container()) {} // (2) C++26 + +priority_queue(const Compare& x, const Container& other); // (3) C++11 +constexpr priority_queue(const Compare& x, const Container& other); // (3) C++26 + +priority_queue(const priority_queue&); // (4) C++03 +priority_queue(const priority_queue&) = default; // (4) C++11 +constexpr priority_queue(const priority_queue&) = default; // (4) C++26 template -priority_queue(InputIterator first, InputIterator last, +priority_queue(InputIterator first, + InputIterator last, const Compare& x = Compare(), - const Container& other = Container()); // (5) C++03 + const Container& other = Container()); // (5) C++03 +template +constexpr + priority_queue(InputIterator first, + InputIterator last, + const Compare& x = Compare(), + const Container& other = Container()); // (5) C++26 template -priority_queue(InputIterator first, InputIterator last, +priority_queue(InputIterator first, + InputIterator last, const Compare& x, - const Container& other); // (6) C++11 + const Container& other); // (6) C++11 +template +constexpr + priority_queue(InputIterator first, + InputIterator last, + const Compare& x, + const Container& other); // (6) C++26 template -priority_queue(InputIterator first, InputIterator last, +priority_queue(InputIterator first, + InputIterator last, const Compare& x = Compare(), - Container&& other = Container()); // (7) C++11 + Container&& other = Container()); // (7) C++11 +template +constexpr + priority_queue(InputIterator first, + InputIterator last, + const Compare& x = Compare(), + Container&& other = Container()); // (7) C++26 -priority_queue(priority_queue&&) = default; // (8) C++11 +priority_queue(priority_queue&&) = default; // (8) C++11 +constexpr priority_queue(priority_queue&&) = default; // (8) C++26 template -explicit priority_queue(const Alloc& alloc); // (9) C++11 +explicit priority_queue(const Alloc& alloc); // (9) C++11 +template +constexpr explicit priority_queue(const Alloc& alloc); // (9) C++26 template -priority_queue(const Compare& x, const Alloc& alloc); // (10) C++11 +priority_queue(const Compare& x, const Alloc& alloc); // (10) C++11 +template +constexpr priority_queue(const Compare& x, const Alloc& alloc); // (10) C++26 template priority_queue(const Compare& x, const Container& other, - const Alloc& alloc); // (11) C++11 + const Alloc& alloc); // (11) C++11 +template +constexpr + priority_queue(const Compare& x, + const Container& other, + const Alloc& alloc); // (11) C++26 template priority_queue(const Compare x&, Container&& other, - const Alloc& alloc); // (12) C++11 + const Alloc& alloc); // (12) C++11 +template +constexpr + priority_queue(const Compare x&, + Container&& other, + const Alloc& alloc); // (12) C++26 template priority_queue(const priority_queue& que, - const Alloc& alloc); // (13) C++11 + const Alloc& alloc); // (13) C++11 +template +constexpr + priority_queue(const priority_queue& que, + const Alloc& alloc); // (13) C++26 template priority_queue(priority_queue&& que, - const Alloc& alloc); // (14) C++11 + const Alloc& alloc); // (14) C++11 +template +constexpr + priority_queue(priority_queue&& que, + const Alloc& alloc); // (14) C++26 template -priority_queue(InputIterator first, InputIterator last, +priority_queue(InputIterator first, + InputIterator last, const Compare& x, - const Alloc& alloc); // (15) C++23 + const Alloc& alloc); // (15) C++23 +template +constexpr + priority_queue(InputIterator first, + InputIterator last, + const Compare& x, + const Alloc& alloc); // (15) C++26 template -priority_queue(InputIterator first, InputIterator last, +priority_queue(InputIterator first, + InputIterator last, const Compare& x, const Container& other, - const Alloc& alloc); // (16) C++23 + const Alloc& alloc); // (16) C++23 +template +constexpr + priority_queue(InputIterator first, + InputIterator last, + const Compare& x, + const Container& other, + const Alloc& alloc); // (16) C++26 template -priority_queue(InputIterator first, InputIterator last, +priority_queue(InputIterator first, + InputIterator last, const Compare& x, Container&& other, - const Alloc& alloc); // (17) C++23 + const Alloc& alloc); // (17) C++23 +template +constexpr + priority_queue(InputIterator first, + InputIterator last, + const Compare& x, + Container&& other, + const Alloc& alloc); // (17) C++26 template R> priority_queue(from_range_t, R&& rg, - const Compare& x = Compare()); // (18) C++23 + const Compare& x = Compare()); // (18) C++23 +template R> +constexpr + priority_queue(from_range_t, R&& rg, + const Compare& x = Compare()); // (18) C++26 template R, class Alloc> priority_queue(from_range_t, R&& rg, const Compare& x, - const Alloc& alloc); // (19) C++23 + const Alloc& alloc); // (19) C++23 +template R, class Alloc> +constexpr + priority_queue(from_range_t, R&& rg, + const Compare& x, + const Alloc& alloc); // (19) C++26 template R, class Alloc> priority_queue(from_range_t, R&& rg, - const Alloc& alloc); // (20) C++23 + const Alloc& alloc); // (20) C++23 +template R, class Alloc> +constexpr + priority_queue(from_range_t, R&& rg, + const Alloc& alloc); // (20) C++26 ``` * from_range_t[link ../../ranges/from_range_t.md] @@ -273,3 +362,4 @@ que5 : 5 4 3 2 1 ## 参照 - [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/queue/priority_queue/pop.md b/reference/queue/priority_queue/pop.md index 5312921514..537bff6aff 100644 --- a/reference/queue/priority_queue/pop.md +++ b/reference/queue/priority_queue/pop.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -void pop(); +void pop(); // (1) C++03 +constexpr void pop(); // (1) C++26 ``` ## 概要 @@ -55,3 +56,4 @@ int main() ``` ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/queue/priority_queue/push.md b/reference/queue/priority_queue/push.md index 22d1218015..1f9bd3c58e 100644 --- a/reference/queue/priority_queue/push.md +++ b/reference/queue/priority_queue/push.md @@ -5,8 +5,11 @@ * function[meta id-type] ```cpp -void push(const value_type& x); // (1) -void push(value_type&& x); // (2) C++11 +void push(const value_type& x); // (1) C++03 +constexpr void push(const value_type& x); // (1) C++26 + +void push(value_type&& x); // (2) C++11 +constexpr void push(value_type&& x); // (2) C++26 ``` ## 概要 @@ -76,3 +79,4 @@ int main() ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/queue/priority_queue/push_range.md b/reference/queue/priority_queue/push_range.md index 82e1291b95..e8f6b9ac0a 100644 --- a/reference/queue/priority_queue/push_range.md +++ b/reference/queue/priority_queue/push_range.md @@ -7,7 +7,9 @@ ```cpp template R> -void push_range(R&& rg); // C++23 +void push_range(R&& rg); // (1) C++23 +template R> +constexpr void push_range(R&& rg); // (1) C++26 ``` ## 概要 @@ -61,3 +63,7 @@ int main() | 名前 | 説明 | |-------------------|----------------| | [`push`](push.md) | 要素を追加する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/queue/priority_queue/size.md b/reference/queue/priority_queue/size.md index 08f8d1a8fe..0f56745d6b 100644 --- a/reference/queue/priority_queue/size.md +++ b/reference/queue/priority_queue/size.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -size_type size() const; +size_type size() const; // (1) C++03 +constexpr size_type size() const; // (1) C++26 ``` ## 概要 @@ -50,3 +51,4 @@ int main() ``` ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/queue/priority_queue/swap.md b/reference/queue/priority_queue/swap.md index 35f15b3d96..6d2b0279b3 100644 --- a/reference/queue/priority_queue/swap.md +++ b/reference/queue/priority_queue/swap.md @@ -7,7 +7,9 @@ ```cpp void swap(priority_queue& q) - noexcept(noexcept(swap(c, q.c)) && noexcept(swap(comp, q.comp))) + noexcept(noexcept(swap(c, q.c)) && noexcept(swap(comp, q.comp))); // (1) C++11 +constexpr void swap(priority_queue& q) + noexcept(noexcept(swap(c, q.c)) && noexcept(swap(comp, q.comp))); // (1) C++26 ``` ## 概要 @@ -87,3 +89,4 @@ int main () ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/queue/priority_queue/swap_free.md b/reference/queue/priority_queue/swap_free.md index 1bc31e0026..d45fa885cf 100644 --- a/reference/queue/priority_queue/swap_free.md +++ b/reference/queue/priority_queue/swap_free.md @@ -7,8 +7,15 @@ ```cpp namespace std { template - void swap(priority_queue& x, - priority_queue& y) noexcept(noexcept(x.swap(y))); + void + swap(priority_queue& x, + priority_queue& y) + noexcept(noexcept(x.swap(y))); // (1) C++11 + template + constexpr void + swap(priority_queue& x, + priority_queue& y) + noexcept(noexcept(x.swap(y))); // (1) C++26 } ``` * swap[link /reference/queue/priority_queue/swap.md] @@ -86,3 +93,4 @@ int main() ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/queue/priority_queue/top.md b/reference/queue/priority_queue/top.md index 99790ffd6d..2ebfcd5f12 100644 --- a/reference/queue/priority_queue/top.md +++ b/reference/queue/priority_queue/top.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -const_reference top() const; +const_reference top() const; // (1) C++03 +constexpr const_reference top() const; // (1) C++26 ``` ## 概要 @@ -53,3 +54,7 @@ int main() 3 1 ``` + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/queue/queue/back.md b/reference/queue/queue/back.md index 9315fb3106..b0aba97bbe 100644 --- a/reference/queue/queue/back.md +++ b/reference/queue/queue/back.md @@ -5,8 +5,11 @@ * function[meta id-type] ```cpp -value_type& back(); -const value_type& back() const; +value_type& back(); // (1) C++03 +constexpr value_type& back(); // (1) C++26 + +const value_type& back() const; // (2) C++03 +constexpr const value_type& back() const; // (2) C++26 ``` ## 概要 @@ -58,3 +61,7 @@ int main() { value_type& back() { return c.back(); } const value_type& back() const { return c.back(); } ``` + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/queue/queue/emplace.md b/reference/queue/queue/emplace.md index dca91c0adc..278ee81dae 100644 --- a/reference/queue/queue/emplace.md +++ b/reference/queue/queue/emplace.md @@ -7,10 +7,11 @@ ```cpp template -void emplace(Args&&... args); // C++14 まで - +void emplace(Args&&... args); // (1) C++11 +template +decltype(auto) emplace(Args&&... args); // (1) C++17 template -decltype(auto) emplace(Args&&... args); // C++17 から +constexpr decltype(auto) emplace(Args&&... args); // (1) C++26 ``` ## 概要 @@ -95,3 +96,4 @@ C++17 規格が発行された段階では戻り値型が `reference` に変更 - [P0084R1 Emplace Return Type (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0084r1.pdf) - [P0084R2 Emplace Return Type (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0084r2.pdf) - [LWG Issue 2783. stack::emplace() and queue::emplace() should return decltype(auto)](https://wg21.cmeerw.net/lwg/issue2783) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/queue/queue/empty.md b/reference/queue/queue/empty.md index 90681fd848..99f40da9ec 100644 --- a/reference/queue/queue/empty.md +++ b/reference/queue/queue/empty.md @@ -5,9 +5,9 @@ * function[meta id-type] ```cpp -bool empty() const; // C++03 -[[nodiscard]] bool empty() const; // C++20 -bool empty() const; // C++26 +bool empty() const; // (1) C++03 +[[nodiscard]] bool empty() const; // (1) C++20 +constexpr bool empty() const; // (1) C++26 ``` ## 概要 @@ -57,3 +57,4 @@ empty - C++20で`[[nodiscard]]`が付加された - [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) - C++26で`[[nodiscard]]`指定が削除された +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/queue/queue/front.md b/reference/queue/queue/front.md index fa6f83769f..4d1a8be3e1 100644 --- a/reference/queue/queue/front.md +++ b/reference/queue/queue/front.md @@ -5,8 +5,11 @@ * function[meta id-type] ```cpp -value_type& front(); -const value_type& front() const; +value_type& front(); // (1) C++03 +constexpr value_type& front(); // (1) C++26 + +const value_type& front() const; // (2) C++03 +constexpr const value_type& front() const; // (2) C++26 ``` ## 概要 @@ -65,3 +68,4 @@ const value_type& front() const { return c.front(); } ``` ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/queue/queue/op_compare_3way.md b/reference/queue/queue/op_compare_3way.md index 451160c784..16fb49f83d 100644 --- a/reference/queue/queue/op_compare_3way.md +++ b/reference/queue/queue/op_compare_3way.md @@ -10,6 +10,10 @@ namespace std { compare_three_way_result_t operator<=>(const queue& x, const queue& y); // (1) C++20 + template + constexpr compare_three_way_result_t + operator<=>(const queue& x, + const queue& y); // (1) C++26 } ``` @@ -62,3 +66,4 @@ int main () ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/queue/queue/op_constructor.md b/reference/queue/queue/op_constructor.md index 4596320db1..0bd75e6682 100644 --- a/reference/queue/queue/op_constructor.md +++ b/reference/queue/queue/op_constructor.md @@ -6,38 +6,66 @@ ```cpp // C++03まで -explicit queue(const Container& other = Container()); // (1), (2) +explicit queue(const Container& other = Container()); // (1), (2) C++03 // C++11以降 C++17まで -explicit queue(const Container& other); // (2) -explicit queue(Container&& other = Container()); // (1), (3) +explicit queue(const Container& other); // (2) C++11 +explicit queue(Container&& other = Container()); // (1), (3) C++11 // C++20以降 -queue() : queue(Container()) {} // (1) -explicit queue(const Container& other); // (2) -explicit queue(Container&& other); // (3) +queue() : queue(Container()) {} // (1) C++20 +constexpr queue() : queue(Container()) {} // (1) C++26 + +explicit queue(const Container& other); // (2) C++11 +constexpr explicit queue(const Container& other); // (2) C++26 + +explicit queue(Container&& other); // (3) C++20 +constexpr explicit queue(Container&& other); // (3) C++26 template -queue(InputIterator first, InputIterator last); // (4) C++23 +queue(InputIterator first, InputIterator last); // (4) C++23 +template +constexpr queue(InputIterator first, InputIterator last); // (4) C++26 + +template +explicit queue(const Alloc& alloc); // (5) C++11 +template +constexpr explicit queue(const Alloc& alloc); // (5) C++26 + +template +queue(const Container& other, const Alloc& alloc); // (6) C++11 +template +constexpr queue(const Container& other, const Alloc& alloc); // (6) C++26 template -explicit queue(const Alloc& alloc); // (5) C++11 +queue(Container&& other, const Alloc& alloc); // (7) C++11 +template +constexpr queue(Container&& other, const Alloc& alloc); // (7) C++26 + template -queue(const Container& other, const Alloc& alloc); // (6) C++11 +queue(const queue& que, const Alloc& alloc); // (8) C++11 template -queue(Container&& other, const Alloc& alloc); // (7) C++11 +constexpr queue(const queue& que, const Alloc& alloc); // (8) C++26 + template -queue(const queue& que, const Alloc& alloc); // (8) C++11 +queue(queue&& que, const Alloc& alloc); // (9) C++11 template -queue(queue&& que, const Alloc& alloc); // (9) C++11 +constexpr queue(queue&& que, const Alloc& alloc); // (9) C++26 template -queue(InputIterator first, InputIterator last, const Alloc&); // (10) C++23 +queue(InputIterator first, InputIterator last, const Alloc&); // (10) C++23 +template +constexpr queue(InputIterator first, InputIterator last, const Alloc&); // (10) C++26 template R> -queue(from_range_t, R&& rg); // (11) C++23 +queue(from_range_t, R&& rg); // (11) C++23 +template R> +constexpr queue(from_range_t, R&& rg); // (11) C++26 + +template R, class Alloc> +queue(from_range_t, R&& rg, const Alloc& alloc); // (12) C++23 template R, class Alloc> -queue(from_range_t, R&& rg, const Alloc& alloc); // (12) C++23 +constexpr queue(from_range_t, R&& rg, const Alloc& alloc); // (12) C++26 ``` * from_range_t[link ../../ranges/from_range_t.md] @@ -101,3 +129,4 @@ int main() { - C++20でのデフォルトコンストラクタの分離 - [P1425R4 Iterators pair constructors for stack and queue](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1425r4.pdf) - C++23でのイテレータペアへの対応 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/queue/queue/op_equal.md b/reference/queue/queue/op_equal.md index 2056579194..072c93c4e3 100644 --- a/reference/queue/queue/op_equal.md +++ b/reference/queue/queue/op_equal.md @@ -6,7 +6,9 @@ ```cpp namespace std { template - bool operator==(const queue& x, const queue& y); + bool operator==(const queue& x, const queue& y); // (1) C++03 + template + constexpr bool operator==(const queue& x, const queue& y); // (1) C++26 } ``` @@ -49,3 +51,4 @@ true ``` ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/queue/queue/op_greater.md b/reference/queue/queue/op_greater.md index cf0cd1466e..4b704ec338 100644 --- a/reference/queue/queue/op_greater.md +++ b/reference/queue/queue/op_greater.md @@ -6,7 +6,9 @@ ```cpp namespace std { template - bool operator>(const queue& x, const queue& y); + bool operator>(const queue& x, const queue& y); // (1) C++03 + template + constexpr bool operator>(const queue& x, const queue& y); // (1) C++26 } ``` @@ -49,3 +51,4 @@ true ``` ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/queue/queue/op_greater_equal.md b/reference/queue/queue/op_greater_equal.md index a5a2a50fd5..c35cf8f6ae 100644 --- a/reference/queue/queue/op_greater_equal.md +++ b/reference/queue/queue/op_greater_equal.md @@ -6,7 +6,9 @@ ```cpp namespace std { template - bool operator>=(const queue& x, const queue& y); + bool operator>=(const queue& x, const queue& y); // (1) C++03 + template + constexpr bool operator>=(const queue& x, const queue& y); // (1) C++26 } ``` @@ -49,3 +51,4 @@ true ``` ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/queue/queue/op_less.md b/reference/queue/queue/op_less.md index 522d326142..d39bdc132e 100644 --- a/reference/queue/queue/op_less.md +++ b/reference/queue/queue/op_less.md @@ -6,7 +6,9 @@ ```cpp namespace std { template - bool operator<(const queue& x, const queue& y); + bool operator<(const queue& x, const queue& y); // (1) C++03 + template + constexpr bool operator<(const queue& x, const queue& y); // (1) C++26 } ``` @@ -49,3 +51,4 @@ true ``` ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/queue/queue/op_less_equal.md b/reference/queue/queue/op_less_equal.md index 54511ec113..6312605206 100644 --- a/reference/queue/queue/op_less_equal.md +++ b/reference/queue/queue/op_less_equal.md @@ -6,7 +6,9 @@ ```cpp namespace std { template - bool operator<=(const queue& x, const queue& y); + bool operator<=(const queue& x, const queue& y); // (1) C++03 + template + constexpr bool operator<=(const queue& x, const queue& y); // (1) C++26 } ``` @@ -49,3 +51,4 @@ true ``` ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/queue/queue/op_not_equal.md b/reference/queue/queue/op_not_equal.md index 09a27c8631..8427a9825d 100644 --- a/reference/queue/queue/op_not_equal.md +++ b/reference/queue/queue/op_not_equal.md @@ -6,7 +6,9 @@ ```cpp namespace std { template - bool operator!=(const queue& x, const queue& y); + bool operator!=(const queue& x, const queue& y); // (1) C++03 + template + constexpr bool operator!=(const queue& x, const queue& y); // (1) C++26 } ``` @@ -55,3 +57,4 @@ true ``` ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/queue/queue/pop.md b/reference/queue/queue/pop.md index e05e95d995..7ca1e8efaa 100644 --- a/reference/queue/queue/pop.md +++ b/reference/queue/queue/pop.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -void pop(); +void pop(); // (1) C++03 +constexpr void pop(); // (1) C++26 ``` ## 概要 @@ -54,3 +55,4 @@ void pop() { c.pop_front(); } ``` ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/queue/queue/push.md b/reference/queue/queue/push.md index 87028e3be5..4dc3dcd087 100644 --- a/reference/queue/queue/push.md +++ b/reference/queue/queue/push.md @@ -5,8 +5,11 @@ * function[meta id-type] ```cpp -void push(const value_type& x); // (1) -void push(value_type&& x); // (2) C++11から +void push(const value_type& x); // (1) C++03 +constexpr void push(const value_type& x); // (1) C++26 + +void push(value_type&& x); // (2) C++11 +constexpr void push(value_type&& x); // (2) C++26 ``` ## 概要 @@ -60,3 +63,4 @@ int main() ``` ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/queue/queue/push_range.md b/reference/queue/queue/push_range.md index af2f2c29b2..1bdb07a573 100644 --- a/reference/queue/queue/push_range.md +++ b/reference/queue/queue/push_range.md @@ -7,7 +7,9 @@ ```cpp template R> -void push_range(R&& rg); // C++23 +void push_range(R&& rg); // (1) C++23 +template R> +constexpr void push_range(R&& rg); // (1) C++26 ``` ## 概要 @@ -63,3 +65,7 @@ int main() | 名前 | 説明 | |-------------------|----------------| | [`push`](push.md) | 要素を追加する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/queue/queue/size.md b/reference/queue/queue/size.md index 186894c5d4..e458b08a3d 100644 --- a/reference/queue/queue/size.md +++ b/reference/queue/queue/size.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -size_type size() const; +size_type size() const; // (1) C++03 +constexpr size_type size() const; // (1) C++26 ``` ## 概要 @@ -59,3 +60,4 @@ int main() { ``` ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/queue/queue/swap.md b/reference/queue/queue/swap.md index 0043f2af26..5c8db742ab 100644 --- a/reference/queue/queue/swap.md +++ b/reference/queue/queue/swap.md @@ -6,7 +6,12 @@ * cpp11[meta cpp] ```cpp -void swap(queue& q) noexcept(noexcept(swap(c, q.c))) +void + swap(queue& q) + noexcept(noexcept(swap(c, q.c))); // (1) C++11 +constexpr void + swap(queue& q) + noexcept(noexcept(swap(c, q.c))); // (1) C++26 ``` ## 概要 @@ -82,3 +87,4 @@ int main () ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/queue/queue/swap_free.md b/reference/queue/queue/swap_free.md index 01d5fcdd3b..93beabd144 100644 --- a/reference/queue/queue/swap_free.md +++ b/reference/queue/queue/swap_free.md @@ -7,7 +7,15 @@ ```cpp namespace std { template - void swap(queue& x, queue& y) noexcept(noexcept(x.swap(y))); + void + swap(queue& x, + queue& y) + noexcept(noexcept(x.swap(y))); // (1) C++11 + template + constexpr void + swap(queue& x, + queue& y) + noexcept(noexcept(x.swap(y))); // (1) C++26 } ``` @@ -84,3 +92,4 @@ int main () ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/begin.md b/reference/set/multiset/begin.md index 721a5a9069..724d49129f 100644 --- a/reference/set/multiset/begin.md +++ b/reference/set/multiset/begin.md @@ -5,11 +5,13 @@ * function[meta id-type] ```cpp -iterator begin(); // (1) C++03 -iterator begin() noexcept; // (1) C++11 +iterator begin(); // (1) C++03 +iterator begin() noexcept; // (1) C++11 +constexpr iterator begin() noexcept; // (1) C++26 -const_iterator begin() const; // (2) C++03 -const_iterator begin() const noexcept; // (2) C++11 +const_iterator begin() const; // (2) C++03 +const_iterator begin() const noexcept; // (2) C++11 +constexpr const_iterator begin() const noexcept; // (2) C++26 ``` @@ -73,3 +75,7 @@ int main() | [`multiset::end`](end.md) | 末尾の次を指すイテレータを取得する | | [`multiset::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | | [`multiset::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/cbegin.md b/reference/set/multiset/cbegin.md index c6a3d9ed4c..87bc000a8b 100644 --- a/reference/set/multiset/cbegin.md +++ b/reference/set/multiset/cbegin.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_iterator cbegin() const noexcept; +const_iterator cbegin() const noexcept; // (1) C++11 +constexpr const_iterator cbegin() const noexcept; // (1) C++26 ``` @@ -55,3 +56,7 @@ int main() | [`multiset::cend`](cend.md) | 末尾の次を指す読み取り専用イテレータを取得する | | [`multuset::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | | [`multiset::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/cend.md b/reference/set/multiset/cend.md index 9a68f756cf..d21e815307 100644 --- a/reference/set/multiset/cend.md +++ b/reference/set/multiset/cend.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_iterator cend() const noexcept; +const_iterator cend() const noexcept; // (1) C++11 +constexpr const_iterator cend() const noexcept; // (1) C++26 ``` ## 概要 @@ -60,3 +61,7 @@ int main() | [`cbegin`](cbegin.md) | 先頭を指す読み取り専用イテレータを取得する | | [`rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | | [`rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/clear.md b/reference/set/multiset/clear.md index b807fe3747..f4d30308bd 100644 --- a/reference/set/multiset/clear.md +++ b/reference/set/multiset/clear.md @@ -5,8 +5,9 @@ * function[meta id-type] ```cpp -void clear(); // C++03 -void clear() noexcept; // C++11 +void clear(); // (1) C++03 +void clear() noexcept; // (1) C++11 +constexpr void clear() noexcept; // (1) C++26 ``` ## 概要 @@ -57,3 +58,7 @@ int main () | [`erase`](erase.md) | 要素を削除する | | [`size`](size.md) | 要素数を取得する | | [`empty`](empty.md) | コンテナが空であるかどうかを調べる | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/contains.md b/reference/set/multiset/contains.md index 182a5dbedc..1435322404 100644 --- a/reference/set/multiset/contains.md +++ b/reference/set/multiset/contains.md @@ -6,10 +6,13 @@ * cpp20[meta cpp] ```cpp -bool contains(const key_type& x) const; // (1) +bool contains(const key_type& x) const; // (1) C++20 +constexpr bool contains(const key_type& x) const; // (1) C++26 template -bool contains(const K& x) const; // (2) +bool contains(const K& x) const; // (2) C++20 +template +constexpr bool contains(const K& x) const; // (2) C++26 ``` @@ -71,3 +74,4 @@ contain ## 参照 - [P0458R2 Checking for Existence of an Element in Associative Containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0458r2.html) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/count.md b/reference/set/multiset/count.md index 7490ba2743..45237a9e4c 100644 --- a/reference/set/multiset/count.md +++ b/reference/set/multiset/count.md @@ -5,10 +5,13 @@ * function[meta id-type] ```cpp -size_type count(const key_type& x) const; // (1) +size_type count(const key_type& x) const; // (1) C++03 +constexpr size_type count(const key_type& x) const; // (1) C++26 template -size_type count(const K& x) const; // (2) C++14 +size_type count(const K& x) const; // (2) C++14 +template +constexpr size_type count(const K& x) const; // (2) C++26 ``` ## 概要 @@ -84,3 +87,4 @@ int main() ## 参照 - [N3657 Adding heterogeneous comparison lookup to associative containers (rev 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3657.htm) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/crbegin.md b/reference/set/multiset/crbegin.md index 2d84f21464..a95778900f 100644 --- a/reference/set/multiset/crbegin.md +++ b/reference/set/multiset/crbegin.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_reverse_iterator crbegin() const noexcept; +const_reverse_iterator crbegin() const noexcept; // (1) C++11 +constexpr const_reverse_iterator crbegin() const noexcept; // (1) C++26 ``` @@ -57,3 +58,7 @@ int main() | [`crend`](crend.md) | 先頭の前を指す読み取り専用逆イテレータを取得する | | [`cbegin`](cbegin.md) | 先頭を指す読み取り専用イテレータを取得する | | [`cend`](cend.md) | 末尾の次を指す読み取り専用イテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/crend.md b/reference/set/multiset/crend.md index 1753fc0250..e8060b82ae 100644 --- a/reference/set/multiset/crend.md +++ b/reference/set/multiset/crend.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_reverse_iterator crend() const noexcept; +const_reverse_iterator crend() const noexcept; // (1) C++11 +constexpr const_reverse_iterator crend() const noexcept; // (1) C++26 ``` @@ -53,3 +54,7 @@ int main() | [`crbegin`](crbegin.md) | 末尾を指す読み取り専用逆イテレータを返す | | [`cbegin`](cbegin.md) | 先頭を指す読み取り専用イテレータを返す | | [`cend`](cend.md) | 末尾の次を指す読み取り専用イテレータを返す | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/emplace.md b/reference/set/multiset/emplace.md index 843f574a56..f88abca766 100644 --- a/reference/set/multiset/emplace.md +++ b/reference/set/multiset/emplace.md @@ -7,7 +7,11 @@ ```cpp template -pair emplace(Args&&... args); +pair + emplace(Args&&... args); // (1) C++11 +template +constexpr pair + emplace(Args&&... args); // (1) C++26 ``` ## 概要 @@ -81,3 +85,4 @@ int main() ## 参照 - [N2680 Proposed Wording for Placement Insert (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2680.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/emplace_hint.md b/reference/set/multiset/emplace_hint.md index 10ba5f7b91..cda575694f 100644 --- a/reference/set/multiset/emplace_hint.md +++ b/reference/set/multiset/emplace_hint.md @@ -7,7 +7,9 @@ ```cpp template -iterator emplace_hint(const_iterator hint, Args&&... args); +iterator emplace_hint(const_iterator hint, Args&&... args); // (1) C++11 +template +constexpr iterator emplace_hint(const_iterator hint, Args&&... args); // (1) C++26 ``` ## 概要 @@ -87,3 +89,4 @@ int main() ## 参照 - [N2680 Proposed Wording for Placement Insert (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2680.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/empty.md b/reference/set/multiset/empty.md index 6460abf3a4..8a2ea12251 100644 --- a/reference/set/multiset/empty.md +++ b/reference/set/multiset/empty.md @@ -5,10 +5,10 @@ * function[meta id-type] ```cpp -bool empty() const; // C++03 -bool empty() const noexcept; // C++11 -[[nodiscard]] bool empty() const noexcept; // C++20 -bool empty() const noexcept; // C++26 +bool empty() const; // (1) C++03 +bool empty() const noexcept; // (1) C++11 +[[nodiscard]] bool empty() const noexcept; // (1) C++20 +constexpr bool empty() const noexcept; // (1) C++26 ``` ## 概要 @@ -64,3 +64,4 @@ int main () - C++20で`[[nodiscard]]`が付加された - [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) - C++26で`[[nodiscard]]`指定が削除された +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/end.md b/reference/set/multiset/end.md index 8b1f2daa2f..90e156ef28 100644 --- a/reference/set/multiset/end.md +++ b/reference/set/multiset/end.md @@ -5,11 +5,13 @@ * function[meta id-type] ```cpp -iterator end(); // (1) C++03 -iterator end() noexcept; // (1) C++11 +iterator end(); // (1) C++03 +iterator end() noexcept; // (1) C++11 +constexpr iterator end() noexcept; // (1) C++26 -const_iterator end() const; // (2) C++03 -const_iterator end() const noexcept; // (2) C++11 +const_iterator end() const; // (2) C++03 +const_iterator end() const noexcept; // (2) C++11 +constexpr const_iterator end() const noexcept; // (2) C++26 ``` ## 概要 @@ -74,3 +76,7 @@ int main() | [`begin`](begin.md) | 先頭を指すイテレータを取得する | | [`rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | | [`rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/equal_range.md b/reference/set/multiset/equal_range.md index a3a9119898..c70cd08c75 100644 --- a/reference/set/multiset/equal_range.md +++ b/reference/set/multiset/equal_range.md @@ -5,17 +5,29 @@ * function[meta id-type] ```cpp -pair equal_range(const key_type& x); // (1) +pair + equal_range(const key_type& x); // (1) C++03 +constexpr pair + equal_range(const key_type& x); // (1) C++26 template -pair equal_range(const K& x); // (2) C++14 +pair + equal_range(const K& x); // (2) C++14 +template +constexpr pair + equal_range(const K& x); // (2) C++26 pair - equal_range(const key_type& x) const; // (3) + equal_range(const key_type& x) const; // (3) C++03 +constexpr pair + equal_range(const key_type& x) const; // (3) C++26 template pair - equal_range(const K& x) const; // (4) C++14 + equal_range(const K& x) const; // (4) C++14 +template +constexpr pair + equal_range(const K& x) const; // (4) C++26 ``` ## 概要 @@ -77,3 +89,4 @@ B ## 参照 - [N3657 Adding heterogeneous comparison lookup to associative containers (rev 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3657.htm) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/erase.md b/reference/set/multiset/erase.md index f31a7564f3..6c2d3dd001 100644 --- a/reference/set/multiset/erase.md +++ b/reference/set/multiset/erase.md @@ -5,18 +5,24 @@ * function[meta id-type] ```cpp -void erase(iterator position); // (1) C++03 (C++11で一旦削除) -iterator erase(iterator position); // (1) C++17 +void erase(iterator position); // (1) C++03 (C++11で一旦削除) +iterator erase(iterator position); // (1) C++17 +constexpr iterator erase(iterator position); // (1) C++26 -iterator erase(const_iterator position); // (2) C++11 +iterator erase(const_iterator position); // (2) C++11 +constexpr iterator erase(const_iterator position); // (2) C++26 -size_type erase(const key_type& x); // (3) C++03 +size_type erase(const key_type& x); // (3) C++03 +constexpr size_type erase(const key_type& x); // (3) C++26 template -size_type erase(K&& x); // (4) C++23 +size_type erase(K&& x); // (4) C++23 +template +constexpr size_type erase(K&& x); // (4) C++26 -void erase(iterator first, iterator last); // (5) C++03 -iterator erase(const_iterator first, const_iterator last); // (5) C++11 +void erase(iterator first, iterator last); // (5) C++03 +iterator erase(const_iterator first, const_iterator last); // (5) C++11 +constexpr iterator erase(const_iterator first, const_iterator last); // (5) C++26 ``` @@ -172,3 +178,4 @@ int main() - C++17で、`erase(iterator)`を再追加 - [P2077R3 Heterogeneous erasure overloads for associative containers](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2077r3.html) - C++23で、`template erase(K&& x)`のオーバーロードが追加された +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/erase_if_free.md b/reference/set/multiset/erase_if_free.md index 6d846ca1e9..35aa3ef1d4 100644 --- a/reference/set/multiset/erase_if_free.md +++ b/reference/set/multiset/erase_if_free.md @@ -8,7 +8,10 @@ namespace std { template typename multiset::size_type - erase_if(multiset& c, Predicate pred); + erase_if(multiset& c, Predicate pred); // (1) C++20 + template + constexpr typename multiset::size_type + erase_if(multiset& c, Predicate pred); // (1) C++26 } ``` @@ -78,3 +81,4 @@ int main() ## 参照 - [P1209R0 Adopt consistent container erasure from Library Fundamentals 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1209r0.html) - [R1115R3 Improving the Return Value of Erase-Like Algorithms II: Free `erase`/`erase_if`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1115r3.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/extract.md b/reference/set/multiset/extract.md index 35a130f573..423597c341 100644 --- a/reference/set/multiset/extract.md +++ b/reference/set/multiset/extract.md @@ -6,12 +6,16 @@ * cpp17[meta cpp] ```cpp -node_type extract(const_iterator position); // (1) C++17 +node_type extract(const_iterator position); // (1) C++17 +constexpr node_type extract(const_iterator position); // (1) C++26 -node_type extract(const key_type& x); // (2) C++17 +node_type extract(const key_type& x); // (2) C++17 +constexpr node_type extract(const key_type& x); // (2) C++26 template -node_type extract(K&& x); // (3) C++23 +node_type extract(K&& x); // (3) C++23 +template +constexpr node_type extract(K&& x); // (3) C++26 ``` ## 概要 @@ -142,3 +146,4 @@ s2 = { 1, 2 } - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) - [P2077R3 Heterogeneous erasure overloads for associative containers](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2077r3.html) - C++23で、`template extract(K&& x)`のオーバーロードが追加された +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/find.md b/reference/set/multiset/find.md index ae74d6658f..78d8b28a2d 100644 --- a/reference/set/multiset/find.md +++ b/reference/set/multiset/find.md @@ -5,15 +5,21 @@ * function[meta id-type] ```cpp -iterator find(const key_type& x); // (1) +iterator find(const key_type& x); // (1) C++03 +constexpr iterator find(const key_type& x); // (1) C++26 template -iterator find(const K& x); // (2) C++14 +iterator find(const K& x); // (2) C++14 +template +constexpr iterator find(const K& x); // (2) C++26 -const_iterator find(const key_type& x) const; // (3) +const_iterator find(const key_type& x) const; // (3) C++03 +constexpr const_iterator find(const key_type& x) const; // (3) C++26 template -const_iterator find(const K& x) const; // (4) C++14 +const_iterator find(const K& x) const; // (4) C++14 +template +constexpr const_iterator find(const K& x) const; // (4) C++26 ``` ## 概要 @@ -95,3 +101,4 @@ Bob ## 参照 - [N3657 Adding heterogeneous comparison lookup to associative containers (rev 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3657.htm) - [LWG Issue 2299. [CD] Effects of inaccessible `key_compare::is_transparent` type are not clear](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2299) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/get_allocator.md b/reference/set/multiset/get_allocator.md index b8bb6a1c06..9d8b4f4a67 100644 --- a/reference/set/multiset/get_allocator.md +++ b/reference/set/multiset/get_allocator.md @@ -5,8 +5,9 @@ * function[meta id-type] ```cpp -allocator_type get_allocator() const; // C++03 -allocator_type get_allocator() const noexcept; // C++11 +allocator_type get_allocator() const; // (1) C++03 +allocator_type get_allocator() const noexcept; // (1) C++11 +constexpr allocator_type get_allocator() const noexcept; // (1) C++26 ``` ## 概要 @@ -66,3 +67,7 @@ int main() - [Visual C++](/implementation.md#visual_cpp): 2002 [mark verified], 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - 2012, 2013は、`noexcept`が実装されていないため、`throw()`が修飾されている。 - 2015からは、`noexcept`が修飾されている。 + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/insert.md b/reference/set/multiset/insert.md index 0a45de240a..0b3a64a8fa 100644 --- a/reference/set/multiset/insert.md +++ b/reference/set/multiset/insert.md @@ -5,21 +5,32 @@ * function[meta id-type] ```cpp -iterator insert(const value_type& x); // (1) -iterator insert(value_type&& y); // (2) C++11 +iterator insert(const value_type& x); // (1) C++03 +constexpr iterator insert(const value_type& x); // (1) C++26 -iterator insert(iterator position, const value_type& x); // (3) C++03 -iterator insert(const_iterator position, const value_type& x); // (3) C++11 +iterator insert(value_type&& y); // (2) C++11 +constexpr iterator insert(value_type&& y); // (2) C++26 -iterator insert(const_iterator position, value_type&& y); // (4) C++11 +iterator insert(iterator position, const value_type& x); // (3) C++03 +iterator insert(const_iterator position, const value_type& x); // (3) C++11 +constexpr iterator insert(const_iterator position, const value_type& x); // (3) C++26 +iterator insert(const_iterator position, value_type&& y); // (4) C++11 +constexpr iterator insert(const_iterator position, value_type&& y); // (4) C++26 + +template +void insert(InputIterator first, InputIterator last); // (5) C++03 template -void insert(InputIterator first, InputIterator last); // (5) +constexpr void insert(InputIterator first, InputIterator last); // (5) C++26 + +void insert(initializer_list init); // (6) C++03 +constexpr void insert(initializer_list init); // (6) C++26 -void insert(initializer_list init); // (6) +iterator insert(node_type&& nh); // (7) C++17 +constexpr iterator insert(node_type&& nh); // (7) C++26 -iterator insert(node_type&& nh); // (7) C++17 -iterator insert(const_iterator hint, node_type&& nh); // (8) C++17 +iterator insert(const_iterator hint, node_type&& nh); // (8) C++17 +constexpr iterator insert(const_iterator hint, node_type&& nh); // (8) C++26 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -107,3 +118,4 @@ int main () - [N2679 Initializer Lists for Standard Containers(Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2679.pdf) - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) - (7), (8)経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/insert_range.md b/reference/set/multiset/insert_range.md index cb78279fc9..bddc6a2adf 100644 --- a/reference/set/multiset/insert_range.md +++ b/reference/set/multiset/insert_range.md @@ -7,7 +7,9 @@ ```cpp template R> -void insert_range(R&& rg); // C++23 +void insert_range(R&& rg); // (1) C++23 +template R> +constexpr void insert_range(R&& rg); // (1) C++26 ``` ## 概要 @@ -63,3 +65,7 @@ int main () | 名前 | 説明 | |----------------------------|------------------------| | [`insert`](insert.md) | 要素を挿入する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/key_comp.md b/reference/set/multiset/key_comp.md index 6daa1ac789..77b244f615 100644 --- a/reference/set/multiset/key_comp.md +++ b/reference/set/multiset/key_comp.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -key_compare key_comp() const; +key_compare key_comp() const; // (1) C++03 +constexpr key_compare key_comp() const; // (1) C++26 ``` ## 概要 @@ -53,3 +54,7 @@ int main() | [`count`](count.md) | 指定したキーにマッチする要素の数を返す | | [`lower_bound`](lower_bound.md) | 与えられた値より小さく無い最初の要素へのイテレータを返す | | [`upper_bound`](upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/lower_bound.md b/reference/set/multiset/lower_bound.md index 04cd499954..b20442781e 100644 --- a/reference/set/multiset/lower_bound.md +++ b/reference/set/multiset/lower_bound.md @@ -5,15 +5,21 @@ * function[meta id-type] ```cpp -iterator lower_bound(const key_type& x); // (1) +iterator lower_bound(const key_type& x); // (1) C++03 +constexpr iterator lower_bound(const key_type& x); // (1) C++26 template -iterator lower_bound(const K& x); // (2) C++14 +iterator lower_bound(const K& x); // (2) C++14 +template +constexpr iterator lower_bound(const K& x); // (2) C++26 -const_iterator lower_bound(const key_type& x) const; // (3) +const_iterator lower_bound(const key_type& x) const; // (3) C++03 +constexpr const_iterator lower_bound(const key_type& x) const; // (3) C++26 template -const_iterator lower_bound(const K& x) const; // (4) C++14 +const_iterator lower_bound(const K& x) const; // (4) C++14 +template +constexpr const_iterator lower_bound(const K& x) const; // (4) C++26 ``` ## 概要 @@ -109,3 +115,4 @@ D ## 参照 - [N3657 Adding heterogeneous comparison lookup to associative containers (rev 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3657.htm) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/max_size.md b/reference/set/multiset/max_size.md index 3ebef31dbe..402180e38f 100644 --- a/reference/set/multiset/max_size.md +++ b/reference/set/multiset/max_size.md @@ -5,8 +5,9 @@ * function[meta id-type] ```cpp -size_type max_size() const; // C++03 -size_type max_size() const noexcept; // C++11 +size_type max_size() const; // (1) C++03 +size_type max_size() const noexcept; // (1) C++11 +constexpr size_type max_size() const noexcept; // (1) C++26 ``` ## 概要 @@ -47,3 +48,7 @@ int main () | 名前 | 説明 | |---------------------|------------------| | [`size`](size.md) | 要素数を取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/merge.md b/reference/set/multiset/merge.md index 6ed8b10eda..22ecc29ad4 100644 --- a/reference/set/multiset/merge.md +++ b/reference/set/multiset/merge.md @@ -7,13 +7,24 @@ ```cpp template - void merge(set& source); // (1) +void merge(set& source); // (1) C++17 template - void merge(set&& source); // (2) +constexpr void merge(set& source); // (1) C++26 + +template +void merge(set&& source); // (2) C++17 +template +constexpr void merge(set&& source); // (2) C++26 + +template +void merge(multiset& source); // (3) C++17 +template +constexpr void merge(multiset& source); // (3) C++26 + template - void merge(multiset& source); // (3) +void merge(multiset&& source); // (4) C++17 template - void merge(multiset&& source); // (4) +constexpr void merge(multiset&& source); // (4) C++26 ``` ## 概要 @@ -91,3 +102,4 @@ s2 = { 10, 10, 20, 30 } ## 参照 - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/op_assign.md b/reference/set/multiset/op_assign.md index f96d890248..14c7335d72 100644 --- a/reference/set/multiset/op_assign.md +++ b/reference/set/multiset/op_assign.md @@ -5,12 +5,19 @@ * function[meta id-type] ```cpp -multiset& operator=(const multiset& x); // (1) C++03 -multiset& operator=(multiset&& x); // (2) C++11 +multiset& operator=(const multiset& x); // (1) C++03 +constexpr multiset& operator=(const multiset& x); // (1) C++26 + +multiset& operator=(multiset&& x); // (2) C++11 multiset& operator=(multiset&& x) noexcept(allocator_traits::is_always_equal::value - && is_nothrow_move_assignable::value); // (2) C++17 -multiset& operator=(initializer_list init); // (3) C++11 + && is_nothrow_move_assignable::value); // (2) C++17 +constexpr multiset& operator=(multiset&& x) + noexcept(allocator_traits::is_always_equal::value + && is_nothrow_move_assignable::value); // (2) C++26 + +multiset& operator=(initializer_list init); // (3) C++11 +constexpr multiset& operator=(initializer_list init); // (3) C++26 ``` * initializer_list[link ../../initializer_list.md] @@ -82,3 +89,4 @@ Size of c2: 7 - [N2679 Initializer Lists for Standard Containers(Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2679.pdf) - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) - `noexcept` 追加の経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/op_compare_3way.md b/reference/set/multiset/op_compare_3way.md index 2539024862..749ba4b357 100644 --- a/reference/set/multiset/op_compare_3way.md +++ b/reference/set/multiset/op_compare_3way.md @@ -10,6 +10,10 @@ namespace std { synth-three-way-result operator<=>(const multiset& x, const multiset& y); // (1) C++20 + template + constexpr synth-three-way-result + operator<=>(const multiset& x, + const multiset& y); // (1) C++26 } ``` @@ -75,3 +79,4 @@ int main() ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/op_constructor.md b/reference/set/multiset/op_constructor.md index 5f80bb239d..4bd0757ab4 100644 --- a/reference/set/multiset/op_constructor.md +++ b/reference/set/multiset/op_constructor.md @@ -5,51 +5,101 @@ * function[meta id-type] ```cpp -multiset(); // (1) C++14 +multiset(); // (1) C++14 +constexpr multiset(); // (1) C++26 -explicit multiset(const Compare& comp, - const Allocator& = Allocator()); // (2) C++14 +explicit + multiset(const Compare& comp, + const Allocator& = Allocator()); // (2) C++14 +constexpr explicit + multiset(const Compare& comp, + const Allocator& = Allocator()); // (2) C++26 explicit multiset(const Compare& comp = Compare(), - const Allocator& alloc = Allocator()); // (1) + (2) C++03 + const Allocator& alloc = Allocator()); // (1) + (2) C++03 -explicit multiset(const Allocator& alloc); // (3) C++11 +explicit multiset(const Allocator& alloc); // (3) C++11 +constexpr explicit multiset(const Allocator& alloc); // (3) C++26 template -multiset(InputIterator first, InputIterator last, - const Compare& comp = Compare(), - const Allocator& alloc = Allocator()); // (4) C++03 +multiset(InputIterator first, + InputIterator last, + const Compare& comp = Compare(), + const Allocator& alloc = Allocator()); // (4) C++03 +template +constexpr + multiset(InputIterator first, + InputIterator last, + const Compare& comp = Compare(), + const Allocator& alloc = Allocator()); // (4) C++26 template -multiset(InputIterator first, InputIterator last, - const Allocator& a); // (5) C++14 +multiset(InputIterator first, + InputIterator last, + const Allocator& a); // (5) C++14 +template +constexpr + multiset(InputIterator first, + InputIterator last, + const Allocator& a); // (5) C++26 + +multiset(const set& x); // (6) C++03 +constexpr multiset(const set& x); // (6) C++26 -multiset(const set& x); // (6) C++03 -multiset(set&& y); // (7) C++11 +multiset(set&& y); // (7) C++11 +constexpr multiset(set&& y); // (7) C++26 -multiset(const multiset& x, const Allocator& alloc); // (8) C++11 multiset(const multiset& x, - const type_identity_t& alloc); // (8) C++23 + const Allocator& alloc); // (8) C++11 +multiset(const multiset& x, + const type_identity_t& alloc); // (8) C++23 +constexpr + multiset(const multiset& x, + const type_identity_t& alloc); // (8) C++26 -multiset(multiset&& y, const Allocator& alloc); // (9) C++11 multiset(multiset&& y, - const type_identity_t& alloc); // (9) C++23 + const Allocator& alloc); // (9) C++11 +multiset(multiset&& y, + const type_identity_t& alloc); // (9) C++23 +constexpr + multiset(multiset&& y, + const type_identity_t& alloc); // (9) C++26 multiset(initializer_list init, const Compare& comp = Compare(), - const Allocator& alloc = Allocator()); // (10) C++11 + const Allocator& alloc = Allocator()); // (10) C++11 +constexpr + multiset(initializer_list init, + const Compare& comp = Compare(), + const Allocator& alloc = Allocator()); // (10) C++26 multiset(initializer_list init, - const Allocator& a); // (11) C++14 + const Allocator& a); // (11) C++14 +constexpr + multiset(initializer_list init, + const Allocator& a); // (11) C++26 template R> -multiset(from_range_t, R&& rg, +multiset(from_range_t, + R&& rg, const Compare& comp = Compare(), - const Allocator& alloc = Allocator()); // (12) C++23 + const Allocator& alloc = Allocator()); // (12) C++23 +template R> +constexpr + multiset(from_range_t, + R&& rg, + const Compare& comp = Compare(), + const Allocator& alloc = Allocator()); // (12) C++26 template R> -multiset(from_range_t, R&& rg, - const Allocator& alloc); // (13) C++23 +multiset(from_range_t, + R&& rg, + const Allocator& alloc); // (13) C++23 +template R> +constexpr + multiset(from_range_t, + R&& rg, + const Allocator& alloc); // (13) C++26 ``` * type_identity_t[link /reference/type_traits/type_identity.md] * initializer_list[link ../../initializer_list.md] @@ -164,3 +214,4 @@ Size of c2: 7 なお、Discussion の例はアロケータの型が誤っているので注意 - [P1518R2 Stop Overconstraining Allocators in Container Deduction Guides](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1518r2.html) - C++23でのアロケータ引数を`type_identity_t`で包む変更 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/op_destructor.md b/reference/set/multiset/op_destructor.md index 937fe5b028..ad253220e7 100644 --- a/reference/set/multiset/op_destructor.md +++ b/reference/set/multiset/op_destructor.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -~multiset(); +~multiset(); // (1) C++03 +constexpr ~multiset(); // (1) C++26 ``` ## 概要 @@ -14,3 +15,7 @@ ## 計算量 [`size()`](size.md) に対して線形時間(デストラクタ呼び出し) + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/op_equal.md b/reference/set/multiset/op_equal.md index 1c3cc1ac2e..08e61d52b5 100644 --- a/reference/set/multiset/op_equal.md +++ b/reference/set/multiset/op_equal.md @@ -9,6 +9,10 @@ namespace std { bool operator==(const multiset& x, const multiset& y); // (1) C++03 + template + constexpr bool + operator==(const multiset& x, + const multiset& y); // (1) C++26 } ``` @@ -65,3 +69,4 @@ int main() - C++14から、2つ目のイテレータ範囲のendイテレータをとる`equal()`アルゴリズムを使用するようになった。 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/op_greater.md b/reference/set/multiset/op_greater.md index de9241d4fe..72892c9105 100644 --- a/reference/set/multiset/op_greater.md +++ b/reference/set/multiset/op_greater.md @@ -10,6 +10,10 @@ namespace std { bool operator>(const multiset& x, const multiset& y); // (1) C++03 + template + constexpr bool + operator>(const multiset& x, + const multiset& y); // (1) C++26 } ``` @@ -63,3 +67,4 @@ int main() ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/op_greater_equal.md b/reference/set/multiset/op_greater_equal.md index 006133c7c5..0c3a01313b 100644 --- a/reference/set/multiset/op_greater_equal.md +++ b/reference/set/multiset/op_greater_equal.md @@ -10,6 +10,10 @@ namespace std { bool operator>=(const multiset& x, const multiset& y); // (1) C++03 + template + constexpr bool + operator>=(const multiset& x, + const multiset& y); // (1) C++26 } ``` @@ -63,3 +67,4 @@ int main() ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/op_less.md b/reference/set/multiset/op_less.md index 8daa1cb93a..a801e00965 100644 --- a/reference/set/multiset/op_less.md +++ b/reference/set/multiset/op_less.md @@ -10,6 +10,10 @@ namespace std { bool operator<(const multiset& x, const multiset& y); // (1) C++03 + template + constexpr bool + operator<(const multiset& x, + const multiset& y); // (1) C++26 } ``` @@ -61,3 +65,4 @@ true ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/op_less_equal.md b/reference/set/multiset/op_less_equal.md index 971590d3f0..66e2e4409d 100644 --- a/reference/set/multiset/op_less_equal.md +++ b/reference/set/multiset/op_less_equal.md @@ -10,6 +10,10 @@ namespace std { bool operator<=(const multiset& x, const multiset& y); // (1) C++03 + template + constexpr bool + operator<=(const multiset& x, + const multiset& y); // (1) C++26 } ``` @@ -63,3 +67,4 @@ int main() ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/op_not_equal.md b/reference/set/multiset/op_not_equal.md index a6fced7871..061d79251f 100644 --- a/reference/set/multiset/op_not_equal.md +++ b/reference/set/multiset/op_not_equal.md @@ -10,6 +10,10 @@ namespace std { bool operator!=(const multiset& x, const multiset& y); // (1) C++03 + template + constexpr bool + operator!=(const multiset& x, + const multiset& y); // (1) C++26 } ``` @@ -63,3 +67,4 @@ int main() ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/rbegin.md b/reference/set/multiset/rbegin.md index 4b4c0d932e..1d4eece4c6 100644 --- a/reference/set/multiset/rbegin.md +++ b/reference/set/multiset/rbegin.md @@ -5,11 +5,13 @@ * function[meta id-type] ```cpp -reverse_iterator rbegin(); // (1) C++03 -reverse_iterator rbegin() noexcept; // (1) C++11 +reverse_iterator rbegin(); // (1) C++03 +reverse_iterator rbegin() noexcept; // (1) C++11 +constexpr reverse_iterator rbegin() noexcept; // (1) C++26 -const_reverse_iterator rbegin() const; // (2) C++03 -const_reverse_iterator rbegin() const noexcept; // (2) C++11 +const_reverse_iterator rbegin() const; // (2) C++03 +const_reverse_iterator rbegin() const noexcept; // (2) C++11 +constexpr const_reverse_iterator rbegin() const noexcept; // (2) C++26 ``` @@ -69,3 +71,7 @@ int main() | [`rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`begin`](begin.md) | 先頭を指すイテレータを取得する | | [`end`](end.md) | 末尾の次を指すイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/rend.md b/reference/set/multiset/rend.md index ad243ceb78..95f9e44656 100644 --- a/reference/set/multiset/rend.md +++ b/reference/set/multiset/rend.md @@ -5,11 +5,13 @@ * function[meta id-type] ```cpp -reverse_iterator rend(); // (1) C++03 -reverse_iterator rend() noexcept; // (1) C++11 +reverse_iterator rend(); // (1) C++03 +reverse_iterator rend() noexcept; // (1) C++11 +constexpr reverse_iterator rend() noexcept; // (1) C++26 -const_reverse_iterator rend() const; // (2) C++03 -const_reverse_iterator rend() const noexcept; // (2) C++11 +const_reverse_iterator rend() const; // (2) C++03 +const_reverse_iterator rend() const noexcept; // (2) C++11 +constexpr const_reverse_iterator rend() const noexcept; // (2) C++26 ``` @@ -63,3 +65,7 @@ int main() | [`rbegin`](rbegin.md) | 末尾を指す逆イテレータを返す | | [`begin`](begin.md) | 先頭を指すイテレータを返す | | [`end`](end.md) | 末尾の次を指すイテレータを返す | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/size.md b/reference/set/multiset/size.md index 4c3061b138..bfdc00eeb0 100644 --- a/reference/set/multiset/size.md +++ b/reference/set/multiset/size.md @@ -5,8 +5,9 @@ * function[meta id-type] ```cpp -size_type size() const; // C++03 -size_type size() const noexcept; // C++11 +size_type size() const; // (1) C++03 +size_type size() const noexcept; // (1) C++11 +constexpr size_type size() const noexcept; // (1) C++26 ``` ## 概要 @@ -56,3 +57,7 @@ int main () |-----------------------------|------------------------------------| | [`max_size`](max_size.md) | 格納可能な最大の要素数を取得する | | [`empty`](empty.md) | コンテナが空であるかどうかを調べる | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/swap.md b/reference/set/multiset/swap.md index 3269c8b413..50f640178d 100644 --- a/reference/set/multiset/swap.md +++ b/reference/set/multiset/swap.md @@ -5,10 +5,13 @@ * function[meta id-type] ```cpp -void swap(multiset& st); +void swap(multiset& st); // (1) C++03 void swap(multiset& x) noexcept(allocator_traits::is_always_equal::value - && noexcept(swap(declval(),declval()))); // C++17 + && noexcept(swap(declval(),declval()))); // (1) C++17 +constexpr void swap(multiset& x) + noexcept(allocator_traits::is_always_equal::value + && noexcept(swap(declval(),declval()))); // (1) C++26 ``` ## 概要 @@ -63,3 +66,4 @@ int main() ## 参照 - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) - `noexcept` 追加の経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/swap_free.md b/reference/set/multiset/swap_free.md index 488f2c8056..67960d35bd 100644 --- a/reference/set/multiset/swap_free.md +++ b/reference/set/multiset/swap_free.md @@ -6,13 +6,19 @@ ```cpp namespace std { template - void swap(multiset& x, - multiset& y); - + void + swap(multiset& x, + multiset& y); // (1) C++03 + template + void + swap(multiset& x, + multiset& y) + noexcept(noexcept(x.swap(y))); // (1) C++17 template - void swap(multiset& x, - multiset& y) - noexcept(noexcept(x.swap(y))); // C++17 + constexpr void + swap(multiset& x, + multiset& y) + noexcept(noexcept(x.swap(y))); // (1) C++26 } ``` @@ -68,3 +74,4 @@ int main() ## 参照 - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) - `noexcept` 追加の経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/upper_bound.md b/reference/set/multiset/upper_bound.md index f60cb6e902..126295b2fe 100644 --- a/reference/set/multiset/upper_bound.md +++ b/reference/set/multiset/upper_bound.md @@ -5,15 +5,21 @@ * function[meta id-type] ```cpp -iterator upper_bound(const key_type& x); // (1) +iterator upper_bound(const key_type& x); // (1) C++03 +constexpr iterator upper_bound(const key_type& x); // (1) C++26 template -iterator upper_bound(const K& x); // (2) C++14 +iterator upper_bound(const K& x); // (2) C++14 +template +constexpr iterator upper_bound(const K& x); // (2) C++26 -const_iterator upper_bound(const key_type& x) const; // (3) +const_iterator upper_bound(const key_type& x) const; // (3) C++03 +constexpr const_iterator upper_bound(const key_type& x) const; // (3) C++26 template -const_iterator upper_bound(const K& x) const; // (4) C++14 +const_iterator upper_bound(const K& x) const; // (4) C++14 +template +constexpr const_iterator upper_bound(const K& x) const; // (4) C++26 ``` ## 概要 @@ -109,3 +115,4 @@ D ## 参照 - [N3657 Adding heterogeneous comparison lookup to associative containers (rev 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3657.htm) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/multiset/value_comp.md b/reference/set/multiset/value_comp.md index 520e564120..0ed427bbfe 100644 --- a/reference/set/multiset/value_comp.md +++ b/reference/set/multiset/value_comp.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -value_compare value_comp() const; +value_compare value_comp() const; // (1) C++03 +constexpr value_compare value_comp() const; // (1) C++26 ``` ## 概要 @@ -54,3 +55,7 @@ int main() | [`count`](count.md) | 指定したキーにマッチする要素の数を返す | | [`lower_bound`](lower_bound.md) | 与えられた値より小さくない最初の要素へのイテレータを返す | | [`upper_bound`](upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/begin.md b/reference/set/set/begin.md index fd041908f6..00adad9dc6 100644 --- a/reference/set/set/begin.md +++ b/reference/set/set/begin.md @@ -5,11 +5,13 @@ * function[meta id-type] ```cpp -iterator begin(); // (1) C++03 -iterator begin() noexcept; // (1) C++11 +iterator begin(); // (1) C++03 +iterator begin() noexcept; // (1) C++11 +constexpr iterator begin() noexcept; // (1) C++26 -const_iterator begin() const; // (2) C++03 -const_iterator begin() const noexcept; // (2) C++11 +const_iterator begin() const; // (2) C++03 +const_iterator begin() const noexcept; // (2) C++11 +constexpr const_iterator begin() const noexcept; // (2) C++26 ``` @@ -73,3 +75,7 @@ int main() | [`set::end`](end.md) | 末尾の次を指すイテレータを取得する | | [`set::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | | [`set::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/cbegin.md b/reference/set/set/cbegin.md index 3231d92b05..8ae03e6a90 100644 --- a/reference/set/set/cbegin.md +++ b/reference/set/set/cbegin.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_iterator cbegin() const noexcept; +const_iterator cbegin() const noexcept; // (1) C++11 +constexpr const_iterator cbegin() const noexcept; // (1) C++26 ``` @@ -55,3 +56,7 @@ int main() | [`set::cend`](cend.md) | 末尾の次を指す読み取り専用イテレータを取得する | | [`set::rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | | [`set::rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/cend.md b/reference/set/set/cend.md index 2a5fa8bb4a..4df8f9088c 100644 --- a/reference/set/set/cend.md +++ b/reference/set/set/cend.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_iterator cend() const noexcept; +const_iterator cend() const noexcept; // (1) C++11 +constexpr const_iterator cend() const noexcept; // (1) C++26 ``` ## 概要 @@ -60,3 +61,7 @@ int main() | [`cbegin`](cbegin.md) | 先頭を指す読み取り専用イテレータを取得する | | [`rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | | [`rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/clear.md b/reference/set/set/clear.md index 8d7cac8736..9f276afd1c 100644 --- a/reference/set/set/clear.md +++ b/reference/set/set/clear.md @@ -5,8 +5,9 @@ * function[meta id-type] ```cpp -void clear(); // C++03 -void clear() noexcept; // C++11 +void clear(); // (1) C++03 +void clear() noexcept; // (1) C++11 +constexpr void clear() noexcept; // (1) C++26 ``` ## 概要 @@ -57,3 +58,7 @@ int main () | [`erase`](erase.md) | 要素を削除する | | [`size`](size.md) | 要素数を取得する | | [`empty`](empty.md) | コンテナが空であるかどうかを調べる | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/contains.md b/reference/set/set/contains.md index 4e54d6a9eb..469342d461 100644 --- a/reference/set/set/contains.md +++ b/reference/set/set/contains.md @@ -6,10 +6,13 @@ * cpp20[meta cpp] ```cpp -bool contains(const key_type& x) const; // (1) +bool contains(const key_type& x) const; // (1) C++20 +constexpr bool contains(const key_type& x) const; // (1) C++26 template -bool contains(const K& x) const; // (2) +bool contains(const K& x) const; // (2) C++20 +template +constexpr bool contains(const K& x) const; // (2) C++26 ``` @@ -71,3 +74,4 @@ contain ## 参照 - [P0458R2 Checking for Existence of an Element in Associative Containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0458r2.html) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/count.md b/reference/set/set/count.md index f503075148..f60cf4249b 100644 --- a/reference/set/set/count.md +++ b/reference/set/set/count.md @@ -5,10 +5,13 @@ * function[meta id-type] ```cpp -size_type count(const key_type& x) const; // (1) +size_type count(const key_type& x) const; // (1) C++03 +constexpr size_type count(const key_type& x) const; // (1) C++26 template -size_type count(const K& x) const; // (2) C++14 +size_type count(const K& x) const; // (2) C++14 +template +constexpr size_type count(const K& x) const; // (2) C++26 ``` ## 概要 @@ -83,3 +86,4 @@ int main() ## 参照 - [N3657 Adding heterogeneous comparison lookup to associative containers (rev 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3657.htm) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/crbegin.md b/reference/set/set/crbegin.md index c600662616..c7694a49e1 100644 --- a/reference/set/set/crbegin.md +++ b/reference/set/set/crbegin.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_reverse_iterator crbegin() const noexcept; +const_reverse_iterator crbegin() const noexcept; // (1) C++11 +constexpr const_reverse_iterator crbegin() const noexcept; // (1) C++26 ``` @@ -57,3 +58,7 @@ int main() | [`crend`](crend.md) | 先頭の前を指す読み取り専用逆イテレータを取得する | | [`cbegin`](cbegin.md) | 先頭を指す読み取り専用イテレータを取得する | | [`cend`](cend.md) | 末尾の次を指す読み取り専用イテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/crend.md b/reference/set/set/crend.md index 4a66c7f05c..b4e87baa9b 100644 --- a/reference/set/set/crend.md +++ b/reference/set/set/crend.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_reverse_iterator crend() const noexcept; +const_reverse_iterator crend() const noexcept; // (1) C++11 +constexpr const_reverse_iterator crend() const noexcept; // (1) C++26 ``` @@ -53,3 +54,7 @@ int main() | [`crbegin`](crbegin.md) | 末尾を指す読み取り専用逆イテレータを返す | | [`cbegin`](cbegin.md) | 先頭を指す読み取り専用イテレータを返す | | [`cend`](cend.md) | 末尾の次を指す読み取り専用イテレータを返す | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/emplace.md b/reference/set/set/emplace.md index 6b3d642552..e576806284 100644 --- a/reference/set/set/emplace.md +++ b/reference/set/set/emplace.md @@ -7,7 +7,9 @@ ```cpp template -pair emplace(Args&&... args); +pair emplace(Args&&... args); // (1) C++11 +template +constexpr pair emplace(Args&&... args); // (1) C++26 ``` ## 概要 @@ -82,3 +84,4 @@ int main() ## 参照 - [N2680 Proposed Wording for Placement Insert (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2680.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/emplace_hint.md b/reference/set/set/emplace_hint.md index d63bcaa591..c5c97972de 100644 --- a/reference/set/set/emplace_hint.md +++ b/reference/set/set/emplace_hint.md @@ -7,7 +7,9 @@ ```cpp template -iterator emplace_hint(const_iterator hint, Args&&... args); +iterator emplace_hint(const_iterator hint, Args&&... args); // (1) C++11 +template +constexpr iterator emplace_hint(const_iterator hint, Args&&... args); // (1) C++26 ``` ## 概要 @@ -87,3 +89,4 @@ int main() ## 参照 - [N2680 Proposed Wording for Placement Insert (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2680.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/empty.md b/reference/set/set/empty.md index 988be85c91..90b526f17d 100644 --- a/reference/set/set/empty.md +++ b/reference/set/set/empty.md @@ -5,10 +5,10 @@ * function[meta id-type] ```cpp -bool empty() const; // C++03 -bool empty() const noexcept; // C++11 -[[nodiscard]] bool empty() const noexcept; // C++20 -bool empty() const noexcept; // C++26 +bool empty() const; // (1) C++03 +bool empty() const noexcept; // (1) C++11 +[[nodiscard]] bool empty() const noexcept; // (1) C++20 +constexpr bool empty() const noexcept; // (1) C++26 ``` ## 概要 @@ -64,3 +64,4 @@ int main () - C++20で`[[nodiscard]]`が付加された - [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) - C++26で`[[nodiscard]]`指定が削除された +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/end.md b/reference/set/set/end.md index afa8ace6d6..4c043cc186 100644 --- a/reference/set/set/end.md +++ b/reference/set/set/end.md @@ -5,11 +5,13 @@ * function[meta id-type] ```cpp -iterator end(); // (1) C++03 -iterator end() noexcept; // (1) C++11 +iterator end(); // (1) C++03 +iterator end() noexcept; // (1) C++11 +constexpr iterator end() noexcept; // (1) C++26 -const_iterator end() const; // (2) C++03 -const_iterator end() const noexcept; // (2) C++11 +const_iterator end() const; // (2) C++03 +const_iterator end() const noexcept; // (2) C++11 +constexpr const_iterator end() const noexcept; // (2) C++26 ``` ## 概要 @@ -74,3 +76,7 @@ int main() | [`begin`](begin.md) | 先頭を指すイテレータを取得する | | [`rbegin`](rbegin.md) | 末尾を指す逆イテレータを取得する | | [`rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/equal_range.md b/reference/set/set/equal_range.md index 46d9991015..99de979627 100644 --- a/reference/set/set/equal_range.md +++ b/reference/set/set/equal_range.md @@ -5,17 +5,29 @@ * function[meta id-type] ```cpp -pair equal_range(const key_type& x); // (1) +pair + equal_range(const key_type& x); // (1) C++03 +constexpr pair + equal_range(const key_type& x); // (1) C++26 template -pair equal_range(const K& x); // (2) C++14 +pair + equal_range(const K& x); // (2) C++14 +template +constexpr pair + equal_range(const K& x); // (2) C++26 pair - equal_range(const key_type& x) const; // (3) + equal_range(const key_type& x) const; // (3) C++03 +constexpr pair + equal_range(const key_type& x) const; // (3) C++26 template pair - equal_range(const K& x) const; // (4) C++14 + equal_range(const K& x) const; // (4) C++14 +template +constexpr pair + equal_range(const K& x) const; // (4) C++26 ``` ## 概要 @@ -76,3 +88,4 @@ B ## 参照 - [N3657 Adding heterogeneous comparison lookup to associative containers (rev 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3657.htm) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/erase.md b/reference/set/set/erase.md index b085dcdefa..af2cab3a9b 100644 --- a/reference/set/set/erase.md +++ b/reference/set/set/erase.md @@ -5,18 +5,24 @@ * function[meta id-type] ```cpp -void erase(iterator position); // (1) C++03 (C++11で一旦削除) -iterator erase(iterator position); // (1) C++17 +void erase(iterator position); // (1) C++03 (C++11で一旦削除) +iterator erase(iterator position); // (1) C++17 +constexpr iterator erase(iterator position); // (1) C++26 -iterator erase(const_iterator position); // (2) C++11 +iterator erase(const_iterator position); // (2) C++11 +constexpr iterator erase(const_iterator position); // (2) C++26 -size_type erase(const key_type& x); // (3) C++03 +size_type erase(const key_type& x); // (3) C++03 +constexpr size_type erase(const key_type& x); // (3) C++26 template -size_type erase(K&& x); // (4) C++23 +size_type erase(K&& x); // (4) C++23 +template +constexpr size_type erase(K&& x); // (4) C++26 -void erase(iterator first, iterator last); // (5) C++03 -iterator erase(const_iterator first, const_iterator last); // (5) C++11 +void erase(iterator first, iterator last); // (5) C++03 +iterator erase(const_iterator first, const_iterator last); // (5) C++11 +constexpr iterator erase(const_iterator first, const_iterator last); // (5) C++26 ``` @@ -173,3 +179,4 @@ int main() - C++17で、`erase(iterator)`を再追加 - [P2077R3 Heterogeneous erasure overloads for associative containers](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2077r3.html) - C++23で、`template erase(K&& x)`のオーバーロードが追加された +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/erase_if_free.md b/reference/set/set/erase_if_free.md index 9011dbd30b..ce45131c6e 100644 --- a/reference/set/set/erase_if_free.md +++ b/reference/set/set/erase_if_free.md @@ -8,7 +8,10 @@ namespace std { template typename set::size_type - erase_if(set& c, Predicate pred); + erase_if(set& c, Predicate pred); // (1) C++20 + template + constexpr typename set::size_type + erase_if(set& c, Predicate pred); // (1) C++26 } ``` @@ -78,3 +81,4 @@ int main() ## 参照 - [P1209R0 Adopt consistent container erasure from Library Fundamentals 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1209r0.html) - [R1115R3 Improving the Return Value of Erase-Like Algorithms II: Free `erase`/`erase_if`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1115r3.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/extract.md b/reference/set/set/extract.md index c045064d74..8afc636e7c 100644 --- a/reference/set/set/extract.md +++ b/reference/set/set/extract.md @@ -6,12 +6,16 @@ * cpp17[meta cpp] ```cpp -node_type extract(const_iterator position); // (1) C++17 +node_type extract(const_iterator position); // (1) C++17 +constexpr node_type extract(const_iterator position); // (1) C++26 -node_type extract(const key_type& x); // (2) C++17 +node_type extract(const key_type& x); // (2) C++17 +constexpr node_type extract(const key_type& x); // (2) C++26 template -node_type extract(K&& x); // (3) C++23 +node_type extract(K&& x); // (3) C++23 +template +constexpr node_type extract(K&& x); // (3) C++26 ``` ## 概要 @@ -142,3 +146,4 @@ s2 = { 1, 2 } - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) - [P2077R3 Heterogeneous erasure overloads for associative containers](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2077r3.html) - C++23で、`template extract(K&& x)`のオーバーロードが追加された +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/find.md b/reference/set/set/find.md index f8765cdd53..2f26041225 100644 --- a/reference/set/set/find.md +++ b/reference/set/set/find.md @@ -5,15 +5,21 @@ * function[meta id-type] ```cpp -iterator find(const key_type& x); // (1) +iterator find(const key_type& x); // (1) C++03 +constexpr iterator find(const key_type& x); // (1) C++26 template -iterator find(const K& x); // (2) C++14 +iterator find(const K& x); // (2) C++14 +template +constexpr iterator find(const K& x); // (2) C++26 -const_iterator find(const key_type& x) const; // (3) +const_iterator find(const key_type& x) const; // (3) C++03 +constexpr const_iterator find(const key_type& x) const; // (3) C++26 template -const_iterator find(const K& x) const; // (4) C++14 +const_iterator find(const K& x) const; // (4) C++14 +template +constexpr const_iterator find(const K& x) const; // (4) C++26 ``` ## 概要 @@ -95,3 +101,4 @@ Bob ## 参照 - [N3657 Adding heterogeneous comparison lookup to associative containers (rev 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3657.htm) - [LWG Issue 2299. [CD] Effects of inaccessible `key_compare::is_transparent` type are not clear](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2299) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/get_allocator.md b/reference/set/set/get_allocator.md index 52a82caab6..53294fac5f 100644 --- a/reference/set/set/get_allocator.md +++ b/reference/set/set/get_allocator.md @@ -5,8 +5,9 @@ * function[meta id-type] ```cpp -allocator_type get_allocator() const; // C++03 -allocator_type get_allocator() const noexcept; // C++11 +allocator_type get_allocator() const; // (1) C++03 +allocator_type get_allocator() const noexcept; // (1) C++11 +constexpr allocator_type get_allocator() const noexcept; // (1) C++26 ``` ## 概要 @@ -66,3 +67,7 @@ int main() - [Visual C++](/implementation.md#visual_cpp): 2002 [mark verified], 2003 [mark verified], 2005 [mark verified], 2008 [mark verified], 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - 2012, 2013は、`noexcept`が実装されていないため、`throw()`が修飾されている。 - 2015からは、`noexcept`が修飾されている。 + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/insert.md b/reference/set/set/insert.md index 6284243c07..d5a28d5375 100644 --- a/reference/set/set/insert.md +++ b/reference/set/set/insert.md @@ -6,26 +6,37 @@ ```cpp pair insert(const value_type& x); // (1) C++03 -pair insert(value_type&& y); // (2) C++11 +constexpr pair insert(const value_type& x); // (1) C++26 + +pair insert(value_type&& y); // (2) C++11 +constexpr pair insert(value_type&& y); // (2) C++26 template -pair insert(K&& x); // (3) C++26 +constexpr pair insert(K&& x); // (3) C++26 -iterator insert(iterator hint, const value_type& x); // (4) C++03 -iterator insert(const_iterator hint, const value_type& x); // (4) C++11 +iterator insert(iterator hint, const value_type& x); // (4) C++03 +iterator insert(const_iterator hint, const value_type& x); // (4) C++11 +constexpr iterator insert(const_iterator hint, const value_type& x); // (4) C++26 -iterator insert(const_iterator hint, value_type&& y); // (5) C++11 +iterator insert(const_iterator hint, value_type&& y); // (5) C++11 +constexpr iterator insert(const_iterator hint, value_type&& y); // (5) C++26 template -iterator insert(const_iterator hint, K&& x); // (6) C++26 +constexpr iterator insert(const_iterator hint, K&& x); // (6) C++26 template -void insert(InputIterator first, InputIterator last); // (7) C++03 +void insert(InputIterator first, InputIterator last); // (7) C++03 +template +constexpr void insert(InputIterator first, InputIterator last); // (7) C++26 + +void insert(initializer_list init); // (8) C++03 +constexpr void insert(initializer_list init); // (8) C++26 -void insert(initializer_list init); // (8) C++03 +insert_return_type insert(node_type&& nh); // (9) C++17 +constexpr insert_return_type insert(node_type&& nh); // (9) C++26 -insert_return_type insert(node_type&& nh); // (9) C++17 -iterator insert(const_iterator hint, node_type&& nh); // (10) C++17 +iterator insert(const_iterator hint, node_type&& nh); // (10) C++17 +constexpr iterator insert(const_iterator hint, node_type&& nh); // (10) C++26 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -133,3 +144,4 @@ int main () - C++17で導入されたノード挿入(9), (10)の経緯となる提案文書 - [P2363R5: Extending associative containers with the remaining heterogeneous overloads](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2363r5.html) - C++26で`template `のバージョンが追加された +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/insert_range.md b/reference/set/set/insert_range.md index e5e6becf34..3dfb79b035 100644 --- a/reference/set/set/insert_range.md +++ b/reference/set/set/insert_range.md @@ -7,7 +7,9 @@ ```cpp template R> -void insert_range(R&& rg); // C++23 +void insert_range(R&& rg); // (1) C++23 +template R> +constexpr void insert_range(R&& rg); // (1) C++26 ``` ## 概要 @@ -62,3 +64,7 @@ int main () | 名前 | 説明 | |----------------------------|------------------------| | [`insert`](insert.md) | 要素を挿入する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/key_comp.md b/reference/set/set/key_comp.md index 25f79a254b..e605de14d2 100644 --- a/reference/set/set/key_comp.md +++ b/reference/set/set/key_comp.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -key_compare key_comp() const; +key_compare key_comp() const; // (1) C++03 +constexpr key_compare key_comp() const; // (1) C++26 ``` ## 概要 @@ -53,3 +54,7 @@ int main() | [`count`](count.md) | 指定したキーにマッチする要素の数を返す | | [`lower_bound`](lower_bound.md) | 与えられた値より小さく無い最初の要素へのイテレータを返す | | [`upper_bound`](upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/lower_bound.md b/reference/set/set/lower_bound.md index 48e2f50d40..75fad22b49 100644 --- a/reference/set/set/lower_bound.md +++ b/reference/set/set/lower_bound.md @@ -5,15 +5,21 @@ * function[meta id-type] ```cpp -iterator lower_bound(const key_type& x); // (1) +iterator lower_bound(const key_type& x); // (1) C++03 +constexpr iterator lower_bound(const key_type& x); // (1) C++26 template -iterator lower_bound(const K& x); // (2) C++14 +iterator lower_bound(const K& x); // (2) C++14 +template +constexpr iterator lower_bound(const K& x); // (2) C++26 -const_iterator lower_bound(const key_type& x) const; // (3) +const_iterator lower_bound(const key_type& x) const; // (3) C++03 +constexpr const_iterator lower_bound(const key_type& x) const; // (3) C++26 template -const_iterator lower_bound(const K& x) const; // (4) C++14 +const_iterator lower_bound(const K& x) const; // (4) C++14 +template +constexpr const_iterator lower_bound(const K& x) const; // (4) C++26 ``` ## 概要 @@ -107,3 +113,4 @@ D ## 参照 - [N3657 Adding heterogeneous comparison lookup to associative containers (rev 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3657.htm) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/max_size.md b/reference/set/set/max_size.md index bf6685eea3..3e9f420fd1 100644 --- a/reference/set/set/max_size.md +++ b/reference/set/set/max_size.md @@ -5,8 +5,9 @@ * function[meta id-type] ```cpp -size_type max_size() const; // C++03 -size_type max_size() const noexcept; // C++11 +size_type max_size() const; // (1) C++03 +size_type max_size() const noexcept; // (1) C++11 +constexpr size_type max_size() const noexcept; // (1) C++26 ``` ## 概要 @@ -47,3 +48,7 @@ int main () | 名前 | 説明 | |---------------------|------------------| | [`size`](size.md) | 要素数を取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/merge.md b/reference/set/set/merge.md index ca5bb9db26..a973d30acb 100644 --- a/reference/set/set/merge.md +++ b/reference/set/set/merge.md @@ -7,13 +7,24 @@ ```cpp template - void merge(set& source); // (1) +void merge(set& source); // (1) C++17 template - void merge(set&& source); // (2) +constexpr void merge(set& source); // (1) C++26 + +template +void merge(set&& source); // (2) C++17 +template +constexpr void merge(set&& source); // (2) C++26 + +template +void merge(multiset& source); // (3) C++17 +template +constexpr void merge(multiset& source); // (3) C++26 + template - void merge(multiset& source); // (3) +void merge(multiset&& source); // (4) C++17 template - void merge(multiset&& source); // (4) +constexpr void merge(multiset&& source); // (4) C++26 ``` ## 概要 @@ -88,3 +99,4 @@ s2 = { 10, 20, 30 } ## 参照 - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/op_assign.md b/reference/set/set/op_assign.md index ea6aabf4a2..6869c912ba 100644 --- a/reference/set/set/op_assign.md +++ b/reference/set/set/op_assign.md @@ -5,12 +5,19 @@ * function[meta id-type] ```cpp -set& operator=(const set& x); // (1) C++03 -set& operator=(set&& x); // (2) C++11 +set& operator=(const set& x); // (1) C++03 +constexpr set& operator=(const set& x); // (1) C++26 + +set& operator=(set&& x); // (2) C++11 set& operator=(set&& x) noexcept(allocator_traits::is_always_equal::value && is_nothrow_move_assignable::value); // (2) C++17 -set& operator=(initializer_list init); // (3) C++11 +constexpr set& operator=(set&& x) + noexcept(allocator_traits::is_always_equal::value + && is_nothrow_move_assignable::value); // (2) C++26 + +set& operator=(initializer_list init); // (3) C++11 +constexpr set& operator=(initializer_list init); // (3) C++26 ``` * initializer_list[link ../../initializer_list.md] @@ -82,3 +89,4 @@ Size of c2: 6 - [N2679 Initializer Lists for Standard Containers(Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2679.pdf) - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) - `noexcept` 追加の経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/op_compare_3way.md b/reference/set/set/op_compare_3way.md index f76dfad5b0..6aac88de4d 100644 --- a/reference/set/set/op_compare_3way.md +++ b/reference/set/set/op_compare_3way.md @@ -10,6 +10,10 @@ namespace std { synth-three-way-result operator<=>(const set& x, const set& y); // (1) C++20 + template + constexpr synth-three-way-result + operator<=>(const set& x, + const set& y); // (1) C++26 } ``` @@ -85,3 +89,4 @@ int main() ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/op_constructor.md b/reference/set/set/op_constructor.md index 51a2b731da..16d8d4a60a 100644 --- a/reference/set/set/op_constructor.md +++ b/reference/set/set/op_constructor.md @@ -5,50 +5,97 @@ * function[meta id-type] ```cpp -set(); // (1) C++14 +set(); // (1) C++14 +constexpr set(); // (1) C++26 explicit set(const Compare& comp, - const Allocator& = Allocator()); // (2) C++14 + const Allocator& = Allocator()); // (2) C++14 +constexpr explicit + set(const Compare& comp, + const Allocator& = Allocator()); // (2) C++26 -explicit set(const Compare& comp = Compare(), - const Allocator& alloc = Allocator()); // (1) + (2) C++03 +explicit + set(const Compare& comp = Compare(), + const Allocator& alloc = Allocator()); // (1) + (2) C++03 -explicit set(const Allocator& alloc); // (3) C++11 +explicit set(const Allocator& alloc); // (3) C++11 +constexpr explicit set(const Allocator& alloc); // (3) C++26 template -set(InputIterator first, InputIterator last, +set(InputIterator first, + InputIterator last, const Compare& comp = Compare(), - const Allocator& alloc = Allocator()); // (4) C++03 + const Allocator& alloc = Allocator()); // (4) C++03 +template +constexpr + set(InputIterator first, + InputIterator last, + const Compare& comp = Compare(), + const Allocator& alloc = Allocator()); // (4) C++26 template -set(InputIterator first, InputIterator last, - const Allocator& a); // (5) C++14 +set(InputIterator first, + InputIterator last, + const Allocator& a); // (5) C++14 +template +constexpr + set(InputIterator first, + InputIterator last, + const Allocator& a); // (5) C++26 + +set(const set& x); // (6) C++03 +constexpr set(const set& x); // (6) C++26 -set(const set& x); // (6) C++03 -set(set&& y); // (7) C++11 +set(set&& y); // (7) C++11 +constexpr set(set&& y); // (7) C++26 -set(const set& x, const Allocator& alloc); // (8) C++11 set(const set& x, - const type_identity_t& alloc); // (8) C++23 + const Allocator& alloc); // (8) C++11 +set(const set& x, + const type_identity_t& alloc); // (8) C++23 +constexpr + set(const set& x, + const type_identity_t& alloc); // (8) C++26 -set(set&& y, const Allocator& alloc); // (9) C++11 -set(set&& y, const type_identity_t& alloc); // (9) C++23 +set(set&& y, const Allocator& alloc); // (9) C++11 +set(set&& y, const type_identity_t& alloc); // (9) C++23 +constexpr set(set&& y, const type_identity_t& alloc); // (9) C++26 set(initializer_list init, const Compare& comp = Compare(), - const Allocator& alloc = Allocator()); // (10) C++11 + const Allocator& alloc = Allocator()); // (10) C++11 +constexpr + set(initializer_list init, + const Compare& comp = Compare(), + const Allocator& alloc = Allocator()); // (10) C++26 set(initializer_list init, - const Allocator& a); // (11) C++14 + const Allocator& a); // (11) C++14 +constexpr + set(initializer_list init, + const Allocator& a); // (11) C++26 template R> -set(from_range_t, R&& rg, +set(from_range_t, + R&& rg, const Compare& comp = Compare(), - const Allocator& alloc = Allocator()); // (12) C++23 + const Allocator& alloc = Allocator()); // (12) C++23 +template R> +constexpr + set(from_range_t, + R&& rg, + const Compare& comp = Compare(), + const Allocator& alloc = Allocator()); // (12) C++26 template R> -set(from_range_t, R&& rg, - const Allocator& alloc); // (13) C++23 +set(from_range_t, + R&& rg, + const Allocator& alloc); // (13) C++23 +template R> +constexpr + set(from_range_t, + R&& rg, + const Allocator& alloc); // (13) C++26 ``` * type_identity_t[link /reference/type_traits/type_identity.md] * initializer_list[link ../../initializer_list.md] @@ -163,3 +210,4 @@ Size of c2: 6 なお、Discussion の例はアロケータの型が誤っているので注意 - [P1518R2 Stop Overconstraining Allocators in Container Deduction Guides](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1518r2.html) - C++23でのアロケータ引数を`type_identity_t`で包む変更 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/op_destructor.md b/reference/set/set/op_destructor.md index 4136f65db5..c0431472dd 100644 --- a/reference/set/set/op_destructor.md +++ b/reference/set/set/op_destructor.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -~set(); +~set(); // (1) C++03 +constexpr ~set(); // (1) C++26 ``` ## 概要 @@ -14,3 +15,7 @@ ## 計算量 [`size()`](size.md) に対して線形時間(デストラクタ呼び出し) + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/op_equal.md b/reference/set/set/op_equal.md index 187e927cbf..1ff17f5601 100644 --- a/reference/set/set/op_equal.md +++ b/reference/set/set/op_equal.md @@ -9,6 +9,10 @@ namespace std { bool operator==(const set& x, const set& y); // (1) C++03 + template + constexpr bool + operator==(const set& x, + const set& y); // (1) C++26 } ``` @@ -65,3 +69,4 @@ int main() - C++14から、2つ目のイテレータ範囲のendイテレータをとる`equal()`アルゴリズムを使用するようになった。 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/op_greater.md b/reference/set/set/op_greater.md index 040d0c5c7c..edfc1a303e 100644 --- a/reference/set/set/op_greater.md +++ b/reference/set/set/op_greater.md @@ -10,6 +10,10 @@ namespace std { bool operator>(const set& x, const set& y); // (1) C++03 + template + constexpr bool + operator>(const set& x, + const set& y); // (1) C++26 } ``` @@ -63,3 +67,4 @@ int main() ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/op_greater_equal.md b/reference/set/set/op_greater_equal.md index 616144e9fb..5d6acc65d9 100644 --- a/reference/set/set/op_greater_equal.md +++ b/reference/set/set/op_greater_equal.md @@ -10,6 +10,10 @@ namespace std { bool operator>=(const set& x, const set& y); // (1) C++03 + template + constexpr bool + operator>=(const set& x, + const set& y); // (1) C++26 } ``` @@ -63,3 +67,4 @@ int main() ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/op_less.md b/reference/set/set/op_less.md index feb55fb296..a056976a09 100644 --- a/reference/set/set/op_less.md +++ b/reference/set/set/op_less.md @@ -10,6 +10,10 @@ namespace std { bool operator<(const set& x, const set& y); // (1) C++03 + template + constexpr bool + operator<(const set& x, + const set& y); // (1) C++26 } ``` @@ -61,3 +65,4 @@ true ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/op_less_equal.md b/reference/set/set/op_less_equal.md index a16faa12ed..388f0acfd2 100644 --- a/reference/set/set/op_less_equal.md +++ b/reference/set/set/op_less_equal.md @@ -10,6 +10,10 @@ namespace std { bool operator<=(const set& x, const set& y); // (1) C++03 + template + constexpr bool + operator<=(const set& x, + const set& y); // (1) C++26 } ``` @@ -63,3 +67,4 @@ int main() ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/op_not_equal.md b/reference/set/set/op_not_equal.md index 148d3ccc99..3ad8c0ef09 100644 --- a/reference/set/set/op_not_equal.md +++ b/reference/set/set/op_not_equal.md @@ -10,6 +10,10 @@ namespace std { bool operator!=(const set& x, const set& y); // (1) C++03 + template + constexpr bool + operator!=(const set& x, + const set& y); // (1) C++26 } ``` @@ -63,3 +67,4 @@ int main() ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/rbegin.md b/reference/set/set/rbegin.md index 05e9ff5f0d..5842141e06 100644 --- a/reference/set/set/rbegin.md +++ b/reference/set/set/rbegin.md @@ -5,11 +5,13 @@ * function[meta id-type] ```cpp -reverse_iterator rbegin(); // (1) C++03 -reverse_iterator rbegin() noexcept; // (1) C++11 +reverse_iterator rbegin(); // (1) C++03 +reverse_iterator rbegin() noexcept; // (1) C++11 +constexpr reverse_iterator rbegin() noexcept; // (1) C++26 -const_reverse_iterator rbegin() const; // (2) C++03 -const_reverse_iterator rbegin() const noexcept; // (2) C++11 +const_reverse_iterator rbegin() const; // (2) C++03 +const_reverse_iterator rbegin() const noexcept; // (2) C++11 +constexpr const_reverse_iterator rbegin() const noexcept; // (2) C++26 ``` @@ -69,3 +71,7 @@ int main() | [`rend`](rend.md) | 先頭の前を指す逆イテレータを取得する | | [`begin`](begin.md) | 先頭を指すイテレータを取得する | | [`end`](end.md) | 末尾の次を指すイテレータを取得する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/rend.md b/reference/set/set/rend.md index 62b0ea8278..68be86fc2f 100644 --- a/reference/set/set/rend.md +++ b/reference/set/set/rend.md @@ -5,11 +5,13 @@ * function[meta id-type] ```cpp -reverse_iterator rend(); // (1) C++03 -reverse_iterator rend() noexcept; // (1) C++11 +reverse_iterator rend(); // (1) C++03 +reverse_iterator rend() noexcept; // (1) C++11 +constexpr reverse_iterator rend() noexcept; // (1) C++26 -const_reverse_iterator rend() const; // (2) C++03 -const_reverse_iterator rend() const noexcept; // (2) C++11 +const_reverse_iterator rend() const; // (2) C++03 +const_reverse_iterator rend() const noexcept; // (2) C++11 +constexpr const_reverse_iterator rend() const noexcept; // (2) C++26 ``` @@ -63,3 +65,7 @@ int main() | [`rbegin`](rbegin.md) | 末尾を指す逆イテレータを返す | | [`begin`](begin.md) | 先頭を指すイテレータを返す | | [`end`](end.md) | 末尾の次を指すイテレータを返す | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/size.md b/reference/set/set/size.md index ecaa35ab49..e46b73b866 100644 --- a/reference/set/set/size.md +++ b/reference/set/set/size.md @@ -5,8 +5,9 @@ * function[meta id-type] ```cpp -size_type size() const; // C++03 -size_type size() const noexcept; // C++11 +size_type size() const; // (1) C++03 +size_type size() const noexcept; // (1) C++11 +constexpr size_type size() const noexcept; // (1) C++26 ``` ## 概要 @@ -56,3 +57,7 @@ int main () |-----------------------------|------------------------------------| | [`max_size`](max_size.md) | 格納可能な最大の要素数を取得する | | [`empty`](empty.md) | コンテナが空であるかどうかを調べる | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/swap.md b/reference/set/set/swap.md index a1ceb2590c..3ec8e6f912 100644 --- a/reference/set/set/swap.md +++ b/reference/set/set/swap.md @@ -5,10 +5,13 @@ * function[meta id-type] ```cpp -void swap(set& st); +void swap(set& st); // (1) C++03 void swap(set& x) noexcept(allocator_traits::is_always_equal::value - && noexcept(swap(declval(),declval()))); // C++17 + && noexcept(swap(declval(),declval()))); // (1) C++17 +constexpr void swap(set& x) + noexcept(allocator_traits::is_always_equal::value + && noexcept(swap(declval(),declval()))); // (1) C++26 ``` ## 概要 @@ -63,3 +66,4 @@ int main() ## 参照 - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) - `noexcept` 追加の経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/swap_free.md b/reference/set/set/swap_free.md index 2924917502..ad0d2263d6 100644 --- a/reference/set/set/swap_free.md +++ b/reference/set/set/swap_free.md @@ -6,13 +6,19 @@ ```cpp namespace std { template - void swap(set& x, - set& y); - + void + swap(set& x, + set& y); // (1) C++03 + template + void + swap(set& x, + set& y) + noexcept(noexcept(x.swap(y))); // (1) C++17 template - void swap(set& x, - set& y) - noexcept(noexcept(x.swap(y))); // C++17 + constexpr void + swap(set& x, + set& y) + noexcept(noexcept(x.swap(y))); // (1) C++26 } ``` @@ -68,3 +74,4 @@ int main() ## 参照 - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) - `noexcept` 追加の経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/upper_bound.md b/reference/set/set/upper_bound.md index 2d8fd61d1a..8db12e7d5c 100644 --- a/reference/set/set/upper_bound.md +++ b/reference/set/set/upper_bound.md @@ -5,15 +5,21 @@ * function[meta id-type] ```cpp -iterator upper_bound(const key_type& x); // (1) +iterator upper_bound(const key_type& x); // (1) C++03 +constexpr iterator upper_bound(const key_type& x); // (1) C++26 template -iterator upper_bound(const K& x); // (2) C++14 +iterator upper_bound(const K& x); // (2) C++14 +template +constexpr iterator upper_bound(const K& x); // (2) C++26 -const_iterator upper_bound(const key_type& x) const; // (3) +const_iterator upper_bound(const key_type& x) const; // (3) C++03 +constexpr const_iterator upper_bound(const key_type& x) const; // (3) C++26 template -const_iterator upper_bound(const K& x) const; // (4) C++14 +const_iterator upper_bound(const K& x) const; // (4) C++14 +template +constexpr const_iterator upper_bound(const K& x) const; // (4) C++26 ``` ## 概要 @@ -107,3 +113,4 @@ D ## 参照 - [N3657 Adding heterogeneous comparison lookup to associative containers (rev 4)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3657.htm) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/set/set/value_comp.md b/reference/set/set/value_comp.md index ad583b2250..4ddf7ede20 100644 --- a/reference/set/set/value_comp.md +++ b/reference/set/set/value_comp.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -value_compare value_comp() const; +value_compare value_comp() const; // (1) C++03 +constexpr value_compare value_comp() const; // (1) C++26 ``` ## 概要 @@ -54,3 +55,7 @@ int main() | [`count`](count.md) | 指定したキーにマッチする要素の数を返す | | [`lower_bound`](lower_bound.md) | 与えられた値より小さくない最初の要素へのイテレータを返す | | [`upper_bound`](upper_bound.md) | 特定の値よりも大きい最初の要素へのイテレータを返す | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/stack/stack/emplace.md b/reference/stack/stack/emplace.md index 83694b65d3..75ebc2a441 100644 --- a/reference/stack/stack/emplace.md +++ b/reference/stack/stack/emplace.md @@ -7,10 +7,11 @@ ```cpp template -void emplace(Args&&... args); // C++14 まで - +void emplace(Args&&... args); // (1) C++11 +template +decltype(auto) emplace(Args&&... args); // (1) C++17 template -decltype(auto) emplace(Args&&... args); // C++17 から +constexpr decltype(auto) emplace(Args&&... args); // (1) C++26 ``` ## 概要 @@ -96,3 +97,4 @@ C++17 規格が発行された段階では戻り値型が `reference` に変更 - [P0084R1 Emplace Return Type (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0084r1.pdf) - [P0084R2 Emplace Return Type (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0084r2.pdf) - [LWG Issue 2783. stack::emplace() and queue::emplace() should return decltype(auto)](https://wg21.cmeerw.net/lwg/issue2783) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/stack/stack/empty.md b/reference/stack/stack/empty.md index 1d58dc05eb..009b3e53d9 100644 --- a/reference/stack/stack/empty.md +++ b/reference/stack/stack/empty.md @@ -5,9 +5,9 @@ * function[meta id-type] ```cpp -bool empty() const; // C++03 -[[nodiscard]] bool empty() const; // C++20 -bool empty() const; // C++26 +bool empty() const; // (1) C++03 +[[nodiscard]] bool empty() const; // (1) C++20 +constexpr bool empty() const; // (1) C++26 ``` ## 概要 @@ -78,3 +78,4 @@ bool empty() const { return c.empty(); } - C++20で`[[nodiscard]]`が付加された - [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) - C++26で`[[nodiscard]]`指定が削除された +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/stack/stack/op_assign.md b/reference/stack/stack/op_assign.md index 1906a194df..be5dc457ae 100644 --- a/reference/stack/stack/op_assign.md +++ b/reference/stack/stack/op_assign.md @@ -5,8 +5,11 @@ * function[meta id-type] ```cpp -stack& operator=(const stack& st); // (1) -stack& operator=(stack&& st); // (2) C++11 +stack& operator=(const stack& st); // (1) C++03 +constexpr stack& operator=(const stack& st); // (1) C++26 + +stack& operator=(stack&& st); // (2) C++11 +constexpr stack& operator=(stack&& st); // (2) C++26 ``` ## 概要 @@ -65,3 +68,7 @@ int main() | 名前 | 説明 | |--------------------------------------------------------------------------------------------|-----------------------------------------------------| | [`(constructor)`](op_constructor.md) | コンストラクタ | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/stack/stack/op_compare_3way.md b/reference/stack/stack/op_compare_3way.md index f481edf6ed..aee15ab3d3 100644 --- a/reference/stack/stack/op_compare_3way.md +++ b/reference/stack/stack/op_compare_3way.md @@ -9,6 +9,10 @@ namespace std { compare_three_way_result_t operator<=>(const stack& x, const stack& y); // (1) C++20 + template + constexpr compare_three_way_result_t + operator<=>(const stack& x, + const stack& y); // (1) C++26 } ``` @@ -59,3 +63,4 @@ int main() ## 参照 - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/stack/stack/op_constructor.md b/reference/stack/stack/op_constructor.md index f173b91cad..3b43a689e0 100644 --- a/reference/stack/stack/op_constructor.md +++ b/reference/stack/stack/op_constructor.md @@ -6,43 +6,66 @@ ```cpp // C++03まで -explicit stack(const Container& cont = Container()); // (1), (2) +explicit stack(const Container& cont = Container()); // (1), (2) // C++11以降 C++17まで -explicit stack(const Container& cont); // (2) -explicit stack(Container&& cont = Container()); // (1), (3) +explicit stack(const Container& cont); // (2) +explicit stack(Container&& cont = Container()); // (1), (3) // C++20以降 -stack() : stack(Container()) {} // (1) -explicit stack(const Container&); // (2) -explicit stack(Container&&); // (3) +stack() : stack(Container()) {} // (1) +constexpr stack() : stack(Container()) {} // (1) C++26 +explicit stack(const Container&); // (2) +constexpr explicit stack(const Container&); // (2) C++26 + +explicit stack(Container&&); // (3) +constexpr explicit stack(Container&&); // (3) C++26 + +template +stack(InputIterator first, InputIterator last); // (4) C++23 template -stack(InputIterator first, InputIterator last); // (4) C++23 +constexpr stack(InputIterator first, InputIterator last); // (4) C++26 template -explicit stack(const Allocator& alloc); // (5) C++11 +explicit stack(const Allocator& alloc); // (5) C++11 +template +constexpr explicit stack(const Allocator& alloc); // (5) C++26 template -stack(const Container& cont, const Allocator& alloc); // (6) C++11 +stack(const Container& cont, const Allocator& alloc); // (6) C++11 +template +constexpr stack(const Container& cont, const Allocator& alloc); // (6) C++26 template -stack(Container&& cont, const Allocator& alloc); // (7) C++11 +stack(Container&& cont, const Allocator& alloc); // (7) C++11 +template +constexpr stack(Container&& cont, const Allocator& alloc); // (7) C++26 template -stack(const stack& st, const Allocator& alloc); // (8) C++11 +stack(const stack& st, const Allocator& alloc); // (8) C++11 +template +constexpr stack(const stack& st, const Allocator& alloc); // (8) C++26 template -stack(stack&& st, const Allocator& alloc); // (9) C++11 +stack(stack&& st, const Allocator& alloc); // (9) C++11 +template +constexpr stack(stack&& st, const Allocator& alloc); // (9) C++26 template -stack(InputIterator first, InputIterator last, const Alloc&); // (10) C++23 +stack(InputIterator first, InputIterator last, const Alloc&); // (10) C++23 +template +constexpr stack(InputIterator first, InputIterator last, const Alloc&); // (10) C++26 template R> -stack(from_range_t, R&& rg); // (11) C++23 +stack(from_range_t, R&& rg); // (11) C++23 +template R> +constexpr stack(from_range_t, R&& rg); // (11) C++26 template R, class Alloc> -stack(from_range_t, R&& rg, const Alloc& alloc); // (12) C++23 +stack(from_range_t, R&& rg, const Alloc& alloc); // (12) C++23 +template R, class Alloc> +constexpr stack(from_range_t, R&& rg, const Alloc& alloc); // (12) C++26 ``` * from_range_t[link ../../ranges/from_range_t.md] @@ -117,3 +140,4 @@ int main() - C++20でのデフォルトコンストラクタの分離 - [P1425R4 Iterators pair constructors for stack and queue](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1425r4.pdf) - C++23でのイテレータペアへの対応 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/stack/stack/op_destructor.md b/reference/stack/stack/op_destructor.md index f2fe2c9b58..b6d84ae6a8 100644 --- a/reference/stack/stack/op_destructor.md +++ b/reference/stack/stack/op_destructor.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -~stack(); +~stack(); // (1) C++03 +constexpr ~stack(); // (1) C++26 ``` ## 概要 @@ -14,3 +15,7 @@ stack コンテナアダプタのオブジェクトを破棄する。 ## 計算量 線形時間 O(n) (全要素のデストラクタ呼び出し) + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/stack/stack/op_equal.md b/reference/stack/stack/op_equal.md index 535570e10b..d4b8291324 100644 --- a/reference/stack/stack/op_equal.md +++ b/reference/stack/stack/op_equal.md @@ -6,7 +6,9 @@ ```cpp namespace std { template - bool operator==(const stack& x, const stack& y); + bool operator==(const stack& x, const stack& y); // (1) C++03 + template + constexpr bool operator==(const stack& x, const stack& y); // (1) C++26 } ``` @@ -46,3 +48,4 @@ true ``` ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/stack/stack/op_greater.md b/reference/stack/stack/op_greater.md index 58d7e002c4..f3ed7e8282 100644 --- a/reference/stack/stack/op_greater.md +++ b/reference/stack/stack/op_greater.md @@ -6,7 +6,9 @@ ```cpp namespace std { template - bool operator> (const stack& x, const stack& y); + bool operator> (const stack& x, const stack& y); // (1) C++03 + template + constexpr bool operator> (const stack& x, const stack& y); // (1) C++26 } ``` @@ -46,3 +48,4 @@ false ``` ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/stack/stack/op_greater_equal.md b/reference/stack/stack/op_greater_equal.md index 8b65ff5238..45c28675ff 100644 --- a/reference/stack/stack/op_greater_equal.md +++ b/reference/stack/stack/op_greater_equal.md @@ -6,7 +6,9 @@ ```cpp namespace std { template - bool operator>=(const stack& x, const stack& y); + bool operator>=(const stack& x, const stack& y); // (1) C++03 + template + constexpr bool operator>=(const stack& x, const stack& y); // (1) C++26 } ``` @@ -46,3 +48,4 @@ false ``` ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/stack/stack/op_less.md b/reference/stack/stack/op_less.md index 34ee98ce25..ac1165547b 100644 --- a/reference/stack/stack/op_less.md +++ b/reference/stack/stack/op_less.md @@ -6,7 +6,9 @@ ```cpp namespace std { template - bool operator< (const stack& x, const stack& y); + bool operator< (const stack& x, const stack& y); // (1) C++03 + template + constexpr bool operator< (const stack& x, const stack& y); // (1) C++26 } ``` @@ -46,3 +48,4 @@ true ``` ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/stack/stack/op_less_equal.md b/reference/stack/stack/op_less_equal.md index cf11c43bb8..0b70ff9653 100644 --- a/reference/stack/stack/op_less_equal.md +++ b/reference/stack/stack/op_less_equal.md @@ -6,7 +6,9 @@ ```cpp namespace std { template - bool operator<=(const stack& x, const stack& y); + bool operator<=(const stack& x, const stack& y); // (1) C++03 + template + constexpr bool operator<=(const stack& x, const stack& y); // (1) C++26 } ``` @@ -46,3 +48,4 @@ true ``` ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/stack/stack/op_not_equal.md b/reference/stack/stack/op_not_equal.md index dd2ea49074..e1768421c5 100644 --- a/reference/stack/stack/op_not_equal.md +++ b/reference/stack/stack/op_not_equal.md @@ -6,7 +6,9 @@ ```cpp namespace std { template - bool operator!=(const stack& x, const stack& y); + bool operator!=(const stack& x, const stack& y); // (1) C++03 + template + constexpr bool operator!=(const stack& x, const stack& y); // (1) C++26 } ``` @@ -52,3 +54,4 @@ true ``` ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/stack/stack/pop.md b/reference/stack/stack/pop.md index 250fef22fa..5b8a5fb975 100644 --- a/reference/stack/stack/pop.md +++ b/reference/stack/stack/pop.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -void pop(); +void pop(); // (1) C++03 +constexpr void pop(); // (1) C++26 ``` ## 概要 @@ -59,3 +60,7 @@ Popping out elements... 4 3 2 1 0 ```cpp void pop() { c.pop_back(); } ``` + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/stack/stack/push.md b/reference/stack/stack/push.md index bbb16a832d..5a540916e0 100644 --- a/reference/stack/stack/push.md +++ b/reference/stack/stack/push.md @@ -5,8 +5,11 @@ * function[meta id-type] ```cpp -void push(const value_type& x); // (1) -void push(value_type&& x); // (2) C++11 +void push(const value_type& x); // (1) C++03 +constexpr void push(const value_type& x); // (1) C++26 + +void push(value_type&& x); // (2) C++11 +constexpr void push(value_type&& x); // (2) C++26 ``` ## 概要 @@ -71,3 +74,7 @@ int main() void push(const value_type& x) { c.push_back(x); } void push(value_type&& x) { c.push_back(std::move(x)); } ``` + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/stack/stack/push_range.md b/reference/stack/stack/push_range.md index 033c284071..9bc99b0f41 100644 --- a/reference/stack/stack/push_range.md +++ b/reference/stack/stack/push_range.md @@ -7,7 +7,9 @@ ```cpp template R> -void push_range(R&& rg); // C++23 +void push_range(R&& rg); // (1) C++23 +template R> +constexpr void push_range(R&& rg); // (1) C++26 ``` ## 概要 @@ -64,3 +66,7 @@ int main() | 名前 | 説明 | |-------------------|----------------| | [`push`](push.md) | 要素を追加する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/stack/stack/size.md b/reference/stack/stack/size.md index cc5094b419..12de0ea4f9 100644 --- a/reference/stack/stack/size.md +++ b/reference/stack/stack/size.md @@ -5,7 +5,8 @@ * function[meta id-type] ```cpp -size_type size() const; +size_type size() const; // (1) C++03 +constexpr size_type size() const; // (1) C++26 ``` ## 概要 @@ -69,3 +70,7 @@ size_type size() const { return c.size(); } | 名前 | 説明 | |-----------------------|--------------------------------| | [`empty`](empty.md) | コンテナが空であるかを確認する | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/stack/stack/swap.md b/reference/stack/stack/swap.md index 0455cd7c6d..e265e78f9f 100644 --- a/reference/stack/stack/swap.md +++ b/reference/stack/stack/swap.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -void swap(stack& s) noexcept(noexcept(swap(c, s.c))); +void swap(stack& s) noexcept(noexcept(swap(c, s.c))); // (1) C++11 +constexpr void swap(stack& s) noexcept(noexcept(swap(c, s.c))); // (1) C++26 ``` ## 概要 @@ -94,3 +95,4 @@ void swap(stack& s) noexcept(noexcept(swap(c, s.c))) ## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/stack/stack/swap_free.md b/reference/stack/stack/swap_free.md index 8cc1970f6d..41b6fbc576 100644 --- a/reference/stack/stack/swap_free.md +++ b/reference/stack/stack/swap_free.md @@ -7,7 +7,15 @@ ```cpp namespace std { template - void swap(stack& x, stack& y) noexcept(noexcept(x.swap(y))); + void + swap(stack& x, + stack& y) + noexcept(noexcept(x.swap(y))); // (1) C++11 + template + constexpr void + swap(stack& x, + stack& y) + noexcept(noexcept(x.swap(y))); // (1) C++26 } ``` @@ -87,3 +95,7 @@ y : 4 1 3 - [GCC](/implementation.md#gcc): 4.7.0 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/stack/stack/top.md b/reference/stack/stack/top.md index f9381f31b7..685050e1d0 100644 --- a/reference/stack/stack/top.md +++ b/reference/stack/stack/top.md @@ -5,8 +5,11 @@ * function[meta id-type] ```cpp -reference top(); -const_reference top() const; +reference top(); // (1) C++03 +constexpr reference top(); // (1) C++26 + +const_reference top() const; // (2) C++03 +constexpr const_reference top() const; // (2) C++26 ``` ## 概要 @@ -64,3 +67,7 @@ const_reference top() const { return c.back(); } |---------------------|------------| | [`push`](push.md) | 要素の追加 | | [`pop`](pop.md) | 要素の削除 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/at.md b/reference/unordered_map/unordered_map/at.md index abe0c2d105..7b0a593282 100644 --- a/reference/unordered_map/unordered_map/at.md +++ b/reference/unordered_map/unordered_map/at.md @@ -6,13 +6,17 @@ * cpp11[meta cpp] ```cpp -T& at(const key_type& x); // (1) C++11 -const T& at(const key_type& x) const; // (2) C++11 +T& at(const key_type& x); // (1) C++11 +constexpr T& at(const key_type& x); // (1) C++26 + +const T& at(const key_type& x) const; // (2) C++11 +constexpr const T& at(const key_type& x) const; // (2) C++26 template -T& at(const K& x); // (3) C++26 +constexpr T& at(const K& x); // (3) C++26 + template -const T& at(const K& x) const; // (4) C++26 +constexpr const T& at(const K& x) const; // (4) C++26 ``` ## 概要 @@ -108,3 +112,4 @@ exception std::out_of_range - [LWG Issue 761. `unordered_map` needs an `at()` member function](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#761) - [P2363R5 Extending associative containers with the remaining heterogeneous overloads](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2363r5.html) - C++26で`template `のバージョンが追加された +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/begin-size_type.md b/reference/unordered_map/unordered_map/begin-size_type.md index 3c53e4b12b..056e5f46f3 100644 --- a/reference/unordered_map/unordered_map/begin-size_type.md +++ b/reference/unordered_map/unordered_map/begin-size_type.md @@ -6,8 +6,11 @@ * cpp11[meta cpp] ```cpp -local_iterator begin(size_type n); -const_local_iterator begin(size_type n) const; +local_iterator begin(size_type n); // (1) C++11 +constexpr local_iterator begin(size_type n); // (1) C++26 + +const_local_iterator begin(size_type n) const; // (2) C++11 +constexpr const_local_iterator begin(size_type n) const; // (2) C++26 ``` ## 概要 @@ -99,3 +102,7 @@ bucket = 10, bucket_size = 1, keys = { A, } | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/begin.md b/reference/unordered_map/unordered_map/begin.md index 0dfc05f138..4c11709302 100644 --- a/reference/unordered_map/unordered_map/begin.md +++ b/reference/unordered_map/unordered_map/begin.md @@ -6,8 +6,11 @@ * cpp11[meta cpp] ```cpp -iterator begin() noexcept; -const_iterator begin() const noexcept; +iterator begin() noexcept; // (1) C++11 +constexpr iterator begin() noexcept; // (1) C++26 + +const_iterator begin() const noexcept; // (2) C++11 +constexpr const_iterator begin() const noexcept; // (2) C++26 ``` ## 概要 @@ -87,3 +90,7 @@ int main() | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/bucket.md b/reference/unordered_map/unordered_map/bucket.md index 0a02d5c0d5..f506e31560 100644 --- a/reference/unordered_map/unordered_map/bucket.md +++ b/reference/unordered_map/unordered_map/bucket.md @@ -6,10 +6,11 @@ * cpp11[meta cpp] ```cpp -size_type bucket(const key_type& k) const; // (1) C++11 +size_type bucket(const key_type& k) const; // (1) C++11 +constexpr size_type bucket(const key_type& k) const; // (1) C++26 template -size_type bucket(const K& k) const; // (2) C++26 +constexpr size_type bucket(const K& k) const; // (2) C++26 ``` ## 概要 @@ -114,3 +115,4 @@ key = H, bucket = 6, bucket_size = 0 ## 参照 - [P2363R5 Extending associative containers with the remaining heterogeneous overloads](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2363r5.html) - C++26で`template `のバージョンが追加された +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/bucket_count.md b/reference/unordered_map/unordered_map/bucket_count.md index 06ec609649..50a6b2911f 100644 --- a/reference/unordered_map/unordered_map/bucket_count.md +++ b/reference/unordered_map/unordered_map/bucket_count.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -size_type bucket_count() const noexcept; +size_type bucket_count() const noexcept; // (1) C++11 +constexpr size_type bucket_count() const noexcept; // (1) C++26 ``` ## 概要 @@ -72,3 +73,7 @@ bucket count is 11 | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/bucket_size.md b/reference/unordered_map/unordered_map/bucket_size.md index 00fcd58e03..5ddcd8338f 100644 --- a/reference/unordered_map/unordered_map/bucket_size.md +++ b/reference/unordered_map/unordered_map/bucket_size.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -size_type bucket_size(size_type n) const; +size_type bucket_size(size_type n) const; // (1) C++11 +constexpr size_type bucket_size(size_type n) const; // (1) C++26 ``` ## 概要 @@ -99,3 +100,7 @@ bucket = 10, bucket_size = 1, keys = { A, } | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/cbegin-size_type.md b/reference/unordered_map/unordered_map/cbegin-size_type.md index f627431445..bbc5308c77 100644 --- a/reference/unordered_map/unordered_map/cbegin-size_type.md +++ b/reference/unordered_map/unordered_map/cbegin-size_type.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_local_iterator cbegin(size_type n) const; +const_local_iterator cbegin(size_type n) const; // (1) C++11 +constexpr const_local_iterator cbegin(size_type n) const; // (1) C++26 ``` ## 概要 @@ -98,3 +99,7 @@ bucket = 10, bucket_size = 1, keys = { A, } | [`begin(size_type)`](begin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指すイテレータを取得 | | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/cbegin.md b/reference/unordered_map/unordered_map/cbegin.md index 09b5dbb821..966db055de 100644 --- a/reference/unordered_map/unordered_map/cbegin.md +++ b/reference/unordered_map/unordered_map/cbegin.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_iterator cbegin() const noexcept; +const_iterator cbegin() const noexcept; // (1) C++11 +constexpr const_iterator cbegin() const noexcept; // (1) C++26 ``` ## 概要 @@ -78,3 +79,7 @@ int main() | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/cend-size_type.md b/reference/unordered_map/unordered_map/cend-size_type.md index 7a4133d725..f602a9abad 100644 --- a/reference/unordered_map/unordered_map/cend-size_type.md +++ b/reference/unordered_map/unordered_map/cend-size_type.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_local_iterator cend(size_type n) const; +const_local_iterator cend(size_type n) const; // (1) C++11 +constexpr const_local_iterator cend(size_type n) const; // (1) C++26 ``` ## 概要 @@ -98,3 +99,7 @@ bucket = 10, bucket_size = 1, keys = { A, } | [`begin(size_type)`](begin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指すイテレータを取得 | | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/cend.md b/reference/unordered_map/unordered_map/cend.md index 29a7e04049..e35ba6c072 100644 --- a/reference/unordered_map/unordered_map/cend.md +++ b/reference/unordered_map/unordered_map/cend.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_iterator cend() const noexcept; +const_iterator cend() const noexcept; // (1) C++11 +constexpr const_iterator cend() const noexcept; // (1) C++26 ``` ## 概要 @@ -82,3 +83,7 @@ int main() | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/clear.md b/reference/unordered_map/unordered_map/clear.md index 366152e203..bf53d441a9 100644 --- a/reference/unordered_map/unordered_map/clear.md +++ b/reference/unordered_map/unordered_map/clear.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -void clear() noexcept; +void clear() noexcept; // (1) C++11 +constexpr void clear() noexcept; // (1) C++26 ``` ## 概要 @@ -99,3 +100,7 @@ true | [`insert`](insert.md) | 要素の追加 | | [`erase`](erase.md) | 要素の削除 | | [`swap`](swap.md) | 内容の交換 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/contains.md b/reference/unordered_map/unordered_map/contains.md index bce59c04c1..3724001279 100644 --- a/reference/unordered_map/unordered_map/contains.md +++ b/reference/unordered_map/unordered_map/contains.md @@ -6,10 +6,13 @@ * cpp20[meta cpp] ```cpp -bool contains(const key_type& x) const; // (1) +bool contains(const key_type& x) const; // (1) C++20 +constexpr bool contains(const key_type& x) const; // (1) C++26 template -bool contains(const K& k) const; // (2) +bool contains(const K& k) const; // (2) C++20 +template +constexpr bool contains(const K& k) const; // (2) C++26 ``` @@ -82,3 +85,4 @@ contain ## 参照 - [P0458R2 Checking for Existence of an Element in Associative Containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0458r2.html) - [P0919R3 Heterogeneous lookup for unordered containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0919r3.html) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/count.md b/reference/unordered_map/unordered_map/count.md index 83ba572345..11958362f2 100644 --- a/reference/unordered_map/unordered_map/count.md +++ b/reference/unordered_map/unordered_map/count.md @@ -6,10 +6,13 @@ * cpp11[meta cpp] ```cpp -size_type count(const key_type& x) const; // (1) C++11 +size_type count(const key_type& x) const; // (1) C++11 +constexpr size_type count(const key_type& x) const; // (1) C++26 template -size_type count(const K& k) const; // (2) C++20 +size_type count(const K& k) const; // (2) C++20 +template +constexpr size_type count(const K& k) const; // (2) C++26 ``` ## 概要 @@ -94,3 +97,4 @@ int main() ## 参照 - [LWG Issue 2304. Complexity of `count` in unordered associative containers](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2304) - [P0919R3 Heterogeneous lookup for unordered containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0919r3.html) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/emplace.md b/reference/unordered_map/unordered_map/emplace.md index 29f2e2fba7..7192d34a63 100644 --- a/reference/unordered_map/unordered_map/emplace.md +++ b/reference/unordered_map/unordered_map/emplace.md @@ -7,7 +7,9 @@ ```cpp template -pair emplace(Args&&... args); +pair emplace(Args&&... args); // (1) C++11 +template +constexpr pair emplace(Args&&... args); // (1) C++26 ``` ## 概要 @@ -160,3 +162,4 @@ int main() ## 参照 - [N2680 Proposed Wording for Placement Insert (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2680.pdf) - [LWG Issue 2156. Unordered containers' reserve(n) reserves for n-1 elements](https://wg21.cmeerw.net/lwg/issue2156) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/emplace_hint.md b/reference/unordered_map/unordered_map/emplace_hint.md index 289478d662..6bcd15e6cd 100644 --- a/reference/unordered_map/unordered_map/emplace_hint.md +++ b/reference/unordered_map/unordered_map/emplace_hint.md @@ -7,7 +7,9 @@ ```cpp template -iterator emplace_hint(const_iterator position, Args&&... args); +iterator emplace_hint(const_iterator position, Args&&... args); // (1) C++11 +template +constexpr iterator emplace_hint(const_iterator position, Args&&... args); // (1) C++26 ``` ## 概要 @@ -160,3 +162,4 @@ int main() ## 参照 - [N2680 Proposed Wording for Placement Insert (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2680.pdf) - [LWG Issue 2156. Unordered containers' reserve(n) reserves for n-1 elements](https://wg21.cmeerw.net/lwg/issue2156) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/empty.md b/reference/unordered_map/unordered_map/empty.md index fca5f7ee30..206cbcd50e 100644 --- a/reference/unordered_map/unordered_map/empty.md +++ b/reference/unordered_map/unordered_map/empty.md @@ -6,9 +6,9 @@ * cpp11[meta cpp] ```cpp -bool empty() const noexcept; // C++11 -[[nodiscard]] bool empty() const noexcept; // C++20 -bool empty() const noexcept; // C++26 +bool empty() const noexcept; // (1) C++11 +[[nodiscard]] bool empty() const noexcept; // (1) C++20 +constexpr bool empty() const noexcept; // (1) C++26 ``` ## 概要 @@ -97,3 +97,4 @@ inline bool unordered_map::empty() const noexcept { - C++20で`[[nodiscard]]`が付加された - [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) - C++26で`[[nodiscard]]`指定が削除された +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/end-size_type.md b/reference/unordered_map/unordered_map/end-size_type.md index 472bb9fec8..d9e236a6c0 100644 --- a/reference/unordered_map/unordered_map/end-size_type.md +++ b/reference/unordered_map/unordered_map/end-size_type.md @@ -6,8 +6,11 @@ * cpp11[meta cpp] ```cpp -local_iterator end(size_type n); -const_local_iterator end(size_type n) const; +local_iterator end(size_type n); // (1) C++11 +constexpr local_iterator end(size_type n); // (1) C++26 + +const_local_iterator end(size_type n) const; // (2) C++11 +constexpr const_local_iterator end(size_type n) const; // (2) C++26 ``` ## 概要 @@ -99,3 +102,7 @@ bucket = 10, bucket_size = 1, keys = { A, } | [`begin(size_type)`](begin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/end.md b/reference/unordered_map/unordered_map/end.md index 97b7ba066e..6a4861826f 100644 --- a/reference/unordered_map/unordered_map/end.md +++ b/reference/unordered_map/unordered_map/end.md @@ -6,8 +6,11 @@ * cpp11[meta cpp] ```cpp -iterator end() noexcept; -const_iterator end() const noexcept; +iterator end() noexcept; // (1) C++11 +constexpr iterator end() noexcept; // (1) C++26 + +const_iterator end() const noexcept; // (2) C++11 +constexpr const_iterator end() const noexcept; // (2) C++26 ``` ## 概要 @@ -89,3 +92,7 @@ int main() | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/equal_range.md b/reference/unordered_map/unordered_map/equal_range.md index 04c3e72976..81cd2e2518 100644 --- a/reference/unordered_map/unordered_map/equal_range.md +++ b/reference/unordered_map/unordered_map/equal_range.md @@ -7,16 +7,28 @@ ```cpp pair - equal_range(const key_type& x); // (1) C++11 + equal_range(const key_type& x); // (1) C++11 +constexpr pair + equal_range(const key_type& x); // (1) C++26 + pair equal_range(const key_type& x) const; // (2) C++11 +constexpr pair + equal_range(const key_type& x) const; // (2) C++26 template pair - equal_range(const K& k); // (3) C++20 + equal_range(const K& k); // (3) C++20 +template +constexpr pair + equal_range(const K& k); // (3) C++26 + template pair - equal_range(const K& k) const; // (4) C++20 + equal_range(const K& k) const; // (4) C++20 +template +constexpr pair + equal_range(const K& k) const; // (4) C++26 ``` ## 概要 @@ -119,3 +131,4 @@ up:1 ## 参照 - [P0919R3 Heterogeneous lookup for unordered containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0919r3.html) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/erase.md b/reference/unordered_map/unordered_map/erase.md index c1ec6e9a0f..339a1fc492 100644 --- a/reference/unordered_map/unordered_map/erase.md +++ b/reference/unordered_map/unordered_map/erase.md @@ -6,13 +6,17 @@ * cpp11[meta cpp] ```cpp -iterator erase(iterator position); // (1) C++17 +iterator erase(iterator position); // (1) C++17 +constexpr iterator erase(iterator position); // (1) C++26 -iterator erase(const_iterator position); // (2) C++11 +iterator erase(const_iterator position); // (2) C++11 +constexpr iterator erase(const_iterator position); // (2) C++26 -size_type erase(const key_type& k); // (3) C++11 +size_type erase(const key_type& k); // (3) C++11 +constexpr size_type erase(const key_type& k); // (3) C++26 -iterator erase(const_iterator first, const_iterator last); // (4) C++11 +iterator erase(const_iterator first, const_iterator last); // (4) C++11 +constexpr iterator erase(const_iterator first, const_iterator last); // (4) C++26 ``` ## 概要 @@ -215,3 +219,4 @@ int main() - [N2350 Container insert/erase and iterator constness (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2350.pdf) - [LWG Issue 2059. C++0x ambiguity problem with `map::erase`](https://cplusplus.github.io/LWG/issue2059) - C++17で、`erase(iterator)`を追加 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/erase_if_free.md b/reference/unordered_map/unordered_map/erase_if_free.md index c527dcc231..fd0866d2ea 100644 --- a/reference/unordered_map/unordered_map/erase_if_free.md +++ b/reference/unordered_map/unordered_map/erase_if_free.md @@ -8,7 +8,10 @@ namespace std { template typename unordered_map::size_type - erase_if(unordered_map& c, Predicate pred); + erase_if(unordered_map& c, Predicate pred); // (1) C++20 + template + constexpr typename unordered_map::size_type + erase_if(unordered_map& c, Predicate pred); // (1) C++26 } ``` @@ -84,3 +87,4 @@ int main() ## 参照 - [P1209R0 Adopt consistent container erasure from Library Fundamentals 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1209r0.html) - [R1115R3 Improving the Return Value of Erase-Like Algorithms II: Free `erase`/`erase_if`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1115r3.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/extract.md b/reference/unordered_map/unordered_map/extract.md index 2f907d40ae..292ff88065 100644 --- a/reference/unordered_map/unordered_map/extract.md +++ b/reference/unordered_map/unordered_map/extract.md @@ -6,8 +6,11 @@ * cpp17[meta cpp] ```cpp -node_type extract(const_iterator position); (1) -node_type extract(const key_type& x); (2) +node_type extract(const_iterator position); // (1) C++17 +constexpr node_type extract(const_iterator position); // (1) C++26 + +node_type extract(const key_type& x); // (2) C++17 +constexpr node_type extract(const key_type& x); // (2) C++26 ``` ## 概要 @@ -95,3 +98,4 @@ m2 : ## 参照 - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/find.md b/reference/unordered_map/unordered_map/find.md index 43066fc4f4..47bc757c35 100644 --- a/reference/unordered_map/unordered_map/find.md +++ b/reference/unordered_map/unordered_map/find.md @@ -6,11 +6,17 @@ * cpp11[meta cpp] ```cpp -iterator find(const key_type& x); // (1) C++11 -const_iterator find(const key_type& x) const; // (2) C++11 +iterator find(const key_type& x); // (1) C++11 +constexpr iterator find(const key_type& x); // (1) C++26 -template iterator find(const K& k); // (3) C++20 -template const_iterator find(const K& k) const; // (4) C++20 +const_iterator find(const key_type& x) const; // (2) C++11 +constexpr const_iterator find(const key_type& x) const; // (2) C++26 + +template iterator find(const K& k); // (3) C++20 +template constexpr iterator find(const K& k); // (3) C++26 + +template const_iterator find(const K& k) const; // (4) C++20 +template constexpr const_iterator find(const K& k) const; // (4) C++26 ``` ## 概要 @@ -92,3 +98,4 @@ int main() ## 参照 - [P0919R3 Heterogeneous lookup for unordered containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0919r3.html) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/get_allocator.md b/reference/unordered_map/unordered_map/get_allocator.md index 96189bf35c..d9f586f41d 100644 --- a/reference/unordered_map/unordered_map/get_allocator.md +++ b/reference/unordered_map/unordered_map/get_allocator.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -allocator_type get_allocator() const noexcept; +allocator_type get_allocator() const noexcept; // (1) C++11 +constexpr allocator_type get_allocator() const noexcept; // (1) C++26 ``` ## 概要 @@ -49,3 +50,7 @@ int main() - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - 2010は、`noexcept`が修飾されていない。 - 2012, 2013は、`noexcept`が実装されていないため、`throw()`が修飾されている。 + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/hash_function.md b/reference/unordered_map/unordered_map/hash_function.md index 8f0ff7ea72..278ae1613e 100644 --- a/reference/unordered_map/unordered_map/hash_function.md +++ b/reference/unordered_map/unordered_map/hash_function.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -hasher hash_function() const; +hasher hash_function() const; // (1) C++11 +constexpr hasher hash_function() const; // (1) C++26 ``` ## 概要 @@ -79,3 +80,7 @@ hash("2nd") = 12978775524054262047 |-----------------------------------------|------------------------------------------------------| | [`hash`](/reference/functional/hash.md) | デフォルトのハッシュ関数オブジェクト(class template) | | [`key_eq`](key_eq.md) | キー比較用関数オブジェクトの取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/insert.md b/reference/unordered_map/unordered_map/insert.md index e0283c3195..7b90433c37 100644 --- a/reference/unordered_map/unordered_map/insert.md +++ b/reference/unordered_map/unordered_map/insert.md @@ -6,25 +6,41 @@ * cpp11[meta cpp] ```cpp -pair insert(const value_type& v); // (1) -pair insert(value_type&& v); // (2) C++17 +pair insert(const value_type& v); // (1) C++11 +constexpr pair insert(const value_type& v); // (1) C++26 +pair insert(value_type&& v); // (2) C++17 +constexpr pair insert(value_type&& v); // (2) C++26 + +template +pair insert(P&& obj); // (3) C++11 template -pair insert(P&& obj); // (3) +constexpr pair insert(P&& obj); // (3) C++26 + +iterator insert(const_iterator position, const value_type& v); // (4) C++11 +constexpr iterator insert(const_iterator position, const value_type& v); // (4) C++26 -iterator insert(const_iterator position, const value_type& v); // (4) -iterator insert(const_iterator hint, value_type&& v); // (5) C++17 +iterator insert(const_iterator hint, value_type&& v); // (5) C++17 +constexpr iterator insert(const_iterator hint, value_type&& v); // (5) C++26 template -iterator insert(const_iterator position, P&& obj); // (6) +iterator insert(const_iterator position, P&& obj); // (6) C++11 +template +constexpr iterator insert(const_iterator position, P&& obj); // (6) C++26 template -void insert(InputIterator first, InputIterator last); // (7) +void insert(InputIterator first, InputIterator last); // (7) C++11 +template +constexpr void insert(InputIterator first, InputIterator last); // (7) C++26 + +void insert(initializer_list il); // (8) C++11 +constexpr void insert(initializer_list il); // (8) C++26 -void insert(initializer_list il); // (8) +insert_return_type insert(node_type&& nh); // (9) C++17 +constexpr insert_return_type insert(node_type&& nh); // (9) C++26 -insert_return_type insert(node_type&& nh); // (9) C++17 -iterator insert(const_iterator hint, node_type&& nh); // (10) C++17 +iterator insert(const_iterator hint, node_type&& nh); // (10) C++17 +constexpr iterator insert(const_iterator hint, node_type&& nh); // (10) C++26 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -314,3 +330,4 @@ inline void unordered_map::insert(initializer_list pair insert_or_assign(const key_type& k, - M&& obj); // (1) C++17 + M&& obj); // (1) C++17 +template +constexpr pair + insert_or_assign(const key_type& k, + M&& obj); // (1) C++26 template pair insert_or_assign(key_type&& k, - M&& obj); // (2) C++17 + M&& obj); // (2) C++17 +template +constexpr pair + insert_or_assign(key_type&& k, + M&& obj); // (2) C++26 template -pair +constexpr pair insert_or_assign(K&& k, - M&& obj); // (3) C++26 + M&& obj); // (3) C++26 template iterator insert_or_assign(const_iterator hint, const key_type& k, - M&& obj); // (4) C++17 + M&& obj); // (4) C++17 +template +constexpr iterator + insert_or_assign(const_iterator hint, + const key_type& k, + M&& obj); // (4) C++26 template iterator insert_or_assign(const_iterator hint, key_type&& k, - M&& obj); // (5) C++17 + M&& obj); // (5) C++17 +template +constexpr iterator + insert_or_assign(const_iterator hint, + key_type&& k, + M&& obj); // (5) C++26 template -iterator +constexpr iterator insert_or_assign(const_iterator hint, K&& k, - M&& obj); // (6) C++26 + M&& obj); // (6) C++26 ``` ## 概要 @@ -169,3 +187,4 @@ key = two, value = 42, is inserted = false, is empty = true - [N4279 Improved insertion interface for unique-key maps (Revision 2.3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4279.html) - [P2363R5 Extending associative containers with the remaining heterogeneous overloads](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2363r5.html) - C++26で`template `のバージョンが追加された +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/insert_range.md b/reference/unordered_map/unordered_map/insert_range.md index 00082d60e3..157a5afa9a 100644 --- a/reference/unordered_map/unordered_map/insert_range.md +++ b/reference/unordered_map/unordered_map/insert_range.md @@ -7,7 +7,9 @@ ```cpp template R> -void insert_range(R&& rg); // C++23 +void insert_range(R&& rg); // (1) C++23 +template R> +constexpr void insert_range(R&& rg); // (1) C++26 ``` ## 概要 @@ -73,3 +75,7 @@ A 10 |-------------------------------------------|----------------------| | [`insert`](insert.md) | 要素の追加 | | [`insert_or_assign`](insert_or_assign.md) | 要素の追加、あるいは代入 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/key_eq.md b/reference/unordered_map/unordered_map/key_eq.md index d7a7fa7986..ac631284d8 100644 --- a/reference/unordered_map/unordered_map/key_eq.md +++ b/reference/unordered_map/unordered_map/key_eq.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -key_equal key_eq() const; +key_equal key_eq() const; // (1) C++11 +constexpr key_equal key_eq() const; // (1) C++26 ``` ## 概要 @@ -77,3 +78,7 @@ eq("1st", "1st") = true |-------------------------------------------------|----------------------------------------------| | [`equal_to`](/reference/functional/equal_to.md) | 等値比較演算関数オブジェクト(class template) | | [`hash_function`](hash_function.md) | ハッシュ関数オブジェクトの取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/load_factor.md b/reference/unordered_map/unordered_map/load_factor.md index 7f9648efd1..01002676e8 100644 --- a/reference/unordered_map/unordered_map/load_factor.md +++ b/reference/unordered_map/unordered_map/load_factor.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -float load_factor() const noexcept; +float load_factor() const noexcept; // (1) C++11 +constexpr float load_factor() const noexcept; // (1) C++26 ``` ## 概要 @@ -88,3 +89,7 @@ current load_factor: 0.5 | [`size`](size.md) | 要素数の取得 | | [`bucket_count`](bucket_count.md) | バケット数の取得 | | [`max_load_factor`](max_load_factor.md) | 負荷率の最大値を取得、設定 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/max_bucket_count.md b/reference/unordered_map/unordered_map/max_bucket_count.md index 1e85abe2ae..8fdfdd0a43 100644 --- a/reference/unordered_map/unordered_map/max_bucket_count.md +++ b/reference/unordered_map/unordered_map/max_bucket_count.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -size_type max_bucket_count() const noexcept; +size_type max_bucket_count() const noexcept; // (1) C++11 +constexpr size_type max_bucket_count() const noexcept; // (1) C++26 ``` ## 概要 @@ -66,3 +67,7 @@ max bucket count is 576460752303423487 | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/max_load_factor.md b/reference/unordered_map/unordered_map/max_load_factor.md index 10d9abdf06..df9e36868f 100644 --- a/reference/unordered_map/unordered_map/max_load_factor.md +++ b/reference/unordered_map/unordered_map/max_load_factor.md @@ -6,8 +6,11 @@ * cpp11[meta cpp] ```cpp -float max_load_factor() const noexcept; // (1) -void max_load_factor(float z); // (2) +float max_load_factor() const noexcept; // (1) C++11 +constexpr float max_load_factor() const noexcept; // (1) C++26 + +void max_load_factor(float z); // (2) C++11 +constexpr void max_load_factor(float z); // (2) C++26 ``` ## 概要 @@ -139,3 +142,7 @@ new load_factor: 1.125 | [`size`](size.md) | 要素数の取得 | | [`bucket_count`](bucket_count.md) | バケット数の取得 | | [`clear`](clear.md) | 全要素の削除 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/max_size.md b/reference/unordered_map/unordered_map/max_size.md index ff55d71924..a4ad105fac 100644 --- a/reference/unordered_map/unordered_map/max_size.md +++ b/reference/unordered_map/unordered_map/max_size.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -size_type max_size() const noexcept; +size_type max_size() const noexcept; // (1) C++11 +constexpr size_type max_size() const noexcept; // (1) C++26 ``` ## 概要 @@ -66,3 +67,7 @@ libstdc++ では、コンテナのアロケータ `allocator_type` にメンバ |-----------------------|----------------------------| | [`empty`](empty.md) | コンテナが空かどうかを判定 | | [`size`](size.md) | 要素数の取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/merge.md b/reference/unordered_map/unordered_map/merge.md index 7bbd0083e6..548e3b7c41 100644 --- a/reference/unordered_map/unordered_map/merge.md +++ b/reference/unordered_map/unordered_map/merge.md @@ -7,13 +7,24 @@ ```cpp template - void merge(unordered_map& source); // (1) +void merge(unordered_map& source); // (1) C++17 template - void merge(unordered_map&& source); // (2) +constexpr void merge(unordered_map& source); // (1) C++26 + +template +void merge(unordered_map&& source); // (2) C++17 +template +constexpr void merge(unordered_map&& source); // (2) C++26 + +template +void merge(unordered_multimap& source); // (3) C++17 +template +constexpr void merge(unordered_multimap& source); // (3) C++26 + template - void merge(unordered_multimap& source); // (3) +void merge(unordered_multimap&& source); // (4) C++17 template - void merge(unordered_multimap&& source); // (4) +constexpr void merge(unordered_multimap&& source); // (4) C++26 ``` ## 概要 @@ -93,3 +104,4 @@ m2 : ## 参照 - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/op_assign.md b/reference/unordered_map/unordered_map/op_assign.md index 34f376dae7..7fb59fd31e 100644 --- a/reference/unordered_map/unordered_map/op_assign.md +++ b/reference/unordered_map/unordered_map/op_assign.md @@ -6,13 +6,21 @@ * cpp11[meta cpp] ```cpp -unordered_map& operator=(const unordered_map& v); // (1) -unordered_map& operator=(unordered_map&& rv); // (2) +unordered_map& operator=(const unordered_map& v); // (1) C++11 +constexpr unordered_map& operator=(const unordered_map& v); // (1) C++26 + +unordered_map& operator=(unordered_map&& rv); // (2) C++11 unordered_map& operator=(unordered_map&& x) noexcept(allocator_traits::is_always_equal::value && is_nothrow_move_assignable::value - && is_nothrow_move_assignable::value); // (2) C++17 -unordered_map& operator=(initializer_list il); // (3) + && is_nothrow_move_assignable::value); // (2) C++17 +constexpr unordered_map& operator=(unordered_map&& x) + noexcept(allocator_traits::is_always_equal::value + && is_nothrow_move_assignable::value + && is_nothrow_move_assignable::value); // (2) C++26 + +unordered_map& operator=(initializer_list il); // (3) C++11 +constexpr unordered_map& operator=(initializer_list il); // (3) C++26 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -95,3 +103,4 @@ unordered_map& operator=(initializer_list il); // (3) - (3)の経緯となる提案文書 - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) - `noexcept` 追加の経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/op_at.md b/reference/unordered_map/unordered_map/op_at.md index a06ea79464..84b0cbca19 100644 --- a/reference/unordered_map/unordered_map/op_at.md +++ b/reference/unordered_map/unordered_map/op_at.md @@ -6,12 +6,14 @@ * cpp11[meta cpp] ```cpp -T& operator[](const key_type& x); // (1) C++11 +T& operator[](const key_type& x); // (1) C++11 +constexpr T& operator[](const key_type& x); // (1) C++26 -T& operator[](key_type&& x); // (2) C++11 +T& operator[](key_type&& x); // (2) C++11 +constexpr T& operator[](key_type&& x); // (2) C++26 template -T& operator[](K&& k); // (3) C++26 +constexpr T& operator[](K&& k); // (3) C++26 ``` ## 概要 @@ -103,3 +105,4 @@ size=2 ## 参照 - [P2363R5 Extending associative containers with the remaining heterogeneous overloads](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2363r5.html) - C++26で`template `のバージョンが追加された +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/op_constructor.md b/reference/unordered_map/unordered_map/op_constructor.md index 327e7af737..81f1479b88 100644 --- a/reference/unordered_map/unordered_map/op_constructor.md +++ b/reference/unordered_map/unordered_map/op_constructor.md @@ -6,89 +6,167 @@ * cpp11[meta cpp] ```cpp -unordered_map(); // (1) C++14 - -explicit unordered_map(size_type n, - const hasher& hf = hasher(), - const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); // (2) C++14 - -explicit unordered_map(size_type n = 実装依存の既定値, - const hasher& hf = hasher(), - const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); // (1) + (2) C++11 +unordered_map(); // (1) C++14 +constexpr unordered_map(); // (1) C++26 + +explicit + unordered_map(size_type n, + const hasher& hf = hasher(), + const key_equal& eql = key_equal(), + const allocator_type& a = allocator_type()); // (2) C++14 +constexpr explicit + unordered_map(size_type n, + const hasher& hf = hasher(), + const key_equal& eql = key_equal(), + const allocator_type& a = allocator_type()); // (2) C++26 + +explicit + unordered_map(size_type n = 実装依存の既定値, + const hasher& hf = hasher(), + const key_equal& eql = key_equal(), + const allocator_type& a = allocator_type()); // (1) + (2) C++11 template unordered_map(InputIterator first, InputIterator last, size_type n = 実装依存の既定値, const hasher& hf = hasher(), const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); // (3) + const allocator_type& a = allocator_type()); // (3) C++11 +template +constexpr + unordered_map(InputIterator first, InputIterator last, + size_type n = 実装依存の既定値, + const hasher& hf = hasher(), + const key_equal& eql = key_equal(), + const allocator_type& a = allocator_type()); // (3) C++26 -unordered_map(const unordered_map& v); // (4) +unordered_map(const unordered_map& v); // (4) C++11 +constexpr unordered_map(const unordered_map& v); // (4) C++26 -unordered_map(unordered_map&& rv); // (5) +unordered_map(unordered_map&& rv); // (5) C++11 +constexpr unordered_map(unordered_map&& rv); // (5) C++26 -explicit unordered_map(const allocator_type& a); // (6) +explicit unordered_map(const allocator_type& a); // (6) C++11 +constexpr explicit unordered_map(const allocator_type& a); // (6) C++26 -unordered_map(const unordered_map& v, const allocator_type& a); // (7) unordered_map(const unordered_map& v, - const type_identity_t& a); // (7) C++23 + const allocator_type& a); // (7) C++11 +unordered_map(const unordered_map& v, + const type_identity_t& a); // (7) C++23 +constexpr + unordered_map(const unordered_map& v, + const type_identity_t& a); // (7) C++26 -unordered_map(unordered_map&& rv, const allocator_type& a); // (8) unordered_map(unordered_map&& rv, - const type_identity_t& a); // (8) C++23 + const allocator_type& a); // (8) C++11 +unordered_map(unordered_map&& rv, + const type_identity_t& a); // (8) C++23 +constexpr + unordered_map(unordered_map&& rv, + const type_identity_t& a); // (8) C++26 unordered_map(initializer_list il, size_type n = 実装依存の既定値, const hasher& hf = hasher(), const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); // (9) + const allocator_type& a = allocator_type()); // (9) C++11 +constexpr + unordered_map(initializer_list il, + size_type n = 実装依存の既定値, + const hasher& hf = hasher(), + const key_equal& eql = key_equal(), + const allocator_type& a = allocator_type()); // (9) C++26 + +unordered_map(size_type n, const allocator_type& a); // (10) C++14 +constexpr unordered_map(size_type n, const allocator_type& a); // (10) C++26 -unordered_map(size_type n, const allocator_type& a); // (10) C++14 unordered_map(size_type n, const hasher& hf, - const allocator_type& a); // (11) C++14 + const allocator_type& a); // (11) C++14 +constexpr + unordered_map(size_type n, + const hasher& hf, + const allocator_type& a); // (11) C++26 template unordered_map(InputIterator f, InputIterator l, size_type n, - const allocator_type& a); // (12) C++14 + const allocator_type& a); // (12) C++14 +template +constexpr + unordered_map(InputIterator f, + InputIterator l, + size_type n, + const allocator_type& a); // (12) C++26 template unordered_map(InputIterator f, InputIterator l, size_type n, - const hasher& hf, - const allocator_type& a); // (13) C++14 + const hasher& hf, + const allocator_type& a); // (13) C++14 +template +constexpr + unordered_map(InputIterator f, + InputIterator l, + size_type n, + const hasher& hf, + const allocator_type& a); // (13) C++26 unordered_map(initializer_list il, size_type n, - const allocator_type& a); // (14) C++14 + const allocator_type& a); // (14) C++14 +constexpr + unordered_map(initializer_list il, + size_type n, + const allocator_type& a); // (14) C++26 unordered_map(initializer_list il, size_type n, - const hasher& hf, - const allocator_type& a); // (15) C++14 + const hasher& hf, + const allocator_type& a); // (15) C++14 +constexpr + unordered_map(initializer_list il, + size_type n, + const hasher& hf, + const allocator_type& a); // (15) C++26 template R> unordered_map(std::from_range_t, R&& rg, size_type n = 実装依存の既定値, const hasher& hf = hasher(), const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); // (16) C++23 + const allocator_type& a = allocator_type()); // (16) C++23 +template R> +constexpr + unordered_map(std::from_range_t, R&& rg, + size_type n = 実装依存の既定値, + const hasher& hf = hasher(), + const key_equal& eql = key_equal(), + const allocator_type& a = allocator_type()); // (16) C++26 template R> unordered_map(std::from_range_t, R&& rg, size_type n, - const allocator_type& a); // (17) C++23 + const allocator_type& a); // (17) C++23 +template R> +constexpr + unordered_map(std::from_range_t, R&& rg, + size_type n, + const allocator_type& a); // (17) C++26 template R> unordered_map(std::from_range_t, R&& rg, size_type n, const hasher& hf, - const allocator_type& a); // (18) C++23 + const allocator_type& a); // (18) C++23 +template R> +constexpr + unordered_map(std::from_range_t, R&& rg, + size_type n, + const hasher& hf, + const allocator_type& a); // (18) C++26 ``` * type_identity_t[link /reference/type_traits/type_identity.md] * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -271,3 +349,4 @@ libstdc++ には 4.8.2 現在、(6), (7), (8)の形式はない。 なお、Discussion の例はアロケータの型が誤っているので注意 - [P1518R2 Stop Overconstraining Allocators in Container Deduction Guides](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1518r2.html) - C++23でのアロケータ引数を`type_identity_t`で包む変更 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/op_destructor.md b/reference/unordered_map/unordered_map/op_destructor.md index 89fbc8e0fc..e6d23ed7ec 100644 --- a/reference/unordered_map/unordered_map/op_destructor.md +++ b/reference/unordered_map/unordered_map/op_destructor.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -~unordered_map(); +~unordered_map(); // (1) C++11 +constexpr ~unordered_map(); // (1) C++26 ``` ## 概要 @@ -37,3 +38,7 @@ |---------------------------------------|----------------| | [`(constructor)`](op_constructor.md) | コンストラクタ | | [`operator=`](op_assign.md) | 代入演算子 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/op_equal.md b/reference/unordered_map/unordered_map/op_equal.md index c18ac50c20..05d077269a 100644 --- a/reference/unordered_map/unordered_map/op_equal.md +++ b/reference/unordered_map/unordered_map/op_equal.md @@ -9,6 +9,9 @@ namespace std { template bool operator==(const unordered_map& a, const unordered_map& b); // (1) C++11 + template + constexpr bool operator==(const unordered_map& a, + const unordered_map& b); // (1) C++26 } ``` @@ -90,3 +93,4 @@ int main() - [P0809R0 Comparing Unordered Containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0809r0.pdf) - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/op_not_equal.md b/reference/unordered_map/unordered_map/op_not_equal.md index f9283c6aba..b6a6374cd5 100644 --- a/reference/unordered_map/unordered_map/op_not_equal.md +++ b/reference/unordered_map/unordered_map/op_not_equal.md @@ -10,6 +10,9 @@ namespace std { template bool operator!=(const unordered_map& a, const unordered_map& b); // (1) C++11 + template + constexpr bool operator!=(const unordered_map& a, + const unordered_map& b); // (1) C++26 } ``` @@ -84,3 +87,4 @@ int main() - [P0809R0 Comparing Unordered Containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0809r0.pdf) - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/rehash.md b/reference/unordered_map/unordered_map/rehash.md index 7f3d4a489e..f81bd9a47e 100644 --- a/reference/unordered_map/unordered_map/rehash.md +++ b/reference/unordered_map/unordered_map/rehash.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -void rehash(size_type n); +void rehash(size_type n); // (1) C++11 +constexpr void rehash(size_type n); // (1) C++26 ``` ## 概要 @@ -126,3 +127,4 @@ new load_factor: 0.363636 ## 参照 - [LWG Issue 2156. Unordered containers' reserve(n) reserves for n-1 elements](https://wg21.cmeerw.net/lwg/issue2156) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/reserve.md b/reference/unordered_map/unordered_map/reserve.md index 464c33c00f..f212161894 100644 --- a/reference/unordered_map/unordered_map/reserve.md +++ b/reference/unordered_map/unordered_map/reserve.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -void reserve(size_type n); +void reserve(size_type n); // (1) C++11 +constexpr void reserve(size_type n); // (1) C++26 ``` ## 概要 @@ -130,3 +131,4 @@ new load_factor: 0.363636 ## 参照 - [LWG Issue 2156. Unordered containers' reserve(n) reserves for n-1 elements](https://wg21.cmeerw.net/lwg/issue2156) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/size.md b/reference/unordered_map/unordered_map/size.md index 6db820a97c..5b9ff367f4 100644 --- a/reference/unordered_map/unordered_map/size.md +++ b/reference/unordered_map/unordered_map/size.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -size_type size() const noexcept; +size_type size() const noexcept; // (1) C++11 +constexpr size_type size() const noexcept; // (1) C++26 ``` ## 概要 @@ -71,3 +72,7 @@ int main() | [`begin`](begin.md) | 先頭要素を指すイテレータの取得 | | [`end`](end.md) | 最終要素の次を指すイテレータの取得 | | [`distance`](/reference/iterator/distance.md) | イテレータ間の距離を求める | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/swap.md b/reference/unordered_map/unordered_map/swap.md index ef254865d9..8d44cd9139 100644 --- a/reference/unordered_map/unordered_map/swap.md +++ b/reference/unordered_map/unordered_map/swap.md @@ -6,11 +6,15 @@ * cpp11[meta cpp] ```cpp -void swap(unordered_map& v); +void swap(unordered_map& v); // (1) C++11 void swap(unordered_map& x) noexcept(allocator_traits::is_always_equal::value && noexcept(swap(declval(),declval())) - && noexcept(swap(declval(),declval()))); // C++17 + && noexcept(swap(declval(),declval()))); // (1) C++17 +constexpr void swap(unordered_map& x) + noexcept(allocator_traits::is_always_equal::value + && noexcept(swap(declval(),declval())) + && noexcept(swap(declval(),declval()))); // (1) C++26 ``` ## 概要 @@ -119,3 +123,4 @@ um2 after : (9th, 9), (7th, 7), (5th, 5), (3rd, 3), (1st, 1), ## 参照 - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) - `noexcept` 追加の経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/swap_free.md b/reference/unordered_map/unordered_map/swap_free.md index 198cc2f4c5..d2019a05cb 100644 --- a/reference/unordered_map/unordered_map/swap_free.md +++ b/reference/unordered_map/unordered_map/swap_free.md @@ -7,20 +7,26 @@ ```cpp namespace std { template - void swap (unordered_map& x, - unordered_map& y); - + void + swap(unordered_map& x, + unordered_map& y); // (1) C++11 + template + void + swap(unordered_map& x, + unordered_map& y) + noexcept(noexcept(x.swap(y))); // (1) C++17 template - void swap (unordered_map& x, - unordered_map& y) - noexcept(noexcept(x.swap(y))); // C++17 + constexpr void + swap(unordered_map& x, + unordered_map& y) + noexcept(noexcept(x.swap(y))); // (1) C++26 } ``` ## 概要 -2つの `unordered_map` オブジェクトである `x` と 'y'が保持するコンテンツを交換する。サイズは異なる場合もある。 +2つの `unordered_map` オブジェクトである `x` と `y` が保持するコンテンツを交換する。サイズは異なる場合もある。 -このメンバ関数の呼び出しの後、呼び出し前に 'x' にあった要素は `y` へ、`y` 内にあった要素は `x` へ移る。全てのイテレータ、参照、ポインタは有効なまま残る。 +このメンバ関数の呼び出しの後、呼び出し前に `x` にあった要素は `y` へ、`y` 内にあった要素は `x` へ移る。全てのイテレータ、参照、ポインタは有効なまま残る。 ## 効果 @@ -95,3 +101,4 @@ um2 : {[10,a], [20,b], [30,c], } ## 参照 - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) - `noexcept` 追加の経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_map/try_emplace.md b/reference/unordered_map/unordered_map/try_emplace.md index 745b32dd22..cd6f205400 100644 --- a/reference/unordered_map/unordered_map/try_emplace.md +++ b/reference/unordered_map/unordered_map/try_emplace.md @@ -9,35 +9,53 @@ template pair try_emplace(const key_type& k, - Args&&... args); // (1) C++17 + Args&&... args); // (1) C++17 +template +constexpr pair + try_emplace(const key_type& k, + Args&&... args); // (1) C++26 template pair try_emplace(key_type&& k, - Args&&... args); // (2) C++17 + Args&&... args); // (2) C++17 +template +constexpr pair + try_emplace(key_type&& k, + Args&&... args); // (2) C++26 template -pair +constexpr pair try_emplace(K&& k, - Args&&... args); // (3) C++26 + Args&&... args); // (3) C++26 template iterator try_emplace(const_iterator hint, const key_type& k, - Args&&... args); // (4) C++17 + Args&&... args); // (4) C++17 +template +constexpr iterator + try_emplace(const_iterator hint, + const key_type& k, + Args&&... args); // (4) C++26 template iterator try_emplace(const_iterator hint, key_type&& k, - Args&&... args); // (5) C++17 + Args&&... args); // (5) C++17 +template +constexpr iterator + try_emplace(const_iterator hint, + key_type&& k, + Args&&... args); // (5) C++26 template -iterator +constexpr iterator try_emplace(const_iterator hint, K&& k, - Args&&... args); // (6) C++26 + Args&&... args); // (6) C++26 ``` ## 概要 @@ -175,3 +193,4 @@ key = two, value = 2, is inserted = false, is empty = false - [N4279 Improved insertion interface for unique-key maps (Revision 2.3)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4279.html) - [P2363R5: Extending associative containers with the remaining heterogeneous overloads](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2363r5.html) - C++26で`template `のバージョンが追加された +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/begin-size_type.md b/reference/unordered_map/unordered_multimap/begin-size_type.md index f9382ae5d1..cae678b002 100644 --- a/reference/unordered_map/unordered_multimap/begin-size_type.md +++ b/reference/unordered_map/unordered_multimap/begin-size_type.md @@ -6,8 +6,11 @@ * cpp11[meta cpp] ```cpp -local_iterator begin(size_type n); -const_local_iterator begin(size_type n) const; +local_iterator begin(size_type n); // (1) C++11 +constexpr local_iterator begin(size_type n); // (1) C++26 + +const_local_iterator begin(size_type n) const; // (2) C++11 +constexpr const_local_iterator begin(size_type n) const; // (2) C++26 ``` ## 概要 @@ -99,3 +102,7 @@ bucket = 10, bucket_size = 1, keys = { A, } | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/begin.md b/reference/unordered_map/unordered_multimap/begin.md index 3adc360f8d..d8152674f9 100644 --- a/reference/unordered_map/unordered_multimap/begin.md +++ b/reference/unordered_map/unordered_multimap/begin.md @@ -6,8 +6,11 @@ * cpp11[meta cpp] ```cpp -iterator begin() noexcept; -const_iterator begin() const noexcept; +iterator begin() noexcept; // (1) C++11 +constexpr iterator begin() noexcept; // (1) C++26 + +const_iterator begin() const noexcept; // (2) C++11 +constexpr const_iterator begin() const noexcept; // (2) C++26 ``` ## 概要 @@ -87,3 +90,7 @@ int main() | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/bucket.md b/reference/unordered_map/unordered_multimap/bucket.md index 245a20b5e4..da6b875c1e 100644 --- a/reference/unordered_map/unordered_multimap/bucket.md +++ b/reference/unordered_map/unordered_multimap/bucket.md @@ -6,10 +6,10 @@ * cpp11[meta cpp] ```cpp -size_type bucket(const key_type& k) const; // (1) C++26 +constexpr size_type bucket(const key_type& k) const; // (1) C++26 template -size_type bucket(const K& k) const; // (2) C++26 +constexpr size_type bucket(const K& k) const; // (2) C++26 ``` ## 概要 @@ -113,3 +113,4 @@ key = H, bucket = 6, bucket_size = 0 ## 参照 - [P2363R5 Extending associative containers with the remaining heterogeneous overloads](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2363r5.html) - C++26で`template `のバージョンが追加された +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/bucket_count.md b/reference/unordered_map/unordered_multimap/bucket_count.md index 07f816186f..5f3f581634 100644 --- a/reference/unordered_map/unordered_multimap/bucket_count.md +++ b/reference/unordered_map/unordered_multimap/bucket_count.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -size_type bucket_count() const noexcept; +size_type bucket_count() const noexcept; // (1) C++11 +constexpr size_type bucket_count() const noexcept; // (1) C++26 ``` ## 概要 @@ -72,3 +73,7 @@ bucket count is 11 | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/bucket_size.md b/reference/unordered_map/unordered_multimap/bucket_size.md index 5488d668a8..5806dcc3f3 100644 --- a/reference/unordered_map/unordered_multimap/bucket_size.md +++ b/reference/unordered_map/unordered_multimap/bucket_size.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -size_type bucket_size(size_type n) const; +size_type bucket_size(size_type n) const; // (1) C++11 +constexpr size_type bucket_size(size_type n) const; // (1) C++26 ``` ## 概要 @@ -99,3 +100,7 @@ bucket = 10, bucket_size = 1, keys = { A, } | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/cbegin-size_type.md b/reference/unordered_map/unordered_multimap/cbegin-size_type.md index dee4c28034..586585f0b2 100644 --- a/reference/unordered_map/unordered_multimap/cbegin-size_type.md +++ b/reference/unordered_map/unordered_multimap/cbegin-size_type.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_local_iterator cbegin(size_type n) const; +const_local_iterator cbegin(size_type n) const; // (1) C++11 +constexpr const_local_iterator cbegin(size_type n) const; // (1) C++26 ``` ## 概要 @@ -98,3 +99,7 @@ bucket = 10, bucket_size = 1, keys = { A, } | [`begin(size_type)`](begin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指すイテレータを取得 | | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/cbegin.md b/reference/unordered_map/unordered_multimap/cbegin.md index 1e74cab432..8ef508d698 100644 --- a/reference/unordered_map/unordered_multimap/cbegin.md +++ b/reference/unordered_map/unordered_multimap/cbegin.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_iterator cbegin() const noexcept; +const_iterator cbegin() const noexcept; // (1) C++11 +constexpr const_iterator cbegin() const noexcept; // (1) C++26 ``` ## 概要 @@ -78,3 +79,7 @@ int main() | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/cend-size_type.md b/reference/unordered_map/unordered_multimap/cend-size_type.md index 5af72e4b19..df73a601aa 100644 --- a/reference/unordered_map/unordered_multimap/cend-size_type.md +++ b/reference/unordered_map/unordered_multimap/cend-size_type.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_local_iterator cend(size_type n) const; +const_local_iterator cend(size_type n) const; // (1) C++11 +constexpr const_local_iterator cend(size_type n) const; // (1) C++26 ``` ## 概要 @@ -98,3 +99,7 @@ bucket = 10, bucket_size = 1, keys = { A, } | [`begin(size_type)`](begin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指すイテレータを取得 | | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/cend.md b/reference/unordered_map/unordered_multimap/cend.md index 6439d2e1a4..844da39cc1 100644 --- a/reference/unordered_map/unordered_multimap/cend.md +++ b/reference/unordered_map/unordered_multimap/cend.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_iterator cend() const noexcept; +const_iterator cend() const noexcept; // (1) C++11 +constexpr const_iterator cend() const noexcept; // (1) C++26 ``` ## 概要 @@ -82,3 +83,7 @@ int main() | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/clear.md b/reference/unordered_map/unordered_multimap/clear.md index 2870682a99..a47db14495 100644 --- a/reference/unordered_map/unordered_multimap/clear.md +++ b/reference/unordered_map/unordered_multimap/clear.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -void clear() noexcept; +void clear() noexcept; // (1) C++11 +constexpr void clear() noexcept; // (1) C++26 ``` ## 概要 @@ -99,3 +100,7 @@ true | [`insert`](insert.md) | 要素の追加 | | [`erase`](erase.md) | 要素の削除 | | [`swap`](swap.md) | 内容の交換 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/contains.md b/reference/unordered_map/unordered_multimap/contains.md index 7aea1e1ffe..20c3d015fc 100644 --- a/reference/unordered_map/unordered_multimap/contains.md +++ b/reference/unordered_map/unordered_multimap/contains.md @@ -6,10 +6,13 @@ * cpp20[meta cpp] ```cpp -bool contains(const key_type& x) const; // (1) +bool contains(const key_type& x) const; // (1) C++20 +constexpr bool contains(const key_type& x) const; // (1) C++26 template -bool contains(const K& k) const; // (2) +bool contains(const K& k) const; // (2) C++20 +template +constexpr bool contains(const K& k) const; // (2) C++26 ``` ## 概要 @@ -81,3 +84,4 @@ contain ## 参照 - [P0458R2 Checking for Existence of an Element in Associative Containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0458r2.html) - [P0919R3 Heterogeneous lookup for unordered containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0919r3.html) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/count.md b/reference/unordered_map/unordered_multimap/count.md index 0b3d80ddd6..2d4743f384 100644 --- a/reference/unordered_map/unordered_multimap/count.md +++ b/reference/unordered_map/unordered_multimap/count.md @@ -6,10 +6,13 @@ * cpp11[meta cpp] ```cpp -size_type count(const key_type& x) const; // (1) C++11 +size_type count(const key_type& x) const; // (1) C++11 +constexpr size_type count(const key_type& x) const; // (1) C++26 template -size_type count(const K& k) const; // (2) C++20 +size_type count(const K& k) const; // (2) C++20 +template +constexpr size_type count(const K& k) const; // (2) C++26 ``` ## 概要 @@ -96,3 +99,4 @@ int main() ## 参照 - [LWG Issue 2304. Complexity of `count` in unordered associative containers](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2304) - [P0919R3 Heterogeneous lookup for unordered containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0919r3.html) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/emplace.md b/reference/unordered_map/unordered_multimap/emplace.md index a82e8787c9..01973672f9 100644 --- a/reference/unordered_map/unordered_multimap/emplace.md +++ b/reference/unordered_map/unordered_multimap/emplace.md @@ -7,7 +7,9 @@ ```cpp template -iterator emplace(Args&&... args); +iterator emplace(Args&&... args); // (1) C++11 +template +constexpr iterator emplace(Args&&... args); // (1) C++26 ``` ## 概要 @@ -149,3 +151,4 @@ int main() - [LWG Issue 518. Are `insert` and `erase` stable for `unordered_multiset` and `unordered_multimap`?](https://wg21.cmeerw.net/lwg/issue518) - 安定性の保証が規定された経緯のレポート - [LWG Issue 2156. Unordered containers' reserve(n) reserves for n-1 elements](https://wg21.cmeerw.net/lwg/issue2156) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/emplace_hint.md b/reference/unordered_map/unordered_multimap/emplace_hint.md index cfdd45f73c..769550ad5e 100644 --- a/reference/unordered_map/unordered_multimap/emplace_hint.md +++ b/reference/unordered_map/unordered_multimap/emplace_hint.md @@ -7,7 +7,9 @@ ```cpp template -iterator emplace_hint(const_iterator position, Args&&... args); +iterator emplace_hint(const_iterator position, Args&&... args); // (1) C++11 +template +constexpr iterator emplace_hint(const_iterator position, Args&&... args); // (1) C++26 ``` ## 概要 @@ -181,3 +183,4 @@ int main() - [LWG Issue 518. Are `insert` and `erase` stable for `unordered_multiset` and `unordered_multimap`?](https://wg21.cmeerw.net/lwg/issue518) - 安定性の保証が規定された経緯のレポート - [LWG Issue 2156. Unordered containers' reserve(n) reserves for n-1 elements](https://wg21.cmeerw.net/lwg/issue2156) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/empty.md b/reference/unordered_map/unordered_multimap/empty.md index 248fea3638..815391c5fc 100644 --- a/reference/unordered_map/unordered_multimap/empty.md +++ b/reference/unordered_map/unordered_multimap/empty.md @@ -6,9 +6,9 @@ * cpp11[meta cpp] ```cpp -bool empty() const noexcept; // C++11 -[[nodiscard]] bool empty() const noexcept; // C++20 -bool empty() const noexcept; // C++26 +bool empty() const noexcept; // (1) C++11 +[[nodiscard]] bool empty() const noexcept; // (1) C++20 +constexpr bool empty() const noexcept; // (1) C++26 ``` ## 概要 @@ -97,3 +97,4 @@ inline bool unordered_multimap::empty() const noexce - C++20で`[[nodiscard]]`が付加された - [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) - C++26で`[[nodiscard]]`指定が削除された +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/end-size_type.md b/reference/unordered_map/unordered_multimap/end-size_type.md index d64967b78a..1bbb0ad154 100644 --- a/reference/unordered_map/unordered_multimap/end-size_type.md +++ b/reference/unordered_map/unordered_multimap/end-size_type.md @@ -6,8 +6,11 @@ * cpp11[meta cpp] ```cpp -local_iterator end(size_type n); -const_local_iterator end(size_type n) const; +local_iterator end(size_type n); // (1) C++11 +constexpr local_iterator end(size_type n); // (1) C++26 + +const_local_iterator end(size_type n) const; // (2) C++11 +constexpr const_local_iterator end(size_type n) const; // (2) C++26 ``` ## 概要 @@ -99,3 +102,7 @@ bucket = 10, bucket_size = 1, keys = { A, } | [`begin(size_type)`](begin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/end.md b/reference/unordered_map/unordered_multimap/end.md index 7fb3083fb4..b28e2fb58a 100644 --- a/reference/unordered_map/unordered_multimap/end.md +++ b/reference/unordered_map/unordered_multimap/end.md @@ -6,8 +6,11 @@ * cpp11[meta cpp] ```cpp -iterator end() noexcept; -const_iterator end() const noexcept; +iterator end() noexcept; // (1) C++11 +constexpr iterator end() noexcept; // (1) C++26 + +const_iterator end() const noexcept; // (2) C++11 +constexpr const_iterator end() const noexcept; // (2) C++26 ``` ## 概要 @@ -89,3 +92,7 @@ int main() | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/equal_range.md b/reference/unordered_map/unordered_multimap/equal_range.md index 605189fbb8..b29096a74e 100644 --- a/reference/unordered_map/unordered_multimap/equal_range.md +++ b/reference/unordered_map/unordered_multimap/equal_range.md @@ -7,16 +7,28 @@ ```cpp pair - equal_range(const key_type& x); // (1) C++11 + equal_range(const key_type& x); // (1) C++11 +constexpr pair + equal_range(const key_type& x); // (1) C++26 + pair equal_range(const key_type& x) const; // (2) C++11 +constexpr pair + equal_range(const key_type& x) const; // (2) C++26 template pair - equal_range(const K& k); // (3) C++20 + equal_range(const K& k); // (3) C++20 +template +constexpr pair + equal_range(const K& k); // (3) C++26 + template pair - equal_range(const K& k) const; // (4) C++20 + equal_range(const K& k) const; // (4) C++20 +template +constexpr pair + equal_range(const K& k) const; // (4) C++26 ``` ## 概要 @@ -124,3 +136,4 @@ second:1 ## 参照 - [P0919R3 Heterogeneous lookup for unordered containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0919r3.html) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/erase.md b/reference/unordered_map/unordered_multimap/erase.md index 770804ef19..dac6320c1c 100644 --- a/reference/unordered_map/unordered_multimap/erase.md +++ b/reference/unordered_map/unordered_multimap/erase.md @@ -6,13 +6,17 @@ * cpp11[meta cpp] ```cpp -iterator erase(iterator position); // (1) C++17 +iterator erase(iterator position); // (1) C++17 +constexpr iterator erase(iterator position); // (1) C++26 -iterator erase(const_iterator position); // (2) C++11 +iterator erase(const_iterator position); // (2) C++11 +constexpr iterator erase(const_iterator position); // (2) C++26 -size_type erase(const key_type& k); // (3) C++11 +size_type erase(const key_type& k); // (3) C++11 +constexpr size_type erase(const key_type& k); // (3) C++26 -iterator erase(const_iterator first, const_iterator last); // (4) C++11 +iterator erase(const_iterator first, const_iterator last); // (4) C++11 +constexpr iterator erase(const_iterator first, const_iterator last); // (4) C++26 ``` ## 概要 @@ -217,3 +221,4 @@ int main() - 安定性の保証が規定された経緯のレポート - [LWG Issue 2059. C++0x ambiguity problem with `map::erase`](https://cplusplus.github.io/LWG/issue2059) - C++17で、`erase(iterator)`を追加 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/erase_if_free.md b/reference/unordered_map/unordered_multimap/erase_if_free.md index c12017d40c..2eecc54004 100644 --- a/reference/unordered_map/unordered_multimap/erase_if_free.md +++ b/reference/unordered_map/unordered_multimap/erase_if_free.md @@ -8,7 +8,10 @@ namespace std { template typename unordered_multimap::size_type - erase_if(unordered_multimap& c, Predicate pred); + erase_if(unordered_multimap& c, Predicate pred); // (1) C++20 + template + constexpr typename unordered_multimap::size_type + erase_if(unordered_multimap& c, Predicate pred); // (1) C++26 } ``` @@ -85,3 +88,4 @@ int main() ## 参照 - [P1209R0 Adopt consistent container erasure from Library Fundamentals 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1209r0.html) - [R1115R3 Improving the Return Value of Erase-Like Algorithms II: Free `erase`/`erase_if`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1115r3.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/extract.md b/reference/unordered_map/unordered_multimap/extract.md index 75a371680a..5fa8213dc2 100644 --- a/reference/unordered_map/unordered_multimap/extract.md +++ b/reference/unordered_map/unordered_multimap/extract.md @@ -6,8 +6,11 @@ * cpp17[meta cpp] ```cpp -node_type extract(const_iterator position); (1) -node_type extract(const key_type& x); (2) +node_type extract(const_iterator position); // (1) C++17 +constexpr node_type extract(const_iterator position); // (1) C++26 + +node_type extract(const key_type& x); // (2) C++17 +constexpr node_type extract(const key_type& x); // (2) C++26 ``` ## 概要 @@ -96,3 +99,4 @@ m2 : ## 参照 - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/find.md b/reference/unordered_map/unordered_multimap/find.md index 219cf82262..f52a1f1e23 100644 --- a/reference/unordered_map/unordered_multimap/find.md +++ b/reference/unordered_map/unordered_multimap/find.md @@ -6,11 +6,17 @@ * cpp11[meta cpp] ```cpp -iterator find(const key_type& x); // (1) C++11 -const_iterator find(const key_type& x) const; // (2) C++11 +iterator find(const key_type& x); // (1) C++11 +constexpr iterator find(const key_type& x); // (1) C++26 -template iterator find(const K& k); // (3) C++20 -template const_iterator find(const K& k) const; // (4) C++20 +const_iterator find(const key_type& x) const; // (2) C++11 +constexpr const_iterator find(const key_type& x) const; // (2) C++26 + +template iterator find(const K& k); // (3) C++20 +template constexpr iterator find(const K& k); // (3) C++26 + +template const_iterator find(const K& k) const; // (4) C++20 +template constexpr const_iterator find(const K& k) const; // (4) C++26 ``` ## 概要 @@ -95,3 +101,4 @@ int main() ## 参照 - [P0919R3 Heterogeneous lookup for unordered containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0919r3.html) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/get_allocator.md b/reference/unordered_map/unordered_multimap/get_allocator.md index 2d51cacb04..d20562660d 100644 --- a/reference/unordered_map/unordered_multimap/get_allocator.md +++ b/reference/unordered_map/unordered_multimap/get_allocator.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -allocator_type get_allocator() const noexcept; +allocator_type get_allocator() const noexcept; // (1) C++11 +constexpr allocator_type get_allocator() const noexcept; // (1) C++26 ``` ## 概要 @@ -49,3 +50,7 @@ int main() - [Visual C++](/implementation.md#visual_cpp): 2010 [mark verified], 2012 [mark verified], 2013 [mark verified], 2015 [mark verified], 2017 [mark verified] - 2010は、`noexcept`が修飾されていない。 - 2012, 2013は、`noexcept`が実装されていないため、`throw()`が修飾されている。 + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/hash_function.md b/reference/unordered_map/unordered_multimap/hash_function.md index 547bfbcb9d..194fbaceae 100644 --- a/reference/unordered_map/unordered_multimap/hash_function.md +++ b/reference/unordered_map/unordered_multimap/hash_function.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -hasher hash_function() const; +hasher hash_function() const; // (1) C++11 +constexpr hasher hash_function() const; // (1) C++26 ``` ## 概要 @@ -79,3 +80,7 @@ hash("2nd") = 12978775524054262047 |-----------------------------------------|------------------------------------------------------| | [`hash`](/reference/functional/hash.md) | デフォルトのハッシュ関数オブジェクト(class template) | | [`key_eq`](key_eq.md) | キー比較用関数オブジェクトの取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/insert.md b/reference/unordered_map/unordered_multimap/insert.md index f537e665eb..2dfcf1e491 100644 --- a/reference/unordered_map/unordered_multimap/insert.md +++ b/reference/unordered_map/unordered_multimap/insert.md @@ -6,25 +6,41 @@ * cpp11[meta cpp] ```cpp -iterator insert(const value_type& v); // (1) -iterator insert(value_type&& v); // (2) C++17 +iterator insert(const value_type& v); // (1) C++11 +constexpr iterator insert(const value_type& v); // (1) C++26 +iterator insert(value_type&& v); // (2) C++17 +constexpr iterator insert(value_type&& v); // (2) C++26 + +template +iterator insert(P&& obj); // (3) C++11 template -iterator insert(P&& obj); // (3) +constexpr iterator insert(P&& obj); // (3) C++26 + +iterator insert(const_iterator position, const value_type& v); // (4) C++11 +constexpr iterator insert(const_iterator position, const value_type& v); // (4) C++26 -iterator insert(const_iterator position, const value_type& v); // (4) -iterator insert(const_iterator hint, value_type&& v); // (5) C++17 +iterator insert(const_iterator hint, value_type&& v); // (5) C++17 +constexpr iterator insert(const_iterator hint, value_type&& v); // (5) C++26 template -iterator insert(const_iterator position, P&& obj); // (6) +iterator insert(const_iterator position, P&& obj); // (6) C++11 +template +constexpr iterator insert(const_iterator position, P&& obj); // (6) C++26 template -void insert(InputIterator first, InputIterator last); // (7) +void insert(InputIterator first, InputIterator last); // (7) C++11 +template +constexpr void insert(InputIterator first, InputIterator last); // (7) C++26 + +void insert(initializer_list il); // (8) C++11 +constexpr void insert(initializer_list il); // (8) C++26 -void insert(initializer_list il); // (8) +iterator insert(node_type&& nh); // (9) C++17 +constexpr iterator insert(node_type&& nh); // (9) C++26 -iterator insert(node_type&& nh); // (9) C++17 -iterator insert(const_iterator hint, node_type&& nh); // (10) C++17 +iterator insert(const_iterator hint, node_type&& nh); // (10) C++17 +constexpr iterator insert(const_iterator hint, node_type&& nh); // (10) C++26 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -306,3 +322,4 @@ inline void unordered_multimap::insert(initializer_l - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) - (9), (10)経緯となる提案文書 - [How useful is the hint passed to the std::unordered_... collections? - The Old New Thing](https://devblogs.microsoft.com/oldnewthing/20241028-00/?p=110428) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/insert_range.md b/reference/unordered_map/unordered_multimap/insert_range.md index 3aacccda91..9d242a4082 100644 --- a/reference/unordered_map/unordered_multimap/insert_range.md +++ b/reference/unordered_map/unordered_multimap/insert_range.md @@ -7,7 +7,9 @@ ```cpp template R> -void insert_range(R&& rg); // C++23 +void insert_range(R&& rg); // (1) C++23 +template R> +constexpr void insert_range(R&& rg); // (1) C++26 ``` ## 概要 @@ -73,3 +75,7 @@ A 10 | 名前 | 説明 | |-------------------------------------------|----------------------| | [`insert`](insert.md) | 要素の追加 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/key_eq.md b/reference/unordered_map/unordered_multimap/key_eq.md index c7d20c3d32..2db5d9d578 100644 --- a/reference/unordered_map/unordered_multimap/key_eq.md +++ b/reference/unordered_map/unordered_multimap/key_eq.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -key_equal key_eq() const; +key_equal key_eq() const; // (1) C++11 +constexpr key_equal key_eq() const; // (1) C++26 ``` ## 概要 @@ -77,3 +78,7 @@ eq("1st", "1st") = true |----------------------------------------------------|----------------------------------------------| | [`equal_to`](/reference/functional/equal_to.md) | 等値比較演算関数オブジェクト(class template) | | [`hash_function`](hash_function.md) | ハッシュ関数オブジェクトの取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/load_factor.md b/reference/unordered_map/unordered_multimap/load_factor.md index 6f933d721b..dfab35f11a 100644 --- a/reference/unordered_map/unordered_multimap/load_factor.md +++ b/reference/unordered_map/unordered_multimap/load_factor.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -float load_factor() const noexcept; +float load_factor() const noexcept; // (1) C++11 +constexpr float load_factor() const noexcept; // (1) C++26 ``` ## 概要 @@ -89,3 +90,7 @@ current load_factor: 0.5 | [`size`](size.md) | 要素数の取得 | | [`bucket_count`](bucket_count.md) | バケット数の取得 | | [`max_load_factor`](max_load_factor.md) | 負荷率の最大値を取得、設定 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/max_bucket_count.md b/reference/unordered_map/unordered_multimap/max_bucket_count.md index 98182b12a1..cde8db0b28 100644 --- a/reference/unordered_map/unordered_multimap/max_bucket_count.md +++ b/reference/unordered_map/unordered_multimap/max_bucket_count.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -size_type max_bucket_count() const noexcept; +size_type max_bucket_count() const noexcept; // (1) C++11 +constexpr size_type max_bucket_count() const noexcept; // (1) C++26 ``` ## 概要 @@ -66,3 +67,7 @@ max bucket count is 576460752303423487 | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/max_load_factor.md b/reference/unordered_map/unordered_multimap/max_load_factor.md index f9ec4b3bba..2597b9f9dd 100644 --- a/reference/unordered_map/unordered_multimap/max_load_factor.md +++ b/reference/unordered_map/unordered_multimap/max_load_factor.md @@ -6,8 +6,11 @@ * cpp11[meta cpp] ```cpp -float max_load_factor() const noexcept; // (1) -void max_load_factor(float z); // (2) +float max_load_factor() const noexcept; // (1) C++11 +constexpr float max_load_factor() const noexcept; // (1) C++26 + +void max_load_factor(float z); // (2) C++11 +constexpr void max_load_factor(float z); // (2) C++26 ``` ## 概要 @@ -141,3 +144,7 @@ new load_factor: 1.125 | [`size`](size.md) | 要素数の取得 | | [`bucket_count`](bucket_count.md) | バケット数の取得 | | [`clear`](clear.md) | 全要素の削除 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/max_size.md b/reference/unordered_map/unordered_multimap/max_size.md index add2a7b7f2..ef8b15e273 100644 --- a/reference/unordered_map/unordered_multimap/max_size.md +++ b/reference/unordered_map/unordered_multimap/max_size.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -size_type max_size() const noexcept; +size_type max_size() const noexcept; // (1) C++11 +constexpr size_type max_size() const noexcept; // (1) C++26 ``` ## 概要 @@ -66,3 +67,7 @@ libstdc++ では、コンテナのアロケータ `allocator_type` にメンバ |-----------------------|----------------------------| | [`empty`](empty.md) | コンテナが空かどうかを判定 | | [`size`](size.md) | 要素数の取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/merge.md b/reference/unordered_map/unordered_multimap/merge.md index 35ff96846a..2c39db2f93 100644 --- a/reference/unordered_map/unordered_multimap/merge.md +++ b/reference/unordered_map/unordered_multimap/merge.md @@ -7,13 +7,24 @@ ```cpp template - void merge(unordered_map& source); // (1) +void merge(unordered_map& source); // (1) C++17 template - void merge(unordered_map&& source); // (2) +constexpr void merge(unordered_map& source); // (1) C++26 + +template +void merge(unordered_map&& source); // (2) C++17 +template +constexpr void merge(unordered_map&& source); // (2) C++26 + +template +void merge(unordered_multimap& source); // (3) C++17 +template +constexpr void merge(unordered_multimap& source); // (3) C++26 + template - void merge(unordered_multimap& source); // (3) +void merge(unordered_multimap&& source); // (4) C++17 template - void merge(unordered_multimap&& source); // (4) +constexpr void merge(unordered_multimap&& source); // (4) C++26 ``` ## 概要 @@ -92,3 +103,4 @@ m2 : ## 参照 - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/op_assign.md b/reference/unordered_map/unordered_multimap/op_assign.md index 0c9c0ee7ec..f49ff0741c 100644 --- a/reference/unordered_map/unordered_multimap/op_assign.md +++ b/reference/unordered_map/unordered_multimap/op_assign.md @@ -6,13 +6,21 @@ * cpp11[meta cpp] ```cpp -unordered_multimap& operator=(const unordered_multimap& v); // (1) -unordered_multimap& operator=(unordered_multimap&& rv); // (2) +unordered_multimap& operator=(const unordered_multimap& v); // (1) C++11 +constexpr unordered_multimap& operator=(const unordered_multimap& v); // (1) C++26 + +unordered_multimap& operator=(unordered_multimap&& rv); // (2) C++11 unordered_multimap& operator=(unordered_multimap&& x) noexcept(allocator_traits::is_always_equal::value && is_nothrow_move_assignable::value - && is_nothrow_move_assignable::value); // (2) C++17 -unordered_multimap& operator=(initializer_list il); // (3) + && is_nothrow_move_assignable::value); // (2) C++17 +constexpr unordered_multimap& operator=(unordered_multimap&& x) + noexcept(allocator_traits::is_always_equal::value + && is_nothrow_move_assignable::value + && is_nothrow_move_assignable::value); // (2) C++26 + +unordered_multimap& operator=(initializer_list il); // (3) C++11 +constexpr unordered_multimap& operator=(initializer_list il); // (3) C++26 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -95,3 +103,4 @@ unordered_multimap& operator=(initializer_list il); // (3) - (3)の経緯となる提案文書 - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) - `noexcept` 追加の経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/op_constructor.md b/reference/unordered_map/unordered_multimap/op_constructor.md index 02ab86d18f..92d8fcce7d 100644 --- a/reference/unordered_map/unordered_multimap/op_constructor.md +++ b/reference/unordered_map/unordered_multimap/op_constructor.md @@ -6,92 +6,169 @@ * cpp11[meta cpp] ```cpp -unordered_multimap(); // (1) C++14 - -explicit unordered_multimap(size_type n, - const hasher& hf = hasher(), - const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); // (2) C++14 - -explicit unordered_multimap(size_type n = 実装依存の既定値, - const hasher& hf = hasher(), - const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); // (1) + (2) C++11 +unordered_multimap(); // (1) C++14 +constexpr unordered_multimap(); // (1) C++26 + +explicit + unordered_multimap(size_type n, + const hasher& hf = hasher(), + const key_equal& eql = key_equal(), + const allocator_type& a = allocator_type()); // (2) C++14 +constexpr explicit + unordered_multimap(size_type n, + const hasher& hf = hasher(), + const key_equal& eql = key_equal(), + const allocator_type& a = allocator_type()); // (2) C++26 + +explicit + unordered_multimap(size_type n = 実装依存の既定値, + const hasher& hf = hasher(), + const key_equal& eql = key_equal(), + const allocator_type& a = allocator_type()); // (1) + (2) C++11 template -unordered_multimap(InputIterator first, InputIterator last, +unordered_multimap(InputIterator first, + InputIterator last, size_type n = 実装依存の既定値, const hasher& hf = hasher(), const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); // (3) + const allocator_type& a = allocator_type()); // (3) C++11 +template +constexpr + unordered_multimap(InputIterator first, + InputIterator last, + size_type n = 実装依存の既定値, + const hasher& hf = hasher(), + const key_equal& eql = key_equal(), + const allocator_type& a = allocator_type()); // (3) C++26 -unordered_multimap(const unordered_multimap& v); // (4) +unordered_multimap(const unordered_multimap& v); // (4) C++11 +constexpr unordered_multimap(const unordered_multimap& v); // (4) C++26 -unordered_multimap(unordered_multimap&& rv); // (5) +unordered_multimap(unordered_multimap&& rv); // (5) C++11 +constexpr unordered_multimap(unordered_multimap&& rv); // (5) C++26 -explicit unordered_multimap(const allocator_type& a); // (6) +explicit unordered_multimap(const allocator_type& a); // (6) C++11 +constexpr explicit unordered_multimap(const allocator_type& a); // (6) C++26 unordered_multimap(const unordered_multimap& v, - const allocator_type& a); // (7) + const allocator_type& a); // (7) C++11 unordered_multimap(const unordered_multimap& v, - const type_identity_t& a); // (7) C++23 + const type_identity_t& a); // (7) C++23 +constexpr + unordered_multimap(const unordered_multimap& v, + const type_identity_t& a); // (7) C++26 unordered_multimap(unordered_multimap&& rv, - const allocator_type& a); // (8) + const allocator_type& a); // (8) C++11 unordered_multimap(unordered_multimap&& rv, - const type_identity_t& a); // (8) C++23 + const type_identity_t& a); // (8) C++23 +constexpr + unordered_multimap(unordered_multimap&& rv, + const type_identity_t& a); // (8) C++26 unordered_multimap(initializer_list il, size_type n = 実装依存の既定値, const hasher& hf = hasher(), const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); // (9) + const allocator_type& a = allocator_type()); // (9) C++11 +constexpr + unordered_multimap(initializer_list il, + size_type n = 実装依存の既定値, + const hasher& hf = hasher(), + const key_equal& eql = key_equal(), + const allocator_type& a = allocator_type()); // (9) C++26 -unordered_multimap(size_type n, const allocator_type& a); // (10) C++14 +unordered_multimap(size_type n, const allocator_type& a); // (10) C++14 +constexpr unordered_multimap(size_type n, const allocator_type& a); // (10) C++26 unordered_multimap(size_type n, const hasher& hf, - const allocator_type& a); // (11) C++14 + const allocator_type& a); // (11) C++14 +constexpr + unordered_multimap(size_type n, + const hasher& hf, + const allocator_type& a); // (11) C++26 template unordered_multimap(InputIterator f, InputIterator l, size_type n, - const allocator_type& a); // (12) C++14 + const allocator_type& a); // (12) C++14 +template +constexpr + unordered_multimap(InputIterator f, + InputIterator l, + size_type n, + const allocator_type& a); // (12) C++26 template unordered_multimap(InputIterator f, InputIterator l, size_type n, - const hasher& hf, - const allocator_type& a); // (13) C++14 + const hasher& hf, + const allocator_type& a); // (13) C++14 +template +constexpr + unordered_multimap(InputIterator f, + InputIterator l, + size_type n, + const hasher& hf, + const allocator_type& a); // (13) C++26 unordered_multimap(initializer_list il, size_type n, - const allocator_type& a); // (14) C++14 + const allocator_type& a); // (14) C++14 +constexpr + unordered_multimap(initializer_list il, + size_type n, + const allocator_type& a); // (14) C++26 unordered_multimap(initializer_list il, size_type n, - const hasher& hf, - const allocator_type& a); // (15) C++14 + const hasher& hf, + const allocator_type& a); // (15) C++14 +constexpr + unordered_multimap(initializer_list il, + size_type n, + const hasher& hf, + const allocator_type& a); // (15) C++26 template R> unordered_multimap(std::from_range_t, R&& rg, size_type n = 実装依存の既定値, const hasher& hf = hasher(), const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); // (16) C++23 + const allocator_type& a = allocator_type()); // (16) C++23 +template R> +constexpr + unordered_multimap(std::from_range_t, R&& rg, + size_type n = 実装依存の既定値, + const hasher& hf = hasher(), + const key_equal& eql = key_equal(), + const allocator_type& a = allocator_type()); // (16) C++26 template R> unordered_multimap(std::from_range_t, R&& rg, size_type n, - const allocator_type& a); // (17) C++23 + const allocator_type& a); // (17) C++23 +template R> +constexpr + unordered_multimap(std::from_range_t, R&& rg, + size_type n, + const allocator_type& a); // (17) C++26 template R> unordered_multimap(std::from_range_t, R&& rg, size_type n, const hasher& hf, - const allocator_type& a); // (18) C++23 + const allocator_type& a); // (18) C++23 +template R> +constexpr + unordered_multimap(std::from_range_t, R&& rg, + size_type n, + const hasher& hf, + const allocator_type& a); // (18) C++26 ``` * type_identity_t[link /reference/type_traits/type_identity.md] * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -277,3 +354,4 @@ libstdc++ には 4.8.2 現在、(6), (7), (8)の形式はない。 なお、Discussion の例はアロケータの型が誤っているので注意 - [P1518R2 Stop Overconstraining Allocators in Container Deduction Guides](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1518r2.html) - C++23でのアロケータ引数を`type_identity_t`で包む変更 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/op_destructor.md b/reference/unordered_map/unordered_multimap/op_destructor.md index fb60b50d2f..2e286f0478 100644 --- a/reference/unordered_map/unordered_multimap/op_destructor.md +++ b/reference/unordered_map/unordered_multimap/op_destructor.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -~unordered_multimap(); +~unordered_multimap(); // (1) C++11 +constexpr ~unordered_multimap(); // (1) C++26 ``` ## 概要 @@ -37,3 +38,7 @@ |--------------------------------------------|----------------| | [`(constructor)`](op_constructor.md) | コンストラクタ | | [`operator=`](op_assign.md) | 代入演算子 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/op_equal.md b/reference/unordered_map/unordered_multimap/op_equal.md index 379ca8e684..be6756bad7 100644 --- a/reference/unordered_map/unordered_multimap/op_equal.md +++ b/reference/unordered_map/unordered_multimap/op_equal.md @@ -9,6 +9,9 @@ namespace std { template bool operator==(const unordered_multimap& a, const unordered_multimap& b); // (1) C++11 + template + constexpr bool operator==(const unordered_multimap& a, + const unordered_multimap& b); // (1) C++26 } ``` @@ -94,3 +97,4 @@ int main() - [P0809R0 Comparing Unordered Containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0809r0.pdf) - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/op_not_equal.md b/reference/unordered_map/unordered_multimap/op_not_equal.md index 825509c6b3..65d5b94702 100644 --- a/reference/unordered_map/unordered_multimap/op_not_equal.md +++ b/reference/unordered_map/unordered_multimap/op_not_equal.md @@ -10,6 +10,9 @@ namespace std { template bool operator!=(const unordered_multimap& a, const unordered_multimap& b); // (1) C++11 + template + constexpr bool operator!=(const unordered_multimap& a, + const unordered_multimap& b); // (1) C++26 } ``` @@ -95,3 +98,4 @@ int main() - [P0809R0 Comparing Unordered Containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0809r0.pdf) - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/rehash.md b/reference/unordered_map/unordered_multimap/rehash.md index 8db1407938..9b2b32da96 100644 --- a/reference/unordered_map/unordered_multimap/rehash.md +++ b/reference/unordered_map/unordered_multimap/rehash.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -void rehash(size_type n); +void rehash(size_type n); // (1) C++11 +constexpr void rehash(size_type n); // (1) C++26 ``` ## 概要 @@ -126,3 +127,4 @@ new load_factor: 0.363636 ## 参照 - [LWG Issue 2156. Unordered containers' reserve(n) reserves for n-1 elements](https://wg21.cmeerw.net/lwg/issue2156) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/reserve.md b/reference/unordered_map/unordered_multimap/reserve.md index e4c13bac6e..8a904456a6 100644 --- a/reference/unordered_map/unordered_multimap/reserve.md +++ b/reference/unordered_map/unordered_multimap/reserve.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -void reserve(size_type n); +void reserve(size_type n); // (1) C++11 +constexpr void reserve(size_type n); // (1) C++26 ``` ## 概要 @@ -130,3 +131,4 @@ new load_factor: 0.363636 ## 参照 - [LWG Issue 2156. Unordered containers' reserve(n) reserves for n-1 elements](https://wg21.cmeerw.net/lwg/issue2156) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/size.md b/reference/unordered_map/unordered_multimap/size.md index 5b99081eb9..e3ebd3bdd7 100644 --- a/reference/unordered_map/unordered_multimap/size.md +++ b/reference/unordered_map/unordered_multimap/size.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -size_type size() const noexcept; +size_type size() const noexcept; // (1) C++11 +constexpr size_type size() const noexcept; // (1) C++26 ``` ## 概要 @@ -71,3 +72,7 @@ int main() | [`begin`](begin.md) | 先頭要素を指すイテレータの取得 | | [`end`](end.md) | 最終要素の次を指すイテレータの取得 | | [`distance`](/reference/iterator/distance.md) | イテレータ間の距離を求める | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/swap.md b/reference/unordered_map/unordered_multimap/swap.md index 7c63516753..ee4be96973 100644 --- a/reference/unordered_map/unordered_multimap/swap.md +++ b/reference/unordered_map/unordered_multimap/swap.md @@ -6,11 +6,15 @@ * cpp11[meta cpp] ```cpp -void swap(unordered_multimap& v); +void swap(unordered_multimap& v); // (1) C++11 void swap(unordered_multimap& x) noexcept(allocator_traits::is_always_equal::value && noexcept(swap(declval(),declval())) - && noexcept(swap(declval(),declval()))); // C++17 + && noexcept(swap(declval(),declval()))); // (1) C++17 +constexpr void swap(unordered_multimap& x) + noexcept(allocator_traits::is_always_equal::value + && noexcept(swap(declval(),declval())) + && noexcept(swap(declval(),declval()))); // (1) C++26 ``` ## 概要 @@ -119,3 +123,4 @@ um2 after : (7th, 7), (7th, 7), (5th, 5), (5th, 5), (9th, 9), (9th, 9), (3rd, 3) ## 参照 - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) - `noexcept` 追加の経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_map/unordered_multimap/swap_free.md b/reference/unordered_map/unordered_multimap/swap_free.md index 9ad6bc6fea..74c6622ff1 100644 --- a/reference/unordered_map/unordered_multimap/swap_free.md +++ b/reference/unordered_map/unordered_multimap/swap_free.md @@ -7,20 +7,26 @@ ```cpp namespace std { template - void swap (unordered_multimap& x, - unordered_multimap& y); - + void + swap(unordered_multimap& x, + unordered_multimap& y); // (1) C++11 + template + void + swap(unordered_multimap& x, + unordered_multimap& y) + noexcept(noexcept(x.swap(y))); // (1) C++17 template - void swap (unordered_multimap& x, - unordered_multimap& y) - noexcept(noexcept(x.swap(y))); // C++17 + constexpr void + swap(unordered_multimap& x, + unordered_multimap& y) + noexcept(noexcept(x.swap(y))); // (1) C++26 } ``` ## 概要 -2つの `unordered_multimap` オブジェクトである `x` と 'y'が保持するコンテンツを交換する。サイズは異なる場合もある。 +2つの `unordered_multimap` オブジェクトである `x` と `y` が保持するコンテンツを交換する。サイズは異なる場合もある。 -このメンバ関数の呼び出しの後、呼び出し前に 'x' にあった要素は `y` へ、`y` 内にあった要素は `x` へ移る。全てのイテレータ、参照、ポインタは有効なまま残る。 +このメンバ関数の呼び出しの後、呼び出し前に `x` にあった要素は `y` へ、`y` 内にあった要素は `x` へ移る。全てのイテレータ、参照、ポインタは有効なまま残る。 ## 効果 @@ -96,3 +102,4 @@ um2 : {[10,a], [20,b], [30,c], [30,d], [30,e], } ## 参照 - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) - `noexcept` 追加の経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/begin-size_type.md b/reference/unordered_set/unordered_multiset/begin-size_type.md index 4c87c781ea..bd18a81bb8 100644 --- a/reference/unordered_set/unordered_multiset/begin-size_type.md +++ b/reference/unordered_set/unordered_multiset/begin-size_type.md @@ -6,8 +6,11 @@ * cpp11[meta cpp] ```cpp -local_iterator begin(size_type n); -const_local_iterator begin(size_type n) const; +local_iterator begin(size_type n); // (1) C++11 +constexpr local_iterator begin(size_type n); // (1) C++26 + +const_local_iterator begin(size_type n) const; // (2) C++11 +constexpr const_local_iterator begin(size_type n) const; // (2) C++26 ``` ## 概要 @@ -99,3 +102,7 @@ bucket = 10, bucket_size = 0, keys = { } | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/begin.md b/reference/unordered_set/unordered_multiset/begin.md index b0bd3d832a..633ec68818 100644 --- a/reference/unordered_set/unordered_multiset/begin.md +++ b/reference/unordered_set/unordered_multiset/begin.md @@ -6,8 +6,11 @@ * cpp11[meta cpp] ```cpp -iterator begin() noexcept; -const_iterator begin() const noexcept; +iterator begin() noexcept; // (1) C++11 +constexpr iterator begin() noexcept; // (1) C++26 + +const_iterator begin() const noexcept; // (2) C++11 +constexpr const_iterator begin() const noexcept; // (2) C++26 ``` ## 概要 @@ -86,3 +89,7 @@ int main() | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/bucket.md b/reference/unordered_set/unordered_multiset/bucket.md index acb395f925..a3ff8fd668 100644 --- a/reference/unordered_set/unordered_multiset/bucket.md +++ b/reference/unordered_set/unordered_multiset/bucket.md @@ -6,10 +6,11 @@ * cpp11[meta cpp] ```cpp -size_type bucket(const key_type& k) const; // (1) C++11 +size_type bucket(const key_type& k) const; // (1) C++11 +constexpr size_type bucket(const key_type& k) const; // (1) C++26 template -size_type bucket(const K& k) const; // (2) C++26 +constexpr size_type bucket(const K& k) const; // (2) C++26 ``` ## 概要 @@ -112,3 +113,4 @@ key = H, bucket = 3, bucket_size = 0 ## 参照 - [P2363R5 Extending associative containers with the remaining heterogeneous overloads](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2363r5.html) - C++26で`template `のバージョンが追加された +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/bucket_count.md b/reference/unordered_set/unordered_multiset/bucket_count.md index 761cbe0fa9..0c80e55ad3 100644 --- a/reference/unordered_set/unordered_multiset/bucket_count.md +++ b/reference/unordered_set/unordered_multiset/bucket_count.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -size_type bucket_count() const noexcept; +size_type bucket_count() const noexcept; // (1) C++11 +constexpr size_type bucket_count() const noexcept; // (1) C++26 ``` ## 概要 @@ -65,3 +66,7 @@ bucket count is 11 | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/bucket_size.md b/reference/unordered_set/unordered_multiset/bucket_size.md index aa5c29e40f..69b5b31524 100644 --- a/reference/unordered_set/unordered_multiset/bucket_size.md +++ b/reference/unordered_set/unordered_multiset/bucket_size.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -size_type bucket_size(size_type n) const; +size_type bucket_size(size_type n) const; // (1) C++11 +constexpr size_type bucket_size(size_type n) const; // (1) C++26 ``` ## 概要 @@ -90,3 +91,7 @@ bucket = 10, bucket_size = 0, keys = { } | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/cbegin-size_type.md b/reference/unordered_set/unordered_multiset/cbegin-size_type.md index a2fbc994b7..0f3cd70f5a 100644 --- a/reference/unordered_set/unordered_multiset/cbegin-size_type.md +++ b/reference/unordered_set/unordered_multiset/cbegin-size_type.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_local_iterator cbegin(size_type n) const; +const_local_iterator cbegin(size_type n) const; // (1) C++11 +constexpr const_local_iterator cbegin(size_type n) const; // (1) C++26 ``` ## 概要 @@ -92,3 +93,7 @@ bucket = 10, bucket_size = 0, keys = { } | [`begin(size_type)`](begin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指すイテレータを取得 | | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/cbegin.md b/reference/unordered_set/unordered_multiset/cbegin.md index b8965faeb1..213b3284f9 100644 --- a/reference/unordered_set/unordered_multiset/cbegin.md +++ b/reference/unordered_set/unordered_multiset/cbegin.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_iterator cbegin() const noexcept; +const_iterator cbegin() const noexcept; // (1) C++11 +constexpr const_iterator cbegin() const noexcept; // (1) C++26 ``` ## 概要 @@ -74,3 +75,7 @@ int main() | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/cend-size_type.md b/reference/unordered_set/unordered_multiset/cend-size_type.md index 1ad1045aec..8f923ad128 100644 --- a/reference/unordered_set/unordered_multiset/cend-size_type.md +++ b/reference/unordered_set/unordered_multiset/cend-size_type.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_local_iterator cend(size_type n) const; +const_local_iterator cend(size_type n) const; // (1) C++11 +constexpr const_local_iterator cend(size_type n) const; // (1) C++26 ``` ## 概要 @@ -92,3 +93,7 @@ bucket = 10, bucket_size = 0, keys = { } | [`begin(size_type)`](begin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指すイテレータを取得 | | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/cend.md b/reference/unordered_set/unordered_multiset/cend.md index f35d69295c..b45f4d7f40 100644 --- a/reference/unordered_set/unordered_multiset/cend.md +++ b/reference/unordered_set/unordered_multiset/cend.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_iterator cend() const noexcept; +const_iterator cend() const noexcept; // (1) C++11 +constexpr const_iterator cend() const noexcept; // (1) C++26 ``` ## 概要 @@ -74,3 +75,7 @@ int main() | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/clear.md b/reference/unordered_set/unordered_multiset/clear.md index 0f012bdd6a..2300b451ad 100644 --- a/reference/unordered_set/unordered_multiset/clear.md +++ b/reference/unordered_set/unordered_multiset/clear.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -void clear() noexcept; +void clear() noexcept; // (1) C++11 +constexpr void clear() noexcept; // (1) C++26 ``` ## 概要 @@ -99,3 +100,7 @@ true | [`insert`](insert.md) | 要素の追加 | | [`erase`](erase.md) | 要素の削除 | | [`swap`](swap.md) | 内容の交換 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/contains.md b/reference/unordered_set/unordered_multiset/contains.md index 49d00282e4..2e204ad071 100644 --- a/reference/unordered_set/unordered_multiset/contains.md +++ b/reference/unordered_set/unordered_multiset/contains.md @@ -6,10 +6,13 @@ * cpp20[meta cpp] ```cpp -bool contains(const key_type& x) const; // (1) +bool contains(const key_type& x) const; // (1) C++20 +constexpr bool contains(const key_type& x) const; // (1) C++26 template -bool contains(const K& k) const; // (2) +bool contains(const K& k) const; // (2) C++20 +template +constexpr bool contains(const K& k) const; // (2) C++26 ``` ## 概要 @@ -79,3 +82,4 @@ contain ## 参照 - [P0458R2 Checking for Existence of an Element in Associative Containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0458r2.html) - [P0919R3 Heterogeneous lookup for unordered containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0919r3.html) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/count.md b/reference/unordered_set/unordered_multiset/count.md index 3acc615510..ac22ed5860 100644 --- a/reference/unordered_set/unordered_multiset/count.md +++ b/reference/unordered_set/unordered_multiset/count.md @@ -6,10 +6,13 @@ * cpp11[meta cpp] ```cpp -size_type count(const key_type& x) const; // (1) C++11 +size_type count(const key_type& x) const; // (1) C++11 +constexpr size_type count(const key_type& x) const; // (1) C++26 template -size_type count(const K& k) const; // (2) C++20 +size_type count(const K& k) const; // (2) C++20 +template +constexpr size_type count(const K& k) const; // (2) C++26 ``` ## 概要 @@ -96,3 +99,4 @@ count of 8:0 ## 参照 - [LWG Issue 2304. Complexity of `count` in unordered associative containers](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2304) - [P0919R3 Heterogeneous lookup for unordered containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0919r3.html) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/emplace.md b/reference/unordered_set/unordered_multiset/emplace.md index 3e57dd12b5..db3ed4ff23 100644 --- a/reference/unordered_set/unordered_multiset/emplace.md +++ b/reference/unordered_set/unordered_multiset/emplace.md @@ -7,7 +7,9 @@ ```cpp template -iterator emplace(Args&&... args); +iterator emplace(Args&&... args); // (1) C++11 +template +constexpr iterator emplace(Args&&... args); // (1) C++26 ``` ## 概要 @@ -159,3 +161,4 @@ int main() ## 参照 - [N2680 Proposed Wording for Placement Insert (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2680.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/emplace_hint.md b/reference/unordered_set/unordered_multiset/emplace_hint.md index a9d2733116..378fc8502a 100644 --- a/reference/unordered_set/unordered_multiset/emplace_hint.md +++ b/reference/unordered_set/unordered_multiset/emplace_hint.md @@ -7,7 +7,9 @@ ```cpp template -iterator emplace_hint(const_iterator position, Args&&... args); +iterator emplace_hint(const_iterator position, Args&&... args); // (1) C++11 +template +constexpr iterator emplace_hint(const_iterator position, Args&&... args); // (1) C++26 ``` ## 概要 @@ -193,3 +195,4 @@ int main() ## 参照 - [N2680 Proposed Wording for Placement Insert (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2680.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/empty.md b/reference/unordered_set/unordered_multiset/empty.md index dbb0d9028d..4de16f3102 100644 --- a/reference/unordered_set/unordered_multiset/empty.md +++ b/reference/unordered_set/unordered_multiset/empty.md @@ -6,9 +6,9 @@ * cpp11[meta cpp] ```cpp -bool empty() const noexcept; // C++11 -[[nodiscard]] bool empty() const noexcept; // C++20 -bool empty() const noexcept; // C++26 +bool empty() const noexcept; // (1) C++11 +[[nodiscard]] bool empty() const noexcept; // (1) C++20 +constexpr bool empty() const noexcept; // (1) C++26 ``` ## 概要 @@ -97,3 +97,4 @@ inline bool unordered_multiset::empty() const noexce - C++20で`[[nodiscard]]`が付加された - [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) - C++26で`[[nodiscard]]`指定が削除された +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/end-size_type.md b/reference/unordered_set/unordered_multiset/end-size_type.md index e29c963c15..41f5a3b7ea 100644 --- a/reference/unordered_set/unordered_multiset/end-size_type.md +++ b/reference/unordered_set/unordered_multiset/end-size_type.md @@ -6,8 +6,11 @@ * cpp11[meta cpp] ```cpp -local_iterator end(size_type n); -const_local_iterator end(size_type n) const; +local_iterator end(size_type n); // (1) C++11 +constexpr local_iterator end(size_type n); // (1) C++26 + +const_local_iterator end(size_type n) const; // (2) C++11 +constexpr const_local_iterator end(size_type n) const; // (2) C++26 ``` ## 概要 @@ -99,3 +102,7 @@ bucket = 10, bucket_size = 0, keys = { } | [`begin(size_type)`](begin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/end.md b/reference/unordered_set/unordered_multiset/end.md index 7871a16ede..1af141f19a 100644 --- a/reference/unordered_set/unordered_multiset/end.md +++ b/reference/unordered_set/unordered_multiset/end.md @@ -6,8 +6,11 @@ * cpp11[meta cpp] ```cpp -iterator end() noexcept; -const_iterator end() const noexcept; +iterator end() noexcept; // (1) C++11 +constexpr iterator end() noexcept; // (1) C++26 + +const_iterator end() const noexcept; // (2) C++11 +constexpr const_iterator end() const noexcept; // (2) C++26 ``` ## 概要 @@ -86,3 +89,7 @@ int main() | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/equal_range.md b/reference/unordered_set/unordered_multiset/equal_range.md index e3e72b330d..edaa11ed50 100644 --- a/reference/unordered_set/unordered_multiset/equal_range.md +++ b/reference/unordered_set/unordered_multiset/equal_range.md @@ -7,16 +7,28 @@ ```cpp pair - equal_range(const key_type& x); // (1) C++11 + equal_range(const key_type& x); // (1) C++11 +constexpr pair + equal_range(const key_type& x); // (1) C++26 + pair equal_range(const key_type& x) const; // (2) C++11 +constexpr pair + equal_range(const key_type& x) const; // (2) C++26 template pair - equal_range(const K& k); // (3) C++20 + equal_range(const K& k); // (3) C++20 +template +constexpr pair + equal_range(const K& k); // (3) C++26 + template pair - equal_range(const K& k) const; // (4) C++20 + equal_range(const K& k) const; // (4) C++20 +template +constexpr pair + equal_range(const K& k) const; // (4) C++26 ``` ## 概要 @@ -111,3 +123,4 @@ equal_range(8): [10, 10) ## 参照 - [P0919R3 Heterogeneous lookup for unordered containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0919r3.html) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/erase.md b/reference/unordered_set/unordered_multiset/erase.md index 77ac089067..f36ccf5354 100644 --- a/reference/unordered_set/unordered_multiset/erase.md +++ b/reference/unordered_set/unordered_multiset/erase.md @@ -6,13 +6,17 @@ * cpp11[meta cpp] ```cpp -iterator erase(iterator position); // (1) C++17 +iterator erase(iterator position); // (1) C++17 +constexpr iterator erase(iterator position); // (1) C++26 -iterator erase(const_iterator position); // (2) C++11 +iterator erase(const_iterator position); // (2) C++11 +constexpr iterator erase(const_iterator position); // (2) C++26 -size_type erase(const key_type& k); // (3) C++11 +size_type erase(const key_type& k); // (3) C++11 +constexpr size_type erase(const key_type& k); // (3) C++26 -iterator erase(const_iterator first, const_iterator last); // (4) C++11 +iterator erase(const_iterator first, const_iterator last); // (4) C++11 +constexpr iterator erase(const_iterator first, const_iterator last); // (4) C++26 ``` ## 概要 @@ -203,3 +207,4 @@ int main() - 安定性の保証が規定された経緯のレポート - [LWG Issue 2059. C++0x ambiguity problem with `map::erase`](https://cplusplus.github.io/LWG/issue2059) - C++17で、`erase(iterator)`を追加 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/erase_if_free.md b/reference/unordered_set/unordered_multiset/erase_if_free.md index 73d47bfa54..8d6eaa3060 100644 --- a/reference/unordered_set/unordered_multiset/erase_if_free.md +++ b/reference/unordered_set/unordered_multiset/erase_if_free.md @@ -8,7 +8,10 @@ namespace std { template typename unordered_multiset::size_type - erase_if(unordered_multiset& c, Predicate pred); + erase_if(unordered_multiset& c, Predicate pred); // (1) C++20 + template + constexpr typename unordered_multiset::size_type + erase_if(unordered_multiset& c, Predicate pred); // (1) C++26 } ``` @@ -78,3 +81,4 @@ int main() ## 参照 - [P1209R0 Adopt consistent container erasure from Library Fundamentals 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1209r0.html) - [R1115R3 Improving the Return Value of Erase-Like Algorithms II: Free `erase`/`erase_if`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1115r3.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/extract.md b/reference/unordered_set/unordered_multiset/extract.md index d6de3b38a6..8d01484356 100644 --- a/reference/unordered_set/unordered_multiset/extract.md +++ b/reference/unordered_set/unordered_multiset/extract.md @@ -6,8 +6,11 @@ * cpp17[meta cpp] ```cpp -node_type extract(const_iterator position); (1) -node_type extract(const key_type& x); (2) +node_type extract(const_iterator position); // (1) C++17 +constexpr node_type extract(const_iterator position); // (1) C++26 + +node_type extract(const key_type& x); // (2) C++17 +constexpr node_type extract(const key_type& x); // (2) C++26 ``` ## 概要 @@ -136,3 +139,4 @@ s2 = { 3, 1 } ## 参照 - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/find.md b/reference/unordered_set/unordered_multiset/find.md index 92fbd7d2fa..fff82c7629 100644 --- a/reference/unordered_set/unordered_multiset/find.md +++ b/reference/unordered_set/unordered_multiset/find.md @@ -6,11 +6,17 @@ * cpp11[meta cpp] ```cpp -iterator find(const key_type& x); // (1) C++11 -const_iterator find(const key_type& x) const; // (2) C++11 +iterator find(const key_type& x); // (1) C++11 +constexpr iterator find(const key_type& x); // (1) C++26 -template iterator find(const K& k); // (3) C++20 -template const_iterator find(const K& k) const; // (4) C++20 +const_iterator find(const key_type& x) const; // (2) C++11 +constexpr const_iterator find(const key_type& x) const; // (2) C++26 + +template iterator find(const K& k); // (3) C++20 +template constexpr iterator find(const K& k); // (3) C++26 + +template const_iterator find(const K& k) const; // (4) C++20 +template constexpr const_iterator find(const K& k) const; // (4) C++26 ``` ## 概要 @@ -104,3 +110,4 @@ not found ## 参照 - [P0919R3 Heterogeneous lookup for unordered containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0919r3.html) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/get_allocator.md b/reference/unordered_set/unordered_multiset/get_allocator.md index 188715c1e2..db85cb96a0 100644 --- a/reference/unordered_set/unordered_multiset/get_allocator.md +++ b/reference/unordered_set/unordered_multiset/get_allocator.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -allocator_type get_allocator() const noexcept; +allocator_type get_allocator() const noexcept; // (1) C++11 +constexpr allocator_type get_allocator() const noexcept; // (1) C++26 ``` ## 概要 @@ -117,3 +118,7 @@ libstdc++ の `unordered_multiset` では、アロケータの `select_on_contai | [`swap`](swap_free.md) | 内容の交換(非メンバ関数) | | [`allocator`](/reference/memory/allocator.md) | デフォルトのアロケータ | | [`allocator_traits`](/reference/memory/allocator_traits.md) | アロケータのトレイツ | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/hash_function.md b/reference/unordered_set/unordered_multiset/hash_function.md index 9728be4be8..dc774a3fda 100644 --- a/reference/unordered_set/unordered_multiset/hash_function.md +++ b/reference/unordered_set/unordered_multiset/hash_function.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -hasher hash_function() const; +hasher hash_function() const; // (1) C++11 +constexpr hasher hash_function() const; // (1) C++26 ``` ## 概要 @@ -74,3 +75,7 @@ hash(2) = 2 |-----------------------------------------|------------------------------------------------------| | [`hash`](/reference/functional/hash.md) | デフォルトのハッシュ関数オブジェクト(class template) | | [`key_eq`](key_eq.md) | キー比較用関数オブジェクトの取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/insert.md b/reference/unordered_set/unordered_multiset/insert.md index 5abaf25734..cf1d1d0a4c 100644 --- a/reference/unordered_set/unordered_multiset/insert.md +++ b/reference/unordered_set/unordered_multiset/insert.md @@ -6,19 +6,31 @@ * cpp11[meta cpp] ```cpp -iterator insert(const value_type& v); -iterator insert(value_type&& rv); // (1) +iterator insert(const value_type& v); // (1) C++11 +constexpr iterator insert(const value_type& v); // (1) C++26 -iterator insert(const_iterator position, const value_type& v); -iterator insert(const_iterator position, value_type&& rv); // (2) +iterator insert(value_type&& rv); // (2) C++11 +constexpr iterator insert(value_type&& rv); // (2) C++26 + +iterator insert(const_iterator position, const value_type& v); // (3) C++11 +constexpr iterator insert(const_iterator position, const value_type& v); // (3) C++26 + +iterator insert(const_iterator position, value_type&& rv); // (4) C++11 +constexpr iterator insert(const_iterator position, value_type&& rv); // (4) C++26 template -void insert(InputIterator first, InputIterator last); // (3) +void insert(InputIterator first, InputIterator last); // (5) C++11 +template +constexpr void insert(InputIterator first, InputIterator last); // (5) C++26 + +void insert(initializer_list il); // (6) C++11 +constexpr void insert(initializer_list il); // (6) C++26 -void insert(initializer_list il); // (4) +iterator insert(node_type&& nh); // (7) C++17 +constexpr iterator insert(node_type&& nh); // (7) C++26 -iterator insert(node_type&& nh); // (5) C++17 -iterator insert(const_iterator hint, node_type&& nh); // (6) C++17 +iterator insert(const_iterator hint, node_type&& nh); // (8) C++17 +constexpr iterator insert(const_iterator hint, node_type&& nh); // (8) C++26 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -244,3 +256,4 @@ inline void unordered_multiset::insert(std::initiali - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) - (5), (6)経緯となる提案文書 - [How useful is the hint passed to the std::unordered_... collections? - The Old New Thing](https://devblogs.microsoft.com/oldnewthing/20241028-00/?p=110428) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/insert_range.md b/reference/unordered_set/unordered_multiset/insert_range.md index 85efcb9536..c275fb9f26 100644 --- a/reference/unordered_set/unordered_multiset/insert_range.md +++ b/reference/unordered_set/unordered_multiset/insert_range.md @@ -7,7 +7,9 @@ ```cpp template R> -void insert_range(R&& rg); // C++23 +void insert_range(R&& rg); // (1) C++23 +template R> +constexpr void insert_range(R&& rg); // (1) C++26 ``` ## 概要 @@ -70,3 +72,7 @@ int main () | 名前 | 説明 | |-------------------------------------------|----------------------| | [`insert`](insert.md) | 要素の追加 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/key_eq.md b/reference/unordered_set/unordered_multiset/key_eq.md index c02bc41b9a..441f417142 100644 --- a/reference/unordered_set/unordered_multiset/key_eq.md +++ b/reference/unordered_set/unordered_multiset/key_eq.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -key_equal key_eq() const; +key_equal key_eq() const; // (1) C++11 +constexpr key_equal key_eq() const; // (1) C++26 ``` ## 概要 @@ -72,3 +73,7 @@ eq(1, 1) = true |----------------------------------------------------|----------------------------------------------| | [`equal_to`](/reference/functional/equal_to.md) | 等値比較演算関数オブジェクト(class template) | | [`hash_function`](hash_function.md) | ハッシュ関数オブジェクトの取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/load_factor.md b/reference/unordered_set/unordered_multiset/load_factor.md index 1cb5eb2702..4ae9b429f1 100644 --- a/reference/unordered_set/unordered_multiset/load_factor.md +++ b/reference/unordered_set/unordered_multiset/load_factor.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -float load_factor() const noexcept; +float load_factor() const noexcept; // (1) C++11 +constexpr float load_factor() const noexcept; // (1) C++26 ``` ## 概要 @@ -92,3 +93,7 @@ size is 20, bucket_count is 23, load_factor is 0.869565 | [`max_load_factor`](max_load_factor.md) | 負荷率の最大値を取得、設定 | | [`rehash`](rehash.md) | 最小バケット数指定によるバケット数の調整 | | [`reserve`](reserve.md) | 最小要素数指定によるバケット数の調整 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/max_bucket_count.md b/reference/unordered_set/unordered_multiset/max_bucket_count.md index c4d4ccf19a..351e549d01 100644 --- a/reference/unordered_set/unordered_multiset/max_bucket_count.md +++ b/reference/unordered_set/unordered_multiset/max_bucket_count.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -size_type max_bucket_count() const noexcept; +size_type max_bucket_count() const noexcept; // (1) C++11 +constexpr size_type max_bucket_count() const noexcept; // (1) C++26 ``` ## 概要 @@ -65,3 +66,7 @@ max bucket count is 2305843009213693951 | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/max_load_factor.md b/reference/unordered_set/unordered_multiset/max_load_factor.md index 6ed4177f4f..4808876fcd 100644 --- a/reference/unordered_set/unordered_multiset/max_load_factor.md +++ b/reference/unordered_set/unordered_multiset/max_load_factor.md @@ -6,8 +6,11 @@ * cpp11[meta cpp] ```cpp -float max_load_factor() const noexcept; // (1) -void max_load_factor(float z); // (2) +float max_load_factor() const noexcept; // (1) C++11 +constexpr float max_load_factor() const noexcept; // (1) C++26 + +void max_load_factor(float z); // (2) C++11 +constexpr void max_load_factor(float z); // (2) C++26 ``` ## 概要 @@ -183,3 +186,7 @@ size is 27, bucket_count is 29, load_factor is 0.931035, bucket_count * max_load | [`load_factor`](load_factor.md) | 現在の負荷率(バケットあたりの要素数の平均)を取得 | | [`rehash`](rehash.md) | 最小バケット数指定によるバケット数の調整 | | [`reserve`](reserve.md) | 最小要素数指定によるバケット数の調整 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/max_size.md b/reference/unordered_set/unordered_multiset/max_size.md index 2f816d1d34..c20ea7b1f2 100644 --- a/reference/unordered_set/unordered_multiset/max_size.md +++ b/reference/unordered_set/unordered_multiset/max_size.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -size_type max_size() const noexcept; +size_type max_size() const noexcept; // (1) C++11 +constexpr size_type max_size() const noexcept; // (1) C++26 ``` ## 概要 @@ -66,3 +67,7 @@ libstdc++ では、コンテナのアロケータ `allocator_type` にメンバ |-----------------------|----------------------------| | [`empty`](empty.md) | コンテナが空かどうかを判定 | | [`size`](size.md) | 要素数の取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/merge.md b/reference/unordered_set/unordered_multiset/merge.md index ba160b79ef..4951fca192 100644 --- a/reference/unordered_set/unordered_multiset/merge.md +++ b/reference/unordered_set/unordered_multiset/merge.md @@ -7,13 +7,24 @@ ```cpp template - void merge(unordered_set& source); // (1) +void merge(unordered_set& source); // (1) C++17 template - void merge(unordered_set&& source); // (2) +constexpr void merge(unordered_set& source); // (1) C++26 + +template +void merge(unordered_set&& source); // (2) C++17 +template +constexpr void merge(unordered_set&& source); // (2) C++26 + +template +void merge(unordered_multiset& source); // (3) C++17 +template +constexpr void merge(unordered_multiset& source); // (3) C++26 + template - void merge(unordered_multiset& source); // (3) +void merge(unordered_multiset&& source); // (4) C++17 template - void merge(unordered_multiset&& source); // (4) +constexpr void merge(unordered_multiset&& source); // (4) C++26 ``` ## 概要 @@ -85,3 +96,4 @@ s2 = { 10, 10, 20, 30 } ## 参照 - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/op_assign.md b/reference/unordered_set/unordered_multiset/op_assign.md index 62ee6e0b7d..a375b9798b 100644 --- a/reference/unordered_set/unordered_multiset/op_assign.md +++ b/reference/unordered_set/unordered_multiset/op_assign.md @@ -6,13 +6,21 @@ * cpp11[meta cpp] ```cpp -unordered_multiset& operator=(const unordered_multiset& v); // (1) -unordered_multiset& operator=(unordered_multiset&& rv); // (2) +unordered_multiset& operator=(const unordered_multiset& v); // (1) C++11 +constexpr unordered_multiset& operator=(const unordered_multiset& v); // (1) C++26 + +unordered_multiset& operator=(unordered_multiset&& rv); // (2) C++11 unordered_multiset & operator=(unordered_multiset&& x) noexcept(allocator_traits::is_always_equal::value && is_nothrow_move_assignable::value && is_nothrow_move_assignable::value); // (2) C++17 -unordered_multiset& operator=(initializer_list il); // (3) +constexpr unordered_multiset & operator=(unordered_multiset&& x) + noexcept(allocator_traits::is_always_equal::value + && is_nothrow_move_assignable::value + && is_nothrow_move_assignable::value); // (2) C++26 + +unordered_multiset& operator=(initializer_list il); // (3) C++11 +constexpr unordered_multiset& operator=(initializer_list il); // (3) C++26 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -90,3 +98,4 @@ unordered_multiset& operator=(initializer_list il); // (3) - (3)の経緯となる提案文書 - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) - `noexcept` 追加の経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/op_constructor.md b/reference/unordered_set/unordered_multiset/op_constructor.md index 8b7ca6561e..3bd98d667b 100644 --- a/reference/unordered_set/unordered_multiset/op_constructor.md +++ b/reference/unordered_set/unordered_multiset/op_constructor.md @@ -6,93 +6,176 @@ * cpp11[meta cpp] ```cpp -unordered_multiset(); // (1) C++14 - -explicit unordered_multiset(size_type n, - const hasher& hf = hasher(), - const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); // (2) C++14 - - -explicit unordered_multiset(size_type n = 実装依存の既定値, - const hasher& hf = hasher(), - const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); // (1) + (2) C++11 +unordered_multiset(); // (1) C++14 +constexpr unordered_multiset(); // (1) C++26 + +explicit + unordered_multiset(size_type n, + const hasher& hf = hasher(), + const key_equal& eql = key_equal(), + const allocator_type& a = allocator_type()); // (2) C++14 +constexpr explicit + unordered_multiset(size_type n, + const hasher& hf = hasher(), + const key_equal& eql = key_equal(), + const allocator_type& a = allocator_type()); // (2) C++26 + + +explicit + unordered_multiset(size_type n = 実装依存の既定値, + const hasher& hf = hasher(), + const key_equal& eql = key_equal(), + const allocator_type& a = allocator_type()); // (1) + (2) C++11 template -unordered_multiset(InputIterator first, InputIterator last, +unordered_multiset(InputIterator first, + InputIterator last, size_type n = 実装依存の既定値, const hasher& hf = hasher(), const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); // (3) + const allocator_type& a = allocator_type()); // (3) C++11 +template +constexpr + unordered_multiset(InputIterator first, + InputIterator last, + size_type n = 実装依存の既定値, + const hasher& hf = hasher(), + const key_equal& eql = key_equal(), + const allocator_type& a = allocator_type()); // (3) C++26 -unordered_multiset(const unordered_multiset& v); // (4) +unordered_multiset(const unordered_multiset& v); // (4) C++11 +constexpr unordered_multiset(const unordered_multiset& v); // (4) C++26 -unordered_multiset(unordered_multiset&& rv); // (5) +unordered_multiset(unordered_multiset&& rv); // (5) C++11 +constexpr unordered_multiset(unordered_multiset&& rv); // (5) C++26 -explicit unordered_multiset(const allocator_type& a); // (6) +explicit unordered_multiset(const allocator_type& a); // (6) C++11 +constexpr explicit unordered_multiset(const allocator_type& a); // (6) C++26 unordered_multiset(const unordered_multiset& v, - const allocator_type& a); // (7) + const allocator_type& a); // (7) C++11 unordered_multiset(const unordered_multiset& v, - const type_identity_t& a); // (7) C++23 + const type_identity_t& a); // (7) C++23 +constexpr + unordered_multiset(const unordered_multiset& v, + const type_identity_t& a); // (7) C++26 unordered_multiset(unordered_multiset&& rv, - const allocator_type& a); // (8) + const allocator_type& a); // (8) C++11 unordered_multiset(unordered_multiset&& rv, - const type_identity_t& a); // (8) C++23 + const type_identity_t& a); // (8) C++23 +constexpr + unordered_multiset(unordered_multiset&& rv, + const type_identity_t& a); // (8) C++26 unordered_multiset(initializer_list il, size_type n = 実装依存の既定値, const hasher& hf = hasher(), const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); // (9) + const allocator_type& a = allocator_type()); // (9) C++11 +constexpr + unordered_multiset(initializer_list il, + size_type n = 実装依存の既定値, + const hasher& hf = hasher(), + const key_equal& eql = key_equal(), + const allocator_type& a = allocator_type()); // (9) C++26 -unordered_multiset(size_type n, const allocator_type& a); // (10) C++14 +unordered_multiset(size_type n, const allocator_type& a); // (10) C++14 +constexpr unordered_multiset(size_type n, const allocator_type& a); // (10) C++26 unordered_multiset(size_type n, const hasher& hf, - const allocator_type& a); // (11) C++14 + const allocator_type& a); // (11) C++14 +constexpr + unordered_multiset(size_type n, + const hasher& hf, + const allocator_type& a); // (11) C++26 template unordered_multiset(InputIterator f, InputIterator l, size_type n, - const allocator_type& a); // (12) C++14 + const allocator_type& a); // (12) C++14 +template +constexpr + unordered_multiset(InputIterator f, + InputIterator l, + size_type n, + const allocator_type& a); // (12) C++26 template unordered_multiset(InputIterator f, InputIterator l, size_type n, const hasher& hf, - const allocator_type& a); // (13) C++14 + const allocator_type& a); // (13) C++14 +template +constexpr + unordered_multiset(InputIterator f, + InputIterator l, + size_type n, + const hasher& hf, + const allocator_type& a); // (13) C++26 unordered_multiset(initializer_list il, size_type n, - const allocator_type& a); // (14) C++14 + const allocator_type& a); // (14) C++14 +constexpr + unordered_multiset(initializer_list il, + size_type n, + const allocator_type& a); // (14) C++26 unordered_multiset(initializer_list il, size_type n, const hasher& hf, - const allocator_type& a); // (15) C++14 + const allocator_type& a); // (15) C++14 +constexpr + unordered_multiset(initializer_list il, + size_type n, + const hasher& hf, + const allocator_type& a); // (15) C++26 template R> -unordered_multiset(std::from_range_t, R&& rg, +unordered_multiset(std::from_range_t, + R&& rg, size_type n = 実装依存の既定値, const hasher& hf = hasher(), const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); // (16) C++23 + const allocator_type& a = allocator_type()); // (16) C++23 +template R> +constexpr + unordered_multiset(std::from_range_t, + R&& rg, + size_type n = 実装依存の既定値, + const hasher& hf = hasher(), + const key_equal& eql = key_equal(), + const allocator_type& a = allocator_type()); // (16) C++26 template R> -unordered_multiset(std::from_range_t, R&& rg, +unordered_multiset(std::from_range_t, + R&& rg, size_type n, - const allocator_type& a); // (17) C++23 + const allocator_type& a); // (17) C++23 +template R> +constexpr + unordered_multiset(std::from_range_t, + R&& rg, + size_type n, + const allocator_type& a); // (17) C++26 template R> -unordered_multiset(std::from_range_t, R&& rg, +unordered_multiset(std::from_range_t, + R&& rg, size_type n, const hasher& hf, - const allocator_type& a); // (18) C++23 + const allocator_type& a); // (18) C++23 +template R> +constexpr + unordered_multiset(std::from_range_t, + R&& rg, + size_type n, + const hasher& hf, + const allocator_type& a); // (18) C++26 ``` * type_identity_t[link /reference/type_traits/type_identity.md] * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -278,3 +361,4 @@ libstdc++ には 4.8.2 現在、(6), (7), (8)の形式はない。 なお、Discussion の例はアロケータの型が誤っているので注意 - [P1518R2 Stop Overconstraining Allocators in Container Deduction Guides](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1518r2.html) - C++23でのアロケータ引数を`type_identity_t`で包む変更 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/op_destructor.md b/reference/unordered_set/unordered_multiset/op_destructor.md index 862734efbe..6cb8fc1f6d 100644 --- a/reference/unordered_set/unordered_multiset/op_destructor.md +++ b/reference/unordered_set/unordered_multiset/op_destructor.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -~unordered_multiset(); +~unordered_multiset(); // (1) C++11 +constexpr ~unordered_multiset(); // (1) C++26 ``` ## 概要 @@ -37,3 +38,7 @@ |--------------------------------------------|----------------| | [`(constructor)`](op_constructor.md) | コンストラクタ | | [`operator=`](op_assign.md) | 代入演算子 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/op_equal.md b/reference/unordered_set/unordered_multiset/op_equal.md index 090f483c5a..4254e3fe30 100644 --- a/reference/unordered_set/unordered_multiset/op_equal.md +++ b/reference/unordered_set/unordered_multiset/op_equal.md @@ -9,6 +9,9 @@ namespace std { template bool operator==(const unordered_multiset& a, const unordered_multiset& b); // (1) C++11 + template + constexpr bool operator==(const unordered_multiset& a, + const unordered_multiset& b); // (1) C++26 } ``` @@ -138,3 +141,4 @@ namespace std { - [P0809R0 Comparing Unordered Containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0809r0.pdf) - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/op_not_equal.md b/reference/unordered_set/unordered_multiset/op_not_equal.md index 6a9927edff..730e134da9 100644 --- a/reference/unordered_set/unordered_multiset/op_not_equal.md +++ b/reference/unordered_set/unordered_multiset/op_not_equal.md @@ -10,6 +10,9 @@ namespace std { template bool operator!=(const unordered_multiset& a, const unordered_multiset& b); // (1) C++11 + template + constexpr bool operator!=(const unordered_multiset& a, + const unordered_multiset& b); // (1) C++26 } ``` @@ -124,3 +127,4 @@ namespace std { - [P0809R0 Comparing Unordered Containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0809r0.pdf) - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/rehash.md b/reference/unordered_set/unordered_multiset/rehash.md index c66bad51d8..c6a73a542c 100644 --- a/reference/unordered_set/unordered_multiset/rehash.md +++ b/reference/unordered_set/unordered_multiset/rehash.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -void rehash(size_type n); +void rehash(size_type n); // (1) C++11 +constexpr void rehash(size_type n); // (1) C++26 ``` ## 概要 @@ -98,3 +99,7 @@ bucket_count is 13 | [`load_factor`](load_factor.md) | 現在の負荷率(バケットあたりの要素数の平均)を取得 | | [`max_load_factor`](max_load_factor.md) | 負荷率の最大値を取得、設定 | | [`reserve`](reserve.md) | 最小要素数指定によるバケット数の調整 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/reserve.md b/reference/unordered_set/unordered_multiset/reserve.md index 31d7f45003..4b2db37b59 100644 --- a/reference/unordered_set/unordered_multiset/reserve.md +++ b/reference/unordered_set/unordered_multiset/reserve.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -void reserve(size_type n); +void reserve(size_type n); // (1) C++11 +constexpr void reserve(size_type n); // (1) C++26 ``` ## 概要 @@ -104,3 +105,7 @@ bucket_count is 13 | [`insert`](insert.md) | 要素の追加 | | [`emplace`](emplace.md) | コンテナ内への要素の直接構築 | | [`emplace_hint`](emplace_hint.md) | 挿入位置のヒントを使用したコンテナ内への要素の直接構築 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/size.md b/reference/unordered_set/unordered_multiset/size.md index dba16be1bb..42f6e82095 100644 --- a/reference/unordered_set/unordered_multiset/size.md +++ b/reference/unordered_set/unordered_multiset/size.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -size_type size() const noexcept; +size_type size() const noexcept; // (1) C++11 +constexpr size_type size() const noexcept; // (1) C++26 ``` ## 概要 @@ -70,3 +71,7 @@ int main() | [`begin`](begin.md) | 先頭要素を指すイテレータの取得 | | [`end`](end.md) | 最終要素の次を指すイテレータの取得 | | [`distance`](/reference/iterator/distance.md) | イテレータ間の距離を求める | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/swap.md b/reference/unordered_set/unordered_multiset/swap.md index 570d1b90d8..b2aa0840d7 100644 --- a/reference/unordered_set/unordered_multiset/swap.md +++ b/reference/unordered_set/unordered_multiset/swap.md @@ -6,11 +6,15 @@ * cpp11[meta cpp] ```cpp -void swap(unordered_multiset& v); +void swap(unordered_multiset& v); // (1) C++11 void swap(unordered_multiset& x) noexcept(allocator_traits::is_always_equal::value && noexcept(swap(declval(),declval())) - && noexcept(swap(declval(),declval()))); // C++17 + && noexcept(swap(declval(),declval()))); // (1) C++17 +constexpr void swap(unordered_multiset& x) + noexcept(allocator_traits::is_always_equal::value + && noexcept(swap(declval(),declval())) + && noexcept(swap(declval(),declval()))); // (1) C++26 ``` ## 概要 @@ -116,3 +120,4 @@ ums2 after : 9 9 7 7 5 5 1 1 3 3 ## 参照 - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) - `noexcept` 追加の経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_multiset/swap_free.md b/reference/unordered_set/unordered_multiset/swap_free.md index a0ae45e1d6..acea0178ff 100644 --- a/reference/unordered_set/unordered_multiset/swap_free.md +++ b/reference/unordered_set/unordered_multiset/swap_free.md @@ -7,13 +7,19 @@ ```cpp namespace std { template - void swap(unordered_multiset& x, - unordered_multiset& y); - + void + swap(unordered_multiset& x, + unordered_multiset& y); // (1) C++11 template - void swap(unordered_multiset& x, - unordered_multiset& y) - noexcept(noexcept(x.swap(y))); // C++17 + void + swap(unordered_multiset& x, + unordered_multiset& y) + noexcept(noexcept(x.swap(y))); // (1) C++17 + template + constexpr void + swap(unordered_multiset& x, + unordered_multiset& y) + noexcept(noexcept(x.swap(y))); // (1) C++26 } ``` @@ -107,3 +113,4 @@ namespace std { ## 参照 - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) - `noexcept` 追加の経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/begin-size_type.md b/reference/unordered_set/unordered_set/begin-size_type.md index 2a0f00a7ea..2e22ca58f6 100644 --- a/reference/unordered_set/unordered_set/begin-size_type.md +++ b/reference/unordered_set/unordered_set/begin-size_type.md @@ -6,8 +6,11 @@ * cpp11[meta cpp] ```cpp -local_iterator begin(size_type n); -const_local_iterator begin(size_type n) const; +local_iterator begin(size_type n); // (1) C++11 +constexpr local_iterator begin(size_type n); // (1) C++26 + +const_local_iterator begin(size_type n) const; // (2) C++11 +constexpr const_local_iterator begin(size_type n) const; // (2) C++26 ``` ## 概要 @@ -93,3 +96,7 @@ bucket = 4, bucket_size = 2, keys = { C, B, } | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/begin.md b/reference/unordered_set/unordered_set/begin.md index a0a5ea36f7..0bbd3c6929 100644 --- a/reference/unordered_set/unordered_set/begin.md +++ b/reference/unordered_set/unordered_set/begin.md @@ -6,8 +6,11 @@ * cpp11[meta cpp] ```cpp -iterator begin() noexcept; -const_iterator begin() const noexcept; +iterator begin() noexcept; // (1) C++11 +constexpr iterator begin() noexcept; // (1) C++26 + +const_iterator begin() const noexcept; // (2) C++11 +constexpr const_iterator begin() const noexcept; // (2) C++26 ``` ## 概要 @@ -87,3 +90,7 @@ int main() | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/bucket.md b/reference/unordered_set/unordered_set/bucket.md index 31b1828818..0b2ed13dd4 100644 --- a/reference/unordered_set/unordered_set/bucket.md +++ b/reference/unordered_set/unordered_set/bucket.md @@ -6,10 +6,11 @@ * cpp11[meta cpp] ```cpp -size_type bucket(const key_type& k) const; // (1) C++11 +size_type bucket(const key_type& k) const; // (1) C++11 +constexpr size_type bucket(const key_type& k) const; // (1) C++26 template -size_type bucket(const K& k) const; // (2) C++26 +constexpr size_type bucket(const K& k) const; // (2) C++26 ``` ## 概要 @@ -107,3 +108,4 @@ key = H, bucket = 2, bucket_size = 0 ## 参照 - [P2363R5 Extending associative containers with the remaining heterogeneous overloads](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2363r5.html) - C++26で`template `のバージョンが追加された +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/bucket_count.md b/reference/unordered_set/unordered_set/bucket_count.md index 4d043bacb5..6b251e60af 100644 --- a/reference/unordered_set/unordered_set/bucket_count.md +++ b/reference/unordered_set/unordered_set/bucket_count.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -size_type bucket_count() const noexcept; +size_type bucket_count() const noexcept; // (1) C++11 +constexpr size_type bucket_count() const noexcept; // (1) C++26 ``` ## 概要 @@ -65,3 +66,7 @@ bucket count is 5 | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/bucket_size.md b/reference/unordered_set/unordered_set/bucket_size.md index 8175673c52..7e6e471953 100644 --- a/reference/unordered_set/unordered_set/bucket_size.md +++ b/reference/unordered_set/unordered_set/bucket_size.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -size_type bucket_size(size_type n) const; +size_type bucket_size(size_type n) const; // (1) C++11 +constexpr size_type bucket_size(size_type n) const; // (1) C++26 ``` ## 概要 @@ -84,3 +85,7 @@ bucket = 4, bucket_size = 2, keys = { C, B, } | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/cbegin-size_type.md b/reference/unordered_set/unordered_set/cbegin-size_type.md index 9df15be329..fd4119b10c 100644 --- a/reference/unordered_set/unordered_set/cbegin-size_type.md +++ b/reference/unordered_set/unordered_set/cbegin-size_type.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_local_iterator cbegin(size_type n) const; +const_local_iterator cbegin(size_type n) const; // (1) C++11 +constexpr const_local_iterator cbegin(size_type n) const; // (1) C++26 ``` ## 概要 @@ -86,3 +87,7 @@ bucket = 4, bucket_size = 2, keys = { C, B, } | [`begin(size_type)`](begin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指すイテレータを取得 | | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/cbegin.md b/reference/unordered_set/unordered_set/cbegin.md index e47ebd7a92..0875d7ae61 100644 --- a/reference/unordered_set/unordered_set/cbegin.md +++ b/reference/unordered_set/unordered_set/cbegin.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_iterator cbegin() const noexcept; +const_iterator cbegin() const noexcept; // (1) C++11 +constexpr const_iterator cbegin() const noexcept; // (1) C++26 ``` ## 概要 @@ -74,3 +75,7 @@ int main() | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/cend-size_type.md b/reference/unordered_set/unordered_set/cend-size_type.md index 9586e16011..80ff967c1e 100644 --- a/reference/unordered_set/unordered_set/cend-size_type.md +++ b/reference/unordered_set/unordered_set/cend-size_type.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_local_iterator cend(size_type n) const; +const_local_iterator cend(size_type n) const; // (1) C++11 +constexpr const_local_iterator cend(size_type n) const; // (1) C++26 ``` ## 概要 @@ -86,3 +87,7 @@ bucket = 4, bucket_size = 2, keys = { C, B, } | [`begin(size_type)`](begin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指すイテレータを取得 | | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/cend.md b/reference/unordered_set/unordered_set/cend.md index 7d73bafd15..62b8aecdae 100644 --- a/reference/unordered_set/unordered_set/cend.md +++ b/reference/unordered_set/unordered_set/cend.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -const_iterator cend() const noexcept; +const_iterator cend() const noexcept; // (1) C++11 +constexpr const_iterator cend() const noexcept; // (1) C++26 ``` ## 概要 @@ -74,3 +75,7 @@ int main() | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/clear.md b/reference/unordered_set/unordered_set/clear.md index eee1da28c5..48dfd50758 100644 --- a/reference/unordered_set/unordered_set/clear.md +++ b/reference/unordered_set/unordered_set/clear.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -void clear() noexcept; +void clear() noexcept; // (1) C++11 +constexpr void clear() noexcept; // (1) C++26 ``` ## 概要 @@ -99,3 +100,7 @@ true | [`insert`](insert.md) | 要素の追加 | | [`erase`](erase.md) | 要素の削除 | | [`swap`](swap.md) | 内容の交換 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/contains.md b/reference/unordered_set/unordered_set/contains.md index b58d453134..5ec73b45ac 100644 --- a/reference/unordered_set/unordered_set/contains.md +++ b/reference/unordered_set/unordered_set/contains.md @@ -6,10 +6,13 @@ * cpp20[meta cpp] ```cpp -bool contains(const key_type& x) const; // (1) +bool contains(const key_type& x) const; // (1) C++20 +constexpr bool contains(const key_type& x) const; // (1) C++26 template -bool contains(const K& k) const; // (2) +bool contains(const K& k) const; // (2) C++20 +template +constexpr bool contains(const K& k) const; // (2) C++26 ``` ## 概要 @@ -77,3 +80,4 @@ contain ## 参照 - [P0458R2 Checking for Existence of an Element in Associative Containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0458r2.html) - [P0919R3 Heterogeneous lookup for unordered containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0919r3.html) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/count.md b/reference/unordered_set/unordered_set/count.md index 3e4c367ea4..6f0148e574 100644 --- a/reference/unordered_set/unordered_set/count.md +++ b/reference/unordered_set/unordered_set/count.md @@ -6,10 +6,13 @@ * cpp11[meta cpp] ```cpp -size_type count(const key_type& x) const; // (1) C++11 +size_type count(const key_type& x) const; // (1) C++11 +constexpr size_type count(const key_type& x) const; // (1) C++26 template -size_type count(const K& k) const; // (2) C++20 +size_type count(const K& k) const; // (2) C++20 +template +constexpr size_type count(const K& k) const; // (2) C++26 ``` ## 概要 @@ -96,3 +99,4 @@ count of 8:0 ## 参照 - [LWG Issue 2304. Complexity of `count` in unordered associative containers](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2304) - [P0919R3 Heterogeneous lookup for unordered containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0919r3.html) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/emplace.md b/reference/unordered_set/unordered_set/emplace.md index 71061c574e..a80892bc53 100644 --- a/reference/unordered_set/unordered_set/emplace.md +++ b/reference/unordered_set/unordered_set/emplace.md @@ -7,7 +7,9 @@ ```cpp template -pair emplace(Args&&... args); +pair emplace(Args&&... args); // (1) C++11 +template +constexpr pair emplace(Args&&... args); // (1) C++26 ``` ## 概要 @@ -174,3 +176,4 @@ int main() ## 参照 - [N2680 Proposed Wording for Placement Insert (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2680.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/emplace_hint.md b/reference/unordered_set/unordered_set/emplace_hint.md index 7acff85326..d1a575e7d0 100644 --- a/reference/unordered_set/unordered_set/emplace_hint.md +++ b/reference/unordered_set/unordered_set/emplace_hint.md @@ -7,7 +7,9 @@ ```cpp template -iterator emplace_hint(const_iterator position, Args&&... args); +iterator emplace_hint(const_iterator position, Args&&... args); // (1) C++11 +template +constexpr iterator emplace_hint(const_iterator position, Args&&... args); // (1) C++26 ``` ## 概要 @@ -170,3 +172,4 @@ int main() ## 参照 - [N2680 Proposed Wording for Placement Insert (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2680.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/empty.md b/reference/unordered_set/unordered_set/empty.md index 0dd50e231c..eb26840175 100644 --- a/reference/unordered_set/unordered_set/empty.md +++ b/reference/unordered_set/unordered_set/empty.md @@ -6,9 +6,9 @@ * cpp11[meta cpp] ```cpp -bool empty() const noexcept; // C++11 -[[nodiscard]] bool empty() const noexcept; // C++20 -bool empty() const noexcept; // C++26 +bool empty() const noexcept; // (1) C++11 +[[nodiscard]] bool empty() const noexcept; // (1) C++20 +constexpr bool empty() const noexcept; // (1) C++26 ``` ## 概要 @@ -97,3 +97,4 @@ inline bool unordered_set::empty() const noexcept { - C++20で`[[nodiscard]]`が付加された - [P2422R1 Remove `nodiscard` annotations from the standard library specification](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) - C++26で`[[nodiscard]]`指定が削除された +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/end-size_type.md b/reference/unordered_set/unordered_set/end-size_type.md index 74ce0eeebd..69b16eb695 100644 --- a/reference/unordered_set/unordered_set/end-size_type.md +++ b/reference/unordered_set/unordered_set/end-size_type.md @@ -6,8 +6,11 @@ * cpp11[meta cpp] ```cpp -local_iterator end(size_type n); -const_local_iterator end(size_type n) const; +local_iterator end(size_type n); // (1) C++11 +constexpr local_iterator end(size_type n); // (1) C++26 + +const_local_iterator end(size_type n) const; // (2) C++11 +constexpr const_local_iterator end(size_type n) const; // (2) C++26 ``` ## 概要 @@ -93,3 +96,7 @@ bucket = 4, bucket_size = 2, keys = { C, B, } | [`begin(size_type)`](begin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/end.md b/reference/unordered_set/unordered_set/end.md index cd0a4e2688..79d29e801a 100644 --- a/reference/unordered_set/unordered_set/end.md +++ b/reference/unordered_set/unordered_set/end.md @@ -6,8 +6,11 @@ * cpp11[meta cpp] ```cpp -iterator end() noexcept; -const_iterator end() const noexcept; +iterator end() noexcept; // (1) C++11 +constexpr iterator end() noexcept; // (1) C++26 + +const_iterator end() const noexcept; // (2) C++11 +constexpr const_iterator end() const noexcept; // (2) C++26 ``` ## 概要 @@ -86,3 +89,7 @@ int main() | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/equal_range.md b/reference/unordered_set/unordered_set/equal_range.md index e675e5b6ba..04a95b22c9 100644 --- a/reference/unordered_set/unordered_set/equal_range.md +++ b/reference/unordered_set/unordered_set/equal_range.md @@ -7,16 +7,28 @@ ```cpp pair - equal_range(const key_type& x); // (1) C++11 + equal_range(const key_type& x); // (1) C++11 +constexpr pair + equal_range(const key_type& x); // (1) C++26 + pair equal_range(const key_type& x) const; // (2) C++11 +constexpr pair + equal_range(const key_type& x) const; // (2) C++26 template pair - equal_range(const K& k); // (3) C++20 + equal_range(const K& k); // (3) C++20 +template +constexpr pair + equal_range(const K& k); // (3) C++26 + template pair - equal_range(const K& k) const; // (4) C++20 + equal_range(const K& k) const; // (4) C++20 +template +constexpr pair + equal_range(const K& k) const; // (4) C++26 ``` ## 概要 @@ -113,3 +125,4 @@ equal_range(8): [5, 5) ## 参照 - [P0919R3 Heterogeneous lookup for unordered containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0919r3.html) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/erase.md b/reference/unordered_set/unordered_set/erase.md index f9d80f8753..64fcfe5b21 100644 --- a/reference/unordered_set/unordered_set/erase.md +++ b/reference/unordered_set/unordered_set/erase.md @@ -6,13 +6,17 @@ * cpp11[meta cpp] ```cpp -iterator erase(iterator position); // (1) C++17 +iterator erase(iterator position); // (1) C++17 +constexpr iterator erase(iterator position); // (1) C++26 -iterator erase(const_iterator position); // (2) C++11 +iterator erase(const_iterator position); // (2) C++11 +constexpr iterator erase(const_iterator position); // (2) C++26 -size_type erase(const key_type& k); // (3) C++11 +size_type erase(const key_type& k); // (3) C++11 +constexpr size_type erase(const key_type& k); // (3) C++26 -iterator erase(const_iterator first, const_iterator last); // (4) C++11 +iterator erase(const_iterator first, const_iterator last); // (4) C++11 +constexpr iterator erase(const_iterator first, const_iterator last); // (4) C++26 ``` ## 概要 @@ -201,3 +205,4 @@ int main() - [N2350 Container insert/erase and iterator constness (Revision 1)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2350.pdf) - [LWG Issue 2059. C++0x ambiguity problem with `map::erase`](https://cplusplus.github.io/LWG/issue2059) - C++17で、`erase(iterator)`を追加 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/erase_if_free.md b/reference/unordered_set/unordered_set/erase_if_free.md index ea70475735..e7c247882d 100644 --- a/reference/unordered_set/unordered_set/erase_if_free.md +++ b/reference/unordered_set/unordered_set/erase_if_free.md @@ -8,7 +8,10 @@ namespace std { template typename unordered_set::size_type - erase_if(unordered_set& c, Predicate pred); + erase_if(unordered_set& c, Predicate pred); // (1) C++20 + template + constexpr typename unordered_set::size_type + erase_if(unordered_set& c, Predicate pred); // (1) C++26 } ``` @@ -78,3 +81,4 @@ int main() ## 参照 - [P1209R0 Adopt consistent container erasure from Library Fundamentals 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1209r0.html) - [R1115R3 Improving the Return Value of Erase-Like Algorithms II: Free `erase`/`erase_if`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1115r3.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/extract.md b/reference/unordered_set/unordered_set/extract.md index 0bb7afefca..28b8e8066d 100644 --- a/reference/unordered_set/unordered_set/extract.md +++ b/reference/unordered_set/unordered_set/extract.md @@ -6,8 +6,11 @@ * cpp17[meta cpp] ```cpp -node_type extract(const_iterator position); (1) -node_type extract(const key_type& x); (2) +node_type extract(const_iterator position); // (1) C++17 +constexpr node_type extract(const_iterator position); // (1) C++26 + +node_type extract(const key_type& x); // (2) C++17 +constexpr node_type extract(const key_type& x); // (2) C++26 ``` ## 概要 @@ -136,3 +139,4 @@ s2 = { 3, 2 } ## 参照 - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/find.md b/reference/unordered_set/unordered_set/find.md index 77923eee23..b776a8ff66 100644 --- a/reference/unordered_set/unordered_set/find.md +++ b/reference/unordered_set/unordered_set/find.md @@ -6,11 +6,17 @@ * cpp11[meta cpp] ```cpp -iterator find(const key_type& x); // (1) C++11 -const_iterator find(const key_type& x) const; // (2) C++11 +iterator find(const key_type& x); // (1) C++11 +constexpr iterator find(const key_type& x); // (1) C++26 -template iterator find(const K& k); // (3) C++20 -template const_iterator find(const K& k) const; // (4) C++20 +const_iterator find(const key_type& x) const; // (2) C++11 +constexpr const_iterator find(const key_type& x) const; // (2) C++26 + +template iterator find(const K& k); // (3) C++20 +template constexpr iterator find(const K& k); // (3) C++26 + +template const_iterator find(const K& k) const; // (4) C++20 +template constexpr const_iterator find(const K& k) const; // (4) C++26 ``` ## 概要 @@ -101,3 +107,4 @@ not found ## 参照 - [P0919R3 Heterogeneous lookup for unordered containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0919r3.html) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/get_allocator.md b/reference/unordered_set/unordered_set/get_allocator.md index c770af92d7..a854c3da27 100644 --- a/reference/unordered_set/unordered_set/get_allocator.md +++ b/reference/unordered_set/unordered_set/get_allocator.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -allocator_type get_allocator() const noexcept; +allocator_type get_allocator() const noexcept; // (1) C++11 +constexpr allocator_type get_allocator() const noexcept; // (1) C++26 ``` ## 概要 @@ -116,3 +117,7 @@ libstdc++ の `unordered_set` では、アロケータの `select_on_container_c | [`swap`](swap_free.md) | 内容の交換(非メンバ関数) | | [`allocator`](/reference/memory/allocator.md) | デフォルトのアロケータ | | [`allocator_traits`](/reference/memory/allocator_traits.md) | アロケータのトレイツ | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/hash_function.md b/reference/unordered_set/unordered_set/hash_function.md index d3082b57d4..fca9ff922b 100644 --- a/reference/unordered_set/unordered_set/hash_function.md +++ b/reference/unordered_set/unordered_set/hash_function.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -hasher hash_function() const; +hasher hash_function() const; // (1) C++11 +constexpr hasher hash_function() const; // (1) C++26 ``` ## 概要 @@ -74,3 +75,7 @@ hash(2) = 2 |-----------------------------------------|------------------------------------------------------| | [`hash`](/reference/functional/hash.md) | デフォルトのハッシュ関数オブジェクト(class template) | | [`key_eq`](key_eq.md) | キー比較用関数オブジェクトの取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/insert.md b/reference/unordered_set/unordered_set/insert.md index e59ee0e8aa..88320d3b9b 100644 --- a/reference/unordered_set/unordered_set/insert.md +++ b/reference/unordered_set/unordered_set/insert.md @@ -7,39 +7,67 @@ ```cpp pair - insert(const value_type& v); // (1) C++11 + insert(const value_type& v); // (1) C++11 +constexpr pair + insert(const value_type& v); // (1) C++26 + pair - insert(value_type&& rv); // (2) C++11 + insert(value_type&& rv); // (2) C++11 +constexpr pair + insert(value_type&& rv); // (2) C++26 template -pair - insert(K&& x); // (3) C++26 +constexpr pair + insert(K&& x); // (3) C++26 iterator insert(const_iterator position, - const value_type& v); // (4) C++11 + const value_type& v); // (4) C++11 +constexpr iterator + insert(const_iterator position, + const value_type& v); // (4) C++26 + iterator insert(const_iterator position, - value_type&& rv); // (5) C++11 + value_type&& rv); // (5) C++11 +constexpr iterator + insert(const_iterator position, + value_type&& rv); // (5) C++26 template iterator insert(const_iterator hint, - K&& x); // (6) C++11 + K&& x); // (6) C++11 +template +constexpr iterator + insert(const_iterator hint, + K&& x); // (6) C++26 template void insert(InputIterator first, - InputIterator last); // (7) C++11 + InputIterator last); // (7) C++11 +template +constexpr void + insert(InputIterator first, + InputIterator last); // (7) C++26 void insert(initializer_list il); // (8) C++11 +constexpr void + insert(initializer_list il); // (8) C++26 insert_return_type - insert(node_type&& nh); // (9) C++17 + insert(node_type&& nh); // (9) C++17 +constexpr insert_return_type + insert(node_type&& nh); // (9) C++26 + iterator insert(const_iterator hint, - node_type&& nh); // (10) C++17 + node_type&& nh); // (10) C++17 +constexpr iterator + insert(const_iterator hint, + node_type&& nh); // (10) C++26 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -290,3 +318,4 @@ inline void unordered_set::insert(initializer_list`のバージョンが追加された +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/insert_range.md b/reference/unordered_set/unordered_set/insert_range.md index 133dbb95ef..d7778ca4c2 100644 --- a/reference/unordered_set/unordered_set/insert_range.md +++ b/reference/unordered_set/unordered_set/insert_range.md @@ -7,7 +7,9 @@ ```cpp template R> -void insert_range(R&& rg); // C++23 +void insert_range(R&& rg); // (1) C++23 +template R> +constexpr void insert_range(R&& rg); // (1) C++26 ``` ## 概要 @@ -70,3 +72,7 @@ int main () | 名前 | 説明 | |-------------------------------------------|----------------------| | [`insert`](insert.md) | 要素の追加 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/key_eq.md b/reference/unordered_set/unordered_set/key_eq.md index d5c80cdced..cb78aba8b8 100644 --- a/reference/unordered_set/unordered_set/key_eq.md +++ b/reference/unordered_set/unordered_set/key_eq.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -key_equal key_eq() const; +key_equal key_eq() const; // (1) C++11 +constexpr key_equal key_eq() const; // (1) C++26 ``` ## 概要 @@ -72,3 +73,7 @@ eq(1, 1) = true |----------------------------------------------------|----------------------------------------------| | [`equal_to`](/reference/functional/equal_to.md) | 等値比較演算関数オブジェクト(class template) | | [`hash_function`](hash_function.md) | ハッシュ関数オブジェクトの取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/load_factor.md b/reference/unordered_set/unordered_set/load_factor.md index 46c6dc735e..9f19614f3b 100644 --- a/reference/unordered_set/unordered_set/load_factor.md +++ b/reference/unordered_set/unordered_set/load_factor.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -float load_factor() const noexcept; +float load_factor() const noexcept; // (1) C++11 +constexpr float load_factor() const noexcept; // (1) C++26 ``` ## 概要 @@ -92,3 +93,7 @@ size is 10, bucket_count is 11, load_factor is 0.909091 | [`max_load_factor`](max_load_factor.md) | 負荷率の最大値を取得、設定 | | [`rehash`](rehash.md) | 最小バケット数指定によるバケット数の調整 | | [`reserve`](reserve.md) | 最小要素数指定によるバケット数の調整 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/max_bucket_count.md b/reference/unordered_set/unordered_set/max_bucket_count.md index 759028262a..00b81b4317 100644 --- a/reference/unordered_set/unordered_set/max_bucket_count.md +++ b/reference/unordered_set/unordered_set/max_bucket_count.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -size_type max_bucket_count() const noexcept; +size_type max_bucket_count() const noexcept; // (1) C++11 +constexpr size_type max_bucket_count() const noexcept; // (1) C++26 ``` ## 概要 @@ -65,3 +66,7 @@ max bucket count is 2305843009213693951 | [`end(size_type)`](end-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指すイテレータを取得 | | [`cbegin(size_type)`](cbegin-size_type.md) | インデックス(添え字)で指定したバケット内の先頭要素を指す読み取り専用イテレータを取得 | | [`cend(size_type)`](cend-size_type.md) | インデックス(添え字)で指定したバケット内の最終要素の次を指す読み取り専用イテレータを取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/max_load_factor.md b/reference/unordered_set/unordered_set/max_load_factor.md index 9bdd9508bb..c393ac68d3 100644 --- a/reference/unordered_set/unordered_set/max_load_factor.md +++ b/reference/unordered_set/unordered_set/max_load_factor.md @@ -6,8 +6,11 @@ * cpp11[meta cpp] ```cpp -float max_load_factor() const noexcept; // (1) -void max_load_factor(float z); // (2) +float max_load_factor() const noexcept; // (1) C++11 +constexpr float max_load_factor() const noexcept; // (1) C++26 + +void max_load_factor(float z); // (2) C++11 +constexpr void max_load_factor(float z); // (2) C++26 ``` ## 概要 @@ -183,3 +186,7 @@ size is 27, bucket_count is 29, load_factor is 0.931035, bucket_count * max_load | [`load_factor`](load_factor.md) | 現在の負荷率(バケットあたりの要素数の平均)を取得 | | [`rehash`](rehash.md) | 最小バケット数指定によるバケット数の調整 | | [`reserve`](reserve.md) | 最小要素数指定によるバケット数の調整 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/max_size.md b/reference/unordered_set/unordered_set/max_size.md index eca44e32ad..9c3caed047 100644 --- a/reference/unordered_set/unordered_set/max_size.md +++ b/reference/unordered_set/unordered_set/max_size.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -size_type max_size() const noexcept; +size_type max_size() const noexcept; // (1) C++11 +constexpr size_type max_size() const noexcept; // (1) C++26 ``` ## 概要 @@ -67,3 +68,7 @@ C++11 ではアロケータにメンバ関数 `max_size` は必須ではない |-----------------------|----------------------------| | [`empty`](empty.md) | コンテナが空かどうかを判定 | | [`size`](size.md) | 要素数の取得 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/merge.md b/reference/unordered_set/unordered_set/merge.md index dfe1913e0d..f0ae2ae30e 100644 --- a/reference/unordered_set/unordered_set/merge.md +++ b/reference/unordered_set/unordered_set/merge.md @@ -7,13 +7,24 @@ ```cpp template - void merge(unordered_set& source); // (1) +void merge(unordered_set& source); // (1) C++17 template - void merge(unordered_set&& source); // (2) +constexpr void merge(unordered_set& source); // (1) C++26 + +template +void merge(unordered_set&& source); // (2) C++17 +template +constexpr void merge(unordered_set&& source); // (2) C++26 + +template +void merge(unordered_multiset& source); // (3) C++17 +template +constexpr void merge(unordered_multiset& source); // (3) C++26 + template - void merge(unordered_multiset& source); // (3) +void merge(unordered_multiset&& source); // (4) C++17 template - void merge(unordered_multiset&& source); // (4) +constexpr void merge(unordered_multiset&& source); // (4) C++26 ``` ## 概要 @@ -86,3 +97,4 @@ s2 = { 20, 30, 10 } ## 参照 - [Splicing Maps and Sets(Revision 5)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0083r3.pdf) +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/op_assign.md b/reference/unordered_set/unordered_set/op_assign.md index 64d8ce2ba6..a75d492d3c 100644 --- a/reference/unordered_set/unordered_set/op_assign.md +++ b/reference/unordered_set/unordered_set/op_assign.md @@ -6,13 +6,21 @@ * cpp11[meta cpp] ```cpp -unordered_set& operator=(const unordered_set& v); // (1) -unordered_set& operator=(unordered_set&& rv); // (2) +unordered_set& operator=(const unordered_set& v); // (1) C++11 +constexpr unordered_set& operator=(const unordered_set& v); // (1) C++26 + +unordered_set& operator=(unordered_set&& rv); // (2) C++11 unordered_set& operator=(unordered_set&& x) noexcept(allocator_traits::is_always_equal::value && is_nothrow_move_assignable::value && is_nothrow_move_assignable::value); // (2) C++17 -unordered_set& operator=(initializer_list il); // (3) +constexpr unordered_set& operator=(unordered_set&& x) + noexcept(allocator_traits::is_always_equal::value + && is_nothrow_move_assignable::value + && is_nothrow_move_assignable::value); // (2) C++26 + +unordered_set& operator=(initializer_list il); // (3) C++11 +constexpr unordered_set& operator=(initializer_list il); // (3) C++26 ``` * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -90,3 +98,4 @@ unordered_set& operator=(initializer_list il); // (3) - (3)の経緯となる提案文書 - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) - `noexcept` 追加の経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/op_constructor.md b/reference/unordered_set/unordered_set/op_constructor.md index 4ee4fba7a3..56d75570d8 100644 --- a/reference/unordered_set/unordered_set/op_constructor.md +++ b/reference/unordered_set/unordered_set/op_constructor.md @@ -6,91 +6,174 @@ * cpp11[meta cpp] ```cpp -unordered_set(); // (1) C++14 - -explicit unordered_set(size_type n, - const hasher& hf = hasher(), - const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); // (2) C++14 - - -explicit unordered_set(size_type n = 実装依存の既定値, - const hasher& hf = hasher(), - const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); // (1) + (2) C++11 +unordered_set(); // (1) C++14 +constexpr unordered_set(); // (1) C++26 + +explicit + unordered_set(size_type n, + const hasher& hf = hasher(), + const key_equal& eql = key_equal(), + const allocator_type& a = allocator_type()); // (2) C++14 +constexpr explicit + unordered_set(size_type n, + const hasher& hf = hasher(), + const key_equal& eql = key_equal(), + const allocator_type& a = allocator_type()); // (2) C++26 + + +explicit + unordered_set(size_type n = 実装依存の既定値, + const hasher& hf = hasher(), + const key_equal& eql = key_equal(), + const allocator_type& a = allocator_type()); // (1) + (2) C++11 template -unordered_set(InputIterator first, InputIterator last, +unordered_set(InputIterator first, + InputIterator last, size_type n = 実装依存の既定値, const hasher& hf = hasher(), const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); // (3) + const allocator_type& a = allocator_type()); // (3) C++11 +template +constexpr + unordered_set(InputIterator first, + InputIterator last, + size_type n = 実装依存の既定値, + const hasher& hf = hasher(), + const key_equal& eql = key_equal(), + const allocator_type& a = allocator_type()); // (3) C++26 -unordered_set(const unordered_set& v); // (4) +unordered_set(const unordered_set& v); // (4) C++11 +constexpr unordered_set(const unordered_set& v); // (4) C++26 -unordered_set(unordered_set&& rv); // (5) +unordered_set(unordered_set&& rv); // (5) C++11 +constexpr unordered_set(unordered_set&& rv); // (5) C++26 -explicit unordered_set(const allocator_type& a); // (6) +explicit unordered_set(const allocator_type& a); // (6) C++11 +constexpr explicit unordered_set(const allocator_type& a); // (6) C++26 -unordered_set(const unordered_set& v, const allocator_type& a); // (7) +unordered_set(const unordered_set& v, const allocator_type& a); // (7) C++11 unordered_set(const unordered_set& v, - const type_identity_t& a); // (7) C++23 + const type_identity_t& a); // (7) C++23 +constexpr + unordered_set(const unordered_set& v, + const type_identity_t& a); // (7) C++26 -unordered_set(unordered_set&& rv, const allocator_type& a); // (8) +unordered_set(unordered_set&& rv, const allocator_type& a); // (8) C++11 unordered_set(unordered_set&& rv, - const type_identity_t& a); // (8) C++23 + const type_identity_t& a); // (8) C++23 +constexpr + unordered_set(unordered_set&& rv, + const type_identity_t& a); // (8) C++26 unordered_set(initializer_list il, size_type n = 実装依存の既定値, const hasher& hf = hasher(), const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); // (9) + const allocator_type& a = allocator_type()); // (9) C++11 +constexpr + unordered_set(initializer_list il, + size_type n = 実装依存の既定値, + const hasher& hf = hasher(), + const key_equal& eql = key_equal(), + const allocator_type& a = allocator_type()); // (9) C++26 -unordered_set(size_type n, const allocator_type& a); // (10) C++14 +unordered_set(size_type n, const allocator_type& a); // (10) C++14 +constexpr unordered_set(size_type n, const allocator_type& a); // (10) C++26 unordered_set(size_type n, const hasher& hf, - const allocator_type& a); // (11) C++14 + const allocator_type& a); // (11) C++14 +constexpr + unordered_set(size_type n, + const hasher& hf, + const allocator_type& a); // (11) C++26 template unordered_set(InputIterator f, InputIterator l, size_type n, - const allocator_type& a); // (12) C++14 + const allocator_type& a); // (12) C++14 +template +constexpr + unordered_set(InputIterator f, + InputIterator l, + size_type n, + const allocator_type& a); // (12) C++26 template unordered_set(InputIterator f, InputIterator l, size_type n, const hasher& hf, - const allocator_type& a); // (13) C++14 + const allocator_type& a); // (13) C++14 +template +constexpr + unordered_set(InputIterator f, + InputIterator l, + size_type n, + const hasher& hf, + const allocator_type& a); // (13) C++26 unordered_set(initializer_list il, size_type n, - const allocator_type& a); // (14) C++14 + const allocator_type& a); // (14) C++14 +constexpr + unordered_set(initializer_list il, + size_type n, + const allocator_type& a); // (14) C++26 unordered_set(initializer_list il, size_type n, const hasher& hf, - const allocator_type& a); // (15) C++14 + const allocator_type& a); // (15) C++14 +constexpr + unordered_set(initializer_list il, + size_type n, + const hasher& hf, + const allocator_type& a); // (15) C++26 template R> -unordered_set(std::from_range_t, R&& rg, +unordered_set(std::from_range_t, + R&& rg, size_type n = 実装依存の既定値, const hasher& hf = hasher(), const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); // (16) C++23 + const allocator_type& a = allocator_type()); // (16) C++23 +template R> +constexpr + unordered_set(std::from_range_t, + R&& rg, + size_type n = 実装依存の既定値, + const hasher& hf = hasher(), + const key_equal& eql = key_equal(), + const allocator_type& a = allocator_type()); // (16) C++26 template R> -unordered_set(std::from_range_t, R&& rg, +unordered_set(std::from_range_t, + R&& rg, size_type n, - const allocator_type& a); // (17) C++23 + const allocator_type& a); // (17) C++23 +template R> +constexpr + unordered_set(std::from_range_t, + R&& rg, + size_type n, + const allocator_type& a); // (17) C++26 template R> -unordered_set(std::from_range_t, R&& rg, +unordered_set(std::from_range_t, + R&& rg, size_type n, const hasher& hf, - const allocator_type& a); // (18) C++23 + const allocator_type& a); // (18) C++23 +template R> +constexpr + unordered_set(std::from_range_t, + R&& rg, + size_type n, + const hasher& hf, + const allocator_type& a); // (18) C++26 ``` * type_identity_t[link /reference/type_traits/type_identity.md] * initializer_list[link /reference/initializer_list/initializer_list.md] @@ -276,3 +359,4 @@ libstdc++ には 4.8.2 現在、(6), (7), (8)の形式はない。 なお、Discussion の例はアロケータの型が誤っているので注意 - [P1518R2 Stop Overconstraining Allocators in Container Deduction Guides](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1518r2.html) - C++23でのアロケータ引数を`type_identity_t`で包む変更 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/op_destructor.md b/reference/unordered_set/unordered_set/op_destructor.md index 7fbe687cab..a3a412a34a 100644 --- a/reference/unordered_set/unordered_set/op_destructor.md +++ b/reference/unordered_set/unordered_set/op_destructor.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -~unordered_set(); +~unordered_set(); // (1) C++11 +constexpr ~unordered_set(); // (1) C++26 ``` ## 概要 @@ -37,3 +38,7 @@ |----------------------------------------|----------------| | [`(constructor)`](op_constructor.md) | コンストラクタ | | [`operator=`](op_assign.md) | 代入演算子 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/op_equal.md b/reference/unordered_set/unordered_set/op_equal.md index 882fa77087..dcdd00fc94 100644 --- a/reference/unordered_set/unordered_set/op_equal.md +++ b/reference/unordered_set/unordered_set/op_equal.md @@ -9,6 +9,9 @@ namespace std { template bool operator==(const unordered_set& a, const unordered_set& b); // (1) C++11 + template + constexpr bool operator==(const unordered_set& a, + const unordered_set& b); // (1) C++26 } ``` @@ -131,3 +134,4 @@ namespace std { - [P0809R0 Comparing Unordered Containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0809r0.pdf) - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/op_not_equal.md b/reference/unordered_set/unordered_set/op_not_equal.md index 5c6fe89e99..8a460ae1ee 100644 --- a/reference/unordered_set/unordered_set/op_not_equal.md +++ b/reference/unordered_set/unordered_set/op_not_equal.md @@ -10,6 +10,9 @@ namespace std { template bool operator!=(const unordered_set& a, const unordered_set& b); // (1) C++11 + template + constexpr bool operator!=(const unordered_set& a, + const unordered_set& b); // (1) C++26 } ``` @@ -121,3 +124,4 @@ namespace std { - [P0809R0 Comparing Unordered Containers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0809r0.pdf) - [P1614R2 The Mothership has Landed](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html) - C++20での三方比較演算子の追加と、関連する演算子の自動導出 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/rehash.md b/reference/unordered_set/unordered_set/rehash.md index e4fea065e5..b8b1f95fcb 100644 --- a/reference/unordered_set/unordered_set/rehash.md +++ b/reference/unordered_set/unordered_set/rehash.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -void rehash(size_type n); +void rehash(size_type n); // (1) C++11 +constexpr void rehash(size_type n); // (1) C++26 ``` ## 概要 @@ -98,3 +99,7 @@ bucket_count is 7 | [`load_factor`](load_factor.md) | 現在の負荷率(バケットあたりの要素数の平均)を取得 | | [`max_load_factor`](max_load_factor.md) | 負荷率の最大値を取得、設定 | | [`reserve`](reserve.md) | 最小要素数指定によるバケット数の調整 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/reserve.md b/reference/unordered_set/unordered_set/reserve.md index 0810b91b1b..d8e532128e 100644 --- a/reference/unordered_set/unordered_set/reserve.md +++ b/reference/unordered_set/unordered_set/reserve.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -void reserve(size_type n); +void reserve(size_type n); // (1) C++11 +constexpr void reserve(size_type n); // (1) C++26 ``` ## 概要 @@ -104,3 +105,7 @@ bucket_count is 7 | [`insert`](insert.md) | 要素の追加 | | [`emplace`](emplace.md) | コンテナ内への要素の直接構築 | | [`emplace_hint`](emplace_hint.md) | 挿入位置のヒントを使用したコンテナ内への要素の直接構築 | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/size.md b/reference/unordered_set/unordered_set/size.md index 0a855b5f15..eaa9a38f61 100644 --- a/reference/unordered_set/unordered_set/size.md +++ b/reference/unordered_set/unordered_set/size.md @@ -6,7 +6,8 @@ * cpp11[meta cpp] ```cpp -size_type size() const noexcept; +size_type size() const noexcept; // (1) C++11 +constexpr size_type size() const noexcept; // (1) C++26 ``` ## 概要 @@ -70,3 +71,7 @@ int main() | [`begin`](begin.md) | 先頭要素を指すイテレータの取得 | | [`end`](end.md) | 最終要素の次を指すイテレータの取得 | | [`distance`](/reference/iterator/distance.md) | イテレータ間の距離を求める | + + +## 参照 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/swap.md b/reference/unordered_set/unordered_set/swap.md index 4c5e6d8a6f..76b8d82353 100644 --- a/reference/unordered_set/unordered_set/swap.md +++ b/reference/unordered_set/unordered_set/swap.md @@ -6,11 +6,15 @@ * cpp11[meta cpp] ```cpp -void swap(unordered_set& v); +void swap(unordered_set& v); // (1) C++11 void swap(unordered_set& x) noexcept(allocator_traits::is_always_equal::value && noexcept(swap(declval(),declval())) - && noexcept(swap(declval(),declval()))); // C++17 + && noexcept(swap(declval(),declval()))); // (1) C++17 +constexpr void swap(unordered_set& x) + noexcept(allocator_traits::is_always_equal::value + && noexcept(swap(declval(),declval())) + && noexcept(swap(declval(),declval()))); // (1) C++26 ``` ## 概要 @@ -116,3 +120,4 @@ us2 after : 9 7 5 3 1 ## 参照 - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) - `noexcept` 追加の経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) diff --git a/reference/unordered_set/unordered_set/swap_free.md b/reference/unordered_set/unordered_set/swap_free.md index a941439f52..2362334efd 100644 --- a/reference/unordered_set/unordered_set/swap_free.md +++ b/reference/unordered_set/unordered_set/swap_free.md @@ -8,12 +8,15 @@ namespace std { template void swap(unordered_set& x, - unordered_set& y); - + unordered_set& y); // (1) C++11 template void swap(unordered_set& x, unordered_set& y) - noexcept(noexcept(x.swap(y))); // C++17 + noexcept(noexcept(x.swap(y))); // (1) C++17 + template + constexpr void swap(unordered_set& x, + unordered_set& y) + noexcept(noexcept(x.swap(y))); // (1) C++26 } ``` @@ -106,3 +109,4 @@ namespace std { ## 参照 - [N4258 Cleaning-up noexcept in the Library, Rev 3](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4258.pdf) - `noexcept` 追加の経緯となる提案文書 +- [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) From ac7082b8a07f09606cad2dab23a6874d6195613a Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 20 Feb 2026 15:50:20 +0900 Subject: [PATCH 2615/3948] =?UTF-8?q?C++23=E5=AF=BE=E5=BF=9C=E3=81=A8?= =?UTF-8?q?=E3=81=97=E3=81=A6=E3=80=81=E5=85=A5=E5=8A=9B=E3=82=B9=E3=83=88?= =?UTF-8?q?=E3=83=AA=E3=83=BC=E3=83=A0=E3=81=AE=E3=82=A8=E3=83=A9=E3=83=BC?= =?UTF-8?q?=E5=87=A6=E7=90=86=E3=82=92=E3=82=B3=E3=83=B3=E3=83=91=E3=82=A4?= =?UTF-8?q?=E3=83=A9=E3=81=AE=E5=AE=9F=E8=A3=85=E3=81=AB=E5=8D=B3=E3=81=97?= =?UTF-8?q?=E3=81=9F=E4=BB=95=E6=A7=98=E3=81=AB=E3=81=97=E3=81=9F=20#1113?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/bitset/bitset/op_istream.md | 4 +++- reference/istream/basic_istream.md | 8 +++++++- reference/istream/basic_istream/get.md | 10 ++++++---- reference/istream/basic_istream/getline.md | 8 +++++--- reference/istream/basic_istream/ignore.md | 4 +++- reference/istream/basic_istream/op_istream.md | 10 ++++++---- reference/istream/basic_istream/op_istream_free.md | 6 ++++-- reference/istream/basic_istream/peek.md | 2 ++ reference/istream/basic_istream/putback.md | 6 ++++-- reference/istream/basic_istream/read.md | 6 ++++-- reference/istream/basic_istream/readsome.md | 10 ++++++---- reference/istream/basic_istream/seekg.md | 4 +++- reference/istream/basic_istream/sync.md | 4 +++- reference/istream/basic_istream/tellg.md | 2 ++ reference/istream/basic_istream/unget.md | 6 ++++-- reference/string/basic_string/getline.md | 10 +++++++--- reference/string/basic_string/op_istream.md | 4 +++- 17 files changed, 72 insertions(+), 32 deletions(-) diff --git a/reference/bitset/bitset/op_istream.md b/reference/bitset/bitset/op_istream.md index 9a10a8cfbc..c6cc9cae12 100644 --- a/reference/bitset/bitset/op_istream.md +++ b/reference/bitset/bitset/op_istream.md @@ -22,7 +22,7 @@ namespace std { - 次に読み込む文字が`is.widen('0')`と`is.widen('1')`のどちらでもなかった。 2. 読み込んだ文字列`str`を`bitset`のコンストラクタに渡して構築し、`x`に代入する:`x = bitset(str);` -`str`に1文字も入力が行われなかった場合、`is.`[`setstate`](/reference/ios/basic_ios/setstate.md)`(`[`ios_base`](/reference/ios/ios_base.md)`::failbit)`が呼び出される。 +1文字も入力が行われなかった場合、ローカルエラー状態に[`ios_base`](/reference/ios/ios_base.md)`::failbit`を設定する。 ## 戻り値 `is` @@ -53,3 +53,5 @@ int main() ## 参照 +- [P1264R2 Revising the wording of stream input operations](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1264r2.pdf) + - C++23でローカルエラー状態の概念が導入され、入力関数のエラー処理セマンティクスが明確化された diff --git a/reference/istream/basic_istream.md b/reference/istream/basic_istream.md index e93ba8c7ec..282334181a 100644 --- a/reference/istream/basic_istream.md +++ b/reference/istream/basic_istream.md @@ -55,13 +55,17 @@ namespace std { 注意:書式化入力関数と非書式化入力関数すべてについて、「効果」の項目は以下の処理を前提として記載している。 -書式化入力関数・非書式化入力関数は、入力処理に先立って`sentry`オブジェクトを構築し、関数から脱出する前に破棄する。 +書式化入力関数・非書式化入力関数は、まず`ios_base::iostate`型のオブジェクトであるローカルエラー状態を`ios_base::goodbit`で初期化して作成する。 +次に、`sentry`オブジェクトを構築し、関数から脱出する前に破棄する。 - 書式化入力関数は、`sentry`コンストラクタの2番目の仮引数`noskipws`に`false`を渡す。 - 非書式化入力関数は、`sentry`コンストラクタの2番目の仮引数`noskipws`に`true`を渡す。 構築した`sentry`オブジェクトが`explicit operator bool`関数で`true`に変換できる場合のみ、実際の入力処理(各関数の「効果」として記載した処理)が実行される。 +入力処理中にエラーが検出された場合、対応するエラービットはローカルエラー状態に設定される。 +入力処理の完了後、ローカルエラー状態を実引数として`setstate()`を呼び出す。 + 関数内部で例外が送出された場合、`ios_base::badbit`を設定する。 そして、`(exceptions() & badbit) != 0`であれば例外を再送出する。 @@ -142,3 +146,5 @@ syncは非書式化入力関数である。 - `basic_istream<>`型のオブジェクト - [`cin`](../iostream/cin.md) - [`wcin`](../iostream/wcin.md.nolink) +- [P1264R2 Revising the wording of stream input operations](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1264r2.pdf) + - C++23からローカルエラー状態の概念が導入され、入力関数のエラー処理セマンティクスが明確化された diff --git a/reference/istream/basic_istream/get.md b/reference/istream/basic_istream/get.md index 4d5a8772d9..207396d32f 100644 --- a/reference/istream/basic_istream/get.md +++ b/reference/istream/basic_istream/get.md @@ -30,7 +30,7 @@ basic_istream& get(basic_streambuf& sb, char_t ### 1文字 1. `sentry`オブジェクトを構築する。`sentry`オブジェクトが失敗を示した場合、何もしない。 1. ストリームバッファから1文字入力を行う。 -1. 入力が行えなかった場合、`setstate(failbit)`を呼び出す。 +1. 入力が行えなかった場合、ローカルエラー状態に`failbit`を設定する。 1. (引数`c`を受け取るもののみ)入力した文字を`c`に代入する。 ### 文字列 @@ -46,15 +46,15 @@ basic_istream& get(basic_streambuf& sb, char_t 1. 以下のいずれかを満たすまで、文字を入力して書き込む。 - 配列要素へのポインタ`s`を引数に取るもの - 引数`n`文字より1文字少ない文字数まで入力した。 - - EOFに達した。この場合、`setstate(eofbit)`を呼び出す。 + - EOFに達した。この場合、ローカルエラー状態に`eofbit`を設定する。 - 次に入力する文字を`c`として、`Traits::eq_int_type(Traits::to_int_type(c), delim)`が真となった。 - ストリームバッファへのポインタ`sb`を引数に取るもの - - EOFに達した。この場合、`setstate(eofbit)`を呼び出す。 + - EOFに達した。この場合、ローカルエラー状態に`eofbit`を設定する。 - `sb`への出力処理に失敗した。 - 次に入力する文字を`c`として、`Traits::eq_int_type(Traits::to_int_type(c), delim)`が真となった。 - 例外が送出された(例外は捕捉され、再送出されることはない)。 -`str`に1文字も入力が行われなかった場合、`is.setstate(ios_base::failbit)`が呼び出される。 +1文字も入力が行われなかった場合、ローカルエラー状態に`failbit`を設定する。 配列要素へのポインタ`s`を引数に取るものについては、入力の如何に関わらず末尾にヌル文字を書き込む処理が行われる。 @@ -105,3 +105,5 @@ TBD ## 参照 - [`basic_streambuf`](../../streambuf/basic_streambuf.md) +- [P1264R2 Revising the wording of stream input operations](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1264r2.pdf) + - C++23でローカルエラー状態の概念が導入され、入力関数のエラー処理セマンティクスが明確化された diff --git a/reference/istream/basic_istream/getline.md b/reference/istream/basic_istream/getline.md index 3431208e50..12a51a2ef1 100644 --- a/reference/istream/basic_istream/getline.md +++ b/reference/istream/basic_istream/getline.md @@ -19,10 +19,10 @@ basic_istream& getline(char_type* s, streamsize n, char_type deli 1. [`basic_istream<>::sentry`](../../istream/basic_istream/sentry.md)オブジェクトを構築する。`sentry`オブジェクトが失敗を示した場合、何もしない。 1. 以下のいずれかを満たすまで、文字を入力して配列の要素へのポインタ`s`に書き込んでゆく。以下の条件判断はこの順で行う。 - 1. EOFに達した。この場合、`is.setstate(ios_base::eofbit)`を呼び出す。 + 1. EOFに達した。この場合、ローカルエラー状態に`eofbit`を設定する。 1. `Traits::eq(c, delim)`が真となった。 - 1. 読み取った文字数が`n - 1`になるまで書き込んだもしくは`n`が1未満であった。この場合、`is.setstate(ios_base::failbit)`を呼び出す。 -1. (`sentry`オブジェクトを破棄したのち)1文字も入力がなされなかったら、`is.setstate(ios_base::failbit)`を呼び出す。 + 1. 読み取った文字数が`n - 1`になるまで書き込んだもしくは`n`が1未満であった。この場合、ローカルエラー状態に`failbit`を設定する。 +1. 1文字も入力がなされなかったら、ローカルエラー状態に`failbit`を設定する。 - 空行の場合はこれに該当しないことに注意。なぜなら、改行文字1文字を入力しているためである。 `n`が1以上の場合、必ず`s`の末尾にヌル文字を書き込む。 @@ -85,3 +85,5 @@ TBD ## 参照 - [`std::getline`](../../string/basic_string/getline.md): `std::basic_string`へ入力を行うもの。 +- [P1264R2 Revising the wording of stream input operations](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1264r2.pdf) + - C++23でローカルエラー状態の概念が導入され、入力関数のエラー処理セマンティクスが明確化された diff --git a/reference/istream/basic_istream/ignore.md b/reference/istream/basic_istream/ignore.md index 62461e5e36..70130813c4 100644 --- a/reference/istream/basic_istream/ignore.md +++ b/reference/istream/basic_istream/ignore.md @@ -27,7 +27,7 @@ basic_istream& ignore(streamsize n, char_type delim); // (2) C++26 2. 以下のいずれかを満たすまで、`this`内のストリームバッファから文字を入力する(どこへも出力することなく捨てる)。 - 実引数で指定された`n`文字まで入力した。 - `n == numeric_limits::max()`の場合、この条件は適用されない。 - - EOFに達した。この場合、`setstate(eofbit)`を呼び出す。 + - EOFに達した。この場合、ローカルエラー状態に`eofbit`を設定する。 - 次に入力する文字が`delim`である。 - 次の文字を`c`として、`Traits::eq_int_type(Traits::to_int_type(c), delim)`が真の場合。 - `delim`が`Traits::eof()`である場合、この条件は適用されない。 @@ -80,5 +80,7 @@ TBD - C++98 ## 参照 +- [P1264R2 Revising the wording of stream input operations](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1264r2.pdf) + - C++23でローカルエラー状態の概念が導入され、入力関数のエラー処理セマンティクスが明確化された - [P3223R2 Making std::istream::ignore less surprising](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3223r2.html) - C++26からオーバーロード(2)が追加された diff --git a/reference/istream/basic_istream/op_istream.md b/reference/istream/basic_istream/op_istream.md index e2e9b6dd0b..54f4589cf5 100644 --- a/reference/istream/basic_istream/op_istream.md +++ b/reference/istream/basic_istream/op_istream.md @@ -55,27 +55,27 @@ basic_istream& 1. `sentry`オブジェクトを構築する。`sentry`オブジェクトが失敗を示した場合、何もしない 1. `num_get::get`を使用して入力のパース・数値への変換を行う。 - - `int`と`short` : `long`を実引数に取るものを使用する。結果が`int`と`short`それぞれの範囲外の値になった場合、`failbit`を追加する + - `int`と`short` : `long`を実引数に取るものを使用する。結果が`int`と`short`それぞれの範囲外の値になった場合、ローカルエラー状態に`failbit`を設定する - 拡張浮動小数点数型 : - 拡張浮動小数点数型の変換順位が`long double`より大きい場合、条件付きサポートとなる - そうでない場合、対応する標準浮動小数点数型`FP`を以下のように定義し、`FP`型の値として値を入力したあと、拡張浮動小数点数型にキャストして代入する - 拡張浮動小数点数型の変換順位が`float`以下の場合、`FP`を`float`とする - そうでなく、拡張浮動小数点数型の変換順位が`double`以下の場合、`FP`を`double`とする - そうでない場合、`FP`を`long double`とする -1. `num_get::get`から得られた`iostate`値を実引数にして`setstate`関数を呼び出す +1. `num_get::get`から得られた`iostate`値をローカルエラー状態に設定する ### (18) : ストリームバッファ ストリームからの入力を別のストリームバッファに出力する。 -1. 仮引数`sb`がヌルポインタの場合、`setstate(failbit)`を呼び出して終了する +1. 仮引数`sb`がヌルポインタの場合、ローカルエラー状態に`failbit`を設定して終了する 1. `sentry`オブジェクトを構築する。`sentry`オブジェクトが失敗を示した場合、何もしない 1. 以下のいずれかを満たすまで、`this`内のストリームバッファから文字を入力して`sb`へ出力する - EOFに達した - 出力処理に失敗した(この場合、失敗したときの文字は入力側のストリームバッファに戻される) - 例外が発生した -入力がなされなかった場合、`setstate(failbit)`を呼び出す。 +入力がなされなかった場合、ローカルエラー状態に`failbit`を設定する。 ## 戻り値 @@ -125,5 +125,7 @@ TBD ## 参照 - [N2114 `long long` Goes to the Library, Revision 1](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2114.html) +- [P1264R2 Revising the wording of stream input operations](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1264r2.pdf) + - C++23でローカルエラー状態の概念が導入され、入力関数のエラー処理セマンティクスが明確化された - [P1467R9 Extended floating-point types and standard names](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1467r9.html) - C++23で拡張浮動小数点数型の`istream`入力がサポートされた diff --git a/reference/istream/basic_istream/op_istream_free.md b/reference/istream/basic_istream/op_istream_free.md index 152d4f5f02..517747048f 100644 --- a/reference/istream/basic_istream/op_istream_free.md +++ b/reference/istream/basic_istream/op_istream_free.md @@ -59,7 +59,7 @@ namespace std { 1. `sentry`オブジェクトを構築する。`sentry`オブジェクト構築が失敗を示した場合、何もしない。 1. ストリームバッファから1文字取り出し、仮引数`c`に書き込む。 -入力がなされなかった場合、`setstate(failbit)`を呼び出す。 +入力がなされなかった場合、ローカルエラー状態に`failbit`を設定する。 ### 文字列 @@ -77,7 +77,7 @@ namespace std { 1. `s`の末尾にヌル文字`CharT()`を書き込む。 1. `width(0)`を呼び出す。 -1文字も入力がなされなかった場合、`setstate(failbit)`を呼び出す。 +1文字も入力がなされなかった場合、ローカルエラー状態に`failbit`を設定する。 `width()`の値を変更するには、`setw`マニピュレータまたは`width()`メンバ関数を使用する。 @@ -133,3 +133,5 @@ TBD ## 参照 - [P0487R1 Fixing `operator>>(basic_istream&, CharT*)` (LWG 2499)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0487r1.html) +- [P1264R2 Revising the wording of stream input operations](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1264r2.pdf) + - C++23でローカルエラー状態の概念が導入され、入力関数のエラー処理セマンティクスが明確化された diff --git a/reference/istream/basic_istream/peek.md b/reference/istream/basic_istream/peek.md index 0788400516..275fb3b2d0 100644 --- a/reference/istream/basic_istream/peek.md +++ b/reference/istream/basic_istream/peek.md @@ -90,3 +90,5 @@ int_type peek() { - [`basic_istream::get`](get.md) - [`basic_streambuf::sgetc`](../../streambuf/basic_streambuf/sgetc.md) +- [P1264R2 Revising the wording of stream input operations](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1264r2.pdf) + - C++23でローカルエラー状態の概念が導入され、入力関数のエラー処理セマンティクスが明確化された diff --git a/reference/istream/basic_istream/putback.md b/reference/istream/basic_istream/putback.md index aa5fd0fd41..c062cf2908 100644 --- a/reference/istream/basic_istream/putback.md +++ b/reference/istream/basic_istream/putback.md @@ -17,9 +17,9 @@ basic_istream& putback(char_type c); ## 効果 1. `sentry`オブジェクトを構築する。 -1. `!good()`なら`setstate(failbit)`を呼び出して終わる。 +1. `!good()`ならローカルエラー状態に`failbit`を設定して終わる。 1. `rdbuf()->sputbackc()`を呼び出す。 - - `rdbuf()`がヌルポインタであるか、`sputbackc()`が`Traits::eof()`を返した場合、`setstate(badbit)`を呼び出す。 + - `rdbuf()`がヌルポインタであるか、`sputbackc()`が`Traits::eof()`を返した場合、ローカルエラー状態に`badbit`を設定する。 ## 戻り値 `*this`。 @@ -97,3 +97,5 @@ basic_istream& putback(char_type c) { - [`basic_istream::unget`](unget.md) - [`basic_streambuf::sputbackc`](../../streambuf/basic_streambuf/sputbackc.md) +- [P1264R2 Revising the wording of stream input operations](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1264r2.pdf) + - C++23でローカルエラー状態の概念が導入され、入力関数のエラー処理セマンティクスが明確化された diff --git a/reference/istream/basic_istream/read.md b/reference/istream/basic_istream/read.md index 54546482c1..125cd4b0c5 100644 --- a/reference/istream/basic_istream/read.md +++ b/reference/istream/basic_istream/read.md @@ -19,10 +19,10 @@ basic_istream& read(char_type* s, streamsize n); ## 効果 1. [`sentry`](sentry.md)オブジェクトを構築する。[`sentry`](sentry.md)オブジェクトが失敗を示した場合、何もしない。 -1. [`good`](../../ios/basic_ios/good.md)`()`メンバ関数を呼び出して`false`であったら、[`setstate`](../../ios/basic_ios/setstate.md)`(`[`failbit`](../../ios/ios_base/type-iostate.md)`)`を呼び出して終了する。 +1. [`good`](../../ios/basic_ios/good.md)`()`メンバ関数を呼び出して`false`であったら、ローカルエラー状態に[`failbit`](../../ios/ios_base/type-iostate.md)を設定して終了する。 1. 以下のいずれかを満たすまで、文字を入力して書き込む。 - 実引数で指定された`n`文字まで入力した。 - - EOFに達した。この場合、[`setstate`](../../ios/basic_ios/setstate.md)`(`[`failbit`](../../ios/ios_base/type-iostate.md) `|` [`eofbit`](../../ios/ios_base/type-iostate.md)`)`を呼び出す。 + - EOFに達した。この場合、ローカルエラー状態に[`failbit`](../../ios/ios_base/type-iostate.md) `|` [`eofbit`](../../ios/ios_base/type-iostate.md)を設定する。 ## 戻り値 `*this` @@ -97,3 +97,5 @@ basic_istream& read(char_type* s, streamsize n) { ## 参照 - [readsome](readsome.md) +- [P1264R2 Revising the wording of stream input operations](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1264r2.pdf) + - C++23でローカルエラー状態の概念が導入され、入力関数のエラー処理セマンティクスが明確化された diff --git a/reference/istream/basic_istream/readsome.md b/reference/istream/basic_istream/readsome.md index 8c19828a5d..810efd10a2 100644 --- a/reference/istream/basic_istream/readsome.md +++ b/reference/istream/basic_istream/readsome.md @@ -15,11 +15,11 @@ streamsize readsome(char_type* s, streamsize n); ## 効果 1. `sentry`オブジェクトを構築する。 -1. `good()`メンバ関数を呼び出して`false`であったら、`setstate(failbit)`を呼び出して終了する。 -1. `rebuf()->in_avail()`の値により以下のように処理を進める。 - - `-1`なら`setstate(eofbit)`を呼び出す。 +1. `good()`メンバ関数を呼び出して`false`であったら、ローカルエラー状態に`failbit`を設定して終了する。 +1. `rdbuf()->in_avail()`の値により以下のように処理を進める。 + - `-1`ならローカルエラー状態に`eofbit`を設定する。 - `0`なら何もしない。 - - `1`以上なら`min(rebuf()->in_avail(), n)`だけの文字を読み込む(`n`は仮引数)。 + - `1`以上なら`min(rdbuf()->in_avail(), n)`だけの文字を読み込む(`n`は仮引数)。 ## 戻り値 `s`に読み込まれた文字数。 @@ -57,3 +57,5 @@ TBD ## 参照 - [`read`](read.md) +- [P1264R2 Revising the wording of stream input operations](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1264r2.pdf) + - C++23でローカルエラー状態の概念が導入され、入力関数のエラー処理セマンティクスが明確化された diff --git a/reference/istream/basic_istream/seekg.md b/reference/istream/basic_istream/seekg.md index 035ab52c80..cc1227adf7 100644 --- a/reference/istream/basic_istream/seekg.md +++ b/reference/istream/basic_istream/seekg.md @@ -24,7 +24,7 @@ basic_istream& seekg(off_type off, seekdir dir); 1. 与えられた実引数により、以下のいずれかを実行する。 - `rdbuf()->pubseekpos(pos, ios_base::in)` - `rdbuf()->pubseekoff(off, dir, ios_base::in)` -1. 失敗した場合、`setstate(failbit)`を呼び出す。 +1. 失敗した場合、ローカルエラー状態に`failbit`を設定する。 ## 戻り値 `*this` @@ -124,3 +124,5 @@ basic_istream& seekg(off_type off, seekdir dir) { - [`basic_streambuf::pubseekoff`](../../streambuf/basic_streambuf/pubseekoff.md) - [`basic_streambuf::seekpos`](../../streambuf/basic_streambuf/seekpos.md) - [`basic_streambuf::seekoff`](../../streambuf/basic_streambuf/seekoff.md) +- [P1264R2 Revising the wording of stream input operations](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1264r2.pdf) + - C++23でローカルエラー状態の概念が導入され、入力関数のエラー処理セマンティクスが明確化された diff --git a/reference/istream/basic_istream/sync.md b/reference/istream/basic_istream/sync.md index 71cb5f62e3..85bf4cb67c 100644 --- a/reference/istream/basic_istream/sync.md +++ b/reference/istream/basic_istream/sync.md @@ -14,7 +14,7 @@ int sync(); ## 効果 1. `sentry`オブジェクトを構築する。`sentry`オブジェクトが失敗を示した場合、何もしない。 1. `rdbuf()->pubsync()`を呼び出す。ただし、`rdbuf()`がヌルポインタなら何もしない。 -1. `rdbuf()->pubsync()`が`-1`を返した場合、`setstate(badbit)`を呼び出す。 +1. `rdbuf()->pubsync()`が`-1`を返した場合、ローカルエラー状態に`badbit`を設定する。 ## 戻り値 - 成功した場合`0`。 @@ -57,3 +57,5 @@ int sync() { ## 参照 - [`basic_streambuf::pubsync`](../../streambuf/basic_streambuf/pubsync.md) +- [P1264R2 Revising the wording of stream input operations](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1264r2.pdf) + - C++23でローカルエラー状態の概念が導入され、入力関数のエラー処理セマンティクスが明確化された diff --git a/reference/istream/basic_istream/tellg.md b/reference/istream/basic_istream/tellg.md index dd8b2b9451..bfc046a24a 100644 --- a/reference/istream/basic_istream/tellg.md +++ b/reference/istream/basic_istream/tellg.md @@ -85,3 +85,5 @@ pos_type tellg(pos_type pos) { - [`basic_istream::seekg`](seekg.md) - [`basic_streambuf::pubseekoff`](../../streambuf/basic_streambuf/pubseekoff.md) - [`basic_streambuf::seekoff`](../../streambuf/basic_streambuf/seekoff.md) +- [P1264R2 Revising the wording of stream input operations](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1264r2.pdf) + - C++23でローカルエラー状態の概念が導入され、入力関数のエラー処理セマンティクスが明確化された diff --git a/reference/istream/basic_istream/unget.md b/reference/istream/basic_istream/unget.md index a69cac2886..f7d7f92c01 100644 --- a/reference/istream/basic_istream/unget.md +++ b/reference/istream/basic_istream/unget.md @@ -16,9 +16,9 @@ basic_istream& unget(); ## 効果 1. `eofbit`を消去する。 1. `sentry`オブジェクトを構築する。 -1. `!good()`なら`setstate(failbit)`して終わる。 +1. `!good()`ならローカルエラー状態に`failbit`を設定して終わる。 1. `rdbuf()->sungetc()`を呼び出す。 - - `rdbuf()`がヌルポインタであるか、`sungetc()`が`Traits::eof()`を返した場合、`setstate(badbit)`を呼び出す。 + - `rdbuf()`がヌルポインタであるか、`sungetc()`が`Traits::eof()`を返した場合、ローカルエラー状態に`badbit`を設定する。 ## 戻り値 `*this`。 @@ -108,3 +108,5 @@ basic_istream& unget() { - [`basic_istream::putback`](putback.md) - [`basic_streambuf::sungetc`](../../streambuf/basic_streambuf/sungetc.md) +- [P1264R2 Revising the wording of stream input operations](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1264r2.pdf) + - C++23でローカルエラー状態の概念が導入され、入力関数のエラー処理セマンティクスが明確化された diff --git a/reference/string/basic_string/getline.md b/reference/string/basic_string/getline.md index 5aee517dce..c5afb540dd 100644 --- a/reference/string/basic_string/getline.md +++ b/reference/string/basic_string/getline.md @@ -40,10 +40,10 @@ namespace std { 1. [`basic_istream<>::sentry`](../../istream/basic_istream/sentry.md)オブジェクトを構築する。`sentry`オブジェクトが失敗を示した場合、何もしない。 1. `str.erase()`を呼び出す。 1. 以下のいずれかを満たすまで、文字を入力して`str.append(1, c)`と等価な方法で文字列に追加する。なお、`c`は入力した文字を表す。以下の条件判断はこの順で行う。 - 1. EOFに達した。この場合、`is.setstate(ios_base::eofbit)`を呼び出す。 + 1. EOFに達した。この場合、ローカルエラー状態に`ios_base::eofbit`を設定する。 1. `Traits::eq(c, delim)`が真となった。 - 1. 読み取った文字数が`str.max_size()`になるまで書き込んだ。この場合、`is.setstate(ios_base::failbit)`を呼び出す。 -1. (`sentry`オブジェクトを破棄したのち)1文字も入力がなされなかったら、`is.setstate(ios_base::failbit)`を呼び出す。 + 1. 読み取った文字数が`str.max_size()`になるまで書き込んだ。この場合、ローカルエラー状態に`ios_base::failbit`を設定する。 +1. 1文字も入力がなされなかったら、ローカルエラー状態に`ios_base::failbit`を設定する。 - 空行の場合はこれに該当しないことに注意。なぜなら、改行文字1文字を入力しているためである。 この関数は[`basic_istream<>::gcount`](../../istream/basic_istream/gcount.md)には影響を及ぼさない。 @@ -82,3 +82,7 @@ Haru wa akebono. | 名前 | 説明 | |-----------------------|--------------------------------| | [`std::basic_istream<>::getline`](../../istream/basic_istream/getline.md) | 文字の配列へ入力を行うもの | + +## 参照 +- [P1264R2 Revising the wording of stream input operations](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1264r2.pdf) + - C++23でローカルエラー状態の概念が導入され、入力関数のエラー処理セマンティクスが明確化された diff --git a/reference/string/basic_string/op_istream.md b/reference/string/basic_string/op_istream.md index 55dcb46e4b..d18ba3f7ac 100644 --- a/reference/string/basic_string/op_istream.md +++ b/reference/string/basic_string/op_istream.md @@ -28,7 +28,7 @@ namespace std { - 空白文字に達した。空白文字の判定にはストリームに設定されているロケールが考慮される。 1. `is.width(0)`を呼び出す。 -`str`に1文字も入力が行われなかった場合、`is.setstate(ios_base::failbit)`が呼び出される。 +1文字も入力が行われなかった場合、ローカルエラー状態に`ios_base::failbit`を設定する。 ## 戻り値 - 仮引数`is`。 @@ -64,3 +64,5 @@ Banana - [`getline`](getline.md): このほかの`basic_string`に対する入力関数。 - このほかの`>>`演算子関数 - [``ヘッダで定義されているもの](../../istream/basic_istream/op_istream.md) +- [P1264R2 Revising the wording of stream input operations](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1264r2.pdf) + - C++23でローカルエラー状態の概念が導入され、入力関数のエラー処理セマンティクスが明確化された From 895a0172946a9b1dd41163ca42b804cade32e1b4 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sun, 22 Feb 2026 14:32:54 +0900 Subject: [PATCH 2616/3948] fix some default constructors in and --- reference/flat_map/flat_multimap/op_constructor.md | 5 +++-- reference/flat_set/flat_multiset/op_constructor.md | 5 +++-- reference/flat_set/flat_set/op_constructor.md | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/reference/flat_map/flat_multimap/op_constructor.md b/reference/flat_map/flat_multimap/op_constructor.md index caa19381ac..89eb998281 100644 --- a/reference/flat_map/flat_multimap/op_constructor.md +++ b/reference/flat_map/flat_multimap/op_constructor.md @@ -8,8 +8,9 @@ ```cpp // ____要素数ゼロのflat_multimapを構築____ -flat_multimap() - : flat_multimap(key_compare()) { } // (1) C++23 +flat_multimap() : flat_multimap(key_compare()) { } // (1) C++23 +constexpr + flat_multimap() : flat_multimap(key_compare()) { } // (1) C++26 explicit flat_multimap(const key_compare& comp) // (2) C++23 diff --git a/reference/flat_set/flat_multiset/op_constructor.md b/reference/flat_set/flat_multiset/op_constructor.md index 9d3be401a2..5dfcbaf9f2 100644 --- a/reference/flat_set/flat_multiset/op_constructor.md +++ b/reference/flat_set/flat_multiset/op_constructor.md @@ -8,8 +8,9 @@ ```cpp // ____要素数ゼロのflat_multisetを構築____ -flat_multiset() - : flat_multiset(key_compare()) { } // (1) C++23 +flat_multiset() : flat_multiset(key_compare()) { } // (1) C++23 +constexpr + flat_multiset() : flat_multiset(key_compare()) { } // (1) C++26 explicit flat_multiset(const key_compare& comp) // (2) C++23 diff --git a/reference/flat_set/flat_set/op_constructor.md b/reference/flat_set/flat_set/op_constructor.md index a46c4228f0..f2581bf9ed 100644 --- a/reference/flat_set/flat_set/op_constructor.md +++ b/reference/flat_set/flat_set/op_constructor.md @@ -8,8 +8,9 @@ ```cpp // ____要素数ゼロのflat_setを構築____ -flat_set() - : flat_set(key_compare()) { } // (1) C++23 +flat_set() : flat_set(key_compare()) { } // (1) C++23 +constexpr + flat_set() : flat_set(key_compare()) { } // (1) C++26 explicit flat_set(const key_compare& comp) // (2) C++23 From 753047591a15e4e9e002e2cf6f50037dab061943 Mon Sep 17 00:00:00 2001 From: suomesta Date: Sun, 22 Feb 2026 16:23:47 +0900 Subject: [PATCH 2617/3948] fix typo. consterxpr -> constexpr --- reference/vector/vector/crend.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/vector/vector/crend.md b/reference/vector/vector/crend.md index a807a9da32..eb2e30e2d3 100644 --- a/reference/vector/vector/crend.md +++ b/reference/vector/vector/crend.md @@ -6,8 +6,8 @@ * cpp11[meta cpp] ```cpp -const_reverse_iterator crend() const noexcept; // (1) C++11 -consterxpr const_reverse_iterator crend() const noexcept; // (1) C++20 +const_reverse_iterator crend() const noexcept; // (1) C++11 +constexpr const_reverse_iterator crend() const noexcept; // (1) C++20 ``` ## 概要 From 5b7faae4570d23b6c14f174224cbdab15701be1d Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 24 Feb 2026 12:22:12 +0900 Subject: [PATCH 2618/3948] =?UTF-8?q?C++23=20(C++20=20DR)=20=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C=E3=81=A8=E3=81=97=E3=81=A6=E3=80=81=E6=AF=94=E8=BC=83?= =?UTF-8?q?=E9=96=A2=E4=BF=82=E3=81=AE=E3=82=B3=E3=83=B3=E3=82=BB=E3=83=97?= =?UTF-8?q?=E3=83=88=E3=82=92=E3=83=A0=E3=83=BC=E3=83=96=E3=81=AE=E3=81=BF?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E3=81=AA=E5=9E=8B=E3=81=AB=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=20#1090?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/compare.md | 1 + reference/compare/three_way_comparable.md | 4 +- reference/concepts.md | 1 + reference/concepts/equality_comparable.md | 4 +- reference/concepts/totally_ordered.md | 1 + .../comparison-common-type-with.md | 46 +++++++++++++++++++ 6 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 reference/exposition-only/comparison-common-type-with.md diff --git a/reference/compare.md b/reference/compare.md index f744843f94..19126e2914 100644 --- a/reference/compare.md +++ b/reference/compare.md @@ -87,3 +87,4 @@ - [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) - [P1959R0 Remove `std::weak_equality` and `std::strong_equality`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1959r0.html) - [P1855R0 Make `` freestanding](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1855r0.html) +- [P2404R3 Move-only types for `equality_comparable_with`, `totally_ordered_with`, and `three_way_comparable_with`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2404r3.pdf) diff --git a/reference/compare/three_way_comparable.md b/reference/compare/three_way_comparable.md index 1ca6bf857c..04c47f0bd1 100644 --- a/reference/compare/three_way_comparable.md +++ b/reference/compare/three_way_comparable.md @@ -65,7 +65,7 @@ template concept three_way_comparable_with = three_way_comparable && three_way_comparable && - common_reference_with&, const remove_reference_t&> && + comparison-common-type-with && three_way_comparable< common_reference_t&, const remove_reference_t&>, Cat> && weakly-equality-comparable-with && @@ -76,6 +76,7 @@ concept three_way_comparable_with = }; ``` * partial_ordering[link /reference/compare/partial_ordering.md] +* comparison-common-type-with[link /reference/exposition-only/comparison-common-type-with.md] * weakly-equality-comparable-with[link /reference/concepts/equality_comparable.md] ## モデル @@ -262,5 +263,6 @@ int main() { - [P0768R1 Library support for the spaceship (comparison) operator](http://wg21.link/p0768) - [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) +- [P2404R3 Move-only types for `equality_comparable_with`, `totally_ordered_with`, and `three_way_comparable_with`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2404r3.pdf) - [LWG Issue 3360. `three_way_comparable_with` is inconsistent with similar concepts](https://wg21.cmeerw.net/lwg/issue3360) - [P1964R2 Wording for `boolean-testable`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1964r2.html) diff --git a/reference/concepts.md b/reference/concepts.md index e745f011cd..ca1b21515a 100644 --- a/reference/concepts.md +++ b/reference/concepts.md @@ -169,3 +169,4 @@ concept C = - [P1754R1 Rename concepts to standard_case for C++20, while we still can](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1754r1.pdf) - [P2101R0 “Models” subsumes “satisfies” (Wording for US298 and US300)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2101r0.html) - [P2102R0 Make “implicit expression variations” more explicit (Wording for US185)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2102r0.html) +- [P2404R3 Move-only types for `equality_comparable_with`, `totally_ordered_with`, and `three_way_comparable_with`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2404r3.pdf) diff --git a/reference/concepts/equality_comparable.md b/reference/concepts/equality_comparable.md index 63fc1fde00..257a726965 100644 --- a/reference/concepts/equality_comparable.md +++ b/reference/concepts/equality_comparable.md @@ -49,13 +49,14 @@ concept equality_comparable = weakly-equality-comparable-with; template concept equality_comparable_with = equality_comparable && equality_comparable && - common_reference_with&, const remove_reference_t&> && + comparison-common-type-with && equality_comparable< common_reference_t< const remove_reference_t&, const remove_reference_t&>> && weakly-equality-comparable-with; ``` +* comparison-common-type-with[link /reference/exposition-only/comparison-common-type-with.md] ## モデル @@ -246,4 +247,5 @@ S2 is not equality comparable with int - [P0898R3 Standard Library Concepts](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0898r3.pdf) - [P1754R1 Rename concepts to standard_case for C++20, while we still can](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1754r1.pdf) +- [P2404R3 Move-only types for `equality_comparable_with`, `totally_ordered_with`, and `three_way_comparable_with`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2404r3.pdf) - [同値関係 - wikipedia](https://ja.wikipedia.org/wiki/同値関係) diff --git a/reference/concepts/totally_ordered.md b/reference/concepts/totally_ordered.md index fb64dfd411..1b354a80f4 100644 --- a/reference/concepts/totally_ordered.md +++ b/reference/concepts/totally_ordered.md @@ -219,5 +219,6 @@ S2 is not totally ordered with int - [P0898R3 Standard Library Concepts](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0898r3.pdf) - [P1754R1 Rename concepts to standard_case for C++20, while we still can](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1754r1.pdf) +- [P2404R3 Move-only types for `equality_comparable_with`, `totally_ordered_with`, and `three_way_comparable_with`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2404r3.pdf) - [LWG Issue 3329. `totally_ordered_with` both directly and indirectly requires `common_reference_with`](https://wg21.cmeerw.net/lwg/issue3329) - [LWG Issue 3331. Define `totally_ordered/_with` in terms of `partially-ordered-with`](https://wg21.cmeerw.net/lwg/issue3331) diff --git a/reference/exposition-only/comparison-common-type-with.md b/reference/exposition-only/comparison-common-type-with.md new file mode 100644 index 0000000000..b6572e8fe6 --- /dev/null +++ b/reference/exposition-only/comparison-common-type-with.md @@ -0,0 +1,46 @@ +# comparison-common-type-with +* [meta exposition-only] +* exposition-only[meta header] +* concept[meta id-type] +* cpp20[meta cpp] + +```cpp +namespace std { + template> + concept comparison-common-type-with-impl = + same_as, + common_reference_t> && + requires { + requires convertible_to || + convertible_to; + requires convertible_to || + convertible_to; + }; + + template + concept comparison-common-type-with = + comparison-common-type-with-impl, remove_cvref_t>; +} +``` +* common_reference_t[link /reference/type_traits/common_reference.md] +* same_as[link /reference/concepts/same_as.md] +* convertible_to[link /reference/concepts/convertible_to.md] +* remove_cvref_t[link /reference/type_traits/remove_cvref.md] + +## 概要 +`comparison-common-type-with`は、2つの型`T`と`U`がムーブオンリー型であっても共通の上位型(common supertype)を持つことを判定するための説明専用コンセプトである。 + +[`common_reference_with`](/reference/concepts/common_reference_with.md)と似ているが、`const T&`からの変換だけでなく`T`(右辺値)からの変換も許可する点が異なる。これにより、コピーができずムーブのみ可能な型であっても、比較コンセプト([`equality_comparable_with`](/reference/concepts/equality_comparable.md), [`totally_ordered_with`](/reference/concepts/totally_ordered.md), [`three_way_comparable_with`](/reference/compare/three_way_comparable.md))を満たすことが可能になる。 + + +## 備考 +- このコンセプトはC++23で導入されたが、C++20への欠陥報告(DR)として扱われる + + +## バージョン +### 言語 +- C++20(C++23で追加、C++20にDR適用) + + +## 参照 +- [P2404R3 Move-only types for `equality_comparable_with`, `totally_ordered_with`, and `three_way_comparable_with`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2404r3.pdf) From c237d0ee6eb26c179b060062aed591d07cfbe2a8 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 24 Feb 2026 12:41:50 +0900 Subject: [PATCH 2619/3948] =?UTF-8?q?C++23=E5=AF=BE=E5=BF=9C=E3=81=A8?= =?UTF-8?q?=E3=81=97=E3=81=A6=E3=80=81integer-class=E3=81=AE=E5=AE=9A?= =?UTF-8?q?=E7=BE=A9=E4=BF=AE=E6=AD=A3=20#1064?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/is_integer_like.md | 20 ++++++++++++++++++-- reference/ranges/counted.md | 1 + reference/ranges/drop_view.md | 1 + reference/ranges/take_view.md | 1 + reference/ranges/take_view/begin.md | 23 ++++++++++++++++++++++- reference/ranges/take_view/end.md | 21 ++++++++++++++------- 6 files changed, 57 insertions(+), 10 deletions(-) diff --git a/reference/iterator/is_integer_like.md b/reference/iterator/is_integer_like.md index f0c16dfc40..ee2eace74f 100644 --- a/reference/iterator/is_integer_like.md +++ b/reference/iterator/is_integer_like.md @@ -28,13 +28,15 @@ namespace std { ## (signed-)integer-class型 -*integer-class*型は組み込みの整数型と同じように動作する実装定義のクラス型である。 +*integer-class*型は組み込みの整数型と同じように動作する実装定義の型である。*integer-class*型は必ずしもクラス型であるとは限らない。 + +*integer-class*型は2の補数で値を表現し、その幅は同じ符号の全ての組み込み整数型よりも大きい。 *integer-class*型の表現可能な範囲はそれが定義する値の連続集合であり、`0`と`1`を必ず含んでいなければならない。この時、その範囲に負の数が含まれていればその型は*signed-integer-class*型であり、それ以外のものは*unsigned-integer-class*型である。 ### 要件 -`I`をある*integer-class*型、`B`を少なくとも`I`と同じ範囲の値を表現可能で同じ幅を持つ別の*integer-class*型とする。 +`I`をある*integer-class*型、`B`を少なくとも`I`と同じ範囲の値を表現可能で同じ幅を持つ別の*integer-class*型とする。 `I`の値`a, b`、`a, b`それぞれと同じ値を表現する`B`の値`x, y`と任意の整数型の値`c`について次のことが成り立つ。 - 式`@x`が適格である全ての単項演算子`@`について`@a`もまた適格であり、共に同じ値、効果、値カテゴリを持つ。`@x`が`bool`型を示す場合`@a`もまた`bool`型を示すが。`@x`が`B`を示す場合は`@a`は`I`を示す。 @@ -45,6 +47,19 @@ namespace std { - *integer-class*型は[`regular`](/reference/concepts/regular.md)及び[`totally_ordered`](/reference/concepts/totally_ordered.md)のモデルとなる。 - 値初期化された*integer-class*型の値は`0`になる。 +### integer-class型間の変換 + +*integer-class*型`I1`から*integer-class*型`I2`への変換について: + +- `I1`と`I2`が同じ符号を持ち、`I2`の幅が`I1`の幅以上である場合、`I1`の値は`I2`へ暗黙的にも明示的にも変換可能である +- それ以外の場合、`I1`の値は`I2`へ明示的に変換可能である + +### common_type + +任意の2つの*integer-like*型`I1`と`I2`について、[`common_type_t`](/reference/type_traits/common_type.md)``は`I1`と`I2`のどちらの幅以上の幅を持つ*integer-class*型を示す。 + +### numeric_limits + *integer-class*型`I`について[`numeric_limits`](/reference/limits/numeric_limits.md)の特殊化は次のような値を示す。 - `numeric_limits::is_specialized == true` @@ -88,4 +103,5 @@ concept _Signed_integer_like = _Integer_like<_Ty> && static_cast<_Ty>(-1) < stat ## 参照 - [P1522R1 Iterator Difference Type and Integer Overflow](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1522r1.pdf) +- [P2393R1 Cleaning up integer-class types](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2393r1.html) - [LWG Issue 3467. bool can't be an integer-like type](https://cplusplus.github.io/LWG/issue3467) diff --git a/reference/ranges/counted.md b/reference/ranges/counted.md index 42d352c9ab..95db22f5e8 100644 --- a/reference/ranges/counted.md +++ b/reference/ranges/counted.md @@ -77,3 +77,4 @@ int main() { - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) - [C++20 ranges](https://techbookfest.org/product/5134506308665344) - [P2367R0 Remove misuses of list-initialization from Clause 24](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2367r0.html) (本提案文書はC++20に遡って適用されている) +- [P2393R1 Cleaning up integer-class types](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2393r1.html) diff --git a/reference/ranges/drop_view.md b/reference/ranges/drop_view.md index e2187b6d32..17063aff77 100644 --- a/reference/ranges/drop_view.md +++ b/reference/ranges/drop_view.md @@ -113,4 +113,5 @@ int main() { - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) - [C++20 ranges](https://techbookfest.org/product/5134506308665344) - [P2367R0 Remove misuses of list-initialization from Clause 24](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2367r0.html) (本提案文書はC++20に遡って適用されている) +- [P2393R1 Cleaning up integer-class types](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2393r1.html) - [P2017R1 Conditionally borrowed ranges](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2017r1.html) diff --git a/reference/ranges/take_view.md b/reference/ranges/take_view.md index 2a4e3ff225..af4097748c 100644 --- a/reference/ranges/take_view.md +++ b/reference/ranges/take_view.md @@ -177,5 +177,6 @@ int main() { - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) - [C++20 ranges](https://techbookfest.org/product/5134506308665344) - [P2367R0 Remove misuses of list-initialization from Clause 24](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2367r0.html) (本提案文書はC++20に遡って適用されている) +- [P2393R1 Cleaning up integer-class types](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2393r1.html) - [P2406R2 Add `lazy_counted_iterator`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2406r2.html) - [P2017R1 Conditionally borrowed ranges](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2017r1.html) diff --git a/reference/ranges/take_view/begin.md b/reference/ranges/take_view/begin.md index b376eaceff..af9924db41 100644 --- a/reference/ranges/take_view/begin.md +++ b/reference/ranges/take_view/begin.md @@ -18,12 +18,30 @@ constexpr auto begin() const `view`の先頭要素を指すイテレータを取得する。 ## 戻り値 + +`base_`を元の`view`を表すメンバ変数、`count_`を取得する要素数を表すメンバ変数とする。 + +入力が[`sized_range`](../sized_range.md)かつ[`random_access_range`](../random_access_range.md)の場合: - (1), (2) : 以下と等価: ```cpp return ranges::begin(base_); ``` -ただし、`base_`は元の`view`を表すメンバ変数。 +入力が[`sized_range`](../sized_range.md)だが[`random_access_range`](../random_access_range.md)ではない場合: +- (1), (2) : 以下と等価: + ```cpp + auto sz = range_difference_t(size()); + return counted_iterator(ranges::begin(base_), sz); + ``` + * range_difference_t[link /reference/ranges/range_difference_t.md] + * counted_iterator[link /reference/iterator/counted_iterator.md] + +それ以外の場合: +- (1), (2) : 以下と等価: + ```cpp + return counted_iterator(ranges::begin(base_), count_); + ``` + * counted_iterator[link /reference/iterator/counted_iterator.md] ## 例 @@ -60,3 +78,6 @@ int main() { - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [P2393R1 Cleaning up integer-class types](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2393r1.html) diff --git a/reference/ranges/take_view/end.md b/reference/ranges/take_view/end.md index 6678fef49f..b304596610 100644 --- a/reference/ranges/take_view/end.md +++ b/reference/ranges/take_view/end.md @@ -17,20 +17,24 @@ constexpr auto end() const 番兵を取得する。 ## 戻り値 + +`base_`を元の`view`を表すメンバ変数とする。 + 入力が[`sized_range`](../sized_range.md)かつ[`random_access_range`](../random_access_range.md)の場合: - (1), (2) : 以下と等価: ```cpp - return ranges::begin(base_) + min(ranges::size(base_), count_); + return ranges::begin(base_) + range_difference_t(size()); ``` - ここで、`D`は[`range_difference_t`](../range_difference_t.md)``。 + * range_difference_t[link /reference/ranges/range_difference_t.md] + +入力が[`sized_range`](../sized_range.md)だが[`random_access_range`](../random_access_range.md)ではない場合: +- (1), (2) : [`default_sentinel`](/reference/iterator/default_sentinel_t.md)を返す。 それ以外の場合: -- (1), (2) : 以下と等価: - ```cpp - return counted_iterator{ranges::begin(base_), count_}; - ``` +- (1) : `sentinel{ranges::end(base_)}`を返す。 +- (2) : `sentinel{ranges::end(base_)}`を返す。 -ただし、`base_`は元の`view`を表すメンバ変数、`count_`は取得する要素数を表すメンバ変数。 +ここで`sentinel`は`take_view`の内部で定義される説明専用の番兵型である。 ## 例 @@ -72,3 +76,6 @@ int main() { - [GCC](/implementation.md#gcc): 10.1.0 [mark verified] - [ICC](/implementation.md#icc): ? - [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified] + +## 参照 +- [P2393R1 Cleaning up integer-class types](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2393r1.html) From 0dca9abc87148e875a00dcee0443adaf7ff9da47 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 24 Feb 2026 16:56:31 +0900 Subject: [PATCH 2620/3948] =?UTF-8?q?C++23=E5=AF=BE=E5=BF=9C=E3=81=A8?= =?UTF-8?q?=E3=81=97=E3=81=A6=E6=AF=94=E8=BC=83=E3=82=84=E3=82=A4=E3=83=86?= =?UTF-8?q?=E3=83=AC=E3=83=BC=E3=82=BF=E3=81=AE=E6=93=8D=E4=BD=9C=E3=82=92?= =?UTF-8?q?ADL=E3=83=99=E3=83=BC=E3=82=B9=E3=81=AB=E4=BF=AE=E6=AD=A3=20#11?= =?UTF-8?q?12?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/compare/partial_order.md | 3 ++- reference/compare/strong_order.md | 3 ++- reference/compare/weak_order.md | 3 ++- reference/iterator/iter_move.md | 6 ++---- reference/iterator/iter_swap.md | 1 + reference/ranges/begin.md | 3 ++- reference/ranges/end.md | 3 ++- reference/ranges/rbegin.md | 3 ++- reference/ranges/rend.md | 3 ++- reference/ranges/size.md | 3 ++- 10 files changed, 19 insertions(+), 12 deletions(-) diff --git a/reference/compare/partial_order.md b/reference/compare/partial_order.md index 09a430e0a6..cdadcfadce 100644 --- a/reference/compare/partial_order.md +++ b/reference/compare/partial_order.md @@ -25,7 +25,7 @@ namespace std { 1. [`decay`](/reference/type_traits/decay.md)を通した`a, b`の型が異なる場合、呼び出しは不適格(コンパイルエラー) -2. `std::partial_order`(本関数オブジェクト)の宣言を含まないコンテキストで、[`partial_ordering`](partial_ordering.md)`(partial_order(a, b))`が呼び出し可能ならば`partial_ordering(partial_order(a, b))` +2. `partial_order(a, b)`の`partial_order`の意味がADLのみによって決まるコンテキストで、[`partial_ordering`](partial_ordering.md)`(partial_order(a, b))`が呼び出し可能ならば`partial_ordering(partial_order(a, b))` 3. [`partial_ordering`](partial_ordering.md)`(a <=> b)`が呼び出し可能ならば`partial_ordering(a <=> b)` @@ -170,3 +170,4 @@ true - [P0768R1 Library support for the spaceship (comparison) operator](http://wg21.link/p0768) - [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) +- [P2602R2 Poison Pills are Too Toxic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2602r2.html) diff --git a/reference/compare/strong_order.md b/reference/compare/strong_order.md index 83c666685e..3fc1ad6334 100644 --- a/reference/compare/strong_order.md +++ b/reference/compare/strong_order.md @@ -24,7 +24,7 @@ namespace std { 1. [`decay`](/reference/type_traits/decay.md)を通した`a, b`の型が異なる場合、呼び出しは不適格(コンパイルエラー) -2. `std::strong_order`(本関数オブジェクト)の宣言を含まないコンテキストで、[`strong_ordering`](strong_ordering.md)`(strong_order(a, b))`が呼び出し可能ならば`strong_ordering(strong_order(a, b))` +2. `strong_order(a, b)`の`strong_order`の意味がADLのみによって決まるコンテキストで、[`strong_ordering`](strong_ordering.md)`(strong_order(a, b))`が呼び出し可能ならば`strong_ordering(strong_order(a, b))` 3. [`decay`](/reference/type_traits/decay.md)を通した`a, b`の型`T`が浮動小数点型の場合、`T`の組み込みの比較演算子による順序と一貫する[`strong_ordering`](strong_ordering.md)の値を返す。 さらに、[`numeric_limits::is_iec559`](/reference/limits/numeric_limits/is_iec559.md) `== true`の場合、その順序はISO/IEC/IEEE 60559の`totalOrder`による全順序と一致する。 @@ -179,5 +179,6 @@ true - [P0768R1 Library support for the spaceship (comparison) operator](http://wg21.link/p0768) - [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) +- [P2602R2 Poison Pills are Too Toxic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2602r2.html) - [IEEE 754 - wikipedia](https://en.wikipedia.org/wiki/IEEE_754#Total-ordering_predicate) - [Floating-point extensions for C — Part 1: Binary floating-point arithmetic - WG14 N1605](http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1605.pdf) diff --git a/reference/compare/weak_order.md b/reference/compare/weak_order.md index 8af4f65958..2bd0b60e10 100644 --- a/reference/compare/weak_order.md +++ b/reference/compare/weak_order.md @@ -25,7 +25,7 @@ namespace std { 1. [`decay`](/reference/type_traits/decay.md)を通した`a, b`の型が異なる場合、呼び出しは不適格(コンパイルエラー) -2. `std::weak_order`(本関数オブジェクト)の宣言を含まないコンテキストで、[`weak_ordering`](weak_ordering.md)`(weak_order(a, b))`が呼び出し可能ならば`weak_ordering(weak_order(a, b))` +2. `weak_order(a, b)`の`weak_order`の意味がADLのみによって決まるコンテキストで、[`weak_ordering`](weak_ordering.md)`(weak_order(a, b))`が呼び出し可能ならば`weak_ordering(weak_order(a, b))` 3. [`decay`](/reference/type_traits/decay.md)を通した`a, b`の型`T`が浮動小数点型の場合、`T`の組み込みの比較演算子および[`strong_order`](strong_order.md)による順序と一貫する[`weak_ordering`](weak_ordering.md)の値を返す。 さらに、[`numeric_limits::is_iec559`](/reference/limits/numeric_limits/is_iec559.md) `== true`の場合、追加で以下の同値類の順序に従った順序付けを行う。 @@ -192,3 +192,4 @@ true - [P0768R1 Library support for the spaceship (comparison) operator](http://wg21.link/p0768) - [P1614R2 The Mothership has Landed (Adding <=> to the Library)](http://wg21.link/p1614) +- [P2602R2 Poison Pills are Too Toxic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2602r2.html) diff --git a/reference/iterator/iter_move.md b/reference/iterator/iter_move.md index 1bacb608d2..7003669622 100644 --- a/reference/iterator/iter_move.md +++ b/reference/iterator/iter_move.md @@ -23,10 +23,7 @@ namespace std { `iter_move(i)`のように呼び出された時、以下のいずれかと等価 -1. 引数`i`の型がクラス型であるか列挙型であり、`std::ranges::iter_move`(本CPO)の宣言を含まず下記の`iter_move`関数宣言を含むコンテキストで、`iter_move(i)`が呼び出し可能ならば`iter_move(i)` - ```cpp - void iter_move(); - ``` +1. 引数`i`の型がクラス型であるか列挙型であり、`iter_move(i)`の`iter_move`の意味がADLのみによって決まるコンテキストで、`iter_move(i)`が呼び出し可能ならば`iter_move(i)` 2. `*i`が有効であり、`*i`の結果が左辺値であるならば`std::move(*i)` @@ -121,3 +118,4 @@ int main() { ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P2602R2 Poison Pills are Too Toxic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2602r2.html) diff --git a/reference/iterator/iter_swap.md b/reference/iterator/iter_swap.md index 21c71d3457..a02c854330 100644 --- a/reference/iterator/iter_swap.md +++ b/reference/iterator/iter_swap.md @@ -123,3 +123,4 @@ int main() { ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P2602R2 Poison Pills are Too Toxic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2602r2.html) diff --git a/reference/ranges/begin.md b/reference/ranges/begin.md index 93263398b9..c047a9f2e4 100644 --- a/reference/ranges/begin.md +++ b/reference/ranges/begin.md @@ -22,7 +22,7 @@ Rangeから先頭要素へのイテレータを取得する関数オブジェク 1. `E`がrvalueかつ[`enable_borrowed_range`](enable_borrowed_range.md)`<`[`remove_cv_t`](/reference/type_traits/remove_cv.md)`>`が`false`であれば、呼び出しは不適格。 2. `T`が配列型であれば、`t + 0`に等しい(expression‑equivalent)。ただし、[`remove_all_extents_t`](/reference/type_traits/remove_all_extents.md)``が不完全型であれば、呼び出しは不適格(診断不要)。 3. [`decay-copy`](/reference/exposition-only/decay-copy.md)`(t.begin())`が有効な式でその型が[`input_or_output_iterator`](/reference/iterator/input_or_output_iterator.md)のモデルであれば、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(t.begin())`と等しい。 -4. `T`がクラス型または列挙体であって、`begin`がADLで見つかり、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(begin(t))`が有効な式でその型が[`input_or_output_iterator`](/reference/iterator/input_or_output_iterator.md)のモデルであれば、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(begin(t))`と等しい。 +4. `T`がクラス型または列挙体であって、`begin(t)`の`begin`の意味がADLのみによって決まるコンテキストで、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(begin(t))`が有効な式でその型が[`input_or_output_iterator`](/reference/iterator/input_or_output_iterator.md)のモデルであれば、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(begin(t))`と等しい。 どれにも当てはまらないとき、呼び出しは不適格。 @@ -96,3 +96,4 @@ int main() ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) - [C++20 ranges](https://techbookfest.org/product/5134506308665344) +- [P2602R2 Poison Pills are Too Toxic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2602r2.html) diff --git a/reference/ranges/end.md b/reference/ranges/end.md index 9aa35f5462..c07c4db60d 100644 --- a/reference/ranges/end.md +++ b/reference/ranges/end.md @@ -22,7 +22,7 @@ Rangeから最後尾要素の次を指すイテレータもしくは番兵を取 1. `E`がrvalueかつ[`enable_borrowed_range`](enable_borrowed_range.md)`<`[`remove_cv_t`](/reference/type_traits/remove_cv.md)`>`が`false`であれば、呼び出しは不適格。 2. `T`が配列型であれば、`t +` [`extent_v`](/reference/type_traits/extent.md)``に等しい(expression‑equivalent)。ただし、要素数不明の配列か、[`remove_all_extents_t`](/reference/type_traits/remove_all_extents.md)``が不完全型であれば、呼び出しは不適格(診断不要)。 3. [`decay-copy`](/reference/exposition-only/decay-copy.md)`(t.end())`が有効な式でその型が[`sentinel_for`](/reference/iterator/sentinel_for.md)`<`[`iterator_t`](iterator_t.md)`>`のモデルであれば、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(t.end())`と等しい。 -4. `T`がクラス型または列挙体であって、`end`がADLで見つかり、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(end(t))`が有効な式でその型が[`sentinel_for`](/reference/iterator/sentinel_for.md)`<`[`iterator_t`](iterator_t.md)`>`のモデルであれば、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(end(t))`と等しい。 +4. `T`がクラス型または列挙体であって、`end(t)`の`end`の意味がADLのみによって決まるコンテキストで、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(end(t))`が有効な式でその型が[`sentinel_for`](/reference/iterator/sentinel_for.md)`<`[`iterator_t`](iterator_t.md)`>`のモデルであれば、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(end(t))`と等しい。 どれにも当てはまらないとき、呼び出しは不適格。 @@ -96,3 +96,4 @@ int main() ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) - [C++20 ranges](https://techbookfest.org/product/5134506308665344) +- [P2602R2 Poison Pills are Too Toxic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2602r2.html) diff --git a/reference/ranges/rbegin.md b/reference/ranges/rbegin.md index 71c0bcc9c7..2213300f21 100644 --- a/reference/ranges/rbegin.md +++ b/reference/ranges/rbegin.md @@ -23,7 +23,7 @@ Rangeの末尾を指す逆イテレータを取得する関数オブジェクト 1. `E`がrvalueかつ[`enable_borrowed_range`](enable_borrowed_range.md)`<`[`remove_cv_t`](/reference/type_traits/remove_cv.md)`>`が`false`であれば、呼び出しは不適格。 2. `T`が配列型かつ[`remove_all_extents_t`](/reference/type_traits/remove_all_extents.md)``が不完全型であれば、呼び出しは不適格(診断不要)。 3. [`decay-copy`](/reference/exposition-only/decay-copy.md)`(t.rbegin())`が有効な式でその型が[`input_or_output_iterator`](/reference/iterator/input_or_output_iterator.md)のモデルであれば、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(t.rbegin())`と等しい。 -4. `T`がクラス型または列挙体であって、`rbegin`がADLで見つかり、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(rbegin(t))`が有効な式でその型が[`input_or_output_iterator`](/reference/iterator/input_or_output_iterator.md)のモデルであれば、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(rbegin(t))`と等しい。 +4. `T`がクラス型または列挙体であって、`rbegin(t)`の`rbegin`の意味がADLのみによって決まるコンテキストで、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(rbegin(t))`が有効な式でその型が[`input_or_output_iterator`](/reference/iterator/input_or_output_iterator.md)のモデルであれば、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(rbegin(t))`と等しい。 5. [`ranges::begin`](begin.md)`(t)`と[`ranges::end`](end.md)`(t)`が同じ型をもつ有効な式で、その型が[`bidirectional_iterator`](/reference/iterator/bidirectional_iterator.md)のモデルであれば、[`make_reverse_iterator`](/reference/iterator/make_reverse_iterator.md)`(`[`ranges::end`](end.md)`(t))`と等しい。 どれにも当てはまらないとき、呼び出しは不適格。 @@ -109,3 +109,4 @@ int main() ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) - [C++20 ranges](https://techbookfest.org/product/5134506308665344) +- [P2602R2 Poison Pills are Too Toxic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2602r2.html) diff --git a/reference/ranges/rend.md b/reference/ranges/rend.md index 042f4d95a0..bedaa4dcc7 100644 --- a/reference/ranges/rend.md +++ b/reference/ranges/rend.md @@ -22,7 +22,7 @@ Rangeの先頭の前を指す逆イテレータもしくは番兵を取得する 1. `E`がrvalueかつ[`enable_borrowed_range`](enable_borrowed_range.md)`<`[`remove_cv_t`](/reference/type_traits/remove_cv.md)`>`が`false`であれば、呼び出しは不適格。 2. `T`が配列型かつ[`remove_all_extents_t`](/reference/type_traits/remove_all_extents.md)``が不完全型であれば、呼び出しは不適格(診断不要)。 3. [`decay-copy`](/reference/exposition-only/decay-copy.md)`(t.rend())`が有効な式でその型が[`sentinel_for`](/reference/iterator/sentinel_for.md)``のモデルであれば、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(t.rend())`と等しい。 -4. `T`がクラス型または列挙体であって、`rend`がADLで見つかり、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(rend(t))`が有効な式でその型が[`sentinel_for`](/reference/iterator/sentinel_for.md)``のモデルであれば、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(rend(t))`と等しい。 +4. `T`がクラス型または列挙体であって、`rend(t)`の`rend`の意味がADLのみによって決まるコンテキストで、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(rend(t))`が有効な式でその型が[`sentinel_for`](/reference/iterator/sentinel_for.md)``のモデルであれば、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(rend(t))`と等しい。 5. [`ranges::begin`](begin.md)`(t)`と[`ranges::end`](end.md)`(t)`が同じ型をもつ有効な式で、その型が[`bidirectional_iterator`](/reference/iterator/bidirectional_iterator.md)のモデルであれば、[`make_reverse_iterator`](/reference/iterator/make_reverse_iterator.md)`(`[`ranges::begin`](begin.md)`(t))`と等しい。 どれにも当てはまらないとき、呼び出しは不適格。 @@ -111,3 +111,4 @@ int main() ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) - [C++20 ranges](https://techbookfest.org/product/5134506308665344) +- [P2602R2 Poison Pills are Too Toxic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2602r2.html) diff --git a/reference/ranges/size.md b/reference/ranges/size.md index 1d051293d5..e187903310 100644 --- a/reference/ranges/size.md +++ b/reference/ranges/size.md @@ -20,7 +20,7 @@ Rangeの要素数を取得する関数オブジェクト。 1. `T`が配列型であれば、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(`[`extent_v`](/reference/type_traits/extent.md)`)`に等しい(expression‑equivalent)。ただし、要素数不明の配列であれば、呼び出しは不適格。 2. [`disable_sized_range`](disable_sized_range.md)`<`[`remove_cv_t`](/reference/type_traits/remove_cv.md)`>`が`false`、かつ[`decay-copy`](/reference/exposition-only/decay-copy.md)`(t.size())`が整数型(integer-like)の有効な式であれば、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(t.size())`と等しい。 -3. `T`がクラス型または列挙体であって、[`disable_sized_range`](disable_sized_range.md)`<`[`remove_cv_t`](/reference/type_traits/remove_cv.md)`>`が`false`、かつ`size`がADLで見つかり、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(size(t))`が整数型の有効な式であれば、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(size(t))`と等しい。 +3. `T`がクラス型または列挙体であって、[`disable_sized_range`](disable_sized_range.md)`<`[`remove_cv_t`](/reference/type_traits/remove_cv.md)`>`が`false`、かつ`size(t)`の`size`の意味がADLのみによって決まるコンテキストで、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(size(t))`が整数型の有効な式であれば、[`decay-copy`](/reference/exposition-only/decay-copy.md)`(size(t))`と等しい。 4. `to-unsigned-like(`[`ranges::end`](end.md)`(t) -` [`ranges::begin`](begin.md)`(t))`が有効な式で、[`ranges::begin`](begin.md)の型`I`、[`ranges::end`](end.md)の型`S`が[`sized_sentinel_for`](/reference/iterator/sized_sentinel_for.md)``と[`forward_iterator`](/reference/iterator/forward_iterator.md)のモデルであれば、`to-unsigned-like(`[`ranges::end`](end.md)`(t) -` [`ranges::begin`](begin.md)`(t))`と等しい。 どれにも当てはまらないとき、呼び出しは不適格。 @@ -79,3 +79,4 @@ int main() ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) - [C++20 ranges](https://techbookfest.org/product/5134506308665344) +- [P2602R2 Poison Pills are Too Toxic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2602r2.html) From 29fbdc9528602c8298dad66d540f47dafbaa0601 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 24 Feb 2026 23:01:12 +0900 Subject: [PATCH 2621/3948] =?UTF-8?q?iterator/is=5Finteger=5Flike:=20meta?= =?UTF-8?q?=20alias=E3=82=BF=E3=82=B0=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/iterator/is_integer_like.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/iterator/is_integer_like.md b/reference/iterator/is_integer_like.md index ee2eace74f..73997f6af8 100644 --- a/reference/iterator/is_integer_like.md +++ b/reference/iterator/is_integer_like.md @@ -4,6 +4,7 @@ * std[meta namespace] * variable[meta id-type] * cpp20[meta cpp] +* is-signed-integer-like[meta alias] ```cpp namespace std { From aaa394b13958d89a4b6e1f5511dc25e2c3b45153 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 25 Feb 2026 13:06:35 +0900 Subject: [PATCH 2622/3948] =?UTF-8?q?C++26=E5=AF=BE=E5=BF=9C=E3=81=A8?= =?UTF-8?q?=E3=81=97=E3=81=A6owner=5Fequal,=20owner=5Fhash=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20#1190?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation.md | 3 +- lang/cpp26.md | 2 +- lang/cpp26/feature_test_macros.md | 2 +- .../query_parallel_scheduler_backend.md | 2 +- reference/memory/owner_equal.md | 99 +++++++++++++++++++ reference/memory/owner_equal/op_call.md | 51 ++++++++++ reference/memory/owner_hash.md | 99 +++++++++++++++++++ reference/memory/owner_hash/op_call.md | 40 ++++++++ reference/memory/shared_ptr.md | 2 + reference/memory/shared_ptr/owner_equal.md | 89 +++++++++++++++++ reference/memory/shared_ptr/owner_hash.md | 66 +++++++++++++ reference/memory/weak_ptr.md | 2 + reference/memory/weak_ptr/owner_equal.md | 89 +++++++++++++++++ reference/memory/weak_ptr/owner_hash.md | 66 +++++++++++++ 14 files changed, 608 insertions(+), 4 deletions(-) create mode 100644 reference/memory/owner_equal.md create mode 100644 reference/memory/owner_equal/op_call.md create mode 100644 reference/memory/owner_hash.md create mode 100644 reference/memory/owner_hash/op_call.md create mode 100644 reference/memory/shared_ptr/owner_equal.md create mode 100644 reference/memory/shared_ptr/owner_hash.md create mode 100644 reference/memory/weak_ptr/owner_equal.md create mode 100644 reference/memory/weak_ptr/owner_hash.md diff --git a/implementation.md b/implementation.md index a4911c98ac..335030b8d9 100644 --- a/implementation.md +++ b/implementation.md @@ -141,7 +141,8 @@ | 表記 | 製品名 [Visual Studio バージョン] †1 | VC++ バージョン †2 | `_MSC_VER` | `_MSC_FULL_VER` | |---------------|----------------------------------------|-----------------|------------|-----------------| -| 2022 Update 14 | Visual Studio 2022 Version 17.14.0 | 14.44 | 1944 | | +| 2026 Update 2 | Visual Studio 2026 Version 18.2 | 14.50 | ?? | ?? | +| 2022 Update 14 | Visual Studio 2022 Version 17.14.0 | 14.44 | 1944 | ?? | | 2022 Update 13 | Visual Studio 2022 Version 17.13.2 | 14.43 | 1943 | 194334808 | | 2022 Update 13 | Visual Studio 2022 Version 17.13.0 | 14.43 | 1943 | 194334808 | | 2022 Update 12 | Visual Studio 2022 Version 17.12.4 | 14.42 | 1942 | 194234436 | diff --git a/lang/cpp26.md b/lang/cpp26.md index ef7bc0dd38..d1e7fd737b 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -354,7 +354,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 ### スマートポインタ・メモリ関連 - 動的確保したオブジェクトに値の意味論をもたせてディープコピーさせるユーティリティクラスとして、[``](/reference/memory.md)に[`std::indirect`](/reference/memory/indirect.md.nolink)クラスと[`std::polymorphic`](/reference/memory/polymorphic.md.nolink)クラスを追加 -- [`std::weak_ptr`](/reference/memory/weak_ptr.md)を非順序連想コンテナのキーとして使用できるよう、[``](/reference/memory.md)に所有権ベースのハッシュ値を取得する関数オブジェクト[`std::owner_hash`](/reference/memory/owner_hash.md.nolink)、および所有権ベースの等値比較を行う関数オブジェクト[`std::owner_equal`](/reference/memory/owner_equal.md.nolink)を追加 +- [`std::weak_ptr`](/reference/memory/weak_ptr.md)を非順序連想コンテナのキーとして使用できるよう、[``](/reference/memory.md)に所有権ベースのハッシュ値を取得する関数オブジェクト[`std::owner_hash`](/reference/memory/owner_hash.md)、および所有権ベースの等値比較を行う関数オブジェクト[`std::owner_equal`](/reference/memory/owner_equal.md)を追加 - 関連して、[`std::shared_ptr`](/reference/memory/shared_ptr.md)クラスと[`std::weak_ptr`](/reference/memory/weak_ptr.md)クラスのメンバ関数として、`owner_hash()`と`owner_equal()`を追加 - [`std::shared_ptr`](/reference/memory/shared_ptr.md)クラスとその関連機能を`constexpr`対応 diff --git a/lang/cpp26/feature_test_macros.md b/lang/cpp26/feature_test_macros.md index eaa6b780b6..2a7e17d02e 100755 --- a/lang/cpp26/feature_test_macros.md +++ b/lang/cpp26/feature_test_macros.md @@ -144,7 +144,7 @@ |`__cpp_lib_simd`|`202506L`|データ並列ライブラリとして、[``](/reference/simd.md.nolink)を追加|[``](/reference/simd.md.nolink)| |`__cpp_lib_simd_complex`|`202502L`|[``](/reference/simd.md.nolink)が[`std::complex`](/reference/complex/complex.md)をサポートする|[``](/reference/simd.md.nolink)| |`__cpp_lib_simd_permutations`|`202506L`|[``](/reference/simd.md.nolink)に`permute()`などを追加する|[``](/reference/simd.md.nolink)| -|`__cpp_lib_smart_ptr_owner_equality`|`202306L`|[``](/reference/memory.md)に[`std::owner_hash`](/reference/memory/owner_hash.md.nolink)と[`std::owner_equal`](/reference/memory/owner_equal.md.nolink)を追加|[``](/reference/memory.md)| +|`__cpp_lib_smart_ptr_owner_equality`|`202306L`|[``](/reference/memory.md)に[`std::owner_hash`](/reference/memory/owner_hash.md)と[`std::owner_equal`](/reference/memory/owner_equal.md)を追加|[``](/reference/memory.md)| |`__cpp_lib_span`|`202311L`|[`std::mdspan`](/reference/mdspan/mdspan.md)に[`at()`](/reference/mdspan/mdspan/at.md)メンバ関数を追加|[``](/reference/span.md)| |`__cpp_lib_span_initializer_list`|`202311L`|[`std::span`](/reference/span/span.md)に[`std::initializer_list`](/reference/initializer_list/initializer_list.md)をとるコンストラクタを追加|[``](/reference/span.md)| |`__cpp_lib_sstream_from_string_view`|`202306L`|[`std::basic_stringstream`](/reference/sstream/basic_stringstream.md)などが[`std::basic_string_view`](/reference/string_view/basic_string_view.md)から構築可能に|[``](/reference/sstream.md)| diff --git a/reference/execution/execution/system_context_replaceability/query_parallel_scheduler_backend.md b/reference/execution/execution/system_context_replaceability/query_parallel_scheduler_backend.md index e146984940..b728a7fee8 100644 --- a/reference/execution/execution/system_context_replaceability/query_parallel_scheduler_backend.md +++ b/reference/execution/execution/system_context_replaceability/query_parallel_scheduler_backend.md @@ -17,7 +17,7 @@ namespace std::execution::system_context_replaceability { ## 効果 オブジェクト`p`は、`p.get()`がその生存期間内に最派生オブジェクト`o`基底クラスの部分オブジェクトである[`parallel_scheduler_backend`](parallel_scheduler_backend.md)オブジェクトを指すものとする。 -その存続期間内に`q.`[`owner_equal`](/reference/memory/shared_ptr/owner_equal.md.nolink)`(p)`が`true`となる[`shared_ptr`](/reference/memory/shared_ptr.md)オブジェクト`q`が存在する限り、`o`の存続期間は終了しない。 +その存続期間内に`q.`[`owner_equal`](/reference/memory/shared_ptr/owner_equal.md)`(p)`が`true`となる[`shared_ptr`](/reference/memory/shared_ptr.md)オブジェクト`q`が存在する限り、`o`の存続期間は終了しない。 ## 備考 diff --git a/reference/memory/owner_equal.md b/reference/memory/owner_equal.md new file mode 100644 index 0000000000..8305b43d8f --- /dev/null +++ b/reference/memory/owner_equal.md @@ -0,0 +1,99 @@ +# owner_equal +* memory[meta header] +* std[meta namespace] +* class[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + struct owner_equal; +} +``` + +## 概要 +`owner_equal`は、スマートポインタを所有権ベースで等値比較するための関数オブジェクトである。 + +スマートポインタを、[`unordered_set`](/reference/unordered_set/unordered_set.md)や[`unordered_map`](/reference/unordered_map/unordered_map.md)のキーにする際、値ベースではなく所有権ベースに比較することを指定するために使用する。 + +[`owner_hash`](owner_hash.md)と組み合わせて使用する。 + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|----------------------------------------|------|-------| +| [`operator()`](owner_equal/op_call.md) | 関数呼び出し演算子 | C++26 | + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------------------------|-----------------------------------------------------------|-------| +| `is_transparent` | `operator()` が関数テンプレートである事を示すタグ型。
実装依存の型であるがあくまでタグ型であり、型そのものには意味はない。 | C++26 | + + +## 例 +```cpp example +#include +#include +#include + +template +using shared_ptr_uset = std::unordered_set< + std::shared_ptr, + std::owner_hash, + std::owner_equal +>; + +struct X { + int i; + int j; +}; + +int main() +{ + shared_ptr_uset us; + + std::shared_ptr p1(new int(2)); + + std::shared_ptr px(new X()); + // 同じ所有権(px)を持つが、異なるポインタを指すp2とp3 + std::shared_ptr p2(px, &(px->i)); + std::shared_ptr p3(px, &(px->j)); + + us.insert(p1); + us.insert(p2); + us.insert(p3); // owner_equalでは、p2とp3が同じリソースを + // 指していると見なされるので、p3は挿入されない + + std::println("{}", us.size()); +} +``` +* std::owner_equal[color ff0000] +* std::owner_hash[link owner_hash.md] +* us.insert[link /reference/unordered_set/unordered_set/insert.md] + +### 出力 +``` +2 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 22 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + + +## 関連項目 +- [`std::owner_hash`](owner_hash.md) +- [`std::owner_less`](owner_less.md) +- [`std::shared_ptr::owner_equal()`](shared_ptr/owner_equal.md) +- [`std::weak_ptr::owner_equal()`](weak_ptr/owner_equal.md) + + +## 参照 +- [P1901R2 Enabling the Use of `weak_ptr` as Keys in Unordered Associative Containers](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1901r2.html) diff --git a/reference/memory/owner_equal/op_call.md b/reference/memory/owner_equal/op_call.md new file mode 100644 index 0000000000..eaa0d1bc34 --- /dev/null +++ b/reference/memory/owner_equal/op_call.md @@ -0,0 +1,51 @@ +# operator() +* memory[meta header] +* std[meta namespace] +* owner_equal[meta class] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +constexpr bool operator()(const shared_ptr& a, + const shared_ptr& b) const noexcept; // (1) C++26 + +template +constexpr bool operator()(const shared_ptr& a, + const weak_ptr& b) const noexcept; // (2) C++26 + +template +constexpr bool operator()(const weak_ptr& a, + const shared_ptr& b) const noexcept; // (3) C++26 + +template +constexpr bool operator()(const weak_ptr& a, + const weak_ptr& b) const noexcept; // (4) C++26 +``` +* shared_ptr[link /reference/memory/shared_ptr.md] +* weak_ptr[link /reference/memory/weak_ptr.md] + +## 概要 +所有権ベースでの等値比較を行う。 + + +## 戻り値 +```cpp +return a.owner_equal(b); +``` +* owner_equal[link /reference/memory/shared_ptr/owner_equal.md] + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`std::shared_ptr::owner_equal()`](/reference/memory/shared_ptr/owner_equal.md) +- [`std::weak_ptr::owner_equal()`](/reference/memory/weak_ptr/owner_equal.md) + + +## 参照 +- [P1901R2 Enabling the Use of `weak_ptr` as Keys in Unordered Associative Containers](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1901r2.html) +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) diff --git a/reference/memory/owner_hash.md b/reference/memory/owner_hash.md new file mode 100644 index 0000000000..6b64e50160 --- /dev/null +++ b/reference/memory/owner_hash.md @@ -0,0 +1,99 @@ +# owner_hash +* memory[meta header] +* std[meta namespace] +* class[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + struct owner_hash; +} +``` + +## 概要 +`owner_hash`は、スマートポインタを所有権ベースでハッシュするための関数オブジェクトである。 + +スマートポインタを、[`unordered_set`](/reference/unordered_set/unordered_set.md)や[`unordered_map`](/reference/unordered_map/unordered_map.md)のキーにする際、値ベースではなく所有権ベースにハッシュすることを指定するために使用する。 + +[`owner_equal`](owner_equal.md)と組み合わせて使用する。 + + +## メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|---------------------------------------|------|-------| +| [`operator()`](owner_hash/op_call.md) | 関数呼び出し演算子 | C++26 | + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------------------------|-----------------------------------------------------------|-------| +| `is_transparent` | `operator()` が関数テンプレートである事を示すタグ型。
実装依存の型であるがあくまでタグ型であり、型そのものには意味はない。 | C++26 | + + +## 例 +```cpp example +#include +#include +#include + +template +using shared_ptr_uset = std::unordered_set< + std::shared_ptr, + std::owner_hash, + std::owner_equal +>; + +struct X { + int i; + int j; +}; + +int main() +{ + shared_ptr_uset us; + + std::shared_ptr p1(new int(2)); + + std::shared_ptr px(new X()); + // 同じ所有権(px)を持つが、異なるポインタを指すp2とp3 + std::shared_ptr p2(px, &(px->i)); + std::shared_ptr p3(px, &(px->j)); + + us.insert(p1); + us.insert(p2); + us.insert(p3); // owner_hashでは、p2とp3が同じリソースを + // 指していると見なされるので、p3は挿入されない + + std::println("{}", s.size()); +} +``` +* std::owner_hash[color ff0000] +* std::owner_equal[link owner_equal.md] +* us.insert[link /reference/unordered_set/unordered_set/insert.md] + +### 出力 +``` +2 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 22 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + + +## 関連項目 +- [`std::owner_equal`](owner_equal.md) +- [`std::owner_less`](owner_less.md) +- [`std::shared_ptr::owner_hash()`](shared_ptr/owner_hash.md) +- [`std::weak_ptr::owner_hash()`](weak_ptr/owner_hash.md) + + +## 参照 +- [P1901R2 Enabling the Use of `weak_ptr` as Keys in Unordered Associative Containers](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1901r2.html) diff --git a/reference/memory/owner_hash/op_call.md b/reference/memory/owner_hash/op_call.md new file mode 100644 index 0000000000..85e27b644a --- /dev/null +++ b/reference/memory/owner_hash/op_call.md @@ -0,0 +1,40 @@ +# operator() +* memory[meta header] +* std[meta namespace] +* owner_hash[meta class] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +size_t operator()(const shared_ptr& key) const noexcept; // (1) C++26 + +template +size_t operator()(const weak_ptr& key) const noexcept; // (2) C++26 +``` +* shared_ptr[link /reference/memory/shared_ptr.md] +* weak_ptr[link /reference/memory/weak_ptr.md] + +## 概要 +所有権ベースでのハッシュ値を取得する。 + + +## 戻り値 +```cpp +return key.owner_hash(); +``` +* owner_hash[link /reference/memory/shared_ptr/owner_hash.md] + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`std::shared_ptr::owner_hash()`](/reference/memory/shared_ptr/owner_hash.md) +- [`std::weak_ptr::owner_hash()`](/reference/memory/weak_ptr/owner_hash.md) + + +## 参照 +- [P1901R2 Enabling the Use of `weak_ptr` as Keys in Unordered Associative Containers](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1901r2.html) diff --git a/reference/memory/shared_ptr.md b/reference/memory/shared_ptr.md index 034716ba61..a563b686f5 100644 --- a/reference/memory/shared_ptr.md +++ b/reference/memory/shared_ptr.md @@ -45,6 +45,8 @@ namespace std { | [`unique`](shared_ptr/unique.md) | 所有権を持つユーザーが一人だけかを判定する | C++11
C++17から非推奨
C++20で削除 | | [`operator bool`](shared_ptr/op_bool.md) | 有効なリソースを所有しているかを判定する | C++11 | | [`owner_before`](shared_ptr/owner_before.md) | 所有権ベースでの小なり比較を行う | C++11 | +| [`owner_equal`](shared_ptr/owner_equal.md) | 所有権ベースでの等値比較を行う | C++26 | +| [`owner_hash`](shared_ptr/owner_hash.md) | 所有権ベースでのハッシュ値を取得する | C++26 | ## メンバ型 diff --git a/reference/memory/shared_ptr/owner_equal.md b/reference/memory/shared_ptr/owner_equal.md new file mode 100644 index 0000000000..8d12309b63 --- /dev/null +++ b/reference/memory/shared_ptr/owner_equal.md @@ -0,0 +1,89 @@ +# owner_equal +* memory[meta header] +* std[meta namespace] +* shared_ptr[meta class] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +constexpr bool + owner_equal(const shared_ptr& b) const noexcept; // (1) C++26 + +template +constexpr bool + owner_equal(const weak_ptr& b) const noexcept; // (2) C++26 +``` +* weak_ptr[link /reference/memory/weak_ptr.md] + +## 概要 +所有権ベースでの等値比較を行う。 + + +## 戻り値 +`*this`と`b`が所有権を共有しているか、両方とも空であれば`true`を返し、そうでなければ`false`を返す。 + +以下の式と等価: + +```cpp +!owner_before(b) && !b.owner_before(*this) +``` +* owner_before[link owner_before.md] + + +## 備考 +[`owner_before()`](owner_before.md)が所有権ベースでの順序を提供するのに対し、`owner_equal()`は所有権ベースでの等値判定を提供する。 + +[`owner_hash()`](owner_hash.md)と組み合わせて、`shared_ptr`や[`weak_ptr`](/reference/memory/weak_ptr.md)を[`unordered_map`](/reference/unordered_map/unordered_map.md)や[`unordered_set`](/reference/unordered_set/unordered_set.md)のキーとして使用できる。 + + +## 例 +```cpp example +#include +#include + +struct X { + int i; + int j; +}; + +int main() +{ + std::shared_ptr org(new X()); + + // 別名コンストラクタで異なるポインタを指すが、所有権は同じ + std::shared_ptr a(org, &(org->i)); + std::shared_ptr b(org, &(org->j)); + + std::cout << std::boolalpha; + std::cout << (a == b) << std::endl; // 値ベース: false + std::cout << a.owner_equal(b) << std::endl; // 所有権ベース: true +} +``` +* owner_equal[color ff0000] + +### 出力 +``` +false +true +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 22 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + + +## 関連項目 +- [`owner_hash()`](owner_hash.md) +- [`owner_before()`](owner_before.md) +- [`std::owner_equal`](/reference/memory/owner_equal.md) + + +## 参照 +- [P1901R2 Enabling the Use of `weak_ptr` as Keys in Unordered Associative Containers](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1901r2.html) +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) diff --git a/reference/memory/shared_ptr/owner_hash.md b/reference/memory/shared_ptr/owner_hash.md new file mode 100644 index 0000000000..639e27737a --- /dev/null +++ b/reference/memory/shared_ptr/owner_hash.md @@ -0,0 +1,66 @@ +# owner_hash +* memory[meta header] +* std[meta namespace] +* shared_ptr[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +size_t owner_hash() const noexcept; // (1) C++26 +``` + +## 概要 +所有権ベースでのハッシュ値を取得する。 + + +## 戻り値 +所有権が等価な([`owner_equal()`](owner_equal.md)が`true`を返す)`shared_ptr`および[`weak_ptr`](/reference/memory/weak_ptr.md)オブジェクトに対して、同じハッシュ値を返す。 + + +## 備考 +この関数は、所有権ベースでのハッシュを提供する。[`std::hash`](/reference/functional/hash.md)`>`が保持するポインタの値をもとにしたハッシュを提供するのに対し、`owner_hash()`は所有権(参照カウンタオブジェクト)をもとにしたハッシュを提供する。 + +これにより、[`owner_equal`](/reference/memory/owner_equal.md)と組み合わせて、`shared_ptr`や[`weak_ptr`](/reference/memory/weak_ptr.md)を[`unordered_map`](/reference/unordered_map/unordered_map.md)や[`unordered_set`](/reference/unordered_set/unordered_set.md)のキーとして使用できる。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::shared_ptr org(new int(42)); + + // 別名コンストラクタで異なるポインタを指すが、所有権は同じ + std::shared_ptr alias(org, org.get()); + + std::cout << std::boolalpha; + std::cout << (org.owner_hash() == alias.owner_hash()) << std::endl; +} +``` +* owner_hash[color ff0000] + +### 出力 +``` +true +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 22 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + + +## 関連項目 +- [`owner_equal()`](owner_equal.md) +- [`std::owner_hash`](/reference/memory/owner_hash.md) +- [`owner_before()`](owner_before.md) + + +## 参照 +- [P1901R2 Enabling the Use of `weak_ptr` as Keys in Unordered Associative Containers](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1901r2.html) diff --git a/reference/memory/weak_ptr.md b/reference/memory/weak_ptr.md index 1af88326ac..548e7d3c10 100644 --- a/reference/memory/weak_ptr.md +++ b/reference/memory/weak_ptr.md @@ -42,6 +42,8 @@ namespace std { | [`expired`](weak_ptr/expired.md) | 監視対象の寿命切れやリンク切れを判定する | C++11 | | [`lock`](weak_ptr/lock.md) | 監視している`shared_ptr`オブジェクトを取得する | C++11 | | [`owner_before`](weak_ptr/owner_before.md) | 所有権ベースでの小なり比較を行う | C++11 | +| [`owner_equal`](weak_ptr/owner_equal.md) | 所有権ベースでの等値比較を行う | C++26 | +| [`owner_hash`](weak_ptr/owner_hash.md) | 所有権ベースでのハッシュ値を取得する | C++26 | ## メンバ型 diff --git a/reference/memory/weak_ptr/owner_equal.md b/reference/memory/weak_ptr/owner_equal.md new file mode 100644 index 0000000000..444d793365 --- /dev/null +++ b/reference/memory/weak_ptr/owner_equal.md @@ -0,0 +1,89 @@ +# owner_equal +* memory[meta header] +* std[meta namespace] +* weak_ptr[meta class] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +constexpr bool + owner_equal(const weak_ptr& b) const noexcept; // (1) C++26 + +template +constexpr bool + owner_equal(const shared_ptr& b) const noexcept; // (2) C++26 +``` +* shared_ptr[link /reference/memory/shared_ptr.md] + +## 概要 +所有権ベースでの等値比較を行う。 + + +## 戻り値 +`*this`と`b`が所有権を共有しているか、両方とも空であれば`true`を返し、そうでなければ`false`を返す。 + +以下の式と等価: + +```cpp +!owner_before(b) && !b.owner_before(*this) +``` +* owner_before[link owner_before.md] + + +## 備考 +詳細は、[`shared_ptr`](/reference/memory/shared_ptr.md)の[`owner_equal()`](/reference/memory/shared_ptr/owner_equal.md)メンバ関数を参照。 + + +## 例 +```cpp example +#include +#include + +struct X { + int i; + int j; +}; + +int main() +{ + std::shared_ptr org(new X()); + + std::shared_ptr sa(org, &(org->i)); + std::shared_ptr sb(org, &(org->j)); + + std::weak_ptr wa = sa; + std::weak_ptr wb = sb; + + std::cout << std::boolalpha; + std::cout << wa.owner_equal(wb) << std::endl; // 所有権ベース: true + std::cout << wa.owner_equal(sa) << std::endl; // weak_ptrとshared_ptrの比較: true +} +``` +* owner_equal[color ff0000] + +### 出力 +``` +true +true +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 22 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + + +## 関連項目 +- [`owner_hash()`](owner_hash.md) +- [`owner_before()`](owner_before.md) +- [`std::owner_equal`](/reference/memory/owner_equal.md) + + +## 参照 +- [P1901R2 Enabling the Use of `weak_ptr` as Keys in Unordered Associative Containers](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1901r2.html) +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) diff --git a/reference/memory/weak_ptr/owner_hash.md b/reference/memory/weak_ptr/owner_hash.md new file mode 100644 index 0000000000..04fe330cad --- /dev/null +++ b/reference/memory/weak_ptr/owner_hash.md @@ -0,0 +1,66 @@ +# owner_hash +* memory[meta header] +* std[meta namespace] +* weak_ptr[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +size_t owner_hash() const noexcept; // (1) C++26 +``` + +## 概要 +所有権ベースでのハッシュ値を取得する。 + + +## 戻り値 +所有権が等価な([`owner_equal()`](owner_equal.md)が`true`を返す)[`shared_ptr`](/reference/memory/shared_ptr.md)および`weak_ptr`オブジェクトに対して、同じハッシュ値を返す。 + + +## 備考 +この関数は、所有権ベースでのハッシュを提供する。 + +[`owner_equal()`](owner_equal.md)と[`std::owner_hash`](/reference/memory/owner_hash.md)を組み合わせて、`weak_ptr`を[`unordered_map`](/reference/unordered_map/unordered_map.md)や[`unordered_set`](/reference/unordered_set/unordered_set.md)のキーとして使用できる。 + +詳細は、[`shared_ptr`](/reference/memory/shared_ptr.md)の[`owner_hash()`](/reference/memory/shared_ptr/owner_hash.md)メンバ関数を参照。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::shared_ptr sp(new int(42)); + std::weak_ptr wp = sp; + + std::cout << std::boolalpha; + std::cout << (sp.owner_hash() == wp.owner_hash()) << std::endl; +} +``` +* owner_hash[color ff0000] + +### 出力 +``` +true +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 22 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + + +## 関連項目 +- [`owner_equal()`](owner_equal.md) +- [`std::owner_hash`](/reference/memory/owner_hash.md) +- [`owner_before()`](owner_before.md) + + +## 参照 +- [P1901R2 Enabling the Use of `weak_ptr` as Keys in Unordered Associative Containers](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1901r2.html) From 2079aca8380c7caa17da231160cfcf03de63e9fb Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 26 Feb 2026 12:48:19 +0900 Subject: [PATCH 2623/3948] =?UTF-8?q?=E9=9B=9B=E5=BD=A2=E3=81=A8=E7=94=A8?= =?UTF-8?q?=E8=AA=9E=E3=81=AB=E3=80=81=E5=A0=85=E7=89=A2=E5=8C=96=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=81=9F=E4=BA=8B=E5=89=8D=E6=9D=A1=E4=BB=B6=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20#1428?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_DEFINED_WORDS.json | 4 ++++ start_editing/comparison_operator_template_page.md | 5 +++++ start_editing/function_template_page.md | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/GLOBAL_DEFINED_WORDS.json b/GLOBAL_DEFINED_WORDS.json index d80cd9ebc1..0f15a869dd 100644 --- a/GLOBAL_DEFINED_WORDS.json +++ b/GLOBAL_DEFINED_WORDS.json @@ -102,6 +102,10 @@ "yomi": "てきかくようけん", "desc": "関数等の意味論を構成する要素の1つ。Mandates。満たさなければプログラムが不適格となる要件。この要件は、オーバーロード解決によって選択された関数内での`static_assert`の定数条件式や、関数に対するdelete宣言などで表現できる" }, + "堅牢化された事前条件": { + "yomi": "けんろうかされたじぜんじょうけん", + "desc": "関数等の意味論を構成する要素の1つ。Hardened preconditions。関数呼び出し時に満たされていると関数が想定する条件。満たさない場合は契約違反となる動作。セキュリティ上の脆弱性につながる操作に対して設定される事前条件" + }, "事前条件": { "yomi": "じぜんじょうけん", "desc": "関数等の意味論を構成する要素の1つ。Preconditions。関数呼び出し時に満たされていると関数が想定する条件。満たさなければ未定義の動作。契約属性の`[[expects]]`に相当" diff --git a/start_editing/comparison_operator_template_page.md b/start_editing/comparison_operator_template_page.md index 5f2874ca45..8c6ad7e3d9 100644 --- a/start_editing/comparison_operator_template_page.md +++ b/start_editing/comparison_operator_template_page.md @@ -69,6 +69,10 @@ namespace std { (ここには、関数を実行するための値の事前条件を記述します。契約属性の`[[expects]]`に相当します。) +## 堅牢化された事前条件 +(ここには、関数を実行するための値の事前条件を記述します。規格ではHardened preconditionsの項目です。) + + ## 効果 (ここには、関数の内部で行われる効果:effect を記述します。戻り値しかないような関数の場合には、項目を削除してください。) @@ -172,3 +176,4 @@ int main() (ここには、その関数・変数・定数を理解するにあたっての参考資料や、関連する機能へのリンクを記述します。とくに必要がないと判断した場合、項目を削除してください。) - [P0788R3 Standard Library Specification in a Concepts and Contracts World](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0788r3.pdf) +- [P3471R4 Standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3471r4.html) diff --git a/start_editing/function_template_page.md b/start_editing/function_template_page.md index e8f439b671..74b679d3a7 100644 --- a/start_editing/function_template_page.md +++ b/start_editing/function_template_page.md @@ -70,6 +70,10 @@ void definition(); // 関数・変数・定数の宣言を記述します。 (ここには、関数を実行するための値の事前条件を記述します。契約属性の`[[expects]]`に相当します。) +## 堅牢化された事前条件 +(ここには、関数を実行するための値の事前条件を記述します。規格ではHardened preconditionsの項目です。) + + ## 効果 (ここには、関数の内部で発生する効果を記述します。戻り値しかないような関数の場合には、項目を削除してください。) @@ -179,3 +183,4 @@ int main() (ここには、その関数・変数・定数を理解するにあたっての参考資料や、関連する機能へのリンクを記述します。とくに必要がないと判断した場合、項目を削除してください。) - [P0788R3 Standard Library Specification in a Concepts and Contracts World](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0788r3.pdf) +- [P3471R4 Standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3471r4.html) From f5d6b947178dfc66f36a78e6276f88a1996e41d5 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 26 Feb 2026 13:20:38 +0900 Subject: [PATCH 2624/3948] =?UTF-8?q?=E3=83=A9=E3=82=A4=E3=83=96=E3=83=A9?= =?UTF-8?q?=E3=83=AA:=20C++26=E3=81=A7=E3=81=AE=E3=80=8C=E5=A0=85=E7=89=A2?= =?UTF-8?q?=E5=8C=96=E3=81=95=E3=82=8C=E3=81=9F=E4=BA=8B=E5=89=8D=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=E3=80=8D=E3=82=92=E9=81=A9=E7=94=A8=20#1520?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/bitset/bitset/op_at.md | 4 +++- reference/deque/deque/pop_back.md | 4 +++- reference/expected/expected.void/error.md | 4 +++- reference/expected/expected.void/op_deref.md | 4 +++- reference/expected/expected/error.md | 4 +++- reference/expected/expected/op_arrow.md | 4 +++- reference/expected/expected/op_deref.md | 4 +++- reference/forward_list/forward_list/pop_front.md | 4 +++- reference/iterator/common_iterator/iter_move.md | 4 +++- reference/iterator/common_iterator/iter_swap.md | 4 +++- reference/iterator/common_iterator/op_arrow.md | 4 +++- reference/iterator/common_iterator/op_assign.md | 4 +++- reference/iterator/common_iterator/op_constructor.md | 4 +++- reference/iterator/common_iterator/op_deref.md | 4 +++- reference/iterator/common_iterator/op_equal.md | 4 +++- reference/iterator/common_iterator/op_increment.md | 4 +++- reference/iterator/common_iterator/op_minus.md | 4 +++- reference/iterator/counted_iterator/iter_move.md | 4 +++- reference/iterator/counted_iterator/iter_swap.md | 4 +++- reference/iterator/counted_iterator/op_at.md | 4 +++- reference/iterator/counted_iterator/op_constructor.md | 4 +++- reference/iterator/counted_iterator/op_deref.md | 4 +++- reference/iterator/counted_iterator/op_increment.md | 4 +++- reference/iterator/counted_iterator/op_minus_assign.md | 4 +++- reference/iterator/counted_iterator/op_plus_assign.md | 4 +++- reference/list/list/pop_back.md | 4 +++- reference/list/list/pop_front.md | 4 +++- reference/mdspan/mdspan/op_at.md | 4 +++- reference/mdspan/mdspan/op_constructor.md | 4 +++- reference/memory/shared_ptr/op_at.md | 6 ++++-- reference/optional/optional/op_arrow.md | 4 +++- reference/optional/optional/op_deref.md | 7 ++++++- reference/ranges/view_interface/back.md | 4 +++- reference/ranges/view_interface/front.md | 4 +++- reference/span/span/back.md | 7 ++++++- reference/span/span/first.md | 4 +++- reference/span/span/front.md | 7 ++++++- reference/span/span/last.md | 4 +++- reference/span/span/op_at.md | 4 +++- reference/span/span/op_constructor.md | 4 +++- reference/span/span/subspan.md | 4 +++- reference/stacktrace/basic_stacktrace/current.md | 6 +++++- reference/stacktrace/basic_stacktrace/op_at.md | 6 +++++- reference/string/basic_string/back.md | 4 +++- reference/string/basic_string/front.md | 4 +++- reference/string/basic_string/op_at.md | 4 +++- reference/string/basic_string/pop_back.md | 4 +++- reference/string_view/basic_string_view/back.md | 7 ++++++- reference/string_view/basic_string_view/front.md | 7 ++++++- reference/string_view/basic_string_view/op_at.md | 7 ++++++- reference/string_view/basic_string_view/remove_prefix.md | 7 ++++++- reference/string_view/basic_string_view/remove_suffix.md | 7 ++++++- reference/vector/vector/pop_back.md | 4 +++- 53 files changed, 188 insertions(+), 54 deletions(-) diff --git a/reference/bitset/bitset/op_at.md b/reference/bitset/bitset/op_at.md index 8d9b77c01a..12a0cbc6cc 100644 --- a/reference/bitset/bitset/op_at.md +++ b/reference/bitset/bitset/op_at.md @@ -17,7 +17,7 @@ constexpr reference operator[](size_t pos); // (2) C++23 任意の位置のビットにアクセスする。 -## 要件 +## 堅牢化された事前条件 `pos <` [`size()`](size.md)であること。 @@ -59,3 +59,5 @@ false ## 参照 - [N3669 Fixing constexpr member functions without const](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3669.pdf) - [P2417R2 A more constexpr bitset](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2417r2.pdf) +- [P3471R4 Standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3471r4.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/deque/deque/pop_back.md b/reference/deque/deque/pop_back.md index ed66804ae1..04a4ec95d2 100644 --- a/reference/deque/deque/pop_back.md +++ b/reference/deque/deque/pop_back.md @@ -13,7 +13,7 @@ constexpr void pop_back(); // (1) C++26 末尾要素を削除する。 -## 要件 +## 堅牢化された事前条件 [`empty()`](empty.md) `== false`であること。 @@ -63,3 +63,5 @@ int main() ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [P3471R4 Standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3471r4.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/expected/expected.void/error.md b/reference/expected/expected.void/error.md index 54bb42da90..d35823538f 100644 --- a/reference/expected/expected.void/error.md +++ b/reference/expected/expected.void/error.md @@ -17,7 +17,7 @@ constexpr E&& error() && noexcept; // (4) エラー値を取得する。 -## 事前条件 +## 堅牢化された事前条件 [`has_value()`](has_value.md) `== false` @@ -73,3 +73,5 @@ ERR ## 参照 - [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) +- [P3471R4 Standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3471r4.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/expected/expected.void/op_deref.md b/reference/expected/expected.void/op_deref.md index 99521a8758..e45540a046 100644 --- a/reference/expected/expected.void/op_deref.md +++ b/reference/expected/expected.void/op_deref.md @@ -14,7 +14,7 @@ constexpr void operator*() const noexcept; 正常値(`void`)を取得する。 -## 事前条件 +## 堅牢化された事前条件 [`has_value()`](has_value.md) `== true` @@ -65,3 +65,5 @@ int main() ## 参照 - [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) +- [P3471R4 Standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3471r4.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/expected/expected/error.md b/reference/expected/expected/error.md index e15a2e80a6..6ecc3edc44 100644 --- a/reference/expected/expected/error.md +++ b/reference/expected/expected/error.md @@ -16,7 +16,7 @@ constexpr E&& error() && noexcept; // (4) エラー値を取得する。 -## 事前条件 +## 堅牢化された事前条件 [`has_value()`](has_value.md) `== false` @@ -72,3 +72,5 @@ ERR ## 参照 - [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) +- [P3471R4 Standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3471r4.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/expected/expected/op_arrow.md b/reference/expected/expected/op_arrow.md index 9356fbd458..7161e5527d 100644 --- a/reference/expected/expected/op_arrow.md +++ b/reference/expected/expected/op_arrow.md @@ -14,7 +14,7 @@ constexpr T* operator->() noexcept; // (2) 保持している正常値のメンバにアクセスする。 -## 事前条件 +## 堅牢化された事前条件 [`has_value()`](has_value.md) `== true` @@ -70,3 +70,5 @@ int main() ## 参照 - [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) +- [P3471R4 Standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3471r4.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/expected/expected/op_deref.md b/reference/expected/expected/op_deref.md index 43e8e5ec52..8e4611da38 100644 --- a/reference/expected/expected/op_deref.md +++ b/reference/expected/expected/op_deref.md @@ -16,7 +16,7 @@ constexpr const T&& operator*() const && noexcept; // (4) 正常値を取得する。 -## 事前条件 +## 堅牢化された事前条件 [`has_value()`](has_value.md) `== true` @@ -75,3 +75,5 @@ int main() ## 参照 - [P0323R12 std::expected](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html) +- [P3471R4 Standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3471r4.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/forward_list/forward_list/pop_front.md b/reference/forward_list/forward_list/pop_front.md index 4ad84bd918..e0a5df6acd 100644 --- a/reference/forward_list/forward_list/pop_front.md +++ b/reference/forward_list/forward_list/pop_front.md @@ -14,7 +14,7 @@ constexpr void pop_front(); // (1) C++26 先頭要素を削除する -## 要件 +## 堅牢化された事前条件 [`empty()`](empty.md) `== false`であること。 @@ -66,3 +66,5 @@ int main() ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [P3471R4 Standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3471r4.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/iterator/common_iterator/iter_move.md b/reference/iterator/common_iterator/iter_move.md index 9fee37512a..d97ba53ad4 100644 --- a/reference/iterator/common_iterator/iter_move.md +++ b/reference/iterator/common_iterator/iter_move.md @@ -22,7 +22,7 @@ namespace std { `common_iterator`の指す要素をムーブする。 -## 事前条件 +## 堅牢化された事前条件 [`holds_alternative`](/reference/variant/holds_alternative.md)`(i.v_) == true`であること。 @@ -89,3 +89,5 @@ int main() { ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) - [LWG Issue 3953. `iter_move` for `common_iterator` and `counted_iterator` should return `decltype(auto)`](https://cplusplus.github.io/LWG/issue3953) +- [P3697R1 Minor additions to C++26 standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3697r1.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/iterator/common_iterator/iter_swap.md b/reference/iterator/common_iterator/iter_swap.md index f3f103619d..a902dfb1bd 100644 --- a/reference/iterator/common_iterator/iter_swap.md +++ b/reference/iterator/common_iterator/iter_swap.md @@ -22,7 +22,7 @@ namespace std { 2つの`common_iterator`の指す要素を交換する。 -## 事前条件 +## 堅牢化された事前条件 [`holds_alternative`](/reference/variant/holds_alternative.md)`(x.v_)`、[`holds_alternative`](/reference/variant/holds_alternative.md)`(y.v_)`はどちらも`true`であること。 @@ -99,3 +99,5 @@ int main() { ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P3697R1 Minor additions to C++26 standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3697r1.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/iterator/common_iterator/op_arrow.md b/reference/iterator/common_iterator/op_arrow.md index 427bc86a5c..0088e8b0b4 100644 --- a/reference/iterator/common_iterator/op_arrow.md +++ b/reference/iterator/common_iterator/op_arrow.md @@ -27,7 +27,7 @@ indirectly_readable && * iter_reference_t[link /reference/iterator/iter_reference_t.md] * constructible_from[link /reference/concepts/constructible_from.md] -## 事前条件 +## 堅牢化された事前条件 [`holds_alternative`](/reference/variant/holds_alternative.md)`(v_) == true` @@ -69,3 +69,5 @@ indirectly_readable && ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P3697R1 Minor additions to C++26 standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3697r1.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/iterator/common_iterator/op_assign.md b/reference/iterator/common_iterator/op_assign.md index e80de3743c..d3e446a631 100644 --- a/reference/iterator/common_iterator/op_assign.md +++ b/reference/iterator/common_iterator/op_assign.md @@ -17,7 +17,7 @@ common_iterator& operator=(const common_iterator& x); `common_iterator`オブジェクトをコピー代入する。 -## 事前条件 +## 堅牢化された事前条件 `x.v_.`[`valueless_by_exception`](/reference/variant/variant/valueless_by_exception.md)`() == false`であること。 @@ -43,3 +43,5 @@ common_iterator& operator=(const common_iterator& x); ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P3697R1 Minor additions to C++26 standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3697r1.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/iterator/common_iterator/op_constructor.md b/reference/iterator/common_iterator/op_constructor.md index 06d76b6d16..11ca928308 100644 --- a/reference/iterator/common_iterator/op_constructor.md +++ b/reference/iterator/common_iterator/op_constructor.md @@ -22,7 +22,7 @@ constexpr common_iterator(const common_iterator& x); // (4) `common_iterator`オブジェクトを構築する。 -## 事前条件 +## 堅牢化された事前条件 - (4) : `x.v_.`[`valueless_by_exception`](/reference/variant/variant/valueless_by_exception.md)`() == false`であること。 @@ -87,3 +87,5 @@ int main() { ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) - [P2325R3 Views should not be required to be default constructible](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2325r3.html) +- [P3697R1 Minor additions to C++26 standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3697r1.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/iterator/common_iterator/op_deref.md b/reference/iterator/common_iterator/op_deref.md index 12713f9c64..0dafd54e85 100644 --- a/reference/iterator/common_iterator/op_deref.md +++ b/reference/iterator/common_iterator/op_deref.md @@ -14,7 +14,7 @@ decltype(auto) operator*() const requires dereferenceable; ## 概要 イテレータを間接参照する。 -## 事前条件 +## 堅牢化された事前条件 [`holds_alternative`](/reference/variant/holds_alternative.md)`(v_) == true` @@ -66,3 +66,5 @@ int main() { ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P3697R1 Minor additions to C++26 standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3697r1.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/iterator/common_iterator/op_equal.md b/reference/iterator/common_iterator/op_equal.md index e114474481..37b766e05c 100644 --- a/reference/iterator/common_iterator/op_equal.md +++ b/reference/iterator/common_iterator/op_equal.md @@ -26,7 +26,7 @@ namespace std { ## 概要 2つの`common_iterator`オブジェクトが同じ要素を指しているかを判定する。 -## 事前条件 +## 堅牢化された事前条件 `x.v_.`[`valueless_by_exception`](/reference/variant/variant/valueless_by_exception.md)`()`、`y.v_.`[`valueless_by_exception`](/reference/variant/variant/valueless_by_exception.md)`()`はどちらも`false`であること。 @@ -105,3 +105,5 @@ true ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P3697R1 Minor additions to C++26 standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3697r1.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/iterator/common_iterator/op_increment.md b/reference/iterator/common_iterator/op_increment.md index 78dc410494..410f366235 100644 --- a/reference/iterator/common_iterator/op_increment.md +++ b/reference/iterator/common_iterator/op_increment.md @@ -13,7 +13,7 @@ decltype(auto) operator++(int); // (2) ## 概要 イテレータをインクリメントする。 -## 事前条件 +## 堅牢化された事前条件 [`holds_alternative`](/reference/variant/holds_alternative.md)`(v_) == true` @@ -84,3 +84,5 @@ int main() { ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P3697R1 Minor additions to C++26 standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3697r1.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/iterator/common_iterator/op_minus.md b/reference/iterator/common_iterator/op_minus.md index cb429e501b..4d1a0a0836 100644 --- a/reference/iterator/common_iterator/op_minus.md +++ b/reference/iterator/common_iterator/op_minus.md @@ -23,7 +23,7 @@ namespace std { 2つの`common_iterator`間の距離を求める。 -## 事前条件 +## 堅牢化された事前条件 `x.v_.`[`valueless_by_exception`](/reference/variant/variant/valueless_by_exception.md)`()`、`y.v_.`[`valueless_by_exception`](/reference/variant/variant/valueless_by_exception.md)`()`はどちらも`false`であること。 @@ -81,3 +81,5 @@ int main() { ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P3697R1 Minor additions to C++26 standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3697r1.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/iterator/counted_iterator/iter_move.md b/reference/iterator/counted_iterator/iter_move.md index fb6fc519fa..f787f69f7f 100644 --- a/reference/iterator/counted_iterator/iter_move.md +++ b/reference/iterator/counted_iterator/iter_move.md @@ -16,7 +16,7 @@ namespace std { `counted_iterator`の指す要素をムーブする。 -## 事前条件 +## 堅牢化された事前条件 カウントの値を`length`メンバ変数に保持するとして @@ -83,3 +83,5 @@ int main() { - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) - [LWG Issue 3472. `counted_iterator` is missing preconditions](https://cplusplus.github.io/LWG/issue3472) - [LWG Issue 3953. `iter_move` for `common_iterator` and `counted_iterator` should return `decltype(auto)`](https://cplusplus.github.io/LWG/issue3953) +- [P3697R1 Minor additions to C++26 standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3697r1.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/iterator/counted_iterator/iter_swap.md b/reference/iterator/counted_iterator/iter_swap.md index 6d5f92c314..b6dc5a69a3 100644 --- a/reference/iterator/counted_iterator/iter_swap.md +++ b/reference/iterator/counted_iterator/iter_swap.md @@ -17,7 +17,7 @@ namespace std { 2つの`counted_iterator`の指す要素を交換する。 -## 事前条件 +## 堅牢化された事前条件 カウントの値を`length`メンバ変数に保持するとして @@ -87,3 +87,5 @@ int main() { ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) - [LWG Issue 3472. `counted_iterator` is missing preconditions](https://cplusplus.github.io/LWG/issue3472) +- [P3697R1 Minor additions to C++26 standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3697r1.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/iterator/counted_iterator/op_at.md b/reference/iterator/counted_iterator/op_at.md index 1ab89a554c..027f647cd7 100644 --- a/reference/iterator/counted_iterator/op_at.md +++ b/reference/iterator/counted_iterator/op_at.md @@ -13,7 +13,7 @@ constexpr decltype(auto) operator[](iter_difference_t n) const ## 概要 任意の位置にランダムアクセスする。 -## 事前条件 +## 堅牢化された事前条件 カウントの値を`length`メンバ変数に保持するとすると、`n < length`であること。 @@ -61,3 +61,5 @@ int main() { ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P3697R1 Minor additions to C++26 standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3697r1.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/iterator/counted_iterator/op_constructor.md b/reference/iterator/counted_iterator/op_constructor.md index f322490891..2a2b3439ef 100644 --- a/reference/iterator/counted_iterator/op_constructor.md +++ b/reference/iterator/counted_iterator/op_constructor.md @@ -19,7 +19,7 @@ constexpr counted_iterator(const counted_iterator& x); // (3) `counted_iterator`オブジェクトを構築する。 -## 事前条件 +## 堅牢化された事前条件 - (2) : `n >= 0` @@ -69,3 +69,5 @@ int main() { ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) - [P2325R3 Views should not be required to be default constructible](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2325r3.html) +- [P3697R1 Minor additions to C++26 standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3697r1.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/iterator/counted_iterator/op_deref.md b/reference/iterator/counted_iterator/op_deref.md index cc0c2f2c1e..0556fca3ab 100644 --- a/reference/iterator/counted_iterator/op_deref.md +++ b/reference/iterator/counted_iterator/op_deref.md @@ -14,7 +14,7 @@ constexpr decltype(auto) operator*() const requires dereferenceable; ## 概要 イテレータを間接参照する。 -## 事前条件 +## 堅牢化された事前条件 カウントの値を`length`メンバ変数に保持するとして @@ -65,3 +65,5 @@ int main() { ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) - [LWG Issue 3472. `counted_iterator` is missing preconditions](https://cplusplus.github.io/LWG/issue3472) +- [P3697R1 Minor additions to C++26 standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3697r1.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/iterator/counted_iterator/op_increment.md b/reference/iterator/counted_iterator/op_increment.md index 7d04b481ba..9ed11a23f5 100644 --- a/reference/iterator/counted_iterator/op_increment.md +++ b/reference/iterator/counted_iterator/op_increment.md @@ -20,7 +20,7 @@ constexpr counted_iterator operator++(int) - (1) : 前置インクリメント - (2), (3) : 後置インクリメント -## 事前条件 +## 堅牢化された事前条件 - (1), (2) : [`count()`](count.md) `> 0` @@ -97,3 +97,5 @@ int main() { ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P3697R1 Minor additions to C++26 standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3697r1.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/iterator/counted_iterator/op_minus_assign.md b/reference/iterator/counted_iterator/op_minus_assign.md index 629a421309..26ad70e80e 100644 --- a/reference/iterator/counted_iterator/op_minus_assign.md +++ b/reference/iterator/counted_iterator/op_minus_assign.md @@ -14,7 +14,7 @@ constexpr counted_iterator& operator-=(iter_difference_t n) requires random_a イテレータ自身を`n`回逆に進める。 -## 事前条件 +## 堅牢化された事前条件 現在のカウントの値を`length`メンバ変数に保持するとして、`n <= length` @@ -67,3 +67,5 @@ int main() { ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P3697R1 Minor additions to C++26 standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3697r1.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/iterator/counted_iterator/op_plus_assign.md b/reference/iterator/counted_iterator/op_plus_assign.md index 821bfe1a2c..3ff092d998 100644 --- a/reference/iterator/counted_iterator/op_plus_assign.md +++ b/reference/iterator/counted_iterator/op_plus_assign.md @@ -14,7 +14,7 @@ constexpr counted_iterator& operator+=(iter_difference_t n) requires random_a イテレータ自身を`n`回進める。 -## 事前条件 +## 堅牢化された事前条件 現在のカウントの値を`length`メンバ変数に保持するとして、`n <= length` @@ -66,3 +66,5 @@ int main() { ## 参照 - [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf) +- [P3697R1 Minor additions to C++26 standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3697r1.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/list/list/pop_back.md b/reference/list/list/pop_back.md index 85fe2215cf..2f6ea7bc87 100644 --- a/reference/list/list/pop_back.md +++ b/reference/list/list/pop_back.md @@ -13,7 +13,7 @@ constexpr void pop_back(); // (1) C++26 末尾要素を削除する -## 要件 +## 堅牢化された事前条件 [`empty()`](empty.md) `== false`であること。 @@ -52,3 +52,5 @@ int main() ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [P3471R4 Standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3471r4.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/list/list/pop_front.md b/reference/list/list/pop_front.md index 482ac1497e..4cda745b83 100644 --- a/reference/list/list/pop_front.md +++ b/reference/list/list/pop_front.md @@ -13,7 +13,7 @@ constexpr void pop_front(); // (1) C++26 先頭要素を削除する -## 要件 +## 堅牢化された事前条件 [`empty()`](empty.md) `== false`であること。 @@ -52,3 +52,5 @@ int main() ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [P3471R4 Standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3471r4.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/mdspan/mdspan/op_at.md b/reference/mdspan/mdspan/op_at.md index 937c9e8f7e..2c02dc9469 100644 --- a/reference/mdspan/mdspan/op_at.md +++ b/reference/mdspan/mdspan/op_at.md @@ -33,7 +33,7 @@ constexpr reference operator[](const array& indices) con - `(`[`is_nothrow_constructible_v`](/reference/type_traits/is_nothrow_constructible.md)` && ...)`が`true`であること -## 事前条件 +## 堅牢化された事前条件 (1) : パック`I`を[`extents_type::index-cast`](../extents/index-cast.md)`(`[`as_const`](/reference/utility/as_const.md)`(indices))`としたとき、`I`は`extents()`の多次元インデクスであること。 @@ -95,3 +95,5 @@ int main() ## 参照 - [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) +- [P3471R4 Standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3471r4.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/mdspan/mdspan/op_constructor.md b/reference/mdspan/mdspan/op_constructor.md index 9b87d9e796..413708dc3f 100644 --- a/reference/mdspan/mdspan/op_constructor.md +++ b/reference/mdspan/mdspan/op_constructor.md @@ -93,7 +93,7 @@ template`が`true` -## 事前条件 +## 堅牢化された事前条件 - (1) : デフォルト構築された`map_`, `acc_`を用いたとき、半開区間`[0, map_.required_span_size())`が`ptr_`と`acc_`によってアクセス可能な範囲であること。 - (4), (5), (6), (7) : このコンストラクタで構築された`map_`とデフォルト構築された`acc_`を用いたとき、半開区間`[0, map_.required_span_size())`が`p`と`acc_`によってアクセス可能な範囲であること。 - (8) : デフォルト構築された`acc_`を用いたとき、半開区間`[0, m.required_span_size())`が`p`と`acc_`によってアクセス可能な範囲であること。 @@ -263,3 +263,5 @@ int main() ## 参照 - [P0009R18 MDSPAN](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0009r18.html) +- [P3471R4 Standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3471r4.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/memory/shared_ptr/op_at.md b/reference/memory/shared_ptr/op_at.md index 1a453a8f1b..196eef4558 100644 --- a/reference/memory/shared_ptr/op_at.md +++ b/reference/memory/shared_ptr/op_at.md @@ -18,7 +18,7 @@ constexpr element_type& 配列に対して、添字を使用して任意の位置の要素を参照する。 -## 要件 +## 堅牢化された事前条件 - [`get()`](get.md) `!= nullptr && i >= 0` - 型`T`が`U[N]`の形式となっており、要素数が判明している場合、`i < N`であること @@ -68,4 +68,6 @@ int main() ## 参照 -- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) \ No newline at end of file +- [P3037R6 `constexpr std::shared_ptr` and friends](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3037r6.pdf) +- [P3697R1 Minor additions to C++26 standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3697r1.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) \ No newline at end of file diff --git a/reference/optional/optional/op_arrow.md b/reference/optional/optional/op_arrow.md index 262f6c1870..87b6fda9bf 100644 --- a/reference/optional/optional/op_arrow.md +++ b/reference/optional/optional/op_arrow.md @@ -14,7 +14,7 @@ constexpr T* operator->(); 保持している有効値のメンバにアクセスする。 -## 要件 +## 堅牢化された事前条件 `*this`が有効な値を保持していること @@ -70,3 +70,5 @@ int main() ## 参照 - [LWG Issue 2740. `constexpr optional::operator->`](https://wg21.cmeerw.net/lwg/issue2740) +- [P3471R4 Standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3471r4.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/optional/optional/op_deref.md b/reference/optional/optional/op_deref.md index 94ca01e7d9..1a456fd7ef 100644 --- a/reference/optional/optional/op_deref.md +++ b/reference/optional/optional/op_deref.md @@ -21,7 +21,7 @@ constexpr const T&& operator*() const&&; // (4) - (4) : `*this` が `const` 右辺値である場合に、有効値への `const` 右辺値参照を返す -## 要件 +## 堅牢化された事前条件 [`has_value()`](has_value.md) `== true` であること。 @@ -81,3 +81,8 @@ int main() ## 関連項目 - [`optional::value()`](value.md) + + +## 参照 +- [P3471R4 Standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3471r4.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/ranges/view_interface/back.md b/reference/ranges/view_interface/back.md index 2f2f5761d5..748be3cb66 100644 --- a/reference/ranges/view_interface/back.md +++ b/reference/ranges/view_interface/back.md @@ -22,7 +22,7 @@ Rangeの末尾の要素を取得する。 - (1): `D`が[`bidirectional_range`](../bidirectional_range.md)かつ[`common_range`](../common_range.md)であること。 - (2): `const D`が[`bidirectional_range`](../bidirectional_range.md)かつ[`common_range`](../common_range.md)であること。 -## 事前条件 +## 堅牢化された事前条件 `!`[`empty`](empty.md)`()` ## 戻り値 @@ -50,3 +50,5 @@ Rangeの末尾の要素を取得する。 ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) - [C++20 ranges](https://techbookfest.org/product/5134506308665344) +- [P3697R1 Minor additions to C++26 standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3697r1.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/ranges/view_interface/front.md b/reference/ranges/view_interface/front.md index 00ba7cdfdb..32786e4f04 100644 --- a/reference/ranges/view_interface/front.md +++ b/reference/ranges/view_interface/front.md @@ -22,7 +22,7 @@ Rangeの先頭の要素を取得する。 - (1): `D`が[`forward_range`](../forward_range.md)であること。 - (2): `const D`が[`forward_range`](../forward_range.md)であること。 -## 事前条件 +## 堅牢化された事前条件 `!`[`empty`](empty.md)`()` ## 戻り値 @@ -49,3 +49,5 @@ Rangeの先頭の要素を取得する。 ## 参照 - [N4861 24 Ranges library](https://timsong-cpp.github.io/cppwp/n4861/ranges) - [C++20 ranges](https://techbookfest.org/product/5134506308665344) +- [P3697R1 Minor additions to C++26 standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3697r1.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/span/span/back.md b/reference/span/span/back.md index 0db3735a71..952b5c83d2 100644 --- a/reference/span/span/back.md +++ b/reference/span/span/back.md @@ -13,7 +13,7 @@ constexpr reference back() const; 参照範囲の末尾要素を取得する。 -## 事前条件 +## 堅牢化された事前条件 - [`empty()`](empty.md)が`false`であること @@ -63,3 +63,8 @@ int main() - [Clang](/implementation.md#clang): 9.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3471R4 Standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3471r4.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/span/span/first.md b/reference/span/span/first.md index acdf611878..5e212dbee2 100644 --- a/reference/span/span/first.md +++ b/reference/span/span/first.md @@ -26,7 +26,7 @@ constexpr span - (1) : `Count <= Extent`が`true`であること -## 事前条件 +## 堅牢化された事前条件 - (1) : `Count <=` [`size()`](size.md)が`true`であること - (2) : `count <=` [`size()`](size.md)が`true`であること @@ -98,3 +98,5 @@ int main() ## 参照 - [P1872R0 `span` should have `size_type`, not `index_type`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1872r0.pdf) - [LWG Issue 3103. Errors in taking subview of `span` should be ill-formed where possible](https://wg21.cmeerw.net/lwg/issue3103) +- [P3471R4 Standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3471r4.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/span/span/front.md b/reference/span/span/front.md index 356ff7d8e1..b49b7e72d8 100644 --- a/reference/span/span/front.md +++ b/reference/span/span/front.md @@ -13,7 +13,7 @@ constexpr reference front() const; 参照範囲の先頭要素を取得する。 -## 事前条件 +## 堅牢化された事前条件 - [`empty()`](empty.md)が`false`であること @@ -62,3 +62,8 @@ int main() - [Clang](/implementation.md#clang): 9.0 [mark verified] - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3471R4 Standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3471r4.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/span/span/last.md b/reference/span/span/last.md index 11cd8656f1..f8bd9cc316 100644 --- a/reference/span/span/last.md +++ b/reference/span/span/last.md @@ -26,7 +26,7 @@ constexpr span - (1) : `Count <= Extent`が`true`であること -## 事前条件 +## 堅牢化された事前条件 - (1) : `Count <=` [`size()`](size.md)が`true`であること - (2) : `count <=` [`size()`](size.md)が`true`であること @@ -99,3 +99,5 @@ int main() ## 参照 - [P1872R0 `span` should have `size_type`, not `index_type`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1872r0.pdf) - [LWG Issue 3103. Errors in taking subview of `span` should be ill-formed where possible](https://wg21.cmeerw.net/lwg/issue3103) +- [P3471R4 Standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3471r4.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/span/span/op_at.md b/reference/span/span/op_at.md index 5c84465a56..b83fa72696 100644 --- a/reference/span/span/op_at.md +++ b/reference/span/span/op_at.md @@ -13,7 +13,7 @@ constexpr reference operator[](size_type i) const; 参照範囲から、任意の位置の要素を取得する。 -## 事前条件 +## 堅牢化された事前条件 - `i <` [`size()`](size.md)が`true`であること @@ -71,3 +71,5 @@ int main() ## 参照 - [P1872R0 `span` should have `size_type`, not `index_type`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1872r0.pdf) +- [P3471R4 Standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3471r4.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/span/span/op_constructor.md b/reference/span/span/op_constructor.md index c4481a62f2..166f30f1bc 100644 --- a/reference/span/span/op_constructor.md +++ b/reference/span/span/op_constructor.md @@ -97,7 +97,7 @@ constexpr explicit(extent != dynamic_extent) - (`std::span`に対してのみ使用できる) -## 事前条件 +## 堅牢化された事前条件 - (2) : - `[first, first + count)`が妥当なイテレータ範囲であること - 型 `It` はコンセプト [`std::contiguous_iterator`](/reference/iterator/contiguous_iterator.md) のモデルであること @@ -344,3 +344,5 @@ int main() - [P2117R0 C++ Standard Library Issues Resolved Directly In Prague](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2117r0.html) - [P2447R6 `std::span` over an initializer list](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2447r6.html) - C++26から初期化子リストをとるコンストラクタが追加された +- [P3471R4 Standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3471r4.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/span/span/subspan.md b/reference/span/span/subspan.md index 3520ed591a..fc5869dd6e 100644 --- a/reference/span/span/subspan.md +++ b/reference/span/span/subspan.md @@ -26,7 +26,7 @@ constexpr span - (1) : `Offset <= Extent && (Count ==` [`dynamic_extent`](/reference/span/dynamic_extent.md) `|| Count <= Extent - Offset)`が`true`であること -## 事前条件 +## 堅牢化された事前条件 (1)であれば`Offset`を`i`、`Count`を`N`とし、(2)であれば`offset`を`i`、`count`を`N`として、 - `i <=` [`size()`](size.md) `&& (N ==` [`dynamic_extent`](/reference/span/dynamic_extent.md) `|| N <=` [`size()`](size.md) `- i)`が`true`であること @@ -116,3 +116,5 @@ int main() ## 参照 - [P1872R0 `span` should have `size_type`, not `index_type`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1872r0.pdf) - [LWG Issue 3103. Errors in taking subview of `span` should be ill-formed where possible](https://wg21.cmeerw.net/lwg/issue3103) +- [P3471R4 Standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3471r4.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/stacktrace/basic_stacktrace/current.md b/reference/stacktrace/basic_stacktrace/current.md index 1027d956ba..edc245d2dc 100644 --- a/reference/stacktrace/basic_stacktrace/current.md +++ b/reference/stacktrace/basic_stacktrace/current.md @@ -27,7 +27,7 @@ static basic_stacktrace - (3) : 現在位置 + `skip`から最大で`max_depth`個のスタックトレースを取得する -## 事前条件 +## 堅牢化された事前条件 - (3) : `skip <= skip + max_depth`であること @@ -141,3 +141,7 @@ int main() { - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): 12 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P3697R1 Minor additions to C++26 standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3697r1.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/stacktrace/basic_stacktrace/op_at.md b/reference/stacktrace/basic_stacktrace/op_at.md index cb94229069..6cf9cb222f 100644 --- a/reference/stacktrace/basic_stacktrace/op_at.md +++ b/reference/stacktrace/basic_stacktrace/op_at.md @@ -13,7 +13,7 @@ const_reference operator[](size_type frame_no) const; // (1) C++23 任意の位置の要素を取得する。 -## 事前条件 +## 堅牢化された事前条件 - `frame_no <` [`size()`](size.md)であること @@ -60,3 +60,7 @@ int main() { - [Clang](/implementation.md#clang): ?? - [GCC](/implementation.md#gcc): 12 [mark verified] - [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P3697R1 Minor additions to C++26 standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3697r1.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/string/basic_string/back.md b/reference/string/basic_string/back.md index 0c565acf65..78249fa1f5 100644 --- a/reference/string/basic_string/back.md +++ b/reference/string/basic_string/back.md @@ -17,7 +17,7 @@ constexpr charT& back(); // (2) C++20 末尾要素への参照を取得する。 -## 要件 +## 堅牢化された事前条件 `!`[`empty()`](empty.md) @@ -48,3 +48,5 @@ o ## 参照 - [LWG Issue 534. Missing `basic_string` members](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#534) - [P0980R1 Making `std::string` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0980r1.pdf) +- [P3471R4 Standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3471r4.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/string/basic_string/front.md b/reference/string/basic_string/front.md index 6428241f5a..a79473814c 100644 --- a/reference/string/basic_string/front.md +++ b/reference/string/basic_string/front.md @@ -17,7 +17,7 @@ constexpr charT& front(); // (2) C++20 先頭要素への参照を返す。 -## 要件 +## 堅牢化された事前条件 `!`[`empty()`](empty.md) @@ -48,3 +48,5 @@ h ## 参照 - [LWG Issue 534. Missing `basic_string` members](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#534) - [P0980R1 Making `std::string` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0980r1.pdf) +- [P3471R4 Standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3471r4.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/string/basic_string/op_at.md b/reference/string/basic_string/op_at.md index b62dfa34b1..8906c48222 100644 --- a/reference/string/basic_string/op_at.md +++ b/reference/string/basic_string/op_at.md @@ -16,7 +16,7 @@ constexpr reference operator[](size_type pos); // (2) C++20 `pos` 番目の要素への参照を取得する。 -## 要件 +## 堅牢化された事前条件 `pos <=` [`size()`](size.md) @@ -63,3 +63,5 @@ e ## 参照 - [P0980R1 Making `std::string` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0980r1.pdf) +- [P3471R4 Standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3471r4.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/string/basic_string/pop_back.md b/reference/string/basic_string/pop_back.md index 6c69afabf6..cd6b1c0022 100644 --- a/reference/string/basic_string/pop_back.md +++ b/reference/string/basic_string/pop_back.md @@ -14,7 +14,7 @@ constexpr void pop_back(); // (1) C++20 末尾の1要素を削除する。 -## 要件 +## 堅牢化された事前条件 `!`[`empty`](empty.md)`()` @@ -62,3 +62,5 @@ hello ## 参照 - [LWG Issue 534. Missing `basic_string` members](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#534) - [P0980R1 Making `std::string` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0980r1.pdf) +- [P3471R4 Standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3471r4.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/string_view/basic_string_view/back.md b/reference/string_view/basic_string_view/back.md index 43c9cb02ca..c80bdab30f 100644 --- a/reference/string_view/basic_string_view/back.md +++ b/reference/string_view/basic_string_view/back.md @@ -13,7 +13,7 @@ constexpr const_reference back() const; 末尾文字を取得する。 -## 要件 +## 堅牢化された事前条件 - `!`[`empty()`](empty.md) @@ -58,3 +58,8 @@ int main() - [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3471R4 Standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3471r4.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/string_view/basic_string_view/front.md b/reference/string_view/basic_string_view/front.md index 08ec24696a..8933dab201 100644 --- a/reference/string_view/basic_string_view/front.md +++ b/reference/string_view/basic_string_view/front.md @@ -13,7 +13,7 @@ constexpr const_reference front() const; 先頭文字を取得する。 -## 要件 +## 堅牢化された事前条件 - `!`[`empty()`](empty.md) @@ -57,3 +57,8 @@ int main() - [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3471R4 Standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3471r4.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/string_view/basic_string_view/op_at.md b/reference/string_view/basic_string_view/op_at.md index 376685c355..a79b2beee7 100644 --- a/reference/string_view/basic_string_view/op_at.md +++ b/reference/string_view/basic_string_view/op_at.md @@ -13,7 +13,7 @@ constexpr const_reference operator[](size_type pos) const; 任意の位置の文字を取得する。 -## 要件 +## 堅牢化された事前条件 - `pos <` [`size()`](size.md) @@ -61,3 +61,8 @@ int main() - [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3471R4 Standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3471r4.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/string_view/basic_string_view/remove_prefix.md b/reference/string_view/basic_string_view/remove_prefix.md index a819f88801..3ea9d8e211 100644 --- a/reference/string_view/basic_string_view/remove_prefix.md +++ b/reference/string_view/basic_string_view/remove_prefix.md @@ -13,7 +13,7 @@ constexpr void remove_prefix(size_type n); 先頭のN文字を削除する。 -## 要件 +## 堅牢化された事前条件 - `n <=` [`size()`](size.md)であること @@ -55,3 +55,8 @@ int main() - [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3471R4 Standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3471r4.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/string_view/basic_string_view/remove_suffix.md b/reference/string_view/basic_string_view/remove_suffix.md index 714cb00bc9..451eb6c5fe 100644 --- a/reference/string_view/basic_string_view/remove_suffix.md +++ b/reference/string_view/basic_string_view/remove_suffix.md @@ -13,7 +13,7 @@ constexpr void remove_suffix(size_type n); 末尾のN文字を削除する。 -## 要件 +## 堅牢化された事前条件 - `n <=` [`size()`](size.md)であること @@ -54,3 +54,8 @@ int main() - [GCC](/implementation.md#gcc): 7.1 [mark verified] - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P3471R4 Standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3471r4.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) diff --git a/reference/vector/vector/pop_back.md b/reference/vector/vector/pop_back.md index 83961e4295..57683dba1a 100644 --- a/reference/vector/vector/pop_back.md +++ b/reference/vector/vector/pop_back.md @@ -13,7 +13,7 @@ constexpr void pop_back(); // (1) C++20 末尾要素を削除する。 -## 要件 +## 堅牢化された事前条件 [`empty()`](empty.md) `== false`であること。 @@ -51,3 +51,5 @@ int main() ## 参照 - [P1004R2 Making `std::vector` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1004r2.pdf) +- [P3471R4 Standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3471r4.html) +- [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) From 6b6628d7d36fc2d94d2e90f59827fbad351a4a45 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 27 Feb 2026 12:03:43 +0900 Subject: [PATCH 2625/3948] =?UTF-8?q?format=20:=20C++26=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=E3=81=A8=E3=81=97=E3=81=A6=E3=80=81=E7=B2=BE=E5=BA=A6=E3=82=84?= =?UTF-8?q?=E5=B9=85=E3=82=92=E6=8C=87=E5=AE=9A=E3=81=97=E3=81=9F=E5=A0=B4?= =?UTF-8?q?=E5=90=88=E3=81=A7=E3=82=82=E3=82=B3=E3=83=B3=E3=83=91=E3=82=A4?= =?UTF-8?q?=E3=83=AB=E6=99=82=E3=81=AE=E5=9E=8B=E3=83=81=E3=82=A7=E3=83=83?= =?UTF-8?q?=E3=82=AF=E3=81=8C=E8=A1=8C=E3=82=8F=E3=82=8C=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E3=81=99=E3=82=8B=E6=8B=A1=E5=BC=B5=E6=A9=9F?= =?UTF-8?q?=E8=83=BD=E3=82=92=E8=BF=BD=E5=8A=A0=20#1193?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../format/basic_format_parse_context.md | 21 +++++- .../check_dynamic_spec.md | 75 +++++++++++++++++++ .../check_dynamic_spec_integral.md | 33 ++++++++ .../check_dynamic_spec_string.md | 34 +++++++++ 4 files changed, 161 insertions(+), 2 deletions(-) create mode 100644 reference/format/basic_format_parse_context/check_dynamic_spec.md create mode 100644 reference/format/basic_format_parse_context/check_dynamic_spec_integral.md create mode 100644 reference/format/basic_format_parse_context/check_dynamic_spec_string.md diff --git a/reference/format/basic_format_parse_context.md b/reference/format/basic_format_parse_context.md index c0012399d9..73a717a3f3 100644 --- a/reference/format/basic_format_parse_context.md +++ b/reference/format/basic_format_parse_context.md @@ -34,6 +34,9 @@ namespace std { | [`advance_to`](basic_format_parse_context/advance_to.md) | 指定したイテレータを先頭イテレータとして設定する | C++20 | | `next_arg_id` | フォーマット引数の番号を次に進める | C++20 | | `check_arg_id` | フォーマット引数の番号指定が有効か確かめる | C++20 | +| [`check_dynamic_spec`](basic_format_parse_context/check_dynamic_spec.md) | 動的な幅・精度の引数の型を検証する | C++26 | +| [`check_dynamic_spec_integral`](basic_format_parse_context/check_dynamic_spec_integral.md) | 動的な幅・精度の引数の型が整数型か検証する | C++26 | +| [`check_dynamic_spec_string`](basic_format_parse_context/check_dynamic_spec_string.md) | 動的な幅・精度の引数の型が文字列型か検証する | C++26 | ## メンバ型 @@ -62,10 +65,10 @@ namespace std { size_t num_args_; public: - explicit constexpr basic_format_parse_context(basic_string_view fmt, size_t num_args = 0) noexcept + explicit constexpr basic_format_parse_context(basic_string_view fmt) noexcept :begin_(fmt.begin()) ,end_(fmt.end()) - ,num_args_(num_args) + ,num_args_(0) {} basic_format_parse_context(const basic_format_parse_context&) = delete; @@ -108,6 +111,19 @@ namespace std { throw format_error("mixing of automatic and manual argument indexing"); } } + + template + constexpr void check_dynamic_spec(size_t id) noexcept; + + constexpr void check_dynamic_spec_integral(size_t id) noexcept + { + check_dynamic_spec(id); + } + + constexpr void check_dynamic_spec_string(size_t id) noexcept + { + check_dynamic_spec>(id); + } }; } ``` @@ -126,3 +142,4 @@ namespace std { ## 参照 * [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) +* [P2757R3 Type-checking format args](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2757r3.html) diff --git a/reference/format/basic_format_parse_context/check_dynamic_spec.md b/reference/format/basic_format_parse_context/check_dynamic_spec.md new file mode 100644 index 0000000000..2226e5cd85 --- /dev/null +++ b/reference/format/basic_format_parse_context/check_dynamic_spec.md @@ -0,0 +1,75 @@ +# check_dynamic_spec +* format[meta header] +* function template[meta id-type] +* std[meta namespace] +* basic_format_parse_context[meta class] +* cpp26[meta cpp] + +```cpp +template +constexpr void check_dynamic_spec(size_t id) noexcept; +``` + +## 概要 +動的な幅・精度の引数の型がコンパイル時に正しいか検証する。 + +この関数はコンパイル時の定数式としてのみ意味のある検証を行う。`id`に対応するフォーマット引数の型が`Ts...`のいずれかでなければ、呼び出しがコア定数式ではなくなり、コンパイルエラーとなる。 + +## 適格要件 +- `Ts...`の型は一意であること +- `Ts...`の各型は、`bool`, `char_type`, `int`, `unsigned int`, `long long int`, `unsigned long long int`, `float`, `double`, `long double`, `const char_type*`, [`basic_string_view`](/reference/string_view/basic_string_view.md)``, `const void*` のいずれかであること + +## 備考 +`id >= num_args_`である場合、または`id`に対応するフォーマット引数の型が`Ts...`のいずれでもない場合、呼び出しはコア定数式ではない。 + +## 例 +### 動的な幅指定の正しい使用 +```cpp example +#include +#include + +int main() +{ + // OK: 動的な幅に整数を指定 + std::cout << std::format("{:>{}}", "hello", 10) << std::endl; + + // OK: 引数番号を明示的に指定して動的な幅を使用 + std::cout << std::format("{0:>{1}}", "hello", 10) << std::endl; +} +``` + +#### 出力 +``` + hello + hello +``` + +### C++26でコンパイルエラーになる例 (C++23では実行時エラー) +```cpp +#include +#include + +int main() +{ + // C++23: 実行時エラー + // C++26: コンパイルエラー + // 動的な幅に文字列を渡しているが、整数型が必要 + std::string s = std::format("{:>{}}", "hello", "10"); +} +``` + +C++23まではフォーマット引数の型チェックが実行時に行われるため、動的な幅に`"10"`(文字列)を指定した場合は実行時に[`format_error`](/reference/format/format_error.md)例外が送出されていた。 + +C++26では、[`formatter`](/reference/format/formatter.md)の[`parse()`](/reference/format/formatter/parse.md)内で`check_dynamic_spec_integral()`が呼ばれることにより、コンパイル時に型の不一致が検出されるようになった。 + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P2757R3 Type-checking format args](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2757r3.html) diff --git a/reference/format/basic_format_parse_context/check_dynamic_spec_integral.md b/reference/format/basic_format_parse_context/check_dynamic_spec_integral.md new file mode 100644 index 0000000000..6deb789ea5 --- /dev/null +++ b/reference/format/basic_format_parse_context/check_dynamic_spec_integral.md @@ -0,0 +1,33 @@ +# check_dynamic_spec_integral +* format[meta header] +* function[meta id-type] +* std[meta namespace] +* basic_format_parse_context[meta class] +* cpp26[meta cpp] + +```cpp +constexpr void check_dynamic_spec_integral(size_t id) noexcept; +``` + +## 概要 +動的な幅・精度の引数の型が整数型かコンパイル時に検証する。 + +## 効果 +以下と等価: + +```cpp +check_dynamic_spec(id); +``` +* check_dynamic_spec[link check_dynamic_spec.md] + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P2757R3 Type-checking format args](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2757r3.html) diff --git a/reference/format/basic_format_parse_context/check_dynamic_spec_string.md b/reference/format/basic_format_parse_context/check_dynamic_spec_string.md new file mode 100644 index 0000000000..fe4129335a --- /dev/null +++ b/reference/format/basic_format_parse_context/check_dynamic_spec_string.md @@ -0,0 +1,34 @@ +# check_dynamic_spec_string +* format[meta header] +* function[meta id-type] +* std[meta namespace] +* basic_format_parse_context[meta class] +* cpp26[meta cpp] + +```cpp +constexpr void check_dynamic_spec_string(size_t id) noexcept; +``` + +## 概要 +動的な幅・精度の引数の型が文字列型かコンパイル時に検証する。 + +## 効果 +以下と等価: + +```cpp +check_dynamic_spec>(id); +``` +* check_dynamic_spec[link check_dynamic_spec.md] +* basic_string_view[link /reference/string_view/basic_string_view.md] + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 参照 +- [P2757R3 Type-checking format args](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2757r3.html) From 0f8a83b77cfa4921d386f19f6ac07da65f415857 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 27 Feb 2026 12:59:29 +0900 Subject: [PATCH 2626/3948] =?UTF-8?q?C++26=20=E3=82=A8=E3=83=A9=E3=83=BC?= =?UTF-8?q?=E6=80=A7=E5=8B=95=E4=BD=9C=20:=20=E7=B5=82=E4=BA=86=E3=82=BF?= =?UTF-8?q?=E3=82=A4=E3=83=9F=E3=83=B3=E3=82=B0=E3=81=AE=E8=A6=8F=E5=AE=9A?= =?UTF-8?q?=E3=81=AB=E5=AF=BE=E5=BF=9C=20#1557?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rroneous_behavior_for_uninitialized_reads.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md index 777703aa8e..0f97c58731 100644 --- a/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md +++ b/lang/cpp26/erroneous_behavior_for_uninitialized_reads.md @@ -24,7 +24,7 @@ int main() { 未初期化の値は、コンパイラやターゲット環境によって定義された固定値である。コンパイラにはこの誤りを診断することが許可され、推奨されているが、誤りを無視して有効な読み取りとして扱うことも許可されている。このコードは誤りではあるが、実行ごとに異なる動作をしたり攻撃者に値を制御されたりといったリスクはなくなる。 -エラー性動作は未定義動作(一切の保証が失われる)とはちがって、動作を定めたうえで診断も可能とするものである。 +エラー性動作は未定義動作(一切の保証が失われる)とはちがって、動作を定めたうえで診断も可能とするものである。エラー性動作が起きた場合、処理系はその操作の実行時点で診断を発行すること、およびプログラムの実行を終了させることが許可されるが、必須ではない。 C++26では、不定値で初期化されることを明確に指示する`[[indeterminate]]`属性も導入され、以下のような動作となる: @@ -49,7 +49,8 @@ int main() { - 式が評価された結果としてエラー性の値が生成された場合、エラー性動作を引き起こす - ただし、`unsigned char`(およびunsignedとなる場合は`char`)もしくは[`std::byte`](/reference/cstddef/byte.md)型のエラー性の値がこれらの型のオブジェクトの初期化・代入に使用される場合や値が破棄される場合はエラー性動作にならない - これらのルールは、式が評価された結果として不定値が生成された場合に未定義の動作を引き起こすとする従来のルールと同様である -- エラー性動作を引き起こしたうえで生成された値は、後続の処理ではエラー性の値とはみなされない +- prvalueを生成する組み込み演算子のオペランドが評価された結果としてエラー性の値を生成し、かつ破棄される値の式でない場合、その演算子が生成する値もエラー性の値となる +- エラー性動作を引き起こしたうえで生成された値もエラー性の値となる (エラー性の値は演算を通じて伝播する) ```cpp example #include @@ -61,20 +62,19 @@ int g(bool b) { assert(c == d); // 常に真、エラー性動作 (整数昇格) - int e = d; // エラー性動作 (型変換) + int e = d; // エラー性動作 (型変換)。eはエラー性の値をもつ return b ? d : 0; // bがtrueの場合にエラー性動作 } int main() { int d1, d2; - int e1 = d1; // エラー性動作 - int e2 = d1; // エラー性動作 + int e1 = d1; // エラー性動作。e1はエラー性の値をもつ + int e2 = d1; // エラー性動作。e2はエラー性の値をもつ // 処理が続行した場合… - assert(e1 == e2); // 常に真、エラー性動作ではない。 - // エラー性動作の結果で生成された値 (e1とe2) は、 - // エラー性の値とはみなされない + assert(e1 == e2); // 常に真、エラー性動作 + // (e1とe2はエラー性の値をもつ) assert(e1 == d1); // 常に真、エラー性動作 assert(e2 == d1); // 常に真、エラー性動作 @@ -143,3 +143,4 @@ int main() { ## 参照 - [P2795R5 Erroneous behaviour for uninitialized reads](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2795r5.html) +- [P3684R1 Fix erroneous behaviour termination semantics for C++26](https://isocpp.org/files/papers/P3684R1.pdf) From cc5dbfd9f81c52e64808d3ba72db2d535d0340af Mon Sep 17 00:00:00 2001 From: suomesta Date: Mon, 2 Mar 2026 21:08:56 +0900 Subject: [PATCH 2627/3948] fix comments in sample --- lang/cpp20/va_opt.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/cpp20/va_opt.md b/lang/cpp20/va_opt.md index ef1fc49271..3df7d22672 100644 --- a/lang/cpp20/va_opt.md +++ b/lang/cpp20/va_opt.md @@ -41,8 +41,8 @@ SDEF(bar, 1, 2, 3); // S bar = {1, 2, 3}; に展開される int main() { - DEBUG_LOG("hello"); // printf("[debug] hello\n"); に展開される - DEBUG_LOG("value:%d", 3); // printf("[debug] value:%d\n", 3); に展開される + DEBUG_LOG("hello"); // std::printf("[debug] hello\n"); に展開される + DEBUG_LOG("value:%d", 3); // std::printf("[debug] value:%d\n", 3); に展開される } ``` From 5bc091a499b48a71c6d0674e992bba204ba96cbc Mon Sep 17 00:00:00 2001 From: suomesta Date: Mon, 2 Mar 2026 21:13:26 +0900 Subject: [PATCH 2628/3948] fix status after moved in std::stop_token and std::stop_source --- reference/stop_token/stop_source/op_assign.md | 2 +- reference/stop_token/stop_token/op_assign.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/stop_token/stop_source/op_assign.md b/reference/stop_token/stop_source/op_assign.md index f2a3e8b4cb..10da575250 100644 --- a/reference/stop_token/stop_source/op_assign.md +++ b/reference/stop_token/stop_source/op_assign.md @@ -17,7 +17,7 @@ stop_source& operator=(stop_source&& r) noexcept; // (2) ## 効果 - (1) : [`stop_source`](op_constructor.md)`(r).`[`swap`](swap.md)`(*this)`。これによって `*this` `==` `r` となる。 -- (2) : [`stop_source`](op_constructor.md)`(std::`[`move`](/reference/utility/move.md)`(r)).`[`swap`](swap.md)`(*this)`。これによって、`r.`[`stop_possible()`](stop_possible.md) `==` `true` となる。 +- (2) : [`stop_source`](op_constructor.md)`(std::`[`move`](/reference/utility/move.md)`(r)).`[`swap`](swap.md)`(*this)`。これによって、`r.`[`stop_possible()`](stop_possible.md) `==` `false` となる。 ## 戻り値 `*this` diff --git a/reference/stop_token/stop_token/op_assign.md b/reference/stop_token/stop_token/op_assign.md index e21059e3da..854261b078 100644 --- a/reference/stop_token/stop_token/op_assign.md +++ b/reference/stop_token/stop_token/op_assign.md @@ -17,7 +17,7 @@ stop_token& operator=(stop_token&& r) noexcept; // (2) ## 効果 - (1) : [`stop_token`](op_constructor.md)`(r).`[`swap`](swap.md)`(*this)`。これによって `*this` `==` `r` となる。 -- (2) : [`stop_token`](op_constructor.md)`(std::`[`move`](/reference/utility/move.md)`(r)).`[`swap`](swap.md)`(*this)`。これによって、`r.`[`stop_possible()`](stop_possible.md) `==` `true` となる。 +- (2) : [`stop_token`](op_constructor.md)`(std::`[`move`](/reference/utility/move.md)`(r)).`[`swap`](swap.md)`(*this)`。これによって、`r.`[`stop_possible()`](stop_possible.md) `==` `false` となる。 ## 戻り値 `*this` From 34807ad138ee7205356b55eaa8d5bebde5ca9d11 Mon Sep 17 00:00:00 2001 From: suomesta Date: Mon, 2 Mar 2026 21:14:38 +0900 Subject: [PATCH 2629/3948] fix typo in std::stop_source constructor --- reference/stop_token/stop_source/op_constructor.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/stop_token/stop_source/op_constructor.md b/reference/stop_token/stop_source/op_constructor.md index 4ec0e0a4ab..15b6be35f9 100644 --- a/reference/stop_token/stop_source/op_constructor.md +++ b/reference/stop_token/stop_source/op_constructor.md @@ -22,7 +22,7 @@ stop_source(stop_source&& rhs) noexcept; // (4) ## 事後条件 - (1) : [`stop_possible()`](stop_possible.md) `==` `true` かつ[`stop_requested()`](stop_requested.md) `==` `false`。 - (2) : [`stop_possible()`](stop_possible.md) `==` `false` かつ[`stop_requested()`](stop_requested.md) `==` `false`。 -- (2) : `*this` `==` `rhs`。(`rhs`が停止状態を所有していれば、`*this`と`rhs`は同じ停止状態を共有するようになる) +- (3) : `*this` `==` `rhs`。(`rhs`が停止状態を所有していれば、`*this`と`rhs`は同じ停止状態を共有するようになる) - (4) : もし`rhs`が停止状態を所有していればその所有権が`*this`へ移動し、`rhs.`[`stop_possible()`](stop_possible.md) `==` `false`となる。 ## 例外 From c24db09111b5f3b7ee49085818e5f35ad30be485 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 5 Mar 2026 16:41:09 +0900 Subject: [PATCH 2630/3948] =?UTF-8?q?=E3=82=B9=E3=83=9D=E3=83=B3=E3=82=B5?= =?UTF-8?q?=E3=83=BC=E6=9B=B4=E6=96=B0=20#1588?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.md b/index.md index dd61e1b09d..a9991e97fc 100644 --- a/index.md +++ b/index.md @@ -137,6 +137,8 @@ cpprefjpプロジェクトは、以下の方々にスポンサーになってい [sponsor name:nodchip様, link:https://twitter.com/nodchip, note:Hisayori Noda, fee:50, amount:1, period:2024-11-07] +[sponsor name:tomoteru様, fee:20, amount:11, period:2027-03-06] + [sponsor name:Hashitaku様, link:https://opencollective.com/hashitaku, fee:20, amount:1, period:2024-05-08] [sponsor name:Akira Kubo様, img:https://raw.githubusercontent.com/cpprefjp/image/master/sponsors/HappyLuckyAkira/HappyLuckyAkira.jpg, link:https://x.com/HappyLuckyAkira, size:256, fee:20, amount:1, period:2025-10-12] From 567d3cc5679972745e13c65042d4be3a10fe4959 Mon Sep 17 00:00:00 2001 From: teruyamato0731 <77840326+teruyamato0731@users.noreply.github.com> Date: Fri, 6 Mar 2026 09:01:03 +0900 Subject: [PATCH 2631/3948] =?UTF-8?q?fix:=20=E3=83=AC=E3=82=A4=E3=82=A2?= =?UTF-8?q?=E3=82=A6=E3=83=88=E4=BA=92=E6=8F=9B=E3=81=AB=E9=96=A2=E3=81=99?= =?UTF-8?q?=E3=82=8B=E6=A9=9F=E8=83=BD=E3=83=86=E3=82=B9=E3=83=88=E3=83=9E?= =?UTF-8?q?=E3=82=AF=E3=83=AD=E3=82=92=E4=BF=AE=E6=AD=A3=20(#1589)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp20/feature_test_macros.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/cpp20/feature_test_macros.md b/lang/cpp20/feature_test_macros.md index c88ed5a9a7..76354ecd1c 100644 --- a/lang/cpp20/feature_test_macros.md +++ b/lang/cpp20/feature_test_macros.md @@ -81,9 +81,9 @@ |`__cpp_lib_integer_comparison_functions`|`202002L`|[`std::cmp_equal()`](/reference/utility/cmp_equal.md)等の整数比較関数と[`std::in_range()`](/reference/utility/in_range.md)|[``](/reference/utility.md)| |`__cpp_lib_interpolate`|`201902L`|[`std::lerp()`](/reference/cmath/lerp.md)と[`std::midpoint()`](/reference/numeric/midpoint.md)|[``](/reference/cmath.md)
[``](/reference/numeric.md)| |`__cpp_lib_is_constant_evaluated`|`201811L`|[`std::is_constant_evaluated()`](/reference/type_traits/is_constant_evaluated.md)|[``](/reference/type_traits.md)| -|`__cpp_lib_is_layout_compatible`|`201907L`|[`std::is_layout_compatible`](/reference/type_traits/is_layout_compatible.md)と[`is_corresponding_member`](/reference/type_traits/is_corresponding_member.md)|[``](/reference/type_traits.md)| +|`__cpp_lib_is_layout_compatible`|`201907L`|[`std::is_layout_compatible`](/reference/type_traits/is_layout_compatible.md)と[`std::is_corresponding_member`](/reference/type_traits/is_corresponding_member.md)|[``](/reference/type_traits.md)| |`__cpp_lib_is_nothrow_convertible`|`201806L`|[`std::is_nothrow_convertible`](/reference/type_traits/is_nothrow_convertible.md)|[``](/reference/type_traits.md)| -|`__cpp_lib_is_pointer_interconvertible`|`201907L`|[`std::is_corresponding_member`](/reference/type_traits/is_corresponding_member.md)と[`std::is_pointer_interconvertible_base_of`](/reference/type_traits/is_pointer_interconvertible_base_of.md)|[``](/reference/type_traits.md)| +|`__cpp_lib_is_pointer_interconvertible`|`201907L`|[`std::is_pointer_interconvertible_base_of`](/reference/type_traits/is_pointer_interconvertible_base_of.md)と[`std::is_pointer_interconvertible_with_class`](/reference/type_traits/is_pointer_interconvertible_with_class.md)|[``](/reference/type_traits.md)| |`__cpp_lib_jthread`|`201911L`|[`std::jthread`](/reference/thread/jthread.md)と`stop_token`による協調的キャンセル機構|[``](/reference/stop_token.md)
[``](/reference/thread.md)| |`__cpp_lib_latch`|`201907L`|[`std::latch`](/reference/latch/latch.md)|[``](/reference/latch.md)| |`__cpp_lib_list_remove_return_type`|`201806L`|[`std::list`](/reference/list/list.md)と[`std::forward_list`](/reference/forward_list/forward_list.md)の`remove(), remove_if(), unique()`の戻り値型変更|[``](/reference/forward_list.md)
[``](/reference/list.md)| From f3a41a5cc843870eefb09204b853b21c8a2f86b6 Mon Sep 17 00:00:00 2001 From: K10-K10 Date: Sun, 15 Feb 2026 00:39:52 +0900 Subject: [PATCH 2632/3948] add new pages `sig_dfl`,`sig_err`,`sig_ign` --- reference/csignal.md | 6 ++-- reference/csignal/sig_dfl.md | 56 ++++++++++++++++++++++++++++++++++++ reference/csignal/sig_err.md | 51 ++++++++++++++++++++++++++++++++ reference/csignal/sig_ign.md | 43 +++++++++++++++++++++++++++ 4 files changed, 153 insertions(+), 3 deletions(-) create mode 100644 reference/csignal/sig_dfl.md create mode 100644 reference/csignal/sig_err.md create mode 100644 reference/csignal/sig_ign.md diff --git a/reference/csignal.md b/reference/csignal.md index e62085edb9..da961487ef 100644 --- a/reference/csignal.md +++ b/reference/csignal.md @@ -16,9 +16,9 @@ | 名前 | 説明 | 対応バージョン | |------|------|----------------| -| `SIG_DFL` | デフォルト動作を指定する | | | -| `SIG_ERR` | `signal`関数が失敗したことを示す戻り値 | | -| `SIG_IGN` | シグナルを無視する | | +| [`SIG_DFL`](csignal/sig_dfl.md) | デフォルト動作を指定する | | +| [`SIG_ERR`](csignal/sig_err.md) | `signal`関数が失敗したことを示す戻り値 | | +| [`SIG_IGN`](csignal/sig_ign.md) | シグナルを無視する | | ### シグナル番号を表すマクロ diff --git a/reference/csignal/sig_dfl.md b/reference/csignal/sig_dfl.md new file mode 100644 index 0000000000..dce1c15dfe --- /dev/null +++ b/reference/csignal/sig_dfl.md @@ -0,0 +1,56 @@ +# SIG_DFL +* csignal[meta header] +* macro[meta id-type] + +```cpp +#define SIG_DFL see below +``` + +## 概要 +`signal`関数に渡される引数として、シグナルハンドラをデフォルトに設定するマクロ。 + +シグナル受信時に`signal`関数で`SIG_DFL`が指定されている場合、そのシグナルに対する実装定義のデフォルト処理が実行される。 + +## 例 +```cpp example +#include +#include +#include +#include + +volatile std::sig_atomic_t flag = 0; + +void handler(int) +{ + flag = 1; +} + +int main() +{ + std::signal(SIGINT, handler); + + std::cout << "Press Ctrl+C (handled)" << std::endl; + while (!flag) { + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + } + + // デフォルトに戻す + std::signal(SIGINT, SIG_DFL); + std::cout << "Press Ctrl+C again (default action)" << std::endl; + for (;;) { + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + } +} +``` +* SIG_DFL[color ff0000] +* std::signal[link /reference/csignal/signal.md] + +### 出力 + +``` +Press Ctrl+C (handled) +Press Ctrl+C again (default action) +``` + +## 関連項目 +- [`signal`](/reference/csignal/signal.md) diff --git a/reference/csignal/sig_err.md b/reference/csignal/sig_err.md new file mode 100644 index 0000000000..49f17b00c7 --- /dev/null +++ b/reference/csignal/sig_err.md @@ -0,0 +1,51 @@ +# SIG_ERR +* csignal[meta header] +* macro[meta id-type] + +```cpp +#define SIG_ERR see below +``` + +## 概要 +`signal`関数の戻り値で、シグナルハンドラの設定に失敗したことを示す値。 + +`signal`関数が失敗した場合、この値が返される。 + +## 例 +```cpp example +#include +#include +#include +#include + +volatile std::sig_atomic_t flag = 0; + +void signal_handler(int sig) +{ + flag = 1; +} + +int main() +{ + if (std::signal(SIGINT, signal_handler) == SIG_ERR) { + std::cerr << "Failed to set signal handler" << std::endl; + return 1; + } + std::cout << "Signal handler set successfully" << std::endl; + while (!flag) { + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + } + return 0; +} +``` +* SIG_ERR[color ff0000] +* std::signal[link /reference/csignal/signal.md] + +### 出力例 + +``` +Signal handler set successfully +``` + +## 関連項目 +- [`signal`](/reference/csignal/signal.md) diff --git a/reference/csignal/sig_ign.md b/reference/csignal/sig_ign.md new file mode 100644 index 0000000000..9d2d5e112c --- /dev/null +++ b/reference/csignal/sig_ign.md @@ -0,0 +1,43 @@ +# SIG_IGN +* csignal[meta header] +* macro[meta id-type] + +```cpp +#define SIG_IGN see below +``` + +## 概要 +`signal`関数に渡される引数として、指定されたシグナルを無視させるマクロ。 + +シグナル受信時に`signal`関数で`SIG_IGN`が指定されている場合、そのシグナルは無視される。 + +## 例 +```cpp example +#include +#include +#include +#include + +int main() +{ + std::signal(SIGINT, SIG_IGN); + // Ctrl+Cを押してもプログラムは続行する + for (int i = 0; i < 10; ++i) { + std::cout << i << " " << std::flush; + std::this_thread::sleep_for(std::chrono::milliseconds(500)); + } + std::cout << std::endl; + return 0; +} +``` +* SIG_IGN[color ff0000] +* std::signal[link /reference/csignal/signal.md] + +### 出力 + +``` +0 1 2 3 4 5 6 7 8 9 +``` + +## 関連項目 +- [`signal`](/reference/csignal/signal.md) From c22c39fe3073c46b31426ec4541a341044a575c3 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 9 Mar 2026 11:24:36 +0900 Subject: [PATCH 2633/3948] =?UTF-8?q?random:=20Code=20Project=E3=81=AE?= =?UTF-8?q?=E8=A8=98=E4=BA=8B=E3=81=8C=E3=83=AA=E3=83=B3=E3=82=AF=E5=88=87?= =?UTF-8?q?=E3=82=8C=E3=81=97=E3=81=A6=E3=81=84=E3=81=9F=E3=81=8C=E5=9F=BA?= =?UTF-8?q?=E6=9C=AC=E7=9A=84=E3=81=AA=E4=BD=BF=E3=81=84=E6=96=B9=E3=81=AE?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E3=81=A0=E3=81=A3=E3=81=9F=E3=81=AE=E3=81=A7?= =?UTF-8?q?=E8=A8=80=E5=8F=8A=E3=82=92=E5=89=8A=E9=99=A4=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=81=93=E3=81=A8=E3=81=AB=E3=81=97=E3=81=9F=20#1590?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/random.md | 1 - 1 file changed, 1 deletion(-) diff --git a/reference/random.md b/reference/random.md index f09f5dc71d..9e2aab5445 100644 --- a/reference/random.md +++ b/reference/random.md @@ -246,7 +246,6 @@ int main() ### 乱数ライブラリの使い方 * [N3551 Random Number Generation in C++11](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3551.pdf) -* [Pitfalls in Random Number Generation](https://www.codeproject.com/articles/28548/pitfalls-in-random-number-generation) ### 乱数ライブラリが導入された経緯 * [N0352 Proposal for Standardization of Random Number Generators in C++](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/1993/N0352.asc) From 971dd4b9f6412a01304d2bd69523f86c8a0dc767 Mon Sep 17 00:00:00 2001 From: Ryoga-exe Date: Mon, 9 Mar 2026 19:10:28 +0900 Subject: [PATCH 2634/3948] fix typo in reference/execution/execution/{spawn.md,spawn_future.md} MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit そうでなはく -> そうではなく --- reference/execution/execution/spawn.md | 2 +- reference/execution/execution/spawn_future.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/execution/execution/spawn.md b/reference/execution/execution/spawn.md index 4e9ab7ce8c..25bbfe1187 100644 --- a/reference/execution/execution/spawn.md +++ b/reference/execution/execution/spawn.md @@ -28,7 +28,7 @@ namespace std::execution { そうでなければ、呼び出し式`spawn(sndr, token, env)`に対して、説明用の式`new_sender`を[`token.wrap`](scope_token.md)`(sndr)`とし、`alloc`と`senv`を次の通りとする。 - 式[`get_allocator`](../get_allocator.md)`(env)`が適格なとき、`alloc`を[`get_allocator`](../get_allocator.md)`(env)`の結果、`senv`を式`env`とする。 -- そうでなはく、式[`get_allocator`](../get_allocator.md)`(`[`get_env`](get_env.md)`(new_sender))`が適格なとき、`alloc`を[`get_allocator`](../get_allocator.md)`(`[`get_env`](get_env.md)`(new_sender))`の結果、`senv`を式[`JOIN-ENV`](../queryable.md)`(`[`prop`](prop.md)`(`[`get_allocator`](../get_allocator.md)`, alloc), env)`とする。 +- そうではなく、式[`get_allocator`](../get_allocator.md)`(`[`get_env`](get_env.md)`(new_sender))`が適格なとき、`alloc`を[`get_allocator`](../get_allocator.md)`(`[`get_env`](get_env.md)`(new_sender))`の結果、`senv`を式[`JOIN-ENV`](../queryable.md)`(`[`prop`](prop.md)`(`[`get_allocator`](../get_allocator.md)`, alloc), env)`とする。 - そうではないとき、`alloc`を[`allocator`](/reference/memory/allocator.md)`()`、`senv`を式`env`とする。 呼び出し式`spawn(sndr, token, env)`は`void`型であり、次の効果をもつ。 diff --git a/reference/execution/execution/spawn_future.md b/reference/execution/execution/spawn_future.md index df9ec183dd..f462903ff3 100644 --- a/reference/execution/execution/spawn_future.md +++ b/reference/execution/execution/spawn_future.md @@ -30,7 +30,7 @@ namespace std::execution { そうでなければ、呼び出し式`spawn_future(sndr, token, env)`に対して、説明用の式`new_sender`を[`token.wrap`](scope_token.md)`(sndr)`とし、`alloc`と`senv`を次の通りとする。 - 式[`get_allocator`](../get_allocator.md)`(env)`が適格なとき、`alloc`を[`get_allocator`](../get_allocator.md)`(env)`の結果、`senv`を式`env`とする。 -- そうでなはく、式[`get_allocator`](../get_allocator.md)`(`[`get_env`](get_env.md)`(new_sender))`が適格なとき、`alloc`を[`get_allocator`](../get_allocator.md)`(`[`get_env`](get_env.md)`(new_sender))`の結果、`senv`を式[`JOIN-ENV`](../queryable.md)`(`[`prop`](prop.md)`(`[`get_allocator`](../get_allocator.md)`, alloc), env)`とする。 +- そうではなく、式[`get_allocator`](../get_allocator.md)`(`[`get_env`](get_env.md)`(new_sender))`が適格なとき、`alloc`を[`get_allocator`](../get_allocator.md)`(`[`get_env`](get_env.md)`(new_sender))`の結果、`senv`を式[`JOIN-ENV`](../queryable.md)`(`[`prop`](prop.md)`(`[`get_allocator`](../get_allocator.md)`, alloc), env)`とする。 - そうではないとき、`alloc`を[`allocator`](/reference/memory/allocator.md)`()`、`senv`を式`env`とする。 呼び出し式`spawn_future(sndr, token, env)`は、次の効果をもつ。 From 9f82d6e43adb2d4da5956d9b6bcbcec9de2aa7de Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 11 Mar 2026 13:40:57 +0900 Subject: [PATCH 2635/3948] =?UTF-8?q?C++26=E5=AF=BE=E5=BF=9C=E3=81=A8?= =?UTF-8?q?=E3=81=97=E3=81=A6string=E3=81=A8string=5Fview=E3=82=92?= =?UTF-8?q?=E9=80=A3=E7=B5=90=E3=81=99=E3=82=8B=E6=BC=94=E7=AE=97=E5=AD=90?= =?UTF-8?q?=E3=82=AA=E3=83=BC=E3=83=90=E3=83=BC=E3=83=AD=E3=83=BC=E3=83=89?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20#1338?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/string/basic_string/op_plus.md | 89 +++++++++++++++++- reference/string_view/basic_string_view.md | 6 ++ .../string_view/basic_string_view/op_plus.md | 94 +++++++++++++++++++ 3 files changed, 188 insertions(+), 1 deletion(-) create mode 100644 reference/string_view/basic_string_view/op_plus.md diff --git a/reference/string/basic_string/op_plus.md b/reference/string/basic_string/op_plus.md index 6b181c21b7..f1bc288eaa 100644 --- a/reference/string/basic_string/op_plus.md +++ b/reference/string/basic_string/op_plus.md @@ -113,12 +113,40 @@ namespace std { constexpr basic_string operator+(basic_string&& lhs, charT rhs); // (12) C++20 + + template + constexpr basic_string + operator+(const basic_string& lhs, + type_identity_t> rhs); // (13) C++26 + + template + constexpr basic_string + operator+(basic_string&& lhs, + type_identity_t> rhs); // (14) C++26 } ``` +* type_identity_t[link /reference/type_traits/type_identity.md] +* basic_string_view[link /reference/string_view/basic_string_view.md] + ## 概要 `basic_string` オブジェクトの連結を行う。 +- (1) : `basic_string`オブジェクト同士を連結する +- (2) : 右辺値の`basic_string`オブジェクトと`basic_string`オブジェクトを連結する +- (3) : `basic_string`オブジェクトと右辺値の`basic_string`オブジェクトを連結する +- (4) : 右辺値の`basic_string`オブジェクト同士を連結する +- (5) : 文字配列と`basic_string`オブジェクトを連結する +- (6) : 文字配列と右辺値の`basic_string`オブジェクトを連結する +- (7) : 文字と`basic_string`オブジェクトを連結する +- (8) : 文字と右辺値の`basic_string`オブジェクトを連結する +- (9) : `basic_string`オブジェクトと文字配列を連結する +- (10) : 右辺値の`basic_string`オブジェクトと文字配列を連結する +- (11) : `basic_string`オブジェクトと文字を連結する +- (12) : 右辺値の`basic_string`オブジェクトと文字を連結する +- (13) : `basic_string`オブジェクトと[`basic_string_view`](/reference/string_view/basic_string_view.md)オブジェクトを連結する +- (14) : 右辺値の`basic_string`オブジェクトと[`basic_string_view`](/reference/string_view/basic_string_view.md)オブジェクトを連結する + ## 戻り値 @@ -220,6 +248,21 @@ namespace std { ``` * push_back[link push_back.md] +- (13) : 以下と等価 + ```cpp + basic_string r = lhs; + r.append(rhs); + return r; + ``` + * append[link append.md] + +- (14) : 以下と等価 + ```cpp + lhs.append(rhs); + return std::move(lhs); + ``` + * append[link append.md] + ## 備考 (5), (6) の形式の `lhs`、および、(9), (10) の形式の `rhs` の文字列長算出のために `traits::length()` が使用される @@ -242,11 +285,14 @@ C++20からこの演算子による文字列連結時にアロケータがどの |(10) : `std::move(lhs) + "rhs"`|`lhs`|`lhs`|`lhs`|`lhs`|`lhs`| |(11) : `lhs + 'r'`|新規にデフォルト構築|`lhs`からのSOCCC|`lhs`|新規にデフォルト構築|`lhs`からのSOCCC| |(12) : `std::move(lhs) + 'r'`|`lhs`|`lhs`|`lhs`|`lhs`|`lhs`| +|(13) : `lhs + sv`| | | | |`lhs`からのSOCCC| +|(14) : `std::move(lhs) + sv`| | | | |`lhs`| 表にあるように、C++17までの仕様に完全に準拠している実装は無かった上に各実装によって伝播仕様がバラバラだったため、この変更によって影響を受けるコードはほぼ無いと思われる。 ## 例 +### 基本的な使い方 ```cpp example #include #include @@ -263,11 +309,39 @@ int main() ``` * +[color ff0000] -### 出力 +#### 出力 ``` Hello, world! ``` +### string_viewとの連結 (C++26) +```cpp example +#include +#include +#include + +int main() +{ + std::string s = "Hello"; + std::string_view sv = ", World!"; + + // string + string_view (13) + std::string result1 = s + sv; + std::cout << result1 << '\n'; + + // string&& + string_view (14) + std::string result2 = std::string("Hello") + sv; + std::cout << result2 << '\n'; +} +``` +* +[color ff0000] + +#### 出力 +``` +Hello, World! +Hello, World! +``` + ## 関連項目 | 名前 | 説明 | @@ -276,6 +350,19 @@ Hello, world! | [`push_back`](push_back.md) | 文字を追加する | | [`insert`](insert.md) | 文字/文字列を挿入する | +## バージョン +### 言語 +- C++03 +- C++26 : (13), (14) + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + ## 参照 - [P1165R1 Make stateful allocator propagation more consistent for operator+(basic_string)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1165r1.html) - [P0980R1 Making `std::string` constexpr](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0980r1.pdf) +- [P2591R5 Concatenation of strings and string views](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2591r5.html) + - C++26で`string_view`との連結が追加された diff --git a/reference/string_view/basic_string_view.md b/reference/string_view/basic_string_view.md index 4774acf500..c42dd9849b 100644 --- a/reference/string_view/basic_string_view.md +++ b/reference/string_view/basic_string_view.md @@ -140,6 +140,12 @@ string_view hello = sv.substr(0, 5); // 先頭5文字を抽出する ## 非メンバ関数 +### 文字列連結 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`operator+`](basic_string_view/op_plus.md) | 文字列の連結 | C++26 | + ### 比較演算 | 名前 | 説明 | 対応バージョン | diff --git a/reference/string_view/basic_string_view/op_plus.md b/reference/string_view/basic_string_view/op_plus.md new file mode 100644 index 0000000000..02ea6db4e8 --- /dev/null +++ b/reference/string_view/basic_string_view/op_plus.md @@ -0,0 +1,94 @@ +# operator+ +* string[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + constexpr basic_string + operator+(type_identity_t> lhs, + const basic_string& rhs); // (1) C++26 + + template + constexpr basic_string + operator+(type_identity_t> lhs, + basic_string&& rhs); // (2) C++26 +} +``` +* type_identity_t[link /reference/type_traits/type_identity.md] +* basic_string[link /reference/string/basic_string.md] + +## 概要 +[`basic_string_view`](../basic_string_view.md)オブジェクトと[`basic_string`](/reference/string/basic_string.md)オブジェクトを連結する。 + +- (1) : [`basic_string_view`](../basic_string_view.md)オブジェクトと`basic_string`オブジェクトを連結する +- (2) : [`basic_string_view`](../basic_string_view.md)オブジェクトと右辺値の`basic_string`オブジェクトを連結する + +`basic_string_view`側の引数に[`type_identity_t`](/reference/type_traits/type_identity.md)を使用することで非推論コンテキストとし、`basic_string_view`に暗黙変換可能な型からの連結を可能にしている。 + + +## 戻り値 +- (1) : 以下と等価 + ```cpp + basic_string r = rhs; + r.insert(0, lhs); + return r; + ``` + * insert[link /reference/string/basic_string/insert.md] + +- (2) : 以下と等価 + ```cpp + rhs.insert(0, lhs); + return std::move(rhs); + ``` + * insert[link /reference/string/basic_string/insert.md] + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::string_view sv = "Hello, "; + std::string s = "World!"; + + // string_view + string (1) + std::string result1 = sv + s; + std::cout << result1 << '\n'; + + // string_view + string&& (2) + std::string result2 = sv + std::string("World!"); + std::cout << result2 << '\n'; +} +``` +* +[color ff0000] + +### 出力 +``` +Hello, World! +Hello, World! +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + +## 関連項目 + +| 名前 | 説明 | +|-------------------------------|------------------------| +| [`basic_string::operator+`](/reference/string/basic_string/op_plus.md) | 文字列の連結 | + +## 参照 +- [P2591R5 Concatenation of strings and string views](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2591r5.html) From 038e14b4a3ce783bcbec09b1797480acd71de759 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Wed, 11 Mar 2026 13:51:33 +0900 Subject: [PATCH 2636/3948] =?UTF-8?q?meta=20header=E3=81=AE=E6=8C=87?= =?UTF-8?q?=E5=AE=9A=E3=83=9F=E3=82=B9=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/string_view/basic_string_view/op_plus.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/string_view/basic_string_view/op_plus.md b/reference/string_view/basic_string_view/op_plus.md index 02ea6db4e8..c45086f046 100644 --- a/reference/string_view/basic_string_view/op_plus.md +++ b/reference/string_view/basic_string_view/op_plus.md @@ -1,5 +1,5 @@ # operator+ -* string[meta header] +* string_view[meta header] * std[meta namespace] * function template[meta id-type] * cpp26[meta cpp] From fa239b65fd1b06b706d5a27ec711d5e0f66da5af Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 12 Mar 2026 11:15:34 +0900 Subject: [PATCH 2637/3948] =?UTF-8?q?C++26=E5=AF=BE=E5=BF=9C=E3=81=A8?= =?UTF-8?q?=E3=81=97=E3=81=A6apply=E3=81=AE=E6=88=BB=E3=82=8A=E5=80=A4?= =?UTF-8?q?=E5=9E=8B=E3=82=92=E5=8F=96=E5=BE=97=E3=81=99=E3=82=8B=E3=83=A1?= =?UTF-8?q?=E3=82=BF=E9=96=A2=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0=20#1522?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 6 +- reference/tuple/apply.md | 16 +++- reference/type_traits.md | 3 + reference/type_traits/apply_result.md | 88 +++++++++++++++++++ reference/type_traits/is_applicable.md | 88 +++++++++++++++++++ .../type_traits/is_nothrow_applicable.md | 84 ++++++++++++++++++ 6 files changed, 281 insertions(+), 4 deletions(-) create mode 100644 reference/type_traits/apply_result.md create mode 100644 reference/type_traits/is_applicable.md create mode 100644 reference/type_traits/is_nothrow_applicable.md diff --git a/lang/cpp26.md b/lang/cpp26.md index d1e7fd737b..9ab5b29e11 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -464,9 +464,9 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [`begin()`](/reference/optional/optional/begin.md)メンバ関数 - [`end()`](/reference/optional/optional/end.md)メンバ関数 - [`std::optional`](/reference/optional/optional.md)に、参照を保持するための`T&`の部分特殊化を追加 -- [`std::apply`](/reference/tuple/apply.md)の戻り値型推論をやめて、戻り値型用の[`std::apply_result`](/reference/tuple/apply_result.md.nolink)クラスを追加し、関連する以下の機能を追加 - - [`std::is_applicable`](/reference/type_traits/is_applicable.md.nolink)型特性 - - [`std::is_nothrow_applicable`](/reference/type_traits/is_nothrow_applicable.md.nolink)型特性 +- [`std::apply`](/reference/tuple/apply.md)の戻り値型推論をやめて、戻り値型用の[`std::apply_result`](/reference/type_traits/apply_result.md)クラスを追加し、関連する以下の機能を追加 + - [`std::is_applicable`](/reference/type_traits/is_applicable.md)型特性 + - [`std::is_nothrow_applicable`](/reference/type_traits/is_nothrow_applicable.md)型特性 - [`std::ignore`](/reference/tuple/ignore.md)をファーストクラス・オブジェクトとして型を詳細に定義 - [`std::bitset`](/reference/bitset/bitset.md)に、[`std::basic_string_view`](/reference/string_view/basic_string_view.md)を受け取るコンストラクタを追加 - [``](/reference/ratio.md)に、新たなSI接頭辞として、以下を追加 diff --git a/reference/tuple/apply.md b/reference/tuple/apply.md index c25e600dd4..1f5b3832d0 100644 --- a/reference/tuple/apply.md +++ b/reference/tuple/apply.md @@ -13,10 +13,18 @@ namespace std { template constexpr decltype(auto) apply(F&& f, Tuple&& t) noexcept(see below); // (1) C++23 + + template + constexpr apply_result_t + apply(F&& f, Tuple&& t) + noexcept(is_nothrow_applicable_v); // (1) C++26 } ``` * tuple-like[link tuple-like.md] * tuple-like[link tuple-like.md] +* tuple-like[link tuple-like.md] +* apply_result_t[link /reference/type_traits/apply_result.md] +* is_nothrow_applicable_v[link /reference/type_traits/is_nothrow_applicable.md] ## 概要 タプルを展開し、関数の引数に適用してその関数を実行する。 @@ -69,7 +77,8 @@ return apply-impl(std::forward(f), std::forward(t), ## 例外 -C++23から : `I`をパラメータパック`0, 1, ..., (`[`tuple_size_v`](tuple_size.md)`<`[`remove_reference_t`](/reference/type_traits/remove_reference.md)`>-1)`としたとき、例外指定の式は次と等価 : `noexcept(`[`invoke`](/reference/functional/invoke.md)`(std::forward(f), get(std::forward(t))...))` +- C++23から : `I`をパラメータパック`0, 1, ..., (`[`tuple_size_v`](tuple_size.md)`<`[`remove_reference_t`](/reference/type_traits/remove_reference.md)`>-1)`としたとき、例外指定の式は次と等価 : `noexcept(`[`invoke`](/reference/functional/invoke.md)`(std::forward(f), get(std::forward(t))...))` +- C++26から : 例外指定は[`is_nothrow_applicable_v`](/reference/type_traits/is_nothrow_applicable.md)`` ## 例 @@ -117,6 +126,9 @@ hello - [`std::tuple`](../tuple.md) - [INVOKE](/reference/concepts/Invoke.md) - [`tuple-like`](tuple-like.md) +- [`apply_result`](/reference/type_traits/apply_result.md) +- [`is_applicable`](/reference/type_traits/is_applicable.md) +- [`is_nothrow_applicable`](/reference/type_traits/is_nothrow_applicable.md) ## 参照 @@ -130,3 +142,5 @@ hello - C++20から効果説明の`decay_t`を`remove_cvref_t`へ変更。 - [P2517R1 Add a conditional `noexcept` specification to `std::apply`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2517r1.html) - C++23から条件付きで`noexcept`例外指定が行われる。 +- [P1317R2 Remove return type deduction in `std::apply`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p1317r2.pdf) + - C++26から戻り値型が`decltype(auto)`から`apply_result_t`に変更され、SFINAEフレンドリーになった。 diff --git a/reference/type_traits.md b/reference/type_traits.md index cad7b2b471..0ac382afca 100644 --- a/reference/type_traits.md +++ b/reference/type_traits.md @@ -182,6 +182,8 @@ | [`is_invocable_r`](type_traits/is_invocable_r.md) | 関数呼び出し可能でその戻り値型がある型へ変換可能かを調べる (class template) | C++17 | | [`is_nothrow_invocable`](type_traits/is_nothrow_invocable.md) | 例外を投げずに関数呼び出し可能かを調べる (class template) | C++17 | | [`is_nothrow_invocable_r`](type_traits/is_nothrow_invocable_r.md) | 例外を投げずに関数呼び出し可能でその戻り値型がある型へ変換可能かを調べる (class template) | C++17 | +| [`is_applicable`](type_traits/is_applicable.md) | タプルを展開して関数呼び出し可能かを調べる (class template) | C++26 | +| [`is_nothrow_applicable`](type_traits/is_nothrow_applicable.md) | 例外を投げずにタプルを展開して関数呼び出し可能かを調べる (class template) | C++26 | ## その他の変換 @@ -202,6 +204,7 @@ | [`underlying_type`](type_traits/underlying_type.md) | 列挙型の基底型を取得する (class template) | C++11 | | [`result_of`](type_traits/result_of.md) | 関数の戻り値の型を取得する (class template) | C++11 | | [`invoke_result`](type_traits/invoke_result.md) | 関数の戻り値の型を取得する (class template) | C++17 | +| [`apply_result`](type_traits/apply_result.md) | タプルを展開して関数を呼び出した場合の戻り値の型を取得する (class template) | C++26 | | [`unwrap_reference`](type_traits/unwrap_reference.md) | [`reference_wrapper`](/reference/functional/reference_wrapper.md)型を`T&`型に展開する (class template) | C++20 | | [`unwrap_ref_decay`](type_traits/unwrap_ref_decay.md) | [`reference_wrapper`](/reference/functional/reference_wrapper.md)型を`T&`型に展開し、型推論規則による型変換を行う (class template) | C++20 | diff --git a/reference/type_traits/apply_result.md b/reference/type_traits/apply_result.md new file mode 100644 index 0000000000..5afd53aad0 --- /dev/null +++ b/reference/type_traits/apply_result.md @@ -0,0 +1,88 @@ +# apply_result +* type_traits[meta header] +* std[meta namespace] +* class template[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + struct apply_result; + + template + using apply_result_t = typename apply_result::type; +} +``` + +## 概要 +関数呼び出し可能な型`F`に対して、[`tuple-like`](/reference/tuple/tuple-like.md)な型`Tuple`の要素を展開して[`apply`](/reference/tuple/apply.md)した場合の戻り値型を取得する。 + +[`invoke_result`](invoke_result.md)の[`apply`](/reference/tuple/apply.md)版であり、タプルの要素を引数として関数を呼び出した結果の型を求める。 + + +## 要件 +型`F`および`Tuple`が、完全型であること。もしくは`const`/`volatile`修飾された(あるいはされていない)`void`か、要素数不明の配列型であること。 + + +## 効果 +`ELEMS-OF(T)`を、`make_index_sequence>>`が示す`index_sequence`の特殊化のテンプレート引数である`size_t`のパラメータパック`N`に対する、パラメータパック`get(declval())`とする。 + +式[*INVOKE*](/reference/concepts/Invoke.md)`(declval(), ELEMS-OF(Tuple)...)`が未評価オペランドとして扱われたときに適格であるならば、メンバ型`type`は`decltype(`[*INVOKE*](/reference/concepts/Invoke.md)`(declval(), ELEMS-OF(Tuple)...))`を示す。そうでなければ、メンバ型`type`は定義されない。 + +アクセスチェックは`F`および`Tuple`と無関係なコンテキストで行われる。式の直接のコンテキストの妥当性のみが考慮される。 + + +## 備考 +このメタ関数はC++26で追加された。C++23まで[`apply`](/reference/tuple/apply.md)の戻り値型は`decltype(auto)`による型推論が使われていたが、これはSFINAEフレンドリーではなかった。`apply_result`を使うことで、[`apply`](/reference/tuple/apply.md)の呼び出し可能性をコンセプトやSFINAEで判定できるようになった。 + + +## 例 +```cpp example +#include +#include +#include + +int add(int a, int b) { return a + b; } + +int main() +{ + using args_t = std::tuple; + + // apply(add, tuple) の戻り値型は int + static_assert(std::is_same_v< + std::apply_result_t, + int + >); + + // 呼び出し不可能な場合、apply_result にはメンバ型 type がない + // (SFINAEフレンドリー) + static_assert(!requires { + typename std::apply_result_t>; + }); +} +``` +* std::apply_result_t[color ff0000] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 22 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + + +## 関連項目 +- [`invoke_result`](invoke_result.md) +- [`is_applicable`](is_applicable.md) +- [`is_nothrow_applicable`](is_nothrow_applicable.md) +- [`apply`](/reference/tuple/apply.md) + + +## 参照 +- [P1317R2 Remove return type deduction in `std::apply`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p1317r2.pdf) diff --git a/reference/type_traits/is_applicable.md b/reference/type_traits/is_applicable.md new file mode 100644 index 0000000000..f512e8812a --- /dev/null +++ b/reference/type_traits/is_applicable.md @@ -0,0 +1,88 @@ +# is_applicable +* type_traits[meta header] +* std[meta namespace] +* class template[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + struct is_applicable; + + template + inline constexpr bool is_applicable_v = std::is_applicable::value; +} +``` + +## 概要 +関数呼び出し可能な型`F`に対して、[`tuple-like`](/reference/tuple/tuple-like.md)な型`Tuple`の要素を展開して[`apply`](/reference/tuple/apply.md)による呼び出しが可能かどうかを調べる。 + +[`is_invocable`](is_invocable.md)の[`apply`](/reference/tuple/apply.md)版である。 + + +## 要件 +型`F`および`Tuple`が、完全型であること。もしくは`const`/`volatile`修飾された(あるいはされていない)`void`か、要素数不明の配列型であること。 + + +## 効果 +`ELEMS-OF(T)`を、`make_index_sequence>>`が示す`index_sequence`の特殊化のテンプレート引数である`size_t`のパラメータパック`N`に対する、パラメータパック`get(declval())`とする。 + +[`tuple-like`](/reference/tuple/tuple-like.md)``が`true`であり、かつ式[*INVOKE*](/reference/concepts/Invoke.md)`(declval(), ELEMS-OF(Tuple)...)`が未評価オペランドとして扱われたときに適格であるならば[`true_type`](true_type.md)から派生し、そうでなければ[`false_type`](false_type.md)から派生する。 + + +## 例 +```cpp example +#include +#include +#include +#include + +int add(int a, int b) { return a + b; } +void no_args() {} + +int main() +{ + std::cout << std::boolalpha; + + // add(int, int) に tuple を展開して呼び出し可能 + std::cout << std::is_applicable_v> << std::endl; + + // add(int, int) に tuple では引数が足りない + std::cout << std::is_applicable_v> << std::endl; + + // no_args() に空のタプルで呼び出し可能 + std::cout << std::is_applicable_v> << std::endl; + + // no_args() に tuple は引数が多すぎる + std::cout << std::is_applicable_v> << std::endl; +} +``` +* std::is_applicable_v[color ff0000] + +### 出力 +``` +true +false +true +false +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 22 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + + +## 関連項目 +- [`is_invocable`](is_invocable.md) +- [`is_nothrow_applicable`](is_nothrow_applicable.md) +- [`apply_result`](apply_result.md) +- [`apply`](/reference/tuple/apply.md) + + +## 参照 +- [P1317R2 Remove return type deduction in `std::apply`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p1317r2.pdf) diff --git a/reference/type_traits/is_nothrow_applicable.md b/reference/type_traits/is_nothrow_applicable.md new file mode 100644 index 0000000000..1323776977 --- /dev/null +++ b/reference/type_traits/is_nothrow_applicable.md @@ -0,0 +1,84 @@ +# is_nothrow_applicable +* type_traits[meta header] +* std[meta namespace] +* class template[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + struct is_nothrow_applicable; + + template + inline constexpr bool is_nothrow_applicable_v + = std::is_nothrow_applicable::value; +} +``` + +## 概要 +関数呼び出し可能な型`F`に対して、[`tuple-like`](/reference/tuple/tuple-like.md)な型`Tuple`の要素を展開して[`apply`](/reference/tuple/apply.md)による呼び出しが可能であり、かつその呼び出しに際して例外を投げないかどうかを調べる。 + +[`is_nothrow_invocable`](is_nothrow_invocable.md)の[`apply`](/reference/tuple/apply.md)版である。 + + +## 要件 +型`F`および`Tuple`が、完全型であること。もしくは`const`/`volatile`修飾された(あるいはされていない)`void`か、要素数不明の配列型であること。 + + +## 効果 +`ELEMS-OF(T)`を、`make_index_sequence>>`が示す`index_sequence`の特殊化のテンプレート引数である`size_t`のパラメータパック`N`に対する、パラメータパック`get(declval())`とする。 + +[`is_applicable_v`](is_applicable.md)``が`true`であり、かつ式[*INVOKE*](/reference/concepts/Invoke.md)`(declval(), ELEMS-OF(Tuple)...)`がいかなる例外も投げない場合[`true_type`](true_type.md)から派生し、そうでなければ[`false_type`](false_type.md)から派生する。 + + +## 例 +```cpp example +#include +#include +#include + +int add(int a, int b) noexcept { return a + b; } +int may_throw(int a, int b) { return a + b; } + +int main() +{ + std::cout << std::boolalpha; + + // add(int, int) noexcept + std::cout << std::is_nothrow_applicable_v> << std::endl; + + // may_throw(int, int) は noexcept ではない + std::cout << std::is_nothrow_applicable_v> << std::endl; + + // 呼び出し不可能 + std::cout << std::is_nothrow_applicable_v> << std::endl; +} +``` +* std::is_nothrow_applicable_v[color ff0000] + +### 出力 +``` +true +false +false +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 22 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + + +## 関連項目 +- [`is_nothrow_invocable`](is_nothrow_invocable.md) +- [`is_applicable`](is_applicable.md) +- [`apply_result`](apply_result.md) +- [`apply`](/reference/tuple/apply.md) + + +## 参照 +- [P1317R2 Remove return type deduction in `std::apply`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p1317r2.pdf) From 8d9f9ce276cbf9b592ea4101ceda0d52a411fab6 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 13 Mar 2026 11:25:45 +0900 Subject: [PATCH 2638/3948] =?UTF-8?q?C++26=E3=81=A7=E3=81=AEflat=5Fmap/set?= =?UTF-8?q?=E9=96=A2=E9=80=A3=E3=81=AE=E4=BB=95=E6=A7=98=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E3=81=AB=E5=AF=BE=E5=BF=9C=20#1566?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/flat_map/flat_map.md | 4 ++- reference/flat_map/flat_map/insert_range.md | 28 +++++++++++----- reference/flat_map/flat_map/swap.md | 10 ++++-- reference/flat_map/flat_map/swap_free.md | 5 ++- reference/flat_map/flat_multimap.md | 4 ++- .../flat_map/flat_multimap/insert_range.md | 28 +++++++++++----- reference/flat_map/flat_multimap/swap.md | 11 +++++-- reference/flat_map/flat_multimap/swap_free.md | 6 ++-- reference/flat_set/flat_multiset.md | 2 ++ .../flat_set/flat_multiset/insert_range.md | 31 ++++++++++++++++-- reference/flat_set/flat_multiset/swap.md | 9 ++++-- reference/flat_set/flat_multiset/swap_free.md | 5 ++- reference/flat_set/flat_set.md | 2 ++ reference/flat_set/flat_set/insert_range.md | 32 +++++++++++++++++-- reference/flat_set/flat_set/swap.md | 9 ++++-- reference/flat_set/flat_set/swap_free.md | 5 ++- 16 files changed, 153 insertions(+), 38 deletions(-) diff --git a/reference/flat_map/flat_map.md b/reference/flat_map/flat_map.md index b63924ae8e..2db5af5af6 100644 --- a/reference/flat_map/flat_map.md +++ b/reference/flat_map/flat_map.md @@ -44,7 +44,7 @@ namespace std { `value_type`は、[`std::map`](/reference/map/map.md)では[`std::pair`](/reference/utility/pair.md)``だが、このクラスは[`std::pair`](/reference/utility/pair.md)``である (`const`がつかない)。 -以下の不変条件をもち、メンバ関数のいずれかが例外によって終了した場合には不変条件の状態に復元される (ただし、その復元操作によってコンテナが空になる可能性がある): +以下の不変条件をもち、メンバ関数のいずれかが例外によって終了した場合には不変条件の状態に復元される (ただし、その復元操作によってコンテナが空になる可能性がある)。ムーブコンストラクタとムーブ代入演算子の場合、両方の引数の不変条件が復元される: - キーの配列と値の配列が、同じ要素数をもつ - キーの配列が、指定された比較関数オブジェクトを尊重してソートを行う @@ -369,3 +369,5 @@ int main() - C++23で`flat_map`が導入された経緯・動機・設計について記載されている - [P0429R9 A Standard `flat_map`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0429r9.pdf) - C++23で導入された`flat_map`の仕様 +- [P3567R2 flat_meow Fixes](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3567r2.html) + - C++26で`swap`の条件付き`noexcept`、`insert_range`のソート済みオーバーロード追加などの修正が行われた diff --git a/reference/flat_map/flat_map/insert_range.md b/reference/flat_map/flat_map/insert_range.md index 4862be3385..9c939b6476 100644 --- a/reference/flat_map/flat_map/insert_range.md +++ b/reference/flat_map/flat_map/insert_range.md @@ -7,11 +7,15 @@ ```cpp template R> -void insert_range(R&& rg); // (1) C++23 +void insert_range(R&& rg); // (1) C++23 template R> -constexpr void insert_range(R&& rg); // (1) C++26 +constexpr void insert_range(R&& rg); // (1) C++26 + +template R> +constexpr void insert_range(sorted_unique_t, R&& rg); // (2) C++26 ``` * container-compatible-range[link /reference/exposition-only/container-compatible-range.md] +* sorted_unique_t[link /reference/flat_map/sorted_unique_t.md] ## 概要 Rangeを挿入し、コンテナを拡張する。 @@ -26,17 +30,19 @@ Rangeを挿入し、コンテナを拡張する。 ## 効果 -- メンバ変数として保持しているコンテナ`c`に、以下のように挿入する: +- (1) : メンバ変数として保持しているコンテナ`c`に、以下のように挿入する: ```cpp - for (const auto& e : rg) { - c.keys.insert(c.keys.end(), e.first); - c.values.insert(c.values.end(), e.second); - } + ranges::for_each(rg, [&](value_type e) { + c.keys.insert(c.keys.end(), std::move(e.first)); + c.values.insert(c.values.end(), std::move(e.second)); + }); ``` * c.keys[link containers.md] * c.values[link containers.md] + * ranges::for_each[link /reference/algorithm/ranges_for_each.md] * end()[link /reference/vector/vector/end.md] * insert[link /reference/vector/vector/insert.md] + * std::move[link /reference/utility/move.md] * first[link /reference/utility/pair/first.md] * second[link /reference/utility/pair/second.md] @@ -58,13 +64,16 @@ Rangeを挿入し、コンテナを拡張する。 * key_equiv[link key_equiv.md] * distance[link /reference/iterator/distance.md] +- (2) : `insert_range(rg)`と等価 + ## 戻り値 なし ## 計算量 -- Nをこの操作の前の[`size()`](size.md)、Mを[`ranges::distance`](/reference/iterator/ranges_distance.md)`(rg)`として、N + MlogM +- (1) : Nをこの操作の前の[`size()`](size.md)、Mを[`ranges::distance`](/reference/iterator/ranges_distance.md)`(rg)`として、N + MlogM +- (2) : 線形 ## 備考 @@ -123,3 +132,6 @@ int main() ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [P3567R2 flat_meow Fixes](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3567r2.html) + - C++26で(2)の`sorted_unique_t`をとるオーバーロードが追加された + - C++26で(1)の効果が、要素のコピーではなくムーブを行うように修正された diff --git a/reference/flat_map/flat_map/swap.md b/reference/flat_map/flat_map/swap.md index 2936b8f8d7..7a2c6a1129 100644 --- a/reference/flat_map/flat_map/swap.md +++ b/reference/flat_map/flat_map/swap.md @@ -6,9 +6,13 @@ * cpp23[meta cpp] ```cpp -void swap(flat_map& y) noexcept; // (1) C++23 -constexpr void swap(flat_map& y) noexcept; // (1) C++26 +void swap(flat_map& y) noexcept; // (1) C++23 +constexpr void swap(flat_map& y) + noexcept(is_nothrow_swappable_v && + is_nothrow_swappable_v && + is_nothrow_swappable_v); // (1) C++26 ``` +* is_nothrow_swappable_v[link /reference/type_traits/is_nothrow_swappable.md] ## 概要 コンテナ内のコンテンツを、同じ型の要素を保持する他の `flat_map` オブジェクトである `y` 内のコンテンツと交換する。 @@ -84,3 +88,5 @@ fm2 : {[10,a], [20,b], [30,c]} ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [P3567R2 flat_meow Fixes](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3567r2.html) + - C++26で、`noexcept`指定が無条件から条件付きに変更された。内部コンテナと比較関数オブジェクトの`swap`が例外を送出しない場合にのみ`noexcept`となる diff --git a/reference/flat_map/flat_map/swap_free.md b/reference/flat_map/flat_map/swap_free.md index 2988842706..fed5304231 100644 --- a/reference/flat_map/flat_map/swap_free.md +++ b/reference/flat_map/flat_map/swap_free.md @@ -13,7 +13,8 @@ namespace std { template constexpr void swap(flat_map& x, - flat_map& y); // (1) C++26 + flat_map& y) + noexcept(noexcept(x.swap(y))); // (1) C++26 } ``` @@ -90,3 +91,5 @@ fm2 : {[10,a], [20,b], [30,c]} ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [P3567R2 flat_meow Fixes](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3567r2.html) + - C++26で、`noexcept`指定が条件付きに変更された。メンバ関数[`swap()`](swap.md)の`noexcept`条件に従う diff --git a/reference/flat_map/flat_multimap.md b/reference/flat_map/flat_multimap.md index f857ebef2e..21c81b18a4 100644 --- a/reference/flat_map/flat_multimap.md +++ b/reference/flat_map/flat_multimap.md @@ -44,7 +44,7 @@ namespace std { `value_type`は、[`std::multimap`](/reference/map/multimap.md)では[`std::pair`](/reference/utility/pair.md)``だが、このクラスは[`std::pair`](/reference/utility/pair.md)``である (`const`がつかない)。 -以下の不変条件をもち、メンバ関数のいずれかが例外によって終了した場合には不変条件の状態に復元される (ただし、その復元操作によってコンテナが空になる可能性がある): +以下の不変条件をもち、メンバ関数のいずれかが例外によって終了した場合には不変条件の状態に復元される (ただし、その復元操作によってコンテナが空になる可能性がある)。ムーブコンストラクタとムーブ代入演算子の場合、両方の引数の不変条件が復元される: - キーの配列と値の配列が、同じ要素数をもつ - キーの配列が、指定された比較関数オブジェクトを尊重してソートを行う @@ -284,3 +284,5 @@ int main() - C++23で`flat_map`が導入された経緯・動機・設計について記載されている - [P0429R9 A Standard `flat_map`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0429r9.pdf) - C++23で導入された`flat_map`の仕様 +- [P3567R2 flat_meow Fixes](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3567r2.html) + - C++26で`swap`の条件付き`noexcept`、`insert_range`のソート済みオーバーロード追加などの修正が行われた diff --git a/reference/flat_map/flat_multimap/insert_range.md b/reference/flat_map/flat_multimap/insert_range.md index 40801e5143..3ac0eb7448 100644 --- a/reference/flat_map/flat_multimap/insert_range.md +++ b/reference/flat_map/flat_multimap/insert_range.md @@ -7,11 +7,15 @@ ```cpp template R> -void insert_range(R&& rg); // (1) C++23 +void insert_range(R&& rg); // (1) C++23 template R> -constexpr void insert_range(R&& rg); // (1) C++26 +constexpr void insert_range(R&& rg); // (1) C++26 + +template R> +constexpr void insert_range(sorted_equivalent_t, R&& rg); // (2) C++26 ``` * container-compatible-range[link /reference/exposition-only/container-compatible-range.md] +* sorted_equivalent_t[link /reference/flat_map/sorted_equivalent_t.md] ## 概要 Rangeを挿入し、コンテナを拡張する。 @@ -22,30 +26,35 @@ Rangeを挿入し、コンテナを拡張する。 ## 効果 -- メンバ変数として保持しているコンテナ`c`に、以下のように挿入する: +- (1) : メンバ変数として保持しているコンテナ`c`に、以下のように挿入する: ```cpp - for (const auto& e : rg) { - c.keys.insert(c.keys.end(), e.first); - c.values.insert(c.values.end(), e.second); - } + ranges::for_each(rg, [&](value_type e) { + c.keys.insert(c.keys.end(), std::move(e.first)); + c.values.insert(c.values.end(), std::move(e.second)); + }); ``` * c.keys[link containers.md] * c.values[link containers.md] + * ranges::for_each[link /reference/algorithm/ranges_for_each.md] * end()[link /reference/vector/vector/end.md] * insert[link /reference/vector/vector/insert.md] + * std::move[link /reference/utility/move.md] * first[link /reference/utility/pair/first.md] * second[link /reference/utility/pair/second.md] - 次に、新しく挿入された要素の範囲を`value_comp()`を基準にソートする - 次に、ソートされた結果の範囲と、既存の要素のソートされた範囲をひとつのソートされた範囲にマージする +- (2) : `insert_range(rg)`と等価 + ## 戻り値 なし ## 計算量 -- Nをこの操作の前の[`size()`](size.md)、Mを[`ranges::distance`](/reference/iterator/ranges_distance.md)`(rg)`として、N + MlogM +- (1) : Nをこの操作の前の[`size()`](size.md)、Mを[`ranges::distance`](/reference/iterator/ranges_distance.md)`(rg)`として、N + MlogM +- (2) : 線形 ## 備考 @@ -103,3 +112,6 @@ int main() ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [P3567R2 flat_meow Fixes](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3567r2.html) + - C++26で(2)の`sorted_equivalent_t`をとるオーバーロードが追加された + - C++26で(1)の効果が、要素のコピーではなくムーブを行うように修正された diff --git a/reference/flat_map/flat_multimap/swap.md b/reference/flat_map/flat_multimap/swap.md index 18f86609a2..9002d99526 100644 --- a/reference/flat_map/flat_multimap/swap.md +++ b/reference/flat_map/flat_multimap/swap.md @@ -6,9 +6,13 @@ * cpp23[meta cpp] ```cpp -void swap(flat_multimap& y) noexcept; // (1) C++23 -constexpr void swap(flat_multimap& y) noexcept; // (1) C++26 +void swap(flat_multimap& y) noexcept; // (1) C++23 +constexpr void swap(flat_multimap& y) + noexcept(is_nothrow_swappable_v && + is_nothrow_swappable_v && + is_nothrow_swappable_v); // (1) C++26 ``` +* is_nothrow_swappable_v[link /reference/type_traits/is_nothrow_swappable.md] ## 概要 コンテナ内のコンテンツを、同じ型の要素を保持する他の `flat_multimap` オブジェクトである `y` 内のコンテンツと交換する。 @@ -81,6 +85,7 @@ fm2 : {[10,a], [20,b], [30,c]} - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [P3567R2 flat_meow Fixes](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3567r2.html) + - C++26で、`noexcept`指定が無条件から条件付きに変更された。内部コンテナと比較関数オブジェクトの`swap`が例外を送出しない場合にのみ`noexcept`となる diff --git a/reference/flat_map/flat_multimap/swap_free.md b/reference/flat_map/flat_multimap/swap_free.md index 7dbc1bda72..a21a02ec82 100644 --- a/reference/flat_map/flat_multimap/swap_free.md +++ b/reference/flat_map/flat_multimap/swap_free.md @@ -13,7 +13,8 @@ namespace std { template constexpr void swap(flat_multimap& x, - flat_multimap& y); // (1) C++26 + flat_multimap& y) + noexcept(noexcept(x.swap(y))); // (1) C++26 } ``` @@ -87,6 +88,7 @@ fm2 : {[10,a], [20,b], [30,c]} - [GCC](/implementation.md#gcc): ?? - [Visual C++](/implementation.md#visual_cpp): ?? - ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [P3567R2 flat_meow Fixes](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3567r2.html) + - C++26で、`noexcept`指定が条件付きに変更された。メンバ関数[`swap()`](swap.md)の`noexcept`条件に従う diff --git a/reference/flat_set/flat_multiset.md b/reference/flat_set/flat_multiset.md index 3c6c273bec..632700a360 100644 --- a/reference/flat_set/flat_multiset.md +++ b/reference/flat_set/flat_multiset.md @@ -260,3 +260,5 @@ int main() - C++23で`flat_set`が導入された経緯・動機・設計について記載されている - [P1222R4 A Standard `flat_set`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1222r4.pdf) - C++23で導入された`flat_set`の仕様 +- [P3567R2 flat_meow Fixes](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3567r2.html) + - C++26で`swap`の条件付き`noexcept`、`insert_range`のソート済みオーバーロード追加などの修正が行われた diff --git a/reference/flat_set/flat_multiset/insert_range.md b/reference/flat_set/flat_multiset/insert_range.md index 93d22062d3..6e11b15c30 100644 --- a/reference/flat_set/flat_multiset/insert_range.md +++ b/reference/flat_set/flat_multiset/insert_range.md @@ -7,11 +7,15 @@ ```cpp template R> -void insert_range(R&& rg); // (1) C++23 +void insert_range(R&& rg); // (1) C++23 template R> -constexpr void insert_range(R&& rg); // (1) C++26 +constexpr void insert_range(R&& rg); // (1) C++26 + +template R> +constexpr void insert_range(sorted_equivalent_t, R&& rg); // (2) C++26 ``` * container-compatible-range[link /reference/exposition-only/container-compatible-range.md] +* sorted_equivalent_t[link /reference/flat_set/sorted_equivalent_t.md] ## 概要 Rangeを挿入し、コンテナを拡張する。 @@ -21,12 +25,31 @@ Rangeを挿入し、コンテナを拡張する。 内部的に `flat_multiset` コンテナは、コンストラクト時に指定された比較オブジェクトによって要素を下位から上位へとソートして保持する。 +## 効果 +- (1) : メンバ変数として保持しているコンテナ`c`に、以下のように挿入する: + ```cpp + ranges::for_each(rg, [&](auto&& e) { + c.insert(c.end(), std::forward(e)); + }); + ``` + * ranges::for_each[link /reference/algorithm/ranges_for_each.md] + * end()[link /reference/vector/vector/end.md] + * insert[link /reference/vector/vector/insert.md] + * std::forward[link /reference/utility/forward.md] + + - 次に、新しく挿入された要素の範囲を`value_comp()`を基準にソートする + - 次に、ソートされた結果の範囲と、既存の要素のソートされた範囲をひとつのソートされた範囲にマージする + +- (2) : `insert_range(rg)`と等価 + + ## 戻り値 なし ## 計算量 -- Nをこの操作の前の[`size()`](size.md)、Mを[`ranges::distance`](/reference/iterator/ranges_distance.md)`(rg)`として、N + MlogM +- (1) : Nをこの操作の前の[`size()`](size.md)、Mを[`ranges::distance`](/reference/iterator/ranges_distance.md)`(rg)`として、N + MlogM +- (2) : 線形 ## 備考 @@ -77,3 +100,5 @@ int main() ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [P3567R2 flat_meow Fixes](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3567r2.html) + - C++26で(2)の`sorted_equivalent_t`をとるオーバーロードが追加された diff --git a/reference/flat_set/flat_multiset/swap.md b/reference/flat_set/flat_multiset/swap.md index 7112799033..67ab777cda 100644 --- a/reference/flat_set/flat_multiset/swap.md +++ b/reference/flat_set/flat_multiset/swap.md @@ -6,9 +6,12 @@ * cpp23[meta cpp] ```cpp -void swap(flat_multiset& y) noexcept; // (1) C++23 -constexpr void swap(flat_multiset& y) noexcept; // (1) C++26 +void swap(flat_multiset& y) noexcept; // (1) C++23 +constexpr void swap(flat_multiset& y) + noexcept(is_nothrow_swappable_v && + is_nothrow_swappable_v); // (1) C++26 ``` +* is_nothrow_swappable_v[link /reference/type_traits/is_nothrow_swappable.md] ## 概要 コンテナ内のコンテンツを、同じ型の要素を保持する他の `flat_multiset` オブジェクトである `y` 内のコンテンツと交換する。 @@ -78,3 +81,5 @@ fs2 : {10, 20, 30} ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [P3567R2 flat_meow Fixes](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3567r2.html) + - C++26で、`noexcept`指定が無条件から条件付きに変更された。内部コンテナと比較関数オブジェクトの`swap`が例外を送出しない場合にのみ`noexcept`となる diff --git a/reference/flat_set/flat_multiset/swap_free.md b/reference/flat_set/flat_multiset/swap_free.md index 0192721c2c..4e991b7687 100644 --- a/reference/flat_set/flat_multiset/swap_free.md +++ b/reference/flat_set/flat_multiset/swap_free.md @@ -13,7 +13,8 @@ namespace std { template constexpr void swap(flat_multiset& x, - flat_multiset& y); // (1) C++26 + flat_multiset& y) + noexcept(noexcept(x.swap(y))); // (1) C++26 } ``` @@ -83,3 +84,5 @@ fs2 : {10, 20, 30} ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [P3567R2 flat_meow Fixes](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3567r2.html) + - C++26で、`noexcept`指定が条件付きに変更された。メンバ関数[`swap()`](swap.md)の`noexcept`条件に従う diff --git a/reference/flat_set/flat_set.md b/reference/flat_set/flat_set.md index 13d6dd0891..3b4957aaf4 100644 --- a/reference/flat_set/flat_set.md +++ b/reference/flat_set/flat_set.md @@ -259,3 +259,5 @@ int main() - C++23で`flat_set`が導入された経緯・動機・設計について記載されている - [P1222R4 A Standard `flat_set`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1222r4.pdf) - C++23で導入された`flat_set`の仕様 +- [P3567R2 flat_meow Fixes](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3567r2.html) + - C++26で`swap`の条件付き`noexcept`、`insert_range`のソート済みオーバーロード追加などの修正が行われた diff --git a/reference/flat_set/flat_set/insert_range.md b/reference/flat_set/flat_set/insert_range.md index 7a83eae38a..b7565537d4 100644 --- a/reference/flat_set/flat_set/insert_range.md +++ b/reference/flat_set/flat_set/insert_range.md @@ -7,11 +7,15 @@ ```cpp template R> -void insert_range(R&& rg); // (1) C++23 +void insert_range(R&& rg); // (1) C++23 template R> -constexpr void insert_range(R&& rg); // (1) C++26 +constexpr void insert_range(R&& rg); // (1) C++26 + +template R> +constexpr void insert_range(sorted_unique_t, R&& rg); // (2) C++26 ``` * container-compatible-range[link /reference/exposition-only/container-compatible-range.md] +* sorted_unique_t[link /reference/flat_set/sorted_unique_t.md] ## 概要 Rangeを挿入し、コンテナを拡張する。 @@ -25,12 +29,32 @@ Rangeを挿入し、コンテナを拡張する。 内部的に `flat_set` コンテナは、コンストラクト時に指定された比較オブジェクトによって要素を下位から上位へとソートして保持する。 +## 効果 +- (1) : メンバ変数として保持しているコンテナ`c`に、以下のように挿入する: + ```cpp + ranges::for_each(rg, [&](auto&& e) { + c.insert(c.end(), std::forward(e)); + }); + ``` + * ranges::for_each[link /reference/algorithm/ranges_for_each.md] + * end()[link /reference/vector/vector/end.md] + * insert[link /reference/vector/vector/insert.md] + * std::forward[link /reference/utility/forward.md] + + - 次に、新しく挿入された要素の範囲を`value_comp()`を基準にソートする + - 次に、ソートされた結果の範囲と、既存の要素のソートされた範囲をひとつのソートされた範囲にマージする + - 最後に、重複する要素を削除する + +- (2) : `insert_range(rg)`と等価 + + ## 戻り値 なし ## 計算量 -- Nをこの操作の前の[`size()`](size.md)、Mを[`ranges::distance`](/reference/iterator/ranges_distance.md)`(rg)`として、N + MlogM +- (1) : Nをこの操作の前の[`size()`](size.md)、Mを[`ranges::distance`](/reference/iterator/ranges_distance.md)`(rg)`として、N + MlogM +- (2) : 線形 ## 備考 @@ -83,3 +107,5 @@ int main() ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [P3567R2 flat_meow Fixes](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3567r2.html) + - C++26で(2)の`sorted_unique_t`をとるオーバーロードが追加された diff --git a/reference/flat_set/flat_set/swap.md b/reference/flat_set/flat_set/swap.md index a7c466de95..2195c3446b 100644 --- a/reference/flat_set/flat_set/swap.md +++ b/reference/flat_set/flat_set/swap.md @@ -6,9 +6,12 @@ * cpp23[meta cpp] ```cpp -void swap(flat_set& y) noexcept; // (1) C++23 -constexpr void swap(flat_set& y) noexcept; // (1) C++26 +void swap(flat_set& y) noexcept; // (1) C++23 +constexpr void swap(flat_set& y) + noexcept(is_nothrow_swappable_v && + is_nothrow_swappable_v); // (1) C++26 ``` +* is_nothrow_swappable_v[link /reference/type_traits/is_nothrow_swappable.md] ## 概要 コンテナ内のコンテンツを、同じ型の要素を保持する他の `flat_sest` オブジェクトである `y` 内のコンテンツと交換する。 @@ -78,3 +81,5 @@ fs2 : {10, 20, 30} ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [P3567R2 flat_meow Fixes](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3567r2.html) + - C++26で、`noexcept`指定が無条件から条件付きに変更された。内部コンテナと比較関数オブジェクトの`swap`が例外を送出しない場合にのみ`noexcept`となる diff --git a/reference/flat_set/flat_set/swap_free.md b/reference/flat_set/flat_set/swap_free.md index 2c3b707d92..fd2e418efa 100644 --- a/reference/flat_set/flat_set/swap_free.md +++ b/reference/flat_set/flat_set/swap_free.md @@ -13,7 +13,8 @@ namespace std { template constexpr void swap(flat_set& x, - flat_set& y); // (1) C++26 + flat_set& y) + noexcept(noexcept(x.swap(y))); // (1) C++26 } ``` @@ -83,3 +84,5 @@ fs2 : {10, 20, 30} ## 参照 - [P3372R3 constexpr containers and adaptors](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3372r3.html) +- [P3567R2 flat_meow Fixes](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3567r2.html) + - C++26で、`noexcept`指定が条件付きに変更された。メンバ関数[`swap()`](swap.md)の`noexcept`条件に従う From 5486a04cdd25de7f357d440ea8c94c661e10c65a Mon Sep 17 00:00:00 2001 From: Akiko Kawai Date: Fri, 13 Mar 2026 11:30:31 +0900 Subject: [PATCH 2639/3948] Update index access for parameter packs in status for Clang --- implementation-status.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/implementation-status.md b/implementation-status.md index 4afae86441..b84d030ea4 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -300,7 +300,7 @@ | P2738R1: [定数式での`void*`からポインタ型へのキャストを許可](/lang/cpp26/constexpr_cast_from_voidptr.md) | 型消去のために`void*`からポインタ型へのキャストを許可する | 14 | 17 | | | | P2741R3: [`static_assert`の診断メッセージにユーザーが生成した文字列の指定を許可](/lang/cpp26/user-generated_static_assert_messages.md) | `constexpr`な`S.size()`と`S.data()`メンバ関数をもつオブジェクトをコンパイル時文字列として指定できるようにする | 14 | 17 | | | | P2558R2: [基本文字集合に@、$、\`を追加](/lang/cpp26/add_atsign_dollar_graveaccent_to_the_basic_character_set.md) | C言語との互換性のためにこれらの文字を基本文字集合に追加 | 15 | Yes | | | -| P2662R3: [パラメータパックへのインデックスアクセスを許可](/lang/cpp26/pack_indexing.md) | 可変引数テンプレートのパラメータパックに添字アクセスできるようにする | 15 | | | | +| P2662R3: [パラメータパックへのインデックスアクセスを許可](/lang/cpp26/pack_indexing.md) | 可変引数テンプレートのパラメータパックに添字アクセスできるようにする | 15 | 19 | | | | P2864R2: [非推奨となっていた列挙値から算術型への暗黙変換を削除](/lang/cpp26/remove_deprecated_arithmetic_conversion_on_enumerations.md) | C++20から非推奨となっていた列挙値への算術演算で算術型に暗黙変換される仕様を削除 | 14 | 18 | | | | P2748R5: [返却された左辺値から暗黙変換された一時オブジェクトが参照に束縛されることを禁止する](/lang/cpp26/disallow_binding_a_returned_glvalue_to_a_temporary.md) | 寿命切れの変数によって引き起こされるバグを防止する | 14 | 19 | | | | P3106R1: [要素数不明の配列を集成体初期化する規則を明確化](/lang/cpp26/clarifying_rules_for_brace_elision_in_aggregate_initialization.md) | 配列要素の集成体初期化で`{}`が省略された場合の矛盾していた規定を修正 | yes | 17 | | | From f1b341a2357de5954bca34b4473f6c3719bbc052 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 19 Mar 2026 11:23:48 +0900 Subject: [PATCH 2640/3948] =?UTF-8?q?generate=5Fcanonical=20:=20C++26?= =?UTF-8?q?=E3=81=A7=E7=AF=84=E5=9B=B2=E5=A4=96=E3=81=AE=E5=80=A4=E3=81=8C?= =?UTF-8?q?=E7=94=9F=E6=88=90=E3=81=95=E3=82=8C=E3=81=AA=E3=81=8F=E3=81=AA?= =?UTF-8?q?=E3=81=A3=E3=81=9F=E4=BB=95=E6=A7=98=E5=A4=89=E6=9B=B4=E3=81=AB?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C=20#1239?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 仕様として変更を記載したので、Qiitaの考察・検証の記事への参照を削除 --- reference/random/generate_canonical.md | 46 ++++++++++++++++--- reference/random/uniform_real_distribution.md | 7 +++ .../op_constructor.md | 2 - 3 files changed, 47 insertions(+), 8 deletions(-) diff --git a/reference/random/generate_canonical.md b/reference/random/generate_canonical.md index f5da186716..c226d9aef5 100644 --- a/reference/random/generate_canonical.md +++ b/reference/random/generate_canonical.md @@ -7,7 +7,10 @@ ```cpp namespace std { template - RealType generate_canonical(URBG& g); + RealType generate_canonical(URBG& g); // (1) C++11 + + template + RealType generate_canonical(URBG& g); // (1) C++26 } ``` @@ -18,17 +21,50 @@ namespace std { ## テンプレートパラメータ - `class RealType` : 生成する実数の型。 -- `size_t bits` : 生成する実数における仮数部への分解能の最低要求。最大値は `std::`[`numeric_limits`](/reference/limits/numeric_limits.md)`::`[`digits`](/reference/limits/numeric_limits/digits.md) 。 +- `size_t bits` : 生成する実数における仮数部への分解能の最低要求。最大値は `std::`[`numeric_limits`](/reference/limits/numeric_limits.md)`::`[`digits`](/reference/limits/numeric_limits/digits.md) + - C++26で`digits`に名称変更 +- `size_t digits` : 生成する実数における基数非依存の桁数としての分解能の最低要求。最大値は `std::`[`numeric_limits`](/reference/limits/numeric_limits.md)`::`[`digits`](/reference/limits/numeric_limits/digits.md) 。 - `class URBG` : 一様乱数生成器の型。 ## 関数パラメータ - URBG& g : 一様乱数生成器。 +## 効果 +- C++11からC++23まで : + 以下の変数を定義する。 + - `R` = `g.`[`max()`](/reference/random/uniform_random_bit_generator.md) `-` `g.`[`min()`](/reference/random/uniform_random_bit_generator.md) `+ 1` + - `k` = max(1, ⌈`bits` / log2`R`⌉) + - `S` = `g()` から `k` 回呼び出した結果を `R` のべき乗で重み付けして累積した値 + + 戻り値は `S` / `R``k` となる。ただし浮動小数点数の丸めにより、結果が1.0になる場合がある。 + +- C++26 : + 以下の変数を定義する。 + - `r` = [`numeric_limits`](/reference/limits/numeric_limits.md)`::`[`radix`](/reference/limits/numeric_limits/radix.md) + - `R` = `g.`[`max()`](/reference/random/uniform_random_bit_generator.md) `-` `g.`[`min()`](/reference/random/uniform_random_bit_generator.md) `+ 1` + - `d` = min(`digits`, [`numeric_limits`](/reference/limits/numeric_limits.md)`::`[`digits`](/reference/limits/numeric_limits/digits.md)) + - `k` = `R``k` ≥ `r``d` を満たす最小の整数 + - `x` = ⌊`R``k` / `r``d`⌋ + + 以下の手順で乱数を生成する。 + + 1. `g()` を `k` 回呼び出して値 `S` を生成する + 2. `S` ≥ `x` · `r``d` の場合、手順1に戻って再試行する(棄却法) + 3. 戻り値は ⌊`S` / `x`⌋ / `r``d` となる + + この棄却法により、浮動小数点数の丸めで結果が1.0になる問題が解消され、戻り値は必ず0以上1未満となることが保証される。 + + ## 例外 `URBG g` が例外を送出する場合はそれに準ずる。 +## 備考 +- C++23まではアルゴリズムの仕様上、浮動小数点数の丸めにより値`1.0`が生成されることがあった +- C++26では棄却法(reject-and-retry)方式が導入され、戻り値が\[0.0, 1.0\)の範囲内であることが保証されるようになった + + ## 例 ```cpp example #include @@ -80,10 +116,8 @@ int main() - GCC 4.9時点において、`float`型を指定した場合に、値`1.0`が生成されることがあるバグがある([Bug 63176](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63176)) - Clang 3.3時点において、値`1.0`が生成されることがある([Bug 18767](https://llvm.org/bugs/show_bug.cgi?id=18767)) -### 参考 -- N3337 p.909 §26.5.7.2 - - ## 参照 - [P0346R1 A `` Nomenclature Tweak](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0346r1.pdf) - URNGをURBGに変更 +- [P0952R2 A New Specification for `generate_canonical`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p0952r2.html) + - C++26でテンプレートパラメータ名を`bits`から`digits`に変更し、棄却法による新しいアルゴリズムを導入 diff --git a/reference/random/uniform_real_distribution.md b/reference/random/uniform_real_distribution.md index 8fc6e7cf42..dce25840e7 100644 --- a/reference/random/uniform_real_distribution.md +++ b/reference/random/uniform_real_distribution.md @@ -20,6 +20,13 @@ namespace std { - `RealType` : 生成する実数の型。 +## 備考 +- `uniform_real_distribution`の実装は、内部的に[`std::generate_canonical()`](generate_canonical.md)を使用している環境がある + - C++23まではその`std::generate_canonical()`の仕様上、浮動小数点数の丸めにより指定範囲外の値(上限値`b`)が生成されることがあった + - C++26では`std::generate_canonical()`に棄却法が導入されたことで、この問題は解消された + - [P0952R2 A New Specification for `generate_canonical`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p0952r2.html) + + ## メンバ関数 ### 構築・リセット diff --git a/reference/random/uniform_real_distribution/op_constructor.md b/reference/random/uniform_real_distribution/op_constructor.md index 1a51ad19a6..ecab69945a 100644 --- a/reference/random/uniform_real_distribution/op_constructor.md +++ b/reference/random/uniform_real_distribution/op_constructor.md @@ -85,5 +85,3 @@ int main() ## 参照 - [P0935R0 Eradicating unnecessarily explicit default constructors from the standard library](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html) -- [C++ の std::uniform_real_distribution はあまり信用できない。](https://qiita.com/Nabetani/items/b6b5f80c77b92ff8bd9f) - - a ≤ x < b なるx を返すはずであるが、その範囲外の値が返ってくるライブラリ実装が存在することの指摘。 From d47dab17cd59f6d59cdcc3cb74a6657b35d44fc7 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 19 Mar 2026 13:15:46 +0900 Subject: [PATCH 2641/3948] =?UTF-8?q?uniform=5Freal=5Fdistribution=20:=20g?= =?UTF-8?q?enerate=5Fcanonical=E3=83=99=E3=83=BC=E3=82=B9=E3=81=AE?= =?UTF-8?q?=E5=AE=9F=E8=A3=85=E4=BE=8B=E3=82=92=E8=A8=98=E8=BC=89=20#1239?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/random/uniform_real_distribution.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/random/uniform_real_distribution.md b/reference/random/uniform_real_distribution.md index dce25840e7..97f45bc1a2 100644 --- a/reference/random/uniform_real_distribution.md +++ b/reference/random/uniform_real_distribution.md @@ -22,6 +22,7 @@ namespace std { ## 備考 - `uniform_real_distribution`の実装は、内部的に[`std::generate_canonical()`](generate_canonical.md)を使用している環境がある + - `std::generate_canonical::digits>(rng) * (b - a) + a`のようにして、指定された範囲`[a, b)`の値を生成する - C++23まではその`std::generate_canonical()`の仕様上、浮動小数点数の丸めにより指定範囲外の値(上限値`b`)が生成されることがあった - C++26では`std::generate_canonical()`に棄却法が導入されたことで、この問題は解消された - [P0952R2 A New Specification for `generate_canonical`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p0952r2.html) From 9de18187ebb3d7adb208ca6911c9b47e78580d35 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Sat, 21 Mar 2026 23:12:53 +0900 Subject: [PATCH 2642/3948] =?UTF-8?q?=E3=82=B5=E3=83=B3=E3=83=97=E3=83=AB?= =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E3=81=AE=20print=20=E3=82=92=20::pr?= =?UTF-8?q?int=20=E3=81=AB=E7=BD=AE=E6=8F=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 以下の正規表現にマッチするものを一括変換しました。 (print\("[^"]*",[^,]+\);) いくつかのサンプルコードで出力用に print という関数を作っていますが、その名前解決において std::print が参入してきて曖昧になっていました。 --- reference/algorithm/partition_copy.md | 6 ++--- reference/algorithm/partition_point.md | 2 +- reference/algorithm/ranges_partition_copy.md | 6 ++--- reference/algorithm/ranges_partition_point.md | 2 +- reference/algorithm/ranges_unique.md | 4 ++-- reference/algorithm/ranges_unique_copy.md | 4 ++-- reference/algorithm/unique.md | 4 ++-- reference/algorithm/unique_copy.md | 4 ++-- reference/array/array/swap.md | 4 ++-- reference/array/array/swap_free.md | 4 ++-- reference/deque/deque/assign.md | 6 ++--- reference/deque/deque/op_assign.md | 6 ++--- reference/deque/deque/op_constructor.md | 14 ++++++------ reference/deque/deque/swap.md | 4 ++-- reference/deque/deque/swap_free.md | 4 ++-- reference/flat_map/flat_map/swap.md | 4 ++-- reference/flat_map/flat_map/swap_free.md | 4 ++-- reference/flat_map/flat_multimap/swap.md | 4 ++-- reference/flat_map/flat_multimap/swap_free.md | 4 ++-- reference/flat_set/flat_multiset/swap.md | 4 ++-- reference/flat_set/flat_multiset/swap_free.md | 4 ++-- reference/flat_set/flat_set/swap.md | 4 ++-- reference/flat_set/flat_set/swap_free.md | 4 ++-- reference/forward_list/forward_list/assign.md | 6 ++--- .../forward_list/forward_list/insert_after.md | 8 +++---- .../forward_list/op_constructor.md | 14 ++++++------ .../forward_list/forward_list/swap_free.md | 4 ++-- reference/list/list/assign.md | 6 ++--- reference/list/list/insert.md | 8 +++---- reference/list/list/op_constructor.md | 14 ++++++------ reference/list/list/swap_free.md | 4 ++-- reference/map/map/swap.md | 4 ++-- reference/map/map/swap_free.md | 4 ++-- reference/map/multimap/swap.md | 4 ++-- reference/map/multimap/swap_free.md | 4 ++-- .../unordered_map/unordered_map/erase.md | 12 +++++----- .../unordered_map/unordered_map/insert.md | 12 +++++----- reference/unordered_map/unordered_map/swap.md | 8 +++---- .../unordered_map/unordered_map/swap_free.md | 4 ++-- .../unordered_map/unordered_multimap/erase.md | 12 +++++----- .../unordered_multimap/insert.md | 12 +++++----- .../unordered_map/unordered_multimap/swap.md | 8 +++---- .../unordered_multimap/swap_free.md | 4 ++-- .../unordered_set/unordered_multiset/erase.md | 12 +++++----- .../unordered_multiset/insert.md | 8 +++---- .../unordered_multiset/op_equal.md | 6 ++--- .../unordered_multiset/op_not_equal.md | 6 ++--- .../unordered_set/unordered_multiset/swap.md | 8 +++---- .../unordered_multiset/swap_free.md | 8 +++---- .../unordered_set/unordered_set/erase.md | 12 +++++----- .../unordered_set/unordered_set/insert.md | 8 +++---- .../unordered_set/unordered_set/op_equal.md | 6 ++--- .../unordered_set/op_not_equal.md | 6 ++--- reference/unordered_set/unordered_set/swap.md | 8 +++---- .../unordered_set/unordered_set/swap_free.md | 8 +++---- reference/utility/pair/op_assign.md | 8 +++---- reference/utility/pair/op_constructor.md | 16 +++++++------- reference/utility/pair/swap.md | 4 ++-- reference/utility/pair/swap_free.md | 4 ++-- reference/valarray/gslice_array/op_assign.md | 6 ++--- .../valarray/indirect_array/op_assign.md | 6 ++--- reference/valarray/mask_array/op_assign.md | 6 ++--- reference/valarray/slice_array/op_assign.md | 6 ++--- reference/valarray/valarray.md | 16 +++++++------- reference/valarray/valarray/atan2.md | 6 ++--- reference/valarray/valarray/cshift.md | 4 ++-- reference/valarray/valarray/log.md | 4 ++-- reference/valarray/valarray/op_assign.md | 16 +++++++------- reference/valarray/valarray/op_constructor.md | 22 +++++++++---------- reference/valarray/valarray/op_divide.md | 6 ++--- .../valarray/valarray/op_divide_assign.md | 4 ++-- reference/valarray/valarray/op_minus.md | 6 ++--- .../valarray/valarray/op_minus_assign.md | 4 ++-- reference/valarray/valarray/op_modulo.md | 6 ++--- .../valarray/valarray/op_modulo_assign.md | 4 ++-- reference/valarray/valarray/op_multiply.md | 6 ++--- .../valarray/valarray/op_multiply_assign.md | 4 ++-- reference/valarray/valarray/op_plus.md | 6 ++--- reference/valarray/valarray/op_plus_assign.md | 4 ++-- reference/valarray/valarray/pow.md | 6 ++--- reference/valarray/valarray/shift.md | 4 ++-- reference/valarray/valarray/swap.md | 4 ++-- reference/valarray/valarray/swap_free.md | 4 ++-- reference/vector/vector/erase.md | 4 ++-- reference/vector/vector/op_constructor.md | 12 +++++----- reference/vector/vector/swap.md | 4 ++-- reference/vector/vector/swap_free.md | 4 ++-- 87 files changed, 285 insertions(+), 285 deletions(-) diff --git a/reference/algorithm/partition_copy.md b/reference/algorithm/partition_copy.md index cdcac74000..01c505ee23 100644 --- a/reference/algorithm/partition_copy.md +++ b/reference/algorithm/partition_copy.md @@ -100,9 +100,9 @@ int main() std::back_inserter(odds), is_even); - print("v", v); - print("evens", evens); - print("odds", odds); + ::print("v", v); + ::print("evens", evens); + ::print("odds", odds); } ``` * std::partition_copy[color ff0000] diff --git a/reference/algorithm/partition_point.md b/reference/algorithm/partition_point.md index 88cfab5d63..49ad6ac36a 100644 --- a/reference/algorithm/partition_point.md +++ b/reference/algorithm/partition_point.md @@ -66,7 +66,7 @@ int main() // 偶数グループと奇数グループに分かれた位置を得る decltype(v)::iterator it = std::partition_point(v.begin(), v.end(), is_even); - print("v", v); + ::print("v", v); std::cout << *it << std::endl; } ``` diff --git a/reference/algorithm/ranges_partition_copy.md b/reference/algorithm/ranges_partition_copy.md index 0cf6d1f51b..c8994fb52c 100644 --- a/reference/algorithm/ranges_partition_copy.md +++ b/reference/algorithm/ranges_partition_copy.md @@ -135,9 +135,9 @@ int main() std::vector odds; std::ranges::partition_copy(v, std::back_inserter(evens), std::back_inserter(odds), is_even); - print("v", v); - print("evens", evens); - print("odds", odds); + ::print("v", v); + ::print("evens", evens); + ::print("odds", odds); } ``` * std::ranges::partition_copy[color ff0000] diff --git a/reference/algorithm/ranges_partition_point.md b/reference/algorithm/ranges_partition_point.md index 58d7348916..3038eaf6a9 100644 --- a/reference/algorithm/ranges_partition_point.md +++ b/reference/algorithm/ranges_partition_point.md @@ -72,7 +72,7 @@ int main() // 偶数グループと奇数グループに分かれた位置を得る auto it = std::ranges::partition_point(v, is_even); - print("v", v); + ::print("v", v); std::cout << *it << std::endl; } ``` diff --git a/reference/algorithm/ranges_unique.md b/reference/algorithm/ranges_unique.md index 04d0306714..ece2fce076 100644 --- a/reference/algorithm/ranges_unique.md +++ b/reference/algorithm/ranges_unique.md @@ -122,7 +122,7 @@ int main() { // 不要になった要素を削除 v.erase(result.begin(), result.end()); - print("unsorted unique", v); + ::print("unsorted unique", v); } // 入力の配列がソート済みである場合、 @@ -136,7 +136,7 @@ int main() { // 不要になった要素を削除 v.erase(result.begin(), result.end()); - print("sorted unique", v); + ::print("sorted unique", v); } } ``` diff --git a/reference/algorithm/ranges_unique_copy.md b/reference/algorithm/ranges_unique_copy.md index 30c2fbe5e4..8945165710 100644 --- a/reference/algorithm/ranges_unique_copy.md +++ b/reference/algorithm/ranges_unique_copy.md @@ -141,7 +141,7 @@ int main() { // 重複を除いた要素がuniquedに追加されていく std::ranges::unique_copy(v, std::back_inserter(uniqued)); - print("unsorted unique", uniqued); + ::print("unsorted unique", uniqued); } // 入力の配列がソート済みである場合、 @@ -153,7 +153,7 @@ int main() { std::ranges::sort(v); std::ranges::unique_copy(v, std::back_inserter(uniqued)); - print("sorted unique", uniqued); + ::print("sorted unique", uniqued); } } ``` diff --git a/reference/algorithm/unique.md b/reference/algorithm/unique.md index 84dfa2265c..0a4a38adbc 100644 --- a/reference/algorithm/unique.md +++ b/reference/algorithm/unique.md @@ -108,7 +108,7 @@ int main() { // 不要になった要素を削除 v.erase(result, v.end()); - print("unsorted unique", v); + ::print("unsorted unique", v); } // 入力の配列がソート済みである場合、 @@ -122,7 +122,7 @@ int main() { // 不要になった要素を削除 v.erase(result, v.end()); - print("sorted unique", v); + ::print("sorted unique", v); } } ``` diff --git a/reference/algorithm/unique_copy.md b/reference/algorithm/unique_copy.md index 875fdfd84f..4ad197b380 100644 --- a/reference/algorithm/unique_copy.md +++ b/reference/algorithm/unique_copy.md @@ -114,7 +114,7 @@ int main() { // 重複を除いた要素がuniquedに追加されていく std::unique_copy(v.begin(), v.end(), std::back_inserter(uniqued)); - print("unsorted unique", uniqued); + ::print("unsorted unique", uniqued); } // 入力の配列がソート済みである場合、 @@ -126,7 +126,7 @@ int main() { std::sort(v.begin(), v.end()); std::unique_copy(v.begin(), v.end(), std::back_inserter(uniqued)); - print("sorted unique", uniqued); + ::print("sorted unique", uniqued); } } ``` diff --git a/reference/array/array/swap.md b/reference/array/array/swap.md index 726204c14b..b01da759a1 100644 --- a/reference/array/array/swap.md +++ b/reference/array/array/swap.md @@ -62,8 +62,8 @@ int main() x.swap(y); - print("x", x); - print("y", y); + ::print("x", x); + ::print("y", y); } ``` * swap[color ff0000] diff --git a/reference/array/array/swap_free.md b/reference/array/array/swap_free.md index f68c39ed58..37ff24d8b2 100644 --- a/reference/array/array/swap_free.md +++ b/reference/array/array/swap_free.md @@ -55,8 +55,8 @@ int main () std::swap(x, y); - print("x", x); - print("y", y); + ::print("x", x); + ::print("y", y); } ``` * std::swap[color ff0000] diff --git a/reference/deque/deque/assign.md b/reference/deque/deque/assign.md index a339584cf9..e94aae9c31 100644 --- a/reference/deque/deque/assign.md +++ b/reference/deque/deque/assign.md @@ -65,9 +65,9 @@ int main () std::deque c3; c3.assign({1, 2, 3}); - print("c1", c1); - print("c2", c2); - print("c3", c3); + ::print("c1", c1); + ::print("c2", c2); + ::print("c3", c3); } ``` * assign[color ff0000] diff --git a/reference/deque/deque/op_assign.md b/reference/deque/deque/op_assign.md index 625cc558e9..5de1aa5c8e 100644 --- a/reference/deque/deque/op_assign.md +++ b/reference/deque/deque/op_assign.md @@ -73,9 +73,9 @@ int main () std::deque c3; c3 = {1, 2, 3}; - print("c1", c1); - print("c2", c2); - print("c3", c3); + ::print("c1", c1); + ::print("c2", c2); + ::print("c3", c3); } ``` * std::move[link /reference/utility/move.md] diff --git a/reference/deque/deque/op_constructor.md b/reference/deque/deque/op_constructor.md index 9d63882fa7..448657d57f 100644 --- a/reference/deque/deque/op_constructor.md +++ b/reference/deque/deque/op_constructor.md @@ -202,13 +202,13 @@ int main () // (10) : 初期化子リストによる構築 std::deque c7 = {1, 2, 3}; - print("c1", c1); - print("c2", c2); - print("c3", c3); - print("c4", c4); - print("c5", c5); - print("c6", c6); - print("c7", c7); + ::print("c1", c1); + ::print("c2", c2); + ::print("c3", c3); + ::print("c4", c4); + ::print("c5", c5); + ::print("c6", c6); + ::print("c7", c7); } ``` * begin()[link begin.md] diff --git a/reference/deque/deque/swap.md b/reference/deque/deque/swap.md index fc43ef9f57..d2f40c156a 100644 --- a/reference/deque/deque/swap.md +++ b/reference/deque/deque/swap.md @@ -59,8 +59,8 @@ int main() c1.swap(c2); - print("c1", c1); - print("c2", c2); + ::print("c1", c1); + ::print("c2", c2); } ``` * swap[color ff0000] diff --git a/reference/deque/deque/swap_free.md b/reference/deque/deque/swap_free.md index 5810d54a2e..8c79151148 100644 --- a/reference/deque/deque/swap_free.md +++ b/reference/deque/deque/swap_free.md @@ -58,8 +58,8 @@ int main() std::swap(c1, c2); - print("c1", c1); - print("c2", c2); + ::print("c1", c1); + ::print("c2", c2); } ``` * std::swap[color ff0000] diff --git a/reference/flat_map/flat_map/swap.md b/reference/flat_map/flat_map/swap.md index 7a2c6a1129..bc48127536 100644 --- a/reference/flat_map/flat_map/swap.md +++ b/reference/flat_map/flat_map/swap.md @@ -64,8 +64,8 @@ int main() // fm1とfm2を入れ替える fm1.swap(fm2); - print("fm1", fm1); - print("fm2", fm2); + ::print("fm1", fm1); + ::print("fm2", fm2); } ``` * swap[color ff0000] diff --git a/reference/flat_map/flat_map/swap_free.md b/reference/flat_map/flat_map/swap_free.md index fed5304231..c152b53a9a 100644 --- a/reference/flat_map/flat_map/swap_free.md +++ b/reference/flat_map/flat_map/swap_free.md @@ -66,8 +66,8 @@ int main() // fm1とfm2を入れ替える std::swap(fm1, fm2); - print("fm1", fm1); - print("fm2", fm2); + ::print("fm1", fm1); + ::print("fm2", fm2); } ``` * std::swap[color ff0000] diff --git a/reference/flat_map/flat_multimap/swap.md b/reference/flat_map/flat_multimap/swap.md index 9002d99526..386ca3874c 100644 --- a/reference/flat_map/flat_multimap/swap.md +++ b/reference/flat_map/flat_multimap/swap.md @@ -64,8 +64,8 @@ int main() // fm1とfm2を入れ替える fm1.swap(fm2); - print("fm1", fm1); - print("fm2", fm2); + ::print("fm1", fm1); + ::print("fm2", fm2); } ``` * swap[color ff0000] diff --git a/reference/flat_map/flat_multimap/swap_free.md b/reference/flat_map/flat_multimap/swap_free.md index a21a02ec82..661f6e71ff 100644 --- a/reference/flat_map/flat_multimap/swap_free.md +++ b/reference/flat_map/flat_multimap/swap_free.md @@ -66,8 +66,8 @@ int main() // fm1とfm2を入れ替える std::swap(fm1, fm2); - print("fm1", fm1); - print("fm2", fm2); + ::print("fm1", fm1); + ::print("fm2", fm2); } ``` * std::swap[color ff0000] diff --git a/reference/flat_set/flat_multiset/swap.md b/reference/flat_set/flat_multiset/swap.md index 67ab777cda..29cbdca2e8 100644 --- a/reference/flat_set/flat_multiset/swap.md +++ b/reference/flat_set/flat_multiset/swap.md @@ -56,8 +56,8 @@ int main() // fs1とfs2を入れ替える fs1.swap(fs2); - print("fs1", fs1); - print("fs2", fs2); + ::print("fs1", fs1); + ::print("fs2", fs2); } ``` * swap[color ff0000] diff --git a/reference/flat_set/flat_multiset/swap_free.md b/reference/flat_set/flat_multiset/swap_free.md index 4e991b7687..07372ed4e0 100644 --- a/reference/flat_set/flat_multiset/swap_free.md +++ b/reference/flat_set/flat_multiset/swap_free.md @@ -59,8 +59,8 @@ int main() // fs1とfs2を入れ替える std::swap(fs1, fs2); - print("fs1", fs1); - print("fs2", fs2); + ::print("fs1", fs1); + ::print("fs2", fs2); } ``` * std::swap[color ff0000] diff --git a/reference/flat_set/flat_set/swap.md b/reference/flat_set/flat_set/swap.md index 2195c3446b..22c5162b51 100644 --- a/reference/flat_set/flat_set/swap.md +++ b/reference/flat_set/flat_set/swap.md @@ -56,8 +56,8 @@ int main() // fs1とfs2を入れ替える fs1.swap(fs2); - print("fs1", fs1); - print("fs2", fs2); + ::print("fs1", fs1); + ::print("fs2", fs2); } ``` * swap[color ff0000] diff --git a/reference/flat_set/flat_set/swap_free.md b/reference/flat_set/flat_set/swap_free.md index fd2e418efa..f8e513e6e7 100644 --- a/reference/flat_set/flat_set/swap_free.md +++ b/reference/flat_set/flat_set/swap_free.md @@ -59,8 +59,8 @@ int main() // fs1とfs2を入れ替える std::swap(fs1, fs2); - print("fs1", fs1); - print("fs2", fs2); + ::print("fs1", fs1); + ::print("fs2", fs2); } ``` * std::swap[color ff0000] diff --git a/reference/forward_list/forward_list/assign.md b/reference/forward_list/forward_list/assign.md index 680b3dc735..125f33dfc8 100644 --- a/reference/forward_list/forward_list/assign.md +++ b/reference/forward_list/forward_list/assign.md @@ -89,7 +89,7 @@ int main() std::forward_list ls1; ls1.assign(ls.begin(), ls.end()); - print("ls1", ls1); + ::print("ls1", ls1); } // n個の指定された値で埋める @@ -97,7 +97,7 @@ int main() std::forward_list ls2; ls2.assign(3, 1); - print("ls2", ls2); + ::print("ls2", ls2); } // 初期化子リストを代入 @@ -105,7 +105,7 @@ int main() std::forward_list ls3; ls3.assign({1, 2, 3}); - print("ls3", ls3); + ::print("ls3", ls3); } } ``` diff --git a/reference/forward_list/forward_list/insert_after.md b/reference/forward_list/forward_list/insert_after.md index 88496c15bc..e688697ec8 100644 --- a/reference/forward_list/forward_list/insert_after.md +++ b/reference/forward_list/forward_list/insert_after.md @@ -109,7 +109,7 @@ int main() decltype(ls)::iterator it = std::next(ls.begin(), 2); ls.insert_after(it, 3); - print("insert one element", ls); + ::print("insert one element", ls); } // n個の要素を挿入する { @@ -118,7 +118,7 @@ int main() // 2の後ろに3を2個挿入する ls.insert_after(std::next(ls.begin(), 1), 2, 3); - print("insert n elements", ls); + ::print("insert n elements", ls); } // 指定範囲の要素を挿入する { @@ -128,7 +128,7 @@ int main() const std::vector v = {3, 4, 5}; ls.insert_after(std::next(ls.begin(), 1), v.begin(), v.end()); - print("insert range", ls); + ::print("insert range", ls); } // 初期化子リストで要素を挿入する { @@ -136,7 +136,7 @@ int main() ls.insert_after(std::next(ls.begin(), 1), {3, 4, 5}); - print("insert initializer_list", ls); + ::print("insert initializer_list", ls); } } ``` diff --git a/reference/forward_list/forward_list/op_constructor.md b/reference/forward_list/forward_list/op_constructor.md index 38b877b81c..8d364bd6c3 100644 --- a/reference/forward_list/forward_list/op_constructor.md +++ b/reference/forward_list/forward_list/op_constructor.md @@ -171,31 +171,31 @@ int main() { // (1) デフォルト構築 std::forward_list ls1; - print("ls1", ls1); + ::print("ls1", ls1); // (4) n個の要素を持つリストを作成 std::forward_list ls2(3); - print("ls2", ls2); + ::print("ls2", ls2); // (3) n個の指定された値を要素を持つリストを作成 std::forward_list ls3(3, 1); - print("ls3", ls3); + ::print("ls3", ls3); // (5) 範囲から構築 std::forward_list ls4(ls3.begin(), ls3.end()); - print("ls4", ls4); + ::print("ls4", ls4); // (6) コピー構築 std::forward_list ls5 = ls4; - print("ls5", ls5); + ::print("ls5", ls5); // (7) ムーブ構築 std::forward_list ls6 = std::move(ls5); - print("ls6", ls6); + ::print("ls6", ls6); // (10) 初期化子リストで構築 std::forward_list ls7 = {1, 2, 3}; - print("ls7", ls7); + ::print("ls7", ls7); } ``` * begin[link begin.md] diff --git a/reference/forward_list/forward_list/swap_free.md b/reference/forward_list/forward_list/swap_free.md index 16206ff9e9..96d830baf4 100644 --- a/reference/forward_list/forward_list/swap_free.md +++ b/reference/forward_list/forward_list/swap_free.md @@ -57,8 +57,8 @@ int main() std::swap(ls1, ls2); - print("ls1", ls1); - print("ls2", ls2); + ::print("ls1", ls1); + ::print("ls2", ls2); } ``` * std::swap[color ff0000] diff --git a/reference/list/list/assign.md b/reference/list/list/assign.md index bb84635288..81f419f006 100644 --- a/reference/list/list/assign.md +++ b/reference/list/list/assign.md @@ -90,7 +90,7 @@ int main() std::list ls1; ls1.assign(ls.begin(), ls.end()); - print("ls1", ls1); + ::print("ls1", ls1); } // n 個の指定された値で埋める @@ -98,7 +98,7 @@ int main() std::list ls2; ls2.assign(3, 1); - print("ls2", ls2); + ::print("ls2", ls2); } // 初期化子リストを代入 @@ -106,7 +106,7 @@ int main() std::list ls3; ls3.assign({ 1, 2, 3 }); - print("ls3", ls3); + ::print("ls3", ls3); } } ``` diff --git a/reference/list/list/insert.md b/reference/list/list/insert.md index 68f9647c58..4033a5c46e 100644 --- a/reference/list/list/insert.md +++ b/reference/list/list/insert.md @@ -119,7 +119,7 @@ int main() decltype(ls)::iterator it = std::next(ls.begin(), 3); ls.insert(it, 3); - print("insert one element", ls); + ::print("insert one element", ls); } // n個の要素を挿入する { @@ -128,7 +128,7 @@ int main() // 5の前に3を2個挿入する ls.insert(std::next(ls.begin(), 2), 2, 3); - print("insert n elements", ls); + ::print("insert n elements", ls); } // 指定範囲の要素を挿入する { @@ -138,7 +138,7 @@ int main() const std::vector v = {3, 4, 5}; ls.insert(std::next(ls.begin(), 2), v.begin(), v.end()); - print("insert range", ls); + ::print("insert range", ls); } // 初期化子リストで要素を挿入する { @@ -146,7 +146,7 @@ int main() ls.insert(std::next(ls.begin(), 2), {3, 4, 5}); - print("insert initializer_list", ls); + ::print("insert initializer_list", ls); } } ``` diff --git a/reference/list/list/op_constructor.md b/reference/list/list/op_constructor.md index 3ccf45d334..67652bd32f 100644 --- a/reference/list/list/op_constructor.md +++ b/reference/list/list/op_constructor.md @@ -168,31 +168,31 @@ int main () { // デフォルト構築 std::list ls1; - print("ls1", ls1); + ::print("ls1", ls1); // n 個の要素を持つリストを作成 std::list ls2(3); - print("ls2", ls2); + ::print("ls2", ls2); // n 個の指定された値を要素に持つリストを作成 std::list ls3(3, 1); - print("ls3", ls3); + ::print("ls3", ls3); // 範囲から構築 std::list ls4(ls3.begin(), ls3.end()); - print("ls4", ls4); + ::print("ls4", ls4); // コピー構築 std::list ls5 = ls4; - print("ls5", ls5); + ::print("ls5", ls5); // ムーブ構築 std::list ls6 = std::move(ls5); - print("ls6", ls6); + ::print("ls6", ls6); // 初期化子リストで構築 std::list ls7 = { 1, 2, 3 }; - print("ls7", ls7); + ::print("ls7", ls7); } ``` * std::move[link ../../utility/move.md] diff --git a/reference/list/list/swap_free.md b/reference/list/list/swap_free.md index dde7b68d05..d149176ee1 100644 --- a/reference/list/list/swap_free.md +++ b/reference/list/list/swap_free.md @@ -58,8 +58,8 @@ int main() std::swap(ls1, ls2); - print("ls1", ls1); - print("ls2", ls2); + ::print("ls1", ls1); + ::print("ls2", ls2); } ``` * std::swap[color ff0000] diff --git a/reference/map/map/swap.md b/reference/map/map/swap.md index 51387a65aa..15b1658a85 100644 --- a/reference/map/map/swap.md +++ b/reference/map/map/swap.md @@ -61,8 +61,8 @@ int main() // m1とm2を入れ替える m1.swap(m2); - print("m1", m1); - print("m2", m2); + ::print("m1", m1); + ::print("m2", m2); } ``` diff --git a/reference/map/map/swap_free.md b/reference/map/map/swap_free.md index 722fee6407..31a8570d53 100644 --- a/reference/map/map/swap_free.md +++ b/reference/map/map/swap_free.md @@ -70,8 +70,8 @@ int main() // m1とm2を入れ替える std::swap(m1, m2); - print("m1", m1); - print("m2", m2); + ::print("m1", m1); + ::print("m2", m2); } ``` * std::swap[color ff0000] diff --git a/reference/map/multimap/swap.md b/reference/map/multimap/swap.md index df7863e8fa..715658e567 100644 --- a/reference/map/multimap/swap.md +++ b/reference/map/multimap/swap.md @@ -59,8 +59,8 @@ int main() // m1とm2を入れ替える m1.swap(m2); - print("m1", m1); - print("m2", m2); + ::print("m1", m1); + ::print("m2", m2); } ``` * swap[color ff0000] diff --git a/reference/map/multimap/swap_free.md b/reference/map/multimap/swap_free.md index 3d803225b9..de561abf98 100644 --- a/reference/map/multimap/swap_free.md +++ b/reference/map/multimap/swap_free.md @@ -68,8 +68,8 @@ int main() // m1とm2を入れ替える std::swap(m1, m2); - print("m1", m1); - print("m2", m2); + ::print("m1", m1); + ::print("m2", m2); } ``` * std::swap[color ff0000] diff --git a/reference/unordered_map/unordered_map/erase.md b/reference/unordered_map/unordered_map/erase.md index 339a1fc492..2b68b0de27 100644 --- a/reference/unordered_map/unordered_map/erase.md +++ b/reference/unordered_map/unordered_map/erase.md @@ -90,40 +90,40 @@ int main() // 指定した位置にある要素を削除((1)の形式) { std::unordered_map um{ {"1st", 1}, {"3rd", 3}, {"5th", 5}, {"7th", 7}, {"9th", 9}, }; - print("(1) erase(const_iterator) before", um); + ::print("(1) erase(const_iterator) before", um); auto it1 = std::next(um.cbegin(), 3); std::cout << "argument: " << *it1 << '\n'; auto it2 = um.erase(it1); std::cout << "return value: " << *it2 << '\n'; - print("after", um); + ::print("after", um); std::cout << std::endl; } // 指定したキーと等価な要素を削除((3)の形式) { std::unordered_map um{ {"1st", 1}, {"3rd", 3}, {"5th", 5}, {"7th", 7}, {"9th", 9}, }; - print("(3) erase(const value_type&) before", um); + ::print("(3) erase(const value_type&) before", um); auto count1 = um.erase("5th"); auto count2 = um.erase("8th"); std::cout << "argument: 5th, 8th" << '\n'; std::cout << "return value: " << count1 << ", " << count2 << '\n'; - print("after", um); + ::print("after", um); std::cout << std::endl; } // 指定した位置にある要素を削除((4)の形式) { std::unordered_map um{ {"1st", 1}, {"3rd", 3}, {"5th", 5}, {"7th", 7}, {"9th", 9}, }; - print("(4) erase(const_iterator, const_iterator) before", um); + ::print("(4) erase(const_iterator, const_iterator) before", um); auto it1 = std::next(um.cbegin()); auto it2 = std::next(it1, 2); std::cout << "arguments: " << *it1 << ", " << *it2 << '\n'; auto it3 = um.erase(it1, it2); std::cout << "return value: " << *it3 << '\n'; - print("after", um); + ::print("after", um); std::cout << std::endl; } } diff --git a/reference/unordered_map/unordered_map/insert.md b/reference/unordered_map/unordered_map/insert.md index 7b90433c37..6a97725380 100644 --- a/reference/unordered_map/unordered_map/insert.md +++ b/reference/unordered_map/unordered_map/insert.md @@ -177,7 +177,7 @@ int main() std::cout << p1.second << ' ' << *p1.first << ' '; auto p2 = um.insert(cis{2, "2nd"}); // 追加されないケース std::cout << p2.second << ' ' << *p2.first << std::endl; - print("insert one element", um); + ::print("insert one element", um); } // 一つの要素を挿入((3)の形式) @@ -188,7 +188,7 @@ int main() std::cout << p1.second << ' ' << *p1.first << ' '; auto p2 = um.insert(is{2, "2nd"}); // 追加されないケース std::cout << p2.second << ' ' << *p2.first << std::endl; - print("insert one element", um); + ::print("insert one element", um); } // 一つの要素を挿入((4), (5)の形式) @@ -199,7 +199,7 @@ int main() std::cout << *it1 << ' '; auto it2 = um.insert(um.cbegin(), cis{2, "2nd"}); // 追加されないケース std::cout << *it2 << std::endl; - print("insert one element with hint", um); + ::print("insert one element with hint", um); } // 一つの要素を挿入((6)の形式) @@ -210,7 +210,7 @@ int main() std::cout << *it1 << ' '; auto it2 = um.insert(um.cbegin(), is{2, "2nd"}); // 追加されないケース std::cout << *it2 << std::endl; - print("insert one element with hint", um); + ::print("insert one element with hint", um); } // 複数の要素を挿入((7)の形式) @@ -219,7 +219,7 @@ int main() std::forward_list> fl{ {5, "5th"}, {6, "6th"}, {0, "0th"}, {8, "8th"}, {7, "7th"}, }; um.insert(fl.cbegin(), fl.cend()); // forward_list の要素を全部 - print("insert range", um); + ::print("insert range", um); } // 複数の要素を挿入((8)の形式) @@ -227,7 +227,7 @@ int main() std::unordered_map um{ {0, "zero"}, {1, "one"}, {2, "two"}, {3, "three"}, {4, "four"}, {5, "five"}, }; um.insert({ {5, "5th"}, {6, "6th"}, {0, "0th"}, {8, "8th"}, {7, "7th"}, }); - print("insert initializer_list", um); + ::print("insert initializer_list", um); } } ``` diff --git a/reference/unordered_map/unordered_map/swap.md b/reference/unordered_map/unordered_map/swap.md index 8d44cd9139..d650b26de7 100644 --- a/reference/unordered_map/unordered_map/swap.md +++ b/reference/unordered_map/unordered_map/swap.md @@ -72,14 +72,14 @@ int main() std::unordered_map um1{ {"1st", 1}, {"3rd", 3}, {"5th", 5}, {"7th", 7}, {"9th", 9}, }; std::unordered_map um2{ {"0th", 0}, {"2nd", 2}, {"4th", 4}, {"6th", 6}, {"8th", 8}, }; - print("um1 before", um1); - print("um2 before", um2); + ::print("um1 before", um1); + ::print("um2 before", um2); std::cout << std::endl; um1.swap(um2); - print("um1 after", um1); - print("um2 after", um2); + ::print("um1 after", um1); + ::print("um2 after", um2); } ``` * swap[color ff0000] diff --git a/reference/unordered_map/unordered_map/swap_free.md b/reference/unordered_map/unordered_map/swap_free.md index d2019a05cb..6a4f505a92 100644 --- a/reference/unordered_map/unordered_map/swap_free.md +++ b/reference/unordered_map/unordered_map/swap_free.md @@ -74,8 +74,8 @@ int main() // c1とc2を入れ替える std::swap(um1, um2); - print("um1", um1); - print("um2", um2); + ::print("um1", um1); + ::print("um2", um2); } ``` * std::swap[color ff0000] diff --git a/reference/unordered_map/unordered_multimap/erase.md b/reference/unordered_map/unordered_multimap/erase.md index dac6320c1c..ba3822dc3c 100644 --- a/reference/unordered_map/unordered_multimap/erase.md +++ b/reference/unordered_map/unordered_multimap/erase.md @@ -90,41 +90,41 @@ int main() // 指定した位置にある要素を削除((1)の形式) { std::unordered_multimap um{ {"1st", 1}, {"3rd", 3}, {"5th", 5}, {"7th", 7}, {"9th", 9}, {"3rd", 33}, }; - print("(1) erase(const_iterator) before", um); + ::print("(1) erase(const_iterator) before", um); auto it1 = um.find("3rd"); std::cout << "argument: " << *it1 << '\n'; auto it2 = um.erase(it1); std::cout << "return value: " << *it2 << '\n'; - print("after", um); + ::print("after", um); std::cout << std::endl; } // 指定したキーと等価な要素を削除((3)の形式) { std::unordered_multimap um{ {"1st", 1}, {"3rd", 3}, {"5th", 5}, {"7th", 7}, {"9th", 9}, {"3rd", 33}, }; - print("(3) erase(const value_type&) before", um); + ::print("(3) erase(const value_type&) before", um); auto count1 = um.erase("5th"); auto count2 = um.erase("8th"); auto count3 = um.erase("3rd"); std::cout << "argument: 5th, 8th, 3rd" << '\n'; std::cout << "return value: " << count1 << ", " << count2 << ", " << count3 << '\n'; - print("after", um); + ::print("after", um); std::cout << std::endl; } // 指定した位置にある要素を削除((4)の形式) { std::unordered_multimap um{ {"1st", 1}, {"3rd", 3}, {"5th", 5}, {"7th", 7}, {"9th", 9}, {"3rd", 33}, }; - print("(4) erase(const_iterator, const_iterator) before", um); + ::print("(4) erase(const_iterator, const_iterator) before", um); auto it1 = std::next(um.cbegin()); auto it2 = std::next(it1, 2); std::cout << "arguments: " << *it1 << ", " << *it2 << '\n'; auto it3 = um.erase(it1, it2); std::cout << "return value: " << *it3 << '\n'; - print("after", um); + ::print("after", um); std::cout << std::endl; } } diff --git a/reference/unordered_map/unordered_multimap/insert.md b/reference/unordered_map/unordered_multimap/insert.md index 2dfcf1e491..b78468dd03 100644 --- a/reference/unordered_map/unordered_multimap/insert.md +++ b/reference/unordered_map/unordered_multimap/insert.md @@ -166,7 +166,7 @@ int main() std::cout << *it1 << ' '; auto it2 = um.insert(cis{2, "2nd"}); // 重複のあるケース std::cout << *it2 << std::endl; - print("insert one element", um); + ::print("insert one element", um); } // 一つの要素を挿入((3)の形式) @@ -177,7 +177,7 @@ int main() std::cout << *it1 << ' '; auto it2 = um.insert(is{2, "2nd"}); // 重複のあるケース std::cout << *it2 << std::endl; - print("insert one element", um); + ::print("insert one element", um); } // 一つの要素を挿入((4), (5)の形式) @@ -188,7 +188,7 @@ int main() std::cout << *it1 << ' '; auto it2 = um.insert(um.cbegin(), cis{2, "2nd"}); // 重複のあるケース std::cout << *it2 << std::endl; - print("insert one element with hint", um); + ::print("insert one element with hint", um); } // 一つの要素を挿入((6)の形式) @@ -199,7 +199,7 @@ int main() std::cout << *it1 << ' '; auto it2 = um.insert(um.cbegin(), is{2, "2nd"}); // 重複のあるケース std::cout << *it2 << std::endl; - print("insert one element with hint", um); + ::print("insert one element with hint", um); } // 複数の要素を挿入((7)の形式) @@ -208,7 +208,7 @@ int main() std::forward_list> fl{ {5, "5th"}, {6, "6th"}, {0, "0th"}, {8, "8th"}, {7, "7th"}, }; um.insert(fl.cbegin(), fl.cend()); // forward_list の要素を全部 - print("insert range", um); + ::print("insert range", um); } // 複数の要素を挿入((8)の形式) @@ -216,7 +216,7 @@ int main() std::unordered_multimap um{ {0, "zero"}, {1, "one"}, {2, "two"}, {3, "three"}, {4, "four"}, {5, "five"}, }; um.insert({ {5, "5th"}, {6, "6th"}, {0, "0th"}, {8, "8th"}, {7, "7th"}, }); - print("insert initializer_list", um); + ::print("insert initializer_list", um); } } ``` diff --git a/reference/unordered_map/unordered_multimap/swap.md b/reference/unordered_map/unordered_multimap/swap.md index ee4be96973..9f1e312859 100644 --- a/reference/unordered_map/unordered_multimap/swap.md +++ b/reference/unordered_map/unordered_multimap/swap.md @@ -72,14 +72,14 @@ int main() std::unordered_multimap um1{ {"1st", 1}, {"3rd", 3}, {"5th", 5}, {"7th", 7}, {"9th", 9}, {"1st", 1}, {"3rd", 3}, {"5th", 5}, {"7th", 7}, {"9th", 9}, }; std::unordered_multimap um2{ {"0th", 0}, {"2nd", 2}, {"4th", 4}, {"6th", 6}, {"8th", 8}, {"0th", 0}, {"2nd", 2}, {"4th", 4}, {"6th", 6}, {"8th", 8}, }; - print("um1 before", um1); - print("um2 before", um2); + ::print("um1 before", um1); + ::print("um2 before", um2); std::cout << std::endl; um1.swap(um2); - print("um1 after", um1); - print("um2 after", um2); + ::print("um1 after", um1); + ::print("um2 after", um2); } ``` * swap[color ff0000] diff --git a/reference/unordered_map/unordered_multimap/swap_free.md b/reference/unordered_map/unordered_multimap/swap_free.md index 74c6622ff1..3c07199919 100644 --- a/reference/unordered_map/unordered_multimap/swap_free.md +++ b/reference/unordered_map/unordered_multimap/swap_free.md @@ -75,8 +75,8 @@ int main() // um1とum2を入れ替える std::swap(um1, um2); - print("um1", um1); - print("um2", um2); + ::print("um1", um1); + ::print("um2", um2); } ``` * std::swap[color ff0000] diff --git a/reference/unordered_set/unordered_multiset/erase.md b/reference/unordered_set/unordered_multiset/erase.md index f36ccf5354..2deb189629 100644 --- a/reference/unordered_set/unordered_multiset/erase.md +++ b/reference/unordered_set/unordered_multiset/erase.md @@ -81,41 +81,41 @@ int main() // 指定した位置にある要素を削除((1)の形式) { std::unordered_multiset ums{ 1, 3, 5, 7, 9, 3, }; - print("(1) erase(const_iterator) before", ums); + ::print("(1) erase(const_iterator) before", ums); auto it1 = std::next(ums.cbegin(), 3); std::cout << "argument: " << *it1 << '\n'; auto it2 = ums.erase(it1); std::cout << "return value: " << *it2 << '\n'; - print("after", ums); + ::print("after", ums); std::cout << std::endl; } // 指定したキーと等価な要素を削除((3)の形式) { std::unordered_multiset ums{ 1, 3, 5, 7, 9, 3, }; - print("(3) erase(const value_type&) before", ums); + ::print("(3) erase(const value_type&) before", ums); auto count1 = ums.erase(5); auto count2 = ums.erase(8); auto count3 = ums.erase(3); std::cout << "argument: 5, 8, 3" << '\n'; std::cout << "return value: " << count1 << ", " << count2 << ", " << count3 << std::endl; - print("after", ums); + ::print("after", ums); std::cout << std::endl; } // 指定した位置にある要素を削除((4)の形式) { std::unordered_multiset ums{ 1, 3, 5, 7, 9, 3, }; - print("(4) erase(const_iterator, const_iterator) before", ums); + ::print("(4) erase(const_iterator, const_iterator) before", ums); auto it1 = std::next(ums.cbegin()); auto it2 = std::next(it1, 2); std::cout << "arguments: " << *it1 << ", " << *it2 << '\n'; auto it3 = ums.erase(it1, it2); std::cout << "return value: " << *it3 << '\n'; - print("after", ums); + ::print("after", ums); std::cout << std::endl; } } diff --git a/reference/unordered_set/unordered_multiset/insert.md b/reference/unordered_set/unordered_multiset/insert.md index cf1d1d0a4c..39590d9a50 100644 --- a/reference/unordered_set/unordered_multiset/insert.md +++ b/reference/unordered_set/unordered_multiset/insert.md @@ -136,7 +136,7 @@ int main() std::cout << *it1 << ' '; auto it2 = ums.insert(2); // 重複のあるケース std::cout << *it2 << std::endl; - print("insert one element", ums); + ::print("insert one element", ums); } // 一つの要素を挿入((2)の形式) @@ -147,7 +147,7 @@ int main() std::cout << *it1 << ' '; auto it2 = ums.insert(ums.cbegin(), 2); // 重複のあるケース std::cout << *it2 << std::endl; - print("insert one element with hint", ums); + ::print("insert one element with hint", ums); } // 複数の要素を挿入((3)の形式) @@ -156,7 +156,7 @@ int main() std::forward_list fl{ 5, 6, 0, 8, 7, }; ums.insert(fl.cbegin(), fl.cend()); // forward_list の要素を全部 - print("insert range", ums); + ::print("insert range", ums); } // 複数の要素を挿入((4)の形式) @@ -164,7 +164,7 @@ int main() std::unordered_multiset ums{ 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, }; ums.insert({ 5, 6, 0, 8, 7, }); - print("insert initializer_list", ums); + ::print("insert initializer_list", ums); } } ``` diff --git a/reference/unordered_set/unordered_multiset/op_equal.md b/reference/unordered_set/unordered_multiset/op_equal.md index 4254e3fe30..9aa133c6b0 100644 --- a/reference/unordered_set/unordered_multiset/op_equal.md +++ b/reference/unordered_set/unordered_multiset/op_equal.md @@ -69,9 +69,9 @@ int main() std::unordered_multiset ums2{ 4, 5, 6, 4, 5, 6, }; std::unordered_multiset ums3{ 1, 2, 3, 1, 2, 3, }; - print("ums1", ums1); - print("ums2", ums2); - print("ums3", ums3); + ::print("ums1", ums1); + ::print("ums2", ums2); + ::print("ums3", ums3); std::cout << "ums1 == ums2:" << (ums1 == ums2) << std::endl; std::cout << "ums1 == ums3:" << (ums1 == ums3) << std::endl; diff --git a/reference/unordered_set/unordered_multiset/op_not_equal.md b/reference/unordered_set/unordered_multiset/op_not_equal.md index 730e134da9..ada65d437e 100644 --- a/reference/unordered_set/unordered_multiset/op_not_equal.md +++ b/reference/unordered_set/unordered_multiset/op_not_equal.md @@ -70,9 +70,9 @@ int main() std::unordered_multiset ums2{ 4, 5, 6, 4, 5, 6, }; std::unordered_multiset ums3{ 1, 2, 3, 1, 2, 3, }; - print("ums1", ums1); - print("ums2", ums2); - print("ums3", ums3); + ::print("ums1", ums1); + ::print("ums2", ums2); + ::print("ums3", ums3); std::cout << "ums1 != ums2:" << (ums1 != ums2) << std::endl; std::cout << "ums1 != ums3:" << (ums1 != ums3) << std::endl; diff --git a/reference/unordered_set/unordered_multiset/swap.md b/reference/unordered_set/unordered_multiset/swap.md index b2aa0840d7..bb04a196a7 100644 --- a/reference/unordered_set/unordered_multiset/swap.md +++ b/reference/unordered_set/unordered_multiset/swap.md @@ -71,14 +71,14 @@ int main() std::unordered_multiset ums1{ 1, 3, 5, 7, 9, 1, 3, 5, 7, 9, }; std::unordered_multiset ums2{ 0, 2, 4, 6, 8, 0, 2, 4, 6, 8, }; - print("ums1 before", ums1); - print("ums2 before", ums2); + ::print("ums1 before", ums1); + ::print("ums2 before", ums2); std::cout << std::endl; ums1.swap(ums2); - print("ums1 after", ums1); - print("ums2 after", ums2); + ::print("ums1 after", ums1); + ::print("ums2 after", ums2); } ``` * swap[color ff0000] diff --git a/reference/unordered_set/unordered_multiset/swap_free.md b/reference/unordered_set/unordered_multiset/swap_free.md index acea0178ff..30b1a89884 100644 --- a/reference/unordered_set/unordered_multiset/swap_free.md +++ b/reference/unordered_set/unordered_multiset/swap_free.md @@ -56,11 +56,11 @@ int main() std::unordered_multiset ums1{ 1, 2, 3, 1, 2, 3, }; std::unordered_multiset ums2{ 4, 5, 6, 4, 5, 6, }; - print("ums1 before", ums1); - print("ums2 before", ums2); + ::print("ums1 before", ums1); + ::print("ums2 before", ums2); swap(ums1, ums2); - print("ums1 after", ums1); - print("ums2 after", ums2); + ::print("ums1 after", ums1); + ::print("ums2 after", ums2); } ``` * swap[color ff0000] diff --git a/reference/unordered_set/unordered_set/erase.md b/reference/unordered_set/unordered_set/erase.md index 64fcfe5b21..4a0f50afd3 100644 --- a/reference/unordered_set/unordered_set/erase.md +++ b/reference/unordered_set/unordered_set/erase.md @@ -81,40 +81,40 @@ int main() // 指定した位置にある要素を削除((1)の形式) { std::unordered_set us{ 1, 3, 5, 7, 9, }; - print("(1) erase(const_iterator) before", us); + ::print("(1) erase(const_iterator) before", us); auto it1 = std::next(us.cbegin(), 3); std::cout << "argument: " << *it1 << '\n'; auto it2 = us.erase(it1); std::cout << "return value: " << *it2 << '\n'; - print("after", us); + ::print("after", us); std::cout << std::endl; } // 指定したキーと等価な要素を削除((3)の形式) { std::unordered_set us{ 1, 3, 5, 7, 9, }; - print("(3) erase(const value_type&) before", us); + ::print("(3) erase(const value_type&) before", us); auto count1 = us.erase(5); auto count2 = us.erase(8); std::cout << "argument: 5, 8" << '\n'; std::cout << "return value: " << count1 << ", " << count2 << '\n'; - print("after", us); + ::print("after", us); std::cout << std::endl; } // 指定した位置にある要素を削除((4)の形式) { std::unordered_set us{ 1, 3, 5, 7, 9, }; - print("(4) erase(const_iterator, const_iterator) before", us); + ::print("(4) erase(const_iterator, const_iterator) before", us); auto it1 = std::next(us.cbegin()); auto it2 = std::next(it1, 2); std::cout << "arguments: " << *it1 << ", " << *it2 << '\n'; auto it3 = us.erase(it1, it2); std::cout << "return value: " << *it3 << '\n'; - print("after", us); + ::print("after", us); std::cout << std::endl; } } diff --git a/reference/unordered_set/unordered_set/insert.md b/reference/unordered_set/unordered_set/insert.md index 88320d3b9b..7e6f5ed46e 100644 --- a/reference/unordered_set/unordered_set/insert.md +++ b/reference/unordered_set/unordered_set/insert.md @@ -195,7 +195,7 @@ int main() std::cout << p1.second << ' ' << *p1.first << ' '; auto p2 = us.insert(2); // 追加されないケース std::cout << p2.second << ' ' << *p2.first << std::endl; - print("insert one element", us); + ::print("insert one element", us); } // 一つの要素を挿入((4), (5), (6)の形式) @@ -206,7 +206,7 @@ int main() std::cout << *it1 << ' '; auto it2 = us.insert(us.begin(), 2); // 追加されないケース std::cout << *it2 << std::endl; - print("insert one element with hint", us); + ::print("insert one element with hint", us); } // 複数の要素を挿入((7)の形式) @@ -215,7 +215,7 @@ int main() std::forward_list fl{ 5, 6, 0, 8, 7, }; us.insert(fl.cbegin(), fl.cend()); // forward_list の要素を全部 - print("insert range", us); + ::print("insert range", us); } // 複数の要素を挿入((8)の形式) @@ -223,7 +223,7 @@ int main() std::unordered_set us{ 0, 1, 2, 3, 4, 5, }; us.insert({ 5, 6, 0, 8, 7, }); - print("insert initializer_list", us); + ::print("insert initializer_list", us); } } ``` diff --git a/reference/unordered_set/unordered_set/op_equal.md b/reference/unordered_set/unordered_set/op_equal.md index dcdd00fc94..435aa6cd5a 100644 --- a/reference/unordered_set/unordered_set/op_equal.md +++ b/reference/unordered_set/unordered_set/op_equal.md @@ -66,9 +66,9 @@ int main() std::unordered_set us2{ 4, 5, 6, }; std::unordered_set us3{ 1, 2, 3, }; - print("us1", us1); - print("us2", us2); - print("us3", us3); + ::print("us1", us1); + ::print("us2", us2); + ::print("us3", us3); std::cout << "us1 == us2:" << (us1 == us2) << std::endl; std::cout << "us1 == us3:" << (us1 == us3) << std::endl; diff --git a/reference/unordered_set/unordered_set/op_not_equal.md b/reference/unordered_set/unordered_set/op_not_equal.md index 8a460ae1ee..21ccd9cc7a 100644 --- a/reference/unordered_set/unordered_set/op_not_equal.md +++ b/reference/unordered_set/unordered_set/op_not_equal.md @@ -68,9 +68,9 @@ int main() std::unordered_set us2{ 4, 5, 6, }; std::unordered_set us3{ 1, 2, 3, }; - print("us1", us1); - print("us2", us2); - print("us3", us3); + ::print("us1", us1); + ::print("us2", us2); + ::print("us3", us3); std::cout << "us1 != us2:" << (us1 != us2) << std::endl; std::cout << "us1 != us3:" << (us1 != us3) << std::endl; diff --git a/reference/unordered_set/unordered_set/swap.md b/reference/unordered_set/unordered_set/swap.md index 76b8d82353..359edc5a1d 100644 --- a/reference/unordered_set/unordered_set/swap.md +++ b/reference/unordered_set/unordered_set/swap.md @@ -71,14 +71,14 @@ int main() std::unordered_set us1{ 1, 3, 5, 7, 9, }; std::unordered_set us2{ 0, 2, 4, 6, 8, }; - print("us1 before", us1); - print("us2 before", us2); + ::print("us1 before", us1); + ::print("us2 before", us2); std::cout << std::endl; us1.swap(us2); - print("us1 after", us1); - print("us2 after", us2); + ::print("us1 after", us1); + ::print("us2 after", us2); } ``` * swap[color ff0000] diff --git a/reference/unordered_set/unordered_set/swap_free.md b/reference/unordered_set/unordered_set/swap_free.md index 2362334efd..6f54fa4d80 100644 --- a/reference/unordered_set/unordered_set/swap_free.md +++ b/reference/unordered_set/unordered_set/swap_free.md @@ -53,11 +53,11 @@ int main() std::unordered_set us1{ 1, 2, 3, }; std::unordered_set us2{ 4, 5, 6, }; - print("us1 before", us1); - print("us2 before", us2); + ::print("us1 before", us1); + ::print("us2 before", us2); swap(us1, us2); - print("us1 after", us1); - print("us2 after", us2); + ::print("us1 after", us1); + ::print("us2 after", us2); } ``` * swap[color ff0000] diff --git a/reference/utility/pair/op_assign.md b/reference/utility/pair/op_assign.md index 170209e716..fbd0c52fe7 100644 --- a/reference/utility/pair/op_assign.md +++ b/reference/utility/pair/op_assign.md @@ -107,7 +107,7 @@ int main() std::pair p(1, "abc"); std::pair p1; p1 = p; - print("p1", p1); + ::print("p1", p1); } // 変換可能なpairのコピー代入 @@ -115,7 +115,7 @@ int main() std::pair p(1, "abc"); std::pair p2; p2 = p; - print("p2", p2); + ::print("p2", p2); } // ムーブ代入 @@ -123,7 +123,7 @@ int main() std::pair p(1, "abc"); std::pair p3; p3 = std::move(p); - print("p3", p3); + ::print("p3", p3); } // 変換可能なpairのムーブ代入 @@ -131,7 +131,7 @@ int main() std::pair p(1, "abc"); std::pair p4; p4 = std::move(p); - print("p4", p4); + ::print("p4", p4); } } ``` diff --git a/reference/utility/pair/op_constructor.md b/reference/utility/pair/op_constructor.md index 6306b0ae55..ad0a5cdf43 100644 --- a/reference/utility/pair/op_constructor.md +++ b/reference/utility/pair/op_constructor.md @@ -200,27 +200,27 @@ int main() // (1) デフォルト構築 { constexpr std::pair p1; - print("p1", p1); + ::print("p1", p1); } // (2) コピー構築 { std::pair p(1, "abc"); std::pair p2 = p; - print("p2", p2); + ::print("p2", p2); } // (3) ムーブ構築 { std::pair p(1, "abc"); std::pair p3 = std::move(p); - print("p3", p3); + ::print("p3", p3); } // (4) firstとsecondの初期値から構築 { std::pair p4(1, std::string("abc")); - print("p4", p4); + ::print("p4", p4); } // (5) firstとsecondの右辺値からムーブ構築 @@ -228,21 +228,21 @@ int main() int x = 1; std::string s = "abc"; std::pair p5(std::move(x), std::move(s)); - print("p5", p5); + ::print("p5", p5); } // (7) 変換可能なpairから構築 { std::pair p(1, "abc"); std::pair p6 = p; - print("p6", p6); + ::print("p6", p6); } // (8) 変換可能なpairからムーブ構築 { std::pair p(1, "abc"); std::pair p7 = std::move(p); - print("p7", p7); + ::print("p7", p7); } // (11) first_typeとsecond_typeのコンストラクタ引数から構築 @@ -250,7 +250,7 @@ int main() std::pair p8(std::piecewise_construct, std::make_tuple(1, 2, 3), std::make_tuple(4, 5)); - print("p8", p8); + ::print("p8", p8); } } ``` diff --git a/reference/utility/pair/swap.md b/reference/utility/pair/swap.md index a55d139750..d1b79e565a 100644 --- a/reference/utility/pair/swap.md +++ b/reference/utility/pair/swap.md @@ -52,8 +52,8 @@ int main() p1.swap(p2); - print("p1", p1); - print("p2", p2); + ::print("p1", p1); + ::print("p2", p2); } ``` * swap[color ff0000] diff --git a/reference/utility/pair/swap_free.md b/reference/utility/pair/swap_free.md index 5958a06d1c..9bc0e26feb 100644 --- a/reference/utility/pair/swap_free.md +++ b/reference/utility/pair/swap_free.md @@ -51,8 +51,8 @@ int main() std::swap(p1, p2); - print("p1", p1); - print("p2", p2); + ::print("p1", p1); + ::print("p2", p2); } ``` * std::swap[color ff0000] diff --git a/reference/valarray/gslice_array/op_assign.md b/reference/valarray/gslice_array/op_assign.md index d0c14cbdf1..09c6f4ae57 100644 --- a/reference/valarray/gslice_array/op_assign.md +++ b/reference/valarray/gslice_array/op_assign.md @@ -86,17 +86,17 @@ int main() 0, std::valarray(3u, 1), std::valarray(1u, 1))] = va[std::gslice(start, lengths, strides)]; - print("assign gslice_array", va1); + ::print("assign gslice_array", va1); // (2) // 抽出した要素全てに33を代入する va[std::gslice(start, lengths, strides)] = std::valarray(33, product(lengths)); - print("assign valarray", va); + ::print("assign valarray", va); // (3) // 抽出した要素全てに55を代入する va[std::gslice(start, lengths, strides)] = 55; - print("assign value", va); + ::print("assign value", va); } ``` * std::gslice[link /reference/valarray/gslice.md] diff --git a/reference/valarray/indirect_array/op_assign.md b/reference/valarray/indirect_array/op_assign.md index c06d84101e..37f93fff15 100644 --- a/reference/valarray/indirect_array/op_assign.md +++ b/reference/valarray/indirect_array/op_assign.md @@ -72,17 +72,17 @@ int main() std::valarray mask1 = {0, 1, 2}; std::indirect_array result1 = va1[mask1]; result1 = result; - print("assign indirect_array", va1); + ::print("assign indirect_array", va1); // (2) // resultが参照する要素全てに、33を代入 result = std::valarray(33, mask.size()); - print("assign valarray", va); + ::print("assign valarray", va); // (3) // resultが参照する要素全てに、55を代入 result = 55; - print("assign value", va); + ::print("assign value", va); } ``` * mask.size()[link /reference/valarray/valarray/size.md] diff --git a/reference/valarray/mask_array/op_assign.md b/reference/valarray/mask_array/op_assign.md index 8fa61c5266..44a89f8e61 100644 --- a/reference/valarray/mask_array/op_assign.md +++ b/reference/valarray/mask_array/op_assign.md @@ -73,17 +73,17 @@ int main() std::valarray mask1 = {true, true, true, false, false, false}; std::mask_array result1 = va1[mask1]; result1 = result; - print("assign mask_array", va1); + ::print("assign mask_array", va1); // (2) // resultが参照する要素全てに、33を代入 result = std::valarray(33, 3); - print("assign valarray", va); + ::print("assign valarray", va); // (3) // resultが参照する要素全てに、55を代入 result = 55; - print("assign value", va); + ::print("assign value", va); } ``` diff --git a/reference/valarray/slice_array/op_assign.md b/reference/valarray/slice_array/op_assign.md index 11def569ab..91f7ee452a 100644 --- a/reference/valarray/slice_array/op_assign.md +++ b/reference/valarray/slice_array/op_assign.md @@ -75,17 +75,17 @@ int main() std::valarray va1 = {1, 2, 3, 4, 5, 6}; std::slice_array result1 = va1[std::slice(0, 3, 1)]; result1 = result; - print("assign slice_array", va1); + ::print("assign slice_array", va1); // (2) // resultが参照する要素全てに、33を代入 result = std::valarray(33, length); - print("assign valarray", va); + ::print("assign valarray", va); // (3) // resultが参照する要素全てに、55を代入 result = 55; - print("assign value", va); + ::print("assign value", va); } ``` * std::slice[link /reference/valarray/slice.md] diff --git a/reference/valarray/valarray.md b/reference/valarray/valarray.md index 4c78146856..b437ad6234 100644 --- a/reference/valarray/valarray.md +++ b/reference/valarray/valarray.md @@ -235,19 +235,19 @@ int main() std::valarray b = {4, 5, 6}; std::valarray plus = a + b; - print("add", plus); + ::print("add", plus); std::valarray minus = a - b; - print("minus", minus); + ::print("minus", minus); std::valarray multiply = a * b; - print("multiply", multiply); + ::print("multiply", multiply); std::valarray divide = a / b; - print("divide", divide); + ::print("divide", divide); std::valarray modulo = a % b; - print("modulo", modulo); + ::print("modulo", modulo); } std::cout << std::endl; @@ -257,10 +257,10 @@ int main() std::valarray a = {0.1f, 0.2f, 0.3f}; std::valarray sin = std::sin(a); - print("sin", sin); + ::print("sin", sin); std::valarray cos = std::cos(a); - print("cos", cos); + ::print("cos", cos); } std::cout << std::endl; @@ -275,7 +275,7 @@ int main() // {2, 4, 6}を抽出し、その全要素を* 2する a[std::slice(start, length, stride)] *= std::valarray {2, 2, 2}; - print("slice + multiply", a); + ::print("slice + multiply", a); } } ``` diff --git a/reference/valarray/valarray/atan2.md b/reference/valarray/valarray/atan2.md index 683238d9f9..89a7386bae 100644 --- a/reference/valarray/valarray/atan2.md +++ b/reference/valarray/valarray/atan2.md @@ -107,13 +107,13 @@ int main() const std::valarray xs = {0.3f, 0.2f, 0.1f}; std::valarray result1 = std::atan2(ys, xs); - print("valarray-valarray", result1); + ::print("valarray-valarray", result1); std::valarray result2 = std::atan2(ys, 0.3f); - print("valarray-float", result2); + ::print("valarray-float", result2); std::valarray result3 = std::atan2(0.1f, xs); - print("float-valarray", result3); + ::print("float-valarray", result3); } ``` * std::atan2[color ff0000] diff --git a/reference/valarray/valarray/cshift.md b/reference/valarray/valarray/cshift.md index 7db05af57e..ea22e3a748 100644 --- a/reference/valarray/valarray/cshift.md +++ b/reference/valarray/valarray/cshift.md @@ -55,10 +55,10 @@ int main() const std::valarray va = {1, 2, 3, 4, 5}; const std::valarray left_shift_result = va.cshift(3); - print("left_shift_result", left_shift_result); + ::print("left_shift_result", left_shift_result); const std::valarray right_shift_result = va.cshift(-3); - print("right_shift_result", right_shift_result); + ::print("right_shift_result", right_shift_result); } ``` * cshift[color ff0000] diff --git a/reference/valarray/valarray/log.md b/reference/valarray/valarray/log.md index 0d68c39368..de7adb3c56 100644 --- a/reference/valarray/valarray/log.md +++ b/reference/valarray/valarray/log.md @@ -61,8 +61,8 @@ int main() std::valarray exp_result = std::exp(va); std::valarray log_result = std::log(exp_result); - print("exp_result", exp_result); - print("log_result", log_result); + ::print("exp_result", exp_result); + ::print("log_result", log_result); } ``` * std::log[color ff0000] diff --git a/reference/valarray/valarray/op_assign.md b/reference/valarray/valarray/op_assign.md index 8cd3556405..9f2a973b6a 100644 --- a/reference/valarray/valarray/op_assign.md +++ b/reference/valarray/valarray/op_assign.md @@ -79,30 +79,30 @@ int main() // コピー代入 std::valarray va1_org = {1, 2, 3}; std::valarray va1 = va1_org; - print("va1", va1); + ::print("va1", va1); // (2) // ムーブ代入 std::valarray va2 = std::move(va1); - print("va2", va2); + ::print("va2", va2); // (3) // 初期化子リストを代入 std::valarray va3; va3 = {1, 2, 3}; - print("va3", va3); + ::print("va3", va3); // (4) // 値を全要素に代入 std::valarray va4(3); va4 = 1; - print("va4", va4); + ::print("va4", va4); // (5) // スライスされたvalarrayオブジェクトを代入 std::valarray va5_org = {1, 2, 3, 4, 5}; std::valarray va5 = va5_org[std::slice(0, 3, 1)]; // 先頭3要素 - print("va5", va5); + ::print("va5", va5); // (6) // 行列スライスされたvalarrayオブジェクトを代入 @@ -110,21 +110,21 @@ int main() std::valarray va6_len = {1, 2, 2}; std::valarray va6_stride = {2, 3, 1}; std::valarray va6 = va6_org[std::gslice(0, va6_len, va6_stride)]; - print("va6", va6); + ::print("va6", va6); // (7) // マスクされたvalarrayオブジェクトを代入 std::valarray va7_org = {1, 2, 3, 4, 5}; std::valarray va7_mask = {true, false, true, false, true}; std::valarray va7 = va7_org[va7_mask]; - print("va7", va7); + ::print("va7", va7); // (8) // インデックス列の指定によってマスクされたvalarrayオブジェクトを代入 std::valarray va8_org = {1, 2, 3, 4, 5}; std::valarray va8_indices = {0, 2, 4}; std::valarray va8 = va8_org[va8_indices]; - print("va8", va8); + ::print("va8", va8); } ``` * std::move[link /reference/utility/move.md] diff --git a/reference/valarray/valarray/op_constructor.md b/reference/valarray/valarray/op_constructor.md index f4eeb6e15a..4a9564b934 100644 --- a/reference/valarray/valarray/op_constructor.md +++ b/reference/valarray/valarray/op_constructor.md @@ -86,40 +86,40 @@ int main() // (1) // デフォルト構築 std::valarray va1; - print("va1", va1); + ::print("va1", va1); // (2) // 3個の要素を保持するvalarrayオブジェクトを構築。 // 要素は0(T())で埋められる。 std::valarray va2(3); - print("va2", va2); + ::print("va2", va2); // (3) // 値1を持つ要素3個からなるvalarrayオブジェクトを構築。 std::valarray va3(1, 3); - print("va3", va3); + ::print("va3", va3); // (4) // 配列の先頭3要素のコピーからvalarrayオブジェクトを構築。 int ar4[] = {1, 2, 3, 4}; std::valarray va4(ar4, 3); - print("va4", va4); + ::print("va4", va4); // (5) // コピー構築。 std::valarray va5 = va4; - print("va5", va5); + ::print("va5", va5); // (6) // ムーブ構築。 std::valarray va6 = std::move(va5); - print("va6", va6); + ::print("va6", va6); // (7) // スライスされたvalarrayオブジェクトから構築 std::valarray va7_org = {1, 2, 3, 4, 5}; std::valarray va7(va7_org[std::slice(0, 3, 1)]); // 先頭3要素 - print("va7", va7); + ::print("va7", va7); // (8) // 行列スライスされたvalarrayオブジェクトから構築 @@ -127,26 +127,26 @@ int main() std::valarray va8_len = {1, 2, 2}; std::valarray va8_stride = {2, 3, 1}; std::valarray va8 = va8_org[std::gslice(0, va8_len, va8_stride)]; - print("va8", va8); + ::print("va8", va8); // (9) // マスクされたvalarrayオブジェクトから構築 std::valarray va9_org = {1, 2, 3, 4, 5}; std::valarray va9_mask = {true, false, true, false, true}; std::valarray va9 = va9_org[va9_mask]; - print("va9", va9); + ::print("va9", va9); // (10) // インデックス列の指定によってマスクされたvalarrayオブジェクトから構築 std::valarray va10_org = {1, 2, 3, 4, 5}; std::valarray va10_indices = {0, 2, 4}; std::valarray va10 = va10_org[va10_indices]; - print("va10", va10); + ::print("va10", va10); // (11) // 初期化子リストから構築 std::valarray va11 = {1, 2, 3}; - print("va11", va11); + ::print("va11", va11); } ``` * std::move[link /reference/utility/move.md] diff --git a/reference/valarray/valarray/op_divide.md b/reference/valarray/valarray/op_divide.md index 67d31a227f..7e46f7982e 100644 --- a/reference/valarray/valarray/op_divide.md +++ b/reference/valarray/valarray/op_divide.md @@ -103,13 +103,13 @@ int main() const std::valarray b = {1, 2, 3}; std::valarray result1 = a / b; - print("valarray/valarray", result1); + ::print("valarray/valarray", result1); std::valarray result2 = a / 2; - print("valarray/int", result2); + ::print("valarray/int", result2); std::valarray result3 = 15 / a; - print("int/valarray", result3); + ::print("int/valarray", result3); } ``` diff --git a/reference/valarray/valarray/op_divide_assign.md b/reference/valarray/valarray/op_divide_assign.md index 8677ea3de6..e7cba71ff1 100644 --- a/reference/valarray/valarray/op_divide_assign.md +++ b/reference/valarray/valarray/op_divide_assign.md @@ -77,11 +77,11 @@ int main() std::valarray result1 = a; result1 /= b; - print("valarray/=valarray", result1); + ::print("valarray/=valarray", result1); std::valarray result2 = a; result2 /= 2; - print("valarray/=int", result2); + ::print("valarray/=int", result2); } ``` diff --git a/reference/valarray/valarray/op_minus.md b/reference/valarray/valarray/op_minus.md index d1081a5619..a07449e84b 100644 --- a/reference/valarray/valarray/op_minus.md +++ b/reference/valarray/valarray/op_minus.md @@ -103,13 +103,13 @@ int main() const std::valarray b = {1, 2, 3}; std::valarray result1 = a - b; - print("valarray-valarray", result1); + ::print("valarray-valarray", result1); std::valarray result2 = a - 1; - print("valarray-int", result2); + ::print("valarray-int", result2); std::valarray result3 = 1 - a; - print("int-valarray", result3); + ::print("int-valarray", result3); } ``` diff --git a/reference/valarray/valarray/op_minus_assign.md b/reference/valarray/valarray/op_minus_assign.md index b6775f1ff3..0d0c5aa800 100644 --- a/reference/valarray/valarray/op_minus_assign.md +++ b/reference/valarray/valarray/op_minus_assign.md @@ -77,11 +77,11 @@ int main() std::valarray result1 = a; result1 -= b; - print("valarray-=valarray", result1); + ::print("valarray-=valarray", result1); std::valarray result2 = a; result2 -= 1; - print("valarray-=int", result2); + ::print("valarray-=int", result2); } ``` diff --git a/reference/valarray/valarray/op_modulo.md b/reference/valarray/valarray/op_modulo.md index 9f3ff99fa0..775e9cee78 100644 --- a/reference/valarray/valarray/op_modulo.md +++ b/reference/valarray/valarray/op_modulo.md @@ -103,13 +103,13 @@ int main() const std::valarray b = {1, 2, 3}; std::valarray result1 = a % b; - print("valarray%valarray", result1); + ::print("valarray%valarray", result1); std::valarray result2 = a % 2; - print("valarray%int", result2); + ::print("valarray%int", result2); std::valarray result3 = 15 % a; - print("int%valarray", result3); + ::print("int%valarray", result3); } ``` diff --git a/reference/valarray/valarray/op_modulo_assign.md b/reference/valarray/valarray/op_modulo_assign.md index ecc7839948..3c45f5d21f 100644 --- a/reference/valarray/valarray/op_modulo_assign.md +++ b/reference/valarray/valarray/op_modulo_assign.md @@ -77,11 +77,11 @@ int main() std::valarray result1 = a; result1 %= b; - print("valarray%=valarray", result1); + ::print("valarray%=valarray", result1); std::valarray result2 = a; result2 %= 2; - print("valarray%=int", result2); + ::print("valarray%=int", result2); } ``` diff --git a/reference/valarray/valarray/op_multiply.md b/reference/valarray/valarray/op_multiply.md index f5068bc7de..e96054df71 100644 --- a/reference/valarray/valarray/op_multiply.md +++ b/reference/valarray/valarray/op_multiply.md @@ -102,13 +102,13 @@ int main() const std::valarray b = {1, 2, 3}; std::valarray result1 = a * b; - print("valarray*valarray", result1); + ::print("valarray*valarray", result1); std::valarray result2 = a * 2; - print("valarray*int", result2); + ::print("valarray*int", result2); std::valarray result3 = 2 * a; - print("int*valarray", result3); + ::print("int*valarray", result3); } ``` diff --git a/reference/valarray/valarray/op_multiply_assign.md b/reference/valarray/valarray/op_multiply_assign.md index 05542bd17b..87e3cb0a01 100644 --- a/reference/valarray/valarray/op_multiply_assign.md +++ b/reference/valarray/valarray/op_multiply_assign.md @@ -77,11 +77,11 @@ int main() std::valarray result1 = a; result1 *= b; - print("valarray*=valarray", result1); + ::print("valarray*=valarray", result1); std::valarray result2 = a; result2 *= 2; - print("valarray*=int", result2); + ::print("valarray*=int", result2); } ``` diff --git a/reference/valarray/valarray/op_plus.md b/reference/valarray/valarray/op_plus.md index 7370c11f60..02458e33ac 100644 --- a/reference/valarray/valarray/op_plus.md +++ b/reference/valarray/valarray/op_plus.md @@ -102,13 +102,13 @@ int main() const std::valarray b = {1, 2, 3}; std::valarray result1 = a + b; - print("valarray+valarray", result1); + ::print("valarray+valarray", result1); std::valarray result2 = a + 1; - print("valarray+int", result2); + ::print("valarray+int", result2); std::valarray result3 = 1 + a; - print("int+valarray", result3); + ::print("int+valarray", result3); } ``` diff --git a/reference/valarray/valarray/op_plus_assign.md b/reference/valarray/valarray/op_plus_assign.md index acf24d326d..3c4a47c19d 100644 --- a/reference/valarray/valarray/op_plus_assign.md +++ b/reference/valarray/valarray/op_plus_assign.md @@ -78,11 +78,11 @@ int main() std::valarray result1 = a; result1 += b; - print("valarray+=valarray", result1); + ::print("valarray+=valarray", result1); std::valarray result2 = a; result2 += 1; - print("valarray+=int", result2); + ::print("valarray+=int", result2); } ``` diff --git a/reference/valarray/valarray/pow.md b/reference/valarray/valarray/pow.md index 34ad57c9fd..a1ad24e309 100644 --- a/reference/valarray/valarray/pow.md +++ b/reference/valarray/valarray/pow.md @@ -107,13 +107,13 @@ int main() const std::valarray ys = {3.0f, 4.0f, 5.0f}; std::valarray result1 = std::pow(xs, ys); - print("valarray-valarray", result1); + ::print("valarray-valarray", result1); std::valarray result2 = std::pow(xs, 3.0f); - print("valarray-float", result2); + ::print("valarray-float", result2); std::valarray result3 = std::pow(3.0f, ys); - print("float-valarray", result3); + ::print("float-valarray", result3); } ``` * std::pow[color ff0000] diff --git a/reference/valarray/valarray/shift.md b/reference/valarray/valarray/shift.md index 4e63559bb2..07a21e4c7d 100644 --- a/reference/valarray/valarray/shift.md +++ b/reference/valarray/valarray/shift.md @@ -53,10 +53,10 @@ int main() const std::valarray va = {1, 2, 3, 4, 5}; const std::valarray left_shift_result = va.shift(3); - print("left_shift_result", left_shift_result); + ::print("left_shift_result", left_shift_result); const std::valarray right_shift_result = va.shift(-3); - print("right_shift_result", right_shift_result); + ::print("right_shift_result", right_shift_result); } ``` * shift[color ff0000] diff --git a/reference/valarray/valarray/swap.md b/reference/valarray/valarray/swap.md index ea74562b4e..adfcd55cf6 100644 --- a/reference/valarray/valarray/swap.md +++ b/reference/valarray/valarray/swap.md @@ -51,8 +51,8 @@ int main() a.swap(b); - print("a", a); - print("b", b); + ::print("a", a); + ::print("b", b); } ``` * swap[color ff0000] diff --git a/reference/valarray/valarray/swap_free.md b/reference/valarray/valarray/swap_free.md index 32e12b2f74..9979f6a145 100644 --- a/reference/valarray/valarray/swap_free.md +++ b/reference/valarray/valarray/swap_free.md @@ -53,8 +53,8 @@ int main() std::swap(a, b); - print("a", a); - print("b", b); + ::print("a", a); + ::print("b", b); } ``` * std::swap[color ff0000] diff --git a/reference/vector/vector/erase.md b/reference/vector/vector/erase.md index 6d4fe195cd..2b7cacbbe5 100644 --- a/reference/vector/vector/erase.md +++ b/reference/vector/vector/erase.md @@ -74,7 +74,7 @@ int main() // 2番目の単一要素(値3)を削除 v.erase(v.begin() + 2); - print("(1)", v); + ::print("(1)", v); } // (2) @@ -83,7 +83,7 @@ int main() // 範囲[v.begin(), v.begin() + 2)の要素を削除 v.erase(v.begin(), v.begin() + 2); - print("(2)", v); + ::print("(2)", v); } } ``` diff --git a/reference/vector/vector/op_constructor.md b/reference/vector/vector/op_constructor.md index 9a353c82a0..dc82db757c 100644 --- a/reference/vector/vector/op_constructor.md +++ b/reference/vector/vector/op_constructor.md @@ -171,12 +171,12 @@ int main() // 初期化子リストからvectorを構築 std::vector sixth = {1, 2, 3}; - print("first", first); - print("second", second); - print("third", third); - print("fourth", fourth); - print("fifth", fifth); - print("sixth", sixth); + ::print("first", first); + ::print("second", second); + ::print("third", third); + ::print("fourth", fourth); + ::print("fifth", fifth); + ::print("sixth", sixth); } ``` diff --git a/reference/vector/vector/swap.md b/reference/vector/vector/swap.md index fc58cd6e5f..428f6d2f92 100644 --- a/reference/vector/vector/swap.md +++ b/reference/vector/vector/swap.md @@ -61,8 +61,8 @@ int main() v1.swap(v2); - print("v1", v1); - print("v2", v2); + ::print("v1", v1); + ::print("v2", v2); } ``` * swap[color ff0000] diff --git a/reference/vector/vector/swap_free.md b/reference/vector/vector/swap_free.md index 07f5fd60cf..09848a4c6c 100644 --- a/reference/vector/vector/swap_free.md +++ b/reference/vector/vector/swap_free.md @@ -54,8 +54,8 @@ int main() std::swap(v1, v2); - print("v1", v1); - print("v2", v2); + ::print("v1", v1); + ::print("v2", v2); } ``` * std::swap[color ff0000] From ce1467a5f8d924cf3753aaa4057271bfd61fa1f8 Mon Sep 17 00:00:00 2001 From: rotarymars Date: Mon, 23 Mar 2026 10:25:18 +0900 Subject: [PATCH 2643/3948] created fgetpos and fsetpos (#1583) * created fgetpos and fsetpos * Update reference/cstdio/fsetpos.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update reference/cstdio/fgetpos.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update reference/cstdio/fsetpos.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- reference/cstdio.md | 4 +-- reference/cstdio/fgetpos.md | 72 +++++++++++++++++++++++++++++++++++++ reference/cstdio/fpos_t.md | 6 ++-- reference/cstdio/fsetpos.md | 72 +++++++++++++++++++++++++++++++++++++ reference/cstdio/ungetc.md | 2 +- 5 files changed, 150 insertions(+), 6 deletions(-) create mode 100644 reference/cstdio/fgetpos.md create mode 100644 reference/cstdio/fsetpos.md diff --git a/reference/cstdio.md b/reference/cstdio.md index def9b35f10..ec93b5362c 100644 --- a/reference/cstdio.md +++ b/reference/cstdio.md @@ -56,9 +56,9 @@ | [`fputs`](/reference/cstdio/fputs.md) | ファイルにN文字出力する | | | [`fread`](/reference/cstdio/fread.md) | ファイルからN文字読み込む | | | [`fwrite`](/reference/cstdio/fwrite.md) | ファイルにN文字書き込む | | -| [`fgetpos`](/reference/cstdio/fgetpos.md.nolink) | ファイルの現在位置を取得する | | +| [`fgetpos`](/reference/cstdio/fgetpos.md) | ファイルの現在位置を取得する | | | [`fseek`](/reference/cstdio/fseek.md.nolink) | ファイルの現在位置を移動する | | -| [`fsetpos`](/reference/cstdio/fsetpos.md.nolink) | ファイルの現在位置を設定する | | +| [`fsetpos`](/reference/cstdio/fsetpos.md) | ファイルの現在位置を設定する | | | [`ftell`](/reference/cstdio/ftell.md.nolink) | ファイルの現在位置を取得する | | | [`rewind`](/reference/cstdio/rewind.md.nolink) | ファイルの現在位置を先頭に戻し、エラーや終端判定をクリアする | | | [`clearerr`](/reference/cstdio/clearerr.md.nolink) | エラーをクリアする | | diff --git a/reference/cstdio/fgetpos.md b/reference/cstdio/fgetpos.md new file mode 100644 index 0000000000..9440ba3352 --- /dev/null +++ b/reference/cstdio/fgetpos.md @@ -0,0 +1,72 @@ +# fgetpos +* cstdio[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +namespace std { + int fgetpos(FILE* stream, fpos_t* pos); +} +``` + +## 概要 +ファイルの現在位置を取得する。 + +## 戻り値 +正常に実行されれば0を返す。 + +失敗した場合は、0以外を返し、エラーの内容は[`errno`](/reference/cerrno/errno.md)から参照することができる。 + +## この機能が必要になった背景・経緯 +かつては[`ftell`](/reference/cstdio/ftell.md.nolink)で位置を取得していたが、`ftell`は位置を`long int`で返すため、非常に大きなファイルやマルチバイト文字を含む特殊なファイルでは正確に表現できないことがあった。 + +そこで、どのようなファイルでも位置を正確に表現できる`fpos_t`型が導入されたことに伴い、この関数が登場した。 + +## 例 +```cpp example +#include +#include + +int main() { + std::FILE *file = std::fopen("example.txt", "w"); + if (file == nullptr) { + std::perror("Failed to open file"); + return 1; + } + std::fpos_t current_pos; + std::fgetpos(file, ¤t_pos); + std::fputs("Hello, World!\n", file); + std::fsetpos(file, ¤t_pos); + std::fputs("h", file); + std::fclose(file); + file = std::fopen("example.txt", "r"); + if (file == nullptr) { + std::perror("Failed to open file"); + return 1; + } + int ch; + while ((ch = std::fgetc(file)) != EOF) { + std::putchar(ch); + } + std::fclose(file); + return 0; +} +``` +* std::fgetpos[color ff0000] +* std::fsetpos[link /reference/cstdio/fsetpos.md] +* std::fopen[link /reference/cstdio/fopen.md] +* std::fputs[link /reference/cstdio/fputs.md] +* std::fclose[link /reference/cstdio/fclose.md] +* std::perror[link /reference/cstdio/perror.md.nolink] +* std::fgetc[link /reference/cstdio/fgetc.md] +* std::putchar[link /reference/cstdio/putchar.md] + +## 出力 +``` +hello, World! +``` + +## 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cstdio/fpos_t.md b/reference/cstdio/fpos_t.md index 9c1a6e3561..503b95b9e0 100644 --- a/reference/cstdio/fpos_t.md +++ b/reference/cstdio/fpos_t.md @@ -13,7 +13,7 @@ namespace std { ## 概要 ファイルの位置を保持するための型。 -[`fgetpos()`](/reference/cstdio/fgetpos.md.nolink)関数や[`fsetpos()`](/reference/cstdio/fsetpos.md.nolink)関数で用いられる。これらの関数は[`fseek()`](/reference/cstdio/fseek.md.nolink)関数や[`ftell()`](/reference/cstdio/ftell.md.nolink)関数と違い、巨大なファイルやマルチバイトファイルに対しても適切に動作することを目的に設計された。 +[`fgetpos()`](/reference/cstdio/fgetpos.md)関数や[`fsetpos()`](/reference/cstdio/fsetpos.md)関数で用いられる。これらの関数は[`fseek()`](/reference/cstdio/fseek.md.nolink)関数や[`ftell()`](/reference/cstdio/ftell.md.nolink)関数と違い、巨大なファイルやマルチバイトファイルに対しても適切に動作することを目的に設計された。 ## 例 ```cpp example @@ -43,8 +43,8 @@ int main() { ``` * std::fpos_t[color ff0000] -* std::fgetpos[link /reference/cstdio/fgetpos.md.nolink] -* std::fsetpos[link /reference/cstdio/fsetpos.md.nolink] +* std::fgetpos[link /reference/cstdio/fgetpos.md] +* std::fsetpos[link /reference/cstdio/fsetpos.md] * std::fopen[link /reference/cstdio/fopen.md] * std::fclose[link /reference/cstdio/fclose.md] * std::fgetc[link /reference/cstdio/fgetc.md] diff --git a/reference/cstdio/fsetpos.md b/reference/cstdio/fsetpos.md new file mode 100644 index 0000000000..f4650406f7 --- /dev/null +++ b/reference/cstdio/fsetpos.md @@ -0,0 +1,72 @@ +# fsetpos +* cstdio[meta header] +* std[meta namespace] +* function[meta id-type] + +```cpp +namespace std { + int fsetpos(FILE* stream, const fpos_t* pos); +} +``` + +## 概要 +ファイルの現在位置を設定する。 + +## 戻り値 +正常に実行されれば0を返す。 + +失敗した場合は、0以外を返し、エラーの内容は[`errno`](/reference/cerrno/errno.md)から参照することができる。 + +## この機能が必要になった背景・経緯 +かつては[`fseek`](/reference/cstdio/fseek.md.nolink)で位置を指定していたが、`fseek`は位置を`long int`で指定するため、非常に大きなファイルやマルチバイト文字を含む特殊なファイルでは正確にファイル位置を指定できないことがあった。 + +そこで、どのようなファイルでも位置を正確に表現できる`fpos_t`型が導入されたことに伴い、この関数が登場した。 + +## 例 +```cpp example +#include +#include + +int main() { + std::FILE *file = std::fopen("example.txt", "w"); + if (file == nullptr) { + std::perror("Failed to open file"); + return 1; + } + std::fpos_t current_pos; + std::fgetpos(file, ¤t_pos); + std::fputs("Hello, World!\n", file); + std::fsetpos(file, ¤t_pos); + std::fputs("h", file); + std::fclose(file); + file = std::fopen("example.txt", "r"); + if (file == nullptr) { + std::perror("Failed to open file"); + return 1; + } + int ch; + while ((ch = std::fgetc(file)) != EOF) { + std::putchar(ch); + } + std::fclose(file); + return 0; +} +``` +* std::fsetpos[color ff0000] +* std::fgetpos[link /reference/cstdio/fgetpos.md] +* std::fopen[link /reference/cstdio/fopen.md] +* std::fputs[link /reference/cstdio/fputs.md] +* std::fclose[link /reference/cstdio/fclose.md] +* std::perror[link /reference/cstdio/perror.md.nolink] +* std::fgetc[link /reference/cstdio/fgetc.md] +* std::putchar[link /reference/cstdio/putchar.md] + +## 出力 +``` +hello, World! +``` + +## 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? diff --git a/reference/cstdio/ungetc.md b/reference/cstdio/ungetc.md index 12b998a399..dd27b639e1 100644 --- a/reference/cstdio/ungetc.md +++ b/reference/cstdio/ungetc.md @@ -16,7 +16,7 @@ namespace std { また、`c`は[`EOF`](/reference/cstdio/eof.md)であってはならない。 -この関数が呼び出されたのち、[`fseek`](/reference/cstdio/fseek.md.nolink)や[`fsetpos`](/reference/cstdio/fsetpos.md.nolink)、[`rewind`](/reference/cstdio/rewind.md.nolink)、[`fflush`](/reference/cstdio/fflush.md)を呼び出すと、その関数の呼び出しによって戻された文字は失われる。 +この関数が呼び出されたのち、[`fseek`](/reference/cstdio/fseek.md.nolink)や[`fsetpos`](/reference/cstdio/fsetpos.md)、[`rewind`](/reference/cstdio/rewind.md.nolink)、[`fflush`](/reference/cstdio/fflush.md)を呼び出すと、その関数の呼び出しによって戻された文字は失われる。 ## 戻り値 成功したら挿入した`c`を、そうでなければ[`EOF`](/reference/cstdio/eof.md)を返す。 From f034aeb64d80fe0e4d90c8eec445e333300fef50 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 23 Mar 2026 15:46:05 +0900 Subject: [PATCH 2644/3948] =?UTF-8?q?reference=5F(construct|convert)s=5Ffr?= =?UTF-8?q?om=5Ftemporary=20=E3=81=AE=E3=83=9A=E3=83=BC=E3=82=B8=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reference_constructs_from_temporary.md | 11 +++++++---- .../type_traits/reference_converts_from_temporary.md | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/reference/type_traits/reference_constructs_from_temporary.md b/reference/type_traits/reference_constructs_from_temporary.md index 230736c205..19c1a60519 100644 --- a/reference/type_traits/reference_constructs_from_temporary.md +++ b/reference/type_traits/reference_constructs_from_temporary.md @@ -33,7 +33,7 @@ namespace std { - `U`が参照型や関数型の場合、[`declval`](/reference/utility/declval.md)`()`と同じ型と値カテゴリを持つ式 - `U`が参照型や関数型でない場合、型`U`である`prvalue`(ただし、`U`に`const`/`volatile`修飾があれば調整される) -[`conjunction_v`](conjunction.md)`<`[`is_reference`](is_reference.md)`,` [`is_constructible`](is_constructible.md)`>`が`true`かつ、`T t(VAL)`において`t`が一時オブジェクトの寿命を延長する場合に[`true_type`](true_type.md)から派生し、そうでなければ[`false_type`](false_type.md)から派生する。 +[`conjunction_v`](conjunction.md)`<`[`is_reference`](is_reference.md)`,` [`is_constructible`](is_constructible.md)`>`が`true`かつ、`T t(VAL);`において`t`が一時オブジェクトの寿命を延長する場合に[`true_type`](true_type.md)から派生し、そうでなければ[`false_type`](false_type.md)から派生する。 ## 備考 @@ -109,6 +109,12 @@ int main() static_assert(std::reference_constructs_from_temporary_v); static_assert(std::reference_constructs_from_temporary_v); + // OK: 変換されて rvalue になってから束縛されて寿命が延長されるタイプ + // C → B の変換は explicit だが、丸カッコ初期化なので変換できる + static_assert(std::reference_constructs_from_temporary_v); + static_assert(std::reference_constructs_from_temporary_v); + static_assert(std::reference_constructs_from_temporary_v); + // NG: const ではない左辺値参照は寿命を延長しないんですタイプ // 1つ目3つ目はそもそも参照そのものが構築出来ない @@ -121,9 +127,6 @@ int main() static_assert(false == std::reference_constructs_from_temporary_v); // NG: explicit なので変換出来ずに詰むパターン - static_assert(false == std::reference_constructs_from_temporary_v); - static_assert(false == std::reference_constructs_from_temporary_v); - static_assert(false == std::reference_constructs_from_temporary_v); static_assert(false == std::reference_constructs_from_temporary_v); } diff --git a/reference/type_traits/reference_converts_from_temporary.md b/reference/type_traits/reference_converts_from_temporary.md index f87ca3ae4a..7d18146e66 100644 --- a/reference/type_traits/reference_converts_from_temporary.md +++ b/reference/type_traits/reference_converts_from_temporary.md @@ -29,7 +29,7 @@ namespace std { - `U`が参照型や関数型の場合、[`declval`](/reference/utility/declval.md)`()`と同じ型と値カテゴリを持つ式 - `U`が参照型や関数型でない場合、型`U`である`prvalue`(ただし、`U`に`const`/`volatile`修飾があれば調整される) -[`conjunction_v`](conjunction.md)`<`[`is_reference`](is_reference.md)`,` [`is_convertible`](is_convertible.md)`>`が`true`かつ、`T t(VAL)`において`t`が一時オブジェクトの寿命を延長する場合に[`true_type`](true_type.md)から派生し、そうでなければ[`false_type`](false_type.md)から派生する。 +[`conjunction_v`](conjunction.md)`<`[`is_reference`](is_reference.md)`,` [`is_convertible`](is_convertible.md)`>`が`true`かつ、`T t = VAL;`において`t`が一時オブジェクトの寿命を延長する場合に[`true_type`](true_type.md)から派生し、そうでなければ[`false_type`](false_type.md)から派生する。 ## 備考 From cb81deea4409b59c15c1450ca51d94a8d24c8b2f Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 23 Mar 2026 17:00:07 +0900 Subject: [PATCH 2645/3948] =?UTF-8?q?null=5Fopt=20=E3=82=92=20nullopt=20?= =?UTF-8?q?=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/optional/optional/begin.md | 2 +- reference/optional/optional/end.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/optional/optional/begin.md b/reference/optional/optional/begin.md index b2d0d3a7d7..fabebdc015 100644 --- a/reference/optional/optional/begin.md +++ b/reference/optional/optional/begin.md @@ -32,7 +32,7 @@ int main() std::cout << *i; // 1度通る } - std::optional p2 = std::null_opt; + std::optional p2 = std::nullopt; for (auto i = p2.begin(); i != p2.end(); ++i) { std::cout << *i; // 1度も通らない } diff --git a/reference/optional/optional/end.md b/reference/optional/optional/end.md index 3476e9e9a4..67b5a82fd0 100644 --- a/reference/optional/optional/end.md +++ b/reference/optional/optional/end.md @@ -29,7 +29,7 @@ int main() std::optional p = 1; std::cout << std::distance(p.begin(), p.end()) << std::endl; - p = std::null_opt; + p = std::nullopt; std::cout << std::distance(p.begin(), p.end()) << std::endl; } ``` From 77d9cef12dadcbf32c0423735c51ce39d4ee5787 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 23 Mar 2026 17:00:53 +0900 Subject: [PATCH 2646/3948] =?UTF-8?q?is=5Fwithin=5Flifetime=20:=20?= =?UTF-8?q?=E3=82=B5=E3=83=B3=E3=83=97=E3=83=AB=E3=82=B3=E3=83=BC=E3=83=89?= =?UTF-8?q?=E3=81=AE=E3=82=A8=E3=83=A9=E3=83=BC=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/type_traits/is_within_lifetime.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/type_traits/is_within_lifetime.md b/reference/type_traits/is_within_lifetime.md index 5707bb2cf8..f1dc4a2593 100644 --- a/reference/type_traits/is_within_lifetime.md +++ b/reference/type_traits/is_within_lifetime.md @@ -62,7 +62,7 @@ struct OptBool { } } - constexpr auto operator*() -> bool& { + constexpr auto operator*() const -> const bool& { return b; } }; From de4a627c65208fe72a3f2c5cf4f13b6cffac0c71 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 23 Mar 2026 19:44:22 +0900 Subject: [PATCH 2647/3948] =?UTF-8?q?new=5Fhandler=20:=20=E3=82=B5?= =?UTF-8?q?=E3=83=B3=E3=83=97=E3=83=AB=E3=82=B3=E3=83=BC=E3=83=89=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit コンパイルエラーになっていたので、要素数がコンパイル時にわからないように修正しました。 --- reference/new/new_handler.md | 4 +++- reference/new/set_new_handler.md | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/reference/new/new_handler.md b/reference/new/new_handler.md index 76fabfce48..dc4e9a4f71 100644 --- a/reference/new/new_handler.md +++ b/reference/new/new_handler.md @@ -41,7 +41,9 @@ int main() std::new_handler handler = on_new_failed; std::set_new_handler(handler); - int* p = new int[std::numeric_limits::max()]; + auto n = std::numeric_limits::max(); + int* p = new int[n]; + delete[] p; } ``` * std::new_handler[color ff0000] diff --git a/reference/new/set_new_handler.md b/reference/new/set_new_handler.md index 84341cddf1..da5b23bc75 100644 --- a/reference/new/set_new_handler.md +++ b/reference/new/set_new_handler.md @@ -45,7 +45,9 @@ int main() // new失敗時の動作をカスタマイズ std::set_new_handler(on_new_failed); - int* p = new int[std::numeric_limits::max()]; + auto n = std::numeric_limits::max(); + int* p = new int[n]; + delete[] p; } ``` * std::set_new_handler[color ff0000] @@ -57,5 +59,5 @@ int main() メモリ確保に失敗した This application has requested the Runtime to terminate it in an unusual way. -Please contact the application's support team for more information.
+Please contact the application's support team for more information. ``` From e26f8362f9bb04bbb4115180a13878f8182cfec3 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 23 Mar 2026 19:49:31 +0900 Subject: [PATCH 2648/3948] =?UTF-8?q?basic=5Fstring=20:=20=E3=82=B5?= =?UTF-8?q?=E3=83=B3=E3=83=97=E3=83=AB=E3=82=B3=E3=83=BC=E3=83=89=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/string/basic_string/op_deduction_guide.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reference/string/basic_string/op_deduction_guide.md b/reference/string/basic_string/op_deduction_guide.md index 138cf80c95..f2801cd177 100644 --- a/reference/string/basic_string/op_deduction_guide.md +++ b/reference/string/basic_string/op_deduction_guide.md @@ -89,7 +89,8 @@ int main() static_assert(std::is_same_v>); // string_viewからの推論 - std::basic_string s6 = "Hello"sv; + // explicit なので ="Hello"sv とはできない + std::basic_string s6("Hello"sv); static_assert(std::is_same_v>); } ``` From 50bc038bb33fa7ae617069bc05f10ae24fc44c0d Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 23 Mar 2026 20:02:13 +0900 Subject: [PATCH 2649/3948] =?UTF-8?q?out=5Fof=5Frange=20:=20=E3=82=B5?= =?UTF-8?q?=E3=83=B3=E3=83=97=E3=83=AB=E3=82=B3=E3=83=BC=E3=83=89=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/stdexcept/out_of_range.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/stdexcept/out_of_range.md b/reference/stdexcept/out_of_range.md index 8ba8b233ad..26d03814e9 100644 --- a/reference/stdexcept/out_of_range.md +++ b/reference/stdexcept/out_of_range.md @@ -36,7 +36,7 @@ int main() { try { std::cout << vec.at(3) << "\n"; } catch (const std::out_of_range& e) { - std::cerr << e.wnat() << "\n"; + std::cerr << e.what() << "\n"; } } ``` From f5ff3c716bcbb8fa976c40a4fa456da380f189bb Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 23 Mar 2026 20:04:09 +0900 Subject: [PATCH 2650/3948] =?UTF-8?q?jthread::get=5Fstop=5Fsource=20:=20?= =?UTF-8?q?=E3=82=B5=E3=83=B3=E3=83=97=E3=83=AB=E3=82=B3=E3=83=BC=E3=83=89?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit stop_source::request_stop() は非constなので、ラムダ式に mutable が必要です。 --- reference/thread/jthread/get_stop_source.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/thread/jthread/get_stop_source.md b/reference/thread/jthread/get_stop_source.md index 303b755fc7..2e408332f2 100644 --- a/reference/thread/jthread/get_stop_source.md +++ b/reference/thread/jthread/get_stop_source.md @@ -40,7 +40,7 @@ int main() // 別スレッドを立てて、そのスレッドからjt1スレッドに停止要求を発行する std::jthread jt2 { - [ssource = jt1.get_stop_source()]() { + [ssource = jt1.get_stop_source()]() mutable { ssource.request_stop(); } }; From d394b79434fcfccfda42129b5810824f86a8d553 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 23 Mar 2026 21:31:23 +0900 Subject: [PATCH 2651/3948] =?UTF-8?q?=E3=82=B5=E3=83=B3=E3=83=97=E3=83=AB?= =?UTF-8?q?=E3=82=B3=E3=83=BC=E3=83=89=E3=81=AE=20include=20=E4=B8=8D?= =?UTF-8?q?=E8=B6=B3=E3=81=AE=E3=82=A8=E3=83=A9=E3=83=BC=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp20/coroutines.md | 3 +++ reference/algorithm/ranges_set_intersection.md | 1 + reference/barrier/barrier.md | 1 + reference/coroutine/coroutine_handle.md | 1 + reference/coroutine/coroutine_traits.md | 1 + reference/coroutine/noop_coroutine.md | 1 + reference/coroutine/suspend_always.md | 1 + reference/coroutine/suspend_never.md | 1 + reference/filesystem/directory_entry/last_write_time.md | 1 + reference/shared_mutex/shared_mutex.md | 1 + reference/shared_mutex/shared_timed_mutex.md | 1 + reference/thread/jthread.md | 1 + reference/tuple/tuple/op_deduction_guide.md | 1 + reference/valarray/valarray/op_flip.md | 1 + 14 files changed, 16 insertions(+) diff --git a/lang/cpp20/coroutines.md b/lang/cpp20/coroutines.md index 5a7597d9bb..cfea5ce922 100644 --- a/lang/cpp20/coroutines.md +++ b/lang/cpp20/coroutines.md @@ -220,6 +220,8 @@ Promise型のスコープにおいて、非修飾な`get_return_object_on_alloca ```cpp example #include #include +#include // std::nothrow +#include // std::terminate() // メモリ確保が必要となったときは::operator new(size_t, nothrow_t)が使われる struct generator { @@ -455,6 +457,7 @@ _p_ をコルーチンPromiseオブジェクトのlvalue名とすると、`co_re #include #include #include +#include // std::terminate() // コルーチン利用ライブラリ: ジェネレータ型 struct my_generator { diff --git a/reference/algorithm/ranges_set_intersection.md b/reference/algorithm/ranges_set_intersection.md index f349845a73..f335372bef 100644 --- a/reference/algorithm/ranges_set_intersection.md +++ b/reference/algorithm/ranges_set_intersection.md @@ -144,6 +144,7 @@ set_intersection_result { #include #include #include +#include // std::inserter() int main() { diff --git a/reference/barrier/barrier.md b/reference/barrier/barrier.md index e4c8dca897..de2898af38 100644 --- a/reference/barrier/barrier.md +++ b/reference/barrier/barrier.md @@ -87,6 +87,7 @@ namespace std { #include #include #include +#include constexpr int NWORKERS = 2; // ワーカ数 constexpr int NPHASES = 3; // フェーズ数 diff --git a/reference/coroutine/coroutine_handle.md b/reference/coroutine/coroutine_handle.md index 630932db70..303dc8a368 100644 --- a/reference/coroutine/coroutine_handle.md +++ b/reference/coroutine/coroutine_handle.md @@ -114,6 +114,7 @@ C++コルーチンとC API(コールバック関数へのポインタと`void* #include #include #include +#include // std::terminate() struct task { struct promise_type { diff --git a/reference/coroutine/coroutine_traits.md b/reference/coroutine/coroutine_traits.md index 3c2a8c0e77..c583c37de6 100644 --- a/reference/coroutine/coroutine_traits.md +++ b/reference/coroutine/coroutine_traits.md @@ -35,6 +35,7 @@ using promise_type = typename R::promise_type; #include #include #include +#include // std::terminate() struct task; diff --git a/reference/coroutine/noop_coroutine.md b/reference/coroutine/noop_coroutine.md index 2d90f81e80..4dc5b693d4 100644 --- a/reference/coroutine/noop_coroutine.md +++ b/reference/coroutine/noop_coroutine.md @@ -33,6 +33,7 @@ noop_coroutine_handle noop_coroutine() noexcept; #include #include #include +#include // std::terminate() struct task { struct promise_type { diff --git a/reference/coroutine/suspend_always.md b/reference/coroutine/suspend_always.md index 039d79a135..242708cb9a 100644 --- a/reference/coroutine/suspend_always.md +++ b/reference/coroutine/suspend_always.md @@ -33,6 +33,7 @@ namespace std { #include #include #include +#include // std::terminate() struct task { struct promise_type { diff --git a/reference/coroutine/suspend_never.md b/reference/coroutine/suspend_never.md index a909bf231f..960bc13a3b 100644 --- a/reference/coroutine/suspend_never.md +++ b/reference/coroutine/suspend_never.md @@ -33,6 +33,7 @@ namespace std { #include #include #include +#include // std::terminate() struct task { struct promise_type { diff --git a/reference/filesystem/directory_entry/last_write_time.md b/reference/filesystem/directory_entry/last_write_time.md index ddcc12fb36..4174172713 100644 --- a/reference/filesystem/directory_entry/last_write_time.md +++ b/reference/filesystem/directory_entry/last_write_time.md @@ -32,6 +32,7 @@ file_time_type last_write_time(std::error_code& ec) const noexcept; // (2) #include #include #include +#include #include #include diff --git a/reference/shared_mutex/shared_mutex.md b/reference/shared_mutex/shared_mutex.md index ced29b2ea9..8c4397c306 100644 --- a/reference/shared_mutex/shared_mutex.md +++ b/reference/shared_mutex/shared_mutex.md @@ -64,6 +64,7 @@ namespace std { ```cpp example #include #include +#include #include #include diff --git a/reference/shared_mutex/shared_timed_mutex.md b/reference/shared_mutex/shared_timed_mutex.md index 854b1491f5..2cf7eedbef 100644 --- a/reference/shared_mutex/shared_timed_mutex.md +++ b/reference/shared_mutex/shared_timed_mutex.md @@ -70,6 +70,7 @@ namespace std { ```cpp example #include #include +#include #include #include diff --git a/reference/thread/jthread.md b/reference/thread/jthread.md index ccbb51401e..200c6c6f4f 100644 --- a/reference/thread/jthread.md +++ b/reference/thread/jthread.md @@ -128,6 +128,7 @@ int main() ```cpp example #include #include +#include int main() { diff --git a/reference/tuple/tuple/op_deduction_guide.md b/reference/tuple/tuple/op_deduction_guide.md index 051298d9a1..74ef0c1899 100644 --- a/reference/tuple/tuple/op_deduction_guide.md +++ b/reference/tuple/tuple/op_deduction_guide.md @@ -46,6 +46,7 @@ namespace std { ```cpp example #include #include +#include // std::pair int main() { diff --git a/reference/valarray/valarray/op_flip.md b/reference/valarray/valarray/op_flip.md index d529dd076e..39c0199a47 100644 --- a/reference/valarray/valarray/op_flip.md +++ b/reference/valarray/valarray/op_flip.md @@ -36,6 +36,7 @@ return result; #include #include #include +#include // std::all_of() int main() { From 0fd244266081c2ea7358d81398a03077aa872b07 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Mon, 23 Mar 2026 23:12:31 +0900 Subject: [PATCH 2652/3948] =?UTF-8?q?format=20:=20=E3=82=B5=E3=83=B3?= =?UTF-8?q?=E3=83=97=E3=83=AB=E3=82=B3=E3=83=BC=E3=83=89=E3=81=AE=E5=87=BA?= =?UTF-8?q?=E5=8A=9B=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/format.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/reference/format/format.md b/reference/format/format.md index b4265b9d88..be84af4fe2 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -581,11 +581,11 @@ int main() #### 出力 ``` -[1, 2, 3] -[3, 2, 1] -[1, 2, 3] -{1: "aaa", 2: "bbb"} -{1, 2, 3} +queue: [1, 2, 3] +priority_queue: [3, 2, 1] +stack: [1, 2, 3] +flat_map: {1: "aaa", 2: "bbb"} +flat_set: {1, 2, 3} ``` ### `vector`を出力する (C++23) From b5fdf000a1964c359d542faf1b15688b6baa78f4 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 24 Mar 2026 13:23:43 +0900 Subject: [PATCH 2653/3948] =?UTF-8?q?C++26=E5=AF=BE=E5=BF=9C=E3=81=A8?= =?UTF-8?q?=E3=81=97=E3=81=A6=E3=80=81text=5Fencoding=E3=83=A9=E3=82=A4?= =?UTF-8?q?=E3=83=96=E3=83=A9=E3=83=AA=E3=82=92=E8=BF=BD=E5=8A=A0=20#1191?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 2 +- lang/cpp26/feature_test_macros.md | 2 +- reference.md | 2 +- reference/locale/locale.md | 1 + reference/locale/locale/encoding.md | 66 +++ reference/text_encoding.md | 179 ++++++++ reference/text_encoding/text_encoding.md | 175 ++++++++ .../text_encoding/text_encoding/aliases.md | 76 ++++ .../text_encoding/aliases_view.md | 76 ++++ .../text_encoding/text_encoding/comp-name.md | 66 +++ .../text_encoding/environment.md | 111 +++++ .../text_encoding/environment_is.md | 59 +++ reference/text_encoding/text_encoding/id.md | 387 ++++++++++++++++++ .../text_encoding/text_encoding/literal.md | 101 +++++ reference/text_encoding/text_encoding/mib.md | 57 +++ reference/text_encoding/text_encoding/name.md | 81 ++++ .../text_encoding/op_constructor.md | 86 ++++ .../text_encoding/text_encoding/op_equal.md | 74 ++++ 18 files changed, 1598 insertions(+), 3 deletions(-) create mode 100644 reference/locale/locale/encoding.md create mode 100644 reference/text_encoding.md create mode 100644 reference/text_encoding/text_encoding.md create mode 100644 reference/text_encoding/text_encoding/aliases.md create mode 100644 reference/text_encoding/text_encoding/aliases_view.md create mode 100644 reference/text_encoding/text_encoding/comp-name.md create mode 100644 reference/text_encoding/text_encoding/environment.md create mode 100644 reference/text_encoding/text_encoding/environment_is.md create mode 100644 reference/text_encoding/text_encoding/id.md create mode 100644 reference/text_encoding/text_encoding/literal.md create mode 100644 reference/text_encoding/text_encoding/mib.md create mode 100644 reference/text_encoding/text_encoding/name.md create mode 100644 reference/text_encoding/text_encoding/op_constructor.md create mode 100644 reference/text_encoding/text_encoding/op_equal.md diff --git a/lang/cpp26.md b/lang/cpp26.md index 9ab5b29e11..56d65a763e 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -125,7 +125,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 ## ライブラリ更新の概要 ### 新ライブラリ -- 文字列エンコーディングを識別するライブラリとして、[``](/reference/text_encoding.md.nolink)を追加 +- 文字列エンコーディングを識別するライブラリとして、[``](/reference/text_encoding.md)を追加 - 要素のメモリ位置が安定するシーケンスコンテナのライブラリとして[``](/reference/hive.md.nolink)を追加 - 並行処理におけるデータの参照・更新を行うRCU (Read Copy Update) のライブラリとして、[``](/reference/rcu.md)を追加 - 並行処理において参照中のデータが更新されないよう保護するハザードポインタのライブラリとして、[``](/reference/hazard_pointer.md.nolink)を追加 diff --git a/lang/cpp26/feature_test_macros.md b/lang/cpp26/feature_test_macros.md index 2a7e17d02e..c04f9b33b3 100755 --- a/lang/cpp26/feature_test_macros.md +++ b/lang/cpp26/feature_test_macros.md @@ -152,7 +152,7 @@ |`__cpp_lib_string_view`|`202403L`|[`std::basic_string`](/reference/string/basic_string.md)と[`std::basic_string_view`](/reference/string_view/basic_string_view.md)を連結させる`operator+`を追加|[``](/reference/string.md), [``](/reference/string_view.md)| |`__cpp_lib_submdspan`|`202411L`|[`std::mdspan`](/reference/mdspan/mdspan.md)から部分ビューを取り出す[`std::submdspan()`](/reference/mdspan/submdspan.md)を追加|[``](/reference/mdspan.md)| |`__cpp_lib_task`|`202506L`||[``](/reference/execution.md)| -|`__cpp_lib_text_encoding`|`202306L`|文字列エンコーディングを識別するライブラリ[``](/reference/text_encoding.md.nolink)を追加|[``](/reference/text_encoding.md.nolink)| +|`__cpp_lib_text_encoding`|`202306L`|文字列エンコーディングを識別するライブラリ[``](/reference/text_encoding.md)を追加|[``](/reference/text_encoding.md)| |`__cpp_lib_to_chars`|`202306L`|[`std::to_chars_result`](/reference/charconv/to_chars_result.md)と[`std::from_chars_result`](/reference/charconv/from_chars_result.md)に`operator bool`を追加|[``](/reference/charconv.md)| |`__cpp_lib_to_string`|`202306L`|[`std::to_string`](/reference/string/to_string.md)の変換結果を`sprintf()`ベースから`std::format()`ベースに変更|[``](/reference/string.md)| |`__cpp_lib_trivially_relocatable`|`202502L`|トリビアルな再配置|[``](/reference/memory.md), [``](/reference/type_traits.md)| diff --git a/reference.md b/reference.md index 369c75a62f..6962fe8e8b 100644 --- a/reference.md +++ b/reference.md @@ -92,7 +92,7 @@ | ヘッダ | 説明 | 対応バージョン | |--------------------------------------|----------------------|----------------| | [``](/reference/locale.md) | ロケール | | -| [``](/reference/text_encoding.md.nolink) | 文字列エンコーディングの識別 | C++26 | +| [``](/reference/text_encoding.md) | 文字列エンコーディングの識別 | C++26 | | [``](/reference/codecvt.md) | コード変換ファセット | C++11
C++17から非推奨
C++26で削除 | diff --git a/reference/locale/locale.md b/reference/locale/locale.md index 76447a619e..e164b731c3 100644 --- a/reference/locale/locale.md +++ b/reference/locale/locale.md @@ -21,6 +21,7 @@ namespace std { | `operator=` | 代入演算子 | | `combine` | 合成 | | `name` | 名前の取得 | +| [`encoding`](locale/encoding.md) | エンコーディングの取得 (C++26) | | [`operator==`](locale/op_equal.md) | 等値比較 | | [`operator!=`](locale/op_not_equal.md) | 非等値比較 | | `operator()` | 照合オブジェクトを使用した文字列比較 | diff --git a/reference/locale/locale/encoding.md b/reference/locale/locale/encoding.md new file mode 100644 index 0000000000..766b1a7874 --- /dev/null +++ b/reference/locale/locale/encoding.md @@ -0,0 +1,66 @@ +# locale::encoding +* locale[meta header] +* std[meta namespace] +* locale[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +text_encoding encoding() const; // (1) C++26 +``` +* text_encoding[link /reference/text_encoding/text_encoding.md] + +## 概要 +ロケールに関連付けられたエンコーディングを取得する。 + + +## 適格要件 +- `CHAR_BIT == 8`であること + + +## 戻り値 +`*this`に関連付けられた実装定義のエンコーディングスキームを表す[`std::text_encoding`](/reference/text_encoding/text_encoding.md)オブジェクトを返す。 + + +## 例 +```cpp example +#include +#include +#include + +int main() { + // デフォルト("C")ロケールのエンコーディング + std::locale c_loc; + std::println("C locale encoding: {}", c_loc.encoding().name()); + + // 環境ロケールのエンコーディング + std::locale env_loc(""); + std::println("Environment locale encoding: {}", env_loc.encoding().name()); + + // 環境エンコーディングとの比較 + if (env_loc.encoding() == std::text_encoding::environment()) { + std::println("Locale encoding matches environment encoding"); + } +} +``` + +### 出力例 +``` +C locale encoding: US-ASCII +Environment locale encoding: UTF-8 +Locale encoding matches environment encoding +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P1885R12 Naming Text Encodings to Demystify Them](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1885r12.pdf) diff --git a/reference/text_encoding.md b/reference/text_encoding.md new file mode 100644 index 0000000000..af45379a43 --- /dev/null +++ b/reference/text_encoding.md @@ -0,0 +1,179 @@ +# text_encoding +* text_encoding[meta header] +* cpp26[meta cpp] + +``ヘッダでは、テキストエンコーディングを識別するためのクラスおよび関数を定義する。 + +## 概要 + +C++プログラムにおけるテキストエンコーディングは、大きく以下の3種類に分けられる: + +1. **リテラルエンコーディング** : コンパイル時に決定される、文字列リテラルのエンコーディング +2. **環境エンコーディング** : 実行時の環境(OS・シェル)が期待するエンコーディング +3. **ロケールエンコーディング** : [`std::locale`](/reference/locale/locale.md)オブジェクトに関連付けられたエンコーディング + +従来のC++では、これらのエンコーディングに関する情報はロケール経由でしか取得できず、実際の環境と一致しないことが多かった。``ヘッダは、ロケールに依存せずにエンコーディングを識別・比較する手段を提供する。 + +エンコーディングの識別には[IANA文字集合](https://www.iana.org/assignments/character-sets/character-sets.xhtml)レジストリを使用し、エンコーディング名・MIB番号・エイリアスによる相互運用性を確保する。 + +### リテラルエンコーディングとは + +リテラルエンコーディング(ordinary literal encoding)とは、コンパイラが文字列リテラル(`"hello"`など)をオブジェクトファイルに書き込む際に使用するエンコーディングである。これはコンパイル時に決定され、[`std::text_encoding::literal()`](text_encoding/text_encoding/literal.md)で取得できる。`consteval`関数であるため、コンパイル時定数として使用できる。 + +各コンパイラにおけるリテラルエンコーディングの決定方法は以下の通り: + +| コンパイラ | デフォルト | 変更方法 | +|-----------|-----------|---------| +| GCC | UTF-8 | `-fexec-charset=エンコーディング名` | +| Clang | UTF-8 | `-fexec-charset=エンコーディング名` | +| MSVC | システムのアクティブコードページ(日本語環境ではShift_JIS / CP932) | `/execution-charset:utf-8` または `/utf-8`(ソース・実行両方をUTF-8にする) | + +日本語環境における注意点として、GCCおよびClangはデフォルトで UTF-8 を使用するが、MSVCは日本語Windowsのアクティブコードページ(Shift_JIS / Windows-31J, CP932)をデフォルトとする。そのため、MSVCでUTF-8リテラルを使いたい場合は明示的にオプションを指定する必要がある。 + +### 環境エンコーディングとは + +環境エンコーディングとは、プログラムの実行環境が文字列の入出力に使用することを期待するエンコーディングである。[`std::text_encoding::environment()`](text_encoding/text_encoding/environment.md)で取得できる。 + +環境エンコーディングは以下のものに適用される: + +- **コマンドライン引数** (`argv`) +- **環境変数** (`std::getenv()`で取得される値) +- **標準入出力** (リダイレクトされていない`stdin` / `stdout` / `stderr`) + +環境エンコーディングは実行環境のプロパティであり、コンパイル環境ではない。クロスコンパイルの場合、リテラルエンコーディング(コンパイル環境で決定)と環境エンコーディング(実行環境で決定)は異なりうる。 + +各プラットフォームにおける環境エンコーディングの決定方法: + +| プラットフォーム | 決定方法 | +|----------------|---------| +| Linux / macOS | POSIXロケール(空文字列`""`)に関連付けられたエンコーディング。環境変数`LC_CTYPE`、`LC_ALL`、`LANG`から決定される。近年のLinux / macOSでは多くの場合UTF-8 | +| Windows | `GetACP()`が返すアクティブコードページ。日本語環境ではCP932(Shift_JIS系) | + +注意として、Windowsではコンソールのコードページ(`GetConsoleCP()`/`GetConsoleOutputCP()`で取得)が環境エンコーディングと異なる場合がある。``の環境エンコーディングはコンソールのコードページではなく、プロセスのアクティブコードページを返す。 + +[`std::text_encoding::environment()`](text_encoding/text_encoding/environment.md)は`setlocale()`の呼び出しに影響されないことが推奨されている。これは、プログラムの初期化時にCロケールが設定されることによって環境の情報が失われることを防ぐためである。 + +### ロケールに依存しないエンコーディング取得 + +従来のC++では、テキストエンコーディングの情報はロケールと結び付いていた。しかし、Unicodeモデルではエンコーディングとロケール(書式設定やテキスト変換のルール)は直交する概念である。 + +`std::text_encoding`クラスは、ロケールに依存せずにエンコーディングを取得・判定する手段を提供する: + +- [`std::text_encoding::literal()`](text_encoding/text_encoding/literal.md)は`consteval`関数であり、ロケールとは完全に独立している +- [`std::text_encoding::environment()`](text_encoding/text_encoding/environment.md)は実行時関数だが、`setlocale()`の影響を受けない(推奨実装) +- [`std::text_encoding::environment_is()`](text_encoding/text_encoding/environment_is.md)により、特定のエンコーディングかどうかをロケール操作なしに判定できる + +これにより、ロケールを変更することなく、環境が期待するエンコーディングを安全に取得できる。 + +## クラス + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`text_encoding`](text_encoding/text_encoding.md) | テキストエンコーディングを識別するクラス (class) | C++26 | + + +## ユースケース + +### C++26仕様でのユースケース + +#### リテラルエンコーディングの確認 + +コンパイル時に文字列リテラルのエンコーディングがUTF-8であることを保証する: + +```cpp example +#include + +// コンパイル時にリテラルエンコーディングを検証 +static_assert(std::text_encoding::literal() == std::text_encoding::id::UTF8, + "This program requires UTF-8 literal encoding"); + +int main() {} +``` + +#### 環境エンコーディングとリテラルエンコーディングの互換性確認 + +実行時に、リテラルエンコーディングと環境エンコーディングが一致するかを確認する: + +```cpp example +#include +#include + +int main() { + if (std::text_encoding::literal() != std::text_encoding::environment()) { + std::println(std::cerr, + "Warning: literal encoding ({}) differs from environment encoding ({})", + std::text_encoding::literal().name(), + std::text_encoding::environment().name()); + } +} +``` + +#### 外部ライブラリとの相互運用 + +ICU、iconv等のライブラリにエンコーディング名を渡す: + +```cpp example +#include +#include +#include + +#include + +int main() { + // iconvを使用してUTF-8から環境エンコーディングに変換 + iconv_t conv = iconv_open( + std::text_encoding::environment().name(), + "UTF-8"); + + // ICUを使用する場合 + UErrorCode err; + UConverter* converter = ucnv_open( + std::text_encoding::environment().name(), + &err); +} +``` + +#### µs表記の安全な使用 + +リテラルと出力先のエンコーディングがともにUTF-8である場合にのみ、µ記号を使用する: + +```cpp example +#include +#include +#include + +void print_microseconds(int count) { + if constexpr (std::text_encoding::literal() == std::text_encoding::id::UTF8) { + if (std::locale().encoding() == std::text_encoding::id::UTF8) { + std::println("{}\u00B5s", count); // µs + return; + } + } + std::println("{}us", count); +} + +int main() { + print_microseconds(42); +} +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`std::locale::encoding()`](locale/locale/encoding.md) : ロケールに関連付けられたエンコーディングの取得 + + +## 参照 +- [P1885R12 Naming Text Encodings to Demystify Them](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1885r12.pdf) +- [P2862R1 `text_encoding::name()` should never return null values](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2862r1.html) +- [IANA Character Sets](https://www.iana.org/assignments/character-sets/character-sets.xhtml) +- [Unicode Technical Standard #22: Unicode Character Mapping Markup Language](https://www.unicode.org/reports/tr22/) diff --git a/reference/text_encoding/text_encoding.md b/reference/text_encoding/text_encoding.md new file mode 100644 index 0000000000..fcca0942eb --- /dev/null +++ b/reference/text_encoding/text_encoding.md @@ -0,0 +1,175 @@ +# text_encoding +* text_encoding[meta header] +* std[meta namespace] +* class[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + struct text_encoding; +} +``` + +## 概要 +`std::text_encoding`クラスは、IANA文字集合レジストリに基づいてテキストエンコーディングを識別するクラスである。エンコーディング名、MIB番号(Management Information Base enumeration)、およびエイリアスによるエンコーディングの識別・比較機能を提供する。 + +このクラスは、ロケールに依存せずにエンコーディングを取得・比較する手段を提供する。従来のC++ではエンコーディング情報はロケール経由でしか取得できなかったが、`std::text_encoding`はロケールとは独立して動作する。 + +- [`literal()`](text_encoding/literal.md)は`consteval`関数であり、コンパイル時にリテラルエンコーディングを取得できる +- [`environment()`](text_encoding/environment.md)は`setlocale()`の影響を受けず、プログラム起動時の環境エンコーディングを返す +- [`environment_is()`](text_encoding/environment_is.md)により、特定のエンコーディングかどうかを効率的に判定できる + +`std::text_encoding`はトリビアルコピー可能な型であり、例外を送出しない。`CHAR_BIT == 8`が要求される。 + +IANAに登録されていないエンコーディングも、[`id::other`](text_encoding/id.md)として名前で管理できる。 + + +## メンバ関数 + +### 構築 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`(constructor)`](text_encoding/op_constructor.md) | コンストラクタ | C++26 | + +### 観測 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`mib`](text_encoding/mib.md) | MIB列挙値の取得 | C++26 | +| [`name`](text_encoding/name.md) | エンコーディング名の取得 | C++26 | +| [`aliases`](text_encoding/aliases.md) | エイリアス一覧の取得 | C++26 | + + +## 静的メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`literal`](text_encoding/literal.md) | リテラルエンコーディングの取得 | C++26 | +| [`environment`](text_encoding/environment.md) | 環境エンコーディングの取得 | C++26 | +| [`environment_is`](text_encoding/environment_is.md) | 環境エンコーディングが指定したエンコーディングかを判定 | C++26 | + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`id`](text_encoding/id.md) | MIB列挙型 (enum class) | C++26 | +| [`aliases_view`](text_encoding/aliases_view.md) | エイリアスのビュー (class) | C++26 | + + +## メンバ定数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `static constexpr size_t max_name_length = 63;` | エンコーディング名の最大長 | C++26 | + + +## 非メンバ関数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`operator==`](text_encoding/op_equal.md) | 等値比較 | C++26 | +| [`operator!=`](text_encoding/op_equal.md) | 非等値比較 (`==`により使用可能) | C++26 | + + +## ハッシュサポート + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `template<> struct hash` | `hash`の特殊化 | C++26 | + + +## 説明専用メンバ + +| 名前 | 説明 | +|------|------| +| `id mib_ = id::unknown;` | MIB値を保持する | +| `char name_[max_name_length + 1] = {0};` | エンコーディング名を保持する | +| [`comp-name`](text_encoding/comp-name.md) | エンコーディング名の比較(Unicode Technical Standard #22準拠) | + + +## 例 +### エンコーディング情報の表示 +```cpp example +#include +#include + +void print(const std::text_encoding& enc) { + std::println("{} (IANA MIB: {})", enc.name(), static_cast(enc.mib())); + std::println("Aliases:"); + for (auto&& alias : enc.aliases()) { + std::println(" {}", alias); + } +} + +int main() { + std::println("Literal encoding: "); + ::print(std::text_encoding::literal()); + + std::println("Environment encoding: "); + ::print(std::text_encoding::environment()); +} +``` + +#### 出力例 +``` +Literal encoding: UTF-8 (IANA MIB: 106) +Aliases: + UTF-8 + csUTF8 +Environment encoding: UTF-8 (IANA MIB: 106) +Aliases: + UTF-8 + csUTF8 +``` + +### エンコーディング名の指定 +```cpp example +#include +#include +#include + +int main() { + using namespace std::string_view_literals; + + // エンコーディング名から構築 + std::text_encoding my_utf8{"utf8"}; + assert(my_utf8.name() == "utf8"sv); + assert(my_utf8.mib() == std::text_encoding::id::UTF8); + + // MIB値から構築 + std::text_encoding my_utf8_2{std::text_encoding::id::UTF8}; + assert(my_utf8_2.mib() == std::text_encoding::id::UTF8); + + // 異なる名前でも同じエンコーディングなら等値 + assert(my_utf8 == my_utf8_2); + + // 未登録のエンコーディングもサポート + std::text_encoding wtf8{"WTF-8"}; + assert(wtf8.name() == "WTF-8"sv); + assert(wtf8.mib() == std::text_encoding::id::other); + // otherのMIBを持つエンコーディングは名前で比較される + assert(wtf8 == std::text_encoding{"___wtf8__"}); +} +``` + +#### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P1885R12 Naming Text Encodings to Demystify Them](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1885r12.pdf) +- [P2862R1 `text_encoding::name()` should never return null values](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2862r1.html) +- [IANA Character Sets](https://www.iana.org/assignments/character-sets/character-sets.xhtml) diff --git a/reference/text_encoding/text_encoding/aliases.md b/reference/text_encoding/text_encoding/aliases.md new file mode 100644 index 0000000000..0179fd8a19 --- /dev/null +++ b/reference/text_encoding/text_encoding/aliases.md @@ -0,0 +1,76 @@ +# text_encoding::aliases +* text_encoding[meta header] +* std[meta namespace] +* text_encoding[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr aliases_view aliases() const noexcept; +``` + +## 概要 +エンコーディングのエイリアス(別名)一覧を取得する。 + + +## 戻り値 +`*this`が既知の登録済み文字エンコーディングを表す場合、以下を満たす[`aliases_view`](aliases_view.md)オブジェクト`r`を返す: + +- `r.front()`はIANAレジストリで定義されたプライマリ名を返す +- `r`は登録済みエンコーディングのエイリアスを含む +- `r`は`strcmp`で比較した場合に重複する値を含まない + +そうでない場合([`id::unknown`](id.md)または[`id::other`](id.md)の場合)、空のRangeを返す。 + +`r`の各要素は、通常リテラルエンコーディングでエンコードされた非ヌルの空でないヌル終端バイト文字列であり、基本文字集合の文字のみで構成される。 + +エイリアスの順序は未規定である。 + + +## 例外 +投げない。 + + +## 例 +```cpp example +#include +#include + +int main() { + std::text_encoding enc{std::text_encoding::id::UTF8}; + std::println("Aliases for UTF-8:"); + for (const char* alias : enc.aliases()) { + std::println(" {}", alias); + } + + // 未登録エンコーディングのエイリアスは空 + std::text_encoding other{"WTF-8"}; + std::print("Aliases for WTF-8: "); + auto aliases = other.aliases(); + if (aliases.begin() == aliases.end()) { + std::println("(none)"); + } +} +``` + +### 出力例 +``` +Aliases for UTF-8: + UTF-8 + csUTF8 +Aliases for WTF-8: (none) +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P1885R12 Naming Text Encodings to Demystify Them](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1885r12.pdf) diff --git a/reference/text_encoding/text_encoding/aliases_view.md b/reference/text_encoding/text_encoding/aliases_view.md new file mode 100644 index 0000000000..0239c5bbfe --- /dev/null +++ b/reference/text_encoding/text_encoding/aliases_view.md @@ -0,0 +1,76 @@ +# text_encoding::aliases_view +* text_encoding[meta header] +* std[meta namespace] +* text_encoding[meta class] +* class[meta id-type] +* cpp26[meta cpp] + +```cpp +struct text_encoding::aliases_view : ranges::view_interface { + constexpr implementation-defined begin() const; + constexpr implementation-defined end() const; +}; +``` + +## 概要 +`aliases_view`は、エンコーディングのエイリアス(別名)一覧を提供するビュークラスである。 + +このクラスは以下のコンセプトをモデル化する: + +- [`copyable`](/reference/concepts/copyable.md) +- [`ranges::view`](/reference/ranges/view.md) +- [`ranges::random_access_range`](/reference/ranges/random_access_range.md) +- [`ranges::borrowed_range`](/reference/ranges/borrowed_range.md) + +[`ranges::range_value_t`](/reference/ranges/range_value_t.md)``および[`ranges::range_reference_t`](/reference/ranges/range_reference_t.md)``はともに`const char*`を表す。 + + +## 例 +```cpp example +#include +#include +#include + +int main() { + std::text_encoding enc{std::text_encoding::id::ShiftJIS}; + auto aliases = enc.aliases(); + + // プライマリ名 + if (aliases.begin() != aliases.end()) { + std::println("Primary name: {}", aliases.front()); + } + + // すべてのエイリアスを表示 + std::println("All aliases:"); + for (const char* alias : aliases) { + std::println(" {}", alias); + } + + // random_access_rangeなのでサイズも取得可能 + std::println("Number of aliases: {}", std::ranges::distance(aliases)); +} +``` + +### 出力例 +``` +Primary name: Shift_JIS +All aliases: + Shift_JIS + MS_Kanji + csShiftJIS +Number of aliases: 3 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P1885R12 Naming Text Encodings to Demystify Them](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1885r12.pdf) diff --git a/reference/text_encoding/text_encoding/comp-name.md b/reference/text_encoding/text_encoding/comp-name.md new file mode 100644 index 0000000000..4b9a9305a7 --- /dev/null +++ b/reference/text_encoding/text_encoding/comp-name.md @@ -0,0 +1,66 @@ +# text_encoding::comp-name +* text_encoding[meta header] +* std[meta namespace] +* text_encoding[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +static constexpr bool comp-name(string_view a, string_view b); // 説明専用 +``` + +## 概要 +2つのエンコーディング名が等価かどうかを比較する説明専用の関数。Unicode Technical Standard #22で定義された「Charset Alias Matching」アルゴリズムに従う。 + + +## 戻り値 +通常リテラルエンコーディングでエンコードされた2つの文字列`a`と`b`が、以下の条件を無視して等しい場合に`true`を返す。左から右に比較し、以下を無視する: + +- 数字でも英字でもないすべての要素 +- 大文字と小文字の違い +- 数値プレフィックスの直後にない`0`の連続。数値プレフィックスとは、`[1-9]`の範囲の数字の後に、任意個の数字でも英字でもない要素が続くシーケンスのこと + +そうでなければ`false`を返す。 + + +## 例 +```cpp example +#include +#include + +int main() { + // comp-nameは説明専用だが、同等の動作を示す例として + // text_encodingコンストラクタとoperator==で確認できる + + // ハイフン・大文字小文字の無視 + // comp-name("UTF-8", "utf8") == true + std::text_encoding a{"UTF-8"}; + std::text_encoding b{"utf8"}; + assert(a == b); + + // 非英数字の無視、先頭の0の無視 + // comp-name("u.t.f-008", "utf8") == true + std::text_encoding c{"u.t.f-008"}; + assert(a == c); + + // 未登録エンコーディング同士も名前で比較される + // comp-name("WTF-8", "wtf8") == true + std::text_encoding d{"WTF-8"}; // other + std::text_encoding e{"wtf8"}; // other + assert(d == e); +} +``` + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + + +## 参照 +- [P1885R12 Naming Text Encodings to Demystify Them](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1885r12.pdf) +- [Unicode Technical Standard #22: Charset Alias Matching](https://www.unicode.org/reports/tr22/#Charset_Alias_Matching) diff --git a/reference/text_encoding/text_encoding/environment.md b/reference/text_encoding/text_encoding/environment.md new file mode 100644 index 0000000000..dde7474d62 --- /dev/null +++ b/reference/text_encoding/text_encoding/environment.md @@ -0,0 +1,111 @@ +# text_encoding::environment +* text_encoding[meta header] +* std[meta namespace] +* text_encoding[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +static text_encoding environment(); +``` + +## 概要 +環境エンコーディングを取得する。 + +環境エンコーディングとは、プログラムの実行環境が文字列の入出力に使用することを期待するエンコーディングである。これはコンパイル時ではなく実行時に決定される。 + + +## 適格要件 +`CHAR_BIT == 8`であること。 + + +## 戻り値 +実装定義の環境の文字エンコーディングスキームを表す`text_encoding`オブジェクトを返す。 + +POSIX実装では、空文字列`""`で表されるPOSIXロケールに関連付けられたエンコーディングスキームが返される。 + + +## 備考 +この関数は`setlocale()`の呼び出しに影響されない。 + +推奨される実装として、POSIXの`setenv()`関数やその他の環境を変更できる関数の呼び出しによっても影響されないことが望ましい。 + +### 環境エンコーディングが適用される対象 + +環境エンコーディングは以下のものに対して使用されることが期待されるエンコーディングである: + +- **コマンドライン引数** : `main()`の`argv`で受け取る文字列 +- **環境変数** : `std::getenv()`等で取得する値 +- **標準入出力** : リダイレクトされていない`stdin`、`stdout`、`stderr` + +### コンパイル環境と実行環境の違い + +環境エンコーディングは**実行環境**(ターゲット環境)のプロパティであり、コンパイル環境のプロパティではない。クロスコンパイルを行う場合、コンパイル環境と実行環境のエンコーディングは異なりうる。 + +一方、[`literal()`](literal.md)はコンパイル時に決定されるため、コンパイル環境のオプションによって決定される。 + +### 各プラットフォームでの決定方法 + +#### Linux +環境変数`LC_CTYPE`、`LC_ALL`、`LANG`(この優先順位で)から決定される。近年のディストリビューションでは多くの場合UTF-8である。 + +推奨実装として`/proc/self/environ`を解析することで、プログラム起動後の`setenv()`の影響を受けない初期の環境変数を取得できる。 + +#### macOS +Linuxと同様にPOSIXロケールから決定される。macOSではデフォルトでUTF-8が使用される。 + +推奨実装として`sysctl({CTL_KERN, KERN_PROCARGS, pid})`で初期環境を取得できる。 + +#### Windows +`GetACP()`が返すアクティブコードページによって決定される。 + +- 日本語環境: CP932 (Windows-31J, Shift_JIS系) +- 英語環境: CP1252 (Windows-1252) +- UTF-8設定有効時: CP65001 (UTF-8) + +注意点として、Windowsではコンソールのコードページ(`GetConsoleCP()`/`GetConsoleOutputCP()`)がアクティブコードページと異なる場合がある。`environment()`はアクティブコードページを返し、コンソールのコードページではない。 + +`GetACP()`は`setenv()`の影響を受けないため、Windowsでは推奨実装が自然に満たされる。 + + +## 例 +```cpp example +#include +#include + +int main() { + auto env = std::text_encoding::environment(); + std::println("Environment encoding: {}", env.name()); + std::println("MIB: {}", static_cast(env.mib())); + + // リテラルエンコーディングと環境エンコーディングの比較 + auto lit = std::text_encoding::literal(); + if (lit == env) { + std::println("Literal and environment encodings match"); + } else { + std::println("WARNING: Literal encoding ({}) differs from environment encoding ({})", + lit.name(), env.name()); + } +} +``` + +### 出力例 +``` +Environment encoding: UTF-8 +MIB: 106 +Literal and environment encodings match +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P1885R12 Naming Text Encodings to Demystify Them](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1885r12.pdf) diff --git a/reference/text_encoding/text_encoding/environment_is.md b/reference/text_encoding/text_encoding/environment_is.md new file mode 100644 index 0000000000..9ed3ead7de --- /dev/null +++ b/reference/text_encoding/text_encoding/environment_is.md @@ -0,0 +1,59 @@ +# text_encoding::environment_is +* text_encoding[meta header] +* std[meta namespace] +* text_encoding[meta class] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +static bool environment_is(); +``` + +## 概要 +環境エンコーディングが指定したエンコーディングかどうかを判定する。 + +この関数は[`environment()`](environment.md)を呼び出して比較するのと同等だが、実装によっては指定されたエンコーディングに関する情報のみをプログラムに取り込むことで、エイリアスデータベース全体を取り込まずに済む最適化が可能である。 + + +## 適格要件 +`CHAR_BIT == 8`であること。 + + +## 戻り値 +[`environment()`](environment.md) `== i` + + +## 例 +```cpp example +#include +#include + +int main() { + if (std::text_encoding::environment_is()) { + std::println("Environment uses UTF-8"); + } else { + std::println("Environment does not use UTF-8"); + std::println("Encoding: {}", std::text_encoding::environment().name()); + } +} +``` + +### 出力例 +``` +Environment uses UTF-8 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P1885R12 Naming Text Encodings to Demystify Them](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1885r12.pdf) diff --git a/reference/text_encoding/text_encoding/id.md b/reference/text_encoding/text_encoding/id.md new file mode 100644 index 0000000000..50cb29e260 --- /dev/null +++ b/reference/text_encoding/text_encoding/id.md @@ -0,0 +1,387 @@ +# text_encoding::id +* text_encoding[meta header] +* std[meta namespace] +* text_encoding[meta class] +* enum[meta id-type] +* cpp26[meta cpp] + +```cpp +enum class id : int_least32_t { + other = 1, + unknown = 2, + ASCII = 3, + ISOLatin1 = 4, + ISOLatin2 = 5, + ISOLatin3 = 6, + ISOLatin4 = 7, + ISOLatinCyrillic = 8, + ISOLatinArabic = 9, + ISOLatinGreek = 10, + ISOLatinHebrew = 11, + ISOLatin5 = 12, + ISOLatin6 = 13, + ISOTextComm = 14, + HalfWidthKatakana = 15, + JISEncoding = 16, + ShiftJIS = 17, + EUCPkdFmtJapanese = 18, + EUCFixWidJapanese = 19, + ISO4UnitedKingdom = 20, + ISO11SwedishForNames = 21, + ISO15Italian = 22, + ISO17Spanish = 23, + ISO21German = 24, + ISO60DanishNorwegian = 25, + ISO69French = 26, + ISO10646UTF1 = 27, + ISO646basic1983 = 28, + INVARIANT = 29, + ISO2IntlRefVersion = 30, + NATSSEFI = 31, + NATSSEFIADD = 32, + // NATS-DANO (33) とNATS-DANO-ADD (34) はcomp-nameの曖昧さにより除外 + ISO10Swedish = 35, + KSC56011987 = 36, + ISO2022KR = 37, + EUCKR = 38, + ISO2022JP = 39, + ISO2022JP2 = 40, + ISO13JISC6220jp = 41, + ISO14JISC6220ro = 42, + ISO16Portuguese = 43, + ISO18Greek7Old = 44, + ISO19LatinGreek = 45, + ISO25French = 46, + ISO27LatinGreek1 = 47, + ISO5427Cyrillic = 48, + ISO42JISC62261978 = 49, + ISO47BSViewdata = 50, + ISO49INIS = 51, + ISO50INIS8 = 52, + ISO51INISCyrillic = 53, + ISO54271981 = 54, + ISO5428Greek = 55, + ISO57GB1988 = 56, + ISO58GB231280 = 57, + ISO61Norwegian2 = 58, + ISO70VideotexSupp1 = 59, + ISO84Portuguese2 = 60, + ISO85Spanish2 = 61, + ISO86Hungarian = 62, + ISO87JISX0208 = 63, + ISO88Greek7 = 64, + ISO89ASMO449 = 65, + ISO90 = 66, + ISO91JISC62291984a = 67, + ISO92JISC62991984b = 68, + ISO93JIS62291984badd = 69, + ISO94JIS62291984hand = 70, + ISO95JIS62291984handadd = 71, + ISO96JISC62291984kana = 72, + ISO2033 = 73, + ISO99NAPLPS = 74, + ISO102T617bit = 75, + ISO103T618bit = 76, + ISO111ECMACyrillic = 77, + ISO121Canadian1 = 78, + ISO122Canadian2 = 79, + ISO123CSAZ24341985gr = 80, + ISO88596E = 81, + ISO88596I = 82, + ISO128T101G2 = 83, + ISO88598E = 84, + ISO88598I = 85, + ISO139CSN369103 = 86, + ISO141JUSIB1002 = 87, + ISO143IECP271 = 88, + ISO146Serbian = 89, + ISO147Macedonian = 90, + ISO150 = 91, + ISO151Cuba = 92, + ISO6937Add = 93, + ISO153GOST1976874 = 94, + ISO8859Supp = 95, + ISO10367Box = 96, + ISO158Lap = 97, + ISO159JISX02121990 = 98, + ISO646Danish = 99, + USDK = 100, + DKUS = 101, + KSC5636 = 102, + Unicode11UTF7 = 103, + ISO2022CN = 104, + ISO2022CNEXT = 105, + UTF8 = 106, + ISO885913 = 109, + ISO885914 = 110, + ISO885915 = 111, + ISO885916 = 112, + GBK = 113, + GB18030 = 114, + OSDEBCDICDF0415 = 115, + OSDEBCDICDF03IRV = 116, + OSDEBCDICDF041 = 117, + ISO115481 = 118, + KZ1048 = 119, + UCS2 = 1000, + UCS4 = 1001, + UnicodeASCII = 1002, + UnicodeLatin1 = 1003, + UnicodeJapanese = 1004, + UnicodeIBM1261 = 1005, + UnicodeIBM1268 = 1006, + UnicodeIBM1276 = 1007, + UnicodeIBM1264 = 1008, + UnicodeIBM1265 = 1009, + Unicode11 = 1010, + SCSU = 1011, + UTF7 = 1012, + UTF16BE = 1013, + UTF16LE = 1014, + UTF16 = 1015, + CESU8 = 1016, + UTF32 = 1017, + UTF32BE = 1018, + UTF32LE = 1019, + BOCU1 = 1020, + UTF7IMAP = 1021, + Windows30Latin1 = 2000, + Windows31Latin1 = 2001, + Windows31Latin2 = 2002, + Windows31Latin5 = 2003, + HPRoman8 = 2004, + AdobeStandardEncoding = 2005, + VenturaUS = 2006, + VenturaInternational = 2007, + DECMCS = 2008, + PC850Multilingual = 2009, + PCp852 = 2010, + PC8CodePage437 = 2011, + PC8DanishNorwegian = 2012, + PC862LatinHebrew = 2013, + PC8Turkish = 2014, + IBMSymbols = 2015, + IBMThai = 2016, + HPLegal = 2017, + HPPiFont = 2018, + HPMath8 = 2019, + HPPSMath = 2020, + HPDesktop = 2021, + VenturaMath = 2022, + MicrosoftPublishing = 2023, + Windows31J = 2024, + GB2312 = 2025, + Big5 = 2026, + Macintosh = 2027, + IBM037 = 2028, + IBM038 = 2029, + IBM273 = 2030, + IBM274 = 2031, + IBM275 = 2032, + IBM277 = 2033, + IBM278 = 2034, + IBM280 = 2035, + IBM281 = 2036, + IBM284 = 2037, + IBM285 = 2038, + IBM290 = 2039, + IBM297 = 2040, + IBM420 = 2041, + IBM423 = 2042, + IBM424 = 2043, + IBM500 = 2044, + IBM851 = 2045, + IBM855 = 2046, + IBM857 = 2047, + IBM860 = 2048, + IBM861 = 2049, + IBM863 = 2050, + IBM864 = 2051, + IBM865 = 2052, + IBM868 = 2053, + IBM869 = 2054, + IBM870 = 2055, + IBM871 = 2056, + IBM880 = 2057, + IBM891 = 2058, + IBM903 = 2059, + IBM904 = 2060, + IBM905 = 2061, + IBM918 = 2062, + IBM1026 = 2063, + IBMEBCDICATDE = 2064, + EBCDICATDEA = 2065, + EBCDICCAFR = 2066, + EBCDICDKNO = 2067, + EBCDICDKNOA = 2068, + EBCDICFISE = 2069, + EBCDICFISEA = 2070, + EBCDICFR = 2071, + EBCDICIT = 2072, + EBCDICPT = 2073, + EBCDICES = 2074, + EBCDICESA = 2075, + EBCDICESS = 2076, + EBCDICUK = 2077, + EBCDICUS = 2078, + Unknown8BiT = 2079, + Mnemonic = 2080, + Mnem = 2081, + VISCII = 2082, + VIQR = 2083, + KOI8R = 2084, + HZGB2312 = 2085, + IBM866 = 2086, + PC775Baltic = 2087, + KOI8U = 2088, + IBM00858 = 2089, + IBM00924 = 2090, + IBM01140 = 2091, + IBM01141 = 2092, + IBM01142 = 2093, + IBM01143 = 2094, + IBM01144 = 2095, + IBM01145 = 2096, + IBM01146 = 2097, + IBM01147 = 2098, + IBM01148 = 2099, + IBM01149 = 2100, + Big5HKSCS = 2101, + IBM1047 = 2102, + PTCP154 = 2103, + Amiga1251 = 2104, + KOI7switched = 2105, + BRF = 2106, + TSCII = 2107, + CP51932 = 2108, + windows874 = 2109, + windows1250 = 2250, + windows1251 = 2251, + windows1252 = 2252, + windows1253 = 2253, + windows1254 = 2254, + windows1255 = 2255, + windows1256 = 2256, + windows1257 = 2257, + windows1258 = 2258, + TIS620 = 2259, + CP50220 = 2260 +}; +using enum id; +``` + +## 概要 +`text_encoding::id`は、IANA Character Setsレジストリに登録された文字エンコーディングを識別するための列挙型である。各列挙子のMIB値はIANAレジストリで定義された値に一致する。 + +`using enum id;`により、`text_encoding::UTF8`のように列挙子に直接アクセスできる。 + +基底型は`int_least32_t`であり、RFCの`INTEGER`型との前方互換性を持つ。 + + +## 特殊な値 + +| 列挙子 | 値 | 説明 | +|--------|-----|------| +| `other` | 1 | IANAに登録されていないエンコーディング。名前で比較される | +| `unknown` | 2 | エンコーディングが不明(デフォルト構築時) | + + +## Unicode関連の列挙子 + +| 列挙子 | 値 | IANA名 | 説明 | +|--------|-----|--------|------| +| `UTF8` | 106 | UTF-8 | 8ビット可変長のUnicodeエンコーディング。現代のテキスト処理で最も広く使用される | +| `UTF16` | 1015 | UTF-16 | 16ビット可変長のUnicodeエンコーディング。バイトオーダーはBOMまたはコンテキストで決定される | +| `UTF16BE` | 1013 | UTF-16BE | UTF-16のビッグエンディアン形式 | +| `UTF16LE` | 1014 | UTF-16LE | UTF-16のリトルエンディアン形式 | +| `UTF32` | 1017 | UTF-32 | 32ビット固定長のUnicodeエンコーディング | +| `UTF32BE` | 1018 | UTF-32BE | UTF-32のビッグエンディアン形式 | +| `UTF32LE` | 1019 | UTF-32LE | UTF-32のリトルエンディアン形式 | +| `UTF7` | 1012 | UTF-7 | 7ビットASCII互換のUnicodeエンコーディング。現在は非推奨 | +| `UTF7IMAP` | 1021 | UTF-7-IMAP | IMAP用のUTF-7変種 | +| `UCS2` | 1000 | ISO-10646-UCS-2 | UCS-2。BMPの文字のみを扱う固定長2バイトエンコーディング | +| `UCS4` | 1001 | ISO-10646-UCS-4 | UCS-4。固定長4バイトエンコーディング | +| `CESU8` | 1016 | CESU-8 | UTF-8の互換エンコーディング。サロゲートペアを個別にエンコードする | +| `BOCU1` | 1020 | BOCU-1 | Binary Ordered Compression for Unicode | +| `SCSU` | 1011 | SCSU | Standard Compression Scheme for Unicode | +| `Unicode11` | 1010 | UNICODE-1-1 | Unicode 1.1 | +| `Unicode11UTF7` | 103 | UNICODE-1-1-UTF-7 | Unicode 1.1のUTF-7エンコーディング | + +`char8_t`、`char16_t`、`char32_t`のリテラルはそれぞれUTF-8、UTF-16、UTF-32であることが規格で保証されているが、`text_encoding`クラスはこれらのワイド・Unicode文字型のエンコーディングは扱わず、通常の`char`のエンコーディングのみを対象とする。 + + +## 日本語関連の列挙子 + +| 列挙子 | 値 | IANA名 | 説明 | +|--------|-----|--------|------| +| `HalfWidthKatakana` | 15 | JIS_X0201 | 半角カタカナ(JIS X 0201) | +| `JISEncoding` | 16 | JIS_Encoding | JISエンコーディング | +| `ShiftJIS` | 17 | Shift_JIS | Shift_JIS。IANAの定義に基づく | +| `EUCPkdFmtJapanese` | 18 | EUC-JP | 日本語EUC(パック形式) | +| `EUCFixWidJapanese` | 19 | Extended_UNIX_Code_Fixed_Width_for_Japanese | 日本語EUC(固定幅) | +| `ISO2022JP` | 39 | ISO-2022-JP | ISO-2022-JP | +| `ISO2022JP2` | 40 | ISO-2022-JP-2 | ISO-2022-JP-2 | +| `Windows31J` | 2024 | Windows-31J | Windows-31J(CP932)。`ShiftJIS`とは異なるエンコーディングであり、NEC特殊文字やIBM拡張文字を含む | + +`ShiftJIS`(MIB 17)と`Windows31J`(MIB 2024)はIANAでは別のエンコーディングとして登録されている。日本語WindowsでMSVCがデフォルトで使用するのは`Windows31J`(CP932)であり、厳密なShift_JISとは異なる。 + + +## 列挙子名の由来 +各列挙子名は、対応するIANAエイリアスのうち`cs`(charset)で始まるものから`cs`プレフィックスを除去して作成されている。 + +例外として: +- `csUnicode`は`UCS2`にマッピングされている +- `csIBM904`のような明らかなタイポは`IBM904`に修正されている + + +## 除外されたエンコーディング +以下の登録済みエンコーディングは、[`comp-name`](comp-name.md)アルゴリズムにおいてエイリアスが他のエンコーディングと衝突するため、`text_encoding::id`から除外されている: + +- NATS-DANO (MIB 33) +- NATS-DANO-ADD (MIB 34) + + +## 例 +```cpp example +#include +#include + +int main() { + // using enum idにより直接アクセス可能 + std::text_encoding enc{std::text_encoding::UTF8}; + std::println("UTF-8 MIB: {}", static_cast(std::text_encoding::UTF8)); + + // 日本語エンコーディングの確認 + std::text_encoding sjis{std::text_encoding::ShiftJIS}; + std::println("Shift_JIS name: {}", sjis.name()); + std::println("Shift_JIS MIB: {}", static_cast(sjis.mib())); + + // リテラルエンコーディングとの比較 + if constexpr (std::text_encoding::literal() == std::text_encoding::UTF8) { + std::println("Compiling with UTF-8 literals"); + } +} +``` + +### 出力例 +``` +UTF-8 MIB: 106 +Shift_JIS name: Shift_JIS +Shift_JIS MIB: 17 +Compiling with UTF-8 literals +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P1885R12 Naming Text Encodings to Demystify Them](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1885r12.pdf) +- [IANA Character Sets](https://www.iana.org/assignments/character-sets/character-sets.xhtml) diff --git a/reference/text_encoding/text_encoding/literal.md b/reference/text_encoding/text_encoding/literal.md new file mode 100644 index 0000000000..bc31f50207 --- /dev/null +++ b/reference/text_encoding/text_encoding/literal.md @@ -0,0 +1,101 @@ +# text_encoding::literal +* text_encoding[meta header] +* std[meta namespace] +* text_encoding[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +static consteval text_encoding literal() noexcept; +``` + +## 概要 +リテラルエンコーディング(ordinary literal encoding)を取得する。 + +リテラルエンコーディングとは、コンパイラが通常の文字列リテラル(`"hello"`や`u8`プレフィックスのない文字列)をオブジェクトファイルに書き込む際に使用するエンコーディングである。この関数は`consteval`であり、コンパイル時にのみ呼び出すことができる。 + + +## 適格要件 +`CHAR_BIT == 8`であること。 + + +## 戻り値 +通常文字リテラルエンコーディングを表す`text_encoding`オブジェクトを返す。 + + +## 備考 +### 各コンパイラにおけるリテラルエンコーディング + +リテラルエンコーディングはコンパイルオプションによって決定される。以下に主要コンパイラにおける決定方法を示す。 + +#### GCC +- デフォルト: UTF-8 +- 変更方法: `-fexec-charset=エンコーディング名` + - 例: `-fexec-charset=SHIFT_JIS` +- 内部でiconvを使用してエンコーディング変換を行う + +#### Clang +- デフォルト: UTF-8 +- 変更方法: `-fexec-charset=エンコーディング名` + - Clang 18以降でサポート +- 古いバージョンのClangではUTF-8固定 + +#### MSVC +- デフォルト: システムのアクティブコードページ + - 日本語Windows環境: Windows-31J(CP932、Shift_JIS系) + - 英語Windows環境: Windows-1252 +- 変更方法: + - `/execution-charset:utf-8` : 実行文字セットをUTF-8にする + - `/utf-8` : ソース文字セットと実行文字セットの両方をUTF-8にする + - `/execution-charset:shift_jis` : 実行文字セットをShift_JISにする + +### 日本語環境における注意点 + +GCCおよびClangはデフォルトでUTF-8をリテラルエンコーディングとして使用するが、MSVCは日本語Windowsのアクティブコードページ(Windows-31J / CP932)をデフォルトとする。 + +この違いにより、同じソースコードでもコンパイラによって文字列リテラルのバイト表現が異なることがある。例えば、`"日本語"`という文字列リテラルは: +- GCCおよびClang (デフォルト): UTF-8で`\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e` +- MSVC (日本語環境デフォルト): Shift_JISで`\x93\xfa\x96\x7b\x8c\xea` + +`text_encoding::literal()`を使用することで、このようなエンコーディングの違いをプログラム的に検出し、適切に処理できる。 + + +## 例 +```cpp example +#include +#include + +int main() { + // コンパイル時にリテラルエンコーディングを取得 + constexpr auto enc = std::text_encoding::literal(); + std::println("Literal encoding: {}", enc.name()); + + // コンパイル時にUTF-8であることを検証 + if constexpr (std::text_encoding::literal() == std::text_encoding::id::UTF8) { + std::println("UTF-8 literals are available"); + } + + // static_assertでの使用 + static_assert(std::text_encoding::literal().mib() != std::text_encoding::id::unknown); +} +``` + +### 出力例 +``` +Literal encoding: UTF-8 +UTF-8 literals are available +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P1885R12 Naming Text Encodings to Demystify Them](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1885r12.pdf) diff --git a/reference/text_encoding/text_encoding/mib.md b/reference/text_encoding/text_encoding/mib.md new file mode 100644 index 0000000000..2940f28184 --- /dev/null +++ b/reference/text_encoding/text_encoding/mib.md @@ -0,0 +1,57 @@ +# text_encoding::mib +* text_encoding[meta header] +* std[meta namespace] +* text_encoding[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr id mib() const noexcept; +``` + +## 概要 +エンコーディングのMIB(Management Information Base)列挙値を取得する。 + + +## 戻り値 +`mib_`を返す。 + + +## 例外 +投げない。 + + +## 例 +```cpp example +#include +#include + +int main() { + auto enc = std::text_encoding::literal(); + std::println("MIB: {}", static_cast(enc.mib())); + + if (enc.mib() == std::text_encoding::id::UTF8) { + std::println("Literal encoding is UTF-8"); + } +} +``` + +### 出力例 +``` +MIB: 106 +Literal encoding is UTF-8 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P1885R12 Naming Text Encodings to Demystify Them](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1885r12.pdf) diff --git a/reference/text_encoding/text_encoding/name.md b/reference/text_encoding/text_encoding/name.md new file mode 100644 index 0000000000..f4f32b3d3e --- /dev/null +++ b/reference/text_encoding/text_encoding/name.md @@ -0,0 +1,81 @@ +# text_encoding::name +* text_encoding[meta header] +* std[meta namespace] +* text_encoding[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr const char* name() const noexcept; +``` + +## 概要 +エンコーディング名を取得する。 + + +## 戻り値 +`name_[0] != '\0'`の場合は`name_`を返す。そうでなければ空文字列へのポインタを返す。 + +`name()`が空文字列でない場合、返される値はヌル終端バイト文字列(NTBS)である。 + +- [`string_view`](/reference/string_view/basic_string_view.md)コンストラクタで構築された場合、コンストラクタに渡された名前がそのまま返される +- [`id`](id.md)から構築された場合、実装定義のエイリアス一覧に含まれる名前が返される +- [`literal()`](literal.md)や[`environment()`](environment.md)から返された場合、実装定義の名前が返される + + +## 備考 +- [P2862R1](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2862r1.html)の適用により、この関数は`nullptr`を返さない。[`id::unknown`](id.md)や[`id::other`](id.md)のMIBを持つ`text_encoding`オブジェクトに対しては空文字列を返す。 + - これにより、`std::cout << te.name()`や`std::format()`への直接渡し、`std::string_view`の構築が常に安全に行える。 + + +## 例外 +投げない。 + + +## 例 +```cpp example +#include +#include +#include + +int main() { + // リテラルエンコーディングの名前 + std::println("Literal: {}", std::text_encoding::literal().name()); + + // 環境エンコーディングの名前 + std::println("Environment: {}", std::text_encoding::environment().name()); + + // ユーザー構築した場合、渡した名前がそのまま返される + std::text_encoding enc{"utf-8"}; + std::println("User: {}", enc.name()); + + // unknownの場合は空文字列 + std::text_encoding unknown; + std::println("Unknown: [{}]", unknown.name()); + std::println("Is empty: {}", std::string_view(unknown.name()).empty()); +} +``` + +### 出力例 +``` +Literal: UTF-8 +Environment: UTF-8 +User: utf-8 +Unknown: [] +Is empty: 1 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P1885R12 Naming Text Encodings to Demystify Them](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1885r12.pdf) +- [P2862R1 `text_encoding::name()` should never return null values](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2862r1.html) diff --git a/reference/text_encoding/text_encoding/op_constructor.md b/reference/text_encoding/text_encoding/op_constructor.md new file mode 100644 index 0000000000..9323b65f7c --- /dev/null +++ b/reference/text_encoding/text_encoding/op_constructor.md @@ -0,0 +1,86 @@ +# text_encoding::text_encoding +* text_encoding[meta header] +* std[meta namespace] +* text_encoding[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr text_encoding() = default; // (1) C++26 +constexpr explicit text_encoding(string_view enc) noexcept; // (2) C++26 +constexpr text_encoding(id i) noexcept; // (3) C++26 +``` + +## 概要 +`text_encoding`オブジェクトを構築する。 + +- (1) : デフォルトコンストラクタ。`mib_`を[`id::unknown`](id.md)に初期化する +- (2) : エンコーディング名から構築する。IANA登録名またはエイリアスに一致する場合は対応するMIB値が設定され、一致しない場合は[`id::other`](id.md)が設定される +- (3) : MIB列挙値から構築する + + +## 事前条件 +- (2) : + - `enc`は基本文字集合の要素のみで構成される通常リテラルエンコーディングの文字列を表す + - `enc.size() <= max_name_length` + - `enc.`[`contains`](/reference/string_view/basic_string_view/contains.md)`('\0')`が`false` + + +## 事後条件 +- (2) : + - 既知の登録済み文字エンコーディングのプライマリ名またはエイリアス`a`が存在し、[`comp-name`](comp-name.md)`(a, enc)`が`true`となる場合、`mib_`はその登録済みエンコーディングに対応する[`id`](id.md)の列挙子の値を持つ。そうでなければ、`mib_ == id::other` + - `enc.compare(name_) == 0` +- (3) : + - `mib_ == i` + - `(mib_ == id::unknown || mib_ == id::other)`が`true`の場合、`strlen(name_) == 0`。そうでなければ、[`ranges::contains`](/reference/algorithm/ranges_contains.md)`(`[`aliases()`](aliases.md)`, `[`string_view`](/reference/string_view/basic_string_view.md)`(name_))`が`true` + + +## 例外 +投げない。 + + +## 例 +```cpp example +#include +#include +#include + +int main() { + using namespace std::string_view_literals; + + // (1) デフォルト構築 + std::text_encoding te1; + assert(te1.mib() == std::text_encoding::id::unknown); + + // (2) エンコーディング名から構築 + std::text_encoding te2{"utf-8"}; + assert(te2.mib() == std::text_encoding::id::UTF8); + assert(te2.name() == "utf-8"sv); + + // (2) 登録されていないエンコーディング名 + std::text_encoding te3{"WTF-8"}; + assert(te3.mib() == std::text_encoding::id::other); + + // (3) MIB値から構築 + std::text_encoding te4{std::text_encoding::id::ShiftJIS}; + assert(te4.mib() == std::text_encoding::id::ShiftJIS); +} +``` + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P1885R12 Naming Text Encodings to Demystify Them](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1885r12.pdf) diff --git a/reference/text_encoding/text_encoding/op_equal.md b/reference/text_encoding/text_encoding/op_equal.md new file mode 100644 index 0000000000..609dbae5e4 --- /dev/null +++ b/reference/text_encoding/text_encoding/op_equal.md @@ -0,0 +1,74 @@ +# text_encoding::operator== +* text_encoding[meta header] +* std[meta namespace] +* text_encoding[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +friend constexpr bool operator==(const text_encoding& a, + const text_encoding& b) noexcept; // (1) C++26 +friend constexpr bool operator==(const text_encoding& encoding, + id i) noexcept; // (2) C++26 +``` + +## 概要 +`text_encoding`オブジェクト同士、または`text_encoding`オブジェクトと[`id`](id.md)列挙値の等値比較を行う。 + +- (1) : 2つの`text_encoding`オブジェクトが同じエンコーディングを表すかを判定する +- (2) : `text_encoding`オブジェクトが指定したMIB値に対応するエンコーディングかを判定する + + +## 戻り値 +- (1) : `a.mib_ == id::other && b.mib_ == id::other`が`true`の場合、[`comp-name`](comp-name.md)`(a.name_, b.name_)`を返す。そうでなければ`a.mib_ == b.mib_`を返す +- (2) : `encoding.mib_ == i`を返す + + +## 備考 +- (1) : IANA登録済みエンコーディングはMIB値で比較される。未登録エンコーディング([`id::other`](id.md))は名前で比較される +- (2) : `i != id::other`の場合に限り、引数に対する同値関係を導く。`id::other`との比較は同値関係にならない(`a == id::other && b == id::other`であっても`a == b`とは限らない) + + +## 例 +```cpp example +#include +#include + +int main() { + // MIBによる比較 + std::text_encoding utf8_a{"utf-8"}; + std::text_encoding utf8_b{"UTF8"}; + assert(utf8_a == utf8_b); // 同じMIBを持つ + + // id列挙値との比較 + assert(utf8_a == std::text_encoding::id::UTF8); + + // 未登録エンコーディングは名前で比較 + std::text_encoding wtf8_a{"WTF-8"}; + std::text_encoding wtf8_b{"wtf8"}; + assert(wtf8_a == wtf8_b); // comp-nameで比較 + + // 異なる未登録エンコーディング + std::text_encoding other_a{"WTF-8"}; + std::text_encoding other_b{"Some-Other"}; + assert(other_a != other_b); +} +``` + +### 出力 +``` +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 参照 +- [P1885R12 Naming Text Encodings to Demystify Them](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p1885r12.pdf) From 23af8649589d2c380a6dc530fe66590e3481dfb5 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 24 Mar 2026 13:32:19 +0900 Subject: [PATCH 2654/3948] =?UTF-8?q?=E3=82=B0=E3=83=AD=E3=83=BC=E3=83=90?= =?UTF-8?q?=E3=83=AB=E4=BF=AE=E9=A3=BE=E3=83=AA=E3=82=B9=E3=83=88=E3=81=AB?= =?UTF-8?q?text=5Fencoding=E3=83=A9=E3=82=A4=E3=83=96=E3=83=A9=E3=83=AA?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20#1191?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 9b62c2e2c0..9d241a3c10 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -333,6 +333,8 @@ * [link /reference/system_error.md] * std::error_code[link /reference/system_error/error_code.md] * ec.message()[link /reference/system_error/error_code/message.md] +* [link /reference/text_encoding.md] + * std::text_encoding[link /reference/text_encoding/text_encoding.md] * [link /reference/thread.md] * std::this_thread::sleep_for[link /reference/thread/this_thread/sleep_for.md] * std::jthread[link /reference/thread/jthread.md] From f9afc16f5088d3e8a6978b6d1d5bac45e0e364ce Mon Sep 17 00:00:00 2001 From: KAZOON <48007342+cycloawaodorin@users.noreply.github.com> Date: Thu, 26 Mar 2026 09:51:58 +0900 Subject: [PATCH 2655/3948] =?UTF-8?q?P2905R2=20=E3=81=AB=E3=82=88=E3=82=8A?= =?UTF-8?q?=EF=BC=8Cmake=5Fformat=5Fargs=20=E3=81=AF=E5=B7=A6=E8=BE=BA?= =?UTF-8?q?=E5=80=A4=E3=81=97=E3=81=8B=E5=8F=97=E3=81=91=E5=8F=96=E3=82=89?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=81=9F=E3=82=81=EF=BC=8C=E3=82=B3=E3=83=B3?= =?UTF-8?q?=E3=83=91=E3=82=A4=E3=83=AB=E3=82=A8=E3=83=A9=E3=83=BC=E3=81=A8?= =?UTF-8?q?=E3=81=AA=E3=81=A3=E3=81=A6=E3=81=84=E3=81=9F=E4=BE=8B=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20(#1595)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * P2905R2 により,make_format_args は左辺値しか受け取らないため,コンパイルエラーとなっていた例を修正 * Update reference/format/vformat.md Co-authored-by: Koichi Murase * P2905R2 に関する簡単な説明を追加 --------- Co-authored-by: cycloawaodorin Co-authored-by: Koichi Murase --- reference/format/make_format_args.md | 13 ++++++++----- reference/format/vformat.md | 4 +++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/reference/format/make_format_args.md b/reference/format/make_format_args.md index 4f4484a98a..326ca50e8a 100644 --- a/reference/format/make_format_args.md +++ b/reference/format/make_format_args.md @@ -9,17 +9,17 @@ namespace std { template format_arg_store - make_format_args(Args&&... args); // (1) C++20 + make_format_args(Args&... args); // (1) C++20 template constexpr format_arg_store - make_format_args(Args&&... args); // (1) C++26 + make_format_args(Args&... args); // (1) C++26 template format_arg_store - make_wformat_args(Args&&... args); // (2) C++20 + make_wformat_args(Args&... args); // (2) C++20 template constexpr format_arg_store - make_wformat_args(Args&&... args); // (2) C++26 + make_wformat_args(Args&... args); // (2) C++26 } ``` * format_arg_store[italic] @@ -79,7 +79,8 @@ return make_format_args(args...); int main() { std::string fmt = "0x{:x} 0b{:04b}"; - std::string s = std::vformat(fmt, std::make_format_args(10, 6)); + int m = 10, n = 6; + std::string s = std::vformat(fmt, std::make_format_args(m, n)); std::cout << s << std::endl; } ``` @@ -124,3 +125,5 @@ namespace std { * [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) * [P2418R2 Add support for `std::generator`-like types to `std::format`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2418r2.html) +* [P2905R2 Runtime format strings](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2905r2.html) + * C++23 発効後の DR として、引数を非 `const` 左辺値参照とすることで、一時オブジェクトを渡すことによる寿命切れオブジェクトの参照を回避する変更が提案された。これは C++20 まで遡及適用された。 diff --git a/reference/format/vformat.md b/reference/format/vformat.md index 3ecbc595be..113ee744a6 100644 --- a/reference/format/vformat.md +++ b/reference/format/vformat.md @@ -70,7 +70,8 @@ C++26以降は、実行時文字列のフォーマット引数を使用したい int main() { std::string fmt = "0x{:x} 0b{:04b}"; - std::string s = std::vformat(fmt, std::make_format_args(10, 6)); + int m = 10, n = 6; + std::string s = std::vformat(fmt, std::make_format_args(m, n)); std::cout << s << std::endl; } ``` @@ -132,5 +133,6 @@ string vformat(const locale& loc, wstring_view fmt, wformat_args args) { - [Working Draft, Standard for Programming Language C++ [format]](https://timsong-cpp.github.io/cppwp/format) - [P0645R10 Text Formatting](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html) +- [P2905R2 Runtime format strings](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2905r2.html) - [P3391R2 `constexpr std::format`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3391r2.html) - C++26から非ロケール版が`constexpr`に対応した From 67a25597b8e27aadcd728d76c4db2eba2007c7cb Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 26 Mar 2026 10:32:49 +0900 Subject: [PATCH 2656/3948] =?UTF-8?q?text=5Fencoding=20:=20=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E4=BF=AE=E9=A3=BE=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20#1191?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 1 + reference/locale/locale/encoding.md | 1 + reference/text_encoding.md | 6 ++++++ reference/text_encoding/text_encoding.md | 2 ++ reference/text_encoding/text_encoding/environment.md | 1 + reference/text_encoding/text_encoding/environment_is.md | 1 + reference/text_encoding/text_encoding/id.md | 1 + reference/text_encoding/text_encoding/mib.md | 1 + reference/text_encoding/text_encoding/name.md | 2 ++ 9 files changed, 16 insertions(+) diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 9d241a3c10..e73acb1ff3 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -217,6 +217,7 @@ * [link /reference/list.md] * std::list[link /reference/list/list.md] * [link /reference/locale.md] + * std::locale[link /reference/locale/locale.md] * [link /reference/map.md] * std::map[link /reference/map/map.md] * [link /reference/mdspan.md] diff --git a/reference/locale/locale/encoding.md b/reference/locale/locale/encoding.md index 766b1a7874..f12edb3b76 100644 --- a/reference/locale/locale/encoding.md +++ b/reference/locale/locale/encoding.md @@ -43,6 +43,7 @@ int main() { } } ``` +* std::text_encoding::environment()[link /reference/text_encoding/text_encoding/environment.md] ### 出力例 ``` diff --git a/reference/text_encoding.md b/reference/text_encoding.md index af45379a43..7ec198144a 100644 --- a/reference/text_encoding.md +++ b/reference/text_encoding.md @@ -89,6 +89,7 @@ static_assert(std::text_encoding::literal() == std::text_encoding::id::UTF8, int main() {} ``` +* std::text_encoding::literal()[link text_encoding/text_encoding/literal.md] #### 環境エンコーディングとリテラルエンコーディングの互換性確認 @@ -107,6 +108,8 @@ int main() { } } ``` +* std::text_encoding::literal()[link text_encoding/text_encoding/literal.md] +* std::text_encoding::environment()[link text_encoding/text_encoding/environment.md] #### 外部ライブラリとの相互運用 @@ -132,6 +135,7 @@ int main() { &err); } ``` +* std::text_encoding::environment()[link text_encoding/text_encoding/environment.md] #### µs表記の安全な使用 @@ -156,6 +160,8 @@ int main() { print_microseconds(42); } ``` +* std::text_encoding::literal()[link text_encoding/text_encoding/literal.md] +* encoding()[link locale/locale/encoding.md] ## バージョン diff --git a/reference/text_encoding/text_encoding.md b/reference/text_encoding/text_encoding.md index fcca0942eb..0cddc20373 100644 --- a/reference/text_encoding/text_encoding.md +++ b/reference/text_encoding/text_encoding.md @@ -111,6 +111,8 @@ int main() { ::print(std::text_encoding::environment()); } ``` +* std::text_encoding::literal()[link text_encoding/literal.md] +* std::text_encoding::environment()[link text_encoding/environment.md] #### 出力例 ``` diff --git a/reference/text_encoding/text_encoding/environment.md b/reference/text_encoding/text_encoding/environment.md index dde7474d62..17ce3ed1a7 100644 --- a/reference/text_encoding/text_encoding/environment.md +++ b/reference/text_encoding/text_encoding/environment.md @@ -88,6 +88,7 @@ int main() { } } ``` +* std::text_encoding::literal()[link literal.md] ### 出力例 ``` diff --git a/reference/text_encoding/text_encoding/environment_is.md b/reference/text_encoding/text_encoding/environment_is.md index 9ed3ead7de..e7cdc867b8 100644 --- a/reference/text_encoding/text_encoding/environment_is.md +++ b/reference/text_encoding/text_encoding/environment_is.md @@ -38,6 +38,7 @@ int main() { } } ``` +* std::text_encoding::environment()[link environment.md] ### 出力例 ``` diff --git a/reference/text_encoding/text_encoding/id.md b/reference/text_encoding/text_encoding/id.md index 50cb29e260..4aaaf2f488 100644 --- a/reference/text_encoding/text_encoding/id.md +++ b/reference/text_encoding/text_encoding/id.md @@ -362,6 +362,7 @@ int main() { } } ``` +* std::text_encoding::literal()[link literal.md] ### 出力例 ``` diff --git a/reference/text_encoding/text_encoding/mib.md b/reference/text_encoding/text_encoding/mib.md index 2940f28184..d621166fe4 100644 --- a/reference/text_encoding/text_encoding/mib.md +++ b/reference/text_encoding/text_encoding/mib.md @@ -35,6 +35,7 @@ int main() { } } ``` +* std::text_encoding::literal()[link literal.md] ### 出力例 ``` diff --git a/reference/text_encoding/text_encoding/name.md b/reference/text_encoding/text_encoding/name.md index f4f32b3d3e..96d4b4a051 100644 --- a/reference/text_encoding/text_encoding/name.md +++ b/reference/text_encoding/text_encoding/name.md @@ -55,6 +55,8 @@ int main() { std::println("Is empty: {}", std::string_view(unknown.name()).empty()); } ``` +* std::text_encoding::literal()[link literal.md] +* std::text_encoding::environment()[link environment.md] ### 出力例 ``` From ee014a03a7ad925e7bcb66983976e0786e987f82 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 26 Mar 2026 10:47:34 +0900 Subject: [PATCH 2657/3948] =?UTF-8?q?cmath=20:=20NaN=E3=82=92=E5=8F=97?= =?UTF-8?q?=E3=81=91=E5=8F=96=E3=81=A3=E3=81=9F=E3=82=89NaN=E3=82=92?= =?UTF-8?q?=E8=BF=94=E3=81=99=E4=BB=95=E6=A7=98=E3=82=92=E8=A8=98=E8=BC=89?= =?UTF-8?q?=20#373?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cmath.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/reference/cmath.md b/reference/cmath.md index e2402db78b..8c440287f6 100644 --- a/reference/cmath.md +++ b/reference/cmath.md @@ -20,6 +20,7 @@ - [乗算・加算](#floating-multiply-add) - [線形補完](#linear-interpolation) - [数値分類](#classification-functions) +- [NaNの扱い](#nan-handling) - [数値比較](#comparison-functions) - [型](#types) - [数値のマクロ](#value-macros) @@ -214,6 +215,35 @@ C++03 までの場合、[`errno`](cerrno/errno.md) でしか通知されない - [`math_errhandling`](cmath/math_errhandling.md) `&` [`MATH_ERRNO`](cmath/math_errno.md)が真で、[`errno`](cerrno/errno.md)が設定された場合 +## NaN の扱い + +浮動小数点規格ISO/IEC 60559 (IEEE 754) に準拠する環境では、C言語規格の Annex F (F.10 paragraph 11) により、以下の一般規則が定められている: + +> NaN の引数をもつ関数は、NaN の結果を返し、浮動小数点例外を発生させない。ただし、個別に規定がある場合を除く。 + +この規則は `__STDC_IEC_559__` が定義されている(ISO/IEC 60559 に準拠する)環境で適用される。 + +また、推奨される実装として、ひとつ以上の NaN 引数をもつ関数が NaN を返す場合、その結果は入力の NaN 引数のいずれかと同じ値(型変換後、符号は異なる可能性がある)であることが望ましいとされている。 + +### 例外となる関数 + +以下の関数は、NaN の引数を受け取っても NaN を返さない場合がある: + +| 関数 | 条件 | 結果 | +|------|------|------| +| [`pow`](cmath/pow.md) | `pow(1.0, NaN)` | `1.0` | +| [`pow`](cmath/pow.md) | `pow(NaN, ±0.0)` | `1.0` | +| [`hypot`](cmath/hypot.md) | `hypot(±∞, NaN)` | `+∞` | +| [`fmax`](cmath/fmax.md) | 一方のみが NaN | NaN でない方の引数 | +| [`fmin`](cmath/fmin.md) | 一方のみが NaN | NaN でない方の引数 | + +[`pow`](cmath/pow.md) と [`hypot`](cmath/hypot.md) の例外は、NaN をどのような実数値に置き換えても結果が同じになるという原則に基づいている(任意の実数の 0 乗は 1、任意の実数と無限大の `hypot` は無限大)。 + +[`fmax`](cmath/fmax.md) と [`fmin`](cmath/fmin.md) は、NaN を欠損値として扱い、有効な数値を優先して返す。ただし、両方の引数が NaN の場合は NaN を返す。 + +なお、数値分類関数([`fpclassify`](cmath/fpclassify.md)、[`isnan`](cmath/isnan.md)、[`isinf`](cmath/isinf.md) 等)は戻り値が整数型であるため、NaN の伝播規則の対象外である。 + + ## 三角関数 | 名前 | 説明 | 対応バージョン | From fb3e3fe792eab6843e4203d7d1a8999c7b940258 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 26 Mar 2026 11:50:04 +0900 Subject: [PATCH 2658/3948] =?UTF-8?q?text=5Fencoding=20:=20=E3=82=B3?= =?UTF-8?q?=E3=83=BC=E3=83=89=E4=BF=AE=E9=A3=BE=E3=82=92=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E3=83=BB=E8=BF=BD=E5=8A=A0=20#1191?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/text_encoding.md | 12 +++++++----- reference/text_encoding/text_encoding.md | 11 +++++++++-- reference/text_encoding/text_encoding/aliases.md | 1 + .../text_encoding/text_encoding/aliases_view.md | 2 ++ reference/text_encoding/text_encoding/environment.md | 4 +++- .../text_encoding/text_encoding/environment_is.md | 4 +++- reference/text_encoding/text_encoding/id.md | 4 +++- reference/text_encoding/text_encoding/literal.md | 3 +++ reference/text_encoding/text_encoding/mib.md | 3 ++- reference/text_encoding/text_encoding/name.md | 4 ++-- .../text_encoding/text_encoding/op_constructor.md | 6 ++++++ reference/text_encoding/text_encoding/op_equal.md | 1 + 12 files changed, 42 insertions(+), 13 deletions(-) diff --git a/reference/text_encoding.md b/reference/text_encoding.md index 7ec198144a..2ac87ad441 100644 --- a/reference/text_encoding.md +++ b/reference/text_encoding.md @@ -89,7 +89,8 @@ static_assert(std::text_encoding::literal() == std::text_encoding::id::UTF8, int main() {} ``` -* std::text_encoding::literal()[link text_encoding/text_encoding/literal.md] +* literal()[link text_encoding/text_encoding/literal.md] +* id::UTF8[link text_encoding/text_encoding/id.md] #### 環境エンコーディングとリテラルエンコーディングの互換性確認 @@ -108,8 +109,8 @@ int main() { } } ``` -* std::text_encoding::literal()[link text_encoding/text_encoding/literal.md] -* std::text_encoding::environment()[link text_encoding/text_encoding/environment.md] +* literal()[link text_encoding/text_encoding/literal.md] +* environment()[link text_encoding/text_encoding/environment.md] #### 外部ライブラリとの相互運用 @@ -135,7 +136,7 @@ int main() { &err); } ``` -* std::text_encoding::environment()[link text_encoding/text_encoding/environment.md] +* environment()[link text_encoding/text_encoding/environment.md] #### µs表記の安全な使用 @@ -160,7 +161,8 @@ int main() { print_microseconds(42); } ``` -* std::text_encoding::literal()[link text_encoding/text_encoding/literal.md] +* literal()[link text_encoding/text_encoding/literal.md] +* id::UTF8[link text_encoding/text_encoding/id.md] * encoding()[link locale/locale/encoding.md] diff --git a/reference/text_encoding/text_encoding.md b/reference/text_encoding/text_encoding.md index 0cddc20373..87b0d4db57 100644 --- a/reference/text_encoding/text_encoding.md +++ b/reference/text_encoding/text_encoding.md @@ -111,8 +111,11 @@ int main() { ::print(std::text_encoding::environment()); } ``` -* std::text_encoding::literal()[link text_encoding/literal.md] -* std::text_encoding::environment()[link text_encoding/environment.md] +* name()[link text_encoding/name.md] +* mib()[link text_encoding/mib.md] +* aliases()[link text_encoding/aliases.md] +* literal()[link text_encoding/literal.md] +* environment()[link text_encoding/environment.md] #### 出力例 ``` @@ -155,6 +158,10 @@ int main() { assert(wtf8 == std::text_encoding{"___wtf8__"}); } ``` +* name()[link text_encoding/name.md] +* mib()[link text_encoding/mib.md] +* id::UTF8[link text_encoding/id.md] +* id::other[link text_encoding/id.md] #### 出力 ``` diff --git a/reference/text_encoding/text_encoding/aliases.md b/reference/text_encoding/text_encoding/aliases.md index 0179fd8a19..34e060191c 100644 --- a/reference/text_encoding/text_encoding/aliases.md +++ b/reference/text_encoding/text_encoding/aliases.md @@ -52,6 +52,7 @@ int main() { } } ``` +* id::UTF8[link id.md] ### 出力例 ``` diff --git a/reference/text_encoding/text_encoding/aliases_view.md b/reference/text_encoding/text_encoding/aliases_view.md index 0239c5bbfe..6efcf2939d 100644 --- a/reference/text_encoding/text_encoding/aliases_view.md +++ b/reference/text_encoding/text_encoding/aliases_view.md @@ -50,6 +50,8 @@ int main() { std::println("Number of aliases: {}", std::ranges::distance(aliases)); } ``` +* aliases()[link aliases.md] +* id::ShiftJIS[link id.md] ### 出力例 ``` diff --git a/reference/text_encoding/text_encoding/environment.md b/reference/text_encoding/text_encoding/environment.md index 17ce3ed1a7..972fdc1461 100644 --- a/reference/text_encoding/text_encoding/environment.md +++ b/reference/text_encoding/text_encoding/environment.md @@ -88,7 +88,9 @@ int main() { } } ``` -* std::text_encoding::literal()[link literal.md] +* name()[link name.md] +* mib()[link mib.md] +* literal()[link literal.md] ### 出力例 ``` diff --git a/reference/text_encoding/text_encoding/environment_is.md b/reference/text_encoding/text_encoding/environment_is.md index e7cdc867b8..2d1a9a99d0 100644 --- a/reference/text_encoding/text_encoding/environment_is.md +++ b/reference/text_encoding/text_encoding/environment_is.md @@ -38,7 +38,9 @@ int main() { } } ``` -* std::text_encoding::environment()[link environment.md] +* name()[link name.md] +* id::UTF8[link id.md] +* environment()[link environment.md] ### 出力例 ``` diff --git a/reference/text_encoding/text_encoding/id.md b/reference/text_encoding/text_encoding/id.md index 4aaaf2f488..46d59bdb1c 100644 --- a/reference/text_encoding/text_encoding/id.md +++ b/reference/text_encoding/text_encoding/id.md @@ -362,7 +362,9 @@ int main() { } } ``` -* std::text_encoding::literal()[link literal.md] +* name()[link name.md] +* mib()[link mib.md] +* literal()[link literal.md] ### 出力例 ``` diff --git a/reference/text_encoding/text_encoding/literal.md b/reference/text_encoding/text_encoding/literal.md index bc31f50207..bb6d2c3483 100644 --- a/reference/text_encoding/text_encoding/literal.md +++ b/reference/text_encoding/text_encoding/literal.md @@ -79,6 +79,9 @@ int main() { static_assert(std::text_encoding::literal().mib() != std::text_encoding::id::unknown); } ``` +* name()[link name.md] +* id::UTF8[link id.md] +* id::unknown[link id.md] ### 出力例 ``` diff --git a/reference/text_encoding/text_encoding/mib.md b/reference/text_encoding/text_encoding/mib.md index d621166fe4..488be88506 100644 --- a/reference/text_encoding/text_encoding/mib.md +++ b/reference/text_encoding/text_encoding/mib.md @@ -35,7 +35,8 @@ int main() { } } ``` -* std::text_encoding::literal()[link literal.md] +* literal()[link literal.md] +* id::UTF8[link id.md] ### 出力例 ``` diff --git a/reference/text_encoding/text_encoding/name.md b/reference/text_encoding/text_encoding/name.md index 96d4b4a051..b07e52b7b6 100644 --- a/reference/text_encoding/text_encoding/name.md +++ b/reference/text_encoding/text_encoding/name.md @@ -55,8 +55,8 @@ int main() { std::println("Is empty: {}", std::string_view(unknown.name()).empty()); } ``` -* std::text_encoding::literal()[link literal.md] -* std::text_encoding::environment()[link environment.md] +* literal()[link literal.md] +* environment()[link environment.md] ### 出力例 ``` diff --git a/reference/text_encoding/text_encoding/op_constructor.md b/reference/text_encoding/text_encoding/op_constructor.md index 9323b65f7c..308ebd5411 100644 --- a/reference/text_encoding/text_encoding/op_constructor.md +++ b/reference/text_encoding/text_encoding/op_constructor.md @@ -66,6 +66,12 @@ int main() { assert(te4.mib() == std::text_encoding::id::ShiftJIS); } ``` +* mib()[link mib.md] +* name()[link name.md] +* id::unknown[link id.md] +* id::UTF8[link id.md] +* id::other[link id.md] +* id::ShiftJIS[link id.md] ### 出力 ``` diff --git a/reference/text_encoding/text_encoding/op_equal.md b/reference/text_encoding/text_encoding/op_equal.md index 609dbae5e4..27b86d3012 100644 --- a/reference/text_encoding/text_encoding/op_equal.md +++ b/reference/text_encoding/text_encoding/op_equal.md @@ -54,6 +54,7 @@ int main() { assert(other_a != other_b); } ``` +* id::UTF8[link id.md] ### 出力 ``` From 162ec14ada140daca5f00c819e09820ee327c45a Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Thu, 26 Mar 2026 13:46:13 +0900 Subject: [PATCH 2659/3948] =?UTF-8?q?text=5Fencoding=20:=20=E3=82=BF?= =?UTF-8?q?=E3=82=A4=E3=83=88=E3=83=AB=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/locale/locale/encoding.md | 2 +- reference/text_encoding/text_encoding/aliases.md | 2 +- reference/text_encoding/text_encoding/aliases_view.md | 2 +- reference/text_encoding/text_encoding/comp-name.md | 2 +- reference/text_encoding/text_encoding/environment.md | 2 +- reference/text_encoding/text_encoding/environment_is.md | 2 +- reference/text_encoding/text_encoding/id.md | 2 +- reference/text_encoding/text_encoding/literal.md | 2 +- reference/text_encoding/text_encoding/mib.md | 2 +- reference/text_encoding/text_encoding/name.md | 2 +- reference/text_encoding/text_encoding/op_constructor.md | 2 +- reference/text_encoding/text_encoding/op_equal.md | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/reference/locale/locale/encoding.md b/reference/locale/locale/encoding.md index f12edb3b76..477577b2dc 100644 --- a/reference/locale/locale/encoding.md +++ b/reference/locale/locale/encoding.md @@ -1,4 +1,4 @@ -# locale::encoding +# encoding * locale[meta header] * std[meta namespace] * locale[meta class] diff --git a/reference/text_encoding/text_encoding/aliases.md b/reference/text_encoding/text_encoding/aliases.md index 34e060191c..e37780c54b 100644 --- a/reference/text_encoding/text_encoding/aliases.md +++ b/reference/text_encoding/text_encoding/aliases.md @@ -1,4 +1,4 @@ -# text_encoding::aliases +# aliases * text_encoding[meta header] * std[meta namespace] * text_encoding[meta class] diff --git a/reference/text_encoding/text_encoding/aliases_view.md b/reference/text_encoding/text_encoding/aliases_view.md index 6efcf2939d..be11c0bd26 100644 --- a/reference/text_encoding/text_encoding/aliases_view.md +++ b/reference/text_encoding/text_encoding/aliases_view.md @@ -1,4 +1,4 @@ -# text_encoding::aliases_view +# aliases_view * text_encoding[meta header] * std[meta namespace] * text_encoding[meta class] diff --git a/reference/text_encoding/text_encoding/comp-name.md b/reference/text_encoding/text_encoding/comp-name.md index 4b9a9305a7..1a3b133170 100644 --- a/reference/text_encoding/text_encoding/comp-name.md +++ b/reference/text_encoding/text_encoding/comp-name.md @@ -1,4 +1,4 @@ -# text_encoding::comp-name +# comp-name * text_encoding[meta header] * std[meta namespace] * text_encoding[meta class] diff --git a/reference/text_encoding/text_encoding/environment.md b/reference/text_encoding/text_encoding/environment.md index 972fdc1461..7d3bb34095 100644 --- a/reference/text_encoding/text_encoding/environment.md +++ b/reference/text_encoding/text_encoding/environment.md @@ -1,4 +1,4 @@ -# text_encoding::environment +# environment * text_encoding[meta header] * std[meta namespace] * text_encoding[meta class] diff --git a/reference/text_encoding/text_encoding/environment_is.md b/reference/text_encoding/text_encoding/environment_is.md index 2d1a9a99d0..b2f71f5b4d 100644 --- a/reference/text_encoding/text_encoding/environment_is.md +++ b/reference/text_encoding/text_encoding/environment_is.md @@ -1,4 +1,4 @@ -# text_encoding::environment_is +# environment_is * text_encoding[meta header] * std[meta namespace] * text_encoding[meta class] diff --git a/reference/text_encoding/text_encoding/id.md b/reference/text_encoding/text_encoding/id.md index 46d59bdb1c..ab89c80157 100644 --- a/reference/text_encoding/text_encoding/id.md +++ b/reference/text_encoding/text_encoding/id.md @@ -1,4 +1,4 @@ -# text_encoding::id +# id * text_encoding[meta header] * std[meta namespace] * text_encoding[meta class] diff --git a/reference/text_encoding/text_encoding/literal.md b/reference/text_encoding/text_encoding/literal.md index bb6d2c3483..3cbe56d152 100644 --- a/reference/text_encoding/text_encoding/literal.md +++ b/reference/text_encoding/text_encoding/literal.md @@ -1,4 +1,4 @@ -# text_encoding::literal +# literal * text_encoding[meta header] * std[meta namespace] * text_encoding[meta class] diff --git a/reference/text_encoding/text_encoding/mib.md b/reference/text_encoding/text_encoding/mib.md index 488be88506..ec5d05825c 100644 --- a/reference/text_encoding/text_encoding/mib.md +++ b/reference/text_encoding/text_encoding/mib.md @@ -1,4 +1,4 @@ -# text_encoding::mib +# mib * text_encoding[meta header] * std[meta namespace] * text_encoding[meta class] diff --git a/reference/text_encoding/text_encoding/name.md b/reference/text_encoding/text_encoding/name.md index b07e52b7b6..a3497b46a1 100644 --- a/reference/text_encoding/text_encoding/name.md +++ b/reference/text_encoding/text_encoding/name.md @@ -1,4 +1,4 @@ -# text_encoding::name +# name * text_encoding[meta header] * std[meta namespace] * text_encoding[meta class] diff --git a/reference/text_encoding/text_encoding/op_constructor.md b/reference/text_encoding/text_encoding/op_constructor.md index 308ebd5411..93a024d78a 100644 --- a/reference/text_encoding/text_encoding/op_constructor.md +++ b/reference/text_encoding/text_encoding/op_constructor.md @@ -1,4 +1,4 @@ -# text_encoding::text_encoding +# コンストラクタ * text_encoding[meta header] * std[meta namespace] * text_encoding[meta class] diff --git a/reference/text_encoding/text_encoding/op_equal.md b/reference/text_encoding/text_encoding/op_equal.md index 27b86d3012..0033d94062 100644 --- a/reference/text_encoding/text_encoding/op_equal.md +++ b/reference/text_encoding/text_encoding/op_equal.md @@ -1,4 +1,4 @@ -# text_encoding::operator== +# operator== * text_encoding[meta header] * std[meta namespace] * text_encoding[meta class] From c08dfb5dce7d73795d1858dbc71a964b668e0c3c Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Thu, 26 Mar 2026 13:51:34 +0900 Subject: [PATCH 2660/3948] =?UTF-8?q?text=5Fencoding::comp-name=20:=20meta?= =?UTF-8?q?=20exposition-only=20=E3=82=BF=E3=82=B0=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/text_encoding/text_encoding/comp-name.md | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/text_encoding/text_encoding/comp-name.md b/reference/text_encoding/text_encoding/comp-name.md index 1a3b133170..4d55a9da00 100644 --- a/reference/text_encoding/text_encoding/comp-name.md +++ b/reference/text_encoding/text_encoding/comp-name.md @@ -4,6 +4,7 @@ * text_encoding[meta class] * function[meta id-type] * cpp26[meta cpp] +* [meta exposition-only] ```cpp static constexpr bool comp-name(string_view a, string_view b); // 説明専用 From 681ca425eac2fb0054a40192a814864580d44c16 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Thu, 26 Mar 2026 13:52:07 +0900 Subject: [PATCH 2661/3948] =?UTF-8?q?generator=20:=20=E3=82=BF=E3=82=A4?= =?UTF-8?q?=E3=83=88=E3=83=AB=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/generator/generator/iterator.md | 3 ++- reference/generator/generator/promise_type.md | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/reference/generator/generator/iterator.md b/reference/generator/generator/iterator.md index 2e29cd8a6d..bf595f2dfd 100644 --- a/reference/generator/generator/iterator.md +++ b/reference/generator/generator/iterator.md @@ -1,7 +1,8 @@ -# generator::iterator +# iterator * generator[meta header] * class template[meta id-type] * std[meta namespace] +* generator[meta class] * cpp23[meta cpp] ```cpp diff --git a/reference/generator/generator/promise_type.md b/reference/generator/generator/promise_type.md index 555ecf2432..6f868b151a 100644 --- a/reference/generator/generator/promise_type.md +++ b/reference/generator/generator/promise_type.md @@ -1,7 +1,8 @@ -# generator::promise_type +# promise_type * generator[meta header] * class template[meta id-type] * std[meta namespace] +* generator[meta class] * cpp23[meta cpp] ```cpp From 73bed16a6ffae8c6e3f028c7b0ba38602402ced7 Mon Sep 17 00:00:00 2001 From: Raclamusi Date: Thu, 26 Mar 2026 13:53:38 +0900 Subject: [PATCH 2662/3948] =?UTF-8?q?format=20:=20=E3=82=B5=E3=83=B3?= =?UTF-8?q?=E3=83=97=E3=83=AB=E3=82=B3=E3=83=BC=E3=83=89=E3=81=AE=E5=87=BA?= =?UTF-8?q?=E5=8A=9B=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/format/format.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/format/format.md b/reference/format/format.md index be84af4fe2..b728d56b72 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -582,7 +582,7 @@ int main() #### 出力 ``` queue: [1, 2, 3] -priority_queue: [3, 2, 1] +priority_queue: [3, 1, 2] stack: [1, 2, 3] flat_map: {1: "aaa", 2: "bbb"} flat_set: {1, 2, 3} From 901f3329f51680f90e0d1fa46e74b20a55309eda Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 27 Mar 2026 12:03:35 +0900 Subject: [PATCH 2663/3948] =?UTF-8?q?C++26=E5=AF=BE=E5=BF=9C=E3=81=A8?= =?UTF-8?q?=E3=81=97=E3=81=A6observable=5Fcheckpoint=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=20#1418?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26.md | 2 +- lang/cpp26/feature_test_macros.md | 2 +- reference/utility.md | 3 +- reference/utility/observable_checkpoint.md | 153 +++++++++++++++++++++ 4 files changed, 157 insertions(+), 3 deletions(-) create mode 100644 reference/utility/observable_checkpoint.md diff --git a/lang/cpp26.md b/lang/cpp26.md index 56d65a763e..8b7f0d9348 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -510,7 +510,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - [``](/reference/format.md)ヘッダの以下の機能 - [`std::format_error`](/reference/format/format_error.md) - [``](/reference/memory.md)に、ポインタのアライメントを判定する[`std::is_sufficiently_aligned()`](/reference/memory/is_sufficiently_aligned.md)関数を追加。 -- [``](/reference/utility.md)に、タイムトラベル最適化を抑止するための観測可能ポイントとして[`std::observable_checkpoint()`](/reference/utility/observable_checkpoint.md.nolink)を追加 +- [``](/reference/utility.md)に、タイムトラベル最適化を抑止するための観測可能ポイントとして[`std::observable_checkpoint()`](/reference/utility/observable_checkpoint.md)を追加 - [`std::exception_ptr`](/reference/exception/exception_ptr.md)を指定した例外型にキャストする[`std::exception_ptr_cast()`](/reference/exception/exception_ptr_cast.md)関数を追加 - [``](/reference/compare.md)に、型の順序を取得する[`std::type_order`](/reference/compare/type_order.md.nolink)クラスを追加 diff --git a/lang/cpp26/feature_test_macros.md b/lang/cpp26/feature_test_macros.md index c04f9b33b3..c4def015ae 100755 --- a/lang/cpp26/feature_test_macros.md +++ b/lang/cpp26/feature_test_macros.md @@ -117,7 +117,7 @@ |`__cpp_lib_linalg`|`202412L`|線形代数ライブラリとして[``](/reference/linalg.md)を追加|[``](/reference/linalg.md)| |`__cpp_lib_mdspan`|`202406L`|[`std::mdspan`](/reference/mdspan/mdspan.md)に対する[`std::dextents`](/reference/mdspan/extents.md)指定の冗長さを解決する[`std::dims`](/reference/mdspan/extents.md)を追加|[``](/reference/mdspan.md)| |`__cpp_lib_not_fn`|`202306L`|[`std::not_fn()`](/reference/functional/not_fn.md)に、非型テンプレート引数として関数を指定するオーバーロードを追加|[``](/reference/functional.md)| -|`__cpp_lib_observable_checkpoint`|`202506L`|[``](/reference/utility.md)に[`std::observable_checkpoint()`](/reference/utility/observable_checkpoint.md.nolink)を追加|[``](/reference/utility.md)| +|`__cpp_lib_observable_checkpoint`|`202506L`|[``](/reference/utility.md)に[`std::observable_checkpoint()`](/reference/utility/observable_checkpoint.md)を追加|[``](/reference/utility.md)| |`__cpp_lib_optional`|`202506L`|[`std::optional`](/reference/optional/optional.md)に、参照を保持するための`T&`の部分特殊化を追加|[``](/reference/optional.md)| |`__cpp_lib_optional_range_support`|`202406L`|[`std::optional`](/reference/optional/optional.md)にイテレータインタフェースを追加|[``](/reference/optional.md)| |`__cpp_lib_out_ptr`|`202311L`||[``](/reference/memory.md)| diff --git a/reference/utility.md b/reference/utility.md index ec1742388b..027556eaf8 100644 --- a/reference/utility.md +++ b/reference/utility.md @@ -68,11 +68,12 @@ | [`to_underlying`](utility/to_underlying.md) | 列挙値を基底型に変換する (function template) | C++23 | -## 到達しない表明 +## 未定義動作 | 名前 | 説明 | 対応バージョン | |------|------|----------------| | [`unreachable`](utility/unreachable.md) | コードパス不到達を表明する (function) | C++23 | +| [`observable_checkpoint`](utility/observable_checkpoint.md) | 観測可能チェックポイントを設置する (function) | C++26 | ## 組 diff --git a/reference/utility/observable_checkpoint.md b/reference/utility/observable_checkpoint.md new file mode 100644 index 0000000000..1e6a84b37d --- /dev/null +++ b/reference/utility/observable_checkpoint.md @@ -0,0 +1,153 @@ +# observable_checkpoint +* utility[meta header] +* function[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std { + void observable_checkpoint() noexcept; +} +``` + +## 概要 +観測可能チェックポイント (observable checkpoint) を設置する。 + +C++では未定義動作を含むプログラムに対して、コンパイラは未定義動作が「将来」発生することを根拠に、それより「前」の操作を削除・変更する最適化を行うことが許容される。これは「タイムトラベル最適化」と呼ばれる。 + +例として以下のコードでは、(2)で未定義動作があるため、(1)の出力すら省略される可能性がある: + +```cpp +#include + +int main() { + std::printf("Hello, "); // (1) 出力 + int* p = nullptr; + *p = 42; // (2) 未定義動作(nullポインタのデリファレンス) + std::printf("World!\n"); // (3) 出力 +} +``` + +`std::observable_checkpoint()`を呼び出すと、その時点で観測可能チェックポイントが設置される。観測可能チェックポイントより前に完了した操作の観測可能な動作は、その後に発生する未定義動作によって遡って無効化されないことが保証される。これにより、タイムトラベル最適化を抑止できる: + +```cpp +#include +#include + +int main() { + std::printf("Hello, "); // (1) 出力 + std::observable_checkpoint(); // ここまでの観測可能な動作を保護 + int* p = nullptr; + *p = 42; // (2) 未定義動作 + std::printf("World!\n"); // (3) 出力 +} +``` + +この場合、`std::observable_checkpoint()`によって(1)の出力`"Hello, "`が保護され、(2)の未定義動作があっても遡って消去されない。 + +`std::observable_checkpoint()`の明示的な呼び出しに加え、以下の操作も暗黙的に観測可能チェックポイントを設置する: + +- C標準の入出力関数([`std::printf()`](/reference/cstdio/printf.md)、[`std::fwrite()`](/reference/cstdio/fwrite.md)など)のうち、ファイルへのデータ書き込みを行う関数呼び出しからの復帰 +- [`std::basic_filebuf`](/reference/fstream/basic_filebuf.md)のオーバーフロー操作(出力シーケンスへの書き込み完了時) +- Unicode出力時の[`std::print()`](/reference/print/print.md) / [`std::println()`](/reference/print/println.md)の内部出力関数[`std::vprint_unicode()`](/reference/print/vprint_unicode.md)によるターミナルへの書き込み([``](/reference/ostream.md)版および[``](/reference/print.md)版) + +上記の例では`std::printf()`がC標準の入出力関数であるため、(1)の呼び出しの復帰が暗黙の観測可能チェックポイントとなり、`"Hello, "`の出力は(2)の未定義動作によって遡って消去されない。 + + +## 効果 +観測可能チェックポイントを設置する。 + + +## 例外 +投げない + + +## 備考 +- `std::observable_checkpoint()`の呼び出し自体は観測可能な動作ではない。コンパイラはこの関数を組み込み関数 (intrinsic) として実装でき、最適化後にゼロ命令のコードを生成できる +- `volatile`アクセスは暗黙の観測可能チェックポイントではない。`volatile`アクセスの順序保証は従来の happens before 規則に従う +- この関数はフリースタンディング環境でも使用可能である + + +## 例 +### 基本的な使い方 +```cpp example +#include +#include + +int table[10]; + +void process(int i) { + std::printf("processing %d\n", i); // (1) 暗黙の観測可能チェックポイント + table[i] = i * i; // i が範囲外なら未定義動作 +} + +int main() { + for (int i = 0; i < 12; ++i) { + process(i); + } +} +``` + +この例では、`i`が10以上になると`table[i]`で範囲外アクセスの未定義動作が発生する。しかし`std::printf()`はC標準の入出力関数であり、呼び出しの復帰が暗黙の観測可能チェックポイントとなる。そのため、`i`が0から9までの反復で出力された`"processing 0"`から`"processing 9"`は、その後の未定義動作によって遡って消去されることはない。 + +#### 出力例 +``` +processing 0 +processing 1 +processing 2 +processing 3 +processing 4 +processing 5 +processing 6 +processing 7 +processing 8 +processing 9 +processing 10 +processing 11 +``` + +### 明示的なチェックポイントの設置 +```cpp example +#include +#include + +int main() { + int result = 0; + + for (int i = 1; i <= 5; ++i) { + result += i; + } + std::printf("sum = %d\n", result); + std::observable_checkpoint(); // ここまでの出力を保護 + + // 以降のコードに未定義動作があっても + // "sum = 15" の出力は保証される + int* p = nullptr; + *p = 0; // 未定義動作 +} +``` +* std::observable_checkpoint[color ff0000] + +#### 出力例 +``` +sum = 15 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 22 [mark noimpl] +- [GCC](/implementation.md#gcc): 15 [mark noimpl] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + + +## 関連項目 +- [`unreachable`](unreachable.md) + + +## 参照 +- [P1494R5 Partial program correctness](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p1494r5.html) +- [P3641R0 Rename `std::observable` to `std::observable_checkpoint`, and add a feature-test macro](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3641r0.html) From 610b4e460f08dc3b3660539fc18f31fe09716958 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 27 Mar 2026 15:07:12 +0900 Subject: [PATCH 2664/3948] =?UTF-8?q?observable=5Fcheckpoint=20:=20cout?= =?UTF-8?q?=E3=82=84fstream=E3=81=AE=E6=89=B1=E3=81=84=E3=82=92=E8=A8=98?= =?UTF-8?q?=E8=BC=89=20#1418?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/utility/observable_checkpoint.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reference/utility/observable_checkpoint.md b/reference/utility/observable_checkpoint.md index 1e6a84b37d..879bca2569 100644 --- a/reference/utility/observable_checkpoint.md +++ b/reference/utility/observable_checkpoint.md @@ -48,7 +48,8 @@ int main() { `std::observable_checkpoint()`の明示的な呼び出しに加え、以下の操作も暗黙的に観測可能チェックポイントを設置する: - C標準の入出力関数([`std::printf()`](/reference/cstdio/printf.md)、[`std::fwrite()`](/reference/cstdio/fwrite.md)など)のうち、ファイルへのデータ書き込みを行う関数呼び出しからの復帰 -- [`std::basic_filebuf`](/reference/fstream/basic_filebuf.md)のオーバーフロー操作(出力シーケンスへの書き込み完了時) + - デフォルトの[`sync_with_stdio(true)`](/reference/ios/ios_base/sync_with_stdio.md)の状態では、[`std::cout`](/reference/iostream/cout.md)などの標準ストリームは`stdout`と同期しているため、これに該当する +- [`std::ofstream`](/reference/fstream/basic_ofstream.md)などのファイルストリーム出力時の[`std::basic_filebuf`](/reference/fstream/basic_filebuf.md)のオーバーフロー操作(バッファの内容をファイルに書き出した時点) - Unicode出力時の[`std::print()`](/reference/print/print.md) / [`std::println()`](/reference/print/println.md)の内部出力関数[`std::vprint_unicode()`](/reference/print/vprint_unicode.md)によるターミナルへの書き込み([``](/reference/ostream.md)版および[``](/reference/print.md)版) 上記の例では`std::printf()`がC標準の入出力関数であるため、(1)の呼び出しの復帰が暗黙の観測可能チェックポイントとなり、`"Hello, "`の出力は(2)の未定義動作によって遡って消去されない。 From d8f8beb93575d1d276829c2a84637f33777ed231 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 27 Mar 2026 15:23:25 +0900 Subject: [PATCH 2665/3948] =?UTF-8?q?observable=5Fcheckpoint=20:=20?= =?UTF-8?q?=E3=83=AB=E3=83=BC=E3=83=AB=E3=81=AE=E3=82=AB=E3=83=90=E3=83=BC?= =?UTF-8?q?=E7=8A=B6=E6=B3=81=E3=81=A8=E5=8B=95=E6=A9=9F=E3=81=A8=E3=81=AA?= =?UTF-8?q?=E3=82=8B=E4=BE=8B=E3=82=92=E8=A8=98=E8=BC=89=20#1418?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/utility/observable_checkpoint.md | 24 ++++++++++------------ 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/reference/utility/observable_checkpoint.md b/reference/utility/observable_checkpoint.md index 879bca2569..ba08d559b7 100644 --- a/reference/utility/observable_checkpoint.md +++ b/reference/utility/observable_checkpoint.md @@ -15,16 +15,14 @@ namespace std { C++では未定義動作を含むプログラムに対して、コンパイラは未定義動作が「将来」発生することを根拠に、それより「前」の操作を削除・変更する最適化を行うことが許容される。これは「タイムトラベル最適化」と呼ばれる。 -例として以下のコードでは、(2)で未定義動作があるため、(1)の出力すら省略される可能性がある: +例として以下のコードでは、nullポインタが渡された場合にエラーメッセージを出力してからデリファレンスに到達する意図だが、コンパイラは`++*p`が未定義動作にならないと仮定して`p`がnullでないと推論し、`if(!p)`の分岐ごと削除できる。その結果、エラーメッセージが出力されることなくクラッシュする可能性がある: ```cpp #include -int main() { - std::printf("Hello, "); // (1) 出力 - int* p = nullptr; - *p = 42; // (2) 未定義動作(nullポインタのデリファレンス) - std::printf("World!\n"); // (3) 出力 +void inc(int* p) { + if (!p) std::fputs("Null!\n", stderr); // (1) エラー出力(削除される可能性がある) + ++*p; // (2) pがnullなら未定義動作 } ``` @@ -34,16 +32,14 @@ int main() { #include #include -int main() { - std::printf("Hello, "); // (1) 出力 - std::observable_checkpoint(); // ここまでの観測可能な動作を保護 - int* p = nullptr; - *p = 42; // (2) 未定義動作 - std::printf("World!\n"); // (3) 出力 +void inc(int* p) { + if (!p) std::fputs("Null!\n", stderr); // (1) エラー出力 + std::observable_checkpoint(); // ここまでの観測可能な動作を保護 + ++*p; // (2) pがnullなら未定義動作 } ``` -この場合、`std::observable_checkpoint()`によって(1)の出力`"Hello, "`が保護され、(2)の未定義動作があっても遡って消去されない。 +この場合、`std::observable_checkpoint()`によって(1)のエラー出力が保護され、(2)の未定義動作があっても遡って消去されない。 `std::observable_checkpoint()`の明示的な呼び出しに加え、以下の操作も暗黙的に観測可能チェックポイントを設置する: @@ -51,6 +47,8 @@ int main() { - デフォルトの[`sync_with_stdio(true)`](/reference/ios/ios_base/sync_with_stdio.md)の状態では、[`std::cout`](/reference/iostream/cout.md)などの標準ストリームは`stdout`と同期しているため、これに該当する - [`std::ofstream`](/reference/fstream/basic_ofstream.md)などのファイルストリーム出力時の[`std::basic_filebuf`](/reference/fstream/basic_filebuf.md)のオーバーフロー操作(バッファの内容をファイルに書き出した時点) - Unicode出力時の[`std::print()`](/reference/print/print.md) / [`std::println()`](/reference/print/println.md)の内部出力関数[`std::vprint_unicode()`](/reference/print/vprint_unicode.md)によるターミナルへの書き込み([``](/reference/ostream.md)版および[``](/reference/print.md)版) + - Unicode出力時はネイティブのOS API(Windowsでの`WriteConsoleW()`など)を直接使用しC標準の入出力を経由しないため、このルールで明示的にカバーしている + - 非Unicode出力時はC標準I/O関数を経由するため、上記のC標準入出力関数のルールでカバーされる 上記の例では`std::printf()`がC標準の入出力関数であるため、(1)の呼び出しの復帰が暗黙の観測可能チェックポイントとなり、`"Hello, "`の出力は(2)の未定義動作によって遡って消去されない。 From 49966cafa26ed417189f8c5c20540a1eee4ce58a Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Sat, 28 Mar 2026 10:51:07 +0900 Subject: [PATCH 2666/3948] =?UTF-8?q?observable=5Fcheckpoint=20:=20printf?= =?UTF-8?q?=20=E2=86=92=20fputs=E3=81=AE=E4=BF=AE=E6=AD=A3=E6=BC=8F?= =?UTF-8?q?=E3=82=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @tshino さんからのコメントに対応 https://github.com/cpprefjp/site/commit/d8f8beb93575d1d276829c2a84637f33777ed231#commitcomment-180806498 --- reference/utility/observable_checkpoint.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/utility/observable_checkpoint.md b/reference/utility/observable_checkpoint.md index ba08d559b7..cb4ecb0b4b 100644 --- a/reference/utility/observable_checkpoint.md +++ b/reference/utility/observable_checkpoint.md @@ -50,7 +50,7 @@ void inc(int* p) { - Unicode出力時はネイティブのOS API(Windowsでの`WriteConsoleW()`など)を直接使用しC標準の入出力を経由しないため、このルールで明示的にカバーしている - 非Unicode出力時はC標準I/O関数を経由するため、上記のC標準入出力関数のルールでカバーされる -上記の例では`std::printf()`がC標準の入出力関数であるため、(1)の呼び出しの復帰が暗黙の観測可能チェックポイントとなり、`"Hello, "`の出力は(2)の未定義動作によって遡って消去されない。 +上記の例では`std::fputs()`がC標準の入出力関数であるため、(1)の呼び出しの復帰が暗黙の観測可能チェックポイントとなり、`"Null!\n"`の出力は(2)の未定義動作によって遡って消去されない。 ## 効果 From 70dfbf31fe6c345a151162fcc25addde76d76520 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 30 Mar 2026 18:31:10 +0900 Subject: [PATCH 2667/3948] =?UTF-8?q?C++26=E5=AF=BE=E5=BF=9C=E3=81=A8?= =?UTF-8?q?=E3=81=97=E3=81=A6inplace=5Fvector=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=20#1313?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_QUALIFY_LIST.txt | 2 + lang/cpp26.md | 2 +- lang/cpp26/feature_test_macros.md | 6 +- reference.md | 2 +- reference/inplace_vector.md | 23 ++ reference/inplace_vector/inplace_vector.md | 271 ++++++++++++++++++ .../inplace_vector/append_range.md | 63 ++++ .../inplace_vector/inplace_vector/assign.md | 87 ++++++ .../inplace_vector/assign_range.md | 63 ++++ reference/inplace_vector/inplace_vector/at.md | 72 +++++ .../inplace_vector/inplace_vector/back.md | 57 ++++ .../inplace_vector/inplace_vector/begin.md | 63 ++++ .../inplace_vector/inplace_vector/capacity.md | 63 ++++ .../inplace_vector/inplace_vector/cbegin.md | 59 ++++ .../inplace_vector/inplace_vector/cend.md | 62 ++++ .../inplace_vector/inplace_vector/clear.md | 62 ++++ .../inplace_vector/inplace_vector/crbegin.md | 58 ++++ .../inplace_vector/inplace_vector/crend.md | 62 ++++ .../inplace_vector/inplace_vector/data.md | 66 +++++ .../inplace_vector/inplace_vector/emplace.md | 73 +++++ .../inplace_vector/emplace_back.md | 69 +++++ .../inplace_vector/inplace_vector/empty.md | 62 ++++ .../inplace_vector/inplace_vector/end.md | 68 +++++ .../inplace_vector/inplace_vector/erase.md | 73 +++++ .../inplace_vector/erase_free.md | 76 +++++ .../inplace_vector/erase_if_free.md | 74 +++++ .../inplace_vector/inplace_vector/front.md | 57 ++++ .../inplace_vector/inplace_vector/insert.md | 104 +++++++ .../inplace_vector/insert_range.md | 72 +++++ .../inplace_vector/inplace_vector/max_size.md | 60 ++++ .../inplace_vector/op_assign.md | 95 ++++++ .../inplace_vector/inplace_vector/op_at.md | 61 ++++ .../inplace_vector/op_compare_3way.md | 90 ++++++ .../inplace_vector/op_constructor.md | 132 +++++++++ .../inplace_vector/op_destructor.md | 27 ++ .../inplace_vector/inplace_vector/op_equal.md | 75 +++++ .../inplace_vector/inplace_vector/pop_back.md | 72 +++++ .../inplace_vector/push_back.md | 77 +++++ .../inplace_vector/inplace_vector/rbegin.md | 63 ++++ .../inplace_vector/inplace_vector/rend.md | 68 +++++ .../inplace_vector/inplace_vector/reserve.md | 72 +++++ .../inplace_vector/inplace_vector/resize.md | 78 +++++ .../inplace_vector/shrink_to_fit.md | 31 ++ .../inplace_vector/inplace_vector/size.md | 56 ++++ .../inplace_vector/inplace_vector/swap.md | 75 +++++ .../inplace_vector/swap_free.md | 67 +++++ .../inplace_vector/try_append_range.md | 70 +++++ .../inplace_vector/try_emplace_back.md | 72 +++++ .../inplace_vector/try_push_back.md | 74 +++++ .../inplace_vector/unchecked_emplace_back.md | 73 +++++ .../inplace_vector/unchecked_push_back.md | 81 ++++++ 51 files changed, 3435 insertions(+), 5 deletions(-) create mode 100644 reference/inplace_vector.md create mode 100644 reference/inplace_vector/inplace_vector.md create mode 100644 reference/inplace_vector/inplace_vector/append_range.md create mode 100644 reference/inplace_vector/inplace_vector/assign.md create mode 100644 reference/inplace_vector/inplace_vector/assign_range.md create mode 100644 reference/inplace_vector/inplace_vector/at.md create mode 100644 reference/inplace_vector/inplace_vector/back.md create mode 100644 reference/inplace_vector/inplace_vector/begin.md create mode 100644 reference/inplace_vector/inplace_vector/capacity.md create mode 100644 reference/inplace_vector/inplace_vector/cbegin.md create mode 100644 reference/inplace_vector/inplace_vector/cend.md create mode 100644 reference/inplace_vector/inplace_vector/clear.md create mode 100644 reference/inplace_vector/inplace_vector/crbegin.md create mode 100644 reference/inplace_vector/inplace_vector/crend.md create mode 100644 reference/inplace_vector/inplace_vector/data.md create mode 100644 reference/inplace_vector/inplace_vector/emplace.md create mode 100644 reference/inplace_vector/inplace_vector/emplace_back.md create mode 100644 reference/inplace_vector/inplace_vector/empty.md create mode 100644 reference/inplace_vector/inplace_vector/end.md create mode 100644 reference/inplace_vector/inplace_vector/erase.md create mode 100644 reference/inplace_vector/inplace_vector/erase_free.md create mode 100644 reference/inplace_vector/inplace_vector/erase_if_free.md create mode 100644 reference/inplace_vector/inplace_vector/front.md create mode 100644 reference/inplace_vector/inplace_vector/insert.md create mode 100644 reference/inplace_vector/inplace_vector/insert_range.md create mode 100644 reference/inplace_vector/inplace_vector/max_size.md create mode 100644 reference/inplace_vector/inplace_vector/op_assign.md create mode 100644 reference/inplace_vector/inplace_vector/op_at.md create mode 100644 reference/inplace_vector/inplace_vector/op_compare_3way.md create mode 100644 reference/inplace_vector/inplace_vector/op_constructor.md create mode 100644 reference/inplace_vector/inplace_vector/op_destructor.md create mode 100644 reference/inplace_vector/inplace_vector/op_equal.md create mode 100644 reference/inplace_vector/inplace_vector/pop_back.md create mode 100644 reference/inplace_vector/inplace_vector/push_back.md create mode 100644 reference/inplace_vector/inplace_vector/rbegin.md create mode 100644 reference/inplace_vector/inplace_vector/rend.md create mode 100644 reference/inplace_vector/inplace_vector/reserve.md create mode 100644 reference/inplace_vector/inplace_vector/resize.md create mode 100644 reference/inplace_vector/inplace_vector/shrink_to_fit.md create mode 100644 reference/inplace_vector/inplace_vector/size.md create mode 100644 reference/inplace_vector/inplace_vector/swap.md create mode 100644 reference/inplace_vector/inplace_vector/swap_free.md create mode 100644 reference/inplace_vector/inplace_vector/try_append_range.md create mode 100644 reference/inplace_vector/inplace_vector/try_emplace_back.md create mode 100644 reference/inplace_vector/inplace_vector/try_push_back.md create mode 100644 reference/inplace_vector/inplace_vector/unchecked_emplace_back.md create mode 100644 reference/inplace_vector/inplace_vector/unchecked_push_back.md diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index e73acb1ff3..0b3452d06f 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -170,6 +170,8 @@ * std::initializer_list[link /reference/initializer_list/initializer_list.md] * il.begin()[link /reference/initializer_list/initializer_list/begin.md] * il.end()[link /reference/initializer_list/initializer_list/end.md] +* [link /reference/inplace_vector.md] + * std::inplace_vector[link /reference/inplace_vector/inplace_vector.md] * [link /reference/iomanip.md] * [link /reference/ios.md] * std::boolalpha[link /reference/ios/boolalpha.md] diff --git a/lang/cpp26.md b/lang/cpp26.md index 8b7f0d9348..943df692e2 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -132,7 +132,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - データ並列ライブラリとして、[``](/reference/simd.md.nolink)を追加 - デバッグサポートのライブラリとして[``](/reference/debugging.md)を追加 - 線形代数ライブラリとして[``](/reference/linalg.md)を追加 -- コンパイル時に容量を固定する可変長配列クラスのライブラリとして[``](/reference/inplace_vector.md.nolink)を追加 +- コンパイル時に容量を固定する可変長配列クラスのライブラリとして[``](/reference/inplace_vector.md)を追加 - C23の互換ライブラリとして、ビット操作ライブラリ[``](/reference/stdbit.h.md.nolink)と、検査付き整数演算ライブラリ[``](/reference/stdckdint.h.md.nolink)を追加。``形式のライブラリは追加されない diff --git a/lang/cpp26/feature_test_macros.md b/lang/cpp26/feature_test_macros.md index c4def015ae..d52c6df881 100755 --- a/lang/cpp26/feature_test_macros.md +++ b/lang/cpp26/feature_test_macros.md @@ -60,7 +60,7 @@ |`__cpp_lib_constexpr_flat_map`|`202502L`|[`std::flat_map`](/reference/flat_map/flat_map.md) / [`std::flat_multimap`](/reference/flat_map/flat_multimap.md)を`constexpr`対応|[``](/reference/flat_map.md)| |`__cpp_lib_constexpr_flat_set`|`202502L`|[`std::flat_set`](/reference/flat_set/flat_set.md) / [`std::flat_multiset`](/reference/flat_set/flat_multiset.md)を`constexpr`対応|[``](/reference/flat_set.md)| |`__cpp_lib_constexpr_forward_list`|`202502L`|[`std::forward_list`](/reference/forward_list/forward_list.md)を`constexpr`対応|[``](/reference/forward_list.md)| -|`__cpp_lib_constexpr_inplace_vector`|`202502L`|[`std::inplace_vector`](/reference/inplace_vector/inplace_vector.md.nolink)を`constexpr`対応|[``](/reference/inplace_vector.md.nolink)| +|`__cpp_lib_constexpr_inplace_vector`|`202502L`|[`std::inplace_vector`](/reference/inplace_vector/inplace_vector.md)を`constexpr`対応|[``](/reference/inplace_vector.md)| |`__cpp_lib_constexpr_list`|`202502L`|[`std::list`](/reference/list/list.md)を`constexpr`対応|[``](/reference/list.md)| |`__cpp_lib_constexpr_map`|`202502L`|[`std::map`](/reference/map/map.md) / [`std::multimap`](/reference/map/multimap.md)を`constexpr`対応|[``](/reference/map.md)| |`__cpp_lib_constexpr_memory`|`202506L`|[`std::shared_ptr`](/reference/memory/shared_ptr.md)クラスとその関連機能を`constexpr`対応|[``](/reference/memory.md)| @@ -110,7 +110,7 @@ |`__cpp_lib_hazard_pointer`|`202306L`|ハザードポインタのライブラリ[``](/reference/hazard_pointer.md.nolink)を追加|[``](/reference/hazard_pointer.md.nolink)| |`__cpp_lib_hive`|`202502L`|シーケンスコンテナのライブラリ[``](/reference/hive.md.nolink)を追加|[``](/reference/hive.md.nolink)| |`__cpp_lib_indirect`|`202502L`|[``](/reference/memory.md)に[`std::indirect`](/reference/memory/indirect.md.nolink)と[`std::polymorphic`](/reference/memory/polymorphic.md.nolink)を追加|[``](/reference/memory.md)| -|`__cpp_lib_inplace_vector`|`202406L`|容量固定の可変長配列のライブラリ[``](/reference/inplace_vector.md.nolink)を追加|[``](/reference/inplace_vector.md.nolink)| +|`__cpp_lib_inplace_vector`|`202406L`|容量固定の可変長配列のライブラリ[``](/reference/inplace_vector.md)を追加|[``](/reference/inplace_vector.md)| |`__cpp_lib_is_sufficiently_aligned`|`202411L`|[``](/reference/mdspan.md)に、要素アクセスにアライメント保証を与える[`std::aligned_accessor`](/reference/mdspan/aligned_accessor.md)を追加|[``](/reference/memory.md)| |`__cpp_lib_is_virtual_base_of`|`202406L`|[``](/reference/type_traits.md)に[`std::is_virtual_base_of`](/reference/type_traits/is_virtual_base_of.md)を追加|[``](/reference/type_traits.md)| |`__cpp_lib_is_within_lifetime`|`202306L`|[``](/reference/type_traits.md)に[`std::is_within_lifetime()`](/reference/type_traits/is_within_lifetime.md)を追加|[``](/reference/type_traits.md)| @@ -174,7 +174,7 @@ |`__cpp_lib_hardened_deque`|`202502L`||[``](/reference/deque.md)| |`__cpp_lib_hardened_expected`|`202502L`||[``](/reference/expected.md)| |`__cpp_lib_hardened_forward_list`|`202502L`||[``](/reference/forward_list.md)| -|`__cpp_lib_hardened_inplace_vector`|`202502L`||[``](/reference/inplace_vector.md.nolink)| +|`__cpp_lib_hardened_inplace_vector`|`202502L`||[``](/reference/inplace_vector.md)| |`__cpp_lib_hardened_list`|`202502L`||[``](/reference/list.md)| |`__cpp_lib_hardened_mdspan`|`202502L`||[``](/reference/mdspan.md)| |`__cpp_lib_hardened_optional`|`202502L`||[``](/reference/optional.md)| diff --git a/reference.md b/reference.md index 6962fe8e8b..9fc7c1ff30 100644 --- a/reference.md +++ b/reference.md @@ -107,7 +107,7 @@ | [``](/reference/queue.md) | FIFOキュー | | | [``](/reference/stack.md) | LIFOスタック | | | [``](/reference/vector.md) | 可変長配列 | | -| [``](/reference/inplace_vector.md.nolink) | 容量固定の可変長配列 | C++26 | +| [``](/reference/inplace_vector.md) | 容量固定の可変長配列 | C++26 | | [``](/reference/map.md) | 順序付き連想配列 | | | [``](/reference/set.md) | 順序付き集合 | | | [``](/reference/flat_map.md) | ソート済みキーによる順序付き連想配列 | C++23 | diff --git a/reference/inplace_vector.md b/reference/inplace_vector.md new file mode 100644 index 0000000000..34901c99eb --- /dev/null +++ b/reference/inplace_vector.md @@ -0,0 +1,23 @@ +# inplace_vector +* inplace_vector[meta header] +* cpp26[meta cpp] + +``ヘッダでは、コンパイル時に容量を決定する可変長配列の実装である`inplace_vector`コンテナを提供する。 + +このヘッダでは、以下の標準ヘッダをインクルードする: + +- [``](initializer_list.md) +- [``](compare.md) + + +| 名前 | 説明 | 対応バージョン | +|-----------------------------|----------------------------|-------| +| [`inplace_vector`](inplace_vector/inplace_vector.md) | 容量固定の可変長配列(class template) | C++26 | + + +## バージョン +### 言語 +- C++26 + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector.md b/reference/inplace_vector/inplace_vector.md new file mode 100644 index 0000000000..c34ec412f9 --- /dev/null +++ b/reference/inplace_vector/inplace_vector.md @@ -0,0 +1,271 @@ +# inplace_vector +* inplace_vector[meta header] +* std[meta namespace] +* class template[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + class inplace_vector; +} +``` + +## 概要 +`inplace_vector`はシーケンスコンテナの一種で、各要素は線形に、順序を保ったまま格納される。 + +`inplace_vector`は容量をコンパイル時定数`N`で固定する可変長配列として実装される。[`std::vector`](/reference/vector/vector.md)と異なり、要素はオブジェクト自身の内部ストレージ(スタック領域)に直接格納され、動的メモリ確保を一切行わない。容量は最大`N`要素であり、実行時にこれを超えて拡張することはできない。 + +`inplace_vector`は連続コンテナ (contiguous container) であり、要素は隣接するメモリ上に配置される。添字による要素のランダムアクセスもできる。 + +[`std::array`](/reference/array/array.md)との主な違いは、`inplace_vector`は要素数が可変であること、つまりデフォルト構築時に空であり、要素の追加・削除ができる点である。[`std::vector`](/reference/vector/vector.md)との主な違いは、ヒープではなくスタック配列であり、容量がコンパイル時に固定される点と、ムーブ・[`swap`](inplace_vector/swap.md)操作の計算量が[`std::array`](/reference/array/array.md)と同様に要素数に対して線形時間であり全イテレータが無効化される点である。 + +`is_trivially_copyable_v`が`true`であるか、`N == 0`である場合、`inplace_vector`自身もトリビアルにコピー可能である。 + +容量`N`が`0`の場合、`inplace_vector`は空の型 ([`is_empty_v`](/reference/type_traits/is_empty.md)が`true`) となる。 + +サイズが`N`を超える操作([`push_back()`](inplace_vector/push_back.md)や[`insert()`](inplace_vector/insert.md)など)は[`std::bad_alloc`](/reference/new/bad_alloc.md)例外を送出する。容量超過時に例外ではなく戻り値で失敗を通知する失敗許容API (fallible API)([`try_push_back()`](inplace_vector/try_push_back.md)、[`try_emplace_back()`](inplace_vector/try_emplace_back.md)、[`try_append_range()`](inplace_vector/try_append_range.md))や、事前条件として容量超過しないことを要求する事前条件チェックなしAPI (unchecked API)([`unchecked_push_back()`](inplace_vector/unchecked_push_back.md)、[`unchecked_emplace_back()`](inplace_vector/unchecked_emplace_back.md))も提供される。 + +`inplace_vector`はアロケータを使用しない。 + +`inplace_vector`の全メンバ関数は`constexpr`指定されており、定数式の中で使用できる。 + + +### コンテナとしての特性 + +- 各要素への添字アクセス(定数時間) +- 双方向への走査(線形時間) +- 末尾への要素の追加・削除(定数時間。ただし容量超過時は例外送出) + + +### テンプレートパラメータ + +- `T`: 格納される要素の型 +- `N`: コンパイル時に決定される最大容量。[`std::size_t`](/reference/cstddef/size_t.md)型 + + +### 推論補助はない +`inplace_vector`にはクラステンプレートの推論補助が定義されていない。これは、初期化子リストやイテレータ範囲から要素型`T`を推論できたとしても、コンパイル定数である容量`N`を推論する方法がないためである。容量はコンパイル時定数として明示的に指定する必要がある。 + +```cpp +// std::vector では推論補助が使える +std::vector v = {1, 2, 3}; // OK: vector + +// std::inplace_vector では推論補助が使えない +// std::inplace_vector iv = {1, 2, 3}; // エラー: Nを推論できない +std::inplace_vector iv = {1, 2, 3}; // OK: 明示的に型と容量を指定 +``` + + +## メンバ関数 +### 構築・破棄 + +| 名前 | 説明 | 対応バージョン | +|---------------------------------------|----------------|-------| +| [`(constructor)`](inplace_vector/op_constructor.md) | コンストラクタ | C++26 | +| [`(destructor)`](inplace_vector/op_destructor.md) | デストラクタ | C++26 | +| [`operator=`](inplace_vector/op_assign.md) | 代入演算子 | C++26 | + + +### イテレータ + +| 名前 | 説明 | 対応バージョン | +|----------------------------------|---------------------------------------|-------| +| [`begin`](inplace_vector/begin.md) | 先頭の要素を指すイテレータを取得する | C++26 | +| [`end`](inplace_vector/end.md) | 末尾の次を指すイテレータを取得する | C++26 | +| [`cbegin`](inplace_vector/cbegin.md) | 先頭の要素を指す読み取り専用イテレータを取得する | C++26 | +| [`cend`](inplace_vector/cend.md) | 末尾の次を指す読み取り専用イテレータを取得する | C++26 | +| [`rbegin`](inplace_vector/rbegin.md) | 末尾を指す逆イテレータを取得する | C++26 | +| [`rend`](inplace_vector/rend.md) | 先頭の前を指す逆イテレータを取得する | C++26 | +| [`crbegin`](inplace_vector/crbegin.md) | 末尾を指す読み取り専用逆イテレータを取得する | C++26 | +| [`crend`](inplace_vector/crend.md) | 先頭の前を指す読み取り専用逆イテレータを取得する | C++26 | + + +### 領域 + +| 名前 | 説明 | 対応バージョン | +|----------------------------------------------|------------------|-------| +| [`size`](inplace_vector/size.md) | 要素数を取得する | C++26 | +| [`max_size`](inplace_vector/max_size.md) | 格納可能な最大の要素数を取得する(`N`を返す) | C++26 | +| [`capacity`](inplace_vector/capacity.md) | 格納可能な最大の要素数を取得する(`N`を返す) | C++26 | +| [`resize`](inplace_vector/resize.md) | 要素数を変更する | C++26 | +| [`empty`](inplace_vector/empty.md) | コンテナが空かどうかを判定する | C++26 | +| [`reserve`](inplace_vector/reserve.md) | 容量を確認する(`n > N`の場合に例外を送出) | C++26 | +| [`shrink_to_fit`](inplace_vector/shrink_to_fit.md) | 何もしない | C++26 | + + +### 要素アクセス + +| 名前 | 説明 | 対応バージョン | +|-----------------------------------|---------------|-------| +| [`operator[]`](inplace_vector/op_at.md) | 要素アクセス | C++26 | +| [`at`](inplace_vector/at.md) | 要素アクセス | C++26 | +| [`front`](inplace_vector/front.md) | 先頭要素への参照を取得する | C++26 | +| [`back`](inplace_vector/back.md) | 末尾要素への参照を取得する | C++26 | +| [`data`](inplace_vector/data.md) | 配列の先頭へのポインタを取得する | C++26 | + + +### コンテナの変更 + +| 名前 | 説明 | 対応バージョン | +|--------------------------------------------|------------------|-------| +| [`assign`](inplace_vector/assign.md) | コンテナの再代入 | C++26 | +| [`assign_range`](inplace_vector/assign_range.md) | Rangeの要素を再代入 | C++26 | +| [`push_back`](inplace_vector/push_back.md) | 末尾へ要素追加 | C++26 | +| [`emplace_back`](inplace_vector/emplace_back.md) | 末尾へ直接構築 | C++26 | +| [`append_range`](inplace_vector/append_range.md) | Rangeの要素を末尾へ追加 | C++26 | +| [`pop_back`](inplace_vector/pop_back.md) | 末尾から要素削除 | C++26 | +| [`insert`](inplace_vector/insert.md) | 要素の挿入 | C++26 | +| [`emplace`](inplace_vector/emplace.md) | 要素の直接構築による挿入 | C++26 | +| [`insert_range`](inplace_vector/insert_range.md) | Rangeの要素を挿入 | C++26 | +| [`erase`](inplace_vector/erase.md) | 要素の削除 | C++26 | +| [`swap`](inplace_vector/swap.md) | コンテナの交換 | C++26 | +| [`clear`](inplace_vector/clear.md) | 全要素削除 | C++26 | + + +### 失敗許容の追加操作 (fallible API) + +| 名前 | 説明 | 対応バージョン | +|--------------------------------------------|------------------|-------| +| [`try_push_back`](inplace_vector/try_push_back.md) | 末尾へ要素追加を試みる。容量超過時は`nullptr`を返す | C++26 | +| [`try_emplace_back`](inplace_vector/try_emplace_back.md) | 末尾へ直接構築を試みる。容量超過時は`nullptr`を返す | C++26 | +| [`try_append_range`](inplace_vector/try_append_range.md) | Rangeの要素を末尾へ追加を試みる。容量超過時は挿入されなかった最初の要素を指すイテレータを返す | C++26 | + + +### 事前条件チェックなしの追加操作 (unchecked API) + +| 名前 | 説明 | 対応バージョン | +|--------------------------------------------|------------------|-------| +| [`unchecked_push_back`](inplace_vector/unchecked_push_back.md) | 容量チェックなしで末尾へ要素追加 | C++26 | +| [`unchecked_emplace_back`](inplace_vector/unchecked_emplace_back.md) | 容量チェックなしで末尾へ直接構築 | C++26 | + + +## メンバ型 + +| 名前 | 説明 | 対応バージョン | +|--------------------------|-----------------------------------------------------------------------|-------| +| `value_type` | 要素型 `T` | C++26 | +| `pointer` | `T*` | C++26 | +| `const_pointer` | `const T*` | C++26 | +| `reference` | `T&` | C++26 | +| `const_reference` | `const T&` | C++26 | +| `size_type` | 符号なし整数型 (通常は[`size_t`](/reference/cstddef/size_t.md)) | C++26 | +| `difference_type` | 符号付き整数型 (通常は[`ptrdiff_t`](/reference/cstddef/ptrdiff_t.md)) | C++26 | +| `iterator` | 実装定義のランダムアクセスイテレータかつ[`contiguous_iterator`](/reference/iterator/contiguous_iterator.md) | C++26 | +| `const_iterator` | 実装定義の読み取り専用ランダムアクセスイテレータかつ[`contiguous_iterator`](/reference/iterator/contiguous_iterator.md) | C++26 | +| `reverse_iterator` | [`reverse_iterator`](/reference/iterator/reverse_iterator.md)`` | C++26 | +| `const_reverse_iterator` | [`reverse_iterator`](/reference/iterator/reverse_iterator.md)`` | C++26 | + + +## 非メンバ関数 +### 比較演算子 + +| 名前 | 説明 | 対応バージョン | +|----------------------------------------------|------------------------------------|-------| +| [`operator==`](inplace_vector/op_equal.md) | 等値比較 | C++26 | +| `bool operator!=(const inplace_vector& x, const inplace_vector& y);` | 非等値比較 (`==`により使用可能) | C++26 | +| [`operator<=>`](inplace_vector/op_compare_3way.md) | 三方比較 | C++26 | +| `bool operator<(const inplace_vector& x, const inplace_vector& y);` | 左辺が右辺より小さいかの判定を行う (`<=>`により使用可能) | C++26 | +| `bool operator<=(const inplace_vector& x, const inplace_vector& y);` | 左辺が右辺以下かの判定を行う (`<=>`により使用可能) | C++26 | +| `bool operator>(const inplace_vector& x, const inplace_vector& y);` | 左辺が右辺より大きいかの判定を行う (`<=>`により使用可能) | C++26 | +| `bool operator>=(const inplace_vector& x, const inplace_vector& y);` | 左辺が右辺以上かの判定を行う (`<=>`により使用可能) | C++26 | + +### 入れ替え + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`swap`](inplace_vector/swap_free.md) | 2つの`inplace_vector`オブジェクトを入れ替える | C++26 | + +### 要素削除 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`erase`](inplace_vector/erase_free.md) | 指定した値をもつ要素とその分の領域を、コンテナから削除する | C++26 | +| [`erase_if`](inplace_vector/erase_if_free.md) | 指定した条件に合致する要素とその分の領域を、コンテナから削除する | C++26 | + + + +## 例 +### 基本的な使い方 +```cpp example +#include +#include + +int main() +{ + // int型を要素とし、最大容量5の固定容量可変長配列 + std::inplace_vector iv = {1, 99, 4}; + + iv[1] = 3; // 1番目の要素を参照し、書き換える + iv.push_back(5); // 末尾に値5を追加 + iv.insert(iv.begin() + 1, 2); // 1番目に値2を挿入 + + int* p = iv.data(); // 内部表現のポインタを取得 + std::size_t size = iv.size(); // 要素数を取得 + + // 各要素に対して操作を行う + for (int x : iv) { + std::println("{}", x); + } +} +``` +* iv[1][link inplace_vector/op_at.md] +* iv.push_back[link inplace_vector/push_back.md] +* iv.insert[link inplace_vector/insert.md] +* iv.data()[link inplace_vector/data.md] +* iv.size()[link inplace_vector/size.md] + +#### 出力 +``` +1 +2 +3 +4 +5 +``` + +### 失敗許容API (fallible API) の使用例 +```cpp example +#include +#include + +int main() +{ + std::inplace_vector iv = {1, 2, 3}; + + // 容量が満杯なので、try_push_backはnullptrを返す + int* result = iv.try_push_back(4); + if (result == nullptr) { + std::println("容量超過: 要素を追加できません"); + } + + // unchecked_push_backは容量チェックを行わない(容量超過は未定義動作) + // iv.unchecked_push_back(4); // 未定義動作! + + std::println("size: {}", iv.size()); +} +``` +* iv.try_push_back[link inplace_vector/try_push_back.md] +* iv.size()[link inplace_vector/size.md] + +#### 出力 +``` +容量超過: 要素を追加できません +size: 3 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) +- [P3074R7 Trivial Unions (was `std::uninitialized`)](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3074r7.html) + - C++26で非トリビアルな型に対する`constexpr`制限が撤廃された diff --git a/reference/inplace_vector/inplace_vector/append_range.md b/reference/inplace_vector/inplace_vector/append_range.md new file mode 100644 index 0000000000..7dd503a705 --- /dev/null +++ b/reference/inplace_vector/inplace_vector/append_range.md @@ -0,0 +1,63 @@ +# append_range +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template R> +constexpr void append_range(R&& rg); // (1) C++26 +``` + +## 概要 +Rangeの要素を末尾へ追加する。 + + +## 効果 +Range `rg`の各要素を末尾に追加する。 + + +## 例外 +追加後のサイズが`N`を超える場合、[`std::bad_alloc`](/reference/new/bad_alloc.md)例外を送出する。 + + +## 戻り値 +なし + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::inplace_vector iv = {1, 2, 3}; + + std::vector src = {4, 5, 6}; + iv.append_range(src); + + for (int x : iv) std::print("{} ", x); + std::println(""); +} +``` +* append_range[color ff0000] + +### 出力 +``` +1 2 3 4 5 6 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/assign.md b/reference/inplace_vector/inplace_vector/assign.md new file mode 100644 index 0000000000..bbbff55a8d --- /dev/null +++ b/reference/inplace_vector/inplace_vector/assign.md @@ -0,0 +1,87 @@ +# assign +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +template +constexpr void assign(InputIterator first, InputIterator last); // (1) C++26 + +constexpr void assign(size_type n, const T& u); // (2) C++26 + +constexpr void assign(initializer_list il); // (3) C++26 +``` +* initializer_list[link /reference/initializer_list/initializer_list.md] + +## 概要 +コンテナの再代入。 + +- (1) : イテレータ範囲`[first, last)`の要素で既存の要素を置き換える。 +- (2) : `n`個の`u`のコピーで既存の要素を置き換える。 +- (3) : 初期化子リスト`il`の要素で既存の要素を置き換える。 + + +## 効果 +- (1) : `*this`の全要素を破棄し、イテレータ範囲`[first, last)`の要素で置き換える。 +- (2) : `*this`の全要素を破棄し、`n`個の`u`のコピーで置き換える。 +- (3) : `*this`の全要素を破棄し、`il`の要素で置き換える。 + + +## 例外 +- (1) : [`distance`](/reference/iterator/distance.md)`(first, last) > N`の場合、[`std::bad_alloc`](/reference/new/bad_alloc.md)例外を送出する。 +- (2) : `n > N`の場合、[`std::bad_alloc`](/reference/new/bad_alloc.md)例外を送出する。 +- (3) : `il.size() > N`の場合、[`std::bad_alloc`](/reference/new/bad_alloc.md)例外を送出する。 + + +## 戻り値 +なし + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::inplace_vector iv = {1, 2, 3}; + + // (1) イテレータ範囲で再代入 + int arr[] = {10, 20, 30, 40}; + iv.assign(std::begin(arr), std::end(arr)); + for (int x : iv) std::print("{} ", x); + std::println(""); + + // (2) n個の値で再代入 + iv.assign(3, 99); + for (int x : iv) std::print("{} ", x); + std::println(""); + + // (3) 初期化子リストで再代入 + iv.assign({5, 6, 7}); + for (int x : iv) std::print("{} ", x); + std::println(""); +} +``` +* assign[color ff0000] + +### 出力 +``` +10 20 30 40 +99 99 99 +5 6 7 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/assign_range.md b/reference/inplace_vector/inplace_vector/assign_range.md new file mode 100644 index 0000000000..1f86302eb9 --- /dev/null +++ b/reference/inplace_vector/inplace_vector/assign_range.md @@ -0,0 +1,63 @@ +# assign_range +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template R> +constexpr void assign_range(R&& rg); // (1) C++26 +``` + +## 概要 +Rangeの要素を再代入する。 + + +## 効果 +`*this`の全要素を破棄し、Range `rg`の要素で置き換える。 + + +## 例外 +`rg`の要素数が`N`を超える場合、[`bad_alloc`](/reference/new/bad_alloc.md)例外を送出する。 + + +## 戻り値 +なし + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::inplace_vector iv = {1, 2, 3}; + + std::vector src = {10, 20, 30, 40, 50}; + iv.assign_range(src); + + for (int x : iv) std::print("{} ", x); + std::println(""); +} +``` +* assign_range[color ff0000] + +### 出力 +``` +10 20 30 40 50 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/at.md b/reference/inplace_vector/inplace_vector/at.md new file mode 100644 index 0000000000..0de6a603b7 --- /dev/null +++ b/reference/inplace_vector/inplace_vector/at.md @@ -0,0 +1,72 @@ +# at +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr reference at(size_type n); // (1) C++26 +constexpr const_reference at(size_type n) const; // (2) C++26 +``` + +## 概要 +境界チェック付きの要素アクセス。 + +- (1) : 非`const`な文脈で任意の要素への参照を取得する。 +- (2) : `const`な文脈で任意の要素への読み取り専用参照を取得する。 + + +## 戻り値 +`n`番目の要素への参照を返す。 + + +## 例外 +`n >=` [`size()`](size.md)の場合、[`std::out_of_range`](/reference/stdexcept.md)例外を送出する。 + + +## 計算量 +定数時間 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::inplace_vector iv = {3, 1, 4}; + + int& x = iv.at(2); + std::println("{}", x); + + try { + iv.at(3); + } + catch (std::out_of_range& ex) { + std::println("out of range"); + } +} +``` +* at[color ff0000] +* std::out_of_range[link /reference/stdexcept.md] + +### 出力 +``` +4 +out of range +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/back.md b/reference/inplace_vector/inplace_vector/back.md new file mode 100644 index 0000000000..adf93231e4 --- /dev/null +++ b/reference/inplace_vector/inplace_vector/back.md @@ -0,0 +1,57 @@ +# back +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr reference back(); // (1) C++26 +constexpr const_reference back() const; // (2) C++26 +``` + +## 概要 +末尾要素への参照を取得する。 + +- (1) : 非`const`な文脈で末尾要素への参照を取得する。 +- (2) : `const`な文脈で末尾要素への読み取り専用参照を取得する。 + + +## 戻り値 +末尾要素への参照 + + +## 計算量 +定数時間 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::inplace_vector iv = {3, 1, 4}; + int& x = iv.back(); + std::println("{}", x); +} +``` +* back()[color ff0000] + +### 出力 +``` +4 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/begin.md b/reference/inplace_vector/inplace_vector/begin.md new file mode 100644 index 0000000000..eeb7dbb240 --- /dev/null +++ b/reference/inplace_vector/inplace_vector/begin.md @@ -0,0 +1,63 @@ +# begin +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr iterator begin() noexcept; // (1) C++26 +constexpr const_iterator begin() const noexcept; // (2) C++26 +``` + +## 概要 +先頭要素を指すイテレータを取得する。 + +- (1) : 非`const`な文脈で先頭要素を指すイテレータを取得する。 +- (2) : `const`な文脈で先頭要素を指す読み取り専用イテレータを取得する。 + + +## 戻り値 +非`const`な文脈では`iterator`型で先頭要素へのイテレータを返し、 +`const`な文脈では`const_iterator`型で先頭要素へのイテレータを返す。 + + +## 例外 +投げない + + +## 計算量 +定数時間 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::inplace_vector iv = {1, 2, 3}; + + decltype(iv)::iterator i = iv.begin(); + std::println("{}", *i); +} +``` +* begin()[color ff0000] + +### 出力 +``` +1 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/capacity.md b/reference/inplace_vector/inplace_vector/capacity.md new file mode 100644 index 0000000000..dc9d9a92c5 --- /dev/null +++ b/reference/inplace_vector/inplace_vector/capacity.md @@ -0,0 +1,63 @@ +# capacity +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +static constexpr size_type capacity() noexcept; // (1) C++26 +``` + +## 概要 +格納可能な最大の要素数を取得する。 + + +## 戻り値 +クラスのテンプレートパラメータ`N`を返す。 + + +## 例外 +投げない + + +## 計算量 +定数時間 + + +## 備考 +この関数は`static`メンバ関数であり、常にコンパイル時定数`N`を返す。[`std::vector`](/reference/vector/vector.md)の[`capacity()`](/reference/vector/vector/capacity.md)と異なり、`inplace_vector`の容量は構築後に変化しない。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::inplace_vector iv = {1, 2, 3}; + std::println("size: {}", iv.size()); + std::println("capacity: {}", iv.capacity()); +} +``` +* capacity()[color ff0000] +* iv.size()[link size.md] + +### 出力 +``` +size: 3 +capacity: 5 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/cbegin.md b/reference/inplace_vector/inplace_vector/cbegin.md new file mode 100644 index 0000000000..c2eeee530b --- /dev/null +++ b/reference/inplace_vector/inplace_vector/cbegin.md @@ -0,0 +1,59 @@ +# cbegin +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr const_iterator cbegin() const noexcept; // (1) C++26 +``` + +## 概要 +先頭要素を指す読み取り専用イテレータを取得する。 + + +## 戻り値 +`const_iterator`型で先頭要素へのイテレータを返す。 + + +## 例外 +投げない + + +## 計算量 +定数時間 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::inplace_vector iv = {1, 2, 3}; + + decltype(iv)::const_iterator i = iv.cbegin(); + std::println("{}", *i); +} +``` +* cbegin()[color ff0000] + +### 出力 +``` +1 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/cend.md b/reference/inplace_vector/inplace_vector/cend.md new file mode 100644 index 0000000000..106bb7d927 --- /dev/null +++ b/reference/inplace_vector/inplace_vector/cend.md @@ -0,0 +1,62 @@ +# cend +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr const_iterator cend() const noexcept; // (1) C++26 +``` + +## 概要 +末尾の次を指す読み取り専用イテレータを取得する。 + + +## 戻り値 +`const_iterator`型で末尾の次を指すイテレータを返す。 + + +## 例外 +投げない + + +## 計算量 +定数時間 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::inplace_vector iv = {1, 2, 3}; + + for (auto i = iv.cbegin(); i != iv.cend(); ++i) { + std::println("{}", *i); + } +} +``` +* cend()[color ff0000] +* iv.cbegin()[link cbegin.md] + +### 出力 +``` +1 +2 +3 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/clear.md b/reference/inplace_vector/inplace_vector/clear.md new file mode 100644 index 0000000000..6e6a92b363 --- /dev/null +++ b/reference/inplace_vector/inplace_vector/clear.md @@ -0,0 +1,62 @@ +# clear +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr void clear() noexcept; // (1) C++26 +``` + +## 概要 +全ての要素を削除する。 + + +## 事後条件 +[`empty()`](empty.md) `== true` + + +## 例外 +投げない + + +## 計算量 +線形時間 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::inplace_vector iv = {1, 2, 3}; + std::println("size before clear: {}", iv.size()); + + iv.clear(); + std::println("size after clear: {}", iv.size()); +} +``` +* clear()[color ff0000] +* iv.size()[link size.md] + +### 出力 +``` +size before clear: 3 +size after clear: 0 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/crbegin.md b/reference/inplace_vector/inplace_vector/crbegin.md new file mode 100644 index 0000000000..d5aba1eb78 --- /dev/null +++ b/reference/inplace_vector/inplace_vector/crbegin.md @@ -0,0 +1,58 @@ +# crbegin +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr const_reverse_iterator crbegin() const noexcept; // (1) C++26 +``` + +## 概要 +末尾を指す読み取り専用逆イテレータを取得する。 + + +## 戻り値 +`const_reverse_iterator`型で末尾を指す逆イテレータを返す。 + + +## 例外 +投げない + + +## 計算量 +定数時間 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::inplace_vector iv = {1, 2, 3}; + + decltype(iv)::const_reverse_iterator i = iv.crbegin(); + std::println("{}", *i); +} +``` +* crbegin()[color ff0000] + +### 出力 +``` +3 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/crend.md b/reference/inplace_vector/inplace_vector/crend.md new file mode 100644 index 0000000000..06c698c19b --- /dev/null +++ b/reference/inplace_vector/inplace_vector/crend.md @@ -0,0 +1,62 @@ +# crend +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr const_reverse_iterator crend() const noexcept; // (1) C++26 +``` + +## 概要 +先頭の前を指す読み取り専用逆イテレータを取得する。 + + +## 戻り値 +`const_reverse_iterator`型で先頭の前を指す逆イテレータを返す。 + + +## 例外 +投げない + + +## 計算量 +定数時間 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::inplace_vector iv = {1, 2, 3}; + + for (auto i = iv.crbegin(); i != iv.crend(); ++i) { + std::println("{}", *i); + } +} +``` +* crend()[color ff0000] +* iv.crbegin()[link crbegin.md] + +### 出力 +``` +3 +2 +1 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/data.md b/reference/inplace_vector/inplace_vector/data.md new file mode 100644 index 0000000000..d2c65440c7 --- /dev/null +++ b/reference/inplace_vector/inplace_vector/data.md @@ -0,0 +1,66 @@ +# data +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr T* data() noexcept; // (1) C++26 +constexpr const T* data() const noexcept; // (2) C++26 +``` + +## 概要 +配列の先頭へのポインタを返す。 + +- (1) : 非`const`な文脈で配列の先頭へのポインタを取得する。 +- (2) : `const`な文脈で配列の先頭への読み取り専用ポインタを取得する。 + + +## 戻り値 +内部に保持する配列の先頭要素へのポインタを返す。空の場合でも呼び出し自体は問題ないが、戻り値のポインタを間接参照してはならない。 + + +## 例外 +投げない + + +## 計算量 +定数時間 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::inplace_vector iv = {3, 1, 4}; + + int* p = iv.data(); + std::println("{}", *p); + + ++p; + std::println("{}", *p); +} +``` +* data()[color ff0000] + +### 出力 +``` +3 +1 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/emplace.md b/reference/inplace_vector/inplace_vector/emplace.md new file mode 100644 index 0000000000..1d55fecf0c --- /dev/null +++ b/reference/inplace_vector/inplace_vector/emplace.md @@ -0,0 +1,73 @@ +# emplace +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +constexpr iterator emplace(const_iterator position, Args&&... args); // (1) C++26 +``` + +## 概要 +任意の位置に要素を直接構築で挿入する。 + +引数`args...`から直接構築した要素を`position`の前に挿入する。 + + +## 戻り値 +挿入された要素を指すイテレータ。 + + +## 例外 +[`size()`](size.md) `== N`の場合、[`bad_alloc`](/reference/new/bad_alloc.md)例外を送出する。 + + +## 計算量 +挿入位置から[`end()`](end.md)までの要素数に対して線形時間。 + + +## 例 +```cpp example +#include +#include +#include +#include + +int main() +{ + std::inplace_vector, 5> iv; + + iv.emplace(iv.begin(), 1, "one"); + iv.emplace(iv.end(), 3, "three"); + iv.emplace(iv.begin() + 1, 2, "two"); + + for (const auto& [k, val] : iv) { + std::println("{}:{}", k, val); + } +} +``` +* emplace[color ff0000] +* iv.begin()[link begin.md] +* iv.end()[link end.md] + +### 出力 +``` +1:one +2:two +3:three +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/emplace_back.md b/reference/inplace_vector/inplace_vector/emplace_back.md new file mode 100644 index 0000000000..a46ea0f20b --- /dev/null +++ b/reference/inplace_vector/inplace_vector/emplace_back.md @@ -0,0 +1,69 @@ +# emplace_back +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +constexpr reference emplace_back(Args&&... args); // (1) C++26 +``` + +## 概要 +直接構築で新たな要素を末尾に追加する。 + +引数`args...`から直接構築して要素を末尾に追加する。 + + +## 戻り値 +構築した要素への参照。 + + +## 例外 +[`size()`](size.md) `== N`の場合、[`std::bad_alloc`](/reference/new/bad_alloc.md)例外を送出する。 + + +## 計算量 +定数時間 + + +## 例 +```cpp example +#include +#include +#include +#include + +int main() +{ + std::inplace_vector, 5> iv; + + iv.emplace_back(1, "one"); + iv.emplace_back(2, "two"); + + for (const auto& [k, val] : iv) { + std::println("{}:{}", k, val); + } +} +``` +* emplace_back[color ff0000] + +### 出力 +``` +1:one +2:two +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/empty.md b/reference/inplace_vector/inplace_vector/empty.md new file mode 100644 index 0000000000..14c769ba56 --- /dev/null +++ b/reference/inplace_vector/inplace_vector/empty.md @@ -0,0 +1,62 @@ +# empty +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr bool empty() const noexcept; // (1) C++26 +``` + +## 概要 +コンテナが空かどうかを判定する。 + + +## 戻り値 +コンテナが空であれば`true`、そうでなければ`false`を返す。 + + +## 例外 +投げない + + +## 計算量 +定数時間 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::inplace_vector iv; + std::println("{}", iv.empty()); + + iv.push_back(1); + std::println("{}", iv.empty()); +} +``` +* empty()[color ff0000] +* iv.push_back[link push_back.md] + +### 出力 +``` +true +false +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/end.md b/reference/inplace_vector/inplace_vector/end.md new file mode 100644 index 0000000000..4718f95177 --- /dev/null +++ b/reference/inplace_vector/inplace_vector/end.md @@ -0,0 +1,68 @@ +# end +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr iterator end() noexcept; // (1) C++26 +constexpr const_iterator end() const noexcept; // (2) C++26 +``` + +## 概要 +末尾の次を指すイテレータを取得する。 + +- (1) : 非`const`な文脈で末尾の次を指すイテレータを取得する。 +- (2) : `const`な文脈で末尾の次を指す読み取り専用イテレータを取得する。 + + +## 戻り値 +非`const`な文脈では`iterator`型で末尾の次を指すイテレータを返し、 +`const`な文脈では`const_iterator`型で末尾の次を指すイテレータを返す。 + + +## 例外 +投げない + + +## 計算量 +定数時間 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::inplace_vector iv = {1, 2, 3}; + + for (auto i = iv.begin(); i != iv.end(); ++i) { + std::println("{}", *i); + } +} +``` +* end()[color ff0000] +* iv.begin()[link begin.md] + +### 出力 +``` +1 +2 +3 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/erase.md b/reference/inplace_vector/inplace_vector/erase.md new file mode 100644 index 0000000000..800dd32c10 --- /dev/null +++ b/reference/inplace_vector/inplace_vector/erase.md @@ -0,0 +1,73 @@ +# erase +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr iterator erase(const_iterator position); // (1) C++26 +constexpr iterator erase(const_iterator first, const_iterator last); // (2) C++26 +``` + +## 概要 +指定した要素を削除する。 + +- (1) : `position`が指す要素を削除する。 +- (2) : イテレータ範囲`[first, last)`の要素を削除する。 + + +## 戻り値 +削除された要素の次の要素を指すイテレータ。そのような要素が存在しない場合は[`end()`](end.md)を返す。 + + +## 計算量 +削除される要素の数と削除位置から[`end()`](end.md)までの要素数に対して線形時間。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + // (1) 単一要素の削除 + { + std::inplace_vector iv = {1, 2, 3, 4, 5}; + iv.erase(iv.begin() + 2); // 3を削除 + + for (int x : iv) std::print("{} ", x); + std::println(""); + } + + // (2) 範囲の削除 + { + std::inplace_vector iv = {1, 2, 3, 4, 5}; + iv.erase(iv.begin() + 1, iv.begin() + 3); // 2, 3を削除 + + for (int x : iv) std::print("{} ", x); + std::println(""); + } +} +``` +* erase[color ff0000] +* iv.begin()[link begin.md] + +### 出力 +``` +1 2 4 5 +1 4 5 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/erase_free.md b/reference/inplace_vector/inplace_vector/erase_free.md new file mode 100644 index 0000000000..d5da07c27f --- /dev/null +++ b/reference/inplace_vector/inplace_vector/erase_free.md @@ -0,0 +1,76 @@ +# erase (非メンバ関数) +* inplace_vector[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + constexpr typename inplace_vector::size_type + erase(inplace_vector& c, const U& value); // (1) C++26 +} +``` + +## 概要 +指定した値をもつ要素とその分の領域を、コンテナから削除する。 + + +## 効果 +以下と等価: + +```cpp +auto it = std::remove(c.begin(), c.end(), value); +auto r = std::distance(it, c.end()); +c.erase(it, c.end()); +return r; +``` +* std::remove[link /reference/algorithm/remove.md] +* std::distance[link /reference/iterator/distance.md] +* distance[link /reference/iterator/distance.md] +* c.erase[link erase.md] +* c.begin()[link begin.md] +* c.end()[link end.md] + + +## 戻り値 +削除した要素数を返す。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::inplace_vector iv = {3, 1, 4, 1, 5}; + + std::erase(iv, 1); + + for (int x : iv) { + std::println("{}", x); + } +} +``` +* std::erase[color ff0000] + +### 出力 +``` +3 +4 +5 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/erase_if_free.md b/reference/inplace_vector/inplace_vector/erase_if_free.md new file mode 100644 index 0000000000..4c5cf08b78 --- /dev/null +++ b/reference/inplace_vector/inplace_vector/erase_if_free.md @@ -0,0 +1,74 @@ +# erase_if (非メンバ関数) +* inplace_vector[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + constexpr typename inplace_vector::size_type + erase_if(inplace_vector& c, Predicate pred); // (1) C++26 +} +``` + +## 概要 +指定した条件に合致する要素とその分の領域を、コンテナから削除する。 + + +## 効果 +以下と等価: + +```cpp +auto it = std::remove_if(c.begin(), c.end(), pred); +auto r = std::distance(it, c.end()); +c.erase(it, c.end()); +return r; +``` +* std::remove_if[link /reference/algorithm/remove_if.md] +* std::distance[link /reference/iterator/distance.md] +* c.erase[link erase.md] +* c.begin()[link begin.md] +* c.end()[link end.md] + + +## 戻り値 +削除した要素数を返す。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::inplace_vector iv = {3, 1, 4, 1, 5}; + + std::erase_if(iv, [](int x) { return x < 3; }); + + for (int x : iv) { + std::println("{}", x); + } +} +``` +* std::erase_if[color ff0000] + +### 出力 +``` +3 +4 +5 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/front.md b/reference/inplace_vector/inplace_vector/front.md new file mode 100644 index 0000000000..bd49db3c58 --- /dev/null +++ b/reference/inplace_vector/inplace_vector/front.md @@ -0,0 +1,57 @@ +# front +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr reference front(); // (1) C++26 +constexpr const_reference front() const; // (2) C++26 +``` + +## 概要 +先頭要素への参照を取得する。 + +- (1) : 非`const`な文脈で先頭要素への参照を取得する。 +- (2) : `const`な文脈で先頭要素への読み取り専用参照を取得する。 + + +## 戻り値 +先頭要素への参照 + + +## 計算量 +定数時間 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::inplace_vector iv = {3, 1, 4}; + int& x = iv.front(); + std::println("{}", x); +} +``` +* front()[color ff0000] + +### 出力 +``` +3 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/insert.md b/reference/inplace_vector/inplace_vector/insert.md new file mode 100644 index 0000000000..2b013f0989 --- /dev/null +++ b/reference/inplace_vector/inplace_vector/insert.md @@ -0,0 +1,104 @@ +# insert +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr iterator + insert(const_iterator position, + const T& x); // (1) C++26 + +constexpr iterator + insert(const_iterator position, + T&& x); // (2) C++26 + +constexpr iterator + insert(const_iterator position, + size_type n, + const T& x); // (3) C++26 + +template +constexpr iterator + insert(const_iterator position, + InputIterator first, + InputIterator last); // (4) C++26 + +constexpr iterator insert(const_iterator position, initializer_list il); // (5) C++26 +``` +* initializer_list[link /reference/initializer_list/initializer_list.md] + +## 概要 +任意の位置に新たな要素を挿入する。 + +- (1) : `position`の前に`x`のコピーを挿入する。 +- (2) : `position`の前に`x`をムーブ挿入する。 +- (3) : `position`の前に`n`個の`x`のコピーを挿入する。 +- (4) : `position`の前にイテレータ範囲`[first, last)`の要素を挿入する。 +- (5) : `position`の前に初期化子リスト`il`の要素を挿入する。 + + +## 戻り値 +挿入された要素を指すイテレータ。(3), (4), (5)では挿入された最初の要素を指すイテレータ。要素が挿入されなかった場合は`position`を指すイテレータ。 + + +## 例外 +挿入後のサイズが`N`を超える場合、[`bad_alloc`](/reference/new/bad_alloc.md)例外を送出する。 + + +## 計算量 +挿入される要素の数と挿入位置から[`end()`](end.md)までの要素数に対して線形時間。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::inplace_vector iv = {1, 2, 3}; + + // (1) 先頭にコピー挿入 + iv.insert(iv.begin(), 0); + + // (3) 末尾に2個の9を挿入 + iv.insert(iv.end(), 2, 9); + + // (5) 初期化子リストで挿入 + iv.insert(iv.begin() + 2, {10, 20}); + + for (int x : iv) { + std::println("{} ", x); + } +} +``` +* insert[color ff0000] +* iv.begin()[link begin.md] +* iv.end()[link end.md] + +### 出力 +``` +0 +1 +10 +20 +2 +3 +9 +9 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/insert_range.md b/reference/inplace_vector/inplace_vector/insert_range.md new file mode 100644 index 0000000000..697f569143 --- /dev/null +++ b/reference/inplace_vector/inplace_vector/insert_range.md @@ -0,0 +1,72 @@ +# insert_range +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template R> +constexpr iterator insert_range(const_iterator position, R&& rg); // (1) C++26 +``` + +## 概要 +Rangeの要素を任意の位置に挿入する。 + +Range `rg`の要素を`position`の前に挿入する。 + + +## 戻り値 +挿入された最初の要素を指すイテレータ。`rg`が空の場合は`position`を指すイテレータ。 + + +## 例外 +挿入後のサイズが`N`を超える場合、[`bad_alloc`](/reference/new/bad_alloc.md)例外を送出する。 + + +## 計算量 +挿入される要素の数と挿入位置から[`end()`](end.md)までの要素数に対して線形時間。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::inplace_vector iv = {1, 2, 5, 6}; + + std::vector src = {3, 4}; + iv.insert_range(iv.begin() + 2, src); + + for (int x : iv) { + std::println("{}", x); + } +} +``` +* insert_range[color ff0000] +* iv.begin()[link begin.md] + +### 出力 +``` +1 +2 +3 +4 +5 +6 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/max_size.md b/reference/inplace_vector/inplace_vector/max_size.md new file mode 100644 index 0000000000..e7eb3be0e0 --- /dev/null +++ b/reference/inplace_vector/inplace_vector/max_size.md @@ -0,0 +1,60 @@ +# max_size +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +static constexpr size_type max_size() noexcept; // (1) C++26 +``` + +## 概要 +格納可能な最大の要素数を取得する。 + + +## 戻り値 +テンプレートパラメータ`N`を返す。 + + +## 例外 +投げない + + +## 計算量 +定数時間 + + +## 備考 +この関数は`static`メンバ関数である。[`capacity()`](capacity.md)と同じ値を返す。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::inplace_vector iv; + std::println("{}", iv.max_size()); +} +``` +* max_size()[color ff0000] + +### 出力 +``` +5 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/op_assign.md b/reference/inplace_vector/inplace_vector/op_assign.md new file mode 100644 index 0000000000..8021f76948 --- /dev/null +++ b/reference/inplace_vector/inplace_vector/op_assign.md @@ -0,0 +1,95 @@ +# operator= +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr inplace_vector& operator=(const inplace_vector& other); // (1) C++26 + +constexpr inplace_vector& operator=(inplace_vector&& other) + noexcept(N == 0 || (is_nothrow_move_assignable_v && + is_nothrow_move_constructible_v)); // (2) C++26 + +constexpr inplace_vector& operator=(initializer_list il); // (3) C++26 +``` +* initializer_list[link /reference/initializer_list/initializer_list.md] + +## 概要 +- (1) : コピー代入 +- (2) : ムーブ代入 +- (3) : 初期化子リストの代入 + + +## 効果 +- (1) : `other`の全ての要素を`*this`にコピーする。`*this`の既存の要素は破棄される。 +- (2) : `other`の全ての要素を`*this`にムーブする。`*this`の既存の要素は破棄される。 +- (3) : 初期化子リスト`il`の全ての要素を`*this`にコピーする。`*this`の既存の要素は破棄される。 + + +## 例外 +- (3) : `il`の要素数が`N`を超える場合、[`bad_alloc`](/reference/new/bad_alloc.md)例外を送出する。 + + +## 戻り値 +`*this` + + +## 計算量 +- (1) : 全要素のデストラクタ呼び出しとコピーを行うために、線形時間 +- (2) : 全要素のデストラクタ呼び出しとムーブを行うために、線形時間 +- (3) : 全要素のデストラクタ呼び出しとコピーを行うために、線形時間 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + // コピー代入 + { + std::inplace_vector v1 = {1, 2, 3}; + std::inplace_vector v2; + v2 = v1; + assert(v1 == v2); + } + + // ムーブ代入 + { + std::inplace_vector v1 = {1, 2, 3}; + std::inplace_vector v2; + auto v1_copy = v1; + v2 = std::move(v1); + assert(v2 == v1_copy); + } + + // 初期化子リストからのコピー代入 + { + std::inplace_vector iv; + iv = {1, 2, 3}; + assert(iv.size() == 3); + } +} +``` +* std::move[link /reference/utility/move.md] +* iv.size()[link size.md] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/op_at.md b/reference/inplace_vector/inplace_vector/op_at.md new file mode 100644 index 0000000000..cb867e3a5d --- /dev/null +++ b/reference/inplace_vector/inplace_vector/op_at.md @@ -0,0 +1,61 @@ +# operator[] +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr reference operator[](size_type n); // (1) C++26 +constexpr const_reference operator[](size_type n) const; // (2) C++26 +``` + +## 概要 +要素アクセス。 + +- (1) : 非`const`な文脈で任意の要素への参照を取得する。 +- (2) : `const`な文脈で任意の要素への読み取り専用参照を取得する。 + + +## 戻り値 +`n`番目の要素への参照を返す。 + + +## 計算量 +定数時間 + + +## 備考 +- `n >=` [`size()`](size.md)の場合、未定義動作を引き起こす。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::inplace_vector iv = {3, 1, 4}; + int& x = iv[2]; + std::println("{}", x); +} +``` + +### 出力 +``` +4 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/op_compare_3way.md b/reference/inplace_vector/inplace_vector/op_compare_3way.md new file mode 100644 index 0000000000..76b4b53af2 --- /dev/null +++ b/reference/inplace_vector/inplace_vector/op_compare_3way.md @@ -0,0 +1,90 @@ +# operator<=> +* inplace_vector[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + constexpr synth-three-way-result + operator<=>(const inplace_vector& x, + const inplace_vector& y); // (1) C++26 +} +``` + +## 概要 +`inplace_vector`オブジェクトの三方比較を行う。 + + +## テンプレートパラメータ制約 +型 (`const`) `T`の値に対して`operator<=>`が定義されるか、型 (`const`) `T`の値に対して`operator<`が定義され全順序をもつこと + + +## 効果 +```cpp +return std::lexicographical_compare_three_way( + x.begin(), x.end(), + y.begin(), y.end(), + synth-three-way); +``` +* std::lexicographical_compare_three_way[link /reference/algorithm/lexicographical_compare_three_way.md] +* begin()[link begin.md] +* end()[link end.md] + + +## 計算量 +線形時間 + + +## 備考 +- この演算子により、以下の演算子が使用可能になる: + - `operator<` + - `operator<=` + - `operator>` + - `operator>=` + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::inplace_vector iv1 = {1, 2, 3}; + std::inplace_vector iv2 = {1, 2, 3}; + std::inplace_vector iv3 = {1, 2, 4}; + + // 三方比較 + assert((iv1 <=> iv2) == 0); + assert((iv1 <=> iv3) < 0); + + // operator<=>から自動導出される比較演算子 + std::println("{}", iv1 < iv3); // true: {1,2,3} < {1,2,4} + std::println("{}", iv1 <= iv2); // true: {1,2,3} <= {1,2,3} + std::println("{}", iv3 > iv1); // true: {1,2,4} > {1,2,3} + std::println("{}", iv1 >= iv2); // true: {1,2,3} >= {1,2,3} +} +``` + +### 出力 +``` +true +true +true +true +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/op_constructor.md b/reference/inplace_vector/inplace_vector/op_constructor.md new file mode 100644 index 0000000000..56a16af376 --- /dev/null +++ b/reference/inplace_vector/inplace_vector/op_constructor.md @@ -0,0 +1,132 @@ +# コンストラクタ +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr inplace_vector() noexcept; // (1) C++26 + +constexpr explicit inplace_vector(size_type n); // (2) C++26 + +constexpr inplace_vector(size_type n, const T& value); // (3) C++26 + +template +constexpr inplace_vector(InputIterator first, InputIterator last); // (4) C++26 + +template R> +constexpr inplace_vector(from_range_t, R&& rg); // (5) C++26 + +constexpr inplace_vector(const inplace_vector& other); // (6) C++26 + +constexpr inplace_vector(inplace_vector&& other) + noexcept(N == 0 || is_nothrow_move_constructible_v); // (7) C++26 + +constexpr inplace_vector(initializer_list il); // (8) C++26 +``` +* from_range_t[link /reference/ranges/from_range_t.md] +* initializer_list[link /reference/initializer_list/initializer_list.md] + +## 概要 +`inplace_vector`オブジェクトを次に示す通りの要素で初期化する。 + +- (1) : デフォルトコンストラクタ。空の`inplace_vector`を構築する。 +- (2) : `n`個の値初期化された要素で構築する。 +- (3) : `n`個の`value`のコピーで構築する。 +- (4) : イテレータ範囲`[first, last)`の要素で構築する。 +- (5) : Range`rg`の要素で構築する。 +- (6) : コピーコンストラクタ。 +- (7) : ムーブコンストラクタ。 +- (8) : 初期化子リストの要素で構築する。 + + +## 効果 + +- (1) : デフォルトコンストラクタ。要素を持たない空の`inplace_vector`オブジェクトを構築する。 +- (2) : `n`個の`T()`で値初期化された要素を保持した`inplace_vector`オブジェクトを構築する。 +- (3) : `value`のコピーを`n`個要素として保持した`inplace_vector`オブジェクトを構築する。 +- (4) : イテレータ範囲`[first, last)`の要素をコピーした`inplace_vector`オブジェクトを構築する。 +- (5) : Range `rg`の要素から`inplace_vector`オブジェクトを構築する。 +- (6) : コピーコンストラクタ。`other`と同じ要素を保持した`inplace_vector`オブジェクトを構築する。 +- (7) : ムーブコンストラクタ。`other`の各要素をムーブして`inplace_vector`オブジェクトを構築する。 +- (8) : 初期化子リストの要素から`inplace_vector`オブジェクトを構築する。 + + +## 例外 +- (1) : 投げない +- (2), (3), (4), (5), (8) : 要素数が`N`を超える場合、[`bad_alloc`](/reference/new/bad_alloc.md)例外を送出する。 + + +## 計算量 +- (1) : 定数時間 +- (2), (3) : `n`に対して線形時間 +- (4) : [`distance`](/reference/iterator/distance.md)`(first, last)`に対して線形時間 +- (5) : [`ranges::distance`](/reference/iterator/ranges_distance.md)`(rg)`に対して線形時間 +- (6) : `other.`[`size()`](size.md)に対して線形時間 +- (7) : `other.`[`size()`](size.md)に対して線形時間 +- (8) : `il.`[`size()`](/reference/initializer_list/initializer_list/size.md)に対して線形時間 + + +## 備考 +- ムーブコンストラクタ(7)は、[`vector`](/reference/vector/vector.md)の定数時間のムーブとは異なり、各要素を個別にムーブするため線形時間である。これは`inplace_vector`の内部配列が動的確保メモリを使用していないためである。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::inplace_vector first; + std::inplace_vector second(4, 100); + std::inplace_vector third(second.begin(), second.end()); + std::inplace_vector fourth(third); + std::inplace_vector fifth = {1, 2, 3}; + + std::print("first: "); + for (int x : first) std::print("{} ", x); + std::println(""); + + std::print("second: "); + for (int x : second) std::print("{} ", x); + std::println(""); + + std::print("third: "); + for (int x : third) std::print("{} ", x); + std::println(""); + + std::print("fourth: "); + for (int x : fourth) std::print("{} ", x); + std::println(""); + + std::print("fifth: "); + for (int x : fifth) std::print("{} ", x); + std::println(""); +} +``` + +### 出力 +``` +first: +second: 100 100 100 100 +third: 100 100 100 100 +fourth: 100 100 100 100 +fifth: 1 2 3 +``` + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/op_destructor.md b/reference/inplace_vector/inplace_vector/op_destructor.md new file mode 100644 index 0000000000..28c945afe5 --- /dev/null +++ b/reference/inplace_vector/inplace_vector/op_destructor.md @@ -0,0 +1,27 @@ +# デストラクタ +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr ~inplace_vector(); // (1) C++26 +``` + +## 概要 +`inplace_vector`が保持している全ての要素に対してデストラクタを実行する。[`vector`](/reference/vector/vector.md)と異なり、動的メモリの解放は行わない。 + + +## 例外 +投げない + + +## 計算量 +全要素のデストラクタを呼び出すために線形時間。 + +[`std::is_trivially_destructible_v`](/reference/type_traits/is_trivially_destructible.md)が`true`の場合、定数時間となりうる。 + + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/op_equal.md b/reference/inplace_vector/inplace_vector/op_equal.md new file mode 100644 index 0000000000..05eae0a7d5 --- /dev/null +++ b/reference/inplace_vector/inplace_vector/op_equal.md @@ -0,0 +1,75 @@ +# operator== +* inplace_vector[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + constexpr bool operator==(const inplace_vector& x, + const inplace_vector& y); // (1) C++26 +} +``` + +## 概要 +`inplace_vector`オブジェクトの等値比較を行う。 + + +## 要件 +型`T`が`==`で比較可能であること。 + + +## 戻り値 +`x`と`y`の要素数および要素の値が等しければ`true`、そうでなければ`false`を返す。 + + +## 計算量 +線形時間。ただし、`x`と`y`のサイズが異なる場合は定数時間。 + + +## 備考 +- この演算子により、以下の演算子が使用可能になる: + - `operator!=` + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::inplace_vector v1 = {1, 2, 3}; + std::inplace_vector v2 = {1, 2, 3}; + std::inplace_vector v3 = {1, 2, 4}; + + // operator== + std::println("{}", (v1 == v2)); + std::println("{}", (v1 == v3)); + + // operator==から自動導出されるoperator!= + std::println("{}", (v1 != v2)); + std::println("{}", (v1 != v3)); +} +``` + +### 出力 +``` +true +false +false +true +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/pop_back.md b/reference/inplace_vector/inplace_vector/pop_back.md new file mode 100644 index 0000000000..e5e2cf1f06 --- /dev/null +++ b/reference/inplace_vector/inplace_vector/pop_back.md @@ -0,0 +1,72 @@ +# pop_back +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr void pop_back(); // (1) C++26 +``` + +## 概要 +末尾要素を削除する。 + + +## 事前条件 +[`empty()`](empty.md) `== false` + + +## 効果 +末尾の要素を削除する。 + + +## 例外 +投げない + + +## 戻り値 +なし + + +## 計算量 +定数時間 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::inplace_vector iv = {1, 2, 3}; + + iv.pop_back(); + + for (int x : iv) std::print("{} ", x); + std::println(""); + + std::println("size: {}", iv.size()); +} +``` +* pop_back()[color ff0000] +* iv.size()[link size.md] + +### 出力 +``` +1 2 +size: 2 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/push_back.md b/reference/inplace_vector/inplace_vector/push_back.md new file mode 100644 index 0000000000..f0c1fd6f5b --- /dev/null +++ b/reference/inplace_vector/inplace_vector/push_back.md @@ -0,0 +1,77 @@ +# push_back +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr reference push_back(const T& x); // (1) C++26 +constexpr reference push_back(T&& x); // (2) C++26 +``` + +## 概要 +新たな要素を末尾に追加する。 + +- (1) : `x`をコピーして末尾に追加する。 +- (2) : `x`をムーブして末尾に追加する。 + + +## 戻り値 +追加された要素への参照。 + + +## 例外 +[`size()`](size.md) `== N`の場合、[`std::bad_alloc`](/reference/new/bad_alloc.md)例外を送出する。 + + +## 計算量 +定数時間 + + +## 備考 +- [`std::vector`](/reference/vector/vector.md)の[`push_back()`](/reference/vector/vector/push_back.md)が`void`を返すのとは異なり、`inplace_vector`では追加された要素への参照を返す。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::inplace_vector iv; + + // (1) コピーで追加 + std::string s = "hello"; + iv.push_back(s); + + // (2) ムーブで追加 + iv.push_back("world"); + + for (const auto& x : iv) { + std::println("{}", x); + } +} +``` +* push_back[color ff0000] + +### 出力 +``` +hello +world +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/rbegin.md b/reference/inplace_vector/inplace_vector/rbegin.md new file mode 100644 index 0000000000..7dbd4a12e3 --- /dev/null +++ b/reference/inplace_vector/inplace_vector/rbegin.md @@ -0,0 +1,63 @@ +# rbegin +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr reverse_iterator rbegin() noexcept; // (1) C++26 +constexpr const_reverse_iterator rbegin() const noexcept; // (2) C++26 +``` + +## 概要 +末尾を指す逆イテレータを取得する。 + +- (1) : 非`const`な文脈で末尾を指す逆イテレータを取得する。 +- (2) : `const`な文脈で末尾を指す読み取り専用逆イテレータを取得する。 + + +## 戻り値 +非`const`な文脈では`reverse_iterator`型で末尾を指す逆イテレータを返し、 +`const`な文脈では`const_reverse_iterator`型で末尾を指す逆イテレータを返す。 + + +## 例外 +投げない + + +## 計算量 +定数時間 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::inplace_vector iv = {1, 2, 3}; + + decltype(iv)::reverse_iterator i = iv.rbegin(); + std::println("{}", *i); +} +``` +* rbegin()[color ff0000] + +### 出力 +``` +3 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/rend.md b/reference/inplace_vector/inplace_vector/rend.md new file mode 100644 index 0000000000..64f5895263 --- /dev/null +++ b/reference/inplace_vector/inplace_vector/rend.md @@ -0,0 +1,68 @@ +# rend +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr reverse_iterator rend() noexcept; // (1) C++26 +constexpr const_reverse_iterator rend() const noexcept; // (2) C++26 +``` + +## 概要 +先頭の前を指す逆イテレータを取得する。 + +- (1) : 非`const`な文脈で先頭の前を指す逆イテレータを取得する。 +- (2) : `const`な文脈で先頭の前を指す読み取り専用逆イテレータを取得する。 + + +## 戻り値 +非`const`な文脈では`reverse_iterator`型で先頭の前を指す逆イテレータを返し、 +`const`な文脈では`const_reverse_iterator`型で先頭の前を指す逆イテレータを返す。 + + +## 例外 +投げない + + +## 計算量 +定数時間 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::inplace_vector iv = {1, 2, 3}; + + for (auto i = iv.rbegin(); i != iv.rend(); ++i) { + std::println("{}", *i); + } +} +``` +* rend()[color ff0000] +* iv.rbegin()[link rbegin.md] + +### 出力 +``` +3 +2 +1 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/reserve.md b/reference/inplace_vector/inplace_vector/reserve.md new file mode 100644 index 0000000000..d2345b9db1 --- /dev/null +++ b/reference/inplace_vector/inplace_vector/reserve.md @@ -0,0 +1,72 @@ +# reserve +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +static constexpr void reserve(size_type n); // (1) C++26 +``` + +## 概要 +容量を確認する。`inplace_vector`の容量は固定であるため、この関数は容量の変更を行わない。`n`が`N`以下であれば何もせず、`n`が`N`を超える場合は例外を送出する。 + +この関数は、[`std::vector`](/reference/vector/vector.md)`::`[`reserve()`](/reference/vector/vector/reserve.md)との互換性のために提供されている。 + + +## 例外 +`n > N`の場合、[`std::bad_alloc`](/reference/new/bad_alloc.md)例外を送出する。 + + +## 戻り値 +なし + + +## 計算量 +定数時間 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::inplace_vector iv; + + // 容量内なので何も起きない + iv.reserve(3); + std::println("reserve(3): OK"); + + // 容量超過で例外 + try { + iv.reserve(10); + } + catch (const std::bad_alloc&) { + std::println("reserve(10): bad_alloc"); + } +} +``` +* reserve[color ff0000] +* std::bad_alloc[link /reference/new/bad_alloc.md] + +### 出力 +``` +reserve(3): OK +reserve(10): bad_alloc +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/resize.md b/reference/inplace_vector/inplace_vector/resize.md new file mode 100644 index 0000000000..364a54d4cc --- /dev/null +++ b/reference/inplace_vector/inplace_vector/resize.md @@ -0,0 +1,78 @@ +# resize +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr void resize(size_type sz); // (1) C++26 +constexpr void resize(size_type sz, const T& c); // (2) C++26 +``` + +## 概要 +要素数を変更する。 + +- (1) : 要素数を`sz`に変更する。増加分は値初期化される。 +- (2) : 要素数を`sz`に変更する。増加分は`c`のコピーで初期化される。 + + +## 効果 +- `sz`が現在の[`size()`](size.md)より小さい場合、後ろから[`size()`](size.md) `- sz`個の要素を削除する。 +- `sz`が現在の[`size()`](size.md)より大きい場合: + - (1) : `sz -` [`size()`](size.md)個の値初期化された要素を追加する。 + - (2) : `sz -` [`size()`](size.md)個の`c`のコピーを追加する。 + + +## 例外 +`sz > N`の場合、[`std::bad_alloc`](/reference/new/bad_alloc.md)例外を送出する。 + + +## 戻り値 +なし + + +## 例 +```cpp example +#include +#include + +int main() +{ + // 増加 + { + std::inplace_vector iv = {3, 1, 4}; + iv.resize(5); + for (int x : iv) std::print("{} ", x); + std::println(""); + } + + // 減少 + { + std::inplace_vector iv = {3, 1, 4}; + iv.resize(1); + for (int x : iv) std::print("{} ", x); + std::println(""); + } +} +``` +* resize[color ff0000] + +### 出力 +``` +3 1 4 0 0 +3 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/shrink_to_fit.md b/reference/inplace_vector/inplace_vector/shrink_to_fit.md new file mode 100644 index 0000000000..18ac464a4c --- /dev/null +++ b/reference/inplace_vector/inplace_vector/shrink_to_fit.md @@ -0,0 +1,31 @@ +# shrink_to_fit +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +static constexpr void shrink_to_fit(); // (1) C++26 +``` + +## 概要 +なにもしない。`inplace_vector`の容量は固定であるため、この関数は何の効果も持たない。 + +[`std::vector::shrink_to_fit()`](/reference/vector/vector/shrink_to_fit.md)との互換性のために提供されている。 + + +## 効果 +なし + + +## 戻り値 +なし + + +## 計算量 +定数時間 + + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/size.md b/reference/inplace_vector/inplace_vector/size.md new file mode 100644 index 0000000000..1ce476aabc --- /dev/null +++ b/reference/inplace_vector/inplace_vector/size.md @@ -0,0 +1,56 @@ +# size +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr size_type size() const noexcept; // (1) C++26 +``` + +## 概要 +コンテナの要素数を取得する。 + + +## 戻り値 +現在`inplace_vector`オブジェクトに含まれている要素数を返す。 + + +## 例外 +投げない + + +## 計算量 +定数時間 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::inplace_vector iv = {3, 1, 4, 5, 2}; + std::println("{}", iv.size()); +} +``` +* size()[color ff0000] + +### 出力 +``` +5 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/swap.md b/reference/inplace_vector/inplace_vector/swap.md new file mode 100644 index 0000000000..3228078771 --- /dev/null +++ b/reference/inplace_vector/inplace_vector/swap.md @@ -0,0 +1,75 @@ +# swap +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr void swap(inplace_vector& x) + noexcept(N == 0 || (is_nothrow_swappable_v && + is_nothrow_move_constructible_v)); // (1) C++26 +``` + +## 概要 +他の`inplace_vector`オブジェクトとデータを入れ替える。 + + +## 効果 +`*this`と`x`の要素を入れ替える。 + + +## 例外 +`N == 0`、もしくは要素型`T`がnothrowでswap可能かつnothrowでムーブ構築可能な場合は、例外を投げない。 + + +## 計算量 +[`size()`](size.md)と`x.`[`size()`](size.md)の大きいほうに対して線形時間。 + +[`std::vector`](/reference/vector/vector.md)の[`swap()`](/reference/vector/vector/swap.md)が定数時間であるのとは異なり、`inplace_vector`では要素の交換が必要なため線形時間となる。 + + +## 備考 +swapにより全てのイテレータが無効化される。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::inplace_vector v1 = {1, 2, 3}; + std::inplace_vector v2 = {4, 5}; + + v1.swap(v2); + + std::print("v1:"); + for (int x : v1) std::print(" {}", x); + std::println(""); + + std::print("v2:"); + for (int x : v2) std::print(" {}", x); + std::println(""); +} +``` +* swap[color ff0000] + +### 出力 +``` +v1: 4 5 +v2: 1 2 3 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/swap_free.md b/reference/inplace_vector/inplace_vector/swap_free.md new file mode 100644 index 0000000000..0096fc6406 --- /dev/null +++ b/reference/inplace_vector/inplace_vector/swap_free.md @@ -0,0 +1,67 @@ +# swap (非メンバ関数) +* inplace_vector[meta header] +* std[meta namespace] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +namespace std { + template + constexpr void swap(inplace_vector& x, inplace_vector& y) + noexcept(noexcept(x.swap(y))); // (1) C++26 +} +``` + +## 概要 +2つの`inplace_vector`オブジェクトを入れ替える。 + + +## 効果 +`x.`[`swap`](swap.md)`(y)` + + +## 戻り値 +なし + + +## 計算量 +`x.size()`と`y.size()`の大きいほうに対して線形時間 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::inplace_vector v1 = {1, 2, 3}; + std::inplace_vector v2 = {4, 5, 6}; + + std::swap(v1, v2); + + for (int x : v1) std::print("{} ", x); + std::println(""); + for (int x : v2) std::print("{} ", x); + std::println(""); +} +``` +* std::swap[color ff0000] + +### 出力 +``` +4 5 6 +1 2 3 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/try_append_range.md b/reference/inplace_vector/inplace_vector/try_append_range.md new file mode 100644 index 0000000000..7a9997e625 --- /dev/null +++ b/reference/inplace_vector/inplace_vector/try_append_range.md @@ -0,0 +1,70 @@ +# try_append_range +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template R> +constexpr ranges::borrowed_iterator_t try_append_range(R&& rg); // (1) C++26 +``` + +## 概要 +Rangeの要素を末尾へ追加を試みる。容量に収まる分だけ追加し、残りは追加しない。 + + +## 効果 +Range `rg`の先頭から順に要素を末尾に追加する。容量が満杯になった時点で追加を停止する。 + + +## 戻り値 +挿入されなかった最初の要素を指す`rg`のイテレータを返す。全要素が挿入された場合は`ranges::end(rg)`を返す。 + + +## 計算量 +実際に挿入された要素数に対して線形時間 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::inplace_vector iv = {1, 2, 3}; + std::vector src = {4, 5, 6, 7}; + + auto it = iv.try_append_range(src); + + std::print("inserted: "); + for (int x : iv) std::print("{} ", x); + std::println(""); + + std::print("remaining: "); + for (; it != src.end(); ++it) std::print("{} ", *it); + std::println(""); +} +``` +* try_append_range[color ff0000] + +### 出力 +``` +inserted: 1 2 3 4 5 +remaining: 6 7 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/try_emplace_back.md b/reference/inplace_vector/inplace_vector/try_emplace_back.md new file mode 100644 index 0000000000..1fd35f081a --- /dev/null +++ b/reference/inplace_vector/inplace_vector/try_emplace_back.md @@ -0,0 +1,72 @@ +# try_emplace_back +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +constexpr pointer try_emplace_back(Args&&... args); // (1) C++26 +``` + +## 概要 +末尾へ直接構築を試みる。容量超過時は例外を送出せず、`nullptr`を返す。 + + +## 効果 +[`size()`](size.md) `< N`の場合、`std::forward(args)...`から構築した要素を末尾に追加する。そうでない場合、何もしない。 + + +## 戻り値 +要素が追加された場合は追加された要素へのポインタ、追加できなかった場合は`nullptr`を返す。 + + +## 例外 +投げない(`T`のコンストラクタが例外を送出する場合を除く) + + +## 計算量 +定数時間 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::inplace_vector iv; + + auto* p1 = iv.try_emplace_back("hello"); + auto* p2 = iv.try_emplace_back("world"); + auto* p3 = iv.try_emplace_back("overflow"); + + std::println("{}", (p1 ? *p1 : "(null)")); + std::println("{}", (p2 ? *p2 : "(null)")); + std::println("{}", (p3 ? "(success)" : "(failed)")); +} +``` +* try_emplace_back[color ff0000] + +### 出力 +``` +hello +world +(failed) +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/try_push_back.md b/reference/inplace_vector/inplace_vector/try_push_back.md new file mode 100644 index 0000000000..6031549e34 --- /dev/null +++ b/reference/inplace_vector/inplace_vector/try_push_back.md @@ -0,0 +1,74 @@ +# try_push_back +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr pointer try_push_back(const T& x); // (1) C++26 +constexpr pointer try_push_back(T&& x); // (2) C++26 +``` + +## 概要 +末尾へ要素追加を試みる。容量超過時は例外を送出せず、`nullptr`を返す。 + +- (1) : `x`をコピーして末尾への追加を試みる。 +- (2) : `x`をムーブして末尾への追加を試みる。 + + +## 効果 +[`size()`](size.md) `< N`の場合、`x`を末尾に追加する。そうでない場合、何もしない。 + + +## 戻り値 +要素が追加された場合は追加された要素へのポインタ、追加できなかった場合は`nullptr`を返す。 + + +## 例外 +投げない(`T`のコンストラクタが例外を送出する場合を除く) + + +## 計算量 +定数時間 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::inplace_vector iv = {1, 2, 3}; + + int* p1 = iv.try_push_back(4); + std::println("push_back(4): {}", (p1 ? "success" : "failed")); + + iv.pop_back(); + int* p2 = iv.try_push_back(4); + std::println("push_back(4): {}", (p2 ? "success" : "failed")); + std::println("value: {}", *p2); +} +``` +* try_push_back[color ff0000] +* iv.pop_back()[link pop_back.md] + +### 出力 +``` +push_back(4): failed +push_back(4): success +value: 4 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/unchecked_emplace_back.md b/reference/inplace_vector/inplace_vector/unchecked_emplace_back.md new file mode 100644 index 0000000000..ae40270d40 --- /dev/null +++ b/reference/inplace_vector/inplace_vector/unchecked_emplace_back.md @@ -0,0 +1,73 @@ +# unchecked_emplace_back +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +constexpr reference unchecked_emplace_back(Args&&... args); // (1) C++26 +``` + +## 概要 +容量チェックなしで末尾へ直接構築する。 + + +## 事前条件 +[`size()`](size.md) `< N`であること。この条件を満たさない場合、未定義動作となる。 + + +## 効果 +[`std::forward`](/reference/utility/forward.md)`(args)...`から構築した要素を末尾に追加する。 + + +## 戻り値 +追加された要素への参照 + + +## 計算量 +定数時間 + + +## 備考 +この関数は容量チェックを行わないため、[`emplace_back()`](emplace_back.md)よりも高速に動作しうる。呼び出し前に容量に空きがあることが確実な場合に使用する。 + + +## 例 +```cpp example +#include +#include +#include + +int main() +{ + std::inplace_vector iv; + + iv.unchecked_emplace_back("hello"); + iv.unchecked_emplace_back(3, 'a'); + + for (const auto& s : iv) { + std::println("{}", s); + } +} +``` +* unchecked_emplace_back[color ff0000] + +### 出力 +``` +hello +aaa +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/reference/inplace_vector/inplace_vector/unchecked_push_back.md b/reference/inplace_vector/inplace_vector/unchecked_push_back.md new file mode 100644 index 0000000000..dcdb43c6de --- /dev/null +++ b/reference/inplace_vector/inplace_vector/unchecked_push_back.md @@ -0,0 +1,81 @@ +# unchecked_push_back +* inplace_vector[meta header] +* std[meta namespace] +* inplace_vector[meta class] +* function[meta id-type] +* cpp26[meta cpp] + +```cpp +constexpr reference unchecked_push_back(const T& x); // (1) C++26 +constexpr reference unchecked_push_back(T&& x); // (2) C++26 +``` + +## 概要 +容量チェックなしで末尾へ要素を追加する。 + +- (1) : `x`をコピーして末尾に追加する。 +- (2) : `x`をムーブして末尾に追加する。 + + +## 事前条件 +[`size()`](size.md) `< N`であること。この条件を満たさない場合、未定義動作となる。 + + +## 効果 +`x`を末尾に追加する。 + + +## 戻り値 +追加された要素への参照 + + +## 計算量 +定数時間 + + +## 備考 +この関数は容量チェックを行わないため、[`push_back()`](push_back.md)よりも高速に動作しうる。呼び出し前に容量に空きがあることが確実な場合に使用する。 + + +## 例 +```cpp example +#include +#include + +int main() +{ + std::inplace_vector iv; + + // 容量に空きがあることが確実な場合に使用 + for (int i = 0; i < 5; ++i) { + iv.unchecked_push_back(i); + } + + for (int x : iv) { + std::println("{}", x); + } +} +``` +* unchecked_push_back[color ff0000] + +### 出力 +``` +0 +1 +2 +3 +4 +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 23 [mark verified] +- [GCC](/implementation.md#gcc): 16 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + + +## 参照 +- [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) From 6d3a97f83cd383298c1118bb4107b3a5dc62a160 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 30 Mar 2026 18:45:19 +0900 Subject: [PATCH 2668/3948] =?UTF-8?q?check.py=20:=20defined=5Fword=5Fcheck?= =?UTF-8?q?=E3=81=8C=E6=8A=9C=E3=81=91=E3=81=A6=E3=81=9F=E3=81=AE=E3=81=A7?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/script/check.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/script/check.py b/.github/workflows/script/check.py index 204322d5f1..19147decdb 100644 --- a/.github/workflows/script/check.py +++ b/.github/workflows/script/check.py @@ -1,5 +1,6 @@ import sys import code_qualify_check +import defined_word_check import display_error_check import forbidden_character_check import global_qualify_check @@ -11,6 +12,9 @@ if not code_qualify_check.check(): print("code_qualify_check failed") sys.exit(1) + if not defined_word_check.check(): + print("defined_word_check failed") + sys.exit(1) if not display_error_check.check(): print("display_error_check failed") sys.exit(1) From 1524520273ee295f7a8ac487cda71feb84a7550f Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 30 Mar 2026 18:45:36 +0900 Subject: [PATCH 2669/3948] =?UTF-8?q?=E7=94=A8=E8=AA=9E=E3=82=92=E8=A8=B1?= =?UTF-8?q?=E5=8F=AF=E3=81=95=E3=82=8C=E3=81=9F=E4=BD=BF=E3=81=84=E6=96=B9?= =?UTF-8?q?=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inplace_vector/inplace_vector/unchecked_emplace_back.md | 2 +- reference/inplace_vector/inplace_vector/unchecked_push_back.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/inplace_vector/inplace_vector/unchecked_emplace_back.md b/reference/inplace_vector/inplace_vector/unchecked_emplace_back.md index ae40270d40..d5f7870e46 100644 --- a/reference/inplace_vector/inplace_vector/unchecked_emplace_back.md +++ b/reference/inplace_vector/inplace_vector/unchecked_emplace_back.md @@ -15,7 +15,7 @@ constexpr reference unchecked_emplace_back(Args&&... args); // (1) C++26 ## 事前条件 -[`size()`](size.md) `< N`であること。この条件を満たさない場合、未定義動作となる。 +[`size()`](size.md) `< N`であること。この条件を満たさない場合、動作は未定義。 ## 効果 diff --git a/reference/inplace_vector/inplace_vector/unchecked_push_back.md b/reference/inplace_vector/inplace_vector/unchecked_push_back.md index dcdb43c6de..fc8d7833a4 100644 --- a/reference/inplace_vector/inplace_vector/unchecked_push_back.md +++ b/reference/inplace_vector/inplace_vector/unchecked_push_back.md @@ -18,7 +18,7 @@ constexpr reference unchecked_push_back(T&& x); // (2) C++26 ## 事前条件 -[`size()`](size.md) `< N`であること。この条件を満たさない場合、未定義動作となる。 +[`size()`](size.md) `< N`であること。この条件を満たさない場合、動作は未定義。 ## 効果 From 2e31db66a0634353afd19307a72b5747865d3edc Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 31 Mar 2026 20:30:41 +0900 Subject: [PATCH 2670/3948] =?UTF-8?q?mdspan:=20P3663R3=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=20(#1567)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/mdspan.md | 2 + reference/mdspan/canonical-index.md | 41 +++++++ reference/mdspan/canonical-slice.md | 77 +++++++++++++ reference/mdspan/de-ice.md | 26 ----- reference/mdspan/first_.md | 40 ------- reference/mdspan/last_.md | 41 ------- .../layout_left/mapping/submdspan_mapping.md | 48 +++----- .../mapping/submdspan_mapping.md | 46 +++----- .../layout_right/mapping/submdspan_mapping.md | 48 +++----- .../mapping/submdspan_mapping.md | 45 +++----- reference/mdspan/layout_stride/mapping.md | 4 + .../layout_stride/mapping/is_exhaustive.md | 2 - .../mapping/submdspan_mapping.md | 29 ++--- reference/mdspan/sliceable-mapping.md | 73 ++++++++++++ reference/mdspan/src-indices.md | 35 ------ reference/mdspan/submdspan.md | 28 ++--- .../mdspan/submdspan_canonicalize_slices.md | 106 ++++++++++++++++++ reference/mdspan/submdspan_extents.md | 54 ++++----- 18 files changed, 414 insertions(+), 331 deletions(-) create mode 100644 reference/mdspan/canonical-index.md create mode 100644 reference/mdspan/canonical-slice.md delete mode 100644 reference/mdspan/de-ice.md delete mode 100644 reference/mdspan/first_.md delete mode 100644 reference/mdspan/last_.md create mode 100644 reference/mdspan/sliceable-mapping.md delete mode 100644 reference/mdspan/src-indices.md create mode 100644 reference/mdspan/submdspan_canonicalize_slices.md diff --git a/reference/mdspan.md b/reference/mdspan.md index e0a9728192..6afea37daf 100644 --- a/reference/mdspan.md +++ b/reference/mdspan.md @@ -49,6 +49,7 @@ | [`full_extent`](mdspan/full_extent_t.md) | 指定次元の全要素取り出しを指示するタグ値 (variable) | C++26 | | [`submdspan_mapping_result`](mdspan/submdspan_mapping_result.md) | 多次元配列部分ビューのレイアウトマッピング情報 (class template) | C++26 | | [`submdspan_extents`](mdspan/submdspan_extents.md) | 多次元配列部分ビューの多次元配列サイズを計算する (function template) | C++26 | +| [`submdspan_canonicalize_slices`](mdspan/submdspan_canonicalize_slices.md) | 多次元配列部分ビュー取得時の多次元インデクスを正規化する (function template) | C++26 | | [`submdspan`](mdspan/submdspan.md) | 多次元配列部分ビューを取得する (function template) | C++26 | @@ -67,3 +68,4 @@ - [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) - [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) - [P2897R7 `aligned_accessor`: An mdspan accessor expressing pointer over-alignment](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2897r7.html) +- [P3663R3 Future-proof `submdspan_mapping`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3663r3.html) diff --git a/reference/mdspan/canonical-index.md b/reference/mdspan/canonical-index.md new file mode 100644 index 0000000000..bfd46fd8c4 --- /dev/null +++ b/reference/mdspan/canonical-index.md @@ -0,0 +1,41 @@ +# canonical-index +* [meta exposition-only] +* mdspan[meta header] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +constexpr auto canonical-index(S s); +``` + +## 概要 +`canonical-index`は、[`submdspan`](submdspan.md)動作仕様定義で用いられる説明専用の関数テンプレートである。 + + +## 適格要件 +`S`が[`integral-constant-like`](/reference/span/integral-constant-like.md)のモデルであるとき、`extents::`[`index-cast`](extents/index-cast.md)`(`[`std::move`](/reference/utility/move.md)`(s))`を`IndexType`型の値として表現できること。 + + +## 事前条件 +`extents::`[`index-cast`](extents/index-cast.md)`(`[`std::move`](/reference/utility/move.md)`(s))`を`IndexType`型の値として表現できること。 + + +## 効果 +以下と等価 + +- `S`が[`integral-constant-like`](/reference/span/integral-constant-like.md)のモデルであるとき、`return` [`cw`](/reference/type_traits/constant_wrapper.md.nolink)`` +- そうではないとき、`return IndexType(`[`std::move`](/reference/utility/move.md)`(s))` + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`submdspan_canonicalize_slices`](submdspan_canonicalize_slices.md) + + +## 参照 +- [P3663R3 Future-proof `submdspan_mapping`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3663r3.html) diff --git a/reference/mdspan/canonical-slice.md b/reference/mdspan/canonical-slice.md new file mode 100644 index 0000000000..30b8c7a436 --- /dev/null +++ b/reference/mdspan/canonical-slice.md @@ -0,0 +1,77 @@ +# canonical-slice +* [meta exposition-only] +* mdspan[meta header] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +constexpr auto canonical-slice(S s); +``` + +## 概要 +`canonical-slice`は、[`submdspan`](submdspan.md)動作仕様定義で用いられる説明専用の関数テンプレートである。 + + +## 適格要件 +`S`が`IndexType`の`submdspan`スライス型であること。 + + +## 効果 +以下と等価 + +```cpp +if constexpr (is_convertible_v) { + return static_cast(std::move(s)); +} else if constexpr (is_convertible_v) { + return canonical-index(std::move(s)); +} else if constexpr (is-strided-slice) { + auto c_extent = canonical-index(std::move(s.extent)); + auto c_offset = canonical-index(std::move(s.offset)); + if constexpr (is_same_v>) { + return strided_slice{ + .offset = c_offset, + .extent = c_extent, + .stride = cw + }; + } else { + return strided_slice{ + .offset = c_offset, + .extent = c_extent, + .stride = canonical-index(std::move(s.stride)) + }; + } +} else { + auto [s_first, s_last] = std::move(s); + auto c_first = canonical-index(std::move(s_first)); + auto c_last = canonical-index(std::move(s_last)); + return strided_slice{ + .offset = c_first, + .extent = canonical-index(c_last - c_first), + .stride = cw + }; +} +``` +* full_extent_t[link full_extent_t.md] +* strided_slice[link strided_slice.md] +* canonical-index[link canonical-index.md] +* is_convertible_v[link /reference/type_traits/is_convertible.md] +* is_same_v[link /reference/type_traits/is_same.md] +* constant_wrapper[link /reference/type_traits/constant_wrapper.md.nolink] +* cw[link /reference/type_traits/constant_wrapper.md.nolink] +* std::move[link /reference/utility/move.md] + +ここで`is-strided-slice`は、型`S`が[`strided_slice`](strided_slice.md)の特殊化であることを表す説明専用コンセプトとする。 + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`submdspan_canonicalize_slices`](submdspan_canonicalize_slices.md) + + +## 参照 +- [P3663R3 Future-proof `submdspan_mapping`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3663r3.html) diff --git a/reference/mdspan/de-ice.md b/reference/mdspan/de-ice.md deleted file mode 100644 index 7c1c853552..0000000000 --- a/reference/mdspan/de-ice.md +++ /dev/null @@ -1,26 +0,0 @@ -# de-ice -* [meta exposition-only] -* mdspan[meta header] -* function template[meta id-type] -* cpp26[meta cpp] - -```cpp -template -constexpr T de-ice(T val) { return val; } - -template -constexpr auto de-ice(T) { return T::value; } -``` -* integral-constant-like[link /reference/span/integral-constant-like.md] - -## 概要 -`de-ice`は[`submdspan`](submdspan.md)動作説明用の関数テンプレートである。 - - -## バージョン -### 言語 -- C++26 - - -## 参照 -- [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) diff --git a/reference/mdspan/first_.md b/reference/mdspan/first_.md deleted file mode 100644 index 7bc26f57d8..0000000000 --- a/reference/mdspan/first_.md +++ /dev/null @@ -1,40 +0,0 @@ -# first_ -* mdspan[meta header] -* function template[meta id-type] -* cpp26[meta cpp] - -```cpp -template -constexpr IndexType first_(SliceSpecifiers... slices); -``` - -## 概要 -`first_`は[`submdspan`](submdspan.md)動作説明用の関数テンプレートである。 - -`S_k`を`SliceSpecifiers`の`k`番目の型、`s_k`を`slices`の`k`番目の値としたとき、説明用の`P_k`の値を次のように定義する。 - -- 型`S_k`が[`convertible_to`](/reference/concepts/convertible_to.md)``のモデルのとき`s_k`、そうでなければ -- 型`S_k`が[`index-pair-like`](index-pair-like.md)``のモデルのとき`get<0>(s_k)`、そうでなければ -- 型`S_k`が[`strided_slice`](strided_slice.md)の特殊化のとき[`de-ice`](de-ice.md)`(s_k.offset)`、そうでなければ -- 値`0` - - -## 適格要件 -`IndexType`は符号付き整数型または符号無し整数型であること。 - - -## 事前条件 -`P_k`が`IndexType`型で表現可能な値であること。 - - -## 戻り値 -[`extents`](extents.md)`::`[`index-cast`](extents/index-cast.md)`(P_k)` - - -## バージョン -### 言語 -- C++26 - - -## 参照 -- [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) diff --git a/reference/mdspan/last_.md b/reference/mdspan/last_.md deleted file mode 100644 index f552e9b469..0000000000 --- a/reference/mdspan/last_.md +++ /dev/null @@ -1,41 +0,0 @@ -# last_ -* mdspan[meta header] -* function template[meta id-type] -* cpp26[meta cpp] - -```cpp -template -constexpr auto last_(const Extents& src, SliceSpecifiers... slices); -``` -* Extents[link extents.md] - -## 概要 -`last_`は[`submdspan`](submdspan.md)動作説明用の関数テンプレートである。 - -`index_type`を`Extents::index_type`型、`S_k`を`SliceSpecifiers`の`k`番目の型、`s_k`を`slices`の`k`番目の値としたとき、説明用の`L_k`の値を次のように定義する。 - -- 型`S_k`が[`convertible_to`](/reference/concepts/convertible_to.md)``のモデルのとき[`de-ice`](de-ice.md)`(s_k) + 1`、そうでなければ -- 型`S_k`が[`index-pair-like`](index-pair-like.md)``のモデルのとき`get<1>(s_k)`、そうでなければ -- 型`S_k`が[`strided_slice`](strided_slice.md)の特殊化のとき[`de-ice`](de-ice.md)`(s_k.offset) +` [`de-ice`](de-ice.md)`(s_k.extent)`、そうでなければ -- `src.`[`extent`](extents/extent.md)`(k)` - - -## 適格要件 -`Extents`が[`extents`](extents.md)の特殊化であること。 - - -## 事前条件 -`L_k`が`index_type`型で表現可能な値であること。 - - -## 戻り値 -[`extents`](extents.md)`::`[`index-cast`](extents/index-cast.md)`(L_k)` - - -## バージョン -### 言語 -- C++26 - - -## 参照 -- [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) diff --git a/reference/mdspan/layout_left/mapping/submdspan_mapping.md b/reference/mdspan/layout_left/mapping/submdspan_mapping.md index 34f9e515fb..4e4fe550f3 100644 --- a/reference/mdspan/layout_left/mapping/submdspan_mapping.md +++ b/reference/mdspan/layout_left/mapping/submdspan_mapping.md @@ -8,7 +8,7 @@ ```cpp template constexpr auto submdspan-mapping-impl( // exposition only - SliceSpecifiers ... slices) const -> see below; + SliceSpecifiers... slices) const -> see below; template friend constexpr auto submdspan_mapping( @@ -22,29 +22,17 @@ friend constexpr auto submdspan_mapping( ## 概要 [`submdspan`](../../submdspan.md)関数をサポートするためのカスタマイゼーションポイント。 -説明用の型`index_type`を[`Extents::index_type`](../../extents.md)、型`S_k`を`SliceSpecifiers`の`k`番目の型とする。 - ## テンプレートパラメータ制約 -`sizeof...(slices)`が[`Extents::rank()`](../../extents/rank.md)と等しいこと。 +`sizeof...(SliceSpecifiers)`が[`Extents::rank()`](../../extents/rank.md)と等しいこと。 ## 適格要件 -`extents()`の各次元インデクス`k`において、下記いずれかのうち1つだけを満たすこと。 - -- 型`S_k`が[`convertible_to`](/reference/concepts/convertible_to.md)``のモデル -- 型`S_k`が[`index-pair-like`](../../index-pair-like.md)``のモデル -- [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` -- 型`S_k`が[`strided_slice`](../../strided_slice.md)の特殊化 +`extents()`の各次元インデクス`k`において、`SliceSpecifiers...[k]`が`Extents`のk番目次元の[有効`submdspan`スライス型(valid `submdspan` slice type)](../../submdspan_canonicalize_slices.md)であること。 ## 事前条件 -`extents()`の各次元インデクス`k`において、`s_k`を`slices`の`k`番目の値としたとき、下記を全て満たすこと。 - -- 型`S_k`が[`strided_slice`](../../strided_slice.md)の特殊化のとき - - `s_k.extent == 0`、または - - `s_k.stride > 0` -- `0` ≤ [`first_`](../../first_.md)`(slices...)` ≤ [`last_`](../../last_.md)`(extents(), slices...)` ≤ `extents().`[`extent(k)`](../../extents/extent.md) +`extents()`の各次元インデクス`k`において、`slices...[k]`が`extents()`のk番目次元の有効スライスであること。 ## 戻り値 @@ -52,30 +40,29 @@ friend constexpr auto submdspan_mapping( - 値`sub_ext` : 式[`submdspan_extents`](../../submdspan_extents.md)`(extents(), slices...)`の結果 - 型`SubExtents` : `decltype(sub_ext)` -- 値`sub_strides` : `extents()`の各次元インデクス`k`において、[`map-rank[k]`](../../submdspan_extents.md)が[`dynamic_extent`](/reference/span/dynamic_extent.md)ではない`k`に対し`sub_strides[map-rank[k]]`が下記を満たす、[`array`](/reference/array/array.md)``型の配列値 - - 型`S_k`が[`strided_slice`](../../strided_slice.md)の特殊化かつ`s_k.stride < s_k.extent`の場合、[`stride(k)`](stride.md) `*` [`de-ice`](../../de-ice.md)`(s_k.stride)` +- 値`sub_strides` : `slices...[k]`の型が縮約スライス型(collapsing slice type)ではない`extents()`の各次元インデクス`k`において`sub_strides[MAP_RANK(slices, k)]`が下記を満たす、[`array`](/reference/array/array.md)``型の配列値 + - 説明用の`s`を`slices...[k]`としたとき、`s`の型が[`strided_slice`](../../strided_slice.md)の特殊化かつ`s.stride < s.extent`の場合、[`stride(k)`](stride.md) `* s.stride` - そうでなければ、[`stride(k)`](stride.md) -- パラメータパック`P` : [`is_same_v`](/reference/type_traits/is_same.md)`<`[`make_index_sequence`](/reference/utility/make_index_sequence.md)`,` [`index_sequence`](/reference/utility/index_sequence.md)`> == true` -- 値`offset` : `size_t`型の値[`(*this)`](op_call.md)`(`[`first_`](../../first_.md)`(slices...)...)` +- パック`ls` : `extents()`の次元`r`に対して、`r`番目の要素が`slices...[r]`の`submdspan`スライス範囲の下限に等しい`index_type`型の値パック +- 値`offset` : `extents()`における任意の次元インデクス`k`に対して`ls...[k]`が`extents().extent(k)`と等しいとき、`required_span_size()`に等しい`size_t`型の値。そうでなければ、[`operator()`](op_call.md)に等しい`size_t`型の値。 -下記を満たす型`S`を、単位ストライド幅スライス(unit-stride slice)と定義する。 +下記を満たす型`S`を、単位ストライド幅スライス型(unit-stride slice type)と定義する。 -- 型`S`が[`strided_slice`](../../strided_slice.md)の特殊化であり型`S::stride_type`が[`integral-constant-like`](/reference/span/integral-constant-like.md)のモデルかつ`S::stride_type::value`が`1`に等しい、もしくは -- 型`S`が[`index-pair-like`](../../index-pair-like.md)``のモデル、もしくは -- [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` +- `S`が[`strided_slice`](../../strided_slice.md)の特殊化であり、`S::stride_type`が[`constant_wrapper`](/reference/type_traits/constant_wrapper.md.nolink)の特殊化かつ`S::stride_type::value`が`1`、または +- `S`が[`full_extent_t`](../../full_extent_t.md) 説明専用の`submdspan-mapping-impl`関数テンプレートは下記の値を返す。 - [`Extents::rank()`](../../extents/rank.md) `== 0`のとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{*this, 0}` - `SubExtents::rank() == 0`のとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_left::mapping`](../../layout_left.md)`(sub_ext), offset}` - 以下を満たすとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_left::mapping`](../../layout_left.md)`(sub_ext), offset}` - - 半開区間`[0, SubExtents::rank()-1)`の値`k`に対して、[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true`、かつ - - `SubExtents::rank()-1`に等しい値`k`に対して、型`S_k`が単位ストライド幅スライスである + - 半開区間`[0, SubExtents::rank()-1)`の値`k`に対して、`SliceSpecifiers...[k]`が[`full_extent_t`](../../full_extent_t.md)を表し、かつ + - `SubExtents::rank()-1`に等しい値`k`に対して、`SliceSpecifiers...[k]`が単位ストライド幅スライス型である - 以下を満たすとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_left_padded::mapping`](../../layout_left_padded/mapping.md)`(sub_ext, stride(u + 1)), offset}` - - 型`S_p`が単位ストライド幅スライスを満たす`0`より大きい最小値`p`に対して、`u+1`が`p`となる値`u`を用いて - - 型`S_0`が単位ストライド幅スライスであり、かつ - - 半開区間`[u+1, u+SubExtents::rank()-1)`の値`k`に対して、[`is_convertible_v`](/reference/type_traits/is_convertible.md)``、かつ - - `u+SubExtents::rank()-1`に等しい値`k`に対して、型`S_k`が単位ストライド幅スライスである + - `SliceSpecifiers...[p]`が単位ストライド幅スライス型となる`0`より大きい最小値`p`に対して、`u+1`が`p`となる値`u`を用いて + - 型`SliceSpecifiers...[0]`が単位ストライド幅スライス型であり、かつ + - 半開区間`[u+1, u+SubExtents::rank()-1)`の値`k`に対して、`SliceSpecifiers...[k]`が[`full_extent_t`](../../full_extent_t.md)を表し、かつ + - `u+SubExtents::rank()-1`に等しい値`k`に対して、`SliceSpecifiers...[k]`が単位ストライド幅スライス型である - ここで定数`S_static`は - 半開区間`[0, u+1)`のいずれかの値`k`に対して`static_extent(k)`が[`dynamic_extent`](/reference/span/dynamic_extent.md)のとき、`dynamic_extent` - そうでなければ、半開区間`[0, u+1)`の全ての値`k`に対して`static_extent(k)`を乗算した値 @@ -101,3 +88,4 @@ friend constexpr auto submdspan_mapping( - [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) - [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) - [P3355R1 Fix submdspan for C++26](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3355r1.html) +- [P3663R3 Future-proof `submdspan_mapping`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3663r3.html) diff --git a/reference/mdspan/layout_left_padded/mapping/submdspan_mapping.md b/reference/mdspan/layout_left_padded/mapping/submdspan_mapping.md index af428d90d6..8c2009911e 100644 --- a/reference/mdspan/layout_left_padded/mapping/submdspan_mapping.md +++ b/reference/mdspan/layout_left_padded/mapping/submdspan_mapping.md @@ -8,7 +8,7 @@ ```cpp template constexpr auto submdspan-mapping-impl( // exposition only - SliceSpecifiers ... slices) const -> see below; + SliceSpecifiers... slices) const -> see below; template friend constexpr auto submdspan_mapping( @@ -22,29 +22,17 @@ friend constexpr auto submdspan_mapping( ## 概要 [`submdspan`](../../submdspan.md)関数をサポートするためのカスタマイゼーションポイント。 -説明用の型`index_type`を[`Extents::index_type`](../../extents.md)、型`S_k`を`SliceSpecifiers`の`k`番目の型とする。 - ## テンプレートパラメータ制約 -`sizeof...(slices)`が[`Extents::rank()`](../../extents/rank.md)と等しいこと。 +`sizeof...(SliceSpecifiers)`が[`Extents::rank()`](../../extents/rank.md)と等しいこと。 ## 適格要件 -`extents()`の各次元インデクス`k`において、下記いずれかのうち1つだけを満たすこと。 - -- 型`S_k`が[`convertible_to`](/reference/concepts/convertible_to.md)``のモデル -- 型`S_k`が[`index-pair-like`](../../index-pair-like.md)``のモデル -- [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` -- 型`S_k`が[`strided_slice`](../../strided_slice.md)の特殊化 +`extents()`の各次元インデクス`k`において、`SliceSpecifiers...[k]`が`Extents`のk番目次元の[有効`submdspan`スライス型(valid `submdspan` slice type)](../../submdspan_canonicalize_slices.md)であること。 ## 事前条件 -`extents()`の各次元インデクス`k`において、`s_k`を`slices`の`k`番目の値としたとき、下記を全て満たすこと。 - -- 型`S_k`が[`strided_slice`](../../strided_slice.md)の特殊化のとき - - `s_k.extent == 0`、または - - `s_k.stride > 0` -- `0` ≤ [`first_`](../../first_.md)`(slices...)` ≤ [`last_`](../../last_.md)`(extents(), slices...)` ≤ `extents().`[`extent(k)`](../../extents/extent.md) +`extents()`の各次元インデクス`k`において、`slices...[k]`が`extents()`のk番目次元の有効スライスであること。 ## 戻り値 @@ -52,17 +40,16 @@ friend constexpr auto submdspan_mapping( - 値`sub_ext` : 式[`submdspan_extents`](../../submdspan_extents.md)`(extents(), slices...)`の結果 - 型`SubExtents` : `decltype(sub_ext)` -- 値`sub_strides` : `extents()`の各次元インデクス`k`において、[`map-rank[k]`](../../submdspan_extents.md)が[`dynamic_extent`](/reference/span/dynamic_extent.md)ではない`k`に対し`sub_strides[map-rank[k]]`が下記を満たす、[`array`](/reference/array/array.md)``型の配列値 - - 型`S_k`が[`strided_slice`](../../strided_slice.md)の特殊化かつ`s_k.stride < s_k.extent`の場合、[`stride(k)`](stride.md) `*` [`de-ice`](../../de-ice.md)`(s_k.stride)` +- 値`sub_strides` : `slices...[k]`の型が縮約スライス型(collapsing slice type)ではない`extents()`の各次元インデクス`k`において`sub_strides[MAP_RANK(slices, k)]`が下記を満たす、[`array`](/reference/array/array.md)``型の配列値 + - 説明用の`s`を`slices...[k]`としたとき、`s`の型が[`strided_slice`](../../strided_slice.md)の特殊化かつ`s.stride < s.extent`の場合、[`stride(k)`](stride.md) `* s.stride` - そうでなければ、[`stride(k)`](stride.md) -- パラメータパック`P` : [`is_same_v`](/reference/type_traits/is_same.md)`<`[`make_index_sequence`](/reference/utility/make_index_sequence.md)`,` [`index_sequence`](/reference/utility/index_sequence.md)`> == true` -- 値`offset` : `size_t`型の値[`(*this)`](op_call.md)`(`[`first_`](../../first_.md)`(slices...)...)` +- パック`ls` : `extents()`の次元`r`に対して、`r`番目の要素が`slices...[r]`の`submdspan`スライス範囲の下限に等しい`index_type`型の値パック +- 値`offset` : `extents()`における任意の次元インデクス`k`に対して`ls...[k]`が`extents().extent(k)`と等しいとき、`required_span_size()`に等しい`size_t`型の値。そうでなければ、[`operator()`](op_call.md)に等しい`size_t`型の値。 -下記を満たす型`S`を、単位ストライド幅スライス(unit-stride slice)と定義する。 +下記を満たす型`S`を、単位ストライド幅スライス型(unit-stride slice type)と定義する。 -- 型`S`が[`strided_slice`](../../strided_slice.md)の特殊化であり型`S::stride_type`が[`integral-constant-like`](/reference/span/integral-constant-like.md)のモデルかつ`S::stride_type::value`が`1`に等しい、もしくは -- 型`S`が[`index-pair-like`](../../index-pair-like.md)``のモデル、もしくは -- [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` +- `S`が[`strided_slice`](../../strided_slice.md)の特殊化であり、`S::stride_type`が[`constant_wrapper`](/reference/type_traits/constant_wrapper.md.nolink)の特殊化かつ`S::stride_type::value`が`1`、または +- `S`が[`full_extent_t`](../../full_extent_t.md) 説明専用の`submdspan-mapping-impl`関数テンプレートは下記の値を返す。 @@ -70,12 +57,12 @@ friend constexpr auto submdspan_mapping( - `rank_ == 1`または`SubExtents::rank() == 0`のとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_left::mapping`](../../layout_left.md)`(sub_ext), offset}` - 以下を満たすとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_left::mapping`](../../layout_left.md)`(sub_ext), offset}` - `SubExtents::rank() == 1`、かつ - - 型`S_0`が単位ストライド幅スライスである + - `SliceSpecifiers...[0]`が単位ストライド幅スライス型である - 以下を満たすとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{layout_left_padded::mapping(sub_ext, stride(u + 1)), offset}` - - 型`S_p`が単位ストライド幅スライスを満たす`0`より大きい最小値`p`に対して、`u+1`が`p`となる値`u`を用いて - - 型`S_0`が単位ストライド幅スライスであり、かつ - - 半開区間`[u+1, u+SubExtents::rank()-1)`の値`k`に対して、[`is_convertible_v`](/reference/type_traits/is_convertible.md)``、かつ - - `u+SubExtents::rank()-1`に等しい値`k`に対して、型`S_k`が単位ストライド幅スライスである + - `SliceSpecifiers...[p]`が単位ストライド幅スライス型となる`0`より大きい最小値`p`に対して、`u+1`が`p`となる値`u`を用いて + - `SliceSpecifiers...[0]`が単位ストライド幅スライス型であり、かつ + - 半開区間`[u+1, u+SubExtents::rank()-1)`の値`k`に対して、`SliceSpecifiers...[k]`が[`full_extent_t`](../../full_extent_t.md)を表し、かつ + - `u+SubExtents::rank()-1`に等しい値`k`に対して、`SliceSpecifiers...[k]`が単位ストライド幅スライス型である - ここで定数`S_static`は - 半開区間`[0, u+1)`のいずれかの値`k`に対して`static_extent(k)`が[`dynamic_extent`](/reference/span/dynamic_extent.md)のとき、`dynamic_extent` - そうでなければ、半開区間`[0, u+1)`の全ての値`k`に対して`static_extent(k)`を乗算した値 @@ -101,3 +88,4 @@ friend constexpr auto submdspan_mapping( - [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) - [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) - [P3355R1 Fix submdspan for C++26](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3355r1.html) +- [P3663R3 Future-proof `submdspan_mapping`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3663r3.html) diff --git a/reference/mdspan/layout_right/mapping/submdspan_mapping.md b/reference/mdspan/layout_right/mapping/submdspan_mapping.md index 74e8e945d3..8b99e9e876 100644 --- a/reference/mdspan/layout_right/mapping/submdspan_mapping.md +++ b/reference/mdspan/layout_right/mapping/submdspan_mapping.md @@ -8,7 +8,7 @@ ```cpp template constexpr auto submdspan-mapping-impl( // exposition only - SliceSpecifiers ... slices) const -> see below; + SliceSpecifiers... slices) const -> see below; template friend constexpr auto submdspan_mapping( @@ -22,29 +22,17 @@ friend constexpr auto submdspan_mapping( ## 概要 [`submdspan`](../../submdspan.md)関数をサポートするためのカスタマイゼーションポイント。 -説明用の型`index_type`を[`Extents::index_type`](../../extents.md)、型`S_k`を`SliceSpecifiers`の`k`番目の型とする。 - ## テンプレートパラメータ制約 -`sizeof...(slices)`が[`Extents::rank()`](../../extents/rank.md)と等しいこと。 +`sizeof...(SliceSpecifiers)`が[`Extents::rank()`](../../extents/rank.md)と等しいこと。 ## 適格要件 -`extents()`の各次元インデクス`k`において、下記いずれかのうち1つだけを満たすこと。 - -- 型`S_k`が[`convertible_to`](/reference/concepts/convertible_to.md)``のモデル -- 型`S_k`が[`index-pair-like`](../../index-pair-like.md)``のモデル -- [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` -- 型`S_k`が[`strided_slice`](../../strided_slice.md)の特殊化 +`extents()`の各次元インデクス`k`において、`SliceSpecifiers...[k]`が`Extents`のk番目次元の[有効`submdspan`スライス型(valid `submdspan` slice type)](../../submdspan_canonicalize_slices.md)であること。 ## 事前条件 -`extents()`の各次元インデクス`k`において、`s_k`を`slices`の`k`番目の値としたとき、下記を全て満たすこと。 - -- 型`S_k`が[`strided_slice`](../../strided_slice.md)の特殊化のとき - - `s_k.extent == 0`、または - - `s_k.stride > 0` -- `0` ≤ [`first_`](../../first_.md)`(slices...)` ≤ [`last_`](../../last_.md)`(extents(), slices...)` ≤ `extents().`[`extent(k)`](../../extents/extent.md) +`extents()`の各次元インデクス`k`において、`slices...[k]`が`extents()`のk番目次元の有効スライスであること。 ## 戻り値 @@ -52,30 +40,29 @@ friend constexpr auto submdspan_mapping( - 値`sub_ext` : 式[`submdspan_extents`](../../submdspan_extents.md)`(extents(), slices...)`の結果 - 型`SubExtents` : `decltype(sub_ext)` -- 値`sub_strides` : `extents()`の各次元インデクス`k`において、[`map-rank[k]`](../../submdspan_extents.md)が[`dynamic_extent`](/reference/span/dynamic_extent.md)ではない`k`に対し`sub_strides[map-rank[k]]`が下記を満たす、[`array`](/reference/array/array.md)``型の配列値 - - 型`S_k`が[`strided_slice`](../../strided_slice.md)の特殊化かつ`s_k.stride < s_k.extent`の場合、[`stride(k)`](stride.md) `*` [`de-ice`](../../de-ice.md)`(s_k.stride)` +- 値`sub_strides` : `slices...[k]`の型が縮約スライス型(collapsing slice type)ではない`extents()`の各次元インデクス`k`において`sub_strides[MAP_RANK(slices, k)]`が下記を満たす、[`array`](/reference/array/array.md)``型の配列値 + - 説明用の`s`を`slices...[k]`としたとき、`s`の型が[`strided_slice`](../../strided_slice.md)の特殊化かつ`s.stride < s.extent`の場合、[`stride(k)`](stride.md) `* s.stride` - そうでなければ、[`stride(k)`](stride.md) -- パラメータパック`P` : [`is_same_v`](/reference/type_traits/is_same.md)`<`[`make_index_sequence`](/reference/utility/make_index_sequence.md)`,` [`index_sequence`](/reference/utility/index_sequence.md)`> == true` -- 値`offset` : `size_t`型の値[`(*this)`](op_call.md)`(`[`first_`](../../first_.md)`(slices...)...)` +- パック`ls` : `extents()`の次元`r`に対して、`r`番目の要素が`slices...[r]`の`submdspan`スライス範囲の下限に等しい`index_type`型の値パック +- 値`offset` : `extents()`における任意の次元インデクス`k`に対して`ls...[k]`が`extents().extent(k)`と等しいとき、`required_span_size()`に等しい`size_t`型の値。そうでなければ、[`operator()`](op_call.md)に等しい`size_t`型の値。 -下記を満たす型`S`を、単位ストライド幅スライス(unit-stride slice)と定義する。 +下記を満たす型`S`を、単位ストライド幅スライス型(unit-stride slice type)と定義する。 -- 型`S`が[`strided_slice`](../../strided_slice.md)の特殊化であり型`S::stride_type`が[`integral-constant-like`](/reference/span/integral-constant-like.md)のモデルかつ`S::stride_type::value`が`1`に等しい、もしくは -- 型`S`が[`index-pair-like`](../../index-pair-like.md)``のモデル、もしくは -- [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` +- `S`が[`strided_slice`](../../strided_slice.md)の特殊化であり、`S::stride_type`が[`constant_wrapper`](/reference/type_traits/constant_wrapper.md.nolink)の特殊化かつ`S::stride_type::value`が`1`、または +- `S`が[`full_extent_t`](../../full_extent_t.md) 説明専用の`submdspan-mapping-impl`関数テンプレートは下記の値を返す。 - [`Extents::rank()`](../../extents/rank.md) `== 0`のとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{*this, 0}` - `SubExtents::rank() == 0`のとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_right::mapping`](../../layout_right.md)`(sub_ext), offset}` - 以下を満たすとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_right::mapping`](../../layout_right.md)`(sub_ext), offset}` - - 半開区間`[Extents::rank() - SubExtents::rank()+1, Extents::rank())`の値`k`に対して、[`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true`、かつ - - `Extents::rank()-SubExtents::rank()`に等しい値`k`に対して、型`S_k`が単位ストライド幅スライスである + - 半開区間`[Extents::rank() - SubExtents::rank()+1, Extents::rank())`の値`k`に対して、`SliceSpecifiers...[k]`が[`full_extent_t`](../../full_extent_t.md)を表し、かつ + - `rank_-SubExtents::rank()`に等しい値`k`に対して、`SliceSpecifiers...[k]`が単位ストライド幅スライス型である - 以下を満たすとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_right_padded::mapping`](../../layout_right_padded/mapping.md)`(sub_ext, stride(rank_-u-2)), offset}` - - 型`S_p`が単位ストライド幅スライスを満たす`rank_-1`より小さい最大値`p`に対して、`rank_-u-2`が`p`となる値`u`を用いて - - `rank_-1`に等しい値`k`に対して、型`S_k`が単位ストライド幅スライスであり、かつ - - 半開区間`[rank_-SubExtents::rank()-u+1, rank_-u-1)`の値`k`に対して、[`is_convertible_v`](/reference/type_traits/is_convertible.md)``、かつ - - `rank_-SubExtents::rank()-u`に等しい値`k`に対して、型`S_k`が単位ストライド幅スライスである + - `SliceSpecifiers...[p]`が単位ストライド幅スライス型となる`rank_-1`より小さい最大値`p`に対して、`rank_-u-2`が`p`となる値`u`を用いて + - `rank_-1`に等しい値`k`に対して、`SliceSpecifiers...[k]`が単位ストライド幅スライス型であり、かつ + - 半開区間`[rank_-SubExtents::rank()-u+1, rank_-u-1)`の値`k`に対して、`SliceSpecifiers...[k]`が[`full_extent_t`](../../full_extent_t.md)を表し、かつ + - `rank_-SubExtents::rank()-u`に等しい値`k`に対して、`SliceSpecifiers...[k]`が単位ストライド幅スライス型である - ここで定数`S_static`は - 半開区間`[rank_-u-1, rank_)`のいずれかの値`k`に対して`static_extent(k)`が[`dynamic_extent`](/reference/span/dynamic_extent.md)のとき、`dynamic_extent` - そうでなければ、半開区間`[rank_-u-1, rank_)`の全ての値`k`に対して`static_extent(k)`を乗算した値 @@ -101,3 +88,4 @@ friend constexpr auto submdspan_mapping( - [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) - [P2642R6 Padded mdspan layouts](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2642r6.pdf) - [P3355R1 Fix submdspan for C++26](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3355r1.html) +- [P3663R3 Future-proof `submdspan_mapping`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3663r3.html) diff --git a/reference/mdspan/layout_right_padded/mapping/submdspan_mapping.md b/reference/mdspan/layout_right_padded/mapping/submdspan_mapping.md index 805c87c102..2109ce2714 100644 --- a/reference/mdspan/layout_right_padded/mapping/submdspan_mapping.md +++ b/reference/mdspan/layout_right_padded/mapping/submdspan_mapping.md @@ -8,7 +8,7 @@ ```cpp template constexpr auto submdspan-mapping-impl( // exposition only - SliceSpecifiers ... slices) const -> see below; + SliceSpecifiers... slices) const -> see below; template friend constexpr auto submdspan_mapping( @@ -22,29 +22,17 @@ friend constexpr auto submdspan_mapping( ## 概要 [`submdspan`](../../submdspan.md)関数をサポートするためのカスタマイゼーションポイント。 -説明用の型`index_type`を[`Extents::index_type`](../../extents.md)、型`S_k`を`SliceSpecifiers`の`k`番目の型とする。 - ## テンプレートパラメータ制約 -`sizeof...(slices)`が[`Extents::rank()`](../../extents/rank.md)と等しいこと。 +`sizeof...(SliceSpecifiers)`が[`Extents::rank()`](../../extents/rank.md)と等しいこと。 ## 適格要件 -`extents()`の各次元インデクス`k`において、下記いずれかのうち1つだけを満たすこと。 - -- 型`S_k`が[`convertible_to`](/reference/concepts/convertible_to.md)``のモデル -- 型`S_k`が[`index-pair-like`](../../index-pair-like.md)``のモデル -- [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` -- 型`S_k`が[`strided_slice`](../../strided_slice.md)の特殊化 +`extents()`の各次元インデクス`k`において、`SliceSpecifiers...[k]`が`Extents`のk番目次元の[有効`submdspan`スライス型(valid `submdspan` slice type)](../../submdspan_canonicalize_slices.md)であること。 ## 事前条件 -`extents()`の各次元インデクス`k`において、`s_k`を`slices`の`k`番目の値としたとき、下記を全て満たすこと。 - -- 型`S_k`が[`strided_slice`](../../strided_slice.md)の特殊化のとき - - `s_k.extent == 0`、または - - `s_k.stride > 0` -- `0` ≤ [`first_`](../../first_.md)`(slices...)` ≤ [`last_`](../../last_.md)`(extents(), slices...)` ≤ `extents().`[`extent(k)`](../../extents/extent.md) +`extents()`の各次元インデクス`k`において、`slices...[k]`が`extents()`のk番目次元の有効スライスであること。 ## 戻り値 @@ -52,17 +40,16 @@ friend constexpr auto submdspan_mapping( - 値`sub_ext` : 式[`submdspan_extents`](../../submdspan_extents.md)`(extents(), slices...)`の結果 - 型`SubExtents` : `decltype(sub_ext)` -- 値`sub_strides` : `extents()`の各次元インデクス`k`において、[`map-rank[k]`](../../submdspan_extents.md)が[`dynamic_extent`](/reference/span/dynamic_extent.md)ではない`k`に対し`sub_strides[map-rank[k]]`が下記を満たす、[`array`](/reference/array/array.md)``型の配列値 - - 型`S_k`が[`strided_slice`](../../strided_slice.md)の特殊化かつ`s_k.stride < s_k.extent`の場合、[`stride(k)`](stride.md) `*` [`de-ice`](../../de-ice.md)`(s_k.stride)` +- 値`sub_strides` : `slices...[k]`の型が縮約スライス型(collapsing slice type)ではない`extents()`の各次元インデクス`k`において`sub_strides[MAP_RANK(slices, k)]`が下記を満たす、[`array`](/reference/array/array.md)``型の配列値 + - 説明用の`s`を`slices...[k]`としたとき、`s`の型が[`strided_slice`](../../strided_slice.md)の特殊化かつ`s.stride < s.extent`の場合、[`stride(k)`](stride.md) `* s.stride` - そうでなければ、[`stride(k)`](stride.md) -- パラメータパック`P` : [`is_same_v`](/reference/type_traits/is_same.md)`<`[`make_index_sequence`](/reference/utility/make_index_sequence.md)`,` [`index_sequence`](/reference/utility/index_sequence.md)`> == true` -- 値`offset` : `size_t`型の値[`(*this)`](op_call.md)`(`[`first_`](../../first_.md)`(slices...)...)` +- パック`ls` : `extents()`の次元`r`に対して、`r`番目の要素が`slices...[r]`の`submdspan`スライス範囲の下限に等しい`index_type`型の値パック +- 値`offset` : `extents()`における任意の次元インデクス`k`に対して`ls...[k]`が`extents().extent(k)`と等しいとき、`required_span_size()`に等しい`size_t`型の値。そうでなければ、[`operator()`](op_call.md)に等しい`size_t`型の値。 -下記を満たす型`S`を、単位ストライド幅スライス(unit-stride slice)と定義する。 +下記を満たす型`S`を、単位ストライド幅スライス型(unit-stride slice type)と定義する。 -- 型`S`が[`strided_slice`](../../strided_slice.md)の特殊化であり型`S::stride_type`が[`integral-constant-like`](/reference/span/integral-constant-like.md)のモデルかつ`S::stride_type::value`が`1`に等しい、もしくは -- 型`S`が[`index-pair-like`](../../index-pair-like.md)``のモデル、もしくは -- [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` +- `S`が[`strided_slice`](../../strided_slice.md)の特殊化であり、`S::stride_type`が[`constant_wrapper`](/reference/type_traits/constant_wrapper.md.nolink)の特殊化かつ`S::stride_type::value`が`1`、または +- `S`が[`full_extent_t`](../../full_extent_t.md) 説明専用の`submdspan-mapping-impl`関数テンプレートは下記の値を返す。 @@ -70,12 +57,12 @@ friend constexpr auto submdspan_mapping( - `rank_ == 1`または`SubExtents::rank() == 0`のとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_right::mapping`](../../layout_right.md)`(sub_ext), offset}` - 以下を満たすとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{`[`layout_right::mapping`](../../layout_right.md)`(sub_ext), offset}` - `SubExtents::rank() == 1`、かつ - - `rank_-1`に等しい値`k`に対して、型`S_k`が単位ストライド幅スライスである + - `rank_-1`に等しい値`k`に対して、`SliceSpecifiers...[k]`が単位ストライド幅スライス型である - 以下を満たすとき、[`submdspan_mapping_result`](../../submdspan_mapping_result.md)`{layout_right_padded::mapping(sub_ext, stride(rank_-u-2)), offset}` - - 型`S_p`が単位ストライド幅スライスを満たす`rank_-1`より小さい最大値`p`に対して、`rank_-u-2`が`p`となる値`u`を用いて - - `rank_-1`に等しい値`k`に対して、型`S_k`が単位ストライド幅スライスであり、かつ - - 半開区間`[rank_-SubExtents::rank()-u+1, rank_-u-1)`の値`k`に対して、[`is_convertible_v`](/reference/type_traits/is_convertible.md)``、かつ - - `rank_-SubExtents::rank()-u`に等しい値`k`に対して、型`S_k`が単位ストライド幅スライスである + - `SliceSpecifiers...[p]`が単位ストライド幅スライス型となる`rank_-1`より小さい最大値`p`に対して、`rank_-u-2`が`p`となる値`u`を用いて + - `rank_-1`に等しい値`k`に対して、`SliceSpecifiers...[k]`が単位ストライド幅スライス型であり、かつ + - 半開区間`[rank_-SubExtents::rank()-u+1, rank_-u-1)`の値`k`に対して、`SliceSpecifiers...[k]`が[`full_extent_t`](../../full_extent_t.md)を表し、かつ + - `rank_-SubExtents::rank()-u`に等しい値`k`に対して、`SliceSpecifiers...[k]`が単位ストライド幅スライス型である - ここで定数`S_static`は - 半開区間`[rank_-u-1, rank_-1)`のいずれかの値`k`に対して`static_extent(k)`が[`dynamic_extent`](/reference/span/dynamic_extent.md)のとき、`dynamic_extent` - そうでなければ、半開区間`[rank_-u-1, rank_-1)`の全ての値`k`に対して`static_extent(k)`を乗算した値 diff --git a/reference/mdspan/layout_stride/mapping.md b/reference/mdspan/layout_stride/mapping.md index d387ad12f2..0f5258252a 100644 --- a/reference/mdspan/layout_stride/mapping.md +++ b/reference/mdspan/layout_stride/mapping.md @@ -25,6 +25,10 @@ namespace std { - `extents_` : `extents_type`型の[多次元配列サイズ情報](../extents.md) - `strides_` : [`array`](/reference/array/array.md)``型のストライド幅配列 +また下記の説明専用静的メンバ変数を保持する。 + +- `rank_` : `size_t`型の定数`extents_type::`[`rank()`](../extents/rank.md) + ## 適格要件 - `Extents`は[`extents`](../extents.md)の特殊化であること。 diff --git a/reference/mdspan/layout_stride/mapping/is_exhaustive.md b/reference/mdspan/layout_stride/mapping/is_exhaustive.md index c63ac2c884..f0a7e81476 100644 --- a/reference/mdspan/layout_stride/mapping/is_exhaustive.md +++ b/reference/mdspan/layout_stride/mapping/is_exhaustive.md @@ -14,8 +14,6 @@ constexpr bool is_exhaustive() const noexcept; ## 戻り値 -多次元インデクスの次元数を`rank_`としたとき - - `rank_ == 0`のとき、`true`を返す。 - そうでなければ、取りうる全ての多次元インデクス値に対応する要素位置を考えたとき、アクセスされうる要素位置に隙間が生じないならば`true`を返す。 - そうでなければ、`false`を返す。 diff --git a/reference/mdspan/layout_stride/mapping/submdspan_mapping.md b/reference/mdspan/layout_stride/mapping/submdspan_mapping.md index d2a065238a..32e4cbd966 100644 --- a/reference/mdspan/layout_stride/mapping/submdspan_mapping.md +++ b/reference/mdspan/layout_stride/mapping/submdspan_mapping.md @@ -8,7 +8,7 @@ ```cpp template constexpr auto submdspan-mapping-impl( // exposition only - SliceSpecifiers ... slices) const -> see below; + SliceSpecifiers... slices) const -> see below; template friend constexpr auto submdspan_mapping( @@ -22,29 +22,17 @@ friend constexpr auto submdspan_mapping( ## 概要 [`submdspan`](../../submdspan.md)関数をサポートするためのカスタマイゼーションポイント。 -説明用の型`index_type`を[`Extents::index_type`](../../extents.md)、型`S_k`を`SliceSpecifiers`の`k`番目の型とする。 - ## テンプレートパラメータ制約 -`sizeof...(slices)`が[`Extents::rank()`](../../extents/rank.md)と等しいこと。 +`sizeof...(SliceSpecifiers)`が[`Extents::rank()`](../../extents/rank.md)と等しいこと。 ## 適格要件 -`extents()`の各次元インデクス`k`において、下記いずれかのうち1つだけを満たすこと。 - -- 型`S_k`が[`convertible_to`](/reference/concepts/convertible_to.md)``のモデル -- 型`S_k`が[`index-pair-like`](../../index-pair-like.md)``のモデル -- [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` -- 型`S_k`が[`strided_slice`](../../strided_slice.md)の特殊化 +`extents()`の各次元インデクス`k`において、`SliceSpecifiers...[k]`が`Extents`のk番目次元の[有効`submdspan`スライス型(valid `submdspan` slice type)](../../submdspan_canonicalize_slices.md)であること。 ## 事前条件 -`extents()`の各次元インデクス`k`において、`s_k`を`slices`の`k`番目の値としたとき、下記を全て満たすこと。 - -- 型`S_k`が[`strided_slice`](../../strided_slice.md)の特殊化のとき - - `s_k.extent == 0`、または - - `s_k.stride > 0` -- `0` ≤ [`first_`](../../first_.md)`(slices...)` ≤ [`last_`](../../last_.md)`(extents(), slices...)` ≤ `extents().`[`extent(k)`](../../extents/extent.md) +`extents()`の各次元インデクス`k`において、`slices...[k]`が`extents()`のk番目次元の有効スライスであること。 ## 戻り値 @@ -52,11 +40,11 @@ friend constexpr auto submdspan_mapping( - 値`sub_ext` : 式[`submdspan_extents`](../../submdspan_extents.md)`(extents(), slices...)`の結果 - 型`SubExtents` : `decltype(sub_ext)` -- 値`sub_strides` : `extents()`の各次元インデクス`k`において、[`map-rank[k]`](../../submdspan_extents.md)が[`dynamic_extent`](/reference/span/dynamic_extent.md)ではない`k`に対し`sub_strides[map-rank[k]]`が下記を満たす、[`array`](/reference/array/array.md)``型の配列値 - - 型`S_k`が[`strided_slice`](../../strided_slice.md)の特殊化かつ`s_k.stride < s_k.extent`の場合、[`stride(k)`](stride.md) `*` [`de-ice`](../../de-ice.md)`(s_k.stride)` +- 値`sub_strides` : `slices...[k]`の型が縮約スライス型(collapsing slice type)ではない`extents()`の各次元インデクス`k`において`sub_strides[MAP_RANK(slices, k)]`が下記を満たす、[`array`](/reference/array/array.md)``型の配列値 + - 説明用の`s`を`slices...[k]`としたとき、`s`の型が[`strided_slice`](../../strided_slice.md)の特殊化かつ`s.stride < s.extent`の場合、[`stride(k)`](stride.md) `* s.stride` - そうでなければ、[`stride(k)`](stride.md) -- パラメータパック`P` : [`is_same_v`](/reference/type_traits/is_same.md)`<`[`make_index_sequence`](/reference/utility/make_index_sequence.md)`,` [`index_sequence`](/reference/utility/index_sequence.md)`> == true` -- 値`offset` : `size_t`型の値[`(*this)`](op_call.md)`(`[`first_`](../../first_.md)`(slices...)...)` +- パック`ls` : `extents()`の次元`r`に対して、`r`番目の要素が`slices...[r]`の`submdspan`スライス範囲の下限に等しい`index_type`型の値パック +- 値`offset` : `extents()`における任意の次元インデクス`k`に対して`ls...[k]`が`extents().extent(k)`と等しいとき、`required_span_size()`に等しい`size_t`型の値。そうでなければ、[`operator()`](op_call.md)に等しい`size_t`型の値。 説明専用の`submdspan-mapping-impl`関数テンプレートは下記の値を返す。 @@ -81,3 +69,4 @@ friend constexpr auto submdspan_mapping( ## 参照 - [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) +- [P3663R3 Future-proof `submdspan_mapping`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3663r3.html) diff --git a/reference/mdspan/sliceable-mapping.md b/reference/mdspan/sliceable-mapping.md new file mode 100644 index 0000000000..b894148a34 --- /dev/null +++ b/reference/mdspan/sliceable-mapping.md @@ -0,0 +1,73 @@ +# sliceable-mapping +* [meta exposition-only] +* mdspan[meta header] +* concept[meta id-type] +* cpp26[meta cpp] + +```cpp +template +concept sliceable-mapping = see below; +``` + +## 概要 +`sliceable-mapping`は、[`submdspan`](submdspan.md)動作仕様定義で用いられる説明専用のコンセプトである。 + +説明用の`lm`を`LayoutMapping`型のオブジェクト、`fe`を`sizeof...(fe) == LayoutMapping::extents_type::rank()`が`true`となる[`full_extent_t`](full_extent_t.md)型オブジェクトのパックとする。下記を満たすとき、型`LayoutMapping`は`sliceable-mapping`を満たす。 + +- 評価されないオペランドとして扱われるとき式`submdspan_mapping(lm, fe...)`が適格であり、かつ +- その式の型が[`submdspan_mapping_result`](submdspan_mapping_result.md)の特殊化であること。 + +型`LayoutMapping`がスライス可能レイアウトマッピング(sliceable layout mapping)要件を満たすとき、型`LayoutMapping`は`sliceable-mapping`のモデルである。 + +### スライス可能レイアウトマッピング要件 +下記の説明用エンティティを定義する。 + +- 型`M` : [レイアウトマッピング](LayoutMapping.md)クラス +- 型`IT` : `M::extents_type::index_type` +- 値`m` : (const修飾された)`M`型の値 +- 値`M_rank` : `M::extents_type::rank()` +- オブジェクトのパック`valid_slices` : `sizeof...(valid_slices) == M_rank`であり、`m.extents()`の各次元インデクス`i`に対して`valid_slices...[i]`が`m.extents()`の`i`番目次元の有効な`submdspan`スライス +- オブジェクトのパック`invalid_slices` : `sizeof...(invalid_slices) == M_rank`であり、`invalid_slices...[k]`のcv非修飾型が下記いずれでもない整数`k`が存在する + - 型`IT` + - [`full_extent_t`](full_extent_t.md) + - [`constant_wrapper`](/reference/type_traits/constant_wrapper.md.nolink)の特殊化 + - [`strided_slice`](strided_slice.md)の特殊化 + +下記を満たすとき、型`M`はスライス可能レイアウトマッピング(sliceable layout mapping)要件を満たす。 + +- `M`が[レイアウトマッピング要件](LayoutMapping.md)を満たす +- 式`submdspan_mapping(m, invalid_slices...)`が不適格である +- 下記式が適格であり、かつ指定されたセマンティクスを持つこと : + + ```cpp + submdspan_mapping(m, valid_slices...) + ``` + + 下記を満たす型`SM`に対して`submdspan_mapping_result`の特殊化である型`SMR`をもつ。 + + - `SM`が[レイアウトマッピング要件](LayoutMapping.md)を満たす + - `SM::extents_type`が[`extents`](extents.md)の特殊化である + - `SM::extents_type::rank()`が[`MAP_RANK`](submdspan_canonicalize_slices.md)`(valid_slices, M_rank)`に等しい + - `SM::extents_type::index_type`が`IT`を表す + + 下記を満たす`SMR`型のオブジェクト`smr`を返す。 + + - `smr.mapping.extents() == submdspan_extents(m.extents(), valid_slices...)`、かつ + - `smr.mapping.extents()`の多次元インデクス値を表す整数パック`i`に対して、下記を満たす整数パック`j`に対し`smr.mapping(i...) + smr.offset == m(j)`が`true`となる + - `sizeof...(j)`が`M_rank`に等しく、かつ + - `m.extents()`の各次元インデクス`r`に対して、`j...[r]`が下記の総和に等しい + - `m.extents()`の`r`次元に対して`vaild_slices...[r]`の`submdspan`スライス範囲の下限、および + - `valid_slices...[r]`の型が[縮約スライス型(collapsing slice type)](submdspan_canonicalize_slices.md)ならば値`0`、そうでなければ`i...[`[`MAP_RANK`](submdspan_canonicalize_slices.md)`(valid_slices, r)]` + + +## バージョン +### 言語 +- C++26 + + +## 関連項目 +- [`submdspan`](submdspan.md) + + +## 参照 +- [P3663R3 Future-proof `submdspan_mapping`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3663r3.html) diff --git a/reference/mdspan/src-indices.md b/reference/mdspan/src-indices.md deleted file mode 100644 index 6e223978d8..0000000000 --- a/reference/mdspan/src-indices.md +++ /dev/null @@ -1,35 +0,0 @@ -# src-indices -* [meta exposition-only] -* mdspan[meta header] -* function template[meta id-type] -* cpp26[meta cpp] - -```cpp -template -constexpr array - src-indices(const array& indices, SliceSpecifiers ... slices); -``` -* array[link /reference/array/array.md] - -## 概要 -`src-indices`は[`submdspan`](submdspan.md)動作説明用の関数テンプレートである。 - - -## 適格要件 -`IndexType`は符号付き整数型または符号無し整数型であること。 - - -## 戻り値 -半開区間`[0, sizeof...(SliceSpecifiers))`の`k`に対して、`k`番目の要素が下記の値を持つ配列を返す。 - -- [`map-rank[k]`](submdspan_extents.md)が[`dynamic_extent`](/reference/span/dynamic_extent.md)に等しいとき、[`first_`](first_.md)`(slices...)` -- そうでなければ、[`first_`](first_.md)`(slices...) + indices[`[`map-rank[k]`](submdspan_extents.md)`]` - - -## バージョン -### 言語 -- C++26 - - -## 参照 -- [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) diff --git a/reference/mdspan/submdspan.md b/reference/mdspan/submdspan.md index 8182673bae..e34027df5f 100644 --- a/reference/mdspan/submdspan.md +++ b/reference/mdspan/submdspan.md @@ -39,42 +39,33 @@ namespace std { ## テンプレートパラメータ制約 -- `sizeof...(slices)`が[`Extents::rank()`](extents/rank.md)と等しく、かつ -- 評価されない文脈において式`submdspan_mapping(`[`src.mapping()`](mdspan/mapping.md)`, slices...)`が妥当な式であること。 +- `sizeof...(slices)`が[`Extents::rank()`](extents/rank.md)と等しい +- `LayoutPolicy::mapping`が[`sliceable-mapping`](sliceable-mapping.md)のモデルである。 ## 適格要件 -説明用の型`index_type`を[`Extents::index_type`](extents.md)、変数`sub_map_offset`を`submdspan_mapping(`[`src.mapping()`](mdspan/mapping.md)`, slices...)`の結果としたとき、 +`src`の各次元インデクス`k`に対して、 -- 型`decltype(submdspan_mapping(`[`src.mapping()`](mdspan/mapping.md)`, slices...))`が[`submdspan_mapping_result`](submdspan_mapping_result.md)の特殊化であり、 -- [`is_same_v`](/reference/type_traits/is_same.md)`<`[`remove_cvref_t`](/reference/type_traits/remove_cvref.md)`, decltype(`[`submdspan_extents`](submdspan_extents.md)`(`[`src.mapping()`](mdspan/mapping.md)`, slices...))>`が`true`、かつ -- [`src.extents()`](mdspan/extents.md)の各次元インデクス`k`において、`S_k`を`SliceSpecifiers`の`k`番目の型としたき、下記いずれかのうち1つだけを満たすこと。 - - 型`S_k`が[`convertible_to`](/reference/concepts/convertible_to.md)``のモデル - - 型`S_k`が[`index-pair-like`](index-pair-like.md)``のモデル - - [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` - - 型`S_k`が[`strided_slice`](strided_slice.md)の特殊化 +- `SliceSpecifiers...[k]`が`index_type`の`submdspan`スライス型であり、かつ +- `decltype(slices...[k])`が`Extents`のk番目の次元に対する有効な`submdspan`スライス型であること。 ## 事前条件 -- [`src.extents()`](mdspan/extents.md)の各次元インデクス`k`において、`S_k`を`SliceSpecifiers`の`k`番目の型、`s_k`を`slices`の`k`番目の値としたとき、下記を全て満たすこと。 - - 型`S_k`が[`strided_slice`](strided_slice.md)の特殊化のとき - - `s_k.extent == 0`、または - - `s_k.stride > 0` - - `0` ≤ [`first_`](first_.md)`(slices...)` ≤ [`last_`](last_.md)`(`[`src.extents()`](mdspan/extents.md)`, slices...)` ≤ [`src.extent(k)`](mdspan/extent.md) -- [`sub_map_offset.mapping`](submdspan_mapping_result.md)`.extents() ==` [`submdspan_extents`](submdspan_extents.md)`(`[`src.mapping()`](mdspan/mapping.md)`, slices...)`が`true`、かつ -- [`sub_map_offset.mapping`](submdspan_mapping_result.md)`.extents()`の多次元インデクス値を表す任意の整数パック`I`に対して、`sub_map_offset.mapping(I...) +` [`sub_map_offset.offset`](submdspan_mapping_result.md) `==` [`src.mapping()`](mdspan/mapping.md)`(`[`src-indices`](src-indices.md)`(`[`array`](/reference/array/array.md)`{I...}, slices...))`が`true`であること。 +[`src.extents()`](mdspan/extents.md)の各次元インデクス`k`に対して、`slices...[k]`が`src.extents()`のk番目の要素に対する有効な`submdspan`スライスであること。 ## 効果 以下と等価 ```cpp +auto [...slices] = submdspan_canonicalize_slices(src, raw_slices...); auto sub_map_offset = submdspan_mapping(src.mapping(), slices...); return mdspan(src.accessor().offset(src.data_handle(), sub_map_offset.offset), sub_map_offset.mapping, - AccessorPolicy::offset_policy(src.accessor())); + typename AccessorPolicy::offset_policy(src.accessor())); ``` * mdspan[link mdspan.md] +* submdspan_canonicalize_slices[link submdspan_canonicalize_slices.md] * sub_map_offset[link submdspan_mapping_result.md] * src.mapping()[link mdspan/mapping.md] * src.data_handle()[link mdspan/data_handle.md] @@ -286,3 +277,4 @@ int main() ## 参照 - [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) +- [P3663R3 Future-proof `submdspan_mapping`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3663r3.html) diff --git a/reference/mdspan/submdspan_canonicalize_slices.md b/reference/mdspan/submdspan_canonicalize_slices.md new file mode 100644 index 0000000000..2e4bf1b7e9 --- /dev/null +++ b/reference/mdspan/submdspan_canonicalize_slices.md @@ -0,0 +1,106 @@ +# submdspan_canonicalize_slices +* mdspan[meta header] +* function template[meta id-type] +* std[meta namespace] +* cpp26[meta cpp] + +```cpp +namespace std { + template + constexpr auto submdspan_canonicalize_slices( + const extents& src, Slices... slices); +} +``` +* extents[link extents.md] + +## 概要 +多次元配列サイズ[`extents`](extents.md)と各次元からの要素取り出し(スライス)情報を正規化する。 + +各次元からの要素取り出し方式は、[`submdspan`](submdspan.md)を参照のこと。 + +### `submdspan`スライス型 +符号付きもしくは符号なし整数型`IndexType`に対して、下記のうち少なくとも1つを満たすとき、型`S`は`IndexType`の`submdspan`スライス型(`submdspan` slice type)となる。 + +- [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` +- [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` +- `S`が[`strided_slice`](strided_slice.md)の特殊化であり、`X`が`S::offset_type`, `S::extent_type`, `S::stride_type`を表すとき[`is_convertible_v`](/reference/type_traits/is_convertible.md)``がいずれも`true` +- 以下を全て満たす + - 型`S`のオブジェクト`s`に対して、宣言`auto [...ls] = std::move(s);`が有効 + - `sizeof...(ls)`が`2`に等しい + - `(`[`is_convertible_v`](/reference/type_traits/is_convertible.md)` && ...)`が`true` + +### 正則`submdspan`スライス型 +符号付きもしくは符号なし整数型`IndexType`に対して、型`S`が`IndexType`もしくは値`0`以上の任意の値`v`を保持する[`constant_wrapper`](/reference/type_traits/constant_wrapper.md.nolink)であるとき、型`S`は`IndexType`の正則`submdspan`インデクス型となる。 + +符号付きもしくは符号なし整数型`IndexType`に対して、下記のうちただ1つだけを満たすとき、型`S`は`IndexType`の正則`submdspan`スライス型(canonical `submdspan` slice type)となる。 + +- `S`が[`full_extent_t`](full_extent_t.md) +- `S`が`IndexType`の正則`submdspan`インデクス型である +- `S`が[`strided_slice`](strided_slice.md)の特殊化であり、下記を全て満たす + - `S::offset_type`, `S::extent_type`, `S::stride_type`が、全て`IndexType`の正則`submdspan`インデクス型である + - `S::stride_type`および`S::extent_type`がいずれも[`constant_wrapper`](/reference/type_traits/constant_wrapper.md.nolink)の特殊化であり、`S::stride_type::value`が`0`より大きい + +### 縮約スライス型と`MAP_RANK` +ある型が[`full_extent_t`](full_extent_t.md)ないし[`strided_slice`](strided_slice.md)の特殊化いずれでもないとき、縮約スライス型(collapsing slice type)となる。 + +パック`p`と整数`i`に対して、説明用の`MAP_RANK(p, i)`を`0 <= j < `のうち縮約スライス型ではない要素`p...[j]`の個数とする。 + +### 有効`submdspan`スライス型 +[`extents`](extents.md)の特殊化である型`E`に対して、型`S`が`E::index_type`の正則スライス型であり、かつ`E::static_extent(k)`に等しい`x`に対して`x`が`dynamic_extent`に等しいか下記を満たすとき、型`S`は`E`の`k`番目次元の有効`submdspan`スライス型(valid `submdspan` slice type)となる。 + +- `S`が[`strided_slice`](strided_slice.md)の特殊化であるとき : + - `S::offset_type`が[`constant_wrapper`](/reference/type_traits/constant_wrapper.md.nolink)の特殊化であるとき、`S::offset_type::value`が`x`以下 + - `S::extent_type`が[`constant_wrapper`](/reference/type_traits/constant_wrapper.md.nolink)の特殊化であるとき、`S::extent_type::value`が`x`以下 + - `S::offset_type`および`S::extent_type`が[`constant_wrapper`](/reference/type_traits/constant_wrapper.md.nolink)の特殊化であるとき、`S::offset_type::value + S::extent_type::value`が`x`以下 +- `S`が[`constant_wrapper`](/reference/type_traits/constant_wrapper.md.nolink)の特殊化であるとき、`S::value`が`x`より小さい + +### 有効`submdspan`スライス +[`extents`](extents.md)の特殊化である型`E`のオブジェクト`e`と、型`S`のオブジェクト`s`に対して、下記を満たすとき`s`は`e`の`k`番目次元の有効`submdspan`スライス(valid `submdspan` slice)となる。 + +- `S`が`E`の`k`番目次元の有効`submdspan`スライス型 +- `e`の`k`番目区間が、`e`の`k`番目次元に対して`s`の`submdspan`スライス範囲を含む +- `S`が[`strided_slice`](strided_slice.md)の特殊化であるとき : + - `s.extent`が値`0`以上であり、かつ + - `s.extents`が値`0`に等しい、もしくは`s.stride`が値`0`より大きい + + +## テンプレートパラメータ制約 +`sizeof...(SliceSpecifiers)`が`sizeof...(Extents)`と等しいこと。 + + +## 適格要件 +`src`の各次元インデクス`k`に対して、 + +- `SliceSpecifiers...[k]`が`IndexType`の`submdspan`スライス型であり、かつ +- `decltype(`[`cannonical-slice`](canonical-slice.md)`(slices...[k]))`が[`extents`](extents.md)``のk番目次元の有効`submdspan`スライス型(valid `submdspan` slice type)であること。 + + +## 事前条件 +`src`の各次元インデクス`k`に対して、[`cannonical-slice`](canonical-slice.md)`(slices...[k])`が`src`のk番目次元の有効`submdspan`スライス(valid `submdspan` slice)であること。 + + +## 戻り値 +```cpp +make_tuple(canonical-slice(slices)...) +``` +* make_tuple[link /reference/tuple/make_tuple.md] +* canonical-slice[link canonical-slice.md] + + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): ?? +- [GCC](/implementation.md#gcc): ?? +- [ICC](/implementation.md#icc): ?? +- [Visual C++](/implementation.md#visual_cpp): ?? + + +## 関連項目 +- [`submdspan`](submdspan.md) + + +## 参照 +- [P3663R3 Future-proof `submdspan_mapping`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3663r3.html) diff --git a/reference/mdspan/submdspan_extents.md b/reference/mdspan/submdspan_extents.md index 4c885ac344..8467d5db46 100644 --- a/reference/mdspan/submdspan_extents.md +++ b/reference/mdspan/submdspan_extents.md @@ -6,8 +6,9 @@ ```cpp namespace std { - template - constexpr auto submdspan_extents(const extents& src, SliceSpecifiers ... slices); + template + constexpr auto submdspan_extents(const extents& src, + SliceSpecifiers... raw_slices); } ``` * extents[link extents.md] @@ -17,54 +18,44 @@ namespace std { 各次元からの要素取り出し方式は、[`submdspan`](submdspan.md)を参照のこと。 -### 動作説明用 -- 型`S_k` : `SliceSpecifiers`の`k`番目の型 -- 値`s_k` : `slices`の`k`番目の値 -- 値`map-rank` : `k`番目の要素`map-rank[k]`が下記を満たす、[`array`](/reference/array/array.md)``型の配列値 - - 型`S_k`が[`convertible_to`](/reference/concepts/convertible_to.md)``のモデルのとき[`dynamic_extent`](/reference/span/dynamic_extent.md)、そうでなければ - - `j < k`において型`S_j`が[`convertible_to`](/reference/concepts/convertible_to.md)``のモデルではない個数 +説明用のパック`slices`を以下の通り宣言する。 -動作説明用の配列`map-rank[]`は、変換元の次元インデクス`k`から変換先の次元インデクスへの対応関係を表現している。要素値`dynamic_extent`は変換により削減される次元を表す。 +```cpp +auto [...slices] = submdspan_canonicalize_slices(src, raw_slices...); +``` +* submdspan_canonicalize_slices[link submdspan_canonicalize_slices.md] ## テンプレートパラメータ制約 -`sizeof...(slices)`が`Extents::rank()`と等しいこと。 +`sizeof...(SliceSpecifiers)`が`sizeof...(Extents)`と等しいこと。 ## 適格要件 -`src`の各次元インデクス`k`に対して、下記いずれかのうち1つだけを満たすこと。 +`src`の各次元インデクス`k`に対して、 -- 型`S_k`が[`convertible_to`](/reference/concepts/convertible_to.md)``のモデル -- 型`S_k`が[`index-pair-like`](index-pair-like.md)``のモデル -- [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true` -- 型`S_k`が[`strided_slice`](strided_slice.md)の特殊化 +- `SliceSpecifiers...[k]`が`IndexType`の`submdspan`スライス型であり、かつ +- `decltype(slices...[k])`が[`extents`](extents.md)``のk番目次元の[有効`submdspan`スライス型(valid `submdspan` slice type)](submdspan_canonicalize_slices.md)であること。 ## 事前条件 -`src`の各次元インデクス`k`に対して、下記を全て満たすこと。 - -- 型`S_k`が[`strided_slice`](strided_slice.md)の特殊化のとき - - `s_k.extent == 0`、または - - `s_k.stride > 0` -- `0` ≤ [`first_`](first_.md)`(slices...)` ≤ [`last_`](last_.md)`(src, slices...)` ≤ [`src.extent(k)`](extents/extent.md) +`src`の各次元インデクス`k`に対して、`slices...[k]`が`src`のk番目次元の[有効`submdspan`スライス(valid `submdspan` slice)](submdspan_canonicalize_slices.md)であること。 ## 戻り値 説明用の型`SubExtents`を、下記を満たす[`extents`](extents.md)の特殊化とする。 -- [`SubExtents::rank()`](extents/rank.md)は、型`S_k`が[`convertible_to`](/reference/concepts/convertible_to.md)``のモデルではない`k`の個数に等しく、かつ -- `map-rank[k] !=` [`dynamic_extent`](/reference/span/dynamic_extent.md)を満たす`Extents`の次元インデクス`k`について、[`SubExtents::static_extent`](extents/static_extent.md)`(map-rank[k])`が下記と等しいこと - - [`is_convertible_v`](/reference/type_traits/is_convertible.md)``が`true`のとき、[`SubExtents::static_extent`](extents/static_extent.md)`(k)`、そうでなければ、 - - 型`S_k`が[`index-pair-like`](index-pair-like.md)のモデルかつ`tuple_element_t<0, S_k>`および`tuple_element_t<1, S_k>`がいずれも[`integral-constant-like`](/reference/span/integral-constant-like.md)のモデルであるとき、[`de-ice`](de-ice.md)`(tuple_element_t<1, S_k>) -` [`de-ice`](de-ice.md)`(tuple_element_t<0, S_k>)`、そうでなければ - - 型`S_k`が[`strided_slice`](strided_slice.md)の特殊化かつメンバ型`extent_type`が`S_k::extent_type() == 0`かつ[`integral-constant-like`](/reference/span/integral-constant-like.md)のモデルであるとき、値`0`、そうでなければ - - 型`S_k`が[`strided_slice`](strided_slice.md)の特殊化かつメンバ型`extent_type`および`stride_type`がいずれも[`integral-constant-like`](/reference/span/integral-constant-like.md)のモデルであるとき、`1 + (`[`de-ice`](de-ice.md)`(S_k::extent_type()) - 1) /` [`de-ice`](de-ice.md)`(S_k::stride_type())`、そうでなければ - - [`dynamic_extent`](/reference/span/dynamic_extent.md) +- [`SubExtents::rank()`](extents/rank.md)が[`MAP_RANK`](submdspan_canonicalize_slices.md)`(slices, Extents::rank())`に等しく、かつ +- `slices...[k]`の型が[縮約スライス型(collapsing slice type)](submdspan_canonicalize_slices.md)ではない`Extents`の各次元インデクス`k`に対して、説明用の`S_k`を`slices...[k]`の型としたとき、[`SubExtents::static_extent`](extents/static_extent.md)`(`[`MAP_RANK`](submdspan_canonicalize_slices.md)`(slices, k))`が下記と等しいこと。 + - 型`S_k`が[`full_extent_t`](full_extent_t.md)のとき、[`SubExtents::static_extent`](extents/static_extent.md)`(k)`、そうでなければ、 + - 型`S_k`が[`strided_slice`](strided_slice.md)の特殊化かつメンバ型`S_k::extent_type`が[`constant_wrapper`](/reference/type_traits/constant_wrapper.md.nolink)``のとき、値`0`、そうでなければ + - 型`S_k`が[`strided_slice`](strided_slice.md)の特殊化かつメンバ型`extent_type`および`stride_type`がいずれも[`constant_wrapper`](/reference/type_traits/constant_wrapper.md.nolink)の特殊化であるとき、`1 + ((S_k::extent_type::value - 1) / S_k::stride_type::value)` + - そうでなければ、[`dynamic_extent`](/reference/span/dynamic_extent.md) 以下を満たす`SubExtents`型の値`ext`を返す。 -- `map-rank[k] !=` [`dynamic_extent`](/reference/span/dynamic_extent.md)を満たす次元インデクス`k`について、[`ext.extent`](extents/extent.md)`(map-rank[k])`が下記に等しいこと - - 型`S_k`が[`strided_slice`](strided_slice.md)の特殊化であるとき、`s_k.extent == 0 ? 0 : 1 + (`[`de-ice`](de-ice.md)`(s_k.extent) - 1) /` [`de-ice`](de-ice.md)`(s_k.stride)` - - そうでなければ、[`last_`](last_.md)`(src, slices...) -` [`first_`](first_.md)`(slices...)` +- `slices...[k]`の型が[縮約スライス型(collapsing slice type)](submdspan_canonicalize_slices.md)ではない`extents`の各次元インデクス`k`について、説明用の`s_k`を`slices...[k]`としたとき、[`ext.extent`](extents/extent.md)`(`[`MAP_RANK`](submdspan_canonicalize_slices.md)`(slices, k))`が下記に等しいこと。 + - `s_k`の型が[`strided_slice`](strided_slice.md)の特殊化であるとき、`s_k.extent == 0 ? 0 : 1 + (s_k.extent - 1) / s_k.stride` + - そうでなければ、`src`のk番目の要素に対して`submdspan`スライス範囲である半開区間`[L, U)`に対して、`U - L` ## 例 @@ -131,3 +122,4 @@ int main() ## 参照 - [P2630R4 Submdspan](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2630r4.html) +- [P3663R3 Future-proof `submdspan_mapping`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3663r3.html) From e6ae6328970cd24f21e8ab6f410869d084725e84 Mon Sep 17 00:00:00 2001 From: yoh Date: Tue, 31 Mar 2026 23:35:28 +0900 Subject: [PATCH 2671/3948] =?UTF-8?q?mdspan:=20P3663R3=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=20=E8=AA=BF=E6=95=B4=20(#1567)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/mdspan/canonical-slice.md | 2 +- reference/mdspan/layout_left/mapping/submdspan_mapping.md | 2 +- .../mdspan/layout_left_padded/mapping/submdspan_mapping.md | 2 +- reference/mdspan/layout_right/mapping/submdspan_mapping.md | 2 +- .../mdspan/layout_right_padded/mapping/submdspan_mapping.md | 2 +- reference/mdspan/sliceable-mapping.md | 4 ++-- reference/mdspan/submdspan_canonicalize_slices.md | 4 ++-- working_style.md | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/reference/mdspan/canonical-slice.md b/reference/mdspan/canonical-slice.md index 30b8c7a436..9851624efa 100644 --- a/reference/mdspan/canonical-slice.md +++ b/reference/mdspan/canonical-slice.md @@ -14,7 +14,7 @@ constexpr auto canonical-slice(S s); ## 適格要件 -`S`が`IndexType`の`submdspan`スライス型であること。 +`S`が`IndexType`の[`submdspan`スライス型](submdspan_canonicalize_slices.md)であること。 ## 効果 diff --git a/reference/mdspan/layout_left/mapping/submdspan_mapping.md b/reference/mdspan/layout_left/mapping/submdspan_mapping.md index 4e4fe550f3..de47a5bb70 100644 --- a/reference/mdspan/layout_left/mapping/submdspan_mapping.md +++ b/reference/mdspan/layout_left/mapping/submdspan_mapping.md @@ -46,7 +46,7 @@ friend constexpr auto submdspan_mapping( - パック`ls` : `extents()`の次元`r`に対して、`r`番目の要素が`slices...[r]`の`submdspan`スライス範囲の下限に等しい`index_type`型の値パック - 値`offset` : `extents()`における任意の次元インデクス`k`に対して`ls...[k]`が`extents().extent(k)`と等しいとき、`required_span_size()`に等しい`size_t`型の値。そうでなければ、[`operator()`](op_call.md)に等しい`size_t`型の値。 -下記を満たす型`S`を、単位ストライド幅スライス型(unit-stride slice type)と定義する。 +下記を満たす型`S`を、単位ストライド幅スライス型と定義する。 - `S`が[`strided_slice`](../../strided_slice.md)の特殊化であり、`S::stride_type`が[`constant_wrapper`](/reference/type_traits/constant_wrapper.md.nolink)の特殊化かつ`S::stride_type::value`が`1`、または - `S`が[`full_extent_t`](../../full_extent_t.md) diff --git a/reference/mdspan/layout_left_padded/mapping/submdspan_mapping.md b/reference/mdspan/layout_left_padded/mapping/submdspan_mapping.md index 8c2009911e..2cd6724385 100644 --- a/reference/mdspan/layout_left_padded/mapping/submdspan_mapping.md +++ b/reference/mdspan/layout_left_padded/mapping/submdspan_mapping.md @@ -46,7 +46,7 @@ friend constexpr auto submdspan_mapping( - パック`ls` : `extents()`の次元`r`に対して、`r`番目の要素が`slices...[r]`の`submdspan`スライス範囲の下限に等しい`index_type`型の値パック - 値`offset` : `extents()`における任意の次元インデクス`k`に対して`ls...[k]`が`extents().extent(k)`と等しいとき、`required_span_size()`に等しい`size_t`型の値。そうでなければ、[`operator()`](op_call.md)に等しい`size_t`型の値。 -下記を満たす型`S`を、単位ストライド幅スライス型(unit-stride slice type)と定義する。 +下記を満たす型`S`を、単位ストライド幅スライス型と定義する。 - `S`が[`strided_slice`](../../strided_slice.md)の特殊化であり、`S::stride_type`が[`constant_wrapper`](/reference/type_traits/constant_wrapper.md.nolink)の特殊化かつ`S::stride_type::value`が`1`、または - `S`が[`full_extent_t`](../../full_extent_t.md) diff --git a/reference/mdspan/layout_right/mapping/submdspan_mapping.md b/reference/mdspan/layout_right/mapping/submdspan_mapping.md index 8b99e9e876..c5d6788afe 100644 --- a/reference/mdspan/layout_right/mapping/submdspan_mapping.md +++ b/reference/mdspan/layout_right/mapping/submdspan_mapping.md @@ -46,7 +46,7 @@ friend constexpr auto submdspan_mapping( - パック`ls` : `extents()`の次元`r`に対して、`r`番目の要素が`slices...[r]`の`submdspan`スライス範囲の下限に等しい`index_type`型の値パック - 値`offset` : `extents()`における任意の次元インデクス`k`に対して`ls...[k]`が`extents().extent(k)`と等しいとき、`required_span_size()`に等しい`size_t`型の値。そうでなければ、[`operator()`](op_call.md)に等しい`size_t`型の値。 -下記を満たす型`S`を、単位ストライド幅スライス型(unit-stride slice type)と定義する。 +下記を満たす型`S`を、単位ストライド幅スライス型と定義する。 - `S`が[`strided_slice`](../../strided_slice.md)の特殊化であり、`S::stride_type`が[`constant_wrapper`](/reference/type_traits/constant_wrapper.md.nolink)の特殊化かつ`S::stride_type::value`が`1`、または - `S`が[`full_extent_t`](../../full_extent_t.md) diff --git a/reference/mdspan/layout_right_padded/mapping/submdspan_mapping.md b/reference/mdspan/layout_right_padded/mapping/submdspan_mapping.md index 2109ce2714..783e777928 100644 --- a/reference/mdspan/layout_right_padded/mapping/submdspan_mapping.md +++ b/reference/mdspan/layout_right_padded/mapping/submdspan_mapping.md @@ -46,7 +46,7 @@ friend constexpr auto submdspan_mapping( - パック`ls` : `extents()`の次元`r`に対して、`r`番目の要素が`slices...[r]`の`submdspan`スライス範囲の下限に等しい`index_type`型の値パック - 値`offset` : `extents()`における任意の次元インデクス`k`に対して`ls...[k]`が`extents().extent(k)`と等しいとき、`required_span_size()`に等しい`size_t`型の値。そうでなければ、[`operator()`](op_call.md)に等しい`size_t`型の値。 -下記を満たす型`S`を、単位ストライド幅スライス型(unit-stride slice type)と定義する。 +下記を満たす型`S`を、単位ストライド幅スライス型と定義する。 - `S`が[`strided_slice`](../../strided_slice.md)の特殊化であり、`S::stride_type`が[`constant_wrapper`](/reference/type_traits/constant_wrapper.md.nolink)の特殊化かつ`S::stride_type::value`が`1`、または - `S`が[`full_extent_t`](../../full_extent_t.md) diff --git a/reference/mdspan/sliceable-mapping.md b/reference/mdspan/sliceable-mapping.md index b894148a34..f086584e28 100644 --- a/reference/mdspan/sliceable-mapping.md +++ b/reference/mdspan/sliceable-mapping.md @@ -43,7 +43,7 @@ concept sliceable-mapping = see below; submdspan_mapping(m, valid_slices...) ``` - 下記を満たす型`SM`に対して`submdspan_mapping_result`の特殊化である型`SMR`をもつ。 + 下記を満たす型`SM`に対して[`submdspan_mapping_result`](submdspan_mapping_result.md)``の特殊化である型`SMR`をもつ。 - `SM`が[レイアウトマッピング要件](LayoutMapping.md)を満たす - `SM::extents_type`が[`extents`](extents.md)の特殊化である @@ -52,7 +52,7 @@ concept sliceable-mapping = see below; 下記を満たす`SMR`型のオブジェクト`smr`を返す。 - - `smr.mapping.extents() == submdspan_extents(m.extents(), valid_slices...)`、かつ + - `smr.mapping.extents() ==` [`submdspan_extents`](submdspan_extents.md)`(m.extents(), valid_slices...)`、かつ - `smr.mapping.extents()`の多次元インデクス値を表す整数パック`i`に対して、下記を満たす整数パック`j`に対し`smr.mapping(i...) + smr.offset == m(j)`が`true`となる - `sizeof...(j)`が`M_rank`に等しく、かつ - `m.extents()`の各次元インデクス`r`に対して、`j...[r]`が下記の総和に等しい diff --git a/reference/mdspan/submdspan_canonicalize_slices.md b/reference/mdspan/submdspan_canonicalize_slices.md index 2e4bf1b7e9..f72ed0f588 100644 --- a/reference/mdspan/submdspan_canonicalize_slices.md +++ b/reference/mdspan/submdspan_canonicalize_slices.md @@ -43,7 +43,7 @@ namespace std { ### 縮約スライス型と`MAP_RANK` ある型が[`full_extent_t`](full_extent_t.md)ないし[`strided_slice`](strided_slice.md)の特殊化いずれでもないとき、縮約スライス型(collapsing slice type)となる。 -パック`p`と整数`i`に対して、説明用の`MAP_RANK(p, i)`を`0 <= j < `のうち縮約スライス型ではない要素`p...[j]`の個数とする。 +パック`p`と整数`i`に対して、説明用の`MAP_RANK(p, i)`を`0 <= j < i`のうち縮約スライス型ではない要素`p...[j]`の個数とする。 ### 有効`submdspan`スライス型 [`extents`](extents.md)の特殊化である型`E`に対して、型`S`が`E::index_type`の正則スライス型であり、かつ`E::static_extent(k)`に等しい`x`に対して`x`が`dynamic_extent`に等しいか下記を満たすとき、型`S`は`E`の`k`番目次元の有効`submdspan`スライス型(valid `submdspan` slice type)となる。 @@ -61,7 +61,7 @@ namespace std { - `e`の`k`番目区間が、`e`の`k`番目次元に対して`s`の`submdspan`スライス範囲を含む - `S`が[`strided_slice`](strided_slice.md)の特殊化であるとき : - `s.extent`が値`0`以上であり、かつ - - `s.extents`が値`0`に等しい、もしくは`s.stride`が値`0`より大きい + - `s.extent`が値`0`に等しい、もしくは`s.stride`が値`0`より大きい ## テンプレートパラメータ制約 diff --git a/working_style.md b/working_style.md index b0209396ba..2265d43920 100644 --- a/working_style.md +++ b/working_style.md @@ -154,7 +154,7 @@ C++11以降対応については対応バージョンを明記します。バー | trait | トレイト | | trivial | トリビアル (逆は非トリビアル) | | underlying type | 基底型 | -| unit-stride slice | 単位ストライド幅スライス | +| unit-stride slice type | 単位ストライド幅スライス型 | | unordered associative container(s) | 非順序連想コンテナ | | unspecified | 未規定 | | program-defined type | プログラム定義型 | From dacd61999e6e35cd350ac04ab8f7bebfc148a642 Mon Sep 17 00:00:00 2001 From: Akiko Kawai Date: Wed, 1 Apr 2026 10:50:58 +0900 Subject: [PATCH 2672/3948] Update implementation status for C++23 features (MSVC) --- implementation-status.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/implementation-status.md b/implementation-status.md index b84d030ea4..e3a9f07df2 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -242,11 +242,11 @@ | 言語機能 | 説明 | [GCC][gcc] | [Clang][clang] | [ICX][icx] | [MSVC][msvc] | |----------|------|------------|----------------|------------|--------------| | P0330R8: [(符号付き)`size_t`リテラルのためのサフィックス](/lang/cpp23/literal_suffix_for_signed_size_t.md) | `42z`/`42Z`とすることで`size_t`に対応する符号付き整数型のリテラルとする | 11 | 13 | 2022.2 | 2022 Update 13 | -| P2290R3: [エスケープシーケンスの区切り](/lang/cpp23/delimited_escape_sequences.md) | エスケープシーケンスの範囲を明確にする構文を追加する | 13 | 15 | 2023.2 | - | -| P2266R3: [暗黙的なムーブを簡略化](/lang/cpp23/simpler_implicit_move.md) | 参照を返す関数の`return`文で暗黙的にムーブされない問題を修正 | 13 | 13 | 2022.2 | - | +| P2290R3: [エスケープシーケンスの区切り](/lang/cpp23/delimited_escape_sequences.md) | エスケープシーケンスの範囲を明確にする構文を追加する | 13 | 15 | 2023.2 | 2026 | +| P2266R3: [暗黙的なムーブを簡略化](/lang/cpp23/simpler_implicit_move.md) | 参照を返す関数の`return`文で暗黙的にムーブされない問題を修正 | 13 | 13 | 2022.2 | 2026 | | P1787R6: [スコープと名前ルックアップの仕様整理](/lang/cpp23/declarations_and_where_to_find_them.md.nolink) | 複雑で不完全になっているスコープと名前ルックアップの仕様を整理し、一部の問題を解決する | - | - | - | - | | P2615R1: [無意味なexport宣言を禁止する](/lang/cpp23/meaningful_exports.md) | いくつかの不必要な宣言に対するモジュールexportを禁止する | - | - | - | - | -| P2360R0: [初期化文での型の別名宣言を許可](/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md) | `for (using T = int; T e : v) {}`を許可 | 12 | 14 | 2022.2 | - | +| P2360R0: [初期化文での型の別名宣言を許可](/lang/cpp23/extend_init_statement_to_allow_alias_declaration.md) | `for (using T = int; T e : v) {}`を許可 | 12 | 14 | 2022.2 | 2026 | | P2718R0: [範囲for文が範囲初期化子内で生じた一時オブジェクトを延命することを規定](lang/cpp23/lifetime_extension_in_range_based_for_loop.md) | 範囲初期化子内で生じた一時オブジェクトは範囲for文の終わりまで延命される | - | 20 | - | - | | P2324R2: [複合文の末尾へのラベルを許可](/lang/cpp23/labels_at_the_end_of_compound_statements.md) | C互換のため、複合文の末尾でのgoto文のラベルを許可する | 13 | 16 | 2023.2 | - | | P0847R7: [自身のオブジェクトを明示的にパラメータとして指定する](/lang/cpp23/deducing_this.md.nolink) | メンバ関数が`*this`の型・オブジェクトをパラメータとしてとり、`*this`オブジェクトがconst/非const、左辺値/右辺値であるかをメンバ関数内で識別できるようにする | - | 18 | - | 2022 Update 2 (partial) | @@ -273,7 +273,7 @@ | P2334R1: [`elif`/`elifdef`/`elifndef`のサポートを追加](/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md) | `#if`/`#ifdef`/`#ifndef`に対応する複数条件命令のサポートを追加する | 12 | 13 | 2022.2 | 2022 Update 10 | | P2437R1: [`#warning`のサポートを追加](/lang/cpp23/warning.md) | 多くのC++コンパイラが実装していたプリプロセス時の警告`#warning message`を正式サポート | yes | yes | 2023.2 | yes | | P2295R6: [汎用的なソースコードのエンコーディングとしてUTF-8をサポート](/lang/cpp23/support_for_utf8_as_a_portable_source_file_encoding.md) | すべてのコンパイラはUTF-8文字コードのソースコードをサポートしなければならない | 13 | 15 | 2023.2 | 2019 Update 2 | -| P2223R2: [行末スペースを無視するよう規定](/lang/cpp23/trimming_whitespaces_before_line_splicing.md) | 行末が「\ 」でおわっていた場合にMSVCは行の継続をしない実装になっていたため動作を共通化するため仕様を規定 | Yes | Yes | 2022.2 | - | +| P2223R2: [行末スペースを無視するよう規定](/lang/cpp23/trimming_whitespaces_before_line_splicing.md) | 行末が「\ 」でおわっていた場合にMSVCは行の継続をしない実装になっていたため動作を共通化するため仕様を規定 | Yes | Yes | 2022.2 | 2026 | 各処理系のC++23実装状況ページ: From db312a9ba8b7eb9adc8753f1715bce3d1c2f2f72 Mon Sep 17 00:00:00 2001 From: Akiko Kawai Date: Wed, 1 Apr 2026 10:56:37 +0900 Subject: [PATCH 2673/3948] Add Microsoft C/C++ language conformance links --- implementation-status.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/implementation-status.md b/implementation-status.md index e3a9f07df2..07cdd414de 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -233,6 +233,7 @@ - libstdc++: [C++ 2020 Implementation Status](https://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#status.iso.2020) - libc++: [libc++ C++20 Status](https://libcxx.llvm.org/Status/Cxx20.html) - Visual C++ (MSVC): + - [Microsoft C/C++ language conformance by Visual Studio version](https://learn.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance?view=msvc-170) - [Visual C++ 言語への準拠](https://docs.microsoft.com/ja-jp/cpp/visual-cpp-language-conformance) - [次リリース情報(VS2019,2022) - Change log](https://github.com/microsoft/STL/wiki/Changelog) - ICC: [C++20 Features Supported by Intel® C++ Compiler](https://www.intel.com/content/www/us/en/developer/articles/technical/c20-features-supported-by-intel-cpp-compiler.html) @@ -281,6 +282,7 @@ - GCC: [C++23 Support in GCC](https://gcc.gnu.org/projects/cxx-status.html#cxx23) - Clang: [C++23 implementation status](https://clang.llvm.org/cxx_status.html#cxx23) - Visual C++ (MSVC): + - [Microsoft C/C++ language conformance by Visual Studio version](https://learn.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance?view=msvc-170) - [C++ Conformance improvements, behavior changes, and bug fixes in Visual Studio 2022](https://learn.microsoft.com/en-us/cpp/overview/cpp-conformance-improvements?view=msvc-170) - [C++ Language Updates in MSVC in Visual Studio 2022 17.13](https://devblogs.microsoft.com/cppblog/msvc-compiler-updates-in-visual-studio-2022-version-17-13/) - [MSVC Compiler Language Updates in Visual Studio 2022 version 17.12](https://devblogs.microsoft.com/cppblog/msvc-compiler-language-updates-in-visual-studio-2022-version-17-12/) @@ -338,6 +340,7 @@ - [C++2c implementation status](https://clang.llvm.org/cxx_status.html#cxx26) - [libc++ Format Status](https://libcxx.llvm.org/Status/Format.html) - Visual C++ (MSVC): + - [Microsoft C/C++ language conformance by Visual Studio version](https://learn.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance?view=msvc-170) - [C++ Conformance improvements, behavior changes, and bug fixes in Visual Studio 2022](https://learn.microsoft.com/en-us/cpp/overview/cpp-conformance-improvements?view=msvc-170) From 95faa017bbda880f37192b63b16f6442c1c47ab9 Mon Sep 17 00:00:00 2001 From: Akiko Kawai Date: Wed, 1 Apr 2026 11:09:31 +0900 Subject: [PATCH 2674/3948] Update implementation status for P1236R1 and P2437R1 --- implementation-status.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/implementation-status.md b/implementation-status.md index 07cdd414de..f66feeabef 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -200,7 +200,7 @@ | P1330R0: [定数式内での共用体のアクティブメンバの変更を許可](/lang/cpp20/changing_the_active_member_of_a_union_inside_constexpr.md) | 共用体メンバの書き換えを定数式内で行えるようにする | 9 | 9.0 | 2021.4 | 2017 | | P1008R1: [ユーザー宣言したコンストラクタを持つクラスの集成体初期化を禁止](/lang/cpp20/prohibit_aggregates_with_user-declared_constructors.md) | コンストラクタが`delete`/`default`宣言されているクラスを、集成体初期化によってコンストラクタ呼び出しを回避して構築できてしまっていた技法を禁止 | 9 | 8.0 | 2021.4 | 2019 | | P0892R2: [関数を条件付きで`explicit`にする構文を追加](/lang/cpp20/explicit_bool.md) | `explicit(true)`のように`explicit`に真理値パラメータを指定できるようにする | 9 | 9.0 | 2021.4 | 2019 Update 2 | -| P1236R1: [符号付き整数型が2の補数表現であることを規定](/lang/cpp20/signed_integers_are_twos_complement.md) | 符号付き整数型のビット表現を2の補数に規定する | 9 | 9.0 | 2023.0 | | +| P1236R1: [符号付き整数型が2の補数表現であることを規定](/lang/cpp20/signed_integers_are_twos_complement.md) | 符号付き整数型のビット表現を2の補数に規定する | 9 | 9.0 | 2023.0 | 2022 Update 14 | | P0482R6: [UTF-8エンコーディングされた文字の型として`char8_t`を追加](/lang/cpp20/char8_t.md) | UTF-8エンコードされた文字かどうかでオーバーロード・特殊化をできるようにする | 9 | 7 (`-fchar8_t`オプションが必要) | 2021.4 | 2019 Update 2 | | P1094R2: [入れ子名前空間定義でのインライン名前空間](/lang/cpp20/nested_inline_mamespaces.md) | `namespace ns1::inline ns2::ns3 {}`のように、入れ子名前空間を定義する式にインライン名前空間の指定を含められるようにする | 9 | 8.0 | 2021.4 | 2019 Update 7 | | P1091R3: [構造化束縛を拡張して通常の変数宣言のように使用できるようにする](/lang/cpp20/extending_structured_bindings_to_be_more_like_variable_declarations.md) | 記憶域指定子として`static`と`thread_local`の指定を許可 | 10 | 8.0 (partial) | 2021.4 | 2019 Update 4 | @@ -272,7 +272,7 @@ | P1774R8: [コード内容の仮定をコンパイラに伝えるassume属性](/lang/cpp23/portable_assumptions.md) | 最適化のために、コードの仮定をコンパイラに伝える属性を標準化する | 13 | 19 | - | - | | P2316R2: [文字リテラルエンコーディングを一貫させる](/lang/cpp23/consistent_character_literal_encoding.md) | プリプロセッサの条件式での文字リテラルの扱いをC++式と同様にする | yes | yes | 2022.2 | 2022 | | P2334R1: [`elif`/`elifdef`/`elifndef`のサポートを追加](/lang/cpp23/add_support_for_preprocessing_directives_elifdef_and_elifndef.md) | `#if`/`#ifdef`/`#ifndef`に対応する複数条件命令のサポートを追加する | 12 | 13 | 2022.2 | 2022 Update 10 | -| P2437R1: [`#warning`のサポートを追加](/lang/cpp23/warning.md) | 多くのC++コンパイラが実装していたプリプロセス時の警告`#warning message`を正式サポート | yes | yes | 2023.2 | yes | +| P2437R1: [`#warning`のサポートを追加](/lang/cpp23/warning.md) | 多くのC++コンパイラが実装していたプリプロセス時の警告`#warning message`を正式サポート | yes | yes | 2023.2 | 2026 | | P2295R6: [汎用的なソースコードのエンコーディングとしてUTF-8をサポート](/lang/cpp23/support_for_utf8_as_a_portable_source_file_encoding.md) | すべてのコンパイラはUTF-8文字コードのソースコードをサポートしなければならない | 13 | 15 | 2023.2 | 2019 Update 2 | | P2223R2: [行末スペースを無視するよう規定](/lang/cpp23/trimming_whitespaces_before_line_splicing.md) | 行末が「\ 」でおわっていた場合にMSVCは行の継続をしない実装になっていたため動作を共通化するため仕様を規定 | Yes | Yes | 2022.2 | 2026 | From cfac0234a3a5770d27d68936cdf2408d3884f964 Mon Sep 17 00:00:00 2001 From: teruyamato0731 <77840326+teruyamato0731@users.noreply.github.com> Date: Thu, 2 Apr 2026 00:00:42 +0900 Subject: [PATCH 2675/3948] =?UTF-8?q?feat:=20`std::ranges::minmax`?= =?UTF-8?q?=E3=81=AE=E3=82=B3=E3=83=BC=E3=83=89=E4=BE=8B=E3=81=AE=E3=83=80?= =?UTF-8?q?=E3=83=B3=E3=82=B0=E3=83=AA=E3=83=B3=E3=82=B0=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E3=80=81=E3=81=8A=E3=82=88=E3=81=B3=E4=B8=80=E6=99=82=E3=82=AA?= =?UTF-8?q?=E3=83=96=E3=82=B8=E3=82=A7=E3=82=AF=E3=83=88=E3=82=92=E6=B8=A1?= =?UTF-8?q?=E3=81=97=E3=81=9F=E9=9A=9B=E3=81=AE=E5=82=99=E8=80=83=E3=81=AE?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20(#1597)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(algorithm/ranges_minmax): `ranges::minmax`呼び出しのダングリングに関する備考を追加 * fix: スペースの調整 * fix: 文言をminmaxに合わせる * feat: 基本的な使い方のダングリング問題を解決 * feat: 寿命切れのタイミングを明確化 * fix: 右辺値 -> 一時オブジェクトに変更し、誤読を防ぐ --------- Co-Authored-By: Koichi Murase Co-Authored-By: Akira Takahashi --- reference/algorithm/minmax.md | 5 +-- reference/algorithm/ranges_minmax.md | 47 +++++++++++++++++++++++++--- 2 files changed, 46 insertions(+), 6 deletions(-) diff --git a/reference/algorithm/minmax.md b/reference/algorithm/minmax.md index 245173fdbb..41a64bc7f1 100644 --- a/reference/algorithm/minmax.md +++ b/reference/algorithm/minmax.md @@ -53,7 +53,8 @@ namespace std { - `initializer_list`バージョンは高々`(3/2) * t.size()`回の述語適用。 ## 備考 -- (1), (2) : 引数に右辺値を与えた場合、`minmax`の呼び出しを含む式の評価が終わった時点で、返された参照は寿命が切れている(ダングリング)ことに注意: +- (1), (2) : 引数に一時オブジェクトを与えた場合、`minmax`の呼び出しを含む完全式 (full-expression; 一番外側の式) の評価が終わる時点で、返された参照の寿命が切れる(ダングリング)ことに注意: + ```cpp example #include #include @@ -68,7 +69,7 @@ int main() std::pair result2 = std::minmax(x, 11); assert(result2.first == 10); // ok: result2.first は xのコピーを持っている - assert(result2.second == 11); // ok: result2.second は 右辺値11のコピーを持っている + assert(result2.second == 11); // ok: result2.second は 一時オブジェクト11のコピーを持っている } ``` diff --git a/reference/algorithm/ranges_minmax.md b/reference/algorithm/ranges_minmax.md index 22b63c906a..58c97731e5 100644 --- a/reference/algorithm/ranges_minmax.md +++ b/reference/algorithm/ranges_minmax.md @@ -76,27 +76,66 @@ minmax_result { - 2値比較バージョンは1操作。 - 範囲バージョンは高々`(3/2) * t.size()`回の述語適用。 +## 備考 +- (1) : 引数に一時オブジェクトを与えた場合、`minmax`の呼び出しを含む完全式 (full-expression; 一番外側の式) の評価が終わる時点で、返された参照の寿命が切れる(ダングリング)ことに注意: + +```cpp example +#include +#include + +int main() +{ + int x = 10; + auto result1 = std::ranges::minmax(x, 11); // decltype(result1) == std::ranges::minmax_result + assert(result1.min == 10); // ok: result1.min は xを参照している + //assert(result1.max == 11); // 未定義動作 : result1.maxは寿命が尽きたオブジェクト(一時オブジェクト11)を指しているため、 + // そのオブジェクトにアクセスしてはならない + + // 構造化束縛を使用した場合も同様に未定義動作を引き起こす + // auto [min_val, max_val] = std::ranges::minmax(x, 11); + // max_val; // 未定義動作 : 一時オブジェクト11の寿命は尽きている + + // 初期化子リストやRangeを渡すオーバーロード(2), (3)では、値が返されるため問題ない + auto result2 = std::ranges::minmax({x, 11}); // decltype(result2) == std::ranges::minmax_result + assert(result2.min == 10); // ok: result2.min は xのコピーを持っている + assert(result2.max == 11); // ok: result2.max は 一時オブジェクト11のコピーを持っている +} +``` + ## 例 ### 基本的な使い方 ```cpp example +#include #include #include -#include #include int main() { - const auto result1 = std::ranges::minmax(2, 3); + const int x = 2; + const int y = 3; + + // (1) 2つの値を受け取るオーバーロード + // 一時オブジェクトを渡すと戻り値のメンバがダングリング参照になるため、左辺値を渡す + const auto result1 = std::ranges::minmax(x, y); assert(result1.min == 2 && result1.max == 3); - const auto result2 = std::ranges::minmax(2, 3, std::ranges::greater()); + const auto result2 = std::ranges::minmax(x, y, std::ranges::greater()); assert(result2.min == 3 && result2.max == 2); + // NG! ダングリング参照が発生する + // const auto result1 = std::ranges::minmax(2, 3); + + // (2) 初期化子リストを受け取るオーバーロード constexpr auto result3 = std::ranges::minmax({1, 2, 3}); static_assert(result3.min == 1 && result3.max == 3); - constexpr std::array a = {1, 2, 3}; + // 構造化束縛も可能 + auto [min_val, max_val] = std::ranges::minmax({1, 2, 3}, std::ranges::greater()); + assert(min_val == 3 && max_val == 1); + // (3) Rangeを受け取るオーバーロード + constexpr std::array a = {1, 2, 3}; constexpr auto result4 = std::ranges::minmax(a, std::ranges::greater()); static_assert(result4.min == 3 && result4.max == 1); } From 09b44838ae181f88f9787c82b9c7144bcc16df3f Mon Sep 17 00:00:00 2001 From: Koichi Murase Date: Thu, 2 Apr 2026 05:04:35 +0900 Subject: [PATCH 2676/3948] =?UTF-8?q?feat(GLOBAL=5FDEFINED=5FWORDS):=20"?= =?UTF-8?q?=E5=AE=8C=E7=B5=90=E5=BC=8F"=E3=83=BB"=E5=AE=8C=E5=85=A8?= =?UTF-8?q?=E5=BC=8F"=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GLOBAL_DEFINED_WORDS.json | 5 +++++ lang/cpp26/contracts.md | 2 +- reference/algorithm/minmax.md | 2 +- reference/algorithm/ranges_minmax.md | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/GLOBAL_DEFINED_WORDS.json b/GLOBAL_DEFINED_WORDS.json index 0f15a869dd..a8e3d080f5 100644 --- a/GLOBAL_DEFINED_WORDS.json +++ b/GLOBAL_DEFINED_WORDS.json @@ -200,5 +200,10 @@ "よりも確実に前に発生する": { "yomi": "よりもかくじつにまえにはっせいする", "desc": "strongly happens before。(異なるスレッド間の) 2つの操作の実行順序を規定する強い関係" + }, + "完全式": { "yomi": "かんぜんしき", "redirect": "完結式" }, + "完結式": { + "yomi": "かんけつしき", + "desc": "full-expression。主に他の式の部分式ではない式。要するに一番外側の式。" } } diff --git a/lang/cpp26/contracts.md b/lang/cpp26/contracts.md index a663549aea..d83c6728ea 100644 --- a/lang/cpp26/contracts.md +++ b/lang/cpp26/contracts.md @@ -349,7 +349,7 @@ int f() ``` #### 述語の評価 -契約アサーションの述語式が評価されるとき、それは`bool`に文脈的に変換される。述語式は完全式(full expression)であるため、述語の評価中に作成された一時オブジェクトは、その評価が完了したときに破棄される。 +契約アサーションの述語式が評価されるとき、それは`bool`に文脈的に変換される。述語式は完全式であるため、述語の評価中に作成された一時オブジェクトは、その評価が完了したときに破棄される。 ### 契約の評価モード 各契約アサーションの個別の評価は、特定の評価セマンティクスで実行される。提案されている4つの評価セマンティクスは以下の通りである。 diff --git a/reference/algorithm/minmax.md b/reference/algorithm/minmax.md index 41a64bc7f1..10c14e2e43 100644 --- a/reference/algorithm/minmax.md +++ b/reference/algorithm/minmax.md @@ -53,7 +53,7 @@ namespace std { - `initializer_list`バージョンは高々`(3/2) * t.size()`回の述語適用。 ## 備考 -- (1), (2) : 引数に一時オブジェクトを与えた場合、`minmax`の呼び出しを含む完全式 (full-expression; 一番外側の式) の評価が終わる時点で、返された参照の寿命が切れる(ダングリング)ことに注意: +- (1), (2) : 引数に一時オブジェクトを与えた場合、`minmax`の呼び出しを含む完全式の評価が終わる時点で、返された参照の寿命が切れる(ダングリング)ことに注意: ```cpp example #include diff --git a/reference/algorithm/ranges_minmax.md b/reference/algorithm/ranges_minmax.md index 58c97731e5..fb6fcc83c6 100644 --- a/reference/algorithm/ranges_minmax.md +++ b/reference/algorithm/ranges_minmax.md @@ -77,7 +77,7 @@ minmax_result { - 範囲バージョンは高々`(3/2) * t.size()`回の述語適用。 ## 備考 -- (1) : 引数に一時オブジェクトを与えた場合、`minmax`の呼び出しを含む完全式 (full-expression; 一番外側の式) の評価が終わる時点で、返された参照の寿命が切れる(ダングリング)ことに注意: +- (1) : 引数に一時オブジェクトを与えた場合、`minmax`の呼び出しを含む完全式の評価が終わる時点で、返された参照の寿命が切れる(ダングリング)ことに注意: ```cpp example #include From 7e4e769bc80a5893daf3a31dca0ec4b8f075d717 Mon Sep 17 00:00:00 2001 From: KAZOON <48007342+cycloawaodorin@users.noreply.github.com> Date: Thu, 2 Apr 2026 09:08:48 +0900 Subject: [PATCH 2677/3948] =?UTF-8?q?=E5=8F=82=E8=80=83=E3=83=AA=E3=83=B3?= =?UTF-8?q?=E3=82=AF=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/cfenv/fe_tonearest.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reference/cfenv/fe_tonearest.md b/reference/cfenv/fe_tonearest.md index baf9d47b59..ed41f98941 100644 --- a/reference/cfenv/fe_tonearest.md +++ b/reference/cfenv/fe_tonearest.md @@ -77,3 +77,6 @@ int main() - [ICC](/implementation.md#icc): ?? - [Visual C++](/implementation.md#visual_cpp): 2013 [mark verified], 2015 [mark verified] - コンパイルオプション`/fp:strict`または`#pragma fenv_access (on)`が必要。さもなくば、正しく動作しないおそれがある。 + +## 参照 +- [ISO/IEC 60559:2020](https://ja.wikibooks.org/wiki/ISO/IEC_60559:2020) From 18aae7ed9e191ca5c790f297c4d107cd2594cac9 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Thu, 2 Apr 2026 11:09:00 +0900 Subject: [PATCH 2678/3948] =?UTF-8?q?C++26:=20=E3=80=8Cmain=E9=96=A2?= =?UTF-8?q?=E6=95=B0=E3=82=92=E3=82=B0=E3=83=AD=E3=83=BC=E3=83=90=E3=83=AB?= =?UTF-8?q?=E3=83=A2=E3=82=B8=E3=83=A5=E3=83=BC=E3=83=AB=E3=81=AB=E9=96=A2?= =?UTF-8?q?=E9=80=A3=E4=BB=98=E3=81=91=E3=82=8B=E3=81=93=E3=81=A8=E3=82=92?= =?UTF-8?q?=E8=A8=B1=E5=8F=AF=E3=80=8D=E3=82=92=E8=BF=BD=E5=8A=A0=20(close?= =?UTF-8?q?=20#1492)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp20/modules.md | 1 + lang/cpp26.md | 2 +- ...low_attaching_main_to_the_global_module.md | 83 +++++++++++++++++++ 4 files changed, 86 insertions(+), 2 deletions(-) create mode 100644 lang/cpp26/allow_attaching_main_to_the_global_module.md diff --git a/implementation-status.md b/implementation-status.md index f66feeabef..55bcaff0d3 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -325,7 +325,7 @@ | P2900R14: [契約プログラミングをサポートする](/lang/cpp26/contracts.md) | 関数の事前条件、事後条件、不変条件を記述できるようにする | | | | | | P2841R7: [コンセプトと変数テンプレートにテンプレートテンプレートパラメータのサポートを追加](/lang/cpp26/concept_and_variable-template_template-parameters.md.nolink) | テンプレート引数をあとで指定するテンプレートテンプレートパラメータを、コンセプトと変数テンプレートでも使用できるようにする | | | | | | P1967R14: [ファイルを読み込む`#embed`命令を追加](/lang/cpp26/embed.md) | バイナリファイルをインクルードするメカニズム。`#include`とちがって読み出しサイズなどの柔軟な指定ができる | 15 | | | | -| P3618R0: [`main`関数をグローバルモジュールに含められるようにする](/lang/cpp26/allow_attaching_main_to_the_global_module.md.nolink) | `main`関数に`extern "C++"`を指定できるようにすることで名前付きモジュールに含められるようにする | 16 | 21 | | | | +| P3618R0: [`main`関数をグローバルモジュールに含められるようにする](/lang/cpp26/allow_attaching_main_to_the_global_module.md) | `main`関数に`extern "C++"`を指定できるようにすることで名前付きモジュールに含められるようにする | 16 | 21 | | | | | P2996R13: [静的リフレクション](/lang/cpp26/reflection.md.nolink) | リフレクション演算子`^^`と`std::meta::info`型によりコンパイル時にさまざまな情報を取得できる | | | | | | P1306R5: [コンパイル時のタプルやリストを展開処理する`template for`文](/lang/cpp26/expansion_statements.md.nolink) | クラス・タプル・Range・パラメータパックなどを展開してすべての要素をコンパイル時の処理する`template for`文を追加 | 16 | | | | | P3533R2: [`constexpr`仮想継承を許可](/lang/cpp26/constexpr_virtual_inheritance.md.nolink) | 定数式の文脈での仮想継承を許可 | 16 | | | | diff --git a/lang/cpp20/modules.md b/lang/cpp20/modules.md index c8d0d51d13..dfd8077292 100644 --- a/lang/cpp20/modules.md +++ b/lang/cpp20/modules.md @@ -493,6 +493,7 @@ int main() { ## 関連項目 - [C++23 無意味なexport宣言を禁止する](/lang/cpp23/meaningful_exports.md) - [C++26 モジュール宣言でのモジュール名のマクロ展開を禁止する](/lang/cpp26/module_declarations_shouldnt_be_macros.md) +- [C++26 `main`関数をグローバルモジュールに関連付けることを許可](/lang/cpp26/allow_attaching_main_to_the_global_module.md) ## 参照 diff --git a/lang/cpp26.md b/lang/cpp26.md index 943df692e2..f40c9bea12 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -104,7 +104,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| | [モジュール宣言でのモジュール名のマクロ展開を禁止する](/lang/cpp26/module_declarations_shouldnt_be_macros.md) | `export module MACRO_NAME;`を禁止 | -| [`main`関数をグローバルモジュールに含められるようにする](/lang/cpp26/allow_attaching_main_to_the_global_module.md.nolink) | `main`関数に`extern "C++"`を指定できるようにすることで名前付きモジュールに含められるようにする | +| [`main`関数をグローバルモジュールに含められるようにする](/lang/cpp26/allow_attaching_main_to_the_global_module.md) | `main`関数に`extern "C++"`を指定できるようにすることで名前付きモジュールに含められるようにする | | [モジュール宣言より前での`#line`ディレクティブの使用を許可する](/lang/cpp26/allow_line_before_module_declarations.md.nolink) | モジュール宣言より前での`#line`ディレクティブの使用を禁止していたのは過度な制限だった | diff --git a/lang/cpp26/allow_attaching_main_to_the_global_module.md b/lang/cpp26/allow_attaching_main_to_the_global_module.md new file mode 100644 index 0000000000..72fc869861 --- /dev/null +++ b/lang/cpp26/allow_attaching_main_to_the_global_module.md @@ -0,0 +1,83 @@ +# main関数をグローバルモジュールに関連付けることを許可 [P3618R0] +* cpp26[meta cpp] + + + +このページはC++26に採用される見込みの言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 + + + +## 概要 +C++20でモジュールが導入されたが、`main()`関数は名前付きモジュールに属することが禁止されていた。 + +C++26では、モジュール内で`extern "C++"`言語リンケージ指定を付けて`main()`関数を定義することで、`main()`関数をグローバルモジュールに関連付けることが許可される。 + +```cpp +// mymodule.cpp +module mymodule; + +extern "C++" int main() { + // グローバルモジュールに関連付けられる + // モジュール内の非エクスポートな実体にアクセスできる +} +``` + +これにより、モジュール内の非エクスポートな実体をテストするために、テストコードをモジュール内に置くことが可能になる。 + + +## 仕様 +- `main()`関数に`extern "C++"`言語リンケージ指定を付けることが許可される +- `extern "C++"`言語リンケージ指定を付けた`main()`関数は、名前付きモジュール内で定義されていてもグローバルモジュールに関連付けられる +- `extern "C++"`言語リンケージ指定なしで`main()`関数を名前付きモジュールに属するように宣言することは、依然として不適格 (ill-formed) である + + +## 例 +```cpp example +module; + +#include + +export module mylib; + +// エクスポートされる関数 +export int add(int a, int b) { + return a + b; +} + +// エクスポートされない内部関数 +int internal_helper(int x) { + return x * 2; +} + +// extern "C++"を付けることで、main関数をグローバルモジュールに関連付ける +// モジュール内の非エクスポートな実体にもアクセスできる +extern "C++" int main() { + assert(add(1, 2) == 3); + assert(internal_helper(5) == 10); +} +``` + +### 出力 +``` +``` + + +## この機能が必要になった背景・経緯 +モジュール内の非エクスポートな実体をユニットテストする場合、テストコードはそのモジュールに属する必要がある。しかしC++20およびC++23では、`main()`関数は名前付きモジュールに属することが禁止されていたため、モジュール内にテスト用の`main()`関数を直接書くことができなかった。 + +この問題に対して、P3422R1は「モジュール内の`main()`を自動的にグローバルモジュールに関連付ける」という特別扱いを追加するアプローチを提案していた。一方、本提案 (P3618R0) は、既存の`extern "C++"`メカニズムを利用して明示的にグローバルモジュールへの関連付けを行うアプローチをとった。本提案は`main()`への特別扱いを追加するのではなく、既存の特別扱い(`main()`に言語リンケージ指定を禁止していたこと)を削除するという、より一貫性のある設計となっている。 + + +## 検討されたほかの選択肢 +P3422R1では、モジュール内で定義された`main()`関数を暗黙的にグローバルモジュールに関連付けるアプローチが提案されていた。これは`main()`への新たな特別扱いの追加であり、本提案 (P3618R0) は既存の`extern "C++"`を利用する明示的なアプローチの方が言語の一貫性を保てるとして、こちらが採用された。 + + +## 関連項目 +- [C++20 モジュール](/lang/cpp20/modules.md) + + +## 参照 +- [P3618R0 Allow attaching main to the global module](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3618r0.html) +- [P3422R1 Fixing Modules for Test](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3422r1.html) From 36dc97276c8853fe25544f1ef5d41934ace9185f Mon Sep 17 00:00:00 2001 From: teruyamato0731 <77840326+teruyamato0731@users.noreply.github.com> Date: Thu, 2 Apr 2026 14:29:58 +0900 Subject: [PATCH 2679/3948] =?UTF-8?q?feat(GLOBAL=5FDEFINED=5FWORDS):=20"?= =?UTF-8?q?=E3=83=80=E3=83=B3=E3=82=B0=E3=83=AA=E3=83=B3=E3=82=B0"?= =?UTF-8?q?=E3=81=AE=E5=AE=9A=E7=BE=A9=E8=BF=BD=E5=8A=A0=E3=80=81=E3=81=8A?= =?UTF-8?q?=E3=82=88=E3=81=B3=E8=A8=B3=E8=AA=9E=E3=81=AE=E7=B5=B1=E4=B8=80?= =?UTF-8?q?=20(#1599)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: ぶら下がり参照 -> ダングリング参照に統一 * feat: 訳語表にダングリングを追加 * feat(GLOBAL_DEFINED_WORDS): "ダングリング"を追加 * feat: ダングリング(dangling) -> ダングリング --- GLOBAL_DEFINED_WORDS.json | 4 ++++ reference/functional/function_ref.md | 2 +- reference/generator/generator.md | 2 +- reference/iterator/reverse_iterator/op_deref.md | 2 +- reference/string/basic_string/subview.md | 4 ++-- reference/valarray/gslice_array/op_constructor.md | 2 +- reference/valarray/valarray/op_at.md | 2 +- working_style.md | 1 + 8 files changed, 12 insertions(+), 7 deletions(-) diff --git a/GLOBAL_DEFINED_WORDS.json b/GLOBAL_DEFINED_WORDS.json index a8e3d080f5..616cfd9293 100644 --- a/GLOBAL_DEFINED_WORDS.json +++ b/GLOBAL_DEFINED_WORDS.json @@ -205,5 +205,9 @@ "完結式": { "yomi": "かんけつしき", "desc": "full-expression。主に他の式の部分式ではない式。要するに一番外側の式。" + }, + "ダングリング": { + "yomi": "だんぐりんぐ", + "desc": "dangling。寿命が尽きた無効なオブジェクトやメモリ領域を、ポインタ・参照・イテレータなどが指し続けている状態のこと。これらにアクセスすると未定義の動作を引き起こす" } } diff --git a/reference/functional/function_ref.md b/reference/functional/function_ref.md index c1f86340b7..76f7db38d1 100644 --- a/reference/functional/function_ref.md +++ b/reference/functional/function_ref.md @@ -35,7 +35,7 @@ namespace std { - `operator bool`を提供しない。 - メンバ関数・メンバ変数を参照する場合は、[`std::constant_arg`](/reference/utility/constant_arg_t.md)タグを利用する。 - 対象オブジェクトの束縛タイミングは、構築時または呼び出し時のいずれもサポートする。 -- ダングリング(dangling)参照を避けるため、左辺値(lvalue)のみを取り扱う。 +- ダングリング参照を避けるため、左辺値(lvalue)のみを取り扱う。 ## メンバ関数 diff --git a/reference/generator/generator.md b/reference/generator/generator.md index 4ba98f5de2..f95c3713e2 100644 --- a/reference/generator/generator.md +++ b/reference/generator/generator.md @@ -318,7 +318,7 @@ int main() // もし fizzbuzz() 戻り値型が std::generator であった場合、 // 変数 vec は std::vector 型となる。このときコルーチン内部実装の // std::to_string() の戻り値 std::string オブジェクトはco_yield式末尾で寿命が切れるため、 - // 各要素 vec[i] に格納される std::string_view はダングリング(dangling)状態になってしまう。 + // 各要素 vec[i] に格納される std::string_view はダングリング状態になってしまう。 for (const auto& e : vec) { std::cout << e << std::endl; diff --git a/reference/iterator/reverse_iterator/op_deref.md b/reference/iterator/reverse_iterator/op_deref.md index 434f83bc7e..60075bbda0 100644 --- a/reference/iterator/reverse_iterator/op_deref.md +++ b/reference/iterator/reverse_iterator/op_deref.md @@ -22,7 +22,7 @@ deref_tmp = current; return *deref_tmp; ``` -※`deref_tmp`は、ぶら下がり参照を避けるために関数内のローカル変数ではなく、メンバ変数として保持される。 +※`deref_tmp`は、ダングリング参照を避けるために関数内のローカル変数ではなく、メンバ変数として保持される。 - C++14 diff --git a/reference/string/basic_string/subview.md b/reference/string/basic_string/subview.md index 364409e34a..8af6969647 100644 --- a/reference/string/basic_string/subview.md +++ b/reference/string/basic_string/subview.md @@ -26,7 +26,7 @@ constexpr basic_string_view ## 注意 -本関数は使い方を誤ると、ぶら下がり参照が発生し得る。 +本関数は使い方を誤ると、ダングリング参照が発生し得る。 ```cpp example #include #include @@ -42,7 +42,7 @@ int main() { std::println("{}", std::string(3, 'A').subview()); // NG! - std::string_view d = std::string(3, 'A').subview(); // ぶら下がり参照発生 + std::string_view d = std::string(3, 'A').subview(); // ダングリング参照発生 std::println("{}", d); // 不定動作 } ``` diff --git a/reference/valarray/gslice_array/op_constructor.md b/reference/valarray/gslice_array/op_constructor.md index fe0e9de299..41abbecbad 100644 --- a/reference/valarray/gslice_array/op_constructor.md +++ b/reference/valarray/gslice_array/op_constructor.md @@ -70,7 +70,7 @@ int main() ### 備考 -- GCC 4.9.0時点のlibstdc++は、(2)のオーバーロードにおいて、ぶら下がり参照の問題が発生する実装のバグがある([Bug 62119](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62119)) +- GCC 4.9.0時点のlibstdc++は、(2)のオーバーロードにおいて、ダングリング参照の問題が発生する実装のバグがある([Bug 62119](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62119)) ## 参照 diff --git a/reference/valarray/valarray/op_at.md b/reference/valarray/valarray/op_at.md index f28b2951bb..119ee2b35a 100644 --- a/reference/valarray/valarray/op_at.md +++ b/reference/valarray/valarray/op_at.md @@ -270,7 +270,7 @@ int main() ``` ### 備考 -- GCC 4.8.2時点のlibstdc++において、(8)と(10)のオーバーロードにおいて、一時オブジェクトのマスク配列を渡すと、ぶら下がり参照が発生する問題がある([#Bug 63314](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63314), [mask_array behavior in libstdc++](http://stackoverflow.com/questions/25918764/mask-array-behavior-in-libstdc)) +- GCC 4.8.2時点のlibstdc++において、(8)と(10)のオーバーロードにおいて、一時オブジェクトのマスク配列を渡すと、ダングリング参照が発生する問題がある([#Bug 63314](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63314), [mask_array behavior in libstdc++](http://stackoverflow.com/questions/25918764/mask-array-behavior-in-libstdc)) ## 参照 diff --git a/working_style.md b/working_style.md index 2265d43920..bb37c58ad3 100644 --- a/working_style.md +++ b/working_style.md @@ -81,6 +81,7 @@ C++11以降対応については対応バージョンを明記します。バー | const iterator | 読み取り専用イテレータ | | const reverse iterator | 読み取り専用逆イテレータ | | covariant | 共変的 | +| dangling | ダングリング | | data member | メンバ変数 (ユーザー視点ではデータメンバより一般的のため) | | dereference | 間接参照 | | dereferenceable | 間接参照可能 | From c20c72f02a6a1698a5749a2cea7bb667535be32c Mon Sep 17 00:00:00 2001 From: teruyamato0731 <77840326+teruyamato0731@users.noreply.github.com> Date: Thu, 2 Apr 2026 16:56:01 +0900 Subject: [PATCH 2680/3948] =?UTF-8?q?typo:=20=E4=B8=8D=E8=87=AA=E7=84=B6?= =?UTF-8?q?=E3=81=AA=E6=96=87=E8=A8=80=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/type_traits/reference_constructs_from_temporary.md | 2 +- reference/type_traits/reference_converts_from_temporary.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/type_traits/reference_constructs_from_temporary.md b/reference/type_traits/reference_constructs_from_temporary.md index 19c1a60519..c2236d735d 100644 --- a/reference/type_traits/reference_constructs_from_temporary.md +++ b/reference/type_traits/reference_constructs_from_temporary.md @@ -116,7 +116,7 @@ int main() static_assert(std::reference_constructs_from_temporary_v); - // NG: const ではない左辺値参照は寿命を延長しないんですタイプ + // NG: const ではない左辺値参照は寿命を延長しないタイプ // 1つ目3つ目はそもそも参照そのものが構築出来ない static_assert(false == std::reference_constructs_from_temporary_v); static_assert(false == std::reference_constructs_from_temporary_v); diff --git a/reference/type_traits/reference_converts_from_temporary.md b/reference/type_traits/reference_converts_from_temporary.md index 7d18146e66..1c3e77d7f0 100644 --- a/reference/type_traits/reference_converts_from_temporary.md +++ b/reference/type_traits/reference_converts_from_temporary.md @@ -107,7 +107,7 @@ int main() static_assert(std::reference_converts_from_temporary_v); - // NG: const ではない左辺値参照は寿命を延長しないんですタイプ + // NG: const ではない左辺値参照は寿命を延長しないタイプ // 1つ目3つ目はそもそも参照そのものが構築出来ない static_assert(false == std::reference_converts_from_temporary_v); static_assert(false == std::reference_converts_from_temporary_v); From 9d5d7a58ce0600470a0c6fe17e40c5b88e28d6f0 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Fri, 3 Apr 2026 10:04:23 +0900 Subject: [PATCH 2681/3948] =?UTF-8?q?C++26:=20=E3=80=8C=E3=83=A2=E3=82=B8?= =?UTF-8?q?=E3=83=A5=E3=83=BC=E3=83=AB=E5=AE=A3=E8=A8=80=E3=82=88=E3=82=8A?= =?UTF-8?q?=E5=89=8D=E3=81=A7=E3=81=AE#line=E3=83=87=E3=82=A3=E3=83=AC?= =?UTF-8?q?=E3=82=AF=E3=83=86=E3=82=A3=E3=83=96=E3=81=AE=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E3=82=92=E8=A8=B1=E5=8F=AF=E3=81=99=E3=82=8B=E3=80=8D=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20(close=20#1556)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp20/modules.md | 1 + lang/cpp26.md | 2 +- .../allow_line_before_module_declarations.md | 43 +++++++++++++++++++ 4 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 lang/cpp26/allow_line_before_module_declarations.md diff --git a/implementation-status.md b/implementation-status.md index 55bcaff0d3..940e846b39 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -330,7 +330,7 @@ | P1306R5: [コンパイル時のタプルやリストを展開処理する`template for`文](/lang/cpp26/expansion_statements.md.nolink) | クラス・タプル・Range・パラメータパックなどを展開してすべての要素をコンパイル時の処理する`template for`文を追加 | 16 | | | | | P3533R2: [`constexpr`仮想継承を許可](/lang/cpp26/constexpr_virtual_inheritance.md.nolink) | 定数式の文脈での仮想継承を許可 | 16 | | | | | P2843R3: [プリプロセッサ仕様での「未定義動作」を不適格 (診断不要) に変更](/lang/cpp26/preprocessing_is_never_undefined.md.nolink) | プリプロセッサとレキサーの文脈での「未定義動作」用語を不適格 (診断不要) に変更 | 16 | | | | -| P3868R1: [モジュール宣言より前での`#line`ディレクティブの使用を許可する](/lang/cpp26/allow_line_before_module_declarations.md.nolink) | モジュール宣言より前での`#line`ディレクティブの使用を禁止していたのは過度な制限だった | | | | | +| P3868R1: [モジュール宣言より前での`#line`ディレクティブの使用を許可する](/lang/cpp26/allow_line_before_module_declarations.md) | モジュール宣言より前での`#line`ディレクティブの使用を禁止していたのは過度な制限だった | | | | | 各処理系のC++26実装状況ページ: diff --git a/lang/cpp20/modules.md b/lang/cpp20/modules.md index dfd8077292..02ac06751a 100644 --- a/lang/cpp20/modules.md +++ b/lang/cpp20/modules.md @@ -494,6 +494,7 @@ int main() { - [C++23 無意味なexport宣言を禁止する](/lang/cpp23/meaningful_exports.md) - [C++26 モジュール宣言でのモジュール名のマクロ展開を禁止する](/lang/cpp26/module_declarations_shouldnt_be_macros.md) - [C++26 `main`関数をグローバルモジュールに関連付けることを許可](/lang/cpp26/allow_attaching_main_to_the_global_module.md) +- [C++26 モジュール宣言より前での`#line`ディレクティブの使用を許可する](/lang/cpp26/allow_line_before_module_declarations.md) ## 参照 diff --git a/lang/cpp26.md b/lang/cpp26.md index f40c9bea12..1a3a3d0603 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -105,7 +105,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 |----------|------| | [モジュール宣言でのモジュール名のマクロ展開を禁止する](/lang/cpp26/module_declarations_shouldnt_be_macros.md) | `export module MACRO_NAME;`を禁止 | | [`main`関数をグローバルモジュールに含められるようにする](/lang/cpp26/allow_attaching_main_to_the_global_module.md) | `main`関数に`extern "C++"`を指定できるようにすることで名前付きモジュールに含められるようにする | -| [モジュール宣言より前での`#line`ディレクティブの使用を許可する](/lang/cpp26/allow_line_before_module_declarations.md.nolink) | モジュール宣言より前での`#line`ディレクティブの使用を禁止していたのは過度な制限だった | +| [モジュール宣言より前での`#line`ディレクティブの使用を許可する](/lang/cpp26/allow_line_before_module_declarations.md) | モジュール宣言より前での`#line`ディレクティブの使用を禁止していたのは過度な制限だった | ### 機能の非推奨化 diff --git a/lang/cpp26/allow_line_before_module_declarations.md b/lang/cpp26/allow_line_before_module_declarations.md new file mode 100644 index 0000000000..116a8d938d --- /dev/null +++ b/lang/cpp26/allow_line_before_module_declarations.md @@ -0,0 +1,43 @@ +# モジュール宣言より前での`#line`ディレクティブの使用を許可する [P3868R1] +* cpp26[meta cpp] + + + +このページはC++26に採用される見込みの言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 + + + +## 概要 +C++20でモジュールが導入された際、グローバルモジュールフラグメントより前でのプリプロセッサ制御行がP1857R3によって禁止された。この制限により`#line`ディレクティブもモジュール宣言より前に書くことができなくなっていた。 + +C++26では、`#line`ディレクティブをモジュール宣言より前に記述することが許可される。 + +```cpp +#line 1 "A.cppm" +export module a; // C++26: OK (C++20/23: ill-formed) +``` + + +## 仕様 +モジュールファイルの文法に`#line`ディレクティブの出現を許可するよう変更される。具体的には、グローバルモジュールフラグメントの有無にかかわらず、モジュール宣言より前に`#line`ディレクティブを記述できる。 + + +## この機能が必要になった背景・経緯 +build2、ccache、distccなどのビルドツールは、前処理済みの出力をコンパイラに再入力することに依存しており、その出力には通常`#line`ディレクティブが含まれている。しかし、モジュール宣言より前での制御行が禁止されていたため、以下のような前処理済み出力がコンパイルできなかった。 + +```cpp +#line 1 "A.cppm" +export module a; +``` + +この制限は過度であり、`#line`ディレクティブはコードの意味に影響を与えないため、禁止する理由がなかった。 + + +## 関連項目 +- [C++20 モジュール](/lang/cpp20/modules.md) + + +## 参照 +- [P3868R1 Allow #line before module declarations](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3868r1.html) From 486647fbec3b34f07974d0139fc98d03b3f964bb Mon Sep 17 00:00:00 2001 From: teruyamato0731 <77840326+teruyamato0731@users.noreply.github.com> Date: Fri, 3 Apr 2026 11:02:19 +0900 Subject: [PATCH 2682/3948] =?UTF-8?q?feat:=20`std::abs`=E3=81=AB=E8=A1=A8?= =?UTF-8?q?=E7=8F=BE=E4=B8=8D=E5=8F=AF=E8=83=BD=E3=81=AA=E5=80=A4=EF=BC=88?= =?UTF-8?q?`INT=5FMIN`=E7=AD=89=EF=BC=89=E3=82=92=E6=B8=A1=E3=81=97?= =?UTF-8?q?=E3=81=9F=E9=9A=9B=E3=81=AE=E6=9C=AA=E5=AE=9A=E7=BE=A9=E5=8B=95?= =?UTF-8?q?=E4=BD=9C=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6=E8=BF=BD=E8=A8=98?= =?UTF-8?q?=20(#1600)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: `std::abs`に表現不可能な値を渡した際の未定義動作について追記 * fix: 整数型に対するオーバーロードに限定 * feat: cmathのabsに対しても記述 * feat: 表記の改善 --- reference/cmath/abs.md | 2 ++ reference/cstdlib/abs.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/reference/cmath/abs.md b/reference/cmath/abs.md index 12397ef4ef..7efe043487 100644 --- a/reference/cmath/abs.md +++ b/reference/cmath/abs.md @@ -50,6 +50,8 @@ namespace std { ## 備考 - $$ f(x) = | x | $$ +- (6), (7), (8) : 引数の絶対値が、戻り値の型で表現できない場合、未定義動作を引き起こす。 + - 一般的な2の補数表現のシステムにおいて、符号付き整数型の最小値(例:`int`における[`INT_MIN`](/reference/climits/int_min.md))の絶対値は、表現できる最大値([`INT_MAX`](/reference/climits/int_max.md))よりも1大きくなってしまうため、この未定義動作に該当する。 - 任意の整数型に対するオーバーロード(5)は C++11 で追加されたが、[一部の符号なし整数型に対して問題を引き起こす](http://wg21.cmeerw.net/lwg/issue2192)ことから C++17 で削除され、符号付き整数型に対するオーバーロード(6), (7), (8)が追加された - C++23では、(1), (2), (3)が(4)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された diff --git a/reference/cstdlib/abs.md b/reference/cstdlib/abs.md index 3ed633d177..cda9c3f690 100644 --- a/reference/cstdlib/abs.md +++ b/reference/cstdlib/abs.md @@ -63,6 +63,8 @@ namespace std { ## 備考 +- (1), (2), (3), (8), (9) : 引数の絶対値が、戻り値の型で表現できない場合、未定義動作を引き起こす。 + - 一般的な2の補数表現のシステムにおいて、符号付き整数型の最小値(例:`int`における[`INT_MIN`](/reference/climits/int_min.md))の絶対値は、表現できる最大値([`INT_MAX`](/reference/climits/int_max.md))よりも1大きくなってしまうため、この未定義動作に該当する。 - パラメータの型`X`において[`is_unsigned_v`](/reference/type_traits/is_unsigned.md)``が`true`であり、`X`が整数昇格によって`int`に変換できない場合、プログラムは不適格となる - Cとの互換性のため、`int`に昇格できる符号なし整数型は許可される - C++23では、(4), (5), (6)が(7)に統合され、拡張浮動小数点数型を含む浮動小数点数型へのオーバーロードとして定義された From 86eecc6953c1d2ccf6bccef05c909665f055b5c7 Mon Sep 17 00:00:00 2001 From: teruyamato0731 <77840326+teruyamato0731@users.noreply.github.com> Date: Fri, 3 Apr 2026 16:22:09 +0900 Subject: [PATCH 2683/3948] =?UTF-8?q?feat:=20abs=E9=96=A2=E9=80=A3?= =?UTF-8?q?=E3=83=9A=E3=83=BC=E3=82=B8=E3=81=AE=E8=A8=98=E8=BF=B0=E6=94=B9?= =?UTF-8?q?=E5=96=84=E3=81=A8=E9=96=A2=E9=80=A3=E9=A0=85=E7=9B=AE=E3=81=AE?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20(#1601)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: floating-point-typeへのオーバーロードが誤っていたのを修正 * feat: absにおいてlong int -> longに統一 * feat: インデントの調整 * feat: abs間で関連項目とする * feat: 概要の微調整 * feat: 関連項目のリンク先をわかりやすくする --------- Co-Authored-By: Akira Takahashi --- reference/cmath/abs.md | 11 ++++++++--- reference/cmath/fabs.md | 6 ++++++ reference/cstdlib/abs.md | 35 ++++++++++++++++++++--------------- 3 files changed, 34 insertions(+), 18 deletions(-) diff --git a/reference/cmath/abs.md b/reference/cmath/abs.md index 7efe043487..019c59eece 100644 --- a/reference/cmath/abs.md +++ b/reference/cmath/abs.md @@ -20,8 +20,8 @@ namespace std { int abs(int x); // (6) C++17 constexpr int abs(int x); // (6) C++23 - long abs(long int x); // (7) C++17 - constexpr long abs(long int x); // (7) C++23 + long abs(long x); // (7) C++17 + constexpr long abs(long x); // (7) C++23 long long abs(long long x); // (8) C++17 constexpr long long abs(long long x); // (8) C++23 @@ -38,7 +38,7 @@ namespace std { - (4) : 浮動小数点数型に対するオーバーロード - (5) : 整数型に対するオーバーロード (`double`にキャストして計算される) - (6) : `int`に対するオーバーロード -- (7) : `long int`に対するオーバーロード +- (7) : `long`に対するオーバーロード - (8) : `long long`に対するオーバーロード @@ -100,6 +100,11 @@ namespace std { ``` +## 関連項目 +- [`abs - `](/reference/cstdlib/abs.md) +- [`fabs`](/reference/cmath/fabs.md) + + ## 参照 - [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) - C++23での、一部関数の`constexpr`対応 diff --git a/reference/cmath/fabs.md b/reference/cmath/fabs.md index 80215e8ebb..65f8d5f709 100644 --- a/reference/cmath/fabs.md +++ b/reference/cmath/fabs.md @@ -131,6 +131,12 @@ namespace std { * is_integral[link ../type_traits/is_integral.md] * enable_if[link ../type_traits/enable_if.md] + +## 関連項目 +- [`abs - `](/reference/cmath/abs.md) +- [`abs - `](/reference/cstdlib/abs.md) + + ## 参照 - [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) - C++23での、一部関数の`constexpr`対応 diff --git a/reference/cstdlib/abs.md b/reference/cstdlib/abs.md index cda9c3f690..cc4fe877de 100644 --- a/reference/cstdlib/abs.md +++ b/reference/cstdlib/abs.md @@ -6,19 +6,19 @@ ```cpp namespace std { int - abs(int j); // (1) C++03 + abs(int j); // (1) C++03 constexpr int - abs(int j); // (1) C++23 + abs(int j); // (1) C++23 long - int abs(long j); // (2) C++03 + abs(long j); // (2) C++03 constexpr long - int abs(long j); // (2) C++23 + abs(long j); // (2) C++23 long long - abs(long long j); // (3) C++11 + abs(long long j); // (3) C++11 constexpr long long - abs(long long j); // (3) C++23 + abs(long long j); // (3) C++23 float abs(float j); // (4) C++03からC++20まで @@ -27,23 +27,23 @@ namespace std { long double abs(long double j); // (6) C++03からC++20まで - floating-point-type - abs(floating-point-type j); // (7) C++03からC++20まで + constexpr floating-point-type + abs(floating-point-type j); // (7) C++23 long - labs(long j); // (8) C++03 + labs(long j); // (8) C++03 constexpr long - labs(long j); // (8) C++23 + labs(long j); // (8) C++23 long long - llabs(long long j); // (9) C++11 + llabs(long long j); // (9) C++11 constexpr long long - llabs(long long j); // (9) C++23 + llabs(long long j); // (9) C++23 } ``` ## 概要 -絶対値を求める。abs は absolute value(絶対値)の略。 +算術型の絶対値を求める。abs は absolute value(絶対値)の略。 - (1) : `int`に対するオーバーロード - (2) : `long`に対するオーバーロード @@ -52,8 +52,8 @@ namespace std { - (5) : `double`に対するオーバーロード - (6) : `long double`に対するオーバーロード - (7) : 浮動小数点数型に対するオーバーロード -- (8) : `long`規定 -- (9) : `long long`規定 +- (8) : `long`型規定 +- (9) : `long long`型規定 ## 戻り値 @@ -95,6 +95,11 @@ int main() - GCC 4.6.1 以上 +## 関連項目 +- [`abs - `](/reference/cmath/abs.md) +- [`fabs`](/reference/cmath/fabs.md) + + ## 参照 - [P0533R9 constexpr for `` and ``](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf) - C++23での、一部関数の`constexpr`対応 From 683ebcdeaef3c9e6e79b85bf0176929017739a97 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 6 Apr 2026 09:53:12 +0900 Subject: [PATCH 2684/3948] =?UTF-8?q?=E9=96=A2=E4=BF=82=E3=81=AA=E3=81=84?= =?UTF-8?q?=E5=8F=82=E7=85=A7=E6=96=87=E6=9B=B8=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26/allow_attaching_main_to_the_global_module.md | 1 - 1 file changed, 1 deletion(-) diff --git a/lang/cpp26/allow_attaching_main_to_the_global_module.md b/lang/cpp26/allow_attaching_main_to_the_global_module.md index 72fc869861..8c1664e1d7 100644 --- a/lang/cpp26/allow_attaching_main_to_the_global_module.md +++ b/lang/cpp26/allow_attaching_main_to_the_global_module.md @@ -80,4 +80,3 @@ P3422R1では、モジュール内で定義された`main()`関数を暗黙的 ## 参照 - [P3618R0 Allow attaching main to the global module](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3618r0.html) -- [P3422R1 Fixing Modules for Test](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3422r1.html) From 5c82273b49dc364df021a0568081255a846026b7 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 6 Apr 2026 10:14:31 +0900 Subject: [PATCH 2685/3948] =?UTF-8?q?C++26:=20constexpr=E4=BB=AE=E6=83=B3?= =?UTF-8?q?=E7=B6=99=E6=89=BF=E3=82=92=E8=BF=BD=E5=8A=A0=20#1495?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp11/constexpr.md | 1 + lang/cpp26.md | 2 +- lang/cpp26/constexpr_virtual_inheritance.md | 87 +++++++++++++++++++++ 4 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 lang/cpp26/constexpr_virtual_inheritance.md diff --git a/implementation-status.md b/implementation-status.md index 940e846b39..4274c7a208 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -328,7 +328,7 @@ | P3618R0: [`main`関数をグローバルモジュールに含められるようにする](/lang/cpp26/allow_attaching_main_to_the_global_module.md) | `main`関数に`extern "C++"`を指定できるようにすることで名前付きモジュールに含められるようにする | 16 | 21 | | | | | P2996R13: [静的リフレクション](/lang/cpp26/reflection.md.nolink) | リフレクション演算子`^^`と`std::meta::info`型によりコンパイル時にさまざまな情報を取得できる | | | | | | P1306R5: [コンパイル時のタプルやリストを展開処理する`template for`文](/lang/cpp26/expansion_statements.md.nolink) | クラス・タプル・Range・パラメータパックなどを展開してすべての要素をコンパイル時の処理する`template for`文を追加 | 16 | | | | -| P3533R2: [`constexpr`仮想継承を許可](/lang/cpp26/constexpr_virtual_inheritance.md.nolink) | 定数式の文脈での仮想継承を許可 | 16 | | | | +| P3533R2: [`constexpr`仮想継承を許可](/lang/cpp26/constexpr_virtual_inheritance.md) | 定数式の文脈での仮想継承を許可 | 16 | | | | | P2843R3: [プリプロセッサ仕様での「未定義動作」を不適格 (診断不要) に変更](/lang/cpp26/preprocessing_is_never_undefined.md.nolink) | プリプロセッサとレキサーの文脈での「未定義動作」用語を不適格 (診断不要) に変更 | 16 | | | | | P3868R1: [モジュール宣言より前での`#line`ディレクティブの使用を許可する](/lang/cpp26/allow_line_before_module_declarations.md) | モジュール宣言より前での`#line`ディレクティブの使用を禁止していたのは過度な制限だった | | | | | diff --git a/lang/cpp11/constexpr.md b/lang/cpp11/constexpr.md index 17ac9eeb38..6a133d179b 100644 --- a/lang/cpp11/constexpr.md +++ b/lang/cpp11/constexpr.md @@ -219,6 +219,7 @@ GCC 5.2、Clang 3.7、Visual C++ 2015時点で、3つともデフォルトは512 - [C++26 定数式での`void*`からポインタ型へのキャストを許可](/lang/cpp26/constexpr_cast_from_voidptr.md) - [C++26 `constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md) - [C++26 `constexpr`構造化束縛の許可と、`constexpr`参照の制限緩和](/lang/cpp26/constexpr_structured_bindings_and_references_to_constexpr_variables.md) +- [C++26 `constexpr`仮想継承を許可](/lang/cpp26/constexpr_virtual_inheritance.md) ## 参照 diff --git a/lang/cpp26.md b/lang/cpp26.md index 1a3a3d0603..7d47d4d842 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -81,7 +81,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | [`constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md) | 定数式の文脈での配置`new`を許可 | | [`constexpr`構造化束縛の許可と、`constexpr`参照の制限緩和](/lang/cpp26/constexpr_structured_bindings_and_references_to_constexpr_variables.md) | 定数式に対する構造化束縛を許可し、関連して`constexpr`参照の制限を緩和して自動変数も参照できるようにする | | [定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) | 定数式の文脈での例外の送出と捕捉を許可 | -| [`constexpr`仮想継承を許可](/lang/cpp26/constexpr_virtual_inheritance.md.nolink) | 定数式の文脈での仮想継承を許可 | +| [`constexpr`仮想継承を許可](/lang/cpp26/constexpr_virtual_inheritance.md) | 定数式の文脈での仮想継承を許可 | ### プリプロセッサ diff --git a/lang/cpp26/constexpr_virtual_inheritance.md b/lang/cpp26/constexpr_virtual_inheritance.md new file mode 100644 index 0000000000..cbd2fe89ef --- /dev/null +++ b/lang/cpp26/constexpr_virtual_inheritance.md @@ -0,0 +1,87 @@ +# `constexpr`仮想継承を許可 [P3533R2] +* cpp26[meta cpp] + + + +このページはC++26に採用される見込みの言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 + + + +## 概要 +C++26では、`constexpr`の文脈で仮想継承が許可される。 + +これまで、`constexpr`コンストラクタおよびデストラクタを持つクラスは仮想基底クラスを持つことができなかった。C++26ではこの制限が撤廃され、仮想継承を含むクラス階層でもコンパイル時の定数評価が可能になる。 + +```cpp +struct Base { + constexpr virtual ~Base() = default; +}; + +struct Derived : virtual Base { + constexpr Derived() = default; // C++26: OK (C++23以前: 不適格) + constexpr ~Derived() = default; // C++26: OK (C++23以前: 不適格) +}; + +constexpr Derived d{}; // OK +``` + + +## 仕様 +`constexpr`宣言の仕様にあった以下の制約が削除される: + +- (`constexpr`指定された対象が) コンストラクタまたはデストラクタである場合、そのクラスは仮想基底クラスを持たないこと + +これにより、仮想基底クラスを持つクラスのコンストラクタおよびデストラクタに`constexpr`を指定できるようになる。 + + +## 例 +```cpp example +#include + +struct Common { + unsigned counter{0}; + constexpr virtual ~Common() = default; +}; + +struct Left : virtual Common { + constexpr const unsigned& get_counter() const { + return counter; + } +}; + +struct Right : virtual Common { + constexpr const unsigned& get_counter() const { + return counter; + } +}; + +struct Child : Left, Right {}; + +int main() { + constexpr auto ch = Child{}; + // 菱形継承でも仮想基底クラスのメンバは共有される + static_assert(&ch.Left::get_counter() == &ch.Right::get_counter()); +} +``` + +### 出力 +``` +``` + + +## この機能が必要になった背景・経緯 +C++の`constexpr`機能は段階的に拡張されてきたが、仮想継承を含むクラスのコンストラクタ・デストラクタを`constexpr`にすることは禁止されたままだった。これは`constexpr`の文脈で許可されない最後の構文上の制限であった。 + +この制限は、標準ライブラリの`constexpr`化を妨げる障害にもなっていた。特に、[`std::stringstream`](/reference/sstream/basic_stringstream.md)などのストリームユーティリティは仮想継承を使用しており、この制限によりコンパイル時に使用できなかった。また、[``](/reference/chrono.md)の例外型([`chrono::nonexistent_local_time`](/reference/chrono/nonexistent_local_time.md)など)の`constexpr`化も阻害されていた。 + + +## 関連項目 +- [C++11 `constexpr`](/lang/cpp11/constexpr.md) +- [C++20 定数式からの仮想関数の呼び出しを許可](/lang/cpp20/allow_virtual_function_calls_in_constant_expressions.md) +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) + + +## 参照 +- [P3533R2 constexpr virtual inheritance](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3533r2.html) From b8e353bec8655c09e5d69f361318b89fa9335cac Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 6 Apr 2026 11:49:40 +0900 Subject: [PATCH 2686/3948] =?UTF-8?q?C++23=E4=BA=92=E6=8F=9B=E3=83=A9?= =?UTF-8?q?=E3=82=A4=E3=83=96=E3=83=A9=E3=83=AA=E3=81=A8=E3=81=97=E3=81=A6?= =?UTF-8?q?stdbit.h=E3=81=A8stdckdint.h=E3=82=92=E8=BF=BD=E5=8A=A0=20(#160?= =?UTF-8?q?3)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * C++23互換ライブラリとしてstdbit.hとstdckdint.hを追加 #1390 * グローバル修飾リストにヘッダ記載 --- GLOBAL_QUALIFY_LIST.txt | 2 + lang/cpp26.md | 2 +- reference.md | 4 +- reference/bit.md | 4 + reference/bit/bit_ceil.md | 4 + reference/bit/bit_floor.md | 4 + reference/bit/bit_width.md | 4 + reference/bit/countl_one.md | 4 + reference/bit/countl_zero.md | 4 + reference/bit/countr_one.md | 4 + reference/bit/countr_zero.md | 4 + reference/bit/endian.md | 4 + reference/bit/has_single_bit.md | 4 + reference/bit/popcount.md | 1 + reference/stdbit.h.md | 91 +++++++++++++++++++ reference/stdbit.h/stdc_bit_ceil.md | 63 +++++++++++++ reference/stdbit.h/stdc_bit_floor.md | 63 +++++++++++++ reference/stdbit.h/stdc_bit_width.md | 63 +++++++++++++ reference/stdbit.h/stdc_count_ones.md | 63 +++++++++++++ reference/stdbit.h/stdc_count_zeros.md | 60 ++++++++++++ reference/stdbit.h/stdc_endian_big.md | 30 ++++++ reference/stdbit.h/stdc_endian_little.md | 30 ++++++ reference/stdbit.h/stdc_endian_native.md | 30 ++++++ reference/stdbit.h/stdc_first_leading_one.md | 58 ++++++++++++ reference/stdbit.h/stdc_first_leading_zero.md | 58 ++++++++++++ reference/stdbit.h/stdc_first_trailing_one.md | 58 ++++++++++++ .../stdbit.h/stdc_first_trailing_zero.md | 58 ++++++++++++ reference/stdbit.h/stdc_has_single_bit.md | 63 +++++++++++++ reference/stdbit.h/stdc_leading_ones.md | 62 +++++++++++++ reference/stdbit.h/stdc_leading_zeros.md | 62 +++++++++++++ reference/stdbit.h/stdc_trailing_ones.md | 62 +++++++++++++ reference/stdbit.h/stdc_trailing_zeros.md | 62 +++++++++++++ reference/stdckdint.h.md | 41 +++++++++ reference/stdckdint.h/ckd_add.md | 61 +++++++++++++ reference/stdckdint.h/ckd_mul.md | 61 +++++++++++++ reference/stdckdint.h/ckd_sub.md | 61 +++++++++++++ 36 files changed, 1306 insertions(+), 3 deletions(-) create mode 100644 reference/stdbit.h.md create mode 100644 reference/stdbit.h/stdc_bit_ceil.md create mode 100644 reference/stdbit.h/stdc_bit_floor.md create mode 100644 reference/stdbit.h/stdc_bit_width.md create mode 100644 reference/stdbit.h/stdc_count_ones.md create mode 100644 reference/stdbit.h/stdc_count_zeros.md create mode 100644 reference/stdbit.h/stdc_endian_big.md create mode 100644 reference/stdbit.h/stdc_endian_little.md create mode 100644 reference/stdbit.h/stdc_endian_native.md create mode 100644 reference/stdbit.h/stdc_first_leading_one.md create mode 100644 reference/stdbit.h/stdc_first_leading_zero.md create mode 100644 reference/stdbit.h/stdc_first_trailing_one.md create mode 100644 reference/stdbit.h/stdc_first_trailing_zero.md create mode 100644 reference/stdbit.h/stdc_has_single_bit.md create mode 100644 reference/stdbit.h/stdc_leading_ones.md create mode 100644 reference/stdbit.h/stdc_leading_zeros.md create mode 100644 reference/stdbit.h/stdc_trailing_ones.md create mode 100644 reference/stdbit.h/stdc_trailing_zeros.md create mode 100644 reference/stdckdint.h.md create mode 100644 reference/stdckdint.h/ckd_add.md create mode 100644 reference/stdckdint.h/ckd_mul.md create mode 100644 reference/stdckdint.h/ckd_sub.md diff --git a/GLOBAL_QUALIFY_LIST.txt b/GLOBAL_QUALIFY_LIST.txt index 0b3452d06f..8d7478c82a 100644 --- a/GLOBAL_QUALIFY_LIST.txt +++ b/GLOBAL_QUALIFY_LIST.txt @@ -310,6 +310,8 @@ * std::istringstream[link /reference/sstream/basic_istringstream.md] * [link /reference/stack.md] * [link /reference/stacktrace.md] +* [link /reference/stdbit.h.md] +* [link /reference/stdckdint.h.md] * [link /reference/stdexcept.md] * [link /reference/stdfloat.md] * std::bfloat16_t[link /reference/stdfloat/bfloat16_t.md] diff --git a/lang/cpp26.md b/lang/cpp26.md index 7d47d4d842..b4b8b5c2b0 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -133,7 +133,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 - デバッグサポートのライブラリとして[``](/reference/debugging.md)を追加 - 線形代数ライブラリとして[``](/reference/linalg.md)を追加 - コンパイル時に容量を固定する可変長配列クラスのライブラリとして[``](/reference/inplace_vector.md)を追加 -- C23の互換ライブラリとして、ビット操作ライブラリ[``](/reference/stdbit.h.md.nolink)と、検査付き整数演算ライブラリ[``](/reference/stdckdint.h.md.nolink)を追加。``形式のライブラリは追加されない +- C23の互換ライブラリとして、ビット操作ライブラリ[``](/reference/stdbit.h.md)と、検査付き整数演算ライブラリ[``](/reference/stdckdint.h.md)を追加。``形式のライブラリは追加されない ### 全体 diff --git a/reference.md b/reference.md index 9fc7c1ff30..0263706afc 100644 --- a/reference.md +++ b/reference.md @@ -233,8 +233,8 @@ | [``](reference/csignal.md) | シグナル | | | `` | アライメント操作のマクロ | C++17で非推奨
C++20で削除 | | `` | 可変引数操作 | | -| [``](/reference/stdbit.h.md.nolink) | ビット操作 | C++26 | -| [``](/reference/stdckdint.h.md.nolink) | 検査付き整数演算 | C++26 | +| [``](/reference/stdbit.h.md) | ビット操作 | C++26 | +| [``](/reference/stdckdint.h.md) | 検査付き整数演算 | C++26 | | `` | 真理値型の定義 | C++11 (C99)
C++17で非推奨
C++20で削除 | | [``](/reference/cstddef.md) | 基本的な型、値、マクロの定義 | | | [``](/reference/cstdint.md) | 大きさが規定されている整数型 | C++11 (C99) | diff --git a/reference/bit.md b/reference/bit.md index 3e5cfde15b..bc1c74f377 100644 --- a/reference/bit.md +++ b/reference/bit.md @@ -56,6 +56,10 @@ | [`endian`](bit/endian.md) | バイトの並び順を表す列挙型 (enum) | C++20 | +## 関連項目 +- [``](stdbit.h.md) - C互換のビット操作ライブラリ + + ## バージョン ### 言語 - C++20 diff --git a/reference/bit/bit_ceil.md b/reference/bit/bit_ceil.md index 64f00a81b9..dce937952e 100644 --- a/reference/bit/bit_ceil.md +++ b/reference/bit/bit_ceil.md @@ -108,6 +108,10 @@ int main() - [Visual C++](/implementation.md#visual_cpp): ?? +## 関連項目 +- [`stdc_bit_ceil`](/reference/stdbit.h/stdc_bit_ceil.md) - C互換のビット操作関数 + + ## 参照 - [P0556R3 Integral power-of-2 operations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0556r3.html) - [P1355R2 Exposing a narrow contract for `ceil2`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1355r2.html) diff --git a/reference/bit/bit_floor.md b/reference/bit/bit_floor.md index 74843d9921..09b513261f 100644 --- a/reference/bit/bit_floor.md +++ b/reference/bit/bit_floor.md @@ -99,6 +99,10 @@ int main() - [Visual C++](/implementation.md#visual_cpp): ?? +## 関連項目 +- [`stdc_bit_floor`](/reference/stdbit.h/stdc_bit_floor.md) - C互換のビット操作関数 + + ## 参照 - [P0556R3 Integral power-of-2 operations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0556r3.html) - [P1956R1 On the names of low-level bit manipulation functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1956r1.pdf) diff --git a/reference/bit/bit_width.md b/reference/bit/bit_width.md index 2a8da7935f..0b9c37ed20 100644 --- a/reference/bit/bit_width.md +++ b/reference/bit/bit_width.md @@ -82,6 +82,10 @@ int main() - [Visual C++](/implementation.md#visual_cpp): ?? +## 関連項目 +- [`stdc_bit_width`](/reference/stdbit.h/stdc_bit_width.md) - C互換のビット操作関数 + + ## 参照 - [P0556R3 Integral power-of-2 operations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0556r3.html) - [P1956R1 On the names of low-level bit manipulation functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1956r1.pdf) diff --git a/reference/bit/countl_one.md b/reference/bit/countl_one.md index 0b22b7347b..7820ee52d4 100644 --- a/reference/bit/countl_one.md +++ b/reference/bit/countl_one.md @@ -67,5 +67,9 @@ int main() - [Visual C++](/implementation.md#visual_cpp): ?? +## 関連項目 +- [`stdc_leading_ones`](/reference/stdbit.h/stdc_leading_ones.md) - C互換のビット操作関数 + + ## 参照 - [P0553R4 Bit operations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0553r4.html) diff --git a/reference/bit/countl_zero.md b/reference/bit/countl_zero.md index fc6dcf62f2..4711bb5bdc 100644 --- a/reference/bit/countl_zero.md +++ b/reference/bit/countl_zero.md @@ -68,5 +68,9 @@ int main() - [Visual C++](/implementation.md#visual_cpp): ?? +## 関連項目 +- [`stdc_leading_zeros`](/reference/stdbit.h/stdc_leading_zeros.md) - C互換のビット操作関数 + + ## 参照 - [P0553R4 Bit operations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0553r4.html) diff --git a/reference/bit/countr_one.md b/reference/bit/countr_one.md index 6ed752c7cf..58fd0b6006 100644 --- a/reference/bit/countr_one.md +++ b/reference/bit/countr_one.md @@ -63,5 +63,9 @@ int main() - [Visual C++](/implementation.md#visual_cpp): ?? +## 関連項目 +- [`stdc_trailing_ones`](/reference/stdbit.h/stdc_trailing_ones.md) - C互換のビット操作関数 + + ## 参照 - [P0553R4 Bit operations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0553r4.html) diff --git a/reference/bit/countr_zero.md b/reference/bit/countr_zero.md index 7924781009..f25a3d37b9 100644 --- a/reference/bit/countr_zero.md +++ b/reference/bit/countr_zero.md @@ -68,5 +68,9 @@ int main() - [Visual C++](/implementation.md#visual_cpp): ?? +## 関連項目 +- [`stdc_trailing_zeros`](/reference/stdbit.h/stdc_trailing_zeros.md) - C互換のビット操作関数 + + ## 参照 - [P0553R4 Bit operations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0553r4.html) diff --git a/reference/bit/endian.md b/reference/bit/endian.md index e93ae48e5f..1bb1511938 100644 --- a/reference/bit/endian.md +++ b/reference/bit/endian.md @@ -71,6 +71,10 @@ int main() - [Visual C++](/implementation.md#visual_cpp): ?? +## 関連項目 +- [`__STDC_ENDIAN_BIG__`](/reference/stdbit.h/stdc_endian_big.md), [`__STDC_ENDIAN_LITTLE__`](/reference/stdbit.h/stdc_endian_little.md), [`__STDC_ENDIAN_NATIVE__`](/reference/stdbit.h/stdc_endian_native.md) - C互換のエンディアン定数 + + ## 参照 - [P0463R1 endian, Just endian](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0463r1.html) - [P1612R1 Relocate Endian's Specification](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1612r1.pdf) diff --git a/reference/bit/has_single_bit.md b/reference/bit/has_single_bit.md index f5cfdd81d3..401e36a50d 100644 --- a/reference/bit/has_single_bit.md +++ b/reference/bit/has_single_bit.md @@ -91,6 +91,10 @@ int main() - [Visual C++](/implementation.md#visual_cpp): ?? +## 関連項目 +- [`stdc_has_single_bit`](/reference/stdbit.h/stdc_has_single_bit.md) - C互換のビット操作関数 + + ## 参照 - [P0556R3 Integral power-of-2 operations](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0556r3.html) - [P1956R1 On the names of low-level bit manipulation functions](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1956r1.pdf) diff --git a/reference/bit/popcount.md b/reference/bit/popcount.md index 0b667ffd95..ad837f6d1f 100644 --- a/reference/bit/popcount.md +++ b/reference/bit/popcount.md @@ -71,6 +71,7 @@ int main() ## 関連項目 - [`std::bitset::count()`](/reference/bitset/bitset/count.md) +- [`stdc_count_ones`](/reference/stdbit.h/stdc_count_ones.md) - C互換のビット操作関数 ## 参照 diff --git a/reference/stdbit.h.md b/reference/stdbit.h.md new file mode 100644 index 0000000000..d9246e0e7b --- /dev/null +++ b/reference/stdbit.h.md @@ -0,0 +1,91 @@ +# stdbit.h +* stdbit.h[meta header] +* cpp26[meta cpp] + +``はC23で追加されたビット操作ライブラリをC++から使用するための互換ヘッダである。 + +C言語では型総称マクロ (type-generic macro) として提供される汎用関数が、C++では関数テンプレートとして提供される。型別の関数 (`_uc`, `_us`, `_ui`, `_ul`, `_ull`サフィックス) はCと共通のインタフェースである。 + +このヘッダで宣言される関数およびマクロは`std`名前空間に属さず、グローバル名前空間に定義される。C++の対応するヘッダとして``は提供されない。これは、C言語との相互運用性を重視し、CとC++の両方でコンパイル可能なコードを記述できるようにするためである。 + +C++固有のビット操作機能が必要な場合は、[``](bit.md)ヘッダの使用を推奨する。 + + +## マクロ + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `__STDC_VERSION_STDBIT_H__` | ヘッダのバージョン (`202311L`) | C++26 | +| [`__STDC_ENDIAN_BIG__`](stdbit.h/stdc_endian_big.md) | ビッグエンディアンを表す定数 | C++26 | +| [`__STDC_ENDIAN_LITTLE__`](stdbit.h/stdc_endian_little.md) | リトルエンディアンを表す定数 | C++26 | +| [`__STDC_ENDIAN_NATIVE__`](stdbit.h/stdc_endian_native.md) | 実行環境のエンディアンを表す定数 | C++26 | + + +## 先頭のビットカウント + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`stdc_leading_zeros`](stdbit.h/stdc_leading_zeros.md) | 左から連続した0のビットを数える (function template) | C++26 | +| [`stdc_leading_ones`](stdbit.h/stdc_leading_ones.md) | 左から連続した1のビットを数える (function template) | C++26 | + + +## 末尾のビットカウント + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`stdc_trailing_zeros`](stdbit.h/stdc_trailing_zeros.md) | 右から連続した0のビットを数える (function template) | C++26 | +| [`stdc_trailing_ones`](stdbit.h/stdc_trailing_ones.md) | 右から連続した1のビットを数える (function template) | C++26 | + + +## 先頭のビット位置検索 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`stdc_first_leading_zero`](stdbit.h/stdc_first_leading_zero.md) | 左から最初の0のビット位置を求める (function template) | C++26 | +| [`stdc_first_leading_one`](stdbit.h/stdc_first_leading_one.md) | 左から最初の1のビット位置を求める (function template) | C++26 | + + +## 末尾のビット位置検索 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`stdc_first_trailing_zero`](stdbit.h/stdc_first_trailing_zero.md) | 右から最初の0のビット位置を求める (function template) | C++26 | +| [`stdc_first_trailing_one`](stdbit.h/stdc_first_trailing_one.md) | 右から最初の1のビット位置を求める (function template) | C++26 | + + +## ビット数カウント + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`stdc_count_zeros`](stdbit.h/stdc_count_zeros.md) | 0のビットを数える (function template) | C++26 | +| [`stdc_count_ones`](stdbit.h/stdc_count_ones.md) | 1のビットを数える (function template) | C++26 | + + +## 2の累乗整数 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`stdc_has_single_bit`](stdbit.h/stdc_has_single_bit.md) | 1ビットだけ立っている値をもっているか判定する (function template) | C++26 | +| [`stdc_bit_width`](stdbit.h/stdc_bit_width.md) | 値を表現するために必要なビット幅を求める (function template) | C++26 | +| [`stdc_bit_floor`](stdbit.h/stdc_bit_floor.md) | 整数値を2の累乗値に切り下げる (function template) | C++26 | +| [`stdc_bit_ceil`](stdbit.h/stdc_bit_ceil.md) | 整数値を2の累乗値に切り上げる (function template) | C++26 | + + +## バージョン +### 言語 +- C++26 + +### 処理系 + +- [Clang](/implementation.md#clang): 21 [mark verified] +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + + +## 関連項目 +- [``](bit.md) - C++標準のビット操作ライブラリ + + +## 参照 +- [N3022 Modern Bit Utilities](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3022.htm) +- [P3370R1 Add new C headers as C++ headers](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3370r1.html) \ No newline at end of file diff --git a/reference/stdbit.h/stdc_bit_ceil.md b/reference/stdbit.h/stdc_bit_ceil.md new file mode 100644 index 0000000000..0fa58f25cb --- /dev/null +++ b/reference/stdbit.h/stdc_bit_ceil.md @@ -0,0 +1,63 @@ +# stdc_bit_ceil +* stdbit.h[meta header] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +T stdc_bit_ceil(T value); + +unsigned char stdc_bit_ceil_uc(unsigned char value); +unsigned short stdc_bit_ceil_us(unsigned short value); +unsigned int stdc_bit_ceil_ui(unsigned int value); +unsigned long stdc_bit_ceil_ul(unsigned long value); +unsigned long long stdc_bit_ceil_ull(unsigned long long value); +``` + +## 概要 +整数値を2の累乗値に切り上げる。 + +C言語の``で定義される関数であり、C++においてはC互換性のために提供される。C言語では汎用版は型総称マクロ (type-generic macro) として定義されるが、C++では関数テンプレートとして提供される。 + +## テンプレートパラメータ制約 +- 型`T`が符号なし整数型であること + +## 戻り値 +`value`以上の最小の2の累乗値を返す。`value`が0または1なら1を返す。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + assert(stdc_bit_ceil(static_cast(5)) == 8); + assert(stdc_bit_ceil(static_cast(1)) == 1); + assert(stdc_bit_ceil(static_cast(0)) == 1); + + // 型別関数 + assert(stdc_bit_ceil_uc(static_cast(5)) == 8); +} +``` +* stdc_bit_ceil[color ff0000] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark verified] +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 関連項目 +- [`std::bit_ceil`](/reference/bit/bit_ceil.md) - C++標準の対応する機能 + +## 参照 +- [N3022 Modern Bit Utilities](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3022.htm) +- [P3370R1 Add new C headers as C++ headers](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3370r1.html) diff --git a/reference/stdbit.h/stdc_bit_floor.md b/reference/stdbit.h/stdc_bit_floor.md new file mode 100644 index 0000000000..e842687a30 --- /dev/null +++ b/reference/stdbit.h/stdc_bit_floor.md @@ -0,0 +1,63 @@ +# stdc_bit_floor +* stdbit.h[meta header] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +T stdc_bit_floor(T value); + +unsigned char stdc_bit_floor_uc(unsigned char value); +unsigned short stdc_bit_floor_us(unsigned short value); +unsigned int stdc_bit_floor_ui(unsigned int value); +unsigned long stdc_bit_floor_ul(unsigned long value); +unsigned long long stdc_bit_floor_ull(unsigned long long value); +``` + +## 概要 +整数値を2の累乗値に切り下げる。 + +C言語の``で定義される関数であり、C++においてはC互換性のために提供される。C言語では汎用版は型総称マクロ (type-generic macro) として定義されるが、C++では関数テンプレートとして提供される。 + +## テンプレートパラメータ制約 +- 型`T`が符号なし整数型であること + +## 戻り値 +`value`が0なら0、そうでなければ`value`以下の最大の2の累乗値を返す。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + assert(stdc_bit_floor(static_cast(5)) == 4); + assert(stdc_bit_floor(static_cast(0)) == 0); + assert(stdc_bit_floor(static_cast(8)) == 8); + + // 型別関数 + assert(stdc_bit_floor_uc(static_cast(5)) == 4); +} +``` +* stdc_bit_floor[color ff0000] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark verified] +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 関連項目 +- [`std::bit_floor`](/reference/bit/bit_floor.md) - C++標準の対応する機能 + +## 参照 +- [N3022 Modern Bit Utilities](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3022.htm) +- [P3370R1 Add new C headers as C++ headers](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3370r1.html) diff --git a/reference/stdbit.h/stdc_bit_width.md b/reference/stdbit.h/stdc_bit_width.md new file mode 100644 index 0000000000..27cb8da154 --- /dev/null +++ b/reference/stdbit.h/stdc_bit_width.md @@ -0,0 +1,63 @@ +# stdc_bit_width +* stdbit.h[meta header] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +unsigned int stdc_bit_width(T value); + +unsigned int stdc_bit_width_uc(unsigned char value); +unsigned int stdc_bit_width_us(unsigned short value); +unsigned int stdc_bit_width_ui(unsigned int value); +unsigned int stdc_bit_width_ul(unsigned long value); +unsigned int stdc_bit_width_ull(unsigned long long value); +``` + +## 概要 +値を表現するために必要なビット幅を求める。 + +C言語の``で定義される関数であり、C++においてはC互換性のために提供される。C言語では汎用版は型総称マクロ (type-generic macro) として定義されるが、C++では関数テンプレートとして提供される。 + +## テンプレートパラメータ制約 +- 型`T`が符号なし整数型であること + +## 戻り値 +`value`が0なら0、そうでなければfloor(log2(value)) + 1を返す。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + assert(stdc_bit_width(static_cast(0b0000'1000)) == 4); + assert(stdc_bit_width(static_cast(0)) == 0); + assert(stdc_bit_width(static_cast(0b0000'0001)) == 1); + + // 型別関数 + assert(stdc_bit_width_uc(static_cast(0b0000'1000)) == 4); +} +``` +* stdc_bit_width[color ff0000] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark verified] +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 関連項目 +- [`std::bit_width`](/reference/bit/bit_width.md) - C++標準の対応する機能 + +## 参照 +- [N3022 Modern Bit Utilities](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3022.htm) +- [P3370R1 Add new C headers as C++ headers](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3370r1.html) diff --git a/reference/stdbit.h/stdc_count_ones.md b/reference/stdbit.h/stdc_count_ones.md new file mode 100644 index 0000000000..c153406f4d --- /dev/null +++ b/reference/stdbit.h/stdc_count_ones.md @@ -0,0 +1,63 @@ +# stdc_count_ones +* stdbit.h[meta header] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +unsigned int stdc_count_ones(T value); + +unsigned int stdc_count_ones_uc(unsigned char value); +unsigned int stdc_count_ones_us(unsigned short value); +unsigned int stdc_count_ones_ui(unsigned int value); +unsigned int stdc_count_ones_ul(unsigned long value); +unsigned int stdc_count_ones_ull(unsigned long long value); +``` + +## 概要 +1のビットを数える (popcount)。 + +C言語の``で定義される関数であり、C++においてはC互換性のために提供される。C言語では汎用版は型総称マクロ (type-generic macro) として定義されるが、C++では関数テンプレートとして提供される。 + +## テンプレートパラメータ制約 +- 型`T`が符号なし整数型であること + +## 戻り値 +`value`中の1であるビットの数を返す。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + assert(stdc_count_ones(static_cast(0b1111'0000)) == 4); + assert(stdc_count_ones(static_cast(0b0000'0000)) == 0); + assert(stdc_count_ones(static_cast(0b1111'1111)) == 8); + + // 型別関数 + assert(stdc_count_ones_uc(static_cast(0b1111'0000)) == 4); +} +``` +* stdc_count_ones[color ff0000] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark verified] +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 関連項目 +- [`std::popcount`](/reference/bit/popcount.md) - C++標準の対応する機能 + +## 参照 +- [N3022 Modern Bit Utilities](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3022.htm) +- [P3370R1 Add new C headers as C++ headers](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3370r1.html) diff --git a/reference/stdbit.h/stdc_count_zeros.md b/reference/stdbit.h/stdc_count_zeros.md new file mode 100644 index 0000000000..159b6f36ee --- /dev/null +++ b/reference/stdbit.h/stdc_count_zeros.md @@ -0,0 +1,60 @@ +# stdc_count_zeros +* stdbit.h[meta header] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +unsigned int stdc_count_zeros(T value); + +unsigned int stdc_count_zeros_uc(unsigned char value); +unsigned int stdc_count_zeros_us(unsigned short value); +unsigned int stdc_count_zeros_ui(unsigned int value); +unsigned int stdc_count_zeros_ul(unsigned long value); +unsigned int stdc_count_zeros_ull(unsigned long long value); +``` + +## 概要 +0のビットを数える。 + +C言語の``で定義される関数であり、C++においてはC互換性のために提供される。C言語では汎用版は型総称マクロ (type-generic macro) として定義されるが、C++では関数テンプレートとして提供される。 + +## テンプレートパラメータ制約 +- 型`T`が符号なし整数型であること + +## 戻り値 +`value`中の0であるビットの数を返す。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + assert(stdc_count_zeros(static_cast(0b1111'0000)) == 4); + assert(stdc_count_zeros(static_cast(0b0000'0000)) == 8); + assert(stdc_count_zeros(static_cast(0b1111'1111)) == 0); + + // 型別関数 + assert(stdc_count_zeros_uc(static_cast(0b1111'0000)) == 4); +} +``` +* stdc_count_zeros[color ff0000] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark verified] +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 参照 +- [N3022 Modern Bit Utilities](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3022.htm) +- [P3370R1 Add new C headers as C++ headers](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3370r1.html) diff --git a/reference/stdbit.h/stdc_endian_big.md b/reference/stdbit.h/stdc_endian_big.md new file mode 100644 index 0000000000..2a653195f5 --- /dev/null +++ b/reference/stdbit.h/stdc_endian_big.md @@ -0,0 +1,30 @@ +# __STDC_ENDIAN_BIG__ +* stdbit.h[meta header] +* macro[meta id-type] +* cpp26[meta cpp] + +## 概要 +ビッグエンディアンを表す定数マクロ。 + +C言語の``で定義される定数であり、C++においてはC互換性のために提供される。 + +## 備考 +- C言語では``で定義される定数マクロである +- C++では、[`std::endian::big`](/reference/bit/endian.md)が対応する機能である + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark verified] +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + + +## 関連項目 +- [`std::endian`](/reference/bit/endian.md) - C++標準のエンディアン列挙型 + +## 参照 +- [N3022 Modern Bit Utilities](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3022.htm) +- [P3370R1 Add new C headers as C++ headers](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3370r1.html) diff --git a/reference/stdbit.h/stdc_endian_little.md b/reference/stdbit.h/stdc_endian_little.md new file mode 100644 index 0000000000..b1951eaa8c --- /dev/null +++ b/reference/stdbit.h/stdc_endian_little.md @@ -0,0 +1,30 @@ +# __STDC_ENDIAN_LITTLE__ +* stdbit.h[meta header] +* macro[meta id-type] +* cpp26[meta cpp] + +## 概要 +リトルエンディアンを表す定数マクロ。 + +C言語の``で定義される定数であり、C++においてはC互換性のために提供される。 + +## 備考 +- C言語では``で定義される定数マクロである +- C++では、[`std::endian::little`](/reference/bit/endian.md)が対応する機能である + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark verified] +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + + +## 関連項目 +- [`std::endian`](/reference/bit/endian.md) - C++標準のエンディアン列挙型 + +## 参照 +- [N3022 Modern Bit Utilities](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3022.htm) +- [P3370R1 Add new C headers as C++ headers](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3370r1.html) diff --git a/reference/stdbit.h/stdc_endian_native.md b/reference/stdbit.h/stdc_endian_native.md new file mode 100644 index 0000000000..bb4526edcb --- /dev/null +++ b/reference/stdbit.h/stdc_endian_native.md @@ -0,0 +1,30 @@ +# __STDC_ENDIAN_NATIVE__ +* stdbit.h[meta header] +* macro[meta id-type] +* cpp26[meta cpp] + +## 概要 +実行環境のエンディアンを表す定数マクロ。 + +C言語の``で定義される定数であり、C++においてはC互換性のために提供される。 + +## 備考 +- C言語では``で定義される定数マクロである +- C++では、[`std::endian::native`](/reference/bit/endian.md)が対応する機能である + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark verified] +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + + +## 関連項目 +- [`std::endian`](/reference/bit/endian.md) - C++標準のエンディアン列挙型 + +## 参照 +- [N3022 Modern Bit Utilities](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3022.htm) +- [P3370R1 Add new C headers as C++ headers](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3370r1.html) diff --git a/reference/stdbit.h/stdc_first_leading_one.md b/reference/stdbit.h/stdc_first_leading_one.md new file mode 100644 index 0000000000..95d9d6b7f6 --- /dev/null +++ b/reference/stdbit.h/stdc_first_leading_one.md @@ -0,0 +1,58 @@ +# stdc_first_leading_one +* stdbit.h[meta header] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +unsigned int stdc_first_leading_one(T value); + +unsigned int stdc_first_leading_one_uc(unsigned char value); +unsigned int stdc_first_leading_one_us(unsigned short value); +unsigned int stdc_first_leading_one_ui(unsigned int value); +unsigned int stdc_first_leading_one_ul(unsigned long value); +unsigned int stdc_first_leading_one_ull(unsigned long long value); +``` + +## 概要 +左から最初の1のビット位置を求める。 + +C言語の``で定義される関数であり、C++においてはC互換性のために提供される。C言語では汎用版は型総称マクロ (type-generic macro) として定義されるが、C++では関数テンプレートとして提供される。 + +## テンプレートパラメータ制約 +- 型`T`が符号なし整数型であること + +## 戻り値 +値`value`の最上位ビット (MSB) 側から数えて、最初の1ビットの位置を1始まりで返す。すべてのビットが0の場合は0を返す。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + // 0b00001111 の最初の1は5番目 (MSB側から) + assert(stdc_first_leading_one(static_cast(0b0000'1111)) == 5); + // すべて0なら0を返す + assert(stdc_first_leading_one(static_cast(0)) == 0); +} +``` +* stdc_first_leading_one[color ff0000] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark verified] +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 参照 +- [N3022 Modern Bit Utilities](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3022.htm) +- [P3370R1 Add new C headers as C++ headers](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3370r1.html) diff --git a/reference/stdbit.h/stdc_first_leading_zero.md b/reference/stdbit.h/stdc_first_leading_zero.md new file mode 100644 index 0000000000..5254f1f2fe --- /dev/null +++ b/reference/stdbit.h/stdc_first_leading_zero.md @@ -0,0 +1,58 @@ +# stdc_first_leading_zero +* stdbit.h[meta header] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +unsigned int stdc_first_leading_zero(T value); + +unsigned int stdc_first_leading_zero_uc(unsigned char value); +unsigned int stdc_first_leading_zero_us(unsigned short value); +unsigned int stdc_first_leading_zero_ui(unsigned int value); +unsigned int stdc_first_leading_zero_ul(unsigned long value); +unsigned int stdc_first_leading_zero_ull(unsigned long long value); +``` + +## 概要 +左から最初の0のビット位置を求める。 + +C言語の``で定義される関数であり、C++においてはC互換性のために提供される。C言語では汎用版は型総称マクロ (type-generic macro) として定義されるが、C++では関数テンプレートとして提供される。 + +## テンプレートパラメータ制約 +- 型`T`が符号なし整数型であること + +## 戻り値 +値`value`の最上位ビット (MSB) 側から数えて、最初の0ビットの位置を1始まりで返す。すべてのビットが1の場合は0を返す。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + // 0b11110000 の最初の0は5番目 (MSB側から) + assert(stdc_first_leading_zero(static_cast(0b1111'0000)) == 5); + // すべて1なら0を返す + assert(stdc_first_leading_zero(static_cast(0xFF)) == 0); +} +``` +* stdc_first_leading_zero[color ff0000] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark verified] +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 参照 +- [N3022 Modern Bit Utilities](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3022.htm) +- [P3370R1 Add new C headers as C++ headers](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3370r1.html) diff --git a/reference/stdbit.h/stdc_first_trailing_one.md b/reference/stdbit.h/stdc_first_trailing_one.md new file mode 100644 index 0000000000..459f50687b --- /dev/null +++ b/reference/stdbit.h/stdc_first_trailing_one.md @@ -0,0 +1,58 @@ +# stdc_first_trailing_one +* stdbit.h[meta header] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +unsigned int stdc_first_trailing_one(T value); + +unsigned int stdc_first_trailing_one_uc(unsigned char value); +unsigned int stdc_first_trailing_one_us(unsigned short value); +unsigned int stdc_first_trailing_one_ui(unsigned int value); +unsigned int stdc_first_trailing_one_ul(unsigned long value); +unsigned int stdc_first_trailing_one_ull(unsigned long long value); +``` + +## 概要 +右から最初の1のビット位置を求める。 + +C言語の``で定義される関数であり、C++においてはC互換性のために提供される。C言語では汎用版は型総称マクロ (type-generic macro) として定義されるが、C++では関数テンプレートとして提供される。 + +## テンプレートパラメータ制約 +- 型`T`が符号なし整数型であること + +## 戻り値 +値`value`の最下位ビット (LSB) 側から数えて、最初の1ビットの位置を1始まりで返す。すべてのビットが0の場合は0を返す。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + // 0b11110000 の最初の1は5番目 (LSB側から) + assert(stdc_first_trailing_one(static_cast(0b1111'0000)) == 5); + // すべて0なら0を返す + assert(stdc_first_trailing_one(static_cast(0)) == 0); +} +``` +* stdc_first_trailing_one[color ff0000] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark verified] +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 参照 +- [N3022 Modern Bit Utilities](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3022.htm) +- [P3370R1 Add new C headers as C++ headers](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3370r1.html) diff --git a/reference/stdbit.h/stdc_first_trailing_zero.md b/reference/stdbit.h/stdc_first_trailing_zero.md new file mode 100644 index 0000000000..9888350b24 --- /dev/null +++ b/reference/stdbit.h/stdc_first_trailing_zero.md @@ -0,0 +1,58 @@ +# stdc_first_trailing_zero +* stdbit.h[meta header] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +unsigned int stdc_first_trailing_zero(T value); + +unsigned int stdc_first_trailing_zero_uc(unsigned char value); +unsigned int stdc_first_trailing_zero_us(unsigned short value); +unsigned int stdc_first_trailing_zero_ui(unsigned int value); +unsigned int stdc_first_trailing_zero_ul(unsigned long value); +unsigned int stdc_first_trailing_zero_ull(unsigned long long value); +``` + +## 概要 +右から最初の0のビット位置を求める。 + +C言語の``で定義される関数であり、C++においてはC互換性のために提供される。C言語では汎用版は型総称マクロ (type-generic macro) として定義されるが、C++では関数テンプレートとして提供される。 + +## テンプレートパラメータ制約 +- 型`T`が符号なし整数型であること + +## 戻り値 +値`value`の最下位ビット (LSB) 側から数えて、最初の0ビットの位置を1始まりで返す。すべてのビットが1の場合は0を返す。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + // 0b00001111 の最初の0は5番目 (LSB側から) + assert(stdc_first_trailing_zero(static_cast(0b0000'1111)) == 5); + // すべて1なら0を返す + assert(stdc_first_trailing_zero(static_cast(0xFF)) == 0); +} +``` +* stdc_first_trailing_zero[color ff0000] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark verified] +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 参照 +- [N3022 Modern Bit Utilities](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3022.htm) +- [P3370R1 Add new C headers as C++ headers](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3370r1.html) diff --git a/reference/stdbit.h/stdc_has_single_bit.md b/reference/stdbit.h/stdc_has_single_bit.md new file mode 100644 index 0000000000..bbfdea1591 --- /dev/null +++ b/reference/stdbit.h/stdc_has_single_bit.md @@ -0,0 +1,63 @@ +# stdc_has_single_bit +* stdbit.h[meta header] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +bool stdc_has_single_bit(T value); + +bool stdc_has_single_bit_uc(unsigned char value); +bool stdc_has_single_bit_us(unsigned short value); +bool stdc_has_single_bit_ui(unsigned int value); +bool stdc_has_single_bit_ul(unsigned long value); +bool stdc_has_single_bit_ull(unsigned long long value); +``` + +## 概要 +1ビットだけ立っている値をもっているか判定する。 + +C言語の``で定義される関数であり、C++においてはC互換性のために提供される。C言語では汎用版は型総称マクロ (type-generic macro) として定義されるが、C++では関数テンプレートとして提供される。 + +## テンプレートパラメータ制約 +- 型`T`が符号なし整数型であること + +## 戻り値 +`value`が2の累乗値 (1ビットだけ立っている) であれば`true`、そうでなければ`false`を返す。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + assert(stdc_has_single_bit(static_cast(0b0000'1000)) == true); + assert(stdc_has_single_bit(static_cast(0b0000'1010)) == false); + assert(stdc_has_single_bit(static_cast(0)) == false); + + // 型別関数 + assert(stdc_has_single_bit_uc(static_cast(0b0000'1000)) == true); +} +``` +* stdc_has_single_bit[color ff0000] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark verified] +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 関連項目 +- [`std::has_single_bit`](/reference/bit/has_single_bit.md) - C++標準の対応する機能 + +## 参照 +- [N3022 Modern Bit Utilities](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3022.htm) +- [P3370R1 Add new C headers as C++ headers](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3370r1.html) diff --git a/reference/stdbit.h/stdc_leading_ones.md b/reference/stdbit.h/stdc_leading_ones.md new file mode 100644 index 0000000000..4eecf6032d --- /dev/null +++ b/reference/stdbit.h/stdc_leading_ones.md @@ -0,0 +1,62 @@ +# stdc_leading_ones +* stdbit.h[meta header] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +unsigned int stdc_leading_ones(T value); + +unsigned int stdc_leading_ones_uc(unsigned char value); +unsigned int stdc_leading_ones_us(unsigned short value); +unsigned int stdc_leading_ones_ui(unsigned int value); +unsigned int stdc_leading_ones_ul(unsigned long value); +unsigned int stdc_leading_ones_ull(unsigned long long value); +``` + +## 概要 +左から連続した1のビットを数える。 + +C言語の``で定義される関数であり、C++においてはC互換性のために提供される。C言語では汎用版は型総称マクロ (type-generic macro) として定義されるが、C++では関数テンプレートとして提供される。 + +## テンプレートパラメータ制約 +- 型`T`が符号なし整数型であること + +## 戻り値 +値`value`の、最上位ビット (MSB) から開始して連続した1ビットの数を返す。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + assert(stdc_leading_ones(static_cast(0b1110'0000)) == 3); + assert(stdc_leading_ones(static_cast(0xFF)) == 8); + + // 型別関数 + assert(stdc_leading_ones_uc(static_cast(0xFF)) == 8); +} +``` +* stdc_leading_ones[color ff0000] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark verified] +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 関連項目 +- [`std::countl_one`](/reference/bit/countl_one.md) - C++標準の対応する機能 + +## 参照 +- [N3022 Modern Bit Utilities](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3022.htm) +- [P3370R1 Add new C headers as C++ headers](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3370r1.html) diff --git a/reference/stdbit.h/stdc_leading_zeros.md b/reference/stdbit.h/stdc_leading_zeros.md new file mode 100644 index 0000000000..1c036179ee --- /dev/null +++ b/reference/stdbit.h/stdc_leading_zeros.md @@ -0,0 +1,62 @@ +# stdc_leading_zeros +* stdbit.h[meta header] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +unsigned int stdc_leading_zeros(T value); + +unsigned int stdc_leading_zeros_uc(unsigned char value); +unsigned int stdc_leading_zeros_us(unsigned short value); +unsigned int stdc_leading_zeros_ui(unsigned int value); +unsigned int stdc_leading_zeros_ul(unsigned long value); +unsigned int stdc_leading_zeros_ull(unsigned long long value); +``` + +## 概要 +左から連続した0のビットを数える。 + +C言語の``で定義される関数であり、C++においてはC互換性のために提供される。C言語では汎用版は型総称マクロ (type-generic macro) として定義されるが、C++では関数テンプレートとして提供される。 + +## テンプレートパラメータ制約 +- 型`T`が符号なし整数型であること + +## 戻り値 +値`value`の、最上位ビット (MSB) から開始して連続した0ビットの数を返す。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + assert(stdc_leading_zeros(static_cast(0b0001'0000'0000'0000'0000'0000'0000'0000u)) == 3); + assert(stdc_leading_zeros(static_cast(0)) == 8); + + // 型別関数 + assert(stdc_leading_zeros_uc(static_cast(0)) == 8); +} +``` +* stdc_leading_zeros[color ff0000] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark verified] +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 関連項目 +- [`std::countl_zero`](/reference/bit/countl_zero.md) - C++標準の対応する機能 + +## 参照 +- [N3022 Modern Bit Utilities](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3022.htm) +- [P3370R1 Add new C headers as C++ headers](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3370r1.html) diff --git a/reference/stdbit.h/stdc_trailing_ones.md b/reference/stdbit.h/stdc_trailing_ones.md new file mode 100644 index 0000000000..c04a229fa9 --- /dev/null +++ b/reference/stdbit.h/stdc_trailing_ones.md @@ -0,0 +1,62 @@ +# stdc_trailing_ones +* stdbit.h[meta header] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +unsigned int stdc_trailing_ones(T value); + +unsigned int stdc_trailing_ones_uc(unsigned char value); +unsigned int stdc_trailing_ones_us(unsigned short value); +unsigned int stdc_trailing_ones_ui(unsigned int value); +unsigned int stdc_trailing_ones_ul(unsigned long value); +unsigned int stdc_trailing_ones_ull(unsigned long long value); +``` + +## 概要 +右から連続した1のビットを数える。 + +C言語の``で定義される関数であり、C++においてはC互換性のために提供される。C言語では汎用版は型総称マクロ (type-generic macro) として定義されるが、C++では関数テンプレートとして提供される。 + +## テンプレートパラメータ制約 +- 型`T`が符号なし整数型であること + +## 戻り値 +値`value`の、最下位ビット (LSB) から開始して連続した1ビットの数を返す。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + assert(stdc_trailing_ones(static_cast(0b0000'0111)) == 3); + assert(stdc_trailing_ones(static_cast(0xFF)) == 8); + + // 型別関数 + assert(stdc_trailing_ones_uc(static_cast(0xFF)) == 8); +} +``` +* stdc_trailing_ones[color ff0000] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark verified] +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 関連項目 +- [`std::countr_one`](/reference/bit/countr_one.md) - C++標準の対応する機能 + +## 参照 +- [N3022 Modern Bit Utilities](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3022.htm) +- [P3370R1 Add new C headers as C++ headers](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3370r1.html) diff --git a/reference/stdbit.h/stdc_trailing_zeros.md b/reference/stdbit.h/stdc_trailing_zeros.md new file mode 100644 index 0000000000..89cc7c8b9a --- /dev/null +++ b/reference/stdbit.h/stdc_trailing_zeros.md @@ -0,0 +1,62 @@ +# stdc_trailing_zeros +* stdbit.h[meta header] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +unsigned int stdc_trailing_zeros(T value); + +unsigned int stdc_trailing_zeros_uc(unsigned char value); +unsigned int stdc_trailing_zeros_us(unsigned short value); +unsigned int stdc_trailing_zeros_ui(unsigned int value); +unsigned int stdc_trailing_zeros_ul(unsigned long value); +unsigned int stdc_trailing_zeros_ull(unsigned long long value); +``` + +## 概要 +右から連続した0のビットを数える。 + +C言語の``で定義される関数であり、C++においてはC互換性のために提供される。C言語では汎用版は型総称マクロ (type-generic macro) として定義されるが、C++では関数テンプレートとして提供される。 + +## テンプレートパラメータ制約 +- 型`T`が符号なし整数型であること + +## 戻り値 +値`value`の、最下位ビット (LSB) から開始して連続した0ビットの数を返す。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + assert(stdc_trailing_zeros(static_cast(0b0000'0000'0000'0000'0000'0000'0000'1000u)) == 3); + assert(stdc_trailing_zeros(static_cast(0)) == 8); + + // 型別関数 + assert(stdc_trailing_zeros_uc(static_cast(0)) == 8); +} +``` +* stdc_trailing_zeros[color ff0000] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark verified] +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 関連項目 +- [`std::countr_zero`](/reference/bit/countr_zero.md) - C++標準の対応する機能 + +## 参照 +- [N3022 Modern Bit Utilities](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3022.htm) +- [P3370R1 Add new C headers as C++ headers](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3370r1.html) diff --git a/reference/stdckdint.h.md b/reference/stdckdint.h.md new file mode 100644 index 0000000000..5ebe723c69 --- /dev/null +++ b/reference/stdckdint.h.md @@ -0,0 +1,41 @@ +# stdckdint.h +* stdckdint.h[meta header] +* cpp26[meta cpp] + +``はC23で追加された検査付き整数演算ライブラリをC++から使用するための互換ヘッダである。 + +C言語では型総称マクロ (type-generic macro) として提供される関数が、C++では関数テンプレートとして提供される。 + +このヘッダで宣言される関数およびマクロは`std`名前空間に属さず、グローバル名前空間に定義される。C++の対応するヘッダとして``は提供されない。これは、C言語との相互運用性を重視し、CとC++の両方でコンパイル可能なコードを記述できるようにするためである。 + + +## マクロ + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| `__STDC_VERSION_STDCKDINT_H__` | ヘッダのバージョン (`202311L`) | C++26 | + + +## 検査付き整数演算 + +| 名前 | 説明 | 対応バージョン | +|------|------|----------------| +| [`ckd_add`](stdckdint.h/ckd_add.md) | 検査付き整数の加算 (function template) | C++26 | +| [`ckd_sub`](stdckdint.h/ckd_sub.md) | 検査付き整数の減算 (function template) | C++26 | +| [`ckd_mul`](stdckdint.h/ckd_mul.md) | 検査付き整数の乗算 (function template) | C++26 | + + +## バージョン +### 言語 +- C++26 + +### 処理系 + +- [Clang](/implementation.md#clang): 21 [mark verified] +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + + +## 参照 +- [N2683 Towards Integer Safety](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2683.pdf) +- [P3370R1 Add new C headers as C++ headers](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3370r1.html) \ No newline at end of file diff --git a/reference/stdckdint.h/ckd_add.md b/reference/stdckdint.h/ckd_add.md new file mode 100644 index 0000000000..b91887fe17 --- /dev/null +++ b/reference/stdckdint.h/ckd_add.md @@ -0,0 +1,61 @@ +# ckd_add +* stdckdint.h[meta header] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +bool ckd_add(type1* result, type2 a, type3 b); +``` + +## 概要 +検査付きの整数の加算を行う。`a + b`を計算し、結果を`result`が指す先に格納する。オーバーフローが発生した場合は`true`を返す。 + +C言語の``で定義される関数であり、C++においてはC互換性のために提供される。C言語では型総称マクロ (type-generic macro) として定義されるが、C++では関数テンプレートとして提供される。 + +## テンプレートパラメータ制約 +- `type1`、`type2`、`type3`はいずれも符号付き整数型または符号なし整数型であること + +## 戻り値 +`a + b`の数学的な結果が`type1`で表現可能な範囲を超える場合 (オーバーフロー) は`true`を返し、そうでなければ`false`を返す。 + +## 効果 +`a + b`の数学的な結果を`type1`に変換した値を`*result`に格納する。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + int result = 0; + + // オーバーフローしない場合 + bool overflow = ckd_add(&result, 1, 2); + assert(!overflow); + assert(result == 3); + + // オーバーフローする場合 + overflow = ckd_add(&result, INT_MAX, 1); + assert(overflow); +} +``` +* ckd_add[color ff0000] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark verified] +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 参照 +- [N2683 Towards Integer Safety](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2683.pdf) +- [P3370R1 Add new C headers as C++ headers](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3370r1.html) diff --git a/reference/stdckdint.h/ckd_mul.md b/reference/stdckdint.h/ckd_mul.md new file mode 100644 index 0000000000..e476ab4630 --- /dev/null +++ b/reference/stdckdint.h/ckd_mul.md @@ -0,0 +1,61 @@ +# ckd_mul +* stdckdint.h[meta header] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +bool ckd_mul(type1* result, type2 a, type3 b); +``` + +## 概要 +検査付きの整数の乗算を行う。`a * b`を計算し、結果を`result`が指す先に格納する。オーバーフローが発生した場合は`true`を返す。 + +C言語の``で定義される関数であり、C++においてはC互換性のために提供される。C言語では型総称マクロ (type-generic macro) として定義されるが、C++では関数テンプレートとして提供される。 + +## テンプレートパラメータ制約 +- `type1`、`type2`、`type3`はいずれも符号付き整数型または符号なし整数型であること + +## 戻り値 +`a * b`の数学的な結果が`type1`で表現可能な範囲を超える場合 (オーバーフロー) は`true`を返し、そうでなければ`false`を返す。 + +## 効果 +`a * b`の数学的な結果を`type1`に変換した値を`*result`に格納する。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + int result = 0; + + // オーバーフローしない場合 + bool overflow = ckd_mul(&result, 3, 4); + assert(!overflow); + assert(result == 12); + + // オーバーフローする場合 + overflow = ckd_mul(&result, INT_MAX, 2); + assert(overflow); +} +``` +* ckd_mul[color ff0000] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark verified] +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 参照 +- [N2683 Towards Integer Safety](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2683.pdf) +- [P3370R1 Add new C headers as C++ headers](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3370r1.html) diff --git a/reference/stdckdint.h/ckd_sub.md b/reference/stdckdint.h/ckd_sub.md new file mode 100644 index 0000000000..e5262da8eb --- /dev/null +++ b/reference/stdckdint.h/ckd_sub.md @@ -0,0 +1,61 @@ +# ckd_sub +* stdckdint.h[meta header] +* function template[meta id-type] +* cpp26[meta cpp] + +```cpp +template +bool ckd_sub(type1* result, type2 a, type3 b); +``` + +## 概要 +検査付きの整数の減算を行う。`a - b`を計算し、結果を`result`が指す先に格納する。オーバーフローが発生した場合は`true`を返す。 + +C言語の``で定義される関数であり、C++においてはC互換性のために提供される。C言語では型総称マクロ (type-generic macro) として定義されるが、C++では関数テンプレートとして提供される。 + +## テンプレートパラメータ制約 +- `type1`、`type2`、`type3`はいずれも符号付き整数型または符号なし整数型であること + +## 戻り値 +`a - b`の数学的な結果が`type1`で表現可能な範囲を超える場合 (オーバーフロー) は`true`を返し、そうでなければ`false`を返す。 + +## 効果 +`a - b`の数学的な結果を`type1`に変換した値を`*result`に格納する。 + +## 例 +```cpp example +#include +#include +#include + +int main() { + int result = 0; + + // オーバーフローしない場合 + bool overflow = ckd_sub(&result, 1, 2); + assert(!overflow); + assert(result == -1); + + // オーバーフローする場合 + overflow = ckd_sub(&result, INT_MIN, 1); + assert(overflow); +} +``` +* ckd_sub[color ff0000] + +### 出力 +``` +``` + +## バージョン +### 言語 +- C++26 + +### 処理系 +- [Clang](/implementation.md#clang): 21 [mark verified] +- [GCC](/implementation.md#gcc): 15 [mark verified] +- [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] + +## 参照 +- [N2683 Towards Integer Safety](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2683.pdf) +- [P3370R1 Add new C headers as C++ headers](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3370r1.html) From e78928366cfb9a6e9a8382178270ef6f37fa7dfc Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 6 Apr 2026 14:09:24 +0900 Subject: [PATCH 2687/3948] =?UTF-8?q?C++26=20:=20=E3=80=8C=E3=82=B3?= =?UTF-8?q?=E3=83=B3=E3=83=91=E3=82=A4=E3=83=AB=E6=99=82=E3=81=AB=E3=81=AE?= =?UTF-8?q?=E3=81=BF=E4=BD=BF=E7=94=A8=E3=81=95=E3=82=8C=E3=82=8B=E6=96=87?= =?UTF-8?q?=E5=AD=97=E5=88=97=E3=81=AE=E6=89=B1=E3=81=84=E3=82=92=E6=98=8E?= =?UTF-8?q?=E7=A2=BA=E5=8C=96=E3=80=8D=E3=82=92=E8=BF=BD=E5=8A=A0=20(close?= =?UTF-8?q?=20#1174)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp11/constexpr.md | 1 + lang/cpp11/static_assert.md | 1 + lang/cpp14/deprecated_attr.md | 1 + lang/cpp17/nodiscard.md | 1 + lang/cpp26.md | 2 +- ...on-encodable_string_literals_ill-formed.md | 1 + lang/cpp26/unevaluated_strings.md | 78 +++++++++++++++++++ .../user-generated_static_assert_messages.md | 1 + 9 files changed, 86 insertions(+), 2 deletions(-) create mode 100644 lang/cpp26/unevaluated_strings.md diff --git a/implementation-status.md b/implementation-status.md index 4274c7a208..cb08534812 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -297,7 +297,7 @@ | P2752R3: [`std::initializer_list`の配列を静的記憶域に配置する](/lang/cpp26/static_storage_for_braced_initializers.md) | `std::vector v = {1, 2, 3};`のような初期化で初期化子リストを静的記憶域に配置することで無駄なコピーをなくす | 14 | | | | | P2169R4: [宣言のみで使用しない変数の名前として`_`をサポート](/lang/cpp26/nice_placeholder_with_no_name.md) | 変数名`_`は暗黙で`[[maybe_unused]]`が指定される | 14 | 18 | | | | P1854R4: [文字列リテラルの文字エンコーディング失敗を不適格とする](/lang/cpp26/making_non-encodable_string_literals_ill-formed.md) | 文字列リテラルのエンコーディング時に文字表現が失われる場合にコンパイルエラーにする | 14 | 14 | | | -| P2361R6: [コンパイル時にのみ使用される文字列の扱いを明確化](/lang/cpp26/unevaluated_strings.md.nolink) | `static_assert`や`[[deprecated]]`などで使用されるコンパイル時の文字列について、文字コードの指定を禁止し、実行時エンコーディングが行われないことを規定 | 14 | 18 | | | +| P2361R6: [コンパイル時にのみ使用される文字列の扱いを明確化](/lang/cpp26/unevaluated_strings.md) | `static_assert`や`[[deprecated]]`などで使用されるコンパイル時の文字列について、文字コードの指定を禁止し、実行時エンコーディングが行われないことを規定 | 14 | 18 | | | | P2552R3: [属性の無視性を見直し](/lang/cpp26/on_the_ignorability_of_standard_attributes.md) | 構文として適格な属性のみを無視できるようにし、そうでない属性の使用を不適格とする | 15 | | | | | P2738R1: [定数式での`void*`からポインタ型へのキャストを許可](/lang/cpp26/constexpr_cast_from_voidptr.md) | 型消去のために`void*`からポインタ型へのキャストを許可する | 14 | 17 | | | | P2741R3: [`static_assert`の診断メッセージにユーザーが生成した文字列の指定を許可](/lang/cpp26/user-generated_static_assert_messages.md) | `constexpr`な`S.size()`と`S.data()`メンバ関数をもつオブジェクトをコンパイル時文字列として指定できるようにする | 14 | 17 | | | diff --git a/lang/cpp11/constexpr.md b/lang/cpp11/constexpr.md index 6a133d179b..d9863f987f 100644 --- a/lang/cpp11/constexpr.md +++ b/lang/cpp11/constexpr.md @@ -220,6 +220,7 @@ GCC 5.2、Clang 3.7、Visual C++ 2015時点で、3つともデフォルトは512 - [C++26 `constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md) - [C++26 `constexpr`構造化束縛の許可と、`constexpr`参照の制限緩和](/lang/cpp26/constexpr_structured_bindings_and_references_to_constexpr_variables.md) - [C++26 `constexpr`仮想継承を許可](/lang/cpp26/constexpr_virtual_inheritance.md) +- [C++26 コンパイル時にのみ使用される文字列の扱いを明確化](/lang/cpp26/unevaluated_strings.md) ## 参照 diff --git a/lang/cpp11/static_assert.md b/lang/cpp11/static_assert.md index be660e97d9..8787129d1a 100644 --- a/lang/cpp11/static_assert.md +++ b/lang/cpp11/static_assert.md @@ -93,6 +93,7 @@ Boost Static Assertion Libraryが開発されたときに、コンパイル時 - [C++17 constexpr if 文](/lang/cpp17/if_constexpr.md) - [C++23 定数式の文脈での`bool`への縮小変換を許可](/lang/cpp23/narrowing_contextual_conversions_to_bool.md) - [C++26 `static_assert`の診断メッセージにユーザーが生成した文字列の指定を許可](/lang/cpp26/user-generated_static_assert_messages.md) +- [C++26 コンパイル時にのみ使用される文字列の扱いを明確化](/lang/cpp26/unevaluated_strings.md) ## 参照 diff --git a/lang/cpp14/deprecated_attr.md b/lang/cpp14/deprecated_attr.md index 352adfda51..26375e0aa0 100644 --- a/lang/cpp14/deprecated_attr.md +++ b/lang/cpp14/deprecated_attr.md @@ -132,6 +132,7 @@ prog.cc:45:3: warning: 'class_templ' is deprecated: don't use class_templ関連項目 - [C++11 属性構文](/lang/cpp11/attributes.md) - [C++23 ラムダ式に対する属性](/lang/cpp23/attributes_on_lambda_expressions.md) +- [C++26 コンパイル時にのみ使用される文字列の扱いを明確化](/lang/cpp26/unevaluated_strings.md) ## 参照 diff --git a/lang/cpp17/nodiscard.md b/lang/cpp17/nodiscard.md index 2682e4cf94..3e3fffa0d0 100644 --- a/lang/cpp17/nodiscard.md +++ b/lang/cpp17/nodiscard.md @@ -62,6 +62,7 @@ nodiscard.cpp:11:3: warning: ignoring return value of function declared with 'no - C++17対応のコンパイラでも使用できる可能性がある - [C++20 `[[nodiscard]]`属性に理由となる文字列を付加できるようにする](/lang/cpp20/nodiscard_should_have_a_reason.md) - [C++23 ラムダ式に対する属性](/lang/cpp23/attributes_on_lambda_expressions.md) +- [C++26 コンパイル時にのみ使用される文字列の扱いを明確化](/lang/cpp26/unevaluated_strings.md) ## 参照 diff --git a/lang/cpp26.md b/lang/cpp26.md index b4b8b5c2b0..64860318ab 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -25,7 +25,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| | [文字列リテラルの文字エンコーディング失敗を不適格とする](/lang/cpp26/making_non-encodable_string_literals_ill-formed.md) | 文字列リテラルのエンコーディング時に文字表現が失われる場合にコンパイルエラーにする | -| [コンパイル時にのみ使用される文字列の扱いを明確化](/lang/cpp26/unevaluated_strings.md.nolink) | `static_assert`や`[[deprecated]]`などで使用されるコンパイル時の文字列について、文字コードの指定を禁止し、実行時エンコーディングが行われないことを規定 | +| [コンパイル時にのみ使用される文字列の扱いを明確化](/lang/cpp26/unevaluated_strings.md) | `static_assert`や`[[deprecated]]`などで使用されるコンパイル時の文字列について、文字コードの指定を禁止し、実行時エンコーディングが行われないことを規定 | ### 分岐・ループ diff --git a/lang/cpp26/making_non-encodable_string_literals_ill-formed.md b/lang/cpp26/making_non-encodable_string_literals_ill-formed.md index 629db80db0..900b5e539c 100644 --- a/lang/cpp26/making_non-encodable_string_literals_ill-formed.md +++ b/lang/cpp26/making_non-encodable_string_literals_ill-formed.md @@ -29,6 +29,7 @@ char c = 'é'; // C++23:実装定義, C++26:NG グレイブアクセントをつ ## 関連項目 - [C++23 1ワイド文字に収まらないワイド文字リテラルを禁止する](/lang/cpp23/remove_non_encodable_wide_character_literals_and_multicharacter_wide_character_literals.md) +- [C++26 コンパイル時にのみ使用される文字列の扱いを明確化](/lang/cpp26/unevaluated_strings.md) ## 参照 diff --git a/lang/cpp26/unevaluated_strings.md b/lang/cpp26/unevaluated_strings.md new file mode 100644 index 0000000000..80c4ab42ee --- /dev/null +++ b/lang/cpp26/unevaluated_strings.md @@ -0,0 +1,78 @@ +# コンパイル時にのみ使用される文字列の扱いを明確化 [P2361R6] +* cpp26[meta cpp] + + + +このページはC++26に採用される見込みの言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 + + + +## 概要 +文字列リテラルは、文字配列の初期化だけでなく、コンパイル時の診断メッセージやプリプロセッシング、その他の実装定義の動作にも使用される。これらのコンパイル時にのみ使用される文字列は「非評価文字列 (unevaluated string)」と呼ばれ、実行時のエンコーディングに変換されることはない。 + +C++26では、非評価文字列が使用される文脈を明確にし、これらの文字列に対して以下の制約を設ける: + +- エンコーディングプレフィックス (`L`, `u`, `U`, `u8`) は許可されない +- 文字列は実行時エンコーディングに変換されない +- ユニバーサルキャラクタ名および (単純な) エスケープシーケンス (`\0`を除く) はUnicodeコードポイントに置換され、数値エスケープシーケンスなどその他のエスケープシーケンスは不適格となる + +これらの変更は既存コードとの互換性を崩す変更 (破壊的変更) ではあるが、オープンソースプロジェクトの調査では、既存コードへの影響はほぼないとされている。 + + +## 非評価文字列が使用される文脈 + +| 文脈 | 説明 | +|-----------|------| +| [`static_assert`](/lang/cpp11/static_assert.md) | 表明失敗時の診断メッセージ | +| [`[[deprecated]]`](/lang/cpp14/deprecated_attr.md) | 非推奨の理由メッセージ | +| [`[[nodiscard]]`](/lang/cpp17/nodiscard.md) | 戻り値無視時の警告メッセージ | +| [`= delete`](/lang/cpp26/delete_reason.md) | 削除された関数の診断メッセージ | +| `extern` | リンケージ指定の文字列 (例: `extern "C"`) | +| `_Pragma` | プリプロセッサプラグマの文字列 | +| `asm` | インラインアセンブリの文字列 | +| `#line` | 行番号ディレクティブのファイル名 | +| リテラル演算子 | ユーザー定義リテラルの接尾辞識別 | + + +## 仕様 +### エンコーディングプレフィックスの禁止 +非評価文字列には、エンコーディングプレフィックスを指定できない。 + +```cpp +// C++23まで: 実装定義の動作 +// C++26: 不適格 +static_assert(true, L"message"); +static_assert(true, u8"message"); + +// C++26: OK +static_assert(true, "message"); +``` + +### エスケープシーケンスの制限 +非評価文字列では、ユニバーサルキャラクタ名 (`\uNNNN`, `\UNNNNNNNN`) と (単純な) エスケープシーケンス (`\\`, `\"`, `\n`など。ただし`\0`を除く) のみが許可される。数値エスケープシーケンス (`\x1B`, `\012`など) は不適格となる。 + +```cpp +// C++26: OK +static_assert(true, "hello\nworld"); // エスケープシーケンス +static_assert(true, "\u0041"); // ユニバーサルキャラクタ名 + +// C++26: 不適格 (数値エスケープシーケンス) +static_assert(true, "\x48\x65\x6c\x6c\x6f"); +``` + +これは、コンパイラが非評価文字列を実行時エンコーディングに変換しないため、数値エスケープシーケンスによるコードユニットの直接指定が意味を持たないためである。 + + +## 関連項目 +- [C++11 `constexpr`](/lang/cpp11/constexpr.md) +- [C++11 コンパイル時アサート](/lang/cpp11/static_assert.md) +- [C++14 `[[deprecated]]`属性](/lang/cpp14/deprecated_attr.md) +- [C++17 `[[nodiscard]]`属性](/lang/cpp17/nodiscard.md) +- [C++26 文字列リテラルの文字エンコーディング失敗を不適格とする](/lang/cpp26/making_non-encodable_string_literals_ill-formed.md) +- [C++26 `static_assert`の診断メッセージにユーザーが生成した文字列の指定を許可](/lang/cpp26/user-generated_static_assert_messages.md) + + +## 参照 +- [P2361R6 Unevaluated Strings](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2361r6.pdf) diff --git a/lang/cpp26/user-generated_static_assert_messages.md b/lang/cpp26/user-generated_static_assert_messages.md index 3e2bdefa70..69db5cc74d 100644 --- a/lang/cpp26/user-generated_static_assert_messages.md +++ b/lang/cpp26/user-generated_static_assert_messages.md @@ -54,6 +54,7 @@ static_assert(定数式, 診断メッセージ); ## 関連項目 - [C++11 コンパイル時アサート](/lang/cpp11/static_assert.md) - [C++17 `static_assert`のメッセージ省略を許可](/lang/cpp17/extending_static_assert.md) +- [C++26 コンパイル時にのみ使用される文字列の扱いを明確化](/lang/cpp26/unevaluated_strings.md) ## 参照 From 25ce68bf3ca8716fcc62f3e6e3b7068b4bc65a64 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 6 Apr 2026 18:01:01 +0900 Subject: [PATCH 2688/3948] =?UTF-8?q?C++26:=20=E3=80=8C=E5=85=B1=E7=94=A8?= =?UTF-8?q?=E4=BD=93=E3=81=AE=E7=89=B9=E6=AE=8A=E3=83=A1=E3=83=B3=E3=83=90?= =?UTF-8?q?=E9=96=A2=E6=95=B0=E3=81=AE=E3=83=88=E3=83=AA=E3=83=93=E3=82=A2?= =?UTF-8?q?=E3=83=AB=E5=8C=96=E3=80=8D=E3=82=92=E8=BF=BD=E5=8A=A0=20(close?= =?UTF-8?q?=20#1417)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp11/constexpr.md | 1 + lang/cpp26.md | 2 +- lang/cpp26/constexpr_placement_new.md | 1 + lang/cpp26/feature_test_macros.md | 2 +- lang/cpp26/trivial_unions.md | 129 +++++++++++++++++++++ reference/inplace_vector/inplace_vector.md | 4 + 7 files changed, 138 insertions(+), 3 deletions(-) create mode 100644 lang/cpp26/trivial_unions.md diff --git a/implementation-status.md b/implementation-status.md index cb08534812..f6ae8fcc66 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -321,7 +321,7 @@ | P2865R6: [非推奨だった組み込み配列の比較を削除](/lang/cpp26/remove_deprecated_array_comparisons.md) | C++20で非推奨となっていた配列比較を削除 | 15 | 20 | | | | P1061R10: [構造化束縛でパックを導入できるようにする](/lang/cpp26/structured_bindings_can_introduce_a_pack.md) | タプルを分解する際に複数の変数をパックとして宣言できるようにする。`auto [a, ...xs] = f();` | | | | | | P3176R0: [先行するカンマのない省略記号を非推奨化](/lang/cpp26/the_oxford_variadic_comma.md) | `void f(int, ...);`はOK。`void f(int...);`は非推奨 | 15 | 20 | | | -| P3074R7: [共用体をトリビアルに未初期化できるようにする](/lang/cpp26/trivial_unions.md.nolink) | `constexpr`での`union U { T storage[N]; };`を許可し、未初期化にできるようにする | | | | | +| P3074R7: [共用体の特殊メンバ関数のトリビアル化](/lang/cpp26/trivial_unions.md) | 非トリビアルな型をメンバにもつ共用体のデフォルトコンストラクタとデストラクタをトリビアルにし、未初期化ストレージとして使用可能にする | | | | | | P2900R14: [契約プログラミングをサポートする](/lang/cpp26/contracts.md) | 関数の事前条件、事後条件、不変条件を記述できるようにする | | | | | | P2841R7: [コンセプトと変数テンプレートにテンプレートテンプレートパラメータのサポートを追加](/lang/cpp26/concept_and_variable-template_template-parameters.md.nolink) | テンプレート引数をあとで指定するテンプレートテンプレートパラメータを、コンセプトと変数テンプレートでも使用できるようにする | | | | | | P1967R14: [ファイルを読み込む`#embed`命令を追加](/lang/cpp26/embed.md) | バイナリファイルをインクルードするメカニズム。`#include`とちがって読み出しサイズなどの柔軟な指定ができる | 15 | | | | diff --git a/lang/cpp11/constexpr.md b/lang/cpp11/constexpr.md index d9863f987f..bf20a1eb03 100644 --- a/lang/cpp11/constexpr.md +++ b/lang/cpp11/constexpr.md @@ -220,6 +220,7 @@ GCC 5.2、Clang 3.7、Visual C++ 2015時点で、3つともデフォルトは512 - [C++26 `constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md) - [C++26 `constexpr`構造化束縛の許可と、`constexpr`参照の制限緩和](/lang/cpp26/constexpr_structured_bindings_and_references_to_constexpr_variables.md) - [C++26 `constexpr`仮想継承を許可](/lang/cpp26/constexpr_virtual_inheritance.md) +- [C++26 共用体の特殊メンバ関数のトリビアル化](/lang/cpp26/trivial_unions.md) - [C++26 コンパイル時にのみ使用される文字列の扱いを明確化](/lang/cpp26/unevaluated_strings.md) diff --git a/lang/cpp26.md b/lang/cpp26.md index 64860318ab..9d8edb1b10 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -49,7 +49,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| -| [共用体をトリビアルに未初期化できるようにする](/lang/cpp26/trivial_unions.md.nolink) | `constexpr`での`union U { T storage[N]; };`を許可し、未初期化にできるようにする | +| [共用体の特殊メンバ関数のトリビアル化](/lang/cpp26/trivial_unions.md) | 非トリビアルな型をメンバにもつ共用体のデフォルトコンストラクタとデストラクタをトリビアルにし、未初期化ストレージとして使用可能にする | ### 属性 diff --git a/lang/cpp26/constexpr_placement_new.md b/lang/cpp26/constexpr_placement_new.md index 1004d155c8..81ca0c41a3 100644 --- a/lang/cpp26/constexpr_placement_new.md +++ b/lang/cpp26/constexpr_placement_new.md @@ -37,6 +37,7 @@ C++20では、[`std::construct_at()`](/reference/memory/construct_at.md)関数 ## 関連項目 - [C++11 constexpr](/lang/cpp11/constexpr.md) +- [C++26 共用体の特殊メンバ関数のトリビアル化](/lang/cpp26/trivial_unions.md) - [`new`演算子](/reference/new/op_new.md) - [`new[]`演算子](/reference/new/op_new[].md) diff --git a/lang/cpp26/feature_test_macros.md b/lang/cpp26/feature_test_macros.md index d52c6df881..2e9389fbee 100755 --- a/lang/cpp26/feature_test_macros.md +++ b/lang/cpp26/feature_test_macros.md @@ -29,7 +29,7 @@ |`__cpp_structured_bindings`|`202411L`|[構造化束縛への属性を許可](/lang/cpp26/attributes_for_structured_bindings.md)
[構造化束縛でパックを導入できるようにする](/lang/cpp26/structured_bindings_can_introduce_a_pack.md)| |`__cpp_template_parameters`|`202502L`|コンセプトと変数テンプレートにテンプレートテンプレートパラメータのサポートを追加| |`__cpp_trivial_relocatability`|`202502L`|トリビアルな再配置| -|`__cpp_trivial_union`|`202502L`|共用体をトリビアルに未初期化できるようにする| +|`__cpp_trivial_union`|`202502L`|[共用体の特殊メンバ関数のトリビアル化](/lang/cpp26/trivial_unions.md)| |`__cpp_variadic_friend`|`202403L`|[可変引数テンプレートで`friend`宣言をできるようにする](/lang/cpp26/variadic_friends.md)| diff --git a/lang/cpp26/trivial_unions.md b/lang/cpp26/trivial_unions.md new file mode 100644 index 0000000000..bca9abfe90 --- /dev/null +++ b/lang/cpp26/trivial_unions.md @@ -0,0 +1,129 @@ +# 共用体の特殊メンバ関数のトリビアル化 [P3074R7] +* cpp26[meta cpp] + + + +このページはC++26に採用される見込みの言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 + + + +## 概要 +C++26では、共用体 (`union`) のデフォルトコンストラクタとデストラクタの規則を変更し、より多くの場合にトリビアル (trivial) となるようにする。 + +これにより、非トリビアルな型のメンバをもつ共用体を未初期化のストレージとして`constexpr`の文脈で使用できるようになる。 + +```cpp +template +struct FixedVector { + union { T storage[N]; }; + size_t size = 0; + + // C++23まで: unionのコンストラクタ/デストラクタが削除されるためコンパイルエラー + // C++26: OK。unionのコンストラクタ/デストラクタはトリビアル + constexpr FixedVector() = default; + + constexpr ~FixedVector() { + std::destroy(storage, storage + size); + } + + constexpr auto push_back(T const& v) -> void { + std::construct_at(storage + size, v); + ++size; + } +}; +``` + + +## 仕様 +### デフォルトコンストラクタの規則 + +共用体のデフォルトコンストラクタは、以下の条件を満たす場合にトリビアルとなる: + +- デフォルトメンバ初期化子をもつメンバがない + +トリビアルなデフォルトコンストラクタは、いかなる初期化も実行しない。ただし、共用体の最初の選択肢 (variant member) が暗黙的寿命型 (implicit-lifetime type) の場合は、そのオブジェクトの寿命が開始され、アクティブメンバとなる。 + +```cpp +// トリビアルデフォルトコンストラクタ、トリビアルデストラクタ +// sの寿命は開始されない +union U1 { std::string s; }; + +// 非トリビアルデフォルトコンストラクタ (デフォルトメンバ初期化子がある) +// デストラクタは削除される +union U2 { std::string s = "hello"; }; + +// トリビアルデフォルトコンストラクタ、トリビアルデストラクタ +// s (配列は暗黙的寿命型) の寿命が開始され、アクティブメンバとなる +union U3 { std::string s[10]; }; +``` + +### デストラクタの規則 + +共用体のデストラクタは、デフォルトメンバ初期化子をもつメンバが非トリビアルなデストラクタをもつ場合に削除される。それ以外の場合、デストラクタはトリビアルとなる。 + +```cpp +// トリビアルデストラクタ (デフォルトメンバ初期化子なし) +union U4 { std::string s; }; + +// 削除されたデストラクタ (デフォルトメンバ初期化子があり、std::stringは非トリビアルデストラクタ) +union U5 { std::string s = "hello"; }; + +// トリビアルデストラクタ (デフォルトメンバ初期化子はあるが、intはトリビアルデストラクタ) +union U6 { std::string s; int n = 0; }; +``` + +### constexprでの使用 +この変更により、共用体を未初期化ストレージとして`constexpr`の文脈で使用できるようになる。 + +```cpp example +#include +#include + +constexpr int f() { + union { int s[4]; }; + // sは暗黙的寿命型の配列なので、寿命が開始されアクティブメンバとなる + std::construct_at(&s[0], 1); + std::construct_at(&s[1], 2); + std::construct_at(&s[2], 3); + return s[0] + s[1] + s[2]; +} + +int main() { + static_assert(f() == 6); +} +``` +* std::construct_at[link /reference/memory/construct_at.md] + +### 既存コードへの影響 +- これまで削除されていたコンストラクタ/デストラクタがトリビアルになるケースがあるため、以前はコンパイルエラーだったコードがコンパイル可能になる +- すでに有効なコードの意味は変わらない +- 未初期化オブジェクトへのアクセスは依然として未定義動作 + + +## 備考 +### `inplace_vector`への影響 +この変更により、[`std::inplace_vector`](/reference/inplace_vector.md)コンテナが非トリビアルな要素型をもつ場合でも`constexpr`で使用できるようになる。 + +### 非トリビアルデストラクタの実行時コスト +「なにもしないデストラクタ」であっても非トリビアルである場合、コンパイラはデストラクタの呼び出しコードを生成する必要があり、最適化が妨げられる場合がある。デストラクタがトリビアルであればそのようなコードは不要であり、`new[]`式でのcookie (配列要素数の管理情報) も不要になる。 + + +## この機能が必要になった背景・経緯 +`constexpr`プログラミングにおいて、未初期化のストレージを扱う需要がある。実行時プログラミングでは`alignas(T) unsigned char buffer[sizeof(T)]`のようなバイト配列を使用できるが、この手法は`constexpr`では動作しない。 + +代わりに共用体を使用するのが自然なアプローチであるが、非トリビアルな型をメンバにもつ共用体はデフォルトコンストラクタとデストラクタが暗黙的に削除されてしまうため、「なにももしない」コンストラクタとデストラクタを明示的に定義する必要があった。しかし、明示的に定義された「なにももしない」デストラクタはトリビアルではなく、実行時のパフォーマンスコストが発生していた。 + +この仕様変更により、共用体のコンストラクタとデストラクタの規則を改善し、未初期化ストレージとしての使用を`constexpr`と実行時の両方でゼロコストにする。 + + +## 関連項目 +- [C++11 `constexpr`](/lang/cpp11/constexpr.md) +- [C++26 `constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md) +- [C++26 定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) +- [`std::inplace_vector`](/reference/inplace_vector/inplace_vector.md) + + +## 参照 +- [P3074R7 trivial unions (was std::uninitialized)](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3074r7.html) diff --git a/reference/inplace_vector/inplace_vector.md b/reference/inplace_vector/inplace_vector.md index c34ec412f9..63192e2a38 100644 --- a/reference/inplace_vector/inplace_vector.md +++ b/reference/inplace_vector/inplace_vector.md @@ -265,6 +265,10 @@ size: 3 - [Visual C++](/implementation.md#visual_cpp): 2026 Update 2 [mark noimpl] +## 関連項目 +- [C++26 共用体の特殊メンバ関数のトリビアル化](/lang/cpp26/trivial_unions.md) + + ## 参照 - [P0843R14 `inplace_vector`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) - [P3074R7 Trivial Unions (was `std::uninitialized`)](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3074r7.html) From 321f8d140117e4fa3530ed309c7233aaa4598df3 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Mon, 6 Apr 2026 18:09:22 +0900 Subject: [PATCH 2689/3948] =?UTF-8?q?=E3=82=A4=E3=83=B3=E3=83=87=E3=83=B3?= =?UTF-8?q?=E3=83=88=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lang/cpp26/trivial_unions.md | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/lang/cpp26/trivial_unions.md b/lang/cpp26/trivial_unions.md index bca9abfe90..418c69d5a8 100644 --- a/lang/cpp26/trivial_unions.md +++ b/lang/cpp26/trivial_unions.md @@ -15,25 +15,27 @@ C++26では、共用体 (`union`) のデフォルトコンストラクタとデ これにより、非トリビアルな型のメンバをもつ共用体を未初期化のストレージとして`constexpr`の文脈で使用できるようになる。 ```cpp -template +template struct FixedVector { - union { T storage[N]; }; - size_t size = 0; + union { T storage[N]; }; + std::size_t size = 0; - // C++23まで: unionのコンストラクタ/デストラクタが削除されるためコンパイルエラー - // C++26: OK。unionのコンストラクタ/デストラクタはトリビアル - constexpr FixedVector() = default; + // C++23まで: unionのコンストラクタ/デストラクタが削除されるためコンパイルエラー + // C++26: OK。unionのコンストラクタ/デストラクタはトリビアル + constexpr FixedVector() = default; - constexpr ~FixedVector() { - std::destroy(storage, storage + size); - } + constexpr ~FixedVector() { + std::destroy(storage, storage + size); + } - constexpr auto push_back(T const& v) -> void { - std::construct_at(storage + size, v); - ++size; - } + constexpr auto push_back(T const& v) -> void { + std::construct_at(storage + size, v); + ++size; + } }; ``` +* std::construct_at[link /reference/memory/construct_at.md] +* std::destroy[link /reference/memory/destroy.md] ## 仕様 From 657e3a95189a12d4dbc034dde4b4db26adb5d939 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 7 Apr 2026 15:36:39 +0900 Subject: [PATCH 2690/3948] =?UTF-8?q?optional=20:=20C++26=E3=81=A7?= =?UTF-8?q?=E3=81=AE=E5=8F=82=E7=85=A7=E3=81=B8=E3=81=AE=E9=83=A8=E5=88=86?= =?UTF-8?q?=E7=89=B9=E6=AE=8A=E5=8C=96=E3=81=AB=E5=AF=BE=E5=BF=9C=20#1498?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/optional/optional.md | 86 ++++++++++++++++++- reference/optional/optional/and_then.md | 34 +++++++- reference/optional/optional/emplace.md | 22 +++-- reference/optional/optional/op_arrow.md | 20 ++++- reference/optional/optional/op_assign.md | 17 +++- reference/optional/optional/op_constructor.md | 42 +++++++++ reference/optional/optional/op_deref.md | 18 +++- reference/optional/optional/op_destructor.md | 13 ++- reference/optional/optional/or_else.md | 19 +++- reference/optional/optional/transform.md | 29 ++++++- reference/optional/optional/value.md | 19 ++-- reference/optional/optional/value_or.md | 38 ++++++-- 12 files changed, 312 insertions(+), 45 deletions(-) diff --git a/reference/optional/optional.md b/reference/optional/optional.md index 08edd48c2e..e7087bb678 100644 --- a/reference/optional/optional.md +++ b/reference/optional/optional.md @@ -9,6 +9,10 @@ namespace std { template class optional; + // 参照に対する部分特殊化 (C++26) + template + class optional; + // viewコンセプトを有効化する (C++26) template @@ -17,6 +21,10 @@ namespace std { // std::formatによるフォーマットを無効化する (C++26) template constexpr auto format_kind> = range_format::disabled; + + // borrowed_rangeコンセプトを有効化する (C++26) + template + constexpr bool ranges::enable_borrowed_range> = true; } ``` @@ -41,7 +49,7 @@ namespace std { ## テンプレートパラメータ制約 -型`T`が以下のいずれかに該当してはならない: +プライマリテンプレート`optional`の型`T`が以下のいずれかに該当してはならない: - 参照型 - (CV修飾された)[`std::in_place_t`](/reference/utility/in_place_t.md) @@ -50,11 +58,21 @@ namespace std { また、型`T`は[`std::destructible`](/reference/concepts/destructible.md)要件を満たすこと。 +## 参照に対する部分特殊化 (C++26) +このクラスは、`optional`のように参照を保持できる。内部的には`T`へのポインタとして保持され、代入時には参照先を再束縛 (rebind) する。 + +`optional`は以下の特徴をもつ: + +- ダングリング参照を防ぐため、一時オブジェクトから構築するオーバーロードは削除定義される +- 代入は参照先の再束縛 (rebind) を行う(参照先オブジェクトへの代入ではない) +- [`emplace()`](optional/emplace.md)は参照先の再束縛を行う意味論であるため、可変長引数版や[`std::initializer_list`](/reference/initializer_list/initializer_list.md)版はなく、単一引数のみ受け取る +- `optional`はトリビアルコピー可能 (trivially copyable) である +- モナド操作 ([`and_then()`](optional/and_then.md), [`transform()`](optional/transform.md), [`or_else()`](optional/or_else.md)) も使用可能 + + ## 備考 このクラスの前身となった[Boost Optional Library](https://boost.org/libs/optional)では、`optional`のように左辺値参照を要素型とした場合に、無効値の領域を最適化する機能が入っていた。 -標準ライブラリの`optional`クラスには現在、参照を持たせることはできない。 - ## メンバ関数 ### 構築・破棄 @@ -199,6 +217,64 @@ error ``` +### 参照型を保持する例 (C++26) +```cpp example +#include +#include +#include +#include + +// コンテナからの要素検索。見つからない場合は無効値を返す +std::optional + find_value(const std::map& m, int key) +{ + auto it = m.find(key); + if (it != m.end()) { + return it->second; // 要素への参照を返す (コピーは発生しない) + } + return std::nullopt; +} + +int main() +{ + std::map m = { + {1, "Alice"}, + {2, "Bob"}, + {3, "Charlie"} + }; + + // 値が見つかった場合 + if (auto name = find_value(m, 2)) { + // コピーではなく参照を保持しているため、効率的にアクセスできる + std::println("{}", name.value()); + } + + // 値が見つからなかった場合 + if (auto name = find_value(m, 99); !name) { + std::println("not found"); + } + + // モナド操作との組み合わせ + auto result = find_value(m, 1) + .transform([](const std::string& s) { return s.size(); }) + .value_or(0u); + std::println("{}", result); +} +``` +* std::nullopt[link nullopt_t.md] +* std::println[link /reference/print/println.md] +* name.value()[link optional/value.md] +* .transform[link optional/transform.md] +* .value_or[link optional/value_or.md] + +#### 出力 +``` +Bob +not found +5 +``` + + ## バージョン ### 言語 - C++17 @@ -230,3 +306,7 @@ error - [P0504R0 Revisiting in-place tag types for `any`/`optional`/`variant`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0504r0.html) - [LWG Issue 3196. `std::optional` is ill-formed is `T` is an array](https://wg21.cmeerw.net/lwg/issue3196) - [P0798R8 Monadic operations for std::optional](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0798r8.html) +- [P2988R12 `std::optional`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2988r12.pdf) + - C++26で参照型`T&`に対する部分特殊化を追加 +- [P3836R2 `optional` Should Be Trivially Copyable](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3836r2.html) + - C++26で`optional`がトリビアルコピー可能であることを保証 diff --git a/reference/optional/optional/and_then.md b/reference/optional/optional/and_then.md index f3d85ecb72..7f0b06836e 100644 --- a/reference/optional/optional/and_then.md +++ b/reference/optional/optional/and_then.md @@ -6,16 +6,28 @@ * cpp23[meta cpp] ```cpp -template constexpr auto and_then(F&& f) &; // (1) -template constexpr auto and_then(F&& f) &&; // (2) -template constexpr auto and_then(F&& f) const&; // (3) -template constexpr auto and_then(F&& f) const&&; // (4) +// optional版のオーバーロード +template constexpr auto and_then(F&& f) &; // (1) C++23 +template constexpr auto and_then(F&& f) &&; // (2) C++23 +template constexpr auto and_then(F&& f) const&; // (3) C++23 +template constexpr auto and_then(F&& f) const&&; // (4) C++23 + +// optional版のオーバーロード (C++26) +template constexpr auto and_then(F&& f) const; // (5) C++26 ``` ## 概要 有効値を保持していれば、値に対して`f`を適用した結果を`optional`として返す。 有効値を保持していなければ、[`std::nullopt`](../nullopt_t.md)を返す。 +- (1) : `*this`が非`const`左辺値の場合 +- (2) : `*this`が非`const`右辺値の場合 +- (3) : `*this`が`const`左辺値の場合 +- (4) : `*this`が`const`右辺値の場合 +- (5) : `optional`の場合 + +`optional`では (1)~(4) が定義され、`optional`では (5) のみが定義される。 + 実際には複数オーバーロードが提供されるが、大まかには下記シグニチャのようにみなせる。 `and_then`へは、引数リストに1個の`T`型をとり`std::optional`型を返す関数や関数オブジェクトを与える。 @@ -34,6 +46,7 @@ class optional { - (1), (3) : [`invoke_result_t`](/reference/type_traits/invoke_result.md)`` - (2), (4) : [`invoke_result_t`](/reference/type_traits/invoke_result.md)`` +- (5) : [`invoke_result_t`](/reference/type_traits/invoke_result.md)`` (説明専用メンバ`val`は`T*`型) [`remove_cvref_t`](/reference/type_traits/remove_cvref.md)``は`optional`の特殊化であること @@ -64,6 +77,17 @@ class optional { * std::move[link /reference/utility/move.md] * value()[link value.md] +- (5) : 次と等価 + + ```cpp + if (*this) { + return invoke(std::forward(f), *val); + } else { + return remove_cvref_t(); + } + ``` + * invoke[link /reference/functional/invoke.md] + ## 備考 `and_then`は、メソッドチェーンをサポートするモナド風(monadic)操作として導入された。 @@ -126,3 +150,5 @@ int main() ## 参照 - [P0798R8 Monadic operations for std::optional](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0798r8.html) +- [P2988R12 `std::optional`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2988r12.pdf) + - C++26で参照型`T&`に対する部分特殊化を追加 diff --git a/reference/optional/optional/emplace.md b/reference/optional/optional/emplace.md index 6d8b578cb3..cb5ee34832 100644 --- a/reference/optional/optional/emplace.md +++ b/reference/optional/optional/emplace.md @@ -6,6 +6,7 @@ * cpp17[meta cpp] ```cpp +// optional版のオーバーロード template T& emplace(Args&&... args); // (1) C++17 template @@ -15,6 +16,10 @@ template T& emplace(std::initializer_list il, Args&&... args); // (2) C++17 template constexpr T& emplace(std::initializer_list il, Args&&... args); // (2) C++23 + +// optional版のオーバーロード (C++26) +template +constexpr T& emplace(U&& u) noexcept(see below); // (3) C++26 ``` ## 概要 @@ -22,17 +27,21 @@ constexpr T& emplace(std::initializer_list il, Args&&... args); // (2) C++23 - (1) : 可変個の引数をとり、それを型`T`のコンストラクタ引数として渡して、この関数内で型`T`の有効値を構築して保持する - (2) : 初期化子リストと可変個の引数をとり、それらを型`T`のコンストラクタ引数として渡して、この関数内で型`T`の有効値を構築して保持する +- (3) : `optional`の参照先を再束縛する。変換可能な単一引数を受け取る + +`optional`では (1), (2) が定義され、`optional`では (3) のみが定義される。 -## 要件 +## テンプレートパラメータ制約 - (1) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true`であること +- (3) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true`であり、[`reference_constructs_from_temporary_v`](/reference/type_traits/reference_constructs_from_temporary.md)` == false`であること ## 効果 -まず、共通の動作として、[`reset()`](reset.md)メンバ関数を呼び出す。 - -- (1) : 型`T`の有効値を、[`std::forward`](/reference/utility/forward.md)`(args)...`を引数として構築する -- (2) : 型`T`の有効値を、`il`と[`std::forward`](/reference/utility/forward.md)`(args)...`を引数として構築する +- (1), (2) : まず[`reset()`](reset.md)メンバ関数を呼び出す + - (1) : 型`T`の有効値を、[`std::forward`](/reference/utility/forward.md)`(args)...`を引数として構築する + - (2) : 型`T`の有効値を、`il`と[`std::forward`](/reference/utility/forward.md)`(args)...`を引数として構築する +- (3) : 参照先を`u`に再束縛する ## 戻り値 @@ -49,6 +58,7 @@ constexpr T& emplace(std::initializer_list il, Args&&... args); // (2) C++23 ## 備考 - (2) : このオーバーロードは主に、コンテナをアロケータ付きで、初期化子リスト代入するためにある +- (3) : 一時オブジェクトから参照を構築するとダングリングになるケースでは、このオーバーロードは削除定義される ## 例 @@ -114,3 +124,5 @@ int main() - [LWG Issue 2857. {`variant`,`optional`,`any`}`::emplace` should return the constructed value](https://wg21.cmeerw.net/lwg/issue2857) - [P0084R2 Emplace Return Type (Revision 2)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0084r2.pdf) - [P2231R1 Missing `constexpr` in `std::optional` and `std::variant`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2231r1.html) +- [P2988R12 `std::optional`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2988r12.pdf) + - C++26で参照型`T&`に対する部分特殊化を追加 diff --git a/reference/optional/optional/op_arrow.md b/reference/optional/optional/op_arrow.md index 87b6fda9bf..c55007c74f 100644 --- a/reference/optional/optional/op_arrow.md +++ b/reference/optional/optional/op_arrow.md @@ -6,20 +6,32 @@ * cpp17[meta cpp] ```cpp -constexpr const T* operator->() const; -constexpr T* operator->(); +// optional版のオーバーロード +constexpr const T* operator->() const; // (1) C++17 +constexpr T* operator->(); // (2) C++17 + +// optional版のオーバーロード (C++26) +constexpr T* operator->() const noexcept; // (3) C++26 ``` ## 概要 保持している有効値のメンバにアクセスする。 +- (1) : `optional`のconst版。`const T*`を返す +- (2) : `optional`の非const版。`T*`を返す +- (3) : `optional`の場合。`T*`を返す + +`optional`では (1), (2) が定義され、`optional`では (3) のみが定義される。 + ## 堅牢化された事前条件 `*this`が有効な値を保持していること ## 戻り値 -保持している有効値へのポインタを返す。 +- (1) : 有効値への`const T*` +- (2) : 有効値への`T*` +- (3) : 参照先への`T*` ## 例外 @@ -72,3 +84,5 @@ int main() - [LWG Issue 2740. `constexpr optional::operator->`](https://wg21.cmeerw.net/lwg/issue2740) - [P3471R4 Standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3471r4.html) - [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) +- [P2988R12 `std::optional`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2988r12.pdf) + - C++26で参照型`T&`に対する部分特殊化を追加 diff --git a/reference/optional/optional/op_assign.md b/reference/optional/optional/op_assign.md index 1aa210d178..e165ce6a17 100644 --- a/reference/optional/optional/op_assign.md +++ b/reference/optional/optional/op_assign.md @@ -29,6 +29,9 @@ template optional& operator=(optional&& rhs); // (6) C++17 template constexpr optional& operator=(optional&& rhs); // (6) C++23 + +// optional固有のオーバーロード (C++26) +constexpr optional& operator=(const optional&) noexcept = default; // (7) C++26 ``` * nullopt_t[link /reference/optional/nullopt_t.md] @@ -39,6 +42,9 @@ constexpr optional& operator=(optional&& rhs); // (6) C++23 - (4) : 要素型`T`に変換可能な値をムーブ代入 - (5) : `optional`に変換可能な`optional`オブジェクトをコピー代入 - (6) : `optional`に変換可能な`optional`オブジェクトをムーブ代入 +- (7) : `optional`のコピー代入。参照先の再束縛 (rebind) を行う (`noexcept = default`) + +`optional`では (1)~(6) が定義される。`optional`では (1), (7) が定義される。 ## テンプレートパラメータ制約 @@ -46,7 +52,7 @@ constexpr optional& operator=(optional&& rhs); // (6) C++23 ## 効果 -いずれのオーバーロードでも、`*this` と `rhs` が有効な値を持っているか否かによって以下のような挙動となる。 +(1)~(6) では、`*this` と `rhs` が有効な値を持っているか否かによって以下のような挙動となる。 | | `*this` が有効な値を持っている | `*this` が有効な値を持っていない | |------------------------------------|-----------------------------------------------------------------------|----------------------------------------------------------------------| @@ -61,6 +67,8 @@ constexpr optional& operator=(optional&& rhs); // (6) C++23 - (3), (6): [`std::move`](../../utility/move.md)`(*rhs)` - (4): [`std::forward`](../../utility/forward.md)`(rhs)` +(7) では、`rhs`が保持する参照先ポインタをコピーする (参照先の再束縛)。 + ## 戻り値 `*this` @@ -87,6 +95,11 @@ constexpr optional& operator=(optional&& rhs); // (6) C++23 - (2) : 型`T`が、[トリビアルにコピー構築可能](/reference/type_traits/is_trivially_copy_constructible.md)であり[トリビアルにコピー代入可能](/reference/type_traits/is_trivially_copy_assignable.md)かつ、[トリビアルに破棄可能](/reference/type_traits/is_trivially_destructible.md)である - (3) : 型`T`が、[トリビアルにムーブ構築可能](/reference/type_traits/is_trivially_move_constructible.md)であり[トリビアルにムーブ代入可能](/reference/type_traits/is_nothrow_move_assignable.md)かつ、[トリビアルに破棄可能](/reference/type_traits/is_trivially_destructible.md)である +## 備考 +- (7) : `optional`への代入は、参照先オブジェクトへの代入ではなく、参照先の再束縛 (rebind) を行う。これはポインタの代入と同じセマンティクスである +- `optional`では、値の代入や異なる型の`optional`からの変換代入は提供されない。値を代入する場合は、暗黙の変換による`optional`の構築とコピー代入 (7) を通じて行われる + + ## 例 ```cpp example #include @@ -180,3 +193,5 @@ int main() - [LWG Issue 2756. `optional` should `forward` `T`'s implicit conversions](https://wg21.cmeerw.net/lwg/issue2756) - [P0602R4 `variant` and `optional` should propagate copy/move triviality](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0602r4.html) - [P2231R1 Missing `constexpr` in `std::optional` and `std::variant`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2231r1.html) +- [P2988R12 `std::optional`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2988r12.pdf) + - C++26で参照型`T&`に対する部分特殊化を追加 diff --git a/reference/optional/optional/op_constructor.md b/reference/optional/optional/op_constructor.md index 3b5095f05c..34185a2fad 100644 --- a/reference/optional/optional/op_constructor.md +++ b/reference/optional/optional/op_constructor.md @@ -38,6 +38,29 @@ template explicit(see below) optional(optional&& rhs); // (9) C++20 template explicit(see below) constexpr optional(optional&& rhs); // (9) C++23 + +// optional固有のオーバーロード (C++26) +constexpr optional(const optional&) noexcept = default; // (10) C++26 + +template +constexpr explicit optional(in_place_t, Arg&& arg); // (11) C++26 + +template +constexpr explicit(see below) optional(U&& u) + noexcept(see below); // (12) C++26 + +template +constexpr explicit(see below) + optional(optional& rhs) noexcept(see below); // (13) C++26 +template +constexpr explicit(see below) + optional(const optional& rhs) noexcept(see below); // (14) C++26 +template +constexpr explicit(see below) + optional(optional&& rhs) noexcept(see below); // (15) C++26 +template +constexpr explicit(see below) + optional(const optional&& rhs) noexcept(see below); // (16) C++26 ``` * EXPLICIT[italic] * nullopt_t[link /reference/optional/nullopt_t.md] @@ -52,6 +75,15 @@ explicit(see below) constexpr optional(optional&& rhs); // (9) C++23 - (7) : 型`T`に変換可能な型`U`の値を有効値として受け取り、ムーブして保持する - (8) : 変換可能な`optional`オブジェクトからコピー構築する - (9) : 変換可能な`optional`オブジェクトからムーブ構築する +- (10) : `optional`のコピーコンストラクタ (`noexcept = default`) +- (11) : `optional`を`in_place_t`と単一引数から構築する +- (12) : `optional`を型`T&`に変換可能な値から構築する +- (13) : `optional`を非const左辺値参照の`optional`オブジェクトから構築する +- (14) : `optional`をconst左辺値参照の`optional`オブジェクトから構築する +- (15) : `optional`を非const右辺値参照の`optional`オブジェクトから構築する +- (16) : `optional`をconst右辺値参照の`optional`オブジェクトから構築する + +`optional`では (1)~(9) が定義される。`optional`では (1), (2) および (10)~(16) が定義される。 ## テンプレートパラメータ制約 @@ -60,6 +92,9 @@ explicit(see below) constexpr optional(optional&& rhs); // (9) C++23 - (7) : 型`U`から型`T`がムーブ構築可能であること - (8) : 型`U`から型`T`がコピー構築可能であること - (9) : 型`U`から型`T`がムーブ構築可能であること +- (11) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true`であり、[`reference_constructs_from_temporary_v`](/reference/type_traits/reference_constructs_from_temporary.md)` == false`であること +- (12) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true`であること +- (13)~(16) : [`is_constructible_v`](/reference/type_traits/is_constructible.md)` == true`であること (型`U`は`rhs`の要素型) ## 効果 @@ -71,6 +106,10 @@ explicit(see below) constexpr optional(optional&& rhs); // (9) C++23 - (7) : `rhs`を有効値として、`*this`にムーブする - (8) : `rhs`が有効値を保持していれば、それを`*this`にコピーする - (9) : `rhs`が有効値を保持していれば、それを`*this`にムーブする +- (10) : `rhs`が有効値 (参照先) を保持していれば、そのポインタを`*this`にコピーする +- (11) : `arg`への参照を有効値として保持する +- (12) : `u`への参照を有効値として保持する +- (13)~(16) : `rhs`が有効値を保持していれば、その参照先を`*this`の参照先として保持する ## 例外 @@ -108,6 +147,7 @@ explicit(see below) constexpr optional(optional&& rhs); // (9) C++23 ## 備考 - (5) : [`std::in_place_t`](/reference/utility/in_place_t.md)はオーバーロードに機能名を付けるためにあり、その型による動的な処理内容への影響はない。このオーバーロードを選択したい場合は、事前定義されている定数[`std::in_place`](/reference/utility/in_place_t.md)を第1引数として指定すること +- (10)~(16) : ダングリング参照を防ぐため、一時オブジェクトから参照を構築するオーバーロードは削除定義される ## 例 @@ -230,3 +270,5 @@ int main() - C++20での`explicit(bool)`構文への対応 - [P0602R4 `variant` and `optional` should propagate copy/move triviality](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0602r4.html) - [P2231R1 Missing `constexpr` in `std::optional` and `std::variant`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2231r1.html) +- [P2988R12 `std::optional`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2988r12.pdf) + - C++26で参照型`T&`に対する部分特殊化を追加 diff --git a/reference/optional/optional/op_deref.md b/reference/optional/optional/op_deref.md index 1a456fd7ef..2ffbb1b5bf 100644 --- a/reference/optional/optional/op_deref.md +++ b/reference/optional/optional/op_deref.md @@ -6,10 +6,14 @@ * cpp17[meta cpp] ```cpp -constexpr T& operator*() &; // (1) -constexpr T&& operator*() &&; // (2) -constexpr const T& operator*() const&; // (3) -constexpr const T&& operator*() const&&; // (4) +// optional版のオーバーロード +constexpr T& operator*() &; // (1) C++17 +constexpr T&& operator*() &&; // (2) C++17 +constexpr const T& operator*() const&; // (3) C++17 +constexpr const T&& operator*() const&&; // (4) C++17 + +// optional版のオーバーロード (C++26) +constexpr T& operator*() const noexcept; // (5) C++26 ``` ## 概要 @@ -19,6 +23,9 @@ constexpr const T&& operator*() const&&; // (4) - (2) : `*this` が非 `const` 右辺値である場合に、有効値への非 `const` 右辺値参照を返す - (3) : `*this` が `const` 左辺値である場合に、有効値への `const` 左辺値参照を返す - (4) : `*this` が `const` 右辺値である場合に、有効値への `const` 右辺値参照を返す +- (5) : `optional`の場合に、参照先への左辺値参照を返す + +`optional`では (1)~(4) が定義され、`optional`では (5) のみが定義される。 ## 堅牢化された事前条件 @@ -30,6 +37,7 @@ constexpr const T&& operator*() const&&; // (4) - (2) : 有効値への非 `const` 右辺値参照 - (3) : 有効値への `const` 左辺値参照 - (4) : 有効値への `const` 右辺値参照 +- (5) : 参照先への`T&` ## 例外 @@ -86,3 +94,5 @@ int main() ## 参照 - [P3471R4 Standard library hardening](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3471r4.html) - [P3878R1 Standard library hardening should not use the 'observe' semantic](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3878r1.html) +- [P2988R12 `std::optional`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2988r12.pdf) + - C++26で参照型`T&`に対する部分特殊化を追加 diff --git a/reference/optional/optional/op_destructor.md b/reference/optional/optional/op_destructor.md index 5175ecb3f4..4211c7ec55 100644 --- a/reference/optional/optional/op_destructor.md +++ b/reference/optional/optional/op_destructor.md @@ -6,18 +6,21 @@ * cpp17[meta cpp] ```cpp -~optional(); // C++17 -constexpr ~optional(); // C++23 +~optional(); // (1) C++17 +constexpr ~optional(); // (1) C++23 ``` ## 概要 -`optional`オブジェクトを破棄する - +`optional`オブジェクトを破棄する。 ## 効果 有効値を保持している場合、型`T`が非トリビアルなデストラクタを持っているならデストラクタを呼び出す。有効値を保持していない場合は、なにもしない。 +## 備考 +- (1) : `optional`の場合、内部的にはポインタを保持しているだけであるため、デストラクタはトリビアル (`= default`) であり、破棄時に特別な処理はしない + + ## 例 ```cpp example #include @@ -78,3 +81,5 @@ int main() - [`std::vector`クラスのデストラクタ](/reference/vector/vector/op_destructor.md) - [`std::is_trivially_destructible`](/reference/type_traits/is_trivially_destructible.md) - [P2231R1 Missing `constexpr` in `std::optional` and `std::variant`](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2231r1.html) +- [P2988R12 `std::optional`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2988r12.pdf) + - C++26で参照型`T&`に対する部分特殊化を追加 diff --git a/reference/optional/optional/or_else.md b/reference/optional/optional/or_else.md index 9511b9ecc0..1f69d14466 100644 --- a/reference/optional/optional/or_else.md +++ b/reference/optional/optional/or_else.md @@ -6,14 +6,24 @@ * cpp23[meta cpp] ```cpp -template constexpr optional or_else(F&& f) const &; // (1) -template constexpr optional or_else(F&& f) &&; // (2) +// optional版のオーバーロード +template constexpr optional or_else(F&& f) const &; // (1) C++23 +template constexpr optional or_else(F&& f) &&; // (2) C++23 + +// optional版のオーバーロード (C++26) +template constexpr optional or_else(F&& f) const; // (3) C++26 ``` ## 概要 有効値を保持していれば、なにもしない。 有効値を保持していなければ、`f()`の呼び出し結果を`optional`として返す。 +- (1) : `*this`が`const`左辺値の場合 +- (2) : `*this`が右辺値の場合 +- (3) : `optional`の場合 + +`optional`では (1), (2) が定義され、`optional`では (3) のみが定義される。 + 実際には複数オーバーロードが提供されるが、大まかには下記シグニチャのようにみなせる。 `or_else`へは、空の引数リストをとり`std::optional`へ変換可能な`Return`型を返す関数や関数オブジェクトを与える。 @@ -30,6 +40,7 @@ class optional { ## テンプレートパラメータ制約 - (1) : `F`は[`invocable<>`](/reference/concepts/invocable.md)のモデル、かつ`T`は[`copy_constructible`](/reference/concepts/copy_constructible.md)のモデルであること - (2) : `F`は[`invocable<>`](/reference/concepts/invocable.md)のモデル、かつ`T`は[`move_constructible`](/reference/concepts/move_constructible.md)のモデルであること +- (3) : `F`は[`invocable<>`](/reference/concepts/invocable.md)のモデル、かつ`T`は[`copy_constructible`](/reference/concepts/copy_constructible.md)のモデルであること ## 適格要件 @@ -37,7 +48,7 @@ class optional { ## 効果 -- (1) : 次と等価 +- (1), (3) : 次と等価 ```cpp if (*this) { @@ -158,3 +169,5 @@ int main() ## 参照 - [P0798R8 Monadic operations for std::optional](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0798r8.html) +- [P2988R12 `std::optional`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2988r12.pdf) + - C++26で参照型`T&`に対する部分特殊化を追加 diff --git a/reference/optional/optional/transform.md b/reference/optional/optional/transform.md index 17ceb6323b..2eb9ee224a 100644 --- a/reference/optional/optional/transform.md +++ b/reference/optional/optional/transform.md @@ -6,16 +6,30 @@ * cpp23[meta cpp] ```cpp -template constexpr auto transform(F&& f) &; // (1) -template constexpr auto transform(F&& f) &&; // (2) -template constexpr auto transform(F&& f) const&; // (3) -template constexpr auto transform(F&& f) const&&; // (4) +// optional版のオーバーロード +template constexpr auto transform(F&& f) &; // (1) C++23 +template constexpr auto transform(F&& f) &&; // (2) C++23 +template constexpr auto transform(F&& f) const&; // (3) C++23 +template constexpr auto transform(F&& f) const&&; // (4) C++23 + +// optional版のオーバーロード (C++26) +template +constexpr optional> + transform(F&& f) const; // (5) C++26 ``` ## 概要 有効値を保持していれば、値に対して`f`を適用した結果を`optional`に格納して返す。 有効値を保持していなければ、[`std::nullopt`](../nullopt_t.md)を返す。 +- (1) : `*this`が非`const`左辺値の場合 +- (2) : `*this`が非`const`右辺値の場合 +- (3) : `*this`が`const`左辺値の場合 +- (4) : `*this`が`const`右辺値の場合 +- (5) : `optional`の場合 + +`optional`では (1)~(4) が定義され、`optional`では (5) のみが定義される。 + 実際には複数オーバーロードが提供されるが、大まかには下記シグニチャのようにみなせる。 `transform`へは、引数リストに1個の`T`型をとり`Return`型を返す関数や関数オブジェクトを与える。 @@ -33,6 +47,7 @@ class optional { - (1), (3) : [`invoke_result_t`](/reference/type_traits/invoke_result.md)`` - (2), (4) : [`invoke_result_t`](/reference/type_traits/invoke_result.md)`` +- (5) : [`remove_cv_t`](/reference/type_traits/remove_cv.md)`<`[`invoke_result_t`](/reference/type_traits/invoke_result.md)`>` (説明専用メンバ`val`は`T*`型) ## 適格要件 @@ -42,11 +57,15 @@ class optional { - (2), (4) : - `U`型は[`in_place_t`](/reference/utility/in_place_t.md), [`nullopt_t`](../nullopt_t.md)いずれでもなく、非配列オブジェクト型であること。 - ある変数`u`の宣言 `U u(`[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`std::move`](/reference/utility/move.md)`(`[`value()`](value.md)`)));` が妥当であること。 +- (5) : + - `U`型は`optional`に対する有効な要素型であること。 + - ある変数`u`の宣言 `U u(`[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f), *val));` が妥当であること。 ## 効果 - (1), (3) : `*this`が有効値を保持するときは、[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`value()`](value.md)`)`で直接非リスト初期化した`optional`オブジェクトを返す。有効値を保持しないときは、`optional()`を返す。 - (2), (4) : `*this`が有効値を保持するときは、[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f),` [`std::move`](/reference/utility/move.md)`(`[`value()`](value.md)`))`で直接非リスト初期化した`optional`オブジェクトを返す。有効値を保持しないときは、`optional()`を返す。 +- (5) : `*this`が有効値を保持するときは、[`invoke`](/reference/functional/invoke.md)`(`[`std::forward`](/reference/utility/forward.md)`(f), *val)`で直接非リスト初期化した`optional`オブジェクトを返す。有効値を保持しないときは、`optional()`を返す。 ## 備考 @@ -102,3 +121,5 @@ int main() ## 参照 - [P0798R8 Monadic operations for std::optional](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0798r8.html) +- [P2988R12 `std::optional`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2988r12.pdf) + - C++26で参照型`T&`に対する部分特殊化を追加 diff --git a/reference/optional/optional/value.md b/reference/optional/optional/value.md index 0a8841ecf1..b231ea50fa 100644 --- a/reference/optional/optional/value.md +++ b/reference/optional/optional/value.md @@ -6,10 +6,14 @@ * cpp17[meta cpp] ```cpp -constexpr const T& value() const&; // (1) -constexpr T& value() &; // (2) -constexpr T&& value() &&; // (3) -constexpr const T&& value() const&&; // (4) +// optional版のオーバーロード +constexpr const T& value() const&; // (1) C++17 +constexpr T& value() &; // (2) C++17 +constexpr T&& value() &&; // (3) C++17 +constexpr const T&& value() const&&; // (4) C++17 + +// optional版のオーバーロード (C++26) +constexpr T& value() const; // (5) C++26 ``` ## 概要 @@ -19,10 +23,13 @@ constexpr const T&& value() const&&; // (4) - (2) : `*this`が非`const`左辺値である場合に、有効値への非`const`左辺値参照を返す - (3) : `*this`が右辺値である場合に、有効値への右辺値参照を返す - (4) : `*this`が`const`右辺値である場合に、有効値への`const`右辺値参照を返す +- (5) : `optional`の場合に、参照先への左辺値参照を返す + +`optional`では (1)~(4) が定義され、`optional`では (5) のみが定義される。 ## 効果 -- (1), (2) : 有効値を保持している場合、有効値への参照を返す +- (1), (2), (5) : 有効値を保持している場合、有効値への参照を返す - (3), (4) : 有効値を保持している場合、有効値をムーブして返す @@ -74,3 +81,5 @@ p2 exception : bad optional access ## 参照 - [getかvalueか - Faith and Brave - C++で遊ぼう](http://faithandbrave.hateblo.jp/entry/2014/08/05/151146) +- [P2988R12 `std::optional`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2988r12.pdf) + - C++26で参照型`T&`に対する部分特殊化を追加 diff --git a/reference/optional/optional/value_or.md b/reference/optional/optional/value_or.md index e52f665683..50c2e18b18 100644 --- a/reference/optional/optional/value_or.md +++ b/reference/optional/optional/value_or.md @@ -6,29 +6,44 @@ * cpp17[meta cpp] ```cpp +// optional版のオーバーロード template constexpr T value_or(U&& v) const&; // (1) template constexpr T value_or(U&& v) &&; // (2) + +// optional版のオーバーロード (C++26) +template > +constexpr remove_cv_t value_or(U&& u) const; // (3) C++26 ``` ## 概要 有効値もしくは指定された無効値を取得する。 -この関数は、`*this`が有効値を保持していれば有効値を返し、そうでなければ`v`を返す。 +- (1) : `*this`が`const`左辺値である場合。有効値を保持していれば有効値を返し、そうでなければ`v`を返す +- (2) : `*this`が右辺値である場合。有効値を保持していれば有効値をムーブして返し、そうでなければ`v`を返す +- (3) : `optional`の場合。有効値を保持していれば参照先の値を返し、そうでなければ`u`を返す + +`optional`では (1), (2) が定義され、`optional`では (3) のみが定義される。 ## 要件 -- [`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)` == true`であること -- [`is_convertible_v`](/reference/type_traits/is_convertible.md)` == true`であること +- (1), (2) : [`is_move_constructible_v`](/reference/type_traits/is_move_constructible.md)` == true`であること +- (1), (2) : [`is_convertible_v`](/reference/type_traits/is_convertible.md)` == true`であること ## 効果 -以下の式と等価の効果を持つ: +- (1), (2) : 以下の式と等価の効果を持つ: -```cpp -return has_value() ? value() : static_cast(std::forward(v)); -``` -* has_value()[link has_value.md] -* value()[link value.md] + ```cpp + return has_value() ? value() : static_cast(std::forward(v)); + ``` + * has_value()[link has_value.md] + * value()[link value.md] + +- (3) : 以下の式と等価の効果を持つ: + + ```cpp + return has_value() ? *val : std::forward(u); + ``` ## 例 @@ -71,3 +86,8 @@ int main() - [`optional::value()`](value.md) - [`optional::has_value()`](has_value.md) - [`optional::operator bool()`](op_bool.md) + + +## 参照 +- [P2988R12 `std::optional`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2988r12.pdf) + - C++26で参照型`T&`に対する部分特殊化を追加 From 1137947812b5c94b6f6a2366db85aa9a9ef8c895 Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 7 Apr 2026 16:14:17 +0900 Subject: [PATCH 2691/3948] =?UTF-8?q?C++26=20:=20=E3=80=8C=E3=83=97?= =?UTF-8?q?=E3=83=AA=E3=83=97=E3=83=AD=E3=82=BB=E3=83=83=E3=82=B5=E4=BB=95?= =?UTF-8?q?=E6=A7=98=E3=81=A7=E3=81=AE=E3=80=8C=E6=9C=AA=E5=AE=9A=E7=BE=A9?= =?UTF-8?q?=E5=8B=95=E4=BD=9C=E3=80=8D=E3=82=92=E4=B8=8D=E9=81=A9=E6=A0=BC?= =?UTF-8?q?=20(=E8=A8=BA=E6=96=AD=E4=B8=8D=E8=A6=81)=20=E3=81=AB=E5=A4=89?= =?UTF-8?q?=E6=9B=B4=E3=80=8D=E3=82=92=E8=BF=BD=E5=8A=A0=20(close=20#1496)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 2 +- lang/cpp26.md | 2 +- .../cpp26/preprocessing_is_never_undefined.md | 39 +++++++++++++++++++ 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 lang/cpp26/preprocessing_is_never_undefined.md diff --git a/implementation-status.md b/implementation-status.md index f6ae8fcc66..820ab5ee1f 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -329,7 +329,7 @@ | P2996R13: [静的リフレクション](/lang/cpp26/reflection.md.nolink) | リフレクション演算子`^^`と`std::meta::info`型によりコンパイル時にさまざまな情報を取得できる | | | | | | P1306R5: [コンパイル時のタプルやリストを展開処理する`template for`文](/lang/cpp26/expansion_statements.md.nolink) | クラス・タプル・Range・パラメータパックなどを展開してすべての要素をコンパイル時の処理する`template for`文を追加 | 16 | | | | | P3533R2: [`constexpr`仮想継承を許可](/lang/cpp26/constexpr_virtual_inheritance.md) | 定数式の文脈での仮想継承を許可 | 16 | | | | -| P2843R3: [プリプロセッサ仕様での「未定義動作」を不適格 (診断不要) に変更](/lang/cpp26/preprocessing_is_never_undefined.md.nolink) | プリプロセッサとレキサーの文脈での「未定義動作」用語を不適格 (診断不要) に変更 | 16 | | | | +| P2843R3: [プリプロセッサ仕様での「未定義動作」を不適格 (診断不要) に変更](/lang/cpp26/preprocessing_is_never_undefined.md) | プリプロセッサとレキサーの文脈での「未定義動作」用語を不適格 (診断不要) に変更 | 16 | | | | | P3868R1: [モジュール宣言より前での`#line`ディレクティブの使用を許可する](/lang/cpp26/allow_line_before_module_declarations.md) | モジュール宣言より前での`#line`ディレクティブの使用を禁止していたのは過度な制限だった | | | | | diff --git a/lang/cpp26.md b/lang/cpp26.md index 9d8edb1b10..a94b5047ef 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -89,7 +89,7 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| | [ファイルを読み込む`#embed`命令を追加](/lang/cpp26/embed.md) | バイナリファイルをインクルードするメカニズム。`#include`とちがって読み出しサイズなどの柔軟な指定ができる | -| [プリプロセッサ仕様での「未定義動作」を不適格 (診断不要) に変更](/lang/cpp26/preprocessing_is_never_undefined.md.nolink) | プリプロセッサとレキサーの文脈での「未定義動作」用語を不適格 (診断不要) に変更 | +| [プリプロセッサ仕様での「未定義動作」を不適格 (診断不要) に変更](/lang/cpp26/preprocessing_is_never_undefined.md) | プリプロセッサとレキサーの文脈での「未定義動作」用語を不適格 (診断不要) に変更 | ### ソースコード diff --git a/lang/cpp26/preprocessing_is_never_undefined.md b/lang/cpp26/preprocessing_is_never_undefined.md new file mode 100644 index 0000000000..72d0fb3869 --- /dev/null +++ b/lang/cpp26/preprocessing_is_never_undefined.md @@ -0,0 +1,39 @@ +# プリプロセッサ仕様での「未定義動作」を不適格 (診断不要) に変更 [P2843R3] +* cpp26[meta cpp] + + + +このページはC++26に採用される見込みの言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 + + + +## 概要 +C++26では、プリプロセッサおよびレキサーの仕様において「未定義動作 (undefined behavior)」と規定されていたすべてのケースを「不適格、診断不要 (ill-formed, no diagnostic required; IFNDR)」に変更する。 + +さらに、各ケースを個別に分析し、多くのケースで診断 (コンパイルエラー) を要求するか、適格なプログラムとして受理するよう仕様を改善する。 + +未定義動作は本来、適格なプログラムの実行時の動作に対する概念である。プリプロセッサはソースコードをコンパイル前に変換する処理であり、実行時の動作ではないため、「未定義動作」という用語は不適切であった。不適格 (診断不要) への変更は、コンパイラの振る舞いを実質的に変えるものではないが、仕様の正確性を向上させる。 + + +## 変更の対象 + +以下のプリプロセッサ機能において、従来「未定義動作」とされていた規定が変更される。 + +| 対象 | C++23までの規定 | C++26での変更 | +|------|---------------|-------------| +| `defined`演算子のマクロ展開による生成 | 未定義動作 | 不適格 (診断不要) | +| `#include`ディレクティブのマクロ展開後の不正な形式 | 未定義動作 | 不適格 (診断不要) | +| マクロ引数内のプリプロセッシングディレクティブ | 未定義動作 | 不適格 (診断不要) | +| `#`演算子の結果が不正な文字列リテラル | 未定義動作 | 不適格 (診断不要) | +| `##`演算子の結果が不正なプリプロセッシングトークン | 未定義動作 | 不適格 (診断不要) | +| `#line`ディレクティブの不正な値 (0や2147483647超) | 未定義動作 | 不適格 | +| 定義済みマクロ名の`#define`/`#undef` | 未定義動作 | 不適格 (診断不要) | +| キーワードと同名のマクロの`#define` | 未定義動作 | 不適格 | + +「不適格 (診断不要)」は、そのプログラムが規格に適合しないことを意味するが、コンパイラが診断メッセージ (エラーや警告) を出す義務はない。「不適格」は、コンパイラが診断メッセージを出す義務がある。 + + +## 参照 +- [P2843R3 Preprocessing is never undefined](https://open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2843r3.pdf) From 63488177bf10ac45615c3a59e8f90fedb9a41f5c Mon Sep 17 00:00:00 2001 From: Akira Takahashi Date: Tue, 7 Apr 2026 22:01:19 +0900 Subject: [PATCH 2692/3948] =?UTF-8?q?C++26:=20=E7=95=B3=E3=81=BF=E8=BE=BC?= =?UTF-8?q?=E3=81=BF=E5=BC=8F=E3=81=AE=E5=88=B6=E7=B4=84=E3=81=A8=E3=80=81?= =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=82=BB=E3=83=97=E3=83=88=E3=83=BB=E5=A4=89?= =?UTF-8?q?=E6=95=B0=E3=83=86=E3=83=B3=E3=83=97=E3=83=AC=E3=83=BC=E3=83=88?= =?UTF-8?q?=E3=81=AE=E3=83=86=E3=83=B3=E3=83=97=E3=83=AC=E3=83=BC=E3=83=88?= =?UTF-8?q?=E3=83=86=E3=83=B3=E3=83=97=E3=83=AC=E3=83=BC=E3=83=88=E3=83=91?= =?UTF-8?q?=E3=83=A9=E3=83=A1=E3=83=BC=E3=82=BF=E5=AF=BE=E5=BF=9C=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20(#1307=20#1447)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- implementation-status.md | 4 +- lang/cpp14/variable_templates.md | 1 + lang/cpp17/folding_expressions.md | 1 + lang/cpp20/concepts.md | 2 + lang/cpp26.md | 4 +- ...d_variable-template_template-parameters.md | 99 +++++++++++++++++++ lang/cpp26/feature_test_macros.md | 2 +- ..._constraints_involving_fold_expressions.md | 89 +++++++++++++++++ 8 files changed, 197 insertions(+), 5 deletions(-) create mode 100644 lang/cpp26/concept_and_variable-template_template-parameters.md create mode 100644 lang/cpp26/ordering_of_constraints_involving_fold_expressions.md diff --git a/implementation-status.md b/implementation-status.md index 820ab5ee1f..34b48971be 100644 --- a/implementation-status.md +++ b/implementation-status.md @@ -314,7 +314,7 @@ | P2893R3: [可変引数テンプレートで`friend`宣言をできるようにする](/lang/cpp26/variadic_friends.md) | クラステンプレートの可変引数テンプレートでまとめて`friend`宣言できるようにする | 15 | 20 | | | | P2747R2: [`constexpr`配置`new`](/lang/cpp26/constexpr_placement_new.md) | 定数式の文脈での配置`new`を許可 | 15 | 20 | | | | P3144R2: [不完全型へのポインタに対する`delete`を不適格とする](/lang/cpp26/deleting_a_pointer_to_an_incomplete_type_should_be_ill-formed.md) | 未定義動作を引き起こす操作をコンパイルエラーとする | 15 | 19 | | | -| P2963R3: [制約式内での畳み込み式の順序付け](/lang/cpp26/ordering_of_constraints_involving_fold_expressions.md.nolink) | 畳み込み式では全体ではなく個別の制約を原子制約式として扱う | | 19 | | | +| P2963R3: [制約式内での畳み込み式の順序付け](/lang/cpp26/ordering_of_constraints_involving_fold_expressions.md) | 畳み込み式を含む制約の包摂関係を認識できるようにし、オーバーロード解決の曖昧さを解消する | | 19 | | | | P0963R3: [条件式での構造化束縛の使用を許可](/lang/cpp26/structured_binding_declaration_as_a_condition.md) | 式全体を`bool`値に変換できる場合に条件式で構造化束縛を使用できることとする | 15 | | | | | P2686R5: [`constexpr`構造化束縛の許可と、`constexpr`参照の制限緩和](/lang/cpp26/constexpr_structured_bindings_and_references_to_constexpr_variables.md) | 定数式に対する構造化束縛を許可し、関連して`constexpr`参照の制限を緩和して自動変数も参照できるようにする | | | | | | P3068R6: [定数評価での例外送出を許可](/lang/cpp26/allowing_exception_throwing_in_constant-evaluation.md) | 定数式の文脈での例外の送出と捕捉を許可 | | | | | @@ -323,7 +323,7 @@ | P3176R0: [先行するカンマのない省略記号を非推奨化](/lang/cpp26/the_oxford_variadic_comma.md) | `void f(int, ...);`はOK。`void f(int...);`は非推奨 | 15 | 20 | | | | P3074R7: [共用体の特殊メンバ関数のトリビアル化](/lang/cpp26/trivial_unions.md) | 非トリビアルな型をメンバにもつ共用体のデフォルトコンストラクタとデストラクタをトリビアルにし、未初期化ストレージとして使用可能にする | | | | | | P2900R14: [契約プログラミングをサポートする](/lang/cpp26/contracts.md) | 関数の事前条件、事後条件、不変条件を記述できるようにする | | | | | -| P2841R7: [コンセプトと変数テンプレートにテンプレートテンプレートパラメータのサポートを追加](/lang/cpp26/concept_and_variable-template_template-parameters.md.nolink) | テンプレート引数をあとで指定するテンプレートテンプレートパラメータを、コンセプトと変数テンプレートでも使用できるようにする | | | | | +| P2841R7: [コンセプトと変数テンプレートをテンプレート引数として渡せるようにする](/lang/cpp26/concept_and_variable-template_template-parameters.md) | テンプレートテンプレートパラメータとして、クラステンプレートやエイリアステンプレートに加え、コンセプトと変数テンプレートも渡せるようにする | | | | | | P1967R14: [ファイルを読み込む`#embed`命令を追加](/lang/cpp26/embed.md) | バイナリファイルをインクルードするメカニズム。`#include`とちがって読み出しサイズなどの柔軟な指定ができる | 15 | | | | | P3618R0: [`main`関数をグローバルモジュールに含められるようにする](/lang/cpp26/allow_attaching_main_to_the_global_module.md) | `main`関数に`extern "C++"`を指定できるようにすることで名前付きモジュールに含められるようにする | 16 | 21 | | | | | P2996R13: [静的リフレクション](/lang/cpp26/reflection.md.nolink) | リフレクション演算子`^^`と`std::meta::info`型によりコンパイル時にさまざまな情報を取得できる | | | | | diff --git a/lang/cpp14/variable_templates.md b/lang/cpp14/variable_templates.md index 2727997438..4b57f06a02 100644 --- a/lang/cpp14/variable_templates.md +++ b/lang/cpp14/variable_templates.md @@ -132,6 +132,7 @@ auto main() -> int - [C++11 `constexpr`](/lang/cpp11/constexpr.md) - [C++17 変数テンプレートのデフォルトテンプレート引数を許可](/lang/cpp17/allow_default_template_arguments_of_variable_templates.md) - [C++23 変数テンプレートの部分特殊化を許可](/lang/cpp23/generalized_wording_for_partial_specializations.md) +- [C++26 コンセプトと変数テンプレートをテンプレート引数として渡せるようにする](/lang/cpp26/concept_and_variable-template_template-parameters.md) ## 参照 - [N3651 Variable Templates (Revision 1)](http://open-std.org/JTC1/SC22/WG21/docs/papers/2013/n3651.pdf) diff --git a/lang/cpp17/folding_expressions.md b/lang/cpp17/folding_expressions.md index a6feba34f8..673776b9ba 100644 --- a/lang/cpp17/folding_expressions.md +++ b/lang/cpp17/folding_expressions.md @@ -243,6 +243,7 @@ auto res = (std::string(args) + ...); ## 関連項目 - [C++11 可変引数テンプレート](/lang/cpp11/variadic_templates.md) - [`std::accumulate`](/reference/numeric/accumulate.md) — イテレータ範囲について累積的に二項演算を行う +- [C++26 制約式内での畳み込み式の順序付け](/lang/cpp26/ordering_of_constraints_involving_fold_expressions.md) ## 参照 diff --git a/lang/cpp20/concepts.md b/lang/cpp20/concepts.md index e5a1140568..97a29691ab 100644 --- a/lang/cpp20/concepts.md +++ b/lang/cpp20/concepts.md @@ -975,6 +975,8 @@ C++14の策定において、コンセプトの複雑さを回避して必要最 - [``](/reference/iterator.md) - [``](/reference/ranges.md) - [C++20 autoパラメータによる関数テンプレートの簡易定義](function_templates_with_auto_parameters.md) +- [C++26 制約式内での畳み込み式の順序付け](/lang/cpp26/ordering_of_constraints_involving_fold_expressions.md) +- [C++26 コンセプトと変数テンプレートをテンプレート引数として渡せるようにする](/lang/cpp26/concept_and_variable-template_template-parameters.md) ## 参照 diff --git a/lang/cpp26.md b/lang/cpp26.md index a94b5047ef..dab63c40ec 100644 --- a/lang/cpp26.md +++ b/lang/cpp26.md @@ -65,9 +65,9 @@ C++26とは、2026年中に改訂される予定の、C++バージョンの通 | 言語機能 | 説明 | |----------|------| | [パラメータパックへのインデックスアクセスを許可](/lang/cpp26/pack_indexing.md) | 可変引数テンプレートのパラメータパックに添字アクセスできるようにする | -| [制約式内での畳み込み式の順序付け](/lang/cpp26/ordering_of_constraints_involving_fold_expressions.md.nolink) | 畳み込み式では全体ではなく個別の制約を原子制約式として扱う | +| [制約式内での畳み込み式の順序付け](/lang/cpp26/ordering_of_constraints_involving_fold_expressions.md) | 畳み込み式を含む制約の包摂関係を認識できるようにし、オーバーロード解決の曖昧さを解消する | | [可変引数テンプレートで`friend`宣言をできるようにする](/lang/cpp26/variadic_friends.md) | クラステンプレートの可変引数テンプレートでまとめて`friend`宣言できるようにする | -| [コンセプトと変数テンプレートにテンプレートテンプレートパラメータのサポートを追加](/lang/cpp26/concept_and_variable-template_template-parameters.md.nolink) | テンプレート引数をあとで指定するテンプレートテンプレートパラメータを、コンセプトと変数テンプレートでも使用できるようにする | +| [コンセプトと変数テンプレートをテンプレート引数として渡せるようにする](/lang/cpp26/concept_and_variable-template_template-parameters.md) | テンプレートテンプレートパラメータとして、クラステンプレートやエイリアステンプレートに加え、コンセプトと変数テンプレートも渡せるようにする | ### 定数式 diff --git a/lang/cpp26/concept_and_variable-template_template-parameters.md b/lang/cpp26/concept_and_variable-template_template-parameters.md new file mode 100644 index 0000000000..6decc9f00b --- /dev/null +++ b/lang/cpp26/concept_and_variable-template_template-parameters.md @@ -0,0 +1,99 @@ +# コンセプトと変数テンプレートをテンプレート引数として渡せるようにする [P2841R7] +* cpp26[meta cpp] + + + +このページはC++26に採用される見込みの言語機能の変更を解説しています。 + +のちのC++規格でさらに変更される場合があるため[関連項目](#relative-page)を参照してください。 + + + +## 概要 +C++26では、テンプレートテンプレートパラメータとしてコンセプトおよび変数テンプレートを渡せるようになる。 + +C++23では、テンプレートテンプレートパラメータにはクラステンプレートまたはエイリアステンプレートのみを渡すことができた。変数テンプレートやコンセプトはテンプレートであるにもかかわらず、テンプレート引数として渡すことができなかった。 + +```cpp +// コンセプトテンプレートパラメータの構文 +template < + template concept C // コンセプトを受け取る +> +struct S {}; + +// 変数テンプレートテンプレートパラメータの構文 +template < + template auto V // 変数テンプレートを受け取る +> +struct T {}; + +template +concept MyConcept = true; + +template +constexpr auto MyVar = 42; + +S s; // OK (C++26) +T t; // OK (C++26) +``` + + +## 仕様 +### コンセプトテンプレートパラメータ +テンプレートパラメータリストにおいて、`concept`キーワードでコンセプトを受け取るパラメータを宣言できる。 + +```cpp +template